From 5e33902e8f1a2fe3ebca900ec7babd5420a076b7 Mon Sep 17 00:00:00 2001 From: support Date: Tue, 20 Sep 2022 09:00:04 +0000 Subject: [PATCH] Built motion from commit 875a1cf4.|2.6.15 --- apidoc/api_project.js | 2 +- apidoc/api_project.json | 2 +- npm-shrinkwrap.json | 3564 ++++++++++++++++++++ package.json | 1 + server/api/action/action.attributes.js | 2 +- server/api/action/action.controller.js | 2 +- server/api/action/action.model.js | 2 +- server/api/action/action.rpc.js | 2 +- server/api/action/index.js | 2 +- .../analyticCustomReport.attributes.js | 2 +- .../analyticCustomReport.controller.js | 2 +- .../analyticCustomReport.model.js | 2 +- .../analyticCustomReport.rpc.js | 2 +- server/api/analyticCustomReport/index.js | 2 +- .../analyticDefaultReport.attributes.js | 2 +- .../analyticDefaultReport.controller.js | 2 +- .../analyticDefaultReport.model.js | 2 +- .../analyticDefaultReport.rpc.js | 2 +- server/api/analyticDefaultReport/index.js | 2 +- .../analyticExtractedReport.attributes.js | 2 +- .../analyticExtractedReport.controller.js | 2 +- .../analyticExtractedReport.model.js | 2 +- .../analyticExtractedReport.rpc.js | 2 +- server/api/analyticExtractedReport/index.js | 2 +- .../analyticFieldReport.attributes.js | 2 +- .../analyticFieldReport.controller.js | 2 +- .../analyticFieldReport.model.js | 2 +- .../analyticFieldReport/analyticFieldReport.rpc.js | 2 +- server/api/analyticFieldReport/index.js | 2 +- .../analyticMetric/analyticMetric.attributes.js | 2 +- .../analyticMetric/analyticMetric.controller.js | 2 +- server/api/analyticMetric/analyticMetric.model.js | 2 +- server/api/analyticMetric/analyticMetric.rpc.js | 2 +- server/api/analyticMetric/index.js | 2 +- .../analyticTreeReport.attributes.js | 2 +- .../analyticTreeReport.controller.js | 2 +- .../analyticTreeReport/analyticTreeReport.model.js | 2 +- .../analyticTreeReport/analyticTreeReport.rpc.js | 2 +- server/api/analyticTreeReport/index.js | 2 +- server/api/attachment/attachment.attributes.js | 2 +- server/api/attachment/attachment.controller.js | 2 +- server/api/attachment/attachment.model.js | 2 +- server/api/attachment/attachment.rpc.js | 2 +- server/api/attachment/index.js | 2 +- .../authActiveDirectory.controller.js | 2 +- server/api/authActiveDirectory/index.js | 2 +- server/api/authGoogle/authGoogle.controller.js | 2 +- server/api/authGoogle/index.js | 2 +- server/api/authLocal/authLocal.controller.js | 2 +- server/api/authLocal/index.js | 2 +- server/api/automation/automation.attributes.js | 2 +- server/api/automation/automation.controller.js | 2 +- server/api/automation/automation.model.js | 2 +- server/api/automation/automation.rpc.js | 2 +- server/api/automation/index.js | 2 +- server/api/campaign/campaign.attributes.js | 2 +- server/api/campaign/campaign.controller.js | 2 +- server/api/campaign/campaign.model.js | 2 +- server/api/campaign/campaign.rpc.js | 2 +- server/api/campaign/index.js | 2 +- server/api/cannedAnswer/cannedAnswer.attributes.js | 2 +- server/api/cannedAnswer/cannedAnswer.controller.js | 2 +- server/api/cannedAnswer/cannedAnswer.model.js | 2 +- server/api/cannedAnswer/cannedAnswer.rpc.js | 2 +- server/api/cannedAnswer/index.js | 2 +- server/api/cdr/cdr.attributes.js | 2 +- server/api/cdr/cdr.controller.js | 2 +- server/api/cdr/cdr.model.js | 2 +- server/api/cdr/cdr.rpc.js | 2 +- server/api/cdr/index.js | 2 +- .../chatApplication/chatApplication.attributes.js | 2 +- .../chatApplication/chatApplication.controller.js | 2 +- .../api/chatApplication/chatApplication.model.js | 2 +- server/api/chatApplication/chatApplication.rpc.js | 2 +- server/api/chatApplication/index.js | 2 +- server/api/chatGroup/chatGroup.attributes.js | 2 +- server/api/chatGroup/chatGroup.controller.js | 2 +- server/api/chatGroup/chatGroup.events.js | 2 +- server/api/chatGroup/chatGroup.model.js | 2 +- server/api/chatGroup/chatGroup.rpc.js | 2 +- server/api/chatGroup/chatGroup.socket.js | 2 +- server/api/chatGroup/index.js | 2 +- .../chatInteraction/chatInteraction.attributes.js | 2 +- .../chatInteraction/chatInteraction.controller.js | 2 +- .../api/chatInteraction/chatInteraction.events.js | 2 +- .../api/chatInteraction/chatInteraction.model.js | 2 +- server/api/chatInteraction/chatInteraction.rpc.js | 2 +- .../api/chatInteraction/chatInteraction.socket.js | 2 +- server/api/chatInteraction/index.js | 2 +- .../chatInternalMessage.attributes.js | 2 +- .../chatInternalMessage.controller.js | 2 +- .../chatInternalMessage.events.js | 2 +- .../chatInternalMessage.model.js | 2 +- .../chatInternalMessage/chatInternalMessage.rpc.js | 2 +- .../chatInternalMessage.socket.js | 2 +- server/api/chatInternalMessage/index.js | 2 +- server/api/chatMessage/chatMessage.attributes.js | 2 +- server/api/chatMessage/chatMessage.controller.js | 2 +- server/api/chatMessage/chatMessage.events.js | 2 +- server/api/chatMessage/chatMessage.model.js | 2 +- server/api/chatMessage/chatMessage.rpc.js | 2 +- server/api/chatMessage/chatMessage.socket.js | 2 +- server/api/chatMessage/index.js | 2 +- .../chatOfflineMessage.attributes.js | 2 +- .../chatOfflineMessage.controller.js | 2 +- .../chatOfflineMessage.events.js | 2 +- .../chatOfflineMessage/chatOfflineMessage.model.js | 2 +- .../chatOfflineMessage/chatOfflineMessage.rpc.js | 2 +- server/api/chatOfflineMessage/index.js | 2 +- .../chatProactiveAction.attributes.js | 2 +- .../chatProactiveAction.controller.js | 2 +- .../chatProactiveAction.model.js | 2 +- .../chatProactiveAction/chatProactiveAction.rpc.js | 2 +- server/api/chatProactiveAction/index.js | 2 +- server/api/chatQueue/chatQueue.attributes.js | 2 +- server/api/chatQueue/chatQueue.controller.js | 2 +- server/api/chatQueue/chatQueue.events.js | 2 +- server/api/chatQueue/chatQueue.model.js | 2 +- server/api/chatQueue/chatQueue.rpc.js | 2 +- server/api/chatQueue/chatQueue.socket.js | 2 +- server/api/chatQueue/index.js | 2 +- .../chatQueueReport/chatQueueReport.attributes.js | 2 +- .../chatQueueReport/chatQueueReport.controller.js | 2 +- .../api/chatQueueReport/chatQueueReport.model.js | 2 +- server/api/chatQueueReport/chatQueueReport.rpc.js | 2 +- server/api/chatQueueReport/index.js | 2 +- .../chatTransferReport.attributes.js | 2 +- .../chatTransferReport.controller.js | 2 +- .../chatTransferReport/chatTransferReport.model.js | 2 +- .../chatTransferReport/chatTransferReport.rpc.js | 2 +- server/api/chatTransferReport/index.js | 2 +- server/api/chatWebsite/chatWebsite.attributes.js | 2 +- server/api/chatWebsite/chatWebsite.controller.js | 2 +- server/api/chatWebsite/chatWebsite.events.js | 2 +- server/api/chatWebsite/chatWebsite.model.js | 2 +- server/api/chatWebsite/chatWebsite.rpc.js | 2 +- server/api/chatWebsite/chatWebsite.socket.js | 2 +- server/api/chatWebsite/index.js | 2 +- server/api/client-side-logs.js | 2 +- .../api/cloudProvider/cloudProvider.attributes.js | 2 +- .../api/cloudProvider/cloudProvider.controller.js | 2 +- server/api/cloudProvider/cloudProvider.model.js | 2 +- server/api/cloudProvider/cloudProvider.oauth.js | 2 +- server/api/cloudProvider/cloudProvider.rpc.js | 2 +- server/api/cloudProvider/index.js | 2 +- server/api/cmCompany/cmCompany.attributes.js | 2 +- server/api/cmCompany/cmCompany.controller.js | 2 +- server/api/cmCompany/cmCompany.model.js | 2 +- server/api/cmCompany/cmCompany.rpc.js | 2 +- server/api/cmCompany/index.js | 2 +- server/api/cmContact/cmContact.attributes.js | 2 +- server/api/cmContact/cmContact.controller.js | 2 +- server/api/cmContact/cmContact.events.js | 2 +- server/api/cmContact/cmContact.model.js | 2 +- server/api/cmContact/cmContact.rpc.js | 2 +- server/api/cmContact/cmContact.socket.js | 2 +- server/api/cmContact/index.js | 2 +- .../cmContactHasItem.attributes.js | 2 +- .../cmContactHasItem.controller.js | 2 +- .../api/cmContactHasItem/cmContactHasItem.model.js | 2 +- .../api/cmContactHasItem/cmContactHasItem.rpc.js | 2 +- server/api/cmContactHasItem/index.js | 2 +- .../api/cmCustomField/cmCustomField.attributes.js | 2 +- .../api/cmCustomField/cmCustomField.controller.js | 2 +- server/api/cmCustomField/cmCustomField.model.js | 2 +- server/api/cmCustomField/cmCustomField.rpc.js | 2 +- server/api/cmCustomField/index.js | 2 +- server/api/cmHopper/cmHopper.attributes.js | 2 +- server/api/cmHopper/cmHopper.controller.js | 2 +- server/api/cmHopper/cmHopper.model.js | 2 +- server/api/cmHopper/cmHopper.rpc.js | 2 +- server/api/cmHopper/index.js | 2 +- .../cmHopperAdditionalPhone.attributes.js | 2 +- .../cmHopperAdditionalPhone.controller.js | 2 +- .../cmHopperAdditionalPhone.model.js | 2 +- .../cmHopperAdditionalPhone.rpc.js | 2 +- server/api/cmHopperAdditionalPhone/index.js | 2 +- .../api/cmHopperBlack/cmHopperBlack.attributes.js | 2 +- .../api/cmHopperBlack/cmHopperBlack.controller.js | 2 +- server/api/cmHopperBlack/cmHopperBlack.model.js | 2 +- server/api/cmHopperBlack/cmHopperBlack.rpc.js | 2 +- server/api/cmHopperBlack/index.js | 2 +- .../api/cmHopperFinal/cmHopperFinal.attributes.js | 2 +- .../api/cmHopperFinal/cmHopperFinal.controller.js | 2 +- server/api/cmHopperFinal/cmHopperFinal.model.js | 2 +- server/api/cmHopperFinal/cmHopperFinal.rpc.js | 2 +- server/api/cmHopperFinal/index.js | 2 +- .../cmHopperHistory/cmHopperHistory.attributes.js | 2 +- .../cmHopperHistory/cmHopperHistory.controller.js | 2 +- .../api/cmHopperHistory/cmHopperHistory.model.js | 2 +- server/api/cmHopperHistory/cmHopperHistory.rpc.js | 2 +- server/api/cmHopperHistory/index.js | 2 +- server/api/cmList/cmList.attributes.js | 2 +- server/api/cmList/cmList.controller.js | 2 +- server/api/cmList/cmList.events.js | 2 +- server/api/cmList/cmList.model.js | 2 +- server/api/cmList/cmList.rpc.js | 2 +- server/api/cmList/cmList.socket.js | 2 +- server/api/cmList/index.js | 2 +- server/api/condition/condition.attributes.js | 2 +- server/api/condition/condition.controller.js | 2 +- server/api/condition/condition.model.js | 2 +- server/api/condition/condition.rpc.js | 2 +- server/api/condition/index.js | 2 +- .../contactItemType/contactItemType.attributes.js | 2 +- .../contactItemType/contactItemType.controller.js | 2 +- .../api/contactItemType/contactItemType.model.js | 2 +- server/api/contactItemType/contactItemType.rpc.js | 2 +- server/api/contactItemType/index.js | 2 +- server/api/dashboard/dashboard.attributes.js | 2 +- server/api/dashboard/dashboard.controller.js | 2 +- server/api/dashboard/dashboard.events.js | 2 +- server/api/dashboard/dashboard.model.js | 2 +- server/api/dashboard/dashboard.rpc.js | 2 +- server/api/dashboard/dashboard.socket.js | 2 +- server/api/dashboard/index.js | 2 +- .../api/dashboardItem/dashboardItem.attributes.js | 2 +- .../api/dashboardItem/dashboardItem.controller.js | 2 +- server/api/dashboardItem/dashboardItem.events.js | 2 +- server/api/dashboardItem/dashboardItem.model.js | 2 +- server/api/dashboardItem/dashboardItem.rpc.js | 2 +- server/api/dashboardItem/dashboardItem.socket.js | 2 +- server/api/dashboardItem/index.js | 2 +- server/api/disposition/disposition.attributes.js | 2 +- server/api/disposition/disposition.controller.js | 2 +- server/api/disposition/disposition.model.js | 2 +- server/api/disposition/disposition.rpc.js | 2 +- server/api/disposition/index.js | 2 +- server/api/faxAccount/faxAccount.attributes.js | 2 +- server/api/faxAccount/faxAccount.controller.js | 2 +- server/api/faxAccount/faxAccount.events.js | 2 +- server/api/faxAccount/faxAccount.model.js | 2 +- server/api/faxAccount/faxAccount.rpc.js | 2 +- server/api/faxAccount/faxAccount.socket.js | 2 +- server/api/faxAccount/index.js | 2 +- .../faxApplication/faxApplication.attributes.js | 2 +- .../faxApplication/faxApplication.controller.js | 2 +- server/api/faxApplication/faxApplication.model.js | 2 +- server/api/faxApplication/faxApplication.rpc.js | 2 +- server/api/faxApplication/index.js | 2 +- .../faxInteraction/faxInteraction.attributes.js | 2 +- .../faxInteraction/faxInteraction.controller.js | 2 +- server/api/faxInteraction/faxInteraction.events.js | 2 +- server/api/faxInteraction/faxInteraction.model.js | 2 +- server/api/faxInteraction/faxInteraction.rpc.js | 2 +- server/api/faxInteraction/faxInteraction.socket.js | 2 +- server/api/faxInteraction/index.js | 2 +- server/api/faxMessage/faxMessage.attributes.js | 2 +- server/api/faxMessage/faxMessage.controller.js | 2 +- server/api/faxMessage/faxMessage.events.js | 2 +- server/api/faxMessage/faxMessage.model.js | 2 +- server/api/faxMessage/faxMessage.rpc.js | 2 +- server/api/faxMessage/faxMessage.socket.js | 2 +- server/api/faxMessage/index.js | 2 +- server/api/faxQueue/faxQueue.attributes.js | 2 +- server/api/faxQueue/faxQueue.controller.js | 2 +- server/api/faxQueue/faxQueue.events.js | 2 +- server/api/faxQueue/faxQueue.model.js | 2 +- server/api/faxQueue/faxQueue.rpc.js | 2 +- server/api/faxQueue/faxQueue.socket.js | 2 +- server/api/faxQueue/index.js | 2 +- .../faxQueueReport/faxQueueReport.attributes.js | 2 +- .../faxQueueReport/faxQueueReport.controller.js | 2 +- server/api/faxQueueReport/faxQueueReport.model.js | 2 +- server/api/faxQueueReport/faxQueueReport.rpc.js | 2 +- server/api/faxQueueReport/index.js | 2 +- .../faxTransferReport.attributes.js | 2 +- .../faxTransferReport.controller.js | 2 +- .../faxTransferReport/faxTransferReport.model.js | 2 +- .../api/faxTransferReport/faxTransferReport.rpc.js | 2 +- server/api/faxTransferReport/index.js | 2 +- server/api/intDeskAccount/index.js | 2 +- .../intDeskAccount/intDeskAccount.attributes.js | 2 +- .../intDeskAccount/intDeskAccount.controller.js | 2 +- server/api/intDeskAccount/intDeskAccount.model.js | 2 +- server/api/intDeskAccount/intDeskAccount.rpc.js | 2 +- server/api/intDeskConfiguration/index.js | 2 +- .../intDeskConfiguration.attributes.js | 2 +- .../intDeskConfiguration.controller.js | 2 +- .../intDeskConfiguration.model.js | 2 +- .../intDeskConfiguration.rpc.js | 2 +- server/api/intDeskField/index.js | 2 +- server/api/intDeskField/intDeskField.attributes.js | 2 +- server/api/intDeskField/intDeskField.controller.js | 2 +- server/api/intDeskField/intDeskField.model.js | 2 +- server/api/intDeskField/intDeskField.rpc.js | 2 +- server/api/intDynamics365Account/index.js | 2 +- .../intDynamics365Account.attributes.js | 2 +- .../intDynamics365Account.controller.js | 2 +- .../intDynamics365Account.model.js | 2 +- .../intDynamics365Account.rpc.js | 2 +- server/api/intDynamics365Configuration/index.js | 2 +- .../intDynamics365Configuration.attributes.js | 2 +- .../intDynamics365Configuration.controller.js | 2 +- .../intDynamics365Configuration.model.js | 2 +- .../intDynamics365Configuration.rpc.js | 2 +- server/api/intDynamics365Field/index.js | 2 +- .../intDynamics365Field.attributes.js | 2 +- .../intDynamics365Field.controller.js | 2 +- .../intDynamics365Field.model.js | 2 +- .../intDynamics365Field/intDynamics365Field.rpc.js | 2 +- server/api/intFreshdeskAccount/index.js | 2 +- .../intFreshdeskAccount.attributes.js | 2 +- .../intFreshdeskAccount.controller.js | 2 +- .../intFreshdeskAccount.model.js | 2 +- .../intFreshdeskAccount/intFreshdeskAccount.rpc.js | 2 +- server/api/intFreshdeskConfiguration/index.js | 2 +- .../intFreshdeskConfiguration.attributes.js | 2 +- .../intFreshdeskConfiguration.controller.js | 2 +- .../intFreshdeskConfiguration.model.js | 2 +- .../intFreshdeskConfiguration.rpc.js | 2 +- server/api/intFreshdeskField/index.js | 2 +- .../intFreshdeskField.attributes.js | 2 +- .../intFreshdeskField.controller.js | 2 +- .../intFreshdeskField/intFreshdeskField.model.js | 2 +- .../api/intFreshdeskField/intFreshdeskField.rpc.js | 2 +- server/api/intFreshsalesAccount/index.js | 2 +- .../intFreshsalesAccount.attributes.js | 2 +- .../intFreshsalesAccount.controller.js | 2 +- .../intFreshsalesAccount.model.js | 2 +- .../intFreshsalesAccount.rpc.js | 2 +- server/api/intFreshsalesConfiguration/index.js | 2 +- .../intFreshsalesConfiguration.attributes.js | 2 +- .../intFreshsalesConfiguration.controller.js | 2 +- .../intFreshsalesConfiguration.model.js | 2 +- .../intFreshsalesConfiguration.rpc.js | 2 +- server/api/intFreshsalesField/index.js | 2 +- .../intFreshsalesField.attributes.js | 2 +- .../intFreshsalesField.controller.js | 2 +- .../intFreshsalesField/intFreshsalesField.model.js | 2 +- .../intFreshsalesField/intFreshsalesField.rpc.js | 2 +- server/api/intSalesforceAccount/index.js | 2 +- .../intSalesforceAccount.attributes.js | 2 +- .../intSalesforceAccount.controller.js | 2 +- .../intSalesforceAccount.model.js | 2 +- .../intSalesforceAccount.rpc.js | 2 +- server/api/intSalesforceConfiguration/index.js | 2 +- .../intSalesforceConfiguration.attributes.js | 2 +- .../intSalesforceConfiguration.controller.js | 2 +- .../intSalesforceConfiguration.model.js | 2 +- .../intSalesforceConfiguration.rpc.js | 2 +- server/api/intSalesforceField/index.js | 2 +- .../intSalesforceField.attributes.js | 2 +- .../intSalesforceField.controller.js | 2 +- .../intSalesforceField/intSalesforceField.model.js | 2 +- .../intSalesforceField/intSalesforceField.rpc.js | 2 +- server/api/intServicenowAccount/index.js | 2 +- .../intServicenowAccount.attributes.js | 2 +- .../intServicenowAccount.controller.js | 2 +- .../intServicenowAccount.model.js | 2 +- .../intServicenowAccount.rpc.js | 2 +- server/api/intServicenowConfiguration/index.js | 2 +- .../intServicenowConfiguration.attributes.js | 2 +- .../intServicenowConfiguration.controller.js | 2 +- .../intServicenowConfiguration.model.js | 2 +- .../intServicenowConfiguration.rpc.js | 2 +- server/api/intServicenowField/index.js | 2 +- .../intServicenowField.attributes.js | 2 +- .../intServicenowField.controller.js | 2 +- .../intServicenowField/intServicenowField.model.js | 2 +- .../intServicenowField/intServicenowField.rpc.js | 2 +- server/api/intSugarcrmAccount/index.js | 2 +- .../intSugarcrmAccount.attributes.js | 2 +- .../intSugarcrmAccount.controller.js | 2 +- .../intSugarcrmAccount/intSugarcrmAccount.model.js | 2 +- .../intSugarcrmAccount/intSugarcrmAccount.rpc.js | 2 +- server/api/intSugarcrmConfiguration/index.js | 2 +- .../intSugarcrmConfiguration.attributes.js | 2 +- .../intSugarcrmConfiguration.controller.js | 2 +- .../intSugarcrmConfiguration.model.js | 2 +- .../intSugarcrmConfiguration.rpc.js | 2 +- server/api/intSugarcrmField/index.js | 2 +- .../intSugarcrmField.attributes.js | 2 +- .../intSugarcrmField.controller.js | 2 +- .../api/intSugarcrmField/intSugarcrmField.model.js | 2 +- .../api/intSugarcrmField/intSugarcrmField.rpc.js | 2 +- server/api/intVtigerAccount/index.js | 2 +- .../intVtigerAccount.attributes.js | 2 +- .../intVtigerAccount.controller.js | 2 +- .../api/intVtigerAccount/intVtigerAccount.model.js | 2 +- .../api/intVtigerAccount/intVtigerAccount.rpc.js | 2 +- server/api/intVtigerConfiguration/index.js | 2 +- .../intVtigerConfiguration.attributes.js | 2 +- .../intVtigerConfiguration.controller.js | 2 +- .../intVtigerConfiguration.model.js | 2 +- .../intVtigerConfiguration.rpc.js | 2 +- server/api/intVtigerField/index.js | 2 +- .../intVtigerField/intVtigerField.attributes.js | 2 +- .../intVtigerField/intVtigerField.controller.js | 2 +- server/api/intVtigerField/intVtigerField.model.js | 2 +- server/api/intVtigerField/intVtigerField.rpc.js | 2 +- server/api/intZendeskAccount/index.js | 2 +- .../intZendeskAccount.attributes.js | 2 +- .../intZendeskAccount.controller.js | 2 +- .../intZendeskAccount/intZendeskAccount.model.js | 2 +- .../api/intZendeskAccount/intZendeskAccount.rpc.js | 2 +- server/api/intZendeskConfiguration/index.js | 2 +- .../intZendeskConfiguration.attributes.js | 2 +- .../intZendeskConfiguration.controller.js | 2 +- .../intZendeskConfiguration.model.js | 2 +- .../intZendeskConfiguration.rpc.js | 2 +- server/api/intZendeskField/index.js | 2 +- .../intZendeskField/intZendeskField.attributes.js | 2 +- .../intZendeskField/intZendeskField.controller.js | 2 +- .../api/intZendeskField/intZendeskField.model.js | 2 +- server/api/intZendeskField/intZendeskField.rpc.js | 2 +- server/api/intZohoAccount/index.js | 2 +- .../intZohoAccount/intZohoAccount.attributes.js | 2 +- .../intZohoAccount/intZohoAccount.controller.js | 2 +- server/api/intZohoAccount/intZohoAccount.model.js | 2 +- server/api/intZohoAccount/intZohoAccount.rpc.js | 2 +- server/api/intZohoConfiguration/index.js | 2 +- .../intZohoConfiguration.attributes.js | 2 +- .../intZohoConfiguration.controller.js | 2 +- .../intZohoConfiguration.model.js | 2 +- .../intZohoConfiguration.rpc.js | 2 +- server/api/intZohoField/index.js | 2 +- server/api/intZohoField/intZohoField.attributes.js | 2 +- server/api/intZohoField/intZohoField.controller.js | 2 +- server/api/intZohoField/intZohoField.model.js | 2 +- server/api/intZohoField/intZohoField.rpc.js | 2 +- server/api/integration/index.js | 2 +- server/api/integration/integration.attributes.js | 2 +- server/api/integration/integration.controller.js | 2 +- server/api/integration/integration.model.js | 2 +- server/api/integration/integration.rpc.js | 2 +- server/api/integrationReport/index.js | 2 +- .../integrationReport.attributes.js | 2 +- .../integrationReport.controller.js | 2 +- .../integrationReport/integrationReport.model.js | 2 +- .../api/integrationReport/integrationReport.rpc.js | 2 +- server/api/interval/index.js | 2 +- server/api/interval/interval.attributes.js | 2 +- server/api/interval/interval.controller.js | 2 +- server/api/interval/interval.model.js | 2 +- server/api/interval/interval.rpc.js | 2 +- server/api/jira/index.js | 2 +- server/api/jira/jira.controller.js | 2 +- server/api/jscriptyAnswerReport/index.js | 2 +- .../jscriptyAnswerReport.attributes.js | 2 +- .../jscriptyAnswerReport.controller.js | 2 +- .../jscriptyAnswerReport.model.js | 2 +- .../jscriptyAnswerReport.rpc.js | 2 +- server/api/jscriptyProject/index.js | 2 +- .../jscriptyProject/jscriptyProject.attributes.js | 2 +- .../jscriptyProject/jscriptyProject.controller.js | 2 +- .../api/jscriptyProject/jscriptyProject.model.js | 2 +- server/api/jscriptyProject/jscriptyProject.rpc.js | 2 +- server/api/jscriptyQuestionReport/index.js | 2 +- .../jscriptyQuestionReport.attributes.js | 2 +- .../jscriptyQuestionReport.controller.js | 2 +- .../jscriptyQuestionReport.model.js | 2 +- .../jscriptyQuestionReport.rpc.js | 2 +- server/api/jscriptySessionReport/index.js | 2 +- .../jscriptySessionReport.attributes.js | 2 +- .../jscriptySessionReport.controller.js | 2 +- .../jscriptySessionReport.model.js | 2 +- .../jscriptySessionReport.rpc.js | 2 +- server/api/license/index.js | 2 +- server/api/license/license.attributes.js | 2 +- server/api/license/license.controller.js | 2 +- server/api/license/license.model.js | 2 +- server/api/license/license.rpc.js | 2 +- server/api/mailAccount/index.js | 2 +- server/api/mailAccount/mailAccount.attributes.js | 2 +- server/api/mailAccount/mailAccount.controller.js | 2 +- server/api/mailAccount/mailAccount.events.js | 2 +- server/api/mailAccount/mailAccount.model.js | 2 +- server/api/mailAccount/mailAccount.rpc.js | 2 +- server/api/mailAccount/mailAccount.socket.js | 2 +- server/api/mailApplication/index.js | 2 +- .../mailApplication/mailApplication.attributes.js | 2 +- .../mailApplication/mailApplication.controller.js | 2 +- .../api/mailApplication/mailApplication.model.js | 2 +- server/api/mailApplication/mailApplication.rpc.js | 2 +- server/api/mailInteraction/index.js | 2 +- .../mailInteraction/mailInteraction.attributes.js | 2 +- .../mailInteraction/mailInteraction.controller.js | 2 +- .../api/mailInteraction/mailInteraction.events.js | 2 +- .../api/mailInteraction/mailInteraction.model.js | 2 +- server/api/mailInteraction/mailInteraction.rpc.js | 2 +- .../api/mailInteraction/mailInteraction.socket.js | 2 +- server/api/mailMessage/index.js | 2 +- server/api/mailMessage/mailMessage.attributes.js | 2 +- server/api/mailMessage/mailMessage.controller.js | 2 +- server/api/mailMessage/mailMessage.events.js | 2 +- server/api/mailMessage/mailMessage.model.js | 2 +- server/api/mailMessage/mailMessage.rpc.js | 2 +- server/api/mailMessage/mailMessage.socket.js | 2 +- server/api/mailQueue/index.js | 2 +- server/api/mailQueue/mailQueue.attributes.js | 2 +- server/api/mailQueue/mailQueue.controller.js | 2 +- server/api/mailQueue/mailQueue.events.js | 2 +- server/api/mailQueue/mailQueue.model.js | 2 +- server/api/mailQueue/mailQueue.rpc.js | 2 +- server/api/mailQueue/mailQueue.socket.js | 2 +- server/api/mailQueueReport/index.js | 2 +- .../mailQueueReport/mailQueueReport.attributes.js | 2 +- .../mailQueueReport/mailQueueReport.controller.js | 2 +- .../api/mailQueueReport/mailQueueReport.model.js | 2 +- server/api/mailQueueReport/mailQueueReport.rpc.js | 2 +- server/api/mailServerIn/index.js | 2 +- server/api/mailServerIn/mailServerIn.attributes.js | 2 +- server/api/mailServerIn/mailServerIn.model.js | 2 +- server/api/mailServerIn/mailServerIn.rpc.js | 2 +- server/api/mailServerOut/index.js | 2 +- .../api/mailServerOut/mailServerOut.attributes.js | 2 +- .../api/mailServerOut/mailServerOut.controller.js | 2 +- server/api/mailServerOut/mailServerOut.model.js | 2 +- server/api/mailServerOut/mailServerOut.rpc.js | 2 +- server/api/mailSubstatus/index.js | 2 +- .../api/mailSubstatus/mailSubstatus.attributes.js | 2 +- .../api/mailSubstatus/mailSubstatus.controller.js | 2 +- server/api/mailSubstatus/mailSubstatus.events.js | 2 +- server/api/mailSubstatus/mailSubstatus.model.js | 2 +- server/api/mailSubstatus/mailSubstatus.rpc.js | 2 +- server/api/mailTransferReport/index.js | 2 +- .../mailTransferReport.attributes.js | 2 +- .../mailTransferReport.controller.js | 2 +- .../mailTransferReport/mailTransferReport.model.js | 2 +- .../mailTransferReport/mailTransferReport.rpc.js | 2 +- server/api/memberReport/index.js | 2 +- server/api/memberReport/memberReport.attributes.js | 2 +- server/api/memberReport/memberReport.controller.js | 2 +- server/api/memberReport/memberReport.model.js | 2 +- server/api/memberReport/memberReport.rpc.js | 2 +- server/api/migration/index.js | 2 +- server/api/migration/migration.attributes.js | 2 +- server/api/migration/migration.controller.js | 2 +- server/api/migration/migration.model.js | 2 +- server/api/migration/migration.rpc.js | 2 +- server/api/network/index.js | 2 +- server/api/network/network.attributes.js | 2 +- server/api/network/network.controller.js | 2 +- server/api/network/network.model.js | 2 +- server/api/network/network.rpc.js | 2 +- server/api/openchannelAccount/index.js | 2 +- .../openchannelAccount.attributes.js | 2 +- .../openchannelAccount.controller.js | 2 +- .../openchannelAccount.events.js | 2 +- .../openchannelAccount/openchannelAccount.model.js | 2 +- .../openchannelAccount/openchannelAccount.rpc.js | 2 +- .../openchannelAccount.socket.js | 2 +- server/api/openchannelApplication/index.js | 2 +- .../openchannelApplication.attributes.js | 2 +- .../openchannelApplication.controller.js | 2 +- .../openchannelApplication.model.js | 2 +- .../openchannelApplication.rpc.js | 2 +- server/api/openchannelInteraction/index.js | 2 +- .../openchannelInteraction.attributes.js | 2 +- .../openchannelInteraction.controller.js | 2 +- .../openchannelInteraction.events.js | 2 +- .../openchannelInteraction.model.js | 2 +- .../openchannelInteraction.rpc.js | 2 +- .../openchannelInteraction.socket.js | 2 +- server/api/openchannelMessage/index.js | 2 +- .../openchannelMessage.attributes.js | 2 +- .../openchannelMessage.controller.js | 2 +- .../openchannelMessage.events.js | 2 +- .../openchannelMessage/openchannelMessage.model.js | 2 +- .../openchannelMessage/openchannelMessage.rpc.js | 2 +- .../openchannelMessage.socket.js | 2 +- server/api/openchannelQueue/index.js | 2 +- .../openchannelQueue.attributes.js | 2 +- .../openchannelQueue.controller.js | 2 +- .../openchannelQueue/openchannelQueue.events.js | 2 +- .../api/openchannelQueue/openchannelQueue.model.js | 2 +- .../api/openchannelQueue/openchannelQueue.rpc.js | 2 +- .../openchannelQueue/openchannelQueue.socket.js | 2 +- server/api/openchannelQueueReport/index.js | 2 +- .../openchannelQueueReport.attributes.js | 2 +- .../openchannelQueueReport.controller.js | 2 +- .../openchannelQueueReport.model.js | 2 +- .../openchannelQueueReport.rpc.js | 2 +- server/api/openchannelTransferReport/index.js | 2 +- .../openchannelTransferReport.attributes.js | 2 +- .../openchannelTransferReport.controller.js | 2 +- .../openchannelTransferReport.model.js | 2 +- .../openchannelTransferReport.rpc.js | 2 +- server/api/pause/index.js | 2 +- server/api/pause/pause.attributes.js | 2 +- server/api/pause/pause.controller.js | 2 +- server/api/pause/pause.model.js | 2 +- server/api/pause/pause.rpc.js | 2 +- server/api/plugin/index.js | 2 +- server/api/plugin/plugin.attributes.js | 2 +- server/api/plugin/plugin.controller.js | 2 +- server/api/plugin/plugin.events.js | 2 +- server/api/plugin/plugin.model.js | 2 +- server/api/plugin/plugin.rpc.js | 2 +- server/api/plugin/plugin.socket.js | 2 +- server/api/pm2/index.js | 2 +- server/api/pm2/pm2.controller.js | 2 +- server/api/realtime/index.js | 2 +- server/api/realtime/realtime.controller.js | 2 +- server/api/reportAgentPreview/index.js | 2 +- .../reportAgentPreview.attributes.js | 2 +- .../reportAgentPreview/reportAgentPreview.model.js | 2 +- .../reportAgentPreview/reportAgentPreview.rpc.js | 2 +- server/api/rpc/index.js | 2 +- server/api/rpc/rpc.controller.js | 2 +- server/api/schedule/index.js | 2 +- server/api/schedule/schedule.attributes.js | 2 +- server/api/schedule/schedule.controller.js | 2 +- server/api/schedule/schedule.model.js | 2 +- server/api/schedule/schedule.rpc.js | 2 +- server/api/screenRecording/index.js | 2 +- .../screenRecording/screenRecording.attributes.js | 2 +- .../screenRecording/screenRecording.controller.js | 2 +- .../api/screenRecording/screenRecording.model.js | 2 +- server/api/screenRecording/screenRecording.rpc.js | 2 +- server/api/setting/index.js | 2 +- server/api/setting/setting.attributes.js | 2 +- server/api/setting/setting.controller.js | 2 +- server/api/setting/setting.model.js | 2 +- server/api/setting/setting.rpc.js | 2 +- server/api/smsAccount/index.js | 2 +- server/api/smsAccount/smsAccount.attributes.js | 2 +- server/api/smsAccount/smsAccount.controller.js | 2 +- server/api/smsAccount/smsAccount.events.js | 2 +- server/api/smsAccount/smsAccount.model.js | 2 +- server/api/smsAccount/smsAccount.rpc.js | 2 +- server/api/smsAccount/smsAccount.socket.js | 2 +- server/api/smsApplication/index.js | 2 +- .../smsApplication/smsApplication.attributes.js | 2 +- .../smsApplication/smsApplication.controller.js | 2 +- server/api/smsApplication/smsApplication.model.js | 2 +- server/api/smsApplication/smsApplication.rpc.js | 2 +- server/api/smsInteraction/index.js | 2 +- .../smsInteraction/smsInteraction.attributes.js | 2 +- .../smsInteraction/smsInteraction.controller.js | 2 +- server/api/smsInteraction/smsInteraction.events.js | 2 +- server/api/smsInteraction/smsInteraction.model.js | 2 +- server/api/smsInteraction/smsInteraction.rpc.js | 2 +- server/api/smsInteraction/smsInteraction.socket.js | 2 +- server/api/smsMessage/index.js | 2 +- server/api/smsMessage/smsMessage.attributes.js | 2 +- server/api/smsMessage/smsMessage.controller.js | 2 +- server/api/smsMessage/smsMessage.events.js | 2 +- server/api/smsMessage/smsMessage.model.js | 2 +- server/api/smsMessage/smsMessage.rpc.js | 2 +- server/api/smsMessage/smsMessage.socket.js | 2 +- server/api/smsQueue/index.js | 2 +- server/api/smsQueue/smsQueue.attributes.js | 2 +- server/api/smsQueue/smsQueue.controller.js | 2 +- server/api/smsQueue/smsQueue.events.js | 2 +- server/api/smsQueue/smsQueue.model.js | 2 +- server/api/smsQueue/smsQueue.rpc.js | 2 +- server/api/smsQueue/smsQueue.socket.js | 2 +- server/api/smsQueueReport/index.js | 2 +- .../smsQueueReport/smsQueueReport.attributes.js | 2 +- .../smsQueueReport/smsQueueReport.controller.js | 2 +- server/api/smsQueueReport/smsQueueReport.model.js | 2 +- server/api/smsQueueReport/smsQueueReport.rpc.js | 2 +- server/api/smsTransferReport/index.js | 2 +- .../smsTransferReport.attributes.js | 2 +- .../smsTransferReport.controller.js | 2 +- .../smsTransferReport/smsTransferReport.model.js | 2 +- .../api/smsTransferReport/smsTransferReport.rpc.js | 2 +- server/api/sound/index.js | 2 +- server/api/sound/sound.attributes.js | 2 +- server/api/sound/sound.controller.js | 2 +- server/api/sound/sound.model.js | 2 +- server/api/sound/sound.rpc.js | 2 +- server/api/squareMessage/index.js | 2 +- .../api/squareMessage/squareMessage.attributes.js | 2 +- .../api/squareMessage/squareMessage.controller.js | 2 +- server/api/squareMessage/squareMessage.model.js | 2 +- server/api/squareMessage/squareMessage.rpc.js | 2 +- server/api/squareOdbc/index.js | 2 +- server/api/squareOdbc/squareOdbc.attributes.js | 2 +- server/api/squareOdbc/squareOdbc.controller.js | 2 +- server/api/squareOdbc/squareOdbc.model.js | 2 +- server/api/squareOdbc/squareOdbc.rpc.js | 2 +- server/api/squareProject/index.js | 2 +- .../api/squareProject/squareProject.attributes.js | 2 +- .../api/squareProject/squareProject.controller.js | 2 +- server/api/squareProject/squareProject.events.js | 2 +- server/api/squareProject/squareProject.model.js | 2 +- server/api/squareProject/squareProject.rpc.js | 2 +- server/api/squareProject/squareProject.socket.js | 2 +- server/api/squareRecording/index.js | 2 +- .../squareRecording/squareRecording.attributes.js | 2 +- .../squareRecording/squareRecording.controller.js | 2 +- .../api/squareRecording/squareRecording.model.js | 2 +- server/api/squareRecording/squareRecording.rpc.js | 2 +- server/api/squareReport/index.js | 2 +- server/api/squareReport/squareReport.attributes.js | 2 +- server/api/squareReport/squareReport.controller.js | 2 +- server/api/squareReport/squareReport.model.js | 2 +- server/api/squareReport/squareReport.rpc.js | 2 +- server/api/squareReportDetail/index.js | 2 +- .../squareReportDetail.attributes.js | 2 +- .../squareReportDetail.controller.js | 2 +- .../squareReportDetail/squareReportDetail.model.js | 2 +- .../squareReportDetail/squareReportDetail.rpc.js | 2 +- server/api/system/index.js | 2 +- server/api/system/system.controller.js | 2 +- server/api/tag/index.js | 2 +- server/api/tag/tag.attributes.js | 2 +- server/api/tag/tag.controller.js | 2 +- server/api/tag/tag.model.js | 2 +- server/api/tag/tag.rpc.js | 2 +- server/api/team/index.js | 2 +- server/api/team/team.attributes.js | 2 +- server/api/team/team.controller.js | 2 +- server/api/team/team.events.js | 2 +- server/api/team/team.model.js | 2 +- server/api/team/team.rpc.js | 2 +- server/api/team/team.socket.js | 2 +- .../teamVoicePrefix/teamVoicePrefix.attributes.js | 2 +- .../api/teamVoicePrefix/teamVoicePrefix.model.js | 2 +- server/api/teamVoiceQueue/index.js | 2 +- .../teamVoiceQueue/teamVoiceQueue.attributes.js | 2 +- server/api/teamVoiceQueue/teamVoiceQueue.model.js | 2 +- server/api/teamVoiceQueue/teamVoiceQueue.rpc.js | 2 +- server/api/template/index.js | 2 +- server/api/template/template.attributes.js | 2 +- server/api/template/template.controller.js | 2 +- server/api/template/template.model.js | 2 +- server/api/template/template.rpc.js | 2 +- server/api/trigger/index.js | 2 +- server/api/trigger/trigger.attributes.js | 2 +- server/api/trigger/trigger.controller.js | 2 +- server/api/trigger/trigger.model.js | 2 +- server/api/trigger/trigger.rpc.js | 2 +- server/api/trunk/index.js | 2 +- server/api/trunk/trunk.attributes.js | 2 +- server/api/trunk/trunk.controller.js | 2 +- server/api/trunk/trunk.model.js | 2 +- server/api/trunk/trunk.rpc.js | 2 +- server/api/user-setting/index.js | 2 +- server/api/user-setting/user-setting.attributes.js | 2 +- server/api/user-setting/user-setting.controller.js | 2 +- server/api/user-setting/user-setting.events.js | 2 +- server/api/user-setting/user-setting.model.js | 2 +- server/api/user-setting/user-setting.socket.js | 2 +- server/api/user/index.js | 2 +- server/api/user/user.attributes.js | 2 +- server/api/user/user.controller.js | 2 +- server/api/user/user.events.js | 2 +- server/api/user/user.model.js | 2 +- server/api/user/user.rpc.js | 2 +- server/api/user/user.socket.js | 2 +- server/api/userChatQueue/index.js | 2 +- .../api/userChatQueue/userChatQueue.attributes.js | 2 +- server/api/userChatQueue/userChatQueue.model.js | 2 +- server/api/userChatQueue/userChatQueue.rpc.js | 2 +- server/api/userFaxQueue/index.js | 2 +- server/api/userFaxQueue/userFaxQueue.attributes.js | 2 +- server/api/userFaxQueue/userFaxQueue.model.js | 2 +- server/api/userFaxQueue/userFaxQueue.rpc.js | 2 +- server/api/userMailQueue/index.js | 2 +- .../api/userMailQueue/userMailQueue.attributes.js | 2 +- server/api/userMailQueue/userMailQueue.model.js | 2 +- server/api/userMailQueue/userMailQueue.rpc.js | 2 +- server/api/userNotification/index.js | 2 +- .../userNotification.attributes.js | 2 +- .../userNotification.controller.js | 2 +- .../userNotification/userNotification.events.js | 2 +- .../api/userNotification/userNotification.model.js | 2 +- .../api/userNotification/userNotification.rpc.js | 2 +- .../userNotification/userNotification.socket.js | 2 +- server/api/userOpenchannelQueue/index.js | 2 +- .../userOpenchannelQueue.attributes.js | 2 +- .../userOpenchannelQueue.model.js | 2 +- .../userOpenchannelQueue.rpc.js | 2 +- server/api/userProfile/index.js | 2 +- server/api/userProfile/userProfile.attributes.js | 2 +- server/api/userProfile/userProfile.controller.js | 2 +- server/api/userProfile/userProfile.events.js | 2 +- server/api/userProfile/userProfile.model.js | 2 +- server/api/userProfile/userProfile.rpc.js | 2 +- server/api/userProfile/userProfile.socket.js | 2 +- server/api/userProfileResource/index.js | 2 +- .../userProfileResource.attributes.js | 2 +- .../userProfileResource.controller.js | 2 +- .../userProfileResource.model.js | 2 +- .../userProfileResource/userProfileResource.rpc.js | 2 +- server/api/userProfileSection/index.js | 2 +- .../userProfileSection.attributes.js | 2 +- .../userProfileSection.controller.js | 2 +- .../userProfileSection/userProfileSection.model.js | 2 +- .../userProfileSection/userProfileSection.rpc.js | 2 +- server/api/userSmsQueue/index.js | 2 +- server/api/userSmsQueue/userSmsQueue.attributes.js | 2 +- server/api/userSmsQueue/userSmsQueue.model.js | 2 +- server/api/userSmsQueue/userSmsQueue.rpc.js | 2 +- .../userVoicePrefix/userVoicePrefix.attributes.js | 2 +- .../api/userVoicePrefix/userVoicePrefix.model.js | 2 +- server/api/userVoiceQueue/index.js | 2 +- .../userVoiceQueue/userVoiceQueue.attributes.js | 2 +- server/api/userVoiceQueue/userVoiceQueue.model.js | 2 +- server/api/userVoiceQueue/userVoiceQueue.rpc.js | 2 +- server/api/userVoiceQueueRt/index.js | 2 +- .../userVoiceQueueRt.attributes.js | 2 +- .../userVoiceQueueRt/userVoiceQueueRt.events.js | 2 +- .../api/userVoiceQueueRt/userVoiceQueueRt.model.js | 2 +- .../api/userVoiceQueueRt/userVoiceQueueRt.rpc.js | 2 +- .../userVoiceQueueRt/userVoiceQueueRt.socket.js | 2 +- server/api/userWhatsappQueue/index.js | 2 +- .../userWhatsappQueue.attributes.js | 2 +- .../userWhatsappQueue/userWhatsappQueue.model.js | 2 +- .../api/userWhatsappQueue/userWhatsappQueue.rpc.js | 2 +- server/api/variable/index.js | 2 +- server/api/variable/variable.attributes.js | 2 +- server/api/variable/variable.controller.js | 2 +- server/api/variable/variable.model.js | 2 +- server/api/variable/variable.rpc.js | 2 +- server/api/version/index.js | 2 +- server/api/version/version.controller.js | 2 +- server/api/voiceAgentReport/index.js | 2 +- .../voiceAgentReport.attributes.js | 2 +- .../voiceAgentReport.controller.js | 2 +- .../api/voiceAgentReport/voiceAgentReport.model.js | 2 +- .../api/voiceAgentReport/voiceAgentReport.rpc.js | 2 +- server/api/voiceCallReport/index.js | 2 +- .../voiceCallReport/voiceCallReport.attributes.js | 2 +- .../voiceCallReport/voiceCallReport.controller.js | 2 +- .../api/voiceCallReport/voiceCallReport.model.js | 2 +- server/api/voiceCallReport/voiceCallReport.rpc.js | 2 +- server/api/voiceChanSpy/index.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.attributes.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.controller.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.model.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.rpc.js | 2 +- server/api/voiceContext/index.js | 2 +- server/api/voiceContext/voiceContext.attributes.js | 2 +- server/api/voiceContext/voiceContext.controller.js | 2 +- server/api/voiceContext/voiceContext.model.js | 2 +- server/api/voiceContext/voiceContext.rpc.js | 2 +- server/api/voiceDialReport/index.js | 2 +- .../voiceDialReport/voiceDialReport.attributes.js | 2 +- .../voiceDialReport/voiceDialReport.controller.js | 2 +- .../api/voiceDialReport/voiceDialReport.model.js | 2 +- server/api/voiceDialReport/voiceDialReport.rpc.js | 2 +- server/api/voiceExtension/index.js | 2 +- .../voiceExtension/voiceExtension.attributes.js | 2 +- .../voiceExtension/voiceExtension.controller.js | 2 +- server/api/voiceExtension/voiceExtension.events.js | 2 +- server/api/voiceExtension/voiceExtension.model.js | 2 +- server/api/voiceExtension/voiceExtension.rpc.js | 2 +- server/api/voiceExtension/voiceExtension.socket.js | 2 +- server/api/voiceMail/index.js | 2 +- server/api/voiceMail/voiceMail.attributes.js | 2 +- server/api/voiceMail/voiceMail.controller.js | 2 +- server/api/voiceMail/voiceMail.model.js | 2 +- server/api/voiceMail/voiceMail.rpc.js | 2 +- server/api/voiceMailMessage/index.js | 2 +- .../voiceMailMessage.attributes.js | 2 +- .../voiceMailMessage.controller.js | 2 +- .../api/voiceMailMessage/voiceMailMessage.model.js | 2 +- .../api/voiceMailMessage/voiceMailMessage.rpc.js | 2 +- server/api/voiceMusicOnHold/index.js | 2 +- .../voiceMusicOnHold.attributes.js | 2 +- .../voiceMusicOnHold.controller.js | 2 +- .../api/voiceMusicOnHold/voiceMusicOnHold.model.js | 2 +- .../api/voiceMusicOnHold/voiceMusicOnHold.rpc.js | 2 +- server/api/voicePrefix/index.js | 2 +- server/api/voicePrefix/voicePrefix.attributes.js | 2 +- server/api/voicePrefix/voicePrefix.controller.js | 2 +- server/api/voicePrefix/voicePrefix.events.js | 2 +- server/api/voicePrefix/voicePrefix.model.js | 2 +- server/api/voicePrefix/voicePrefix.rpc.js | 2 +- server/api/voicePrefix/voicePrefix.socket.js | 2 +- server/api/voiceQueue/index.js | 2 +- server/api/voiceQueue/voiceQueue.attributes.js | 2 +- server/api/voiceQueue/voiceQueue.controller.js | 2 +- server/api/voiceQueue/voiceQueue.events.js | 2 +- server/api/voiceQueue/voiceQueue.model.js | 2 +- server/api/voiceQueue/voiceQueue.rpc.js | 2 +- server/api/voiceQueue/voiceQueue.socket.js | 2 +- server/api/voiceQueueReport/index.js | 2 +- .../voiceQueueReport.attributes.js | 2 +- .../voiceQueueReport.controller.js | 2 +- .../voiceQueueReport/voiceQueueReport.events.js | 2 +- .../api/voiceQueueReport/voiceQueueReport.model.js | 2 +- .../api/voiceQueueReport/voiceQueueReport.rpc.js | 2 +- .../voiceQueueReport/voiceQueueReport.socket.js | 2 +- server/api/voiceQueuesLog/index.js | 2 +- .../voiceQueuesLog/voiceQueuesLog.attributes.js | 2 +- .../voiceQueuesLog/voiceQueuesLog.controller.js | 2 +- server/api/voiceQueuesLog/voiceQueuesLog.model.js | 2 +- server/api/voiceQueuesLog/voiceQueuesLog.rpc.js | 2 +- server/api/voiceRecording/index.js | 2 +- .../voiceRecording/voiceRecording.attributes.js | 2 +- .../voiceRecording/voiceRecording.controller.js | 2 +- server/api/voiceRecording/voiceRecording.model.js | 2 +- server/api/voiceRecording/voiceRecording.rpc.js | 2 +- server/api/voiceTransferReport/index.js | 2 +- .../voiceTransferReport.attributes.js | 2 +- .../voiceTransferReport.controller.js | 2 +- .../voiceTransferReport.model.js | 2 +- .../voiceTransferReport/voiceTransferReport.rpc.js | 2 +- server/api/webbar/index.js | 2 +- server/api/webbar/webbar.controller.js | 2 +- server/api/whatsappAccount/index.js | 2 +- .../whatsappAccount/whatsappAccount.attributes.js | 2 +- .../whatsappAccount/whatsappAccount.controller.js | 2 +- .../api/whatsappAccount/whatsappAccount.events.js | 2 +- .../api/whatsappAccount/whatsappAccount.model.js | 2 +- server/api/whatsappAccount/whatsappAccount.rpc.js | 2 +- .../api/whatsappAccount/whatsappAccount.socket.js | 2 +- server/api/whatsappApplication/index.js | 2 +- .../whatsappApplication.attributes.js | 2 +- .../whatsappApplication.controller.js | 2 +- .../whatsappApplication.model.js | 2 +- .../whatsappApplication/whatsappApplication.rpc.js | 2 +- server/api/whatsappInteraction/index.js | 2 +- .../whatsappInteraction.attributes.js | 2 +- .../whatsappInteraction.controller.js | 2 +- .../whatsappInteraction.events.js | 2 +- .../whatsappInteraction.model.js | 2 +- .../whatsappInteraction/whatsappInteraction.rpc.js | 2 +- .../whatsappInteraction.socket.js | 2 +- server/api/whatsappMessage/index.js | 2 +- .../whatsappMessage/whatsappMessage.attributes.js | 2 +- .../whatsappMessage/whatsappMessage.controller.js | 2 +- .../api/whatsappMessage/whatsappMessage.events.js | 2 +- .../api/whatsappMessage/whatsappMessage.model.js | 2 +- server/api/whatsappMessage/whatsappMessage.rpc.js | 2 +- .../api/whatsappMessage/whatsappMessage.socket.js | 2 +- server/api/whatsappQueue/index.js | 2 +- .../api/whatsappQueue/whatsappQueue.attributes.js | 2 +- .../api/whatsappQueue/whatsappQueue.controller.js | 2 +- server/api/whatsappQueue/whatsappQueue.events.js | 2 +- server/api/whatsappQueue/whatsappQueue.model.js | 2 +- server/api/whatsappQueue/whatsappQueue.rpc.js | 2 +- server/api/whatsappQueue/whatsappQueue.socket.js | 2 +- server/api/whatsappQueueReport/index.js | 2 +- .../whatsappQueueReport.attributes.js | 2 +- .../whatsappQueueReport.controller.js | 2 +- .../whatsappQueueReport.model.js | 2 +- .../whatsappQueueReport/whatsappQueueReport.rpc.js | 2 +- server/api/whatsappTransferReport/index.js | 2 +- .../whatsappTransferReport.attributes.js | 2 +- .../whatsappTransferReport.controller.js | 2 +- .../whatsappTransferReport.model.js | 2 +- .../whatsappTransferReport.rpc.js | 2 +- server/app.js | 2 +- server/components/auth/service.js | 2 +- server/components/contacts/index.js | 2 +- server/components/contacts/sql-utils.js | 2 +- server/components/encryptor/index.js | 2 +- server/components/export/csv.js | 2 +- server/components/export/pdf.js | 2 +- server/components/export/xlsx.js | 2 +- server/components/extensions/rewrite.js | 2 +- server/components/import/cm/csv.js | 2 +- server/components/import/cm/csv2.js | 2 +- server/components/import/cm/csvUpdates.js | 2 +- server/components/integrations/configuration.js | 2 +- server/components/interaction/service.js | 2 +- server/components/interaction/sql-utils.js | 2 +- .../components/interaction/update-interaction.js | 2 +- server/components/interaction/utils.js | 2 +- server/components/license/service.js | 2 +- server/components/parsers/advancedSearch.js | 2 +- server/components/parsers/qs.js | 2 +- server/components/realtime/agents.js | 2 +- server/components/realtime/queues.js | 2 +- server/config/express.js | 2 +- server/config/license/hardware.js | 2 +- server/config/license/index.js | 2 +- server/config/license/util.js | 2 +- server/config/local.env.js | 2 +- server/config/logger.js | 2 +- server/config/pm2/config.js | 2 +- server/config/pm2/index.js | 2 +- server/config/schedule/chat.js | 2 +- server/config/schedule/cloud-provider.js | 2 +- server/config/schedule/index.js | 2 +- server/config/schedule/transcribe.js | 2 +- server/config/schedule/whatsapp.js | 2 +- server/config/seedContact.js | 2 +- server/config/seedUsers.js | 2 +- server/config/socketio.js | 2 +- server/config/triggers/index.js | 2 +- server/config/utils.js | 2 +- server/errors/api.js | 2 +- server/errors/index.js | 2 +- server/mysqldb/index.js | 2 +- server/routes.js | 2 +- server/rpc/index.js | 2 +- server/services/agi/channel.js | 2 +- server/services/agi/error.js | 2 +- server/services/agi/events.js | 2 +- server/services/agi/graph/index.js | 2 +- server/services/agi/index.js | 2 +- server/services/agi/mailRpc/index.js | 2 +- server/services/agi/project.js | 2 +- server/services/agi/reply.js | 2 +- server/services/agi/rpc/index.js | 2 +- server/services/agi/scripts/aws/index.js | 2 +- server/services/agi/scripts/aws/lex/index.js | 2 +- server/services/agi/scripts/aws/lex/lib/api.js | 2 +- server/services/agi/scripts/aws/polly/index.js | 2 +- server/services/agi/scripts/aws/polly/lib/api.js | 2 +- server/services/agi/scripts/google/asr/index.js | 2 +- server/services/agi/scripts/google/asr/lib/api.js | 2 +- server/services/agi/scripts/google/index.js | 2 +- server/services/agi/scripts/index.js | 2 +- server/services/agi/scripts/sestek/index.js | 2 +- server/services/agi/scripts/sestek/nda/index.js | 2 +- server/services/agi/scripts/tilde/asr/index.js | 2 +- server/services/agi/scripts/tilde/asr/lib/api.js | 2 +- server/services/agi/scripts/tilde/index.js | 2 +- server/services/agi/server.js | 2 +- server/services/agi/vertices.js | 2 +- server/services/ami/acw/index.js | 2 +- server/services/ami/ami.js | 2 +- server/services/ami/client.js | 2 +- server/services/ami/dialer/index.js | 2 +- server/services/ami/dialer/models/action.js | 2 +- server/services/ami/dialer/models/agentComplete.js | 2 +- server/services/ami/dialer/models/final.js | 2 +- server/services/ami/dialer/models/hangup.js | 2 +- server/services/ami/dialer/models/history.js | 2 +- .../ami/dialer/models/queueCallerAbandon.js | 2 +- server/services/ami/dialer/utils/hopper.js | 2 +- server/services/ami/dialer/utils/index.js | 2 +- server/services/ami/fax/action.js | 2 +- server/services/ami/fax/index.js | 2 +- server/services/ami/fax/rpcDb.js | 2 +- server/services/ami/fax/util/gs.js | 2 +- server/services/ami/fax/util/util.js | 2 +- server/services/ami/index.js | 2 +- server/services/ami/model/agent.js | 2 +- server/services/ami/model/campaign.js | 2 +- server/services/ami/model/channel.js | 2 +- server/services/ami/model/deskAccount.js | 2 +- server/services/ami/model/dynamics365Account.js | 2 +- server/services/ami/model/faxAccount.js | 2 +- server/services/ami/model/freshdeskAccount.js | 2 +- server/services/ami/model/freshsalesAccount.js | 2 +- server/services/ami/model/queueReport.js | 2 +- server/services/ami/model/salesforceAccount.js | 2 +- server/services/ami/model/servicenowAccount.js | 2 +- server/services/ami/model/sugarcrmAccount.js | 2 +- server/services/ami/model/telephone.js | 2 +- server/services/ami/model/template.js | 2 +- server/services/ami/model/trigger.js | 2 +- server/services/ami/model/trunk.js | 2 +- server/services/ami/model/voiceExtension.js | 2 +- server/services/ami/model/voiceQueue.js | 2 +- server/services/ami/model/voiceQueueSummary.js | 2 +- server/services/ami/model/vtigerAccount.js | 2 +- server/services/ami/model/zendeskAccount.js | 2 +- server/services/ami/model/zohoAccount.js | 2 +- server/services/ami/preview/action.js | 2 +- server/services/ami/preview/index.js | 2 +- server/services/ami/preview/rpcDb.js | 2 +- server/services/ami/preview/util/util.js | 2 +- server/services/ami/properties.js | 2 +- server/services/ami/realtime/index.js | 2 +- server/services/ami/realtime/utils.js | 2 +- server/services/ami/report/index.js | 2 +- server/services/ami/report/userReport.js | 2 +- server/services/ami/report/voiceAgentReport.js | 2 +- server/services/ami/report/voiceCallReport.js | 2 +- server/services/ami/report/voiceDialReport.js | 2 +- server/services/ami/report/voiceQueueReport.js | 2 +- server/services/ami/rpc/agentReportPreview.js | 2 +- server/services/ami/rpc/attachment.js | 2 +- server/services/ami/rpc/campaign.js | 2 +- server/services/ami/rpc/cmContact.js | 2 +- server/services/ami/rpc/cmHopper.js | 2 +- server/services/ami/rpc/cmHopperAdditionalPhone.js | 2 +- server/services/ami/rpc/cmHopperBlack.js | 2 +- server/services/ami/rpc/cmHopperFinal.js | 2 +- server/services/ami/rpc/cmHopperHistory.js | 2 +- server/services/ami/rpc/faxAccount.js | 2 +- server/services/ami/rpc/faxMessage.js | 2 +- server/services/ami/rpc/integrations/desk.js | 2 +- .../services/ami/rpc/integrations/dynamics365.js | 2 +- server/services/ami/rpc/integrations/freshdesk.js | 2 +- server/services/ami/rpc/integrations/freshsales.js | 2 +- server/services/ami/rpc/integrations/salesforce.js | 2 +- server/services/ami/rpc/integrations/servicenow.js | 2 +- server/services/ami/rpc/integrations/sugarcrm.js | 2 +- server/services/ami/rpc/integrations/vtiger.js | 2 +- server/services/ami/rpc/integrations/zendesk.js | 2 +- server/services/ami/rpc/integrations/zoho.js | 2 +- server/services/ami/rpc/interval.js | 2 +- server/services/ami/rpc/memberReport.js | 2 +- server/services/ami/rpc/setting.js | 2 +- server/services/ami/rpc/template.js | 2 +- server/services/ami/rpc/trigger.js | 2 +- server/services/ami/rpc/trunk.js | 2 +- server/services/ami/rpc/user.js | 2 +- server/services/ami/rpc/voiceAgentReport.js | 2 +- server/services/ami/rpc/voiceCallReport.js | 2 +- server/services/ami/rpc/voiceDialReport.js | 2 +- server/services/ami/rpc/voiceExtension.js | 2 +- server/services/ami/rpc/voiceQueue.js | 2 +- server/services/ami/rpc/voiceQueueReport.js | 2 +- server/services/ami/rpc/voiceQueueRt.js | 2 +- server/services/ami/rpc/voiceRecording.js | 2 +- server/services/ami/rpc/voiceTransferReport.js | 2 +- server/services/ami/server/index.js | 2 +- server/services/ami/trigger/cmContact/index.js | 2 +- server/services/ami/trigger/index.js | 2 +- server/services/ami/trigger/integration/desk.js | 2 +- .../ami/trigger/integration/dynamics365.js | 2 +- .../services/ami/trigger/integration/freshdesk.js | 2 +- .../services/ami/trigger/integration/freshsales.js | 2 +- server/services/ami/trigger/integration/index.js | 2 +- .../services/ami/trigger/integration/salesforce.js | 2 +- .../services/ami/trigger/integration/servicenow.js | 2 +- .../services/ami/trigger/integration/sugarcrm.js | 2 +- server/services/ami/trigger/integration/util.js | 2 +- server/services/ami/trigger/integration/vtiger.js | 2 +- server/services/ami/trigger/integration/zendesk.js | 2 +- server/services/ami/trigger/integration/zoho.js | 2 +- server/services/ami/trigger/script/index.js | 2 +- server/services/ami/trigger/urlforward/index.js | 2 +- server/services/email/client.js | 2 +- server/services/email/index.js | 2 +- server/services/email/lib/email.js | 2 +- server/services/email/lib/imap.js | 2 +- server/services/email/lib/smtp.js | 2 +- server/services/email/lib/utils.js | 2 +- server/services/email/model/mailAccount.js | 2 +- server/services/email/realtime/index.js | 2 +- server/services/email/rpc/mailAccount.js | 2 +- server/services/email/rpc/setting.js | 2 +- server/services/email/server/index.js | 2 +- server/services/express/index.js | 2 +- server/services/routing/client.js | 2 +- server/services/routing/index.js | 2 +- server/services/routing/lib/rule-engine.js | 2 +- server/services/routing/mailRpc/index.js | 2 +- server/services/routing/model/agent.js | 2 +- server/services/routing/model/chatQueue.js | 2 +- server/services/routing/model/faxQueue.js | 2 +- server/services/routing/model/interval.js | 2 +- server/services/routing/model/mailQueue.js | 2 +- server/services/routing/model/openchannelQueue.js | 2 +- server/services/routing/model/smsQueue.js | 2 +- server/services/routing/model/whatsappQueue.js | 2 +- server/services/routing/realtime/index.js | 2 +- server/services/routing/rpc/chatInteraction.js | 2 +- server/services/routing/rpc/chatMessage.js | 2 +- server/services/routing/rpc/chatQueue.js | 2 +- server/services/routing/rpc/chatQueueReport.js | 2 +- server/services/routing/rpc/faxInteraction.js | 2 +- server/services/routing/rpc/faxMessage.js | 2 +- server/services/routing/rpc/faxQueue.js | 2 +- server/services/routing/rpc/faxQueueReport.js | 2 +- server/services/routing/rpc/interval.js | 2 +- server/services/routing/rpc/mailInteraction.js | 2 +- server/services/routing/rpc/mailMessage.js | 2 +- server/services/routing/rpc/mailQueue.js | 2 +- server/services/routing/rpc/mailQueueReport.js | 2 +- .../services/routing/rpc/openchannelInteraction.js | 2 +- server/services/routing/rpc/openchannelMessage.js | 2 +- server/services/routing/rpc/openchannelQueue.js | 2 +- .../services/routing/rpc/openchannelQueueReport.js | 2 +- server/services/routing/rpc/smsInteraction.js | 2 +- server/services/routing/rpc/smsMessage.js | 2 +- server/services/routing/rpc/smsQueue.js | 2 +- server/services/routing/rpc/smsQueueReport.js | 2 +- server/services/routing/rpc/user.js | 2 +- server/services/routing/rpc/whatsappInteraction.js | 2 +- server/services/routing/rpc/whatsappMessage.js | 2 +- server/services/routing/rpc/whatsappQueue.js | 2 +- server/services/routing/rpc/whatsappQueueReport.js | 2 +- .../services/routing/server/applications/agent.js | 2 +- .../routing/server/applications/amazonlex.js | 2 +- .../routing/server/applications/autoreply.js | 2 +- .../services/routing/server/applications/close.js | 2 +- .../routing/server/applications/dialogflow.js | 2 +- .../routing/server/applications/dialogflowV2.js | 2 +- .../services/routing/server/applications/gotoif.js | 2 +- .../services/routing/server/applications/gotop.js | 2 +- .../routing/server/applications/message.js | 2 +- .../services/routing/server/applications/noop.js | 2 +- .../services/routing/server/applications/queue.js | 2 +- .../routing/server/applications/strategy/agent.js | 2 +- .../server/applications/strategy/beepall.js | 2 +- .../routing/server/applications/strategy/index.js | 2 +- .../server/applications/strategy/rrmemory.js | 2 +- .../routing/server/applications/strategy/util.js | 2 +- .../services/routing/server/applications/system.js | 2 +- server/services/routing/server/applications/tag.js | 2 +- .../services/routing/server/applications/tvox.js | 2 +- .../services/routing/server/applications/utils.js | 2 +- server/services/routing/server/index.js | 2 +- server/services/routing/server/interval.js | 2 +- server/services/xdr/agents.controller.js | 2 +- server/services/xdr/calls.controller.js | 2 +- server/services/xdr/core.controller.js | 2 +- server/services/xdr/dials.controller.js | 2 +- server/services/xdr/index.js | 2 +- server/services/xdr/members.controller.js | 2 +- server/services/xdr/queues.controller.js | 2 +- server/services/xdr/recordings.controller.js | 2 +- server/services/xdr/transfers.controller.js | 2 +- server/services/xdr/utils.js | 2 +- server/utils/client-side-logger.js | 2 +- server/utils/iftime.js | 2 +- server/utils/loggers.js | 2 +- server/utils/mask-sensitive-data.js | 2 +- server/utils/safe-template.js | 2 +- server/utils/update-app-config.js | 2 +- 1205 files changed, 4768 insertions(+), 1203 deletions(-) diff --git a/apidoc/api_project.js b/apidoc/api_project.js index e6a4692..0d4a549 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-09-19T11:47:30.540Z", + "time": "2022-09-20T08:51:26.506Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 0109d0b..16e77fa 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-09-19T11:47:30.540Z", + "time": "2022-09-20T08:51:26.506Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index b5754f6..2f604ac 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -2,6 +2,50 @@ "name": "motion", "version": "2.6.15", "dependencies": { + "@babel/code-frame": { + "version": "7.18.6", + "from": "@babel/code-frame@>=7.0.0 <8.0.0", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz", + "dev": true + }, + "@babel/helper-validator-identifier": { + "version": "7.19.1", + "from": "@babel/helper-validator-identifier@>=7.18.6 <8.0.0", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz", + "dev": true + }, + "@babel/highlight": { + "version": "7.18.6", + "from": "@babel/highlight@>=7.18.6 <8.0.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz", + "dev": true, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "from": "ansi-styles@>=3.2.1 <4.0.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "dev": true + }, + "chalk": { + "version": "2.4.2", + "from": "chalk@^2.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "dev": true + } + } + }, + "@colors/colors": { + "version": "1.5.0", + "from": "@colors/colors@1.5.0", + "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", + "dev": true + }, + "@dabh/diagnostics": { + "version": "2.0.3", + "from": "@dabh/diagnostics@>=2.0.2 <3.0.0", + "resolved": "https://registry.npmjs.org/@dabh/diagnostics/-/diagnostics-2.0.3.tgz", + "dev": true + }, "@swc/helpers": { "version": "0.3.17", "from": "@swc/helpers@>=0.3.13 <0.4.0", @@ -72,6 +116,12 @@ "from": "abab@>=2.0.0 <3.0.0", "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz" }, + "abbrev": { + "version": "1.1.1", + "from": "abbrev@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "dev": true + }, "abort-controller": { "version": "3.0.0", "from": "abort-controller@>=3.0.0 <4.0.0", @@ -104,6 +154,20 @@ } } }, + "acorn-jsx": { + "version": "3.0.1", + "from": "acorn-jsx@>=3.0.0 <4.0.0", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.1.tgz", + "dev": true, + "dependencies": { + "acorn": { + "version": "3.3.0", + "from": "acorn@>=3.0.4 <4.0.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", + "dev": true + } + } + }, "acorn-walk": { "version": "6.2.0", "from": "acorn-walk@>=6.0.1 <7.0.0", @@ -134,6 +198,12 @@ "from": "align-text@>=0.1.3 <0.2.0", "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz" }, + "alter": { + "version": "0.2.0", + "from": "alter@>=0.2.0 <0.3.0", + "resolved": "https://registry.npmjs.org/alter/-/alter-0.2.0.tgz", + "dev": true + }, "amdefine": { "version": "1.0.1", "from": "amdefine@>=0.0.4", @@ -149,6 +219,12 @@ "from": "amp-message@>=0.1.1 <0.2.0", "resolved": "https://registry.npmjs.org/amp-message/-/amp-message-0.1.2.tgz" }, + "ansi-escapes": { + "version": "3.2.0", + "from": "ansi-escapes@>=3.2.0 <4.0.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", + "dev": true + }, "ansi-regex": { "version": "2.1.1", "from": "ansi-regex@>=2.0.0 <3.0.0", @@ -179,6 +255,52 @@ "from": "git+https://github.com/gcareri/apiai-promise.git", "resolved": "git+https://github.com/gcareri/apiai-promise.git#2a203dd2bff4b578e1193f44ff5b87b289b22087" }, + "apidoc": { + "version": "0.24.0", + "from": "apidoc@0.24.0", + "resolved": "https://registry.npmjs.org/apidoc/-/apidoc-0.24.0.tgz", + "dev": true, + "dependencies": { + "is-stream": { + "version": "2.0.1", + "from": "is-stream@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "dev": true + }, + "readable-stream": { + "version": "3.6.0", + "from": "readable-stream@>=3.4.0 <4.0.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "dev": true + }, + "winston": { + "version": "3.8.2", + "from": "winston@>=3.3.3 <4.0.0", + "resolved": "https://registry.npmjs.org/winston/-/winston-3.8.2.tgz", + "dev": true + } + } + }, + "apidoc-core": { + "version": "0.11.1", + "from": "apidoc-core@>=0.11.1 <0.12.0", + "resolved": "https://registry.npmjs.org/apidoc-core/-/apidoc-core-0.11.1.tgz", + "dev": true, + "dependencies": { + "iconv-lite": { + "version": "0.5.2", + "from": "iconv-lite@>=0.5.0 <0.6.0", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.5.2.tgz", + "dev": true + }, + "semver": { + "version": "6.3.0", + "from": "semver@>=6.3.0 <6.4.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "dev": true + } + } + }, "apparatus": { "version": "0.0.10", "from": "apparatus@>=0.0.9", @@ -190,6 +312,12 @@ "from": "append-field@>=1.0.0 <2.0.0", "resolved": "https://registry.npmjs.org/append-field/-/append-field-1.0.0.tgz" }, + "aproba": { + "version": "1.2.0", + "from": "aproba@>=1.0.3 <2.0.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", + "dev": true + }, "archiver": { "version": "2.1.1", "from": "archiver@2.1.1", @@ -207,6 +335,12 @@ "from": "archiver-utils@>=1.3.0 <2.0.0", "resolved": "https://registry.npmjs.org/archiver-utils/-/archiver-utils-1.3.0.tgz" }, + "are-we-there-yet": { + "version": "1.1.7", + "from": "are-we-there-yet@>=1.1.2 <1.2.0", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.7.tgz", + "dev": true + }, "argparse": { "version": "1.0.10", "from": "argparse@>=1.0.7 <2.0.0", @@ -234,16 +368,34 @@ "from": "arr-union@>=3.1.0 <4.0.0", "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz" }, + "array-differ": { + "version": "1.0.0", + "from": "array-differ@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-1.0.0.tgz", + "dev": true + }, "array-equal": { "version": "1.0.0", "from": "array-equal@>=1.0.0 <2.0.0", "resolved": "https://registry.npmjs.org/array-equal/-/array-equal-1.0.0.tgz" }, + "array-find-index": { + "version": "1.0.2", + "from": "array-find-index@>=1.0.1 <2.0.0", + "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", + "dev": true + }, "array-flatten": { "version": "1.1.1", "from": "array-flatten@1.1.1", "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz" }, + "array-union": { + "version": "1.0.2", + "from": "array-union@>=1.0.1 <2.0.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", + "dev": true + }, "array-uniq": { "version": "1.0.2", "from": "array-uniq@1.0.2", @@ -259,6 +411,12 @@ "from": "arraybuffer.slice@>=0.0.7 <0.1.0", "resolved": "https://registry.npmjs.org/arraybuffer.slice/-/arraybuffer.slice-0.0.7.tgz" }, + "arrify": { + "version": "1.0.1", + "from": "arrify@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "dev": true + }, "asap": { "version": "2.0.6", "from": "asap@*", @@ -274,6 +432,12 @@ "from": "assert-plus@>=1.0.0 <2.0.0", "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz" }, + "assertion-error": { + "version": "1.1.0", + "from": "assertion-error@>=1.0.1 <2.0.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "dev": true + }, "assign-symbols": { "version": "1.0.0", "from": "assign-symbols@>=1.0.0 <2.0.0", @@ -284,6 +448,12 @@ "from": "asterisk-manager@0.1.16", "resolved": "https://registry.npmjs.org/asterisk-manager/-/asterisk-manager-0.1.16.tgz" }, + "astral-regex": { + "version": "1.0.0", + "from": "astral-regex@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", + "dev": true + }, "async": { "version": "3.2.4", "from": "async@>=3.1.0 <4.0.0", @@ -294,6 +464,12 @@ "from": "async-each@>=1.0.1 <2.0.0", "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz" }, + "async-foreach": { + "version": "0.1.3", + "from": "async-foreach@>=0.1.3 <0.2.0", + "resolved": "https://registry.npmjs.org/async-foreach/-/async-foreach-0.1.3.tgz", + "dev": true + }, "async-limiter": { "version": "1.0.1", "from": "async-limiter@>=1.0.0 <1.1.0", @@ -314,6 +490,12 @@ "from": "atob@>=2.1.2 <3.0.0", "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz" }, + "autoprefixer-core": { + "version": "5.2.1", + "from": "autoprefixer-core@>=5.1.7 <6.0.0", + "resolved": "https://registry.npmjs.org/autoprefixer-core/-/autoprefixer-core-5.2.1.tgz", + "dev": true + }, "available-typed-arrays": { "version": "1.0.5", "from": "available-typed-arrays@>=1.0.5 <2.0.0", @@ -351,6 +533,20 @@ "from": "axios@>=0.19.2 <0.20.0", "resolved": "https://registry.npmjs.org/axios/-/axios-0.19.2.tgz" }, + "babel-polyfill": { + "version": "6.23.0", + "from": "babel-polyfill@6.23.0", + "resolved": "https://registry.npmjs.org/babel-polyfill/-/babel-polyfill-6.23.0.tgz", + "dev": true, + "dependencies": { + "regenerator-runtime": { + "version": "0.10.5", + "from": "regenerator-runtime@>=0.10.0 <0.11.0", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz", + "dev": true + } + } + }, "babel-runtime": { "version": "6.26.0", "from": "babel-runtime@>=6.26.0 <7.0.0", @@ -498,11 +694,43 @@ "from": "blob@0.0.5", "resolved": "https://registry.npmjs.org/blob/-/blob-0.0.5.tgz" }, + "block-stream": { + "version": "0.0.9", + "from": "block-stream@*", + "resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz", + "dev": true + }, "bluebird": { "version": "3.7.2", "from": "bluebird@3.7.2", "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz" }, + "body": { + "version": "5.1.0", + "from": "body@>=5.1.0 <6.0.0", + "resolved": "https://registry.npmjs.org/body/-/body-5.1.0.tgz", + "dev": true, + "dependencies": { + "bytes": { + "version": "1.0.0", + "from": "bytes@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-1.0.0.tgz", + "dev": true + }, + "raw-body": { + "version": "1.1.7", + "from": "raw-body@>=1.1.0 <1.2.0", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-1.1.7.tgz", + "dev": true + }, + "string_decoder": { + "version": "0.10.31", + "from": "string_decoder@0.10", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "dev": true + } + } + }, "body-parser": { "version": "1.19.0", "from": "body-parser@1.19.0", @@ -518,6 +746,20 @@ "from": "boom@>=4.0.0 <5.0.0", "resolved": "https://registry.npmjs.org/boom/-/boom-4.3.1.tgz" }, + "bower-config": { + "version": "1.4.3", + "from": "bower-config@>=1.3.0 <2.0.0", + "resolved": "https://registry.npmjs.org/bower-config/-/bower-config-1.4.3.tgz", + "dev": true, + "dependencies": { + "minimist": { + "version": "0.2.1", + "from": "minimist@>=0.2.1 <0.3.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.2.1.tgz", + "dev": true + } + } + }, "brace-expansion": { "version": "1.1.11", "from": "brace-expansion@>=1.1.7 <2.0.0", @@ -545,6 +787,18 @@ "from": "browser-process-hrtime@>=1.0.0 <2.0.0", "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz" }, + "browser-stdout": { + "version": "1.3.0", + "from": "browser-stdout@1.3.0", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.0.tgz", + "dev": true + }, + "browserslist": { + "version": "0.4.0", + "from": "browserslist@>=0.4.0 <0.5.0", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-0.4.0.tgz", + "dev": true + }, "buffer": { "version": "5.7.1", "from": "buffer@>=5.1.0 <6.0.0", @@ -627,11 +881,43 @@ "from": "callsite@1.0.0", "resolved": "https://registry.npmjs.org/callsite/-/callsite-1.0.0.tgz" }, + "callsites": { + "version": "3.1.0", + "from": "callsites@>=3.0.0 <4.0.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "dev": true + }, + "camel-case": { + "version": "3.0.0", + "from": "camel-case@>=3.0.0 <4.0.0", + "resolved": "https://registry.npmjs.org/camel-case/-/camel-case-3.0.0.tgz", + "dev": true + }, "camelcase": { "version": "1.2.1", "from": "camelcase@>=1.0.2 <2.0.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz" }, + "camelcase-keys": { + "version": "2.1.0", + "from": "camelcase-keys@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", + "dev": true, + "dependencies": { + "camelcase": { + "version": "2.1.1", + "from": "camelcase@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz", + "dev": true + } + } + }, + "caniuse-db": { + "version": "1.0.30001406", + "from": "caniuse-db@>=1.0.30000214 <2.0.0", + "resolved": "https://registry.npmjs.org/caniuse-db/-/caniuse-db-1.0.30001406.tgz", + "dev": true + }, "caseless": { "version": "0.12.0", "from": "caseless@>=0.12.0 <0.13.0", @@ -642,16 +928,46 @@ "from": "center-align@>=0.1.1 <0.2.0", "resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz" }, + "chai": { + "version": "3.5.0", + "from": "chai@3.5.0", + "resolved": "https://registry.npmjs.org/chai/-/chai-3.5.0.tgz", + "dev": true + }, + "chai-http": { + "version": "3.0.0", + "from": "chai-http@3.0.0", + "resolved": "https://registry.npmjs.org/chai-http/-/chai-http-3.0.0.tgz", + "dev": true + }, "chalk": { "version": "0.4.0", "from": "chalk@>=0.4.0 <0.5.0", "resolved": "https://registry.npmjs.org/chalk/-/chalk-0.4.0.tgz" }, + "chance": { + "version": "1.0.10", + "from": "chance@1.0.10", + "resolved": "https://registry.npmjs.org/chance/-/chance-1.0.10.tgz", + "dev": true + }, + "char-spinner": { + "version": "1.0.1", + "from": "char-spinner@>=1.0.1 <2.0.0", + "resolved": "https://registry.npmjs.org/char-spinner/-/char-spinner-1.0.1.tgz", + "dev": true + }, "character-parser": { "version": "2.2.0", "from": "character-parser@>=2.1.1 <3.0.0", "resolved": "https://registry.npmjs.org/character-parser/-/character-parser-2.2.0.tgz" }, + "chardet": { + "version": "0.7.0", + "from": "chardet@>=0.7.0 <0.8.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "dev": true + }, "charenc": { "version": "0.0.2", "from": "charenc@0.0.2", @@ -698,11 +1014,37 @@ } } }, + "class-validator": { + "version": "0.7.2", + "from": "class-validator@0.7.2", + "resolved": "https://registry.npmjs.org/class-validator/-/class-validator-0.7.2.tgz", + "dev": true, + "dependencies": { + "validator": { + "version": "7.2.0", + "from": "validator@>=7.0.0 <8.0.0", + "resolved": "https://registry.npmjs.org/validator/-/validator-7.2.0.tgz", + "dev": true + } + } + }, "clean-css": { "version": "4.2.4", "from": "clean-css@>=4.1.11 <5.0.0", "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-4.2.4.tgz" }, + "cli": { + "version": "1.0.1", + "from": "cli@>=1.0.0 <1.1.0", + "resolved": "https://registry.npmjs.org/cli/-/cli-1.0.1.tgz", + "dev": true + }, + "cli-cursor": { + "version": "2.1.0", + "from": "cli-cursor@>=2.1.0 <3.0.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", + "dev": true + }, "cli-table-redemption": { "version": "1.0.1", "from": "cli-table-redemption@>=1.0.0 <2.0.0", @@ -730,6 +1072,12 @@ } } }, + "cli-width": { + "version": "2.2.1", + "from": "cli-width@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz", + "dev": true + }, "cliui": { "version": "2.1.0", "from": "cliui@>=2.1.0 <3.0.0", @@ -777,6 +1125,12 @@ "from": "collection-visit@>=1.0.0 <2.0.0", "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz" }, + "color": { + "version": "3.2.1", + "from": "color@>=3.1.3 <4.0.0", + "resolved": "https://registry.npmjs.org/color/-/color-3.2.1.tgz", + "dev": true + }, "color-convert": { "version": "1.9.3", "from": "color-convert@>=1.9.0 <2.0.0", @@ -787,11 +1141,23 @@ "from": "color-name@1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz" }, + "color-string": { + "version": "1.9.1", + "from": "color-string@>=1.6.0 <2.0.0", + "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz", + "dev": true + }, "colors": { "version": "1.0.3", "from": "colors@>=1.0.0 <1.1.0", "resolved": "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz" }, + "colorspace": { + "version": "1.1.4", + "from": "colorspace@>=1.1.0 <1.2.0", + "resolved": "https://registry.npmjs.org/colorspace/-/colorspace-1.1.4.tgz", + "dev": true + }, "combined-stream": { "version": "1.0.8", "from": "combined-stream@>=1.0.5 <1.1.0", @@ -847,6 +1213,12 @@ "from": "concat-stream@>=1.6.2 <2.0.0", "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz" }, + "config-chain": { + "version": "1.1.13", + "from": "config-chain@>=1.1.12 <2.0.0", + "resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.13.tgz", + "dev": true + }, "connect-timeout": { "version": "1.9.0", "from": "connect-timeout@1.9.0", @@ -869,6 +1241,18 @@ } } }, + "console-browserify": { + "version": "1.1.0", + "from": "console-browserify@>=1.1.0 <1.2.0", + "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz", + "dev": true + }, + "console-control-strings": { + "version": "1.1.0", + "from": "console-control-strings@>=1.1.0 <1.2.0", + "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "dev": true + }, "constantinople": { "version": "3.1.2", "from": "constantinople@>=3.1.2 <4.0.0", @@ -884,11 +1268,23 @@ "from": "content-type@>=1.0.4 <1.1.0", "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz" }, + "continuable-cache": { + "version": "0.3.1", + "from": "continuable-cache@>=0.3.1 <0.4.0", + "resolved": "https://registry.npmjs.org/continuable-cache/-/continuable-cache-0.3.1.tgz", + "dev": true + }, "continuation-local-storage": { "version": "3.2.1", "from": "continuation-local-storage@>=3.1.4 <4.0.0", "resolved": "https://registry.npmjs.org/continuation-local-storage/-/continuation-local-storage-3.2.1.tgz" }, + "convert-source-map": { + "version": "1.8.0", + "from": "convert-source-map@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz", + "dev": true + }, "convert-string": { "version": "0.1.0", "from": "convert-string@>=0.1.0 <0.2.0", @@ -909,6 +1305,12 @@ "from": "cookie-signature@1.0.6", "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz" }, + "cookiejar": { + "version": "2.0.6", + "from": "cookiejar@>=2.0.0 <2.1.0", + "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.0.6.tgz", + "dev": true + }, "copy-descriptor": { "version": "0.1.1", "from": "copy-descriptor@>=0.1.0 <0.2.0", @@ -976,6 +1378,34 @@ "from": "crypto-js@3.1.9-1", "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-3.1.9-1.tgz" }, + "cson": { + "version": "3.0.2", + "from": "cson@>=3.0.2 <3.1.0", + "resolved": "https://registry.npmjs.org/cson/-/cson-3.0.2.tgz", + "dev": true, + "dependencies": { + "coffee-script": { + "version": "1.12.7", + "from": "coffee-script@>=1.9.0 <2.0.0", + "resolved": "https://registry.npmjs.org/coffee-script/-/coffee-script-1.12.7.tgz", + "dev": true + } + } + }, + "cson-parser": { + "version": "1.3.5", + "from": "cson-parser@>=1.0.6 <2.0.0", + "resolved": "https://registry.npmjs.org/cson-parser/-/cson-parser-1.3.5.tgz", + "dev": true, + "dependencies": { + "coffee-script": { + "version": "1.12.7", + "from": "coffee-script@^1.10.0", + "resolved": "https://registry.npmjs.org/coffee-script/-/coffee-script-1.12.7.tgz", + "dev": true + } + } + }, "csprng": { "version": "0.1.2", "from": "csprng@*", @@ -1028,6 +1458,12 @@ "from": "csv-stringify@>=1.0.4 <2.0.0", "resolved": "https://registry.npmjs.org/csv-stringify/-/csv-stringify-1.1.2.tgz" }, + "currently-unhandled": { + "version": "0.4.1", + "from": "currently-unhandled@>=0.4.1 <0.5.0", + "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", + "dev": true + }, "cycle": { "version": "1.0.3", "from": "cycle@>=1.0.0 <1.1.0", @@ -1070,6 +1506,24 @@ "from": "datauri@>=2.0.0 <3.0.0", "resolved": "https://registry.npmjs.org/datauri/-/datauri-2.0.0.tgz" }, + "date-now": { + "version": "0.1.4", + "from": "date-now@>=0.1.4 <0.2.0", + "resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz", + "dev": true + }, + "date-time": { + "version": "1.1.0", + "from": "date-time@>=1.1.0 <2.0.0", + "resolved": "https://registry.npmjs.org/date-time/-/date-time-1.1.0.tgz", + "dev": true + }, + "dateformat": { + "version": "1.0.12", + "from": "dateformat@>=1.0.12 <1.1.0", + "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-1.0.12.tgz", + "dev": true + }, "dayjs": { "version": "1.11.3", "from": "dayjs@>=1.8.29 <2.0.0", @@ -1090,6 +1544,20 @@ "from": "decode-uri-component@>=0.2.0 <0.3.0", "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz" }, + "deep-eql": { + "version": "0.1.3", + "from": "deep-eql@>=0.1.3 <0.2.0", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-0.1.3.tgz", + "dev": true, + "dependencies": { + "type-detect": { + "version": "0.1.1", + "from": "type-detect@0.1.1", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-0.1.1.tgz", + "dev": true + } + } + }, "deep-equal": { "version": "2.0.5", "from": "deep-equal@>=2.0.5 <3.0.0", @@ -1154,6 +1622,12 @@ "from": "delayed-stream@>=1.0.0 <1.1.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz" }, + "delegates": { + "version": "1.0.0", + "from": "delegates@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "dev": true + }, "denque": { "version": "1.5.1", "from": "denque@>=1.1.0 <2.0.0", @@ -1213,6 +1687,18 @@ } } }, + "diff": { + "version": "1.3.2", + "from": "diff@>=1.3.0 <1.4.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-1.3.2.tgz", + "dev": true + }, + "doctrine": { + "version": "3.0.0", + "from": "doctrine@>=3.0.0 <4.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "dev": true + }, "doctypes": { "version": "1.1.0", "from": "doctypes@>=1.1.0 <2.0.0", @@ -1278,11 +1764,29 @@ "resolved": "https://registry.npmjs.org/dtrace-provider/-/dtrace-provider-0.8.8.tgz", "optional": true }, + "duplexer": { + "version": "0.1.2", + "from": "duplexer@>=0.1.1 <0.2.0", + "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz", + "dev": true + }, "duplexify": { "version": "3.6.0", "from": "duplexify@3.6.0", "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.6.0.tgz" }, + "each-async": { + "version": "0.1.3", + "from": "each-async@>=0.1.3 <0.2.0", + "resolved": "https://registry.npmjs.org/each-async/-/each-async-0.1.3.tgz", + "dev": true + }, + "eachr": { + "version": "3.3.0", + "from": "eachr@>=3.2.0 <4.0.0", + "resolved": "https://registry.npmjs.org/eachr/-/eachr-3.3.0.tgz", + "dev": true + }, "ecc-jsbn": { "version": "0.1.2", "from": "ecc-jsbn@>=0.1.1 <0.2.0", @@ -1293,6 +1797,34 @@ "from": "ecdsa-sig-formatter@1.0.11", "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz" }, + "editions": { + "version": "2.3.1", + "from": "editions@>=2.2.0 <3.0.0", + "resolved": "https://registry.npmjs.org/editions/-/editions-2.3.1.tgz", + "dev": true, + "dependencies": { + "semver": { + "version": "6.3.0", + "from": "semver@^6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "dev": true + } + } + }, + "editorconfig": { + "version": "0.15.3", + "from": "editorconfig@>=0.15.3 <0.16.0", + "resolved": "https://registry.npmjs.org/editorconfig/-/editorconfig-0.15.3.tgz", + "dev": true, + "dependencies": { + "lru-cache": { + "version": "4.1.5", + "from": "lru-cache@>=4.1.5 <5.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", + "dev": true + } + } + }, "ee-first": { "version": "1.1.1", "from": "ee-first@1.1.1", @@ -1323,6 +1855,12 @@ "from": "emoji-regex@>=8.0.0 <9.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz" }, + "enabled": { + "version": "2.0.0", + "from": "enabled@>=2.0.0 <2.1.0", + "resolved": "https://registry.npmjs.org/enabled/-/enabled-2.0.0.tgz", + "dev": true + }, "encodeurl": { "version": "1.0.2", "from": "encodeurl@>=1.0.2 <1.1.0", @@ -1404,6 +1942,26 @@ "from": "entities@1.1.2", "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz" }, + "errlop": { + "version": "2.2.0", + "from": "errlop@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/errlop/-/errlop-2.2.0.tgz", + "dev": true + }, + "error": { + "version": "7.2.1", + "from": "error@>=7.0.0 <8.0.0", + "resolved": "https://registry.npmjs.org/error/-/error-7.2.1.tgz", + "dev": true, + "dependencies": { + "string-template": { + "version": "0.2.1", + "from": "string-template@>=0.2.1 <0.3.0", + "resolved": "https://registry.npmjs.org/string-template/-/string-template-0.2.1.tgz", + "dev": true + } + } + }, "error-ex": { "version": "1.3.2", "from": "error-ex@>=1.2.0 <2.0.0", @@ -1466,11 +2024,243 @@ "from": "escodegen@>=1.11.0 <2.0.0", "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.14.3.tgz" }, + "escope": { + "version": "1.0.3", + "from": "escope@>=1.0.1 <1.1.0", + "resolved": "https://registry.npmjs.org/escope/-/escope-1.0.3.tgz", + "dev": true, + "dependencies": { + "estraverse": { + "version": "2.0.0", + "from": "estraverse@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-2.0.0.tgz", + "dev": true + } + } + }, + "eslint": { + "version": "5.16.0", + "from": "eslint@5.16.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.16.0.tgz", + "dev": true, + "dependencies": { + "ajv": { + "version": "6.12.6", + "from": "ajv@>=6.9.1 <7.0.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "dev": true + }, + "ansi-regex": { + "version": "3.0.1", + "from": "ansi-regex@^3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "from": "ansi-styles@^3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "dev": true + }, + "chalk": { + "version": "2.4.2", + "from": "chalk@>=2.1.0 <3.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "dev": true + }, + "debug": { + "version": "4.3.4", + "from": "debug@>=4.0.1 <5.0.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "dev": true + }, + "fast-deep-equal": { + "version": "3.1.3", + "from": "fast-deep-equal@>=3.1.1 <4.0.0", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "dev": true + }, + "json-schema-traverse": { + "version": "0.4.1", + "from": "json-schema-traverse@>=0.4.1 <0.5.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "dev": true + }, + "ms": { + "version": "2.1.2", + "from": "ms@2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "dev": true + }, + "strip-ansi": { + "version": "4.0.0", + "from": "strip-ansi@>=4.0.0 <5.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "dev": true + } + } + }, + "eslint-plugin-es": { + "version": "1.4.1", + "from": "eslint-plugin-es@>=1.3.1 <2.0.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-es/-/eslint-plugin-es-1.4.1.tgz", + "dev": true + }, + "eslint-plugin-node": { + "version": "8.0.1", + "from": "eslint-plugin-node@8.0.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-8.0.1.tgz", + "dev": true, + "dependencies": { + "ignore": { + "version": "5.2.0", + "from": "ignore@>=5.0.2 <6.0.0", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", + "dev": true + } + } + }, + "eslint-scope": { + "version": "4.0.3", + "from": "eslint-scope@>=4.0.3 <5.0.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", + "dev": true + }, + "eslint-utils": { + "version": "1.4.3", + "from": "eslint-utils@>=1.3.1 <2.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.3.tgz", + "dev": true + }, + "eslint-visitor-keys": { + "version": "1.3.0", + "from": "eslint-visitor-keys@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "dev": true + }, + "esmangle": { + "version": "1.0.1", + "from": "esmangle@1.0.1", + "resolved": "https://registry.npmjs.org/esmangle/-/esmangle-1.0.1.tgz", + "dev": true, + "dependencies": { + "escodegen": { + "version": "1.3.3", + "from": "escodegen@>=1.3.2 <1.4.0", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.3.3.tgz", + "dev": true + }, + "esprima": { + "version": "1.1.1", + "from": "esprima@>=1.1.1 <1.2.0", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-1.1.1.tgz", + "dev": true + }, + "estraverse": { + "version": "1.5.1", + "from": "estraverse@>=1.5.0 <1.6.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-1.5.1.tgz", + "dev": true + }, + "esutils": { + "version": "1.0.0", + "from": "esutils@>=1.0.0 <1.1.0", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-1.0.0.tgz", + "dev": true + }, + "fast-levenshtein": { + "version": "1.0.7", + "from": "fast-levenshtein@>=1.0.0 <1.1.0", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-1.0.7.tgz", + "dev": true + }, + "levn": { + "version": "0.2.5", + "from": "levn@>=0.2.4 <0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.2.5.tgz", + "dev": true + }, + "optionator": { + "version": "0.3.0", + "from": "optionator@>=0.3.0 <0.4.0", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.3.0.tgz", + "dev": true + }, + "source-map": { + "version": "0.1.43", + "from": "source-map@>=0.1.33 <0.2.0", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.43.tgz", + "dev": true + } + } + }, + "espree": { + "version": "5.0.1", + "from": "espree@>=5.0.1 <6.0.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-5.0.1.tgz", + "dev": true, + "dependencies": { + "acorn": { + "version": "6.4.2", + "from": "acorn@>=6.0.7 <7.0.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.2.tgz", + "dev": true + }, + "acorn-jsx": { + "version": "5.3.2", + "from": "acorn-jsx@>=5.0.0 <6.0.0", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "dev": true + } + } + }, "esprima": { "version": "4.0.1", "from": "esprima@>=4.0.1 <5.0.0", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz" }, + "esquery": { + "version": "1.4.0", + "from": "esquery@>=1.0.1 <2.0.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", + "dev": true, + "dependencies": { + "estraverse": { + "version": "5.3.0", + "from": "estraverse@^5.1.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "dev": true + } + } + }, + "esrecurse": { + "version": "4.3.0", + "from": "esrecurse@>=4.1.0 <5.0.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "dev": true, + "dependencies": { + "estraverse": { + "version": "5.3.0", + "from": "estraverse@>=5.2.0 <6.0.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "dev": true + } + } + }, + "esshorten": { + "version": "1.1.1", + "from": "esshorten@>=1.1.0 <1.2.0", + "resolved": "https://registry.npmjs.org/esshorten/-/esshorten-1.1.1.tgz", + "dev": true, + "dependencies": { + "estraverse": { + "version": "4.1.1", + "from": "estraverse@>=4.1.1 <4.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.1.1.tgz", + "dev": true + } + } + }, "estraverse": { "version": "4.3.0", "from": "estraverse@>=4.2.0 <5.0.0", @@ -1506,6 +2296,12 @@ "from": "excel-export@>=0.3.11 <0.4.0", "resolved": "https://registry.npmjs.org/excel-export/-/excel-export-0.3.11.tgz" }, + "exit": { + "version": "0.1.2", + "from": "exit@>=0.1.1 <0.2.0", + "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", + "dev": true + }, "expand-brackets": { "version": "2.1.4", "from": "expand-brackets@>=2.1.4 <3.0.0", @@ -1577,6 +2373,12 @@ } } }, + "external-editor": { + "version": "3.1.0", + "from": "external-editor@>=3.0.3 <4.0.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", + "dev": true + }, "extglob": { "version": "2.0.4", "from": "extglob@>=2.0.4 <3.0.0", @@ -1614,6 +2416,12 @@ } } }, + "extract-opts": { + "version": "3.4.0", + "from": "extract-opts@>=3.0.1 <4.0.0", + "resolved": "https://registry.npmjs.org/extract-opts/-/extract-opts-3.4.0.tgz", + "dev": true + }, "extract-zip": { "version": "1.7.0", "from": "extract-zip@1.7.0", @@ -1674,11 +2482,35 @@ "from": "fd-slicer@>=1.1.0 <1.2.0", "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz" }, + "fecha": { + "version": "4.2.3", + "from": "fecha@>=4.2.0 <5.0.0", + "resolved": "https://registry.npmjs.org/fecha/-/fecha-4.2.3.tgz", + "dev": true + }, "fibers": { "version": "1.0.15", "from": "fibers@>=1.0.5 <1.1.0", "resolved": "https://registry.npmjs.org/fibers/-/fibers-1.0.15.tgz" }, + "figures": { + "version": "2.0.0", + "from": "figures@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", + "dev": true + }, + "file-entry-cache": { + "version": "5.0.1", + "from": "file-entry-cache@>=5.0.1 <6.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", + "dev": true + }, + "file-sync-cmp": { + "version": "0.1.1", + "from": "file-sync-cmp@>=0.1.0 <0.2.0", + "resolved": "https://registry.npmjs.org/file-sync-cmp/-/file-sync-cmp-0.1.1.tgz", + "dev": true + }, "file-uri-to-path": { "version": "1.0.0", "from": "file-uri-to-path@1.0.0", @@ -1706,6 +2538,46 @@ "from": "find-up@>=1.0.0 <2.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz" }, + "findup-sync": { + "version": "0.3.0", + "from": "findup-sync@>=0.3.0 <0.4.0", + "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-0.3.0.tgz", + "dev": true, + "dependencies": { + "glob": { + "version": "5.0.15", + "from": "glob@>=5.0.0 <5.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", + "dev": true + } + } + }, + "flat-cache": { + "version": "2.0.1", + "from": "flat-cache@>=2.0.1 <3.0.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", + "dev": true, + "dependencies": { + "rimraf": { + "version": "2.6.3", + "from": "rimraf@2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "dev": true + } + } + }, + "flatted": { + "version": "2.0.2", + "from": "flatted@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.2.tgz", + "dev": true + }, + "fn.name": { + "version": "1.1.0", + "from": "fn.name@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/fn.name/-/fn.name-1.1.0.tgz", + "dev": true + }, "follow-redirects": { "version": "1.5.10", "from": "follow-redirects@1.5.10", @@ -1743,6 +2615,12 @@ "from": "form-data@>=2.3.1 <2.4.0", "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz" }, + "formidable": { + "version": "1.2.6", + "from": "formidable@>=1.0.17 <2.0.0", + "resolved": "https://registry.npmjs.org/formidable/-/formidable-1.2.6.tgz", + "dev": true + }, "forwarded": { "version": "0.2.0", "from": "forwarded@0.2.0", @@ -1773,6 +2651,12 @@ "from": "fs.realpath@>=1.0.0 <2.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz" }, + "fstream": { + "version": "1.0.12", + "from": "fstream@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.12.tgz", + "dev": true + }, "function-bind": { "version": "1.1.1", "from": "function-bind@>=1.1.1 <2.0.0", @@ -1783,11 +2667,31 @@ "from": "function.prototype.name@>=1.1.5 <2.0.0", "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.5.tgz" }, + "functional-red-black-tree": { + "version": "1.0.1", + "from": "functional-red-black-tree@>=1.0.1 <2.0.0", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "dev": true + }, "functions-have-names": { "version": "1.2.3", "from": "functions-have-names@>=1.2.2 <2.0.0", "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz" }, + "gauge": { + "version": "2.7.4", + "from": "gauge@>=2.7.3 <2.8.0", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", + "dev": true, + "dependencies": { + "strip-ansi": { + "version": "3.0.1", + "from": "strip-ansi@>=3.0.1 <4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "dev": true + } + } + }, "gaxios": { "version": "1.8.4", "from": "gaxios@>=1.0.4 <2.0.0", @@ -1800,6 +2704,12 @@ } } }, + "gaze": { + "version": "1.1.3", + "from": "gaze@>=1.1.0 <2.0.0", + "resolved": "https://registry.npmjs.org/gaze/-/gaze-1.1.3.tgz", + "dev": true + }, "generic-pool": { "version": "2.4.2", "from": "generic-pool@2.4.2", @@ -1815,6 +2725,12 @@ "from": "get-intrinsic@>=1.0.2 <2.0.0", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.2.tgz" }, + "get-stdin": { + "version": "4.0.1", + "from": "get-stdin@>=4.0.1 <5.0.0", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", + "dev": true + }, "get-symbol-description": { "version": "1.0.0", "from": "get-symbol-description@>=1.0.0 <2.0.0", @@ -1825,6 +2741,12 @@ "from": "get-value@>=2.0.6 <3.0.0", "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz" }, + "getobject": { + "version": "0.1.0", + "from": "getobject@>=0.1.0 <0.2.0", + "resolved": "https://registry.npmjs.org/getobject/-/getobject-0.1.0.tgz", + "dev": true + }, "getpass": { "version": "0.1.7", "from": "getpass@>=0.1.1 <0.2.0", @@ -1853,6 +2775,38 @@ } } }, + "globals": { + "version": "11.12.0", + "from": "globals@>=11.7.0 <12.0.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "dev": true + }, + "globule": { + "version": "1.3.4", + "from": "globule@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/globule/-/globule-1.3.4.tgz", + "dev": true, + "dependencies": { + "glob": { + "version": "7.1.7", + "from": "glob@>=7.1.1 <7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", + "dev": true + }, + "lodash": { + "version": "4.17.21", + "from": "lodash@>=4.17.21 <5.0.0", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "dev": true + }, + "minimatch": { + "version": "3.0.8", + "from": "minimatch@~3.0.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.8.tgz", + "dev": true + } + } + }, "google-p12-pem": { "version": "1.0.5", "from": "google-p12-pem@>=1.0.0 <2.0.0", @@ -1868,6 +2822,778 @@ "from": "graceful-fs@>=4.1.0 <5.0.0", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz" }, + "graceful-readlink": { + "version": "1.0.1", + "from": "graceful-readlink@>=1.0.0", + "resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz", + "dev": true + }, + "growl": { + "version": "1.9.2", + "from": "growl@1.9.2", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.9.2.tgz", + "dev": true + }, + "grunt": { + "version": "1.0.4", + "from": "grunt@1.0.4", + "resolved": "https://registry.npmjs.org/grunt/-/grunt-1.0.4.tgz", + "dev": true, + "dependencies": { + "coffeescript": { + "version": "1.10.0", + "from": "coffeescript@>=1.10.0 <1.11.0", + "resolved": "https://registry.npmjs.org/coffeescript/-/coffeescript-1.10.0.tgz", + "dev": true + }, + "eventemitter2": { + "version": "0.4.14", + "from": "eventemitter2@>=0.4.13 <0.5.0", + "resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-0.4.14.tgz", + "dev": true + }, + "glob": { + "version": "7.0.6", + "from": "glob@>=7.0.0 <7.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.0.6.tgz", + "dev": true + }, + "grunt-cli": { + "version": "1.2.0", + "from": "grunt-cli@>=1.2.0 <1.3.0", + "resolved": "https://registry.npmjs.org/grunt-cli/-/grunt-cli-1.2.0.tgz", + "dev": true + }, + "js-yaml": { + "version": "3.13.1", + "from": "js-yaml@>=3.13.0 <3.14.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", + "dev": true + }, + "minimatch": { + "version": "3.0.8", + "from": "minimatch@>=3.0.2 <3.1.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.8.tgz", + "dev": true + }, + "nopt": { + "version": "3.0.6", + "from": "nopt@>=3.0.6 <3.1.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", + "dev": true + }, + "resolve": { + "version": "1.1.7", + "from": "resolve@>=1.1.0 <1.2.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", + "dev": true + }, + "rimraf": { + "version": "2.6.3", + "from": "rimraf@~2.6.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "dev": true, + "dependencies": { + "glob": { + "version": "7.2.3", + "from": "glob@>=7.1.3 <8.0.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "dev": true + }, + "minimatch": { + "version": "3.1.2", + "from": "minimatch@>=3.1.1 <4.0.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "dev": true + } + } + } + } + }, + "grunt-angular-templates": { + "version": "1.2.0", + "from": "grunt-angular-templates@1.2.0", + "resolved": "https://registry.npmjs.org/grunt-angular-templates/-/grunt-angular-templates-1.2.0.tgz", + "dev": true + }, + "grunt-apidoc": { + "version": "0.11.0", + "from": "grunt-apidoc@0.11.0", + "resolved": "https://registry.npmjs.org/grunt-apidoc/-/grunt-apidoc-0.11.0.tgz", + "dev": true + }, + "grunt-autoprefixer": { + "version": "3.0.4", + "from": "grunt-autoprefixer@3.0.4", + "resolved": "https://registry.npmjs.org/grunt-autoprefixer/-/grunt-autoprefixer-3.0.4.tgz", + "dev": true, + "dependencies": { + "ansi-regex": { + "version": "1.1.1", + "from": "ansi-regex@>=1.1.0 <2.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-1.1.1.tgz", + "dev": true + }, + "ansi-styles": { + "version": "2.2.1", + "from": "ansi-styles@>=2.0.1 <3.0.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "dev": true + }, + "chalk": { + "version": "1.0.0", + "from": "chalk@>=1.0.0 <1.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.0.0.tgz", + "dev": true + }, + "has-ansi": { + "version": "1.0.3", + "from": "has-ansi@>=1.0.3 <2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-1.0.3.tgz", + "dev": true + }, + "strip-ansi": { + "version": "2.0.1", + "from": "strip-ansi@>=2.0.1 <3.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-2.0.1.tgz", + "dev": true + }, + "supports-color": { + "version": "1.3.1", + "from": "supports-color@>=1.3.0 <2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-1.3.1.tgz", + "dev": true + } + } + }, + "grunt-build-control": { + "version": "0.7.1", + "from": "grunt-build-control@0.7.1", + "resolved": "https://registry.npmjs.org/grunt-build-control/-/grunt-build-control-0.7.1.tgz", + "dev": true, + "dependencies": { + "semver": { + "version": "4.3.6", + "from": "semver@>=4.3.3 <4.4.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-4.3.6.tgz", + "dev": true + }, + "shelljs": { + "version": "0.2.6", + "from": "shelljs@>=0.2.6 <0.3.0", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.2.6.tgz", + "dev": true + } + } + }, + "grunt-contrib-clean": { + "version": "1.1.0", + "from": "grunt-contrib-clean@1.1.0", + "resolved": "https://registry.npmjs.org/grunt-contrib-clean/-/grunt-contrib-clean-1.1.0.tgz", + "dev": true, + "dependencies": { + "async": { + "version": "1.5.2", + "from": "async@^1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "dev": true + } + } + }, + "grunt-contrib-concat": { + "version": "1.0.1", + "from": "grunt-contrib-concat@1.0.1", + "resolved": "https://registry.npmjs.org/grunt-contrib-concat/-/grunt-contrib-concat-1.0.1.tgz", + "dev": true, + "dependencies": { + "ansi-styles": { + "version": "2.2.1", + "from": "ansi-styles@>=2.2.1 <3.0.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "dev": true + }, + "chalk": { + "version": "1.1.3", + "from": "chalk@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "dev": true + }, + "source-map": { + "version": "0.5.7", + "from": "source-map@>=0.5.3 <0.6.0", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "dev": true + }, + "strip-ansi": { + "version": "3.0.1", + "from": "strip-ansi@>=3.0.0 <4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "dev": true + }, + "supports-color": { + "version": "2.0.0", + "from": "supports-color@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "dev": true + } + } + }, + "grunt-contrib-copy": { + "version": "1.0.0", + "from": "grunt-contrib-copy@1.0.0", + "resolved": "https://registry.npmjs.org/grunt-contrib-copy/-/grunt-contrib-copy-1.0.0.tgz", + "dev": true, + "dependencies": { + "ansi-styles": { + "version": "2.2.1", + "from": "ansi-styles@>=2.2.1 <3.0.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "dev": true + }, + "chalk": { + "version": "1.1.3", + "from": "chalk@>=1.1.1 <2.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "dev": true + }, + "strip-ansi": { + "version": "3.0.1", + "from": "strip-ansi@>=3.0.0 <4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "dev": true + }, + "supports-color": { + "version": "2.0.0", + "from": "supports-color@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "dev": true + } + } + }, + "grunt-contrib-cssmin": { + "version": "2.2.1", + "from": "grunt-contrib-cssmin@2.2.1", + "resolved": "https://registry.npmjs.org/grunt-contrib-cssmin/-/grunt-contrib-cssmin-2.2.1.tgz", + "dev": true, + "dependencies": { + "ansi-styles": { + "version": "2.2.1", + "from": "ansi-styles@>=2.2.1 <3.0.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "dev": true + }, + "chalk": { + "version": "1.1.3", + "from": "chalk@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "dev": true + }, + "clean-css": { + "version": "4.1.11", + "from": "clean-css@>=4.1.1 <4.2.0", + "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-4.1.11.tgz", + "dev": true + }, + "source-map": { + "version": "0.5.7", + "from": "source-map@>=0.5.0 <0.6.0", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "dev": true + }, + "strip-ansi": { + "version": "3.0.1", + "from": "strip-ansi@>=3.0.0 <4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "dev": true + }, + "supports-color": { + "version": "2.0.0", + "from": "supports-color@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "dev": true + } + } + }, + "grunt-contrib-jshint": { + "version": "1.1.0", + "from": "grunt-contrib-jshint@1.1.0", + "resolved": "https://registry.npmjs.org/grunt-contrib-jshint/-/grunt-contrib-jshint-1.1.0.tgz", + "dev": true, + "dependencies": { + "ansi-styles": { + "version": "2.2.1", + "from": "ansi-styles@>=2.2.1 <3.0.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "dev": true + }, + "chalk": { + "version": "1.1.3", + "from": "chalk@>=1.1.1 <2.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "dev": true + }, + "strip-ansi": { + "version": "3.0.1", + "from": "strip-ansi@>=3.0.0 <4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "dev": true + }, + "supports-color": { + "version": "2.0.0", + "from": "supports-color@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "dev": true + } + } + }, + "grunt-contrib-obfuscator": { + "version": "4.0.0", + "from": "grunt-contrib-obfuscator@4.0.0", + "resolved": "https://registry.npmjs.org/grunt-contrib-obfuscator/-/grunt-contrib-obfuscator-4.0.0.tgz", + "dev": true, + "dependencies": { + "ansi-styles": { + "version": "2.2.1", + "from": "ansi-styles@>=2.2.1 <3.0.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "dev": true + }, + "chalk": { + "version": "1.1.3", + "from": "chalk@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "dev": true + }, + "strip-ansi": { + "version": "3.0.1", + "from": "strip-ansi@>=3.0.0 <4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "dev": true + }, + "supports-color": { + "version": "2.0.0", + "from": "supports-color@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "dev": true + } + } + }, + "grunt-contrib-uglify": { + "version": "3.4.0", + "from": "grunt-contrib-uglify@3.4.0", + "resolved": "https://registry.npmjs.org/grunt-contrib-uglify/-/grunt-contrib-uglify-3.4.0.tgz", + "dev": true, + "dependencies": { + "ansi-styles": { + "version": "2.2.1", + "from": "ansi-styles@>=2.2.1 <3.0.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "dev": true + }, + "chalk": { + "version": "1.1.3", + "from": "chalk@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "dev": true + }, + "commander": { + "version": "2.19.0", + "from": "commander@>=2.19.0 <2.20.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.19.0.tgz", + "dev": true + }, + "strip-ansi": { + "version": "3.0.1", + "from": "strip-ansi@>=3.0.0 <4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "dev": true + }, + "supports-color": { + "version": "2.0.0", + "from": "supports-color@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "dev": true + }, + "uglify-js": { + "version": "3.4.10", + "from": "uglify-js@>=3.4.0 <3.5.0", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.4.10.tgz", + "dev": true + } + } + }, + "grunt-contrib-watch": { + "version": "1.1.0", + "from": "grunt-contrib-watch@1.1.0", + "resolved": "https://registry.npmjs.org/grunt-contrib-watch/-/grunt-contrib-watch-1.1.0.tgz", + "dev": true, + "dependencies": { + "async": { + "version": "2.6.4", + "from": "async@>=2.6.0 <3.0.0", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.4.tgz", + "dev": true + } + } + }, + "grunt-express-server": { + "version": "0.5.4", + "from": "grunt-express-server@0.5.4", + "resolved": "https://registry.npmjs.org/grunt-express-server/-/grunt-express-server-0.5.4.tgz", + "dev": true + }, + "grunt-filerev": { + "version": "2.3.1", + "from": "grunt-filerev@2.3.1", + "resolved": "https://registry.npmjs.org/grunt-filerev/-/grunt-filerev-2.3.1.tgz", + "dev": true, + "dependencies": { + "ansi-styles": { + "version": "2.2.1", + "from": "ansi-styles@>=2.2.1 <3.0.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "dev": true + }, + "chalk": { + "version": "1.1.3", + "from": "chalk@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "dev": true + }, + "strip-ansi": { + "version": "3.0.1", + "from": "strip-ansi@>=3.0.0 <4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "dev": true + }, + "supports-color": { + "version": "2.0.0", + "from": "supports-color@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "dev": true + } + } + }, + "grunt-injector": { + "version": "1.1.0", + "from": "grunt-injector@1.1.0", + "resolved": "https://registry.npmjs.org/grunt-injector/-/grunt-injector-1.1.0.tgz", + "dev": true, + "dependencies": { + "lodash": { + "version": "4.15.0", + "from": "lodash@>=4.15.0 <4.16.0", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.15.0.tgz", + "dev": true + } + } + }, + "grunt-jsbeautifier": { + "version": "0.2.13", + "from": "grunt-jsbeautifier@0.2.13", + "resolved": "https://registry.npmjs.org/grunt-jsbeautifier/-/grunt-jsbeautifier-0.2.13.tgz", + "dev": true, + "dependencies": { + "async": { + "version": "2.6.4", + "from": "async@>=2.0.0-rc.3 <3.0.0", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.4.tgz", + "dev": true + } + } + }, + "grunt-jsonlint": { + "version": "1.1.0", + "from": "grunt-jsonlint@1.1.0", + "resolved": "https://registry.npmjs.org/grunt-jsonlint/-/grunt-jsonlint-1.1.0.tgz", + "dev": true + }, + "grunt-known-options": { + "version": "1.1.1", + "from": "grunt-known-options@>=1.1.0 <1.2.0", + "resolved": "https://registry.npmjs.org/grunt-known-options/-/grunt-known-options-1.1.1.tgz", + "dev": true + }, + "grunt-legacy-log": { + "version": "2.0.0", + "from": "grunt-legacy-log@>=2.0.0 <2.1.0", + "resolved": "https://registry.npmjs.org/grunt-legacy-log/-/grunt-legacy-log-2.0.0.tgz", + "dev": true, + "dependencies": { + "colors": { + "version": "1.1.2", + "from": "colors@>=1.1.2 <1.2.0", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.1.2.tgz", + "dev": true + } + } + }, + "grunt-legacy-log-utils": { + "version": "2.0.1", + "from": "grunt-legacy-log-utils@>=2.0.0 <2.1.0", + "resolved": "https://registry.npmjs.org/grunt-legacy-log-utils/-/grunt-legacy-log-utils-2.0.1.tgz", + "dev": true, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "from": "ansi-styles@^3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "dev": true + }, + "chalk": { + "version": "2.4.2", + "from": "chalk@~2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "dev": true + } + } + }, + "grunt-legacy-util": { + "version": "1.1.1", + "from": "grunt-legacy-util@>=1.1.1 <1.2.0", + "resolved": "https://registry.npmjs.org/grunt-legacy-util/-/grunt-legacy-util-1.1.1.tgz", + "dev": true, + "dependencies": { + "async": { + "version": "1.5.2", + "from": "async@~1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "dev": true + } + } + }, + "grunt-ng-annotate": { + "version": "3.0.0", + "from": "grunt-ng-annotate@3.0.0", + "resolved": "https://registry.npmjs.org/grunt-ng-annotate/-/grunt-ng-annotate-3.0.0.tgz", + "dev": true + }, + "grunt-nodemailer": { + "version": "1.1.0", + "from": "grunt-nodemailer@1.1.0", + "resolved": "https://registry.npmjs.org/grunt-nodemailer/-/grunt-nodemailer-1.1.0.tgz", + "dev": true, + "dependencies": { + "async": { + "version": "1.5.2", + "from": "async@1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "dev": true + }, + "lodash": { + "version": "4.13.1", + "from": "lodash@4.13.1", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.13.1.tgz", + "dev": true + }, + "nodemailer": { + "version": "2.4.1", + "from": "nodemailer@2.4.1", + "resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-2.4.1.tgz", + "dev": true, + "dependencies": { + "addressparser": { + "version": "1.0.1", + "from": "addressparser@1.0.1", + "resolved": "https://registry.npmjs.org/addressparser/-/addressparser-1.0.1.tgz", + "dev": true + }, + "buildmail": { + "version": "3.7.0", + "from": "buildmail@3.7.0", + "resolved": "https://registry.npmjs.org/buildmail/-/buildmail-3.7.0.tgz", + "dev": true + }, + "httpntlm": { + "version": "1.6.1", + "from": "httpntlm@1.6.1", + "resolved": "https://registry.npmjs.org/httpntlm/-/httpntlm-1.6.1.tgz", + "dev": true + }, + "httpreq": { + "version": "0.4.22", + "from": "httpreq@>=0.4.22", + "resolved": "https://registry.npmjs.org/httpreq/-/httpreq-0.4.22.tgz", + "dev": true + }, + "iconv-lite": { + "version": "0.4.13", + "from": "iconv-lite@0.4.13", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.13.tgz", + "dev": true + }, + "ip": { + "version": "1.1.3", + "from": "ip@>=1.1.2 <2.0.0", + "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.3.tgz", + "dev": true + }, + "libbase64": { + "version": "0.1.0", + "from": "libbase64@0.1.0", + "resolved": "https://registry.npmjs.org/libbase64/-/libbase64-0.1.0.tgz", + "dev": true + }, + "libmime": { + "version": "2.0.3", + "from": "libmime@2.0.3", + "resolved": "https://registry.npmjs.org/libmime/-/libmime-2.0.3.tgz", + "dev": true + }, + "libqp": { + "version": "1.1.0", + "from": "libqp@1.1.0", + "resolved": "https://registry.npmjs.org/libqp/-/libqp-1.1.0.tgz", + "dev": true + }, + "mailcomposer": { + "version": "3.9.0", + "from": "mailcomposer@3.9.0", + "resolved": "https://registry.npmjs.org/mailcomposer/-/mailcomposer-3.9.0.tgz", + "dev": true + }, + "nodemailer-direct-transport": { + "version": "3.1.0", + "from": "nodemailer-direct-transport@3.1.0", + "resolved": "https://registry.npmjs.org/nodemailer-direct-transport/-/nodemailer-direct-transport-3.1.0.tgz", + "dev": true + }, + "nodemailer-fetch": { + "version": "1.4.0", + "from": "nodemailer-fetch@1.4.0", + "resolved": "https://registry.npmjs.org/nodemailer-fetch/-/nodemailer-fetch-1.4.0.tgz", + "dev": true + }, + "nodemailer-shared": { + "version": "1.0.5", + "from": "nodemailer-shared@1.0.5", + "resolved": "https://registry.npmjs.org/nodemailer-shared/-/nodemailer-shared-1.0.5.tgz", + "dev": true + }, + "nodemailer-smtp-pool": { + "version": "2.6.0", + "from": "nodemailer-smtp-pool@2.6.0", + "resolved": "https://registry.npmjs.org/nodemailer-smtp-pool/-/nodemailer-smtp-pool-2.6.0.tgz", + "dev": true + }, + "nodemailer-smtp-transport": { + "version": "2.5.0", + "from": "nodemailer-smtp-transport@2.5.0", + "resolved": "https://registry.npmjs.org/nodemailer-smtp-transport/-/nodemailer-smtp-transport-2.5.0.tgz", + "dev": true + }, + "nodemailer-wellknown": { + "version": "0.1.9", + "from": "nodemailer-wellknown@0.1.9", + "resolved": "https://registry.npmjs.org/nodemailer-wellknown/-/nodemailer-wellknown-0.1.9.tgz", + "dev": true + }, + "smart-buffer": { + "version": "1.0.9", + "from": "smart-buffer@>=1.0.4 <2.0.0", + "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-1.0.9.tgz", + "dev": true + }, + "smtp-connection": { + "version": "2.5.0", + "from": "smtp-connection@2.5.0", + "resolved": "https://registry.npmjs.org/smtp-connection/-/smtp-connection-2.5.0.tgz", + "dev": true + }, + "socks": { + "version": "1.1.9", + "from": "socks@1.1.9", + "resolved": "https://registry.npmjs.org/socks/-/socks-1.1.9.tgz", + "dev": true + }, + "underscore": { + "version": "1.7.0", + "from": "underscore@>=1.7.0 <1.8.0", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.7.0.tgz", + "dev": true + } + } + } + } + }, + "grunt-sass": { + "version": "1.2.1", + "from": "grunt-sass@1.2.1", + "resolved": "https://registry.npmjs.org/grunt-sass/-/grunt-sass-1.2.1.tgz", + "dev": true, + "dependencies": { + "each-async": { + "version": "1.1.1", + "from": "each-async@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/each-async/-/each-async-1.1.1.tgz", + "dev": true + }, + "onetime": { + "version": "1.1.0", + "from": "onetime@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz", + "dev": true + } + } + }, + "grunt-usemin": { + "version": "3.1.1", + "from": "grunt-usemin@3.1.1", + "resolved": "https://registry.npmjs.org/grunt-usemin/-/grunt-usemin-3.1.1.tgz", + "dev": true, + "dependencies": { + "ansi-styles": { + "version": "2.2.1", + "from": "ansi-styles@>=2.2.1 <3.0.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "dev": true + }, + "chalk": { + "version": "1.1.3", + "from": "chalk@>=1.1.1 <2.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "dev": true + }, + "lodash": { + "version": "3.10.1", + "from": "lodash@>=3.6.0 <4.0.0", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz", + "dev": true + }, + "path-exists": { + "version": "1.0.0", + "from": "path-exists@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-1.0.0.tgz", + "dev": true + }, + "strip-ansi": { + "version": "3.0.1", + "from": "strip-ansi@>=3.0.0 <4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "dev": true + }, + "supports-color": { + "version": "2.0.0", + "from": "supports-color@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "dev": true + } + } + }, + "grunt-version": { + "version": "1.3.2", + "from": "grunt-version@1.3.2", + "resolved": "https://registry.npmjs.org/grunt-version/-/grunt-version-1.3.2.tgz", + "dev": true, + "dependencies": { + "semver": { + "version": "6.3.0", + "from": "semver@^6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "dev": true + } + } + }, "gtoken": { "version": "2.3.3", "from": "gtoken@>=2.3.2 <3.0.0", @@ -1880,6 +3606,33 @@ } } }, + "gzip-size": { + "version": "3.0.0", + "from": "gzip-size@>=3.0.0 <4.0.0", + "resolved": "https://registry.npmjs.org/gzip-size/-/gzip-size-3.0.0.tgz", + "dev": true + }, + "handlebars": { + "version": "4.7.7", + "from": "handlebars@>=4.7.6 <5.0.0", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz", + "dev": true, + "dependencies": { + "uglify-js": { + "version": "3.17.0", + "from": "uglify-js@>=3.1.4 <4.0.0", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.17.0.tgz", + "dev": true, + "optional": true + }, + "wordwrap": { + "version": "1.0.0", + "from": "wordwrap@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "dev": true + } + } + }, "har-schema": { "version": "2.0.0", "from": "har-schema@>=2.0.0 <3.0.0", @@ -1947,6 +3700,12 @@ "from": "has-tostringtag@>=1.0.0 <2.0.0", "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz" }, + "has-unicode": { + "version": "2.0.1", + "from": "has-unicode@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "dev": true + }, "has-value": { "version": "1.0.0", "from": "has-value@>=1.0.0 <2.0.0", @@ -1979,6 +3738,12 @@ "from": "hoek@>=4.0.0 <5.0.0", "resolved": "https://registry.npmjs.org/hoek/-/hoek-4.2.1.tgz" }, + "hooker": { + "version": "0.2.3", + "from": "hooker@>=0.2.3 <0.3.0", + "resolved": "https://registry.npmjs.org/hooker/-/hooker-0.2.3.tgz", + "dev": true + }, "hosted-git-info": { "version": "2.8.9", "from": "hosted-git-info@>=2.1.4 <3.0.0", @@ -1994,6 +3759,20 @@ "from": "html-entities@2.3.2", "resolved": "https://registry.npmjs.org/html-entities/-/html-entities-2.3.2.tgz" }, + "html-minifier": { + "version": "4.0.0", + "from": "html-minifier@>=4.0.0 <4.1.0", + "resolved": "https://registry.npmjs.org/html-minifier/-/html-minifier-4.0.0.tgz", + "dev": true, + "dependencies": { + "uglify-js": { + "version": "3.17.0", + "from": "uglify-js@^3.5.1", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.17.0.tgz", + "dev": true + } + } + }, "html-to-pdfmake": { "version": "2.1.7", "from": "html-to-pdfmake@2.1.7", @@ -2070,6 +3849,18 @@ "from": "ieee754@>=1.1.13 <2.0.0", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz" }, + "ignore": { + "version": "4.0.6", + "from": "ignore@>=4.0.6 <5.0.0", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "dev": true + }, + "ignore-by-default": { + "version": "1.0.1", + "from": "ignore-by-default@>=1.0.1 <2.0.0", + "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", + "dev": true + }, "image-size": { "version": "0.7.5", "from": "image-size@>=0.7.3 <0.8.0", @@ -2097,6 +3888,30 @@ } } }, + "import-fresh": { + "version": "3.3.0", + "from": "import-fresh@>=3.0.0 <4.0.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "dev": true + }, + "imurmurhash": { + "version": "0.1.4", + "from": "imurmurhash@>=0.1.4 <0.2.0", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "dev": true + }, + "in-publish": { + "version": "2.0.1", + "from": "in-publish@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/in-publish/-/in-publish-2.0.1.tgz", + "dev": true + }, + "indent-string": { + "version": "2.1.0", + "from": "indent-string@>=2.1.0 <3.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz", + "dev": true + }, "indexof": { "version": "0.0.1", "from": "indexof@0.0.1", @@ -2112,11 +3927,89 @@ "from": "inflight@>=1.0.4 <2.0.0", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz" }, + "inherit": { + "version": "2.2.7", + "from": "inherit@>=2.2.2 <3.0.0", + "resolved": "https://registry.npmjs.org/inherit/-/inherit-2.2.7.tgz", + "dev": true + }, "inherits": { "version": "2.0.4", "from": "inherits@>=2.0.0 <3.0.0", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz" }, + "ini": { + "version": "1.3.8", + "from": "ini@>=1.3.4 <2.0.0", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "dev": true + }, + "inquirer": { + "version": "6.5.2", + "from": "inquirer@>=6.2.2 <7.0.0", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.5.2.tgz", + "dev": true, + "dependencies": { + "ansi-regex": { + "version": "3.0.1", + "from": "ansi-regex@>=3.0.0 <4.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "from": "ansi-styles@^3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "dev": true + }, + "chalk": { + "version": "2.4.2", + "from": "chalk@^2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "from": "is-fullwidth-code-point@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "dev": true + }, + "mute-stream": { + "version": "0.0.7", + "from": "mute-stream@0.0.7", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", + "dev": true + }, + "string-width": { + "version": "2.1.1", + "from": "string-width@>=2.1.0 <3.0.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "dev": true, + "dependencies": { + "strip-ansi": { + "version": "4.0.0", + "from": "strip-ansi@^4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "dev": true + } + } + }, + "strip-ansi": { + "version": "5.2.0", + "from": "strip-ansi@>=5.1.0 <6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "dev": true, + "dependencies": { + "ansi-regex": { + "version": "4.1.1", + "from": "ansi-regex@>=4.1.0 <5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", + "dev": true + } + } + } + } + }, "internal-slot": { "version": "1.0.3", "from": "internal-slot@>=1.0.3 <2.0.0", @@ -2127,6 +4020,12 @@ "from": "interpret@>=1.0.0 <2.0.0", "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz" }, + "inversify": { + "version": "4.3.0", + "from": "inversify@4.3.0", + "resolved": "https://registry.npmjs.org/inversify/-/inversify-4.3.0.tgz", + "dev": true + }, "invert-kv": { "version": "1.0.0", "from": "invert-kv@>=1.0.0 <2.0.0", @@ -2154,6 +4053,12 @@ "from": "ip@>=1.0.0 <2.0.0", "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.8.tgz" }, + "ip-regex": { + "version": "1.0.3", + "from": "ip-regex@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-1.0.3.tgz", + "dev": true + }, "ipaddr.js": { "version": "1.9.1", "from": "ipaddr.js@1.9.1", @@ -2253,6 +4158,12 @@ "from": "is-extglob@>=2.1.0 <3.0.0", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz" }, + "is-finite": { + "version": "1.1.0", + "from": "is-finite@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.1.0.tgz", + "dev": true + }, "is-fullwidth-code-point": { "version": "1.0.0", "from": "is-fullwidth-code-point@>=1.0.0 <2.0.0", @@ -2263,6 +4174,12 @@ "from": "is-glob@>=4.0.0 <5.0.0", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz" }, + "is-ip": { + "version": "1.0.0", + "from": "is-ip@1.0.0", + "resolved": "https://registry.npmjs.org/is-ip/-/is-ip-1.0.0.tgz", + "dev": true + }, "is-map": { "version": "2.0.2", "from": "is-map@>=2.0.2 <3.0.0", @@ -2408,6 +4325,97 @@ "from": "isuuid@>=0.1.0 <0.2.0", "resolved": "https://registry.npmjs.org/isuuid/-/isuuid-0.1.0.tgz" }, + "javascript-obfuscator": { + "version": "0.10.2", + "from": "javascript-obfuscator@>=0.10.0 <0.11.0", + "resolved": "https://registry.npmjs.org/javascript-obfuscator/-/javascript-obfuscator-0.10.2.tgz", + "dev": true, + "dependencies": { + "commander": { + "version": "2.11.0", + "from": "commander@2.11.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.11.0.tgz", + "dev": true + }, + "escodegen-wallaby": { + "version": "1.6.12", + "from": "escodegen-wallaby@1.6.12", + "resolved": "https://registry.npmjs.org/escodegen-wallaby/-/escodegen-wallaby-1.6.12.tgz", + "dev": true, + "dependencies": { + "esprima": { + "version": "2.7.3", + "from": "esprima@>=2.7.1 <3.0.0", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", + "dev": true + }, + "estraverse": { + "version": "1.9.3", + "from": "estraverse@>=1.9.1 <2.0.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-1.9.3.tgz", + "dev": true + } + } + }, + "esprima": { + "version": "4.0.0", + "from": "esprima@4.0.0", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz", + "dev": true + }, + "estraverse": { + "version": "4.2.0", + "from": "estraverse@4.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", + "dev": true + }, + "md5": { + "version": "2.2.1", + "from": "md5@2.2.1", + "resolved": "https://registry.npmjs.org/md5/-/md5-2.2.1.tgz", + "dev": true + }, + "minimist": { + "version": "0.0.8", + "from": "minimist@0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "dev": true + }, + "mkdirp": { + "version": "0.5.1", + "from": "mkdirp@0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "dev": true + }, + "source-map": { + "version": "0.2.0", + "from": "source-map@>=0.2.0 <0.3.0", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.2.0.tgz", + "dev": true, + "optional": true + }, + "source-map-support": { + "version": "0.4.15", + "from": "source-map-support@0.4.15", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.15.tgz", + "dev": true, + "dependencies": { + "source-map": { + "version": "0.5.7", + "from": "source-map@>=0.5.6 <0.6.0", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "dev": true + } + } + }, + "tslib": { + "version": "1.7.1", + "from": "tslib@1.7.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.7.1.tgz", + "dev": true + } + } + }, "jayson": { "version": "2.1.2", "from": "jayson@2.1.2", @@ -2420,6 +4428,12 @@ } } }, + "jit-grunt": { + "version": "0.10.0", + "from": "jit-grunt@>=0.10.0 <0.11.0", + "resolved": "https://registry.npmjs.org/jit-grunt/-/jit-grunt-0.10.0.tgz", + "dev": true + }, "jmespath": { "version": "0.15.0", "from": "jmespath@0.15.0", @@ -2437,11 +4451,63 @@ } } }, + "js-base64": { + "version": "2.1.9", + "from": "js-base64@>=2.1.8 <2.2.0", + "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.1.9.tgz", + "dev": true + }, + "js-beautify": { + "version": "1.10.3", + "from": "js-beautify@1.10.3", + "resolved": "https://registry.npmjs.org/js-beautify/-/js-beautify-1.10.3.tgz", + "dev": true, + "dependencies": { + "nopt": { + "version": "4.0.3", + "from": "nopt@>=4.0.1 <4.1.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.3.tgz", + "dev": true + } + } + }, + "js-obfuscator": { + "version": "0.1.2", + "from": "js-obfuscator@0.1.2", + "resolved": "https://registry.npmjs.org/js-obfuscator/-/js-obfuscator-0.1.2.tgz", + "dev": true, + "dependencies": { + "async": { + "version": "0.9.2", + "from": "async@>=0.9.0 <0.10.0", + "resolved": "https://registry.npmjs.org/async/-/async-0.9.2.tgz", + "dev": true + }, + "q": { + "version": "1.5.1", + "from": "q@>=1.0.1 <2.0.0", + "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", + "dev": true + } + } + }, "js-stringify": { "version": "1.0.2", "from": "js-stringify@>=1.0.1 <2.0.0", "resolved": "https://registry.npmjs.org/js-stringify/-/js-stringify-1.0.2.tgz" }, + "js-tokens": { + "version": "4.0.0", + "from": "js-tokens@>=4.0.0 <5.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "dev": true + }, + "js-yaml": { + "version": "3.14.1", + "from": "js-yaml@>=3.13.0 <4.0.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "dev": true + }, "jsbn": { "version": "0.1.1", "from": "jsbn@>=0.1.0 <0.2.0", @@ -2529,6 +4595,74 @@ "from": "jsforce@1.9.3", "resolved": "https://registry.npmjs.org/jsforce/-/jsforce-1.9.3.tgz" }, + "jshint": { + "version": "2.9.7", + "from": "jshint@>=2.9.4 <2.10.0", + "resolved": "https://registry.npmjs.org/jshint/-/jshint-2.9.7.tgz", + "dev": true, + "dependencies": { + "domhandler": { + "version": "2.3.0", + "from": "domhandler@>=2.3.0 <2.4.0", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.3.0.tgz", + "dev": true + }, + "domutils": { + "version": "1.5.1", + "from": "domutils@>=1.5.0 <1.6.0", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.5.1.tgz", + "dev": true + }, + "entities": { + "version": "1.0.0", + "from": "entities@>=1.0.0 <1.1.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-1.0.0.tgz", + "dev": true + }, + "htmlparser2": { + "version": "3.8.3", + "from": "htmlparser2@>=3.8.0 <3.9.0", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.8.3.tgz", + "dev": true + }, + "isarray": { + "version": "0.0.1", + "from": "isarray@0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "dev": true + }, + "minimatch": { + "version": "3.0.8", + "from": "minimatch@~3.0.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.8.tgz", + "dev": true + }, + "readable-stream": { + "version": "1.1.14", + "from": "readable-stream@>=1.1.0 <1.2.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "dev": true + }, + "shelljs": { + "version": "0.3.0", + "from": "shelljs@>=0.3.0 <0.4.0", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.3.0.tgz", + "dev": true + }, + "string_decoder": { + "version": "0.10.31", + "from": "string_decoder@>=0.10.0 <0.11.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "dev": true + }, + "strip-json-comments": { + "version": "1.0.4", + "from": "strip-json-comments@>=1.0.0 <1.1.0", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-1.0.4.tgz", + "dev": true + } + } + }, "json-schema": { "version": "0.4.0", "from": "json-schema@0.4.0", @@ -2539,6 +4673,12 @@ "from": "json-schema-traverse@>=0.3.0 <0.4.0", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz" }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "from": "json-stable-stringify-without-jsonify@>=1.0.1 <2.0.0", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "dev": true + }, "json-stringify-safe": { "version": "5.0.1", "from": "json-stringify-safe@>=5.0.1 <5.1.0", @@ -2549,11 +4689,23 @@ "from": "git+https://github.com/xmdevelop/json2xls.git", "resolved": "git+https://github.com/xmdevelop/json2xls.git#24363de2f490e09e0708319288f48081e0304fa0" }, + "json3": { + "version": "3.3.2", + "from": "json3@3.3.2", + "resolved": "https://registry.npmjs.org/json3/-/json3-3.3.2.tgz", + "dev": true + }, "jsonfile": { "version": "4.0.0", "from": "jsonfile@>=4.0.0 <5.0.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz" }, + "jsonlint": { + "version": "1.6.2", + "from": "jsonlint@1.6.2", + "resolved": "https://registry.npmjs.org/jsonlint/-/jsonlint-1.6.2.tgz", + "dev": true + }, "jsonparse": { "version": "1.3.1", "from": "jsonparse@>=1.2.0 <2.0.0", @@ -2596,6 +4748,12 @@ "from": "jstz@1.0.11", "resolved": "https://registry.npmjs.org/jstz/-/jstz-1.0.11.tgz" }, + "JSV": { + "version": "4.0.2", + "from": "JSV@>=4.0.0", + "resolved": "https://registry.npmjs.org/JSV/-/JSV-4.0.2.tgz", + "dev": true + }, "jszip": { "version": "2.5.0", "from": "jszip@2.5.0", @@ -2626,11 +4784,23 @@ "from": "kind-of@>=3.0.2 <4.0.0", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz" }, + "klaw-sync": { + "version": "6.0.0", + "from": "klaw-sync@>=6.0.0 <7.0.0", + "resolved": "https://registry.npmjs.org/klaw-sync/-/klaw-sync-6.0.0.tgz", + "dev": true + }, "kue": { "version": "0.11.6", "from": "kue@0.11.6", "resolved": "https://registry.npmjs.org/kue/-/kue-0.11.6.tgz" }, + "kuler": { + "version": "2.0.0", + "from": "kuler@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/kuler/-/kuler-2.0.0.tgz", + "dev": true + }, "lazy": { "version": "1.0.11", "from": "lazy@>=1.0.11 <1.1.0", @@ -2705,6 +4875,50 @@ "from": "linkify-it@2.2.0", "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-2.2.0.tgz" }, + "livereload-js": { + "version": "2.4.0", + "from": "livereload-js@>=2.3.0 <3.0.0", + "resolved": "https://registry.npmjs.org/livereload-js/-/livereload-js-2.4.0.tgz", + "dev": true + }, + "load-grunt-config": { + "version": "0.19.2", + "from": "load-grunt-config@0.19.2", + "resolved": "https://registry.npmjs.org/load-grunt-config/-/load-grunt-config-0.19.2.tgz", + "dev": true, + "dependencies": { + "esprima": { + "version": "2.7.3", + "from": "esprima@>=2.6.0 <3.0.0", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", + "dev": true + }, + "glob": { + "version": "5.0.15", + "from": "glob@>=5.0.15 <5.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", + "dev": true + }, + "js-yaml": { + "version": "3.4.6", + "from": "js-yaml@>=3.4.3 <3.5.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.4.6.tgz", + "dev": true + }, + "lodash": { + "version": "3.10.1", + "from": "lodash@>=3.10.1 <3.11.0", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz", + "dev": true + } + } + }, + "load-grunt-tasks": { + "version": "3.3.0", + "from": "load-grunt-tasks@>=3.3.0 <3.4.0", + "resolved": "https://registry.npmjs.org/load-grunt-tasks/-/load-grunt-tasks-3.3.0.tgz", + "dev": true + }, "load-json-file": { "version": "1.1.0", "from": "load-json-file@>=1.0.0 <2.0.0", @@ -2727,6 +4941,36 @@ "from": "lodash@4.17.20", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz" }, + "lodash._baseassign": { + "version": "3.2.0", + "from": "lodash._baseassign@>=3.0.0 <4.0.0", + "resolved": "https://registry.npmjs.org/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz", + "dev": true + }, + "lodash._basecopy": { + "version": "3.0.1", + "from": "lodash._basecopy@>=3.0.0 <4.0.0", + "resolved": "https://registry.npmjs.org/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz", + "dev": true + }, + "lodash._basecreate": { + "version": "3.0.3", + "from": "lodash._basecreate@>=3.0.0 <4.0.0", + "resolved": "https://registry.npmjs.org/lodash._basecreate/-/lodash._basecreate-3.0.3.tgz", + "dev": true + }, + "lodash._getnative": { + "version": "3.9.1", + "from": "lodash._getnative@>=3.0.0 <4.0.0", + "resolved": "https://registry.npmjs.org/lodash._getnative/-/lodash._getnative-3.9.1.tgz", + "dev": true + }, + "lodash._isiterateecall": { + "version": "3.0.9", + "from": "lodash._isiterateecall@>=3.0.0 <4.0.0", + "resolved": "https://registry.npmjs.org/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz", + "dev": true + }, "lodash.assign": { "version": "4.2.0", "from": "lodash.assign@>=4.0.3 <5.0.0", @@ -2757,6 +5001,18 @@ "from": "lodash.clone@4.5.0", "resolved": "https://registry.npmjs.org/lodash.clone/-/lodash.clone-4.5.0.tgz" }, + "lodash.clonedeep": { + "version": "4.5.0", + "from": "lodash.clonedeep@>=4.5.0 <5.0.0", + "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", + "dev": true + }, + "lodash.create": { + "version": "3.1.1", + "from": "lodash.create@3.1.1", + "resolved": "https://registry.npmjs.org/lodash.create/-/lodash.create-3.1.1.tgz", + "dev": true + }, "lodash.defaults": { "version": "4.2.0", "from": "lodash.defaults@>=4.2.0 <5.0.0", @@ -2797,6 +5053,18 @@ "from": "lodash.includes@>=4.3.0 <5.0.0", "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz" }, + "lodash.isarguments": { + "version": "3.1.0", + "from": "lodash.isarguments@>=3.0.0 <4.0.0", + "resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", + "dev": true + }, + "lodash.isarray": { + "version": "3.0.4", + "from": "lodash.isarray@>=3.0.0 <4.0.0", + "resolved": "https://registry.npmjs.org/lodash.isarray/-/lodash.isarray-3.0.4.tgz", + "dev": true + }, "lodash.isboolean": { "version": "3.0.3", "from": "lodash.isboolean@>=3.0.3 <4.0.0", @@ -2827,6 +5095,12 @@ "from": "lodash.isstring@>=4.0.1 <5.0.0", "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz" }, + "lodash.keys": { + "version": "3.1.2", + "from": "lodash.keys@>=3.0.0 <4.0.0", + "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-3.1.2.tgz", + "dev": true + }, "lodash.map": { "version": "4.6.0", "from": "lodash.map@>=4.4.0 <5.0.0", @@ -2877,11 +5151,37 @@ "from": "lodash.unescape@>=4.0.1 <5.0.0", "resolved": "https://registry.npmjs.org/lodash.unescape/-/lodash.unescape-4.0.1.tgz" }, + "logform": { + "version": "2.4.2", + "from": "logform@>=2.4.0 <3.0.0", + "resolved": "https://registry.npmjs.org/logform/-/logform-2.4.2.tgz", + "dev": true, + "dependencies": { + "ms": { + "version": "2.1.3", + "from": "ms@^2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "dev": true + } + } + }, "longest": { "version": "1.0.1", "from": "longest@>=1.0.1 <2.0.0", "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz" }, + "loud-rejection": { + "version": "1.6.0", + "from": "loud-rejection@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz", + "dev": true + }, + "lower-case": { + "version": "1.1.4", + "from": "lower-case@>=1.1.1 <2.0.0", + "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-1.1.4.tgz", + "dev": true + }, "lru-cache": { "version": "2.7.3", "from": "lru-cache@>=2.5.0 <3.0.0", @@ -2941,16 +5241,80 @@ "from": "map-cache@>=0.2.2 <0.3.0", "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz" }, + "map-obj": { + "version": "1.0.1", + "from": "map-obj@>=1.0.1 <2.0.0", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", + "dev": true + }, "map-visit": { "version": "1.0.0", "from": "map-visit@>=1.0.0 <2.0.0", "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz" }, + "markdown-it": { + "version": "10.0.0", + "from": "markdown-it@>=10.0.0 <11.0.0", + "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-10.0.0.tgz", + "dev": true, + "dependencies": { + "entities": { + "version": "2.0.3", + "from": "entities@>=2.0.0 <2.1.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-2.0.3.tgz", + "dev": true + } + } + }, + "maxmin": { + "version": "2.1.0", + "from": "maxmin@>=2.1.0 <3.0.0", + "resolved": "https://registry.npmjs.org/maxmin/-/maxmin-2.1.0.tgz", + "dev": true, + "dependencies": { + "ansi-styles": { + "version": "2.2.1", + "from": "ansi-styles@>=2.2.1 <3.0.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "dev": true + }, + "chalk": { + "version": "1.1.3", + "from": "chalk@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "dev": true + }, + "figures": { + "version": "1.7.0", + "from": "figures@>=1.0.1 <2.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", + "dev": true + }, + "strip-ansi": { + "version": "3.0.1", + "from": "strip-ansi@>=3.0.0 <4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "dev": true + }, + "supports-color": { + "version": "2.0.0", + "from": "supports-color@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "dev": true + } + } + }, "md5": { "version": "2.3.0", "from": "md5@2.3.0", "resolved": "https://registry.npmjs.org/md5/-/md5-2.3.0.tgz" }, + "mdurl": { + "version": "1.0.1", + "from": "mdurl@>=1.0.1 <2.0.0", + "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", + "dev": true + }, "media-typer": { "version": "0.3.0", "from": "media-typer@0.3.0", @@ -2961,6 +5325,12 @@ "from": "mensch@>=0.3.4 <0.4.0", "resolved": "https://registry.npmjs.org/mensch/-/mensch-0.3.4.tgz" }, + "meow": { + "version": "3.7.0", + "from": "meow@>=3.3.0 <4.0.0", + "resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz", + "dev": true + }, "merge-descriptors": { "version": "1.0.1", "from": "merge-descriptors@1.0.1", @@ -3013,6 +5383,12 @@ "from": "mimer@>=1.0.0 <2.0.0", "resolved": "https://registry.npmjs.org/mimer/-/mimer-1.1.1.tgz" }, + "mimic-fn": { + "version": "1.2.0", + "from": "mimic-fn@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", + "dev": true + }, "minimatch": { "version": "3.1.2", "from": "minimatch@>=3.1.1 <4.0.0", @@ -3040,6 +5416,68 @@ "from": "mkdirp@>=0.5.4 <0.6.0", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz" }, + "mocha": { + "version": "3.5.3", + "from": "mocha@3.5.3", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-3.5.3.tgz", + "dev": true, + "dependencies": { + "commander": { + "version": "2.9.0", + "from": "commander@2.9.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.9.0.tgz", + "dev": true + }, + "debug": { + "version": "2.6.8", + "from": "debug@2.6.8", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz", + "dev": true + }, + "diff": { + "version": "3.2.0", + "from": "diff@3.2.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.2.0.tgz", + "dev": true + }, + "glob": { + "version": "7.1.1", + "from": "glob@7.1.1", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.1.tgz", + "dev": true + }, + "has-flag": { + "version": "1.0.0", + "from": "has-flag@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", + "dev": true + }, + "he": { + "version": "1.1.1", + "from": "he@1.1.1", + "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", + "dev": true + }, + "minimist": { + "version": "0.0.8", + "from": "minimist@0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "dev": true + }, + "mkdirp": { + "version": "0.5.1", + "from": "mkdirp@0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "dev": true + }, + "supports-color": { + "version": "3.1.2", + "from": "supports-color@3.1.2", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.1.2.tgz", + "dev": true + } + } + }, "moment": { "version": "2.27.0", "from": "moment@2.27.0", @@ -3062,6 +5500,12 @@ } } }, + "mout": { + "version": "1.2.3", + "from": "mout@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/mout/-/mout-1.2.3.tgz", + "dev": true + }, "ms": { "version": "2.0.0", "from": "ms@2.0.0", @@ -3072,6 +5516,12 @@ "from": "multer@1.4.2", "resolved": "https://registry.npmjs.org/multer/-/multer-1.4.2.tgz" }, + "multimatch": { + "version": "2.1.0", + "from": "multimatch@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/multimatch/-/multimatch-2.1.0.tgz", + "dev": true + }, "multistream": { "version": "2.1.1", "from": "multistream@>=2.0.5 <3.0.0", @@ -3135,6 +5585,12 @@ "resolved": "https://registry.npmjs.org/natural/-/natural-0.2.1.tgz", "optional": true }, + "natural-compare": { + "version": "1.4.0", + "from": "natural-compare@>=1.4.0 <2.0.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "dev": true + }, "ncp": { "version": "2.0.0", "from": "ncp@>=2.0.0 <2.1.0", @@ -3168,6 +5624,38 @@ "from": "negotiator@0.6.3", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz" }, + "neo-async": { + "version": "2.6.2", + "from": "neo-async@>=2.6.0 <3.0.0", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "dev": true + }, + "ng-annotate": { + "version": "1.2.2", + "from": "ng-annotate@>=1.2.1 <2.0.0", + "resolved": "https://registry.npmjs.org/ng-annotate/-/ng-annotate-1.2.2.tgz", + "dev": true, + "dependencies": { + "acorn": { + "version": "2.6.4", + "from": "acorn@>=2.6.4 <2.7.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-2.6.4.tgz", + "dev": true + }, + "convert-source-map": { + "version": "1.1.3", + "from": "convert-source-map@>=1.1.2 <1.2.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.1.3.tgz", + "dev": true + }, + "source-map": { + "version": "0.5.7", + "from": "source-map@>=0.5.3 <0.6.0", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "dev": true + } + } + }, "nib": { "version": "1.1.2", "from": "nib@>=1.1.2 <1.2.0", @@ -3200,6 +5688,12 @@ "from": "nice-try@>=1.0.4 <2.0.0", "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz" }, + "no-case": { + "version": "2.3.2", + "from": "no-case@>=2.2.0 <3.0.0", + "resolved": "https://registry.npmjs.org/no-case/-/no-case-2.3.2.tgz", + "dev": true + }, "node-expat": { "version": "2.4.0", "from": "node-expat@>=2.3.15 <3.0.0", @@ -3215,6 +5709,80 @@ "from": "node-forge@>=0.10.0 <0.11.0", "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.10.0.tgz" }, + "node-gyp": { + "version": "3.8.0", + "from": "node-gyp@>=3.3.1 <4.0.0", + "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-3.8.0.tgz", + "dev": true, + "dependencies": { + "ajv": { + "version": "6.12.6", + "from": "ajv@^6.12.3", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "dev": true + }, + "fast-deep-equal": { + "version": "3.1.3", + "from": "fast-deep-equal@^3.1.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "dev": true + }, + "har-validator": { + "version": "5.1.5", + "from": "har-validator@>=5.1.3 <5.2.0", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", + "dev": true + }, + "json-schema-traverse": { + "version": "0.4.1", + "from": "json-schema-traverse@^0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "dev": true + }, + "nopt": { + "version": "3.0.6", + "from": "nopt@>=2.0.0 <3.0.0||>=3.0.0 <4.0.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", + "dev": true + }, + "oauth-sign": { + "version": "0.9.0", + "from": "oauth-sign@>=0.9.0 <0.10.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", + "dev": true + }, + "punycode": { + "version": "2.1.1", + "from": "punycode@>=2.1.1 <3.0.0", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "dev": true + }, + "qs": { + "version": "6.5.3", + "from": "qs@>=6.5.2 <6.6.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz", + "dev": true + }, + "request": { + "version": "2.88.2", + "from": "request@>=2.87.0 <3.0.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", + "dev": true + }, + "semver": { + "version": "5.3.0", + "from": "semver@>=5.3.0 <5.4.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", + "dev": true + }, + "tough-cookie": { + "version": "2.5.0", + "from": "tough-cookie@>=2.5.0 <2.6.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", + "dev": true + } + } + }, "node-redis-scripty": { "version": "0.0.5", "from": "node-redis-scripty@0.0.5", @@ -3239,6 +5807,50 @@ } } }, + "node-sass": { + "version": "3.13.1", + "from": "node-sass@>=3.7.0 <4.0.0", + "resolved": "https://registry.npmjs.org/node-sass/-/node-sass-3.13.1.tgz", + "dev": true, + "dependencies": { + "ansi-styles": { + "version": "2.2.1", + "from": "ansi-styles@>=2.2.1 <3.0.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "dev": true + }, + "chalk": { + "version": "1.1.3", + "from": "chalk@>=1.1.1 <2.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "dev": true + }, + "cross-spawn": { + "version": "3.0.1", + "from": "cross-spawn@>=3.0.0 <4.0.0", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-3.0.1.tgz", + "dev": true + }, + "lru-cache": { + "version": "4.1.5", + "from": "lru-cache@^4.0.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", + "dev": true + }, + "strip-ansi": { + "version": "3.0.1", + "from": "strip-ansi@>=3.0.0 <4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "dev": true + }, + "supports-color": { + "version": "2.0.0", + "from": "supports-color@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "dev": true + } + } + }, "node-tnef": { "version": "1.3.3", "from": "node-tnef@1.3.3", @@ -3351,6 +5963,118 @@ "from": "nodemailer-plugin-inline-base64@2.1.1", "resolved": "https://registry.npmjs.org/nodemailer-plugin-inline-base64/-/nodemailer-plugin-inline-base64-2.1.1.tgz" }, + "nodemailer-sendmail-transport": { + "version": "1.0.0", + "from": "nodemailer-sendmail-transport@1.0.0", + "resolved": "https://registry.npmjs.org/nodemailer-sendmail-transport/-/nodemailer-sendmail-transport-1.0.0.tgz", + "dev": true + }, + "nodemon": { + "version": "2.0.20", + "from": "nodemon@>=2.0.4 <3.0.0", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-2.0.20.tgz", + "dev": true, + "dependencies": { + "anymatch": { + "version": "3.1.2", + "from": "anymatch@>=3.1.2 <3.2.0", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", + "dev": true + }, + "binary-extensions": { + "version": "2.2.0", + "from": "binary-extensions@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "dev": true + }, + "braces": { + "version": "3.0.2", + "from": "braces@>=3.0.2 <3.1.0", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "dev": true + }, + "chokidar": { + "version": "3.5.3", + "from": "chokidar@>=3.5.2 <4.0.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", + "dev": true + }, + "debug": { + "version": "3.2.7", + "from": "debug@>=3.2.7 <4.0.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "dev": true + }, + "fill-range": { + "version": "7.0.1", + "from": "fill-range@>=7.0.1 <8.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "dev": true + }, + "glob-parent": { + "version": "5.1.2", + "from": "glob-parent@>=5.1.2 <5.2.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "dev": true + }, + "is-binary-path": { + "version": "2.1.0", + "from": "is-binary-path@>=2.1.0 <2.2.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "dev": true + }, + "is-number": { + "version": "7.0.0", + "from": "is-number@>=7.0.0 <8.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "dev": true + }, + "ms": { + "version": "2.1.3", + "from": "ms@>=2.1.1 <3.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "dev": true + }, + "normalize-path": { + "version": "3.0.0", + "from": "normalize-path@>=3.0.0 <3.1.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "dev": true + }, + "readdirp": { + "version": "3.6.0", + "from": "readdirp@>=3.6.0 <3.7.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "dev": true + }, + "to-regex-range": { + "version": "5.0.1", + "from": "to-regex-range@>=5.0.1 <6.0.0", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "dev": true + } + } + }, + "nomnom": { + "version": "1.8.1", + "from": "nomnom@>=1.5.0", + "resolved": "https://registry.npmjs.org/nomnom/-/nomnom-1.8.1.tgz", + "dev": true, + "dependencies": { + "underscore": { + "version": "1.6.0", + "from": "underscore@>=1.6.0 <1.7.0", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.6.0.tgz", + "dev": true + } + } + }, + "nopt": { + "version": "1.0.10", + "from": "nopt@>=1.0.10 <1.1.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", + "dev": true + }, "normalize-package-data": { "version": "2.5.0", "from": "normalize-package-data@>=2.3.2 <3.0.0", @@ -3366,6 +6090,12 @@ "from": "notepack.io@>=2.1.0 <2.2.0", "resolved": "https://registry.npmjs.org/notepack.io/-/notepack.io-2.1.3.tgz" }, + "npmlog": { + "version": "4.1.2", + "from": "npmlog@>=4.0.0 <5.0.0", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", + "dev": true + }, "nssocket": { "version": "0.6.0", "from": "nssocket@0.6.0", @@ -3383,6 +6113,12 @@ "from": "nth-check@>=1.0.1 <1.1.0", "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-1.0.2.tgz" }, + "num2fraction": { + "version": "1.2.2", + "from": "num2fraction@>=1.1.0 <2.0.0", + "resolved": "https://registry.npmjs.org/num2fraction/-/num2fraction-1.2.2.tgz", + "dev": true + }, "number-is-nan": { "version": "1.0.1", "from": "number-is-nan@>=1.0.0 <2.0.0", @@ -3475,6 +6211,124 @@ "from": "once@>=1.4.0 <2.0.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz" }, + "one-time": { + "version": "1.0.0", + "from": "one-time@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/one-time/-/one-time-1.0.0.tgz", + "dev": true + }, + "onetime": { + "version": "2.0.1", + "from": "onetime@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", + "dev": true + }, + "opencollective": { + "version": "1.0.3", + "from": "opencollective@1.0.3", + "resolved": "https://registry.npmjs.org/opencollective/-/opencollective-1.0.3.tgz", + "dev": true, + "dependencies": { + "ansi-escapes": { + "version": "1.4.0", + "from": "ansi-escapes@>=1.1.0 <2.0.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-1.4.0.tgz", + "dev": true + }, + "ansi-styles": { + "version": "2.2.1", + "from": "ansi-styles@>=2.2.1 <3.0.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "dev": true + }, + "chalk": { + "version": "1.1.3", + "from": "chalk@1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "dev": true + }, + "chardet": { + "version": "0.4.2", + "from": "chardet@>=0.4.0 <0.5.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz", + "dev": true + }, + "external-editor": { + "version": "2.2.0", + "from": "external-editor@>=2.0.1 <3.0.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.2.0.tgz", + "dev": true + }, + "inquirer": { + "version": "3.0.6", + "from": "inquirer@3.0.6", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.0.6.tgz", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "from": "is-fullwidth-code-point@^2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "dev": true + }, + "minimist": { + "version": "1.2.0", + "from": "minimist@1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "dev": true + }, + "mute-stream": { + "version": "0.0.7", + "from": "mute-stream@0.0.7", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", + "dev": true + }, + "node-fetch": { + "version": "1.6.3", + "from": "node-fetch@1.6.3", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.6.3.tgz", + "dev": true + }, + "opn": { + "version": "4.0.2", + "from": "opn@4.0.2", + "resolved": "https://registry.npmjs.org/opn/-/opn-4.0.2.tgz", + "dev": true + }, + "string-width": { + "version": "2.1.1", + "from": "string-width@^2.0.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "dev": true, + "dependencies": { + "ansi-regex": { + "version": "3.0.1", + "from": "ansi-regex@^3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", + "dev": true + }, + "strip-ansi": { + "version": "4.0.0", + "from": "strip-ansi@^4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "dev": true + } + } + }, + "strip-ansi": { + "version": "3.0.1", + "from": "strip-ansi@>=3.0.0 <4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "dev": true + }, + "supports-color": { + "version": "2.0.0", + "from": "supports-color@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "dev": true + } + } + }, "opn": { "version": "5.5.0", "from": "opn@>=5.3.0 <6.0.0", @@ -3497,11 +6351,41 @@ "from": "optionator@>=0.8.1 <0.9.0", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz" }, + "ordered-ast-traverse": { + "version": "1.1.1", + "from": "ordered-ast-traverse@>=1.1.1 <1.2.0", + "resolved": "https://registry.npmjs.org/ordered-ast-traverse/-/ordered-ast-traverse-1.1.1.tgz", + "dev": true + }, + "ordered-esprima-props": { + "version": "1.1.0", + "from": "ordered-esprima-props@>=1.1.0 <1.2.0", + "resolved": "https://registry.npmjs.org/ordered-esprima-props/-/ordered-esprima-props-1.1.0.tgz", + "dev": true + }, + "os-homedir": { + "version": "1.0.2", + "from": "os-homedir@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "dev": true + }, "os-locale": { "version": "1.4.0", "from": "os-locale@>=1.4.0 <2.0.0", "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz" }, + "os-tmpdir": { + "version": "1.0.2", + "from": "os-tmpdir@>=1.0.2 <1.1.0", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "dev": true + }, + "osenv": { + "version": "0.1.5", + "from": "osenv@>=0.1.3 <0.2.0", + "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", + "dev": true + }, "p-limit": { "version": "2.3.0", "from": "p-limit@>=2.2.0 <3.0.0", @@ -3527,11 +6411,29 @@ "from": "papaparse@4.6.3", "resolved": "https://registry.npmjs.org/papaparse/-/papaparse-4.6.3.tgz" }, + "param-case": { + "version": "2.1.1", + "from": "param-case@>=2.1.1 <3.0.0", + "resolved": "https://registry.npmjs.org/param-case/-/param-case-2.1.1.tgz", + "dev": true + }, + "parent-module": { + "version": "1.0.1", + "from": "parent-module@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "dev": true + }, "parse-json": { "version": "2.2.0", "from": "parse-json@>=2.2.0 <3.0.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz" }, + "parse-ms": { + "version": "1.0.1", + "from": "parse-ms@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-1.0.1.tgz", + "dev": true + }, "parse5": { "version": "5.1.0", "from": "parse5@5.1.0", @@ -3597,6 +6499,12 @@ "from": "path-is-absolute@>=1.0.0 <2.0.0", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz" }, + "path-is-inside": { + "version": "1.0.2", + "from": "path-is-inside@>=1.0.2 <2.0.0", + "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", + "dev": true + }, "path-key": { "version": "2.0.1", "from": "path-key@>=2.0.1 <3.0.0", @@ -3656,6 +6564,12 @@ "from": "performance-now@>=2.1.0 <3.0.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz" }, + "picomatch": { + "version": "2.3.1", + "from": "picomatch@>=2.0.4 <3.0.0", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "dev": true + }, "pidusage": { "version": "1.2.0", "from": "pidusage@>=1.2.0 <2.0.0", @@ -3676,11 +6590,23 @@ "from": "pinkie-promise@>=2.0.0 <3.0.0", "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz" }, + "pkg-up": { + "version": "1.0.0", + "from": "pkg-up@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/pkg-up/-/pkg-up-1.0.0.tgz", + "dev": true + }, "pkginfo": { "version": "0.4.1", "from": "pkginfo@0.4.1", "resolved": "https://registry.npmjs.org/pkginfo/-/pkginfo-0.4.1.tgz" }, + "plur": { + "version": "1.0.0", + "from": "plur@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/plur/-/plur-1.0.0.tgz", + "dev": true + }, "pm2": { "version": "2.10.4", "from": "pm2@2.10.4", @@ -3831,6 +6757,26 @@ "from": "posix-character-classes@>=0.1.0 <0.2.0", "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz" }, + "postcss": { + "version": "4.1.16", + "from": "postcss@>=4.1.11 <5.0.0", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-4.1.16.tgz", + "dev": true, + "dependencies": { + "es6-promise": { + "version": "2.3.0", + "from": "es6-promise@>=2.3.0 <2.4.0", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-2.3.0.tgz", + "dev": true + }, + "source-map": { + "version": "0.4.4", + "from": "source-map@>=0.4.2 <0.5.0", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", + "dev": true + } + } + }, "precond": { "version": "0.2.3", "from": "precond@>=0.2.0 <0.3.0", @@ -3841,11 +6787,35 @@ "from": "prelude-ls@>=1.1.2 <1.2.0", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz" }, + "prettier": { + "version": "1.19.1", + "from": "prettier@1.19.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.19.1.tgz", + "dev": true + }, + "pretty-bytes": { + "version": "3.0.1", + "from": "pretty-bytes@>=3.0.0 <4.0.0", + "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-3.0.1.tgz", + "dev": true + }, + "pretty-ms": { + "version": "2.1.0", + "from": "pretty-ms@>=2.1.0 <3.0.0", + "resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-2.1.0.tgz", + "dev": true + }, "process-nextick-args": { "version": "2.0.1", "from": "process-nextick-args@>=2.0.0 <2.1.0", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz" }, + "progress": { + "version": "2.0.3", + "from": "progress@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "dev": true + }, "promise": { "version": "7.3.1", "from": "promise@>=7.1.1 <8.0.0", @@ -3856,16 +6826,40 @@ "from": "promptly@2.2.0", "resolved": "https://registry.npmjs.org/promptly/-/promptly-2.2.0.tgz" }, + "propprop": { + "version": "0.3.1", + "from": "propprop@>=0.3.0 <0.4.0", + "resolved": "https://registry.npmjs.org/propprop/-/propprop-0.3.1.tgz", + "dev": true + }, + "proto-list": { + "version": "1.2.4", + "from": "proto-list@>=1.2.1 <1.3.0", + "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", + "dev": true + }, "proxy-addr": { "version": "2.0.7", "from": "proxy-addr@>=2.0.5 <2.1.0", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz" }, + "pseudomap": { + "version": "1.0.2", + "from": "pseudomap@>=1.0.2 <2.0.0", + "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "dev": true + }, "psl": { "version": "1.8.0", "from": "psl@>=1.1.28 <2.0.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz" }, + "pstree.remy": { + "version": "1.1.8", + "from": "pstree.remy@>=1.1.8 <2.0.0", + "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", + "dev": true + }, "pug": { "version": "2.0.4", "from": "pug@>=2.0.0-beta3 <3.0.0", @@ -3966,6 +6960,12 @@ "from": "raw-body@2.4.0", "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz" }, + "rc": { + "version": "1.2.8", + "from": "rc@>=0.5.5", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "dev": true + }, "read": { "version": "1.0.7", "from": "read@>=1.0.4 <2.0.0", @@ -3996,6 +6996,12 @@ "from": "rechoir@>=0.6.2 <0.7.0", "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz" }, + "redent": { + "version": "1.0.0", + "from": "redent@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz", + "dev": true + }, "redis": { "version": "2.6.5", "from": "redis@>=2.6.0-2 <2.7.0", @@ -4037,6 +7043,12 @@ } } }, + "reflect-metadata": { + "version": "0.1.10", + "from": "reflect-metadata@0.1.10", + "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.10.tgz", + "dev": true + }, "regenerator-runtime": { "version": "0.11.1", "from": "regenerator-runtime@>=0.11.0 <0.12.0", @@ -4052,6 +7064,18 @@ "from": "regexp.prototype.flags@>=1.3.0 <2.0.0", "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.4.3.tgz" }, + "regexpp": { + "version": "2.0.1", + "from": "regexpp@>=2.0.1 <3.0.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", + "dev": true + }, + "relateurl": { + "version": "0.2.7", + "from": "relateurl@>=0.2.7 <0.3.0", + "resolved": "https://registry.npmjs.org/relateurl/-/relateurl-0.2.7.tgz", + "dev": true + }, "remove-trailing-separator": { "version": "1.1.0", "from": "remove-trailing-separator@>=1.0.1 <2.0.0", @@ -4067,6 +7091,12 @@ "from": "repeat-string@>=1.5.2 <2.0.0", "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz" }, + "repeating": { + "version": "2.0.1", + "from": "repeating@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", + "dev": true + }, "request": { "version": "2.83.0", "from": "request@>=2.83.0 <2.84.0", @@ -4104,6 +7134,12 @@ "from": "require-main-filename@>=1.0.1 <2.0.0", "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz" }, + "requirefresh": { + "version": "2.3.0", + "from": "requirefresh@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/requirefresh/-/requirefresh-2.3.0.tgz", + "dev": true + }, "requires-port": { "version": "1.0.0", "from": "requires-port@>=1.0.0 <2.0.0", @@ -4114,11 +7150,23 @@ "from": "resolve@>=1.1.6 <2.0.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz" }, + "resolve-from": { + "version": "4.0.0", + "from": "resolve-from@>=4.0.0 <5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "dev": true + }, "resolve-url": { "version": "0.2.1", "from": "resolve-url@>=0.2.1 <0.3.0", "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz" }, + "restore-cursor": { + "version": "2.0.0", + "from": "restore-cursor@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", + "dev": true + }, "restructure": { "version": "2.0.1", "from": "restructure@>=2.0.1 <3.0.0", @@ -4159,11 +7207,43 @@ "from": "rr@0.1.0", "resolved": "https://registry.npmjs.org/rr/-/rr-0.1.0.tgz" }, + "run-async": { + "version": "2.4.1", + "from": "run-async@>=2.2.0 <3.0.0", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", + "dev": true + }, + "rx": { + "version": "4.1.0", + "from": "rx@>=4.1.0 <5.0.0", + "resolved": "https://registry.npmjs.org/rx/-/rx-4.1.0.tgz", + "dev": true + }, + "rxjs": { + "version": "6.6.7", + "from": "rxjs@>=6.4.0 <7.0.0", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz", + "dev": true, + "dependencies": { + "tslib": { + "version": "1.14.1", + "from": "tslib@>=1.9.0 <2.0.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "dev": true + } + } + }, "safe-buffer": { "version": "5.1.2", "from": "safe-buffer@>=5.1.1 <5.2.0", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz" }, + "safe-json-parse": { + "version": "1.0.1", + "from": "safe-json-parse@>=1.0.1 <1.1.0", + "resolved": "https://registry.npmjs.org/safe-json-parse/-/safe-json-parse-1.0.1.tgz", + "dev": true + }, "safe-json-stringify": { "version": "1.2.0", "from": "safe-json-stringify@>=1.0.0 <2.0.0", @@ -4175,11 +7255,61 @@ "from": "safe-regex@>=1.1.0 <2.0.0", "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz" }, + "safe-stable-stringify": { + "version": "2.3.1", + "from": "safe-stable-stringify@2.3.1", + "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.3.1.tgz", + "dev": true + }, + "safefs": { + "version": "4.2.0", + "from": "safefs@>=4.0.0 <5.0.0", + "resolved": "https://registry.npmjs.org/safefs/-/safefs-4.2.0.tgz", + "dev": true + }, "safer-buffer": { "version": "2.1.2", "from": "safer-buffer@>=2.1.0 <2.2.0", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz" }, + "sass-graph": { + "version": "2.2.6", + "from": "sass-graph@>=2.1.1 <3.0.0", + "resolved": "https://registry.npmjs.org/sass-graph/-/sass-graph-2.2.6.tgz", + "dev": true, + "dependencies": { + "camelcase": { + "version": "3.0.0", + "from": "camelcase@>=3.0.0 <4.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", + "dev": true + }, + "cliui": { + "version": "3.2.0", + "from": "cliui@>=3.2.0 <4.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", + "dev": true + }, + "strip-ansi": { + "version": "3.0.1", + "from": "strip-ansi@>=3.0.1 <4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "dev": true + }, + "yargs": { + "version": "7.1.2", + "from": "yargs@>=7.0.0 <8.0.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-7.1.2.tgz", + "dev": true + }, + "yargs-parser": { + "version": "5.0.1", + "from": "yargs-parser@>=5.0.1 <6.0.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-5.0.1.tgz", + "dev": true + } + } + }, "sax": { "version": "1.2.1", "from": "sax@1.2.1", @@ -4190,6 +7320,20 @@ "from": "scmp@>=2.1.0 <3.0.0", "resolved": "https://registry.npmjs.org/scmp/-/scmp-2.1.0.tgz" }, + "scss-tokenizer": { + "version": "0.2.3", + "from": "scss-tokenizer@>=0.2.3 <0.3.0", + "resolved": "https://registry.npmjs.org/scss-tokenizer/-/scss-tokenizer-0.2.3.tgz", + "dev": true, + "dependencies": { + "source-map": { + "version": "0.4.4", + "from": "source-map@^0.4.2", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", + "dev": true + } + } + }, "semver": { "version": "5.7.1", "from": "semver@>=5.6.0 <6.0.0", @@ -4256,6 +7400,12 @@ "from": "set-blocking@>=2.0.0 <3.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz" }, + "set-immediate-shim": { + "version": "1.0.1", + "from": "set-immediate-shim@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz", + "dev": true + }, "set-value": { "version": "2.0.1", "from": "set-value@>=2.0.0 <3.0.0", @@ -4298,6 +7448,24 @@ "from": "side-channel@>=1.0.3 <2.0.0", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz" }, + "sigmund": { + "version": "1.0.1", + "from": "sigmund@>=1.0.1 <2.0.0", + "resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz", + "dev": true + }, + "signal-exit": { + "version": "3.0.7", + "from": "signal-exit@>=3.0.2 <4.0.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "dev": true + }, + "simple-fmt": { + "version": "0.1.0", + "from": "simple-fmt@>=0.1.0 <0.2.0", + "resolved": "https://registry.npmjs.org/simple-fmt/-/simple-fmt-0.1.0.tgz", + "dev": true + }, "simple-git": { "version": "1.132.0", "from": "simple-git@1.132.0", @@ -4315,6 +7483,60 @@ } } }, + "simple-is": { + "version": "0.2.0", + "from": "simple-is@>=0.2.0 <0.3.0", + "resolved": "https://registry.npmjs.org/simple-is/-/simple-is-0.2.0.tgz", + "dev": true + }, + "simple-swizzle": { + "version": "0.2.2", + "from": "simple-swizzle@>=0.2.2 <0.3.0", + "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", + "dev": true, + "dependencies": { + "is-arrayish": { + "version": "0.3.2", + "from": "is-arrayish@>=0.3.1 <0.4.0", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", + "dev": true + } + } + }, + "simple-update-notifier": { + "version": "1.0.7", + "from": "simple-update-notifier@>=1.0.7 <2.0.0", + "resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-1.0.7.tgz", + "dev": true, + "dependencies": { + "semver": { + "version": "7.0.0", + "from": "semver@>=7.0.0 <7.1.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz", + "dev": true + } + } + }, + "slice-ansi": { + "version": "2.1.0", + "from": "slice-ansi@>=2.1.0 <3.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", + "dev": true, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "from": "ansi-styles@^3.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "from": "is-fullwidth-code-point@^2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "dev": true + } + } + }, "slick": { "version": "1.12.2", "from": "slick@>=1.12.2 <2.0.0", @@ -4610,6 +7832,12 @@ "from": "sshpk@>=1.7.0 <2.0.0", "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.17.0.tgz" }, + "stable": { + "version": "0.1.8", + "from": "stable@>=0.1.5 <0.2.0", + "resolved": "https://registry.npmjs.org/stable/-/stable-0.1.8.tgz", + "dev": true + }, "stack-trace": { "version": "0.0.10", "from": "stack-trace@>=0.0.0 <0.1.0", @@ -4662,6 +7890,12 @@ "from": "string_decoder@>=1.1.1 <1.2.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz" }, + "string-template": { + "version": "1.0.0", + "from": "string-template@1.0.0", + "resolved": "https://registry.npmjs.org/string-template/-/string-template-1.0.0.tgz", + "dev": true + }, "string-width": { "version": "1.0.2", "from": "string-width@>=1.0.1 <2.0.0", @@ -4684,6 +7918,18 @@ "from": "string.prototype.trimstart@>=1.0.5 <2.0.0", "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.5.tgz" }, + "stringmap": { + "version": "0.2.2", + "from": "stringmap@>=0.2.2 <0.3.0", + "resolved": "https://registry.npmjs.org/stringmap/-/stringmap-0.2.2.tgz", + "dev": true + }, + "stringset": { + "version": "0.2.1", + "from": "stringset@>=0.2.1 <0.3.0", + "resolved": "https://registry.npmjs.org/stringset/-/stringset-0.2.1.tgz", + "dev": true + }, "stringstream": { "version": "0.0.6", "from": "stringstream@>=0.0.5 <0.1.0", @@ -4699,6 +7945,18 @@ "from": "strip-bom@>=2.0.0 <3.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz" }, + "strip-indent": { + "version": "1.0.1", + "from": "strip-indent@>=1.0.1 <2.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz", + "dev": true + }, + "strip-json-comments": { + "version": "2.0.1", + "from": "strip-json-comments@>=2.0.1 <3.0.0", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "dev": true + }, "stylus": { "version": "0.54.8", "from": "stylus@>=0.54.5 <0.55.0", @@ -4736,6 +7994,26 @@ } } }, + "superagent": { + "version": "2.3.0", + "from": "superagent@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/superagent/-/superagent-2.3.0.tgz", + "dev": true, + "dependencies": { + "async": { + "version": "1.5.2", + "from": "async@>=1.5.2 <2.0.0", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "dev": true + }, + "form-data": { + "version": "1.0.0-rc4", + "from": "form-data@1.0.0-rc4", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-1.0.0-rc4.tgz", + "dev": true + } + } + }, "supports-color": { "version": "5.5.0", "from": "supports-color@>=5.3.0 <6.0.0", @@ -4771,6 +8049,68 @@ "from": "systeminformation@3.54.0", "resolved": "https://registry.npmjs.org/systeminformation/-/systeminformation-3.54.0.tgz" }, + "table": { + "version": "5.4.6", + "from": "table@>=5.2.3 <6.0.0", + "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", + "dev": true, + "dependencies": { + "ajv": { + "version": "6.12.6", + "from": "ajv@^6.10.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "dev": true + }, + "ansi-regex": { + "version": "4.1.1", + "from": "ansi-regex@>=4.1.0 <5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", + "dev": true + }, + "emoji-regex": { + "version": "7.0.3", + "from": "emoji-regex@>=7.0.1 <8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "dev": true + }, + "fast-deep-equal": { + "version": "3.1.3", + "from": "fast-deep-equal@^3.1.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "from": "is-fullwidth-code-point@^2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "dev": true + }, + "json-schema-traverse": { + "version": "0.4.1", + "from": "json-schema-traverse@^0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "from": "string-width@>=3.0.0 <4.0.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "dev": true + }, + "strip-ansi": { + "version": "5.2.0", + "from": "strip-ansi@>=5.1.0 <6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "dev": true + } + } + }, + "tar": { + "version": "2.2.2", + "from": "tar@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/tar/-/tar-2.2.2.tgz", + "dev": true + }, "tar-stream": { "version": "1.6.2", "from": "tar-stream@>=1.5.0 <2.0.0", @@ -4786,6 +8126,18 @@ "from": "terraformer-wkt-parser@>=1.1.0 <2.0.0", "resolved": "https://registry.npmjs.org/terraformer-wkt-parser/-/terraformer-wkt-parser-1.2.1.tgz" }, + "text-hex": { + "version": "1.0.0", + "from": "text-hex@>=1.0.0 <1.1.0", + "resolved": "https://registry.npmjs.org/text-hex/-/text-hex-1.0.0.tgz", + "dev": true + }, + "text-table": { + "version": "0.2.0", + "from": "text-table@>=0.2.0 <0.3.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "dev": true + }, "through": { "version": "2.3.8", "from": "through@>=2.2.7 <3.0.0", @@ -4801,16 +8153,92 @@ "from": "tiff2pdf@1.0.2", "resolved": "https://registry.npmjs.org/tiff2pdf/-/tiff2pdf-1.0.2.tgz" }, + "time-grunt": { + "version": "1.4.0", + "from": "time-grunt@1.4.0", + "resolved": "https://registry.npmjs.org/time-grunt/-/time-grunt-1.4.0.tgz", + "dev": true, + "dependencies": { + "ansi-styles": { + "version": "2.2.1", + "from": "ansi-styles@>=2.2.1 <3.0.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "dev": true + }, + "chalk": { + "version": "1.1.3", + "from": "chalk@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "dev": true + }, + "figures": { + "version": "1.7.0", + "from": "figures@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", + "dev": true + }, + "strip-ansi": { + "version": "3.0.1", + "from": "strip-ansi@>=3.0.0 <4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "dev": true + }, + "supports-color": { + "version": "2.0.0", + "from": "supports-color@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "dev": true + } + } + }, + "time-zone": { + "version": "0.1.0", + "from": "time-zone@>=0.1.0 <0.2.0", + "resolved": "https://registry.npmjs.org/time-zone/-/time-zone-0.1.0.tgz", + "dev": true + }, "tiny-inflate": { "version": "1.0.3", "from": "tiny-inflate@>=1.0.0 <2.0.0", "resolved": "https://registry.npmjs.org/tiny-inflate/-/tiny-inflate-1.0.3.tgz" }, + "tiny-lr": { + "version": "1.1.1", + "from": "tiny-lr@>=1.1.1 <2.0.0", + "resolved": "https://registry.npmjs.org/tiny-lr/-/tiny-lr-1.1.1.tgz", + "dev": true, + "dependencies": { + "debug": { + "version": "3.2.7", + "from": "debug@^3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "dev": true + }, + "faye-websocket": { + "version": "0.10.0", + "from": "faye-websocket@>=0.10.0 <0.11.0", + "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.10.0.tgz", + "dev": true + }, + "ms": { + "version": "2.1.3", + "from": "ms@^2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "dev": true + } + } + }, "tlds": { "version": "1.203.1", "from": "tlds@1.203.1", "resolved": "https://registry.npmjs.org/tlds/-/tlds-1.203.1.tgz" }, + "tmp": { + "version": "0.0.33", + "from": "tmp@>=0.0.33 <0.0.34", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "dev": true + }, "to-array": { "version": "0.1.4", "from": "to-array@0.1.4", @@ -4873,6 +8301,12 @@ "from": "toposort-class@>=1.0.1 <2.0.0", "resolved": "https://registry.npmjs.org/toposort-class/-/toposort-class-1.0.1.tgz" }, + "touch": { + "version": "3.1.0", + "from": "touch@>=3.1.0 <4.0.0", + "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.0.tgz", + "dev": true + }, "tough-cookie": { "version": "2.3.4", "from": "tough-cookie@>=2.3.3 <2.4.0", @@ -4890,6 +8324,24 @@ "from": "tr46@>=0.0.3 <0.1.0", "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz" }, + "trim-newlines": { + "version": "1.0.0", + "from": "trim-newlines@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz", + "dev": true + }, + "triple-beam": { + "version": "1.3.0", + "from": "triple-beam@>=1.3.0 <2.0.0", + "resolved": "https://registry.npmjs.org/triple-beam/-/triple-beam-1.3.0.tgz", + "dev": true + }, + "tryor": { + "version": "0.1.2", + "from": "tryor@>=0.1.2 <0.2.0", + "resolved": "https://registry.npmjs.org/tryor/-/tryor-0.1.2.tgz", + "dev": true + }, "tslib": { "version": "2.4.0", "from": "tslib@>=2.4.0 <3.0.0", @@ -4947,6 +8399,12 @@ "from": "type-check@>=0.3.2 <0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz" }, + "type-detect": { + "version": "1.0.0", + "from": "type-detect@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-1.0.0.tgz", + "dev": true + }, "type-is": { "version": "1.6.18", "from": "type-is@>=1.6.17 <1.7.0", @@ -4957,6 +8415,12 @@ "from": "typecast@0.0.1", "resolved": "https://registry.npmjs.org/typecast/-/typecast-0.0.1.tgz" }, + "typechecker": { + "version": "4.11.0", + "from": "typechecker@>=4.9.0 <5.0.0", + "resolved": "https://registry.npmjs.org/typechecker/-/typechecker-4.11.0.tgz", + "dev": true + }, "typedarray": { "version": "0.0.6", "from": "typedarray@>=0.0.6 <0.0.7", @@ -5010,12 +8474,24 @@ "from": "unbox-primitive@>=1.0.2 <2.0.0", "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz" }, + "undefsafe": { + "version": "2.0.5", + "from": "undefsafe@>=2.0.5 <3.0.0", + "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz", + "dev": true + }, "underscore": { "version": "1.13.4", "from": "underscore@>=1.3.1", "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.4.tgz", "optional": true }, + "underscore.string": { + "version": "3.3.6", + "from": "underscore.string@>=3.3.4 <3.4.0", + "resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-3.3.6.tgz", + "dev": true + }, "unicode-properties": { "version": "1.4.1", "from": "unicode-properties@>=1.3.1 <2.0.0", @@ -5065,11 +8541,23 @@ } } }, + "untildify": { + "version": "2.1.0", + "from": "untildify@>=2.1.0 <3.0.0", + "resolved": "https://registry.npmjs.org/untildify/-/untildify-2.1.0.tgz", + "dev": true + }, "upath": { "version": "1.2.0", "from": "upath@>=1.1.1 <2.0.0", "resolved": "https://registry.npmjs.org/upath/-/upath-1.2.0.tgz" }, + "upper-case": { + "version": "1.1.3", + "from": "upper-case@>=1.1.1 <2.0.0", + "resolved": "https://registry.npmjs.org/upper-case/-/upper-case-1.1.3.tgz", + "dev": true + }, "uri-js": { "version": "4.4.1", "from": "uri-js@>=4.2.2 <5.0.0", @@ -5082,6 +8570,12 @@ } } }, + "uri-path": { + "version": "1.0.0", + "from": "uri-path@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/uri-path/-/uri-path-1.0.0.tgz", + "dev": true + }, "urix": { "version": "0.1.0", "from": "urix@>=0.1.0 <0.2.0", @@ -5379,6 +8873,12 @@ "from": "which-typed-array@>=1.1.2 <2.0.0", "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.8.tgz" }, + "wide-align": { + "version": "1.1.5", + "from": "wide-align@>=1.1.0 <2.0.0", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", + "dev": true + }, "window-size": { "version": "0.1.0", "from": "window-size@0.1.0", @@ -5396,6 +8896,58 @@ } } }, + "winston-transport": { + "version": "4.5.0", + "from": "winston-transport@>=4.5.0 <5.0.0", + "resolved": "https://registry.npmjs.org/winston-transport/-/winston-transport-4.5.0.tgz", + "dev": true, + "dependencies": { + "readable-stream": { + "version": "3.6.0", + "from": "readable-stream@^3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "dev": true + } + } + }, + "wiredep": { + "version": "4.0.0", + "from": "wiredep@>=4.0.0 <4.1.0", + "resolved": "https://registry.npmjs.org/wiredep/-/wiredep-4.0.0.tgz", + "dev": true + }, + "wiredep-cli": { + "version": "0.1.0", + "from": "wiredep-cli@>=0.1.0 <0.2.0", + "resolved": "https://registry.npmjs.org/wiredep-cli/-/wiredep-cli-0.1.0.tgz", + "dev": true, + "dependencies": { + "ansi-styles": { + "version": "2.2.1", + "from": "ansi-styles@>=2.2.1 <3.0.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "dev": true + }, + "chalk": { + "version": "1.1.3", + "from": "chalk@>=1.1.1 <2.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "dev": true + }, + "strip-ansi": { + "version": "3.0.1", + "from": "strip-ansi@>=3.0.0 <4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "dev": true + }, + "supports-color": { + "version": "2.0.0", + "from": "supports-color@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "dev": true + } + } + }, "with": { "version": "5.1.1", "from": "with@>=5.0.0 <6.0.0", @@ -5452,6 +9004,12 @@ "from": "wrappy@>=1.0.0 <2.0.0", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz" }, + "write": { + "version": "1.0.3", + "from": "write@1.0.3", + "resolved": "https://registry.npmjs.org/write/-/write-1.0.3.tgz", + "dev": true + }, "ws": { "version": "4.1.0", "from": "ws@4.1.0", @@ -5533,6 +9091,12 @@ "from": "y18n@>=3.2.1 <4.0.0", "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.2.tgz" }, + "yallist": { + "version": "2.1.2", + "from": "yallist@>=2.1.2 <3.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "dev": true + }, "yamljs": { "version": "0.3.0", "from": "yamljs@>=0.3.0 <0.4.0", diff --git a/package.json b/package.json index b4573ff..c4ff6f9 100644 --- a/package.json +++ b/package.json @@ -161,6 +161,7 @@ }, "devDependencies": { "acorn": "6.4.2", + "acorn-jsx": "^3.0.1", "apidoc": "0.24.0", "chai": "3.5.0", "chai-http": "3.0.0", diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js index 803836e..da65524 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 _0x3bda=['urlForward[body]','exports','getDataValue','action','STRING','contactManager','integration','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','TEXT'];(function(_0x1d2113,_0x3f7d50){var _0x20f278=function(_0x5f39cc){while(--_0x5f39cc){_0x1d2113['push'](_0x1d2113['shift']());}};_0x20f278(++_0x3f7d50);}(_0x3bda,0x143));var _0xa3bd=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0x3bda[_0x35885a];return _0xe86249;};'use strict';var Sequelize=require('sequelize');module[_0xa3bd('0x0')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x5c7b28){return this[_0xa3bd('0x1')](_0xa3bd('0x2'));}},'action':{'type':Sequelize[_0xa3bd('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0xa3bd('0x4'),_0xa3bd('0x5'),'motionbar','jscripty','urlForward',_0xa3bd('0x6'),_0xa3bd('0x7'),_0xa3bd('0x8')]],'msg':_0xa3bd('0x9')}},'comment':_0xa3bd('0x9')},'data1':{'type':Sequelize[_0xa3bd('0x3')](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize[_0xa3bd('0x3')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0xa3bd('0x3')](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize[_0xa3bd('0x3')](0x1000),'comments':_0xa3bd('0xa')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0xa3bd('0xb')},'data6':{'type':Sequelize[_0xa3bd('0x3')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0xa3bd('0xc')],'comments':_0xa3bd('0xd')}}; \ No newline at end of file +var _0x308a=['jscripty','urlForward','browser','bot','script','STRING','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[body]','sequelize','VIRTUAL','getDataValue','action','integration','motionbar'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x308a,0x71));var _0xa308=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x308a[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xa308('0x0'));module['exports']={'name':{'type':Sequelize[_0xa308('0x1')],'get':function(_0x9efb23){return this[_0xa308('0x2')](_0xa308('0x3'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0xa308('0x4'),_0xa308('0x5'),_0xa308('0x6'),_0xa308('0x7'),_0xa308('0x8'),_0xa308('0x9'),_0xa308('0xa')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0xa308('0xb')](0x1000),'comment':_0xa308('0xc')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0xa308('0xd')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0xa308('0xe')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0xa308('0xf')},'data5':{'type':Sequelize[_0xa308('0xb')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0xa308('0xb')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize['TEXT'],'comments':_0xa308('0x10')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 3e182d6..56f3621 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 _0xbc91=['body','Action','params','find','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','apply','reject','update','then','destroy','error','name'];(function(_0x2b8c9c,_0x41e0c8){var _0x4ebc81=function(_0x55a9b9){while(--_0x55a9b9){_0x2b8c9c['push'](_0x2b8c9c['shift']());}};_0x4ebc81(++_0x41e0c8);}(_0xbc91,0x119));var _0x1bc9=function(_0x4fc557,_0x4e2491){_0x4fc557=_0x4fc557-0x0;var _0x9fa268=_0xbc91[_0x4fc557];return _0x9fa268;};'use strict';var emlformat=require(_0x1bc9('0x0'));var rimraf=require(_0x1bc9('0x1'));var zipdir=require(_0x1bc9('0x2'));var jsonpatch=require(_0x1bc9('0x3'));var rp=require(_0x1bc9('0x4'));var moment=require('moment');var BPromise=require(_0x1bc9('0x5'));var Mustache=require(_0x1bc9('0x6'));var util=require('util');var path=require(_0x1bc9('0x7'));var sox=require('sox');var csv=require(_0x1bc9('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1bc9('0x9'));var _=require(_0x1bc9('0xa'));var squel=require(_0x1bc9('0xb'));var crypto=require(_0x1bc9('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1bc9('0xd'));var toCsv=require('to-csv');var querystring=require(_0x1bc9('0xe'));var Papa=require(_0x1bc9('0xf'));var Redis=require(_0x1bc9('0x10'));var authService=require(_0x1bc9('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1bc9('0x12'));var logger=require(_0x1bc9('0x13'))(_0x1bc9('0x14'));var utils=require(_0x1bc9('0x15'));var config=require(_0x1bc9('0x16'));var licenseUtil=require(_0x1bc9('0x17'));var db=require(_0x1bc9('0x18'))['db'];function respondWithStatusCode(_0x5b9333,_0x564b2b){_0x564b2b=_0x564b2b||0xcc;return function(_0x42414){if(_0x42414){return _0x5b9333[_0x1bc9('0x19')](_0x564b2b);}return _0x5b9333[_0x1bc9('0x1a')](_0x564b2b)[_0x1bc9('0x1b')]();};}function respondWithResult(_0x2c178c,_0x1de310){_0x1de310=_0x1de310||0xc8;return function(_0x336515){if(_0x336515){return _0x2c178c[_0x1bc9('0x1a')](_0x1de310)['json'](_0x336515);}};}function respondWithFilteredResult(_0x45aafb,_0xeea899){return function(_0x1a0c24){if(_0x1a0c24){var _0x388d0f=typeof _0xeea899['offset']===_0x1bc9('0x1c')&&typeof _0xeea899[_0x1bc9('0x1d')]===_0x1bc9('0x1c');var _0x977ae8=_0x1a0c24[_0x1bc9('0x1e')];var _0x106118=_0x388d0f?0x0:_0xeea899[_0x1bc9('0x1f')];var _0x9a74f1=_0x388d0f?_0x1a0c24['count']:_0xeea899[_0x1bc9('0x1f')]+_0xeea899[_0x1bc9('0x1d')];var _0x179cfb;if(_0x9a74f1>=_0x977ae8){_0x9a74f1=_0x977ae8;_0x179cfb=0xc8;}else{_0x179cfb=0xce;}_0x45aafb[_0x1bc9('0x1a')](_0x179cfb);return _0x45aafb['set'](_0x1bc9('0x20'),_0x106118+'-'+_0x9a74f1+'/'+_0x977ae8)[_0x1bc9('0x21')](_0x1a0c24);}return null;};}function patchUpdates(_0x1dabf5){return function(_0x1d7de6){try{jsonpatch[_0x1bc9('0x22')](_0x1d7de6,_0x1dabf5,!![]);}catch(_0xd9ab6d){return BPromise[_0x1bc9('0x23')](_0xd9ab6d);}return _0x1d7de6['save']();};}function saveUpdates(_0x4463ce,_0xefd9d0){return function(_0x556307){if(_0x556307){return _0x556307[_0x1bc9('0x24')](_0x4463ce)[_0x1bc9('0x25')](function(_0x2706b8){return _0x2706b8;});}return null;};}function removeEntity(_0x53ac2c,_0x43ed71){return function(_0x32e2b5){if(_0x32e2b5){return _0x32e2b5[_0x1bc9('0x26')]()[_0x1bc9('0x25')](function(){_0x53ac2c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x49e8be,_0x3c554d){return function(_0x434b2e){if(!_0x434b2e){_0x49e8be[_0x1bc9('0x19')](0x194);}return _0x434b2e;};}function handleError(_0x36a401,_0x2fe84f){_0x2fe84f=_0x2fe84f||0x1f4;return function(_0x4b821f){logger[_0x1bc9('0x27')](_0x4b821f['stack']);if(_0x4b821f[_0x1bc9('0x28')]){delete _0x4b821f[_0x1bc9('0x28')];}_0x36a401[_0x1bc9('0x1a')](_0x2fe84f)['send'](_0x4b821f);};}exports[_0x1bc9('0x24')]=function(_0x28d3e4,_0x3244a3){if(_0x28d3e4[_0x1bc9('0x29')]['id']){delete _0x28d3e4[_0x1bc9('0x29')]['id'];}return db[_0x1bc9('0x2a')]['find']({'where':{'id':_0x28d3e4[_0x1bc9('0x2b')]['id']}})['then'](handleEntityNotFound(_0x3244a3,null))['then'](saveUpdates(_0x28d3e4[_0x1bc9('0x29')],null))[_0x1bc9('0x25')](respondWithResult(_0x3244a3,null))['catch'](handleError(_0x3244a3,null));};exports['destroy']=function(_0x52a6eb,_0x563194){return db['Action'][_0x1bc9('0x2c')]({'where':{'id':_0x52a6eb[_0x1bc9('0x2b')]['id']}})[_0x1bc9('0x25')](handleEntityNotFound(_0x563194,null))['then'](removeEntity(_0x563194,null))[_0x1bc9('0x2d')](handleError(_0x563194,null));}; \ No newline at end of file +var _0x7476=['lodash','squel','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','name','send','body','Action','find','params','then','catch','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs'];(function(_0x11dc39,_0x491115){var _0x457277=function(_0x1d77cd){while(--_0x1d77cd){_0x11dc39['push'](_0x11dc39['shift']());}};_0x457277(++_0x491115);}(_0x7476,0x14e));var _0x6747=function(_0x45937f,_0x256a25){_0x45937f=_0x45937f-0x0;var _0x5bf5d1=_0x7476[_0x45937f];return _0x5bf5d1;};'use strict';var emlformat=require(_0x6747('0x0'));var rimraf=require(_0x6747('0x1'));var zipdir=require(_0x6747('0x2'));var jsonpatch=require(_0x6747('0x3'));var rp=require('request-promise');var moment=require(_0x6747('0x4'));var BPromise=require(_0x6747('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6747('0x6'));var sox=require(_0x6747('0x7'));var csv=require(_0x6747('0x8'));var ejs=require(_0x6747('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6747('0xa'));var squel=require(_0x6747('0xb'));var crypto=require('crypto');var jsforce=require(_0x6747('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6747('0xd'));var Redis=require('ioredis');var authService=require(_0x6747('0xe'));var qs=require(_0x6747('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6747('0x10'));var logger=require(_0x6747('0x11'))('api');var utils=require(_0x6747('0x12'));var config=require(_0x6747('0x13'));var licenseUtil=require(_0x6747('0x14'));var db=require(_0x6747('0x15'))['db'];function respondWithStatusCode(_0x212e4b,_0x387057){_0x387057=_0x387057||0xcc;return function(_0x572e14){if(_0x572e14){return _0x212e4b[_0x6747('0x16')](_0x387057);}return _0x212e4b[_0x6747('0x17')](_0x387057)['end']();};}function respondWithResult(_0x13e36b,_0x241a16){_0x241a16=_0x241a16||0xc8;return function(_0x4f6c96){if(_0x4f6c96){return _0x13e36b['status'](_0x241a16)[_0x6747('0x18')](_0x4f6c96);}};}function respondWithFilteredResult(_0x4270ae,_0x1c15bb){return function(_0x12e9f0){if(_0x12e9f0){var _0x5c07b0=typeof _0x1c15bb[_0x6747('0x19')]===_0x6747('0x1a')&&typeof _0x1c15bb[_0x6747('0x1b')]===_0x6747('0x1a');var _0x513fd2=_0x12e9f0[_0x6747('0x1c')];var _0x618628=_0x5c07b0?0x0:_0x1c15bb['offset'];var _0x39ca4e=_0x5c07b0?_0x12e9f0['count']:_0x1c15bb[_0x6747('0x19')]+_0x1c15bb[_0x6747('0x1b')];var _0x33ae77;if(_0x39ca4e>=_0x513fd2){_0x39ca4e=_0x513fd2;_0x33ae77=0xc8;}else{_0x33ae77=0xce;}_0x4270ae[_0x6747('0x17')](_0x33ae77);return _0x4270ae[_0x6747('0x1d')](_0x6747('0x1e'),_0x618628+'-'+_0x39ca4e+'/'+_0x513fd2)['json'](_0x12e9f0);}return null;};}function patchUpdates(_0x33334f){return function(_0x3cb11c){try{jsonpatch['apply'](_0x3cb11c,_0x33334f,!![]);}catch(_0x3ff174){return BPromise[_0x6747('0x1f')](_0x3ff174);}return _0x3cb11c[_0x6747('0x20')]();};}function saveUpdates(_0x5337f4,_0x4a2326){return function(_0x2394da){if(_0x2394da){return _0x2394da[_0x6747('0x21')](_0x5337f4)['then'](function(_0x1e741e){return _0x1e741e;});}return null;};}function removeEntity(_0x5440cb,_0x8ab1f3){return function(_0x164405){if(_0x164405){return _0x164405['destroy']()['then'](function(){_0x5440cb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x38c3a0,_0x6898c4){return function(_0x40e948){if(!_0x40e948){_0x38c3a0[_0x6747('0x16')](0x194);}return _0x40e948;};}function handleError(_0x550464,_0x1b34ac){_0x1b34ac=_0x1b34ac||0x1f4;return function(_0x1a00b5){logger['error'](_0x1a00b5['stack']);if(_0x1a00b5[_0x6747('0x22')]){delete _0x1a00b5[_0x6747('0x22')];}_0x550464[_0x6747('0x17')](_0x1b34ac)[_0x6747('0x23')](_0x1a00b5);};}exports[_0x6747('0x21')]=function(_0x18ce60,_0x5b737a){if(_0x18ce60[_0x6747('0x24')]['id']){delete _0x18ce60['body']['id'];}return db[_0x6747('0x25')][_0x6747('0x26')]({'where':{'id':_0x18ce60[_0x6747('0x27')]['id']}})[_0x6747('0x28')](handleEntityNotFound(_0x5b737a,null))[_0x6747('0x28')](saveUpdates(_0x18ce60['body'],null))[_0x6747('0x28')](respondWithResult(_0x5b737a,null))[_0x6747('0x29')](handleError(_0x5b737a,null));};exports[_0x6747('0x2a')]=function(_0x2b539a,_0x9aab80){return db['Action'][_0x6747('0x26')]({'where':{'id':_0x2b539a[_0x6747('0x27')]['id']}})[_0x6747('0x28')](handleEntityNotFound(_0x9aab80,null))[_0x6747('0x28')](removeEntity(_0x9aab80,null))['catch'](handleError(_0x9aab80,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 4b83118..6a1ced7 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 _0x7869=['api','request-promise','rimraf','../../config/environment','define','tools_actions','lodash'];(function(_0xb82940,_0x530318){var _0x2e152a=function(_0x27bf29){while(--_0x27bf29){_0xb82940['push'](_0xb82940['shift']());}};_0x2e152a(++_0x530318);}(_0x7869,0x13a));var _0x9786=function(_0x4530e6,_0x526e2f){_0x4530e6=_0x4530e6-0x0;var _0x5316ac=_0x7869[_0x4530e6];return _0x5316ac;};'use strict';var _=require(_0x9786('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9786('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9786('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9786('0x3'));var config=require(_0x9786('0x4'));var attributes=require('./action.attributes');module['exports']=function(_0x5d7f09,_0x2ab0a1){return _0x5d7f09[_0x9786('0x5')]('Action',attributes,{'tableName':_0x9786('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3b93=['../../config/environment','./action.attributes','exports','define','Action','tools_actions','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x3b93,0x92));var _0x33b9=function(_0x1d2e14,_0x3ccc45){_0x1d2e14=_0x1d2e14-0x0;var _0x56941f=_0x3b93[_0x1d2e14];return _0x56941f;};'use strict';var _=require('lodash');var util=require(_0x33b9('0x0'));var logger=require(_0x33b9('0x1'))(_0x33b9('0x2'));var moment=require(_0x33b9('0x3'));var BPromise=require(_0x33b9('0x4'));var rp=require(_0x33b9('0x5'));var fs=require('fs');var path=require(_0x33b9('0x6'));var rimraf=require(_0x33b9('0x7'));var config=require(_0x33b9('0x8'));var attributes=require(_0x33b9('0x9'));module[_0x33b9('0xa')]=function(_0x51d85c,_0x1ab793){return _0x51d85c[_0x33b9('0xb')](_0x33b9('0xc'),attributes,{'tableName':_0x33b9('0xd'),'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 852c0ae..a7ee4de 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 _0x7a54=['info','Action,\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(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x7a54,0x106));var _0x47a5=function(_0x3c4bb5,_0x1a069c){_0x3c4bb5=_0x3c4bb5-0x0;var _0x6585b1=_0x7a54[_0x3c4bb5];return _0x6585b1;};'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')]('Action,\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 _0x7217=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Action,\x20%s,\x20%s','debug','Action,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x15c421,_0x6366f7){var _0x5e5ed5=function(_0x206e66){while(--_0x206e66){_0x15c421['push'](_0x15c421['shift']());}};_0x5e5ed5(++_0x6366f7);}(_0x7217,0x19e));var _0x7721=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x7217[_0xa1e3e3];return _0xc980e9;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('Action,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index e176e9a..0edc44f 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 _0xd576=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','/:id','isAuthenticated','update','delete','multer','path','connect-timeout'];(function(_0x2cd8b5,_0x431ff7){var _0x17ff7b=function(_0x14d053){while(--_0x14d053){_0x2cd8b5['push'](_0x2cd8b5['shift']());}};_0x17ff7b(++_0x431ff7);}(_0xd576,0x75));var _0x6d57=function(_0x3e3247,_0x5e7cdc){_0x3e3247=_0x3e3247-0x0;var _0x5bfe93=_0xd576[_0x3e3247];return _0x5bfe93;};'use strict';var multer=require(_0x6d57('0x0'));var util=require('util');var path=require(_0x6d57('0x1'));var timeout=require(_0x6d57('0x2'));var express=require(_0x6d57('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6d57('0x4'));var interaction=require(_0x6d57('0x5'));var config=require(_0x6d57('0x6'));var controller=require(_0x6d57('0x7'));router['put'](_0x6d57('0x8'),auth[_0x6d57('0x9')](),controller[_0x6d57('0xa')]);router[_0x6d57('0xb')](_0x6d57('0x8'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x713e=['/:id','isAuthenticated','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./action.controller','put'];(function(_0x1c4456,_0x25771a){var _0x198576=function(_0x56b8a6){while(--_0x56b8a6){_0x1c4456['push'](_0x1c4456['shift']());}};_0x198576(++_0x25771a);}(_0x713e,0x1e5));var _0xe713=function(_0x101cd1,_0x9e28ef){_0x101cd1=_0x101cd1-0x0;var _0x2e50b0=_0x713e[_0x101cd1];return _0x2e50b0;};'use strict';var multer=require(_0xe713('0x0'));var util=require(_0xe713('0x1'));var path=require(_0xe713('0x2'));var timeout=require('connect-timeout');var express=require(_0xe713('0x3'));var router=express[_0xe713('0x4')]();var fs_extra=require(_0xe713('0x5'));var auth=require(_0xe713('0x6'));var interaction=require(_0xe713('0x7'));var config=require('../../config/environment');var controller=require(_0xe713('0x8'));router[_0xe713('0x9')](_0xe713('0xa'),auth[_0xe713('0xb')](),controller[_0xe713('0xc')]);router['delete'](_0xe713('0xa'),auth[_0xe713('0xb')](),controller[_0xe713('0xd')]);module[_0xe713('0xe')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 2abedf6..44d8257 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 _0x1cb9=['TEXT','sequelize','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1cb9,0x14e));var _0x91cb=function(_0x3b3c17,_0x1fe143){_0x3b3c17=_0x3b3c17-0x0;var _0xcff7=_0x1cb9[_0x3b3c17];return _0xcff7;};'use strict';var Sequelize=require(_0x91cb('0x0'));module['exports']={'name':{'type':Sequelize[_0x91cb('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x91cb('0x1')]},'parent':{'type':Sequelize[_0x91cb('0x1')]},'table':{'type':Sequelize[_0x91cb('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x91cb('0x2')]}}; \ No newline at end of file +var _0xeff8=['STRING','TEXT','sequelize','exports'];(function(_0x2624c4,_0x20e618){var _0x533d3c=function(_0x16d97b){while(--_0x16d97b){_0x2624c4['push'](_0x2624c4['shift']());}};_0x533d3c(++_0x20e618);}(_0xeff8,0x186));var _0x8eff=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xeff8[_0x5037ab];return _0x512adb;};'use strict';var Sequelize=require(_0x8eff('0x0'));module[_0x8eff('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x8eff('0x2')]},'parent':{'type':Sequelize[_0x8eff('0x2')]},'table':{'type':Sequelize[_0x8eff('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x8eff('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index d8bb7b7..6c596fc 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 _0xea2d=['COUNT(%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','value','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','table','MetricId','function','replace','format','groupBy','orderBy','alias','joins','foreignTable','parentKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','cross_join','COUNT(DISTINCT\x20%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','condition','getFields','ValidationErrorItem','metric','order','DESC','parse','foreignKey','%s.%s\x20=\x20%s.%s','output','web','fullPath','randomstring','generate','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','info','Run\x20Query:','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','SUM(%s)','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','get','CustomReports','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','where','filter','merge','type','VIRTUAL','options','AnalyticCustomReport','includeAll','include','rows','catch','show','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','right_join'];(function(_0x360e5c,_0x1d60de){var _0x3629ea=function(_0x3f12b6){while(--_0x3f12b6){_0x360e5c['push'](_0x360e5c['shift']());}};_0x3629ea(++_0x1d60de);}(_0xea2d,0xfb));var _0xdea2=function(_0x255ec2,_0xd9ac02){_0x255ec2=_0x255ec2-0x0;var _0x528a0d=_0xea2d[_0x255ec2];return _0x528a0d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdea2('0x0'));var zipdir=require(_0xdea2('0x1'));var jsonpatch=require(_0xdea2('0x2'));var rp=require(_0xdea2('0x3'));var moment=require(_0xdea2('0x4'));var BPromise=require(_0xdea2('0x5'));var Mustache=require(_0xdea2('0x6'));var util=require(_0xdea2('0x7'));var path=require(_0xdea2('0x8'));var sox=require(_0xdea2('0x9'));var csv=require(_0xdea2('0xa'));var ejs=require(_0xdea2('0xb'));var fs=require('fs');var fs_extra=require(_0xdea2('0xc'));var _=require(_0xdea2('0xd'));var squel=require(_0xdea2('0xe'));var crypto=require('crypto');var jsforce=require(_0xdea2('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xdea2('0xa'));var querystring=require(_0xdea2('0x10'));var Papa=require(_0xdea2('0x11'));var Redis=require(_0xdea2('0x12'));var authService=require(_0xdea2('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xdea2('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdea2('0x15'))(_0xdea2('0x16'));var utils=require(_0xdea2('0x17'));var config=require(_0xdea2('0x18'));var licenseUtil=require(_0xdea2('0x19'));var db=require('../../mysqldb')['db'];var dbH=require(_0xdea2('0x1a'))[_0xdea2('0x1b')];function respondWithStatusCode(_0x2fa081,_0x587233){_0x587233=_0x587233||0xcc;return function(_0x5507d2){if(_0x5507d2){return _0x2fa081[_0xdea2('0x1c')](_0x587233);}return _0x2fa081[_0xdea2('0x1d')](_0x587233)[_0xdea2('0x1e')]();};}function respondWithResult(_0xbb9d1d,_0xd2298d){_0xd2298d=_0xd2298d||0xc8;return function(_0x199ad5){if(_0x199ad5){return _0xbb9d1d[_0xdea2('0x1d')](_0xd2298d)[_0xdea2('0x1f')](_0x199ad5);}};}function respondWithFilteredResult(_0x13ec29,_0x2497ee){return function(_0x4d35d9){if(_0x4d35d9){var _0x96ed72=typeof _0x2497ee[_0xdea2('0x20')]===_0xdea2('0x21')&&typeof _0x2497ee[_0xdea2('0x22')]===_0xdea2('0x21');var _0xc88597=_0x4d35d9[_0xdea2('0x23')];var _0x5f5ae5=_0x96ed72?0x0:_0x2497ee[_0xdea2('0x20')];var _0x17ef7b=_0x96ed72?_0x4d35d9[_0xdea2('0x23')]:_0x2497ee[_0xdea2('0x20')]+_0x2497ee['limit'];var _0x5251c3;if(_0x17ef7b>=_0xc88597){_0x17ef7b=_0xc88597;_0x5251c3=0xc8;}else{_0x5251c3=0xce;}_0x13ec29[_0xdea2('0x1d')](_0x5251c3);return _0x13ec29['set'](_0xdea2('0x24'),_0x5f5ae5+'-'+_0x17ef7b+'/'+_0xc88597)[_0xdea2('0x1f')](_0x4d35d9);}return null;};}function patchUpdates(_0x4f2ce1){return function(_0x2636c6){try{jsonpatch[_0xdea2('0x25')](_0x2636c6,_0x4f2ce1,!![]);}catch(_0x522a1b){return BPromise['reject'](_0x522a1b);}return _0x2636c6[_0xdea2('0x26')]();};}function saveUpdates(_0x51d9d8,_0x31cd6b){return function(_0x70457){if(_0x70457){return _0x70457[_0xdea2('0x27')](_0x51d9d8)[_0xdea2('0x28')](function(_0x377f2e){return _0x377f2e;});}return null;};}function removeEntity(_0xbde118,_0x1ccf36){return function(_0x1d8d43){if(_0x1d8d43){return _0x1d8d43[_0xdea2('0x29')]()[_0xdea2('0x28')](function(){var _0x3b70ef=_0x1d8d43[_0xdea2('0x2a')]({'plain':!![]});var _0x3b1a21=_0xdea2('0x2b');return db[_0xdea2('0x2c')]['destroy']({'where':{'type':_0x3b1a21,'resourceId':_0x3b70ef['id']}})[_0xdea2('0x28')](function(){return _0x1d8d43;});})[_0xdea2('0x28')](function(){_0xbde118[_0xdea2('0x1d')](0xcc)[_0xdea2('0x1e')]();});}};}function handleEntityNotFound(_0x1b275a,_0x7943eb){return function(_0xadc524){if(!_0xadc524){_0x1b275a['sendStatus'](0x194);}return _0xadc524;};}function handleError(_0x8809b4,_0x4b5374){_0x4b5374=_0x4b5374||0x1f4;return function(_0x5c31f0){logger[_0xdea2('0x2d')](_0x5c31f0[_0xdea2('0x2e')]);if(_0x5c31f0[_0xdea2('0x2f')]){delete _0x5c31f0[_0xdea2('0x2f')];}_0x8809b4[_0xdea2('0x1d')](_0x4b5374)[_0xdea2('0x30')](_0x5c31f0);};}exports[_0xdea2('0x31')]=function(_0x37495b,_0x5d2e04){var _0x13e467={},_0x3bce94={},_0x39f354={'count':0x0,'rows':[]};var _0x3cee80=_[_0xdea2('0x32')](db['AnalyticCustomReport'][_0xdea2('0x33')],function(_0x2068c2){return{'name':_0x2068c2[_0xdea2('0x34')],'type':_0x2068c2['type'][_0xdea2('0x35')]};});_0x3bce94[_0xdea2('0x36')]=_[_0xdea2('0x32')](_0x3cee80,_0xdea2('0x2f'));_0x3bce94[_0xdea2('0x37')]=_[_0xdea2('0x38')](_0x37495b['query']);_0x3bce94[_0xdea2('0x39')]=_['intersection'](_0x3bce94[_0xdea2('0x36')],_0x3bce94[_0xdea2('0x37')]);_0x13e467['attributes']=_[_0xdea2('0x3a')](_0x3bce94[_0xdea2('0x36')],qs[_0xdea2('0x3b')](_0x37495b['query'][_0xdea2('0x3b')]));_0x13e467[_0xdea2('0x3c')]=_0x13e467[_0xdea2('0x3c')][_0xdea2('0x3d')]?_0x13e467[_0xdea2('0x3c')]:_0x3bce94['model'];if(!_0x37495b[_0xdea2('0x37')]['hasOwnProperty'](_0xdea2('0x3e'))){_0x13e467[_0xdea2('0x22')]=qs['limit'](_0x37495b[_0xdea2('0x37')][_0xdea2('0x22')]);_0x13e467[_0xdea2('0x20')]=qs[_0xdea2('0x20')](_0x37495b['query'][_0xdea2('0x20')]);}_0x13e467['order']=qs[_0xdea2('0x3f')](_0x37495b[_0xdea2('0x37')]['sort']);_0x13e467[_0xdea2('0x40')]=qs[_0xdea2('0x39')](_['pick'](_0x37495b[_0xdea2('0x37')],_0x3bce94[_0xdea2('0x39')]),_0x3cee80);if(_0x37495b[_0xdea2('0x37')][_0xdea2('0x41')]){_0x13e467[_0xdea2('0x40')]=_[_0xdea2('0x42')](_0x13e467[_0xdea2('0x40')],{'$or':_[_0xdea2('0x32')](_0x3cee80,function(_0x2d74ee){if(_0x2d74ee[_0xdea2('0x43')]!==_0xdea2('0x44')){var _0x181ab4={};_0x181ab4[_0x2d74ee['name']]={'$like':'%'+_0x37495b[_0xdea2('0x37')][_0xdea2('0x41')]+'%'};return _0x181ab4;}})});}_0x13e467=_[_0xdea2('0x42')]({},_0x13e467,_0x37495b[_0xdea2('0x45')]);var _0x1653e0={'where':_0x13e467[_0xdea2('0x40')]};return db[_0xdea2('0x46')][_0xdea2('0x23')](_0x1653e0)[_0xdea2('0x28')](function(_0x2d33b2){_0x39f354[_0xdea2('0x23')]=_0x2d33b2;if(_0x37495b[_0xdea2('0x37')][_0xdea2('0x47')]){_0x13e467[_0xdea2('0x48')]=[{'all':!![]}];}return db[_0xdea2('0x46')]['findAll'](_0x13e467);})['then'](function(_0x3f31fc){_0x39f354[_0xdea2('0x49')]=_0x3f31fc;return _0x39f354;})[_0xdea2('0x28')](respondWithFilteredResult(_0x5d2e04,_0x13e467))[_0xdea2('0x4a')](handleError(_0x5d2e04,null));};exports[_0xdea2('0x4b')]=function(_0x1c24a7,_0x4cbb0f){var _0x220dbe={'raw':![],'where':{'id':_0x1c24a7['params']['id']}},_0x1e3a66={};_0x1e3a66['model']=_[_0xdea2('0x38')](db['AnalyticCustomReport']['rawAttributes']);_0x1e3a66[_0xdea2('0x37')]=_[_0xdea2('0x38')](_0x1c24a7[_0xdea2('0x37')]);_0x1e3a66[_0xdea2('0x39')]=_[_0xdea2('0x3a')](_0x1e3a66['model'],_0x1e3a66[_0xdea2('0x37')]);_0x220dbe[_0xdea2('0x3c')]=_['intersection'](_0x1e3a66[_0xdea2('0x36')],qs[_0xdea2('0x3b')](_0x1c24a7['query'][_0xdea2('0x3b')]));_0x220dbe[_0xdea2('0x3c')]=_0x220dbe[_0xdea2('0x3c')][_0xdea2('0x3d')]?_0x220dbe[_0xdea2('0x3c')]:_0x1e3a66['model'];if(_0x1c24a7[_0xdea2('0x37')]['includeAll']){_0x220dbe[_0xdea2('0x48')]=[{'all':!![]}];}_0x220dbe=_[_0xdea2('0x42')]({},_0x220dbe,_0x1c24a7[_0xdea2('0x45')]);return db['AnalyticCustomReport'][_0xdea2('0x4c')](_0x220dbe)['then'](handleEntityNotFound(_0x4cbb0f,null))[_0xdea2('0x28')](respondWithResult(_0x4cbb0f,null))[_0xdea2('0x4a')](handleError(_0x4cbb0f,null));};exports[_0xdea2('0x4d')]=function(_0x5db7e0,_0x34e2a2){return db[_0xdea2('0x46')][_0xdea2('0x4d')](_0x5db7e0[_0xdea2('0x4e')],{})[_0xdea2('0x28')](function(_0x5b5c0a){var _0x551e17=_0x5db7e0['user']['get']({'plain':!![]});if(!_0x551e17)throw new Error(_0xdea2('0x4f'));if(_0x551e17['role']==='user'){var _0x3a0090=_0x5b5c0a['get']({'plain':!![]});var _0x3a42d7=_0xdea2('0x50');return db[_0xdea2('0x51')][_0xdea2('0x4c')]({'where':{'name':_0x3a42d7,'userProfileId':_0x551e17['userProfileId']},'raw':!![]})[_0xdea2('0x28')](function(_0x48b357){if(_0x48b357&&_0x48b357[_0xdea2('0x52')]===0x0){return db[_0xdea2('0x2c')][_0xdea2('0x4d')]({'name':_0x3a0090[_0xdea2('0x2f')],'resourceId':_0x3a0090['id'],'type':_0xdea2('0x2b'),'sectionId':_0x48b357['id']},{})[_0xdea2('0x28')](function(){return _0x5b5c0a;});}else{return _0x5b5c0a;}})[_0xdea2('0x4a')](function(_0xd98c85){logger[_0xdea2('0x2d')](_0xdea2('0x53'),_0xd98c85);throw _0xd98c85;});}return _0x5b5c0a;})[_0xdea2('0x28')](respondWithResult(_0x34e2a2,0xc9))[_0xdea2('0x4a')](handleError(_0x34e2a2,null));};exports[_0xdea2('0x27')]=function(_0x1be882,_0x21e799){if(_0x1be882[_0xdea2('0x4e')]['id']){delete _0x1be882[_0xdea2('0x4e')]['id'];}return db[_0xdea2('0x46')]['find']({'where':{'id':_0x1be882[_0xdea2('0x54')]['id']}})['then'](handleEntityNotFound(_0x21e799,null))[_0xdea2('0x28')](saveUpdates(_0x1be882[_0xdea2('0x4e')],null))[_0xdea2('0x28')](respondWithResult(_0x21e799,null))[_0xdea2('0x4a')](handleError(_0x21e799,null));};exports['destroy']=function(_0x5d421b,_0x33223c){return db[_0xdea2('0x46')][_0xdea2('0x4c')]({'where':{'id':_0x5d421b[_0xdea2('0x54')]['id']}})[_0xdea2('0x28')](handleEntityNotFound(_0x33223c,null))[_0xdea2('0x28')](removeEntity(_0x33223c,null))[_0xdea2('0x4a')](handleError(_0x33223c,null));};exports[_0xdea2('0x55')]=function(_0x5dc737,_0x398b9a){var _0x144ef4=0xa;var _0xf013f1=[_0xdea2('0x56'),_0xdea2('0x57'),_0xdea2('0x58'),'cross_join'];var _0x5384b0={'SUM':'SUM(%s)','COUNT':_0xdea2('0x59'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xdea2('0x5a'),'MIN':_0xdea2('0x5b'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xdea2('0x5c'),'GROUP_CONCAT ASC':_0xdea2('0x5d'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4823c9={'SEC_TO_TIME':_0xdea2('0x5e'),'DATE':_0xdea2('0x5f'),'HOUR':_0xdea2('0x60'),'ROUND':_0xdea2('0x61'),'UNIX_TIMESTAMP':_0xdea2('0x62')};var _0x59cca9=function(_0x4dc3ae){return!_[_0xdea2('0x63')]([_0xdea2('0x64'),_0xdea2('0x65'),_0xdea2('0x66'),_0xdea2('0x67')],_0x4dc3ae);};var _0x406831=function(_0xb4bd91){if(!_0xb4bd91||!_0xb4bd91[_0xdea2('0x68')]['length']){return'';}for(var _0x5b2f67='(',_0x8162b0=0x0;_0x8162b0<_0xb4bd91[_0xdea2('0x68')][_0xdea2('0x3d')];_0x8162b0+=0x1){_0x8162b0>0x0&&(_0x5b2f67+='\x20'+_0xb4bd91[_0xdea2('0x69')]+'\x20');_0x5b2f67+=_0xb4bd91[_0xdea2('0x68')][_0x8162b0]['group']?_0x406831(_0xb4bd91[_0xdea2('0x68')][_0x8162b0][_0xdea2('0x6a')]):_0xb4bd91[_0xdea2('0x68')][_0x8162b0][_0xdea2('0x6b')]+'\x20'+_0xb4bd91[_0xdea2('0x68')][_0x8162b0]['condition']+(_0x59cca9(_0xb4bd91['rules'][_0x8162b0]['condition'])?'\x20'+_0xb4bd91[_0xdea2('0x68')][_0x8162b0][_0xdea2('0x6c')]:'');}return _0x5b2f67+')';};var _0x4c4727={'where':{'id':_0x5dc737[_0xdea2('0x54')]['id']}},_0x276b5f,_0x6832e1,_0x5c5e69,_0x2bf92a,_0x1c9081;_0x4c4727=_[_0xdea2('0x42')]({},_0x4c4727,_0x5dc737['options']);return db[_0xdea2('0x46')][_0xdea2('0x4c')](_0x4c4727)[_0xdea2('0x28')](function(_0x5501a){if(_0x5501a){_0x276b5f=_0x5501a;return _0x5501a['getFields']();}return null;})[_0xdea2('0x28')](function(_0x24e8e1){if(_0x24e8e1){if(!_0x24e8e1[_0xdea2('0x3d')]){throw new db[(_0xdea2('0x6d'))]['ValidationErrorItem'](_0xdea2('0x6e'),0x193);}_0x6832e1=_0x24e8e1;return db[_0xdea2('0x6f')][_0xdea2('0x70')]({'raw':!![]});}return null;})[_0xdea2('0x28')](function(_0xc13fe){if(_0xc13fe){_0x5c5e69=_[_0xdea2('0x71')](_0xc13fe,'id');var _0x4acf73;var _0x5a09e1=squel[_0xdea2('0x72')]();_0x5a09e1[_0xdea2('0x73')](_0x276b5f[_0xdea2('0x74')]);for(var _0xb70cd=0x0;_0xb70cd<_0x6832e1[_0xdea2('0x3d')];_0xb70cd+=0x1){_0x4acf73=_0x6832e1[_0xb70cd][_0xdea2('0x75')]?_0x5c5e69[_0x6832e1[_0xb70cd][_0xdea2('0x75')]]['metric']:_0x6832e1[_0xb70cd][_0xdea2('0x6b')];_0x4acf73=_0x6832e1[_0xb70cd][_0xdea2('0x76')]?_['replace'](_0x5384b0[_0x6832e1[_0xb70cd][_0xdea2('0x76')]],'%s',_0x4acf73):_0x4acf73;_0x4acf73=_0x6832e1[_0xb70cd]['format']?_[_0xdea2('0x77')](_0x4823c9[_0x6832e1[_0xb70cd][_0xdea2('0x78')]],'%s',_0x4acf73):_0x4acf73;if(_0x6832e1[_0xb70cd][_0xdea2('0x79')]){_0x5a09e1[_0xdea2('0x6a')](_0x4acf73);}_0x6832e1[_0xb70cd][_0xdea2('0x7a')]&&_0x5a09e1['order'](_0x4acf73,_0x6832e1[_0xb70cd]['orderBy']==='DESC'?![]:!![]);_0x5a09e1['field'](_0x4acf73,_0x6832e1[_0xb70cd][_0xdea2('0x7b')]||_0x4acf73);}if(_0x276b5f[_0xdea2('0x7c')]){_0x276b5f[_0xdea2('0x7c')]=JSON['parse'](_0x276b5f[_0xdea2('0x7c')]);for(var _0x49863d=0x0;_0x49863d<_0x276b5f[_0xdea2('0x7c')]['length'];_0x49863d+=0x1){if(_0x276b5f[_0xdea2('0x7c')][_0x49863d][_0xdea2('0x43')]&&_[_0xdea2('0x63')](_0xf013f1,_0x276b5f[_0xdea2('0x7c')][_0x49863d]['type'])&&_0x276b5f[_0xdea2('0x7c')][_0x49863d]['parentKey']&&_0x276b5f[_0xdea2('0x7c')][_0x49863d][_0xdea2('0x7d')]&&_0x276b5f[_0xdea2('0x7c')][_0x49863d]['foreignKey']){_0x5a09e1[_0x276b5f['joins'][_0x49863d]['type']](_0x276b5f[_0xdea2('0x7c')][_0x49863d][_0xdea2('0x7d')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x276b5f[_0xdea2('0x74')],_0x276b5f[_0xdea2('0x7c')][_0x49863d][_0xdea2('0x7e')],_0x276b5f[_0xdea2('0x7c')][_0x49863d][_0xdea2('0x7d')],_0x276b5f['joins'][_0x49863d]['foreignKey']));}}}if(_0x276b5f[_0xdea2('0x7f')]){_0x276b5f['conditions']=JSON['parse'](_0x276b5f[_0xdea2('0x7f')]);_0x5a09e1[_0xdea2('0x40')](_0x406831(_0x276b5f[_0xdea2('0x7f')]['group']));}_0x1c9081=_0x5a09e1[_0xdea2('0x80')]();_0x5a09e1[_0xdea2('0x22')](_0x144ef4);_0x5a09e1[_0xdea2('0x20')](0x0);logger[_0xdea2('0x81')](_0xdea2('0x82'),_0x5a09e1[_0xdea2('0x83')]());return dbH['sequelize'][_0xdea2('0x37')](_0x5a09e1['toString'](),{'type':dbH[_0xdea2('0x84')][_0xdea2('0x85')][_0xdea2('0x86')]});}})['then'](respondWithResult(_0x398b9a,null))['catch'](handleError(_0x398b9a,null));};function runReport(_0x20def0,_0x1a3159,_0x337a49){var _0x521792=_0x1a3159[_0xdea2('0x2f')];var _0x6232d6=0xa;var _0x44525e=['join',_0xdea2('0x57'),_0xdea2('0x58'),_0xdea2('0x87')];var _0x3224be={'SUM':'SUM(%s)','COUNT':_0xdea2('0x59'),'COUNT DISTINCT':_0xdea2('0x88'),'MAX':_0xdea2('0x5a'),'MIN':_0xdea2('0x5b'),'AVG':_0xdea2('0x89'),'GROUP_CONCAT':_0xdea2('0x5c'),'GROUP_CONCAT ASC':_0xdea2('0x5d'),'GROUP_CONCAT DESC':_0xdea2('0x8a')};var _0x1ce6a4={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xdea2('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0xdea2('0x61'),'UNIX_TIMESTAMP':_0xdea2('0x62')};var _0x1e22e2=function(_0xcbfe26){return!_[_0xdea2('0x63')]([_0xdea2('0x64'),_0xdea2('0x65'),_0xdea2('0x66'),_0xdea2('0x67')],_0xcbfe26);};var _0x4f10cf=function(_0x277a20){if(!_0x277a20||!_0x277a20['rules'][_0xdea2('0x3d')]){return'';}for(var _0x133a26='(',_0x43a5fe=0x0;_0x43a5fe<_0x277a20[_0xdea2('0x68')][_0xdea2('0x3d')];_0x43a5fe+=0x1){_0x43a5fe>0x0&&(_0x133a26+='\x20'+_0x277a20[_0xdea2('0x69')]+'\x20');_0x133a26+=_0x277a20[_0xdea2('0x68')][_0x43a5fe][_0xdea2('0x6a')]?_0x4f10cf(_0x277a20[_0xdea2('0x68')][_0x43a5fe]['group']):_0x277a20[_0xdea2('0x68')][_0x43a5fe][_0xdea2('0x6b')]+'\x20'+_0x277a20[_0xdea2('0x68')][_0x43a5fe][_0xdea2('0x8b')]+(_0x1e22e2(_0x277a20[_0xdea2('0x68')][_0x43a5fe]['condition'])?'\x20'+_0x277a20[_0xdea2('0x68')][_0x43a5fe][_0xdea2('0x6c')]:'');}return _0x133a26+')';};var _0x4fdf7f={'where':{'id':_0x20def0['id']}},_0x236301,_0x7e115f,_0x2bda25,_0xe44705,_0x48f823;_0x4fdf7f=_[_0xdea2('0x42')]({},_0x4fdf7f,_0x337a49);return db[_0xdea2('0x46')][_0xdea2('0x4c')](_0x4fdf7f)[_0xdea2('0x28')](function(_0x2472e2){if(_0x2472e2){_0x236301=_0x2472e2;return _0x2472e2[_0xdea2('0x8c')]();}return null;})['then'](function(_0x59b9fb){if(_0x59b9fb){if(!_0x59b9fb[_0xdea2('0x3d')]){throw new db[(_0xdea2('0x6d'))][(_0xdea2('0x8d'))](_0xdea2('0x6e'),0x193);}_0x7e115f=_0x59b9fb;return db[_0xdea2('0x6f')][_0xdea2('0x70')]({'raw':!![]});}return null;})[_0xdea2('0x28')](function(_0x17ad47){if(_0x17ad47){_0x2bda25=_[_0xdea2('0x71')](_0x17ad47,'id');var _0x5082e0;var _0x1fff4a=squel[_0xdea2('0x72')]();_0x1fff4a['from'](_0x236301[_0xdea2('0x74')]);for(var _0x255750=0x0;_0x255750<_0x7e115f['length'];_0x255750+=0x1){_0x5082e0=_0x7e115f[_0x255750][_0xdea2('0x75')]?_0x2bda25[_0x7e115f[_0x255750]['MetricId']][_0xdea2('0x8e')]:_0x7e115f[_0x255750][_0xdea2('0x6b')];_0x5082e0=_0x7e115f[_0x255750][_0xdea2('0x76')]?_[_0xdea2('0x77')](_0x3224be[_0x7e115f[_0x255750]['function']],'%s',_0x5082e0):_0x5082e0;_0x5082e0=_0x7e115f[_0x255750][_0xdea2('0x78')]?_[_0xdea2('0x77')](_0x1ce6a4[_0x7e115f[_0x255750]['format']],'%s',_0x5082e0):_0x5082e0;if(_0x7e115f[_0x255750][_0xdea2('0x79')]){_0x1fff4a[_0xdea2('0x6a')](_0x5082e0);}_0x7e115f[_0x255750][_0xdea2('0x7a')]&&_0x1fff4a[_0xdea2('0x8f')](_0x5082e0,_0x7e115f[_0x255750][_0xdea2('0x7a')]===_0xdea2('0x90')?![]:!![]);_0x1fff4a[_0xdea2('0x6b')](_0x5082e0,_0x7e115f[_0x255750][_0xdea2('0x7b')]||_0x5082e0);}if(_0x236301[_0xdea2('0x7c')]){_0x236301[_0xdea2('0x7c')]=JSON[_0xdea2('0x91')](_0x236301[_0xdea2('0x7c')]);for(var _0x3c83e8=0x0;_0x3c83e8<_0x236301[_0xdea2('0x7c')][_0xdea2('0x3d')];_0x3c83e8+=0x1){if(_0x236301['joins'][_0x3c83e8][_0xdea2('0x43')]&&_[_0xdea2('0x63')](_0x44525e,_0x236301[_0xdea2('0x7c')][_0x3c83e8][_0xdea2('0x43')])&&_0x236301['joins'][_0x3c83e8][_0xdea2('0x7e')]&&_0x236301['joins'][_0x3c83e8][_0xdea2('0x7d')]&&_0x236301[_0xdea2('0x7c')][_0x3c83e8][_0xdea2('0x92')]){_0x1fff4a[_0x236301['joins'][_0x3c83e8][_0xdea2('0x43')]](_0x236301[_0xdea2('0x7c')][_0x3c83e8]['foreignTable'],null,util[_0xdea2('0x78')](_0xdea2('0x93'),_0x236301[_0xdea2('0x74')],_0x236301[_0xdea2('0x7c')][_0x3c83e8][_0xdea2('0x7e')],_0x236301[_0xdea2('0x7c')][_0x3c83e8][_0xdea2('0x7d')],_0x236301[_0xdea2('0x7c')][_0x3c83e8][_0xdea2('0x92')]));}}}if(_0x236301[_0xdea2('0x7f')]){_0x236301[_0xdea2('0x7f')]=JSON['parse'](_0x236301[_0xdea2('0x7f')]);_0x1fff4a['where'](_0x4f10cf(_0x236301[_0xdea2('0x7f')]['group']));}_0x48f823=_0x1fff4a[_0xdea2('0x80')]();_0x1fff4a[_0xdea2('0x22')](_0x6232d6);_0x1fff4a[_0xdea2('0x20')](0x0);return;}})[_0xdea2('0x28')](function(){if(_0x1a3159[_0xdea2('0x94')]===_0xdea2('0x95')){return null;}var _0x1aa8ac=_[_0xdea2('0x42')](_0x1a3159,{'name':_0x1a3159[_0xdea2('0x96')]||_0x1a3159[_0xdea2('0x2f')]||_0x236301[_0xdea2('0x2f')],'basename':_0x521792,'savename':util['format']('%s-%s.%s',_0x1a3159[_0xdea2('0x2f')]||_0x236301[_0xdea2('0x2f')],require(_0xdea2('0x97'))[_0xdea2('0x98')](0x4),_0x1a3159[_0xdea2('0x94')]||_0xdea2('0x99')),'reportId':_0x236301['id'],'reportType':'custom'});return db[_0xdea2('0x9a')][_0xdea2('0x4d')](_0x1aa8ac,{'raw':!![]});})['then'](function(_0x54cc65){if(_0x236301[_0xdea2('0x74')]===_0xdea2('0x9b')){_0x48f823[_0xdea2('0x40')](_0x236301[_0xdea2('0x74')]+_0xdea2('0x9c'),_0x1a3159['startDate'],_0x1a3159[_0xdea2('0x9d')]);}else{_0x48f823[_0xdea2('0x40')](_0x236301[_0xdea2('0x74')]+_0xdea2('0x9e'),_0x1a3159[_0xdea2('0x9f')],_0x1a3159[_0xdea2('0x9d')]);}if(_0x54cc65){logger[_0xdea2('0xa0')](_0xdea2('0xa1'),_0x48f823['toString']());require('child_process')[_0xdea2('0xa2')](path[_0xdea2('0x56')](__dirname,_0xdea2('0xa3'),_0x54cc65[_0xdea2('0x94')]),[_0x54cc65['id'],_0x48f823[_0xdea2('0x83')](),path[_0xdea2('0x56')](__dirname,_0xdea2('0xa4'),_0x54cc65[_0xdea2('0xa5')]),_0x521792]);return _0x54cc65;}else{var _0x16ee1a=squel[_0xdea2('0x72')]();_0x16ee1a[_0xdea2('0x73')]('('+_0x48f823[_0xdea2('0x83')]()+')',_0xdea2('0xa6'));_0x16ee1a['field'](_0xdea2('0xa7'),_0xdea2('0x23'));_0x48f823[_0xdea2('0x22')](_0x1a3159[_0xdea2('0x22')]||_0x6232d6);_0x48f823[_0xdea2('0x20')](_0x1a3159[_0xdea2('0x20')]||0x0);return dbH['sequelize'][_0xdea2('0x37')](_0x16ee1a[_0xdea2('0x83')](),{'type':dbH['sequelize'][_0xdea2('0x85')][_0xdea2('0x86')]})['then'](function(_0x1307e6){if(!_0x1307e6[_0xdea2('0x3d')]){_0xe44705=0x0;}else{_0xe44705=_0x1307e6[0x0]['count']||0x0;}return dbH[_0xdea2('0x84')]['query'](_0x48f823[_0xdea2('0x83')](),{'type':dbH[_0xdea2('0x84')][_0xdea2('0x85')][_0xdea2('0x86')]});})[_0xdea2('0x28')](function(_0x3b91ba){return{'rows':_0x3b91ba||[],'count':_0xe44705};});}});}exports[_0xdea2('0xa8')]=function(_0x3c5cbd,_0x16db8c){return runReport(_0x3c5cbd[_0xdea2('0x54')],_0x3c5cbd[_0xdea2('0x37')],_0x3c5cbd[_0xdea2('0x45')])[_0xdea2('0x28')](respondWithResult(_0x16db8c,null))[_0xdea2('0x4a')](handleError(_0x16db8c,null));};exports['runReport']=runReport;exports[_0xdea2('0x37')]=function(_0x1071c2,_0x190de9){var _0x14c918=0xa;var _0x171040=[_0xdea2('0x56'),_0xdea2('0x57'),_0xdea2('0x58'),'cross_join'];var _0x339142={'SUM':_0xdea2('0xa9'),'COUNT':_0xdea2('0x59'),'COUNT DISTINCT':_0xdea2('0x88'),'MAX':_0xdea2('0x5a'),'MIN':_0xdea2('0x5b'),'AVG':_0xdea2('0x89'),'GROUP_CONCAT':_0xdea2('0x5c'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xdea2('0x8a')};var _0xb04908={'SEC_TO_TIME':_0xdea2('0x5e'),'DATE':_0xdea2('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0xdea2('0x61'),'UNIX_TIMESTAMP':_0xdea2('0x62')};var _0xc0fb5d=function(_0x43ec57){return!_['includes']([_0xdea2('0x64'),_0xdea2('0x65'),_0xdea2('0x66'),_0xdea2('0x67')],_0x43ec57);};var _0x3d2172=function(_0x16900e){if(!_0x16900e||!_0x16900e['rules'][_0xdea2('0x3d')]){return'';}for(var _0x5f1f20='(',_0x5bb484=0x0;_0x5bb484<_0x16900e[_0xdea2('0x68')][_0xdea2('0x3d')];_0x5bb484+=0x1){_0x5bb484>0x0&&(_0x5f1f20+='\x20'+_0x16900e[_0xdea2('0x69')]+'\x20');_0x5f1f20+=_0x16900e[_0xdea2('0x68')][_0x5bb484]['group']?_0x3d2172(_0x16900e['rules'][_0x5bb484][_0xdea2('0x6a')]):_0x16900e[_0xdea2('0x68')][_0x5bb484]['field']+'\x20'+_0x16900e[_0xdea2('0x68')][_0x5bb484][_0xdea2('0x8b')]+(_0xc0fb5d(_0x16900e[_0xdea2('0x68')][_0x5bb484][_0xdea2('0x8b')])?'\x20'+_0x16900e[_0xdea2('0x68')][_0x5bb484][_0xdea2('0x6c')]:'');}return _0x5f1f20+')';};var _0x4b922c={'where':{'id':_0x1071c2[_0xdea2('0x54')]['id']}},_0x273d23,_0x462ff9,_0x2b754c,_0x9f3dba,_0x1e0b82;_0x4b922c=_[_0xdea2('0x42')]({},_0x4b922c,_0x1071c2[_0xdea2('0x45')]);return db[_0xdea2('0x46')][_0xdea2('0x4c')](_0x4b922c)[_0xdea2('0x28')](function(_0x350ccf){if(_0x350ccf){_0x273d23=_0x350ccf;return _0x350ccf['getFields']();}return null;})[_0xdea2('0x28')](function(_0x3f046f){if(_0x3f046f){if(!_0x3f046f[_0xdea2('0x3d')]){throw new db[(_0xdea2('0x6d'))][(_0xdea2('0x8d'))](_0xdea2('0x6e'),0x193);}_0x462ff9=_0x3f046f;return db[_0xdea2('0x6f')][_0xdea2('0x70')]({'raw':!![]});}return null;})['then'](function(_0x34ac87){if(_0x34ac87){_0x2b754c=_[_0xdea2('0x71')](_0x34ac87,'id');var _0x55e574;var _0x29e386=squel[_0xdea2('0x72')]();_0x29e386[_0xdea2('0x73')](_0x273d23[_0xdea2('0x74')]);for(var _0x16b081=0x0;_0x16b081<_0x462ff9['length'];_0x16b081+=0x1){_0x55e574=_0x462ff9[_0x16b081][_0xdea2('0x75')]?_0x2b754c[_0x462ff9[_0x16b081][_0xdea2('0x75')]][_0xdea2('0x8e')]:_0x462ff9[_0x16b081][_0xdea2('0x6b')];_0x55e574=_0x462ff9[_0x16b081][_0xdea2('0x76')]?_[_0xdea2('0x77')](_0x339142[_0x462ff9[_0x16b081]['function']],'%s',_0x55e574):_0x55e574;_0x55e574=_0x462ff9[_0x16b081][_0xdea2('0x78')]?_['replace'](_0xb04908[_0x462ff9[_0x16b081][_0xdea2('0x78')]],'%s',_0x55e574):_0x55e574;if(_0x462ff9[_0x16b081]['groupBy']){_0x29e386['group'](_0x55e574);}_0x462ff9[_0x16b081]['orderBy']&&_0x29e386[_0xdea2('0x8f')](_0x55e574,_0x462ff9[_0x16b081][_0xdea2('0x7a')]===_0xdea2('0x90')?![]:!![]);_0x29e386['field'](_0x55e574,_0x462ff9[_0x16b081][_0xdea2('0x7b')]||_0x55e574);}if(_0x273d23[_0xdea2('0x7c')]){_0x273d23[_0xdea2('0x7c')]=JSON[_0xdea2('0x91')](_0x273d23[_0xdea2('0x7c')]);for(var _0x5e8122=0x0;_0x5e8122<_0x273d23[_0xdea2('0x7c')][_0xdea2('0x3d')];_0x5e8122+=0x1){if(_0x273d23[_0xdea2('0x7c')][_0x5e8122]['type']&&_[_0xdea2('0x63')](_0x171040,_0x273d23['joins'][_0x5e8122][_0xdea2('0x43')])&&_0x273d23[_0xdea2('0x7c')][_0x5e8122][_0xdea2('0x7e')]&&_0x273d23[_0xdea2('0x7c')][_0x5e8122][_0xdea2('0x7d')]&&_0x273d23['joins'][_0x5e8122][_0xdea2('0x92')]){_0x29e386[_0x273d23[_0xdea2('0x7c')][_0x5e8122][_0xdea2('0x43')]](_0x273d23[_0xdea2('0x7c')][_0x5e8122][_0xdea2('0x7d')],null,util[_0xdea2('0x78')]('%s.%s\x20=\x20%s.%s',_0x273d23['table'],_0x273d23[_0xdea2('0x7c')][_0x5e8122][_0xdea2('0x7e')],_0x273d23['joins'][_0x5e8122][_0xdea2('0x7d')],_0x273d23[_0xdea2('0x7c')][_0x5e8122][_0xdea2('0x92')]));}}}if(_0x273d23[_0xdea2('0x7f')]){_0x273d23[_0xdea2('0x7f')]=JSON['parse'](_0x273d23['conditions']);_0x29e386[_0xdea2('0x40')](_0x3d2172(_0x273d23[_0xdea2('0x7f')]['group']));}_0x1e0b82=_0x29e386[_0xdea2('0x80')]();_0x29e386[_0xdea2('0x22')](_0x14c918);_0x29e386[_0xdea2('0x20')](0x0);logger['debug'](_0xdea2('0x82'),_0x29e386[_0xdea2('0x83')]());return dbH['sequelize'][_0xdea2('0x37')](_0x29e386[_0xdea2('0x83')](),{'type':dbH[_0xdea2('0x84')][_0xdea2('0x85')][_0xdea2('0x86')]});}})[_0xdea2('0x28')](function(){return{'sql':_0x1e0b82[_0xdea2('0x83')]()};})[_0xdea2('0x28')](respondWithResult(_0x190de9,null))['catch'](handleError(_0x190de9,null));}; \ No newline at end of file +var _0x413f=['keyBy','MetricId','metric','field','function','format','replace','order','orderBy','DESC','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','table','foreignKey','conditions','clone','debug','sequelize','toString','QueryTypes','SELECT','COUNT(%s)','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s)','from','groupBy','alias','web','fullPath','%s-%s.%s','randomstring','output','custom','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','fork','../../components/export/','select','countTable','COUNT(*)','run','runReport','MAX(%s)','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','update','then','CustomReports','UserProfileResource','sendStatus','error','stack','name','send','index','map','AnalyticCustomReport','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','rawAttributes','length','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','join','left_join','right_join','cross_join','SUM(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll'];(function(_0x1667e1,_0x2d12c5){var _0x4a59cd=function(_0x528f60){while(--_0x528f60){_0x1667e1['push'](_0x1667e1['shift']());}};_0x4a59cd(++_0x2d12c5);}(_0x413f,0xd7));var _0xf413=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x413f[_0x2c91e9];return _0x13f0ff;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf413('0x0'));var zipdir=require(_0xf413('0x1'));var jsonpatch=require(_0xf413('0x2'));var rp=require('request-promise');var moment=require(_0xf413('0x3'));var BPromise=require(_0xf413('0x4'));var Mustache=require(_0xf413('0x5'));var util=require('util');var path=require(_0xf413('0x6'));var sox=require(_0xf413('0x7'));var csv=require('to-csv');var ejs=require(_0xf413('0x8'));var fs=require('fs');var fs_extra=require(_0xf413('0x9'));var _=require('lodash');var squel=require(_0xf413('0xa'));var crypto=require(_0xf413('0xb'));var jsforce=require(_0xf413('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xf413('0xd'));var querystring=require('querystring');var Papa=require(_0xf413('0xe'));var Redis=require(_0xf413('0xf'));var authService=require(_0xf413('0x10'));var qs=require(_0xf413('0x11'));var as=require(_0xf413('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf413('0x13'))(_0xf413('0x14'));var utils=require(_0xf413('0x15'));var config=require(_0xf413('0x16'));var licenseUtil=require(_0xf413('0x17'));var db=require(_0xf413('0x18'))['db'];var dbH=require(_0xf413('0x18'))[_0xf413('0x19')];function respondWithStatusCode(_0x4942dd,_0x598925){_0x598925=_0x598925||0xcc;return function(_0x75a24e){if(_0x75a24e){return _0x4942dd['sendStatus'](_0x598925);}return _0x4942dd[_0xf413('0x1a')](_0x598925)[_0xf413('0x1b')]();};}function respondWithResult(_0x1f1622,_0xf83fcd){_0xf83fcd=_0xf83fcd||0xc8;return function(_0x29b61b){if(_0x29b61b){return _0x1f1622['status'](_0xf83fcd)[_0xf413('0x1c')](_0x29b61b);}};}function respondWithFilteredResult(_0x76b6d6,_0x48b610){return function(_0x3bb73f){if(_0x3bb73f){var _0x4c7649=typeof _0x48b610['offset']==='undefined'&&typeof _0x48b610[_0xf413('0x1d')]===_0xf413('0x1e');var _0x2b3f8b=_0x3bb73f[_0xf413('0x1f')];var _0x1f9de1=_0x4c7649?0x0:_0x48b610['offset'];var _0x3586c7=_0x4c7649?_0x3bb73f['count']:_0x48b610[_0xf413('0x20')]+_0x48b610[_0xf413('0x1d')];var _0x40632e;if(_0x3586c7>=_0x2b3f8b){_0x3586c7=_0x2b3f8b;_0x40632e=0xc8;}else{_0x40632e=0xce;}_0x76b6d6[_0xf413('0x1a')](_0x40632e);return _0x76b6d6[_0xf413('0x21')](_0xf413('0x22'),_0x1f9de1+'-'+_0x3586c7+'/'+_0x2b3f8b)[_0xf413('0x1c')](_0x3bb73f);}return null;};}function patchUpdates(_0x3b25f4){return function(_0x30ca86){try{jsonpatch[_0xf413('0x23')](_0x30ca86,_0x3b25f4,!![]);}catch(_0x393c80){return BPromise[_0xf413('0x24')](_0x393c80);}return _0x30ca86['save']();};}function saveUpdates(_0x51a8e,_0x4e4eb6){return function(_0x44461e){if(_0x44461e){return _0x44461e[_0xf413('0x25')](_0x51a8e)[_0xf413('0x26')](function(_0x5d85e1){return _0x5d85e1;});}return null;};}function removeEntity(_0x386d4c,_0x5d1ef6){return function(_0x502989){if(_0x502989){return _0x502989['destroy']()[_0xf413('0x26')](function(){var _0x55a1c1=_0x502989['get']({'plain':!![]});var _0x3e6402=_0xf413('0x27');return db[_0xf413('0x28')]['destroy']({'where':{'type':_0x3e6402,'resourceId':_0x55a1c1['id']}})['then'](function(){return _0x502989;});})[_0xf413('0x26')](function(){_0x386d4c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x6f1357,_0x1716cd){return function(_0x3269c5){if(!_0x3269c5){_0x6f1357[_0xf413('0x29')](0x194);}return _0x3269c5;};}function handleError(_0x23859e,_0x52bf6c){_0x52bf6c=_0x52bf6c||0x1f4;return function(_0x5a187b){logger[_0xf413('0x2a')](_0x5a187b[_0xf413('0x2b')]);if(_0x5a187b[_0xf413('0x2c')]){delete _0x5a187b[_0xf413('0x2c')];}_0x23859e['status'](_0x52bf6c)[_0xf413('0x2d')](_0x5a187b);};}exports[_0xf413('0x2e')]=function(_0x3f2b1a,_0x512ad1){var _0x509e02={},_0x38f725={},_0x3a5d9a={'count':0x0,'rows':[]};var _0x12e124=_[_0xf413('0x2f')](db[_0xf413('0x30')]['rawAttributes'],function(_0x4e4831){return{'name':_0x4e4831['fieldName'],'type':_0x4e4831[_0xf413('0x31')][_0xf413('0x32')]};});_0x38f725[_0xf413('0x33')]=_[_0xf413('0x2f')](_0x12e124,_0xf413('0x2c'));_0x38f725[_0xf413('0x34')]=_[_0xf413('0x35')](_0x3f2b1a[_0xf413('0x34')]);_0x38f725[_0xf413('0x36')]=_['intersection'](_0x38f725[_0xf413('0x33')],_0x38f725['query']);_0x509e02[_0xf413('0x37')]=_[_0xf413('0x38')](_0x38f725[_0xf413('0x33')],qs[_0xf413('0x39')](_0x3f2b1a[_0xf413('0x34')]['fields']));_0x509e02[_0xf413('0x37')]=_0x509e02[_0xf413('0x37')]['length']?_0x509e02['attributes']:_0x38f725[_0xf413('0x33')];if(!_0x3f2b1a[_0xf413('0x34')][_0xf413('0x3a')](_0xf413('0x3b'))){_0x509e02[_0xf413('0x1d')]=qs[_0xf413('0x1d')](_0x3f2b1a['query']['limit']);_0x509e02[_0xf413('0x20')]=qs[_0xf413('0x20')](_0x3f2b1a[_0xf413('0x34')][_0xf413('0x20')]);}_0x509e02['order']=qs[_0xf413('0x3c')](_0x3f2b1a[_0xf413('0x34')][_0xf413('0x3c')]);_0x509e02[_0xf413('0x3d')]=qs[_0xf413('0x36')](_[_0xf413('0x3e')](_0x3f2b1a[_0xf413('0x34')],_0x38f725[_0xf413('0x36')]),_0x12e124);if(_0x3f2b1a[_0xf413('0x34')][_0xf413('0x3f')]){_0x509e02[_0xf413('0x3d')]=_[_0xf413('0x40')](_0x509e02[_0xf413('0x3d')],{'$or':_['map'](_0x12e124,function(_0x1d3b05){if(_0x1d3b05[_0xf413('0x31')]!==_0xf413('0x41')){var _0x5dfd0c={};_0x5dfd0c[_0x1d3b05['name']]={'$like':'%'+_0x3f2b1a[_0xf413('0x34')][_0xf413('0x3f')]+'%'};return _0x5dfd0c;}})});}_0x509e02=_[_0xf413('0x40')]({},_0x509e02,_0x3f2b1a[_0xf413('0x42')]);var _0xade415={'where':_0x509e02[_0xf413('0x3d')]};return db[_0xf413('0x30')][_0xf413('0x1f')](_0xade415)[_0xf413('0x26')](function(_0x3bb268){_0x3a5d9a[_0xf413('0x1f')]=_0x3bb268;if(_0x3f2b1a['query'][_0xf413('0x43')]){_0x509e02[_0xf413('0x44')]=[{'all':!![]}];}return db[_0xf413('0x30')]['findAll'](_0x509e02);})[_0xf413('0x26')](function(_0x141fba){_0x3a5d9a[_0xf413('0x45')]=_0x141fba;return _0x3a5d9a;})[_0xf413('0x26')](respondWithFilteredResult(_0x512ad1,_0x509e02))[_0xf413('0x46')](handleError(_0x512ad1,null));};exports[_0xf413('0x47')]=function(_0x5d8554,_0x2e0298){var _0x17fa2b={'raw':![],'where':{'id':_0x5d8554[_0xf413('0x48')]['id']}},_0x42fe52={};_0x42fe52['model']=_[_0xf413('0x35')](db[_0xf413('0x30')][_0xf413('0x49')]);_0x42fe52[_0xf413('0x34')]=_[_0xf413('0x35')](_0x5d8554['query']);_0x42fe52[_0xf413('0x36')]=_['intersection'](_0x42fe52[_0xf413('0x33')],_0x42fe52[_0xf413('0x34')]);_0x17fa2b[_0xf413('0x37')]=_[_0xf413('0x38')](_0x42fe52[_0xf413('0x33')],qs['fields'](_0x5d8554['query']['fields']));_0x17fa2b['attributes']=_0x17fa2b['attributes'][_0xf413('0x4a')]?_0x17fa2b['attributes']:_0x42fe52['model'];if(_0x5d8554[_0xf413('0x34')]['includeAll']){_0x17fa2b[_0xf413('0x44')]=[{'all':!![]}];}_0x17fa2b=_[_0xf413('0x40')]({},_0x17fa2b,_0x5d8554[_0xf413('0x42')]);return db['AnalyticCustomReport'][_0xf413('0x4b')](_0x17fa2b)['then'](handleEntityNotFound(_0x2e0298,null))[_0xf413('0x26')](respondWithResult(_0x2e0298,null))[_0xf413('0x46')](handleError(_0x2e0298,null));};exports[_0xf413('0x4c')]=function(_0x3a567c,_0x27d690){return db[_0xf413('0x30')]['create'](_0x3a567c['body'],{})[_0xf413('0x26')](function(_0x154b3d){var _0x202a82=_0x3a567c[_0xf413('0x4d')][_0xf413('0x4e')]({'plain':!![]});if(!_0x202a82)throw new Error(_0xf413('0x4f'));if(_0x202a82[_0xf413('0x50')]===_0xf413('0x4d')){var _0x2993a7=_0x154b3d['get']({'plain':!![]});var _0x4f1689=_0xf413('0x51');return db[_0xf413('0x52')][_0xf413('0x4b')]({'where':{'name':_0x4f1689,'userProfileId':_0x202a82['userProfileId']},'raw':!![]})[_0xf413('0x26')](function(_0x1776d0){if(_0x1776d0&&_0x1776d0['autoAssociation']===0x0){return db[_0xf413('0x28')]['create']({'name':_0x2993a7[_0xf413('0x2c')],'resourceId':_0x2993a7['id'],'type':_0xf413('0x27'),'sectionId':_0x1776d0['id']},{})[_0xf413('0x26')](function(){return _0x154b3d;});}else{return _0x154b3d;}})[_0xf413('0x46')](function(_0x4a6ea7){logger[_0xf413('0x2a')](_0xf413('0x53'),_0x4a6ea7);throw _0x4a6ea7;});}return _0x154b3d;})[_0xf413('0x26')](respondWithResult(_0x27d690,0xc9))[_0xf413('0x46')](handleError(_0x27d690,null));};exports[_0xf413('0x25')]=function(_0x1ff3b5,_0x51463e){if(_0x1ff3b5['body']['id']){delete _0x1ff3b5[_0xf413('0x54')]['id'];}return db['AnalyticCustomReport']['find']({'where':{'id':_0x1ff3b5[_0xf413('0x48')]['id']}})[_0xf413('0x26')](handleEntityNotFound(_0x51463e,null))[_0xf413('0x26')](saveUpdates(_0x1ff3b5['body'],null))[_0xf413('0x26')](respondWithResult(_0x51463e,null))['catch'](handleError(_0x51463e,null));};exports['destroy']=function(_0x2477f7,_0xd1c9ab){return db[_0xf413('0x30')][_0xf413('0x4b')]({'where':{'id':_0x2477f7['params']['id']}})[_0xf413('0x26')](handleEntityNotFound(_0xd1c9ab,null))['then'](removeEntity(_0xd1c9ab,null))[_0xf413('0x46')](handleError(_0xd1c9ab,null));};exports['preview']=function(_0x28e6b7,_0x505449){var _0x45fcfc=0xa;var _0x204024=[_0xf413('0x55'),_0xf413('0x56'),_0xf413('0x57'),_0xf413('0x58')];var _0x1235ac={'SUM':_0xf413('0x59'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xf413('0x5a'),'AVG':_0xf413('0x5b'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xf413('0x5c'),'GROUP_CONCAT DESC':_0xf413('0x5d')};var _0x432f3d={'SEC_TO_TIME':_0xf413('0x5e'),'DATE':_0xf413('0x5f'),'HOUR':_0xf413('0x60'),'ROUND':_0xf413('0x61'),'UNIX_TIMESTAMP':_0xf413('0x62')};var _0x19d1ce=function(_0x338662){return!_[_0xf413('0x63')]([_0xf413('0x64'),_0xf413('0x65'),_0xf413('0x66'),_0xf413('0x67')],_0x338662);};var _0x31dcb6=function(_0x1407c2){if(!_0x1407c2||!_0x1407c2[_0xf413('0x68')][_0xf413('0x4a')]){return'';}for(var _0x30545a='(',_0x3bd03b=0x0;_0x3bd03b<_0x1407c2[_0xf413('0x68')][_0xf413('0x4a')];_0x3bd03b+=0x1){_0x3bd03b>0x0&&(_0x30545a+='\x20'+_0x1407c2[_0xf413('0x69')]+'\x20');_0x30545a+=_0x1407c2[_0xf413('0x68')][_0x3bd03b][_0xf413('0x6a')]?_0x31dcb6(_0x1407c2[_0xf413('0x68')][_0x3bd03b]['group']):_0x1407c2[_0xf413('0x68')][_0x3bd03b]['field']+'\x20'+_0x1407c2[_0xf413('0x68')][_0x3bd03b]['condition']+(_0x19d1ce(_0x1407c2['rules'][_0x3bd03b][_0xf413('0x6b')])?'\x20'+_0x1407c2[_0xf413('0x68')][_0x3bd03b][_0xf413('0x6c')]:'');}return _0x30545a+')';};var _0x5c28fe={'where':{'id':_0x28e6b7['params']['id']}},_0x1700d1,_0x3057a5,_0x5d2ca7,_0x49a012,_0x279652;_0x5c28fe=_['merge']({},_0x5c28fe,_0x28e6b7['options']);return db['AnalyticCustomReport'][_0xf413('0x4b')](_0x5c28fe)[_0xf413('0x26')](function(_0x3a36c9){if(_0x3a36c9){_0x1700d1=_0x3a36c9;return _0x3a36c9[_0xf413('0x6d')]();}return null;})[_0xf413('0x26')](function(_0x4c20c1){if(_0x4c20c1){if(!_0x4c20c1[_0xf413('0x4a')]){throw new db[(_0xf413('0x6e'))][(_0xf413('0x6f'))](_0xf413('0x70'),0x193);}_0x3057a5=_0x4c20c1;return db[_0xf413('0x71')][_0xf413('0x72')]({'raw':!![]});}return null;})[_0xf413('0x26')](function(_0x2a5f2a){if(_0x2a5f2a){_0x5d2ca7=_[_0xf413('0x73')](_0x2a5f2a,'id');var _0x78d45d;var _0x93fe6f=squel['select']();_0x93fe6f['from'](_0x1700d1['table']);for(var _0x4280d7=0x0;_0x4280d7<_0x3057a5[_0xf413('0x4a')];_0x4280d7+=0x1){_0x78d45d=_0x3057a5[_0x4280d7]['MetricId']?_0x5d2ca7[_0x3057a5[_0x4280d7][_0xf413('0x74')]][_0xf413('0x75')]:_0x3057a5[_0x4280d7][_0xf413('0x76')];_0x78d45d=_0x3057a5[_0x4280d7][_0xf413('0x77')]?_['replace'](_0x1235ac[_0x3057a5[_0x4280d7][_0xf413('0x77')]],'%s',_0x78d45d):_0x78d45d;_0x78d45d=_0x3057a5[_0x4280d7][_0xf413('0x78')]?_[_0xf413('0x79')](_0x432f3d[_0x3057a5[_0x4280d7]['format']],'%s',_0x78d45d):_0x78d45d;if(_0x3057a5[_0x4280d7]['groupBy']){_0x93fe6f[_0xf413('0x6a')](_0x78d45d);}_0x3057a5[_0x4280d7]['orderBy']&&_0x93fe6f[_0xf413('0x7a')](_0x78d45d,_0x3057a5[_0x4280d7][_0xf413('0x7b')]===_0xf413('0x7c')?![]:!![]);_0x93fe6f[_0xf413('0x76')](_0x78d45d,_0x3057a5[_0x4280d7]['alias']||_0x78d45d);}if(_0x1700d1['joins']){_0x1700d1[_0xf413('0x7d')]=JSON[_0xf413('0x7e')](_0x1700d1[_0xf413('0x7d')]);for(var _0x57c23a=0x0;_0x57c23a<_0x1700d1[_0xf413('0x7d')]['length'];_0x57c23a+=0x1){if(_0x1700d1['joins'][_0x57c23a][_0xf413('0x31')]&&_[_0xf413('0x63')](_0x204024,_0x1700d1[_0xf413('0x7d')][_0x57c23a][_0xf413('0x31')])&&_0x1700d1[_0xf413('0x7d')][_0x57c23a][_0xf413('0x7f')]&&_0x1700d1['joins'][_0x57c23a][_0xf413('0x80')]&&_0x1700d1[_0xf413('0x7d')][_0x57c23a]['foreignKey']){_0x93fe6f[_0x1700d1[_0xf413('0x7d')][_0x57c23a][_0xf413('0x31')]](_0x1700d1[_0xf413('0x7d')][_0x57c23a][_0xf413('0x80')],null,util['format'](_0xf413('0x81'),_0x1700d1[_0xf413('0x82')],_0x1700d1[_0xf413('0x7d')][_0x57c23a]['parentKey'],_0x1700d1[_0xf413('0x7d')][_0x57c23a][_0xf413('0x80')],_0x1700d1[_0xf413('0x7d')][_0x57c23a][_0xf413('0x83')]));}}}if(_0x1700d1[_0xf413('0x84')]){_0x1700d1[_0xf413('0x84')]=JSON[_0xf413('0x7e')](_0x1700d1['conditions']);_0x93fe6f['where'](_0x31dcb6(_0x1700d1['conditions'][_0xf413('0x6a')]));}_0x279652=_0x93fe6f[_0xf413('0x85')]();_0x93fe6f[_0xf413('0x1d')](_0x45fcfc);_0x93fe6f[_0xf413('0x20')](0x0);logger[_0xf413('0x86')]('Limited\x20Query:',_0x93fe6f['toString']());return dbH[_0xf413('0x87')][_0xf413('0x34')](_0x93fe6f[_0xf413('0x88')](),{'type':dbH[_0xf413('0x87')][_0xf413('0x89')][_0xf413('0x8a')]});}})['then'](respondWithResult(_0x505449,null))[_0xf413('0x46')](handleError(_0x505449,null));};function runReport(_0x7ca68c,_0x1fcc85,_0x2459c0){var _0x3b4ba7=_0x1fcc85[_0xf413('0x2c')];var _0x5361ed=0xa;var _0x40beae=['join','left_join',_0xf413('0x57'),'cross_join'];var _0x5a22d4={'SUM':'SUM(%s)','COUNT':_0xf413('0x8b'),'COUNT DISTINCT':_0xf413('0x8c'),'MAX':'MAX(%s)','MIN':_0xf413('0x5a'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xf413('0x8d'),'GROUP_CONCAT ASC':_0xf413('0x5c'),'GROUP_CONCAT DESC':_0xf413('0x5d')};var _0x3c0e0f={'SEC_TO_TIME':_0xf413('0x5e'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xf413('0x61'),'UNIX_TIMESTAMP':_0xf413('0x62')};var _0x57d776=function(_0x573ab6){return!_['includes']([_0xf413('0x64'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0xf413('0x67')],_0x573ab6);};var _0x136d48=function(_0x51cb05){if(!_0x51cb05||!_0x51cb05[_0xf413('0x68')][_0xf413('0x4a')]){return'';}for(var _0x4ae26c='(',_0x1700f8=0x0;_0x1700f8<_0x51cb05[_0xf413('0x68')][_0xf413('0x4a')];_0x1700f8+=0x1){_0x1700f8>0x0&&(_0x4ae26c+='\x20'+_0x51cb05[_0xf413('0x69')]+'\x20');_0x4ae26c+=_0x51cb05[_0xf413('0x68')][_0x1700f8][_0xf413('0x6a')]?_0x136d48(_0x51cb05[_0xf413('0x68')][_0x1700f8][_0xf413('0x6a')]):_0x51cb05[_0xf413('0x68')][_0x1700f8]['field']+'\x20'+_0x51cb05[_0xf413('0x68')][_0x1700f8][_0xf413('0x6b')]+(_0x57d776(_0x51cb05[_0xf413('0x68')][_0x1700f8][_0xf413('0x6b')])?'\x20'+_0x51cb05[_0xf413('0x68')][_0x1700f8][_0xf413('0x6c')]:'');}return _0x4ae26c+')';};var _0x1d553d={'where':{'id':_0x7ca68c['id']}},_0x48d763,_0x2ac396,_0x5f0b00,_0x3da1e3,_0x31e0af;_0x1d553d=_[_0xf413('0x40')]({},_0x1d553d,_0x2459c0);return db[_0xf413('0x30')][_0xf413('0x4b')](_0x1d553d)[_0xf413('0x26')](function(_0x306e5b){if(_0x306e5b){_0x48d763=_0x306e5b;return _0x306e5b[_0xf413('0x6d')]();}return null;})[_0xf413('0x26')](function(_0x357b29){if(_0x357b29){if(!_0x357b29[_0xf413('0x4a')]){throw new db[(_0xf413('0x6e'))][(_0xf413('0x6f'))](_0xf413('0x70'),0x193);}_0x2ac396=_0x357b29;return db[_0xf413('0x71')][_0xf413('0x72')]({'raw':!![]});}return null;})['then'](function(_0x47dfcd){if(_0x47dfcd){_0x5f0b00=_[_0xf413('0x73')](_0x47dfcd,'id');var _0x45e993;var _0x2682f7=squel['select']();_0x2682f7[_0xf413('0x8e')](_0x48d763[_0xf413('0x82')]);for(var _0x381c7b=0x0;_0x381c7b<_0x2ac396['length'];_0x381c7b+=0x1){_0x45e993=_0x2ac396[_0x381c7b][_0xf413('0x74')]?_0x5f0b00[_0x2ac396[_0x381c7b][_0xf413('0x74')]][_0xf413('0x75')]:_0x2ac396[_0x381c7b]['field'];_0x45e993=_0x2ac396[_0x381c7b][_0xf413('0x77')]?_[_0xf413('0x79')](_0x5a22d4[_0x2ac396[_0x381c7b][_0xf413('0x77')]],'%s',_0x45e993):_0x45e993;_0x45e993=_0x2ac396[_0x381c7b]['format']?_[_0xf413('0x79')](_0x3c0e0f[_0x2ac396[_0x381c7b][_0xf413('0x78')]],'%s',_0x45e993):_0x45e993;if(_0x2ac396[_0x381c7b][_0xf413('0x8f')]){_0x2682f7[_0xf413('0x6a')](_0x45e993);}_0x2ac396[_0x381c7b][_0xf413('0x7b')]&&_0x2682f7[_0xf413('0x7a')](_0x45e993,_0x2ac396[_0x381c7b][_0xf413('0x7b')]===_0xf413('0x7c')?![]:!![]);_0x2682f7[_0xf413('0x76')](_0x45e993,_0x2ac396[_0x381c7b][_0xf413('0x90')]||_0x45e993);}if(_0x48d763[_0xf413('0x7d')]){_0x48d763['joins']=JSON[_0xf413('0x7e')](_0x48d763[_0xf413('0x7d')]);for(var _0x4fbaa0=0x0;_0x4fbaa0<_0x48d763[_0xf413('0x7d')]['length'];_0x4fbaa0+=0x1){if(_0x48d763[_0xf413('0x7d')][_0x4fbaa0]['type']&&_[_0xf413('0x63')](_0x40beae,_0x48d763[_0xf413('0x7d')][_0x4fbaa0][_0xf413('0x31')])&&_0x48d763[_0xf413('0x7d')][_0x4fbaa0][_0xf413('0x7f')]&&_0x48d763[_0xf413('0x7d')][_0x4fbaa0][_0xf413('0x80')]&&_0x48d763['joins'][_0x4fbaa0][_0xf413('0x83')]){_0x2682f7[_0x48d763['joins'][_0x4fbaa0]['type']](_0x48d763[_0xf413('0x7d')][_0x4fbaa0]['foreignTable'],null,util[_0xf413('0x78')](_0xf413('0x81'),_0x48d763[_0xf413('0x82')],_0x48d763[_0xf413('0x7d')][_0x4fbaa0][_0xf413('0x7f')],_0x48d763[_0xf413('0x7d')][_0x4fbaa0][_0xf413('0x80')],_0x48d763['joins'][_0x4fbaa0][_0xf413('0x83')]));}}}if(_0x48d763[_0xf413('0x84')]){_0x48d763['conditions']=JSON[_0xf413('0x7e')](_0x48d763[_0xf413('0x84')]);_0x2682f7['where'](_0x136d48(_0x48d763['conditions'][_0xf413('0x6a')]));}_0x31e0af=_0x2682f7[_0xf413('0x85')]();_0x2682f7[_0xf413('0x1d')](_0x5361ed);_0x2682f7[_0xf413('0x20')](0x0);return;}})[_0xf413('0x26')](function(){if(_0x1fcc85['output']===_0xf413('0x91')){return null;}var _0x2a79c2=_[_0xf413('0x40')](_0x1fcc85,{'name':_0x1fcc85[_0xf413('0x92')]||_0x1fcc85[_0xf413('0x2c')]||_0x48d763[_0xf413('0x2c')],'basename':_0x3b4ba7,'savename':util[_0xf413('0x78')](_0xf413('0x93'),_0x1fcc85[_0xf413('0x2c')]||_0x48d763[_0xf413('0x2c')],require(_0xf413('0x94'))['generate'](0x4),_0x1fcc85[_0xf413('0x95')]||'csv'),'reportId':_0x48d763['id'],'reportType':_0xf413('0x96')});return db[_0xf413('0x97')]['create'](_0x2a79c2,{'raw':!![]});})['then'](function(_0x30246b){if(_0x48d763[_0xf413('0x82')]===_0xf413('0x98')){_0x31e0af[_0xf413('0x3d')](_0x48d763[_0xf413('0x82')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x1fcc85[_0xf413('0x99')],_0x1fcc85[_0xf413('0x9a')]);}else{_0x31e0af[_0xf413('0x3d')](_0x48d763['table']+_0xf413('0x9b'),_0x1fcc85[_0xf413('0x99')],_0x1fcc85[_0xf413('0x9a')]);}if(_0x30246b){logger['info'](_0xf413('0x9c'),_0x31e0af[_0xf413('0x88')]());require('child_process')[_0xf413('0x9d')](path[_0xf413('0x55')](__dirname,_0xf413('0x9e'),_0x30246b[_0xf413('0x95')]),[_0x30246b['id'],_0x31e0af[_0xf413('0x88')](),path['join'](__dirname,'../../files/reports',_0x30246b['savename']),_0x3b4ba7]);return _0x30246b;}else{var _0x3df604=squel[_0xf413('0x9f')]();_0x3df604[_0xf413('0x8e')]('('+_0x31e0af['toString']()+')',_0xf413('0xa0'));_0x3df604['field'](_0xf413('0xa1'),_0xf413('0x1f'));_0x31e0af['limit'](_0x1fcc85[_0xf413('0x1d')]||_0x5361ed);_0x31e0af[_0xf413('0x20')](_0x1fcc85[_0xf413('0x20')]||0x0);return dbH[_0xf413('0x87')]['query'](_0x3df604[_0xf413('0x88')](),{'type':dbH[_0xf413('0x87')][_0xf413('0x89')][_0xf413('0x8a')]})[_0xf413('0x26')](function(_0xb30a5){if(!_0xb30a5['length']){_0x3da1e3=0x0;}else{_0x3da1e3=_0xb30a5[0x0]['count']||0x0;}return dbH['sequelize'][_0xf413('0x34')](_0x31e0af[_0xf413('0x88')](),{'type':dbH[_0xf413('0x87')][_0xf413('0x89')]['SELECT']});})[_0xf413('0x26')](function(_0x4927cf){return{'rows':_0x4927cf||[],'count':_0x3da1e3};});}});}exports[_0xf413('0xa2')]=function(_0x140361,_0x1997fe){return runReport(_0x140361[_0xf413('0x48')],_0x140361[_0xf413('0x34')],_0x140361[_0xf413('0x42')])[_0xf413('0x26')](respondWithResult(_0x1997fe,null))[_0xf413('0x46')](handleError(_0x1997fe,null));};exports[_0xf413('0xa3')]=runReport;exports[_0xf413('0x34')]=function(_0x31fee7,_0x12fcb2){var _0x279632=0xa;var _0x35e17c=[_0xf413('0x55'),_0xf413('0x56'),_0xf413('0x57'),_0xf413('0x58')];var _0x512a1b={'SUM':'SUM(%s)','COUNT':_0xf413('0x8b'),'COUNT DISTINCT':_0xf413('0x8c'),'MAX':_0xf413('0xa4'),'MIN':_0xf413('0x5a'),'AVG':_0xf413('0x5b'),'GROUP_CONCAT':_0xf413('0x8d'),'GROUP_CONCAT ASC':_0xf413('0x5c'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x413829={'SEC_TO_TIME':_0xf413('0x5e'),'DATE':_0xf413('0x5f'),'HOUR':_0xf413('0x60'),'ROUND':_0xf413('0x61'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0xf1cc33=function(_0x5f5c45){return!_[_0xf413('0x63')]([_0xf413('0x64'),_0xf413('0x65'),_0xf413('0x66'),_0xf413('0x67')],_0x5f5c45);};var _0x5b86fb=function(_0xccb251){if(!_0xccb251||!_0xccb251[_0xf413('0x68')][_0xf413('0x4a')]){return'';}for(var _0x1f2ce3='(',_0x749dbc=0x0;_0x749dbc<_0xccb251['rules']['length'];_0x749dbc+=0x1){_0x749dbc>0x0&&(_0x1f2ce3+='\x20'+_0xccb251[_0xf413('0x69')]+'\x20');_0x1f2ce3+=_0xccb251['rules'][_0x749dbc]['group']?_0x5b86fb(_0xccb251[_0xf413('0x68')][_0x749dbc]['group']):_0xccb251[_0xf413('0x68')][_0x749dbc][_0xf413('0x76')]+'\x20'+_0xccb251[_0xf413('0x68')][_0x749dbc][_0xf413('0x6b')]+(_0xf1cc33(_0xccb251[_0xf413('0x68')][_0x749dbc][_0xf413('0x6b')])?'\x20'+_0xccb251[_0xf413('0x68')][_0x749dbc][_0xf413('0x6c')]:'');}return _0x1f2ce3+')';};var _0x57a7d0={'where':{'id':_0x31fee7[_0xf413('0x48')]['id']}},_0x24f01e,_0x3c0376,_0x21cc5b,_0x21fc7c,_0x50b602;_0x57a7d0=_[_0xf413('0x40')]({},_0x57a7d0,_0x31fee7[_0xf413('0x42')]);return db[_0xf413('0x30')][_0xf413('0x4b')](_0x57a7d0)[_0xf413('0x26')](function(_0x8d7ced){if(_0x8d7ced){_0x24f01e=_0x8d7ced;return _0x8d7ced['getFields']();}return null;})[_0xf413('0x26')](function(_0x165ea2){if(_0x165ea2){if(!_0x165ea2[_0xf413('0x4a')]){throw new db[(_0xf413('0x6e'))]['ValidationErrorItem'](_0xf413('0x70'),0x193);}_0x3c0376=_0x165ea2;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xf413('0x26')](function(_0x16f84e){if(_0x16f84e){_0x21cc5b=_[_0xf413('0x73')](_0x16f84e,'id');var _0x35db6b;var _0x2b1e24=squel[_0xf413('0x9f')]();_0x2b1e24[_0xf413('0x8e')](_0x24f01e[_0xf413('0x82')]);for(var _0x557c25=0x0;_0x557c25<_0x3c0376[_0xf413('0x4a')];_0x557c25+=0x1){_0x35db6b=_0x3c0376[_0x557c25][_0xf413('0x74')]?_0x21cc5b[_0x3c0376[_0x557c25]['MetricId']][_0xf413('0x75')]:_0x3c0376[_0x557c25][_0xf413('0x76')];_0x35db6b=_0x3c0376[_0x557c25][_0xf413('0x77')]?_[_0xf413('0x79')](_0x512a1b[_0x3c0376[_0x557c25][_0xf413('0x77')]],'%s',_0x35db6b):_0x35db6b;_0x35db6b=_0x3c0376[_0x557c25][_0xf413('0x78')]?_['replace'](_0x413829[_0x3c0376[_0x557c25][_0xf413('0x78')]],'%s',_0x35db6b):_0x35db6b;if(_0x3c0376[_0x557c25][_0xf413('0x8f')]){_0x2b1e24[_0xf413('0x6a')](_0x35db6b);}_0x3c0376[_0x557c25][_0xf413('0x7b')]&&_0x2b1e24[_0xf413('0x7a')](_0x35db6b,_0x3c0376[_0x557c25][_0xf413('0x7b')]===_0xf413('0x7c')?![]:!![]);_0x2b1e24[_0xf413('0x76')](_0x35db6b,_0x3c0376[_0x557c25]['alias']||_0x35db6b);}if(_0x24f01e[_0xf413('0x7d')]){_0x24f01e['joins']=JSON[_0xf413('0x7e')](_0x24f01e['joins']);for(var _0x2a6960=0x0;_0x2a6960<_0x24f01e[_0xf413('0x7d')][_0xf413('0x4a')];_0x2a6960+=0x1){if(_0x24f01e[_0xf413('0x7d')][_0x2a6960][_0xf413('0x31')]&&_[_0xf413('0x63')](_0x35e17c,_0x24f01e['joins'][_0x2a6960][_0xf413('0x31')])&&_0x24f01e[_0xf413('0x7d')][_0x2a6960][_0xf413('0x7f')]&&_0x24f01e['joins'][_0x2a6960]['foreignTable']&&_0x24f01e[_0xf413('0x7d')][_0x2a6960][_0xf413('0x83')]){_0x2b1e24[_0x24f01e[_0xf413('0x7d')][_0x2a6960][_0xf413('0x31')]](_0x24f01e[_0xf413('0x7d')][_0x2a6960][_0xf413('0x80')],null,util[_0xf413('0x78')]('%s.%s\x20=\x20%s.%s',_0x24f01e['table'],_0x24f01e['joins'][_0x2a6960][_0xf413('0x7f')],_0x24f01e[_0xf413('0x7d')][_0x2a6960][_0xf413('0x80')],_0x24f01e[_0xf413('0x7d')][_0x2a6960]['foreignKey']));}}}if(_0x24f01e[_0xf413('0x84')]){_0x24f01e[_0xf413('0x84')]=JSON[_0xf413('0x7e')](_0x24f01e[_0xf413('0x84')]);_0x2b1e24[_0xf413('0x3d')](_0x5b86fb(_0x24f01e['conditions'][_0xf413('0x6a')]));}_0x50b602=_0x2b1e24[_0xf413('0x85')]();_0x2b1e24[_0xf413('0x1d')](_0x279632);_0x2b1e24['offset'](0x0);logger[_0xf413('0x86')]('Limited\x20Query:',_0x2b1e24[_0xf413('0x88')]());return dbH[_0xf413('0x87')][_0xf413('0x34')](_0x2b1e24[_0xf413('0x88')](),{'type':dbH[_0xf413('0x87')][_0xf413('0x89')]['SELECT']});}})[_0xf413('0x26')](function(){return{'sql':_0x50b602[_0xf413('0x88')]()};})['then'](respondWithResult(_0x12fcb2,null))[_0xf413('0x46')](handleError(_0x12fcb2,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 6c48c4c..9381b3b 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 _0x6e67=['rimraf','../../config/environment','./analyticCustomReport.attributes','define','analytics_custom_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4dc12e,_0x203a26){var _0x542ac7=function(_0x139aa5){while(--_0x139aa5){_0x4dc12e['push'](_0x4dc12e['shift']());}};_0x542ac7(++_0x203a26);}(_0x6e67,0x1e6));var _0x76e6=function(_0x2124a6,_0x4b788c){_0x2124a6=_0x2124a6-0x0;var _0x23e704=_0x6e67[_0x2124a6];return _0x23e704;};'use strict';var _=require(_0x76e6('0x0'));var util=require(_0x76e6('0x1'));var logger=require(_0x76e6('0x2'))(_0x76e6('0x3'));var moment=require(_0x76e6('0x4'));var BPromise=require(_0x76e6('0x5'));var rp=require(_0x76e6('0x6'));var fs=require('fs');var path=require(_0x76e6('0x7'));var rimraf=require(_0x76e6('0x8'));var config=require(_0x76e6('0x9'));var attributes=require(_0x76e6('0xa'));module['exports']=function(_0x3b7935,_0x3fd5ca){return _0x3b7935[_0x76e6('0xb')]('AnalyticCustomReport',attributes,{'tableName':_0x76e6('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7fc1=['../../config/environment','./analyticCustomReport.attributes','exports','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x7fc1,0x6d));var _0x17fc=function(_0x15fca6,_0x546c5c){_0x15fca6=_0x15fca6-0x0;var _0x15792a=_0x7fc1[_0x15fca6];return _0x15792a;};'use strict';var _=require(_0x17fc('0x0'));var util=require(_0x17fc('0x1'));var logger=require(_0x17fc('0x2'))(_0x17fc('0x3'));var moment=require(_0x17fc('0x4'));var BPromise=require(_0x17fc('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x17fc('0x6'));var rimraf=require(_0x17fc('0x7'));var config=require(_0x17fc('0x8'));var attributes=require(_0x17fc('0x9'));module[_0x17fc('0xa')]=function(_0x44732c,_0x1c2787){return _0x44732c['define'](_0x17fc('0xb'),attributes,{'tableName':_0x17fc('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 d8a72ab..caf44a3 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 _0x999c=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x999c,0xf7));var _0xc999=function(_0x1fd3de,_0x36cfa2){_0x1fd3de=_0x1fd3de-0x0;var _0x411aba=_0x999c[_0x1fd3de];return _0x411aba;};'use strict';var _=require(_0xc999('0x0'));var util=require(_0xc999('0x1'));var moment=require(_0xc999('0x2'));var BPromise=require(_0xc999('0x3'));var rs=require(_0xc999('0x4'));var fs=require('fs');var Redis=require(_0xc999('0x5'));var db=require(_0xc999('0x6'))['db'];var utils=require(_0xc999('0x7'));var logger=require(_0xc999('0x8'))(_0xc999('0x9'));var config=require(_0xc999('0xa'));var jayson=require(_0xc999('0xb'));var client=jayson[_0xc999('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0xf46970,_0x272f56,_0x370dc8){return new BPromise(function(_0x404363,_0x3a9bd9){return client[_0xc999('0xd')](_0xf46970,_0x370dc8)[_0xc999('0xe')](function(_0x245ff3){logger[_0xc999('0xf')](_0xc999('0x10'),_0x272f56,_0xc999('0x11'));logger[_0xc999('0x12')](_0xc999('0x13'),_0x272f56,_0xc999('0x11'),JSON[_0xc999('0x14')](_0x245ff3));if(_0x245ff3[_0xc999('0x15')]){if(_0x245ff3['error'][_0xc999('0x16')]===0x1f4){logger[_0xc999('0x15')](_0xc999('0x10'),_0x272f56,_0x245ff3[_0xc999('0x15')]['message']);return _0x3a9bd9(_0x245ff3[_0xc999('0x15')][_0xc999('0x17')]);}logger[_0xc999('0x15')](_0xc999('0x10'),_0x272f56,_0x245ff3[_0xc999('0x15')][_0xc999('0x17')]);return _0x404363(_0x245ff3['error']['message']);}else{logger[_0xc999('0xf')](_0xc999('0x10'),_0x272f56,_0xc999('0x11'));_0x404363(_0x245ff3['result'][_0xc999('0x17')]);}})[_0xc999('0x18')](function(_0x189282){logger['error'](_0xc999('0x10'),_0x272f56,_0x189282);_0x3a9bd9(_0x189282);});});} \ No newline at end of file +var _0x63a8=['http','request','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x5f08a6,_0x400121){var _0x5d0641=function(_0x304467){while(--_0x304467){_0x5f08a6['push'](_0x5f08a6['shift']());}};_0x5d0641(++_0x400121);}(_0x63a8,0xd2));var _0x863a=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x63a8[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x863a('0x0'));var util=require(_0x863a('0x1'));var moment=require(_0x863a('0x2'));var BPromise=require('bluebird');var rs=require(_0x863a('0x3'));var fs=require('fs');var Redis=require(_0x863a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x863a('0x5'));var logger=require(_0x863a('0x6'))(_0x863a('0x7'));var config=require('../../config/environment');var jayson=require(_0x863a('0x8'));var client=jayson[_0x863a('0x9')][_0x863a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x43d0d3,_0x16692e,_0x92f119){return new BPromise(function(_0x507737,_0x2ff54c){return client[_0x863a('0xb')](_0x43d0d3,_0x92f119)[_0x863a('0xc')](function(_0x1779cd){logger['info'](_0x863a('0xd'),_0x16692e,_0x863a('0xe'));logger[_0x863a('0xf')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x16692e,_0x863a('0xe'),JSON['stringify'](_0x1779cd));if(_0x1779cd[_0x863a('0x10')]){if(_0x1779cd[_0x863a('0x10')][_0x863a('0x11')]===0x1f4){logger[_0x863a('0x10')](_0x863a('0xd'),_0x16692e,_0x1779cd[_0x863a('0x10')]['message']);return _0x2ff54c(_0x1779cd[_0x863a('0x10')]['message']);}logger['error'](_0x863a('0xd'),_0x16692e,_0x1779cd[_0x863a('0x10')][_0x863a('0x12')]);return _0x507737(_0x1779cd[_0x863a('0x10')][_0x863a('0x12')]);}else{logger[_0x863a('0x13')](_0x863a('0xd'),_0x16692e,_0x863a('0xe'));_0x507737(_0x1779cd[_0x863a('0x14')][_0x863a('0x12')]);}})[_0x863a('0x15')](function(_0x23ce04){logger['error'](_0x863a('0xd'),_0x16692e,_0x23ce04);_0x2ff54c(_0x23ce04);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 9668350..e0ab449 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 _0x8ad9=['query','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','index','/:id','show','/:id/preview','isAuthenticated','/:id/run'];(function(_0x335931,_0x42214b){var _0x2e2be9=function(_0x2ae612){while(--_0x2ae612){_0x335931['push'](_0x335931['shift']());}};_0x2e2be9(++_0x42214b);}(_0x8ad9,0x6c));var _0x98ad=function(_0x486f4a,_0x478dc7){_0x486f4a=_0x486f4a-0x0;var _0x135d99=_0x8ad9[_0x486f4a];return _0x135d99;};'use strict';var multer=require(_0x98ad('0x0'));var util=require(_0x98ad('0x1'));var path=require(_0x98ad('0x2'));var timeout=require(_0x98ad('0x3'));var express=require(_0x98ad('0x4'));var router=express[_0x98ad('0x5')]();var fs_extra=require(_0x98ad('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x98ad('0x7'));var config=require(_0x98ad('0x8'));var controller=require(_0x98ad('0x9'));router[_0x98ad('0xa')]('/',auth['isAuthenticated'](),controller[_0x98ad('0xb')]);router[_0x98ad('0xa')](_0x98ad('0xc'),auth['isAuthenticated'](),controller[_0x98ad('0xd')]);router['get'](_0x98ad('0xe'),auth[_0x98ad('0xf')](),controller['preview']);router[_0x98ad('0xa')](_0x98ad('0x10'),auth[_0x98ad('0xf')](),controller['run']);router[_0x98ad('0xa')]('/:id/query',auth[_0x98ad('0xf')](),controller[_0x98ad('0x11')]);router[_0x98ad('0x12')]('/',auth[_0x98ad('0xf')](),controller[_0x98ad('0x13')]);router[_0x98ad('0x14')](_0x98ad('0xc'),auth[_0x98ad('0xf')](),controller[_0x98ad('0x15')]);router[_0x98ad('0x16')](_0x98ad('0xc'),auth[_0x98ad('0xf')](),controller[_0x98ad('0x17')]);module[_0x98ad('0x18')]=router; \ No newline at end of file +var _0x615e=['query','post','create','put','update','delete','destroy','exports','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','/:id/run','run','/:id/query'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x615e,0x128));var _0xe615=function(_0x2aa8b,_0x4dd1b0){_0x2aa8b=_0x2aa8b-0x0;var _0x52ef53=_0x615e[_0x2aa8b];return _0x52ef53;};'use strict';var multer=require('multer');var util=require(_0xe615('0x0'));var path=require(_0xe615('0x1'));var timeout=require('connect-timeout');var express=require(_0xe615('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe615('0x3'));var interaction=require(_0xe615('0x4'));var config=require(_0xe615('0x5'));var controller=require(_0xe615('0x6'));router[_0xe615('0x7')]('/',auth[_0xe615('0x8')](),controller[_0xe615('0x9')]);router[_0xe615('0x7')](_0xe615('0xa'),auth[_0xe615('0x8')](),controller[_0xe615('0xb')]);router[_0xe615('0x7')](_0xe615('0xc'),auth[_0xe615('0x8')](),controller['preview']);router[_0xe615('0x7')](_0xe615('0xd'),auth['isAuthenticated'](),controller[_0xe615('0xe')]);router[_0xe615('0x7')](_0xe615('0xf'),auth[_0xe615('0x8')](),controller[_0xe615('0x10')]);router[_0xe615('0x11')]('/',auth['isAuthenticated'](),controller[_0xe615('0x12')]);router[_0xe615('0x13')]('/:id',auth[_0xe615('0x8')](),controller[_0xe615('0x14')]);router[_0xe615('0x15')](_0xe615('0xa'),auth[_0xe615('0x8')](),controller[_0xe615('0x16')]);module[_0xe615('0x17')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 5793d21..542e011 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 _0x4819=['TEXT','exports','STRING'];(function(_0x274dd7,_0x2e6051){var _0x148829=function(_0x4cec98){while(--_0x4cec98){_0x274dd7['push'](_0x274dd7['shift']());}};_0x148829(++_0x2e6051);}(_0x4819,0xcd));var _0x9481=function(_0x4c67da,_0x12fba3){_0x4c67da=_0x4c67da-0x0;var _0x507337=_0x4819[_0x4c67da];return _0x507337;};'use strict';var Sequelize=require('sequelize');module[_0x9481('0x0')]={'name':{'type':Sequelize[_0x9481('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x9481('0x1')]},'parent':{'type':Sequelize[_0x9481('0x1')]},'table':{'type':Sequelize[_0x9481('0x1')]},'conditions':{'type':Sequelize[_0x9481('0x2')]},'joins':{'type':Sequelize[_0x9481('0x2')]}}; \ No newline at end of file +var _0xeda8=['sequelize','exports','STRING','TEXT'];(function(_0x2f4e65,_0x58cfd8){var _0x22b944=function(_0x4c7cc5){while(--_0x4c7cc5){_0x2f4e65['push'](_0x2f4e65['shift']());}};_0x22b944(++_0x58cfd8);}(_0xeda8,0x104));var _0x8eda=function(_0x4eb898,_0x10001a){_0x4eb898=_0x4eb898-0x0;var _0x4f3b72=_0xeda8[_0x4eb898];return _0x4f3b72;};'use strict';var Sequelize=require(_0x8eda('0x0'));module[_0x8eda('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x8eda('0x2')]},'parent':{'type':Sequelize[_0x8eda('0x2')]},'table':{'type':Sequelize[_0x8eda('0x2')]},'conditions':{'type':Sequelize[_0x8eda('0x3')]},'joins':{'type':Sequelize[_0x8eda('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 1048cf7..0c11cc6 100644 --- a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js +++ b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fc3=['QueryTypes','right_join','HOUR(%s)','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','dbH','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','get','DefaultReports','destroy','error','stack','name','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','rules','operator','group','field','condition','value','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','groupBy','orderBy','order','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','format','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','sequelize','toString','SELECT','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20EMPTY','getFields','ValidationErrorItem','fullPath','%s-%s.%s','generate','output','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','fork','../../components/export/','../../files/reports','countTable','COUNT(*)'];(function(_0xaf2a3b,_0x1516f1){var _0x91ffbe=function(_0x4a6908){while(--_0x4a6908){_0xaf2a3b['push'](_0xaf2a3b['shift']());}};_0x91ffbe(++_0x1516f1);}(_0x5fc3,0xa8));var _0x35fc=function(_0x43e4b3,_0x1444de){_0x43e4b3=_0x43e4b3-0x0;var _0x10c655=_0x5fc3[_0x43e4b3];return _0x10c655;};'use strict';var emlformat=require(_0x35fc('0x0'));var rimraf=require(_0x35fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x35fc('0x2'));var rp=require(_0x35fc('0x3'));var moment=require(_0x35fc('0x4'));var BPromise=require(_0x35fc('0x5'));var Mustache=require(_0x35fc('0x6'));var util=require('util');var path=require(_0x35fc('0x7'));var sox=require(_0x35fc('0x8'));var csv=require(_0x35fc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x35fc('0xa'));var squel=require('squel');var crypto=require(_0x35fc('0xb'));var jsforce=require(_0x35fc('0xc'));var deskjs=require(_0x35fc('0xd'));var toCsv=require(_0x35fc('0x9'));var querystring=require(_0x35fc('0xe'));var Papa=require(_0x35fc('0xf'));var Redis=require(_0x35fc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x35fc('0x11'));var as=require(_0x35fc('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x35fc('0x13'))(_0x35fc('0x14'));var utils=require('../../config/utils');var config=require(_0x35fc('0x15'));var licenseUtil=require(_0x35fc('0x16'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0x35fc('0x17')];function respondWithStatusCode(_0x5d462a,_0x397738){_0x397738=_0x397738||0xcc;return function(_0x22055e){if(_0x22055e){return _0x5d462a[_0x35fc('0x18')](_0x397738);}return _0x5d462a[_0x35fc('0x19')](_0x397738)[_0x35fc('0x1a')]();};}function respondWithResult(_0x5cfe94,_0x59507a){_0x59507a=_0x59507a||0xc8;return function(_0x5eac0f){if(_0x5eac0f){return _0x5cfe94['status'](_0x59507a)[_0x35fc('0x1b')](_0x5eac0f);}};}function respondWithFilteredResult(_0x229d56,_0x53b898){return function(_0x154958){if(_0x154958){var _0x227a49=typeof _0x53b898[_0x35fc('0x1c')]==='undefined'&&typeof _0x53b898[_0x35fc('0x1d')]===_0x35fc('0x1e');var _0x553677=_0x154958[_0x35fc('0x1f')];var _0x363e47=_0x227a49?0x0:_0x53b898[_0x35fc('0x1c')];var _0x5f56c6=_0x227a49?_0x154958[_0x35fc('0x1f')]:_0x53b898[_0x35fc('0x1c')]+_0x53b898[_0x35fc('0x1d')];var _0x488234;if(_0x5f56c6>=_0x553677){_0x5f56c6=_0x553677;_0x488234=0xc8;}else{_0x488234=0xce;}_0x229d56[_0x35fc('0x19')](_0x488234);return _0x229d56[_0x35fc('0x20')](_0x35fc('0x21'),_0x363e47+'-'+_0x5f56c6+'/'+_0x553677)[_0x35fc('0x1b')](_0x154958);}return null;};}function patchUpdates(_0x20ffde){return function(_0x21f1a9){try{jsonpatch[_0x35fc('0x22')](_0x21f1a9,_0x20ffde,!![]);}catch(_0x3b05b0){return BPromise[_0x35fc('0x23')](_0x3b05b0);}return _0x21f1a9[_0x35fc('0x24')]();};}function saveUpdates(_0x5bd2b8,_0x323aee){return function(_0xd5399f){if(_0xd5399f){return _0xd5399f[_0x35fc('0x25')](_0x5bd2b8)[_0x35fc('0x26')](function(_0x3b4743){return _0x3b4743;});}return null;};}function removeEntity(_0x55e9e7,_0x33f5e8){return function(_0x4c587a){if(_0x4c587a){return _0x4c587a['destroy']()[_0x35fc('0x26')](function(){var _0x5a93df=_0x4c587a[_0x35fc('0x27')]({'plain':!![]});var _0x51cfec=_0x35fc('0x28');return db['UserProfileResource'][_0x35fc('0x29')]({'where':{'type':_0x51cfec,'resourceId':_0x5a93df['id']}})[_0x35fc('0x26')](function(){return _0x4c587a;});})['then'](function(){_0x55e9e7['status'](0xcc)[_0x35fc('0x1a')]();});}};}function handleEntityNotFound(_0x58edb6,_0x274208){return function(_0x1a5d92){if(!_0x1a5d92){_0x58edb6['sendStatus'](0x194);}return _0x1a5d92;};}function handleError(_0x26b7cb,_0x645eac){_0x645eac=_0x645eac||0x1f4;return function(_0x383837){logger[_0x35fc('0x2a')](_0x383837[_0x35fc('0x2b')]);if(_0x383837[_0x35fc('0x2c')]){delete _0x383837[_0x35fc('0x2c')];}_0x26b7cb[_0x35fc('0x19')](_0x645eac)['send'](_0x383837);};}exports[_0x35fc('0x2d')]=function(_0x220931,_0x22af18){var _0x52acc5={},_0xe79f52={},_0x16f067={'count':0x0,'rows':[]};var _0x3822a8=_[_0x35fc('0x2e')](db[_0x35fc('0x2f')][_0x35fc('0x30')],function(_0x222ddb){return{'name':_0x222ddb[_0x35fc('0x31')],'type':_0x222ddb[_0x35fc('0x32')][_0x35fc('0x33')]};});_0xe79f52['model']=_['map'](_0x3822a8,_0x35fc('0x2c'));_0xe79f52['query']=_[_0x35fc('0x34')](_0x220931[_0x35fc('0x35')]);_0xe79f52[_0x35fc('0x36')]=_[_0x35fc('0x37')](_0xe79f52[_0x35fc('0x38')],_0xe79f52[_0x35fc('0x35')]);_0x52acc5['attributes']=_[_0x35fc('0x37')](_0xe79f52[_0x35fc('0x38')],qs[_0x35fc('0x39')](_0x220931[_0x35fc('0x35')][_0x35fc('0x39')]));_0x52acc5[_0x35fc('0x3a')]=_0x52acc5['attributes'][_0x35fc('0x3b')]?_0x52acc5[_0x35fc('0x3a')]:_0xe79f52[_0x35fc('0x38')];if(!_0x220931['query'][_0x35fc('0x3c')]('nolimit')){_0x52acc5[_0x35fc('0x1d')]=qs[_0x35fc('0x1d')](_0x220931[_0x35fc('0x35')][_0x35fc('0x1d')]);_0x52acc5['offset']=qs['offset'](_0x220931['query'][_0x35fc('0x1c')]);}_0x52acc5['order']=qs[_0x35fc('0x3d')](_0x220931['query'][_0x35fc('0x3d')]);_0x52acc5[_0x35fc('0x3e')]=qs[_0x35fc('0x36')](_[_0x35fc('0x3f')](_0x220931[_0x35fc('0x35')],_0xe79f52[_0x35fc('0x36')]),_0x3822a8);if(_0x220931[_0x35fc('0x35')]['filter']){_0x52acc5[_0x35fc('0x3e')]=_[_0x35fc('0x40')](_0x52acc5['where'],{'$or':_[_0x35fc('0x2e')](_0x3822a8,function(_0x1ccc41){if(_0x1ccc41[_0x35fc('0x32')]!==_0x35fc('0x41')){var _0x813866={};_0x813866[_0x1ccc41[_0x35fc('0x2c')]]={'$like':'%'+_0x220931['query'][_0x35fc('0x42')]+'%'};return _0x813866;}})});}_0x52acc5=_[_0x35fc('0x40')]({},_0x52acc5,_0x220931[_0x35fc('0x43')]);var _0x52543b={'where':_0x52acc5[_0x35fc('0x3e')]};return db[_0x35fc('0x2f')]['count'](_0x52543b)[_0x35fc('0x26')](function(_0x280af1){_0x16f067[_0x35fc('0x1f')]=_0x280af1;if(_0x220931[_0x35fc('0x35')][_0x35fc('0x44')]){_0x52acc5[_0x35fc('0x45')]=[{'all':!![]}];}return db[_0x35fc('0x2f')][_0x35fc('0x46')](_0x52acc5);})['then'](function(_0x596e83){_0x16f067[_0x35fc('0x47')]=_0x596e83;return _0x16f067;})[_0x35fc('0x26')](respondWithFilteredResult(_0x22af18,_0x52acc5))['catch'](handleError(_0x22af18,null));};exports['show']=function(_0x4ff202,_0x79677d){var _0x10f98b={'raw':!![],'where':{'id':_0x4ff202[_0x35fc('0x48')]['id']}},_0x4e56ed={};_0x4e56ed[_0x35fc('0x38')]=_[_0x35fc('0x34')](db[_0x35fc('0x2f')]['rawAttributes']);_0x4e56ed['query']=_['keys'](_0x4ff202['query']);_0x4e56ed['filters']=_[_0x35fc('0x37')](_0x4e56ed[_0x35fc('0x38')],_0x4e56ed['query']);_0x10f98b[_0x35fc('0x3a')]=_['intersection'](_0x4e56ed[_0x35fc('0x38')],qs[_0x35fc('0x39')](_0x4ff202[_0x35fc('0x35')][_0x35fc('0x39')]));_0x10f98b[_0x35fc('0x3a')]=_0x10f98b['attributes'][_0x35fc('0x3b')]?_0x10f98b[_0x35fc('0x3a')]:_0x4e56ed['model'];if(_0x4ff202[_0x35fc('0x35')][_0x35fc('0x44')]){_0x10f98b[_0x35fc('0x45')]=[{'all':!![]}];}_0x10f98b=_[_0x35fc('0x40')]({},_0x10f98b,_0x4ff202['options']);return db[_0x35fc('0x2f')]['find'](_0x10f98b)['then'](handleEntityNotFound(_0x79677d,null))[_0x35fc('0x26')](respondWithResult(_0x79677d,null))[_0x35fc('0x49')](handleError(_0x79677d,null));};exports[_0x35fc('0x4a')]=function(_0xca8aef,_0xf2ca20){return db[_0x35fc('0x2f')][_0x35fc('0x4a')](_0xca8aef[_0x35fc('0x4b')],{})['then'](function(_0x3e2961){var _0x91d7c0=_0xca8aef[_0x35fc('0x4c')][_0x35fc('0x27')]({'plain':!![]});if(!_0x91d7c0)throw new Error(_0x35fc('0x4d'));if(_0x91d7c0[_0x35fc('0x4e')]===_0x35fc('0x4c')){var _0x347a4a=_0x3e2961[_0x35fc('0x27')]({'plain':!![]});var _0xe6eb6a=_0x35fc('0x4f');return db[_0x35fc('0x50')][_0x35fc('0x51')]({'where':{'name':_0xe6eb6a,'userProfileId':_0x91d7c0[_0x35fc('0x52')]},'raw':!![]})['then'](function(_0x553ed6){if(_0x553ed6&&_0x553ed6[_0x35fc('0x53')]===0x0){return db[_0x35fc('0x54')][_0x35fc('0x4a')]({'name':_0x347a4a[_0x35fc('0x2c')],'resourceId':_0x347a4a['id'],'type':_0x35fc('0x28'),'sectionId':_0x553ed6['id']},{})[_0x35fc('0x26')](function(){return _0x3e2961;});}else{return _0x3e2961;}})['catch'](function(_0x4f024c){logger[_0x35fc('0x2a')](_0x35fc('0x55'),_0x4f024c);throw _0x4f024c;});}return _0x3e2961;})[_0x35fc('0x26')](respondWithResult(_0xf2ca20,0xc9))[_0x35fc('0x49')](handleError(_0xf2ca20,null));};exports['update']=function(_0x467980,_0x13281f){if(_0x467980['body']['id']){delete _0x467980[_0x35fc('0x4b')]['id'];}return db[_0x35fc('0x2f')]['find']({'where':{'id':_0x467980[_0x35fc('0x48')]['id']}})[_0x35fc('0x26')](handleEntityNotFound(_0x13281f,null))[_0x35fc('0x26')](saveUpdates(_0x467980[_0x35fc('0x4b')],null))['then'](respondWithResult(_0x13281f,null))['catch'](handleError(_0x13281f,null));};exports['destroy']=function(_0x240338,_0x2ea8d6){return db['AnalyticDefaultReport'][_0x35fc('0x51')]({'where':{'id':_0x240338[_0x35fc('0x48')]['id']}})[_0x35fc('0x26')](handleEntityNotFound(_0x2ea8d6,null))[_0x35fc('0x26')](removeEntity(_0x2ea8d6,null))[_0x35fc('0x49')](handleError(_0x2ea8d6,null));};exports['preview']=function(_0x2d9d45,_0x757aa6){var _0x39d470=0xa;var _0x509e77=[_0x35fc('0x56'),_0x35fc('0x57'),'right_join',_0x35fc('0x58')];var _0x164c7b={'SUM':_0x35fc('0x59'),'COUNT':_0x35fc('0x5a'),'COUNT DISTINCT':_0x35fc('0x5b'),'MAX':_0x35fc('0x5c'),'MIN':_0x35fc('0x5d'),'AVG':_0x35fc('0x5e'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x35fc('0x5f'),'GROUP_CONCAT DESC':_0x35fc('0x60')};var _0x303927={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x35fc('0x61'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x23b54f=function(_0xb1c68a){return!_[_0x35fc('0x62')]([_0x35fc('0x63'),_0x35fc('0x64'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0xb1c68a);};var _0x5353ea=function(_0x4faef4){if(!_0x4faef4||!_0x4faef4['rules'][_0x35fc('0x3b')]){return'';}for(var _0x44250b='(',_0xd470e8=0x0;_0xd470e8<_0x4faef4[_0x35fc('0x65')]['length'];_0xd470e8+=0x1){_0xd470e8>0x0&&(_0x44250b+='\x20'+_0x4faef4[_0x35fc('0x66')]+'\x20');_0x44250b+=_0x4faef4[_0x35fc('0x65')][_0xd470e8][_0x35fc('0x67')]?_0x5353ea(_0x4faef4[_0x35fc('0x65')][_0xd470e8][_0x35fc('0x67')]):_0x4faef4[_0x35fc('0x65')][_0xd470e8][_0x35fc('0x68')]+'\x20'+_0x4faef4[_0x35fc('0x65')][_0xd470e8][_0x35fc('0x69')]+(_0x23b54f(_0x4faef4['rules'][_0xd470e8][_0x35fc('0x69')])?'\x20'+_0x4faef4['rules'][_0xd470e8][_0x35fc('0x6a')]:'');}return _0x44250b+')';};var _0x9029e3={'where':{'id':_0x2d9d45['params']['id']}},_0x2ac8e1,_0x2bc76c,_0x4bdde7,_0x465c14,_0x4af592;_0x9029e3=_['merge']({},_0x9029e3,_0x2d9d45[_0x35fc('0x43')]);return db['AnalyticDefaultReport'][_0x35fc('0x51')](_0x9029e3)['then'](function(_0x11717){if(_0x11717){_0x2ac8e1=_0x11717;return _0x11717['getFields']();}return null;})[_0x35fc('0x26')](function(_0x455b84){if(_0x455b84){if(!_0x455b84[_0x35fc('0x3b')]){throw new db[(_0x35fc('0x6b'))]['ValidationErrorItem'](_0x35fc('0x6c'),0x193);}_0x2bc76c=_0x455b84;return db[_0x35fc('0x6d')][_0x35fc('0x46')]({'raw':!![]});}return null;})['then'](function(_0x3aa7fa){if(_0x3aa7fa){_0x4bdde7=_[_0x35fc('0x6e')](_0x3aa7fa,'id');var _0x37764b;var _0x3c1b56=squel[_0x35fc('0x6f')]();_0x3c1b56[_0x35fc('0x70')](_0x2ac8e1[_0x35fc('0x71')]);for(var _0x4464d5=0x0;_0x4464d5<_0x2bc76c['length'];_0x4464d5+=0x1){_0x37764b=_0x2bc76c[_0x4464d5][_0x35fc('0x72')]?_0x4bdde7[_0x2bc76c[_0x4464d5][_0x35fc('0x72')]][_0x35fc('0x73')]:_0x2bc76c[_0x4464d5]['field'];_0x37764b=_0x2bc76c[_0x4464d5][_0x35fc('0x74')]?_[_0x35fc('0x75')](_0x164c7b[_0x2bc76c[_0x4464d5]['function']],'%s',_0x37764b):_0x37764b;_0x37764b=_0x2bc76c[_0x4464d5]['format']?_[_0x35fc('0x75')](_0x303927[_0x2bc76c[_0x4464d5]['format']],'%s',_0x37764b):_0x37764b;if(_0x2bc76c[_0x4464d5][_0x35fc('0x76')]){_0x3c1b56[_0x35fc('0x67')](_0x37764b);}_0x2bc76c[_0x4464d5][_0x35fc('0x77')]&&_0x3c1b56[_0x35fc('0x78')](_0x37764b,_0x2bc76c[_0x4464d5][_0x35fc('0x77')]===_0x35fc('0x79')?![]:!![]);_0x3c1b56[_0x35fc('0x68')](_0x37764b,_0x2bc76c[_0x4464d5][_0x35fc('0x7a')]||_0x37764b);}if(_0x2ac8e1[_0x35fc('0x7b')]){_0x2ac8e1[_0x35fc('0x7b')]=JSON[_0x35fc('0x7c')](_0x2ac8e1[_0x35fc('0x7b')]);for(var _0x29f2b9=0x0;_0x29f2b9<_0x2ac8e1[_0x35fc('0x7b')][_0x35fc('0x3b')];_0x29f2b9+=0x1){if(_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x32')]&&_[_0x35fc('0x62')](_0x509e77,_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x32')])&&_0x2ac8e1['joins'][_0x29f2b9][_0x35fc('0x7d')]&&_0x2ac8e1['joins'][_0x29f2b9][_0x35fc('0x7e')]&&_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x7f')]){_0x3c1b56[_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x32')]](_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x7e')],null,util[_0x35fc('0x80')](_0x35fc('0x81'),_0x2ac8e1[_0x35fc('0x71')],_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9]['parentKey'],_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x7e')],_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x7f')]));}}}if(_0x2ac8e1[_0x35fc('0x82')]){_0x2ac8e1[_0x35fc('0x82')]=JSON['parse'](_0x2ac8e1[_0x35fc('0x82')]);_0x3c1b56[_0x35fc('0x3e')](_0x5353ea(_0x2ac8e1[_0x35fc('0x82')][_0x35fc('0x67')]));}_0x4af592=_0x3c1b56[_0x35fc('0x83')]();_0x3c1b56[_0x35fc('0x1d')](_0x39d470);_0x3c1b56[_0x35fc('0x1c')](0x0);logger[_0x35fc('0x84')](_0x35fc('0x85'),_0x3c1b56['toString']());return dbH[_0x35fc('0x86')]['query'](_0x3c1b56[_0x35fc('0x87')](),{'type':dbH[_0x35fc('0x86')]['QueryTypes'][_0x35fc('0x88')]});}})[_0x35fc('0x26')](respondWithResult(_0x757aa6,null))[_0x35fc('0x49')](handleError(_0x757aa6,null));};function runReport(_0x4274d6,_0x4026cc,_0x1a765f){var _0x42f87e=_0x4026cc[_0x35fc('0x2c')];var _0x25ee61=0xa;var _0x5806bf=['join','left_join','right_join',_0x35fc('0x58')];var _0x23cf84={'SUM':_0x35fc('0x59'),'COUNT':_0x35fc('0x5a'),'COUNT DISTINCT':_0x35fc('0x5b'),'MAX':'MAX(%s)','MIN':_0x35fc('0x5d'),'AVG':_0x35fc('0x5e'),'GROUP_CONCAT':_0x35fc('0x89'),'GROUP_CONCAT ASC':_0x35fc('0x5f'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x15e936={'SEC_TO_TIME':_0x35fc('0x8a'),'DATE':_0x35fc('0x61'),'HOUR':'HOUR(%s)','ROUND':_0x35fc('0x8b'),'UNIX_TIMESTAMP':_0x35fc('0x8c')};var _0x319033=function(_0x9fe765){return!_[_0x35fc('0x62')]([_0x35fc('0x63'),_0x35fc('0x64'),_0x35fc('0x8d'),'IS\x20NOT\x20EMPTY'],_0x9fe765);};var _0x2faff7=function(_0xa2c5f8){if(!_0xa2c5f8||!_0xa2c5f8[_0x35fc('0x65')][_0x35fc('0x3b')]){return'';}for(var _0x221c5b='(',_0x1fcd36=0x0;_0x1fcd36<_0xa2c5f8['rules'][_0x35fc('0x3b')];_0x1fcd36+=0x1){_0x1fcd36>0x0&&(_0x221c5b+='\x20'+_0xa2c5f8['operator']+'\x20');_0x221c5b+=_0xa2c5f8['rules'][_0x1fcd36][_0x35fc('0x67')]?_0x2faff7(_0xa2c5f8['rules'][_0x1fcd36][_0x35fc('0x67')]):_0xa2c5f8[_0x35fc('0x65')][_0x1fcd36][_0x35fc('0x68')]+'\x20'+_0xa2c5f8['rules'][_0x1fcd36][_0x35fc('0x69')]+(_0x319033(_0xa2c5f8[_0x35fc('0x65')][_0x1fcd36][_0x35fc('0x69')])?'\x20'+_0xa2c5f8[_0x35fc('0x65')][_0x1fcd36][_0x35fc('0x6a')]:'');}return _0x221c5b+')';};var _0x5abdf9={'where':{'id':_0x4274d6['id']}},_0x5512f6,_0x487cb5,_0x23b261,_0x4c742c,_0x2fae26;_0x5abdf9=_[_0x35fc('0x40')]({},_0x5abdf9,_0x1a765f);return db[_0x35fc('0x2f')][_0x35fc('0x51')](_0x5abdf9)['then'](function(_0x28e80d){if(_0x28e80d){_0x5512f6=_0x28e80d;return _0x28e80d[_0x35fc('0x8e')]();}return null;})[_0x35fc('0x26')](function(_0x47c507){if(_0x47c507){if(!_0x47c507[_0x35fc('0x3b')]){throw new db[(_0x35fc('0x6b'))][(_0x35fc('0x8f'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x487cb5=_0x47c507;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x35fc('0x26')](function(_0x2edb1b){if(_0x2edb1b){_0x23b261=_[_0x35fc('0x6e')](_0x2edb1b,'id');var _0x3858a9;var _0x4859be=squel[_0x35fc('0x6f')]();_0x4859be[_0x35fc('0x70')](_0x5512f6['table']);for(var _0x5849a0=0x0;_0x5849a0<_0x487cb5[_0x35fc('0x3b')];_0x5849a0+=0x1){_0x3858a9=_0x487cb5[_0x5849a0][_0x35fc('0x72')]?_0x23b261[_0x487cb5[_0x5849a0][_0x35fc('0x72')]]['metric']:_0x487cb5[_0x5849a0]['field'];_0x3858a9=_0x487cb5[_0x5849a0][_0x35fc('0x74')]?_[_0x35fc('0x75')](_0x23cf84[_0x487cb5[_0x5849a0]['function']],'%s',_0x3858a9):_0x3858a9;_0x3858a9=_0x487cb5[_0x5849a0][_0x35fc('0x80')]?_[_0x35fc('0x75')](_0x15e936[_0x487cb5[_0x5849a0][_0x35fc('0x80')]],'%s',_0x3858a9):_0x3858a9;if(_0x487cb5[_0x5849a0]['groupBy']){_0x4859be[_0x35fc('0x67')](_0x3858a9);}_0x487cb5[_0x5849a0][_0x35fc('0x77')]&&_0x4859be[_0x35fc('0x78')](_0x3858a9,_0x487cb5[_0x5849a0][_0x35fc('0x77')]==='DESC'?![]:!![]);_0x4859be[_0x35fc('0x68')](_0x3858a9,_0x487cb5[_0x5849a0][_0x35fc('0x7a')]||_0x3858a9);}if(_0x5512f6[_0x35fc('0x7b')]){_0x5512f6['joins']=JSON[_0x35fc('0x7c')](_0x5512f6[_0x35fc('0x7b')]);for(var _0x425f72=0x0;_0x425f72<_0x5512f6['joins'][_0x35fc('0x3b')];_0x425f72+=0x1){if(_0x5512f6[_0x35fc('0x7b')][_0x425f72]['type']&&_[_0x35fc('0x62')](_0x5806bf,_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x32')])&&_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7d')]&&_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7e')]&&_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7f')]){_0x4859be[_0x5512f6['joins'][_0x425f72][_0x35fc('0x32')]](_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7e')],null,util[_0x35fc('0x80')]('%s.%s\x20=\x20%s.%s',_0x5512f6[_0x35fc('0x71')],_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7d')],_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7e')],_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7f')]));}}}if(_0x5512f6[_0x35fc('0x82')]){_0x5512f6['conditions']=JSON['parse'](_0x5512f6[_0x35fc('0x82')]);_0x4859be[_0x35fc('0x3e')](_0x2faff7(_0x5512f6[_0x35fc('0x82')]['group']));}_0x2fae26=_0x4859be[_0x35fc('0x83')]();_0x4859be[_0x35fc('0x1d')](_0x25ee61);_0x4859be[_0x35fc('0x1c')](0x0);return;}})[_0x35fc('0x26')](function(){if(_0x4026cc['output']==='web'){return null;}var _0x379650=_['merge'](_0x4026cc,{'name':_0x4026cc[_0x35fc('0x90')]||_0x4026cc[_0x35fc('0x2c')]||_0x5512f6['name'],'basename':_0x42f87e,'savename':util['format'](_0x35fc('0x91'),_0x4026cc[_0x35fc('0x2c')]||_0x5512f6[_0x35fc('0x2c')],require('randomstring')[_0x35fc('0x92')](0x4),_0x4026cc[_0x35fc('0x93')]||_0x35fc('0x94')),'reportId':_0x5512f6['id'],'reportType':'default'});return db[_0x35fc('0x95')][_0x35fc('0x4a')](_0x379650,{'raw':!![]});})[_0x35fc('0x26')](function(_0x328e90){if(_0x5512f6['table']===_0x35fc('0x96')){_0x2fae26[_0x35fc('0x3e')](_0x5512f6[_0x35fc('0x71')]+_0x35fc('0x97'),_0x4026cc[_0x35fc('0x98')],_0x4026cc[_0x35fc('0x99')]);}else{_0x2fae26['where'](_0x5512f6[_0x35fc('0x71')]+_0x35fc('0x9a'),_0x4026cc['startDate'],_0x4026cc[_0x35fc('0x99')]);}if(_0x328e90){logger[_0x35fc('0x9b')]('Run\x20Query:',_0x2fae26[_0x35fc('0x87')]());require(_0x35fc('0x9c'))[_0x35fc('0x9d')](path[_0x35fc('0x56')](__dirname,_0x35fc('0x9e'),_0x328e90['output']),[_0x328e90['id'],_0x2fae26[_0x35fc('0x87')](),path[_0x35fc('0x56')](__dirname,_0x35fc('0x9f'),_0x328e90['savename']),_0x42f87e]);return _0x328e90;}else{var _0x1224cd=squel['select']();_0x1224cd['from']('('+_0x2fae26[_0x35fc('0x87')]()+')',_0x35fc('0xa0'));_0x1224cd[_0x35fc('0x68')](_0x35fc('0xa1'),_0x35fc('0x1f'));_0x2fae26['limit'](_0x4026cc[_0x35fc('0x1d')]||_0x25ee61);_0x2fae26[_0x35fc('0x1c')](_0x4026cc[_0x35fc('0x1c')]||0x0);return dbH['sequelize'][_0x35fc('0x35')](_0x1224cd[_0x35fc('0x87')](),{'type':dbH[_0x35fc('0x86')][_0x35fc('0xa2')][_0x35fc('0x88')]})['then'](function(_0x1a2d73){if(!_0x1a2d73[_0x35fc('0x3b')]){_0x4c742c=0x0;}else{_0x4c742c=_0x1a2d73[0x0]['count']||0x0;}return dbH['sequelize'][_0x35fc('0x35')](_0x2fae26[_0x35fc('0x87')](),{'type':dbH[_0x35fc('0x86')][_0x35fc('0xa2')][_0x35fc('0x88')]});})[_0x35fc('0x26')](function(_0x8c80ca){return{'rows':_0x8c80ca||[],'count':_0x4c742c};});}});}exports['run']=function(_0x5dc286,_0x146ce1){return runReport(_0x5dc286[_0x35fc('0x48')],_0x5dc286[_0x35fc('0x35')],_0x5dc286[_0x35fc('0x43')])[_0x35fc('0x26')](respondWithResult(_0x146ce1,null))['catch'](handleError(_0x146ce1,null));};exports['runReport']=runReport;exports[_0x35fc('0x35')]=function(_0x2451f2,_0x3fff79){var _0x1c6ce9=0xa;var _0x4b2079=['join',_0x35fc('0x57'),_0x35fc('0xa3'),_0x35fc('0x58')];var _0xd46d64={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x35fc('0x5b'),'MAX':_0x35fc('0x5c'),'MIN':'MIN(%s)','AVG':_0x35fc('0x5e'),'GROUP_CONCAT':_0x35fc('0x89'),'GROUP_CONCAT ASC':_0x35fc('0x5f'),'GROUP_CONCAT DESC':_0x35fc('0x60')};var _0x274337={'SEC_TO_TIME':_0x35fc('0x8a'),'DATE':_0x35fc('0x61'),'HOUR':_0x35fc('0xa4'),'ROUND':_0x35fc('0x8b'),'UNIX_TIMESTAMP':_0x35fc('0x8c')};var _0x19ae76=function(_0x366a3b){return!_[_0x35fc('0x62')]([_0x35fc('0x63'),_0x35fc('0x64'),_0x35fc('0x8d'),'IS\x20NOT\x20EMPTY'],_0x366a3b);};var _0x345026=function(_0x553f7d){if(!_0x553f7d||!_0x553f7d[_0x35fc('0x65')]['length']){return'';}for(var _0x5aa072='(',_0x3c96ef=0x0;_0x3c96ef<_0x553f7d[_0x35fc('0x65')][_0x35fc('0x3b')];_0x3c96ef+=0x1){_0x3c96ef>0x0&&(_0x5aa072+='\x20'+_0x553f7d['operator']+'\x20');_0x5aa072+=_0x553f7d[_0x35fc('0x65')][_0x3c96ef][_0x35fc('0x67')]?_0x345026(_0x553f7d[_0x35fc('0x65')][_0x3c96ef][_0x35fc('0x67')]):_0x553f7d[_0x35fc('0x65')][_0x3c96ef][_0x35fc('0x68')]+'\x20'+_0x553f7d['rules'][_0x3c96ef]['condition']+(_0x19ae76(_0x553f7d[_0x35fc('0x65')][_0x3c96ef]['condition'])?'\x20'+_0x553f7d['rules'][_0x3c96ef][_0x35fc('0x6a')]:'');}return _0x5aa072+')';};var _0x48b826={'where':{'id':_0x2451f2[_0x35fc('0x48')]['id']}},_0x556f9a,_0x5ae83f,_0x450769,_0x5d461c,_0x355154;_0x48b826=_[_0x35fc('0x40')]({},_0x48b826,_0x2451f2[_0x35fc('0x43')]);return db[_0x35fc('0x2f')][_0x35fc('0x51')](_0x48b826)['then'](function(_0x522ff2){if(_0x522ff2){_0x556f9a=_0x522ff2;return _0x522ff2[_0x35fc('0x8e')]();}return null;})['then'](function(_0x233c94){if(_0x233c94){if(!_0x233c94[_0x35fc('0x3b')]){throw new db['Sequelize']['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x5ae83f=_0x233c94;return db[_0x35fc('0x6d')][_0x35fc('0x46')]({'raw':!![]});}return null;})[_0x35fc('0x26')](function(_0x135e18){if(_0x135e18){_0x450769=_[_0x35fc('0x6e')](_0x135e18,'id');var _0x28525f;var _0x9116b1=squel[_0x35fc('0x6f')]();_0x9116b1['from'](_0x556f9a['table']);for(var _0x5cefdb=0x0;_0x5cefdb<_0x5ae83f['length'];_0x5cefdb+=0x1){_0x28525f=_0x5ae83f[_0x5cefdb][_0x35fc('0x72')]?_0x450769[_0x5ae83f[_0x5cefdb]['MetricId']][_0x35fc('0x73')]:_0x5ae83f[_0x5cefdb]['field'];_0x28525f=_0x5ae83f[_0x5cefdb][_0x35fc('0x74')]?_[_0x35fc('0x75')](_0xd46d64[_0x5ae83f[_0x5cefdb]['function']],'%s',_0x28525f):_0x28525f;_0x28525f=_0x5ae83f[_0x5cefdb]['format']?_[_0x35fc('0x75')](_0x274337[_0x5ae83f[_0x5cefdb][_0x35fc('0x80')]],'%s',_0x28525f):_0x28525f;if(_0x5ae83f[_0x5cefdb][_0x35fc('0x76')]){_0x9116b1[_0x35fc('0x67')](_0x28525f);}_0x5ae83f[_0x5cefdb][_0x35fc('0x77')]&&_0x9116b1['order'](_0x28525f,_0x5ae83f[_0x5cefdb]['orderBy']===_0x35fc('0x79')?![]:!![]);_0x9116b1['field'](_0x28525f,_0x5ae83f[_0x5cefdb][_0x35fc('0x7a')]||_0x28525f);}if(_0x556f9a['joins']){_0x556f9a[_0x35fc('0x7b')]=JSON[_0x35fc('0x7c')](_0x556f9a[_0x35fc('0x7b')]);for(var _0x10e30e=0x0;_0x10e30e<_0x556f9a['joins'][_0x35fc('0x3b')];_0x10e30e+=0x1){if(_0x556f9a['joins'][_0x10e30e][_0x35fc('0x32')]&&_['includes'](_0x4b2079,_0x556f9a['joins'][_0x10e30e][_0x35fc('0x32')])&&_0x556f9a['joins'][_0x10e30e][_0x35fc('0x7d')]&&_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7e')]&&_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7f')]){_0x9116b1[_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x32')]](_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7e')],null,util['format'](_0x35fc('0x81'),_0x556f9a[_0x35fc('0x71')],_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7d')],_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7e')],_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7f')]));}}}if(_0x556f9a['conditions']){_0x556f9a['conditions']=JSON['parse'](_0x556f9a['conditions']);_0x9116b1['where'](_0x345026(_0x556f9a[_0x35fc('0x82')][_0x35fc('0x67')]));}_0x355154=_0x9116b1[_0x35fc('0x83')]();_0x9116b1[_0x35fc('0x1d')](_0x1c6ce9);_0x9116b1[_0x35fc('0x1c')](0x0);logger['debug'](_0x35fc('0x85'),_0x9116b1[_0x35fc('0x87')]());return dbH[_0x35fc('0x86')][_0x35fc('0x35')](_0x9116b1[_0x35fc('0x87')](),{'type':dbH['sequelize'][_0x35fc('0xa2')][_0x35fc('0x88')]});}})[_0x35fc('0x26')](function(){return{'sql':_0x355154['toString']()};})[_0x35fc('0x26')](respondWithResult(_0x3fff79,null))[_0x35fc('0x49')](handleError(_0x3fff79,null));}; \ No newline at end of file +var _0xabce=['where','findAll','show','includeAll','options','find','catch','create','body','user','role','Reports','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','table','MetricId','field','function','replace','format','groupBy','orderBy','joins','parse','includes','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','debug','Limited\x20Query:','toString','SELECT','COUNT(DISTINCT\x20%s)','MAX(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','ValidationErrorItem','AnalyticMetric','keyBy','select','metric','DESC','foreignKey','output','web','%s-%s.%s','default','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','from','countTable','COUNT(*)','sequelize','QueryTypes','run','runReport','Sequelize','alias','clone','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','offset','limit','undefined','count','set','json','apply','save','update','then','get','DefaultReports','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','filter','merge'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xabce,0x103));var _0xeabc=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xabce[_0xa1e3e3];return _0xc980e9;};'use strict';var emlformat=require(_0xeabc('0x0'));var rimraf=require(_0xeabc('0x1'));var zipdir=require(_0xeabc('0x2'));var jsonpatch=require(_0xeabc('0x3'));var rp=require(_0xeabc('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeabc('0x5'));var util=require(_0xeabc('0x6'));var path=require(_0xeabc('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeabc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeabc('0x9'));var squel=require('squel');var crypto=require(_0xeabc('0xa'));var jsforce=require(_0xeabc('0xb'));var deskjs=require(_0xeabc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xeabc('0xd'));var Papa=require(_0xeabc('0xe'));var Redis=require(_0xeabc('0xf'));var authService=require(_0xeabc('0x10'));var qs=require(_0xeabc('0x11'));var as=require(_0xeabc('0x12'));var hardwareService=require(_0xeabc('0x13'));var logger=require(_0xeabc('0x14'))(_0xeabc('0x15'));var utils=require(_0xeabc('0x16'));var config=require(_0xeabc('0x17'));var licenseUtil=require(_0xeabc('0x18'));var db=require(_0xeabc('0x19'))['db'];var dbH=require(_0xeabc('0x19'))[_0xeabc('0x1a')];function respondWithStatusCode(_0xcfbf06,_0x53df9c){_0x53df9c=_0x53df9c||0xcc;return function(_0x235c2d){if(_0x235c2d){return _0xcfbf06[_0xeabc('0x1b')](_0x53df9c);}return _0xcfbf06[_0xeabc('0x1c')](_0x53df9c)['end']();};}function respondWithResult(_0x5f4ee8,_0x3170ea){_0x3170ea=_0x3170ea||0xc8;return function(_0x3ae954){if(_0x3ae954){return _0x5f4ee8[_0xeabc('0x1c')](_0x3170ea)['json'](_0x3ae954);}};}function respondWithFilteredResult(_0xf913d7,_0x638976){return function(_0x49f2d8){if(_0x49f2d8){var _0x53fe28=typeof _0x638976[_0xeabc('0x1d')]==='undefined'&&typeof _0x638976[_0xeabc('0x1e')]===_0xeabc('0x1f');var _0x58a3c0=_0x49f2d8[_0xeabc('0x20')];var _0x31dd53=_0x53fe28?0x0:_0x638976[_0xeabc('0x1d')];var _0x384be5=_0x53fe28?_0x49f2d8[_0xeabc('0x20')]:_0x638976['offset']+_0x638976[_0xeabc('0x1e')];var _0x4d68ea;if(_0x384be5>=_0x58a3c0){_0x384be5=_0x58a3c0;_0x4d68ea=0xc8;}else{_0x4d68ea=0xce;}_0xf913d7[_0xeabc('0x1c')](_0x4d68ea);return _0xf913d7[_0xeabc('0x21')]('Content-Range',_0x31dd53+'-'+_0x384be5+'/'+_0x58a3c0)[_0xeabc('0x22')](_0x49f2d8);}return null;};}function patchUpdates(_0x41d67a){return function(_0x254590){try{jsonpatch[_0xeabc('0x23')](_0x254590,_0x41d67a,!![]);}catch(_0x3c9611){return BPromise['reject'](_0x3c9611);}return _0x254590[_0xeabc('0x24')]();};}function saveUpdates(_0x10c675,_0x91ab00){return function(_0x5bdd57){if(_0x5bdd57){return _0x5bdd57[_0xeabc('0x25')](_0x10c675)[_0xeabc('0x26')](function(_0x214953){return _0x214953;});}return null;};}function removeEntity(_0x319119,_0x5b8838){return function(_0x109e1d){if(_0x109e1d){return _0x109e1d['destroy']()[_0xeabc('0x26')](function(){var _0x4d4e29=_0x109e1d[_0xeabc('0x27')]({'plain':!![]});var _0x12acbd=_0xeabc('0x28');return db[_0xeabc('0x29')][_0xeabc('0x2a')]({'where':{'type':_0x12acbd,'resourceId':_0x4d4e29['id']}})[_0xeabc('0x26')](function(){return _0x109e1d;});})[_0xeabc('0x26')](function(){_0x319119['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x459c8a,_0x5bf8f2){return function(_0x3c1b5b){if(!_0x3c1b5b){_0x459c8a[_0xeabc('0x1b')](0x194);}return _0x3c1b5b;};}function handleError(_0x48fb52,_0x2163e6){_0x2163e6=_0x2163e6||0x1f4;return function(_0x38572d){logger[_0xeabc('0x2b')](_0x38572d[_0xeabc('0x2c')]);if(_0x38572d[_0xeabc('0x2d')]){delete _0x38572d[_0xeabc('0x2d')];}_0x48fb52[_0xeabc('0x1c')](_0x2163e6)[_0xeabc('0x2e')](_0x38572d);};}exports[_0xeabc('0x2f')]=function(_0x5ebb86,_0x5b34dd){var _0x5bb1f1={},_0x2f03e8={},_0x2d027e={'count':0x0,'rows':[]};var _0x98b445=_[_0xeabc('0x30')](db[_0xeabc('0x31')][_0xeabc('0x32')],function(_0x61c0af){return{'name':_0x61c0af['fieldName'],'type':_0x61c0af[_0xeabc('0x33')][_0xeabc('0x34')]};});_0x2f03e8[_0xeabc('0x35')]=_['map'](_0x98b445,_0xeabc('0x2d'));_0x2f03e8[_0xeabc('0x36')]=_[_0xeabc('0x37')](_0x5ebb86['query']);_0x2f03e8[_0xeabc('0x38')]=_[_0xeabc('0x39')](_0x2f03e8[_0xeabc('0x35')],_0x2f03e8['query']);_0x5bb1f1[_0xeabc('0x3a')]=_[_0xeabc('0x39')](_0x2f03e8['model'],qs['fields'](_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x3b')]));_0x5bb1f1['attributes']=_0x5bb1f1[_0xeabc('0x3a')][_0xeabc('0x3c')]?_0x5bb1f1[_0xeabc('0x3a')]:_0x2f03e8[_0xeabc('0x35')];if(!_0x5ebb86[_0xeabc('0x36')]['hasOwnProperty'](_0xeabc('0x3d'))){_0x5bb1f1['limit']=qs[_0xeabc('0x1e')](_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x1e')]);_0x5bb1f1['offset']=qs['offset'](_0x5ebb86[_0xeabc('0x36')]['offset']);}_0x5bb1f1[_0xeabc('0x3e')]=qs['sort'](_0x5ebb86['query']['sort']);_0x5bb1f1['where']=qs[_0xeabc('0x38')](_['pick'](_0x5ebb86[_0xeabc('0x36')],_0x2f03e8[_0xeabc('0x38')]),_0x98b445);if(_0x5ebb86['query'][_0xeabc('0x3f')]){_0x5bb1f1['where']=_[_0xeabc('0x40')](_0x5bb1f1['where'],{'$or':_[_0xeabc('0x30')](_0x98b445,function(_0xf1b7ef){if(_0xf1b7ef[_0xeabc('0x33')]!=='VIRTUAL'){var _0x5a00d0={};_0x5a00d0[_0xf1b7ef['name']]={'$like':'%'+_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x3f')]+'%'};return _0x5a00d0;}})});}_0x5bb1f1=_[_0xeabc('0x40')]({},_0x5bb1f1,_0x5ebb86['options']);var _0x4f1897={'where':_0x5bb1f1[_0xeabc('0x41')]};return db[_0xeabc('0x31')]['count'](_0x4f1897)[_0xeabc('0x26')](function(_0x5e0b78){_0x2d027e[_0xeabc('0x20')]=_0x5e0b78;if(_0x5ebb86['query']['includeAll']){_0x5bb1f1['include']=[{'all':!![]}];}return db[_0xeabc('0x31')][_0xeabc('0x42')](_0x5bb1f1);})[_0xeabc('0x26')](function(_0x3eeeb5){_0x2d027e['rows']=_0x3eeeb5;return _0x2d027e;})[_0xeabc('0x26')](respondWithFilteredResult(_0x5b34dd,_0x5bb1f1))['catch'](handleError(_0x5b34dd,null));};exports[_0xeabc('0x43')]=function(_0x1a4bbe,_0x3a7807){var _0x17a0df={'raw':!![],'where':{'id':_0x1a4bbe['params']['id']}},_0xc849c9={};_0xc849c9['model']=_[_0xeabc('0x37')](db['AnalyticDefaultReport'][_0xeabc('0x32')]);_0xc849c9[_0xeabc('0x36')]=_['keys'](_0x1a4bbe[_0xeabc('0x36')]);_0xc849c9[_0xeabc('0x38')]=_[_0xeabc('0x39')](_0xc849c9[_0xeabc('0x35')],_0xc849c9[_0xeabc('0x36')]);_0x17a0df[_0xeabc('0x3a')]=_[_0xeabc('0x39')](_0xc849c9['model'],qs[_0xeabc('0x3b')](_0x1a4bbe[_0xeabc('0x36')][_0xeabc('0x3b')]));_0x17a0df[_0xeabc('0x3a')]=_0x17a0df[_0xeabc('0x3a')][_0xeabc('0x3c')]?_0x17a0df[_0xeabc('0x3a')]:_0xc849c9[_0xeabc('0x35')];if(_0x1a4bbe[_0xeabc('0x36')][_0xeabc('0x44')]){_0x17a0df['include']=[{'all':!![]}];}_0x17a0df=_[_0xeabc('0x40')]({},_0x17a0df,_0x1a4bbe[_0xeabc('0x45')]);return db[_0xeabc('0x31')][_0xeabc('0x46')](_0x17a0df)[_0xeabc('0x26')](handleEntityNotFound(_0x3a7807,null))[_0xeabc('0x26')](respondWithResult(_0x3a7807,null))[_0xeabc('0x47')](handleError(_0x3a7807,null));};exports['create']=function(_0x766743,_0x32e09b){return db[_0xeabc('0x31')][_0xeabc('0x48')](_0x766743[_0xeabc('0x49')],{})['then'](function(_0x305946){var _0x2b2b9c=_0x766743[_0xeabc('0x4a')][_0xeabc('0x27')]({'plain':!![]});if(!_0x2b2b9c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2b2b9c[_0xeabc('0x4b')]===_0xeabc('0x4a')){var _0x568847=_0x305946[_0xeabc('0x27')]({'plain':!![]});var _0x5a0d4d=_0xeabc('0x4c');return db['UserProfileSection'][_0xeabc('0x46')]({'where':{'name':_0x5a0d4d,'userProfileId':_0x2b2b9c[_0xeabc('0x4d')]},'raw':!![]})[_0xeabc('0x26')](function(_0x1524c3){if(_0x1524c3&&_0x1524c3[_0xeabc('0x4e')]===0x0){return db[_0xeabc('0x29')][_0xeabc('0x48')]({'name':_0x568847[_0xeabc('0x2d')],'resourceId':_0x568847['id'],'type':_0xeabc('0x28'),'sectionId':_0x1524c3['id']},{})[_0xeabc('0x26')](function(){return _0x305946;});}else{return _0x305946;}})['catch'](function(_0x180a14){logger[_0xeabc('0x2b')](_0xeabc('0x4f'),_0x180a14);throw _0x180a14;});}return _0x305946;})[_0xeabc('0x26')](respondWithResult(_0x32e09b,0xc9))['catch'](handleError(_0x32e09b,null));};exports[_0xeabc('0x25')]=function(_0x392913,_0x10d56f){if(_0x392913[_0xeabc('0x49')]['id']){delete _0x392913['body']['id'];}return db[_0xeabc('0x31')][_0xeabc('0x46')]({'where':{'id':_0x392913[_0xeabc('0x50')]['id']}})[_0xeabc('0x26')](handleEntityNotFound(_0x10d56f,null))[_0xeabc('0x26')](saveUpdates(_0x392913[_0xeabc('0x49')],null))[_0xeabc('0x26')](respondWithResult(_0x10d56f,null))[_0xeabc('0x47')](handleError(_0x10d56f,null));};exports[_0xeabc('0x2a')]=function(_0x58ab08,_0x4546c4){return db['AnalyticDefaultReport']['find']({'where':{'id':_0x58ab08['params']['id']}})[_0xeabc('0x26')](handleEntityNotFound(_0x4546c4,null))[_0xeabc('0x26')](removeEntity(_0x4546c4,null))[_0xeabc('0x47')](handleError(_0x4546c4,null));};exports[_0xeabc('0x51')]=function(_0xe89728,_0x2f78f3){var _0x4a2ad6=0xa;var _0x4358d7=[_0xeabc('0x52'),_0xeabc('0x53'),_0xeabc('0x54'),_0xeabc('0x55')];var _0x2c7b4e={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xeabc('0x58'),'AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x536f42={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':_0xeabc('0x5e'),'UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x26c784=function(_0xc2ef0c){return!_['includes']([_0xeabc('0x60'),_0xeabc('0x61'),_0xeabc('0x62'),_0xeabc('0x63')],_0xc2ef0c);};var _0x11cc1f=function(_0x514787){if(!_0x514787||!_0x514787['rules'][_0xeabc('0x3c')]){return'';}for(var _0x7b659f='(',_0x1b6675=0x0;_0x1b6675<_0x514787[_0xeabc('0x64')][_0xeabc('0x3c')];_0x1b6675+=0x1){_0x1b6675>0x0&&(_0x7b659f+='\x20'+_0x514787[_0xeabc('0x65')]+'\x20');_0x7b659f+=_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x66')]?_0x11cc1f(_0x514787[_0xeabc('0x64')][_0x1b6675]['group']):_0x514787[_0xeabc('0x64')][_0x1b6675]['field']+'\x20'+_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x67')]+(_0x26c784(_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x67')])?'\x20'+_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x68')]:'');}return _0x7b659f+')';};var _0xf48062={'where':{'id':_0xe89728[_0xeabc('0x50')]['id']}},_0xb59a2a,_0x5d4bc2,_0x24d0e5,_0x5702cb,_0x3fa31b;_0xf48062=_[_0xeabc('0x40')]({},_0xf48062,_0xe89728[_0xeabc('0x45')]);return db['AnalyticDefaultReport'][_0xeabc('0x46')](_0xf48062)['then'](function(_0x54e7d6){if(_0x54e7d6){_0xb59a2a=_0x54e7d6;return _0x54e7d6[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x23270a){if(_0x23270a){if(!_0x23270a[_0xeabc('0x3c')]){throw new db['Sequelize']['ValidationErrorItem'](_0xeabc('0x6a'),0x193);}_0x5d4bc2=_0x23270a;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xeabc('0x26')](function(_0x4f1a4f){if(_0x4f1a4f){_0x24d0e5=_['keyBy'](_0x4f1a4f,'id');var _0xa44f2d;var _0x1c84b5=squel['select']();_0x1c84b5['from'](_0xb59a2a[_0xeabc('0x6b')]);for(var _0x5d183a=0x0;_0x5d183a<_0x5d4bc2[_0xeabc('0x3c')];_0x5d183a+=0x1){_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x6c')]?_0x24d0e5[_0x5d4bc2[_0x5d183a]['MetricId']]['metric']:_0x5d4bc2[_0x5d183a][_0xeabc('0x6d')];_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x6e')]?_[_0xeabc('0x6f')](_0x2c7b4e[_0x5d4bc2[_0x5d183a][_0xeabc('0x6e')]],'%s',_0xa44f2d):_0xa44f2d;_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x70')]?_['replace'](_0x536f42[_0x5d4bc2[_0x5d183a]['format']],'%s',_0xa44f2d):_0xa44f2d;if(_0x5d4bc2[_0x5d183a][_0xeabc('0x71')]){_0x1c84b5['group'](_0xa44f2d);}_0x5d4bc2[_0x5d183a][_0xeabc('0x72')]&&_0x1c84b5['order'](_0xa44f2d,_0x5d4bc2[_0x5d183a][_0xeabc('0x72')]==='DESC'?![]:!![]);_0x1c84b5[_0xeabc('0x6d')](_0xa44f2d,_0x5d4bc2[_0x5d183a]['alias']||_0xa44f2d);}if(_0xb59a2a[_0xeabc('0x73')]){_0xb59a2a[_0xeabc('0x73')]=JSON[_0xeabc('0x74')](_0xb59a2a[_0xeabc('0x73')]);for(var _0x5e121c=0x0;_0x5e121c<_0xb59a2a[_0xeabc('0x73')]['length'];_0x5e121c+=0x1){if(_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')]&&_[_0xeabc('0x75')](_0x4358d7,_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')])&&_0xb59a2a['joins'][_0x5e121c][_0xeabc('0x76')]&&_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x77')]&&_0xb59a2a[_0xeabc('0x73')][_0x5e121c]['foreignKey']){_0x1c84b5[_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')]](_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x77')],null,util['format'](_0xeabc('0x78'),_0xb59a2a[_0xeabc('0x6b')],_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x76')],_0xb59a2a['joins'][_0x5e121c]['foreignTable'],_0xb59a2a[_0xeabc('0x73')][_0x5e121c]['foreignKey']));}}}if(_0xb59a2a['conditions']){_0xb59a2a[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0xb59a2a[_0xeabc('0x79')]);_0x1c84b5['where'](_0x11cc1f(_0xb59a2a[_0xeabc('0x79')][_0xeabc('0x66')]));}_0x3fa31b=_0x1c84b5['clone']();_0x1c84b5[_0xeabc('0x1e')](_0x4a2ad6);_0x1c84b5[_0xeabc('0x1d')](0x0);logger[_0xeabc('0x7a')](_0xeabc('0x7b'),_0x1c84b5[_0xeabc('0x7c')]());return dbH['sequelize'][_0xeabc('0x36')](_0x1c84b5['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0xeabc('0x7d')]});}})[_0xeabc('0x26')](respondWithResult(_0x2f78f3,null))[_0xeabc('0x47')](handleError(_0x2f78f3,null));};function runReport(_0x4424ce,_0x33fa74,_0x51368f){var _0x39f961=_0x33fa74['name'];var _0x1795fe=0xa;var _0x2f95c7=['join',_0xeabc('0x53'),'right_join','cross_join'];var _0x952dc7={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':_0xeabc('0x7e'),'MAX':_0xeabc('0x7f'),'MIN':'MIN(%s)','AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':_0xeabc('0x80'),'GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x348064={'SEC_TO_TIME':_0xeabc('0x81'),'DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':_0xeabc('0x5e'),'UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x522c6e=function(_0x436f8e){return!_[_0xeabc('0x75')]([_0xeabc('0x60'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0xeabc('0x63')],_0x436f8e);};var _0x273ca5=function(_0xe90200){if(!_0xe90200||!_0xe90200[_0xeabc('0x64')][_0xeabc('0x3c')]){return'';}for(var _0x5f5a47='(',_0x289f98=0x0;_0x289f98<_0xe90200['rules']['length'];_0x289f98+=0x1){_0x289f98>0x0&&(_0x5f5a47+='\x20'+_0xe90200[_0xeabc('0x65')]+'\x20');_0x5f5a47+=_0xe90200[_0xeabc('0x64')][_0x289f98]['group']?_0x273ca5(_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x66')]):_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x6d')]+'\x20'+_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x67')]+(_0x522c6e(_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x67')])?'\x20'+_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x68')]:'');}return _0x5f5a47+')';};var _0x1f8197={'where':{'id':_0x4424ce['id']}},_0x485c13,_0xb54c35,_0x5c9d6f,_0x1caaa7,_0x3e764a;_0x1f8197=_[_0xeabc('0x40')]({},_0x1f8197,_0x51368f);return db[_0xeabc('0x31')][_0xeabc('0x46')](_0x1f8197)[_0xeabc('0x26')](function(_0x40f51e){if(_0x40f51e){_0x485c13=_0x40f51e;return _0x40f51e[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x156e20){if(_0x156e20){if(!_0x156e20[_0xeabc('0x3c')]){throw new db['Sequelize'][(_0xeabc('0x82'))](_0xeabc('0x6a'),0x193);}_0xb54c35=_0x156e20;return db[_0xeabc('0x83')][_0xeabc('0x42')]({'raw':!![]});}return null;})['then'](function(_0x26c595){if(_0x26c595){_0x5c9d6f=_[_0xeabc('0x84')](_0x26c595,'id');var _0x580661;var _0x3de927=squel[_0xeabc('0x85')]();_0x3de927['from'](_0x485c13['table']);for(var _0x489b1d=0x0;_0x489b1d<_0xb54c35['length'];_0x489b1d+=0x1){_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x6c')]?_0x5c9d6f[_0xb54c35[_0x489b1d][_0xeabc('0x6c')]][_0xeabc('0x86')]:_0xb54c35[_0x489b1d][_0xeabc('0x6d')];_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x6e')]?_[_0xeabc('0x6f')](_0x952dc7[_0xb54c35[_0x489b1d][_0xeabc('0x6e')]],'%s',_0x580661):_0x580661;_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x70')]?_[_0xeabc('0x6f')](_0x348064[_0xb54c35[_0x489b1d][_0xeabc('0x70')]],'%s',_0x580661):_0x580661;if(_0xb54c35[_0x489b1d]['groupBy']){_0x3de927[_0xeabc('0x66')](_0x580661);}_0xb54c35[_0x489b1d][_0xeabc('0x72')]&&_0x3de927['order'](_0x580661,_0xb54c35[_0x489b1d][_0xeabc('0x72')]===_0xeabc('0x87')?![]:!![]);_0x3de927[_0xeabc('0x6d')](_0x580661,_0xb54c35[_0x489b1d]['alias']||_0x580661);}if(_0x485c13[_0xeabc('0x73')]){_0x485c13['joins']=JSON[_0xeabc('0x74')](_0x485c13[_0xeabc('0x73')]);for(var _0x1841f0=0x0;_0x1841f0<_0x485c13[_0xeabc('0x73')][_0xeabc('0x3c')];_0x1841f0+=0x1){if(_0x485c13['joins'][_0x1841f0]['type']&&_['includes'](_0x2f95c7,_0x485c13['joins'][_0x1841f0][_0xeabc('0x33')])&&_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x76')]&&_0x485c13['joins'][_0x1841f0][_0xeabc('0x77')]&&_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x88')]){_0x3de927[_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x33')]](_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x77')],null,util[_0xeabc('0x70')](_0xeabc('0x78'),_0x485c13[_0xeabc('0x6b')],_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x76')],_0x485c13['joins'][_0x1841f0]['foreignTable'],_0x485c13[_0xeabc('0x73')][_0x1841f0]['foreignKey']));}}}if(_0x485c13[_0xeabc('0x79')]){_0x485c13[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0x485c13['conditions']);_0x3de927[_0xeabc('0x41')](_0x273ca5(_0x485c13[_0xeabc('0x79')][_0xeabc('0x66')]));}_0x3e764a=_0x3de927['clone']();_0x3de927['limit'](_0x1795fe);_0x3de927[_0xeabc('0x1d')](0x0);return;}})[_0xeabc('0x26')](function(){if(_0x33fa74[_0xeabc('0x89')]===_0xeabc('0x8a')){return null;}var _0x2cc9b3=_[_0xeabc('0x40')](_0x33fa74,{'name':_0x33fa74['fullPath']||_0x33fa74['name']||_0x485c13[_0xeabc('0x2d')],'basename':_0x39f961,'savename':util[_0xeabc('0x70')](_0xeabc('0x8b'),_0x33fa74[_0xeabc('0x2d')]||_0x485c13['name'],require('randomstring')['generate'](0x4),_0x33fa74[_0xeabc('0x89')]||'csv'),'reportId':_0x485c13['id'],'reportType':_0xeabc('0x8c')});return db['AnalyticExtractedReport'][_0xeabc('0x48')](_0x2cc9b3,{'raw':!![]});})['then'](function(_0x6e6ab2){if(_0x485c13[_0xeabc('0x6b')]===_0xeabc('0x8d')){_0x3e764a[_0xeabc('0x41')](_0x485c13[_0xeabc('0x6b')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x33fa74[_0xeabc('0x8e')],_0x33fa74[_0xeabc('0x8f')]);}else{_0x3e764a[_0xeabc('0x41')](_0x485c13['table']+_0xeabc('0x90'),_0x33fa74[_0xeabc('0x8e')],_0x33fa74[_0xeabc('0x8f')]);}if(_0x6e6ab2){logger[_0xeabc('0x91')](_0xeabc('0x92'),_0x3e764a['toString']());require(_0xeabc('0x93'))[_0xeabc('0x94')](path['join'](__dirname,_0xeabc('0x95'),_0x6e6ab2[_0xeabc('0x89')]),[_0x6e6ab2['id'],_0x3e764a['toString'](),path[_0xeabc('0x52')](__dirname,_0xeabc('0x96'),_0x6e6ab2[_0xeabc('0x97')]),_0x39f961]);return _0x6e6ab2;}else{var _0x307d26=squel[_0xeabc('0x85')]();_0x307d26[_0xeabc('0x98')]('('+_0x3e764a[_0xeabc('0x7c')]()+')',_0xeabc('0x99'));_0x307d26[_0xeabc('0x6d')](_0xeabc('0x9a'),_0xeabc('0x20'));_0x3e764a[_0xeabc('0x1e')](_0x33fa74[_0xeabc('0x1e')]||_0x1795fe);_0x3e764a['offset'](_0x33fa74['offset']||0x0);return dbH[_0xeabc('0x9b')][_0xeabc('0x36')](_0x307d26[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')]['QueryTypes'][_0xeabc('0x7d')]})['then'](function(_0x49fba2){if(!_0x49fba2['length']){_0x1caaa7=0x0;}else{_0x1caaa7=_0x49fba2[0x0]['count']||0x0;}return dbH['sequelize']['query'](_0x3e764a[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')][_0xeabc('0x9c')][_0xeabc('0x7d')]});})[_0xeabc('0x26')](function(_0xe27492){return{'rows':_0xe27492||[],'count':_0x1caaa7};});}});}exports[_0xeabc('0x9d')]=function(_0x3eaedf,_0x44dc85){return runReport(_0x3eaedf['params'],_0x3eaedf[_0xeabc('0x36')],_0x3eaedf[_0xeabc('0x45')])[_0xeabc('0x26')](respondWithResult(_0x44dc85,null))[_0xeabc('0x47')](handleError(_0x44dc85,null));};exports[_0xeabc('0x9e')]=runReport;exports[_0xeabc('0x36')]=function(_0x2a29d7,_0x5bb5d6){var _0x3513ce=0xa;var _0x58cb5d=[_0xeabc('0x52'),_0xeabc('0x53'),'right_join',_0xeabc('0x55')];var _0x4c8bf3={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':_0xeabc('0x7e'),'MAX':_0xeabc('0x7f'),'MIN':_0xeabc('0x58'),'AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':_0xeabc('0x80'),'GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x484c75={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x580f72=function(_0x37907a){return!_[_0xeabc('0x75')]([_0xeabc('0x60'),_0xeabc('0x61'),_0xeabc('0x62'),_0xeabc('0x63')],_0x37907a);};var _0x57db6d=function(_0x13cc55){if(!_0x13cc55||!_0x13cc55['rules'][_0xeabc('0x3c')]){return'';}for(var _0x43b88e='(',_0x1fa464=0x0;_0x1fa464<_0x13cc55[_0xeabc('0x64')]['length'];_0x1fa464+=0x1){_0x1fa464>0x0&&(_0x43b88e+='\x20'+_0x13cc55[_0xeabc('0x65')]+'\x20');_0x43b88e+=_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x66')]?_0x57db6d(_0x13cc55['rules'][_0x1fa464][_0xeabc('0x66')]):_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x6d')]+'\x20'+_0x13cc55['rules'][_0x1fa464]['condition']+(_0x580f72(_0x13cc55['rules'][_0x1fa464]['condition'])?'\x20'+_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x68')]:'');}return _0x43b88e+')';};var _0x52e84f={'where':{'id':_0x2a29d7[_0xeabc('0x50')]['id']}},_0x12f024,_0x1d35da,_0x2695a4,_0x199251,_0x1899d6;_0x52e84f=_[_0xeabc('0x40')]({},_0x52e84f,_0x2a29d7[_0xeabc('0x45')]);return db[_0xeabc('0x31')]['find'](_0x52e84f)[_0xeabc('0x26')](function(_0x5bb015){if(_0x5bb015){_0x12f024=_0x5bb015;return _0x5bb015[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x438ce3){if(_0x438ce3){if(!_0x438ce3[_0xeabc('0x3c')]){throw new db[(_0xeabc('0x9f'))][(_0xeabc('0x82'))](_0xeabc('0x6a'),0x193);}_0x1d35da=_0x438ce3;return db['AnalyticMetric'][_0xeabc('0x42')]({'raw':!![]});}return null;})['then'](function(_0x475160){if(_0x475160){_0x2695a4=_['keyBy'](_0x475160,'id');var _0x10d66b;var _0x12a042=squel[_0xeabc('0x85')]();_0x12a042[_0xeabc('0x98')](_0x12f024[_0xeabc('0x6b')]);for(var _0x49bf0f=0x0;_0x49bf0f<_0x1d35da[_0xeabc('0x3c')];_0x49bf0f+=0x1){_0x10d66b=_0x1d35da[_0x49bf0f][_0xeabc('0x6c')]?_0x2695a4[_0x1d35da[_0x49bf0f][_0xeabc('0x6c')]][_0xeabc('0x86')]:_0x1d35da[_0x49bf0f][_0xeabc('0x6d')];_0x10d66b=_0x1d35da[_0x49bf0f]['function']?_[_0xeabc('0x6f')](_0x4c8bf3[_0x1d35da[_0x49bf0f][_0xeabc('0x6e')]],'%s',_0x10d66b):_0x10d66b;_0x10d66b=_0x1d35da[_0x49bf0f][_0xeabc('0x70')]?_[_0xeabc('0x6f')](_0x484c75[_0x1d35da[_0x49bf0f][_0xeabc('0x70')]],'%s',_0x10d66b):_0x10d66b;if(_0x1d35da[_0x49bf0f]['groupBy']){_0x12a042[_0xeabc('0x66')](_0x10d66b);}_0x1d35da[_0x49bf0f]['orderBy']&&_0x12a042[_0xeabc('0x3e')](_0x10d66b,_0x1d35da[_0x49bf0f][_0xeabc('0x72')]===_0xeabc('0x87')?![]:!![]);_0x12a042[_0xeabc('0x6d')](_0x10d66b,_0x1d35da[_0x49bf0f][_0xeabc('0xa0')]||_0x10d66b);}if(_0x12f024[_0xeabc('0x73')]){_0x12f024[_0xeabc('0x73')]=JSON[_0xeabc('0x74')](_0x12f024[_0xeabc('0x73')]);for(var _0x223a3=0x0;_0x223a3<_0x12f024['joins'][_0xeabc('0x3c')];_0x223a3+=0x1){if(_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x33')]&&_[_0xeabc('0x75')](_0x58cb5d,_0x12f024['joins'][_0x223a3][_0xeabc('0x33')])&&_0x12f024['joins'][_0x223a3]['parentKey']&&_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x77')]&&_0x12f024[_0xeabc('0x73')][_0x223a3]['foreignKey']){_0x12a042[_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x33')]](_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x77')],null,util[_0xeabc('0x70')]('%s.%s\x20=\x20%s.%s',_0x12f024[_0xeabc('0x6b')],_0x12f024[_0xeabc('0x73')][_0x223a3]['parentKey'],_0x12f024['joins'][_0x223a3][_0xeabc('0x77')],_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x88')]));}}}if(_0x12f024[_0xeabc('0x79')]){_0x12f024[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0x12f024[_0xeabc('0x79')]);_0x12a042[_0xeabc('0x41')](_0x57db6d(_0x12f024[_0xeabc('0x79')]['group']));}_0x1899d6=_0x12a042[_0xeabc('0xa1')]();_0x12a042['limit'](_0x3513ce);_0x12a042[_0xeabc('0x1d')](0x0);logger['debug'](_0xeabc('0x7b'),_0x12a042[_0xeabc('0x7c')]());return dbH[_0xeabc('0x9b')][_0xeabc('0x36')](_0x12a042[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')][_0xeabc('0x9c')][_0xeabc('0x7d')]});}})[_0xeabc('0x26')](function(){return{'sql':_0x1899d6[_0xeabc('0x7c')]()};})['then'](respondWithResult(_0x5bb5d6,null))['catch'](handleError(_0x5bb5d6,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 3e82796..13120b7 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 _0xbf7e=['./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x31c730,_0x1cb757){var _0x2acdaa=function(_0x42c783){while(--_0x42c783){_0x31c730['push'](_0x31c730['shift']());}};_0x2acdaa(++_0x1cb757);}(_0xbf7e,0x109));var _0xebf7=function(_0x48ea0,_0x38b4a9){_0x48ea0=_0x48ea0-0x0;var _0x56894c=_0xbf7e[_0x48ea0];return _0x56894c;};'use strict';var _=require('lodash');var util=require(_0xebf7('0x0'));var logger=require(_0xebf7('0x1'))(_0xebf7('0x2'));var moment=require(_0xebf7('0x3'));var BPromise=require('bluebird');var rp=require(_0xebf7('0x4'));var fs=require('fs');var path=require(_0xebf7('0x5'));var rimraf=require(_0xebf7('0x6'));var config=require(_0xebf7('0x7'));var attributes=require(_0xebf7('0x8'));module[_0xebf7('0x9')]=function(_0x2e0177,_0x4d3611){return _0x2e0177[_0xebf7('0xa')](_0xebf7('0xb'),attributes,{'tableName':_0xebf7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2158=['lodash','util','../../config/logger','moment','bluebird','path','rimraf','./analyticDefaultReport.attributes','exports','AnalyticDefaultReport'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x2158,0xe6));var _0x8215=function(_0x7ce298,_0x12fe35){_0x7ce298=_0x7ce298-0x0;var _0xd6b83a=_0x2158[_0x7ce298];return _0xd6b83a;};'use strict';var _=require(_0x8215('0x0'));var util=require(_0x8215('0x1'));var logger=require(_0x8215('0x2'))('api');var moment=require(_0x8215('0x3'));var BPromise=require(_0x8215('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8215('0x5'));var rimraf=require(_0x8215('0x6'));var config=require('../../config/environment');var attributes=require(_0x8215('0x7'));module[_0x8215('0x8')]=function(_0x5ad126,_0x3f0911){return _0x5ad126['define'](_0x8215('0x9'),attributes,{'tableName':'analytics_default_reports','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 c176fbd..0920d1c 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 _0x538a=['client','http','request','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x31d506,_0x3faa83){var _0x5561af=function(_0x439c83){while(--_0x439c83){_0x31d506['push'](_0x31d506['shift']());}};_0x5561af(++_0x3faa83);}(_0x538a,0x108));var _0xa538=function(_0x4f754f,_0x70cce4){_0x4f754f=_0x4f754f-0x0;var _0xef660d=_0x538a[_0x4f754f];return _0xef660d;};'use strict';var _=require(_0xa538('0x0'));var util=require(_0xa538('0x1'));var moment=require(_0xa538('0x2'));var BPromise=require(_0xa538('0x3'));var rs=require(_0xa538('0x4'));var fs=require('fs');var Redis=require(_0xa538('0x5'));var db=require(_0xa538('0x6'))['db'];var utils=require(_0xa538('0x7'));var logger=require('../../config/logger')(_0xa538('0x8'));var config=require(_0xa538('0x9'));var jayson=require(_0xa538('0xa'));var client=jayson[_0xa538('0xb')][_0xa538('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x412739,_0x583e75,_0x1b1751){return new BPromise(function(_0x3990c7,_0x4bb87f){return client[_0xa538('0xd')](_0x412739,_0x1b1751)['then'](function(_0x5b2de0){logger[_0xa538('0xe')](_0xa538('0xf'),_0x583e75,_0xa538('0x10'));logger[_0xa538('0x11')](_0xa538('0x12'),_0x583e75,_0xa538('0x10'),JSON[_0xa538('0x13')](_0x5b2de0));if(_0x5b2de0[_0xa538('0x14')]){if(_0x5b2de0[_0xa538('0x14')][_0xa538('0x15')]===0x1f4){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x583e75,_0x5b2de0[_0xa538('0x14')]['message']);return _0x4bb87f(_0x5b2de0[_0xa538('0x14')][_0xa538('0x16')]);}logger[_0xa538('0x14')](_0xa538('0xf'),_0x583e75,_0x5b2de0[_0xa538('0x14')]['message']);return _0x3990c7(_0x5b2de0['error'][_0xa538('0x16')]);}else{logger['info'](_0xa538('0xf'),_0x583e75,'request\x20sent');_0x3990c7(_0x5b2de0[_0xa538('0x17')][_0xa538('0x16')]);}})[_0xa538('0x18')](function(_0x217b5c){logger[_0xa538('0x14')](_0xa538('0xf'),_0x583e75,_0x217b5c);_0x4bb87f(_0x217b5c);});});} \ No newline at end of file +var _0xd9e3=['client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x15d4f8,_0x4b746b){var _0x4a8d92=function(_0x323e61){while(--_0x323e61){_0x15d4f8['push'](_0x15d4f8['shift']());}};_0x4a8d92(++_0x4b746b);}(_0xd9e3,0xe0));var _0x3d9e=function(_0x149b28,_0x13990c){_0x149b28=_0x149b28-0x0;var _0x2864da=_0xd9e3[_0x149b28];return _0x2864da;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x3d9e('0x0'));var rs=require(_0x3d9e('0x1'));var fs=require('fs');var Redis=require(_0x3d9e('0x2'));var db=require(_0x3d9e('0x3'))['db'];var utils=require(_0x3d9e('0x4'));var logger=require('../../config/logger')(_0x3d9e('0x5'));var config=require(_0x3d9e('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3d9e('0x7')][_0x3d9e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2d491b,_0xd4f0da,_0x4ac48f){return new BPromise(function(_0x571c3a,_0x349d30){return client[_0x3d9e('0x9')](_0x2d491b,_0x4ac48f)[_0x3d9e('0xa')](function(_0x32b965){logger[_0x3d9e('0xb')](_0x3d9e('0xc'),_0xd4f0da,_0x3d9e('0xd'));logger[_0x3d9e('0xe')](_0x3d9e('0xf'),_0xd4f0da,_0x3d9e('0xd'),JSON[_0x3d9e('0x10')](_0x32b965));if(_0x32b965[_0x3d9e('0x11')]){if(_0x32b965['error']['code']===0x1f4){logger[_0x3d9e('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s',_0xd4f0da,_0x32b965[_0x3d9e('0x11')][_0x3d9e('0x12')]);return _0x349d30(_0x32b965['error'][_0x3d9e('0x12')]);}logger[_0x3d9e('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s',_0xd4f0da,_0x32b965['error'][_0x3d9e('0x12')]);return _0x571c3a(_0x32b965['error'][_0x3d9e('0x12')]);}else{logger['info'](_0x3d9e('0xc'),_0xd4f0da,_0x3d9e('0xd'));_0x571c3a(_0x32b965[_0x3d9e('0x13')][_0x3d9e('0x12')]);}})[_0x3d9e('0x14')](function(_0xda2e8f){logger[_0x3d9e('0x11')](_0x3d9e('0xc'),_0xd4f0da,_0xda2e8f);_0x349d30(_0xda2e8f);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index b8deeb4..d924fbc 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 _0x38b8=['../../config/environment','isAuthenticated','index','/:id','/:id/preview','preview','/:id/run','run','get','/:id/query','query','post','create','put','update','delete','destroy','multer','path','connect-timeout','Router','../../components/interaction/service'];(function(_0xecc93b,_0xc0dab9){var _0x5b1795=function(_0x203244){while(--_0x203244){_0xecc93b['push'](_0xecc93b['shift']());}};_0x5b1795(++_0xc0dab9);}(_0x38b8,0x7f));var _0x838b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x38b8[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x838b('0x0'));var util=require('util');var path=require(_0x838b('0x1'));var timeout=require(_0x838b('0x2'));var express=require('express');var router=express[_0x838b('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x838b('0x4'));var config=require(_0x838b('0x5'));var controller=require('./analyticDefaultReport.controller');router['get']('/',auth[_0x838b('0x6')](),controller[_0x838b('0x7')]);router['get'](_0x838b('0x8'),auth[_0x838b('0x6')](),controller['show']);router['get'](_0x838b('0x9'),auth[_0x838b('0x6')](),controller[_0x838b('0xa')]);router['get'](_0x838b('0xb'),auth['isAuthenticated'](),controller[_0x838b('0xc')]);router[_0x838b('0xd')](_0x838b('0xe'),auth[_0x838b('0x6')](),controller[_0x838b('0xf')]);router[_0x838b('0x10')]('/',auth['isAuthenticated'](),controller[_0x838b('0x11')]);router[_0x838b('0x12')](_0x838b('0x8'),auth[_0x838b('0x6')](),controller[_0x838b('0x13')]);router[_0x838b('0x14')](_0x838b('0x8'),auth[_0x838b('0x6')](),controller[_0x838b('0x15')]);module['exports']=router; \ No newline at end of file +var _0x5957=['util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','/:id','show','/:id/preview','isAuthenticated','preview','run','/:id/query','query','post','create','put','update','delete','destroy','multer'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x5957,0x158));var _0x7595=function(_0x1e4305,_0x3728cc){_0x1e4305=_0x1e4305-0x0;var _0x4f004f=_0x5957[_0x1e4305];return _0x4f004f;};'use strict';var multer=require(_0x7595('0x0'));var util=require(_0x7595('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7595('0x2'));var router=express['Router']();var fs_extra=require(_0x7595('0x3'));var auth=require(_0x7595('0x4'));var interaction=require(_0x7595('0x5'));var config=require(_0x7595('0x6'));var controller=require(_0x7595('0x7'));router[_0x7595('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7595('0x8')](_0x7595('0x9'),auth['isAuthenticated'](),controller[_0x7595('0xa')]);router[_0x7595('0x8')](_0x7595('0xb'),auth[_0x7595('0xc')](),controller[_0x7595('0xd')]);router[_0x7595('0x8')]('/:id/run',auth[_0x7595('0xc')](),controller[_0x7595('0xe')]);router[_0x7595('0x8')](_0x7595('0xf'),auth[_0x7595('0xc')](),controller[_0x7595('0x10')]);router[_0x7595('0x11')]('/',auth['isAuthenticated'](),controller[_0x7595('0x12')]);router[_0x7595('0x13')]('/:id',auth[_0x7595('0xc')](),controller[_0x7595('0x14')]);router[_0x7595('0x15')]('/:id',auth[_0x7595('0xc')](),controller[_0x7595('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 8e1d4c6..68c33e9 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 _0x42d3=['scheduled','INTEGER','UNSIGNED','sequelize','moment','exports','STRING','csv','pdf','xlsx','DATE','Loading','manual'];(function(_0x4dbaad,_0x730318){var _0x226c72=function(_0x501972){while(--_0x501972){_0x4dbaad['push'](_0x4dbaad['shift']());}};_0x226c72(++_0x730318);}(_0x42d3,0x1bd));var _0x342d=function(_0xe9ba2c,_0xfc7a6f){_0xe9ba2c=_0xe9ba2c-0x0;var _0x3f88a6=_0x42d3[_0xe9ba2c];return _0x3f88a6;};'use strict';var Sequelize=require(_0x342d('0x0'));var moment=require(_0x342d('0x1'));module[_0x342d('0x2')]={'name':{'type':Sequelize[_0x342d('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x342d('0x3')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x342d('0x4'),_0x342d('0x5'),_0x342d('0x6')),'allowNull':![],'defaultValue':_0x342d('0x4')},'savename':{'type':Sequelize[_0x342d('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x342d('0x7')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x342d('0x3')],'defaultValue':_0x342d('0x8')},'type':{'type':Sequelize['ENUM'](_0x342d('0x9'),_0x342d('0xa')),'allowNull':![],'defaultValue':_0x342d('0x9')},'reportId':{'type':Sequelize[_0x342d('0xb')](0xb)[_0x342d('0xc')]},'reportType':{'type':Sequelize[_0x342d('0x3')]}}; \ No newline at end of file +var _0x9d67=['ENUM','csv','pdf','DATE','manual','INTEGER','UNSIGNED','sequelize','moment','exports','STRING'];(function(_0x27afa6,_0x3892e8){var _0x343a71=function(_0xe2b4ce){while(--_0xe2b4ce){_0x27afa6['push'](_0x27afa6['shift']());}};_0x343a71(++_0x3892e8);}(_0x9d67,0x17d));var _0x79d6=function(_0x1311ff,_0x159219){_0x1311ff=_0x1311ff-0x0;var _0x247489=_0x9d67[_0x1311ff];return _0x247489;};'use strict';var Sequelize=require(_0x79d6('0x0'));var moment=require(_0x79d6('0x1'));module[_0x79d6('0x2')]={'name':{'type':Sequelize[_0x79d6('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x79d6('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x79d6('0x4')](_0x79d6('0x5'),_0x79d6('0x6'),'xlsx'),'allowNull':![],'defaultValue':_0x79d6('0x5')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x79d6('0x7')]},'endDate':{'type':Sequelize[_0x79d6('0x7')]},'status':{'type':Sequelize['STRING'],'defaultValue':'Loading'},'type':{'type':Sequelize['ENUM']('manual','scheduled'),'allowNull':![],'defaultValue':_0x79d6('0x8')},'reportId':{'type':Sequelize[_0x79d6('0x9')](0xb)[_0x79d6('0xa')]},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 6eb4fcd..59fb155 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 _0xe48b=['user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','download','basename','savename','output','existsSync','server/files/reports','ValidationError','exists','join','root','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','request-promise','bluebird','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','get','ExtractedReports','UserProfileResource','error','stack','name','send','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','includeAll','include','findAll','rows','catch','params','options','find','create'];(function(_0x49452d,_0x367a95){var _0x18884d=function(_0x1ff825){while(--_0x1ff825){_0x49452d['push'](_0x49452d['shift']());}};_0x18884d(++_0x367a95);}(_0xe48b,0x17b));var _0xbe48=function(_0x228082,_0x424104){_0x228082=_0x228082-0x0;var _0x559a92=_0xe48b[_0x228082];return _0x559a92;};'use strict';var emlformat=require(_0xbe48('0x0'));var rimraf=require(_0xbe48('0x1'));var zipdir=require(_0xbe48('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbe48('0x3'));var moment=require('moment');var BPromise=require(_0xbe48('0x4'));var Mustache=require('mustache');var util=require(_0xbe48('0x5'));var path=require('path');var sox=require(_0xbe48('0x6'));var csv=require(_0xbe48('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbe48('0x8'));var _=require(_0xbe48('0x9'));var squel=require(_0xbe48('0xa'));var crypto=require(_0xbe48('0xb'));var jsforce=require(_0xbe48('0xc'));var deskjs=require(_0xbe48('0xd'));var toCsv=require('to-csv');var querystring=require(_0xbe48('0xe'));var Papa=require('papaparse');var Redis=require(_0xbe48('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xbe48('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xbe48('0x11'));var licenseUtil=require(_0xbe48('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x491ae1,_0x396d6d){_0x396d6d=_0x396d6d||0xcc;return function(_0x33032e){if(_0x33032e){return _0x491ae1[_0xbe48('0x13')](_0x396d6d);}return _0x491ae1['status'](_0x396d6d)[_0xbe48('0x14')]();};}function respondWithResult(_0x1a1718,_0x2ed501){_0x2ed501=_0x2ed501||0xc8;return function(_0xce82d3){if(_0xce82d3){return _0x1a1718[_0xbe48('0x15')](_0x2ed501)[_0xbe48('0x16')](_0xce82d3);}};}function respondWithFilteredResult(_0x4c94c9,_0x31b4e6){return function(_0x10e044){if(_0x10e044){var _0x1b505e=typeof _0x31b4e6[_0xbe48('0x17')]===_0xbe48('0x18')&&typeof _0x31b4e6[_0xbe48('0x19')]===_0xbe48('0x18');var _0x367df0=_0x10e044[_0xbe48('0x1a')];var _0x23bc2c=_0x1b505e?0x0:_0x31b4e6[_0xbe48('0x17')];var _0xa378ee=_0x1b505e?_0x10e044[_0xbe48('0x1a')]:_0x31b4e6[_0xbe48('0x17')]+_0x31b4e6[_0xbe48('0x19')];var _0x27450f;if(_0xa378ee>=_0x367df0){_0xa378ee=_0x367df0;_0x27450f=0xc8;}else{_0x27450f=0xce;}_0x4c94c9[_0xbe48('0x15')](_0x27450f);return _0x4c94c9['set'](_0xbe48('0x1b'),_0x23bc2c+'-'+_0xa378ee+'/'+_0x367df0)['json'](_0x10e044);}return null;};}function patchUpdates(_0xac853){return function(_0x59ce31){try{jsonpatch['apply'](_0x59ce31,_0xac853,!![]);}catch(_0x23154a){return BPromise[_0xbe48('0x1c')](_0x23154a);}return _0x59ce31[_0xbe48('0x1d')]();};}function saveUpdates(_0x3ebfea,_0x5e0d1d){return function(_0x9b7536){if(_0x9b7536){return _0x9b7536[_0xbe48('0x1e')](_0x3ebfea)[_0xbe48('0x1f')](function(_0x32d4f8){return _0x32d4f8;});}return null;};}function removeEntity(_0x5f16d6,_0x31448f){return function(_0x24c69e){if(_0x24c69e){return _0x24c69e[_0xbe48('0x20')]()['then'](function(){var _0x51937d=_0x24c69e[_0xbe48('0x21')]({'plain':!![]});var _0x4997b9=_0xbe48('0x22');return db[_0xbe48('0x23')][_0xbe48('0x20')]({'where':{'type':_0x4997b9,'resourceId':_0x51937d['id']}})[_0xbe48('0x1f')](function(){return _0x24c69e;});})[_0xbe48('0x1f')](function(){_0x5f16d6[_0xbe48('0x15')](0xcc)[_0xbe48('0x14')]();});}};}function handleEntityNotFound(_0x2bb3fb,_0x2d7b99){return function(_0x33d1e6){if(!_0x33d1e6){_0x2bb3fb[_0xbe48('0x13')](0x194);}return _0x33d1e6;};}function handleError(_0x506786,_0x3c0834){_0x3c0834=_0x3c0834||0x1f4;return function(_0x133d1f){logger[_0xbe48('0x24')](_0x133d1f[_0xbe48('0x25')]);if(_0x133d1f[_0xbe48('0x26')]){delete _0x133d1f[_0xbe48('0x26')];}_0x506786[_0xbe48('0x15')](_0x3c0834)[_0xbe48('0x27')](_0x133d1f);};}exports['index']=function(_0x1520b,_0x36cfa6){var _0x34bbcc={},_0x47d716={},_0x4a123d={'count':0x0,'rows':[]};var _0x1fd1b8=_[_0xbe48('0x28')](db[_0xbe48('0x29')][_0xbe48('0x2a')],function(_0xf0a0f){return{'name':_0xf0a0f[_0xbe48('0x2b')],'type':_0xf0a0f[_0xbe48('0x2c')][_0xbe48('0x2d')]};});_0x47d716[_0xbe48('0x2e')]=_[_0xbe48('0x28')](_0x1fd1b8,'name');_0x47d716[_0xbe48('0x2f')]=_[_0xbe48('0x30')](_0x1520b[_0xbe48('0x2f')]);_0x47d716[_0xbe48('0x31')]=_[_0xbe48('0x32')](_0x47d716['model'],_0x47d716[_0xbe48('0x2f')]);_0x34bbcc[_0xbe48('0x33')]=_[_0xbe48('0x32')](_0x47d716[_0xbe48('0x2e')],qs[_0xbe48('0x34')](_0x1520b[_0xbe48('0x2f')][_0xbe48('0x34')]));_0x34bbcc[_0xbe48('0x33')]=_0x34bbcc[_0xbe48('0x33')][_0xbe48('0x35')]?_0x34bbcc['attributes']:_0x47d716[_0xbe48('0x2e')];if(!_0x1520b['query'][_0xbe48('0x36')](_0xbe48('0x37'))){_0x34bbcc['limit']=qs['limit'](_0x1520b[_0xbe48('0x2f')][_0xbe48('0x19')]);_0x34bbcc[_0xbe48('0x17')]=qs[_0xbe48('0x17')](_0x1520b['query']['offset']);}_0x34bbcc[_0xbe48('0x38')]=qs[_0xbe48('0x39')](_0x1520b[_0xbe48('0x2f')][_0xbe48('0x39')]);_0x34bbcc[_0xbe48('0x3a')]=qs[_0xbe48('0x31')](_[_0xbe48('0x3b')](_0x1520b[_0xbe48('0x2f')],_0x47d716[_0xbe48('0x31')]),_0x1fd1b8);if(_0x1520b[_0xbe48('0x2f')]['filter']){_0x34bbcc[_0xbe48('0x3a')]=_[_0xbe48('0x3c')](_0x34bbcc[_0xbe48('0x3a')],{'$or':_[_0xbe48('0x28')](_0x1fd1b8,function(_0x186199){if(_0x186199['type']!=='VIRTUAL'){var _0x3b6272={};_0x3b6272[_0x186199[_0xbe48('0x26')]]={'$like':'%'+_0x1520b[_0xbe48('0x2f')][_0xbe48('0x3d')]+'%'};return _0x3b6272;}})});}_0x34bbcc=_[_0xbe48('0x3c')]({},_0x34bbcc,_0x1520b['options']);var _0xd735d4={'where':_0x34bbcc['where']};return db[_0xbe48('0x29')][_0xbe48('0x1a')](_0xd735d4)[_0xbe48('0x1f')](function(_0x42f18f){_0x4a123d['count']=_0x42f18f;if(_0x1520b['query'][_0xbe48('0x3e')]){_0x34bbcc[_0xbe48('0x3f')]=[{'all':!![]}];}return db[_0xbe48('0x29')][_0xbe48('0x40')](_0x34bbcc);})[_0xbe48('0x1f')](function(_0x3abb56){_0x4a123d[_0xbe48('0x41')]=_0x3abb56;return _0x4a123d;})['then'](respondWithFilteredResult(_0x36cfa6,_0x34bbcc))[_0xbe48('0x42')](handleError(_0x36cfa6,null));};exports['show']=function(_0x572b9b,_0x58b755){var _0xa8510c={'raw':!![],'where':{'id':_0x572b9b[_0xbe48('0x43')]['id']}},_0x4095bb={};_0x4095bb[_0xbe48('0x2e')]=_['keys'](db[_0xbe48('0x29')]['rawAttributes']);_0x4095bb[_0xbe48('0x2f')]=_['keys'](_0x572b9b[_0xbe48('0x2f')]);_0x4095bb['filters']=_[_0xbe48('0x32')](_0x4095bb['model'],_0x4095bb['query']);_0xa8510c['attributes']=_[_0xbe48('0x32')](_0x4095bb[_0xbe48('0x2e')],qs[_0xbe48('0x34')](_0x572b9b[_0xbe48('0x2f')][_0xbe48('0x34')]));_0xa8510c['attributes']=_0xa8510c[_0xbe48('0x33')]['length']?_0xa8510c['attributes']:_0x4095bb[_0xbe48('0x2e')];if(_0x572b9b[_0xbe48('0x2f')][_0xbe48('0x3e')]){_0xa8510c[_0xbe48('0x3f')]=[{'all':!![]}];}_0xa8510c=_[_0xbe48('0x3c')]({},_0xa8510c,_0x572b9b[_0xbe48('0x44')]);return db[_0xbe48('0x29')][_0xbe48('0x45')](_0xa8510c)['then'](handleEntityNotFound(_0x58b755,null))[_0xbe48('0x1f')](respondWithResult(_0x58b755,null))[_0xbe48('0x42')](handleError(_0x58b755,null));};exports['create']=function(_0x834526,_0x156bd9){return db[_0xbe48('0x29')][_0xbe48('0x46')](_0x834526['body'],{})[_0xbe48('0x1f')](function(_0x3e384f){var _0xf7299=_0x834526['user'][_0xbe48('0x21')]({'plain':!![]});if(!_0xf7299)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xf7299['role']===_0xbe48('0x47')){var _0x124890=_0x3e384f['get']({'plain':!![]});var _0x5bbc9a=_0xbe48('0x22');return db[_0xbe48('0x48')][_0xbe48('0x45')]({'where':{'name':_0x5bbc9a,'userProfileId':_0xf7299[_0xbe48('0x49')]},'raw':!![]})['then'](function(_0x516304){if(_0x516304&&_0x516304[_0xbe48('0x4a')]===0x0){return db[_0xbe48('0x23')]['create']({'name':_0x124890[_0xbe48('0x26')],'resourceId':_0x124890['id'],'type':_0x516304[_0xbe48('0x26')],'sectionId':_0x516304['id']},{})[_0xbe48('0x1f')](function(){return _0x3e384f;});}else{return _0x3e384f;}})[_0xbe48('0x42')](function(_0x3faec7){logger[_0xbe48('0x24')](_0xbe48('0x4b'),_0x3faec7);throw _0x3faec7;});}return _0x3e384f;})['then'](respondWithResult(_0x156bd9,0xc9))['catch'](handleError(_0x156bd9,null));};exports[_0xbe48('0x1e')]=function(_0x16ba70,_0x3db4fd){if(_0x16ba70[_0xbe48('0x4c')]['id']){delete _0x16ba70[_0xbe48('0x4c')]['id'];}return db['AnalyticExtractedReport'][_0xbe48('0x45')]({'where':{'id':_0x16ba70[_0xbe48('0x43')]['id']}})[_0xbe48('0x1f')](handleEntityNotFound(_0x3db4fd,null))['then'](saveUpdates(_0x16ba70['body'],null))[_0xbe48('0x1f')](respondWithResult(_0x3db4fd,null))[_0xbe48('0x42')](handleError(_0x3db4fd,null));};exports[_0xbe48('0x20')]=function(_0x445aa2,_0x4299f1){return db[_0xbe48('0x29')][_0xbe48('0x45')]({'where':{'id':_0x445aa2[_0xbe48('0x43')]['id']}})[_0xbe48('0x1f')](handleEntityNotFound(_0x4299f1,null))['then'](removeEntity(_0x4299f1,null))[_0xbe48('0x42')](handleError(_0x4299f1,null));};exports[_0xbe48('0x4d')]=function(_0x2974bd,_0x4cf4da,_0x572eaf){return db[_0xbe48('0x29')][_0xbe48('0x45')]({'where':{'id':_0x2974bd[_0xbe48('0x43')]['id']},'attributes':[_0xbe48('0x26'),_0xbe48('0x4e'),_0xbe48('0x4f'),_0xbe48('0x50')],'raw':!![]})[_0xbe48('0x1f')](handleEntityNotFound(_0x4cf4da,null))[_0xbe48('0x1f')](function(_0x4bd476){if(_0x4bd476){if(!fs[_0xbe48('0x51')](path['join'](config['root'],_0xbe48('0x52'),_0x4bd476[_0xbe48('0x4f')]))){throw new db['Sequelize'][(_0xbe48('0x53'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x2974bd[_0xbe48('0x2f')][_0xbe48('0x54')]){return _0x4cf4da[_0xbe48('0x13')](0xc8);}return _0x4cf4da[_0xbe48('0x4d')](path[_0xbe48('0x55')](config[_0xbe48('0x56')],_0xbe48('0x52'),_0x4bd476['savename']),util[_0xbe48('0x57')](_0xbe48('0x58'),_0x4bd476[_0xbe48('0x4e')]||_0x4bd476[_0xbe48('0x26')],_0x4bd476[_0xbe48('0x50')][_0xbe48('0x59')]()));}})[_0xbe48('0x42')](handleError(_0x4cf4da,null));}; \ No newline at end of file +var _0x093c=['offset','set','Content-Range','apply','reject','then','destroy','UserProfileResource','stack','name','index','AnalyticExtractedReport','rawAttributes','fieldName','type','model','map','keys','intersection','query','attributes','fields','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','include','findAll','rows','catch','length','includeAll','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','ExtractedReports','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','basename','savename','existsSync','join','root','ValidationError','format','%s.%s','output','toLowerCase','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count'];(function(_0x12e079,_0x517643){var _0xb673e3=function(_0x523ccb){while(--_0x523ccb){_0x12e079['push'](_0x12e079['shift']());}};_0xb673e3(++_0x517643);}(_0x093c,0xef));var _0xc093=function(_0x3f390c,_0x4074dc){_0x3f390c=_0x3f390c-0x0;var _0x15a060=_0x093c[_0x3f390c];return _0x15a060;};'use strict';var emlformat=require(_0xc093('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc093('0x1'));var jsonpatch=require(_0xc093('0x2'));var rp=require(_0xc093('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc093('0x4'));var util=require(_0xc093('0x5'));var path=require(_0xc093('0x6'));var sox=require('sox');var csv=require(_0xc093('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc093('0x8'));var squel=require(_0xc093('0x9'));var crypto=require('crypto');var jsforce=require(_0xc093('0xa'));var deskjs=require(_0xc093('0xb'));var toCsv=require(_0xc093('0x7'));var querystring=require(_0xc093('0xc'));var Papa=require(_0xc093('0xd'));var Redis=require(_0xc093('0xe'));var authService=require(_0xc093('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xc093('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xc093('0x11'));var config=require(_0xc093('0x12'));var licenseUtil=require(_0xc093('0x13'));var db=require(_0xc093('0x14'))['db'];function respondWithStatusCode(_0x5d8973,_0xf1f4ec){_0xf1f4ec=_0xf1f4ec||0xcc;return function(_0x10e955){if(_0x10e955){return _0x5d8973[_0xc093('0x15')](_0xf1f4ec);}return _0x5d8973[_0xc093('0x16')](_0xf1f4ec)[_0xc093('0x17')]();};}function respondWithResult(_0x5278c3,_0x51470e){_0x51470e=_0x51470e||0xc8;return function(_0x4b108c){if(_0x4b108c){return _0x5278c3['status'](_0x51470e)[_0xc093('0x18')](_0x4b108c);}};}function respondWithFilteredResult(_0x427883,_0x4a77c5){return function(_0x45ee9c){if(_0x45ee9c){var _0x45cbc4=typeof _0x4a77c5['offset']===_0xc093('0x19')&&typeof _0x4a77c5[_0xc093('0x1a')]===_0xc093('0x19');var _0x22104a=_0x45ee9c[_0xc093('0x1b')];var _0x1b8def=_0x45cbc4?0x0:_0x4a77c5[_0xc093('0x1c')];var _0x265ad5=_0x45cbc4?_0x45ee9c[_0xc093('0x1b')]:_0x4a77c5[_0xc093('0x1c')]+_0x4a77c5[_0xc093('0x1a')];var _0x388752;if(_0x265ad5>=_0x22104a){_0x265ad5=_0x22104a;_0x388752=0xc8;}else{_0x388752=0xce;}_0x427883[_0xc093('0x16')](_0x388752);return _0x427883[_0xc093('0x1d')](_0xc093('0x1e'),_0x1b8def+'-'+_0x265ad5+'/'+_0x22104a)[_0xc093('0x18')](_0x45ee9c);}return null;};}function patchUpdates(_0x18296b){return function(_0x5a9891){try{jsonpatch[_0xc093('0x1f')](_0x5a9891,_0x18296b,!![]);}catch(_0x3e889a){return BPromise[_0xc093('0x20')](_0x3e889a);}return _0x5a9891['save']();};}function saveUpdates(_0x380bc1,_0x51083c){return function(_0x22091f){if(_0x22091f){return _0x22091f['update'](_0x380bc1)[_0xc093('0x21')](function(_0x85e645){return _0x85e645;});}return null;};}function removeEntity(_0x360534,_0x485a8e){return function(_0x3e2f85){if(_0x3e2f85){return _0x3e2f85[_0xc093('0x22')]()[_0xc093('0x21')](function(){var _0x3a3320=_0x3e2f85['get']({'plain':!![]});var _0x3e1ab6='ExtractedReports';return db[_0xc093('0x23')]['destroy']({'where':{'type':_0x3e1ab6,'resourceId':_0x3a3320['id']}})[_0xc093('0x21')](function(){return _0x3e2f85;});})['then'](function(){_0x360534[_0xc093('0x16')](0xcc)[_0xc093('0x17')]();});}};}function handleEntityNotFound(_0x578072,_0x2b9606){return function(_0x568f79){if(!_0x568f79){_0x578072[_0xc093('0x15')](0x194);}return _0x568f79;};}function handleError(_0xb3ba2e,_0x3fa544){_0x3fa544=_0x3fa544||0x1f4;return function(_0x421bef){logger['error'](_0x421bef[_0xc093('0x24')]);if(_0x421bef[_0xc093('0x25')]){delete _0x421bef['name'];}_0xb3ba2e['status'](_0x3fa544)['send'](_0x421bef);};}exports[_0xc093('0x26')]=function(_0x54daf7,_0x25e643){var _0x46ff80={},_0x5574f3={},_0x4dc233={'count':0x0,'rows':[]};var _0x45867a=_['map'](db[_0xc093('0x27')][_0xc093('0x28')],function(_0x403084){return{'name':_0x403084[_0xc093('0x29')],'type':_0x403084[_0xc093('0x2a')]['key']};});_0x5574f3[_0xc093('0x2b')]=_[_0xc093('0x2c')](_0x45867a,'name');_0x5574f3['query']=_[_0xc093('0x2d')](_0x54daf7['query']);_0x5574f3['filters']=_[_0xc093('0x2e')](_0x5574f3['model'],_0x5574f3[_0xc093('0x2f')]);_0x46ff80[_0xc093('0x30')]=_[_0xc093('0x2e')](_0x5574f3[_0xc093('0x2b')],qs[_0xc093('0x31')](_0x54daf7[_0xc093('0x2f')][_0xc093('0x31')]));_0x46ff80[_0xc093('0x30')]=_0x46ff80[_0xc093('0x30')]['length']?_0x46ff80['attributes']:_0x5574f3[_0xc093('0x2b')];if(!_0x54daf7[_0xc093('0x2f')]['hasOwnProperty'](_0xc093('0x32'))){_0x46ff80[_0xc093('0x1a')]=qs[_0xc093('0x1a')](_0x54daf7[_0xc093('0x2f')][_0xc093('0x1a')]);_0x46ff80[_0xc093('0x1c')]=qs[_0xc093('0x1c')](_0x54daf7[_0xc093('0x2f')][_0xc093('0x1c')]);}_0x46ff80[_0xc093('0x33')]=qs[_0xc093('0x34')](_0x54daf7[_0xc093('0x2f')][_0xc093('0x34')]);_0x46ff80[_0xc093('0x35')]=qs[_0xc093('0x36')](_['pick'](_0x54daf7['query'],_0x5574f3['filters']),_0x45867a);if(_0x54daf7[_0xc093('0x2f')][_0xc093('0x37')]){_0x46ff80['where']=_[_0xc093('0x38')](_0x46ff80[_0xc093('0x35')],{'$or':_['map'](_0x45867a,function(_0x3763fc){if(_0x3763fc[_0xc093('0x2a')]!==_0xc093('0x39')){var _0x2ac88f={};_0x2ac88f[_0x3763fc[_0xc093('0x25')]]={'$like':'%'+_0x54daf7['query'][_0xc093('0x37')]+'%'};return _0x2ac88f;}})});}_0x46ff80=_[_0xc093('0x38')]({},_0x46ff80,_0x54daf7[_0xc093('0x3a')]);var _0x1fcc9e={'where':_0x46ff80['where']};return db[_0xc093('0x27')][_0xc093('0x1b')](_0x1fcc9e)[_0xc093('0x21')](function(_0x663df){_0x4dc233[_0xc093('0x1b')]=_0x663df;if(_0x54daf7['query']['includeAll']){_0x46ff80[_0xc093('0x3b')]=[{'all':!![]}];}return db[_0xc093('0x27')][_0xc093('0x3c')](_0x46ff80);})['then'](function(_0x4f18a3){_0x4dc233[_0xc093('0x3d')]=_0x4f18a3;return _0x4dc233;})['then'](respondWithFilteredResult(_0x25e643,_0x46ff80))[_0xc093('0x3e')](handleError(_0x25e643,null));};exports['show']=function(_0x16314c,_0x325e2f){var _0x343eed={'raw':!![],'where':{'id':_0x16314c['params']['id']}},_0x14de22={};_0x14de22['model']=_[_0xc093('0x2d')](db[_0xc093('0x27')][_0xc093('0x28')]);_0x14de22[_0xc093('0x2f')]=_[_0xc093('0x2d')](_0x16314c[_0xc093('0x2f')]);_0x14de22[_0xc093('0x36')]=_[_0xc093('0x2e')](_0x14de22[_0xc093('0x2b')],_0x14de22[_0xc093('0x2f')]);_0x343eed[_0xc093('0x30')]=_[_0xc093('0x2e')](_0x14de22[_0xc093('0x2b')],qs[_0xc093('0x31')](_0x16314c[_0xc093('0x2f')][_0xc093('0x31')]));_0x343eed['attributes']=_0x343eed[_0xc093('0x30')][_0xc093('0x3f')]?_0x343eed[_0xc093('0x30')]:_0x14de22[_0xc093('0x2b')];if(_0x16314c[_0xc093('0x2f')][_0xc093('0x40')]){_0x343eed[_0xc093('0x3b')]=[{'all':!![]}];}_0x343eed=_[_0xc093('0x38')]({},_0x343eed,_0x16314c[_0xc093('0x3a')]);return db[_0xc093('0x27')][_0xc093('0x41')](_0x343eed)[_0xc093('0x21')](handleEntityNotFound(_0x325e2f,null))['then'](respondWithResult(_0x325e2f,null))[_0xc093('0x3e')](handleError(_0x325e2f,null));};exports[_0xc093('0x42')]=function(_0x9d8b9f,_0x54a953){return db[_0xc093('0x27')]['create'](_0x9d8b9f[_0xc093('0x43')],{})[_0xc093('0x21')](function(_0x45ce4b){var _0x51ab46=_0x9d8b9f['user'][_0xc093('0x44')]({'plain':!![]});if(!_0x51ab46)throw new Error(_0xc093('0x45'));if(_0x51ab46[_0xc093('0x46')]===_0xc093('0x47')){var _0x28f9a7=_0x45ce4b['get']({'plain':!![]});var _0x37ab1a=_0xc093('0x48');return db[_0xc093('0x49')]['find']({'where':{'name':_0x37ab1a,'userProfileId':_0x51ab46[_0xc093('0x4a')]},'raw':!![]})[_0xc093('0x21')](function(_0x14ceaf){if(_0x14ceaf&&_0x14ceaf['autoAssociation']===0x0){return db[_0xc093('0x23')][_0xc093('0x42')]({'name':_0x28f9a7[_0xc093('0x25')],'resourceId':_0x28f9a7['id'],'type':_0x14ceaf['name'],'sectionId':_0x14ceaf['id']},{})[_0xc093('0x21')](function(){return _0x45ce4b;});}else{return _0x45ce4b;}})[_0xc093('0x3e')](function(_0x237a98){logger[_0xc093('0x4b')](_0xc093('0x4c'),_0x237a98);throw _0x237a98;});}return _0x45ce4b;})[_0xc093('0x21')](respondWithResult(_0x54a953,0xc9))[_0xc093('0x3e')](handleError(_0x54a953,null));};exports[_0xc093('0x4d')]=function(_0x516472,_0x338653){if(_0x516472[_0xc093('0x43')]['id']){delete _0x516472[_0xc093('0x43')]['id'];}return db[_0xc093('0x27')][_0xc093('0x41')]({'where':{'id':_0x516472['params']['id']}})[_0xc093('0x21')](handleEntityNotFound(_0x338653,null))[_0xc093('0x21')](saveUpdates(_0x516472[_0xc093('0x43')],null))[_0xc093('0x21')](respondWithResult(_0x338653,null))[_0xc093('0x3e')](handleError(_0x338653,null));};exports['destroy']=function(_0x8fcb62,_0x3f5980){return db[_0xc093('0x27')][_0xc093('0x41')]({'where':{'id':_0x8fcb62[_0xc093('0x4e')]['id']}})[_0xc093('0x21')](handleEntityNotFound(_0x3f5980,null))[_0xc093('0x21')](removeEntity(_0x3f5980,null))['catch'](handleError(_0x3f5980,null));};exports['download']=function(_0x15c449,_0xcfeabc,_0x408ccc){return db[_0xc093('0x27')]['find']({'where':{'id':_0x15c449[_0xc093('0x4e')]['id']},'attributes':['name',_0xc093('0x4f'),_0xc093('0x50'),'output'],'raw':!![]})['then'](handleEntityNotFound(_0xcfeabc,null))[_0xc093('0x21')](function(_0x45a74b){if(_0x45a74b){if(!fs[_0xc093('0x51')](path[_0xc093('0x52')](config[_0xc093('0x53')],'server/files/reports',_0x45a74b['savename']))){throw new db['Sequelize'][(_0xc093('0x54'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x15c449[_0xc093('0x2f')]['exists']){return _0xcfeabc['sendStatus'](0xc8);}return _0xcfeabc['download'](path[_0xc093('0x52')](config[_0xc093('0x53')],'server/files/reports',_0x45a74b['savename']),util[_0xc093('0x55')](_0xc093('0x56'),_0x45a74b[_0xc093('0x4f')]||_0x45a74b[_0xc093('0x25')],_0x45a74b[_0xc093('0x57')][_0xc093('0x58')]()));}})[_0xc093('0x3e')](handleError(_0xcfeabc,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 8af4d1c..db48292 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 _0xaa94=['analytics_extracted_reports','lodash','util','../../config/logger','moment','bluebird','path','rimraf','./analyticExtractedReport.attributes','exports','AnalyticExtractedReport'];(function(_0x514c15,_0x486901){var _0x16283e=function(_0x53b7d0){while(--_0x53b7d0){_0x514c15['push'](_0x514c15['shift']());}};_0x16283e(++_0x486901);}(_0xaa94,0xfe));var _0x4aa9=function(_0x35d10f,_0x487501){_0x35d10f=_0x35d10f-0x0;var _0x1611df=_0xaa94[_0x35d10f];return _0x1611df;};'use strict';var _=require(_0x4aa9('0x0'));var util=require(_0x4aa9('0x1'));var logger=require(_0x4aa9('0x2'))('api');var moment=require(_0x4aa9('0x3'));var BPromise=require(_0x4aa9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4aa9('0x5'));var rimraf=require(_0x4aa9('0x6'));var config=require('../../config/environment');var attributes=require(_0x4aa9('0x7'));module[_0x4aa9('0x8')]=function(_0x2ffd36,_0x3d301f){return _0x2ffd36['define'](_0x4aa9('0x9'),attributes,{'tableName':_0x4aa9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x10ab=['define','lodash','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x2a8256,_0x25c61d){var _0x2984aa=function(_0x4c29aa){while(--_0x4c29aa){_0x2a8256['push'](_0x2a8256['shift']());}};_0x2984aa(++_0x25c61d);}(_0x10ab,0xc1));var _0xb10a=function(_0x519756,_0x288785){_0x519756=_0x519756-0x0;var _0x37047e=_0x10ab[_0x519756];return _0x37047e;};'use strict';var _=require(_0xb10a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb10a('0x1'));var moment=require(_0xb10a('0x2'));var BPromise=require(_0xb10a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb10a('0x4'));var rimraf=require(_0xb10a('0x5'));var config=require(_0xb10a('0x6'));var attributes=require('./analyticExtractedReport.attributes');module['exports']=function(_0x5bb54c,_0x5581b1){return _0x5bb54c[_0xb10a('0x7')]('AnalyticExtractedReport',attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js index 9be1e89..9e9c449 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 _0x751d=['moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x2fa2aa,_0x18205f){var _0x3fb7db=function(_0x1fe65f){while(--_0x1fe65f){_0x2fa2aa['push'](_0x2fa2aa['shift']());}};_0x3fb7db(++_0x18205f);}(_0x751d,0x1a3));var _0xd751=function(_0x13187a,_0x2fcec4){_0x13187a=_0x13187a-0x0;var _0x65b85f=_0x751d[_0x13187a];return _0x65b85f;};'use strict';var _=require(_0xd751('0x0'));var util=require('util');var moment=require(_0xd751('0x1'));var BPromise=require('bluebird');var rs=require(_0xd751('0x2'));var fs=require('fs');var Redis=require(_0xd751('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd751('0x4'))(_0xd751('0x5'));var config=require(_0xd751('0x6'));var jayson=require(_0xd751('0x7'));var client=jayson[_0xd751('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2b4cae,_0x5d6b95,_0x38d085){return new BPromise(function(_0x233e83,_0x1c98e3){return client[_0xd751('0x9')](_0x2b4cae,_0x38d085)[_0xd751('0xa')](function(_0x6f3b4e){logger[_0xd751('0xb')](_0xd751('0xc'),_0x5d6b95,_0xd751('0xd'));logger[_0xd751('0xe')](_0xd751('0xf'),_0x5d6b95,_0xd751('0xd'),JSON[_0xd751('0x10')](_0x6f3b4e));if(_0x6f3b4e[_0xd751('0x11')]){if(_0x6f3b4e['error'][_0xd751('0x12')]===0x1f4){logger[_0xd751('0x11')](_0xd751('0xc'),_0x5d6b95,_0x6f3b4e[_0xd751('0x11')][_0xd751('0x13')]);return _0x1c98e3(_0x6f3b4e[_0xd751('0x11')][_0xd751('0x13')]);}logger[_0xd751('0x11')](_0xd751('0xc'),_0x5d6b95,_0x6f3b4e[_0xd751('0x11')][_0xd751('0x13')]);return _0x233e83(_0x6f3b4e[_0xd751('0x11')][_0xd751('0x13')]);}else{logger[_0xd751('0xb')](_0xd751('0xc'),_0x5d6b95,'request\x20sent');_0x233e83(_0x6f3b4e[_0xd751('0x14')][_0xd751('0x13')]);}})['catch'](function(_0x650ab4){logger[_0xd751('0x11')](_0xd751('0xc'),_0x5d6b95,_0x650ab4);_0x1c98e3(_0x650ab4);});});} \ No newline at end of file +var _0x6360=['info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then'];(function(_0x1008d6,_0x5ad4c9){var _0x3ee555=function(_0x493571){while(--_0x493571){_0x1008d6['push'](_0x1008d6['shift']());}};_0x3ee555(++_0x5ad4c9);}(_0x6360,0x148));var _0x0636=function(_0x5dc368,_0x38fb08){_0x5dc368=_0x5dc368-0x0;var _0x864c4a=_0x6360[_0x5dc368];return _0x864c4a;};'use strict';var _=require(_0x0636('0x0'));var util=require(_0x0636('0x1'));var moment=require(_0x0636('0x2'));var BPromise=require(_0x0636('0x3'));var rs=require(_0x0636('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0636('0x5'))['db'];var utils=require(_0x0636('0x6'));var logger=require(_0x0636('0x7'))(_0x0636('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x0636('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x9910d,_0x4c66a3,_0x328d53){return new BPromise(function(_0x26233e,_0x172264){return client[_0x0636('0xa')](_0x9910d,_0x328d53)[_0x0636('0xb')](function(_0x2cf0c9){logger[_0x0636('0xc')](_0x0636('0xd'),_0x4c66a3,_0x0636('0xe'));logger[_0x0636('0xf')](_0x0636('0x10'),_0x4c66a3,_0x0636('0xe'),JSON['stringify'](_0x2cf0c9));if(_0x2cf0c9[_0x0636('0x11')]){if(_0x2cf0c9[_0x0636('0x11')]['code']===0x1f4){logger[_0x0636('0x11')](_0x0636('0xd'),_0x4c66a3,_0x2cf0c9[_0x0636('0x11')]['message']);return _0x172264(_0x2cf0c9[_0x0636('0x11')][_0x0636('0x12')]);}logger[_0x0636('0x11')](_0x0636('0xd'),_0x4c66a3,_0x2cf0c9[_0x0636('0x11')][_0x0636('0x12')]);return _0x26233e(_0x2cf0c9['error'][_0x0636('0x12')]);}else{logger[_0x0636('0xc')](_0x0636('0xd'),_0x4c66a3,_0x0636('0xe'));_0x26233e(_0x2cf0c9[_0x0636('0x13')][_0x0636('0x12')]);}})['catch'](function(_0x16f29f){logger['error'](_0x0636('0xd'),_0x4c66a3,_0x16f29f);_0x172264(_0x16f29f);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 91488d9..f55ea32 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 _0x0397=['destroy','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','download','post','create','put','delete'];(function(_0x56f83c,_0x13e5b0){var _0x43aac0=function(_0x24b8be){while(--_0x24b8be){_0x56f83c['push'](_0x56f83c['shift']());}};_0x43aac0(++_0x13e5b0);}(_0x0397,0x155));var _0x7039=function(_0x2872b0,_0x4b0855){_0x2872b0=_0x2872b0-0x0;var _0x58b379=_0x0397[_0x2872b0];return _0x58b379;};'use strict';var multer=require(_0x7039('0x0'));var util=require('util');var path=require(_0x7039('0x1'));var timeout=require(_0x7039('0x2'));var express=require(_0x7039('0x3'));var router=express['Router']();var fs_extra=require(_0x7039('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x7039('0x5'));var config=require(_0x7039('0x6'));var controller=require('./analyticExtractedReport.controller');router[_0x7039('0x7')]('/',auth[_0x7039('0x8')](),controller[_0x7039('0x9')]);router[_0x7039('0x7')](_0x7039('0xa'),auth[_0x7039('0x8')](),controller['show']);router[_0x7039('0x7')]('/:id/download',auth[_0x7039('0x8')](),controller[_0x7039('0xb')]);router[_0x7039('0xc')]('/',auth[_0x7039('0x8')](),controller[_0x7039('0xd')]);router[_0x7039('0xe')]('/:id',auth[_0x7039('0x8')](),controller['update']);router[_0x7039('0xf')](_0x7039('0xa'),auth['isAuthenticated'](),controller[_0x7039('0x10')]);module['exports']=router; \ No newline at end of file +var _0x036f=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','/:id','isAuthenticated','show','/:id/download','download','post','create','put','delete'];(function(_0x48424b,_0x7f9d77){var _0x4d77a5=function(_0x5025c3){while(--_0x5025c3){_0x48424b['push'](_0x48424b['shift']());}};_0x4d77a5(++_0x7f9d77);}(_0x036f,0x109));var _0xf036=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x036f[_0x17d9e3];return _0x14192d;};'use strict';var multer=require(_0xf036('0x0'));var util=require(_0xf036('0x1'));var path=require(_0xf036('0x2'));var timeout=require(_0xf036('0x3'));var express=require(_0xf036('0x4'));var router=express[_0xf036('0x5')]();var fs_extra=require(_0xf036('0x6'));var auth=require(_0xf036('0x7'));var interaction=require(_0xf036('0x8'));var config=require(_0xf036('0x9'));var controller=require(_0xf036('0xa'));router[_0xf036('0xb')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf036('0xb')](_0xf036('0xc'),auth[_0xf036('0xd')](),controller[_0xf036('0xe')]);router[_0xf036('0xb')](_0xf036('0xf'),auth[_0xf036('0xd')](),controller[_0xf036('0x10')]);router[_0xf036('0x11')]('/',auth[_0xf036('0xd')](),controller[_0xf036('0x12')]);router[_0xf036('0x13')](_0xf036('0xc'),auth[_0xf036('0xd')](),controller['update']);router[_0xf036('0x14')](_0xf036('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xf036('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 8727c29..1aec947 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 _0x35b2=['BOOLEAN','sequelize','exports','STRING'];(function(_0x9d7494,_0x19c86a){var _0x5b4804=function(_0x2a0160){while(--_0x2a0160){_0x9d7494['push'](_0x9d7494['shift']());}};_0x5b4804(++_0x19c86a);}(_0x35b2,0x119));var _0x235b=function(_0x2bfb66,_0x431abf){_0x2bfb66=_0x2bfb66-0x0;var _0x57e6a0=_0x35b2[_0x2bfb66];return _0x57e6a0;};'use strict';var Sequelize=require(_0x235b('0x0'));module[_0x235b('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0x235b('0x2')]},'function':{'type':Sequelize[_0x235b('0x2')]},'format':{'type':Sequelize[_0x235b('0x2')]},'groupBy':{'type':Sequelize[_0x235b('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x235b('0x2')]},'custom':{'type':Sequelize[_0x235b('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x90d2=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x1b65f4,_0x10d2fa){var _0x41c609=function(_0x160a83){while(--_0x160a83){_0x1b65f4['push'](_0x1b65f4['shift']());}};_0x41c609(++_0x10d2fa);}(_0x90d2,0xae));var _0x290d=function(_0x37357f,_0x3b23bb){_0x37357f=_0x37357f-0x0;var _0x505ef9=_0x90d2[_0x37357f];return _0x505ef9;};'use strict';var Sequelize=require(_0x290d('0x0'));module[_0x290d('0x1')]={'field':{'type':Sequelize[_0x290d('0x2')]},'alias':{'type':Sequelize[_0x290d('0x3')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x290d('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x290d('0x3')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index a481299..2dfbbb2 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 _0x080f=['path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','set','apply','reject','save','update','destroy','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','then','rows','catch','show','params','find','create','body','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','transaction','CustomReportId','bulkCreate','eml-format','zip-dir','request-promise','moment','mustache','util'];(function(_0xbe0daa,_0x5f57ab){var _0x2f296a=function(_0xc3af16){while(--_0xc3af16){_0xbe0daa['push'](_0xbe0daa['shift']());}};_0x2f296a(++_0x5f57ab);}(_0x080f,0xa2));var _0xf080=function(_0x5fe190,_0x503142){_0x5fe190=_0x5fe190-0x0;var _0xe91d68=_0x080f[_0x5fe190];return _0xe91d68;};'use strict';var emlformat=require(_0xf080('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf080('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf080('0x2'));var moment=require(_0xf080('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf080('0x4'));var util=require(_0xf080('0x5'));var path=require(_0xf080('0x6'));var sox=require(_0xf080('0x7'));var csv=require('to-csv');var ejs=require(_0xf080('0x8'));var fs=require('fs');var fs_extra=require(_0xf080('0x9'));var _=require(_0xf080('0xa'));var squel=require(_0xf080('0xb'));var crypto=require('crypto');var jsforce=require(_0xf080('0xc'));var deskjs=require(_0xf080('0xd'));var toCsv=require(_0xf080('0xe'));var querystring=require(_0xf080('0xf'));var Papa=require(_0xf080('0x10'));var Redis=require(_0xf080('0x11'));var authService=require(_0xf080('0x12'));var qs=require(_0xf080('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf080('0x14'));var logger=require(_0xf080('0x15'))(_0xf080('0x16'));var utils=require(_0xf080('0x17'));var config=require(_0xf080('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xf080('0x19'))['db'];function respondWithStatusCode(_0x49ce34,_0x4720a6){_0x4720a6=_0x4720a6||0xcc;return function(_0x64c435){if(_0x64c435){return _0x49ce34[_0xf080('0x1a')](_0x4720a6);}return _0x49ce34[_0xf080('0x1b')](_0x4720a6)[_0xf080('0x1c')]();};}function respondWithResult(_0x38bc9d,_0x4baaaa){_0x4baaaa=_0x4baaaa||0xc8;return function(_0x519bac){if(_0x519bac){return _0x38bc9d[_0xf080('0x1b')](_0x4baaaa)[_0xf080('0x1d')](_0x519bac);}};}function respondWithFilteredResult(_0x2ad258,_0x5ecafe){return function(_0x4261cb){if(_0x4261cb){var _0x3965e8=typeof _0x5ecafe[_0xf080('0x1e')]==='undefined'&&typeof _0x5ecafe[_0xf080('0x1f')]===_0xf080('0x20');var _0x4422b8=_0x4261cb['count'];var _0x58d5c0=_0x3965e8?0x0:_0x5ecafe[_0xf080('0x1e')];var _0x1a1cf6=_0x3965e8?_0x4261cb['count']:_0x5ecafe[_0xf080('0x1e')]+_0x5ecafe['limit'];var _0x228985;if(_0x1a1cf6>=_0x4422b8){_0x1a1cf6=_0x4422b8;_0x228985=0xc8;}else{_0x228985=0xce;}_0x2ad258[_0xf080('0x1b')](_0x228985);return _0x2ad258[_0xf080('0x21')]('Content-Range',_0x58d5c0+'-'+_0x1a1cf6+'/'+_0x4422b8)[_0xf080('0x1d')](_0x4261cb);}return null;};}function patchUpdates(_0x2459f1){return function(_0x2599f0){try{jsonpatch[_0xf080('0x22')](_0x2599f0,_0x2459f1,!![]);}catch(_0x3d0c5a){return BPromise[_0xf080('0x23')](_0x3d0c5a);}return _0x2599f0[_0xf080('0x24')]();};}function saveUpdates(_0x433407,_0x1be042){return function(_0x255535){if(_0x255535){return _0x255535[_0xf080('0x25')](_0x433407)['then'](function(_0x580fa0){return _0x580fa0;});}return null;};}function removeEntity(_0x306319,_0x28af22){return function(_0xaaadc1){if(_0xaaadc1){return _0xaaadc1[_0xf080('0x26')]()['then'](function(){_0x306319[_0xf080('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x52f105,_0x213191){return function(_0x4807d7){if(!_0x4807d7){_0x52f105[_0xf080('0x1a')](0x194);}return _0x4807d7;};}function handleError(_0x184eec,_0x1077a3){_0x1077a3=_0x1077a3||0x1f4;return function(_0x3e876b){logger['error'](_0x3e876b[_0xf080('0x27')]);if(_0x3e876b[_0xf080('0x28')]){delete _0x3e876b['name'];}_0x184eec['status'](_0x1077a3)[_0xf080('0x29')](_0x3e876b);};}exports[_0xf080('0x2a')]=function(_0x2c580a,_0x197694){var _0x353803={},_0xd1fdf9={},_0x16a900={'count':0x0,'rows':[]};var _0x37e8fb=_[_0xf080('0x2b')](db[_0xf080('0x2c')][_0xf080('0x2d')],function(_0x41489b){return{'name':_0x41489b[_0xf080('0x2e')],'type':_0x41489b['type'][_0xf080('0x2f')]};});_0xd1fdf9[_0xf080('0x30')]=_['map'](_0x37e8fb,_0xf080('0x28'));_0xd1fdf9[_0xf080('0x31')]=_[_0xf080('0x32')](_0x2c580a[_0xf080('0x31')]);_0xd1fdf9[_0xf080('0x33')]=_[_0xf080('0x34')](_0xd1fdf9['model'],_0xd1fdf9[_0xf080('0x31')]);_0x353803[_0xf080('0x35')]=_[_0xf080('0x34')](_0xd1fdf9[_0xf080('0x30')],qs[_0xf080('0x36')](_0x2c580a[_0xf080('0x31')][_0xf080('0x36')]));_0x353803[_0xf080('0x35')]=_0x353803[_0xf080('0x35')][_0xf080('0x37')]?_0x353803[_0xf080('0x35')]:_0xd1fdf9['model'];if(!_0x2c580a['query'][_0xf080('0x38')]('nolimit')){_0x353803['limit']=qs['limit'](_0x2c580a['query'][_0xf080('0x1f')]);_0x353803[_0xf080('0x1e')]=qs['offset'](_0x2c580a[_0xf080('0x31')]['offset']);}_0x353803[_0xf080('0x39')]=qs['sort'](_0x2c580a['query'][_0xf080('0x3a')]);_0x353803[_0xf080('0x3b')]=qs['filters'](_['pick'](_0x2c580a[_0xf080('0x31')],_0xd1fdf9[_0xf080('0x33')]),_0x37e8fb);if(_0x2c580a[_0xf080('0x31')][_0xf080('0x3c')]){_0x353803[_0xf080('0x3b')]=_[_0xf080('0x3d')](_0x353803['where'],{'$or':_[_0xf080('0x2b')](_0x37e8fb,function(_0x44ec5b){if(_0x44ec5b['type']!==_0xf080('0x3e')){var _0x5c47aa={};_0x5c47aa[_0x44ec5b[_0xf080('0x28')]]={'$like':'%'+_0x2c580a[_0xf080('0x31')]['filter']+'%'};return _0x5c47aa;}})});}_0x353803=_[_0xf080('0x3d')]({},_0x353803,_0x2c580a[_0xf080('0x3f')]);var _0xfc6a19={'where':_0x353803[_0xf080('0x3b')]};return db[_0xf080('0x2c')]['count'](_0xfc6a19)['then'](function(_0x297b48){_0x16a900[_0xf080('0x40')]=_0x297b48;if(_0x2c580a[_0xf080('0x31')][_0xf080('0x41')]){_0x353803[_0xf080('0x42')]=[{'all':!![]}];}return db[_0xf080('0x2c')][_0xf080('0x43')](_0x353803);})[_0xf080('0x44')](function(_0x3b6577){_0x16a900[_0xf080('0x45')]=_0x3b6577;return _0x16a900;})[_0xf080('0x44')](respondWithFilteredResult(_0x197694,_0x353803))[_0xf080('0x46')](handleError(_0x197694,null));};exports[_0xf080('0x47')]=function(_0x441342,_0x35d4cb){var _0x2d9d6d={'raw':![],'where':{'id':_0x441342[_0xf080('0x48')]['id']}},_0x560887={};_0x560887[_0xf080('0x30')]=_['keys'](db[_0xf080('0x2c')][_0xf080('0x2d')]);_0x560887[_0xf080('0x31')]=_['keys'](_0x441342[_0xf080('0x31')]);_0x560887[_0xf080('0x33')]=_[_0xf080('0x34')](_0x560887[_0xf080('0x30')],_0x560887['query']);_0x2d9d6d['attributes']=_['intersection'](_0x560887[_0xf080('0x30')],qs['fields'](_0x441342['query'][_0xf080('0x36')]));_0x2d9d6d[_0xf080('0x35')]=_0x2d9d6d[_0xf080('0x35')][_0xf080('0x37')]?_0x2d9d6d[_0xf080('0x35')]:_0x560887['model'];if(_0x441342[_0xf080('0x31')][_0xf080('0x41')]){_0x2d9d6d['include']=[{'all':!![]}];}_0x2d9d6d=_[_0xf080('0x3d')]({},_0x2d9d6d,_0x441342['options']);return db['AnalyticFieldReport'][_0xf080('0x49')](_0x2d9d6d)['then'](handleEntityNotFound(_0x35d4cb,null))[_0xf080('0x44')](respondWithResult(_0x35d4cb,null))[_0xf080('0x46')](handleError(_0x35d4cb,null));};exports[_0xf080('0x4a')]=function(_0xec7c0b,_0x3c9aeb){return db[_0xf080('0x2c')][_0xf080('0x4a')](_0xec7c0b[_0xf080('0x4b')],{})['then'](respondWithResult(_0x3c9aeb,0xc9))[_0xf080('0x46')](handleError(_0x3c9aeb,null));};exports['bulkCreate']=function(_0x50bf9d,_0x3ffe7a){return db['AnalyticFieldReport']['bulkCreate'](_0x50bf9d[_0xf080('0x4b')],{'raw':![],'individualHooks':!![]})[_0xf080('0x44')](respondWithResult(_0x3ffe7a,0xc9))[_0xf080('0x46')](handleError(_0x3ffe7a,null));};exports['update']=function(_0x13d6ad,_0x31a694){if(_0x13d6ad[_0xf080('0x4b')]['id']){delete _0x13d6ad[_0xf080('0x4b')]['id'];}return db['AnalyticFieldReport'][_0xf080('0x49')]({'where':{'id':_0x13d6ad['params']['id']}})[_0xf080('0x44')](handleEntityNotFound(_0x31a694,null))[_0xf080('0x44')](saveUpdates(_0x13d6ad[_0xf080('0x4b')],null))[_0xf080('0x44')](respondWithResult(_0x31a694,null))[_0xf080('0x46')](handleError(_0x31a694,null));};exports[_0xf080('0x26')]=function(_0x5a0cb0,_0x3aedf6){return db[_0xf080('0x2c')][_0xf080('0x49')]({'where':{'id':_0x5a0cb0['params']['id']}})[_0xf080('0x44')](handleEntityNotFound(_0x3aedf6,null))[_0xf080('0x44')](removeEntity(_0x3aedf6,null))[_0xf080('0x46')](handleError(_0x3aedf6,null));};exports[_0xf080('0x4c')]=function(_0x4ccf55,_0x29eb60){return db[_0xf080('0x2c')]['destroy']({'where':{'id':_0x4ccf55['query'][_0xf080('0x4d')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x29eb60,0xcc))[_0xf080('0x46')](handleError(_0x29eb60,null));};exports[_0xf080('0x4e')]=function(_0x5bf735,_0x19b02a,_0x4a71ce){return db[_0xf080('0x4f')][_0xf080('0x50')]({'where':{'id':_0x5bf735[_0xf080('0x48')]['id']}})[_0xf080('0x44')](handleEntityNotFound(_0x19b02a,null))[_0xf080('0x44')](function(_0x234ede){if(_0x234ede){return db['sequelize'][_0xf080('0x51')](function(_0xfd1fa1){return db['AnalyticFieldReport']['destroy']({'where':{'CustomReportId':_0x5bf735[_0xf080('0x48')]['id']},'transaction':_0xfd1fa1})[_0xf080('0x44')](function(_0x3d02b9){var _0x3018bd=_[_0xf080('0x2b')](_0x5bf735['body'],function(_0x337cbb){delete _0x337cbb['id'];_0x337cbb[_0xf080('0x52')]=_0x5bf735[_0xf080('0x48')]['id'];return _0x337cbb;});return db[_0xf080('0x2c')][_0xf080('0x53')](_0x3018bd,{'transaction':_0xfd1fa1});});})[_0xf080('0x44')](function(){return db[_0xf080('0x2c')][_0xf080('0x43')]({'where':{'CustomReportId':_0x5bf735[_0xf080('0x48')]['id']}});});}})['then'](respondWithResult(_0x19b02a,null))[_0xf080('0x46')](handleError(_0x19b02a,null));}; \ No newline at end of file +var _0x6daf=['include','findAll','rows','catch','params','find','create','body','bulkCreate','destroy','bulkDestroy','addFields','findOne','sequelize','transaction','CustomReportId','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','error','stack','name','send','index','AnalyticFieldReport','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','filter','options','includeAll'];(function(_0x326ed1,_0x3c5fb9){var _0x21f9bd=function(_0x31baf0){while(--_0x31baf0){_0x326ed1['push'](_0x326ed1['shift']());}};_0x21f9bd(++_0x3c5fb9);}(_0x6daf,0xb0));var _0xf6da=function(_0xa91e8a,_0x36bacf){_0xa91e8a=_0xa91e8a-0x0;var _0x462b5a=_0x6daf[_0xa91e8a];return _0x462b5a;};'use strict';var emlformat=require(_0xf6da('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf6da('0x1'));var jsonpatch=require(_0xf6da('0x2'));var rp=require(_0xf6da('0x3'));var moment=require(_0xf6da('0x4'));var BPromise=require(_0xf6da('0x5'));var Mustache=require(_0xf6da('0x6'));var util=require(_0xf6da('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xf6da('0x8'));var ejs=require(_0xf6da('0x9'));var fs=require('fs');var fs_extra=require(_0xf6da('0xa'));var _=require(_0xf6da('0xb'));var squel=require(_0xf6da('0xc'));var crypto=require('crypto');var jsforce=require(_0xf6da('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf6da('0x8'));var querystring=require(_0xf6da('0xe'));var Papa=require(_0xf6da('0xf'));var Redis=require(_0xf6da('0x10'));var authService=require(_0xf6da('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xf6da('0x12'));var hardwareService=require(_0xf6da('0x13'));var logger=require(_0xf6da('0x14'))('api');var utils=require(_0xf6da('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf6da('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x32dd1c,_0x45ed4c){_0x45ed4c=_0x45ed4c||0xcc;return function(_0x5c3308){if(_0x5c3308){return _0x32dd1c['sendStatus'](_0x45ed4c);}return _0x32dd1c[_0xf6da('0x17')](_0x45ed4c)[_0xf6da('0x18')]();};}function respondWithResult(_0x5133ab,_0x1ea919){_0x1ea919=_0x1ea919||0xc8;return function(_0x22f3c1){if(_0x22f3c1){return _0x5133ab[_0xf6da('0x17')](_0x1ea919)[_0xf6da('0x19')](_0x22f3c1);}};}function respondWithFilteredResult(_0x6cd86f,_0x533388){return function(_0x3d0108){if(_0x3d0108){var _0x19f98d=typeof _0x533388[_0xf6da('0x1a')]==='undefined'&&typeof _0x533388[_0xf6da('0x1b')]===_0xf6da('0x1c');var _0xee889b=_0x3d0108[_0xf6da('0x1d')];var _0x5aa950=_0x19f98d?0x0:_0x533388['offset'];var _0x1201d2=_0x19f98d?_0x3d0108[_0xf6da('0x1d')]:_0x533388[_0xf6da('0x1a')]+_0x533388[_0xf6da('0x1b')];var _0x42ebd8;if(_0x1201d2>=_0xee889b){_0x1201d2=_0xee889b;_0x42ebd8=0xc8;}else{_0x42ebd8=0xce;}_0x6cd86f['status'](_0x42ebd8);return _0x6cd86f[_0xf6da('0x1e')](_0xf6da('0x1f'),_0x5aa950+'-'+_0x1201d2+'/'+_0xee889b)['json'](_0x3d0108);}return null;};}function patchUpdates(_0x17a776){return function(_0x13fd78){try{jsonpatch['apply'](_0x13fd78,_0x17a776,!![]);}catch(_0xcff682){return BPromise[_0xf6da('0x20')](_0xcff682);}return _0x13fd78[_0xf6da('0x21')]();};}function saveUpdates(_0x3f21a5,_0x10ab68){return function(_0x3ff58a){if(_0x3ff58a){return _0x3ff58a[_0xf6da('0x22')](_0x3f21a5)[_0xf6da('0x23')](function(_0x3737ca){return _0x3737ca;});}return null;};}function removeEntity(_0x268e37,_0x454925){return function(_0x1e74c1){if(_0x1e74c1){return _0x1e74c1['destroy']()[_0xf6da('0x23')](function(){_0x268e37[_0xf6da('0x17')](0xcc)[_0xf6da('0x18')]();});}};}function handleEntityNotFound(_0x1cc03a,_0x1d4648){return function(_0x436cc4){if(!_0x436cc4){_0x1cc03a['sendStatus'](0x194);}return _0x436cc4;};}function handleError(_0x3443dc,_0x1cdd20){_0x1cdd20=_0x1cdd20||0x1f4;return function(_0x471b6d){logger[_0xf6da('0x24')](_0x471b6d[_0xf6da('0x25')]);if(_0x471b6d[_0xf6da('0x26')]){delete _0x471b6d[_0xf6da('0x26')];}_0x3443dc['status'](_0x1cdd20)[_0xf6da('0x27')](_0x471b6d);};}exports[_0xf6da('0x28')]=function(_0x4ec381,_0x290313){var _0x2e6cb9={},_0x549815={},_0x350ab8={'count':0x0,'rows':[]};var _0x33f592=_['map'](db[_0xf6da('0x29')][_0xf6da('0x2a')],function(_0x28c243){return{'name':_0x28c243['fieldName'],'type':_0x28c243[_0xf6da('0x2b')][_0xf6da('0x2c')]};});_0x549815[_0xf6da('0x2d')]=_['map'](_0x33f592,_0xf6da('0x26'));_0x549815['query']=_[_0xf6da('0x2e')](_0x4ec381[_0xf6da('0x2f')]);_0x549815[_0xf6da('0x30')]=_[_0xf6da('0x31')](_0x549815['model'],_0x549815['query']);_0x2e6cb9[_0xf6da('0x32')]=_['intersection'](_0x549815[_0xf6da('0x2d')],qs['fields'](_0x4ec381[_0xf6da('0x2f')][_0xf6da('0x33')]));_0x2e6cb9[_0xf6da('0x32')]=_0x2e6cb9[_0xf6da('0x32')][_0xf6da('0x34')]?_0x2e6cb9[_0xf6da('0x32')]:_0x549815[_0xf6da('0x2d')];if(!_0x4ec381[_0xf6da('0x2f')][_0xf6da('0x35')](_0xf6da('0x36'))){_0x2e6cb9[_0xf6da('0x1b')]=qs['limit'](_0x4ec381[_0xf6da('0x2f')][_0xf6da('0x1b')]);_0x2e6cb9[_0xf6da('0x1a')]=qs['offset'](_0x4ec381[_0xf6da('0x2f')][_0xf6da('0x1a')]);}_0x2e6cb9[_0xf6da('0x37')]=qs[_0xf6da('0x38')](_0x4ec381[_0xf6da('0x2f')]['sort']);_0x2e6cb9[_0xf6da('0x39')]=qs[_0xf6da('0x30')](_[_0xf6da('0x3a')](_0x4ec381[_0xf6da('0x2f')],_0x549815[_0xf6da('0x30')]),_0x33f592);if(_0x4ec381['query']['filter']){_0x2e6cb9['where']=_[_0xf6da('0x3b')](_0x2e6cb9[_0xf6da('0x39')],{'$or':_[_0xf6da('0x3c')](_0x33f592,function(_0x5764ff){if(_0x5764ff[_0xf6da('0x2b')]!=='VIRTUAL'){var _0x5e1ea={};_0x5e1ea[_0x5764ff['name']]={'$like':'%'+_0x4ec381['query'][_0xf6da('0x3d')]+'%'};return _0x5e1ea;}})});}_0x2e6cb9=_[_0xf6da('0x3b')]({},_0x2e6cb9,_0x4ec381[_0xf6da('0x3e')]);var _0x5c36da={'where':_0x2e6cb9[_0xf6da('0x39')]};return db['AnalyticFieldReport'][_0xf6da('0x1d')](_0x5c36da)['then'](function(_0x35f385){_0x350ab8[_0xf6da('0x1d')]=_0x35f385;if(_0x4ec381['query'][_0xf6da('0x3f')]){_0x2e6cb9[_0xf6da('0x40')]=[{'all':!![]}];}return db[_0xf6da('0x29')][_0xf6da('0x41')](_0x2e6cb9);})[_0xf6da('0x23')](function(_0x1d5098){_0x350ab8[_0xf6da('0x42')]=_0x1d5098;return _0x350ab8;})[_0xf6da('0x23')](respondWithFilteredResult(_0x290313,_0x2e6cb9))[_0xf6da('0x43')](handleError(_0x290313,null));};exports['show']=function(_0x5df74b,_0x579554){var _0x22851c={'raw':![],'where':{'id':_0x5df74b[_0xf6da('0x44')]['id']}},_0x30cc76={};_0x30cc76[_0xf6da('0x2d')]=_[_0xf6da('0x2e')](db[_0xf6da('0x29')][_0xf6da('0x2a')]);_0x30cc76[_0xf6da('0x2f')]=_[_0xf6da('0x2e')](_0x5df74b[_0xf6da('0x2f')]);_0x30cc76[_0xf6da('0x30')]=_['intersection'](_0x30cc76[_0xf6da('0x2d')],_0x30cc76[_0xf6da('0x2f')]);_0x22851c[_0xf6da('0x32')]=_['intersection'](_0x30cc76[_0xf6da('0x2d')],qs[_0xf6da('0x33')](_0x5df74b[_0xf6da('0x2f')]['fields']));_0x22851c[_0xf6da('0x32')]=_0x22851c[_0xf6da('0x32')][_0xf6da('0x34')]?_0x22851c[_0xf6da('0x32')]:_0x30cc76['model'];if(_0x5df74b[_0xf6da('0x2f')]['includeAll']){_0x22851c[_0xf6da('0x40')]=[{'all':!![]}];}_0x22851c=_['merge']({},_0x22851c,_0x5df74b[_0xf6da('0x3e')]);return db['AnalyticFieldReport'][_0xf6da('0x45')](_0x22851c)[_0xf6da('0x23')](handleEntityNotFound(_0x579554,null))['then'](respondWithResult(_0x579554,null))[_0xf6da('0x43')](handleError(_0x579554,null));};exports[_0xf6da('0x46')]=function(_0x4dfdab,_0x1d01a3){return db['AnalyticFieldReport'][_0xf6da('0x46')](_0x4dfdab[_0xf6da('0x47')],{})[_0xf6da('0x23')](respondWithResult(_0x1d01a3,0xc9))[_0xf6da('0x43')](handleError(_0x1d01a3,null));};exports[_0xf6da('0x48')]=function(_0x5b8d5d,_0x515626){return db[_0xf6da('0x29')]['bulkCreate'](_0x5b8d5d[_0xf6da('0x47')],{'raw':![],'individualHooks':!![]})[_0xf6da('0x23')](respondWithResult(_0x515626,0xc9))[_0xf6da('0x43')](handleError(_0x515626,null));};exports[_0xf6da('0x22')]=function(_0x4d0907,_0x497bb6){if(_0x4d0907['body']['id']){delete _0x4d0907[_0xf6da('0x47')]['id'];}return db[_0xf6da('0x29')][_0xf6da('0x45')]({'where':{'id':_0x4d0907['params']['id']}})[_0xf6da('0x23')](handleEntityNotFound(_0x497bb6,null))[_0xf6da('0x23')](saveUpdates(_0x4d0907[_0xf6da('0x47')],null))[_0xf6da('0x23')](respondWithResult(_0x497bb6,null))[_0xf6da('0x43')](handleError(_0x497bb6,null));};exports[_0xf6da('0x49')]=function(_0x263a90,_0x1b09c9){return db[_0xf6da('0x29')]['find']({'where':{'id':_0x263a90[_0xf6da('0x44')]['id']}})[_0xf6da('0x23')](handleEntityNotFound(_0x1b09c9,null))['then'](removeEntity(_0x1b09c9,null))[_0xf6da('0x43')](handleError(_0x1b09c9,null));};exports[_0xf6da('0x4a')]=function(_0x9dd246,_0x5999a8){return db[_0xf6da('0x29')][_0xf6da('0x49')]({'where':{'id':_0x9dd246[_0xf6da('0x2f')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0xf6da('0x23')](respondWithResult(_0x5999a8,0xcc))[_0xf6da('0x43')](handleError(_0x5999a8,null));};exports[_0xf6da('0x4b')]=function(_0xec00d3,_0x3e3109,_0x162fd1){return db['AnalyticCustomReport'][_0xf6da('0x4c')]({'where':{'id':_0xec00d3[_0xf6da('0x44')]['id']}})[_0xf6da('0x23')](handleEntityNotFound(_0x3e3109,null))[_0xf6da('0x23')](function(_0xeb6cf7){if(_0xeb6cf7){return db[_0xf6da('0x4d')][_0xf6da('0x4e')](function(_0x53ebaf){return db['AnalyticFieldReport']['destroy']({'where':{'CustomReportId':_0xec00d3[_0xf6da('0x44')]['id']},'transaction':_0x53ebaf})[_0xf6da('0x23')](function(_0x214aaf){var _0x20d45c=_[_0xf6da('0x3c')](_0xec00d3['body'],function(_0x91b211){delete _0x91b211['id'];_0x91b211[_0xf6da('0x4f')]=_0xec00d3[_0xf6da('0x44')]['id'];return _0x91b211;});return db['AnalyticFieldReport']['bulkCreate'](_0x20d45c,{'transaction':_0x53ebaf});});})[_0xf6da('0x23')](function(){return db[_0xf6da('0x29')][_0xf6da('0x41')]({'where':{'CustomReportId':_0xec00d3[_0xf6da('0x44')]['id']}});});}})['then'](respondWithResult(_0x3e3109,null))[_0xf6da('0x43')](handleError(_0x3e3109,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 01a110c..179d355 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 _0x6e38=['request-promise','rimraf','../../config/environment','./analyticFieldReport.attributes','define','AnalyticFieldReport','analytics_report_fields','lodash','../../config/logger','api','moment','bluebird'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6e38,0x103));var _0x86e3=function(_0x32806d,_0x46e71b){_0x32806d=_0x32806d-0x0;var _0x437806=_0x6e38[_0x32806d];return _0x437806;};'use strict';var _=require(_0x86e3('0x0'));var util=require('util');var logger=require(_0x86e3('0x1'))(_0x86e3('0x2'));var moment=require(_0x86e3('0x3'));var BPromise=require(_0x86e3('0x4'));var rp=require(_0x86e3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x86e3('0x6'));var config=require(_0x86e3('0x7'));var attributes=require(_0x86e3('0x8'));module['exports']=function(_0x33a05a,_0x163eb9){return _0x33a05a[_0x86e3('0x9')](_0x86e3('0xa'),attributes,{'tableName':_0x86e3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x47d4=['moment','bluebird','request-promise','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','AnalyticFieldReport','analytics_report_fields','util','../../config/logger'];(function(_0x328b1c,_0xec0b4f){var _0x4dbeaa=function(_0x432519){while(--_0x432519){_0x328b1c['push'](_0x328b1c['shift']());}};_0x4dbeaa(++_0xec0b4f);}(_0x47d4,0x195));var _0x447d=function(_0x5e7c0c,_0x11c6c3){_0x5e7c0c=_0x5e7c0c-0x0;var _0x291695=_0x47d4[_0x5e7c0c];return _0x291695;};'use strict';var _=require('lodash');var util=require(_0x447d('0x0'));var logger=require(_0x447d('0x1'))('api');var moment=require(_0x447d('0x2'));var BPromise=require(_0x447d('0x3'));var rp=require(_0x447d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x447d('0x5'));var config=require(_0x447d('0x6'));var attributes=require(_0x447d('0x7'));module[_0x447d('0x8')]=function(_0xcb1d14,_0x1ed028){return _0xcb1d14['define'](_0x447d('0x9'),attributes,{'tableName':_0x447d('0xa'),'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 6f470e1..733a579 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 _0x43af=['message','catch','util','bluebird','ioredis','../../config/utils','../../config/logger','jayson/promise','http','info','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticFieldReport,\x20%s,\x20%s'];(function(_0xad57ee,_0x2823a6){var _0x3eaea9=function(_0x185650){while(--_0x185650){_0xad57ee['push'](_0xad57ee['shift']());}};_0x3eaea9(++_0x2823a6);}(_0x43af,0x162));var _0xf43a=function(_0x46af3f,_0x39c0dc){_0x46af3f=_0x46af3f-0x0;var _0x365cf8=_0x43af[_0x46af3f];return _0x365cf8;};'use strict';var _=require('lodash');var util=require(_0xf43a('0x0'));var moment=require('moment');var BPromise=require(_0xf43a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf43a('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xf43a('0x3'));var logger=require(_0xf43a('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf43a('0x5'));var client=jayson['client'][_0xf43a('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x2b13b9,_0x1c84cc,_0x2bbd09){return new BPromise(function(_0x4260c3,_0x15b7ed){return client['request'](_0x2b13b9,_0x2bbd09)['then'](function(_0x3d61c1){logger[_0xf43a('0x7')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1c84cc,_0xf43a('0x8'));logger[_0xf43a('0x9')](_0xf43a('0xa'),_0x1c84cc,_0xf43a('0x8'),JSON[_0xf43a('0xb')](_0x3d61c1));if(_0x3d61c1[_0xf43a('0xc')]){if(_0x3d61c1[_0xf43a('0xc')]['code']===0x1f4){logger[_0xf43a('0xc')](_0xf43a('0xd'),_0x1c84cc,_0x3d61c1[_0xf43a('0xc')][_0xf43a('0xe')]);return _0x15b7ed(_0x3d61c1['error']['message']);}logger[_0xf43a('0xc')](_0xf43a('0xd'),_0x1c84cc,_0x3d61c1[_0xf43a('0xc')][_0xf43a('0xe')]);return _0x4260c3(_0x3d61c1[_0xf43a('0xc')][_0xf43a('0xe')]);}else{logger[_0xf43a('0x7')](_0xf43a('0xd'),_0x1c84cc,_0xf43a('0x8'));_0x4260c3(_0x3d61c1['result'][_0xf43a('0xe')]);}})[_0xf43a('0xf')](function(_0x434442){logger[_0xf43a('0xc')](_0xf43a('0xd'),_0x1c84cc,_0x434442);_0x15b7ed(_0x434442);});});} \ No newline at end of file +var _0xb131=['bluebird','rpc','../../config/environment','AnalyticFieldReport,\x20%s,\x20%s','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb131,0x10c));var _0x1b13=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0xb131[_0x5a776b];return _0xbbef59;};'use strict';var _=require(_0x1b13('0x0'));var util=require(_0x1b13('0x1'));var moment=require('moment');var BPromise=require(_0x1b13('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1b13('0x3'));var config=require(_0x1b13('0x4'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2513b5,_0x5bcdbd,_0x14a2c9){return new BPromise(function(_0x5388b1,_0x187d6e){return client['request'](_0x2513b5,_0x14a2c9)['then'](function(_0x15754d){logger['info'](_0x1b13('0x5'),_0x5bcdbd,'request\x20sent');logger[_0x1b13('0x6')](_0x1b13('0x7'),_0x5bcdbd,_0x1b13('0x8'),JSON[_0x1b13('0x9')](_0x15754d));if(_0x15754d['error']){if(_0x15754d[_0x1b13('0xa')][_0x1b13('0xb')]===0x1f4){logger[_0x1b13('0xa')](_0x1b13('0x5'),_0x5bcdbd,_0x15754d[_0x1b13('0xa')][_0x1b13('0xc')]);return _0x187d6e(_0x15754d[_0x1b13('0xa')]['message']);}logger[_0x1b13('0xa')](_0x1b13('0x5'),_0x5bcdbd,_0x15754d['error'][_0x1b13('0xc')]);return _0x5388b1(_0x15754d[_0x1b13('0xa')]['message']);}else{logger[_0x1b13('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x5bcdbd,_0x1b13('0x8'));_0x5388b1(_0x15754d['result'][_0x1b13('0xc')]);}})[_0x1b13('0xe')](function(_0x4da4b3){logger[_0x1b13('0xa')](_0x1b13('0x5'),_0x5bcdbd,_0x4da4b3);_0x187d6e(_0x4da4b3);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 4a05630..514779b 100644 --- a/server/api/analyticFieldReport/index.js +++ b/server/api/analyticFieldReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0x3967c5,_0x321929){var _0x421d4c=function(_0xfc3b16){while(--_0xfc3b16){_0x3967c5['push'](_0x3967c5['shift']());}};_0x421d4c(++_0x321929);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router; \ No newline at end of file +var _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0x33d81c,_0x1c75c9){var _0x454e39=function(_0x4b2000){while(--_0x4b2000){_0x33d81c['push'](_0x33d81c['shift']());}};_0x454e39(++_0x1c75c9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js index 22b63cf..e59a5f7 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 _0x2b65=['sequelize','exports','STRING','name','TEXT'];(function(_0x31c19c,_0xbe4b70){var _0x1a87f7=function(_0x23cf92){while(--_0x23cf92){_0x31c19c['push'](_0x31c19c['shift']());}};_0x1a87f7(++_0xbe4b70);}(_0x2b65,0x131));var _0x52b6=function(_0x301064,_0x1985aa){_0x301064=_0x301064-0x0;var _0x5bc841=_0x2b65[_0x301064];return _0x5bc841;};'use strict';var Sequelize=require(_0x52b6('0x0'));module[_0x52b6('0x1')]={'name':{'type':Sequelize[_0x52b6('0x2')],'allowNull':![],'unique':_0x52b6('0x3')},'table':{'type':Sequelize[_0x52b6('0x2')]},'metric':{'type':Sequelize[_0x52b6('0x4')]},'description':{'type':Sequelize[_0x52b6('0x2')]}}; \ No newline at end of file +var _0x2cb0=['sequelize','exports','name','STRING','TEXT'];(function(_0x4f94d9,_0x50e691){var _0x1347ef=function(_0xe2cb19){while(--_0xe2cb19){_0x4f94d9['push'](_0x4f94d9['shift']());}};_0x1347ef(++_0x50e691);}(_0x2cb0,0x12c));var _0x02cb=function(_0x191dc6,_0x3293d8){_0x191dc6=_0x191dc6-0x0;var _0x1c19b7=_0x2cb0[_0x191dc6];return _0x1c19b7;};'use strict';var Sequelize=require(_0x02cb('0x0'));module[_0x02cb('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x02cb('0x2')},'table':{'type':Sequelize[_0x02cb('0x3')]},'metric':{'type':Sequelize[_0x02cb('0x4')]},'description':{'type':Sequelize[_0x02cb('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index e43564a..70eb2ff 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 _0x98a8=['../../mysqldb','end','status','json','undefined','count','offset','apply','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','name','send','index','map','AnalyticMetric','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','limit','order','sort','where','filters','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','length','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Metrics','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment'];(function(_0x45a141,_0xcee4b3){var _0xe94b79=function(_0x551fec){while(--_0x551fec){_0x45a141['push'](_0x45a141['shift']());}};_0xe94b79(++_0xcee4b3);}(_0x98a8,0x12c));var _0x898a=function(_0x3a99d4,_0x4c22e7){_0x3a99d4=_0x3a99d4-0x0;var _0x2fdf46=_0x98a8[_0x3a99d4];return _0x2fdf46;};'use strict';var emlformat=require(_0x898a('0x0'));var rimraf=require(_0x898a('0x1'));var zipdir=require(_0x898a('0x2'));var jsonpatch=require(_0x898a('0x3'));var rp=require(_0x898a('0x4'));var moment=require(_0x898a('0x5'));var BPromise=require(_0x898a('0x6'));var Mustache=require('mustache');var util=require(_0x898a('0x7'));var path=require(_0x898a('0x8'));var sox=require(_0x898a('0x9'));var csv=require(_0x898a('0xa'));var ejs=require(_0x898a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x898a('0xc'));var squel=require('squel');var crypto=require(_0x898a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x898a('0xe'));var toCsv=require(_0x898a('0xa'));var querystring=require(_0x898a('0xf'));var Papa=require(_0x898a('0x10'));var Redis=require(_0x898a('0x11'));var authService=require(_0x898a('0x12'));var qs=require(_0x898a('0x13'));var as=require(_0x898a('0x14'));var hardwareService=require(_0x898a('0x15'));var logger=require('../../config/logger')(_0x898a('0x16'));var utils=require('../../config/utils');var config=require(_0x898a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x898a('0x18'))['db'];function respondWithStatusCode(_0x2c76b7,_0x364a23){_0x364a23=_0x364a23||0xcc;return function(_0x5f5e06){if(_0x5f5e06){return _0x2c76b7['sendStatus'](_0x364a23);}return _0x2c76b7['status'](_0x364a23)[_0x898a('0x19')]();};}function respondWithResult(_0x1f5be4,_0xb24335){_0xb24335=_0xb24335||0xc8;return function(_0x116fbe){if(_0x116fbe){return _0x1f5be4[_0x898a('0x1a')](_0xb24335)[_0x898a('0x1b')](_0x116fbe);}};}function respondWithFilteredResult(_0x506023,_0x47033c){return function(_0x53a4b8){if(_0x53a4b8){var _0x3fec7a=typeof _0x47033c['offset']===_0x898a('0x1c')&&typeof _0x47033c['limit']===_0x898a('0x1c');var _0x56f8f9=_0x53a4b8[_0x898a('0x1d')];var _0x3197f7=_0x3fec7a?0x0:_0x47033c[_0x898a('0x1e')];var _0x4ddd4d=_0x3fec7a?_0x53a4b8[_0x898a('0x1d')]:_0x47033c['offset']+_0x47033c['limit'];var _0x3f8af4;if(_0x4ddd4d>=_0x56f8f9){_0x4ddd4d=_0x56f8f9;_0x3f8af4=0xc8;}else{_0x3f8af4=0xce;}_0x506023[_0x898a('0x1a')](_0x3f8af4);return _0x506023['set']('Content-Range',_0x3197f7+'-'+_0x4ddd4d+'/'+_0x56f8f9)[_0x898a('0x1b')](_0x53a4b8);}return null;};}function patchUpdates(_0x26449a){return function(_0x38a8f0){try{jsonpatch[_0x898a('0x1f')](_0x38a8f0,_0x26449a,!![]);}catch(_0x2da52d){return BPromise[_0x898a('0x20')](_0x2da52d);}return _0x38a8f0[_0x898a('0x21')]();};}function saveUpdates(_0x483212,_0x247cfc){return function(_0x50718e){if(_0x50718e){return _0x50718e[_0x898a('0x22')](_0x483212)[_0x898a('0x23')](function(_0x30495a){return _0x30495a;});}return null;};}function removeEntity(_0x310bfa,_0x4e254d){return function(_0x274cdf){if(_0x274cdf){return _0x274cdf[_0x898a('0x24')]()[_0x898a('0x23')](function(){var _0x32eca5=_0x274cdf[_0x898a('0x25')]({'plain':!![]});var _0x1426e3='Metrics';return db[_0x898a('0x26')]['destroy']({'where':{'type':_0x1426e3,'resourceId':_0x32eca5['id']}})['then'](function(){return _0x274cdf;});})['then'](function(){_0x310bfa[_0x898a('0x1a')](0xcc)[_0x898a('0x19')]();});}};}function handleEntityNotFound(_0x420b25,_0x40b3db){return function(_0x28ae6a){if(!_0x28ae6a){_0x420b25[_0x898a('0x27')](0x194);}return _0x28ae6a;};}function handleError(_0x398e98,_0xac1fc4){_0xac1fc4=_0xac1fc4||0x1f4;return function(_0xd31922){logger['error'](_0xd31922['stack']);if(_0xd31922['name']){delete _0xd31922[_0x898a('0x28')];}_0x398e98[_0x898a('0x1a')](_0xac1fc4)[_0x898a('0x29')](_0xd31922);};}exports[_0x898a('0x2a')]=function(_0x34f447,_0x560000){var _0xe3c983={},_0xf74645={},_0x18773a={'count':0x0,'rows':[]};var _0x4287da=_[_0x898a('0x2b')](db[_0x898a('0x2c')]['rawAttributes'],function(_0x7a1eb5){return{'name':_0x7a1eb5[_0x898a('0x2d')],'type':_0x7a1eb5[_0x898a('0x2e')][_0x898a('0x2f')]};});_0xf74645[_0x898a('0x30')]=_['map'](_0x4287da,'name');_0xf74645[_0x898a('0x31')]=_[_0x898a('0x32')](_0x34f447[_0x898a('0x31')]);_0xf74645['filters']=_[_0x898a('0x33')](_0xf74645[_0x898a('0x30')],_0xf74645[_0x898a('0x31')]);_0xe3c983[_0x898a('0x34')]=_[_0x898a('0x33')](_0xf74645[_0x898a('0x30')],qs[_0x898a('0x35')](_0x34f447[_0x898a('0x31')]['fields']));_0xe3c983[_0x898a('0x34')]=_0xe3c983['attributes']['length']?_0xe3c983[_0x898a('0x34')]:_0xf74645['model'];if(!_0x34f447[_0x898a('0x31')]['hasOwnProperty'](_0x898a('0x36'))){_0xe3c983['limit']=qs[_0x898a('0x37')](_0x34f447[_0x898a('0x31')][_0x898a('0x37')]);_0xe3c983['offset']=qs['offset'](_0x34f447['query'][_0x898a('0x1e')]);}_0xe3c983[_0x898a('0x38')]=qs['sort'](_0x34f447[_0x898a('0x31')][_0x898a('0x39')]);_0xe3c983[_0x898a('0x3a')]=qs[_0x898a('0x3b')](_['pick'](_0x34f447['query'],_0xf74645[_0x898a('0x3b')]),_0x4287da);if(_0x34f447[_0x898a('0x31')]['filter']){_0xe3c983['where']=_[_0x898a('0x3c')](_0xe3c983[_0x898a('0x3a')],{'$or':_[_0x898a('0x2b')](_0x4287da,function(_0xa45405){if(_0xa45405['type']!==_0x898a('0x3d')){var _0x369c02={};_0x369c02[_0xa45405['name']]={'$like':'%'+_0x34f447['query']['filter']+'%'};return _0x369c02;}})});}_0xe3c983=_[_0x898a('0x3c')]({},_0xe3c983,_0x34f447[_0x898a('0x3e')]);var _0x35d767={'where':_0xe3c983[_0x898a('0x3a')]};return db[_0x898a('0x2c')][_0x898a('0x1d')](_0x35d767)[_0x898a('0x23')](function(_0x1432ec){_0x18773a[_0x898a('0x1d')]=_0x1432ec;if(_0x34f447[_0x898a('0x31')][_0x898a('0x3f')]){_0xe3c983[_0x898a('0x40')]=[{'all':!![]}];}return db[_0x898a('0x2c')][_0x898a('0x41')](_0xe3c983);})[_0x898a('0x23')](function(_0x4c8628){_0x18773a[_0x898a('0x42')]=_0x4c8628;return _0x18773a;})[_0x898a('0x23')](respondWithFilteredResult(_0x560000,_0xe3c983))[_0x898a('0x43')](handleError(_0x560000,null));};exports['show']=function(_0x34029e,_0x2e5451){var _0x3a8663={'raw':!![],'where':{'id':_0x34029e[_0x898a('0x44')]['id']}},_0x6ab441={};_0x6ab441[_0x898a('0x30')]=_[_0x898a('0x32')](db[_0x898a('0x2c')]['rawAttributes']);_0x6ab441[_0x898a('0x31')]=_[_0x898a('0x32')](_0x34029e[_0x898a('0x31')]);_0x6ab441[_0x898a('0x3b')]=_['intersection'](_0x6ab441[_0x898a('0x30')],_0x6ab441[_0x898a('0x31')]);_0x3a8663['attributes']=_[_0x898a('0x33')](_0x6ab441['model'],qs[_0x898a('0x35')](_0x34029e['query']['fields']));_0x3a8663[_0x898a('0x34')]=_0x3a8663['attributes'][_0x898a('0x45')]?_0x3a8663[_0x898a('0x34')]:_0x6ab441['model'];if(_0x34029e[_0x898a('0x31')][_0x898a('0x3f')]){_0x3a8663['include']=[{'all':!![]}];}_0x3a8663=_[_0x898a('0x3c')]({},_0x3a8663,_0x34029e[_0x898a('0x3e')]);return db[_0x898a('0x2c')][_0x898a('0x46')](_0x3a8663)['then'](handleEntityNotFound(_0x2e5451,null))[_0x898a('0x23')](respondWithResult(_0x2e5451,null))[_0x898a('0x43')](handleError(_0x2e5451,null));};exports['create']=function(_0x25adcc,_0x1d8c16){return db['AnalyticMetric'][_0x898a('0x47')](_0x25adcc['body'],{})[_0x898a('0x23')](function(_0x41f291){var _0x32ccb9=_0x25adcc['user'][_0x898a('0x25')]({'plain':!![]});if(!_0x32ccb9)throw new Error(_0x898a('0x48'));if(_0x32ccb9[_0x898a('0x49')]===_0x898a('0x4a')){var _0x5a8a2c=_0x41f291[_0x898a('0x25')]({'plain':!![]});var _0x529d7c=_0x898a('0x4b');return db[_0x898a('0x4c')][_0x898a('0x46')]({'where':{'name':_0x529d7c,'userProfileId':_0x32ccb9['userProfileId']},'raw':!![]})[_0x898a('0x23')](function(_0x3c4db0){if(_0x3c4db0&&_0x3c4db0[_0x898a('0x4d')]===0x0){return db['UserProfileResource']['create']({'name':_0x5a8a2c[_0x898a('0x28')],'resourceId':_0x5a8a2c['id'],'type':_0x3c4db0[_0x898a('0x28')],'sectionId':_0x3c4db0['id']},{})[_0x898a('0x23')](function(){return _0x41f291;});}else{return _0x41f291;}})[_0x898a('0x43')](function(_0x28b8c9){logger[_0x898a('0x4e')](_0x898a('0x4f'),_0x28b8c9);throw _0x28b8c9;});}return _0x41f291;})[_0x898a('0x23')](respondWithResult(_0x1d8c16,0xc9))[_0x898a('0x43')](handleError(_0x1d8c16,null));};exports[_0x898a('0x22')]=function(_0x2382a9,_0x5e9329){if(_0x2382a9[_0x898a('0x50')]['id']){delete _0x2382a9[_0x898a('0x50')]['id'];}return db['AnalyticMetric'][_0x898a('0x46')]({'where':{'id':_0x2382a9['params']['id']}})['then'](handleEntityNotFound(_0x5e9329,null))[_0x898a('0x23')](saveUpdates(_0x2382a9[_0x898a('0x50')],null))[_0x898a('0x23')](respondWithResult(_0x5e9329,null))['catch'](handleError(_0x5e9329,null));};exports['destroy']=function(_0x11a07a,_0x1f5e4b){return db['AnalyticMetric'][_0x898a('0x46')]({'where':{'id':_0x11a07a[_0x898a('0x44')]['id']}})['then'](handleEntityNotFound(_0x1f5e4b,null))[_0x898a('0x23')](removeEntity(_0x1f5e4b,null))[_0x898a('0x43')](handleError(_0x1f5e4b,null));}; \ No newline at end of file +var _0xe5b3=['undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','type','keys','query','filters','intersection','model','attributes','fields','length','nolimit','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','params','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json'];(function(_0x1a1bf0,_0xa3dfbc){var _0x569391=function(_0x596a29){while(--_0x596a29){_0x1a1bf0['push'](_0x1a1bf0['shift']());}};_0x569391(++_0xa3dfbc);}(_0xe5b3,0x133));var _0x3e5b=function(_0x4d52c8,_0x510e8b){_0x4d52c8=_0x4d52c8-0x0;var _0x44e6df=_0xe5b3[_0x4d52c8];return _0x44e6df;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3e5b('0x0'));var zipdir=require(_0x3e5b('0x1'));var jsonpatch=require(_0x3e5b('0x2'));var rp=require(_0x3e5b('0x3'));var moment=require(_0x3e5b('0x4'));var BPromise=require(_0x3e5b('0x5'));var Mustache=require(_0x3e5b('0x6'));var util=require(_0x3e5b('0x7'));var path=require(_0x3e5b('0x8'));var sox=require(_0x3e5b('0x9'));var csv=require(_0x3e5b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3e5b('0xb'));var _=require(_0x3e5b('0xc'));var squel=require('squel');var crypto=require(_0x3e5b('0xd'));var jsforce=require(_0x3e5b('0xe'));var deskjs=require(_0x3e5b('0xf'));var toCsv=require(_0x3e5b('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3e5b('0x10'));var authService=require(_0x3e5b('0x11'));var qs=require(_0x3e5b('0x12'));var as=require(_0x3e5b('0x13'));var hardwareService=require(_0x3e5b('0x14'));var logger=require('../../config/logger')(_0x3e5b('0x15'));var utils=require('../../config/utils');var config=require(_0x3e5b('0x16'));var licenseUtil=require(_0x3e5b('0x17'));var db=require(_0x3e5b('0x18'))['db'];function respondWithStatusCode(_0x374068,_0x20b97b){_0x20b97b=_0x20b97b||0xcc;return function(_0x3c4eb1){if(_0x3c4eb1){return _0x374068[_0x3e5b('0x19')](_0x20b97b);}return _0x374068['status'](_0x20b97b)[_0x3e5b('0x1a')]();};}function respondWithResult(_0x5f2f9c,_0x51a188){_0x51a188=_0x51a188||0xc8;return function(_0x4d71a3){if(_0x4d71a3){return _0x5f2f9c[_0x3e5b('0x1b')](_0x51a188)[_0x3e5b('0x1c')](_0x4d71a3);}};}function respondWithFilteredResult(_0x17aaa3,_0x4fb471){return function(_0x1f81a7){if(_0x1f81a7){var _0x59ddc0=typeof _0x4fb471['offset']===_0x3e5b('0x1d')&&typeof _0x4fb471[_0x3e5b('0x1e')]==='undefined';var _0x3d58a4=_0x1f81a7[_0x3e5b('0x1f')];var _0x555002=_0x59ddc0?0x0:_0x4fb471[_0x3e5b('0x20')];var _0x3365dd=_0x59ddc0?_0x1f81a7['count']:_0x4fb471['offset']+_0x4fb471[_0x3e5b('0x1e')];var _0x20806a;if(_0x3365dd>=_0x3d58a4){_0x3365dd=_0x3d58a4;_0x20806a=0xc8;}else{_0x20806a=0xce;}_0x17aaa3[_0x3e5b('0x1b')](_0x20806a);return _0x17aaa3[_0x3e5b('0x21')](_0x3e5b('0x22'),_0x555002+'-'+_0x3365dd+'/'+_0x3d58a4)[_0x3e5b('0x1c')](_0x1f81a7);}return null;};}function patchUpdates(_0x447d36){return function(_0x21fc32){try{jsonpatch[_0x3e5b('0x23')](_0x21fc32,_0x447d36,!![]);}catch(_0x3d95f3){return BPromise[_0x3e5b('0x24')](_0x3d95f3);}return _0x21fc32[_0x3e5b('0x25')]();};}function saveUpdates(_0x2d77cc,_0x402873){return function(_0x5b46d4){if(_0x5b46d4){return _0x5b46d4[_0x3e5b('0x26')](_0x2d77cc)[_0x3e5b('0x27')](function(_0x2146d4){return _0x2146d4;});}return null;};}function removeEntity(_0x150674,_0x50039b){return function(_0x1eb80f){if(_0x1eb80f){return _0x1eb80f['destroy']()[_0x3e5b('0x27')](function(){var _0x36d960=_0x1eb80f['get']({'plain':!![]});var _0x41b684=_0x3e5b('0x28');return db[_0x3e5b('0x29')][_0x3e5b('0x2a')]({'where':{'type':_0x41b684,'resourceId':_0x36d960['id']}})[_0x3e5b('0x27')](function(){return _0x1eb80f;});})[_0x3e5b('0x27')](function(){_0x150674[_0x3e5b('0x1b')](0xcc)[_0x3e5b('0x1a')]();});}};}function handleEntityNotFound(_0x4c4b89,_0x1c7278){return function(_0x505f40){if(!_0x505f40){_0x4c4b89[_0x3e5b('0x19')](0x194);}return _0x505f40;};}function handleError(_0x4fd64b,_0x101653){_0x101653=_0x101653||0x1f4;return function(_0x1f6473){logger[_0x3e5b('0x2b')](_0x1f6473[_0x3e5b('0x2c')]);if(_0x1f6473[_0x3e5b('0x2d')]){delete _0x1f6473[_0x3e5b('0x2d')];}_0x4fd64b[_0x3e5b('0x1b')](_0x101653)[_0x3e5b('0x2e')](_0x1f6473);};}exports[_0x3e5b('0x2f')]=function(_0x112dc0,_0x1e1565){var _0x489221={},_0x21bc10={},_0x1882aa={'count':0x0,'rows':[]};var _0xa8760b=_[_0x3e5b('0x30')](db[_0x3e5b('0x31')][_0x3e5b('0x32')],function(_0x345927){return{'name':_0x345927['fieldName'],'type':_0x345927[_0x3e5b('0x33')]['key']};});_0x21bc10['model']=_[_0x3e5b('0x30')](_0xa8760b,_0x3e5b('0x2d'));_0x21bc10['query']=_[_0x3e5b('0x34')](_0x112dc0[_0x3e5b('0x35')]);_0x21bc10[_0x3e5b('0x36')]=_[_0x3e5b('0x37')](_0x21bc10[_0x3e5b('0x38')],_0x21bc10[_0x3e5b('0x35')]);_0x489221[_0x3e5b('0x39')]=_[_0x3e5b('0x37')](_0x21bc10[_0x3e5b('0x38')],qs[_0x3e5b('0x3a')](_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x3a')]));_0x489221['attributes']=_0x489221[_0x3e5b('0x39')][_0x3e5b('0x3b')]?_0x489221['attributes']:_0x21bc10['model'];if(!_0x112dc0[_0x3e5b('0x35')]['hasOwnProperty'](_0x3e5b('0x3c'))){_0x489221[_0x3e5b('0x1e')]=qs[_0x3e5b('0x1e')](_0x112dc0[_0x3e5b('0x35')]['limit']);_0x489221[_0x3e5b('0x20')]=qs['offset'](_0x112dc0[_0x3e5b('0x35')]['offset']);}_0x489221['order']=qs['sort'](_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x3d')]);_0x489221[_0x3e5b('0x3e')]=qs[_0x3e5b('0x36')](_[_0x3e5b('0x3f')](_0x112dc0[_0x3e5b('0x35')],_0x21bc10['filters']),_0xa8760b);if(_0x112dc0['query']['filter']){_0x489221['where']=_['merge'](_0x489221['where'],{'$or':_['map'](_0xa8760b,function(_0x182bc4){if(_0x182bc4[_0x3e5b('0x33')]!==_0x3e5b('0x40')){var _0x1aafd5={};_0x1aafd5[_0x182bc4[_0x3e5b('0x2d')]]={'$like':'%'+_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x41')]+'%'};return _0x1aafd5;}})});}_0x489221=_[_0x3e5b('0x42')]({},_0x489221,_0x112dc0[_0x3e5b('0x43')]);var _0xbbc6b={'where':_0x489221[_0x3e5b('0x3e')]};return db['AnalyticMetric'][_0x3e5b('0x1f')](_0xbbc6b)[_0x3e5b('0x27')](function(_0x1e8075){_0x1882aa[_0x3e5b('0x1f')]=_0x1e8075;if(_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x44')]){_0x489221[_0x3e5b('0x45')]=[{'all':!![]}];}return db[_0x3e5b('0x31')][_0x3e5b('0x46')](_0x489221);})[_0x3e5b('0x27')](function(_0x13c8d5){_0x1882aa['rows']=_0x13c8d5;return _0x1882aa;})['then'](respondWithFilteredResult(_0x1e1565,_0x489221))['catch'](handleError(_0x1e1565,null));};exports['show']=function(_0xa99d75,_0x21ee8a){var _0x9fc025={'raw':!![],'where':{'id':_0xa99d75[_0x3e5b('0x47')]['id']}},_0x24c416={};_0x24c416[_0x3e5b('0x38')]=_[_0x3e5b('0x34')](db[_0x3e5b('0x31')][_0x3e5b('0x32')]);_0x24c416[_0x3e5b('0x35')]=_['keys'](_0xa99d75[_0x3e5b('0x35')]);_0x24c416[_0x3e5b('0x36')]=_[_0x3e5b('0x37')](_0x24c416[_0x3e5b('0x38')],_0x24c416[_0x3e5b('0x35')]);_0x9fc025['attributes']=_['intersection'](_0x24c416['model'],qs[_0x3e5b('0x3a')](_0xa99d75[_0x3e5b('0x35')][_0x3e5b('0x3a')]));_0x9fc025['attributes']=_0x9fc025['attributes'][_0x3e5b('0x3b')]?_0x9fc025[_0x3e5b('0x39')]:_0x24c416[_0x3e5b('0x38')];if(_0xa99d75['query']['includeAll']){_0x9fc025[_0x3e5b('0x45')]=[{'all':!![]}];}_0x9fc025=_['merge']({},_0x9fc025,_0xa99d75[_0x3e5b('0x43')]);return db[_0x3e5b('0x31')][_0x3e5b('0x48')](_0x9fc025)[_0x3e5b('0x27')](handleEntityNotFound(_0x21ee8a,null))[_0x3e5b('0x27')](respondWithResult(_0x21ee8a,null))[_0x3e5b('0x49')](handleError(_0x21ee8a,null));};exports[_0x3e5b('0x4a')]=function(_0x3ea5aa,_0x339852){return db['AnalyticMetric'][_0x3e5b('0x4a')](_0x3ea5aa['body'],{})[_0x3e5b('0x27')](function(_0x2e7047){var _0x26e11e=_0x3ea5aa[_0x3e5b('0x4b')][_0x3e5b('0x4c')]({'plain':!![]});if(!_0x26e11e)throw new Error(_0x3e5b('0x4d'));if(_0x26e11e[_0x3e5b('0x4e')]===_0x3e5b('0x4b')){var _0x2b5d3d=_0x2e7047[_0x3e5b('0x4c')]({'plain':!![]});var _0xf6ca5b=_0x3e5b('0x28');return db[_0x3e5b('0x4f')]['find']({'where':{'name':_0xf6ca5b,'userProfileId':_0x26e11e[_0x3e5b('0x50')]},'raw':!![]})[_0x3e5b('0x27')](function(_0x2ca33b){if(_0x2ca33b&&_0x2ca33b[_0x3e5b('0x51')]===0x0){return db[_0x3e5b('0x29')][_0x3e5b('0x4a')]({'name':_0x2b5d3d['name'],'resourceId':_0x2b5d3d['id'],'type':_0x2ca33b[_0x3e5b('0x2d')],'sectionId':_0x2ca33b['id']},{})[_0x3e5b('0x27')](function(){return _0x2e7047;});}else{return _0x2e7047;}})[_0x3e5b('0x49')](function(_0x314d42){logger[_0x3e5b('0x2b')](_0x3e5b('0x52'),_0x314d42);throw _0x314d42;});}return _0x2e7047;})[_0x3e5b('0x27')](respondWithResult(_0x339852,0xc9))[_0x3e5b('0x49')](handleError(_0x339852,null));};exports['update']=function(_0x1e6403,_0x5e702f){if(_0x1e6403['body']['id']){delete _0x1e6403[_0x3e5b('0x53')]['id'];}return db['AnalyticMetric'][_0x3e5b('0x48')]({'where':{'id':_0x1e6403[_0x3e5b('0x47')]['id']}})[_0x3e5b('0x27')](handleEntityNotFound(_0x5e702f,null))[_0x3e5b('0x27')](saveUpdates(_0x1e6403['body'],null))['then'](respondWithResult(_0x5e702f,null))['catch'](handleError(_0x5e702f,null));};exports['destroy']=function(_0x2ab5f3,_0x999518){return db[_0x3e5b('0x31')][_0x3e5b('0x48')]({'where':{'id':_0x2ab5f3[_0x3e5b('0x47')]['id']}})['then'](handleEntityNotFound(_0x999518,null))['then'](removeEntity(_0x999518,null))[_0x3e5b('0x49')](handleError(_0x999518,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 64553c1..948dc4d 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 _0x31af=['define','AnalyticMetric','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./analyticMetric.attributes'];(function(_0x46a408,_0x1c0c36){var _0x4167f6=function(_0x40fcb9){while(--_0x40fcb9){_0x46a408['push'](_0x46a408['shift']());}};_0x4167f6(++_0x1c0c36);}(_0x31af,0xde));var _0xf31a=function(_0x1880f1,_0x1674f1){_0x1880f1=_0x1880f1-0x0;var _0x1d9a9d=_0x31af[_0x1880f1];return _0x1d9a9d;};'use strict';var _=require(_0xf31a('0x0'));var util=require(_0xf31a('0x1'));var logger=require(_0xf31a('0x2'))('api');var moment=require('moment');var BPromise=require(_0xf31a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf31a('0x4'));var rimraf=require(_0xf31a('0x5'));var config=require(_0xf31a('0x6'));var attributes=require(_0xf31a('0x7'));module['exports']=function(_0x8d7853,_0x209fcc){return _0x8d7853[_0xf31a('0x8')](_0xf31a('0x9'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc359=['analytics_metrics','util','api','moment','bluebird','path','../../config/environment','exports'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0xc359,0x1d9));var _0x9c35=function(_0x2dd615,_0x18099c){_0x2dd615=_0x2dd615-0x0;var _0x5255a4=_0xc359[_0x2dd615];return _0x5255a4;};'use strict';var _=require('lodash');var util=require(_0x9c35('0x0'));var logger=require('../../config/logger')(_0x9c35('0x1'));var moment=require(_0x9c35('0x2'));var BPromise=require(_0x9c35('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9c35('0x4'));var rimraf=require('rimraf');var config=require(_0x9c35('0x5'));var attributes=require('./analyticMetric.attributes');module[_0x9c35('0x6')]=function(_0x5b3ada,_0x490409){return _0x5b3ada['define']('AnalyticMetric',attributes,{'tableName':_0x9c35('0x7'),'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 efa2af7..217ee15 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 _0xad95=['code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5047bd,_0x5b5c25){var _0xd3b157=function(_0x1a38ff){while(--_0x1a38ff){_0x5047bd['push'](_0x5047bd['shift']());}};_0xd3b157(++_0x5b5c25);}(_0xad95,0x10b));var _0x5ad9=function(_0x20f983,_0xbedd89){_0x20f983=_0x20f983-0x0;var _0x4c4063=_0xad95[_0x20f983];return _0x4c4063;};'use strict';var _=require(_0x5ad9('0x0'));var util=require(_0x5ad9('0x1'));var moment=require(_0x5ad9('0x2'));var BPromise=require('bluebird');var rs=require(_0x5ad9('0x3'));var fs=require('fs');var Redis=require(_0x5ad9('0x4'));var db=require(_0x5ad9('0x5'))['db'];var utils=require(_0x5ad9('0x6'));var logger=require('../../config/logger')(_0x5ad9('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5ad9('0x8')][_0x5ad9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4d2ec8,_0x586c82,_0x17d441){return new BPromise(function(_0x27f0eb,_0x1cc16d){return client[_0x5ad9('0xa')](_0x4d2ec8,_0x17d441)[_0x5ad9('0xb')](function(_0x34d058){logger[_0x5ad9('0xc')](_0x5ad9('0xd'),_0x586c82,_0x5ad9('0xe'));logger[_0x5ad9('0xf')](_0x5ad9('0x10'),_0x586c82,'request\x20sent',JSON[_0x5ad9('0x11')](_0x34d058));if(_0x34d058['error']){if(_0x34d058[_0x5ad9('0x12')][_0x5ad9('0x13')]===0x1f4){logger['error'](_0x5ad9('0xd'),_0x586c82,_0x34d058['error'][_0x5ad9('0x14')]);return _0x1cc16d(_0x34d058[_0x5ad9('0x12')][_0x5ad9('0x14')]);}logger[_0x5ad9('0x12')](_0x5ad9('0xd'),_0x586c82,_0x34d058[_0x5ad9('0x12')][_0x5ad9('0x14')]);return _0x27f0eb(_0x34d058[_0x5ad9('0x12')]['message']);}else{logger[_0x5ad9('0xc')]('AnalyticMetric,\x20%s,\x20%s',_0x586c82,_0x5ad9('0xe'));_0x27f0eb(_0x34d058[_0x5ad9('0x15')][_0x5ad9('0x14')]);}})['catch'](function(_0x984ddb){logger[_0x5ad9('0x12')](_0x5ad9('0xd'),_0x586c82,_0x984ddb);_0x1cc16d(_0x984ddb);});});} \ No newline at end of file +var _0x6217=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','AnalyticMetric,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6217,0x16c));var _0x7621=function(_0x21a2b3,_0x5d6564){_0x21a2b3=_0x21a2b3-0x0;var _0x4651a7=_0x6217[_0x21a2b3];return _0x4651a7;};'use strict';var _=require(_0x7621('0x0'));var util=require(_0x7621('0x1'));var moment=require(_0x7621('0x2'));var BPromise=require('bluebird');var rs=require(_0x7621('0x3'));var fs=require('fs');var Redis=require(_0x7621('0x4'));var db=require(_0x7621('0x5'))['db'];var utils=require(_0x7621('0x6'));var logger=require(_0x7621('0x7'))(_0x7621('0x8'));var config=require(_0x7621('0x9'));var jayson=require(_0x7621('0xa'));var client=jayson[_0x7621('0xb')][_0x7621('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5c35b3,_0x4dc902,_0x478694){return new BPromise(function(_0x252890,_0x1f4b38){return client['request'](_0x5c35b3,_0x478694)['then'](function(_0x5a5027){logger[_0x7621('0xd')]('AnalyticMetric,\x20%s,\x20%s',_0x4dc902,'request\x20sent');logger[_0x7621('0xe')](_0x7621('0xf'),_0x4dc902,_0x7621('0x10'),JSON[_0x7621('0x11')](_0x5a5027));if(_0x5a5027['error']){if(_0x5a5027[_0x7621('0x12')]['code']===0x1f4){logger[_0x7621('0x12')](_0x7621('0x13'),_0x4dc902,_0x5a5027['error'][_0x7621('0x14')]);return _0x1f4b38(_0x5a5027[_0x7621('0x12')][_0x7621('0x14')]);}logger['error'](_0x7621('0x13'),_0x4dc902,_0x5a5027['error'][_0x7621('0x14')]);return _0x252890(_0x5a5027[_0x7621('0x12')][_0x7621('0x14')]);}else{logger[_0x7621('0xd')](_0x7621('0x13'),_0x4dc902,_0x7621('0x10'));_0x252890(_0x5a5027[_0x7621('0x15')][_0x7621('0x14')]);}})[_0x7621('0x16')](function(_0x2d0faa){logger[_0x7621('0x12')]('AnalyticMetric,\x20%s,\x20%s',_0x4dc902,_0x2d0faa);_0x1f4b38(_0x2d0faa);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 9fd3896..83995c8 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 _0x88d5=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','show','post','create','/:id','update','delete','destroy','exports','multer','util'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x88d5,0x76));var _0x588d=function(_0x75b0d9,_0x40dd78){_0x75b0d9=_0x75b0d9-0x0;var _0x324713=_0x88d5[_0x75b0d9];return _0x324713;};'use strict';var multer=require(_0x588d('0x0'));var util=require(_0x588d('0x1'));var path=require(_0x588d('0x2'));var timeout=require(_0x588d('0x3'));var express=require(_0x588d('0x4'));var router=express['Router']();var fs_extra=require(_0x588d('0x5'));var auth=require(_0x588d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x588d('0x7'));var controller=require(_0x588d('0x8'));router[_0x588d('0x9')]('/',auth[_0x588d('0xa')](),controller[_0x588d('0xb')]);router[_0x588d('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x588d('0xc')]);router[_0x588d('0xd')]('/',auth[_0x588d('0xa')](),controller[_0x588d('0xe')]);router['put'](_0x588d('0xf'),auth['isAuthenticated'](),controller[_0x588d('0x10')]);router[_0x588d('0x11')]('/:id',auth[_0x588d('0xa')](),controller[_0x588d('0x12')]);module[_0x588d('0x13')]=router; \ No newline at end of file +var _0x1629=['index','get','/:id','show','put','update','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x5b9588,_0x9266b5){var _0x273454=function(_0x3909fb){while(--_0x3909fb){_0x5b9588['push'](_0x5b9588['shift']());}};_0x273454(++_0x9266b5);}(_0x1629,0x1d8));var _0x9162=function(_0x4036b6,_0x8f6b0c){_0x4036b6=_0x4036b6-0x0;var _0xa26364=_0x1629[_0x4036b6];return _0xa26364;};'use strict';var multer=require(_0x9162('0x0'));var util=require(_0x9162('0x1'));var path=require(_0x9162('0x2'));var timeout=require(_0x9162('0x3'));var express=require('express');var router=express[_0x9162('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x9162('0x5'));var config=require(_0x9162('0x6'));var controller=require('./analyticMetric.controller');router['get']('/',auth[_0x9162('0x7')](),controller[_0x9162('0x8')]);router[_0x9162('0x9')](_0x9162('0xa'),auth[_0x9162('0x7')](),controller[_0x9162('0xb')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x9162('0xc')](_0x9162('0xa'),auth[_0x9162('0x7')](),controller[_0x9162('0xd')]);router['delete'](_0x9162('0xa'),auth[_0x9162('0x7')](),controller['destroy']);module[_0x9162('0xe')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 9e64afb..bc07643 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. * // * * // ************************************************************************* -'use strict';var Sequelize=require('sequelize');module['exports']={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file +var _0xe362=['TEXT','sequelize','exports'];(function(_0x58d0bf,_0x407493){var _0x31aa59=function(_0x15ff36){while(--_0x15ff36){_0x58d0bf['push'](_0x58d0bf['shift']());}};_0x31aa59(++_0x407493);}(_0xe362,0x136));var _0x2e36=function(_0x3292d2,_0x54267b){_0x3292d2=_0x3292d2-0x0;var _0x105d99=_0xe362[_0x3292d2];return _0x105d99;};'use strict';var Sequelize=require(_0x2e36('0x0'));module[_0x2e36('0x1')]={'tree':{'type':Sequelize[_0x2e36('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 88f9af0..47b1eb2 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 _0x29aa=['rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','destroy','then','error','stack','name','send','index','AnalyticTreeReport','fieldName','key','map','query','keys','filters','attributes','model','fields','length','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','intersection','create','body','update','find','eml-format'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x29aa,0x1c1));var _0xa29a=function(_0x288617,_0x2f1e1e){_0x288617=_0x288617-0x0;var _0x507440=_0x29aa[_0x288617];return _0x507440;};'use strict';var emlformat=require(_0xa29a('0x0'));var rimraf=require(_0xa29a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa29a('0x2'));var rp=require(_0xa29a('0x3'));var moment=require('moment');var BPromise=require(_0xa29a('0x4'));var Mustache=require(_0xa29a('0x5'));var util=require(_0xa29a('0x6'));var path=require(_0xa29a('0x7'));var sox=require(_0xa29a('0x8'));var csv=require(_0xa29a('0x9'));var ejs=require(_0xa29a('0xa'));var fs=require('fs');var fs_extra=require(_0xa29a('0xb'));var _=require('lodash');var squel=require(_0xa29a('0xc'));var crypto=require(_0xa29a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa29a('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa29a('0xf'));var Papa=require(_0xa29a('0x10'));var Redis=require(_0xa29a('0x11'));var authService=require(_0xa29a('0x12'));var qs=require(_0xa29a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa29a('0x14'))('api');var utils=require(_0xa29a('0x15'));var config=require(_0xa29a('0x16'));var licenseUtil=require(_0xa29a('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5212a0,_0x15cb8c){_0x15cb8c=_0x15cb8c||0xcc;return function(_0x3273a6){if(_0x3273a6){return _0x5212a0[_0xa29a('0x18')](_0x15cb8c);}return _0x5212a0[_0xa29a('0x19')](_0x15cb8c)[_0xa29a('0x1a')]();};}function respondWithResult(_0x35317f,_0x9a0e3){_0x9a0e3=_0x9a0e3||0xc8;return function(_0x454ebc){if(_0x454ebc){return _0x35317f[_0xa29a('0x19')](_0x9a0e3)[_0xa29a('0x1b')](_0x454ebc);}};}function respondWithFilteredResult(_0x383813,_0x4d49d7){return function(_0x1402c1){if(_0x1402c1){var _0x16db36=typeof _0x4d49d7[_0xa29a('0x1c')]===_0xa29a('0x1d')&&typeof _0x4d49d7[_0xa29a('0x1e')]==='undefined';var _0x58a5ea=_0x1402c1[_0xa29a('0x1f')];var _0x3d3954=_0x16db36?0x0:_0x4d49d7[_0xa29a('0x1c')];var _0x10f8d6=_0x16db36?_0x1402c1[_0xa29a('0x1f')]:_0x4d49d7[_0xa29a('0x1c')]+_0x4d49d7[_0xa29a('0x1e')];var _0x244b9e;if(_0x10f8d6>=_0x58a5ea){_0x10f8d6=_0x58a5ea;_0x244b9e=0xc8;}else{_0x244b9e=0xce;}_0x383813[_0xa29a('0x19')](_0x244b9e);return _0x383813[_0xa29a('0x20')](_0xa29a('0x21'),_0x3d3954+'-'+_0x10f8d6+'/'+_0x58a5ea)[_0xa29a('0x1b')](_0x1402c1);}return null;};}function patchUpdates(_0x3087eb){return function(_0x5a70a4){try{jsonpatch['apply'](_0x5a70a4,_0x3087eb,!![]);}catch(_0xa018bf){return BPromise[_0xa29a('0x22')](_0xa018bf);}return _0x5a70a4[_0xa29a('0x23')]();};}function saveUpdates(_0x4d6fa9,_0x2f3458){return function(_0x3281d4){if(_0x3281d4){return _0x3281d4['update'](_0x4d6fa9)['then'](function(_0x3e1db8){return _0x3e1db8;});}return null;};}function removeEntity(_0x3a14e3,_0x5b63cd){return function(_0x1f5e0b){if(_0x1f5e0b){return _0x1f5e0b[_0xa29a('0x24')]()[_0xa29a('0x25')](function(){_0x3a14e3[_0xa29a('0x19')](0xcc)[_0xa29a('0x1a')]();});}};}function handleEntityNotFound(_0x5c7a0c,_0x412182){return function(_0x8f0543){if(!_0x8f0543){_0x5c7a0c[_0xa29a('0x18')](0x194);}return _0x8f0543;};}function handleError(_0x4ad654,_0x50c9cc){_0x50c9cc=_0x50c9cc||0x1f4;return function(_0x572d76){logger[_0xa29a('0x26')](_0x572d76[_0xa29a('0x27')]);if(_0x572d76['name']){delete _0x572d76[_0xa29a('0x28')];}_0x4ad654[_0xa29a('0x19')](_0x50c9cc)[_0xa29a('0x29')](_0x572d76);};}exports[_0xa29a('0x2a')]=function(_0x2186e2,_0x530797){var _0x4fea7a={},_0x473095={},_0xbba93d={'count':0x0,'rows':[]};var _0x3b8d34=_['map'](db[_0xa29a('0x2b')]['rawAttributes'],function(_0x586a4c){return{'name':_0x586a4c[_0xa29a('0x2c')],'type':_0x586a4c['type'][_0xa29a('0x2d')]};});_0x473095['model']=_[_0xa29a('0x2e')](_0x3b8d34,'name');_0x473095[_0xa29a('0x2f')]=_[_0xa29a('0x30')](_0x2186e2[_0xa29a('0x2f')]);_0x473095[_0xa29a('0x31')]=_['intersection'](_0x473095['model'],_0x473095[_0xa29a('0x2f')]);_0x4fea7a[_0xa29a('0x32')]=_['intersection'](_0x473095[_0xa29a('0x33')],qs[_0xa29a('0x34')](_0x2186e2[_0xa29a('0x2f')][_0xa29a('0x34')]));_0x4fea7a['attributes']=_0x4fea7a[_0xa29a('0x32')][_0xa29a('0x35')]?_0x4fea7a['attributes']:_0x473095[_0xa29a('0x33')];if(!_0x2186e2[_0xa29a('0x2f')]['hasOwnProperty'](_0xa29a('0x36'))){_0x4fea7a[_0xa29a('0x1e')]=qs[_0xa29a('0x1e')](_0x2186e2[_0xa29a('0x2f')][_0xa29a('0x1e')]);_0x4fea7a[_0xa29a('0x1c')]=qs[_0xa29a('0x1c')](_0x2186e2[_0xa29a('0x2f')]['offset']);}_0x4fea7a[_0xa29a('0x37')]=qs[_0xa29a('0x38')](_0x2186e2[_0xa29a('0x2f')][_0xa29a('0x38')]);_0x4fea7a[_0xa29a('0x39')]=qs[_0xa29a('0x31')](_[_0xa29a('0x3a')](_0x2186e2[_0xa29a('0x2f')],_0x473095[_0xa29a('0x31')]),_0x3b8d34);if(_0x2186e2[_0xa29a('0x2f')][_0xa29a('0x3b')]){_0x4fea7a[_0xa29a('0x39')]=_['merge'](_0x4fea7a[_0xa29a('0x39')],{'$or':_[_0xa29a('0x2e')](_0x3b8d34,function(_0x27cacd){if(_0x27cacd[_0xa29a('0x3c')]!==_0xa29a('0x3d')){var _0x2d2a11={};_0x2d2a11[_0x27cacd[_0xa29a('0x28')]]={'$like':'%'+_0x2186e2[_0xa29a('0x2f')][_0xa29a('0x3b')]+'%'};return _0x2d2a11;}})});}_0x4fea7a=_[_0xa29a('0x3e')]({},_0x4fea7a,_0x2186e2[_0xa29a('0x3f')]);var _0x3f544a={'where':_0x4fea7a[_0xa29a('0x39')]};return db[_0xa29a('0x2b')][_0xa29a('0x1f')](_0x3f544a)[_0xa29a('0x25')](function(_0x4648ac){_0xbba93d[_0xa29a('0x1f')]=_0x4648ac;if(_0x2186e2['query'][_0xa29a('0x40')]){_0x4fea7a[_0xa29a('0x41')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0xa29a('0x42')](_0x4fea7a);})[_0xa29a('0x25')](function(_0x56186b){_0xbba93d[_0xa29a('0x43')]=_0x56186b;return _0xbba93d;})[_0xa29a('0x25')](respondWithFilteredResult(_0x530797,_0x4fea7a))[_0xa29a('0x44')](handleError(_0x530797,null));};exports['show']=function(_0xa45359,_0x2793cc){var _0xb552e={'raw':!![],'where':{'id':_0xa45359[_0xa29a('0x45')]['id']}},_0x3dbe7c={};_0x3dbe7c[_0xa29a('0x33')]=_['keys'](db['AnalyticTreeReport']['rawAttributes']);_0x3dbe7c[_0xa29a('0x2f')]=_['keys'](_0xa45359[_0xa29a('0x2f')]);_0x3dbe7c[_0xa29a('0x31')]=_[_0xa29a('0x46')](_0x3dbe7c[_0xa29a('0x33')],_0x3dbe7c[_0xa29a('0x2f')]);_0xb552e[_0xa29a('0x32')]=_[_0xa29a('0x46')](_0x3dbe7c['model'],qs[_0xa29a('0x34')](_0xa45359[_0xa29a('0x2f')][_0xa29a('0x34')]));_0xb552e[_0xa29a('0x32')]=_0xb552e['attributes'][_0xa29a('0x35')]?_0xb552e[_0xa29a('0x32')]:_0x3dbe7c['model'];if(_0xa45359['query'][_0xa29a('0x40')]){_0xb552e[_0xa29a('0x41')]=[{'all':!![]}];}_0xb552e=_[_0xa29a('0x3e')]({},_0xb552e,_0xa45359['options']);return db[_0xa29a('0x2b')]['find'](_0xb552e)[_0xa29a('0x25')](handleEntityNotFound(_0x2793cc,null))['then'](respondWithResult(_0x2793cc,null))['catch'](handleError(_0x2793cc,null));};exports[_0xa29a('0x47')]=function(_0x21ed5a,_0x97083a){return db[_0xa29a('0x2b')][_0xa29a('0x47')](_0x21ed5a[_0xa29a('0x48')],{})['then'](respondWithResult(_0x97083a,0xc9))[_0xa29a('0x44')](handleError(_0x97083a,null));};exports[_0xa29a('0x49')]=function(_0x31a8e5,_0x3dd67c){if(_0x31a8e5[_0xa29a('0x48')]['id']){delete _0x31a8e5[_0xa29a('0x48')]['id'];}return db['AnalyticTreeReport']['find']({'where':{'id':_0x31a8e5['params']['id']}})[_0xa29a('0x25')](handleEntityNotFound(_0x3dd67c,null))[_0xa29a('0x25')](saveUpdates(_0x31a8e5[_0xa29a('0x48')],null))[_0xa29a('0x25')](respondWithResult(_0x3dd67c,null))['catch'](handleError(_0x3dd67c,null));};exports[_0xa29a('0x24')]=function(_0x138305,_0x1b7930){return db[_0xa29a('0x2b')][_0xa29a('0x4a')]({'where':{'id':_0x138305[_0xa29a('0x45')]['id']}})[_0xa29a('0x25')](handleEntityNotFound(_0x1b7930,null))[_0xa29a('0x25')](removeEntity(_0x1b7930,null))[_0xa29a('0x44')](handleError(_0x1b7930,null));}; \ No newline at end of file +var _0x15a4=['where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','AnalyticTreeReport','intersection','options','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','keys','query','filters','attributes','model','fields','length','hasOwnProperty','nolimit','sort'];(function(_0x191ede,_0x2a456e){var _0x4cf25c=function(_0x4125e0){while(--_0x4125e0){_0x191ede['push'](_0x191ede['shift']());}};_0x4cf25c(++_0x2a456e);}(_0x15a4,0x14e));var _0x415a=function(_0x506475,_0x534546){_0x506475=_0x506475-0x0;var _0x17ca20=_0x15a4[_0x506475];return _0x17ca20;};'use strict';var emlformat=require(_0x415a('0x0'));var rimraf=require(_0x415a('0x1'));var zipdir=require(_0x415a('0x2'));var jsonpatch=require(_0x415a('0x3'));var rp=require(_0x415a('0x4'));var moment=require(_0x415a('0x5'));var BPromise=require(_0x415a('0x6'));var Mustache=require(_0x415a('0x7'));var util=require('util');var path=require(_0x415a('0x8'));var sox=require(_0x415a('0x9'));var csv=require(_0x415a('0xa'));var ejs=require(_0x415a('0xb'));var fs=require('fs');var fs_extra=require(_0x415a('0xc'));var _=require(_0x415a('0xd'));var squel=require(_0x415a('0xe'));var crypto=require(_0x415a('0xf'));var jsforce=require(_0x415a('0x10'));var deskjs=require(_0x415a('0x11'));var toCsv=require(_0x415a('0xa'));var querystring=require('querystring');var Papa=require(_0x415a('0x12'));var Redis=require(_0x415a('0x13'));var authService=require(_0x415a('0x14'));var qs=require(_0x415a('0x15'));var as=require(_0x415a('0x16'));var hardwareService=require(_0x415a('0x17'));var logger=require(_0x415a('0x18'))(_0x415a('0x19'));var utils=require('../../config/utils');var config=require(_0x415a('0x1a'));var licenseUtil=require(_0x415a('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x55f3a9,_0x50b5fb){_0x50b5fb=_0x50b5fb||0xcc;return function(_0x15cee0){if(_0x15cee0){return _0x55f3a9[_0x415a('0x1c')](_0x50b5fb);}return _0x55f3a9[_0x415a('0x1d')](_0x50b5fb)[_0x415a('0x1e')]();};}function respondWithResult(_0x403a86,_0x757c30){_0x757c30=_0x757c30||0xc8;return function(_0x5b6151){if(_0x5b6151){return _0x403a86[_0x415a('0x1d')](_0x757c30)['json'](_0x5b6151);}};}function respondWithFilteredResult(_0x2271f2,_0x508003){return function(_0x3931e3){if(_0x3931e3){var _0x101207=typeof _0x508003[_0x415a('0x1f')]===_0x415a('0x20')&&typeof _0x508003[_0x415a('0x21')]===_0x415a('0x20');var _0x325ca8=_0x3931e3[_0x415a('0x22')];var _0x491c11=_0x101207?0x0:_0x508003[_0x415a('0x1f')];var _0x1c5a0e=_0x101207?_0x3931e3['count']:_0x508003['offset']+_0x508003[_0x415a('0x21')];var _0x5b2264;if(_0x1c5a0e>=_0x325ca8){_0x1c5a0e=_0x325ca8;_0x5b2264=0xc8;}else{_0x5b2264=0xce;}_0x2271f2[_0x415a('0x1d')](_0x5b2264);return _0x2271f2['set'](_0x415a('0x23'),_0x491c11+'-'+_0x1c5a0e+'/'+_0x325ca8)[_0x415a('0x24')](_0x3931e3);}return null;};}function patchUpdates(_0x5c8e15){return function(_0x3597ef){try{jsonpatch[_0x415a('0x25')](_0x3597ef,_0x5c8e15,!![]);}catch(_0x5196e9){return BPromise[_0x415a('0x26')](_0x5196e9);}return _0x3597ef[_0x415a('0x27')]();};}function saveUpdates(_0x2867ee,_0x4453ba){return function(_0x5e198c){if(_0x5e198c){return _0x5e198c[_0x415a('0x28')](_0x2867ee)[_0x415a('0x29')](function(_0x450e9f){return _0x450e9f;});}return null;};}function removeEntity(_0x2105ea,_0x3bfeb1){return function(_0x4f2f8b){if(_0x4f2f8b){return _0x4f2f8b['destroy']()[_0x415a('0x29')](function(){_0x2105ea[_0x415a('0x1d')](0xcc)[_0x415a('0x1e')]();});}};}function handleEntityNotFound(_0x194778,_0x315056){return function(_0x1955ae){if(!_0x1955ae){_0x194778['sendStatus'](0x194);}return _0x1955ae;};}function handleError(_0x33945d,_0x15abb2){_0x15abb2=_0x15abb2||0x1f4;return function(_0x358ff9){logger[_0x415a('0x2a')](_0x358ff9[_0x415a('0x2b')]);if(_0x358ff9['name']){delete _0x358ff9[_0x415a('0x2c')];}_0x33945d['status'](_0x15abb2)[_0x415a('0x2d')](_0x358ff9);};}exports[_0x415a('0x2e')]=function(_0x47b942,_0x39c109){var _0x4f6b2f={},_0x24943d={},_0x4776ff={'count':0x0,'rows':[]};var _0x29e2ad=_[_0x415a('0x2f')](db['AnalyticTreeReport'][_0x415a('0x30')],function(_0x4b96d6){return{'name':_0x4b96d6[_0x415a('0x31')],'type':_0x4b96d6[_0x415a('0x32')]['key']};});_0x24943d['model']=_[_0x415a('0x2f')](_0x29e2ad,_0x415a('0x2c'));_0x24943d['query']=_[_0x415a('0x33')](_0x47b942[_0x415a('0x34')]);_0x24943d[_0x415a('0x35')]=_['intersection'](_0x24943d['model'],_0x24943d[_0x415a('0x34')]);_0x4f6b2f[_0x415a('0x36')]=_['intersection'](_0x24943d[_0x415a('0x37')],qs['fields'](_0x47b942[_0x415a('0x34')][_0x415a('0x38')]));_0x4f6b2f['attributes']=_0x4f6b2f[_0x415a('0x36')][_0x415a('0x39')]?_0x4f6b2f[_0x415a('0x36')]:_0x24943d[_0x415a('0x37')];if(!_0x47b942['query'][_0x415a('0x3a')](_0x415a('0x3b'))){_0x4f6b2f['limit']=qs[_0x415a('0x21')](_0x47b942[_0x415a('0x34')][_0x415a('0x21')]);_0x4f6b2f[_0x415a('0x1f')]=qs[_0x415a('0x1f')](_0x47b942[_0x415a('0x34')][_0x415a('0x1f')]);}_0x4f6b2f['order']=qs[_0x415a('0x3c')](_0x47b942[_0x415a('0x34')]['sort']);_0x4f6b2f[_0x415a('0x3d')]=qs[_0x415a('0x35')](_[_0x415a('0x3e')](_0x47b942[_0x415a('0x34')],_0x24943d['filters']),_0x29e2ad);if(_0x47b942[_0x415a('0x34')][_0x415a('0x3f')]){_0x4f6b2f[_0x415a('0x3d')]=_[_0x415a('0x40')](_0x4f6b2f[_0x415a('0x3d')],{'$or':_[_0x415a('0x2f')](_0x29e2ad,function(_0x3fff50){if(_0x3fff50['type']!==_0x415a('0x41')){var _0x4b058e={};_0x4b058e[_0x3fff50['name']]={'$like':'%'+_0x47b942[_0x415a('0x34')][_0x415a('0x3f')]+'%'};return _0x4b058e;}})});}_0x4f6b2f=_[_0x415a('0x40')]({},_0x4f6b2f,_0x47b942['options']);var _0x3ec0c9={'where':_0x4f6b2f['where']};return db['AnalyticTreeReport']['count'](_0x3ec0c9)['then'](function(_0x53f9ed){_0x4776ff['count']=_0x53f9ed;if(_0x47b942[_0x415a('0x34')][_0x415a('0x42')]){_0x4f6b2f[_0x415a('0x43')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x415a('0x44')](_0x4f6b2f);})[_0x415a('0x29')](function(_0x27d3b1){_0x4776ff['rows']=_0x27d3b1;return _0x4776ff;})[_0x415a('0x29')](respondWithFilteredResult(_0x39c109,_0x4f6b2f))[_0x415a('0x45')](handleError(_0x39c109,null));};exports[_0x415a('0x46')]=function(_0x5655ec,_0x5e5c71){var _0x30c380={'raw':!![],'where':{'id':_0x5655ec[_0x415a('0x47')]['id']}},_0x1075ca={};_0x1075ca['model']=_['keys'](db[_0x415a('0x48')][_0x415a('0x30')]);_0x1075ca['query']=_['keys'](_0x5655ec['query']);_0x1075ca['filters']=_[_0x415a('0x49')](_0x1075ca[_0x415a('0x37')],_0x1075ca[_0x415a('0x34')]);_0x30c380[_0x415a('0x36')]=_['intersection'](_0x1075ca[_0x415a('0x37')],qs['fields'](_0x5655ec['query']['fields']));_0x30c380[_0x415a('0x36')]=_0x30c380[_0x415a('0x36')][_0x415a('0x39')]?_0x30c380['attributes']:_0x1075ca[_0x415a('0x37')];if(_0x5655ec[_0x415a('0x34')][_0x415a('0x42')]){_0x30c380[_0x415a('0x43')]=[{'all':!![]}];}_0x30c380=_[_0x415a('0x40')]({},_0x30c380,_0x5655ec[_0x415a('0x4a')]);return db[_0x415a('0x48')][_0x415a('0x4b')](_0x30c380)[_0x415a('0x29')](handleEntityNotFound(_0x5e5c71,null))[_0x415a('0x29')](respondWithResult(_0x5e5c71,null))[_0x415a('0x45')](handleError(_0x5e5c71,null));};exports[_0x415a('0x4c')]=function(_0x5dff84,_0x5edfe7){return db[_0x415a('0x48')][_0x415a('0x4c')](_0x5dff84[_0x415a('0x4d')],{})['then'](respondWithResult(_0x5edfe7,0xc9))[_0x415a('0x45')](handleError(_0x5edfe7,null));};exports[_0x415a('0x28')]=function(_0x2890c2,_0x535cfc){if(_0x2890c2[_0x415a('0x4d')]['id']){delete _0x2890c2[_0x415a('0x4d')]['id'];}return db[_0x415a('0x48')][_0x415a('0x4b')]({'where':{'id':_0x2890c2[_0x415a('0x47')]['id']}})[_0x415a('0x29')](handleEntityNotFound(_0x535cfc,null))[_0x415a('0x29')](saveUpdates(_0x2890c2[_0x415a('0x4d')],null))[_0x415a('0x29')](respondWithResult(_0x535cfc,null))[_0x415a('0x45')](handleError(_0x535cfc,null));};exports[_0x415a('0x4e')]=function(_0x4a74b6,_0x2bd124){return db[_0x415a('0x48')][_0x415a('0x4b')]({'where':{'id':_0x4a74b6[_0x415a('0x47')]['id']}})[_0x415a('0x29')](handleEntityNotFound(_0x2bd124,null))[_0x415a('0x29')](removeEntity(_0x2bd124,null))[_0x415a('0x45')](handleError(_0x2bd124,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index ddbf54f..253b388 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 _0x657c=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','lodash','util'];(function(_0x147331,_0x3c2a32){var _0x5524fb=function(_0x2b5c4a){while(--_0x2b5c4a){_0x147331['push'](_0x147331['shift']());}};_0x5524fb(++_0x3c2a32);}(_0x657c,0x1de));var _0xc657=function(_0x534f61,_0x8f77af){_0x534f61=_0x534f61-0x0;var _0x250ba8=_0x657c[_0x534f61];return _0x250ba8;};'use strict';var _=require(_0xc657('0x0'));var util=require(_0xc657('0x1'));var logger=require(_0xc657('0x2'))(_0xc657('0x3'));var moment=require(_0xc657('0x4'));var BPromise=require(_0xc657('0x5'));var rp=require(_0xc657('0x6'));var fs=require('fs');var path=require(_0xc657('0x7'));var rimraf=require(_0xc657('0x8'));var config=require(_0xc657('0x9'));var attributes=require('./analyticTreeReport.attributes');module[_0xc657('0xa')]=function(_0xcca124,_0x41e401){return _0xcca124[_0xc657('0xb')]('AnalyticTreeReport',attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0f69=['moment','path','rimraf','../../config/environment','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api'];(function(_0x2ad008,_0x31f893){var _0x5caa27=function(_0x41ef08){while(--_0x41ef08){_0x2ad008['push'](_0x2ad008['shift']());}};_0x5caa27(++_0x31f893);}(_0x0f69,0xb0));var _0x90f6=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x0f69[_0x21549c];return _0x426cbd;};'use strict';var _=require(_0x90f6('0x0'));var util=require(_0x90f6('0x1'));var logger=require(_0x90f6('0x2'))(_0x90f6('0x3'));var moment=require(_0x90f6('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x90f6('0x5'));var rimraf=require(_0x90f6('0x6'));var config=require(_0x90f6('0x7'));var attributes=require('./analyticTreeReport.attributes');module[_0x90f6('0x8')]=function(_0x35a5a2,_0x13a4dc){return _0x35a5a2[_0x90f6('0x9')](_0x90f6('0xa'),attributes,{'tableName':_0x90f6('0xb'),'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 af7a799..d2211b7 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 _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x2d0d31,_0x479ec9){var _0x4e620c=function(_0x351762){while(--_0x351762){_0x2d0d31['push'](_0x2d0d31['shift']());}};_0x4e620c(++_0x479ec9);}(_0x5f2f,0x73));var _0xf5f2=function(_0x42f6b1,_0x560c04){_0x42f6b1=_0x42f6b1-0x0;var _0x39b69f=_0x5f2f[_0x42f6b1];return _0x39b69f;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});} \ No newline at end of file +var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x136ca9,_0x293840){var _0xaf521c=function(_0x4a5993){while(--_0x4a5993){_0x136ca9['push'](_0x136ca9['shift']());}};_0xaf521c(++_0x293840);}(_0x5f2f,0x73));var _0xf5f2=function(_0x824733,_0x24e272){_0x824733=_0x824733-0x0;var _0x50d7ed=_0x5f2f[_0x824733];return _0x50d7ed;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index f508f07..e31d8af 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 _0x3860=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','create','put','delete','destroy','exports','multer','util'];(function(_0xdca108,_0x2e422e){var _0x39ef15=function(_0x5e6e9f){while(--_0x5e6e9f){_0xdca108['push'](_0xdca108['shift']());}};_0x39ef15(++_0x2e422e);}(_0x3860,0x142));var _0x0386=function(_0x96fb58,_0x1c2174){_0x96fb58=_0x96fb58-0x0;var _0x1ef92d=_0x3860[_0x96fb58];return _0x1ef92d;};'use strict';var multer=require(_0x0386('0x0'));var util=require(_0x0386('0x1'));var path=require('path');var timeout=require(_0x0386('0x2'));var express=require(_0x0386('0x3'));var router=express[_0x0386('0x4')]();var fs_extra=require(_0x0386('0x5'));var auth=require(_0x0386('0x6'));var interaction=require(_0x0386('0x7'));var config=require('../../config/environment');var controller=require('./analyticTreeReport.controller');router[_0x0386('0x8')]('/',auth[_0x0386('0x9')](),controller[_0x0386('0xa')]);router[_0x0386('0x8')](_0x0386('0xb'),auth['isAuthenticated'](),controller[_0x0386('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x0386('0xd')]);router[_0x0386('0xe')]('/:id',auth[_0x0386('0x9')](),controller['update']);router[_0x0386('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x0386('0x10')]);module[_0x0386('0x11')]=router; \ No newline at end of file +var _0x8a10=['isAuthenticated','index','show','create','/:id','update','delete','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticTreeReport.controller','get'];(function(_0x1f1e22,_0x4d523b){var _0x3b2157=function(_0x5e6695){while(--_0x5e6695){_0x1f1e22['push'](_0x1f1e22['shift']());}};_0x3b2157(++_0x4d523b);}(_0x8a10,0xd3));var _0x08a1=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x8a10[_0x59ee6f];return _0x4c0979;};'use strict';var multer=require(_0x08a1('0x0'));var util=require(_0x08a1('0x1'));var path=require(_0x08a1('0x2'));var timeout=require(_0x08a1('0x3'));var express=require('express');var router=express[_0x08a1('0x4')]();var fs_extra=require(_0x08a1('0x5'));var auth=require(_0x08a1('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x08a1('0x7'));var controller=require(_0x08a1('0x8'));router[_0x08a1('0x9')]('/',auth[_0x08a1('0xa')](),controller[_0x08a1('0xb')]);router[_0x08a1('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x08a1('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x08a1('0xd')]);router['put'](_0x08a1('0xe'),auth[_0x08a1('0xa')](),controller[_0x08a1('0xf')]);router[_0x08a1('0x10')](_0x08a1('0xe'),auth[_0x08a1('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 6bef58d..4941b78 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 _0xe79a=['STRING'];(function(_0x5ca51b,_0x57a81c){var _0x399373=function(_0x46a2da){while(--_0x46a2da){_0x5ca51b['push'](_0x5ca51b['shift']());}};_0x399373(++_0x57a81c);}(_0xe79a,0x70));var _0xae79=function(_0x8b0f43,_0x1c57b8){_0x8b0f43=_0x8b0f43-0x0;var _0x3f4425=_0xe79a[_0x8b0f43];return _0x3f4425;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xae79('0x0')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xae79('0x0')]}}; \ No newline at end of file +var _0x55e0=['STRING','sequelize','exports'];(function(_0x205081,_0x3f0823){var _0x13e35b=function(_0x58a0e7){while(--_0x58a0e7){_0x205081['push'](_0x205081['shift']());}};_0x13e35b(++_0x3f0823);}(_0x55e0,0xdc));var _0x055e=function(_0x1ee501,_0x16537c){_0x1ee501=_0x1ee501-0x0;var _0x11fdb0=_0x55e0[_0x1ee501];return _0x11fdb0;};'use strict';var Sequelize=require(_0x055e('0x0'));module[_0x055e('0x1')]={'name':{'type':Sequelize[_0x055e('0x2')]},'basename':{'type':Sequelize[_0x055e('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 17099ed..425429b 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 _0xff9b=['map','Attachment','rawAttributes','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','type','includeAll','include','findAll','then','catch','show','params','keys','find','get','omit','createdAt','updatedAt','body','create','file','originalname','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','offline-chat/','join','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','error','stack','name'];(function(_0x5d9af1,_0x36e656){var _0x45d487=function(_0x18e5bd){while(--_0x18e5bd){_0x5d9af1['push'](_0x5d9af1['shift']());}};_0x45d487(++_0x36e656);}(_0xff9b,0xd1));var _0xbff9=function(_0x2b2dd1,_0x2c6ac7){_0x2b2dd1=_0x2b2dd1-0x0;var _0x5d2ef5=_0xff9b[_0x2b2dd1];return _0x5d2ef5;};'use strict';var emlformat=require(_0xbff9('0x0'));var rimraf=require(_0xbff9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbff9('0x2'));var rp=require(_0xbff9('0x3'));var moment=require(_0xbff9('0x4'));var BPromise=require(_0xbff9('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xbff9('0x6'));var sox=require(_0xbff9('0x7'));var csv=require('to-csv');var ejs=require(_0xbff9('0x8'));var fs=require('fs');var fs_extra=require(_0xbff9('0x9'));var _=require(_0xbff9('0xa'));var squel=require(_0xbff9('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xbff9('0xc'));var querystring=require(_0xbff9('0xd'));var Papa=require(_0xbff9('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xbff9('0xf'));var as=require(_0xbff9('0x10'));var hardwareService=require(_0xbff9('0x11'));var logger=require('../../config/logger')(_0xbff9('0x12'));var utils=require(_0xbff9('0x13'));var config=require(_0xbff9('0x14'));var licenseUtil=require(_0xbff9('0x15'));var db=require(_0xbff9('0x16'))['db'];function respondWithStatusCode(_0xe05b90,_0x26e6b2){_0x26e6b2=_0x26e6b2||0xcc;return function(_0x4d9321){if(_0x4d9321){return _0xe05b90[_0xbff9('0x17')](_0x26e6b2);}return _0xe05b90[_0xbff9('0x18')](_0x26e6b2)[_0xbff9('0x19')]();};}function respondWithResult(_0x59ab84,_0x175d48){_0x175d48=_0x175d48||0xc8;return function(_0x1892ab){if(_0x1892ab){return _0x59ab84[_0xbff9('0x18')](_0x175d48)[_0xbff9('0x1a')](_0x1892ab);}};}function respondWithFilteredResult(_0x4ddee9,_0x101d8a){return function(_0x3facf3){if(_0x3facf3){var _0x615325=typeof _0x101d8a[_0xbff9('0x1b')]===_0xbff9('0x1c')&&typeof _0x101d8a[_0xbff9('0x1d')]===_0xbff9('0x1c');var _0x385c0a=_0x3facf3[_0xbff9('0x1e')];var _0x2b0ecf=_0x615325?0x0:_0x101d8a[_0xbff9('0x1b')];var _0x25174a=_0x615325?_0x3facf3[_0xbff9('0x1e')]:_0x101d8a['offset']+_0x101d8a[_0xbff9('0x1d')];var _0x5ed7fa;if(_0x25174a>=_0x385c0a){_0x25174a=_0x385c0a;_0x5ed7fa=0xc8;}else{_0x5ed7fa=0xce;}_0x4ddee9[_0xbff9('0x18')](_0x5ed7fa);return _0x4ddee9[_0xbff9('0x1f')](_0xbff9('0x20'),_0x2b0ecf+'-'+_0x25174a+'/'+_0x385c0a)[_0xbff9('0x1a')](_0x3facf3);}return null;};}function patchUpdates(_0x573041){return function(_0x4e8663){try{jsonpatch['apply'](_0x4e8663,_0x573041,!![]);}catch(_0x4af8ab){return BPromise[_0xbff9('0x21')](_0x4af8ab);}return _0x4e8663[_0xbff9('0x22')]();};}function saveUpdates(_0x3529c0,_0x395555){return function(_0x3a77f1){if(_0x3a77f1){return _0x3a77f1[_0xbff9('0x23')](_0x3529c0)['then'](function(_0x40ea5f){return _0x40ea5f;});}return null;};}function removeEntity(_0x3fbb23,_0x335522){return function(_0x3405d4){if(_0x3405d4){return _0x3405d4[_0xbff9('0x24')]()['then'](function(){_0x3fbb23[_0xbff9('0x18')](0xcc)[_0xbff9('0x19')]();});}};}function handleEntityNotFound(_0x2c58ab,_0x2133a2){return function(_0x44a2cd){if(!_0x44a2cd){_0x2c58ab[_0xbff9('0x17')](0x194);}return _0x44a2cd;};}function handleError(_0x540707,_0x17dc6c){_0x17dc6c=_0x17dc6c||0x1f4;return function(_0x322021){logger[_0xbff9('0x25')](_0x322021[_0xbff9('0x26')]);if(_0x322021[_0xbff9('0x27')]){delete _0x322021[_0xbff9('0x27')];}_0x540707[_0xbff9('0x18')](_0x17dc6c)['send'](_0x322021);};}exports['index']=function(_0x353de3,_0x2c0002){var _0x4362d7={},_0x467748={},_0x4776dd={'count':0x0,'rows':[]};var _0x1a07f2=_[_0xbff9('0x28')](db[_0xbff9('0x29')][_0xbff9('0x2a')],function(_0x2fe8dc){return{'name':_0x2fe8dc['fieldName'],'type':_0x2fe8dc['type']['key']};});_0x467748[_0xbff9('0x2b')]=_['map'](_0x1a07f2,_0xbff9('0x27'));_0x467748[_0xbff9('0x2c')]=_['keys'](_0x353de3[_0xbff9('0x2c')]);_0x467748['filters']=_[_0xbff9('0x2d')](_0x467748['model'],_0x467748[_0xbff9('0x2c')]);_0x4362d7[_0xbff9('0x2e')]=_[_0xbff9('0x2d')](_0x467748[_0xbff9('0x2b')],qs['fields'](_0x353de3[_0xbff9('0x2c')][_0xbff9('0x2f')]));_0x4362d7[_0xbff9('0x2e')]=_0x4362d7[_0xbff9('0x2e')][_0xbff9('0x30')]?_0x4362d7[_0xbff9('0x2e')]:_0x467748[_0xbff9('0x2b')];if(!_0x353de3[_0xbff9('0x2c')][_0xbff9('0x31')](_0xbff9('0x32'))){_0x4362d7[_0xbff9('0x1d')]=qs[_0xbff9('0x1d')](_0x353de3[_0xbff9('0x2c')][_0xbff9('0x1d')]);_0x4362d7[_0xbff9('0x1b')]=qs[_0xbff9('0x1b')](_0x353de3[_0xbff9('0x2c')][_0xbff9('0x1b')]);}_0x4362d7['order']=qs[_0xbff9('0x33')](_0x353de3[_0xbff9('0x2c')][_0xbff9('0x33')]);_0x4362d7[_0xbff9('0x34')]=qs[_0xbff9('0x35')](_[_0xbff9('0x36')](_0x353de3[_0xbff9('0x2c')],_0x467748[_0xbff9('0x35')]),_0x1a07f2);if(_0x353de3['query'][_0xbff9('0x37')]){_0x4362d7[_0xbff9('0x34')]=_[_0xbff9('0x38')](_0x4362d7['where'],{'$or':_[_0xbff9('0x28')](_0x1a07f2,function(_0xa1ae4c){if(_0xa1ae4c[_0xbff9('0x39')]!=='VIRTUAL'){var _0x5dac5e={};_0x5dac5e[_0xa1ae4c[_0xbff9('0x27')]]={'$like':'%'+_0x353de3[_0xbff9('0x2c')]['filter']+'%'};return _0x5dac5e;}})});}_0x4362d7=_[_0xbff9('0x38')]({},_0x4362d7,_0x353de3['options']);var _0x10b03f={'where':_0x4362d7['where']};return db[_0xbff9('0x29')]['count'](_0x10b03f)['then'](function(_0x4fd633){_0x4776dd[_0xbff9('0x1e')]=_0x4fd633;if(_0x353de3['query'][_0xbff9('0x3a')]){_0x4362d7[_0xbff9('0x3b')]=[{'all':!![]}];}return db[_0xbff9('0x29')][_0xbff9('0x3c')](_0x4362d7);})[_0xbff9('0x3d')](function(_0x20bd87){_0x4776dd['rows']=_0x20bd87;return _0x4776dd;})[_0xbff9('0x3d')](respondWithFilteredResult(_0x2c0002,_0x4362d7))[_0xbff9('0x3e')](handleError(_0x2c0002,null));};exports[_0xbff9('0x3f')]=function(_0x42db1f,_0x9e9ffb){var _0x329fff={'raw':!![],'where':{'id':_0x42db1f[_0xbff9('0x40')]['id']}},_0x148a27={};_0x148a27['model']=_[_0xbff9('0x41')](db[_0xbff9('0x29')][_0xbff9('0x2a')]);_0x148a27[_0xbff9('0x2c')]=_[_0xbff9('0x41')](_0x42db1f['query']);_0x148a27['filters']=_['intersection'](_0x148a27['model'],_0x148a27['query']);_0x329fff[_0xbff9('0x2e')]=_[_0xbff9('0x2d')](_0x148a27[_0xbff9('0x2b')],qs[_0xbff9('0x2f')](_0x42db1f[_0xbff9('0x2c')][_0xbff9('0x2f')]));_0x329fff[_0xbff9('0x2e')]=_0x329fff['attributes'][_0xbff9('0x30')]?_0x329fff['attributes']:_0x148a27[_0xbff9('0x2b')];if(_0x42db1f[_0xbff9('0x2c')][_0xbff9('0x3a')]){_0x329fff[_0xbff9('0x3b')]=[{'all':!![]}];}_0x329fff=_[_0xbff9('0x38')]({},_0x329fff,_0x42db1f['options']);return db['Attachment'][_0xbff9('0x42')](_0x329fff)[_0xbff9('0x3d')](handleEntityNotFound(_0x9e9ffb,null))[_0xbff9('0x3d')](respondWithResult(_0x9e9ffb,null))[_0xbff9('0x3e')](handleError(_0x9e9ffb,null));};exports['clone']=function(_0x1fbab0,_0xd23a09){var _0x2b0bd9={'where':{'id':_0x1fbab0[_0xbff9('0x40')]['id']}},_0x4af148={};_0x4af148[_0xbff9('0x2b')]=_[_0xbff9('0x41')](db[_0xbff9('0x29')]['rawAttributes']);_0x2b0bd9[_0xbff9('0x2e')]=_[_0xbff9('0x2d')](_0x4af148[_0xbff9('0x2b')],qs[_0xbff9('0x2f')](_0x1fbab0['query'][_0xbff9('0x2f')]));_0x2b0bd9[_0xbff9('0x2e')]=_0x2b0bd9[_0xbff9('0x2e')][_0xbff9('0x30')]?_0x2b0bd9[_0xbff9('0x2e')]:_0x4af148[_0xbff9('0x2b')];if(_0x1fbab0[_0xbff9('0x2c')][_0xbff9('0x3a')]){_0x2b0bd9[_0xbff9('0x3b')]=[{'all':!![]}];}_0x2b0bd9=_['merge']({},_0x2b0bd9,_0x1fbab0['options']);return db[_0xbff9('0x29')][_0xbff9('0x42')](_0x2b0bd9)[_0xbff9('0x3d')](handleEntityNotFound(_0xd23a09,null))[_0xbff9('0x3d')](function(_0x59289f){if(_0x59289f){var _0x15f782=_0x59289f[_0xbff9('0x43')]({'plain':!![]});_0x15f782=qs[_0xbff9('0x44')](_0x15f782,['id',_0xbff9('0x45'),_0xbff9('0x46')]);_0x1fbab0['body']=_[_0xbff9('0x44')](_0x1fbab0[_0xbff9('0x47')],['id',_0xbff9('0x45'),_0xbff9('0x46')]);return db[_0xbff9('0x29')][_0xbff9('0x48')](_['merge'](_0x15f782,_0x1fbab0[_0xbff9('0x47')]),{'include':_0x1fbab0[_0xbff9('0x2c')][_0xbff9('0x3a')]?[{'all':!![]}]:undefined});}})[_0xbff9('0x3d')](respondWithResult(_0xd23a09,0xc9))[_0xbff9('0x3e')](handleError(_0xd23a09,null));};exports[_0xbff9('0x23')]=function(_0x236ffc,_0x233dfa){if(_0x236ffc['body']['id']){delete _0x236ffc[_0xbff9('0x47')]['id'];}return db[_0xbff9('0x29')][_0xbff9('0x42')]({'where':{'id':_0x236ffc[_0xbff9('0x40')]['id']}})[_0xbff9('0x3d')](handleEntityNotFound(_0x233dfa,null))[_0xbff9('0x3d')](saveUpdates(_0x236ffc[_0xbff9('0x47')],null))['then'](respondWithResult(_0x233dfa,null))[_0xbff9('0x3e')](handleError(_0x233dfa,null));};exports['destroy']=function(_0x1cd028,_0xa838d4){return db['Attachment'][_0xbff9('0x42')]({'where':{'id':_0x1cd028[_0xbff9('0x40')]['id']}})[_0xbff9('0x3d')](handleEntityNotFound(_0xa838d4,null))[_0xbff9('0x3d')](removeEntity(_0xa838d4,null))[_0xbff9('0x3e')](handleError(_0xa838d4,null));};exports[_0xbff9('0x48')]=function(_0x289ea2,_0x5eb8e0,_0x58ace2){_0x289ea2[_0xbff9('0x47')][_0xbff9('0x27')]=_0x289ea2[_0xbff9('0x49')][_0xbff9('0x4a')];_0x289ea2[_0xbff9('0x47')][_0xbff9('0x4b')]=_0x289ea2['file'][_0xbff9('0x4c')];_0x289ea2[_0xbff9('0x47')][_0xbff9('0x39')]=_0x289ea2[_0xbff9('0x49')][_0xbff9('0x4d')];return db[_0xbff9('0x29')][_0xbff9('0x48')](_0x289ea2[_0xbff9('0x47')])['then'](respondWithResult(_0x5eb8e0,0xc9))['catch'](handleError(_0x5eb8e0,null));};exports[_0xbff9('0x4e')]=function(_0x2258ee,_0x8b8c57,_0x4aa1e2){return db['Attachment'][_0xbff9('0x4f')]({'where':{'id':_0x2258ee['params']['id']},'raw':!![]})[_0xbff9('0x3d')](handleEntityNotFound(_0x8b8c57,null))['then'](function(_0x3793c6){if(_0x3793c6){var _0x30118f=_0x3793c6[_0xbff9('0x50')]!==null;var _0x2049d6=path['join'](config['root'],'server/files/attachments/');if(_0x30118f){_0x2049d6=path['join'](_0x2049d6,_0xbff9('0x51'));}var _0x4e1213=path[_0xbff9('0x52')](_0x2049d6,_0x3793c6[_0xbff9('0x4b')]);return _0x8b8c57['download'](_0x4e1213);}})[_0xbff9('0x3e')](handleError(_0x8b8c57,null));}; \ No newline at end of file +var _0xaae4=['rows','catch','show','params','find','get','omit','createdAt','updatedAt','create','body','destroy','file','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','offline-chat/','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','stack','index','map','rawAttributes','type','key','name','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','Attachment','includeAll','include','findAll'];(function(_0x3984c2,_0x5bfc1e){var _0x2b4837=function(_0xb9cbdc){while(--_0xb9cbdc){_0x3984c2['push'](_0x3984c2['shift']());}};_0x2b4837(++_0x5bfc1e);}(_0xaae4,0xce));var _0x4aae=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xaae4[_0x167cc1];return _0x10bc4b;};'use strict';var emlformat=require(_0x4aae('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4aae('0x1'));var jsonpatch=require(_0x4aae('0x2'));var rp=require(_0x4aae('0x3'));var moment=require(_0x4aae('0x4'));var BPromise=require(_0x4aae('0x5'));var Mustache=require(_0x4aae('0x6'));var util=require(_0x4aae('0x7'));var path=require(_0x4aae('0x8'));var sox=require('sox');var csv=require(_0x4aae('0x9'));var ejs=require(_0x4aae('0xa'));var fs=require('fs');var fs_extra=require(_0x4aae('0xb'));var _=require(_0x4aae('0xc'));var squel=require(_0x4aae('0xd'));var crypto=require(_0x4aae('0xe'));var jsforce=require(_0x4aae('0xf'));var deskjs=require(_0x4aae('0x10'));var toCsv=require(_0x4aae('0x9'));var querystring=require(_0x4aae('0x11'));var Papa=require(_0x4aae('0x12'));var Redis=require('ioredis');var authService=require(_0x4aae('0x13'));var qs=require(_0x4aae('0x14'));var as=require(_0x4aae('0x15'));var hardwareService=require(_0x4aae('0x16'));var logger=require(_0x4aae('0x17'))('api');var utils=require(_0x4aae('0x18'));var config=require(_0x4aae('0x19'));var licenseUtil=require(_0x4aae('0x1a'));var db=require(_0x4aae('0x1b'))['db'];function respondWithStatusCode(_0x105086,_0x9b0f34){_0x9b0f34=_0x9b0f34||0xcc;return function(_0x4aab8d){if(_0x4aab8d){return _0x105086[_0x4aae('0x1c')](_0x9b0f34);}return _0x105086[_0x4aae('0x1d')](_0x9b0f34)[_0x4aae('0x1e')]();};}function respondWithResult(_0x518498,_0x2904e6){_0x2904e6=_0x2904e6||0xc8;return function(_0x39a4b5){if(_0x39a4b5){return _0x518498['status'](_0x2904e6)[_0x4aae('0x1f')](_0x39a4b5);}};}function respondWithFilteredResult(_0x48b34d,_0xb71a8e){return function(_0x7411c){if(_0x7411c){var _0x106397=typeof _0xb71a8e[_0x4aae('0x20')]===_0x4aae('0x21')&&typeof _0xb71a8e['limit']===_0x4aae('0x21');var _0x5c089f=_0x7411c[_0x4aae('0x22')];var _0x36ffcf=_0x106397?0x0:_0xb71a8e[_0x4aae('0x20')];var _0x296ff5=_0x106397?_0x7411c[_0x4aae('0x22')]:_0xb71a8e[_0x4aae('0x20')]+_0xb71a8e[_0x4aae('0x23')];var _0xef6055;if(_0x296ff5>=_0x5c089f){_0x296ff5=_0x5c089f;_0xef6055=0xc8;}else{_0xef6055=0xce;}_0x48b34d[_0x4aae('0x1d')](_0xef6055);return _0x48b34d[_0x4aae('0x24')](_0x4aae('0x25'),_0x36ffcf+'-'+_0x296ff5+'/'+_0x5c089f)[_0x4aae('0x1f')](_0x7411c);}return null;};}function patchUpdates(_0x5e8e78){return function(_0x23ef32){try{jsonpatch[_0x4aae('0x26')](_0x23ef32,_0x5e8e78,!![]);}catch(_0x5b302f){return BPromise[_0x4aae('0x27')](_0x5b302f);}return _0x23ef32['save']();};}function saveUpdates(_0x3d9576,_0x23f643){return function(_0x11550e){if(_0x11550e){return _0x11550e[_0x4aae('0x28')](_0x3d9576)[_0x4aae('0x29')](function(_0x4a17be){return _0x4a17be;});}return null;};}function removeEntity(_0x1fcc94,_0x39c127){return function(_0x2909dd){if(_0x2909dd){return _0x2909dd['destroy']()['then'](function(){_0x1fcc94[_0x4aae('0x1d')](0xcc)[_0x4aae('0x1e')]();});}};}function handleEntityNotFound(_0x3f0892,_0x458ac7){return function(_0x3cac46){if(!_0x3cac46){_0x3f0892[_0x4aae('0x1c')](0x194);}return _0x3cac46;};}function handleError(_0x3b2a46,_0x52d1ef){_0x52d1ef=_0x52d1ef||0x1f4;return function(_0x30eeb9){logger['error'](_0x30eeb9[_0x4aae('0x2a')]);if(_0x30eeb9['name']){delete _0x30eeb9['name'];}_0x3b2a46['status'](_0x52d1ef)['send'](_0x30eeb9);};}exports[_0x4aae('0x2b')]=function(_0x91061c,_0x24b018){var _0x1da16f={},_0x55cc22={},_0x17c7ba={'count':0x0,'rows':[]};var _0x4c7fda=_[_0x4aae('0x2c')](db['Attachment'][_0x4aae('0x2d')],function(_0x56dfbb){return{'name':_0x56dfbb['fieldName'],'type':_0x56dfbb[_0x4aae('0x2e')][_0x4aae('0x2f')]};});_0x55cc22['model']=_[_0x4aae('0x2c')](_0x4c7fda,_0x4aae('0x30'));_0x55cc22[_0x4aae('0x31')]=_[_0x4aae('0x32')](_0x91061c[_0x4aae('0x31')]);_0x55cc22[_0x4aae('0x33')]=_[_0x4aae('0x34')](_0x55cc22[_0x4aae('0x35')],_0x55cc22[_0x4aae('0x31')]);_0x1da16f[_0x4aae('0x36')]=_[_0x4aae('0x34')](_0x55cc22[_0x4aae('0x35')],qs[_0x4aae('0x37')](_0x91061c['query']['fields']));_0x1da16f[_0x4aae('0x36')]=_0x1da16f[_0x4aae('0x36')][_0x4aae('0x38')]?_0x1da16f[_0x4aae('0x36')]:_0x55cc22[_0x4aae('0x35')];if(!_0x91061c[_0x4aae('0x31')][_0x4aae('0x39')](_0x4aae('0x3a'))){_0x1da16f[_0x4aae('0x23')]=qs[_0x4aae('0x23')](_0x91061c[_0x4aae('0x31')][_0x4aae('0x23')]);_0x1da16f['offset']=qs[_0x4aae('0x20')](_0x91061c[_0x4aae('0x31')][_0x4aae('0x20')]);}_0x1da16f[_0x4aae('0x3b')]=qs[_0x4aae('0x3c')](_0x91061c[_0x4aae('0x31')][_0x4aae('0x3c')]);_0x1da16f[_0x4aae('0x3d')]=qs['filters'](_['pick'](_0x91061c['query'],_0x55cc22[_0x4aae('0x33')]),_0x4c7fda);if(_0x91061c[_0x4aae('0x31')][_0x4aae('0x3e')]){_0x1da16f['where']=_['merge'](_0x1da16f['where'],{'$or':_['map'](_0x4c7fda,function(_0x2cddc8){if(_0x2cddc8[_0x4aae('0x2e')]!==_0x4aae('0x3f')){var _0x1f50df={};_0x1f50df[_0x2cddc8[_0x4aae('0x30')]]={'$like':'%'+_0x91061c[_0x4aae('0x31')][_0x4aae('0x3e')]+'%'};return _0x1f50df;}})});}_0x1da16f=_[_0x4aae('0x40')]({},_0x1da16f,_0x91061c[_0x4aae('0x41')]);var _0x123804={'where':_0x1da16f['where']};return db[_0x4aae('0x42')][_0x4aae('0x22')](_0x123804)[_0x4aae('0x29')](function(_0x3f890a){_0x17c7ba[_0x4aae('0x22')]=_0x3f890a;if(_0x91061c['query'][_0x4aae('0x43')]){_0x1da16f[_0x4aae('0x44')]=[{'all':!![]}];}return db[_0x4aae('0x42')][_0x4aae('0x45')](_0x1da16f);})[_0x4aae('0x29')](function(_0xe1aff2){_0x17c7ba[_0x4aae('0x46')]=_0xe1aff2;return _0x17c7ba;})[_0x4aae('0x29')](respondWithFilteredResult(_0x24b018,_0x1da16f))[_0x4aae('0x47')](handleError(_0x24b018,null));};exports[_0x4aae('0x48')]=function(_0x392d6f,_0x332d04){var _0x422dca={'raw':!![],'where':{'id':_0x392d6f[_0x4aae('0x49')]['id']}},_0x1e6365={};_0x1e6365['model']=_[_0x4aae('0x32')](db[_0x4aae('0x42')][_0x4aae('0x2d')]);_0x1e6365[_0x4aae('0x31')]=_[_0x4aae('0x32')](_0x392d6f['query']);_0x1e6365[_0x4aae('0x33')]=_['intersection'](_0x1e6365[_0x4aae('0x35')],_0x1e6365[_0x4aae('0x31')]);_0x422dca[_0x4aae('0x36')]=_['intersection'](_0x1e6365[_0x4aae('0x35')],qs[_0x4aae('0x37')](_0x392d6f[_0x4aae('0x31')][_0x4aae('0x37')]));_0x422dca[_0x4aae('0x36')]=_0x422dca[_0x4aae('0x36')]['length']?_0x422dca[_0x4aae('0x36')]:_0x1e6365[_0x4aae('0x35')];if(_0x392d6f[_0x4aae('0x31')][_0x4aae('0x43')]){_0x422dca[_0x4aae('0x44')]=[{'all':!![]}];}_0x422dca=_[_0x4aae('0x40')]({},_0x422dca,_0x392d6f[_0x4aae('0x41')]);return db[_0x4aae('0x42')][_0x4aae('0x4a')](_0x422dca)[_0x4aae('0x29')](handleEntityNotFound(_0x332d04,null))[_0x4aae('0x29')](respondWithResult(_0x332d04,null))['catch'](handleError(_0x332d04,null));};exports['clone']=function(_0x553221,_0x595032){var _0x30165f={'where':{'id':_0x553221[_0x4aae('0x49')]['id']}},_0x4921ba={};_0x4921ba[_0x4aae('0x35')]=_[_0x4aae('0x32')](db[_0x4aae('0x42')][_0x4aae('0x2d')]);_0x30165f[_0x4aae('0x36')]=_[_0x4aae('0x34')](_0x4921ba[_0x4aae('0x35')],qs[_0x4aae('0x37')](_0x553221[_0x4aae('0x31')][_0x4aae('0x37')]));_0x30165f[_0x4aae('0x36')]=_0x30165f[_0x4aae('0x36')][_0x4aae('0x38')]?_0x30165f[_0x4aae('0x36')]:_0x4921ba[_0x4aae('0x35')];if(_0x553221[_0x4aae('0x31')][_0x4aae('0x43')]){_0x30165f[_0x4aae('0x44')]=[{'all':!![]}];}_0x30165f=_[_0x4aae('0x40')]({},_0x30165f,_0x553221[_0x4aae('0x41')]);return db[_0x4aae('0x42')][_0x4aae('0x4a')](_0x30165f)[_0x4aae('0x29')](handleEntityNotFound(_0x595032,null))['then'](function(_0x3f9ca0){if(_0x3f9ca0){var _0x3ea97e=_0x3f9ca0[_0x4aae('0x4b')]({'plain':!![]});_0x3ea97e=qs[_0x4aae('0x4c')](_0x3ea97e,['id',_0x4aae('0x4d'),_0x4aae('0x4e')]);_0x553221['body']=_[_0x4aae('0x4c')](_0x553221['body'],['id','createdAt',_0x4aae('0x4e')]);return db[_0x4aae('0x42')][_0x4aae('0x4f')](_[_0x4aae('0x40')](_0x3ea97e,_0x553221[_0x4aae('0x50')]),{'include':_0x553221[_0x4aae('0x31')][_0x4aae('0x43')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x595032,0xc9))['catch'](handleError(_0x595032,null));};exports[_0x4aae('0x28')]=function(_0x1df41a,_0x52938c){if(_0x1df41a['body']['id']){delete _0x1df41a[_0x4aae('0x50')]['id'];}return db[_0x4aae('0x42')][_0x4aae('0x4a')]({'where':{'id':_0x1df41a[_0x4aae('0x49')]['id']}})[_0x4aae('0x29')](handleEntityNotFound(_0x52938c,null))['then'](saveUpdates(_0x1df41a['body'],null))[_0x4aae('0x29')](respondWithResult(_0x52938c,null))[_0x4aae('0x47')](handleError(_0x52938c,null));};exports[_0x4aae('0x51')]=function(_0x1aad33,_0x25f1be){return db[_0x4aae('0x42')][_0x4aae('0x4a')]({'where':{'id':_0x1aad33[_0x4aae('0x49')]['id']}})[_0x4aae('0x29')](handleEntityNotFound(_0x25f1be,null))[_0x4aae('0x29')](removeEntity(_0x25f1be,null))[_0x4aae('0x47')](handleError(_0x25f1be,null));};exports[_0x4aae('0x4f')]=function(_0x54aa2b,_0x250af5,_0xe1ce2c){_0x54aa2b[_0x4aae('0x50')][_0x4aae('0x30')]=_0x54aa2b[_0x4aae('0x52')]['originalname'];_0x54aa2b[_0x4aae('0x50')][_0x4aae('0x53')]=_0x54aa2b[_0x4aae('0x52')][_0x4aae('0x54')];_0x54aa2b[_0x4aae('0x50')][_0x4aae('0x2e')]=_0x54aa2b[_0x4aae('0x52')][_0x4aae('0x55')];return db[_0x4aae('0x42')][_0x4aae('0x4f')](_0x54aa2b['body'])[_0x4aae('0x29')](respondWithResult(_0x250af5,0xc9))[_0x4aae('0x47')](handleError(_0x250af5,null));};exports[_0x4aae('0x56')]=function(_0xfdd0e8,_0x2fe011,_0x77136d){return db[_0x4aae('0x42')][_0x4aae('0x57')]({'where':{'id':_0xfdd0e8[_0x4aae('0x49')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x2fe011,null))[_0x4aae('0x29')](function(_0x5a4ca6){if(_0x5a4ca6){var _0x1a9e1a=_0x5a4ca6[_0x4aae('0x58')]!==null;var _0x494958=path[_0x4aae('0x59')](config[_0x4aae('0x5a')],'server/files/attachments/');if(_0x1a9e1a){_0x494958=path['join'](_0x494958,_0x4aae('0x5b'));}var _0x6f1c45=path[_0x4aae('0x59')](_0x494958,_0x5a4ca6[_0x4aae('0x53')]);return _0x2fe011['download'](_0x6f1c45);}})[_0x4aae('0x47')](handleError(_0x2fe011,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index aca28ec..b2ec0d7 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 _0x5980=['../../config/logger','api','moment','bluebird','path','../../config/environment','./attachment.attributes','exports','Attachment','lodash','util'];(function(_0x42360c,_0x93aca4){var _0x4a8ac0=function(_0x438d14){while(--_0x438d14){_0x42360c['push'](_0x42360c['shift']());}};_0x4a8ac0(++_0x93aca4);}(_0x5980,0xae));var _0x0598=function(_0x3c2166,_0x41fc16){_0x3c2166=_0x3c2166-0x0;var _0x30ccc3=_0x5980[_0x3c2166];return _0x30ccc3;};'use strict';var _=require(_0x0598('0x0'));var util=require(_0x0598('0x1'));var logger=require(_0x0598('0x2'))(_0x0598('0x3'));var moment=require(_0x0598('0x4'));var BPromise=require(_0x0598('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0598('0x6'));var rimraf=require('rimraf');var config=require(_0x0598('0x7'));var attributes=require(_0x0598('0x8'));module[_0x0598('0x9')]=function(_0x3e8745,_0x44bc79){return _0x3e8745['define'](_0x0598('0xa'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x82ec=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports','define','Attachment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x82ec,0x90));var _0xc82e=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x82ec[_0x17d9e3];return _0x14192d;};'use strict';var _=require('lodash');var util=require(_0xc82e('0x0'));var logger=require('../../config/logger')(_0xc82e('0x1'));var moment=require(_0xc82e('0x2'));var BPromise=require(_0xc82e('0x3'));var rp=require(_0xc82e('0x4'));var fs=require('fs');var path=require(_0xc82e('0x5'));var rimraf=require(_0xc82e('0x6'));var config=require(_0xc82e('0x7'));var attributes=require(_0xc82e('0x8'));module[_0xc82e('0x9')]=function(_0x35e467,_0x2d10ca){return _0x35e467[_0xc82e('0xa')](_0xc82e('0xb'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index fa77db7..fb2b592 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 _0xadb8=['create','body','options','raw','then','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Attachment,\x20%s,\x20%s','message','result','catch','CreateAttachment','Attachment'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xadb8,0x1d0));var _0x8adb=function(_0x1895b7,_0x21fbc7){_0x1895b7=_0x1895b7-0x0;var _0x1aecdc=_0xadb8[_0x1895b7];return _0x1aecdc;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8adb('0x0'));var BPromise=require('bluebird');var rs=require(_0x8adb('0x1'));var fs=require('fs');var Redis=require(_0x8adb('0x2'));var db=require(_0x8adb('0x3'))['db'];var utils=require(_0x8adb('0x4'));var logger=require(_0x8adb('0x5'))(_0x8adb('0x6'));var config=require(_0x8adb('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8adb('0x8')][_0x8adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x9f435,_0x2bebfe,_0x271bed){return new BPromise(function(_0x16b932,_0x27d994){return client['request'](_0x9f435,_0x271bed)['then'](function(_0x58ad1a){logger[_0x8adb('0xa')]('Attachment,\x20%s,\x20%s',_0x2bebfe,'request\x20sent');logger['debug'](_0x8adb('0xb'),_0x2bebfe,_0x8adb('0xc'),JSON[_0x8adb('0xd')](_0x58ad1a));if(_0x58ad1a[_0x8adb('0xe')]){if(_0x58ad1a[_0x8adb('0xe')][_0x8adb('0xf')]===0x1f4){logger[_0x8adb('0xe')](_0x8adb('0x10'),_0x2bebfe,_0x58ad1a[_0x8adb('0xe')][_0x8adb('0x11')]);return _0x27d994(_0x58ad1a['error']['message']);}logger['error'](_0x8adb('0x10'),_0x2bebfe,_0x58ad1a['error'][_0x8adb('0x11')]);return _0x16b932(_0x58ad1a[_0x8adb('0xe')][_0x8adb('0x11')]);}else{logger['info'](_0x8adb('0x10'),_0x2bebfe,_0x8adb('0xc'));_0x16b932(_0x58ad1a[_0x8adb('0x12')][_0x8adb('0x11')]);}})[_0x8adb('0x13')](function(_0x13659c){logger['error'](_0x8adb('0x10'),_0x2bebfe,_0x13659c);_0x27d994(_0x13659c);});});}exports[_0x8adb('0x14')]=function(_0x4ba298){var _0x5a0e22=this;return new Promise(function(_0x18897e,_0x30ef5a){return db[_0x8adb('0x15')][_0x8adb('0x16')](_0x4ba298[_0x8adb('0x17')],{'raw':_0x4ba298[_0x8adb('0x18')]?_0x4ba298[_0x8adb('0x18')][_0x8adb('0x19')]===undefined?!![]:![]:!![]})[_0x8adb('0x1a')](function(_0x2a322d){logger[_0x8adb('0xa')](_0x8adb('0x14'),_0x4ba298);logger['debug']('CreateAttachment',_0x4ba298,JSON[_0x8adb('0xd')](_0x2a322d));_0x18897e(_0x2a322d);})[_0x8adb('0x13')](function(_0x4f33e7){logger[_0x8adb('0xe')](_0x8adb('0x14'),_0x4f33e7[_0x8adb('0x11')],_0x4ba298);_0x30ef5a(_0x5a0e22[_0x8adb('0xe')](0x1f4,_0x4f33e7[_0x8adb('0x11')]));});});}; \ No newline at end of file +var _0x063c=['code','message','info','result','catch','CreateAttachment','Attachment','body','options','debug','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','client','http','then','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x063c,0xba));var _0xc063=function(_0x55e26a,_0x56be87){_0x55e26a=_0x55e26a-0x0;var _0x45d30b=_0x063c[_0x55e26a];return _0x45d30b;};'use strict';var _=require('lodash');var util=require(_0xc063('0x0'));var moment=require(_0xc063('0x1'));var BPromise=require(_0xc063('0x2'));var rs=require(_0xc063('0x3'));var fs=require('fs');var Redis=require(_0xc063('0x4'));var db=require(_0xc063('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc063('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc063('0x7')][_0xc063('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x57ba85,_0x3dbe7c,_0x10716b){return new BPromise(function(_0x3f286a,_0x2f2915){return client['request'](_0x57ba85,_0x10716b)[_0xc063('0x9')](function(_0x421328){logger['info'](_0xc063('0xa'),_0x3dbe7c,_0xc063('0xb'));logger['debug'](_0xc063('0xc'),_0x3dbe7c,'request\x20sent',JSON['stringify'](_0x421328));if(_0x421328['error']){if(_0x421328[_0xc063('0xd')][_0xc063('0xe')]===0x1f4){logger['error'](_0xc063('0xa'),_0x3dbe7c,_0x421328['error'][_0xc063('0xf')]);return _0x2f2915(_0x421328[_0xc063('0xd')][_0xc063('0xf')]);}logger['error'](_0xc063('0xa'),_0x3dbe7c,_0x421328[_0xc063('0xd')][_0xc063('0xf')]);return _0x3f286a(_0x421328[_0xc063('0xd')][_0xc063('0xf')]);}else{logger[_0xc063('0x10')](_0xc063('0xa'),_0x3dbe7c,_0xc063('0xb'));_0x3f286a(_0x421328[_0xc063('0x11')]['message']);}})[_0xc063('0x12')](function(_0xfddf5c){logger['error'](_0xc063('0xa'),_0x3dbe7c,_0xfddf5c);_0x2f2915(_0xfddf5c);});});}exports[_0xc063('0x13')]=function(_0x4dcef1){var _0x238ecb=this;return new Promise(function(_0x13cc09,_0xf87f41){return db[_0xc063('0x14')]['create'](_0x4dcef1[_0xc063('0x15')],{'raw':_0x4dcef1[_0xc063('0x16')]?_0x4dcef1[_0xc063('0x16')]['raw']===undefined?!![]:![]:!![]})[_0xc063('0x9')](function(_0x5fa053){logger['info'](_0xc063('0x13'),_0x4dcef1);logger[_0xc063('0x17')](_0xc063('0x13'),_0x4dcef1,JSON[_0xc063('0x18')](_0x5fa053));_0x13cc09(_0x5fa053);})[_0xc063('0x12')](function(_0x4a82eb){logger['error']('CreateAttachment',_0x4a82eb[_0xc063('0xf')],_0x4dcef1);_0xf87f41(_0x238ecb['error'](0x1f4,_0x4a82eb['message']));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 64313c2..9662c9d 100644 --- a/server/api/attachment/index.js +++ b/server/api/attachment/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2032=['./attachment.controller','get','isAuthenticated','index','/:id','show','download','/:id/clone','clone','root','server/files/attachments/','now','post','single','file','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x2cf27c,_0x43068d){var _0x550865=function(_0x3cc1f7){while(--_0x3cc1f7){_0x2cf27c['push'](_0x2cf27c['shift']());}};_0x550865(++_0x43068d);}(_0x2032,0xd9));var _0x2203=function(_0x40006e,_0x104991){_0x40006e=_0x40006e-0x0;var _0x2899bc=_0x2032[_0x40006e];return _0x2899bc;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['post'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x849049,_0x4a6832,_0x3f690a){_0x3f690a(null,path['join'](config[_0x2203('0x10')],_0x2203('0x11')));},'filename':function(_0x4b9376,_0x583bc7,_0x585c76){_0x585c76(null,util['format']('%s-%s',Date[_0x2203('0x12')](),_0x583bc7['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2203('0x13')]('/',upload[_0x2203('0x14')](_0x2203('0x15')),controller[_0x2203('0x16')]);router[_0x2203('0x17')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0x18')]);router[_0x2203('0x19')](_0x2203('0xb'),auth['isAuthenticated'](),controller[_0x2203('0x1a')]);module[_0x2203('0x1b')]=router; \ No newline at end of file +var _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x2dab77,_0x22ecd8){var _0x252ec0=function(_0x262640){while(--_0x262640){_0x2dab77['push'](_0x2dab77['shift']());}};_0x252ec0(++_0x22ecd8);}(_0x5f2f,0x73));var _0xf5f2=function(_0x34ef2a,_0x41a2f8){_0x34ef2a=_0x34ef2a-0x0;var _0x2213f1=_0x5f2f[_0x34ef2a];return _0x2213f1;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index 2efa3b4..b64414f 100644 --- a/server/api/authActiveDirectory/authActiveDirectory.controller.js +++ b/server/api/authActiveDirectory/authActiveDirectory.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf91a=['role','disabled','online','admin','user','agent','blocked','blockedAt','add','clearBlockUser','getLicense','catch','status','send','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','User','passport','passport-local','Strategy','moment','activedirectory2','bluebird','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Setting','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt'];(function(_0x1c82e4,_0x2a1eee){var _0x25ff67=function(_0x550787){while(--_0x550787){_0x1c82e4['push'](_0x1c82e4['shift']());}};_0x25ff67(++_0x2a1eee);}(_0xf91a,0x1b5));var _0xaf91=function(_0x2de095,_0x191f9b){_0x2de095=_0x2de095-0x0;var _0x58380e=_0xf91a[_0x2de095];return _0x58380e;};'use strict';var passport=require(_0xaf91('0x0'));var LocalStrategy=require(_0xaf91('0x1'))[_0xaf91('0x2')];var moment=require(_0xaf91('0x3'));var ActiveDirectory=require(_0xaf91('0x4'));var BPromise=require(_0xaf91('0x5'));var util=require('util');var db=require(_0xaf91('0x6'))['db'];var authService=require(_0xaf91('0x7'));var utils=require(_0xaf91('0x8'));var config=require(_0xaf91('0x9'));var logger=require(_0xaf91('0xa'))(_0xaf91('0xb'));function isActiveDirectoryConfigured(_0x5173bf){var _0x2e7417=![];if(typeof _0x5173bf[_0xaf91('0xc')]!==_0xaf91('0xd')){_0x2e7417=_0x5173bf[_0xaf91('0xc')][_0xaf91('0xe')]&&_0x5173bf[_0xaf91('0xc')]['url']&&_0x5173bf[_0xaf91('0xc')][_0xaf91('0xf')];}return _0x2e7417;}function adAuthenticate(_0x5d2011,_0x251034,_0x30e865){return new BPromise(function(_0x1c1e34,_0x13cea9){try{var _0x1c9b16=new ActiveDirectory(_0x5d2011);_0x1c9b16[_0xaf91('0x10')](_0x251034,_0x30e865,function(_0x3c5fe1,_0x49db4c){if(_0x3c5fe1){logger[_0xaf91('0x11')](_0xaf91('0x12'),_0x251034,util[_0xaf91('0x13')](_0x3c5fe1,{'showHidden':![],'depth':null}));_0x13cea9('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x49db4c){logger[_0xaf91('0x11')](_0xaf91('0x14'),_0x251034);_0x13cea9(_0xaf91('0x15'));}else{_0x1c1e34(_0x49db4c);}});}catch(_0x2b2fd4){_0x13cea9(_0x2b2fd4);}});}function ActiveDirectoryAuthenticate(_0x134cd9,_0x2b9afd,_0x54e9f7,_0x2405ef){var _0x16de76,_0x140ee3;if(!isActiveDirectoryConfigured(config)){logger[_0xaf91('0x11')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x2b9afd);return _0x2405ef(null,![],{'message':_0xaf91('0x15')});}return db[_0xaf91('0x16')][_0xaf91('0x17')]({'where':{'id':0x1},'attributes':[_0xaf91('0x18'),_0xaf91('0x19')],'raw':!![]})[_0xaf91('0x1a')](function(_0x1a2831){_0x16de76=_0x1a2831;if(!_0x16de76[_0xaf91('0x18')]){logger[_0xaf91('0x11')](_0xaf91('0x1b'),_0x2b9afd);throw new Error(_0xaf91('0x15'));}return _0x134cd9['findOne']({'attributes':['id',_0xaf91('0x1c'),_0xaf91('0x1d'),_0xaf91('0x1e'),_0xaf91('0x1f'),_0xaf91('0x20'),'blocked','blockedAt',_0xaf91('0x21')],'where':{'name':_0x2b9afd,'role':{'$or':[_0xaf91('0x22'),_0xaf91('0x23'),_0xaf91('0x24')]},'adSsoEnabled':!![]}});})[_0xaf91('0x1a')](function(_0x14e3fc){if(!_0x14e3fc||_0x14e3fc&&_0x14e3fc['name']!==_0x2b9afd){throw new Error(_0xaf91('0x15'));}_0x140ee3=_0x14e3fc;var _0x3bc513=_0x140ee3['name']+'@'+config[_0xaf91('0xc')][_0xaf91('0xf')];return adAuthenticate(config['activedirectory'],_0x3bc513,_0x54e9f7);})[_0xaf91('0x1a')](function(_0xa94e21){if(_0x140ee3[_0xaf91('0x20')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x16de76[_0xaf91('0x19')]>0x0){if(_0x140ee3[_0xaf91('0x25')]){if(moment(_0x140ee3[_0xaf91('0x26')])[_0xaf91('0x27')](_0x16de76[_0xaf91('0x19')],'minutes')>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0xaf91('0x28')](_0x140ee3,0x0,![],null)[_0xaf91('0x1a')](function(){return utils[_0xaf91('0x29')](_0x140ee3);})[_0xaf91('0x1a')](function(){return _0x2405ef(null,_0x140ee3);});}else{return utils[_0xaf91('0x29')](_0x140ee3)[_0xaf91('0x1a')](function(){return _0x2405ef(null,_0x140ee3);});}}else{return utils[_0xaf91('0x29')](_0x140ee3)[_0xaf91('0x1a')](function(){return _0x2405ef(null,_0x140ee3);});}})[_0xaf91('0x2a')](function(_0x3999ae){return _0x2405ef(null,![],_0x3999ae);});}function handleError(_0x1b0292,_0x3b9083,_0x5536c9){return _0x1b0292[_0xaf91('0x2b')](_0x3b9083||0x1f4)[_0xaf91('0x2c')]({'message':_0x5536c9?_0x5536c9['message']||_0x5536c9:''});}exports[_0xaf91('0x2d')]=function(_0x37acdf,_0x4a550a,_0x2d3ea2){passport[_0xaf91('0x10')](_0xaf91('0x2e'),function(_0x1eb395,_0x3c11a7,_0x8ace74){var _0x4c5e82=_0x1eb395||_0x8ace74;if(_0x4c5e82){return handleError(_0x4a550a,0x191,_0x4c5e82);}if(!_0x3c11a7){return handleError(_0x4a550a,0x194,{'message':_0xaf91('0x2f')});}else{var _0x3070f9={'payload':{'id':_0x3c11a7['id'],'role':_0x3c11a7['role']},'options':{'expiresIn':0x15180}};return authService[_0xaf91('0x30')](_0x3070f9)[_0xaf91('0x1a')](function(_0x154deb){_0x4a550a[_0xaf91('0x31')]({'id':_0x3c11a7['id'],'token':_0x154deb,'statusCall':'','isAlreadyLogged':_0x3c11a7['online']});});}})(_0x37acdf,_0x4a550a,_0x2d3ea2);};passport[_0xaf91('0x32')](_0xaf91('0x2e'),new LocalStrategy({'usernameField':_0xaf91('0x1c'),'passwordField':_0xaf91('0x1d')},function(_0x19db2d,_0x544eb8,_0x41747c){return ActiveDirectoryAuthenticate(db[_0xaf91('0x33')],_0x19db2d,_0x544eb8,_0x41747c);})); \ No newline at end of file +var _0xdc2c=['findOne','name','role','disabled','blocked','blockedAt','user','agent','then','add','minutes','clearBlockUser','getLicense','send','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','password','User','passport','moment','activedirectory2','bluebird','util','../../mysqldb','../../config/utils','../../config/environment','api','undefined','activedirectory','url','domain','authenticate','Error\x20authenticate\x20%s:\x20%s','error','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','adSsoEnabled','blockDuration'];(function(_0x1493f7,_0x2700ac){var _0x5c8485=function(_0xaafb0c){while(--_0xaafb0c){_0x1493f7['push'](_0x1493f7['shift']());}};_0x5c8485(++_0x2700ac);}(_0xdc2c,0x1e3));var _0xcdc2=function(_0x3c688c,_0x41a843){_0x3c688c=_0x3c688c-0x0;var _0x1d86c9=_0xdc2c[_0x3c688c];return _0x1d86c9;};'use strict';var passport=require(_0xcdc2('0x0'));var LocalStrategy=require('passport-local')['Strategy'];var moment=require(_0xcdc2('0x1'));var ActiveDirectory=require(_0xcdc2('0x2'));var BPromise=require(_0xcdc2('0x3'));var util=require(_0xcdc2('0x4'));var db=require(_0xcdc2('0x5'))['db'];var authService=require('../../components/auth/service');var utils=require(_0xcdc2('0x6'));var config=require(_0xcdc2('0x7'));var logger=require('../../config/logger')(_0xcdc2('0x8'));function isActiveDirectoryConfigured(_0x8ee7d0){var _0x3b4fce=![];if(typeof _0x8ee7d0['activedirectory']!==_0xcdc2('0x9')){_0x3b4fce=_0x8ee7d0[_0xcdc2('0xa')]['baseDN']&&_0x8ee7d0[_0xcdc2('0xa')][_0xcdc2('0xb')]&&_0x8ee7d0['activedirectory'][_0xcdc2('0xc')];}return _0x3b4fce;}function adAuthenticate(_0x1e51b3,_0x61baa8,_0x1ea301){return new BPromise(function(_0x154dc1,_0x26ee8e){try{var _0x22a4c5=new ActiveDirectory(_0x1e51b3);_0x22a4c5[_0xcdc2('0xd')](_0x61baa8,_0x1ea301,function(_0x14ae4f,_0x387fa7){if(_0x14ae4f){logger['error'](_0xcdc2('0xe'),_0x61baa8,util['inspect'](_0x14ae4f,{'showHidden':![],'depth':null}));_0x26ee8e('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x387fa7){logger[_0xcdc2('0xf')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x61baa8);_0x26ee8e(_0xcdc2('0x10'));}else{_0x154dc1(_0x387fa7);}});}catch(_0x252b18){_0x26ee8e(_0x252b18);}});}function ActiveDirectoryAuthenticate(_0x237b41,_0x5c5eca,_0xe3cc8a,_0x1bf5c4){var _0x28892a,_0x167edc;if(!isActiveDirectoryConfigured(config)){logger[_0xcdc2('0xf')](_0xcdc2('0x11'),_0x5c5eca);return _0x1bf5c4(null,![],{'message':_0xcdc2('0x10')});}return db[_0xcdc2('0x12')]['findOne']({'where':{'id':0x1},'attributes':[_0xcdc2('0x13'),_0xcdc2('0x14')],'raw':!![]})['then'](function(_0x497174){_0x28892a=_0x497174;if(!_0x28892a[_0xcdc2('0x13')]){logger[_0xcdc2('0xf')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x5c5eca);throw new Error(_0xcdc2('0x10'));}return _0x237b41[_0xcdc2('0x15')]({'attributes':['id',_0xcdc2('0x16'),'password','salt',_0xcdc2('0x17'),_0xcdc2('0x18'),_0xcdc2('0x19'),_0xcdc2('0x1a'),'online'],'where':{'name':_0x5c5eca,'role':{'$or':['admin',_0xcdc2('0x1b'),_0xcdc2('0x1c')]},'adSsoEnabled':!![]}});})['then'](function(_0x416651){if(!_0x416651||_0x416651&&_0x416651['name']!==_0x5c5eca){throw new Error(_0xcdc2('0x10'));}_0x167edc=_0x416651;var _0xdde3df=_0x167edc['name']+'@'+config[_0xcdc2('0xa')][_0xcdc2('0xc')];return adAuthenticate(config[_0xcdc2('0xa')],_0xdde3df,_0xe3cc8a);})[_0xcdc2('0x1d')](function(_0x249810){if(_0x167edc[_0xcdc2('0x18')]){throw new Error(_0xcdc2('0x10'));}if(_0x28892a['blockDuration']>0x0){if(_0x167edc[_0xcdc2('0x19')]){if(moment(_0x167edc[_0xcdc2('0x1a')])[_0xcdc2('0x1e')](_0x28892a[_0xcdc2('0x14')],_0xcdc2('0x1f'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0xcdc2('0x20')](_0x167edc,0x0,![],null)['then'](function(){return utils['getLicense'](_0x167edc);})[_0xcdc2('0x1d')](function(){return _0x1bf5c4(null,_0x167edc);});}else{return utils[_0xcdc2('0x21')](_0x167edc)[_0xcdc2('0x1d')](function(){return _0x1bf5c4(null,_0x167edc);});}}else{return utils[_0xcdc2('0x21')](_0x167edc)['then'](function(){return _0x1bf5c4(null,_0x167edc);});}})['catch'](function(_0x1dd93f){return _0x1bf5c4(null,![],_0x1dd93f);});}function handleError(_0x1e4b32,_0x64e72f,_0x591229){return _0x1e4b32['status'](_0x64e72f||0x1f4)[_0xcdc2('0x22')]({'message':_0x591229?_0x591229['message']||_0x591229:''});}exports[_0xcdc2('0x23')]=function(_0x2a9b04,_0x26d12e,_0xbf5780){passport['authenticate'](_0xcdc2('0x24'),function(_0x324708,_0x45e49e,_0x5aa34b){var _0x280266=_0x324708||_0x5aa34b;if(_0x280266){return handleError(_0x26d12e,0x191,_0x280266);}if(!_0x45e49e){return handleError(_0x26d12e,0x194,{'message':_0xcdc2('0x25')});}else{var _0x42fed2={'payload':{'id':_0x45e49e['id'],'role':_0x45e49e[_0xcdc2('0x17')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x42fed2)[_0xcdc2('0x1d')](function(_0x31deee){_0x26d12e[_0xcdc2('0x26')]({'id':_0x45e49e['id'],'token':_0x31deee,'statusCall':'','isAlreadyLogged':_0x45e49e[_0xcdc2('0x27')]});});}})(_0x2a9b04,_0x26d12e,_0xbf5780);};passport['use'](_0xcdc2('0x24'),new LocalStrategy({'usernameField':_0xcdc2('0x16'),'passwordField':_0xcdc2('0x28')},function(_0xddbfe2,_0x4c08a0,_0x19169a){return ActiveDirectoryAuthenticate(db[_0xcdc2('0x29')],_0xddbfe2,_0x4c08a0,_0x19169a);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index 28df517..9c6a899 100644 --- a/server/api/authActiveDirectory/index.js +++ b/server/api/authActiveDirectory/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x794c=['./authActiveDirectory.controller','login','exports','express','Router'];(function(_0x4ec3b5,_0x31b5c8){var _0x50806b=function(_0x39030a){while(--_0x39030a){_0x4ec3b5['push'](_0x4ec3b5['shift']());}};_0x50806b(++_0x31b5c8);}(_0x794c,0xa3));var _0xc794=function(_0x20d54d,_0x1adc8e){_0x20d54d=_0x20d54d-0x0;var _0x516e8b=_0x794c[_0x20d54d];return _0x516e8b;};'use strict';var express=require(_0xc794('0x0'));var router=express[_0xc794('0x1')]();var controller=require(_0xc794('0x2'));router['post']('/',controller[_0xc794('0x3')]);module[_0xc794('0x4')]=router; \ No newline at end of file +var _0x05c0=['post','login','express','Router','./authActiveDirectory.controller'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x05c0,0x11a));var _0x005c=function(_0x490393,_0x3f5b95){_0x490393=_0x490393-0x0;var _0x554450=_0x05c0[_0x490393];return _0x554450;};'use strict';var express=require(_0x005c('0x0'));var router=express[_0x005c('0x1')]();var controller=require(_0x005c('0x2'));router[_0x005c('0x3')]('/',controller[_0x005c('0x4')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 1a130a1..b85ebc6 100644 --- a/server/api/authGoogle/authGoogle.controller.js +++ b/server/api/authGoogle/authGoogle.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0x7a54,0x106));var _0x47a5=function(_0x4c4cf1,_0x3e37ea){_0x4c4cf1=_0x4c4cf1-0x0;var _0x122c9d=_0x7a54[_0x4c4cf1];return _0x122c9d;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});})); \ No newline at end of file +var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x7a54,0x106));var _0x47a5=function(_0xcdfce2,_0xfec5b6){_0xcdfce2=_0xcdfce2-0x0;var _0x1ffa66=_0x7a54[_0xcdfce2];return _0x1ffa66;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 695267f..3e92761 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 _0xe49a=['get','login','/callback','callback','isMiddleware','setTokenCookie','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service'];(function(_0x13620a,_0x21e76b){var _0x1cc16d=function(_0x2fa0a3){while(--_0x2fa0a3){_0x13620a['push'](_0x13620a['shift']());}};_0x1cc16d(++_0x21e76b);}(_0xe49a,0xd7));var _0xae49=function(_0x2b3fbb,_0x5589cd){_0x2b3fbb=_0x2b3fbb-0x0;var _0x1b2192=_0xe49a[_0x2b3fbb];return _0x1b2192;};'use strict';var express=require('express');var passport=require(_0xae49('0x0'));var router=express[_0xae49('0x1')]();var controller=require(_0xae49('0x2'));var userController=require(_0xae49('0x3'));var authService=require(_0xae49('0x4'));router[_0xae49('0x5')]('/',controller[_0xae49('0x6')]);router['get'](_0xae49('0x7'),controller[_0xae49('0x8')],authService[_0xae49('0x9')],userController['login'],authService[_0xae49('0xa')]);module['exports']=router; \ No newline at end of file +var _0xe781=['passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback','callback','isMiddleware','setTokenCookie','exports','express'];(function(_0x2f1d28,_0xbbfd1c){var _0x1480a6=function(_0xf7c07a){while(--_0xf7c07a){_0x2f1d28['push'](_0x2f1d28['shift']());}};_0x1480a6(++_0xbbfd1c);}(_0xe781,0xdc));var _0x1e78=function(_0x2687e5,_0x5d297f){_0x2687e5=_0x2687e5-0x0;var _0x2e7d32=_0xe781[_0x2687e5];return _0x2e7d32;};'use strict';var express=require(_0x1e78('0x0'));var passport=require(_0x1e78('0x1'));var router=express[_0x1e78('0x2')]();var controller=require(_0x1e78('0x3'));var userController=require(_0x1e78('0x4'));var authService=require(_0x1e78('0x5'));router[_0x1e78('0x6')]('/',controller[_0x1e78('0x7')]);router[_0x1e78('0x6')](_0x1e78('0x8'),controller[_0x1e78('0x9')],authService[_0x1e78('0xa')],userController[_0x1e78('0x7')],authService[_0x1e78('0xb')]);module[_0x1e78('0xc')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index de1b1a3..1192b06 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 _0x873b=['SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','message','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','forgot','body','Email\x20parameter\x20is\x20missing','trim','toLowerCase','find','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','add','minutes','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','headers','host','/reset/','status','Reset\x20Email\x20sent!','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','Setting','securePassword','validatePasswordPattern','enforcePasswordHistory','previousPasswords','validatePasswordHistory','passwordHistoryLimit','resetPasswordExpires','Password\x20reset!','use','User','util','passport','passport-local','Strategy','lodash','../../components/auth/service','../../config/utils','client','http','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','blocked','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','disabled','clearBlockUser','getLicense','catch','email','MailServerOut','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','Smtp','SendMail'];(function(_0x2dad23,_0x5183a8){var _0x3bde6e=function(_0x158c1e){while(--_0x158c1e){_0x2dad23['push'](_0x2dad23['shift']());}};_0x3bde6e(++_0x5183a8);}(_0x873b,0x7d));var _0xb873=function(_0x8bca3f,_0x158cf8){_0x8bca3f=_0x8bca3f-0x0;var _0x448ab5=_0x873b[_0x8bca3f];return _0x448ab5;};'use strict';var util=require(_0xb873('0x0'));var passport=require(_0xb873('0x1'));var LocalStrategy=require(_0xb873('0x2'))[_0xb873('0x3')];var jayson=require('jayson/promise');var _=require(_0xb873('0x4'));var rs=require('randomstring');var moment=require('moment');var db=require('../../mysqldb')['db'];var authService=require(_0xb873('0x5'));var utils=require(_0xb873('0x6'));var client=jayson[_0xb873('0x7')][_0xb873('0x8')]({'port':0x232b});function localAuthenticate(_0x138307,_0x3bbed5,_0x3fc6e9,_0x71c3e6){var _0x305e13,_0x37b977;return db['Setting'][_0xb873('0x9')]({'where':{'id':0x1},'attributes':[_0xb873('0xa'),_0xb873('0xb')],'raw':!![]})[_0xb873('0xc')](function(_0xc4f8b9){_0x305e13=_0xc4f8b9;return _0x138307[_0xb873('0x9')]({'attributes':['id',_0xb873('0xd'),_0xb873('0xe'),_0xb873('0xf'),_0xb873('0x10'),'disabled',_0xb873('0x11'),_0xb873('0x12'),_0xb873('0x13')],'where':{'name':_0x3bbed5,'role':{'$or':[_0xb873('0x14'),_0xb873('0x15'),_0xb873('0x16')]}}});})[_0xb873('0xc')](function(_0x44af5c){if(!_0x44af5c||_0x44af5c&&_0x44af5c['name']!==_0x3bbed5){throw new Error(_0xb873('0x17'));}else{_0x37b977=_0x44af5c;return _0x37b977;}})[_0xb873('0xc')](function(){_0x37b977[_0xb873('0x18')](_0x3fc6e9,function(_0x2e6340,_0x3151ca){var _0x18e625=_0x37b977[_0xb873('0x13')]+0x1;if(_0x2e6340){return _0x71c3e6(_0x2e6340);}else if(!_0x3151ca){if(_0x37b977[_0xb873('0x19')]){return _0x71c3e6(null,![],{'message':_0xb873('0x17')});}else if(_0x305e13[_0xb873('0xa')]>0x0){if(_0x37b977[_0xb873('0x11')]){if(_0x305e13[_0xb873('0xb')]>0x0){if(moment(_0x37b977[_0xb873('0x12')])['add'](_0x305e13[_0xb873('0xb')],'minutes')>moment()){return _0x71c3e6(null,![],{'message':_0xb873('0x17')});}else{return utils[_0xb873('0x1a')](_0x37b977,_0x18e625,![],null)['then'](function(){return _0x71c3e6(null,![],{'message':_0xb873('0x17')});});}}else{return _0x71c3e6(null,![],{'message':_0xb873('0x17')});}}else{if(_0x18e625>=_0x305e13[_0xb873('0xa')]){return utils[_0xb873('0x1a')](_0x37b977,0x0,!![],moment())[_0xb873('0xc')](function(){return _0x71c3e6(null,![],{'message':_0xb873('0x17')});});}else{return utils['clearBlockUser'](_0x37b977,_0x18e625,![],null)['then'](function(){return _0x71c3e6(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x71c3e6(null,![],{'message':_0xb873('0x17')});}}else{if(_0x37b977[_0xb873('0x19')]){return _0x71c3e6(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x305e13[_0xb873('0xa')]>0x0){if(_0x37b977[_0xb873('0x11')]){if(_0x305e13['blockDuration']>0x0){if(moment(_0x37b977['blockedAt'])['add'](_0x305e13[_0xb873('0xb')],'minutes')>moment()){return _0x71c3e6(null,![],{'message':_0xb873('0x17')});}else{return utils[_0xb873('0x1a')](_0x37b977,0x0,![],null)['then'](function(){return utils['getLicense'](_0x37b977);})[_0xb873('0xc')](function(){return _0x71c3e6(null,_0x37b977);});}}else{return _0x71c3e6(null,![],{'message':_0xb873('0x17')});}}else{return utils[_0xb873('0x1a')](_0x37b977,0x0,![],null)[_0xb873('0xc')](function(){return utils[_0xb873('0x1b')](_0x37b977);})[_0xb873('0xc')](function(){return _0x71c3e6(null,_0x37b977);})[_0xb873('0x1c')](function(_0x2802e2){return _0x71c3e6(null,![],_0x2802e2);});}}else{if(_0x37b977[_0xb873('0x11')]){return _0x71c3e6(null,![],{'message':_0xb873('0x17')});}else{return utils[_0xb873('0x1b')](_0x37b977)[_0xb873('0xc')](function(){return _0x71c3e6(null,_0x37b977);});}}}});})[_0xb873('0x1c')](function(_0x40ea99){return _0x71c3e6(null,![],_0x40ea99);});}function sendServiceMail(_0x551307){return db['MailAccount']['find']({'where':{'service':!![]},'attributes':['id',_0xb873('0xd'),_0xb873('0x1d')],'include':[{'model':db[_0xb873('0x1e')],'as':'Smtp','include':[{'model':db[_0xb873('0x1f')],'as':_0xb873('0x1f')}]}]})[_0xb873('0xc')](function(_0x4f3be9){if(!_0x4f3be9){throw new Error(_0xb873('0x20'));}var _0xb6c6a8=_0x4f3be9[_0xb873('0x21')]();var _0x1cd877={'account':_0xb6c6a8,'message':_[_0xb873('0x22')]({'from':util[_0xb873('0x23')](_0xb873('0x24'),_0x4f3be9[_0xb873('0xd')],_0x4f3be9['email']||_0x4f3be9[_0xb873('0x25')][_0xb873('0x15')])},_0x551307)};return client['request'](_0xb873('0x26'),_0x1cd877);})[_0xb873('0xc')](function(_0x5ad49d){if(_0x5ad49d['error']){throw new Error(util[_0xb873('0x23')](_0xb873('0x27'),_0x5ad49d[_0xb873('0x28')][_0xb873('0x29')]||JSON['stringify'](_0x5ad49d[_0xb873('0x28')])));}return!![];});}function handleError(_0x130153,_0x212b5c,_0x265e25){return _0x130153['status'](_0x212b5c||0x1f4)[_0xb873('0x2a')]({'message':_0x265e25?_0x265e25[_0xb873('0x29')]||_0x265e25:''});}exports[_0xb873('0x2b')]=function(_0x10e780,_0x1d13d9,_0x2368c7){passport[_0xb873('0x18')](_0xb873('0x2c'),function(_0x46eb41,_0x29e70b,_0x4878a8){var _0x2ef0da=_0x46eb41||_0x4878a8;if(_0x2ef0da){return handleError(_0x1d13d9,0x191,_0x2ef0da);}if(!_0x29e70b){return handleError(_0x1d13d9,0x194,{'message':_0xb873('0x2d')});}else{var _0x1515e7={'payload':{'id':_0x29e70b['id'],'role':_0x29e70b[_0xb873('0x10')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x1515e7)['then'](function(_0x4e8430){_0x1d13d9[_0xb873('0x2e')]({'id':_0x29e70b['id'],'token':_0x4e8430,'statusCall':'','isAlreadyLogged':_0x29e70b[_0xb873('0x2f')]});});}})(_0x10e780,_0x1d13d9,_0x2368c7);};exports[_0xb873('0x30')]=function(_0x50b5b9,_0x13d88c){if(!_0x50b5b9[_0xb873('0x31')]['email']){return handleError(_0x13d88c,0x1f4,{'message':_0xb873('0x32')});}var _0x2d2138=rs['generate']();_0x50b5b9[_0xb873('0x31')]['email']=_0x50b5b9['body'][_0xb873('0x1d')][_0xb873('0x33')]()[_0xb873('0x34')]();var _0x1d7f56;return db['Setting'][_0xb873('0x9')]({'where':{'id':0x1},'attributes':[_0xb873('0xa'),_0xb873('0xb')],'raw':!![]})[_0xb873('0xc')](function(_0x2ffa2c){_0x1d7f56=_0x2ffa2c;return db['User'][_0xb873('0x35')]({'where':{'email':_0x50b5b9[_0xb873('0x31')][_0xb873('0x1d')]}});})[_0xb873('0xc')](function(_0x5b351f){if(!_0x5b351f){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x5b351f[_0xb873('0x19')]){throw new Error(_0xb873('0x36'));}if(_0x5b351f[_0xb873('0x11')]){if(moment(_0x5b351f[_0xb873('0x12')])[_0xb873('0x37')](_0x1d7f56[_0xb873('0xb')],_0xb873('0x38'))>moment()){throw new Error(_0xb873('0x39'));}else{_0x5b351f[_0xb873('0x11')]=![];_0x5b351f['blockedAt']=null;}}_0x5b351f[_0xb873('0x3a')]=_0x2d2138;_0x5b351f['resetPasswordExpires']=Date[_0xb873('0x3b')]()+0x36ee80;return _0x5b351f[_0xb873('0x3c')]();})['then'](function(){return sendServiceMail({'to':_0x50b5b9[_0xb873('0x31')][_0xb873('0x1d')],'subject':_0xb873('0x3d'),'text':_0xb873('0x3e')+_0xb873('0x3f')+'https://'+_0x50b5b9[_0xb873('0x40')][_0xb873('0x41')]+_0xb873('0x42')+_0x2d2138+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0xb873('0xc')](function(){_0x13d88c[_0xb873('0x43')](0xc8)['send']({'message':_0xb873('0x44')});})[_0xb873('0x1c')](function(_0x1a0fdf){return handleError(_0x13d88c,0x1f4,_0x1a0fdf);});};exports['reset']=function(_0x3c139b,_0x4bbea1){return db['User'][_0xb873('0x35')]({'where':{'resetPasswordToken':_0x3c139b['params'][_0xb873('0x45')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0xb873('0xc')](function(_0x3c57bc){if(!_0x3c57bc){throw new Error(_0xb873('0x46'));}return db[_0xb873('0x47')]['findOne']({'attributes':['id',_0xb873('0x48'),'enforcePasswordHistory','passwordHistoryLimit']})[_0xb873('0xc')](function(_0x5c42e0){if(_0x5c42e0[_0xb873('0x48')])authService[_0xb873('0x49')](_0x3c139b[_0xb873('0x31')][_0xb873('0xe')]);if(!_0x5c42e0[_0xb873('0x4a')]||!_0x3c57bc[_0xb873('0x4b')])return _0x3c57bc;authService[_0xb873('0x4c')](_0x3c139b[_0xb873('0x31')]['password'],_0x3c57bc[_0xb873('0x4b')],_0x5c42e0[_0xb873('0x4d')]);return _0x3c57bc;})[_0xb873('0xc')](function(){_0x3c57bc['password']=_0x3c139b[_0xb873('0x31')]['password'];_0x3c57bc[_0xb873('0x3a')]=null;_0x3c57bc[_0xb873('0x4e')]=null;return _0x3c57bc['save']();});})[_0xb873('0xc')](function(){_0x4bbea1[_0xb873('0x43')](0xc8)[_0xb873('0x2a')]({'message':_0xb873('0x4f')});})[_0xb873('0x1c')](function(_0x1b657e){return handleError(_0x4bbea1,0x1f4,_0x1b657e);});};passport[_0xb873('0x50')](_0xb873('0x2c'),new LocalStrategy({'usernameField':_0xb873('0xd'),'passwordField':_0xb873('0xe')},function(_0x4a13a1,_0x43fe1b,_0x1e0ebf){return localAuthenticate(db[_0xb873('0x51')],_0x4a13a1,_0x43fe1b,_0x1e0ebf);})); \ No newline at end of file +var _0xefc7=['SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','status','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','send','Reset\x20Email\x20sent!','reset','params','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','passwordHistoryLimit','previousPasswords','validatePasswordHistory','save','Password\x20reset!','use','util','passport-local','Strategy','jayson/promise','lodash','randomstring','../../components/auth/service','client','http','Setting','findOne','allowedLoginAttempts','then','password','salt','role','disabled','blocked','loginAttempts','admin','user','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blockDuration','blockedAt','add','clearBlockUser','minutes','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error'];(function(_0x9f930a,_0x44051e){var _0x3fa0ce=function(_0x289da7){while(--_0x289da7){_0x9f930a['push'](_0x9f930a['shift']());}};_0x3fa0ce(++_0x44051e);}(_0xefc7,0x78));var _0x7efc=function(_0x1f3c77,_0xab5864){_0x1f3c77=_0x1f3c77-0x0;var _0x5bc8b6=_0xefc7[_0x1f3c77];return _0x5bc8b6;};'use strict';var util=require(_0x7efc('0x0'));var passport=require('passport');var LocalStrategy=require(_0x7efc('0x1'))[_0x7efc('0x2')];var jayson=require(_0x7efc('0x3'));var _=require(_0x7efc('0x4'));var rs=require(_0x7efc('0x5'));var moment=require('moment');var db=require('../../mysqldb')['db'];var authService=require(_0x7efc('0x6'));var utils=require('../../config/utils');var client=jayson[_0x7efc('0x7')][_0x7efc('0x8')]({'port':0x232b});function localAuthenticate(_0x389d4d,_0x322a12,_0x6d6cb4,_0x490d59){var _0x241ea1,_0x27b1e2;return db[_0x7efc('0x9')][_0x7efc('0xa')]({'where':{'id':0x1},'attributes':[_0x7efc('0xb'),'blockDuration'],'raw':!![]})[_0x7efc('0xc')](function(_0xdadff3){_0x241ea1=_0xdadff3;return _0x389d4d['findOne']({'attributes':['id','name',_0x7efc('0xd'),_0x7efc('0xe'),_0x7efc('0xf'),_0x7efc('0x10'),_0x7efc('0x11'),'blockedAt',_0x7efc('0x12')],'where':{'name':_0x322a12,'role':{'$or':[_0x7efc('0x13'),_0x7efc('0x14'),'agent']}}});})[_0x7efc('0xc')](function(_0xd0aa56){if(!_0xd0aa56||_0xd0aa56&&_0xd0aa56[_0x7efc('0x15')]!==_0x322a12){throw new Error(_0x7efc('0x16'));}else{_0x27b1e2=_0xd0aa56;return _0x27b1e2;}})[_0x7efc('0xc')](function(){_0x27b1e2[_0x7efc('0x17')](_0x6d6cb4,function(_0x49603e,_0xf55985){var _0x16f1af=_0x27b1e2[_0x7efc('0x12')]+0x1;if(_0x49603e){return _0x490d59(_0x49603e);}else if(!_0xf55985){if(_0x27b1e2[_0x7efc('0x10')]){return _0x490d59(null,![],{'message':_0x7efc('0x16')});}else if(_0x241ea1[_0x7efc('0xb')]>0x0){if(_0x27b1e2[_0x7efc('0x11')]){if(_0x241ea1[_0x7efc('0x18')]>0x0){if(moment(_0x27b1e2[_0x7efc('0x19')])[_0x7efc('0x1a')](_0x241ea1[_0x7efc('0x18')],'minutes')>moment()){return _0x490d59(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x27b1e2,_0x16f1af,![],null)['then'](function(){return _0x490d59(null,![],{'message':_0x7efc('0x16')});});}}else{return _0x490d59(null,![],{'message':_0x7efc('0x16')});}}else{if(_0x16f1af>=_0x241ea1['allowedLoginAttempts']){return utils[_0x7efc('0x1b')](_0x27b1e2,0x0,!![],moment())[_0x7efc('0xc')](function(){return _0x490d59(null,![],{'message':_0x7efc('0x16')});});}else{return utils['clearBlockUser'](_0x27b1e2,_0x16f1af,![],null)[_0x7efc('0xc')](function(){return _0x490d59(null,![],{'message':_0x7efc('0x16')});});}}}else{return _0x490d59(null,![],{'message':_0x7efc('0x16')});}}else{if(_0x27b1e2[_0x7efc('0x10')]){return _0x490d59(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x241ea1[_0x7efc('0xb')]>0x0){if(_0x27b1e2[_0x7efc('0x11')]){if(_0x241ea1[_0x7efc('0x18')]>0x0){if(moment(_0x27b1e2[_0x7efc('0x19')])[_0x7efc('0x1a')](_0x241ea1['blockDuration'],_0x7efc('0x1c'))>moment()){return _0x490d59(null,![],{'message':_0x7efc('0x16')});}else{return utils[_0x7efc('0x1b')](_0x27b1e2,0x0,![],null)[_0x7efc('0xc')](function(){return utils[_0x7efc('0x1d')](_0x27b1e2);})['then'](function(){return _0x490d59(null,_0x27b1e2);});}}else{return _0x490d59(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils['clearBlockUser'](_0x27b1e2,0x0,![],null)[_0x7efc('0xc')](function(){return utils['getLicense'](_0x27b1e2);})[_0x7efc('0xc')](function(){return _0x490d59(null,_0x27b1e2);})[_0x7efc('0x1e')](function(_0x44258f){return _0x490d59(null,![],_0x44258f);});}}else{if(_0x27b1e2[_0x7efc('0x11')]){return _0x490d59(null,![],{'message':_0x7efc('0x16')});}else{return utils[_0x7efc('0x1d')](_0x27b1e2)['then'](function(){return _0x490d59(null,_0x27b1e2);});}}}});})[_0x7efc('0x1e')](function(_0x45a885){return _0x490d59(null,![],_0x45a885);});}function sendServiceMail(_0xa407dc){return db[_0x7efc('0x1f')][_0x7efc('0x20')]({'where':{'service':!![]},'attributes':['id',_0x7efc('0x15'),_0x7efc('0x21')],'include':[{'model':db[_0x7efc('0x22')],'as':_0x7efc('0x23'),'include':[{'model':db[_0x7efc('0x24')],'as':'CloudProvider'}]}]})[_0x7efc('0xc')](function(_0x1f4b75){if(!_0x1f4b75){throw new Error(_0x7efc('0x25'));}var _0x558258=_0x1f4b75['getSmtpOptions']();var _0x429bb5={'account':_0x558258,'message':_[_0x7efc('0x26')]({'from':util[_0x7efc('0x27')](_0x7efc('0x28'),_0x1f4b75[_0x7efc('0x15')],_0x1f4b75[_0x7efc('0x21')]||_0x1f4b75[_0x7efc('0x23')]['user'])},_0xa407dc)};return client[_0x7efc('0x29')](_0x7efc('0x2a'),_0x429bb5);})[_0x7efc('0xc')](function(_0x273b3f){if(_0x273b3f[_0x7efc('0x2b')]){throw new Error(util[_0x7efc('0x27')](_0x7efc('0x2c'),_0x273b3f[_0x7efc('0x2b')][_0x7efc('0x2d')]||JSON['stringify'](_0x273b3f[_0x7efc('0x2b')])));}return!![];});}function handleError(_0x164a88,_0x244c9e,_0x55d887){return _0x164a88[_0x7efc('0x2e')](_0x244c9e||0x1f4)['send']({'message':_0x55d887?_0x55d887[_0x7efc('0x2d')]||_0x55d887:''});}exports[_0x7efc('0x2f')]=function(_0x462ffd,_0x284310,_0x5209ef){passport[_0x7efc('0x17')](_0x7efc('0x30'),function(_0x45dd8a,_0x3ca887,_0x32e098){var _0x2839c8=_0x45dd8a||_0x32e098;if(_0x2839c8){return handleError(_0x284310,0x191,_0x2839c8);}if(!_0x3ca887){return handleError(_0x284310,0x194,{'message':_0x7efc('0x31')});}else{var _0x1485d1={'payload':{'id':_0x3ca887['id'],'role':_0x3ca887[_0x7efc('0xf')]},'options':{'expiresIn':0x15180}};return authService[_0x7efc('0x32')](_0x1485d1)[_0x7efc('0xc')](function(_0x4abb39){_0x284310[_0x7efc('0x33')]({'id':_0x3ca887['id'],'token':_0x4abb39,'statusCall':'','isAlreadyLogged':_0x3ca887[_0x7efc('0x34')]});});}})(_0x462ffd,_0x284310,_0x5209ef);};exports[_0x7efc('0x35')]=function(_0x95d51e,_0x2cc697){if(!_0x95d51e[_0x7efc('0x36')][_0x7efc('0x21')]){return handleError(_0x2cc697,0x1f4,{'message':_0x7efc('0x37')});}var _0x3e43e2=rs[_0x7efc('0x38')]();_0x95d51e[_0x7efc('0x36')][_0x7efc('0x21')]=_0x95d51e[_0x7efc('0x36')][_0x7efc('0x21')][_0x7efc('0x39')]()['toLowerCase']();var _0x1f810b;return db[_0x7efc('0x9')][_0x7efc('0xa')]({'where':{'id':0x1},'attributes':[_0x7efc('0xb'),'blockDuration'],'raw':!![]})['then'](function(_0x4ac672){_0x1f810b=_0x4ac672;return db[_0x7efc('0x3a')][_0x7efc('0x20')]({'where':{'email':_0x95d51e[_0x7efc('0x36')]['email']}});})[_0x7efc('0xc')](function(_0x572cda){if(!_0x572cda){throw new Error(_0x7efc('0x3b'));}if(_0x572cda[_0x7efc('0x10')]){throw new Error(_0x7efc('0x3c'));}if(_0x572cda[_0x7efc('0x11')]){if(moment(_0x572cda[_0x7efc('0x19')])[_0x7efc('0x1a')](_0x1f810b[_0x7efc('0x18')],_0x7efc('0x1c'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x572cda[_0x7efc('0x11')]=![];_0x572cda[_0x7efc('0x19')]=null;}}_0x572cda['resetPasswordToken']=_0x3e43e2;_0x572cda[_0x7efc('0x3d')]=Date['now']()+0x36ee80;return _0x572cda['save']();})['then'](function(){return sendServiceMail({'to':_0x95d51e[_0x7efc('0x36')]['email'],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0x7efc('0x3e')+_0x7efc('0x3f')+_0x7efc('0x40')+_0x95d51e[_0x7efc('0x41')][_0x7efc('0x42')]+_0x7efc('0x43')+_0x3e43e2+'\x0a\x0a'+_0x7efc('0x44')});})[_0x7efc('0xc')](function(){_0x2cc697['status'](0xc8)[_0x7efc('0x45')]({'message':_0x7efc('0x46')});})[_0x7efc('0x1e')](function(_0x32cde5){return handleError(_0x2cc697,0x1f4,_0x32cde5);});};exports[_0x7efc('0x47')]=function(_0x2be1c4,_0x4b5336){return db[_0x7efc('0x3a')][_0x7efc('0x20')]({'where':{'resetPasswordToken':_0x2be1c4[_0x7efc('0x48')]['token'],'resetPasswordExpires':{'$gt':Date[_0x7efc('0x49')]()}}})[_0x7efc('0xc')](function(_0x11af31){if(!_0x11af31){throw new Error(_0x7efc('0x4a'));}return db['Setting']['findOne']({'attributes':['id',_0x7efc('0x4b'),'enforcePasswordHistory',_0x7efc('0x4c')]})[_0x7efc('0xc')](function(_0x58353b){if(_0x58353b[_0x7efc('0x4b')])authService['validatePasswordPattern'](_0x2be1c4[_0x7efc('0x36')][_0x7efc('0xd')]);if(!_0x58353b['enforcePasswordHistory']||!_0x11af31[_0x7efc('0x4d')])return _0x11af31;authService[_0x7efc('0x4e')](_0x2be1c4['body']['password'],_0x11af31[_0x7efc('0x4d')],_0x58353b['passwordHistoryLimit']);return _0x11af31;})[_0x7efc('0xc')](function(){_0x11af31['password']=_0x2be1c4[_0x7efc('0x36')]['password'];_0x11af31['resetPasswordToken']=null;_0x11af31[_0x7efc('0x3d')]=null;return _0x11af31[_0x7efc('0x4f')]();});})[_0x7efc('0xc')](function(){_0x4b5336[_0x7efc('0x2e')](0xc8)['send']({'message':_0x7efc('0x50')});})['catch'](function(_0x3a1b43){return handleError(_0x4b5336,0x1f4,_0x3a1b43);});};passport[_0x7efc('0x51')]('local-login',new LocalStrategy({'usernameField':_0x7efc('0x15'),'passwordField':_0x7efc('0xd')},function(_0xb7ab86,_0x145f93,_0x56c256){return localAuthenticate(db[_0x7efc('0x3a')],_0xb7ab86,_0x145f93,_0x56c256);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index fe94ed9..a7cc185 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 _0xeb57=['Router','./authLocal.controller','post','login','forgot','exports'];(function(_0x39a757,_0x51e36d){var _0x3df2f=function(_0x1e5083){while(--_0x1e5083){_0x39a757['push'](_0x39a757['shift']());}};_0x3df2f(++_0x51e36d);}(_0xeb57,0x1aa));var _0x7eb5=function(_0x46fd05,_0x2a121d){_0x46fd05=_0x46fd05-0x0;var _0xdcbee=_0xeb57[_0x46fd05];return _0xdcbee;};'use strict';var express=require('express');var router=express[_0x7eb5('0x0')]();var controller=require(_0x7eb5('0x1'));router[_0x7eb5('0x2')]('/',controller[_0x7eb5('0x3')]);router[_0x7eb5('0x2')]('/forgot',controller[_0x7eb5('0x4')]);router[_0x7eb5('0x2')]('/reset/:token',controller['reset']);module[_0x7eb5('0x5')]=router; \ No newline at end of file +var _0x1ac7=['/reset/:token','reset','exports','post','forgot'];(function(_0x5f0eb8,_0x3639a0){var _0xff2017=function(_0x2ab1f5){while(--_0x2ab1f5){_0x5f0eb8['push'](_0x5f0eb8['shift']());}};_0xff2017(++_0x3639a0);}(_0x1ac7,0x1ca));var _0x71ac=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0x1ac7[_0x45d55e];return _0x29812a;};'use strict';var express=require('express');var router=express['Router']();var controller=require('./authLocal.controller');router[_0x71ac('0x0')]('/',controller['login']);router['post']('/forgot',controller[_0x71ac('0x1')]);router[_0x71ac('0x0')](_0x71ac('0x2'),controller[_0x71ac('0x3')]);module[_0x71ac('0x4')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index c798b23..2cb3137 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 _0xea10=['sequelize','exports','STRING','INTEGER'];(function(_0x5cb157,_0x26a384){var _0x233e33=function(_0x5001ce){while(--_0x5001ce){_0x5cb157['push'](_0x5cb157['shift']());}};_0x233e33(++_0x26a384);}(_0xea10,0x84));var _0x0ea1=function(_0x102890,_0x24dd23){_0x102890=_0x102890-0x0;var _0x5b7191=_0xea10[_0x102890];return _0x5b7191;};'use strict';var Sequelize=require(_0x0ea1('0x0'));module[_0x0ea1('0x1')]={'name':{'type':Sequelize[_0x0ea1('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0ea1('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x0ea1('0x3')],'defaultValue':0xa}}; \ No newline at end of file +var _0x5a5a=['exports','STRING','BOOLEAN','sequelize'];(function(_0xc372ca,_0x58eada){var _0x4264f1=function(_0x319e3b){while(--_0x319e3b){_0xc372ca['push'](_0xc372ca['shift']());}};_0x4264f1(++_0x58eada);}(_0x5a5a,0xaf));var _0xa5a5=function(_0x5ce15c,_0x19c917){_0x5ce15c=_0x5ce15c-0x0;var _0x36e4f5=_0x5a5a[_0x5ce15c];return _0x36e4f5;};'use strict';var Sequelize=require(_0xa5a5('0x0'));module[_0xa5a5('0x1')]={'name':{'type':Sequelize[_0xa5a5('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xa5a5('0x2')]},'description':{'type':Sequelize[_0xa5a5('0x2')]},'status':{'type':Sequelize[_0xa5a5('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index 0e2741d..a05a0f6 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 _0x7232=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','rawAttributes','fieldName','type','model','map','query','keys','intersection','attributes','fields','length','nolimit','sort','where','filters','merge','filter','options','Automation','includeAll','include','findAll','catch','show','params','find','create','body','addConditions','Condition','omit','ids','getConditions','findOne','order','pick','hasOwnProperty','addActions','Action','getActions','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis'];(function(_0x585199,_0x10d223){var _0x4f5eaf=function(_0x19f4cf){while(--_0x19f4cf){_0x585199['push'](_0x585199['shift']());}};_0x4f5eaf(++_0x10d223);}(_0x7232,0x94));var _0x2723=function(_0x297e6e,_0x394019){_0x297e6e=_0x297e6e-0x0;var _0x43e41d=_0x7232[_0x297e6e];return _0x43e41d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2723('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2723('0x1'));var moment=require(_0x2723('0x2'));var BPromise=require(_0x2723('0x3'));var Mustache=require('mustache');var util=require(_0x2723('0x4'));var path=require(_0x2723('0x5'));var sox=require(_0x2723('0x6'));var csv=require(_0x2723('0x7'));var ejs=require(_0x2723('0x8'));var fs=require('fs');var fs_extra=require(_0x2723('0x9'));var _=require(_0x2723('0xa'));var squel=require('squel');var crypto=require(_0x2723('0xb'));var jsforce=require(_0x2723('0xc'));var deskjs=require(_0x2723('0xd'));var toCsv=require(_0x2723('0x7'));var querystring=require(_0x2723('0xe'));var Papa=require('papaparse');var Redis=require(_0x2723('0xf'));var authService=require(_0x2723('0x10'));var qs=require(_0x2723('0x11'));var as=require(_0x2723('0x12'));var hardwareService=require(_0x2723('0x13'));var logger=require('../../config/logger')(_0x2723('0x14'));var utils=require(_0x2723('0x15'));var config=require(_0x2723('0x16'));var licenseUtil=require(_0x2723('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x8034e3,_0x39050d){_0x39050d=_0x39050d||0xcc;return function(_0x28364d){if(_0x28364d){return _0x8034e3[_0x2723('0x18')](_0x39050d);}return _0x8034e3[_0x2723('0x19')](_0x39050d)[_0x2723('0x1a')]();};}function respondWithResult(_0x9cfa36,_0xbae6f6){_0xbae6f6=_0xbae6f6||0xc8;return function(_0x3fa7c2){if(_0x3fa7c2){return _0x9cfa36[_0x2723('0x19')](_0xbae6f6)[_0x2723('0x1b')](_0x3fa7c2);}};}function respondWithFilteredResult(_0x4f022c,_0x2abeaf){return function(_0x190442){if(_0x190442){var _0x309703=typeof _0x2abeaf[_0x2723('0x1c')]==='undefined'&&typeof _0x2abeaf[_0x2723('0x1d')]===_0x2723('0x1e');var _0x20157b=_0x190442[_0x2723('0x1f')];var _0x9d09ca=_0x309703?0x0:_0x2abeaf[_0x2723('0x1c')];var _0xb78b2a=_0x309703?_0x190442[_0x2723('0x1f')]:_0x2abeaf[_0x2723('0x1c')]+_0x2abeaf[_0x2723('0x1d')];var _0x40f6ef;if(_0xb78b2a>=_0x20157b){_0xb78b2a=_0x20157b;_0x40f6ef=0xc8;}else{_0x40f6ef=0xce;}_0x4f022c[_0x2723('0x19')](_0x40f6ef);return _0x4f022c['set'](_0x2723('0x20'),_0x9d09ca+'-'+_0xb78b2a+'/'+_0x20157b)['json'](_0x190442);}return null;};}function patchUpdates(_0x1c9417){return function(_0x1d03b9){try{jsonpatch[_0x2723('0x21')](_0x1d03b9,_0x1c9417,!![]);}catch(_0x4a500c){return BPromise[_0x2723('0x22')](_0x4a500c);}return _0x1d03b9['save']();};}function saveUpdates(_0x259c6f,_0x561a7c){return function(_0x3b2718){if(_0x3b2718){return _0x3b2718[_0x2723('0x23')](_0x259c6f)[_0x2723('0x24')](function(_0x4d024e){return _0x4d024e;});}return null;};}function removeEntity(_0x258263,_0x168d3c){return function(_0x888387){if(_0x888387){return _0x888387[_0x2723('0x25')]()['then'](function(){_0x258263[_0x2723('0x19')](0xcc)[_0x2723('0x1a')]();});}};}function handleEntityNotFound(_0x129da0,_0x3c4851){return function(_0x2194b2){if(!_0x2194b2){_0x129da0[_0x2723('0x18')](0x194);}return _0x2194b2;};}function handleError(_0x55d7c6,_0xf249e3){_0xf249e3=_0xf249e3||0x1f4;return function(_0x57c9d2){logger[_0x2723('0x26')](_0x57c9d2[_0x2723('0x27')]);if(_0x57c9d2[_0x2723('0x28')]){delete _0x57c9d2[_0x2723('0x28')];}_0x55d7c6[_0x2723('0x19')](_0xf249e3)[_0x2723('0x29')](_0x57c9d2);};}exports['index']=function(_0x2fc953,_0x1947e3){var _0x46c34d={},_0x4ea0f8={},_0x306fba={'count':0x0,'rows':[]};var _0x2a53d7=_['map'](db['Automation'][_0x2723('0x2a')],function(_0x4732f7){return{'name':_0x4732f7[_0x2723('0x2b')],'type':_0x4732f7[_0x2723('0x2c')]['key']};});_0x4ea0f8[_0x2723('0x2d')]=_[_0x2723('0x2e')](_0x2a53d7,_0x2723('0x28'));_0x4ea0f8[_0x2723('0x2f')]=_[_0x2723('0x30')](_0x2fc953[_0x2723('0x2f')]);_0x4ea0f8['filters']=_[_0x2723('0x31')](_0x4ea0f8[_0x2723('0x2d')],_0x4ea0f8[_0x2723('0x2f')]);_0x46c34d[_0x2723('0x32')]=_[_0x2723('0x31')](_0x4ea0f8['model'],qs[_0x2723('0x33')](_0x2fc953[_0x2723('0x2f')]['fields']));_0x46c34d['attributes']=_0x46c34d[_0x2723('0x32')][_0x2723('0x34')]?_0x46c34d[_0x2723('0x32')]:_0x4ea0f8['model'];if(!_0x2fc953[_0x2723('0x2f')]['hasOwnProperty'](_0x2723('0x35'))){_0x46c34d['limit']=qs[_0x2723('0x1d')](_0x2fc953[_0x2723('0x2f')][_0x2723('0x1d')]);_0x46c34d[_0x2723('0x1c')]=qs[_0x2723('0x1c')](_0x2fc953['query']['offset']);}_0x46c34d['order']=qs[_0x2723('0x36')](_0x2fc953['query'][_0x2723('0x36')]);_0x46c34d[_0x2723('0x37')]=qs[_0x2723('0x38')](_['pick'](_0x2fc953['query'],_0x4ea0f8[_0x2723('0x38')]),_0x2a53d7);if(_0x2fc953[_0x2723('0x2f')]['filter']){_0x46c34d['where']=_[_0x2723('0x39')](_0x46c34d[_0x2723('0x37')],{'$or':_[_0x2723('0x2e')](_0x2a53d7,function(_0x3e04e2){if(_0x3e04e2[_0x2723('0x2c')]!=='VIRTUAL'){var _0x2bba9c={};_0x2bba9c[_0x3e04e2[_0x2723('0x28')]]={'$like':'%'+_0x2fc953[_0x2723('0x2f')][_0x2723('0x3a')]+'%'};return _0x2bba9c;}})});}_0x46c34d=_['merge']({},_0x46c34d,_0x2fc953[_0x2723('0x3b')]);var _0x40b869={'where':_0x46c34d[_0x2723('0x37')]};return db[_0x2723('0x3c')]['count'](_0x40b869)[_0x2723('0x24')](function(_0x3f42fb){_0x306fba[_0x2723('0x1f')]=_0x3f42fb;if(_0x2fc953[_0x2723('0x2f')][_0x2723('0x3d')]){_0x46c34d[_0x2723('0x3e')]=[{'all':!![]}];}return db[_0x2723('0x3c')][_0x2723('0x3f')](_0x46c34d);})[_0x2723('0x24')](function(_0x5a389d){_0x306fba['rows']=_0x5a389d;return _0x306fba;})[_0x2723('0x24')](respondWithFilteredResult(_0x1947e3,_0x46c34d))[_0x2723('0x40')](handleError(_0x1947e3,null));};exports[_0x2723('0x41')]=function(_0x3001b4,_0x2f2120){var _0x424937={'raw':![],'where':{'id':_0x3001b4[_0x2723('0x42')]['id']}},_0x332783={};_0x332783[_0x2723('0x2d')]=_['keys'](db[_0x2723('0x3c')][_0x2723('0x2a')]);_0x332783[_0x2723('0x2f')]=_[_0x2723('0x30')](_0x3001b4[_0x2723('0x2f')]);_0x332783['filters']=_[_0x2723('0x31')](_0x332783[_0x2723('0x2d')],_0x332783[_0x2723('0x2f')]);_0x424937[_0x2723('0x32')]=_[_0x2723('0x31')](_0x332783[_0x2723('0x2d')],qs['fields'](_0x3001b4[_0x2723('0x2f')][_0x2723('0x33')]));_0x424937['attributes']=_0x424937[_0x2723('0x32')][_0x2723('0x34')]?_0x424937[_0x2723('0x32')]:_0x332783[_0x2723('0x2d')];if(_0x3001b4['query'][_0x2723('0x3d')]){_0x424937['include']=[{'all':!![]}];}_0x424937=_[_0x2723('0x39')]({},_0x424937,_0x3001b4[_0x2723('0x3b')]);return db[_0x2723('0x3c')][_0x2723('0x43')](_0x424937)[_0x2723('0x24')](handleEntityNotFound(_0x2f2120,null))['then'](respondWithResult(_0x2f2120,null))[_0x2723('0x40')](handleError(_0x2f2120,null));};exports[_0x2723('0x44')]=function(_0x3764f2,_0xa8ae85){return db['Automation'][_0x2723('0x44')](_0x3764f2['body'],{})[_0x2723('0x24')](respondWithResult(_0xa8ae85,0xc9))[_0x2723('0x40')](handleError(_0xa8ae85,null));};exports[_0x2723('0x23')]=function(_0x5914cc,_0x1583c0){if(_0x5914cc['body']['id']){delete _0x5914cc[_0x2723('0x45')]['id'];}return db[_0x2723('0x3c')]['find']({'where':{'id':_0x5914cc[_0x2723('0x42')]['id']}})['then'](handleEntityNotFound(_0x1583c0,null))[_0x2723('0x24')](saveUpdates(_0x5914cc[_0x2723('0x45')],null))[_0x2723('0x24')](respondWithResult(_0x1583c0,null))[_0x2723('0x40')](handleError(_0x1583c0,null));};exports[_0x2723('0x25')]=function(_0x12876c,_0x109a04){return db[_0x2723('0x3c')][_0x2723('0x43')]({'where':{'id':_0x12876c[_0x2723('0x42')]['id']}})['then'](handleEntityNotFound(_0x109a04,null))[_0x2723('0x24')](removeEntity(_0x109a04,null))[_0x2723('0x40')](handleError(_0x109a04,null));};exports[_0x2723('0x46')]=function(_0x13bbe2,_0x271124,_0x173787){return db[_0x2723('0x47')]['find']({'where':{'id':_0x13bbe2[_0x2723('0x42')]['id']}})[_0x2723('0x24')](handleEntityNotFound(_0x271124,null))['then'](function(_0x53fc4d){if(_0x53fc4d){return _0x53fc4d['addConditions'](_0x13bbe2[_0x2723('0x45')]['ids'],_[_0x2723('0x48')](_0x13bbe2['body'],[_0x2723('0x49'),'id'])||{});}})['then'](respondWithResult(_0x271124,null))[_0x2723('0x40')](handleError(_0x271124,null));};exports[_0x2723('0x4a')]=function(_0x5d31c1,_0x4e38b0,_0xd3d258){var _0x23c6fb={};var _0xab224a={};var _0x471eba;var _0xd48d87;return db[_0x2723('0x3c')][_0x2723('0x4b')]({'where':{'id':_0x5d31c1[_0x2723('0x42')]['id']}})['then'](handleEntityNotFound(_0x4e38b0,null))[_0x2723('0x24')](function(_0x218de0){if(_0x218de0){_0x471eba=_0x218de0;_0xab224a[_0x2723('0x2d')]=_[_0x2723('0x30')](db['Condition'][_0x2723('0x2a')]);_0xab224a[_0x2723('0x2f')]=_[_0x2723('0x30')](_0x5d31c1[_0x2723('0x2f')]);_0xab224a[_0x2723('0x38')]=_[_0x2723('0x31')](_0xab224a['model'],_0xab224a[_0x2723('0x2f')]);_0x23c6fb[_0x2723('0x32')]=_['intersection'](_0xab224a[_0x2723('0x2d')],qs[_0x2723('0x33')](_0x5d31c1[_0x2723('0x2f')][_0x2723('0x33')]));_0x23c6fb[_0x2723('0x32')]=_0x23c6fb[_0x2723('0x32')]['length']?_0x23c6fb[_0x2723('0x32')]:_0xab224a[_0x2723('0x2d')];_0x23c6fb[_0x2723('0x4c')]=qs['sort'](_0x5d31c1['query']['sort']);_0x23c6fb[_0x2723('0x37')]=qs[_0x2723('0x38')](_[_0x2723('0x4d')](_0x5d31c1['query'],_0xab224a[_0x2723('0x38')]));if(_0x5d31c1[_0x2723('0x2f')]['filter']){_0x23c6fb['where']=_[_0x2723('0x39')](_0x23c6fb[_0x2723('0x37')],{'$or':_['map'](_0x23c6fb[_0x2723('0x32')],function(_0x53d8cb){var _0x10068a={};_0x10068a[_0x53d8cb]={'$like':'%'+_0x5d31c1['query'][_0x2723('0x3a')]+'%'};return _0x10068a;})});}_0x23c6fb=_['merge']({},_0x23c6fb,_0x5d31c1[_0x2723('0x3b')]);return _0x471eba[_0x2723('0x4a')](_0x23c6fb);}})[_0x2723('0x24')](function(_0x16b4b8){if(_0x16b4b8){_0xd48d87=_0x16b4b8[_0x2723('0x34')];if(!_0x5d31c1[_0x2723('0x2f')][_0x2723('0x4e')](_0x2723('0x35'))){_0x23c6fb[_0x2723('0x1d')]=qs[_0x2723('0x1d')](_0x5d31c1[_0x2723('0x2f')][_0x2723('0x1d')]);_0x23c6fb[_0x2723('0x1c')]=qs[_0x2723('0x1c')](_0x5d31c1[_0x2723('0x2f')][_0x2723('0x1c')]);}return _0x471eba['getConditions'](_0x23c6fb);}})[_0x2723('0x24')](function(_0x2b2cb5){if(_0x2b2cb5){return _0x2b2cb5?{'count':_0xd48d87,'rows':_0x2b2cb5}:null;}})['then'](respondWithResult(_0x4e38b0,null))[_0x2723('0x40')](handleError(_0x4e38b0,null));};exports[_0x2723('0x4f')]=function(_0x42d589,_0xec6677,_0x34f7ca){return db[_0x2723('0x50')][_0x2723('0x43')]({'where':{'id':_0x42d589[_0x2723('0x42')]['id']}})[_0x2723('0x24')](handleEntityNotFound(_0xec6677,null))[_0x2723('0x24')](function(_0x2724fa){if(_0x2724fa){return _0x2724fa[_0x2723('0x4f')](_0x42d589[_0x2723('0x45')]['ids'],_[_0x2723('0x48')](_0x42d589[_0x2723('0x45')],[_0x2723('0x49'),'id'])||{});}})[_0x2723('0x24')](respondWithResult(_0xec6677,null))[_0x2723('0x40')](handleError(_0xec6677,null));};exports[_0x2723('0x51')]=function(_0xdc16fd,_0x531a52,_0x39382b){var _0x52432d={};var _0x49349a={};var _0x1bcd42;var _0x287c12;return db['Automation'][_0x2723('0x4b')]({'where':{'id':_0xdc16fd[_0x2723('0x42')]['id']}})['then'](handleEntityNotFound(_0x531a52,null))[_0x2723('0x24')](function(_0x1ebdd6){if(_0x1ebdd6){_0x1bcd42=_0x1ebdd6;_0x49349a[_0x2723('0x2d')]=_['keys'](db['Action']['rawAttributes']);_0x49349a[_0x2723('0x2f')]=_[_0x2723('0x30')](_0xdc16fd[_0x2723('0x2f')]);_0x49349a['filters']=_[_0x2723('0x31')](_0x49349a[_0x2723('0x2d')],_0x49349a[_0x2723('0x2f')]);_0x52432d[_0x2723('0x32')]=_[_0x2723('0x31')](_0x49349a[_0x2723('0x2d')],qs[_0x2723('0x33')](_0xdc16fd[_0x2723('0x2f')][_0x2723('0x33')]));_0x52432d[_0x2723('0x32')]=_0x52432d[_0x2723('0x32')][_0x2723('0x34')]?_0x52432d['attributes']:_0x49349a[_0x2723('0x2d')];_0x52432d['order']=qs[_0x2723('0x36')](_0xdc16fd['query'][_0x2723('0x36')]);_0x52432d[_0x2723('0x37')]=qs[_0x2723('0x38')](_['pick'](_0xdc16fd[_0x2723('0x2f')],_0x49349a['filters']));if(_0xdc16fd['query'][_0x2723('0x3a')]){_0x52432d[_0x2723('0x37')]=_[_0x2723('0x39')](_0x52432d['where'],{'$or':_[_0x2723('0x2e')](_0x52432d[_0x2723('0x32')],function(_0x2a1bd7){var _0x16c8a5={};_0x16c8a5[_0x2a1bd7]={'$like':'%'+_0xdc16fd[_0x2723('0x2f')]['filter']+'%'};return _0x16c8a5;})});}_0x52432d=_[_0x2723('0x39')]({},_0x52432d,_0xdc16fd[_0x2723('0x3b')]);return _0x1bcd42[_0x2723('0x51')](_0x52432d);}})[_0x2723('0x24')](function(_0x410c9e){if(_0x410c9e){_0x287c12=_0x410c9e[_0x2723('0x34')];if(!_0xdc16fd[_0x2723('0x2f')]['hasOwnProperty'](_0x2723('0x35'))){_0x52432d['limit']=qs[_0x2723('0x1d')](_0xdc16fd[_0x2723('0x2f')][_0x2723('0x1d')]);_0x52432d[_0x2723('0x1c')]=qs['offset'](_0xdc16fd['query'][_0x2723('0x1c')]);}return _0x1bcd42['getActions'](_0x52432d);}})[_0x2723('0x24')](function(_0x8da368){if(_0x8da368){return _0x8da368?{'count':_0x287c12,'rows':_0x8da368}:null;}})[_0x2723('0x24')](respondWithResult(_0x531a52,null))[_0x2723('0x40')](handleError(_0x531a52,null));}; \ No newline at end of file +var _0x431a=['Automation','rawAttributes','fieldName','key','map','query','filters','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','type','VIRTUAL','then','includeAll','include','findAll','catch','show','params','keys','intersection','merge','options','find','create','body','update','addConditions','Condition','ids','omit','getConditions','findOne','nolimit','Action','addActions','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','destroy','sendStatus','name','send','index'];(function(_0x5e9b23,_0x3069fd){var _0x27501f=function(_0x37667c){while(--_0x37667c){_0x5e9b23['push'](_0x5e9b23['shift']());}};_0x27501f(++_0x3069fd);}(_0x431a,0x1cb));var _0xa431=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x431a[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xa431('0x0'));var rimraf=require(_0xa431('0x1'));var zipdir=require(_0xa431('0x2'));var jsonpatch=require(_0xa431('0x3'));var rp=require(_0xa431('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa431('0x5'));var util=require(_0xa431('0x6'));var path=require(_0xa431('0x7'));var sox=require('sox');var csv=require(_0xa431('0x8'));var ejs=require(_0xa431('0x9'));var fs=require('fs');var fs_extra=require(_0xa431('0xa'));var _=require(_0xa431('0xb'));var squel=require(_0xa431('0xc'));var crypto=require('crypto');var jsforce=require(_0xa431('0xd'));var deskjs=require(_0xa431('0xe'));var toCsv=require(_0xa431('0x8'));var querystring=require(_0xa431('0xf'));var Papa=require(_0xa431('0x10'));var Redis=require(_0xa431('0x11'));var authService=require(_0xa431('0x12'));var qs=require(_0xa431('0x13'));var as=require(_0xa431('0x14'));var hardwareService=require(_0xa431('0x15'));var logger=require(_0xa431('0x16'))(_0xa431('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa431('0x18'))['db'];function respondWithStatusCode(_0x2dbafa,_0x3012b6){_0x3012b6=_0x3012b6||0xcc;return function(_0x5a4759){if(_0x5a4759){return _0x2dbafa['sendStatus'](_0x3012b6);}return _0x2dbafa[_0xa431('0x19')](_0x3012b6)[_0xa431('0x1a')]();};}function respondWithResult(_0x508cd2,_0x1667ed){_0x1667ed=_0x1667ed||0xc8;return function(_0x47f01a){if(_0x47f01a){return _0x508cd2['status'](_0x1667ed)[_0xa431('0x1b')](_0x47f01a);}};}function respondWithFilteredResult(_0x404b37,_0x39a86f){return function(_0x381699){if(_0x381699){var _0x3869dd=typeof _0x39a86f[_0xa431('0x1c')]===_0xa431('0x1d')&&typeof _0x39a86f[_0xa431('0x1e')]===_0xa431('0x1d');var _0x2bdd58=_0x381699[_0xa431('0x1f')];var _0x5a5e93=_0x3869dd?0x0:_0x39a86f[_0xa431('0x1c')];var _0x5ac633=_0x3869dd?_0x381699[_0xa431('0x1f')]:_0x39a86f[_0xa431('0x1c')]+_0x39a86f[_0xa431('0x1e')];var _0x310d44;if(_0x5ac633>=_0x2bdd58){_0x5ac633=_0x2bdd58;_0x310d44=0xc8;}else{_0x310d44=0xce;}_0x404b37[_0xa431('0x19')](_0x310d44);return _0x404b37['set'](_0xa431('0x20'),_0x5a5e93+'-'+_0x5ac633+'/'+_0x2bdd58)[_0xa431('0x1b')](_0x381699);}return null;};}function patchUpdates(_0x18b378){return function(_0x5a1120){try{jsonpatch[_0xa431('0x21')](_0x5a1120,_0x18b378,!![]);}catch(_0x6df2e1){return BPromise['reject'](_0x6df2e1);}return _0x5a1120['save']();};}function saveUpdates(_0x190594,_0xf3638f){return function(_0x125747){if(_0x125747){return _0x125747['update'](_0x190594)['then'](function(_0x5d12bc){return _0x5d12bc;});}return null;};}function removeEntity(_0x18e0e8,_0x21d076){return function(_0xf1d563){if(_0xf1d563){return _0xf1d563[_0xa431('0x22')]()['then'](function(){_0x18e0e8[_0xa431('0x19')](0xcc)[_0xa431('0x1a')]();});}};}function handleEntityNotFound(_0x2a4b6f,_0x17f2a7){return function(_0x2c4228){if(!_0x2c4228){_0x2a4b6f[_0xa431('0x23')](0x194);}return _0x2c4228;};}function handleError(_0x245aba,_0xf53ea3){_0xf53ea3=_0xf53ea3||0x1f4;return function(_0x4e9391){logger['error'](_0x4e9391['stack']);if(_0x4e9391[_0xa431('0x24')]){delete _0x4e9391['name'];}_0x245aba[_0xa431('0x19')](_0xf53ea3)[_0xa431('0x25')](_0x4e9391);};}exports[_0xa431('0x26')]=function(_0x1a8eec,_0x119329){var _0x5b2be2={},_0x123a12={},_0x5a4c93={'count':0x0,'rows':[]};var _0x18a768=_['map'](db[_0xa431('0x27')][_0xa431('0x28')],function(_0x5e7978){return{'name':_0x5e7978[_0xa431('0x29')],'type':_0x5e7978['type'][_0xa431('0x2a')]};});_0x123a12['model']=_[_0xa431('0x2b')](_0x18a768,'name');_0x123a12[_0xa431('0x2c')]=_['keys'](_0x1a8eec['query']);_0x123a12[_0xa431('0x2d')]=_['intersection'](_0x123a12[_0xa431('0x2e')],_0x123a12['query']);_0x5b2be2['attributes']=_['intersection'](_0x123a12['model'],qs[_0xa431('0x2f')](_0x1a8eec['query'][_0xa431('0x2f')]));_0x5b2be2[_0xa431('0x30')]=_0x5b2be2[_0xa431('0x30')][_0xa431('0x31')]?_0x5b2be2[_0xa431('0x30')]:_0x123a12[_0xa431('0x2e')];if(!_0x1a8eec[_0xa431('0x2c')][_0xa431('0x32')]('nolimit')){_0x5b2be2['limit']=qs[_0xa431('0x1e')](_0x1a8eec[_0xa431('0x2c')][_0xa431('0x1e')]);_0x5b2be2[_0xa431('0x1c')]=qs['offset'](_0x1a8eec[_0xa431('0x2c')][_0xa431('0x1c')]);}_0x5b2be2[_0xa431('0x33')]=qs[_0xa431('0x34')](_0x1a8eec[_0xa431('0x2c')][_0xa431('0x34')]);_0x5b2be2[_0xa431('0x35')]=qs[_0xa431('0x2d')](_[_0xa431('0x36')](_0x1a8eec['query'],_0x123a12[_0xa431('0x2d')]),_0x18a768);if(_0x1a8eec[_0xa431('0x2c')][_0xa431('0x37')]){_0x5b2be2[_0xa431('0x35')]=_['merge'](_0x5b2be2[_0xa431('0x35')],{'$or':_[_0xa431('0x2b')](_0x18a768,function(_0x21baa5){if(_0x21baa5[_0xa431('0x38')]!==_0xa431('0x39')){var _0x55ddb5={};_0x55ddb5[_0x21baa5[_0xa431('0x24')]]={'$like':'%'+_0x1a8eec[_0xa431('0x2c')]['filter']+'%'};return _0x55ddb5;}})});}_0x5b2be2=_['merge']({},_0x5b2be2,_0x1a8eec['options']);var _0x33221c={'where':_0x5b2be2[_0xa431('0x35')]};return db[_0xa431('0x27')][_0xa431('0x1f')](_0x33221c)[_0xa431('0x3a')](function(_0x4b8302){_0x5a4c93[_0xa431('0x1f')]=_0x4b8302;if(_0x1a8eec[_0xa431('0x2c')][_0xa431('0x3b')]){_0x5b2be2[_0xa431('0x3c')]=[{'all':!![]}];}return db['Automation'][_0xa431('0x3d')](_0x5b2be2);})[_0xa431('0x3a')](function(_0x14e7bf){_0x5a4c93['rows']=_0x14e7bf;return _0x5a4c93;})[_0xa431('0x3a')](respondWithFilteredResult(_0x119329,_0x5b2be2))[_0xa431('0x3e')](handleError(_0x119329,null));};exports[_0xa431('0x3f')]=function(_0x27b39e,_0x237b35){var _0x4222ff={'raw':![],'where':{'id':_0x27b39e[_0xa431('0x40')]['id']}},_0x103aca={};_0x103aca[_0xa431('0x2e')]=_[_0xa431('0x41')](db['Automation'][_0xa431('0x28')]);_0x103aca['query']=_[_0xa431('0x41')](_0x27b39e['query']);_0x103aca[_0xa431('0x2d')]=_[_0xa431('0x42')](_0x103aca[_0xa431('0x2e')],_0x103aca[_0xa431('0x2c')]);_0x4222ff[_0xa431('0x30')]=_[_0xa431('0x42')](_0x103aca[_0xa431('0x2e')],qs[_0xa431('0x2f')](_0x27b39e[_0xa431('0x2c')][_0xa431('0x2f')]));_0x4222ff['attributes']=_0x4222ff[_0xa431('0x30')][_0xa431('0x31')]?_0x4222ff[_0xa431('0x30')]:_0x103aca[_0xa431('0x2e')];if(_0x27b39e['query']['includeAll']){_0x4222ff[_0xa431('0x3c')]=[{'all':!![]}];}_0x4222ff=_[_0xa431('0x43')]({},_0x4222ff,_0x27b39e[_0xa431('0x44')]);return db[_0xa431('0x27')][_0xa431('0x45')](_0x4222ff)[_0xa431('0x3a')](handleEntityNotFound(_0x237b35,null))[_0xa431('0x3a')](respondWithResult(_0x237b35,null))['catch'](handleError(_0x237b35,null));};exports[_0xa431('0x46')]=function(_0x5e40d3,_0x5ee56f){return db[_0xa431('0x27')][_0xa431('0x46')](_0x5e40d3[_0xa431('0x47')],{})[_0xa431('0x3a')](respondWithResult(_0x5ee56f,0xc9))[_0xa431('0x3e')](handleError(_0x5ee56f,null));};exports[_0xa431('0x48')]=function(_0x36db24,_0x4c9130){if(_0x36db24[_0xa431('0x47')]['id']){delete _0x36db24[_0xa431('0x47')]['id'];}return db['Automation'][_0xa431('0x45')]({'where':{'id':_0x36db24[_0xa431('0x40')]['id']}})[_0xa431('0x3a')](handleEntityNotFound(_0x4c9130,null))['then'](saveUpdates(_0x36db24[_0xa431('0x47')],null))[_0xa431('0x3a')](respondWithResult(_0x4c9130,null))[_0xa431('0x3e')](handleError(_0x4c9130,null));};exports[_0xa431('0x22')]=function(_0x599fc4,_0x605d45){return db[_0xa431('0x27')]['find']({'where':{'id':_0x599fc4[_0xa431('0x40')]['id']}})[_0xa431('0x3a')](handleEntityNotFound(_0x605d45,null))[_0xa431('0x3a')](removeEntity(_0x605d45,null))[_0xa431('0x3e')](handleError(_0x605d45,null));};exports[_0xa431('0x49')]=function(_0x5ed033,_0x1f0f80,_0x125a89){return db[_0xa431('0x4a')][_0xa431('0x45')]({'where':{'id':_0x5ed033[_0xa431('0x40')]['id']}})[_0xa431('0x3a')](handleEntityNotFound(_0x1f0f80,null))[_0xa431('0x3a')](function(_0x358c22){if(_0x358c22){return _0x358c22[_0xa431('0x49')](_0x5ed033[_0xa431('0x47')][_0xa431('0x4b')],_[_0xa431('0x4c')](_0x5ed033[_0xa431('0x47')],[_0xa431('0x4b'),'id'])||{});}})['then'](respondWithResult(_0x1f0f80,null))['catch'](handleError(_0x1f0f80,null));};exports[_0xa431('0x4d')]=function(_0x36f1bd,_0x17c6d3,_0x274aa1){var _0x2f1324={};var _0x515fd7={};var _0x1b8b29;var _0x2cd973;return db[_0xa431('0x27')][_0xa431('0x4e')]({'where':{'id':_0x36f1bd[_0xa431('0x40')]['id']}})['then'](handleEntityNotFound(_0x17c6d3,null))[_0xa431('0x3a')](function(_0x2ed81e){if(_0x2ed81e){_0x1b8b29=_0x2ed81e;_0x515fd7[_0xa431('0x2e')]=_['keys'](db[_0xa431('0x4a')]['rawAttributes']);_0x515fd7[_0xa431('0x2c')]=_['keys'](_0x36f1bd[_0xa431('0x2c')]);_0x515fd7[_0xa431('0x2d')]=_[_0xa431('0x42')](_0x515fd7[_0xa431('0x2e')],_0x515fd7[_0xa431('0x2c')]);_0x2f1324[_0xa431('0x30')]=_['intersection'](_0x515fd7[_0xa431('0x2e')],qs['fields'](_0x36f1bd[_0xa431('0x2c')]['fields']));_0x2f1324[_0xa431('0x30')]=_0x2f1324['attributes'][_0xa431('0x31')]?_0x2f1324[_0xa431('0x30')]:_0x515fd7[_0xa431('0x2e')];_0x2f1324['order']=qs[_0xa431('0x34')](_0x36f1bd[_0xa431('0x2c')][_0xa431('0x34')]);_0x2f1324[_0xa431('0x35')]=qs['filters'](_[_0xa431('0x36')](_0x36f1bd[_0xa431('0x2c')],_0x515fd7[_0xa431('0x2d')]));if(_0x36f1bd[_0xa431('0x2c')]['filter']){_0x2f1324['where']=_[_0xa431('0x43')](_0x2f1324[_0xa431('0x35')],{'$or':_[_0xa431('0x2b')](_0x2f1324['attributes'],function(_0x2f1b57){var _0x59c038={};_0x59c038[_0x2f1b57]={'$like':'%'+_0x36f1bd[_0xa431('0x2c')][_0xa431('0x37')]+'%'};return _0x59c038;})});}_0x2f1324=_[_0xa431('0x43')]({},_0x2f1324,_0x36f1bd[_0xa431('0x44')]);return _0x1b8b29[_0xa431('0x4d')](_0x2f1324);}})['then'](function(_0x2e5292){if(_0x2e5292){_0x2cd973=_0x2e5292[_0xa431('0x31')];if(!_0x36f1bd['query']['hasOwnProperty'](_0xa431('0x4f'))){_0x2f1324[_0xa431('0x1e')]=qs[_0xa431('0x1e')](_0x36f1bd[_0xa431('0x2c')][_0xa431('0x1e')]);_0x2f1324['offset']=qs['offset'](_0x36f1bd[_0xa431('0x2c')][_0xa431('0x1c')]);}return _0x1b8b29[_0xa431('0x4d')](_0x2f1324);}})['then'](function(_0x847cd9){if(_0x847cd9){return _0x847cd9?{'count':_0x2cd973,'rows':_0x847cd9}:null;}})[_0xa431('0x3a')](respondWithResult(_0x17c6d3,null))['catch'](handleError(_0x17c6d3,null));};exports['addActions']=function(_0x49e870,_0x5344b8,_0x57eb84){return db[_0xa431('0x50')][_0xa431('0x45')]({'where':{'id':_0x49e870[_0xa431('0x40')]['id']}})['then'](handleEntityNotFound(_0x5344b8,null))[_0xa431('0x3a')](function(_0x28fca6){if(_0x28fca6){return _0x28fca6[_0xa431('0x51')](_0x49e870[_0xa431('0x47')]['ids'],_['omit'](_0x49e870[_0xa431('0x47')],['ids','id'])||{});}})[_0xa431('0x3a')](respondWithResult(_0x5344b8,null))['catch'](handleError(_0x5344b8,null));};exports[_0xa431('0x52')]=function(_0x507e05,_0x310e5f,_0x1ec102){var _0x148c3b={};var _0x578805={};var _0x374736;var _0x10420e;return db[_0xa431('0x27')][_0xa431('0x4e')]({'where':{'id':_0x507e05[_0xa431('0x40')]['id']}})[_0xa431('0x3a')](handleEntityNotFound(_0x310e5f,null))[_0xa431('0x3a')](function(_0x21eb21){if(_0x21eb21){_0x374736=_0x21eb21;_0x578805['model']=_['keys'](db['Action'][_0xa431('0x28')]);_0x578805[_0xa431('0x2c')]=_[_0xa431('0x41')](_0x507e05[_0xa431('0x2c')]);_0x578805[_0xa431('0x2d')]=_['intersection'](_0x578805[_0xa431('0x2e')],_0x578805[_0xa431('0x2c')]);_0x148c3b['attributes']=_['intersection'](_0x578805[_0xa431('0x2e')],qs[_0xa431('0x2f')](_0x507e05['query'][_0xa431('0x2f')]));_0x148c3b[_0xa431('0x30')]=_0x148c3b[_0xa431('0x30')][_0xa431('0x31')]?_0x148c3b[_0xa431('0x30')]:_0x578805['model'];_0x148c3b[_0xa431('0x33')]=qs[_0xa431('0x34')](_0x507e05[_0xa431('0x2c')][_0xa431('0x34')]);_0x148c3b[_0xa431('0x35')]=qs[_0xa431('0x2d')](_[_0xa431('0x36')](_0x507e05['query'],_0x578805[_0xa431('0x2d')]));if(_0x507e05[_0xa431('0x2c')][_0xa431('0x37')]){_0x148c3b[_0xa431('0x35')]=_[_0xa431('0x43')](_0x148c3b[_0xa431('0x35')],{'$or':_[_0xa431('0x2b')](_0x148c3b[_0xa431('0x30')],function(_0x399354){var _0x11c948={};_0x11c948[_0x399354]={'$like':'%'+_0x507e05[_0xa431('0x2c')][_0xa431('0x37')]+'%'};return _0x11c948;})});}_0x148c3b=_[_0xa431('0x43')]({},_0x148c3b,_0x507e05['options']);return _0x374736[_0xa431('0x52')](_0x148c3b);}})[_0xa431('0x3a')](function(_0x24f746){if(_0x24f746){_0x10420e=_0x24f746[_0xa431('0x31')];if(!_0x507e05[_0xa431('0x2c')][_0xa431('0x32')]('nolimit')){_0x148c3b[_0xa431('0x1e')]=qs[_0xa431('0x1e')](_0x507e05[_0xa431('0x2c')][_0xa431('0x1e')]);_0x148c3b[_0xa431('0x1c')]=qs[_0xa431('0x1c')](_0x507e05['query']['offset']);}return _0x374736[_0xa431('0x52')](_0x148c3b);}})[_0xa431('0x3a')](function(_0x5ea415){if(_0x5ea415){return _0x5ea415?{'count':_0x10420e,'rows':_0x5ea415}:null;}})['then'](respondWithResult(_0x310e5f,null))[_0xa431('0x3e')](handleError(_0x310e5f,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 65a5c88..9d539db 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 _0xf7ff=['exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x172e9d,_0x1e6650){var _0x51aaa1=function(_0x59f09d){while(--_0x59f09d){_0x172e9d['push'](_0x172e9d['shift']());}};_0x51aaa1(++_0x1e6650);}(_0xf7ff,0x6e));var _0xff7f=function(_0x943999,_0x5b5863){_0x943999=_0x943999-0x0;var _0x476123=_0xf7ff[_0x943999];return _0x476123;};'use strict';var _=require(_0xff7f('0x0'));var util=require(_0xff7f('0x1'));var logger=require(_0xff7f('0x2'))(_0xff7f('0x3'));var moment=require(_0xff7f('0x4'));var BPromise=require(_0xff7f('0x5'));var rp=require(_0xff7f('0x6'));var fs=require('fs');var path=require(_0xff7f('0x7'));var rimraf=require(_0xff7f('0x8'));var config=require(_0xff7f('0x9'));var attributes=require('./automation.attributes');module[_0xff7f('0xa')]=function(_0x3ad154,_0xa4ddc8){return _0x3ad154[_0xff7f('0xb')]('Automation',attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x89f0=['rimraf','../../config/environment','./automation.attributes','exports','define','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x52c8cd,_0x48ebb6){var _0x565e29=function(_0x4db58c){while(--_0x4db58c){_0x52c8cd['push'](_0x52c8cd['shift']());}};_0x565e29(++_0x48ebb6);}(_0x89f0,0xd7));var _0x089f=function(_0x3ea97c,_0xdfd96c){_0x3ea97c=_0x3ea97c-0x0;var _0x466eba=_0x89f0[_0x3ea97c];return _0x466eba;};'use strict';var _=require(_0x089f('0x0'));var util=require('util');var logger=require(_0x089f('0x1'))(_0x089f('0x2'));var moment=require('moment');var BPromise=require(_0x089f('0x3'));var rp=require(_0x089f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x089f('0x5'));var config=require(_0x089f('0x6'));var attributes=require(_0x089f('0x7'));module[_0x089f('0x8')]=function(_0x5f5ddc,_0x522c59){return _0x5f5ddc[_0x089f('0x9')]('Automation',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 96d8135..e44435f 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 _0xe3b3=['info','Automation,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x2bab51,_0x5c81ce){var _0x16128f=function(_0x1c8a56){while(--_0x1c8a56){_0x2bab51['push'](_0x2bab51['shift']());}};_0x16128f(++_0x5c81ce);}(_0xe3b3,0x1b3));var _0x3e3b=function(_0x48e7a4,_0x54485a){_0x48e7a4=_0x48e7a4-0x0;var _0x1fc97c=_0xe3b3[_0x48e7a4];return _0x1fc97c;};'use strict';var _=require(_0x3e3b('0x0'));var util=require(_0x3e3b('0x1'));var moment=require(_0x3e3b('0x2'));var BPromise=require(_0x3e3b('0x3'));var rs=require(_0x3e3b('0x4'));var fs=require('fs');var Redis=require(_0x3e3b('0x5'));var db=require(_0x3e3b('0x6'))['db'];var utils=require(_0x3e3b('0x7'));var logger=require(_0x3e3b('0x8'))(_0x3e3b('0x9'));var config=require('../../config/environment');var jayson=require(_0x3e3b('0xa'));var client=jayson[_0x3e3b('0xb')][_0x3e3b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x57c8f9,_0x11ed30,_0x46c928){return new BPromise(function(_0x3d7821,_0x3491a7){return client[_0x3e3b('0xd')](_0x57c8f9,_0x46c928)[_0x3e3b('0xe')](function(_0x214205){logger[_0x3e3b('0xf')](_0x3e3b('0x10'),_0x11ed30,'request\x20sent');logger[_0x3e3b('0x11')]('Automation,\x20%s,\x20%s,\x20%s',_0x11ed30,_0x3e3b('0x12'),JSON[_0x3e3b('0x13')](_0x214205));if(_0x214205[_0x3e3b('0x14')]){if(_0x214205[_0x3e3b('0x14')][_0x3e3b('0x15')]===0x1f4){logger[_0x3e3b('0x14')](_0x3e3b('0x10'),_0x11ed30,_0x214205[_0x3e3b('0x14')][_0x3e3b('0x16')]);return _0x3491a7(_0x214205[_0x3e3b('0x14')][_0x3e3b('0x16')]);}logger[_0x3e3b('0x14')](_0x3e3b('0x10'),_0x11ed30,_0x214205[_0x3e3b('0x14')][_0x3e3b('0x16')]);return _0x3d7821(_0x214205[_0x3e3b('0x14')][_0x3e3b('0x16')]);}else{logger['info'](_0x3e3b('0x10'),_0x11ed30,'request\x20sent');_0x3d7821(_0x214205[_0x3e3b('0x17')][_0x3e3b('0x16')]);}})[_0x3e3b('0x18')](function(_0x5a36e3){logger['error']('Automation,\x20%s,\x20%s',_0x11ed30,_0x5a36e3);_0x3491a7(_0x5a36e3);});});} \ No newline at end of file +var _0x2dd8=['Automation,\x20%s,\x20%s','debug','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then'];(function(_0x12c289,_0x3376b8){var _0x9e28d5=function(_0x33cb58){while(--_0x33cb58){_0x12c289['push'](_0x12c289['shift']());}};_0x9e28d5(++_0x3376b8);}(_0x2dd8,0x143));var _0x82dd=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x2dd8[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x82dd('0x0'));var util=require(_0x82dd('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x82dd('0x2'));var fs=require('fs');var Redis=require(_0x82dd('0x3'));var db=require(_0x82dd('0x4'))['db'];var utils=require(_0x82dd('0x5'));var logger=require(_0x82dd('0x6'))(_0x82dd('0x7'));var config=require(_0x82dd('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x82dd('0x9')][_0x82dd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x416be0,_0x2e9d89,_0x54fb28){return new BPromise(function(_0x21ebb8,_0x3e8516){return client[_0x82dd('0xb')](_0x416be0,_0x54fb28)[_0x82dd('0xc')](function(_0x488126){logger['info'](_0x82dd('0xd'),_0x2e9d89,'request\x20sent');logger[_0x82dd('0xe')](_0x82dd('0xf'),_0x2e9d89,_0x82dd('0x10'),JSON[_0x82dd('0x11')](_0x488126));if(_0x488126[_0x82dd('0x12')]){if(_0x488126['error'][_0x82dd('0x13')]===0x1f4){logger[_0x82dd('0x12')](_0x82dd('0xd'),_0x2e9d89,_0x488126[_0x82dd('0x12')][_0x82dd('0x14')]);return _0x3e8516(_0x488126['error']['message']);}logger[_0x82dd('0x12')](_0x82dd('0xd'),_0x2e9d89,_0x488126[_0x82dd('0x12')][_0x82dd('0x14')]);return _0x21ebb8(_0x488126[_0x82dd('0x12')][_0x82dd('0x14')]);}else{logger[_0x82dd('0x15')](_0x82dd('0xd'),_0x2e9d89,_0x82dd('0x10'));_0x21ebb8(_0x488126[_0x82dd('0x16')][_0x82dd('0x14')]);}})[_0x82dd('0x17')](function(_0x1bdd14){logger['error'](_0x82dd('0xd'),_0x2e9d89,_0x1bdd14);_0x3e8516(_0x1bdd14);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 0f960dd..fadd1a2 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 _0x2da1=['put','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./automation.controller','get','isAuthenticated','index','/:id','/:id/conditions','/:id/actions','getActions','post','create','addActions'];(function(_0x59162a,_0x10e547){var _0x35e50d=function(_0x578425){while(--_0x578425){_0x59162a['push'](_0x59162a['shift']());}};_0x35e50d(++_0x10e547);}(_0x2da1,0xca));var _0x12da=function(_0x2c727b,_0x40c7fd){_0x2c727b=_0x2c727b-0x0;var _0x1a7a1a=_0x2da1[_0x2c727b];return _0x1a7a1a;};'use strict';var multer=require(_0x12da('0x0'));var util=require(_0x12da('0x1'));var path=require('path');var timeout=require(_0x12da('0x2'));var express=require('express');var router=express[_0x12da('0x3')]();var fs_extra=require(_0x12da('0x4'));var auth=require(_0x12da('0x5'));var interaction=require(_0x12da('0x6'));var config=require('../../config/environment');var controller=require(_0x12da('0x7'));router[_0x12da('0x8')]('/',auth[_0x12da('0x9')](),controller[_0x12da('0xa')]);router[_0x12da('0x8')](_0x12da('0xb'),auth[_0x12da('0x9')](),controller['show']);router[_0x12da('0x8')](_0x12da('0xc'),auth[_0x12da('0x9')](),controller['getConditions']);router[_0x12da('0x8')](_0x12da('0xd'),auth[_0x12da('0x9')](),controller[_0x12da('0xe')]);router[_0x12da('0xf')]('/',auth['isAuthenticated'](),controller[_0x12da('0x10')]);router['post'](_0x12da('0xc'),auth[_0x12da('0x9')](),controller['addConditions']);router['post'](_0x12da('0xd'),auth['isAuthenticated'](),controller[_0x12da('0x11')]);router[_0x12da('0x12')](_0x12da('0xb'),auth[_0x12da('0x9')](),controller['update']);router[_0x12da('0x13')](_0x12da('0xb'),auth[_0x12da('0x9')](),controller[_0x12da('0x14')]);module[_0x12da('0x15')]=router; \ No newline at end of file +var _0x1793=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','show','get','getConditions','getActions','post','create','/:id/conditions','/:id/actions','/:id','destroy'];(function(_0x296cb0,_0x3f5ae1){var _0x31bb6a=function(_0x2670af){while(--_0x2670af){_0x296cb0['push'](_0x296cb0['shift']());}};_0x31bb6a(++_0x3f5ae1);}(_0x1793,0x1ce));var _0x3179=function(_0x502844,_0x3a9b73){_0x502844=_0x502844-0x0;var _0x443889=_0x1793[_0x502844];return _0x443889;};'use strict';var multer=require(_0x3179('0x0'));var util=require(_0x3179('0x1'));var path=require(_0x3179('0x2'));var timeout=require(_0x3179('0x3'));var express=require('express');var router=express[_0x3179('0x4')]();var fs_extra=require(_0x3179('0x5'));var auth=require(_0x3179('0x6'));var interaction=require(_0x3179('0x7'));var config=require(_0x3179('0x8'));var controller=require('./automation.controller');router['get']('/',auth[_0x3179('0x9')](),controller[_0x3179('0xa')]);router['get']('/:id',auth[_0x3179('0x9')](),controller[_0x3179('0xb')]);router[_0x3179('0xc')]('/:id/conditions',auth[_0x3179('0x9')](),controller[_0x3179('0xd')]);router['get']('/:id/actions',auth[_0x3179('0x9')](),controller[_0x3179('0xe')]);router[_0x3179('0xf')]('/',auth['isAuthenticated'](),controller[_0x3179('0x10')]);router[_0x3179('0xf')](_0x3179('0x11'),auth[_0x3179('0x9')](),controller['addConditions']);router[_0x3179('0xf')](_0x3179('0x12'),auth[_0x3179('0x9')](),controller['addActions']);router['put'](_0x3179('0x13'),auth[_0x3179('0x9')](),controller['update']);router['delete'](_0x3179('0x13'),auth[_0x3179('0x9')](),controller[_0x3179('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index e0f5d21..5d45b3a 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 _0x1df3=['onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','Cut\x20Digit\x20(min:1,\x20max:15)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','sequelize','exports','STRING','name','ivr','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','INTEGER','#Congestion\x20Retry\x20(min:1,\x20max:999)','#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,*,*,*','ENUM','always','never'];(function(_0x5f04a9,_0x47ff78){var _0x3773e5=function(_0x2ba9d6){while(--_0x2ba9d6){_0x5f04a9['push'](_0x5f04a9['shift']());}};_0x3773e5(++_0x47ff78);}(_0x1df3,0xda));var _0x31df=function(_0x3704fb,_0x4953b6){_0x3704fb=_0x3704fb-0x0;var _0x10f70f=_0x1df3[_0x3704fb];return _0x10f70f;};'use strict';var Sequelize=require(_0x31df('0x0'));module[_0x31df('0x1')]={'name':{'type':Sequelize[_0x31df('0x2')],'unique':_0x31df('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x31df('0x4')),'allowNull':![],'defaultValue':_0x31df('0x4')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x31df('0x5')],'defaultValue':0x0,'comment':_0x31df('0x6')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x31df('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x31df('0x8')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x31df('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x31df('0x9')](0x3)[_0x31df('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x31df('0x9')](0x3)[_0x31df('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x31df('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x31df('0x9')](0x5)[_0x31df('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x31df('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x31df('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x31df('0x9')](0x5)[_0x31df('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x31df('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x31df('0x9')](0x3)[_0x31df('0x7')],'defaultValue':0x3,'comment':_0x31df('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x31df('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x31df('0xe')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x31df('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x31df('0xf')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x31df('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0x31df('0x11')](_0x31df('0x12'),_0x31df('0x13'),_0x31df('0x14')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x31df('0x5')],'defaultValue':0x0,'comment':_0x31df('0x15')},'dialAMDInitialSilence':{'type':Sequelize[_0x31df('0x9')](0x9)[_0x31df('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x31df('0x9')](0x9)[_0x31df('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x31df('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x31df('0x9')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x31df('0x17')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x31df('0x9')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x31df('0x18')},'dialAMDMinWordLength':{'type':Sequelize[_0x31df('0x9')](0x9)[_0x31df('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x31df('0x19')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x31df('0x9')](0x9)[_0x31df('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x31df('0x1a')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x31df('0x9')](0x9)[_0x31df('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x31df('0x1b')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x31df('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x31df('0x1c')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x31df('0x9')](0x9)[_0x31df('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC','ASC'),'defaultValue':_0x31df('0x1d')},'dialPrefix':{'type':Sequelize[_0x31df('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x31df('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x31df('0x9')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x31df('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x31df('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x31df('0x9')](0x5)[_0x31df('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x31df('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x31df('0x9')](0x5)[_0x31df('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x31df('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x31df('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x31df('0x20')},'dialMachineMaxRetry':{'type':Sequelize[_0x31df('0x9')](0x3)[_0x31df('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x31df('0x21')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x31df('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x31df('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x31df('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}}; \ No newline at end of file +var _0x3884=['#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','ENUM','ivr','BOOLEAN','INTEGER','UNSIGNED','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','always','never','onlyIfOpen'];(function(_0x4ab99,_0x219ed2){var _0x29e39c=function(_0x2dd986){while(--_0x2dd986){_0x4ab99['push'](_0x4ab99['shift']());}};_0x29e39c(++_0x219ed2);}(_0x3884,0x186));var _0x4388=function(_0x2e76a7,_0x23871a){_0x2e76a7=_0x2e76a7-0x0;var _0x454cde=_0x3884[_0x2e76a7];return _0x454cde;};'use strict';var Sequelize=require(_0x4388('0x0'));module[_0x4388('0x1')]={'name':{'type':Sequelize[_0x4388('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x4388('0x3')](_0x4388('0x4')),'allowNull':![],'defaultValue':_0x4388('0x4')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x4388('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x4388('0x6')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x4388('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x4388('0x6')](0x3)[_0x4388('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x4388('0x6')](0x3)[_0x4388('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4388('0x8')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x4388('0x6')](0x5)[_0x4388('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4388('0x9')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x4388('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4388('0xa')},'dialBusyRetryFrequency':{'type':Sequelize[_0x4388('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4388('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x4388('0x6')](0x3)[_0x4388('0x7')],'defaultValue':0x3,'comment':_0x4388('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x4388('0x6')](0x5)[_0x4388('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4388('0xd')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x4388('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x4388('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x4388('0x3')](_0x4388('0xe'),_0x4388('0xf'),_0x4388('0x10')),'defaultValue':_0x4388('0xe')},'dialAMDActive':{'type':Sequelize[_0x4388('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x4388('0x6')](0x9)[_0x4388('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x4388('0x11')},'dialAMDGreeting':{'type':Sequelize[_0x4388('0x6')](0x9)[_0x4388('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x4388('0x12')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x4388('0x13')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x4388('0x6')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x4388('0x14')},'dialAMDMinWordLength':{'type':Sequelize[_0x4388('0x6')](0x9)[_0x4388('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x4388('0x15')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x4388('0x6')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x4388('0x16')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x4388('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x4388('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x4388('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x4388('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x4388('0x6')](0x9)[_0x4388('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0x4388('0x3')](_0x4388('0x19'),_0x4388('0x1a')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x4388('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x4388('0x6')](0x3)[_0x4388('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x4388('0x1b')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x4388('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x4388('0x1c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x4388('0x6')](0x3)[_0x4388('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x4388('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x4388('0x6')](0x3)[_0x4388('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4388('0x1d')},'dialDropRetryFrequency':{'type':Sequelize[_0x4388('0x6')](0x5)[_0x4388('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4388('0x1e')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x4388('0x6')](0x3)[_0x4388('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4388('0x1f')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x4388('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4388('0x20')},'dialMachineMaxRetry':{'type':Sequelize[_0x4388('0x6')](0x3)[_0x4388('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4388('0x21')},'dialMachineRetryFrequency':{'type':Sequelize[_0x4388('0x6')](0x5)[_0x4388('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4388('0x22')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x4388('0x6')](0x3)[_0x4388('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4388('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x4388('0x6')](0x5)[_0x4388('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4388('0x24')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 30abed2..4f579ce 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 _0x7b37=['UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','getHoppers','findOne','CmHopper','order','pick','CampaignId','getHopperHistories','CmHopperHistory','rows','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','format','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','ContactId','ListId','select','field','scheduledAt','CmListId','toString','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)','onlyIfOpen','NOW()','deletedAt\x20IS\x20NULL','cm_hopper_additional_phones','h.id','ci.OrderBY','OrderBy','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','sequelize','push','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','fs-extra','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','get','error','name','send','index','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','Campaign','includeAll','include','findAll','catch','show','params','fields','options','find','create','body','user','role','IvrCampaigns'];(function(_0x1ca8d8,_0x17aa35){var _0x1161d8=function(_0x797269){while(--_0x797269){_0x1ca8d8['push'](_0x1ca8d8['shift']());}};_0x1161d8(++_0x17aa35);}(_0x7b37,0xd9));var _0x77b3=function(_0xd351b8,_0x410fa3){_0xd351b8=_0xd351b8-0x0;var _0x3f8a1c=_0x7b37[_0xd351b8];return _0x3f8a1c;};'use strict';var emlformat=require(_0x77b3('0x0'));var rimraf=require(_0x77b3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x77b3('0x2'));var rp=require(_0x77b3('0x3'));var moment=require('moment');var BPromise=require(_0x77b3('0x4'));var Mustache=require('mustache');var util=require(_0x77b3('0x5'));var path=require(_0x77b3('0x6'));var sox=require(_0x77b3('0x7'));var csv=require('to-csv');var ejs=require(_0x77b3('0x8'));var fs=require('fs');var fs_extra=require(_0x77b3('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x77b3('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x77b3('0xb'));var toCsv=require(_0x77b3('0xc'));var querystring=require('querystring');var Papa=require(_0x77b3('0xd'));var Redis=require(_0x77b3('0xe'));var authService=require(_0x77b3('0xf'));var qs=require(_0x77b3('0x10'));var as=require(_0x77b3('0x11'));var hardwareService=require(_0x77b3('0x12'));var logger=require(_0x77b3('0x13'))(_0x77b3('0x14'));var utils=require(_0x77b3('0x15'));var config=require(_0x77b3('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x77b3('0x17'))['db'];function respondWithStatusCode(_0x48adca,_0x804b7){_0x804b7=_0x804b7||0xcc;return function(_0x16692f){if(_0x16692f){return _0x48adca[_0x77b3('0x18')](_0x804b7);}return _0x48adca[_0x77b3('0x19')](_0x804b7)[_0x77b3('0x1a')]();};}function respondWithResult(_0x1d176f,_0x9bdb6d){_0x9bdb6d=_0x9bdb6d||0xc8;return function(_0x28a47d){if(_0x28a47d){return _0x1d176f[_0x77b3('0x19')](_0x9bdb6d)[_0x77b3('0x1b')](_0x28a47d);}};}function respondWithFilteredResult(_0x504c5b,_0x2fc377){return function(_0x471afa){if(_0x471afa){var _0x1c995c=typeof _0x2fc377[_0x77b3('0x1c')]==='undefined'&&typeof _0x2fc377[_0x77b3('0x1d')]==='undefined';var _0x4e44ec=_0x471afa[_0x77b3('0x1e')];var _0x32bf27=_0x1c995c?0x0:_0x2fc377[_0x77b3('0x1c')];var _0x4499e8=_0x1c995c?_0x471afa['count']:_0x2fc377[_0x77b3('0x1c')]+_0x2fc377['limit'];var _0x5453ba;if(_0x4499e8>=_0x4e44ec){_0x4499e8=_0x4e44ec;_0x5453ba=0xc8;}else{_0x5453ba=0xce;}_0x504c5b[_0x77b3('0x19')](_0x5453ba);return _0x504c5b[_0x77b3('0x1f')](_0x77b3('0x20'),_0x32bf27+'-'+_0x4499e8+'/'+_0x4e44ec)['json'](_0x471afa);}return null;};}function patchUpdates(_0x95b5fc){return function(_0x2c545a){try{jsonpatch[_0x77b3('0x21')](_0x2c545a,_0x95b5fc,!![]);}catch(_0x625bba){return BPromise[_0x77b3('0x22')](_0x625bba);}return _0x2c545a[_0x77b3('0x23')]();};}function saveUpdates(_0x174058,_0x17d739){return function(_0x3e3eea){if(_0x3e3eea){return _0x3e3eea[_0x77b3('0x24')](_0x174058)['then'](function(_0x2cf221){return _0x2cf221;});}return null;};}function removeEntity(_0x5d7ec8,_0x233886){return function(_0x54dcd7){if(_0x54dcd7){return _0x54dcd7[_0x77b3('0x25')]()[_0x77b3('0x26')](function(){var _0x37de70=_0x54dcd7[_0x77b3('0x27')]({'plain':!![]});var _0x38be5e='IvrCampaigns';return db['UserProfileResource'][_0x77b3('0x25')]({'where':{'type':_0x38be5e,'resourceId':_0x37de70['id']}})[_0x77b3('0x26')](function(){return _0x54dcd7;});})[_0x77b3('0x26')](function(){_0x5d7ec8['status'](0xcc)[_0x77b3('0x1a')]();});}};}function handleEntityNotFound(_0x287733,_0x1d9eaf){return function(_0x2df602){if(!_0x2df602){_0x287733[_0x77b3('0x18')](0x194);}return _0x2df602;};}function handleError(_0x3b7713,_0x4fd867){_0x4fd867=_0x4fd867||0x1f4;return function(_0x289383){logger[_0x77b3('0x28')](_0x289383['stack']);if(_0x289383['name']){delete _0x289383[_0x77b3('0x29')];}_0x3b7713[_0x77b3('0x19')](_0x4fd867)[_0x77b3('0x2a')](_0x289383);};}exports[_0x77b3('0x2b')]=function(_0x14a7f8,_0x240c1b){var _0x3ff4ea={},_0xe88a76={},_0x42916e={'count':0x0,'rows':[]};var _0x104747=_['map'](db['Campaign'][_0x77b3('0x2c')],function(_0x35043b){return{'name':_0x35043b['fieldName'],'type':_0x35043b[_0x77b3('0x2d')][_0x77b3('0x2e')]};});_0xe88a76[_0x77b3('0x2f')]=_[_0x77b3('0x30')](_0x104747,'name');_0xe88a76[_0x77b3('0x31')]=_[_0x77b3('0x32')](_0x14a7f8[_0x77b3('0x31')]);_0xe88a76[_0x77b3('0x33')]=_[_0x77b3('0x34')](_0xe88a76[_0x77b3('0x2f')],_0xe88a76[_0x77b3('0x31')]);_0x3ff4ea['attributes']=_['intersection'](_0xe88a76[_0x77b3('0x2f')],qs['fields'](_0x14a7f8['query']['fields']));_0x3ff4ea[_0x77b3('0x35')]=_0x3ff4ea[_0x77b3('0x35')][_0x77b3('0x36')]?_0x3ff4ea[_0x77b3('0x35')]:_0xe88a76['model'];if(!_0x14a7f8[_0x77b3('0x31')][_0x77b3('0x37')](_0x77b3('0x38'))){_0x3ff4ea[_0x77b3('0x1d')]=qs['limit'](_0x14a7f8[_0x77b3('0x31')][_0x77b3('0x1d')]);_0x3ff4ea['offset']=qs['offset'](_0x14a7f8[_0x77b3('0x31')][_0x77b3('0x1c')]);}_0x3ff4ea['order']=qs[_0x77b3('0x39')](_0x14a7f8['query'][_0x77b3('0x39')]);_0x3ff4ea[_0x77b3('0x3a')]=qs[_0x77b3('0x33')](_['pick'](_0x14a7f8[_0x77b3('0x31')],_0xe88a76[_0x77b3('0x33')]),_0x104747);if(_0x14a7f8[_0x77b3('0x31')][_0x77b3('0x3b')]){_0x3ff4ea['where']=_[_0x77b3('0x3c')](_0x3ff4ea[_0x77b3('0x3a')],{'$or':_['map'](_0x104747,function(_0xce39cb){if(_0xce39cb['type']!==_0x77b3('0x3d')){var _0x2553c1={};_0x2553c1[_0xce39cb[_0x77b3('0x29')]]={'$like':'%'+_0x14a7f8[_0x77b3('0x31')][_0x77b3('0x3b')]+'%'};return _0x2553c1;}})});}_0x3ff4ea=_[_0x77b3('0x3c')]({},_0x3ff4ea,_0x14a7f8['options']);var _0x2dd852={'where':_0x3ff4ea[_0x77b3('0x3a')]};return db[_0x77b3('0x3e')][_0x77b3('0x1e')](_0x2dd852)[_0x77b3('0x26')](function(_0x438f6a){_0x42916e['count']=_0x438f6a;if(_0x14a7f8[_0x77b3('0x31')][_0x77b3('0x3f')]){_0x3ff4ea[_0x77b3('0x40')]=[{'all':!![]}];}return db['Campaign'][_0x77b3('0x41')](_0x3ff4ea);})['then'](function(_0x11774f){_0x42916e['rows']=_0x11774f;return _0x42916e;})[_0x77b3('0x26')](respondWithFilteredResult(_0x240c1b,_0x3ff4ea))[_0x77b3('0x42')](handleError(_0x240c1b,null));};exports[_0x77b3('0x43')]=function(_0x324f41,_0x4e12e8){var _0x8de361={'raw':![],'where':{'id':_0x324f41[_0x77b3('0x44')]['id']}},_0x354e3c={};_0x354e3c[_0x77b3('0x2f')]=_['keys'](db[_0x77b3('0x3e')]['rawAttributes']);_0x354e3c['query']=_[_0x77b3('0x32')](_0x324f41[_0x77b3('0x31')]);_0x354e3c[_0x77b3('0x33')]=_[_0x77b3('0x34')](_0x354e3c[_0x77b3('0x2f')],_0x354e3c[_0x77b3('0x31')]);_0x8de361[_0x77b3('0x35')]=_[_0x77b3('0x34')](_0x354e3c['model'],qs[_0x77b3('0x45')](_0x324f41[_0x77b3('0x31')][_0x77b3('0x45')]));_0x8de361['attributes']=_0x8de361[_0x77b3('0x35')][_0x77b3('0x36')]?_0x8de361[_0x77b3('0x35')]:_0x354e3c[_0x77b3('0x2f')];if(_0x324f41[_0x77b3('0x31')][_0x77b3('0x3f')]){_0x8de361[_0x77b3('0x40')]=[{'all':!![]}];}_0x8de361=_[_0x77b3('0x3c')]({},_0x8de361,_0x324f41[_0x77b3('0x46')]);return db[_0x77b3('0x3e')][_0x77b3('0x47')](_0x8de361)[_0x77b3('0x26')](handleEntityNotFound(_0x4e12e8,null))[_0x77b3('0x26')](respondWithResult(_0x4e12e8,null))[_0x77b3('0x42')](handleError(_0x4e12e8,null));};exports[_0x77b3('0x48')]=function(_0x127a14,_0x52a6ea){return db[_0x77b3('0x3e')][_0x77b3('0x48')](_0x127a14[_0x77b3('0x49')],{})[_0x77b3('0x26')](function(_0x262734){var _0x10ba91=_0x127a14[_0x77b3('0x4a')][_0x77b3('0x27')]({'plain':!![]});if(!_0x10ba91)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x10ba91[_0x77b3('0x4b')]===_0x77b3('0x4a')){var _0x1cdff7=_0x262734[_0x77b3('0x27')]({'plain':!![]});var _0x3e20ee=_0x77b3('0x4c');return db[_0x77b3('0x4d')][_0x77b3('0x47')]({'where':{'name':_0x3e20ee,'userProfileId':_0x10ba91[_0x77b3('0x4e')]},'raw':!![]})[_0x77b3('0x26')](function(_0x405235){if(_0x405235&&_0x405235[_0x77b3('0x4f')]===0x0){return db[_0x77b3('0x50')][_0x77b3('0x48')]({'name':_0x1cdff7[_0x77b3('0x29')],'resourceId':_0x1cdff7['id'],'type':_0x405235[_0x77b3('0x29')],'sectionId':_0x405235['id']},{})['then'](function(){return _0x262734;});}else{return _0x262734;}})['catch'](function(_0x142aff){logger[_0x77b3('0x28')](_0x77b3('0x51'),_0x142aff);throw _0x142aff;});}return _0x262734;})[_0x77b3('0x26')](respondWithResult(_0x52a6ea,0xc9))[_0x77b3('0x42')](handleError(_0x52a6ea,null));};exports[_0x77b3('0x52')]=function(_0x5e3af0,_0x11ec26){var _0x2cc5c0={'where':{'id':_0x5e3af0['params']['id']}},_0x280eb7={};_0x280eb7[_0x77b3('0x2f')]=_[_0x77b3('0x32')](db[_0x77b3('0x3e')][_0x77b3('0x2c')]);_0x2cc5c0[_0x77b3('0x35')]=_['intersection'](_0x280eb7[_0x77b3('0x2f')],qs[_0x77b3('0x45')](_0x5e3af0[_0x77b3('0x31')][_0x77b3('0x45')]));_0x2cc5c0[_0x77b3('0x35')]=_0x2cc5c0[_0x77b3('0x35')][_0x77b3('0x36')]?_0x2cc5c0[_0x77b3('0x35')]:_0x280eb7[_0x77b3('0x2f')];if(_0x5e3af0[_0x77b3('0x31')][_0x77b3('0x3f')]){_0x2cc5c0[_0x77b3('0x40')]=[{'all':!![]}];}_0x2cc5c0=_[_0x77b3('0x3c')]({},_0x2cc5c0,_0x5e3af0[_0x77b3('0x46')]);return db['Campaign']['find'](_0x2cc5c0)[_0x77b3('0x26')](handleEntityNotFound(_0x11ec26,null))[_0x77b3('0x26')](function(_0x115bc2){if(_0x115bc2){var _0x2c3dea=_0x115bc2[_0x77b3('0x27')]({'plain':!![]});_0x2c3dea=qs['omit'](_0x2c3dea,['id',_0x77b3('0x53'),'updatedAt']);_0x5e3af0[_0x77b3('0x49')]=_['omit'](_0x5e3af0[_0x77b3('0x49')],['id',_0x77b3('0x53'),_0x77b3('0x54')]);return db[_0x77b3('0x3e')][_0x77b3('0x48')](_[_0x77b3('0x3c')](_0x2c3dea,_0x5e3af0[_0x77b3('0x49')]),{'include':_0x5e3af0[_0x77b3('0x31')][_0x77b3('0x3f')]?[{'all':!![]}]:undefined})['then'](function(_0x4f4c97){var _0x34678e=_0x5e3af0[_0x77b3('0x4a')][_0x77b3('0x27')]({'plain':!![]});if(!_0x34678e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x34678e[_0x77b3('0x4b')]===_0x77b3('0x4a')){var _0x1f85e2=_0x4f4c97['get']({'plain':!![]});var _0x1d2e2b='IvrCampaigns';return db[_0x77b3('0x4d')][_0x77b3('0x47')]({'where':{'name':_0x1d2e2b,'userProfileId':_0x34678e['userProfileId']},'raw':!![]})[_0x77b3('0x26')](function(_0x4b177d){if(_0x4b177d&&_0x4b177d[_0x77b3('0x4f')]===0x0){return db[_0x77b3('0x50')][_0x77b3('0x48')]({'name':_0x1f85e2[_0x77b3('0x29')],'resourceId':_0x1f85e2['id'],'type':_0x4b177d[_0x77b3('0x29')],'sectionId':_0x4b177d['id']},{})[_0x77b3('0x26')](function(){return _0x4f4c97;});}else{return _0x4f4c97;}})['catch'](function(_0x100bb4){logger[_0x77b3('0x28')](_0x77b3('0x51'),_0x100bb4);throw _0x100bb4;});}return _0x4f4c97;});}})[_0x77b3('0x26')](respondWithResult(_0x11ec26,0xc9))['catch'](handleError(_0x11ec26,null));};exports['update']=function(_0x1ef64c,_0x49d489){if(_0x1ef64c['body']['id']){delete _0x1ef64c[_0x77b3('0x49')]['id'];}return db['Campaign'][_0x77b3('0x47')]({'where':{'id':_0x1ef64c['params']['id']}})[_0x77b3('0x26')](handleEntityNotFound(_0x49d489,null))[_0x77b3('0x26')](saveUpdates(_0x1ef64c[_0x77b3('0x49')],null))[_0x77b3('0x26')](respondWithResult(_0x49d489,null))['catch'](handleError(_0x49d489,null));};exports[_0x77b3('0x25')]=function(_0x26fc7b,_0x3e780c){return db[_0x77b3('0x3e')][_0x77b3('0x47')]({'where':{'id':_0x26fc7b[_0x77b3('0x44')]['id']}})[_0x77b3('0x26')](handleEntityNotFound(_0x3e780c,null))['then'](removeEntity(_0x3e780c,null))['catch'](handleError(_0x3e780c,null));};exports[_0x77b3('0x55')]=function(_0x5e4c4d,_0x25c7be,_0x47c7d5){var _0x144427={'raw':!![],'where':{}};var _0x27af82={};var _0x338f06={'count':0x0,'rows':[]};return db['Campaign'][_0x77b3('0x56')]({'where':{'id':_0x5e4c4d[_0x77b3('0x44')]['id']}})[_0x77b3('0x26')](handleEntityNotFound(_0x25c7be,null))[_0x77b3('0x26')](function(_0x2e8fcf){if(_0x2e8fcf){_0x27af82[_0x77b3('0x2f')]=_['keys'](db[_0x77b3('0x57')][_0x77b3('0x2c')]);_0x27af82['query']=_['keys'](_0x5e4c4d['query']);_0x27af82['filters']=_[_0x77b3('0x34')](_0x27af82['model'],_0x27af82[_0x77b3('0x31')]);_0x144427['attributes']=_['intersection'](_0x27af82[_0x77b3('0x2f')],qs[_0x77b3('0x45')](_0x5e4c4d[_0x77b3('0x31')][_0x77b3('0x45')]));_0x144427['attributes']=_0x144427[_0x77b3('0x35')][_0x77b3('0x36')]?_0x144427[_0x77b3('0x35')]:_0x27af82[_0x77b3('0x2f')];if(!_0x5e4c4d[_0x77b3('0x31')][_0x77b3('0x37')](_0x77b3('0x38'))){_0x144427[_0x77b3('0x1d')]=qs[_0x77b3('0x1d')](_0x5e4c4d[_0x77b3('0x31')][_0x77b3('0x1d')]);_0x144427[_0x77b3('0x1c')]=qs[_0x77b3('0x1c')](_0x5e4c4d[_0x77b3('0x31')][_0x77b3('0x1c')]);}_0x144427[_0x77b3('0x58')]=qs['sort'](_0x5e4c4d['query'][_0x77b3('0x39')]);_0x144427['where']=qs['filters'](_[_0x77b3('0x59')](_0x5e4c4d[_0x77b3('0x31')],_0x27af82[_0x77b3('0x33')]));_0x144427[_0x77b3('0x3a')][_0x77b3('0x5a')]=_0x2e8fcf['id'];if(_0x5e4c4d[_0x77b3('0x31')][_0x77b3('0x3b')]){_0x144427['where']=_[_0x77b3('0x3c')](_0x144427[_0x77b3('0x3a')],{'$or':_[_0x77b3('0x30')](_0x144427[_0x77b3('0x35')],function(_0x57923f){var _0xeb165d={};_0xeb165d[_0x57923f]={'$like':'%'+_0x5e4c4d[_0x77b3('0x31')][_0x77b3('0x3b')]+'%'};return _0xeb165d;})});}_0x144427=_[_0x77b3('0x3c')]({},_0x144427,_0x5e4c4d['options']);return db[_0x77b3('0x57')][_0x77b3('0x1e')]({'where':_0x144427[_0x77b3('0x3a')]})[_0x77b3('0x26')](function(_0x33b250){_0x338f06[_0x77b3('0x1e')]=_0x33b250;if(_0x5e4c4d['query'][_0x77b3('0x3f')]){_0x144427[_0x77b3('0x40')]=[{'all':!![]}];}return db[_0x77b3('0x57')][_0x77b3('0x41')](_0x144427);})[_0x77b3('0x26')](function(_0x111c71){_0x338f06['rows']=_0x111c71;return _0x338f06;});}})[_0x77b3('0x26')](respondWithFilteredResult(_0x25c7be,_0x144427))[_0x77b3('0x42')](handleError(_0x25c7be,null));};exports[_0x77b3('0x5b')]=function(_0x3ad517,_0x574e5a,_0x13ce87){var _0xa80c14={'raw':!![],'where':{}};var _0x448130={};var _0x1eb461={'count':0x0,'rows':[]};return db[_0x77b3('0x3e')][_0x77b3('0x56')]({'where':{'id':_0x3ad517[_0x77b3('0x44')]['id']}})[_0x77b3('0x26')](handleEntityNotFound(_0x574e5a,null))[_0x77b3('0x26')](function(_0x5375ad){if(_0x5375ad){_0x448130[_0x77b3('0x2f')]=_[_0x77b3('0x32')](db[_0x77b3('0x5c')][_0x77b3('0x2c')]);_0x448130[_0x77b3('0x31')]=_['keys'](_0x3ad517[_0x77b3('0x31')]);_0x448130[_0x77b3('0x33')]=_['intersection'](_0x448130[_0x77b3('0x2f')],_0x448130[_0x77b3('0x31')]);_0xa80c14[_0x77b3('0x35')]=_[_0x77b3('0x34')](_0x448130[_0x77b3('0x2f')],qs['fields'](_0x3ad517[_0x77b3('0x31')][_0x77b3('0x45')]));_0xa80c14[_0x77b3('0x35')]=_0xa80c14[_0x77b3('0x35')]['length']?_0xa80c14[_0x77b3('0x35')]:_0x448130[_0x77b3('0x2f')];if(!_0x3ad517[_0x77b3('0x31')][_0x77b3('0x37')](_0x77b3('0x38'))){_0xa80c14['limit']=qs['limit'](_0x3ad517[_0x77b3('0x31')][_0x77b3('0x1d')]);_0xa80c14[_0x77b3('0x1c')]=qs['offset'](_0x3ad517[_0x77b3('0x31')][_0x77b3('0x1c')]);}_0xa80c14[_0x77b3('0x58')]=qs[_0x77b3('0x39')](_0x3ad517['query'][_0x77b3('0x39')]);_0xa80c14[_0x77b3('0x3a')]=qs[_0x77b3('0x33')](_[_0x77b3('0x59')](_0x3ad517['query'],_0x448130['filters']));_0xa80c14[_0x77b3('0x3a')][_0x77b3('0x5a')]=_0x5375ad['id'];if(_0x3ad517[_0x77b3('0x31')]['filter']){_0xa80c14[_0x77b3('0x3a')]=_['merge'](_0xa80c14[_0x77b3('0x3a')],{'$or':_[_0x77b3('0x30')](_0xa80c14[_0x77b3('0x35')],function(_0x134606){var _0x3a153d={};_0x3a153d[_0x134606]={'$like':'%'+_0x3ad517['query'][_0x77b3('0x3b')]+'%'};return _0x3a153d;})});}_0xa80c14=_[_0x77b3('0x3c')]({},_0xa80c14,_0x3ad517['options']);return db['CmHopperHistory']['count']({'where':_0xa80c14[_0x77b3('0x3a')]})[_0x77b3('0x26')](function(_0x452d0e){_0x1eb461['count']=_0x452d0e;if(_0x3ad517['query'][_0x77b3('0x3f')]){_0xa80c14[_0x77b3('0x40')]=[{'all':!![]}];}return db[_0x77b3('0x5c')]['findAll'](_0xa80c14);})[_0x77b3('0x26')](function(_0x4b7c6e){_0x1eb461[_0x77b3('0x5d')]=_0x4b7c6e;return _0x1eb461;});}})[_0x77b3('0x26')](respondWithFilteredResult(_0x574e5a,_0xa80c14))[_0x77b3('0x42')](handleError(_0x574e5a,null));};exports[_0x77b3('0x5e')]=function(_0x49194d,_0x4f48b5,_0x2c344a){var _0x5a03c4={'raw':!![],'where':{}};var _0x8b7363={};var _0x5ce3c3={'count':0x0,'rows':[]};return db[_0x77b3('0x3e')][_0x77b3('0x56')]({'where':{'id':_0x49194d[_0x77b3('0x44')]['id']}})[_0x77b3('0x26')](handleEntityNotFound(_0x4f48b5,null))[_0x77b3('0x26')](function(_0x3e5840){if(_0x3e5840){_0x8b7363[_0x77b3('0x2f')]=_[_0x77b3('0x32')](db[_0x77b3('0x5f')][_0x77b3('0x2c')]);_0x8b7363['query']=_[_0x77b3('0x32')](_0x49194d[_0x77b3('0x31')]);_0x8b7363[_0x77b3('0x33')]=_['intersection'](_0x8b7363[_0x77b3('0x2f')],_0x8b7363[_0x77b3('0x31')]);_0x5a03c4[_0x77b3('0x35')]=_[_0x77b3('0x34')](_0x8b7363[_0x77b3('0x2f')],qs[_0x77b3('0x45')](_0x49194d[_0x77b3('0x31')][_0x77b3('0x45')]));_0x5a03c4['attributes']=_0x5a03c4[_0x77b3('0x35')][_0x77b3('0x36')]?_0x5a03c4[_0x77b3('0x35')]:_0x8b7363[_0x77b3('0x2f')];if(!_0x49194d[_0x77b3('0x31')][_0x77b3('0x37')](_0x77b3('0x38'))){_0x5a03c4[_0x77b3('0x1d')]=qs['limit'](_0x49194d['query'][_0x77b3('0x1d')]);_0x5a03c4[_0x77b3('0x1c')]=qs[_0x77b3('0x1c')](_0x49194d[_0x77b3('0x31')][_0x77b3('0x1c')]);}_0x5a03c4[_0x77b3('0x58')]=qs[_0x77b3('0x39')](_0x49194d[_0x77b3('0x31')]['sort']);_0x5a03c4[_0x77b3('0x3a')]=qs['filters'](_[_0x77b3('0x59')](_0x49194d[_0x77b3('0x31')],_0x8b7363[_0x77b3('0x33')]));_0x5a03c4['where'][_0x77b3('0x5a')]=_0x3e5840['id'];if(_0x49194d[_0x77b3('0x31')][_0x77b3('0x3b')]){_0x5a03c4[_0x77b3('0x3a')]=_[_0x77b3('0x3c')](_0x5a03c4['where'],{'$or':_['map'](_0x5a03c4[_0x77b3('0x35')],function(_0xa7a84a){var _0x4e89fb={};_0x4e89fb[_0xa7a84a]={'$like':'%'+_0x49194d[_0x77b3('0x31')][_0x77b3('0x3b')]+'%'};return _0x4e89fb;})});}_0x5a03c4=_[_0x77b3('0x3c')]({},_0x5a03c4,_0x49194d['options']);return db[_0x77b3('0x5f')][_0x77b3('0x1e')]({'where':_0x5a03c4['where']})['then'](function(_0x413c36){_0x5ce3c3[_0x77b3('0x1e')]=_0x413c36;if(_0x49194d[_0x77b3('0x31')]['includeAll']){_0x5a03c4[_0x77b3('0x40')]=[{'all':!![]}];}return db[_0x77b3('0x5f')][_0x77b3('0x41')](_0x5a03c4);})[_0x77b3('0x26')](function(_0x3b6c8c){_0x5ce3c3[_0x77b3('0x5d')]=_0x3b6c8c;return _0x5ce3c3;});}})[_0x77b3('0x26')](respondWithFilteredResult(_0x4f48b5,_0x5a03c4))[_0x77b3('0x42')](handleError(_0x4f48b5,null));};exports[_0x77b3('0x60')]=function(_0x464829,_0x23af47,_0x1c9f8d){var _0xea7a59={'raw':!![],'where':{}};var _0xfa1a81={};var _0x2dfb08={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x464829[_0x77b3('0x44')]['id']}})[_0x77b3('0x26')](handleEntityNotFound(_0x23af47,null))[_0x77b3('0x26')](function(_0x360729){if(_0x360729){_0xfa1a81[_0x77b3('0x2f')]=_['keys'](db[_0x77b3('0x61')][_0x77b3('0x2c')]);_0xfa1a81[_0x77b3('0x31')]=_[_0x77b3('0x32')](_0x464829[_0x77b3('0x31')]);_0xfa1a81[_0x77b3('0x33')]=_[_0x77b3('0x34')](_0xfa1a81[_0x77b3('0x2f')],_0xfa1a81[_0x77b3('0x31')]);_0xea7a59[_0x77b3('0x35')]=_[_0x77b3('0x34')](_0xfa1a81[_0x77b3('0x2f')],qs[_0x77b3('0x45')](_0x464829[_0x77b3('0x31')]['fields']));_0xea7a59['attributes']=_0xea7a59[_0x77b3('0x35')][_0x77b3('0x36')]?_0xea7a59[_0x77b3('0x35')]:_0xfa1a81[_0x77b3('0x2f')];if(!_0x464829[_0x77b3('0x31')]['hasOwnProperty'](_0x77b3('0x38'))){_0xea7a59[_0x77b3('0x1d')]=qs['limit'](_0x464829[_0x77b3('0x31')]['limit']);_0xea7a59[_0x77b3('0x1c')]=qs['offset'](_0x464829['query'][_0x77b3('0x1c')]);}_0xea7a59[_0x77b3('0x58')]=qs['sort'](_0x464829[_0x77b3('0x31')]['sort']);_0xea7a59[_0x77b3('0x3a')]=qs[_0x77b3('0x33')](_[_0x77b3('0x59')](_0x464829[_0x77b3('0x31')],_0xfa1a81[_0x77b3('0x33')]));_0xea7a59[_0x77b3('0x3a')][_0x77b3('0x5a')]=_0x360729['id'];if(_0x464829['query'][_0x77b3('0x3b')]){_0xea7a59[_0x77b3('0x3a')]=_['merge'](_0xea7a59[_0x77b3('0x3a')],{'$or':_['map'](_0xea7a59[_0x77b3('0x35')],function(_0x26c3c6){var _0x156196={};_0x156196[_0x26c3c6]={'$like':'%'+_0x464829[_0x77b3('0x31')][_0x77b3('0x3b')]+'%'};return _0x156196;})});}_0xea7a59=_[_0x77b3('0x3c')]({},_0xea7a59,_0x464829['options']);return db['CmHopperBlack']['count']({'where':_0xea7a59['where']})[_0x77b3('0x26')](function(_0x3199c0){_0x2dfb08[_0x77b3('0x1e')]=_0x3199c0;if(_0x464829[_0x77b3('0x31')][_0x77b3('0x3f')]){_0xea7a59[_0x77b3('0x40')]=[{'all':!![]}];}return db[_0x77b3('0x61')][_0x77b3('0x41')](_0xea7a59);})[_0x77b3('0x26')](function(_0x3ec0ed){_0x2dfb08['rows']=_0x3ec0ed;return _0x2dfb08;});}})[_0x77b3('0x26')](respondWithFilteredResult(_0x23af47,_0xea7a59))[_0x77b3('0x42')](handleError(_0x23af47,null));};exports[_0x77b3('0x62')]=function(_0x4a916e,_0x582d5b,_0x2eedf8){var _0x20f782={};var _0x92305={};var _0x2bad42;var _0x487be8;return db[_0x77b3('0x3e')][_0x77b3('0x56')]({'where':{'id':_0x4a916e[_0x77b3('0x44')]['id']}})[_0x77b3('0x26')](handleEntityNotFound(_0x582d5b,null))[_0x77b3('0x26')](function(_0x5c19d1){if(_0x5c19d1){_0x2bad42=_0x5c19d1;_0x92305[_0x77b3('0x2f')]=_['keys'](db[_0x77b3('0x63')][_0x77b3('0x2c')]);_0x92305[_0x77b3('0x31')]=_[_0x77b3('0x32')](_0x4a916e[_0x77b3('0x31')]);_0x92305[_0x77b3('0x33')]=_[_0x77b3('0x34')](_0x92305[_0x77b3('0x2f')],_0x92305[_0x77b3('0x31')]);_0x20f782['attributes']=_[_0x77b3('0x34')](_0x92305[_0x77b3('0x2f')],qs['fields'](_0x4a916e[_0x77b3('0x31')][_0x77b3('0x45')]));_0x20f782['attributes']=_0x20f782[_0x77b3('0x35')][_0x77b3('0x36')]?_0x20f782[_0x77b3('0x35')]:_0x92305[_0x77b3('0x2f')];_0x20f782['order']=qs[_0x77b3('0x39')](_0x4a916e[_0x77b3('0x31')][_0x77b3('0x39')]);_0x20f782['where']=qs['filters'](_[_0x77b3('0x59')](_0x4a916e[_0x77b3('0x31')],_0x92305[_0x77b3('0x33')]));if(_0x4a916e[_0x77b3('0x31')][_0x77b3('0x3b')]){_0x20f782[_0x77b3('0x3a')]=_['merge'](_0x20f782[_0x77b3('0x3a')],{'$or':_['map'](_0x20f782[_0x77b3('0x35')],function(_0x3481ee){var _0x1aa7e2={};_0x1aa7e2[_0x3481ee]={'$like':'%'+_0x4a916e[_0x77b3('0x31')][_0x77b3('0x3b')]+'%'};return _0x1aa7e2;})});}_0x20f782=_['merge']({},_0x20f782,_0x4a916e[_0x77b3('0x46')]);return _0x2bad42[_0x77b3('0x62')](_0x20f782);}})['then'](function(_0x429689){if(_0x429689){_0x487be8=_0x429689[_0x77b3('0x36')];if(!_0x4a916e[_0x77b3('0x31')][_0x77b3('0x37')](_0x77b3('0x38'))){_0x20f782['limit']=qs[_0x77b3('0x1d')](_0x4a916e[_0x77b3('0x31')]['limit']);_0x20f782[_0x77b3('0x1c')]=qs[_0x77b3('0x1c')](_0x4a916e['query']['offset']);}return _0x2bad42[_0x77b3('0x62')](_0x20f782);}})[_0x77b3('0x26')](function(_0x4628b4){if(_0x4628b4){return _0x4628b4?{'count':_0x487be8,'rows':_0x4628b4}:null;}})[_0x77b3('0x26')](respondWithResult(_0x582d5b,null))[_0x77b3('0x42')](handleError(_0x582d5b,null));};exports['addLists']=function(_0x34bcc1,_0x3d04b8,_0x1b8095){var _0x115b36,_0x2d2f9b;var _0x21bf81=[];var _0x42c9a8=moment()[_0x77b3('0x64')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x77b3('0x3e')][_0x77b3('0x47')]({'where':{'id':_0x34bcc1[_0x77b3('0x44')]['id']}})[_0x77b3('0x26')](handleEntityNotFound(_0x3d04b8,null))[_0x77b3('0x26')](function(_0x4aa7b7){if(_0x4aa7b7){_0x2d2f9b=_0x4aa7b7;return _0x4aa7b7[_0x77b3('0x65')](_0x34bcc1['body'][_0x77b3('0x66')],_['omit'](_0x34bcc1[_0x77b3('0x49')],[_0x77b3('0x66'),'id'])||{});}return null;})[_0x77b3('0x67')](function(_0x50116a){var _0x321f3e;var _0x484dbb;_0x115b36=_0x50116a||[];var _0x234649=[];if(_0x50116a){for(var _0x1119a6=0x0;_0x1119a6<_0x50116a[_0x77b3('0x36')];_0x1119a6+=0x1){var _0x20fe31=_0x50116a[_0x1119a6]['get']({'plain':!![]});_0x2d2f9b[_0x77b3('0x68')]=_0x34bcc1[_0x77b3('0x49')][_0x77b3('0x68')]?_0x34bcc1[_0x77b3('0x49')][_0x77b3('0x68')]:_0x2d2f9b[_0x77b3('0x68')];switch(_0x2d2f9b['dialCheckDuplicateType']){case _0x77b3('0x69'):_0x321f3e=squel[_0x77b3('0x6a')]()[_0x77b3('0x6b')](_0x77b3('0x6c'))[_0x77b3('0x6d')]([_0x77b3('0x6e'),'scheduledAt',_0x77b3('0x6f'),_0x77b3('0x70'),_0x77b3('0x5a'),'createdAt','updatedAt'],squel[_0x77b3('0x71')]()[_0x77b3('0x72')]('phone',_0x77b3('0x6e'))[_0x77b3('0x72')]('NOW()',_0x77b3('0x73'))[_0x77b3('0x72')]('id',_0x77b3('0x6f'))[_0x77b3('0x72')](_0x20fe31[_0x77b3('0x74')][_0x77b3('0x75')](),_0x77b3('0x70'))['field'](_0x34bcc1['params']['id'][_0x77b3('0x75')](),_0x77b3('0x5a'))[_0x77b3('0x72')]('\x27'+_0x42c9a8+'\x27',_0x77b3('0x53'))[_0x77b3('0x72')]('\x27'+_0x42c9a8+'\x27',_0x77b3('0x54'))[_0x77b3('0x76')](_0x77b3('0x77'))['where']('deletedAt\x20IS\x20NULL')[_0x77b3('0x3a')](_0x77b3('0x78'),_0x20fe31[_0x77b3('0x74')]['toString']())[_0x77b3('0x3a')](_0x77b3('0x79'))[_0x77b3('0x3a')](_0x77b3('0x7a'),squel[_0x77b3('0x71')]()[_0x77b3('0x72')](_0x77b3('0x7b'))[_0x77b3('0x76')](_0x77b3('0x7c'))[_0x77b3('0x3a')](_0x77b3('0x7d'),_0x34bcc1[_0x77b3('0x44')]['id']['toString']()))['where'](_0x77b3('0x7a'),squel[_0x77b3('0x71')]()['field'](_0x77b3('0x7e'))[_0x77b3('0x76')](_0x77b3('0x6c'))[_0x77b3('0x3a')]('CampaignId\x20=\x20?',_0x34bcc1['params']['id'][_0x77b3('0x75')]())))[_0x77b3('0x75')]();break;case _0x77b3('0x7f'):_0x321f3e=squel[_0x77b3('0x6a')]()[_0x77b3('0x6b')]('cm_hopper')[_0x77b3('0x6d')]([_0x77b3('0x6e'),_0x77b3('0x73'),_0x77b3('0x6f'),_0x77b3('0x70'),_0x77b3('0x5a'),_0x77b3('0x53'),_0x77b3('0x54')],squel['select']()[_0x77b3('0x72')](_0x77b3('0x6e'),'phone')[_0x77b3('0x72')](_0x77b3('0x80'),'scheduledAt')[_0x77b3('0x72')]('id',_0x77b3('0x6f'))[_0x77b3('0x72')](_0x20fe31[_0x77b3('0x74')][_0x77b3('0x75')](),'ListId')[_0x77b3('0x72')](_0x34bcc1['params']['id']['toString'](),_0x77b3('0x5a'))['field']('\x27'+_0x42c9a8+'\x27',_0x77b3('0x53'))['field']('\x27'+_0x42c9a8+'\x27',_0x77b3('0x54'))['from'](_0x77b3('0x77'))[_0x77b3('0x3a')](_0x77b3('0x81'))['where']('ListId\x20=\x20?',_0x20fe31['CmListId'][_0x77b3('0x75')]())['where'](_0x77b3('0x79'))[_0x77b3('0x3a')]('phone\x20NOT\x20IN\x20(?)',squel[_0x77b3('0x71')]()[_0x77b3('0x72')]('COALESCE(phone,\x27\x27)')[_0x77b3('0x76')]('cm_hopper')[_0x77b3('0x3a')](_0x77b3('0x7d'),_0x34bcc1[_0x77b3('0x44')]['id'][_0x77b3('0x75')]())))[_0x77b3('0x75')]();break;default:_0x321f3e=squel[_0x77b3('0x6a')]()[_0x77b3('0x6b')](_0x77b3('0x6c'))[_0x77b3('0x6d')]([_0x77b3('0x6e'),_0x77b3('0x73'),_0x77b3('0x6f'),_0x77b3('0x70'),_0x77b3('0x5a'),_0x77b3('0x53'),'updatedAt'],squel[_0x77b3('0x71')]()['field'](_0x77b3('0x6e'),_0x77b3('0x6e'))[_0x77b3('0x72')](_0x77b3('0x80'),_0x77b3('0x73'))[_0x77b3('0x72')]('id',_0x77b3('0x6f'))[_0x77b3('0x72')](_0x20fe31[_0x77b3('0x74')][_0x77b3('0x75')](),_0x77b3('0x70'))[_0x77b3('0x72')](_0x34bcc1[_0x77b3('0x44')]['id'][_0x77b3('0x75')](),'CampaignId')[_0x77b3('0x72')]('\x27'+_0x42c9a8+'\x27',_0x77b3('0x53'))[_0x77b3('0x72')]('\x27'+_0x42c9a8+'\x27',_0x77b3('0x54'))[_0x77b3('0x76')]('cm_contacts')[_0x77b3('0x3a')](_0x77b3('0x81'))[_0x77b3('0x3a')](_0x77b3('0x78'),_0x20fe31[_0x77b3('0x74')][_0x77b3('0x75')]())[_0x77b3('0x3a')](_0x77b3('0x79')))[_0x77b3('0x75')]();}_0x484dbb=squel[_0x77b3('0x6a')]()[_0x77b3('0x6b')](_0x77b3('0x82'))[_0x77b3('0x6d')](['cmHopperId',_0x77b3('0x73'),_0x77b3('0x6e'),'OrderBy',_0x77b3('0x53'),_0x77b3('0x54')],squel[_0x77b3('0x71')]()[_0x77b3('0x72')](_0x77b3('0x83'),'id')[_0x77b3('0x72')](_0x77b3('0x80'),'scheduledAt')[_0x77b3('0x72')]('ci.item',_0x77b3('0x6e'))[_0x77b3('0x72')](_0x77b3('0x84'),_0x77b3('0x85'))[_0x77b3('0x72')]('\x27'+_0x42c9a8+'\x27',_0x77b3('0x53'))[_0x77b3('0x72')]('\x27'+_0x42c9a8+'\x27',_0x77b3('0x54'))[_0x77b3('0x76')]('cm_contact_has_items','ci')[_0x77b3('0x86')](_0x77b3('0x6c'),'h',_0x77b3('0x87'))['where'](_0x77b3('0x88'),_0x20fe31[_0x77b3('0x74')][_0x77b3('0x75')]())[_0x77b3('0x3a')](_0x77b3('0x89'),_0x34bcc1[_0x77b3('0x44')]['id'][_0x77b3('0x75')]())[_0x77b3('0x3a')](_0x77b3('0x8a'),_0x42c9a8))[_0x77b3('0x75')]();_0x234649['push'](db[_0x77b3('0x8b')][_0x77b3('0x31')](_0x321f3e));_0x21bf81[_0x77b3('0x8c')](db['sequelize'][_0x77b3('0x31')](_0x484dbb));}return BPromise[_0x77b3('0x8d')](_0x234649);}})['then'](function(){return BPromise['all'](_0x21bf81);})[_0x77b3('0x26')](function(){return _0x115b36;})['then'](respondWithResult(_0x3d04b8,null))['catch'](handleError(_0x3d04b8,null));};exports[_0x77b3('0x8e')]=function(_0x3ac619,_0x3fd3d1,_0x10744c){return db[_0x77b3('0x3e')][_0x77b3('0x47')]({'where':{'id':_0x3ac619[_0x77b3('0x44')]['id']}})[_0x77b3('0x26')](handleEntityNotFound(_0x3fd3d1,null))[_0x77b3('0x26')](function(_0x28fe86){if(_0x28fe86){return _0x28fe86[_0x77b3('0x8e')](_0x3ac619[_0x77b3('0x31')][_0x77b3('0x66')]);}})[_0x77b3('0x26')](function(_0x3076dd){if(_0x3076dd){return db[_0x77b3('0x57')][_0x77b3('0x25')]({'where':{'ListId':_0x3ac619[_0x77b3('0x31')]['ids'],'CampaignId':_0x3ac619['params']['id']}})[_0x77b3('0x26')](function(){return _0x3076dd;});}})['then'](respondWithStatusCode(_0x3fd3d1,null))[_0x77b3('0x42')](handleError(_0x3fd3d1,null));};exports[_0x77b3('0x8f')]=function(_0x4e60a7,_0x42a1c0,_0x5987e9){var _0x2814d7={};var _0x21d858={};var _0x2fec96;var _0x31d3fb;return db[_0x77b3('0x3e')][_0x77b3('0x56')]({'where':{'id':_0x4e60a7[_0x77b3('0x44')]['id']}})[_0x77b3('0x26')](handleEntityNotFound(_0x42a1c0,null))['then'](function(_0x25f81c){if(_0x25f81c){_0x2fec96=_0x25f81c;_0x21d858['model']=_[_0x77b3('0x32')](db['CmList'][_0x77b3('0x2c')]);_0x21d858[_0x77b3('0x31')]=_[_0x77b3('0x32')](_0x4e60a7[_0x77b3('0x31')]);_0x21d858[_0x77b3('0x33')]=_['intersection'](_0x21d858[_0x77b3('0x2f')],_0x21d858['query']);_0x2814d7[_0x77b3('0x35')]=_[_0x77b3('0x34')](_0x21d858['model'],qs[_0x77b3('0x45')](_0x4e60a7['query']['fields']));_0x2814d7['attributes']=_0x2814d7[_0x77b3('0x35')][_0x77b3('0x36')]?_0x2814d7['attributes']:_0x21d858[_0x77b3('0x2f')];_0x2814d7[_0x77b3('0x58')]=qs[_0x77b3('0x39')](_0x4e60a7['query'][_0x77b3('0x39')]);_0x2814d7[_0x77b3('0x3a')]=qs[_0x77b3('0x33')](_[_0x77b3('0x59')](_0x4e60a7[_0x77b3('0x31')],_0x21d858[_0x77b3('0x33')]));if(_0x4e60a7['query'][_0x77b3('0x3b')]){_0x2814d7['where']=_['merge'](_0x2814d7['where'],{'$or':_[_0x77b3('0x30')](_0x2814d7[_0x77b3('0x35')],function(_0x29b8d8){var _0x3c66a8={};_0x3c66a8[_0x29b8d8]={'$like':'%'+_0x4e60a7[_0x77b3('0x31')]['filter']+'%'};return _0x3c66a8;})});}_0x2814d7=_[_0x77b3('0x3c')]({},_0x2814d7,_0x4e60a7[_0x77b3('0x46')]);return _0x2fec96[_0x77b3('0x8f')](_0x2814d7);}})['then'](function(_0x2f4ade){if(_0x2f4ade){_0x31d3fb=_0x2f4ade[_0x77b3('0x36')];if(!_0x4e60a7['query'][_0x77b3('0x37')]('nolimit')){_0x2814d7['limit']=qs[_0x77b3('0x1d')](_0x4e60a7[_0x77b3('0x31')][_0x77b3('0x1d')]);_0x2814d7[_0x77b3('0x1c')]=qs[_0x77b3('0x1c')](_0x4e60a7[_0x77b3('0x31')][_0x77b3('0x1c')]);}return _0x2fec96['getBlackLists'](_0x2814d7);}})[_0x77b3('0x26')](function(_0x3e0408){if(_0x3e0408){return _0x3e0408?{'count':_0x31d3fb,'rows':_0x3e0408}:null;}})['then'](respondWithResult(_0x42a1c0,null))[_0x77b3('0x42')](handleError(_0x42a1c0,null));};exports['addBlackLists']=function(_0x123ae5,_0x4e9bc4,_0x376a4d){var _0x100361,_0x14c188;var _0x5e2fca=[];var _0x36d4ca=moment()[_0x77b3('0x64')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x77b3('0x3e')][_0x77b3('0x47')]({'where':{'id':_0x123ae5[_0x77b3('0x44')]['id']}})[_0x77b3('0x26')](handleEntityNotFound(_0x4e9bc4,null))['then'](function(_0x408e2e){if(_0x408e2e){_0x14c188=_0x408e2e;return _0x408e2e[_0x77b3('0x90')](_0x123ae5['body'][_0x77b3('0x66')],_['omit'](_0x123ae5[_0x77b3('0x49')],[_0x77b3('0x66'),'id'])||{});}return null;})[_0x77b3('0x67')](function(_0x206d2d){var _0x2174ef;var _0x4187f0;_0x100361=_0x206d2d||[];var _0x39f11e=[];if(_0x206d2d){for(var _0x3818ba=0x0;_0x3818ba<_0x206d2d['length'];_0x3818ba+=0x1){var _0x1b7c8e=_0x206d2d[_0x3818ba][_0x77b3('0x27')]({'plain':!![]});_0x2174ef=squel[_0x77b3('0x6a')]()['into'](_0x77b3('0x91'))[_0x77b3('0x6d')]([_0x77b3('0x6e'),_0x77b3('0x6f'),'ListId','CampaignId',_0x77b3('0x53'),_0x77b3('0x54')],squel[_0x77b3('0x71')]()[_0x77b3('0x72')](_0x77b3('0x6e'),_0x77b3('0x6e'))[_0x77b3('0x72')]('id','ContactId')['field'](_0x1b7c8e['CmListId'][_0x77b3('0x75')](),_0x77b3('0x70'))['field'](_0x123ae5[_0x77b3('0x44')]['id'][_0x77b3('0x75')](),_0x77b3('0x5a'))[_0x77b3('0x72')]('NOW()',_0x77b3('0x53'))[_0x77b3('0x72')](_0x77b3('0x80'),_0x77b3('0x54'))[_0x77b3('0x76')](_0x77b3('0x77'))[_0x77b3('0x3a')]('deletedAt\x20IS\x20NULL')['where'](_0x77b3('0x78'),_0x1b7c8e['CmListId'][_0x77b3('0x75')]())[_0x77b3('0x3a')](_0x77b3('0x79')))[_0x77b3('0x75')]();_0x39f11e[_0x77b3('0x8c')](db['sequelize'][_0x77b3('0x31')](_0x2174ef));}return BPromise['all'](_0x39f11e);}})[_0x77b3('0x26')](function(){return _0x100361;})['then'](respondWithResult(_0x4e9bc4,null))[_0x77b3('0x42')](handleError(_0x4e9bc4,null));};exports[_0x77b3('0x92')]=function(_0xdd7c76,_0x486767,_0x463cdb){return db[_0x77b3('0x3e')]['find']({'where':{'id':_0xdd7c76[_0x77b3('0x44')]['id']}})['then'](handleEntityNotFound(_0x486767,null))['then'](function(_0x49e6ee){if(_0x49e6ee){return _0x49e6ee[_0x77b3('0x92')](_0xdd7c76[_0x77b3('0x31')]['ids']);}})['then'](function(_0x19d2c4){if(_0x19d2c4){return db[_0x77b3('0x61')][_0x77b3('0x25')]({'where':{'ListId':_0xdd7c76[_0x77b3('0x31')][_0x77b3('0x66')],'CampaignId':_0xdd7c76['params']['id']}})[_0x77b3('0x26')](function(){return _0x19d2c4;});}})[_0x77b3('0x26')](respondWithStatusCode(_0x486767,null))[_0x77b3('0x42')](handleError(_0x486767,null));}; \ No newline at end of file +var _0x6a47=['api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','get','IvrCampaigns','UserProfileResource','destroy','end','error','name','send','index','map','Campaign','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','options','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','getHoppers','findOne','CmHopper','nolimit','CampaignId','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','CmList','getLists','format','YYYY-MM-DD\x20HH:mm:ss','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','phone','scheduledAt','ContactId','select','field','NOW()','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','CampaignId\x20=\x20?','onlyIfOpen','cm_hopper','fromQuery','ListId','phone\x20IS\x20NOT\x20NULL','cm_hopper_additional_phones','OrderBy','h.id','ci.item','cm_contact_has_items','join','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x294abb,_0x37ff32){var _0x2b9b0e=function(_0x435277){while(--_0x435277){_0x294abb['push'](_0x294abb['shift']());}};_0x2b9b0e(++_0x37ff32);}(_0x6a47,0x112));var _0x76a4=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x6a47[_0x4e676e];return _0x336a3c;};'use strict';var emlformat=require(_0x76a4('0x0'));var rimraf=require(_0x76a4('0x1'));var zipdir=require(_0x76a4('0x2'));var jsonpatch=require(_0x76a4('0x3'));var rp=require(_0x76a4('0x4'));var moment=require('moment');var BPromise=require(_0x76a4('0x5'));var Mustache=require(_0x76a4('0x6'));var util=require('util');var path=require(_0x76a4('0x7'));var sox=require(_0x76a4('0x8'));var csv=require('to-csv');var ejs=require(_0x76a4('0x9'));var fs=require('fs');var fs_extra=require(_0x76a4('0xa'));var _=require('lodash');var squel=require(_0x76a4('0xb'));var crypto=require(_0x76a4('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x76a4('0xd'));var toCsv=require(_0x76a4('0xe'));var querystring=require(_0x76a4('0xf'));var Papa=require('papaparse');var Redis=require(_0x76a4('0x10'));var authService=require(_0x76a4('0x11'));var qs=require(_0x76a4('0x12'));var as=require(_0x76a4('0x13'));var hardwareService=require(_0x76a4('0x14'));var logger=require(_0x76a4('0x15'))(_0x76a4('0x16'));var utils=require(_0x76a4('0x17'));var config=require(_0x76a4('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x76a4('0x19'))['db'];function respondWithStatusCode(_0xfe603f,_0x421ed2){_0x421ed2=_0x421ed2||0xcc;return function(_0x48e8a7){if(_0x48e8a7){return _0xfe603f[_0x76a4('0x1a')](_0x421ed2);}return _0xfe603f[_0x76a4('0x1b')](_0x421ed2)['end']();};}function respondWithResult(_0x3ec54f,_0x42e0c2){_0x42e0c2=_0x42e0c2||0xc8;return function(_0x5a729a){if(_0x5a729a){return _0x3ec54f['status'](_0x42e0c2)[_0x76a4('0x1c')](_0x5a729a);}};}function respondWithFilteredResult(_0x6213d3,_0x5261de){return function(_0x1ecb5c){if(_0x1ecb5c){var _0x3aed77=typeof _0x5261de[_0x76a4('0x1d')]===_0x76a4('0x1e')&&typeof _0x5261de[_0x76a4('0x1f')]===_0x76a4('0x1e');var _0x147a68=_0x1ecb5c[_0x76a4('0x20')];var _0x52e81f=_0x3aed77?0x0:_0x5261de[_0x76a4('0x1d')];var _0x52cc5f=_0x3aed77?_0x1ecb5c[_0x76a4('0x20')]:_0x5261de['offset']+_0x5261de['limit'];var _0x297064;if(_0x52cc5f>=_0x147a68){_0x52cc5f=_0x147a68;_0x297064=0xc8;}else{_0x297064=0xce;}_0x6213d3['status'](_0x297064);return _0x6213d3[_0x76a4('0x21')](_0x76a4('0x22'),_0x52e81f+'-'+_0x52cc5f+'/'+_0x147a68)[_0x76a4('0x1c')](_0x1ecb5c);}return null;};}function patchUpdates(_0x30c770){return function(_0x18fa98){try{jsonpatch['apply'](_0x18fa98,_0x30c770,!![]);}catch(_0x5a52c7){return BPromise[_0x76a4('0x23')](_0x5a52c7);}return _0x18fa98[_0x76a4('0x24')]();};}function saveUpdates(_0x5ab74a,_0xae96cc){return function(_0x3eee72){if(_0x3eee72){return _0x3eee72[_0x76a4('0x25')](_0x5ab74a)[_0x76a4('0x26')](function(_0x2892f2){return _0x2892f2;});}return null;};}function removeEntity(_0x367164,_0x229cbe){return function(_0x53ec55){if(_0x53ec55){return _0x53ec55['destroy']()['then'](function(){var _0x4fd6eb=_0x53ec55[_0x76a4('0x27')]({'plain':!![]});var _0x4570a0=_0x76a4('0x28');return db[_0x76a4('0x29')][_0x76a4('0x2a')]({'where':{'type':_0x4570a0,'resourceId':_0x4fd6eb['id']}})['then'](function(){return _0x53ec55;});})['then'](function(){_0x367164[_0x76a4('0x1b')](0xcc)[_0x76a4('0x2b')]();});}};}function handleEntityNotFound(_0x4a2b41,_0x5b2e28){return function(_0x41d8f8){if(!_0x41d8f8){_0x4a2b41[_0x76a4('0x1a')](0x194);}return _0x41d8f8;};}function handleError(_0x43ce16,_0x6f89b4){_0x6f89b4=_0x6f89b4||0x1f4;return function(_0x228c34){logger[_0x76a4('0x2c')](_0x228c34['stack']);if(_0x228c34['name']){delete _0x228c34[_0x76a4('0x2d')];}_0x43ce16[_0x76a4('0x1b')](_0x6f89b4)[_0x76a4('0x2e')](_0x228c34);};}exports[_0x76a4('0x2f')]=function(_0x183f0b,_0x3ba49c){var _0x78ce67={},_0x4afff6={},_0x553738={'count':0x0,'rows':[]};var _0x16dc67=_[_0x76a4('0x30')](db[_0x76a4('0x31')][_0x76a4('0x32')],function(_0x65eb1f){return{'name':_0x65eb1f[_0x76a4('0x33')],'type':_0x65eb1f[_0x76a4('0x34')]['key']};});_0x4afff6['model']=_[_0x76a4('0x30')](_0x16dc67,_0x76a4('0x2d'));_0x4afff6[_0x76a4('0x35')]=_[_0x76a4('0x36')](_0x183f0b['query']);_0x4afff6[_0x76a4('0x37')]=_[_0x76a4('0x38')](_0x4afff6[_0x76a4('0x39')],_0x4afff6[_0x76a4('0x35')]);_0x78ce67[_0x76a4('0x3a')]=_[_0x76a4('0x38')](_0x4afff6['model'],qs[_0x76a4('0x3b')](_0x183f0b['query'][_0x76a4('0x3b')]));_0x78ce67[_0x76a4('0x3a')]=_0x78ce67['attributes'][_0x76a4('0x3c')]?_0x78ce67[_0x76a4('0x3a')]:_0x4afff6[_0x76a4('0x39')];if(!_0x183f0b[_0x76a4('0x35')][_0x76a4('0x3d')]('nolimit')){_0x78ce67['limit']=qs[_0x76a4('0x1f')](_0x183f0b['query'][_0x76a4('0x1f')]);_0x78ce67[_0x76a4('0x1d')]=qs[_0x76a4('0x1d')](_0x183f0b[_0x76a4('0x35')][_0x76a4('0x1d')]);}_0x78ce67[_0x76a4('0x3e')]=qs['sort'](_0x183f0b['query'][_0x76a4('0x3f')]);_0x78ce67[_0x76a4('0x40')]=qs['filters'](_[_0x76a4('0x41')](_0x183f0b[_0x76a4('0x35')],_0x4afff6[_0x76a4('0x37')]),_0x16dc67);if(_0x183f0b['query'][_0x76a4('0x42')]){_0x78ce67[_0x76a4('0x40')]=_['merge'](_0x78ce67[_0x76a4('0x40')],{'$or':_[_0x76a4('0x30')](_0x16dc67,function(_0x91df79){if(_0x91df79['type']!=='VIRTUAL'){var _0x3b149a={};_0x3b149a[_0x91df79['name']]={'$like':'%'+_0x183f0b['query'][_0x76a4('0x42')]+'%'};return _0x3b149a;}})});}_0x78ce67=_['merge']({},_0x78ce67,_0x183f0b[_0x76a4('0x43')]);var _0x3b7c6b={'where':_0x78ce67[_0x76a4('0x40')]};return db['Campaign'][_0x76a4('0x20')](_0x3b7c6b)[_0x76a4('0x26')](function(_0x51d94b){_0x553738[_0x76a4('0x20')]=_0x51d94b;if(_0x183f0b[_0x76a4('0x35')][_0x76a4('0x44')]){_0x78ce67[_0x76a4('0x45')]=[{'all':!![]}];}return db[_0x76a4('0x31')][_0x76a4('0x46')](_0x78ce67);})[_0x76a4('0x26')](function(_0x361abe){_0x553738[_0x76a4('0x47')]=_0x361abe;return _0x553738;})[_0x76a4('0x26')](respondWithFilteredResult(_0x3ba49c,_0x78ce67))[_0x76a4('0x48')](handleError(_0x3ba49c,null));};exports[_0x76a4('0x49')]=function(_0x442431,_0x26ed8f){var _0x51f8b7={'raw':![],'where':{'id':_0x442431[_0x76a4('0x4a')]['id']}},_0x193ad1={};_0x193ad1[_0x76a4('0x39')]=_[_0x76a4('0x36')](db[_0x76a4('0x31')][_0x76a4('0x32')]);_0x193ad1[_0x76a4('0x35')]=_[_0x76a4('0x36')](_0x442431['query']);_0x193ad1[_0x76a4('0x37')]=_['intersection'](_0x193ad1[_0x76a4('0x39')],_0x193ad1['query']);_0x51f8b7[_0x76a4('0x3a')]=_[_0x76a4('0x38')](_0x193ad1['model'],qs[_0x76a4('0x3b')](_0x442431['query'][_0x76a4('0x3b')]));_0x51f8b7['attributes']=_0x51f8b7['attributes'][_0x76a4('0x3c')]?_0x51f8b7[_0x76a4('0x3a')]:_0x193ad1['model'];if(_0x442431[_0x76a4('0x35')][_0x76a4('0x44')]){_0x51f8b7['include']=[{'all':!![]}];}_0x51f8b7=_[_0x76a4('0x4b')]({},_0x51f8b7,_0x442431[_0x76a4('0x43')]);return db[_0x76a4('0x31')][_0x76a4('0x4c')](_0x51f8b7)['then'](handleEntityNotFound(_0x26ed8f,null))[_0x76a4('0x26')](respondWithResult(_0x26ed8f,null))['catch'](handleError(_0x26ed8f,null));};exports['create']=function(_0x4275ff,_0x1dea2d){return db[_0x76a4('0x31')][_0x76a4('0x4d')](_0x4275ff[_0x76a4('0x4e')],{})[_0x76a4('0x26')](function(_0x5687b3){var _0x180761=_0x4275ff[_0x76a4('0x4f')][_0x76a4('0x27')]({'plain':!![]});if(!_0x180761)throw new Error(_0x76a4('0x50'));if(_0x180761[_0x76a4('0x51')]===_0x76a4('0x4f')){var _0x513325=_0x5687b3[_0x76a4('0x27')]({'plain':!![]});var _0xdf968b='IvrCampaigns';return db[_0x76a4('0x52')][_0x76a4('0x4c')]({'where':{'name':_0xdf968b,'userProfileId':_0x180761[_0x76a4('0x53')]},'raw':!![]})[_0x76a4('0x26')](function(_0x2f9abf){if(_0x2f9abf&&_0x2f9abf[_0x76a4('0x54')]===0x0){return db[_0x76a4('0x29')][_0x76a4('0x4d')]({'name':_0x513325['name'],'resourceId':_0x513325['id'],'type':_0x2f9abf[_0x76a4('0x2d')],'sectionId':_0x2f9abf['id']},{})[_0x76a4('0x26')](function(){return _0x5687b3;});}else{return _0x5687b3;}})[_0x76a4('0x48')](function(_0x2cac9c){logger[_0x76a4('0x2c')](_0x76a4('0x55'),_0x2cac9c);throw _0x2cac9c;});}return _0x5687b3;})[_0x76a4('0x26')](respondWithResult(_0x1dea2d,0xc9))[_0x76a4('0x48')](handleError(_0x1dea2d,null));};exports[_0x76a4('0x56')]=function(_0x1512b2,_0x3a6f9d){var _0x6a2ec0={'where':{'id':_0x1512b2[_0x76a4('0x4a')]['id']}},_0x576c0c={};_0x576c0c['model']=_[_0x76a4('0x36')](db[_0x76a4('0x31')][_0x76a4('0x32')]);_0x6a2ec0[_0x76a4('0x3a')]=_[_0x76a4('0x38')](_0x576c0c['model'],qs[_0x76a4('0x3b')](_0x1512b2[_0x76a4('0x35')][_0x76a4('0x3b')]));_0x6a2ec0['attributes']=_0x6a2ec0[_0x76a4('0x3a')]['length']?_0x6a2ec0['attributes']:_0x576c0c[_0x76a4('0x39')];if(_0x1512b2[_0x76a4('0x35')]['includeAll']){_0x6a2ec0[_0x76a4('0x45')]=[{'all':!![]}];}_0x6a2ec0=_[_0x76a4('0x4b')]({},_0x6a2ec0,_0x1512b2[_0x76a4('0x43')]);return db[_0x76a4('0x31')][_0x76a4('0x4c')](_0x6a2ec0)[_0x76a4('0x26')](handleEntityNotFound(_0x3a6f9d,null))[_0x76a4('0x26')](function(_0x554b83){if(_0x554b83){var _0x1a5478=_0x554b83['get']({'plain':!![]});_0x1a5478=qs[_0x76a4('0x57')](_0x1a5478,['id',_0x76a4('0x58'),_0x76a4('0x59')]);_0x1512b2[_0x76a4('0x4e')]=_[_0x76a4('0x57')](_0x1512b2[_0x76a4('0x4e')],['id',_0x76a4('0x58'),'updatedAt']);return db['Campaign'][_0x76a4('0x4d')](_[_0x76a4('0x4b')](_0x1a5478,_0x1512b2[_0x76a4('0x4e')]),{'include':_0x1512b2[_0x76a4('0x35')][_0x76a4('0x44')]?[{'all':!![]}]:undefined})[_0x76a4('0x26')](function(_0x581886){var _0x4298ba=_0x1512b2[_0x76a4('0x4f')]['get']({'plain':!![]});if(!_0x4298ba)throw new Error(_0x76a4('0x50'));if(_0x4298ba[_0x76a4('0x51')]===_0x76a4('0x4f')){var _0xc2a60b=_0x581886['get']({'plain':!![]});var _0x194ebc='IvrCampaigns';return db[_0x76a4('0x52')][_0x76a4('0x4c')]({'where':{'name':_0x194ebc,'userProfileId':_0x4298ba['userProfileId']},'raw':!![]})[_0x76a4('0x26')](function(_0x5d112a){if(_0x5d112a&&_0x5d112a[_0x76a4('0x54')]===0x0){return db['UserProfileResource'][_0x76a4('0x4d')]({'name':_0xc2a60b['name'],'resourceId':_0xc2a60b['id'],'type':_0x5d112a['name'],'sectionId':_0x5d112a['id']},{})[_0x76a4('0x26')](function(){return _0x581886;});}else{return _0x581886;}})[_0x76a4('0x48')](function(_0x396eb4){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x396eb4);throw _0x396eb4;});}return _0x581886;});}})['then'](respondWithResult(_0x3a6f9d,0xc9))[_0x76a4('0x48')](handleError(_0x3a6f9d,null));};exports[_0x76a4('0x25')]=function(_0x5d1dda,_0x394a52){if(_0x5d1dda['body']['id']){delete _0x5d1dda[_0x76a4('0x4e')]['id'];}return db[_0x76a4('0x31')][_0x76a4('0x4c')]({'where':{'id':_0x5d1dda[_0x76a4('0x4a')]['id']}})[_0x76a4('0x26')](handleEntityNotFound(_0x394a52,null))['then'](saveUpdates(_0x5d1dda[_0x76a4('0x4e')],null))[_0x76a4('0x26')](respondWithResult(_0x394a52,null))[_0x76a4('0x48')](handleError(_0x394a52,null));};exports[_0x76a4('0x2a')]=function(_0x533999,_0x3c60a7){return db[_0x76a4('0x31')][_0x76a4('0x4c')]({'where':{'id':_0x533999[_0x76a4('0x4a')]['id']}})[_0x76a4('0x26')](handleEntityNotFound(_0x3c60a7,null))[_0x76a4('0x26')](removeEntity(_0x3c60a7,null))[_0x76a4('0x48')](handleError(_0x3c60a7,null));};exports[_0x76a4('0x5a')]=function(_0x45719b,_0x3eacdb,_0x401289){var _0x52c468={'raw':!![],'where':{}};var _0x39a6e4={};var _0x4972ed={'count':0x0,'rows':[]};return db[_0x76a4('0x31')][_0x76a4('0x5b')]({'where':{'id':_0x45719b[_0x76a4('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3eacdb,null))[_0x76a4('0x26')](function(_0x2ec71f){if(_0x2ec71f){_0x39a6e4[_0x76a4('0x39')]=_[_0x76a4('0x36')](db[_0x76a4('0x5c')][_0x76a4('0x32')]);_0x39a6e4[_0x76a4('0x35')]=_[_0x76a4('0x36')](_0x45719b[_0x76a4('0x35')]);_0x39a6e4[_0x76a4('0x37')]=_['intersection'](_0x39a6e4[_0x76a4('0x39')],_0x39a6e4['query']);_0x52c468['attributes']=_['intersection'](_0x39a6e4['model'],qs['fields'](_0x45719b[_0x76a4('0x35')]['fields']));_0x52c468[_0x76a4('0x3a')]=_0x52c468[_0x76a4('0x3a')][_0x76a4('0x3c')]?_0x52c468[_0x76a4('0x3a')]:_0x39a6e4[_0x76a4('0x39')];if(!_0x45719b[_0x76a4('0x35')]['hasOwnProperty'](_0x76a4('0x5d'))){_0x52c468['limit']=qs[_0x76a4('0x1f')](_0x45719b['query'][_0x76a4('0x1f')]);_0x52c468[_0x76a4('0x1d')]=qs[_0x76a4('0x1d')](_0x45719b[_0x76a4('0x35')]['offset']);}_0x52c468[_0x76a4('0x3e')]=qs['sort'](_0x45719b['query'][_0x76a4('0x3f')]);_0x52c468[_0x76a4('0x40')]=qs[_0x76a4('0x37')](_[_0x76a4('0x41')](_0x45719b[_0x76a4('0x35')],_0x39a6e4[_0x76a4('0x37')]));_0x52c468[_0x76a4('0x40')][_0x76a4('0x5e')]=_0x2ec71f['id'];if(_0x45719b[_0x76a4('0x35')][_0x76a4('0x42')]){_0x52c468[_0x76a4('0x40')]=_['merge'](_0x52c468[_0x76a4('0x40')],{'$or':_[_0x76a4('0x30')](_0x52c468[_0x76a4('0x3a')],function(_0x572566){var _0x44017f={};_0x44017f[_0x572566]={'$like':'%'+_0x45719b[_0x76a4('0x35')]['filter']+'%'};return _0x44017f;})});}_0x52c468=_['merge']({},_0x52c468,_0x45719b[_0x76a4('0x43')]);return db[_0x76a4('0x5c')][_0x76a4('0x20')]({'where':_0x52c468['where']})[_0x76a4('0x26')](function(_0x5e6b39){_0x4972ed[_0x76a4('0x20')]=_0x5e6b39;if(_0x45719b[_0x76a4('0x35')][_0x76a4('0x44')]){_0x52c468[_0x76a4('0x45')]=[{'all':!![]}];}return db[_0x76a4('0x5c')][_0x76a4('0x46')](_0x52c468);})[_0x76a4('0x26')](function(_0x4d2e02){_0x4972ed[_0x76a4('0x47')]=_0x4d2e02;return _0x4972ed;});}})[_0x76a4('0x26')](respondWithFilteredResult(_0x3eacdb,_0x52c468))[_0x76a4('0x48')](handleError(_0x3eacdb,null));};exports['getHopperHistories']=function(_0x490f07,_0x2d39b8,_0xed0ab4){var _0x2ffd0b={'raw':!![],'where':{}};var _0x12ca48={};var _0x464855={'count':0x0,'rows':[]};return db[_0x76a4('0x31')]['findOne']({'where':{'id':_0x490f07[_0x76a4('0x4a')]['id']}})[_0x76a4('0x26')](handleEntityNotFound(_0x2d39b8,null))[_0x76a4('0x26')](function(_0x4bcca7){if(_0x4bcca7){_0x12ca48[_0x76a4('0x39')]=_['keys'](db[_0x76a4('0x5f')][_0x76a4('0x32')]);_0x12ca48[_0x76a4('0x35')]=_[_0x76a4('0x36')](_0x490f07['query']);_0x12ca48[_0x76a4('0x37')]=_[_0x76a4('0x38')](_0x12ca48['model'],_0x12ca48[_0x76a4('0x35')]);_0x2ffd0b['attributes']=_[_0x76a4('0x38')](_0x12ca48[_0x76a4('0x39')],qs[_0x76a4('0x3b')](_0x490f07[_0x76a4('0x35')][_0x76a4('0x3b')]));_0x2ffd0b['attributes']=_0x2ffd0b['attributes'][_0x76a4('0x3c')]?_0x2ffd0b[_0x76a4('0x3a')]:_0x12ca48[_0x76a4('0x39')];if(!_0x490f07[_0x76a4('0x35')][_0x76a4('0x3d')](_0x76a4('0x5d'))){_0x2ffd0b['limit']=qs[_0x76a4('0x1f')](_0x490f07[_0x76a4('0x35')][_0x76a4('0x1f')]);_0x2ffd0b[_0x76a4('0x1d')]=qs[_0x76a4('0x1d')](_0x490f07[_0x76a4('0x35')][_0x76a4('0x1d')]);}_0x2ffd0b[_0x76a4('0x3e')]=qs[_0x76a4('0x3f')](_0x490f07[_0x76a4('0x35')]['sort']);_0x2ffd0b[_0x76a4('0x40')]=qs[_0x76a4('0x37')](_['pick'](_0x490f07[_0x76a4('0x35')],_0x12ca48['filters']));_0x2ffd0b['where'][_0x76a4('0x5e')]=_0x4bcca7['id'];if(_0x490f07['query'][_0x76a4('0x42')]){_0x2ffd0b[_0x76a4('0x40')]=_['merge'](_0x2ffd0b['where'],{'$or':_[_0x76a4('0x30')](_0x2ffd0b[_0x76a4('0x3a')],function(_0x5b5db8){var _0x4160d1={};_0x4160d1[_0x5b5db8]={'$like':'%'+_0x490f07[_0x76a4('0x35')][_0x76a4('0x42')]+'%'};return _0x4160d1;})});}_0x2ffd0b=_[_0x76a4('0x4b')]({},_0x2ffd0b,_0x490f07[_0x76a4('0x43')]);return db['CmHopperHistory'][_0x76a4('0x20')]({'where':_0x2ffd0b[_0x76a4('0x40')]})[_0x76a4('0x26')](function(_0x2e8399){_0x464855['count']=_0x2e8399;if(_0x490f07['query']['includeAll']){_0x2ffd0b[_0x76a4('0x45')]=[{'all':!![]}];}return db[_0x76a4('0x5f')][_0x76a4('0x46')](_0x2ffd0b);})[_0x76a4('0x26')](function(_0x66b40){_0x464855[_0x76a4('0x47')]=_0x66b40;return _0x464855;});}})[_0x76a4('0x26')](respondWithFilteredResult(_0x2d39b8,_0x2ffd0b))[_0x76a4('0x48')](handleError(_0x2d39b8,null));};exports[_0x76a4('0x60')]=function(_0x280e10,_0x5c27e0,_0xa49a50){var _0x44c0f3={'raw':!![],'where':{}};var _0xe9fd35={};var _0x231c5a={'count':0x0,'rows':[]};return db['Campaign'][_0x76a4('0x5b')]({'where':{'id':_0x280e10[_0x76a4('0x4a')]['id']}})[_0x76a4('0x26')](handleEntityNotFound(_0x5c27e0,null))[_0x76a4('0x26')](function(_0x5b5268){if(_0x5b5268){_0xe9fd35[_0x76a4('0x39')]=_['keys'](db[_0x76a4('0x61')][_0x76a4('0x32')]);_0xe9fd35[_0x76a4('0x35')]=_[_0x76a4('0x36')](_0x280e10[_0x76a4('0x35')]);_0xe9fd35['filters']=_[_0x76a4('0x38')](_0xe9fd35[_0x76a4('0x39')],_0xe9fd35[_0x76a4('0x35')]);_0x44c0f3[_0x76a4('0x3a')]=_['intersection'](_0xe9fd35['model'],qs['fields'](_0x280e10['query'][_0x76a4('0x3b')]));_0x44c0f3[_0x76a4('0x3a')]=_0x44c0f3[_0x76a4('0x3a')][_0x76a4('0x3c')]?_0x44c0f3[_0x76a4('0x3a')]:_0xe9fd35[_0x76a4('0x39')];if(!_0x280e10[_0x76a4('0x35')][_0x76a4('0x3d')]('nolimit')){_0x44c0f3[_0x76a4('0x1f')]=qs[_0x76a4('0x1f')](_0x280e10['query'][_0x76a4('0x1f')]);_0x44c0f3[_0x76a4('0x1d')]=qs[_0x76a4('0x1d')](_0x280e10['query'][_0x76a4('0x1d')]);}_0x44c0f3['order']=qs[_0x76a4('0x3f')](_0x280e10[_0x76a4('0x35')][_0x76a4('0x3f')]);_0x44c0f3[_0x76a4('0x40')]=qs[_0x76a4('0x37')](_[_0x76a4('0x41')](_0x280e10[_0x76a4('0x35')],_0xe9fd35[_0x76a4('0x37')]));_0x44c0f3[_0x76a4('0x40')][_0x76a4('0x5e')]=_0x5b5268['id'];if(_0x280e10[_0x76a4('0x35')][_0x76a4('0x42')]){_0x44c0f3['where']=_['merge'](_0x44c0f3[_0x76a4('0x40')],{'$or':_[_0x76a4('0x30')](_0x44c0f3['attributes'],function(_0x459c23){var _0xb00b69={};_0xb00b69[_0x459c23]={'$like':'%'+_0x280e10['query'][_0x76a4('0x42')]+'%'};return _0xb00b69;})});}_0x44c0f3=_[_0x76a4('0x4b')]({},_0x44c0f3,_0x280e10[_0x76a4('0x43')]);return db[_0x76a4('0x61')]['count']({'where':_0x44c0f3[_0x76a4('0x40')]})[_0x76a4('0x26')](function(_0x78152b){_0x231c5a[_0x76a4('0x20')]=_0x78152b;if(_0x280e10['query'][_0x76a4('0x44')]){_0x44c0f3[_0x76a4('0x45')]=[{'all':!![]}];}return db[_0x76a4('0x61')][_0x76a4('0x46')](_0x44c0f3);})[_0x76a4('0x26')](function(_0x2828aa){_0x231c5a['rows']=_0x2828aa;return _0x231c5a;});}})['then'](respondWithFilteredResult(_0x5c27e0,_0x44c0f3))[_0x76a4('0x48')](handleError(_0x5c27e0,null));};exports[_0x76a4('0x62')]=function(_0x7e94bf,_0x1c4dd5,_0x52482c){var _0x448fec={'raw':!![],'where':{}};var _0x519bf6={};var _0x22fd87={'count':0x0,'rows':[]};return db[_0x76a4('0x31')][_0x76a4('0x5b')]({'where':{'id':_0x7e94bf[_0x76a4('0x4a')]['id']}})[_0x76a4('0x26')](handleEntityNotFound(_0x1c4dd5,null))[_0x76a4('0x26')](function(_0x574e4e){if(_0x574e4e){_0x519bf6[_0x76a4('0x39')]=_['keys'](db['CmHopperBlack'][_0x76a4('0x32')]);_0x519bf6[_0x76a4('0x35')]=_['keys'](_0x7e94bf[_0x76a4('0x35')]);_0x519bf6[_0x76a4('0x37')]=_['intersection'](_0x519bf6[_0x76a4('0x39')],_0x519bf6[_0x76a4('0x35')]);_0x448fec[_0x76a4('0x3a')]=_['intersection'](_0x519bf6[_0x76a4('0x39')],qs[_0x76a4('0x3b')](_0x7e94bf[_0x76a4('0x35')][_0x76a4('0x3b')]));_0x448fec[_0x76a4('0x3a')]=_0x448fec['attributes'][_0x76a4('0x3c')]?_0x448fec['attributes']:_0x519bf6[_0x76a4('0x39')];if(!_0x7e94bf[_0x76a4('0x35')][_0x76a4('0x3d')](_0x76a4('0x5d'))){_0x448fec[_0x76a4('0x1f')]=qs['limit'](_0x7e94bf[_0x76a4('0x35')][_0x76a4('0x1f')]);_0x448fec[_0x76a4('0x1d')]=qs[_0x76a4('0x1d')](_0x7e94bf[_0x76a4('0x35')][_0x76a4('0x1d')]);}_0x448fec['order']=qs[_0x76a4('0x3f')](_0x7e94bf[_0x76a4('0x35')][_0x76a4('0x3f')]);_0x448fec[_0x76a4('0x40')]=qs['filters'](_[_0x76a4('0x41')](_0x7e94bf[_0x76a4('0x35')],_0x519bf6['filters']));_0x448fec[_0x76a4('0x40')][_0x76a4('0x5e')]=_0x574e4e['id'];if(_0x7e94bf[_0x76a4('0x35')][_0x76a4('0x42')]){_0x448fec[_0x76a4('0x40')]=_[_0x76a4('0x4b')](_0x448fec[_0x76a4('0x40')],{'$or':_['map'](_0x448fec['attributes'],function(_0x18f4f7){var _0x5e3e70={};_0x5e3e70[_0x18f4f7]={'$like':'%'+_0x7e94bf[_0x76a4('0x35')]['filter']+'%'};return _0x5e3e70;})});}_0x448fec=_[_0x76a4('0x4b')]({},_0x448fec,_0x7e94bf[_0x76a4('0x43')]);return db[_0x76a4('0x63')][_0x76a4('0x20')]({'where':_0x448fec[_0x76a4('0x40')]})['then'](function(_0x55e39c){_0x22fd87['count']=_0x55e39c;if(_0x7e94bf[_0x76a4('0x35')][_0x76a4('0x44')]){_0x448fec[_0x76a4('0x45')]=[{'all':!![]}];}return db[_0x76a4('0x63')][_0x76a4('0x46')](_0x448fec);})[_0x76a4('0x26')](function(_0x1923a8){_0x22fd87['rows']=_0x1923a8;return _0x22fd87;});}})[_0x76a4('0x26')](respondWithFilteredResult(_0x1c4dd5,_0x448fec))[_0x76a4('0x48')](handleError(_0x1c4dd5,null));};exports['getLists']=function(_0x4f0aa2,_0x11bcba,_0x1b0c2e){var _0x1ca3a0={};var _0x24fcd1={};var _0xb26574;var _0xfe873;return db['Campaign']['findOne']({'where':{'id':_0x4f0aa2['params']['id']}})[_0x76a4('0x26')](handleEntityNotFound(_0x11bcba,null))[_0x76a4('0x26')](function(_0x2cbfbd){if(_0x2cbfbd){_0xb26574=_0x2cbfbd;_0x24fcd1[_0x76a4('0x39')]=_[_0x76a4('0x36')](db[_0x76a4('0x64')]['rawAttributes']);_0x24fcd1[_0x76a4('0x35')]=_[_0x76a4('0x36')](_0x4f0aa2['query']);_0x24fcd1[_0x76a4('0x37')]=_[_0x76a4('0x38')](_0x24fcd1['model'],_0x24fcd1[_0x76a4('0x35')]);_0x1ca3a0[_0x76a4('0x3a')]=_['intersection'](_0x24fcd1[_0x76a4('0x39')],qs[_0x76a4('0x3b')](_0x4f0aa2['query'][_0x76a4('0x3b')]));_0x1ca3a0['attributes']=_0x1ca3a0[_0x76a4('0x3a')][_0x76a4('0x3c')]?_0x1ca3a0[_0x76a4('0x3a')]:_0x24fcd1[_0x76a4('0x39')];_0x1ca3a0[_0x76a4('0x3e')]=qs[_0x76a4('0x3f')](_0x4f0aa2[_0x76a4('0x35')][_0x76a4('0x3f')]);_0x1ca3a0[_0x76a4('0x40')]=qs['filters'](_[_0x76a4('0x41')](_0x4f0aa2[_0x76a4('0x35')],_0x24fcd1[_0x76a4('0x37')]));if(_0x4f0aa2[_0x76a4('0x35')][_0x76a4('0x42')]){_0x1ca3a0[_0x76a4('0x40')]=_[_0x76a4('0x4b')](_0x1ca3a0[_0x76a4('0x40')],{'$or':_[_0x76a4('0x30')](_0x1ca3a0['attributes'],function(_0x2b0cad){var _0xb9c2ce={};_0xb9c2ce[_0x2b0cad]={'$like':'%'+_0x4f0aa2[_0x76a4('0x35')]['filter']+'%'};return _0xb9c2ce;})});}_0x1ca3a0=_['merge']({},_0x1ca3a0,_0x4f0aa2['options']);return _0xb26574[_0x76a4('0x65')](_0x1ca3a0);}})['then'](function(_0x10dd3f){if(_0x10dd3f){_0xfe873=_0x10dd3f[_0x76a4('0x3c')];if(!_0x4f0aa2[_0x76a4('0x35')][_0x76a4('0x3d')](_0x76a4('0x5d'))){_0x1ca3a0[_0x76a4('0x1f')]=qs[_0x76a4('0x1f')](_0x4f0aa2[_0x76a4('0x35')][_0x76a4('0x1f')]);_0x1ca3a0[_0x76a4('0x1d')]=qs['offset'](_0x4f0aa2[_0x76a4('0x35')][_0x76a4('0x1d')]);}return _0xb26574['getLists'](_0x1ca3a0);}})[_0x76a4('0x26')](function(_0xeb9dd5){if(_0xeb9dd5){return _0xeb9dd5?{'count':_0xfe873,'rows':_0xeb9dd5}:null;}})['then'](respondWithResult(_0x11bcba,null))[_0x76a4('0x48')](handleError(_0x11bcba,null));};exports['addLists']=function(_0xc1abde,_0x5184de,_0x2e8095){var _0x3e0d0b,_0x18bf06;var _0x529699=[];var _0x294ebe=moment()[_0x76a4('0x66')](_0x76a4('0x67'));return db[_0x76a4('0x31')]['find']({'where':{'id':_0xc1abde['params']['id']}})[_0x76a4('0x26')](handleEntityNotFound(_0x5184de,null))[_0x76a4('0x26')](function(_0x24278c){if(_0x24278c){_0x18bf06=_0x24278c;return _0x24278c[_0x76a4('0x68')](_0xc1abde[_0x76a4('0x4e')][_0x76a4('0x69')],_['omit'](_0xc1abde[_0x76a4('0x4e')],[_0x76a4('0x69'),'id'])||{});}return null;})[_0x76a4('0x6a')](function(_0xa161a4){var _0x351c9f;var _0xb948a9;_0x3e0d0b=_0xa161a4||[];var _0x5e58da=[];if(_0xa161a4){for(var _0x23a24e=0x0;_0x23a24e<_0xa161a4[_0x76a4('0x3c')];_0x23a24e+=0x1){var _0x39b005=_0xa161a4[_0x23a24e][_0x76a4('0x27')]({'plain':!![]});_0x18bf06[_0x76a4('0x6b')]=_0xc1abde[_0x76a4('0x4e')][_0x76a4('0x6b')]?_0xc1abde['body'][_0x76a4('0x6b')]:_0x18bf06[_0x76a4('0x6b')];switch(_0x18bf06[_0x76a4('0x6b')]){case _0x76a4('0x6c'):_0x351c9f=squel[_0x76a4('0x6d')]()[_0x76a4('0x6e')]('cm_hopper')['fromQuery']([_0x76a4('0x6f'),_0x76a4('0x70'),_0x76a4('0x71'),'ListId',_0x76a4('0x5e'),_0x76a4('0x58'),'updatedAt'],squel[_0x76a4('0x72')]()[_0x76a4('0x73')](_0x76a4('0x6f'),'phone')[_0x76a4('0x73')](_0x76a4('0x74'),_0x76a4('0x70'))[_0x76a4('0x73')]('id',_0x76a4('0x71'))[_0x76a4('0x73')](_0x39b005['CmListId']['toString'](),'ListId')[_0x76a4('0x73')](_0xc1abde['params']['id'][_0x76a4('0x75')](),_0x76a4('0x5e'))[_0x76a4('0x73')]('\x27'+_0x294ebe+'\x27',_0x76a4('0x58'))[_0x76a4('0x73')]('\x27'+_0x294ebe+'\x27',_0x76a4('0x59'))[_0x76a4('0x76')](_0x76a4('0x77'))[_0x76a4('0x40')](_0x76a4('0x78'))[_0x76a4('0x40')](_0x76a4('0x79'),_0x39b005[_0x76a4('0x7a')]['toString']())[_0x76a4('0x40')]('phone\x20IS\x20NOT\x20NULL')[_0x76a4('0x40')](_0x76a4('0x7b'),squel[_0x76a4('0x72')]()[_0x76a4('0x73')]('COALESCE(calleridnum,\x27\x27)')[_0x76a4('0x76')]('cm_hopper_final')[_0x76a4('0x40')]('CampaignId\x20=\x20?',_0xc1abde[_0x76a4('0x4a')]['id'][_0x76a4('0x75')]()))['where'](_0x76a4('0x7b'),squel[_0x76a4('0x72')]()[_0x76a4('0x73')](_0x76a4('0x7c'))[_0x76a4('0x76')]('cm_hopper')['where'](_0x76a4('0x7d'),_0xc1abde[_0x76a4('0x4a')]['id']['toString']())))[_0x76a4('0x75')]();break;case _0x76a4('0x7e'):_0x351c9f=squel['insert']()[_0x76a4('0x6e')](_0x76a4('0x7f'))[_0x76a4('0x80')](['phone',_0x76a4('0x70'),_0x76a4('0x71'),_0x76a4('0x81'),_0x76a4('0x5e'),_0x76a4('0x58'),'updatedAt'],squel[_0x76a4('0x72')]()[_0x76a4('0x73')](_0x76a4('0x6f'),_0x76a4('0x6f'))[_0x76a4('0x73')](_0x76a4('0x74'),'scheduledAt')['field']('id',_0x76a4('0x71'))[_0x76a4('0x73')](_0x39b005['CmListId'][_0x76a4('0x75')](),'ListId')[_0x76a4('0x73')](_0xc1abde['params']['id'][_0x76a4('0x75')](),_0x76a4('0x5e'))[_0x76a4('0x73')]('\x27'+_0x294ebe+'\x27',_0x76a4('0x58'))[_0x76a4('0x73')]('\x27'+_0x294ebe+'\x27','updatedAt')[_0x76a4('0x76')](_0x76a4('0x77'))['where'](_0x76a4('0x78'))[_0x76a4('0x40')]('ListId\x20=\x20?',_0x39b005['CmListId']['toString']())[_0x76a4('0x40')](_0x76a4('0x82'))[_0x76a4('0x40')](_0x76a4('0x7b'),squel[_0x76a4('0x72')]()[_0x76a4('0x73')](_0x76a4('0x7c'))[_0x76a4('0x76')](_0x76a4('0x7f'))[_0x76a4('0x40')]('CampaignId\x20=\x20?',_0xc1abde[_0x76a4('0x4a')]['id'][_0x76a4('0x75')]())))['toString']();break;default:_0x351c9f=squel[_0x76a4('0x6d')]()[_0x76a4('0x6e')](_0x76a4('0x7f'))[_0x76a4('0x80')]([_0x76a4('0x6f'),_0x76a4('0x70'),_0x76a4('0x71'),'ListId','CampaignId',_0x76a4('0x58'),'updatedAt'],squel['select']()['field'](_0x76a4('0x6f'),_0x76a4('0x6f'))[_0x76a4('0x73')]('NOW()',_0x76a4('0x70'))['field']('id','ContactId')[_0x76a4('0x73')](_0x39b005[_0x76a4('0x7a')][_0x76a4('0x75')](),_0x76a4('0x81'))[_0x76a4('0x73')](_0xc1abde[_0x76a4('0x4a')]['id'][_0x76a4('0x75')](),'CampaignId')[_0x76a4('0x73')]('\x27'+_0x294ebe+'\x27','createdAt')[_0x76a4('0x73')]('\x27'+_0x294ebe+'\x27','updatedAt')[_0x76a4('0x76')]('cm_contacts')[_0x76a4('0x40')](_0x76a4('0x78'))[_0x76a4('0x40')]('ListId\x20=\x20?',_0x39b005[_0x76a4('0x7a')]['toString']())[_0x76a4('0x40')](_0x76a4('0x82')))[_0x76a4('0x75')]();}_0xb948a9=squel[_0x76a4('0x6d')]()[_0x76a4('0x6e')](_0x76a4('0x83'))[_0x76a4('0x80')](['cmHopperId','scheduledAt',_0x76a4('0x6f'),_0x76a4('0x84'),_0x76a4('0x58'),_0x76a4('0x59')],squel['select']()['field'](_0x76a4('0x85'),'id')[_0x76a4('0x73')]('NOW()',_0x76a4('0x70'))[_0x76a4('0x73')](_0x76a4('0x86'),_0x76a4('0x6f'))[_0x76a4('0x73')]('ci.OrderBY','OrderBy')['field']('\x27'+_0x294ebe+'\x27','createdAt')[_0x76a4('0x73')]('\x27'+_0x294ebe+'\x27',_0x76a4('0x59'))['from'](_0x76a4('0x87'),'ci')[_0x76a4('0x88')](_0x76a4('0x7f'),'h','h.ContactId\x20=\x20ci.CmContactId')[_0x76a4('0x40')](_0x76a4('0x89'),_0x39b005[_0x76a4('0x7a')][_0x76a4('0x75')]())[_0x76a4('0x40')](_0x76a4('0x8a'),_0xc1abde[_0x76a4('0x4a')]['id'][_0x76a4('0x75')]())[_0x76a4('0x40')](_0x76a4('0x8b'),_0x294ebe))[_0x76a4('0x75')]();_0x5e58da[_0x76a4('0x8c')](db['sequelize'][_0x76a4('0x35')](_0x351c9f));_0x529699[_0x76a4('0x8c')](db[_0x76a4('0x8d')][_0x76a4('0x35')](_0xb948a9));}return BPromise[_0x76a4('0x8e')](_0x5e58da);}})[_0x76a4('0x26')](function(){return BPromise['all'](_0x529699);})[_0x76a4('0x26')](function(){return _0x3e0d0b;})[_0x76a4('0x26')](respondWithResult(_0x5184de,null))['catch'](handleError(_0x5184de,null));};exports[_0x76a4('0x8f')]=function(_0x450518,_0x139892,_0x2a01e4){return db['Campaign'][_0x76a4('0x4c')]({'where':{'id':_0x450518[_0x76a4('0x4a')]['id']}})['then'](handleEntityNotFound(_0x139892,null))[_0x76a4('0x26')](function(_0xf7c07a){if(_0xf7c07a){return _0xf7c07a[_0x76a4('0x8f')](_0x450518[_0x76a4('0x35')]['ids']);}})[_0x76a4('0x26')](function(_0x1aa7f0){if(_0x1aa7f0){return db['CmHopper'][_0x76a4('0x2a')]({'where':{'ListId':_0x450518[_0x76a4('0x35')][_0x76a4('0x69')],'CampaignId':_0x450518['params']['id']}})[_0x76a4('0x26')](function(){return _0x1aa7f0;});}})[_0x76a4('0x26')](respondWithStatusCode(_0x139892,null))[_0x76a4('0x48')](handleError(_0x139892,null));};exports['getBlackLists']=function(_0x3110f5,_0x2f2fe2,_0x745983){var _0x5c808d={};var _0x543219={};var _0x4db85d;var _0x100da3;return db[_0x76a4('0x31')]['findOne']({'where':{'id':_0x3110f5[_0x76a4('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2f2fe2,null))[_0x76a4('0x26')](function(_0x5f0167){if(_0x5f0167){_0x4db85d=_0x5f0167;_0x543219[_0x76a4('0x39')]=_[_0x76a4('0x36')](db[_0x76a4('0x64')]['rawAttributes']);_0x543219[_0x76a4('0x35')]=_[_0x76a4('0x36')](_0x3110f5[_0x76a4('0x35')]);_0x543219[_0x76a4('0x37')]=_[_0x76a4('0x38')](_0x543219[_0x76a4('0x39')],_0x543219[_0x76a4('0x35')]);_0x5c808d['attributes']=_[_0x76a4('0x38')](_0x543219[_0x76a4('0x39')],qs['fields'](_0x3110f5[_0x76a4('0x35')][_0x76a4('0x3b')]));_0x5c808d['attributes']=_0x5c808d[_0x76a4('0x3a')][_0x76a4('0x3c')]?_0x5c808d[_0x76a4('0x3a')]:_0x543219['model'];_0x5c808d[_0x76a4('0x3e')]=qs[_0x76a4('0x3f')](_0x3110f5[_0x76a4('0x35')]['sort']);_0x5c808d[_0x76a4('0x40')]=qs[_0x76a4('0x37')](_[_0x76a4('0x41')](_0x3110f5[_0x76a4('0x35')],_0x543219[_0x76a4('0x37')]));if(_0x3110f5[_0x76a4('0x35')][_0x76a4('0x42')]){_0x5c808d[_0x76a4('0x40')]=_[_0x76a4('0x4b')](_0x5c808d[_0x76a4('0x40')],{'$or':_['map'](_0x5c808d[_0x76a4('0x3a')],function(_0x522f64){var _0x417a7d={};_0x417a7d[_0x522f64]={'$like':'%'+_0x3110f5[_0x76a4('0x35')][_0x76a4('0x42')]+'%'};return _0x417a7d;})});}_0x5c808d=_[_0x76a4('0x4b')]({},_0x5c808d,_0x3110f5[_0x76a4('0x43')]);return _0x4db85d['getBlackLists'](_0x5c808d);}})[_0x76a4('0x26')](function(_0x2b116a){if(_0x2b116a){_0x100da3=_0x2b116a[_0x76a4('0x3c')];if(!_0x3110f5[_0x76a4('0x35')]['hasOwnProperty'](_0x76a4('0x5d'))){_0x5c808d[_0x76a4('0x1f')]=qs[_0x76a4('0x1f')](_0x3110f5['query']['limit']);_0x5c808d['offset']=qs[_0x76a4('0x1d')](_0x3110f5['query']['offset']);}return _0x4db85d[_0x76a4('0x90')](_0x5c808d);}})[_0x76a4('0x26')](function(_0x2094ed){if(_0x2094ed){return _0x2094ed?{'count':_0x100da3,'rows':_0x2094ed}:null;}})['then'](respondWithResult(_0x2f2fe2,null))[_0x76a4('0x48')](handleError(_0x2f2fe2,null));};exports[_0x76a4('0x91')]=function(_0x29c2ab,_0x2a204a,_0x18cdaa){var _0x3a7c01,_0xc07122;var _0x30c180=[];var _0x1834f3=moment()[_0x76a4('0x66')](_0x76a4('0x67'));return db[_0x76a4('0x31')][_0x76a4('0x4c')]({'where':{'id':_0x29c2ab[_0x76a4('0x4a')]['id']}})[_0x76a4('0x26')](handleEntityNotFound(_0x2a204a,null))[_0x76a4('0x26')](function(_0x51f367){if(_0x51f367){_0xc07122=_0x51f367;return _0x51f367[_0x76a4('0x91')](_0x29c2ab[_0x76a4('0x4e')][_0x76a4('0x69')],_[_0x76a4('0x57')](_0x29c2ab[_0x76a4('0x4e')],[_0x76a4('0x69'),'id'])||{});}return null;})[_0x76a4('0x6a')](function(_0x528ae2){var _0xcd1023;var _0x123d0a;_0x3a7c01=_0x528ae2||[];var _0x46433e=[];if(_0x528ae2){for(var _0x5a2b88=0x0;_0x5a2b88<_0x528ae2['length'];_0x5a2b88+=0x1){var _0x347f68=_0x528ae2[_0x5a2b88]['get']({'plain':!![]});_0xcd1023=squel[_0x76a4('0x6d')]()[_0x76a4('0x6e')](_0x76a4('0x92'))['fromQuery']([_0x76a4('0x6f'),_0x76a4('0x71'),'ListId',_0x76a4('0x5e'),_0x76a4('0x58'),'updatedAt'],squel[_0x76a4('0x72')]()['field'](_0x76a4('0x6f'),_0x76a4('0x6f'))[_0x76a4('0x73')]('id',_0x76a4('0x71'))[_0x76a4('0x73')](_0x347f68['CmListId'][_0x76a4('0x75')](),_0x76a4('0x81'))[_0x76a4('0x73')](_0x29c2ab[_0x76a4('0x4a')]['id'][_0x76a4('0x75')](),_0x76a4('0x5e'))[_0x76a4('0x73')](_0x76a4('0x74'),_0x76a4('0x58'))[_0x76a4('0x73')]('NOW()',_0x76a4('0x59'))['from'](_0x76a4('0x77'))[_0x76a4('0x40')](_0x76a4('0x78'))['where'](_0x76a4('0x79'),_0x347f68[_0x76a4('0x7a')][_0x76a4('0x75')]())[_0x76a4('0x40')](_0x76a4('0x82')))[_0x76a4('0x75')]();_0x46433e[_0x76a4('0x8c')](db[_0x76a4('0x8d')]['query'](_0xcd1023));}return BPromise[_0x76a4('0x8e')](_0x46433e);}})[_0x76a4('0x26')](function(){return _0x3a7c01;})[_0x76a4('0x26')](respondWithResult(_0x2a204a,null))[_0x76a4('0x48')](handleError(_0x2a204a,null));};exports[_0x76a4('0x93')]=function(_0x5114a0,_0x2d8f1a,_0xdf273b){return db[_0x76a4('0x31')][_0x76a4('0x4c')]({'where':{'id':_0x5114a0['params']['id']}})['then'](handleEntityNotFound(_0x2d8f1a,null))[_0x76a4('0x26')](function(_0xa23a02){if(_0xa23a02){return _0xa23a02[_0x76a4('0x93')](_0x5114a0[_0x76a4('0x35')][_0x76a4('0x69')]);}})[_0x76a4('0x26')](function(_0x27502d){if(_0x27502d){return db[_0x76a4('0x63')]['destroy']({'where':{'ListId':_0x5114a0[_0x76a4('0x35')][_0x76a4('0x69')],'CampaignId':_0x5114a0['params']['id']}})['then'](function(){return _0x27502d;});}})[_0x76a4('0x26')](respondWithStatusCode(_0x2d8f1a,null))[_0x76a4('0x48')](handleError(_0x2d8f1a,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 2dcc9bf..fa1bcf4 100644 --- a/server/api/campaign/campaign.model.js +++ b/server/api/campaign/campaign.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x486f4a,_0x478dc7){var _0x135d99=function(_0x434008){while(--_0x434008){_0x486f4a['push'](_0x486f4a['shift']());}};_0x135d99(++_0x478dc7);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x5a3cf0,_0x160a68){var _0x5a64ee=function(_0x34cd1d){while(--_0x34cd1d){_0x5a3cf0['push'](_0x5a3cf0['shift']());}};_0x5a64ee(++_0x160a68);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index af92e13..8d14d3f 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 _0x2e31=['error','code','message','GetCampaign','Campaign','raw','options','where','attributes','limit','include','map','model','then','debug','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','request','info','Campaign,\x20%s,\x20%s','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0xb962a,_0x13e5ff){var _0x3a1eb5=function(_0x58f2c9){while(--_0x58f2c9){_0xb962a['push'](_0xb962a['shift']());}};_0x3a1eb5(++_0x13e5ff);}(_0x2e31,0x145));var _0x12e3=function(_0x4525ae,_0x5cf017){_0x4525ae=_0x4525ae-0x0;var _0x6e405e=_0x2e31[_0x4525ae];return _0x6e405e;};'use strict';var _=require(_0x12e3('0x0'));var util=require(_0x12e3('0x1'));var moment=require(_0x12e3('0x2'));var BPromise=require('bluebird');var rs=require(_0x12e3('0x3'));var fs=require('fs');var Redis=require(_0x12e3('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x12e3('0x5'))(_0x12e3('0x6'));var config=require(_0x12e3('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x12e3('0x8')][_0x12e3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5aefcf,_0x5f056f,_0x37f287){return new BPromise(function(_0x403cc5,_0x31e2cf){return client[_0x12e3('0xa')](_0x5aefcf,_0x37f287)['then'](function(_0x438c7e){logger[_0x12e3('0xb')](_0x12e3('0xc'),_0x5f056f,'request\x20sent');logger['debug'](_0x12e3('0xd'),_0x5f056f,_0x12e3('0xe'),JSON[_0x12e3('0xf')](_0x438c7e));if(_0x438c7e[_0x12e3('0x10')]){if(_0x438c7e[_0x12e3('0x10')][_0x12e3('0x11')]===0x1f4){logger[_0x12e3('0x10')](_0x12e3('0xc'),_0x5f056f,_0x438c7e[_0x12e3('0x10')][_0x12e3('0x12')]);return _0x31e2cf(_0x438c7e[_0x12e3('0x10')][_0x12e3('0x12')]);}logger['error'](_0x12e3('0xc'),_0x5f056f,_0x438c7e[_0x12e3('0x10')][_0x12e3('0x12')]);return _0x403cc5(_0x438c7e['error'][_0x12e3('0x12')]);}else{logger[_0x12e3('0xb')]('Campaign,\x20%s,\x20%s',_0x5f056f,'request\x20sent');_0x403cc5(_0x438c7e['result'][_0x12e3('0x12')]);}})['catch'](function(_0x2f26b1){logger[_0x12e3('0x10')](_0x12e3('0xc'),_0x5f056f,_0x2f26b1);_0x31e2cf(_0x2f26b1);});});}exports[_0x12e3('0x13')]=function(_0x211c6a){var _0x2041e9=this;return new Promise(function(_0x5a63c8,_0x77ad03){return db[_0x12e3('0x14')]['findAll']({'raw':_0x211c6a['options']?_0x211c6a['options'][_0x12e3('0x15')]===undefined?!![]:![]:!![],'where':_0x211c6a['options']?_0x211c6a[_0x12e3('0x16')][_0x12e3('0x17')]||null:null,'attributes':_0x211c6a['options']?_0x211c6a['options'][_0x12e3('0x18')]||null:null,'limit':_0x211c6a[_0x12e3('0x16')]?_0x211c6a[_0x12e3('0x16')][_0x12e3('0x19')]||null:null,'include':_0x211c6a['options']?_0x211c6a['options'][_0x12e3('0x1a')]?_[_0x12e3('0x1b')](_0x211c6a[_0x12e3('0x16')][_0x12e3('0x1a')],function(_0x2cf78a){return{'model':db[_0x2cf78a['model']],'as':_0x2cf78a['as'],'attributes':_0x2cf78a[_0x12e3('0x18')],'include':_0x2cf78a[_0x12e3('0x1a')]?_[_0x12e3('0x1b')](_0x2cf78a[_0x12e3('0x1a')],function(_0x43a59f){return{'model':db[_0x43a59f[_0x12e3('0x1c')]],'as':_0x43a59f['as'],'attributes':_0x43a59f['attributes'],'include':_0x43a59f[_0x12e3('0x1a')]?_[_0x12e3('0x1b')](_0x43a59f[_0x12e3('0x1a')],function(_0x42765f){return{'model':db[_0x42765f['model']],'as':_0x42765f['as'],'attributes':_0x42765f[_0x12e3('0x18')]};}):[]};}):[]};}):[]:[]})[_0x12e3('0x1d')](function(_0x2293ec){logger['info'](_0x12e3('0x13'),_0x211c6a);logger[_0x12e3('0x1e')](_0x12e3('0x13'),_0x211c6a,JSON[_0x12e3('0xf')](_0x2293ec));_0x5a63c8(_0x2293ec);})['catch'](function(_0x342ad2){logger[_0x12e3('0x10')](_0x12e3('0x13'),_0x342ad2['message'],_0x211c6a);_0x77ad03(_0x2041e9[_0x12e3('0x10')](0x1f4,_0x342ad2['message']));});});}; \ No newline at end of file +var _0x61a1=['error','message','result','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','map','include','model','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x298152,_0x2bab07){var _0x58117d=function(_0x12ff68){while(--_0x12ff68){_0x298152['push'](_0x298152['shift']());}};_0x58117d(++_0x2bab07);}(_0x61a1,0x127));var _0x161a=function(_0x175a55,_0x4082fd){_0x175a55=_0x175a55-0x0;var _0x167adf=_0x61a1[_0x175a55];return _0x167adf;};'use strict';var _=require(_0x161a('0x0'));var util=require(_0x161a('0x1'));var moment=require(_0x161a('0x2'));var BPromise=require(_0x161a('0x3'));var rs=require(_0x161a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x161a('0x5'))['db'];var utils=require(_0x161a('0x6'));var logger=require('../../config/logger')(_0x161a('0x7'));var config=require(_0x161a('0x8'));var jayson=require(_0x161a('0x9'));var client=jayson[_0x161a('0xa')][_0x161a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x45b1e8,_0x3b7d68,_0x182e6c){return new BPromise(function(_0x3e07e5,_0x15cde9){return client[_0x161a('0xc')](_0x45b1e8,_0x182e6c)[_0x161a('0xd')](function(_0x405108){logger[_0x161a('0xe')](_0x161a('0xf'),_0x3b7d68,_0x161a('0x10'));logger[_0x161a('0x11')](_0x161a('0x12'),_0x3b7d68,_0x161a('0x10'),JSON[_0x161a('0x13')](_0x405108));if(_0x405108['error']){if(_0x405108['error']['code']===0x1f4){logger['error']('Campaign,\x20%s,\x20%s',_0x3b7d68,_0x405108[_0x161a('0x14')][_0x161a('0x15')]);return _0x15cde9(_0x405108[_0x161a('0x14')][_0x161a('0x15')]);}logger[_0x161a('0x14')](_0x161a('0xf'),_0x3b7d68,_0x405108[_0x161a('0x14')]['message']);return _0x3e07e5(_0x405108['error']['message']);}else{logger[_0x161a('0xe')](_0x161a('0xf'),_0x3b7d68,'request\x20sent');_0x3e07e5(_0x405108[_0x161a('0x16')][_0x161a('0x15')]);}})['catch'](function(_0x31dcc6){logger[_0x161a('0x14')](_0x161a('0xf'),_0x3b7d68,_0x31dcc6);_0x15cde9(_0x31dcc6);});});}exports[_0x161a('0x17')]=function(_0x28c9bf){var _0x12075e=this;return new Promise(function(_0x25a286,_0x1491fa){return db[_0x161a('0x18')][_0x161a('0x19')]({'raw':_0x28c9bf[_0x161a('0x1a')]?_0x28c9bf[_0x161a('0x1a')][_0x161a('0x1b')]===undefined?!![]:![]:!![],'where':_0x28c9bf['options']?_0x28c9bf[_0x161a('0x1a')][_0x161a('0x1c')]||null:null,'attributes':_0x28c9bf[_0x161a('0x1a')]?_0x28c9bf[_0x161a('0x1a')][_0x161a('0x1d')]||null:null,'limit':_0x28c9bf[_0x161a('0x1a')]?_0x28c9bf[_0x161a('0x1a')][_0x161a('0x1e')]||null:null,'include':_0x28c9bf[_0x161a('0x1a')]?_0x28c9bf[_0x161a('0x1a')]['include']?_[_0x161a('0x1f')](_0x28c9bf['options'][_0x161a('0x20')],function(_0x2e7a46){return{'model':db[_0x2e7a46['model']],'as':_0x2e7a46['as'],'attributes':_0x2e7a46[_0x161a('0x1d')],'include':_0x2e7a46[_0x161a('0x20')]?_[_0x161a('0x1f')](_0x2e7a46[_0x161a('0x20')],function(_0x1541c6){return{'model':db[_0x1541c6[_0x161a('0x21')]],'as':_0x1541c6['as'],'attributes':_0x1541c6[_0x161a('0x1d')],'include':_0x1541c6[_0x161a('0x20')]?_['map'](_0x1541c6[_0x161a('0x20')],function(_0x1b10b0){return{'model':db[_0x1b10b0['model']],'as':_0x1b10b0['as'],'attributes':_0x1b10b0['attributes']};}):[]};}):[]};}):[]:[]})[_0x161a('0xd')](function(_0x3b5779){logger['info'](_0x161a('0x17'),_0x28c9bf);logger['debug']('GetCampaign',_0x28c9bf,JSON[_0x161a('0x13')](_0x3b5779));_0x25a286(_0x3b5779);})[_0x161a('0x22')](function(_0x2c5039){logger[_0x161a('0x14')](_0x161a('0x17'),_0x2c5039[_0x161a('0x15')],_0x28c9bf);_0x1491fa(_0x12075e[_0x161a('0x14')](0x1f4,_0x2c5039['message']));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 379476a..f374a08 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 _0x63db=['../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','isAuthenticated','index','get','/:id','show','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','getBlackLists','post','create','/:id/clone','clone','addLists','/:id/blacklists','addBlackLists','put','update','delete','destroy','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x1fc122,_0x5e2c17){var _0xa2cb13=function(_0x263b13){while(--_0x263b13){_0x1fc122['push'](_0x1fc122['shift']());}};_0xa2cb13(++_0x5e2c17);}(_0x63db,0x191));var _0xb63d=function(_0x2fa1be,_0x5e646f){_0x2fa1be=_0x2fa1be-0x0;var _0x1e016c=_0x63db[_0x2fa1be];return _0x1e016c;};'use strict';var multer=require(_0xb63d('0x0'));var util=require(_0xb63d('0x1'));var path=require(_0xb63d('0x2'));var timeout=require(_0xb63d('0x3'));var express=require(_0xb63d('0x4'));var router=express[_0xb63d('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb63d('0x6'));var interaction=require(_0xb63d('0x7'));var config=require(_0xb63d('0x8'));var controller=require(_0xb63d('0x9'));router['get']('/',auth[_0xb63d('0xa')](),controller[_0xb63d('0xb')]);router[_0xb63d('0xc')](_0xb63d('0xd'),auth[_0xb63d('0xa')](),controller[_0xb63d('0xe')]);router[_0xb63d('0xc')]('/:id/hoppers',auth[_0xb63d('0xa')](),controller['getHoppers']);router['get']('/:id/hopper_histories',auth['isAuthenticated'](),controller[_0xb63d('0xf')]);router[_0xb63d('0xc')](_0xb63d('0x10'),auth['isAuthenticated'](),controller[_0xb63d('0x11')]);router[_0xb63d('0xc')](_0xb63d('0x12'),auth[_0xb63d('0xa')](),controller[_0xb63d('0x13')]);router[_0xb63d('0xc')](_0xb63d('0x14'),auth['isAuthenticated'](),controller[_0xb63d('0x15')]);router[_0xb63d('0xc')]('/:id/blacklists',auth[_0xb63d('0xa')](),controller[_0xb63d('0x16')]);router[_0xb63d('0x17')]('/',auth['isAuthenticated'](),controller[_0xb63d('0x18')]);router[_0xb63d('0x17')](_0xb63d('0x19'),auth[_0xb63d('0xa')](),controller[_0xb63d('0x1a')]);router['post'](_0xb63d('0x14'),auth[_0xb63d('0xa')](),controller[_0xb63d('0x1b')]);router[_0xb63d('0x17')](_0xb63d('0x1c'),auth['isAuthenticated'](),controller[_0xb63d('0x1d')]);router[_0xb63d('0x1e')](_0xb63d('0xd'),auth['isAuthenticated'](),controller[_0xb63d('0x1f')]);router[_0xb63d('0x20')](_0xb63d('0xd'),auth[_0xb63d('0xa')](),controller[_0xb63d('0x21')]);router[_0xb63d('0x20')](_0xb63d('0x14'),auth['isAuthenticated'](),controller[_0xb63d('0x22')]);router[_0xb63d('0x20')](_0xb63d('0x1c'),auth[_0xb63d('0xa')](),controller[_0xb63d('0x23')]);module[_0xb63d('0x24')]=router; \ No newline at end of file +var _0xb0bf=['destroy','removeBlackLists','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','getBlackLists','post','/:id/clone','clone','/:id/lists','addLists','/:id/blacklists','addBlackLists','put','update','delete'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0xb0bf,0x69));var _0xfb0b=function(_0x66f4c4,_0x1b9d68){_0x66f4c4=_0x66f4c4-0x0;var _0xdce1cc=_0xb0bf[_0x66f4c4];return _0xdce1cc;};'use strict';var multer=require(_0xfb0b('0x0'));var util=require('util');var path=require(_0xfb0b('0x1'));var timeout=require(_0xfb0b('0x2'));var express=require(_0xfb0b('0x3'));var router=express[_0xfb0b('0x4')]();var fs_extra=require(_0xfb0b('0x5'));var auth=require(_0xfb0b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xfb0b('0x7'));var controller=require('./campaign.controller');router[_0xfb0b('0x8')]('/',auth[_0xfb0b('0x9')](),controller[_0xfb0b('0xa')]);router[_0xfb0b('0x8')](_0xfb0b('0xb'),auth[_0xfb0b('0x9')](),controller[_0xfb0b('0xc')]);router[_0xfb0b('0x8')](_0xfb0b('0xd'),auth['isAuthenticated'](),controller['getHoppers']);router['get'](_0xfb0b('0xe'),auth[_0xfb0b('0x9')](),controller[_0xfb0b('0xf')]);router[_0xfb0b('0x8')](_0xfb0b('0x10'),auth['isAuthenticated'](),controller[_0xfb0b('0x11')]);router[_0xfb0b('0x8')](_0xfb0b('0x12'),auth[_0xfb0b('0x9')](),controller[_0xfb0b('0x13')]);router[_0xfb0b('0x8')]('/:id/lists',auth[_0xfb0b('0x9')](),controller['getLists']);router[_0xfb0b('0x8')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0xfb0b('0x14')]);router[_0xfb0b('0x15')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xfb0b('0x16'),auth[_0xfb0b('0x9')](),controller[_0xfb0b('0x17')]);router[_0xfb0b('0x15')](_0xfb0b('0x18'),auth[_0xfb0b('0x9')](),controller[_0xfb0b('0x19')]);router[_0xfb0b('0x15')](_0xfb0b('0x1a'),auth[_0xfb0b('0x9')](),controller[_0xfb0b('0x1b')]);router[_0xfb0b('0x1c')](_0xfb0b('0xb'),auth[_0xfb0b('0x9')](),controller[_0xfb0b('0x1d')]);router[_0xfb0b('0x1e')](_0xfb0b('0xb'),auth['isAuthenticated'](),controller[_0xfb0b('0x1f')]);router[_0xfb0b('0x1e')](_0xfb0b('0x18'),auth['isAuthenticated'](),controller['removeLists']);router['delete']('/:id/blacklists',auth['isAuthenticated'](),controller[_0xfb0b('0x20')]);module[_0xfb0b('0x21')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 776a2cf..df053f4 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 _0xc199=['VIRTUAL','getDataValue','sequelize','exports','TEXT'];(function(_0x397cfb,_0xb8f317){var _0x15fed9=function(_0x3eba43){while(--_0x3eba43){_0x397cfb['push'](_0x397cfb['shift']());}};_0x15fed9(++_0xb8f317);}(_0xc199,0x11f));var _0x9c19=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0xc199[_0x122096];return _0x3d1966;};'use strict';var Sequelize=require(_0x9c19('0x0'));module[_0x9c19('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x9c19('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x9c19('0x3')],'get':function(){return this[_0x9c19('0x4')]('key');}}}; \ No newline at end of file +var _0x8732=['STRING','TEXT','key','sequelize'];(function(_0x6487e3,_0x3ef5ac){var _0x4c1f77=function(_0x63f9e0){while(--_0x63f9e0){_0x6487e3['push'](_0x6487e3['shift']());}};_0x4c1f77(++_0x3ef5ac);}(_0x8732,0xb3));var _0x2873=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0x8732[_0x819464];return _0x49dcc0;};'use strict';var Sequelize=require(_0x2873('0x0'));module['exports']={'key':{'type':Sequelize[_0x2873('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x2873('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x2873('0x1')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue'](_0x2873('0x3'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 6330844..c9b37c3 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 _0xd87d=['fields','hasOwnProperty','nolimit','sort','where','filter','merge','options','includeAll','include','findAll','catch','show','length','find','body','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','request-promise','moment','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','update','then','destroy','CannedAnswers','UserProfileResource','error','stack','name','send','index','CannedAnswer','rawAttributes','fieldName','key','model','query','filters','intersection','attributes'];(function(_0x29754a,_0x3ddfda){var _0x41735b=function(_0x90c415){while(--_0x90c415){_0x29754a['push'](_0x29754a['shift']());}};_0x41735b(++_0x3ddfda);}(_0xd87d,0x16b));var _0xdd87=function(_0x183fc0,_0x1ca88f){_0x183fc0=_0x183fc0-0x0;var _0x9b5fef=_0xd87d[_0x183fc0];return _0x9b5fef;};'use strict';var emlformat=require(_0xdd87('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdd87('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdd87('0x2'));var moment=require(_0xdd87('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xdd87('0x4'));var path=require(_0xdd87('0x5'));var sox=require('sox');var csv=require(_0xdd87('0x6'));var ejs=require(_0xdd87('0x7'));var fs=require('fs');var fs_extra=require(_0xdd87('0x8'));var _=require(_0xdd87('0x9'));var squel=require(_0xdd87('0xa'));var crypto=require('crypto');var jsforce=require(_0xdd87('0xb'));var deskjs=require(_0xdd87('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xdd87('0xd'));var Redis=require(_0xdd87('0xe'));var authService=require(_0xdd87('0xf'));var qs=require(_0xdd87('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xdd87('0x11'))(_0xdd87('0x12'));var utils=require(_0xdd87('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xdd87('0x14'));var db=require(_0xdd87('0x15'))['db'];function respondWithStatusCode(_0x39b484,_0x434b47){_0x434b47=_0x434b47||0xcc;return function(_0x2ca2b1){if(_0x2ca2b1){return _0x39b484[_0xdd87('0x16')](_0x434b47);}return _0x39b484[_0xdd87('0x17')](_0x434b47)[_0xdd87('0x18')]();};}function respondWithResult(_0x3edbe0,_0x141905){_0x141905=_0x141905||0xc8;return function(_0x59db28){if(_0x59db28){return _0x3edbe0[_0xdd87('0x17')](_0x141905)[_0xdd87('0x19')](_0x59db28);}};}function respondWithFilteredResult(_0x25127a,_0x52ee4f){return function(_0x504c72){if(_0x504c72){var _0x5f4462=typeof _0x52ee4f['offset']===_0xdd87('0x1a')&&typeof _0x52ee4f['limit']===_0xdd87('0x1a');var _0xadc970=_0x504c72[_0xdd87('0x1b')];var _0x20aaf8=_0x5f4462?0x0:_0x52ee4f['offset'];var _0xabf813=_0x5f4462?_0x504c72['count']:_0x52ee4f[_0xdd87('0x1c')]+_0x52ee4f[_0xdd87('0x1d')];var _0x492835;if(_0xabf813>=_0xadc970){_0xabf813=_0xadc970;_0x492835=0xc8;}else{_0x492835=0xce;}_0x25127a['status'](_0x492835);return _0x25127a[_0xdd87('0x1e')](_0xdd87('0x1f'),_0x20aaf8+'-'+_0xabf813+'/'+_0xadc970)[_0xdd87('0x19')](_0x504c72);}return null;};}function patchUpdates(_0x1393ae){return function(_0x57ada6){try{jsonpatch[_0xdd87('0x20')](_0x57ada6,_0x1393ae,!![]);}catch(_0x1cd440){return BPromise['reject'](_0x1cd440);}return _0x57ada6['save']();};}function saveUpdates(_0x28d0b8,_0x49df45){return function(_0x4a5262){if(_0x4a5262){return _0x4a5262[_0xdd87('0x21')](_0x28d0b8)[_0xdd87('0x22')](function(_0x3be42b){return _0x3be42b;});}return null;};}function removeEntity(_0x37d045,_0x1c18d3){return function(_0x17c6d9){if(_0x17c6d9){return _0x17c6d9[_0xdd87('0x23')]()[_0xdd87('0x22')](function(){var _0x5b6ab2=_0x17c6d9['get']({'plain':!![]});var _0x183502=_0xdd87('0x24');return db[_0xdd87('0x25')][_0xdd87('0x23')]({'where':{'type':_0x183502,'resourceId':_0x5b6ab2['id']}})[_0xdd87('0x22')](function(){return _0x17c6d9;});})['then'](function(){_0x37d045[_0xdd87('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5cb3b6,_0x23f664){return function(_0x2bdc38){if(!_0x2bdc38){_0x5cb3b6[_0xdd87('0x16')](0x194);}return _0x2bdc38;};}function handleError(_0x500c93,_0x13f1d8){_0x13f1d8=_0x13f1d8||0x1f4;return function(_0x59be6e){logger[_0xdd87('0x26')](_0x59be6e[_0xdd87('0x27')]);if(_0x59be6e[_0xdd87('0x28')]){delete _0x59be6e['name'];}_0x500c93['status'](_0x13f1d8)[_0xdd87('0x29')](_0x59be6e);};}exports[_0xdd87('0x2a')]=function(_0x1a6c00,_0x24d589){var _0xa26477={},_0x34a0eb={},_0x35e4e3={'count':0x0,'rows':[]};var _0x256bed=_['map'](db[_0xdd87('0x2b')][_0xdd87('0x2c')],function(_0x2e4750){return{'name':_0x2e4750[_0xdd87('0x2d')],'type':_0x2e4750['type'][_0xdd87('0x2e')]};});_0x34a0eb[_0xdd87('0x2f')]=_['map'](_0x256bed,_0xdd87('0x28'));_0x34a0eb[_0xdd87('0x30')]=_['keys'](_0x1a6c00[_0xdd87('0x30')]);_0x34a0eb[_0xdd87('0x31')]=_[_0xdd87('0x32')](_0x34a0eb[_0xdd87('0x2f')],_0x34a0eb[_0xdd87('0x30')]);_0xa26477[_0xdd87('0x33')]=_[_0xdd87('0x32')](_0x34a0eb[_0xdd87('0x2f')],qs['fields'](_0x1a6c00[_0xdd87('0x30')][_0xdd87('0x34')]));_0xa26477[_0xdd87('0x33')]=_0xa26477[_0xdd87('0x33')]['length']?_0xa26477[_0xdd87('0x33')]:_0x34a0eb[_0xdd87('0x2f')];if(!_0x1a6c00['query'][_0xdd87('0x35')](_0xdd87('0x36'))){_0xa26477[_0xdd87('0x1d')]=qs['limit'](_0x1a6c00[_0xdd87('0x30')][_0xdd87('0x1d')]);_0xa26477[_0xdd87('0x1c')]=qs[_0xdd87('0x1c')](_0x1a6c00[_0xdd87('0x30')][_0xdd87('0x1c')]);}_0xa26477['order']=qs[_0xdd87('0x37')](_0x1a6c00['query'][_0xdd87('0x37')]);_0xa26477[_0xdd87('0x38')]=qs['filters'](_['pick'](_0x1a6c00['query'],_0x34a0eb[_0xdd87('0x31')]),_0x256bed);if(_0x1a6c00[_0xdd87('0x30')]['filter']){_0xa26477['where']=_['merge'](_0xa26477[_0xdd87('0x38')],{'$or':[{'key':{'$like':'%'+_0x1a6c00[_0xdd87('0x30')][_0xdd87('0x39')]+'%'}},{'value':{'$like':'%'+_0x1a6c00['query']['filter']+'%'}}]});}_0xa26477=_[_0xdd87('0x3a')]({},_0xa26477,_0x1a6c00[_0xdd87('0x3b')]);var _0x5d7805={'where':_0xa26477[_0xdd87('0x38')]};return db['CannedAnswer'][_0xdd87('0x1b')](_0x5d7805)[_0xdd87('0x22')](function(_0x4c4fb0){_0x35e4e3[_0xdd87('0x1b')]=_0x4c4fb0;if(_0x1a6c00['query'][_0xdd87('0x3c')]){_0xa26477[_0xdd87('0x3d')]=[{'all':!![]}];}return db['CannedAnswer'][_0xdd87('0x3e')](_0xa26477);})[_0xdd87('0x22')](function(_0x3f6e01){_0x35e4e3['rows']=_0x3f6e01;return _0x35e4e3;})[_0xdd87('0x22')](respondWithFilteredResult(_0x24d589,_0xa26477))[_0xdd87('0x3f')](handleError(_0x24d589,null));};exports[_0xdd87('0x40')]=function(_0x4646e1,_0x4bfa1c){var _0x55b31e={'raw':!![],'where':{'id':_0x4646e1['params']['id']}},_0x2240fc={};_0x2240fc[_0xdd87('0x2f')]=_['keys'](db['CannedAnswer'][_0xdd87('0x2c')]);_0x2240fc[_0xdd87('0x30')]=_['keys'](_0x4646e1[_0xdd87('0x30')]);_0x2240fc[_0xdd87('0x31')]=_[_0xdd87('0x32')](_0x2240fc[_0xdd87('0x2f')],_0x2240fc[_0xdd87('0x30')]);_0x55b31e[_0xdd87('0x33')]=_[_0xdd87('0x32')](_0x2240fc[_0xdd87('0x2f')],qs['fields'](_0x4646e1[_0xdd87('0x30')][_0xdd87('0x34')]));_0x55b31e[_0xdd87('0x33')]=_0x55b31e[_0xdd87('0x33')][_0xdd87('0x41')]?_0x55b31e[_0xdd87('0x33')]:_0x2240fc['model'];if(_0x4646e1[_0xdd87('0x30')][_0xdd87('0x3c')]){_0x55b31e[_0xdd87('0x3d')]=[{'all':!![]}];}_0x55b31e=_[_0xdd87('0x3a')]({},_0x55b31e,_0x4646e1['options']);return db[_0xdd87('0x2b')][_0xdd87('0x42')](_0x55b31e)[_0xdd87('0x22')](handleEntityNotFound(_0x4bfa1c,null))[_0xdd87('0x22')](respondWithResult(_0x4bfa1c,null))[_0xdd87('0x3f')](handleError(_0x4bfa1c,null));};exports[_0xdd87('0x21')]=function(_0x22c2bc,_0x3f1737){if(_0x22c2bc[_0xdd87('0x43')]['id']){delete _0x22c2bc[_0xdd87('0x43')]['id'];}return db['CannedAnswer'][_0xdd87('0x42')]({'where':{'id':_0x22c2bc[_0xdd87('0x44')]['id']}})[_0xdd87('0x22')](handleEntityNotFound(_0x3f1737,null))['then'](saveUpdates(_0x22c2bc['body'],null))['then'](respondWithResult(_0x3f1737,null))[_0xdd87('0x3f')](handleError(_0x3f1737,null));};exports[_0xdd87('0x23')]=function(_0x543f49,_0x5948fb){return db['CannedAnswer'][_0xdd87('0x42')]({'where':{'id':_0x543f49[_0xdd87('0x44')]['id']}})[_0xdd87('0x22')](handleEntityNotFound(_0x5948fb,null))[_0xdd87('0x22')](removeEntity(_0x5948fb,null))[_0xdd87('0x3f')](handleError(_0x5948fb,null));};exports[_0xdd87('0x45')]=function(_0x219fc2,_0x35d764){var _0x495ecc={'key':_0x219fc2[_0xdd87('0x43')]['key']};if(_0x219fc2[_0xdd87('0x43')][_0xdd87('0x46')]){_0x495ecc[_0xdd87('0x46')]=_0x219fc2[_0xdd87('0x43')][_0xdd87('0x46')];}else if(_0x219fc2['body'][_0xdd87('0x47')]){_0x495ecc[_0xdd87('0x47')]=_0x219fc2[_0xdd87('0x43')][_0xdd87('0x47')];}else if(_0x219fc2[_0xdd87('0x43')][_0xdd87('0x48')]){_0x495ecc['OpenchannelAccountId']=_0x219fc2[_0xdd87('0x43')]['OpenchannelAccountId'];}else if(_0x219fc2['body']['ChatWebsiteId']){_0x495ecc[_0xdd87('0x49')]=_0x219fc2['body'][_0xdd87('0x49')];}return db[_0xdd87('0x2b')][_0xdd87('0x42')]({'where':_0x495ecc})[_0xdd87('0x22')](function(_0x482c02){if(_0x482c02){throw new db[(_0xdd87('0x4a'))][(_0xdd87('0x4b'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0xdd87('0x2b')][_0xdd87('0x45')](_0x219fc2[_0xdd87('0x43')]);})[_0xdd87('0x22')](function(_0xe5d296){var _0x184d20=_0x219fc2[_0xdd87('0x4c')]['get']({'plain':!![]});if(!_0x184d20)throw new Error(_0xdd87('0x4d'));if(_0x184d20[_0xdd87('0x4e')]==='user'){var _0x376e47=_0xe5d296[_0xdd87('0x4f')]({'plain':!![]});return db[_0xdd87('0x50')]['find']({'where':{'name':_0xdd87('0x24'),'userProfileId':_0x184d20['userProfileId']},'raw':!![]})['then'](function(_0x3ca633){if(_0x3ca633&&_0x3ca633[_0xdd87('0x51')]===0x0){return db[_0xdd87('0x25')][_0xdd87('0x45')]({'name':_0x376e47[_0xdd87('0x28')],'resourceId':_0x376e47['id'],'type':_0x3ca633[_0xdd87('0x28')],'sectionId':_0x3ca633['id']},{})[_0xdd87('0x22')](function(){return _0xe5d296;});}else{return _0xe5d296;}})['catch'](function(_0x342cf5){logger[_0xdd87('0x26')](_0xdd87('0x52'),_0x342cf5);throw _0x342cf5;});}return _0xe5d296;})[_0xdd87('0x22')](respondWithResult(_0x35d764,0xc9))['catch'](handleError(_0x35d764,null));}; \ No newline at end of file +var _0xc19c=['create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','json','undefined','limit','count','status','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','CannedAnswer','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','pick','filter','where','merge','includeAll','include','findAll','catch','show','params','rawAttributes','body','find','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0xc19c,0x1be));var _0xcc19=function(_0x12153b,_0x48f386){_0x12153b=_0x12153b-0x0;var _0x460fe3=_0xc19c[_0x12153b];return _0x460fe3;};'use strict';var emlformat=require(_0xcc19('0x0'));var rimraf=require(_0xcc19('0x1'));var zipdir=require(_0xcc19('0x2'));var jsonpatch=require(_0xcc19('0x3'));var rp=require('request-promise');var moment=require(_0xcc19('0x4'));var BPromise=require(_0xcc19('0x5'));var Mustache=require(_0xcc19('0x6'));var util=require(_0xcc19('0x7'));var path=require(_0xcc19('0x8'));var sox=require(_0xcc19('0x9'));var csv=require(_0xcc19('0xa'));var ejs=require(_0xcc19('0xb'));var fs=require('fs');var fs_extra=require(_0xcc19('0xc'));var _=require(_0xcc19('0xd'));var squel=require('squel');var crypto=require(_0xcc19('0xe'));var jsforce=require(_0xcc19('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xcc19('0xa'));var querystring=require('querystring');var Papa=require(_0xcc19('0x10'));var Redis=require(_0xcc19('0x11'));var authService=require(_0xcc19('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xcc19('0x13'));var hardwareService=require(_0xcc19('0x14'));var logger=require(_0xcc19('0x15'))(_0xcc19('0x16'));var utils=require('../../config/utils');var config=require(_0xcc19('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xcc19('0x18'))['db'];function respondWithStatusCode(_0x5b3f69,_0x535aaf){_0x535aaf=_0x535aaf||0xcc;return function(_0x49b27){if(_0x49b27){return _0x5b3f69[_0xcc19('0x19')](_0x535aaf);}return _0x5b3f69['status'](_0x535aaf)[_0xcc19('0x1a')]();};}function respondWithResult(_0xc27108,_0x5d8b77){_0x5d8b77=_0x5d8b77||0xc8;return function(_0x499d28){if(_0x499d28){return _0xc27108['status'](_0x5d8b77)[_0xcc19('0x1b')](_0x499d28);}};}function respondWithFilteredResult(_0xea75fe,_0x9c5e2b){return function(_0x2978aa){if(_0x2978aa){var _0x231916=typeof _0x9c5e2b['offset']===_0xcc19('0x1c')&&typeof _0x9c5e2b[_0xcc19('0x1d')]==='undefined';var _0xd9d7f6=_0x2978aa[_0xcc19('0x1e')];var _0x32864e=_0x231916?0x0:_0x9c5e2b['offset'];var _0x142d9c=_0x231916?_0x2978aa[_0xcc19('0x1e')]:_0x9c5e2b['offset']+_0x9c5e2b[_0xcc19('0x1d')];var _0x3cd072;if(_0x142d9c>=_0xd9d7f6){_0x142d9c=_0xd9d7f6;_0x3cd072=0xc8;}else{_0x3cd072=0xce;}_0xea75fe[_0xcc19('0x1f')](_0x3cd072);return _0xea75fe['set'](_0xcc19('0x20'),_0x32864e+'-'+_0x142d9c+'/'+_0xd9d7f6)[_0xcc19('0x1b')](_0x2978aa);}return null;};}function patchUpdates(_0x1f7182){return function(_0x1944ff){try{jsonpatch[_0xcc19('0x21')](_0x1944ff,_0x1f7182,!![]);}catch(_0x13771d){return BPromise[_0xcc19('0x22')](_0x13771d);}return _0x1944ff[_0xcc19('0x23')]();};}function saveUpdates(_0x4e63dd,_0x3e0d96){return function(_0x2f7db3){if(_0x2f7db3){return _0x2f7db3[_0xcc19('0x24')](_0x4e63dd)[_0xcc19('0x25')](function(_0xed9329){return _0xed9329;});}return null;};}function removeEntity(_0x594186,_0x3c5268){return function(_0x31a374){if(_0x31a374){return _0x31a374[_0xcc19('0x26')]()['then'](function(){var _0x3ba305=_0x31a374[_0xcc19('0x27')]({'plain':!![]});var _0x20c23c='CannedAnswers';return db[_0xcc19('0x28')]['destroy']({'where':{'type':_0x20c23c,'resourceId':_0x3ba305['id']}})[_0xcc19('0x25')](function(){return _0x31a374;});})['then'](function(){_0x594186[_0xcc19('0x1f')](0xcc)[_0xcc19('0x1a')]();});}};}function handleEntityNotFound(_0x317870,_0x53c30f){return function(_0x3cff86){if(!_0x3cff86){_0x317870[_0xcc19('0x19')](0x194);}return _0x3cff86;};}function handleError(_0x31b0cc,_0x31ba16){_0x31ba16=_0x31ba16||0x1f4;return function(_0x3c9cf2){logger[_0xcc19('0x29')](_0x3c9cf2[_0xcc19('0x2a')]);if(_0x3c9cf2[_0xcc19('0x2b')]){delete _0x3c9cf2[_0xcc19('0x2b')];}_0x31b0cc[_0xcc19('0x1f')](_0x31ba16)[_0xcc19('0x2c')](_0x3c9cf2);};}exports[_0xcc19('0x2d')]=function(_0x4bbaa1,_0x57f348){var _0x16feed={},_0xa3ff24={},_0x588d20={'count':0x0,'rows':[]};var _0x5ab3b1=_[_0xcc19('0x2e')](db[_0xcc19('0x2f')]['rawAttributes'],function(_0x396b1b){return{'name':_0x396b1b[_0xcc19('0x30')],'type':_0x396b1b[_0xcc19('0x31')]['key']};});_0xa3ff24[_0xcc19('0x32')]=_[_0xcc19('0x2e')](_0x5ab3b1,_0xcc19('0x2b'));_0xa3ff24['query']=_[_0xcc19('0x33')](_0x4bbaa1[_0xcc19('0x34')]);_0xa3ff24[_0xcc19('0x35')]=_[_0xcc19('0x36')](_0xa3ff24['model'],_0xa3ff24[_0xcc19('0x34')]);_0x16feed[_0xcc19('0x37')]=_[_0xcc19('0x36')](_0xa3ff24['model'],qs[_0xcc19('0x38')](_0x4bbaa1[_0xcc19('0x34')]['fields']));_0x16feed[_0xcc19('0x37')]=_0x16feed['attributes'][_0xcc19('0x39')]?_0x16feed[_0xcc19('0x37')]:_0xa3ff24['model'];if(!_0x4bbaa1['query'][_0xcc19('0x3a')](_0xcc19('0x3b'))){_0x16feed['limit']=qs[_0xcc19('0x1d')](_0x4bbaa1[_0xcc19('0x34')][_0xcc19('0x1d')]);_0x16feed['offset']=qs[_0xcc19('0x3c')](_0x4bbaa1[_0xcc19('0x34')][_0xcc19('0x3c')]);}_0x16feed[_0xcc19('0x3d')]=qs['sort'](_0x4bbaa1['query']['sort']);_0x16feed['where']=qs[_0xcc19('0x35')](_[_0xcc19('0x3e')](_0x4bbaa1['query'],_0xa3ff24['filters']),_0x5ab3b1);if(_0x4bbaa1['query'][_0xcc19('0x3f')]){_0x16feed[_0xcc19('0x40')]=_['merge'](_0x16feed[_0xcc19('0x40')],{'$or':[{'key':{'$like':'%'+_0x4bbaa1[_0xcc19('0x34')][_0xcc19('0x3f')]+'%'}},{'value':{'$like':'%'+_0x4bbaa1[_0xcc19('0x34')]['filter']+'%'}}]});}_0x16feed=_[_0xcc19('0x41')]({},_0x16feed,_0x4bbaa1['options']);var _0xa14fb3={'where':_0x16feed['where']};return db[_0xcc19('0x2f')]['count'](_0xa14fb3)['then'](function(_0x18f5bb){_0x588d20[_0xcc19('0x1e')]=_0x18f5bb;if(_0x4bbaa1[_0xcc19('0x34')][_0xcc19('0x42')]){_0x16feed[_0xcc19('0x43')]=[{'all':!![]}];}return db['CannedAnswer'][_0xcc19('0x44')](_0x16feed);})[_0xcc19('0x25')](function(_0x2db6a0){_0x588d20['rows']=_0x2db6a0;return _0x588d20;})[_0xcc19('0x25')](respondWithFilteredResult(_0x57f348,_0x16feed))[_0xcc19('0x45')](handleError(_0x57f348,null));};exports[_0xcc19('0x46')]=function(_0xd1272d,_0x42e170){var _0x1c6e02={'raw':!![],'where':{'id':_0xd1272d[_0xcc19('0x47')]['id']}},_0x5e818a={};_0x5e818a[_0xcc19('0x32')]=_['keys'](db[_0xcc19('0x2f')][_0xcc19('0x48')]);_0x5e818a[_0xcc19('0x34')]=_['keys'](_0xd1272d['query']);_0x5e818a[_0xcc19('0x35')]=_[_0xcc19('0x36')](_0x5e818a[_0xcc19('0x32')],_0x5e818a[_0xcc19('0x34')]);_0x1c6e02[_0xcc19('0x37')]=_[_0xcc19('0x36')](_0x5e818a[_0xcc19('0x32')],qs[_0xcc19('0x38')](_0xd1272d[_0xcc19('0x34')][_0xcc19('0x38')]));_0x1c6e02[_0xcc19('0x37')]=_0x1c6e02[_0xcc19('0x37')][_0xcc19('0x39')]?_0x1c6e02[_0xcc19('0x37')]:_0x5e818a['model'];if(_0xd1272d[_0xcc19('0x34')][_0xcc19('0x42')]){_0x1c6e02['include']=[{'all':!![]}];}_0x1c6e02=_[_0xcc19('0x41')]({},_0x1c6e02,_0xd1272d['options']);return db[_0xcc19('0x2f')]['find'](_0x1c6e02)[_0xcc19('0x25')](handleEntityNotFound(_0x42e170,null))[_0xcc19('0x25')](respondWithResult(_0x42e170,null))[_0xcc19('0x45')](handleError(_0x42e170,null));};exports[_0xcc19('0x24')]=function(_0x45a64e,_0x7a9d3f){if(_0x45a64e[_0xcc19('0x49')]['id']){delete _0x45a64e[_0xcc19('0x49')]['id'];}return db[_0xcc19('0x2f')]['find']({'where':{'id':_0x45a64e['params']['id']}})['then'](handleEntityNotFound(_0x7a9d3f,null))[_0xcc19('0x25')](saveUpdates(_0x45a64e[_0xcc19('0x49')],null))['then'](respondWithResult(_0x7a9d3f,null))[_0xcc19('0x45')](handleError(_0x7a9d3f,null));};exports[_0xcc19('0x26')]=function(_0x3d59e6,_0x3df428){return db[_0xcc19('0x2f')][_0xcc19('0x4a')]({'where':{'id':_0x3d59e6[_0xcc19('0x47')]['id']}})[_0xcc19('0x25')](handleEntityNotFound(_0x3df428,null))[_0xcc19('0x25')](removeEntity(_0x3df428,null))[_0xcc19('0x45')](handleError(_0x3df428,null));};exports['create']=function(_0xd7bf6c,_0x5e2fcd){var _0x5f01c5={'key':_0xd7bf6c[_0xcc19('0x49')][_0xcc19('0x4b')]};if(_0xd7bf6c['body'][_0xcc19('0x4c')]){_0x5f01c5[_0xcc19('0x4c')]=_0xd7bf6c[_0xcc19('0x49')][_0xcc19('0x4c')];}else if(_0xd7bf6c[_0xcc19('0x49')][_0xcc19('0x4d')]){_0x5f01c5[_0xcc19('0x4d')]=_0xd7bf6c[_0xcc19('0x49')][_0xcc19('0x4d')];}else if(_0xd7bf6c[_0xcc19('0x49')][_0xcc19('0x4e')]){_0x5f01c5[_0xcc19('0x4e')]=_0xd7bf6c[_0xcc19('0x49')]['OpenchannelAccountId'];}else if(_0xd7bf6c[_0xcc19('0x49')][_0xcc19('0x4f')]){_0x5f01c5[_0xcc19('0x4f')]=_0xd7bf6c[_0xcc19('0x49')][_0xcc19('0x4f')];}return db[_0xcc19('0x2f')][_0xcc19('0x4a')]({'where':_0x5f01c5})[_0xcc19('0x25')](function(_0x5caab3){if(_0x5caab3){throw new db[(_0xcc19('0x50'))][(_0xcc19('0x51'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0xcc19('0x2f')][_0xcc19('0x52')](_0xd7bf6c[_0xcc19('0x49')]);})['then'](function(_0x59d8e4){var _0x48fe36=_0xd7bf6c['user']['get']({'plain':!![]});if(!_0x48fe36)throw new Error(_0xcc19('0x53'));if(_0x48fe36[_0xcc19('0x54')]===_0xcc19('0x55')){var _0xb5db88=_0x59d8e4[_0xcc19('0x27')]({'plain':!![]});return db[_0xcc19('0x56')][_0xcc19('0x4a')]({'where':{'name':'CannedAnswers','userProfileId':_0x48fe36['userProfileId']},'raw':!![]})[_0xcc19('0x25')](function(_0x19ad4c){if(_0x19ad4c&&_0x19ad4c[_0xcc19('0x57')]===0x0){return db['UserProfileResource'][_0xcc19('0x52')]({'name':_0xb5db88[_0xcc19('0x2b')],'resourceId':_0xb5db88['id'],'type':_0x19ad4c[_0xcc19('0x2b')],'sectionId':_0x19ad4c['id']},{})[_0xcc19('0x25')](function(){return _0x59d8e4;});}else{return _0x59d8e4;}})['catch'](function(_0x262b2c){logger[_0xcc19('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x262b2c);throw _0x262b2c;});}return _0x59d8e4;})[_0xcc19('0x25')](respondWithResult(_0x5e2fcd,0xc9))['catch'](handleError(_0x5e2fcd,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 124c9cb..5d5a5bd 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 _0x3e2b=['path','../../config/environment','./cannedAnswer.attributes','define','tools_canned_answers','utf8mb4','lodash','api','moment','bluebird','request-promise'];(function(_0x28ade3,_0x3849b9){var _0x20ca87=function(_0x47515f){while(--_0x47515f){_0x28ade3['push'](_0x28ade3['shift']());}};_0x20ca87(++_0x3849b9);}(_0x3e2b,0xcc));var _0xb3e2=function(_0x159a75,_0x1e880a){_0x159a75=_0x159a75-0x0;var _0x5e06eb=_0x3e2b[_0x159a75];return _0x5e06eb;};'use strict';var _=require(_0xb3e2('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb3e2('0x1'));var moment=require(_0xb3e2('0x2'));var BPromise=require(_0xb3e2('0x3'));var rp=require(_0xb3e2('0x4'));var fs=require('fs');var path=require(_0xb3e2('0x5'));var rimraf=require('rimraf');var config=require(_0xb3e2('0x6'));var attributes=require(_0xb3e2('0x7'));module['exports']=function(_0x200765,_0x274450){return _0x200765[_0xb3e2('0x8')]('CannedAnswer',attributes,{'tableName':_0xb3e2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb3e2('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xe47e=['api','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','CannedAnswer','tools_canned_answers','utf8mb4','lodash','util','../../config/logger'];(function(_0x5e2489,_0x2fd8be){var _0xa87596=function(_0x3b348d){while(--_0x3b348d){_0x5e2489['push'](_0x5e2489['shift']());}};_0xa87596(++_0x2fd8be);}(_0xe47e,0x111));var _0xee47=function(_0x532d78,_0x25b6a8){_0x532d78=_0x532d78-0x0;var _0x5990c4=_0xe47e[_0x532d78];return _0x5990c4;};'use strict';var _=require(_0xee47('0x0'));var util=require(_0xee47('0x1'));var logger=require(_0xee47('0x2'))(_0xee47('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xee47('0x4'));var rimraf=require(_0xee47('0x5'));var config=require(_0xee47('0x6'));var attributes=require(_0xee47('0x7'));module[_0xee47('0x8')]=function(_0x5eed21,_0x2aa00d){return _0x5eed21['define'](_0xee47('0x9'),attributes,{'tableName':_0xee47('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xee47('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index f77c203..1e47ef5 100644 --- a/server/api/cannedAnswer/cannedAnswer.rpc.js +++ b/server/api/cannedAnswer/cannedAnswer.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['http','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x38c35a,_0x502250){var _0x30dd82=function(_0x144042){while(--_0x144042){_0x38c35a['push'](_0x38c35a['shift']());}};_0x30dd82(++_0x502250);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +var _0xa9e0=['http','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2f53e9,_0x136279){var _0x245047=function(_0x1e0a5d){while(--_0x1e0a5d){_0x2f53e9['push'](_0x2f53e9['shift']());}};_0x245047(++_0x136279);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js index 5074012..84e1170 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 _0x108e=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show','post','/:id','update','delete','exports','util','path','connect-timeout'];(function(_0x1f3055,_0x399266){var _0x59969f=function(_0x366866){while(--_0x366866){_0x1f3055['push'](_0x1f3055['shift']());}};_0x59969f(++_0x399266);}(_0x108e,0x1d9));var _0xe108=function(_0x4eb107,_0x502e04){_0x4eb107=_0x4eb107-0x0;var _0x45498d=_0x108e[_0x4eb107];return _0x45498d;};'use strict';var multer=require('multer');var util=require(_0xe108('0x0'));var path=require(_0xe108('0x1'));var timeout=require(_0xe108('0x2'));var express=require(_0xe108('0x3'));var router=express[_0xe108('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe108('0x5'));var interaction=require(_0xe108('0x6'));var config=require(_0xe108('0x7'));var controller=require('./cannedAnswer.controller');router[_0xe108('0x8')]('/',auth['isAuthenticated'](),controller[_0xe108('0x9')]);router[_0xe108('0x8')]('/:id',auth[_0xe108('0xa')](),controller[_0xe108('0xb')]);router[_0xe108('0xc')]('/',auth[_0xe108('0xa')](),controller['create']);router['put'](_0xe108('0xd'),auth[_0xe108('0xa')](),controller[_0xe108('0xe')]);router[_0xe108('0xf')](_0xe108('0xd'),auth[_0xe108('0xa')](),controller['destroy']);module[_0xe108('0x10')]=router; \ No newline at end of file +var _0xd014=['update','delete','destroy','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','post','create','put'];(function(_0x27cec0,_0x439a37){var _0x183651=function(_0x1a4371){while(--_0x1a4371){_0x27cec0['push'](_0x27cec0['shift']());}};_0x183651(++_0x439a37);}(_0xd014,0x1d7));var _0x4d01=function(_0x11b1a1,_0x378945){_0x11b1a1=_0x11b1a1-0x0;var _0x1e718b=_0xd014[_0x11b1a1];return _0x1e718b;};'use strict';var multer=require(_0x4d01('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4d01('0x1'));var express=require(_0x4d01('0x2'));var router=express['Router']();var fs_extra=require(_0x4d01('0x3'));var auth=require(_0x4d01('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4d01('0x5'));var controller=require(_0x4d01('0x6'));router[_0x4d01('0x7')]('/',auth[_0x4d01('0x8')](),controller[_0x4d01('0x9')]);router[_0x4d01('0x7')](_0x4d01('0xa'),auth[_0x4d01('0x8')](),controller[_0x4d01('0xb')]);router[_0x4d01('0xc')]('/',auth[_0x4d01('0x8')](),controller[_0x4d01('0xd')]);router[_0x4d01('0xe')](_0x4d01('0xa'),auth[_0x4d01('0x8')](),controller[_0x4d01('0xf')]);router[_0x4d01('0x10')](_0x4d01('0xa'),auth[_0x4d01('0x8')](),controller[_0x4d01('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index b9ee8b3..1ec11ba 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 _0x409b=['sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x296195,_0x407009){var _0x245bb4=function(_0x235ca4){while(--_0x235ca4){_0x296195['push'](_0x296195['shift']());}};_0x245bb4(++_0x407009);}(_0x409b,0x14a));var _0xb409=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x409b[_0x68c979];return _0x4f0001;};'use strict';var Sequelize=require(_0xb409('0x0'));module[_0xb409('0x1')]={'calldate':{'type':Sequelize[_0xb409('0x2')],'allowNull':![],'defaultValue':_0xb409('0x3')},'clid':{'type':Sequelize[_0xb409('0x4')]},'src':{'type':Sequelize[_0xb409('0x4')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0xb409('0x4')]},'channel':{'type':Sequelize[_0xb409('0x4')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0xb409('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xb409('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xb409('0x4')]},'amaflags':{'type':Sequelize[_0xb409('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xb409('0x4')]},'userfield':{'type':Sequelize[_0xb409('0x4')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xb409('0x4')]},'sequence':{'type':Sequelize[_0xb409('0x4')]},'peeraccount':{'type':Sequelize[_0xb409('0x4')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0xb409('0x4')]}}; \ No newline at end of file +var _0x0a12=['INTEGER','exports','STRING'];(function(_0x1631a8,_0x2d24de){var _0x43884a=function(_0x205572){while(--_0x205572){_0x1631a8['push'](_0x1631a8['shift']());}};_0x43884a(++_0x2d24de);}(_0x0a12,0xb8));var _0x20a1=function(_0x576170,_0x1712ae){_0x576170=_0x576170-0x0;var _0x397c70=_0x0a12[_0x576170];return _0x397c70;};'use strict';var Sequelize=require('sequelize');module[_0x20a1('0x0')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x20a1('0x1')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x20a1('0x1')]},'channel':{'type':Sequelize[_0x20a1('0x1')]},'dstchannel':{'type':Sequelize[_0x20a1('0x1')]},'lastapp':{'type':Sequelize[_0x20a1('0x1')]},'lastdata':{'type':Sequelize[_0x20a1('0x1')]},'duration':{'type':Sequelize[_0x20a1('0x2')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x20a1('0x2')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x20a1('0x1')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x20a1('0x1')]},'sequence':{'type':Sequelize[_0x20a1('0x1')]},'peeraccount':{'type':Sequelize[_0x20a1('0x1')]},'type':{'type':Sequelize[_0x20a1('0x1')]},'tag':{'type':Sequelize[_0x20a1('0x1')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index bf83dfa..c1929f8 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 _0x5fd1=['fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','offset','set','Content-Range','apply','update','then','destroy','end','error','name','send','index','map','Cdr','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs'];(function(_0x2fde21,_0x5998d4){var _0x3f726d=function(_0x367c22){while(--_0x367c22){_0x2fde21['push'](_0x2fde21['shift']());}};_0x3f726d(++_0x5998d4);}(_0x5fd1,0x155));var _0x15fd=function(_0x2752d6,_0x40d30a){_0x2752d6=_0x2752d6-0x0;var _0x4daebf=_0x5fd1[_0x2752d6];return _0x4daebf;};'use strict';var emlformat=require(_0x15fd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x15fd('0x1'));var jsonpatch=require(_0x15fd('0x2'));var rp=require(_0x15fd('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x15fd('0x4'));var util=require(_0x15fd('0x5'));var path=require(_0x15fd('0x6'));var sox=require('sox');var csv=require(_0x15fd('0x7'));var ejs=require(_0x15fd('0x8'));var fs=require('fs');var fs_extra=require(_0x15fd('0x9'));var _=require(_0x15fd('0xa'));var squel=require(_0x15fd('0xb'));var crypto=require('crypto');var jsforce=require(_0x15fd('0xc'));var deskjs=require(_0x15fd('0xd'));var toCsv=require(_0x15fd('0x7'));var querystring=require('querystring');var Papa=require(_0x15fd('0xe'));var Redis=require('ioredis');var authService=require(_0x15fd('0xf'));var qs=require(_0x15fd('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x15fd('0x11'));var utils=require(_0x15fd('0x12'));var config=require(_0x15fd('0x13'));var licenseUtil=require(_0x15fd('0x14'));var db=require(_0x15fd('0x15'))['db'];function respondWithStatusCode(_0x2e18ec,_0x346ab1){_0x346ab1=_0x346ab1||0xcc;return function(_0x2660db){if(_0x2660db){return _0x2e18ec[_0x15fd('0x16')](_0x346ab1);}return _0x2e18ec['status'](_0x346ab1)['end']();};}function respondWithResult(_0x5784a3,_0x3fda60){_0x3fda60=_0x3fda60||0xc8;return function(_0x135a15){if(_0x135a15){return _0x5784a3[_0x15fd('0x17')](_0x3fda60)[_0x15fd('0x18')](_0x135a15);}};}function respondWithFilteredResult(_0x44eae6,_0x2ffa03){return function(_0x2c5375){if(_0x2c5375){var _0x44a63a=typeof _0x2ffa03['offset']==='undefined'&&typeof _0x2ffa03[_0x15fd('0x19')]==='undefined';var _0x7afe9c=_0x2c5375['count'];var _0x917fe4=_0x44a63a?0x0:_0x2ffa03[_0x15fd('0x1a')];var _0x855bae=_0x44a63a?_0x2c5375['count']:_0x2ffa03[_0x15fd('0x1a')]+_0x2ffa03[_0x15fd('0x19')];var _0x8b7b9e;if(_0x855bae>=_0x7afe9c){_0x855bae=_0x7afe9c;_0x8b7b9e=0xc8;}else{_0x8b7b9e=0xce;}_0x44eae6[_0x15fd('0x17')](_0x8b7b9e);return _0x44eae6[_0x15fd('0x1b')](_0x15fd('0x1c'),_0x917fe4+'-'+_0x855bae+'/'+_0x7afe9c)[_0x15fd('0x18')](_0x2c5375);}return null;};}function patchUpdates(_0x2f46f1){return function(_0x1b8b9f){try{jsonpatch[_0x15fd('0x1d')](_0x1b8b9f,_0x2f46f1,!![]);}catch(_0x3ff307){return BPromise['reject'](_0x3ff307);}return _0x1b8b9f['save']();};}function saveUpdates(_0x293d7b,_0x36b21e){return function(_0x252a1c){if(_0x252a1c){return _0x252a1c[_0x15fd('0x1e')](_0x293d7b)[_0x15fd('0x1f')](function(_0x11496a){return _0x11496a;});}return null;};}function removeEntity(_0x2073da,_0x50d493){return function(_0x40d43){if(_0x40d43){return _0x40d43[_0x15fd('0x20')]()[_0x15fd('0x1f')](function(){_0x2073da['status'](0xcc)[_0x15fd('0x21')]();});}};}function handleEntityNotFound(_0x49062f,_0x3d1835){return function(_0x1fc24f){if(!_0x1fc24f){_0x49062f[_0x15fd('0x16')](0x194);}return _0x1fc24f;};}function handleError(_0x4c9708,_0x16b87c){_0x16b87c=_0x16b87c||0x1f4;return function(_0x1cbf2c){logger[_0x15fd('0x22')](_0x1cbf2c['stack']);if(_0x1cbf2c[_0x15fd('0x23')]){delete _0x1cbf2c['name'];}_0x4c9708[_0x15fd('0x17')](_0x16b87c)[_0x15fd('0x24')](_0x1cbf2c);};}exports[_0x15fd('0x25')]=function(_0x27d2c4,_0x233ed3){var _0x6c213b={},_0x218034={},_0xe650a3={'count':0x0,'rows':[]};var _0x4590a1=_[_0x15fd('0x26')](db[_0x15fd('0x27')]['rawAttributes'],function(_0x47c22c){return{'name':_0x47c22c[_0x15fd('0x28')],'type':_0x47c22c['type'][_0x15fd('0x29')]};});_0x218034[_0x15fd('0x2a')]=_['map'](_0x4590a1,_0x15fd('0x23'));_0x218034[_0x15fd('0x2b')]=_['keys'](_0x27d2c4[_0x15fd('0x2b')]);_0x218034[_0x15fd('0x2c')]=_[_0x15fd('0x2d')](_0x218034[_0x15fd('0x2a')],_0x218034[_0x15fd('0x2b')]);_0x6c213b[_0x15fd('0x2e')]=_['intersection'](_0x218034[_0x15fd('0x2a')],qs[_0x15fd('0x2f')](_0x27d2c4[_0x15fd('0x2b')][_0x15fd('0x2f')]));_0x6c213b['attributes']=_0x6c213b[_0x15fd('0x2e')][_0x15fd('0x30')]?_0x6c213b[_0x15fd('0x2e')]:_0x218034[_0x15fd('0x2a')];if(!_0x27d2c4[_0x15fd('0x2b')][_0x15fd('0x31')]('nolimit')){_0x6c213b[_0x15fd('0x19')]=qs[_0x15fd('0x19')](_0x27d2c4['query'][_0x15fd('0x19')]);_0x6c213b[_0x15fd('0x1a')]=qs[_0x15fd('0x1a')](_0x27d2c4['query'][_0x15fd('0x1a')]);}_0x6c213b[_0x15fd('0x32')]=qs[_0x15fd('0x33')](_0x27d2c4[_0x15fd('0x2b')][_0x15fd('0x33')]);_0x6c213b[_0x15fd('0x34')]=qs['filters'](_['pick'](_0x27d2c4['query'],_0x218034[_0x15fd('0x2c')]),_0x4590a1);if(_0x27d2c4[_0x15fd('0x2b')][_0x15fd('0x35')]){_0x6c213b['where']=_['merge'](_0x6c213b[_0x15fd('0x34')],{'$or':_['map'](_0x4590a1,function(_0x4f1c84){if(_0x4f1c84['type']!==_0x15fd('0x36')){var _0x10702c={};_0x10702c[_0x4f1c84[_0x15fd('0x23')]]={'$like':'%'+_0x27d2c4['query'][_0x15fd('0x35')]+'%'};return _0x10702c;}})});}_0x6c213b=_[_0x15fd('0x37')]({},_0x6c213b,_0x27d2c4[_0x15fd('0x38')]);var _0x5beb6e={'where':_0x6c213b[_0x15fd('0x34')]};return db[_0x15fd('0x27')][_0x15fd('0x39')](_0x5beb6e)[_0x15fd('0x1f')](function(_0x2e8b0a){_0xe650a3[_0x15fd('0x39')]=_0x2e8b0a;if(_0x27d2c4[_0x15fd('0x2b')][_0x15fd('0x3a')]){_0x6c213b[_0x15fd('0x3b')]=[{'all':!![]}];}return db['Cdr'][_0x15fd('0x3c')](_0x6c213b);})[_0x15fd('0x1f')](function(_0x180433){_0xe650a3[_0x15fd('0x3d')]=_0x180433;return _0xe650a3;})[_0x15fd('0x1f')](respondWithFilteredResult(_0x233ed3,_0x6c213b))[_0x15fd('0x3e')](handleError(_0x233ed3,null));};exports[_0x15fd('0x3f')]=function(_0xda4ca2,_0x343ce6){var _0x104eef={'raw':!![],'where':{'id':_0xda4ca2[_0x15fd('0x40')]['id']}},_0x2eb6b6={};_0x2eb6b6[_0x15fd('0x2a')]=_[_0x15fd('0x41')](db[_0x15fd('0x27')]['rawAttributes']);_0x2eb6b6[_0x15fd('0x2b')]=_[_0x15fd('0x41')](_0xda4ca2[_0x15fd('0x2b')]);_0x2eb6b6[_0x15fd('0x2c')]=_[_0x15fd('0x2d')](_0x2eb6b6[_0x15fd('0x2a')],_0x2eb6b6[_0x15fd('0x2b')]);_0x104eef[_0x15fd('0x2e')]=_['intersection'](_0x2eb6b6['model'],qs[_0x15fd('0x2f')](_0xda4ca2['query'][_0x15fd('0x2f')]));_0x104eef[_0x15fd('0x2e')]=_0x104eef['attributes'][_0x15fd('0x30')]?_0x104eef[_0x15fd('0x2e')]:_0x2eb6b6[_0x15fd('0x2a')];if(_0xda4ca2[_0x15fd('0x2b')][_0x15fd('0x3a')]){_0x104eef[_0x15fd('0x3b')]=[{'all':!![]}];}_0x104eef=_['merge']({},_0x104eef,_0xda4ca2[_0x15fd('0x38')]);return db[_0x15fd('0x27')][_0x15fd('0x42')](_0x104eef)[_0x15fd('0x1f')](handleEntityNotFound(_0x343ce6,null))[_0x15fd('0x1f')](respondWithResult(_0x343ce6,null))[_0x15fd('0x3e')](handleError(_0x343ce6,null));};exports[_0x15fd('0x43')]=function(_0xffc5dc,_0x24cb44){return db[_0x15fd('0x27')][_0x15fd('0x43')](_0xffc5dc[_0x15fd('0x44')],{})['then'](respondWithResult(_0x24cb44,0xc9))[_0x15fd('0x3e')](handleError(_0x24cb44,null));};exports['update']=function(_0x284f51,_0x34c250){if(_0x284f51[_0x15fd('0x44')]['id']){delete _0x284f51['body']['id'];}return db[_0x15fd('0x27')][_0x15fd('0x42')]({'where':{'id':_0x284f51[_0x15fd('0x40')]['id']}})[_0x15fd('0x1f')](handleEntityNotFound(_0x34c250,null))['then'](saveUpdates(_0x284f51[_0x15fd('0x44')],null))[_0x15fd('0x1f')](respondWithResult(_0x34c250,null))[_0x15fd('0x3e')](handleError(_0x34c250,null));};exports[_0x15fd('0x20')]=function(_0x4b6827,_0x56c6be){return db[_0x15fd('0x27')]['find']({'where':{'id':_0x4b6827['params']['id']}})['then'](handleEntityNotFound(_0x56c6be,null))[_0x15fd('0x1f')](removeEntity(_0x56c6be,null))[_0x15fd('0x3e')](handleError(_0x56c6be,null));};exports[_0x15fd('0x45')]=function(_0x10cf04,_0x292174){return db[_0x15fd('0x27')]['describe']()[_0x15fd('0x1f')](respondWithResult(_0x292174,null))[_0x15fd('0x3e')](handleError(_0x292174,null));}; \ No newline at end of file +var _0x8d0e=['rows','catch','show','params','rawAttributes','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','offset','count','set','apply','reject','save','update','destroy','then','end','sendStatus','error','stack','name','send','map','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','Cdr','includeAll','include'];(function(_0x593696,_0x5504c2){var _0x3f0b2b=function(_0x28a53b){while(--_0x28a53b){_0x593696['push'](_0x593696['shift']());}};_0x3f0b2b(++_0x5504c2);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x4aad44,_0x20dc1f){_0x4aad44=_0x4aad44-0x0;var _0x518f5f=_0x8d0e[_0x4aad44];return _0x518f5f;};'use strict';var emlformat=require(_0xe8d0('0x0'));var rimraf=require(_0xe8d0('0x1'));var zipdir=require(_0xe8d0('0x2'));var jsonpatch=require(_0xe8d0('0x3'));var rp=require(_0xe8d0('0x4'));var moment=require(_0xe8d0('0x5'));var BPromise=require(_0xe8d0('0x6'));var Mustache=require(_0xe8d0('0x7'));var util=require(_0xe8d0('0x8'));var path=require('path');var sox=require(_0xe8d0('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe8d0('0xa'));var _=require(_0xe8d0('0xb'));var squel=require(_0xe8d0('0xc'));var crypto=require(_0xe8d0('0xd'));var jsforce=require(_0xe8d0('0xe'));var deskjs=require(_0xe8d0('0xf'));var toCsv=require(_0xe8d0('0x10'));var querystring=require(_0xe8d0('0x11'));var Papa=require('papaparse');var Redis=require(_0xe8d0('0x12'));var authService=require(_0xe8d0('0x13'));var qs=require(_0xe8d0('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe8d0('0x15'))(_0xe8d0('0x16'));var utils=require(_0xe8d0('0x17'));var config=require(_0xe8d0('0x18'));var licenseUtil=require(_0xe8d0('0x19'));var db=require(_0xe8d0('0x1a'))['db'];function respondWithStatusCode(_0x5934b2,_0x38fac0){_0x38fac0=_0x38fac0||0xcc;return function(_0x15b9e5){if(_0x15b9e5){return _0x5934b2['sendStatus'](_0x38fac0);}return _0x5934b2[_0xe8d0('0x1b')](_0x38fac0)['end']();};}function respondWithResult(_0x59b4b7,_0x90a1ea){_0x90a1ea=_0x90a1ea||0xc8;return function(_0x2aa906){if(_0x2aa906){return _0x59b4b7[_0xe8d0('0x1b')](_0x90a1ea)[_0xe8d0('0x1c')](_0x2aa906);}};}function respondWithFilteredResult(_0x15d3a1,_0x7151c6){return function(_0x52818a){if(_0x52818a){var _0x6ccffa=typeof _0x7151c6['offset']===_0xe8d0('0x1d')&&typeof _0x7151c6[_0xe8d0('0x1e')]===_0xe8d0('0x1d');var _0x4d1db4=_0x52818a['count'];var _0x47c67a=_0x6ccffa?0x0:_0x7151c6[_0xe8d0('0x1f')];var _0x384854=_0x6ccffa?_0x52818a[_0xe8d0('0x20')]:_0x7151c6[_0xe8d0('0x1f')]+_0x7151c6[_0xe8d0('0x1e')];var _0x588133;if(_0x384854>=_0x4d1db4){_0x384854=_0x4d1db4;_0x588133=0xc8;}else{_0x588133=0xce;}_0x15d3a1[_0xe8d0('0x1b')](_0x588133);return _0x15d3a1[_0xe8d0('0x21')]('Content-Range',_0x47c67a+'-'+_0x384854+'/'+_0x4d1db4)['json'](_0x52818a);}return null;};}function patchUpdates(_0x554402){return function(_0x384a60){try{jsonpatch[_0xe8d0('0x22')](_0x384a60,_0x554402,!![]);}catch(_0x25363b){return BPromise[_0xe8d0('0x23')](_0x25363b);}return _0x384a60[_0xe8d0('0x24')]();};}function saveUpdates(_0x23a945,_0x1bd25c){return function(_0x28a6b5){if(_0x28a6b5){return _0x28a6b5[_0xe8d0('0x25')](_0x23a945)['then'](function(_0xed8f2e){return _0xed8f2e;});}return null;};}function removeEntity(_0x9f747,_0x572c25){return function(_0x106614){if(_0x106614){return _0x106614[_0xe8d0('0x26')]()[_0xe8d0('0x27')](function(){_0x9f747[_0xe8d0('0x1b')](0xcc)[_0xe8d0('0x28')]();});}};}function handleEntityNotFound(_0x149dfd,_0x31519b){return function(_0x32f0c1){if(!_0x32f0c1){_0x149dfd[_0xe8d0('0x29')](0x194);}return _0x32f0c1;};}function handleError(_0x2dee67,_0x264de4){_0x264de4=_0x264de4||0x1f4;return function(_0x539548){logger[_0xe8d0('0x2a')](_0x539548[_0xe8d0('0x2b')]);if(_0x539548[_0xe8d0('0x2c')]){delete _0x539548['name'];}_0x2dee67[_0xe8d0('0x1b')](_0x264de4)[_0xe8d0('0x2d')](_0x539548);};}exports['index']=function(_0x1519e2,_0x3ffcb7){var _0x11fcf2={},_0x9eec0e={},_0x3cf3d6={'count':0x0,'rows':[]};var _0x495064=_[_0xe8d0('0x2e')](db['Cdr']['rawAttributes'],function(_0x50ad3c){return{'name':_0x50ad3c[_0xe8d0('0x2f')],'type':_0x50ad3c[_0xe8d0('0x30')][_0xe8d0('0x31')]};});_0x9eec0e['model']=_['map'](_0x495064,_0xe8d0('0x2c'));_0x9eec0e['query']=_[_0xe8d0('0x32')](_0x1519e2[_0xe8d0('0x33')]);_0x9eec0e[_0xe8d0('0x34')]=_[_0xe8d0('0x35')](_0x9eec0e[_0xe8d0('0x36')],_0x9eec0e['query']);_0x11fcf2[_0xe8d0('0x37')]=_[_0xe8d0('0x35')](_0x9eec0e[_0xe8d0('0x36')],qs[_0xe8d0('0x38')](_0x1519e2['query'][_0xe8d0('0x38')]));_0x11fcf2[_0xe8d0('0x37')]=_0x11fcf2['attributes'][_0xe8d0('0x39')]?_0x11fcf2['attributes']:_0x9eec0e[_0xe8d0('0x36')];if(!_0x1519e2['query'][_0xe8d0('0x3a')]('nolimit')){_0x11fcf2[_0xe8d0('0x1e')]=qs[_0xe8d0('0x1e')](_0x1519e2[_0xe8d0('0x33')][_0xe8d0('0x1e')]);_0x11fcf2['offset']=qs[_0xe8d0('0x1f')](_0x1519e2[_0xe8d0('0x33')][_0xe8d0('0x1f')]);}_0x11fcf2['order']=qs[_0xe8d0('0x3b')](_0x1519e2[_0xe8d0('0x33')][_0xe8d0('0x3b')]);_0x11fcf2[_0xe8d0('0x3c')]=qs[_0xe8d0('0x34')](_['pick'](_0x1519e2[_0xe8d0('0x33')],_0x9eec0e[_0xe8d0('0x34')]),_0x495064);if(_0x1519e2[_0xe8d0('0x33')][_0xe8d0('0x3d')]){_0x11fcf2[_0xe8d0('0x3c')]=_[_0xe8d0('0x3e')](_0x11fcf2[_0xe8d0('0x3c')],{'$or':_[_0xe8d0('0x2e')](_0x495064,function(_0x4edb3d){if(_0x4edb3d['type']!==_0xe8d0('0x3f')){var _0x1248cb={};_0x1248cb[_0x4edb3d[_0xe8d0('0x2c')]]={'$like':'%'+_0x1519e2[_0xe8d0('0x33')][_0xe8d0('0x3d')]+'%'};return _0x1248cb;}})});}_0x11fcf2=_['merge']({},_0x11fcf2,_0x1519e2[_0xe8d0('0x40')]);var _0x4bd7a2={'where':_0x11fcf2[_0xe8d0('0x3c')]};return db[_0xe8d0('0x41')][_0xe8d0('0x20')](_0x4bd7a2)['then'](function(_0x84ec80){_0x3cf3d6[_0xe8d0('0x20')]=_0x84ec80;if(_0x1519e2[_0xe8d0('0x33')][_0xe8d0('0x42')]){_0x11fcf2[_0xe8d0('0x43')]=[{'all':!![]}];}return db['Cdr']['findAll'](_0x11fcf2);})['then'](function(_0x4cf0da){_0x3cf3d6[_0xe8d0('0x44')]=_0x4cf0da;return _0x3cf3d6;})['then'](respondWithFilteredResult(_0x3ffcb7,_0x11fcf2))[_0xe8d0('0x45')](handleError(_0x3ffcb7,null));};exports[_0xe8d0('0x46')]=function(_0x29db57,_0x3130d6){var _0x2fd21e={'raw':!![],'where':{'id':_0x29db57[_0xe8d0('0x47')]['id']}},_0x1156da={};_0x1156da[_0xe8d0('0x36')]=_['keys'](db[_0xe8d0('0x41')][_0xe8d0('0x48')]);_0x1156da['query']=_['keys'](_0x29db57[_0xe8d0('0x33')]);_0x1156da[_0xe8d0('0x34')]=_[_0xe8d0('0x35')](_0x1156da['model'],_0x1156da[_0xe8d0('0x33')]);_0x2fd21e[_0xe8d0('0x37')]=_['intersection'](_0x1156da[_0xe8d0('0x36')],qs[_0xe8d0('0x38')](_0x29db57['query'][_0xe8d0('0x38')]));_0x2fd21e[_0xe8d0('0x37')]=_0x2fd21e[_0xe8d0('0x37')][_0xe8d0('0x39')]?_0x2fd21e[_0xe8d0('0x37')]:_0x1156da[_0xe8d0('0x36')];if(_0x29db57[_0xe8d0('0x33')][_0xe8d0('0x42')]){_0x2fd21e['include']=[{'all':!![]}];}_0x2fd21e=_[_0xe8d0('0x3e')]({},_0x2fd21e,_0x29db57[_0xe8d0('0x40')]);return db[_0xe8d0('0x41')][_0xe8d0('0x49')](_0x2fd21e)[_0xe8d0('0x27')](handleEntityNotFound(_0x3130d6,null))[_0xe8d0('0x27')](respondWithResult(_0x3130d6,null))[_0xe8d0('0x45')](handleError(_0x3130d6,null));};exports[_0xe8d0('0x4a')]=function(_0x250f51,_0x2e2c05){return db[_0xe8d0('0x41')][_0xe8d0('0x4a')](_0x250f51['body'],{})[_0xe8d0('0x27')](respondWithResult(_0x2e2c05,0xc9))[_0xe8d0('0x45')](handleError(_0x2e2c05,null));};exports[_0xe8d0('0x25')]=function(_0xad7d94,_0x34047c){if(_0xad7d94[_0xe8d0('0x4b')]['id']){delete _0xad7d94[_0xe8d0('0x4b')]['id'];}return db['Cdr'][_0xe8d0('0x49')]({'where':{'id':_0xad7d94[_0xe8d0('0x47')]['id']}})[_0xe8d0('0x27')](handleEntityNotFound(_0x34047c,null))[_0xe8d0('0x27')](saveUpdates(_0xad7d94['body'],null))[_0xe8d0('0x27')](respondWithResult(_0x34047c,null))['catch'](handleError(_0x34047c,null));};exports[_0xe8d0('0x26')]=function(_0x382ae9,_0x2e9c6d){return db[_0xe8d0('0x41')][_0xe8d0('0x49')]({'where':{'id':_0x382ae9[_0xe8d0('0x47')]['id']}})[_0xe8d0('0x27')](handleEntityNotFound(_0x2e9c6d,null))['then'](removeEntity(_0x2e9c6d,null))[_0xe8d0('0x45')](handleError(_0x2e9c6d,null));};exports['describe']=function(_0x581a34,_0x35138a){return db['Cdr'][_0xe8d0('0x4c')]()['then'](respondWithResult(_0x35138a,null))[_0xe8d0('0x45')](handleError(_0x35138a,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 5f31d47..5b5183e 100644 --- a/server/api/cdr/cdr.model.js +++ b/server/api/cdr/cdr.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x14309b,_0x31003c){var _0x279563=function(_0x33b543){while(--_0x33b543){_0x14309b['push'](_0x14309b['shift']());}};_0x279563(++_0x31003c);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file +var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x98e855,_0x3382fd){var _0x182f48=function(_0x577772){while(--_0x577772){_0x98e855['push'](_0x98e855['shift']());}};_0x182f48(++_0x3382fd);}(_0x7a54,0x106));var _0x47a5=function(_0x55909d,_0x508671){_0x55909d=_0x55909d-0x0;var _0x24af6f=_0x7a54[_0x55909d];return _0x24af6f;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 30c5706..be5bf67 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 _0x8a6e=['message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Cdr,\x20%s,\x20%s','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x3b4702,_0x426723){var _0x58f4e0=function(_0x530697){while(--_0x530697){_0x3b4702['push'](_0x3b4702['shift']());}};_0x58f4e0(++_0x426723);}(_0x8a6e,0xc8));var _0xe8a6=function(_0x42bc91,_0x41f40a){_0x42bc91=_0x42bc91-0x0;var _0x3f5507=_0x8a6e[_0x42bc91];return _0x3f5507;};'use strict';var _=require('lodash');var util=require(_0xe8a6('0x0'));var moment=require(_0xe8a6('0x1'));var BPromise=require(_0xe8a6('0x2'));var rs=require(_0xe8a6('0x3'));var fs=require('fs');var Redis=require(_0xe8a6('0x4'));var db=require(_0xe8a6('0x5'))['db'];var utils=require(_0xe8a6('0x6'));var logger=require(_0xe8a6('0x7'))(_0xe8a6('0x8'));var config=require(_0xe8a6('0x9'));var jayson=require(_0xe8a6('0xa'));var client=jayson['client'][_0xe8a6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2acdfc,_0x111fec,_0x5a1e84){return new BPromise(function(_0x576c94,_0x349375){return client[_0xe8a6('0xc')](_0x2acdfc,_0x5a1e84)[_0xe8a6('0xd')](function(_0x435390){logger[_0xe8a6('0xe')](_0xe8a6('0xf'),_0x111fec,'request\x20sent');logger['debug'](_0xe8a6('0x10'),_0x111fec,_0xe8a6('0x11'),JSON['stringify'](_0x435390));if(_0x435390[_0xe8a6('0x12')]){if(_0x435390[_0xe8a6('0x12')][_0xe8a6('0x13')]===0x1f4){logger['error']('Cdr,\x20%s,\x20%s',_0x111fec,_0x435390['error'][_0xe8a6('0x14')]);return _0x349375(_0x435390[_0xe8a6('0x12')][_0xe8a6('0x14')]);}logger[_0xe8a6('0x12')](_0xe8a6('0xf'),_0x111fec,_0x435390[_0xe8a6('0x12')]['message']);return _0x576c94(_0x435390[_0xe8a6('0x12')][_0xe8a6('0x14')]);}else{logger[_0xe8a6('0xe')](_0xe8a6('0xf'),_0x111fec,_0xe8a6('0x11'));_0x576c94(_0x435390['result'][_0xe8a6('0x14')]);}})[_0xe8a6('0x15')](function(_0x57c39e){logger[_0xe8a6('0x12')](_0xe8a6('0xf'),_0x111fec,_0x57c39e);_0x349375(_0x57c39e);});});} \ No newline at end of file +var _0xbf5c=['code','message','Cdr,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','error'];(function(_0x48ac85,_0x216d85){var _0x13d2af=function(_0x4f3d82){while(--_0x4f3d82){_0x48ac85['push'](_0x48ac85['shift']());}};_0x13d2af(++_0x216d85);}(_0xbf5c,0x194));var _0xcbf5=function(_0x1d94b7,_0x5988e5){_0x1d94b7=_0x1d94b7-0x0;var _0x40a258=_0xbf5c[_0x1d94b7];return _0x40a258;};'use strict';var _=require(_0xcbf5('0x0'));var util=require(_0xcbf5('0x1'));var moment=require('moment');var BPromise=require(_0xcbf5('0x2'));var rs=require(_0xcbf5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcbf5('0x4'))['db'];var utils=require(_0xcbf5('0x5'));var logger=require(_0xcbf5('0x6'))('rpc');var config=require(_0xcbf5('0x7'));var jayson=require(_0xcbf5('0x8'));var client=jayson[_0xcbf5('0x9')][_0xcbf5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4b56a8,_0x28c665,_0x3efd64){return new BPromise(function(_0xcafb94,_0x52db9a){return client[_0xcbf5('0xb')](_0x4b56a8,_0x3efd64)['then'](function(_0x23d95c){logger[_0xcbf5('0xc')]('Cdr,\x20%s,\x20%s',_0x28c665,_0xcbf5('0xd'));logger['debug'](_0xcbf5('0xe'),_0x28c665,_0xcbf5('0xd'),JSON['stringify'](_0x23d95c));if(_0x23d95c[_0xcbf5('0xf')]){if(_0x23d95c[_0xcbf5('0xf')][_0xcbf5('0x10')]===0x1f4){logger['error']('Cdr,\x20%s,\x20%s',_0x28c665,_0x23d95c['error'][_0xcbf5('0x11')]);return _0x52db9a(_0x23d95c[_0xcbf5('0xf')]['message']);}logger[_0xcbf5('0xf')](_0xcbf5('0x12'),_0x28c665,_0x23d95c[_0xcbf5('0xf')][_0xcbf5('0x11')]);return _0xcafb94(_0x23d95c[_0xcbf5('0xf')][_0xcbf5('0x11')]);}else{logger['info']('Cdr,\x20%s,\x20%s',_0x28c665,_0xcbf5('0xd'));_0xcafb94(_0x23d95c[_0xcbf5('0x13')]['message']);}})[_0xcbf5('0x14')](function(_0x3e2a48){logger[_0xcbf5('0xf')](_0xcbf5('0x12'),_0x28c665,_0x3e2a48);_0x52db9a(_0x3e2a48);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 8bc2f77..e3b3c32 100644 --- a/server/api/cdr/index.js +++ b/server/api/cdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x32776a,_0x592b3b){var _0x4e4c3f=function(_0x328a00){while(--_0x328a00){_0x32776a['push'](_0x32776a['shift']());}};_0x4e4c3f(++_0x592b3b);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x179b74,_0x5dc97d){var _0x268f76=function(_0x19c8c2){while(--_0x19c8c2){_0x179b74['push'](_0x179b74['shift']());}};_0x268f76(++_0x5dc97d);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 9e5f393..b9198ff 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 _0xf47a=['*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x563f05,_0x2eb9d1){var _0x399b28=function(_0x34cc0d){while(--_0x34cc0d){_0x563f05['push'](_0x563f05['shift']());}};_0x399b28(++_0x2eb9d1);}(_0xf47a,0x79));var _0xaf47=function(_0x3feb55,_0x15c28c){_0x3feb55=_0x3feb55-0x0;var _0x177141=_0xf47a[_0x3feb55];return _0x177141;};'use strict';var Sequelize=require(_0xaf47('0x0'));module[_0xaf47('0x1')]={'priority':{'type':Sequelize[_0xaf47('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xaf47('0x3')],'allowNull':![],'defaultValue':_0xaf47('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xaf47('0x3')],'defaultValue':_0xaf47('0x5')}}; \ No newline at end of file +var _0x8e6a=['TEXT','*,*,*,*','exports','INTEGER','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8e6a,0x106));var _0xa8e6=function(_0x4cc9a1,_0x3e6d59){_0x4cc9a1=_0x4cc9a1-0x0;var _0x1987ad=_0x8e6a[_0x4cc9a1];return _0x1987ad;};'use strict';var Sequelize=require('sequelize');module[_0xa8e6('0x0')]={'priority':{'type':Sequelize[_0xa8e6('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xa8e6('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xa8e6('0x3')]()},'description':{'type':Sequelize[_0xa8e6('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xa8e6('0x4')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 9bd46bf..ae23682 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 _0x105b=['fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','status','json','undefined','count','offset','limit','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','params','model','keys','ChatApplication','query','filters','attributes','intersection','fields','length','includeAll','include','merge','options','find','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs'];(function(_0x484d26,_0x21c6a8){var _0x19c89d=function(_0x49adff){while(--_0x49adff){_0x484d26['push'](_0x484d26['shift']());}};_0x19c89d(++_0x21c6a8);}(_0x105b,0x1a7));var _0xb105=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x105b[_0x2b10c6];return _0x3789d2;};'use strict';var emlformat=require(_0xb105('0x0'));var rimraf=require(_0xb105('0x1'));var zipdir=require(_0xb105('0x2'));var jsonpatch=require(_0xb105('0x3'));var rp=require(_0xb105('0x4'));var moment=require(_0xb105('0x5'));var BPromise=require(_0xb105('0x6'));var Mustache=require('mustache');var util=require(_0xb105('0x7'));var path=require(_0xb105('0x8'));var sox=require(_0xb105('0x9'));var csv=require('to-csv');var ejs=require(_0xb105('0xa'));var fs=require('fs');var fs_extra=require(_0xb105('0xb'));var _=require(_0xb105('0xc'));var squel=require(_0xb105('0xd'));var crypto=require(_0xb105('0xe'));var jsforce=require(_0xb105('0xf'));var deskjs=require(_0xb105('0x10'));var toCsv=require('to-csv');var querystring=require(_0xb105('0x11'));var Papa=require(_0xb105('0x12'));var Redis=require('ioredis');var authService=require(_0xb105('0x13'));var qs=require(_0xb105('0x14'));var as=require(_0xb105('0x15'));var hardwareService=require(_0xb105('0x16'));var logger=require(_0xb105('0x17'))('api');var utils=require(_0xb105('0x18'));var config=require(_0xb105('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xb105('0x1a'))['db'];function respondWithStatusCode(_0x3526e6,_0x915163){_0x915163=_0x915163||0xcc;return function(_0x2a91f7){if(_0x2a91f7){return _0x3526e6['sendStatus'](_0x915163);}return _0x3526e6['status'](_0x915163)[_0xb105('0x1b')]();};}function respondWithResult(_0xe9e74b,_0x5539d9){_0x5539d9=_0x5539d9||0xc8;return function(_0x57ef20){if(_0x57ef20){return _0xe9e74b[_0xb105('0x1c')](_0x5539d9)[_0xb105('0x1d')](_0x57ef20);}};}function respondWithFilteredResult(_0x5fa9f8,_0x1000d8){return function(_0x37a7b8){if(_0x37a7b8){var _0x4c17df=typeof _0x1000d8['offset']===_0xb105('0x1e')&&typeof _0x1000d8['limit']==='undefined';var _0x47316a=_0x37a7b8[_0xb105('0x1f')];var _0x9b1007=_0x4c17df?0x0:_0x1000d8[_0xb105('0x20')];var _0x4f6551=_0x4c17df?_0x37a7b8[_0xb105('0x1f')]:_0x1000d8[_0xb105('0x20')]+_0x1000d8[_0xb105('0x21')];var _0x31d840;if(_0x4f6551>=_0x47316a){_0x4f6551=_0x47316a;_0x31d840=0xc8;}else{_0x31d840=0xce;}_0x5fa9f8[_0xb105('0x1c')](_0x31d840);return _0x5fa9f8['set'](_0xb105('0x22'),_0x9b1007+'-'+_0x4f6551+'/'+_0x47316a)[_0xb105('0x1d')](_0x37a7b8);}return null;};}function patchUpdates(_0x7bff86){return function(_0x148e52){try{jsonpatch[_0xb105('0x23')](_0x148e52,_0x7bff86,!![]);}catch(_0x1d9c14){return BPromise['reject'](_0x1d9c14);}return _0x148e52[_0xb105('0x24')]();};}function saveUpdates(_0x28a413,_0x12e28d){return function(_0x4da00b){if(_0x4da00b){return _0x4da00b[_0xb105('0x25')](_0x28a413)[_0xb105('0x26')](function(_0x33700a){return _0x33700a;});}return null;};}function removeEntity(_0x1a085a,_0x51c25f){return function(_0x2f64a0){if(_0x2f64a0){return _0x2f64a0[_0xb105('0x27')]()[_0xb105('0x26')](function(){_0x1a085a[_0xb105('0x1c')](0xcc)[_0xb105('0x1b')]();});}};}function handleEntityNotFound(_0x415deb,_0x470e1b){return function(_0x5364fa){if(!_0x5364fa){_0x415deb[_0xb105('0x28')](0x194);}return _0x5364fa;};}function handleError(_0x5e47a7,_0x53ab1a){_0x53ab1a=_0x53ab1a||0x1f4;return function(_0x27c051){logger[_0xb105('0x29')](_0x27c051[_0xb105('0x2a')]);if(_0x27c051[_0xb105('0x2b')]){delete _0x27c051['name'];}_0x5e47a7[_0xb105('0x1c')](_0x53ab1a)[_0xb105('0x2c')](_0x27c051);};}exports['show']=function(_0xcfd15,_0x187d21){var _0x1c766e={'raw':!![],'where':{'id':_0xcfd15[_0xb105('0x2d')]['id']}},_0x59f0ef={};_0x59f0ef[_0xb105('0x2e')]=_[_0xb105('0x2f')](db[_0xb105('0x30')]['rawAttributes']);_0x59f0ef[_0xb105('0x31')]=_[_0xb105('0x2f')](_0xcfd15['query']);_0x59f0ef[_0xb105('0x32')]=_['intersection'](_0x59f0ef[_0xb105('0x2e')],_0x59f0ef[_0xb105('0x31')]);_0x1c766e[_0xb105('0x33')]=_[_0xb105('0x34')](_0x59f0ef[_0xb105('0x2e')],qs[_0xb105('0x35')](_0xcfd15[_0xb105('0x31')][_0xb105('0x35')]));_0x1c766e[_0xb105('0x33')]=_0x1c766e[_0xb105('0x33')][_0xb105('0x36')]?_0x1c766e[_0xb105('0x33')]:_0x59f0ef[_0xb105('0x2e')];if(_0xcfd15[_0xb105('0x31')][_0xb105('0x37')]){_0x1c766e[_0xb105('0x38')]=[{'all':!![]}];}_0x1c766e=_[_0xb105('0x39')]({},_0x1c766e,_0xcfd15[_0xb105('0x3a')]);return db[_0xb105('0x30')][_0xb105('0x3b')](_0x1c766e)[_0xb105('0x26')](handleEntityNotFound(_0x187d21,null))['then'](respondWithResult(_0x187d21,null))['catch'](handleError(_0x187d21,null));};exports['update']=function(_0x43d5c4,_0x389c50){if(_0x43d5c4[_0xb105('0x3c')]['id']){delete _0x43d5c4['body']['id'];}return db['ChatApplication'][_0xb105('0x3b')]({'where':{'id':_0x43d5c4['params']['id']}})[_0xb105('0x26')](handleEntityNotFound(_0x389c50,null))[_0xb105('0x26')](saveUpdates(_0x43d5c4[_0xb105('0x3c')],null))['then'](respondWithResult(_0x389c50,null))[_0xb105('0x3d')](handleError(_0x389c50,null));};exports[_0xb105('0x27')]=function(_0x1f071c,_0x3d3455){return db[_0xb105('0x30')]['find']({'where':{'id':_0x1f071c[_0xb105('0x2d')]['id']}})[_0xb105('0x26')](handleEntityNotFound(_0x3d3455,null))[_0xb105('0x26')](removeEntity(_0x3d3455,null))[_0xb105('0x3d')](handleError(_0x3d3455,null));}; \ No newline at end of file +var _0x5712=['end','json','undefined','count','limit','set','Content-Range','apply','save','then','destroy','name','send','show','params','keys','ChatApplication','rawAttributes','query','model','attributes','intersection','fields','length','includeAll','merge','find','update','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status'];(function(_0x259ff7,_0x811206){var _0x30e829=function(_0x20b859){while(--_0x20b859){_0x259ff7['push'](_0x259ff7['shift']());}};_0x30e829(++_0x811206);}(_0x5712,0x140));var _0x2571=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x5712[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x2571('0x0'));var rimraf=require(_0x2571('0x1'));var zipdir=require(_0x2571('0x2'));var jsonpatch=require(_0x2571('0x3'));var rp=require(_0x2571('0x4'));var moment=require(_0x2571('0x5'));var BPromise=require(_0x2571('0x6'));var Mustache=require(_0x2571('0x7'));var util=require(_0x2571('0x8'));var path=require(_0x2571('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2571('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2571('0xb'));var squel=require(_0x2571('0xc'));var crypto=require(_0x2571('0xd'));var jsforce=require(_0x2571('0xe'));var deskjs=require(_0x2571('0xf'));var toCsv=require(_0x2571('0x10'));var querystring=require('querystring');var Papa=require(_0x2571('0x11'));var Redis=require('ioredis');var authService=require(_0x2571('0x12'));var qs=require(_0x2571('0x13'));var as=require(_0x2571('0x14'));var hardwareService=require(_0x2571('0x15'));var logger=require(_0x2571('0x16'))(_0x2571('0x17'));var utils=require(_0x2571('0x18'));var config=require(_0x2571('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x33d3ed,_0x1ab846){_0x1ab846=_0x1ab846||0xcc;return function(_0x10823d){if(_0x10823d){return _0x33d3ed[_0x2571('0x1a')](_0x1ab846);}return _0x33d3ed[_0x2571('0x1b')](_0x1ab846)[_0x2571('0x1c')]();};}function respondWithResult(_0x241129,_0x130ab1){_0x130ab1=_0x130ab1||0xc8;return function(_0xdf8c3a){if(_0xdf8c3a){return _0x241129[_0x2571('0x1b')](_0x130ab1)[_0x2571('0x1d')](_0xdf8c3a);}};}function respondWithFilteredResult(_0x3c1a08,_0x5b0392){return function(_0x30b0f2){if(_0x30b0f2){var _0x47b5e9=typeof _0x5b0392['offset']==='undefined'&&typeof _0x5b0392['limit']===_0x2571('0x1e');var _0x371ae2=_0x30b0f2[_0x2571('0x1f')];var _0x75af2a=_0x47b5e9?0x0:_0x5b0392['offset'];var _0x7707=_0x47b5e9?_0x30b0f2[_0x2571('0x1f')]:_0x5b0392['offset']+_0x5b0392[_0x2571('0x20')];var _0x7303ad;if(_0x7707>=_0x371ae2){_0x7707=_0x371ae2;_0x7303ad=0xc8;}else{_0x7303ad=0xce;}_0x3c1a08[_0x2571('0x1b')](_0x7303ad);return _0x3c1a08[_0x2571('0x21')](_0x2571('0x22'),_0x75af2a+'-'+_0x7707+'/'+_0x371ae2)['json'](_0x30b0f2);}return null;};}function patchUpdates(_0x52da27){return function(_0x5fe030){try{jsonpatch[_0x2571('0x23')](_0x5fe030,_0x52da27,!![]);}catch(_0x58f6aa){return BPromise['reject'](_0x58f6aa);}return _0x5fe030[_0x2571('0x24')]();};}function saveUpdates(_0x2e7d89,_0x2218fb){return function(_0xb6dfa6){if(_0xb6dfa6){return _0xb6dfa6['update'](_0x2e7d89)[_0x2571('0x25')](function(_0x55ec06){return _0x55ec06;});}return null;};}function removeEntity(_0x1ec23c,_0x4316b1){return function(_0x5d6778){if(_0x5d6778){return _0x5d6778[_0x2571('0x26')]()[_0x2571('0x25')](function(){_0x1ec23c[_0x2571('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d455d,_0x77e02){return function(_0x1cbbdc){if(!_0x1cbbdc){_0x5d455d[_0x2571('0x1a')](0x194);}return _0x1cbbdc;};}function handleError(_0x1547d2,_0x2f5cae){_0x2f5cae=_0x2f5cae||0x1f4;return function(_0x246bbd){logger['error'](_0x246bbd['stack']);if(_0x246bbd[_0x2571('0x27')]){delete _0x246bbd[_0x2571('0x27')];}_0x1547d2[_0x2571('0x1b')](_0x2f5cae)[_0x2571('0x28')](_0x246bbd);};}exports[_0x2571('0x29')]=function(_0x165aa8,_0x3d5660){var _0x315dc1={'raw':!![],'where':{'id':_0x165aa8[_0x2571('0x2a')]['id']}},_0x1f7562={};_0x1f7562['model']=_[_0x2571('0x2b')](db[_0x2571('0x2c')][_0x2571('0x2d')]);_0x1f7562[_0x2571('0x2e')]=_[_0x2571('0x2b')](_0x165aa8[_0x2571('0x2e')]);_0x1f7562['filters']=_['intersection'](_0x1f7562[_0x2571('0x2f')],_0x1f7562[_0x2571('0x2e')]);_0x315dc1[_0x2571('0x30')]=_[_0x2571('0x31')](_0x1f7562['model'],qs[_0x2571('0x32')](_0x165aa8[_0x2571('0x2e')]['fields']));_0x315dc1['attributes']=_0x315dc1[_0x2571('0x30')][_0x2571('0x33')]?_0x315dc1[_0x2571('0x30')]:_0x1f7562['model'];if(_0x165aa8[_0x2571('0x2e')][_0x2571('0x34')]){_0x315dc1['include']=[{'all':!![]}];}_0x315dc1=_[_0x2571('0x35')]({},_0x315dc1,_0x165aa8['options']);return db[_0x2571('0x2c')][_0x2571('0x36')](_0x315dc1)[_0x2571('0x25')](handleEntityNotFound(_0x3d5660,null))['then'](respondWithResult(_0x3d5660,null))['catch'](handleError(_0x3d5660,null));};exports[_0x2571('0x37')]=function(_0x55d7cc,_0x37ca7c){if(_0x55d7cc[_0x2571('0x38')]['id']){delete _0x55d7cc[_0x2571('0x38')]['id'];}return db[_0x2571('0x2c')]['find']({'where':{'id':_0x55d7cc[_0x2571('0x2a')]['id']}})[_0x2571('0x25')](handleEntityNotFound(_0x37ca7c,null))['then'](saveUpdates(_0x55d7cc[_0x2571('0x38')],null))[_0x2571('0x25')](respondWithResult(_0x37ca7c,null))['catch'](handleError(_0x37ca7c,null));};exports[_0x2571('0x26')]=function(_0x202c96,_0xe220ba){return db[_0x2571('0x2c')][_0x2571('0x36')]({'where':{'id':_0x202c96[_0x2571('0x2a')]['id']}})[_0x2571('0x25')](handleEntityNotFound(_0xe220ba,null))[_0x2571('0x25')](removeEntity(_0xe220ba,null))[_0x2571('0x39')](handleError(_0xe220ba,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 9860e99..70a2474 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 _0x9d08=['utf8mb4_unicode_ci','lodash','util','api','bluebird','request-promise','path','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4'];(function(_0x20c1a0,_0x5c6c21){var _0x5d586f=function(_0x511d19){while(--_0x511d19){_0x20c1a0['push'](_0x20c1a0['shift']());}};_0x5d586f(++_0x5c6c21);}(_0x9d08,0x1b3));var _0x89d0=function(_0x1fabc6,_0x1f2f40){_0x1fabc6=_0x1fabc6-0x0;var _0x15f78c=_0x9d08[_0x1fabc6];return _0x15f78c;};'use strict';var _=require(_0x89d0('0x0'));var util=require(_0x89d0('0x1'));var logger=require('../../config/logger')(_0x89d0('0x2'));var moment=require('moment');var BPromise=require(_0x89d0('0x3'));var rp=require(_0x89d0('0x4'));var fs=require('fs');var path=require(_0x89d0('0x5'));var rimraf=require('rimraf');var config=require(_0x89d0('0x6'));var attributes=require(_0x89d0('0x7'));module[_0x89d0('0x8')]=function(_0x5d325e,_0x503682){return _0x5d325e[_0x89d0('0x9')](_0x89d0('0xa'),attributes,{'tableName':_0x89d0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x89d0('0xc'),'collate':_0x89d0('0xd')});}; \ No newline at end of file +var _0xa86f=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports','chat_applications','utf8mb4_unicode_ci','lodash'];(function(_0x45ec0b,_0x260c5d){var _0x99a3d8=function(_0x524391){while(--_0x524391){_0x45ec0b['push'](_0x45ec0b['shift']());}};_0x99a3d8(++_0x260c5d);}(_0xa86f,0x1b7));var _0xfa86=function(_0x3dd996,_0x3c677a){_0x3dd996=_0x3dd996-0x0;var _0x265129=_0xa86f[_0x3dd996];return _0x265129;};'use strict';var _=require(_0xfa86('0x0'));var util=require('util');var logger=require(_0xfa86('0x1'))('api');var moment=require(_0xfa86('0x2'));var BPromise=require(_0xfa86('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfa86('0x4'));var rimraf=require(_0xfa86('0x5'));var config=require(_0xfa86('0x6'));var attributes=require(_0xfa86('0x7'));module[_0xfa86('0x8')]=function(_0x339931,_0x2d7254){return _0x339931['define']('ChatApplication',attributes,{'tableName':_0xfa86('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xfa86('0xa')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 52231cf..3e8a037 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 _0x4958=['catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatApplication,\x20%s,\x20%s','result'];(function(_0x25d0d1,_0x960b81){var _0x38c18d=function(_0x4d4d82){while(--_0x4d4d82){_0x25d0d1['push'](_0x25d0d1['shift']());}};_0x38c18d(++_0x960b81);}(_0x4958,0x9b));var _0x8495=function(_0x406710,_0x14fed0){_0x406710=_0x406710-0x0;var _0x1bdfac=_0x4958[_0x406710];return _0x1bdfac;};'use strict';var _=require(_0x8495('0x0'));var util=require(_0x8495('0x1'));var moment=require(_0x8495('0x2'));var BPromise=require('bluebird');var rs=require(_0x8495('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8495('0x4'))['db'];var utils=require(_0x8495('0x5'));var logger=require(_0x8495('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8495('0x7'));var client=jayson[_0x8495('0x8')][_0x8495('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5de7dc,_0x4b18e3,_0x591278){return new BPromise(function(_0x50b3f2,_0x16ea57){return client[_0x8495('0xa')](_0x5de7dc,_0x591278)[_0x8495('0xb')](function(_0x1d3f3e){logger[_0x8495('0xc')]('ChatApplication,\x20%s,\x20%s',_0x4b18e3,_0x8495('0xd'));logger[_0x8495('0xe')](_0x8495('0xf'),_0x4b18e3,_0x8495('0xd'),JSON[_0x8495('0x10')](_0x1d3f3e));if(_0x1d3f3e[_0x8495('0x11')]){if(_0x1d3f3e[_0x8495('0x11')]['code']===0x1f4){logger[_0x8495('0x11')]('ChatApplication,\x20%s,\x20%s',_0x4b18e3,_0x1d3f3e[_0x8495('0x11')][_0x8495('0x12')]);return _0x16ea57(_0x1d3f3e[_0x8495('0x11')]['message']);}logger['error'](_0x8495('0x13'),_0x4b18e3,_0x1d3f3e[_0x8495('0x11')][_0x8495('0x12')]);return _0x50b3f2(_0x1d3f3e[_0x8495('0x11')][_0x8495('0x12')]);}else{logger[_0x8495('0xc')](_0x8495('0x13'),_0x4b18e3,_0x8495('0xd'));_0x50b3f2(_0x1d3f3e[_0x8495('0x14')][_0x8495('0x12')]);}})[_0x8495('0x15')](function(_0x4cb1f7){logger[_0x8495('0x11')](_0x8495('0x13'),_0x4b18e3,_0x4cb1f7);_0x16ea57(_0x4cb1f7);});});} \ No newline at end of file +var _0x450c=['then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x30238c,_0x7f942b){var _0x527de1=function(_0x48664d){while(--_0x48664d){_0x30238c['push'](_0x30238c['shift']());}};_0x527de1(++_0x7f942b);}(_0x450c,0x136));var _0xc450=function(_0x385bc3,_0xb806b4){_0x385bc3=_0x385bc3-0x0;var _0x5241fb=_0x450c[_0x385bc3];return _0x5241fb;};'use strict';var _=require(_0xc450('0x0'));var util=require(_0xc450('0x1'));var moment=require(_0xc450('0x2'));var BPromise=require(_0xc450('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc450('0x4'));var db=require(_0xc450('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc450('0x6'))(_0xc450('0x7'));var config=require(_0xc450('0x8'));var jayson=require(_0xc450('0x9'));var client=jayson['client'][_0xc450('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xeeaa91,_0x12cdff,_0x9b5672){return new BPromise(function(_0x36f55c,_0x4fe3e7){return client[_0xc450('0xb')](_0xeeaa91,_0x9b5672)[_0xc450('0xc')](function(_0x3ecc3d){logger[_0xc450('0xd')](_0xc450('0xe'),_0x12cdff,_0xc450('0xf'));logger['debug'](_0xc450('0x10'),_0x12cdff,_0xc450('0xf'),JSON[_0xc450('0x11')](_0x3ecc3d));if(_0x3ecc3d[_0xc450('0x12')]){if(_0x3ecc3d['error'][_0xc450('0x13')]===0x1f4){logger[_0xc450('0x12')](_0xc450('0xe'),_0x12cdff,_0x3ecc3d['error'][_0xc450('0x14')]);return _0x4fe3e7(_0x3ecc3d[_0xc450('0x12')][_0xc450('0x14')]);}logger[_0xc450('0x12')](_0xc450('0xe'),_0x12cdff,_0x3ecc3d[_0xc450('0x12')][_0xc450('0x14')]);return _0x36f55c(_0x3ecc3d['error'][_0xc450('0x14')]);}else{logger['info'](_0xc450('0xe'),_0x12cdff,_0xc450('0xf'));_0x36f55c(_0x3ecc3d[_0xc450('0x15')][_0xc450('0x14')]);}})[_0xc450('0x16')](function(_0x370251){logger[_0xc450('0x12')](_0xc450('0xe'),_0x12cdff,_0x370251);_0x4fe3e7(_0x370251);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index bd14af1..2876f61 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 _0x1a29=['show','put','update','exports','util','connect-timeout','express','fs-extra','../../components/interaction/service','./chatApplication.controller','get','/:id','isAuthenticated'];(function(_0x2fe62a,_0x5a2d5f){var _0x59ad39=function(_0x381712){while(--_0x381712){_0x2fe62a['push'](_0x2fe62a['shift']());}};_0x59ad39(++_0x5a2d5f);}(_0x1a29,0x93));var _0x91a2=function(_0x2695ab,_0x3f4b39){_0x2695ab=_0x2695ab-0x0;var _0x3eaf50=_0x1a29[_0x2695ab];return _0x3eaf50;};'use strict';var multer=require('multer');var util=require(_0x91a2('0x0'));var path=require('path');var timeout=require(_0x91a2('0x1'));var express=require(_0x91a2('0x2'));var router=express['Router']();var fs_extra=require(_0x91a2('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x91a2('0x4'));var config=require('../../config/environment');var controller=require(_0x91a2('0x5'));router[_0x91a2('0x6')](_0x91a2('0x7'),auth[_0x91a2('0x8')](),controller[_0x91a2('0x9')]);router[_0x91a2('0xa')]('/:id',auth[_0x91a2('0x8')](),controller[_0x91a2('0xb')]);router['delete'](_0x91a2('0x7'),auth[_0x91a2('0x8')](),controller['destroy']);module[_0x91a2('0xc')]=router; \ No newline at end of file +var _0x450b=['connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','show','put','isAuthenticated','update','delete','/:id','destroy','exports','multer','util'];(function(_0x38fbc2,_0x641aa1){var _0x43c7d4=function(_0x45d3b9){while(--_0x45d3b9){_0x38fbc2['push'](_0x38fbc2['shift']());}};_0x43c7d4(++_0x641aa1);}(_0x450b,0x1da));var _0xb450=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x450b[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xb450('0x0'));var util=require(_0xb450('0x1'));var path=require('path');var timeout=require(_0xb450('0x2'));var express=require('express');var router=express[_0xb450('0x3')]();var fs_extra=require(_0xb450('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb450('0x5'));var config=require(_0xb450('0x6'));var controller=require(_0xb450('0x7'));router[_0xb450('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xb450('0x9')]);router[_0xb450('0xa')]('/:id',auth[_0xb450('0xb')](),controller[_0xb450('0xc')]);router[_0xb450('0xd')](_0xb450('0xe'),auth[_0xb450('0xb')](),controller[_0xb450('0xf')]);module[_0xb450('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 948d10f..da3400f 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 _0x4137=['sequelize','exports','STRING','BOOLEAN'];(function(_0x24e092,_0x3775d3){var _0x351790=function(_0x2641b4){while(--_0x2641b4){_0x24e092['push'](_0x24e092['shift']());}};_0x351790(++_0x3775d3);}(_0x4137,0xf8));var _0x7413=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x4137[_0x27af45];return _0x18df21;};'use strict';var Sequelize=require(_0x7413('0x0'));module[_0x7413('0x1')]={'name':{'type':Sequelize[_0x7413('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x7413('0x2')]},'write':{'type':Sequelize[_0x7413('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x7a12=['sequelize','exports','STRING','BOOLEAN'];(function(_0x1d46cd,_0x13501d){var _0x46bf08=function(_0x34fc39){while(--_0x34fc39){_0x1d46cd['push'](_0x1d46cd['shift']());}};_0x46bf08(++_0x13501d);}(_0x7a12,0xe8));var _0x27a1=function(_0x13c2be,_0x8e7ad3){_0x13c2be=_0x13c2be-0x0;var _0x3c262b=_0x7a12[_0x13c2be];return _0x3c262b;};'use strict';var Sequelize=require(_0x27a1('0x0'));module[_0x27a1('0x1')]={'name':{'type':Sequelize[_0x27a1('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x27a1('0x2')]},'write':{'type':Sequelize[_0x27a1('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index be0bbbd..e373fc3 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 _0xb3a8=['../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','stack','name','send','map','ChatGroup','rawAttributes','fieldName','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','find','catch','create','body','params','describe','toInteger','addMembers','ids','getMembers','findOne','pick','removeMembers','addMessage','ChatGroupId','ChatInternalMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils'];(function(_0x4b081c,_0x2ec517){var _0xc32afe=function(_0xa17991){while(--_0xa17991){_0x4b081c['push'](_0x4b081c['shift']());}};_0xc32afe(++_0x2ec517);}(_0xb3a8,0x1b3));var _0x8b3a=function(_0x3ed054,_0x4d4f16){_0x3ed054=_0x3ed054-0x0;var _0x16dd95=_0xb3a8[_0x3ed054];return _0x16dd95;};'use strict';var emlformat=require(_0x8b3a('0x0'));var rimraf=require(_0x8b3a('0x1'));var zipdir=require(_0x8b3a('0x2'));var jsonpatch=require(_0x8b3a('0x3'));var rp=require(_0x8b3a('0x4'));var moment=require('moment');var BPromise=require(_0x8b3a('0x5'));var Mustache=require('mustache');var util=require(_0x8b3a('0x6'));var path=require('path');var sox=require(_0x8b3a('0x7'));var csv=require(_0x8b3a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8b3a('0x9'));var _=require(_0x8b3a('0xa'));var squel=require(_0x8b3a('0xb'));var crypto=require(_0x8b3a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8b3a('0xd'));var toCsv=require('to-csv');var querystring=require(_0x8b3a('0xe'));var Papa=require('papaparse');var Redis=require(_0x8b3a('0xf'));var authService=require(_0x8b3a('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8b3a('0x11'));var logger=require(_0x8b3a('0x12'))('api');var utils=require(_0x8b3a('0x13'));var config=require(_0x8b3a('0x14'));var licenseUtil=require(_0x8b3a('0x15'));var db=require('../../mysqldb')['db'];config[_0x8b3a('0x16')]=_[_0x8b3a('0x17')](config['redis'],{'host':_0x8b3a('0x18'),'port':0x18eb});var socket=require(_0x8b3a('0x19'))(new Redis(config[_0x8b3a('0x16')]));require('./chatGroup.socket')[_0x8b3a('0x1a')](socket);function respondWithStatusCode(_0x1dbe8e,_0x2923b0){_0x2923b0=_0x2923b0||0xcc;return function(_0x10a92e){if(_0x10a92e){return _0x1dbe8e[_0x8b3a('0x1b')](_0x2923b0);}return _0x1dbe8e[_0x8b3a('0x1c')](_0x2923b0)[_0x8b3a('0x1d')]();};}function respondWithResult(_0x23ebad,_0x5b4891){_0x5b4891=_0x5b4891||0xc8;return function(_0x10b61c){if(_0x10b61c){return _0x23ebad[_0x8b3a('0x1c')](_0x5b4891)[_0x8b3a('0x1e')](_0x10b61c);}};}function respondWithFilteredResult(_0x25fe76,_0x1453be){return function(_0x4ae14d){if(_0x4ae14d){var _0x5d9b2f=typeof _0x1453be[_0x8b3a('0x1f')]===_0x8b3a('0x20')&&typeof _0x1453be[_0x8b3a('0x21')]===_0x8b3a('0x20');var _0x5c0678=_0x4ae14d[_0x8b3a('0x22')];var _0xc9c5ea=_0x5d9b2f?0x0:_0x1453be[_0x8b3a('0x1f')];var _0x2760ef=_0x5d9b2f?_0x4ae14d['count']:_0x1453be['offset']+_0x1453be[_0x8b3a('0x21')];var _0x243e87;if(_0x2760ef>=_0x5c0678){_0x2760ef=_0x5c0678;_0x243e87=0xc8;}else{_0x243e87=0xce;}_0x25fe76[_0x8b3a('0x1c')](_0x243e87);return _0x25fe76[_0x8b3a('0x23')](_0x8b3a('0x24'),_0xc9c5ea+'-'+_0x2760ef+'/'+_0x5c0678)[_0x8b3a('0x1e')](_0x4ae14d);}return null;};}function patchUpdates(_0x5d8c3a){return function(_0x3023f1){try{jsonpatch['apply'](_0x3023f1,_0x5d8c3a,!![]);}catch(_0x452bb5){return BPromise[_0x8b3a('0x25')](_0x452bb5);}return _0x3023f1[_0x8b3a('0x26')]();};}function saveUpdates(_0x590a2d,_0x3af72d){return function(_0x20dfc6){if(_0x20dfc6){return _0x20dfc6[_0x8b3a('0x27')](_0x590a2d)[_0x8b3a('0x28')](function(_0x105bb0){return _0x105bb0;});}return null;};}function removeEntity(_0x430642,_0x3e9a02){return function(_0x565e6e){if(_0x565e6e){return _0x565e6e[_0x8b3a('0x29')]()['then'](function(){_0x430642[_0x8b3a('0x1c')](0xcc)[_0x8b3a('0x1d')]();});}};}function handleEntityNotFound(_0x1019d7,_0x17bfa9){return function(_0x5797d4){if(!_0x5797d4){_0x1019d7['sendStatus'](0x194);}return _0x5797d4;};}function handleError(_0x2d7917,_0x9451b5){_0x9451b5=_0x9451b5||0x1f4;return function(_0x3a50df){logger['error'](_0x3a50df[_0x8b3a('0x2a')]);if(_0x3a50df['name']){delete _0x3a50df[_0x8b3a('0x2b')];}_0x2d7917[_0x8b3a('0x1c')](_0x9451b5)[_0x8b3a('0x2c')](_0x3a50df);};}exports['index']=function(_0x3c368e,_0x64e8ce){var _0x34f894={},_0x33d760={},_0x2ed138={'count':0x0,'rows':[]};var _0x5a1dee=_[_0x8b3a('0x2d')](db[_0x8b3a('0x2e')][_0x8b3a('0x2f')],function(_0x48e8a0){return{'name':_0x48e8a0[_0x8b3a('0x30')],'type':_0x48e8a0['type']['key']};});_0x33d760[_0x8b3a('0x31')]=_[_0x8b3a('0x2d')](_0x5a1dee,'name');_0x33d760[_0x8b3a('0x32')]=_[_0x8b3a('0x33')](_0x3c368e[_0x8b3a('0x32')]);_0x33d760['filters']=_[_0x8b3a('0x34')](_0x33d760[_0x8b3a('0x31')],_0x33d760[_0x8b3a('0x32')]);_0x34f894[_0x8b3a('0x35')]=_[_0x8b3a('0x34')](_0x33d760[_0x8b3a('0x31')],qs[_0x8b3a('0x36')](_0x3c368e['query']['fields']));_0x34f894[_0x8b3a('0x35')]=_0x34f894[_0x8b3a('0x35')][_0x8b3a('0x37')]?_0x34f894[_0x8b3a('0x35')]:_0x33d760[_0x8b3a('0x31')];if(!_0x3c368e[_0x8b3a('0x32')][_0x8b3a('0x38')](_0x8b3a('0x39'))){_0x34f894[_0x8b3a('0x21')]=qs[_0x8b3a('0x21')](_0x3c368e['query'][_0x8b3a('0x21')]);_0x34f894[_0x8b3a('0x1f')]=qs['offset'](_0x3c368e[_0x8b3a('0x32')]['offset']);}_0x34f894[_0x8b3a('0x3a')]=qs['sort'](_0x3c368e[_0x8b3a('0x32')][_0x8b3a('0x3b')]);_0x34f894[_0x8b3a('0x3c')]=qs[_0x8b3a('0x3d')](_['pick'](_0x3c368e[_0x8b3a('0x32')],_0x33d760[_0x8b3a('0x3d')]),_0x5a1dee);if(_0x3c368e[_0x8b3a('0x32')][_0x8b3a('0x3e')]){_0x34f894['where']=_[_0x8b3a('0x3f')](_0x34f894[_0x8b3a('0x3c')],{'$or':_[_0x8b3a('0x2d')](_0x5a1dee,function(_0xe4080d){if(_0xe4080d['type']!==_0x8b3a('0x40')){var _0x5d1a88={};_0x5d1a88[_0xe4080d[_0x8b3a('0x2b')]]={'$like':'%'+_0x3c368e['query'][_0x8b3a('0x3e')]+'%'};return _0x5d1a88;}})});}_0x34f894=_[_0x8b3a('0x3f')]({},_0x34f894,_0x3c368e[_0x8b3a('0x41')]);var _0x24f2ed={'where':_0x34f894[_0x8b3a('0x3c')]};return db['ChatGroup'][_0x8b3a('0x22')](_0x24f2ed)['then'](function(_0x52b219){_0x2ed138['count']=_0x52b219;if(_0x3c368e[_0x8b3a('0x32')][_0x8b3a('0x42')]){_0x34f894[_0x8b3a('0x43')]=[{'all':!![]}];}return db['ChatGroup'][_0x8b3a('0x44')](_0x34f894);})[_0x8b3a('0x28')](function(_0xcb77e9){_0x2ed138[_0x8b3a('0x45')]=_0xcb77e9;return _0x2ed138;})['then'](respondWithFilteredResult(_0x64e8ce,_0x34f894))['catch'](handleError(_0x64e8ce,null));};exports[_0x8b3a('0x46')]=function(_0xc5ecda,_0xc2474d){var _0x3aed17={'raw':!![],'where':{'id':_0xc5ecda['params']['id']}},_0x3353c0={};_0x3353c0[_0x8b3a('0x31')]=_[_0x8b3a('0x33')](db[_0x8b3a('0x2e')][_0x8b3a('0x2f')]);_0x3353c0[_0x8b3a('0x32')]=_[_0x8b3a('0x33')](_0xc5ecda['query']);_0x3353c0[_0x8b3a('0x3d')]=_[_0x8b3a('0x34')](_0x3353c0[_0x8b3a('0x31')],_0x3353c0[_0x8b3a('0x32')]);_0x3aed17[_0x8b3a('0x35')]=_[_0x8b3a('0x34')](_0x3353c0[_0x8b3a('0x31')],qs[_0x8b3a('0x36')](_0xc5ecda[_0x8b3a('0x32')]['fields']));_0x3aed17[_0x8b3a('0x35')]=_0x3aed17[_0x8b3a('0x35')][_0x8b3a('0x37')]?_0x3aed17['attributes']:_0x3353c0['model'];if(_0xc5ecda[_0x8b3a('0x32')]['includeAll']){_0x3aed17[_0x8b3a('0x43')]=[{'all':!![]}];}_0x3aed17=_[_0x8b3a('0x3f')]({},_0x3aed17,_0xc5ecda[_0x8b3a('0x41')]);return db['ChatGroup'][_0x8b3a('0x47')](_0x3aed17)[_0x8b3a('0x28')](handleEntityNotFound(_0xc2474d,null))[_0x8b3a('0x28')](respondWithResult(_0xc2474d,null))[_0x8b3a('0x48')](handleError(_0xc2474d,null));};exports[_0x8b3a('0x49')]=function(_0x50a487,_0x19e683){return db[_0x8b3a('0x2e')][_0x8b3a('0x49')](_0x50a487[_0x8b3a('0x4a')],{})[_0x8b3a('0x28')](respondWithResult(_0x19e683,0xc9))['catch'](handleError(_0x19e683,null));};exports[_0x8b3a('0x27')]=function(_0x41def8,_0x5277e2){if(_0x41def8[_0x8b3a('0x4a')]['id']){delete _0x41def8[_0x8b3a('0x4a')]['id'];}return db['ChatGroup'][_0x8b3a('0x47')]({'where':{'id':_0x41def8[_0x8b3a('0x4b')]['id']}})[_0x8b3a('0x28')](handleEntityNotFound(_0x5277e2,null))[_0x8b3a('0x28')](saveUpdates(_0x41def8[_0x8b3a('0x4a')],null))['then'](respondWithResult(_0x5277e2,null))[_0x8b3a('0x48')](handleError(_0x5277e2,null));};exports[_0x8b3a('0x29')]=function(_0x1dadcf,_0x57b138){return db['ChatGroup']['find']({'where':{'id':_0x1dadcf[_0x8b3a('0x4b')]['id']}})['then'](handleEntityNotFound(_0x57b138,null))[_0x8b3a('0x28')](removeEntity(_0x57b138,null))[_0x8b3a('0x48')](handleError(_0x57b138,null));};exports[_0x8b3a('0x4c')]=function(_0x2b8acf,_0x39d6eb){return db[_0x8b3a('0x2e')]['describe']()[_0x8b3a('0x28')](respondWithResult(_0x39d6eb,null))[_0x8b3a('0x48')](handleError(_0x39d6eb,null));};exports['getUnread']=function(_0x555a00,_0x20582a,_0x19f7fc){return db['ChatInternalMessage'][_0x8b3a('0x22')]({'where':{'ChatGroupId':_0x555a00[_0x8b3a('0x4b')]['id'],'ToId':_0x555a00['user']['id'],'read':![]}})[_0x8b3a('0x28')](function(_0x47a3d6){return{'id':_[_0x8b3a('0x4d')](_0x555a00[_0x8b3a('0x4b')]['id']),'count':_0x47a3d6};})[_0x8b3a('0x28')](respondWithResult(_0x20582a,null))['catch'](handleError(_0x20582a,null));};exports['addMembers']=function(_0x2c6def,_0x480200,_0x2327a9){return db[_0x8b3a('0x2e')]['find']({'where':{'id':_0x2c6def[_0x8b3a('0x4b')]['id']}})[_0x8b3a('0x28')](handleEntityNotFound(_0x480200,null))['then'](function(_0x43c142){if(_0x43c142){return _0x43c142[_0x8b3a('0x4e')](_0x2c6def[_0x8b3a('0x4a')]['ids'],_['omit'](_0x2c6def[_0x8b3a('0x4a')],[_0x8b3a('0x4f'),'id'])||{});}})[_0x8b3a('0x28')](respondWithResult(_0x480200,null))[_0x8b3a('0x48')](handleError(_0x480200,null));};exports[_0x8b3a('0x50')]=function(_0x1c629c,_0x4af8e0,_0x3b7c71){var _0x9a24da={};var _0x3c6cb1={};var _0x118e15;var _0x951c15;return db['ChatGroup'][_0x8b3a('0x51')]({'where':{'id':_0x1c629c['params']['id']}})['then'](handleEntityNotFound(_0x4af8e0,null))[_0x8b3a('0x28')](function(_0x9b1a58){if(_0x9b1a58){_0x118e15=_0x9b1a58;_0x3c6cb1[_0x8b3a('0x31')]=_[_0x8b3a('0x33')](db['User'][_0x8b3a('0x2f')]);_0x3c6cb1['query']=_[_0x8b3a('0x33')](_0x1c629c[_0x8b3a('0x32')]);_0x3c6cb1['filters']=_['intersection'](_0x3c6cb1[_0x8b3a('0x31')],_0x3c6cb1[_0x8b3a('0x32')]);_0x9a24da[_0x8b3a('0x35')]=_['intersection'](_0x3c6cb1[_0x8b3a('0x31')],qs[_0x8b3a('0x36')](_0x1c629c[_0x8b3a('0x32')][_0x8b3a('0x36')]));_0x9a24da['attributes']=_0x9a24da['attributes'][_0x8b3a('0x37')]?_0x9a24da['attributes']:_0x3c6cb1[_0x8b3a('0x31')];_0x9a24da[_0x8b3a('0x3a')]=qs[_0x8b3a('0x3b')](_0x1c629c[_0x8b3a('0x32')][_0x8b3a('0x3b')]);_0x9a24da[_0x8b3a('0x3c')]=qs[_0x8b3a('0x3d')](_[_0x8b3a('0x52')](_0x1c629c['query'],_0x3c6cb1[_0x8b3a('0x3d')]));if(_0x1c629c[_0x8b3a('0x32')][_0x8b3a('0x3e')]){_0x9a24da['where']=_[_0x8b3a('0x3f')](_0x9a24da['where'],{'$or':_[_0x8b3a('0x2d')](_0x9a24da[_0x8b3a('0x35')],function(_0x3642dc){var _0xd54e2c={};_0xd54e2c[_0x3642dc]={'$like':'%'+_0x1c629c[_0x8b3a('0x32')]['filter']+'%'};return _0xd54e2c;})});}_0x9a24da=_[_0x8b3a('0x3f')]({},_0x9a24da,_0x1c629c['options']);return _0x118e15['getMembers'](_0x9a24da);}})[_0x8b3a('0x28')](function(_0xc6de5b){if(_0xc6de5b){_0x951c15=_0xc6de5b[_0x8b3a('0x37')];if(!_0x1c629c[_0x8b3a('0x32')][_0x8b3a('0x38')](_0x8b3a('0x39'))){_0x9a24da[_0x8b3a('0x21')]=qs[_0x8b3a('0x21')](_0x1c629c[_0x8b3a('0x32')][_0x8b3a('0x21')]);_0x9a24da[_0x8b3a('0x1f')]=qs['offset'](_0x1c629c[_0x8b3a('0x32')][_0x8b3a('0x1f')]);}return _0x118e15[_0x8b3a('0x50')](_0x9a24da);}})[_0x8b3a('0x28')](function(_0x5c7eaf){if(_0x5c7eaf){return _0x5c7eaf?{'count':_0x951c15,'rows':_0x5c7eaf}:null;}})[_0x8b3a('0x28')](respondWithResult(_0x4af8e0,null))[_0x8b3a('0x48')](handleError(_0x4af8e0,null));};exports[_0x8b3a('0x53')]=function(_0x49b778,_0x335c7a,_0x2de17c){return db[_0x8b3a('0x2e')][_0x8b3a('0x47')]({'where':{'id':_0x49b778[_0x8b3a('0x4b')]['id']}})[_0x8b3a('0x28')](handleEntityNotFound(_0x335c7a,null))[_0x8b3a('0x28')](function(_0x45e2f3){if(_0x45e2f3){return _0x45e2f3[_0x8b3a('0x53')](_0x49b778[_0x8b3a('0x32')][_0x8b3a('0x4f')]);}})[_0x8b3a('0x28')](respondWithStatusCode(_0x335c7a,null))['catch'](handleError(_0x335c7a,null));};exports[_0x8b3a('0x54')]=function(_0x45f55b,_0x497963,_0x11a0b6){if(_0x45f55b[_0x8b3a('0x4a')]['id']){delete _0x45f55b[_0x8b3a('0x4a')]['id'];}return db[_0x8b3a('0x2e')][_0x8b3a('0x47')]({'where':{'id':_0x45f55b[_0x8b3a('0x4b')]['id']}})[_0x8b3a('0x28')](handleEntityNotFound(_0x497963,null))[_0x8b3a('0x28')](function(_0x520d4f){if(_0x520d4f){_0x45f55b[_0x8b3a('0x4a')][_0x8b3a('0x55')]=_0x520d4f['id'];return db[_0x8b3a('0x56')][_0x8b3a('0x49')](_0x45f55b[_0x8b3a('0x4a')]);}})[_0x8b3a('0x28')](respondWithResult(_0x497963,null))['catch'](handleError(_0x497963,null));};exports['getMessages']=function(_0x2730c5,_0x305bd6,_0x5f56b2){var _0x1c6006={};var _0x3b16f8={};var _0x1016b2;var _0x27cc94;return db[_0x8b3a('0x2e')][_0x8b3a('0x51')]({'where':{'id':_0x2730c5['params']['id']}})[_0x8b3a('0x28')](handleEntityNotFound(_0x305bd6,null))['then'](function(_0x50d0aa){if(_0x50d0aa){_0x1016b2=_0x50d0aa;_0x3b16f8[_0x8b3a('0x31')]=_[_0x8b3a('0x33')](db[_0x8b3a('0x56')][_0x8b3a('0x2f')]);_0x3b16f8[_0x8b3a('0x32')]=_['keys'](_0x2730c5[_0x8b3a('0x32')]);_0x3b16f8[_0x8b3a('0x3d')]=_[_0x8b3a('0x34')](_0x3b16f8[_0x8b3a('0x31')],_0x3b16f8[_0x8b3a('0x32')]);_0x1c6006[_0x8b3a('0x35')]=_[_0x8b3a('0x34')](_0x3b16f8[_0x8b3a('0x31')],qs[_0x8b3a('0x36')](_0x2730c5[_0x8b3a('0x32')][_0x8b3a('0x36')]));_0x1c6006[_0x8b3a('0x35')]=_0x1c6006[_0x8b3a('0x35')][_0x8b3a('0x37')]?_0x1c6006['attributes']:_0x3b16f8['model'];_0x1c6006[_0x8b3a('0x3a')]=qs[_0x8b3a('0x3b')](_0x2730c5[_0x8b3a('0x32')][_0x8b3a('0x3b')]);_0x1c6006[_0x8b3a('0x3c')]=qs['filters'](_['pick'](_0x2730c5[_0x8b3a('0x32')],_0x3b16f8[_0x8b3a('0x3d')]));if(_0x2730c5['query'][_0x8b3a('0x3e')]){_0x1c6006[_0x8b3a('0x3c')]=_[_0x8b3a('0x3f')](_0x1c6006[_0x8b3a('0x3c')],{'$or':_['map'](_0x1c6006[_0x8b3a('0x35')],function(_0xcefffc){var _0x5a74e2={};_0x5a74e2[_0xcefffc]={'$like':'%'+_0x2730c5[_0x8b3a('0x32')][_0x8b3a('0x3e')]+'%'};return _0x5a74e2;})});}if(_0x2730c5['query'][_0x8b3a('0x57')]){var _0x191e9d=_0x2730c5['query'][_0x8b3a('0x57')][_0x8b3a('0x58')](',');var _0x1e0163={};_0x1e0163[_0x191e9d[0x0]]={'$gte':moment(_0x191e9d[0x1])['format'](_0x8b3a('0x59'))};_0x1c6006['where']=_[_0x8b3a('0x3f')](_0x1c6006[_0x8b3a('0x3c')],_0x1e0163);}_0x1c6006=_['merge']({},_0x1c6006,_0x2730c5['options']);return _0x1016b2[_0x8b3a('0x5a')](_0x1c6006);}})[_0x8b3a('0x28')](function(_0x4f732b){if(_0x4f732b){_0x27cc94=_0x4f732b['length'];if(!_0x2730c5[_0x8b3a('0x32')]['hasOwnProperty'](_0x8b3a('0x39'))){_0x1c6006['limit']=qs[_0x8b3a('0x21')](_0x2730c5[_0x8b3a('0x32')][_0x8b3a('0x21')]);_0x1c6006['offset']=qs['offset'](_0x2730c5['query'][_0x8b3a('0x1f')]);}return _0x1016b2['getMessages'](_0x1c6006);}})[_0x8b3a('0x28')](function(_0x338cbb){if(_0x338cbb){return _0x338cbb?{'count':_0x27cc94,'rows':_0x338cbb}:null;}})[_0x8b3a('0x28')](respondWithResult(_0x305bd6,null))[_0x8b3a('0x48')](handleError(_0x305bd6,null));}; \ No newline at end of file +var _0x8032=['sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','end','stack','name','map','ChatGroup','fieldName','model','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','type','VIRTUAL','filter','includeAll','include','findAll','show','params','keys','rawAttributes','length','options','find','catch','create','body','update','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','User','getMembers','removeMembers','getMessages','findOne','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatGroup.socket','register'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x8032,0x9d));var _0x2803=function(_0x114b54,_0x3ed9bb){_0x114b54=_0x114b54-0x0;var _0x21c37f=_0x8032[_0x114b54];return _0x21c37f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2803('0x0'));var rp=require('request-promise');var moment=require(_0x2803('0x1'));var BPromise=require(_0x2803('0x2'));var Mustache=require(_0x2803('0x3'));var util=require(_0x2803('0x4'));var path=require('path');var sox=require(_0x2803('0x5'));var csv=require(_0x2803('0x6'));var ejs=require(_0x2803('0x7'));var fs=require('fs');var fs_extra=require(_0x2803('0x8'));var _=require(_0x2803('0x9'));var squel=require(_0x2803('0xa'));var crypto=require('crypto');var jsforce=require(_0x2803('0xb'));var deskjs=require(_0x2803('0xc'));var toCsv=require(_0x2803('0x6'));var querystring=require(_0x2803('0xd'));var Papa=require('papaparse');var Redis=require(_0x2803('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x2803('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2803('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x2803('0x11'));var licenseUtil=require(_0x2803('0x12'));var db=require(_0x2803('0x13'))['db'];config[_0x2803('0x14')]=_[_0x2803('0x15')](config[_0x2803('0x14')],{'host':'localhost','port':0x18eb});var socket=require(_0x2803('0x16'))(new Redis(config[_0x2803('0x14')]));require(_0x2803('0x17'))[_0x2803('0x18')](socket);function respondWithStatusCode(_0x4a7e80,_0x17f032){_0x17f032=_0x17f032||0xcc;return function(_0x44e718){if(_0x44e718){return _0x4a7e80[_0x2803('0x19')](_0x17f032);}return _0x4a7e80['status'](_0x17f032)['end']();};}function respondWithResult(_0x209210,_0x128ce0){_0x128ce0=_0x128ce0||0xc8;return function(_0xcb9a7){if(_0xcb9a7){return _0x209210[_0x2803('0x1a')](_0x128ce0)[_0x2803('0x1b')](_0xcb9a7);}};}function respondWithFilteredResult(_0x3ff134,_0x243e4f){return function(_0x4a3b8d){if(_0x4a3b8d){var _0x6faa43=typeof _0x243e4f[_0x2803('0x1c')]===_0x2803('0x1d')&&typeof _0x243e4f[_0x2803('0x1e')]===_0x2803('0x1d');var _0x454e20=_0x4a3b8d[_0x2803('0x1f')];var _0x3751fc=_0x6faa43?0x0:_0x243e4f[_0x2803('0x1c')];var _0x31a03d=_0x6faa43?_0x4a3b8d[_0x2803('0x1f')]:_0x243e4f[_0x2803('0x1c')]+_0x243e4f[_0x2803('0x1e')];var _0x48c4a8;if(_0x31a03d>=_0x454e20){_0x31a03d=_0x454e20;_0x48c4a8=0xc8;}else{_0x48c4a8=0xce;}_0x3ff134['status'](_0x48c4a8);return _0x3ff134[_0x2803('0x20')](_0x2803('0x21'),_0x3751fc+'-'+_0x31a03d+'/'+_0x454e20)['json'](_0x4a3b8d);}return null;};}function patchUpdates(_0x1434e6){return function(_0x30fa33){try{jsonpatch[_0x2803('0x22')](_0x30fa33,_0x1434e6,!![]);}catch(_0x3f86ee){return BPromise[_0x2803('0x23')](_0x3f86ee);}return _0x30fa33[_0x2803('0x24')]();};}function saveUpdates(_0xac50d3,_0x17b4c1){return function(_0x21c4c5){if(_0x21c4c5){return _0x21c4c5['update'](_0xac50d3)['then'](function(_0x48ce2a){return _0x48ce2a;});}return null;};}function removeEntity(_0x3d2e0a,_0x1a2b57){return function(_0x236e25){if(_0x236e25){return _0x236e25['destroy']()[_0x2803('0x25')](function(){_0x3d2e0a[_0x2803('0x1a')](0xcc)[_0x2803('0x26')]();});}};}function handleEntityNotFound(_0xe82184,_0x574ac5){return function(_0x1a5a31){if(!_0x1a5a31){_0xe82184['sendStatus'](0x194);}return _0x1a5a31;};}function handleError(_0x4ce9e2,_0x33b436){_0x33b436=_0x33b436||0x1f4;return function(_0x15c541){logger['error'](_0x15c541[_0x2803('0x27')]);if(_0x15c541[_0x2803('0x28')]){delete _0x15c541[_0x2803('0x28')];}_0x4ce9e2[_0x2803('0x1a')](_0x33b436)['send'](_0x15c541);};}exports['index']=function(_0x39aa51,_0x214b2b){var _0x116226={},_0x1322d7={},_0x28c4a8={'count':0x0,'rows':[]};var _0x24ca88=_[_0x2803('0x29')](db[_0x2803('0x2a')]['rawAttributes'],function(_0x43ab71){return{'name':_0x43ab71[_0x2803('0x2b')],'type':_0x43ab71['type']['key']};});_0x1322d7[_0x2803('0x2c')]=_['map'](_0x24ca88,'name');_0x1322d7[_0x2803('0x2d')]=_['keys'](_0x39aa51[_0x2803('0x2d')]);_0x1322d7['filters']=_['intersection'](_0x1322d7[_0x2803('0x2c')],_0x1322d7[_0x2803('0x2d')]);_0x116226['attributes']=_[_0x2803('0x2e')](_0x1322d7[_0x2803('0x2c')],qs[_0x2803('0x2f')](_0x39aa51[_0x2803('0x2d')]['fields']));_0x116226[_0x2803('0x30')]=_0x116226[_0x2803('0x30')]['length']?_0x116226[_0x2803('0x30')]:_0x1322d7['model'];if(!_0x39aa51[_0x2803('0x2d')][_0x2803('0x31')](_0x2803('0x32'))){_0x116226['limit']=qs[_0x2803('0x1e')](_0x39aa51[_0x2803('0x2d')][_0x2803('0x1e')]);_0x116226[_0x2803('0x1c')]=qs[_0x2803('0x1c')](_0x39aa51[_0x2803('0x2d')][_0x2803('0x1c')]);}_0x116226[_0x2803('0x33')]=qs[_0x2803('0x34')](_0x39aa51[_0x2803('0x2d')][_0x2803('0x34')]);_0x116226['where']=qs[_0x2803('0x35')](_[_0x2803('0x36')](_0x39aa51[_0x2803('0x2d')],_0x1322d7[_0x2803('0x35')]),_0x24ca88);if(_0x39aa51[_0x2803('0x2d')]['filter']){_0x116226[_0x2803('0x37')]=_[_0x2803('0x38')](_0x116226[_0x2803('0x37')],{'$or':_[_0x2803('0x29')](_0x24ca88,function(_0x19646c){if(_0x19646c[_0x2803('0x39')]!==_0x2803('0x3a')){var _0x41e935={};_0x41e935[_0x19646c[_0x2803('0x28')]]={'$like':'%'+_0x39aa51[_0x2803('0x2d')][_0x2803('0x3b')]+'%'};return _0x41e935;}})});}_0x116226=_[_0x2803('0x38')]({},_0x116226,_0x39aa51['options']);var _0x2f0be9={'where':_0x116226[_0x2803('0x37')]};return db[_0x2803('0x2a')][_0x2803('0x1f')](_0x2f0be9)[_0x2803('0x25')](function(_0x538dbb){_0x28c4a8[_0x2803('0x1f')]=_0x538dbb;if(_0x39aa51['query'][_0x2803('0x3c')]){_0x116226[_0x2803('0x3d')]=[{'all':!![]}];}return db[_0x2803('0x2a')][_0x2803('0x3e')](_0x116226);})[_0x2803('0x25')](function(_0x170ea2){_0x28c4a8['rows']=_0x170ea2;return _0x28c4a8;})[_0x2803('0x25')](respondWithFilteredResult(_0x214b2b,_0x116226))['catch'](handleError(_0x214b2b,null));};exports[_0x2803('0x3f')]=function(_0x2e546b,_0x493f50){var _0x101bd0={'raw':!![],'where':{'id':_0x2e546b[_0x2803('0x40')]['id']}},_0x37fc40={};_0x37fc40['model']=_[_0x2803('0x41')](db[_0x2803('0x2a')][_0x2803('0x42')]);_0x37fc40[_0x2803('0x2d')]=_['keys'](_0x2e546b[_0x2803('0x2d')]);_0x37fc40[_0x2803('0x35')]=_[_0x2803('0x2e')](_0x37fc40[_0x2803('0x2c')],_0x37fc40[_0x2803('0x2d')]);_0x101bd0[_0x2803('0x30')]=_[_0x2803('0x2e')](_0x37fc40[_0x2803('0x2c')],qs[_0x2803('0x2f')](_0x2e546b[_0x2803('0x2d')]['fields']));_0x101bd0[_0x2803('0x30')]=_0x101bd0[_0x2803('0x30')][_0x2803('0x43')]?_0x101bd0[_0x2803('0x30')]:_0x37fc40['model'];if(_0x2e546b[_0x2803('0x2d')][_0x2803('0x3c')]){_0x101bd0[_0x2803('0x3d')]=[{'all':!![]}];}_0x101bd0=_[_0x2803('0x38')]({},_0x101bd0,_0x2e546b[_0x2803('0x44')]);return db[_0x2803('0x2a')][_0x2803('0x45')](_0x101bd0)['then'](handleEntityNotFound(_0x493f50,null))['then'](respondWithResult(_0x493f50,null))[_0x2803('0x46')](handleError(_0x493f50,null));};exports[_0x2803('0x47')]=function(_0x107f48,_0xe090da){return db[_0x2803('0x2a')]['create'](_0x107f48[_0x2803('0x48')],{})['then'](respondWithResult(_0xe090da,0xc9))['catch'](handleError(_0xe090da,null));};exports[_0x2803('0x49')]=function(_0x2d5bf0,_0x5e667e){if(_0x2d5bf0['body']['id']){delete _0x2d5bf0[_0x2803('0x48')]['id'];}return db[_0x2803('0x2a')][_0x2803('0x45')]({'where':{'id':_0x2d5bf0['params']['id']}})[_0x2803('0x25')](handleEntityNotFound(_0x5e667e,null))['then'](saveUpdates(_0x2d5bf0[_0x2803('0x48')],null))[_0x2803('0x25')](respondWithResult(_0x5e667e,null))[_0x2803('0x46')](handleError(_0x5e667e,null));};exports['destroy']=function(_0x2f9b5a,_0x1c9163){return db[_0x2803('0x2a')][_0x2803('0x45')]({'where':{'id':_0x2f9b5a[_0x2803('0x40')]['id']}})[_0x2803('0x25')](handleEntityNotFound(_0x1c9163,null))[_0x2803('0x25')](removeEntity(_0x1c9163,null))[_0x2803('0x46')](handleError(_0x1c9163,null));};exports[_0x2803('0x4a')]=function(_0x1776d9,_0x345687){return db[_0x2803('0x2a')][_0x2803('0x4a')]()[_0x2803('0x25')](respondWithResult(_0x345687,null))['catch'](handleError(_0x345687,null));};exports[_0x2803('0x4b')]=function(_0x43b9a4,_0x5dd88b,_0x35ab09){return db[_0x2803('0x4c')][_0x2803('0x1f')]({'where':{'ChatGroupId':_0x43b9a4[_0x2803('0x40')]['id'],'ToId':_0x43b9a4[_0x2803('0x4d')]['id'],'read':![]}})['then'](function(_0x1c2844){return{'id':_[_0x2803('0x4e')](_0x43b9a4[_0x2803('0x40')]['id']),'count':_0x1c2844};})['then'](respondWithResult(_0x5dd88b,null))[_0x2803('0x46')](handleError(_0x5dd88b,null));};exports[_0x2803('0x4f')]=function(_0x2c0188,_0x29c76d,_0x4f490f){return db[_0x2803('0x2a')]['find']({'where':{'id':_0x2c0188[_0x2803('0x40')]['id']}})[_0x2803('0x25')](handleEntityNotFound(_0x29c76d,null))[_0x2803('0x25')](function(_0xf3e4dc){if(_0xf3e4dc){return _0xf3e4dc['addMembers'](_0x2c0188['body'][_0x2803('0x50')],_[_0x2803('0x51')](_0x2c0188[_0x2803('0x48')],[_0x2803('0x50'),'id'])||{});}})[_0x2803('0x25')](respondWithResult(_0x29c76d,null))[_0x2803('0x46')](handleError(_0x29c76d,null));};exports['getMembers']=function(_0x4e8bbf,_0x202342,_0x44159e){var _0x2585f8={};var _0x530c37={};var _0x24d476;var _0x45298a;return db[_0x2803('0x2a')]['findOne']({'where':{'id':_0x4e8bbf[_0x2803('0x40')]['id']}})[_0x2803('0x25')](handleEntityNotFound(_0x202342,null))[_0x2803('0x25')](function(_0x415dd2){if(_0x415dd2){_0x24d476=_0x415dd2;_0x530c37['model']=_[_0x2803('0x41')](db[_0x2803('0x52')]['rawAttributes']);_0x530c37['query']=_[_0x2803('0x41')](_0x4e8bbf[_0x2803('0x2d')]);_0x530c37[_0x2803('0x35')]=_[_0x2803('0x2e')](_0x530c37[_0x2803('0x2c')],_0x530c37[_0x2803('0x2d')]);_0x2585f8[_0x2803('0x30')]=_['intersection'](_0x530c37['model'],qs[_0x2803('0x2f')](_0x4e8bbf[_0x2803('0x2d')][_0x2803('0x2f')]));_0x2585f8[_0x2803('0x30')]=_0x2585f8[_0x2803('0x30')][_0x2803('0x43')]?_0x2585f8[_0x2803('0x30')]:_0x530c37[_0x2803('0x2c')];_0x2585f8[_0x2803('0x33')]=qs[_0x2803('0x34')](_0x4e8bbf[_0x2803('0x2d')][_0x2803('0x34')]);_0x2585f8['where']=qs[_0x2803('0x35')](_[_0x2803('0x36')](_0x4e8bbf[_0x2803('0x2d')],_0x530c37['filters']));if(_0x4e8bbf[_0x2803('0x2d')][_0x2803('0x3b')]){_0x2585f8[_0x2803('0x37')]=_[_0x2803('0x38')](_0x2585f8['where'],{'$or':_[_0x2803('0x29')](_0x2585f8[_0x2803('0x30')],function(_0x1a2dc5){var _0x3b3d07={};_0x3b3d07[_0x1a2dc5]={'$like':'%'+_0x4e8bbf[_0x2803('0x2d')][_0x2803('0x3b')]+'%'};return _0x3b3d07;})});}_0x2585f8=_[_0x2803('0x38')]({},_0x2585f8,_0x4e8bbf[_0x2803('0x44')]);return _0x24d476['getMembers'](_0x2585f8);}})[_0x2803('0x25')](function(_0x816d17){if(_0x816d17){_0x45298a=_0x816d17[_0x2803('0x43')];if(!_0x4e8bbf[_0x2803('0x2d')][_0x2803('0x31')](_0x2803('0x32'))){_0x2585f8['limit']=qs[_0x2803('0x1e')](_0x4e8bbf[_0x2803('0x2d')][_0x2803('0x1e')]);_0x2585f8[_0x2803('0x1c')]=qs[_0x2803('0x1c')](_0x4e8bbf[_0x2803('0x2d')][_0x2803('0x1c')]);}return _0x24d476[_0x2803('0x53')](_0x2585f8);}})[_0x2803('0x25')](function(_0x594663){if(_0x594663){return _0x594663?{'count':_0x45298a,'rows':_0x594663}:null;}})[_0x2803('0x25')](respondWithResult(_0x202342,null))[_0x2803('0x46')](handleError(_0x202342,null));};exports[_0x2803('0x54')]=function(_0x149edc,_0x52fd9c,_0x21602c){return db['ChatGroup']['find']({'where':{'id':_0x149edc[_0x2803('0x40')]['id']}})[_0x2803('0x25')](handleEntityNotFound(_0x52fd9c,null))['then'](function(_0x5e09bb){if(_0x5e09bb){return _0x5e09bb[_0x2803('0x54')](_0x149edc[_0x2803('0x2d')][_0x2803('0x50')]);}})['then'](respondWithStatusCode(_0x52fd9c,null))[_0x2803('0x46')](handleError(_0x52fd9c,null));};exports['addMessage']=function(_0x96a877,_0x5310cc,_0x3b4d5e){if(_0x96a877[_0x2803('0x48')]['id']){delete _0x96a877[_0x2803('0x48')]['id'];}return db[_0x2803('0x2a')]['find']({'where':{'id':_0x96a877[_0x2803('0x40')]['id']}})[_0x2803('0x25')](handleEntityNotFound(_0x5310cc,null))[_0x2803('0x25')](function(_0x3c28d7){if(_0x3c28d7){_0x96a877[_0x2803('0x48')]['ChatGroupId']=_0x3c28d7['id'];return db[_0x2803('0x4c')]['create'](_0x96a877[_0x2803('0x48')]);}})[_0x2803('0x25')](respondWithResult(_0x5310cc,null))['catch'](handleError(_0x5310cc,null));};exports[_0x2803('0x55')]=function(_0x139c3d,_0x77b8c3,_0x15a6b4){var _0x45eb39={};var _0x46d92d={};var _0x2a0102;var _0x5bfb22;return db[_0x2803('0x2a')][_0x2803('0x56')]({'where':{'id':_0x139c3d[_0x2803('0x40')]['id']}})[_0x2803('0x25')](handleEntityNotFound(_0x77b8c3,null))[_0x2803('0x25')](function(_0x166053){if(_0x166053){_0x2a0102=_0x166053;_0x46d92d[_0x2803('0x2c')]=_[_0x2803('0x41')](db[_0x2803('0x4c')][_0x2803('0x42')]);_0x46d92d[_0x2803('0x2d')]=_[_0x2803('0x41')](_0x139c3d['query']);_0x46d92d[_0x2803('0x35')]=_[_0x2803('0x2e')](_0x46d92d[_0x2803('0x2c')],_0x46d92d['query']);_0x45eb39[_0x2803('0x30')]=_['intersection'](_0x46d92d['model'],qs[_0x2803('0x2f')](_0x139c3d[_0x2803('0x2d')][_0x2803('0x2f')]));_0x45eb39[_0x2803('0x30')]=_0x45eb39[_0x2803('0x30')][_0x2803('0x43')]?_0x45eb39[_0x2803('0x30')]:_0x46d92d[_0x2803('0x2c')];_0x45eb39[_0x2803('0x33')]=qs[_0x2803('0x34')](_0x139c3d[_0x2803('0x2d')][_0x2803('0x34')]);_0x45eb39[_0x2803('0x37')]=qs['filters'](_[_0x2803('0x36')](_0x139c3d[_0x2803('0x2d')],_0x46d92d[_0x2803('0x35')]));if(_0x139c3d['query']['filter']){_0x45eb39['where']=_[_0x2803('0x38')](_0x45eb39[_0x2803('0x37')],{'$or':_[_0x2803('0x29')](_0x45eb39[_0x2803('0x30')],function(_0xd9aab2){var _0x429d5c={};_0x429d5c[_0xd9aab2]={'$like':'%'+_0x139c3d['query'][_0x2803('0x3b')]+'%'};return _0x429d5c;})});}if(_0x139c3d[_0x2803('0x2d')][_0x2803('0x57')]){var _0x3940a8=_0x139c3d[_0x2803('0x2d')][_0x2803('0x57')][_0x2803('0x58')](',');var _0x2b03aa={};_0x2b03aa[_0x3940a8[0x0]]={'$gte':moment(_0x3940a8[0x1])[_0x2803('0x59')](_0x2803('0x5a'))};_0x45eb39[_0x2803('0x37')]=_[_0x2803('0x38')](_0x45eb39[_0x2803('0x37')],_0x2b03aa);}_0x45eb39=_['merge']({},_0x45eb39,_0x139c3d[_0x2803('0x44')]);return _0x2a0102[_0x2803('0x55')](_0x45eb39);}})['then'](function(_0x5388fe){if(_0x5388fe){_0x5bfb22=_0x5388fe['length'];if(!_0x139c3d['query'][_0x2803('0x31')](_0x2803('0x32'))){_0x45eb39['limit']=qs['limit'](_0x139c3d['query'][_0x2803('0x1e')]);_0x45eb39[_0x2803('0x1c')]=qs[_0x2803('0x1c')](_0x139c3d[_0x2803('0x2d')][_0x2803('0x1c')]);}return _0x2a0102['getMessages'](_0x45eb39);}})[_0x2803('0x25')](function(_0x634760){if(_0x634760){return _0x634760?{'count':_0x5bfb22,'rows':_0x634760}:null;}})[_0x2803('0x25')](respondWithResult(_0x77b8c3,null))[_0x2803('0x46')](handleError(_0x77b8c3,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index f618d92..d8eb895 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 _0x8bcf=['update','remove','emit','hook','exports','events','ChatGroup','setMaxListeners','save'];(function(_0x1fc1f9,_0x454fb2){var _0x4987ca=function(_0x5e90dd){while(--_0x5e90dd){_0x1fc1f9['push'](_0x1fc1f9['shift']());}};_0x4987ca(++_0x454fb2);}(_0x8bcf,0x1be));var _0xf8bc=function(_0x141c3d,_0x1c1f73){_0x141c3d=_0x141c3d-0x0;var _0xed7479=_0x8bcf[_0x141c3d];return _0xed7479;};'use strict';var EventEmitter=require(_0xf8bc('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0xf8bc('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xf8bc('0x2')](0x0);var events={'afterCreate':_0xf8bc('0x3'),'afterUpdate':_0xf8bc('0x4'),'afterDestroy':_0xf8bc('0x5')};function emitEvent(_0x3177b8){return function(_0x3f6d71,_0xfd0ffd,_0x26726a){ChatGroupEvents[_0xf8bc('0x6')](_0x3177b8+':'+_0x3f6d71['id'],_0x3f6d71);ChatGroupEvents[_0xf8bc('0x6')](_0x3177b8,_0x3f6d71);_0x26726a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0xf8bc('0x7')](e,emitEvent(event));}}module[_0xf8bc('0x8')]=ChatGroupEvents; \ No newline at end of file +var _0x419f=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatGroup','setMaxListeners','save','update'];(function(_0x183f9c,_0x1645b6){var _0x4b6e4b=function(_0x45abf){while(--_0x45abf){_0x183f9c['push'](_0x183f9c['shift']());}};_0x4b6e4b(++_0x1645b6);}(_0x419f,0x176));var _0xf419=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x419f[_0x1035c1];return _0x308d67;};'use strict';var EventEmitter=require(_0xf419('0x0'));var ChatGroup=require(_0xf419('0x1'))['db'][_0xf419('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xf419('0x3')](0x0);var events={'afterCreate':_0xf419('0x4'),'afterUpdate':_0xf419('0x5'),'afterDestroy':'remove'};function emitEvent(_0x20a4f5){return function(_0x595a63,_0x28eb8f,_0x29b885){ChatGroupEvents[_0xf419('0x6')](_0x20a4f5+':'+_0x595a63['id'],_0x595a63);ChatGroupEvents[_0xf419('0x6')](_0x20a4f5,_0x595a63);_0x29b885(null);};}for(var e in events){if(events[_0xf419('0x7')](e)){var event=events[e];ChatGroup[_0xf419('0x8')](e,emitEvent(event));}}module[_0xf419('0x9')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 31d4f92..608310f 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 _0x672f=['rimraf','./chatGroup.attributes','define','ChatGroup','chat_groups','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x2ddfd9,_0x5877d0){var _0x2668f0=function(_0x70ad6f){while(--_0x70ad6f){_0x2ddfd9['push'](_0x2ddfd9['shift']());}};_0x2668f0(++_0x5877d0);}(_0x672f,0x18b));var _0xf672=function(_0x1d29da,_0x2eb10d){_0x1d29da=_0x1d29da-0x0;var _0x2722ea=_0x672f[_0x1d29da];return _0x2722ea;};'use strict';var _=require(_0xf672('0x0'));var util=require(_0xf672('0x1'));var logger=require(_0xf672('0x2'))(_0xf672('0x3'));var moment=require(_0xf672('0x4'));var BPromise=require(_0xf672('0x5'));var rp=require(_0xf672('0x6'));var fs=require('fs');var path=require(_0xf672('0x7'));var rimraf=require(_0xf672('0x8'));var config=require('../../config/environment');var attributes=require(_0xf672('0x9'));module['exports']=function(_0x5968ae,_0x3fad10){return _0x5968ae[_0xf672('0xa')](_0xf672('0xb'),attributes,{'tableName':_0xf672('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2707=['request-promise','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash','util','../../config/logger','api','moment'];(function(_0x288f5e,_0x205edd){var _0x476cc9=function(_0x796f53){while(--_0x796f53){_0x288f5e['push'](_0x288f5e['shift']());}};_0x476cc9(++_0x205edd);}(_0x2707,0x1cf));var _0x7270=function(_0x476bf4,_0x2a3755){_0x476bf4=_0x476bf4-0x0;var _0x788ffe=_0x2707[_0x476bf4];return _0x788ffe;};'use strict';var _=require(_0x7270('0x0'));var util=require(_0x7270('0x1'));var logger=require(_0x7270('0x2'))(_0x7270('0x3'));var moment=require(_0x7270('0x4'));var BPromise=require('bluebird');var rp=require(_0x7270('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7270('0x6'));var attributes=require(_0x7270('0x7'));module[_0x7270('0x8')]=function(_0x2dce33,_0x1ae13a){return _0x2dce33[_0x7270('0x9')](_0x7270('0xa'),attributes,{'tableName':_0x7270('0xb'),'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 188db2e..66b436e 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 _0x9ed1=['ChatGroup,\x20%s,\x20%s','debug','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','then'];(function(_0x323d9d,_0x2c850d){var _0x2ee2c3=function(_0xb737f){while(--_0xb737f){_0x323d9d['push'](_0x323d9d['shift']());}};_0x2ee2c3(++_0x2c850d);}(_0x9ed1,0x107));var _0x19ed=function(_0x50a0da,_0x5f4273){_0x50a0da=_0x50a0da-0x0;var _0x2dc52b=_0x9ed1[_0x50a0da];return _0x2dc52b;};'use strict';var _=require(_0x19ed('0x0'));var util=require(_0x19ed('0x1'));var moment=require(_0x19ed('0x2'));var BPromise=require(_0x19ed('0x3'));var rs=require(_0x19ed('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x19ed('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x19ed('0x6'))('rpc');var config=require(_0x19ed('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x19ed('0x8')][_0x19ed('0x9')]({'port':0x232a});config[_0x19ed('0xa')]=_[_0x19ed('0xb')](config[_0x19ed('0xa')],{'host':_0x19ed('0xc'),'port':0x18eb});var socket=require(_0x19ed('0xd'))(new Redis(config[_0x19ed('0xa')]));require(_0x19ed('0xe'))[_0x19ed('0xf')](socket);function respondWithRpcPromise(_0x1c28df,_0x302660,_0x4bafe8){return new BPromise(function(_0x2c5f1f,_0x5735be){return client['request'](_0x1c28df,_0x4bafe8)[_0x19ed('0x10')](function(_0x2ecbda){logger['info'](_0x19ed('0x11'),_0x302660,'request\x20sent');logger[_0x19ed('0x12')](_0x19ed('0x13'),_0x302660,_0x19ed('0x14'),JSON[_0x19ed('0x15')](_0x2ecbda));if(_0x2ecbda[_0x19ed('0x16')]){if(_0x2ecbda[_0x19ed('0x16')][_0x19ed('0x17')]===0x1f4){logger[_0x19ed('0x16')](_0x19ed('0x11'),_0x302660,_0x2ecbda[_0x19ed('0x16')][_0x19ed('0x18')]);return _0x5735be(_0x2ecbda[_0x19ed('0x16')]['message']);}logger[_0x19ed('0x16')](_0x19ed('0x11'),_0x302660,_0x2ecbda[_0x19ed('0x16')][_0x19ed('0x18')]);return _0x2c5f1f(_0x2ecbda[_0x19ed('0x16')]['message']);}else{logger[_0x19ed('0x19')](_0x19ed('0x11'),_0x302660,_0x19ed('0x14'));_0x2c5f1f(_0x2ecbda[_0x19ed('0x1a')][_0x19ed('0x18')]);}})[_0x19ed('0x1b')](function(_0x142f01){logger[_0x19ed('0x16')]('ChatGroup,\x20%s,\x20%s',_0x302660,_0x142f01);_0x5735be(_0x142f01);});});} \ No newline at end of file +var _0x30ff=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','./chatGroup.socket','register','request','then','info','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','ChatGroup,\x20%s,\x20%s','message','result','catch','util','moment'];(function(_0x253e83,_0x53d92a){var _0x246275=function(_0x57b4f4){while(--_0x57b4f4){_0x253e83['push'](_0x253e83['shift']());}};_0x246275(++_0x53d92a);}(_0x30ff,0x6a));var _0xf30f=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x30ff[_0x502c7d];return _0x30b7ed;};'use strict';var _=require('lodash');var util=require(_0xf30f('0x0'));var moment=require(_0xf30f('0x1'));var BPromise=require(_0xf30f('0x2'));var rs=require(_0xf30f('0x3'));var fs=require('fs');var Redis=require(_0xf30f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf30f('0x5'));var logger=require(_0xf30f('0x6'))('rpc');var config=require(_0xf30f('0x7'));var jayson=require(_0xf30f('0x8'));var client=jayson[_0xf30f('0x9')]['http']({'port':0x232a});config[_0xf30f('0xa')]=_[_0xf30f('0xb')](config[_0xf30f('0xa')],{'host':_0xf30f('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf30f('0xa')]));require(_0xf30f('0xd'))[_0xf30f('0xe')](socket);function respondWithRpcPromise(_0x2f473e,_0x349206,_0x83cac8){return new BPromise(function(_0xca7dea,_0x1aa921){return client[_0xf30f('0xf')](_0x2f473e,_0x83cac8)[_0xf30f('0x10')](function(_0x3d0e6a){logger[_0xf30f('0x11')]('ChatGroup,\x20%s,\x20%s',_0x349206,_0xf30f('0x12'));logger[_0xf30f('0x13')](_0xf30f('0x14'),_0x349206,'request\x20sent',JSON[_0xf30f('0x15')](_0x3d0e6a));if(_0x3d0e6a[_0xf30f('0x16')]){if(_0x3d0e6a[_0xf30f('0x16')]['code']===0x1f4){logger[_0xf30f('0x16')](_0xf30f('0x17'),_0x349206,_0x3d0e6a[_0xf30f('0x16')][_0xf30f('0x18')]);return _0x1aa921(_0x3d0e6a[_0xf30f('0x16')][_0xf30f('0x18')]);}logger[_0xf30f('0x16')](_0xf30f('0x17'),_0x349206,_0x3d0e6a[_0xf30f('0x16')]['message']);return _0xca7dea(_0x3d0e6a[_0xf30f('0x16')][_0xf30f('0x18')]);}else{logger[_0xf30f('0x11')](_0xf30f('0x17'),_0x349206,_0xf30f('0x12'));_0xca7dea(_0x3d0e6a[_0xf30f('0x19')]['message']);}})[_0xf30f('0x1a')](function(_0x27b339){logger[_0xf30f('0x16')](_0xf30f('0x17'),_0x349206,_0x27b339);_0x1aa921(_0x27b339);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 201c753..ad3a530 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 _0xc0c9=['save','remove','update','register','length'];(function(_0x524451,_0x3f6a5d){var _0xb369b6=function(_0x5283b9){while(--_0x5283b9){_0x524451['push'](_0x524451['shift']());}};_0xb369b6(++_0x3f6a5d);}(_0xc0c9,0xf0));var _0x9c0c=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xc0c9[_0xa1e3e3];return _0xc980e9;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0x9c0c('0x0'),_0x9c0c('0x1'),_0x9c0c('0x2')];function createListener(_0x35b73d,_0xebda46){return function(_0x323598){_0xebda46['emit'](_0x35b73d,_0x323598);};}function removeListener(_0x547543,_0x2272b8){return function(){ChatGroupEvents['removeListener'](_0x547543,_0x2272b8);};}exports[_0x9c0c('0x3')]=function(_0x3894cc){for(var _0x18cdd5=0x0,_0x4e617b=events[_0x9c0c('0x4')];_0x18cdd5<_0x4e617b;_0x18cdd5++){var _0x400dea=events[_0x18cdd5];var _0x3a82e1=createListener('chatGroup:'+_0x400dea,_0x3894cc);ChatGroupEvents['on'](_0x400dea,_0x3a82e1);}}; \ No newline at end of file +var _0x7e73=['emit','length','chatGroup:','./chatGroup.events','save','update'];(function(_0x254fee,_0x4496d4){var _0x4a1eb9=function(_0x3627f1){while(--_0x3627f1){_0x254fee['push'](_0x254fee['shift']());}};_0x4a1eb9(++_0x4496d4);}(_0x7e73,0x1cb));var _0x37e7=function(_0x1e7098,_0x419b77){_0x1e7098=_0x1e7098-0x0;var _0x222d97=_0x7e73[_0x1e7098];return _0x222d97;};'use strict';var ChatGroupEvents=require(_0x37e7('0x0'));var events=[_0x37e7('0x1'),'remove',_0x37e7('0x2')];function createListener(_0x492fb0,_0x276614){return function(_0x3329cd){_0x276614[_0x37e7('0x3')](_0x492fb0,_0x3329cd);};}function removeListener(_0x5f3e30,_0x5f36d4){return function(){ChatGroupEvents['removeListener'](_0x5f3e30,_0x5f36d4);};}exports['register']=function(_0x44f8a4){for(var _0x19094d=0x0,_0x38555d=events[_0x37e7('0x4')];_0x19094d<_0x38555d;_0x19094d++){var _0x13cdfb=events[_0x19094d];var _0x13e442=createListener(_0x37e7('0x5')+_0x13cdfb,_0x44f8a4);ChatGroupEvents['on'](_0x13cdfb,_0x13e442);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 8cafd8c..0b9f302 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 _0x8dc7=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','/:id/unread','/:id/members','getMembers','/:id/messages','getMessages','create','post','addMembers','/:id','update','delete','destroy','removeMembers','exports','multer','connect-timeout','express','Router'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x8dc7,0xf6));var _0x78dc=function(_0x4ee256,_0x4157d2){_0x4ee256=_0x4ee256-0x0;var _0x47bd75=_0x8dc7[_0x4ee256];return _0x47bd75;};'use strict';var multer=require(_0x78dc('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x78dc('0x1'));var express=require(_0x78dc('0x2'));var router=express[_0x78dc('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x78dc('0x4'));var interaction=require(_0x78dc('0x5'));var config=require(_0x78dc('0x6'));var controller=require('./chatGroup.controller');router[_0x78dc('0x7')]('/',auth['isAuthenticated'](),controller[_0x78dc('0x8')]);router[_0x78dc('0x7')](_0x78dc('0x9'),auth[_0x78dc('0xa')](),controller['describe']);router['get']('/:id',auth[_0x78dc('0xa')](),controller['show']);router[_0x78dc('0x7')](_0x78dc('0xb'),auth[_0x78dc('0xa')](),controller['getUnread']);router[_0x78dc('0x7')](_0x78dc('0xc'),auth[_0x78dc('0xa')](),controller[_0x78dc('0xd')]);router[_0x78dc('0x7')](_0x78dc('0xe'),auth['isAuthenticated'](),controller[_0x78dc('0xf')]);router['post']('/',auth[_0x78dc('0xa')](),controller[_0x78dc('0x10')]);router[_0x78dc('0x11')]('/:id/members',auth[_0x78dc('0xa')](),controller[_0x78dc('0x12')]);router[_0x78dc('0x11')](_0x78dc('0xe'),auth[_0x78dc('0xa')](),controller['addMessage']);router['put'](_0x78dc('0x13'),auth[_0x78dc('0xa')](),controller[_0x78dc('0x14')]);router[_0x78dc('0x15')](_0x78dc('0x13'),auth['isAuthenticated'](),controller[_0x78dc('0x16')]);router[_0x78dc('0x15')](_0x78dc('0xc'),auth[_0x78dc('0xa')](),controller[_0x78dc('0x17')]);module[_0x78dc('0x18')]=router; \ No newline at end of file +var _0xb581=['/:id/members','/:id/messages','getMessages','post','create','addMembers','addMessage','put','update','destroy','delete','exports','util','path','express','Router','fs-extra','../../config/environment','get','index','isAuthenticated','describe','/:id','show','/:id/unread'];(function(_0x462899,_0x3981da){var _0x5b4b3b=function(_0xfcc73e){while(--_0xfcc73e){_0x462899['push'](_0x462899['shift']());}};_0x5b4b3b(++_0x3981da);}(_0xb581,0x16a));var _0x1b58=function(_0x14c74f,_0xb85b73){_0x14c74f=_0x14c74f-0x0;var _0x5ac34e=_0xb581[_0x14c74f];return _0x5ac34e;};'use strict';var multer=require('multer');var util=require(_0x1b58('0x0'));var path=require(_0x1b58('0x1'));var timeout=require('connect-timeout');var express=require(_0x1b58('0x2'));var router=express[_0x1b58('0x3')]();var fs_extra=require(_0x1b58('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1b58('0x5'));var controller=require('./chatGroup.controller');router[_0x1b58('0x6')]('/',auth['isAuthenticated'](),controller[_0x1b58('0x7')]);router[_0x1b58('0x6')]('/describe',auth[_0x1b58('0x8')](),controller[_0x1b58('0x9')]);router['get'](_0x1b58('0xa'),auth[_0x1b58('0x8')](),controller[_0x1b58('0xb')]);router[_0x1b58('0x6')](_0x1b58('0xc'),auth[_0x1b58('0x8')](),controller['getUnread']);router[_0x1b58('0x6')](_0x1b58('0xd'),auth['isAuthenticated'](),controller['getMembers']);router[_0x1b58('0x6')](_0x1b58('0xe'),auth[_0x1b58('0x8')](),controller[_0x1b58('0xf')]);router[_0x1b58('0x10')]('/',auth[_0x1b58('0x8')](),controller[_0x1b58('0x11')]);router['post'](_0x1b58('0xd'),auth[_0x1b58('0x8')](),controller[_0x1b58('0x12')]);router[_0x1b58('0x10')](_0x1b58('0xe'),auth[_0x1b58('0x8')](),controller[_0x1b58('0x13')]);router[_0x1b58('0x14')]('/:id',auth[_0x1b58('0x8')](),controller[_0x1b58('0x15')]);router['delete'](_0x1b58('0xa'),auth['isAuthenticated'](),controller[_0x1b58('0x16')]);router[_0x1b58('0x17')](_0x1b58('0xd'),auth['isAuthenticated'](),controller['removeMembers']);module[_0x1b58('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 76ee537..195abe4 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 _0x25c2=['out','sequelize','BOOLEAN','INTEGER','star','thumb','TEXT','DATE','STRING','long'];(function(_0x763a66,_0x31e0b5){var _0x111ba4=function(_0x305099){while(--_0x305099){_0x763a66['push'](_0x763a66['shift']());}};_0x111ba4(++_0x31e0b5);}(_0x25c2,0xdd));var _0x225c=function(_0x34eb31,_0x8f0f70){_0x34eb31=_0x34eb31-0x0;var _0x254994=_0x25c2[_0x34eb31];return _0x254994;};'use strict';var Sequelize=require(_0x225c('0x0'));module['exports']={'closed':{'type':Sequelize[_0x225c('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x225c('0x2')]},'ratingType':{'type':Sequelize['ENUM'](_0x225c('0x3'),_0x225c('0x4')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x225c('0x5')]},'pathTranscript':{'type':Sequelize[_0x225c('0x5')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x225c('0x6')]},'disposition':{'type':Sequelize[_0x225c('0x7')]},'secondDisposition':{'type':Sequelize[_0x225c('0x7')]},'thirdDisposition':{'type':Sequelize[_0x225c('0x7')]},'note':{'type':Sequelize[_0x225c('0x7')]},'browserName':{'type':Sequelize[_0x225c('0x7')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x225c('0x7')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x225c('0x7')]},'deviceType':{'type':Sequelize[_0x225c('0x7')]},'referer':{'type':Sequelize[_0x225c('0x5')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x225c('0x5')](_0x225c('0x8'))},'read1stAt':{'type':Sequelize[_0x225c('0x6')]},'lastMsgAt':{'type':Sequelize[_0x225c('0x6')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x225c('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x225c('0x7')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0x225c('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0x225c('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0x38d0=['DATE','STRING','ENUM','exports','BOOLEAN','INTEGER','star','thumb','TEXT'];(function(_0x2a7131,_0xff2edf){var _0xf1e7b4=function(_0x23265b){while(--_0x23265b){_0x2a7131['push'](_0x2a7131['shift']());}};_0xf1e7b4(++_0xff2edf);}(_0x38d0,0x123));var _0x038d=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0x38d0[_0x88cd7b];return _0x56fcc8;};'use strict';var Sequelize=require('sequelize');module[_0x038d('0x0')]={'closed':{'type':Sequelize[_0x038d('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x038d('0x2')]},'ratingType':{'type':Sequelize['ENUM'](_0x038d('0x3'),_0x038d('0x4')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x038d('0x5')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x038d('0x6')]},'disposition':{'type':Sequelize[_0x038d('0x7')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x038d('0x7')]},'note':{'type':Sequelize[_0x038d('0x7')]},'browserName':{'type':Sequelize[_0x038d('0x7')]},'browserVersion':{'type':Sequelize[_0x038d('0x7')]},'osName':{'type':Sequelize[_0x038d('0x7')]},'osVersion':{'type':Sequelize[_0x038d('0x7')]},'deviceModel':{'type':Sequelize[_0x038d('0x7')]},'deviceVendor':{'type':Sequelize[_0x038d('0x7')]},'deviceType':{'type':Sequelize[_0x038d('0x7')]},'referer':{'type':Sequelize[_0x038d('0x5')]},'customerIp':{'type':Sequelize[_0x038d('0x7')]},'formData':{'type':Sequelize[_0x038d('0x5')]('long')},'read1stAt':{'type':Sequelize[_0x038d('0x6')]},'lastMsgAt':{'type':Sequelize[_0x038d('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x038d('0x8')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x038d('0x7')]},'customerPort':{'type':Sequelize[_0x038d('0x7')]},'vidaooSessionId':{'type':Sequelize[_0x038d('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0x038d('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 32ccf73..267d08c 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 _0x496f=['Visitor','agentIdentifier','website_alias','System','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','direction','secret','appendFileSync','Smtp','CloudProvider','getSmtpOptions','sendMail','mailTranscript','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','keys','intersection','length','nolimit','order','sort','where','pick','ChatInteractionId','filter','merge','$gte','split','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','getMyMessages','hasOwnProperty','map','include','push','setTags','spread','Tag','color','chatInteractionTags:save','removeTags','download','toString','files','tmp','server','attachments','transcript-%d-%s.zip','firstName','createdAt','get','mkdirSync','Chat','Account','Owner','N.A.','closedAt','disposition','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','createWriteStream','lastName','out','read','value','renderFile','views','transcript-','err','rimraf','zip-dir','request-promise','moment','util','path','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','./chatInteraction.socket','register','jayson/promise','client','http','then','info','ChatInteraction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','sendStatus','end','status','offset','limit','count','set','Content-Range','json','update','destroy','stack','name','render','body','agent','account','index','rawAttributes','type','user','show','params','model','ChatInteraction','query','filters','attributes','fields','includeAll','options','find','describe','createVidaooSession','ChatWebsite','findOne','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','fullname','email','contact','POST','follow','isNull','parse','metadata','Sequelize','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','create','ValidationError','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','Contact','abandon','UserId','Interaction\x20already\x20assigned','closed','AbandonInteraction','attachmentUpload','file','basename','filename','mimetype','Attachment','attachmentDownload','Unauthorized','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','User','CmContact','ContactId','%s%d','agentAlias','customer'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0x496f,0x11c));var _0xf496=function(_0x266618,_0x18f637){_0x266618=_0x266618-0x0;var _0x54dbf5=_0x496f[_0x266618];return _0x54dbf5;};'use strict';var rimraf=require(_0xf496('0x0'));var zipdir=require(_0xf496('0x1'));var rp=require(_0xf496('0x2'));var moment=require(_0xf496('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf496('0x4'));var path=require(_0xf496('0x5'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var Redis=require(_0xf496('0x6'));var interaction=require('../../components/interaction/service');var qs=require(_0xf496('0x7'));var pdf=require(_0xf496('0x8'));var logger=require(_0xf496('0x9'))(_0xf496('0xa'));var config=require(_0xf496('0xb'));var db=require(_0xf496('0xc'))['db'];config['redis']=_[_0xf496('0xd')](config[_0xf496('0xe')],{'host':_0xf496('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf496('0xe')]));require(_0xf496('0x10'))[_0xf496('0x11')](socket);var jayson=require(_0xf496('0x12'));var client=jayson[_0xf496('0x13')][_0xf496('0x14')]({'port':0x232b});var client9004=jayson['client'][_0xf496('0x14')]({'port':0x232c});function respondWithRpcPromise(_0x24e912,_0x2f16fc,_0x3baa99,_0x1517ba){return new BPromise(function(_0x178961,_0x5d194e){var _0x64a79c=_0x1517ba||client;return _0x64a79c['request'](_0x24e912,_0x3baa99)[_0xf496('0x15')](function(_0x158094){logger[_0xf496('0x16')](_0xf496('0x17'),_0x2f16fc,'request\x20sent');logger[_0xf496('0x18')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x2f16fc,_0xf496('0x19'),JSON[_0xf496('0x1a')](_0x158094));if(_0x158094['error']){if(_0x158094[_0xf496('0x1b')][_0xf496('0x1c')]===0x1f4){logger[_0xf496('0x1b')](_0xf496('0x17'),_0x2f16fc,_0x158094[_0xf496('0x1b')][_0xf496('0x1d')]);return _0x5d194e(_0x158094[_0xf496('0x1b')][_0xf496('0x1d')]);}logger[_0xf496('0x1b')](_0xf496('0x17'),_0x2f16fc,_0x158094[_0xf496('0x1b')][_0xf496('0x1d')]);return _0x178961(_0x158094[_0xf496('0x1b')][_0xf496('0x1d')]);}else{logger[_0xf496('0x16')](_0xf496('0x17'),_0x2f16fc,_0xf496('0x19'));_0x178961(_0x158094[_0xf496('0x1e')][_0xf496('0x1d')]);}})[_0xf496('0x1f')](function(_0x1cc66e){logger[_0xf496('0x1b')](_0xf496('0x17'),_0x2f16fc,_0x1cc66e);_0x5d194e(_0x1cc66e);});});}function respondWithStatusCode(_0x3b9e25,_0x546915){_0x546915=_0x546915||0xcc;return function(_0x56f8a5){if(_0x56f8a5){return _0x3b9e25[_0xf496('0x20')](_0x546915);}return _0x3b9e25['status'](_0x546915)[_0xf496('0x21')]();};}function respondWithResult(_0x2e4e51,_0x6ae0cf){_0x6ae0cf=_0x6ae0cf||0xc8;return function(_0x17fae7){if(_0x17fae7){return _0x2e4e51[_0xf496('0x22')](_0x6ae0cf)['json'](_0x17fae7);}};}function respondWithFilteredResult(_0x421e8a,_0x5e2338){return function(_0x21fab3){if(_0x21fab3){var _0x33b02a=typeof _0x5e2338[_0xf496('0x23')]==='undefined'&&typeof _0x5e2338[_0xf496('0x24')]==='undefined';var _0x419d5e=_0x21fab3[_0xf496('0x25')];var _0x45da56=_0x33b02a?0x0:_0x5e2338[_0xf496('0x23')];var _0x506ff3=_0x33b02a?_0x21fab3[_0xf496('0x25')]:_0x5e2338[_0xf496('0x23')]+_0x5e2338[_0xf496('0x24')];var _0x2bd07f;if(_0x506ff3>=_0x419d5e){_0x506ff3=_0x419d5e;_0x2bd07f=0xc8;}else{_0x2bd07f=0xce;}_0x421e8a[_0xf496('0x22')](_0x2bd07f);return _0x421e8a[_0xf496('0x26')](_0xf496('0x27'),_0x45da56+'-'+_0x506ff3+'/'+_0x419d5e)[_0xf496('0x28')](_0x21fab3);}return null;};}function saveUpdates(_0x4a6bd6){return function(_0x539f3d){if(_0x539f3d){return _0x539f3d[_0xf496('0x29')](_0x4a6bd6)[_0xf496('0x15')](function(_0x1cb55c){return _0x1cb55c;});}return null;};}function removeEntity(_0x1ce598){return function(_0x11d03f){if(_0x11d03f){return _0x11d03f[_0xf496('0x2a')]()[_0xf496('0x15')](function(){_0x1ce598[_0xf496('0x22')](0xcc)[_0xf496('0x21')]();});}};}function handleEntityNotFound(_0x3892bb){return function(_0x43277c){if(!_0x43277c){_0x3892bb[_0xf496('0x20')](0x194);}return _0x43277c;};}function handleError(_0x391f2d,_0x4ab9d0){_0x4ab9d0=_0x4ab9d0||0x1f4;return function(_0x125a65){logger[_0xf496('0x1b')](_0x125a65[_0xf496('0x2b')]);if(_0x125a65[_0xf496('0x2c')]){delete _0x125a65[_0xf496('0x2c')];}_0x391f2d[_0xf496('0x22')](_0x4ab9d0)['send'](_0x125a65);};}function getMustacheRender(_0x5af3ad,_0x51b4f4){return Mustache[_0xf496('0x2d')](_0x5af3ad,_['merge'](_0x51b4f4[_0xf496('0x2e')],{'contact':_0x51b4f4['contact'],'message':_0x51b4f4[_0xf496('0x1d')],'agent':_0x51b4f4[_0xf496('0x2f')],'interaction':_0x51b4f4['interaction'],'account':_0x51b4f4[_0xf496('0x30')]}))||'';}exports[_0xf496('0x31')]=function(_0x3d0dc3,_0x2bfb4d){var _0xc38a1c={};var _0x553747=_['map'](db['ChatInteraction'][_0xf496('0x32')],function(_0x57a9dd){return{'name':_0x57a9dd['fieldName'],'type':_0x57a9dd[_0xf496('0x33')]['key']};});_0xc38a1c=qs['getOptions'](_0x553747,_0x3d0dc3);return interaction['findAll']('chat',_0x3d0dc3['query'],_0x3d0dc3[_0xf496('0x34')],_0xc38a1c,_0x553747)[_0xf496('0x15')](respondWithFilteredResult(_0x2bfb4d,_0xc38a1c))[_0xf496('0x1f')](handleError(_0x2bfb4d,null));};exports[_0xf496('0x35')]=function(_0x3ec716,_0x13693d){var _0x55dfb5={'raw':![],'where':{'id':_0x3ec716[_0xf496('0x36')]['id']}},_0x52f764={};_0x52f764[_0xf496('0x37')]=_['keys'](db[_0xf496('0x38')]['rawAttributes']);_0x52f764['query']=_['keys'](_0x3ec716[_0xf496('0x39')]);_0x52f764[_0xf496('0x3a')]=_['intersection'](_0x52f764[_0xf496('0x37')],_0x52f764['query']);_0x55dfb5[_0xf496('0x3b')]=_['intersection'](_0x52f764['model'],qs['fields'](_0x3ec716[_0xf496('0x39')][_0xf496('0x3c')]));_0x55dfb5[_0xf496('0x3b')]=_0x55dfb5[_0xf496('0x3b')]['length']?_0x55dfb5[_0xf496('0x3b')]:_0x52f764['model'];if(_0x3ec716[_0xf496('0x39')][_0xf496('0x3d')]){_0x55dfb5['include']=[{'all':!![]}];}_0x55dfb5=_['merge']({},_0x55dfb5,_0x3ec716[_0xf496('0x3e')]);return db[_0xf496('0x38')][_0xf496('0x3f')](_0x55dfb5)['then'](handleEntityNotFound(_0x13693d,null))[_0xf496('0x15')](respondWithResult(_0x13693d,null))[_0xf496('0x1f')](handleError(_0x13693d,null));};exports['create']=function(_0xb4498a,_0x26ca90){return db[_0xf496('0x38')]['create'](_0xb4498a[_0xf496('0x2e')],{})['then'](respondWithResult(_0x26ca90,0xc9))[_0xf496('0x1f')](handleError(_0x26ca90,null));};exports[_0xf496('0x29')]=function(_0x615c5d,_0x3beb45){if(_0x615c5d[_0xf496('0x2e')]['id']){delete _0x615c5d[_0xf496('0x2e')]['id'];}return db[_0xf496('0x38')][_0xf496('0x3f')]({'where':{'id':_0x615c5d[_0xf496('0x36')]['id']}})[_0xf496('0x15')](handleEntityNotFound(_0x3beb45,null))['then'](saveUpdates(_0x615c5d[_0xf496('0x2e')],null))[_0xf496('0x15')](respondWithResult(_0x3beb45,null))[_0xf496('0x1f')](handleError(_0x3beb45,null));};exports[_0xf496('0x2a')]=function(_0x273303,_0x4aad55){return db['ChatInteraction']['find']({'where':{'id':_0x273303[_0xf496('0x36')]['id']}})[_0xf496('0x15')](handleEntityNotFound(_0x4aad55,null))[_0xf496('0x15')](removeEntity(_0x4aad55,null))[_0xf496('0x1f')](handleError(_0x4aad55,null));};exports[_0xf496('0x40')]=function(_0x3ad634,_0xf5f529){return db[_0xf496('0x38')][_0xf496('0x40')]()[_0xf496('0x15')](respondWithResult(_0xf5f529,null))[_0xf496('0x1f')](handleError(_0xf5f529,null));};exports[_0xf496('0x41')]=function(_0x5d1c33,_0x6213c2){var _0x50df69=_0x5d1c33[_0xf496('0x36')]['id'];var _0x1a05b1;var _0x4b99ce;var _0x50b33f;return db['ChatInteraction']['findOne']({'where':{'id':_0x50df69}})[_0xf496('0x15')](function(_0x23a6aa){_0x1a05b1=_0x23a6aa;return db[_0xf496('0x42')][_0xf496('0x43')]({'where':{'id':_0x23a6aa[_0xf496('0x44')]},'attributes':['id',_0xf496('0x45'),_0xf496('0x46'),_0xf496('0x47'),_0xf496('0x48'),_0xf496('0x49')],'raw':!![]});})[_0xf496('0x15')](function(_0xc21710){if(_0xc21710&&_0xc21710[_0xf496('0x45')]&&_0xc21710[_0xf496('0x46')]){_0x4b99ce=_0xc21710;var _0x30b8a6={'interaction':{'id':_0x50df69},'agent':{'id':_0x5d1c33['user']['id'],'name':_0x5d1c33[_0xf496('0x34')][_0xf496('0x2c')],'fullname':_0x5d1c33[_0xf496('0x34')][_0xf496('0x4a')],'email':_0x5d1c33[_0xf496('0x34')][_0xf496('0x4b')]},'contact':_0x5d1c33[_0xf496('0x2e')][_0xf496('0x4c')],'account':_0x5d1c33['body'][_0xf496('0x30')]};var _0x161070={'rejectUnauthorized':![],'method':_0xf496('0x4d'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0xc21710[_0xf496('0x45')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x5d1c33['user'][_0xf496('0x4b')]],'buttons':null,'topic':_0x4b99ce['vidaooTopic'],'note':_['isNull'](_0x4b99ce[_0xf496('0x48')])?null:getMustacheRender(_0x4b99ce[_0xf496('0x48')],_0x30b8a6),'metadata':null},'redirect':_0xf496('0x4e'),'json':!![]};try{if(!_[_0xf496('0x4f')](_0x4b99ce[_0xf496('0x49')])){var _0x2e2989=getMustacheRender(_0x4b99ce[_0xf496('0x49')],_0x30b8a6);var _0x3da782=JSON[_0xf496('0x50')](_0x2e2989);_0x161070[_0xf496('0x2e')][_0xf496('0x51')]=_0x3da782;}}catch(_0x1a8099){throw new db[(_0xf496('0x52'))]['ValidationError'](_0xf496('0x53'));}return rp(_0x161070);}else{throw new db[(_0xf496('0x52'))]['ValidationError'](_0xf496('0x54'));}})[_0xf496('0x15')](function(_0x425944){_0x50b33f=_0x425944;if(_0x50b33f['id']){var _0x415d30={'body':_0x50b33f[_0xf496('0x55')],'ChatWebsiteId':_0x4b99ce['id'],'ChatInteractionId':_0x1a05b1['id'],'direction':'out','UserId':_0x5d1c33[_0xf496('0x34')]['id']};return db[_0xf496('0x56')][_0xf496('0x57')](_0x415d30,{});}else{throw new db[(_0xf496('0x52'))][(_0xf496('0x58'))](_0xf496('0x59'));}})[_0xf496('0x15')](function(){return _0x1a05b1[_0xf496('0x5a')]({'vidaooSessionId':_0x50b33f['id']});})['then'](respondWithResult(_0x6213c2,null))[_0xf496('0x1f')](handleError(_0x6213c2,null));};exports['customUpdate']=function(_0xd8e5e8,_0x2e1340){if(_0xd8e5e8['body']['id']){delete _0xd8e5e8[_0xf496('0x2e')]['id'];}return db['ChatInteraction'][_0xf496('0x3f')]({'where':{'id':_0xd8e5e8[_0xf496('0x36')]['id']},'include':[{'model':db['CmContact'],'as':_0xf496('0x5b')}]})[_0xf496('0x15')](handleEntityNotFound(_0x2e1340,null))[_0xf496('0x15')](saveUpdates(_0xd8e5e8['body'],null))[_0xf496('0x15')](respondWithResult(_0x2e1340,null))[_0xf496('0x1f')](handleError(_0x2e1340,null));};exports[_0xf496('0x5c')]=function(_0x20fb13,_0x48a253){if(_0x20fb13[_0xf496('0x2e')]['id']){delete _0x20fb13['body']['id'];}return db[_0xf496('0x38')][_0xf496('0x3f')]({'where':{'id':_0x20fb13[_0xf496('0x36')]['id']}})['then'](function(_0xc73e1e){if(!_0xc73e1e){logger[_0xf496('0x1b')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0xf496('0x5c'),0x194,'entity\x20not\x20found');_0x48a253[_0xf496('0x20')](0x194);}else{if(_0xc73e1e[_0xf496('0x5d')]){throw new db[(_0xf496('0x52'))][(_0xf496('0x58'))](_0xf496('0x5e'));}}return _0xc73e1e;})['then'](function(_0x238d19){if(_0x238d19){return _0x238d19['update']({'closed':_0x20fb13[_0xf496('0x2e')][_0xf496('0x5f')],'disposition':_0x20fb13[_0xf496('0x2e')]['disposition']})[_0xf496('0x15')](function(_0x598de3){return _0x598de3;});}})[_0xf496('0x15')](function(){return respondWithRpcPromise(_0xf496('0x60'),_0xf496('0x5c'),_0x20fb13[_0xf496('0x2e')],client9004);})['then'](respondWithResult(_0x48a253,null))[_0xf496('0x1f')](handleError(_0x48a253,null));};exports[_0xf496('0x61')]=function(_0x34353b,_0x39425c){_0x34353b['body'][_0xf496('0x2c')]=_0x34353b[_0xf496('0x62')]['originalname'];_0x34353b[_0xf496('0x2e')][_0xf496('0x63')]=_0x34353b[_0xf496('0x62')][_0xf496('0x64')];_0x34353b[_0xf496('0x2e')][_0xf496('0x33')]=_0x34353b[_0xf496('0x62')][_0xf496('0x65')];return db[_0xf496('0x66')][_0xf496('0x57')](_0x34353b[_0xf496('0x2e')])[_0xf496('0x15')](respondWithResult(_0x39425c,0xc9))[_0xf496('0x1f')](handleError(_0x39425c,null));};exports[_0xf496('0x67')]=function(_0x3ff8e7,_0x25583a){return db[_0xf496('0x38')][_0xf496('0x43')]({'where':{'id':_0x3ff8e7['params']['id']},'raw':!![]})[_0xf496('0x15')](handleEntityNotFound(_0x25583a,null))[_0xf496('0x15')](function(_0x10aa11){if(_0x10aa11){if(_0x10aa11[_0xf496('0x5f')]){return _0x25583a[_0xf496('0x22')](0x193)['json']({'status':0x193,'message':_0xf496('0x68')});}return db[_0xf496('0x66')]['findOne']({'where':{'id':_0x3ff8e7[_0xf496('0x39')]['attachId']},'raw':!![]})[_0xf496('0x15')](handleEntityNotFound(_0x25583a,null));}})[_0xf496('0x15')](function(_0x40ef09){if(_0x40ef09){var _0x146862=_0x40ef09[_0xf496('0x69')]!==null;var _0x3dd1ce=path[_0xf496('0x6a')](config[_0xf496('0x6b')],_0xf496('0x6c'));if(_0x146862){_0x3dd1ce=path['join'](_0x3dd1ce,_0xf496('0x6d'));}var _0x55bff9=path['join'](_0x3dd1ce,_0x40ef09['basename']);return _0x25583a['download'](_0x55bff9);}})[_0xf496('0x1f')](handleError(_0x25583a,null));};exports['close']=function(_0x41ee5f,_0x3b735a){var _0x39da89=null;var _0x371950=null;var _0x1a27dd=null;if(_0x41ee5f[_0xf496('0x2e')]['id']){delete _0x41ee5f[_0xf496('0x2e')]['id'];}if(_0x41ee5f['body']['mailTranscript']){_0x1a27dd=path[_0xf496('0x6a')](config[_0xf496('0x6b')],_0xf496('0x6e'),util[_0xf496('0x6f')](_0xf496('0x70'),Date[_0xf496('0x71')]()));_0x41ee5f[_0xf496('0x2e')][_0xf496('0x72')]=_0x1a27dd;}return db['ChatInteraction'][_0xf496('0x3f')]({'where':{'id':_0x41ee5f[_0xf496('0x36')]['id']},'include':[{'model':db[_0xf496('0x56')],'as':_0xf496('0x73'),'include':[{'model':db[_0xf496('0x74')],'as':_0xf496('0x74')}]}]})[_0xf496('0x15')](handleEntityNotFound(_0x3b735a,null))[_0xf496('0x15')](saveUpdates(_0x41ee5f[_0xf496('0x2e')],null))[_0xf496('0x15')](function(_0x4b4b79){if(_0x4b4b79){_0x39da89=_0x4b4b79;return db[_0xf496('0x42')][_0xf496('0x3f')]({'where':{'id':_0x39da89[_0xf496('0x44')]}});}})[_0xf496('0x15')](function(_0x2af0a4){if(_0x2af0a4){_0x371950=_0x2af0a4;return db[_0xf496('0x75')][_0xf496('0x3f')]({'where':{'id':_0x39da89[_0xf496('0x76')]}});}})[_0xf496('0x15')](function(_0x169017){if(_0x169017){if(_0x1a27dd){var _0x51941f=null;for(var _0x384253=0x1;_0x384253<_0x39da89['Messages']['length'];++_0x384253){_0x51941f=_0x39da89[_0xf496('0x73')][_0x384253];var _0x40e16f=_0x51941f['UserId']?util[_0xf496('0x6f')](_0xf496('0x77'),_0x371950[_0xf496('0x78')],_0x51941f[_0xf496('0x5d')]):'System';var _0xd90099=_0x41ee5f[_0xf496('0x2e')][_0xf496('0x79')]||util['format'](_0xf496('0x77'),_0xf496('0x7a'),_0x51941f[_0xf496('0x76')]);switch(_0x371950[_0xf496('0x7b')]){case _0xf496('0x7c'):_0x40e16f=_0x51941f[_0xf496('0x5d')]?util[_0xf496('0x6f')](_0xf496('0x77'),_0x371950['agentAlias'],_0x51941f[_0xf496('0x5d')]):_0xf496('0x7d');break;case _0xf496('0x7e'):_0x40e16f=_0x51941f[_0xf496('0x5d')]?_0x51941f['User'][_0xf496('0x7f')]||_0x51941f[_0xf496('0x74')][_0xf496('0x4a')]:'System';break;case _0xf496('0x80'):_0x40e16f=_0x51941f[_0xf496('0x5d')]?_0x51941f['User'][_0xf496('0x4a')]:'System';break;default:_0x40e16f=_0x51941f[_0xf496('0x5d')]?util[_0xf496('0x6f')]('%s%d',_0x371950[_0xf496('0x78')],_0x51941f[_0xf496('0x5d')]):_0xf496('0x7d');}var _0x2459ce=util[_0xf496('0x6f')](_0xf496('0x81'),moment(_0x51941f['createdAt'])[_0xf496('0x6f')]('MM/DD/YYYY\x20HH:mm:ss'),_0x51941f[_0xf496('0x82')]==='in'?_0xd90099:_0x40e16f,_0x51941f['body']);if(!_0x51941f[_0xf496('0x83')]){fs[_0xf496('0x84')](_0x1a27dd,_0x2459ce);}}return db['MailAccount'][_0xf496('0x43')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xf496('0x85'),'raw':!![],'include':[{'model':db[_0xf496('0x86')],'as':'CloudProvider','raw':!![]}]}]});}}})[_0xf496('0x15')](function(_0x18208b){if(!_0x18208b||!_0x18208b[_0xf496('0x85')]||!_0x41ee5f[_0xf496('0x2e')])return _0x39da89;var _0x579a46=_0x18208b[_0xf496('0x87')]();return respondWithRpcPromise('SendMail',_0xf496('0x88'),{'account':_0x579a46,'message':{'from':util[_0xf496('0x6f')]('\x22%s\x22\x20<%s>',_0x18208b[_0xf496('0x2c')],_0x18208b[_0xf496('0x4b')]||_0x18208b[_0xf496('0x85')][_0xf496('0x34')]),'to':_0x41ee5f[_0xf496('0x2e')][_0xf496('0x89')],'subject':_0xf496('0x8a'),'text':util[_0xf496('0x6f')](_0xf496('0x8b'),_0x41ee5f['body'][_0xf496('0x89')]),'attachments':[{'path':_0x1a27dd}]}})[_0xf496('0x15')](function(){return _0x39da89;})[_0xf496('0x1f')](function(_0x424271){logger[_0xf496('0x1b')](_0x424271);});})[_0xf496('0x15')](respondWithStatusCode(_0x3b735a,0xc8))['catch'](handleError(_0x3b735a,null));};exports[_0xf496('0x8c')]=function(_0x1b067e,_0x354541){return db[_0xf496('0x56')][_0xf496('0x3f')]({'where':{'id':_0x1b067e[_0xf496('0x36')]['id']}})['then'](handleEntityNotFound(_0x354541,null))[_0xf496('0x15')](function(_0x3b3607){if(_0x3b3607){return _0x3b3607[_0xf496('0x8c')](_0x1b067e[_0xf496('0x2e')][_0xf496('0x8d')],_['omit'](_0x1b067e[_0xf496('0x2e')],[_0xf496('0x8d'),'id'])||{});}})[_0xf496('0x15')](respondWithResult(_0x354541,null))['catch'](handleError(_0x354541,null));};exports['getMessages']=function(_0x295547,_0x2e9f30){var _0x14af3b={'raw':![],'where':{}};var _0x37f5cc={};var _0x47f273={'count':0x0,'rows':[]};return db[_0xf496('0x38')]['findOne']({'where':{'id':_0x295547['params']['id']}})['then'](handleEntityNotFound(_0x2e9f30,null))[_0xf496('0x15')](function(_0x47943c){if(_0x47943c){_0x37f5cc[_0xf496('0x37')]=_[_0xf496('0x8e')](db[_0xf496('0x56')][_0xf496('0x32')]);_0x37f5cc[_0xf496('0x39')]=_[_0xf496('0x8e')](_0x295547[_0xf496('0x39')]);_0x37f5cc[_0xf496('0x3a')]=_[_0xf496('0x8f')](_0x37f5cc[_0xf496('0x37')],_0x37f5cc[_0xf496('0x39')]);_0x14af3b[_0xf496('0x3b')]=_['intersection'](_0x37f5cc[_0xf496('0x37')],qs['fields'](_0x295547[_0xf496('0x39')]['fields']));_0x14af3b[_0xf496('0x3b')]=_0x14af3b[_0xf496('0x3b')][_0xf496('0x90')]?_0x14af3b['attributes']:_0x37f5cc[_0xf496('0x37')];if(!_0x295547[_0xf496('0x39')]['hasOwnProperty'](_0xf496('0x91'))){_0x14af3b[_0xf496('0x24')]=qs[_0xf496('0x24')](_0x295547[_0xf496('0x39')][_0xf496('0x24')]);_0x14af3b[_0xf496('0x23')]=qs[_0xf496('0x23')](_0x295547[_0xf496('0x39')]['offset']);}_0x14af3b[_0xf496('0x92')]=qs[_0xf496('0x93')](_0x295547['query']['sort']);_0x14af3b[_0xf496('0x94')]=qs[_0xf496('0x3a')](_[_0xf496('0x95')](_0x295547[_0xf496('0x39')],_0x37f5cc[_0xf496('0x3a')]));_0x14af3b[_0xf496('0x94')][_0xf496('0x96')]=_0x47943c['id'];if(_0x295547[_0xf496('0x39')][_0xf496('0x97')]){_0x14af3b['where']=_[_0xf496('0x98')](_0x14af3b[_0xf496('0x94')],{'$or':_['map'](_0x14af3b[_0xf496('0x3b')],function(_0x3bb8f1){var _0x5615b0={};_0x5615b0[_0x3bb8f1]={'$like':'%'+_0x295547[_0xf496('0x39')][_0xf496('0x97')]+'%'};return _0x5615b0;})});}if(_0x295547['query'][_0xf496('0x99')]){var _0x204ce1=_0x295547[_0xf496('0x39')][_0xf496('0x99')][_0xf496('0x9a')](',');var _0x2a31c0={};_0x2a31c0[_0x204ce1[0x0]]={'$gte':moment(_0x204ce1[0x1])[_0xf496('0x6f')](_0xf496('0x9b'))};_0x14af3b[_0xf496('0x94')]=_[_0xf496('0x98')](_0x14af3b['where'],_0x2a31c0);}_0x14af3b=_[_0xf496('0x98')]({},_0x14af3b,_0x295547['options']);return db['ChatMessage']['count']({'where':_0x14af3b[_0xf496('0x94')]})[_0xf496('0x15')](function(_0x5b4e54){_0x47f273[_0xf496('0x25')]=_0x5b4e54;if(_0x295547[_0xf496('0x39')][_0xf496('0x3d')]){_0x14af3b['include']=[{'all':!![]}];}return db[_0xf496('0x56')][_0xf496('0x9c')](_0x14af3b);})['then'](function(_0x16fa00){_0x47f273[_0xf496('0x9d')]=_0x16fa00;return _0x47f273;});}})[_0xf496('0x15')](respondWithFilteredResult(_0x2e9f30,_0x14af3b))[_0xf496('0x1f')](handleError(_0x2e9f30,null));};exports[_0xf496('0x9e')]=function(_0x271cd2,_0x4f4bd2){var _0xc3b2eb={'where':{}},_0x132928={},_0x5b3525={'count':0x0,'rows':[]};return db[_0xf496('0x38')][_0xf496('0x43')]({'where':{'id':_0x271cd2['params']['id']}})[_0xf496('0x15')](handleEntityNotFound(_0x4f4bd2,null))[_0xf496('0x15')](function(_0x3a3973){if(_0x3a3973){_0x132928[_0xf496('0x37')]=_[_0xf496('0x8e')](db['ChatMessage'][_0xf496('0x32')]);_0x132928['query']=_[_0xf496('0x8e')](_0x271cd2['query']);_0x132928['filters']=_['intersection'](_0x132928[_0xf496('0x37')],_0x132928[_0xf496('0x39')]);_0xc3b2eb[_0xf496('0x3b')]=_[_0xf496('0x8f')](_0x132928[_0xf496('0x37')],qs[_0xf496('0x3c')](_0x271cd2[_0xf496('0x39')]['fields']));_0xc3b2eb[_0xf496('0x3b')]=_0xc3b2eb['attributes'][_0xf496('0x90')]?_0xc3b2eb['attributes']:_0x132928['model'];if(!_0x271cd2[_0xf496('0x39')][_0xf496('0x9f')](_0xf496('0x91'))){_0xc3b2eb[_0xf496('0x24')]=qs[_0xf496('0x24')](_0x271cd2['query'][_0xf496('0x24')]);_0xc3b2eb['offset']=qs[_0xf496('0x23')](_0x271cd2[_0xf496('0x39')][_0xf496('0x23')]);}_0xc3b2eb[_0xf496('0x92')]=qs[_0xf496('0x93')](_0x271cd2['query'][_0xf496('0x93')]);_0xc3b2eb[_0xf496('0x94')]=qs[_0xf496('0x3a')](_[_0xf496('0x95')](_0x271cd2[_0xf496('0x39')],_0x132928[_0xf496('0x3a')]));_0xc3b2eb[_0xf496('0x94')][_0xf496('0x96')]=_0x3a3973['id'];if(_0x271cd2['query'][_0xf496('0x97')]){_0xc3b2eb[_0xf496('0x94')]=_['merge'](_0xc3b2eb['where'],{'$or':_[_0xf496('0xa0')](_0xc3b2eb[_0xf496('0x3b')],function(_0x533b75){var _0x94ba94={};_0x94ba94[_0x533b75]={'$like':'%'+_0x271cd2[_0xf496('0x39')][_0xf496('0x97')]+'%'};return _0x94ba94;})});}_0xc3b2eb[_0xf496('0x94')][_0xf496('0x83')]=![];if(_0x271cd2[_0xf496('0x39')]['id']){_0xc3b2eb[_0xf496('0x94')]['id']={'$gt':_0x271cd2[_0xf496('0x39')]['id']};}_0xc3b2eb=_[_0xf496('0x98')]({},_0xc3b2eb,_0x271cd2['options']);return db['ChatMessage'][_0xf496('0x25')]({'where':_0xc3b2eb[_0xf496('0x94')]})[_0xf496('0x15')](function(_0x1a1984){_0x5b3525[_0xf496('0x25')]=_0x1a1984;_0xc3b2eb[_0xf496('0xa1')]=[];if(_0x271cd2[_0xf496('0x39')]['includeAgent']){_0xc3b2eb[_0xf496('0xa1')][_0xf496('0xa2')]({'model':db['User'],'as':'User','attributes':['id',_0xf496('0x4a'),_0xf496('0x7f')]});}if(_0x271cd2[_0xf496('0x39')][_0xf496('0x3d')]){_0xc3b2eb[_0xf496('0xa1')]=[{'all':!![]}];}return db[_0xf496('0x56')][_0xf496('0x9c')](_0xc3b2eb);})[_0xf496('0x15')](function(_0x55ab46){_0x5b3525[_0xf496('0x9d')]=_0x55ab46;return _0x5b3525;});}})['then'](respondWithFilteredResult(_0x4f4bd2,_0xc3b2eb))[_0xf496('0x1f')](handleError(_0x4f4bd2,null));};exports['addTags']=function(_0x4ceb13,_0x98d145){return db['ChatInteraction']['find']({'where':{'id':_0x4ceb13[_0xf496('0x36')]['id']}})['then'](handleEntityNotFound(_0x98d145,null))[_0xf496('0x15')](function(_0x4d8514){if(_0x4d8514){return _0x4d8514[_0xf496('0xa3')](_0x4ceb13[_0xf496('0x2e')][_0xf496('0x8d')],_['omit'](_0x4ceb13[_0xf496('0x2e')],[_0xf496('0x8d'),'id'])||{})[_0xf496('0xa4')](function(){return db[_0xf496('0xa5')][_0xf496('0x9c')]({'attributes':['id',_0xf496('0x2c'),_0xf496('0xa6')],'where':{'id':_0x4ceb13[_0xf496('0x2e')][_0xf496('0x8d')]}});})[_0xf496('0x15')](function(_0x56e750){socket['emit'](_0xf496('0xa7'),{'id':Number(_0x4ceb13[_0xf496('0x36')]['id']),'tags':_0x56e750||[]});return{'id':Number(_0x4ceb13[_0xf496('0x36')]['id']),'tags':_0x56e750||[]};});}})[_0xf496('0x15')](respondWithResult(_0x98d145,null))[_0xf496('0x1f')](handleError(_0x98d145,null));};exports[_0xf496('0xa8')]=function(_0x39e2d7,_0x18b1cf){return db[_0xf496('0x38')][_0xf496('0x3f')]({'where':{'id':_0x39e2d7['params']['id']}})[_0xf496('0x15')](handleEntityNotFound(_0x18b1cf,null))[_0xf496('0x15')](function(_0x484bad){if(_0x484bad){return _0x484bad[_0xf496('0xa8')](_0x39e2d7[_0xf496('0x39')][_0xf496('0x8d')]);}})[_0xf496('0x15')](respondWithStatusCode(_0x18b1cf,null))[_0xf496('0x1f')](handleError(_0x18b1cf,null));};exports[_0xf496('0xa9')]=function(_0x49222c,_0x124371){var _0x350416=moment()['unix']()[_0xf496('0xaa')]();var _0x454b46=path[_0xf496('0x6a')](config[_0xf496('0x6b')],'server',_0xf496('0xab'),_0xf496('0xac'));var _0x3b13c9=path[_0xf496('0x6a')](config[_0xf496('0x6b')],_0xf496('0xad'),_0xf496('0xab'),_0xf496('0xae'));var _0x30803f=path[_0xf496('0x6a')](_0x454b46,_0x350416);var _0x20c055=util[_0xf496('0x6f')](_0xf496('0xaf'),_0x49222c[_0xf496('0x36')]['id'],_0x350416);var _0x37c9fc=path[_0xf496('0x6a')](_0x454b46,_0x20c055);var _0x4f3ae5=[];_0x4f3ae5['push']({'model':db[_0xf496('0x74')],'as':_0xf496('0x74'),'attributes':['id',_0xf496('0x4a')],'raw':!![]});_0x4f3ae5['push']({'model':db[_0xf496('0x75')],'as':_0xf496('0x5b'),'attributes':['id',_0xf496('0xb0'),'lastName'],'raw':!![]});if(_0x49222c[_0xf496('0x39')][_0xf496('0xae')]){_0x4f3ae5[_0xf496('0xa2')]({'model':db['Attachment'],'as':_0xf496('0x66'),'raw':!![]});}var _0x1cd7fa=[{'model':db['ChatMessage'],'as':'Messages','attributes':['id',_0xf496('0x2e'),_0xf496('0xb1'),_0xf496('0x82'),_0xf496('0x83'),'read'],'include':_0x4f3ae5}];_0x1cd7fa[_0xf496('0xa2')]({'model':db['ChatWebsite'],'as':'Account','attributes':['id','name']});_0x1cd7fa[_0xf496('0xa2')]({'model':db[_0xf496('0x74')],'as':'Owner','attributes':['id',_0xf496('0x4a')]});return db[_0xf496('0x38')][_0xf496('0x3f')]({'where':{'id':_0x49222c[_0xf496('0x36')]['id']},'include':_0x1cd7fa})[_0xf496('0x15')](handleEntityNotFound(_0x124371,null))['then'](function(_0xd71ff7){if(_0xd71ff7){var _0x2716e9=_0xd71ff7[_0xf496('0xb2')]({'plain':!![]});fs[_0xf496('0xb3')](_0x30803f);var _0x538136={'channel':_0xf496('0xb4'),'account':_0x2716e9[_0xf496('0xb5')][_0xf496('0x2c')],'agent':_0x2716e9[_0xf496('0xb6')]?_0x2716e9[_0xf496('0xb6')][_0xf496('0x4a')]:_0xf496('0xb7'),'createdAt':moment(_0x2716e9[_0xf496('0xb1')])['format'](_0xf496('0x9b'))['toString'](),'closedAt':_0x2716e9[_0xf496('0x5f')]?moment(_0x2716e9[_0xf496('0xb8')])[_0xf496('0x6f')]('YYYY-MM-DD\x20HH:mm:ss')[_0xf496('0xaa')]():'','disposition':_0x2716e9[_0xf496('0xb9')],'chatInfo':{'browser':_0x2716e9[_0xf496('0xba')],'os':_0x2716e9[_0xf496('0xbb')],'referer':_0x2716e9[_0xf496('0xbc')],'customerIp':_0x2716e9[_0xf496('0xbd')],'customerPort':_0x2716e9['customerPort']?_0x2716e9[_0xf496('0xbe')]:'N.A.'},'messages':_(_0x2716e9[_0xf496('0x73')])[_0xf496('0xbf')]()[_0xf496('0x97')]({'secret':![]})['map'](function(_0x53f0b8){if(_0x53f0b8[_0xf496('0x66')]){var _0x5dbc2a=path[_0xf496('0x6a')](_0x3b13c9,_0x53f0b8[_0xf496('0x66')][_0xf496('0x63')]);if(fs[_0xf496('0xc0')](_0x5dbc2a)){fs[_0xf496('0xc1')](_0x5dbc2a)['pipe'](fs[_0xf496('0xc2')](path[_0xf496('0x6a')](_0x30803f,_0x53f0b8['Attachment']['basename'])));}}return{'date':moment(_0x53f0b8[_0xf496('0xb1')])[_0xf496('0x6f')](_0xf496('0x9b'))[_0xf496('0xaa')](),'sender':_0x53f0b8[_0xf496('0x82')]==='out'?_0x53f0b8[_0xf496('0x74')]?_0x53f0b8[_0xf496('0x74')][_0xf496('0x4a')]:_0xf496('0x7d'):_0x53f0b8['Contact'][_0xf496('0xb0')]+(_0x53f0b8[_0xf496('0x5b')][_0xf496('0xc3')]?'\x20'+_0x53f0b8[_0xf496('0x5b')][_0xf496('0xc3')]:''),'body':_0x53f0b8[_0xf496('0x66')]?_0x53f0b8['Attachment']['basename']:_0x53f0b8['body'],'direction':_0x53f0b8[_0xf496('0x82')]===_0xf496('0xc4')?'A':'C','secret':_0x53f0b8[_0xf496('0x83')],'read':_0x53f0b8[_0xf496('0xc5')],'attachment':_0x53f0b8[_0xf496('0x66')]};})[_0xf496('0xc6')]()};return ejs[_0xf496('0xc7')](path[_0xf496('0x6a')](config[_0xf496('0x6b')],_0xf496('0xad'),_0xf496('0xc8'),'downloadInteraction.ejs'),{'interaction':_0x538136})[_0xf496('0x15')](function(_0x56db4b){var _0x27cdd=path[_0xf496('0x6a')](_0x30803f,_0xf496('0xc9')+_0x2716e9['id']+'-'+_0x350416+'.pdf');var _0x408ef8={'path':_0x27cdd,'channel':_0xf496('0xb4'),'interactionId':_0x2716e9['id']};return pdf['createPdfFromHTML'](_0x56db4b,_0x408ef8);})['then'](function(){return new Promise(function(_0x23510d,_0x354f9d){zipdir(_0x30803f,{'saveTo':_0x37c9fc},function(_0x44d1c8,_0x101571){if(_0x44d1c8)return _0x354f9d(_0x44d1c8);return _0x23510d(_0x101571);});})['then'](function(){return new BPromise(function(_0x49bc91,_0x17ac0c){rimraf(_0x30803f,function(_0x955893){if(_0x955893)_0x17ac0c(_0x955893);return _0x49bc91();});});})['then'](function(){return _0x124371[_0xf496('0xa9')](_0x37c9fc,_0x20c055,function(_0x55f15f){if(_0x55f15f){logger[_0xf496('0x1b')](_0xf496('0xca'),_0x55f15f);}else{fs['unlinkSync'](_0x37c9fc);}});});});}else{return _0x124371[_0xf496('0x20')](0xc8);}})[_0xf496('0x1f')](handleError(_0x124371,null));}; \ No newline at end of file +var _0xd3f3=['chatInteractionTags:save','removeTags','toString','files','tmp','server','attachments','transcript-%d-%s.zip','firstName','lastName','Account','Owner','get','mkdirSync','Chat','YYYY-MM-DD\x20HH:mm:ss','closedAt','browserName','referer','customerIp','customerPort','N.A.','tail','existsSync','pipe','createWriteStream','read','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','err','unlinkSync','rimraf','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','update','destroy','name','merge','agent','interaction','account','map','ChatInteraction','rawAttributes','fieldName','key','findAll','query','show','params','model','keys','filters','intersection','attributes','fields','length','includeAll','include','options','find','create','body','describe','createVidaooSession','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','user','email','contact','POST','isNull','follow','parse','metadata','Sequelize','Error\x20in\x20conversion\x20vidaooMetadata','out','ChatMessage','ValidationError','updateAttributes','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','UserId','closed','disposition','AbandonInteraction','originalname','basename','filename','file','mimetype','Attachment','findOne','Unauthorized','attachId','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','download','close','mailTranscript','root','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','ChatWebsite','ChatWebsiteId','ContactId','%s%d','System','customer','agentIdentifier','website_alias','agentAlias','agent_alias','User','alias','fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','Smtp','CloudProvider','SendMail','sendMail','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','order','sort','where','ChatInteractionId','filter','$gte','rows','getMyMessages','nolimit','pick','includeAgent','push','addTags','setTags','spread','Tag','emit'];(function(_0x24bfa3,_0x23311c){var _0x2d1f1a=function(_0x4dd338){while(--_0x4dd338){_0x24bfa3['push'](_0x24bfa3['shift']());}};_0x2d1f1a(++_0x23311c);}(_0xd3f3,0xf0));var _0x3d3f=function(_0x58273d,_0x2fefaf){_0x58273d=_0x58273d-0x0;var _0x8708b=_0xd3f3[_0x58273d];return _0x8708b;};'use strict';var rimraf=require(_0x3d3f('0x0'));var zipdir=require('zip-dir');var rp=require(_0x3d3f('0x1'));var moment=require(_0x3d3f('0x2'));var BPromise=require(_0x3d3f('0x3'));var Mustache=require(_0x3d3f('0x4'));var util=require(_0x3d3f('0x5'));var path=require(_0x3d3f('0x6'));var ejs=require(_0x3d3f('0x7'));var fs=require('fs');var _=require(_0x3d3f('0x8'));var Redis=require('ioredis');var interaction=require(_0x3d3f('0x9'));var qs=require(_0x3d3f('0xa'));var pdf=require(_0x3d3f('0xb'));var logger=require(_0x3d3f('0xc'))(_0x3d3f('0xd'));var config=require(_0x3d3f('0xe'));var db=require(_0x3d3f('0xf'))['db'];config[_0x3d3f('0x10')]=_[_0x3d3f('0x11')](config['redis'],{'host':_0x3d3f('0x12'),'port':0x18eb});var socket=require(_0x3d3f('0x13'))(new Redis(config[_0x3d3f('0x10')]));require(_0x3d3f('0x14'))['register'](socket);var jayson=require(_0x3d3f('0x15'));var client=jayson[_0x3d3f('0x16')][_0x3d3f('0x17')]({'port':0x232b});var client9004=jayson[_0x3d3f('0x16')][_0x3d3f('0x17')]({'port':0x232c});function respondWithRpcPromise(_0x56e3cf,_0x823a17,_0x140066,_0x5adee8){return new BPromise(function(_0x31e3c3,_0x2cfab5){var _0x446758=_0x5adee8||client;return _0x446758[_0x3d3f('0x18')](_0x56e3cf,_0x140066)[_0x3d3f('0x19')](function(_0x4a1ad2){logger[_0x3d3f('0x1a')](_0x3d3f('0x1b'),_0x823a17,_0x3d3f('0x1c'));logger[_0x3d3f('0x1d')](_0x3d3f('0x1e'),_0x823a17,_0x3d3f('0x1c'),JSON['stringify'](_0x4a1ad2));if(_0x4a1ad2[_0x3d3f('0x1f')]){if(_0x4a1ad2[_0x3d3f('0x1f')][_0x3d3f('0x20')]===0x1f4){logger[_0x3d3f('0x1f')](_0x3d3f('0x1b'),_0x823a17,_0x4a1ad2[_0x3d3f('0x1f')][_0x3d3f('0x21')]);return _0x2cfab5(_0x4a1ad2[_0x3d3f('0x1f')]['message']);}logger[_0x3d3f('0x1f')](_0x3d3f('0x1b'),_0x823a17,_0x4a1ad2['error']['message']);return _0x31e3c3(_0x4a1ad2[_0x3d3f('0x1f')]['message']);}else{logger[_0x3d3f('0x1a')](_0x3d3f('0x1b'),_0x823a17,_0x3d3f('0x1c'));_0x31e3c3(_0x4a1ad2[_0x3d3f('0x22')][_0x3d3f('0x21')]);}})[_0x3d3f('0x23')](function(_0x48586f){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x823a17,_0x48586f);_0x2cfab5(_0x48586f);});});}function respondWithStatusCode(_0x1cad89,_0xb2a258){_0xb2a258=_0xb2a258||0xcc;return function(_0x1d6f03){if(_0x1d6f03){return _0x1cad89[_0x3d3f('0x24')](_0xb2a258);}return _0x1cad89[_0x3d3f('0x25')](_0xb2a258)[_0x3d3f('0x26')]();};}function respondWithResult(_0x172c9f,_0x366b49){_0x366b49=_0x366b49||0xc8;return function(_0xb821ac){if(_0xb821ac){return _0x172c9f['status'](_0x366b49)[_0x3d3f('0x27')](_0xb821ac);}};}function respondWithFilteredResult(_0x363bc0,_0x1ee57f){return function(_0x7c14f9){if(_0x7c14f9){var _0x5b6681=typeof _0x1ee57f[_0x3d3f('0x28')]===_0x3d3f('0x29')&&typeof _0x1ee57f[_0x3d3f('0x2a')]==='undefined';var _0x26cf0e=_0x7c14f9[_0x3d3f('0x2b')];var _0x42bda9=_0x5b6681?0x0:_0x1ee57f['offset'];var _0x5bd482=_0x5b6681?_0x7c14f9[_0x3d3f('0x2b')]:_0x1ee57f[_0x3d3f('0x28')]+_0x1ee57f[_0x3d3f('0x2a')];var _0x58363d;if(_0x5bd482>=_0x26cf0e){_0x5bd482=_0x26cf0e;_0x58363d=0xc8;}else{_0x58363d=0xce;}_0x363bc0[_0x3d3f('0x25')](_0x58363d);return _0x363bc0[_0x3d3f('0x2c')]('Content-Range',_0x42bda9+'-'+_0x5bd482+'/'+_0x26cf0e)[_0x3d3f('0x27')](_0x7c14f9);}return null;};}function saveUpdates(_0x30848b){return function(_0x2737a0){if(_0x2737a0){return _0x2737a0[_0x3d3f('0x2d')](_0x30848b)['then'](function(_0x3b0578){return _0x3b0578;});}return null;};}function removeEntity(_0x154c0a){return function(_0xc2279f){if(_0xc2279f){return _0xc2279f[_0x3d3f('0x2e')]()['then'](function(){_0x154c0a[_0x3d3f('0x25')](0xcc)[_0x3d3f('0x26')]();});}};}function handleEntityNotFound(_0x421306){return function(_0x5b8d7e){if(!_0x5b8d7e){_0x421306[_0x3d3f('0x24')](0x194);}return _0x5b8d7e;};}function handleError(_0x3c172f,_0x3a45be){_0x3a45be=_0x3a45be||0x1f4;return function(_0x2c6737){logger['error'](_0x2c6737['stack']);if(_0x2c6737[_0x3d3f('0x2f')]){delete _0x2c6737[_0x3d3f('0x2f')];}_0x3c172f['status'](_0x3a45be)['send'](_0x2c6737);};}function getMustacheRender(_0x233e7a,_0x56a9f1){return Mustache['render'](_0x233e7a,_[_0x3d3f('0x30')](_0x56a9f1['body'],{'contact':_0x56a9f1['contact'],'message':_0x56a9f1[_0x3d3f('0x21')],'agent':_0x56a9f1[_0x3d3f('0x31')],'interaction':_0x56a9f1[_0x3d3f('0x32')],'account':_0x56a9f1[_0x3d3f('0x33')]}))||'';}exports['index']=function(_0x605a40,_0x16d723){var _0x1030d5={};var _0x42090e=_[_0x3d3f('0x34')](db[_0x3d3f('0x35')][_0x3d3f('0x36')],function(_0x5f1353){return{'name':_0x5f1353[_0x3d3f('0x37')],'type':_0x5f1353['type'][_0x3d3f('0x38')]};});_0x1030d5=qs['getOptions'](_0x42090e,_0x605a40);return interaction[_0x3d3f('0x39')]('chat',_0x605a40[_0x3d3f('0x3a')],_0x605a40['user'],_0x1030d5,_0x42090e)[_0x3d3f('0x19')](respondWithFilteredResult(_0x16d723,_0x1030d5))[_0x3d3f('0x23')](handleError(_0x16d723,null));};exports[_0x3d3f('0x3b')]=function(_0x44e4e6,_0x458cda){var _0x3181b1={'raw':![],'where':{'id':_0x44e4e6[_0x3d3f('0x3c')]['id']}},_0x287701={};_0x287701[_0x3d3f('0x3d')]=_['keys'](db[_0x3d3f('0x35')][_0x3d3f('0x36')]);_0x287701[_0x3d3f('0x3a')]=_[_0x3d3f('0x3e')](_0x44e4e6['query']);_0x287701[_0x3d3f('0x3f')]=_[_0x3d3f('0x40')](_0x287701[_0x3d3f('0x3d')],_0x287701[_0x3d3f('0x3a')]);_0x3181b1[_0x3d3f('0x41')]=_[_0x3d3f('0x40')](_0x287701[_0x3d3f('0x3d')],qs['fields'](_0x44e4e6[_0x3d3f('0x3a')][_0x3d3f('0x42')]));_0x3181b1[_0x3d3f('0x41')]=_0x3181b1[_0x3d3f('0x41')][_0x3d3f('0x43')]?_0x3181b1[_0x3d3f('0x41')]:_0x287701[_0x3d3f('0x3d')];if(_0x44e4e6[_0x3d3f('0x3a')][_0x3d3f('0x44')]){_0x3181b1[_0x3d3f('0x45')]=[{'all':!![]}];}_0x3181b1=_[_0x3d3f('0x30')]({},_0x3181b1,_0x44e4e6[_0x3d3f('0x46')]);return db['ChatInteraction'][_0x3d3f('0x47')](_0x3181b1)['then'](handleEntityNotFound(_0x458cda,null))['then'](respondWithResult(_0x458cda,null))['catch'](handleError(_0x458cda,null));};exports[_0x3d3f('0x48')]=function(_0x5f5427,_0x37e4e1){return db[_0x3d3f('0x35')][_0x3d3f('0x48')](_0x5f5427[_0x3d3f('0x49')],{})[_0x3d3f('0x19')](respondWithResult(_0x37e4e1,0xc9))[_0x3d3f('0x23')](handleError(_0x37e4e1,null));};exports[_0x3d3f('0x2d')]=function(_0x52a79e,_0xd8cef7){if(_0x52a79e[_0x3d3f('0x49')]['id']){delete _0x52a79e['body']['id'];}return db[_0x3d3f('0x35')][_0x3d3f('0x47')]({'where':{'id':_0x52a79e[_0x3d3f('0x3c')]['id']}})[_0x3d3f('0x19')](handleEntityNotFound(_0xd8cef7,null))[_0x3d3f('0x19')](saveUpdates(_0x52a79e[_0x3d3f('0x49')],null))[_0x3d3f('0x19')](respondWithResult(_0xd8cef7,null))['catch'](handleError(_0xd8cef7,null));};exports[_0x3d3f('0x2e')]=function(_0x25ff30,_0x3dfca1){return db[_0x3d3f('0x35')][_0x3d3f('0x47')]({'where':{'id':_0x25ff30[_0x3d3f('0x3c')]['id']}})[_0x3d3f('0x19')](handleEntityNotFound(_0x3dfca1,null))[_0x3d3f('0x19')](removeEntity(_0x3dfca1,null))['catch'](handleError(_0x3dfca1,null));};exports['describe']=function(_0x6b985b,_0x2f296e){return db[_0x3d3f('0x35')][_0x3d3f('0x4a')]()[_0x3d3f('0x19')](respondWithResult(_0x2f296e,null))['catch'](handleError(_0x2f296e,null));};exports[_0x3d3f('0x4b')]=function(_0x40d33b,_0x57361c){var _0x29d0a7=_0x40d33b[_0x3d3f('0x3c')]['id'];var _0x44d192;var _0x4cd1b6;var _0x253ae2;return db[_0x3d3f('0x35')]['findOne']({'where':{'id':_0x29d0a7}})['then'](function(_0x525ef6){_0x44d192=_0x525ef6;return db['ChatWebsite']['findOne']({'where':{'id':_0x525ef6['ChatWebsiteId']},'attributes':['id',_0x3d3f('0x4c'),_0x3d3f('0x4d'),_0x3d3f('0x4e'),_0x3d3f('0x4f'),_0x3d3f('0x50')],'raw':!![]});})['then'](function(_0x1aec21){if(_0x1aec21&&_0x1aec21[_0x3d3f('0x4c')]&&_0x1aec21[_0x3d3f('0x4d')]){_0x4cd1b6=_0x1aec21;var _0x35eda3={'interaction':{'id':_0x29d0a7},'agent':{'id':_0x40d33b[_0x3d3f('0x51')]['id'],'name':_0x40d33b[_0x3d3f('0x51')][_0x3d3f('0x2f')],'fullname':_0x40d33b[_0x3d3f('0x51')]['fullname'],'email':_0x40d33b[_0x3d3f('0x51')][_0x3d3f('0x52')]},'contact':_0x40d33b[_0x3d3f('0x49')][_0x3d3f('0x53')],'account':_0x40d33b[_0x3d3f('0x49')][_0x3d3f('0x33')]};var _0x1e1742={'rejectUnauthorized':![],'method':_0x3d3f('0x54'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x1aec21[_0x3d3f('0x4c')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x40d33b[_0x3d3f('0x51')][_0x3d3f('0x52')]],'buttons':null,'topic':_0x4cd1b6[_0x3d3f('0x4e')],'note':_[_0x3d3f('0x55')](_0x4cd1b6[_0x3d3f('0x4f')])?null:getMustacheRender(_0x4cd1b6[_0x3d3f('0x4f')],_0x35eda3),'metadata':null},'redirect':_0x3d3f('0x56'),'json':!![]};try{if(!_[_0x3d3f('0x55')](_0x4cd1b6['vidaooMetadata'])){var _0x1f760a=getMustacheRender(_0x4cd1b6['vidaooMetadata'],_0x35eda3);var _0x11db84=JSON[_0x3d3f('0x57')](_0x1f760a);_0x1e1742[_0x3d3f('0x49')][_0x3d3f('0x58')]=_0x11db84;}}catch(_0x4329ee){throw new db[(_0x3d3f('0x59'))]['ValidationError'](_0x3d3f('0x5a'));}return rp(_0x1e1742);}else{throw new db['Sequelize']['ValidationError']('Error\x20in\x20Vidaoo\x20configuration');}})['then'](function(_0x1065a2){_0x253ae2=_0x1065a2;if(_0x253ae2['id']){var _0x27d359={'body':_0x253ae2['join_url'],'ChatWebsiteId':_0x4cd1b6['id'],'ChatInteractionId':_0x44d192['id'],'direction':_0x3d3f('0x5b'),'UserId':_0x40d33b[_0x3d3f('0x51')]['id']};return db[_0x3d3f('0x5c')][_0x3d3f('0x48')](_0x27d359,{});}else{throw new db[(_0x3d3f('0x59'))][(_0x3d3f('0x5d'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x3d3f('0x19')](function(){return _0x44d192[_0x3d3f('0x5e')]({'vidaooSessionId':_0x253ae2['id']});})[_0x3d3f('0x19')](respondWithResult(_0x57361c,null))[_0x3d3f('0x23')](handleError(_0x57361c,null));};exports[_0x3d3f('0x5f')]=function(_0x3be64e,_0x476c8f){if(_0x3be64e[_0x3d3f('0x49')]['id']){delete _0x3be64e[_0x3d3f('0x49')]['id'];}return db[_0x3d3f('0x35')][_0x3d3f('0x47')]({'where':{'id':_0x3be64e['params']['id']},'include':[{'model':db[_0x3d3f('0x60')],'as':_0x3d3f('0x61')}]})[_0x3d3f('0x19')](handleEntityNotFound(_0x476c8f,null))[_0x3d3f('0x19')](saveUpdates(_0x3be64e[_0x3d3f('0x49')],null))[_0x3d3f('0x19')](respondWithResult(_0x476c8f,null))['catch'](handleError(_0x476c8f,null));};exports[_0x3d3f('0x62')]=function(_0x33f2ab,_0x2c1a24){if(_0x33f2ab['body']['id']){delete _0x33f2ab[_0x3d3f('0x49')]['id'];}return db['ChatInteraction'][_0x3d3f('0x47')]({'where':{'id':_0x33f2ab[_0x3d3f('0x3c')]['id']}})['then'](function(_0x28125f){if(!_0x28125f){logger['error'](_0x3d3f('0x63'),_0x3d3f('0x62'),0x194,'entity\x20not\x20found');_0x2c1a24[_0x3d3f('0x24')](0x194);}else{if(_0x28125f[_0x3d3f('0x64')]){throw new db[(_0x3d3f('0x59'))][(_0x3d3f('0x5d'))]('Interaction\x20already\x20assigned');}}return _0x28125f;})['then'](function(_0x582c70){if(_0x582c70){return _0x582c70[_0x3d3f('0x2d')]({'closed':_0x33f2ab['body'][_0x3d3f('0x65')],'disposition':_0x33f2ab[_0x3d3f('0x49')][_0x3d3f('0x66')]})[_0x3d3f('0x19')](function(_0x493e9f){return _0x493e9f;});}})[_0x3d3f('0x19')](function(){return respondWithRpcPromise(_0x3d3f('0x67'),_0x3d3f('0x62'),_0x33f2ab[_0x3d3f('0x49')],client9004);})[_0x3d3f('0x19')](respondWithResult(_0x2c1a24,null))[_0x3d3f('0x23')](handleError(_0x2c1a24,null));};exports['attachmentUpload']=function(_0xa1246b,_0x4b2a66){_0xa1246b['body']['name']=_0xa1246b['file'][_0x3d3f('0x68')];_0xa1246b[_0x3d3f('0x49')][_0x3d3f('0x69')]=_0xa1246b['file'][_0x3d3f('0x6a')];_0xa1246b[_0x3d3f('0x49')]['type']=_0xa1246b[_0x3d3f('0x6b')][_0x3d3f('0x6c')];return db[_0x3d3f('0x6d')]['create'](_0xa1246b['body'])[_0x3d3f('0x19')](respondWithResult(_0x4b2a66,0xc9))[_0x3d3f('0x23')](handleError(_0x4b2a66,null));};exports['attachmentDownload']=function(_0xb0d919,_0x563113){return db[_0x3d3f('0x35')][_0x3d3f('0x6e')]({'where':{'id':_0xb0d919[_0x3d3f('0x3c')]['id']},'raw':!![]})[_0x3d3f('0x19')](handleEntityNotFound(_0x563113,null))[_0x3d3f('0x19')](function(_0x34765e){if(_0x34765e){if(_0x34765e['closed']){return _0x563113[_0x3d3f('0x25')](0x193)[_0x3d3f('0x27')]({'status':0x193,'message':_0x3d3f('0x6f')});}return db[_0x3d3f('0x6d')]['findOne']({'where':{'id':_0xb0d919['query'][_0x3d3f('0x70')]},'raw':!![]})[_0x3d3f('0x19')](handleEntityNotFound(_0x563113,null));}})[_0x3d3f('0x19')](function(_0x14a48a){if(_0x14a48a){var _0x3f244f=_0x14a48a[_0x3d3f('0x71')]!==null;var _0x5335a2=path[_0x3d3f('0x72')](config['root'],_0x3d3f('0x73'));if(_0x3f244f){_0x5335a2=path[_0x3d3f('0x72')](_0x5335a2,_0x3d3f('0x74'));}var _0x522666=path[_0x3d3f('0x72')](_0x5335a2,_0x14a48a[_0x3d3f('0x69')]);return _0x563113[_0x3d3f('0x75')](_0x522666);}})[_0x3d3f('0x23')](handleError(_0x563113,null));};exports[_0x3d3f('0x76')]=function(_0x353562,_0x594027){var _0x5f0049=null;var _0x54f36e=null;var _0x3178f9=null;if(_0x353562[_0x3d3f('0x49')]['id']){delete _0x353562[_0x3d3f('0x49')]['id'];}if(_0x353562[_0x3d3f('0x49')][_0x3d3f('0x77')]){_0x3178f9=path[_0x3d3f('0x72')](config[_0x3d3f('0x78')],_0x3d3f('0x79'),util[_0x3d3f('0x7a')](_0x3d3f('0x7b'),Date[_0x3d3f('0x7c')]()));_0x353562[_0x3d3f('0x49')][_0x3d3f('0x7d')]=_0x3178f9;}return db[_0x3d3f('0x35')][_0x3d3f('0x47')]({'where':{'id':_0x353562[_0x3d3f('0x3c')]['id']},'include':[{'model':db[_0x3d3f('0x5c')],'as':_0x3d3f('0x7e'),'include':[{'model':db['User'],'as':'User'}]}]})['then'](handleEntityNotFound(_0x594027,null))['then'](saveUpdates(_0x353562[_0x3d3f('0x49')],null))[_0x3d3f('0x19')](function(_0x1eae79){if(_0x1eae79){_0x5f0049=_0x1eae79;return db[_0x3d3f('0x7f')][_0x3d3f('0x47')]({'where':{'id':_0x5f0049[_0x3d3f('0x80')]}});}})[_0x3d3f('0x19')](function(_0xde6d9c){if(_0xde6d9c){_0x54f36e=_0xde6d9c;return db[_0x3d3f('0x60')][_0x3d3f('0x47')]({'where':{'id':_0x5f0049[_0x3d3f('0x81')]}});}})[_0x3d3f('0x19')](function(_0x5c1442){if(_0x5c1442){if(_0x3178f9){var _0x34cb9b=null;for(var _0x3a423f=0x1;_0x3a423f<_0x5f0049[_0x3d3f('0x7e')][_0x3d3f('0x43')];++_0x3a423f){_0x34cb9b=_0x5f0049[_0x3d3f('0x7e')][_0x3a423f];var _0x46efda=_0x34cb9b[_0x3d3f('0x64')]?util[_0x3d3f('0x7a')](_0x3d3f('0x82'),_0x54f36e['agentAlias'],_0x34cb9b['UserId']):_0x3d3f('0x83');var _0x47ee66=_0x353562[_0x3d3f('0x49')][_0x3d3f('0x84')]||util[_0x3d3f('0x7a')](_0x3d3f('0x82'),'Visitor',_0x34cb9b[_0x3d3f('0x81')]);switch(_0x54f36e[_0x3d3f('0x85')]){case _0x3d3f('0x86'):_0x46efda=_0x34cb9b['UserId']?util['format']('%s%d',_0x54f36e[_0x3d3f('0x87')],_0x34cb9b[_0x3d3f('0x64')]):_0x3d3f('0x83');break;case _0x3d3f('0x88'):_0x46efda=_0x34cb9b[_0x3d3f('0x64')]?_0x34cb9b[_0x3d3f('0x89')][_0x3d3f('0x8a')]||_0x34cb9b[_0x3d3f('0x89')][_0x3d3f('0x8b')]:_0x3d3f('0x83');break;case'agent_fullname':_0x46efda=_0x34cb9b['UserId']?_0x34cb9b[_0x3d3f('0x89')][_0x3d3f('0x8b')]:_0x3d3f('0x83');break;default:_0x46efda=_0x34cb9b['UserId']?util[_0x3d3f('0x7a')](_0x3d3f('0x82'),_0x54f36e[_0x3d3f('0x87')],_0x34cb9b[_0x3d3f('0x64')]):_0x3d3f('0x83');}var _0x576a00=util[_0x3d3f('0x7a')](_0x3d3f('0x8c'),moment(_0x34cb9b[_0x3d3f('0x8d')])[_0x3d3f('0x7a')](_0x3d3f('0x8e')),_0x34cb9b[_0x3d3f('0x8f')]==='in'?_0x47ee66:_0x46efda,_0x34cb9b['body']);if(!_0x34cb9b[_0x3d3f('0x90')]){fs[_0x3d3f('0x91')](_0x3178f9,_0x576a00);}}return db['MailAccount'][_0x3d3f('0x6e')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x3d3f('0x92'),'raw':!![],'include':[{'model':db[_0x3d3f('0x93')],'as':_0x3d3f('0x93'),'raw':!![]}]}]});}}})[_0x3d3f('0x19')](function(_0x43b681){if(!_0x43b681||!_0x43b681[_0x3d3f('0x92')]||!_0x353562['body'])return _0x5f0049;var _0x5dc8df=_0x43b681['getSmtpOptions']();return respondWithRpcPromise(_0x3d3f('0x94'),_0x3d3f('0x95'),{'account':_0x5dc8df,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x43b681[_0x3d3f('0x2f')],_0x43b681['email']||_0x43b681['Smtp']['user']),'to':_0x353562[_0x3d3f('0x49')][_0x3d3f('0x77')],'subject':_0x3d3f('0x96'),'text':util[_0x3d3f('0x7a')](_0x3d3f('0x97'),_0x353562[_0x3d3f('0x49')][_0x3d3f('0x77')]),'attachments':[{'path':_0x3178f9}]}})[_0x3d3f('0x19')](function(){return _0x5f0049;})[_0x3d3f('0x23')](function(_0x455360){logger[_0x3d3f('0x1f')](_0x455360);});})[_0x3d3f('0x19')](respondWithStatusCode(_0x594027,0xc8))[_0x3d3f('0x23')](handleError(_0x594027,null));};exports[_0x3d3f('0x98')]=function(_0x2a112a,_0x3f3592){return db[_0x3d3f('0x5c')][_0x3d3f('0x47')]({'where':{'id':_0x2a112a['params']['id']}})[_0x3d3f('0x19')](handleEntityNotFound(_0x3f3592,null))['then'](function(_0x38ff90){if(_0x38ff90){return _0x38ff90[_0x3d3f('0x98')](_0x2a112a[_0x3d3f('0x49')][_0x3d3f('0x99')],_[_0x3d3f('0x9a')](_0x2a112a[_0x3d3f('0x49')],[_0x3d3f('0x99'),'id'])||{});}})[_0x3d3f('0x19')](respondWithResult(_0x3f3592,null))[_0x3d3f('0x23')](handleError(_0x3f3592,null));};exports['getMessages']=function(_0x1e5f79,_0x97dd3e){var _0x11389b={'raw':![],'where':{}};var _0x2c630d={};var _0x58bd6d={'count':0x0,'rows':[]};return db[_0x3d3f('0x35')][_0x3d3f('0x6e')]({'where':{'id':_0x1e5f79['params']['id']}})['then'](handleEntityNotFound(_0x97dd3e,null))['then'](function(_0x1ba175){if(_0x1ba175){_0x2c630d[_0x3d3f('0x3d')]=_['keys'](db[_0x3d3f('0x5c')][_0x3d3f('0x36')]);_0x2c630d[_0x3d3f('0x3a')]=_[_0x3d3f('0x3e')](_0x1e5f79['query']);_0x2c630d[_0x3d3f('0x3f')]=_[_0x3d3f('0x40')](_0x2c630d[_0x3d3f('0x3d')],_0x2c630d[_0x3d3f('0x3a')]);_0x11389b[_0x3d3f('0x41')]=_[_0x3d3f('0x40')](_0x2c630d['model'],qs[_0x3d3f('0x42')](_0x1e5f79['query'][_0x3d3f('0x42')]));_0x11389b['attributes']=_0x11389b['attributes'][_0x3d3f('0x43')]?_0x11389b[_0x3d3f('0x41')]:_0x2c630d[_0x3d3f('0x3d')];if(!_0x1e5f79[_0x3d3f('0x3a')]['hasOwnProperty']('nolimit')){_0x11389b['limit']=qs[_0x3d3f('0x2a')](_0x1e5f79[_0x3d3f('0x3a')][_0x3d3f('0x2a')]);_0x11389b['offset']=qs['offset'](_0x1e5f79['query'][_0x3d3f('0x28')]);}_0x11389b[_0x3d3f('0x9b')]=qs['sort'](_0x1e5f79[_0x3d3f('0x3a')][_0x3d3f('0x9c')]);_0x11389b[_0x3d3f('0x9d')]=qs[_0x3d3f('0x3f')](_['pick'](_0x1e5f79[_0x3d3f('0x3a')],_0x2c630d[_0x3d3f('0x3f')]));_0x11389b[_0x3d3f('0x9d')][_0x3d3f('0x9e')]=_0x1ba175['id'];if(_0x1e5f79['query'][_0x3d3f('0x9f')]){_0x11389b['where']=_[_0x3d3f('0x30')](_0x11389b[_0x3d3f('0x9d')],{'$or':_[_0x3d3f('0x34')](_0x11389b[_0x3d3f('0x41')],function(_0x26eae7){var _0x1f0afb={};_0x1f0afb[_0x26eae7]={'$like':'%'+_0x1e5f79[_0x3d3f('0x3a')]['filter']+'%'};return _0x1f0afb;})});}if(_0x1e5f79[_0x3d3f('0x3a')][_0x3d3f('0xa0')]){var _0x36600f=_0x1e5f79[_0x3d3f('0x3a')]['$gte']['split'](',');var _0x1c265={};_0x1c265[_0x36600f[0x0]]={'$gte':moment(_0x36600f[0x1])[_0x3d3f('0x7a')]('YYYY-MM-DD\x20HH:mm:ss')};_0x11389b[_0x3d3f('0x9d')]=_[_0x3d3f('0x30')](_0x11389b[_0x3d3f('0x9d')],_0x1c265);}_0x11389b=_[_0x3d3f('0x30')]({},_0x11389b,_0x1e5f79[_0x3d3f('0x46')]);return db[_0x3d3f('0x5c')][_0x3d3f('0x2b')]({'where':_0x11389b['where']})[_0x3d3f('0x19')](function(_0x1c2399){_0x58bd6d[_0x3d3f('0x2b')]=_0x1c2399;if(_0x1e5f79['query'][_0x3d3f('0x44')]){_0x11389b['include']=[{'all':!![]}];}return db[_0x3d3f('0x5c')][_0x3d3f('0x39')](_0x11389b);})[_0x3d3f('0x19')](function(_0x4f9c7f){_0x58bd6d[_0x3d3f('0xa1')]=_0x4f9c7f;return _0x58bd6d;});}})['then'](respondWithFilteredResult(_0x97dd3e,_0x11389b))[_0x3d3f('0x23')](handleError(_0x97dd3e,null));};exports[_0x3d3f('0xa2')]=function(_0x1a7b76,_0x2c1742){var _0x346e94={'where':{}},_0x64bcf4={},_0x34f6b2={'count':0x0,'rows':[]};return db[_0x3d3f('0x35')][_0x3d3f('0x6e')]({'where':{'id':_0x1a7b76['params']['id']}})[_0x3d3f('0x19')](handleEntityNotFound(_0x2c1742,null))['then'](function(_0x2a80e0){if(_0x2a80e0){_0x64bcf4[_0x3d3f('0x3d')]=_[_0x3d3f('0x3e')](db['ChatMessage']['rawAttributes']);_0x64bcf4[_0x3d3f('0x3a')]=_[_0x3d3f('0x3e')](_0x1a7b76['query']);_0x64bcf4[_0x3d3f('0x3f')]=_[_0x3d3f('0x40')](_0x64bcf4['model'],_0x64bcf4[_0x3d3f('0x3a')]);_0x346e94[_0x3d3f('0x41')]=_[_0x3d3f('0x40')](_0x64bcf4['model'],qs[_0x3d3f('0x42')](_0x1a7b76[_0x3d3f('0x3a')]['fields']));_0x346e94['attributes']=_0x346e94[_0x3d3f('0x41')][_0x3d3f('0x43')]?_0x346e94[_0x3d3f('0x41')]:_0x64bcf4[_0x3d3f('0x3d')];if(!_0x1a7b76['query']['hasOwnProperty'](_0x3d3f('0xa3'))){_0x346e94['limit']=qs['limit'](_0x1a7b76[_0x3d3f('0x3a')]['limit']);_0x346e94[_0x3d3f('0x28')]=qs['offset'](_0x1a7b76['query'][_0x3d3f('0x28')]);}_0x346e94[_0x3d3f('0x9b')]=qs['sort'](_0x1a7b76[_0x3d3f('0x3a')][_0x3d3f('0x9c')]);_0x346e94[_0x3d3f('0x9d')]=qs['filters'](_[_0x3d3f('0xa4')](_0x1a7b76[_0x3d3f('0x3a')],_0x64bcf4[_0x3d3f('0x3f')]));_0x346e94[_0x3d3f('0x9d')][_0x3d3f('0x9e')]=_0x2a80e0['id'];if(_0x1a7b76[_0x3d3f('0x3a')][_0x3d3f('0x9f')]){_0x346e94[_0x3d3f('0x9d')]=_['merge'](_0x346e94[_0x3d3f('0x9d')],{'$or':_['map'](_0x346e94[_0x3d3f('0x41')],function(_0x2d0744){var _0x3f440a={};_0x3f440a[_0x2d0744]={'$like':'%'+_0x1a7b76[_0x3d3f('0x3a')][_0x3d3f('0x9f')]+'%'};return _0x3f440a;})});}_0x346e94[_0x3d3f('0x9d')][_0x3d3f('0x90')]=![];if(_0x1a7b76[_0x3d3f('0x3a')]['id']){_0x346e94['where']['id']={'$gt':_0x1a7b76[_0x3d3f('0x3a')]['id']};}_0x346e94=_[_0x3d3f('0x30')]({},_0x346e94,_0x1a7b76[_0x3d3f('0x46')]);return db['ChatMessage'][_0x3d3f('0x2b')]({'where':_0x346e94[_0x3d3f('0x9d')]})['then'](function(_0x535eeb){_0x34f6b2['count']=_0x535eeb;_0x346e94[_0x3d3f('0x45')]=[];if(_0x1a7b76[_0x3d3f('0x3a')][_0x3d3f('0xa5')]){_0x346e94['include'][_0x3d3f('0xa6')]({'model':db[_0x3d3f('0x89')],'as':_0x3d3f('0x89'),'attributes':['id',_0x3d3f('0x8b'),_0x3d3f('0x8a')]});}if(_0x1a7b76[_0x3d3f('0x3a')][_0x3d3f('0x44')]){_0x346e94[_0x3d3f('0x45')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x346e94);})[_0x3d3f('0x19')](function(_0x288e43){_0x34f6b2[_0x3d3f('0xa1')]=_0x288e43;return _0x34f6b2;});}})[_0x3d3f('0x19')](respondWithFilteredResult(_0x2c1742,_0x346e94))[_0x3d3f('0x23')](handleError(_0x2c1742,null));};exports[_0x3d3f('0xa7')]=function(_0x18b8ea,_0x5cf52a){return db[_0x3d3f('0x35')][_0x3d3f('0x47')]({'where':{'id':_0x18b8ea[_0x3d3f('0x3c')]['id']}})[_0x3d3f('0x19')](handleEntityNotFound(_0x5cf52a,null))['then'](function(_0x11a156){if(_0x11a156){return _0x11a156[_0x3d3f('0xa8')](_0x18b8ea[_0x3d3f('0x49')][_0x3d3f('0x99')],_[_0x3d3f('0x9a')](_0x18b8ea[_0x3d3f('0x49')],[_0x3d3f('0x99'),'id'])||{})[_0x3d3f('0xa9')](function(){return db[_0x3d3f('0xaa')]['findAll']({'attributes':['id',_0x3d3f('0x2f'),'color'],'where':{'id':_0x18b8ea[_0x3d3f('0x49')][_0x3d3f('0x99')]}});})['then'](function(_0x28b79a){socket[_0x3d3f('0xab')](_0x3d3f('0xac'),{'id':Number(_0x18b8ea[_0x3d3f('0x3c')]['id']),'tags':_0x28b79a||[]});return{'id':Number(_0x18b8ea['params']['id']),'tags':_0x28b79a||[]};});}})[_0x3d3f('0x19')](respondWithResult(_0x5cf52a,null))[_0x3d3f('0x23')](handleError(_0x5cf52a,null));};exports['removeTags']=function(_0x486f39,_0x38818b){return db[_0x3d3f('0x35')]['find']({'where':{'id':_0x486f39[_0x3d3f('0x3c')]['id']}})[_0x3d3f('0x19')](handleEntityNotFound(_0x38818b,null))[_0x3d3f('0x19')](function(_0x38a5fa){if(_0x38a5fa){return _0x38a5fa[_0x3d3f('0xad')](_0x486f39[_0x3d3f('0x3a')][_0x3d3f('0x99')]);}})['then'](respondWithStatusCode(_0x38818b,null))[_0x3d3f('0x23')](handleError(_0x38818b,null));};exports[_0x3d3f('0x75')]=function(_0x13ff3f,_0x5da737){var _0x29e494=moment()['unix']()[_0x3d3f('0xae')]();var _0x37a079=path[_0x3d3f('0x72')](config[_0x3d3f('0x78')],'server',_0x3d3f('0xaf'),_0x3d3f('0xb0'));var _0x3ea657=path[_0x3d3f('0x72')](config[_0x3d3f('0x78')],_0x3d3f('0xb1'),_0x3d3f('0xaf'),_0x3d3f('0xb2'));var _0x56a3bf=path[_0x3d3f('0x72')](_0x37a079,_0x29e494);var _0x4fd26b=util['format'](_0x3d3f('0xb3'),_0x13ff3f[_0x3d3f('0x3c')]['id'],_0x29e494);var _0x2044c9=path[_0x3d3f('0x72')](_0x37a079,_0x4fd26b);var _0x9d7456=[];_0x9d7456[_0x3d3f('0xa6')]({'model':db[_0x3d3f('0x89')],'as':_0x3d3f('0x89'),'attributes':['id',_0x3d3f('0x8b')],'raw':!![]});_0x9d7456[_0x3d3f('0xa6')]({'model':db['CmContact'],'as':'Contact','attributes':['id',_0x3d3f('0xb4'),_0x3d3f('0xb5')],'raw':!![]});if(_0x13ff3f[_0x3d3f('0x3a')][_0x3d3f('0xb2')]){_0x9d7456[_0x3d3f('0xa6')]({'model':db[_0x3d3f('0x6d')],'as':_0x3d3f('0x6d'),'raw':!![]});}var _0x17cfdd=[{'model':db[_0x3d3f('0x5c')],'as':_0x3d3f('0x7e'),'attributes':['id',_0x3d3f('0x49'),'createdAt',_0x3d3f('0x8f'),_0x3d3f('0x90'),'read'],'include':_0x9d7456}];_0x17cfdd[_0x3d3f('0xa6')]({'model':db[_0x3d3f('0x7f')],'as':_0x3d3f('0xb6'),'attributes':['id','name']});_0x17cfdd[_0x3d3f('0xa6')]({'model':db[_0x3d3f('0x89')],'as':_0x3d3f('0xb7'),'attributes':['id','fullname']});return db['ChatInteraction'][_0x3d3f('0x47')]({'where':{'id':_0x13ff3f['params']['id']},'include':_0x17cfdd})['then'](handleEntityNotFound(_0x5da737,null))[_0x3d3f('0x19')](function(_0x1b491c){if(_0x1b491c){var _0x945ff6=_0x1b491c[_0x3d3f('0xb8')]({'plain':!![]});fs[_0x3d3f('0xb9')](_0x56a3bf);var _0x54d2c4={'channel':_0x3d3f('0xba'),'account':_0x945ff6[_0x3d3f('0xb6')][_0x3d3f('0x2f')],'agent':_0x945ff6[_0x3d3f('0xb7')]?_0x945ff6[_0x3d3f('0xb7')]['fullname']:'N.A.','createdAt':moment(_0x945ff6[_0x3d3f('0x8d')])[_0x3d3f('0x7a')](_0x3d3f('0xbb'))[_0x3d3f('0xae')](),'closedAt':_0x945ff6[_0x3d3f('0x65')]?moment(_0x945ff6[_0x3d3f('0xbc')])[_0x3d3f('0x7a')](_0x3d3f('0xbb'))[_0x3d3f('0xae')]():'','disposition':_0x945ff6['disposition'],'chatInfo':{'browser':_0x945ff6[_0x3d3f('0xbd')],'os':_0x945ff6['osName'],'referer':_0x945ff6[_0x3d3f('0xbe')],'customerIp':_0x945ff6[_0x3d3f('0xbf')],'customerPort':_0x945ff6[_0x3d3f('0xc0')]?_0x945ff6['customerPort']:_0x3d3f('0xc1')},'messages':_(_0x945ff6['Messages'])[_0x3d3f('0xc2')]()['filter']({'secret':![]})[_0x3d3f('0x34')](function(_0xb87c81){if(_0xb87c81['Attachment']){var _0x58d903=path[_0x3d3f('0x72')](_0x3ea657,_0xb87c81[_0x3d3f('0x6d')][_0x3d3f('0x69')]);if(fs[_0x3d3f('0xc3')](_0x58d903)){fs['createReadStream'](_0x58d903)[_0x3d3f('0xc4')](fs[_0x3d3f('0xc5')](path['join'](_0x56a3bf,_0xb87c81['Attachment'][_0x3d3f('0x69')])));}}return{'date':moment(_0xb87c81[_0x3d3f('0x8d')])[_0x3d3f('0x7a')](_0x3d3f('0xbb'))['toString'](),'sender':_0xb87c81['direction']===_0x3d3f('0x5b')?_0xb87c81['User']?_0xb87c81[_0x3d3f('0x89')][_0x3d3f('0x8b')]:_0x3d3f('0x83'):_0xb87c81['Contact'][_0x3d3f('0xb4')]+(_0xb87c81[_0x3d3f('0x61')][_0x3d3f('0xb5')]?'\x20'+_0xb87c81['Contact'][_0x3d3f('0xb5')]:''),'body':_0xb87c81[_0x3d3f('0x6d')]?_0xb87c81[_0x3d3f('0x6d')][_0x3d3f('0x69')]:_0xb87c81['body'],'direction':_0xb87c81[_0x3d3f('0x8f')]===_0x3d3f('0x5b')?'A':'C','secret':_0xb87c81[_0x3d3f('0x90')],'read':_0xb87c81[_0x3d3f('0xc6')],'attachment':_0xb87c81[_0x3d3f('0x6d')]};})['value']()};return ejs[_0x3d3f('0xc7')](path[_0x3d3f('0x72')](config['root'],'server',_0x3d3f('0xc8'),_0x3d3f('0xc9')),{'interaction':_0x54d2c4})[_0x3d3f('0x19')](function(_0x3a3873){var _0xbed23b=path[_0x3d3f('0x72')](_0x56a3bf,_0x3d3f('0xca')+_0x945ff6['id']+'-'+_0x29e494+'.pdf');var _0x2d8bb2={'path':_0xbed23b,'channel':_0x3d3f('0xba'),'interactionId':_0x945ff6['id']};return pdf[_0x3d3f('0xcb')](_0x3a3873,_0x2d8bb2);})[_0x3d3f('0x19')](function(){return new Promise(function(_0x56f569,_0xe12c06){zipdir(_0x56a3bf,{'saveTo':_0x2044c9},function(_0x2d3945,_0x3ded67){if(_0x2d3945)return _0xe12c06(_0x2d3945);return _0x56f569(_0x3ded67);});})['then'](function(){return new BPromise(function(_0x53f5d0,_0x3f3710){rimraf(_0x56a3bf,function(_0x2c806a){if(_0x2c806a)_0x3f3710(_0x2c806a);return _0x53f5d0();});});})[_0x3d3f('0x19')](function(){return _0x5da737[_0x3d3f('0x75')](_0x2044c9,_0x4fd26b,function(_0x309e7f){if(_0x309e7f){logger[_0x3d3f('0x1f')](_0x3d3f('0xcc'),_0x309e7f);}else{fs[_0x3d3f('0xcd')](_0x2044c9);}});});});}else{return _0x5da737[_0x3d3f('0x24')](0xc8);}})['catch'](handleError(_0x5da737,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index dade411..a39e2b7 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 _0x5cd5=['emit','catch','hasOwnProperty','hook','exports','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','remove','getUsers','setDataValue','Users','map','findAll','unreadMessages','length'];(function(_0xe66cf2,_0x32ba5f){var _0x2d84e7=function(_0x58a7d8){while(--_0x58a7d8){_0xe66cf2['push'](_0xe66cf2['shift']());}};_0x2d84e7(++_0x32ba5f);}(_0x5cd5,0xd6));var _0x55cd=function(_0x3b6718,_0x390fe2){_0x3b6718=_0x3b6718-0x0;var _0x318c02=_0x5cd5[_0x3b6718];return _0x318c02;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x55cd('0x0'))['db'][_0x55cd('0x1')];var ChatMessage=require(_0x55cd('0x0'))['db'][_0x55cd('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x55cd('0x3')](0x0);var events={'afterCreate':_0x55cd('0x4'),'afterUpdate':_0x55cd('0x5'),'afterDestroy':_0x55cd('0x6')};function emitEvent(_0x2a9af6){return function(_0xeabf7a,_0x3b91ef,_0x3fb22c){_0xeabf7a[_0x55cd('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x8f1223){_0xeabf7a[_0x55cd('0x8')](_0x55cd('0x9'),_0x8f1223[_0x55cd('0xa')](function(_0x6268df){return{'id':_0x6268df['id']};}));return ChatMessage[_0x55cd('0xb')]({'where':{'ChatInteractionId':_0xeabf7a['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x2ac4c3){_0xeabf7a[_0x55cd('0x8')](_0x55cd('0xc'),_0x2ac4c3[_0x55cd('0xd')]);ChatInteractionEvents[_0x55cd('0xe')](_0x2a9af6+':'+_0xeabf7a['id'],_0xeabf7a);ChatInteractionEvents['emit'](_0x2a9af6,_0xeabf7a);_0x3fb22c(null);})[_0x55cd('0xf')](_0x3fb22c(null));};}for(var e in events){if(events[_0x55cd('0x10')](e)){var event=events[e];ChatInteraction[_0x55cd('0x11')](e,emitEvent(event));}}module[_0x55cd('0x12')]=ChatInteractionEvents; \ No newline at end of file +var _0xfcaa=['catch','hasOwnProperty','hook','exports','../../mysqldb','ChatMessage','save','update','remove','getUsers','then','setDataValue','map','findAll','length'];(function(_0x410ee9,_0x4cb863){var _0x50715e=function(_0xc37ca7){while(--_0xc37ca7){_0x410ee9['push'](_0x410ee9['shift']());}};_0x50715e(++_0x4cb863);}(_0xfcaa,0x130));var _0xafca=function(_0xe9eec4,_0x3f63e2){_0xe9eec4=_0xe9eec4-0x0;var _0x5d7321=_0xfcaa[_0xe9eec4];return _0x5d7321;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0xafca('0x0'))['db']['ChatInteraction'];var ChatMessage=require(_0xafca('0x0'))['db'][_0xafca('0x1')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xafca('0x2'),'afterUpdate':_0xafca('0x3'),'afterDestroy':_0xafca('0x4')};function emitEvent(_0x53f5af){return function(_0x1b60be,_0x49da1f,_0x5301dc){_0x1b60be[_0xafca('0x5')]({'attributes':['id'],'raw':!![]})[_0xafca('0x6')](function(_0x1fff0c){_0x1b60be[_0xafca('0x7')]('Users',_0x1fff0c[_0xafca('0x8')](function(_0x11bc14){return{'id':_0x11bc14['id']};}));return ChatMessage[_0xafca('0x9')]({'where':{'ChatInteractionId':_0x1b60be['id'],'direction':'in','read':![]},'raw':!![]});})[_0xafca('0x6')](function(_0x12cd3c){_0x1b60be[_0xafca('0x7')]('unreadMessages',_0x12cd3c[_0xafca('0xa')]);ChatInteractionEvents['emit'](_0x53f5af+':'+_0x1b60be['id'],_0x1b60be);ChatInteractionEvents['emit'](_0x53f5af,_0x1b60be);_0x5301dc(null);})[_0xafca('0xb')](_0x5301dc(null));};}for(var e in events){if(events[_0xafca('0xc')](e)){var event=events[e];ChatInteraction[_0xafca('0xd')](e,emitEvent(event));}}module[_0xafca('0xe')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index e3d4d46..d9de635 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 _0x9c83=['ChatInteraction','chat_interactions','changed','closed','format','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9c83,0x93));var _0x39c8=function(_0x559cf3,_0x441d1b){_0x559cf3=_0x559cf3-0x0;var _0x5bbb5c=_0x9c83[_0x559cf3];return _0x5bbb5c;};'use strict';var _=require(_0x39c8('0x0'));var util=require(_0x39c8('0x1'));var logger=require(_0x39c8('0x2'))(_0x39c8('0x3'));var moment=require(_0x39c8('0x4'));var BPromise=require(_0x39c8('0x5'));var rp=require(_0x39c8('0x6'));var fs=require('fs');var path=require(_0x39c8('0x7'));var rimraf=require(_0x39c8('0x8'));var config=require(_0x39c8('0x9'));var attributes=require(_0x39c8('0xa'));module[_0x39c8('0xb')]=function(_0x17fd6a,_0x1100d6){return _0x17fd6a[_0x39c8('0xc')](_0x39c8('0xd'),attributes,{'tableName':_0x39c8('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1afd3f,_0x3c968f,_0x1f732b){if(_0x1afd3f[_0x39c8('0xf')](_0x39c8('0x10'))){_0x1afd3f['closedAt']=moment()[_0x39c8('0x11')]('YYYY-MM-DD\x20HH:mm:ss');}_0x1f732b(null,_0x1afd3f);}},'charset':_0x39c8('0x12'),'collate':_0x39c8('0x13')});}; \ No newline at end of file +var _0xc320=['request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','ChatInteraction','chat_interactions','closed','closedAt','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0xc320,0x1eb));var _0x0c32=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0xc320[_0x4f9b18];return _0x29f20c;};'use strict';var _=require(_0x0c32('0x0'));var util=require(_0x0c32('0x1'));var logger=require(_0x0c32('0x2'))('api');var moment=require(_0x0c32('0x3'));var BPromise=require('bluebird');var rp=require(_0x0c32('0x4'));var fs=require('fs');var path=require(_0x0c32('0x5'));var rimraf=require(_0x0c32('0x6'));var config=require(_0x0c32('0x7'));var attributes=require(_0x0c32('0x8'));module[_0x0c32('0x9')]=function(_0x52ed8d,_0x407797){return _0x52ed8d['define'](_0x0c32('0xa'),attributes,{'tableName':_0x0c32('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1f068a,_0x3972ca,_0x578104){if(_0x1f068a['changed'](_0x0c32('0xc'))){_0x1f068a[_0x0c32('0xd')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x578104(null,_0x1f068a);}},'charset':'utf8mb4','collate':_0x0c32('0xe')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index caec2d2..9955ca1 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 _0x3f31=['UpdateChatInteraction','ChatInteraction','body','options','raw','where','attributes','limit','catch','AddTagsToChatInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x25e918,_0x136322){var _0x3b2825=function(_0x212acd){while(--_0x212acd){_0x25e918['push'](_0x25e918['shift']());}};_0x3b2825(++_0x136322);}(_0x3f31,0x140));var _0x13f3=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x3f31[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x13f3('0x0'));var util=require(_0x13f3('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x13f3('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x13f3('0x3'))['db'];var utils=require(_0x13f3('0x4'));var logger=require('../../config/logger')(_0x13f3('0x5'));var config=require(_0x13f3('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x13f3('0x7')]=_[_0x13f3('0x8')](config[_0x13f3('0x7')],{'host':_0x13f3('0x9'),'port':0x18eb});var socket=require(_0x13f3('0xa'))(new Redis(config[_0x13f3('0x7')]));require('./chatInteraction.socket')['register'](socket);function respondWithRpcPromise(_0xafcc8c,_0x32a55a,_0xd25700){return new BPromise(function(_0x5f3666,_0x41257e){return client['request'](_0xafcc8c,_0xd25700)[_0x13f3('0xb')](function(_0x936895){logger[_0x13f3('0xc')](_0x13f3('0xd'),_0x32a55a,_0x13f3('0xe'));logger[_0x13f3('0xf')](_0x13f3('0x10'),_0x32a55a,'request\x20sent',JSON[_0x13f3('0x11')](_0x936895));if(_0x936895[_0x13f3('0x12')]){if(_0x936895[_0x13f3('0x12')][_0x13f3('0x13')]===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x32a55a,_0x936895[_0x13f3('0x12')]['message']);return _0x41257e(_0x936895[_0x13f3('0x12')][_0x13f3('0x14')]);}logger['error']('ChatInteraction,\x20%s,\x20%s',_0x32a55a,_0x936895[_0x13f3('0x12')]['message']);return _0x5f3666(_0x936895['error'][_0x13f3('0x14')]);}else{logger['info'](_0x13f3('0xd'),_0x32a55a,_0x13f3('0xe'));_0x5f3666(_0x936895[_0x13f3('0x15')]['message']);}})['catch'](function(_0x318d75){logger[_0x13f3('0x12')](_0x13f3('0xd'),_0x32a55a,_0x318d75);_0x41257e(_0x318d75);});});}exports[_0x13f3('0x16')]=function(_0x8e198a){var _0x502362=this;return new Promise(function(_0x3a73f0,_0x43b285){return db[_0x13f3('0x17')]['update'](_0x8e198a[_0x13f3('0x18')],{'raw':_0x8e198a['options']?_0x8e198a[_0x13f3('0x19')][_0x13f3('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x8e198a[_0x13f3('0x19')]?_0x8e198a[_0x13f3('0x19')][_0x13f3('0x1b')]||null:null,'attributes':_0x8e198a[_0x13f3('0x19')]?_0x8e198a[_0x13f3('0x19')][_0x13f3('0x1c')]||null:null,'limit':_0x8e198a['options']?_0x8e198a[_0x13f3('0x19')][_0x13f3('0x1d')]||null:null})[_0x13f3('0xb')](function(_0x31ca3e){logger['info'](_0x13f3('0x16'),_0x8e198a);logger[_0x13f3('0xf')]('UpdateChatInteraction',_0x8e198a,JSON[_0x13f3('0x11')](_0x31ca3e));_0x3a73f0(_0x31ca3e);})[_0x13f3('0x1e')](function(_0x43532b){logger[_0x13f3('0x12')]('UpdateChatInteraction',_0x43532b[_0x13f3('0x14')],_0x8e198a);_0x43b285(_0x502362[_0x13f3('0x12')](0x1f4,_0x43532b[_0x13f3('0x14')]));});});};exports[_0x13f3('0x1f')]=function(_0x5b627c){return new Promise(function(_0x4fdc81,_0x3f2d28){return db[_0x13f3('0x17')][_0x13f3('0x20')]({'where':_0x5b627c[_0x13f3('0x19')]?_0x5b627c[_0x13f3('0x19')][_0x13f3('0x1b')]||null:null})[_0x13f3('0xb')](function(_0x56cc3a){if(_0x56cc3a){return _0x56cc3a[_0x13f3('0x21')](_0x5b627c['body'][_0x13f3('0x22')],_[_0x13f3('0x23')](_0x5b627c[_0x13f3('0x18')],[_0x13f3('0x22'),'id'])||{});}})[_0x13f3('0x24')](function(_0x403ddd){logger[_0x13f3('0xc')](_0x13f3('0x25'),_0x5b627c);logger[_0x13f3('0xf')](_0x13f3('0x25'),_0x5b627c,JSON[_0x13f3('0x11')](_0x403ddd));_0x4fdc81(_0x403ddd);})[_0x13f3('0x1e')](function(_0x5c423b){logger[_0x13f3('0x12')]('AddTags',_0x5c423b[_0x13f3('0x14')],_0x5b627c);_0x3f2d28(_this[_0x13f3('0x12')](0x1f4,_0x5c423b[_0x13f3('0x14')]));});});}; \ No newline at end of file +var _0x9ec9=['UpdateChatInteraction','update','body','options','raw','where','limit','AddTagsToChatInteraction','ChatInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x304fe8,_0x6a7c6){var _0x5444c8=function(_0xb0a69a){while(--_0xb0a69a){_0x304fe8['push'](_0x304fe8['shift']());}};_0x5444c8(++_0x6a7c6);}(_0x9ec9,0x1ad));var _0x99ec=function(_0x253f2a,_0x2c51f2){_0x253f2a=_0x253f2a-0x0;var _0x1c15f5=_0x9ec9[_0x253f2a];return _0x1c15f5;};'use strict';var _=require(_0x99ec('0x0'));var util=require(_0x99ec('0x1'));var moment=require(_0x99ec('0x2'));var BPromise=require(_0x99ec('0x3'));var rs=require(_0x99ec('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x99ec('0x5'))['db'];var utils=require(_0x99ec('0x6'));var logger=require(_0x99ec('0x7'))(_0x99ec('0x8'));var config=require(_0x99ec('0x9'));var jayson=require(_0x99ec('0xa'));var client=jayson[_0x99ec('0xb')][_0x99ec('0xc')]({'port':0x232a});config['redis']=_[_0x99ec('0xd')](config[_0x99ec('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0x99ec('0xf'))(new Redis(config[_0x99ec('0xe')]));require(_0x99ec('0x10'))[_0x99ec('0x11')](socket);function respondWithRpcPromise(_0x2554e1,_0x395683,_0x3da92f){return new BPromise(function(_0x2bc28e,_0x498754){return client[_0x99ec('0x12')](_0x2554e1,_0x3da92f)[_0x99ec('0x13')](function(_0x3a9394){logger[_0x99ec('0x14')](_0x99ec('0x15'),_0x395683,_0x99ec('0x16'));logger[_0x99ec('0x17')](_0x99ec('0x18'),_0x395683,_0x99ec('0x16'),JSON[_0x99ec('0x19')](_0x3a9394));if(_0x3a9394[_0x99ec('0x1a')]){if(_0x3a9394[_0x99ec('0x1a')][_0x99ec('0x1b')]===0x1f4){logger['error'](_0x99ec('0x15'),_0x395683,_0x3a9394[_0x99ec('0x1a')][_0x99ec('0x1c')]);return _0x498754(_0x3a9394['error'][_0x99ec('0x1c')]);}logger[_0x99ec('0x1a')]('ChatInteraction,\x20%s,\x20%s',_0x395683,_0x3a9394[_0x99ec('0x1a')][_0x99ec('0x1c')]);return _0x2bc28e(_0x3a9394[_0x99ec('0x1a')][_0x99ec('0x1c')]);}else{logger['info'](_0x99ec('0x15'),_0x395683,_0x99ec('0x16'));_0x2bc28e(_0x3a9394[_0x99ec('0x1d')][_0x99ec('0x1c')]);}})[_0x99ec('0x1e')](function(_0x523224){logger[_0x99ec('0x1a')](_0x99ec('0x15'),_0x395683,_0x523224);_0x498754(_0x523224);});});}exports[_0x99ec('0x1f')]=function(_0x246c65){var _0x22bfb0=this;return new Promise(function(_0x3017ff,_0x9acb7){return db['ChatInteraction'][_0x99ec('0x20')](_0x246c65[_0x99ec('0x21')],{'raw':_0x246c65[_0x99ec('0x22')]?_0x246c65[_0x99ec('0x22')][_0x99ec('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x246c65[_0x99ec('0x22')]?_0x246c65['options'][_0x99ec('0x24')]||null:null,'attributes':_0x246c65[_0x99ec('0x22')]?_0x246c65[_0x99ec('0x22')]['attributes']||null:null,'limit':_0x246c65['options']?_0x246c65[_0x99ec('0x22')][_0x99ec('0x25')]||null:null})['then'](function(_0x580bd0){logger[_0x99ec('0x14')](_0x99ec('0x1f'),_0x246c65);logger['debug'](_0x99ec('0x1f'),_0x246c65,JSON[_0x99ec('0x19')](_0x580bd0));_0x3017ff(_0x580bd0);})[_0x99ec('0x1e')](function(_0x19a362){logger[_0x99ec('0x1a')]('UpdateChatInteraction',_0x19a362[_0x99ec('0x1c')],_0x246c65);_0x9acb7(_0x22bfb0[_0x99ec('0x1a')](0x1f4,_0x19a362[_0x99ec('0x1c')]));});});};exports[_0x99ec('0x26')]=function(_0x20b384){return new Promise(function(_0x44df23,_0x48b321){return db[_0x99ec('0x27')][_0x99ec('0x28')]({'where':_0x20b384[_0x99ec('0x22')]?_0x20b384[_0x99ec('0x22')][_0x99ec('0x24')]||null:null})[_0x99ec('0x13')](function(_0x16e252){if(_0x16e252){return _0x16e252[_0x99ec('0x29')](_0x20b384[_0x99ec('0x21')][_0x99ec('0x2a')],_[_0x99ec('0x2b')](_0x20b384[_0x99ec('0x21')],[_0x99ec('0x2a'),'id'])||{});}})[_0x99ec('0x2c')](function(_0x5e72c9){logger[_0x99ec('0x14')](_0x99ec('0x2d'),_0x20b384);logger[_0x99ec('0x17')](_0x99ec('0x2d'),_0x20b384,JSON[_0x99ec('0x19')](_0x5e72c9));_0x44df23(_0x5e72c9);})[_0x99ec('0x1e')](function(_0x47bd94){logger[_0x99ec('0x1a')](_0x99ec('0x2d'),_0x47bd94[_0x99ec('0x1c')],_0x20b384);_0x48b321(_this['error'](0x1f4,_0x47bd94[_0x99ec('0x1c')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 1858b9c..d7f4fab 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 _0x28dd=['emit','removeListener','register','length','chatInteraction:','./chatInteraction.events','save'];(function(_0x5dff77,_0x25121c){var _0x48a309=function(_0x39b84d){while(--_0x39b84d){_0x5dff77['push'](_0x5dff77['shift']());}};_0x48a309(++_0x25121c);}(_0x28dd,0x15c));var _0xd28d=function(_0x533676,_0x2be01c){_0x533676=_0x533676-0x0;var _0x32f7bd=_0x28dd[_0x533676];return _0x32f7bd;};'use strict';var ChatInteractionEvents=require(_0xd28d('0x0'));var events=[_0xd28d('0x1'),'remove','update'];function createListener(_0x161106,_0x21200b){return function(_0x1b5e4e){_0x21200b[_0xd28d('0x2')](_0x161106,_0x1b5e4e);};}function removeListener(_0x4f036b,_0x39a27e){return function(){ChatInteractionEvents[_0xd28d('0x3')](_0x4f036b,_0x39a27e);};}exports[_0xd28d('0x4')]=function(_0x1efa00){for(var _0x51e6c9=0x0,_0x1b9c58=events[_0xd28d('0x5')];_0x51e6c9<_0x1b9c58;_0x51e6c9++){var _0x5a5318=events[_0x51e6c9];var _0x35956e=createListener(_0xd28d('0x6')+_0x5a5318,_0x1efa00);ChatInteractionEvents['on'](_0x5a5318,_0x35956e);}}; \ No newline at end of file +var _0xf6cf=['save','update','emit','removeListener','register','chatInteraction:','./chatInteraction.events'];(function(_0x240786,_0x2bd6e1){var _0xd3a543=function(_0xc091e3){while(--_0xc091e3){_0x240786['push'](_0x240786['shift']());}};_0xd3a543(++_0x2bd6e1);}(_0xf6cf,0x156));var _0xff6c=function(_0x49f7a0,_0x52f319){_0x49f7a0=_0x49f7a0-0x0;var _0x5d2518=_0xf6cf[_0x49f7a0];return _0x5d2518;};'use strict';var ChatInteractionEvents=require(_0xff6c('0x0'));var events=[_0xff6c('0x1'),'remove',_0xff6c('0x2')];function createListener(_0x13040f,_0x28282b){return function(_0x35d6fc){_0x28282b[_0xff6c('0x3')](_0x13040f,_0x35d6fc);};}function removeListener(_0x232e86,_0x25471c){return function(){ChatInteractionEvents[_0xff6c('0x4')](_0x232e86,_0x25471c);};}exports[_0xff6c('0x5')]=function(_0x47b562){for(var _0x77b1e3=0x0,_0x4e1f5f=events['length'];_0x77b1e3<_0x4e1f5f;_0x77b1e3++){var _0x5e1887=events[_0x77b1e3];var _0x87849f=createListener(_0xff6c('0x6')+_0x5e1887,_0x47b562);ChatInteractionEvents['on'](_0x5e1887,_0x87849f);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index d326b20..af2c9c1 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 _0xc7e7=['delete','chatinteraction:destroy','destroy','removeTags','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','server/files/attachments/','format','%s-%s','originalname','/:id/attachment_upload','file','attachmentUpload','addMessage','/:id/tags','chatinteraction:addtags','addTags','tracked','chat','chatinteraction:update','update','/:id/custom_update','customUpdate','put','/:id/abandon','abandon','/:id/close','close'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc7e7,0x162));var _0x7c7e=function(_0xf665cc,_0x56c142){_0xf665cc=_0xf665cc-0x0;var _0x2cfd79=_0xc7e7[_0xf665cc];return _0x2cfd79;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7c7e('0x0'));var timeout=require('connect-timeout');var express=require(_0x7c7e('0x1'));var router=express[_0x7c7e('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x7c7e('0x3'));var interaction=require(_0x7c7e('0x4'));var config=require(_0x7c7e('0x5'));var controller=require('./chatInteraction.controller');router[_0x7c7e('0x6')]('/',auth[_0x7c7e('0x7')](),controller[_0x7c7e('0x8')]);router[_0x7c7e('0x6')](_0x7c7e('0x9'),auth[_0x7c7e('0x7')](),controller[_0x7c7e('0xa')]);router[_0x7c7e('0x6')](_0x7c7e('0xb'),auth[_0x7c7e('0xc')](),controller[_0x7c7e('0xd')]);router[_0x7c7e('0x6')](_0x7c7e('0xe'),auth[_0x7c7e('0xc')](),controller[_0x7c7e('0xf')]);router[_0x7c7e('0x6')](_0x7c7e('0x10'),auth[_0x7c7e('0x7')](),controller['getMessages']);router[_0x7c7e('0x6')]('/:id/my_messages',auth[_0x7c7e('0xc')](),controller['getMyMessages']);router[_0x7c7e('0x6')](_0x7c7e('0x11'),auth[_0x7c7e('0x7')](),controller[_0x7c7e('0x12')]);router[_0x7c7e('0x13')]('/',auth[_0x7c7e('0x7')](),controller[_0x7c7e('0x14')]);router[_0x7c7e('0x13')](_0x7c7e('0x15'),auth[_0x7c7e('0x7')](),controller[_0x7c7e('0x16')]);var upload=multer({'storage':multer[_0x7c7e('0x17')]({'destination':function(_0x1a2b3a,_0x547777,_0x2cabf9){_0x2cabf9(null,path['join'](config['root'],_0x7c7e('0x18')));},'filename':function(_0x4852f6,_0x37d51,_0x3c0108){_0x3c0108(null,util[_0x7c7e('0x19')](_0x7c7e('0x1a'),Date['now'](),_0x37d51[_0x7c7e('0x1b')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x7c7e('0x1c'),upload['single'](_0x7c7e('0x1d')),controller[_0x7c7e('0x1e')]);router[_0x7c7e('0x13')](_0x7c7e('0x10'),auth['isChatInteractionAuthorized'](),controller[_0x7c7e('0x1f')]);router[_0x7c7e('0x13')](_0x7c7e('0x20'),auth[_0x7c7e('0x7')](),interaction['tracked']('chat',_0x7c7e('0x21')),controller[_0x7c7e('0x22')]);router['put'](_0x7c7e('0xb'),auth[_0x7c7e('0x7')](),interaction[_0x7c7e('0x23')](_0x7c7e('0x24'),_0x7c7e('0x25')),controller[_0x7c7e('0x26')]);router['put'](_0x7c7e('0x27'),controller[_0x7c7e('0x28')]);router[_0x7c7e('0x29')](_0x7c7e('0x2a'),auth[_0x7c7e('0xc')](),controller[_0x7c7e('0x2b')]);router[_0x7c7e('0x29')](_0x7c7e('0x2c'),controller[_0x7c7e('0x2d')]);router[_0x7c7e('0x2e')](_0x7c7e('0xb'),auth[_0x7c7e('0x7')](),interaction['tracked']('chat',_0x7c7e('0x2f')),controller[_0x7c7e('0x30')]);router[_0x7c7e('0x2e')]('/:id/tags',auth[_0x7c7e('0x7')](),controller[_0x7c7e('0x31')]);module['exports']=router; \ No newline at end of file +var _0xbda7=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','isAuthenticated','index','get','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','/:id/messages','getMessages','/:id/my_messages','getMyMessages','download','post','/:id/vidaoo','join','format','%s-%s','replace','/:id/attachment_upload','single','attachmentUpload','/:id/tags','tracked','chat','addTags','put','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','delete','chatinteraction:destroy','removeTags','exports','util'];(function(_0x5f46d2,_0x417305){var _0x387ed9=function(_0x4cacbf){while(--_0x4cacbf){_0x5f46d2['push'](_0x5f46d2['shift']());}};_0x387ed9(++_0x417305);}(_0xbda7,0x1ee));var _0x7bda=function(_0x37b67f,_0x497547){_0x37b67f=_0x37b67f-0x0;var _0x5514e8=_0xbda7[_0x37b67f];return _0x5514e8;};'use strict';var multer=require('multer');var util=require(_0x7bda('0x0'));var path=require('path');var timeout=require(_0x7bda('0x1'));var express=require(_0x7bda('0x2'));var router=express[_0x7bda('0x3')]();var fs_extra=require(_0x7bda('0x4'));var auth=require(_0x7bda('0x5'));var interaction=require(_0x7bda('0x6'));var config=require(_0x7bda('0x7'));var controller=require(_0x7bda('0x8'));router['get']('/',auth[_0x7bda('0x9')](),controller[_0x7bda('0xa')]);router[_0x7bda('0xb')]('/describe',auth[_0x7bda('0x9')](),controller['describe']);router[_0x7bda('0xb')](_0x7bda('0xc'),auth[_0x7bda('0xd')](),controller[_0x7bda('0xe')]);router['get'](_0x7bda('0xf'),auth[_0x7bda('0xd')](),controller['attachmentDownload']);router[_0x7bda('0xb')](_0x7bda('0x10'),auth['isAuthenticated'](),controller[_0x7bda('0x11')]);router['get'](_0x7bda('0x12'),auth[_0x7bda('0xd')](),controller[_0x7bda('0x13')]);router[_0x7bda('0xb')]('/:id/download',auth[_0x7bda('0x9')](),controller[_0x7bda('0x14')]);router['post']('/',auth[_0x7bda('0x9')](),controller['create']);router[_0x7bda('0x15')](_0x7bda('0x16'),auth[_0x7bda('0x9')](),controller['createVidaooSession']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3044d5,_0x36ba63,_0x1bcc2b){_0x1bcc2b(null,path[_0x7bda('0x17')](config['root'],'server/files/attachments/'));},'filename':function(_0x1381de,_0x11d298,_0x796296){_0x796296(null,util[_0x7bda('0x18')](_0x7bda('0x19'),Date['now'](),_0x11d298['originalname'][_0x7bda('0x1a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x7bda('0x15')](_0x7bda('0x1b'),upload[_0x7bda('0x1c')]('file'),controller[_0x7bda('0x1d')]);router[_0x7bda('0x15')](_0x7bda('0x10'),auth[_0x7bda('0xd')](),controller['addMessage']);router[_0x7bda('0x15')](_0x7bda('0x1e'),auth[_0x7bda('0x9')](),interaction[_0x7bda('0x1f')](_0x7bda('0x20'),'chatinteraction:addtags'),controller[_0x7bda('0x21')]);router[_0x7bda('0x22')]('/:id',auth['isAuthenticated'](),interaction[_0x7bda('0x1f')](_0x7bda('0x20'),'chatinteraction:update'),controller[_0x7bda('0x23')]);router[_0x7bda('0x22')](_0x7bda('0x24'),controller[_0x7bda('0x25')]);router[_0x7bda('0x22')](_0x7bda('0x26'),auth['isChatInteractionAuthorized'](),controller[_0x7bda('0x27')]);router['put'](_0x7bda('0x28'),controller['close']);router[_0x7bda('0x29')](_0x7bda('0xc'),auth[_0x7bda('0x9')](),interaction[_0x7bda('0x1f')]('chat',_0x7bda('0x2a')),controller['destroy']);router[_0x7bda('0x29')](_0x7bda('0x1e'),auth[_0x7bda('0x9')](),controller[_0x7bda('0x2b')]);module[_0x7bda('0x2c')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 5ac6d2d..eab4963 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 _0x1d8b=['exports','BOOLEAN'];(function(_0x222a0f,_0x1b97cd){var _0x126665=function(_0x56c1ec){while(--_0x56c1ec){_0x222a0f['push'](_0x222a0f['shift']());}};_0x126665(++_0x1b97cd);}(_0x1d8b,0xc8));var _0xb1d8=function(_0xc67528,_0x24e2fb){_0xc67528=_0xc67528-0x0;var _0x38e26d=_0x1d8b[_0xc67528];return _0x38e26d;};'use strict';var Sequelize=require('sequelize');module[_0xb1d8('0x0')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xb1d8('0x1')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x6a22=['medium','BOOLEAN','INTEGER','sequelize','TEXT'];(function(_0x14840d,_0x2efbe0){var _0x69956d=function(_0x2dac23){while(--_0x2dac23){_0x14840d['push'](_0x14840d['shift']());}};_0x69956d(++_0x2efbe0);}(_0x6a22,0x148));var _0x26a2=function(_0x2c00b3,_0x29b200){_0x2c00b3=_0x2c00b3-0x0;var _0x595512=_0x6a22[_0x2c00b3];return _0x595512;};'use strict';var Sequelize=require(_0x26a2('0x0'));module['exports']={'body':{'type':Sequelize[_0x26a2('0x1')](_0x26a2('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x26a2('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x26a2('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 2221740..05d078f 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 _0x9790=['lastMessage','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','admin','role','userpic','internal','online','lastLoginAt','showWebBar','-online','VoiceQueue','VoiceQueues','user','get','UserProfileSection','autoAssociation','isEmpty','agent','resourceId','push','messages','FromId','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','json','offset','undefined','limit','count','apply','save','then','destroy','end','error','stack','name','send','index','ChatInternalMessage','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','keys','include','options','create','body','update','find','params','describe','createdAt'];(function(_0x4f0956,_0x1f5e73){var _0xf28ef7=function(_0x423bdd){while(--_0x423bdd){_0x4f0956['push'](_0x4f0956['shift']());}};_0xf28ef7(++_0x1f5e73);}(_0x9790,0x8e));var _0x0979=function(_0xd5f9b3,_0x19aad6){_0xd5f9b3=_0xd5f9b3-0x0;var _0x13db33=_0x9790[_0xd5f9b3];return _0x13db33;};'use strict';var emlformat=require(_0x0979('0x0'));var rimraf=require(_0x0979('0x1'));var zipdir=require(_0x0979('0x2'));var jsonpatch=require(_0x0979('0x3'));var rp=require(_0x0979('0x4'));var moment=require('moment');var BPromise=require(_0x0979('0x5'));var Mustache=require(_0x0979('0x6'));var util=require('util');var path=require(_0x0979('0x7'));var sox=require(_0x0979('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0979('0x9'));var _=require(_0x0979('0xa'));var squel=require(_0x0979('0xb'));var crypto=require(_0x0979('0xc'));var jsforce=require(_0x0979('0xd'));var deskjs=require(_0x0979('0xe'));var toCsv=require(_0x0979('0xf'));var querystring=require(_0x0979('0x10'));var Papa=require(_0x0979('0x11'));var Redis=require(_0x0979('0x12'));var authService=require(_0x0979('0x13'));var qs=require(_0x0979('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0979('0x15'))('api');var utils=require(_0x0979('0x16'));var config=require(_0x0979('0x17'));var licenseUtil=require(_0x0979('0x18'));var db=require(_0x0979('0x19'))['db'];config[_0x0979('0x1a')]=_[_0x0979('0x1b')](config[_0x0979('0x1a')],{'host':_0x0979('0x1c'),'port':0x18eb});var socket=require(_0x0979('0x1d'))(new Redis(config['redis']));require('./chatInternalMessage.socket')['register'](socket);function respondWithStatusCode(_0x4fe19b,_0x2bd34c){_0x2bd34c=_0x2bd34c||0xcc;return function(_0x1422a2){if(_0x1422a2){return _0x4fe19b[_0x0979('0x1e')](_0x2bd34c);}return _0x4fe19b[_0x0979('0x1f')](_0x2bd34c)['end']();};}function respondWithResult(_0xe65e3b,_0x2d025a){_0x2d025a=_0x2d025a||0xc8;return function(_0x4046f8){if(_0x4046f8){return _0xe65e3b[_0x0979('0x1f')](_0x2d025a)[_0x0979('0x20')](_0x4046f8);}};}function respondWithFilteredResult(_0x26be3a,_0x247102){return function(_0x2d091d){if(_0x2d091d){var _0x48fd30=typeof _0x247102[_0x0979('0x21')]===_0x0979('0x22')&&typeof _0x247102[_0x0979('0x23')]===_0x0979('0x22');var _0x5a592c=_0x2d091d[_0x0979('0x24')];var _0x2cdb95=_0x48fd30?0x0:_0x247102['offset'];var _0x2e2981=_0x48fd30?_0x2d091d[_0x0979('0x24')]:_0x247102[_0x0979('0x21')]+_0x247102[_0x0979('0x23')];var _0x5c1db0;if(_0x2e2981>=_0x5a592c){_0x2e2981=_0x5a592c;_0x5c1db0=0xc8;}else{_0x5c1db0=0xce;}_0x26be3a[_0x0979('0x1f')](_0x5c1db0);return _0x26be3a['set']('Content-Range',_0x2cdb95+'-'+_0x2e2981+'/'+_0x5a592c)[_0x0979('0x20')](_0x2d091d);}return null;};}function patchUpdates(_0x994512){return function(_0x341448){try{jsonpatch[_0x0979('0x25')](_0x341448,_0x994512,!![]);}catch(_0x5761de){return BPromise['reject'](_0x5761de);}return _0x341448[_0x0979('0x26')]();};}function saveUpdates(_0x23f689,_0x16eca8){return function(_0x1a973e){if(_0x1a973e){return _0x1a973e['update'](_0x23f689)[_0x0979('0x27')](function(_0x57b251){return _0x57b251;});}return null;};}function removeEntity(_0x559a2e,_0x33757e){return function(_0xddcc47){if(_0xddcc47){return _0xddcc47[_0x0979('0x28')]()[_0x0979('0x27')](function(){_0x559a2e['status'](0xcc)[_0x0979('0x29')]();});}};}function handleEntityNotFound(_0x538435,_0x50d4cc){return function(_0x4c7a64){if(!_0x4c7a64){_0x538435['sendStatus'](0x194);}return _0x4c7a64;};}function handleError(_0x4c1320,_0x3be623){_0x3be623=_0x3be623||0x1f4;return function(_0x451ded){logger[_0x0979('0x2a')](_0x451ded[_0x0979('0x2b')]);if(_0x451ded[_0x0979('0x2c')]){delete _0x451ded['name'];}_0x4c1320[_0x0979('0x1f')](_0x3be623)[_0x0979('0x2d')](_0x451ded);};}exports[_0x0979('0x2e')]=function(_0x44fb62,_0xbc043c){var _0x7ca74b={},_0x152c77={},_0x334ca7={'count':0x0,'rows':[]};var _0x4ff6a1=_['map'](db[_0x0979('0x2f')][_0x0979('0x30')],function(_0x3cd3dc){return{'name':_0x3cd3dc[_0x0979('0x31')],'type':_0x3cd3dc[_0x0979('0x32')][_0x0979('0x33')]};});_0x152c77[_0x0979('0x34')]=_[_0x0979('0x35')](_0x4ff6a1,_0x0979('0x2c'));_0x152c77[_0x0979('0x36')]=_['keys'](_0x44fb62['query']);_0x152c77[_0x0979('0x37')]=_[_0x0979('0x38')](_0x152c77['model'],_0x152c77['query']);_0x7ca74b[_0x0979('0x39')]=_[_0x0979('0x38')](_0x152c77[_0x0979('0x34')],qs[_0x0979('0x3a')](_0x44fb62[_0x0979('0x36')]['fields']));_0x7ca74b[_0x0979('0x39')]=_0x7ca74b[_0x0979('0x39')][_0x0979('0x3b')]?_0x7ca74b[_0x0979('0x39')]:_0x152c77[_0x0979('0x34')];if(!_0x44fb62[_0x0979('0x36')][_0x0979('0x3c')](_0x0979('0x3d'))){_0x7ca74b['limit']=qs[_0x0979('0x23')](_0x44fb62['query']['limit']);_0x7ca74b[_0x0979('0x21')]=qs[_0x0979('0x21')](_0x44fb62[_0x0979('0x36')][_0x0979('0x21')]);}_0x7ca74b['order']=qs[_0x0979('0x3e')](_0x44fb62[_0x0979('0x36')][_0x0979('0x3e')]);_0x7ca74b[_0x0979('0x3f')]=qs[_0x0979('0x37')](_['pick'](_0x44fb62[_0x0979('0x36')],_0x152c77[_0x0979('0x37')]),_0x4ff6a1);if(_0x44fb62['query'][_0x0979('0x40')]){_0x7ca74b['where']=_[_0x0979('0x41')](_0x7ca74b['where'],{'$or':_[_0x0979('0x35')](_0x4ff6a1,function(_0x22d0cf){if(_0x22d0cf[_0x0979('0x32')]!==_0x0979('0x42')){var _0x1c1e59={};_0x1c1e59[_0x22d0cf[_0x0979('0x2c')]]={'$like':'%'+_0x44fb62['query']['filter']+'%'};return _0x1c1e59;}})});}_0x7ca74b=_[_0x0979('0x41')]({},_0x7ca74b,_0x44fb62['options']);var _0x24581e={'where':_0x7ca74b[_0x0979('0x3f')]};return db[_0x0979('0x2f')]['count'](_0x24581e)[_0x0979('0x27')](function(_0xe8d0f4){_0x334ca7[_0x0979('0x24')]=_0xe8d0f4;if(_0x44fb62[_0x0979('0x36')][_0x0979('0x43')]){_0x7ca74b['include']=[{'all':!![]}];}return db[_0x0979('0x2f')][_0x0979('0x44')](_0x7ca74b);})[_0x0979('0x27')](function(_0x5138c9){_0x334ca7[_0x0979('0x45')]=_0x5138c9;return _0x334ca7;})[_0x0979('0x27')](respondWithFilteredResult(_0xbc043c,_0x7ca74b))[_0x0979('0x46')](handleError(_0xbc043c,null));};exports[_0x0979('0x47')]=function(_0x257f67,_0x4e75e2){var _0x6ea4c={'raw':!![],'where':{'id':_0x257f67['params']['id']}},_0x42e90c={};_0x42e90c['model']=_[_0x0979('0x48')](db[_0x0979('0x2f')][_0x0979('0x30')]);_0x42e90c[_0x0979('0x36')]=_['keys'](_0x257f67['query']);_0x42e90c[_0x0979('0x37')]=_['intersection'](_0x42e90c['model'],_0x42e90c['query']);_0x6ea4c['attributes']=_[_0x0979('0x38')](_0x42e90c[_0x0979('0x34')],qs[_0x0979('0x3a')](_0x257f67['query'][_0x0979('0x3a')]));_0x6ea4c[_0x0979('0x39')]=_0x6ea4c[_0x0979('0x39')]['length']?_0x6ea4c[_0x0979('0x39')]:_0x42e90c['model'];if(_0x257f67[_0x0979('0x36')][_0x0979('0x43')]){_0x6ea4c[_0x0979('0x49')]=[{'all':!![]}];}_0x6ea4c=_[_0x0979('0x41')]({},_0x6ea4c,_0x257f67[_0x0979('0x4a')]);return db[_0x0979('0x2f')]['find'](_0x6ea4c)[_0x0979('0x27')](handleEntityNotFound(_0x4e75e2,null))[_0x0979('0x27')](respondWithResult(_0x4e75e2,null))[_0x0979('0x46')](handleError(_0x4e75e2,null));};exports[_0x0979('0x4b')]=function(_0x1000dc,_0x9edcf5){return db[_0x0979('0x2f')][_0x0979('0x4b')](_0x1000dc[_0x0979('0x4c')],{})[_0x0979('0x27')](respondWithResult(_0x9edcf5,0xc9))[_0x0979('0x46')](handleError(_0x9edcf5,null));};exports[_0x0979('0x4d')]=function(_0x1e00d5,_0x2fe8f6){if(_0x1e00d5['body']['id']){delete _0x1e00d5[_0x0979('0x4c')]['id'];}return db[_0x0979('0x2f')][_0x0979('0x4e')]({'where':{'id':_0x1e00d5[_0x0979('0x4f')]['id']}})[_0x0979('0x27')](handleEntityNotFound(_0x2fe8f6,null))[_0x0979('0x27')](saveUpdates(_0x1e00d5[_0x0979('0x4c')],null))[_0x0979('0x27')](respondWithResult(_0x2fe8f6,null))[_0x0979('0x46')](handleError(_0x2fe8f6,null));};exports[_0x0979('0x28')]=function(_0x225e14,_0x52830a){return db[_0x0979('0x2f')][_0x0979('0x4e')]({'where':{'id':_0x225e14[_0x0979('0x4f')]['id']}})['then'](handleEntityNotFound(_0x52830a,null))[_0x0979('0x27')](removeEntity(_0x52830a,null))[_0x0979('0x46')](handleError(_0x52830a,null));};exports[_0x0979('0x50')]=function(_0x282d4f,_0x582ee3){return db['ChatInternalMessage'][_0x0979('0x50')]()[_0x0979('0x27')](respondWithResult(_0x582ee3,null))['catch'](handleError(_0x582ee3,null));};function wrapUser(_0x3e5a2b){return function(_0xae6db9){var _0xdeb3ac=_0x3e5a2b['get']({'plain':!![]});_0xdeb3ac['messages']=[];if(_0xae6db9){_0xdeb3ac['lastMessageAt']=_0xae6db9[_0x0979('0x51')];_0xdeb3ac[_0x0979('0x52')]=_0xae6db9;}else{_0xdeb3ac[_0x0979('0x53')]=moment(0x0)[_0x0979('0x54')](_0x0979('0x55'));_0xdeb3ac[_0x0979('0x52')]={};}return _0xdeb3ac;};}exports[_0x0979('0x56')]=function(_0x3441af,_0x3e5761,_0x5ee055){var _0x5db372=[];return db[_0x0979('0x57')][_0x0979('0x44')]({'where':{'role':['agent',_0x0979('0x58'),'user']},'attributes':['id','fullname',_0x0979('0x2c'),_0x0979('0x59'),_0x0979('0x5a'),_0x0979('0x5b'),_0x0979('0x5c'),_0x0979('0x5d'),'allowmessenger',_0x0979('0x5e')],'order':qs['sort'](_0x0979('0x5f')),'include':[{'model':db[_0x0979('0x60')],'as':_0x0979('0x61'),'attributes':['id',_0x0979('0x2c'),_0x0979('0x32')],'through':{'attributes':[]}}]})['then'](function(_0x393e81){if(_0x393e81){var _0x43642d=_0x3441af[_0x0979('0x62')][_0x0979('0x63')]({'plain':!![]});if(!_0x43642d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x43642d[_0x0979('0x59')]==='user'){return db[_0x0979('0x64')]['find']({'where':{'name':'Agents','userProfileId':_0x43642d['userProfileId']},'raw':!![]})[_0x0979('0x27')](function(_0x38032b){if(_0x38032b){if(_0x38032b[_0x0979('0x65')]===0x0){return db['UserProfileResource'][_0x0979('0x44')]({'where':{'sectionId':_0x38032b['id']},'raw':!![]})[_0x0979('0x27')](function(_0x4f96e0){var _0x3ea38e=[];if(_[_0x0979('0x66')](_0x4f96e0)){_0x3ea38e=_[_0x0979('0x40')](_0x393e81,function(_0x15d3b7){if(_0x15d3b7['role']!=='agent'){return _0x15d3b7;}});return _0x3ea38e;}else{for(var _0x41be48=0x0;_0x41be48<_0x393e81['length'];_0x41be48++){var _0x229f04=_0x393e81[_0x41be48];if(_0x229f04[_0x0979('0x59')]===_0x0979('0x67')){var _0x2a16dd=_[_0x0979('0x4e')](_0x4f96e0,function(_0x3c5f99){return _0x3c5f99[_0x0979('0x68')]===_0x229f04['id'];});if(_0x2a16dd)_0x3ea38e[_0x0979('0x69')](_0x229f04);}else{_0x3ea38e[_0x0979('0x69')](_0x229f04);}}return _0x3ea38e;}});}else{return _0x393e81;}}else{var _0x2199e6=_[_0x0979('0x40')](_0x393e81,function(_0xb55966){if(_0xb55966[_0x0979('0x59')]!=='agent'){return _0xb55966;}});return _0x2199e6;}});}else{return _0x393e81;}}})['then'](function(_0x77ba8f){var _0x57772d=[];if(_0x77ba8f){_0x5db372=_0x77ba8f;for(var _0x3b418c=0x0;_0x3b418c<_0x77ba8f[_0x0979('0x3b')];_0x3b418c+=0x1){_0x5db372[_0x3b418c][_0x0979('0x6a')]=[];_0x57772d[_0x0979('0x69')](db[_0x0979('0x2f')][_0x0979('0x4e')]({'where':{'FromId':[_0x3441af['user']['id'],_0x77ba8f[_0x3b418c]['id']],'ToId':[_0x3441af['user']['id'],_0x77ba8f[_0x3b418c]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x0979('0x6b'),_0x0979('0x6c'),_0x0979('0x6d'),_0x0979('0x4c')],'order':qs[_0x0979('0x3e')](_0x0979('0x6e')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x0979('0x27')](wrapUser(_0x77ba8f[_0x3b418c])));}return BPromise[_0x0979('0x6f')](_0x57772d);}return[];})[_0x0979('0x27')](function(_0xe7050a){return{'rows':_0xe7050a,'count':_0xe7050a['length']};})[_0x0979('0x27')](respondWithResult(_0x3e5761,null))[_0x0979('0x46')](handleError(_0x3e5761,null));}; \ No newline at end of file +var _0xe3b3=['Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','ChatInternalMessage','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','params','rawAttributes','find','create','body','update','describe','messages','lastMessageAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','agent','admin','user','fullname','role','userpic','internal','lastLoginAt','allowmessenger','showWebBar','VoiceQueue','VoiceQueues','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','UserProfileResource','isEmpty','push','FromId','ToId','-createdAt','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/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','json','undefined','count','offset','set'];(function(_0x41ae4f,_0x20e57f){var _0x18a5a1=function(_0x122c83){while(--_0x122c83){_0x41ae4f['push'](_0x41ae4f['shift']());}};_0x18a5a1(++_0x20e57f);}(_0xe3b3,0x125));var _0x3e3b=function(_0x1a8cc1,_0x4090c2){_0x1a8cc1=_0x1a8cc1-0x0;var _0x20d95d=_0xe3b3[_0x1a8cc1];return _0x20d95d;};'use strict';var emlformat=require(_0x3e3b('0x0'));var rimraf=require(_0x3e3b('0x1'));var zipdir=require(_0x3e3b('0x2'));var jsonpatch=require(_0x3e3b('0x3'));var rp=require(_0x3e3b('0x4'));var moment=require(_0x3e3b('0x5'));var BPromise=require(_0x3e3b('0x6'));var Mustache=require(_0x3e3b('0x7'));var util=require(_0x3e3b('0x8'));var path=require(_0x3e3b('0x9'));var sox=require(_0x3e3b('0xa'));var csv=require(_0x3e3b('0xb'));var ejs=require(_0x3e3b('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3e3b('0xd'));var squel=require(_0x3e3b('0xe'));var crypto=require(_0x3e3b('0xf'));var jsforce=require(_0x3e3b('0x10'));var deskjs=require(_0x3e3b('0x11'));var toCsv=require(_0x3e3b('0xb'));var querystring=require('querystring');var Papa=require(_0x3e3b('0x12'));var Redis=require(_0x3e3b('0x13'));var authService=require(_0x3e3b('0x14'));var qs=require(_0x3e3b('0x15'));var as=require(_0x3e3b('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3e3b('0x17'))(_0x3e3b('0x18'));var utils=require(_0x3e3b('0x19'));var config=require(_0x3e3b('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x3e3b('0x1b'))['db'];config['redis']=_['defaults'](config[_0x3e3b('0x1c')],{'host':_0x3e3b('0x1d'),'port':0x18eb});var socket=require(_0x3e3b('0x1e'))(new Redis(config[_0x3e3b('0x1c')]));require(_0x3e3b('0x1f'))[_0x3e3b('0x20')](socket);function respondWithStatusCode(_0x2fcfa5,_0xc63a07){_0xc63a07=_0xc63a07||0xcc;return function(_0x5596a6){if(_0x5596a6){return _0x2fcfa5[_0x3e3b('0x21')](_0xc63a07);}return _0x2fcfa5['status'](_0xc63a07)['end']();};}function respondWithResult(_0x363937,_0x559c52){_0x559c52=_0x559c52||0xc8;return function(_0x14aa4c){if(_0x14aa4c){return _0x363937[_0x3e3b('0x22')](_0x559c52)[_0x3e3b('0x23')](_0x14aa4c);}};}function respondWithFilteredResult(_0x351c37,_0x2314a9){return function(_0x1a764b){if(_0x1a764b){var _0x7b51c6=typeof _0x2314a9['offset']===_0x3e3b('0x24')&&typeof _0x2314a9['limit']===_0x3e3b('0x24');var _0x52effc=_0x1a764b[_0x3e3b('0x25')];var _0x5d1e8e=_0x7b51c6?0x0:_0x2314a9['offset'];var _0x470d26=_0x7b51c6?_0x1a764b[_0x3e3b('0x25')]:_0x2314a9[_0x3e3b('0x26')]+_0x2314a9['limit'];var _0x16899a;if(_0x470d26>=_0x52effc){_0x470d26=_0x52effc;_0x16899a=0xc8;}else{_0x16899a=0xce;}_0x351c37[_0x3e3b('0x22')](_0x16899a);return _0x351c37[_0x3e3b('0x27')](_0x3e3b('0x28'),_0x5d1e8e+'-'+_0x470d26+'/'+_0x52effc)[_0x3e3b('0x23')](_0x1a764b);}return null;};}function patchUpdates(_0x3d886f){return function(_0xc544f1){try{jsonpatch[_0x3e3b('0x29')](_0xc544f1,_0x3d886f,!![]);}catch(_0x2808ad){return BPromise[_0x3e3b('0x2a')](_0x2808ad);}return _0xc544f1[_0x3e3b('0x2b')]();};}function saveUpdates(_0x55d449,_0x20f3c7){return function(_0x5781dd){if(_0x5781dd){return _0x5781dd['update'](_0x55d449)[_0x3e3b('0x2c')](function(_0x5758e8){return _0x5758e8;});}return null;};}function removeEntity(_0x32f953,_0x42eede){return function(_0x59f587){if(_0x59f587){return _0x59f587[_0x3e3b('0x2d')]()[_0x3e3b('0x2c')](function(){_0x32f953['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a0ae9,_0x24d96b){return function(_0x5f1b3a){if(!_0x5f1b3a){_0x1a0ae9[_0x3e3b('0x21')](0x194);}return _0x5f1b3a;};}function handleError(_0x14b654,_0x479f2b){_0x479f2b=_0x479f2b||0x1f4;return function(_0x2f3c77){logger[_0x3e3b('0x2e')](_0x2f3c77[_0x3e3b('0x2f')]);if(_0x2f3c77[_0x3e3b('0x30')]){delete _0x2f3c77['name'];}_0x14b654['status'](_0x479f2b)[_0x3e3b('0x31')](_0x2f3c77);};}exports[_0x3e3b('0x32')]=function(_0x501441,_0x414a75){var _0x13d03f={},_0x5dd16a={},_0x17dc9={'count':0x0,'rows':[]};var _0x5442e6=_[_0x3e3b('0x33')](db[_0x3e3b('0x34')]['rawAttributes'],function(_0x4c3a4b){return{'name':_0x4c3a4b['fieldName'],'type':_0x4c3a4b[_0x3e3b('0x35')]['key']};});_0x5dd16a[_0x3e3b('0x36')]=_['map'](_0x5442e6,_0x3e3b('0x30'));_0x5dd16a[_0x3e3b('0x37')]=_[_0x3e3b('0x38')](_0x501441[_0x3e3b('0x37')]);_0x5dd16a[_0x3e3b('0x39')]=_[_0x3e3b('0x3a')](_0x5dd16a['model'],_0x5dd16a[_0x3e3b('0x37')]);_0x13d03f[_0x3e3b('0x3b')]=_[_0x3e3b('0x3a')](_0x5dd16a[_0x3e3b('0x36')],qs[_0x3e3b('0x3c')](_0x501441['query'][_0x3e3b('0x3c')]));_0x13d03f[_0x3e3b('0x3b')]=_0x13d03f[_0x3e3b('0x3b')][_0x3e3b('0x3d')]?_0x13d03f[_0x3e3b('0x3b')]:_0x5dd16a[_0x3e3b('0x36')];if(!_0x501441[_0x3e3b('0x37')][_0x3e3b('0x3e')](_0x3e3b('0x3f'))){_0x13d03f[_0x3e3b('0x40')]=qs[_0x3e3b('0x40')](_0x501441[_0x3e3b('0x37')][_0x3e3b('0x40')]);_0x13d03f[_0x3e3b('0x26')]=qs['offset'](_0x501441[_0x3e3b('0x37')]['offset']);}_0x13d03f['order']=qs[_0x3e3b('0x41')](_0x501441[_0x3e3b('0x37')]['sort']);_0x13d03f[_0x3e3b('0x42')]=qs['filters'](_[_0x3e3b('0x43')](_0x501441['query'],_0x5dd16a[_0x3e3b('0x39')]),_0x5442e6);if(_0x501441[_0x3e3b('0x37')]['filter']){_0x13d03f[_0x3e3b('0x42')]=_[_0x3e3b('0x44')](_0x13d03f[_0x3e3b('0x42')],{'$or':_[_0x3e3b('0x33')](_0x5442e6,function(_0x2344eb){if(_0x2344eb[_0x3e3b('0x35')]!==_0x3e3b('0x45')){var _0x888dae={};_0x888dae[_0x2344eb[_0x3e3b('0x30')]]={'$like':'%'+_0x501441['query'][_0x3e3b('0x46')]+'%'};return _0x888dae;}})});}_0x13d03f=_[_0x3e3b('0x44')]({},_0x13d03f,_0x501441[_0x3e3b('0x47')]);var _0x5c8b28={'where':_0x13d03f['where']};return db[_0x3e3b('0x34')][_0x3e3b('0x25')](_0x5c8b28)[_0x3e3b('0x2c')](function(_0x548b97){_0x17dc9[_0x3e3b('0x25')]=_0x548b97;if(_0x501441[_0x3e3b('0x37')][_0x3e3b('0x48')]){_0x13d03f['include']=[{'all':!![]}];}return db[_0x3e3b('0x34')][_0x3e3b('0x49')](_0x13d03f);})[_0x3e3b('0x2c')](function(_0x4c6724){_0x17dc9[_0x3e3b('0x4a')]=_0x4c6724;return _0x17dc9;})[_0x3e3b('0x2c')](respondWithFilteredResult(_0x414a75,_0x13d03f))[_0x3e3b('0x4b')](handleError(_0x414a75,null));};exports['show']=function(_0x342a61,_0xabde9f){var _0x40c605={'raw':!![],'where':{'id':_0x342a61[_0x3e3b('0x4c')]['id']}},_0x46d275={};_0x46d275[_0x3e3b('0x36')]=_[_0x3e3b('0x38')](db['ChatInternalMessage'][_0x3e3b('0x4d')]);_0x46d275[_0x3e3b('0x37')]=_['keys'](_0x342a61['query']);_0x46d275[_0x3e3b('0x39')]=_['intersection'](_0x46d275[_0x3e3b('0x36')],_0x46d275[_0x3e3b('0x37')]);_0x40c605[_0x3e3b('0x3b')]=_[_0x3e3b('0x3a')](_0x46d275[_0x3e3b('0x36')],qs[_0x3e3b('0x3c')](_0x342a61[_0x3e3b('0x37')]['fields']));_0x40c605[_0x3e3b('0x3b')]=_0x40c605[_0x3e3b('0x3b')]['length']?_0x40c605['attributes']:_0x46d275['model'];if(_0x342a61[_0x3e3b('0x37')]['includeAll']){_0x40c605['include']=[{'all':!![]}];}_0x40c605=_[_0x3e3b('0x44')]({},_0x40c605,_0x342a61[_0x3e3b('0x47')]);return db[_0x3e3b('0x34')][_0x3e3b('0x4e')](_0x40c605)[_0x3e3b('0x2c')](handleEntityNotFound(_0xabde9f,null))[_0x3e3b('0x2c')](respondWithResult(_0xabde9f,null))[_0x3e3b('0x4b')](handleError(_0xabde9f,null));};exports['create']=function(_0x28703d,_0x257a6e){return db[_0x3e3b('0x34')][_0x3e3b('0x4f')](_0x28703d[_0x3e3b('0x50')],{})['then'](respondWithResult(_0x257a6e,0xc9))[_0x3e3b('0x4b')](handleError(_0x257a6e,null));};exports[_0x3e3b('0x51')]=function(_0x3a69fe,_0x3b11cb){if(_0x3a69fe['body']['id']){delete _0x3a69fe[_0x3e3b('0x50')]['id'];}return db[_0x3e3b('0x34')][_0x3e3b('0x4e')]({'where':{'id':_0x3a69fe[_0x3e3b('0x4c')]['id']}})[_0x3e3b('0x2c')](handleEntityNotFound(_0x3b11cb,null))[_0x3e3b('0x2c')](saveUpdates(_0x3a69fe[_0x3e3b('0x50')],null))['then'](respondWithResult(_0x3b11cb,null))['catch'](handleError(_0x3b11cb,null));};exports['destroy']=function(_0x317667,_0x12bac4){return db[_0x3e3b('0x34')][_0x3e3b('0x4e')]({'where':{'id':_0x317667['params']['id']}})['then'](handleEntityNotFound(_0x12bac4,null))[_0x3e3b('0x2c')](removeEntity(_0x12bac4,null))[_0x3e3b('0x4b')](handleError(_0x12bac4,null));};exports[_0x3e3b('0x52')]=function(_0x3ed61a,_0x5b0cdf){return db['ChatInternalMessage'][_0x3e3b('0x52')]()[_0x3e3b('0x2c')](respondWithResult(_0x5b0cdf,null))['catch'](handleError(_0x5b0cdf,null));};function wrapUser(_0x47291f){return function(_0x3cbe94){var _0xaf0bef=_0x47291f['get']({'plain':!![]});_0xaf0bef[_0x3e3b('0x53')]=[];if(_0x3cbe94){_0xaf0bef[_0x3e3b('0x54')]=_0x3cbe94['createdAt'];_0xaf0bef[_0x3e3b('0x55')]=_0x3cbe94;}else{_0xaf0bef[_0x3e3b('0x54')]=moment(0x0)[_0x3e3b('0x56')](_0x3e3b('0x57'));_0xaf0bef[_0x3e3b('0x55')]={};}return _0xaf0bef;};}exports[_0x3e3b('0x58')]=function(_0xa68bf0,_0x47b2ee,_0x4be313){var _0x4a747e=[];return db['User'][_0x3e3b('0x49')]({'where':{'role':[_0x3e3b('0x59'),_0x3e3b('0x5a'),_0x3e3b('0x5b')]},'attributes':['id',_0x3e3b('0x5c'),_0x3e3b('0x30'),_0x3e3b('0x5d'),_0x3e3b('0x5e'),_0x3e3b('0x5f'),'online',_0x3e3b('0x60'),_0x3e3b('0x61'),_0x3e3b('0x62')],'order':qs[_0x3e3b('0x41')]('-online'),'include':[{'model':db[_0x3e3b('0x63')],'as':_0x3e3b('0x64'),'attributes':['id',_0x3e3b('0x30'),_0x3e3b('0x35')],'through':{'attributes':[]}}]})[_0x3e3b('0x2c')](function(_0x3b9de9){if(_0x3b9de9){var _0x20cb15=_0xa68bf0['user'][_0x3e3b('0x65')]({'plain':!![]});if(!_0x20cb15)throw new Error(_0x3e3b('0x66'));if(_0x20cb15[_0x3e3b('0x5d')]===_0x3e3b('0x5b')){return db[_0x3e3b('0x67')]['find']({'where':{'name':_0x3e3b('0x68'),'userProfileId':_0x20cb15['userProfileId']},'raw':!![]})[_0x3e3b('0x2c')](function(_0x411eb4){if(_0x411eb4){if(_0x411eb4['autoAssociation']===0x0){return db[_0x3e3b('0x69')][_0x3e3b('0x49')]({'where':{'sectionId':_0x411eb4['id']},'raw':!![]})[_0x3e3b('0x2c')](function(_0x4e85e1){var _0x2da0f5=[];if(_[_0x3e3b('0x6a')](_0x4e85e1)){_0x2da0f5=_[_0x3e3b('0x46')](_0x3b9de9,function(_0x2cea22){if(_0x2cea22['role']!==_0x3e3b('0x59')){return _0x2cea22;}});return _0x2da0f5;}else{for(var _0xadf134=0x0;_0xadf134<_0x3b9de9['length'];_0xadf134++){var _0x2fb455=_0x3b9de9[_0xadf134];if(_0x2fb455[_0x3e3b('0x5d')]===_0x3e3b('0x59')){var _0x35d8c8=_[_0x3e3b('0x4e')](_0x4e85e1,function(_0x28d467){return _0x28d467['resourceId']===_0x2fb455['id'];});if(_0x35d8c8)_0x2da0f5[_0x3e3b('0x6b')](_0x2fb455);}else{_0x2da0f5['push'](_0x2fb455);}}return _0x2da0f5;}});}else{return _0x3b9de9;}}else{var _0x5ccae5=_['filter'](_0x3b9de9,function(_0x9fd465){if(_0x9fd465[_0x3e3b('0x5d')]!==_0x3e3b('0x59')){return _0x9fd465;}});return _0x5ccae5;}});}else{return _0x3b9de9;}}})[_0x3e3b('0x2c')](function(_0x50eb3d){var _0x16ee44=[];if(_0x50eb3d){_0x4a747e=_0x50eb3d;for(var _0x16c814=0x0;_0x16c814<_0x50eb3d[_0x3e3b('0x3d')];_0x16c814+=0x1){_0x4a747e[_0x16c814][_0x3e3b('0x53')]=[];_0x16ee44['push'](db[_0x3e3b('0x34')][_0x3e3b('0x4e')]({'where':{'FromId':[_0xa68bf0['user']['id'],_0x50eb3d[_0x16c814]['id']],'ToId':[_0xa68bf0['user']['id'],_0x50eb3d[_0x16c814]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x3e3b('0x6c'),_0x3e3b('0x6d'),'read','body'],'order':qs[_0x3e3b('0x41')](_0x3e3b('0x6e')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x3e3b('0x2c')](wrapUser(_0x50eb3d[_0x16c814])));}return BPromise['all'](_0x16ee44);}return[];})[_0x3e3b('0x2c')](function(_0x4a2c3d){return{'rows':_0x4a2c3d,'count':_0x4a2c3d[_0x3e3b('0x3d')]};})[_0x3e3b('0x2c')](respondWithResult(_0x47b2ee,null))['catch'](handleError(_0x47b2ee,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index ea7a34c..c910892 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 _0x79b5=['setMaxListeners','update','remove','emit','events','../../mysqldb','ChatInternalMessage'];(function(_0x556daa,_0x19452a){var _0xb0f115=function(_0x4ad092){while(--_0x4ad092){_0x556daa['push'](_0x556daa['shift']());}};_0xb0f115(++_0x19452a);}(_0x79b5,0x1bd));var _0x579b=function(_0x4c05ca,_0x1db77c){_0x4c05ca=_0x4c05ca-0x0;var _0x2bf9d9=_0x79b5[_0x4c05ca];return _0x2bf9d9;};'use strict';var EventEmitter=require(_0x579b('0x0'));var ChatInternalMessage=require(_0x579b('0x1'))['db'][_0x579b('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x579b('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x579b('0x4'),'afterDestroy':_0x579b('0x5')};function emitEvent(_0x463a7f){return function(_0x503968,_0x4d6d4f,_0x2fe97f){ChatInternalMessageEvents[_0x579b('0x6')](_0x463a7f+':'+_0x503968['id'],_0x503968);ChatInternalMessageEvents[_0x579b('0x6')](_0x463a7f,_0x503968);_0x2fe97f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file +var _0xc93e=['remove','emit','hasOwnProperty','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x585945,_0x5deaa7){var _0x420bad=function(_0x315f89){while(--_0x315f89){_0x585945['push'](_0x585945['shift']());}};_0x420bad(++_0x5deaa7);}(_0xc93e,0x143));var _0xec93=function(_0xe66cf2,_0x32ba5f){_0xe66cf2=_0xe66cf2-0x0;var _0x2d84e7=_0xc93e[_0xe66cf2];return _0x2d84e7;};'use strict';var EventEmitter=require(_0xec93('0x0'));var ChatInternalMessage=require(_0xec93('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xec93('0x2')](0x0);var events={'afterCreate':_0xec93('0x3'),'afterUpdate':_0xec93('0x4'),'afterDestroy':_0xec93('0x5')};function emitEvent(_0x2ccbe0){return function(_0x52d4c1,_0x140ada,_0x5ed1dd){ChatInternalMessageEvents[_0xec93('0x6')](_0x2ccbe0+':'+_0x52d4c1['id'],_0x52d4c1);ChatInternalMessageEvents[_0xec93('0x6')](_0x2ccbe0,_0x52d4c1);_0x5ed1dd(null);};}for(var e in events){if(events[_0xec93('0x7')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index e4c442e..cc6fb12 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 _0x989b=['rimraf','../../config/environment','define','ChatInternalMessage','chat_internal_messages','utf8mb4','util','moment','bluebird','request-promise'];(function(_0x5c5f4f,_0x746f02){var _0x54232c=function(_0x168194){while(--_0x168194){_0x5c5f4f['push'](_0x5c5f4f['shift']());}};_0x54232c(++_0x746f02);}(_0x989b,0x1be));var _0xb989=function(_0x33e692,_0x471951){_0x33e692=_0x33e692-0x0;var _0x3b4f48=_0x989b[_0x33e692];return _0x3b4f48;};'use strict';var _=require('lodash');var util=require(_0xb989('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xb989('0x1'));var BPromise=require(_0xb989('0x2'));var rp=require(_0xb989('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb989('0x4'));var config=require(_0xb989('0x5'));var attributes=require('./chatInternalMessage.attributes');module['exports']=function(_0x574173,_0x210b05){return _0x574173[_0xb989('0x6')](_0xb989('0x7'),attributes,{'tableName':_0xb989('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb989('0x9'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x0a78=['moment','request-promise','../../config/environment','./chatInternalMessage.attributes','exports','define','chat_internal_messages','utf8mb4_unicode_ci','../../config/logger','api'];(function(_0x40fcdf,_0x3ec4f0){var _0x4a0aee=function(_0x4a0bef){while(--_0x4a0bef){_0x40fcdf['push'](_0x40fcdf['shift']());}};_0x4a0aee(++_0x3ec4f0);}(_0x0a78,0x17a));var _0x80a7=function(_0x2a7ad1,_0x2d4295){_0x2a7ad1=_0x2a7ad1-0x0;var _0x266565=_0x0a78[_0x2a7ad1];return _0x266565;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x80a7('0x0'))(_0x80a7('0x1'));var moment=require(_0x80a7('0x2'));var BPromise=require('bluebird');var rp=require(_0x80a7('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x80a7('0x4'));var attributes=require(_0x80a7('0x5'));module[_0x80a7('0x6')]=function(_0x11c2fb,_0x281a15){return _0x11c2fb[_0x80a7('0x7')]('ChatInternalMessage',attributes,{'tableName':_0x80a7('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x80a7('0x9')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 0c398c7..bc16944 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 _0x6484=['request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register'];(function(_0x5a4843,_0x2cb9de){var _0x4eb652=function(_0x22a9ba){while(--_0x22a9ba){_0x5a4843['push'](_0x5a4843['shift']());}};_0x4eb652(++_0x2cb9de);}(_0x6484,0x1bb));var _0x4648=function(_0x98d8da,_0x3f9ece){_0x98d8da=_0x98d8da-0x0;var _0x118b06=_0x6484[_0x98d8da];return _0x118b06;};'use strict';var _=require('lodash');var util=require(_0x4648('0x0'));var moment=require(_0x4648('0x1'));var BPromise=require(_0x4648('0x2'));var rs=require(_0x4648('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4648('0x4'))['db'];var utils=require(_0x4648('0x5'));var logger=require('../../config/logger')(_0x4648('0x6'));var config=require(_0x4648('0x7'));var jayson=require(_0x4648('0x8'));var client=jayson['client'][_0x4648('0x9')]({'port':0x232a});config[_0x4648('0xa')]=_[_0x4648('0xb')](config[_0x4648('0xa')],{'host':_0x4648('0xc'),'port':0x18eb});var socket=require(_0x4648('0xd'))(new Redis(config[_0x4648('0xa')]));require(_0x4648('0xe'))[_0x4648('0xf')](socket);function respondWithRpcPromise(_0x4a846c,_0x51e481,_0x496f9c){return new BPromise(function(_0x2b599a,_0x37d582){return client[_0x4648('0x10')](_0x4a846c,_0x496f9c)[_0x4648('0x11')](function(_0xa7c5c5){logger[_0x4648('0x12')](_0x4648('0x13'),_0x51e481,_0x4648('0x14'));logger[_0x4648('0x15')](_0x4648('0x16'),_0x51e481,_0x4648('0x14'),JSON[_0x4648('0x17')](_0xa7c5c5));if(_0xa7c5c5[_0x4648('0x18')]){if(_0xa7c5c5['error'][_0x4648('0x19')]===0x1f4){logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x51e481,_0xa7c5c5[_0x4648('0x18')][_0x4648('0x1a')]);return _0x37d582(_0xa7c5c5[_0x4648('0x18')][_0x4648('0x1a')]);}logger[_0x4648('0x18')](_0x4648('0x13'),_0x51e481,_0xa7c5c5['error'][_0x4648('0x1a')]);return _0x2b599a(_0xa7c5c5[_0x4648('0x18')]['message']);}else{logger[_0x4648('0x12')](_0x4648('0x13'),_0x51e481,_0x4648('0x14'));_0x2b599a(_0xa7c5c5['result'][_0x4648('0x1a')]);}})['catch'](function(_0x28271e){logger[_0x4648('0x18')](_0x4648('0x13'),_0x51e481,_0x28271e);_0x37d582(_0x28271e);});});} \ No newline at end of file +var _0x77ec=['error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','defaults','redis','localhost','socket.io-emitter','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x975622,_0x269414){var _0x5f54ae=function(_0x559d11){while(--_0x559d11){_0x975622['push'](_0x975622['shift']());}};_0x5f54ae(++_0x269414);}(_0x77ec,0x1cf));var _0xc77e=function(_0x67956f,_0x269dc3){_0x67956f=_0x67956f-0x0;var _0x3bfe28=_0x77ec[_0x67956f];return _0x3bfe28;};'use strict';var _=require(_0xc77e('0x0'));var util=require(_0xc77e('0x1'));var moment=require(_0xc77e('0x2'));var BPromise=require(_0xc77e('0x3'));var rs=require(_0xc77e('0x4'));var fs=require('fs');var Redis=require(_0xc77e('0x5'));var db=require(_0xc77e('0x6'))['db'];var utils=require(_0xc77e('0x7'));var logger=require(_0xc77e('0x8'))(_0xc77e('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc77e('0xa')][_0xc77e('0xb')]({'port':0x232a});config['redis']=_[_0xc77e('0xc')](config[_0xc77e('0xd')],{'host':_0xc77e('0xe'),'port':0x18eb});var socket=require(_0xc77e('0xf'))(new Redis(config[_0xc77e('0xd')]));require('./chatInternalMessage.socket')[_0xc77e('0x10')](socket);function respondWithRpcPromise(_0x1ee6ff,_0x4d702f,_0x1813b0){return new BPromise(function(_0x3a9071,_0x32f678){return client[_0xc77e('0x11')](_0x1ee6ff,_0x1813b0)[_0xc77e('0x12')](function(_0x39068f){logger[_0xc77e('0x13')](_0xc77e('0x14'),_0x4d702f,_0xc77e('0x15'));logger['debug']('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x4d702f,_0xc77e('0x15'),JSON[_0xc77e('0x16')](_0x39068f));if(_0x39068f[_0xc77e('0x17')]){if(_0x39068f[_0xc77e('0x17')]['code']===0x1f4){logger['error'](_0xc77e('0x14'),_0x4d702f,_0x39068f['error'][_0xc77e('0x18')]);return _0x32f678(_0x39068f['error']['message']);}logger[_0xc77e('0x17')](_0xc77e('0x14'),_0x4d702f,_0x39068f['error'][_0xc77e('0x18')]);return _0x3a9071(_0x39068f[_0xc77e('0x17')][_0xc77e('0x18')]);}else{logger['info'](_0xc77e('0x14'),_0x4d702f,'request\x20sent');_0x3a9071(_0x39068f[_0xc77e('0x19')][_0xc77e('0x18')]);}})[_0xc77e('0x1a')](function(_0x69ba9c){logger[_0xc77e('0x17')](_0xc77e('0x14'),_0x4d702f,_0x69ba9c);_0x32f678(_0x69ba9c);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 3325587..92dda74 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 _0x183b=['remove','emit','removeListener','register','length','./chatInternalMessage.events','save'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x183b,0xd0));var _0xb183=function(_0x19c5ef,_0x369588){_0x19c5ef=_0x19c5ef-0x0;var _0x2e5aff=_0x183b[_0x19c5ef];return _0x2e5aff;};'use strict';var ChatInternalMessageEvents=require(_0xb183('0x0'));var events=[_0xb183('0x1'),_0xb183('0x2'),'update'];function createListener(_0x6232b,_0xde2ed4){return function(_0xa803ff){_0xde2ed4[_0xb183('0x3')](_0x6232b,_0xa803ff);};}function removeListener(_0x399e5e,_0x50c571){return function(){ChatInternalMessageEvents[_0xb183('0x4')](_0x399e5e,_0x50c571);};}exports[_0xb183('0x5')]=function(_0x8e4369){for(var _0x325472=0x0,_0x48a29d=events[_0xb183('0x6')];_0x325472<_0x48a29d;_0x325472++){var _0x57ddcb=events[_0x325472];var _0x16b1a7=createListener('chatInternalMessage:'+_0x57ddcb,_0x8e4369);ChatInternalMessageEvents['on'](_0x57ddcb,_0x16b1a7);}}; \ No newline at end of file +var _0x29d8=['./chatInternalMessage.events','save','update','emit','removeListener','register','length','chatInternalMessage:'];(function(_0x38a198,_0x4060f3){var _0x6a008b=function(_0x5b2095){while(--_0x5b2095){_0x38a198['push'](_0x38a198['shift']());}};_0x6a008b(++_0x4060f3);}(_0x29d8,0x110));var _0x829d=function(_0x30780d,_0x2ec4e7){_0x30780d=_0x30780d-0x0;var _0x338a06=_0x29d8[_0x30780d];return _0x338a06;};'use strict';var ChatInternalMessageEvents=require(_0x829d('0x0'));var events=[_0x829d('0x1'),'remove',_0x829d('0x2')];function createListener(_0x11b300,_0x4a8345){return function(_0x1a75cd){_0x4a8345[_0x829d('0x3')](_0x11b300,_0x1a75cd);};}function removeListener(_0x3f0a14,_0x220189){return function(){ChatInternalMessageEvents[_0x829d('0x4')](_0x3f0a14,_0x220189);};}exports[_0x829d('0x5')]=function(_0x1edce6){for(var _0x45cb08=0x0,_0x200f79=events[_0x829d('0x6')];_0x45cb08<_0x200f79;_0x45cb08++){var _0x264e34=events[_0x45cb08];var _0x4faba7=createListener(_0x829d('0x7')+_0x264e34,_0x1edce6);ChatInternalMessageEvents['on'](_0x264e34,_0x4faba7);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 747b9c5..91361d0 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 _0x48a7=['describe','getUsers','/:id','show','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./chatInternalMessage.controller','get','isAuthenticated'];(function(_0x5ad1e0,_0x12fb74){var _0x45ab27=function(_0x320d3d){while(--_0x320d3d){_0x5ad1e0['push'](_0x5ad1e0['shift']());}};_0x45ab27(++_0x12fb74);}(_0x48a7,0x122));var _0x748a=function(_0x34ce79,_0x418548){_0x34ce79=_0x34ce79-0x0;var _0xbb5f98=_0x48a7[_0x34ce79];return _0xbb5f98;};'use strict';var multer=require(_0x748a('0x0'));var util=require(_0x748a('0x1'));var path=require('path');var timeout=require(_0x748a('0x2'));var express=require(_0x748a('0x3'));var router=express[_0x748a('0x4')]();var fs_extra=require(_0x748a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x748a('0x6'));var config=require('../../config/environment');var controller=require(_0x748a('0x7'));router[_0x748a('0x8')]('/',auth[_0x748a('0x9')](),controller['index']);router['get']('/describe',auth[_0x748a('0x9')](),controller[_0x748a('0xa')]);router['get']('/users',auth['isAuthenticated'](),controller[_0x748a('0xb')]);router[_0x748a('0x8')](_0x748a('0xc'),auth[_0x748a('0x9')](),controller[_0x748a('0xd')]);router['post']('/',auth[_0x748a('0x9')](),controller[_0x748a('0xe')]);router[_0x748a('0xf')](_0x748a('0xc'),controller[_0x748a('0x10')]);router[_0x748a('0x11')]('/:id',auth[_0x748a('0x9')](),controller[_0x748a('0x12')]);module[_0x748a('0x13')]=router; \ No newline at end of file +var _0x698c=['get','index','/describe','describe','getUsers','/:id','post','create','put','update','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x698c,0xee));var _0xc698=function(_0x26056a,_0x1f39c8){_0x26056a=_0x26056a-0x0;var _0x47b881=_0x698c[_0x26056a];return _0x47b881;};'use strict';var multer=require('multer');var util=require(_0xc698('0x0'));var path=require(_0xc698('0x1'));var timeout=require(_0xc698('0x2'));var express=require(_0xc698('0x3'));var router=express[_0xc698('0x4')]();var fs_extra=require(_0xc698('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc698('0x6'));var config=require(_0xc698('0x7'));var controller=require(_0xc698('0x8'));router[_0xc698('0x9')]('/',auth['isAuthenticated'](),controller[_0xc698('0xa')]);router['get'](_0xc698('0xb'),auth['isAuthenticated'](),controller[_0xc698('0xc')]);router[_0xc698('0x9')]('/users',auth['isAuthenticated'](),controller[_0xc698('0xd')]);router['get'](_0xc698('0xe'),auth['isAuthenticated'](),controller['show']);router[_0xc698('0xf')]('/',auth['isAuthenticated'](),controller[_0xc698('0x10')]);router[_0xc698('0x11')]('/:id',controller[_0xc698('0x12')]);router['delete'](_0xc698('0xe'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 0605180..c53cb8d 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 _0x6146=['BOOLEAN','ENUM','out','STRING','sequelize','TEXT','medium'];(function(_0x12fe86,_0x57ec8d){var _0x3c528b=function(_0x497daf){while(--_0x497daf){_0x12fe86['push'](_0x12fe86['shift']());}};_0x3c528b(++_0x57ec8d);}(_0x6146,0xba));var _0x6614=function(_0x233089,_0x515540){_0x233089=_0x233089-0x0;var _0x5f512c=_0x6146[_0x233089];return _0x5f512c;};'use strict';var Sequelize=require(_0x6614('0x0'));module['exports']={'body':{'type':Sequelize[_0x6614('0x1')](_0x6614('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x6614('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x6614('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x6614('0x4')]('in',_0x6614('0x5')),'defaultValue':_0x6614('0x5'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x6614('0x6')]},'providerResponse':{'type':Sequelize[_0x6614('0x1')]}}; \ No newline at end of file +var _0x79e2=['out','DATE','STRING','sequelize','TEXT','medium','BOOLEAN','ENUM'];(function(_0x37e8e8,_0x1be63e){var _0x2c3c9e=function(_0x4e3a54){while(--_0x4e3a54){_0x37e8e8['push'](_0x37e8e8['shift']());}};_0x2c3c9e(++_0x1be63e);}(_0x79e2,0x1c3));var _0x279e=function(_0x5d869e,_0x1731bd){_0x5d869e=_0x5d869e-0x0;var _0x13a90b=_0x79e2[_0x5d869e];return _0x13a90b;};'use strict';var Sequelize=require(_0x279e('0x0'));module['exports']={'body':{'type':Sequelize[_0x279e('0x1')](_0x279e('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x279e('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x279e('0x4')]('in','out'),'defaultValue':_0x279e('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x279e('0x6')]},'providerName':{'type':Sequelize[_0x279e('0x7')]},'providerResponse':{'type':Sequelize[_0x279e('0x1')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index e268fdd..b4b268e 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 _0x702b=['params','describe','chat-interactions','accept','chat','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','ChatInteraction','isNil','read1stAt','user','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','ChatInteractionId','interaction','info','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','destroy','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','ChatMessage','includeAll','include','findAll','rows','show','keys','length','create','body','update','find'];(function(_0xa79977,_0x4f7f12){var _0x109f10=function(_0x56780f){while(--_0x56780f){_0xa79977['push'](_0xa79977['shift']());}};_0x109f10(++_0x4f7f12);}(_0x702b,0x135));var _0xb702=function(_0x2fba30,_0x1bedef){_0x2fba30=_0x2fba30-0x0;var _0x14c638=_0x702b[_0x2fba30];return _0x14c638;};'use strict';var emlformat=require(_0xb702('0x0'));var rimraf=require(_0xb702('0x1'));var zipdir=require(_0xb702('0x2'));var jsonpatch=require(_0xb702('0x3'));var rp=require(_0xb702('0x4'));var moment=require(_0xb702('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb702('0x6'));var util=require('util');var path=require(_0xb702('0x7'));var sox=require(_0xb702('0x8'));var csv=require(_0xb702('0x9'));var ejs=require(_0xb702('0xa'));var fs=require('fs');var fs_extra=require(_0xb702('0xb'));var _=require(_0xb702('0xc'));var squel=require(_0xb702('0xd'));var crypto=require(_0xb702('0xe'));var jsforce=require(_0xb702('0xf'));var deskjs=require(_0xb702('0x10'));var toCsv=require(_0xb702('0x9'));var querystring=require('querystring');var Papa=require(_0xb702('0x11'));var Redis=require(_0xb702('0x12'));var authService=require(_0xb702('0x13'));var qs=require(_0xb702('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb702('0x15'));var logger=require(_0xb702('0x16'))(_0xb702('0x17'));var utils=require('../../config/utils');var config=require(_0xb702('0x18'));var licenseUtil=require(_0xb702('0x19'));var db=require(_0xb702('0x1a'))['db'];config['redis']=_[_0xb702('0x1b')](config[_0xb702('0x1c')],{'host':_0xb702('0x1d'),'port':0x18eb});var socket=require(_0xb702('0x1e'))(new Redis(config[_0xb702('0x1c')]));require(_0xb702('0x1f'))[_0xb702('0x20')](socket);var jayson=require(_0xb702('0x21'));var client=jayson[_0xb702('0x22')][_0xb702('0x23')]({'port':0x232c});var client9002=jayson[_0xb702('0x22')]['http']({'port':0x232a});function respondWithRpcPromise(_0x48e416,_0x5dc96d,_0x2a085b,_0x3330c3){return new BPromise(function(_0x5a0ffa,_0x573908){var _0x3e024d=_0x3330c3||client;return _0x3e024d[_0xb702('0x24')](_0x48e416,_0x2a085b)[_0xb702('0x25')](function(_0x181477){logger['info'](_0xb702('0x26'),_0x5dc96d,_0xb702('0x27'));logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x5dc96d,'request\x20sent',JSON[_0xb702('0x28')](_0x181477));if(_0x181477[_0xb702('0x29')]){if(_0x181477['error'][_0xb702('0x2a')]===0x1f4){logger[_0xb702('0x29')]('ChatMessage,\x20%s,\x20%s',_0x5dc96d,_0x181477[_0xb702('0x29')][_0xb702('0x2b')]);return _0x573908(_0x181477[_0xb702('0x29')][_0xb702('0x2b')]);}logger[_0xb702('0x29')](_0xb702('0x26'),_0x5dc96d,_0x181477[_0xb702('0x29')][_0xb702('0x2b')]);return _0x5a0ffa(_0x181477['error'][_0xb702('0x2b')]);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x5dc96d,_0xb702('0x27'));_0x5a0ffa(_0x181477[_0xb702('0x2c')][_0xb702('0x2b')]);}})[_0xb702('0x2d')](function(_0x35421e){logger[_0xb702('0x29')]('ChatMessage,\x20%s,\x20%s',_0x5dc96d,_0x35421e);_0x573908(_0x35421e);});});}function respondWithStatusCode(_0x427b19,_0x142cee){_0x142cee=_0x142cee||0xcc;return function(_0x16c133){if(_0x16c133){return _0x427b19[_0xb702('0x2e')](_0x142cee);}return _0x427b19['status'](_0x142cee)[_0xb702('0x2f')]();};}function respondWithResult(_0x1cecba,_0x4d77d5){_0x4d77d5=_0x4d77d5||0xc8;return function(_0x4d4111){if(_0x4d4111){return _0x1cecba[_0xb702('0x30')](_0x4d77d5)[_0xb702('0x31')](_0x4d4111);}};}function respondWithFilteredResult(_0x476ffa,_0x5419b2){return function(_0x17ae19){if(_0x17ae19){var _0x183b1a=typeof _0x5419b2[_0xb702('0x32')]===_0xb702('0x33')&&typeof _0x5419b2[_0xb702('0x34')]===_0xb702('0x33');var _0x535c57=_0x17ae19[_0xb702('0x35')];var _0x448927=_0x183b1a?0x0:_0x5419b2[_0xb702('0x32')];var _0x5d38ae=_0x183b1a?_0x17ae19[_0xb702('0x35')]:_0x5419b2[_0xb702('0x32')]+_0x5419b2['limit'];var _0x2d837f;if(_0x5d38ae>=_0x535c57){_0x5d38ae=_0x535c57;_0x2d837f=0xc8;}else{_0x2d837f=0xce;}_0x476ffa[_0xb702('0x30')](_0x2d837f);return _0x476ffa[_0xb702('0x36')](_0xb702('0x37'),_0x448927+'-'+_0x5d38ae+'/'+_0x535c57)[_0xb702('0x31')](_0x17ae19);}return null;};}function patchUpdates(_0x5c33be){return function(_0x16a83e){try{jsonpatch['apply'](_0x16a83e,_0x5c33be,!![]);}catch(_0xec6a08){return BPromise[_0xb702('0x38')](_0xec6a08);}return _0x16a83e['save']();};}function saveUpdates(_0x17c74b,_0xc20784){return function(_0x5c555c){if(_0x5c555c){return _0x5c555c['update'](_0x17c74b)[_0xb702('0x25')](function(_0x14a21b){return _0x14a21b;});}return null;};}function removeEntity(_0x2d2121,_0x2c3dc3){return function(_0x3a8928){if(_0x3a8928){return _0x3a8928[_0xb702('0x39')]()[_0xb702('0x25')](function(){_0x2d2121[_0xb702('0x30')](0xcc)[_0xb702('0x2f')]();});}};}function handleEntityNotFound(_0x42682b,_0x1039d7){return function(_0x37b491){if(!_0x37b491){_0x42682b[_0xb702('0x2e')](0x194);}return _0x37b491;};}function handleError(_0x2d4d1c,_0x6eb03){_0x6eb03=_0x6eb03||0x1f4;return function(_0x50abe7){logger[_0xb702('0x29')](_0x50abe7[_0xb702('0x3a')]);if(_0x50abe7[_0xb702('0x3b')]){delete _0x50abe7['name'];}_0x2d4d1c['status'](_0x6eb03)[_0xb702('0x3c')](_0x50abe7);};}exports[_0xb702('0x3d')]=function(_0x54076d,_0x4e37bc){var _0x46cb5e={},_0x13ff3a={},_0x13f62c={'count':0x0,'rows':[]};var _0x37c362=_[_0xb702('0x3e')](db['ChatMessage'][_0xb702('0x3f')],function(_0x58539e){return{'name':_0x58539e[_0xb702('0x40')],'type':_0x58539e['type'][_0xb702('0x41')]};});_0x13ff3a[_0xb702('0x42')]=_[_0xb702('0x3e')](_0x37c362,'name');_0x13ff3a[_0xb702('0x43')]=_['keys'](_0x54076d[_0xb702('0x43')]);_0x13ff3a[_0xb702('0x44')]=_[_0xb702('0x45')](_0x13ff3a['model'],_0x13ff3a['query']);_0x46cb5e[_0xb702('0x46')]=_['intersection'](_0x13ff3a[_0xb702('0x42')],qs[_0xb702('0x47')](_0x54076d[_0xb702('0x43')]['fields']));_0x46cb5e['attributes']=_0x46cb5e[_0xb702('0x46')]['length']?_0x46cb5e[_0xb702('0x46')]:_0x13ff3a[_0xb702('0x42')];if(!_0x54076d[_0xb702('0x43')][_0xb702('0x48')](_0xb702('0x49'))){_0x46cb5e[_0xb702('0x34')]=qs['limit'](_0x54076d['query']['limit']);_0x46cb5e['offset']=qs[_0xb702('0x32')](_0x54076d['query'][_0xb702('0x32')]);}_0x46cb5e[_0xb702('0x4a')]=qs[_0xb702('0x4b')](_0x54076d[_0xb702('0x43')][_0xb702('0x4b')]);_0x46cb5e[_0xb702('0x4c')]=qs[_0xb702('0x44')](_[_0xb702('0x4d')](_0x54076d['query'],_0x13ff3a['filters']),_0x37c362);if(_0x54076d[_0xb702('0x43')]['filter']){_0x46cb5e[_0xb702('0x4c')]=_[_0xb702('0x4e')](_0x46cb5e[_0xb702('0x4c')],{'$or':_[_0xb702('0x3e')](_0x37c362,function(_0x358e80){if(_0x358e80['type']!=='VIRTUAL'){var _0x1984c1={};_0x1984c1[_0x358e80[_0xb702('0x3b')]]={'$like':'%'+_0x54076d[_0xb702('0x43')][_0xb702('0x4f')]+'%'};return _0x1984c1;}})});}_0x46cb5e=_[_0xb702('0x4e')]({},_0x46cb5e,_0x54076d[_0xb702('0x50')]);var _0x4a6f8b={'where':_0x46cb5e['where']};return db[_0xb702('0x51')][_0xb702('0x35')](_0x4a6f8b)[_0xb702('0x25')](function(_0x4d89e0){_0x13f62c['count']=_0x4d89e0;if(_0x54076d['query'][_0xb702('0x52')]){_0x46cb5e[_0xb702('0x53')]=[{'all':!![]}];}return db[_0xb702('0x51')][_0xb702('0x54')](_0x46cb5e);})[_0xb702('0x25')](function(_0x1bcffd){_0x13f62c[_0xb702('0x55')]=_0x1bcffd;return _0x13f62c;})['then'](respondWithFilteredResult(_0x4e37bc,_0x46cb5e))['catch'](handleError(_0x4e37bc,null));};exports[_0xb702('0x56')]=function(_0x520a2b,_0x1762ea){var _0x38e2ed={'raw':!![],'where':{'id':_0x520a2b['params']['id']}},_0x215060={};_0x215060[_0xb702('0x42')]=_['keys'](db[_0xb702('0x51')][_0xb702('0x3f')]);_0x215060[_0xb702('0x43')]=_[_0xb702('0x57')](_0x520a2b['query']);_0x215060[_0xb702('0x44')]=_[_0xb702('0x45')](_0x215060[_0xb702('0x42')],_0x215060[_0xb702('0x43')]);_0x38e2ed[_0xb702('0x46')]=_[_0xb702('0x45')](_0x215060['model'],qs[_0xb702('0x47')](_0x520a2b[_0xb702('0x43')][_0xb702('0x47')]));_0x38e2ed[_0xb702('0x46')]=_0x38e2ed[_0xb702('0x46')][_0xb702('0x58')]?_0x38e2ed[_0xb702('0x46')]:_0x215060[_0xb702('0x42')];if(_0x520a2b[_0xb702('0x43')][_0xb702('0x52')]){_0x38e2ed[_0xb702('0x53')]=[{'all':!![]}];}_0x38e2ed=_[_0xb702('0x4e')]({},_0x38e2ed,_0x520a2b[_0xb702('0x50')]);return db['ChatMessage']['find'](_0x38e2ed)[_0xb702('0x25')](handleEntityNotFound(_0x1762ea,null))['then'](respondWithResult(_0x1762ea,null))['catch'](handleError(_0x1762ea,null));};exports['create']=function(_0x45477c,_0x271e5f){return db[_0xb702('0x51')][_0xb702('0x59')](_0x45477c[_0xb702('0x5a')],{})[_0xb702('0x25')](respondWithResult(_0x271e5f,0xc9))[_0xb702('0x2d')](handleError(_0x271e5f,null));};exports[_0xb702('0x5b')]=function(_0x20b605,_0xe29d5){if(_0x20b605[_0xb702('0x5a')]['id']){delete _0x20b605[_0xb702('0x5a')]['id'];}return db[_0xb702('0x51')][_0xb702('0x5c')]({'where':{'id':_0x20b605[_0xb702('0x5d')]['id']}})[_0xb702('0x25')](handleEntityNotFound(_0xe29d5,null))['then'](saveUpdates(_0x20b605['body'],null))[_0xb702('0x25')](respondWithResult(_0xe29d5,null))[_0xb702('0x2d')](handleError(_0xe29d5,null));};exports['destroy']=function(_0xde9b86,_0x1866a0){return db['ChatMessage'][_0xb702('0x5c')]({'where':{'id':_0xde9b86[_0xb702('0x5d')]['id']}})[_0xb702('0x25')](handleEntityNotFound(_0x1866a0,null))['then'](removeEntity(_0x1866a0,null))['catch'](handleError(_0x1866a0,null));};exports[_0xb702('0x5e')]=function(_0x3dcc5b,_0x4bc0f3){return db[_0xb702('0x51')][_0xb702('0x5e')]()[_0xb702('0x25')](respondWithResult(_0x4bc0f3,null))[_0xb702('0x2d')](handleError(_0x4bc0f3,null));};var interaction_log=require('../../config/logger')(_0xb702('0x5f'));exports[_0xb702('0x60')]=function(_0x4a047e,_0x569576,_0x213e45){var _0x12305a={'agent':{},'channel':_0xb702('0x61')};if(_0x4a047e[_0xb702('0x5a')]['id']){delete _0x4a047e[_0xb702('0x5a')]['id'];}_0x4a047e['body'][_0xb702('0x62')]=!![];_0x4a047e[_0xb702('0x5a')]['readAt']=moment()[_0xb702('0x63')](_0xb702('0x64'));_0x4a047e[_0xb702('0x5a')][_0xb702('0x65')]=_0x4a047e[_0xb702('0x5a')]['UserId']||_0x4a047e['user']['id'];_0x12305a[_0xb702('0x66')]['id']=_0x4a047e[_0xb702('0x5a')][_0xb702('0x65')];return db[_0xb702('0x51')][_0xb702('0x5c')]({'where':{'id':_0x4a047e['params']['id'],'UserId':null}})[_0xb702('0x25')](handleEntityNotFound(_0x569576,null))[_0xb702('0x25')](saveUpdates(_0x4a047e[_0xb702('0x5a')],null))[_0xb702('0x25')](function(_0x3c6fc){if(_0x3c6fc){_0x12305a['message']=_0x3c6fc[_0xb702('0x67')]({'plain':!![]});return db[_0xb702('0x68')]['find']({'where':{'id':_0x3c6fc['ChatInteractionId']}});}return null;})[_0xb702('0x25')](handleEntityNotFound(_0x569576,null))[_0xb702('0x25')](function(_0x2c31a5){if(_0x2c31a5){return _0x2c31a5['update']({'UserId':_0x4a047e[_0xb702('0x5a')][_0xb702('0x65')],'read1stAt':_[_0xb702('0x69')](_0x2c31a5[_0xb702('0x6a')])?moment()[_0xb702('0x63')](_0xb702('0x64')):undefined});}return null;})[_0xb702('0x25')](function(_0x2a2de3){if(_0x2a2de3){_0x12305a['interaction']=_0x2a2de3['get']({'plain':!![]});interaction_log['info']('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4a047e['user']['id'],_0x4a047e[_0xb702('0x6b')][_0xb702('0x3b')],_0x4a047e['user'][_0xb702('0x6c')],_0x12305a['interaction']['id'],_0x4a047e[_0xb702('0x5a')]?JSON['stringify'](_0x4a047e[_0xb702('0x5a')]):_0xb702('0x6d'));return respondWithRpcPromise(_0xb702('0x6e'),_0xb702('0x6f'),_0x12305a);}return null;})[_0xb702('0x25')](function(_0x2ae9e2){var _0x36a607=_0xb702('0x70')+_0x2ae9e2[_0xb702('0x2b')][_0xb702('0x71')];return db[_0xb702('0x72')][_0xb702('0x43')](_0x36a607,{'type':db[_0xb702('0x73')][_0xb702('0x74')][_0xb702('0x75')],'raw':!![]})[_0xb702('0x25')](function(_0x2cf1f0){return _0x2cf1f0;});})['then'](function(_0x33290d){if(_0x33290d){_0x12305a[_0xb702('0x2b')]['contact']=_0x33290d[0x0];if(!_0x4a047e[_0xb702('0x5a')][_0xb702('0x65')])return;return db[_0xb702('0x76')][_0xb702('0x5c')]({'where':{'id':_0x4a047e[_0xb702('0x5a')][_0xb702('0x65')],'role':_0xb702('0x66')},'attributes':['id',_0xb702('0x3b'),'fullname',_0xb702('0x77'),_0xb702('0x78')],'raw':!![]});}return null;})['then'](function(_0x3fecc7){if(!_0x3fecc7)return null;_0x12305a[_0xb702('0x2b')][_0xb702('0x66')]=_0x3fecc7;return _0x12305a;})[_0xb702('0x25')](function(_0x3761c7){if(_0x3761c7){if(_0x4a047e[_0xb702('0x5a')][_0xb702('0x79')]){_0x12305a[_0xb702('0x2b')][_0xb702('0x7a')]=util[_0xb702('0x63')](_0xb702('0x7b'),_0x4a047e[_0xb702('0x6b')][_0xb702('0x3b')]);_0x12305a['message'][_0xb702('0x7c')]=_0x12305a[_0xb702('0x7c')];_0x12305a['message'][_0xb702('0x7d')]=_0x12305a[_0xb702('0x7c')];_0x12305a[_0xb702('0x2b')][_0xb702('0x7e')]=_0xb702('0x60');return respondWithRpcPromise(_0xb702('0x7f'),_0xb702('0x7f'),{'event':_0xb702('0x80'),'message':_[_0xb702('0x4e')](_0x12305a['message'],JSON[_0xb702('0x81')](_0x12305a['interaction']['formData']))},client9002)[_0xb702('0x25')](function(){return _0x12305a;});}return _0x12305a;}return null;})[_0xb702('0x25')](respondWithResult(_0x569576,null))['catch'](handleError(_0x569576,null));};var interaction_log=require(_0xb702('0x16'))(_0xb702('0x5f'));exports[_0xb702('0x38')]=function(_0x59a0b0,_0x4efe72,_0x1efea8){var _0x23e797={'agent':{},'channel':_0xb702('0x61')};if(_0x59a0b0[_0xb702('0x5a')]['id']){delete _0x59a0b0[_0xb702('0x5a')]['id'];}_0x59a0b0[_0xb702('0x5a')][_0xb702('0x65')]=_0x59a0b0[_0xb702('0x5a')]['UserId']||_0x59a0b0[_0xb702('0x6b')]['id'];_0x23e797[_0xb702('0x66')]['id']=_0x59a0b0[_0xb702('0x5a')][_0xb702('0x65')];return db[_0xb702('0x51')][_0xb702('0x5c')]({'where':{'id':_0x59a0b0[_0xb702('0x5d')]['id'],'UserId':null}})[_0xb702('0x25')](handleEntityNotFound(_0x4efe72,null))[_0xb702('0x25')](function(_0x23c44c){if(_0x23c44c){_0x23e797[_0xb702('0x2b')]=_0x23c44c[_0xb702('0x67')]({'plain':!![]});return db[_0xb702('0x68')][_0xb702('0x5c')]({'where':{'id':_0x23c44c[_0xb702('0x82')]}});}return null;})[_0xb702('0x25')](handleEntityNotFound(_0x4efe72,null))[_0xb702('0x25')](function(_0x38b0dc){if(_0x38b0dc){_0x23e797[_0xb702('0x83')]=_0x38b0dc[_0xb702('0x67')]({'plain':!![]});interaction_log[_0xb702('0x84')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x59a0b0[_0xb702('0x6b')]['id'],_0x59a0b0['user'][_0xb702('0x3b')],_0x59a0b0[_0xb702('0x6b')][_0xb702('0x6c')],_0x23e797[_0xb702('0x83')]['id'],_0x59a0b0[_0xb702('0x5a')]?JSON['stringify'](_0x59a0b0[_0xb702('0x5a')]):'null');return respondWithRpcPromise('RejectMessage','rejectMessage',_0x23e797);}return null;})[_0xb702('0x25')](function(_0x111feb){var _0x222bc6=_0xb702('0x70')+_0x111feb[_0xb702('0x2b')]['ContactId'];return db[_0xb702('0x72')]['query'](_0x222bc6,{'type':db['Sequelize'][_0xb702('0x74')][_0xb702('0x75')],'raw':!![]})[_0xb702('0x25')](function(_0x41a4a2){return _0x41a4a2;});})[_0xb702('0x25')](function(_0x141cac){if(_0x141cac){_0x23e797['message']['contact']=_0x141cac[0x0];if(!_0x59a0b0[_0xb702('0x5a')][_0xb702('0x65')])return;return db['User']['find']({'where':{'id':_0x59a0b0['body']['UserId'],'role':_0xb702('0x66')},'attributes':['id',_0xb702('0x3b'),'fullname',_0xb702('0x77'),_0xb702('0x78')],'raw':!![]});}return null;})['then'](function(_0x3aa4cb){if(!_0x3aa4cb)return null;_0x23e797[_0xb702('0x2b')][_0xb702('0x66')]=_0x3aa4cb;return _0x23e797;})[_0xb702('0x25')](function(_0x25700f){if(_0x25700f){_0x25700f['message'][_0xb702('0x7a')]=util[_0xb702('0x63')](_0xb702('0x7b'),_0x59a0b0[_0xb702('0x6b')]['name']);_0x25700f[_0xb702('0x2b')][_0xb702('0x7c')]=_0x23e797[_0xb702('0x7c')];_0x25700f[_0xb702('0x2b')][_0xb702('0x7d')]=_0x23e797[_0xb702('0x7c')];_0x25700f[_0xb702('0x2b')][_0xb702('0x7e')]='reject';respondWithRpcPromise(_0xb702('0x7f'),_0xb702('0x7f'),{'event':_0xb702('0x85'),'message':_['merge'](_0x23e797[_0xb702('0x2b')],JSON[_0xb702('0x81')](_0x23e797[_0xb702('0x83')]['formData']))},client9002);return _0x23e797;}return null;})[_0xb702('0x25')](respondWithResult(_0x4efe72,null))[_0xb702('0x2d')](handleError(_0x4efe72,null));}; \ No newline at end of file +var _0xcc82=['rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','filter','where','merge','VIRTUAL','includeAll','include','ChatMessage','findAll','show','params','keys','options','find','create','body','destroy','describe','chat-interactions','read','readAt','format','UserId','user','agent','get','ChatInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','SELECT','User','fullname','email','internal','manual','interface','channel','motionChannel','event','accept','EventManager','parse','formData','chat','ChatInteraction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','Sequelize','contact','SIP/%s','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','sendStatus','end','status','undefined','offset','count','set','Content-Range','apply','reject','save','update','name','send','map'];(function(_0x5ca355,_0x43c86d){var _0x436c64=function(_0x1663da){while(--_0x1663da){_0x5ca355['push'](_0x5ca355['shift']());}};_0x436c64(++_0x43c86d);}(_0xcc82,0x1da));var _0x2cc8=function(_0x4f8d61,_0x29eff0){_0x4f8d61=_0x4f8d61-0x0;var _0x3bc078=_0xcc82[_0x4f8d61];return _0x3bc078;};'use strict';var emlformat=require(_0x2cc8('0x0'));var rimraf=require(_0x2cc8('0x1'));var zipdir=require(_0x2cc8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2cc8('0x3'));var moment=require(_0x2cc8('0x4'));var BPromise=require(_0x2cc8('0x5'));var Mustache=require('mustache');var util=require(_0x2cc8('0x6'));var path=require(_0x2cc8('0x7'));var sox=require(_0x2cc8('0x8'));var csv=require('to-csv');var ejs=require(_0x2cc8('0x9'));var fs=require('fs');var fs_extra=require(_0x2cc8('0xa'));var _=require(_0x2cc8('0xb'));var squel=require(_0x2cc8('0xc'));var crypto=require('crypto');var jsforce=require(_0x2cc8('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2cc8('0xe'));var querystring=require(_0x2cc8('0xf'));var Papa=require(_0x2cc8('0x10'));var Redis=require(_0x2cc8('0x11'));var authService=require(_0x2cc8('0x12'));var qs=require(_0x2cc8('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2cc8('0x14'))(_0x2cc8('0x15'));var utils=require(_0x2cc8('0x16'));var config=require(_0x2cc8('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x2cc8('0x18')]=_[_0x2cc8('0x19')](config[_0x2cc8('0x18')],{'host':_0x2cc8('0x1a'),'port':0x18eb});var socket=require(_0x2cc8('0x1b'))(new Redis(config[_0x2cc8('0x18')]));require('./chatMessage.socket')['register'](socket);var jayson=require(_0x2cc8('0x1c'));var client=jayson[_0x2cc8('0x1d')][_0x2cc8('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0x2cc8('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x10ec7a,_0x227046,_0x152040,_0x5ea4f0){return new BPromise(function(_0x16f138,_0x2db51e){var _0x4a84cf=_0x5ea4f0||client;return _0x4a84cf[_0x2cc8('0x1f')](_0x10ec7a,_0x152040)[_0x2cc8('0x20')](function(_0x3e16b5){logger[_0x2cc8('0x21')](_0x2cc8('0x22'),_0x227046,'request\x20sent');logger[_0x2cc8('0x23')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x227046,'request\x20sent',JSON[_0x2cc8('0x24')](_0x3e16b5));if(_0x3e16b5[_0x2cc8('0x25')]){if(_0x3e16b5['error'][_0x2cc8('0x26')]===0x1f4){logger['error']('ChatMessage,\x20%s,\x20%s',_0x227046,_0x3e16b5[_0x2cc8('0x25')][_0x2cc8('0x27')]);return _0x2db51e(_0x3e16b5[_0x2cc8('0x25')]['message']);}logger['error'](_0x2cc8('0x22'),_0x227046,_0x3e16b5[_0x2cc8('0x25')][_0x2cc8('0x27')]);return _0x16f138(_0x3e16b5[_0x2cc8('0x25')]['message']);}else{logger[_0x2cc8('0x21')](_0x2cc8('0x22'),_0x227046,_0x2cc8('0x28'));_0x16f138(_0x3e16b5[_0x2cc8('0x29')][_0x2cc8('0x27')]);}})[_0x2cc8('0x2a')](function(_0x36a334){logger['error']('ChatMessage,\x20%s,\x20%s',_0x227046,_0x36a334);_0x2db51e(_0x36a334);});});}function respondWithStatusCode(_0x2d4777,_0x7e6c26){_0x7e6c26=_0x7e6c26||0xcc;return function(_0x46db32){if(_0x46db32){return _0x2d4777[_0x2cc8('0x2b')](_0x7e6c26);}return _0x2d4777['status'](_0x7e6c26)[_0x2cc8('0x2c')]();};}function respondWithResult(_0x4b52bc,_0xcd7948){_0xcd7948=_0xcd7948||0xc8;return function(_0x521d27){if(_0x521d27){return _0x4b52bc[_0x2cc8('0x2d')](_0xcd7948)['json'](_0x521d27);}};}function respondWithFilteredResult(_0x595992,_0x540998){return function(_0x48298c){if(_0x48298c){var _0x22bdbc=typeof _0x540998['offset']===_0x2cc8('0x2e')&&typeof _0x540998['limit']===_0x2cc8('0x2e');var _0x3670dc=_0x48298c['count'];var _0x2d4aca=_0x22bdbc?0x0:_0x540998[_0x2cc8('0x2f')];var _0x1565d1=_0x22bdbc?_0x48298c[_0x2cc8('0x30')]:_0x540998[_0x2cc8('0x2f')]+_0x540998['limit'];var _0x5b4f6f;if(_0x1565d1>=_0x3670dc){_0x1565d1=_0x3670dc;_0x5b4f6f=0xc8;}else{_0x5b4f6f=0xce;}_0x595992[_0x2cc8('0x2d')](_0x5b4f6f);return _0x595992[_0x2cc8('0x31')](_0x2cc8('0x32'),_0x2d4aca+'-'+_0x1565d1+'/'+_0x3670dc)['json'](_0x48298c);}return null;};}function patchUpdates(_0x3cf197){return function(_0x4b5e72){try{jsonpatch[_0x2cc8('0x33')](_0x4b5e72,_0x3cf197,!![]);}catch(_0x434a4f){return BPromise[_0x2cc8('0x34')](_0x434a4f);}return _0x4b5e72[_0x2cc8('0x35')]();};}function saveUpdates(_0x1624b0,_0x5520ad){return function(_0xe57ece){if(_0xe57ece){return _0xe57ece[_0x2cc8('0x36')](_0x1624b0)[_0x2cc8('0x20')](function(_0xc6b690){return _0xc6b690;});}return null;};}function removeEntity(_0x11eebd,_0x593969){return function(_0x2d0248){if(_0x2d0248){return _0x2d0248['destroy']()[_0x2cc8('0x20')](function(){_0x11eebd[_0x2cc8('0x2d')](0xcc)[_0x2cc8('0x2c')]();});}};}function handleEntityNotFound(_0xb730de,_0x143b79){return function(_0x5a863e){if(!_0x5a863e){_0xb730de[_0x2cc8('0x2b')](0x194);}return _0x5a863e;};}function handleError(_0x104938,_0x497b7f){_0x497b7f=_0x497b7f||0x1f4;return function(_0x176a09){logger[_0x2cc8('0x25')](_0x176a09['stack']);if(_0x176a09[_0x2cc8('0x37')]){delete _0x176a09[_0x2cc8('0x37')];}_0x104938[_0x2cc8('0x2d')](_0x497b7f)[_0x2cc8('0x38')](_0x176a09);};}exports['index']=function(_0x4f3a18,_0x5533b0){var _0x5b0f8d={},_0x2fc484={},_0x27dcca={'count':0x0,'rows':[]};var _0x13eebf=_[_0x2cc8('0x39')](db['ChatMessage'][_0x2cc8('0x3a')],function(_0x3f0d49){return{'name':_0x3f0d49['fieldName'],'type':_0x3f0d49[_0x2cc8('0x3b')][_0x2cc8('0x3c')]};});_0x2fc484[_0x2cc8('0x3d')]=_[_0x2cc8('0x39')](_0x13eebf,_0x2cc8('0x37'));_0x2fc484['query']=_['keys'](_0x4f3a18[_0x2cc8('0x3e')]);_0x2fc484[_0x2cc8('0x3f')]=_[_0x2cc8('0x40')](_0x2fc484[_0x2cc8('0x3d')],_0x2fc484[_0x2cc8('0x3e')]);_0x5b0f8d[_0x2cc8('0x41')]=_['intersection'](_0x2fc484[_0x2cc8('0x3d')],qs['fields'](_0x4f3a18[_0x2cc8('0x3e')][_0x2cc8('0x42')]));_0x5b0f8d['attributes']=_0x5b0f8d[_0x2cc8('0x41')][_0x2cc8('0x43')]?_0x5b0f8d[_0x2cc8('0x41')]:_0x2fc484['model'];if(!_0x4f3a18[_0x2cc8('0x3e')][_0x2cc8('0x44')](_0x2cc8('0x45'))){_0x5b0f8d[_0x2cc8('0x46')]=qs['limit'](_0x4f3a18[_0x2cc8('0x3e')][_0x2cc8('0x46')]);_0x5b0f8d[_0x2cc8('0x2f')]=qs[_0x2cc8('0x2f')](_0x4f3a18[_0x2cc8('0x3e')][_0x2cc8('0x2f')]);}_0x5b0f8d[_0x2cc8('0x47')]=qs['sort'](_0x4f3a18[_0x2cc8('0x3e')][_0x2cc8('0x48')]);_0x5b0f8d['where']=qs['filters'](_['pick'](_0x4f3a18[_0x2cc8('0x3e')],_0x2fc484[_0x2cc8('0x3f')]),_0x13eebf);if(_0x4f3a18[_0x2cc8('0x3e')][_0x2cc8('0x49')]){_0x5b0f8d[_0x2cc8('0x4a')]=_[_0x2cc8('0x4b')](_0x5b0f8d['where'],{'$or':_['map'](_0x13eebf,function(_0x4769c2){if(_0x4769c2['type']!==_0x2cc8('0x4c')){var _0x39bb7c={};_0x39bb7c[_0x4769c2[_0x2cc8('0x37')]]={'$like':'%'+_0x4f3a18[_0x2cc8('0x3e')]['filter']+'%'};return _0x39bb7c;}})});}_0x5b0f8d=_[_0x2cc8('0x4b')]({},_0x5b0f8d,_0x4f3a18['options']);var _0x4bd239={'where':_0x5b0f8d['where']};return db['ChatMessage'][_0x2cc8('0x30')](_0x4bd239)[_0x2cc8('0x20')](function(_0x4810cf){_0x27dcca[_0x2cc8('0x30')]=_0x4810cf;if(_0x4f3a18[_0x2cc8('0x3e')][_0x2cc8('0x4d')]){_0x5b0f8d[_0x2cc8('0x4e')]=[{'all':!![]}];}return db[_0x2cc8('0x4f')][_0x2cc8('0x50')](_0x5b0f8d);})[_0x2cc8('0x20')](function(_0x3f038f){_0x27dcca['rows']=_0x3f038f;return _0x27dcca;})[_0x2cc8('0x20')](respondWithFilteredResult(_0x5533b0,_0x5b0f8d))[_0x2cc8('0x2a')](handleError(_0x5533b0,null));};exports[_0x2cc8('0x51')]=function(_0x419ad9,_0xd5d05a){var _0xcf75ea={'raw':!![],'where':{'id':_0x419ad9[_0x2cc8('0x52')]['id']}},_0x43697b={};_0x43697b['model']=_[_0x2cc8('0x53')](db[_0x2cc8('0x4f')][_0x2cc8('0x3a')]);_0x43697b['query']=_[_0x2cc8('0x53')](_0x419ad9[_0x2cc8('0x3e')]);_0x43697b['filters']=_[_0x2cc8('0x40')](_0x43697b[_0x2cc8('0x3d')],_0x43697b[_0x2cc8('0x3e')]);_0xcf75ea[_0x2cc8('0x41')]=_[_0x2cc8('0x40')](_0x43697b[_0x2cc8('0x3d')],qs[_0x2cc8('0x42')](_0x419ad9[_0x2cc8('0x3e')][_0x2cc8('0x42')]));_0xcf75ea[_0x2cc8('0x41')]=_0xcf75ea['attributes']['length']?_0xcf75ea[_0x2cc8('0x41')]:_0x43697b['model'];if(_0x419ad9[_0x2cc8('0x3e')][_0x2cc8('0x4d')]){_0xcf75ea[_0x2cc8('0x4e')]=[{'all':!![]}];}_0xcf75ea=_[_0x2cc8('0x4b')]({},_0xcf75ea,_0x419ad9[_0x2cc8('0x54')]);return db[_0x2cc8('0x4f')][_0x2cc8('0x55')](_0xcf75ea)[_0x2cc8('0x20')](handleEntityNotFound(_0xd5d05a,null))['then'](respondWithResult(_0xd5d05a,null))['catch'](handleError(_0xd5d05a,null));};exports[_0x2cc8('0x56')]=function(_0x358769,_0x4cf676){return db[_0x2cc8('0x4f')][_0x2cc8('0x56')](_0x358769[_0x2cc8('0x57')],{})[_0x2cc8('0x20')](respondWithResult(_0x4cf676,0xc9))[_0x2cc8('0x2a')](handleError(_0x4cf676,null));};exports[_0x2cc8('0x36')]=function(_0x30efec,_0x1a53bf){if(_0x30efec['body']['id']){delete _0x30efec[_0x2cc8('0x57')]['id'];}return db['ChatMessage'][_0x2cc8('0x55')]({'where':{'id':_0x30efec['params']['id']}})[_0x2cc8('0x20')](handleEntityNotFound(_0x1a53bf,null))[_0x2cc8('0x20')](saveUpdates(_0x30efec['body'],null))[_0x2cc8('0x20')](respondWithResult(_0x1a53bf,null))[_0x2cc8('0x2a')](handleError(_0x1a53bf,null));};exports[_0x2cc8('0x58')]=function(_0x561da0,_0x9a104b){return db['ChatMessage'][_0x2cc8('0x55')]({'where':{'id':_0x561da0[_0x2cc8('0x52')]['id']}})[_0x2cc8('0x20')](handleEntityNotFound(_0x9a104b,null))[_0x2cc8('0x20')](removeEntity(_0x9a104b,null))['catch'](handleError(_0x9a104b,null));};exports[_0x2cc8('0x59')]=function(_0x487e64,_0x18284f){return db['ChatMessage']['describe']()[_0x2cc8('0x20')](respondWithResult(_0x18284f,null))['catch'](handleError(_0x18284f,null));};var interaction_log=require(_0x2cc8('0x14'))(_0x2cc8('0x5a'));exports['accept']=function(_0x1b1581,_0x520c74,_0x5e3941){var _0x3be9f8={'agent':{},'channel':'chat'};if(_0x1b1581[_0x2cc8('0x57')]['id']){delete _0x1b1581[_0x2cc8('0x57')]['id'];}_0x1b1581['body'][_0x2cc8('0x5b')]=!![];_0x1b1581[_0x2cc8('0x57')][_0x2cc8('0x5c')]=moment()[_0x2cc8('0x5d')]('YYYY-MM-DD\x20HH:mm:ss');_0x1b1581['body'][_0x2cc8('0x5e')]=_0x1b1581[_0x2cc8('0x57')]['UserId']||_0x1b1581[_0x2cc8('0x5f')]['id'];_0x3be9f8[_0x2cc8('0x60')]['id']=_0x1b1581[_0x2cc8('0x57')][_0x2cc8('0x5e')];return db[_0x2cc8('0x4f')][_0x2cc8('0x55')]({'where':{'id':_0x1b1581['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x520c74,null))[_0x2cc8('0x20')](saveUpdates(_0x1b1581[_0x2cc8('0x57')],null))[_0x2cc8('0x20')](function(_0x5865ab){if(_0x5865ab){_0x3be9f8[_0x2cc8('0x27')]=_0x5865ab[_0x2cc8('0x61')]({'plain':!![]});return db['ChatInteraction'][_0x2cc8('0x55')]({'where':{'id':_0x5865ab[_0x2cc8('0x62')]}});}return null;})[_0x2cc8('0x20')](handleEntityNotFound(_0x520c74,null))['then'](function(_0x1bfafa){if(_0x1bfafa){return _0x1bfafa['update']({'UserId':_0x1b1581[_0x2cc8('0x57')][_0x2cc8('0x5e')],'read1stAt':_[_0x2cc8('0x63')](_0x1bfafa[_0x2cc8('0x64')])?moment()['format'](_0x2cc8('0x65')):undefined});}return null;})[_0x2cc8('0x20')](function(_0x63bd1f){if(_0x63bd1f){_0x3be9f8[_0x2cc8('0x66')]=_0x63bd1f[_0x2cc8('0x61')]({'plain':!![]});interaction_log[_0x2cc8('0x21')](_0x2cc8('0x67'),_0x1b1581[_0x2cc8('0x5f')]['id'],_0x1b1581[_0x2cc8('0x5f')][_0x2cc8('0x37')],_0x1b1581[_0x2cc8('0x5f')][_0x2cc8('0x68')],_0x3be9f8['interaction']['id'],_0x1b1581[_0x2cc8('0x57')]?JSON[_0x2cc8('0x24')](_0x1b1581['body']):_0x2cc8('0x69'));return respondWithRpcPromise(_0x2cc8('0x6a'),_0x2cc8('0x6b'),_0x3be9f8);}return null;})[_0x2cc8('0x20')](function(_0xac786){var _0x7b1867=_0x2cc8('0x6c')+_0xac786['message']['ContactId'];return db[_0x2cc8('0x6d')][_0x2cc8('0x3e')](_0x7b1867,{'type':db['Sequelize'][_0x2cc8('0x6e')][_0x2cc8('0x6f')],'raw':!![]})['then'](function(_0x5baf50){return _0x5baf50;});})[_0x2cc8('0x20')](function(_0x41f7b8){if(_0x41f7b8){_0x3be9f8[_0x2cc8('0x27')]['contact']=_0x41f7b8[0x0];if(!_0x1b1581[_0x2cc8('0x57')]['UserId'])return;return db[_0x2cc8('0x70')][_0x2cc8('0x55')]({'where':{'id':_0x1b1581[_0x2cc8('0x57')][_0x2cc8('0x5e')],'role':_0x2cc8('0x60')},'attributes':['id',_0x2cc8('0x37'),_0x2cc8('0x71'),_0x2cc8('0x72'),_0x2cc8('0x73')],'raw':!![]});}return null;})['then'](function(_0x9afb1a){if(!_0x9afb1a)return null;_0x3be9f8[_0x2cc8('0x27')]['agent']=_0x9afb1a;return _0x3be9f8;})[_0x2cc8('0x20')](function(_0x15a312){if(_0x15a312){if(_0x1b1581[_0x2cc8('0x57')][_0x2cc8('0x74')]){_0x3be9f8[_0x2cc8('0x27')][_0x2cc8('0x75')]=util['format']('SIP/%s',_0x1b1581[_0x2cc8('0x5f')]['name']);_0x3be9f8[_0x2cc8('0x27')][_0x2cc8('0x76')]=_0x3be9f8[_0x2cc8('0x76')];_0x3be9f8['message'][_0x2cc8('0x77')]=_0x3be9f8[_0x2cc8('0x76')];_0x3be9f8['message'][_0x2cc8('0x78')]=_0x2cc8('0x79');return respondWithRpcPromise(_0x2cc8('0x7a'),_0x2cc8('0x7a'),{'event':'acceptmessage','message':_[_0x2cc8('0x4b')](_0x3be9f8[_0x2cc8('0x27')],JSON[_0x2cc8('0x7b')](_0x3be9f8[_0x2cc8('0x66')][_0x2cc8('0x7c')]))},client9002)[_0x2cc8('0x20')](function(){return _0x3be9f8;});}return _0x3be9f8;}return null;})[_0x2cc8('0x20')](respondWithResult(_0x520c74,null))['catch'](handleError(_0x520c74,null));};var interaction_log=require(_0x2cc8('0x14'))('chat-interactions');exports[_0x2cc8('0x34')]=function(_0x57ae11,_0xf599e5,_0x18b0e1){var _0x329cc2={'agent':{},'channel':_0x2cc8('0x7d')};if(_0x57ae11[_0x2cc8('0x57')]['id']){delete _0x57ae11[_0x2cc8('0x57')]['id'];}_0x57ae11[_0x2cc8('0x57')]['UserId']=_0x57ae11['body'][_0x2cc8('0x5e')]||_0x57ae11[_0x2cc8('0x5f')]['id'];_0x329cc2[_0x2cc8('0x60')]['id']=_0x57ae11[_0x2cc8('0x57')]['UserId'];return db[_0x2cc8('0x4f')][_0x2cc8('0x55')]({'where':{'id':_0x57ae11['params']['id'],'UserId':null}})[_0x2cc8('0x20')](handleEntityNotFound(_0xf599e5,null))[_0x2cc8('0x20')](function(_0x46475c){if(_0x46475c){_0x329cc2[_0x2cc8('0x27')]=_0x46475c[_0x2cc8('0x61')]({'plain':!![]});return db[_0x2cc8('0x7e')][_0x2cc8('0x55')]({'where':{'id':_0x46475c[_0x2cc8('0x62')]}});}return null;})[_0x2cc8('0x20')](handleEntityNotFound(_0xf599e5,null))[_0x2cc8('0x20')](function(_0x3ead3c){if(_0x3ead3c){_0x329cc2['interaction']=_0x3ead3c['get']({'plain':!![]});interaction_log[_0x2cc8('0x21')](_0x2cc8('0x7f'),_0x57ae11[_0x2cc8('0x5f')]['id'],_0x57ae11['user'][_0x2cc8('0x37')],_0x57ae11[_0x2cc8('0x5f')][_0x2cc8('0x68')],_0x329cc2[_0x2cc8('0x66')]['id'],_0x57ae11['body']?JSON['stringify'](_0x57ae11[_0x2cc8('0x57')]):_0x2cc8('0x69'));return respondWithRpcPromise(_0x2cc8('0x80'),_0x2cc8('0x81'),_0x329cc2);}return null;})['then'](function(_0x4b6f2d){var _0x54d72e=_0x2cc8('0x6c')+_0x4b6f2d[_0x2cc8('0x27')]['ContactId'];return db[_0x2cc8('0x6d')]['query'](_0x54d72e,{'type':db[_0x2cc8('0x82')][_0x2cc8('0x6e')][_0x2cc8('0x6f')],'raw':!![]})['then'](function(_0x4bb789){return _0x4bb789;});})[_0x2cc8('0x20')](function(_0x219624){if(_0x219624){_0x329cc2[_0x2cc8('0x27')][_0x2cc8('0x83')]=_0x219624[0x0];if(!_0x57ae11[_0x2cc8('0x57')]['UserId'])return;return db[_0x2cc8('0x70')][_0x2cc8('0x55')]({'where':{'id':_0x57ae11[_0x2cc8('0x57')][_0x2cc8('0x5e')],'role':_0x2cc8('0x60')},'attributes':['id',_0x2cc8('0x37'),_0x2cc8('0x71'),_0x2cc8('0x72'),_0x2cc8('0x73')],'raw':!![]});}return null;})[_0x2cc8('0x20')](function(_0x40d9cf){if(!_0x40d9cf)return null;_0x329cc2[_0x2cc8('0x27')][_0x2cc8('0x60')]=_0x40d9cf;return _0x329cc2;})[_0x2cc8('0x20')](function(_0x56e38e){if(_0x56e38e){_0x56e38e['message'][_0x2cc8('0x75')]=util[_0x2cc8('0x5d')](_0x2cc8('0x84'),_0x57ae11[_0x2cc8('0x5f')][_0x2cc8('0x37')]);_0x56e38e[_0x2cc8('0x27')][_0x2cc8('0x76')]=_0x329cc2[_0x2cc8('0x76')];_0x56e38e[_0x2cc8('0x27')]['motionChannel']=_0x329cc2[_0x2cc8('0x76')];_0x56e38e[_0x2cc8('0x27')]['event']=_0x2cc8('0x34');respondWithRpcPromise('EventManager','EventManager',{'event':'rejectmessage','message':_[_0x2cc8('0x4b')](_0x329cc2[_0x2cc8('0x27')],JSON[_0x2cc8('0x7b')](_0x329cc2[_0x2cc8('0x66')][_0x2cc8('0x7c')]))},client9002);return _0x329cc2;}return null;})['then'](respondWithResult(_0xf599e5,null))[_0x2cc8('0x2a')](handleError(_0xf599e5,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index fcde1bd..6e8effc 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 _0xaa9e=['exports','events','../../mysqldb','ChatMessage','setMaxListeners','update','emit','hasOwnProperty','hook'];(function(_0x4e8adb,_0x4a0bf9){var _0x4f95e0=function(_0x40fa10){while(--_0x40fa10){_0x4e8adb['push'](_0x4e8adb['shift']());}};_0x4f95e0(++_0x4a0bf9);}(_0xaa9e,0x118));var _0xeaa9=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0xaa9e[_0x122096];return _0x3d1966;};'use strict';var EventEmitter=require(_0xeaa9('0x0'));var ChatMessage=require(_0xeaa9('0x1'))['db'][_0xeaa9('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xeaa9('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xeaa9('0x4'),'afterDestroy':'remove'};function emitEvent(_0x39f835){return function(_0x402981,_0xfded34,_0x57a9bb){ChatMessageEvents[_0xeaa9('0x5')](_0x39f835+':'+_0x402981['id'],_0x402981);ChatMessageEvents['emit'](_0x39f835,_0x402981);_0x57a9bb(null);};}for(var e in events){if(events[_0xeaa9('0x6')](e)){var event=events[e];ChatMessage[_0xeaa9('0x7')](e,emitEvent(event));}}module[_0xeaa9('0x8')]=ChatMessageEvents; \ No newline at end of file +var _0xbd1a=['events','ChatMessage','setMaxListeners','save','emit','hasOwnProperty','exports'];(function(_0x442f55,_0x325446){var _0x1076c2=function(_0x3fa294){while(--_0x3fa294){_0x442f55['push'](_0x442f55['shift']());}};_0x1076c2(++_0x325446);}(_0xbd1a,0x157));var _0xabd1=function(_0x32eb0d,_0x5b16fa){_0x32eb0d=_0x32eb0d-0x0;var _0x59cf53=_0xbd1a[_0x32eb0d];return _0x59cf53;};'use strict';var EventEmitter=require(_0xabd1('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0xabd1('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xabd1('0x2')](0x0);var events={'afterCreate':_0xabd1('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x400536){return function(_0x55ec2f,_0x2cf94d,_0x39fa8f){ChatMessageEvents[_0xabd1('0x4')](_0x400536+':'+_0x55ec2f['id'],_0x55ec2f);ChatMessageEvents['emit'](_0x400536,_0x55ec2f);_0x39fa8f(null);};}for(var e in events){if(events[_0xabd1('0x5')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0xabd1('0x6')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 9ff567b..1e89ad7 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 _0x86fa=['api','moment','bluebird','path','rimraf','../../config/environment','exports','define','fti_chat_messages','body','FULLTEXT','models','get','toLowerCase','direction','secret','UserId','ChatInteraction','findOne','update','createdAt','catch','error','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x8a52c8,_0x2df399){var _0x3ab22d=function(_0x245c87){while(--_0x245c87){_0x8a52c8['push'](_0x8a52c8['shift']());}};_0x3ab22d(++_0x2df399);}(_0x86fa,0x15c));var _0xa86f=function(_0x23f20f,_0x1e0173){_0x23f20f=_0x23f20f-0x0;var _0x2f5ce4=_0x86fa[_0x23f20f];return _0x2f5ce4;};'use strict';var _=require(_0xa86f('0x0'));var util=require(_0xa86f('0x1'));var logger=require(_0xa86f('0x2'))(_0xa86f('0x3'));var moment=require(_0xa86f('0x4'));var BPromise=require(_0xa86f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa86f('0x6'));var rimraf=require(_0xa86f('0x7'));var config=require(_0xa86f('0x8'));var attributes=require('./chatMessage.attributes');module[_0xa86f('0x9')]=function(_0x28cef1,_0x339f97){return _0x28cef1[_0xa86f('0xa')]('ChatMessage',attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0xa86f('0xb'),'fields':[_0xa86f('0xc')],'type':_0xa86f('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2c0155,_0xa7675c,_0x3c4896){var _0x3a0dfd=_0x28cef1[_0xa86f('0xe')];var _0x5d2c01=_0x2c0155[_0xa86f('0xf')]({'plain':!![]});if(_0x5d2c01['direction'][_0xa86f('0x10')]()==='in'||_0x5d2c01[_0xa86f('0x11')][_0xa86f('0x10')]()==='out'&&!_0x5d2c01[_0xa86f('0x12')]&&!_['isNil'](_0x5d2c01[_0xa86f('0x13')])){_0x3a0dfd[_0xa86f('0x14')][_0xa86f('0x15')]({'where':{'id':_0x5d2c01['ChatInteractionId']}})['then'](function(_0x2bce0a){if(_0x2bce0a){_0x2bce0a[_0xa86f('0x16')]({'lastMsgAt':_0x5d2c01[_0xa86f('0x17')],'lastMsgDirection':_0x5d2c01['direction'][_0xa86f('0x10')]()});}})[_0xa86f('0x18')](function(_0xe5984a){console[_0xa86f('0x19')](_0xe5984a);});}_0x3c4896();}},'charset':'utf8mb4','collate':_0xa86f('0x1a')});}; \ No newline at end of file +var _0x35b5=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','define','ChatMessage','fti_chat_messages','body','FULLTEXT','models','get','toLowerCase','direction','out','isNil','findOne','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4_unicode_ci'];(function(_0x1b6c6d,_0x2983b0){var _0x290d9d=function(_0x5b9779){while(--_0x5b9779){_0x1b6c6d['push'](_0x1b6c6d['shift']());}};_0x290d9d(++_0x2983b0);}(_0x35b5,0x14a));var _0x535b=function(_0x19f1da,_0x1f2b1d){_0x19f1da=_0x19f1da-0x0;var _0x385520=_0x35b5[_0x19f1da];return _0x385520;};'use strict';var _=require(_0x535b('0x0'));var util=require(_0x535b('0x1'));var logger=require(_0x535b('0x2'))(_0x535b('0x3'));var moment=require(_0x535b('0x4'));var BPromise=require(_0x535b('0x5'));var rp=require(_0x535b('0x6'));var fs=require('fs');var path=require(_0x535b('0x7'));var rimraf=require(_0x535b('0x8'));var config=require(_0x535b('0x9'));var attributes=require(_0x535b('0xa'));module['exports']=function(_0x2d58a1,_0x35f3d5){return _0x2d58a1[_0x535b('0xb')](_0x535b('0xc'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x535b('0xd'),'fields':[_0x535b('0xe')],'type':_0x535b('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x498b60,_0x240533,_0xe66753){var _0x392975=_0x2d58a1[_0x535b('0x10')];var _0x57fa0d=_0x498b60[_0x535b('0x11')]({'plain':!![]});if(_0x57fa0d['direction'][_0x535b('0x12')]()==='in'||_0x57fa0d[_0x535b('0x13')][_0x535b('0x12')]()===_0x535b('0x14')&&!_0x57fa0d['secret']&&!_[_0x535b('0x15')](_0x57fa0d['UserId'])){_0x392975['ChatInteraction'][_0x535b('0x16')]({'where':{'id':_0x57fa0d[_0x535b('0x17')]}})[_0x535b('0x18')](function(_0x10b75a){if(_0x10b75a){_0x10b75a[_0x535b('0x19')]({'lastMsgAt':_0x57fa0d[_0x535b('0x1a')],'lastMsgDirection':_0x57fa0d['direction'][_0x535b('0x12')]()});}})[_0x535b('0x1b')](function(_0x1162eb){console[_0x535b('0x1c')](_0x1162eb);});}_0xe66753();}},'charset':'utf8mb4','collate':_0x535b('0x1d')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index f335a70..e83f04c 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 _0x1bea=['../../mysqldb','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','then','debug','lodash','util','bluebird','ioredis'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1bea,0x18f));var _0xa1be=function(_0x1e9f16,_0x5c6259){_0x1e9f16=_0x1e9f16-0x0;var _0x2335a6=_0x1bea[_0x1e9f16];return _0x2335a6;};'use strict';var _=require(_0xa1be('0x0'));var util=require(_0xa1be('0x1'));var moment=require('moment');var BPromise=require(_0xa1be('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa1be('0x3'));var db=require(_0xa1be('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa1be('0x5'))(_0xa1be('0x6'));var config=require('../../config/environment');var jayson=require(_0xa1be('0x7'));var client=jayson['client'][_0xa1be('0x8')]({'port':0x232a});config[_0xa1be('0x9')]=_[_0xa1be('0xa')](config[_0xa1be('0x9')],{'host':_0xa1be('0xb'),'port':0x18eb});var socket=require(_0xa1be('0xc'))(new Redis(config[_0xa1be('0x9')]));require('./chatMessage.socket')[_0xa1be('0xd')](socket);function respondWithRpcPromise(_0x2eeef8,_0xc23357,_0xeb729f){return new BPromise(function(_0x5c5877,_0x139967){return client['request'](_0x2eeef8,_0xeb729f)['then'](function(_0x25787d){logger[_0xa1be('0xe')](_0xa1be('0xf'),_0xc23357,_0xa1be('0x10'));logger['debug'](_0xa1be('0x11'),_0xc23357,_0xa1be('0x10'),JSON[_0xa1be('0x12')](_0x25787d));if(_0x25787d[_0xa1be('0x13')]){if(_0x25787d[_0xa1be('0x13')]['code']===0x1f4){logger[_0xa1be('0x13')](_0xa1be('0xf'),_0xc23357,_0x25787d['error'][_0xa1be('0x14')]);return _0x139967(_0x25787d[_0xa1be('0x13')][_0xa1be('0x14')]);}logger[_0xa1be('0x13')](_0xa1be('0xf'),_0xc23357,_0x25787d[_0xa1be('0x13')][_0xa1be('0x14')]);return _0x5c5877(_0x25787d[_0xa1be('0x13')][_0xa1be('0x14')]);}else{logger[_0xa1be('0xe')](_0xa1be('0xf'),_0xc23357,_0xa1be('0x10'));_0x5c5877(_0x25787d[_0xa1be('0x15')]['message']);}})[_0xa1be('0x16')](function(_0x3fb3e7){logger[_0xa1be('0x13')]('ChatMessage,\x20%s,\x20%s',_0xc23357,_0x3fb3e7);_0x139967(_0x3fb3e7);});});}exports[_0xa1be('0x17')]=function(_0x84fb86){var _0x174417=this;return new Promise(function(_0x11e0f9,_0x5ac487){return db[_0xa1be('0x18')][_0xa1be('0x19')](_0x84fb86[_0xa1be('0x1a')],{'raw':_0x84fb86[_0xa1be('0x1b')]?_0x84fb86['options'][_0xa1be('0x1c')]===undefined?!![]:![]:!![]})[_0xa1be('0x1d')](function(_0xc28cfc){logger[_0xa1be('0xe')]('CreateChatMessage',_0x84fb86);logger[_0xa1be('0x1e')](_0xa1be('0x17'),_0x84fb86,JSON['stringify'](_0xc28cfc));_0x11e0f9(_0xc28cfc);})[_0xa1be('0x16')](function(_0xf6a4d7){logger[_0xa1be('0x13')](_0xa1be('0x17'),_0xf6a4d7['message'],_0x84fb86);_0x5ac487(_0x174417[_0xa1be('0x13')](0x1f4,_0xf6a4d7[_0xa1be('0x14')]));});});}; \ No newline at end of file +var _0x2d25=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','then','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','util','../../mysqldb'];(function(_0x8de141,_0x316d45){var _0x5b1864=function(_0x1b09cd){while(--_0x1b09cd){_0x8de141['push'](_0x8de141['shift']());}};_0x5b1864(++_0x316d45);}(_0x2d25,0x1de));var _0x52d2=function(_0x1e5be4,_0x552b4c){_0x1e5be4=_0x1e5be4-0x0;var _0x3d4b48=_0x2d25[_0x1e5be4];return _0x3d4b48;};'use strict';var _=require('lodash');var util=require(_0x52d2('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x52d2('0x1'))['db'];var utils=require(_0x52d2('0x2'));var logger=require('../../config/logger')(_0x52d2('0x3'));var config=require(_0x52d2('0x4'));var jayson=require(_0x52d2('0x5'));var client=jayson[_0x52d2('0x6')][_0x52d2('0x7')]({'port':0x232a});config[_0x52d2('0x8')]=_[_0x52d2('0x9')](config[_0x52d2('0x8')],{'host':_0x52d2('0xa'),'port':0x18eb});var socket=require(_0x52d2('0xb'))(new Redis(config[_0x52d2('0x8')]));require(_0x52d2('0xc'))['register'](socket);function respondWithRpcPromise(_0x24f4da,_0x2deecf,_0x7ed2f5){return new BPromise(function(_0x35bbd6,_0x485217){return client['request'](_0x24f4da,_0x7ed2f5)[_0x52d2('0xd')](function(_0xc83d71){logger[_0x52d2('0xe')](_0x52d2('0xf'),_0x2deecf,_0x52d2('0x10'));logger[_0x52d2('0x11')](_0x52d2('0x12'),_0x2deecf,_0x52d2('0x10'),JSON[_0x52d2('0x13')](_0xc83d71));if(_0xc83d71[_0x52d2('0x14')]){if(_0xc83d71['error']['code']===0x1f4){logger[_0x52d2('0x14')](_0x52d2('0xf'),_0x2deecf,_0xc83d71['error'][_0x52d2('0x15')]);return _0x485217(_0xc83d71[_0x52d2('0x14')][_0x52d2('0x15')]);}logger[_0x52d2('0x14')](_0x52d2('0xf'),_0x2deecf,_0xc83d71['error'][_0x52d2('0x15')]);return _0x35bbd6(_0xc83d71[_0x52d2('0x14')][_0x52d2('0x15')]);}else{logger[_0x52d2('0xe')](_0x52d2('0xf'),_0x2deecf,_0x52d2('0x10'));_0x35bbd6(_0xc83d71[_0x52d2('0x16')][_0x52d2('0x15')]);}})[_0x52d2('0x17')](function(_0x23d22b){logger[_0x52d2('0x14')](_0x52d2('0xf'),_0x2deecf,_0x23d22b);_0x485217(_0x23d22b);});});}exports[_0x52d2('0x18')]=function(_0x349ad5){var _0x3970be=this;return new Promise(function(_0x13a436,_0x15c257){return db[_0x52d2('0x19')][_0x52d2('0x1a')](_0x349ad5[_0x52d2('0x1b')],{'raw':_0x349ad5[_0x52d2('0x1c')]?_0x349ad5[_0x52d2('0x1c')][_0x52d2('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x626f76){logger[_0x52d2('0xe')]('CreateChatMessage',_0x349ad5);logger['debug']('CreateChatMessage',_0x349ad5,JSON[_0x52d2('0x13')](_0x626f76));_0x13a436(_0x626f76);})[_0x52d2('0x17')](function(_0x16dae0){logger[_0x52d2('0x14')](_0x52d2('0x18'),_0x16dae0['message'],_0x349ad5);_0x15c257(_0x3970be['error'](0x1f4,_0x16dae0['message']));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index b8ccb37..69b2120 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 _0x6eed=['emit','removeListener','register','./chatMessage.events','save','remove','update'];(function(_0x2637ac,_0x377857){var _0x4a5758=function(_0x5d5043){while(--_0x5d5043){_0x2637ac['push'](_0x2637ac['shift']());}};_0x4a5758(++_0x377857);}(_0x6eed,0xff));var _0xd6ee=function(_0x4034c7,_0x218b3f){_0x4034c7=_0x4034c7-0x0;var _0x313a6c=_0x6eed[_0x4034c7];return _0x313a6c;};'use strict';var ChatMessageEvents=require(_0xd6ee('0x0'));var events=[_0xd6ee('0x1'),_0xd6ee('0x2'),_0xd6ee('0x3')];function createListener(_0x1a734a,_0x4e325a){return function(_0x25a92a){_0x4e325a[_0xd6ee('0x4')](_0x1a734a,_0x25a92a);};}function removeListener(_0x588715,_0x53cce9){return function(){ChatMessageEvents[_0xd6ee('0x5')](_0x588715,_0x53cce9);};}exports[_0xd6ee('0x6')]=function(_0x1c4f36){for(var _0x37abca=0x0,_0x10c1d7=events['length'];_0x37abca<_0x10c1d7;_0x37abca++){var _0x514dc3=events[_0x37abca];var _0x2e6369=createListener('chatMessage:'+_0x514dc3,_0x1c4f36);ChatMessageEvents['on'](_0x514dc3,_0x2e6369);}}; \ No newline at end of file +var _0x2caf=['removeListener','register','length','chatMessage:','update','emit'];(function(_0x40f9a0,_0x3458cc){var _0x3e3144=function(_0x1f8fce){while(--_0x1f8fce){_0x40f9a0['push'](_0x40f9a0['shift']());}};_0x3e3144(++_0x3458cc);}(_0x2caf,0x6a));var _0xf2ca=function(_0x3483e8,_0x17b699){_0x3483e8=_0x3483e8-0x0;var _0x1e4748=_0x2caf[_0x3483e8];return _0x1e4748;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=['save','remove',_0xf2ca('0x0')];function createListener(_0x53a64f,_0x3b2612){return function(_0x36e439){_0x3b2612[_0xf2ca('0x1')](_0x53a64f,_0x36e439);};}function removeListener(_0x375e8b,_0x137501){return function(){ChatMessageEvents[_0xf2ca('0x2')](_0x375e8b,_0x137501);};}exports[_0xf2ca('0x3')]=function(_0x51372a){for(var _0x8ce770=0x0,_0x4292b4=events[_0xf2ca('0x4')];_0x8ce770<_0x4292b4;_0x8ce770++){var _0x57e3e8=events[_0x8ce770];var _0x4ea38c=createListener(_0xf2ca('0x5')+_0x57e3e8,_0x51372a);ChatMessageEvents['on'](_0x57e3e8,_0x4ea38c);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 3946855..60166f3 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 _0x4d53=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','/describe','describe','/:id','post','tracked','chat','create','update','put','/:id/accept','reject','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x3b8eef,_0x176dc4){var _0x1cd62a=function(_0x1bf492){while(--_0x1bf492){_0x3b8eef['push'](_0x3b8eef['shift']());}};_0x1cd62a(++_0x176dc4);}(_0x4d53,0x1d0));var _0x34d5=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x4d53[_0x2b10c6];return _0x3789d2;};'use strict';var multer=require(_0x34d5('0x0'));var util=require(_0x34d5('0x1'));var path=require(_0x34d5('0x2'));var timeout=require(_0x34d5('0x3'));var express=require(_0x34d5('0x4'));var router=express[_0x34d5('0x5')]();var fs_extra=require(_0x34d5('0x6'));var auth=require(_0x34d5('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x34d5('0x8'));var controller=require(_0x34d5('0x9'));router[_0x34d5('0xa')]('/',auth[_0x34d5('0xb')](),controller['index']);router[_0x34d5('0xa')](_0x34d5('0xc'),auth[_0x34d5('0xb')](),controller[_0x34d5('0xd')]);router['get'](_0x34d5('0xe'),auth[_0x34d5('0xb')](),controller['show']);router[_0x34d5('0xf')]('/',auth[_0x34d5('0xb')](),interaction[_0x34d5('0x10')](_0x34d5('0x11'),'chatmessage:create'),controller[_0x34d5('0x12')]);router['put'](_0x34d5('0xe'),controller[_0x34d5('0x13')]);router[_0x34d5('0x14')](_0x34d5('0x15'),auth[_0x34d5('0xb')](),controller['accept']);router[_0x34d5('0x14')]('/:id/reject',auth[_0x34d5('0xb')](),controller[_0x34d5('0x16')]);router[_0x34d5('0x17')]('/:id',auth[_0x34d5('0xb')](),controller[_0x34d5('0x18')]);module[_0x34d5('0x19')]=router; \ No newline at end of file +var _0x1b59=['create','put','update','/:id/accept','accept','delete','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','describe','get','/:id','show','post','tracked','chatmessage:create'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x1b59,0x151));var _0x91b5=function(_0x5bfea1,_0x494abb){_0x5bfea1=_0x5bfea1-0x0;var _0x42d2fa=_0x1b59[_0x5bfea1];return _0x42d2fa;};'use strict';var multer=require(_0x91b5('0x0'));var util=require('util');var path=require(_0x91b5('0x1'));var timeout=require('connect-timeout');var express=require(_0x91b5('0x2'));var router=express[_0x91b5('0x3')]();var fs_extra=require(_0x91b5('0x4'));var auth=require(_0x91b5('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x91b5('0x6'));var controller=require('./chatMessage.controller');router['get']('/',auth[_0x91b5('0x7')](),controller['index']);router['get']('/describe',auth[_0x91b5('0x7')](),controller[_0x91b5('0x8')]);router[_0x91b5('0x9')](_0x91b5('0xa'),auth[_0x91b5('0x7')](),controller[_0x91b5('0xb')]);router[_0x91b5('0xc')]('/',auth[_0x91b5('0x7')](),interaction[_0x91b5('0xd')]('chat',_0x91b5('0xe')),controller[_0x91b5('0xf')]);router[_0x91b5('0x10')](_0x91b5('0xa'),controller[_0x91b5('0x11')]);router[_0x91b5('0x10')](_0x91b5('0x12'),auth['isAuthenticated'](),controller[_0x91b5('0x13')]);router[_0x91b5('0x10')]('/:id/reject',auth[_0x91b5('0x7')](),controller['reject']);router[_0x91b5('0x14')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x91b5('0x15')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 485935d..62551c1 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 _0x2032=['medium','exports','TEXT'];(function(_0x513194,_0x2f763b){var _0x33dffa=function(_0x642e06){while(--_0x642e06){_0x513194['push'](_0x513194['shift']());}};_0x33dffa(++_0x2f763b);}(_0x2032,0xd9));var _0x2203=function(_0x4ae658,_0x51297f){_0x4ae658=_0x4ae658-0x0;var _0x9769fa=_0x2032[_0x4ae658];return _0x9769fa;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'body':{'type':Sequelize[_0x2203('0x1')](_0x2203('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x2203('0x2')),'allowNull':![]}}; \ No newline at end of file +var _0x2032=['medium','exports','TEXT'];(function(_0x3f50ad,_0x2d4102){var _0x225c50=function(_0x1cb88d){while(--_0x1cb88d){_0x3f50ad['push'](_0x3f50ad['shift']());}};_0x225c50(++_0x2d4102);}(_0x2032,0xd9));var _0x2203=function(_0x244120,_0x116196){_0x244120=_0x244120-0x0;var _0x3b9be6=_0x2032[_0x244120];return _0x3b9be6;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'body':{'type':Sequelize[_0x2203('0x1')](_0x2203('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x2203('0x2')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index b070893..6ebdccb 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 _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x47d5b5,_0x36a1fd){var _0x424b3a=function(_0x4c1ed0){while(--_0x4c1ed0){_0x47d5b5['push'](_0x47d5b5['shift']());}};_0x424b3a(++_0x36a1fd);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file +var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x186376,_0x5d988a){var _0x2dbdd9=function(_0x96908e){while(--_0x96908e){_0x186376['push'](_0x186376['shift']());}};_0x2dbdd9(++_0x5d988a);}(_0x7a54,0x106));var _0x47a5=function(_0x2f70b9,_0x550c83){_0x2f70b9=_0x2f70b9-0x0;var _0x2f4f16=_0x7a54[_0x2f70b9];return _0x2f4f16;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js index 568e68d..9571a7a 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.events.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x810f=['update','emit','hasOwnProperty','exports','events','../../mysqldb','ChatOfflineMessage','save'];(function(_0x3d3ec7,_0x20d718){var _0x372f75=function(_0x1082fc){while(--_0x1082fc){_0x3d3ec7['push'](_0x3d3ec7['shift']());}};_0x372f75(++_0x20d718);}(_0x810f,0x114));var _0xf810=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x810f[_0x33032e];return _0x13316b;};'use strict';var EventEmitter=require(_0xf810('0x0'));var ChatOfflineMessage=require(_0xf810('0x1'))['db'][_0xf810('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf810('0x3'),'afterUpdate':_0xf810('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2fbf8b){return function(_0x184812,_0x350933,_0x5d7308){ChatOfflineMessageEvents[_0xf810('0x5')](_0x2fbf8b+':'+_0x184812['id'],_0x184812);ChatOfflineMessageEvents[_0xf810('0x5')](_0x2fbf8b,_0x184812);_0x5d7308(null);};}for(var e in events){if(events[_0xf810('0x6')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0xf810('0x7')]=ChatOfflineMessageEvents; \ No newline at end of file +var _0xc367=['exports','events','../../mysqldb','ChatOfflineMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x2ff0fa,_0x209317){var _0x20a8dc=function(_0x59f52c){while(--_0x59f52c){_0x2ff0fa['push'](_0x2ff0fa['shift']());}};_0x20a8dc(++_0x209317);}(_0xc367,0x14b));var _0x7c36=function(_0x573616,_0xea5527){_0x573616=_0x573616-0x0;var _0x4a2927=_0xc367[_0x573616];return _0x4a2927;};'use strict';var EventEmitter=require(_0x7c36('0x0'));var ChatOfflineMessage=require(_0x7c36('0x1'))['db'][_0x7c36('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x7c36('0x3')](0x0);var events={'afterCreate':_0x7c36('0x4'),'afterUpdate':_0x7c36('0x5'),'afterDestroy':_0x7c36('0x6')};function emitEvent(_0x3a09c8){return function(_0x1cc5d5,_0x254bc6,_0x3b47cb){ChatOfflineMessageEvents[_0x7c36('0x7')](_0x3a09c8+':'+_0x1cc5d5['id'],_0x1cc5d5);ChatOfflineMessageEvents[_0x7c36('0x7')](_0x3a09c8,_0x1cc5d5);_0x3b47cb(null);};}for(var e in events){if(events[_0x7c36('0x8')](e)){var event=events[e];ChatOfflineMessage[_0x7c36('0x9')](e,emitEvent(event));}}module[_0x7c36('0xa')]=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 072179d..29b7976 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 _0x4172=['exports','define','ChatOfflineMessage','utf8mb4_unicode_ci','./chatOfflineMessage.attributes'];(function(_0x389ebe,_0x1785cb){var _0x311ef9=function(_0x4389b0){while(--_0x4389b0){_0x389ebe['push'](_0x389ebe['shift']());}};_0x311ef9(++_0x1785cb);}(_0x4172,0x19e));var _0x2417=function(_0x5e3333,_0x5b7880){_0x5e3333=_0x5e3333-0x0;var _0x5a3896=_0x4172[_0x5e3333];return _0x5a3896;};'use strict';var attributes=require(_0x2417('0x0'));module[_0x2417('0x1')]=function(_0x2079ca){return _0x2079ca[_0x2417('0x2')](_0x2417('0x3'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x2417('0x4')});}; \ No newline at end of file +var _0x8b4a=['chat_offline_messages','utf8mb4','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage'];(function(_0x447746,_0x18f780){var _0x54a8f6=function(_0x358d20){while(--_0x358d20){_0x447746['push'](_0x447746['shift']());}};_0x54a8f6(++_0x18f780);}(_0x8b4a,0x188));var _0xa8b4=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x8b4a[_0x19e35c];return _0x3e1fe8;};'use strict';var attributes=require(_0xa8b4('0x0'));module[_0xa8b4('0x1')]=function(_0x4bdccb){return _0x4bdccb[_0xa8b4('0x2')](_0xa8b4('0x3'),attributes,{'tableName':_0xa8b4('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa8b4('0x5'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index d8bbd8e..e6c9ad9 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 _0xc12f=['result','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','client','http','request','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatOfflineMessage,\x20%s,\x20%s','message','info'];(function(_0x3c5e54,_0x2b991b){var _0x3ae1f3=function(_0x43f80f){while(--_0x43f80f){_0x3c5e54['push'](_0x3c5e54['shift']());}};_0x3ae1f3(++_0x2b991b);}(_0xc12f,0xe8));var _0xfc12=function(_0x1a7846,_0x59723e){_0x1a7846=_0x1a7846-0x0;var _0x48049=_0xc12f[_0x1a7846];return _0x48049;};'use strict';var _=require(_0xfc12('0x0'));var util=require(_0xfc12('0x1'));var moment=require(_0xfc12('0x2'));var BPromise=require(_0xfc12('0x3'));var rs=require(_0xfc12('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfc12('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xfc12('0x6'));var config=require(_0xfc12('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xfc12('0x8')][_0xfc12('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3be23d,_0x2caef9,_0x983b54){return new BPromise(function(_0x4831be,_0x121c98){return client[_0xfc12('0xa')](_0x3be23d,_0x983b54)['then'](function(_0x57b044){logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x2caef9,_0xfc12('0xb'));logger[_0xfc12('0xc')](_0xfc12('0xd'),_0x2caef9,_0xfc12('0xb'),JSON[_0xfc12('0xe')](_0x57b044));if(_0x57b044['error']){if(_0x57b044[_0xfc12('0xf')][_0xfc12('0x10')]===0x1f4){logger[_0xfc12('0xf')](_0xfc12('0x11'),_0x2caef9,_0x57b044[_0xfc12('0xf')]['message']);return _0x121c98(_0x57b044['error']['message']);}logger[_0xfc12('0xf')](_0xfc12('0x11'),_0x2caef9,_0x57b044[_0xfc12('0xf')]['message']);return _0x4831be(_0x57b044['error'][_0xfc12('0x12')]);}else{logger[_0xfc12('0x13')](_0xfc12('0x11'),_0x2caef9,'request\x20sent');_0x4831be(_0x57b044[_0xfc12('0x14')][_0xfc12('0x12')]);}})['catch'](function(_0x1a3fc7){logger[_0xfc12('0xf')](_0xfc12('0x11'),_0x2caef9,_0x1a3fc7);_0x121c98(_0x1a3fc7);});});} \ No newline at end of file +var _0xf555=['error','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x90acc8,_0x39bedd){var _0x278ee0=function(_0x4f00f4){while(--_0x4f00f4){_0x90acc8['push'](_0x90acc8['shift']());}};_0x278ee0(++_0x39bedd);}(_0xf555,0x97));var _0x5f55=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf555[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5f55('0x0'));var util=require(_0x5f55('0x1'));var moment=require('moment');var BPromise=require(_0x5f55('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5f55('0x3'));var db=require(_0x5f55('0x4'))['db'];var utils=require(_0x5f55('0x5'));var logger=require('../../config/logger')(_0x5f55('0x6'));var config=require(_0x5f55('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5f55('0x8')][_0x5f55('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3b48dd,_0x40e2ac,_0x3ae755){return new BPromise(function(_0x8419b0,_0x23e3a9){return client[_0x5f55('0xa')](_0x3b48dd,_0x3ae755)[_0x5f55('0xb')](function(_0x5e961f){logger[_0x5f55('0xc')](_0x5f55('0xd'),_0x40e2ac,_0x5f55('0xe'));logger[_0x5f55('0xf')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x40e2ac,_0x5f55('0xe'),JSON[_0x5f55('0x10')](_0x5e961f));if(_0x5e961f['error']){if(_0x5e961f['error']['code']===0x1f4){logger[_0x5f55('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x40e2ac,_0x5e961f['error']['message']);return _0x23e3a9(_0x5e961f['error'][_0x5f55('0x12')]);}logger[_0x5f55('0x11')](_0x5f55('0xd'),_0x40e2ac,_0x5e961f[_0x5f55('0x11')][_0x5f55('0x12')]);return _0x8419b0(_0x5e961f[_0x5f55('0x11')][_0x5f55('0x12')]);}else{logger['info'](_0x5f55('0xd'),_0x40e2ac,'request\x20sent');_0x8419b0(_0x5e961f[_0x5f55('0x13')][_0x5f55('0x12')]);}})[_0x5f55('0x14')](function(_0x49eb28){logger[_0x5f55('0x11')](_0x5f55('0xd'),_0x40e2ac,_0x49eb28);_0x23e3a9(_0x49eb28);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 2a16ef0..f6eb8cd 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 _0x58e7=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/describe','describe','/:id','post','create','put','delete','util'];(function(_0x17915c,_0x57d0ee){var _0x49a7d7=function(_0xcba1a5){while(--_0xcba1a5){_0x17915c['push'](_0x17915c['shift']());}};_0x49a7d7(++_0x57d0ee);}(_0x58e7,0x1a8));var _0x758e=function(_0x4e2bc1,_0x38f88b){_0x4e2bc1=_0x4e2bc1-0x0;var _0x7d06eb=_0x58e7[_0x4e2bc1];return _0x7d06eb;};'use strict';var multer=require('multer');var util=require(_0x758e('0x0'));var path=require(_0x758e('0x1'));var timeout=require(_0x758e('0x2'));var express=require(_0x758e('0x3'));var router=express['Router']();var fs_extra=require(_0x758e('0x4'));var auth=require(_0x758e('0x5'));var interaction=require(_0x758e('0x6'));var config=require('../../config/environment');var controller=require('./chatOfflineMessage.controller');router['get']('/',auth[_0x758e('0x7')](),controller[_0x758e('0x8')]);router[_0x758e('0x9')](_0x758e('0xa'),auth[_0x758e('0x7')](),controller[_0x758e('0xb')]);router[_0x758e('0x9')](_0x758e('0xc'),auth[_0x758e('0x7')](),controller['show']);router[_0x758e('0xd')]('/',auth['isAuthenticated'](),controller[_0x758e('0xe')]);router[_0x758e('0xf')](_0x758e('0xc'),auth[_0x758e('0x7')](),controller['update']);router[_0x758e('0x10')]('/:id',auth[_0x758e('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x10e8=['put','update','delete','destroy','exports','util','path','connect-timeout','fs-extra','../../config/environment','./chatOfflineMessage.controller','isAuthenticated','get','/describe','/:id','post','create'];(function(_0x57f37c,_0x509412){var _0x4b3535=function(_0x3aae68){while(--_0x3aae68){_0x57f37c['push'](_0x57f37c['shift']());}};_0x4b3535(++_0x509412);}(_0x10e8,0x16a));var _0x810e=function(_0x8c2922,_0x181bf2){_0x8c2922=_0x8c2922-0x0;var _0x3c4b7c=_0x10e8[_0x8c2922];return _0x3c4b7c;};'use strict';var multer=require('multer');var util=require(_0x810e('0x0'));var path=require(_0x810e('0x1'));var timeout=require(_0x810e('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x810e('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x810e('0x4'));var controller=require(_0x810e('0x5'));router['get']('/',auth[_0x810e('0x6')](),controller['index']);router[_0x810e('0x7')](_0x810e('0x8'),auth[_0x810e('0x6')](),controller['describe']);router[_0x810e('0x7')](_0x810e('0x9'),auth[_0x810e('0x6')](),controller['show']);router[_0x810e('0xa')]('/',auth['isAuthenticated'](),controller[_0x810e('0xb')]);router[_0x810e('0xc')](_0x810e('0x9'),auth[_0x810e('0x6')](),controller[_0x810e('0xd')]);router[_0x810e('0xe')](_0x810e('0x9'),auth[_0x810e('0x6')](),controller[_0x810e('0xf')]);module[_0x810e('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 1f44af3..508d61d 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 _0xd833=['mouseOver','timeout','INTEGER','exports','STRING'];(function(_0x37a7c6,_0x3a84b6){var _0x539905=function(_0xa00c20){while(--_0xa00c20){_0x37a7c6['push'](_0x37a7c6['shift']());}};_0x539905(++_0x3a84b6);}(_0xd833,0xc6));var _0x3d83=function(_0x3018eb,_0x570c63){_0x3018eb=_0x3018eb-0x0;var _0x23131f=_0xd833[_0x3018eb];return _0x23131f;};'use strict';var Sequelize=require('sequelize');module[_0x3d83('0x0')]={'name':{'type':Sequelize[_0x3d83('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x3d83('0x2'),_0x3d83('0x3')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x3d83('0x1')]},'timeout':{'type':Sequelize[_0x3d83('0x4')]}}; \ No newline at end of file +var _0x2d37=['INTEGER','sequelize','STRING','mouseOver'];(function(_0x5497d3,_0x193adf){var _0x42f1ef=function(_0x83263f){while(--_0x83263f){_0x5497d3['push'](_0x5497d3['shift']());}};_0x42f1ef(++_0x193adf);}(_0x2d37,0x101));var _0x72d3=function(_0xf9a4a0,_0x19902c){_0xf9a4a0=_0xf9a4a0-0x0;var _0x130aa3=_0x2d37[_0xf9a4a0];return _0x130aa3;};'use strict';var Sequelize=require(_0x72d3('0x0'));module['exports']={'name':{'type':Sequelize[_0x72d3('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('mouseOver','timeout'),'defaultValue':_0x72d3('0x2')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x72d3('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 2224c08..debd7d0 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 _0xfafd=['ChatProactiveAction','query','filters','intersection','attributes','fields','length','includeAll','include','merge','find','catch','create','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','then','error','stack','name','send','show','params','model','keys'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0xfafd,0xcc));var _0xdfaf=function(_0x1b16e7,_0x3a270f){_0x1b16e7=_0x1b16e7-0x0;var _0x15338c=_0xfafd[_0x1b16e7];return _0x15338c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdfaf('0x0'));var zipdir=require(_0xdfaf('0x1'));var jsonpatch=require(_0xdfaf('0x2'));var rp=require(_0xdfaf('0x3'));var moment=require(_0xdfaf('0x4'));var BPromise=require(_0xdfaf('0x5'));var Mustache=require(_0xdfaf('0x6'));var util=require(_0xdfaf('0x7'));var path=require(_0xdfaf('0x8'));var sox=require(_0xdfaf('0x9'));var csv=require(_0xdfaf('0xa'));var ejs=require(_0xdfaf('0xb'));var fs=require('fs');var fs_extra=require(_0xdfaf('0xc'));var _=require(_0xdfaf('0xd'));var squel=require(_0xdfaf('0xe'));var crypto=require('crypto');var jsforce=require(_0xdfaf('0xf'));var deskjs=require(_0xdfaf('0x10'));var toCsv=require(_0xdfaf('0xa'));var querystring=require(_0xdfaf('0x11'));var Papa=require(_0xdfaf('0x12'));var Redis=require(_0xdfaf('0x13'));var authService=require(_0xdfaf('0x14'));var qs=require(_0xdfaf('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdfaf('0x16'));var logger=require(_0xdfaf('0x17'))(_0xdfaf('0x18'));var utils=require(_0xdfaf('0x19'));var config=require(_0xdfaf('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xdfaf('0x1b'))['db'];function respondWithStatusCode(_0x2ecc29,_0x2ad242){_0x2ad242=_0x2ad242||0xcc;return function(_0x2f8477){if(_0x2f8477){return _0x2ecc29[_0xdfaf('0x1c')](_0x2ad242);}return _0x2ecc29[_0xdfaf('0x1d')](_0x2ad242)[_0xdfaf('0x1e')]();};}function respondWithResult(_0x1048f0,_0x3a48ca){_0x3a48ca=_0x3a48ca||0xc8;return function(_0x444277){if(_0x444277){return _0x1048f0['status'](_0x3a48ca)[_0xdfaf('0x1f')](_0x444277);}};}function respondWithFilteredResult(_0x3a67c0,_0x396bdf){return function(_0x555334){if(_0x555334){var _0x3eaef2=typeof _0x396bdf[_0xdfaf('0x20')]===_0xdfaf('0x21')&&typeof _0x396bdf['limit']==='undefined';var _0x2e46f2=_0x555334['count'];var _0x4a3b0e=_0x3eaef2?0x0:_0x396bdf[_0xdfaf('0x20')];var _0x685589=_0x3eaef2?_0x555334[_0xdfaf('0x22')]:_0x396bdf[_0xdfaf('0x20')]+_0x396bdf[_0xdfaf('0x23')];var _0x2d82ed;if(_0x685589>=_0x2e46f2){_0x685589=_0x2e46f2;_0x2d82ed=0xc8;}else{_0x2d82ed=0xce;}_0x3a67c0[_0xdfaf('0x1d')](_0x2d82ed);return _0x3a67c0[_0xdfaf('0x24')](_0xdfaf('0x25'),_0x4a3b0e+'-'+_0x685589+'/'+_0x2e46f2)[_0xdfaf('0x1f')](_0x555334);}return null;};}function patchUpdates(_0x58b3a8){return function(_0x111527){try{jsonpatch[_0xdfaf('0x26')](_0x111527,_0x58b3a8,!![]);}catch(_0x395bd7){return BPromise['reject'](_0x395bd7);}return _0x111527['save']();};}function saveUpdates(_0x2f4826,_0x358550){return function(_0x637510){if(_0x637510){return _0x637510['update'](_0x2f4826)[_0xdfaf('0x27')](function(_0x8a3307){return _0x8a3307;});}return null;};}function removeEntity(_0x3f2aa1,_0x4f46e2){return function(_0x35cae0){if(_0x35cae0){return _0x35cae0['destroy']()[_0xdfaf('0x27')](function(){_0x3f2aa1[_0xdfaf('0x1d')](0xcc)[_0xdfaf('0x1e')]();});}};}function handleEntityNotFound(_0x555020,_0x5c9e76){return function(_0x215f06){if(!_0x215f06){_0x555020[_0xdfaf('0x1c')](0x194);}return _0x215f06;};}function handleError(_0x5e80c2,_0x22e0e2){_0x22e0e2=_0x22e0e2||0x1f4;return function(_0x53ff01){logger[_0xdfaf('0x28')](_0x53ff01[_0xdfaf('0x29')]);if(_0x53ff01[_0xdfaf('0x2a')]){delete _0x53ff01['name'];}_0x5e80c2[_0xdfaf('0x1d')](_0x22e0e2)[_0xdfaf('0x2b')](_0x53ff01);};}exports[_0xdfaf('0x2c')]=function(_0x30f1ec,_0x1cdf14){var _0x240a4b={'raw':!![],'where':{'id':_0x30f1ec[_0xdfaf('0x2d')]['id']}},_0x5c7d87={};_0x5c7d87[_0xdfaf('0x2e')]=_[_0xdfaf('0x2f')](db[_0xdfaf('0x30')]['rawAttributes']);_0x5c7d87[_0xdfaf('0x31')]=_[_0xdfaf('0x2f')](_0x30f1ec['query']);_0x5c7d87[_0xdfaf('0x32')]=_[_0xdfaf('0x33')](_0x5c7d87['model'],_0x5c7d87[_0xdfaf('0x31')]);_0x240a4b[_0xdfaf('0x34')]=_[_0xdfaf('0x33')](_0x5c7d87[_0xdfaf('0x2e')],qs[_0xdfaf('0x35')](_0x30f1ec['query'][_0xdfaf('0x35')]));_0x240a4b[_0xdfaf('0x34')]=_0x240a4b[_0xdfaf('0x34')][_0xdfaf('0x36')]?_0x240a4b[_0xdfaf('0x34')]:_0x5c7d87[_0xdfaf('0x2e')];if(_0x30f1ec['query'][_0xdfaf('0x37')]){_0x240a4b[_0xdfaf('0x38')]=[{'all':!![]}];}_0x240a4b=_[_0xdfaf('0x39')]({},_0x240a4b,_0x30f1ec['options']);return db[_0xdfaf('0x30')][_0xdfaf('0x3a')](_0x240a4b)[_0xdfaf('0x27')](handleEntityNotFound(_0x1cdf14,null))[_0xdfaf('0x27')](respondWithResult(_0x1cdf14,null))[_0xdfaf('0x3b')](handleError(_0x1cdf14,null));};exports[_0xdfaf('0x3c')]=function(_0x309212,_0x9a8850){return db[_0xdfaf('0x30')][_0xdfaf('0x3c')](_0x309212[_0xdfaf('0x3d')],{})[_0xdfaf('0x27')](respondWithResult(_0x9a8850,0xc9))[_0xdfaf('0x3b')](handleError(_0x9a8850,null));};exports['update']=function(_0x4dc6d0,_0x758d32){if(_0x4dc6d0[_0xdfaf('0x3d')]['id']){delete _0x4dc6d0[_0xdfaf('0x3d')]['id'];}return db[_0xdfaf('0x30')][_0xdfaf('0x3a')]({'where':{'id':_0x4dc6d0[_0xdfaf('0x2d')]['id']}})['then'](handleEntityNotFound(_0x758d32,null))[_0xdfaf('0x27')](saveUpdates(_0x4dc6d0[_0xdfaf('0x3d')],null))[_0xdfaf('0x27')](respondWithResult(_0x758d32,null))[_0xdfaf('0x3b')](handleError(_0x758d32,null));};exports[_0xdfaf('0x3e')]=function(_0x197c93,_0x5c023a){return db[_0xdfaf('0x30')][_0xdfaf('0x3a')]({'where':{'id':_0x197c93[_0xdfaf('0x2d')]['id']}})['then'](handleEntityNotFound(_0x5c023a,null))[_0xdfaf('0x27')](removeEntity(_0x5c023a,null))[_0xdfaf('0x3b')](handleError(_0x5c023a,null));}; \ No newline at end of file +var _0x13fe=['sendStatus','error','stack','name','params','model','keys','ChatProactiveAction','rawAttributes','query','intersection','fields','attributes','length','includeAll','include','merge','options','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then'];(function(_0x1f20c1,_0x350567){var _0x548c58=function(_0x54b7c5){while(--_0x54b7c5){_0x1f20c1['push'](_0x1f20c1['shift']());}};_0x548c58(++_0x350567);}(_0x13fe,0x138));var _0xe13f=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x13fe[_0xf50820];return _0x2a9b10;};'use strict';var emlformat=require(_0xe13f('0x0'));var rimraf=require(_0xe13f('0x1'));var zipdir=require(_0xe13f('0x2'));var jsonpatch=require(_0xe13f('0x3'));var rp=require(_0xe13f('0x4'));var moment=require(_0xe13f('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xe13f('0x6'));var util=require(_0xe13f('0x7'));var path=require(_0xe13f('0x8'));var sox=require(_0xe13f('0x9'));var csv=require(_0xe13f('0xa'));var ejs=require(_0xe13f('0xb'));var fs=require('fs');var fs_extra=require(_0xe13f('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xe13f('0xd'));var jsforce=require(_0xe13f('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe13f('0xf'));var Papa=require(_0xe13f('0x10'));var Redis=require('ioredis');var authService=require(_0xe13f('0x11'));var qs=require(_0xe13f('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe13f('0x13'))(_0xe13f('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe13f('0x15'));var db=require(_0xe13f('0x16'))['db'];function respondWithStatusCode(_0x183f22,_0x3ab7e4){_0x3ab7e4=_0x3ab7e4||0xcc;return function(_0x35d715){if(_0x35d715){return _0x183f22['sendStatus'](_0x3ab7e4);}return _0x183f22[_0xe13f('0x17')](_0x3ab7e4)[_0xe13f('0x18')]();};}function respondWithResult(_0x571787,_0x69222){_0x69222=_0x69222||0xc8;return function(_0x1bdde1){if(_0x1bdde1){return _0x571787['status'](_0x69222)[_0xe13f('0x19')](_0x1bdde1);}};}function respondWithFilteredResult(_0x44d6f8,_0x2f1f4f){return function(_0x474730){if(_0x474730){var _0x398c2e=typeof _0x2f1f4f[_0xe13f('0x1a')]==='undefined'&&typeof _0x2f1f4f[_0xe13f('0x1b')]==='undefined';var _0x11d180=_0x474730['count'];var _0x28770d=_0x398c2e?0x0:_0x2f1f4f['offset'];var _0x39852b=_0x398c2e?_0x474730[_0xe13f('0x1c')]:_0x2f1f4f[_0xe13f('0x1a')]+_0x2f1f4f[_0xe13f('0x1b')];var _0x32ba0e;if(_0x39852b>=_0x11d180){_0x39852b=_0x11d180;_0x32ba0e=0xc8;}else{_0x32ba0e=0xce;}_0x44d6f8[_0xe13f('0x17')](_0x32ba0e);return _0x44d6f8[_0xe13f('0x1d')](_0xe13f('0x1e'),_0x28770d+'-'+_0x39852b+'/'+_0x11d180)['json'](_0x474730);}return null;};}function patchUpdates(_0x48ea63){return function(_0x1519e4){try{jsonpatch[_0xe13f('0x1f')](_0x1519e4,_0x48ea63,!![]);}catch(_0x3ebf70){return BPromise[_0xe13f('0x20')](_0x3ebf70);}return _0x1519e4[_0xe13f('0x21')]();};}function saveUpdates(_0x612555,_0x199590){return function(_0x5c93da){if(_0x5c93da){return _0x5c93da[_0xe13f('0x22')](_0x612555)[_0xe13f('0x23')](function(_0x17ef1b){return _0x17ef1b;});}return null;};}function removeEntity(_0x45f6a2,_0x415adf){return function(_0x2ce943){if(_0x2ce943){return _0x2ce943['destroy']()[_0xe13f('0x23')](function(){_0x45f6a2[_0xe13f('0x17')](0xcc)[_0xe13f('0x18')]();});}};}function handleEntityNotFound(_0x37eff0,_0x547cd3){return function(_0x33a811){if(!_0x33a811){_0x37eff0[_0xe13f('0x24')](0x194);}return _0x33a811;};}function handleError(_0x5a66bb,_0x52d2c7){_0x52d2c7=_0x52d2c7||0x1f4;return function(_0x35d1f0){logger[_0xe13f('0x25')](_0x35d1f0[_0xe13f('0x26')]);if(_0x35d1f0[_0xe13f('0x27')]){delete _0x35d1f0[_0xe13f('0x27')];}_0x5a66bb[_0xe13f('0x17')](_0x52d2c7)['send'](_0x35d1f0);};}exports['show']=function(_0x578842,_0x1404d0){var _0x1b4f4f={'raw':!![],'where':{'id':_0x578842[_0xe13f('0x28')]['id']}},_0x1bf59c={};_0x1bf59c[_0xe13f('0x29')]=_[_0xe13f('0x2a')](db[_0xe13f('0x2b')][_0xe13f('0x2c')]);_0x1bf59c[_0xe13f('0x2d')]=_[_0xe13f('0x2a')](_0x578842[_0xe13f('0x2d')]);_0x1bf59c['filters']=_[_0xe13f('0x2e')](_0x1bf59c[_0xe13f('0x29')],_0x1bf59c[_0xe13f('0x2d')]);_0x1b4f4f['attributes']=_['intersection'](_0x1bf59c[_0xe13f('0x29')],qs[_0xe13f('0x2f')](_0x578842['query']['fields']));_0x1b4f4f[_0xe13f('0x30')]=_0x1b4f4f[_0xe13f('0x30')][_0xe13f('0x31')]?_0x1b4f4f['attributes']:_0x1bf59c[_0xe13f('0x29')];if(_0x578842[_0xe13f('0x2d')][_0xe13f('0x32')]){_0x1b4f4f[_0xe13f('0x33')]=[{'all':!![]}];}_0x1b4f4f=_[_0xe13f('0x34')]({},_0x1b4f4f,_0x578842[_0xe13f('0x35')]);return db[_0xe13f('0x2b')][_0xe13f('0x36')](_0x1b4f4f)['then'](handleEntityNotFound(_0x1404d0,null))['then'](respondWithResult(_0x1404d0,null))[_0xe13f('0x37')](handleError(_0x1404d0,null));};exports[_0xe13f('0x38')]=function(_0x525c42,_0x46be98){return db[_0xe13f('0x2b')][_0xe13f('0x38')](_0x525c42[_0xe13f('0x39')],{})[_0xe13f('0x23')](respondWithResult(_0x46be98,0xc9))[_0xe13f('0x37')](handleError(_0x46be98,null));};exports[_0xe13f('0x22')]=function(_0x4e1b20,_0x5d7075){if(_0x4e1b20[_0xe13f('0x39')]['id']){delete _0x4e1b20[_0xe13f('0x39')]['id'];}return db['ChatProactiveAction']['find']({'where':{'id':_0x4e1b20['params']['id']}})[_0xe13f('0x23')](handleEntityNotFound(_0x5d7075,null))[_0xe13f('0x23')](saveUpdates(_0x4e1b20[_0xe13f('0x39')],null))[_0xe13f('0x23')](respondWithResult(_0x5d7075,null))[_0xe13f('0x37')](handleError(_0x5d7075,null));};exports['destroy']=function(_0x30c810,_0xd5a895){return db[_0xe13f('0x2b')][_0xe13f('0x36')]({'where':{'id':_0x30c810[_0xe13f('0x28')]['id']}})['then'](handleEntityNotFound(_0xd5a895,null))[_0xe13f('0x23')](removeEntity(_0xd5a895,null))[_0xe13f('0x37')](handleError(_0xd5a895,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index a9ce88d..0fe9ea9 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 _0x11c2=['path','../../config/environment','./chatProactiveAction.attributes','exports','ChatProactiveAction','chat_proactive_actions','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x592eb6,_0x30d5d3){var _0x555e38=function(_0x1f906a){while(--_0x1f906a){_0x592eb6['push'](_0x592eb6['shift']());}};_0x555e38(++_0x30d5d3);}(_0x11c2,0x95));var _0x211c=function(_0x236393,_0x33600e){_0x236393=_0x236393-0x0;var _0x2a5427=_0x11c2[_0x236393];return _0x2a5427;};'use strict';var _=require(_0x211c('0x0'));var util=require('util');var logger=require(_0x211c('0x1'))('api');var moment=require(_0x211c('0x2'));var BPromise=require(_0x211c('0x3'));var rp=require(_0x211c('0x4'));var fs=require('fs');var path=require(_0x211c('0x5'));var rimraf=require('rimraf');var config=require(_0x211c('0x6'));var attributes=require(_0x211c('0x7'));module[_0x211c('0x8')]=function(_0x3b40ab,_0x41ad49){return _0x3b40ab['define'](_0x211c('0x9'),attributes,{'tableName':_0x211c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x740f=['path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','chat_proactive_actions','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x5cc8b9,_0x20e3c3){var _0x58892e=function(_0x87457a){while(--_0x87457a){_0x5cc8b9['push'](_0x5cc8b9['shift']());}};_0x58892e(++_0x20e3c3);}(_0x740f,0xd3));var _0xf740=function(_0x2f544e,_0x99c662){_0x2f544e=_0x2f544e-0x0;var _0x5d6eaa=_0x740f[_0x2f544e];return _0x5d6eaa;};'use strict';var _=require('lodash');var util=require(_0xf740('0x0'));var logger=require(_0xf740('0x1'))('api');var moment=require(_0xf740('0x2'));var BPromise=require(_0xf740('0x3'));var rp=require(_0xf740('0x4'));var fs=require('fs');var path=require(_0xf740('0x5'));var rimraf=require(_0xf740('0x6'));var config=require(_0xf740('0x7'));var attributes=require(_0xf740('0x8'));module[_0xf740('0x9')]=function(_0x5bd134,_0x5ed16e){return _0x5bd134[_0xf740('0xa')]('ChatProactiveAction',attributes,{'tableName':_0xf740('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 b9ffa7b..e5f7a2e 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 _0x43bf=['error','message','info','result','catch','lodash','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','code'];(function(_0x29d97e,_0x1e04df){var _0x520cfc=function(_0x168853){while(--_0x168853){_0x29d97e['push'](_0x29d97e['shift']());}};_0x520cfc(++_0x1e04df);}(_0x43bf,0x1be));var _0xf43b=function(_0x3f2b1f,_0x173e24){_0x3f2b1f=_0x3f2b1f-0x0;var _0x400016=_0x43bf[_0x3f2b1f];return _0x400016;};'use strict';var _=require(_0xf43b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf43b('0x1'));var rs=require(_0xf43b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf43b('0x3'));var logger=require(_0xf43b('0x4'))(_0xf43b('0x5'));var config=require(_0xf43b('0x6'));var jayson=require(_0xf43b('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3d66b6,_0x54c447,_0x487700){return new BPromise(function(_0x15bc89,_0x1ced81){return client[_0xf43b('0x8')](_0x3d66b6,_0x487700)[_0xf43b('0x9')](function(_0x3ba7c6){logger['info'](_0xf43b('0xa'),_0x54c447,_0xf43b('0xb'));logger[_0xf43b('0xc')](_0xf43b('0xd'),_0x54c447,_0xf43b('0xb'),JSON[_0xf43b('0xe')](_0x3ba7c6));if(_0x3ba7c6['error']){if(_0x3ba7c6['error'][_0xf43b('0xf')]===0x1f4){logger[_0xf43b('0x10')](_0xf43b('0xa'),_0x54c447,_0x3ba7c6[_0xf43b('0x10')][_0xf43b('0x11')]);return _0x1ced81(_0x3ba7c6[_0xf43b('0x10')][_0xf43b('0x11')]);}logger['error'](_0xf43b('0xa'),_0x54c447,_0x3ba7c6['error'][_0xf43b('0x11')]);return _0x15bc89(_0x3ba7c6[_0xf43b('0x10')][_0xf43b('0x11')]);}else{logger[_0xf43b('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x54c447,_0xf43b('0xb'));_0x15bc89(_0x3ba7c6[_0xf43b('0x13')]['message']);}})[_0xf43b('0x14')](function(_0x22bb9f){logger['error'](_0xf43b('0xa'),_0x54c447,_0x22bb9f);_0x1ced81(_0x22bb9f);});});} \ No newline at end of file +var _0x6f3c=['ChatProactiveAction,\x20%s,\x20%s','info','result','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','request\x20sent','stringify','error','code','message'];(function(_0x2e68e0,_0x4f1069){var _0x2b354c=function(_0x1486c7){while(--_0x1486c7){_0x2e68e0['push'](_0x2e68e0['shift']());}};_0x2b354c(++_0x4f1069);}(_0x6f3c,0x75));var _0xc6f3=function(_0x39fd9d,_0x4241f6){_0x39fd9d=_0x39fd9d-0x0;var _0x2b314b=_0x6f3c[_0x39fd9d];return _0x2b314b;};'use strict';var _=require('lodash');var util=require(_0xc6f3('0x0'));var moment=require(_0xc6f3('0x1'));var BPromise=require(_0xc6f3('0x2'));var rs=require(_0xc6f3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc6f3('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc6f3('0x5'))(_0xc6f3('0x6'));var config=require(_0xc6f3('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc6f3('0x8')][_0xc6f3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x25bd06,_0x2a4634,_0x2f3b63){return new BPromise(function(_0x2d0775,_0x1a3671){return client[_0xc6f3('0xa')](_0x25bd06,_0x2f3b63)['then'](function(_0x22091b){logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x2a4634,_0xc6f3('0xb'));logger['debug']('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x2a4634,'request\x20sent',JSON[_0xc6f3('0xc')](_0x22091b));if(_0x22091b[_0xc6f3('0xd')]){if(_0x22091b[_0xc6f3('0xd')][_0xc6f3('0xe')]===0x1f4){logger[_0xc6f3('0xd')]('ChatProactiveAction,\x20%s,\x20%s',_0x2a4634,_0x22091b[_0xc6f3('0xd')][_0xc6f3('0xf')]);return _0x1a3671(_0x22091b[_0xc6f3('0xd')][_0xc6f3('0xf')]);}logger[_0xc6f3('0xd')](_0xc6f3('0x10'),_0x2a4634,_0x22091b[_0xc6f3('0xd')][_0xc6f3('0xf')]);return _0x2d0775(_0x22091b[_0xc6f3('0xd')][_0xc6f3('0xf')]);}else{logger[_0xc6f3('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x2a4634,_0xc6f3('0xb'));_0x2d0775(_0x22091b[_0xc6f3('0x12')][_0xc6f3('0xf')]);}})['catch'](function(_0x42ffd1){logger[_0xc6f3('0xd')](_0xc6f3('0x10'),_0x2a4634,_0x42ffd1);_0x1a3671(_0x42ffd1);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index f0d852f..4969879 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 _0xf2ca=['show','create','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated'];(function(_0xc5c634,_0xbc5adf){var _0x3b36c0=function(_0x11a6ef){while(--_0x11a6ef){_0xc5c634['push'](_0xc5c634['shift']());}};_0x3b36c0(++_0xbc5adf);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x29d849,_0x209ceb){_0x29d849=_0x29d849-0x0;var _0x30b104=_0xf2ca[_0x29d849];return _0x30b104;};'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 fs_extra=require(_0xaf2c('0x5'));var auth=require(_0xaf2c('0x6'));var interaction=require(_0xaf2c('0x7'));var config=require(_0xaf2c('0x8'));var controller=require('./chatProactiveAction.controller');router[_0xaf2c('0x9')](_0xaf2c('0xa'),auth[_0xaf2c('0xb')](),controller[_0xaf2c('0xc')]);router['post']('/',auth[_0xaf2c('0xb')](),controller[_0xaf2c('0xd')]);router['put'](_0xaf2c('0xa'),auth['isAuthenticated'](),controller[_0xaf2c('0xe')]);router['delete'](_0xaf2c('0xa'),auth[_0xaf2c('0xb')](),controller[_0xaf2c('0xf')]);module[_0xaf2c('0x10')]=router; \ No newline at end of file +var _0x5fd1=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','post','create','put','update','multer','path','connect-timeout','express'];(function(_0x28ebdb,_0x4c8bc1){var _0x41ff03=function(_0x26701e){while(--_0x26701e){_0x28ebdb['push'](_0x28ebdb['shift']());}};_0x41ff03(++_0x4c8bc1);}(_0x5fd1,0x155));var _0x15fd=function(_0x4c131d,_0x4b88bf){_0x4c131d=_0x4c131d-0x0;var _0x171834=_0x5fd1[_0x4c131d];return _0x171834;};'use strict';var multer=require(_0x15fd('0x0'));var util=require('util');var path=require(_0x15fd('0x1'));var timeout=require(_0x15fd('0x2'));var express=require(_0x15fd('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x15fd('0x4'));var interaction=require(_0x15fd('0x5'));var config=require(_0x15fd('0x6'));var controller=require('./chatProactiveAction.controller');router[_0x15fd('0x7')](_0x15fd('0x8'),auth[_0x15fd('0x9')](),controller[_0x15fd('0xa')]);router[_0x15fd('0xb')]('/',auth['isAuthenticated'](),controller[_0x15fd('0xc')]);router[_0x15fd('0xd')](_0x15fd('0x8'),auth['isAuthenticated'](),controller[_0x15fd('0xe')]);router['delete'](_0x15fd('0x8'),auth[_0x15fd('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 3588a94..eaa2765 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 _0xd1bf=['roundrobin','sequelize','exports','STRING','name','INTEGER','rrmemory','beepall'];(function(_0x4f5827,_0x460486){var _0x5cf408=function(_0x37d335){while(--_0x37d335){_0x4f5827['push'](_0x4f5827['shift']());}};_0x5cf408(++_0x460486);}(_0xd1bf,0xa9));var _0xfd1b=function(_0x375c59,_0x4f6aa5){_0x375c59=_0x375c59-0x0;var _0x34aaae=_0xd1bf[_0x375c59];return _0x34aaae;};'use strict';var Sequelize=require(_0xfd1b('0x0'));module[_0xfd1b('0x1')]={'name':{'type':Sequelize[_0xfd1b('0x2')],'unique':_0xfd1b('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xfd1b('0x2')]},'timeout':{'type':Sequelize[_0xfd1b('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xfd1b('0x5'),_0xfd1b('0x6'),_0xfd1b('0x7'))}}; \ No newline at end of file +var _0xc7ba=['exports','STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize'];(function(_0x42c067,_0x14fd27){var _0x1ce401=function(_0x293eb5){while(--_0x293eb5){_0x42c067['push'](_0x42c067['shift']());}};_0x1ce401(++_0x14fd27);}(_0xc7ba,0x67));var _0xac7b=function(_0x442cda,_0x774c57){_0x442cda=_0x442cda-0x0;var _0xf392f6=_0xc7ba[_0x442cda];return _0xf392f6;};'use strict';var Sequelize=require(_0xac7b('0x0'));module[_0xac7b('0x1')]={'name':{'type':Sequelize[_0xac7b('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xac7b('0x2')]},'timeout':{'type':Sequelize[_0xac7b('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xac7b('0x4')](_0xac7b('0x5'),_0xac7b('0x6'),_0xac7b('0x7'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 04a6043..36b04df 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 _0x98a4=['Content-Range','apply','reject','save','get','UserProfileResource','name','send','index','map','ChatQueue','rawAttributes','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatQueues','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','destroy','describe','findOne','ChatQueueId','UserChatQueue','findAll','User','agent','chatPause','createdAt','%s/%s','updatedAt','getTeams','Team','addTeams','ids','voicePause','flatMap','sequelize','transaction','each','findOrCreate','emit','userChatQueue:save','removeTeams','Agents','select','field','tq.TeamId','user_has_teams','clone','ut.UserId\x20=\x20?','push','QueryTypes','TeamId','includes','all','union','compact','value','isEmpty','forEach','addAgents','omit','spread','removeAgents','isArray','userChatQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','client','http','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','sendStatus','status','end','json','offset','undefined','limit','count'];(function(_0xc3a71f,_0x54fe71){var _0x46a474=function(_0x47e601){while(--_0x47e601){_0xc3a71f['push'](_0xc3a71f['shift']());}};_0x46a474(++_0x54fe71);}(_0x98a4,0xf6));var _0x498a=function(_0x41c3a7,_0x181c60){_0x41c3a7=_0x41c3a7-0x0;var _0x4869b4=_0x98a4[_0x41c3a7];return _0x4869b4;};'use strict';var emlformat=require(_0x498a('0x0'));var rimraf=require(_0x498a('0x1'));var zipdir=require(_0x498a('0x2'));var jsonpatch=require(_0x498a('0x3'));var rp=require(_0x498a('0x4'));var moment=require(_0x498a('0x5'));var BPromise=require(_0x498a('0x6'));var Mustache=require('mustache');var util=require(_0x498a('0x7'));var path=require(_0x498a('0x8'));var sox=require(_0x498a('0x9'));var csv=require(_0x498a('0xa'));var ejs=require(_0x498a('0xb'));var fs=require('fs');var fs_extra=require(_0x498a('0xc'));var _=require(_0x498a('0xd'));var squel=require('squel');var crypto=require(_0x498a('0xe'));var jsforce=require(_0x498a('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x498a('0xa'));var querystring=require(_0x498a('0x10'));var Papa=require('papaparse');var Redis=require(_0x498a('0x11'));var authService=require(_0x498a('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x498a('0x13'));var hardwareService=require(_0x498a('0x14'));var logger=require(_0x498a('0x15'))('api');var utils=require(_0x498a('0x16'));var config=require(_0x498a('0x17'));var licenseUtil=require(_0x498a('0x18'));var db=require('../../mysqldb')['db'];config[_0x498a('0x19')]=_[_0x498a('0x1a')](config[_0x498a('0x19')],{'host':_0x498a('0x1b'),'port':0x18eb});var socket=require(_0x498a('0x1c'))(new Redis(config[_0x498a('0x19')]));require(_0x498a('0x1d'))[_0x498a('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0x498a('0x1f')][_0x498a('0x20')]({'port':0x232a});function respondWithRpcPromise(_0xf69e33,_0x4a6fe0,_0x3aede3,_0x47a6ca){return new BPromise(function(_0x3fe1b5,_0x271d09){var _0x2aefeb=_0x47a6ca||client;return _0x2aefeb['request'](_0xf69e33,_0x3aede3)[_0x498a('0x21')](function(_0xb0df8d){logger['info'](_0x498a('0x22'),_0x4a6fe0,_0x498a('0x23'));logger[_0x498a('0x24')](_0x498a('0x25'),_0x4a6fe0,_0x498a('0x23'),JSON[_0x498a('0x26')](_0xb0df8d));if(_0xb0df8d[_0x498a('0x27')]){if(_0xb0df8d[_0x498a('0x27')][_0x498a('0x28')]===0x1f4){logger[_0x498a('0x27')](_0x498a('0x22'),_0x4a6fe0,_0xb0df8d['error'][_0x498a('0x29')]);return _0x271d09(_0xb0df8d['error'][_0x498a('0x29')]);}logger[_0x498a('0x27')](_0x498a('0x22'),_0x4a6fe0,_0xb0df8d[_0x498a('0x27')][_0x498a('0x29')]);return _0x3fe1b5(_0xb0df8d[_0x498a('0x27')]['message']);}else{logger[_0x498a('0x2a')](_0x498a('0x22'),_0x4a6fe0,_0x498a('0x23'));_0x3fe1b5(_0xb0df8d['result'][_0x498a('0x29')]);}})[_0x498a('0x2b')](function(_0x1dca2f){logger[_0x498a('0x27')](_0x498a('0x22'),_0x4a6fe0,_0x1dca2f);_0x271d09(_0x1dca2f);});});}function respondWithStatusCode(_0x4a4f5c,_0x583a56){_0x583a56=_0x583a56||0xcc;return function(_0x185798){if(_0x185798){return _0x4a4f5c[_0x498a('0x2c')](_0x583a56);}return _0x4a4f5c[_0x498a('0x2d')](_0x583a56)[_0x498a('0x2e')]();};}function respondWithResult(_0x4848bb,_0x30c49c){_0x30c49c=_0x30c49c||0xc8;return function(_0x546d41){if(_0x546d41){return _0x4848bb[_0x498a('0x2d')](_0x30c49c)[_0x498a('0x2f')](_0x546d41);}};}function respondWithFilteredResult(_0x2e009f,_0x3cc943){return function(_0x512df5){if(_0x512df5){var _0x4f9b6b=typeof _0x3cc943[_0x498a('0x30')]===_0x498a('0x31')&&typeof _0x3cc943[_0x498a('0x32')]==='undefined';var _0x5d19cc=_0x512df5['count'];var _0xeac4b9=_0x4f9b6b?0x0:_0x3cc943[_0x498a('0x30')];var _0x36c484=_0x4f9b6b?_0x512df5[_0x498a('0x33')]:_0x3cc943[_0x498a('0x30')]+_0x3cc943['limit'];var _0x2814e3;if(_0x36c484>=_0x5d19cc){_0x36c484=_0x5d19cc;_0x2814e3=0xc8;}else{_0x2814e3=0xce;}_0x2e009f[_0x498a('0x2d')](_0x2814e3);return _0x2e009f['set'](_0x498a('0x34'),_0xeac4b9+'-'+_0x36c484+'/'+_0x5d19cc)[_0x498a('0x2f')](_0x512df5);}return null;};}function patchUpdates(_0x510908){return function(_0xc49836){try{jsonpatch[_0x498a('0x35')](_0xc49836,_0x510908,!![]);}catch(_0x364753){return BPromise[_0x498a('0x36')](_0x364753);}return _0xc49836[_0x498a('0x37')]();};}function saveUpdates(_0x243e6e,_0x4e6426){return function(_0x2e5733){if(_0x2e5733){return _0x2e5733['update'](_0x243e6e)[_0x498a('0x21')](function(_0xc15cb3){return _0xc15cb3;});}return null;};}function removeEntity(_0x5116e2,_0xbdc6ff){return function(_0x4df537){if(_0x4df537){return _0x4df537['destroy']()[_0x498a('0x21')](function(){var _0x268239=_0x4df537[_0x498a('0x38')]({'plain':!![]});var _0x37c0b9='ChatQueues';return db[_0x498a('0x39')]['destroy']({'where':{'type':_0x37c0b9,'resourceId':_0x268239['id']}})['then'](function(){return _0x4df537;});})[_0x498a('0x21')](function(){_0x5116e2['status'](0xcc)[_0x498a('0x2e')]();});}};}function handleEntityNotFound(_0x38a6c8,_0x3d4645){return function(_0x8d0058){if(!_0x8d0058){_0x38a6c8[_0x498a('0x2c')](0x194);}return _0x8d0058;};}function handleError(_0xafd865,_0x511564){_0x511564=_0x511564||0x1f4;return function(_0x11cf51){logger[_0x498a('0x27')](_0x11cf51['stack']);if(_0x11cf51[_0x498a('0x3a')]){delete _0x11cf51['name'];}_0xafd865[_0x498a('0x2d')](_0x511564)[_0x498a('0x3b')](_0x11cf51);};}exports[_0x498a('0x3c')]=function(_0x398d9b,_0xc06e78){var _0x86bb7b={},_0x8f6a0b={},_0x3cbbd3={'count':0x0,'rows':[]};var _0x593f50=_[_0x498a('0x3d')](db[_0x498a('0x3e')][_0x498a('0x3f')],function(_0x454fc3){return{'name':_0x454fc3['fieldName'],'type':_0x454fc3['type'][_0x498a('0x40')]};});_0x8f6a0b[_0x498a('0x41')]=_[_0x498a('0x3d')](_0x593f50,_0x498a('0x3a'));_0x8f6a0b['query']=_[_0x498a('0x42')](_0x398d9b[_0x498a('0x43')]);_0x8f6a0b[_0x498a('0x44')]=_['intersection'](_0x8f6a0b[_0x498a('0x41')],_0x8f6a0b[_0x498a('0x43')]);_0x86bb7b[_0x498a('0x45')]=_[_0x498a('0x46')](_0x8f6a0b[_0x498a('0x41')],qs[_0x498a('0x47')](_0x398d9b[_0x498a('0x43')]['fields']));_0x86bb7b[_0x498a('0x45')]=_0x86bb7b[_0x498a('0x45')][_0x498a('0x48')]?_0x86bb7b[_0x498a('0x45')]:_0x8f6a0b[_0x498a('0x41')];if(!_0x398d9b[_0x498a('0x43')][_0x498a('0x49')](_0x498a('0x4a'))){_0x86bb7b['limit']=qs[_0x498a('0x32')](_0x398d9b['query'][_0x498a('0x32')]);_0x86bb7b['offset']=qs['offset'](_0x398d9b['query'][_0x498a('0x30')]);}_0x86bb7b[_0x498a('0x4b')]=qs['sort'](_0x398d9b[_0x498a('0x43')][_0x498a('0x4c')]);_0x86bb7b[_0x498a('0x4d')]=qs[_0x498a('0x44')](_[_0x498a('0x4e')](_0x398d9b['query'],_0x8f6a0b[_0x498a('0x44')]),_0x593f50);if(_0x398d9b[_0x498a('0x43')][_0x498a('0x4f')]){_0x86bb7b[_0x498a('0x4d')]=_[_0x498a('0x50')](_0x86bb7b[_0x498a('0x4d')],{'$or':_[_0x498a('0x3d')](_0x593f50,function(_0x468cc8){if(_0x468cc8[_0x498a('0x51')]!==_0x498a('0x52')){var _0x37fb32={};_0x37fb32[_0x468cc8['name']]={'$like':'%'+_0x398d9b[_0x498a('0x43')][_0x498a('0x4f')]+'%'};return _0x37fb32;}})});}_0x86bb7b=_[_0x498a('0x50')]({},_0x86bb7b,_0x398d9b[_0x498a('0x53')]);var _0x2d71ec={'where':_0x86bb7b[_0x498a('0x4d')]};return db['ChatQueue']['count'](_0x2d71ec)['then'](function(_0x12db37){_0x3cbbd3[_0x498a('0x33')]=_0x12db37;if(_0x398d9b[_0x498a('0x43')][_0x498a('0x54')]){_0x86bb7b[_0x498a('0x55')]=[{'all':!![]}];}return db['ChatQueue']['findAll'](_0x86bb7b);})['then'](function(_0x4ec0b9){_0x3cbbd3[_0x498a('0x56')]=_0x4ec0b9;return _0x3cbbd3;})[_0x498a('0x21')](respondWithFilteredResult(_0xc06e78,_0x86bb7b))[_0x498a('0x2b')](handleError(_0xc06e78,null));};exports[_0x498a('0x57')]=function(_0x4b20c3,_0x25ea45){var _0x5c67ed={'raw':!![],'where':{'id':_0x4b20c3[_0x498a('0x58')]['id']}},_0x27a0e7={};_0x27a0e7[_0x498a('0x41')]=_['keys'](db[_0x498a('0x3e')][_0x498a('0x3f')]);_0x27a0e7['query']=_[_0x498a('0x42')](_0x4b20c3[_0x498a('0x43')]);_0x27a0e7['filters']=_[_0x498a('0x46')](_0x27a0e7[_0x498a('0x41')],_0x27a0e7[_0x498a('0x43')]);_0x5c67ed[_0x498a('0x45')]=_[_0x498a('0x46')](_0x27a0e7[_0x498a('0x41')],qs[_0x498a('0x47')](_0x4b20c3[_0x498a('0x43')][_0x498a('0x47')]));_0x5c67ed[_0x498a('0x45')]=_0x5c67ed['attributes']['length']?_0x5c67ed[_0x498a('0x45')]:_0x27a0e7[_0x498a('0x41')];if(_0x4b20c3[_0x498a('0x43')][_0x498a('0x54')]){_0x5c67ed[_0x498a('0x55')]=[{'all':!![]}];}_0x5c67ed=_['merge']({},_0x5c67ed,_0x4b20c3[_0x498a('0x53')]);return db[_0x498a('0x3e')]['find'](_0x5c67ed)[_0x498a('0x21')](handleEntityNotFound(_0x25ea45,null))[_0x498a('0x21')](respondWithResult(_0x25ea45,null))[_0x498a('0x2b')](handleError(_0x25ea45,null));};exports['create']=function(_0x305e0a,_0x5a5120){return db[_0x498a('0x3e')][_0x498a('0x59')](_0x305e0a[_0x498a('0x5a')],{})[_0x498a('0x21')](function(_0x4607d4){var _0x1b0acd=_0x305e0a[_0x498a('0x5b')][_0x498a('0x38')]({'plain':!![]});if(!_0x1b0acd)throw new Error(_0x498a('0x5c'));if(_0x1b0acd[_0x498a('0x5d')]===_0x498a('0x5b')){var _0xa8023b=_0x4607d4[_0x498a('0x38')]({'plain':!![]});var _0x3bc7e6=_0x498a('0x5e');return db['UserProfileSection']['find']({'where':{'name':_0x3bc7e6,'userProfileId':_0x1b0acd[_0x498a('0x5f')]},'raw':!![]})[_0x498a('0x21')](function(_0x21107a){if(_0x21107a&&_0x21107a[_0x498a('0x60')]===0x0){return db[_0x498a('0x39')][_0x498a('0x59')]({'name':_0xa8023b['name'],'resourceId':_0xa8023b['id'],'type':_0x21107a[_0x498a('0x3a')],'sectionId':_0x21107a['id']},{})['then'](function(){return _0x4607d4;});}else{return _0x4607d4;}})[_0x498a('0x2b')](function(_0x1369e8){logger[_0x498a('0x27')](_0x498a('0x61'),_0x1369e8);throw _0x1369e8;});}return _0x4607d4;})[_0x498a('0x21')](respondWithResult(_0x5a5120,0xc9))[_0x498a('0x2b')](handleError(_0x5a5120,null));};exports[_0x498a('0x62')]=function(_0x15c79e,_0x182ea1){if(_0x15c79e[_0x498a('0x5a')]['id']){delete _0x15c79e[_0x498a('0x5a')]['id'];}return db[_0x498a('0x3e')][_0x498a('0x63')]({'where':{'id':_0x15c79e['params']['id']}})['then'](handleEntityNotFound(_0x182ea1,null))[_0x498a('0x21')](saveUpdates(_0x15c79e[_0x498a('0x5a')],null))['then'](respondWithResult(_0x182ea1,null))[_0x498a('0x2b')](handleError(_0x182ea1,null));};exports[_0x498a('0x64')]=function(_0x1592a8,_0x570cf2){return db[_0x498a('0x3e')][_0x498a('0x63')]({'where':{'id':_0x1592a8[_0x498a('0x58')]['id']}})[_0x498a('0x21')](handleEntityNotFound(_0x570cf2,null))[_0x498a('0x21')](removeEntity(_0x570cf2,null))[_0x498a('0x2b')](handleError(_0x570cf2,null));};exports[_0x498a('0x65')]=function(_0xb8ff9,_0x43b7a9){return db[_0x498a('0x3e')]['describe']()['then'](respondWithResult(_0x43b7a9,null))[_0x498a('0x2b')](handleError(_0x43b7a9,null));};exports['getMembers']=function(_0x161e35,_0x23bdc8,_0x5d167e){var _0x36fae6={'raw':!![],'where':{}},_0x1e3d5a={},_0x470a72;return db[_0x498a('0x3e')][_0x498a('0x66')]({'where':{'id':_0x161e35[_0x498a('0x58')]['id']}})[_0x498a('0x21')](handleEntityNotFound(_0x23bdc8,null))[_0x498a('0x21')](function(_0x2982df){if(_0x2982df){_0x470a72=_0x2982df['get']({'plain':!![]});_0x1e3d5a['model']=_[_0x498a('0x42')](db['UserChatQueue']['rawAttributes']);_0x1e3d5a[_0x498a('0x43')]=_[_0x498a('0x42')](_0x161e35[_0x498a('0x43')]);_0x1e3d5a[_0x498a('0x44')]=_[_0x498a('0x46')](_0x1e3d5a[_0x498a('0x41')],_0x1e3d5a['query']);_0x36fae6[_0x498a('0x45')]=_['intersection'](_0x1e3d5a[_0x498a('0x41')],qs[_0x498a('0x47')](_0x161e35[_0x498a('0x43')]['fields']));_0x36fae6['attributes']=_0x36fae6[_0x498a('0x45')]['length']?_0x36fae6[_0x498a('0x45')]:_0x1e3d5a['model'];if(!_0x161e35['query'][_0x498a('0x49')](_0x498a('0x4a'))){_0x36fae6['limit']=qs['limit'](_0x161e35[_0x498a('0x43')]['limit']);_0x36fae6[_0x498a('0x30')]=qs['offset'](_0x161e35[_0x498a('0x43')][_0x498a('0x30')]);}_0x36fae6[_0x498a('0x4b')]=qs[_0x498a('0x4c')](_0x161e35[_0x498a('0x43')][_0x498a('0x4c')]);_0x36fae6[_0x498a('0x4d')]=qs[_0x498a('0x44')](_[_0x498a('0x4e')](_0x161e35[_0x498a('0x43')],_0x1e3d5a[_0x498a('0x44')]));_0x36fae6[_0x498a('0x4d')][_0x498a('0x67')]=_0x2982df['id'];if(_0x161e35['query']['filter']){_0x36fae6['where']=_[_0x498a('0x50')](_0x36fae6[_0x498a('0x4d')],{'$or':_['map'](_0x36fae6[_0x498a('0x45')],function(_0x58c531){var _0x40049b={};_0x40049b[_0x58c531]={'$like':'%'+_0x161e35[_0x498a('0x43')][_0x498a('0x4f')]+'%'};return _0x40049b;})});}_0x36fae6=_[_0x498a('0x50')]({},_0x36fae6,_0x161e35[_0x498a('0x53')]);return db[_0x498a('0x68')][_0x498a('0x69')](_0x36fae6);}})[_0x498a('0x21')](function(_0x41d082){if(_0x41d082){return db[_0x498a('0x6a')]['findAndCountAll']({'where':{'id':_[_0x498a('0x3d')](_0x41d082,'UserId'),'role':_0x498a('0x6b')},'attributes':['id',_0x498a('0x3a'),_0x498a('0x6c'),'updatedAt',_0x498a('0x6d')]});}})[_0x498a('0x21')](function(_0x3329da){if(_0x3329da){return{'count':_0x3329da[_0x498a('0x33')],'rows':_['map'](_0x3329da[_0x498a('0x56')],function(_0x2449ef){return{'membername':_0x2449ef[_0x498a('0x3a')],'UserId':_0x2449ef['id'],'queue_name':_0x470a72['name'],'ChatQueueId':_0x470a72['id'],'interface':util['format'](_0x498a('0x6e'),'SIP',_0x2449ef[_0x498a('0x3a')]),'penalty':0x0,'paused':_0x2449ef[_0x498a('0x6c')],'createdAt':_0x2449ef[_0x498a('0x6d')],'updatedAt':_0x2449ef[_0x498a('0x6f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x498a('0x21')](respondWithFilteredResult(_0x23bdc8,_0x36fae6))[_0x498a('0x2b')](handleError(_0x23bdc8,null));};exports[_0x498a('0x70')]=function(_0x3ac777,_0x51f922,_0x50c61e){var _0x296b47={};var _0x49af52={};var _0xe5418c;var _0x1e23f4;return db[_0x498a('0x3e')][_0x498a('0x66')]({'where':{'id':_0x3ac777['params']['id']}})[_0x498a('0x21')](handleEntityNotFound(_0x51f922,null))[_0x498a('0x21')](function(_0x232c36){if(_0x232c36){_0xe5418c=_0x232c36;_0x49af52[_0x498a('0x41')]=_[_0x498a('0x42')](db[_0x498a('0x71')][_0x498a('0x3f')]);_0x49af52[_0x498a('0x43')]=_[_0x498a('0x42')](_0x3ac777[_0x498a('0x43')]);_0x49af52['filters']=_[_0x498a('0x46')](_0x49af52[_0x498a('0x41')],_0x49af52[_0x498a('0x43')]);_0x296b47[_0x498a('0x45')]=_['intersection'](_0x49af52[_0x498a('0x41')],qs[_0x498a('0x47')](_0x3ac777[_0x498a('0x43')]['fields']));_0x296b47[_0x498a('0x45')]=_0x296b47[_0x498a('0x45')][_0x498a('0x48')]?_0x296b47['attributes']:_0x49af52[_0x498a('0x41')];_0x296b47[_0x498a('0x4b')]=qs['sort'](_0x3ac777['query']['sort']);_0x296b47['where']=qs[_0x498a('0x44')](_[_0x498a('0x4e')](_0x3ac777[_0x498a('0x43')],_0x49af52['filters']));if(_0x3ac777['query']['filter']){_0x296b47[_0x498a('0x4d')]=_[_0x498a('0x50')](_0x296b47['where'],{'$or':_[_0x498a('0x3d')](_0x296b47['attributes'],function(_0x30a846){var _0x97af59={};_0x97af59[_0x30a846]={'$like':'%'+_0x3ac777[_0x498a('0x43')][_0x498a('0x4f')]+'%'};return _0x97af59;})});}_0x296b47=_[_0x498a('0x50')]({},_0x296b47,_0x3ac777[_0x498a('0x53')]);return _0xe5418c[_0x498a('0x70')](_0x296b47);}})[_0x498a('0x21')](function(_0x4ebc9b){if(_0x4ebc9b){_0x1e23f4=_0x4ebc9b[_0x498a('0x48')];if(!_0x3ac777['query']['hasOwnProperty'](_0x498a('0x4a'))){_0x296b47[_0x498a('0x32')]=qs[_0x498a('0x32')](_0x3ac777[_0x498a('0x43')][_0x498a('0x32')]);_0x296b47[_0x498a('0x30')]=qs[_0x498a('0x30')](_0x3ac777[_0x498a('0x43')]['offset']);}return _0xe5418c[_0x498a('0x70')](_0x296b47);}})[_0x498a('0x21')](function(_0x2f2708){if(_0x2f2708){return _0x2f2708?{'count':_0x1e23f4,'rows':_0x2f2708}:null;}})['then'](respondWithResult(_0x51f922,null))[_0x498a('0x2b')](handleError(_0x51f922,null));};exports[_0x498a('0x72')]=function(_0x1aca56,_0x21b8f5,_0x1b0d94){var _0x3b665f=_0x1aca56[_0x498a('0x5a')][_0x498a('0x73')];return db[_0x498a('0x71')][_0x498a('0x69')]({'where':{'id':_0x3b665f},'attributes':['id'],'include':[{'model':db[_0x498a('0x6a')],'as':'Agents','attributes':['id','name','online',_0x498a('0x74'),'interface'],'raw':!![]}]})[_0x498a('0x21')](function(_0x53efb9){if(_0x53efb9){var _0x338651=_[_0x498a('0x75')](_0x53efb9,function(_0x24ed7c){var _0x33f6f3=_0x24ed7c[_0x498a('0x38')]({'plain':!![]});return _0x33f6f3['Agents'];});return db[_0x498a('0x3e')][_0x498a('0x63')]({'where':{'id':_0x1aca56[_0x498a('0x58')]['id']}})['then'](function(_0x1ddcce){return db[_0x498a('0x76')][_0x498a('0x77')](function(_0x586ee0){return _0x1ddcce[_0x498a('0x72')](_0x3b665f,{'transaction':_0x586ee0})[_0x498a('0x21')](function(){return BPromise[_0x498a('0x78')](_0x338651,function(_0x35f63e){return db['UserChatQueue'][_0x498a('0x79')]({'where':{'UserId':_0x35f63e['id'],'ChatQueueId':_0x1aca56['params']['id']},'transaction':_0x586ee0});});})[_0x498a('0x21')](function(){_0x338651['forEach'](function(_0x1b0a5a){socket[_0x498a('0x7a')](_0x498a('0x7b'),{'UserId':_0x1b0a5a['id'],'ChatQueueId':_0x1ddcce['id']});});});});});}})[_0x498a('0x21')](respondWithStatusCode(_0x21b8f5,null))[_0x498a('0x2b')](handleError(_0x21b8f5,null));};exports[_0x498a('0x7c')]=function(_0x3d6320,_0x264e63,_0x34502c){return db[_0x498a('0x71')][_0x498a('0x69')]({'where':{'id':_0x3d6320['query'][_0x498a('0x73')]},'attributes':['id'],'include':[{'model':db[_0x498a('0x6a')],'as':_0x498a('0x7d'),'attributes':['id'],'raw':!![]}]})[_0x498a('0x21')](handleEntityNotFound(_0x264e63,null))[_0x498a('0x21')](function(_0x3df357){var _0x79ec0f=_[_0x498a('0x3d')](_0x3df357,'id');var _0x25b9c0=[];var _0x16fcea=[];var _0x412d5c=squel[_0x498a('0x7e')]();_0x412d5c[_0x498a('0x7f')](_0x498a('0x80'))['from']('team_has_chat_queues','tq')['join'](_0x498a('0x81'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x498a('0x4d')]('ChatQueueId\x20=\x20?',_0x3d6320[_0x498a('0x58')]['id']);for(var _0x1dc801=0x0;_0x1dc801<_0x3df357[_0x498a('0x48')];_0x1dc801+=0x1){let _0x2119e3=_0x3df357[_0x1dc801];for(var _0x3c3be5=0x0;_0x3c3be5<_0x2119e3[_0x498a('0x7d')][_0x498a('0x48')];_0x3c3be5+=0x1){let _0x354226=_0x2119e3[_0x498a('0x7d')][_0x3c3be5];var _0x2ac02f=_0x412d5c[_0x498a('0x82')]();_0x2ac02f['where'](_0x498a('0x83'),_0x354226['id']);_0x16fcea[_0x498a('0x84')](db[_0x498a('0x76')][_0x498a('0x43')](_0x2ac02f['toString'](),{'type':db[_0x498a('0x76')][_0x498a('0x85')]['SELECT']})[_0x498a('0x21')](function(_0x3eb300){if(_0x3eb300[_0x498a('0x48')]===0x1){return _0x354226['id'];}else{var _0x3b7519=_['every'](_[_0x498a('0x3d')](_0x3eb300,_0x498a('0x86')),function(_0x1b1afc){return _[_0x498a('0x87')](_0x79ec0f,_0x1b1afc);});if(_0x3b7519){return _0x354226['id'];}}}));}}return BPromise[_0x498a('0x88')](_0x16fcea)[_0x498a('0x21')](function(_0xd2ebe7){_0x25b9c0=_(_0x25b9c0)[_0x498a('0x89')](_0xd2ebe7)[_0x498a('0x8a')]()[_0x498a('0x8b')]();return db['ChatQueue'][_0x498a('0x63')]({'where':{'id':_0x3d6320[_0x498a('0x58')]['id']}})[_0x498a('0x21')](function(_0xc59c6e){return db[_0x498a('0x76')][_0x498a('0x77')](function(_0x466c25){return _0xc59c6e[_0x498a('0x7c')](_0x3d6320['query'][_0x498a('0x73')],{'transaction':_0x466c25})[_0x498a('0x21')](function(){if(!_[_0x498a('0x8c')](_0x25b9c0)){return _0xc59c6e['removeAgents'](_0x25b9c0,{'transaction':_0x466c25});}})[_0x498a('0x21')](function(){_0x25b9c0[_0x498a('0x8d')](function(_0x407ef9){socket[_0x498a('0x7a')]('userChatQueue:remove',{'UserId':_0x407ef9,'ChatQueueId':_0xc59c6e['id']});});});});});});})[_0x498a('0x21')](respondWithStatusCode(_0x264e63,null))['catch'](handleError(_0x264e63,null));};exports[_0x498a('0x8e')]=function(_0x1c1b3a,_0x4c6adf,_0x385735){return db[_0x498a('0x3e')]['find']({'where':{'id':_0x1c1b3a[_0x498a('0x58')]['id']}})[_0x498a('0x21')](handleEntityNotFound(_0x4c6adf,null))['then'](function(_0x1d2105){if(_0x1d2105){return _0x1d2105[_0x498a('0x8e')](_0x1c1b3a['body'][_0x498a('0x73')],_[_0x498a('0x8f')](_0x1c1b3a[_0x498a('0x5a')],[_0x498a('0x73'),'id'])||{})[_0x498a('0x90')](function(_0x2830c1){for(var _0x2b52c6=0x0;_0x2b52c6<_0x1c1b3a[_0x498a('0x5a')]['ids']['length'];_0x2b52c6+=0x1){socket['emit'](_0x498a('0x7b'),{'UserId':Number(_0x1c1b3a[_0x498a('0x5a')][_0x498a('0x73')][_0x2b52c6]),'ChatQueueId':Number(_0x1c1b3a[_0x498a('0x58')]['id'])});}return _0x2830c1;});}})[_0x498a('0x21')](respondWithResult(_0x4c6adf,null))[_0x498a('0x2b')](handleError(_0x4c6adf,null));};exports[_0x498a('0x91')]=function(_0x25c60c,_0x642dfe,_0x51ac41){return db[_0x498a('0x3e')][_0x498a('0x63')]({'where':{'id':_0x25c60c[_0x498a('0x58')]['id']}})[_0x498a('0x21')](handleEntityNotFound(_0x642dfe,null))['then'](function(_0x392dd8){if(_0x392dd8){return _0x392dd8[_0x498a('0x91')](_0x25c60c[_0x498a('0x43')]['ids'])[_0x498a('0x21')](function(){if(_[_0x498a('0x92')](_0x25c60c[_0x498a('0x43')]['ids'])){for(var _0x319aba=0x0;_0x319aba<_0x25c60c[_0x498a('0x43')][_0x498a('0x73')]['length'];_0x319aba+=0x1){socket[_0x498a('0x7a')](_0x498a('0x93'),{'UserId':Number(_0x25c60c[_0x498a('0x43')]['ids'][_0x319aba]),'ChatQueueId':Number(_0x25c60c['params']['id'])});}}else{socket[_0x498a('0x7a')](_0x498a('0x93'),{'UserId':Number(_0x25c60c['query']['ids']),'ChatQueueId':Number(_0x25c60c[_0x498a('0x58')]['id'])});}});}})[_0x498a('0x21')](respondWithStatusCode(_0x642dfe,null))[_0x498a('0x2b')](handleError(_0x642dfe,null));};exports[_0x498a('0x94')]=function(_0x243fc8,_0x3de7d3,_0x2b9b09){var _0x145769={};var _0x5bae04={};var _0x4fe189;var _0x46f3e5;return db[_0x498a('0x3e')][_0x498a('0x66')]({'where':{'id':_0x243fc8[_0x498a('0x58')]['id']}})[_0x498a('0x21')](handleEntityNotFound(_0x3de7d3,null))[_0x498a('0x21')](function(_0x5acb21){if(_0x5acb21){_0x4fe189=_0x5acb21;_0x5bae04['model']=_[_0x498a('0x42')](db[_0x498a('0x6a')]['rawAttributes']);_0x5bae04[_0x498a('0x43')]=_[_0x498a('0x42')](_0x243fc8[_0x498a('0x43')]);_0x5bae04[_0x498a('0x44')]=_[_0x498a('0x46')](_0x5bae04[_0x498a('0x41')],_0x5bae04['query']);_0x145769[_0x498a('0x45')]=_[_0x498a('0x46')](_0x5bae04[_0x498a('0x41')],qs[_0x498a('0x47')](_0x243fc8['query'][_0x498a('0x47')]));_0x145769[_0x498a('0x45')]=_0x145769[_0x498a('0x45')]['length']?_0x145769[_0x498a('0x45')]:_0x5bae04[_0x498a('0x41')];_0x145769[_0x498a('0x4b')]=qs[_0x498a('0x4c')](_0x243fc8[_0x498a('0x43')][_0x498a('0x4c')]);_0x145769[_0x498a('0x4d')]=qs['filters'](_[_0x498a('0x4e')](_0x243fc8[_0x498a('0x43')],_0x5bae04[_0x498a('0x44')]));if(_0x243fc8[_0x498a('0x43')][_0x498a('0x4f')]){_0x145769[_0x498a('0x4d')]=_['merge'](_0x145769[_0x498a('0x4d')],{'$or':_['map'](_0x145769[_0x498a('0x45')],function(_0x479450){var _0x7a1516={};_0x7a1516[_0x479450]={'$like':'%'+_0x243fc8[_0x498a('0x43')][_0x498a('0x4f')]+'%'};return _0x7a1516;})});}_0x145769=_[_0x498a('0x50')]({},_0x145769,_0x243fc8[_0x498a('0x53')]);return _0x4fe189[_0x498a('0x94')](_0x145769);}})[_0x498a('0x21')](function(_0x2f3b9f){if(_0x2f3b9f){_0x46f3e5=_0x2f3b9f[_0x498a('0x48')];if(!_0x243fc8[_0x498a('0x43')][_0x498a('0x49')](_0x498a('0x4a'))){_0x145769['limit']=qs[_0x498a('0x32')](_0x243fc8['query'][_0x498a('0x32')]);_0x145769[_0x498a('0x30')]=qs[_0x498a('0x30')](_0x243fc8['query'][_0x498a('0x30')]);}return _0x4fe189['getAgents'](_0x145769);}})['then'](function(_0x4289a1){if(_0x4289a1){return _0x4289a1?{'count':_0x46f3e5,'rows':_0x4289a1}:null;}})[_0x498a('0x21')](respondWithResult(_0x3de7d3,null))[_0x498a('0x2b')](handleError(_0x3de7d3,null));}; \ No newline at end of file +var _0x41a3=['sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','redis','defaults','socket.io-emitter','./chatQueue.socket','register','jayson/promise','request','then','info','ChatQueue,\x20%s,\x20%s','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','get','ChatQueues','UserProfileResource','destroy','stack','name','send','index','map','ChatQueue','fieldName','model','query','intersection','attributes','fields','length','sort','where','filters','pick','merge','type','filter','options','includeAll','rows','show','params','keys','rawAttributes','find','create','body','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserChatQueue','hasOwnProperty','order','ChatQueueId','findAndCountAll','UserId','agent','chatPause','updatedAt','format','SIP','getTeams','Team','nolimit','addTeams','findAll','Agents','online','voicePause','flatMap','sequelize','transaction','each','findOrCreate','userChatQueue:save','removeTeams','ids','User','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','forEach','emit','addAgents','omit','isArray','userChatQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util'];(function(_0x35e4e8,_0x231074){var _0x3cc5a3=function(_0x16b37c){while(--_0x16b37c){_0x35e4e8['push'](_0x35e4e8['shift']());}};_0x3cc5a3(++_0x231074);}(_0x41a3,0x92));var _0x341a=function(_0x2a63f2,_0x46ff3c){_0x2a63f2=_0x2a63f2-0x0;var _0x49f979=_0x41a3[_0x2a63f2];return _0x49f979;};'use strict';var emlformat=require(_0x341a('0x0'));var rimraf=require(_0x341a('0x1'));var zipdir=require(_0x341a('0x2'));var jsonpatch=require(_0x341a('0x3'));var rp=require('request-promise');var moment=require(_0x341a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x341a('0x5'));var util=require(_0x341a('0x6'));var path=require('path');var sox=require(_0x341a('0x7'));var csv=require(_0x341a('0x8'));var ejs=require(_0x341a('0x9'));var fs=require('fs');var fs_extra=require(_0x341a('0xa'));var _=require(_0x341a('0xb'));var squel=require(_0x341a('0xc'));var crypto=require(_0x341a('0xd'));var jsforce=require(_0x341a('0xe'));var deskjs=require(_0x341a('0xf'));var toCsv=require(_0x341a('0x8'));var querystring=require(_0x341a('0x10'));var Papa=require(_0x341a('0x11'));var Redis=require('ioredis');var authService=require(_0x341a('0x12'));var qs=require(_0x341a('0x13'));var as=require(_0x341a('0x14'));var hardwareService=require(_0x341a('0x15'));var logger=require(_0x341a('0x16'))(_0x341a('0x17'));var utils=require('../../config/utils');var config=require(_0x341a('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x341a('0x19')]=_[_0x341a('0x1a')](config[_0x341a('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x341a('0x1b'))(new Redis(config['redis']));require(_0x341a('0x1c'))[_0x341a('0x1d')](socket);var jayson=require(_0x341a('0x1e'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2019ca,_0x11aec7,_0x3b2efd,_0x526fa1){return new BPromise(function(_0x3f92e3,_0x2122a3){var _0x380901=_0x526fa1||client;return _0x380901[_0x341a('0x1f')](_0x2019ca,_0x3b2efd)[_0x341a('0x20')](function(_0x23cc72){logger[_0x341a('0x21')](_0x341a('0x22'),_0x11aec7,'request\x20sent');logger['debug'](_0x341a('0x23'),_0x11aec7,_0x341a('0x24'),JSON[_0x341a('0x25')](_0x23cc72));if(_0x23cc72['error']){if(_0x23cc72[_0x341a('0x26')][_0x341a('0x27')]===0x1f4){logger['error'](_0x341a('0x22'),_0x11aec7,_0x23cc72[_0x341a('0x26')][_0x341a('0x28')]);return _0x2122a3(_0x23cc72[_0x341a('0x26')]['message']);}logger[_0x341a('0x26')](_0x341a('0x22'),_0x11aec7,_0x23cc72['error'][_0x341a('0x28')]);return _0x3f92e3(_0x23cc72[_0x341a('0x26')][_0x341a('0x28')]);}else{logger[_0x341a('0x21')](_0x341a('0x22'),_0x11aec7,_0x341a('0x24'));_0x3f92e3(_0x23cc72[_0x341a('0x29')][_0x341a('0x28')]);}})[_0x341a('0x2a')](function(_0x3bc63b){logger[_0x341a('0x26')](_0x341a('0x22'),_0x11aec7,_0x3bc63b);_0x2122a3(_0x3bc63b);});});}function respondWithStatusCode(_0x3f10cf,_0x2a7aca){_0x2a7aca=_0x2a7aca||0xcc;return function(_0x809335){if(_0x809335){return _0x3f10cf[_0x341a('0x2b')](_0x2a7aca);}return _0x3f10cf['status'](_0x2a7aca)[_0x341a('0x2c')]();};}function respondWithResult(_0x31e6b5,_0x1cd040){_0x1cd040=_0x1cd040||0xc8;return function(_0x54a589){if(_0x54a589){return _0x31e6b5[_0x341a('0x2d')](_0x1cd040)[_0x341a('0x2e')](_0x54a589);}};}function respondWithFilteredResult(_0x6a4d3d,_0xc4cad9){return function(_0x3a807f){if(_0x3a807f){var _0x1a3c9a=typeof _0xc4cad9[_0x341a('0x2f')]===_0x341a('0x30')&&typeof _0xc4cad9[_0x341a('0x31')]==='undefined';var _0x2ba3b7=_0x3a807f[_0x341a('0x32')];var _0x3cde55=_0x1a3c9a?0x0:_0xc4cad9['offset'];var _0x149b51=_0x1a3c9a?_0x3a807f['count']:_0xc4cad9[_0x341a('0x2f')]+_0xc4cad9[_0x341a('0x31')];var _0x3b5b63;if(_0x149b51>=_0x2ba3b7){_0x149b51=_0x2ba3b7;_0x3b5b63=0xc8;}else{_0x3b5b63=0xce;}_0x6a4d3d['status'](_0x3b5b63);return _0x6a4d3d[_0x341a('0x33')](_0x341a('0x34'),_0x3cde55+'-'+_0x149b51+'/'+_0x2ba3b7)['json'](_0x3a807f);}return null;};}function patchUpdates(_0x3abc4d){return function(_0x37c872){try{jsonpatch[_0x341a('0x35')](_0x37c872,_0x3abc4d,!![]);}catch(_0x2d65b3){return BPromise[_0x341a('0x36')](_0x2d65b3);}return _0x37c872[_0x341a('0x37')]();};}function saveUpdates(_0x1f3c37,_0x54eca4){return function(_0xc8b537){if(_0xc8b537){return _0xc8b537[_0x341a('0x38')](_0x1f3c37)[_0x341a('0x20')](function(_0x1a49c2){return _0x1a49c2;});}return null;};}function removeEntity(_0x27741b,_0x6c9333){return function(_0x35e224){if(_0x35e224){return _0x35e224['destroy']()[_0x341a('0x20')](function(){var _0x14370c=_0x35e224[_0x341a('0x39')]({'plain':!![]});var _0x53ba2d=_0x341a('0x3a');return db[_0x341a('0x3b')][_0x341a('0x3c')]({'where':{'type':_0x53ba2d,'resourceId':_0x14370c['id']}})[_0x341a('0x20')](function(){return _0x35e224;});})['then'](function(){_0x27741b[_0x341a('0x2d')](0xcc)[_0x341a('0x2c')]();});}};}function handleEntityNotFound(_0x2eb320,_0x1d7f4f){return function(_0x125545){if(!_0x125545){_0x2eb320[_0x341a('0x2b')](0x194);}return _0x125545;};}function handleError(_0x1c0f8f,_0x22881b){_0x22881b=_0x22881b||0x1f4;return function(_0x5e06f0){logger[_0x341a('0x26')](_0x5e06f0[_0x341a('0x3d')]);if(_0x5e06f0[_0x341a('0x3e')]){delete _0x5e06f0[_0x341a('0x3e')];}_0x1c0f8f[_0x341a('0x2d')](_0x22881b)[_0x341a('0x3f')](_0x5e06f0);};}exports[_0x341a('0x40')]=function(_0x111618,_0x1b24d2){var _0x3813db={},_0x147c36={},_0x235b45={'count':0x0,'rows':[]};var _0x4af83d=_[_0x341a('0x41')](db[_0x341a('0x42')]['rawAttributes'],function(_0x2aed69){return{'name':_0x2aed69[_0x341a('0x43')],'type':_0x2aed69['type']['key']};});_0x147c36[_0x341a('0x44')]=_[_0x341a('0x41')](_0x4af83d,_0x341a('0x3e'));_0x147c36['query']=_['keys'](_0x111618[_0x341a('0x45')]);_0x147c36['filters']=_[_0x341a('0x46')](_0x147c36[_0x341a('0x44')],_0x147c36['query']);_0x3813db[_0x341a('0x47')]=_['intersection'](_0x147c36['model'],qs[_0x341a('0x48')](_0x111618[_0x341a('0x45')][_0x341a('0x48')]));_0x3813db[_0x341a('0x47')]=_0x3813db[_0x341a('0x47')][_0x341a('0x49')]?_0x3813db['attributes']:_0x147c36['model'];if(!_0x111618['query']['hasOwnProperty']('nolimit')){_0x3813db[_0x341a('0x31')]=qs[_0x341a('0x31')](_0x111618[_0x341a('0x45')]['limit']);_0x3813db['offset']=qs['offset'](_0x111618[_0x341a('0x45')]['offset']);}_0x3813db['order']=qs[_0x341a('0x4a')](_0x111618['query'][_0x341a('0x4a')]);_0x3813db[_0x341a('0x4b')]=qs[_0x341a('0x4c')](_[_0x341a('0x4d')](_0x111618[_0x341a('0x45')],_0x147c36[_0x341a('0x4c')]),_0x4af83d);if(_0x111618[_0x341a('0x45')]['filter']){_0x3813db[_0x341a('0x4b')]=_[_0x341a('0x4e')](_0x3813db[_0x341a('0x4b')],{'$or':_[_0x341a('0x41')](_0x4af83d,function(_0x52ca99){if(_0x52ca99[_0x341a('0x4f')]!=='VIRTUAL'){var _0x3209e8={};_0x3209e8[_0x52ca99[_0x341a('0x3e')]]={'$like':'%'+_0x111618[_0x341a('0x45')][_0x341a('0x50')]+'%'};return _0x3209e8;}})});}_0x3813db=_[_0x341a('0x4e')]({},_0x3813db,_0x111618[_0x341a('0x51')]);var _0xcf1f35={'where':_0x3813db['where']};return db[_0x341a('0x42')][_0x341a('0x32')](_0xcf1f35)['then'](function(_0x308bc8){_0x235b45[_0x341a('0x32')]=_0x308bc8;if(_0x111618[_0x341a('0x45')][_0x341a('0x52')]){_0x3813db['include']=[{'all':!![]}];}return db[_0x341a('0x42')]['findAll'](_0x3813db);})[_0x341a('0x20')](function(_0x40302a){_0x235b45[_0x341a('0x53')]=_0x40302a;return _0x235b45;})[_0x341a('0x20')](respondWithFilteredResult(_0x1b24d2,_0x3813db))['catch'](handleError(_0x1b24d2,null));};exports[_0x341a('0x54')]=function(_0x2acf8d,_0x3f688e){var _0x24ade7={'raw':!![],'where':{'id':_0x2acf8d[_0x341a('0x55')]['id']}},_0x369981={};_0x369981[_0x341a('0x44')]=_[_0x341a('0x56')](db[_0x341a('0x42')][_0x341a('0x57')]);_0x369981[_0x341a('0x45')]=_[_0x341a('0x56')](_0x2acf8d[_0x341a('0x45')]);_0x369981['filters']=_['intersection'](_0x369981[_0x341a('0x44')],_0x369981[_0x341a('0x45')]);_0x24ade7['attributes']=_['intersection'](_0x369981[_0x341a('0x44')],qs['fields'](_0x2acf8d[_0x341a('0x45')][_0x341a('0x48')]));_0x24ade7[_0x341a('0x47')]=_0x24ade7[_0x341a('0x47')][_0x341a('0x49')]?_0x24ade7[_0x341a('0x47')]:_0x369981[_0x341a('0x44')];if(_0x2acf8d[_0x341a('0x45')][_0x341a('0x52')]){_0x24ade7['include']=[{'all':!![]}];}_0x24ade7=_['merge']({},_0x24ade7,_0x2acf8d[_0x341a('0x51')]);return db[_0x341a('0x42')][_0x341a('0x58')](_0x24ade7)[_0x341a('0x20')](handleEntityNotFound(_0x3f688e,null))[_0x341a('0x20')](respondWithResult(_0x3f688e,null))['catch'](handleError(_0x3f688e,null));};exports[_0x341a('0x59')]=function(_0x2ae061,_0xfed073){return db[_0x341a('0x42')][_0x341a('0x59')](_0x2ae061[_0x341a('0x5a')],{})[_0x341a('0x20')](function(_0x30861e){var _0x2717da=_0x2ae061['user'][_0x341a('0x39')]({'plain':!![]});if(!_0x2717da)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2717da[_0x341a('0x5b')]===_0x341a('0x5c')){var _0xdbdffa=_0x30861e[_0x341a('0x39')]({'plain':!![]});var _0x2227a9=_0x341a('0x3a');return db['UserProfileSection'][_0x341a('0x58')]({'where':{'name':_0x2227a9,'userProfileId':_0x2717da[_0x341a('0x5d')]},'raw':!![]})[_0x341a('0x20')](function(_0x4ab559){if(_0x4ab559&&_0x4ab559[_0x341a('0x5e')]===0x0){return db[_0x341a('0x3b')]['create']({'name':_0xdbdffa[_0x341a('0x3e')],'resourceId':_0xdbdffa['id'],'type':_0x4ab559['name'],'sectionId':_0x4ab559['id']},{})[_0x341a('0x20')](function(){return _0x30861e;});}else{return _0x30861e;}})[_0x341a('0x2a')](function(_0x49da41){logger[_0x341a('0x26')](_0x341a('0x5f'),_0x49da41);throw _0x49da41;});}return _0x30861e;})[_0x341a('0x20')](respondWithResult(_0xfed073,0xc9))[_0x341a('0x2a')](handleError(_0xfed073,null));};exports[_0x341a('0x38')]=function(_0x3d5257,_0x96e81){if(_0x3d5257[_0x341a('0x5a')]['id']){delete _0x3d5257[_0x341a('0x5a')]['id'];}return db[_0x341a('0x42')][_0x341a('0x58')]({'where':{'id':_0x3d5257[_0x341a('0x55')]['id']}})['then'](handleEntityNotFound(_0x96e81,null))[_0x341a('0x20')](saveUpdates(_0x3d5257[_0x341a('0x5a')],null))[_0x341a('0x20')](respondWithResult(_0x96e81,null))[_0x341a('0x2a')](handleError(_0x96e81,null));};exports[_0x341a('0x3c')]=function(_0xf7611,_0xe1c6ec){return db[_0x341a('0x42')]['find']({'where':{'id':_0xf7611['params']['id']}})['then'](handleEntityNotFound(_0xe1c6ec,null))[_0x341a('0x20')](removeEntity(_0xe1c6ec,null))[_0x341a('0x2a')](handleError(_0xe1c6ec,null));};exports[_0x341a('0x60')]=function(_0x18d9f1,_0x224c5c){return db[_0x341a('0x42')][_0x341a('0x60')]()[_0x341a('0x20')](respondWithResult(_0x224c5c,null))[_0x341a('0x2a')](handleError(_0x224c5c,null));};exports['getMembers']=function(_0x33b603,_0x2916f0,_0x337a0b){var _0x1d27dd={'raw':!![],'where':{}},_0x123266={},_0x335a98;return db['ChatQueue'][_0x341a('0x61')]({'where':{'id':_0x33b603[_0x341a('0x55')]['id']}})['then'](handleEntityNotFound(_0x2916f0,null))[_0x341a('0x20')](function(_0x4c0457){if(_0x4c0457){_0x335a98=_0x4c0457[_0x341a('0x39')]({'plain':!![]});_0x123266['model']=_['keys'](db[_0x341a('0x62')][_0x341a('0x57')]);_0x123266['query']=_[_0x341a('0x56')](_0x33b603[_0x341a('0x45')]);_0x123266[_0x341a('0x4c')]=_[_0x341a('0x46')](_0x123266[_0x341a('0x44')],_0x123266[_0x341a('0x45')]);_0x1d27dd[_0x341a('0x47')]=_['intersection'](_0x123266['model'],qs[_0x341a('0x48')](_0x33b603[_0x341a('0x45')][_0x341a('0x48')]));_0x1d27dd['attributes']=_0x1d27dd[_0x341a('0x47')][_0x341a('0x49')]?_0x1d27dd['attributes']:_0x123266[_0x341a('0x44')];if(!_0x33b603[_0x341a('0x45')][_0x341a('0x63')]('nolimit')){_0x1d27dd[_0x341a('0x31')]=qs[_0x341a('0x31')](_0x33b603[_0x341a('0x45')][_0x341a('0x31')]);_0x1d27dd[_0x341a('0x2f')]=qs[_0x341a('0x2f')](_0x33b603['query']['offset']);}_0x1d27dd[_0x341a('0x64')]=qs[_0x341a('0x4a')](_0x33b603[_0x341a('0x45')][_0x341a('0x4a')]);_0x1d27dd[_0x341a('0x4b')]=qs[_0x341a('0x4c')](_[_0x341a('0x4d')](_0x33b603[_0x341a('0x45')],_0x123266[_0x341a('0x4c')]));_0x1d27dd[_0x341a('0x4b')][_0x341a('0x65')]=_0x4c0457['id'];if(_0x33b603[_0x341a('0x45')]['filter']){_0x1d27dd[_0x341a('0x4b')]=_[_0x341a('0x4e')](_0x1d27dd['where'],{'$or':_['map'](_0x1d27dd['attributes'],function(_0x111665){var _0x4f48e2={};_0x4f48e2[_0x111665]={'$like':'%'+_0x33b603[_0x341a('0x45')]['filter']+'%'};return _0x4f48e2;})});}_0x1d27dd=_[_0x341a('0x4e')]({},_0x1d27dd,_0x33b603[_0x341a('0x51')]);return db[_0x341a('0x62')]['findAll'](_0x1d27dd);}})[_0x341a('0x20')](function(_0x5bbbd2){if(_0x5bbbd2){return db['User'][_0x341a('0x66')]({'where':{'id':_['map'](_0x5bbbd2,_0x341a('0x67')),'role':_0x341a('0x68')},'attributes':['id',_0x341a('0x3e'),_0x341a('0x69'),_0x341a('0x6a'),'createdAt']});}})['then'](function(_0x202b3f){if(_0x202b3f){return{'count':_0x202b3f['count'],'rows':_[_0x341a('0x41')](_0x202b3f['rows'],function(_0x523ecb){return{'membername':_0x523ecb[_0x341a('0x3e')],'UserId':_0x523ecb['id'],'queue_name':_0x335a98[_0x341a('0x3e')],'ChatQueueId':_0x335a98['id'],'interface':util[_0x341a('0x6b')]('%s/%s',_0x341a('0x6c'),_0x523ecb[_0x341a('0x3e')]),'penalty':0x0,'paused':_0x523ecb[_0x341a('0x69')],'createdAt':_0x523ecb['createdAt'],'updatedAt':_0x523ecb['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x341a('0x20')](respondWithFilteredResult(_0x2916f0,_0x1d27dd))[_0x341a('0x2a')](handleError(_0x2916f0,null));};exports[_0x341a('0x6d')]=function(_0x598dd6,_0x3082e8,_0x5495db){var _0x5c8cfa={};var _0x377177={};var _0x483943;var _0x4af6c7;return db[_0x341a('0x42')][_0x341a('0x61')]({'where':{'id':_0x598dd6[_0x341a('0x55')]['id']}})[_0x341a('0x20')](handleEntityNotFound(_0x3082e8,null))[_0x341a('0x20')](function(_0xbe14dd){if(_0xbe14dd){_0x483943=_0xbe14dd;_0x377177[_0x341a('0x44')]=_[_0x341a('0x56')](db[_0x341a('0x6e')]['rawAttributes']);_0x377177[_0x341a('0x45')]=_[_0x341a('0x56')](_0x598dd6['query']);_0x377177[_0x341a('0x4c')]=_['intersection'](_0x377177['model'],_0x377177['query']);_0x5c8cfa[_0x341a('0x47')]=_[_0x341a('0x46')](_0x377177[_0x341a('0x44')],qs['fields'](_0x598dd6[_0x341a('0x45')][_0x341a('0x48')]));_0x5c8cfa['attributes']=_0x5c8cfa[_0x341a('0x47')][_0x341a('0x49')]?_0x5c8cfa[_0x341a('0x47')]:_0x377177['model'];_0x5c8cfa[_0x341a('0x64')]=qs[_0x341a('0x4a')](_0x598dd6[_0x341a('0x45')][_0x341a('0x4a')]);_0x5c8cfa[_0x341a('0x4b')]=qs['filters'](_[_0x341a('0x4d')](_0x598dd6['query'],_0x377177['filters']));if(_0x598dd6[_0x341a('0x45')][_0x341a('0x50')]){_0x5c8cfa[_0x341a('0x4b')]=_[_0x341a('0x4e')](_0x5c8cfa[_0x341a('0x4b')],{'$or':_[_0x341a('0x41')](_0x5c8cfa['attributes'],function(_0xa6a2ff){var _0x4bc2d1={};_0x4bc2d1[_0xa6a2ff]={'$like':'%'+_0x598dd6[_0x341a('0x45')]['filter']+'%'};return _0x4bc2d1;})});}_0x5c8cfa=_[_0x341a('0x4e')]({},_0x5c8cfa,_0x598dd6[_0x341a('0x51')]);return _0x483943[_0x341a('0x6d')](_0x5c8cfa);}})[_0x341a('0x20')](function(_0x1e5f41){if(_0x1e5f41){_0x4af6c7=_0x1e5f41[_0x341a('0x49')];if(!_0x598dd6[_0x341a('0x45')][_0x341a('0x63')](_0x341a('0x6f'))){_0x5c8cfa['limit']=qs[_0x341a('0x31')](_0x598dd6[_0x341a('0x45')][_0x341a('0x31')]);_0x5c8cfa[_0x341a('0x2f')]=qs['offset'](_0x598dd6['query'][_0x341a('0x2f')]);}return _0x483943['getTeams'](_0x5c8cfa);}})[_0x341a('0x20')](function(_0x122ed0){if(_0x122ed0){return _0x122ed0?{'count':_0x4af6c7,'rows':_0x122ed0}:null;}})[_0x341a('0x20')](respondWithResult(_0x3082e8,null))['catch'](handleError(_0x3082e8,null));};exports[_0x341a('0x70')]=function(_0x1b06cf,_0x5b1390,_0x5ee54f){var _0x3e6ec6=_0x1b06cf[_0x341a('0x5a')]['ids'];return db['Team'][_0x341a('0x71')]({'where':{'id':_0x3e6ec6},'attributes':['id'],'include':[{'model':db['User'],'as':_0x341a('0x72'),'attributes':['id','name',_0x341a('0x73'),_0x341a('0x74'),'interface'],'raw':!![]}]})[_0x341a('0x20')](function(_0x56f563){if(_0x56f563){var _0x5f4b80=_[_0x341a('0x75')](_0x56f563,function(_0x369087){var _0x454811=_0x369087['get']({'plain':!![]});return _0x454811[_0x341a('0x72')];});return db['ChatQueue'][_0x341a('0x58')]({'where':{'id':_0x1b06cf['params']['id']}})[_0x341a('0x20')](function(_0x1ab4a5){return db[_0x341a('0x76')][_0x341a('0x77')](function(_0x4a746d){return _0x1ab4a5['addTeams'](_0x3e6ec6,{'transaction':_0x4a746d})[_0x341a('0x20')](function(){return BPromise[_0x341a('0x78')](_0x5f4b80,function(_0x79de3a){return db[_0x341a('0x62')][_0x341a('0x79')]({'where':{'UserId':_0x79de3a['id'],'ChatQueueId':_0x1b06cf[_0x341a('0x55')]['id']},'transaction':_0x4a746d});});})[_0x341a('0x20')](function(){_0x5f4b80['forEach'](function(_0x2f9c60){socket['emit'](_0x341a('0x7a'),{'UserId':_0x2f9c60['id'],'ChatQueueId':_0x1ab4a5['id']});});});});});}})['then'](respondWithStatusCode(_0x5b1390,null))[_0x341a('0x2a')](handleError(_0x5b1390,null));};exports[_0x341a('0x7b')]=function(_0x4f9bb3,_0x3fd158,_0x5126ae){return db['Team']['findAll']({'where':{'id':_0x4f9bb3[_0x341a('0x45')][_0x341a('0x7c')]},'attributes':['id'],'include':[{'model':db[_0x341a('0x7d')],'as':_0x341a('0x72'),'attributes':['id'],'raw':!![]}]})[_0x341a('0x20')](handleEntityNotFound(_0x3fd158,null))[_0x341a('0x20')](function(_0x29bee0){var _0xd49ec0=_[_0x341a('0x41')](_0x29bee0,'id');var _0x5cd39a=[];var _0x465593=[];var _0x5f42b2=squel['select']();_0x5f42b2['field']('tq.TeamId')[_0x341a('0x7e')](_0x341a('0x7f'),'tq')[_0x341a('0x80')](_0x341a('0x81'),'ut',_0x341a('0x82'))[_0x341a('0x4b')](_0x341a('0x83'),_0x4f9bb3[_0x341a('0x55')]['id']);for(var _0x276824=0x0;_0x276824<_0x29bee0[_0x341a('0x49')];_0x276824+=0x1){let _0x240f38=_0x29bee0[_0x276824];for(var _0x47084e=0x0;_0x47084e<_0x240f38['Agents'][_0x341a('0x49')];_0x47084e+=0x1){let _0x7f5ba4=_0x240f38[_0x341a('0x72')][_0x47084e];var _0x536e5b=_0x5f42b2[_0x341a('0x84')]();_0x536e5b[_0x341a('0x4b')](_0x341a('0x85'),_0x7f5ba4['id']);_0x465593[_0x341a('0x86')](db[_0x341a('0x76')][_0x341a('0x45')](_0x536e5b['toString'](),{'type':db[_0x341a('0x76')][_0x341a('0x87')][_0x341a('0x88')]})[_0x341a('0x20')](function(_0x244a0f){if(_0x244a0f[_0x341a('0x49')]===0x1){return _0x7f5ba4['id'];}else{var _0x26af61=_[_0x341a('0x89')](_[_0x341a('0x41')](_0x244a0f,_0x341a('0x8a')),function(_0x52e0ae){return _[_0x341a('0x8b')](_0xd49ec0,_0x52e0ae);});if(_0x26af61){return _0x7f5ba4['id'];}}}));}}return BPromise[_0x341a('0x8c')](_0x465593)[_0x341a('0x20')](function(_0x3f6cc7){_0x5cd39a=_(_0x5cd39a)[_0x341a('0x8d')](_0x3f6cc7)[_0x341a('0x8e')]()[_0x341a('0x8f')]();return db[_0x341a('0x42')]['find']({'where':{'id':_0x4f9bb3[_0x341a('0x55')]['id']}})['then'](function(_0x59fd96){return db[_0x341a('0x76')][_0x341a('0x77')](function(_0x54e90a){return _0x59fd96[_0x341a('0x7b')](_0x4f9bb3['query']['ids'],{'transaction':_0x54e90a})[_0x341a('0x20')](function(){if(!_[_0x341a('0x90')](_0x5cd39a)){return _0x59fd96[_0x341a('0x91')](_0x5cd39a,{'transaction':_0x54e90a});}})[_0x341a('0x20')](function(){_0x5cd39a[_0x341a('0x92')](function(_0x32e89b){socket[_0x341a('0x93')]('userChatQueue:remove',{'UserId':_0x32e89b,'ChatQueueId':_0x59fd96['id']});});});});});});})['then'](respondWithStatusCode(_0x3fd158,null))[_0x341a('0x2a')](handleError(_0x3fd158,null));};exports[_0x341a('0x94')]=function(_0x4a8b46,_0x53c30f,_0x5590c4){return db[_0x341a('0x42')][_0x341a('0x58')]({'where':{'id':_0x4a8b46[_0x341a('0x55')]['id']}})[_0x341a('0x20')](handleEntityNotFound(_0x53c30f,null))[_0x341a('0x20')](function(_0x31c1b1){if(_0x31c1b1){return _0x31c1b1[_0x341a('0x94')](_0x4a8b46[_0x341a('0x5a')][_0x341a('0x7c')],_[_0x341a('0x95')](_0x4a8b46[_0x341a('0x5a')],[_0x341a('0x7c'),'id'])||{})['spread'](function(_0x3f5819){for(var _0x21a00b=0x0;_0x21a00b<_0x4a8b46[_0x341a('0x5a')][_0x341a('0x7c')][_0x341a('0x49')];_0x21a00b+=0x1){socket[_0x341a('0x93')](_0x341a('0x7a'),{'UserId':Number(_0x4a8b46[_0x341a('0x5a')]['ids'][_0x21a00b]),'ChatQueueId':Number(_0x4a8b46['params']['id'])});}return _0x3f5819;});}})['then'](respondWithResult(_0x53c30f,null))[_0x341a('0x2a')](handleError(_0x53c30f,null));};exports[_0x341a('0x91')]=function(_0x323b23,_0x5a9be2,_0x166d53){return db[_0x341a('0x42')][_0x341a('0x58')]({'where':{'id':_0x323b23[_0x341a('0x55')]['id']}})[_0x341a('0x20')](handleEntityNotFound(_0x5a9be2,null))[_0x341a('0x20')](function(_0x52a4a4){if(_0x52a4a4){return _0x52a4a4['removeAgents'](_0x323b23[_0x341a('0x45')][_0x341a('0x7c')])[_0x341a('0x20')](function(){if(_[_0x341a('0x96')](_0x323b23[_0x341a('0x45')][_0x341a('0x7c')])){for(var _0x37e694=0x0;_0x37e694<_0x323b23[_0x341a('0x45')][_0x341a('0x7c')][_0x341a('0x49')];_0x37e694+=0x1){socket[_0x341a('0x93')]('userChatQueue:remove',{'UserId':Number(_0x323b23['query'][_0x341a('0x7c')][_0x37e694]),'ChatQueueId':Number(_0x323b23[_0x341a('0x55')]['id'])});}}else{socket['emit'](_0x341a('0x97'),{'UserId':Number(_0x323b23[_0x341a('0x45')][_0x341a('0x7c')]),'ChatQueueId':Number(_0x323b23[_0x341a('0x55')]['id'])});}});}})[_0x341a('0x20')](respondWithStatusCode(_0x5a9be2,null))[_0x341a('0x2a')](handleError(_0x5a9be2,null));};exports['getAgents']=function(_0x375b28,_0x555bb2,_0x503212){var _0x563ee8={};var _0x48d1cb={};var _0x3d5034;var _0x37d4ce;return db[_0x341a('0x42')][_0x341a('0x61')]({'where':{'id':_0x375b28['params']['id']}})[_0x341a('0x20')](handleEntityNotFound(_0x555bb2,null))['then'](function(_0x1df05a){if(_0x1df05a){_0x3d5034=_0x1df05a;_0x48d1cb[_0x341a('0x44')]=_[_0x341a('0x56')](db['User'][_0x341a('0x57')]);_0x48d1cb['query']=_[_0x341a('0x56')](_0x375b28['query']);_0x48d1cb[_0x341a('0x4c')]=_[_0x341a('0x46')](_0x48d1cb[_0x341a('0x44')],_0x48d1cb['query']);_0x563ee8[_0x341a('0x47')]=_[_0x341a('0x46')](_0x48d1cb[_0x341a('0x44')],qs[_0x341a('0x48')](_0x375b28[_0x341a('0x45')][_0x341a('0x48')]));_0x563ee8[_0x341a('0x47')]=_0x563ee8['attributes'][_0x341a('0x49')]?_0x563ee8[_0x341a('0x47')]:_0x48d1cb[_0x341a('0x44')];_0x563ee8[_0x341a('0x64')]=qs[_0x341a('0x4a')](_0x375b28[_0x341a('0x45')][_0x341a('0x4a')]);_0x563ee8['where']=qs[_0x341a('0x4c')](_['pick'](_0x375b28['query'],_0x48d1cb['filters']));if(_0x375b28[_0x341a('0x45')][_0x341a('0x50')]){_0x563ee8['where']=_[_0x341a('0x4e')](_0x563ee8[_0x341a('0x4b')],{'$or':_[_0x341a('0x41')](_0x563ee8[_0x341a('0x47')],function(_0x14109c){var _0x34c9ee={};_0x34c9ee[_0x14109c]={'$like':'%'+_0x375b28[_0x341a('0x45')][_0x341a('0x50')]+'%'};return _0x34c9ee;})});}_0x563ee8=_[_0x341a('0x4e')]({},_0x563ee8,_0x375b28[_0x341a('0x51')]);return _0x3d5034[_0x341a('0x98')](_0x563ee8);}})[_0x341a('0x20')](function(_0x12b73c){if(_0x12b73c){_0x37d4ce=_0x12b73c['length'];if(!_0x375b28[_0x341a('0x45')][_0x341a('0x63')](_0x341a('0x6f'))){_0x563ee8[_0x341a('0x31')]=qs['limit'](_0x375b28[_0x341a('0x45')]['limit']);_0x563ee8['offset']=qs[_0x341a('0x2f')](_0x375b28[_0x341a('0x45')][_0x341a('0x2f')]);}return _0x3d5034[_0x341a('0x98')](_0x563ee8);}})[_0x341a('0x20')](function(_0x34f332){if(_0x34f332){return _0x34f332?{'count':_0x37d4ce,'rows':_0x34f332}:null;}})[_0x341a('0x20')](respondWithResult(_0x555bb2,null))['catch'](handleError(_0x555bb2,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index d77ae74..ad3a223 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 _0x8c77=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x28e88f,_0x422dae){var _0x4d8a46=function(_0x44bd41){while(--_0x44bd41){_0x28e88f['push'](_0x28e88f['shift']());}};_0x4d8a46(++_0x422dae);}(_0x8c77,0x1d6));var _0x78c7=function(_0x2c94a4,_0x379dc5){_0x2c94a4=_0x2c94a4-0x0;var _0x473b75=_0x8c77[_0x2c94a4];return _0x473b75;};'use strict';var EventEmitter=require(_0x78c7('0x0'));var ChatQueue=require(_0x78c7('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x78c7('0x2')](0x0);var events={'afterCreate':_0x78c7('0x3'),'afterUpdate':_0x78c7('0x4'),'afterDestroy':_0x78c7('0x5')};function emitEvent(_0x21cae3){return function(_0x1bea4b,_0x17118b,_0x33426a){ChatQueueEvents[_0x78c7('0x6')](_0x21cae3+':'+_0x1bea4b['id'],_0x1bea4b);ChatQueueEvents['emit'](_0x21cae3,_0x1bea4b);_0x33426a(null);};}for(var e in events){if(events[_0x78c7('0x7')](e)){var event=events[e];ChatQueue[_0x78c7('0x8')](e,emitEvent(event));}}module[_0x78c7('0x9')]=ChatQueueEvents; \ No newline at end of file +var _0x283c=['../../mysqldb','ChatQueue','setMaxListeners','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x25fc41,_0x250864){var _0x1371d1=function(_0x8ab2e3){while(--_0x8ab2e3){_0x25fc41['push'](_0x25fc41['shift']());}};_0x1371d1(++_0x250864);}(_0x283c,0x170));var _0xc283=function(_0x22a9c4,_0x27c41e){_0x22a9c4=_0x22a9c4-0x0;var _0xd236c6=_0x283c[_0x22a9c4];return _0xd236c6;};'use strict';var EventEmitter=require(_0xc283('0x0'));var ChatQueue=require(_0xc283('0x1'))['db'][_0xc283('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xc283('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc283('0x4'),'afterDestroy':_0xc283('0x5')};function emitEvent(_0xb54cdd){return function(_0x31e62c,_0x5d9a66,_0x3a09cc){ChatQueueEvents[_0xc283('0x6')](_0xb54cdd+':'+_0x31e62c['id'],_0x31e62c);ChatQueueEvents[_0xc283('0x6')](_0xb54cdd,_0x31e62c);_0x3a09cc(null);};}for(var e in events){if(events[_0xc283('0x7')](e)){var event=events[e];ChatQueue[_0xc283('0x8')](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 4cc1cd0..aa8b39e 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 _0x608f=['moment','bluebird','request-promise','path','rimraf','./chatQueue.attributes','exports','define','ChatQueue','util','api'];(function(_0x2fb102,_0x355f97){var _0x10b7ea=function(_0x4d2d9f){while(--_0x4d2d9f){_0x2fb102['push'](_0x2fb102['shift']());}};_0x10b7ea(++_0x355f97);}(_0x608f,0x169));var _0xf608=function(_0x331b97,_0x14aa59){_0x331b97=_0x331b97-0x0;var _0x345fb5=_0x608f[_0x331b97];return _0x345fb5;};'use strict';var _=require('lodash');var util=require(_0xf608('0x0'));var logger=require('../../config/logger')(_0xf608('0x1'));var moment=require(_0xf608('0x2'));var BPromise=require(_0xf608('0x3'));var rp=require(_0xf608('0x4'));var fs=require('fs');var path=require(_0xf608('0x5'));var rimraf=require(_0xf608('0x6'));var config=require('../../config/environment');var attributes=require(_0xf608('0x7'));module[_0xf608('0x8')]=function(_0x19985f,_0x3a805b){return _0x19985f[_0xf608('0x9')](_0xf608('0xa'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x502a=['util','../../config/logger','api','moment','request-promise','path','../../config/environment','./chatQueue.attributes','define','chat_queues','lodash'];(function(_0x4e5504,_0x2be6a6){var _0x424a9e=function(_0x245b10){while(--_0x245b10){_0x4e5504['push'](_0x4e5504['shift']());}};_0x424a9e(++_0x2be6a6);}(_0x502a,0x8e));var _0xa502=function(_0x3c978b,_0x2256a9){_0x3c978b=_0x3c978b-0x0;var _0x15bc82=_0x502a[_0x3c978b];return _0x15bc82;};'use strict';var _=require(_0xa502('0x0'));var util=require(_0xa502('0x1'));var logger=require(_0xa502('0x2'))(_0xa502('0x3'));var moment=require(_0xa502('0x4'));var BPromise=require('bluebird');var rp=require(_0xa502('0x5'));var fs=require('fs');var path=require(_0xa502('0x6'));var rimraf=require('rimraf');var config=require(_0xa502('0x7'));var attributes=require(_0xa502('0x8'));module['exports']=function(_0x128359,_0xf062f6){return _0x128359[_0xa502('0x9')]('ChatQueue',attributes,{'tableName':_0xa502('0xa'),'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 93998a5..dc317f9 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 _0x082b=['ChatQueue','findAll','options','where','limit','include','map','attributes','model','ShowChatQueue','find','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','GetChatQueue'];(function(_0x291c27,_0x1d336c){var _0x542995=function(_0xb4239b){while(--_0xb4239b){_0x291c27['push'](_0x291c27['shift']());}};_0x542995(++_0x1d336c);}(_0x082b,0x1ec));var _0xb082=function(_0x131f9d,_0x35401c){_0x131f9d=_0x131f9d-0x0;var _0x5edb30=_0x082b[_0x131f9d];return _0x5edb30;};'use strict';var _=require(_0xb082('0x0'));var util=require(_0xb082('0x1'));var moment=require(_0xb082('0x2'));var BPromise=require(_0xb082('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb082('0x4'));var db=require(_0xb082('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb082('0x6'))(_0xb082('0x7'));var config=require('../../config/environment');var jayson=require(_0xb082('0x8'));var client=jayson[_0xb082('0x9')][_0xb082('0xa')]({'port':0x232a});config[_0xb082('0xb')]=_['defaults'](config[_0xb082('0xb')],{'host':_0xb082('0xc'),'port':0x18eb});var socket=require(_0xb082('0xd'))(new Redis(config['redis']));require(_0xb082('0xe'))[_0xb082('0xf')](socket);function respondWithRpcPromise(_0x2cea94,_0x362f97,_0x52d0ef){return new BPromise(function(_0x3b87d9,_0x4d95a4){return client[_0xb082('0x10')](_0x2cea94,_0x52d0ef)[_0xb082('0x11')](function(_0x5307a2){logger['info'](_0xb082('0x12'),_0x362f97,_0xb082('0x13'));logger[_0xb082('0x14')](_0xb082('0x15'),_0x362f97,_0xb082('0x13'),JSON[_0xb082('0x16')](_0x5307a2));if(_0x5307a2[_0xb082('0x17')]){if(_0x5307a2[_0xb082('0x17')]['code']===0x1f4){logger[_0xb082('0x17')](_0xb082('0x12'),_0x362f97,_0x5307a2[_0xb082('0x17')][_0xb082('0x18')]);return _0x4d95a4(_0x5307a2[_0xb082('0x17')]['message']);}logger[_0xb082('0x17')](_0xb082('0x12'),_0x362f97,_0x5307a2[_0xb082('0x17')][_0xb082('0x18')]);return _0x3b87d9(_0x5307a2[_0xb082('0x17')][_0xb082('0x18')]);}else{logger[_0xb082('0x19')]('ChatQueue,\x20%s,\x20%s',_0x362f97,'request\x20sent');_0x3b87d9(_0x5307a2['result'][_0xb082('0x18')]);}})[_0xb082('0x1a')](function(_0x569c86){logger[_0xb082('0x17')](_0xb082('0x12'),_0x362f97,_0x569c86);_0x4d95a4(_0x569c86);});});}exports[_0xb082('0x1b')]=function(_0x239794){var _0x566551=this;return new Promise(function(_0x138a40,_0x428160){return db[_0xb082('0x1c')][_0xb082('0x1d')]({'raw':_0x239794['options']?_0x239794[_0xb082('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x239794[_0xb082('0x1e')]?_0x239794[_0xb082('0x1e')][_0xb082('0x1f')]||null:null,'attributes':_0x239794[_0xb082('0x1e')]?_0x239794[_0xb082('0x1e')]['attributes']||null:null,'limit':_0x239794[_0xb082('0x1e')]?_0x239794[_0xb082('0x1e')][_0xb082('0x20')]||null:null,'include':_0x239794['options']?_0x239794[_0xb082('0x1e')][_0xb082('0x21')]?_[_0xb082('0x22')](_0x239794[_0xb082('0x1e')]['include'],function(_0x5ca741){return{'model':db[_0x5ca741['model']],'as':_0x5ca741['as'],'attributes':_0x5ca741[_0xb082('0x23')],'include':_0x5ca741[_0xb082('0x21')]?_[_0xb082('0x22')](_0x5ca741[_0xb082('0x21')],function(_0x4b39eb){return{'model':db[_0x4b39eb[_0xb082('0x24')]],'as':_0x4b39eb['as'],'attributes':_0x4b39eb[_0xb082('0x23')],'include':_0x4b39eb[_0xb082('0x21')]?_[_0xb082('0x22')](_0x4b39eb[_0xb082('0x21')],function(_0x45ff35){return{'model':db[_0x45ff35['model']],'as':_0x45ff35['as'],'attributes':_0x45ff35[_0xb082('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x569978){logger['info'](_0xb082('0x1b'),_0x239794);logger[_0xb082('0x14')](_0xb082('0x1b'),_0x239794,JSON['stringify'](_0x569978));_0x138a40(_0x569978);})[_0xb082('0x1a')](function(_0x1a5e6c){logger[_0xb082('0x17')](_0xb082('0x1b'),_0x1a5e6c[_0xb082('0x18')],_0x239794);_0x428160(_0x566551[_0xb082('0x17')](0x1f4,_0x1a5e6c[_0xb082('0x18')]));});});};exports[_0xb082('0x25')]=function(_0x5c5214){var _0x8dabd9=this;return new Promise(function(_0x192eff,_0x3ba20b){return db[_0xb082('0x1c')][_0xb082('0x26')]({'raw':_0x5c5214[_0xb082('0x1e')]?_0x5c5214[_0xb082('0x1e')][_0xb082('0x27')]===undefined?!![]:![]:!![],'where':_0x5c5214[_0xb082('0x1e')]?_0x5c5214[_0xb082('0x1e')][_0xb082('0x1f')]||null:null,'attributes':_0x5c5214[_0xb082('0x1e')]?_0x5c5214[_0xb082('0x1e')][_0xb082('0x23')]||null:null,'include':_0x5c5214[_0xb082('0x1e')]?_0x5c5214[_0xb082('0x1e')]['include']?_['map'](_0x5c5214[_0xb082('0x1e')][_0xb082('0x21')],function(_0x1cdffa){return{'model':db[_0x1cdffa[_0xb082('0x24')]],'as':_0x1cdffa['as'],'attributes':_0x1cdffa['attributes'],'include':_0x1cdffa['include']?_['map'](_0x1cdffa[_0xb082('0x21')],function(_0x275453){return{'model':db[_0x275453[_0xb082('0x24')]],'as':_0x275453['as'],'attributes':_0x275453['attributes'],'include':_0x275453[_0xb082('0x21')]?_['map'](_0x275453[_0xb082('0x21')],function(_0x48d9b7){return{'model':db[_0x48d9b7[_0xb082('0x24')]],'as':_0x48d9b7['as'],'attributes':_0x48d9b7[_0xb082('0x23')]};}):[]};}):[]};}):[]:[]})[_0xb082('0x11')](function(_0x3b7338){logger['info'](_0xb082('0x25'),_0x5c5214);logger[_0xb082('0x14')](_0xb082('0x25'),_0x5c5214,JSON[_0xb082('0x16')](_0x3b7338));_0x192eff(_0x3b7338);})['catch'](function(_0x521769){logger[_0xb082('0x17')]('ShowChatQueue',_0x521769[_0xb082('0x18')],_0x5c5214);_0x3ba20b(_0x8dabd9[_0xb082('0x17')](0x1f4,_0x521769[_0xb082('0x18')]));});});}; \ No newline at end of file +var _0x56bd=['../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetChatQueue','findAll','options','raw','attributes','include','map','model','ShowChatQueue','find','where','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x33fde0,_0x5e36dd){var _0x2e22ec=function(_0x55a97d){while(--_0x55a97d){_0x33fde0['push'](_0x33fde0['shift']());}};_0x2e22ec(++_0x5e36dd);}(_0x56bd,0xe9));var _0xd56b=function(_0x20583b,_0x5edaf9){_0x20583b=_0x20583b-0x0;var _0x1d09e2=_0x56bd[_0x20583b];return _0x1d09e2;};'use strict';var _=require('lodash');var util=require(_0xd56b('0x0'));var moment=require(_0xd56b('0x1'));var BPromise=require(_0xd56b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd56b('0x3'));var db=require(_0xd56b('0x4'))['db'];var utils=require(_0xd56b('0x5'));var logger=require(_0xd56b('0x6'))('rpc');var config=require(_0xd56b('0x7'));var jayson=require(_0xd56b('0x8'));var client=jayson[_0xd56b('0x9')][_0xd56b('0xa')]({'port':0x232a});config[_0xd56b('0xb')]=_[_0xd56b('0xc')](config[_0xd56b('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xd56b('0xd'))(new Redis(config[_0xd56b('0xb')]));require(_0xd56b('0xe'))[_0xd56b('0xf')](socket);function respondWithRpcPromise(_0x53b856,_0x5b5abd,_0x16b2c9){return new BPromise(function(_0x3271bc,_0x5a8959){return client[_0xd56b('0x10')](_0x53b856,_0x16b2c9)[_0xd56b('0x11')](function(_0x3bfaf9){logger[_0xd56b('0x12')](_0xd56b('0x13'),_0x5b5abd,_0xd56b('0x14'));logger[_0xd56b('0x15')](_0xd56b('0x16'),_0x5b5abd,_0xd56b('0x14'),JSON[_0xd56b('0x17')](_0x3bfaf9));if(_0x3bfaf9[_0xd56b('0x18')]){if(_0x3bfaf9[_0xd56b('0x18')][_0xd56b('0x19')]===0x1f4){logger[_0xd56b('0x18')](_0xd56b('0x13'),_0x5b5abd,_0x3bfaf9['error'][_0xd56b('0x1a')]);return _0x5a8959(_0x3bfaf9['error'][_0xd56b('0x1a')]);}logger[_0xd56b('0x18')](_0xd56b('0x13'),_0x5b5abd,_0x3bfaf9[_0xd56b('0x18')][_0xd56b('0x1a')]);return _0x3271bc(_0x3bfaf9[_0xd56b('0x18')][_0xd56b('0x1a')]);}else{logger[_0xd56b('0x12')](_0xd56b('0x13'),_0x5b5abd,_0xd56b('0x14'));_0x3271bc(_0x3bfaf9[_0xd56b('0x1b')]['message']);}})['catch'](function(_0x5ccee5){logger[_0xd56b('0x18')](_0xd56b('0x13'),_0x5b5abd,_0x5ccee5);_0x5a8959(_0x5ccee5);});});}exports[_0xd56b('0x1c')]=function(_0x1ac90f){var _0x149422=this;return new Promise(function(_0x106aa4,_0x477212){return db['ChatQueue'][_0xd56b('0x1d')]({'raw':_0x1ac90f[_0xd56b('0x1e')]?_0x1ac90f[_0xd56b('0x1e')][_0xd56b('0x1f')]===undefined?!![]:![]:!![],'where':_0x1ac90f[_0xd56b('0x1e')]?_0x1ac90f[_0xd56b('0x1e')]['where']||null:null,'attributes':_0x1ac90f['options']?_0x1ac90f[_0xd56b('0x1e')][_0xd56b('0x20')]||null:null,'limit':_0x1ac90f['options']?_0x1ac90f[_0xd56b('0x1e')]['limit']||null:null,'include':_0x1ac90f[_0xd56b('0x1e')]?_0x1ac90f['options'][_0xd56b('0x21')]?_[_0xd56b('0x22')](_0x1ac90f[_0xd56b('0x1e')]['include'],function(_0x42e907){return{'model':db[_0x42e907[_0xd56b('0x23')]],'as':_0x42e907['as'],'attributes':_0x42e907[_0xd56b('0x20')],'include':_0x42e907[_0xd56b('0x21')]?_[_0xd56b('0x22')](_0x42e907[_0xd56b('0x21')],function(_0x3c9730){return{'model':db[_0x3c9730['model']],'as':_0x3c9730['as'],'attributes':_0x3c9730['attributes'],'include':_0x3c9730[_0xd56b('0x21')]?_[_0xd56b('0x22')](_0x3c9730[_0xd56b('0x21')],function(_0x171ca5){return{'model':db[_0x171ca5[_0xd56b('0x23')]],'as':_0x171ca5['as'],'attributes':_0x171ca5[_0xd56b('0x20')]};}):[]};}):[]};}):[]:[]})[_0xd56b('0x11')](function(_0x18dece){logger[_0xd56b('0x12')](_0xd56b('0x1c'),_0x1ac90f);logger[_0xd56b('0x15')](_0xd56b('0x1c'),_0x1ac90f,JSON['stringify'](_0x18dece));_0x106aa4(_0x18dece);})['catch'](function(_0x155407){logger['error']('GetChatQueue',_0x155407[_0xd56b('0x1a')],_0x1ac90f);_0x477212(_0x149422[_0xd56b('0x18')](0x1f4,_0x155407[_0xd56b('0x1a')]));});});};exports[_0xd56b('0x24')]=function(_0x245673){var _0x3d9d62=this;return new Promise(function(_0x13900e,_0xbae998){return db['ChatQueue'][_0xd56b('0x25')]({'raw':_0x245673['options']?_0x245673[_0xd56b('0x1e')][_0xd56b('0x1f')]===undefined?!![]:![]:!![],'where':_0x245673[_0xd56b('0x1e')]?_0x245673[_0xd56b('0x1e')][_0xd56b('0x26')]||null:null,'attributes':_0x245673['options']?_0x245673[_0xd56b('0x1e')][_0xd56b('0x20')]||null:null,'include':_0x245673['options']?_0x245673[_0xd56b('0x1e')][_0xd56b('0x21')]?_['map'](_0x245673['options'][_0xd56b('0x21')],function(_0x576dff){return{'model':db[_0x576dff[_0xd56b('0x23')]],'as':_0x576dff['as'],'attributes':_0x576dff[_0xd56b('0x20')],'include':_0x576dff[_0xd56b('0x21')]?_[_0xd56b('0x22')](_0x576dff[_0xd56b('0x21')],function(_0x86ac7f){return{'model':db[_0x86ac7f['model']],'as':_0x86ac7f['as'],'attributes':_0x86ac7f[_0xd56b('0x20')],'include':_0x86ac7f[_0xd56b('0x21')]?_['map'](_0x86ac7f[_0xd56b('0x21')],function(_0x8d3d6b){return{'model':db[_0x8d3d6b[_0xd56b('0x23')]],'as':_0x8d3d6b['as'],'attributes':_0x8d3d6b[_0xd56b('0x20')]};}):[]};}):[]};}):[]:[]})[_0xd56b('0x11')](function(_0x6075d0){logger[_0xd56b('0x12')]('ShowChatQueue',_0x245673);logger[_0xd56b('0x15')](_0xd56b('0x24'),_0x245673,JSON[_0xd56b('0x17')](_0x6075d0));_0x13900e(_0x6075d0);})[_0xd56b('0x27')](function(_0x5d0102){logger[_0xd56b('0x18')](_0xd56b('0x24'),_0x5d0102[_0xd56b('0x1a')],_0x245673);_0xbae998(_0x3d9d62[_0xd56b('0x18')](0x1f4,_0x5d0102[_0xd56b('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 4d9681b..86d17e0 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 _0x5ad3=['register','chatQueue:','./chatQueue.events','save','remove','update','emit','removeListener'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x5ad3,0x1e2));var _0x35ad=function(_0xdeefbd,_0x9e1b3d){_0xdeefbd=_0xdeefbd-0x0;var _0x4ff63f=_0x5ad3[_0xdeefbd];return _0x4ff63f;};'use strict';var ChatQueueEvents=require(_0x35ad('0x0'));var events=[_0x35ad('0x1'),_0x35ad('0x2'),_0x35ad('0x3')];function createListener(_0x5543d1,_0x468072){return function(_0x373228){_0x468072[_0x35ad('0x4')](_0x5543d1,_0x373228);};}function removeListener(_0x69a0b3,_0x450f55){return function(){ChatQueueEvents[_0x35ad('0x5')](_0x69a0b3,_0x450f55);};}exports[_0x35ad('0x6')]=function(_0x436dcb){for(var _0x36c606=0x0,_0x31cc6a=events['length'];_0x36c606<_0x31cc6a;_0x36c606++){var _0x292521=events[_0x36c606];var _0x3cec3e=createListener(_0x35ad('0x7')+_0x292521,_0x436dcb);ChatQueueEvents['on'](_0x292521,_0x3cec3e);}}; \ No newline at end of file +var _0x6737=['chatQueue:','save','remove','emit','removeListener'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x6737,0xe2));var _0x7673=function(_0x3a4b7b,_0x117c3b){_0x3a4b7b=_0x3a4b7b-0x0;var _0x396537=_0x6737[_0x3a4b7b];return _0x396537;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0x7673('0x0'),_0x7673('0x1'),'update'];function createListener(_0x2f05d4,_0x2a9cd0){return function(_0x43ee27){_0x2a9cd0[_0x7673('0x2')](_0x2f05d4,_0x43ee27);};}function removeListener(_0x54002e,_0x32e6f2){return function(){ChatQueueEvents[_0x7673('0x3')](_0x54002e,_0x32e6f2);};}exports['register']=function(_0x2f5edc){for(var _0x15230f=0x0,_0x5af802=events['length'];_0x15230f<_0x5af802;_0x15230f++){var _0x53d67d=events[_0x15230f];var _0x5292f7=createListener(_0x7673('0x4')+_0x53d67d,_0x2f5edc);ChatQueueEvents['on'](_0x53d67d,_0x5292f7);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index f198923..a894d7f 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 _0x55ca=['post','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','addTeams'];(function(_0x66a3f9,_0x58eef8){var _0x4c6c4a=function(_0x3adf2d){while(--_0x3adf2d){_0x66a3f9['push'](_0x66a3f9['shift']());}};_0x4c6c4a(++_0x58eef8);}(_0x55ca,0x126));var _0xa55c=function(_0x5743e3,_0x4a2aab){_0x5743e3=_0x5743e3-0x0;var _0x24d100=_0x55ca[_0x5743e3];return _0x24d100;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/describe',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['show']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getAgents']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/teams',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x13')]);router['put'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router[_0xa55c('0x15')](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x16')]);router[_0xa55c('0x15')](_0xa55c('0xe'),auth['isAuthenticated'](),controller[_0xa55c('0x17')]);router[_0xa55c('0x15')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x18')]);module[_0xa55c('0x19')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','/:id/teams','removeTeams','multer','util','path'];(function(_0x362f01,_0x464acd){var _0xfc2aca=function(_0x19f8ab){while(--_0x19f8ab){_0x362f01['push'](_0x362f01['shift']());}};_0xfc2aca(++_0x464acd);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/teams',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x14')](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x17')]);router[_0x7995('0x18')](_0x7995('0x19'),auth[_0x7995('0xa')](),controller['update']);router[_0x7995('0x1a')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0x1b')]);router[_0x7995('0x1a')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router['delete']('/:id/users',auth[_0x7995('0xa')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 8823fb0..4f101dd 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 _0x541e=['STRING','DATE'];(function(_0x2307fa,_0x266e5e){var _0x496486=function(_0x53466e){while(--_0x53466e){_0x2307fa['push'](_0x2307fa['shift']());}};_0x496486(++_0x266e5e);}(_0x541e,0x1a0));var _0xe541=function(_0x3a2ccf,_0x2cfbde){_0x3a2ccf=_0x3a2ccf-0x0;var _0xc0efec=_0x541e[_0x3a2ccf];return _0xc0efec;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xe541('0x0')],'allowNull':![]},'from':{'type':Sequelize[_0xe541('0x0')]},'joinAt':{'type':Sequelize[_0xe541('0x1')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xe541('0x1')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xec82=['DATE','moment','STRING'];(function(_0xf73766,_0x314c10){var _0x14165d=function(_0x343b97){while(--_0x343b97){_0xf73766['push'](_0xf73766['shift']());}};_0x14165d(++_0x314c10);}(_0xec82,0x184));var _0x2ec8=function(_0x2af104,_0x50f765){_0x2af104=_0x2af104-0x0;var _0x4a14b4=_0xec82[_0x2af104];return _0x4a14b4;};'use strict';var moment=require(_0x2ec8('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x2ec8('0x1')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x2ec8('0x2')]},'leaveAt':{'type':Sequelize[_0x2ec8('0x2')]},'acceptAt':{'type':Sequelize[_0x2ec8('0x2')]},'exitAt':{'type':Sequelize[_0x2ec8('0x2')]},'reason':{'type':Sequelize[_0x2ec8('0x1')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 765e047..2c90695 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 _0xe062=['show','params','keys','options','find','body','update','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','offset','limit','count','set','Content-Range','json','apply','then','destroy','sendStatus','error','name','index','map','rawAttributes','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','ChatQueueReport','includeAll','include','findAll','rows','catch'];(function(_0x507527,_0x3d1f6e){var _0x2dec80=function(_0x5c1e5f){while(--_0x5c1e5f){_0x507527['push'](_0x507527['shift']());}};_0x2dec80(++_0x3d1f6e);}(_0xe062,0x1b8));var _0x2e06=function(_0x762caf,_0xfb4e3d){_0x762caf=_0x762caf-0x0;var _0x56d592=_0xe062[_0x762caf];return _0x56d592;};'use strict';var emlformat=require(_0x2e06('0x0'));var rimraf=require(_0x2e06('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2e06('0x2'));var moment=require(_0x2e06('0x3'));var BPromise=require(_0x2e06('0x4'));var Mustache=require(_0x2e06('0x5'));var util=require(_0x2e06('0x6'));var path=require(_0x2e06('0x7'));var sox=require(_0x2e06('0x8'));var csv=require(_0x2e06('0x9'));var ejs=require(_0x2e06('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2e06('0xb'));var deskjs=require(_0x2e06('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2e06('0xd'));var Redis=require(_0x2e06('0xe'));var authService=require(_0x2e06('0xf'));var qs=require(_0x2e06('0x10'));var as=require(_0x2e06('0x11'));var hardwareService=require(_0x2e06('0x12'));var logger=require(_0x2e06('0x13'))(_0x2e06('0x14'));var utils=require(_0x2e06('0x15'));var config=require(_0x2e06('0x16'));var licenseUtil=require(_0x2e06('0x17'));var db=require(_0x2e06('0x18'))['db'];function respondWithStatusCode(_0x54d0f8,_0x37504e){_0x37504e=_0x37504e||0xcc;return function(_0x733017){if(_0x733017){return _0x54d0f8['sendStatus'](_0x37504e);}return _0x54d0f8['status'](_0x37504e)[_0x2e06('0x19')]();};}function respondWithResult(_0x45d9a7,_0x4d8ff3){_0x4d8ff3=_0x4d8ff3||0xc8;return function(_0x48d757){if(_0x48d757){return _0x45d9a7[_0x2e06('0x1a')](_0x4d8ff3)['json'](_0x48d757);}};}function respondWithFilteredResult(_0x4935b3,_0x982729){return function(_0xb1dfa9){if(_0xb1dfa9){var _0x501a19=typeof _0x982729[_0x2e06('0x1b')]==='undefined'&&typeof _0x982729[_0x2e06('0x1c')]==='undefined';var _0x15a25b=_0xb1dfa9[_0x2e06('0x1d')];var _0x2359e6=_0x501a19?0x0:_0x982729[_0x2e06('0x1b')];var _0x23e38b=_0x501a19?_0xb1dfa9[_0x2e06('0x1d')]:_0x982729[_0x2e06('0x1b')]+_0x982729['limit'];var _0x3dcf38;if(_0x23e38b>=_0x15a25b){_0x23e38b=_0x15a25b;_0x3dcf38=0xc8;}else{_0x3dcf38=0xce;}_0x4935b3[_0x2e06('0x1a')](_0x3dcf38);return _0x4935b3[_0x2e06('0x1e')](_0x2e06('0x1f'),_0x2359e6+'-'+_0x23e38b+'/'+_0x15a25b)[_0x2e06('0x20')](_0xb1dfa9);}return null;};}function patchUpdates(_0x43a978){return function(_0x10d4e3){try{jsonpatch[_0x2e06('0x21')](_0x10d4e3,_0x43a978,!![]);}catch(_0x13b89c){return BPromise['reject'](_0x13b89c);}return _0x10d4e3['save']();};}function saveUpdates(_0x52baf9,_0x5c2736){return function(_0x431a90){if(_0x431a90){return _0x431a90['update'](_0x52baf9)[_0x2e06('0x22')](function(_0x1c65c7){return _0x1c65c7;});}return null;};}function removeEntity(_0x569a45,_0x4e895f){return function(_0x1eba15){if(_0x1eba15){return _0x1eba15[_0x2e06('0x23')]()[_0x2e06('0x22')](function(){_0x569a45[_0x2e06('0x1a')](0xcc)[_0x2e06('0x19')]();});}};}function handleEntityNotFound(_0x367ac7,_0x58e0c6){return function(_0x4e0d68){if(!_0x4e0d68){_0x367ac7[_0x2e06('0x24')](0x194);}return _0x4e0d68;};}function handleError(_0x51e780,_0x427dac){_0x427dac=_0x427dac||0x1f4;return function(_0x4cd21d){logger[_0x2e06('0x25')](_0x4cd21d['stack']);if(_0x4cd21d[_0x2e06('0x26')]){delete _0x4cd21d[_0x2e06('0x26')];}_0x51e780['status'](_0x427dac)['send'](_0x4cd21d);};}exports[_0x2e06('0x27')]=function(_0x39d862,_0x37ede1){var _0x588cd6={},_0x5cd5b7={},_0x2bba8d={'count':0x0,'rows':[]};var _0x568fad=_[_0x2e06('0x28')](db['ChatQueueReport'][_0x2e06('0x29')],function(_0x35bf89){return{'name':_0x35bf89['fieldName'],'type':_0x35bf89['type']['key']};});_0x5cd5b7[_0x2e06('0x2a')]=_[_0x2e06('0x28')](_0x568fad,_0x2e06('0x26'));_0x5cd5b7[_0x2e06('0x2b')]=_['keys'](_0x39d862[_0x2e06('0x2b')]);_0x5cd5b7[_0x2e06('0x2c')]=_[_0x2e06('0x2d')](_0x5cd5b7['model'],_0x5cd5b7[_0x2e06('0x2b')]);_0x588cd6[_0x2e06('0x2e')]=_[_0x2e06('0x2d')](_0x5cd5b7['model'],qs['fields'](_0x39d862[_0x2e06('0x2b')][_0x2e06('0x2f')]));_0x588cd6[_0x2e06('0x2e')]=_0x588cd6[_0x2e06('0x2e')][_0x2e06('0x30')]?_0x588cd6['attributes']:_0x5cd5b7[_0x2e06('0x2a')];if(!_0x39d862['query'][_0x2e06('0x31')](_0x2e06('0x32'))){_0x588cd6[_0x2e06('0x1c')]=qs[_0x2e06('0x1c')](_0x39d862[_0x2e06('0x2b')]['limit']);_0x588cd6[_0x2e06('0x1b')]=qs[_0x2e06('0x1b')](_0x39d862['query'][_0x2e06('0x1b')]);}_0x588cd6[_0x2e06('0x33')]=qs[_0x2e06('0x34')](_0x39d862[_0x2e06('0x2b')][_0x2e06('0x34')]);_0x588cd6[_0x2e06('0x35')]=qs[_0x2e06('0x2c')](_[_0x2e06('0x36')](_0x39d862['query'],_0x5cd5b7[_0x2e06('0x2c')]),_0x568fad);if(_0x39d862[_0x2e06('0x2b')][_0x2e06('0x37')]){_0x588cd6[_0x2e06('0x35')]=_[_0x2e06('0x38')](_0x588cd6[_0x2e06('0x35')],{'$or':_[_0x2e06('0x28')](_0x568fad,function(_0x101142){if(_0x101142['type']!==_0x2e06('0x39')){var _0x4fe373={};_0x4fe373[_0x101142[_0x2e06('0x26')]]={'$like':'%'+_0x39d862[_0x2e06('0x2b')][_0x2e06('0x37')]+'%'};return _0x4fe373;}})});}_0x588cd6=_['merge']({},_0x588cd6,_0x39d862['options']);var _0x5a5fe2={'where':_0x588cd6['where']};return db[_0x2e06('0x3a')][_0x2e06('0x1d')](_0x5a5fe2)[_0x2e06('0x22')](function(_0x2cd56b){_0x2bba8d['count']=_0x2cd56b;if(_0x39d862[_0x2e06('0x2b')][_0x2e06('0x3b')]){_0x588cd6[_0x2e06('0x3c')]=[{'all':!![]}];}return db[_0x2e06('0x3a')][_0x2e06('0x3d')](_0x588cd6);})['then'](function(_0x2630b3){_0x2bba8d[_0x2e06('0x3e')]=_0x2630b3;return _0x2bba8d;})['then'](respondWithFilteredResult(_0x37ede1,_0x588cd6))[_0x2e06('0x3f')](handleError(_0x37ede1,null));};exports[_0x2e06('0x40')]=function(_0x18a663,_0x40fba2){var _0x46e2d2={'raw':!![],'where':{'id':_0x18a663[_0x2e06('0x41')]['id']}},_0x25eba3={};_0x25eba3[_0x2e06('0x2a')]=_[_0x2e06('0x42')](db[_0x2e06('0x3a')][_0x2e06('0x29')]);_0x25eba3['query']=_['keys'](_0x18a663[_0x2e06('0x2b')]);_0x25eba3['filters']=_['intersection'](_0x25eba3[_0x2e06('0x2a')],_0x25eba3[_0x2e06('0x2b')]);_0x46e2d2[_0x2e06('0x2e')]=_['intersection'](_0x25eba3[_0x2e06('0x2a')],qs[_0x2e06('0x2f')](_0x18a663['query'][_0x2e06('0x2f')]));_0x46e2d2[_0x2e06('0x2e')]=_0x46e2d2[_0x2e06('0x2e')][_0x2e06('0x30')]?_0x46e2d2[_0x2e06('0x2e')]:_0x25eba3[_0x2e06('0x2a')];if(_0x18a663['query'][_0x2e06('0x3b')]){_0x46e2d2['include']=[{'all':!![]}];}_0x46e2d2=_[_0x2e06('0x38')]({},_0x46e2d2,_0x18a663[_0x2e06('0x43')]);return db[_0x2e06('0x3a')][_0x2e06('0x44')](_0x46e2d2)[_0x2e06('0x22')](handleEntityNotFound(_0x40fba2,null))[_0x2e06('0x22')](respondWithResult(_0x40fba2,null))['catch'](handleError(_0x40fba2,null));};exports['create']=function(_0x1f8be4,_0x31dd08){return db[_0x2e06('0x3a')]['create'](_0x1f8be4[_0x2e06('0x45')],{})['then'](respondWithResult(_0x31dd08,0xc9))[_0x2e06('0x3f')](handleError(_0x31dd08,null));};exports[_0x2e06('0x46')]=function(_0x4cc187,_0x125b64){if(_0x4cc187[_0x2e06('0x45')]['id']){delete _0x4cc187[_0x2e06('0x45')]['id'];}return db[_0x2e06('0x3a')]['find']({'where':{'id':_0x4cc187['params']['id']}})['then'](handleEntityNotFound(_0x125b64,null))[_0x2e06('0x22')](saveUpdates(_0x4cc187[_0x2e06('0x45')],null))[_0x2e06('0x22')](respondWithResult(_0x125b64,null))[_0x2e06('0x3f')](handleError(_0x125b64,null));};exports[_0x2e06('0x23')]=function(_0x55ba55,_0x45e57f){return db[_0x2e06('0x3a')][_0x2e06('0x44')]({'where':{'id':_0x55ba55['params']['id']}})[_0x2e06('0x22')](handleEntityNotFound(_0x45e57f,null))[_0x2e06('0x22')](removeEntity(_0x45e57f,null))['catch'](handleError(_0x45e57f,null));};exports[_0x2e06('0x47')]=function(_0x1ac74f,_0x5b92fe){return db[_0x2e06('0x3a')][_0x2e06('0x47')]()[_0x2e06('0x22')](respondWithResult(_0x5b92fe,null))[_0x2e06('0x3f')](handleError(_0x5b92fe,null));}; \ No newline at end of file +var _0xc0d7=['squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','update','then','destroy','error','stack','name','send','index','map','ChatQueueReport','rawAttributes','type','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','filter','options','include','findAll','find','create','catch','body','params','describe','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash'];(function(_0x4c190d,_0x5b9e3b){var _0x1e72c4=function(_0x1ca2a0){while(--_0x1ca2a0){_0x4c190d['push'](_0x4c190d['shift']());}};_0x1e72c4(++_0x5b9e3b);}(_0xc0d7,0x7f));var _0x7c0d=function(_0x27b3c6,_0x5f5957){_0x27b3c6=_0x27b3c6-0x0;var _0x5248ca=_0xc0d7[_0x27b3c6];return _0x5248ca;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7c0d('0x0'));var rp=require(_0x7c0d('0x1'));var moment=require(_0x7c0d('0x2'));var BPromise=require(_0x7c0d('0x3'));var Mustache=require(_0x7c0d('0x4'));var util=require(_0x7c0d('0x5'));var path=require(_0x7c0d('0x6'));var sox=require(_0x7c0d('0x7'));var csv=require(_0x7c0d('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7c0d('0x9'));var _=require(_0x7c0d('0xa'));var squel=require(_0x7c0d('0xb'));var crypto=require(_0x7c0d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7c0d('0xd'));var toCsv=require(_0x7c0d('0x8'));var querystring=require(_0x7c0d('0xe'));var Papa=require(_0x7c0d('0xf'));var Redis=require('ioredis');var authService=require(_0x7c0d('0x10'));var qs=require(_0x7c0d('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7c0d('0x12'))(_0x7c0d('0x13'));var utils=require('../../config/utils');var config=require(_0x7c0d('0x14'));var licenseUtil=require(_0x7c0d('0x15'));var db=require(_0x7c0d('0x16'))['db'];function respondWithStatusCode(_0x198dde,_0x41236d){_0x41236d=_0x41236d||0xcc;return function(_0x34dccf){if(_0x34dccf){return _0x198dde['sendStatus'](_0x41236d);}return _0x198dde[_0x7c0d('0x17')](_0x41236d)[_0x7c0d('0x18')]();};}function respondWithResult(_0x2ee593,_0x25c4a8){_0x25c4a8=_0x25c4a8||0xc8;return function(_0x33dd94){if(_0x33dd94){return _0x2ee593[_0x7c0d('0x17')](_0x25c4a8)[_0x7c0d('0x19')](_0x33dd94);}};}function respondWithFilteredResult(_0x13f301,_0x4a5fb4){return function(_0x340937){if(_0x340937){var _0x4e9850=typeof _0x4a5fb4[_0x7c0d('0x1a')]==='undefined'&&typeof _0x4a5fb4[_0x7c0d('0x1b')]===_0x7c0d('0x1c');var _0x478100=_0x340937[_0x7c0d('0x1d')];var _0x2841e1=_0x4e9850?0x0:_0x4a5fb4[_0x7c0d('0x1a')];var _0x1418ee=_0x4e9850?_0x340937[_0x7c0d('0x1d')]:_0x4a5fb4[_0x7c0d('0x1a')]+_0x4a5fb4[_0x7c0d('0x1b')];var _0x111dbe;if(_0x1418ee>=_0x478100){_0x1418ee=_0x478100;_0x111dbe=0xc8;}else{_0x111dbe=0xce;}_0x13f301[_0x7c0d('0x17')](_0x111dbe);return _0x13f301[_0x7c0d('0x1e')](_0x7c0d('0x1f'),_0x2841e1+'-'+_0x1418ee+'/'+_0x478100)[_0x7c0d('0x19')](_0x340937);}return null;};}function patchUpdates(_0x12e19a){return function(_0x2f0ac0){try{jsonpatch[_0x7c0d('0x20')](_0x2f0ac0,_0x12e19a,!![]);}catch(_0x1308c6){return BPromise['reject'](_0x1308c6);}return _0x2f0ac0['save']();};}function saveUpdates(_0x5dae80,_0x54b14f){return function(_0x5872fe){if(_0x5872fe){return _0x5872fe[_0x7c0d('0x21')](_0x5dae80)[_0x7c0d('0x22')](function(_0x1c7b84){return _0x1c7b84;});}return null;};}function removeEntity(_0x2f657e,_0x1ef191){return function(_0x2a92ce){if(_0x2a92ce){return _0x2a92ce[_0x7c0d('0x23')]()['then'](function(){_0x2f657e[_0x7c0d('0x17')](0xcc)[_0x7c0d('0x18')]();});}};}function handleEntityNotFound(_0x5aa006,_0x540abc){return function(_0x357cca){if(!_0x357cca){_0x5aa006['sendStatus'](0x194);}return _0x357cca;};}function handleError(_0x236973,_0x305a3a){_0x305a3a=_0x305a3a||0x1f4;return function(_0x43ba3b){logger[_0x7c0d('0x24')](_0x43ba3b[_0x7c0d('0x25')]);if(_0x43ba3b['name']){delete _0x43ba3b[_0x7c0d('0x26')];}_0x236973[_0x7c0d('0x17')](_0x305a3a)[_0x7c0d('0x27')](_0x43ba3b);};}exports[_0x7c0d('0x28')]=function(_0x2a8756,_0x4aea76){var _0x2b261={},_0x553627={},_0x3a8947={'count':0x0,'rows':[]};var _0x1d2020=_[_0x7c0d('0x29')](db[_0x7c0d('0x2a')][_0x7c0d('0x2b')],function(_0x35284b){return{'name':_0x35284b['fieldName'],'type':_0x35284b[_0x7c0d('0x2c')]['key']};});_0x553627[_0x7c0d('0x2d')]=_[_0x7c0d('0x29')](_0x1d2020,'name');_0x553627['query']=_[_0x7c0d('0x2e')](_0x2a8756['query']);_0x553627[_0x7c0d('0x2f')]=_[_0x7c0d('0x30')](_0x553627['model'],_0x553627['query']);_0x2b261['attributes']=_['intersection'](_0x553627[_0x7c0d('0x2d')],qs['fields'](_0x2a8756[_0x7c0d('0x31')][_0x7c0d('0x32')]));_0x2b261['attributes']=_0x2b261[_0x7c0d('0x33')][_0x7c0d('0x34')]?_0x2b261[_0x7c0d('0x33')]:_0x553627[_0x7c0d('0x2d')];if(!_0x2a8756['query'][_0x7c0d('0x35')](_0x7c0d('0x36'))){_0x2b261[_0x7c0d('0x1b')]=qs[_0x7c0d('0x1b')](_0x2a8756[_0x7c0d('0x31')][_0x7c0d('0x1b')]);_0x2b261[_0x7c0d('0x1a')]=qs[_0x7c0d('0x1a')](_0x2a8756[_0x7c0d('0x31')][_0x7c0d('0x1a')]);}_0x2b261['order']=qs[_0x7c0d('0x37')](_0x2a8756[_0x7c0d('0x31')]['sort']);_0x2b261[_0x7c0d('0x38')]=qs[_0x7c0d('0x2f')](_[_0x7c0d('0x39')](_0x2a8756[_0x7c0d('0x31')],_0x553627[_0x7c0d('0x2f')]),_0x1d2020);if(_0x2a8756[_0x7c0d('0x31')]['filter']){_0x2b261[_0x7c0d('0x38')]=_[_0x7c0d('0x3a')](_0x2b261[_0x7c0d('0x38')],{'$or':_[_0x7c0d('0x29')](_0x1d2020,function(_0xf5058e){if(_0xf5058e['type']!=='VIRTUAL'){var _0x653e1f={};_0x653e1f[_0xf5058e[_0x7c0d('0x26')]]={'$like':'%'+_0x2a8756['query'][_0x7c0d('0x3b')]+'%'};return _0x653e1f;}})});}_0x2b261=_['merge']({},_0x2b261,_0x2a8756[_0x7c0d('0x3c')]);var _0x544e9f={'where':_0x2b261['where']};return db[_0x7c0d('0x2a')]['count'](_0x544e9f)[_0x7c0d('0x22')](function(_0x1a0daa){_0x3a8947['count']=_0x1a0daa;if(_0x2a8756['query']['includeAll']){_0x2b261[_0x7c0d('0x3d')]=[{'all':!![]}];}return db[_0x7c0d('0x2a')][_0x7c0d('0x3e')](_0x2b261);})[_0x7c0d('0x22')](function(_0x5dc200){_0x3a8947['rows']=_0x5dc200;return _0x3a8947;})[_0x7c0d('0x22')](respondWithFilteredResult(_0x4aea76,_0x2b261))['catch'](handleError(_0x4aea76,null));};exports['show']=function(_0x420ecf,_0x5dd062){var _0x2ae43c={'raw':!![],'where':{'id':_0x420ecf['params']['id']}},_0x36aafb={};_0x36aafb[_0x7c0d('0x2d')]=_[_0x7c0d('0x2e')](db[_0x7c0d('0x2a')][_0x7c0d('0x2b')]);_0x36aafb[_0x7c0d('0x31')]=_['keys'](_0x420ecf[_0x7c0d('0x31')]);_0x36aafb[_0x7c0d('0x2f')]=_['intersection'](_0x36aafb[_0x7c0d('0x2d')],_0x36aafb[_0x7c0d('0x31')]);_0x2ae43c[_0x7c0d('0x33')]=_[_0x7c0d('0x30')](_0x36aafb['model'],qs[_0x7c0d('0x32')](_0x420ecf[_0x7c0d('0x31')][_0x7c0d('0x32')]));_0x2ae43c[_0x7c0d('0x33')]=_0x2ae43c[_0x7c0d('0x33')]['length']?_0x2ae43c[_0x7c0d('0x33')]:_0x36aafb['model'];if(_0x420ecf[_0x7c0d('0x31')]['includeAll']){_0x2ae43c[_0x7c0d('0x3d')]=[{'all':!![]}];}_0x2ae43c=_[_0x7c0d('0x3a')]({},_0x2ae43c,_0x420ecf[_0x7c0d('0x3c')]);return db[_0x7c0d('0x2a')][_0x7c0d('0x3f')](_0x2ae43c)['then'](handleEntityNotFound(_0x5dd062,null))[_0x7c0d('0x22')](respondWithResult(_0x5dd062,null))['catch'](handleError(_0x5dd062,null));};exports[_0x7c0d('0x40')]=function(_0x182029,_0x32bb12){return db['ChatQueueReport'][_0x7c0d('0x40')](_0x182029['body'],{})['then'](respondWithResult(_0x32bb12,0xc9))[_0x7c0d('0x41')](handleError(_0x32bb12,null));};exports[_0x7c0d('0x21')]=function(_0x24a5c4,_0x57038b){if(_0x24a5c4[_0x7c0d('0x42')]['id']){delete _0x24a5c4[_0x7c0d('0x42')]['id'];}return db[_0x7c0d('0x2a')]['find']({'where':{'id':_0x24a5c4[_0x7c0d('0x43')]['id']}})[_0x7c0d('0x22')](handleEntityNotFound(_0x57038b,null))[_0x7c0d('0x22')](saveUpdates(_0x24a5c4[_0x7c0d('0x42')],null))[_0x7c0d('0x22')](respondWithResult(_0x57038b,null))['catch'](handleError(_0x57038b,null));};exports['destroy']=function(_0x41c115,_0x333ebf){return db['ChatQueueReport']['find']({'where':{'id':_0x41c115[_0x7c0d('0x43')]['id']}})[_0x7c0d('0x22')](handleEntityNotFound(_0x333ebf,null))[_0x7c0d('0x22')](removeEntity(_0x333ebf,null))['catch'](handleError(_0x333ebf,null));};exports[_0x7c0d('0x44')]=function(_0x1522e3,_0x12e84d){return db[_0x7c0d('0x2a')][_0x7c0d('0x44')]()[_0x7c0d('0x22')](respondWithResult(_0x12e84d,null))['catch'](handleError(_0x12e84d,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 27bbf08..1788ee0 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 _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x51313d,_0x475a8f){var _0x4a1b64=function(_0x3fdcf6){while(--_0x3fdcf6){_0x51313d['push'](_0x51313d['shift']());}};_0x4a1b64(++_0x475a8f);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'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('./chatQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf0=['define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0x1532cc,_0x177dfd){var _0x5e1fab=function(_0x1fd1ae){while(--_0x1fd1ae){_0x1532cc['push'](_0x1532cc['shift']());}};_0x5e1fab(++_0x177dfd);}(_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 logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 9103516..50424de 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 _0xb4f4=['then','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','CreateChatQueueReport','ChatQueueReport','create','options','raw','update','where','limit','UpdateChatQueueReport','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x3053f7,_0x40b764){var _0x5430d7=function(_0x50fd04){while(--_0x50fd04){_0x3053f7['push'](_0x3053f7['shift']());}};_0x5430d7(++_0x40b764);}(_0xb4f4,0xda));var _0x4b4f=function(_0x56916d,_0x37b935){_0x56916d=_0x56916d-0x0;var _0x2b7f1f=_0xb4f4[_0x56916d];return _0x2b7f1f;};'use strict';var _=require(_0x4b4f('0x0'));var util=require(_0x4b4f('0x1'));var moment=require('moment');var BPromise=require(_0x4b4f('0x2'));var rs=require(_0x4b4f('0x3'));var fs=require('fs');var Redis=require(_0x4b4f('0x4'));var db=require(_0x4b4f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4b4f('0x6'))(_0x4b4f('0x7'));var config=require(_0x4b4f('0x8'));var jayson=require(_0x4b4f('0x9'));var client=jayson[_0x4b4f('0xa')][_0x4b4f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x405321,_0x58c1e5,_0x5ba9b0){return new BPromise(function(_0x108b4e,_0x2c647f){return client[_0x4b4f('0xc')](_0x405321,_0x5ba9b0)[_0x4b4f('0xd')](function(_0x25e0c9){logger['info'](_0x4b4f('0xe'),_0x58c1e5,_0x4b4f('0xf'));logger[_0x4b4f('0x10')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x58c1e5,_0x4b4f('0xf'),JSON[_0x4b4f('0x11')](_0x25e0c9));if(_0x25e0c9['error']){if(_0x25e0c9[_0x4b4f('0x12')][_0x4b4f('0x13')]===0x1f4){logger[_0x4b4f('0x12')](_0x4b4f('0xe'),_0x58c1e5,_0x25e0c9[_0x4b4f('0x12')][_0x4b4f('0x14')]);return _0x2c647f(_0x25e0c9[_0x4b4f('0x12')][_0x4b4f('0x14')]);}logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x58c1e5,_0x25e0c9[_0x4b4f('0x12')][_0x4b4f('0x14')]);return _0x108b4e(_0x25e0c9['error'][_0x4b4f('0x14')]);}else{logger[_0x4b4f('0x15')](_0x4b4f('0xe'),_0x58c1e5,'request\x20sent');_0x108b4e(_0x25e0c9[_0x4b4f('0x16')][_0x4b4f('0x14')]);}})[_0x4b4f('0x17')](function(_0x57d09a){logger[_0x4b4f('0x12')](_0x4b4f('0xe'),_0x58c1e5,_0x57d09a);_0x2c647f(_0x57d09a);});});}exports[_0x4b4f('0x18')]=function(_0x3a0ae3){var _0x246cde=this;return new Promise(function(_0x406e5b,_0x264097){return db[_0x4b4f('0x19')][_0x4b4f('0x1a')](_0x3a0ae3['body'],{'raw':_0x3a0ae3[_0x4b4f('0x1b')]?_0x3a0ae3[_0x4b4f('0x1b')][_0x4b4f('0x1c')]===undefined?!![]:![]:!![]})[_0x4b4f('0xd')](function(_0x3ae9f2){logger[_0x4b4f('0x15')](_0x4b4f('0x18'),_0x3a0ae3);logger[_0x4b4f('0x10')](_0x4b4f('0x18'),_0x3a0ae3,JSON[_0x4b4f('0x11')](_0x3ae9f2));_0x406e5b(_0x3ae9f2);})[_0x4b4f('0x17')](function(_0x48c58d){logger[_0x4b4f('0x12')](_0x4b4f('0x18'),_0x48c58d[_0x4b4f('0x14')],_0x3a0ae3);_0x264097(_0x246cde['error'](0x1f4,_0x48c58d[_0x4b4f('0x14')]));});});};exports['UpdateChatQueueReport']=function(_0x2c6405){var _0x5b422a=this;return new Promise(function(_0x248112,_0x5da930){return db[_0x4b4f('0x19')][_0x4b4f('0x1d')](_0x2c6405['body'],{'raw':_0x2c6405[_0x4b4f('0x1b')]?_0x2c6405[_0x4b4f('0x1b')][_0x4b4f('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c6405[_0x4b4f('0x1b')]?_0x2c6405[_0x4b4f('0x1b')][_0x4b4f('0x1e')]||null:null,'attributes':_0x2c6405[_0x4b4f('0x1b')]?_0x2c6405[_0x4b4f('0x1b')]['attributes']||null:null,'limit':_0x2c6405['options']?_0x2c6405[_0x4b4f('0x1b')][_0x4b4f('0x1f')]||null:null})[_0x4b4f('0xd')](function(_0x2726c9){logger[_0x4b4f('0x15')](_0x4b4f('0x20'),_0x2c6405);logger[_0x4b4f('0x10')](_0x4b4f('0x20'),_0x2c6405,JSON[_0x4b4f('0x11')](_0x2726c9));_0x248112(_0x2726c9);})[_0x4b4f('0x17')](function(_0x3b8e14){logger['error']('UpdateChatQueueReport',_0x3b8e14[_0x4b4f('0x14')],_0x2c6405);_0x5da930(_0x5b422a[_0x4b4f('0x12')](0x1f4,_0x3b8e14[_0x4b4f('0x14')]));});});}; \ No newline at end of file +var _0x73b8=['../../config/logger','rpc','../../config/environment','client','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateChatQueueReport','ChatQueueReport','create','body','catch','update','raw','options','where','attributes','limit','UpdateChatQueueReport','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x549321,_0xbcd660){var _0x597e73=function(_0x4aad10){while(--_0x4aad10){_0x549321['push'](_0x549321['shift']());}};_0x597e73(++_0xbcd660);}(_0x73b8,0x187));var _0x873b=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x73b8[_0x110c3d];return _0x226d67;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x873b('0x0'));var BPromise=require(_0x873b('0x1'));var rs=require(_0x873b('0x2'));var fs=require('fs');var Redis=require(_0x873b('0x3'));var db=require(_0x873b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x873b('0x5'))(_0x873b('0x6'));var config=require(_0x873b('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x873b('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f9ad4,_0x4e94e6,_0x13866e){return new BPromise(function(_0x437027,_0x185e7){return client[_0x873b('0x9')](_0x1f9ad4,_0x13866e)[_0x873b('0xa')](function(_0xc4c0f0){logger[_0x873b('0xb')](_0x873b('0xc'),_0x4e94e6,_0x873b('0xd'));logger[_0x873b('0xe')](_0x873b('0xf'),_0x4e94e6,_0x873b('0xd'),JSON[_0x873b('0x10')](_0xc4c0f0));if(_0xc4c0f0[_0x873b('0x11')]){if(_0xc4c0f0[_0x873b('0x11')][_0x873b('0x12')]===0x1f4){logger[_0x873b('0x11')](_0x873b('0xc'),_0x4e94e6,_0xc4c0f0[_0x873b('0x11')][_0x873b('0x13')]);return _0x185e7(_0xc4c0f0[_0x873b('0x11')]['message']);}logger[_0x873b('0x11')](_0x873b('0xc'),_0x4e94e6,_0xc4c0f0[_0x873b('0x11')][_0x873b('0x13')]);return _0x437027(_0xc4c0f0[_0x873b('0x11')]['message']);}else{logger[_0x873b('0xb')](_0x873b('0xc'),_0x4e94e6,_0x873b('0xd'));_0x437027(_0xc4c0f0[_0x873b('0x14')][_0x873b('0x13')]);}})['catch'](function(_0x47492b){logger[_0x873b('0x11')](_0x873b('0xc'),_0x4e94e6,_0x47492b);_0x185e7(_0x47492b);});});}exports[_0x873b('0x15')]=function(_0x52cc16){var _0x5ede50=this;return new Promise(function(_0xb2e13b,_0x92b3c5){return db[_0x873b('0x16')][_0x873b('0x17')](_0x52cc16[_0x873b('0x18')],{'raw':_0x52cc16['options']?_0x52cc16['options']['raw']===undefined?!![]:![]:!![]})[_0x873b('0xa')](function(_0x3fce0b){logger['info'](_0x873b('0x15'),_0x52cc16);logger['debug'](_0x873b('0x15'),_0x52cc16,JSON[_0x873b('0x10')](_0x3fce0b));_0xb2e13b(_0x3fce0b);})[_0x873b('0x19')](function(_0x57881b){logger[_0x873b('0x11')](_0x873b('0x15'),_0x57881b[_0x873b('0x13')],_0x52cc16);_0x92b3c5(_0x5ede50['error'](0x1f4,_0x57881b['message']));});});};exports['UpdateChatQueueReport']=function(_0x148040){var _0x476be7=this;return new Promise(function(_0x17f38b,_0x4b89f5){return db['ChatQueueReport'][_0x873b('0x1a')](_0x148040['body'],{'raw':_0x148040['options']?_0x148040['options'][_0x873b('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x148040[_0x873b('0x1c')]?_0x148040[_0x873b('0x1c')][_0x873b('0x1d')]||null:null,'attributes':_0x148040['options']?_0x148040[_0x873b('0x1c')][_0x873b('0x1e')]||null:null,'limit':_0x148040[_0x873b('0x1c')]?_0x148040['options'][_0x873b('0x1f')]||null:null})[_0x873b('0xa')](function(_0x43662c){logger[_0x873b('0xb')](_0x873b('0x20'),_0x148040);logger[_0x873b('0xe')](_0x873b('0x20'),_0x148040,JSON[_0x873b('0x10')](_0x43662c));_0x17f38b(_0x43662c);})[_0x873b('0x19')](function(_0x434918){logger[_0x873b('0x11')](_0x873b('0x20'),_0x434918[_0x873b('0x13')],_0x148040);_0x4b89f5(_0x476be7[_0x873b('0x11')](0x1f4,_0x434918[_0x873b('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 592a5f5..a27902c 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 _0x0b69=['../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','put','delete','destroy','exports','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1a078f,_0x23a5df){var _0x2ce4e4=function(_0x5e31ec){while(--_0x5e31ec){_0x1a078f['push'](_0x1a078f['shift']());}};_0x2ce4e4(++_0x23a5df);}(_0x0b69,0x161));var _0x90b6=function(_0x5cca2f,_0x4b41ed){_0x5cca2f=_0x5cca2f-0x0;var _0x38d587=_0x0b69[_0x5cca2f];return _0x38d587;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x90b6('0x0'));var router=express['Router']();var fs_extra=require(_0x90b6('0x1'));var auth=require(_0x90b6('0x2'));var interaction=require(_0x90b6('0x3'));var config=require(_0x90b6('0x4'));var controller=require(_0x90b6('0x5'));router[_0x90b6('0x6')]('/',auth[_0x90b6('0x7')](),controller[_0x90b6('0x8')]);router[_0x90b6('0x6')](_0x90b6('0x9'),auth['isAuthenticated'](),controller[_0x90b6('0xa')]);router[_0x90b6('0x6')](_0x90b6('0xb'),auth['isAuthenticated'](),controller[_0x90b6('0xc')]);router['post']('/',auth[_0x90b6('0x7')](),controller['create']);router[_0x90b6('0xd')](_0x90b6('0xb'),auth[_0x90b6('0x7')](),controller['update']);router[_0x90b6('0xe')](_0x90b6('0xb'),auth[_0x90b6('0x7')](),controller[_0x90b6('0xf')]);module[_0x90b6('0x10')]=router; \ No newline at end of file +var _0x98d8=['connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id','put','delete','destroy','exports','util','path'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x98d8,0x7c));var _0x898d=function(_0x1c238f,_0x36012b){_0x1c238f=_0x1c238f-0x0;var _0x344288=_0x98d8[_0x1c238f];return _0x344288;};'use strict';var multer=require('multer');var util=require(_0x898d('0x0'));var path=require(_0x898d('0x1'));var timeout=require(_0x898d('0x2'));var express=require(_0x898d('0x3'));var router=express['Router']();var fs_extra=require(_0x898d('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x898d('0x5'));var config=require(_0x898d('0x6'));var controller=require(_0x898d('0x7'));router['get']('/',auth[_0x898d('0x8')](),controller[_0x898d('0x9')]);router[_0x898d('0xa')](_0x898d('0xb'),auth[_0x898d('0x8')](),controller[_0x898d('0xc')]);router['get'](_0x898d('0xd'),auth[_0x898d('0x8')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x898d('0xe')]('/:id',auth[_0x898d('0x8')](),controller['update']);router[_0x898d('0xf')](_0x898d('0xd'),auth['isAuthenticated'](),controller[_0x898d('0x10')]);module[_0x898d('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 2f0ae3e..1522d31 100644 --- a/server/api/chatTransferReport/chatTransferReport.attributes.js +++ b/server/api/chatTransferReport/chatTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x253c59,_0x383713){var _0x2705a8=function(_0x25d30a){while(--_0x25d30a){_0x253c59['push'](_0x253c59['shift']());}};_0x2705a8(++_0x383713);}(_0xcb91,0x1a9));var _0x1cb9=function(_0xac0de1,_0x12d3d9){_0xac0de1=_0xac0de1-0x0;var _0x1c1995=_0xcb91[_0xac0de1];return _0x1c1995;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}}; \ No newline at end of file +var _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x321cb9,_0x1c3579){var _0x59c6bf=function(_0xfcaaf8){while(--_0xfcaaf8){_0x321cb9['push'](_0x321cb9['shift']());}};_0x59c6bf(++_0x1c3579);}(_0x008c,0x188));var _0xc008=function(_0x1f782d,_0x5906b8){_0x1f782d=_0x1f782d-0x0;var _0x228cce=_0x008c[_0x1f782d];return _0x228cce;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 18f9aa9..ee32624 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 _0x0c26=['type','VIRTUAL','options','include','catch','show','params','includeAll','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge'];(function(_0x11eb07,_0x4e029c){var _0x88d824=function(_0x152232){while(--_0x152232){_0x11eb07['push'](_0x11eb07['shift']());}};_0x88d824(++_0x4e029c);}(_0x0c26,0x1e7));var _0x60c2=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x0c26[_0x30ae5e];return _0x1f2e93;};'use strict';var emlformat=require(_0x60c2('0x0'));var rimraf=require(_0x60c2('0x1'));var zipdir=require(_0x60c2('0x2'));var jsonpatch=require(_0x60c2('0x3'));var rp=require(_0x60c2('0x4'));var moment=require(_0x60c2('0x5'));var BPromise=require(_0x60c2('0x6'));var Mustache=require('mustache');var util=require(_0x60c2('0x7'));var path=require(_0x60c2('0x8'));var sox=require(_0x60c2('0x9'));var csv=require(_0x60c2('0xa'));var ejs=require(_0x60c2('0xb'));var fs=require('fs');var fs_extra=require(_0x60c2('0xc'));var _=require(_0x60c2('0xd'));var squel=require(_0x60c2('0xe'));var crypto=require(_0x60c2('0xf'));var jsforce=require(_0x60c2('0x10'));var deskjs=require(_0x60c2('0x11'));var toCsv=require(_0x60c2('0xa'));var querystring=require('querystring');var Papa=require(_0x60c2('0x12'));var Redis=require(_0x60c2('0x13'));var authService=require(_0x60c2('0x14'));var qs=require(_0x60c2('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x60c2('0x16'));var logger=require(_0x60c2('0x17'))('api');var utils=require(_0x60c2('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x60c2('0x19'));var db=require(_0x60c2('0x1a'))['db'];function respondWithStatusCode(_0x5e8851,_0x34e515){_0x34e515=_0x34e515||0xcc;return function(_0x2f00a2){if(_0x2f00a2){return _0x5e8851[_0x60c2('0x1b')](_0x34e515);}return _0x5e8851[_0x60c2('0x1c')](_0x34e515)['end']();};}function respondWithResult(_0x1ef956,_0x2779fe){_0x2779fe=_0x2779fe||0xc8;return function(_0x2b6253){if(_0x2b6253){return _0x1ef956['status'](_0x2779fe)['json'](_0x2b6253);}};}function respondWithFilteredResult(_0x11d58b,_0x14e02b){return function(_0x1d28c2){if(_0x1d28c2){var _0x123782=typeof _0x14e02b[_0x60c2('0x1d')]===_0x60c2('0x1e')&&typeof _0x14e02b[_0x60c2('0x1f')]==='undefined';var _0x2121ad=_0x1d28c2[_0x60c2('0x20')];var _0x55e430=_0x123782?0x0:_0x14e02b[_0x60c2('0x1d')];var _0x871e5e=_0x123782?_0x1d28c2[_0x60c2('0x20')]:_0x14e02b[_0x60c2('0x1d')]+_0x14e02b['limit'];var _0x5eaf62;if(_0x871e5e>=_0x2121ad){_0x871e5e=_0x2121ad;_0x5eaf62=0xc8;}else{_0x5eaf62=0xce;}_0x11d58b[_0x60c2('0x1c')](_0x5eaf62);return _0x11d58b[_0x60c2('0x21')](_0x60c2('0x22'),_0x55e430+'-'+_0x871e5e+'/'+_0x2121ad)[_0x60c2('0x23')](_0x1d28c2);}return null;};}function patchUpdates(_0x28d098){return function(_0x420934){try{jsonpatch[_0x60c2('0x24')](_0x420934,_0x28d098,!![]);}catch(_0x1069df){return BPromise[_0x60c2('0x25')](_0x1069df);}return _0x420934['save']();};}function saveUpdates(_0x5af8e2,_0x2f46ab){return function(_0x2b2f63){if(_0x2b2f63){return _0x2b2f63[_0x60c2('0x26')](_0x5af8e2)[_0x60c2('0x27')](function(_0x479ade){return _0x479ade;});}return null;};}function removeEntity(_0x12c5e0,_0xda7465){return function(_0x5b66d8){if(_0x5b66d8){return _0x5b66d8['destroy']()['then'](function(){_0x12c5e0[_0x60c2('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e5204,_0x4fa435){return function(_0x318217){if(!_0x318217){_0x1e5204[_0x60c2('0x1b')](0x194);}return _0x318217;};}function handleError(_0x7d93c9,_0x11281f){_0x11281f=_0x11281f||0x1f4;return function(_0x30deba){logger[_0x60c2('0x28')](_0x30deba[_0x60c2('0x29')]);if(_0x30deba[_0x60c2('0x2a')]){delete _0x30deba[_0x60c2('0x2a')];}_0x7d93c9[_0x60c2('0x1c')](_0x11281f)[_0x60c2('0x2b')](_0x30deba);};}exports[_0x60c2('0x2c')]=function(_0x12c4c4,_0x4434c6){var _0x303ae6={},_0x473d6c={},_0x536580={'count':0x0,'rows':[]};var _0x28ebcb=_[_0x60c2('0x2d')](db[_0x60c2('0x2e')][_0x60c2('0x2f')],function(_0x12169c){return{'name':_0x12169c[_0x60c2('0x30')],'type':_0x12169c['type'][_0x60c2('0x31')]};});_0x473d6c[_0x60c2('0x32')]=_[_0x60c2('0x2d')](_0x28ebcb,_0x60c2('0x2a'));_0x473d6c['query']=_[_0x60c2('0x33')](_0x12c4c4[_0x60c2('0x34')]);_0x473d6c[_0x60c2('0x35')]=_[_0x60c2('0x36')](_0x473d6c['model'],_0x473d6c[_0x60c2('0x34')]);_0x303ae6[_0x60c2('0x37')]=_[_0x60c2('0x36')](_0x473d6c['model'],qs['fields'](_0x12c4c4[_0x60c2('0x34')][_0x60c2('0x38')]));_0x303ae6[_0x60c2('0x37')]=_0x303ae6[_0x60c2('0x37')][_0x60c2('0x39')]?_0x303ae6[_0x60c2('0x37')]:_0x473d6c[_0x60c2('0x32')];if(!_0x12c4c4[_0x60c2('0x34')][_0x60c2('0x3a')](_0x60c2('0x3b'))){_0x303ae6['limit']=qs['limit'](_0x12c4c4[_0x60c2('0x34')][_0x60c2('0x1f')]);_0x303ae6['offset']=qs[_0x60c2('0x1d')](_0x12c4c4['query'][_0x60c2('0x1d')]);}_0x303ae6[_0x60c2('0x3c')]=qs[_0x60c2('0x3d')](_0x12c4c4[_0x60c2('0x34')][_0x60c2('0x3d')]);_0x303ae6[_0x60c2('0x3e')]=qs[_0x60c2('0x35')](_[_0x60c2('0x3f')](_0x12c4c4[_0x60c2('0x34')],_0x473d6c['filters']),_0x28ebcb);if(_0x12c4c4['query'][_0x60c2('0x40')]){_0x303ae6[_0x60c2('0x3e')]=_[_0x60c2('0x41')](_0x303ae6['where'],{'$or':_['map'](_0x28ebcb,function(_0x4fb12c){if(_0x4fb12c[_0x60c2('0x42')]!==_0x60c2('0x43')){var _0x37ff27={};_0x37ff27[_0x4fb12c[_0x60c2('0x2a')]]={'$like':'%'+_0x12c4c4[_0x60c2('0x34')][_0x60c2('0x40')]+'%'};return _0x37ff27;}})});}_0x303ae6=_[_0x60c2('0x41')]({},_0x303ae6,_0x12c4c4[_0x60c2('0x44')]);var _0x3e3f72={'where':_0x303ae6['where']};return db[_0x60c2('0x2e')]['count'](_0x3e3f72)['then'](function(_0x22cce0){_0x536580['count']=_0x22cce0;if(_0x12c4c4[_0x60c2('0x34')]['includeAll']){_0x303ae6[_0x60c2('0x45')]=[{'all':!![]}];}return db[_0x60c2('0x2e')]['findAll'](_0x303ae6);})[_0x60c2('0x27')](function(_0x2e7ea5){_0x536580['rows']=_0x2e7ea5;return _0x536580;})['then'](respondWithFilteredResult(_0x4434c6,_0x303ae6))[_0x60c2('0x46')](handleError(_0x4434c6,null));};exports[_0x60c2('0x47')]=function(_0x42f44c,_0x559c72){var _0x3c64ce={'raw':!![],'where':{'id':_0x42f44c[_0x60c2('0x48')]['id']}},_0x51e505={};_0x51e505[_0x60c2('0x32')]=_[_0x60c2('0x33')](db[_0x60c2('0x2e')][_0x60c2('0x2f')]);_0x51e505[_0x60c2('0x34')]=_[_0x60c2('0x33')](_0x42f44c['query']);_0x51e505['filters']=_['intersection'](_0x51e505['model'],_0x51e505[_0x60c2('0x34')]);_0x3c64ce['attributes']=_[_0x60c2('0x36')](_0x51e505[_0x60c2('0x32')],qs[_0x60c2('0x38')](_0x42f44c['query']['fields']));_0x3c64ce[_0x60c2('0x37')]=_0x3c64ce[_0x60c2('0x37')][_0x60c2('0x39')]?_0x3c64ce[_0x60c2('0x37')]:_0x51e505[_0x60c2('0x32')];if(_0x42f44c['query'][_0x60c2('0x49')]){_0x3c64ce[_0x60c2('0x45')]=[{'all':!![]}];}_0x3c64ce=_['merge']({},_0x3c64ce,_0x42f44c[_0x60c2('0x44')]);return db[_0x60c2('0x2e')][_0x60c2('0x4a')](_0x3c64ce)[_0x60c2('0x27')](handleEntityNotFound(_0x559c72,null))[_0x60c2('0x27')](respondWithResult(_0x559c72,null))['catch'](handleError(_0x559c72,null));};exports['create']=function(_0x520a71,_0x27529c){return db[_0x60c2('0x2e')][_0x60c2('0x4b')](_0x520a71[_0x60c2('0x4c')],{})[_0x60c2('0x27')](respondWithResult(_0x27529c,0xc9))[_0x60c2('0x46')](handleError(_0x27529c,null));};exports['update']=function(_0x2f99f2,_0x3fa948){if(_0x2f99f2[_0x60c2('0x4c')]['id']){delete _0x2f99f2['body']['id'];}return db[_0x60c2('0x2e')][_0x60c2('0x4a')]({'where':{'id':_0x2f99f2['params']['id']}})['then'](handleEntityNotFound(_0x3fa948,null))[_0x60c2('0x27')](saveUpdates(_0x2f99f2[_0x60c2('0x4c')],null))['then'](respondWithResult(_0x3fa948,null))['catch'](handleError(_0x3fa948,null));};exports[_0x60c2('0x4d')]=function(_0x39c916,_0x336ba9){return db[_0x60c2('0x2e')][_0x60c2('0x4a')]({'where':{'id':_0x39c916['params']['id']}})[_0x60c2('0x27')](handleEntityNotFound(_0x336ba9,null))[_0x60c2('0x27')](removeEntity(_0x336ba9,null))['catch'](handleError(_0x336ba9,null));};exports[_0x60c2('0x4e')]=function(_0x5ce874,_0x1dd3f1){return db['ChatTransferReport'][_0x60c2('0x4e')]()[_0x60c2('0x27')](respondWithResult(_0x1dd3f1,null))['catch'](handleError(_0x1dd3f1,null));}; \ No newline at end of file +var _0x03fa=['filter','VIRTUAL','merge','includeAll','include','rows','catch','show','params','rawAttributes','options','find','create','body','destroy','describe','eml-format','zip-dir','request-promise','moment','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','set','Content-Range','apply','reject','update','then','end','stack','name','send','index','map','ChatTransferReport','type','query','keys','intersection','model','attributes','length','hasOwnProperty','nolimit','limit','sort','where','filters'];(function(_0x3345c9,_0x483714){var _0x2fe149=function(_0x36c654){while(--_0x36c654){_0x3345c9['push'](_0x3345c9['shift']());}};_0x2fe149(++_0x483714);}(_0x03fa,0x1f3));var _0xa03f=function(_0x523638,_0x39c61c){_0x523638=_0x523638-0x0;var _0x40f137=_0x03fa[_0x523638];return _0x40f137;};'use strict';var emlformat=require(_0xa03f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa03f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa03f('0x2'));var moment=require(_0xa03f('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xa03f('0x4'));var sox=require(_0xa03f('0x5'));var csv=require(_0xa03f('0x6'));var ejs=require(_0xa03f('0x7'));var fs=require('fs');var fs_extra=require(_0xa03f('0x8'));var _=require('lodash');var squel=require(_0xa03f('0x9'));var crypto=require('crypto');var jsforce=require(_0xa03f('0xa'));var deskjs=require(_0xa03f('0xb'));var toCsv=require(_0xa03f('0x6'));var querystring=require(_0xa03f('0xc'));var Papa=require(_0xa03f('0xd'));var Redis=require(_0xa03f('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xa03f('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa03f('0x10'));var logger=require('../../config/logger')(_0xa03f('0x11'));var utils=require('../../config/utils');var config=require(_0xa03f('0x12'));var licenseUtil=require(_0xa03f('0x13'));var db=require(_0xa03f('0x14'))['db'];function respondWithStatusCode(_0x4cd0ec,_0x345432){_0x345432=_0x345432||0xcc;return function(_0x524018){if(_0x524018){return _0x4cd0ec[_0xa03f('0x15')](_0x345432);}return _0x4cd0ec[_0xa03f('0x16')](_0x345432)['end']();};}function respondWithResult(_0x21d138,_0x2c33d9){_0x2c33d9=_0x2c33d9||0xc8;return function(_0x6495c4){if(_0x6495c4){return _0x21d138['status'](_0x2c33d9)[_0xa03f('0x17')](_0x6495c4);}};}function respondWithFilteredResult(_0x5b6afd,_0x311d96){return function(_0x4c54a8){if(_0x4c54a8){var _0xc36121=typeof _0x311d96['offset']===_0xa03f('0x18')&&typeof _0x311d96['limit']==='undefined';var _0x28618f=_0x4c54a8[_0xa03f('0x19')];var _0x30ec88=_0xc36121?0x0:_0x311d96[_0xa03f('0x1a')];var _0x297901=_0xc36121?_0x4c54a8[_0xa03f('0x19')]:_0x311d96[_0xa03f('0x1a')]+_0x311d96['limit'];var _0x1fa107;if(_0x297901>=_0x28618f){_0x297901=_0x28618f;_0x1fa107=0xc8;}else{_0x1fa107=0xce;}_0x5b6afd['status'](_0x1fa107);return _0x5b6afd[_0xa03f('0x1b')](_0xa03f('0x1c'),_0x30ec88+'-'+_0x297901+'/'+_0x28618f)[_0xa03f('0x17')](_0x4c54a8);}return null;};}function patchUpdates(_0x52f242){return function(_0x5055a1){try{jsonpatch[_0xa03f('0x1d')](_0x5055a1,_0x52f242,!![]);}catch(_0x5483f4){return BPromise[_0xa03f('0x1e')](_0x5483f4);}return _0x5055a1['save']();};}function saveUpdates(_0x1445de,_0x4970c5){return function(_0x344550){if(_0x344550){return _0x344550[_0xa03f('0x1f')](_0x1445de)[_0xa03f('0x20')](function(_0x4e99cb){return _0x4e99cb;});}return null;};}function removeEntity(_0x865a86,_0x15ca48){return function(_0x1cde79){if(_0x1cde79){return _0x1cde79['destroy']()[_0xa03f('0x20')](function(){_0x865a86[_0xa03f('0x16')](0xcc)[_0xa03f('0x21')]();});}};}function handleEntityNotFound(_0x373ee6,_0x499aae){return function(_0x21634d){if(!_0x21634d){_0x373ee6['sendStatus'](0x194);}return _0x21634d;};}function handleError(_0x44f366,_0x2f3e32){_0x2f3e32=_0x2f3e32||0x1f4;return function(_0xc0b809){logger['error'](_0xc0b809[_0xa03f('0x22')]);if(_0xc0b809[_0xa03f('0x23')]){delete _0xc0b809[_0xa03f('0x23')];}_0x44f366[_0xa03f('0x16')](_0x2f3e32)[_0xa03f('0x24')](_0xc0b809);};}exports[_0xa03f('0x25')]=function(_0xbbb778,_0x240460){var _0x531384={},_0x5946b9={},_0x31ea5e={'count':0x0,'rows':[]};var _0x3903ea=_[_0xa03f('0x26')](db[_0xa03f('0x27')]['rawAttributes'],function(_0x5e2141){return{'name':_0x5e2141['fieldName'],'type':_0x5e2141[_0xa03f('0x28')]['key']};});_0x5946b9['model']=_[_0xa03f('0x26')](_0x3903ea,_0xa03f('0x23'));_0x5946b9[_0xa03f('0x29')]=_[_0xa03f('0x2a')](_0xbbb778[_0xa03f('0x29')]);_0x5946b9['filters']=_[_0xa03f('0x2b')](_0x5946b9[_0xa03f('0x2c')],_0x5946b9[_0xa03f('0x29')]);_0x531384[_0xa03f('0x2d')]=_[_0xa03f('0x2b')](_0x5946b9['model'],qs['fields'](_0xbbb778['query']['fields']));_0x531384[_0xa03f('0x2d')]=_0x531384[_0xa03f('0x2d')][_0xa03f('0x2e')]?_0x531384[_0xa03f('0x2d')]:_0x5946b9[_0xa03f('0x2c')];if(!_0xbbb778[_0xa03f('0x29')][_0xa03f('0x2f')](_0xa03f('0x30'))){_0x531384[_0xa03f('0x31')]=qs['limit'](_0xbbb778[_0xa03f('0x29')][_0xa03f('0x31')]);_0x531384['offset']=qs[_0xa03f('0x1a')](_0xbbb778[_0xa03f('0x29')]['offset']);}_0x531384['order']=qs['sort'](_0xbbb778[_0xa03f('0x29')][_0xa03f('0x32')]);_0x531384[_0xa03f('0x33')]=qs['filters'](_['pick'](_0xbbb778[_0xa03f('0x29')],_0x5946b9[_0xa03f('0x34')]),_0x3903ea);if(_0xbbb778['query'][_0xa03f('0x35')]){_0x531384[_0xa03f('0x33')]=_['merge'](_0x531384['where'],{'$or':_['map'](_0x3903ea,function(_0x2878ce){if(_0x2878ce['type']!==_0xa03f('0x36')){var _0x4bbeba={};_0x4bbeba[_0x2878ce['name']]={'$like':'%'+_0xbbb778[_0xa03f('0x29')]['filter']+'%'};return _0x4bbeba;}})});}_0x531384=_[_0xa03f('0x37')]({},_0x531384,_0xbbb778['options']);var _0x5ba261={'where':_0x531384['where']};return db[_0xa03f('0x27')]['count'](_0x5ba261)[_0xa03f('0x20')](function(_0x365e9a){_0x31ea5e[_0xa03f('0x19')]=_0x365e9a;if(_0xbbb778[_0xa03f('0x29')][_0xa03f('0x38')]){_0x531384[_0xa03f('0x39')]=[{'all':!![]}];}return db[_0xa03f('0x27')]['findAll'](_0x531384);})[_0xa03f('0x20')](function(_0x53ba58){_0x31ea5e[_0xa03f('0x3a')]=_0x53ba58;return _0x31ea5e;})[_0xa03f('0x20')](respondWithFilteredResult(_0x240460,_0x531384))[_0xa03f('0x3b')](handleError(_0x240460,null));};exports[_0xa03f('0x3c')]=function(_0xb4dfa0,_0x3289f8){var _0x3e586c={'raw':!![],'where':{'id':_0xb4dfa0[_0xa03f('0x3d')]['id']}},_0x228385={};_0x228385[_0xa03f('0x2c')]=_[_0xa03f('0x2a')](db['ChatTransferReport'][_0xa03f('0x3e')]);_0x228385[_0xa03f('0x29')]=_[_0xa03f('0x2a')](_0xb4dfa0[_0xa03f('0x29')]);_0x228385[_0xa03f('0x34')]=_[_0xa03f('0x2b')](_0x228385[_0xa03f('0x2c')],_0x228385[_0xa03f('0x29')]);_0x3e586c[_0xa03f('0x2d')]=_[_0xa03f('0x2b')](_0x228385[_0xa03f('0x2c')],qs['fields'](_0xb4dfa0['query']['fields']));_0x3e586c[_0xa03f('0x2d')]=_0x3e586c[_0xa03f('0x2d')][_0xa03f('0x2e')]?_0x3e586c[_0xa03f('0x2d')]:_0x228385[_0xa03f('0x2c')];if(_0xb4dfa0[_0xa03f('0x29')][_0xa03f('0x38')]){_0x3e586c[_0xa03f('0x39')]=[{'all':!![]}];}_0x3e586c=_[_0xa03f('0x37')]({},_0x3e586c,_0xb4dfa0[_0xa03f('0x3f')]);return db[_0xa03f('0x27')][_0xa03f('0x40')](_0x3e586c)[_0xa03f('0x20')](handleEntityNotFound(_0x3289f8,null))[_0xa03f('0x20')](respondWithResult(_0x3289f8,null))['catch'](handleError(_0x3289f8,null));};exports[_0xa03f('0x41')]=function(_0x4894bf,_0x5d9d63){return db[_0xa03f('0x27')][_0xa03f('0x41')](_0x4894bf['body'],{})[_0xa03f('0x20')](respondWithResult(_0x5d9d63,0xc9))[_0xa03f('0x3b')](handleError(_0x5d9d63,null));};exports[_0xa03f('0x1f')]=function(_0x2eb5df,_0x3fa635){if(_0x2eb5df[_0xa03f('0x42')]['id']){delete _0x2eb5df[_0xa03f('0x42')]['id'];}return db[_0xa03f('0x27')][_0xa03f('0x40')]({'where':{'id':_0x2eb5df[_0xa03f('0x3d')]['id']}})[_0xa03f('0x20')](handleEntityNotFound(_0x3fa635,null))[_0xa03f('0x20')](saveUpdates(_0x2eb5df[_0xa03f('0x42')],null))[_0xa03f('0x20')](respondWithResult(_0x3fa635,null))[_0xa03f('0x3b')](handleError(_0x3fa635,null));};exports[_0xa03f('0x43')]=function(_0x4f7a36,_0x35014f){return db[_0xa03f('0x27')][_0xa03f('0x40')]({'where':{'id':_0x4f7a36[_0xa03f('0x3d')]['id']}})['then'](handleEntityNotFound(_0x35014f,null))[_0xa03f('0x20')](removeEntity(_0x35014f,null))[_0xa03f('0x3b')](handleError(_0x35014f,null));};exports[_0xa03f('0x44')]=function(_0x5429ed,_0x7e858f){return db[_0xa03f('0x27')][_0xa03f('0x44')]()[_0xa03f('0x20')](respondWithResult(_0x7e858f,null))[_0xa03f('0x3b')](handleError(_0x7e858f,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index eba7baa..15f5b65 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 _0x1996=['./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x5647f9,_0x4a8bad){var _0x46c52b=function(_0x30e6ce){while(--_0x30e6ce){_0x5647f9['push'](_0x5647f9['shift']());}};_0x46c52b(++_0x4a8bad);}(_0x1996,0x18e));var _0x6199=function(_0x314bc1,_0x38f27e){_0x314bc1=_0x314bc1-0x0;var _0x79f2d8=_0x1996[_0x314bc1];return _0x79f2d8;};'use strict';var _=require(_0x6199('0x0'));var util=require('util');var logger=require(_0x6199('0x1'))(_0x6199('0x2'));var moment=require(_0x6199('0x3'));var BPromise=require(_0x6199('0x4'));var rp=require(_0x6199('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6199('0x6'));var config=require(_0x6199('0x7'));var attributes=require(_0x6199('0x8'));module[_0x6199('0x9')]=function(_0x5cbc23,_0x2054e5){return _0x5cbc23[_0x6199('0xa')](_0x6199('0xb'),attributes,{'tableName':_0x6199('0xc'),'paranoid':![],'indexes':[{'name':_0x6199('0xd'),'fields':[_0x6199('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2f38=['uniqueid','lodash','util','moment','path','../../config/environment','exports','define','ChatTransferReport','report_chat_transfer'];(function(_0x592277,_0x3bccb4){var _0x184de3=function(_0x392810){while(--_0x392810){_0x592277['push'](_0x592277['shift']());}};_0x184de3(++_0x3bccb4);}(_0x2f38,0x79));var _0x82f3=function(_0x21d81d,_0x4955e4){_0x21d81d=_0x21d81d-0x0;var _0x5be847=_0x2f38[_0x21d81d];return _0x5be847;};'use strict';var _=require(_0x82f3('0x0'));var util=require(_0x82f3('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x82f3('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x82f3('0x3'));var rimraf=require('rimraf');var config=require(_0x82f3('0x4'));var attributes=require('./chatTransferReport.attributes');module[_0x82f3('0x5')]=function(_0x3fc0db,_0x321d76){return _0x3fc0db[_0x82f3('0x6')](_0x82f3('0x7'),attributes,{'tableName':_0x82f3('0x8'),'paranoid':![],'indexes':[{'name':_0x82f3('0x9'),'fields':[_0x82f3('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 2468fd2..281b849 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 _0xaa76=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','ChatTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0x2ae099,_0x1d9376){var _0x2ce323=function(_0x2acab1){while(--_0x2acab1){_0x2ae099['push'](_0x2ae099['shift']());}};_0x2ce323(++_0x1d9376);}(_0xaa76,0x17c));var _0x6aa7=function(_0x347775,_0x5945e7){_0x347775=_0x347775-0x0;var _0x509295=_0xaa76[_0x347775];return _0x509295;};'use strict';var _=require(_0x6aa7('0x0'));var util=require(_0x6aa7('0x1'));var moment=require(_0x6aa7('0x2'));var BPromise=require(_0x6aa7('0x3'));var rs=require(_0x6aa7('0x4'));var fs=require('fs');var Redis=require(_0x6aa7('0x5'));var db=require(_0x6aa7('0x6'))['db'];var utils=require(_0x6aa7('0x7'));var logger=require(_0x6aa7('0x8'))(_0x6aa7('0x9'));var config=require(_0x6aa7('0xa'));var jayson=require(_0x6aa7('0xb'));var client=jayson[_0x6aa7('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x18d0ac,_0x3656e5,_0x6a288e){return new BPromise(function(_0x16d6d0,_0x5b09a6){return client[_0x6aa7('0xd')](_0x18d0ac,_0x6a288e)['then'](function(_0x23fc7a){logger[_0x6aa7('0xe')]('ChatTransferReport,\x20%s,\x20%s',_0x3656e5,_0x6aa7('0xf'));logger[_0x6aa7('0x10')](_0x6aa7('0x11'),_0x3656e5,_0x6aa7('0xf'),JSON[_0x6aa7('0x12')](_0x23fc7a));if(_0x23fc7a[_0x6aa7('0x13')]){if(_0x23fc7a[_0x6aa7('0x13')]['code']===0x1f4){logger['error'](_0x6aa7('0x14'),_0x3656e5,_0x23fc7a['error'][_0x6aa7('0x15')]);return _0x5b09a6(_0x23fc7a[_0x6aa7('0x13')]['message']);}logger[_0x6aa7('0x13')]('ChatTransferReport,\x20%s,\x20%s',_0x3656e5,_0x23fc7a[_0x6aa7('0x13')][_0x6aa7('0x15')]);return _0x16d6d0(_0x23fc7a[_0x6aa7('0x13')][_0x6aa7('0x15')]);}else{logger[_0x6aa7('0xe')]('ChatTransferReport,\x20%s,\x20%s',_0x3656e5,'request\x20sent');_0x16d6d0(_0x23fc7a[_0x6aa7('0x16')][_0x6aa7('0x15')]);}})[_0x6aa7('0x17')](function(_0xaca678){logger[_0x6aa7('0x13')](_0x6aa7('0x14'),_0x3656e5,_0xaca678);_0x5b09a6(_0xaca678);});});} \ No newline at end of file +var _0x0cba=['util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x2bd88d,_0x2d5dc3){var _0x5516d4=function(_0x1272c8){while(--_0x1272c8){_0x2bd88d['push'](_0x2bd88d['shift']());}};_0x5516d4(++_0x2d5dc3);}(_0x0cba,0xe6));var _0xa0cb=function(_0x9faff7,_0x59a564){_0x9faff7=_0x9faff7-0x0;var _0x4f8043=_0x0cba[_0x9faff7];return _0x4f8043;};'use strict';var _=require('lodash');var util=require(_0xa0cb('0x0'));var moment=require(_0xa0cb('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa0cb('0x2'));var db=require(_0xa0cb('0x3'))['db'];var utils=require(_0xa0cb('0x4'));var logger=require(_0xa0cb('0x5'))(_0xa0cb('0x6'));var config=require(_0xa0cb('0x7'));var jayson=require(_0xa0cb('0x8'));var client=jayson[_0xa0cb('0x9')][_0xa0cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe630ce,_0x26ad19,_0x840d1a){return new BPromise(function(_0x2fbe5e,_0x35f8a3){return client[_0xa0cb('0xb')](_0xe630ce,_0x840d1a)[_0xa0cb('0xc')](function(_0x5e85da){logger[_0xa0cb('0xd')]('ChatTransferReport,\x20%s,\x20%s',_0x26ad19,_0xa0cb('0xe'));logger[_0xa0cb('0xf')](_0xa0cb('0x10'),_0x26ad19,'request\x20sent',JSON[_0xa0cb('0x11')](_0x5e85da));if(_0x5e85da[_0xa0cb('0x12')]){if(_0x5e85da[_0xa0cb('0x12')][_0xa0cb('0x13')]===0x1f4){logger[_0xa0cb('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x26ad19,_0x5e85da[_0xa0cb('0x12')][_0xa0cb('0x14')]);return _0x35f8a3(_0x5e85da['error']['message']);}logger[_0xa0cb('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x26ad19,_0x5e85da[_0xa0cb('0x12')][_0xa0cb('0x14')]);return _0x2fbe5e(_0x5e85da[_0xa0cb('0x12')]['message']);}else{logger[_0xa0cb('0xd')]('ChatTransferReport,\x20%s,\x20%s',_0x26ad19,_0xa0cb('0xe'));_0x2fbe5e(_0x5e85da[_0xa0cb('0x15')][_0xa0cb('0x14')]);}})[_0xa0cb('0x16')](function(_0x371bca){logger[_0xa0cb('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x26ad19,_0x371bca);_0x35f8a3(_0x371bca);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 6779bf8..8fef266 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 _0x17b1=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','isAuthenticated','index','get','/describe','/:id','show','post','put','update','delete','exports','util'];(function(_0xf88281,_0x28f89d){var _0x344af7=function(_0x4fc67b){while(--_0x4fc67b){_0xf88281['push'](_0xf88281['shift']());}};_0x344af7(++_0x28f89d);}(_0x17b1,0xdb));var _0x117b=function(_0x134058,_0x423995){_0x134058=_0x134058-0x0;var _0x14a1a9=_0x17b1[_0x134058];return _0x14a1a9;};'use strict';var multer=require('multer');var util=require(_0x117b('0x0'));var path=require(_0x117b('0x1'));var timeout=require(_0x117b('0x2'));var express=require(_0x117b('0x3'));var router=express[_0x117b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x117b('0x5'));var interaction=require(_0x117b('0x6'));var config=require(_0x117b('0x7'));var controller=require(_0x117b('0x8'));router['get']('/',auth[_0x117b('0x9')](),controller[_0x117b('0xa')]);router[_0x117b('0xb')](_0x117b('0xc'),auth[_0x117b('0x9')](),controller['describe']);router[_0x117b('0xb')](_0x117b('0xd'),auth['isAuthenticated'](),controller[_0x117b('0xe')]);router[_0x117b('0xf')]('/',auth[_0x117b('0x9')](),controller['create']);router[_0x117b('0x10')](_0x117b('0xd'),auth[_0x117b('0x9')](),controller[_0x117b('0x11')]);router[_0x117b('0x12')](_0x117b('0xd'),auth[_0x117b('0x9')](),controller['destroy']);module[_0x117b('0x13')]=router; \ No newline at end of file +var _0xc2ac=['get','/describe','describe','post','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatTransferReport.controller','isAuthenticated','index'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xc2ac,0xd2));var _0xcc2a=function(_0x361eec,_0x25d17d){_0x361eec=_0x361eec-0x0;var _0x135971=_0xc2ac[_0x361eec];return _0x135971;};'use strict';var multer=require('multer');var util=require(_0xcc2a('0x0'));var path=require(_0xcc2a('0x1'));var timeout=require(_0xcc2a('0x2'));var express=require(_0xcc2a('0x3'));var router=express[_0xcc2a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xcc2a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xcc2a('0x6'));var controller=require(_0xcc2a('0x7'));router['get']('/',auth[_0xcc2a('0x8')](),controller[_0xcc2a('0x9')]);router[_0xcc2a('0xa')](_0xcc2a('0xb'),auth[_0xcc2a('0x8')](),controller[_0xcc2a('0xc')]);router[_0xcc2a('0xa')]('/:id',auth[_0xcc2a('0x8')](),controller['show']);router[_0xcc2a('0xd')]('/',auth[_0xcc2a('0x8')](),controller['create']);router[_0xcc2a('0xe')](_0xcc2a('0xf'),auth[_0xcc2a('0x8')](),controller[_0xcc2a('0x10')]);router[_0xcc2a('0x11')]('/:id',auth[_0xcc2a('0x8')](),controller[_0xcc2a('0x12')]);module[_0xcc2a('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 7e87a96..a58843e 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 _0x2750=['BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Send','Feedback','thumb','star','stringify','name','input','getDataValue','parse','onlineForm','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','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2750,0x13b));var _0x0275=function(_0xa74591,_0x1795d1){_0xa74591=_0xa74591-0x0;var _0x29b0cf=_0x2750[_0xa74591];return _0x29b0cf;};'use strict';var Sequelize=require(_0x0275('0x0'));var rs=require('randomstring');module[_0x0275('0x1')]={'name':{'type':Sequelize[_0x0275('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x0275('0x2')],'allowNull':![],'unique':_0x0275('0x3')},'description':{'type':Sequelize[_0x0275('0x2')]},'mapKey':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x4')},'mapKeyOffline':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x4')},'key':{'type':Sequelize[_0x0275('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x0275('0x5')},'customerAlias':{'type':Sequelize[_0x0275('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x0275('0x2')],'allowNull':![],'defaultValue':_0x0275('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0275('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x0275('0x2')],'allowNull':![],'defaultValue':_0x0275('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x0275('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x0275('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x0275('0xa')](_0x0275('0xb'),_0x0275('0xc')),'defaultValue':_0x0275('0xb')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x0275('0xd')},'start_chat_button':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0xe')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0xf')},'download_transcript':{'type':Sequelize[_0x0275('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x0275('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x10')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x0275('0x11')]},'closingQuestion':{'type':Sequelize[_0x0275('0x2')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x12')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x0275('0x13')},'noteTitle':{'type':Sequelize[_0x0275('0x2')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x14')},'skipMessageButton':{'type':Sequelize[_0x0275('0x2')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x15')},'ratingType':{'type':Sequelize['ENUM']('star',_0x0275('0x16')),'defaultValue':_0x0275('0x17')},'ratingStarsNumber':{'type':Sequelize[_0x0275('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x0275('0x18')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x0275('0x19'),'type':'text','required':!![]},'props':{'title':_0x0275('0x19'),'helpText':''}},{'type':_0x0275('0x1a'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x0275('0x4'),'type':_0x0275('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x0275('0x1b')]('onlineForm')?JSON[_0x0275('0x1c')](this[_0x0275('0x1b')](_0x0275('0x1d'))):{};},'set':function(_0x15813f){return this[_0x0275('0x1e')](_0x0275('0x1d'),JSON['stringify'](_0x15813f));}},'offlineForm':{'type':Sequelize[_0x0275('0x11')],'defaultValue':function(){return JSON[_0x0275('0x18')]({'items':[{'type':_0x0275('0x1a'),'props':{'title':_0x0275('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x0275('0x4'),'type':'email'},'variable':null},{'type':_0x0275('0x1f'),'config':{'placeholder':_0x0275('0x20')},'props':{'title':_0x0275('0x20'),'helpText':_0x0275('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0x0275('0x1b')]('offlineForm')?JSON[_0x0275('0x1c')](this[_0x0275('0x1b')](_0x0275('0x22'))):{};},'set':function(_0x489d7f){return this['setDataValue'](_0x0275('0x22'),JSON[_0x0275('0x18')](_0x489d7f));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x0275('0x23')]();}},'autoclose':{'type':Sequelize[_0x0275('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x0275('0x2')]},'waitingTitle':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x24')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x0275('0x25')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x0275('0x26')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x0275('0x27')},'enableUnmanagedNote':{'type':Sequelize[_0x0275('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x0275('0x28')},'skipUnmanaged':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x29')},'sendUnmanaged':{'type':Sequelize[_0x0275('0x2')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x0275('0x11')]},'showAgentAvatar':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x0275('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x0275('0x2a');}},'notificationSound':{'type':Sequelize[_0x0275('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize[_0x0275('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x2c')},'verticalAlignment':{'type':Sequelize[_0x0275('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x0275('0x2')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x2d')},'defaultTitle':{'type':Sequelize[_0x0275('0x2')]},'customerAvatar':{'type':Sequelize[_0x0275('0x11')]},'showCustomerAvatar':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x0275('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x0275('0x2')],'allowNull':![],'defaultValue':_0x0275('0x2e'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0275('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x0275('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x2f')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0275('0x8')],'comment':_0x0275('0x30')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x0275('0x31'),'set':function(_0x76b8fa){if(!_0x76b8fa)this[_0x0275('0x1e')](_0x0275('0x32'),null);this[_0x0275('0x1e')](_0x0275('0x33'),_0x76b8fa);}},'vidaooEscalation':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0x0275('0x2')],'allowNull':![],'defaultValue':_0x0275('0x34')},'vidaooNote':{'type':Sequelize[_0x0275('0x2')],'defaultValue':function(){return _0x0275('0x35');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x0275('0x11')]}}; \ No newline at end of file +var _0x6f0d=['Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','thumb','star','TEXT','input','name','getDataValue','parse','onlineForm','stringify','Comments','offlineForm','setDataValue','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion','randomstring','exports','STRING','email','#011F6A','#ffffff','INTEGER','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','BOOLEAN','Powered\x20by\x20xCALLY','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message'];(function(_0x4bda4c,_0x18aa61){var _0x8fa353=function(_0x662b4a){while(--_0x662b4a){_0x4bda4c['push'](_0x4bda4c['shift']());}};_0x8fa353(++_0x18aa61);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x50e661,_0x2bf5bd){_0x50e661=_0x50e661-0x0;var _0xc2489d=_0x6f0d[_0x50e661];return _0xc2489d;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xd6f0('0x0'));module[_0xd6f0('0x1')]={'name':{'type':Sequelize[_0xd6f0('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0xd6f0('0x2')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0xd6f0('0x2')]},'mapKey':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':_0xd6f0('0x3')},'mapKeyOffline':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':_0xd6f0('0x3')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xd6f0('0x2')],'allowNull':![],'defaultValue':_0xd6f0('0x4'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xd6f0('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd6f0('0x5'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xd6f0('0x2')],'allowNull':![],'defaultValue':_0xd6f0('0x5'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xd6f0('0x6')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xd6f0('0x2')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xd6f0('0x7')](_0xd6f0('0x8'),_0xd6f0('0x9')),'defaultValue':_0xd6f0('0x8')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0xd6f0('0xa')},'start_chat_button':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':_0xd6f0('0xb')},'offline_chat_button':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':_0xd6f0('0xc')},'header_offline':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':_0xd6f0('0xd')},'download_transcript':{'type':Sequelize[_0xd6f0('0xe')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xd6f0('0x6')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0xd6f0('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0xd6f0('0xe')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':_0xd6f0('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':_0xd6f0('0x11')},'noteTitle':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':_0xd6f0('0x12')},'placeholderMessage':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':_0xd6f0('0x13')},'closingMessage':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':_0xd6f0('0x14')},'closingMessageButton':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':_0xd6f0('0xc')},'skipMessageButton':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':_0xd6f0('0x15')},'conditionAgreement':{'type':Sequelize[_0xd6f0('0xe')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xd6f0('0xe')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':_0xd6f0('0x16')},'ratingType':{'type':Sequelize[_0xd6f0('0x7')]('star',_0xd6f0('0x17')),'defaultValue':_0xd6f0('0x18')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xd6f0('0x19')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xd6f0('0x1a'),'variable':null,'config':{'placeholder':_0xd6f0('0x1b'),'type':'text','required':!![]},'props':{'title':_0xd6f0('0x1b'),'helpText':''}},{'type':_0xd6f0('0x1a'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xd6f0('0x3'),'type':_0xd6f0('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xd6f0('0x1c')]('onlineForm')?JSON[_0xd6f0('0x1d')](this[_0xd6f0('0x1c')]('onlineForm')):{};},'set':function(_0xcea0ae){return this['setDataValue'](_0xd6f0('0x1e'),JSON[_0xd6f0('0x1f')](_0xcea0ae));}},'offlineForm':{'type':Sequelize[_0xd6f0('0x19')],'defaultValue':function(){return JSON[_0xd6f0('0x1f')]({'items':[{'type':_0xd6f0('0x1a'),'props':{'title':_0xd6f0('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0xd6f0('0x3'),'type':_0xd6f0('0x3')},'variable':null},{'type':'textarea','config':{'placeholder':_0xd6f0('0x20')},'props':{'title':_0xd6f0('0x20'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0xd6f0('0x1c')](_0xd6f0('0x21'))?JSON[_0xd6f0('0x1d')](this[_0xd6f0('0x1c')](_0xd6f0('0x21'))):{};},'set':function(_0x39e96a){return this[_0xd6f0('0x22')](_0xd6f0('0x21'),JSON[_0xd6f0('0x1f')](_0x39e96a));}},'token':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':function(){return rs[_0xd6f0('0x23')]();}},'autoclose':{'type':Sequelize[_0xd6f0('0xe')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xd6f0('0xe')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xd6f0('0xe')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xd6f0('0x2')]},'forwardOffline':{'type':Sequelize[_0xd6f0('0xe')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xd6f0('0x2')]},'waitingTitle':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':_0xd6f0('0x24')},'waitingMessage':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':_0xd6f0('0x25')},'offlineMessageSubject':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':_0xd6f0('0x26')},'skipUnmanaged':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':_0xd6f0('0x15')},'sendUnmanaged':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0xd6f0('0xe')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xd6f0('0x19')]},'showAgentAvatar':{'type':Sequelize[_0xd6f0('0xe')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xd6f0('0x2')]},'notificationTemplate':{'type':Sequelize[_0xd6f0('0x19')],'defaultValue':function(){return _0xd6f0('0x27');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xd6f0('0xe')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xd6f0('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0xd6f0('0x28')},'verticalAlignment':{'type':Sequelize[_0xd6f0('0x6')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':_0xd6f0('0x29')},'messagesAlignment':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':_0xd6f0('0x2a')},'defaultTitle':{'type':Sequelize[_0xd6f0('0x2')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xd6f0('0x6')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xd6f0('0x2')],'allowNull':![],'defaultValue':_0xd6f0('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd6f0('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd6f0('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':_0xd6f0('0x2c')},'systemAvatar':{'type':Sequelize[_0xd6f0('0x19')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd6f0('0x6')],'comment':_0xd6f0('0x2d')},'mandatoryDisposition':{'type':Sequelize[_0xd6f0('0xe')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1af620){if(!_0x1af620)this[_0xd6f0('0x22')](_0xd6f0('0x2e'),null);this[_0xd6f0('0x22')]('mandatoryDisposition',_0x1af620);}},'vidaooEscalation':{'type':Sequelize[_0xd6f0('0xe')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xd6f0('0x2')]},'vidaooTopic':{'type':Sequelize[_0xd6f0('0x2')],'allowNull':![],'defaultValue':_0xd6f0('0x2f')},'vidaooNote':{'type':Sequelize[_0xd6f0('0x2')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0xd6f0('0x19')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xd6f0('0xe')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xd6f0('0x19')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 92ad870..341b917 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 _0xe254=['version','%s\x20%s','unknown','device','vendor','format','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','interaction','spread','messageId','created','autoclose','close','unmanaged','agent','*,*,*,*','forcedOwnership','startRouting','Start','EventManager','notify','offline','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','readFileSync','utf8','toPairs','ChatOfflineMessage','fromString','mimetype','files','offline-chat','basename','sequelize','transaction','Attachment','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','sendMail','MailAccountId','originalname','subjectOffline','mapValues','email','NotifyMailAccount','notifyMail','server','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','User','Owner','Tag','Tags','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','Interval','Intervals','License','increment','chatLicenseExceeded','push','all','some','server/files/chat/iframe.ejs','URL','address','3.1.0','x-real-ip','remoteAddress','virtual','replace','render','alignment','verticalAlignment','labelText','textColor','textButtonColor','color_button','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','stack','finally','sendStatus','getApplications','addProactiveActions','chatProactiveAction','getProactiveActions','ChatProactiveAction','getFields','false','offlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','getAgents','bluebird','mustache','util','path','fs-extra','querystring','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','html-to-text','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','offset','undefined','limit','count','set','Content-Range','json','update','destroy','ChatWebsites','name','send','index','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','include','findAll','rows','show','params','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','Disposition','getDispositions','findOne','ChatWebsiteId','includeAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','file','filename','addAvatar','agentAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','getLicense','custom','isNil','sitepic','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','user-agent-parser','setUA','headers','user-agent','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','DESC','ChatApplication','account','Applications','list','orderBy','applications','priority','Contacts','contact','cf-connecting-ip','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser'];(function(_0x4b0a13,_0x9f30e0){var _0x4d11bf=function(_0x1cc6cc){while(--_0x1cc6cc){_0x4b0a13['push'](_0x4b0a13['shift']());}};_0x4d11bf(++_0x9f30e0);}(_0xe254,0x1a9));var _0x4e25=function(_0x2d1e99,_0x1a5b32){_0x2d1e99=_0x2d1e99-0x0;var _0x4eb5c5=_0xe254[_0x2d1e99];return _0x4eb5c5;};'use strict';var BPromise=require(_0x4e25('0x0'));var Mustache=require(_0x4e25('0x1'));var util=require(_0x4e25('0x2'));var path=require(_0x4e25('0x3'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4e25('0x4'));var _=require('lodash');var querystring=require(_0x4e25('0x5'));var Redis=require(_0x4e25('0x6'));var qs=require(_0x4e25('0x7'));var logger=require('../../config/logger')(_0x4e25('0x8'));var config=require(_0x4e25('0x9'));var url=require('url');var db=require(_0x4e25('0xa'))['db'];config[_0x4e25('0xb')]=_[_0x4e25('0xc')](config['redis'],{'host':_0x4e25('0xd'),'port':0x18eb});var socket=require(_0x4e25('0xe'))(new Redis(config[_0x4e25('0xb')]));require(_0x4e25('0xf'))[_0x4e25('0x10')](socket);var htmlToText=require(_0x4e25('0x11'));var jayson=require('jayson/promise');var client=jayson[_0x4e25('0x12')]['http']({'port':0x232c});var client9002=jayson[_0x4e25('0x12')][_0x4e25('0x13')]({'port':0x232a});var client9003=jayson[_0x4e25('0x12')][_0x4e25('0x13')]({'port':0x232b});var client9001=jayson[_0x4e25('0x12')][_0x4e25('0x13')]({'port':0x2329});function respondWithRpcPromise(_0x2aaee4,_0x4d5dc1,_0x1e007d,_0x26469e){return new BPromise(function(_0x88f7c7,_0x19b069){var _0x3e41f9=_0x26469e||client;return _0x3e41f9[_0x4e25('0x14')](_0x2aaee4,_0x1e007d)[_0x4e25('0x15')](function(_0xe071c2){logger[_0x4e25('0x16')](_0x4e25('0x17'),_0x4d5dc1,_0x4e25('0x18'));logger['debug'](_0x4e25('0x19'),_0x4d5dc1,_0x4e25('0x18'),JSON[_0x4e25('0x1a')](_0xe071c2));if(_0xe071c2[_0x4e25('0x1b')]){if(_0xe071c2[_0x4e25('0x1b')][_0x4e25('0x1c')]===0x1f4){logger[_0x4e25('0x1b')](_0x4e25('0x17'),_0x4d5dc1,_0xe071c2['error'][_0x4e25('0x1d')]);return _0x19b069(_0xe071c2[_0x4e25('0x1b')]['message']);}logger['error'](_0x4e25('0x17'),_0x4d5dc1,_0xe071c2['error'][_0x4e25('0x1d')]);return _0x88f7c7(_0xe071c2[_0x4e25('0x1b')][_0x4e25('0x1d')]);}else{logger[_0x4e25('0x16')](_0x4e25('0x17'),_0x4d5dc1,_0x4e25('0x18'));_0x88f7c7(_0xe071c2['result'][_0x4e25('0x1d')]);}})[_0x4e25('0x1e')](function(_0x4b61d6){logger['error'](_0x4e25('0x17'),_0x4d5dc1,_0x4b61d6);_0x19b069(_0x4b61d6);});});}function respondWithStatusCode(_0x4ae962,_0x101ed7){_0x101ed7=_0x101ed7||0xcc;return function(_0x6d3f98){if(_0x6d3f98){return _0x4ae962['sendStatus'](_0x101ed7);}return _0x4ae962[_0x4e25('0x1f')](_0x101ed7)['end']();};}function respondWithResult(_0x26750d,_0x3531ba){_0x3531ba=_0x3531ba||0xc8;return function(_0x3c202f){if(_0x3c202f){return _0x26750d[_0x4e25('0x1f')](_0x3531ba)['json'](_0x3c202f);}};}function respondWithFilteredResult(_0x492b16,_0x43a3ba){return function(_0x501dd6){if(_0x501dd6){var _0x39ac8b=typeof _0x43a3ba[_0x4e25('0x20')]===_0x4e25('0x21')&&typeof _0x43a3ba[_0x4e25('0x22')]===_0x4e25('0x21');var _0x482856=_0x501dd6['count'];var _0x2673c4=_0x39ac8b?0x0:_0x43a3ba[_0x4e25('0x20')];var _0x3b3d2d=_0x39ac8b?_0x501dd6[_0x4e25('0x23')]:_0x43a3ba[_0x4e25('0x20')]+_0x43a3ba[_0x4e25('0x22')];var _0x36c0f6;if(_0x3b3d2d>=_0x482856){_0x3b3d2d=_0x482856;_0x36c0f6=0xc8;}else{_0x36c0f6=0xce;}_0x492b16['status'](_0x36c0f6);return _0x492b16[_0x4e25('0x24')](_0x4e25('0x25'),_0x2673c4+'-'+_0x3b3d2d+'/'+_0x482856)[_0x4e25('0x26')](_0x501dd6);}return null;};}function saveUpdates(_0xd29de2){return function(_0x4d80eb){if(_0x4d80eb){return _0x4d80eb[_0x4e25('0x27')](_0xd29de2)[_0x4e25('0x15')](function(_0x14e960){return _0x14e960;});}return null;};}function removeEntity(_0x5c9c02){return function(_0x203c89){if(_0x203c89){return _0x203c89[_0x4e25('0x28')]()['then'](function(){var _0x3b45c7=_0x203c89['get']({'plain':!![]});var _0x5af48d=_0x4e25('0x29');return db['UserProfileResource'][_0x4e25('0x28')]({'where':{'type':_0x5af48d,'resourceId':_0x3b45c7['id']}})[_0x4e25('0x15')](function(){return _0x203c89;});})['then'](function(){_0x5c9c02[_0x4e25('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3970a8){return function(_0xb5ee74){if(!_0xb5ee74){_0x3970a8['sendStatus'](0x194);}return _0xb5ee74;};}function handleError(_0x583701,_0x506407){_0x506407=_0x506407||0x1f4;return function(_0x1392e6){logger[_0x4e25('0x1b')](_0x1392e6['stack']);if(_0x1392e6['name']){delete _0x1392e6[_0x4e25('0x2a')];}_0x583701['status'](_0x506407)[_0x4e25('0x2b')](_0x1392e6);};}exports[_0x4e25('0x2c')]=function(_0x2609c4,_0x232ca1){var _0x4f506d={'include':[{'model':db[_0x4e25('0x2d')],'as':_0x4e25('0x2e')}]},_0x8649b6={},_0x199edc={'count':0x0,'rows':[]};var _0x2046f0=_['map'](db[_0x4e25('0x2f')][_0x4e25('0x30')],function(_0x399a47){return{'name':_0x399a47[_0x4e25('0x31')],'type':_0x399a47[_0x4e25('0x32')][_0x4e25('0x33')]};});_0x8649b6[_0x4e25('0x34')]=_['map'](_0x2046f0,_0x4e25('0x2a'));_0x8649b6['query']=_[_0x4e25('0x35')](_0x2609c4['query']);_0x8649b6[_0x4e25('0x36')]=_[_0x4e25('0x37')](_0x8649b6[_0x4e25('0x34')],_0x8649b6[_0x4e25('0x38')]);_0x4f506d['attributes']=_[_0x4e25('0x37')](_0x8649b6[_0x4e25('0x34')],qs[_0x4e25('0x39')](_0x2609c4['query'][_0x4e25('0x39')]));_0x4f506d[_0x4e25('0x3a')]=_0x4f506d[_0x4e25('0x3a')][_0x4e25('0x3b')]?_0x4f506d[_0x4e25('0x3a')]:_0x8649b6[_0x4e25('0x34')];if(!_0x2609c4[_0x4e25('0x38')][_0x4e25('0x3c')](_0x4e25('0x3d'))){_0x4f506d['limit']=qs['limit'](_0x2609c4['query'][_0x4e25('0x22')]);_0x4f506d[_0x4e25('0x20')]=qs[_0x4e25('0x20')](_0x2609c4[_0x4e25('0x38')]['offset']);}_0x4f506d[_0x4e25('0x3e')]=qs[_0x4e25('0x3f')](_0x2609c4['query'][_0x4e25('0x3f')]);_0x4f506d[_0x4e25('0x40')]=qs[_0x4e25('0x36')](_[_0x4e25('0x41')](_0x2609c4['query'],_0x8649b6['filters']),_0x2046f0);if(_0x2609c4[_0x4e25('0x38')][_0x4e25('0x42')]){_0x4f506d['where']=_[_0x4e25('0x43')](_0x4f506d['where'],{'$or':_[_0x4e25('0x44')](_0x2046f0,function(_0x1c35ce){if(_0x1c35ce[_0x4e25('0x32')]!==_0x4e25('0x45')){var _0x275f7a={};_0x275f7a[_0x1c35ce['name']]={'$like':'%'+_0x2609c4[_0x4e25('0x38')][_0x4e25('0x42')]+'%'};return _0x275f7a;}})});}_0x4f506d=_[_0x4e25('0x43')]({},_0x4f506d,_0x2609c4[_0x4e25('0x46')]);var _0x50c328={'where':_0x4f506d[_0x4e25('0x40')]};return db[_0x4e25('0x2f')]['count'](_0x50c328)[_0x4e25('0x15')](function(_0x5bd0f7){_0x199edc[_0x4e25('0x23')]=_0x5bd0f7;if(_0x2609c4[_0x4e25('0x38')]['includeAll']){_0x4f506d[_0x4e25('0x47')]=[{'all':!![]}];}return db[_0x4e25('0x2f')][_0x4e25('0x48')](_0x4f506d);})[_0x4e25('0x15')](function(_0x1bdba7){_0x199edc[_0x4e25('0x49')]=_0x1bdba7;return _0x199edc;})[_0x4e25('0x15')](respondWithFilteredResult(_0x232ca1,_0x4f506d))['catch'](handleError(_0x232ca1,null));};exports[_0x4e25('0x4a')]=function(_0xa2061a,_0x18cd1c){var _0x3675cd={'raw':![],'where':{'id':_0xa2061a[_0x4e25('0x4b')]['id']},'include':[{'model':db['Pause'],'as':_0x4e25('0x2e')}]},_0x2875fd={};_0x2875fd['model']=_['keys'](db[_0x4e25('0x2f')][_0x4e25('0x30')]);_0x2875fd[_0x4e25('0x38')]=_[_0x4e25('0x35')](_0xa2061a[_0x4e25('0x38')]);_0x2875fd[_0x4e25('0x36')]=_[_0x4e25('0x37')](_0x2875fd[_0x4e25('0x34')],_0x2875fd[_0x4e25('0x38')]);_0x3675cd[_0x4e25('0x3a')]=_[_0x4e25('0x37')](_0x2875fd['model'],qs[_0x4e25('0x39')](_0xa2061a[_0x4e25('0x38')]['fields']));_0x3675cd['attributes']=_0x3675cd[_0x4e25('0x3a')]['length']?_0x3675cd[_0x4e25('0x3a')]:_0x2875fd[_0x4e25('0x34')];if(_0xa2061a['query']['includeAll']){_0x3675cd[_0x4e25('0x47')]=[{'all':!![]}];}_0x3675cd=_[_0x4e25('0x43')]({},_0x3675cd,_0xa2061a[_0x4e25('0x46')]);return db['ChatWebsite'][_0x4e25('0x4c')](_0x3675cd)['then'](handleEntityNotFound(_0x18cd1c,null))['then'](respondWithResult(_0x18cd1c,null))[_0x4e25('0x1e')](handleError(_0x18cd1c,null));};exports[_0x4e25('0x4d')]=function(_0x1195f9,_0x43fb24){return db['ChatWebsite']['create'](_0x1195f9['body'],{})['then'](function(_0x28fe29){var _0x5282c1=_0x1195f9[_0x4e25('0x4e')][_0x4e25('0x4f')]({'plain':!![]});if(!_0x5282c1)throw new Error(_0x4e25('0x50'));if(_0x5282c1[_0x4e25('0x51')]===_0x4e25('0x4e')){var _0x479999=_0x28fe29[_0x4e25('0x4f')]({'plain':!![]});var _0x35925c=_0x4e25('0x29');return db[_0x4e25('0x52')][_0x4e25('0x4c')]({'where':{'name':_0x35925c,'userProfileId':_0x5282c1[_0x4e25('0x53')]},'raw':!![]})[_0x4e25('0x15')](function(_0x31b589){if(_0x31b589&&_0x31b589[_0x4e25('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0x479999['name'],'resourceId':_0x479999['id'],'type':_0x31b589[_0x4e25('0x2a')],'sectionId':_0x31b589['id']},{})[_0x4e25('0x15')](function(){return _0x28fe29;});}else{return _0x28fe29;}})['catch'](function(_0x9d21cf){logger[_0x4e25('0x1b')](_0x4e25('0x55'),_0x9d21cf);throw _0x9d21cf;});}return _0x28fe29;})[_0x4e25('0x15')](respondWithResult(_0x43fb24,0xc9))[_0x4e25('0x1e')](handleError(_0x43fb24,null));};exports[_0x4e25('0x27')]=function(_0x2f1ba8,_0x53b273){if(_0x2f1ba8['body']['id']){delete _0x2f1ba8[_0x4e25('0x56')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x2f1ba8[_0x4e25('0x4b')]['id']},'include':[{'model':db['Pause'],'as':_0x4e25('0x2e')}]})[_0x4e25('0x15')](handleEntityNotFound(_0x53b273,null))[_0x4e25('0x15')](saveUpdates(_0x2f1ba8[_0x4e25('0x56')],null))[_0x4e25('0x15')](respondWithResult(_0x53b273,null))['catch'](handleError(_0x53b273,null));};exports[_0x4e25('0x28')]=function(_0x42d383,_0x5943ba){return db[_0x4e25('0x2f')]['find']({'where':{'id':_0x42d383['params']['id']}})[_0x4e25('0x15')](handleEntityNotFound(_0x5943ba,null))[_0x4e25('0x15')](removeEntity(_0x5943ba,null))[_0x4e25('0x1e')](handleError(_0x5943ba,null));};exports[_0x4e25('0x57')]=function(_0x431bc9,_0x436a49){return db[_0x4e25('0x2f')][_0x4e25('0x57')]()[_0x4e25('0x15')](respondWithResult(_0x436a49,null))[_0x4e25('0x1e')](handleError(_0x436a49,null));};exports[_0x4e25('0x58')]=function(_0x265f65,_0x342201){if(_0x265f65[_0x4e25('0x56')]['id']){delete _0x265f65[_0x4e25('0x56')]['id'];}return db['ChatWebsite'][_0x4e25('0x4c')]({'where':{'id':_0x265f65[_0x4e25('0x4b')]['id']}})[_0x4e25('0x15')](handleEntityNotFound(_0x342201,null))['then'](function(_0x532a05){if(_0x532a05){_0x265f65[_0x4e25('0x56')]['ChatWebsiteId']=_0x532a05['id'];return db[_0x4e25('0x59')]['create'](_0x265f65[_0x4e25('0x56')]);}})[_0x4e25('0x15')](respondWithResult(_0x342201,null))[_0x4e25('0x1e')](handleError(_0x342201,null));};exports[_0x4e25('0x5a')]=function(_0x30cc6c,_0x2c19c4){var _0x48337b={'raw':![],'where':{}};var _0x39435f={};var _0x25233b={'count':0x0,'rows':[]};return db[_0x4e25('0x2f')][_0x4e25('0x5b')]({'where':{'id':_0x30cc6c[_0x4e25('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2c19c4,null))[_0x4e25('0x15')](function(_0xa28a62){if(_0xa28a62){_0x39435f[_0x4e25('0x34')]=_[_0x4e25('0x35')](db[_0x4e25('0x59')]['rawAttributes']);_0x39435f[_0x4e25('0x38')]=_[_0x4e25('0x35')](_0x30cc6c['query']);_0x39435f['filters']=_['intersection'](_0x39435f['model'],_0x39435f[_0x4e25('0x38')]);_0x48337b[_0x4e25('0x3a')]=_[_0x4e25('0x37')](_0x39435f[_0x4e25('0x34')],qs[_0x4e25('0x39')](_0x30cc6c['query'][_0x4e25('0x39')]));_0x48337b[_0x4e25('0x3a')]=_0x48337b[_0x4e25('0x3a')][_0x4e25('0x3b')]?_0x48337b[_0x4e25('0x3a')]:_0x39435f[_0x4e25('0x34')];if(!_0x30cc6c[_0x4e25('0x38')][_0x4e25('0x3c')](_0x4e25('0x3d'))){_0x48337b[_0x4e25('0x22')]=qs[_0x4e25('0x22')](_0x30cc6c[_0x4e25('0x38')][_0x4e25('0x22')]);_0x48337b[_0x4e25('0x20')]=qs[_0x4e25('0x20')](_0x30cc6c['query']['offset']);}_0x48337b[_0x4e25('0x3e')]=qs[_0x4e25('0x3f')](_0x30cc6c[_0x4e25('0x38')][_0x4e25('0x3f')]);_0x48337b[_0x4e25('0x40')]=qs[_0x4e25('0x36')](_[_0x4e25('0x41')](_0x30cc6c[_0x4e25('0x38')],_0x39435f['filters']));_0x48337b[_0x4e25('0x40')][_0x4e25('0x5c')]=_0xa28a62['id'];if(_0x30cc6c['query'][_0x4e25('0x42')]){_0x48337b['where']=_['merge'](_0x48337b[_0x4e25('0x40')],{'$or':_['map'](_0x48337b[_0x4e25('0x3a')],function(_0x2be3e2){var _0xb9d82d={};_0xb9d82d[_0x2be3e2]={'$like':'%'+_0x30cc6c[_0x4e25('0x38')]['filter']+'%'};return _0xb9d82d;})});}_0x48337b=_['merge']({},_0x48337b,_0x30cc6c[_0x4e25('0x46')]);return db[_0x4e25('0x59')][_0x4e25('0x23')]({'where':_0x48337b[_0x4e25('0x40')]})[_0x4e25('0x15')](function(_0x1dde07){_0x25233b[_0x4e25('0x23')]=_0x1dde07;if(_0x30cc6c['query'][_0x4e25('0x5d')]){_0x48337b[_0x4e25('0x47')]=[{'all':!![]}];}return db[_0x4e25('0x59')]['findAll'](_0x48337b);})[_0x4e25('0x15')](function(_0x40d1b){_0x25233b['rows']=_0x40d1b;return _0x25233b;});}})[_0x4e25('0x15')](respondWithFilteredResult(_0x2c19c4,_0x48337b))[_0x4e25('0x1e')](handleError(_0x2c19c4,null));};exports[_0x4e25('0x5e')]=function(_0x479d85,_0x1cd6ee){return db['ChatWebsite']['find']({'where':{'id':_0x479d85['params']['id']}})[_0x4e25('0x15')](handleEntityNotFound(_0x1cd6ee,null))[_0x4e25('0x15')](function(_0x2c0689){if(_0x2c0689){return _0x2c0689[_0x4e25('0x5e')](_0x479d85[_0x4e25('0x38')][_0x4e25('0x5f')]);}})[_0x4e25('0x15')](respondWithStatusCode(_0x1cd6ee,null))[_0x4e25('0x1e')](handleError(_0x1cd6ee,null));};exports[_0x4e25('0x60')]=function(_0x1dc3f7,_0x832157){if(_0x1dc3f7['body']['id']){delete _0x1dc3f7[_0x4e25('0x56')]['id'];}return db[_0x4e25('0x2f')]['find']({'where':{'id':_0x1dc3f7[_0x4e25('0x4b')]['id']}})[_0x4e25('0x15')](handleEntityNotFound(_0x832157,null))[_0x4e25('0x15')](function(_0xfdd12d){if(_0xfdd12d){_0x1dc3f7['body'][_0x4e25('0x5c')]=_0xfdd12d['id'];return db[_0x4e25('0x61')][_0x4e25('0x4d')](_0x1dc3f7[_0x4e25('0x56')]);}})['then'](respondWithResult(_0x832157,null))[_0x4e25('0x1e')](handleError(_0x832157,null));};exports[_0x4e25('0x62')]=function(_0x2a781a,_0x52a9a7){var _0x507262={'raw':![],'where':{}};var _0x5ea415={};var _0x4ab20c={'count':0x0,'rows':[]};return db[_0x4e25('0x2f')][_0x4e25('0x5b')]({'where':{'id':_0x2a781a['params']['id']}})[_0x4e25('0x15')](handleEntityNotFound(_0x52a9a7,null))[_0x4e25('0x15')](function(_0x523787){if(_0x523787){_0x5ea415[_0x4e25('0x34')]=_[_0x4e25('0x35')](db[_0x4e25('0x61')][_0x4e25('0x30')]);_0x5ea415['query']=_[_0x4e25('0x35')](_0x2a781a['query']);_0x5ea415[_0x4e25('0x36')]=_[_0x4e25('0x37')](_0x5ea415[_0x4e25('0x34')],_0x5ea415[_0x4e25('0x38')]);_0x507262['attributes']=_['intersection'](_0x5ea415['model'],qs['fields'](_0x2a781a[_0x4e25('0x38')][_0x4e25('0x39')]));_0x507262['attributes']=_0x507262['attributes']['length']?_0x507262[_0x4e25('0x3a')]:_0x5ea415[_0x4e25('0x34')];if(!_0x2a781a[_0x4e25('0x38')][_0x4e25('0x3c')](_0x4e25('0x3d'))){_0x507262['limit']=qs[_0x4e25('0x22')](_0x2a781a[_0x4e25('0x38')]['limit']);_0x507262[_0x4e25('0x20')]=qs[_0x4e25('0x20')](_0x2a781a[_0x4e25('0x38')][_0x4e25('0x20')]);}_0x507262['order']=qs['sort'](_0x2a781a[_0x4e25('0x38')][_0x4e25('0x3f')]);_0x507262[_0x4e25('0x40')]=qs['filters'](_[_0x4e25('0x41')](_0x2a781a[_0x4e25('0x38')],_0x5ea415['filters']));_0x507262[_0x4e25('0x40')][_0x4e25('0x5c')]=_0x523787['id'];if(_0x2a781a[_0x4e25('0x38')][_0x4e25('0x42')]){_0x507262[_0x4e25('0x40')]=_[_0x4e25('0x43')](_0x507262[_0x4e25('0x40')],{'$or':_['map'](_0x507262[_0x4e25('0x3a')],function(_0x2992ff){var _0x59c418={};_0x59c418[_0x2992ff]={'$like':'%'+_0x2a781a[_0x4e25('0x38')][_0x4e25('0x42')]+'%'};return _0x59c418;})});}_0x507262=_[_0x4e25('0x43')]({},_0x507262,_0x2a781a[_0x4e25('0x46')]);return db['CannedAnswer'][_0x4e25('0x23')]({'where':_0x507262['where']})[_0x4e25('0x15')](function(_0x4d1578){_0x4ab20c[_0x4e25('0x23')]=_0x4d1578;if(_0x2a781a['query'][_0x4e25('0x5d')]){_0x507262[_0x4e25('0x47')]=[{'all':!![]}];}return db['CannedAnswer'][_0x4e25('0x48')](_0x507262);})[_0x4e25('0x15')](function(_0x371710){_0x4ab20c[_0x4e25('0x49')]=_0x371710;return _0x4ab20c;});}})[_0x4e25('0x15')](respondWithFilteredResult(_0x52a9a7,_0x507262))[_0x4e25('0x1e')](handleError(_0x52a9a7,null));};exports[_0x4e25('0x63')]=function(_0x25f0ec,_0x391332){return db[_0x4e25('0x2f')]['find']({'where':{'id':_0x25f0ec['params']['id']}})[_0x4e25('0x15')](handleEntityNotFound(_0x391332,null))[_0x4e25('0x15')](function(_0x3feb81){if(_0x3feb81){return _0x3feb81[_0x4e25('0x63')](_0x25f0ec[_0x4e25('0x38')][_0x4e25('0x5f')]);}})[_0x4e25('0x15')](respondWithStatusCode(_0x391332,null))[_0x4e25('0x1e')](handleError(_0x391332,null));};exports[_0x4e25('0x64')]=function(_0x15ce20,_0xe48826){_0x15ce20[_0x4e25('0x56')]['sitepic']=_0x15ce20[_0x4e25('0x65')][_0x4e25('0x66')];return db[_0x4e25('0x2f')][_0x4e25('0x4c')]({'where':{'id':_0x15ce20[_0x4e25('0x4b')]['id']}})[_0x4e25('0x15')](handleEntityNotFound(_0xe48826,null))[_0x4e25('0x15')](saveUpdates(_0x15ce20[_0x4e25('0x56')],null))['then'](respondWithResult(_0xe48826,null))[_0x4e25('0x1e')](handleError(_0xe48826,null));};exports[_0x4e25('0x67')]=function(_0x215650,_0x4ea797){_0x215650[_0x4e25('0x56')][_0x4e25('0x68')]=_0x215650[_0x4e25('0x65')][_0x4e25('0x66')];return db[_0x4e25('0x2f')][_0x4e25('0x4c')]({'where':{'id':_0x215650['params']['id']}})[_0x4e25('0x15')](handleEntityNotFound(_0x4ea797,null))['then'](saveUpdates(_0x215650[_0x4e25('0x56')],null))[_0x4e25('0x15')](respondWithResult(_0x4ea797,null))[_0x4e25('0x1e')](handleError(_0x4ea797,null));};exports['addCustomerAvatar']=function(_0x29500b,_0x3ac5d0){_0x29500b[_0x4e25('0x56')][_0x4e25('0x69')]=_0x29500b[_0x4e25('0x65')][_0x4e25('0x66')];return db[_0x4e25('0x2f')][_0x4e25('0x4c')]({'where':{'id':_0x29500b[_0x4e25('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3ac5d0,null))[_0x4e25('0x15')](saveUpdates(_0x29500b[_0x4e25('0x56')],null))['then'](respondWithResult(_0x3ac5d0,null))[_0x4e25('0x1e')](handleError(_0x3ac5d0,null));};exports[_0x4e25('0x6a')]=function(_0x538c48,_0x26ad4d){_0x538c48[_0x4e25('0x56')][_0x4e25('0x6b')]=_0x538c48['file'][_0x4e25('0x66')];return db[_0x4e25('0x2f')][_0x4e25('0x4c')]({'where':{'id':_0x538c48[_0x4e25('0x4b')]['id']}})[_0x4e25('0x15')](handleEntityNotFound(_0x26ad4d,null))['then'](saveUpdates(_0x538c48[_0x4e25('0x56')],null))[_0x4e25('0x15')](respondWithResult(_0x26ad4d,null))[_0x4e25('0x1e')](handleError(_0x26ad4d,null));};exports[_0x4e25('0x6c')]=function(_0x53bc99,_0x19402f){var _0x5cad01=path[_0x4e25('0x6d')](config[_0x4e25('0x6e')],_0x4e25('0x6f'));var _0x4ad198={'where':{'id':_0x53bc99[_0x4e25('0x4b')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x4ab195=![];return require('../../config/license/util')[_0x4e25('0x70')]()['then'](function(_0x18f91a){if(_0x18f91a){_0x4ab195=_0x18f91a[_0x4e25('0x71')];}})[_0x4e25('0x15')](function(){return db['ChatWebsite']['find'](_0x4ad198);})[_0x4e25('0x15')](handleEntityNotFound(_0x19402f,null))[_0x4e25('0x15')](function(_0x25777e){if(_0x25777e){if(!_[_0x4e25('0x72')](_0x25777e[_0x4e25('0x73')])){if(fs[_0x4e25('0x74')](path[_0x4e25('0x6d')](config[_0x4e25('0x6e')],_0x4e25('0x75'),_0x25777e[_0x4e25('0x73')]))&&_0x4ab195){_0x5cad01=path[_0x4e25('0x6d')](config[_0x4e25('0x6e')],_0x4e25('0x75'),_0x25777e[_0x4e25('0x73')]);}}return _0x19402f[_0x4e25('0x76')](_0x5cad01);}})[_0x4e25('0x1e')](handleError(_0x19402f,null));};exports[_0x4e25('0x77')]=function(_0x2824fe,_0x3c143d){var _0x567c1d=path[_0x4e25('0x6d')](config[_0x4e25('0x6e')],_0x4e25('0x78'));var _0x256126={'where':{'id':_0x2824fe['params']['id']},'attributes':['id',_0x4e25('0x68')],'raw':!![]};return db[_0x4e25('0x2f')]['find'](_0x256126)['then'](handleEntityNotFound(_0x3c143d,null))[_0x4e25('0x15')](function(_0x3b9959){if(_0x3b9959){if(!_['isNil'](_0x3b9959['agentAvatar'])){if(fs[_0x4e25('0x74')](path['join'](config[_0x4e25('0x6e')],_0x4e25('0x79'),_0x3b9959[_0x4e25('0x68')]))){_0x567c1d=path[_0x4e25('0x6d')](config['root'],_0x4e25('0x79'),_0x3b9959[_0x4e25('0x68')]);}}return _0x3c143d[_0x4e25('0x76')](_0x567c1d);}})[_0x4e25('0x1e')](handleError(_0x3c143d,null));};exports[_0x4e25('0x7a')]=function(_0x1c674f,_0x2c6fc){var _0x38098f=path[_0x4e25('0x6d')](config[_0x4e25('0x6e')],_0x4e25('0x7b'));var _0x157eda={'where':{'id':_0x1c674f[_0x4e25('0x4b')]['id']},'attributes':['id',_0x4e25('0x69'),'showCustomerAvatar'],'raw':!![]};return db[_0x4e25('0x2f')][_0x4e25('0x4c')](_0x157eda)[_0x4e25('0x15')](handleEntityNotFound(_0x2c6fc,null))[_0x4e25('0x15')](function(_0x3181f0){if(_0x3181f0){if(!_['isNil'](_0x3181f0['customerAvatar'])){if(fs[_0x4e25('0x74')](path[_0x4e25('0x6d')](config['root'],_0x4e25('0x79'),_0x3181f0[_0x4e25('0x69')]))&&_0x3181f0[_0x4e25('0x7c')]){_0x38098f=path[_0x4e25('0x6d')](config[_0x4e25('0x6e')],_0x4e25('0x79'),_0x3181f0[_0x4e25('0x69')]);}}return _0x2c6fc[_0x4e25('0x76')](_0x38098f);}})[_0x4e25('0x1e')](handleError(_0x2c6fc,null));};exports[_0x4e25('0x7d')]=function(_0x52ec82,_0x3e7eb5){var _0x4cb1fa=path[_0x4e25('0x6d')](config[_0x4e25('0x6e')],_0x4e25('0x7e'));var _0x21f18d={'where':{'id':_0x52ec82['params']['id']},'attributes':['id',_0x4e25('0x6b')],'raw':!![]};return db[_0x4e25('0x2f')][_0x4e25('0x4c')](_0x21f18d)[_0x4e25('0x15')](handleEntityNotFound(_0x3e7eb5,null))['then'](function(_0x4c015b){if(_0x4c015b){if(!_[_0x4e25('0x72')](_0x4c015b[_0x4e25('0x6b')])){if(fs[_0x4e25('0x74')](path[_0x4e25('0x6d')](config[_0x4e25('0x6e')],_0x4e25('0x79'),_0x4c015b[_0x4e25('0x6b')]))){_0x4cb1fa=path['join'](config[_0x4e25('0x6e')],'server/files/images/avatars/',_0x4c015b[_0x4e25('0x6b')]);}}return _0x3e7eb5[_0x4e25('0x76')](_0x4cb1fa);}})[_0x4e25('0x1e')](handleError(_0x3e7eb5,null));};exports['notify']=function(_0x43464c,_0x1e1b68){var _0x4c872e=require(_0x4e25('0x7f'));var _0x59cb5a=new _0x4c872e();var _0x26dbc9=_0x59cb5a[_0x4e25('0x80')](_0x43464c[_0x4e25('0x81')][_0x4e25('0x82')])['getResult']();var _0x44b96c={'body':_0x43464c[_0x4e25('0x56')],'channel':'chat'};var _0x51ee5e=[];var _0x474e16=[];var _0x145709={};var _0x4c80c0=![];return db[_0x4e25('0x83')]['describe']()[_0x4e25('0x15')](function(_0x1c7635){if(!_0x1c7635){throw new db[(_0x4e25('0x84'))][(_0x4e25('0x85'))](_0x4e25('0x86'));}_0x51ee5e=_[_0x4e25('0x87')](_[_0x4e25('0x35')](_0x1c7635),[_0x4e25('0x88'),_0x4e25('0x89')]);_0x474e16=_[_0x4e25('0x87')](_[_0x4e25('0x35')](_0x1c7635),[_0x4e25('0x88'),_0x4e25('0x89'),_0x4e25('0x8a'),_0x4e25('0x8b')]);if(_0x43464c['body']['id']){delete _0x43464c['body']['id'];}if(_['isNil'](_0x43464c[_0x4e25('0x56')][_0x4e25('0x8c')])){throw new db['Sequelize']['ValidationError'](_0x4e25('0x8d'));}if(_[_0x4e25('0x72')](_0x43464c[_0x4e25('0x56')]['body'])||_0x43464c[_0x4e25('0x56')][_0x4e25('0x56')]===''){throw new db[(_0x4e25('0x84'))]['ValidationError'](_0x4e25('0x8e'));}if(_['isNil'](_0x43464c[_0x4e25('0x56')][_0x4e25('0x8f')])){throw new db['Sequelize'][(_0x4e25('0x85'))](_0x4e25('0x90')+_0x474e16);}if(!_['includes'](_0x474e16,_0x43464c['body']['mapKey'])){throw new db[(_0x4e25('0x84'))][(_0x4e25('0x85'))](_0x4e25('0x91')+_0x474e16);}_0x145709[_0x43464c['body']['mapKey']]=_0x43464c[_0x4e25('0x56')]['from'];})['then'](function(){return db[_0x4e25('0x2f')][_0x4e25('0x4c')]({'where':{'id':_0x43464c[_0x4e25('0x4b')]['id']},'include':[{'model':db['CmList'],'as':_0x4e25('0x92'),'include':[{'model':db[_0x4e25('0x83')],'as':'Contacts','where':_0x145709,'limit':0x1,'order':[[_0x4e25('0x89'),_0x4e25('0x93')]]}]},{'model':db[_0x4e25('0x94')],'as':'Applications'}]});})[_0x4e25('0x15')](handleEntityNotFound(_0x1e1b68,null))['then'](function(_0x29e0ce){if(_0x29e0ce&&_0x29e0ce['List']){_0x44b96c[_0x4e25('0x95')]=_0x29e0ce;_0x44b96c['applications']=_0x29e0ce[_0x4e25('0x96')];_0x44b96c[_0x4e25('0x97')]=_0x29e0ce[_0x4e25('0x92')];_0x44b96c['applications']=_[_0x4e25('0x98')](_0x44b96c[_0x4e25('0x99')],[_0x4e25('0x9a')],['asc']);if(_0x44b96c[_0x4e25('0x95')][_0x4e25('0x96')]){delete _0x44b96c[_0x4e25('0x95')][_0x4e25('0x96')];}if(_0x44b96c[_0x4e25('0x95')][_0x4e25('0x92')]&&_0x44b96c[_0x4e25('0x95')][_0x4e25('0x92')]['Contacts'][_0x4e25('0x3b')]){return _0x44b96c[_0x4e25('0x95')][_0x4e25('0x92')][_0x4e25('0x9b')][0x0];}var _0x342318=_[_0x4e25('0xc')](_0x43464c['body'],{'firstName':_0x43464c[_0x4e25('0x56')][_0x4e25('0x8c')],'ListId':_0x29e0ce[_0x4e25('0x8b')]});_0x342318[_0x43464c[_0x4e25('0x56')][_0x4e25('0x8f')]]=_0x43464c[_0x4e25('0x56')]['from'];return db['CmContact'][_0x4e25('0x4d')](_0x342318,{'fields':_0x51ee5e,'raw':!![]});}})[_0x4e25('0x15')](handleEntityNotFound(_0x1e1b68,null))[_0x4e25('0x15')](function(_0x512c12){_0x44b96c[_0x4e25('0x9c')]=_0x512c12;var _0xab39a3=_0x43464c[_0x4e25('0x56')]['customerIp'];if(_0x43464c[_0x4e25('0x81')][_0x4e25('0x9d')]){_0xab39a3=_0x43464c[_0x4e25('0x81')]['cf-connecting-ip'];}else if(_0x43464c[_0x4e25('0x81')][_0x4e25('0x9e')]){_0xab39a3=_['first'](_0x43464c['headers'][_0x4e25('0x9e')][_0x4e25('0x9f')](','));}if(_0x512c12){var _0x4d44ed={'ContactId':_0x512c12['id'],'ChatWebsiteId':_0x43464c[_0x4e25('0x4b')]['id'],'from':(_0x512c12[_0x4e25('0xa0')]||'')+'\x20'+(_0x512c12[_0x4e25('0xa1')]||''),'customerIp':_0xab39a3,'customerPort':_0x43464c[_0x4e25('0x81')]['x-real-port']?_0x43464c[_0x4e25('0x81')][_0x4e25('0xa2')]:null,'referer':_0x43464c[_0x4e25('0x56')][_0x4e25('0xa3')],'browserName':_0x26dbc9[_0x4e25('0xa4')]['name']&&_0x26dbc9[_0x4e25('0xa4')][_0x4e25('0xa5')]?util['format'](_0x4e25('0xa6'),_0x26dbc9['browser'][_0x4e25('0x2a')],_0x26dbc9[_0x4e25('0xa4')][_0x4e25('0xa5')]):'unknown','browserVersion':_0x26dbc9[_0x4e25('0xa4')][_0x4e25('0xa5')]||_0x4e25('0xa7'),'osName':util['format'](_0x4e25('0xa6'),_0x26dbc9['os']['name'],_0x26dbc9['os']['version']),'osVersion':_0x26dbc9['os'][_0x4e25('0xa5')],'deviceModel':_0x26dbc9[_0x4e25('0xa8')][_0x4e25('0x34')]&&_0x26dbc9[_0x4e25('0xa8')][_0x4e25('0xa9')]?util[_0x4e25('0xaa')](_0x4e25('0xab'),_0x26dbc9['device'][_0x4e25('0x34')],_0x26dbc9[_0x4e25('0xa8')][_0x4e25('0xa9')],_0x26dbc9['device'][_0x4e25('0x32')]):null,'deviceVendor':_0x26dbc9[_0x4e25('0xa8')][_0x4e25('0xa9')],'deviceType':_0x26dbc9[_0x4e25('0xa8')][_0x4e25('0x32')],'formData':JSON[_0x4e25('0x1a')](_0x43464c[_0x4e25('0x56')])};var _0x57dfcf={'ChatWebsiteId':_0x43464c['params']['id'],'closed':![]};if(_0x43464c[_0x4e25('0x56')][_0x4e25('0xac')]){_0x57dfcf['threadId']=_0x43464c[_0x4e25('0x56')][_0x4e25('0xac')];return db[_0x4e25('0xad')][_0x4e25('0x4c')]({'where':_0x57dfcf})[_0x4e25('0x15')](function(_0x153d61){if(_0x153d61){return[_0x153d61,![]];}_0x4d44ed['threadId']=_0x43464c[_0x4e25('0x56')][_0x4e25('0xac')];_0x4d44ed[_0x4e25('0xae')]=_0x43464c[_0x4e25('0x56')][_0x4e25('0xae')];return db[_0x4e25('0xad')][_0x4e25('0x4d')](_0x4d44ed)['then'](function(_0x2ca972){return[_0x2ca972,!![]];});});}_0x57dfcf['ContactId']=_0x512c12['id'];if(_0x43464c[_0x4e25('0x56')]['interaction']&&_0x43464c[_0x4e25('0x56')][_0x4e25('0xaf')]['id']){_0x57dfcf['id']=_0x43464c['body'][_0x4e25('0xaf')]['id'];return db[_0x4e25('0xad')][_0x4e25('0x4c')]({'where':_0x57dfcf})[_0x4e25('0x15')](function(_0x2ae232){if(_0x2ae232){return[_0x2ae232,![]];}return db['ChatInteraction'][_0x4e25('0x4d')](_0x4d44ed)[_0x4e25('0x15')](function(_0x236bca){return[_0x236bca,!![]];});});}return db[_0x4e25('0xad')][_0x4e25('0x4d')](_0x4d44ed)[_0x4e25('0x15')](function(_0x490d45){return[_0x490d45,!![]];});}})[_0x4e25('0xb0')](function(_0x5d756b,_0x580ede){if(_0x5d756b){_0x4c80c0=_0x580ede;if(!_0x580ede){var _0x4a9e22={'from':(_0x44b96c[_0x4e25('0x9c')][_0x4e25('0xa0')]||'')+'\x20'+(_0x44b96c['contact'][_0x4e25('0xa1')]||'')};if(_0x43464c[_0x4e25('0x56')][_0x4e25('0xac')]&&_0x43464c['body']['messageId']&&_0x43464c[_0x4e25('0x56')][_0x4e25('0xac')]!=_0x43464c['body']['messageId']){_0x4a9e22['threadId']=_0x43464c['body'][_0x4e25('0xb1')];}return _0x5d756b[_0x4e25('0x27')](_0x4a9e22);}else{return _0x5d756b;}}})[_0x4e25('0x15')](function(_0x1c48df){_0x44b96c[_0x4e25('0xaf')]=_0x1c48df[_0x4e25('0x4f')]({'plain':!![]});_0x44b96c[_0x4e25('0xaf')][_0x4e25('0xb2')]=_0x4c80c0;if(_0x44b96c[_0x4e25('0xaf')]['created']){if(_0x44b96c['account'][_0x4e25('0xb3')]){_0x44b96c['applications']['push']({'id':0x0,'priority':_0x44b96c[_0x4e25('0x99')]['length']+0x1,'app':_0x4e25('0xb4'),'appdata':_0x4e25('0xb5'),'interval':'*,*,*,*'});}}return db['ChatMessage']['create']({'body':_0x43464c[_0x4e25('0x56')][_0x4e25('0x56')],'ChatWebsiteId':_0x43464c[_0x4e25('0x4b')]['id'],'ChatInteractionId':_0x1c48df['id'],'direction':'in','ContactId':_0x44b96c['contact']['id'],'AttachmentId':_0x43464c[_0x4e25('0x56')]['AttachmentId']});})['then'](function(_0x169a92){_0x44b96c[_0x4e25('0x1d')]=_0x169a92;if(_0x44b96c[_0x4e25('0xaf')]['UserId']){return db['User'][_0x4e25('0x4c')]({'attributes':['id',_0x4e25('0x2a')],'where':{'id':_0x44b96c[_0x4e25('0xaf')]['UserId']}})[_0x4e25('0x15')](function(_0x31c503){if(_0x31c503){_0x44b96c['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0x4e25('0xb6'),'appdata':_0x31c503[_0x4e25('0x2a')]+','+(_0x44b96c[_0x4e25('0x95')]['waitForTheAssignedAgent']||0xa),'interval':_0x4e25('0xb7')});_0x44b96c[_0x4e25('0xb8')]=!![];}return respondWithRpcPromise('Start',_0x4e25('0xb9'),_0x44b96c);});}return respondWithRpcPromise(_0x4e25('0xba'),_0x4e25('0xb9'),_0x44b96c);})['then'](function(_0x3e821e){respondWithRpcPromise(_0x4e25('0xbb'),_0x4e25('0xbb'),{'event':_0x4e25('0xbc'),'message':_0x3e821e},client9002);return _0x3e821e;})[_0x4e25('0x15')](respondWithResult(_0x1e1b68,null))[_0x4e25('0x1e')](handleError(_0x1e1b68,null));};exports[_0x4e25('0xbd')]=function(_0x3b572a,_0x21eb9f){var _0x41c0b6,_0x444a2e,_0x5f4b77;var _0x37d989=[];var _0x57b10e={};var _0x14d6fd=_0x3b572a['files']||[];var _0x4086d9=[];var _0x1c9328;return db['CmContact']['describe']()[_0x4e25('0x15')](function(_0x465800){if(!_0x465800){throw new db[(_0x4e25('0x84'))][(_0x4e25('0x85'))](_0x4e25('0x86'));}_0x37d989=_['difference'](_[_0x4e25('0x35')](_0x465800),[_0x4e25('0x88'),_0x4e25('0x89'),_0x4e25('0x8a'),'ListId']);if(_0x3b572a[_0x4e25('0x56')]['id']){delete _0x3b572a[_0x4e25('0x56')]['id'];}if(_[_0x4e25('0x72')](_0x3b572a[_0x4e25('0x56')][_0x4e25('0x8c')])){throw _0x21eb9f[_0x4e25('0x1f')](0x1f4)['send'](new db[(_0x4e25('0x84'))]['ValidationError'](_0x4e25('0x8d')));}if(_[_0x4e25('0x72')](_0x3b572a[_0x4e25('0x56')][_0x4e25('0x56')])||_0x3b572a[_0x4e25('0x56')]['body']===''){throw _0x21eb9f[_0x4e25('0x1f')](0x1f4)[_0x4e25('0x2b')](new db[(_0x4e25('0x84'))]['ValidationError'](_0x4e25('0x8e')));}if(_['isNil'](_0x3b572a[_0x4e25('0x56')][_0x4e25('0xbe')])){throw _0x21eb9f[_0x4e25('0x1f')](0x1f4)[_0x4e25('0x2b')](new db[(_0x4e25('0x84'))]['ValidationError'](_0x4e25('0xbf')+_0x37d989));}if(!_[_0x4e25('0xc0')](_0x37d989,_0x3b572a[_0x4e25('0x56')][_0x4e25('0xbe')])){throw _0x21eb9f['status'](0x1f4)[_0x4e25('0x2b')](new db[(_0x4e25('0x84'))]['ValidationError'](_0x4e25('0xc1')+_0x37d989));}_0x57b10e[_0x3b572a['body']['mapKeyOffline']]=_0x3b572a[_0x4e25('0x56')][_0x4e25('0x8c')];})['then'](function(){return db[_0x4e25('0x2f')][_0x4e25('0x4c')]({'where':{'id':_0x3b572a['params']['id']},'include':[{'model':db[_0x4e25('0xc2')],'as':_0x4e25('0x92')},{'model':db[_0x4e25('0xc3')],'as':'MailAccount'}]});})[_0x4e25('0x15')](handleEntityNotFound(_0x21eb9f,null))[_0x4e25('0x15')](function(_0x3ada6f){if(_0x3ada6f&&_0x3ada6f[_0x4e25('0x92')]){_0x444a2e=_0x3ada6f;var _0x1ebdfc=_[_0x4e25('0xc')](_0x3b572a[_0x4e25('0x56')],{'firstName':_0x3b572a[_0x4e25('0x56')][_0x4e25('0x8c')],'phone':_0x3b572a['body'][_0x4e25('0x8c')],'ListId':_0x3ada6f[_0x4e25('0x8b')]});_0x1ebdfc[_0x3b572a[_0x4e25('0x56')][_0x4e25('0xbe')]]=_0x3b572a['body'][_0x4e25('0x8c')];return db['CmContact']['findOrCreate']({'where':_0x57b10e,'defaults':_0x1ebdfc});}})[_0x4e25('0xb0')](function(_0x4fe1b6){if(_0x4fe1b6){_0x5f4b77=_0x4fe1b6;var _0x2d2e54=fs[_0x4e25('0xc4')](path[_0x4e25('0x6d')](config[_0x4e25('0x6e')],'server/files/templates/chatOfflineMessage.ejs'),_0x4e25('0xc5'));var _0x43dfd5=ejs['render'](_0x2d2e54,{'body':_[_0x4e25('0xc6')](_0x3b572a[_0x4e25('0x56')][_0x4e25('0x56')]),'bodyTitle':_0x444a2e['offlineMessageBody']});return db[_0x4e25('0xc7')][_0x4e25('0x4d')]({'body':_0x43dfd5,'plainBody':htmlToText[_0x4e25('0xc8')](_0x43dfd5),'ContactId':_0x4fe1b6['id'],'ChatWebsiteId':_0x444a2e['id']});}})[_0x4e25('0x15')](function(_0x3f05ff){_0x1c9328=_0x3f05ff;if(_0x14d6fd[_0x4e25('0x3b')]){var _0x555ca4=_0x14d6fd[_0x4e25('0x44')](function(_0x41061a){return{'name':_0x41061a['originalname'],'basename':_0x41061a[_0x4e25('0x66')],'type':_0x41061a[_0x4e25('0xc9')],'ChatOfflineMessageId':_0x3f05ff['id']};});_0x4086d9=_0x555ca4['map'](_0x1e198f=>{var _0x1d1db5={'filename':_0x1e198f['name'],'path':path['join'](config[_0x4e25('0x6e')],'server',_0x4e25('0xca'),'attachments',_0x4e25('0xcb'),_0x1e198f[_0x4e25('0xcc')])};return _0x1d1db5;});if(!_0x444a2e['openNewInteraction']){return db[_0x4e25('0xcd')][_0x4e25('0xce')](function(_0x44089b){return db[_0x4e25('0xcf')]['bulkCreate'](_0x555ca4,{'transaction':_0x44089b});});}}})[_0x4e25('0x15')](function(){if(_0x1c9328){_0x41c0b6=_0x1c9328;return db['MailAccount'][_0x4e25('0x5b')]({'where':{'service':!![]},'include':[{'model':db[_0x4e25('0xd0')],'as':_0x4e25('0xd1'),'raw':!![],'include':[{'model':db[_0x4e25('0xd2')],'as':'CloudProvider','raw':!![]}]}]});}})['then'](function(_0x4a9879){if(_0x4a9879&&_0x4a9879['Smtp']&&_0x444a2e[_0x4e25('0xd3')]&&_0x444a2e[_0x4e25('0xd4')]){var _0x367a40=_0x4a9879[_0x4e25('0xd5')]();return respondWithRpcPromise('SendMail',_0x4e25('0xd6'),{'account':_0x367a40,'message':{'from':util[_0x4e25('0xaa')]('\x22%s\x22\x20<%s>',_0x4a9879[_0x4e25('0x2a')],_0x4a9879['email']||_0x4a9879['Smtp'][_0x4e25('0x4e')]),'to':_0x444a2e[_0x4e25('0xd4')],'subject':_0x444a2e['offlineMessageSubject'],'html':_0x41c0b6[_0x4e25('0x56')],'attachments':_0x4086d9}},client9003)[_0x4e25('0x15')](function(){return _0x41c0b6;})[_0x4e25('0x1e')](function(_0x470849){logger['error'](_0x470849);});}})[_0x4e25('0x15')](function(){if(_0x444a2e&&_0x444a2e['openNewInteraction']&&_0x444a2e[_0x4e25('0xd7')]){var _0x6cf796=[];if(_0x14d6fd[_0x4e25('0x3b')]){_0x6cf796=_0x14d6fd[_0x4e25('0x44')](function(_0x3adea8){return{'name':_0x3adea8[_0x4e25('0xd8')],'basename':_0x3adea8[_0x4e25('0x66')],'type':_0x3adea8[_0x4e25('0xc9')],'ChatOfflineMessageId':_0x1c9328['id']};});}var _0x543c8a;if(!_['isNil'](_0x444a2e[_0x4e25('0xd9')])){var _0x2bb95a=_['map'](_0x3b572a[_0x4e25('0x56')],function(_0x17ec68){return _0x17ec68;});var _0x29971e=_['toPairsIn'](_0x2bb95a)[0x0];var _0x295163=_[_0x4e25('0xda')](_0x29971e,function(_0x4d412b){return _0x4d412b;});_0x543c8a=_0x295163[0x1][_0x444a2e[_0x4e25('0xd9')]];}var _0x1e9d00={'from':_0x5f4b77[_0x4e25('0xdb')],'firstName':_0x5f4b77[_0x4e25('0xa0')],'lastName':_0x5f4b77[_0x4e25('0xa1')],'mapKey':_0x4e25('0xdb'),'message':{'from':_0x5f4b77['email'],'to':_0x444a2e[_0x4e25('0xc3')][_0x4e25('0xdb')],'cc':'','subject':_[_0x4e25('0x72')](_0x543c8a)?_0x444a2e['offlineMessageSubject']:_0x543c8a,'messageId':'','sentAt':new Date(),'attach':_0x6cf796[_0x4e25('0x3b')],'attachments':_0x6cf796,'originChannel':'Chat','ChatWebsiteId':_0x444a2e['id'],'ChatOfflineMessageId':_0x41c0b6['id'],'originTo':_0x444a2e[_0x4e25('0xc3')][_0x4e25('0xdb')]},'body':_0x41c0b6[_0x4e25('0x56')]};var _0x199eed={'account':{'id':_0x444a2e[_0x4e25('0xd7')]},'body':_0x1e9d00,'log':_0x4e25('0xdc')};return respondWithRpcPromise('NotifyMailAccount',_0x4e25('0xdd'),_0x199eed,client9001)[_0x4e25('0x15')](function(){return _0x41c0b6;})['catch'](function(_0x25c319){logger[_0x4e25('0x1b')](_0x25c319);});}return;})['then'](function(){if(_0x41c0b6){return _0x41c0b6;}})['then'](respondWithResult(_0x21eb9f,null))[_0x4e25('0x1e')](function(_0x5ae927){logger[_0x4e25('0x1b')](_0x4e25('0x1e'),_0x5ae927);for(var _0xcd595b of _0x14d6fd){var _0x36c947=path[_0x4e25('0x6d')](config[_0x4e25('0x6e')],_0x4e25('0xde'),'files','attachments',_0x4e25('0xcb'),_0xcd595b[_0x4e25('0x66')]);fs_extra[_0x4e25('0xdf')](_0x36c947)[_0x4e25('0x1e')](function(_0x33b8ba){logger[_0x4e25('0x1b')](_0x4e25('0xe0'),_0x36c947,_0x33b8ba);});}});};exports[_0x4e25('0xe1')]=function(_0x442ab2,_0x4123f3){return db[_0x4e25('0xad')][_0x4e25('0x4c')]({'where':{'id':_0x442ab2[_0x4e25('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4123f3,null))[_0x4e25('0x15')](function(_0x5bc0f6){if(_0x5bc0f6){return _0x5bc0f6[_0x4e25('0xe1')](_0x442ab2[_0x4e25('0x56')][_0x4e25('0x5f')],_[_0x4e25('0xe2')](_0x442ab2['body'],['ids','id'])||{});}})[_0x4e25('0x15')](respondWithResult(_0x4123f3,null))[_0x4e25('0x1e')](handleError(_0x4123f3,null));};exports[_0x4e25('0xe3')]=function(_0x5c398d,_0x5a84c3){var _0x1ee538={'raw':![],'where':{}};var _0x2ad163={};var _0x1daa66={'count':0x0,'rows':[]};return db[_0x4e25('0x2f')][_0x4e25('0x5b')]({'where':{'id':_0x5c398d[_0x4e25('0x4b')]['id']}})[_0x4e25('0x15')](handleEntityNotFound(_0x5a84c3,null))[_0x4e25('0x15')](function(_0x484375){if(_0x484375){_0x2ad163[_0x4e25('0x34')]=_['keys'](db[_0x4e25('0xad')]['rawAttributes']);_0x2ad163[_0x4e25('0x38')]=_[_0x4e25('0x35')](_0x5c398d['query']);_0x2ad163[_0x4e25('0x36')]=_[_0x4e25('0x37')](_0x2ad163[_0x4e25('0x34')],_0x2ad163[_0x4e25('0x38')]);_0x1ee538[_0x4e25('0x3a')]=_[_0x4e25('0x37')](_0x2ad163[_0x4e25('0x34')],qs[_0x4e25('0x39')](_0x5c398d[_0x4e25('0x38')]['fields']));_0x1ee538[_0x4e25('0x3a')]=_0x1ee538[_0x4e25('0x3a')][_0x4e25('0x3b')]?_0x1ee538[_0x4e25('0x3a')]:_0x2ad163['model'];if(!_0x5c398d[_0x4e25('0x38')]['hasOwnProperty'](_0x4e25('0x3d'))){_0x1ee538['limit']=qs[_0x4e25('0x22')](_0x5c398d[_0x4e25('0x38')][_0x4e25('0x22')]);_0x1ee538['offset']=qs[_0x4e25('0x20')](_0x5c398d[_0x4e25('0x38')][_0x4e25('0x20')]);}_0x1ee538['order']=qs[_0x4e25('0x3f')](_0x5c398d[_0x4e25('0x38')]['sort']);_0x1ee538[_0x4e25('0x40')]=qs[_0x4e25('0x36')](_[_0x4e25('0x41')](_0x5c398d[_0x4e25('0x38')],_0x2ad163['filters']));_0x1ee538[_0x4e25('0x40')]['ChatWebsiteId']=_0x484375['id'];if(_0x5c398d[_0x4e25('0x38')][_0x4e25('0x42')]){_0x1ee538[_0x4e25('0x40')]=_['merge'](_0x1ee538[_0x4e25('0x40')],{'$or':_[_0x4e25('0x44')](_0x1ee538[_0x4e25('0x3a')],function(_0x58b9b2){var _0x1a17a9={};_0x1a17a9[_0x58b9b2]={'$like':'%'+_0x5c398d[_0x4e25('0x38')][_0x4e25('0x42')]+'%'};return _0x1a17a9;})});}_0x1ee538=_['merge']({},_0x1ee538,_0x5c398d[_0x4e25('0x46')]);return db[_0x4e25('0xad')][_0x4e25('0x23')]({'where':_0x1ee538[_0x4e25('0x40')]})[_0x4e25('0x15')](function(_0x42c91e){_0x1daa66[_0x4e25('0x23')]=_0x42c91e;if(_0x5c398d['query'][_0x4e25('0x5d')]){_0x1ee538[_0x4e25('0x47')]=[{'model':db[_0x4e25('0x83')],'as':_0x4e25('0xe4'),'required':![]},{'model':db[_0x4e25('0xe5')],'as':_0x4e25('0xe6'),'attributes':[_0x4e25('0x2a'),'fullname','internal'],'required':![]},{'model':db[_0x4e25('0xe7')],'as':_0x4e25('0xe8'),'attributes':['id',_0x4e25('0x2a'),'color'],'where':_0x5c398d[_0x4e25('0x38')][_0x4e25('0xe9')]?{'id':_0x5c398d['query']['tag']}:undefined,'required':_0x5c398d[_0x4e25('0x38')][_0x4e25('0xe9')]?!![]:![]}];}return db[_0x4e25('0xad')][_0x4e25('0x48')](_0x1ee538);})[_0x4e25('0x15')](function(_0x4a325b){_0x1daa66[_0x4e25('0x49')]=_0x4a325b;return _0x1daa66;});}})['then'](respondWithFilteredResult(_0x5a84c3,_0x1ee538))[_0x4e25('0x1e')](handleError(_0x5a84c3,null));};function iftimePromise(_0x39a1a3,_0x429cd9){return respondWithRpcPromise(_0x4e25('0xea'),_0x4e25('0xeb'),{'command':_0x429cd9[_0x4e25('0xec')]?util[_0x4e25('0xaa')](_0x4e25('0xed'),_0x39a1a3[_0x4e25('0xee')],_0x429cd9[_0x4e25('0xec')]):util[_0x4e25('0xaa')](_0x4e25('0xef'),_0x39a1a3[_0x4e25('0xee')])},client9002)[_0x4e25('0x15')](function(_0x53951c){var _0x542e14=_0x53951c&&_0x53951c[_0x4e25('0xf0')]('true')>=0x0?!![]:![];logger[_0x4e25('0x16')](_0x4e25('0xf1'),_0x429cd9['id'],_0x39a1a3['id'],_0x39a1a3[_0x4e25('0xee')],_0x542e14?_0x4e25('0xf2'):_0x4e25('0xf3'),_0x429cd9[_0x4e25('0xec')]?_0x429cd9['timezone']:_0x4e25('0xf4'));return _0x542e14;})[_0x4e25('0x1e')](function(_0x25dc66){logger[_0x4e25('0x1b')](_0x4e25('0xf1'),_0x429cd9['id'],_0x39a1a3['id'],_0x39a1a3[_0x4e25('0xee')],util['inspect'](_0x25dc66,{'showHidden':![],'depth':null}),_0x429cd9[_0x4e25('0xec')]?_0x429cd9['timezone']:'No\x20timezone');return![];});}exports[_0x4e25('0xeb')]=function(_0x3b6221,_0x5e9314){var _0x310aaf=0x0;var _0x1e15bd=0x0;var _0x30e495=![];var _0x5b3401;var _0x160b48;return db['ChatWebsite'][_0x4e25('0x4c')]({'where':{'id':_0x3b6221[_0x4e25('0x4b')]['id']},'include':[{'model':db['Interval'],'as':_0x4e25('0xf5'),'include':[{'model':db[_0x4e25('0xf5')],'as':_0x4e25('0xf6'),'attributes':['id',_0x4e25('0xee')],'raw':!![]}]}]})[_0x4e25('0x15')](handleEntityNotFound(_0x5e9314,null))[_0x4e25('0x15')](function(_0x3bd09d){if(_0x3bd09d){_0x5b3401=_0x3bd09d;return _0x3bd09d['getProactiveActions']({'raw':!![]});}})['then'](function(_0x2d7cd6){if(_0x5b3401){if(_0x2d7cd6){_0x160b48=_0x2d7cd6;}}return require('../../config/license/util')[_0x4e25('0x70')]();})['then'](function(_0x5fea6){if(_0x5fea6){_0x1e15bd=_0x5fea6['virtual'];_0x30e495=_0x5fea6[_0x4e25('0x71')];}})[_0x4e25('0x15')](function(){return db['ChatInteraction'][_0x4e25('0x23')]({'where':{'closed':![]}});})[_0x4e25('0x15')](function(_0x3a2b61){_0x310aaf=_0x3a2b61;if(_0x1e15bd&&_0x3a2b61>_0x1e15bd){return db[_0x4e25('0xf7')]['findOne']({'where':{'id':0x1}})['then'](function(_0xae5615){if(_0xae5615){_0xae5615[_0x4e25('0xf8')](_0x4e25('0xf9'));}});}})[_0x4e25('0x15')](function(){if(_0x5b3401['Interval']&&_0x5b3401['Interval'][_0x4e25('0xf6')]){var _0x27be6e=[];for(var _0x3db087=0x0;_0x3db087<_0x5b3401['Interval'][_0x4e25('0xf6')][_0x4e25('0x3b')];_0x3db087++){var _0x4068bf=_0x5b3401[_0x4e25('0xf5')][_0x4e25('0xf6')][_0x3db087][_0x4e25('0x4f')]({'plain':!![]});_0x27be6e[_0x4e25('0xfa')](iftimePromise(_0x4068bf,_0x5b3401));}return BPromise[_0x4e25('0xfb')](_0x27be6e)[_0x4e25('0x15')](function(_0x563f83){return _[_0x4e25('0xfc')](_0x563f83);});}else{return!![];}})[_0x4e25('0x15')](function(_0x3ba14d){var _0x111c01=fs[_0x4e25('0xc4')](path[_0x4e25('0x6d')](config[_0x4e25('0x6e')],_0x4e25('0xfd')),_0x4e25('0xc5'));var _0x3d46ea=new url[(_0x4e25('0xfe'))](_0x5b3401[_0x4e25('0xff')])['origin'];var _0x325b34=_0x4e25('0x100');var _0x4ab181=![];var _0x3fa6a5={'chatVersion':_0x325b34,'chatWebsiteAddressOrigin':_0x3d46ea,'remote':_0x5b3401['remote'],'query':querystring[_0x4e25('0x1a')](_[_0x4e25('0x43')](_0x5b3401[_0x4e25('0x4f')]({'plain':!![]}),{'customerIp':_0x3b6221[_0x4e25('0x81')]['x-forwarded-for']||_0x3b6221[_0x4e25('0x81')][_0x4e25('0x101')]||_0x3b6221['connection'][_0x4e25('0x102')]||_0x3b6221['ip'],'referer':_0x3b6221[_0x4e25('0x81')][_0x4e25('0xa3')],'openedInteractions':_0x310aaf,'maxInteractions':_0x1e15bd,'virtual':_0x30e495[_0x4e25('0x103')],'online':_0x3ba14d,'custom':_0x30e495}))[_0x4e25('0x104')](/'/g,'\x5c\x27')};_0x5e9314[_0x4e25('0x2b')](ejs[_0x4e25('0x105')](Mustache[_0x4e25('0x105')](_0x111c01,_0x3fa6a5),{'proactiveActions':_0x160b48,'alignment':_0x5b3401[_0x4e25('0x106')],'verticalAlignment':_0x5b3401[_0x4e25('0x107')],'div_color':_0x5b3401['color'],'labelText':_0x5b3401[_0x4e25('0x108')],'text_color':_0x5b3401[_0x4e25('0x109')],'text_button_color':_0x5b3401[_0x4e25('0x10a')],'button_color':_0x5b3401[_0x4e25('0x10b')],'background_color':_0x5b3401['backgroundColor'],'hideWhenOffline':_0x5b3401['hideWhenOffline'],'intervalId':_0x5b3401['IntervalId'],'isDevelopment':_0x4ab181,'chatVersion':_0x325b34}));})[_0x4e25('0x1e')](handleError(_0x5e9314,null));};exports[_0x4e25('0x10c')]=function(_0xc4c45c,_0x81139a){var _0x5cacbb=_0xc4c45c['params']['id'];var _0x5c44bb=_0xc4c45c[_0x4e25('0x56')];var _0x2adfe2=0xc8;var _0x430e20=null;return db['sequelize'][_0x4e25('0xce')]({'isolationLevel':db[_0x4e25('0xcd')][_0x4e25('0x10d')][_0x4e25('0x10e')][_0x4e25('0x10f')]},function(_0x312599){return db[_0x4e25('0x2f')][_0x4e25('0x5b')]({'where':{'id':_0x5cacbb},'transaction':_0x312599})[_0x4e25('0x15')](function(_0x9f3d97){if(_0x9f3d97){return db['ChatApplication']['destroy']({'where':{'ChatWebsiteId':_0x5cacbb},'transaction':_0x312599})[_0x4e25('0x15')](function(){var _0x35ca8d=_[_0x4e25('0x44')](_0x5c44bb,function(_0x17ee71){_0x17ee71[_0x4e25('0x5c')]=_0x5cacbb;return _0x17ee71;});return db[_0x4e25('0x94')][_0x4e25('0x110')](_0x35ca8d,{'transaction':_0x312599});});}else{_0x2adfe2=0x194;_0x430e20=[];}});})[_0x4e25('0x15')](function(){if(_0x2adfe2!==0x194){return db[_0x4e25('0x94')][_0x4e25('0x111')]({'where':{'ChatWebsiteId':_0x5cacbb},'order':_0x4e25('0x9a')})[_0x4e25('0x15')](function(_0x1c2713){_0x430e20=_0x1c2713;});}})[_0x4e25('0x1e')](function(_0x89fe79){_0x2adfe2=0x1f4;logger['error'](_0x89fe79[_0x4e25('0x112')]);if(_0x89fe79[_0x4e25('0x2a')]){delete _0x89fe79[_0x4e25('0x2a')];}_0x430e20=_0x89fe79;})[_0x4e25('0x113')](function(){if(_0x430e20===null){_0x81139a[_0x4e25('0x114')](_0x2adfe2);}else{if(_0x2adfe2===0x1f4){_0x81139a[_0x4e25('0x1f')](_0x2adfe2)['send'](_0x430e20);}else{_0x81139a[_0x4e25('0x1f')](_0x2adfe2)[_0x4e25('0x26')](_0x430e20);}}});};exports[_0x4e25('0x115')]=function(_0x26eb6a,_0x4e1d8b){var _0x40f792={};var _0x4c0338={};var _0x47e0dc;var _0x2c9adb;return db['ChatWebsite'][_0x4e25('0x5b')]({'where':{'id':_0x26eb6a['params']['id']}})[_0x4e25('0x15')](handleEntityNotFound(_0x4e1d8b,null))[_0x4e25('0x15')](function(_0x2fd5b0){if(_0x2fd5b0){_0x47e0dc=_0x2fd5b0;_0x4c0338['model']=_['keys'](db[_0x4e25('0x94')][_0x4e25('0x30')]);_0x4c0338[_0x4e25('0x38')]=_[_0x4e25('0x35')](_0x26eb6a['query']);_0x4c0338[_0x4e25('0x36')]=_[_0x4e25('0x37')](_0x4c0338['model'],_0x4c0338[_0x4e25('0x38')]);_0x40f792[_0x4e25('0x3a')]=_['intersection'](_0x4c0338[_0x4e25('0x34')],qs['fields'](_0x26eb6a[_0x4e25('0x38')][_0x4e25('0x39')]));_0x40f792[_0x4e25('0x3a')]=_0x40f792[_0x4e25('0x3a')][_0x4e25('0x3b')]?_0x40f792['attributes']:_0x4c0338[_0x4e25('0x34')];_0x40f792[_0x4e25('0x3e')]=qs['sort'](_0x26eb6a[_0x4e25('0x38')][_0x4e25('0x3f')]);_0x40f792[_0x4e25('0x40')]=qs[_0x4e25('0x36')](_[_0x4e25('0x41')](_0x26eb6a['query'],_0x4c0338[_0x4e25('0x36')]));if(_0x26eb6a[_0x4e25('0x38')]['filter']){_0x40f792[_0x4e25('0x40')]=_['merge'](_0x40f792['where'],{'$or':_[_0x4e25('0x44')](_0x40f792[_0x4e25('0x3a')],function(_0x2e32aa){var _0x10491f={};_0x10491f[_0x2e32aa]={'$like':'%'+_0x26eb6a[_0x4e25('0x38')][_0x4e25('0x42')]+'%'};return _0x10491f;})});}_0x40f792=_[_0x4e25('0x43')]({},_0x40f792,_0x26eb6a[_0x4e25('0x46')]);return _0x47e0dc[_0x4e25('0x115')](_0x40f792);}})[_0x4e25('0x15')](function(_0x59a051){if(_0x59a051){_0x2c9adb=_0x59a051['length'];if(!_0x26eb6a[_0x4e25('0x38')][_0x4e25('0x3c')](_0x4e25('0x3d'))){_0x40f792[_0x4e25('0x22')]=qs['limit'](_0x26eb6a[_0x4e25('0x38')][_0x4e25('0x22')]);_0x40f792['offset']=qs['offset'](_0x26eb6a['query'][_0x4e25('0x20')]);}return _0x47e0dc['getApplications'](_0x40f792);}})[_0x4e25('0x15')](function(_0x2ab769){if(_0x2ab769){return _0x2ab769?{'count':_0x2c9adb,'rows':_0x2ab769}:null;}})[_0x4e25('0x15')](respondWithResult(_0x4e1d8b,null))[_0x4e25('0x1e')](handleError(_0x4e1d8b,null));};exports[_0x4e25('0x116')]=function(_0xa516f6,_0xc170ef){return db[_0x4e25('0x117')]['find']({'where':{'id':_0xa516f6[_0x4e25('0x4b')]['id']}})[_0x4e25('0x15')](handleEntityNotFound(_0xc170ef,null))['then'](function(_0x4674a3){if(_0x4674a3){return _0x4674a3[_0x4e25('0x116')](_0xa516f6['body'][_0x4e25('0x5f')],_['omit'](_0xa516f6[_0x4e25('0x56')],[_0x4e25('0x5f'),'id'])||{});}})[_0x4e25('0x15')](respondWithResult(_0xc170ef,null))[_0x4e25('0x1e')](handleError(_0xc170ef,null));};exports[_0x4e25('0x118')]=function(_0x2d5109,_0x2259f7){var _0x48ff69={};var _0x5e1ba5={};var _0x272037;var _0x1c98f2;return db[_0x4e25('0x2f')][_0x4e25('0x5b')]({'where':{'id':_0x2d5109['params']['id']}})[_0x4e25('0x15')](handleEntityNotFound(_0x2259f7,null))[_0x4e25('0x15')](function(_0x46d05e){if(_0x46d05e){_0x272037=_0x46d05e;_0x5e1ba5[_0x4e25('0x34')]=_[_0x4e25('0x35')](db[_0x4e25('0x119')][_0x4e25('0x30')]);_0x5e1ba5[_0x4e25('0x38')]=_['keys'](_0x2d5109[_0x4e25('0x38')]);_0x5e1ba5['filters']=_[_0x4e25('0x37')](_0x5e1ba5[_0x4e25('0x34')],_0x5e1ba5[_0x4e25('0x38')]);_0x48ff69['attributes']=_[_0x4e25('0x37')](_0x5e1ba5['model'],qs[_0x4e25('0x39')](_0x2d5109[_0x4e25('0x38')][_0x4e25('0x39')]));_0x48ff69[_0x4e25('0x3a')]=_0x48ff69[_0x4e25('0x3a')]['length']?_0x48ff69[_0x4e25('0x3a')]:_0x5e1ba5['model'];_0x48ff69['order']=qs[_0x4e25('0x3f')](_0x2d5109[_0x4e25('0x38')][_0x4e25('0x3f')]);_0x48ff69[_0x4e25('0x40')]=qs[_0x4e25('0x36')](_['pick'](_0x2d5109[_0x4e25('0x38')],_0x5e1ba5[_0x4e25('0x36')]));if(_0x2d5109['query'][_0x4e25('0x42')]){_0x48ff69['where']=_[_0x4e25('0x43')](_0x48ff69['where'],{'$or':_[_0x4e25('0x44')](_0x48ff69[_0x4e25('0x3a')],function(_0x56f035){var _0x5596d8={};_0x5596d8[_0x56f035]={'$like':'%'+_0x2d5109[_0x4e25('0x38')][_0x4e25('0x42')]+'%'};return _0x5596d8;})});}_0x48ff69=_[_0x4e25('0x43')]({},_0x48ff69,_0x2d5109[_0x4e25('0x46')]);return _0x272037['getProactiveActions'](_0x48ff69);}})[_0x4e25('0x15')](function(_0x7aa131){if(_0x7aa131){_0x1c98f2=_0x7aa131[_0x4e25('0x3b')];if(!_0x2d5109['query'][_0x4e25('0x3c')]('nolimit')){_0x48ff69[_0x4e25('0x22')]=qs[_0x4e25('0x22')](_0x2d5109[_0x4e25('0x38')]['limit']);_0x48ff69['offset']=qs[_0x4e25('0x20')](_0x2d5109['query'][_0x4e25('0x20')]);}return _0x272037[_0x4e25('0x118')](_0x48ff69);}})[_0x4e25('0x15')](function(_0x29bd41){if(_0x29bd41){return _0x29bd41?{'count':_0x1c98f2,'rows':_0x29bd41}:null;}})[_0x4e25('0x15')](respondWithResult(_0x2259f7,null))[_0x4e25('0x1e')](handleError(_0x2259f7,null));};exports[_0x4e25('0x11a')]=function(_0x221dd5,_0x11a439){var _0x2a129d=_0x221dd5[_0x4e25('0x38')]['online']===_0x4e25('0x11b')?_0x4e25('0x11c'):'onlineForm';return db['ChatWebsite']['find']({'attributes':['id',_0x2a129d],'where':{'id':_0x221dd5['params']['id']}})[_0x4e25('0x15')](handleEntityNotFound(_0x11a439,null))[_0x4e25('0x15')](function(_0x542e9c){if(_0x542e9c){var _0x4a876c=_0x542e9c[_0x2a129d];var _0x41fa64=_0x4a876c&&_0x4a876c[_0x4e25('0x11d')]?_0x4a876c[_0x4e25('0x11d')]:[];_0x11a439[_0x4e25('0x2b')]({'fromKey':_['isNil'](_0x4a876c[_0x4e25('0x11e')])?undefined:_0x4a876c['fromKey'],'count':_0x41fa64[_0x4e25('0x3b')],'rows':_0x41fa64});}})[_0x4e25('0x1e')](handleError(_0x11a439,null));};exports[_0x4e25('0x11f')]=function(_0x597694,_0x12f7be){var _0x193e0b={'raw':![],'where':{}};var _0x288de5={};var _0x567f0d={'count':0x0,'rows':[]};return db[_0x4e25('0x2f')][_0x4e25('0x5b')]({'where':{'id':_0x597694['params']['id']}})[_0x4e25('0x15')](handleEntityNotFound(_0x12f7be,null))['then'](function(_0x339bb1){if(_0x339bb1){_0x288de5[_0x4e25('0x34')]=_['keys'](db[_0x4e25('0xc7')][_0x4e25('0x30')]);_0x288de5[_0x4e25('0x38')]=_['keys'](_0x597694[_0x4e25('0x38')]);_0x288de5[_0x4e25('0x36')]=_[_0x4e25('0x37')](_0x288de5[_0x4e25('0x34')],_0x288de5[_0x4e25('0x38')]);_0x193e0b[_0x4e25('0x3a')]=_[_0x4e25('0x37')](_0x288de5[_0x4e25('0x34')],qs['fields'](_0x597694[_0x4e25('0x38')]['fields']));_0x193e0b[_0x4e25('0x3a')]=_0x193e0b[_0x4e25('0x3a')][_0x4e25('0x3b')]?_0x193e0b[_0x4e25('0x3a')]:_0x288de5['model'];if(!_0x597694['query']['hasOwnProperty'](_0x4e25('0x3d'))){_0x193e0b[_0x4e25('0x22')]=qs[_0x4e25('0x22')](_0x597694[_0x4e25('0x38')][_0x4e25('0x22')]);_0x193e0b['offset']=qs[_0x4e25('0x20')](_0x597694[_0x4e25('0x38')][_0x4e25('0x20')]);}_0x193e0b[_0x4e25('0x3e')]=qs[_0x4e25('0x3f')](_0x597694[_0x4e25('0x38')][_0x4e25('0x3f')]);_0x193e0b[_0x4e25('0x40')]=qs[_0x4e25('0x36')](_[_0x4e25('0x41')](_0x597694[_0x4e25('0x38')],_0x288de5[_0x4e25('0x36')]));_0x193e0b[_0x4e25('0x40')][_0x4e25('0x5c')]=_0x339bb1['id'];if(_0x597694[_0x4e25('0x38')][_0x4e25('0x42')]){_0x193e0b[_0x4e25('0x40')]=_[_0x4e25('0x43')](_0x193e0b[_0x4e25('0x40')],{'$or':_[_0x4e25('0x44')](_0x193e0b['attributes'],function(_0x44b5ec){var _0x26f1b7={};_0x26f1b7[_0x44b5ec]={'$like':'%'+_0x597694[_0x4e25('0x38')][_0x4e25('0x42')]+'%'};return _0x26f1b7;})});}_0x193e0b=_[_0x4e25('0x43')]({},_0x193e0b,_0x597694[_0x4e25('0x46')]);return db['ChatOfflineMessage'][_0x4e25('0x23')]({'where':_0x193e0b[_0x4e25('0x40')]})[_0x4e25('0x15')](function(_0x103ad7){_0x567f0d[_0x4e25('0x23')]=_0x103ad7;if(_0x597694['query'][_0x4e25('0x5d')]){_0x193e0b['include']=[{'all':!![]}];}else{_0x193e0b[_0x4e25('0x47')]=[{'model':db['CmContact'],'as':_0x4e25('0xe4'),'required':![]},{'model':db['Attachment'],'as':_0x4e25('0x120'),'required':![]}];}return db[_0x4e25('0xc7')][_0x4e25('0x48')](_0x193e0b);})[_0x4e25('0x15')](function(_0x32f9ce){_0x567f0d['rows']=_0x32f9ce;return _0x567f0d;});}})[_0x4e25('0x15')](respondWithFilteredResult(_0x12f7be,_0x193e0b))[_0x4e25('0x1e')](handleError(_0x12f7be,null));};exports[_0x4e25('0x121')]=function(_0xd378b0,_0x3769fc){return db[_0x4e25('0x2f')]['find']({'where':{'id':_0xd378b0[_0x4e25('0x4b')]['id']}})[_0x4e25('0x15')](handleEntityNotFound(_0x3769fc,null))[_0x4e25('0x15')](function(_0x10ba19){if(_0x10ba19){return _0x10ba19[_0x4e25('0x121')](_0xd378b0[_0x4e25('0x56')][_0x4e25('0x5f')],_[_0x4e25('0xe2')](_0xd378b0[_0x4e25('0x56')],['ids','id'])||{})[_0x4e25('0xb0')](function(_0x19652d){for(var _0x5e1668=0x0;_0x5e1668<_0xd378b0[_0x4e25('0x56')][_0x4e25('0x5f')][_0x4e25('0x3b')];_0x5e1668+=0x1){socket[_0x4e25('0x122')](_0x4e25('0x123'),{'UserId':Number(_0xd378b0[_0x4e25('0x56')]['ids'][_0x5e1668]),'ChatWebsiteId':Number(_0xd378b0[_0x4e25('0x4b')]['id'])});}return _0x19652d;});}})['then'](respondWithResult(_0x3769fc,null))[_0x4e25('0x1e')](handleError(_0x3769fc,null));};exports[_0x4e25('0x124')]=function(_0x302dae,_0x221784){return db[_0x4e25('0x2f')][_0x4e25('0x4c')]({'where':{'id':_0x302dae['params']['id']}})[_0x4e25('0x15')](handleEntityNotFound(_0x221784,null))[_0x4e25('0x15')](function(_0x427ea2){if(_0x427ea2){return _0x427ea2[_0x4e25('0x124')](_0x302dae[_0x4e25('0x38')][_0x4e25('0x5f')])[_0x4e25('0x15')](function(){if(_[_0x4e25('0x125')](_0x302dae[_0x4e25('0x38')]['ids'])){for(var _0x53c297=0x0;_0x53c297<_0x302dae['query'][_0x4e25('0x5f')][_0x4e25('0x3b')];_0x53c297+=0x1){socket['emit']('userChatWebsite:remove',{'UserId':Number(_0x302dae[_0x4e25('0x38')][_0x4e25('0x5f')][_0x53c297]),'ChatWebsiteId':Number(_0x302dae[_0x4e25('0x4b')]['id'])});}}else{socket[_0x4e25('0x122')]('userChatWebsite:remove',{'UserId':Number(_0x302dae[_0x4e25('0x38')][_0x4e25('0x5f')]),'ChatWebsiteId':Number(_0x302dae[_0x4e25('0x4b')]['id'])});}});}})[_0x4e25('0x15')](respondWithStatusCode(_0x221784,null))['catch'](handleError(_0x221784,null));};exports[_0x4e25('0x126')]=function(_0x39adb0,_0x2442f3){var _0x22583a={};var _0x481e5d={};var _0x2a85be;var _0x3fb098;return db['ChatWebsite'][_0x4e25('0x5b')]({'where':{'id':_0x39adb0[_0x4e25('0x4b')]['id']}})[_0x4e25('0x15')](handleEntityNotFound(_0x2442f3,null))[_0x4e25('0x15')](function(_0x55e5b0){if(_0x55e5b0){_0x2a85be=_0x55e5b0;_0x481e5d[_0x4e25('0x34')]=_['keys'](db['User'][_0x4e25('0x30')]);_0x481e5d['query']=_[_0x4e25('0x35')](_0x39adb0[_0x4e25('0x38')]);_0x481e5d[_0x4e25('0x36')]=_[_0x4e25('0x37')](_0x481e5d['model'],_0x481e5d[_0x4e25('0x38')]);_0x22583a[_0x4e25('0x3a')]=_['intersection'](_0x481e5d[_0x4e25('0x34')],qs['fields'](_0x39adb0['query'][_0x4e25('0x39')]));_0x22583a[_0x4e25('0x3a')]=_0x22583a[_0x4e25('0x3a')][_0x4e25('0x3b')]?_0x22583a[_0x4e25('0x3a')]:_0x481e5d[_0x4e25('0x34')];_0x22583a[_0x4e25('0x3e')]=qs[_0x4e25('0x3f')](_0x39adb0[_0x4e25('0x38')]['sort']);_0x22583a[_0x4e25('0x40')]=qs[_0x4e25('0x36')](_[_0x4e25('0x41')](_0x39adb0[_0x4e25('0x38')],_0x481e5d[_0x4e25('0x36')]));if(_0x39adb0['query'][_0x4e25('0x42')]){_0x22583a[_0x4e25('0x40')]=_[_0x4e25('0x43')](_0x22583a[_0x4e25('0x40')],{'$or':_[_0x4e25('0x44')](_0x22583a['attributes'],function(_0x2a9985){var _0x1badf1={};_0x1badf1[_0x2a9985]={'$like':'%'+_0x39adb0[_0x4e25('0x38')][_0x4e25('0x42')]+'%'};return _0x1badf1;})});}_0x22583a=_[_0x4e25('0x43')]({},_0x22583a,_0x39adb0[_0x4e25('0x46')]);return _0x2a85be[_0x4e25('0x126')](_0x22583a);}})[_0x4e25('0x15')](function(_0x52a228){if(_0x52a228){_0x3fb098=_0x52a228[_0x4e25('0x3b')];if(!_0x39adb0[_0x4e25('0x38')]['hasOwnProperty'](_0x4e25('0x3d'))){_0x22583a[_0x4e25('0x22')]=qs[_0x4e25('0x22')](_0x39adb0[_0x4e25('0x38')]['limit']);_0x22583a[_0x4e25('0x20')]=qs[_0x4e25('0x20')](_0x39adb0[_0x4e25('0x38')][_0x4e25('0x20')]);}return _0x2a85be[_0x4e25('0x126')](_0x22583a);}})[_0x4e25('0x15')](function(_0x205474){if(_0x205474){return _0x205474?{'count':_0x3fb098,'rows':_0x205474}:null;}})['then'](respondWithResult(_0x2442f3,null))[_0x4e25('0x1e')](handleError(_0x2442f3,null));}; \ No newline at end of file +var _0x7eff=['ids','addAnswer','CannedAnswer','pick','removeAnswers','addLogo','sitepic','addAvatar','agentAvatar','file','filename','customerAvatar','addSystemAvatar','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','join','root','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','existsSync','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','notify','setUA','user-agent','getResult','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','CmContact','Contacts','DESC','ChatApplication','Applications','applications','orderBy','priority','asc','account','headers','first','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','version','%s\x20%s','unknown','format','vendor','%s\x20%s\x20%s','device','threadId','ChatInteraction','externalUrl','interaction','spread','contact','messageId','unmanaged','ChatMessage','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','files','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','mimetype','attachments','basename','openNewInteraction','sequelize','bulkCreate','CloudProvider','forwardOffline','forwardOfflineAddress','SendMail','\x22%s\x22\x20<%s>','Smtp','offlineMessageSubject','MailAccountId','originalname','subjectOffline','toPairsIn','mapValues','email','Chat','NotifyMailAccount','server','offline-chat','remove','addInteraction','omit','Contact','fullname','internal','Tags','tag','getSnippet','timezone','iftime\x20%s,%s','iftime\x20%s','interval','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','No\x20timezone','Interval','Intervals','getProactiveActions','virtual','License','increment','chatLicenseExceeded','push','all','some','server/files/chat/iframe.ejs','URL','address','origin','3.1.0','remote','x-real-ip','connection','remoteAddress','replace','alignment','verticalAlignment','labelText','textColor','textButtonColor','color_button','hideWhenOffline','IntervalId','addApplications','Transaction','READ_COMMITTED','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','offlineForm','items','fromKey','getOfflineMessages','Attachment','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','util','ejs','fs-extra','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','url','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','html-to-text','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','update','destroy','ChatWebsites','UserProfileResource','stack','send','index','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','nolimit','order','sort','where','filters','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','params','length','find','create','body','user','get','role','UserProfileSection','autoAssociation','name','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','hasOwnProperty','findAll','removeDispositions'];(function(_0x28e24a,_0x460849){var _0x1b4321=function(_0x289fac){while(--_0x289fac){_0x28e24a['push'](_0x28e24a['shift']());}};_0x1b4321(++_0x460849);}(_0x7eff,0xc7));var _0xf7ef=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7eff[_0x321bb2];return _0x9c12ed;};'use strict';var BPromise=require(_0xf7ef('0x0'));var Mustache=require(_0xf7ef('0x1'));var util=require(_0xf7ef('0x2'));var path=require('path');var ejs=require(_0xf7ef('0x3'));var fs=require('fs');var fs_extra=require(_0xf7ef('0x4'));var _=require(_0xf7ef('0x5'));var querystring=require('querystring');var Redis=require(_0xf7ef('0x6'));var qs=require(_0xf7ef('0x7'));var logger=require(_0xf7ef('0x8'))(_0xf7ef('0x9'));var config=require(_0xf7ef('0xa'));var url=require(_0xf7ef('0xb'));var db=require(_0xf7ef('0xc'))['db'];config[_0xf7ef('0xd')]=_[_0xf7ef('0xe')](config['redis'],{'host':_0xf7ef('0xf'),'port':0x18eb});var socket=require(_0xf7ef('0x10'))(new Redis(config[_0xf7ef('0xd')]));require(_0xf7ef('0x11'))[_0xf7ef('0x12')](socket);var htmlToText=require(_0xf7ef('0x13'));var jayson=require('jayson/promise');var client=jayson[_0xf7ef('0x14')][_0xf7ef('0x15')]({'port':0x232c});var client9002=jayson[_0xf7ef('0x14')][_0xf7ef('0x15')]({'port':0x232a});var client9003=jayson[_0xf7ef('0x14')][_0xf7ef('0x15')]({'port':0x232b});var client9001=jayson['client']['http']({'port':0x2329});function respondWithRpcPromise(_0x4a7f2f,_0x2a34a4,_0x2f1410,_0x397a52){return new BPromise(function(_0x3b2e8c,_0x47ad44){var _0x2121b1=_0x397a52||client;return _0x2121b1[_0xf7ef('0x16')](_0x4a7f2f,_0x2f1410)[_0xf7ef('0x17')](function(_0x1de6b1){logger[_0xf7ef('0x18')](_0xf7ef('0x19'),_0x2a34a4,'request\x20sent');logger['debug'](_0xf7ef('0x1a'),_0x2a34a4,_0xf7ef('0x1b'),JSON[_0xf7ef('0x1c')](_0x1de6b1));if(_0x1de6b1['error']){if(_0x1de6b1[_0xf7ef('0x1d')][_0xf7ef('0x1e')]===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x2a34a4,_0x1de6b1[_0xf7ef('0x1d')][_0xf7ef('0x1f')]);return _0x47ad44(_0x1de6b1[_0xf7ef('0x1d')][_0xf7ef('0x1f')]);}logger[_0xf7ef('0x1d')](_0xf7ef('0x19'),_0x2a34a4,_0x1de6b1['error']['message']);return _0x3b2e8c(_0x1de6b1[_0xf7ef('0x1d')][_0xf7ef('0x1f')]);}else{logger[_0xf7ef('0x18')](_0xf7ef('0x19'),_0x2a34a4,'request\x20sent');_0x3b2e8c(_0x1de6b1[_0xf7ef('0x20')][_0xf7ef('0x1f')]);}})['catch'](function(_0x108b0d){logger[_0xf7ef('0x1d')](_0xf7ef('0x19'),_0x2a34a4,_0x108b0d);_0x47ad44(_0x108b0d);});});}function respondWithStatusCode(_0x21df2d,_0x216140){_0x216140=_0x216140||0xcc;return function(_0x232814){if(_0x232814){return _0x21df2d[_0xf7ef('0x21')](_0x216140);}return _0x21df2d[_0xf7ef('0x22')](_0x216140)[_0xf7ef('0x23')]();};}function respondWithResult(_0x12ecaf,_0x561eea){_0x561eea=_0x561eea||0xc8;return function(_0x4784ea){if(_0x4784ea){return _0x12ecaf[_0xf7ef('0x22')](_0x561eea)[_0xf7ef('0x24')](_0x4784ea);}};}function respondWithFilteredResult(_0x30ae0e,_0xbcf427){return function(_0x2c1544){if(_0x2c1544){var _0x3753e6=typeof _0xbcf427[_0xf7ef('0x25')]===_0xf7ef('0x26')&&typeof _0xbcf427[_0xf7ef('0x27')]===_0xf7ef('0x26');var _0xea969c=_0x2c1544[_0xf7ef('0x28')];var _0x44a25c=_0x3753e6?0x0:_0xbcf427['offset'];var _0x5914af=_0x3753e6?_0x2c1544[_0xf7ef('0x28')]:_0xbcf427[_0xf7ef('0x25')]+_0xbcf427['limit'];var _0x3960a0;if(_0x5914af>=_0xea969c){_0x5914af=_0xea969c;_0x3960a0=0xc8;}else{_0x3960a0=0xce;}_0x30ae0e['status'](_0x3960a0);return _0x30ae0e[_0xf7ef('0x29')]('Content-Range',_0x44a25c+'-'+_0x5914af+'/'+_0xea969c)[_0xf7ef('0x24')](_0x2c1544);}return null;};}function saveUpdates(_0x2bc6e0){return function(_0x467a4c){if(_0x467a4c){return _0x467a4c[_0xf7ef('0x2a')](_0x2bc6e0)[_0xf7ef('0x17')](function(_0x5934ad){return _0x5934ad;});}return null;};}function removeEntity(_0x85bf1e){return function(_0x20f0a8){if(_0x20f0a8){return _0x20f0a8[_0xf7ef('0x2b')]()[_0xf7ef('0x17')](function(){var _0x456d8d=_0x20f0a8['get']({'plain':!![]});var _0x32956e=_0xf7ef('0x2c');return db[_0xf7ef('0x2d')][_0xf7ef('0x2b')]({'where':{'type':_0x32956e,'resourceId':_0x456d8d['id']}})[_0xf7ef('0x17')](function(){return _0x20f0a8;});})[_0xf7ef('0x17')](function(){_0x85bf1e[_0xf7ef('0x22')](0xcc)[_0xf7ef('0x23')]();});}};}function handleEntityNotFound(_0x561f37){return function(_0x2d3405){if(!_0x2d3405){_0x561f37[_0xf7ef('0x21')](0x194);}return _0x2d3405;};}function handleError(_0x56817a,_0x41c0ea){_0x41c0ea=_0x41c0ea||0x1f4;return function(_0x49ad82){logger[_0xf7ef('0x1d')](_0x49ad82[_0xf7ef('0x2e')]);if(_0x49ad82['name']){delete _0x49ad82['name'];}_0x56817a[_0xf7ef('0x22')](_0x41c0ea)[_0xf7ef('0x2f')](_0x49ad82);};}exports[_0xf7ef('0x30')]=function(_0x3fcaef,_0x4a2b61){var _0x306644={'include':[{'model':db['Pause'],'as':_0xf7ef('0x31')}]},_0x1ccbbb={},_0x1b1d5c={'count':0x0,'rows':[]};var _0x1dcdd7=_[_0xf7ef('0x32')](db[_0xf7ef('0x33')][_0xf7ef('0x34')],function(_0x205e80){return{'name':_0x205e80[_0xf7ef('0x35')],'type':_0x205e80[_0xf7ef('0x36')][_0xf7ef('0x37')]};});_0x1ccbbb['model']=_[_0xf7ef('0x32')](_0x1dcdd7,'name');_0x1ccbbb[_0xf7ef('0x38')]=_[_0xf7ef('0x39')](_0x3fcaef[_0xf7ef('0x38')]);_0x1ccbbb['filters']=_[_0xf7ef('0x3a')](_0x1ccbbb[_0xf7ef('0x3b')],_0x1ccbbb[_0xf7ef('0x38')]);_0x306644[_0xf7ef('0x3c')]=_[_0xf7ef('0x3a')](_0x1ccbbb[_0xf7ef('0x3b')],qs[_0xf7ef('0x3d')](_0x3fcaef['query'][_0xf7ef('0x3d')]));_0x306644['attributes']=_0x306644['attributes']['length']?_0x306644[_0xf7ef('0x3c')]:_0x1ccbbb[_0xf7ef('0x3b')];if(!_0x3fcaef[_0xf7ef('0x38')]['hasOwnProperty'](_0xf7ef('0x3e'))){_0x306644[_0xf7ef('0x27')]=qs['limit'](_0x3fcaef[_0xf7ef('0x38')][_0xf7ef('0x27')]);_0x306644['offset']=qs[_0xf7ef('0x25')](_0x3fcaef[_0xf7ef('0x38')]['offset']);}_0x306644[_0xf7ef('0x3f')]=qs[_0xf7ef('0x40')](_0x3fcaef[_0xf7ef('0x38')][_0xf7ef('0x40')]);_0x306644[_0xf7ef('0x41')]=qs['filters'](_['pick'](_0x3fcaef[_0xf7ef('0x38')],_0x1ccbbb[_0xf7ef('0x42')]),_0x1dcdd7);if(_0x3fcaef[_0xf7ef('0x38')][_0xf7ef('0x43')]){_0x306644[_0xf7ef('0x41')]=_['merge'](_0x306644[_0xf7ef('0x41')],{'$or':_['map'](_0x1dcdd7,function(_0x1f4878){if(_0x1f4878[_0xf7ef('0x36')]!==_0xf7ef('0x44')){var _0x1a6c81={};_0x1a6c81[_0x1f4878['name']]={'$like':'%'+_0x3fcaef[_0xf7ef('0x38')][_0xf7ef('0x43')]+'%'};return _0x1a6c81;}})});}_0x306644=_[_0xf7ef('0x45')]({},_0x306644,_0x3fcaef[_0xf7ef('0x46')]);var _0x440bf1={'where':_0x306644[_0xf7ef('0x41')]};return db[_0xf7ef('0x33')][_0xf7ef('0x28')](_0x440bf1)[_0xf7ef('0x17')](function(_0x124d79){_0x1b1d5c[_0xf7ef('0x28')]=_0x124d79;if(_0x3fcaef[_0xf7ef('0x38')][_0xf7ef('0x47')]){_0x306644[_0xf7ef('0x48')]=[{'all':!![]}];}return db['ChatWebsite']['findAll'](_0x306644);})[_0xf7ef('0x17')](function(_0xa54e22){_0x1b1d5c[_0xf7ef('0x49')]=_0xa54e22;return _0x1b1d5c;})[_0xf7ef('0x17')](respondWithFilteredResult(_0x4a2b61,_0x306644))[_0xf7ef('0x4a')](handleError(_0x4a2b61,null));};exports['show']=function(_0x19c1b7,_0x5cc0d1){var _0x309228={'raw':![],'where':{'id':_0x19c1b7[_0xf7ef('0x4b')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x40b83e={};_0x40b83e['model']=_['keys'](db[_0xf7ef('0x33')][_0xf7ef('0x34')]);_0x40b83e[_0xf7ef('0x38')]=_['keys'](_0x19c1b7[_0xf7ef('0x38')]);_0x40b83e['filters']=_[_0xf7ef('0x3a')](_0x40b83e['model'],_0x40b83e['query']);_0x309228['attributes']=_[_0xf7ef('0x3a')](_0x40b83e[_0xf7ef('0x3b')],qs[_0xf7ef('0x3d')](_0x19c1b7[_0xf7ef('0x38')]['fields']));_0x309228['attributes']=_0x309228[_0xf7ef('0x3c')][_0xf7ef('0x4c')]?_0x309228[_0xf7ef('0x3c')]:_0x40b83e['model'];if(_0x19c1b7[_0xf7ef('0x38')][_0xf7ef('0x47')]){_0x309228[_0xf7ef('0x48')]=[{'all':!![]}];}_0x309228=_[_0xf7ef('0x45')]({},_0x309228,_0x19c1b7[_0xf7ef('0x46')]);return db[_0xf7ef('0x33')][_0xf7ef('0x4d')](_0x309228)[_0xf7ef('0x17')](handleEntityNotFound(_0x5cc0d1,null))[_0xf7ef('0x17')](respondWithResult(_0x5cc0d1,null))['catch'](handleError(_0x5cc0d1,null));};exports['create']=function(_0x36155e,_0x457b4c){return db[_0xf7ef('0x33')][_0xf7ef('0x4e')](_0x36155e[_0xf7ef('0x4f')],{})[_0xf7ef('0x17')](function(_0x45e4f3){var _0x368698=_0x36155e[_0xf7ef('0x50')][_0xf7ef('0x51')]({'plain':!![]});if(!_0x368698)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x368698[_0xf7ef('0x52')]===_0xf7ef('0x50')){var _0x41043f=_0x45e4f3['get']({'plain':!![]});var _0x35405e=_0xf7ef('0x2c');return db[_0xf7ef('0x53')]['find']({'where':{'name':_0x35405e,'userProfileId':_0x368698['userProfileId']},'raw':!![]})[_0xf7ef('0x17')](function(_0x2218b5){if(_0x2218b5&&_0x2218b5[_0xf7ef('0x54')]===0x0){return db['UserProfileResource'][_0xf7ef('0x4e')]({'name':_0x41043f['name'],'resourceId':_0x41043f['id'],'type':_0x2218b5[_0xf7ef('0x55')],'sectionId':_0x2218b5['id']},{})['then'](function(){return _0x45e4f3;});}else{return _0x45e4f3;}})[_0xf7ef('0x4a')](function(_0x2a86ea){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2a86ea);throw _0x2a86ea;});}return _0x45e4f3;})[_0xf7ef('0x17')](respondWithResult(_0x457b4c,0xc9))[_0xf7ef('0x4a')](handleError(_0x457b4c,null));};exports[_0xf7ef('0x2a')]=function(_0x272741,_0x4d5c7c){if(_0x272741[_0xf7ef('0x4f')]['id']){delete _0x272741[_0xf7ef('0x4f')]['id'];}return db['ChatWebsite'][_0xf7ef('0x4d')]({'where':{'id':_0x272741['params']['id']},'include':[{'model':db['Pause'],'as':_0xf7ef('0x31')}]})[_0xf7ef('0x17')](handleEntityNotFound(_0x4d5c7c,null))[_0xf7ef('0x17')](saveUpdates(_0x272741['body'],null))['then'](respondWithResult(_0x4d5c7c,null))[_0xf7ef('0x4a')](handleError(_0x4d5c7c,null));};exports[_0xf7ef('0x2b')]=function(_0x3d69ce,_0x498ac1){return db['ChatWebsite']['find']({'where':{'id':_0x3d69ce[_0xf7ef('0x4b')]['id']}})[_0xf7ef('0x17')](handleEntityNotFound(_0x498ac1,null))[_0xf7ef('0x17')](removeEntity(_0x498ac1,null))[_0xf7ef('0x4a')](handleError(_0x498ac1,null));};exports[_0xf7ef('0x56')]=function(_0x46d259,_0x248a23){return db[_0xf7ef('0x33')][_0xf7ef('0x56')]()['then'](respondWithResult(_0x248a23,null))[_0xf7ef('0x4a')](handleError(_0x248a23,null));};exports[_0xf7ef('0x57')]=function(_0x292203,_0x541254){if(_0x292203[_0xf7ef('0x4f')]['id']){delete _0x292203[_0xf7ef('0x4f')]['id'];}return db[_0xf7ef('0x33')]['find']({'where':{'id':_0x292203[_0xf7ef('0x4b')]['id']}})[_0xf7ef('0x17')](handleEntityNotFound(_0x541254,null))[_0xf7ef('0x17')](function(_0x4e273c){if(_0x4e273c){_0x292203[_0xf7ef('0x4f')][_0xf7ef('0x58')]=_0x4e273c['id'];return db[_0xf7ef('0x59')][_0xf7ef('0x4e')](_0x292203[_0xf7ef('0x4f')]);}})[_0xf7ef('0x17')](respondWithResult(_0x541254,null))[_0xf7ef('0x4a')](handleError(_0x541254,null));};exports[_0xf7ef('0x5a')]=function(_0x3c3bb8,_0x482664){var _0x54c6a5={'raw':![],'where':{}};var _0x2922d1={};var _0xaff146={'count':0x0,'rows':[]};return db[_0xf7ef('0x33')][_0xf7ef('0x5b')]({'where':{'id':_0x3c3bb8[_0xf7ef('0x4b')]['id']}})[_0xf7ef('0x17')](handleEntityNotFound(_0x482664,null))['then'](function(_0x3aac15){if(_0x3aac15){_0x2922d1['model']=_[_0xf7ef('0x39')](db['Disposition'][_0xf7ef('0x34')]);_0x2922d1['query']=_[_0xf7ef('0x39')](_0x3c3bb8['query']);_0x2922d1['filters']=_['intersection'](_0x2922d1[_0xf7ef('0x3b')],_0x2922d1['query']);_0x54c6a5['attributes']=_[_0xf7ef('0x3a')](_0x2922d1[_0xf7ef('0x3b')],qs[_0xf7ef('0x3d')](_0x3c3bb8[_0xf7ef('0x38')][_0xf7ef('0x3d')]));_0x54c6a5[_0xf7ef('0x3c')]=_0x54c6a5[_0xf7ef('0x3c')][_0xf7ef('0x4c')]?_0x54c6a5[_0xf7ef('0x3c')]:_0x2922d1[_0xf7ef('0x3b')];if(!_0x3c3bb8[_0xf7ef('0x38')][_0xf7ef('0x5c')](_0xf7ef('0x3e'))){_0x54c6a5[_0xf7ef('0x27')]=qs[_0xf7ef('0x27')](_0x3c3bb8[_0xf7ef('0x38')][_0xf7ef('0x27')]);_0x54c6a5[_0xf7ef('0x25')]=qs[_0xf7ef('0x25')](_0x3c3bb8[_0xf7ef('0x38')][_0xf7ef('0x25')]);}_0x54c6a5[_0xf7ef('0x3f')]=qs[_0xf7ef('0x40')](_0x3c3bb8[_0xf7ef('0x38')][_0xf7ef('0x40')]);_0x54c6a5['where']=qs[_0xf7ef('0x42')](_['pick'](_0x3c3bb8[_0xf7ef('0x38')],_0x2922d1[_0xf7ef('0x42')]));_0x54c6a5[_0xf7ef('0x41')][_0xf7ef('0x58')]=_0x3aac15['id'];if(_0x3c3bb8[_0xf7ef('0x38')][_0xf7ef('0x43')]){_0x54c6a5[_0xf7ef('0x41')]=_['merge'](_0x54c6a5[_0xf7ef('0x41')],{'$or':_[_0xf7ef('0x32')](_0x54c6a5['attributes'],function(_0x3acbef){var _0x1447d8={};_0x1447d8[_0x3acbef]={'$like':'%'+_0x3c3bb8[_0xf7ef('0x38')][_0xf7ef('0x43')]+'%'};return _0x1447d8;})});}_0x54c6a5=_[_0xf7ef('0x45')]({},_0x54c6a5,_0x3c3bb8[_0xf7ef('0x46')]);return db[_0xf7ef('0x59')][_0xf7ef('0x28')]({'where':_0x54c6a5[_0xf7ef('0x41')]})[_0xf7ef('0x17')](function(_0x11f400){_0xaff146[_0xf7ef('0x28')]=_0x11f400;if(_0x3c3bb8['query'][_0xf7ef('0x47')]){_0x54c6a5[_0xf7ef('0x48')]=[{'all':!![]}];}return db[_0xf7ef('0x59')][_0xf7ef('0x5d')](_0x54c6a5);})[_0xf7ef('0x17')](function(_0x4214f9){_0xaff146['rows']=_0x4214f9;return _0xaff146;});}})[_0xf7ef('0x17')](respondWithFilteredResult(_0x482664,_0x54c6a5))[_0xf7ef('0x4a')](handleError(_0x482664,null));};exports[_0xf7ef('0x5e')]=function(_0x4522dc,_0x6b28e8){return db[_0xf7ef('0x33')][_0xf7ef('0x4d')]({'where':{'id':_0x4522dc[_0xf7ef('0x4b')]['id']}})['then'](handleEntityNotFound(_0x6b28e8,null))[_0xf7ef('0x17')](function(_0x9f6c8e){if(_0x9f6c8e){return _0x9f6c8e[_0xf7ef('0x5e')](_0x4522dc[_0xf7ef('0x38')][_0xf7ef('0x5f')]);}})[_0xf7ef('0x17')](respondWithStatusCode(_0x6b28e8,null))[_0xf7ef('0x4a')](handleError(_0x6b28e8,null));};exports[_0xf7ef('0x60')]=function(_0x175ccc,_0x42691c){if(_0x175ccc['body']['id']){delete _0x175ccc[_0xf7ef('0x4f')]['id'];}return db[_0xf7ef('0x33')][_0xf7ef('0x4d')]({'where':{'id':_0x175ccc['params']['id']}})[_0xf7ef('0x17')](handleEntityNotFound(_0x42691c,null))[_0xf7ef('0x17')](function(_0x33012a){if(_0x33012a){_0x175ccc['body'][_0xf7ef('0x58')]=_0x33012a['id'];return db[_0xf7ef('0x61')][_0xf7ef('0x4e')](_0x175ccc['body']);}})[_0xf7ef('0x17')](respondWithResult(_0x42691c,null))[_0xf7ef('0x4a')](handleError(_0x42691c,null));};exports['getAnswers']=function(_0x7b4080,_0x4dbe4c){var _0x2cd4c6={'raw':![],'where':{}};var _0x798917={};var _0x6b9a60={'count':0x0,'rows':[]};return db[_0xf7ef('0x33')]['findOne']({'where':{'id':_0x7b4080[_0xf7ef('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4dbe4c,null))[_0xf7ef('0x17')](function(_0x45f473){if(_0x45f473){_0x798917[_0xf7ef('0x3b')]=_[_0xf7ef('0x39')](db['CannedAnswer'][_0xf7ef('0x34')]);_0x798917[_0xf7ef('0x38')]=_['keys'](_0x7b4080[_0xf7ef('0x38')]);_0x798917['filters']=_[_0xf7ef('0x3a')](_0x798917[_0xf7ef('0x3b')],_0x798917[_0xf7ef('0x38')]);_0x2cd4c6[_0xf7ef('0x3c')]=_['intersection'](_0x798917[_0xf7ef('0x3b')],qs[_0xf7ef('0x3d')](_0x7b4080[_0xf7ef('0x38')][_0xf7ef('0x3d')]));_0x2cd4c6[_0xf7ef('0x3c')]=_0x2cd4c6[_0xf7ef('0x3c')][_0xf7ef('0x4c')]?_0x2cd4c6[_0xf7ef('0x3c')]:_0x798917[_0xf7ef('0x3b')];if(!_0x7b4080['query'][_0xf7ef('0x5c')]('nolimit')){_0x2cd4c6['limit']=qs[_0xf7ef('0x27')](_0x7b4080[_0xf7ef('0x38')][_0xf7ef('0x27')]);_0x2cd4c6[_0xf7ef('0x25')]=qs[_0xf7ef('0x25')](_0x7b4080['query'][_0xf7ef('0x25')]);}_0x2cd4c6['order']=qs['sort'](_0x7b4080[_0xf7ef('0x38')]['sort']);_0x2cd4c6[_0xf7ef('0x41')]=qs[_0xf7ef('0x42')](_[_0xf7ef('0x62')](_0x7b4080[_0xf7ef('0x38')],_0x798917[_0xf7ef('0x42')]));_0x2cd4c6['where'][_0xf7ef('0x58')]=_0x45f473['id'];if(_0x7b4080[_0xf7ef('0x38')][_0xf7ef('0x43')]){_0x2cd4c6[_0xf7ef('0x41')]=_[_0xf7ef('0x45')](_0x2cd4c6['where'],{'$or':_[_0xf7ef('0x32')](_0x2cd4c6[_0xf7ef('0x3c')],function(_0x5a7190){var _0x52a617={};_0x52a617[_0x5a7190]={'$like':'%'+_0x7b4080['query'][_0xf7ef('0x43')]+'%'};return _0x52a617;})});}_0x2cd4c6=_['merge']({},_0x2cd4c6,_0x7b4080[_0xf7ef('0x46')]);return db[_0xf7ef('0x61')]['count']({'where':_0x2cd4c6[_0xf7ef('0x41')]})[_0xf7ef('0x17')](function(_0x30d720){_0x6b9a60[_0xf7ef('0x28')]=_0x30d720;if(_0x7b4080['query'][_0xf7ef('0x47')]){_0x2cd4c6[_0xf7ef('0x48')]=[{'all':!![]}];}return db[_0xf7ef('0x61')]['findAll'](_0x2cd4c6);})[_0xf7ef('0x17')](function(_0x3ad311){_0x6b9a60[_0xf7ef('0x49')]=_0x3ad311;return _0x6b9a60;});}})['then'](respondWithFilteredResult(_0x4dbe4c,_0x2cd4c6))[_0xf7ef('0x4a')](handleError(_0x4dbe4c,null));};exports['removeAnswers']=function(_0x29e635,_0x47afaa){return db[_0xf7ef('0x33')][_0xf7ef('0x4d')]({'where':{'id':_0x29e635[_0xf7ef('0x4b')]['id']}})[_0xf7ef('0x17')](handleEntityNotFound(_0x47afaa,null))[_0xf7ef('0x17')](function(_0xffc9d3){if(_0xffc9d3){return _0xffc9d3[_0xf7ef('0x63')](_0x29e635[_0xf7ef('0x38')][_0xf7ef('0x5f')]);}})[_0xf7ef('0x17')](respondWithStatusCode(_0x47afaa,null))['catch'](handleError(_0x47afaa,null));};exports[_0xf7ef('0x64')]=function(_0x73fcfd,_0x1419aa){_0x73fcfd[_0xf7ef('0x4f')][_0xf7ef('0x65')]=_0x73fcfd['file']['filename'];return db[_0xf7ef('0x33')][_0xf7ef('0x4d')]({'where':{'id':_0x73fcfd['params']['id']}})[_0xf7ef('0x17')](handleEntityNotFound(_0x1419aa,null))[_0xf7ef('0x17')](saveUpdates(_0x73fcfd[_0xf7ef('0x4f')],null))[_0xf7ef('0x17')](respondWithResult(_0x1419aa,null))[_0xf7ef('0x4a')](handleError(_0x1419aa,null));};exports[_0xf7ef('0x66')]=function(_0x42b190,_0x404dbe){_0x42b190[_0xf7ef('0x4f')][_0xf7ef('0x67')]=_0x42b190[_0xf7ef('0x68')][_0xf7ef('0x69')];return db['ChatWebsite']['find']({'where':{'id':_0x42b190['params']['id']}})[_0xf7ef('0x17')](handleEntityNotFound(_0x404dbe,null))[_0xf7ef('0x17')](saveUpdates(_0x42b190['body'],null))['then'](respondWithResult(_0x404dbe,null))['catch'](handleError(_0x404dbe,null));};exports['addCustomerAvatar']=function(_0x3d827c,_0x1111a1){_0x3d827c[_0xf7ef('0x4f')][_0xf7ef('0x6a')]=_0x3d827c[_0xf7ef('0x68')][_0xf7ef('0x69')];return db['ChatWebsite']['find']({'where':{'id':_0x3d827c[_0xf7ef('0x4b')]['id']}})[_0xf7ef('0x17')](handleEntityNotFound(_0x1111a1,null))[_0xf7ef('0x17')](saveUpdates(_0x3d827c['body'],null))[_0xf7ef('0x17')](respondWithResult(_0x1111a1,null))[_0xf7ef('0x4a')](handleError(_0x1111a1,null));};exports[_0xf7ef('0x6b')]=function(_0x43b167,_0x4a07f7){_0x43b167[_0xf7ef('0x4f')]['systemAvatar']=_0x43b167[_0xf7ef('0x68')][_0xf7ef('0x69')];return db['ChatWebsite'][_0xf7ef('0x4d')]({'where':{'id':_0x43b167[_0xf7ef('0x4b')]['id']}})[_0xf7ef('0x17')](handleEntityNotFound(_0x4a07f7,null))[_0xf7ef('0x17')](saveUpdates(_0x43b167[_0xf7ef('0x4f')],null))[_0xf7ef('0x17')](respondWithResult(_0x4a07f7,null))[_0xf7ef('0x4a')](handleError(_0x4a07f7,null));};exports['getLogo']=function(_0x403d6a,_0x597386){var _0x8083e1=path['join'](config['root'],_0xf7ef('0x6c'));var _0x182433={'where':{'id':_0x403d6a['params']['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x266c8c=![];return require(_0xf7ef('0x6d'))[_0xf7ef('0x6e')]()[_0xf7ef('0x17')](function(_0x551e0b){if(_0x551e0b){_0x266c8c=_0x551e0b[_0xf7ef('0x6f')];}})[_0xf7ef('0x17')](function(){return db[_0xf7ef('0x33')]['find'](_0x182433);})['then'](handleEntityNotFound(_0x597386,null))[_0xf7ef('0x17')](function(_0x278316){if(_0x278316){if(!_[_0xf7ef('0x70')](_0x278316['sitepic'])){if(fs['existsSync'](path[_0xf7ef('0x71')](config[_0xf7ef('0x72')],_0xf7ef('0x73'),_0x278316[_0xf7ef('0x65')]))&&_0x266c8c){_0x8083e1=path[_0xf7ef('0x71')](config[_0xf7ef('0x72')],_0xf7ef('0x73'),_0x278316[_0xf7ef('0x65')]);}}return _0x597386[_0xf7ef('0x74')](_0x8083e1);}})[_0xf7ef('0x4a')](handleError(_0x597386,null));};exports[_0xf7ef('0x75')]=function(_0x3f3742,_0x10b8d0){var _0x3798a6=path[_0xf7ef('0x71')](config[_0xf7ef('0x72')],_0xf7ef('0x76'));var _0x4ff6df={'where':{'id':_0x3f3742[_0xf7ef('0x4b')]['id']},'attributes':['id',_0xf7ef('0x67')],'raw':!![]};return db[_0xf7ef('0x33')]['find'](_0x4ff6df)[_0xf7ef('0x17')](handleEntityNotFound(_0x10b8d0,null))['then'](function(_0x16d7af){if(_0x16d7af){if(!_[_0xf7ef('0x70')](_0x16d7af['agentAvatar'])){if(fs[_0xf7ef('0x77')](path[_0xf7ef('0x71')](config[_0xf7ef('0x72')],_0xf7ef('0x78'),_0x16d7af[_0xf7ef('0x67')]))){_0x3798a6=path['join'](config['root'],_0xf7ef('0x78'),_0x16d7af['agentAvatar']);}}return _0x10b8d0[_0xf7ef('0x74')](_0x3798a6);}})[_0xf7ef('0x4a')](handleError(_0x10b8d0,null));};exports[_0xf7ef('0x79')]=function(_0x10caea,_0x6f2624){var _0x13471c=path[_0xf7ef('0x71')](config[_0xf7ef('0x72')],_0xf7ef('0x7a'));var _0x5aba35={'where':{'id':_0x10caea[_0xf7ef('0x4b')]['id']},'attributes':['id','customerAvatar',_0xf7ef('0x7b')],'raw':!![]};return db[_0xf7ef('0x33')][_0xf7ef('0x4d')](_0x5aba35)['then'](handleEntityNotFound(_0x6f2624,null))[_0xf7ef('0x17')](function(_0x542a3c){if(_0x542a3c){if(!_[_0xf7ef('0x70')](_0x542a3c[_0xf7ef('0x6a')])){if(fs[_0xf7ef('0x77')](path['join'](config['root'],'server/files/images/avatars/',_0x542a3c['customerAvatar']))&&_0x542a3c['showCustomerAvatar']){_0x13471c=path[_0xf7ef('0x71')](config[_0xf7ef('0x72')],_0xf7ef('0x78'),_0x542a3c[_0xf7ef('0x6a')]);}}return _0x6f2624['download'](_0x13471c);}})['catch'](handleError(_0x6f2624,null));};exports[_0xf7ef('0x7c')]=function(_0x53bcb6,_0x464f5f){var _0x3c00c5=path[_0xf7ef('0x71')](config[_0xf7ef('0x72')],_0xf7ef('0x7d'));var _0x2cbd34={'where':{'id':_0x53bcb6[_0xf7ef('0x4b')]['id']},'attributes':['id',_0xf7ef('0x7e')],'raw':!![]};return db[_0xf7ef('0x33')][_0xf7ef('0x4d')](_0x2cbd34)['then'](handleEntityNotFound(_0x464f5f,null))[_0xf7ef('0x17')](function(_0x1f1e05){if(_0x1f1e05){if(!_[_0xf7ef('0x70')](_0x1f1e05['systemAvatar'])){if(fs['existsSync'](path['join'](config[_0xf7ef('0x72')],'server/files/images/avatars/',_0x1f1e05[_0xf7ef('0x7e')]))){_0x3c00c5=path['join'](config[_0xf7ef('0x72')],_0xf7ef('0x78'),_0x1f1e05[_0xf7ef('0x7e')]);}}return _0x464f5f[_0xf7ef('0x74')](_0x3c00c5);}})[_0xf7ef('0x4a')](handleError(_0x464f5f,null));};exports[_0xf7ef('0x7f')]=function(_0x1c190a,_0x3cf284){var _0x428532=require('user-agent-parser');var _0x8cb475=new _0x428532();var _0x234b2b=_0x8cb475[_0xf7ef('0x80')](_0x1c190a['headers'][_0xf7ef('0x81')])[_0xf7ef('0x82')]();var _0x20a770={'body':_0x1c190a[_0xf7ef('0x4f')],'channel':'chat'};var _0x2261ad=[];var _0x28d6e1=[];var _0x499e53={};var _0x55143e=![];return db['CmContact'][_0xf7ef('0x56')]()[_0xf7ef('0x17')](function(_0x447011){if(!_0x447011){throw new db['Sequelize'][(_0xf7ef('0x83'))]('no\x20available\x20attributes');}_0x2261ad=_[_0xf7ef('0x84')](_[_0xf7ef('0x39')](_0x447011),[_0xf7ef('0x85'),_0xf7ef('0x86')]);_0x28d6e1=_[_0xf7ef('0x84')](_[_0xf7ef('0x39')](_0x447011),[_0xf7ef('0x85'),_0xf7ef('0x86'),_0xf7ef('0x87'),_0xf7ef('0x88')]);if(_0x1c190a[_0xf7ef('0x4f')]['id']){delete _0x1c190a['body']['id'];}if(_[_0xf7ef('0x70')](_0x1c190a[_0xf7ef('0x4f')]['from'])){throw new db[(_0xf7ef('0x89'))]['ValidationError'](_0xf7ef('0x8a'));}if(_[_0xf7ef('0x70')](_0x1c190a['body'][_0xf7ef('0x4f')])||_0x1c190a[_0xf7ef('0x4f')][_0xf7ef('0x4f')]===''){throw new db['Sequelize'][(_0xf7ef('0x83'))](_0xf7ef('0x8b'));}if(_[_0xf7ef('0x70')](_0x1c190a[_0xf7ef('0x4f')][_0xf7ef('0x8c')])){throw new db[(_0xf7ef('0x89'))][(_0xf7ef('0x83'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x28d6e1);}if(!_[_0xf7ef('0x8d')](_0x28d6e1,_0x1c190a[_0xf7ef('0x4f')][_0xf7ef('0x8c')])){throw new db[(_0xf7ef('0x89'))][(_0xf7ef('0x83'))](_0xf7ef('0x8e')+_0x28d6e1);}_0x499e53[_0x1c190a['body'][_0xf7ef('0x8c')]]=_0x1c190a['body'][_0xf7ef('0x8f')];})[_0xf7ef('0x17')](function(){return db['ChatWebsite'][_0xf7ef('0x4d')]({'where':{'id':_0x1c190a['params']['id']},'include':[{'model':db[_0xf7ef('0x90')],'as':_0xf7ef('0x91'),'include':[{'model':db[_0xf7ef('0x92')],'as':_0xf7ef('0x93'),'where':_0x499e53,'limit':0x1,'order':[[_0xf7ef('0x86'),_0xf7ef('0x94')]]}]},{'model':db[_0xf7ef('0x95')],'as':'Applications'}]});})[_0xf7ef('0x17')](handleEntityNotFound(_0x3cf284,null))[_0xf7ef('0x17')](function(_0x512e7a){if(_0x512e7a&&_0x512e7a[_0xf7ef('0x91')]){_0x20a770['account']=_0x512e7a;_0x20a770['applications']=_0x512e7a[_0xf7ef('0x96')];_0x20a770['list']=_0x512e7a[_0xf7ef('0x91')];_0x20a770[_0xf7ef('0x97')]=_[_0xf7ef('0x98')](_0x20a770[_0xf7ef('0x97')],[_0xf7ef('0x99')],[_0xf7ef('0x9a')]);if(_0x20a770[_0xf7ef('0x9b')][_0xf7ef('0x96')]){delete _0x20a770[_0xf7ef('0x9b')]['Applications'];}if(_0x20a770['account'][_0xf7ef('0x91')]&&_0x20a770['account'][_0xf7ef('0x91')][_0xf7ef('0x93')][_0xf7ef('0x4c')]){return _0x20a770[_0xf7ef('0x9b')][_0xf7ef('0x91')][_0xf7ef('0x93')][0x0];}var _0x3f09a2=_[_0xf7ef('0xe')](_0x1c190a[_0xf7ef('0x4f')],{'firstName':_0x1c190a[_0xf7ef('0x4f')]['from'],'ListId':_0x512e7a[_0xf7ef('0x88')]});_0x3f09a2[_0x1c190a['body']['mapKey']]=_0x1c190a[_0xf7ef('0x4f')][_0xf7ef('0x8f')];return db[_0xf7ef('0x92')][_0xf7ef('0x4e')](_0x3f09a2,{'fields':_0x2261ad,'raw':!![]});}})['then'](handleEntityNotFound(_0x3cf284,null))[_0xf7ef('0x17')](function(_0x34cb77){_0x20a770['contact']=_0x34cb77;var _0x39320c=_0x1c190a[_0xf7ef('0x4f')]['customerIp'];if(_0x1c190a[_0xf7ef('0x9c')]['cf-connecting-ip']){_0x39320c=_0x1c190a[_0xf7ef('0x9c')]['cf-connecting-ip'];}else if(_0x1c190a['headers']['x-forwarded-for']){_0x39320c=_[_0xf7ef('0x9d')](_0x1c190a['headers'][_0xf7ef('0x9e')][_0xf7ef('0x9f')](','));}if(_0x34cb77){var _0x456940={'ContactId':_0x34cb77['id'],'ChatWebsiteId':_0x1c190a['params']['id'],'from':(_0x34cb77[_0xf7ef('0xa0')]||'')+'\x20'+(_0x34cb77[_0xf7ef('0xa1')]||''),'customerIp':_0x39320c,'customerPort':_0x1c190a[_0xf7ef('0x9c')]['x-real-port']?_0x1c190a[_0xf7ef('0x9c')][_0xf7ef('0xa2')]:null,'referer':_0x1c190a[_0xf7ef('0x4f')][_0xf7ef('0xa3')],'browserName':_0x234b2b[_0xf7ef('0xa4')]['name']&&_0x234b2b['browser'][_0xf7ef('0xa5')]?util['format'](_0xf7ef('0xa6'),_0x234b2b[_0xf7ef('0xa4')][_0xf7ef('0x55')],_0x234b2b[_0xf7ef('0xa4')][_0xf7ef('0xa5')]):_0xf7ef('0xa7'),'browserVersion':_0x234b2b[_0xf7ef('0xa4')][_0xf7ef('0xa5')]||_0xf7ef('0xa7'),'osName':util[_0xf7ef('0xa8')](_0xf7ef('0xa6'),_0x234b2b['os']['name'],_0x234b2b['os'][_0xf7ef('0xa5')]),'osVersion':_0x234b2b['os'][_0xf7ef('0xa5')],'deviceModel':_0x234b2b['device'][_0xf7ef('0x3b')]&&_0x234b2b['device'][_0xf7ef('0xa9')]?util[_0xf7ef('0xa8')](_0xf7ef('0xaa'),_0x234b2b[_0xf7ef('0xab')][_0xf7ef('0x3b')],_0x234b2b[_0xf7ef('0xab')][_0xf7ef('0xa9')],_0x234b2b[_0xf7ef('0xab')][_0xf7ef('0x36')]):null,'deviceVendor':_0x234b2b['device']['vendor'],'deviceType':_0x234b2b[_0xf7ef('0xab')][_0xf7ef('0x36')],'formData':JSON[_0xf7ef('0x1c')](_0x1c190a['body'])};var _0x9ed6fe={'ChatWebsiteId':_0x1c190a[_0xf7ef('0x4b')]['id'],'closed':![]};if(_0x1c190a['body'][_0xf7ef('0xac')]){_0x9ed6fe[_0xf7ef('0xac')]=_0x1c190a[_0xf7ef('0x4f')][_0xf7ef('0xac')];return db[_0xf7ef('0xad')][_0xf7ef('0x4d')]({'where':_0x9ed6fe})['then'](function(_0x4e1192){if(_0x4e1192){return[_0x4e1192,![]];}_0x456940[_0xf7ef('0xac')]=_0x1c190a[_0xf7ef('0x4f')][_0xf7ef('0xac')];_0x456940[_0xf7ef('0xae')]=_0x1c190a[_0xf7ef('0x4f')][_0xf7ef('0xae')];return db[_0xf7ef('0xad')][_0xf7ef('0x4e')](_0x456940)[_0xf7ef('0x17')](function(_0x4c2568){return[_0x4c2568,!![]];});});}_0x9ed6fe['ContactId']=_0x34cb77['id'];if(_0x1c190a[_0xf7ef('0x4f')][_0xf7ef('0xaf')]&&_0x1c190a[_0xf7ef('0x4f')][_0xf7ef('0xaf')]['id']){_0x9ed6fe['id']=_0x1c190a['body'][_0xf7ef('0xaf')]['id'];return db[_0xf7ef('0xad')][_0xf7ef('0x4d')]({'where':_0x9ed6fe})['then'](function(_0x4f5360){if(_0x4f5360){return[_0x4f5360,![]];}return db[_0xf7ef('0xad')][_0xf7ef('0x4e')](_0x456940)[_0xf7ef('0x17')](function(_0x24bfb5){return[_0x24bfb5,!![]];});});}return db[_0xf7ef('0xad')][_0xf7ef('0x4e')](_0x456940)[_0xf7ef('0x17')](function(_0x2ef066){return[_0x2ef066,!![]];});}})[_0xf7ef('0xb0')](function(_0x4d4a2e,_0x25212c){if(_0x4d4a2e){_0x55143e=_0x25212c;if(!_0x25212c){var _0x5dba8c={'from':(_0x20a770[_0xf7ef('0xb1')][_0xf7ef('0xa0')]||'')+'\x20'+(_0x20a770[_0xf7ef('0xb1')][_0xf7ef('0xa1')]||'')};if(_0x1c190a[_0xf7ef('0x4f')][_0xf7ef('0xac')]&&_0x1c190a[_0xf7ef('0x4f')][_0xf7ef('0xb2')]&&_0x1c190a[_0xf7ef('0x4f')][_0xf7ef('0xac')]!=_0x1c190a[_0xf7ef('0x4f')][_0xf7ef('0xb2')]){_0x5dba8c[_0xf7ef('0xac')]=_0x1c190a[_0xf7ef('0x4f')][_0xf7ef('0xb2')];}return _0x4d4a2e[_0xf7ef('0x2a')](_0x5dba8c);}else{return _0x4d4a2e;}}})[_0xf7ef('0x17')](function(_0x8731e3){_0x20a770[_0xf7ef('0xaf')]=_0x8731e3[_0xf7ef('0x51')]({'plain':!![]});_0x20a770['interaction']['created']=_0x55143e;if(_0x20a770[_0xf7ef('0xaf')]['created']){if(_0x20a770[_0xf7ef('0x9b')]['autoclose']){_0x20a770[_0xf7ef('0x97')]['push']({'id':0x0,'priority':_0x20a770[_0xf7ef('0x97')][_0xf7ef('0x4c')]+0x1,'app':'close','appdata':_0xf7ef('0xb3'),'interval':'*,*,*,*'});}}return db[_0xf7ef('0xb4')][_0xf7ef('0x4e')]({'body':_0x1c190a[_0xf7ef('0x4f')]['body'],'ChatWebsiteId':_0x1c190a[_0xf7ef('0x4b')]['id'],'ChatInteractionId':_0x8731e3['id'],'direction':'in','ContactId':_0x20a770[_0xf7ef('0xb1')]['id'],'AttachmentId':_0x1c190a[_0xf7ef('0x4f')][_0xf7ef('0xb5')]});})[_0xf7ef('0x17')](function(_0x2ed1c6){_0x20a770['message']=_0x2ed1c6;if(_0x20a770[_0xf7ef('0xaf')][_0xf7ef('0xb6')]){return db[_0xf7ef('0xb7')][_0xf7ef('0x4d')]({'attributes':['id',_0xf7ef('0x55')],'where':{'id':_0x20a770[_0xf7ef('0xaf')]['UserId']}})[_0xf7ef('0x17')](function(_0x5d5884){if(_0x5d5884){_0x20a770[_0xf7ef('0x97')]['unshift']({'id':0x0,'priority':0x0,'app':_0xf7ef('0xb8'),'appdata':_0x5d5884['name']+','+(_0x20a770[_0xf7ef('0x9b')][_0xf7ef('0xb9')]||0xa),'interval':_0xf7ef('0xba')});_0x20a770[_0xf7ef('0xbb')]=!![];}return respondWithRpcPromise(_0xf7ef('0xbc'),_0xf7ef('0xbd'),_0x20a770);});}return respondWithRpcPromise(_0xf7ef('0xbc'),_0xf7ef('0xbd'),_0x20a770);})[_0xf7ef('0x17')](function(_0x2ea02d){respondWithRpcPromise(_0xf7ef('0xbe'),'EventManager',{'event':'notify','message':_0x2ea02d},client9002);return _0x2ea02d;})[_0xf7ef('0x17')](respondWithResult(_0x3cf284,null))['catch'](handleError(_0x3cf284,null));};exports['offline']=function(_0x1728e5,_0x5e6e38){var _0x53a895,_0xa2743,_0x433f93;var _0x519aa4=[];var _0x3cc2c3={};var _0x517cf2=_0x1728e5[_0xf7ef('0xbf')]||[];var _0x1e958a=[];var _0x4a45b6;return db['CmContact'][_0xf7ef('0x56')]()['then'](function(_0x5035a0){if(!_0x5035a0){throw new db[(_0xf7ef('0x89'))]['ValidationError']('no\x20available\x20attributes');}_0x519aa4=_['difference'](_[_0xf7ef('0x39')](_0x5035a0),[_0xf7ef('0x85'),_0xf7ef('0x86'),_0xf7ef('0x87'),_0xf7ef('0x88')]);if(_0x1728e5['body']['id']){delete _0x1728e5[_0xf7ef('0x4f')]['id'];}if(_[_0xf7ef('0x70')](_0x1728e5[_0xf7ef('0x4f')][_0xf7ef('0x8f')])){throw _0x5e6e38[_0xf7ef('0x22')](0x1f4)[_0xf7ef('0x2f')](new db[(_0xf7ef('0x89'))]['ValidationError'](_0xf7ef('0x8a')));}if(_[_0xf7ef('0x70')](_0x1728e5[_0xf7ef('0x4f')][_0xf7ef('0x4f')])||_0x1728e5['body'][_0xf7ef('0x4f')]===''){throw _0x5e6e38[_0xf7ef('0x22')](0x1f4)['send'](new db[(_0xf7ef('0x89'))][(_0xf7ef('0x83'))](_0xf7ef('0x8b')));}if(_[_0xf7ef('0x70')](_0x1728e5[_0xf7ef('0x4f')]['mapKeyOffline'])){throw _0x5e6e38['status'](0x1f4)['send'](new db['Sequelize'][(_0xf7ef('0x83'))](_0xf7ef('0xc0')+_0x519aa4));}if(!_[_0xf7ef('0x8d')](_0x519aa4,_0x1728e5[_0xf7ef('0x4f')][_0xf7ef('0xc1')])){throw _0x5e6e38[_0xf7ef('0x22')](0x1f4)[_0xf7ef('0x2f')](new db['Sequelize'][(_0xf7ef('0x83'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x519aa4));}_0x3cc2c3[_0x1728e5[_0xf7ef('0x4f')][_0xf7ef('0xc1')]]=_0x1728e5[_0xf7ef('0x4f')][_0xf7ef('0x8f')];})['then'](function(){return db[_0xf7ef('0x33')][_0xf7ef('0x4d')]({'where':{'id':_0x1728e5[_0xf7ef('0x4b')]['id']},'include':[{'model':db['CmList'],'as':_0xf7ef('0x91')},{'model':db[_0xf7ef('0xc2')],'as':_0xf7ef('0xc2')}]});})[_0xf7ef('0x17')](handleEntityNotFound(_0x5e6e38,null))[_0xf7ef('0x17')](function(_0x2b807c){if(_0x2b807c&&_0x2b807c[_0xf7ef('0x91')]){_0xa2743=_0x2b807c;var _0x409f17=_[_0xf7ef('0xe')](_0x1728e5[_0xf7ef('0x4f')],{'firstName':_0x1728e5['body'][_0xf7ef('0x8f')],'phone':_0x1728e5[_0xf7ef('0x4f')][_0xf7ef('0x8f')],'ListId':_0x2b807c[_0xf7ef('0x88')]});_0x409f17[_0x1728e5[_0xf7ef('0x4f')]['mapKeyOffline']]=_0x1728e5['body'][_0xf7ef('0x8f')];return db[_0xf7ef('0x92')][_0xf7ef('0xc3')]({'where':_0x3cc2c3,'defaults':_0x409f17});}})[_0xf7ef('0xb0')](function(_0x5dc688){if(_0x5dc688){_0x433f93=_0x5dc688;var _0x29198d=fs[_0xf7ef('0xc4')](path[_0xf7ef('0x71')](config[_0xf7ef('0x72')],_0xf7ef('0xc5')),_0xf7ef('0xc6'));var _0x5e150d=ejs[_0xf7ef('0xc7')](_0x29198d,{'body':_[_0xf7ef('0xc8')](_0x1728e5[_0xf7ef('0x4f')]['body']),'bodyTitle':_0xa2743[_0xf7ef('0xc9')]});return db[_0xf7ef('0xca')][_0xf7ef('0x4e')]({'body':_0x5e150d,'plainBody':htmlToText['fromString'](_0x5e150d),'ContactId':_0x5dc688['id'],'ChatWebsiteId':_0xa2743['id']});}})['then'](function(_0x1e5df7){_0x4a45b6=_0x1e5df7;if(_0x517cf2['length']){var _0x358b0c=_0x517cf2[_0xf7ef('0x32')](function(_0xad6053){return{'name':_0xad6053['originalname'],'basename':_0xad6053[_0xf7ef('0x69')],'type':_0xad6053[_0xf7ef('0xcb')],'ChatOfflineMessageId':_0x1e5df7['id']};});_0x1e958a=_0x358b0c[_0xf7ef('0x32')](_0x5c0337=>{var _0x47e5bd={'filename':_0x5c0337[_0xf7ef('0x55')],'path':path['join'](config[_0xf7ef('0x72')],'server',_0xf7ef('0xbf'),_0xf7ef('0xcc'),'offline-chat',_0x5c0337[_0xf7ef('0xcd')])};return _0x47e5bd;});if(!_0xa2743[_0xf7ef('0xce')]){return db[_0xf7ef('0xcf')]['transaction'](function(_0x10fabc){return db['Attachment'][_0xf7ef('0xd0')](_0x358b0c,{'transaction':_0x10fabc});});}}})[_0xf7ef('0x17')](function(){if(_0x4a45b6){_0x53a895=_0x4a45b6;return db[_0xf7ef('0xc2')][_0xf7ef('0x5b')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db[_0xf7ef('0xd1')],'as':'CloudProvider','raw':!![]}]}]});}})['then'](function(_0x38fdeb){if(_0x38fdeb&&_0x38fdeb['Smtp']&&_0xa2743[_0xf7ef('0xd2')]&&_0xa2743[_0xf7ef('0xd3')]){var _0xe470a1=_0x38fdeb['getSmtpOptions']();return respondWithRpcPromise(_0xf7ef('0xd4'),'sendMail',{'account':_0xe470a1,'message':{'from':util['format'](_0xf7ef('0xd5'),_0x38fdeb[_0xf7ef('0x55')],_0x38fdeb['email']||_0x38fdeb[_0xf7ef('0xd6')]['user']),'to':_0xa2743[_0xf7ef('0xd3')],'subject':_0xa2743[_0xf7ef('0xd7')],'html':_0x53a895[_0xf7ef('0x4f')],'attachments':_0x1e958a}},client9003)[_0xf7ef('0x17')](function(){return _0x53a895;})[_0xf7ef('0x4a')](function(_0x102557){logger[_0xf7ef('0x1d')](_0x102557);});}})[_0xf7ef('0x17')](function(){if(_0xa2743&&_0xa2743[_0xf7ef('0xce')]&&_0xa2743[_0xf7ef('0xd8')]){var _0x4277d4=[];if(_0x517cf2[_0xf7ef('0x4c')]){_0x4277d4=_0x517cf2[_0xf7ef('0x32')](function(_0x452091){return{'name':_0x452091[_0xf7ef('0xd9')],'basename':_0x452091[_0xf7ef('0x69')],'type':_0x452091[_0xf7ef('0xcb')],'ChatOfflineMessageId':_0x4a45b6['id']};});}var _0x1a1a6c;if(!_[_0xf7ef('0x70')](_0xa2743[_0xf7ef('0xda')])){var _0x5d5f79=_[_0xf7ef('0x32')](_0x1728e5[_0xf7ef('0x4f')],function(_0x3ed3ba){return _0x3ed3ba;});var _0x52e23c=_[_0xf7ef('0xdb')](_0x5d5f79)[0x0];var _0xb67dad=_[_0xf7ef('0xdc')](_0x52e23c,function(_0x1721d0){return _0x1721d0;});_0x1a1a6c=_0xb67dad[0x1][_0xa2743['subjectOffline']];}var _0x58f424={'from':_0x433f93['email'],'firstName':_0x433f93[_0xf7ef('0xa0')],'lastName':_0x433f93[_0xf7ef('0xa1')],'mapKey':_0xf7ef('0xdd'),'message':{'from':_0x433f93[_0xf7ef('0xdd')],'to':_0xa2743[_0xf7ef('0xc2')][_0xf7ef('0xdd')],'cc':'','subject':_[_0xf7ef('0x70')](_0x1a1a6c)?_0xa2743['offlineMessageSubject']:_0x1a1a6c,'messageId':'','sentAt':new Date(),'attach':_0x4277d4['length'],'attachments':_0x4277d4,'originChannel':_0xf7ef('0xde'),'ChatWebsiteId':_0xa2743['id'],'ChatOfflineMessageId':_0x53a895['id'],'originTo':_0xa2743['MailAccount'][_0xf7ef('0xdd')]},'body':_0x53a895[_0xf7ef('0x4f')]};var _0x381bf7={'account':{'id':_0xa2743[_0xf7ef('0xd8')]},'body':_0x58f424,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0xf7ef('0xdf'),'notifyMail',_0x381bf7,client9001)[_0xf7ef('0x17')](function(){return _0x53a895;})[_0xf7ef('0x4a')](function(_0x5fd82a){logger[_0xf7ef('0x1d')](_0x5fd82a);});}return;})['then'](function(){if(_0x53a895){return _0x53a895;}})[_0xf7ef('0x17')](respondWithResult(_0x5e6e38,null))['catch'](function(_0x512d3d){logger[_0xf7ef('0x1d')](_0xf7ef('0x4a'),_0x512d3d);for(var _0x640b61 of _0x517cf2){var _0x2a8b78=path['join'](config[_0xf7ef('0x72')],_0xf7ef('0xe0'),_0xf7ef('0xbf'),_0xf7ef('0xcc'),_0xf7ef('0xe1'),_0x640b61[_0xf7ef('0x69')]);fs_extra[_0xf7ef('0xe2')](_0x2a8b78)[_0xf7ef('0x4a')](function(_0xf21b0e){logger[_0xf7ef('0x1d')]('Could\x20not\x20remove\x20attachment\x20file',_0x2a8b78,_0xf21b0e);});}});};exports[_0xf7ef('0xe3')]=function(_0x180e8f,_0x3c646d){return db[_0xf7ef('0xad')][_0xf7ef('0x4d')]({'where':{'id':_0x180e8f[_0xf7ef('0x4b')]['id']}})[_0xf7ef('0x17')](handleEntityNotFound(_0x3c646d,null))[_0xf7ef('0x17')](function(_0x417888){if(_0x417888){return _0x417888[_0xf7ef('0xe3')](_0x180e8f['body'][_0xf7ef('0x5f')],_[_0xf7ef('0xe4')](_0x180e8f[_0xf7ef('0x4f')],[_0xf7ef('0x5f'),'id'])||{});}})[_0xf7ef('0x17')](respondWithResult(_0x3c646d,null))[_0xf7ef('0x4a')](handleError(_0x3c646d,null));};exports['getInteractions']=function(_0x34aa9c,_0x37db60){var _0x6abbdf={'raw':![],'where':{}};var _0x4dc16f={};var _0xf4cebd={'count':0x0,'rows':[]};return db[_0xf7ef('0x33')]['findOne']({'where':{'id':_0x34aa9c[_0xf7ef('0x4b')]['id']}})[_0xf7ef('0x17')](handleEntityNotFound(_0x37db60,null))[_0xf7ef('0x17')](function(_0x40a540){if(_0x40a540){_0x4dc16f[_0xf7ef('0x3b')]=_[_0xf7ef('0x39')](db[_0xf7ef('0xad')][_0xf7ef('0x34')]);_0x4dc16f[_0xf7ef('0x38')]=_[_0xf7ef('0x39')](_0x34aa9c['query']);_0x4dc16f[_0xf7ef('0x42')]=_['intersection'](_0x4dc16f['model'],_0x4dc16f[_0xf7ef('0x38')]);_0x6abbdf[_0xf7ef('0x3c')]=_[_0xf7ef('0x3a')](_0x4dc16f[_0xf7ef('0x3b')],qs['fields'](_0x34aa9c[_0xf7ef('0x38')][_0xf7ef('0x3d')]));_0x6abbdf[_0xf7ef('0x3c')]=_0x6abbdf[_0xf7ef('0x3c')][_0xf7ef('0x4c')]?_0x6abbdf['attributes']:_0x4dc16f[_0xf7ef('0x3b')];if(!_0x34aa9c['query'][_0xf7ef('0x5c')](_0xf7ef('0x3e'))){_0x6abbdf['limit']=qs[_0xf7ef('0x27')](_0x34aa9c[_0xf7ef('0x38')][_0xf7ef('0x27')]);_0x6abbdf[_0xf7ef('0x25')]=qs[_0xf7ef('0x25')](_0x34aa9c[_0xf7ef('0x38')]['offset']);}_0x6abbdf[_0xf7ef('0x3f')]=qs[_0xf7ef('0x40')](_0x34aa9c['query'][_0xf7ef('0x40')]);_0x6abbdf['where']=qs[_0xf7ef('0x42')](_['pick'](_0x34aa9c[_0xf7ef('0x38')],_0x4dc16f[_0xf7ef('0x42')]));_0x6abbdf['where']['ChatWebsiteId']=_0x40a540['id'];if(_0x34aa9c[_0xf7ef('0x38')]['filter']){_0x6abbdf[_0xf7ef('0x41')]=_[_0xf7ef('0x45')](_0x6abbdf[_0xf7ef('0x41')],{'$or':_[_0xf7ef('0x32')](_0x6abbdf['attributes'],function(_0x44c797){var _0x1cb62c={};_0x1cb62c[_0x44c797]={'$like':'%'+_0x34aa9c['query'][_0xf7ef('0x43')]+'%'};return _0x1cb62c;})});}_0x6abbdf=_[_0xf7ef('0x45')]({},_0x6abbdf,_0x34aa9c['options']);return db[_0xf7ef('0xad')]['count']({'where':_0x6abbdf['where']})[_0xf7ef('0x17')](function(_0x5cc7b1){_0xf4cebd[_0xf7ef('0x28')]=_0x5cc7b1;if(_0x34aa9c['query']['includeAll']){_0x6abbdf[_0xf7ef('0x48')]=[{'model':db[_0xf7ef('0x92')],'as':_0xf7ef('0xe5'),'required':![]},{'model':db[_0xf7ef('0xb7')],'as':'Owner','attributes':[_0xf7ef('0x55'),_0xf7ef('0xe6'),_0xf7ef('0xe7')],'required':![]},{'model':db['Tag'],'as':_0xf7ef('0xe8'),'attributes':['id',_0xf7ef('0x55'),'color'],'where':_0x34aa9c['query'][_0xf7ef('0xe9')]?{'id':_0x34aa9c[_0xf7ef('0x38')]['tag']}:undefined,'required':_0x34aa9c[_0xf7ef('0x38')][_0xf7ef('0xe9')]?!![]:![]}];}return db[_0xf7ef('0xad')][_0xf7ef('0x5d')](_0x6abbdf);})[_0xf7ef('0x17')](function(_0x30b96f){_0xf4cebd['rows']=_0x30b96f;return _0xf4cebd;});}})[_0xf7ef('0x17')](respondWithFilteredResult(_0x37db60,_0x6abbdf))[_0xf7ef('0x4a')](handleError(_0x37db60,null));};function iftimePromise(_0x3dbe67,_0x743207){return respondWithRpcPromise('Command',_0xf7ef('0xea'),{'command':_0x743207[_0xf7ef('0xeb')]?util[_0xf7ef('0xa8')](_0xf7ef('0xec'),_0x3dbe67['interval'],_0x743207[_0xf7ef('0xeb')]):util['format'](_0xf7ef('0xed'),_0x3dbe67[_0xf7ef('0xee')])},client9002)[_0xf7ef('0x17')](function(_0x51bd6d){var _0x46abcf=_0x51bd6d&&_0x51bd6d[_0xf7ef('0xef')](_0xf7ef('0xf0'))>=0x0?!![]:![];logger[_0xf7ef('0x18')](_0xf7ef('0xf1'),_0x743207['id'],_0x3dbe67['id'],_0x3dbe67[_0xf7ef('0xee')],_0x46abcf?_0xf7ef('0xf2'):'OFFLINE',_0x743207[_0xf7ef('0xeb')]?_0x743207[_0xf7ef('0xeb')]:_0xf7ef('0xf3'));return _0x46abcf;})[_0xf7ef('0x4a')](function(_0x750068){logger[_0xf7ef('0x1d')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x743207['id'],_0x3dbe67['id'],_0x3dbe67[_0xf7ef('0xee')],util['inspect'](_0x750068,{'showHidden':![],'depth':null}),_0x743207[_0xf7ef('0xeb')]?_0x743207[_0xf7ef('0xeb')]:_0xf7ef('0xf3'));return![];});}exports[_0xf7ef('0xea')]=function(_0x1f25d7,_0x5c3ccd){var _0x283a6d=0x0;var _0x43c99d=0x0;var _0x523b20=![];var _0x26973a;var _0x5156ea;return db['ChatWebsite']['find']({'where':{'id':_0x1f25d7['params']['id']},'include':[{'model':db[_0xf7ef('0xf4')],'as':_0xf7ef('0xf4'),'include':[{'model':db[_0xf7ef('0xf4')],'as':_0xf7ef('0xf5'),'attributes':['id',_0xf7ef('0xee')],'raw':!![]}]}]})[_0xf7ef('0x17')](handleEntityNotFound(_0x5c3ccd,null))[_0xf7ef('0x17')](function(_0xde9c82){if(_0xde9c82){_0x26973a=_0xde9c82;return _0xde9c82[_0xf7ef('0xf6')]({'raw':!![]});}})[_0xf7ef('0x17')](function(_0xd55492){if(_0x26973a){if(_0xd55492){_0x5156ea=_0xd55492;}}return require(_0xf7ef('0x6d'))['getLicense']();})[_0xf7ef('0x17')](function(_0x28c0df){if(_0x28c0df){_0x43c99d=_0x28c0df[_0xf7ef('0xf7')];_0x523b20=_0x28c0df[_0xf7ef('0x6f')];}})[_0xf7ef('0x17')](function(){return db[_0xf7ef('0xad')][_0xf7ef('0x28')]({'where':{'closed':![]}});})[_0xf7ef('0x17')](function(_0xda3991){_0x283a6d=_0xda3991;if(_0x43c99d&&_0xda3991>_0x43c99d){return db[_0xf7ef('0xf8')]['findOne']({'where':{'id':0x1}})[_0xf7ef('0x17')](function(_0x5dc29b){if(_0x5dc29b){_0x5dc29b[_0xf7ef('0xf9')](_0xf7ef('0xfa'));}});}})[_0xf7ef('0x17')](function(){if(_0x26973a['Interval']&&_0x26973a[_0xf7ef('0xf4')]['Intervals']){var _0x18bac7=[];for(var _0x3eebfd=0x0;_0x3eebfd<_0x26973a['Interval'][_0xf7ef('0xf5')][_0xf7ef('0x4c')];_0x3eebfd++){var _0x197b7a=_0x26973a[_0xf7ef('0xf4')][_0xf7ef('0xf5')][_0x3eebfd][_0xf7ef('0x51')]({'plain':!![]});_0x18bac7[_0xf7ef('0xfb')](iftimePromise(_0x197b7a,_0x26973a));}return BPromise[_0xf7ef('0xfc')](_0x18bac7)[_0xf7ef('0x17')](function(_0x1e83bb){return _[_0xf7ef('0xfd')](_0x1e83bb);});}else{return!![];}})['then'](function(_0x32aedd){var _0x7f377=fs[_0xf7ef('0xc4')](path['join'](config['root'],_0xf7ef('0xfe')),_0xf7ef('0xc6'));var _0xa2c86b=new url[(_0xf7ef('0xff'))](_0x26973a[_0xf7ef('0x100')])[_0xf7ef('0x101')];var _0xa1db8c=_0xf7ef('0x102');var _0x3004e3=![];var _0x1020a7={'chatVersion':_0xa1db8c,'chatWebsiteAddressOrigin':_0xa2c86b,'remote':_0x26973a[_0xf7ef('0x103')],'query':querystring[_0xf7ef('0x1c')](_[_0xf7ef('0x45')](_0x26973a['get']({'plain':!![]}),{'customerIp':_0x1f25d7[_0xf7ef('0x9c')]['x-forwarded-for']||_0x1f25d7[_0xf7ef('0x9c')][_0xf7ef('0x104')]||_0x1f25d7[_0xf7ef('0x105')][_0xf7ef('0x106')]||_0x1f25d7['ip'],'referer':_0x1f25d7[_0xf7ef('0x9c')]['referer'],'openedInteractions':_0x283a6d,'maxInteractions':_0x43c99d,'virtual':_0x523b20[_0xf7ef('0xf7')],'online':_0x32aedd,'custom':_0x523b20}))[_0xf7ef('0x107')](/'/g,'\x5c\x27')};_0x5c3ccd[_0xf7ef('0x2f')](ejs['render'](Mustache['render'](_0x7f377,_0x1020a7),{'proactiveActions':_0x5156ea,'alignment':_0x26973a[_0xf7ef('0x108')],'verticalAlignment':_0x26973a[_0xf7ef('0x109')],'div_color':_0x26973a['color'],'labelText':_0x26973a[_0xf7ef('0x10a')],'text_color':_0x26973a[_0xf7ef('0x10b')],'text_button_color':_0x26973a[_0xf7ef('0x10c')],'button_color':_0x26973a[_0xf7ef('0x10d')],'background_color':_0x26973a['backgroundColor'],'hideWhenOffline':_0x26973a[_0xf7ef('0x10e')],'intervalId':_0x26973a[_0xf7ef('0x10f')],'isDevelopment':_0x3004e3,'chatVersion':_0xa1db8c}));})[_0xf7ef('0x4a')](handleError(_0x5c3ccd,null));};exports[_0xf7ef('0x110')]=function(_0x52dc43,_0x2d3aae){var _0x1c37a5=_0x52dc43[_0xf7ef('0x4b')]['id'];var _0x104e1f=_0x52dc43[_0xf7ef('0x4f')];var _0x1f5e86=0xc8;var _0x6f10a=null;return db['sequelize']['transaction']({'isolationLevel':db[_0xf7ef('0xcf')][_0xf7ef('0x111')]['ISOLATION_LEVELS'][_0xf7ef('0x112')]},function(_0x5c0d2c){return db['ChatWebsite'][_0xf7ef('0x5b')]({'where':{'id':_0x1c37a5},'transaction':_0x5c0d2c})[_0xf7ef('0x17')](function(_0x324d4b){if(_0x324d4b){return db[_0xf7ef('0x95')][_0xf7ef('0x2b')]({'where':{'ChatWebsiteId':_0x1c37a5},'transaction':_0x5c0d2c})[_0xf7ef('0x17')](function(){var _0x60cb74=_[_0xf7ef('0x32')](_0x104e1f,function(_0x388a71){_0x388a71[_0xf7ef('0x58')]=_0x1c37a5;return _0x388a71;});return db[_0xf7ef('0x95')][_0xf7ef('0xd0')](_0x60cb74,{'transaction':_0x5c0d2c});});}else{_0x1f5e86=0x194;_0x6f10a=[];}});})[_0xf7ef('0x17')](function(){if(_0x1f5e86!==0x194){return db[_0xf7ef('0x95')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x1c37a5},'order':_0xf7ef('0x99')})[_0xf7ef('0x17')](function(_0x3a7d51){_0x6f10a=_0x3a7d51;});}})[_0xf7ef('0x4a')](function(_0x4ab280){_0x1f5e86=0x1f4;logger[_0xf7ef('0x1d')](_0x4ab280[_0xf7ef('0x2e')]);if(_0x4ab280[_0xf7ef('0x55')]){delete _0x4ab280['name'];}_0x6f10a=_0x4ab280;})['finally'](function(){if(_0x6f10a===null){_0x2d3aae[_0xf7ef('0x21')](_0x1f5e86);}else{if(_0x1f5e86===0x1f4){_0x2d3aae[_0xf7ef('0x22')](_0x1f5e86)[_0xf7ef('0x2f')](_0x6f10a);}else{_0x2d3aae[_0xf7ef('0x22')](_0x1f5e86)['json'](_0x6f10a);}}});};exports['getApplications']=function(_0x45b1b3,_0x1e0d57){var _0x5161d2={};var _0x5b85ac={};var _0x21775d;var _0x40040e;return db[_0xf7ef('0x33')][_0xf7ef('0x5b')]({'where':{'id':_0x45b1b3['params']['id']}})[_0xf7ef('0x17')](handleEntityNotFound(_0x1e0d57,null))[_0xf7ef('0x17')](function(_0x29dba7){if(_0x29dba7){_0x21775d=_0x29dba7;_0x5b85ac[_0xf7ef('0x3b')]=_[_0xf7ef('0x39')](db[_0xf7ef('0x95')]['rawAttributes']);_0x5b85ac[_0xf7ef('0x38')]=_[_0xf7ef('0x39')](_0x45b1b3['query']);_0x5b85ac[_0xf7ef('0x42')]=_[_0xf7ef('0x3a')](_0x5b85ac[_0xf7ef('0x3b')],_0x5b85ac['query']);_0x5161d2[_0xf7ef('0x3c')]=_[_0xf7ef('0x3a')](_0x5b85ac[_0xf7ef('0x3b')],qs[_0xf7ef('0x3d')](_0x45b1b3[_0xf7ef('0x38')][_0xf7ef('0x3d')]));_0x5161d2[_0xf7ef('0x3c')]=_0x5161d2['attributes'][_0xf7ef('0x4c')]?_0x5161d2[_0xf7ef('0x3c')]:_0x5b85ac[_0xf7ef('0x3b')];_0x5161d2[_0xf7ef('0x3f')]=qs[_0xf7ef('0x40')](_0x45b1b3[_0xf7ef('0x38')][_0xf7ef('0x40')]);_0x5161d2[_0xf7ef('0x41')]=qs[_0xf7ef('0x42')](_[_0xf7ef('0x62')](_0x45b1b3[_0xf7ef('0x38')],_0x5b85ac[_0xf7ef('0x42')]));if(_0x45b1b3['query'][_0xf7ef('0x43')]){_0x5161d2['where']=_[_0xf7ef('0x45')](_0x5161d2[_0xf7ef('0x41')],{'$or':_[_0xf7ef('0x32')](_0x5161d2[_0xf7ef('0x3c')],function(_0x3fcd8c){var _0x1b6998={};_0x1b6998[_0x3fcd8c]={'$like':'%'+_0x45b1b3[_0xf7ef('0x38')]['filter']+'%'};return _0x1b6998;})});}_0x5161d2=_[_0xf7ef('0x45')]({},_0x5161d2,_0x45b1b3[_0xf7ef('0x46')]);return _0x21775d[_0xf7ef('0x113')](_0x5161d2);}})[_0xf7ef('0x17')](function(_0x4462ec){if(_0x4462ec){_0x40040e=_0x4462ec['length'];if(!_0x45b1b3['query']['hasOwnProperty'](_0xf7ef('0x3e'))){_0x5161d2[_0xf7ef('0x27')]=qs[_0xf7ef('0x27')](_0x45b1b3[_0xf7ef('0x38')]['limit']);_0x5161d2[_0xf7ef('0x25')]=qs[_0xf7ef('0x25')](_0x45b1b3[_0xf7ef('0x38')][_0xf7ef('0x25')]);}return _0x21775d[_0xf7ef('0x113')](_0x5161d2);}})[_0xf7ef('0x17')](function(_0x4d532c){if(_0x4d532c){return _0x4d532c?{'count':_0x40040e,'rows':_0x4d532c}:null;}})['then'](respondWithResult(_0x1e0d57,null))['catch'](handleError(_0x1e0d57,null));};exports[_0xf7ef('0x114')]=function(_0x25e4e2,_0x1afe6c){return db[_0xf7ef('0x115')][_0xf7ef('0x4d')]({'where':{'id':_0x25e4e2[_0xf7ef('0x4b')]['id']}})[_0xf7ef('0x17')](handleEntityNotFound(_0x1afe6c,null))['then'](function(_0x377ecd){if(_0x377ecd){return _0x377ecd['addProactiveActions'](_0x25e4e2['body'][_0xf7ef('0x5f')],_[_0xf7ef('0xe4')](_0x25e4e2[_0xf7ef('0x4f')],['ids','id'])||{});}})[_0xf7ef('0x17')](respondWithResult(_0x1afe6c,null))[_0xf7ef('0x4a')](handleError(_0x1afe6c,null));};exports[_0xf7ef('0xf6')]=function(_0x4be59f,_0x3ea116){var _0xeacfa7={};var _0x4d7577={};var _0x52a548;var _0x466a76;return db[_0xf7ef('0x33')]['findOne']({'where':{'id':_0x4be59f[_0xf7ef('0x4b')]['id']}})[_0xf7ef('0x17')](handleEntityNotFound(_0x3ea116,null))[_0xf7ef('0x17')](function(_0xe81b41){if(_0xe81b41){_0x52a548=_0xe81b41;_0x4d7577[_0xf7ef('0x3b')]=_[_0xf7ef('0x39')](db[_0xf7ef('0x116')][_0xf7ef('0x34')]);_0x4d7577[_0xf7ef('0x38')]=_[_0xf7ef('0x39')](_0x4be59f[_0xf7ef('0x38')]);_0x4d7577['filters']=_[_0xf7ef('0x3a')](_0x4d7577[_0xf7ef('0x3b')],_0x4d7577[_0xf7ef('0x38')]);_0xeacfa7[_0xf7ef('0x3c')]=_['intersection'](_0x4d7577[_0xf7ef('0x3b')],qs[_0xf7ef('0x3d')](_0x4be59f['query'][_0xf7ef('0x3d')]));_0xeacfa7['attributes']=_0xeacfa7[_0xf7ef('0x3c')][_0xf7ef('0x4c')]?_0xeacfa7[_0xf7ef('0x3c')]:_0x4d7577['model'];_0xeacfa7[_0xf7ef('0x3f')]=qs[_0xf7ef('0x40')](_0x4be59f[_0xf7ef('0x38')]['sort']);_0xeacfa7[_0xf7ef('0x41')]=qs['filters'](_['pick'](_0x4be59f[_0xf7ef('0x38')],_0x4d7577[_0xf7ef('0x42')]));if(_0x4be59f[_0xf7ef('0x38')][_0xf7ef('0x43')]){_0xeacfa7[_0xf7ef('0x41')]=_[_0xf7ef('0x45')](_0xeacfa7[_0xf7ef('0x41')],{'$or':_[_0xf7ef('0x32')](_0xeacfa7[_0xf7ef('0x3c')],function(_0xaf7a34){var _0x4aa666={};_0x4aa666[_0xaf7a34]={'$like':'%'+_0x4be59f[_0xf7ef('0x38')][_0xf7ef('0x43')]+'%'};return _0x4aa666;})});}_0xeacfa7=_[_0xf7ef('0x45')]({},_0xeacfa7,_0x4be59f[_0xf7ef('0x46')]);return _0x52a548[_0xf7ef('0xf6')](_0xeacfa7);}})[_0xf7ef('0x17')](function(_0xe5339d){if(_0xe5339d){_0x466a76=_0xe5339d[_0xf7ef('0x4c')];if(!_0x4be59f['query'][_0xf7ef('0x5c')](_0xf7ef('0x3e'))){_0xeacfa7[_0xf7ef('0x27')]=qs['limit'](_0x4be59f['query'][_0xf7ef('0x27')]);_0xeacfa7['offset']=qs[_0xf7ef('0x25')](_0x4be59f[_0xf7ef('0x38')][_0xf7ef('0x25')]);}return _0x52a548[_0xf7ef('0xf6')](_0xeacfa7);}})[_0xf7ef('0x17')](function(_0x50c9f7){if(_0x50c9f7){return _0x50c9f7?{'count':_0x466a76,'rows':_0x50c9f7}:null;}})[_0xf7ef('0x17')](respondWithResult(_0x3ea116,null))[_0xf7ef('0x4a')](handleError(_0x3ea116,null));};exports[_0xf7ef('0x117')]=function(_0x57b0e5,_0x1f8e99){var _0x2b58a1=_0x57b0e5[_0xf7ef('0x38')][_0xf7ef('0x118')]===_0xf7ef('0x119')?_0xf7ef('0x11a'):'onlineForm';return db['ChatWebsite']['find']({'attributes':['id',_0x2b58a1],'where':{'id':_0x57b0e5[_0xf7ef('0x4b')]['id']}})[_0xf7ef('0x17')](handleEntityNotFound(_0x1f8e99,null))['then'](function(_0x47f235){if(_0x47f235){var _0x47ab9c=_0x47f235[_0x2b58a1];var _0x5a0d47=_0x47ab9c&&_0x47ab9c[_0xf7ef('0x11b')]?_0x47ab9c[_0xf7ef('0x11b')]:[];_0x1f8e99[_0xf7ef('0x2f')]({'fromKey':_[_0xf7ef('0x70')](_0x47ab9c['fromKey'])?undefined:_0x47ab9c[_0xf7ef('0x11c')],'count':_0x5a0d47['length'],'rows':_0x5a0d47});}})[_0xf7ef('0x4a')](handleError(_0x1f8e99,null));};exports[_0xf7ef('0x11d')]=function(_0x1517a0,_0x3e152c){var _0x31a6b2={'raw':![],'where':{}};var _0x386703={};var _0x5b5de8={'count':0x0,'rows':[]};return db[_0xf7ef('0x33')][_0xf7ef('0x5b')]({'where':{'id':_0x1517a0[_0xf7ef('0x4b')]['id']}})[_0xf7ef('0x17')](handleEntityNotFound(_0x3e152c,null))[_0xf7ef('0x17')](function(_0xd95aad){if(_0xd95aad){_0x386703[_0xf7ef('0x3b')]=_[_0xf7ef('0x39')](db['ChatOfflineMessage']['rawAttributes']);_0x386703[_0xf7ef('0x38')]=_[_0xf7ef('0x39')](_0x1517a0[_0xf7ef('0x38')]);_0x386703['filters']=_[_0xf7ef('0x3a')](_0x386703['model'],_0x386703[_0xf7ef('0x38')]);_0x31a6b2[_0xf7ef('0x3c')]=_['intersection'](_0x386703[_0xf7ef('0x3b')],qs['fields'](_0x1517a0[_0xf7ef('0x38')][_0xf7ef('0x3d')]));_0x31a6b2['attributes']=_0x31a6b2['attributes'][_0xf7ef('0x4c')]?_0x31a6b2[_0xf7ef('0x3c')]:_0x386703['model'];if(!_0x1517a0[_0xf7ef('0x38')][_0xf7ef('0x5c')](_0xf7ef('0x3e'))){_0x31a6b2['limit']=qs[_0xf7ef('0x27')](_0x1517a0[_0xf7ef('0x38')][_0xf7ef('0x27')]);_0x31a6b2[_0xf7ef('0x25')]=qs[_0xf7ef('0x25')](_0x1517a0[_0xf7ef('0x38')][_0xf7ef('0x25')]);}_0x31a6b2[_0xf7ef('0x3f')]=qs['sort'](_0x1517a0['query'][_0xf7ef('0x40')]);_0x31a6b2[_0xf7ef('0x41')]=qs[_0xf7ef('0x42')](_[_0xf7ef('0x62')](_0x1517a0[_0xf7ef('0x38')],_0x386703[_0xf7ef('0x42')]));_0x31a6b2[_0xf7ef('0x41')][_0xf7ef('0x58')]=_0xd95aad['id'];if(_0x1517a0[_0xf7ef('0x38')][_0xf7ef('0x43')]){_0x31a6b2[_0xf7ef('0x41')]=_[_0xf7ef('0x45')](_0x31a6b2[_0xf7ef('0x41')],{'$or':_[_0xf7ef('0x32')](_0x31a6b2[_0xf7ef('0x3c')],function(_0x3b6685){var _0x37e14d={};_0x37e14d[_0x3b6685]={'$like':'%'+_0x1517a0['query'][_0xf7ef('0x43')]+'%'};return _0x37e14d;})});}_0x31a6b2=_[_0xf7ef('0x45')]({},_0x31a6b2,_0x1517a0[_0xf7ef('0x46')]);return db[_0xf7ef('0xca')][_0xf7ef('0x28')]({'where':_0x31a6b2[_0xf7ef('0x41')]})[_0xf7ef('0x17')](function(_0x31b779){_0x5b5de8[_0xf7ef('0x28')]=_0x31b779;if(_0x1517a0[_0xf7ef('0x38')][_0xf7ef('0x47')]){_0x31a6b2[_0xf7ef('0x48')]=[{'all':!![]}];}else{_0x31a6b2['include']=[{'model':db['CmContact'],'as':_0xf7ef('0xe5'),'required':![]},{'model':db[_0xf7ef('0x11e')],'as':'Attachments','required':![]}];}return db[_0xf7ef('0xca')][_0xf7ef('0x5d')](_0x31a6b2);})[_0xf7ef('0x17')](function(_0x4cebb6){_0x5b5de8[_0xf7ef('0x49')]=_0x4cebb6;return _0x5b5de8;});}})['then'](respondWithFilteredResult(_0x3e152c,_0x31a6b2))['catch'](handleError(_0x3e152c,null));};exports[_0xf7ef('0x11f')]=function(_0x32032b,_0x57d67a){return db['ChatWebsite'][_0xf7ef('0x4d')]({'where':{'id':_0x32032b['params']['id']}})['then'](handleEntityNotFound(_0x57d67a,null))[_0xf7ef('0x17')](function(_0x4f2783){if(_0x4f2783){return _0x4f2783['addAgents'](_0x32032b[_0xf7ef('0x4f')][_0xf7ef('0x5f')],_[_0xf7ef('0xe4')](_0x32032b['body'],[_0xf7ef('0x5f'),'id'])||{})[_0xf7ef('0xb0')](function(_0x47830f){for(var _0x1fb368=0x0;_0x1fb368<_0x32032b[_0xf7ef('0x4f')][_0xf7ef('0x5f')]['length'];_0x1fb368+=0x1){socket[_0xf7ef('0x120')](_0xf7ef('0x121'),{'UserId':Number(_0x32032b['body'][_0xf7ef('0x5f')][_0x1fb368]),'ChatWebsiteId':Number(_0x32032b[_0xf7ef('0x4b')]['id'])});}return _0x47830f;});}})[_0xf7ef('0x17')](respondWithResult(_0x57d67a,null))['catch'](handleError(_0x57d67a,null));};exports[_0xf7ef('0x122')]=function(_0x1481eb,_0x46be0f){return db[_0xf7ef('0x33')]['find']({'where':{'id':_0x1481eb[_0xf7ef('0x4b')]['id']}})['then'](handleEntityNotFound(_0x46be0f,null))[_0xf7ef('0x17')](function(_0x338465){if(_0x338465){return _0x338465[_0xf7ef('0x122')](_0x1481eb[_0xf7ef('0x38')][_0xf7ef('0x5f')])[_0xf7ef('0x17')](function(){if(_[_0xf7ef('0x123')](_0x1481eb[_0xf7ef('0x38')][_0xf7ef('0x5f')])){for(var _0x458f95=0x0;_0x458f95<_0x1481eb['query'][_0xf7ef('0x5f')][_0xf7ef('0x4c')];_0x458f95+=0x1){socket[_0xf7ef('0x120')](_0xf7ef('0x124'),{'UserId':Number(_0x1481eb[_0xf7ef('0x38')][_0xf7ef('0x5f')][_0x458f95]),'ChatWebsiteId':Number(_0x1481eb[_0xf7ef('0x4b')]['id'])});}}else{socket['emit'](_0xf7ef('0x124'),{'UserId':Number(_0x1481eb[_0xf7ef('0x38')][_0xf7ef('0x5f')]),'ChatWebsiteId':Number(_0x1481eb[_0xf7ef('0x4b')]['id'])});}});}})[_0xf7ef('0x17')](respondWithStatusCode(_0x46be0f,null))[_0xf7ef('0x4a')](handleError(_0x46be0f,null));};exports[_0xf7ef('0x125')]=function(_0x45e1c6,_0x555a03){var _0x4940fb={};var _0x857557={};var _0x44ee5e;var _0x107422;return db[_0xf7ef('0x33')][_0xf7ef('0x5b')]({'where':{'id':_0x45e1c6[_0xf7ef('0x4b')]['id']}})[_0xf7ef('0x17')](handleEntityNotFound(_0x555a03,null))['then'](function(_0x5ea3b2){if(_0x5ea3b2){_0x44ee5e=_0x5ea3b2;_0x857557['model']=_['keys'](db[_0xf7ef('0xb7')][_0xf7ef('0x34')]);_0x857557[_0xf7ef('0x38')]=_[_0xf7ef('0x39')](_0x45e1c6['query']);_0x857557['filters']=_[_0xf7ef('0x3a')](_0x857557[_0xf7ef('0x3b')],_0x857557['query']);_0x4940fb['attributes']=_['intersection'](_0x857557[_0xf7ef('0x3b')],qs['fields'](_0x45e1c6[_0xf7ef('0x38')][_0xf7ef('0x3d')]));_0x4940fb[_0xf7ef('0x3c')]=_0x4940fb[_0xf7ef('0x3c')]['length']?_0x4940fb[_0xf7ef('0x3c')]:_0x857557[_0xf7ef('0x3b')];_0x4940fb['order']=qs[_0xf7ef('0x40')](_0x45e1c6['query'][_0xf7ef('0x40')]);_0x4940fb['where']=qs['filters'](_[_0xf7ef('0x62')](_0x45e1c6['query'],_0x857557[_0xf7ef('0x42')]));if(_0x45e1c6[_0xf7ef('0x38')][_0xf7ef('0x43')]){_0x4940fb[_0xf7ef('0x41')]=_[_0xf7ef('0x45')](_0x4940fb[_0xf7ef('0x41')],{'$or':_[_0xf7ef('0x32')](_0x4940fb['attributes'],function(_0x4830e0){var _0x11fd5d={};_0x11fd5d[_0x4830e0]={'$like':'%'+_0x45e1c6[_0xf7ef('0x38')][_0xf7ef('0x43')]+'%'};return _0x11fd5d;})});}_0x4940fb=_[_0xf7ef('0x45')]({},_0x4940fb,_0x45e1c6[_0xf7ef('0x46')]);return _0x44ee5e[_0xf7ef('0x125')](_0x4940fb);}})[_0xf7ef('0x17')](function(_0x1b84e9){if(_0x1b84e9){_0x107422=_0x1b84e9[_0xf7ef('0x4c')];if(!_0x45e1c6[_0xf7ef('0x38')][_0xf7ef('0x5c')](_0xf7ef('0x3e'))){_0x4940fb[_0xf7ef('0x27')]=qs['limit'](_0x45e1c6[_0xf7ef('0x38')][_0xf7ef('0x27')]);_0x4940fb[_0xf7ef('0x25')]=qs[_0xf7ef('0x25')](_0x45e1c6['query']['offset']);}return _0x44ee5e['getAgents'](_0x4940fb);}})[_0xf7ef('0x17')](function(_0x3a895b){if(_0x3a895b){return _0x3a895b?{'count':_0x107422,'rows':_0x3a895b}:null;}})['then'](respondWithResult(_0x555a03,null))[_0xf7ef('0x4a')](handleError(_0x555a03,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 6ff32fc..2f7b983 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 _0x692c=['emit','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save','update'];(function(_0x3c3af2,_0x1f3887){var _0x514875=function(_0x5dbc94){while(--_0x5dbc94){_0x3c3af2['push'](_0x3c3af2['shift']());}};_0x514875(++_0x1f3887);}(_0x692c,0x6a));var _0xc692=function(_0x1be044,_0x8b45c7){_0x1be044=_0x1be044-0x0;var _0x29afeb=_0x692c[_0x1be044];return _0x29afeb;};'use strict';var EventEmitter=require(_0xc692('0x0'));var ChatWebsite=require(_0xc692('0x1'))['db'][_0xc692('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xc692('0x3')](0x0);var events={'afterCreate':_0xc692('0x4'),'afterUpdate':_0xc692('0x5'),'afterDestroy':'remove'};function emitEvent(_0x28de2e){return function(_0x28614b,_0xe1b63b,_0x2096b7){ChatWebsiteEvents[_0xc692('0x6')](_0x28de2e+':'+_0x28614b['id'],_0x28614b);ChatWebsiteEvents[_0xc692('0x6')](_0x28de2e,_0x28614b);_0x2096b7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0xc692('0x7')]=ChatWebsiteEvents; \ No newline at end of file +var _0xf14b=['exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x4abcf8,_0x4191de){var _0x86ef7c=function(_0x430998){while(--_0x430998){_0x4abcf8['push'](_0x4abcf8['shift']());}};_0x86ef7c(++_0x4191de);}(_0xf14b,0xdd));var _0xbf14=function(_0x520552,_0x568c01){_0x520552=_0x520552-0x0;var _0x545f39=_0xf14b[_0x520552];return _0x545f39;};'use strict';var EventEmitter=require(_0xbf14('0x0'));var ChatWebsite=require(_0xbf14('0x1'))['db'][_0xbf14('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xbf14('0x3')](0x0);var events={'afterCreate':_0xbf14('0x4'),'afterUpdate':_0xbf14('0x5'),'afterDestroy':_0xbf14('0x6')};function emitEvent(_0x933794){return function(_0x1c9f49,_0x3afb15,_0x52d8f7){ChatWebsiteEvents[_0xbf14('0x7')](_0x933794+':'+_0x1c9f49['id'],_0x1c9f49);ChatWebsiteEvents[_0xbf14('0x7')](_0x933794,_0x1c9f49);_0x52d8f7(null);};}for(var e in events){if(events[_0xbf14('0x8')](e)){var event=events[e];ChatWebsite[_0xbf14('0x9')](e,emitEvent(event));}}module[_0xbf14('0xa')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 556c301..b5385d1 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 _0x9fb9=['./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','util','moment','path','rimraf'];(function(_0xfbd5f7,_0x31df8d){var _0x2b4daf=function(_0x1b23a1){while(--_0x1b23a1){_0xfbd5f7['push'](_0xfbd5f7['shift']());}};_0x2b4daf(++_0x31df8d);}(_0x9fb9,0x1b3));var _0x99fb=function(_0x43528d,_0x27aebf){_0x43528d=_0x43528d-0x0;var _0x854c29=_0x9fb9[_0x43528d];return _0x854c29;};'use strict';var _=require(_0x99fb('0x0'));var util=require(_0x99fb('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x99fb('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x99fb('0x3'));var rimraf=require(_0x99fb('0x4'));var config=require('../../config/environment');var attributes=require(_0x99fb('0x5'));module[_0x99fb('0x6')]=function(_0x4f6bc4,_0x2c9223){return _0x4f6bc4[_0x99fb('0x7')](_0x99fb('0x8'),attributes,{'tableName':_0x99fb('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x94d0=['bluebird','request-promise','path','./chatWebsite.attributes','ChatWebsite','chat_websites','lodash','util','../../config/logger','api','moment'];(function(_0x4e658c,_0x3139a5){var _0x3a2973=function(_0x479a80){while(--_0x479a80){_0x4e658c['push'](_0x4e658c['shift']());}};_0x3a2973(++_0x3139a5);}(_0x94d0,0x119));var _0x094d=function(_0x14e341,_0x6198eb){_0x14e341=_0x14e341-0x0;var _0x1a5060=_0x94d0[_0x14e341];return _0x1a5060;};'use strict';var _=require(_0x094d('0x0'));var util=require(_0x094d('0x1'));var logger=require(_0x094d('0x2'))(_0x094d('0x3'));var moment=require(_0x094d('0x4'));var BPromise=require(_0x094d('0x5'));var rp=require(_0x094d('0x6'));var fs=require('fs');var path=require(_0x094d('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x094d('0x8'));module['exports']=function(_0x166b7c,_0x27b8ec){return _0x166b7c['define'](_0x094d('0x9'),attributes,{'tableName':_0x094d('0xa'),'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 6c09f65..450ee60 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 _0x1182=['request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','localhost','socket.io-emitter','./chatWebsite.socket','register','then','ChatWebsite,\x20%s,\x20%s'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0x1182,0x1ef));var _0x2118=function(_0x3d6989,_0xae1e80){_0x3d6989=_0x3d6989-0x0;var _0x55ff42=_0x1182[_0x3d6989];return _0x55ff42;};'use strict';var _=require(_0x2118('0x0'));var util=require(_0x2118('0x1'));var moment=require(_0x2118('0x2'));var BPromise=require(_0x2118('0x3'));var rs=require(_0x2118('0x4'));var fs=require('fs');var Redis=require(_0x2118('0x5'));var db=require(_0x2118('0x6'))['db'];var utils=require(_0x2118('0x7'));var logger=require(_0x2118('0x8'))(_0x2118('0x9'));var config=require('../../config/environment');var jayson=require(_0x2118('0xa'));var client=jayson['client'][_0x2118('0xb')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x2118('0xc'),'port':0x18eb});var socket=require(_0x2118('0xd'))(new Redis(config['redis']));require(_0x2118('0xe'))[_0x2118('0xf')](socket);function respondWithRpcPromise(_0x519a44,_0x423edc,_0x41031b){return new BPromise(function(_0x594660,_0x5ac7cb){return client['request'](_0x519a44,_0x41031b)[_0x2118('0x10')](function(_0x511116){logger['info'](_0x2118('0x11'),_0x423edc,_0x2118('0x12'));logger[_0x2118('0x13')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x423edc,_0x2118('0x12'),JSON[_0x2118('0x14')](_0x511116));if(_0x511116['error']){if(_0x511116[_0x2118('0x15')][_0x2118('0x16')]===0x1f4){logger[_0x2118('0x15')](_0x2118('0x11'),_0x423edc,_0x511116[_0x2118('0x15')][_0x2118('0x17')]);return _0x5ac7cb(_0x511116[_0x2118('0x15')][_0x2118('0x17')]);}logger[_0x2118('0x15')](_0x2118('0x11'),_0x423edc,_0x511116['error'][_0x2118('0x17')]);return _0x594660(_0x511116[_0x2118('0x15')]['message']);}else{logger[_0x2118('0x18')](_0x2118('0x11'),_0x423edc,_0x2118('0x12'));_0x594660(_0x511116[_0x2118('0x19')][_0x2118('0x17')]);}})[_0x2118('0x1a')](function(_0x28ae49){logger[_0x2118('0x15')](_0x2118('0x11'),_0x423edc,_0x28ae49);_0x5ac7cb(_0x28ae49);});});} \ No newline at end of file +var _0xaa15=['ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./chatWebsite.socket','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent'];(function(_0x4a9fb8,_0x35dcbe){var _0x28ebcc=function(_0x5645dc){while(--_0x5645dc){_0x4a9fb8['push'](_0x4a9fb8['shift']());}};_0x28ebcc(++_0x35dcbe);}(_0xaa15,0x1c8));var _0x5aa1=function(_0x3a474d,_0x38e952){_0x3a474d=_0x3a474d-0x0;var _0x1bb5bb=_0xaa15[_0x3a474d];return _0x1bb5bb;};'use strict';var _=require(_0x5aa1('0x0'));var util=require('util');var moment=require(_0x5aa1('0x1'));var BPromise=require(_0x5aa1('0x2'));var rs=require(_0x5aa1('0x3'));var fs=require('fs');var Redis=require(_0x5aa1('0x4'));var db=require(_0x5aa1('0x5'))['db'];var utils=require(_0x5aa1('0x6'));var logger=require('../../config/logger')(_0x5aa1('0x7'));var config=require(_0x5aa1('0x8'));var jayson=require(_0x5aa1('0x9'));var client=jayson[_0x5aa1('0xa')][_0x5aa1('0xb')]({'port':0x232a});config[_0x5aa1('0xc')]=_['defaults'](config[_0x5aa1('0xc')],{'host':_0x5aa1('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5aa1('0xc')]));require(_0x5aa1('0xe'))['register'](socket);function respondWithRpcPromise(_0x23fda0,_0x1dee2d,_0x503be2){return new BPromise(function(_0x138c4b,_0x4e8082){return client['request'](_0x23fda0,_0x503be2)[_0x5aa1('0xf')](function(_0x58ed4c){logger[_0x5aa1('0x10')](_0x5aa1('0x11'),_0x1dee2d,_0x5aa1('0x12'));logger['debug'](_0x5aa1('0x13'),_0x1dee2d,'request\x20sent',JSON[_0x5aa1('0x14')](_0x58ed4c));if(_0x58ed4c[_0x5aa1('0x15')]){if(_0x58ed4c[_0x5aa1('0x15')][_0x5aa1('0x16')]===0x1f4){logger[_0x5aa1('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x1dee2d,_0x58ed4c['error'][_0x5aa1('0x17')]);return _0x4e8082(_0x58ed4c['error']['message']);}logger['error'](_0x5aa1('0x11'),_0x1dee2d,_0x58ed4c[_0x5aa1('0x15')][_0x5aa1('0x17')]);return _0x138c4b(_0x58ed4c[_0x5aa1('0x15')][_0x5aa1('0x17')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x1dee2d,_0x5aa1('0x12'));_0x138c4b(_0x58ed4c[_0x5aa1('0x18')][_0x5aa1('0x17')]);}})['catch'](function(_0x343b81){logger[_0x5aa1('0x15')](_0x5aa1('0x11'),_0x1dee2d,_0x343b81);_0x4e8082(_0x343b81);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index a97a7fa..dc86bba 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 _0xfb47=['save','update','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events'];(function(_0x5ad24b,_0x590442){var _0x47b743=function(_0x927b97){while(--_0x927b97){_0x5ad24b['push'](_0x5ad24b['shift']());}};_0x47b743(++_0x590442);}(_0xfb47,0x197));var _0x7fb4=function(_0xda7dbd,_0xdda90d){_0xda7dbd=_0xda7dbd-0x0;var _0x4fb238=_0xfb47[_0xda7dbd];return _0x4fb238;};'use strict';var ChatWebsiteEvents=require(_0x7fb4('0x0'));var events=[_0x7fb4('0x1'),'remove',_0x7fb4('0x2')];function createListener(_0x2ab447,_0x4e5ed9){return function(_0x86f8fa){_0x4e5ed9[_0x7fb4('0x3')](_0x2ab447,_0x86f8fa);};}function removeListener(_0x167ade,_0x3b00c7){return function(){ChatWebsiteEvents[_0x7fb4('0x4')](_0x167ade,_0x3b00c7);};}exports[_0x7fb4('0x5')]=function(_0x450a55){for(var _0x34d609=0x0,_0x57e0b5=events[_0x7fb4('0x6')];_0x34d609<_0x57e0b5;_0x34d609++){var _0x503861=events[_0x34d609];var _0x104e15=createListener(_0x7fb4('0x7')+_0x503861,_0x450a55);ChatWebsiteEvents['on'](_0x503861,_0x104e15);}}; \ No newline at end of file +var _0x61c4=['length','./chatWebsite.events','save','remove','emit'];(function(_0x31e4c6,_0x27d39c){var _0x56c225=function(_0x54fb1a){while(--_0x54fb1a){_0x31e4c6['push'](_0x31e4c6['shift']());}};_0x56c225(++_0x27d39c);}(_0x61c4,0xc9));var _0x461c=function(_0x394795,_0x25d1bd){_0x394795=_0x394795-0x0;var _0x534f6e=_0x61c4[_0x394795];return _0x534f6e;};'use strict';var ChatWebsiteEvents=require(_0x461c('0x0'));var events=[_0x461c('0x1'),_0x461c('0x2'),'update'];function createListener(_0x4f7cf3,_0x2af67b){return function(_0x296557){_0x2af67b[_0x461c('0x3')](_0x4f7cf3,_0x296557);};}function removeListener(_0x40e190,_0x1ead38){return function(){ChatWebsiteEvents['removeListener'](_0x40e190,_0x1ead38);};}exports['register']=function(_0x1805e8){for(var _0x41c2dc=0x0,_0x4987f3=events[_0x461c('0x4')];_0x41c2dc<_0x4987f3;_0x41c2dc++){var _0x31981a=events[_0x41c2dc];var _0x54af67=createListener('chatWebsite:'+_0x31981a,_0x1805e8);ChatWebsiteEvents['on'](_0x31981a,_0x54af67);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 8b2c00d..837c3ad 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 _0x26ff=['delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','index','/describe','describe','get','/:id','isAuthenticated','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/logo','getLogo','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','getSnippet','/:id/applications','/:id/proactive_actions','getProactiveActions','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','create','addDisposition','post','diskStorage','join','root','server/files/images/logos/','format','%s-%s','originalname','single','file','addLogo','server/files/images/avatars/','addAvatar','now','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','attachments','offline-chat','extname','replace','/:id/offline','any','offline','addApplications','addProactiveActions','addAgents','put','update','destroy'];(function(_0x277a18,_0x2a8811){var _0x38bf54=function(_0xfcb0d9){while(--_0xfcb0d9){_0x277a18['push'](_0x277a18['shift']());}};_0x38bf54(++_0x2a8811);}(_0x26ff,0x186));var _0xf26f=function(_0x2d077c,_0x8f68d9){_0x2d077c=_0x2d077c-0x0;var _0x32956d=_0x26ff[_0x2d077c];return _0x32956d;};'use strict';var multer=require(_0xf26f('0x0'));var util=require(_0xf26f('0x1'));var path=require(_0xf26f('0x2'));var timeout=require(_0xf26f('0x3'));var express=require(_0xf26f('0x4'));var router=express[_0xf26f('0x5')]();var fs_extra=require(_0xf26f('0x6'));var auth=require(_0xf26f('0x7'));var interaction=require(_0xf26f('0x8'));var config=require(_0xf26f('0x9'));var controller=require(_0xf26f('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0xf26f('0xb')]);router['get'](_0xf26f('0xc'),auth['isAuthenticated'](),controller[_0xf26f('0xd')]);router[_0xf26f('0xe')](_0xf26f('0xf'),auth[_0xf26f('0x10')](),controller[_0xf26f('0x11')]);router[_0xf26f('0xe')](_0xf26f('0x12'),auth['isAuthenticated'](),controller[_0xf26f('0x13')]);router[_0xf26f('0xe')](_0xf26f('0x14'),auth[_0xf26f('0x10')](),controller['getAnswers']);router[_0xf26f('0xe')](_0xf26f('0x15'),controller[_0xf26f('0x16')]);router[_0xf26f('0xe')](_0xf26f('0x17'),controller['getAvatar']);router['get'](_0xf26f('0x18'),controller[_0xf26f('0x19')]);router[_0xf26f('0xe')](_0xf26f('0x1a'),controller[_0xf26f('0x1b')]);router[_0xf26f('0xe')](_0xf26f('0x1c'),auth[_0xf26f('0x10')](),controller[_0xf26f('0x1d')]);router[_0xf26f('0xe')]('/:id/snippet',controller[_0xf26f('0x1e')]);router[_0xf26f('0xe')](_0xf26f('0x1f'),auth['isAuthenticated'](),controller['getApplications']);router[_0xf26f('0xe')](_0xf26f('0x20'),auth[_0xf26f('0x10')](),controller[_0xf26f('0x21')]);router[_0xf26f('0xe')]('/:id/fields',controller[_0xf26f('0x22')]);router[_0xf26f('0xe')](_0xf26f('0x23'),auth[_0xf26f('0x10')](),controller[_0xf26f('0x24')]);router[_0xf26f('0xe')](_0xf26f('0x25'),auth[_0xf26f('0x10')](),controller[_0xf26f('0x26')]);router['post']('/',auth[_0xf26f('0x10')](),controller[_0xf26f('0x27')]);router['post'](_0xf26f('0x12'),auth[_0xf26f('0x10')](),controller[_0xf26f('0x28')]);router[_0xf26f('0x29')]('/:id/canned_answers',auth['isAuthenticated'](),controller['addAnswer']);var upload=multer({'storage':multer[_0xf26f('0x2a')]({'destination':function(_0x12c9d3,_0x3f5e4d,_0x4608ea){_0x4608ea(null,path[_0xf26f('0x2b')](config[_0xf26f('0x2c')],_0xf26f('0x2d')));},'filename':function(_0x2dcc73,_0x9e8d78,_0x47dc60){_0x47dc60(null,util[_0xf26f('0x2e')](_0xf26f('0x2f'),Date['now'](),_0x9e8d78[_0xf26f('0x30')]));}})});router[_0xf26f('0x29')](_0xf26f('0x15'),upload[_0xf26f('0x31')](_0xf26f('0x32')),controller[_0xf26f('0x33')]);var upload=multer({'storage':multer[_0xf26f('0x2a')]({'destination':function(_0x50836f,_0x2e294c,_0x3056b2){_0x3056b2(null,path['join'](config[_0xf26f('0x2c')],_0xf26f('0x34')));},'filename':function(_0x3bc80a,_0x46a0fa,_0x40e9dd){_0x40e9dd(null,util['format'](_0xf26f('0x2f'),Date['now'](),_0x46a0fa[_0xf26f('0x30')]));}})});router['post'](_0xf26f('0x17'),upload[_0xf26f('0x31')]('file'),controller[_0xf26f('0x35')]);var upload=multer({'storage':multer[_0xf26f('0x2a')]({'destination':function(_0x36b4e8,_0x57ff93,_0x251d97){_0x251d97(null,path[_0xf26f('0x2b')](config['root'],_0xf26f('0x34')));},'filename':function(_0x4d5c1d,_0x19afbb,_0x57c59f){_0x57c59f(null,util['format'](_0xf26f('0x2f'),Date[_0xf26f('0x36')](),_0x19afbb['originalname']));}})});router['post'](_0xf26f('0x18'),upload['single'](_0xf26f('0x32')),controller[_0xf26f('0x37')]);var upload=multer({'storage':multer[_0xf26f('0x2a')]({'destination':function(_0x2fac63,_0xe5f215,_0x11d9a3){_0x11d9a3(null,path[_0xf26f('0x2b')](config[_0xf26f('0x2c')],_0xf26f('0x34')));},'filename':function(_0x1b9c80,_0x34eb27,_0xb5ebd8){_0xb5ebd8(null,util['format'](_0xf26f('0x2f'),Date[_0xf26f('0x36')](),_0x34eb27['originalname']));}})});router[_0xf26f('0x29')]('/:id/system_avatar',upload[_0xf26f('0x31')](_0xf26f('0x32')),controller[_0xf26f('0x38')]);router[_0xf26f('0x29')](_0xf26f('0x39'),controller[_0xf26f('0x3a')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x46bd9f,_0x4f7b0d,_0xe99f90){const _0x40488a=path[_0xf26f('0x2b')](config[_0xf26f('0x2c')],'server/files',_0xf26f('0x3b'),_0xf26f('0x3c'));fs_extra['ensureDir'](_0x40488a,function(){_0xe99f90(null,_0x40488a);});},'filename':function(_0xcc1d02,_0x4cc6da,_0x1f6d57){const _0x46d0a7=_0x4cc6da['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x371d8d=path[_0xf26f('0x3d')](_0x46d0a7);const _0x2e7201=Date[_0xf26f('0x36')]()+'-'+_0x46d0a7[_0xf26f('0x3e')](_0x371d8d,'')+_0x371d8d;_0x1f6d57(null,_0x2e7201);}})});router[_0xf26f('0x29')](_0xf26f('0x3f'),offlineUploadMulter[_0xf26f('0x40')](),controller[_0xf26f('0x41')]);router[_0xf26f('0x29')](_0xf26f('0x1c'),auth[_0xf26f('0x10')](),controller['addInteraction']);router[_0xf26f('0x29')](_0xf26f('0x1f'),auth[_0xf26f('0x10')](),controller[_0xf26f('0x42')]);router[_0xf26f('0x29')]('/:id/proactive_actions',auth[_0xf26f('0x10')](),controller[_0xf26f('0x43')]);router[_0xf26f('0x29')](_0xf26f('0x25'),auth[_0xf26f('0x10')](),controller[_0xf26f('0x44')]);router[_0xf26f('0x45')](_0xf26f('0xf'),auth[_0xf26f('0x10')](),controller[_0xf26f('0x46')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xf26f('0x47')]);router[_0xf26f('0x48')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xf26f('0x49')]);router['delete'](_0xf26f('0x14'),auth[_0xf26f('0x10')](),controller[_0xf26f('0x4a')]);router[_0xf26f('0x48')](_0xf26f('0x25'),auth['isAuthenticated'](),controller[_0xf26f('0x4b')]);module[_0xf26f('0x4c')]=router; \ No newline at end of file +var _0x0ac5=['addDisposition','addAnswer','join','root','server/files/images/logos/','format','now','originalname','single','file','server/files/images/avatars/','addAvatar','diskStorage','%s-%s','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','notify','offline-chat','ensureDir','replace','offline','addInteraction','/:id/applications','addApplications','addProactiveActions','addAgents','put','delete','destroy','removeAnswers','/:id/users','removeAgents','exports','multer','util','connect-timeout','express','fs-extra','../../config/environment','./chatWebsite.controller','index','get','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','/:id/avatar','getAvatar','/:id/customer_avatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','getAgents','post'];(function(_0x20d65e,_0x225482){var _0xdd7ffa=function(_0x33de13){while(--_0x33de13){_0x20d65e['push'](_0x20d65e['shift']());}};_0xdd7ffa(++_0x225482);}(_0x0ac5,0x1c0));var _0x50ac=function(_0x41f078,_0x11acc2){_0x41f078=_0x41f078-0x0;var _0x30a854=_0x0ac5[_0x41f078];return _0x30a854;};'use strict';var multer=require(_0x50ac('0x0'));var util=require(_0x50ac('0x1'));var path=require('path');var timeout=require(_0x50ac('0x2'));var express=require(_0x50ac('0x3'));var router=express['Router']();var fs_extra=require(_0x50ac('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x50ac('0x5'));var controller=require(_0x50ac('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x50ac('0x7')]);router[_0x50ac('0x8')](_0x50ac('0x9'),auth[_0x50ac('0xa')](),controller[_0x50ac('0xb')]);router[_0x50ac('0x8')](_0x50ac('0xc'),auth[_0x50ac('0xa')](),controller[_0x50ac('0xd')]);router['get'](_0x50ac('0xe'),auth[_0x50ac('0xa')](),controller[_0x50ac('0xf')]);router['get'](_0x50ac('0x10'),auth[_0x50ac('0xa')](),controller[_0x50ac('0x11')]);router[_0x50ac('0x8')](_0x50ac('0x12'),controller['getLogo']);router['get'](_0x50ac('0x13'),controller[_0x50ac('0x14')]);router[_0x50ac('0x8')](_0x50ac('0x15'),controller['getCustomerAvatar']);router['get']('/:id/system_avatar',controller['getSystemAvatar']);router[_0x50ac('0x8')](_0x50ac('0x16'),auth[_0x50ac('0xa')](),controller[_0x50ac('0x17')]);router['get'](_0x50ac('0x18'),controller[_0x50ac('0x19')]);router[_0x50ac('0x8')]('/:id/applications',auth[_0x50ac('0xa')](),controller[_0x50ac('0x1a')]);router[_0x50ac('0x8')](_0x50ac('0x1b'),auth[_0x50ac('0xa')](),controller[_0x50ac('0x1c')]);router['get'](_0x50ac('0x1d'),controller[_0x50ac('0x1e')]);router[_0x50ac('0x8')](_0x50ac('0x1f'),auth[_0x50ac('0xa')](),controller[_0x50ac('0x20')]);router[_0x50ac('0x8')]('/:id/users',auth[_0x50ac('0xa')](),controller[_0x50ac('0x21')]);router[_0x50ac('0x22')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/dispositions',auth['isAuthenticated'](),controller[_0x50ac('0x23')]);router[_0x50ac('0x22')]('/:id/canned_answers',auth[_0x50ac('0xa')](),controller[_0x50ac('0x24')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x10fcc2,_0x6ca358,_0xdf52f6){_0xdf52f6(null,path[_0x50ac('0x25')](config[_0x50ac('0x26')],_0x50ac('0x27')));},'filename':function(_0x42f22f,_0x3e73d1,_0x1060fc){_0x1060fc(null,util[_0x50ac('0x28')]('%s-%s',Date[_0x50ac('0x29')](),_0x3e73d1[_0x50ac('0x2a')]));}})});router['post'](_0x50ac('0x12'),upload[_0x50ac('0x2b')](_0x50ac('0x2c')),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1ed220,_0x1ab71,_0x5bad84){_0x5bad84(null,path['join'](config[_0x50ac('0x26')],_0x50ac('0x2d')));},'filename':function(_0x3ad103,_0x3da2ed,_0x2a3450){_0x2a3450(null,util[_0x50ac('0x28')]('%s-%s',Date['now'](),_0x3da2ed[_0x50ac('0x2a')]));}})});router[_0x50ac('0x22')](_0x50ac('0x13'),upload[_0x50ac('0x2b')](_0x50ac('0x2c')),controller[_0x50ac('0x2e')]);var upload=multer({'storage':multer[_0x50ac('0x2f')]({'destination':function(_0x568978,_0x2fc45c,_0x10753d){_0x10753d(null,path[_0x50ac('0x25')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x57615f,_0x5ca625,_0x3cd3a3){_0x3cd3a3(null,util[_0x50ac('0x28')](_0x50ac('0x30'),Date[_0x50ac('0x29')](),_0x5ca625['originalname']));}})});router['post'](_0x50ac('0x15'),upload['single']('file'),controller[_0x50ac('0x31')]);var upload=multer({'storage':multer[_0x50ac('0x2f')]({'destination':function(_0x487b30,_0x556d30,_0x4a1ab1){_0x4a1ab1(null,path['join'](config['root'],_0x50ac('0x2d')));},'filename':function(_0x31e7fc,_0x3bb8aa,_0x1ffcd2){_0x1ffcd2(null,util[_0x50ac('0x28')](_0x50ac('0x30'),Date[_0x50ac('0x29')](),_0x3bb8aa['originalname']));}})});router['post'](_0x50ac('0x32'),upload[_0x50ac('0x2b')](_0x50ac('0x2c')),controller[_0x50ac('0x33')]);router[_0x50ac('0x22')]('/:id/notify',controller[_0x50ac('0x34')]);const offlineUploadMulter=multer({'storage':multer[_0x50ac('0x2f')]({'destination':function(_0x128a05,_0x45d809,_0x1cd70b){const _0x151f69=path[_0x50ac('0x25')](config[_0x50ac('0x26')],'server/files','attachments',_0x50ac('0x35'));fs_extra[_0x50ac('0x36')](_0x151f69,function(){_0x1cd70b(null,_0x151f69);});},'filename':function(_0x4e6fb1,_0x195266,_0x15ac1e){const _0x4d3fb4=_0x195266['originalname'][_0x50ac('0x37')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x16805b=path['extname'](_0x4d3fb4);const _0x309a41=Date[_0x50ac('0x29')]()+'-'+_0x4d3fb4[_0x50ac('0x37')](_0x16805b,'')+_0x16805b;_0x15ac1e(null,_0x309a41);}})});router[_0x50ac('0x22')]('/:id/offline',offlineUploadMulter['any'](),controller[_0x50ac('0x38')]);router[_0x50ac('0x22')](_0x50ac('0x16'),auth[_0x50ac('0xa')](),controller[_0x50ac('0x39')]);router[_0x50ac('0x22')](_0x50ac('0x3a'),auth[_0x50ac('0xa')](),controller[_0x50ac('0x3b')]);router['post'](_0x50ac('0x1b'),auth[_0x50ac('0xa')](),controller[_0x50ac('0x3c')]);router[_0x50ac('0x22')]('/:id/users',auth[_0x50ac('0xa')](),controller[_0x50ac('0x3d')]);router[_0x50ac('0x3e')]('/:id',auth[_0x50ac('0xa')](),controller['update']);router[_0x50ac('0x3f')]('/:id',auth[_0x50ac('0xa')](),controller[_0x50ac('0x40')]);router[_0x50ac('0x3f')](_0x50ac('0xe'),auth[_0x50ac('0xa')](),controller['removeDispositions']);router[_0x50ac('0x3f')](_0x50ac('0x10'),auth[_0x50ac('0xa')](),controller[_0x50ac('0x41')]);router[_0x50ac('0x3f')](_0x50ac('0x42'),auth[_0x50ac('0xa')](),controller[_0x50ac('0x43')]);module[_0x50ac('0x44')]=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index 9719d34..7f5d95b 100644 --- a/server/api/client-side-logs.js +++ b/server/api/client-side-logs.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3927=['use','isAuthenticated','exports','beaver-logger/server','express','Router','env','production','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint'];(function(_0xf75894,_0x1a456a){var _0x362a66=function(_0x3d6023){while(--_0x3d6023){_0xf75894['push'](_0xf75894['shift']());}};_0x362a66(++_0x1a456a);}(_0x3927,0x92));var _0x7392=function(_0x8de8dd,_0x30e1b4){_0x8de8dd=_0x8de8dd-0x0;var _0x596169=_0x3927[_0x8de8dd];return _0x596169;};var beaverLogger=require(_0x7392('0x0'));var express=require(_0x7392('0x1'));var auth=require('../components/auth/service');var config=require('../config/environment');var router=express[_0x7392('0x2')]();var isProduction=config[_0x7392('0x3')]===_0x7392('0x4')||![];function clientSideLogs(_0x517073,_0x5c17a2,_0x17d968){var _0x2bfd55=_0x517073['app']['get'](_0x7392('0x5'));if(!_0x2bfd55){throw new Error(_0x7392('0x6'));}return beaverLogger[_0x7392('0x7')]({'uri':'/client-logs','logger':_0x2bfd55,'enableCors':!isProduction})(_0x517073,_0x5c17a2,_0x17d968);}router[_0x7392('0x8')](auth[_0x7392('0x9')](),clientSideLogs);module[_0x7392('0xa')]=router; \ No newline at end of file +var _0x26de=['../components/auth/service','../config/environment','Router','env','production','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','exports','beaver-logger/server','express'];(function(_0xc79e9b,_0x55e810){var _0x3d5758=function(_0x500024){while(--_0x500024){_0xc79e9b['push'](_0xc79e9b['shift']());}};_0x3d5758(++_0x55e810);}(_0x26de,0x194));var _0xe26d=function(_0x10cd80,_0xc03c52){_0x10cd80=_0x10cd80-0x0;var _0x29b601=_0x26de[_0x10cd80];return _0x29b601;};var beaverLogger=require(_0xe26d('0x0'));var express=require(_0xe26d('0x1'));var auth=require(_0xe26d('0x2'));var config=require(_0xe26d('0x3'));var router=express[_0xe26d('0x4')]();var isProduction=config[_0xe26d('0x5')]===_0xe26d('0x6')||![];function clientSideLogs(_0x513e1d,_0x24389c,_0x2aae53){var _0x10d72d=_0x513e1d['app'][_0xe26d('0x7')](_0xe26d('0x8'));if(!_0x10d72d){throw new Error(_0xe26d('0x9'));}return beaverLogger[_0xe26d('0xa')]({'uri':_0xe26d('0xb'),'logger':_0x10d72d,'enableCors':!isProduction})(_0x513e1d,_0x24389c,_0x2aae53);}router[_0xe26d('0xc')](auth['isAuthenticated'](),clientSideLogs);module[_0xe26d('0xd')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index a04566b..32c456f 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 _0xf512=['sequelize','exports','STRING','ENUM','AmazonAWS','Google','MicrosoftAzure','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'];(function(_0x1cc3e1,_0x6e2d4c){var _0x2fd7f9=function(_0x1c819e){while(--_0x1c819e){_0x1cc3e1['push'](_0x1cc3e1['shift']());}};_0x2fd7f9(++_0x6e2d4c);}(_0xf512,0x7e));var _0x2f51=function(_0x39928c,_0x5cd489){_0x39928c=_0x39928c-0x0;var _0x4a02ad=_0xf512[_0x39928c];return _0x4a02ad;};'use strict';var Sequelize=require(_0x2f51('0x0'));module[_0x2f51('0x1')]={'name':{'type':Sequelize[_0x2f51('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x2f51('0x3')](_0x2f51('0x4'),_0x2f51('0x5'),_0x2f51('0x6')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x2f51('0x3')]('Outlook365','Dynamics365')},'data1':{'type':Sequelize[_0x2f51('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize['STRING'],'comment':_0x2f51('0x7')},'data3':{'type':Sequelize[_0x2f51('0x2')],'comment':_0x2f51('0x8')},'data4':{'type':Sequelize['STRING'],'comment':_0x2f51('0x9')},'data5':{'type':Sequelize[_0x2f51('0xa')],'comment':_0x2f51('0xb')},'data6':{'type':Sequelize[_0x2f51('0xa')],'comment':_0x2f51('0xc')},'data7':{'type':Sequelize[_0x2f51('0xa')],'comment':_0x2f51('0xd')}}; \ No newline at end of file +var _0x1d0e=['Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','MicrosoftAzure\x20=>\x20access_token','TEXT','sequelize','exports','STRING','ENUM','AmazonAWS','Google','MicrosoftAzure'];(function(_0x2c4805,_0x5145b6){var _0x454e7e=function(_0x32459c){while(--_0x32459c){_0x2c4805['push'](_0x2c4805['shift']());}};_0x454e7e(++_0x5145b6);}(_0x1d0e,0x1d5));var _0xe1d0=function(_0x119a60,_0x2ba44a){_0x119a60=_0x119a60-0x0;var _0x529763=_0x1d0e[_0x119a60];return _0x529763;};'use strict';var Sequelize=require(_0xe1d0('0x0'));module[_0xe1d0('0x1')]={'name':{'type':Sequelize[_0xe1d0('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xe1d0('0x3')](_0xe1d0('0x4'),_0xe1d0('0x5'),_0xe1d0('0x6')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xe1d0('0x3')]('Outlook365',_0xe1d0('0x7'))},'data1':{'type':Sequelize['STRING'],'comment':_0xe1d0('0x8')},'data2':{'type':Sequelize['STRING'],'comment':_0xe1d0('0x9')},'data3':{'type':Sequelize['STRING'],'comment':_0xe1d0('0xa')},'data4':{'type':Sequelize[_0xe1d0('0x2')],'comment':_0xe1d0('0xb')},'data5':{'type':Sequelize['TEXT'],'comment':_0xe1d0('0xc')},'data6':{'type':Sequelize[_0xe1d0('0xd')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0xe1d0('0xd')],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index b2df90b..630fe08 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 _0xc40f=['../../config/logger','api','../../mysqldb','defaults','redis','localhost','end','json','offset','undefined','limit','count','status','set','update','destroy','then','sendStatus','error','name','send','padEnd','slice','index','CloudProvider','rawAttributes','type','key','map','query','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','include','findAll','rows','service','MicrosoftAzure','decryptString','data3','keys','includeAll','options','find','create','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','body','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','params','catch','generateMicrosoftAuthorizationUrl','user','state','Invalid\x20state\x20parameter','from','base64','toString','parse','id_token','Unable\x20to\x20validate\x20id_token','del','code','data5','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','ioredis','../../components/encryptor','../../config/environment'];(function(_0x5dfec3,_0x4fdec7){var _0x2249ba=function(_0x683452){while(--_0x683452){_0x5dfec3['push'](_0x5dfec3['shift']());}};_0x2249ba(++_0x4fdec7);}(_0xc40f,0xad));var _0xfc40=function(_0x24f2ca,_0x4e4b65){_0x24f2ca=_0x24f2ca-0x0;var _0x2f6646=_0xc40f[_0x24f2ca];return _0x2f6646;};'use strict';var _=require('lodash');var Redis=require(_0xfc40('0x0'));var qs=require('../../components/parsers/qs');var encryptor=require(_0xfc40('0x1'));var config=require(_0xfc40('0x2'));var logger=require(_0xfc40('0x3'))(_0xfc40('0x4'));var db=require(_0xfc40('0x5'))['db'];var oauth=require('./cloudProvider.oauth');config['redis']=_[_0xfc40('0x6')](config[_0xfc40('0x7')],{'host':_0xfc40('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfc40('0x7')]));var redis=new Redis(config[_0xfc40('0x7')]);function respondWithStatusCode(_0x41273a,_0x13ec3d){_0x13ec3d=_0x13ec3d||0xcc;return function(_0x37392e){if(_0x37392e){return _0x41273a['sendStatus'](_0x13ec3d);}return _0x41273a['status'](_0x13ec3d)[_0xfc40('0x9')]();};}function respondWithResult(_0x3a2286,_0x38dbf0){_0x38dbf0=_0x38dbf0||0xc8;return function(_0x1cc7c4){if(_0x1cc7c4){return _0x3a2286['status'](_0x38dbf0)[_0xfc40('0xa')](_0x1cc7c4);}};}function respondWithFilteredResult(_0x1fce85,_0x307bfd){return function(_0x16f449){if(_0x16f449){var _0x3d691d=typeof _0x307bfd[_0xfc40('0xb')]===_0xfc40('0xc')&&typeof _0x307bfd[_0xfc40('0xd')]===_0xfc40('0xc');var _0x5346a3=_0x16f449[_0xfc40('0xe')];var _0x4b1b0c=_0x3d691d?0x0:_0x307bfd[_0xfc40('0xb')];var _0x5accab=_0x3d691d?_0x16f449['count']:_0x307bfd[_0xfc40('0xb')]+_0x307bfd[_0xfc40('0xd')];var _0x1ba8a7;if(_0x5accab>=_0x5346a3){_0x5accab=_0x5346a3;_0x1ba8a7=0xc8;}else{_0x1ba8a7=0xce;}_0x1fce85[_0xfc40('0xf')](_0x1ba8a7);return _0x1fce85[_0xfc40('0x10')]('Content-Range',_0x4b1b0c+'-'+_0x5accab+'/'+_0x5346a3)[_0xfc40('0xa')](_0x16f449);}return null;};}function saveUpdates(_0x1a3ed0){return function(_0x1f60a5){if(_0x1f60a5){return _0x1f60a5[_0xfc40('0x11')](_0x1a3ed0)['then'](function(_0x4d310d){return _0x4d310d;});}return null;};}function removeEntity(_0x588347){return function(_0x2e28be){if(_0x2e28be){return _0x2e28be[_0xfc40('0x12')]()[_0xfc40('0x13')](function(){_0x588347[_0xfc40('0xf')](0xcc)[_0xfc40('0x9')]();});}};}function handleEntityNotFound(_0x251a9f){return function(_0x363515){if(!_0x363515){_0x251a9f[_0xfc40('0x14')](0x194);}return _0x363515;};}function handleError(_0x31a38c,_0x20d407){_0x20d407=_0x20d407||0x1f4;return function(_0x487499){logger[_0xfc40('0x15')](_0x487499['stack']);if(_0x487499[_0xfc40('0x16')]){delete _0x487499[_0xfc40('0x16')];}_0x31a38c['status'](_0x20d407)[_0xfc40('0x17')](_0x487499);};}function maskClientSecret(_0x976d2d){return _[_0xfc40('0x18')](_0x976d2d[_0xfc40('0x19')](0x0,0x3),0x14,'*');}exports[_0xfc40('0x1a')]=function(_0x1d694d,_0x3b6325){var _0x273c6a={},_0x414b00={},_0x1c9df7={'count':0x0,'rows':[]};var _0x13a786=_['map'](db[_0xfc40('0x1b')][_0xfc40('0x1c')],function(_0x5909d1){return{'name':_0x5909d1['fieldName'],'type':_0x5909d1[_0xfc40('0x1d')][_0xfc40('0x1e')]};});_0x414b00['model']=_[_0xfc40('0x1f')](_0x13a786,_0xfc40('0x16'));_0x414b00[_0xfc40('0x20')]=_['keys'](_0x1d694d[_0xfc40('0x20')]);_0x414b00['filters']=_['intersection'](_0x414b00[_0xfc40('0x21')],_0x414b00[_0xfc40('0x20')]);_0x273c6a['attributes']=_[_0xfc40('0x22')](_0x414b00[_0xfc40('0x21')],qs[_0xfc40('0x23')](_0x1d694d[_0xfc40('0x20')]['fields']));_0x273c6a[_0xfc40('0x24')]=_0x273c6a[_0xfc40('0x24')][_0xfc40('0x25')]?_0x273c6a[_0xfc40('0x24')]:_0x414b00[_0xfc40('0x21')];if(!_0x1d694d[_0xfc40('0x20')][_0xfc40('0x26')](_0xfc40('0x27'))){_0x273c6a[_0xfc40('0xd')]=qs['limit'](_0x1d694d[_0xfc40('0x20')][_0xfc40('0xd')]);_0x273c6a['offset']=qs['offset'](_0x1d694d[_0xfc40('0x20')][_0xfc40('0xb')]);}_0x273c6a['order']=qs[_0xfc40('0x28')](_0x1d694d[_0xfc40('0x20')][_0xfc40('0x28')]);_0x273c6a[_0xfc40('0x29')]=qs[_0xfc40('0x2a')](_[_0xfc40('0x2b')](_0x1d694d['query'],_0x414b00[_0xfc40('0x2a')]),_0x13a786);if(_0x1d694d[_0xfc40('0x20')][_0xfc40('0x2c')]){_0x273c6a[_0xfc40('0x29')]=_[_0xfc40('0x2d')](_0x273c6a[_0xfc40('0x29')],{'$or':_[_0xfc40('0x1f')](_0x13a786,function(_0x52993c){if(_0x52993c[_0xfc40('0x1d')]!==_0xfc40('0x2e')){var _0x45c569={};_0x45c569[_0x52993c['name']]={'$like':'%'+_0x1d694d['query'][_0xfc40('0x2c')]+'%'};return _0x45c569;}})});}_0x273c6a=_[_0xfc40('0x2d')]({},_0x273c6a,_0x1d694d['options']);var _0xa270a0={'where':_0x273c6a[_0xfc40('0x29')]};return db['CloudProvider']['count'](_0xa270a0)['then'](function(_0xf36146){_0x1c9df7[_0xfc40('0xe')]=_0xf36146;if(_0x1d694d[_0xfc40('0x20')]['includeAll']){_0x273c6a[_0xfc40('0x2f')]=[{'all':!![]}];}return db[_0xfc40('0x1b')][_0xfc40('0x30')](_0x273c6a);})[_0xfc40('0x13')](function(_0x4a4e25){_0x1c9df7[_0xfc40('0x31')]=_[_0xfc40('0x1f')](_0x4a4e25,function(_0x28676d){if(_0x28676d[_0xfc40('0x32')]===_0xfc40('0x33')){var _0x5878ad=encryptor[_0xfc40('0x34')](_0x28676d[_0xfc40('0x35')]);_0x28676d[_0xfc40('0x35')]=maskClientSecret(_0x5878ad);}return _0x28676d;});return _0x1c9df7;})[_0xfc40('0x13')](respondWithFilteredResult(_0x3b6325,_0x273c6a))['catch'](handleError(_0x3b6325,null));};exports['show']=function(_0xe55fc7,_0x3a50af){var _0x5e9107={'raw':!![],'where':{'id':_0xe55fc7['params']['id']}},_0x47ccc9={};_0x47ccc9[_0xfc40('0x21')]=_[_0xfc40('0x36')](db[_0xfc40('0x1b')][_0xfc40('0x1c')]);_0x47ccc9[_0xfc40('0x20')]=_[_0xfc40('0x36')](_0xe55fc7[_0xfc40('0x20')]);_0x47ccc9[_0xfc40('0x2a')]=_[_0xfc40('0x22')](_0x47ccc9[_0xfc40('0x21')],_0x47ccc9['query']);_0x5e9107['attributes']=_[_0xfc40('0x22')](_0x47ccc9['model'],qs[_0xfc40('0x23')](_0xe55fc7[_0xfc40('0x20')]['fields']));_0x5e9107[_0xfc40('0x24')]=_0x5e9107[_0xfc40('0x24')][_0xfc40('0x25')]?_0x5e9107['attributes']:_0x47ccc9[_0xfc40('0x21')];if(_0xe55fc7['query'][_0xfc40('0x37')]){_0x5e9107[_0xfc40('0x2f')]=[{'all':!![]}];}_0x5e9107=_[_0xfc40('0x2d')]({},_0x5e9107,_0xe55fc7[_0xfc40('0x38')]);return db['CloudProvider'][_0xfc40('0x39')](_0x5e9107)['then'](handleEntityNotFound(_0x3a50af,null))[_0xfc40('0x13')](function(_0x49b2c9){if(_0x49b2c9[_0xfc40('0x32')]===_0xfc40('0x33')){var _0x3660dc=encryptor[_0xfc40('0x34')](_0x49b2c9[_0xfc40('0x35')]);_0x49b2c9[_0xfc40('0x35')]=maskClientSecret(_0x3660dc);}return _0x49b2c9;})['then'](respondWithResult(_0x3a50af,null))['catch'](handleError(_0x3a50af,null));};exports[_0xfc40('0x3a')]=function(_0x396255,_0x46683e){if(!_0x396255['body'][_0xfc40('0x16')])throw new Error(_0xfc40('0x3b'));if(!_0x396255['body'][_0xfc40('0x32')])throw new Error(_0xfc40('0x3c'));var _0x2f177b=db['CloudProvider'][_0xfc40('0x1c')][_0xfc40('0x32')][_0xfc40('0x3d')];if(!_0x2f177b[_0xfc40('0x3e')](_0x396255[_0xfc40('0x3f')][_0xfc40('0x32')]))throw new Error(_0xfc40('0x40')+_0x2f177b[_0xfc40('0x41')](',\x20'));if(_0x396255['body'][_0xfc40('0x32')]===_0xfc40('0x33')&&_0x396255['body']['data3']){_0x396255[_0xfc40('0x3f')][_0xfc40('0x35')]=encryptor[_0xfc40('0x42')](_0x396255['body']['data3']);}return db['CloudProvider'][_0xfc40('0x3a')](_0x396255['body'],{})[_0xfc40('0x13')](respondWithResult(_0x46683e,0xc9))['catch'](handleError(_0x46683e,null));};exports[_0xfc40('0x11')]=function(_0x11a418,_0x1ba752){if(_0x11a418[_0xfc40('0x3f')]['id']){delete _0x11a418[_0xfc40('0x3f')]['id'];}return db[_0xfc40('0x1b')][_0xfc40('0x39')]({'where':{'id':_0x11a418[_0xfc40('0x43')]['id']}})[_0xfc40('0x13')](handleEntityNotFound(_0x1ba752,null))['then'](function(_0x3dcc4b){if(_0x3dcc4b[_0xfc40('0x32')]===_0xfc40('0x33')&&_0x11a418[_0xfc40('0x3f')]['data3']){_0x11a418[_0xfc40('0x3f')]['data3']=encryptor[_0xfc40('0x42')](_0x11a418[_0xfc40('0x3f')][_0xfc40('0x35')]);}return _0x3dcc4b;})[_0xfc40('0x13')](saveUpdates(_0x11a418[_0xfc40('0x3f')],null))[_0xfc40('0x13')](respondWithResult(_0x1ba752,null))[_0xfc40('0x44')](handleError(_0x1ba752,null));};exports[_0xfc40('0x12')]=function(_0x458b36,_0x46c11b){return db[_0xfc40('0x1b')][_0xfc40('0x39')]({'where':{'id':_0x458b36[_0xfc40('0x43')]['id']}})[_0xfc40('0x13')](handleEntityNotFound(_0x46c11b,null))[_0xfc40('0x13')](removeEntity(_0x46c11b,null))['catch'](handleError(_0x46c11b,null));};exports['oauth2MicrosoftAuthorize']=function(_0x1752f8,_0x1fa629){return db['CloudProvider']['findOne']({'where':{'id':_0x1752f8[_0xfc40('0x43')]['id']},'raw':!![]})[_0xfc40('0x13')](function(_0x411bf4){if(!_0x411bf4)return _0x1fa629['sendStatus'](0x194);return{'url':oauth[_0xfc40('0x45')](_0x411bf4,_0x1752f8[_0xfc40('0x46')]['id'])};})[_0xfc40('0x13')](respondWithResult(_0x1fa629,null))[_0xfc40('0x44')](handleError(_0x1fa629,null));};exports['oauth2MicrosoftCallback']=function(_0x1d820e,_0x55892c){var _0x4695c3=_0x1d820e[_0xfc40('0x3f')];var _0xa8c798;var _0x24a2bf;if(_0x4695c3['error'])throw _0x4695c3;redis['get'](_0x4695c3[_0xfc40('0x47')])[_0xfc40('0x13')](function(_0x22e522){if(!_0x22e522)throw new Error(_0xfc40('0x48'));_0xa8c798=JSON['parse'](_0x22e522);var _0x16d575=Buffer[_0xfc40('0x49')](_0x4695c3[_0xfc40('0x47')],_0xfc40('0x4a'))[_0xfc40('0x4b')]('ascii');_0x24a2bf=JSON[_0xfc40('0x4c')](_0x16d575);if(!oauth['isValidIdToken'](_0x4695c3[_0xfc40('0x4d')],_0xa8c798['oauth2Claims']))throw new Error(_0xfc40('0x4e'));redis[_0xfc40('0x4f')](_0x4695c3[_0xfc40('0x47')]);return oauth['getOauth2MicrosoftAccessToken'](_0x4695c3[_0xfc40('0x50')],_0xa8c798);})[_0xfc40('0x13')](function(_0x59c700){_0xa8c798[_0xfc40('0x51')]=_0x59c700['access_token'];_0xa8c798['data6']=_0x59c700[_0xfc40('0x52')];return db[_0xfc40('0x1b')][_0xfc40('0x11')]({'data5':_0xa8c798['data5'],'data6':_0xa8c798['data6']},{'where':{'id':_0xa8c798['id']}});})[_0xfc40('0x13')](function(){oauth[_0xfc40('0x53')](_0xa8c798);socket[_0xfc40('0x54')](_0xfc40('0x55'),{'id':_0x24a2bf['id']});return;})[_0xfc40('0x13')](respondWithStatusCode(_0x55892c,null))[_0xfc40('0x44')](function(_0x2dea33){if(_0x24a2bf){socket[_0xfc40('0x54')](_0xfc40('0x56'),{'id':_0x24a2bf['id']});}if(!_0xa8c798){logger['error']('Invalid\x20authentication\x20state\x20parameter',_0x2dea33);return _0x55892c[_0xfc40('0xf')](0x1f4)['send'](_0x2dea33['message']);}logger['error'](_0xfc40('0x57'),_0xa8c798['id'],JSON['stringify'](_0x2dea33));});}; \ No newline at end of file +var _0xd726=['microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','api','../../mysqldb','./cloudProvider.oauth','redis','localhost','socket.io-emitter','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','sendStatus','error','stack','name','send','padEnd','index','map','CloudProvider','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','service','MicrosoftAzure','decryptString','data3','catch','show','rawAttributes','body','Name\x20parameter\x20not\x20specified','includes','join','encryptString','create','find','params','findOne','generateMicrosoftAuthorizationUrl','user','get','state','Invalid\x20state\x20parameter','base64','toString','ascii','parse','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','refresh_token','startRefreshInterval','emit'];(function(_0xfc1760,_0x19eaaf){var _0x28a795=function(_0x296984){while(--_0x296984){_0xfc1760['push'](_0xfc1760['shift']());}};_0x28a795(++_0x19eaaf);}(_0xd726,0xc3));var _0x6d72=function(_0x5b7078,_0x12e9ab){_0x5b7078=_0x5b7078-0x0;var _0x1f4ee4=_0xd726[_0x5b7078];return _0x1f4ee4;};'use strict';var _=require('lodash');var Redis=require(_0x6d72('0x0'));var qs=require(_0x6d72('0x1'));var encryptor=require(_0x6d72('0x2'));var config=require(_0x6d72('0x3'));var logger=require('../../config/logger')(_0x6d72('0x4'));var db=require(_0x6d72('0x5'))['db'];var oauth=require(_0x6d72('0x6'));config['redis']=_['defaults'](config[_0x6d72('0x7')],{'host':_0x6d72('0x8'),'port':0x18eb});var socket=require(_0x6d72('0x9'))(new Redis(config[_0x6d72('0x7')]));var redis=new Redis(config[_0x6d72('0x7')]);function respondWithStatusCode(_0x57e993,_0x2bb27e){_0x2bb27e=_0x2bb27e||0xcc;return function(_0x3bc027){if(_0x3bc027){return _0x57e993['sendStatus'](_0x2bb27e);}return _0x57e993[_0x6d72('0xa')](_0x2bb27e)[_0x6d72('0xb')]();};}function respondWithResult(_0x2d693c,_0xa9af9c){_0xa9af9c=_0xa9af9c||0xc8;return function(_0x1e134f){if(_0x1e134f){return _0x2d693c[_0x6d72('0xa')](_0xa9af9c)[_0x6d72('0xc')](_0x1e134f);}};}function respondWithFilteredResult(_0x205d33,_0x1f3bfa){return function(_0x42c443){if(_0x42c443){var _0x4be8be=typeof _0x1f3bfa[_0x6d72('0xd')]===_0x6d72('0xe')&&typeof _0x1f3bfa[_0x6d72('0xf')]===_0x6d72('0xe');var _0x19d71a=_0x42c443[_0x6d72('0x10')];var _0x114727=_0x4be8be?0x0:_0x1f3bfa[_0x6d72('0xd')];var _0x11d658=_0x4be8be?_0x42c443[_0x6d72('0x10')]:_0x1f3bfa[_0x6d72('0xd')]+_0x1f3bfa['limit'];var _0x5b1424;if(_0x11d658>=_0x19d71a){_0x11d658=_0x19d71a;_0x5b1424=0xc8;}else{_0x5b1424=0xce;}_0x205d33[_0x6d72('0xa')](_0x5b1424);return _0x205d33[_0x6d72('0x11')](_0x6d72('0x12'),_0x114727+'-'+_0x11d658+'/'+_0x19d71a)[_0x6d72('0xc')](_0x42c443);}return null;};}function saveUpdates(_0x2f2d1e){return function(_0x328fc5){if(_0x328fc5){return _0x328fc5[_0x6d72('0x13')](_0x2f2d1e)[_0x6d72('0x14')](function(_0x217106){return _0x217106;});}return null;};}function removeEntity(_0x5d3cfe){return function(_0x526117){if(_0x526117){return _0x526117[_0x6d72('0x15')]()['then'](function(){_0x5d3cfe[_0x6d72('0xa')](0xcc)['end']();});}};}function handleEntityNotFound(_0x169757){return function(_0x5a56c2){if(!_0x5a56c2){_0x169757[_0x6d72('0x16')](0x194);}return _0x5a56c2;};}function handleError(_0x3c0b0e,_0x303d52){_0x303d52=_0x303d52||0x1f4;return function(_0x2ba45d){logger[_0x6d72('0x17')](_0x2ba45d[_0x6d72('0x18')]);if(_0x2ba45d[_0x6d72('0x19')]){delete _0x2ba45d[_0x6d72('0x19')];}_0x3c0b0e[_0x6d72('0xa')](_0x303d52)[_0x6d72('0x1a')](_0x2ba45d);};}function maskClientSecret(_0x685481){return _[_0x6d72('0x1b')](_0x685481['slice'](0x0,0x3),0x14,'*');}exports[_0x6d72('0x1c')]=function(_0xb56ac0,_0x23c643){var _0x230206={},_0x169b83={},_0xfba97={'count':0x0,'rows':[]};var _0x54ecf9=_[_0x6d72('0x1d')](db[_0x6d72('0x1e')]['rawAttributes'],function(_0x47db86){return{'name':_0x47db86[_0x6d72('0x1f')],'type':_0x47db86[_0x6d72('0x20')]['key']};});_0x169b83[_0x6d72('0x21')]=_[_0x6d72('0x1d')](_0x54ecf9,_0x6d72('0x19'));_0x169b83[_0x6d72('0x22')]=_[_0x6d72('0x23')](_0xb56ac0[_0x6d72('0x22')]);_0x169b83[_0x6d72('0x24')]=_[_0x6d72('0x25')](_0x169b83[_0x6d72('0x21')],_0x169b83[_0x6d72('0x22')]);_0x230206[_0x6d72('0x26')]=_['intersection'](_0x169b83[_0x6d72('0x21')],qs[_0x6d72('0x27')](_0xb56ac0[_0x6d72('0x22')]['fields']));_0x230206[_0x6d72('0x26')]=_0x230206[_0x6d72('0x26')][_0x6d72('0x28')]?_0x230206[_0x6d72('0x26')]:_0x169b83[_0x6d72('0x21')];if(!_0xb56ac0['query']['hasOwnProperty']('nolimit')){_0x230206['limit']=qs[_0x6d72('0xf')](_0xb56ac0['query']['limit']);_0x230206[_0x6d72('0xd')]=qs[_0x6d72('0xd')](_0xb56ac0[_0x6d72('0x22')][_0x6d72('0xd')]);}_0x230206[_0x6d72('0x29')]=qs[_0x6d72('0x2a')](_0xb56ac0[_0x6d72('0x22')][_0x6d72('0x2a')]);_0x230206[_0x6d72('0x2b')]=qs[_0x6d72('0x24')](_[_0x6d72('0x2c')](_0xb56ac0[_0x6d72('0x22')],_0x169b83['filters']),_0x54ecf9);if(_0xb56ac0[_0x6d72('0x22')]['filter']){_0x230206[_0x6d72('0x2b')]=_[_0x6d72('0x2d')](_0x230206[_0x6d72('0x2b')],{'$or':_[_0x6d72('0x1d')](_0x54ecf9,function(_0x498990){if(_0x498990['type']!==_0x6d72('0x2e')){var _0x3216f6={};_0x3216f6[_0x498990['name']]={'$like':'%'+_0xb56ac0['query'][_0x6d72('0x2f')]+'%'};return _0x3216f6;}})});}_0x230206=_[_0x6d72('0x2d')]({},_0x230206,_0xb56ac0[_0x6d72('0x30')]);var _0x113aa9={'where':_0x230206[_0x6d72('0x2b')]};return db[_0x6d72('0x1e')]['count'](_0x113aa9)[_0x6d72('0x14')](function(_0x440c16){_0xfba97[_0x6d72('0x10')]=_0x440c16;if(_0xb56ac0[_0x6d72('0x22')][_0x6d72('0x31')]){_0x230206[_0x6d72('0x32')]=[{'all':!![]}];}return db[_0x6d72('0x1e')][_0x6d72('0x33')](_0x230206);})['then'](function(_0x7b7d98){_0xfba97[_0x6d72('0x34')]=_[_0x6d72('0x1d')](_0x7b7d98,function(_0x3b2976){if(_0x3b2976[_0x6d72('0x35')]===_0x6d72('0x36')){var _0xdddaa3=encryptor[_0x6d72('0x37')](_0x3b2976[_0x6d72('0x38')]);_0x3b2976[_0x6d72('0x38')]=maskClientSecret(_0xdddaa3);}return _0x3b2976;});return _0xfba97;})[_0x6d72('0x14')](respondWithFilteredResult(_0x23c643,_0x230206))[_0x6d72('0x39')](handleError(_0x23c643,null));};exports[_0x6d72('0x3a')]=function(_0x4d512e,_0x30350b){var _0x2eacc8={'raw':!![],'where':{'id':_0x4d512e['params']['id']}},_0x5ef614={};_0x5ef614['model']=_[_0x6d72('0x23')](db[_0x6d72('0x1e')][_0x6d72('0x3b')]);_0x5ef614[_0x6d72('0x22')]=_[_0x6d72('0x23')](_0x4d512e[_0x6d72('0x22')]);_0x5ef614['filters']=_[_0x6d72('0x25')](_0x5ef614[_0x6d72('0x21')],_0x5ef614[_0x6d72('0x22')]);_0x2eacc8[_0x6d72('0x26')]=_['intersection'](_0x5ef614['model'],qs['fields'](_0x4d512e['query'][_0x6d72('0x27')]));_0x2eacc8['attributes']=_0x2eacc8[_0x6d72('0x26')][_0x6d72('0x28')]?_0x2eacc8[_0x6d72('0x26')]:_0x5ef614['model'];if(_0x4d512e[_0x6d72('0x22')][_0x6d72('0x31')]){_0x2eacc8[_0x6d72('0x32')]=[{'all':!![]}];}_0x2eacc8=_[_0x6d72('0x2d')]({},_0x2eacc8,_0x4d512e['options']);return db[_0x6d72('0x1e')]['find'](_0x2eacc8)[_0x6d72('0x14')](handleEntityNotFound(_0x30350b,null))[_0x6d72('0x14')](function(_0x1ae29f){if(_0x1ae29f[_0x6d72('0x35')]==='MicrosoftAzure'){var _0x329642=encryptor['decryptString'](_0x1ae29f['data3']);_0x1ae29f[_0x6d72('0x38')]=maskClientSecret(_0x329642);}return _0x1ae29f;})[_0x6d72('0x14')](respondWithResult(_0x30350b,null))['catch'](handleError(_0x30350b,null));};exports['create']=function(_0xd82df0,_0x40341c){if(!_0xd82df0[_0x6d72('0x3c')]['name'])throw new Error(_0x6d72('0x3d'));if(!_0xd82df0[_0x6d72('0x3c')]['service'])throw new Error('Service\x20parameter\x20not\x20specified');var _0x50aa7b=db[_0x6d72('0x1e')]['rawAttributes']['service']['values'];if(!_0x50aa7b[_0x6d72('0x3e')](_0xd82df0[_0x6d72('0x3c')]['service']))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x50aa7b[_0x6d72('0x3f')](',\x20'));if(_0xd82df0['body']['service']===_0x6d72('0x36')&&_0xd82df0[_0x6d72('0x3c')][_0x6d72('0x38')]){_0xd82df0['body'][_0x6d72('0x38')]=encryptor[_0x6d72('0x40')](_0xd82df0[_0x6d72('0x3c')][_0x6d72('0x38')]);}return db['CloudProvider'][_0x6d72('0x41')](_0xd82df0[_0x6d72('0x3c')],{})[_0x6d72('0x14')](respondWithResult(_0x40341c,0xc9))[_0x6d72('0x39')](handleError(_0x40341c,null));};exports[_0x6d72('0x13')]=function(_0x1a695e,_0x5bb125){if(_0x1a695e[_0x6d72('0x3c')]['id']){delete _0x1a695e[_0x6d72('0x3c')]['id'];}return db[_0x6d72('0x1e')][_0x6d72('0x42')]({'where':{'id':_0x1a695e['params']['id']}})[_0x6d72('0x14')](handleEntityNotFound(_0x5bb125,null))[_0x6d72('0x14')](function(_0x2dc476){if(_0x2dc476[_0x6d72('0x35')]===_0x6d72('0x36')&&_0x1a695e[_0x6d72('0x3c')][_0x6d72('0x38')]){_0x1a695e[_0x6d72('0x3c')][_0x6d72('0x38')]=encryptor[_0x6d72('0x40')](_0x1a695e[_0x6d72('0x3c')][_0x6d72('0x38')]);}return _0x2dc476;})['then'](saveUpdates(_0x1a695e[_0x6d72('0x3c')],null))['then'](respondWithResult(_0x5bb125,null))[_0x6d72('0x39')](handleError(_0x5bb125,null));};exports[_0x6d72('0x15')]=function(_0x4c75a9,_0x463951){return db['CloudProvider']['find']({'where':{'id':_0x4c75a9[_0x6d72('0x43')]['id']}})[_0x6d72('0x14')](handleEntityNotFound(_0x463951,null))[_0x6d72('0x14')](removeEntity(_0x463951,null))['catch'](handleError(_0x463951,null));};exports['oauth2MicrosoftAuthorize']=function(_0x1cb277,_0x1240e5){return db[_0x6d72('0x1e')][_0x6d72('0x44')]({'where':{'id':_0x1cb277[_0x6d72('0x43')]['id']},'raw':!![]})[_0x6d72('0x14')](function(_0x3e0f27){if(!_0x3e0f27)return _0x1240e5[_0x6d72('0x16')](0x194);return{'url':oauth[_0x6d72('0x45')](_0x3e0f27,_0x1cb277[_0x6d72('0x46')]['id'])};})[_0x6d72('0x14')](respondWithResult(_0x1240e5,null))['catch'](handleError(_0x1240e5,null));};exports['oauth2MicrosoftCallback']=function(_0x217997,_0x14dec6){var _0x4576d0=_0x217997[_0x6d72('0x3c')];var _0x1afc41;var _0x2ee1d2;if(_0x4576d0[_0x6d72('0x17')])throw _0x4576d0;redis[_0x6d72('0x47')](_0x4576d0[_0x6d72('0x48')])['then'](function(_0x3410ba){if(!_0x3410ba)throw new Error(_0x6d72('0x49'));_0x1afc41=JSON['parse'](_0x3410ba);var _0x28b544=Buffer['from'](_0x4576d0[_0x6d72('0x48')],_0x6d72('0x4a'))[_0x6d72('0x4b')](_0x6d72('0x4c'));_0x2ee1d2=JSON[_0x6d72('0x4d')](_0x28b544);if(!oauth[_0x6d72('0x4e')](_0x4576d0[_0x6d72('0x4f')],_0x1afc41[_0x6d72('0x50')]))throw new Error(_0x6d72('0x51'));redis['del'](_0x4576d0[_0x6d72('0x48')]);return oauth[_0x6d72('0x52')](_0x4576d0[_0x6d72('0x53')],_0x1afc41);})[_0x6d72('0x14')](function(_0x28d595){_0x1afc41[_0x6d72('0x54')]=_0x28d595[_0x6d72('0x55')];_0x1afc41[_0x6d72('0x56')]=_0x28d595[_0x6d72('0x57')];return db[_0x6d72('0x1e')][_0x6d72('0x13')]({'data5':_0x1afc41[_0x6d72('0x54')],'data6':_0x1afc41['data6']},{'where':{'id':_0x1afc41['id']}});})[_0x6d72('0x14')](function(){oauth[_0x6d72('0x58')](_0x1afc41);socket[_0x6d72('0x59')]('microsoftAuthorization:success',{'id':_0x2ee1d2['id']});return;})[_0x6d72('0x14')](respondWithStatusCode(_0x14dec6,null))[_0x6d72('0x39')](function(_0x2f244e){if(_0x2ee1d2){socket[_0x6d72('0x59')](_0x6d72('0x5a'),{'id':_0x2ee1d2['id']});}if(!_0x1afc41){logger[_0x6d72('0x17')](_0x6d72('0x5b'),_0x2f244e);return _0x14dec6[_0x6d72('0xa')](0x1f4)[_0x6d72('0x1a')](_0x2f244e[_0x6d72('0x5c')]);}logger[_0x6d72('0x17')](_0x6d72('0x5d'),_0x1afc41['id'],JSON[_0x6d72('0x5e')](_0x2f244e));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index b21b6df..a8235fe 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 _0x8437=['cloud_providers','util','../../config/logger','api','moment','bluebird','path','rimraf','./cloudProvider.attributes','CloudProvider'];(function(_0x465924,_0x484ee8){var _0x40844b=function(_0x4e2357){while(--_0x4e2357){_0x465924['push'](_0x465924['shift']());}};_0x40844b(++_0x484ee8);}(_0x8437,0xd3));var _0x7843=function(_0x2896d9,_0x4b7ed9){_0x2896d9=_0x2896d9-0x0;var _0x402efc=_0x8437[_0x2896d9];return _0x402efc;};'use strict';var _=require('lodash');var util=require(_0x7843('0x0'));var logger=require(_0x7843('0x1'))(_0x7843('0x2'));var moment=require(_0x7843('0x3'));var BPromise=require(_0x7843('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7843('0x5'));var rimraf=require(_0x7843('0x6'));var config=require('../../config/environment');var attributes=require(_0x7843('0x7'));module['exports']=function(_0x211c06,_0x2bea31){return _0x211c06['define'](_0x7843('0x8'),attributes,{'tableName':_0x7843('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf6c0=['exports','define','CloudProvider','cloud_providers','lodash','../../config/logger','api','moment','bluebird','path','../../config/environment','./cloudProvider.attributes'];(function(_0x3e5693,_0x58a72b){var _0x29c521=function(_0x1235d2){while(--_0x1235d2){_0x3e5693['push'](_0x3e5693['shift']());}};_0x29c521(++_0x58a72b);}(_0xf6c0,0xac));var _0x0f6c=function(_0x37d0b9,_0x1db60c){_0x37d0b9=_0x37d0b9-0x0;var _0x4425a9=_0xf6c0[_0x37d0b9];return _0x4425a9;};'use strict';var _=require(_0x0f6c('0x0'));var util=require('util');var logger=require(_0x0f6c('0x1'))(_0x0f6c('0x2'));var moment=require(_0x0f6c('0x3'));var BPromise=require(_0x0f6c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0f6c('0x5'));var rimraf=require('rimraf');var config=require(_0x0f6c('0x6'));var attributes=require(_0x0f6c('0x7'));module[_0x0f6c('0x8')]=function(_0x515bc0,_0x5a0a36){return _0x515bc0[_0x0f6c('0x9')](_0x0f6c('0xa'),attributes,{'tableName':_0x0f6c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js index ae1cfab..5786b75 100644 --- a/server/api/cloudProvider/cloudProvider.oauth.js +++ b/server/api/cloudProvider/cloudProvider.oauth.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1628=['oauth2Claims','oauth2/','set','decode','payload','iss','issuer','nonce','isAfter','unix','exp','then','data3','CloudProvider','findOne','refresh_token','data6','decryptString','data5','access_token','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','POST','intervals','bind','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','jsonwebtoken','moment','ioredis','request-promise','util','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','openid','/authorize','map','type','push','data7','/.default','Dynamics365','replace','{TENANT_ID}','data2','code','id_token','from','stringify','toString','base64','randomBytes','client_id','data1','response_type','join','redirect_uri','data4','response_mode','form_post','scope','key','value'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1628,0xc5));var _0x8162=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x1628[_0x31e29a];return _0x32d892;};'use strict';var _=require(_0x8162('0x0'));var crypto=require('crypto');var jwt=require(_0x8162('0x1'));var moment=require(_0x8162('0x2'));var Redis=require(_0x8162('0x3'));var rp=require(_0x8162('0x4'));var util=require(_0x8162('0x5'));var encryptor=require('../../components/encryptor');var config=require(_0x8162('0x6'));var logger=require(_0x8162('0x7'))(_0x8162('0x8'));var schedule=require(_0x8162('0x9'));var db=require(_0x8162('0xa'))['db'];config[_0x8162('0xb')]=_[_0x8162('0xc')](config[_0x8162('0xb')],{'host':_0x8162('0xd'),'port':0x18eb});var redis=new Redis(config[_0x8162('0xb')]);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0x8162('0xe'),_0x8162('0xf'),_0x8162('0x10'),_0x8162('0x11'),_0x8162('0x12'),_0x8162('0x13')],'Dynamics365':[_0x8162('0x14'),'offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0x8162('0x15');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x1db21c){var _0x2e1297=_[_0x8162('0x16')](AZURE_AUTH_SCOPES[_0x1db21c[_0x8162('0x17')]]);if(_0x1db21c[_0x8162('0x17')]==='Dynamics365')_0x2e1297[_0x8162('0x18')](_0x1db21c[_0x8162('0x19')]+_0x8162('0x1a'));return _0x2e1297['join']('\x20');}function getAccessTokenScope(_0x529fca){if(_0x529fca[_0x8162('0x17')]==='Outlook365')return _0x8162('0x11');if(_0x529fca['type']===_0x8162('0x1b'))return _0x529fca['data7']+_0x8162('0x1a');}function generateMicrosoftAuthorizationUrl(_0x5d1bdf,_0x1d7972){var _0x185ab2=MICROSOFT_AUTH_URL[_0x8162('0x1c')](_0x8162('0x1d'),_0x5d1bdf[_0x8162('0x1e')]);var _0x33f55b=[_0x8162('0x1f'),_0x8162('0x20')];var _0x155ba0=Buffer[_0x8162('0x21')](JSON[_0x8162('0x22')]({'id':_0x1d7972}))[_0x8162('0x23')](_0x8162('0x24'));var _0x1b722f=crypto[_0x8162('0x25')](0x10)[_0x8162('0x23')]('hex');var _0x254519=getAuthorizationScopes(_0x5d1bdf);var _0x587cae=[{'key':_0x8162('0x26'),'value':_0x5d1bdf[_0x8162('0x27')]},{'key':_0x8162('0x28'),'value':encodeURIComponent(_0x33f55b[_0x8162('0x29')]('\x20'))},{'key':_0x8162('0x2a'),'value':_0x5d1bdf[_0x8162('0x2b')]},{'key':_0x8162('0x2c'),'value':_0x8162('0x2d')},{'key':_0x8162('0x2e'),'value':encodeURIComponent(_0x254519)},{'key':'state','value':_0x155ba0},{'key':'nonce','value':_0x1b722f},{'key':'prompt','value':'login'}];var _0x458746=_0x185ab2+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x8162('0x16')](_0x587cae,function(_0xd56137){return _0xd56137[_0x8162('0x2f')]+'='+_0xd56137[_0x8162('0x30')];})['join']('&');_0x5d1bdf[_0x8162('0x31')]={'issuer':_0x185ab2['replace'](_0x8162('0x32'),''),'audience':_0x5d1bdf[_0x8162('0x27')],'state':_0x155ba0,'nonce':_0x1b722f};redis[_0x8162('0x33')](_0x155ba0,JSON[_0x8162('0x22')](_0x5d1bdf));return _0x458746;}function isValidIdToken(_0x46676a,_0x2ac3db){try{var _0x73f829=jwt[_0x8162('0x34')](_0x46676a,{'complete':!![]});var _0x206240=_0x73f829[_0x8162('0x35')];if(_0x206240[_0x8162('0x36')]!==_0x2ac3db[_0x8162('0x37')])return![];if(_0x206240['aud']!==_0x2ac3db['audience'])return![];if(_0x206240[_0x8162('0x38')]!==_0x2ac3db[_0x8162('0x38')])return![];if(moment()[_0x8162('0x39')](moment[_0x8162('0x3a')](_0x206240[_0x8162('0x3b')])))return![];return!![];}catch(_0x557fea){throw _0x557fea;}}function refreshOauth2MicrosoftAccessToken(_0x2c9219){return Promise['resolve']()[_0x8162('0x3c')](function(){if(_0x2c9219[_0x8162('0x3d')])return _0x2c9219;return db[_0x8162('0x3e')][_0x8162('0x3f')]({'where':{'id':_0x2c9219['id']},'raw':!![]});})[_0x8162('0x3c')](function(_0x2020aa){var _0x235f22={'grant_type':_0x8162('0x40'),'refresh_token':_0x2020aa[_0x8162('0x41')],'scope':getAccessTokenScope(_0x2020aa),'redirect_uri':_0x2020aa[_0x8162('0x2b')],'client_id':_0x2020aa[_0x8162('0x27')],'client_secret':encryptor[_0x8162('0x42')](_0x2020aa[_0x8162('0x3d')])};var _0x902f8d={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x8162('0x1c')](_0x8162('0x1d'),_0x2020aa['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x235f22,'json':!![]};return rp(_0x902f8d);})['then'](function(_0x19fddb){_0x2c9219[_0x8162('0x43')]=_0x19fddb[_0x8162('0x44')];_0x2c9219[_0x8162('0x41')]=_0x19fddb['refresh_token'];return db[_0x8162('0x3e')][_0x8162('0x45')]({'data5':_0x2c9219['data5'],'data6':_0x2c9219['data6']},{'where':{'id':_0x2c9219['id']}});})[_0x8162('0x3c')](function(){return _0x2c9219;})[_0x8162('0x46')](function(_0x17f624){logger[_0x8162('0x47')](_0x8162('0x48'),_0x2c9219['id'],_0x17f624);});}function getOauth2MicrosoftAccessToken(_0x3269bc,_0xe50f54){var _0x4efa73={'grant_type':_0x8162('0x49'),'code':_0x3269bc,'scope':getAccessTokenScope(_0xe50f54),'redirect_uri':_0xe50f54['data4'],'client_id':_0xe50f54['data1'],'client_secret':encryptor[_0x8162('0x42')](_0xe50f54[_0x8162('0x3d')])};var _0xbd9b0c={'method':_0x8162('0x4a'),'uri':MICROSOFT_AUTH_URL[_0x8162('0x1c')](_0x8162('0x1d'),_0xe50f54['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4efa73,'json':!![]};return rp(_0xbd9b0c);}function startRefreshInterval(_0x57f185){var _0x3f885f=schedule[_0x8162('0x4b')];if(_0x3f885f[_0x57f185['id']])clearInterval(_0x3f885f[_0x57f185['id']]);_0x3f885f[_0x57f185['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x8162('0x4c')](this,{'id':_0x57f185['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x3f885f;}function startAllRefreshIntervals(){return db[_0x8162('0x3e')][_0x8162('0x4d')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x8162('0x3c')](function(_0x45dd12){var _0x1056a9=_0x45dd12['map'](function(_0xdf912){return refreshOauth2MicrosoftAccessToken(_0xdf912)[_0x8162('0x3c')](function(_0x391e85){startRefreshInterval(_0x391e85);});});return Promise[_0x8162('0x4e')](_0x1056a9);})[_0x8162('0x46')](function(_0x3e5612){var _0x260469=_0x3e5612?util[_0x8162('0x4f')](_0x3e5612,{'showHidden':![],'depth':null}):'';logger[_0x8162('0x47')](_0x8162('0x50'),_0x260469);});}module[_0x8162('0x51')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0xd2b8=['moment','ioredis','util','../../components/encryptor','../../config/logger','api','../../config/schedule/cloud-provider','defaults','redis','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','profile','offline_access','https://outlook.office.com/POP.AccessAsUser.All','openid','/authorize','/token','map','type','Dynamics365','push','data7','/.default','join','Outlook365','replace','data2','id_token','from','stringify','toString','base64','hex','data1','response_type','redirect_uri','data4','response_mode','prompt','login','value','oauth2Claims','oauth2/','set','decode','payload','iss','issuer','aud','audience','nonce','isAfter','unix','exp','resolve','then','data3','CloudProvider','findOne','refresh_token','data6','decryptString','POST','{TENANT_ID}','data5','access_token','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','intervals','bind','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','crypto','jsonwebtoken'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0xd2b8,0xe8));var _0x8d2b=function(_0x2fd8d4,_0x297557){_0x2fd8d4=_0x2fd8d4-0x0;var _0x5224bc=_0xd2b8[_0x2fd8d4];return _0x5224bc;};'use strict';var _=require('lodash');var crypto=require(_0x8d2b('0x0'));var jwt=require(_0x8d2b('0x1'));var moment=require(_0x8d2b('0x2'));var Redis=require(_0x8d2b('0x3'));var rp=require('request-promise');var util=require(_0x8d2b('0x4'));var encryptor=require(_0x8d2b('0x5'));var config=require('../../config/environment');var logger=require(_0x8d2b('0x6'))(_0x8d2b('0x7'));var schedule=require(_0x8d2b('0x8'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x8d2b('0x9')](config[_0x8d2b('0xa')],{'host':'localhost','port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0x8d2b('0xb');var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0x8d2b('0xc'),'email',_0x8d2b('0xd'),'https://outlook.office365.com/IMAP.AccessAsUser.All',_0x8d2b('0xe'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0x8d2b('0xf'),_0x8d2b('0xd')]};var MICROSOFT_AUTH_ENDPOINT=_0x8d2b('0x10');var MICROSOFT_TOKEN_ENDPOINT=_0x8d2b('0x11');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x8cb8c1){var _0x5e7d8f=_[_0x8d2b('0x12')](AZURE_AUTH_SCOPES[_0x8cb8c1[_0x8d2b('0x13')]]);if(_0x8cb8c1[_0x8d2b('0x13')]===_0x8d2b('0x14'))_0x5e7d8f[_0x8d2b('0x15')](_0x8cb8c1[_0x8d2b('0x16')]+_0x8d2b('0x17'));return _0x5e7d8f[_0x8d2b('0x18')]('\x20');}function getAccessTokenScope(_0x4866a0){if(_0x4866a0[_0x8d2b('0x13')]===_0x8d2b('0x19'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x4866a0[_0x8d2b('0x13')]===_0x8d2b('0x14'))return _0x4866a0[_0x8d2b('0x16')]+_0x8d2b('0x17');}function generateMicrosoftAuthorizationUrl(_0x365229,_0x4c461a){var _0x948a83=MICROSOFT_AUTH_URL[_0x8d2b('0x1a')]('{TENANT_ID}',_0x365229[_0x8d2b('0x1b')]);var _0x1346d9=['code',_0x8d2b('0x1c')];var _0x4ad99d=Buffer[_0x8d2b('0x1d')](JSON[_0x8d2b('0x1e')]({'id':_0x4c461a}))[_0x8d2b('0x1f')](_0x8d2b('0x20'));var _0x1391af=crypto['randomBytes'](0x10)[_0x8d2b('0x1f')](_0x8d2b('0x21'));var _0xa45fa4=getAuthorizationScopes(_0x365229);var _0x16e1c2=[{'key':'client_id','value':_0x365229[_0x8d2b('0x22')]},{'key':_0x8d2b('0x23'),'value':encodeURIComponent(_0x1346d9[_0x8d2b('0x18')]('\x20'))},{'key':_0x8d2b('0x24'),'value':_0x365229[_0x8d2b('0x25')]},{'key':_0x8d2b('0x26'),'value':'form_post'},{'key':'scope','value':encodeURIComponent(_0xa45fa4)},{'key':'state','value':_0x4ad99d},{'key':'nonce','value':_0x1391af},{'key':_0x8d2b('0x27'),'value':_0x8d2b('0x28')}];var _0x4e1c61=_0x948a83+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x8d2b('0x12')](_0x16e1c2,function(_0x2a6ef2){return _0x2a6ef2['key']+'='+_0x2a6ef2[_0x8d2b('0x29')];})[_0x8d2b('0x18')]('&');_0x365229[_0x8d2b('0x2a')]={'issuer':_0x948a83[_0x8d2b('0x1a')](_0x8d2b('0x2b'),''),'audience':_0x365229['data1'],'state':_0x4ad99d,'nonce':_0x1391af};redis[_0x8d2b('0x2c')](_0x4ad99d,JSON[_0x8d2b('0x1e')](_0x365229));return _0x4e1c61;}function isValidIdToken(_0x19b26f,_0x43302c){try{var _0x2ab8bc=jwt[_0x8d2b('0x2d')](_0x19b26f,{'complete':!![]});var _0x449531=_0x2ab8bc[_0x8d2b('0x2e')];if(_0x449531[_0x8d2b('0x2f')]!==_0x43302c[_0x8d2b('0x30')])return![];if(_0x449531[_0x8d2b('0x31')]!==_0x43302c[_0x8d2b('0x32')])return![];if(_0x449531[_0x8d2b('0x33')]!==_0x43302c[_0x8d2b('0x33')])return![];if(moment()[_0x8d2b('0x34')](moment[_0x8d2b('0x35')](_0x449531[_0x8d2b('0x36')])))return![];return!![];}catch(_0x12165f){throw _0x12165f;}}function refreshOauth2MicrosoftAccessToken(_0x14dbfd){return Promise[_0x8d2b('0x37')]()[_0x8d2b('0x38')](function(){if(_0x14dbfd[_0x8d2b('0x39')])return _0x14dbfd;return db[_0x8d2b('0x3a')][_0x8d2b('0x3b')]({'where':{'id':_0x14dbfd['id']},'raw':!![]});})['then'](function(_0x2839cf){var _0x43f8fa={'grant_type':_0x8d2b('0x3c'),'refresh_token':_0x2839cf[_0x8d2b('0x3d')],'scope':getAccessTokenScope(_0x2839cf),'redirect_uri':_0x2839cf[_0x8d2b('0x25')],'client_id':_0x2839cf[_0x8d2b('0x22')],'client_secret':encryptor[_0x8d2b('0x3e')](_0x2839cf[_0x8d2b('0x39')])};var _0x34e246={'method':_0x8d2b('0x3f'),'uri':MICROSOFT_AUTH_URL[_0x8d2b('0x1a')](_0x8d2b('0x40'),_0x2839cf[_0x8d2b('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x43f8fa,'json':!![]};return rp(_0x34e246);})[_0x8d2b('0x38')](function(_0x3b30ee){_0x14dbfd[_0x8d2b('0x41')]=_0x3b30ee[_0x8d2b('0x42')];_0x14dbfd[_0x8d2b('0x3d')]=_0x3b30ee[_0x8d2b('0x3c')];return db[_0x8d2b('0x3a')][_0x8d2b('0x43')]({'data5':_0x14dbfd[_0x8d2b('0x41')],'data6':_0x14dbfd[_0x8d2b('0x3d')]},{'where':{'id':_0x14dbfd['id']}});})['then'](function(){return _0x14dbfd;})[_0x8d2b('0x44')](function(_0x5a0e83){logger[_0x8d2b('0x45')](_0x8d2b('0x46'),_0x14dbfd['id'],_0x5a0e83);});}function getOauth2MicrosoftAccessToken(_0x2673f0,_0xec548c){var _0x4aaa81={'grant_type':'authorization_code','code':_0x2673f0,'scope':getAccessTokenScope(_0xec548c),'redirect_uri':_0xec548c['data4'],'client_id':_0xec548c[_0x8d2b('0x22')],'client_secret':encryptor['decryptString'](_0xec548c[_0x8d2b('0x39')])};var _0x4845f0={'method':_0x8d2b('0x3f'),'uri':MICROSOFT_AUTH_URL[_0x8d2b('0x1a')](_0x8d2b('0x40'),_0xec548c[_0x8d2b('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4aaa81,'json':!![]};return rp(_0x4845f0);}function startRefreshInterval(_0x291511){var _0x5acc53=schedule[_0x8d2b('0x47')];if(_0x5acc53[_0x291511['id']])clearInterval(_0x5acc53[_0x291511['id']]);_0x5acc53[_0x291511['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x8d2b('0x48')](this,{'id':_0x291511['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x8d2b('0x47')]=_0x5acc53;}function startAllRefreshIntervals(){return db[_0x8d2b('0x3a')][_0x8d2b('0x49')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x8d2b('0x38')](function(_0x54a74b){var _0x2892bf=_0x54a74b['map'](function(_0x158129){return refreshOauth2MicrosoftAccessToken(_0x158129)[_0x8d2b('0x38')](function(_0x5a8de1){startRefreshInterval(_0x5a8de1);});});return Promise[_0x8d2b('0x4a')](_0x2892bf);})[_0x8d2b('0x44')](function(_0x3f7e38){var _0x401aa0=_0x3f7e38?util[_0x8d2b('0x4b')](_0x3f7e38,{'showHidden':![],'depth':null}):'';logger['error'](_0x8d2b('0x4c'),_0x401aa0);});}module[_0x8d2b('0x4d')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index a78065e..511bc86 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 _0x72a1=['jayson/promise','http','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x72a1,0x1ce));var _0x172a=function(_0x59818a,_0x121ef3){_0x59818a=_0x59818a-0x0;var _0x5e82ea=_0x72a1[_0x59818a];return _0x5e82ea;};'use strict';var _=require('lodash');var util=require(_0x172a('0x0'));var moment=require('moment');var BPromise=require(_0x172a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x172a('0x2'));var db=require(_0x172a('0x3'))['db'];var utils=require(_0x172a('0x4'));var logger=require('../../config/logger')(_0x172a('0x5'));var config=require('../../config/environment');var jayson=require(_0x172a('0x6'));var client=jayson['client'][_0x172a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4859e1,_0x15e050,_0x5bf691){return new BPromise(function(_0x1164c1,_0x3efa61){return client['request'](_0x4859e1,_0x5bf691)[_0x172a('0x8')](function(_0x4928a6){logger[_0x172a('0x9')](_0x172a('0xa'),_0x15e050,_0x172a('0xb'));logger['debug'](_0x172a('0xc'),_0x15e050,_0x172a('0xb'),JSON[_0x172a('0xd')](_0x4928a6));if(_0x4928a6[_0x172a('0xe')]){if(_0x4928a6[_0x172a('0xe')]['code']===0x1f4){logger[_0x172a('0xe')](_0x172a('0xa'),_0x15e050,_0x4928a6[_0x172a('0xe')][_0x172a('0xf')]);return _0x3efa61(_0x4928a6['error'][_0x172a('0xf')]);}logger[_0x172a('0xe')](_0x172a('0xa'),_0x15e050,_0x4928a6['error'][_0x172a('0xf')]);return _0x1164c1(_0x4928a6[_0x172a('0xe')][_0x172a('0xf')]);}else{logger[_0x172a('0x9')]('CloudProvider,\x20%s,\x20%s',_0x15e050,_0x172a('0xb'));_0x1164c1(_0x4928a6[_0x172a('0x10')]['message']);}})[_0x172a('0x11')](function(_0x489d1c){logger[_0x172a('0xe')](_0x172a('0xa'),_0x15e050,_0x489d1c);_0x3efa61(_0x489d1c);});});} \ No newline at end of file +var _0x18f3=['rpc','../../config/environment','jayson/promise','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','../../mysqldb','../../config/logger'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x18f3,0x19f));var _0x318f=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0x18f3[_0x1a36a5];return _0x746243;};'use strict';var _=require('lodash');var util=require(_0x318f('0x0'));var moment=require(_0x318f('0x1'));var BPromise=require(_0x318f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x318f('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x318f('0x4'))(_0x318f('0x5'));var config=require(_0x318f('0x6'));var jayson=require(_0x318f('0x7'));var client=jayson['client'][_0x318f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3579e8,_0x49188c,_0x59abcf){return new BPromise(function(_0x4618c1,_0x547785){return client[_0x318f('0x9')](_0x3579e8,_0x59abcf)[_0x318f('0xa')](function(_0x1479df){logger[_0x318f('0xb')](_0x318f('0xc'),_0x49188c,_0x318f('0xd'));logger[_0x318f('0xe')](_0x318f('0xf'),_0x49188c,_0x318f('0xd'),JSON[_0x318f('0x10')](_0x1479df));if(_0x1479df[_0x318f('0x11')]){if(_0x1479df[_0x318f('0x11')][_0x318f('0x12')]===0x1f4){logger[_0x318f('0x11')](_0x318f('0xc'),_0x49188c,_0x1479df['error']['message']);return _0x547785(_0x1479df[_0x318f('0x11')][_0x318f('0x13')]);}logger[_0x318f('0x11')](_0x318f('0xc'),_0x49188c,_0x1479df[_0x318f('0x11')][_0x318f('0x13')]);return _0x4618c1(_0x1479df[_0x318f('0x11')]['message']);}else{logger[_0x318f('0xb')]('CloudProvider,\x20%s,\x20%s',_0x49188c,'request\x20sent');_0x4618c1(_0x1479df[_0x318f('0x14')][_0x318f('0x13')]);}})['catch'](function(_0x594af8){logger[_0x318f('0x11')]('CloudProvider,\x20%s,\x20%s',_0x49188c,_0x594af8);_0x547785(_0x594af8);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index c441f3b..357683f 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 _0xadb5=['put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','Router','./cloudProvider.controller','get','isAuthenticated','/:id','post','create'];(function(_0x1c02c7,_0x5ca6f4){var _0x33b661=function(_0xad7b5b){while(--_0xad7b5b){_0x1c02c7['push'](_0x1c02c7['shift']());}};_0x33b661(++_0x5ca6f4);}(_0xadb5,0xad));var _0x5adb=function(_0x1f89c0,_0x5f46ee){_0x1f89c0=_0x1f89c0-0x0;var _0x5bcfb7=_0xadb5[_0x1f89c0];return _0x5bcfb7;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['index']);router[_0x5adb('0x2')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller['show']);router[_0x5adb('0x5')]('/',auth[_0x5adb('0x3')](),controller[_0x5adb('0x6')]);router[_0x5adb('0x7')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0x8')]);router[_0x5adb('0x9')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0xa')]);router[_0x5adb('0x2')](_0x5adb('0xb'),auth[_0x5adb('0x3')](),controller['oauth2MicrosoftAuthorize']);router['post'](_0x5adb('0xc'),controller[_0x5adb('0xd')]);module[_0x5adb('0xe')]=router; \ No newline at end of file +var _0xadb5=['put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','Router','./cloudProvider.controller','get','isAuthenticated','/:id','post','create'];(function(_0x4554b8,_0xd15e23){var _0x486ed8=function(_0x511286){while(--_0x511286){_0x4554b8['push'](_0x4554b8['shift']());}};_0x486ed8(++_0xd15e23);}(_0xadb5,0xad));var _0x5adb=function(_0x4a054d,_0x5a3844){_0x4a054d=_0x4a054d-0x0;var _0x5034fa=_0xadb5[_0x4a054d];return _0x5034fa;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['index']);router[_0x5adb('0x2')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller['show']);router[_0x5adb('0x5')]('/',auth[_0x5adb('0x3')](),controller[_0x5adb('0x6')]);router[_0x5adb('0x7')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0x8')]);router[_0x5adb('0x9')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0xa')]);router[_0x5adb('0x2')](_0x5adb('0xb'),auth[_0x5adb('0x3')](),controller['oauth2MicrosoftAuthorize']);router['post'](_0x5adb('0xc'),controller[_0x5adb('0xd')]);module[_0x5adb('0xe')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 6f2cd6d..d92727c 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 _0xb15c=['name','STRING','exports'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0xb15c,0x15e));var _0xcb15=function(_0x10300f,_0x1113ad){_0x10300f=_0x10300f-0x0;var _0x59d00d=_0xb15c[_0x10300f];return _0x59d00d;};'use strict';var Sequelize=require('sequelize');module[_0xcb15('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xcb15('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xcb15('0x2')]},'companyId':{'type':Sequelize[_0xcb15('0x2')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xcb15('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xcb15('0x2')]},'country':{'type':Sequelize[_0xcb15('0x2')]},'email':{'type':Sequelize[_0xcb15('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xcb15('0x2')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0xcb15('0x2')]},'sCity':{'type':Sequelize[_0xcb15('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6b3a=['STRING','sequelize'];(function(_0x2cfb58,_0x3d9412){var _0xd99951=function(_0x329afa){while(--_0x329afa){_0x2cfb58['push'](_0x2cfb58['shift']());}};_0xd99951(++_0x3d9412);}(_0x6b3a,0x1af));var _0xa6b3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6b3a[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xa6b3('0x0'));module['exports']={'name':{'type':Sequelize[_0xa6b3('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xa6b3('0x1')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0xa6b3('0x1')]},'phone':{'type':Sequelize[_0xa6b3('0x1')]},'fax':{'type':Sequelize[_0xa6b3('0x1')]},'type':{'type':Sequelize[_0xa6b3('0x1')]},'street':{'type':Sequelize[_0xa6b3('0x1')]},'postalCode':{'type':Sequelize[_0xa6b3('0x1')]},'city':{'type':Sequelize[_0xa6b3('0x1')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xa6b3('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xa6b3('0x1')]},'sStreet':{'type':Sequelize[_0xa6b3('0x1')]},'sPostalCode':{'type':Sequelize[_0xa6b3('0x1')]},'sCity':{'type':Sequelize[_0xa6b3('0x1')]},'sCountry':{'type':Sequelize[_0xa6b3('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index fbe0013..bdb0dcc 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 _0x183a=['body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','addContacts','CmContact','ids','getContacts','keys','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','apply','reject','save','then','destroy','get','Companies','UserProfileResource','end','stack','name','send','index','CmCompany','describe','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','pick','filter','where','merge','map','options','include','catch','params','rawAttributes','includeAll','find','create'];(function(_0x4bce69,_0x4bb02c){var _0xc865dd=function(_0x50ee29){while(--_0x50ee29){_0x4bce69['push'](_0x4bce69['shift']());}};_0xc865dd(++_0x4bb02c);}(_0x183a,0x155));var _0xa183=function(_0x262fff,_0x5c46d2){_0x262fff=_0x262fff-0x0;var _0x5d6823=_0x183a[_0x262fff];return _0x5d6823;};'use strict';var emlformat=require(_0xa183('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa183('0x1'));var jsonpatch=require(_0xa183('0x2'));var rp=require(_0xa183('0x3'));var moment=require('moment');var BPromise=require(_0xa183('0x4'));var Mustache=require('mustache');var util=require(_0xa183('0x5'));var path=require(_0xa183('0x6'));var sox=require('sox');var csv=require(_0xa183('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa183('0x8'));var _=require(_0xa183('0x9'));var squel=require(_0xa183('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa183('0xb'));var toCsv=require(_0xa183('0x7'));var querystring=require(_0xa183('0xc'));var Papa=require(_0xa183('0xd'));var Redis=require(_0xa183('0xe'));var authService=require(_0xa183('0xf'));var qs=require(_0xa183('0x10'));var as=require(_0xa183('0x11'));var hardwareService=require(_0xa183('0x12'));var logger=require(_0xa183('0x13'))(_0xa183('0x14'));var utils=require(_0xa183('0x15'));var config=require(_0xa183('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xa183('0x17'))['db'];function respondWithStatusCode(_0x9e527c,_0x19ba2a){_0x19ba2a=_0x19ba2a||0xcc;return function(_0x41a8a6){if(_0x41a8a6){return _0x9e527c[_0xa183('0x18')](_0x19ba2a);}return _0x9e527c[_0xa183('0x19')](_0x19ba2a)['end']();};}function respondWithResult(_0x2b0bcb,_0x5a9943){_0x5a9943=_0x5a9943||0xc8;return function(_0x3f0fb2){if(_0x3f0fb2){return _0x2b0bcb[_0xa183('0x19')](_0x5a9943)[_0xa183('0x1a')](_0x3f0fb2);}};}function respondWithFilteredResult(_0x26e2bd,_0x588227){return function(_0x229b2c){if(_0x229b2c){var _0x416e06=typeof _0x588227[_0xa183('0x1b')]==='undefined'&&typeof _0x588227['limit']===_0xa183('0x1c');var _0x31bc7a=_0x229b2c[_0xa183('0x1d')];var _0x3757ea=_0x416e06?0x0:_0x588227[_0xa183('0x1b')];var _0x4d5909=_0x416e06?_0x229b2c[_0xa183('0x1d')]:_0x588227['offset']+_0x588227['limit'];var _0x47bf42;if(_0x4d5909>=_0x31bc7a){_0x4d5909=_0x31bc7a;_0x47bf42=0xc8;}else{_0x47bf42=0xce;}_0x26e2bd[_0xa183('0x19')](_0x47bf42);return _0x26e2bd['set']('Content-Range',_0x3757ea+'-'+_0x4d5909+'/'+_0x31bc7a)[_0xa183('0x1a')](_0x229b2c);}return null;};}function patchUpdates(_0x2058b2){return function(_0x4e19b9){try{jsonpatch[_0xa183('0x1e')](_0x4e19b9,_0x2058b2,!![]);}catch(_0x42caef){return BPromise[_0xa183('0x1f')](_0x42caef);}return _0x4e19b9[_0xa183('0x20')]();};}function saveUpdates(_0x565ee2,_0x1b57f8){return function(_0x9fb0e2){if(_0x9fb0e2){return _0x9fb0e2['update'](_0x565ee2)[_0xa183('0x21')](function(_0x5ac706){return _0x5ac706;});}return null;};}function removeEntity(_0x5d7bdd,_0xdc5d27){return function(_0x56c68a){if(_0x56c68a){return _0x56c68a[_0xa183('0x22')]()['then'](function(){var _0x58a450=_0x56c68a[_0xa183('0x23')]({'plain':!![]});var _0x18f768=_0xa183('0x24');return db[_0xa183('0x25')][_0xa183('0x22')]({'where':{'type':_0x18f768,'resourceId':_0x58a450['id']}})[_0xa183('0x21')](function(){return _0x56c68a;});})['then'](function(){_0x5d7bdd[_0xa183('0x19')](0xcc)[_0xa183('0x26')]();});}};}function handleEntityNotFound(_0x5bc40e,_0x4b3cdc){return function(_0x2f3ceb){if(!_0x2f3ceb){_0x5bc40e[_0xa183('0x18')](0x194);}return _0x2f3ceb;};}function handleError(_0x4c1a3a,_0x1b473a){_0x1b473a=_0x1b473a||0x1f4;return function(_0x4d58ac){logger['error'](_0x4d58ac[_0xa183('0x27')]);if(_0x4d58ac[_0xa183('0x28')]){delete _0x4d58ac['name'];}_0x4c1a3a['status'](_0x1b473a)[_0xa183('0x29')](_0x4d58ac);};}exports[_0xa183('0x2a')]=function(_0x496776,_0x4dd50b){var _0x4fb59b={},_0x285693={},_0x4960d0={'count':0x0,'rows':[]};return db[_0xa183('0x2b')][_0xa183('0x2c')]()[_0xa183('0x21')](function(_0x4a6329){_0x285693[_0xa183('0x2d')]=_['keys'](_0x4a6329);_0x285693[_0xa183('0x2e')]=_['keys'](_0x496776[_0xa183('0x2e')]);_0x285693[_0xa183('0x2f')]=_[_0xa183('0x30')](_0x285693[_0xa183('0x2d')],_0x285693[_0xa183('0x2e')]);_0x4fb59b[_0xa183('0x31')]=_[_0xa183('0x30')](_0x285693[_0xa183('0x2d')],qs[_0xa183('0x32')](_0x496776[_0xa183('0x2e')]['fields']));_0x4fb59b['attributes']=_0x4fb59b[_0xa183('0x31')][_0xa183('0x33')]?_0x4fb59b['attributes']:_0x285693['model'];if(!_0x496776['query'][_0xa183('0x34')](_0xa183('0x35'))){_0x4fb59b[_0xa183('0x36')]=qs[_0xa183('0x36')](_0x496776[_0xa183('0x2e')][_0xa183('0x36')]);_0x4fb59b[_0xa183('0x1b')]=qs[_0xa183('0x1b')](_0x496776['query'][_0xa183('0x1b')]);}_0x4fb59b['order']=qs['sort'](_0x496776[_0xa183('0x2e')][_0xa183('0x37')]);_0x4fb59b['where']=qs[_0xa183('0x2f')](_[_0xa183('0x38')](_0x496776[_0xa183('0x2e')],_0x285693[_0xa183('0x2f')]),_0x4a6329);if(_0x496776[_0xa183('0x2e')][_0xa183('0x39')]){_0x4fb59b[_0xa183('0x3a')]=_[_0xa183('0x3b')](_0x4fb59b[_0xa183('0x3a')],{'$or':_[_0xa183('0x3c')](_0x4fb59b['attributes'],function(_0x39aa98){var _0x4a70c0={};_0x4a70c0[_0x39aa98]={'$like':'%'+_0x496776[_0xa183('0x2e')][_0xa183('0x39')]+'%'};return _0x4a70c0;})});}_0x4fb59b=_[_0xa183('0x3b')]({},_0x4fb59b,_0x496776[_0xa183('0x3d')]);var _0x3f8c9a={'where':_0x4fb59b[_0xa183('0x3a')]};return db[_0xa183('0x2b')][_0xa183('0x1d')](_0x3f8c9a)[_0xa183('0x21')](function(_0x3000dd){_0x4960d0['count']=_0x3000dd;if(_0x496776[_0xa183('0x2e')]['includeAll']){_0x4fb59b[_0xa183('0x3e')]=[{'all':!![]}];}return db[_0xa183('0x2b')]['findAll'](_0x4fb59b);})[_0xa183('0x21')](function(_0x408a81){_0x4960d0['rows']=_0x408a81;return _0x4960d0;})[_0xa183('0x21')](respondWithFilteredResult(_0x4dd50b,_0x4fb59b))[_0xa183('0x3f')](handleError(_0x4dd50b,null));})[_0xa183('0x3f')](handleError(_0x4dd50b,null));};exports['show']=function(_0x245d55,_0x403ba4){var _0x547065={'raw':![],'where':{'id':_0x245d55[_0xa183('0x40')]['id']}},_0x4fb8f1={};_0x4fb8f1[_0xa183('0x2d')]=_['keys'](db['CmCompany'][_0xa183('0x41')]);_0x4fb8f1['query']=_['keys'](_0x245d55['query']);_0x4fb8f1['filters']=_[_0xa183('0x30')](_0x4fb8f1['model'],_0x4fb8f1['query']);_0x547065[_0xa183('0x31')]=_['intersection'](_0x4fb8f1[_0xa183('0x2d')],qs[_0xa183('0x32')](_0x245d55['query'][_0xa183('0x32')]));_0x547065['attributes']=_0x547065[_0xa183('0x31')]['length']?_0x547065[_0xa183('0x31')]:_0x4fb8f1[_0xa183('0x2d')];if(_0x245d55[_0xa183('0x2e')][_0xa183('0x42')]){_0x547065[_0xa183('0x3e')]=[{'all':!![]}];}_0x547065=_[_0xa183('0x3b')]({},_0x547065,_0x245d55[_0xa183('0x3d')]);return db['CmCompany'][_0xa183('0x43')](_0x547065)['then'](handleEntityNotFound(_0x403ba4,null))[_0xa183('0x21')](respondWithResult(_0x403ba4,null))[_0xa183('0x3f')](handleError(_0x403ba4,null));};exports[_0xa183('0x44')]=function(_0x399cea,_0x342437){return db[_0xa183('0x2b')][_0xa183('0x44')](_0x399cea[_0xa183('0x45')],{})['then'](function(_0x5309de){var _0x756ffb=_0x399cea[_0xa183('0x46')]['get']({'plain':!![]});if(!_0x756ffb)throw new Error(_0xa183('0x47'));if(_0x756ffb[_0xa183('0x48')]===_0xa183('0x46')){var _0x5d9fcf=_0x5309de[_0xa183('0x23')]({'plain':!![]});var _0x469aec=_0xa183('0x24');return db[_0xa183('0x49')][_0xa183('0x43')]({'where':{'name':_0x469aec,'userProfileId':_0x756ffb[_0xa183('0x4a')]},'raw':!![]})[_0xa183('0x21')](function(_0x213f32){if(_0x213f32&&_0x213f32[_0xa183('0x4b')]===0x0){return db['UserProfileResource'][_0xa183('0x44')]({'name':_0x5d9fcf[_0xa183('0x28')],'resourceId':_0x5d9fcf['id'],'type':_0x213f32[_0xa183('0x28')],'sectionId':_0x213f32['id']},{})['then'](function(){return _0x5309de;});}else{return _0x5309de;}})['catch'](function(_0x174d7b){logger[_0xa183('0x4c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x174d7b);throw _0x174d7b;});}return _0x5309de;})['then'](respondWithResult(_0x342437,0xc9))['catch'](handleError(_0x342437,null));};exports['update']=function(_0x3ed2f0,_0x722b00){if(_0x3ed2f0[_0xa183('0x45')]['id']){delete _0x3ed2f0[_0xa183('0x45')]['id'];}return db[_0xa183('0x2b')][_0xa183('0x43')]({'where':{'id':_0x3ed2f0[_0xa183('0x40')]['id']}})['then'](handleEntityNotFound(_0x722b00,null))[_0xa183('0x21')](saveUpdates(_0x3ed2f0[_0xa183('0x45')],null))['then'](respondWithResult(_0x722b00,null))['catch'](handleError(_0x722b00,null));};exports['destroy']=function(_0x3ad391,_0x3f307d){return db[_0xa183('0x2b')][_0xa183('0x43')]({'where':{'id':_0x3ad391[_0xa183('0x40')]['id']}})[_0xa183('0x21')](handleEntityNotFound(_0x3f307d,null))[_0xa183('0x21')](removeEntity(_0x3f307d,null))['catch'](handleError(_0x3f307d,null));};exports[_0xa183('0x2c')]=function(_0x5186a7,_0x250964){return db[_0xa183('0x2b')][_0xa183('0x2c')]()[_0xa183('0x21')](respondWithResult(_0x250964,null))[_0xa183('0x3f')](handleError(_0x250964,null));};exports[_0xa183('0x4d')]=function(_0x4d68b0,_0x193e05,_0x12711a){return db[_0xa183('0x4e')]['find']({'where':{'id':_0x4d68b0[_0xa183('0x40')]['id']}})[_0xa183('0x21')](handleEntityNotFound(_0x193e05,null))['then'](function(_0x30f7d0){if(_0x30f7d0){return _0x30f7d0['addContacts'](_0x4d68b0['body'][_0xa183('0x4f')],_['omit'](_0x4d68b0[_0xa183('0x45')],['ids','id'])||{});}})[_0xa183('0x21')](respondWithResult(_0x193e05,null))[_0xa183('0x3f')](handleError(_0x193e05,null));};exports[_0xa183('0x50')]=function(_0x5e6e08,_0x13c989,_0x148712){var _0x5e90de={};var _0x392cd5={};var _0x324511;var _0x198e3b;return db[_0xa183('0x2b')]['findOne']({'where':{'id':_0x5e6e08['params']['id']}})[_0xa183('0x21')](handleEntityNotFound(_0x13c989,null))[_0xa183('0x21')](function(_0x323fee){if(_0x323fee){_0x324511=_0x323fee;_0x392cd5[_0xa183('0x2d')]=_[_0xa183('0x51')](db['CmContact'][_0xa183('0x41')]);_0x392cd5[_0xa183('0x2e')]=_[_0xa183('0x51')](_0x5e6e08[_0xa183('0x2e')]);_0x392cd5[_0xa183('0x2f')]=_[_0xa183('0x30')](_0x392cd5[_0xa183('0x2d')],_0x392cd5[_0xa183('0x2e')]);_0x5e90de[_0xa183('0x31')]=_['intersection'](_0x392cd5[_0xa183('0x2d')],qs[_0xa183('0x32')](_0x5e6e08[_0xa183('0x2e')]['fields']));_0x5e90de[_0xa183('0x31')]=_0x5e90de[_0xa183('0x31')][_0xa183('0x33')]?_0x5e90de[_0xa183('0x31')]:_0x392cd5[_0xa183('0x2d')];_0x5e90de['order']=qs[_0xa183('0x37')](_0x5e6e08[_0xa183('0x2e')][_0xa183('0x37')]);_0x5e90de['where']=qs['filters'](_[_0xa183('0x38')](_0x5e6e08[_0xa183('0x2e')],_0x392cd5[_0xa183('0x2f')]));if(_0x5e6e08['query'][_0xa183('0x39')]){_0x5e90de['where']=_[_0xa183('0x3b')](_0x5e90de[_0xa183('0x3a')],{'$or':_[_0xa183('0x3c')](_0x5e90de[_0xa183('0x31')],function(_0x40b000){var _0x4355b9={};_0x4355b9[_0x40b000]={'$like':'%'+_0x5e6e08[_0xa183('0x2e')][_0xa183('0x39')]+'%'};return _0x4355b9;})});}_0x5e90de=_[_0xa183('0x3b')]({},_0x5e90de,_0x5e6e08[_0xa183('0x3d')]);return _0x324511[_0xa183('0x50')](_0x5e90de);}})[_0xa183('0x21')](function(_0x1c9157){if(_0x1c9157){_0x198e3b=_0x1c9157['length'];if(!_0x5e6e08[_0xa183('0x2e')]['hasOwnProperty'](_0xa183('0x35'))){_0x5e90de[_0xa183('0x36')]=qs[_0xa183('0x36')](_0x5e6e08[_0xa183('0x2e')]['limit']);_0x5e90de[_0xa183('0x1b')]=qs['offset'](_0x5e6e08['query'][_0xa183('0x1b')]);}return _0x324511[_0xa183('0x50')](_0x5e90de);}})[_0xa183('0x21')](function(_0x4dd2e0){if(_0x4dd2e0){return _0x4dd2e0?{'count':_0x198e3b,'rows':_0x4dd2e0}:null;}})[_0xa183('0x21')](respondWithResult(_0x13c989,null))[_0xa183('0x3f')](handleError(_0x13c989,null));}; \ No newline at end of file +var _0xb8d1=['query','filters','intersection','fields','attributes','hasOwnProperty','sort','pick','filter','where','map','merge','options','includeAll','include','findAll','rows','catch','show','params','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','destroy','addContacts','CmContact','ids','omit','getContacts','findOne','rawAttributes','length','order','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','then','get','Companies','error','stack','name','send','CmCompany','describe','model','keys'];(function(_0x44113a,_0x17c405){var _0x526baf=function(_0xf5e3e2){while(--_0xf5e3e2){_0x44113a['push'](_0x44113a['shift']());}};_0x526baf(++_0x17c405);}(_0xb8d1,0x7c));var _0x1b8d=function(_0x4fc421,_0x94e88){_0x4fc421=_0x4fc421-0x0;var _0x8c6d63=_0xb8d1[_0x4fc421];return _0x8c6d63;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1b8d('0x0'));var jsonpatch=require(_0x1b8d('0x1'));var rp=require(_0x1b8d('0x2'));var moment=require(_0x1b8d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1b8d('0x4'));var util=require('util');var path=require(_0x1b8d('0x5'));var sox=require(_0x1b8d('0x6'));var csv=require(_0x1b8d('0x7'));var ejs=require(_0x1b8d('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1b8d('0x9'));var squel=require(_0x1b8d('0xa'));var crypto=require(_0x1b8d('0xb'));var jsforce=require(_0x1b8d('0xc'));var deskjs=require(_0x1b8d('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1b8d('0xe'));var Redis=require('ioredis');var authService=require(_0x1b8d('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x1b8d('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1b8d('0x11'))(_0x1b8d('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x358575,_0x39ebec){_0x39ebec=_0x39ebec||0xcc;return function(_0x227473){if(_0x227473){return _0x358575[_0x1b8d('0x13')](_0x39ebec);}return _0x358575[_0x1b8d('0x14')](_0x39ebec)[_0x1b8d('0x15')]();};}function respondWithResult(_0x14e7b8,_0x314770){_0x314770=_0x314770||0xc8;return function(_0x4a0155){if(_0x4a0155){return _0x14e7b8['status'](_0x314770)[_0x1b8d('0x16')](_0x4a0155);}};}function respondWithFilteredResult(_0x16381c,_0x5e74bf){return function(_0x54c764){if(_0x54c764){var _0x3f1fb9=typeof _0x5e74bf[_0x1b8d('0x17')]===_0x1b8d('0x18')&&typeof _0x5e74bf['limit']===_0x1b8d('0x18');var _0x232ef3=_0x54c764[_0x1b8d('0x19')];var _0x343f5c=_0x3f1fb9?0x0:_0x5e74bf[_0x1b8d('0x17')];var _0x22e1fa=_0x3f1fb9?_0x54c764['count']:_0x5e74bf[_0x1b8d('0x17')]+_0x5e74bf[_0x1b8d('0x1a')];var _0x5a1a99;if(_0x22e1fa>=_0x232ef3){_0x22e1fa=_0x232ef3;_0x5a1a99=0xc8;}else{_0x5a1a99=0xce;}_0x16381c[_0x1b8d('0x14')](_0x5a1a99);return _0x16381c['set'](_0x1b8d('0x1b'),_0x343f5c+'-'+_0x22e1fa+'/'+_0x232ef3)[_0x1b8d('0x16')](_0x54c764);}return null;};}function patchUpdates(_0x5d48a2){return function(_0x1430bc){try{jsonpatch[_0x1b8d('0x1c')](_0x1430bc,_0x5d48a2,!![]);}catch(_0x1ff80a){return BPromise[_0x1b8d('0x1d')](_0x1ff80a);}return _0x1430bc[_0x1b8d('0x1e')]();};}function saveUpdates(_0x100a4a,_0x5d0a6d){return function(_0x4d1a28){if(_0x4d1a28){return _0x4d1a28['update'](_0x100a4a)[_0x1b8d('0x1f')](function(_0xefe3fd){return _0xefe3fd;});}return null;};}function removeEntity(_0x40e8a4,_0x608d1e){return function(_0x1d7b04){if(_0x1d7b04){return _0x1d7b04['destroy']()[_0x1b8d('0x1f')](function(){var _0x216e6d=_0x1d7b04[_0x1b8d('0x20')]({'plain':!![]});var _0x422c21=_0x1b8d('0x21');return db['UserProfileResource']['destroy']({'where':{'type':_0x422c21,'resourceId':_0x216e6d['id']}})[_0x1b8d('0x1f')](function(){return _0x1d7b04;});})[_0x1b8d('0x1f')](function(){_0x40e8a4['status'](0xcc)[_0x1b8d('0x15')]();});}};}function handleEntityNotFound(_0x459795,_0x39800a){return function(_0x404e98){if(!_0x404e98){_0x459795[_0x1b8d('0x13')](0x194);}return _0x404e98;};}function handleError(_0xf40435,_0x2cc9bf){_0x2cc9bf=_0x2cc9bf||0x1f4;return function(_0xb96160){logger[_0x1b8d('0x22')](_0xb96160[_0x1b8d('0x23')]);if(_0xb96160[_0x1b8d('0x24')]){delete _0xb96160['name'];}_0xf40435[_0x1b8d('0x14')](_0x2cc9bf)[_0x1b8d('0x25')](_0xb96160);};}exports['index']=function(_0x2fa2fd,_0x23648d){var _0x4e5f4b={},_0x1101c7={},_0x202583={'count':0x0,'rows':[]};return db[_0x1b8d('0x26')][_0x1b8d('0x27')]()[_0x1b8d('0x1f')](function(_0x4fc6f0){_0x1101c7[_0x1b8d('0x28')]=_[_0x1b8d('0x29')](_0x4fc6f0);_0x1101c7[_0x1b8d('0x2a')]=_['keys'](_0x2fa2fd[_0x1b8d('0x2a')]);_0x1101c7[_0x1b8d('0x2b')]=_[_0x1b8d('0x2c')](_0x1101c7[_0x1b8d('0x28')],_0x1101c7[_0x1b8d('0x2a')]);_0x4e5f4b['attributes']=_[_0x1b8d('0x2c')](_0x1101c7['model'],qs[_0x1b8d('0x2d')](_0x2fa2fd[_0x1b8d('0x2a')][_0x1b8d('0x2d')]));_0x4e5f4b[_0x1b8d('0x2e')]=_0x4e5f4b['attributes']['length']?_0x4e5f4b[_0x1b8d('0x2e')]:_0x1101c7[_0x1b8d('0x28')];if(!_0x2fa2fd[_0x1b8d('0x2a')][_0x1b8d('0x2f')]('nolimit')){_0x4e5f4b[_0x1b8d('0x1a')]=qs[_0x1b8d('0x1a')](_0x2fa2fd[_0x1b8d('0x2a')][_0x1b8d('0x1a')]);_0x4e5f4b[_0x1b8d('0x17')]=qs[_0x1b8d('0x17')](_0x2fa2fd[_0x1b8d('0x2a')]['offset']);}_0x4e5f4b['order']=qs[_0x1b8d('0x30')](_0x2fa2fd[_0x1b8d('0x2a')][_0x1b8d('0x30')]);_0x4e5f4b['where']=qs[_0x1b8d('0x2b')](_[_0x1b8d('0x31')](_0x2fa2fd[_0x1b8d('0x2a')],_0x1101c7[_0x1b8d('0x2b')]),_0x4fc6f0);if(_0x2fa2fd[_0x1b8d('0x2a')][_0x1b8d('0x32')]){_0x4e5f4b[_0x1b8d('0x33')]=_['merge'](_0x4e5f4b[_0x1b8d('0x33')],{'$or':_[_0x1b8d('0x34')](_0x4e5f4b[_0x1b8d('0x2e')],function(_0x332a90){var _0x1bc411={};_0x1bc411[_0x332a90]={'$like':'%'+_0x2fa2fd['query'][_0x1b8d('0x32')]+'%'};return _0x1bc411;})});}_0x4e5f4b=_[_0x1b8d('0x35')]({},_0x4e5f4b,_0x2fa2fd[_0x1b8d('0x36')]);var _0x55e28f={'where':_0x4e5f4b['where']};return db[_0x1b8d('0x26')][_0x1b8d('0x19')](_0x55e28f)[_0x1b8d('0x1f')](function(_0x42c84f){_0x202583[_0x1b8d('0x19')]=_0x42c84f;if(_0x2fa2fd[_0x1b8d('0x2a')][_0x1b8d('0x37')]){_0x4e5f4b[_0x1b8d('0x38')]=[{'all':!![]}];}return db[_0x1b8d('0x26')][_0x1b8d('0x39')](_0x4e5f4b);})[_0x1b8d('0x1f')](function(_0x344afb){_0x202583[_0x1b8d('0x3a')]=_0x344afb;return _0x202583;})[_0x1b8d('0x1f')](respondWithFilteredResult(_0x23648d,_0x4e5f4b))[_0x1b8d('0x3b')](handleError(_0x23648d,null));})[_0x1b8d('0x3b')](handleError(_0x23648d,null));};exports[_0x1b8d('0x3c')]=function(_0xf735fa,_0x595af8){var _0x32f39a={'raw':![],'where':{'id':_0xf735fa[_0x1b8d('0x3d')]['id']}},_0x5bb1c5={};_0x5bb1c5[_0x1b8d('0x28')]=_['keys'](db[_0x1b8d('0x26')]['rawAttributes']);_0x5bb1c5[_0x1b8d('0x2a')]=_[_0x1b8d('0x29')](_0xf735fa[_0x1b8d('0x2a')]);_0x5bb1c5[_0x1b8d('0x2b')]=_[_0x1b8d('0x2c')](_0x5bb1c5[_0x1b8d('0x28')],_0x5bb1c5[_0x1b8d('0x2a')]);_0x32f39a['attributes']=_[_0x1b8d('0x2c')](_0x5bb1c5[_0x1b8d('0x28')],qs['fields'](_0xf735fa[_0x1b8d('0x2a')][_0x1b8d('0x2d')]));_0x32f39a['attributes']=_0x32f39a[_0x1b8d('0x2e')]['length']?_0x32f39a[_0x1b8d('0x2e')]:_0x5bb1c5[_0x1b8d('0x28')];if(_0xf735fa[_0x1b8d('0x2a')][_0x1b8d('0x37')]){_0x32f39a[_0x1b8d('0x38')]=[{'all':!![]}];}_0x32f39a=_[_0x1b8d('0x35')]({},_0x32f39a,_0xf735fa[_0x1b8d('0x36')]);return db[_0x1b8d('0x26')]['find'](_0x32f39a)['then'](handleEntityNotFound(_0x595af8,null))[_0x1b8d('0x1f')](respondWithResult(_0x595af8,null))[_0x1b8d('0x3b')](handleError(_0x595af8,null));};exports[_0x1b8d('0x3e')]=function(_0x150d91,_0x30d4a2){return db[_0x1b8d('0x26')][_0x1b8d('0x3e')](_0x150d91[_0x1b8d('0x3f')],{})['then'](function(_0x40a8fe){var _0x11cea6=_0x150d91['user'][_0x1b8d('0x20')]({'plain':!![]});if(!_0x11cea6)throw new Error(_0x1b8d('0x40'));if(_0x11cea6[_0x1b8d('0x41')]===_0x1b8d('0x42')){var _0x4e42ba=_0x40a8fe[_0x1b8d('0x20')]({'plain':!![]});var _0x30fdd1=_0x1b8d('0x21');return db[_0x1b8d('0x43')][_0x1b8d('0x44')]({'where':{'name':_0x30fdd1,'userProfileId':_0x11cea6[_0x1b8d('0x45')]},'raw':!![]})['then'](function(_0x4aaeef){if(_0x4aaeef&&_0x4aaeef['autoAssociation']===0x0){return db[_0x1b8d('0x46')][_0x1b8d('0x3e')]({'name':_0x4e42ba['name'],'resourceId':_0x4e42ba['id'],'type':_0x4aaeef[_0x1b8d('0x24')],'sectionId':_0x4aaeef['id']},{})['then'](function(){return _0x40a8fe;});}else{return _0x40a8fe;}})['catch'](function(_0x3399f3){logger[_0x1b8d('0x22')](_0x1b8d('0x47'),_0x3399f3);throw _0x3399f3;});}return _0x40a8fe;})[_0x1b8d('0x1f')](respondWithResult(_0x30d4a2,0xc9))['catch'](handleError(_0x30d4a2,null));};exports[_0x1b8d('0x48')]=function(_0x2d07fd,_0x3fe532){if(_0x2d07fd[_0x1b8d('0x3f')]['id']){delete _0x2d07fd[_0x1b8d('0x3f')]['id'];}return db[_0x1b8d('0x26')][_0x1b8d('0x44')]({'where':{'id':_0x2d07fd[_0x1b8d('0x3d')]['id']}})[_0x1b8d('0x1f')](handleEntityNotFound(_0x3fe532,null))['then'](saveUpdates(_0x2d07fd[_0x1b8d('0x3f')],null))[_0x1b8d('0x1f')](respondWithResult(_0x3fe532,null))[_0x1b8d('0x3b')](handleError(_0x3fe532,null));};exports[_0x1b8d('0x49')]=function(_0xe07c2a,_0x132e2f){return db['CmCompany']['find']({'where':{'id':_0xe07c2a['params']['id']}})[_0x1b8d('0x1f')](handleEntityNotFound(_0x132e2f,null))[_0x1b8d('0x1f')](removeEntity(_0x132e2f,null))[_0x1b8d('0x3b')](handleError(_0x132e2f,null));};exports[_0x1b8d('0x27')]=function(_0x377c6f,_0x2adfcf){return db[_0x1b8d('0x26')][_0x1b8d('0x27')]()[_0x1b8d('0x1f')](respondWithResult(_0x2adfcf,null))[_0x1b8d('0x3b')](handleError(_0x2adfcf,null));};exports[_0x1b8d('0x4a')]=function(_0x4cbc4d,_0x372f51,_0x56287d){return db[_0x1b8d('0x4b')][_0x1b8d('0x44')]({'where':{'id':_0x4cbc4d[_0x1b8d('0x3d')]['id']}})[_0x1b8d('0x1f')](handleEntityNotFound(_0x372f51,null))[_0x1b8d('0x1f')](function(_0x482a80){if(_0x482a80){return _0x482a80[_0x1b8d('0x4a')](_0x4cbc4d[_0x1b8d('0x3f')][_0x1b8d('0x4c')],_[_0x1b8d('0x4d')](_0x4cbc4d[_0x1b8d('0x3f')],[_0x1b8d('0x4c'),'id'])||{});}})[_0x1b8d('0x1f')](respondWithResult(_0x372f51,null))['catch'](handleError(_0x372f51,null));};exports[_0x1b8d('0x4e')]=function(_0x21d295,_0x442103,_0x1e0a56){var _0x452588={};var _0x450320={};var _0x1c3dea;var _0x4a935c;return db['CmCompany'][_0x1b8d('0x4f')]({'where':{'id':_0x21d295[_0x1b8d('0x3d')]['id']}})[_0x1b8d('0x1f')](handleEntityNotFound(_0x442103,null))[_0x1b8d('0x1f')](function(_0xe5f80c){if(_0xe5f80c){_0x1c3dea=_0xe5f80c;_0x450320[_0x1b8d('0x28')]=_['keys'](db[_0x1b8d('0x4b')][_0x1b8d('0x50')]);_0x450320[_0x1b8d('0x2a')]=_['keys'](_0x21d295[_0x1b8d('0x2a')]);_0x450320[_0x1b8d('0x2b')]=_[_0x1b8d('0x2c')](_0x450320[_0x1b8d('0x28')],_0x450320[_0x1b8d('0x2a')]);_0x452588[_0x1b8d('0x2e')]=_[_0x1b8d('0x2c')](_0x450320['model'],qs[_0x1b8d('0x2d')](_0x21d295[_0x1b8d('0x2a')][_0x1b8d('0x2d')]));_0x452588[_0x1b8d('0x2e')]=_0x452588[_0x1b8d('0x2e')][_0x1b8d('0x51')]?_0x452588[_0x1b8d('0x2e')]:_0x450320['model'];_0x452588[_0x1b8d('0x52')]=qs[_0x1b8d('0x30')](_0x21d295[_0x1b8d('0x2a')][_0x1b8d('0x30')]);_0x452588[_0x1b8d('0x33')]=qs[_0x1b8d('0x2b')](_['pick'](_0x21d295[_0x1b8d('0x2a')],_0x450320['filters']));if(_0x21d295[_0x1b8d('0x2a')][_0x1b8d('0x32')]){_0x452588[_0x1b8d('0x33')]=_[_0x1b8d('0x35')](_0x452588['where'],{'$or':_['map'](_0x452588[_0x1b8d('0x2e')],function(_0x1501d4){var _0x4d607a={};_0x4d607a[_0x1501d4]={'$like':'%'+_0x21d295['query'][_0x1b8d('0x32')]+'%'};return _0x4d607a;})});}_0x452588=_[_0x1b8d('0x35')]({},_0x452588,_0x21d295[_0x1b8d('0x36')]);return _0x1c3dea[_0x1b8d('0x4e')](_0x452588);}})[_0x1b8d('0x1f')](function(_0x541222){if(_0x541222){_0x4a935c=_0x541222[_0x1b8d('0x51')];if(!_0x21d295['query'][_0x1b8d('0x2f')]('nolimit')){_0x452588[_0x1b8d('0x1a')]=qs[_0x1b8d('0x1a')](_0x21d295[_0x1b8d('0x2a')][_0x1b8d('0x1a')]);_0x452588[_0x1b8d('0x17')]=qs['offset'](_0x21d295[_0x1b8d('0x2a')][_0x1b8d('0x17')]);}return _0x1c3dea[_0x1b8d('0x4e')](_0x452588);}})[_0x1b8d('0x1f')](function(_0x4425aa){if(_0x4425aa){return _0x4425aa?{'count':_0x4a935c,'rows':_0x4425aa}:null;}})[_0x1b8d('0x1f')](respondWithResult(_0x442103,null))[_0x1b8d('0x3b')](handleError(_0x442103,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 6fa2597..f63837e 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 _0xd2c9=['moment','bluebird','path','rimraf','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','../../config/logger'];(function(_0x55d073,_0x591dfc){var _0x126820=function(_0x1f46d4){while(--_0x1f46d4){_0x55d073['push'](_0x55d073['shift']());}};_0x126820(++_0x591dfc);}(_0xd2c9,0x17e));var _0x9d2c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd2c9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9d2c('0x0'));var util=require('util');var logger=require(_0x9d2c('0x1'))('api');var moment=require(_0x9d2c('0x2'));var BPromise=require(_0x9d2c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9d2c('0x4'));var rimraf=require(_0x9d2c('0x5'));var config=require(_0x9d2c('0x6'));var attributes=require(_0x9d2c('0x7'));module[_0x9d2c('0x8')]=function(_0x46002f,_0x2722a7){return _0x46002f[_0x9d2c('0x9')](_0x9d2c('0xa'),attributes,{'tableName':_0x9d2c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x364f=['bluebird','path','rimraf','../../config/environment','./cmCompany.attributes','exports','define','lodash','../../config/logger','api'];(function(_0x148c51,_0x11ab83){var _0x354000=function(_0x6e403d){while(--_0x6e403d){_0x148c51['push'](_0x148c51['shift']());}};_0x354000(++_0x11ab83);}(_0x364f,0x1b5));var _0xf364=function(_0x5ddaac,_0x2697a8){_0x5ddaac=_0x5ddaac-0x0;var _0x2a9c58=_0x364f[_0x5ddaac];return _0x2a9c58;};'use strict';var _=require(_0xf364('0x0'));var util=require('util');var logger=require(_0xf364('0x1'))(_0xf364('0x2'));var moment=require('moment');var BPromise=require(_0xf364('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf364('0x4'));var rimraf=require(_0xf364('0x5'));var config=require(_0xf364('0x6'));var attributes=require(_0xf364('0x7'));module[_0xf364('0x8')]=function(_0x5c7713,_0x2199a4){return _0x5c7713[_0xf364('0x9')]('CmCompany',attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js index 3456ab6..0cc89e8 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 _0xc95c=['error','message','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','info','CmCompany,\x20%s,\x20%s','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','code'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xc95c,0x16c));var _0xcc95=function(_0x5b13b7,_0x586d4f){_0x5b13b7=_0x5b13b7-0x0;var _0x2dea3c=_0xc95c[_0x5b13b7];return _0x2dea3c;};'use strict';var _=require(_0xcc95('0x0'));var util=require(_0xcc95('0x1'));var moment=require('moment');var BPromise=require(_0xcc95('0x2'));var rs=require(_0xcc95('0x3'));var fs=require('fs');var Redis=require(_0xcc95('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xcc95('0x5'));var logger=require(_0xcc95('0x6'))(_0xcc95('0x7'));var config=require('../../config/environment');var jayson=require(_0xcc95('0x8'));var client=jayson[_0xcc95('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2481f4,_0x16a5da,_0x54a7ca){return new BPromise(function(_0x19bcc6,_0x2c4cf9){return client[_0xcc95('0xa')](_0x2481f4,_0x54a7ca)['then'](function(_0x346a91){logger[_0xcc95('0xb')](_0xcc95('0xc'),_0x16a5da,_0xcc95('0xd'));logger['debug'](_0xcc95('0xe'),_0x16a5da,_0xcc95('0xd'),JSON['stringify'](_0x346a91));if(_0x346a91['error']){if(_0x346a91['error'][_0xcc95('0xf')]===0x1f4){logger[_0xcc95('0x10')](_0xcc95('0xc'),_0x16a5da,_0x346a91[_0xcc95('0x10')][_0xcc95('0x11')]);return _0x2c4cf9(_0x346a91[_0xcc95('0x10')]['message']);}logger[_0xcc95('0x10')]('CmCompany,\x20%s,\x20%s',_0x16a5da,_0x346a91[_0xcc95('0x10')][_0xcc95('0x11')]);return _0x19bcc6(_0x346a91[_0xcc95('0x10')]['message']);}else{logger['info'](_0xcc95('0xc'),_0x16a5da,'request\x20sent');_0x19bcc6(_0x346a91['result']['message']);}})[_0xcc95('0x12')](function(_0xf042e0){logger[_0xcc95('0x10')](_0xcc95('0xc'),_0x16a5da,_0xf042e0);_0x2c4cf9(_0xf042e0);});});} \ No newline at end of file +var _0x2cd7=['CmCompany,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','debug','stringify','error','code'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x2cd7,0x1bb));var _0x72cd=function(_0x2a8bdf,_0xc5288c){_0x2a8bdf=_0x2a8bdf-0x0;var _0x1ab822=_0x2cd7[_0x2a8bdf];return _0x1ab822;};'use strict';var _=require(_0x72cd('0x0'));var util=require(_0x72cd('0x1'));var moment=require(_0x72cd('0x2'));var BPromise=require(_0x72cd('0x3'));var rs=require(_0x72cd('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x72cd('0x5'))['db'];var utils=require(_0x72cd('0x6'));var logger=require(_0x72cd('0x7'))(_0x72cd('0x8'));var config=require(_0x72cd('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x72cd('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8ea233,_0x467e66,_0xe8f7e0){return new BPromise(function(_0x48996f,_0xed52b9){return client[_0x72cd('0xb')](_0x8ea233,_0xe8f7e0)[_0x72cd('0xc')](function(_0xd81219){logger[_0x72cd('0xd')]('CmCompany,\x20%s,\x20%s',_0x467e66,_0x72cd('0xe'));logger[_0x72cd('0xf')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x467e66,_0x72cd('0xe'),JSON[_0x72cd('0x10')](_0xd81219));if(_0xd81219[_0x72cd('0x11')]){if(_0xd81219[_0x72cd('0x11')][_0x72cd('0x12')]===0x1f4){logger['error'](_0x72cd('0x13'),_0x467e66,_0xd81219[_0x72cd('0x11')][_0x72cd('0x14')]);return _0xed52b9(_0xd81219[_0x72cd('0x11')]['message']);}logger[_0x72cd('0x11')]('CmCompany,\x20%s,\x20%s',_0x467e66,_0xd81219[_0x72cd('0x11')][_0x72cd('0x14')]);return _0x48996f(_0xd81219[_0x72cd('0x11')]['message']);}else{logger[_0x72cd('0xd')](_0x72cd('0x13'),_0x467e66,_0x72cd('0xe'));_0x48996f(_0xd81219['result'][_0x72cd('0x14')]);}})[_0x72cd('0x15')](function(_0x262343){logger[_0x72cd('0x11')]('CmCompany,\x20%s,\x20%s',_0x467e66,_0x262343);_0xed52b9(_0x262343);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 5ad116b..dbdefbe 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 _0xdbcd=['./cmCompany.controller','get','isAuthenticated','/describe','describe','/:id','/:id/contacts','getContacts','create','post','addContacts','put','delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xb84e8f,_0x5eceae){var _0x3ea7a6=function(_0x2f844c){while(--_0x2f844c){_0xb84e8f['push'](_0xb84e8f['shift']());}};_0x3ea7a6(++_0x5eceae);}(_0xdbcd,0x67));var _0xddbc=function(_0x1996b1,_0x2818d0){_0x1996b1=_0x1996b1-0x0;var _0x5c6fcf=_0xdbcd[_0x1996b1];return _0x5c6fcf;};'use strict';var multer=require('multer');var util=require(_0xddbc('0x0'));var path=require(_0xddbc('0x1'));var timeout=require(_0xddbc('0x2'));var express=require('express');var router=express[_0xddbc('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xddbc('0x4'));var interaction=require(_0xddbc('0x5'));var config=require(_0xddbc('0x6'));var controller=require(_0xddbc('0x7'));router[_0xddbc('0x8')]('/',auth[_0xddbc('0x9')](),controller['index']);router[_0xddbc('0x8')](_0xddbc('0xa'),auth['isAuthenticated'](),controller[_0xddbc('0xb')]);router[_0xddbc('0x8')](_0xddbc('0xc'),auth[_0xddbc('0x9')](),controller['show']);router['get'](_0xddbc('0xd'),auth['isAuthenticated'](),controller[_0xddbc('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xddbc('0xf')]);router[_0xddbc('0x10')]('/:id/contacts',auth[_0xddbc('0x9')](),controller[_0xddbc('0x11')]);router[_0xddbc('0x12')]('/:id',auth[_0xddbc('0x9')](),controller['update']);router[_0xddbc('0x13')](_0xddbc('0xc'),auth[_0xddbc('0x9')](),controller[_0xddbc('0x14')]);module[_0xddbc('0x15')]=router; \ No newline at end of file +var _0x52d9=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmCompany.controller','get','isAuthenticated','/describe','show','/:id/contacts','getContacts','create','post','addContacts','update','delete','destroy'];(function(_0x539d8c,_0x5ecc6d){var _0x37dee2=function(_0x3f9e47){while(--_0x3f9e47){_0x539d8c['push'](_0x539d8c['shift']());}};_0x37dee2(++_0x5ecc6d);}(_0x52d9,0xdc));var _0x952d=function(_0x300e96,_0x329b01){_0x300e96=_0x300e96-0x0;var _0x3a4fe6=_0x52d9[_0x300e96];return _0x3a4fe6;};'use strict';var multer=require(_0x952d('0x0'));var util=require(_0x952d('0x1'));var path=require(_0x952d('0x2'));var timeout=require(_0x952d('0x3'));var express=require(_0x952d('0x4'));var router=express[_0x952d('0x5')]();var fs_extra=require(_0x952d('0x6'));var auth=require(_0x952d('0x7'));var interaction=require(_0x952d('0x8'));var config=require('../../config/environment');var controller=require(_0x952d('0x9'));router[_0x952d('0xa')]('/',auth[_0x952d('0xb')](),controller['index']);router[_0x952d('0xa')](_0x952d('0xc'),auth[_0x952d('0xb')](),controller['describe']);router['get']('/:id',auth[_0x952d('0xb')](),controller[_0x952d('0xd')]);router[_0x952d('0xa')](_0x952d('0xe'),auth[_0x952d('0xb')](),controller[_0x952d('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x952d('0x10')]);router[_0x952d('0x11')](_0x952d('0xe'),auth['isAuthenticated'](),controller[_0x952d('0x12')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x952d('0x13')]);router[_0x952d('0x14')]('/:id',auth[_0x952d('0xb')](),controller[_0x952d('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 352c2de..0b57061 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 _0x621b=['INTEGER','NOW','lodash','exports','STRING','TEXT'];(function(_0x12939d,_0x24971d){var _0x38f9ab=function(_0x23a8d5){while(--_0x23a8d5){_0x12939d['push'](_0x12939d['shift']());}};_0x38f9ab(++_0x24971d);}(_0x621b,0x18e));var _0xb621=function(_0x57d13b,_0x52d8cb){_0x57d13b=_0x57d13b-0x0;var _0x467696=_0x621b[_0x57d13b];return _0x467696;};'use strict';var _=require(_0xb621('0x0'));var Sequelize=require('sequelize');module[_0xb621('0x1')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0xb621('0x2')]},'street':{'type':Sequelize[_0xb621('0x2')]},'postalCode':{'type':Sequelize[_0xb621('0x2')]},'city':{'type':Sequelize[_0xb621('0x2')]},'country':{'type':Sequelize[_0xb621('0x2')]},'dateOfBirth':{'type':Sequelize[_0xb621('0x2')]},'description':{'type':Sequelize[_0xb621('0x3')]},'phone':{'type':Sequelize[_0xb621('0x2')]},'mobile':{'type':Sequelize[_0xb621('0x2')]},'fax':{'type':Sequelize[_0xb621('0x2')]},'email':{'type':Sequelize[_0xb621('0x2')]},'url':{'type':Sequelize[_0xb621('0x2')]},'facebook':{'type':Sequelize[_0xb621('0x2')]},'fb_data':{'type':Sequelize[_0xb621('0x2')]},'twitter':{'type':Sequelize[_0xb621('0x2')]},'skype':{'type':Sequelize[_0xb621('0x2')]},'teams':{'type':Sequelize[_0xb621('0x2')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0xb621('0x2')]},'wechat':{'type':Sequelize[_0xb621('0x2')]},'telegram':{'type':Sequelize[_0xb621('0x2')]},'UserId':{'type':Sequelize[_0xb621('0x4')]},'AdditionalPhones':{'type':Sequelize[_0xb621('0x2')]},'priority':{'type':Sequelize[_0xb621('0x4')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0xb621('0x5')]},'dialTimezone':{'type':Sequelize[_0xb621('0x2')]},'utcOffset':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x85f1=['lodash','sequelize','exports','STRING','TEXT','INTEGER','DATE'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x85f1,0x1f1));var _0x185f=function(_0x412e27,_0x20a978){_0x412e27=_0x412e27-0x0;var _0x53da42=_0x85f1[_0x412e27];return _0x53da42;};'use strict';var _=require(_0x185f('0x0'));var Sequelize=require(_0x185f('0x1'));module[_0x185f('0x2')]={'firstName':{'type':Sequelize[_0x185f('0x3')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x185f('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x185f('0x3')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x185f('0x3')]},'description':{'type':Sequelize[_0x185f('0x4')]},'phone':{'type':Sequelize[_0x185f('0x3')]},'mobile':{'type':Sequelize[_0x185f('0x3')]},'fax':{'type':Sequelize[_0x185f('0x3')]},'email':{'type':Sequelize[_0x185f('0x3')]},'url':{'type':Sequelize[_0x185f('0x3')]},'facebook':{'type':Sequelize[_0x185f('0x3')]},'fb_data':{'type':Sequelize[_0x185f('0x3')]},'twitter':{'type':Sequelize[_0x185f('0x3')]},'skype':{'type':Sequelize[_0x185f('0x3')]},'teams':{'type':Sequelize[_0x185f('0x3')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x185f('0x3')]},'telegram':{'type':Sequelize[_0x185f('0x3')]},'UserId':{'type':Sequelize[_0x185f('0x5')]},'AdditionalPhones':{'type':Sequelize[_0x185f('0x3')]},'priority':{'type':Sequelize[_0x185f('0x5')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x185f('0x6')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize[_0x185f('0x3')]},'utcOffset':{'type':Sequelize[_0x185f('0x5')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 5b5404c..55094d5 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 _0x4d9a=['WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','describe','join','isNil','dialTimezone','utcOffset','additionalPhones','duplicates','where','push','ListId','findOrCreate','contact','show','Tag','Tags','color','tag','CmContactHasItem','Phones','ContactItemType','literal','Phones.OrderBy','$and','omit','format','cf_%d','timezones','pickBy','startsWith','map','isEmpty','table','cm_contacts','setFields','id\x20=\x20?','toParam','sequelize','text','values','phone','CmHopper','getTags','findOne','filters','intersection','model','attributes','fields','sort','filter','options','hasOwnProperty','nolimit','setTags','ids','setAdditionalPhones','all','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','PHONE','CmHopperAdditionalPhone','item','ItemType','CmHopperId','ItemType.OrderBy','bulkCreate','getAdditionalPhones','`ItemType`.OrderBy','duplicateAdditionalPhones','fromContactId','CmContactId','hopperId','getHoppers','rawAttributes','order','pick','includeAll','include','rows','getHopperFinals','ContactId','getJscriptySessions','No\x20ListId\x20specified','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','binding_keys','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','root','server/files/tmp','file','filename','chmodSync','0777','../../components/import/cm/csv','socket_timestamp','pid','send','upload','createReadStream','parse','meta','import','agent','binding','No\x20firstName\x20column\x20specified','child_process','fork','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','getJourney','mail','chat','fax','whatsapp','voice','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','Invalid\x20date\x20for\x20range\x20from\x20filter','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','callerid','starttime','endtime','duration','note','createdAt','userSecondDisposition','UserId','fullname','findAndCountAll','Website','closed','closedAt','secondDisposition','thirdDisposition','Account','key','Owner','DESC','browserName','customerIp','customerPort','osName','ratingType','referer','subject','substatus','openchannel','externalUrl','startCase','flatten','sortBy','value','bluebird','util','path','lodash','squel','papaparse','../../components/contacts','../../components/parsers/qs','api','../../config/environment/shared','../../mysqldb','redis','localhost','./cmContact.socket','register','status','json','offset','undefined','limit','count','update','then','destroy','end','error','stack','name','index','getOptions','findAll','catch','find','params','CmContact','keys','length','columnName','displayName','query','analytics','CmCustomField','cf_','alias','custom','type','info','forEach','merge','body','from','get','mergeWith','isArray','tags','[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','SmsInteraction','FaxInteraction','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','JscriptySessionReport'];(function(_0x276758,_0x582b00){var _0x3c535d=function(_0x355ab2){while(--_0x355ab2){_0x276758['push'](_0x276758['shift']());}};_0x3c535d(++_0x582b00);}(_0x4d9a,0x1b6));var _0xa4d9=function(_0x36a2f0,_0x14a8e2){_0x36a2f0=_0x36a2f0-0x0;var _0x1ef6ca=_0x4d9a[_0x36a2f0];return _0x1ef6ca;};'use strict';var moment=require('moment');var BPromise=require(_0xa4d9('0x0'));var util=require(_0xa4d9('0x1'));var path=require(_0xa4d9('0x2'));var fs=require('fs');var _=require(_0xa4d9('0x3'));var squel=require(_0xa4d9('0x4'));var Papa=require(_0xa4d9('0x5'));var Redis=require('ioredis');var contacts=require(_0xa4d9('0x6'));var qs=require(_0xa4d9('0x7'));var logger=require('../../config/logger')(_0xa4d9('0x8'));var config=require('../../config/environment');var shared=require(_0xa4d9('0x9'));var db=require(_0xa4d9('0xa'))['db'];config[_0xa4d9('0xb')]=_['defaults'](config[_0xa4d9('0xb')],{'host':_0xa4d9('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa4d9('0xb')]));require(_0xa4d9('0xd'))[_0xa4d9('0xe')](socket);function respondWithResult(_0x598e2e,_0x1dcece){_0x1dcece=_0x1dcece||0xc8;return function(_0x458362){if(_0x458362){return _0x598e2e[_0xa4d9('0xf')](_0x1dcece)[_0xa4d9('0x10')](_0x458362);}};}function respondWithFilteredResult(_0x45c22b,_0x31d6bb){return function(_0x4ae289){if(_0x4ae289){var _0x2c023c=typeof _0x31d6bb[_0xa4d9('0x11')]===_0xa4d9('0x12')&&typeof _0x31d6bb[_0xa4d9('0x13')]===_0xa4d9('0x12');var _0x23e1a5=_0x4ae289[_0xa4d9('0x14')];var _0x34cc76=_0x2c023c?0x0:_0x31d6bb[_0xa4d9('0x11')];var _0x2aee92=_0x2c023c?_0x4ae289[_0xa4d9('0x14')]:_0x31d6bb[_0xa4d9('0x11')]+_0x31d6bb[_0xa4d9('0x13')];var _0x3bd4dd;if(_0x2aee92>=_0x23e1a5){_0x2aee92=_0x23e1a5;_0x3bd4dd=0xc8;}else{_0x3bd4dd=0xce;}_0x45c22b[_0xa4d9('0xf')](_0x3bd4dd);return _0x45c22b['set']('Content-Range',_0x34cc76+'-'+_0x2aee92+'/'+_0x23e1a5)[_0xa4d9('0x10')](_0x4ae289);}return null;};}function saveUpdates(_0x4a9817){return function(_0x452196){if(_0x452196){return _0x452196[_0xa4d9('0x15')](_0x4a9817)[_0xa4d9('0x16')](function(_0x1abd36){return _0x1abd36;});}return null;};}function removeEntity(_0x215d55){return function(_0x5962f6){if(_0x5962f6){return _0x5962f6[_0xa4d9('0x17')]()[_0xa4d9('0x16')](function(){_0x215d55[_0xa4d9('0xf')](0xcc)[_0xa4d9('0x18')]();});}};}function handleEntityNotFound(_0x9ac11b){return function(_0x2ab52b){if(!_0x2ab52b){_0x9ac11b['sendStatus'](0x194);}return _0x2ab52b;};}function handleError(_0x373b31,_0x51f19a){_0x51f19a=_0x51f19a||0x1f4;return function(_0x38626e){logger[_0xa4d9('0x19')](_0x38626e[_0xa4d9('0x1a')]);if(_0x38626e['name']){delete _0x38626e[_0xa4d9('0x1b')];}_0x373b31['status'](_0x51f19a)['send'](_0x38626e);};}exports[_0xa4d9('0x1c')]=function(_0x30f205,_0x5b65e1){var _0x1af68d={};return contacts['describe']()[_0xa4d9('0x16')](function(_0x3b06bb){_0x1af68d=qs[_0xa4d9('0x1d')](_0x3b06bb,_0x30f205);return contacts[_0xa4d9('0x1e')](_0x30f205['query'],_0x30f205['user'],_0x1af68d,_0x3b06bb);})[_0xa4d9('0x16')](respondWithFilteredResult(_0x5b65e1,_0x1af68d))[_0xa4d9('0x1f')](handleError(_0x5b65e1,null));};exports[_0xa4d9('0x17')]=function(_0x467997,_0x3bf1f0){return db['CmContact'][_0xa4d9('0x20')]({'where':{'id':_0x467997[_0xa4d9('0x21')]['id']}})[_0xa4d9('0x16')](handleEntityNotFound(_0x3bf1f0,null))[_0xa4d9('0x16')](removeEntity(_0x3bf1f0,null))[_0xa4d9('0x1f')](handleError(_0x3bf1f0,null));};exports['describe']=function(_0x2103f6,_0x106a0a){return db[_0xa4d9('0x22')]['describe']()[_0xa4d9('0x16')](function(_0x19de56){delete _0x19de56['tags'];for(var _0x56a356=0x0;_0x56a3560x0){return new Promise(function(_0x523f8d){var _0x1269d6=[];for(var _0x2ca65e=0x0;_0x2ca65e<_0x29ae74[_0xa4d9('0x24')];_0x2ca65e++){_0x1269d6[_0xa4d9('0x57')](insertAdditionalPhones(_0x29ae74[_0x2ca65e][_0xa4d9('0x5a')],_0x29ae74[_0x2ca65e][_0xa4d9('0x54')]));}Promise['all'](_0x1269d6)[_0xa4d9('0x16')](function(){_0x523f8d(0x1);});})[_0xa4d9('0x16')](function(){return{'success':_0x5a0d3d,'failure':_0x54ba28,'duplicates':_0x52a6b9};});}else{return{'success':_0x5a0d3d,'failure':_0x54ba28,'duplicates':_0x52a6b9};}}})[_0xa4d9('0x16')](respondWithResult(_0x16ecd0,0xc9))['catch'](handleError(_0x16ecd0,null));};exports[_0xa4d9('0x5b')]=function(_0x16acb6,_0xbcce93){var _0x219d9c;return db[_0xa4d9('0x22')]['describe']()[_0xa4d9('0x16')](function(_0x429a3c){return db[_0xa4d9('0x22')][_0xa4d9('0x20')]({'where':{'id':_0x16acb6[_0xa4d9('0x21')]['id']},'include':[{'model':db[_0xa4d9('0x5c')],'as':_0xa4d9('0x5d'),'attributes':['id',_0xa4d9('0x1b'),_0xa4d9('0x5e')],'required':_0x16acb6[_0xa4d9('0x27')][_0xa4d9('0x5f')]?!![]:![]},{'model':db[_0xa4d9('0x60')],'as':_0xa4d9('0x61'),'where':{'CmContactId':_0x16acb6[_0xa4d9('0x21')]['id']},'required':![],'include':[{'model':db[_0xa4d9('0x62')],'as':'ItemType'}]}],'order':[db['sequelize'][_0xa4d9('0x63')](_0xa4d9('0x64'))],'attributes':_['keys'](_0x429a3c)});})[_0xa4d9('0x16')](function(_0xfbc3c9){if(!_[_0xa4d9('0x51')](_0xfbc3c9)){_0x219d9c=_0xfbc3c9[_0xa4d9('0x33')]({'plain':!![]});var _0x207d98={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xfbc3c9&&_0xfbc3c9[_0xa4d9('0x58')]){if(_0xfbc3c9[_0xa4d9('0x58')]){_0x207d98['where'][_0xa4d9('0x65')][_0xa4d9('0x57')]({'ListId':{'$ne':_0xfbc3c9[_0xa4d9('0x58')]}});}}return db[_0xa4d9('0x29')][_0xa4d9('0x1e')](_0x207d98);}})['then'](function(_0x3941e7){if(!_[_0xa4d9('0x51')](_0x3941e7)){return _[_0xa4d9('0x66')](_0x219d9c,_['map'](_0x3941e7,function(_0x579485){return util[_0xa4d9('0x67')](_0xa4d9('0x68'),_0x579485['id']);}));}})[_0xa4d9('0x16')](handleEntityNotFound(_0xbcce93,null))[_0xa4d9('0x16')](respondWithResult(_0xbcce93,null))[_0xa4d9('0x1f')](handleError(_0xbcce93,null));};exports[_0xa4d9('0x15')]=function(_0x280738,_0x1d04b2){var _0x5d1693;if(_0x280738[_0xa4d9('0x31')]['id']){delete _0x280738['body']['id'];}if(!_[_0xa4d9('0x51')](_0x280738['body'][_0xa4d9('0x52')])){var _0x561ecd=_0x280738[_0xa4d9('0x31')][_0xa4d9('0x52')];if(!_['isNil'](shared[_0xa4d9('0x69')][_0x561ecd]))_0x280738['body'][_0xa4d9('0x53')]=shared['timezones'][_0x561ecd]['utcOffset'];}return db[_0xa4d9('0x22')][_0xa4d9('0x20')]({'where':{'id':_0x280738[_0xa4d9('0x21')]['id']}})[_0xa4d9('0x16')](handleEntityNotFound(_0x1d04b2,null))[_0xa4d9('0x16')](saveUpdates(_0x280738['body'],null))[_0xa4d9('0x16')](function(_0xea988c){_0x5d1693=_0xea988c;var _0x22f578={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xea988c&&_0xea988c[_0xa4d9('0x58')]){if(_0xea988c['ListId']){_0x22f578[_0xa4d9('0x56')][_0xa4d9('0x65')][_0xa4d9('0x57')]({'ListId':{'$ne':_0xea988c[_0xa4d9('0x58')]}});}}return db[_0xa4d9('0x29')]['findAll'](_0x22f578);})[_0xa4d9('0x16')](function(_0x2b96c2){if(_0x2b96c2){return _[_0xa4d9('0x66')](_[_0xa4d9('0x6a')](_0x280738[_0xa4d9('0x31')],function(_0x5a79f9,_0x480da0){return _[_0xa4d9('0x6b')](_0x480da0,_0xa4d9('0x2a'));}),_[_0xa4d9('0x6c')](_0x2b96c2,function(_0x1df72a){return util[_0xa4d9('0x67')](_0xa4d9('0x68'),_0x1df72a['id']);}));}})[_0xa4d9('0x16')](function(_0x34f242){if(_0x34f242&&!_[_0xa4d9('0x6d')](_0x34f242)){var _0x35aab2=squel[_0xa4d9('0x15')]()[_0xa4d9('0x6e')](_0xa4d9('0x6f'))[_0xa4d9('0x70')](_0x34f242)[_0xa4d9('0x56')](_0xa4d9('0x71'),_0x280738[_0xa4d9('0x21')]['id'])[_0xa4d9('0x72')]();return db[_0xa4d9('0x73')][_0xa4d9('0x27')](_0x35aab2[_0xa4d9('0x74')],{'replacements':_0x35aab2[_0xa4d9('0x75')]});}})[_0xa4d9('0x16')](function(){if(_0x280738['body'][_0xa4d9('0x76')]&&_0x5d1693){return db[_0xa4d9('0x77')][_0xa4d9('0x15')]({'phone':_0x280738[_0xa4d9('0x31')]['phone'],'OrderBy':0x0},{'where':{'ContactId':_0x5d1693['id']}});}})[_0xa4d9('0x16')](function(){return _0x5d1693;})[_0xa4d9('0x16')](respondWithResult(_0x1d04b2,null))[_0xa4d9('0x1f')](handleError(_0x1d04b2,null));};exports[_0xa4d9('0x78')]=function(_0x4e88a4,_0x2319f8){var _0x3d0afc={};var _0x593c7f={};var _0xbea5c;var _0x30c857;return db[_0xa4d9('0x22')][_0xa4d9('0x79')]({'where':{'id':_0x4e88a4[_0xa4d9('0x21')]['id']}})[_0xa4d9('0x16')](handleEntityNotFound(_0x2319f8,null))['then'](function(_0x154aa9){if(_0x154aa9){_0xbea5c=_0x154aa9;_0x593c7f['model']=_['keys'](db[_0xa4d9('0x5c')]['rawAttributes']);_0x593c7f[_0xa4d9('0x27')]=_[_0xa4d9('0x23')](_0x4e88a4[_0xa4d9('0x27')]);_0x593c7f[_0xa4d9('0x7a')]=_[_0xa4d9('0x7b')](_0x593c7f[_0xa4d9('0x7c')],_0x593c7f[_0xa4d9('0x27')]);_0x3d0afc[_0xa4d9('0x7d')]=_[_0xa4d9('0x7b')](_0x593c7f[_0xa4d9('0x7c')],qs['fields'](_0x4e88a4[_0xa4d9('0x27')][_0xa4d9('0x7e')]));_0x3d0afc[_0xa4d9('0x7d')]=_0x3d0afc[_0xa4d9('0x7d')]['length']?_0x3d0afc[_0xa4d9('0x7d')]:_0x593c7f[_0xa4d9('0x7c')];_0x3d0afc['order']=qs[_0xa4d9('0x7f')](_0x4e88a4[_0xa4d9('0x27')][_0xa4d9('0x7f')]);_0x3d0afc[_0xa4d9('0x56')]=qs[_0xa4d9('0x7a')](_['pick'](_0x4e88a4[_0xa4d9('0x27')],_0x593c7f['filters']));if(_0x4e88a4[_0xa4d9('0x27')]['filter']){_0x3d0afc[_0xa4d9('0x56')]=_[_0xa4d9('0x30')](_0x3d0afc['where'],{'$or':_['map'](_0x3d0afc[_0xa4d9('0x7d')],function(_0x50dfc8){var _0x24d64d={};_0x24d64d[_0x50dfc8]={'$like':'%'+_0x4e88a4[_0xa4d9('0x27')][_0xa4d9('0x80')]+'%'};return _0x24d64d;})});}_0x3d0afc=_['merge']({},_0x3d0afc,_0x4e88a4[_0xa4d9('0x81')]);return _0xbea5c[_0xa4d9('0x78')](_0x3d0afc);}})[_0xa4d9('0x16')](function(_0x3b74b7){if(_0x3b74b7){_0x30c857=_0x3b74b7[_0xa4d9('0x24')];if(!_0x4e88a4['query'][_0xa4d9('0x82')](_0xa4d9('0x83'))){_0x3d0afc[_0xa4d9('0x13')]=qs['limit'](_0x4e88a4[_0xa4d9('0x27')]['limit']);_0x3d0afc['offset']=qs['offset'](_0x4e88a4[_0xa4d9('0x27')][_0xa4d9('0x11')]);}return _0xbea5c['getTags'](_0x3d0afc);}})[_0xa4d9('0x16')](function(_0x20000f){if(_0x20000f){return _0x20000f?{'count':_0x30c857,'rows':_0x20000f}:null;}})[_0xa4d9('0x16')](respondWithResult(_0x2319f8,null))['catch'](handleError(_0x2319f8,null));};exports[_0xa4d9('0x84')]=function(_0x492260,_0x22b338){if(_0x492260[_0xa4d9('0x31')]['id']){delete _0x492260[_0xa4d9('0x31')]['id'];}return db['CmContact'][_0xa4d9('0x79')]({'where':{'id':_0x492260[_0xa4d9('0x21')]['id']}})['then'](handleEntityNotFound(_0x22b338,null))[_0xa4d9('0x16')](function(_0x2e462f){if(_0x2e462f){return _0x2e462f[_0xa4d9('0x84')](_0x492260[_0xa4d9('0x31')][_0xa4d9('0x85')]||[]);}return null;})[_0xa4d9('0x16')](respondWithResult(_0x22b338,null))['catch'](handleError(_0x22b338,null));};exports[_0xa4d9('0x86')]=function(_0x4f25e0,_0x194d2b){var _0x359513=[];_0x359513[_0xa4d9('0x57')](addAdditionalPhones(_0x4f25e0[_0xa4d9('0x31')]));Promise[_0xa4d9('0x87')](_0x359513)[_0xa4d9('0x16')](function(){_0x359513=[];_0x359513[_0xa4d9('0x57')](deleteCmHopperPhones(_0x4f25e0[_0xa4d9('0x31')]['id']));_0x359513[_0xa4d9('0x57')](addCmHopperPhones(_0x4f25e0[_0xa4d9('0x31')]['id']));Promise[_0xa4d9('0x87')](_0x359513)[_0xa4d9('0x16')](function(){return[0x1];})[_0xa4d9('0x16')](respondWithResult(_0x194d2b,null));});};function addAdditionalPhones(_0x25cb83){var _0x56adae;return new Promise(function(_0x37055e){return db[_0xa4d9('0x60')][_0xa4d9('0x17')]({'where':{'CmContactId':_0x25cb83['id']}})[_0xa4d9('0x16')](function(){db[_0xa4d9('0x62')]['findAll']({'raw':!![],'attributes':['id',_0xa4d9('0x88')]})['then'](function(_0x9d9e77){var _0x4dd112=[];for(var _0x13d247=0x0;_0x13d247<_0x25cb83[_0xa4d9('0x89')][_0xa4d9('0x24')];_0x13d247++){var _0x2dd5a5=_0x25cb83['item_types']?_[_0xa4d9('0x51')](_0x25cb83[_0xa4d9('0x8a')][_0x13d247])?'':_0x25cb83[_0xa4d9('0x8a')][_0x13d247]:_0x25cb83['items'][_0x13d247]['ItemTypeId']?_0x25cb83[_0xa4d9('0x89')][_0x13d247][_0xa4d9('0x8b')]:'';var _0x2f0f6a=_['isNil'](_0x25cb83['items'][_0x13d247]['description'])?'':_0x25cb83[_0xa4d9('0x89')][_0x13d247][_0xa4d9('0x8c')];var _0x13cc0e=_0x2dd5a5+':'+_0x25cb83['items'][_0x13d247][_0xa4d9('0x76')]+'§'+_0x2f0f6a;if(_['isNil'](_0x56adae))_0x56adae=_0x13cc0e;else _0x56adae+=';'+_0x13cc0e;var _0x4d804e=null;var _0x342491=null;if(_0x25cb83[_0xa4d9('0x8a')]){if(!_[_0xa4d9('0x51')](_0x25cb83[_0xa4d9('0x8a')][_0x13d247])){_0x342491=_[_0xa4d9('0x20')](_0x9d9e77,function(_0x522f3f){return _0x522f3f['id']===_0x25cb83[_0xa4d9('0x8a')][_0x13d247];});if(!_[_0xa4d9('0x51')](_0x342491)){_0x4d804e=_0x342491[_0xa4d9('0x88')];}}}else{if(!_[_0xa4d9('0x51')](_0x25cb83[_0xa4d9('0x89')][_0x13d247])){_0x342491=_['find'](_0x9d9e77,function(_0x334918){return _0x334918['id']===_0x25cb83[_0xa4d9('0x89')][_0x13d247][_0xa4d9('0x8b')];});if(!_[_0xa4d9('0x51')](_0x342491)){_0x4d804e=_0x13d247;}}}if(_[_0xa4d9('0x51')](_0x4d804e)){_0x4d804e=0x64;}_0x4dd112[_0xa4d9('0x57')](addAdditionalPhone(_0x25cb83['id'],_0x25cb83[_0xa4d9('0x89')][_0x13d247][_0xa4d9('0x76')],_0x25cb83[_0xa4d9('0x8a')]?_[_0xa4d9('0x51')](_0x25cb83[_0xa4d9('0x8a')][_0x13d247])?null:_0x25cb83['item_types'][_0x13d247]:_0x25cb83[_0xa4d9('0x89')][_0x13d247][_0xa4d9('0x8b')]?_0x25cb83[_0xa4d9('0x89')][_0x13d247][_0xa4d9('0x8b')]:null,_0x4d804e,_0x2f0f6a));}Promise[_0xa4d9('0x87')](_0x4dd112)[_0xa4d9('0x16')](function(){db[_0xa4d9('0x22')]['update']({'AdditionalPhones':_0x56adae},{'where':{'id':_0x25cb83['id']}})[_0xa4d9('0x16')](function(){_0x37055e(0x1);});});});});});}function addAdditionalPhone(_0xd195b1,_0x597b4d,_0x56646a,_0x56632e,_0x48a4a7){return db[_0xa4d9('0x60')][_0xa4d9('0x20')]({'where':{'CmContactId':_0xd195b1,'item':_0x597b4d}})[_0xa4d9('0x16')](function(_0x1072e4){if(_0x1072e4)logger[_0xa4d9('0x2e')](_0xa4d9('0x8d'),_0x1072e4);else{db[_0xa4d9('0x60')]['create']({'CmContactId':_0xd195b1,'item':_0x597b4d,'ItemTypeId':_0x56646a,'OrderBy':_0x56632e,'ItemClass':_0xa4d9('0x8e'),'description':_0x48a4a7});}});}function deleteCmHopperPhones(_0x51dbcb){return new Promise(function(_0x2b769e){return db[_0xa4d9('0x77')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x51dbcb}})[_0xa4d9('0x16')](function(_0x191d0a){db[_0xa4d9('0x8f')][_0xa4d9('0x17')]({'where':{'CmHopperId':{'$in':_['map'](_0x191d0a,'id')}}});})[_0xa4d9('0x16')](function(){_0x2b769e(0x1);});});}function addCmHopperPhones(_0x19e22b){return new Promise(function(_0x42fd61){return db[_0xa4d9('0x77')][_0xa4d9('0x1e')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x19e22b}})[_0xa4d9('0x16')](function(_0x446f2f){var _0x51dd4e=[];_[_0xa4d9('0x6c')](_0x446f2f,function(_0x507208){_0x51dd4e[_0xa4d9('0x57')](createCmHopperPhone(_0x19e22b,_0x507208['id']));});Promise[_0xa4d9('0x87')](_0x51dd4e)[_0xa4d9('0x16')](function(){_0x42fd61(0x1);});});});}function createCmHopperPhone(_0x2d8a71,_0x243822){return new Promise(function(_0x2cf1c4){db[_0xa4d9('0x60')][_0xa4d9('0x1e')]({'raw':!![],'attributes':[_0xa4d9('0x90'),_0xa4d9('0x88')],'where':{'CmContactId':_0x2d8a71,'ItemClass':'PHONE'},'include':[{'model':db[_0xa4d9('0x62')],'attributes':[_0xa4d9('0x88')],'as':_0xa4d9('0x91')}],'order':[_0xa4d9('0x88'),db[_0xa4d9('0x73')][_0xa4d9('0x63')]('`ItemType`.OrderBy')]})['then'](function(_0xa0ca68){var _0x1f5208=0x1;var _0x136143=_[_0xa4d9('0x6c')](_0xa0ca68,function(_0x3615bc){_0x3615bc[_0xa4d9('0x92')]=_0x243822;_0x3615bc[_0xa4d9('0x76')]=_0x3615bc['item'];_0x3615bc[_0xa4d9('0x88')]=_0x1f5208;delete _0x3615bc[_0xa4d9('0x93')];_0x1f5208=_0x1f5208+0x1;return _0x3615bc;});return db[_0xa4d9('0x8f')][_0xa4d9('0x94')](_0x136143,{});})[_0xa4d9('0x16')](function(){_0x2cf1c4(0x1);});});}function insertAdditionalPhones(_0x436fbd,_0x103d4c){return new Promise(function(_0x1c0e2d){var _0x578668=[];for(var _0x541483=0x0;_0x541483<_0x103d4c[_0xa4d9('0x24')];_0x541483++){var _0x36c794=_0x103d4c[_0x541483];_0x578668[_0xa4d9('0x57')](parseContactItemType(_0x36c794));}Promise[_0xa4d9('0x87')](_0x578668)[_0xa4d9('0x16')](function(){var _0x16f386={'id':_0x436fbd['id'],'items':_0x103d4c};return addAdditionalPhones(_0x16f386)[_0xa4d9('0x16')](function(){return addCmHopperPhones(_0x436fbd['id']);});})[_0xa4d9('0x16')](function(){_0x1c0e2d(_0x436fbd);});});}function parseContactItemType(_0x4a08d2){return new Promise(function(_0x49bd98){if(_0x4a08d2[_0xa4d9('0x82')](_0xa4d9('0x8b'))){_0x49bd98(_0x4a08d2);}else{return db[_0xa4d9('0x62')][_0xa4d9('0x20')]({'where':{'name':_0x4a08d2[_0xa4d9('0x91')]}})[_0xa4d9('0x16')](function(_0x485cf7){if(_[_0xa4d9('0x51')](_0x485cf7))_0x4a08d2[_0xa4d9('0x8b')]=null;else _0x4a08d2['ItemTypeId']=_0x485cf7['id'];_0x49bd98(_0x4a08d2);});}});}exports[_0xa4d9('0x95')]=function(_0x2b0645,_0x1d30fb){return db[_0xa4d9('0x60')][_0xa4d9('0x1e')]({'raw':!![],'where':{'CmContactId':_0x2b0645[_0xa4d9('0x21')]['id'],'ItemClass':_0xa4d9('0x8e')},'include':[{'model':db[_0xa4d9('0x62')],'as':_0xa4d9('0x91')}],'order':[['OrderBy'],[db[_0xa4d9('0x73')][_0xa4d9('0x63')](_0xa4d9('0x96'))]]})[_0xa4d9('0x16')](function(_0xbebc41){return _0xbebc41;})[_0xa4d9('0x16')](respondWithResult(_0x1d30fb,null))[_0xa4d9('0x1f')](handleError(_0x1d30fb,null));};exports[_0xa4d9('0x97')]=function(_0x3a4248,_0x51028b){return db[_0xa4d9('0x60')][_0xa4d9('0x1e')]({'raw':!![],'where':{'CmContactId':_0x3a4248[_0xa4d9('0x31')][_0xa4d9('0x98')]}})[_0xa4d9('0x16')](function(_0x2e0244){var _0x49ac75=_['map'](_0x2e0244,function(_0x2f9515){_0x2f9515[_0xa4d9('0x99')]=_0x3a4248[_0xa4d9('0x31')]['toContactId'];return _0x2f9515;});return db[_0xa4d9('0x60')]['bulkCreate'](_0x49ac75,{});})[_0xa4d9('0x16')](function(){return addCmHopperPhones(_0x3a4248['body']['toContactId']);})[_0xa4d9('0x16')](function(){return['ok'];})['then'](respondWithResult(_0x51028b,null))['catch'](handleError(_0x51028b,null));};exports['rescheduleAdditionalPhones']=function(_0x340258,_0x8a11e){var _0x30592f=[];_0x30592f[_0xa4d9('0x57')](createCmHopperPhone(_0x340258[_0xa4d9('0x31')]['id'],_0x340258[_0xa4d9('0x31')][_0xa4d9('0x9a')]));Promise[_0xa4d9('0x87')](_0x30592f)[_0xa4d9('0x16')](function(){return[0x1];})['then'](respondWithResult(_0x8a11e,null));};exports[_0xa4d9('0x9b')]=function(_0x46a251,_0x34ee70){var _0x65931e={'raw':![],'where':{}};var _0x1b2b04={};var _0x355f27={'count':0x0,'rows':[]};return db[_0xa4d9('0x22')][_0xa4d9('0x79')]({'where':{'id':_0x46a251[_0xa4d9('0x21')]['id']}})['then'](handleEntityNotFound(_0x34ee70,null))['then'](function(_0x1ea521){if(_0x1ea521){_0x1b2b04[_0xa4d9('0x7c')]=_[_0xa4d9('0x23')](db[_0xa4d9('0x77')][_0xa4d9('0x9c')]);_0x1b2b04[_0xa4d9('0x27')]=_['keys'](_0x46a251[_0xa4d9('0x27')]);_0x1b2b04[_0xa4d9('0x7a')]=_[_0xa4d9('0x7b')](_0x1b2b04[_0xa4d9('0x7c')],_0x1b2b04[_0xa4d9('0x27')]);_0x65931e['attributes']=_[_0xa4d9('0x7b')](_0x1b2b04['model'],qs[_0xa4d9('0x7e')](_0x46a251[_0xa4d9('0x27')][_0xa4d9('0x7e')]));_0x65931e[_0xa4d9('0x7d')]=_0x65931e[_0xa4d9('0x7d')][_0xa4d9('0x24')]?_0x65931e[_0xa4d9('0x7d')]:_0x1b2b04[_0xa4d9('0x7c')];if(!_0x46a251[_0xa4d9('0x27')]['hasOwnProperty'](_0xa4d9('0x83'))){_0x65931e[_0xa4d9('0x13')]=qs[_0xa4d9('0x13')](_0x46a251[_0xa4d9('0x27')][_0xa4d9('0x13')]);_0x65931e[_0xa4d9('0x11')]=qs['offset'](_0x46a251['query'][_0xa4d9('0x11')]);}_0x65931e[_0xa4d9('0x9d')]=qs['sort'](_0x46a251[_0xa4d9('0x27')]['sort']);_0x65931e[_0xa4d9('0x56')]=qs[_0xa4d9('0x7a')](_[_0xa4d9('0x9e')](_0x46a251['query'],_0x1b2b04['filters']));_0x65931e[_0xa4d9('0x56')]['ContactId']=_0x1ea521['id'];if(_0x46a251[_0xa4d9('0x27')]['filter']){_0x65931e[_0xa4d9('0x56')]=_['merge'](_0x65931e[_0xa4d9('0x56')],{'$or':_[_0xa4d9('0x6c')](_0x65931e[_0xa4d9('0x7d')],function(_0x43dc71){var _0x319e41={};_0x319e41[_0x43dc71]={'$like':'%'+_0x46a251[_0xa4d9('0x27')]['filter']+'%'};return _0x319e41;})});}_0x65931e=_[_0xa4d9('0x30')]({},_0x65931e,_0x46a251[_0xa4d9('0x81')]);return db[_0xa4d9('0x77')]['count']({'where':_0x65931e['where']})['then'](function(_0x1b2926){_0x355f27[_0xa4d9('0x14')]=_0x1b2926;if(_0x46a251[_0xa4d9('0x27')][_0xa4d9('0x9f')]){_0x65931e[_0xa4d9('0xa0')]=[{'all':!![]}];}return db[_0xa4d9('0x77')][_0xa4d9('0x1e')](_0x65931e);})['then'](function(_0x4b4cb1){_0x355f27[_0xa4d9('0xa1')]=_0x4b4cb1;return _0x355f27;});}})[_0xa4d9('0x16')](respondWithFilteredResult(_0x34ee70,_0x65931e))['catch'](handleError(_0x34ee70,null));};exports['getHopperHistories']=function(_0x597bda,_0x244781){var _0x43169c={'raw':!![],'where':{}};var _0x11e85b={};var _0x35df81={'count':0x0,'rows':[]};return db[_0xa4d9('0x22')][_0xa4d9('0x79')]({'where':{'id':_0x597bda['params']['id']}})[_0xa4d9('0x16')](handleEntityNotFound(_0x244781,null))[_0xa4d9('0x16')](function(_0x7b7ef5){if(_0x7b7ef5){_0x11e85b[_0xa4d9('0x7c')]=_[_0xa4d9('0x23')](db[_0xa4d9('0x45')][_0xa4d9('0x9c')]);_0x11e85b[_0xa4d9('0x27')]=_['keys'](_0x597bda[_0xa4d9('0x27')]);_0x11e85b[_0xa4d9('0x7a')]=_['intersection'](_0x11e85b[_0xa4d9('0x7c')],_0x11e85b[_0xa4d9('0x27')]);_0x43169c[_0xa4d9('0x7d')]=_[_0xa4d9('0x7b')](_0x11e85b[_0xa4d9('0x7c')],qs[_0xa4d9('0x7e')](_0x597bda['query'][_0xa4d9('0x7e')]));_0x43169c[_0xa4d9('0x7d')]=_0x43169c[_0xa4d9('0x7d')][_0xa4d9('0x24')]?_0x43169c[_0xa4d9('0x7d')]:_0x11e85b['model'];if(!_0x597bda[_0xa4d9('0x27')]['hasOwnProperty'](_0xa4d9('0x83'))){_0x43169c[_0xa4d9('0x13')]=qs[_0xa4d9('0x13')](_0x597bda[_0xa4d9('0x27')][_0xa4d9('0x13')]);_0x43169c[_0xa4d9('0x11')]=qs[_0xa4d9('0x11')](_0x597bda[_0xa4d9('0x27')]['offset']);}_0x43169c['order']=qs[_0xa4d9('0x7f')](_0x597bda['query']['sort']);_0x43169c[_0xa4d9('0x56')]=qs[_0xa4d9('0x7a')](_[_0xa4d9('0x9e')](_0x597bda[_0xa4d9('0x27')],_0x11e85b[_0xa4d9('0x7a')]));_0x43169c[_0xa4d9('0x56')]['ContactId']=_0x7b7ef5['id'];if(_0x597bda[_0xa4d9('0x27')]['filter']){_0x43169c[_0xa4d9('0x56')]=_[_0xa4d9('0x30')](_0x43169c[_0xa4d9('0x56')],{'$or':_['map'](_0x43169c[_0xa4d9('0x7d')],function(_0x58e836){var _0x2612f3={};_0x2612f3[_0x58e836]={'$like':'%'+_0x597bda[_0xa4d9('0x27')][_0xa4d9('0x80')]+'%'};return _0x2612f3;})});}_0x43169c=_[_0xa4d9('0x30')]({},_0x43169c,_0x597bda[_0xa4d9('0x81')]);return db[_0xa4d9('0x45')]['count']({'where':_0x43169c[_0xa4d9('0x56')]})[_0xa4d9('0x16')](function(_0x2a5c56){_0x35df81['count']=_0x2a5c56;if(_0x597bda[_0xa4d9('0x27')][_0xa4d9('0x9f')]){_0x43169c[_0xa4d9('0xa0')]=[{'all':!![]}];}return db[_0xa4d9('0x45')][_0xa4d9('0x1e')](_0x43169c);})[_0xa4d9('0x16')](function(_0x4937b0){_0x35df81[_0xa4d9('0xa1')]=_0x4937b0;return _0x35df81;});}})['then'](respondWithFilteredResult(_0x244781,_0x43169c))['catch'](handleError(_0x244781,null));};exports[_0xa4d9('0xa2')]=function(_0x3ba6f9,_0x451db9){var _0xb36c21={'raw':!![],'where':{}};var _0x2cc06a={};var _0x28edbb={'count':0x0,'rows':[]};return db['CmContact'][_0xa4d9('0x79')]({'where':{'id':_0x3ba6f9[_0xa4d9('0x21')]['id']}})[_0xa4d9('0x16')](handleEntityNotFound(_0x451db9,null))[_0xa4d9('0x16')](function(_0x4da870){if(_0x4da870){_0x2cc06a[_0xa4d9('0x7c')]=_[_0xa4d9('0x23')](db[_0xa4d9('0x44')][_0xa4d9('0x9c')]);_0x2cc06a['query']=_[_0xa4d9('0x23')](_0x3ba6f9[_0xa4d9('0x27')]);_0x2cc06a[_0xa4d9('0x7a')]=_[_0xa4d9('0x7b')](_0x2cc06a[_0xa4d9('0x7c')],_0x2cc06a[_0xa4d9('0x27')]);_0xb36c21['attributes']=_['intersection'](_0x2cc06a[_0xa4d9('0x7c')],qs[_0xa4d9('0x7e')](_0x3ba6f9['query'][_0xa4d9('0x7e')]));_0xb36c21[_0xa4d9('0x7d')]=_0xb36c21['attributes'][_0xa4d9('0x24')]?_0xb36c21['attributes']:_0x2cc06a['model'];if(!_0x3ba6f9[_0xa4d9('0x27')][_0xa4d9('0x82')](_0xa4d9('0x83'))){_0xb36c21[_0xa4d9('0x13')]=qs[_0xa4d9('0x13')](_0x3ba6f9['query'][_0xa4d9('0x13')]);_0xb36c21[_0xa4d9('0x11')]=qs[_0xa4d9('0x11')](_0x3ba6f9['query']['offset']);}_0xb36c21[_0xa4d9('0x9d')]=qs['sort'](_0x3ba6f9[_0xa4d9('0x27')][_0xa4d9('0x7f')]);_0xb36c21[_0xa4d9('0x56')]=qs[_0xa4d9('0x7a')](_[_0xa4d9('0x9e')](_0x3ba6f9[_0xa4d9('0x27')],_0x2cc06a['filters']));_0xb36c21[_0xa4d9('0x56')][_0xa4d9('0xa3')]=_0x4da870['id'];if(_0x3ba6f9['query'][_0xa4d9('0x80')]){_0xb36c21['where']=_[_0xa4d9('0x30')](_0xb36c21[_0xa4d9('0x56')],{'$or':_[_0xa4d9('0x6c')](_0xb36c21[_0xa4d9('0x7d')],function(_0x53c0c0){var _0x15247f={};_0x15247f[_0x53c0c0]={'$like':'%'+_0x3ba6f9['query'][_0xa4d9('0x80')]+'%'};return _0x15247f;})});}_0xb36c21=_['merge']({},_0xb36c21,_0x3ba6f9[_0xa4d9('0x81')]);return db[_0xa4d9('0x44')][_0xa4d9('0x14')]({'where':_0xb36c21[_0xa4d9('0x56')]})[_0xa4d9('0x16')](function(_0x4cc559){_0x28edbb[_0xa4d9('0x14')]=_0x4cc559;if(_0x3ba6f9[_0xa4d9('0x27')][_0xa4d9('0x9f')]){_0xb36c21[_0xa4d9('0xa0')]=[{'all':!![]}];}return db[_0xa4d9('0x44')][_0xa4d9('0x1e')](_0xb36c21);})[_0xa4d9('0x16')](function(_0x4f8c2c){_0x28edbb[_0xa4d9('0xa1')]=_0x4f8c2c;return _0x28edbb;});}})[_0xa4d9('0x16')](respondWithFilteredResult(_0x451db9,_0xb36c21))[_0xa4d9('0x1f')](handleError(_0x451db9,null));};exports[_0xa4d9('0xa4')]=function(_0x5a9211,_0x422eca){var _0x4daa52={'raw':!![],'where':{}};var _0x21ff3c={};var _0x23c107={'count':0x0,'rows':[]};return db[_0xa4d9('0x22')][_0xa4d9('0x79')]({'where':{'id':_0x5a9211[_0xa4d9('0x21')]['id']}})[_0xa4d9('0x16')](handleEntityNotFound(_0x422eca,null))[_0xa4d9('0x16')](function(_0x564640){if(_0x564640){_0x21ff3c[_0xa4d9('0x7c')]=_[_0xa4d9('0x23')](db['JscriptySessionReport'][_0xa4d9('0x9c')]);_0x21ff3c[_0xa4d9('0x27')]=_['keys'](_0x5a9211[_0xa4d9('0x27')]);_0x21ff3c[_0xa4d9('0x7a')]=_[_0xa4d9('0x7b')](_0x21ff3c[_0xa4d9('0x7c')],_0x21ff3c['query']);_0x4daa52[_0xa4d9('0x7d')]=_[_0xa4d9('0x7b')](_0x21ff3c[_0xa4d9('0x7c')],qs[_0xa4d9('0x7e')](_0x5a9211[_0xa4d9('0x27')][_0xa4d9('0x7e')]));_0x4daa52[_0xa4d9('0x7d')]=_0x4daa52[_0xa4d9('0x7d')][_0xa4d9('0x24')]?_0x4daa52[_0xa4d9('0x7d')]:_0x21ff3c['model'];if(!_0x5a9211[_0xa4d9('0x27')][_0xa4d9('0x82')](_0xa4d9('0x83'))){_0x4daa52['limit']=qs[_0xa4d9('0x13')](_0x5a9211[_0xa4d9('0x27')][_0xa4d9('0x13')]);_0x4daa52[_0xa4d9('0x11')]=qs['offset'](_0x5a9211['query'][_0xa4d9('0x11')]);}_0x4daa52[_0xa4d9('0x9d')]=qs[_0xa4d9('0x7f')](_0x5a9211[_0xa4d9('0x27')]['sort']);_0x4daa52[_0xa4d9('0x56')]=qs[_0xa4d9('0x7a')](_[_0xa4d9('0x9e')](_0x5a9211[_0xa4d9('0x27')],_0x21ff3c[_0xa4d9('0x7a')]));_0x4daa52['where'][_0xa4d9('0xa3')]=_0x564640['id'];if(_0x5a9211[_0xa4d9('0x27')]['filter']){_0x4daa52[_0xa4d9('0x56')]=_[_0xa4d9('0x30')](_0x4daa52['where'],{'$or':_[_0xa4d9('0x6c')](_0x4daa52[_0xa4d9('0x7d')],function(_0x1d0dcd){var _0x167103={};_0x167103[_0x1d0dcd]={'$like':'%'+_0x5a9211[_0xa4d9('0x27')][_0xa4d9('0x80')]+'%'};return _0x167103;})});}_0x4daa52=_[_0xa4d9('0x30')]({},_0x4daa52,_0x5a9211[_0xa4d9('0x81')]);return db[_0xa4d9('0x4b')][_0xa4d9('0x14')]({'where':_0x4daa52[_0xa4d9('0x56')]})[_0xa4d9('0x16')](function(_0x1b5175){_0x23c107[_0xa4d9('0x14')]=_0x1b5175;if(_0x5a9211[_0xa4d9('0x27')][_0xa4d9('0x9f')]){_0x4daa52[_0xa4d9('0xa0')]=[{'all':!![]}];}return db[_0xa4d9('0x4b')]['findAll'](_0x4daa52);})[_0xa4d9('0x16')](function(_0x41f783){_0x23c107[_0xa4d9('0xa1')]=_0x41f783;return _0x23c107;});}})[_0xa4d9('0x16')](respondWithFilteredResult(_0x422eca,_0x4daa52))[_0xa4d9('0x1f')](handleError(_0x422eca,null));};exports['uploadCsv']=function(_0x411863,_0x4e2515){try{if(!_0x411863[_0xa4d9('0x31')]['ListId']){throw new Error(_0xa4d9('0xa5'));}if(!_0x411863[_0xa4d9('0x31')]['binding_keys']){throw new Error(_0xa4d9('0xa6'));}if(!_0x411863[_0xa4d9('0x31')][_0xa4d9('0xa7')]){throw new Error(_0xa4d9('0xa8'));}if(!_0x411863[_0xa4d9('0x31')]['socket_timestamp']){throw new Error(_0xa4d9('0xa9'));}var _0x4f2772=_0x411863[_0xa4d9('0x31')][_0xa4d9('0xaa')][_0xa4d9('0xab')](',');var _0x4a57e1=_0x411863['body']['binding_values'][_0xa4d9('0xab')](',');if(!_0x4f2772['length']||!_0x4a57e1['length']||_0x4f2772['length']!==_0x4a57e1['length']){throw new Error(_0xa4d9('0xac'));}_0x411863[_0xa4d9('0x31')][_0xa4d9('0x7e')]=_[_0xa4d9('0xad')](_0x4f2772,_0x4a57e1);if(!_0x411863[_0xa4d9('0x31')][_0xa4d9('0x7e')][_0xa4d9('0x76')]){throw new Error(_0xa4d9('0xae'));}if(!_0x411863[_0xa4d9('0x31')][_0xa4d9('0x7e')][_0xa4d9('0xaf')]){throw new Error('No\x20firstName\x20column\x20specified');}var _0x26054d=path[_0xa4d9('0x50')](config[_0xa4d9('0xb0')],_0xa4d9('0xb1'),_0x411863[_0xa4d9('0xb2')][_0xa4d9('0xb3')]);fs[_0xa4d9('0xb4')](_0x26054d,parseInt(_0xa4d9('0xb5'),0x8));var _0x30782f=require('child_process')['fork'](path[_0xa4d9('0x50')](__dirname,_0xa4d9('0xb6')),[_0x26054d,_0x411863[_0xa4d9('0x31')][_0xa4d9('0xaa')],_0x411863[_0xa4d9('0x31')][_0xa4d9('0xa7')],_0x411863['body'][_0xa4d9('0x58')],_0x411863[_0xa4d9('0x31')]['CompanyId'],_0x411863[_0xa4d9('0x31')]['duplicates'],_0x411863[_0xa4d9('0x31')][_0xa4d9('0xb7')]]);return _0x4e2515[_0xa4d9('0xf')](0xc8)[_0xa4d9('0x10')]({'message':'File\x20uploaded\x20correctly!','pid':_0x30782f[_0xa4d9('0xb8')]});}catch(_0x34d827){return _0x4e2515[_0xa4d9('0xf')](0x1f4)[_0xa4d9('0xb9')](_0x34d827);}};exports[_0xa4d9('0xba')]=function(_0x1eb1c3,_0xd8b718){var _0x1188f3=fs[_0xa4d9('0xbb')](_0x1eb1c3[_0xa4d9('0xb2')][_0xa4d9('0x2')]);Papa[_0xa4d9('0xbc')](_0x1188f3,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x13e96f){return _0xd8b718[_0xa4d9('0xf')](0xc8)['json']({'file':_0x1eb1c3[_0xa4d9('0xb2')],'fields':_0x13e96f[_0xa4d9('0xbd')][_0xa4d9('0x7e')]});}});};exports[_0xa4d9('0xbe')]=function(_0x43084e,_0x33703f){return db['User'][_0xa4d9('0x1e')]({'raw':!![],'attributes':['id'],'where':{'role':_0xa4d9('0xbf')}})[_0xa4d9('0x16')](function(_0x211b27){var _0x32ed45=![];if(!_0x43084e['body']['ListId']){throw new Error(_0xa4d9('0xa5'));}if(!_0x43084e['body']['binding'][_0xa4d9('0x76')]){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x43084e[_0xa4d9('0x31')][_0xa4d9('0xc0')]['firstName']){throw new Error(_0xa4d9('0xc1'));}if(!_0x43084e[_0xa4d9('0x31')][_0xa4d9('0xb7')]){throw new Error(_0xa4d9('0xa9'));}var _0x29a197=require(_0xa4d9('0xc2'))[_0xa4d9('0xc3')](path['join'](__dirname,_0xa4d9('0xc4')),[_0x43084e[_0xa4d9('0x21')]['id'],JSON[_0xa4d9('0xc5')](_0x43084e[_0xa4d9('0x31')]),JSON[_0xa4d9('0xc5')](_0x211b27)]);_0x29a197['on'](_0xa4d9('0xc6'),function(){_0x32ed45=!![];return _0x33703f['status'](0xc8)[_0xa4d9('0x10')]({'message':_0xa4d9('0xc7'),'pid':_0x29a197['pid']});});_0x29a197['on'](_0xa4d9('0xc8'),function(_0xe0b732){if(_0xe0b732&&!_0x32ed45){return _0x33703f[_0xa4d9('0xf')](0x1f4)[_0xa4d9('0x10')]({'message':_0xa4d9('0xc9'),'pid':_0x29a197[_0xa4d9('0xb8')]});}});})[_0xa4d9('0x1f')](handleError(_0x33703f,null));};exports[_0xa4d9('0xca')]=function(_0x27a347,_0x462d92){return db[_0xa4d9('0xcb')][_0xa4d9('0x1e')]({'raw':!![],'attributes':['id'],'where':{'role':_0xa4d9('0xbf')}})[_0xa4d9('0x16')](function(_0x3bcc8b){var _0x326d25=![];if(!_0x27a347[_0xa4d9('0x31')][_0xa4d9('0x58')]){throw new Error(_0xa4d9('0xa5'));}if(!_0x27a347[_0xa4d9('0x31')]['binding'][_0xa4d9('0x76')]){throw new Error(_0xa4d9('0xae'));}if(!_0x27a347['body'][_0xa4d9('0xc0')][_0xa4d9('0xaf')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x27a347['body']['socket_timestamp']){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x1fd7cf=require(_0xa4d9('0xc2'))['fork'](path[_0xa4d9('0x50')](__dirname,_0xa4d9('0xcc')),[_0x27a347[_0xa4d9('0x21')]['id'],JSON[_0xa4d9('0xc5')](_0x27a347[_0xa4d9('0x31')]),JSON['stringify'](_0x3bcc8b)]);_0x1fd7cf['on']('message',function(){_0x326d25=!![];return _0x462d92[_0xa4d9('0xf')](0xc8)[_0xa4d9('0x10')]({'message':_0xa4d9('0xc7'),'pid':_0x1fd7cf[_0xa4d9('0xb8')]});});_0x1fd7cf['on'](_0xa4d9('0xc8'),function(_0x17c12c){if(_0x17c12c&&!_0x326d25){return _0x462d92[_0xa4d9('0xf')](0x1f4)[_0xa4d9('0x10')]({'message':_0xa4d9('0xc9'),'pid':_0x1fd7cf[_0xa4d9('0xb8')]});}});})['catch'](handleError(_0x462d92,null));};exports[_0xa4d9('0xcd')]=function(_0x3845ee,_0x233a54){var _0x272709=[_0xa4d9('0xce'),_0xa4d9('0xcf'),'sms','openchannel',_0xa4d9('0xd0'),_0xa4d9('0xd1'),_0xa4d9('0xd2')];var _0x52d547={'offset':0x0,'order':qs[_0xa4d9('0x7f')]('-createdAt')},_0x2d2fac={'count':0x0,'rows':[]};Promise[_0xa4d9('0xd3')]()['then'](function(){if(_0x3845ee[_0xa4d9('0x27')][_0xa4d9('0xd4')]){if(!_[_0xa4d9('0xd5')](_0x272709,_0x3845ee[_0xa4d9('0x27')][_0xa4d9('0xd4')][_0xa4d9('0xd6')]())){throw new Error(_0xa4d9('0xd7'));}_0x272709=[_0x3845ee[_0xa4d9('0x27')][_0xa4d9('0xd4')]['toLowerCase']()];}if(_0x3845ee[_0xa4d9('0x27')][_0xa4d9('0xd8')]){try{var _0x5bf2e6=JSON['parse'](_0x3845ee['query']['range']);if(!moment(_0x5bf2e6['from'])['isValid']()){throw new Error(_0xa4d9('0xd9'));}if(!moment(_0x5bf2e6['to'])[_0xa4d9('0xda')]()){throw new Error(_0xa4d9('0xdb'));}}catch(_0x21e3c9){throw new Error(_0xa4d9('0xdc'));}}if(!_0x3845ee[_0xa4d9('0x27')]['hasOwnProperty'](_0xa4d9('0x83'))){_0x52d547['limit']=qs[_0xa4d9('0x13')](_0x3845ee[_0xa4d9('0x27')][_0xa4d9('0x13')]||0xa);_0x52d547[_0xa4d9('0x11')]=qs[_0xa4d9('0x11')](_0x3845ee[_0xa4d9('0x27')]['offset']);}var _0x2cf4eb=_0x272709['map'](function(_0x13d435){if(_0x13d435===_0xa4d9('0xd2')){var _0x313ca0={'attributes':['id',_0xa4d9('0xdd'),_0xa4d9('0x2d'),_0xa4d9('0xde'),_0xa4d9('0xdf'),_0xa4d9('0xe0'),_0xa4d9('0xe1'),_0xa4d9('0xe2'),_0xa4d9('0xe3'),_0xa4d9('0xe4'),_0xa4d9('0xe5'),'userDisposition',_0xa4d9('0xe6'),'userThirdDisposition',_0xa4d9('0xe7')],'where':{'ContactId':_0x3845ee['params']['id']},'include':[{'model':db['User'],'as':'User','attributes':['id',_0xa4d9('0x1b'),_0xa4d9('0xe8'),_0xa4d9('0x2b')]}],'order':[['createdAt','DESC']]};if(_0x3845ee[_0xa4d9('0x27')][_0xa4d9('0xd8')]){_0x313ca0[_0xa4d9('0x56')][_0xa4d9('0xe5')]={'$gte':_0x5bf2e6[_0xa4d9('0x32')],'$lte':_0x5bf2e6['to']};}return db['VoiceCallReport'][_0xa4d9('0xe9')](_0x313ca0)[_0xa4d9('0x16')](function(_0x994f15){_0x2d2fac[_0xa4d9('0x14')]+=_0x994f15[_0xa4d9('0x14')];return _[_0xa4d9('0x6c')](_0x994f15[_0xa4d9('0xa1')],function(_0x1e64e7){var _0x12adb9=_0x1e64e7[_0xa4d9('0x33')]({'plain':!![]});_0x12adb9[_0xa4d9('0xd4')]=_0x13d435;if(_0x12adb9[_0xa4d9('0xcb')]){_0x12adb9[_0xa4d9('0xcb')]={'id':_0x12adb9[_0xa4d9('0xcb')]['id'],'name':_0x12adb9['User'][_0xa4d9('0x1b')],'fullname':_0x12adb9[_0xa4d9('0xcb')][_0xa4d9('0xe8')],'alias':_0x12adb9[_0xa4d9('0xcb')][_0xa4d9('0x2b')]};}return _0x12adb9;});});}else{var _0x3fed53=_['startCase'](_0x13d435)+(_0x13d435===_0xa4d9('0xcf')?_0xa4d9('0xea'):'Account');var _0x470d23={'attributes':['id',_0xa4d9('0xeb'),_0xa4d9('0xec'),'createdAt',_0xa4d9('0xe4'),'disposition',_0xa4d9('0xed'),_0xa4d9('0xee'),_0xa4d9('0xe7'),_0x3fed53+'Id'],'where':{'ContactId':_0x3845ee['params']['id']},'include':[{'model':db[_0x3fed53],'as':_0xa4d9('0xef'),'attributes':['id',_0xa4d9('0x1b'),_0xa4d9('0xf0')]},{'model':db[_0xa4d9('0xcb')],'as':_0xa4d9('0xf1'),'attributes':['id',_0xa4d9('0x1b'),_0xa4d9('0xe8')]},{'model':db[_0xa4d9('0x5c')],'as':_0xa4d9('0x5d'),'attributes':['id',_0xa4d9('0x1b'),_0xa4d9('0x5e')],'through':{'attributes':[]}}],'order':[['createdAt',_0xa4d9('0xf2')]]};if(_0x3845ee[_0xa4d9('0x27')][_0xa4d9('0xd8')]){_0x470d23['where']['createdAt']={'$gte':_0x5bf2e6[_0xa4d9('0x32')],'$lte':_0x5bf2e6['to']};}switch(_0x13d435){case'chat':_0x470d23[_0xa4d9('0x7d')][_0xa4d9('0x57')](_0xa4d9('0xf3'),_0xa4d9('0xf4'),_0xa4d9('0xf5'),'deviceModel',_0xa4d9('0xf6'),'ratingMessage',_0xa4d9('0xf7'),'ratingValue',_0xa4d9('0xf8'));break;case _0xa4d9('0xce'):_0x470d23[_0xa4d9('0x7d')][_0xa4d9('0x57')](_0xa4d9('0xf9'),_0xa4d9('0xfa'));break;case _0xa4d9('0xfb'):_0x470d23[_0xa4d9('0x7d')][_0xa4d9('0x57')](_0xa4d9('0xfc'),'threadId');break;}return db[_[_0xa4d9('0xfd')](_0x13d435)+'Interaction'][_0xa4d9('0xe9')](_0x470d23)[_0xa4d9('0x16')](function(_0x43ce96){_0x2d2fac['count']+=_0x43ce96[_0xa4d9('0x14')];return _[_0xa4d9('0x6c')](_0x43ce96[_0xa4d9('0xa1')],function(_0x2a7f99){var _0x32f0f9=_0x2a7f99['get']({'plain':!![]});_0x32f0f9['channel']=_0x13d435;if(_0x32f0f9[_0xa4d9('0xf1')]){_0x32f0f9[_0xa4d9('0xf1')]={'id':_0x32f0f9[_0xa4d9('0xf1')]['id'],'name':_0x32f0f9[_0xa4d9('0xf1')]['name'],'fullname':_0x32f0f9[_0xa4d9('0xf1')][_0xa4d9('0xe8')]};}return _0x32f0f9;});});}});return Promise[_0xa4d9('0x87')](_0x2cf4eb);})['then'](function(_0x2a61da){return _(_0x2a61da)[_0xa4d9('0xfe')]()[_0xa4d9('0xff')](_0xa4d9('0xe5'))['reverse']()[_0xa4d9('0x100')]();})[_0xa4d9('0x16')](function(_0x1818b7){_0x2d2fac['rows']=_0x52d547[_0xa4d9('0x13')]?_0x1818b7['slice'](_0x52d547['offset'],_0x52d547[_0xa4d9('0x11')]+_0x52d547[_0xa4d9('0x13')]):_0x1818b7;return _0x2d2fac;})[_0xa4d9('0x16')](respondWithFilteredResult(_0x233a54,_0x52d547))[_0xa4d9('0x1f')](handleError(_0x233a54,null));}; \ No newline at end of file +var _0xecb4=['tags','keys','length','startsWith','columnName','displayName','query','analytics','CmCustomField','findAll','cf_','alias','custom','type','values','info','forEach','hasOwnProperty','body','from','get','mergeWith','isArray','join','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','FaxQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','isNil','dialTimezone','utcOffset','additionalPhones','bulkCreate','duplicates','$or','push','where','ListId','findOrCreate','spread','contact','show','Tag','Tags','color','Phones','ContactItemType','literal','Phones.OrderBy','$and','omit','map','format','cf_%d','timezones','pickBy','isEmpty','table','cm_contacts','setFields','id\x20=\x20?','sequelize','text','phone','getTags','findOne','rawAttributes','intersection','model','fields','attributes','order','sort','filters','pick','filter','merge','nolimit','ids','all','OrderBy','item_types','items','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','ItemType','ItemType.OrderBy','getAdditionalPhones','PHONE','`ItemType`.OrderBy','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','getHoppers','ContactId','options','include','rows','getHopperHistories','CmHopperHistory','includeAll','getHopperFinals','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','File\x20uploaded\x20correctly!','upload','meta','import','binding','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','pid','exit','error\x20child\x20process','../../components/import/cm/csvUpdates','getJourney','mail','chat','openchannel','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','parse','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','callerid','starttime','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','fullname','DESC','VoiceCallReport','findAndCountAll','User','Website','closedAt','secondDisposition','thirdDisposition','UserId','Account','key','range','browserName','customerPort','deviceModel','ratingMessage','ratingType','ratingValue','referer','subject','externalUrl','threadId','startCase','Interaction','Owner','flatten','sortBy','reverse','value','slice','moment','bluebird','path','lodash','squel','papaparse','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/environment/shared','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','status','json','offset','limit','undefined','count','set','Content-Range','update','then','destroy','end','sendStatus','error','stack','name','send','describe','getOptions','user','catch','CmContact','find','params'];(function(_0x3843af,_0x375e94){var _0x20543c=function(_0x4bf08f){while(--_0x4bf08f){_0x3843af['push'](_0x3843af['shift']());}};_0x20543c(++_0x375e94);}(_0xecb4,0xdd));var _0x4ecb=function(_0x45bf5a,_0x32f02a){_0x45bf5a=_0x45bf5a-0x0;var _0x227488=_0xecb4[_0x45bf5a];return _0x227488;};'use strict';var moment=require(_0x4ecb('0x0'));var BPromise=require(_0x4ecb('0x1'));var util=require('util');var path=require(_0x4ecb('0x2'));var fs=require('fs');var _=require(_0x4ecb('0x3'));var squel=require(_0x4ecb('0x4'));var Papa=require(_0x4ecb('0x5'));var Redis=require('ioredis');var contacts=require(_0x4ecb('0x6'));var qs=require(_0x4ecb('0x7'));var logger=require(_0x4ecb('0x8'))(_0x4ecb('0x9'));var config=require(_0x4ecb('0xa'));var shared=require(_0x4ecb('0xb'));var db=require('../../mysqldb')['db'];config[_0x4ecb('0xc')]=_[_0x4ecb('0xd')](config['redis'],{'host':_0x4ecb('0xe'),'port':0x18eb});var socket=require(_0x4ecb('0xf'))(new Redis(config[_0x4ecb('0xc')]));require(_0x4ecb('0x10'))['register'](socket);function respondWithResult(_0x297188,_0x361644){_0x361644=_0x361644||0xc8;return function(_0x4b025c){if(_0x4b025c){return _0x297188[_0x4ecb('0x11')](_0x361644)[_0x4ecb('0x12')](_0x4b025c);}};}function respondWithFilteredResult(_0x3269e6,_0x369636){return function(_0x5472ae){if(_0x5472ae){var _0x12428c=typeof _0x369636[_0x4ecb('0x13')]==='undefined'&&typeof _0x369636[_0x4ecb('0x14')]===_0x4ecb('0x15');var _0x72f188=_0x5472ae['count'];var _0x21cf65=_0x12428c?0x0:_0x369636[_0x4ecb('0x13')];var _0xe94e80=_0x12428c?_0x5472ae[_0x4ecb('0x16')]:_0x369636[_0x4ecb('0x13')]+_0x369636['limit'];var _0x1ad857;if(_0xe94e80>=_0x72f188){_0xe94e80=_0x72f188;_0x1ad857=0xc8;}else{_0x1ad857=0xce;}_0x3269e6[_0x4ecb('0x11')](_0x1ad857);return _0x3269e6[_0x4ecb('0x17')](_0x4ecb('0x18'),_0x21cf65+'-'+_0xe94e80+'/'+_0x72f188)[_0x4ecb('0x12')](_0x5472ae);}return null;};}function saveUpdates(_0x5f164d){return function(_0x272435){if(_0x272435){return _0x272435[_0x4ecb('0x19')](_0x5f164d)[_0x4ecb('0x1a')](function(_0xc4fa69){return _0xc4fa69;});}return null;};}function removeEntity(_0x19c0d1){return function(_0x3cd8a0){if(_0x3cd8a0){return _0x3cd8a0[_0x4ecb('0x1b')]()['then'](function(){_0x19c0d1[_0x4ecb('0x11')](0xcc)[_0x4ecb('0x1c')]();});}};}function handleEntityNotFound(_0x598bce){return function(_0x3f63c1){if(!_0x3f63c1){_0x598bce[_0x4ecb('0x1d')](0x194);}return _0x3f63c1;};}function handleError(_0x2409e7,_0x1a5ba5){_0x1a5ba5=_0x1a5ba5||0x1f4;return function(_0x4caad1){logger[_0x4ecb('0x1e')](_0x4caad1[_0x4ecb('0x1f')]);if(_0x4caad1[_0x4ecb('0x20')]){delete _0x4caad1[_0x4ecb('0x20')];}_0x2409e7[_0x4ecb('0x11')](_0x1a5ba5)[_0x4ecb('0x21')](_0x4caad1);};}exports['index']=function(_0x58697c,_0x5712db){var _0x4b3b52={};return contacts[_0x4ecb('0x22')]()[_0x4ecb('0x1a')](function(_0xe9778a){_0x4b3b52=qs[_0x4ecb('0x23')](_0xe9778a,_0x58697c);return contacts['findAll'](_0x58697c['query'],_0x58697c[_0x4ecb('0x24')],_0x4b3b52,_0xe9778a);})[_0x4ecb('0x1a')](respondWithFilteredResult(_0x5712db,_0x4b3b52))[_0x4ecb('0x25')](handleError(_0x5712db,null));};exports['destroy']=function(_0x33716a,_0x2e2380){return db[_0x4ecb('0x26')][_0x4ecb('0x27')]({'where':{'id':_0x33716a[_0x4ecb('0x28')]['id']}})[_0x4ecb('0x1a')](handleEntityNotFound(_0x2e2380,null))['then'](removeEntity(_0x2e2380,null))['catch'](handleError(_0x2e2380,null));};exports['describe']=function(_0xeae218,_0x4a127a){return db[_0x4ecb('0x26')][_0x4ecb('0x22')]()[_0x4ecb('0x1a')](function(_0x10fe61){delete _0x10fe61[_0x4ecb('0x29')];for(var _0x53af70=0x0;_0x53af700x0){return new Promise(function(_0x202f39){var _0x436eb0=[];for(var _0x127315=0x0;_0x127315<_0x4e4359['length'];_0x127315++){_0x436eb0[_0x4ecb('0x61')](insertAdditionalPhones(_0x4e4359[_0x127315][_0x4ecb('0x66')],_0x4e4359[_0x127315][_0x4ecb('0x5d')]));}Promise['all'](_0x436eb0)[_0x4ecb('0x1a')](function(){_0x202f39(0x1);});})['then'](function(){return{'success':_0x2e545b,'failure':_0x30fd01,'duplicates':_0x4ba503};});}else{return{'success':_0x2e545b,'failure':_0x30fd01,'duplicates':_0x4ba503};}}})[_0x4ecb('0x1a')](respondWithResult(_0x788dcd,0xc9))[_0x4ecb('0x25')](handleError(_0x788dcd,null));};exports[_0x4ecb('0x67')]=function(_0x46294a,_0x571bb5){var _0x235da0;return db['CmContact'][_0x4ecb('0x22')]()[_0x4ecb('0x1a')](function(_0x523931){return db[_0x4ecb('0x26')]['find']({'where':{'id':_0x46294a['params']['id']},'include':[{'model':db[_0x4ecb('0x68')],'as':_0x4ecb('0x69'),'attributes':['id',_0x4ecb('0x20'),_0x4ecb('0x6a')],'required':_0x46294a['query']['tag']?!![]:![]},{'model':db[_0x4ecb('0x50')],'as':_0x4ecb('0x6b'),'where':{'CmContactId':_0x46294a['params']['id']},'required':![],'include':[{'model':db[_0x4ecb('0x6c')],'as':'ItemType'}]}],'order':[db['sequelize'][_0x4ecb('0x6d')](_0x4ecb('0x6e'))],'attributes':_['keys'](_0x523931)});})['then'](function(_0x3bab5b){if(!_[_0x4ecb('0x5a')](_0x3bab5b)){_0x235da0=_0x3bab5b[_0x4ecb('0x3d')]({'plain':!![]});var _0x249c5e={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x3bab5b&&_0x3bab5b[_0x4ecb('0x63')]){if(_0x3bab5b[_0x4ecb('0x63')]){_0x249c5e[_0x4ecb('0x62')][_0x4ecb('0x6f')]['push']({'ListId':{'$ne':_0x3bab5b[_0x4ecb('0x63')]}});}}return db[_0x4ecb('0x31')][_0x4ecb('0x32')](_0x249c5e);}})['then'](function(_0x3b62f1){if(!_[_0x4ecb('0x5a')](_0x3b62f1)){return _[_0x4ecb('0x70')](_0x235da0,_[_0x4ecb('0x71')](_0x3b62f1,function(_0x5efa2b){return util[_0x4ecb('0x72')](_0x4ecb('0x73'),_0x5efa2b['id']);}));}})[_0x4ecb('0x1a')](handleEntityNotFound(_0x571bb5,null))[_0x4ecb('0x1a')](respondWithResult(_0x571bb5,null))[_0x4ecb('0x25')](handleError(_0x571bb5,null));};exports[_0x4ecb('0x19')]=function(_0x25f2e5,_0x4af19e){var _0x10046a;if(_0x25f2e5[_0x4ecb('0x3b')]['id']){delete _0x25f2e5[_0x4ecb('0x3b')]['id'];}if(!_[_0x4ecb('0x5a')](_0x25f2e5[_0x4ecb('0x3b')][_0x4ecb('0x5b')])){var _0xe83103=_0x25f2e5[_0x4ecb('0x3b')][_0x4ecb('0x5b')];if(!_['isNil'](shared[_0x4ecb('0x74')][_0xe83103]))_0x25f2e5[_0x4ecb('0x3b')]['utcOffset']=shared[_0x4ecb('0x74')][_0xe83103][_0x4ecb('0x5c')];}return db['CmContact']['find']({'where':{'id':_0x25f2e5['params']['id']}})[_0x4ecb('0x1a')](handleEntityNotFound(_0x4af19e,null))[_0x4ecb('0x1a')](saveUpdates(_0x25f2e5['body'],null))[_0x4ecb('0x1a')](function(_0x2a68c1){_0x10046a=_0x2a68c1;var _0x2a14ad={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x2a68c1&&_0x2a68c1[_0x4ecb('0x63')]){if(_0x2a68c1[_0x4ecb('0x63')]){_0x2a14ad[_0x4ecb('0x62')][_0x4ecb('0x6f')][_0x4ecb('0x61')]({'ListId':{'$ne':_0x2a68c1[_0x4ecb('0x63')]}});}}return db[_0x4ecb('0x31')]['findAll'](_0x2a14ad);})[_0x4ecb('0x1a')](function(_0x15eb55){if(_0x15eb55){return _['omit'](_[_0x4ecb('0x75')](_0x25f2e5[_0x4ecb('0x3b')],function(_0x59a891,_0x43a72a){return _[_0x4ecb('0x2c')](_0x43a72a,_0x4ecb('0x33'));}),_[_0x4ecb('0x71')](_0x15eb55,function(_0x38e3ac){return util[_0x4ecb('0x72')](_0x4ecb('0x73'),_0x38e3ac['id']);}));}})[_0x4ecb('0x1a')](function(_0x342783){if(_0x342783&&!_[_0x4ecb('0x76')](_0x342783)){var _0x5d328e=squel[_0x4ecb('0x19')]()[_0x4ecb('0x77')](_0x4ecb('0x78'))[_0x4ecb('0x79')](_0x342783)[_0x4ecb('0x62')](_0x4ecb('0x7a'),_0x25f2e5[_0x4ecb('0x28')]['id'])['toParam']();return db[_0x4ecb('0x7b')]['query'](_0x5d328e[_0x4ecb('0x7c')],{'replacements':_0x5d328e[_0x4ecb('0x37')]});}})[_0x4ecb('0x1a')](function(){if(_0x25f2e5['body'][_0x4ecb('0x7d')]&&_0x10046a){return db[_0x4ecb('0x41')][_0x4ecb('0x19')]({'phone':_0x25f2e5[_0x4ecb('0x3b')][_0x4ecb('0x7d')],'OrderBy':0x0},{'where':{'ContactId':_0x10046a['id']}});}})[_0x4ecb('0x1a')](function(){return _0x10046a;})[_0x4ecb('0x1a')](respondWithResult(_0x4af19e,null))[_0x4ecb('0x25')](handleError(_0x4af19e,null));};exports[_0x4ecb('0x7e')]=function(_0x378949,_0xd30f39){var _0x3e7be1={};var _0x3943d9={};var _0x3f73e0;var _0x1c2a57;return db['CmContact'][_0x4ecb('0x7f')]({'where':{'id':_0x378949[_0x4ecb('0x28')]['id']}})['then'](handleEntityNotFound(_0xd30f39,null))[_0x4ecb('0x1a')](function(_0x24d1e8){if(_0x24d1e8){_0x3f73e0=_0x24d1e8;_0x3943d9['model']=_[_0x4ecb('0x2a')](db[_0x4ecb('0x68')][_0x4ecb('0x80')]);_0x3943d9[_0x4ecb('0x2f')]=_[_0x4ecb('0x2a')](_0x378949[_0x4ecb('0x2f')]);_0x3943d9['filters']=_[_0x4ecb('0x81')](_0x3943d9[_0x4ecb('0x82')],_0x3943d9['query']);_0x3e7be1['attributes']=_[_0x4ecb('0x81')](_0x3943d9[_0x4ecb('0x82')],qs[_0x4ecb('0x83')](_0x378949[_0x4ecb('0x2f')]['fields']));_0x3e7be1[_0x4ecb('0x84')]=_0x3e7be1['attributes']['length']?_0x3e7be1[_0x4ecb('0x84')]:_0x3943d9[_0x4ecb('0x82')];_0x3e7be1[_0x4ecb('0x85')]=qs[_0x4ecb('0x86')](_0x378949[_0x4ecb('0x2f')][_0x4ecb('0x86')]);_0x3e7be1[_0x4ecb('0x62')]=qs[_0x4ecb('0x87')](_[_0x4ecb('0x88')](_0x378949['query'],_0x3943d9[_0x4ecb('0x87')]));if(_0x378949[_0x4ecb('0x2f')][_0x4ecb('0x89')]){_0x3e7be1[_0x4ecb('0x62')]=_[_0x4ecb('0x8a')](_0x3e7be1[_0x4ecb('0x62')],{'$or':_['map'](_0x3e7be1[_0x4ecb('0x84')],function(_0x18e749){var _0x13a522={};_0x13a522[_0x18e749]={'$like':'%'+_0x378949[_0x4ecb('0x2f')][_0x4ecb('0x89')]+'%'};return _0x13a522;})});}_0x3e7be1=_['merge']({},_0x3e7be1,_0x378949['options']);return _0x3f73e0[_0x4ecb('0x7e')](_0x3e7be1);}})[_0x4ecb('0x1a')](function(_0xe89e40){if(_0xe89e40){_0x1c2a57=_0xe89e40[_0x4ecb('0x2b')];if(!_0x378949[_0x4ecb('0x2f')][_0x4ecb('0x3a')](_0x4ecb('0x8b'))){_0x3e7be1[_0x4ecb('0x14')]=qs[_0x4ecb('0x14')](_0x378949[_0x4ecb('0x2f')]['limit']);_0x3e7be1['offset']=qs[_0x4ecb('0x13')](_0x378949[_0x4ecb('0x2f')][_0x4ecb('0x13')]);}return _0x3f73e0[_0x4ecb('0x7e')](_0x3e7be1);}})[_0x4ecb('0x1a')](function(_0x1fa5e2){if(_0x1fa5e2){return _0x1fa5e2?{'count':_0x1c2a57,'rows':_0x1fa5e2}:null;}})[_0x4ecb('0x1a')](respondWithResult(_0xd30f39,null))[_0x4ecb('0x25')](handleError(_0xd30f39,null));};exports['setTags']=function(_0x27c89b,_0x58df29){if(_0x27c89b[_0x4ecb('0x3b')]['id']){delete _0x27c89b[_0x4ecb('0x3b')]['id'];}return db[_0x4ecb('0x26')][_0x4ecb('0x7f')]({'where':{'id':_0x27c89b[_0x4ecb('0x28')]['id']}})['then'](handleEntityNotFound(_0x58df29,null))[_0x4ecb('0x1a')](function(_0x11b2ec){if(_0x11b2ec){return _0x11b2ec['setTags'](_0x27c89b[_0x4ecb('0x3b')][_0x4ecb('0x8c')]||[]);}return null;})[_0x4ecb('0x1a')](respondWithResult(_0x58df29,null))[_0x4ecb('0x25')](handleError(_0x58df29,null));};exports['setAdditionalPhones']=function(_0x156e3c,_0x26f83a){var _0x239b0c=[];_0x239b0c[_0x4ecb('0x61')](addAdditionalPhones(_0x156e3c['body']));Promise['all'](_0x239b0c)[_0x4ecb('0x1a')](function(){_0x239b0c=[];_0x239b0c['push'](deleteCmHopperPhones(_0x156e3c[_0x4ecb('0x3b')]['id']));_0x239b0c[_0x4ecb('0x61')](addCmHopperPhones(_0x156e3c[_0x4ecb('0x3b')]['id']));Promise[_0x4ecb('0x8d')](_0x239b0c)[_0x4ecb('0x1a')](function(){return[0x1];})['then'](respondWithResult(_0x26f83a,null));});};function addAdditionalPhones(_0x1ad0fb){var _0x331d56;return new Promise(function(_0x9f5469){return db[_0x4ecb('0x50')][_0x4ecb('0x1b')]({'where':{'CmContactId':_0x1ad0fb['id']}})['then'](function(){db[_0x4ecb('0x6c')]['findAll']({'raw':!![],'attributes':['id',_0x4ecb('0x8e')]})[_0x4ecb('0x1a')](function(_0x2345d4){var _0xeb0aad=[];for(var _0x18c5c8=0x0;_0x18c5c8<_0x1ad0fb['items'][_0x4ecb('0x2b')];_0x18c5c8++){var _0x943bbc=_0x1ad0fb[_0x4ecb('0x8f')]?_[_0x4ecb('0x5a')](_0x1ad0fb[_0x4ecb('0x8f')][_0x18c5c8])?'':_0x1ad0fb[_0x4ecb('0x8f')][_0x18c5c8]:_0x1ad0fb[_0x4ecb('0x90')][_0x18c5c8][_0x4ecb('0x91')]?_0x1ad0fb[_0x4ecb('0x90')][_0x18c5c8]['ItemTypeId']:'';var _0x10f671=_[_0x4ecb('0x5a')](_0x1ad0fb[_0x4ecb('0x90')][_0x18c5c8][_0x4ecb('0x92')])?'':_0x1ad0fb[_0x4ecb('0x90')][_0x18c5c8][_0x4ecb('0x92')];var _0x1fa15f=_0x943bbc+':'+_0x1ad0fb['items'][_0x18c5c8][_0x4ecb('0x7d')]+'§'+_0x10f671;if(_[_0x4ecb('0x5a')](_0x331d56))_0x331d56=_0x1fa15f;else _0x331d56+=';'+_0x1fa15f;var _0x1c390c=null;var _0xa4cd5a=null;if(_0x1ad0fb['item_types']){if(!_[_0x4ecb('0x5a')](_0x1ad0fb[_0x4ecb('0x8f')][_0x18c5c8])){_0xa4cd5a=_[_0x4ecb('0x27')](_0x2345d4,function(_0x2e042c){return _0x2e042c['id']===_0x1ad0fb[_0x4ecb('0x8f')][_0x18c5c8];});if(!_[_0x4ecb('0x5a')](_0xa4cd5a)){_0x1c390c=_0xa4cd5a[_0x4ecb('0x8e')];}}}else{if(!_[_0x4ecb('0x5a')](_0x1ad0fb[_0x4ecb('0x90')][_0x18c5c8])){_0xa4cd5a=_[_0x4ecb('0x27')](_0x2345d4,function(_0x2aa4e8){return _0x2aa4e8['id']===_0x1ad0fb[_0x4ecb('0x90')][_0x18c5c8][_0x4ecb('0x91')];});if(!_[_0x4ecb('0x5a')](_0xa4cd5a)){_0x1c390c=_0x18c5c8;}}}if(_[_0x4ecb('0x5a')](_0x1c390c)){_0x1c390c=0x64;}_0xeb0aad[_0x4ecb('0x61')](addAdditionalPhone(_0x1ad0fb['id'],_0x1ad0fb[_0x4ecb('0x90')][_0x18c5c8][_0x4ecb('0x7d')],_0x1ad0fb[_0x4ecb('0x8f')]?_['isNil'](_0x1ad0fb[_0x4ecb('0x8f')][_0x18c5c8])?null:_0x1ad0fb[_0x4ecb('0x8f')][_0x18c5c8]:_0x1ad0fb[_0x4ecb('0x90')][_0x18c5c8][_0x4ecb('0x91')]?_0x1ad0fb['items'][_0x18c5c8][_0x4ecb('0x91')]:null,_0x1c390c,_0x10f671));}Promise[_0x4ecb('0x8d')](_0xeb0aad)[_0x4ecb('0x1a')](function(){db[_0x4ecb('0x26')]['update']({'AdditionalPhones':_0x331d56},{'where':{'id':_0x1ad0fb['id']}})[_0x4ecb('0x1a')](function(){_0x9f5469(0x1);});});});});});}function addAdditionalPhone(_0x3f7dd6,_0x3e0cab,_0x57d29d,_0x503347,_0x3e000c){return db[_0x4ecb('0x50')][_0x4ecb('0x27')]({'where':{'CmContactId':_0x3f7dd6,'item':_0x3e0cab}})[_0x4ecb('0x1a')](function(_0x4598c9){if(_0x4598c9)logger[_0x4ecb('0x38')](_0x4ecb('0x93'),_0x4598c9);else{db[_0x4ecb('0x50')][_0x4ecb('0x45')]({'CmContactId':_0x3f7dd6,'item':_0x3e0cab,'ItemTypeId':_0x57d29d,'OrderBy':_0x503347,'ItemClass':'PHONE','description':_0x3e000c});}});}function deleteCmHopperPhones(_0x49b9ad){return new Promise(function(_0x4ec7ef){return db[_0x4ecb('0x41')][_0x4ecb('0x32')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x49b9ad}})[_0x4ecb('0x1a')](function(_0x4c6a3d){db[_0x4ecb('0x94')]['destroy']({'where':{'CmHopperId':{'$in':_['map'](_0x4c6a3d,'id')}}});})['then'](function(){_0x4ec7ef(0x1);});});}function addCmHopperPhones(_0xddbad4){return new Promise(function(_0x5c5c66){return db[_0x4ecb('0x41')][_0x4ecb('0x32')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0xddbad4}})['then'](function(_0x56a296){var _0x3fa37c=[];_[_0x4ecb('0x71')](_0x56a296,function(_0x5ac659){_0x3fa37c[_0x4ecb('0x61')](createCmHopperPhone(_0xddbad4,_0x5ac659['id']));});Promise[_0x4ecb('0x8d')](_0x3fa37c)['then'](function(){_0x5c5c66(0x1);});});});}function createCmHopperPhone(_0x9e89a2,_0x111bd7){return new Promise(function(_0x25f10f){db['CmContactHasItem'][_0x4ecb('0x32')]({'raw':!![],'attributes':[_0x4ecb('0x95'),'OrderBy'],'where':{'CmContactId':_0x9e89a2,'ItemClass':'PHONE'},'include':[{'model':db['ContactItemType'],'attributes':[_0x4ecb('0x8e')],'as':_0x4ecb('0x96')}],'order':[_0x4ecb('0x8e'),db[_0x4ecb('0x7b')][_0x4ecb('0x6d')]('`ItemType`.OrderBy')]})[_0x4ecb('0x1a')](function(_0x1c1690){var _0x513562=0x1;var _0x3f5e10=_['map'](_0x1c1690,function(_0x23b82c){_0x23b82c['CmHopperId']=_0x111bd7;_0x23b82c[_0x4ecb('0x7d')]=_0x23b82c['item'];_0x23b82c[_0x4ecb('0x8e')]=_0x513562;delete _0x23b82c[_0x4ecb('0x97')];_0x513562=_0x513562+0x1;return _0x23b82c;});return db['CmHopperAdditionalPhone'][_0x4ecb('0x5e')](_0x3f5e10,{});})[_0x4ecb('0x1a')](function(){_0x25f10f(0x1);});});}function insertAdditionalPhones(_0x41389b,_0x725a3e){return new Promise(function(_0x570778){var _0x232b7e=[];for(var _0x42d308=0x0;_0x42d308<_0x725a3e['length'];_0x42d308++){var _0x456965=_0x725a3e[_0x42d308];_0x232b7e[_0x4ecb('0x61')](parseContactItemType(_0x456965));}Promise[_0x4ecb('0x8d')](_0x232b7e)[_0x4ecb('0x1a')](function(){var _0x16879c={'id':_0x41389b['id'],'items':_0x725a3e};return addAdditionalPhones(_0x16879c)['then'](function(){return addCmHopperPhones(_0x41389b['id']);});})['then'](function(){_0x570778(_0x41389b);});});}function parseContactItemType(_0x1b3013){return new Promise(function(_0x31cf4f){if(_0x1b3013[_0x4ecb('0x3a')](_0x4ecb('0x91'))){_0x31cf4f(_0x1b3013);}else{return db[_0x4ecb('0x6c')]['find']({'where':{'name':_0x1b3013['ItemType']}})[_0x4ecb('0x1a')](function(_0x1f5ef7){if(_['isNil'](_0x1f5ef7))_0x1b3013[_0x4ecb('0x91')]=null;else _0x1b3013[_0x4ecb('0x91')]=_0x1f5ef7['id'];_0x31cf4f(_0x1b3013);});}});}exports[_0x4ecb('0x98')]=function(_0x3ffa74,_0x1774af){return db[_0x4ecb('0x50')][_0x4ecb('0x32')]({'raw':!![],'where':{'CmContactId':_0x3ffa74[_0x4ecb('0x28')]['id'],'ItemClass':_0x4ecb('0x99')},'include':[{'model':db[_0x4ecb('0x6c')],'as':_0x4ecb('0x96')}],'order':[['OrderBy'],[db[_0x4ecb('0x7b')][_0x4ecb('0x6d')](_0x4ecb('0x9a'))]]})['then'](function(_0x401726){return _0x401726;})[_0x4ecb('0x1a')](respondWithResult(_0x1774af,null))[_0x4ecb('0x25')](handleError(_0x1774af,null));};exports[_0x4ecb('0x9b')]=function(_0x2f5081,_0x2b53e2){return db['CmContactHasItem'][_0x4ecb('0x32')]({'raw':!![],'where':{'CmContactId':_0x2f5081[_0x4ecb('0x3b')][_0x4ecb('0x9c')]}})[_0x4ecb('0x1a')](function(_0x2a57db){var _0x53e06f=_[_0x4ecb('0x71')](_0x2a57db,function(_0x20d00b){_0x20d00b[_0x4ecb('0x9d')]=_0x2f5081[_0x4ecb('0x3b')][_0x4ecb('0x9e')];return _0x20d00b;});return db[_0x4ecb('0x50')]['bulkCreate'](_0x53e06f,{});})[_0x4ecb('0x1a')](function(){return addCmHopperPhones(_0x2f5081[_0x4ecb('0x3b')][_0x4ecb('0x9e')]);})['then'](function(){return['ok'];})[_0x4ecb('0x1a')](respondWithResult(_0x2b53e2,null))[_0x4ecb('0x25')](handleError(_0x2b53e2,null));};exports['rescheduleAdditionalPhones']=function(_0x403046,_0x1c143a){var _0x2b9a31=[];_0x2b9a31['push'](createCmHopperPhone(_0x403046[_0x4ecb('0x3b')]['id'],_0x403046[_0x4ecb('0x3b')]['hopperId']));Promise[_0x4ecb('0x8d')](_0x2b9a31)[_0x4ecb('0x1a')](function(){return[0x1];})[_0x4ecb('0x1a')](respondWithResult(_0x1c143a,null));};exports[_0x4ecb('0x9f')]=function(_0x64879d,_0x5d54ee){var _0xef86d5={'raw':![],'where':{}};var _0x58023={};var _0x3b2b26={'count':0x0,'rows':[]};return db['CmContact'][_0x4ecb('0x7f')]({'where':{'id':_0x64879d[_0x4ecb('0x28')]['id']}})[_0x4ecb('0x1a')](handleEntityNotFound(_0x5d54ee,null))[_0x4ecb('0x1a')](function(_0x459e3c){if(_0x459e3c){_0x58023['model']=_[_0x4ecb('0x2a')](db[_0x4ecb('0x41')][_0x4ecb('0x80')]);_0x58023[_0x4ecb('0x2f')]=_[_0x4ecb('0x2a')](_0x64879d['query']);_0x58023[_0x4ecb('0x87')]=_[_0x4ecb('0x81')](_0x58023[_0x4ecb('0x82')],_0x58023[_0x4ecb('0x2f')]);_0xef86d5['attributes']=_[_0x4ecb('0x81')](_0x58023['model'],qs[_0x4ecb('0x83')](_0x64879d[_0x4ecb('0x2f')][_0x4ecb('0x83')]));_0xef86d5['attributes']=_0xef86d5[_0x4ecb('0x84')][_0x4ecb('0x2b')]?_0xef86d5[_0x4ecb('0x84')]:_0x58023[_0x4ecb('0x82')];if(!_0x64879d[_0x4ecb('0x2f')][_0x4ecb('0x3a')](_0x4ecb('0x8b'))){_0xef86d5['limit']=qs[_0x4ecb('0x14')](_0x64879d[_0x4ecb('0x2f')][_0x4ecb('0x14')]);_0xef86d5[_0x4ecb('0x13')]=qs['offset'](_0x64879d[_0x4ecb('0x2f')][_0x4ecb('0x13')]);}_0xef86d5[_0x4ecb('0x85')]=qs[_0x4ecb('0x86')](_0x64879d[_0x4ecb('0x2f')]['sort']);_0xef86d5['where']=qs['filters'](_[_0x4ecb('0x88')](_0x64879d['query'],_0x58023[_0x4ecb('0x87')]));_0xef86d5['where'][_0x4ecb('0xa0')]=_0x459e3c['id'];if(_0x64879d[_0x4ecb('0x2f')]['filter']){_0xef86d5[_0x4ecb('0x62')]=_['merge'](_0xef86d5['where'],{'$or':_['map'](_0xef86d5[_0x4ecb('0x84')],function(_0x4df30d){var _0x136626={};_0x136626[_0x4df30d]={'$like':'%'+_0x64879d[_0x4ecb('0x2f')][_0x4ecb('0x89')]+'%'};return _0x136626;})});}_0xef86d5=_[_0x4ecb('0x8a')]({},_0xef86d5,_0x64879d[_0x4ecb('0xa1')]);return db[_0x4ecb('0x41')][_0x4ecb('0x16')]({'where':_0xef86d5[_0x4ecb('0x62')]})[_0x4ecb('0x1a')](function(_0x2d5725){_0x3b2b26[_0x4ecb('0x16')]=_0x2d5725;if(_0x64879d[_0x4ecb('0x2f')]['includeAll']){_0xef86d5[_0x4ecb('0xa2')]=[{'all':!![]}];}return db[_0x4ecb('0x41')][_0x4ecb('0x32')](_0xef86d5);})[_0x4ecb('0x1a')](function(_0x4fb334){_0x3b2b26[_0x4ecb('0xa3')]=_0x4fb334;return _0x3b2b26;});}})[_0x4ecb('0x1a')](respondWithFilteredResult(_0x5d54ee,_0xef86d5))['catch'](handleError(_0x5d54ee,null));};exports[_0x4ecb('0xa4')]=function(_0x3fc4c3,_0x2bd8fd){var _0x15ca4f={'raw':!![],'where':{}};var _0x334123={};var _0x2d9d97={'count':0x0,'rows':[]};return db[_0x4ecb('0x26')][_0x4ecb('0x7f')]({'where':{'id':_0x3fc4c3[_0x4ecb('0x28')]['id']}})[_0x4ecb('0x1a')](handleEntityNotFound(_0x2bd8fd,null))[_0x4ecb('0x1a')](function(_0x2945fb){if(_0x2945fb){_0x334123[_0x4ecb('0x82')]=_[_0x4ecb('0x2a')](db[_0x4ecb('0xa5')][_0x4ecb('0x80')]);_0x334123[_0x4ecb('0x2f')]=_[_0x4ecb('0x2a')](_0x3fc4c3['query']);_0x334123[_0x4ecb('0x87')]=_['intersection'](_0x334123[_0x4ecb('0x82')],_0x334123[_0x4ecb('0x2f')]);_0x15ca4f[_0x4ecb('0x84')]=_[_0x4ecb('0x81')](_0x334123['model'],qs[_0x4ecb('0x83')](_0x3fc4c3['query'][_0x4ecb('0x83')]));_0x15ca4f[_0x4ecb('0x84')]=_0x15ca4f[_0x4ecb('0x84')]['length']?_0x15ca4f[_0x4ecb('0x84')]:_0x334123[_0x4ecb('0x82')];if(!_0x3fc4c3[_0x4ecb('0x2f')][_0x4ecb('0x3a')](_0x4ecb('0x8b'))){_0x15ca4f[_0x4ecb('0x14')]=qs[_0x4ecb('0x14')](_0x3fc4c3['query']['limit']);_0x15ca4f[_0x4ecb('0x13')]=qs['offset'](_0x3fc4c3[_0x4ecb('0x2f')][_0x4ecb('0x13')]);}_0x15ca4f['order']=qs[_0x4ecb('0x86')](_0x3fc4c3[_0x4ecb('0x2f')]['sort']);_0x15ca4f[_0x4ecb('0x62')]=qs[_0x4ecb('0x87')](_['pick'](_0x3fc4c3[_0x4ecb('0x2f')],_0x334123[_0x4ecb('0x87')]));_0x15ca4f[_0x4ecb('0x62')]['ContactId']=_0x2945fb['id'];if(_0x3fc4c3[_0x4ecb('0x2f')]['filter']){_0x15ca4f['where']=_[_0x4ecb('0x8a')](_0x15ca4f[_0x4ecb('0x62')],{'$or':_[_0x4ecb('0x71')](_0x15ca4f[_0x4ecb('0x84')],function(_0x2726ac){var _0x403cc2={};_0x403cc2[_0x2726ac]={'$like':'%'+_0x3fc4c3[_0x4ecb('0x2f')][_0x4ecb('0x89')]+'%'};return _0x403cc2;})});}_0x15ca4f=_[_0x4ecb('0x8a')]({},_0x15ca4f,_0x3fc4c3[_0x4ecb('0xa1')]);return db[_0x4ecb('0xa5')][_0x4ecb('0x16')]({'where':_0x15ca4f[_0x4ecb('0x62')]})[_0x4ecb('0x1a')](function(_0x5e13b0){_0x2d9d97[_0x4ecb('0x16')]=_0x5e13b0;if(_0x3fc4c3[_0x4ecb('0x2f')][_0x4ecb('0xa6')]){_0x15ca4f[_0x4ecb('0xa2')]=[{'all':!![]}];}return db[_0x4ecb('0xa5')][_0x4ecb('0x32')](_0x15ca4f);})['then'](function(_0x1d61f5){_0x2d9d97[_0x4ecb('0xa3')]=_0x1d61f5;return _0x2d9d97;});}})[_0x4ecb('0x1a')](respondWithFilteredResult(_0x2bd8fd,_0x15ca4f))['catch'](handleError(_0x2bd8fd,null));};exports[_0x4ecb('0xa7')]=function(_0xd90ee9,_0x55b210){var _0x3a242c={'raw':!![],'where':{}};var _0x3d5645={};var _0x14d46d={'count':0x0,'rows':[]};return db[_0x4ecb('0x26')][_0x4ecb('0x7f')]({'where':{'id':_0xd90ee9['params']['id']}})['then'](handleEntityNotFound(_0x55b210,null))[_0x4ecb('0x1a')](function(_0x41aecb){if(_0x41aecb){_0x3d5645[_0x4ecb('0x82')]=_[_0x4ecb('0x2a')](db[_0x4ecb('0x51')][_0x4ecb('0x80')]);_0x3d5645[_0x4ecb('0x2f')]=_[_0x4ecb('0x2a')](_0xd90ee9['query']);_0x3d5645[_0x4ecb('0x87')]=_[_0x4ecb('0x81')](_0x3d5645[_0x4ecb('0x82')],_0x3d5645['query']);_0x3a242c['attributes']=_[_0x4ecb('0x81')](_0x3d5645[_0x4ecb('0x82')],qs[_0x4ecb('0x83')](_0xd90ee9['query'][_0x4ecb('0x83')]));_0x3a242c['attributes']=_0x3a242c[_0x4ecb('0x84')][_0x4ecb('0x2b')]?_0x3a242c[_0x4ecb('0x84')]:_0x3d5645[_0x4ecb('0x82')];if(!_0xd90ee9[_0x4ecb('0x2f')]['hasOwnProperty'](_0x4ecb('0x8b'))){_0x3a242c[_0x4ecb('0x14')]=qs[_0x4ecb('0x14')](_0xd90ee9[_0x4ecb('0x2f')][_0x4ecb('0x14')]);_0x3a242c[_0x4ecb('0x13')]=qs[_0x4ecb('0x13')](_0xd90ee9[_0x4ecb('0x2f')]['offset']);}_0x3a242c[_0x4ecb('0x85')]=qs[_0x4ecb('0x86')](_0xd90ee9[_0x4ecb('0x2f')][_0x4ecb('0x86')]);_0x3a242c[_0x4ecb('0x62')]=qs[_0x4ecb('0x87')](_[_0x4ecb('0x88')](_0xd90ee9[_0x4ecb('0x2f')],_0x3d5645['filters']));_0x3a242c[_0x4ecb('0x62')][_0x4ecb('0xa0')]=_0x41aecb['id'];if(_0xd90ee9[_0x4ecb('0x2f')][_0x4ecb('0x89')]){_0x3a242c['where']=_['merge'](_0x3a242c[_0x4ecb('0x62')],{'$or':_['map'](_0x3a242c[_0x4ecb('0x84')],function(_0x103269){var _0x4e4614={};_0x4e4614[_0x103269]={'$like':'%'+_0xd90ee9[_0x4ecb('0x2f')][_0x4ecb('0x89')]+'%'};return _0x4e4614;})});}_0x3a242c=_[_0x4ecb('0x8a')]({},_0x3a242c,_0xd90ee9[_0x4ecb('0xa1')]);return db[_0x4ecb('0x51')][_0x4ecb('0x16')]({'where':_0x3a242c[_0x4ecb('0x62')]})[_0x4ecb('0x1a')](function(_0x3bdc63){_0x14d46d[_0x4ecb('0x16')]=_0x3bdc63;if(_0xd90ee9[_0x4ecb('0x2f')][_0x4ecb('0xa6')]){_0x3a242c['include']=[{'all':!![]}];}return db[_0x4ecb('0x51')][_0x4ecb('0x32')](_0x3a242c);})[_0x4ecb('0x1a')](function(_0x2532d1){_0x14d46d[_0x4ecb('0xa3')]=_0x2532d1;return _0x14d46d;});}})[_0x4ecb('0x1a')](respondWithFilteredResult(_0x55b210,_0x3a242c))['catch'](handleError(_0x55b210,null));};exports[_0x4ecb('0xa8')]=function(_0x430d0e,_0x56fcba){var _0xaea896={'raw':!![],'where':{}};var _0x580d61={};var _0x1481b2={'count':0x0,'rows':[]};return db[_0x4ecb('0x26')]['findOne']({'where':{'id':_0x430d0e[_0x4ecb('0x28')]['id']}})[_0x4ecb('0x1a')](handleEntityNotFound(_0x56fcba,null))['then'](function(_0x58b63f){if(_0x58b63f){_0x580d61[_0x4ecb('0x82')]=_[_0x4ecb('0x2a')](db['JscriptySessionReport']['rawAttributes']);_0x580d61[_0x4ecb('0x2f')]=_[_0x4ecb('0x2a')](_0x430d0e[_0x4ecb('0x2f')]);_0x580d61['filters']=_[_0x4ecb('0x81')](_0x580d61[_0x4ecb('0x82')],_0x580d61['query']);_0xaea896[_0x4ecb('0x84')]=_['intersection'](_0x580d61[_0x4ecb('0x82')],qs[_0x4ecb('0x83')](_0x430d0e['query'][_0x4ecb('0x83')]));_0xaea896[_0x4ecb('0x84')]=_0xaea896[_0x4ecb('0x84')]['length']?_0xaea896[_0x4ecb('0x84')]:_0x580d61['model'];if(!_0x430d0e[_0x4ecb('0x2f')][_0x4ecb('0x3a')](_0x4ecb('0x8b'))){_0xaea896[_0x4ecb('0x14')]=qs[_0x4ecb('0x14')](_0x430d0e['query']['limit']);_0xaea896[_0x4ecb('0x13')]=qs['offset'](_0x430d0e[_0x4ecb('0x2f')][_0x4ecb('0x13')]);}_0xaea896['order']=qs[_0x4ecb('0x86')](_0x430d0e[_0x4ecb('0x2f')][_0x4ecb('0x86')]);_0xaea896[_0x4ecb('0x62')]=qs[_0x4ecb('0x87')](_[_0x4ecb('0x88')](_0x430d0e[_0x4ecb('0x2f')],_0x580d61[_0x4ecb('0x87')]));_0xaea896[_0x4ecb('0x62')][_0x4ecb('0xa0')]=_0x58b63f['id'];if(_0x430d0e[_0x4ecb('0x2f')]['filter']){_0xaea896['where']=_[_0x4ecb('0x8a')](_0xaea896[_0x4ecb('0x62')],{'$or':_[_0x4ecb('0x71')](_0xaea896[_0x4ecb('0x84')],function(_0x165ff6){var _0x16b546={};_0x16b546[_0x165ff6]={'$like':'%'+_0x430d0e['query'][_0x4ecb('0x89')]+'%'};return _0x16b546;})});}_0xaea896=_[_0x4ecb('0x8a')]({},_0xaea896,_0x430d0e[_0x4ecb('0xa1')]);return db[_0x4ecb('0x56')][_0x4ecb('0x16')]({'where':_0xaea896[_0x4ecb('0x62')]})[_0x4ecb('0x1a')](function(_0x4d16b6){_0x1481b2[_0x4ecb('0x16')]=_0x4d16b6;if(_0x430d0e[_0x4ecb('0x2f')][_0x4ecb('0xa6')]){_0xaea896[_0x4ecb('0xa2')]=[{'all':!![]}];}return db[_0x4ecb('0x56')][_0x4ecb('0x32')](_0xaea896);})[_0x4ecb('0x1a')](function(_0x559883){_0x1481b2[_0x4ecb('0xa3')]=_0x559883;return _0x1481b2;});}})[_0x4ecb('0x1a')](respondWithFilteredResult(_0x56fcba,_0xaea896))[_0x4ecb('0x25')](handleError(_0x56fcba,null));};exports[_0x4ecb('0xa9')]=function(_0x3938bb,_0x17c614){try{if(!_0x3938bb[_0x4ecb('0x3b')][_0x4ecb('0x63')]){throw new Error(_0x4ecb('0xaa'));}if(!_0x3938bb[_0x4ecb('0x3b')][_0x4ecb('0xab')]){throw new Error(_0x4ecb('0xac'));}if(!_0x3938bb[_0x4ecb('0x3b')][_0x4ecb('0xad')]){throw new Error(_0x4ecb('0xae'));}if(!_0x3938bb[_0x4ecb('0x3b')][_0x4ecb('0xaf')]){throw new Error(_0x4ecb('0xb0'));}var _0x524c84=_0x3938bb[_0x4ecb('0x3b')][_0x4ecb('0xab')]['split'](',');var _0x190bdd=_0x3938bb[_0x4ecb('0x3b')][_0x4ecb('0xad')][_0x4ecb('0xb1')](',');if(!_0x524c84[_0x4ecb('0x2b')]||!_0x190bdd[_0x4ecb('0x2b')]||_0x524c84[_0x4ecb('0x2b')]!==_0x190bdd[_0x4ecb('0x2b')]){throw new Error(_0x4ecb('0xb2'));}_0x3938bb[_0x4ecb('0x3b')][_0x4ecb('0x83')]=_['zipObject'](_0x524c84,_0x190bdd);if(!_0x3938bb['body'][_0x4ecb('0x83')][_0x4ecb('0x7d')]){throw new Error(_0x4ecb('0xb3'));}if(!_0x3938bb[_0x4ecb('0x3b')]['fields'][_0x4ecb('0xb4')]){throw new Error(_0x4ecb('0xb5'));}var _0x1faa14=path[_0x4ecb('0x40')](config[_0x4ecb('0xb6')],'server/files/tmp',_0x3938bb[_0x4ecb('0xb7')][_0x4ecb('0xb8')]);fs[_0x4ecb('0xb9')](_0x1faa14,parseInt(_0x4ecb('0xba'),0x8));var _0x26a207=require(_0x4ecb('0xbb'))[_0x4ecb('0xbc')](path['join'](__dirname,_0x4ecb('0xbd')),[_0x1faa14,_0x3938bb[_0x4ecb('0x3b')][_0x4ecb('0xab')],_0x3938bb['body'][_0x4ecb('0xad')],_0x3938bb[_0x4ecb('0x3b')][_0x4ecb('0x63')],_0x3938bb[_0x4ecb('0x3b')]['CompanyId'],_0x3938bb[_0x4ecb('0x3b')][_0x4ecb('0x5f')],_0x3938bb[_0x4ecb('0x3b')]['socket_timestamp']]);return _0x17c614['status'](0xc8)[_0x4ecb('0x12')]({'message':_0x4ecb('0xbe'),'pid':_0x26a207['pid']});}catch(_0xfc5128){return _0x17c614['status'](0x1f4)['send'](_0xfc5128);}};exports[_0x4ecb('0xbf')]=function(_0x5a563e,_0x2a77f4){var _0xa30809=fs['createReadStream'](_0x5a563e['file'][_0x4ecb('0x2')]);Papa['parse'](_0xa30809,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x54c985){return _0x2a77f4[_0x4ecb('0x11')](0xc8)[_0x4ecb('0x12')]({'file':_0x5a563e['file'],'fields':_0x54c985[_0x4ecb('0xc0')][_0x4ecb('0x83')]});}});};exports[_0x4ecb('0xc1')]=function(_0x5cc048,_0x218785){return db['User'][_0x4ecb('0x32')]({'raw':!![],'attributes':['id'],'where':{'role':'agent'}})['then'](function(_0xd34694){var _0x365a95=![];if(!_0x5cc048[_0x4ecb('0x3b')][_0x4ecb('0x63')]){throw new Error(_0x4ecb('0xaa'));}if(!_0x5cc048[_0x4ecb('0x3b')][_0x4ecb('0xc2')][_0x4ecb('0x7d')]){throw new Error(_0x4ecb('0xb3'));}if(!_0x5cc048['body'][_0x4ecb('0xc2')][_0x4ecb('0xb4')]){throw new Error(_0x4ecb('0xb5'));}if(!_0x5cc048[_0x4ecb('0x3b')][_0x4ecb('0xaf')]){throw new Error(_0x4ecb('0xb0'));}var _0xb992de=require(_0x4ecb('0xbb'))[_0x4ecb('0xbc')](path[_0x4ecb('0x40')](__dirname,_0x4ecb('0xc3')),[_0x5cc048[_0x4ecb('0x28')]['id'],JSON['stringify'](_0x5cc048['body']),JSON[_0x4ecb('0xc4')](_0xd34694)]);_0xb992de['on'](_0x4ecb('0xc5'),function(){_0x365a95=!![];return _0x218785[_0x4ecb('0x11')](0xc8)[_0x4ecb('0x12')]({'message':_0x4ecb('0xc6'),'pid':_0xb992de[_0x4ecb('0xc7')]});});_0xb992de['on'](_0x4ecb('0xc8'),function(_0x41efdf){if(_0x41efdf&&!_0x365a95){return _0x218785[_0x4ecb('0x11')](0x1f4)[_0x4ecb('0x12')]({'message':_0x4ecb('0xc9'),'pid':_0xb992de[_0x4ecb('0xc7')]});}});})['catch'](handleError(_0x218785,null));};exports['importUpdates']=function(_0x31fcba,_0x307b56){return db['User']['findAll']({'raw':!![],'attributes':['id'],'where':{'role':'agent'}})[_0x4ecb('0x1a')](function(_0x15bb3c){var _0x365720=![];if(!_0x31fcba['body'][_0x4ecb('0x63')]){throw new Error(_0x4ecb('0xaa'));}if(!_0x31fcba[_0x4ecb('0x3b')]['binding']['phone']){throw new Error(_0x4ecb('0xb3'));}if(!_0x31fcba[_0x4ecb('0x3b')][_0x4ecb('0xc2')][_0x4ecb('0xb4')]){throw new Error(_0x4ecb('0xb5'));}if(!_0x31fcba[_0x4ecb('0x3b')]['socket_timestamp']){throw new Error(_0x4ecb('0xb0'));}var _0x43bf9f=require('child_process')[_0x4ecb('0xbc')](path[_0x4ecb('0x40')](__dirname,_0x4ecb('0xca')),[_0x31fcba['params']['id'],JSON[_0x4ecb('0xc4')](_0x31fcba[_0x4ecb('0x3b')]),JSON['stringify'](_0x15bb3c)]);_0x43bf9f['on'](_0x4ecb('0xc5'),function(){_0x365720=!![];return _0x307b56[_0x4ecb('0x11')](0xc8)[_0x4ecb('0x12')]({'message':_0x4ecb('0xc6'),'pid':_0x43bf9f[_0x4ecb('0xc7')]});});_0x43bf9f['on'](_0x4ecb('0xc8'),function(_0x188a24){if(_0x188a24&&!_0x365720){return _0x307b56[_0x4ecb('0x11')](0x1f4)['json']({'message':_0x4ecb('0xc9'),'pid':_0x43bf9f[_0x4ecb('0xc7')]});}});})[_0x4ecb('0x25')](handleError(_0x307b56,null));};exports[_0x4ecb('0xcb')]=function(_0x266e24,_0x496778){var _0x35b122=[_0x4ecb('0xcc'),_0x4ecb('0xcd'),'sms',_0x4ecb('0xce'),'fax',_0x4ecb('0xcf'),_0x4ecb('0xd0')];var _0x5afa94={'offset':0x0,'order':qs[_0x4ecb('0x86')](_0x4ecb('0xd1'))},_0x9e23ce={'count':0x0,'rows':[]};Promise[_0x4ecb('0xd2')]()[_0x4ecb('0x1a')](function(){if(_0x266e24['query'][_0x4ecb('0xd3')]){if(!_[_0x4ecb('0xd4')](_0x35b122,_0x266e24[_0x4ecb('0x2f')]['channel'][_0x4ecb('0xd5')]())){throw new Error(_0x4ecb('0xd6'));}_0x35b122=[_0x266e24['query'][_0x4ecb('0xd3')][_0x4ecb('0xd5')]()];}if(_0x266e24[_0x4ecb('0x2f')]['range']){try{var _0x36fc3b=JSON[_0x4ecb('0xd7')](_0x266e24['query']['range']);if(!moment(_0x36fc3b[_0x4ecb('0x3c')])[_0x4ecb('0xd8')]()){throw new Error(_0x4ecb('0xd9'));}if(!moment(_0x36fc3b['to'])[_0x4ecb('0xd8')]()){throw new Error(_0x4ecb('0xda'));}}catch(_0x3b2877){throw new Error(_0x4ecb('0xdb'));}}if(!_0x266e24[_0x4ecb('0x2f')][_0x4ecb('0x3a')](_0x4ecb('0x8b'))){_0x5afa94[_0x4ecb('0x14')]=qs['limit'](_0x266e24[_0x4ecb('0x2f')][_0x4ecb('0x14')]||0xa);_0x5afa94[_0x4ecb('0x13')]=qs[_0x4ecb('0x13')](_0x266e24[_0x4ecb('0x2f')][_0x4ecb('0x13')]);}var _0x56151a=_0x35b122[_0x4ecb('0x71')](function(_0x562ec0){if(_0x562ec0===_0x4ecb('0xd0')){var _0xad37ab={'attributes':['id',_0x4ecb('0xdc'),_0x4ecb('0x36'),_0x4ecb('0xdd'),_0x4ecb('0xde'),_0x4ecb('0xdf'),_0x4ecb('0xe0'),_0x4ecb('0xe1'),_0x4ecb('0xe2'),_0x4ecb('0xe3'),_0x4ecb('0xe4'),_0x4ecb('0xe5'),_0x4ecb('0xe6'),'userThirdDisposition','UserId'],'where':{'ContactId':_0x266e24[_0x4ecb('0x28')]['id']},'include':[{'model':db['User'],'as':'User','attributes':['id',_0x4ecb('0x20'),_0x4ecb('0xe7'),'alias']}],'order':[['createdAt',_0x4ecb('0xe8')]]};if(_0x266e24[_0x4ecb('0x2f')]['range']){_0xad37ab[_0x4ecb('0x62')]['createdAt']={'$gte':_0x36fc3b[_0x4ecb('0x3c')],'$lte':_0x36fc3b['to']};}return db[_0x4ecb('0xe9')][_0x4ecb('0xea')](_0xad37ab)['then'](function(_0x1f1d95){_0x9e23ce[_0x4ecb('0x16')]+=_0x1f1d95[_0x4ecb('0x16')];return _['map'](_0x1f1d95[_0x4ecb('0xa3')],function(_0x2dcca7){var _0x312ef8=_0x2dcca7[_0x4ecb('0x3d')]({'plain':!![]});_0x312ef8['channel']=_0x562ec0;if(_0x312ef8[_0x4ecb('0xeb')]){_0x312ef8[_0x4ecb('0xeb')]={'id':_0x312ef8['User']['id'],'name':_0x312ef8['User'][_0x4ecb('0x20')],'fullname':_0x312ef8[_0x4ecb('0xeb')]['fullname'],'alias':_0x312ef8[_0x4ecb('0xeb')][_0x4ecb('0x34')]};}return _0x312ef8;});});}else{var _0x35d4ee=_['startCase'](_0x562ec0)+(_0x562ec0===_0x4ecb('0xcd')?_0x4ecb('0xec'):'Account');var _0x125869={'attributes':['id','closed',_0x4ecb('0xed'),_0x4ecb('0xe4'),'note','disposition',_0x4ecb('0xee'),_0x4ecb('0xef'),_0x4ecb('0xf0'),_0x35d4ee+'Id'],'where':{'ContactId':_0x266e24[_0x4ecb('0x28')]['id']},'include':[{'model':db[_0x35d4ee],'as':_0x4ecb('0xf1'),'attributes':['id',_0x4ecb('0x20'),_0x4ecb('0xf2')]},{'model':db[_0x4ecb('0xeb')],'as':'Owner','attributes':['id',_0x4ecb('0x20'),_0x4ecb('0xe7')]},{'model':db[_0x4ecb('0x68')],'as':_0x4ecb('0x69'),'attributes':['id','name',_0x4ecb('0x6a')],'through':{'attributes':[]}}],'order':[[_0x4ecb('0xe4'),_0x4ecb('0xe8')]]};if(_0x266e24['query'][_0x4ecb('0xf3')]){_0x125869[_0x4ecb('0x62')][_0x4ecb('0xe4')]={'$gte':_0x36fc3b['from'],'$lte':_0x36fc3b['to']};}switch(_0x562ec0){case _0x4ecb('0xcd'):_0x125869[_0x4ecb('0x84')][_0x4ecb('0x61')](_0x4ecb('0xf4'),'customerIp',_0x4ecb('0xf5'),_0x4ecb('0xf6'),'osName',_0x4ecb('0xf7'),_0x4ecb('0xf8'),_0x4ecb('0xf9'),_0x4ecb('0xfa'));break;case'mail':_0x125869[_0x4ecb('0x84')][_0x4ecb('0x61')](_0x4ecb('0xfb'),'substatus');break;case _0x4ecb('0xce'):_0x125869[_0x4ecb('0x84')][_0x4ecb('0x61')](_0x4ecb('0xfc'),_0x4ecb('0xfd'));break;}return db[_[_0x4ecb('0xfe')](_0x562ec0)+_0x4ecb('0xff')][_0x4ecb('0xea')](_0x125869)['then'](function(_0x3986c1){_0x9e23ce[_0x4ecb('0x16')]+=_0x3986c1['count'];return _[_0x4ecb('0x71')](_0x3986c1[_0x4ecb('0xa3')],function(_0x2e9090){var _0x16f17d=_0x2e9090[_0x4ecb('0x3d')]({'plain':!![]});_0x16f17d['channel']=_0x562ec0;if(_0x16f17d[_0x4ecb('0x100')]){_0x16f17d['Owner']={'id':_0x16f17d[_0x4ecb('0x100')]['id'],'name':_0x16f17d[_0x4ecb('0x100')][_0x4ecb('0x20')],'fullname':_0x16f17d[_0x4ecb('0x100')][_0x4ecb('0xe7')]};}return _0x16f17d;});});}});return Promise[_0x4ecb('0x8d')](_0x56151a);})['then'](function(_0x336ac8){return _(_0x336ac8)[_0x4ecb('0x101')]()[_0x4ecb('0x102')](_0x4ecb('0xe4'))[_0x4ecb('0x103')]()[_0x4ecb('0x104')]();})['then'](function(_0x1d18f4){_0x9e23ce[_0x4ecb('0xa3')]=_0x5afa94[_0x4ecb('0x14')]?_0x1d18f4[_0x4ecb('0x105')](_0x5afa94[_0x4ecb('0x13')],_0x5afa94['offset']+_0x5afa94[_0x4ecb('0x14')]):_0x1d18f4;return _0x9e23ce;})[_0x4ecb('0x1a')](respondWithFilteredResult(_0x496778,_0x5afa94))['catch'](handleError(_0x496778,null));}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.events.js b/server/api/cmContact/cmContact.events.js index 1e01427..628d846 100644 --- a/server/api/cmContact/cmContact.events.js +++ b/server/api/cmContact/cmContact.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe232=['save','remove','emit','hasOwnProperty','exports','events','../../mysqldb','CmContact'];(function(_0x369289,_0xb779d8){var _0x1c8ba4=function(_0x28cc27){while(--_0x28cc27){_0x369289['push'](_0x369289['shift']());}};_0x1c8ba4(++_0xb779d8);}(_0xe232,0xcd));var _0x2e23=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe232[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x2e23('0x0'));var CmContact=require(_0x2e23('0x1'))['db'][_0x2e23('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2e23('0x3'),'afterUpdate':'update','afterDestroy':_0x2e23('0x4')};function emitEvent(_0x42e9ea){return function(_0x4858cf,_0x15a14a,_0x76e597){CmContactEvents[_0x2e23('0x5')](_0x42e9ea+':'+_0x4858cf['id'],_0x4858cf);CmContactEvents[_0x2e23('0x5')](_0x42e9ea,_0x4858cf);_0x76e597(null);};}for(var e in events){if(events[_0x2e23('0x6')](e)){var event=events[e];CmContact['hook'](e,emitEvent(event));}}module[_0x2e23('0x7')]=CmContactEvents; \ No newline at end of file +var _0xff7f=['../../mysqldb','CmContact','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x481bf7,_0x437f69){var _0x461787=function(_0xb3bc9d){while(--_0xb3bc9d){_0x481bf7['push'](_0x481bf7['shift']());}};_0x461787(++_0x437f69);}(_0xff7f,0x1b7));var _0xfff7=function(_0x4d971d,_0x494901){_0x4d971d=_0x4d971d-0x0;var _0x3f40a0=_0xff7f[_0x4d971d];return _0x3f40a0;};'use strict';var EventEmitter=require(_0xfff7('0x0'));var CmContact=require(_0xfff7('0x1'))['db'][_0xfff7('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents[_0xfff7('0x3')](0x0);var events={'afterCreate':_0xfff7('0x4'),'afterUpdate':_0xfff7('0x5'),'afterDestroy':_0xfff7('0x6')};function emitEvent(_0x40df7c){return function(_0x78c890,_0x490086,_0x5b7767){CmContactEvents['emit'](_0x40df7c+':'+_0x78c890['id'],_0x78c890);CmContactEvents[_0xfff7('0x7')](_0x40df7c,_0x78c890);_0x5b7767(null);};}for(var e in events){if(events[_0xfff7('0x8')](e)){var event=events[e];CmContact[_0xfff7('0x9')](e,emitEvent(event));}}module[_0xfff7('0xa')]=CmContactEvents; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.model.js b/server/api/cmContact/cmContact.model.js index d4612e9..ce38037 100644 --- a/server/api/cmContact/cmContact.model.js +++ b/server/api/cmContact/cmContact.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x652e=['cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','cmContact','Campaign','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','create','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll','outbound','dialCheckDuplicateType','CmList','Lists','length','always','onlyIfOpen','BlackLists','CmHopperBlack','cmContact,\x20%s,\x20%s','message','isEmpty','destroy','ContactId','VoiceQueueId','all','info','[CmContact][afterDestroy][Error]','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./cmContact.attributes','exports','define','CmContact','phone','fti_cm_contacts','firstName','lastName','mobile','fax','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','models','get','error','afterCreate','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','dialTimezone','VoiceQueue','findOne','then','isNil','timezones','utcOffset','add','minutes','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopper','ListId','priority','callbackUniqueid','catch','ret','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal'];(function(_0x305247,_0x2b2ce9){var _0x226fdc=function(_0x3c33fa){while(--_0x3c33fa){_0x305247['push'](_0x305247['shift']());}};_0x226fdc(++_0x2b2ce9);}(_0x652e,0x1dd));var _0xe652=function(_0x304a52,_0x1bdae0){_0x304a52=_0x304a52-0x0;var _0x4a9605=_0x652e[_0x304a52];return _0x4a9605;};'use strict';var _=require(_0xe652('0x0'));var util=require('util');var logger=require(_0xe652('0x1'))(_0xe652('0x2'));var moment=require(_0xe652('0x3'));var BPromise=require('bluebird');var rp=require(_0xe652('0x4'));var fs=require('fs');var path=require(_0xe652('0x5'));var rimraf=require(_0xe652('0x6'));var config=require(_0xe652('0x7'));var shared=require('../../config/environment/shared');var attributes=require(_0xe652('0x8'));module[_0xe652('0x9')]=function(_0xbba2ea,_0x7a3e58){return _0xbba2ea[_0xe652('0xa')](_0xe652('0xb'),attributes,{'tableName':'cm_contacts','paranoid':!![],'indexes':[{'name':_0xe652('0xc'),'fields':['phone']},{'name':_0xe652('0xd'),'fields':[_0xe652('0xe'),_0xe652('0xf'),_0xe652('0xc'),_0xe652('0x10'),_0xe652('0x11'),'email'],'type':_0xe652('0x12')}],'timestamps':!![],'charset':_0xe652('0x13'),'collate':_0xe652('0x14'),'hooks':{'afterCreate':function(_0x4eb0ff,_0x13eef4,_0x36d647){var _0x52288f=_0xbba2ea[_0xe652('0x15')];var _0x3d9bc6=_0x4eb0ff[_0xe652('0x16')]({'plain':!![]});function _0x480890(){return function(_0x5f2623){logger[_0xe652('0x17')]('cmContact',_0xe652('0x18'),util[_0xe652('0x19')](_0x5f2623,{'showHidden':![],'depth':null}));};}function _0x40bf51(_0x2cb900,_0x2966bc){var _0xceb74c=_0x2966bc[_0xe652('0x1a')]?_0x2966bc[_0xe652('0x1a')]:moment()[_0xe652('0x1b')](_0xe652('0x1c'));return new BPromise(function(_0xd8ef97,_0x3d617f){if(_['isNil'](_0x2966bc[_0xe652('0x1d')])){_0xd8ef97({'ret':_0xceb74c});}else{_0x52288f[_0xe652('0x1e')][_0xe652('0x1f')]({'where':{'id':_0x2cb900['id']}})[_0xe652('0x20')](function(_0x3f37b5){if(!_['isNil'](_0x3f37b5)){var _0x265fbd=_0x3f37b5['dialTimezone'];if(!_[_0xe652('0x21')](_0x265fbd)){var _0x11fc90=shared[_0xe652('0x22')];var _0x555012=_0x11fc90[_0x265fbd];var _0x3a52ac=_0x11fc90[_0x2966bc[_0xe652('0x1d')]];if(!_[_0xe652('0x21')](_0x555012)&&!_[_0xe652('0x21')](_0x3a52ac)){var _0x510e8e=_0x555012['utcOffset']-_0x3a52ac[_0xe652('0x23')];_0xceb74c=_0x2966bc[_0xe652('0x1a')]?_0x2966bc['scheduledat']:moment();var _0x2b16cf=moment(_0xceb74c)[_0xe652('0x24')](_0x510e8e,_0xe652('0x25'));_0xd8ef97({'ret':_0x2b16cf['format']('YYYY-MM-DD\x20HH:mm:ss')});}else _0xd8ef97({'ret':_0xceb74c});}else _0xd8ef97({'ret':_0xceb74c});}else{_0xd8ef97({'ret':_0xceb74c});}});}});return 0xa;}var _0x140e7a=function(_0x3a2a17){return new BPromise(function(_0x3e5c91,_0x5017ed){_0x40bf51(_0x3a2a17,_0x3d9bc6)[_0xe652('0x20')](function(_0x218e56){_0x3d9bc6['scheduledat']=_0x218e56['ret'];_0x52288f['CmHopper'][_0xe652('0x1f')]({'where':{'phone':_0x3d9bc6[_0xe652('0xc')],'VoiceQueueId':_0x3a2a17['id']}})[_0xe652('0x20')](function(_0x2ac5b1){if(!_[_0xe652('0x21')](_0x2ac5b1)){throw new Error(_0xe652('0x26')+_0x3d9bc6['phone']+_0xe652('0x27')+_0x3a2a17['id']);}return _0x52288f[_0xe652('0x28')]['create']({'phone':_0x3d9bc6[_0xe652('0xc')],'ContactId':_0x3d9bc6['id'],'ListId':_0x3d9bc6[_0xe652('0x29')],'priority':_0x3d9bc6[_0xe652('0x2a')]?_0x3d9bc6[_0xe652('0x2a')]:0x2,'scheduledat':_0x3d9bc6[_0xe652('0x1a')]?_0x3d9bc6[_0xe652('0x1a')]:moment()[_0xe652('0x1b')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x3d9bc6[_0xe652('0x2b')]?!![]:![],'callbackuniqueid':_0x3d9bc6[_0xe652('0x2b')]?_0x3d9bc6[_0xe652('0x2b')]:undefined,'callbackat':_0x3d9bc6[_0xe652('0x2b')]?moment()['format'](_0xe652('0x1c')):undefined,'VoiceQueueId':_0x3a2a17['id']});})[_0xe652('0x2c')](function(_0x1f1a01){_0x5017ed(_0x1f1a01);});});});};var _0x11b35f=function(_0xe1e7d9){return new BPromise(function(_0x4ab4ec,_0x1d461f){_0x40bf51(_0xe1e7d9,_0x3d9bc6)[_0xe652('0x20')](function(_0x37f81d){_0x3d9bc6[_0xe652('0x1a')]=_0x37f81d[_0xe652('0x2d')];_0x52288f[_0xe652('0x28')]['findOne']({'where':{'phone':_0x3d9bc6[_0xe652('0xc')],'VoiceQueueId':_0xe1e7d9['id']}})[_0xe652('0x20')](function(_0x44a46d){if(!_[_0xe652('0x21')](_0x44a46d)){throw new Error(_0xe652('0x26')+_0x3d9bc6['phone']+_0xe652('0x2e')+_0xe1e7d9['id']);}return _0x52288f[_0xe652('0x2f')][_0xe652('0x1f')]({'where':{'calleridnum':_0x3d9bc6[_0xe652('0xc')],'VoiceQueueId':_0xe1e7d9['id']}});})[_0xe652('0x20')](function(_0x51ea59){if(!_[_0xe652('0x21')](_0x51ea59)){throw new Error(_0xe652('0x30')+_0x3d9bc6['phone']+_0xe652('0x31')+_0xe1e7d9['id']);}return _0x52288f[_0xe652('0x28')]['create']({'phone':_0x3d9bc6[_0xe652('0xc')],'ContactId':_0x3d9bc6['id'],'ListId':_0x3d9bc6['ListId'],'priority':_0x3d9bc6[_0xe652('0x2a')]?_0x3d9bc6['priority']:0x2,'scheduledat':_0x3d9bc6['scheduledat']?_0x3d9bc6[_0xe652('0x1a')]:moment()[_0xe652('0x1b')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x3d9bc6[_0xe652('0x2b')]?!![]:![],'callbackuniqueid':_0x3d9bc6[_0xe652('0x2b')]?_0x3d9bc6[_0xe652('0x2b')]:undefined,'callbackat':_0x3d9bc6[_0xe652('0x2b')]?moment()['format'](_0xe652('0x1c')):undefined,'VoiceQueueId':_0xe1e7d9['id']});})['catch'](function(_0x518339){_0x1d461f(_0x518339);});});});};function _0x2819cf(){return function(_0x4dd49f){logger['error'](_0xe652('0x32'),_0xe652('0x18'),util['inspect'](_0x4dd49f,{'showHidden':![],'depth':null}));};}function _0x2d94c4(_0x51e81e,_0x270b64){var _0x11fc2e=_0x270b64[_0xe652('0x1a')]?_0x270b64['scheduledat']:moment()[_0xe652('0x1b')]('YYYY-MM-DD\x20HH:mm:ss');return new BPromise(function(_0x2a81ed,_0x5586a0){if(_[_0xe652('0x21')](_0x270b64[_0xe652('0x1d')])){_0x2a81ed({'ret':_0x11fc2e});}else{_0x52288f[_0xe652('0x33')][_0xe652('0x1f')]({'where':{'id':_0x51e81e['id']}})[_0xe652('0x20')](function(_0x53e093){if(!_[_0xe652('0x21')](_0x53e093)){var _0x223d7a=_0x53e093[_0xe652('0x1d')];if(!_[_0xe652('0x21')](_0x223d7a)){var _0x2fc08d=shared[_0xe652('0x22')];var _0x5d24bf=_0x2fc08d[_0x223d7a];var _0x460484=_0x2fc08d[_0x270b64[_0xe652('0x1d')]];if(!_['isNil'](_0x5d24bf)&&!_['isNil'](_0x460484)){var _0x50f04b=_0x5d24bf[_0xe652('0x23')]-_0x460484[_0xe652('0x23')];_0x11fc2e=_0x270b64[_0xe652('0x1a')]?_0x270b64['scheduledat']:moment();var _0x46fbc2=moment(_0x11fc2e)[_0xe652('0x24')](_0x50f04b,_0xe652('0x25'));_0x2a81ed({'ret':_0x46fbc2[_0xe652('0x1b')](_0xe652('0x1c'))});}else _0x2a81ed({'ret':_0x11fc2e});}else _0x2a81ed({'ret':_0x11fc2e});}else{_0x2a81ed({'ret':_0x11fc2e});}});}});return 0xa;}var _0x3b4488=function(_0x537f2e){return new BPromise(function(_0x4f1c57,_0x1f1d8e){_0x2d94c4(_0x537f2e,_0x3d9bc6)['then'](function(_0x597038){_0x3d9bc6[_0xe652('0x1a')]=_0x597038[_0xe652('0x2d')];_0x52288f['CmHopper'][_0xe652('0x1f')]({'where':{'phone':_0x3d9bc6[_0xe652('0xc')],'CampaignId':_0x537f2e['id']}})[_0xe652('0x20')](function(_0xdc16b5){if(!_[_0xe652('0x21')](_0xdc16b5)){throw new Error('cmContact,\x20afterCreate\x20'+_0x3d9bc6[_0xe652('0xc')]+_0xe652('0x34')+_0x537f2e['id']);}return _0x52288f[_0xe652('0x28')][_0xe652('0x35')]({'phone':_0x3d9bc6[_0xe652('0xc')],'ContactId':_0x3d9bc6['id'],'ListId':_0x3d9bc6['ListId'],'priority':_0x3d9bc6[_0xe652('0x2a')]?_0x3d9bc6['priority']:0x2,'scheduledat':_0x3d9bc6['scheduledat']?_0x3d9bc6[_0xe652('0x1a')]:moment()[_0xe652('0x1b')](_0xe652('0x1c')),'callback':_0x3d9bc6[_0xe652('0x2b')]?!![]:![],'callbackuniqueid':_0x3d9bc6[_0xe652('0x2b')]?_0x3d9bc6[_0xe652('0x2b')]:undefined,'callbackat':_0x3d9bc6[_0xe652('0x2b')]?moment()[_0xe652('0x1b')](_0xe652('0x1c')):undefined,'CampaignId':_0x537f2e['id']});})[_0xe652('0x2c')](function(_0x8159c8){_0x1f1d8e(_0x8159c8);});});});};var _0x4b7383=function(_0x2292ad){return new BPromise(function(_0x34fe14,_0x24bc85){_0x2d94c4(_0x2292ad,_0x3d9bc6)[_0xe652('0x20')](function(_0x78205d){_0x3d9bc6[_0xe652('0x1a')]=_0x78205d[_0xe652('0x2d')];_0x52288f[_0xe652('0x28')][_0xe652('0x1f')]({'where':{'phone':_0x3d9bc6['phone'],'CampaignId':_0x2292ad['id']}})['then'](function(_0x407367){if(!_['isNil'](_0x407367)){throw new Error(_0xe652('0x26')+_0x3d9bc6['phone']+_0xe652('0x36')+_0x2292ad['id']);}return _0x52288f[_0xe652('0x2f')][_0xe652('0x1f')]({'where':{'calleridnum':_0x3d9bc6[_0xe652('0xc')],'CampaignId':_0x2292ad['id']}});})[_0xe652('0x20')](function(_0x515643){if(!_[_0xe652('0x21')](_0x515643)){throw new Error(_0xe652('0x30')+_0x3d9bc6[_0xe652('0xc')]+_0xe652('0x37')+_0x2292ad['id']);}return _0x52288f[_0xe652('0x28')][_0xe652('0x35')]({'phone':_0x3d9bc6[_0xe652('0xc')],'ContactId':_0x3d9bc6['id'],'ListId':_0x3d9bc6[_0xe652('0x29')],'priority':_0x3d9bc6[_0xe652('0x2a')]?_0x3d9bc6[_0xe652('0x2a')]:0x2,'scheduledat':_0x3d9bc6['scheduledat']?_0x3d9bc6['scheduledat']:moment()[_0xe652('0x1b')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x3d9bc6[_0xe652('0x2b')]?!![]:![],'callbackuniqueid':_0x3d9bc6['callbackUniqueid']?_0x3d9bc6[_0xe652('0x2b')]:undefined,'callbackat':_0x3d9bc6[_0xe652('0x2b')]?moment()['format'](_0xe652('0x1c')):undefined,'CampaignId':_0x2292ad['id']});})[_0xe652('0x2c')](function(_0x3765f4){_0x24bc85(_0x3765f4);});});});};if(_0x3d9bc6['ListId']){_0x52288f['VoiceQueue'][_0xe652('0x38')]({'where':{'type':_0xe652('0x39')},'attributes':['id',_0xe652('0x3a'),_0xe652('0x1d')],'include':[{'model':_0x52288f[_0xe652('0x3b')],'as':_0xe652('0x3c'),'where':{'id':_0x3d9bc6['ListId']}}]})[_0xe652('0x20')](function(_0x228f1c){if(_0x228f1c){var _0x5e246d=[];for(var _0x3af46f=0x0,_0x535d3a;_0x3af46f<_0x228f1c[_0xe652('0x3d')];_0x3af46f+=0x1){_0x535d3a=_0x228f1c[_0x3af46f]['get']({'plain':!![]});switch(_0x535d3a[_0xe652('0x3a')]){case _0xe652('0x3e'):_0x11b35f(_0x535d3a)[_0xe652('0x2c')](_0x480890());break;case _0xe652('0x3f'):_0x140e7a(_0x535d3a)[_0xe652('0x2c')](_0x480890());break;default:_0x2d94c4(_0x535d3a,_0x3d9bc6)[_0xe652('0x20')](function(_0xa242b){_0x3d9bc6['scheduledat']=_0xa242b['ret'];_0x52288f[_0xe652('0x28')]['create']({'phone':_0x3d9bc6[_0xe652('0xc')],'ContactId':_0x3d9bc6['id'],'ListId':_0x3d9bc6[_0xe652('0x29')],'scheduledat':_0x3d9bc6[_0xe652('0x1a')]?_0x3d9bc6['scheduledat']:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x3d9bc6['priority']?_0x3d9bc6[_0xe652('0x2a')]:0x2,'callback':_0x3d9bc6[_0xe652('0x2b')]?!![]:![],'callbackuniqueid':_0x3d9bc6[_0xe652('0x2b')]?_0x3d9bc6[_0xe652('0x2b')]:undefined,'callbackat':_0x3d9bc6['callbackUniqueid']?moment()[_0xe652('0x1b')](_0xe652('0x1c')):undefined,'VoiceQueueId':_0x535d3a['id']})[_0xe652('0x2c')](_0x480890());});}}}})['then'](function(){return _0x52288f['VoiceQueue'][_0xe652('0x38')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':_0x52288f['CmList'],'as':_0xe652('0x40'),'where':{'id':_0x3d9bc6[_0xe652('0x29')]}}]})[_0xe652('0x20')](function(_0x3841fb){if(_0x3841fb){var _0x6ea13d=[];for(var _0x17df3e=0x0,_0xe5a253;_0x17df3e<_0x3841fb[_0xe652('0x3d')];_0x17df3e+=0x1){_0xe5a253=_0x3841fb[_0x17df3e][_0xe652('0x16')]({'plain':!![]});_0x52288f[_0xe652('0x41')][_0xe652('0x35')]({'phone':_0x3d9bc6[_0xe652('0xc')],'ContactId':_0x3d9bc6['id'],'ListId':_0x3d9bc6[_0xe652('0x29')],'VoiceQueueId':_0xe5a253['id']})[_0xe652('0x2c')](function(_0x564dd0){logger[_0xe652('0x17')](_0xe652('0x42'),_0xe652('0x18'),_0x564dd0[_0xe652('0x43')]);});}}});})['then'](function(){return _0x52288f[_0xe652('0x33')]['findAll']({'attributes':['id',_0xe652('0x3a'),_0xe652('0x1d')],'include':[{'model':_0x52288f[_0xe652('0x3b')],'as':_0xe652('0x3c'),'where':{'id':_0x3d9bc6[_0xe652('0x29')]}}]})[_0xe652('0x20')](function(_0x54135d){if(_0x54135d){var _0x516dc2=[];for(var _0x5a90ae=0x0,_0x30c9c8;_0x5a90ae<_0x54135d[_0xe652('0x3d')];_0x5a90ae+=0x1){_0x30c9c8=_0x54135d[_0x5a90ae][_0xe652('0x16')]({'plain':!![]});switch(_0x30c9c8['dialCheckDuplicateType']){case _0xe652('0x3e'):_0x4b7383(_0x30c9c8)['catch'](_0x2819cf());break;case _0xe652('0x3f'):_0x3b4488(_0x30c9c8)[_0xe652('0x2c')](_0x2819cf());break;default:_0x52288f['CmHopper'][_0xe652('0x35')]({'phone':_0x3d9bc6['phone'],'ContactId':_0x3d9bc6['id'],'ListId':_0x3d9bc6[_0xe652('0x29')],'scheduledat':_0x3d9bc6[_0xe652('0x1a')]?_0x3d9bc6['scheduledat']:moment()[_0xe652('0x1b')](_0xe652('0x1c')),'priority':_0x3d9bc6['priority']?_0x3d9bc6[_0xe652('0x2a')]:0x2,'callback':_0x3d9bc6[_0xe652('0x2b')]?!![]:![],'callbackuniqueid':_0x3d9bc6['callbackUniqueid']?_0x3d9bc6[_0xe652('0x2b')]:undefined,'callbackat':_0x3d9bc6['callbackUniqueid']?moment()[_0xe652('0x1b')](_0xe652('0x1c')):undefined,'CampaignId':_0x30c9c8['id']})[_0xe652('0x2c')](_0x2819cf());}}}});})[_0xe652('0x20')](function(){return _0x52288f[_0xe652('0x33')][_0xe652('0x38')]({'attributes':['id'],'include':[{'model':_0x52288f[_0xe652('0x3b')],'as':'BlackLists','where':{'id':_0x3d9bc6[_0xe652('0x29')]}}]})[_0xe652('0x20')](function(_0x2c6184){if(_0x2c6184){var _0x1e1ace=[];for(var _0x328375=0x0,_0x4f1014;_0x328375<_0x2c6184[_0xe652('0x3d')];_0x328375+=0x1){_0x4f1014=_0x2c6184[_0x328375]['get']({'plain':!![]});_0x52288f[_0xe652('0x41')][_0xe652('0x35')]({'phone':_0x3d9bc6[_0xe652('0xc')],'ContactId':_0x3d9bc6['id'],'ListId':_0x3d9bc6['ListId'],'CampaignId':_0x4f1014['id']})[_0xe652('0x2c')](function(_0x2b024b){logger['error']('cmContact,\x20%s,\x20%s',_0xe652('0x18'),_0x2b024b['message']);});}}});})['then'](function(){_0x36d647();})[_0xe652('0x2c')](function(_0x2e2b16){logger[_0xe652('0x17')]('cmContact,\x20%s,\x20%s','afterCreate',_0x2e2b16[_0xe652('0x43')]);_0x36d647(_0x2e2b16);});}else{_0x36d647(new Error('List\x20not\x20found'));}},'afterDestroy':function(_0xd1afe,_0x242184,_0x30501f){var _0xe53469=_0xbba2ea['models'];var _0x18c48a=_0xd1afe[_0xe652('0x16')]({'plain':!![]});return _0xe53469[_0xe652('0x28')][_0xe652('0x38')]({'raw':!![],'where':{'ListId':_0x18c48a[_0xe652('0x29')],'ContactId':_0x18c48a['id']}})['then'](function(_0x305b29){if(!_[_0xe652('0x44')](_0x305b29)){var _0x4a903c=[];for(var _0x326317=0x0;_0x326317<_0x305b29['length'];_0x326317+=0x1){var _0x56358b=_0xe53469['CmHopper'][_0xe652('0x45')]({'where':{'ListId':_0x305b29[_0x326317][_0xe652('0x29')],'ContactId':_0x305b29[_0x326317][_0xe652('0x46')],'VoiceQueueId':_0x305b29[_0x326317][_0xe652('0x47')],'CampaignId':_0x305b29[_0x326317]['CampaignId']}});_0x4a903c['push'](_0x56358b);}return BPromise[_0xe652('0x48')](_0x4a903c);}})[_0xe652('0x20')](function(_0x44fe2b){logger[_0xe652('0x49')]('[CmContact][afterDestroy][Succesfull]',util['inspect'](_0x44fe2b,{'showHidden':![],'depth':null}));_0x30501f();})['catch'](function(_0x4b242d){logger['error'](_0xe652('0x4a'),util[_0xe652('0x19')](_0x4b242d,{'showHidden':![],'depth':null}));_0x30501f(_0x4b242d);});}}});}; \ No newline at end of file +var _0x0906=['phone','firstName','lastName','mobile','fax','email','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','models','get','error','cmContact','afterCreate','inspect','format','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','VoiceQueue','timezones','scheduledat','add','then','ret','findOne','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopper','create','ListId','callbackUniqueid','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','priority','catch','Campaign','utcOffset','minutes','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','cmContact,\x20afterCreate,\x20','findAll','outbound','CmList','length','dialCheckDuplicateType','always','onlyIfOpen','cmContact,\x20%s,\x20%s','message','BlackLists','List\x20not\x20found','isEmpty','destroy','ContactId','all','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment/shared','exports','define','CmContact','cm_contacts'];(function(_0x441f7a,_0x576321){var _0x4821da=function(_0x5c5b52){while(--_0x5c5b52){_0x441f7a['push'](_0x441f7a['shift']());}};_0x4821da(++_0x576321);}(_0x0906,0x157));var _0x6090=function(_0x15ee59,_0x1e7b8b){_0x15ee59=_0x15ee59-0x0;var _0x1e1e80=_0x0906[_0x15ee59];return _0x1e1e80;};'use strict';var _=require(_0x6090('0x0'));var util=require('util');var logger=require(_0x6090('0x1'))(_0x6090('0x2'));var moment=require(_0x6090('0x3'));var BPromise=require('bluebird');var rp=require(_0x6090('0x4'));var fs=require('fs');var path=require(_0x6090('0x5'));var rimraf=require(_0x6090('0x6'));var config=require('../../config/environment');var shared=require(_0x6090('0x7'));var attributes=require('./cmContact.attributes');module[_0x6090('0x8')]=function(_0x2688db,_0x46c9c7){return _0x2688db[_0x6090('0x9')](_0x6090('0xa'),attributes,{'tableName':_0x6090('0xb'),'paranoid':!![],'indexes':[{'name':'phone','fields':[_0x6090('0xc')]},{'name':'fti_cm_contacts','fields':[_0x6090('0xd'),_0x6090('0xe'),_0x6090('0xc'),_0x6090('0xf'),_0x6090('0x10'),_0x6090('0x11')],'type':_0x6090('0x12')}],'timestamps':!![],'charset':_0x6090('0x13'),'collate':_0x6090('0x14'),'hooks':{'afterCreate':function(_0xf0a570,_0x1716f0,_0x913949){var _0x4b40e7=_0x2688db[_0x6090('0x15')];var _0x3b0954=_0xf0a570[_0x6090('0x16')]({'plain':!![]});function _0x33e96d(){return function(_0x10575e){logger[_0x6090('0x17')](_0x6090('0x18'),_0x6090('0x19'),util[_0x6090('0x1a')](_0x10575e,{'showHidden':![],'depth':null}));};}function _0x5a31a7(_0x4a6405,_0x299c90){var _0x22debb=_0x299c90['scheduledat']?_0x299c90['scheduledat']:moment()[_0x6090('0x1b')](_0x6090('0x1c'));return new BPromise(function(_0x104aea,_0x3bb958){if(_[_0x6090('0x1d')](_0x299c90[_0x6090('0x1e')])){_0x104aea({'ret':_0x22debb});}else{_0x4b40e7[_0x6090('0x1f')]['findOne']({'where':{'id':_0x4a6405['id']}})['then'](function(_0x587fc1){if(!_['isNil'](_0x587fc1)){var _0x41c387=_0x587fc1[_0x6090('0x1e')];if(!_[_0x6090('0x1d')](_0x41c387)){var _0x2c529d=shared[_0x6090('0x20')];var _0x42b848=_0x2c529d[_0x41c387];var _0x5658ad=_0x2c529d[_0x299c90['dialTimezone']];if(!_[_0x6090('0x1d')](_0x42b848)&&!_[_0x6090('0x1d')](_0x5658ad)){var _0x1b8484=_0x42b848['utcOffset']-_0x5658ad['utcOffset'];_0x22debb=_0x299c90[_0x6090('0x21')]?_0x299c90[_0x6090('0x21')]:moment();var _0x35307b=moment(_0x22debb)[_0x6090('0x22')](_0x1b8484,'minutes');_0x104aea({'ret':_0x35307b[_0x6090('0x1b')](_0x6090('0x1c'))});}else _0x104aea({'ret':_0x22debb});}else _0x104aea({'ret':_0x22debb});}else{_0x104aea({'ret':_0x22debb});}});}});return 0xa;}var _0x455db0=function(_0x283923){return new BPromise(function(_0x24ec83,_0x228c2c){_0x5a31a7(_0x283923,_0x3b0954)[_0x6090('0x23')](function(_0x59037c){_0x3b0954[_0x6090('0x21')]=_0x59037c[_0x6090('0x24')];_0x4b40e7['CmHopper'][_0x6090('0x25')]({'where':{'phone':_0x3b0954['phone'],'VoiceQueueId':_0x283923['id']}})[_0x6090('0x23')](function(_0x358b58){if(!_['isNil'](_0x358b58)){throw new Error(_0x6090('0x26')+_0x3b0954[_0x6090('0xc')]+_0x6090('0x27')+_0x283923['id']);}return _0x4b40e7[_0x6090('0x28')][_0x6090('0x29')]({'phone':_0x3b0954[_0x6090('0xc')],'ContactId':_0x3b0954['id'],'ListId':_0x3b0954[_0x6090('0x2a')],'priority':_0x3b0954['priority']?_0x3b0954['priority']:0x2,'scheduledat':_0x3b0954[_0x6090('0x21')]?_0x3b0954[_0x6090('0x21')]:moment()[_0x6090('0x1b')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x3b0954[_0x6090('0x2b')]?!![]:![],'callbackuniqueid':_0x3b0954[_0x6090('0x2b')]?_0x3b0954[_0x6090('0x2b')]:undefined,'callbackat':_0x3b0954['callbackUniqueid']?moment()[_0x6090('0x1b')](_0x6090('0x1c')):undefined,'VoiceQueueId':_0x283923['id']});})['catch'](function(_0x8be01e){_0x228c2c(_0x8be01e);});});});};var _0x4cd64e=function(_0x491f24){return new BPromise(function(_0x31e5cf,_0x29ae19){_0x5a31a7(_0x491f24,_0x3b0954)[_0x6090('0x23')](function(_0x177cd4){_0x3b0954[_0x6090('0x21')]=_0x177cd4[_0x6090('0x24')];_0x4b40e7[_0x6090('0x28')]['findOne']({'where':{'phone':_0x3b0954[_0x6090('0xc')],'VoiceQueueId':_0x491f24['id']}})['then'](function(_0xce576a){if(!_[_0x6090('0x1d')](_0xce576a)){throw new Error('cmContact,\x20afterCreate\x20'+_0x3b0954[_0x6090('0xc')]+_0x6090('0x2c')+_0x491f24['id']);}return _0x4b40e7[_0x6090('0x2d')][_0x6090('0x25')]({'where':{'calleridnum':_0x3b0954[_0x6090('0xc')],'VoiceQueueId':_0x491f24['id']}});})[_0x6090('0x23')](function(_0x370d06){if(!_[_0x6090('0x1d')](_0x370d06)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x3b0954['phone']+_0x6090('0x2e')+_0x491f24['id']);}return _0x4b40e7[_0x6090('0x28')]['create']({'phone':_0x3b0954[_0x6090('0xc')],'ContactId':_0x3b0954['id'],'ListId':_0x3b0954[_0x6090('0x2a')],'priority':_0x3b0954[_0x6090('0x2f')]?_0x3b0954[_0x6090('0x2f')]:0x2,'scheduledat':_0x3b0954['scheduledat']?_0x3b0954['scheduledat']:moment()[_0x6090('0x1b')](_0x6090('0x1c')),'callback':_0x3b0954['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x3b0954[_0x6090('0x2b')]?_0x3b0954[_0x6090('0x2b')]:undefined,'callbackat':_0x3b0954[_0x6090('0x2b')]?moment()[_0x6090('0x1b')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x491f24['id']});})[_0x6090('0x30')](function(_0x304d48){_0x29ae19(_0x304d48);});});});};function _0x4e03bb(){return function(_0x450bcb){logger[_0x6090('0x17')](_0x6090('0x18'),_0x6090('0x19'),util[_0x6090('0x1a')](_0x450bcb,{'showHidden':![],'depth':null}));};}function _0x171e8e(_0x413f96,_0x6e15dd){var _0x2269c0=_0x6e15dd['scheduledat']?_0x6e15dd['scheduledat']:moment()[_0x6090('0x1b')](_0x6090('0x1c'));return new BPromise(function(_0x5ab296,_0x58b800){if(_[_0x6090('0x1d')](_0x6e15dd['dialTimezone'])){_0x5ab296({'ret':_0x2269c0});}else{_0x4b40e7[_0x6090('0x31')][_0x6090('0x25')]({'where':{'id':_0x413f96['id']}})[_0x6090('0x23')](function(_0x5e6a46){if(!_['isNil'](_0x5e6a46)){var _0x49fb61=_0x5e6a46[_0x6090('0x1e')];if(!_['isNil'](_0x49fb61)){var _0x4fc9ed=shared[_0x6090('0x20')];var _0x25ea13=_0x4fc9ed[_0x49fb61];var _0x22bed7=_0x4fc9ed[_0x6e15dd[_0x6090('0x1e')]];if(!_[_0x6090('0x1d')](_0x25ea13)&&!_[_0x6090('0x1d')](_0x22bed7)){var _0x457222=_0x25ea13[_0x6090('0x32')]-_0x22bed7[_0x6090('0x32')];_0x2269c0=_0x6e15dd[_0x6090('0x21')]?_0x6e15dd[_0x6090('0x21')]:moment();var _0x18982a=moment(_0x2269c0)[_0x6090('0x22')](_0x457222,_0x6090('0x33'));_0x5ab296({'ret':_0x18982a['format'](_0x6090('0x1c'))});}else _0x5ab296({'ret':_0x2269c0});}else _0x5ab296({'ret':_0x2269c0});}else{_0x5ab296({'ret':_0x2269c0});}});}});return 0xa;}var _0xa1749a=function(_0x5789e9){return new BPromise(function(_0x398380,_0x32a8ff){_0x171e8e(_0x5789e9,_0x3b0954)[_0x6090('0x23')](function(_0x4b7e4d){_0x3b0954[_0x6090('0x21')]=_0x4b7e4d[_0x6090('0x24')];_0x4b40e7[_0x6090('0x28')][_0x6090('0x25')]({'where':{'phone':_0x3b0954[_0x6090('0xc')],'CampaignId':_0x5789e9['id']}})[_0x6090('0x23')](function(_0x25dccf){if(!_[_0x6090('0x1d')](_0x25dccf)){throw new Error('cmContact,\x20afterCreate\x20'+_0x3b0954[_0x6090('0xc')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x5789e9['id']);}return _0x4b40e7[_0x6090('0x28')][_0x6090('0x29')]({'phone':_0x3b0954[_0x6090('0xc')],'ContactId':_0x3b0954['id'],'ListId':_0x3b0954[_0x6090('0x2a')],'priority':_0x3b0954[_0x6090('0x2f')]?_0x3b0954[_0x6090('0x2f')]:0x2,'scheduledat':_0x3b0954['scheduledat']?_0x3b0954[_0x6090('0x21')]:moment()[_0x6090('0x1b')](_0x6090('0x1c')),'callback':_0x3b0954[_0x6090('0x2b')]?!![]:![],'callbackuniqueid':_0x3b0954[_0x6090('0x2b')]?_0x3b0954[_0x6090('0x2b')]:undefined,'callbackat':_0x3b0954['callbackUniqueid']?moment()[_0x6090('0x1b')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x5789e9['id']});})[_0x6090('0x30')](function(_0x5129f0){_0x32a8ff(_0x5129f0);});});});};var _0x100dbe=function(_0x489d41){return new BPromise(function(_0x268efd,_0x195afd){_0x171e8e(_0x489d41,_0x3b0954)[_0x6090('0x23')](function(_0x19f46e){_0x3b0954[_0x6090('0x21')]=_0x19f46e['ret'];_0x4b40e7['CmHopper']['findOne']({'where':{'phone':_0x3b0954[_0x6090('0xc')],'CampaignId':_0x489d41['id']}})['then'](function(_0x57b5e9){if(!_[_0x6090('0x1d')](_0x57b5e9)){throw new Error(_0x6090('0x26')+_0x3b0954['phone']+_0x6090('0x34')+_0x489d41['id']);}return _0x4b40e7['CmHopperFinal'][_0x6090('0x25')]({'where':{'calleridnum':_0x3b0954[_0x6090('0xc')],'CampaignId':_0x489d41['id']}});})[_0x6090('0x23')](function(_0x469d16){if(!_[_0x6090('0x1d')](_0x469d16)){throw new Error(_0x6090('0x35')+_0x3b0954[_0x6090('0xc')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20'+_0x489d41['id']);}return _0x4b40e7['CmHopper'][_0x6090('0x29')]({'phone':_0x3b0954[_0x6090('0xc')],'ContactId':_0x3b0954['id'],'ListId':_0x3b0954[_0x6090('0x2a')],'priority':_0x3b0954[_0x6090('0x2f')]?_0x3b0954[_0x6090('0x2f')]:0x2,'scheduledat':_0x3b0954['scheduledat']?_0x3b0954[_0x6090('0x21')]:moment()[_0x6090('0x1b')](_0x6090('0x1c')),'callback':_0x3b0954[_0x6090('0x2b')]?!![]:![],'callbackuniqueid':_0x3b0954[_0x6090('0x2b')]?_0x3b0954[_0x6090('0x2b')]:undefined,'callbackat':_0x3b0954[_0x6090('0x2b')]?moment()[_0x6090('0x1b')](_0x6090('0x1c')):undefined,'CampaignId':_0x489d41['id']});})['catch'](function(_0x2f54e9){_0x195afd(_0x2f54e9);});});});};if(_0x3b0954[_0x6090('0x2a')]){_0x4b40e7[_0x6090('0x1f')][_0x6090('0x36')]({'where':{'type':_0x6090('0x37')},'attributes':['id','dialCheckDuplicateType',_0x6090('0x1e')],'include':[{'model':_0x4b40e7[_0x6090('0x38')],'as':'Lists','where':{'id':_0x3b0954['ListId']}}]})[_0x6090('0x23')](function(_0x3265e3){if(_0x3265e3){var _0x367df9=[];for(var _0x5da3b9=0x0,_0xc6de52;_0x5da3b9<_0x3265e3[_0x6090('0x39')];_0x5da3b9+=0x1){_0xc6de52=_0x3265e3[_0x5da3b9]['get']({'plain':!![]});switch(_0xc6de52[_0x6090('0x3a')]){case _0x6090('0x3b'):_0x4cd64e(_0xc6de52)[_0x6090('0x30')](_0x33e96d());break;case _0x6090('0x3c'):_0x455db0(_0xc6de52)['catch'](_0x33e96d());break;default:_0x171e8e(_0xc6de52,_0x3b0954)['then'](function(_0x4d391c){_0x3b0954[_0x6090('0x21')]=_0x4d391c['ret'];_0x4b40e7[_0x6090('0x28')][_0x6090('0x29')]({'phone':_0x3b0954[_0x6090('0xc')],'ContactId':_0x3b0954['id'],'ListId':_0x3b0954[_0x6090('0x2a')],'scheduledat':_0x3b0954[_0x6090('0x21')]?_0x3b0954[_0x6090('0x21')]:moment()[_0x6090('0x1b')](_0x6090('0x1c')),'priority':_0x3b0954[_0x6090('0x2f')]?_0x3b0954[_0x6090('0x2f')]:0x2,'callback':_0x3b0954['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x3b0954[_0x6090('0x2b')]?_0x3b0954[_0x6090('0x2b')]:undefined,'callbackat':_0x3b0954['callbackUniqueid']?moment()[_0x6090('0x1b')](_0x6090('0x1c')):undefined,'VoiceQueueId':_0xc6de52['id']})[_0x6090('0x30')](_0x33e96d());});}}}})[_0x6090('0x23')](function(){return _0x4b40e7[_0x6090('0x1f')][_0x6090('0x36')]({'where':{'type':_0x6090('0x37')},'attributes':['id'],'include':[{'model':_0x4b40e7[_0x6090('0x38')],'as':'BlackLists','where':{'id':_0x3b0954[_0x6090('0x2a')]}}]})[_0x6090('0x23')](function(_0x346cb4){if(_0x346cb4){var _0x587e35=[];for(var _0x8c67eb=0x0,_0x22fc7d;_0x8c67eb<_0x346cb4['length'];_0x8c67eb+=0x1){_0x22fc7d=_0x346cb4[_0x8c67eb][_0x6090('0x16')]({'plain':!![]});_0x4b40e7['CmHopperBlack'][_0x6090('0x29')]({'phone':_0x3b0954[_0x6090('0xc')],'ContactId':_0x3b0954['id'],'ListId':_0x3b0954[_0x6090('0x2a')],'VoiceQueueId':_0x22fc7d['id']})[_0x6090('0x30')](function(_0x1e685d){logger[_0x6090('0x17')](_0x6090('0x3d'),_0x6090('0x19'),_0x1e685d[_0x6090('0x3e')]);});}}});})[_0x6090('0x23')](function(){return _0x4b40e7[_0x6090('0x31')][_0x6090('0x36')]({'attributes':['id',_0x6090('0x3a'),_0x6090('0x1e')],'include':[{'model':_0x4b40e7['CmList'],'as':'Lists','where':{'id':_0x3b0954[_0x6090('0x2a')]}}]})[_0x6090('0x23')](function(_0x364a2e){if(_0x364a2e){var _0x2e0653=[];for(var _0x22602e=0x0,_0x5659fa;_0x22602e<_0x364a2e[_0x6090('0x39')];_0x22602e+=0x1){_0x5659fa=_0x364a2e[_0x22602e]['get']({'plain':!![]});switch(_0x5659fa['dialCheckDuplicateType']){case'always':_0x100dbe(_0x5659fa)[_0x6090('0x30')](_0x4e03bb());break;case'onlyIfOpen':_0xa1749a(_0x5659fa)[_0x6090('0x30')](_0x4e03bb());break;default:_0x4b40e7[_0x6090('0x28')][_0x6090('0x29')]({'phone':_0x3b0954[_0x6090('0xc')],'ContactId':_0x3b0954['id'],'ListId':_0x3b0954[_0x6090('0x2a')],'scheduledat':_0x3b0954['scheduledat']?_0x3b0954['scheduledat']:moment()[_0x6090('0x1b')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x3b0954[_0x6090('0x2f')]?_0x3b0954[_0x6090('0x2f')]:0x2,'callback':_0x3b0954[_0x6090('0x2b')]?!![]:![],'callbackuniqueid':_0x3b0954[_0x6090('0x2b')]?_0x3b0954[_0x6090('0x2b')]:undefined,'callbackat':_0x3b0954[_0x6090('0x2b')]?moment()['format'](_0x6090('0x1c')):undefined,'CampaignId':_0x5659fa['id']})[_0x6090('0x30')](_0x4e03bb());}}}});})['then'](function(){return _0x4b40e7[_0x6090('0x31')][_0x6090('0x36')]({'attributes':['id'],'include':[{'model':_0x4b40e7[_0x6090('0x38')],'as':_0x6090('0x3f'),'where':{'id':_0x3b0954[_0x6090('0x2a')]}}]})['then'](function(_0x41d7fa){if(_0x41d7fa){var _0x57ee7d=[];for(var _0x1b8775=0x0,_0x2a43ff;_0x1b8775<_0x41d7fa[_0x6090('0x39')];_0x1b8775+=0x1){_0x2a43ff=_0x41d7fa[_0x1b8775][_0x6090('0x16')]({'plain':!![]});_0x4b40e7['CmHopperBlack'][_0x6090('0x29')]({'phone':_0x3b0954[_0x6090('0xc')],'ContactId':_0x3b0954['id'],'ListId':_0x3b0954[_0x6090('0x2a')],'CampaignId':_0x2a43ff['id']})[_0x6090('0x30')](function(_0x13721b){logger[_0x6090('0x17')]('cmContact,\x20%s,\x20%s',_0x6090('0x19'),_0x13721b[_0x6090('0x3e')]);});}}});})[_0x6090('0x23')](function(){_0x913949();})[_0x6090('0x30')](function(_0x40b51f){logger['error'](_0x6090('0x3d'),_0x6090('0x19'),_0x40b51f[_0x6090('0x3e')]);_0x913949(_0x40b51f);});}else{_0x913949(new Error(_0x6090('0x40')));}},'afterDestroy':function(_0x14f9d8,_0x2418b4,_0x1dcda8){var _0x32ca20=_0x2688db['models'];var _0x2b7a83=_0x14f9d8[_0x6090('0x16')]({'plain':!![]});return _0x32ca20[_0x6090('0x28')][_0x6090('0x36')]({'raw':!![],'where':{'ListId':_0x2b7a83['ListId'],'ContactId':_0x2b7a83['id']}})['then'](function(_0x4423ba){if(!_[_0x6090('0x41')](_0x4423ba)){var _0x4fdad8=[];for(var _0x69e1df=0x0;_0x69e1df<_0x4423ba[_0x6090('0x39')];_0x69e1df+=0x1){var _0x4c2bab=_0x32ca20[_0x6090('0x28')][_0x6090('0x42')]({'where':{'ListId':_0x4423ba[_0x69e1df][_0x6090('0x2a')],'ContactId':_0x4423ba[_0x69e1df][_0x6090('0x43')],'VoiceQueueId':_0x4423ba[_0x69e1df]['VoiceQueueId'],'CampaignId':_0x4423ba[_0x69e1df]['CampaignId']}});_0x4fdad8['push'](_0x4c2bab);}return BPromise[_0x6090('0x44')](_0x4fdad8);}})['then'](function(_0x450caf){logger['info'](_0x6090('0x45'),util[_0x6090('0x1a')](_0x450caf,{'showHidden':![],'depth':null}));_0x1dcda8();})[_0x6090('0x30')](function(_0x33069d){logger[_0x6090('0x17')](_0x6090('0x46'),util[_0x6090('0x1a')](_0x33069d,{'showHidden':![],'depth':null}));_0x1dcda8(_0x33069d);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index 7bb46f0..d51e689 100644 --- a/server/api/cmContact/cmContact.rpc.js +++ b/server/api/cmContact/cmContact.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['include','model','length','CmContactHasItem','find','ListId','Contact','isNil','CmContactId','CmContact','catch','CreateCmContact','create','body','keys','startsWith','cf_','table','cm_contacts','set','where','id\x20=\x20?','toString','sequelize','query','lodash','util','moment','bluebird','ioredis','squel','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./cmContact.socket','register','request','then','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','GetCmContact','findAll','options','raw','attributes','limit','map'];(function(_0x6005a5,_0x43dc7b){var _0x37a565=function(_0x6b1bb6){while(--_0x6b1bb6){_0x6005a5['push'](_0x6005a5['shift']());}};_0x37a565(++_0x43dc7b);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var squel=require(_0x7995('0x5'));var db=require(_0x7995('0x6'))['db'];var utils=require(_0x7995('0x7'));var logger=require('../../config/logger')(_0x7995('0x8'));var config=require(_0x7995('0x9'));var jayson=require(_0x7995('0xa'));var client=jayson[_0x7995('0xb')][_0x7995('0xc')]({'port':0x232a});config[_0x7995('0xd')]=_['defaults'](config[_0x7995('0xd')],{'host':_0x7995('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7995('0xd')]));require(_0x7995('0xf'))[_0x7995('0x10')](socket);function respondWithRpcPromise(_0x35b5fe,_0x3c1d19,_0x1e400a){return new BPromise(function(_0x341672,_0x524f7b){return client[_0x7995('0x11')](_0x35b5fe,_0x1e400a)[_0x7995('0x12')](function(_0x581f22){logger[_0x7995('0x13')](_0x7995('0x14'),_0x3c1d19,_0x7995('0x15'));logger[_0x7995('0x16')](_0x7995('0x17'),_0x3c1d19,_0x7995('0x15'),JSON[_0x7995('0x18')](_0x581f22));if(_0x581f22['error']){if(_0x581f22['error'][_0x7995('0x19')]===0x1f4){logger[_0x7995('0x1a')](_0x7995('0x14'),_0x3c1d19,_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);return _0x524f7b(_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);}logger[_0x7995('0x1a')]('CmContact,\x20%s,\x20%s',_0x3c1d19,_0x581f22[_0x7995('0x1a')]['message']);return _0x341672(_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);}else{logger[_0x7995('0x13')](_0x7995('0x14'),_0x3c1d19,_0x7995('0x15'));_0x341672(_0x581f22[_0x7995('0x1c')]['message']);}})['catch'](function(_0x2536c8){logger['error']('CmContact,\x20%s,\x20%s',_0x3c1d19,_0x2536c8);_0x524f7b(_0x2536c8);});});}exports[_0x7995('0x1d')]=function(_0x3d463e){var _0x4cbe10=this;return new Promise(function(_0x3a9b54,_0x51f276){return db['CmContact'][_0x7995('0x1e')]({'raw':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x20')]===undefined?!![]:![]:!![],'where':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')]['where']||null:null,'attributes':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x21')]||null:null,'limit':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x22')]||null:null,'include':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')]['include']?_[_0x7995('0x23')](_0x3d463e[_0x7995('0x1f')][_0x7995('0x24')],function(_0x268ce7){return{'model':db[_0x268ce7[_0x7995('0x25')]],'as':_0x268ce7['as'],'attributes':_0x268ce7[_0x7995('0x21')],'include':_0x268ce7['include']?_[_0x7995('0x23')](_0x268ce7['include'],function(_0x229742){return{'model':db[_0x229742[_0x7995('0x25')]],'as':_0x229742['as'],'attributes':_0x229742[_0x7995('0x21')],'include':_0x229742[_0x7995('0x24')]?_[_0x7995('0x23')](_0x229742['include'],function(_0x9b2a15){return{'model':db[_0x9b2a15['model']],'as':_0x9b2a15['as'],'attributes':_0x9b2a15[_0x7995('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7995('0x12')](function(_0x4253e5){logger['info']('GetCmContact',_0x3d463e);logger['debug'](_0x7995('0x1d'),_0x3d463e,JSON[_0x7995('0x18')](_0x4253e5));if(_0x4253e5[_0x7995('0x26')]==0x0){return db[_0x7995('0x27')][_0x7995('0x28')]({'raw':!![],'where':{'item':_0x3d463e[_0x7995('0x1f')]['phone']},'include':[{'model':db['CmContact'],'where':{'ListId':_0x3d463e[_0x7995('0x1f')]['where'][_0x7995('0x29')],'deletedAt':{'$eq':null}},'as':_0x7995('0x2a')}]})[_0x7995('0x12')](function(_0x1e9fa4){if(_[_0x7995('0x2b')](_0x1e9fa4)){_0x3a9b54(_0x4253e5);}else{var _0x510841=_0x1e9fa4[_0x7995('0x2c')];return db[_0x7995('0x2d')]['findAll']({'raw':!![],'where':{'id':_0x510841},'attributes':_0x3d463e['options']?_0x3d463e['options'][_0x7995('0x21')]||null:null})[_0x7995('0x12')](function(_0x4a176f){_0x3a9b54(_0x4a176f);});}});}else{_0x3a9b54(_0x4253e5);}})[_0x7995('0x2e')](function(_0x51b95d){logger[_0x7995('0x1a')](_0x7995('0x1d'),_0x51b95d[_0x7995('0x1b')],_0x3d463e);_0x51f276(_0x4cbe10['error'](0x1f4,_0x51b95d['message']));});});};exports[_0x7995('0x2f')]=function(_0x5e67fe){var _0x5d2428=this;return new Promise(function(_0x3e99cd,_0xe328b1){return db['CmContact'][_0x7995('0x30')](_0x5e67fe[_0x7995('0x31')],{'raw':_0x5e67fe[_0x7995('0x1f')]?_0x5e67fe[_0x7995('0x1f')][_0x7995('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x2d4285){var _0x242713;for(var _0xf612e6=0x0;_0xf612e6{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router; \ No newline at end of file +var _0xa9e0=['basename','extname','now','/csv','single','file','uploadCsv','%s-%s%s','upload','/upload/:id','import','put','/:id','update','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','index','/describe','show','/:id/tags','isAuthenticated','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','post','create','/create_many','bulkCreate','setTags','setAdditionalPhones','/:id/duplicateAdditionalPhones','/:id/rescheduleAdditionalPhones','rescheduleAdditionalPhones','join','root','server/files/tmp','originalname','replace','format'];(function(_0x505a44,_0x3812cc){var _0x336459=function(_0x9ad2b0){while(--_0x9ad2b0){_0x505a44['push'](_0x505a44['shift']());}};_0x336459(++_0x3812cc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/phones',auth['isAuthenticated'](),controller['getAdditionalPhones']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getHopperHistories']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x18')]('/merge',auth[_0x0a9e('0xd')](),controller['merge']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/phones',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x1e'),auth['isAuthenticated'](),controller['duplicateAdditionalPhones']);router[_0x0a9e('0x18')](_0x0a9e('0x1f'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xfb6e48,_0x2fb0e4,_0x3b45bc){_0x3b45bc(null,path[_0x0a9e('0x21')](config[_0x0a9e('0x22')],_0x0a9e('0x23')));},'filename':function(_0x16b1ca,_0x5ea472,_0x59181e){_0x5ea472[_0x0a9e('0x24')]=_0x5ea472[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.attributes.js b/server/api/cmContactHasItem/cmContactHasItem.attributes.js index 51cb396..2ed8c6a 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 _0x757f=['STRING','PHONE','sequelize','INTEGER'];(function(_0x339129,_0x86dcc6){var _0x1570df=function(_0x3b537e){while(--_0x3b537e){_0x339129['push'](_0x339129['shift']());}};_0x1570df(++_0x86dcc6);}(_0x757f,0xee));var _0xf757=function(_0x575a38,_0x2e83d7){_0x575a38=_0x575a38-0x0;var _0x5a7bdd=_0x757f[_0x575a38];return _0x5a7bdd;};'use strict';var Sequelize=require(_0xf757('0x0'));module['exports']={'CmContactId':{'type':Sequelize[_0xf757('0x1')],'primaryKey':!![]},'item':{'type':Sequelize[_0xf757('0x2')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0xf757('0x1')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0xf757('0x2')],'defaultValue':_0xf757('0x3')},'OrderBy':{'type':Sequelize[_0xf757('0x1')],'defaultValue':null},'description':{'type':Sequelize[_0xf757('0x2')],'defaultValue':null}}; \ No newline at end of file +var _0xe148=['STRING','INTEGER','PHONE','sequelize','exports'];(function(_0x3611c4,_0x4ac980){var _0x3a39f3=function(_0x8d6e41){while(--_0x8d6e41){_0x3611c4['push'](_0x3611c4['shift']());}};_0x3a39f3(++_0x4ac980);}(_0xe148,0x9e));var _0x8e14=function(_0x3b3933,_0x4a5bd2){_0x3b3933=_0x3b3933-0x0;var _0x41d2c4=_0xe148[_0x3b3933];return _0x41d2c4;};'use strict';var Sequelize=require(_0x8e14('0x0'));module[_0x8e14('0x1')]={'CmContactId':{'type':Sequelize['INTEGER'],'primaryKey':!![]},'item':{'type':Sequelize[_0x8e14('0x2')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x8e14('0x3')],'defaultValue':null},'ItemClass':{'type':Sequelize['STRING'],'defaultValue':_0x8e14('0x4')},'OrderBy':{'type':Sequelize[_0x8e14('0x3')],'defaultValue':null},'description':{'type':Sequelize[_0x8e14('0x2')],'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 91ad293..7e694b9 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 _0x16d2=['zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','CmContactHasItems','UserProfileResource','error','stack','send','map','CmContactHasItem','fieldName','type','model','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','keys','rawAttributes','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf'];(function(_0x46f2e1,_0x4c08cf){var _0x40a7f5=function(_0x4e0fef){while(--_0x4e0fef){_0x46f2e1['push'](_0x46f2e1['shift']());}};_0x40a7f5(++_0x4c08cf);}(_0x16d2,0xa6));var _0x216d=function(_0x2971a6,_0x156540){_0x2971a6=_0x2971a6-0x0;var _0x2093e7=_0x16d2[_0x2971a6];return _0x2093e7;};'use strict';var emlformat=require(_0x216d('0x0'));var rimraf=require(_0x216d('0x1'));var zipdir=require(_0x216d('0x2'));var jsonpatch=require(_0x216d('0x3'));var rp=require('request-promise');var moment=require(_0x216d('0x4'));var BPromise=require(_0x216d('0x5'));var Mustache=require(_0x216d('0x6'));var util=require('util');var path=require(_0x216d('0x7'));var sox=require(_0x216d('0x8'));var csv=require('to-csv');var ejs=require(_0x216d('0x9'));var fs=require('fs');var fs_extra=require(_0x216d('0xa'));var _=require(_0x216d('0xb'));var squel=require(_0x216d('0xc'));var crypto=require(_0x216d('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x216d('0xe'));var toCsv=require(_0x216d('0xf'));var querystring=require(_0x216d('0x10'));var Papa=require('papaparse');var Redis=require(_0x216d('0x11'));var authService=require(_0x216d('0x12'));var qs=require(_0x216d('0x13'));var as=require(_0x216d('0x14'));var hardwareService=require(_0x216d('0x15'));var logger=require(_0x216d('0x16'))(_0x216d('0x17'));var utils=require('../../config/utils');var config=require(_0x216d('0x18'));var licenseUtil=require(_0x216d('0x19'));var db=require(_0x216d('0x1a'))['db'];function respondWithStatusCode(_0x4d4455,_0x35d5f3){_0x35d5f3=_0x35d5f3||0xcc;return function(_0x5ee9af){if(_0x5ee9af){return _0x4d4455[_0x216d('0x1b')](_0x35d5f3);}return _0x4d4455[_0x216d('0x1c')](_0x35d5f3)[_0x216d('0x1d')]();};}function respondWithResult(_0x5ce1b9,_0x186f83){_0x186f83=_0x186f83||0xc8;return function(_0x1d26d6){if(_0x1d26d6){return _0x5ce1b9['status'](_0x186f83)[_0x216d('0x1e')](_0x1d26d6);}};}function respondWithFilteredResult(_0x45dc9a,_0x2816af){return function(_0x57d253){if(_0x57d253){var _0x10feac=typeof _0x2816af[_0x216d('0x1f')]===_0x216d('0x20')&&typeof _0x2816af[_0x216d('0x21')]==='undefined';var _0x51f6c7=_0x57d253[_0x216d('0x22')];var _0x586231=_0x10feac?0x0:_0x2816af[_0x216d('0x1f')];var _0x2394bd=_0x10feac?_0x57d253['count']:_0x2816af['offset']+_0x2816af[_0x216d('0x21')];var _0x5cbb6e;if(_0x2394bd>=_0x51f6c7){_0x2394bd=_0x51f6c7;_0x5cbb6e=0xc8;}else{_0x5cbb6e=0xce;}_0x45dc9a['status'](_0x5cbb6e);return _0x45dc9a[_0x216d('0x23')](_0x216d('0x24'),_0x586231+'-'+_0x2394bd+'/'+_0x51f6c7)[_0x216d('0x1e')](_0x57d253);}return null;};}function patchUpdates(_0x2737ed){return function(_0x49e5be){try{jsonpatch[_0x216d('0x25')](_0x49e5be,_0x2737ed,!![]);}catch(_0x38f1e9){return BPromise[_0x216d('0x26')](_0x38f1e9);}return _0x49e5be[_0x216d('0x27')]();};}function saveUpdates(_0x24b1ba,_0xd88ede){return function(_0x45ed30){if(_0x45ed30){return _0x45ed30['update'](_0x24b1ba)[_0x216d('0x28')](function(_0x95dad2){return _0x95dad2;});}return null;};}function removeEntity(_0x36b7a5,_0x35aa28){return function(_0x2fa975){if(_0x2fa975){return _0x2fa975[_0x216d('0x29')]()[_0x216d('0x28')](function(){var _0x4cdf23=_0x2fa975[_0x216d('0x2a')]({'plain':!![]});var _0x54e37d=_0x216d('0x2b');return db[_0x216d('0x2c')][_0x216d('0x29')]({'where':{'type':_0x54e37d,'resourceId':_0x4cdf23['id']}})[_0x216d('0x28')](function(){return _0x2fa975;});})[_0x216d('0x28')](function(){_0x36b7a5[_0x216d('0x1c')](0xcc)[_0x216d('0x1d')]();});}};}function handleEntityNotFound(_0xe3d6ca,_0x566858){return function(_0x3f718a){if(!_0x3f718a){_0xe3d6ca[_0x216d('0x1b')](0x194);}return _0x3f718a;};}function handleError(_0x3db05f,_0x5f5840){_0x5f5840=_0x5f5840||0x1f4;return function(_0x3ee94e){logger[_0x216d('0x2d')](_0x3ee94e[_0x216d('0x2e')]);if(_0x3ee94e['name']){delete _0x3ee94e['name'];}_0x3db05f[_0x216d('0x1c')](_0x5f5840)[_0x216d('0x2f')](_0x3ee94e);};}exports['index']=function(_0x391f52,_0x5c6d70){var _0x51643a={},_0x1b4e82={},_0x1f4469={'count':0x0,'rows':[]};var _0x4737ef=_[_0x216d('0x30')](db[_0x216d('0x31')]['rawAttributes'],function(_0xc85b3b){return{'name':_0xc85b3b[_0x216d('0x32')],'type':_0xc85b3b[_0x216d('0x33')]['key']};});_0x1b4e82[_0x216d('0x34')]=_['map'](_0x4737ef,_0x216d('0x35'));_0x1b4e82[_0x216d('0x36')]=_['keys'](_0x391f52[_0x216d('0x36')]);_0x1b4e82[_0x216d('0x37')]=_[_0x216d('0x38')](_0x1b4e82[_0x216d('0x34')],_0x1b4e82['query']);_0x51643a[_0x216d('0x39')]=_[_0x216d('0x38')](_0x1b4e82[_0x216d('0x34')],qs[_0x216d('0x3a')](_0x391f52['query'][_0x216d('0x3a')]));_0x51643a[_0x216d('0x39')]=_0x51643a[_0x216d('0x39')][_0x216d('0x3b')]?_0x51643a[_0x216d('0x39')]:_0x1b4e82[_0x216d('0x34')];if(!_0x391f52['query'][_0x216d('0x3c')](_0x216d('0x3d'))){_0x51643a[_0x216d('0x21')]=qs[_0x216d('0x21')](_0x391f52[_0x216d('0x36')][_0x216d('0x21')]);_0x51643a[_0x216d('0x1f')]=qs[_0x216d('0x1f')](_0x391f52['query'][_0x216d('0x1f')]);}_0x51643a[_0x216d('0x3e')]=qs[_0x216d('0x3f')](_0x391f52['query']['sort']);_0x51643a[_0x216d('0x40')]=qs['filters'](_[_0x216d('0x41')](_0x391f52[_0x216d('0x36')],_0x1b4e82[_0x216d('0x37')]),_0x4737ef);if(_0x391f52['query'][_0x216d('0x42')]){_0x51643a[_0x216d('0x40')]=_[_0x216d('0x43')](_0x51643a[_0x216d('0x40')],{'$or':_[_0x216d('0x30')](_0x4737ef,function(_0x3ebc12){if(_0x3ebc12[_0x216d('0x33')]!=='VIRTUAL'){var _0x44ee0f={};_0x44ee0f[_0x3ebc12[_0x216d('0x35')]]={'$like':'%'+_0x391f52[_0x216d('0x36')][_0x216d('0x42')]+'%'};return _0x44ee0f;}})});}_0x51643a=_[_0x216d('0x43')]({},_0x51643a,_0x391f52[_0x216d('0x44')]);var _0x675efe={'where':_0x51643a[_0x216d('0x40')]};return db[_0x216d('0x31')][_0x216d('0x22')](_0x675efe)[_0x216d('0x28')](function(_0x49377b){_0x1f4469[_0x216d('0x22')]=_0x49377b;if(_0x391f52['query'][_0x216d('0x45')]){_0x51643a[_0x216d('0x46')]=[{'all':!![]}];}return db[_0x216d('0x31')]['findAll'](_0x51643a);})[_0x216d('0x28')](function(_0x1eec00){_0x1f4469[_0x216d('0x47')]=_0x1eec00;return _0x1f4469;})[_0x216d('0x28')](respondWithFilteredResult(_0x5c6d70,_0x51643a))[_0x216d('0x48')](handleError(_0x5c6d70,null));};exports[_0x216d('0x49')]=function(_0x4685ac,_0x554397){var _0x5d2a76={'raw':!![],'where':{'id':_0x4685ac['params']['id']}},_0x1d3096={};_0x1d3096['model']=_[_0x216d('0x4a')](db[_0x216d('0x31')][_0x216d('0x4b')]);_0x1d3096['query']=_[_0x216d('0x4a')](_0x4685ac[_0x216d('0x36')]);_0x1d3096[_0x216d('0x37')]=_[_0x216d('0x38')](_0x1d3096[_0x216d('0x34')],_0x1d3096[_0x216d('0x36')]);_0x5d2a76['attributes']=_[_0x216d('0x38')](_0x1d3096[_0x216d('0x34')],qs['fields'](_0x4685ac[_0x216d('0x36')][_0x216d('0x3a')]));_0x5d2a76[_0x216d('0x39')]=_0x5d2a76[_0x216d('0x39')][_0x216d('0x3b')]?_0x5d2a76[_0x216d('0x39')]:_0x1d3096[_0x216d('0x34')];if(_0x4685ac['query'][_0x216d('0x45')]){_0x5d2a76[_0x216d('0x46')]=[{'all':!![]}];}_0x5d2a76=_[_0x216d('0x43')]({},_0x5d2a76,_0x4685ac[_0x216d('0x44')]);return db[_0x216d('0x31')][_0x216d('0x4c')](_0x5d2a76)['then'](handleEntityNotFound(_0x554397,null))[_0x216d('0x28')](respondWithResult(_0x554397,null))['catch'](handleError(_0x554397,null));};exports['create']=function(_0x589ea3,_0xde84c9){return db[_0x216d('0x31')]['create'](_0x589ea3[_0x216d('0x4d')],{})['then'](function(_0x5a8605){var _0x4b65c6=_0x589ea3[_0x216d('0x4e')][_0x216d('0x2a')]({'plain':!![]});if(!_0x4b65c6)throw new Error(_0x216d('0x4f'));if(_0x4b65c6[_0x216d('0x50')]===_0x216d('0x4e')){var _0x56a7ec=_0x5a8605[_0x216d('0x2a')]({'plain':!![]});var _0x4f5af5=_0x216d('0x2b');return db[_0x216d('0x51')][_0x216d('0x4c')]({'where':{'name':_0x4f5af5,'userProfileId':_0x4b65c6['userProfileId']},'raw':!![]})[_0x216d('0x28')](function(_0x19d7a6){if(_0x19d7a6&&_0x19d7a6['autoAssociation']===0x0){return db[_0x216d('0x2c')]['create']({'name':_0x56a7ec['name'],'resourceId':_0x56a7ec['id'],'type':_0x19d7a6[_0x216d('0x35')],'sectionId':_0x19d7a6['id']},{})[_0x216d('0x28')](function(){return _0x5a8605;});}else{return _0x5a8605;}})[_0x216d('0x48')](function(_0x2abbdc){logger[_0x216d('0x2d')](_0x216d('0x52'),_0x2abbdc);throw _0x2abbdc;});}return _0x5a8605;})['then'](respondWithResult(_0xde84c9,0xc9))[_0x216d('0x48')](handleError(_0xde84c9,null));};exports['update']=function(_0x39d742,_0x39e960){if(_0x39d742[_0x216d('0x4d')]['id']){delete _0x39d742[_0x216d('0x4d')]['id'];}return db['CmContactHasItem']['find']({'where':{'id':_0x39d742[_0x216d('0x53')]['id']}})['then'](handleEntityNotFound(_0x39e960,null))['then'](saveUpdates(_0x39d742['body'],null))[_0x216d('0x28')](respondWithResult(_0x39e960,null))[_0x216d('0x48')](handleError(_0x39e960,null));};exports['destroy']=function(_0xd97eec,_0x1675ca){return db[_0x216d('0x31')][_0x216d('0x4c')]({'where':{'id':_0xd97eec[_0x216d('0x53')]['id']}})[_0x216d('0x28')](handleEntityNotFound(_0x1675ca,null))[_0x216d('0x28')](removeEntity(_0x1675ca,null))[_0x216d('0x48')](handleError(_0x1675ca,null));}; \ No newline at end of file +var _0x0a9e=['rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','sort','filter','where','merge','VIRTUAL','options','CmContactHasItem','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CmContactHasItems','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','get','UserProfileResource','stack','name','send','index','map'];(function(_0x95a08c,_0x5a96b5){var _0x551d4a=function(_0x5d93ee){while(--_0x5d93ee){_0x95a08c['push'](_0x95a08c['shift']());}};_0x551d4a(++_0x5a96b5);}(_0x0a9e,0x124));var _0xe0a9=function(_0x520934,_0xbb1318){_0x520934=_0x520934-0x0;var _0x4ab161=_0x0a9e[_0x520934];return _0x4ab161;};'use strict';var emlformat=require(_0xe0a9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0a9('0x1'));var jsonpatch=require(_0xe0a9('0x2'));var rp=require('request-promise');var moment=require(_0xe0a9('0x3'));var BPromise=require(_0xe0a9('0x4'));var Mustache=require(_0xe0a9('0x5'));var util=require(_0xe0a9('0x6'));var path=require(_0xe0a9('0x7'));var sox=require('sox');var csv=require(_0xe0a9('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe0a9('0x9'));var _=require(_0xe0a9('0xa'));var squel=require(_0xe0a9('0xb'));var crypto=require(_0xe0a9('0xc'));var jsforce=require(_0xe0a9('0xd'));var deskjs=require(_0xe0a9('0xe'));var toCsv=require(_0xe0a9('0x8'));var querystring=require('querystring');var Papa=require(_0xe0a9('0xf'));var Redis=require(_0xe0a9('0x10'));var authService=require(_0xe0a9('0x11'));var qs=require(_0xe0a9('0x12'));var as=require(_0xe0a9('0x13'));var hardwareService=require(_0xe0a9('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xe0a9('0x15'));var config=require(_0xe0a9('0x16'));var licenseUtil=require(_0xe0a9('0x17'));var db=require(_0xe0a9('0x18'))['db'];function respondWithStatusCode(_0x245312,_0x37bd4a){_0x37bd4a=_0x37bd4a||0xcc;return function(_0x3d7a21){if(_0x3d7a21){return _0x245312[_0xe0a9('0x19')](_0x37bd4a);}return _0x245312['status'](_0x37bd4a)[_0xe0a9('0x1a')]();};}function respondWithResult(_0x317732,_0x4f16f6){_0x4f16f6=_0x4f16f6||0xc8;return function(_0x5cbb82){if(_0x5cbb82){return _0x317732[_0xe0a9('0x1b')](_0x4f16f6)[_0xe0a9('0x1c')](_0x5cbb82);}};}function respondWithFilteredResult(_0x5ce249,_0x17d810){return function(_0x1d7de2){if(_0x1d7de2){var _0x3dbca8=typeof _0x17d810[_0xe0a9('0x1d')]===_0xe0a9('0x1e')&&typeof _0x17d810[_0xe0a9('0x1f')]===_0xe0a9('0x1e');var _0x50cedb=_0x1d7de2[_0xe0a9('0x20')];var _0x41a284=_0x3dbca8?0x0:_0x17d810['offset'];var _0xa839=_0x3dbca8?_0x1d7de2[_0xe0a9('0x20')]:_0x17d810[_0xe0a9('0x1d')]+_0x17d810[_0xe0a9('0x1f')];var _0x1a1a70;if(_0xa839>=_0x50cedb){_0xa839=_0x50cedb;_0x1a1a70=0xc8;}else{_0x1a1a70=0xce;}_0x5ce249[_0xe0a9('0x1b')](_0x1a1a70);return _0x5ce249[_0xe0a9('0x21')](_0xe0a9('0x22'),_0x41a284+'-'+_0xa839+'/'+_0x50cedb)['json'](_0x1d7de2);}return null;};}function patchUpdates(_0x42a87f){return function(_0x3a0171){try{jsonpatch[_0xe0a9('0x23')](_0x3a0171,_0x42a87f,!![]);}catch(_0x3db498){return BPromise[_0xe0a9('0x24')](_0x3db498);}return _0x3a0171[_0xe0a9('0x25')]();};}function saveUpdates(_0x10edee,_0x4537d3){return function(_0x4ec140){if(_0x4ec140){return _0x4ec140[_0xe0a9('0x26')](_0x10edee)['then'](function(_0xc488d6){return _0xc488d6;});}return null;};}function removeEntity(_0x4bf6a9,_0xf5a142){return function(_0x52036e){if(_0x52036e){return _0x52036e[_0xe0a9('0x27')]()[_0xe0a9('0x28')](function(){var _0xd6dc83=_0x52036e[_0xe0a9('0x29')]({'plain':!![]});var _0x2070ff='CmContactHasItems';return db[_0xe0a9('0x2a')][_0xe0a9('0x27')]({'where':{'type':_0x2070ff,'resourceId':_0xd6dc83['id']}})[_0xe0a9('0x28')](function(){return _0x52036e;});})[_0xe0a9('0x28')](function(){_0x4bf6a9[_0xe0a9('0x1b')](0xcc)[_0xe0a9('0x1a')]();});}};}function handleEntityNotFound(_0xd36eb8,_0x5a8207){return function(_0x359d44){if(!_0x359d44){_0xd36eb8[_0xe0a9('0x19')](0x194);}return _0x359d44;};}function handleError(_0x31c9a1,_0x40c744){_0x40c744=_0x40c744||0x1f4;return function(_0x4f68aa){logger['error'](_0x4f68aa[_0xe0a9('0x2b')]);if(_0x4f68aa[_0xe0a9('0x2c')]){delete _0x4f68aa[_0xe0a9('0x2c')];}_0x31c9a1[_0xe0a9('0x1b')](_0x40c744)[_0xe0a9('0x2d')](_0x4f68aa);};}exports[_0xe0a9('0x2e')]=function(_0x1f1259,_0x2828f0){var _0x357aa2={},_0x201907={},_0x28596f={'count':0x0,'rows':[]};var _0x55af1b=_[_0xe0a9('0x2f')](db['CmContactHasItem'][_0xe0a9('0x30')],function(_0x5d1d70){return{'name':_0x5d1d70[_0xe0a9('0x31')],'type':_0x5d1d70[_0xe0a9('0x32')][_0xe0a9('0x33')]};});_0x201907[_0xe0a9('0x34')]=_[_0xe0a9('0x2f')](_0x55af1b,_0xe0a9('0x2c'));_0x201907[_0xe0a9('0x35')]=_[_0xe0a9('0x36')](_0x1f1259[_0xe0a9('0x35')]);_0x201907[_0xe0a9('0x37')]=_[_0xe0a9('0x38')](_0x201907[_0xe0a9('0x34')],_0x201907[_0xe0a9('0x35')]);_0x357aa2[_0xe0a9('0x39')]=_['intersection'](_0x201907[_0xe0a9('0x34')],qs[_0xe0a9('0x3a')](_0x1f1259[_0xe0a9('0x35')][_0xe0a9('0x3a')]));_0x357aa2[_0xe0a9('0x39')]=_0x357aa2['attributes'][_0xe0a9('0x3b')]?_0x357aa2[_0xe0a9('0x39')]:_0x201907['model'];if(!_0x1f1259[_0xe0a9('0x35')]['hasOwnProperty']('nolimit')){_0x357aa2[_0xe0a9('0x1f')]=qs[_0xe0a9('0x1f')](_0x1f1259[_0xe0a9('0x35')][_0xe0a9('0x1f')]);_0x357aa2['offset']=qs[_0xe0a9('0x1d')](_0x1f1259[_0xe0a9('0x35')]['offset']);}_0x357aa2['order']=qs[_0xe0a9('0x3c')](_0x1f1259['query']['sort']);_0x357aa2['where']=qs['filters'](_['pick'](_0x1f1259[_0xe0a9('0x35')],_0x201907[_0xe0a9('0x37')]),_0x55af1b);if(_0x1f1259[_0xe0a9('0x35')][_0xe0a9('0x3d')]){_0x357aa2[_0xe0a9('0x3e')]=_[_0xe0a9('0x3f')](_0x357aa2[_0xe0a9('0x3e')],{'$or':_[_0xe0a9('0x2f')](_0x55af1b,function(_0x39c819){if(_0x39c819[_0xe0a9('0x32')]!==_0xe0a9('0x40')){var _0xd7f038={};_0xd7f038[_0x39c819[_0xe0a9('0x2c')]]={'$like':'%'+_0x1f1259[_0xe0a9('0x35')][_0xe0a9('0x3d')]+'%'};return _0xd7f038;}})});}_0x357aa2=_['merge']({},_0x357aa2,_0x1f1259[_0xe0a9('0x41')]);var _0x351235={'where':_0x357aa2[_0xe0a9('0x3e')]};return db[_0xe0a9('0x42')][_0xe0a9('0x20')](_0x351235)[_0xe0a9('0x28')](function(_0x2a898e){_0x28596f[_0xe0a9('0x20')]=_0x2a898e;if(_0x1f1259[_0xe0a9('0x35')][_0xe0a9('0x43')]){_0x357aa2[_0xe0a9('0x44')]=[{'all':!![]}];}return db[_0xe0a9('0x42')][_0xe0a9('0x45')](_0x357aa2);})[_0xe0a9('0x28')](function(_0x493f99){_0x28596f[_0xe0a9('0x46')]=_0x493f99;return _0x28596f;})['then'](respondWithFilteredResult(_0x2828f0,_0x357aa2))[_0xe0a9('0x47')](handleError(_0x2828f0,null));};exports[_0xe0a9('0x48')]=function(_0x4bd234,_0x1680f7){var _0x58422e={'raw':!![],'where':{'id':_0x4bd234[_0xe0a9('0x49')]['id']}},_0x1ebebc={};_0x1ebebc['model']=_[_0xe0a9('0x36')](db[_0xe0a9('0x42')][_0xe0a9('0x30')]);_0x1ebebc[_0xe0a9('0x35')]=_[_0xe0a9('0x36')](_0x4bd234[_0xe0a9('0x35')]);_0x1ebebc[_0xe0a9('0x37')]=_[_0xe0a9('0x38')](_0x1ebebc['model'],_0x1ebebc['query']);_0x58422e[_0xe0a9('0x39')]=_[_0xe0a9('0x38')](_0x1ebebc[_0xe0a9('0x34')],qs['fields'](_0x4bd234[_0xe0a9('0x35')][_0xe0a9('0x3a')]));_0x58422e[_0xe0a9('0x39')]=_0x58422e['attributes'][_0xe0a9('0x3b')]?_0x58422e[_0xe0a9('0x39')]:_0x1ebebc[_0xe0a9('0x34')];if(_0x4bd234[_0xe0a9('0x35')][_0xe0a9('0x43')]){_0x58422e[_0xe0a9('0x44')]=[{'all':!![]}];}_0x58422e=_[_0xe0a9('0x3f')]({},_0x58422e,_0x4bd234[_0xe0a9('0x41')]);return db[_0xe0a9('0x42')][_0xe0a9('0x4a')](_0x58422e)[_0xe0a9('0x28')](handleEntityNotFound(_0x1680f7,null))['then'](respondWithResult(_0x1680f7,null))[_0xe0a9('0x47')](handleError(_0x1680f7,null));};exports['create']=function(_0x3be1b3,_0x10253a){return db[_0xe0a9('0x42')][_0xe0a9('0x4b')](_0x3be1b3[_0xe0a9('0x4c')],{})[_0xe0a9('0x28')](function(_0x53acc3){var _0x44d71d=_0x3be1b3[_0xe0a9('0x4d')]['get']({'plain':!![]});if(!_0x44d71d)throw new Error(_0xe0a9('0x4e'));if(_0x44d71d[_0xe0a9('0x4f')]===_0xe0a9('0x4d')){var _0xb5c4b2=_0x53acc3[_0xe0a9('0x29')]({'plain':!![]});var _0x3146d7=_0xe0a9('0x50');return db['UserProfileSection'][_0xe0a9('0x4a')]({'where':{'name':_0x3146d7,'userProfileId':_0x44d71d[_0xe0a9('0x51')]},'raw':!![]})['then'](function(_0x184be2){if(_0x184be2&&_0x184be2[_0xe0a9('0x52')]===0x0){return db[_0xe0a9('0x2a')][_0xe0a9('0x4b')]({'name':_0xb5c4b2['name'],'resourceId':_0xb5c4b2['id'],'type':_0x184be2['name'],'sectionId':_0x184be2['id']},{})[_0xe0a9('0x28')](function(){return _0x53acc3;});}else{return _0x53acc3;}})[_0xe0a9('0x47')](function(_0x45c2ce){logger[_0xe0a9('0x53')](_0xe0a9('0x54'),_0x45c2ce);throw _0x45c2ce;});}return _0x53acc3;})['then'](respondWithResult(_0x10253a,0xc9))['catch'](handleError(_0x10253a,null));};exports[_0xe0a9('0x26')]=function(_0x38ec6b,_0x397d6c){if(_0x38ec6b[_0xe0a9('0x4c')]['id']){delete _0x38ec6b[_0xe0a9('0x4c')]['id'];}return db[_0xe0a9('0x42')][_0xe0a9('0x4a')]({'where':{'id':_0x38ec6b[_0xe0a9('0x49')]['id']}})[_0xe0a9('0x28')](handleEntityNotFound(_0x397d6c,null))[_0xe0a9('0x28')](saveUpdates(_0x38ec6b[_0xe0a9('0x4c')],null))[_0xe0a9('0x28')](respondWithResult(_0x397d6c,null))[_0xe0a9('0x47')](handleError(_0x397d6c,null));};exports[_0xe0a9('0x27')]=function(_0x157de2,_0x437f54){return db[_0xe0a9('0x42')]['find']({'where':{'id':_0x157de2['params']['id']}})['then'](handleEntityNotFound(_0x437f54,null))[_0xe0a9('0x28')](removeEntity(_0x437f54,null))['catch'](handleError(_0x437f54,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index c7d4a4a..ecc6792 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 _0xc285=['path','rimraf','./cmContactHasItem.attributes','exports','define','CmContactHasItem','cm_contact_has_items','lodash','util','api','bluebird'];(function(_0x3d6989,_0xae1e80){var _0x55ff42=function(_0x138c36){while(--_0x138c36){_0x3d6989['push'](_0x3d6989['shift']());}};_0x55ff42(++_0xae1e80);}(_0xc285,0xd8));var _0x5c28=function(_0x1147ab,_0x10e72b){_0x1147ab=_0x1147ab-0x0;var _0x55cb5a=_0xc285[_0x1147ab];return _0x55cb5a;};'use strict';var _=require(_0x5c28('0x0'));var util=require(_0x5c28('0x1'));var logger=require('../../config/logger')(_0x5c28('0x2'));var moment=require('moment');var BPromise=require(_0x5c28('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5c28('0x4'));var rimraf=require(_0x5c28('0x5'));var config=require('../../config/environment');var attributes=require(_0x5c28('0x6'));module[_0x5c28('0x7')]=function(_0x1da864,_0x2404d0){return _0x1da864[_0x5c28('0x8')](_0x5c28('0x9'),attributes,{'tableName':_0x5c28('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x83c7=['bluebird','request-promise','path','../../config/environment','./cmContactHasItem.attributes','exports','define','CmContactHasItem','cm_contact_has_items','lodash','util','../../config/logger','api','moment'];(function(_0x1eb3a6,_0x2573c6){var _0x178348=function(_0x1522f7){while(--_0x1522f7){_0x1eb3a6['push'](_0x1eb3a6['shift']());}};_0x178348(++_0x2573c6);}(_0x83c7,0x183));var _0x783c=function(_0xf51cc5,_0x176595){_0xf51cc5=_0xf51cc5-0x0;var _0x12d18c=_0x83c7[_0xf51cc5];return _0x12d18c;};'use strict';var _=require(_0x783c('0x0'));var util=require(_0x783c('0x1'));var logger=require(_0x783c('0x2'))(_0x783c('0x3'));var moment=require(_0x783c('0x4'));var BPromise=require(_0x783c('0x5'));var rp=require(_0x783c('0x6'));var fs=require('fs');var path=require(_0x783c('0x7'));var rimraf=require('rimraf');var config=require(_0x783c('0x8'));var attributes=require(_0x783c('0x9'));module[_0x783c('0xa')]=function(_0x4d08a6,_0x50e4dc){return _0x4d08a6[_0x783c('0xb')](_0x783c('0xc'),attributes,{'tableName':_0x783c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.rpc.js b/server/api/cmContactHasItem/cmContactHasItem.rpc.js index 912320b..376c911 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 _0xfb22=['CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x517ce8,_0x26c9c4){var _0x2cdcd5=function(_0x261407){while(--_0x261407){_0x517ce8['push'](_0x517ce8['shift']());}};_0x2cdcd5(++_0x26c9c4);}(_0xfb22,0x1b0));var _0x2fb2=function(_0x2d2258,_0x2ce510){_0x2d2258=_0x2d2258-0x0;var _0x18e155=_0xfb22[_0x2d2258];return _0x18e155;};'use strict';var _=require(_0x2fb2('0x0'));var util=require(_0x2fb2('0x1'));var moment=require(_0x2fb2('0x2'));var BPromise=require('bluebird');var rs=require(_0x2fb2('0x3'));var fs=require('fs');var Redis=require(_0x2fb2('0x4'));var db=require(_0x2fb2('0x5'))['db'];var utils=require(_0x2fb2('0x6'));var logger=require(_0x2fb2('0x7'))(_0x2fb2('0x8'));var config=require(_0x2fb2('0x9'));var jayson=require(_0x2fb2('0xa'));var client=jayson[_0x2fb2('0xb')][_0x2fb2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3d69f4,_0x5cc7e0,_0xf7402b){return new BPromise(function(_0x3022ae,_0x3cda00){return client['request'](_0x3d69f4,_0xf7402b)[_0x2fb2('0xd')](function(_0x164aa6){logger[_0x2fb2('0xe')](_0x2fb2('0xf'),_0x5cc7e0,_0x2fb2('0x10'));logger[_0x2fb2('0x11')](_0x2fb2('0x12'),_0x5cc7e0,'request\x20sent',JSON[_0x2fb2('0x13')](_0x164aa6));if(_0x164aa6[_0x2fb2('0x14')]){if(_0x164aa6[_0x2fb2('0x14')][_0x2fb2('0x15')]===0x1f4){logger[_0x2fb2('0x14')]('CmContactHasItem,\x20%s,\x20%s',_0x5cc7e0,_0x164aa6[_0x2fb2('0x14')][_0x2fb2('0x16')]);return _0x3cda00(_0x164aa6[_0x2fb2('0x14')][_0x2fb2('0x16')]);}logger[_0x2fb2('0x14')](_0x2fb2('0xf'),_0x5cc7e0,_0x164aa6[_0x2fb2('0x14')][_0x2fb2('0x16')]);return _0x3022ae(_0x164aa6[_0x2fb2('0x14')][_0x2fb2('0x16')]);}else{logger[_0x2fb2('0xe')](_0x2fb2('0xf'),_0x5cc7e0,_0x2fb2('0x10'));_0x3022ae(_0x164aa6[_0x2fb2('0x17')][_0x2fb2('0x16')]);}})[_0x2fb2('0x18')](function(_0x4ba637){logger['error']('CmContactHasItem,\x20%s,\x20%s',_0x5cc7e0,_0x4ba637);_0x3cda00(_0x4ba637);});});} \ No newline at end of file +var _0x378b=['http','request','then','info','CmContactHasItem,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x5ecb0b,_0xc35f01){var _0x32dffe=function(_0x221b99){while(--_0x221b99){_0x5ecb0b['push'](_0x5ecb0b['shift']());}};_0x32dffe(++_0xc35f01);}(_0x378b,0xc7));var _0xb378=function(_0x32da8f,_0x31db00){_0x32da8f=_0x32da8f-0x0;var _0x154db0=_0x378b[_0x32da8f];return _0x154db0;};'use strict';var _=require(_0xb378('0x0'));var util=require(_0xb378('0x1'));var moment=require(_0xb378('0x2'));var BPromise=require(_0xb378('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb378('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb378('0x5'));var logger=require(_0xb378('0x6'))(_0xb378('0x7'));var config=require(_0xb378('0x8'));var jayson=require(_0xb378('0x9'));var client=jayson[_0xb378('0xa')][_0xb378('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2d7107,_0x3eea14,_0x570e2a){return new BPromise(function(_0x13361c,_0x916a9c){return client[_0xb378('0xc')](_0x2d7107,_0x570e2a)[_0xb378('0xd')](function(_0xd7f829){logger[_0xb378('0xe')](_0xb378('0xf'),_0x3eea14,'request\x20sent');logger[_0xb378('0x10')]('CmContactHasItem,\x20%s,\x20%s,\x20%s',_0x3eea14,_0xb378('0x11'),JSON[_0xb378('0x12')](_0xd7f829));if(_0xd7f829[_0xb378('0x13')]){if(_0xd7f829[_0xb378('0x13')]['code']===0x1f4){logger[_0xb378('0x13')](_0xb378('0xf'),_0x3eea14,_0xd7f829[_0xb378('0x13')][_0xb378('0x14')]);return _0x916a9c(_0xd7f829[_0xb378('0x13')][_0xb378('0x14')]);}logger[_0xb378('0x13')]('CmContactHasItem,\x20%s,\x20%s',_0x3eea14,_0xd7f829[_0xb378('0x13')][_0xb378('0x14')]);return _0x13361c(_0xd7f829['error'][_0xb378('0x14')]);}else{logger['info']('CmContactHasItem,\x20%s,\x20%s',_0x3eea14,_0xb378('0x11'));_0x13361c(_0xd7f829['result'][_0xb378('0x14')]);}})['catch'](function(_0x30c12f){logger[_0xb378('0x13')](_0xb378('0xf'),_0x3eea14,_0x30c12f);_0x916a9c(_0x30c12f);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index 05f43ca..e682013 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 _0x4eb0=['get','isAuthenticated','index','post','create','put','/:id','update','delete','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','./cmContactHasItem.controller'];(function(_0x486b5e,_0x4cc12b){var _0x550bf5=function(_0x5939fb){while(--_0x5939fb){_0x486b5e['push'](_0x486b5e['shift']());}};_0x550bf5(++_0x4cc12b);}(_0x4eb0,0xd0));var _0x04eb=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x4eb0[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x04eb('0x0'));var util=require(_0x04eb('0x1'));var path=require(_0x04eb('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x04eb('0x3')]();var fs_extra=require(_0x04eb('0x4'));var auth=require(_0x04eb('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x04eb('0x6'));var controller=require(_0x04eb('0x7'));router[_0x04eb('0x8')]('/',auth[_0x04eb('0x9')](),controller[_0x04eb('0xa')]);router[_0x04eb('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x04eb('0xb')]('/',auth[_0x04eb('0x9')](),controller[_0x04eb('0xc')]);router[_0x04eb('0xd')](_0x04eb('0xe'),auth[_0x04eb('0x9')](),controller[_0x04eb('0xf')]);router[_0x04eb('0x10')]('/:id',auth[_0x04eb('0x9')](),controller['destroy']);module[_0x04eb('0x11')]=router; \ No newline at end of file +var _0x9632=['/:id','show','create','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContactHasItem.controller','isAuthenticated','index','get'];(function(_0x2edf24,_0x172528){var _0x50e403=function(_0x4814ff){while(--_0x4814ff){_0x2edf24['push'](_0x2edf24['shift']());}};_0x50e403(++_0x172528);}(_0x9632,0x1b6));var _0x2963=function(_0x2f2765,_0x4f291c){_0x2f2765=_0x2f2765-0x0;var _0x3730ce=_0x9632[_0x2f2765];return _0x3730ce;};'use strict';var multer=require(_0x2963('0x0'));var util=require(_0x2963('0x1'));var path=require(_0x2963('0x2'));var timeout=require(_0x2963('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x2963('0x4'));var auth=require(_0x2963('0x5'));var interaction=require(_0x2963('0x6'));var config=require(_0x2963('0x7'));var controller=require(_0x2963('0x8'));router['get']('/',auth[_0x2963('0x9')](),controller[_0x2963('0xa')]);router[_0x2963('0xb')](_0x2963('0xc'),auth[_0x2963('0x9')](),controller[_0x2963('0xd')]);router['post']('/',auth[_0x2963('0x9')](),controller[_0x2963('0xe')]);router['put'](_0x2963('0xc'),auth[_0x2963('0x9')](),controller['update']);router[_0x2963('0xf')](_0x2963('0xc'),auth[_0x2963('0x9')](),controller[_0x2963('0x10')]);module[_0x2963('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 05f7a97..260c187 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 _0x313a=['sequelize','lodash','exports','VIRTUAL','getDataValue','alias','STRING','setDataValue','name','TEXT','long','type','parse','values','isArray','stringify','BOOLEAN','ENUM'];(function(_0x1139fa,_0x4c184a){var _0xaa380c=function(_0x241aea){while(--_0x241aea){_0x1139fa['push'](_0x1139fa['shift']());}};_0xaa380c(++_0x4c184a);}(_0x313a,0xc6));var _0xa313=function(_0x3c5f8d,_0x39891f){_0x3c5f8d=_0x3c5f8d-0x0;var _0x3b7beb=_0x313a[_0x3c5f8d];return _0x3b7beb;};'use strict';var Sequelize=require(_0xa313('0x0'));var _=require(_0xa313('0x1'));module[_0xa313('0x2')]={'name':{'type':Sequelize[_0xa313('0x3')],'get':function(_0x2b3a73){return this[_0xa313('0x4')](_0xa313('0x5'));}},'alias':{'type':Sequelize[_0xa313('0x6')],'allowNull':![],'set':function(_0x5168f3){this[_0xa313('0x7')](_0xa313('0x5'),_0x5168f3?_0x5168f3:this[_0xa313('0x4')](_0xa313('0x8')));}},'type':{'type':Sequelize[_0xa313('0x6')],'allowNull':![]},'values':{'type':Sequelize[_0xa313('0x9')](_0xa313('0xa')),'get':function(){if(this[_0xa313('0x4')](_0xa313('0xb'))==='select'){return JSON[_0xa313('0xc')](this[_0xa313('0x4')](_0xa313('0xd')));}else{return this['getDataValue']('values');}},'set':function(_0x2ac4f7){if(Array[_0xa313('0xe')](_0x2ac4f7)){this[_0xa313('0x7')](_0xa313('0xd'),JSON[_0xa313('0xf')](_0x2ac4f7));}else{this[_0xa313('0x7')](_0xa313('0xd'),_0x2ac4f7);}}},'required':{'type':Sequelize[_0xa313('0x10')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xa313('0x10')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xa313('0x11')]('voice')}}; \ No newline at end of file +var _0x5376=['BOOLEAN','voice','sequelize','exports','VIRTUAL','getDataValue','alias','STRING','name','TEXT','long','type','select','values','setDataValue','stringify'];(function(_0x5793b5,_0xd1123a){var _0x85674f=function(_0x12607a){while(--_0x12607a){_0x5793b5['push'](_0x5793b5['shift']());}};_0x85674f(++_0xd1123a);}(_0x5376,0x1e2));var _0x6537=function(_0x32959e,_0x95c759){_0x32959e=_0x32959e-0x0;var _0x379025=_0x5376[_0x32959e];return _0x379025;};'use strict';var Sequelize=require(_0x6537('0x0'));var _=require('lodash');module[_0x6537('0x1')]={'name':{'type':Sequelize[_0x6537('0x2')],'get':function(_0x455744){return this[_0x6537('0x3')](_0x6537('0x4'));}},'alias':{'type':Sequelize[_0x6537('0x5')],'allowNull':![],'set':function(_0x57a83a){this['setDataValue'](_0x6537('0x4'),_0x57a83a?_0x57a83a:this['getDataValue'](_0x6537('0x6')));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0x6537('0x7')](_0x6537('0x8')),'get':function(){if(this[_0x6537('0x3')](_0x6537('0x9'))===_0x6537('0xa')){return JSON['parse'](this[_0x6537('0x3')]('values'));}else{return this[_0x6537('0x3')](_0x6537('0xb'));}},'set':function(_0x233ef4){if(Array['isArray'](_0x233ef4)){this[_0x6537('0xc')](_0x6537('0xb'),JSON[_0x6537('0xd')](_0x233ef4));}else{this['setDataValue'](_0x6537('0xb'),_0x233ef4);}}},'required':{'type':Sequelize[_0x6537('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize['ENUM'](_0x6537('0xf'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 7c18235..2bd6221 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 _0x4d53=['destroy','end','stack','name','send','index','CmCustomField','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','keys','length','find','body','params','sequelize','transaction','Sequelize','TEXT','text','number','INTEGER','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','format','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','apply','save','update','then'];(function(_0x48b495,_0x58f330){var _0x45da5e=function(_0xa2c670){while(--_0xa2c670){_0x48b495['push'](_0x48b495['shift']());}};_0x45da5e(++_0x58f330);}(_0x4d53,0x1ec));var _0x34d5=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x4d53[_0x2b7764];return _0x848dcb;};'use strict';var emlformat=require(_0x34d5('0x0'));var rimraf=require(_0x34d5('0x1'));var zipdir=require(_0x34d5('0x2'));var jsonpatch=require(_0x34d5('0x3'));var rp=require('request-promise');var moment=require(_0x34d5('0x4'));var BPromise=require(_0x34d5('0x5'));var Mustache=require(_0x34d5('0x6'));var util=require('util');var path=require(_0x34d5('0x7'));var sox=require('sox');var csv=require(_0x34d5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x34d5('0x9'));var _=require(_0x34d5('0xa'));var squel=require(_0x34d5('0xb'));var crypto=require(_0x34d5('0xc'));var jsforce=require(_0x34d5('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x34d5('0x8'));var querystring=require(_0x34d5('0xe'));var Papa=require(_0x34d5('0xf'));var Redis=require(_0x34d5('0x10'));var authService=require(_0x34d5('0x11'));var qs=require(_0x34d5('0x12'));var as=require(_0x34d5('0x13'));var hardwareService=require(_0x34d5('0x14'));var logger=require(_0x34d5('0x15'))('api');var utils=require(_0x34d5('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x34d5('0x17'));var db=require(_0x34d5('0x18'))['db'];function respondWithStatusCode(_0x3ed339,_0x599b3f){_0x599b3f=_0x599b3f||0xcc;return function(_0x2200a2){if(_0x2200a2){return _0x3ed339[_0x34d5('0x19')](_0x599b3f);}return _0x3ed339[_0x34d5('0x1a')](_0x599b3f)['end']();};}function respondWithResult(_0x5a4de9,_0x105686){_0x105686=_0x105686||0xc8;return function(_0x246710){if(_0x246710){return _0x5a4de9[_0x34d5('0x1a')](_0x105686)[_0x34d5('0x1b')](_0x246710);}};}function respondWithFilteredResult(_0x10fac6,_0x56d894){return function(_0xa062fc){if(_0xa062fc){var _0x119e44=typeof _0x56d894[_0x34d5('0x1c')]===_0x34d5('0x1d')&&typeof _0x56d894[_0x34d5('0x1e')]==='undefined';var _0x51aeb7=_0xa062fc[_0x34d5('0x1f')];var _0x51f46b=_0x119e44?0x0:_0x56d894['offset'];var _0x50db03=_0x119e44?_0xa062fc[_0x34d5('0x1f')]:_0x56d894[_0x34d5('0x1c')]+_0x56d894[_0x34d5('0x1e')];var _0x35e6ca;if(_0x50db03>=_0x51aeb7){_0x50db03=_0x51aeb7;_0x35e6ca=0xc8;}else{_0x35e6ca=0xce;}_0x10fac6[_0x34d5('0x1a')](_0x35e6ca);return _0x10fac6['set']('Content-Range',_0x51f46b+'-'+_0x50db03+'/'+_0x51aeb7)[_0x34d5('0x1b')](_0xa062fc);}return null;};}function patchUpdates(_0x117554){return function(_0x5cdf3b){try{jsonpatch[_0x34d5('0x20')](_0x5cdf3b,_0x117554,!![]);}catch(_0x2208d8){return BPromise['reject'](_0x2208d8);}return _0x5cdf3b[_0x34d5('0x21')]();};}function saveUpdates(_0x8ff035,_0x2641eb){return function(_0x407a99){if(_0x407a99){return _0x407a99[_0x34d5('0x22')](_0x8ff035)[_0x34d5('0x23')](function(_0x54a700){return _0x54a700;});}return null;};}function removeEntity(_0x160fca,_0x154b1e){return function(_0x1535ed){if(_0x1535ed){return _0x1535ed[_0x34d5('0x24')]()[_0x34d5('0x23')](function(){_0x160fca[_0x34d5('0x1a')](0xcc)[_0x34d5('0x25')]();});}};}function handleEntityNotFound(_0x3212fc,_0x1a7f90){return function(_0x1c450b){if(!_0x1c450b){_0x3212fc[_0x34d5('0x19')](0x194);}return _0x1c450b;};}function handleError(_0x564fbd,_0x3d49a7){_0x3d49a7=_0x3d49a7||0x1f4;return function(_0x1e500b){logger['error'](_0x1e500b[_0x34d5('0x26')]);if(_0x1e500b['name']){delete _0x1e500b[_0x34d5('0x27')];}_0x564fbd[_0x34d5('0x1a')](_0x3d49a7)[_0x34d5('0x28')](_0x1e500b);};}exports[_0x34d5('0x29')]=function(_0x5c93ea,_0x351445){var _0x2417b1={},_0x59a6b2={},_0x48a992={'count':0x0,'rows':[]};var _0x18fcdb=_['map'](db[_0x34d5('0x2a')][_0x34d5('0x2b')],function(_0x5a2d58){return{'name':_0x5a2d58[_0x34d5('0x2c')],'type':_0x5a2d58[_0x34d5('0x2d')][_0x34d5('0x2e')]};});_0x59a6b2[_0x34d5('0x2f')]=_['differenceBy'](_[_0x34d5('0x30')](_0x18fcdb,_0x34d5('0x27')),[_0x34d5('0x27')]);_0x59a6b2[_0x34d5('0x31')]=_['keys'](_0x5c93ea[_0x34d5('0x31')]);_0x59a6b2[_0x34d5('0x32')]=_['intersection'](_0x59a6b2[_0x34d5('0x2f')],_0x59a6b2['query']);_0x2417b1[_0x34d5('0x33')]=_[_0x34d5('0x34')](_0x59a6b2[_0x34d5('0x2f')],qs[_0x34d5('0x35')](_0x5c93ea['query'][_0x34d5('0x35')]));_0x2417b1[_0x34d5('0x33')]=_0x2417b1[_0x34d5('0x33')]['length']?_0x2417b1[_0x34d5('0x33')]:_0x59a6b2[_0x34d5('0x2f')];if(!_0x5c93ea[_0x34d5('0x31')][_0x34d5('0x36')](_0x34d5('0x37'))){_0x2417b1['limit']=qs[_0x34d5('0x1e')](_0x5c93ea['query'][_0x34d5('0x1e')]);_0x2417b1['offset']=qs[_0x34d5('0x1c')](_0x5c93ea[_0x34d5('0x31')][_0x34d5('0x1c')]);}_0x2417b1[_0x34d5('0x38')]=qs[_0x34d5('0x39')](_0x5c93ea[_0x34d5('0x31')][_0x34d5('0x39')]);_0x2417b1[_0x34d5('0x3a')]=qs[_0x34d5('0x32')](_[_0x34d5('0x3b')](_0x5c93ea[_0x34d5('0x31')],_0x59a6b2['filters']),_0x18fcdb);if(_0x5c93ea[_0x34d5('0x31')][_0x34d5('0x3c')]){_0x2417b1[_0x34d5('0x3a')]=_['merge'](_0x2417b1[_0x34d5('0x3a')],{'$or':_[_0x34d5('0x30')](_0x18fcdb,function(_0x5596be){if(_0x5596be[_0x34d5('0x2d')]!==_0x34d5('0x3d')){var _0x24aa86={};_0x24aa86[_0x5596be['name']]={'$like':'%'+_0x5c93ea[_0x34d5('0x31')][_0x34d5('0x3c')]+'%'};return _0x24aa86;}})});}_0x2417b1=_[_0x34d5('0x3e')]({},_0x2417b1,_0x5c93ea[_0x34d5('0x3f')]);var _0x3f168d={'where':_0x2417b1['where']};return db[_0x34d5('0x2a')][_0x34d5('0x1f')](_0x3f168d)[_0x34d5('0x23')](function(_0xba5c47){_0x48a992[_0x34d5('0x1f')]=_0xba5c47;if(_0x5c93ea[_0x34d5('0x31')][_0x34d5('0x40')]){_0x2417b1[_0x34d5('0x41')]=[{'all':!![]}];}return db[_0x34d5('0x2a')][_0x34d5('0x42')](_0x2417b1);})[_0x34d5('0x23')](function(_0x25fce8){_0x48a992['rows']=_0x25fce8;return _0x48a992;})['then'](respondWithFilteredResult(_0x351445,_0x2417b1))[_0x34d5('0x43')](handleError(_0x351445,null));};exports[_0x34d5('0x44')]=function(_0x4c9b4c,_0x491d8a){var _0x3023c1={'raw':!![],'where':{'id':_0x4c9b4c['params']['id']}},_0xe0ea17={};_0xe0ea17[_0x34d5('0x2f')]=_['keys'](db[_0x34d5('0x2a')]['rawAttributes']);_0xe0ea17['query']=_[_0x34d5('0x45')](_0x4c9b4c[_0x34d5('0x31')]);_0xe0ea17[_0x34d5('0x32')]=_[_0x34d5('0x34')](_0xe0ea17[_0x34d5('0x2f')],_0xe0ea17[_0x34d5('0x31')]);_0x3023c1[_0x34d5('0x33')]=_[_0x34d5('0x34')](_0xe0ea17[_0x34d5('0x2f')],qs[_0x34d5('0x35')](_0x4c9b4c[_0x34d5('0x31')]['fields']));_0x3023c1['attributes']=_0x3023c1[_0x34d5('0x33')][_0x34d5('0x46')]?_0x3023c1['attributes']:_0xe0ea17[_0x34d5('0x2f')];if(_0x4c9b4c[_0x34d5('0x31')]['includeAll']){_0x3023c1[_0x34d5('0x41')]=[{'all':!![]}];}_0x3023c1=_[_0x34d5('0x3e')]({},_0x3023c1,_0x4c9b4c[_0x34d5('0x3f')]);return db['CmCustomField'][_0x34d5('0x47')](_0x3023c1)['then'](handleEntityNotFound(_0x491d8a,null))['then'](respondWithResult(_0x491d8a,null))[_0x34d5('0x43')](handleError(_0x491d8a,null));};exports[_0x34d5('0x22')]=function(_0x4baf4b,_0x1191fc){if(_0x4baf4b[_0x34d5('0x48')]['id']){delete _0x4baf4b[_0x34d5('0x48')]['id'];}return db[_0x34d5('0x2a')]['find']({'where':{'id':_0x4baf4b[_0x34d5('0x49')]['id']}})[_0x34d5('0x23')](handleEntityNotFound(_0x1191fc,null))[_0x34d5('0x23')](saveUpdates(_0x4baf4b[_0x34d5('0x48')],null))[_0x34d5('0x23')](respondWithResult(_0x1191fc,null))[_0x34d5('0x43')](handleError(_0x1191fc,null));};exports[_0x34d5('0x24')]=function(_0x9a9fb3,_0x230ea6){return db[_0x34d5('0x2a')][_0x34d5('0x47')]({'where':{'id':_0x9a9fb3[_0x34d5('0x49')]['id']}})['then'](handleEntityNotFound(_0x230ea6,null))[_0x34d5('0x23')](removeEntity(_0x230ea6,null))[_0x34d5('0x43')](handleError(_0x230ea6,null));};exports['create']=function(_0x55ecb7,_0x431cef){var _0x39e0e2;return db[_0x34d5('0x4a')][_0x34d5('0x4b')](function(_0x34d662){return db[_0x34d5('0x2a')]['create'](_0x55ecb7[_0x34d5('0x48')],{'transaction':_0x34d662})['then'](function(_0x3efe6c){_0x39e0e2=_0x3efe6c;var _0x2dcec3={'type':db[_0x34d5('0x4c')][_0x34d5('0x4d')],'transaction':_0x34d662};switch(_0x55ecb7['body']['type']){case _0x34d5('0x4e'):_0x2dcec3[_0x34d5('0x2d')]=db[_0x34d5('0x4c')]['TEXT'];break;case _0x34d5('0x4f'):_0x2dcec3[_0x34d5('0x2d')]=db[_0x34d5('0x4c')][_0x34d5('0x50')];break;case'switch':_0x2dcec3['type']=db[_0x34d5('0x4c')][_0x34d5('0x51')];_0x2dcec3[_0x34d5('0x52')]=![];break;default:}return db[_0x34d5('0x4a')][_0x34d5('0x53')][_0x34d5('0x54')](_0x34d5('0x55'),util[_0x34d5('0x56')](_0x34d5('0x57'),_0x39e0e2['id']),_0x2dcec3);})[_0x34d5('0x23')](function(){return _0x39e0e2;});})['then'](respondWithResult(_0x431cef,0xc9))['catch'](handleError(_0x431cef,null));}; \ No newline at end of file +var _0x1c7c=['eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','reject','save','update','then','destroy','error','name','index','map','CmCustomField','rawAttributes','fieldName','model','differenceBy','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','include','find','body','create','sequelize','transaction','Sequelize','text','TEXT','number','INTEGER','switch','defaultValue','queryInterface','cm_contacts','cf_%d'];(function(_0x2f4fc9,_0x2a39e6){var _0x52417b=function(_0x205b2d){while(--_0x205b2d){_0x2f4fc9['push'](_0x2f4fc9['shift']());}};_0x52417b(++_0x2a39e6);}(_0x1c7c,0x164));var _0xc1c7=function(_0x21d04f,_0xe7442a){_0x21d04f=_0x21d04f-0x0;var _0x359363=_0x1c7c[_0x21d04f];return _0x359363;};'use strict';var emlformat=require(_0xc1c7('0x0'));var rimraf=require(_0xc1c7('0x1'));var zipdir=require(_0xc1c7('0x2'));var jsonpatch=require(_0xc1c7('0x3'));var rp=require('request-promise');var moment=require(_0xc1c7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc1c7('0x5'));var util=require(_0xc1c7('0x6'));var path=require(_0xc1c7('0x7'));var sox=require(_0xc1c7('0x8'));var csv=require(_0xc1c7('0x9'));var ejs=require(_0xc1c7('0xa'));var fs=require('fs');var fs_extra=require(_0xc1c7('0xb'));var _=require(_0xc1c7('0xc'));var squel=require(_0xc1c7('0xd'));var crypto=require(_0xc1c7('0xe'));var jsforce=require(_0xc1c7('0xf'));var deskjs=require(_0xc1c7('0x10'));var toCsv=require(_0xc1c7('0x9'));var querystring=require(_0xc1c7('0x11'));var Papa=require(_0xc1c7('0x12'));var Redis=require(_0xc1c7('0x13'));var authService=require(_0xc1c7('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xc1c7('0x15'));var hardwareService=require(_0xc1c7('0x16'));var logger=require('../../config/logger')(_0xc1c7('0x17'));var utils=require(_0xc1c7('0x18'));var config=require(_0xc1c7('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xc1c7('0x1a'))['db'];function respondWithStatusCode(_0x44bf88,_0x376cab){_0x376cab=_0x376cab||0xcc;return function(_0x35feaa){if(_0x35feaa){return _0x44bf88[_0xc1c7('0x1b')](_0x376cab);}return _0x44bf88[_0xc1c7('0x1c')](_0x376cab)[_0xc1c7('0x1d')]();};}function respondWithResult(_0x1b57ab,_0xdfc7d9){_0xdfc7d9=_0xdfc7d9||0xc8;return function(_0x1b6905){if(_0x1b6905){return _0x1b57ab[_0xc1c7('0x1c')](_0xdfc7d9)[_0xc1c7('0x1e')](_0x1b6905);}};}function respondWithFilteredResult(_0x49576d,_0x3e1f0e){return function(_0x335600){if(_0x335600){var _0x21911c=typeof _0x3e1f0e['offset']===_0xc1c7('0x1f')&&typeof _0x3e1f0e[_0xc1c7('0x20')]===_0xc1c7('0x1f');var _0x39ac54=_0x335600[_0xc1c7('0x21')];var _0xb42702=_0x21911c?0x0:_0x3e1f0e[_0xc1c7('0x22')];var _0x2e93e5=_0x21911c?_0x335600['count']:_0x3e1f0e[_0xc1c7('0x22')]+_0x3e1f0e[_0xc1c7('0x20')];var _0x3ec66a;if(_0x2e93e5>=_0x39ac54){_0x2e93e5=_0x39ac54;_0x3ec66a=0xc8;}else{_0x3ec66a=0xce;}_0x49576d[_0xc1c7('0x1c')](_0x3ec66a);return _0x49576d['set'](_0xc1c7('0x23'),_0xb42702+'-'+_0x2e93e5+'/'+_0x39ac54)['json'](_0x335600);}return null;};}function patchUpdates(_0x5e7e4a){return function(_0x195c5f){try{jsonpatch['apply'](_0x195c5f,_0x5e7e4a,!![]);}catch(_0x5846f0){return BPromise[_0xc1c7('0x24')](_0x5846f0);}return _0x195c5f[_0xc1c7('0x25')]();};}function saveUpdates(_0x2f1b87,_0x4c6b34){return function(_0x813853){if(_0x813853){return _0x813853[_0xc1c7('0x26')](_0x2f1b87)[_0xc1c7('0x27')](function(_0x31a0e0){return _0x31a0e0;});}return null;};}function removeEntity(_0x2e64c4,_0x3a2483){return function(_0x3180fd){if(_0x3180fd){return _0x3180fd[_0xc1c7('0x28')]()[_0xc1c7('0x27')](function(){_0x2e64c4[_0xc1c7('0x1c')](0xcc)[_0xc1c7('0x1d')]();});}};}function handleEntityNotFound(_0x363fbc,_0x33aac7){return function(_0x260a3f){if(!_0x260a3f){_0x363fbc[_0xc1c7('0x1b')](0x194);}return _0x260a3f;};}function handleError(_0x21563a,_0x5edb34){_0x5edb34=_0x5edb34||0x1f4;return function(_0xf0ab9c){logger[_0xc1c7('0x29')](_0xf0ab9c['stack']);if(_0xf0ab9c['name']){delete _0xf0ab9c[_0xc1c7('0x2a')];}_0x21563a['status'](_0x5edb34)['send'](_0xf0ab9c);};}exports[_0xc1c7('0x2b')]=function(_0x1b873c,_0x46d045){var _0x243450={},_0x461360={},_0x4adb81={'count':0x0,'rows':[]};var _0x574e1c=_[_0xc1c7('0x2c')](db[_0xc1c7('0x2d')][_0xc1c7('0x2e')],function(_0x3a786f){return{'name':_0x3a786f[_0xc1c7('0x2f')],'type':_0x3a786f['type']['key']};});_0x461360[_0xc1c7('0x30')]=_[_0xc1c7('0x31')](_['map'](_0x574e1c,_0xc1c7('0x2a')),[_0xc1c7('0x2a')]);_0x461360[_0xc1c7('0x32')]=_[_0xc1c7('0x33')](_0x1b873c[_0xc1c7('0x32')]);_0x461360[_0xc1c7('0x34')]=_[_0xc1c7('0x35')](_0x461360['model'],_0x461360[_0xc1c7('0x32')]);_0x243450[_0xc1c7('0x36')]=_[_0xc1c7('0x35')](_0x461360[_0xc1c7('0x30')],qs[_0xc1c7('0x37')](_0x1b873c[_0xc1c7('0x32')][_0xc1c7('0x37')]));_0x243450[_0xc1c7('0x36')]=_0x243450[_0xc1c7('0x36')]['length']?_0x243450['attributes']:_0x461360[_0xc1c7('0x30')];if(!_0x1b873c[_0xc1c7('0x32')][_0xc1c7('0x38')](_0xc1c7('0x39'))){_0x243450[_0xc1c7('0x20')]=qs[_0xc1c7('0x20')](_0x1b873c[_0xc1c7('0x32')][_0xc1c7('0x20')]);_0x243450[_0xc1c7('0x22')]=qs[_0xc1c7('0x22')](_0x1b873c[_0xc1c7('0x32')][_0xc1c7('0x22')]);}_0x243450[_0xc1c7('0x3a')]=qs[_0xc1c7('0x3b')](_0x1b873c[_0xc1c7('0x32')][_0xc1c7('0x3b')]);_0x243450[_0xc1c7('0x3c')]=qs[_0xc1c7('0x34')](_[_0xc1c7('0x3d')](_0x1b873c[_0xc1c7('0x32')],_0x461360[_0xc1c7('0x34')]),_0x574e1c);if(_0x1b873c['query']['filter']){_0x243450['where']=_[_0xc1c7('0x3e')](_0x243450['where'],{'$or':_['map'](_0x574e1c,function(_0x17ae8e){if(_0x17ae8e[_0xc1c7('0x3f')]!==_0xc1c7('0x40')){var _0x146397={};_0x146397[_0x17ae8e['name']]={'$like':'%'+_0x1b873c[_0xc1c7('0x32')][_0xc1c7('0x41')]+'%'};return _0x146397;}})});}_0x243450=_[_0xc1c7('0x3e')]({},_0x243450,_0x1b873c[_0xc1c7('0x42')]);var _0x1a395c={'where':_0x243450[_0xc1c7('0x3c')]};return db[_0xc1c7('0x2d')][_0xc1c7('0x21')](_0x1a395c)[_0xc1c7('0x27')](function(_0x1810c7){_0x4adb81[_0xc1c7('0x21')]=_0x1810c7;if(_0x1b873c[_0xc1c7('0x32')][_0xc1c7('0x43')]){_0x243450['include']=[{'all':!![]}];}return db[_0xc1c7('0x2d')][_0xc1c7('0x44')](_0x243450);})['then'](function(_0x767caa){_0x4adb81[_0xc1c7('0x45')]=_0x767caa;return _0x4adb81;})[_0xc1c7('0x27')](respondWithFilteredResult(_0x46d045,_0x243450))[_0xc1c7('0x46')](handleError(_0x46d045,null));};exports[_0xc1c7('0x47')]=function(_0x2c09de,_0xd5e06a){var _0x1e0248={'raw':!![],'where':{'id':_0x2c09de[_0xc1c7('0x48')]['id']}},_0x1c96f1={};_0x1c96f1['model']=_[_0xc1c7('0x33')](db[_0xc1c7('0x2d')]['rawAttributes']);_0x1c96f1['query']=_[_0xc1c7('0x33')](_0x2c09de[_0xc1c7('0x32')]);_0x1c96f1[_0xc1c7('0x34')]=_[_0xc1c7('0x35')](_0x1c96f1[_0xc1c7('0x30')],_0x1c96f1['query']);_0x1e0248[_0xc1c7('0x36')]=_[_0xc1c7('0x35')](_0x1c96f1['model'],qs['fields'](_0x2c09de['query'][_0xc1c7('0x37')]));_0x1e0248[_0xc1c7('0x36')]=_0x1e0248[_0xc1c7('0x36')]['length']?_0x1e0248[_0xc1c7('0x36')]:_0x1c96f1[_0xc1c7('0x30')];if(_0x2c09de['query'][_0xc1c7('0x43')]){_0x1e0248[_0xc1c7('0x49')]=[{'all':!![]}];}_0x1e0248=_[_0xc1c7('0x3e')]({},_0x1e0248,_0x2c09de[_0xc1c7('0x42')]);return db[_0xc1c7('0x2d')][_0xc1c7('0x4a')](_0x1e0248)[_0xc1c7('0x27')](handleEntityNotFound(_0xd5e06a,null))[_0xc1c7('0x27')](respondWithResult(_0xd5e06a,null))[_0xc1c7('0x46')](handleError(_0xd5e06a,null));};exports[_0xc1c7('0x26')]=function(_0xa49f73,_0x13c275){if(_0xa49f73[_0xc1c7('0x4b')]['id']){delete _0xa49f73[_0xc1c7('0x4b')]['id'];}return db[_0xc1c7('0x2d')][_0xc1c7('0x4a')]({'where':{'id':_0xa49f73[_0xc1c7('0x48')]['id']}})[_0xc1c7('0x27')](handleEntityNotFound(_0x13c275,null))['then'](saveUpdates(_0xa49f73[_0xc1c7('0x4b')],null))['then'](respondWithResult(_0x13c275,null))[_0xc1c7('0x46')](handleError(_0x13c275,null));};exports[_0xc1c7('0x28')]=function(_0x2840a3,_0x524088){return db[_0xc1c7('0x2d')][_0xc1c7('0x4a')]({'where':{'id':_0x2840a3['params']['id']}})['then'](handleEntityNotFound(_0x524088,null))['then'](removeEntity(_0x524088,null))[_0xc1c7('0x46')](handleError(_0x524088,null));};exports[_0xc1c7('0x4c')]=function(_0x53f542,_0x49542){var _0x12a1d2;return db[_0xc1c7('0x4d')][_0xc1c7('0x4e')](function(_0x37374c){return db[_0xc1c7('0x2d')]['create'](_0x53f542[_0xc1c7('0x4b')],{'transaction':_0x37374c})['then'](function(_0x307b5e){_0x12a1d2=_0x307b5e;var _0x456ac1={'type':db[_0xc1c7('0x4f')]['TEXT'],'transaction':_0x37374c};switch(_0x53f542[_0xc1c7('0x4b')][_0xc1c7('0x3f')]){case _0xc1c7('0x50'):_0x456ac1[_0xc1c7('0x3f')]=db[_0xc1c7('0x4f')][_0xc1c7('0x51')];break;case _0xc1c7('0x52'):_0x456ac1[_0xc1c7('0x3f')]=db['Sequelize'][_0xc1c7('0x53')];break;case _0xc1c7('0x54'):_0x456ac1[_0xc1c7('0x3f')]=db['Sequelize']['BOOLEAN'];_0x456ac1[_0xc1c7('0x55')]=![];break;default:}return db[_0xc1c7('0x4d')][_0xc1c7('0x56')]['addColumn'](_0xc1c7('0x57'),util['format'](_0xc1c7('0x58'),_0x12a1d2['id']),_0x456ac1);})[_0xc1c7('0x27')](function(){return _0x12a1d2;});})[_0xc1c7('0x27')](respondWithResult(_0x49542,0xc9))[_0xc1c7('0x46')](handleError(_0x49542,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 51c3d0c..285814a 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 _0xb0d7=['path','rimraf','../../config/environment','CmCustomField','cm_custom_fields','lodash','util','api','moment','bluebird'];(function(_0x2320de,_0x4956a6){var _0x591180=function(_0x93dd18){while(--_0x93dd18){_0x2320de['push'](_0x2320de['shift']());}};_0x591180(++_0x4956a6);}(_0xb0d7,0x16d));var _0x7b0d=function(_0x3a782e,_0x41a23e){_0x3a782e=_0x3a782e-0x0;var _0x414a78=_0xb0d7[_0x3a782e];return _0x414a78;};'use strict';var _=require(_0x7b0d('0x0'));var util=require(_0x7b0d('0x1'));var logger=require('../../config/logger')(_0x7b0d('0x2'));var moment=require(_0x7b0d('0x3'));var BPromise=require(_0x7b0d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7b0d('0x5'));var rimraf=require(_0x7b0d('0x6'));var config=require(_0x7b0d('0x7'));var attributes=require('./cmCustomField.attributes');module['exports']=function(_0x196ae7,_0x52f953){return _0x196ae7['define'](_0x7b0d('0x8'),attributes,{'tableName':_0x7b0d('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb574=['bluebird','request-promise','path','rimraf','./cmCustomField.attributes','define','CmCustomField','cm_custom_fields','util','api'];(function(_0x21b99d,_0x46fbc9){var _0x31335a=function(_0x3985a8){while(--_0x3985a8){_0x21b99d['push'](_0x21b99d['shift']());}};_0x31335a(++_0x46fbc9);}(_0xb574,0x13e));var _0x4b57=function(_0x4871d9,_0x5b637a){_0x4871d9=_0x4871d9-0x0;var _0x5b0f9b=_0xb574[_0x4871d9];return _0x5b0f9b;};'use strict';var _=require('lodash');var util=require(_0x4b57('0x0'));var logger=require('../../config/logger')(_0x4b57('0x1'));var moment=require('moment');var BPromise=require(_0x4b57('0x2'));var rp=require(_0x4b57('0x3'));var fs=require('fs');var path=require(_0x4b57('0x4'));var rimraf=require(_0x4b57('0x5'));var config=require('../../config/environment');var attributes=require(_0x4b57('0x6'));module['exports']=function(_0x2ffb8c,_0x759ab1){return _0x2ffb8c[_0x4b57('0x7')](_0x4b57('0x8'),attributes,{'tableName':_0x4b57('0x9'),'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 c9f1324..db0da52 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 _0x07f1=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x07f1,0x111));var _0x107f=function(_0x449e76,_0x10a779){_0x449e76=_0x449e76-0x0;var _0x3563ae=_0x07f1[_0x449e76];return _0x3563ae;};'use strict';var _=require(_0x107f('0x0'));var util=require(_0x107f('0x1'));var moment=require(_0x107f('0x2'));var BPromise=require(_0x107f('0x3'));var rs=require(_0x107f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x107f('0x5'))['db'];var utils=require(_0x107f('0x6'));var logger=require(_0x107f('0x7'))('rpc');var config=require(_0x107f('0x8'));var jayson=require(_0x107f('0x9'));var client=jayson[_0x107f('0xa')][_0x107f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x49b7fd,_0xa84742,_0xd4dc2b){return new BPromise(function(_0x2d2de2,_0x2c7a04){return client[_0x107f('0xc')](_0x49b7fd,_0xd4dc2b)[_0x107f('0xd')](function(_0x2d3520){logger[_0x107f('0xe')](_0x107f('0xf'),_0xa84742,_0x107f('0x10'));logger[_0x107f('0x11')](_0x107f('0x12'),_0xa84742,_0x107f('0x10'),JSON[_0x107f('0x13')](_0x2d3520));if(_0x2d3520[_0x107f('0x14')]){if(_0x2d3520[_0x107f('0x14')][_0x107f('0x15')]===0x1f4){logger['error']('CmCustomField,\x20%s,\x20%s',_0xa84742,_0x2d3520[_0x107f('0x14')][_0x107f('0x16')]);return _0x2c7a04(_0x2d3520[_0x107f('0x14')][_0x107f('0x16')]);}logger[_0x107f('0x14')](_0x107f('0xf'),_0xa84742,_0x2d3520[_0x107f('0x14')][_0x107f('0x16')]);return _0x2d2de2(_0x2d3520[_0x107f('0x14')][_0x107f('0x16')]);}else{logger[_0x107f('0xe')](_0x107f('0xf'),_0xa84742,'request\x20sent');_0x2d2de2(_0x2d3520[_0x107f('0x17')][_0x107f('0x16')]);}})[_0x107f('0x18')](function(_0x553fb2){logger['error']('CmCustomField,\x20%s,\x20%s',_0xa84742,_0x553fb2);_0x2c7a04(_0x553fb2);});});} \ No newline at end of file +var _0x53e1=['jayson/promise','client','http','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0x53e1,0x16f));var _0x153e=function(_0x1a37e3,_0x5db8f6){_0x1a37e3=_0x1a37e3-0x0;var _0x4db78a=_0x53e1[_0x1a37e3];return _0x4db78a;};'use strict';var _=require(_0x153e('0x0'));var util=require('util');var moment=require(_0x153e('0x1'));var BPromise=require(_0x153e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x153e('0x3'))['db'];var utils=require(_0x153e('0x4'));var logger=require(_0x153e('0x5'))(_0x153e('0x6'));var config=require('../../config/environment');var jayson=require(_0x153e('0x7'));var client=jayson[_0x153e('0x8')][_0x153e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2d4b0c,_0x2e496e,_0x1689ba){return new BPromise(function(_0x515720,_0x370439){return client[_0x153e('0xa')](_0x2d4b0c,_0x1689ba)[_0x153e('0xb')](function(_0x33d182){logger[_0x153e('0xc')](_0x153e('0xd'),_0x2e496e,_0x153e('0xe'));logger[_0x153e('0xf')](_0x153e('0x10'),_0x2e496e,_0x153e('0xe'),JSON[_0x153e('0x11')](_0x33d182));if(_0x33d182['error']){if(_0x33d182['error'][_0x153e('0x12')]===0x1f4){logger[_0x153e('0x13')](_0x153e('0xd'),_0x2e496e,_0x33d182[_0x153e('0x13')]['message']);return _0x370439(_0x33d182[_0x153e('0x13')]['message']);}logger['error'](_0x153e('0xd'),_0x2e496e,_0x33d182['error'][_0x153e('0x14')]);return _0x515720(_0x33d182[_0x153e('0x13')]['message']);}else{logger[_0x153e('0xc')](_0x153e('0xd'),_0x2e496e,'request\x20sent');_0x515720(_0x33d182[_0x153e('0x15')]['message']);}})['catch'](function(_0x388bc9){logger['error'](_0x153e('0xd'),_0x2e496e,_0x388bc9);_0x370439(_0x388bc9);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 119c3fd..84501d2 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 _0xaa3f=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','show','post','put','delete','destroy','exports','multer','util','path'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0xaa3f,0xbb));var _0xfaa3=function(_0xfd104,_0x2cdcd7){_0xfd104=_0xfd104-0x0;var _0x513128=_0xaa3f[_0xfd104];return _0x513128;};'use strict';var multer=require(_0xfaa3('0x0'));var util=require(_0xfaa3('0x1'));var path=require(_0xfaa3('0x2'));var timeout=require(_0xfaa3('0x3'));var express=require(_0xfaa3('0x4'));var router=express[_0xfaa3('0x5')]();var fs_extra=require(_0xfaa3('0x6'));var auth=require(_0xfaa3('0x7'));var interaction=require(_0xfaa3('0x8'));var config=require('../../config/environment');var controller=require('./cmCustomField.controller');router[_0xfaa3('0x9')]('/',auth['isAuthenticated'](),controller[_0xfaa3('0xa')]);router[_0xfaa3('0x9')](_0xfaa3('0xb'),auth[_0xfaa3('0xc')](),controller[_0xfaa3('0xd')]);router[_0xfaa3('0xe')]('/',auth[_0xfaa3('0xc')](),controller['create']);router[_0xfaa3('0xf')](_0xfaa3('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xfaa3('0x10')](_0xfaa3('0xb'),auth[_0xfaa3('0xc')](),controller[_0xfaa3('0x11')]);module[_0xfaa3('0x12')]=router; \ No newline at end of file +var _0x76ed=['/:id','show','post','create','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index'];(function(_0x4d3b77,_0x3c789c){var _0x1a716a=function(_0x10707c){while(--_0x10707c){_0x4d3b77['push'](_0x4d3b77['shift']());}};_0x1a716a(++_0x3c789c);}(_0x76ed,0x1d0));var _0xd76e=function(_0x5340fb,_0x53d5a2){_0x5340fb=_0x5340fb-0x0;var _0x35701e=_0x76ed[_0x5340fb];return _0x35701e;};'use strict';var multer=require(_0xd76e('0x0'));var util=require(_0xd76e('0x1'));var path=require('path');var timeout=require(_0xd76e('0x2'));var express=require(_0xd76e('0x3'));var router=express[_0xd76e('0x4')]();var fs_extra=require(_0xd76e('0x5'));var auth=require(_0xd76e('0x6'));var interaction=require(_0xd76e('0x7'));var config=require('../../config/environment');var controller=require('./cmCustomField.controller');router[_0xd76e('0x8')]('/',auth[_0xd76e('0x9')](),controller[_0xd76e('0xa')]);router[_0xd76e('0x8')](_0xd76e('0xb'),auth[_0xd76e('0x9')](),controller[_0xd76e('0xc')]);router[_0xd76e('0xd')]('/',auth['isAuthenticated'](),controller[_0xd76e('0xe')]);router[_0xd76e('0xf')](_0xd76e('0xb'),auth[_0xd76e('0x9')](),controller['update']);router[_0xd76e('0x10')](_0xd76e('0xb'),auth['isAuthenticated'](),controller[_0xd76e('0x11')]);module[_0xd76e('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 7c831fe..f8fe449 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 _0x46e0=['BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','moment','sequelize','exports','STRING'];(function(_0x522980,_0x2a5e90){var _0x30c3e8=function(_0x2beb7c){while(--_0x2beb7c){_0x522980['push'](_0x522980['shift']());}};_0x30c3e8(++_0x2a5e90);}(_0x46e0,0xee));var _0x046e=function(_0xf44494,_0x137695){_0xf44494=_0xf44494-0x0;var _0x2b8b88=_0x46e0[_0xf44494];return _0x2b8b88;};'use strict';var moment=require(_0x046e('0x0'));var Sequelize=require(_0x046e('0x1'));module[_0x046e('0x2')]={'phone':{'type':Sequelize[_0x046e('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0x046e('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x046e('0x5')],'defaultValue':moment()[_0x046e('0x6')](_0x046e('0x7'))},'countbusyretry':{'type':Sequelize[_0x046e('0x8')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x046e('0x8')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x046e('0x8')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x046e('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x046e('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x046e('0x5')]},'priority':{'type':Sequelize[_0x046e('0x8')](0x2)[_0x046e('0x9')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x046e('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x046e('0xa')},'ListId':{'type':Sequelize[_0x046e('0x8')],'unique':_0x046e('0xa')},'UserId':{'type':Sequelize[_0x046e('0x8')]},'VoiceQueueId':{'type':Sequelize[_0x046e('0x8')],'unique':_0x046e('0xa')},'CampaignId':{'type':Sequelize[_0x046e('0x8')]},'countnosuchnumberretry':{'type':Sequelize[_0x046e('0x8')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x046e('0x8')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x046e('0x8')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x046e('0x8')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x046e('0x8')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']},'recallmeNotifiedDate':{'type':Sequelize[_0x046e('0x5')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0xbe7b=['sequelize','STRING','BOOLEAN','DATE','format','INTEGER','contactListQueue','moment'];(function(_0x3e633e,_0x17edd5){var _0x21794a=function(_0x12bac2){while(--_0x12bac2){_0x3e633e['push'](_0x3e633e['shift']());}};_0x21794a(++_0x17edd5);}(_0xbe7b,0x197));var _0xbbe7=function(_0x3f9a1b,_0x474051){_0x3f9a1b=_0x3f9a1b-0x0;var _0xb419cd=_0xbe7b[_0x3f9a1b];return _0xb419cd;};'use strict';var moment=require(_0xbbe7('0x0'));var Sequelize=require(_0xbbe7('0x1'));module['exports']={'phone':{'type':Sequelize[_0xbbe7('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0xbbe7('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xbbe7('0x4')],'defaultValue':moment()[_0xbbe7('0x5')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xbbe7('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xbbe7('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xbbe7('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xbbe7('0x4')]},'priority':{'type':Sequelize[_0xbbe7('0x6')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xbbe7('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0xbbe7('0x7')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0xbbe7('0x7')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0xbbe7('0x7')},'CampaignId':{'type':Sequelize[_0xbbe7('0x6')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xbbe7('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xbbe7('0x6')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0xbbe7('0x6')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xbbe7('0x2')]},'recallmeNotifiedDate':{'type':Sequelize[_0xbbe7('0x4')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index 590583f..05ad795 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 _0x495e=['$gt','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$like','$iLike','$notILike','$contains','$contained','$any','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','CmHopper','includeAll','include','findAll','rows','catch','keys','merge','find','create','body','update','destroy','params','CampaignId','VoiceQueue','Campaign','VoiceQueueId','omit','dataValues','createdAt','updatedAt','statedesc','deleted','campaign','membername','user','UserId','YYYY-MM-DD\x20HH:mm:ss','calleridnum','campaigntype','queue','ivr','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','CmHopperAdditionalPhone','end','getPreview','CmContact','describe','getVoiceQueues','outbound','preview','dialPreviewAutoRecallMe','transaction','format','value','direction','prev','isEmpty','hopperIds','priority','ASC','dialOrderByScheduledAt','DESC','sequelize','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','scheduledAt','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','recallme','UPDATE','Contact','CmCompany','Company','CmList','List','Queue','dialActive','getPreviewRecall','LOCK','getOpenContacts','isNumber','entity\x20not\x20found','sendStatus','getTimezones','timezones','push','getTimezone','moment','../../config/logger','api','../../config/environment','../../mysqldb','status','json','limit','count','offset','set','Content-Range','then','error','stack','send','index','map','fieldName','type','key','name','query','filters','intersection','model','concat','$and','$or'];(function(_0x17b989,_0x3b6190){var _0x1665fc=function(_0x19787d){while(--_0x19787d){_0x17b989['push'](_0x17b989['shift']());}};_0x1665fc(++_0x3b6190);}(_0x495e,0xfb));var _0xe495=function(_0x39ded1,_0xaee436){_0x39ded1=_0x39ded1-0x0;var _0x2e248e=_0x495e[_0x39ded1];return _0x2e248e;};'use strict';var moment=require(_0xe495('0x0'));var _=require('lodash');var qs=require('../../components/parsers/qs');var logger=require(_0xe495('0x1'))(_0xe495('0x2'));var shared=require(_0xe495('0x3'));var db=require(_0xe495('0x4'))['db'];function respondWithResult(_0x4e5ce9,_0x3f119c){_0x3f119c=_0x3f119c||0xc8;return function(_0x442101){if(_0x442101){return _0x4e5ce9[_0xe495('0x5')](_0x3f119c)[_0xe495('0x6')](_0x442101);}};}function respondWithFilteredResult(_0x130db3,_0x467a69){return function(_0x101a7e){if(_0x101a7e){var _0x5745e3=typeof _0x467a69['offset']==='undefined'&&typeof _0x467a69[_0xe495('0x7')]==='undefined';var _0x3dc66f=_0x101a7e[_0xe495('0x8')];var _0x15ff5c=_0x5745e3?0x0:_0x467a69[_0xe495('0x9')];var _0x2a38c7=_0x5745e3?_0x101a7e['count']:_0x467a69[_0xe495('0x9')]+_0x467a69[_0xe495('0x7')];var _0x2325ea;if(_0x2a38c7>=_0x3dc66f){_0x2a38c7=_0x3dc66f;_0x2325ea=0xc8;}else{_0x2325ea=0xce;}_0x130db3['status'](_0x2325ea);return _0x130db3[_0xe495('0xa')](_0xe495('0xb'),_0x15ff5c+'-'+_0x2a38c7+'/'+_0x3dc66f)['json'](_0x101a7e);}return null;};}function saveUpdates(_0x51c2d4,_0x1d73a5){return function(_0x13aedb){if(_0x13aedb){return _0x13aedb['update'](_0x51c2d4)[_0xe495('0xc')](function(_0x21654e){return _0x21654e;});}return null;};}function handleEntityNotFound(_0xab9c10,_0x14744d){return function(_0x2b5e19){if(!_0x2b5e19){_0xab9c10['sendStatus'](0x194);}return _0x2b5e19;};}function handleError(_0x3e2a09,_0x103c25){_0x103c25=_0x103c25||0x1f4;return function(_0x19d096){logger[_0xe495('0xd')](_0x19d096[_0xe495('0xe')]);if(_0x19d096['name']){delete _0x19d096['name'];}_0x3e2a09['status'](_0x103c25)[_0xe495('0xf')](_0x19d096);};}exports[_0xe495('0x10')]=function(_0x2aa692,_0x577fb7){var _0x1e602c={},_0x302ca0={},_0x3ba8cc={'count':0x0,'rows':[]};var _0x1ba7b2=_[_0xe495('0x11')](db['CmHopper']['rawAttributes'],function(_0x1ef900){return{'name':_0x1ef900[_0xe495('0x12')],'type':_0x1ef900[_0xe495('0x13')][_0xe495('0x14')]};});_0x302ca0['model']=_[_0xe495('0x11')](_0x1ba7b2,_0xe495('0x15'));_0x302ca0[_0xe495('0x16')]=_['keys'](_0x2aa692[_0xe495('0x16')]);_0x302ca0[_0xe495('0x17')]=_[_0xe495('0x18')](_0x302ca0[_0xe495('0x19')],_0x302ca0[_0xe495('0x16')]);_0x302ca0['filters']=_[_0xe495('0x1a')](_0x302ca0['filters'],[_0xe495('0x1b'),_0xe495('0x1c'),_0xe495('0x1d'),'$gte',_0xe495('0x1e'),_0xe495('0x1f'),_0xe495('0x20'),_0xe495('0x21'),_0xe495('0x22'),_0xe495('0x23'),_0xe495('0x24'),'$in','$notIn',_0xe495('0x25'),'$notLike',_0xe495('0x26'),_0xe495('0x27'),'$like','$overlap',_0xe495('0x28'),_0xe495('0x29'),_0xe495('0x2a')]);_0x1e602c[_0xe495('0x2b')]=_[_0xe495('0x18')](_0x302ca0[_0xe495('0x19')],qs[_0xe495('0x2c')](_0x2aa692[_0xe495('0x16')]['fields']));_0x1e602c['attributes']=_0x1e602c[_0xe495('0x2b')][_0xe495('0x2d')]?_0x1e602c[_0xe495('0x2b')]:_0x302ca0[_0xe495('0x19')];if(!_0x2aa692['query'][_0xe495('0x2e')](_0xe495('0x2f'))){_0x1e602c[_0xe495('0x7')]=qs[_0xe495('0x7')](_0x2aa692[_0xe495('0x16')][_0xe495('0x7')]);_0x1e602c[_0xe495('0x9')]=qs[_0xe495('0x9')](_0x2aa692[_0xe495('0x16')][_0xe495('0x9')]);}_0x1e602c[_0xe495('0x30')]=qs[_0xe495('0x31')](_0x2aa692[_0xe495('0x16')][_0xe495('0x31')]);_0x1e602c[_0xe495('0x32')]=qs['filters'](_[_0xe495('0x33')](_0x2aa692[_0xe495('0x16')],_0x302ca0['filters']),_0x1ba7b2);if(_0x2aa692[_0xe495('0x16')][_0xe495('0x34')]){_0x1e602c['where']=_['merge'](_0x1e602c[_0xe495('0x32')],{'$or':_[_0xe495('0x11')](_0x1ba7b2,function(_0x3b2b1e){if(_0x3b2b1e[_0xe495('0x13')]!=='VIRTUAL'){var _0x3c2003={};_0x3c2003[_0x3b2b1e[_0xe495('0x15')]]={'$like':'%'+_0x2aa692[_0xe495('0x16')]['filter']+'%'};return _0x3c2003;}})});}_0x1e602c=_['merge']({},_0x1e602c,_0x2aa692[_0xe495('0x35')]);var _0x5b6d05={'where':_0x1e602c[_0xe495('0x32')]};return db[_0xe495('0x36')]['count'](_0x5b6d05)['then'](function(_0x3fb1fe){_0x3ba8cc[_0xe495('0x8')]=_0x3fb1fe;if(_0x2aa692[_0xe495('0x16')][_0xe495('0x37')]){_0x1e602c[_0xe495('0x38')]=[{'all':!![]}];}return db[_0xe495('0x36')][_0xe495('0x39')](_0x1e602c);})[_0xe495('0xc')](function(_0x4384ee){_0x3ba8cc[_0xe495('0x3a')]=_0x4384ee;return _0x3ba8cc;})[_0xe495('0xc')](respondWithFilteredResult(_0x577fb7,_0x1e602c))[_0xe495('0x3b')](handleError(_0x577fb7,null));};exports['show']=function(_0x734667,_0x1f80af){var _0x232465={'raw':!![],'where':{'id':_0x734667['params']['id']}},_0x6cb073={};_0x6cb073[_0xe495('0x19')]=_[_0xe495('0x3c')](db['CmHopper']['rawAttributes']);_0x6cb073['query']=_[_0xe495('0x3c')](_0x734667[_0xe495('0x16')]);_0x6cb073[_0xe495('0x17')]=_[_0xe495('0x18')](_0x6cb073[_0xe495('0x19')],_0x6cb073[_0xe495('0x16')]);_0x232465['attributes']=_[_0xe495('0x18')](_0x6cb073[_0xe495('0x19')],qs[_0xe495('0x2c')](_0x734667[_0xe495('0x16')][_0xe495('0x2c')]));_0x232465[_0xe495('0x2b')]=_0x232465[_0xe495('0x2b')][_0xe495('0x2d')]?_0x232465[_0xe495('0x2b')]:_0x6cb073['model'];if(_0x734667['query'][_0xe495('0x37')]){_0x232465['include']=[{'all':!![]}];}_0x232465=_[_0xe495('0x3d')]({},_0x232465,_0x734667[_0xe495('0x35')]);return db['CmHopper'][_0xe495('0x3e')](_0x232465)['then'](handleEntityNotFound(_0x1f80af,null))['then'](respondWithResult(_0x1f80af,null))[_0xe495('0x3b')](handleError(_0x1f80af,null));};exports['create']=function(_0x41518b,_0x4d7f59){return db[_0xe495('0x36')][_0xe495('0x3f')](_0x41518b[_0xe495('0x40')],{})[_0xe495('0xc')](respondWithResult(_0x4d7f59,0xc9))[_0xe495('0x3b')](handleError(_0x4d7f59,null));};exports[_0xe495('0x41')]=function(_0x1f4999,_0x56b620){if(_0x1f4999[_0xe495('0x40')]['id']){delete _0x1f4999[_0xe495('0x40')]['id'];}return db['CmHopper'][_0xe495('0x3e')]({'where':{'id':_0x1f4999['params']['id']}})[_0xe495('0xc')](handleEntityNotFound(_0x56b620,null))[_0xe495('0xc')](saveUpdates(_0x1f4999[_0xe495('0x40')],null))[_0xe495('0xc')](respondWithResult(_0x56b620,null))['catch'](handleError(_0x56b620,null));};exports['describe']=function(_0x54a346,_0x3b3fb1){return db[_0xe495('0x36')]['describe']()[_0xe495('0xc')](respondWithResult(_0x3b3fb1,null))[_0xe495('0x3b')](handleError(_0x3b3fb1,null));};exports[_0xe495('0x42')]=function(_0x103953,_0x13fa96){var _0x11f801;var _0x215114=_0x103953['params']['id'];return db[_0xe495('0x36')][_0xe495('0x3e')]({'where':{'id':_0x103953[_0xe495('0x43')]['id']}})[_0xe495('0xc')](handleEntityNotFound(_0x13fa96,null))[_0xe495('0xc')](function(_0x4c366e){if(_0x4c366e){return _0x4c366e['destroy']()[_0xe495('0xc')](function(_0x19d7b7){return _0x19d7b7;});}})[_0xe495('0xc')](function(_0x53cd3f){_0x11f801=_0x53cd3f;if(_0x53cd3f){if(_0x53cd3f['VoiceQueueId']||_0x53cd3f[_0xe495('0x44')]){return db[_0x53cd3f['VoiceQueueId']?_0xe495('0x45'):_0xe495('0x46')]['find']({'where':{'id':_0x53cd3f[_0xe495('0x47')]?_0x53cd3f[_0xe495('0x47')]:_0x53cd3f[_0xe495('0x44')]},'attributes':['id',_0xe495('0x15')],'raw':!![]});}}})[_0xe495('0xc')](function(_0xb8959a){var _0x9b12f9={};if(_0xb8959a){_[_0xe495('0x3d')](_0x9b12f9,_[_0xe495('0x48')](_0x11f801[_0xe495('0x49')],[_0xe495('0x4a'),_0xe495('0x4b'),'id']));_0x9b12f9['state']=0x15;_0x9b12f9[_0xe495('0x4c')]=_0xe495('0x4d');_0x9b12f9[_0xe495('0x4e')]=_0xb8959a[_0xe495('0x15')];_0x9b12f9[_0xe495('0x4f')]=_0x103953[_0xe495('0x50')][_0xe495('0x15')];_0x9b12f9[_0xe495('0x51')]=_0x103953[_0xe495('0x50')]['id'];_0x9b12f9[_0xe495('0x4d')]=!![];_0x9b12f9['deletedat']=moment()['format'](_0xe495('0x52'));_0x9b12f9[_0xe495('0x53')]=_0x11f801['phone'];_0x9b12f9[_0xe495('0x54')]=_0x11f801[_0xe495('0x47')]?_0xe495('0x55'):_0xe495('0x56');return db['CmContact'][_0xe495('0x3e')]({'where':{'id':_0x9b12f9[_0xe495('0x57')]},'attributes':[_0xe495('0x58'),_0xe495('0x59')]})[_0xe495('0xc')](function(_0xfcfb7b){if(!_['isNil'](_0x13fa96)&&!_[_0xe495('0x5a')](_0xfcfb7b['firstName'])){_0x9b12f9[_0xe495('0x5b')]=_0xfcfb7b['firstName'];if(!_[_0xe495('0x5a')](_0xfcfb7b['lastName'])){_0x9b12f9[_0xe495('0x5b')]+='\x20'+_0xfcfb7b['lastName'];}}})[_0xe495('0x5c')](function(){return db[_0xe495('0x5d')]['create'](_0x9b12f9);});}})[_0xe495('0xc')](function(_0x1ccb69){return db[_0xe495('0x5e')][_0xe495('0x42')]({'where':{'CmHopperId':_0x215114}});})[_0xe495('0xc')](function(){return _0x13fa96[_0xe495('0x5')](0xcc)[_0xe495('0x5f')]();})[_0xe495('0x3b')](handleError(_0x13fa96,null));};exports[_0xe495('0x60')]=function(_0x11906c,_0x31493a){var _0x34bd9e=[];return db[_0xe495('0x61')][_0xe495('0x62')]()[_0xe495('0xc')](function(_0x45a768){_0x34bd9e=_[_0xe495('0x3c')](_0x45a768);return _0x11906c[_0xe495('0x50')][_0xe495('0x63')]({'where':{'type':_0xe495('0x64'),'dialActive':!![],'dialMethod':_0xe495('0x65')},'attributes':['id','dialOrderByScheduledAt',_0xe495('0x66')],'raw':!![]});})['then'](function(_0x3f0766){if(_0x3f0766&&_0x3f0766[_0xe495('0x2d')]){return db['sequelize'][_0xe495('0x67')](function(_0x5ea667){var _0x518419={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xe495('0x68')](_0xe495('0x52'))},'VoiceQueueId':{'$in':_['map'](_0x3f0766,'id')},'$or':[{'UserId':null},{'UserId':_0x11906c[_0xe495('0x50')]['id']}]};var _0x298c52={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x3f0766)[_0xe495('0x34')]([_0xe495('0x66'),0x0])['map']('id')[_0xe495('0x69')]()},'$or':[{'UserId':null},{'UserId':_0x11906c[_0xe495('0x50')]['id']}]};var _0x384ef0={'$or':[_0x518419,_0x298c52]};var _0x25175d=[];if(_0x11906c[_0xe495('0x40')]['direction']&&_0x11906c[_0xe495('0x40')][_0xe495('0x6a')]===_0xe495('0x6b')){if(!_[_0xe495('0x6c')](_0x11906c[_0xe495('0x40')]['hopperIds'])){_0x384ef0['id']={'$in':_0x11906c['body'][_0xe495('0x6d')]};}_0x25175d=[[_0xe495('0x6e'),_0xe495('0x6f')],['scheduledAt',_0x3f0766[0x0][_0xe495('0x70')]===_0xe495('0x6f')?_0xe495('0x71'):_0xe495('0x6f')],db[_0xe495('0x72')][_0xe495('0x73')](_0xe495('0x74')),['id',_0xe495('0x71')]];}else{if(!_['isEmpty'](_0x11906c[_0xe495('0x40')][_0xe495('0x6d')])){_0x384ef0['id']={'$notIn':_0x11906c[_0xe495('0x40')][_0xe495('0x6d')]};}_0x25175d=[['priority',_0xe495('0x71')],[_0xe495('0x75'),_0x3f0766[0x0]['dialOrderByScheduledAt']],db['sequelize'][_0xe495('0x73')](_0xe495('0x76')),['id',_0xe495('0x6f')]];}return db[_0xe495('0x36')][_0xe495('0x77')]({'attributes':['id',_0xe495('0x78'),'phone',_0xe495('0x79')],'where':_0x384ef0,'order':_0x25175d,'transaction':_0x5ea667,'lock':_0x5ea667['LOCK'][_0xe495('0x7a')],'include':[{'model':db[_0xe495('0x61')],'as':_0xe495('0x7b'),'attributes':_0x34bd9e,'include':[{'model':db[_0xe495('0x7c')],'as':_0xe495('0x7d'),'attributes':['id','name']}]},{'model':db[_0xe495('0x7e')],'as':_0xe495('0x7f'),'attributes':['id','name']},{'model':db[_0xe495('0x45')],'as':_0xe495('0x80'),'attributes':['id','name',_0xe495('0x81')]}]})[_0xe495('0xc')](function(_0x738b2d){if(_0x738b2d){return _0x738b2d[_0xe495('0x41')]({'UserId':_0x11906c[_0xe495('0x50')]['id']},{'transaction':_0x5ea667});}});});}})[_0xe495('0xc')](handleEntityNotFound(_0x31493a,null))[_0xe495('0xc')](respondWithResult(_0x31493a,null))['catch'](handleError(_0x31493a,null));};exports[_0xe495('0x82')]=function(_0x27525e,_0x4eb2fe,_0x33ea8b){var _0xd2806e=[];var _0x175682=_0x27525e[_0xe495('0x43')]['id'];var _0x5aa77c=_0x27525e['user']['id'];return db[_0xe495('0x61')][_0xe495('0x62')]()[_0xe495('0xc')](function(_0x5a913c){_0xd2806e=_[_0xe495('0x3c')](_0x5a913c);return db[_0xe495('0x72')][_0xe495('0x67')](function(_0x159d1f){const _0x18600f={'id':_0x175682};return db[_0xe495('0x36')][_0xe495('0x77')]({'attributes':['id',_0xe495('0x78'),_0xe495('0x79')],'where':_0x18600f,'transaction':_0x159d1f,'lock':_0x159d1f[_0xe495('0x83')]['UPDATE'],'include':[{'model':db['CmContact'],'as':_0xe495('0x7b'),'attributes':_0xd2806e,'include':[{'model':db[_0xe495('0x7c')],'as':'Company','attributes':['id',_0xe495('0x15')]}]},{'model':db[_0xe495('0x7e')],'as':_0xe495('0x7f'),'attributes':['id',_0xe495('0x15')]},{'model':db['VoiceQueue'],'as':'Queue','attributes':['id','name',_0xe495('0x81')]}]})[_0xe495('0xc')](function(_0x18209d){if(_0x18209d){return _0x18209d[_0xe495('0x41')]({'UserId':_0x5aa77c},{'transaction':_0x159d1f});}});});})[_0xe495('0xc')](handleEntityNotFound(_0x4eb2fe,null))[_0xe495('0xc')](respondWithResult(_0x4eb2fe,null))[_0xe495('0x3b')](handleError(_0x4eb2fe,null));};exports[_0xe495('0x84')]=function(_0x52715e,_0x288462){return _0x52715e[_0xe495('0x50')][_0xe495('0x63')]({'where':{'type':_0xe495('0x64'),'dialActive':!![],'dialMethod':_0xe495('0x65')},'attributes':['id'],'raw':!![]})[_0xe495('0xc')](function(_0x4281aa){if(_0x4281aa&&_0x4281aa[_0xe495('0x2d')]){return db[_0xe495('0x36')][_0xe495('0x8')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xe495('0x68')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0xe495('0x11')](_0x4281aa,'id')},'$or':[{'UserId':null},{'UserId':_0x52715e[_0xe495('0x50')]['id']}]}});}return 0x0;})[_0xe495('0xc')](function(_0x2002d7){if(!_[_0xe495('0x5a')](_0x2002d7)&&_[_0xe495('0x85')](_0x2002d7)){return _0x288462['status'](0xc8)[_0xe495('0x6')]({'contacts':_0x2002d7});}else{logger[_0xe495('0xd')]('CmHopper,\x20%s,\x20%s,\x20%s',_0xe495('0x84'),0x194,_0xe495('0x86'));_0x288462[_0xe495('0x87')](0x194);}})[_0xe495('0x3b')](handleError(_0x288462,null));};exports[_0xe495('0x88')]=function(_0xe9cc59,_0x45e263){var _0x543b33=shared[_0xe495('0x89')];var _0x5a72cd=[];_[_0xe495('0x11')](_0x543b33,function(_0x7d2729){_0x5a72cd[_0xe495('0x8a')]({'id':_0x7d2729['name'],'name':_0x7d2729[_0xe495('0x15')],'utcOffset':_0x7d2729['utcOffset']});});return _0x45e263[_0xe495('0x5')](0xc8)[_0xe495('0x6')]({'tz':_0x5a72cd});};exports[_0xe495('0x8b')]=function(_0x1ef812,_0x801f5f){var _0xaf9358=shared[_0xe495('0x89')];var _0x4dc595={};if(!_[_0xe495('0x5a')](_0xaf9358[_0x1ef812[_0xe495('0x40')]['id']]))_0x4dc595=_0xaf9358[_0x1ef812[_0xe495('0x40')]['id']];return _0x801f5f[_0xe495('0x5')](0xc8)[_0xe495('0x6')](_0x4dc595);}; \ No newline at end of file +var _0x5577=['Campaign','omit','createdAt','updatedAt','state','statedesc','deleted','membername','user','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','CmContact','lastName','isNil','firstName','calleridname','finally','CmHopperFinal','CmHopperAdditionalPhone','end','getPreview','getVoiceQueues','outbound','preview','dialPreviewAutoRecallMe','length','sequelize','transaction','value','direction','isEmpty','hopperIds','priority','ASC','scheduledAt','DESC','COALESCE(CmHopper.UserId,\x200)\x20ASC','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','UPDATE','CmCompany','Company','List','Queue','dialActive','LOCK','Contact','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','push','utcOffset','getTimezone','timezones','moment','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','json','update','then','sendStatus','error','stack','name','CmHopper','rawAttributes','fieldName','key','model','map','query','intersection','filters','concat','$and','$or','$gt','$lt','$ne','$not','$between','$notBetween','$in','$like','$iLike','$notILike','$contains','$contained','$any','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','rows','params','keys','include','find','create','body','catch','describe','destroy','VoiceQueueId','CampaignId','VoiceQueue'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x5577,0x1b4));var _0x7557=function(_0x9bc1d4,_0x4fdf10){_0x9bc1d4=_0x9bc1d4-0x0;var _0x258c19=_0x5577[_0x9bc1d4];return _0x258c19;};'use strict';var moment=require(_0x7557('0x0'));var _=require('lodash');var qs=require(_0x7557('0x1'));var logger=require(_0x7557('0x2'))('api');var shared=require(_0x7557('0x3'));var db=require(_0x7557('0x4'))['db'];function respondWithResult(_0x25c0da,_0x3c4697){_0x3c4697=_0x3c4697||0xc8;return function(_0x1274d5){if(_0x1274d5){return _0x25c0da[_0x7557('0x5')](_0x3c4697)['json'](_0x1274d5);}};}function respondWithFilteredResult(_0x7bb8c,_0x41a4a5){return function(_0x3da895){if(_0x3da895){var _0x1446fd=typeof _0x41a4a5[_0x7557('0x6')]===_0x7557('0x7')&&typeof _0x41a4a5[_0x7557('0x8')]===_0x7557('0x7');var _0x166f43=_0x3da895[_0x7557('0x9')];var _0x98b346=_0x1446fd?0x0:_0x41a4a5[_0x7557('0x6')];var _0x3c7986=_0x1446fd?_0x3da895[_0x7557('0x9')]:_0x41a4a5[_0x7557('0x6')]+_0x41a4a5['limit'];var _0x4d92d9;if(_0x3c7986>=_0x166f43){_0x3c7986=_0x166f43;_0x4d92d9=0xc8;}else{_0x4d92d9=0xce;}_0x7bb8c[_0x7557('0x5')](_0x4d92d9);return _0x7bb8c[_0x7557('0xa')](_0x7557('0xb'),_0x98b346+'-'+_0x3c7986+'/'+_0x166f43)[_0x7557('0xc')](_0x3da895);}return null;};}function saveUpdates(_0xb6ed30,_0x467ac5){return function(_0x156ac1){if(_0x156ac1){return _0x156ac1[_0x7557('0xd')](_0xb6ed30)[_0x7557('0xe')](function(_0x926138){return _0x926138;});}return null;};}function handleEntityNotFound(_0x5468df,_0x276031){return function(_0x3fb7a6){if(!_0x3fb7a6){_0x5468df[_0x7557('0xf')](0x194);}return _0x3fb7a6;};}function handleError(_0x519549,_0x3ad3a1){_0x3ad3a1=_0x3ad3a1||0x1f4;return function(_0x3c3953){logger[_0x7557('0x10')](_0x3c3953[_0x7557('0x11')]);if(_0x3c3953['name']){delete _0x3c3953[_0x7557('0x12')];}_0x519549[_0x7557('0x5')](_0x3ad3a1)['send'](_0x3c3953);};}exports['index']=function(_0x41b3db,_0x11f186){var _0x10edc3={},_0x40a81b={},_0x5c1774={'count':0x0,'rows':[]};var _0x16bb9b=_['map'](db[_0x7557('0x13')][_0x7557('0x14')],function(_0x1515ea){return{'name':_0x1515ea[_0x7557('0x15')],'type':_0x1515ea['type'][_0x7557('0x16')]};});_0x40a81b[_0x7557('0x17')]=_[_0x7557('0x18')](_0x16bb9b,_0x7557('0x12'));_0x40a81b[_0x7557('0x19')]=_['keys'](_0x41b3db['query']);_0x40a81b['filters']=_[_0x7557('0x1a')](_0x40a81b['model'],_0x40a81b[_0x7557('0x19')]);_0x40a81b[_0x7557('0x1b')]=_[_0x7557('0x1c')](_0x40a81b[_0x7557('0x1b')],[_0x7557('0x1d'),_0x7557('0x1e'),_0x7557('0x1f'),'$gte',_0x7557('0x20'),'$lte',_0x7557('0x21'),'$eq',_0x7557('0x22'),_0x7557('0x23'),_0x7557('0x24'),_0x7557('0x25'),'$notIn',_0x7557('0x26'),'$notLike',_0x7557('0x27'),_0x7557('0x28'),_0x7557('0x26'),'$overlap',_0x7557('0x29'),_0x7557('0x2a'),_0x7557('0x2b')]);_0x10edc3[_0x7557('0x2c')]=_[_0x7557('0x1a')](_0x40a81b[_0x7557('0x17')],qs['fields'](_0x41b3db[_0x7557('0x19')][_0x7557('0x2d')]));_0x10edc3[_0x7557('0x2c')]=_0x10edc3[_0x7557('0x2c')]['length']?_0x10edc3[_0x7557('0x2c')]:_0x40a81b[_0x7557('0x17')];if(!_0x41b3db[_0x7557('0x19')][_0x7557('0x2e')](_0x7557('0x2f'))){_0x10edc3[_0x7557('0x8')]=qs[_0x7557('0x8')](_0x41b3db[_0x7557('0x19')][_0x7557('0x8')]);_0x10edc3[_0x7557('0x6')]=qs[_0x7557('0x6')](_0x41b3db[_0x7557('0x19')][_0x7557('0x6')]);}_0x10edc3[_0x7557('0x30')]=qs[_0x7557('0x31')](_0x41b3db[_0x7557('0x19')][_0x7557('0x31')]);_0x10edc3[_0x7557('0x32')]=qs[_0x7557('0x1b')](_[_0x7557('0x33')](_0x41b3db[_0x7557('0x19')],_0x40a81b[_0x7557('0x1b')]),_0x16bb9b);if(_0x41b3db['query'][_0x7557('0x34')]){_0x10edc3['where']=_['merge'](_0x10edc3[_0x7557('0x32')],{'$or':_['map'](_0x16bb9b,function(_0x24dd31){if(_0x24dd31['type']!=='VIRTUAL'){var _0x2eaeaa={};_0x2eaeaa[_0x24dd31[_0x7557('0x12')]]={'$like':'%'+_0x41b3db[_0x7557('0x19')]['filter']+'%'};return _0x2eaeaa;}})});}_0x10edc3=_[_0x7557('0x35')]({},_0x10edc3,_0x41b3db[_0x7557('0x36')]);var _0x239454={'where':_0x10edc3[_0x7557('0x32')]};return db[_0x7557('0x13')][_0x7557('0x9')](_0x239454)[_0x7557('0xe')](function(_0x32c22b){_0x5c1774['count']=_0x32c22b;if(_0x41b3db['query']['includeAll']){_0x10edc3['include']=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x10edc3);})[_0x7557('0xe')](function(_0x2ad88e){_0x5c1774[_0x7557('0x37')]=_0x2ad88e;return _0x5c1774;})[_0x7557('0xe')](respondWithFilteredResult(_0x11f186,_0x10edc3))['catch'](handleError(_0x11f186,null));};exports['show']=function(_0x3c7e08,_0x338d90){var _0x962488={'raw':!![],'where':{'id':_0x3c7e08[_0x7557('0x38')]['id']}},_0x2bd51a={};_0x2bd51a['model']=_[_0x7557('0x39')](db[_0x7557('0x13')][_0x7557('0x14')]);_0x2bd51a[_0x7557('0x19')]=_[_0x7557('0x39')](_0x3c7e08[_0x7557('0x19')]);_0x2bd51a[_0x7557('0x1b')]=_['intersection'](_0x2bd51a[_0x7557('0x17')],_0x2bd51a[_0x7557('0x19')]);_0x962488[_0x7557('0x2c')]=_[_0x7557('0x1a')](_0x2bd51a['model'],qs[_0x7557('0x2d')](_0x3c7e08[_0x7557('0x19')][_0x7557('0x2d')]));_0x962488['attributes']=_0x962488[_0x7557('0x2c')]['length']?_0x962488[_0x7557('0x2c')]:_0x2bd51a['model'];if(_0x3c7e08[_0x7557('0x19')]['includeAll']){_0x962488[_0x7557('0x3a')]=[{'all':!![]}];}_0x962488=_[_0x7557('0x35')]({},_0x962488,_0x3c7e08[_0x7557('0x36')]);return db[_0x7557('0x13')][_0x7557('0x3b')](_0x962488)[_0x7557('0xe')](handleEntityNotFound(_0x338d90,null))['then'](respondWithResult(_0x338d90,null))['catch'](handleError(_0x338d90,null));};exports['create']=function(_0x2a4188,_0x3dee0c){return db[_0x7557('0x13')][_0x7557('0x3c')](_0x2a4188[_0x7557('0x3d')],{})['then'](respondWithResult(_0x3dee0c,0xc9))[_0x7557('0x3e')](handleError(_0x3dee0c,null));};exports['update']=function(_0x3e86e8,_0x321d62){if(_0x3e86e8[_0x7557('0x3d')]['id']){delete _0x3e86e8[_0x7557('0x3d')]['id'];}return db[_0x7557('0x13')][_0x7557('0x3b')]({'where':{'id':_0x3e86e8[_0x7557('0x38')]['id']}})[_0x7557('0xe')](handleEntityNotFound(_0x321d62,null))['then'](saveUpdates(_0x3e86e8[_0x7557('0x3d')],null))[_0x7557('0xe')](respondWithResult(_0x321d62,null))[_0x7557('0x3e')](handleError(_0x321d62,null));};exports['describe']=function(_0xb25031,_0x5cad65){return db['CmHopper'][_0x7557('0x3f')]()[_0x7557('0xe')](respondWithResult(_0x5cad65,null))[_0x7557('0x3e')](handleError(_0x5cad65,null));};exports[_0x7557('0x40')]=function(_0x3683c9,_0x4d9b43){var _0x2b8a99;var _0x23468c=_0x3683c9[_0x7557('0x38')]['id'];return db[_0x7557('0x13')][_0x7557('0x3b')]({'where':{'id':_0x3683c9[_0x7557('0x38')]['id']}})[_0x7557('0xe')](handleEntityNotFound(_0x4d9b43,null))['then'](function(_0x4e7f2c){if(_0x4e7f2c){return _0x4e7f2c['destroy']()['then'](function(_0x2b85c5){return _0x2b85c5;});}})[_0x7557('0xe')](function(_0x3212c7){_0x2b8a99=_0x3212c7;if(_0x3212c7){if(_0x3212c7[_0x7557('0x41')]||_0x3212c7[_0x7557('0x42')]){return db[_0x3212c7[_0x7557('0x41')]?_0x7557('0x43'):_0x7557('0x44')]['find']({'where':{'id':_0x3212c7[_0x7557('0x41')]?_0x3212c7[_0x7557('0x41')]:_0x3212c7['CampaignId']},'attributes':['id',_0x7557('0x12')],'raw':!![]});}}})['then'](function(_0x121057){var _0x5bc7f8={};if(_0x121057){_[_0x7557('0x35')](_0x5bc7f8,_[_0x7557('0x45')](_0x2b8a99['dataValues'],[_0x7557('0x46'),_0x7557('0x47'),'id']));_0x5bc7f8[_0x7557('0x48')]=0x15;_0x5bc7f8[_0x7557('0x49')]=_0x7557('0x4a');_0x5bc7f8['campaign']=_0x121057[_0x7557('0x12')];_0x5bc7f8[_0x7557('0x4b')]=_0x3683c9[_0x7557('0x4c')][_0x7557('0x12')];_0x5bc7f8['UserId']=_0x3683c9['user']['id'];_0x5bc7f8[_0x7557('0x4a')]=!![];_0x5bc7f8['deletedat']=moment()[_0x7557('0x4d')](_0x7557('0x4e'));_0x5bc7f8[_0x7557('0x4f')]=_0x2b8a99[_0x7557('0x50')];_0x5bc7f8['campaigntype']=_0x2b8a99[_0x7557('0x41')]?'queue':'ivr';return db[_0x7557('0x51')][_0x7557('0x3b')]({'where':{'id':_0x5bc7f8['ContactId']},'attributes':['firstName',_0x7557('0x52')]})[_0x7557('0xe')](function(_0x2109f7){if(!_[_0x7557('0x53')](_0x4d9b43)&&!_[_0x7557('0x53')](_0x2109f7[_0x7557('0x54')])){_0x5bc7f8['calleridname']=_0x2109f7['firstName'];if(!_['isNil'](_0x2109f7[_0x7557('0x52')])){_0x5bc7f8[_0x7557('0x55')]+='\x20'+_0x2109f7[_0x7557('0x52')];}}})[_0x7557('0x56')](function(){return db[_0x7557('0x57')][_0x7557('0x3c')](_0x5bc7f8);});}})['then'](function(_0x211467){return db[_0x7557('0x58')][_0x7557('0x40')]({'where':{'CmHopperId':_0x23468c}});})[_0x7557('0xe')](function(){return _0x4d9b43[_0x7557('0x5')](0xcc)[_0x7557('0x59')]();})[_0x7557('0x3e')](handleError(_0x4d9b43,null));};exports[_0x7557('0x5a')]=function(_0x558cf0,_0x586645){var _0x17fa97=[];return db['CmContact'][_0x7557('0x3f')]()[_0x7557('0xe')](function(_0x5c2d0d){_0x17fa97=_['keys'](_0x5c2d0d);return _0x558cf0['user'][_0x7557('0x5b')]({'where':{'type':_0x7557('0x5c'),'dialActive':!![],'dialMethod':_0x7557('0x5d')},'attributes':['id','dialOrderByScheduledAt',_0x7557('0x5e')],'raw':!![]});})[_0x7557('0xe')](function(_0x5df751){if(_0x5df751&&_0x5df751[_0x7557('0x5f')]){return db[_0x7557('0x60')][_0x7557('0x61')](function(_0x10b7d8){var _0x5df5dd={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x7557('0x4d')](_0x7557('0x4e'))},'VoiceQueueId':{'$in':_[_0x7557('0x18')](_0x5df751,'id')},'$or':[{'UserId':null},{'UserId':_0x558cf0['user']['id']}]};var _0x576665={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x5df751)['filter']([_0x7557('0x5e'),0x0])[_0x7557('0x18')]('id')[_0x7557('0x62')]()},'$or':[{'UserId':null},{'UserId':_0x558cf0[_0x7557('0x4c')]['id']}]};var _0x5e333c={'$or':[_0x5df5dd,_0x576665]};var _0xec14bb=[];if(_0x558cf0[_0x7557('0x3d')][_0x7557('0x63')]&&_0x558cf0[_0x7557('0x3d')][_0x7557('0x63')]==='prev'){if(!_[_0x7557('0x64')](_0x558cf0[_0x7557('0x3d')]['hopperIds'])){_0x5e333c['id']={'$in':_0x558cf0[_0x7557('0x3d')][_0x7557('0x65')]};}_0xec14bb=[[_0x7557('0x66'),_0x7557('0x67')],[_0x7557('0x68'),_0x5df751[0x0]['dialOrderByScheduledAt']===_0x7557('0x67')?_0x7557('0x69'):_0x7557('0x67')],db[_0x7557('0x60')]['literal'](_0x7557('0x6a')),['id',_0x7557('0x69')]];}else{if(!_[_0x7557('0x64')](_0x558cf0[_0x7557('0x3d')]['hopperIds'])){_0x5e333c['id']={'$notIn':_0x558cf0[_0x7557('0x3d')][_0x7557('0x65')]};}_0xec14bb=[[_0x7557('0x66'),'DESC'],[_0x7557('0x68'),_0x5df751[0x0]['dialOrderByScheduledAt']],db[_0x7557('0x60')][_0x7557('0x6b')](_0x7557('0x6c')),['id',_0x7557('0x67')]];}return db[_0x7557('0x13')][_0x7557('0x6d')]({'attributes':['id',_0x7557('0x6e'),'phone','recallme'],'where':_0x5e333c,'order':_0xec14bb,'transaction':_0x10b7d8,'lock':_0x10b7d8['LOCK'][_0x7557('0x6f')],'include':[{'model':db[_0x7557('0x51')],'as':'Contact','attributes':_0x17fa97,'include':[{'model':db[_0x7557('0x70')],'as':_0x7557('0x71'),'attributes':['id',_0x7557('0x12')]}]},{'model':db['CmList'],'as':_0x7557('0x72'),'attributes':['id','name']},{'model':db[_0x7557('0x43')],'as':_0x7557('0x73'),'attributes':['id',_0x7557('0x12'),_0x7557('0x74')]}]})[_0x7557('0xe')](function(_0x359dbe){if(_0x359dbe){return _0x359dbe['update']({'UserId':_0x558cf0['user']['id']},{'transaction':_0x10b7d8});}});});}})[_0x7557('0xe')](handleEntityNotFound(_0x586645,null))[_0x7557('0xe')](respondWithResult(_0x586645,null))[_0x7557('0x3e')](handleError(_0x586645,null));};exports['getPreviewRecall']=function(_0x2437a3,_0x1e6873,_0x4968dd){var _0x5ad6ba=[];var _0x400767=_0x2437a3[_0x7557('0x38')]['id'];var _0x490667=_0x2437a3[_0x7557('0x4c')]['id'];return db['CmContact'][_0x7557('0x3f')]()[_0x7557('0xe')](function(_0x126f7b){_0x5ad6ba=_[_0x7557('0x39')](_0x126f7b);return db[_0x7557('0x60')][_0x7557('0x61')](function(_0x1a03ed){const _0x4c018e={'id':_0x400767};return db['CmHopper'][_0x7557('0x6d')]({'attributes':['id','scheduledat','recallme'],'where':_0x4c018e,'transaction':_0x1a03ed,'lock':_0x1a03ed[_0x7557('0x75')][_0x7557('0x6f')],'include':[{'model':db[_0x7557('0x51')],'as':_0x7557('0x76'),'attributes':_0x5ad6ba,'include':[{'model':db[_0x7557('0x70')],'as':_0x7557('0x71'),'attributes':['id',_0x7557('0x12')]}]},{'model':db['CmList'],'as':_0x7557('0x72'),'attributes':['id',_0x7557('0x12')]},{'model':db[_0x7557('0x43')],'as':'Queue','attributes':['id','name',_0x7557('0x74')]}]})[_0x7557('0xe')](function(_0x41004c){if(_0x41004c){return _0x41004c[_0x7557('0xd')]({'UserId':_0x490667},{'transaction':_0x1a03ed});}});});})[_0x7557('0xe')](handleEntityNotFound(_0x1e6873,null))[_0x7557('0xe')](respondWithResult(_0x1e6873,null))['catch'](handleError(_0x1e6873,null));};exports['getOpenContacts']=function(_0x25107f,_0x27e0f9){return _0x25107f[_0x7557('0x4c')]['getVoiceQueues']({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x7557('0x5d')},'attributes':['id'],'raw':!![]})[_0x7557('0xe')](function(_0x18af3){if(_0x18af3&&_0x18af3[_0x7557('0x5f')]){return db[_0x7557('0x13')]['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x7557('0x4d')](_0x7557('0x4e'))},'VoiceQueueId':{'$in':_['map'](_0x18af3,'id')},'$or':[{'UserId':null},{'UserId':_0x25107f[_0x7557('0x4c')]['id']}]}});}return 0x0;})['then'](function(_0x5d981f){if(!_[_0x7557('0x53')](_0x5d981f)&&_['isNumber'](_0x5d981f)){return _0x27e0f9['status'](0xc8)['json']({'contacts':_0x5d981f});}else{logger[_0x7557('0x10')](_0x7557('0x77'),'getOpenContacts',0x194,_0x7557('0x78'));_0x27e0f9['sendStatus'](0x194);}})[_0x7557('0x3e')](handleError(_0x27e0f9,null));};exports[_0x7557('0x79')]=function(_0xba3dcf,_0x46fc3b){var _0x30d952=shared['timezones'];var _0x2886b3=[];_[_0x7557('0x18')](_0x30d952,function(_0xba06bf){_0x2886b3[_0x7557('0x7a')]({'id':_0xba06bf[_0x7557('0x12')],'name':_0xba06bf[_0x7557('0x12')],'utcOffset':_0xba06bf[_0x7557('0x7b')]});});return _0x46fc3b[_0x7557('0x5')](0xc8)[_0x7557('0xc')]({'tz':_0x2886b3});};exports[_0x7557('0x7c')]=function(_0x4fd3e5,_0x34a327){var _0x3df70b=shared[_0x7557('0x7d')];var _0x25935d={};if(!_[_0x7557('0x53')](_0x3df70b[_0x4fd3e5[_0x7557('0x3d')]['id']]))_0x25935d=_0x3df70b[_0x4fd3e5['body']['id']];return _0x34a327['status'](0xc8)[_0x7557('0xc')](_0x25935d);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index a8c3556..e1cfa67 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 _0xafc4=['priority','lodash','../../config/logger','moment','bluebird','request-promise','path','exports','define','CmHopper','cm_hopper','scheduledat','phone'];(function(_0x48de11,_0x5c274e){var _0x5ccb5e=function(_0x22fa99){while(--_0x22fa99){_0x48de11['push'](_0x48de11['shift']());}};_0x5ccb5e(++_0x5c274e);}(_0xafc4,0x69));var _0x4afc=function(_0x15bf38,_0x4cba4c){_0x15bf38=_0x15bf38-0x0;var _0x4e218f=_0xafc4[_0x15bf38];return _0x4e218f;};'use strict';var _=require(_0x4afc('0x0'));var util=require('util');var logger=require(_0x4afc('0x1'))('api');var moment=require(_0x4afc('0x2'));var BPromise=require(_0x4afc('0x3'));var rp=require(_0x4afc('0x4'));var fs=require('fs');var path=require(_0x4afc('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cmHopper.attributes');module[_0x4afc('0x6')]=function(_0x471d45,_0x16953b){return _0x471d45[_0x4afc('0x7')](_0x4afc('0x8'),attributes,{'tableName':_0x4afc('0x9'),'paranoid':![],'indexes':[{'name':'scheduledat','fields':[_0x4afc('0xa')]},{'name':_0x4afc('0xb'),'fields':[_0x4afc('0xb')]},{'name':_0x4afc('0xc'),'fields':[_0x4afc('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xeda8=['exports','define','cm_hopper','scheduledat','phone','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes'];(function(_0x179039,_0x1fb713){var _0xeb427=function(_0x307847){while(--_0x307847){_0x179039['push'](_0x179039['shift']());}};_0xeb427(++_0x1fb713);}(_0xeda8,0x104));var _0x8eda=function(_0xc79a8d,_0x1a2dee){_0xc79a8d=_0xc79a8d-0x0;var _0x385427=_0xeda8[_0xc79a8d];return _0x385427;};'use strict';var _=require(_0x8eda('0x0'));var util=require(_0x8eda('0x1'));var logger=require('../../config/logger')(_0x8eda('0x2'));var moment=require(_0x8eda('0x3'));var BPromise=require(_0x8eda('0x4'));var rp=require(_0x8eda('0x5'));var fs=require('fs');var path=require(_0x8eda('0x6'));var rimraf=require(_0x8eda('0x7'));var config=require(_0x8eda('0x8'));var attributes=require(_0x8eda('0x9'));module[_0x8eda('0xa')]=function(_0x1f3556,_0x349361){return _0x1f3556[_0x8eda('0xb')]('CmHopper',attributes,{'tableName':_0x8eda('0xc'),'paranoid':![],'indexes':[{'name':_0x8eda('0xd'),'fields':[_0x8eda('0xd')]},{'name':_0x8eda('0xe'),'fields':['phone']},{'name':'priority','fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 8716ecb..4e31765 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 _0x719a=['\x20,\x201,\x20null','contactsRescheduled','describe','update','GetContactRecallMe','GetCmHopperPreview','Contact','GetContactByPhone','findOne','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','interval','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','NOW()','name','CmList','List','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','GetCmHopper','CmHopper','options','raw','where','attributes','limit','include','map','model','debug','catch','error','message','ShowCmHopper','find','then','info','stringify','CreateCmHopper','create','body','UpdateCmHopper','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','destroy','DestroyCmHopper','CmContact','sequelize','transaction','order','LOCK','UPDATE','keys','User','Agent','length','UserId','includes','push','all','GetContactDialer','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','MoveContactManagedDialer','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','CountReScheduled','findAll','literal','`scheduledat`\x20>=\x20','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x719a,0x110));var _0xa719=function(_0x252cee,_0x1308fb){_0x252cee=_0x252cee-0x0;var _0x2e0a1b=_0x719a[_0x252cee];return _0x2e0a1b;};'use strict';var _=require(_0xa719('0x0'));var util=require(_0xa719('0x1'));var moment=require(_0xa719('0x2'));var BPromise=require(_0xa719('0x3'));var db=require(_0xa719('0x4'))['db'];var logger=require(_0xa719('0x5'))('rpc');exports[_0xa719('0x6')]=function(_0x514e60){var _0x40f7d3=this;return new Promise(function(_0x4dd032,_0x4f89ce){return db[_0xa719('0x7')]['findAll']({'raw':_0x514e60[_0xa719('0x8')]?_0x514e60[_0xa719('0x8')][_0xa719('0x9')]===undefined?!![]:![]:!![],'where':_0x514e60[_0xa719('0x8')]?_0x514e60[_0xa719('0x8')][_0xa719('0xa')]||null:null,'attributes':_0x514e60[_0xa719('0x8')]?_0x514e60['options'][_0xa719('0xb')]||null:null,'limit':_0x514e60['options']?_0x514e60[_0xa719('0x8')][_0xa719('0xc')]||null:null,'include':_0x514e60[_0xa719('0x8')]?_0x514e60[_0xa719('0x8')][_0xa719('0xd')]?_[_0xa719('0xe')](_0x514e60[_0xa719('0x8')][_0xa719('0xd')],function(_0x570e02){return{'model':db[_0x570e02['model']],'as':_0x570e02['as'],'attributes':_0x570e02[_0xa719('0xb')],'include':_0x570e02['include']?_[_0xa719('0xe')](_0x570e02[_0xa719('0xd')],function(_0x278ca4){return{'model':db[_0x278ca4['model']],'as':_0x278ca4['as'],'attributes':_0x278ca4[_0xa719('0xb')],'include':_0x278ca4[_0xa719('0xd')]?_[_0xa719('0xe')](_0x278ca4[_0xa719('0xd')],function(_0x312406){return{'model':db[_0x312406[_0xa719('0xf')]],'as':_0x312406['as'],'attributes':_0x312406[_0xa719('0xb')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x25e5cf){logger['info'](_0xa719('0x6'),_0x514e60);logger[_0xa719('0x10')]('GetCmHopper',_0x514e60,JSON['stringify'](_0x25e5cf));_0x4dd032(_0x25e5cf);})[_0xa719('0x11')](function(_0x45c812){logger[_0xa719('0x12')](_0xa719('0x6'),_0x45c812[_0xa719('0x13')],_0x514e60);_0x4f89ce(_0x40f7d3[_0xa719('0x12')](0x1f4,_0x45c812[_0xa719('0x13')]));});});};exports[_0xa719('0x14')]=function(_0x55d9cd){var _0xad1fd6=this;return new Promise(function(_0x4df941,_0x5e8ca3){return db['CmHopper'][_0xa719('0x15')]({'raw':_0x55d9cd[_0xa719('0x8')]?_0x55d9cd[_0xa719('0x8')][_0xa719('0x9')]===undefined?!![]:![]:!![],'where':_0x55d9cd[_0xa719('0x8')]?_0x55d9cd[_0xa719('0x8')][_0xa719('0xa')]||null:null,'attributes':_0x55d9cd['options']?_0x55d9cd[_0xa719('0x8')][_0xa719('0xb')]||null:null,'include':_0x55d9cd['options']?_0x55d9cd[_0xa719('0x8')]['include']?_[_0xa719('0xe')](_0x55d9cd['options']['include'],function(_0x4f4203){return{'model':db[_0x4f4203['model']],'as':_0x4f4203['as'],'attributes':_0x4f4203[_0xa719('0xb')],'include':_0x4f4203['include']?_[_0xa719('0xe')](_0x4f4203[_0xa719('0xd')],function(_0x5a3df3){return{'model':db[_0x5a3df3[_0xa719('0xf')]],'as':_0x5a3df3['as'],'attributes':_0x5a3df3[_0xa719('0xb')],'include':_0x5a3df3[_0xa719('0xd')]?_[_0xa719('0xe')](_0x5a3df3[_0xa719('0xd')],function(_0x6abb3c){return{'model':db[_0x6abb3c[_0xa719('0xf')]],'as':_0x6abb3c['as'],'attributes':_0x6abb3c[_0xa719('0xb')]};}):[]};}):[]};}):[]:[]})[_0xa719('0x16')](function(_0x408d0d){logger[_0xa719('0x17')](_0xa719('0x14'),_0x55d9cd);logger['debug']('ShowCmHopper',_0x55d9cd,JSON[_0xa719('0x18')](_0x408d0d));_0x4df941(_0x408d0d);})[_0xa719('0x11')](function(_0x3cb066){logger[_0xa719('0x12')]('ShowCmHopper',_0x3cb066[_0xa719('0x13')],_0x55d9cd);_0x5e8ca3(_0xad1fd6['error'](0x1f4,_0x3cb066[_0xa719('0x13')]));});});};exports[_0xa719('0x19')]=function(_0x41560b){var _0x438778=this;return new Promise(function(_0x1e635a,_0x8d71f4){return db[_0xa719('0x7')][_0xa719('0x1a')](_0x41560b[_0xa719('0x1b')],{'raw':_0x41560b['options']?_0x41560b[_0xa719('0x8')][_0xa719('0x9')]===undefined?!![]:![]:!![]})[_0xa719('0x16')](function(_0x4421e0){logger[_0xa719('0x17')](_0xa719('0x19'),_0x41560b);logger['debug']('CreateCmHopper',_0x41560b,JSON[_0xa719('0x18')](_0x4421e0));_0x1e635a(_0x4421e0);})[_0xa719('0x11')](function(_0x588669){logger[_0xa719('0x12')](_0xa719('0x19'),_0x588669[_0xa719('0x13')],_0x41560b);_0x8d71f4(_0x438778[_0xa719('0x12')](0x1f4,_0x588669[_0xa719('0x13')]));});});};exports[_0xa719('0x1c')]=function(_0x13fe5a){var _0x2c2103=this;return new Promise(function(_0x43d248,_0x21ff69){return db['CmHopper']['update'](_0x13fe5a[_0xa719('0x1b')],{'raw':_0x13fe5a['options']?_0x13fe5a['options'][_0xa719('0x9')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x13fe5a['options']?_0x13fe5a[_0xa719('0x8')][_0xa719('0xa')]||null:null,'attributes':_0x13fe5a[_0xa719('0x8')]?_0x13fe5a['options'][_0xa719('0xb')]||null:null,'limit':_0x13fe5a['options']?_0x13fe5a[_0xa719('0x8')][_0xa719('0xc')]||null:null})[_0xa719('0x16')](function(_0x545500){logger[_0xa719('0x17')](_0xa719('0x1c'),_0x13fe5a);logger['info'](_0xa719('0x1d'),JSON[_0xa719('0x18')](_0x13fe5a[_0xa719('0x8')][_0xa719('0xa')]),_0x13fe5a[_0xa719('0x1b')][_0xa719('0x1e')]);logger[_0xa719('0x10')](_0xa719('0x1c'),_0x13fe5a,JSON[_0xa719('0x18')](_0x545500));_0x43d248(_0x545500);})[_0xa719('0x11')](function(_0x3108e0){logger[_0xa719('0x12')](_0xa719('0x1c'),_0x3108e0['message'],_0x13fe5a);_0x21ff69(_0x2c2103[_0xa719('0x12')](0x1f4,_0x3108e0['message']));});});};exports['DestroyCmHopper']=function(_0x9a4630){var _0x1cb43d=this;return new Promise(function(_0x4da87c,_0x1554f5){return db[_0xa719('0x7')][_0xa719('0x1f')]({'where':_0x9a4630[_0xa719('0x8')]?_0x9a4630[_0xa719('0x8')][_0xa719('0xa')]||null:null})['then'](function(_0x5c32d9){logger[_0xa719('0x17')](_0xa719('0x20'),_0x9a4630);logger['debug'](_0xa719('0x20'),_0x9a4630,JSON['stringify'](_0x5c32d9));_0x4da87c(_0x5c32d9);})[_0xa719('0x11')](function(_0x4256c5){logger[_0xa719('0x12')](_0xa719('0x20'),_0x4256c5['message'],_0x9a4630);_0x1554f5(_0x1cb43d[_0xa719('0x12')](0x1f4,_0x4256c5[_0xa719('0x13')]));});});};exports['GetContactDialer']=function(_0x124830){var _0x3da68c=this;return new Promise(function(_0xe04ffa,_0xbd94f8){return db[_0xa719('0x21')]['describe']()[_0xa719('0x16')](function(_0x5d0cb6){return db[_0xa719('0x22')][_0xa719('0x23')](function(_0x56fff5){return db[_0xa719('0x7')]['findAll']({'where':_0x124830[_0xa719('0x8')]?_0x124830['options'][_0xa719('0xa')]||null:null,'attributes':_0x124830[_0xa719('0x8')]?_0x124830[_0xa719('0x8')][_0xa719('0xb')]||null:null,'limit':_0x124830[_0xa719('0x8')]?_0x124830[_0xa719('0x8')][_0xa719('0xc')]||null:null,'order':_0x124830[_0xa719('0x8')]?_0x124830[_0xa719('0x8')][_0xa719('0x24')]||null:null,'transaction':_0x56fff5,'lock':_0x56fff5[_0xa719('0x25')][_0xa719('0x26')],'include':[{'model':db[_0xa719('0x21')],'as':'Contact','attributes':_[_0xa719('0x27')](_0x5d0cb6)},{'model':db[_0xa719('0x28')],'as':_0xa719('0x29'),'attributes':['id','name','voicePause']}]})[_0xa719('0x16')](function(_0x54faa5){var _0x36d7a4=[];var _0x3ee9d8=[];for(var _0xef43f1=0x0;_0xef43f1<_0x54faa5[_0xa719('0x2a')];_0xef43f1+=0x1){var _0x1173c9=_0x54faa5[_0xef43f1][_0xa719('0x2b')];if(_0x1173c9===null){_0x36d7a4['push'](_0x54faa5[_0xef43f1]['update'](_0x124830[_0xa719('0x1b')],{'transaction':_0x56fff5}));}else if(!_0x3ee9d8[_0xa719('0x2c')](_0x1173c9)){_0x3ee9d8[_0xa719('0x2d')](_0x1173c9);_0x36d7a4[_0xa719('0x2d')](_0x54faa5[_0xef43f1]['update'](_0x124830[_0xa719('0x1b')],{'transaction':_0x56fff5}));}}return BPromise[_0xa719('0x2e')](_0x36d7a4);});})[_0xa719('0x16')](function(_0x1e7a24){logger[_0xa719('0x17')](_0xa719('0x2f'),_0x124830);if(_0x1e7a24[_0xa719('0x2a')]>0x0){logger[_0xa719('0x17')](_0xa719('0x30'),_0x1e7a24[0x0][_0xa719('0x31')]['id'],_0x1e7a24[0x0][_0xa719('0x31')][_0xa719('0x32')],_0x1e7a24[0x0]['dataValues'][_0xa719('0x1e')]);}logger[_0xa719('0x10')]('GetContactDialer',_0x124830,JSON[_0xa719('0x18')](_0x1e7a24));_0xe04ffa(_0x1e7a24);})['catch'](function(_0x30031d){logger[_0xa719('0x12')](_0xa719('0x2f'),_0x30031d[_0xa719('0x13')],_0x124830);_0xbd94f8(_0x3da68c[_0xa719('0x12')](0x1f4,_0x30031d['message']));});});});};exports[_0xa719('0x33')]=function(_0x329590){var _0xfa8080=this;return new Promise(function(_0x6c803,_0x181c38){return db[_0xa719('0x22')][_0xa719('0x23')](function(_0x51240f){return db[_0xa719('0x34')][_0xa719('0x1a')](_0x329590['body'],{'raw':_0x329590[_0xa719('0x8')]?_0x329590[_0xa719('0x8')][_0xa719('0x9')]===undefined?!![]:![]:!![],'transaction':_0x51240f})['then'](function(){logger[_0xa719('0x17')](_0xa719('0x35'),JSON[_0xa719('0x18')](_0x329590[_0xa719('0x8')][_0xa719('0xa')]),_0x329590[_0xa719('0x8')]['where'][_0xa719('0x1e')]);return db[_0xa719('0x7')][_0xa719('0x1f')]({'where':_0x329590[_0xa719('0x8')]?_0x329590[_0xa719('0x8')][_0xa719('0xa')]||null:null,'transaction':_0x51240f});});})[_0xa719('0x16')](function(_0x49991b){logger[_0xa719('0x17')](_0xa719('0x33'),_0x329590);logger[_0xa719('0x10')](_0xa719('0x33'),_0x329590,JSON['stringify'](_0x49991b));_0x6c803(_0x49991b);})[_0xa719('0x11')](function(_0x1a72f1){logger[_0xa719('0x12')](_0xa719('0x33'),_0x1a72f1[_0xa719('0x13')],_0x329590);_0x181c38(_0xfa8080[_0xa719('0x12')](0x1f4,_0x1a72f1['message']));});});};exports[_0xa719('0x36')]=function(_0x52e3c9){var _0x439412=this;return new Promise(function(_0x1bea4f,_0x4bbcbe){return db[_0xa719('0x7')][_0xa719('0x37')]({'raw':_0x52e3c9['options']?_0x52e3c9[_0xa719('0x8')][_0xa719('0x9')]===undefined?!![]:![]:!![],'where':_0x52e3c9['options']?_0x52e3c9[_0xa719('0x8')]['where']||null:null,'attributes':[[db[_0xa719('0x22')]['fn']('COUNT',db[_0xa719('0x22')]['fn']('IF',db[_0xa719('0x22')][_0xa719('0x38')](_0xa719('0x39')+util[_0xa719('0x3a')]('\x22%s\x22',moment()[_0xa719('0x3a')](_0xa719('0x3b')))+_0xa719('0x3c')))),_0xa719('0x3d')]]})[_0xa719('0x16')](function(_0x4b9f9d){logger[_0xa719('0x17')](_0xa719('0x36'),_0x52e3c9);logger[_0xa719('0x10')](_0xa719('0x36'),_0x52e3c9,JSON[_0xa719('0x18')](_0x4b9f9d));_0x1bea4f(_0x4b9f9d);})['catch'](function(_0x214afc){logger[_0xa719('0x12')](_0xa719('0x36'),_0x214afc[_0xa719('0x13')],_0x52e3c9);_0x4bbcbe(_0x439412[_0xa719('0x12')](0x1f4,_0x214afc['message']));});});};exports['GetContactRecallMe']=function(_0x260f5f){var _0xf55598=this;return new Promise(function(_0x11a667,_0x25cb40){return db['CmContact'][_0xa719('0x3e')]()['then'](function(){return db[_0xa719('0x22')][_0xa719('0x23')](function(_0x214cb0){return db[_0xa719('0x7')][_0xa719('0x37')]({'where':_0x260f5f[_0xa719('0x8')]?_0x260f5f[_0xa719('0x8')]['where']||null:null,'attributes':_0x260f5f[_0xa719('0x8')]?_0x260f5f[_0xa719('0x8')][_0xa719('0xb')]||null:null,'limit':0x1,'order':_0x260f5f[_0xa719('0x8')]?_0x260f5f[_0xa719('0x8')]['order']||null:null,'group':db[_0xa719('0x7')][_0xa719('0x2b')],'transaction':_0x214cb0,'lock':_0x214cb0[_0xa719('0x25')]['UPDATE'],'include':_0x260f5f['options']?_0x260f5f[_0xa719('0x8')]['include']?_[_0xa719('0xe')](_0x260f5f[_0xa719('0x8')]['include'],function(_0x59bbf3){return{'model':db[_0x59bbf3[_0xa719('0xf')]],'as':_0x59bbf3['as'],'attributes':_0x59bbf3[_0xa719('0xb')],'include':_0x59bbf3['include']?_['map'](_0x59bbf3[_0xa719('0xd')],function(_0x269a39){return{'model':db[_0x269a39['model']],'as':_0x269a39['as'],'attributes':_0x269a39[_0xa719('0xb')],'include':_0x269a39[_0xa719('0xd')]?_['map'](_0x269a39[_0xa719('0xd')],function(_0xc77fa7){return{'model':db[_0xc77fa7[_0xa719('0xf')]],'as':_0xc77fa7['as'],'attributes':_0xc77fa7[_0xa719('0xb')]};}):[]};}):[]};}):[]:[]})[_0xa719('0x16')](function(_0xbcbae2){var _0x2a3881=[];for(var _0x1257db=0x0;_0x1257db<_0xbcbae2[_0xa719('0x2a')];_0x1257db+=0x1){_0x2a3881[_0xa719('0x2d')](_0xbcbae2[_0x1257db][_0xa719('0x3f')](_0x260f5f[_0xa719('0x1b')],{'transaction':_0x214cb0}));}return BPromise[_0xa719('0x2e')](_0x2a3881);});})['then'](function(_0x40ca1a){logger['info'](_0xa719('0x40'),_0x260f5f);logger[_0xa719('0x10')](_0xa719('0x40'),_0x260f5f,JSON[_0xa719('0x18')](_0x40ca1a));_0x11a667(_0x40ca1a);})['catch'](function(_0x30e2ae){logger['error'](_0xa719('0x40'),_0x30e2ae[_0xa719('0x13')],_0x260f5f);_0x25cb40(_0xf55598[_0xa719('0x12')](0x1f4,_0x30e2ae[_0xa719('0x13')]));});});});};exports[_0xa719('0x41')]=function(_0x43b6f6){var _0x5d32f0=this;return new Promise(function(_0x6a18b6,_0x5486ad){db[_0xa719('0x21')]['describe']()[_0xa719('0x16')](function(_0x2a4da0){return db['CmHopper'][_0xa719('0x37')]({'raw':_0x43b6f6['options']?_0x43b6f6[_0xa719('0x8')][_0xa719('0x9')]===undefined?!![]:![]:!![],'where':_0x43b6f6[_0xa719('0x8')]?_0x43b6f6[_0xa719('0x8')][_0xa719('0xa')]||null:null,'attributes':_0x43b6f6['options']?_0x43b6f6[_0xa719('0x8')][_0xa719('0xb')]||null:null,'limit':_0x43b6f6['options']?_0x43b6f6[_0xa719('0x8')]['limit']||null:null,'include':_0x43b6f6[_0xa719('0x8')]?_0x43b6f6[_0xa719('0x8')][_0xa719('0xd')]?_[_0xa719('0xe')](_0x43b6f6[_0xa719('0x8')][_0xa719('0xd')],function(_0x4d4cbb){return{'model':db[_0x4d4cbb['model']],'as':_0x4d4cbb['as'],'attributes':_0x4d4cbb['as']===_0xa719('0x42')?_[_0xa719('0x27')](_0x2a4da0):_0x4d4cbb[_0xa719('0xb')],'include':_0x4d4cbb[_0xa719('0xd')]?_[_0xa719('0xe')](_0x4d4cbb[_0xa719('0xd')],function(_0x2f86c2){return{'model':db[_0x2f86c2[_0xa719('0xf')]],'as':_0x2f86c2['as'],'attributes':_0x2f86c2[_0xa719('0xb')],'include':_0x2f86c2[_0xa719('0xd')]?_[_0xa719('0xe')](_0x2f86c2[_0xa719('0xd')],function(_0x3ee325){return{'model':db[_0x3ee325[_0xa719('0xf')]],'as':_0x3ee325['as'],'attributes':_0x3ee325['attributes']};}):[]};}):[]};}):[]:[]})[_0xa719('0x16')](function(_0x11e666){logger['info'](_0xa719('0x6'),_0x43b6f6);logger['debug']('GetCmHopper',_0x43b6f6,JSON['stringify'](_0x11e666));_0x6a18b6(_0x11e666);})['catch'](function(_0x251737){logger[_0xa719('0x12')](_0xa719('0x6'),_0x251737[_0xa719('0x13')],_0x43b6f6);_0x5486ad(_0x5d32f0[_0xa719('0x12')](0x1f4,_0x251737[_0xa719('0x13')]));});});});};exports[_0xa719('0x43')]=function(_0x4ce39c){var _0x19d202=this;return new Promise(function(_0x4bd760,_0x3cd198){return db[_0xa719('0x21')][_0xa719('0x44')]({'raw':!![],'where':{'phone':_0x4ce39c[_0xa719('0x8')][_0xa719('0xa')][_0xa719('0x45')]},'attributes':['id',_0xa719('0x46')],'order':[['id',_0xa719('0x47')]]})[_0xa719('0x16')](function(_0x40ec2e){logger[_0xa719('0x17')](_0xa719('0x48'),_0x4ce39c);logger[_0xa719('0x10')](_0xa719('0x48'),_0x4ce39c,JSON[_0xa719('0x18')](_0x40ec2e));_0x4bd760(_0x40ec2e);})['catch'](function(_0x498b90){logger[_0xa719('0x12')](_0xa719('0x48'),_0x498b90['message'],_0x4ce39c);_0x3cd198(_0x19d202[_0xa719('0x12')](0x1f4,_0x498b90[_0xa719('0x13')]));});});};exports[_0xa719('0x49')]=function(_0x16a9be){var _0x2ad6ad=this;return new Promise(function(_0x21502c,_0x3c8d7d){return db['sequelize'][_0xa719('0x23')](function(_0x393246){var _0x4f4303=_0x16a9be[_0xa719('0x8')]&&_0x16a9be['options'][_0xa719('0xa')]?_0x16a9be[_0xa719('0x8')][_0xa719('0xa')]:{};return db[_0xa719('0x7')]['update'](_0x16a9be['body'],{'where':_0x4f4303,'transaction':_0x393246})[_0xa719('0x16')](function(_0x3aa4ad){logger['info']('ResetActiveCalls',_0x16a9be);logger[_0xa719('0x10')](_0xa719('0x49'),_0x16a9be,JSON[_0xa719('0x18')](_0x3aa4ad));_0x21502c(_0x3aa4ad);})['catch'](function(_0x11417a){logger['error'](_0xa719('0x49'),_0x11417a[_0xa719('0x13')],_0x16a9be);_0x3c8d7d(_0x2ad6ad[_0xa719('0x12')](0x1f4,_0x11417a[_0xa719('0x13')]));});});});};exports[_0xa719('0x4a')]=function(_0x382e47){var _0x1db61d=this;var _0x283ca1=_0x382e47['body'][_0xa719('0xa')][_0xa719('0x4b')];var _0x4cb7bb=_0x382e47[_0xa719('0x1b')][_0xa719('0xa')][_0xa719('0x4c')];var _0x194954=_0x382e47['body'][_0xa719('0xa')][_0xa719('0x4d')];return new Promise(function(_0x1119f6,_0xff4db6){return db[_0xa719('0x7')][_0xa719('0x37')]({'where':{'voiceQueueId':{'$in':_0x283ca1},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0xa719('0x22')]['literal'](_0xa719('0x4e')+_0x4cb7bb+'\x20MINUTE'),'$gt':db[_0xa719('0x22')][_0xa719('0x38')](_0xa719('0x4f'))}},'UserId':{'$in':_0x194954}},'include':[{'model':db['CmContact'],'as':_0xa719('0x42')},{'model':db[_0xa719('0x28')],'as':_0xa719('0x29'),'attributes':['id',_0xa719('0x50'),'voicePause']},{'model':db[_0xa719('0x51')],'as':_0xa719('0x52')}]})[_0xa719('0x16')](function(_0x1614be){if(_0x1614be[_0xa719('0x2a')]>0x0){return db['sequelize'][_0xa719('0x23')](function(_0x491f0b){return db['CmHopper'][_0xa719('0x3f')]({'recallmeNotifiedDate':db['sequelize'][_0xa719('0x38')](_0xa719('0x4f'))},{'where':{'id':{'$in':_[_0xa719('0xe')](_0x1614be,'id')}},'transaction':_0x491f0b})[_0xa719('0x16')](function(){_0x1119f6(_0x1614be);})[_0xa719('0x11')](function(_0x3bdf1c){logger[_0xa719('0x12')]('CmHopperHandlePreviewRecallNotifications',_0x3bdf1c[_0xa719('0x13')],_0x382e47);_0xff4db6(_0x1db61d[_0xa719('0x12')](0x1f4,_0x3bdf1c['message']));});})[_0xa719('0x11')](function(_0x3ed29a){logger[_0xa719('0x12')](_0xa719('0x4a'),_0x3ed29a[_0xa719('0x13')],_0x382e47);_0xff4db6(_0x1db61d[_0xa719('0x12')](0x1f4,_0x3ed29a[_0xa719('0x13')]));});}else{_0x1119f6(_0x1614be);}});});}; \ No newline at end of file +var _0x335d=['info','GetCmHopper','debug','error','message','ShowCmHopper','where','stringify','catch','CreateCmHopper','create','body','UpdateCmHopper','active','DestroyCmHopper','GetContactDialer','CmContact','describe','sequelize','transaction','findAll','LOCK','UPDATE','Contact','keys','User','Agent','name','length','push','update','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','MoveContactManagedDialer','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','destroy','CountReScheduled','COUNT','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','order','UserId','GetContactRecallMe','GetCmHopperPreview','findOne','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','interval','\x20MINUTE','literal','NOW()','CmList','List','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','CmHopper','options','raw','attributes','limit','include','map','model','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x335d,0x181));var _0xd335=function(_0x510fd8,_0x57ccdf){_0x510fd8=_0x510fd8-0x0;var _0x211a2f=_0x335d[_0x510fd8];return _0x211a2f;};'use strict';var _=require(_0xd335('0x0'));var util=require(_0xd335('0x1'));var moment=require(_0xd335('0x2'));var BPromise=require(_0xd335('0x3'));var db=require(_0xd335('0x4'))['db'];var logger=require(_0xd335('0x5'))('rpc');exports['GetCmHopper']=function(_0x2290ed){var _0x1db1d0=this;return new Promise(function(_0x103a67,_0x1bcf40){return db[_0xd335('0x6')]['findAll']({'raw':_0x2290ed[_0xd335('0x7')]?_0x2290ed['options'][_0xd335('0x8')]===undefined?!![]:![]:!![],'where':_0x2290ed[_0xd335('0x7')]?_0x2290ed[_0xd335('0x7')]['where']||null:null,'attributes':_0x2290ed[_0xd335('0x7')]?_0x2290ed[_0xd335('0x7')][_0xd335('0x9')]||null:null,'limit':_0x2290ed[_0xd335('0x7')]?_0x2290ed[_0xd335('0x7')][_0xd335('0xa')]||null:null,'include':_0x2290ed['options']?_0x2290ed[_0xd335('0x7')][_0xd335('0xb')]?_[_0xd335('0xc')](_0x2290ed[_0xd335('0x7')]['include'],function(_0x1bcc5e){return{'model':db[_0x1bcc5e[_0xd335('0xd')]],'as':_0x1bcc5e['as'],'attributes':_0x1bcc5e[_0xd335('0x9')],'include':_0x1bcc5e[_0xd335('0xb')]?_[_0xd335('0xc')](_0x1bcc5e[_0xd335('0xb')],function(_0x1b1cbf){return{'model':db[_0x1b1cbf[_0xd335('0xd')]],'as':_0x1b1cbf['as'],'attributes':_0x1b1cbf['attributes'],'include':_0x1b1cbf[_0xd335('0xb')]?_[_0xd335('0xc')](_0x1b1cbf[_0xd335('0xb')],function(_0x573669){return{'model':db[_0x573669[_0xd335('0xd')]],'as':_0x573669['as'],'attributes':_0x573669['attributes']};}):[]};}):[]};}):[]:[]})[_0xd335('0xe')](function(_0xd8cfaa){logger[_0xd335('0xf')](_0xd335('0x10'),_0x2290ed);logger[_0xd335('0x11')](_0xd335('0x10'),_0x2290ed,JSON['stringify'](_0xd8cfaa));_0x103a67(_0xd8cfaa);})['catch'](function(_0x2096f7){logger[_0xd335('0x12')]('GetCmHopper',_0x2096f7['message'],_0x2290ed);_0x1bcf40(_0x1db1d0['error'](0x1f4,_0x2096f7[_0xd335('0x13')]));});});};exports[_0xd335('0x14')]=function(_0x2e1276){var _0x53fdfd=this;return new Promise(function(_0x34a2a0,_0x41fcad){return db[_0xd335('0x6')]['find']({'raw':_0x2e1276[_0xd335('0x7')]?_0x2e1276[_0xd335('0x7')][_0xd335('0x8')]===undefined?!![]:![]:!![],'where':_0x2e1276['options']?_0x2e1276[_0xd335('0x7')][_0xd335('0x15')]||null:null,'attributes':_0x2e1276[_0xd335('0x7')]?_0x2e1276[_0xd335('0x7')][_0xd335('0x9')]||null:null,'include':_0x2e1276['options']?_0x2e1276['options'][_0xd335('0xb')]?_[_0xd335('0xc')](_0x2e1276['options'][_0xd335('0xb')],function(_0x2fe979){return{'model':db[_0x2fe979[_0xd335('0xd')]],'as':_0x2fe979['as'],'attributes':_0x2fe979[_0xd335('0x9')],'include':_0x2fe979[_0xd335('0xb')]?_[_0xd335('0xc')](_0x2fe979[_0xd335('0xb')],function(_0x52bf4e){return{'model':db[_0x52bf4e[_0xd335('0xd')]],'as':_0x52bf4e['as'],'attributes':_0x52bf4e['attributes'],'include':_0x52bf4e[_0xd335('0xb')]?_[_0xd335('0xc')](_0x52bf4e[_0xd335('0xb')],function(_0x510aae){return{'model':db[_0x510aae['model']],'as':_0x510aae['as'],'attributes':_0x510aae['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x46d00d){logger[_0xd335('0xf')](_0xd335('0x14'),_0x2e1276);logger[_0xd335('0x11')](_0xd335('0x14'),_0x2e1276,JSON[_0xd335('0x16')](_0x46d00d));_0x34a2a0(_0x46d00d);})[_0xd335('0x17')](function(_0x1e8b33){logger[_0xd335('0x12')](_0xd335('0x14'),_0x1e8b33['message'],_0x2e1276);_0x41fcad(_0x53fdfd['error'](0x1f4,_0x1e8b33['message']));});});};exports[_0xd335('0x18')]=function(_0x66eb47){var _0x4a2f04=this;return new Promise(function(_0x386581,_0x3e0548){return db[_0xd335('0x6')][_0xd335('0x19')](_0x66eb47[_0xd335('0x1a')],{'raw':_0x66eb47['options']?_0x66eb47[_0xd335('0x7')][_0xd335('0x8')]===undefined?!![]:![]:!![]})[_0xd335('0xe')](function(_0x4845a8){logger[_0xd335('0xf')](_0xd335('0x18'),_0x66eb47);logger[_0xd335('0x11')](_0xd335('0x18'),_0x66eb47,JSON[_0xd335('0x16')](_0x4845a8));_0x386581(_0x4845a8);})[_0xd335('0x17')](function(_0x46366a){logger['error']('CreateCmHopper',_0x46366a['message'],_0x66eb47);_0x3e0548(_0x4a2f04[_0xd335('0x12')](0x1f4,_0x46366a['message']));});});};exports['UpdateCmHopper']=function(_0x20af11){var _0x531260=this;return new Promise(function(_0x31355a,_0xb3f76c){return db[_0xd335('0x6')]['update'](_0x20af11[_0xd335('0x1a')],{'raw':_0x20af11[_0xd335('0x7')]?_0x20af11[_0xd335('0x7')][_0xd335('0x8')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x20af11['options']?_0x20af11['options'][_0xd335('0x15')]||null:null,'attributes':_0x20af11[_0xd335('0x7')]?_0x20af11['options'][_0xd335('0x9')]||null:null,'limit':_0x20af11['options']?_0x20af11[_0xd335('0x7')]['limit']||null:null})[_0xd335('0xe')](function(_0x2c550a){logger[_0xd335('0xf')](_0xd335('0x1b'),_0x20af11);logger['info']('UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON['stringify'](_0x20af11[_0xd335('0x7')][_0xd335('0x15')]),_0x20af11[_0xd335('0x1a')][_0xd335('0x1c')]);logger[_0xd335('0x11')](_0xd335('0x1b'),_0x20af11,JSON['stringify'](_0x2c550a));_0x31355a(_0x2c550a);})[_0xd335('0x17')](function(_0x3d4957){logger[_0xd335('0x12')](_0xd335('0x1b'),_0x3d4957[_0xd335('0x13')],_0x20af11);_0xb3f76c(_0x531260[_0xd335('0x12')](0x1f4,_0x3d4957[_0xd335('0x13')]));});});};exports[_0xd335('0x1d')]=function(_0x3e93cd){var _0x1c0d3a=this;return new Promise(function(_0x22a218,_0x9eb504){return db[_0xd335('0x6')]['destroy']({'where':_0x3e93cd[_0xd335('0x7')]?_0x3e93cd[_0xd335('0x7')]['where']||null:null})[_0xd335('0xe')](function(_0x2fc78e){logger[_0xd335('0xf')]('DestroyCmHopper',_0x3e93cd);logger[_0xd335('0x11')](_0xd335('0x1d'),_0x3e93cd,JSON[_0xd335('0x16')](_0x2fc78e));_0x22a218(_0x2fc78e);})['catch'](function(_0x23ed19){logger[_0xd335('0x12')](_0xd335('0x1d'),_0x23ed19[_0xd335('0x13')],_0x3e93cd);_0x9eb504(_0x1c0d3a['error'](0x1f4,_0x23ed19['message']));});});};exports[_0xd335('0x1e')]=function(_0x3ef241){var _0x492536=this;return new Promise(function(_0x11f7c9,_0x1b7f15){return db[_0xd335('0x1f')][_0xd335('0x20')]()['then'](function(_0xb67b18){return db[_0xd335('0x21')][_0xd335('0x22')](function(_0x1de41b){return db[_0xd335('0x6')][_0xd335('0x23')]({'where':_0x3ef241[_0xd335('0x7')]?_0x3ef241[_0xd335('0x7')]['where']||null:null,'attributes':_0x3ef241['options']?_0x3ef241[_0xd335('0x7')][_0xd335('0x9')]||null:null,'limit':_0x3ef241[_0xd335('0x7')]?_0x3ef241[_0xd335('0x7')][_0xd335('0xa')]||null:null,'order':_0x3ef241[_0xd335('0x7')]?_0x3ef241[_0xd335('0x7')]['order']||null:null,'transaction':_0x1de41b,'lock':_0x1de41b[_0xd335('0x24')][_0xd335('0x25')],'include':[{'model':db[_0xd335('0x1f')],'as':_0xd335('0x26'),'attributes':_[_0xd335('0x27')](_0xb67b18)},{'model':db[_0xd335('0x28')],'as':_0xd335('0x29'),'attributes':['id',_0xd335('0x2a'),'voicePause']}]})[_0xd335('0xe')](function(_0x56d12a){var _0x313981=[];var _0x519ea4=[];for(var _0x342371=0x0;_0x342371<_0x56d12a[_0xd335('0x2b')];_0x342371+=0x1){var _0x4ac03e=_0x56d12a[_0x342371]['UserId'];if(_0x4ac03e===null){_0x313981[_0xd335('0x2c')](_0x56d12a[_0x342371][_0xd335('0x2d')](_0x3ef241[_0xd335('0x1a')],{'transaction':_0x1de41b}));}else if(!_0x519ea4['includes'](_0x4ac03e)){_0x519ea4[_0xd335('0x2c')](_0x4ac03e);_0x313981[_0xd335('0x2c')](_0x56d12a[_0x342371][_0xd335('0x2d')](_0x3ef241[_0xd335('0x1a')],{'transaction':_0x1de41b}));}}return BPromise[_0xd335('0x2e')](_0x313981);});})[_0xd335('0xe')](function(_0x32a4c6){logger[_0xd335('0xf')](_0xd335('0x1e'),_0x3ef241);if(_0x32a4c6['length']>0x0){logger[_0xd335('0xf')](_0xd335('0x2f'),_0x32a4c6[0x0][_0xd335('0x30')]['id'],_0x32a4c6[0x0][_0xd335('0x30')][_0xd335('0x31')],_0x32a4c6[0x0][_0xd335('0x30')][_0xd335('0x1c')]);}logger['debug']('GetContactDialer',_0x3ef241,JSON[_0xd335('0x16')](_0x32a4c6));_0x11f7c9(_0x32a4c6);})[_0xd335('0x17')](function(_0x53a141){logger['error'](_0xd335('0x1e'),_0x53a141[_0xd335('0x13')],_0x3ef241);_0x1b7f15(_0x492536['error'](0x1f4,_0x53a141[_0xd335('0x13')]));});});});};exports[_0xd335('0x32')]=function(_0x4db175){var _0x349477=this;return new Promise(function(_0x50d3f9,_0x54665a){return db[_0xd335('0x21')]['transaction'](function(_0x1e24a1){return db[_0xd335('0x33')][_0xd335('0x19')](_0x4db175[_0xd335('0x1a')],{'raw':_0x4db175[_0xd335('0x7')]?_0x4db175[_0xd335('0x7')][_0xd335('0x8')]===undefined?!![]:![]:!![],'transaction':_0x1e24a1})[_0xd335('0xe')](function(){logger[_0xd335('0xf')](_0xd335('0x34'),JSON['stringify'](_0x4db175['options'][_0xd335('0x15')]),_0x4db175[_0xd335('0x7')][_0xd335('0x15')][_0xd335('0x1c')]);return db['CmHopper'][_0xd335('0x35')]({'where':_0x4db175[_0xd335('0x7')]?_0x4db175[_0xd335('0x7')]['where']||null:null,'transaction':_0x1e24a1});});})['then'](function(_0x52fe67){logger['info']('MoveContactManagedDialer',_0x4db175);logger[_0xd335('0x11')]('MoveContactManagedDialer',_0x4db175,JSON[_0xd335('0x16')](_0x52fe67));_0x50d3f9(_0x52fe67);})[_0xd335('0x17')](function(_0x5539f2){logger[_0xd335('0x12')]('MoveContactManagedDialer',_0x5539f2[_0xd335('0x13')],_0x4db175);_0x54665a(_0x349477[_0xd335('0x12')](0x1f4,_0x5539f2[_0xd335('0x13')]));});});};exports[_0xd335('0x36')]=function(_0x1d9eb1){var _0x4cbf78=this;return new Promise(function(_0x368a1f,_0x1a7701){return db[_0xd335('0x6')][_0xd335('0x23')]({'raw':_0x1d9eb1['options']?_0x1d9eb1[_0xd335('0x7')][_0xd335('0x8')]===undefined?!![]:![]:!![],'where':_0x1d9eb1[_0xd335('0x7')]?_0x1d9eb1['options'][_0xd335('0x15')]||null:null,'attributes':[[db['sequelize']['fn'](_0xd335('0x37'),db['sequelize']['fn']('IF',db[_0xd335('0x21')]['literal'](_0xd335('0x38')+util[_0xd335('0x39')](_0xd335('0x3a'),moment()[_0xd335('0x39')](_0xd335('0x3b')))+_0xd335('0x3c')))),_0xd335('0x3d')]]})[_0xd335('0xe')](function(_0xc811d5){logger[_0xd335('0xf')]('CountReScheduled',_0x1d9eb1);logger[_0xd335('0x11')](_0xd335('0x36'),_0x1d9eb1,JSON['stringify'](_0xc811d5));_0x368a1f(_0xc811d5);})[_0xd335('0x17')](function(_0x40bbc9){logger[_0xd335('0x12')]('CountReScheduled',_0x40bbc9[_0xd335('0x13')],_0x1d9eb1);_0x1a7701(_0x4cbf78[_0xd335('0x12')](0x1f4,_0x40bbc9[_0xd335('0x13')]));});});};exports['GetContactRecallMe']=function(_0x54e56f){var _0x4e1d9c=this;return new Promise(function(_0x29ab2a,_0x3b8d6c){return db[_0xd335('0x1f')]['describe']()[_0xd335('0xe')](function(){return db[_0xd335('0x21')][_0xd335('0x22')](function(_0x104d20){return db['CmHopper'][_0xd335('0x23')]({'where':_0x54e56f[_0xd335('0x7')]?_0x54e56f['options'][_0xd335('0x15')]||null:null,'attributes':_0x54e56f['options']?_0x54e56f[_0xd335('0x7')][_0xd335('0x9')]||null:null,'limit':0x1,'order':_0x54e56f[_0xd335('0x7')]?_0x54e56f[_0xd335('0x7')][_0xd335('0x3e')]||null:null,'group':db['CmHopper'][_0xd335('0x3f')],'transaction':_0x104d20,'lock':_0x104d20[_0xd335('0x24')][_0xd335('0x25')],'include':_0x54e56f[_0xd335('0x7')]?_0x54e56f['options'][_0xd335('0xb')]?_[_0xd335('0xc')](_0x54e56f['options'][_0xd335('0xb')],function(_0x45097c){return{'model':db[_0x45097c[_0xd335('0xd')]],'as':_0x45097c['as'],'attributes':_0x45097c['attributes'],'include':_0x45097c['include']?_[_0xd335('0xc')](_0x45097c[_0xd335('0xb')],function(_0x454d9a){return{'model':db[_0x454d9a['model']],'as':_0x454d9a['as'],'attributes':_0x454d9a[_0xd335('0x9')],'include':_0x454d9a[_0xd335('0xb')]?_['map'](_0x454d9a[_0xd335('0xb')],function(_0x133e08){return{'model':db[_0x133e08[_0xd335('0xd')]],'as':_0x133e08['as'],'attributes':_0x133e08[_0xd335('0x9')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5de876){var _0xbbac72=[];for(var _0x49dee4=0x0;_0x49dee4<_0x5de876['length'];_0x49dee4+=0x1){_0xbbac72[_0xd335('0x2c')](_0x5de876[_0x49dee4][_0xd335('0x2d')](_0x54e56f[_0xd335('0x1a')],{'transaction':_0x104d20}));}return BPromise[_0xd335('0x2e')](_0xbbac72);});})[_0xd335('0xe')](function(_0x5613f0){logger[_0xd335('0xf')]('GetContactRecallMe',_0x54e56f);logger[_0xd335('0x11')](_0xd335('0x40'),_0x54e56f,JSON[_0xd335('0x16')](_0x5613f0));_0x29ab2a(_0x5613f0);})[_0xd335('0x17')](function(_0x4f147){logger[_0xd335('0x12')]('GetContactRecallMe',_0x4f147[_0xd335('0x13')],_0x54e56f);_0x3b8d6c(_0x4e1d9c['error'](0x1f4,_0x4f147[_0xd335('0x13')]));});});});};exports[_0xd335('0x41')]=function(_0x42bcae){var _0x4b0b87=this;return new Promise(function(_0x554307,_0xba33aa){db[_0xd335('0x1f')]['describe']()['then'](function(_0x5c2cdd){return db['CmHopper']['findAll']({'raw':_0x42bcae[_0xd335('0x7')]?_0x42bcae[_0xd335('0x7')]['raw']===undefined?!![]:![]:!![],'where':_0x42bcae['options']?_0x42bcae[_0xd335('0x7')][_0xd335('0x15')]||null:null,'attributes':_0x42bcae['options']?_0x42bcae[_0xd335('0x7')]['attributes']||null:null,'limit':_0x42bcae['options']?_0x42bcae[_0xd335('0x7')][_0xd335('0xa')]||null:null,'include':_0x42bcae['options']?_0x42bcae[_0xd335('0x7')][_0xd335('0xb')]?_['map'](_0x42bcae[_0xd335('0x7')]['include'],function(_0x50b819){return{'model':db[_0x50b819[_0xd335('0xd')]],'as':_0x50b819['as'],'attributes':_0x50b819['as']==='Contact'?_[_0xd335('0x27')](_0x5c2cdd):_0x50b819[_0xd335('0x9')],'include':_0x50b819[_0xd335('0xb')]?_[_0xd335('0xc')](_0x50b819[_0xd335('0xb')],function(_0x50f32a){return{'model':db[_0x50f32a['model']],'as':_0x50f32a['as'],'attributes':_0x50f32a[_0xd335('0x9')],'include':_0x50f32a[_0xd335('0xb')]?_[_0xd335('0xc')](_0x50f32a[_0xd335('0xb')],function(_0x597c08){return{'model':db[_0x597c08[_0xd335('0xd')]],'as':_0x597c08['as'],'attributes':_0x597c08[_0xd335('0x9')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x594add){logger['info'](_0xd335('0x10'),_0x42bcae);logger[_0xd335('0x11')](_0xd335('0x10'),_0x42bcae,JSON[_0xd335('0x16')](_0x594add));_0x554307(_0x594add);})['catch'](function(_0x5052eb){logger[_0xd335('0x12')](_0xd335('0x10'),_0x5052eb[_0xd335('0x13')],_0x42bcae);_0xba33aa(_0x4b0b87[_0xd335('0x12')](0x1f4,_0x5052eb[_0xd335('0x13')]));});});});};exports['GetContactByPhone']=function(_0x4dc69f){var _0x5b878b=this;return new Promise(function(_0x188988,_0x1ae751){return db['CmContact'][_0xd335('0x42')]({'raw':!![],'where':{'phone':_0x4dc69f[_0xd335('0x7')]['where'][_0xd335('0x43')]},'attributes':['id',_0xd335('0x44')],'order':[['id',_0xd335('0x45')]]})[_0xd335('0xe')](function(_0x58aa62){logger[_0xd335('0xf')](_0xd335('0x46'),_0x4dc69f);logger['debug'](_0xd335('0x46'),_0x4dc69f,JSON['stringify'](_0x58aa62));_0x188988(_0x58aa62);})[_0xd335('0x17')](function(_0x523b81){logger[_0xd335('0x12')]('getContactByPhone',_0x523b81[_0xd335('0x13')],_0x4dc69f);_0x1ae751(_0x5b878b[_0xd335('0x12')](0x1f4,_0x523b81[_0xd335('0x13')]));});});};exports['ResetActiveCalls']=function(_0x4d768e){var _0x466c9f=this;return new Promise(function(_0x2964d5,_0x317481){return db[_0xd335('0x21')]['transaction'](function(_0x344090){var _0x1cacd9=_0x4d768e[_0xd335('0x7')]&&_0x4d768e[_0xd335('0x7')][_0xd335('0x15')]?_0x4d768e[_0xd335('0x7')][_0xd335('0x15')]:{};return db[_0xd335('0x6')][_0xd335('0x2d')](_0x4d768e['body'],{'where':_0x1cacd9,'transaction':_0x344090})[_0xd335('0xe')](function(_0x34d83a){logger[_0xd335('0xf')](_0xd335('0x47'),_0x4d768e);logger[_0xd335('0x11')](_0xd335('0x47'),_0x4d768e,JSON[_0xd335('0x16')](_0x34d83a));_0x2964d5(_0x34d83a);})[_0xd335('0x17')](function(_0x195b78){logger[_0xd335('0x12')](_0xd335('0x47'),_0x195b78[_0xd335('0x13')],_0x4d768e);_0x317481(_0x466c9f[_0xd335('0x12')](0x1f4,_0x195b78[_0xd335('0x13')]));});});});};exports[_0xd335('0x48')]=function(_0x276c60){var _0x29ba69=this;var _0x213a36=_0x276c60['body'][_0xd335('0x15')][_0xd335('0x49')];var _0x5ff18=_0x276c60[_0xd335('0x1a')]['where'][_0xd335('0x4a')];var _0x13bbb0=_0x276c60[_0xd335('0x1a')][_0xd335('0x15')]['availableAgentsIds'];return new Promise(function(_0x56a150,_0x523b50){return db[_0xd335('0x6')][_0xd335('0x23')]({'where':{'voiceQueueId':{'$in':_0x213a36},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0xd335('0x21')]['literal']('NOW()\x20+\x20INTERVAL\x20'+_0x5ff18+_0xd335('0x4b')),'$gt':db[_0xd335('0x21')][_0xd335('0x4c')](_0xd335('0x4d'))}},'UserId':{'$in':_0x13bbb0}},'include':[{'model':db['CmContact'],'as':_0xd335('0x26')},{'model':db[_0xd335('0x28')],'as':'Agent','attributes':['id',_0xd335('0x2a'),'voicePause']},{'model':db[_0xd335('0x4e')],'as':_0xd335('0x4f')}]})[_0xd335('0xe')](function(_0x5cd9d2){if(_0x5cd9d2[_0xd335('0x2b')]>0x0){return db['sequelize'][_0xd335('0x22')](function(_0x18cfca){return db[_0xd335('0x6')]['update']({'recallmeNotifiedDate':db[_0xd335('0x21')][_0xd335('0x4c')](_0xd335('0x4d'))},{'where':{'id':{'$in':_[_0xd335('0xc')](_0x5cd9d2,'id')}},'transaction':_0x18cfca})[_0xd335('0xe')](function(){_0x56a150(_0x5cd9d2);})[_0xd335('0x17')](function(_0x3be5c7){logger[_0xd335('0x12')](_0xd335('0x48'),_0x3be5c7[_0xd335('0x13')],_0x276c60);_0x523b50(_0x29ba69[_0xd335('0x12')](0x1f4,_0x3be5c7[_0xd335('0x13')]));});})['catch'](function(_0x1a3ebf){logger[_0xd335('0x12')](_0xd335('0x48'),_0x1a3ebf[_0xd335('0x13')],_0x276c60);_0x523b50(_0x29ba69[_0xd335('0x12')](0x1f4,_0x1a3ebf[_0xd335('0x13')]));});}else{_0x56a150(_0x5cd9d2);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 016bb2d..4acca4b 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 _0x6718=['put','delete','destroy','express','../../components/auth/service','./cmHopper.controller','get','isAuthenticated','index','/describe','describe','/opencontacts','getOpenContacts','/timezones','getTimezones','/:id','show','post','create','/preview','/timezone','getTimezone'];(function(_0x42167f,_0x36c277){var _0x20f119=function(_0x1f79f3){while(--_0x1f79f3){_0x42167f['push'](_0x42167f['shift']());}};_0x20f119(++_0x36c277);}(_0x6718,0xc9));var _0x8671=function(_0x2c3a47,_0x170687){_0x2c3a47=_0x2c3a47-0x0;var _0x1c04de=_0x6718[_0x2c3a47];return _0x1c04de;};'use strict';var express=require(_0x8671('0x0'));var router=express['Router']();var auth=require(_0x8671('0x1'));var controller=require(_0x8671('0x2'));router[_0x8671('0x3')]('/',auth[_0x8671('0x4')](),controller[_0x8671('0x5')]);router[_0x8671('0x3')](_0x8671('0x6'),auth[_0x8671('0x4')](),controller[_0x8671('0x7')]);router['get'](_0x8671('0x8'),auth['isAuthenticated'](),controller[_0x8671('0x9')]);router['get'](_0x8671('0xa'),auth[_0x8671('0x4')](),controller[_0x8671('0xb')]);router[_0x8671('0x3')](_0x8671('0xc'),auth[_0x8671('0x4')](),controller[_0x8671('0xd')]);router['get']('/:id/previewrecall',auth[_0x8671('0x4')](),controller['getPreviewRecall']);router[_0x8671('0xe')]('/',auth[_0x8671('0x4')](),controller[_0x8671('0xf')]);router[_0x8671('0xe')](_0x8671('0x10'),auth['isAuthenticated'](),controller['getPreview']);router[_0x8671('0xe')](_0x8671('0x11'),auth[_0x8671('0x4')](),controller[_0x8671('0x12')]);router[_0x8671('0x13')](_0x8671('0xc'),auth[_0x8671('0x4')](),controller['update']);router[_0x8671('0x14')](_0x8671('0xc'),auth['isAuthenticated'](),controller[_0x8671('0x15')]);module['exports']=router; \ No newline at end of file +var _0x5166=['post','/preview','getPreview','/timezone','getTimezone','put','update','delete','express','Router','../../components/auth/service','./cmHopper.controller','get','index','/describe','isAuthenticated','describe','/opencontacts','getOpenContacts','getTimezones','/:id','show','/:id/previewrecall','getPreviewRecall'];(function(_0x514196,_0x4f160d){var _0x2fb47b=function(_0x4626c1){while(--_0x4626c1){_0x514196['push'](_0x514196['shift']());}};_0x2fb47b(++_0x4f160d);}(_0x5166,0xe0));var _0x6516=function(_0x9149e2,_0x282d94){_0x9149e2=_0x9149e2-0x0;var _0x51725a=_0x5166[_0x9149e2];return _0x51725a;};'use strict';var express=require(_0x6516('0x0'));var router=express[_0x6516('0x1')]();var auth=require(_0x6516('0x2'));var controller=require(_0x6516('0x3'));router[_0x6516('0x4')]('/',auth['isAuthenticated'](),controller[_0x6516('0x5')]);router[_0x6516('0x4')](_0x6516('0x6'),auth[_0x6516('0x7')](),controller[_0x6516('0x8')]);router[_0x6516('0x4')](_0x6516('0x9'),auth['isAuthenticated'](),controller[_0x6516('0xa')]);router[_0x6516('0x4')]('/timezones',auth['isAuthenticated'](),controller[_0x6516('0xb')]);router[_0x6516('0x4')](_0x6516('0xc'),auth[_0x6516('0x7')](),controller[_0x6516('0xd')]);router['get'](_0x6516('0xe'),auth[_0x6516('0x7')](),controller[_0x6516('0xf')]);router[_0x6516('0x10')]('/',auth[_0x6516('0x7')](),controller['create']);router[_0x6516('0x10')](_0x6516('0x11'),auth[_0x6516('0x7')](),controller[_0x6516('0x12')]);router[_0x6516('0x10')](_0x6516('0x13'),auth[_0x6516('0x7')](),controller[_0x6516('0x14')]);router[_0x6516('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x6516('0x16')]);router[_0x6516('0x17')](_0x6516('0xc'),auth[_0x6516('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index e46f756..a600345 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 _0xdca4=['INTEGER','DATE','moment','exports','STRING'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0xdca4,0x151));var _0x4dca=function(_0x5e0902,_0x70044c){_0x5e0902=_0x5e0902-0x0;var _0x1874b0=_0xdca4[_0x5e0902];return _0x1874b0;};'use strict';var moment=require(_0x4dca('0x0'));var Sequelize=require('sequelize');module[_0x4dca('0x1')]={'CmHopperId':{'type':Sequelize['INTEGER']},'phone':{'type':Sequelize[_0x4dca('0x2')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x4dca('0x3')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x4dca('0x4')],'defaultValue':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x4dca('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x4dca('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x4dca('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x4dca('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x4dca('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x4dca('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x8f72=['format','exports','STRING','INTEGER','DATE'];(function(_0x52495f,_0x32cf36){var _0x43e17b=function(_0x122c14){while(--_0x122c14){_0x52495f['push'](_0x52495f['shift']());}};_0x43e17b(++_0x32cf36);}(_0x8f72,0x1e1));var _0x28f7=function(_0x5c6cd1,_0x32031c){_0x5c6cd1=_0x5c6cd1-0x0;var _0x97db42=_0x8f72[_0x5c6cd1];return _0x97db42;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x28f7('0x0')]={'CmHopperId':{'type':Sequelize['INTEGER']},'phone':{'type':Sequelize[_0x28f7('0x1')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x28f7('0x2')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x28f7('0x3')],'defaultValue':moment()[_0x28f7('0x4')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x28f7('0x2')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x28f7('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x28f7('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js index e4dc527..718cba8 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 _0xf1d8=['rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','get','CmHopperAdditionalPhones','UserProfileResource','destroy','then','sendStatus','stack','name','index','map','fieldName','type','key','model','filters','intersection','query','attributes','fields','length','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','CmHopperAdditionalPhone','rawAttributes','keys','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format'];(function(_0x3074f3,_0x2d8f39){var _0x2a1455=function(_0x135bde){while(--_0x135bde){_0x3074f3['push'](_0x3074f3['shift']());}};_0x2a1455(++_0x2d8f39);}(_0xf1d8,0xfb));var _0x8f1d=function(_0x41ee16,_0xfa94c3){_0x41ee16=_0x41ee16-0x0;var _0x1f60de=_0xf1d8[_0x41ee16];return _0x1f60de;};'use strict';var emlformat=require(_0x8f1d('0x0'));var rimraf=require(_0x8f1d('0x1'));var zipdir=require(_0x8f1d('0x2'));var jsonpatch=require(_0x8f1d('0x3'));var rp=require(_0x8f1d('0x4'));var moment=require('moment');var BPromise=require(_0x8f1d('0x5'));var Mustache=require(_0x8f1d('0x6'));var util=require('util');var path=require(_0x8f1d('0x7'));var sox=require(_0x8f1d('0x8'));var csv=require(_0x8f1d('0x9'));var ejs=require(_0x8f1d('0xa'));var fs=require('fs');var fs_extra=require(_0x8f1d('0xb'));var _=require(_0x8f1d('0xc'));var squel=require(_0x8f1d('0xd'));var crypto=require(_0x8f1d('0xe'));var jsforce=require(_0x8f1d('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8f1d('0x10'));var Papa=require(_0x8f1d('0x11'));var Redis=require(_0x8f1d('0x12'));var authService=require(_0x8f1d('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8f1d('0x14'));var logger=require(_0x8f1d('0x15'))('api');var utils=require(_0x8f1d('0x16'));var config=require(_0x8f1d('0x17'));var licenseUtil=require(_0x8f1d('0x18'));var db=require(_0x8f1d('0x19'))['db'];function respondWithStatusCode(_0x202af2,_0x56f5aa){_0x56f5aa=_0x56f5aa||0xcc;return function(_0x5babe4){if(_0x5babe4){return _0x202af2['sendStatus'](_0x56f5aa);}return _0x202af2['status'](_0x56f5aa)[_0x8f1d('0x1a')]();};}function respondWithResult(_0x26ebbd,_0x4de9cc){_0x4de9cc=_0x4de9cc||0xc8;return function(_0x590e49){if(_0x590e49){return _0x26ebbd[_0x8f1d('0x1b')](_0x4de9cc)[_0x8f1d('0x1c')](_0x590e49);}};}function respondWithFilteredResult(_0x38b7eb,_0x4a1c98){return function(_0x5f2d0e){if(_0x5f2d0e){var _0x2c1ab6=typeof _0x4a1c98[_0x8f1d('0x1d')]===_0x8f1d('0x1e')&&typeof _0x4a1c98[_0x8f1d('0x1f')]===_0x8f1d('0x1e');var _0x4fc3d9=_0x5f2d0e[_0x8f1d('0x20')];var _0x1d1fe0=_0x2c1ab6?0x0:_0x4a1c98['offset'];var _0x5b550a=_0x2c1ab6?_0x5f2d0e[_0x8f1d('0x20')]:_0x4a1c98[_0x8f1d('0x1d')]+_0x4a1c98[_0x8f1d('0x1f')];var _0x53370c;if(_0x5b550a>=_0x4fc3d9){_0x5b550a=_0x4fc3d9;_0x53370c=0xc8;}else{_0x53370c=0xce;}_0x38b7eb[_0x8f1d('0x1b')](_0x53370c);return _0x38b7eb[_0x8f1d('0x21')]('Content-Range',_0x1d1fe0+'-'+_0x5b550a+'/'+_0x4fc3d9)[_0x8f1d('0x1c')](_0x5f2d0e);}return null;};}function patchUpdates(_0xb77705){return function(_0xb98a86){try{jsonpatch[_0x8f1d('0x22')](_0xb98a86,_0xb77705,!![]);}catch(_0xbb8692){return BPromise[_0x8f1d('0x23')](_0xbb8692);}return _0xb98a86[_0x8f1d('0x24')]();};}function saveUpdates(_0x289862,_0x16c98b){return function(_0x2f713e){if(_0x2f713e){return _0x2f713e[_0x8f1d('0x25')](_0x289862)['then'](function(_0x57d0fa){return _0x57d0fa;});}return null;};}function removeEntity(_0x332a70,_0x351008){return function(_0xf079f8){if(_0xf079f8){return _0xf079f8['destroy']()['then'](function(){var _0x27610b=_0xf079f8[_0x8f1d('0x26')]({'plain':!![]});var _0xe071e5=_0x8f1d('0x27');return db[_0x8f1d('0x28')][_0x8f1d('0x29')]({'where':{'type':_0xe071e5,'resourceId':_0x27610b['id']}})[_0x8f1d('0x2a')](function(){return _0xf079f8;});})['then'](function(){_0x332a70[_0x8f1d('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x172764,_0xb2d153){return function(_0xd36bee){if(!_0xd36bee){_0x172764[_0x8f1d('0x2b')](0x194);}return _0xd36bee;};}function handleError(_0x2762c1,_0x35175a){_0x35175a=_0x35175a||0x1f4;return function(_0x317d10){logger['error'](_0x317d10[_0x8f1d('0x2c')]);if(_0x317d10[_0x8f1d('0x2d')]){delete _0x317d10[_0x8f1d('0x2d')];}_0x2762c1['status'](_0x35175a)['send'](_0x317d10);};}exports[_0x8f1d('0x2e')]=function(_0x40575b,_0x198828){var _0xb201a6={},_0x12a0b6={},_0x27e0e4={'count':0x0,'rows':[]};var _0x13482f=_[_0x8f1d('0x2f')](db['CmHopperAdditionalPhone']['rawAttributes'],function(_0x32507e){return{'name':_0x32507e[_0x8f1d('0x30')],'type':_0x32507e[_0x8f1d('0x31')][_0x8f1d('0x32')]};});_0x12a0b6[_0x8f1d('0x33')]=_[_0x8f1d('0x2f')](_0x13482f,_0x8f1d('0x2d'));_0x12a0b6['query']=_['keys'](_0x40575b['query']);_0x12a0b6[_0x8f1d('0x34')]=_[_0x8f1d('0x35')](_0x12a0b6['model'],_0x12a0b6[_0x8f1d('0x36')]);_0xb201a6[_0x8f1d('0x37')]=_[_0x8f1d('0x35')](_0x12a0b6['model'],qs[_0x8f1d('0x38')](_0x40575b['query'][_0x8f1d('0x38')]));_0xb201a6[_0x8f1d('0x37')]=_0xb201a6[_0x8f1d('0x37')][_0x8f1d('0x39')]?_0xb201a6['attributes']:_0x12a0b6['model'];if(!_0x40575b['query']['hasOwnProperty'](_0x8f1d('0x3a'))){_0xb201a6[_0x8f1d('0x1f')]=qs[_0x8f1d('0x1f')](_0x40575b[_0x8f1d('0x36')][_0x8f1d('0x1f')]);_0xb201a6[_0x8f1d('0x1d')]=qs[_0x8f1d('0x1d')](_0x40575b[_0x8f1d('0x36')]['offset']);}_0xb201a6[_0x8f1d('0x3b')]=qs[_0x8f1d('0x3c')](_0x40575b[_0x8f1d('0x36')]['sort']);_0xb201a6[_0x8f1d('0x3d')]=qs[_0x8f1d('0x34')](_['pick'](_0x40575b[_0x8f1d('0x36')],_0x12a0b6[_0x8f1d('0x34')]),_0x13482f);if(_0x40575b[_0x8f1d('0x36')]['filter']){_0xb201a6['where']=_[_0x8f1d('0x3e')](_0xb201a6[_0x8f1d('0x3d')],{'$or':_[_0x8f1d('0x2f')](_0x13482f,function(_0x39acc9){if(_0x39acc9['type']!==_0x8f1d('0x3f')){var _0x18bf81={};_0x18bf81[_0x39acc9['name']]={'$like':'%'+_0x40575b['query'][_0x8f1d('0x40')]+'%'};return _0x18bf81;}})});}_0xb201a6=_[_0x8f1d('0x3e')]({},_0xb201a6,_0x40575b[_0x8f1d('0x41')]);var _0x3533e4={'where':_0xb201a6['where']};return db['CmHopperAdditionalPhone'][_0x8f1d('0x20')](_0x3533e4)[_0x8f1d('0x2a')](function(_0x2b142e){_0x27e0e4['count']=_0x2b142e;if(_0x40575b[_0x8f1d('0x36')][_0x8f1d('0x42')]){_0xb201a6[_0x8f1d('0x43')]=[{'all':!![]}];}return db['CmHopperAdditionalPhone'][_0x8f1d('0x44')](_0xb201a6);})[_0x8f1d('0x2a')](function(_0x42d4d2){_0x27e0e4[_0x8f1d('0x45')]=_0x42d4d2;return _0x27e0e4;})['then'](respondWithFilteredResult(_0x198828,_0xb201a6))[_0x8f1d('0x46')](handleError(_0x198828,null));};exports['show']=function(_0x5f39be,_0x128c80){var _0x23a9d8={'raw':!![],'where':{'id':_0x5f39be['params']['id']}},_0x2ffe8a={};_0x2ffe8a[_0x8f1d('0x33')]=_['keys'](db[_0x8f1d('0x47')][_0x8f1d('0x48')]);_0x2ffe8a['query']=_[_0x8f1d('0x49')](_0x5f39be[_0x8f1d('0x36')]);_0x2ffe8a['filters']=_[_0x8f1d('0x35')](_0x2ffe8a[_0x8f1d('0x33')],_0x2ffe8a[_0x8f1d('0x36')]);_0x23a9d8[_0x8f1d('0x37')]=_[_0x8f1d('0x35')](_0x2ffe8a['model'],qs[_0x8f1d('0x38')](_0x5f39be[_0x8f1d('0x36')][_0x8f1d('0x38')]));_0x23a9d8[_0x8f1d('0x37')]=_0x23a9d8[_0x8f1d('0x37')]['length']?_0x23a9d8[_0x8f1d('0x37')]:_0x2ffe8a[_0x8f1d('0x33')];if(_0x5f39be['query']['includeAll']){_0x23a9d8[_0x8f1d('0x43')]=[{'all':!![]}];}_0x23a9d8=_[_0x8f1d('0x3e')]({},_0x23a9d8,_0x5f39be[_0x8f1d('0x41')]);return db[_0x8f1d('0x47')][_0x8f1d('0x4a')](_0x23a9d8)['then'](handleEntityNotFound(_0x128c80,null))[_0x8f1d('0x2a')](respondWithResult(_0x128c80,null))['catch'](handleError(_0x128c80,null));};exports[_0x8f1d('0x4b')]=function(_0x5d7f8b,_0x2fb9ff){return db['CmHopperAdditionalPhone'][_0x8f1d('0x4b')](_0x5d7f8b['body'],{})[_0x8f1d('0x2a')](function(_0x5d498e){var _0xb3c411=_0x5d7f8b['user']['get']({'plain':!![]});if(!_0xb3c411)throw new Error(_0x8f1d('0x4c'));if(_0xb3c411[_0x8f1d('0x4d')]===_0x8f1d('0x4e')){var _0x2c040d=_0x5d498e[_0x8f1d('0x26')]({'plain':!![]});var _0x174a50=_0x8f1d('0x27');return db[_0x8f1d('0x4f')][_0x8f1d('0x4a')]({'where':{'name':_0x174a50,'userProfileId':_0xb3c411['userProfileId']},'raw':!![]})['then'](function(_0x805349){if(_0x805349&&_0x805349[_0x8f1d('0x50')]===0x0){return db[_0x8f1d('0x28')][_0x8f1d('0x4b')]({'name':_0x2c040d['name'],'resourceId':_0x2c040d['id'],'type':_0x805349[_0x8f1d('0x2d')],'sectionId':_0x805349['id']},{})[_0x8f1d('0x2a')](function(){return _0x5d498e;});}else{return _0x5d498e;}})[_0x8f1d('0x46')](function(_0x10f719){logger['error'](_0x8f1d('0x51'),_0x10f719);throw _0x10f719;});}return _0x5d498e;})[_0x8f1d('0x2a')](respondWithResult(_0x2fb9ff,0xc9))[_0x8f1d('0x46')](handleError(_0x2fb9ff,null));};exports['update']=function(_0x520152,_0x324e39){if(_0x520152[_0x8f1d('0x52')]['id']){delete _0x520152[_0x8f1d('0x52')]['id'];}return db[_0x8f1d('0x47')][_0x8f1d('0x4a')]({'where':{'id':_0x520152[_0x8f1d('0x53')]['id']}})[_0x8f1d('0x2a')](handleEntityNotFound(_0x324e39,null))[_0x8f1d('0x2a')](saveUpdates(_0x520152[_0x8f1d('0x52')],null))['then'](respondWithResult(_0x324e39,null))[_0x8f1d('0x46')](handleError(_0x324e39,null));};exports['destroy']=function(_0xc7ae1a,_0x478e95){return db[_0x8f1d('0x47')]['find']({'where':{'id':_0xc7ae1a[_0x8f1d('0x53')]['id']}})[_0x8f1d('0x2a')](handleEntityNotFound(_0x478e95,null))[_0x8f1d('0x2a')](removeEntity(_0x478e95,null))['catch'](handleError(_0x478e95,null));}; \ No newline at end of file +var _0xfb82=['type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','VIRTUAL','filter','merge','options','include','findAll','rows','catch','includeAll','find','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','fs-extra','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','destroy','get','CmHopperAdditionalPhones','UserProfileResource','then','error','stack','name','send','index','map','CmHopperAdditionalPhone','rawAttributes','fieldName'];(function(_0x3c4116,_0x8a1a3d){var _0x1bbdcd=function(_0x4ad059){while(--_0x4ad059){_0x3c4116['push'](_0x3c4116['shift']());}};_0x1bbdcd(++_0x8a1a3d);}(_0xfb82,0x113));var _0x2fb8=function(_0x178dfb,_0x16ef31){_0x178dfb=_0x178dfb-0x0;var _0x5c88db=_0xfb82[_0x178dfb];return _0x5c88db;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2fb8('0x0'));var zipdir=require(_0x2fb8('0x1'));var jsonpatch=require(_0x2fb8('0x2'));var rp=require('request-promise');var moment=require(_0x2fb8('0x3'));var BPromise=require(_0x2fb8('0x4'));var Mustache=require('mustache');var util=require(_0x2fb8('0x5'));var path=require(_0x2fb8('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2fb8('0x7'));var _=require('lodash');var squel=require(_0x2fb8('0x8'));var crypto=require(_0x2fb8('0x9'));var jsforce=require(_0x2fb8('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x2fb8('0xb'));var querystring=require(_0x2fb8('0xc'));var Papa=require('papaparse');var Redis=require(_0x2fb8('0xd'));var authService=require(_0x2fb8('0xe'));var qs=require(_0x2fb8('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2fb8('0x10'));var logger=require(_0x2fb8('0x11'))(_0x2fb8('0x12'));var utils=require(_0x2fb8('0x13'));var config=require(_0x2fb8('0x14'));var licenseUtil=require(_0x2fb8('0x15'));var db=require(_0x2fb8('0x16'))['db'];function respondWithStatusCode(_0x387069,_0x53469a){_0x53469a=_0x53469a||0xcc;return function(_0x46663e){if(_0x46663e){return _0x387069[_0x2fb8('0x17')](_0x53469a);}return _0x387069[_0x2fb8('0x18')](_0x53469a)[_0x2fb8('0x19')]();};}function respondWithResult(_0x28f227,_0x3aa86c){_0x3aa86c=_0x3aa86c||0xc8;return function(_0x173749){if(_0x173749){return _0x28f227[_0x2fb8('0x18')](_0x3aa86c)[_0x2fb8('0x1a')](_0x173749);}};}function respondWithFilteredResult(_0xc88ea2,_0x493ed4){return function(_0x41762a){if(_0x41762a){var _0x498ac4=typeof _0x493ed4[_0x2fb8('0x1b')]===_0x2fb8('0x1c')&&typeof _0x493ed4[_0x2fb8('0x1d')]===_0x2fb8('0x1c');var _0x192853=_0x41762a[_0x2fb8('0x1e')];var _0x3ea269=_0x498ac4?0x0:_0x493ed4[_0x2fb8('0x1b')];var _0x1ac830=_0x498ac4?_0x41762a[_0x2fb8('0x1e')]:_0x493ed4[_0x2fb8('0x1b')]+_0x493ed4[_0x2fb8('0x1d')];var _0x39a7b6;if(_0x1ac830>=_0x192853){_0x1ac830=_0x192853;_0x39a7b6=0xc8;}else{_0x39a7b6=0xce;}_0xc88ea2[_0x2fb8('0x18')](_0x39a7b6);return _0xc88ea2[_0x2fb8('0x1f')]('Content-Range',_0x3ea269+'-'+_0x1ac830+'/'+_0x192853)['json'](_0x41762a);}return null;};}function patchUpdates(_0x189ee2){return function(_0x2c9446){try{jsonpatch['apply'](_0x2c9446,_0x189ee2,!![]);}catch(_0x3a79e2){return BPromise[_0x2fb8('0x20')](_0x3a79e2);}return _0x2c9446[_0x2fb8('0x21')]();};}function saveUpdates(_0x5afa05,_0x13f2a4){return function(_0x13ff6a){if(_0x13ff6a){return _0x13ff6a[_0x2fb8('0x22')](_0x5afa05)['then'](function(_0x2bbf9a){return _0x2bbf9a;});}return null;};}function removeEntity(_0x5de2a1,_0x2d4db3){return function(_0x1351ff){if(_0x1351ff){return _0x1351ff[_0x2fb8('0x23')]()['then'](function(){var _0x53cb25=_0x1351ff[_0x2fb8('0x24')]({'plain':!![]});var _0x14f746=_0x2fb8('0x25');return db[_0x2fb8('0x26')][_0x2fb8('0x23')]({'where':{'type':_0x14f746,'resourceId':_0x53cb25['id']}})[_0x2fb8('0x27')](function(){return _0x1351ff;});})[_0x2fb8('0x27')](function(){_0x5de2a1[_0x2fb8('0x18')](0xcc)[_0x2fb8('0x19')]();});}};}function handleEntityNotFound(_0xecfbf7,_0x293ab5){return function(_0x25181d){if(!_0x25181d){_0xecfbf7[_0x2fb8('0x17')](0x194);}return _0x25181d;};}function handleError(_0x17488e,_0x203a5c){_0x203a5c=_0x203a5c||0x1f4;return function(_0x5ae78c){logger[_0x2fb8('0x28')](_0x5ae78c[_0x2fb8('0x29')]);if(_0x5ae78c['name']){delete _0x5ae78c[_0x2fb8('0x2a')];}_0x17488e[_0x2fb8('0x18')](_0x203a5c)[_0x2fb8('0x2b')](_0x5ae78c);};}exports[_0x2fb8('0x2c')]=function(_0x287886,_0x10f4ee){var _0x564d2c={},_0x2d4e0f={},_0x13a744={'count':0x0,'rows':[]};var _0x4c0ccb=_[_0x2fb8('0x2d')](db[_0x2fb8('0x2e')][_0x2fb8('0x2f')],function(_0x454931){return{'name':_0x454931[_0x2fb8('0x30')],'type':_0x454931[_0x2fb8('0x31')]['key']};});_0x2d4e0f['model']=_[_0x2fb8('0x2d')](_0x4c0ccb,_0x2fb8('0x2a'));_0x2d4e0f[_0x2fb8('0x32')]=_[_0x2fb8('0x33')](_0x287886[_0x2fb8('0x32')]);_0x2d4e0f[_0x2fb8('0x34')]=_[_0x2fb8('0x35')](_0x2d4e0f[_0x2fb8('0x36')],_0x2d4e0f[_0x2fb8('0x32')]);_0x564d2c[_0x2fb8('0x37')]=_[_0x2fb8('0x35')](_0x2d4e0f[_0x2fb8('0x36')],qs[_0x2fb8('0x38')](_0x287886['query']['fields']));_0x564d2c[_0x2fb8('0x37')]=_0x564d2c['attributes'][_0x2fb8('0x39')]?_0x564d2c[_0x2fb8('0x37')]:_0x2d4e0f[_0x2fb8('0x36')];if(!_0x287886[_0x2fb8('0x32')][_0x2fb8('0x3a')]('nolimit')){_0x564d2c['limit']=qs[_0x2fb8('0x1d')](_0x287886['query'][_0x2fb8('0x1d')]);_0x564d2c['offset']=qs['offset'](_0x287886[_0x2fb8('0x32')]['offset']);}_0x564d2c[_0x2fb8('0x3b')]=qs[_0x2fb8('0x3c')](_0x287886[_0x2fb8('0x32')][_0x2fb8('0x3c')]);_0x564d2c[_0x2fb8('0x3d')]=qs['filters'](_['pick'](_0x287886['query'],_0x2d4e0f[_0x2fb8('0x34')]),_0x4c0ccb);if(_0x287886[_0x2fb8('0x32')]['filter']){_0x564d2c['where']=_['merge'](_0x564d2c['where'],{'$or':_['map'](_0x4c0ccb,function(_0x401c1a){if(_0x401c1a['type']!==_0x2fb8('0x3e')){var _0x3eca32={};_0x3eca32[_0x401c1a[_0x2fb8('0x2a')]]={'$like':'%'+_0x287886[_0x2fb8('0x32')][_0x2fb8('0x3f')]+'%'};return _0x3eca32;}})});}_0x564d2c=_[_0x2fb8('0x40')]({},_0x564d2c,_0x287886[_0x2fb8('0x41')]);var _0x44a198={'where':_0x564d2c[_0x2fb8('0x3d')]};return db[_0x2fb8('0x2e')][_0x2fb8('0x1e')](_0x44a198)[_0x2fb8('0x27')](function(_0x2a99b4){_0x13a744[_0x2fb8('0x1e')]=_0x2a99b4;if(_0x287886[_0x2fb8('0x32')]['includeAll']){_0x564d2c[_0x2fb8('0x42')]=[{'all':!![]}];}return db['CmHopperAdditionalPhone'][_0x2fb8('0x43')](_0x564d2c);})['then'](function(_0x28824d){_0x13a744[_0x2fb8('0x44')]=_0x28824d;return _0x13a744;})[_0x2fb8('0x27')](respondWithFilteredResult(_0x10f4ee,_0x564d2c))[_0x2fb8('0x45')](handleError(_0x10f4ee,null));};exports['show']=function(_0x47b79b,_0x28d17b){var _0x4d404e={'raw':!![],'where':{'id':_0x47b79b['params']['id']}},_0x1fe249={};_0x1fe249[_0x2fb8('0x36')]=_[_0x2fb8('0x33')](db[_0x2fb8('0x2e')][_0x2fb8('0x2f')]);_0x1fe249['query']=_[_0x2fb8('0x33')](_0x47b79b[_0x2fb8('0x32')]);_0x1fe249[_0x2fb8('0x34')]=_['intersection'](_0x1fe249[_0x2fb8('0x36')],_0x1fe249[_0x2fb8('0x32')]);_0x4d404e[_0x2fb8('0x37')]=_[_0x2fb8('0x35')](_0x1fe249['model'],qs[_0x2fb8('0x38')](_0x47b79b[_0x2fb8('0x32')][_0x2fb8('0x38')]));_0x4d404e[_0x2fb8('0x37')]=_0x4d404e[_0x2fb8('0x37')][_0x2fb8('0x39')]?_0x4d404e[_0x2fb8('0x37')]:_0x1fe249[_0x2fb8('0x36')];if(_0x47b79b[_0x2fb8('0x32')][_0x2fb8('0x46')]){_0x4d404e[_0x2fb8('0x42')]=[{'all':!![]}];}_0x4d404e=_['merge']({},_0x4d404e,_0x47b79b[_0x2fb8('0x41')]);return db[_0x2fb8('0x2e')][_0x2fb8('0x47')](_0x4d404e)[_0x2fb8('0x27')](handleEntityNotFound(_0x28d17b,null))[_0x2fb8('0x27')](respondWithResult(_0x28d17b,null))[_0x2fb8('0x45')](handleError(_0x28d17b,null));};exports['create']=function(_0x23fd9f,_0x2d9c1c){return db[_0x2fb8('0x2e')]['create'](_0x23fd9f[_0x2fb8('0x48')],{})[_0x2fb8('0x27')](function(_0x304b73){var _0x54679f=_0x23fd9f['user'][_0x2fb8('0x24')]({'plain':!![]});if(!_0x54679f)throw new Error(_0x2fb8('0x49'));if(_0x54679f['role']===_0x2fb8('0x4a')){var _0x5b3e7e=_0x304b73[_0x2fb8('0x24')]({'plain':!![]});var _0x102479=_0x2fb8('0x25');return db[_0x2fb8('0x4b')]['find']({'where':{'name':_0x102479,'userProfileId':_0x54679f[_0x2fb8('0x4c')]},'raw':!![]})[_0x2fb8('0x27')](function(_0x42d8bf){if(_0x42d8bf&&_0x42d8bf[_0x2fb8('0x4d')]===0x0){return db[_0x2fb8('0x26')][_0x2fb8('0x4e')]({'name':_0x5b3e7e[_0x2fb8('0x2a')],'resourceId':_0x5b3e7e['id'],'type':_0x42d8bf['name'],'sectionId':_0x42d8bf['id']},{})[_0x2fb8('0x27')](function(){return _0x304b73;});}else{return _0x304b73;}})[_0x2fb8('0x45')](function(_0x5c57d1){logger['error'](_0x2fb8('0x4f'),_0x5c57d1);throw _0x5c57d1;});}return _0x304b73;})[_0x2fb8('0x27')](respondWithResult(_0x2d9c1c,0xc9))[_0x2fb8('0x45')](handleError(_0x2d9c1c,null));};exports['update']=function(_0x54f5a6,_0x363bfc){if(_0x54f5a6[_0x2fb8('0x48')]['id']){delete _0x54f5a6['body']['id'];}return db[_0x2fb8('0x2e')][_0x2fb8('0x47')]({'where':{'id':_0x54f5a6[_0x2fb8('0x50')]['id']}})[_0x2fb8('0x27')](handleEntityNotFound(_0x363bfc,null))[_0x2fb8('0x27')](saveUpdates(_0x54f5a6[_0x2fb8('0x48')],null))[_0x2fb8('0x27')](respondWithResult(_0x363bfc,null))[_0x2fb8('0x45')](handleError(_0x363bfc,null));};exports[_0x2fb8('0x23')]=function(_0x5e57bc,_0x1d0649){return db['CmHopperAdditionalPhone'][_0x2fb8('0x47')]({'where':{'id':_0x5e57bc[_0x2fb8('0x50')]['id']}})['then'](handleEntityNotFound(_0x1d0649,null))['then'](removeEntity(_0x1d0649,null))['catch'](handleError(_0x1d0649,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index dfc59a5..1435c6f 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 _0x1e14=['api','path','../../config/environment','./cmHopperAdditionalPhone.attributes','exports','define','CmHopperAdditionalPhone','cm_hopper_additional_phones','lodash','util','../../config/logger'];(function(_0x1fca3f,_0x2e69b7){var _0xbcd8be=function(_0x694349){while(--_0x694349){_0x1fca3f['push'](_0x1fca3f['shift']());}};_0xbcd8be(++_0x2e69b7);}(_0x1e14,0xef));var _0x41e1=function(_0x374849,_0x393920){_0x374849=_0x374849-0x0;var _0x21c8e4=_0x1e14[_0x374849];return _0x21c8e4;};'use strict';var _=require(_0x41e1('0x0'));var util=require(_0x41e1('0x1'));var logger=require(_0x41e1('0x2'))(_0x41e1('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x41e1('0x4'));var rimraf=require('rimraf');var config=require(_0x41e1('0x5'));var attributes=require(_0x41e1('0x6'));module[_0x41e1('0x7')]=function(_0xd3a2bf,_0x362862){return _0xd3a2bf[_0x41e1('0x8')](_0x41e1('0x9'),attributes,{'tableName':_0x41e1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbddb=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperAdditionalPhone.attributes','define','CmHopperAdditionalPhone','cm_hopper_additional_phones','lodash'];(function(_0x388255,_0x5eb62f){var _0x37bab5=function(_0x101269){while(--_0x101269){_0x388255['push'](_0x388255['shift']());}};_0x37bab5(++_0x5eb62f);}(_0xbddb,0x1bf));var _0xbbdd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbddb[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xbbdd('0x0'));var util=require(_0xbbdd('0x1'));var logger=require(_0xbbdd('0x2'))(_0xbbdd('0x3'));var moment=require(_0xbbdd('0x4'));var BPromise=require(_0xbbdd('0x5'));var rp=require(_0xbbdd('0x6'));var fs=require('fs');var path=require(_0xbbdd('0x7'));var rimraf=require(_0xbbdd('0x8'));var config=require(_0xbbdd('0x9'));var attributes=require(_0xbbdd('0xa'));module['exports']=function(_0x2c0320,_0xe88056){return _0x2c0320[_0xbbdd('0xb')](_0xbbdd('0xc'),attributes,{'tableName':_0xbbdd('0xd'),'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 d7164b8..9453744 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 _0x761b=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','VerifyAdditionalPhones','CmHopper','findOne','ContactId','body','ListId','CampaignId','CmHopperAdditionalPhone','OrderBy','ASC','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','entity','dialGlobalMaxRetry','countmachineretry','SwapAdditionalPhones','VoiceQueueId','waitTime','isNil','scheduledat','minutes','add','phone','createdAt','updatedAt','transaction','update','activateAdditionalPhone','IncrementPreviewCounters','field','lodash','util','moment'];(function(_0x4f2bc2,_0x1520ed){var _0x45e3e1=function(_0x274f00){while(--_0x274f00){_0x4f2bc2['push'](_0x4f2bc2['shift']());}};_0x45e3e1(++_0x1520ed);}(_0x761b,0xa8));var _0xb761=function(_0x325654,_0x4e6fe1){_0x325654=_0x325654-0x0;var _0x994fc7=_0x761b[_0x325654];return _0x994fc7;};'use strict';var _=require(_0xb761('0x0'));var util=require(_0xb761('0x1'));var moment=require(_0xb761('0x2'));var BPromise=require(_0xb761('0x3'));var rs=require(_0xb761('0x4'));var fs=require('fs');var Redis=require(_0xb761('0x5'));var db=require(_0xb761('0x6'))['db'];var utils=require(_0xb761('0x7'));var logger=require('../../config/logger')(_0xb761('0x8'));var config=require(_0xb761('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xb761('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1aaeaf,_0x103125,_0x51f718){return new BPromise(function(_0x260aaf,_0x6e12f8){return client[_0xb761('0xb')](_0x1aaeaf,_0x51f718)[_0xb761('0xc')](function(_0x39a155){logger['info'](_0xb761('0xd'),_0x103125,_0xb761('0xe'));logger['debug'](_0xb761('0xf'),_0x103125,_0xb761('0xe'),JSON['stringify'](_0x39a155));if(_0x39a155[_0xb761('0x10')]){if(_0x39a155[_0xb761('0x10')][_0xb761('0x11')]===0x1f4){logger[_0xb761('0x10')](_0xb761('0xd'),_0x103125,_0x39a155[_0xb761('0x10')][_0xb761('0x12')]);return _0x6e12f8(_0x39a155[_0xb761('0x10')][_0xb761('0x12')]);}logger[_0xb761('0x10')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x103125,_0x39a155[_0xb761('0x10')][_0xb761('0x12')]);return _0x260aaf(_0x39a155['error'][_0xb761('0x12')]);}else{logger[_0xb761('0x13')](_0xb761('0xd'),_0x103125,_0xb761('0xe'));_0x260aaf(_0x39a155[_0xb761('0x14')]['message']);}})[_0xb761('0x15')](function(_0x3b4d78){logger[_0xb761('0x10')](_0xb761('0xd'),_0x103125,_0x3b4d78);_0x6e12f8(_0x3b4d78);});});}exports[_0xb761('0x16')]=function(_0x3b9cb8){var _0x4778e7=this;return new Promise(function(_0x3890b0,_0x346bb2){return db[_0xb761('0x17')][_0xb761('0x18')]({'raw':!![],'where':{'ContactId':_0x3b9cb8['body'][_0xb761('0x19')],'ListId':_0x3b9cb8[_0xb761('0x1a')][_0xb761('0x1b')],'VoiceQueueId':_0x3b9cb8[_0xb761('0x1a')]['VoiceQueueId']===undefined?null:_0x3b9cb8[_0xb761('0x1a')]['VoiceQueueId'],'CampaignId':_0x3b9cb8[_0xb761('0x1a')][_0xb761('0x1c')]===undefined?null:_0x3b9cb8[_0xb761('0x1a')][_0xb761('0x1c')]}})[_0xb761('0xc')](function(_0x2b6b89){if(_0x2b6b89!=null){return db[_0xb761('0x1d')][_0xb761('0x18')]({'raw':!![],'where':{'CmHopperId':_0x2b6b89['id'],'OrderBy':{'$gt':_0x2b6b89[_0xb761('0x1e')]}},'order':[[_0xb761('0x1e'),_0xb761('0x1f')]]})[_0xb761('0xc')](function(_0xd0288f){var _0x482c7d=0x0;if(_0xd0288f){if(_0xd0288f[_0xb761('0x20')]+_0xd0288f[_0xb761('0x21')]+_0xd0288f[_0xb761('0x22')]+_0xd0288f[_0xb761('0x23')]+_0xd0288f[_0xb761('0x24')]+_0xd0288f[_0xb761('0x25')]+_0xd0288f['countmachineretry']+_0xd0288f[_0xb761('0x26')]<_0x3b9cb8[_0xb761('0x27')][_0xb761('0x28')])_0x482c7d=0x1;_0x3890b0({'additional':_0x482c7d});}else{return db[_0xb761('0x1d')][_0xb761('0x18')]({'raw':!![],'where':{'CmHopperId':_0x2b6b89['id']},'order':[['OrderBy','ASC']]})[_0xb761('0xc')](function(_0x805829){var _0x5e76df=0x0;if(_0x805829){if(_0x805829[_0xb761('0x20')]+_0x805829[_0xb761('0x21')]+_0x805829['countnoanswerretry']+_0x805829[_0xb761('0x23')]+_0x805829[_0xb761('0x24')]+_0x805829[_0xb761('0x25')]+_0x805829[_0xb761('0x29')]+_0x805829[_0xb761('0x26')]<_0x3b9cb8['entity'][_0xb761('0x28')])_0x5e76df=0x1;_0x3890b0({'additional':_0x5e76df});}else{_0x3890b0({'additional':0x0});}})[_0xb761('0x15')](function(_0xb4d826){logger[_0xb761('0x10')](_0xb761('0x16'),_0xb4d826['message']);_0x346bb2(_0x4778e7[_0xb761('0x10')](0x1f4,_0xb4d826[_0xb761('0x12')]));});}})[_0xb761('0x15')](function(_0x2c064d){logger[_0xb761('0x10')]('VerifyAdditionalPhones',_0x2c064d[_0xb761('0x12')]);_0x346bb2(_0x4778e7['error'](0x1f4,_0x2c064d[_0xb761('0x12')]));});}else _0x3890b0({'additional':0x0});});});};exports[_0xb761('0x2a')]=function(_0x231a28){var _0x3a7087=this;return new Promise(function(_0x352ecc,_0x28c282){return db['CmHopper']['findOne']({'raw':!![],'where':{'ContactId':_0x231a28[_0xb761('0x1a')]['ContactId'],'ListId':_0x231a28[_0xb761('0x1a')][_0xb761('0x1b')],'VoiceQueueId':_0x231a28[_0xb761('0x1a')][_0xb761('0x2b')]===undefined?null:_0x231a28['body'][_0xb761('0x2b')],'CampaignId':_0x231a28[_0xb761('0x1a')]['CampaignId']===undefined?null:_0x231a28[_0xb761('0x1a')][_0xb761('0x1c')]}})[_0xb761('0xc')](function(_0xfa3c43){if(_0xfa3c43!=null){return db[_0xb761('0x1d')]['findOne']({'raw':!![],'where':{'CmHopperId':_0xfa3c43['id'],'OrderBy':{'$gte':_0xfa3c43[_0xb761('0x1e')]}},'order':[['OrderBy','ASC']]})[_0xb761('0xc')](function(_0x24ed9e){if(_0x24ed9e)return activateAdditionalPhone(_0xfa3c43,_0x231a28[_0xb761('0x1a')],_0x24ed9e,_0x231a28['duration'],_0x231a28[_0xb761('0x2c')])['then'](function(_0x2c1441){_0x352ecc(_0x2c1441);});else{return db[_0xb761('0x1d')][_0xb761('0x18')]({'raw':!![],'where':{'CmHopperId':_0xfa3c43['id']},'order':[[_0xb761('0x1e'),'ASC']]})['then'](function(_0x444ca1){if(_0x444ca1)return activateAdditionalPhone(_0xfa3c43,_0x231a28['body'],_0x444ca1,_0x231a28['duration'],_0x231a28['waitTime'])[_0xb761('0xc')](function(_0x1d8cbb){_0x352ecc(_0x1d8cbb);});else{_0x352ecc({'id':_0xfa3c43['id'],'phone':''});}})['catch'](function(_0x1846d9){logger[_0xb761('0x10')](_0xb761('0x16'),_0x1846d9[_0xb761('0x12')]);_0x28c282(_0x3a7087[_0xb761('0x10')](0x1f4,_0x1846d9[_0xb761('0x12')]));});}})[_0xb761('0x15')](function(_0x388cd3){logger['error'](_0xb761('0x16'),_0x388cd3[_0xb761('0x12')]);_0x28c282(_0x3a7087['error'](0x1f4,_0x388cd3[_0xb761('0x12')]));});}else _0x352ecc(0x1);});});};function activateAdditionalPhone(_0x326400,_0x4f4421,_0x5dfc5e,_0x2cd7a1,_0x23f6b0){return new Promise(function(_0x330f05,_0xeff45){var _0x485e52;if(_[_0xb761('0x2d')](_0x5dfc5e['scheduledat'])){_0x5dfc5e[_0xb761('0x2e')]=moment();}if(moment()>moment(_0x5dfc5e[_0xb761('0x2e')])){_0x485e52=moment()['add'](_0x23f6b0||0x3,_0xb761('0x2f'));}else{if(_0x5dfc5e['OrderBy']==0x0){_0x485e52=moment(_0x5dfc5e[_0xb761('0x2e')]);}else{_0x485e52=moment()['add'](_0x23f6b0||0x3,_0xb761('0x2f'));}}if(_[_0xb761('0x2d')](_0x485e52)){_0x485e52=moment()[_0xb761('0x30')](_0x23f6b0||0x3,'minutes');}var _0x5aec09={'phone':_0x326400[_0xb761('0x31')],'active':0x0,'OrderBy':_[_0xb761('0x2d')](_0x326400[_0xb761('0x1e')])?0x0:_0x326400[_0xb761('0x1e')],'scheduledat':moment()[_0xb761('0x30')](_0x2cd7a1||0x1,_0xb761('0x2f')),'countbusyretry':_0x4f4421[_0xb761('0x20')],'countcongestionretry':_0x4f4421[_0xb761('0x21')],'countnoanswerretry':_0x4f4421[_0xb761('0x22')],'countnosuchnumberretry':_0x4f4421[_0xb761('0x23')],'countdropretry':_0x4f4421['countdropretry'],'countabandonedretry':_0x4f4421[_0xb761('0x25')],'countmachineretry':_0x4f4421[_0xb761('0x29')],'countagentrejectretry':_0x4f4421['countagentrejectretry'],'createdAt':_0x4f4421[_0xb761('0x32')],'updatedAt':_0x4f4421[_0xb761('0x33')]};var _0x33cf1f={'CmHopperId':_0x326400['id'],'phone':_0x5dfc5e[_0xb761('0x31')],'active':0x0,'OrderBy':_['isNil'](_0x5dfc5e['OrderBy'])?0x0:_0x5dfc5e[_0xb761('0x1e')],'scheduledat':_0x485e52,'countbusyretry':_0x5dfc5e['countbusyretry'],'countcongestionretry':_0x5dfc5e[_0xb761('0x21')],'countnoanswerretry':_0x5dfc5e[_0xb761('0x22')],'countnosuchnumberretry':_0x5dfc5e[_0xb761('0x23')],'countdropretry':_0x5dfc5e['countdropretry'],'countabandonedretry':_0x5dfc5e['countabandonedretry'],'countmachineretry':_0x5dfc5e[_0xb761('0x29')],'countagentrejectretry':_0x5dfc5e[_0xb761('0x26')],'createdAt':_0x5dfc5e[_0xb761('0x32')],'updatedAt':_0x5dfc5e['updatedAt']};return db['sequelize'][_0xb761('0x34')](function(_0x4bbdd2){return db[_0xb761('0x1d')][_0xb761('0x35')](_0x5aec09,{'where':{'id':_0x5dfc5e['id']}},{'transaction':_0x4bbdd2})[_0xb761('0xc')](function(){return db[_0xb761('0x17')][_0xb761('0x35')](_0x33cf1f,{'where':{'id':_0x326400['id']}},{'transaction':_0x4bbdd2});});})['then'](function(_0x262d5a){_0x330f05({'id':_0x326400['id'],'phone':_0x5dfc5e[_0xb761('0x31')]});})[_0xb761('0x15')](function(_0x1a993d){logger['error'](_0xb761('0x36'),_0x1a993d[_0xb761('0x12')]);_0xeff45({'error':_0x1a993d[_0xb761('0x12')]});});});}exports[_0xb761('0x37')]=function(_0x24767c){var _0x45b782=this;return new Promise(function(_0x12d9d2,_0x58533c){return db[_0xb761('0x17')][_0xb761('0x35')](_0x24767c['body'][_0xb761('0x38')],{'where':{'id':_0x24767c[_0xb761('0x1a')]['id']}})[_0xb761('0xc')](function(_0x424529){_0x12d9d2(_0x424529);})[_0xb761('0x15')](function(_0x2c67c2){logger[_0xb761('0x10')](_0xb761('0x37'),_0x2c67c2['message']);_0x58533c(_0x45b782[_0xb761('0x10')](0x1f4,_0x2c67c2[_0xb761('0x12')]));});});}; \ No newline at end of file +var _0x347f=['ASC','then','countbusyretry','countcongestionretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','entity','dialGlobalMaxRetry','countnoanswerretry','catch','SwapAdditionalPhones','ListId','duration','waitTime','isNil','scheduledat','minutes','add','countnosuchnumberretry','createdAt','updatedAt','sequelize','transaction','update','field','IncrementPreviewCounters','util','moment','bluebird','randomstring','rpc','jayson/promise','http','request','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','code','CmHopperAdditionalPhone,\x20%s,\x20%s','error','message','result','VerifyAdditionalPhones','CmHopper','findOne','body','ContactId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x347f,0x1cc));var _0xf347=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x347f[_0x432682];return _0x463d05;};'use strict';var _=require('lodash');var util=require(_0xf347('0x0'));var moment=require(_0xf347('0x1'));var BPromise=require(_0xf347('0x2'));var rs=require(_0xf347('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf347('0x4'));var config=require('../../config/environment');var jayson=require(_0xf347('0x5'));var client=jayson['client'][_0xf347('0x6')]({'port':0x232a});function respondWithRpcPromise(_0xfbe434,_0x509547,_0x22709c){return new BPromise(function(_0xc358cc,_0x1c31d6){return client[_0xf347('0x7')](_0xfbe434,_0x22709c)['then'](function(_0xac7693){logger['info']('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x509547,_0xf347('0x8'));logger[_0xf347('0x9')](_0xf347('0xa'),_0x509547,_0xf347('0x8'),JSON[_0xf347('0xb')](_0xac7693));if(_0xac7693['error']){if(_0xac7693['error'][_0xf347('0xc')]===0x1f4){logger['error'](_0xf347('0xd'),_0x509547,_0xac7693[_0xf347('0xe')][_0xf347('0xf')]);return _0x1c31d6(_0xac7693[_0xf347('0xe')][_0xf347('0xf')]);}logger[_0xf347('0xe')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x509547,_0xac7693[_0xf347('0xe')][_0xf347('0xf')]);return _0xc358cc(_0xac7693[_0xf347('0xe')]['message']);}else{logger['info'](_0xf347('0xd'),_0x509547,_0xf347('0x8'));_0xc358cc(_0xac7693[_0xf347('0x10')][_0xf347('0xf')]);}})['catch'](function(_0x5d71d2){logger[_0xf347('0xe')](_0xf347('0xd'),_0x509547,_0x5d71d2);_0x1c31d6(_0x5d71d2);});});}exports[_0xf347('0x11')]=function(_0x5a03be){var _0x442834=this;return new Promise(function(_0x3428b8,_0x347efe){return db[_0xf347('0x12')][_0xf347('0x13')]({'raw':!![],'where':{'ContactId':_0x5a03be[_0xf347('0x14')][_0xf347('0x15')],'ListId':_0x5a03be[_0xf347('0x14')]['ListId'],'VoiceQueueId':_0x5a03be[_0xf347('0x14')][_0xf347('0x16')]===undefined?null:_0x5a03be[_0xf347('0x14')][_0xf347('0x16')],'CampaignId':_0x5a03be[_0xf347('0x14')][_0xf347('0x17')]===undefined?null:_0x5a03be[_0xf347('0x14')][_0xf347('0x17')]}})['then'](function(_0x439deb){if(_0x439deb!=null){return db[_0xf347('0x18')][_0xf347('0x13')]({'raw':!![],'where':{'CmHopperId':_0x439deb['id'],'OrderBy':{'$gt':_0x439deb[_0xf347('0x19')]}},'order':[['OrderBy',_0xf347('0x1a')]]})[_0xf347('0x1b')](function(_0x272a99){var _0x3bc9b8=0x0;if(_0x272a99){if(_0x272a99[_0xf347('0x1c')]+_0x272a99[_0xf347('0x1d')]+_0x272a99['countnoanswerretry']+_0x272a99['countnosuchnumberretry']+_0x272a99[_0xf347('0x1e')]+_0x272a99[_0xf347('0x1f')]+_0x272a99[_0xf347('0x20')]+_0x272a99[_0xf347('0x21')]<_0x5a03be[_0xf347('0x22')][_0xf347('0x23')])_0x3bc9b8=0x1;_0x3428b8({'additional':_0x3bc9b8});}else{return db[_0xf347('0x18')][_0xf347('0x13')]({'raw':!![],'where':{'CmHopperId':_0x439deb['id']},'order':[['OrderBy','ASC']]})[_0xf347('0x1b')](function(_0x27b327){var _0x45ec16=0x0;if(_0x27b327){if(_0x27b327[_0xf347('0x1c')]+_0x27b327['countcongestionretry']+_0x27b327[_0xf347('0x24')]+_0x27b327['countnosuchnumberretry']+_0x27b327[_0xf347('0x1e')]+_0x27b327[_0xf347('0x1f')]+_0x27b327[_0xf347('0x20')]+_0x27b327[_0xf347('0x21')]<_0x5a03be[_0xf347('0x22')][_0xf347('0x23')])_0x45ec16=0x1;_0x3428b8({'additional':_0x45ec16});}else{_0x3428b8({'additional':0x0});}})[_0xf347('0x25')](function(_0x29e3ae){logger[_0xf347('0xe')]('VerifyAdditionalPhones',_0x29e3ae[_0xf347('0xf')]);_0x347efe(_0x442834[_0xf347('0xe')](0x1f4,_0x29e3ae[_0xf347('0xf')]));});}})[_0xf347('0x25')](function(_0x34af14){logger[_0xf347('0xe')](_0xf347('0x11'),_0x34af14[_0xf347('0xf')]);_0x347efe(_0x442834['error'](0x1f4,_0x34af14[_0xf347('0xf')]));});}else _0x3428b8({'additional':0x0});});});};exports[_0xf347('0x26')]=function(_0x46305a){var _0x427194=this;return new Promise(function(_0x3ce0b4,_0x3813ec){return db[_0xf347('0x12')][_0xf347('0x13')]({'raw':!![],'where':{'ContactId':_0x46305a[_0xf347('0x14')]['ContactId'],'ListId':_0x46305a[_0xf347('0x14')][_0xf347('0x27')],'VoiceQueueId':_0x46305a[_0xf347('0x14')][_0xf347('0x16')]===undefined?null:_0x46305a[_0xf347('0x14')][_0xf347('0x16')],'CampaignId':_0x46305a[_0xf347('0x14')]['CampaignId']===undefined?null:_0x46305a[_0xf347('0x14')]['CampaignId']}})['then'](function(_0x1e4f73){if(_0x1e4f73!=null){return db[_0xf347('0x18')][_0xf347('0x13')]({'raw':!![],'where':{'CmHopperId':_0x1e4f73['id'],'OrderBy':{'$gte':_0x1e4f73[_0xf347('0x19')]}},'order':[[_0xf347('0x19'),'ASC']]})[_0xf347('0x1b')](function(_0x569c29){if(_0x569c29)return activateAdditionalPhone(_0x1e4f73,_0x46305a[_0xf347('0x14')],_0x569c29,_0x46305a[_0xf347('0x28')],_0x46305a[_0xf347('0x29')])['then'](function(_0x5a42e0){_0x3ce0b4(_0x5a42e0);});else{return db[_0xf347('0x18')][_0xf347('0x13')]({'raw':!![],'where':{'CmHopperId':_0x1e4f73['id']},'order':[[_0xf347('0x19'),_0xf347('0x1a')]]})[_0xf347('0x1b')](function(_0xe2647c){if(_0xe2647c)return activateAdditionalPhone(_0x1e4f73,_0x46305a[_0xf347('0x14')],_0xe2647c,_0x46305a[_0xf347('0x28')],_0x46305a[_0xf347('0x29')])[_0xf347('0x1b')](function(_0x44ee1c){_0x3ce0b4(_0x44ee1c);});else{_0x3ce0b4({'id':_0x1e4f73['id'],'phone':''});}})[_0xf347('0x25')](function(_0x15eef1){logger['error'](_0xf347('0x11'),_0x15eef1['message']);_0x3813ec(_0x427194['error'](0x1f4,_0x15eef1[_0xf347('0xf')]));});}})[_0xf347('0x25')](function(_0xab10fc){logger[_0xf347('0xe')]('VerifyAdditionalPhones',_0xab10fc[_0xf347('0xf')]);_0x3813ec(_0x427194['error'](0x1f4,_0xab10fc[_0xf347('0xf')]));});}else _0x3ce0b4(0x1);});});};function activateAdditionalPhone(_0x1e83d2,_0x799540,_0x14954a,_0x32bb77,_0x43a905){return new Promise(function(_0xa758dc,_0x1b3154){var _0x9e1fed;if(_[_0xf347('0x2a')](_0x14954a[_0xf347('0x2b')])){_0x14954a[_0xf347('0x2b')]=moment();}if(moment()>moment(_0x14954a[_0xf347('0x2b')])){_0x9e1fed=moment()['add'](_0x43a905||0x3,_0xf347('0x2c'));}else{if(_0x14954a[_0xf347('0x19')]==0x0){_0x9e1fed=moment(_0x14954a[_0xf347('0x2b')]);}else{_0x9e1fed=moment()[_0xf347('0x2d')](_0x43a905||0x3,_0xf347('0x2c'));}}if(_[_0xf347('0x2a')](_0x9e1fed)){_0x9e1fed=moment()[_0xf347('0x2d')](_0x43a905||0x3,'minutes');}var _0xcf8a1e={'phone':_0x1e83d2['phone'],'active':0x0,'OrderBy':_['isNil'](_0x1e83d2[_0xf347('0x19')])?0x0:_0x1e83d2[_0xf347('0x19')],'scheduledat':moment()['add'](_0x32bb77||0x1,_0xf347('0x2c')),'countbusyretry':_0x799540[_0xf347('0x1c')],'countcongestionretry':_0x799540['countcongestionretry'],'countnoanswerretry':_0x799540[_0xf347('0x24')],'countnosuchnumberretry':_0x799540[_0xf347('0x2e')],'countdropretry':_0x799540[_0xf347('0x1e')],'countabandonedretry':_0x799540[_0xf347('0x1f')],'countmachineretry':_0x799540[_0xf347('0x20')],'countagentrejectretry':_0x799540[_0xf347('0x21')],'createdAt':_0x799540[_0xf347('0x2f')],'updatedAt':_0x799540[_0xf347('0x30')]};var _0x24d809={'CmHopperId':_0x1e83d2['id'],'phone':_0x14954a['phone'],'active':0x0,'OrderBy':_[_0xf347('0x2a')](_0x14954a['OrderBy'])?0x0:_0x14954a['OrderBy'],'scheduledat':_0x9e1fed,'countbusyretry':_0x14954a[_0xf347('0x1c')],'countcongestionretry':_0x14954a[_0xf347('0x1d')],'countnoanswerretry':_0x14954a[_0xf347('0x24')],'countnosuchnumberretry':_0x14954a['countnosuchnumberretry'],'countdropretry':_0x14954a[_0xf347('0x1e')],'countabandonedretry':_0x14954a[_0xf347('0x1f')],'countmachineretry':_0x14954a[_0xf347('0x20')],'countagentrejectretry':_0x14954a[_0xf347('0x21')],'createdAt':_0x14954a[_0xf347('0x2f')],'updatedAt':_0x14954a[_0xf347('0x30')]};return db[_0xf347('0x31')][_0xf347('0x32')](function(_0x2ee2dd){return db[_0xf347('0x18')]['update'](_0xcf8a1e,{'where':{'id':_0x14954a['id']}},{'transaction':_0x2ee2dd})['then'](function(){return db[_0xf347('0x12')][_0xf347('0x33')](_0x24d809,{'where':{'id':_0x1e83d2['id']}},{'transaction':_0x2ee2dd});});})['then'](function(_0xef37c1){_0xa758dc({'id':_0x1e83d2['id'],'phone':_0x14954a['phone']});})[_0xf347('0x25')](function(_0x1c5fad){logger[_0xf347('0xe')]('activateAdditionalPhone',_0x1c5fad['message']);_0x1b3154({'error':_0x1c5fad[_0xf347('0xf')]});});});}exports['IncrementPreviewCounters']=function(_0x29e07c){var _0xd9dbd8=this;return new Promise(function(_0x57e156,_0xa4d106){return db['CmHopper'][_0xf347('0x33')](_0x29e07c['body'][_0xf347('0x34')],{'where':{'id':_0x29e07c['body']['id']}})[_0xf347('0x1b')](function(_0x5f5224){_0x57e156(_0x5f5224);})['catch'](function(_0x6ff6d0){logger[_0xf347('0xe')](_0xf347('0x35'),_0x6ff6d0[_0xf347('0xf')]);_0xa4d106(_0xd9dbd8[_0xf347('0xe')](0x1f4,_0x6ff6d0[_0xf347('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index 8fd19aa..1b2d48e 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 _0x8623=['create','update','delete','destroy','exports','multer','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','index','get','/:id','isAuthenticated','show','post'];(function(_0x1fd954,_0x581084){var _0x31d4e2=function(_0x4f4d55){while(--_0x4f4d55){_0x1fd954['push'](_0x1fd954['shift']());}};_0x31d4e2(++_0x581084);}(_0x8623,0x194));var _0x3862=function(_0x12bfc3,_0x20969b){_0x12bfc3=_0x12bfc3-0x0;var _0x34871b=_0x8623[_0x12bfc3];return _0x34871b;};'use strict';var multer=require(_0x3862('0x0'));var util=require('util');var path=require(_0x3862('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3862('0x2')]();var fs_extra=require(_0x3862('0x3'));var auth=require(_0x3862('0x4'));var interaction=require(_0x3862('0x5'));var config=require(_0x3862('0x6'));var controller=require(_0x3862('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x3862('0x8')]);router[_0x3862('0x9')](_0x3862('0xa'),auth[_0x3862('0xb')](),controller[_0x3862('0xc')]);router[_0x3862('0xd')]('/',auth[_0x3862('0xb')](),controller[_0x3862('0xe')]);router['put'](_0x3862('0xa'),auth[_0x3862('0xb')](),controller[_0x3862('0xf')]);router[_0x3862('0x10')](_0x3862('0xa'),auth[_0x3862('0xb')](),controller[_0x3862('0x11')]);module[_0x3862('0x12')]=router; \ No newline at end of file +var _0x2e2a=['./cmHopperAdditionalPhone.controller','get','isAuthenticated','/:id','show','post','create','update','delete','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2e97b9,_0x13b532){var _0xe303cf=function(_0xb93091){while(--_0xb93091){_0x2e97b9['push'](_0x2e97b9['shift']());}};_0xe303cf(++_0x13b532);}(_0x2e2a,0x1b3));var _0xa2e2=function(_0xfc8faf,_0x86244a){_0xfc8faf=_0xfc8faf-0x0;var _0x48c40b=_0x2e2a[_0xfc8faf];return _0x48c40b;};'use strict';var multer=require('multer');var util=require(_0xa2e2('0x0'));var path=require(_0xa2e2('0x1'));var timeout=require(_0xa2e2('0x2'));var express=require('express');var router=express[_0xa2e2('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xa2e2('0x4'));var interaction=require(_0xa2e2('0x5'));var config=require(_0xa2e2('0x6'));var controller=require(_0xa2e2('0x7'));router[_0xa2e2('0x8')]('/',auth[_0xa2e2('0x9')](),controller['index']);router[_0xa2e2('0x8')](_0xa2e2('0xa'),auth[_0xa2e2('0x9')](),controller[_0xa2e2('0xb')]);router[_0xa2e2('0xc')]('/',auth[_0xa2e2('0x9')](),controller[_0xa2e2('0xd')]);router['put'](_0xa2e2('0xa'),auth[_0xa2e2('0x9')](),controller[_0xa2e2('0xe')]);router[_0xa2e2('0xf')](_0xa2e2('0xa'),auth[_0xa2e2('0x9')](),controller['destroy']);module[_0xa2e2('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 9c7ccfc..35651a0 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 _0xb5dd=['contactListQueue','moment','sequelize','exports','STRING','INTEGER'];(function(_0x122cec,_0x48e185){var _0x2ebd76=function(_0x3b36f4){while(--_0x3b36f4){_0x122cec['push'](_0x122cec['shift']());}};_0x2ebd76(++_0x48e185);}(_0xb5dd,0xd9));var _0xdb5d=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xb5dd[_0x397e5f];return _0x5302b8;};'use strict';var moment=require(_0xdb5d('0x0'));var Sequelize=require(_0xdb5d('0x1'));module[_0xdb5d('0x2')]={'phone':{'type':Sequelize[_0xdb5d('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xdb5d('0x4')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0xdb5d('0x4')],'unique':_0xdb5d('0x5')},'VoiceQueueId':{'type':Sequelize[_0xdb5d('0x4')],'unique':'contactListQueue'}}; \ No newline at end of file +var _0x7f3f=['contactListQueue','moment','sequelize','STRING','INTEGER'];(function(_0x5959c9,_0x2ed153){var _0x4ffcbc=function(_0x459b7a){while(--_0x459b7a){_0x5959c9['push'](_0x5959c9['shift']());}};_0x4ffcbc(++_0x2ed153);}(_0x7f3f,0x1c8));var _0xf7f3=function(_0x4df1f5,_0x39c6d2){_0x4df1f5=_0x4df1f5-0x0;var _0x56585b=_0x7f3f[_0x4df1f5];return _0x56585b;};'use strict';var moment=require(_0xf7f3('0x0'));var Sequelize=require(_0xf7f3('0x1'));module['exports']={'phone':{'type':Sequelize[_0xf7f3('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xf7f3('0x3')],'unique':_0xf7f3('0x4')},'ListId':{'type':Sequelize[_0xf7f3('0x3')],'unique':_0xf7f3('0x4')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0xf7f3('0x4')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 722b90c..d2c828e 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 _0x2dd3=['body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','json','save','update','then','destroy','error','name','map','CmHopperBlack','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','VIRTUAL','filter','merge','options','rows','catch','show','keys','include','find'];(function(_0x35f09f,_0x385f81){var _0x5b6e5e=function(_0x114127){while(--_0x114127){_0x35f09f['push'](_0x35f09f['shift']());}};_0x5b6e5e(++_0x385f81);}(_0x2dd3,0x99));var _0x32dd=function(_0x4eb562,_0x10ec6f){_0x4eb562=_0x4eb562-0x0;var _0x3e2487=_0x2dd3[_0x4eb562];return _0x3e2487;};'use strict';var emlformat=require(_0x32dd('0x0'));var rimraf=require(_0x32dd('0x1'));var zipdir=require(_0x32dd('0x2'));var jsonpatch=require(_0x32dd('0x3'));var rp=require(_0x32dd('0x4'));var moment=require(_0x32dd('0x5'));var BPromise=require(_0x32dd('0x6'));var Mustache=require(_0x32dd('0x7'));var util=require(_0x32dd('0x8'));var path=require(_0x32dd('0x9'));var sox=require(_0x32dd('0xa'));var csv=require(_0x32dd('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x32dd('0xc'));var _=require(_0x32dd('0xd'));var squel=require(_0x32dd('0xe'));var crypto=require(_0x32dd('0xf'));var jsforce=require(_0x32dd('0x10'));var deskjs=require(_0x32dd('0x11'));var toCsv=require(_0x32dd('0xb'));var querystring=require(_0x32dd('0x12'));var Papa=require(_0x32dd('0x13'));var Redis=require(_0x32dd('0x14'));var authService=require(_0x32dd('0x15'));var qs=require(_0x32dd('0x16'));var as=require(_0x32dd('0x17'));var hardwareService=require(_0x32dd('0x18'));var logger=require(_0x32dd('0x19'))(_0x32dd('0x1a'));var utils=require(_0x32dd('0x1b'));var config=require(_0x32dd('0x1c'));var licenseUtil=require(_0x32dd('0x1d'));var db=require(_0x32dd('0x1e'))['db'];function respondWithStatusCode(_0x18f464,_0x4f308b){_0x4f308b=_0x4f308b||0xcc;return function(_0x55d034){if(_0x55d034){return _0x18f464[_0x32dd('0x1f')](_0x4f308b);}return _0x18f464[_0x32dd('0x20')](_0x4f308b)[_0x32dd('0x21')]();};}function respondWithResult(_0x39ea5a,_0x210517){_0x210517=_0x210517||0xc8;return function(_0x26882e){if(_0x26882e){return _0x39ea5a[_0x32dd('0x20')](_0x210517)['json'](_0x26882e);}};}function respondWithFilteredResult(_0x26377d,_0x351656){return function(_0x5e9fe1){if(_0x5e9fe1){var _0x372a1a=typeof _0x351656[_0x32dd('0x22')]===_0x32dd('0x23')&&typeof _0x351656['limit']===_0x32dd('0x23');var _0x503a36=_0x5e9fe1[_0x32dd('0x24')];var _0x2173e3=_0x372a1a?0x0:_0x351656[_0x32dd('0x22')];var _0x252c23=_0x372a1a?_0x5e9fe1['count']:_0x351656[_0x32dd('0x22')]+_0x351656[_0x32dd('0x25')];var _0x37a350;if(_0x252c23>=_0x503a36){_0x252c23=_0x503a36;_0x37a350=0xc8;}else{_0x37a350=0xce;}_0x26377d['status'](_0x37a350);return _0x26377d[_0x32dd('0x26')]('Content-Range',_0x2173e3+'-'+_0x252c23+'/'+_0x503a36)[_0x32dd('0x27')](_0x5e9fe1);}return null;};}function patchUpdates(_0x53a522){return function(_0xa7ade6){try{jsonpatch['apply'](_0xa7ade6,_0x53a522,!![]);}catch(_0x55d9a8){return BPromise['reject'](_0x55d9a8);}return _0xa7ade6[_0x32dd('0x28')]();};}function saveUpdates(_0x10cc7e,_0xf57c91){return function(_0x59dd89){if(_0x59dd89){return _0x59dd89[_0x32dd('0x29')](_0x10cc7e)[_0x32dd('0x2a')](function(_0x35344a){return _0x35344a;});}return null;};}function removeEntity(_0x3f585d,_0x40bed0){return function(_0x3de522){if(_0x3de522){return _0x3de522[_0x32dd('0x2b')]()[_0x32dd('0x2a')](function(){_0x3f585d[_0x32dd('0x20')](0xcc)[_0x32dd('0x21')]();});}};}function handleEntityNotFound(_0x3897d3,_0xcb8dcf){return function(_0x3f5cdf){if(!_0x3f5cdf){_0x3897d3['sendStatus'](0x194);}return _0x3f5cdf;};}function handleError(_0x3709ea,_0x1c682e){_0x1c682e=_0x1c682e||0x1f4;return function(_0x53c32d){logger[_0x32dd('0x2c')](_0x53c32d['stack']);if(_0x53c32d[_0x32dd('0x2d')]){delete _0x53c32d['name'];}_0x3709ea['status'](_0x1c682e)['send'](_0x53c32d);};}exports['index']=function(_0x147db2,_0x31c8d8){var _0x12541f={},_0x6e423a={},_0x4b96a2={'count':0x0,'rows':[]};var _0x7df745=_[_0x32dd('0x2e')](db[_0x32dd('0x2f')][_0x32dd('0x30')],function(_0x52c685){return{'name':_0x52c685['fieldName'],'type':_0x52c685[_0x32dd('0x31')][_0x32dd('0x32')]};});_0x6e423a[_0x32dd('0x33')]=_[_0x32dd('0x2e')](_0x7df745,'name');_0x6e423a[_0x32dd('0x34')]=_['keys'](_0x147db2['query']);_0x6e423a[_0x32dd('0x35')]=_[_0x32dd('0x36')](_0x6e423a['model'],_0x6e423a[_0x32dd('0x34')]);_0x12541f[_0x32dd('0x37')]=_[_0x32dd('0x36')](_0x6e423a[_0x32dd('0x33')],qs[_0x32dd('0x38')](_0x147db2[_0x32dd('0x34')][_0x32dd('0x38')]));_0x12541f[_0x32dd('0x37')]=_0x12541f[_0x32dd('0x37')][_0x32dd('0x39')]?_0x12541f[_0x32dd('0x37')]:_0x6e423a[_0x32dd('0x33')];if(!_0x147db2[_0x32dd('0x34')]['hasOwnProperty'](_0x32dd('0x3a'))){_0x12541f[_0x32dd('0x25')]=qs[_0x32dd('0x25')](_0x147db2[_0x32dd('0x34')][_0x32dd('0x25')]);_0x12541f[_0x32dd('0x22')]=qs[_0x32dd('0x22')](_0x147db2[_0x32dd('0x34')][_0x32dd('0x22')]);}_0x12541f[_0x32dd('0x3b')]=qs[_0x32dd('0x3c')](_0x147db2[_0x32dd('0x34')][_0x32dd('0x3c')]);_0x12541f[_0x32dd('0x3d')]=qs[_0x32dd('0x35')](_['pick'](_0x147db2[_0x32dd('0x34')],_0x6e423a[_0x32dd('0x35')]),_0x7df745);if(_0x147db2[_0x32dd('0x34')]['filter']){_0x12541f[_0x32dd('0x3d')]=_['merge'](_0x12541f[_0x32dd('0x3d')],{'$or':_['map'](_0x7df745,function(_0x231efc){if(_0x231efc[_0x32dd('0x31')]!==_0x32dd('0x3e')){var _0x5689e5={};_0x5689e5[_0x231efc[_0x32dd('0x2d')]]={'$like':'%'+_0x147db2[_0x32dd('0x34')][_0x32dd('0x3f')]+'%'};return _0x5689e5;}})});}_0x12541f=_[_0x32dd('0x40')]({},_0x12541f,_0x147db2[_0x32dd('0x41')]);var _0x1e2213={'where':_0x12541f['where']};return db[_0x32dd('0x2f')]['count'](_0x1e2213)[_0x32dd('0x2a')](function(_0x3aba46){_0x4b96a2[_0x32dd('0x24')]=_0x3aba46;if(_0x147db2[_0x32dd('0x34')]['includeAll']){_0x12541f['include']=[{'all':!![]}];}return db[_0x32dd('0x2f')]['findAll'](_0x12541f);})[_0x32dd('0x2a')](function(_0x1af9b0){_0x4b96a2[_0x32dd('0x42')]=_0x1af9b0;return _0x4b96a2;})['then'](respondWithFilteredResult(_0x31c8d8,_0x12541f))[_0x32dd('0x43')](handleError(_0x31c8d8,null));};exports[_0x32dd('0x44')]=function(_0x5768df,_0x7890d1){var _0x246d32={'raw':!![],'where':{'id':_0x5768df['params']['id']}},_0x4f9bfe={};_0x4f9bfe[_0x32dd('0x33')]=_[_0x32dd('0x45')](db[_0x32dd('0x2f')]['rawAttributes']);_0x4f9bfe[_0x32dd('0x34')]=_[_0x32dd('0x45')](_0x5768df[_0x32dd('0x34')]);_0x4f9bfe['filters']=_['intersection'](_0x4f9bfe[_0x32dd('0x33')],_0x4f9bfe[_0x32dd('0x34')]);_0x246d32['attributes']=_['intersection'](_0x4f9bfe['model'],qs['fields'](_0x5768df['query'][_0x32dd('0x38')]));_0x246d32['attributes']=_0x246d32['attributes'][_0x32dd('0x39')]?_0x246d32[_0x32dd('0x37')]:_0x4f9bfe[_0x32dd('0x33')];if(_0x5768df['query']['includeAll']){_0x246d32[_0x32dd('0x46')]=[{'all':!![]}];}_0x246d32=_['merge']({},_0x246d32,_0x5768df[_0x32dd('0x41')]);return db[_0x32dd('0x2f')][_0x32dd('0x47')](_0x246d32)[_0x32dd('0x2a')](handleEntityNotFound(_0x7890d1,null))['then'](respondWithResult(_0x7890d1,null))['catch'](handleError(_0x7890d1,null));};exports['update']=function(_0x5819a3,_0x107366){if(_0x5819a3[_0x32dd('0x48')]['id']){delete _0x5819a3[_0x32dd('0x48')]['id'];}return db[_0x32dd('0x2f')][_0x32dd('0x47')]({'where':{'id':_0x5819a3[_0x32dd('0x49')]['id']}})[_0x32dd('0x2a')](handleEntityNotFound(_0x107366,null))['then'](saveUpdates(_0x5819a3[_0x32dd('0x48')],null))['then'](respondWithResult(_0x107366,null))[_0x32dd('0x43')](handleError(_0x107366,null));};exports[_0x32dd('0x2b')]=function(_0x5e1aa4,_0x2bb3b8){return db[_0x32dd('0x2f')][_0x32dd('0x47')]({'where':{'id':_0x5e1aa4[_0x32dd('0x49')]['id']}})['then'](handleEntityNotFound(_0x2bb3b8,null))[_0x32dd('0x2a')](removeEntity(_0x2bb3b8,null))[_0x32dd('0x43')](handleError(_0x2bb3b8,null));};exports[_0x32dd('0x4a')]=function(_0xc65d48,_0x15556f){return db['CmHopperBlack']['describe']()[_0x32dd('0x2a')](respondWithResult(_0x15556f,null))[_0x32dd('0x43')](handleError(_0x15556f,null));}; \ No newline at end of file +var _0xa59d=['error','stack','name','send','index','map','fieldName','type','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','include','CmHopperBlack','findAll','rows','catch','show','params','rawAttributes','length','includeAll','find','update','body','destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','then','end'];(function(_0x126a6f,_0x390a17){var _0x3988db=function(_0x162d81){while(--_0x162d81){_0x126a6f['push'](_0x126a6f['shift']());}};_0x3988db(++_0x390a17);}(_0xa59d,0x15b));var _0xda59=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xa59d[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0xda59('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xda59('0x1'));var jsonpatch=require(_0xda59('0x2'));var rp=require(_0xda59('0x3'));var moment=require(_0xda59('0x4'));var BPromise=require(_0xda59('0x5'));var Mustache=require(_0xda59('0x6'));var util=require('util');var path=require('path');var sox=require(_0xda59('0x7'));var csv=require(_0xda59('0x8'));var ejs=require(_0xda59('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xda59('0xa'));var squel=require(_0xda59('0xb'));var crypto=require('crypto');var jsforce=require(_0xda59('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xda59('0xd'));var Papa=require(_0xda59('0xe'));var Redis=require(_0xda59('0xf'));var authService=require(_0xda59('0x10'));var qs=require(_0xda59('0x11'));var as=require(_0xda59('0x12'));var hardwareService=require(_0xda59('0x13'));var logger=require(_0xda59('0x14'))('api');var utils=require(_0xda59('0x15'));var config=require(_0xda59('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xda59('0x17'))['db'];function respondWithStatusCode(_0x1c0656,_0x4da9d0){_0x4da9d0=_0x4da9d0||0xcc;return function(_0x236ab2){if(_0x236ab2){return _0x1c0656[_0xda59('0x18')](_0x4da9d0);}return _0x1c0656['status'](_0x4da9d0)['end']();};}function respondWithResult(_0x41a26c,_0x890719){_0x890719=_0x890719||0xc8;return function(_0x35e7c2){if(_0x35e7c2){return _0x41a26c[_0xda59('0x19')](_0x890719)[_0xda59('0x1a')](_0x35e7c2);}};}function respondWithFilteredResult(_0x1578fd,_0xbd01f2){return function(_0x235d6d){if(_0x235d6d){var _0x2396c0=typeof _0xbd01f2['offset']===_0xda59('0x1b')&&typeof _0xbd01f2[_0xda59('0x1c')]===_0xda59('0x1b');var _0x1b243b=_0x235d6d['count'];var _0x26d6f4=_0x2396c0?0x0:_0xbd01f2[_0xda59('0x1d')];var _0x581054=_0x2396c0?_0x235d6d[_0xda59('0x1e')]:_0xbd01f2['offset']+_0xbd01f2[_0xda59('0x1c')];var _0x33904f;if(_0x581054>=_0x1b243b){_0x581054=_0x1b243b;_0x33904f=0xc8;}else{_0x33904f=0xce;}_0x1578fd['status'](_0x33904f);return _0x1578fd[_0xda59('0x1f')](_0xda59('0x20'),_0x26d6f4+'-'+_0x581054+'/'+_0x1b243b)[_0xda59('0x1a')](_0x235d6d);}return null;};}function patchUpdates(_0x562399){return function(_0x48d1af){try{jsonpatch[_0xda59('0x21')](_0x48d1af,_0x562399,!![]);}catch(_0x4568d5){return BPromise[_0xda59('0x22')](_0x4568d5);}return _0x48d1af[_0xda59('0x23')]();};}function saveUpdates(_0x2293d8,_0x4eb774){return function(_0x498cc3){if(_0x498cc3){return _0x498cc3['update'](_0x2293d8)['then'](function(_0x170f4){return _0x170f4;});}return null;};}function removeEntity(_0x5dfa67,_0x313c09){return function(_0x5e953f){if(_0x5e953f){return _0x5e953f['destroy']()[_0xda59('0x24')](function(){_0x5dfa67[_0xda59('0x19')](0xcc)[_0xda59('0x25')]();});}};}function handleEntityNotFound(_0x303307,_0x2082c8){return function(_0x974f4){if(!_0x974f4){_0x303307[_0xda59('0x18')](0x194);}return _0x974f4;};}function handleError(_0x202494,_0x22b33e){_0x22b33e=_0x22b33e||0x1f4;return function(_0x2a83de){logger[_0xda59('0x26')](_0x2a83de[_0xda59('0x27')]);if(_0x2a83de[_0xda59('0x28')]){delete _0x2a83de[_0xda59('0x28')];}_0x202494[_0xda59('0x19')](_0x22b33e)[_0xda59('0x29')](_0x2a83de);};}exports[_0xda59('0x2a')]=function(_0x4cc442,_0x45a5ff){var _0x4a9345={},_0x4ae0a1={},_0x339364={'count':0x0,'rows':[]};var _0x596e75=_[_0xda59('0x2b')](db['CmHopperBlack']['rawAttributes'],function(_0x74ce81){return{'name':_0x74ce81[_0xda59('0x2c')],'type':_0x74ce81[_0xda59('0x2d')][_0xda59('0x2e')]};});_0x4ae0a1[_0xda59('0x2f')]=_[_0xda59('0x2b')](_0x596e75,'name');_0x4ae0a1[_0xda59('0x30')]=_[_0xda59('0x31')](_0x4cc442[_0xda59('0x30')]);_0x4ae0a1['filters']=_['intersection'](_0x4ae0a1[_0xda59('0x2f')],_0x4ae0a1['query']);_0x4a9345[_0xda59('0x32')]=_[_0xda59('0x33')](_0x4ae0a1[_0xda59('0x2f')],qs[_0xda59('0x34')](_0x4cc442[_0xda59('0x30')][_0xda59('0x34')]));_0x4a9345[_0xda59('0x32')]=_0x4a9345[_0xda59('0x32')]['length']?_0x4a9345['attributes']:_0x4ae0a1[_0xda59('0x2f')];if(!_0x4cc442[_0xda59('0x30')][_0xda59('0x35')](_0xda59('0x36'))){_0x4a9345[_0xda59('0x1c')]=qs['limit'](_0x4cc442[_0xda59('0x30')][_0xda59('0x1c')]);_0x4a9345['offset']=qs[_0xda59('0x1d')](_0x4cc442[_0xda59('0x30')]['offset']);}_0x4a9345['order']=qs[_0xda59('0x37')](_0x4cc442[_0xda59('0x30')][_0xda59('0x37')]);_0x4a9345[_0xda59('0x38')]=qs[_0xda59('0x39')](_['pick'](_0x4cc442[_0xda59('0x30')],_0x4ae0a1[_0xda59('0x39')]),_0x596e75);if(_0x4cc442[_0xda59('0x30')][_0xda59('0x3a')]){_0x4a9345[_0xda59('0x38')]=_[_0xda59('0x3b')](_0x4a9345[_0xda59('0x38')],{'$or':_[_0xda59('0x2b')](_0x596e75,function(_0x157d65){if(_0x157d65[_0xda59('0x2d')]!==_0xda59('0x3c')){var _0x46dc13={};_0x46dc13[_0x157d65['name']]={'$like':'%'+_0x4cc442['query'][_0xda59('0x3a')]+'%'};return _0x46dc13;}})});}_0x4a9345=_[_0xda59('0x3b')]({},_0x4a9345,_0x4cc442[_0xda59('0x3d')]);var _0x53d47b={'where':_0x4a9345[_0xda59('0x38')]};return db['CmHopperBlack'][_0xda59('0x1e')](_0x53d47b)[_0xda59('0x24')](function(_0x4bb3b8){_0x339364[_0xda59('0x1e')]=_0x4bb3b8;if(_0x4cc442[_0xda59('0x30')]['includeAll']){_0x4a9345[_0xda59('0x3e')]=[{'all':!![]}];}return db[_0xda59('0x3f')][_0xda59('0x40')](_0x4a9345);})[_0xda59('0x24')](function(_0xdec837){_0x339364[_0xda59('0x41')]=_0xdec837;return _0x339364;})['then'](respondWithFilteredResult(_0x45a5ff,_0x4a9345))[_0xda59('0x42')](handleError(_0x45a5ff,null));};exports[_0xda59('0x43')]=function(_0x369772,_0x2e7230){var _0x27cc96={'raw':!![],'where':{'id':_0x369772[_0xda59('0x44')]['id']}},_0x18a74a={};_0x18a74a[_0xda59('0x2f')]=_[_0xda59('0x31')](db[_0xda59('0x3f')][_0xda59('0x45')]);_0x18a74a[_0xda59('0x30')]=_[_0xda59('0x31')](_0x369772[_0xda59('0x30')]);_0x18a74a[_0xda59('0x39')]=_['intersection'](_0x18a74a['model'],_0x18a74a[_0xda59('0x30')]);_0x27cc96[_0xda59('0x32')]=_['intersection'](_0x18a74a[_0xda59('0x2f')],qs[_0xda59('0x34')](_0x369772[_0xda59('0x30')][_0xda59('0x34')]));_0x27cc96[_0xda59('0x32')]=_0x27cc96[_0xda59('0x32')][_0xda59('0x46')]?_0x27cc96['attributes']:_0x18a74a[_0xda59('0x2f')];if(_0x369772[_0xda59('0x30')][_0xda59('0x47')]){_0x27cc96[_0xda59('0x3e')]=[{'all':!![]}];}_0x27cc96=_[_0xda59('0x3b')]({},_0x27cc96,_0x369772[_0xda59('0x3d')]);return db[_0xda59('0x3f')][_0xda59('0x48')](_0x27cc96)[_0xda59('0x24')](handleEntityNotFound(_0x2e7230,null))[_0xda59('0x24')](respondWithResult(_0x2e7230,null))[_0xda59('0x42')](handleError(_0x2e7230,null));};exports[_0xda59('0x49')]=function(_0x44ffa2,_0xecdb7a){if(_0x44ffa2[_0xda59('0x4a')]['id']){delete _0x44ffa2[_0xda59('0x4a')]['id'];}return db[_0xda59('0x3f')][_0xda59('0x48')]({'where':{'id':_0x44ffa2[_0xda59('0x44')]['id']}})[_0xda59('0x24')](handleEntityNotFound(_0xecdb7a,null))[_0xda59('0x24')](saveUpdates(_0x44ffa2[_0xda59('0x4a')],null))[_0xda59('0x24')](respondWithResult(_0xecdb7a,null))[_0xda59('0x42')](handleError(_0xecdb7a,null));};exports[_0xda59('0x4b')]=function(_0x1243c2,_0x38c70c){return db[_0xda59('0x3f')][_0xda59('0x48')]({'where':{'id':_0x1243c2[_0xda59('0x44')]['id']}})[_0xda59('0x24')](handleEntityNotFound(_0x38c70c,null))[_0xda59('0x24')](removeEntity(_0x38c70c,null))[_0xda59('0x42')](handleError(_0x38c70c,null));};exports[_0xda59('0x4c')]=function(_0x28b6e8,_0x507007){return db[_0xda59('0x3f')][_0xda59('0x4c')]()['then'](respondWithResult(_0x507007,null))[_0xda59('0x42')](handleError(_0x507007,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 903ce3b..0864701 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 _0x459d=['define','cm_hopper_black','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2cb0e3,_0x74db03){var _0x54592b=function(_0x3db3aa){while(--_0x3db3aa){_0x2cb0e3['push'](_0x2cb0e3['shift']());}};_0x54592b(++_0x74db03);}(_0x459d,0x199));var _0xd459=function(_0x44921d,_0x3bc8ae){_0x44921d=_0x44921d-0x0;var _0x209a71=_0x459d[_0x44921d];return _0x209a71;};'use strict';var _=require(_0xd459('0x0'));var util=require(_0xd459('0x1'));var logger=require(_0xd459('0x2'))(_0xd459('0x3'));var moment=require('moment');var BPromise=require(_0xd459('0x4'));var rp=require(_0xd459('0x5'));var fs=require('fs');var path=require(_0xd459('0x6'));var rimraf=require(_0xd459('0x7'));var config=require(_0xd459('0x8'));var attributes=require('./cmHopperBlack.attributes');module['exports']=function(_0x2fe9ee,_0x2c31e1){return _0x2fe9ee[_0xd459('0x9')]('CmHopperBlack',attributes,{'tableName':_0xd459('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5323=['api','moment','request-promise','path','rimraf','../../config/environment','exports','define','CmHopperBlack','cm_hopper_black','lodash','util'];(function(_0x49e584,_0x2886f8){var _0x58b1be=function(_0x40397c){while(--_0x40397c){_0x49e584['push'](_0x49e584['shift']());}};_0x58b1be(++_0x2886f8);}(_0x5323,0x8e));var _0x3532=function(_0x2e6b32,_0x22f9bf){_0x2e6b32=_0x2e6b32-0x0;var _0x7a237d=_0x5323[_0x2e6b32];return _0x7a237d;};'use strict';var _=require(_0x3532('0x0'));var util=require(_0x3532('0x1'));var logger=require('../../config/logger')(_0x3532('0x2'));var moment=require(_0x3532('0x3'));var BPromise=require('bluebird');var rp=require(_0x3532('0x4'));var fs=require('fs');var path=require(_0x3532('0x5'));var rimraf=require(_0x3532('0x6'));var config=require(_0x3532('0x7'));var attributes=require('./cmHopperBlack.attributes');module[_0x3532('0x8')]=function(_0x4471ef,_0x1fd6ee){return _0x4471ef[_0x3532('0x9')](_0x3532('0xa'),attributes,{'tableName':_0x3532('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index c813f5e..0fdcbad 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 _0xa7f9=['error','code','message','result','GetCmHopperBlack','CmHopperBlack','options','raw','where','attributes','limit','include','model','map','update','UpdateCmHopperBlack','catch','DestroyCmHopperBlack','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5be26e,_0x1e8cc3){var _0x5929d9=function(_0x286591){while(--_0x286591){_0x5be26e['push'](_0x5be26e['shift']());}};_0x5929d9(++_0x1e8cc3);}(_0xa7f9,0x18e));var _0x9a7f=function(_0xf4a734,_0x1a4fe7){_0xf4a734=_0xf4a734-0x0;var _0x10ee33=_0xa7f9[_0xf4a734];return _0x10ee33;};'use strict';var _=require(_0x9a7f('0x0'));var util=require(_0x9a7f('0x1'));var moment=require(_0x9a7f('0x2'));var BPromise=require(_0x9a7f('0x3'));var rs=require(_0x9a7f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9a7f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9a7f('0x6'))(_0x9a7f('0x7'));var config=require(_0x9a7f('0x8'));var jayson=require(_0x9a7f('0x9'));var client=jayson[_0x9a7f('0xa')][_0x9a7f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2d7de5,_0x4b5026,_0x17a62e){return new BPromise(function(_0x40dc9f,_0x29d820){return client[_0x9a7f('0xc')](_0x2d7de5,_0x17a62e)[_0x9a7f('0xd')](function(_0x127336){logger[_0x9a7f('0xe')](_0x9a7f('0xf'),_0x4b5026,_0x9a7f('0x10'));logger[_0x9a7f('0x11')](_0x9a7f('0x12'),_0x4b5026,_0x9a7f('0x10'),JSON[_0x9a7f('0x13')](_0x127336));if(_0x127336[_0x9a7f('0x14')]){if(_0x127336['error'][_0x9a7f('0x15')]===0x1f4){logger[_0x9a7f('0x14')](_0x9a7f('0xf'),_0x4b5026,_0x127336[_0x9a7f('0x14')]['message']);return _0x29d820(_0x127336['error'][_0x9a7f('0x16')]);}logger[_0x9a7f('0x14')](_0x9a7f('0xf'),_0x4b5026,_0x127336['error']['message']);return _0x40dc9f(_0x127336[_0x9a7f('0x14')]['message']);}else{logger[_0x9a7f('0xe')](_0x9a7f('0xf'),_0x4b5026,'request\x20sent');_0x40dc9f(_0x127336[_0x9a7f('0x17')]['message']);}})['catch'](function(_0x36a94e){logger[_0x9a7f('0x14')](_0x9a7f('0xf'),_0x4b5026,_0x36a94e);_0x29d820(_0x36a94e);});});}exports[_0x9a7f('0x18')]=function(_0x126013){var _0x5cb36b=this;return new Promise(function(_0x280437,_0x2e362e){return db[_0x9a7f('0x19')]['findAll']({'raw':_0x126013[_0x9a7f('0x1a')]?_0x126013[_0x9a7f('0x1a')][_0x9a7f('0x1b')]===undefined?!![]:![]:!![],'where':_0x126013[_0x9a7f('0x1a')]?_0x126013[_0x9a7f('0x1a')][_0x9a7f('0x1c')]||null:null,'attributes':_0x126013[_0x9a7f('0x1a')]?_0x126013[_0x9a7f('0x1a')][_0x9a7f('0x1d')]||null:null,'limit':_0x126013['options']?_0x126013[_0x9a7f('0x1a')][_0x9a7f('0x1e')]||null:null,'include':_0x126013[_0x9a7f('0x1a')]?_0x126013[_0x9a7f('0x1a')][_0x9a7f('0x1f')]?_['map'](_0x126013[_0x9a7f('0x1a')][_0x9a7f('0x1f')],function(_0x1099c3){return{'model':db[_0x1099c3[_0x9a7f('0x20')]],'as':_0x1099c3['as'],'attributes':_0x1099c3[_0x9a7f('0x1d')],'include':_0x1099c3['include']?_[_0x9a7f('0x21')](_0x1099c3[_0x9a7f('0x1f')],function(_0x66294e){return{'model':db[_0x66294e[_0x9a7f('0x20')]],'as':_0x66294e['as'],'attributes':_0x66294e[_0x9a7f('0x1d')],'include':_0x66294e[_0x9a7f('0x1f')]?_[_0x9a7f('0x21')](_0x66294e[_0x9a7f('0x1f')],function(_0x20a907){return{'model':db[_0x20a907[_0x9a7f('0x20')]],'as':_0x20a907['as'],'attributes':_0x20a907[_0x9a7f('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x9a7f('0xd')](function(_0x1c4baf){logger['info'](_0x9a7f('0x18'),_0x126013);logger[_0x9a7f('0x11')](_0x9a7f('0x18'),_0x126013,JSON[_0x9a7f('0x13')](_0x1c4baf));_0x280437(_0x1c4baf);})['catch'](function(_0x42214c){logger[_0x9a7f('0x14')]('GetCmHopperBlack',_0x42214c[_0x9a7f('0x16')],_0x126013);_0x2e362e(_0x5cb36b[_0x9a7f('0x14')](0x1f4,_0x42214c[_0x9a7f('0x16')]));});});};exports['UpdateCmHopperBlack']=function(_0x3eb022){var _0x4844e4=this;return new Promise(function(_0x4b6633,_0x166d8a){return db['CmHopperBlack'][_0x9a7f('0x22')](_0x3eb022['body'],{'raw':_0x3eb022[_0x9a7f('0x1a')]?_0x3eb022[_0x9a7f('0x1a')][_0x9a7f('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3eb022['options']?_0x3eb022[_0x9a7f('0x1a')]['where']||null:null,'attributes':_0x3eb022['options']?_0x3eb022['options'][_0x9a7f('0x1d')]||null:null,'limit':_0x3eb022[_0x9a7f('0x1a')]?_0x3eb022['options'][_0x9a7f('0x1e')]||null:null})[_0x9a7f('0xd')](function(_0xab2778){logger[_0x9a7f('0xe')](_0x9a7f('0x23'),_0x3eb022);logger[_0x9a7f('0x11')](_0x9a7f('0x23'),_0x3eb022,JSON['stringify'](_0xab2778));_0x4b6633(_0xab2778);})[_0x9a7f('0x24')](function(_0x587f68){logger[_0x9a7f('0x14')](_0x9a7f('0x23'),_0x587f68[_0x9a7f('0x16')],_0x3eb022);_0x166d8a(_0x4844e4[_0x9a7f('0x14')](0x1f4,_0x587f68[_0x9a7f('0x16')]));});});};exports[_0x9a7f('0x25')]=function(_0x1e77aa){var _0x359ceb=this;return new Promise(function(_0x246370,_0x7c4913){return db[_0x9a7f('0x19')]['destroy']({'where':_0x1e77aa[_0x9a7f('0x1a')]?_0x1e77aa[_0x9a7f('0x1a')]['where']||null:null})[_0x9a7f('0xd')](function(_0x4de370){logger[_0x9a7f('0xe')]('DestroyCmHopperBlack',_0x1e77aa);logger[_0x9a7f('0x11')](_0x9a7f('0x25'),_0x1e77aa,JSON[_0x9a7f('0x13')](_0x4de370));_0x246370(_0x4de370);})[_0x9a7f('0x24')](function(_0x33e1a3){logger[_0x9a7f('0x14')](_0x9a7f('0x25'),_0x33e1a3[_0x9a7f('0x16')],_0x1e77aa);_0x7c4913(_0x359ceb['error'](0x1f4,_0x33e1a3[_0x9a7f('0x16')]));});});}; \ No newline at end of file +var _0xe899=['DestroyCmHopperBlack','destroy','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','CmHopperBlack,\x20%s,\x20%s','request\x20sent','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','GetCmHopperBlack','CmHopperBlack','options','raw','where','attributes','limit','include','map','model','debug','UpdateCmHopperBlack','update'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xe899,0x1e3));var _0x9e89=function(_0x12c280,_0x51dd07){_0x12c280=_0x12c280-0x0;var _0x3638d3=_0xe899[_0x12c280];return _0x3638d3;};'use strict';var _=require(_0x9e89('0x0'));var util=require(_0x9e89('0x1'));var moment=require(_0x9e89('0x2'));var BPromise=require(_0x9e89('0x3'));var rs=require(_0x9e89('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9e89('0x5'));var logger=require('../../config/logger')(_0x9e89('0x6'));var config=require(_0x9e89('0x7'));var jayson=require(_0x9e89('0x8'));var client=jayson[_0x9e89('0x9')][_0x9e89('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x527dc6,_0x140582,_0x10e70e){return new BPromise(function(_0x45d9f1,_0x529ee4){return client[_0x9e89('0xb')](_0x527dc6,_0x10e70e)[_0x9e89('0xc')](function(_0x7e94f8){logger['info'](_0x9e89('0xd'),_0x140582,_0x9e89('0xe'));logger['debug'](_0x9e89('0xf'),_0x140582,_0x9e89('0xe'),JSON[_0x9e89('0x10')](_0x7e94f8));if(_0x7e94f8[_0x9e89('0x11')]){if(_0x7e94f8['error'][_0x9e89('0x12')]===0x1f4){logger['error'](_0x9e89('0xd'),_0x140582,_0x7e94f8[_0x9e89('0x11')][_0x9e89('0x13')]);return _0x529ee4(_0x7e94f8[_0x9e89('0x11')][_0x9e89('0x13')]);}logger[_0x9e89('0x11')](_0x9e89('0xd'),_0x140582,_0x7e94f8[_0x9e89('0x11')][_0x9e89('0x13')]);return _0x45d9f1(_0x7e94f8[_0x9e89('0x11')][_0x9e89('0x13')]);}else{logger[_0x9e89('0x14')](_0x9e89('0xd'),_0x140582,_0x9e89('0xe'));_0x45d9f1(_0x7e94f8['result']['message']);}})[_0x9e89('0x15')](function(_0x1d0e96){logger[_0x9e89('0x11')](_0x9e89('0xd'),_0x140582,_0x1d0e96);_0x529ee4(_0x1d0e96);});});}exports[_0x9e89('0x16')]=function(_0x559f83){var _0x15d1a5=this;return new Promise(function(_0x39f404,_0x2f73cc){return db[_0x9e89('0x17')]['findAll']({'raw':_0x559f83[_0x9e89('0x18')]?_0x559f83[_0x9e89('0x18')][_0x9e89('0x19')]===undefined?!![]:![]:!![],'where':_0x559f83[_0x9e89('0x18')]?_0x559f83['options'][_0x9e89('0x1a')]||null:null,'attributes':_0x559f83['options']?_0x559f83[_0x9e89('0x18')][_0x9e89('0x1b')]||null:null,'limit':_0x559f83[_0x9e89('0x18')]?_0x559f83[_0x9e89('0x18')][_0x9e89('0x1c')]||null:null,'include':_0x559f83[_0x9e89('0x18')]?_0x559f83[_0x9e89('0x18')][_0x9e89('0x1d')]?_[_0x9e89('0x1e')](_0x559f83['options'][_0x9e89('0x1d')],function(_0x4ee0ee){return{'model':db[_0x4ee0ee['model']],'as':_0x4ee0ee['as'],'attributes':_0x4ee0ee[_0x9e89('0x1b')],'include':_0x4ee0ee[_0x9e89('0x1d')]?_['map'](_0x4ee0ee[_0x9e89('0x1d')],function(_0x54c4f6){return{'model':db[_0x54c4f6[_0x9e89('0x1f')]],'as':_0x54c4f6['as'],'attributes':_0x54c4f6[_0x9e89('0x1b')],'include':_0x54c4f6['include']?_['map'](_0x54c4f6['include'],function(_0x2beefd){return{'model':db[_0x2beefd['model']],'as':_0x2beefd['as'],'attributes':_0x2beefd[_0x9e89('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5354bb){logger[_0x9e89('0x14')]('GetCmHopperBlack',_0x559f83);logger[_0x9e89('0x20')](_0x9e89('0x16'),_0x559f83,JSON[_0x9e89('0x10')](_0x5354bb));_0x39f404(_0x5354bb);})[_0x9e89('0x15')](function(_0x20caca){logger[_0x9e89('0x11')](_0x9e89('0x16'),_0x20caca['message'],_0x559f83);_0x2f73cc(_0x15d1a5['error'](0x1f4,_0x20caca[_0x9e89('0x13')]));});});};exports[_0x9e89('0x21')]=function(_0x183da9){var _0x52eaa7=this;return new Promise(function(_0x3aacde,_0x4cfbe5){return db['CmHopperBlack'][_0x9e89('0x22')](_0x183da9['body'],{'raw':_0x183da9['options']?_0x183da9[_0x9e89('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x183da9[_0x9e89('0x18')]?_0x183da9[_0x9e89('0x18')][_0x9e89('0x1a')]||null:null,'attributes':_0x183da9[_0x9e89('0x18')]?_0x183da9['options']['attributes']||null:null,'limit':_0x183da9[_0x9e89('0x18')]?_0x183da9['options'][_0x9e89('0x1c')]||null:null})['then'](function(_0x78f6ab){logger[_0x9e89('0x14')](_0x9e89('0x21'),_0x183da9);logger[_0x9e89('0x20')](_0x9e89('0x21'),_0x183da9,JSON['stringify'](_0x78f6ab));_0x3aacde(_0x78f6ab);})[_0x9e89('0x15')](function(_0x5ea833){logger[_0x9e89('0x11')]('UpdateCmHopperBlack',_0x5ea833['message'],_0x183da9);_0x4cfbe5(_0x52eaa7[_0x9e89('0x11')](0x1f4,_0x5ea833[_0x9e89('0x13')]));});});};exports[_0x9e89('0x23')]=function(_0x5faeeb){var _0x9774a0=this;return new Promise(function(_0x55f115,_0x512da9){return db['CmHopperBlack'][_0x9e89('0x24')]({'where':_0x5faeeb[_0x9e89('0x18')]?_0x5faeeb[_0x9e89('0x18')][_0x9e89('0x1a')]||null:null})['then'](function(_0x413cf9){logger[_0x9e89('0x14')]('DestroyCmHopperBlack',_0x5faeeb);logger[_0x9e89('0x20')](_0x9e89('0x23'),_0x5faeeb,JSON['stringify'](_0x413cf9));_0x55f115(_0x413cf9);})[_0x9e89('0x15')](function(_0x125bb7){logger[_0x9e89('0x11')](_0x9e89('0x23'),_0x125bb7[_0x9e89('0x13')],_0x5faeeb);_0x512da9(_0x9774a0[_0x9e89('0x11')](0x1f4,_0x125bb7[_0x9e89('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 07c2d63..b38c937 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 _0xfb65=['put','update','destroy','exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','/describe','isAuthenticated','describe','/:id','show'];(function(_0x4fa7d9,_0x250589){var _0x200612=function(_0x58d6a7){while(--_0x58d6a7){_0x4fa7d9['push'](_0x4fa7d9['shift']());}};_0x200612(++_0x250589);}(_0xfb65,0x82));var _0x5fb6=function(_0x519a62,_0x33a042){_0x519a62=_0x519a62-0x0;var _0x802bd8=_0xfb65[_0x519a62];return _0x802bd8;};'use strict';var multer=require('multer');var util=require(_0x5fb6('0x0'));var path=require(_0x5fb6('0x1'));var timeout=require('connect-timeout');var express=require(_0x5fb6('0x2'));var router=express['Router']();var fs_extra=require(_0x5fb6('0x3'));var auth=require(_0x5fb6('0x4'));var interaction=require(_0x5fb6('0x5'));var config=require(_0x5fb6('0x6'));var controller=require(_0x5fb6('0x7'));router[_0x5fb6('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5fb6('0x8')](_0x5fb6('0x9'),auth[_0x5fb6('0xa')](),controller[_0x5fb6('0xb')]);router['get'](_0x5fb6('0xc'),auth[_0x5fb6('0xa')](),controller[_0x5fb6('0xd')]);router[_0x5fb6('0xe')]('/:id',auth[_0x5fb6('0xa')](),controller[_0x5fb6('0xf')]);router['delete'](_0x5fb6('0xc'),auth[_0x5fb6('0xa')](),controller[_0x5fb6('0x10')]);module[_0x5fb6('0x11')]=router; \ No newline at end of file +var _0x5430=['path','connect-timeout','express','Router','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','put','update','destroy','exports','multer','util'];(function(_0x1bc258,_0x1ac7d3){var _0x39ee4a=function(_0x3c4e9e){while(--_0x3c4e9e){_0x1bc258['push'](_0x1bc258['shift']());}};_0x39ee4a(++_0x1ac7d3);}(_0x5430,0x10c));var _0x0543=function(_0xf8867c,_0x52ec3e){_0xf8867c=_0xf8867c-0x0;var _0x498baf=_0x5430[_0xf8867c];return _0x498baf;};'use strict';var multer=require(_0x0543('0x0'));var util=require(_0x0543('0x1'));var path=require(_0x0543('0x2'));var timeout=require(_0x0543('0x3'));var express=require(_0x0543('0x4'));var router=express[_0x0543('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0543('0x6'));var config=require('../../config/environment');var controller=require('./cmHopperBlack.controller');router[_0x0543('0x7')]('/',auth[_0x0543('0x8')](),controller[_0x0543('0x9')]);router[_0x0543('0x7')](_0x0543('0xa'),auth['isAuthenticated'](),controller[_0x0543('0xb')]);router[_0x0543('0x7')](_0x0543('0xc'),auth[_0x0543('0x8')](),controller[_0x0543('0xd')]);router[_0x0543('0xe')]('/:id',auth[_0x0543('0x8')](),controller[_0x0543('0xf')]);router['delete'](_0x0543('0xc'),auth[_0x0543('0x8')](),controller[_0x0543('0x10')]);module[_0x0543('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 ff4ff8b..e8f06e7 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 _0x89c7=['DATE','INTEGER','STRING','followuptime','BOOLEAN','moment','exports'];(function(_0x399f3f,_0x4bd01b){var _0xb636e2=function(_0x3e0e19){while(--_0x3e0e19){_0x399f3f['push'](_0x399f3f['shift']());}};_0xb636e2(++_0x4bd01b);}(_0x89c7,0x1e1));var _0x789c=function(_0x4983f4,_0x107731){_0x4983f4=_0x4983f4-0x0;var _0xbac14f=_0x89c7[_0x4983f4];return _0xbac14f;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x789c('0x0'));module[_0x789c('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x789c('0x2')]},'countbusyretry':{'type':Sequelize[_0x789c('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x789c('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x789c('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x789c('0x4')]},'originatecalleridname':{'type':Sequelize[_0x789c('0x4')]},'calleridnum':{'type':Sequelize[_0x789c('0x4')]},'calleridname':{'type':Sequelize[_0x789c('0x4')]},'starttime':{'type':Sequelize[_0x789c('0x2')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x789c('0x2')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x789c('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x789c('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x789c('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x789c('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x789c('0x4')]},'campaigntype':{'type':Sequelize[_0x789c('0x4')]},'membername':{'type':Sequelize[_0x789c('0x4')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x789c('0x4')]},'secondDisposition':{'type':Sequelize[_0x789c('0x4')]},'thirdDisposition':{'type':Sequelize[_0x789c('0x4')]},'dispositionat':{'type':Sequelize[_0x789c('0x2')],'set':function(_0x1e8698){var _0x1e26e4=this['getDataValue']('endtime');if(_0x1e26e4&&_0x1e8698){this['setDataValue'](_0x789c('0x5'),moment(_0x1e8698)['diff'](moment(_0x1e26e4),'seconds'));}}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x789c('0x6')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x789c('0x6')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x789c('0x6')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x789c('0x2')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x789c('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x789c('0x2')]},'deleted':{'type':Sequelize[_0x789c('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x789c('0x6')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x789c('0x2')]},'countnosuchnumberretry':{'type':Sequelize[_0x789c('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x789c('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x789c('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x789c('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x789c('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x4c59=['endtime','setDataValue','followuptime','diff','seconds','BOOLEAN','sequelize','INTEGER','STRING','DATE'];(function(_0x1b91c7,_0x539acd){var _0xbbe014=function(_0x57ff15){while(--_0x57ff15){_0x1b91c7['push'](_0x1b91c7['shift']());}};_0xbbe014(++_0x539acd);}(_0x4c59,0x1e6));var _0x94c5=function(_0x58b6c7,_0x3bf35e){_0x58b6c7=_0x58b6c7-0x0;var _0x5f50d0=_0x4c59[_0x58b6c7];return _0x5f50d0;};'use strict';var Sequelize=require(_0x94c5('0x0'));var moment=require('moment');module['exports']={'state':{'type':Sequelize[_0x94c5('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x94c5('0x2')]},'scheduledat':{'type':Sequelize[_0x94c5('0x3')]},'countbusyretry':{'type':Sequelize[_0x94c5('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x94c5('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x94c5('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x94c5('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x94c5('0x2')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x94c5('0x2')]},'calleridnum':{'type':Sequelize[_0x94c5('0x2')]},'calleridname':{'type':Sequelize[_0x94c5('0x2')]},'starttime':{'type':Sequelize[_0x94c5('0x3')]},'responsetime':{'type':Sequelize[_0x94c5('0x3')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x94c5('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x94c5('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x94c5('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x94c5('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x94c5('0x2')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x94c5('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x94c5('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0x94c5('0x3')],'set':function(_0x283241){var _0x5a3417=this['getDataValue'](_0x94c5('0x4'));if(_0x5a3417&&_0x283241){this[_0x94c5('0x5')](_0x94c5('0x6'),moment(_0x283241)[_0x94c5('0x7')](moment(_0x5a3417),_0x94c5('0x8')));}}},'amd':{'type':Sequelize[_0x94c5('0x9')],'defaultValue':![]},'fax':{'type':Sequelize[_0x94c5('0x9')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x94c5('0x9')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x94c5('0x3')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x94c5('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x94c5('0x3')]},'deleted':{'type':Sequelize[_0x94c5('0x2')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x94c5('0x3')]},'recallme':{'type':Sequelize[_0x94c5('0x9')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize[_0x94c5('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x94c5('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x94c5('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x94c5('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x94c5('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index 0851852..2ca98e1 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 _0x524e=['destroy','name','send','index','map','rawAttributes','key','model','keys','filters','intersection','attributes','fields','query','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','CmHopperFinal','then','includeAll','include','findAll','rows','catch','show','length','find','describe','body','uniqueid','params','sequelize','COUNT','`state`\x20=\x200,\x201,\x20null','noSuchContacts','literal','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2022,\x201,\x20null','countContactsIvrCampaignHopperFinal','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','moveContactsQueueCampaignHopperFinal','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ListId','VoiceQueueId','createdAt','select','field','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','updatedAt','from','cm_hopper_final','toString','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','VoiceQueueId\x20=\x20?','group','Campaign','ContactId','ANY_VALUE(calleridnum)','CampaignId','CampaignId\x20=\x20?','state\x20=\x20?','calleridnum','CmHopper','findOne','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','apply','reject','save','update'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x524e,0x15e));var _0xe524=function(_0x243313,_0x500c94){_0x243313=_0x243313-0x0;var _0x302d26=_0x524e[_0x243313];return _0x302d26;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe524('0x0'));var jsonpatch=require(_0xe524('0x1'));var rp=require(_0xe524('0x2'));var moment=require(_0xe524('0x3'));var BPromise=require(_0xe524('0x4'));var Mustache=require(_0xe524('0x5'));var util=require(_0xe524('0x6'));var path=require(_0xe524('0x7'));var sox=require(_0xe524('0x8'));var csv=require(_0xe524('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe524('0xa'));var _=require(_0xe524('0xb'));var squel=require(_0xe524('0xc'));var crypto=require('crypto');var jsforce=require(_0xe524('0xd'));var deskjs=require(_0xe524('0xe'));var toCsv=require(_0xe524('0x9'));var querystring=require(_0xe524('0xf'));var Papa=require(_0xe524('0x10'));var Redis=require(_0xe524('0x11'));var authService=require(_0xe524('0x12'));var qs=require(_0xe524('0x13'));var as=require(_0xe524('0x14'));var hardwareService=require(_0xe524('0x15'));var logger=require(_0xe524('0x16'))(_0xe524('0x17'));var utils=require(_0xe524('0x18'));var config=require(_0xe524('0x19'));var licenseUtil=require(_0xe524('0x1a'));var db=require(_0xe524('0x1b'))['db'];function respondWithStatusCode(_0x5077c1,_0x4b0f51){_0x4b0f51=_0x4b0f51||0xcc;return function(_0xfdc2a5){if(_0xfdc2a5){return _0x5077c1[_0xe524('0x1c')](_0x4b0f51);}return _0x5077c1[_0xe524('0x1d')](_0x4b0f51)[_0xe524('0x1e')]();};}function respondWithResult(_0x20a852,_0x57c1b6){_0x57c1b6=_0x57c1b6||0xc8;return function(_0x12ff75){if(_0x12ff75){return _0x20a852['status'](_0x57c1b6)[_0xe524('0x1f')](_0x12ff75);}};}function respondWithFilteredResult(_0x1b0af6,_0x48165e){return function(_0x569660){if(_0x569660){var _0x488fce=typeof _0x48165e[_0xe524('0x20')]==='undefined'&&typeof _0x48165e[_0xe524('0x21')]==='undefined';var _0x5c8736=_0x569660['count'];var _0x3a4027=_0x488fce?0x0:_0x48165e['offset'];var _0x11b2a1=_0x488fce?_0x569660[_0xe524('0x22')]:_0x48165e[_0xe524('0x20')]+_0x48165e[_0xe524('0x21')];var _0x5d7b17;if(_0x11b2a1>=_0x5c8736){_0x11b2a1=_0x5c8736;_0x5d7b17=0xc8;}else{_0x5d7b17=0xce;}_0x1b0af6[_0xe524('0x1d')](_0x5d7b17);return _0x1b0af6[_0xe524('0x23')]('Content-Range',_0x3a4027+'-'+_0x11b2a1+'/'+_0x5c8736)[_0xe524('0x1f')](_0x569660);}return null;};}function patchUpdates(_0x309f85){return function(_0x43a4f9){try{jsonpatch[_0xe524('0x24')](_0x43a4f9,_0x309f85,!![]);}catch(_0x1c4194){return BPromise[_0xe524('0x25')](_0x1c4194);}return _0x43a4f9[_0xe524('0x26')]();};}function saveUpdates(_0x375219,_0x7dfe97){return function(_0x5c4d21){if(_0x5c4d21){return _0x5c4d21[_0xe524('0x27')](_0x375219)['then'](function(_0x577d1f){return _0x577d1f;});}return null;};}function removeEntity(_0x2d2f83,_0x23df5e){return function(_0x1ad106){if(_0x1ad106){return _0x1ad106[_0xe524('0x28')]()['then'](function(){_0x2d2f83[_0xe524('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17e245,_0xcf5db){return function(_0xd62772){if(!_0xd62772){_0x17e245[_0xe524('0x1c')](0x194);}return _0xd62772;};}function handleError(_0x4102d9,_0xfd5965){_0xfd5965=_0xfd5965||0x1f4;return function(_0x2141db){logger['error'](_0x2141db['stack']);if(_0x2141db[_0xe524('0x29')]){delete _0x2141db[_0xe524('0x29')];}_0x4102d9[_0xe524('0x1d')](_0xfd5965)[_0xe524('0x2a')](_0x2141db);};}exports[_0xe524('0x2b')]=function(_0x5405e4,_0x52f140){var _0x4b1ff={},_0x25e7a7={},_0x3aedd9={'count':0x0,'rows':[]};var _0x8070e4=_[_0xe524('0x2c')](db['CmHopperFinal'][_0xe524('0x2d')],function(_0x9a7e98){return{'name':_0x9a7e98['fieldName'],'type':_0x9a7e98['type'][_0xe524('0x2e')]};});_0x25e7a7[_0xe524('0x2f')]=_['map'](_0x8070e4,_0xe524('0x29'));_0x25e7a7['query']=_[_0xe524('0x30')](_0x5405e4['query']);_0x25e7a7[_0xe524('0x31')]=_[_0xe524('0x32')](_0x25e7a7[_0xe524('0x2f')],_0x25e7a7['query']);_0x4b1ff[_0xe524('0x33')]=_['intersection'](_0x25e7a7[_0xe524('0x2f')],qs[_0xe524('0x34')](_0x5405e4[_0xe524('0x35')]['fields']));_0x4b1ff[_0xe524('0x33')]=_0x4b1ff[_0xe524('0x33')]['length']?_0x4b1ff[_0xe524('0x33')]:_0x25e7a7[_0xe524('0x2f')];if(!_0x5405e4[_0xe524('0x35')][_0xe524('0x36')]('nolimit')){_0x4b1ff[_0xe524('0x21')]=qs[_0xe524('0x21')](_0x5405e4[_0xe524('0x35')][_0xe524('0x21')]);_0x4b1ff[_0xe524('0x20')]=qs[_0xe524('0x20')](_0x5405e4[_0xe524('0x35')][_0xe524('0x20')]);}_0x4b1ff['order']=qs[_0xe524('0x37')](_0x5405e4['query'][_0xe524('0x37')]);_0x4b1ff[_0xe524('0x38')]=qs['filters'](_[_0xe524('0x39')](_0x5405e4['query'],_0x25e7a7[_0xe524('0x31')]),_0x8070e4);if(_0x5405e4[_0xe524('0x35')][_0xe524('0x3a')]){_0x4b1ff[_0xe524('0x38')]=_[_0xe524('0x3b')](_0x4b1ff[_0xe524('0x38')],{'$or':_[_0xe524('0x2c')](_0x8070e4,function(_0x13762c){if(_0x13762c['type']!==_0xe524('0x3c')){var _0x940c05={};_0x940c05[_0x13762c[_0xe524('0x29')]]={'$like':'%'+_0x5405e4[_0xe524('0x35')][_0xe524('0x3a')]+'%'};return _0x940c05;}})});}_0x4b1ff=_[_0xe524('0x3b')]({},_0x4b1ff,_0x5405e4[_0xe524('0x3d')]);var _0x158d45={'where':_0x4b1ff['where']};return db[_0xe524('0x3e')][_0xe524('0x22')](_0x158d45)[_0xe524('0x3f')](function(_0x59781b){_0x3aedd9[_0xe524('0x22')]=_0x59781b;if(_0x5405e4['query'][_0xe524('0x40')]){_0x4b1ff[_0xe524('0x41')]=[{'all':!![]}];}return db[_0xe524('0x3e')][_0xe524('0x42')](_0x4b1ff);})[_0xe524('0x3f')](function(_0x4746cd){_0x3aedd9[_0xe524('0x43')]=_0x4746cd;return _0x3aedd9;})['then'](respondWithFilteredResult(_0x52f140,_0x4b1ff))[_0xe524('0x44')](handleError(_0x52f140,null));};exports[_0xe524('0x45')]=function(_0x13c54c,_0x376505){var _0x438962={'raw':!![],'where':{'id':_0x13c54c['params']['id']}},_0x1ae283={};_0x1ae283[_0xe524('0x2f')]=_[_0xe524('0x30')](db[_0xe524('0x3e')]['rawAttributes']);_0x1ae283[_0xe524('0x35')]=_['keys'](_0x13c54c['query']);_0x1ae283[_0xe524('0x31')]=_[_0xe524('0x32')](_0x1ae283['model'],_0x1ae283[_0xe524('0x35')]);_0x438962[_0xe524('0x33')]=_[_0xe524('0x32')](_0x1ae283[_0xe524('0x2f')],qs['fields'](_0x13c54c['query'][_0xe524('0x34')]));_0x438962[_0xe524('0x33')]=_0x438962['attributes'][_0xe524('0x46')]?_0x438962['attributes']:_0x1ae283[_0xe524('0x2f')];if(_0x13c54c[_0xe524('0x35')][_0xe524('0x40')]){_0x438962[_0xe524('0x41')]=[{'all':!![]}];}_0x438962=_[_0xe524('0x3b')]({},_0x438962,_0x13c54c[_0xe524('0x3d')]);return db[_0xe524('0x3e')][_0xe524('0x47')](_0x438962)[_0xe524('0x3f')](handleEntityNotFound(_0x376505,null))[_0xe524('0x3f')](respondWithResult(_0x376505,null))[_0xe524('0x44')](handleError(_0x376505,null));};exports[_0xe524('0x48')]=function(_0x3d7ab7,_0x33b1c8){return db[_0xe524('0x3e')]['describe']()[_0xe524('0x3f')](respondWithResult(_0x33b1c8,null))['catch'](handleError(_0x33b1c8,null));};exports['update']=function(_0x24f313,_0x59fe6b){if(_0x24f313[_0xe524('0x49')][_0xe524('0x4a')]){delete _0x24f313['body'][_0xe524('0x4a')];}return db['CmHopperFinal']['find']({'where':{'uniqueid':_0x24f313[_0xe524('0x4b')]['id']}})[_0xe524('0x3f')](handleEntityNotFound(_0x59fe6b,null))[_0xe524('0x3f')](saveUpdates(_0x24f313['body'],null))['then'](respondWithResult(_0x59fe6b,null))['catch'](handleError(_0x59fe6b,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x4f7a64,_0x5477ca,_0x45f504){return db[_0xe524('0x3e')]['findAll']({'raw':![],'where':{'VoiceQueueId':_0x4f7a64[_0xe524('0x4b')]['id']},'attributes':[[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db[_0xe524('0x4c')]['fn']('IF',db[_0xe524('0x4c')]['literal'](_0xe524('0x4e')))),_0xe524('0x4f')],[db[_0xe524('0x4c')]['fn']('COUNT',db[_0xe524('0x4c')]['fn']('IF',db['sequelize'][_0xe524('0x50')](_0xe524('0x51')))),_0xe524('0x52')],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db[_0xe524('0x4c')]['fn']('IF',db[_0xe524('0x4c')][_0xe524('0x50')](_0xe524('0x53')))),_0xe524('0x54')],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0xe524('0x55')))),_0xe524('0x56')],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db[_0xe524('0x4c')]['fn']('IF',db[_0xe524('0x4c')][_0xe524('0x50')](_0xe524('0x57')))),_0xe524('0x58')],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db['sequelize']['fn']('IF',db[_0xe524('0x4c')][_0xe524('0x50')]('`state`\x20=\x2011\x20,\x201,\x20null'))),'abandonedContacts'],[db['sequelize']['fn']('COUNT',db[_0xe524('0x4c')]['fn']('IF',db[_0xe524('0x4c')][_0xe524('0x50')](_0xe524('0x59')))),'reCallContacts'],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db[_0xe524('0x4c')]['fn']('IF',db[_0xe524('0x4c')]['literal']('`state`\x20=\x2019,\x201,\x20null'))),'answeringMachine']]})[_0xe524('0x3f')](handleEntityNotFound(_0x5477ca,null))['then'](respondWithResult(_0x5477ca,null))[_0xe524('0x44')](handleError(_0x5477ca,null));};exports[_0xe524('0x5a')]=function(_0x3f4201,_0x287ab8,_0x2b2a0e){return db['CmHopperFinal']['findAll']({'raw':![],'where':{'CampaignId':_0x3f4201[_0xe524('0x4b')]['id']},'attributes':[[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db[_0xe524('0x4c')]['fn']('IF',db[_0xe524('0x4c')][_0xe524('0x50')]('`state`\x20=\x200,\x201,\x20null'))),_0xe524('0x4f')],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db['sequelize']['fn']('IF',db[_0xe524('0x4c')][_0xe524('0x50')](_0xe524('0x51')))),'noAnswerContacts'],[db['sequelize']['fn'](_0xe524('0x4d'),db[_0xe524('0x4c')]['fn']('IF',db[_0xe524('0x4c')][_0xe524('0x50')](_0xe524('0x53')))),'busyContacts'],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db[_0xe524('0x4c')]['fn']('IF',db[_0xe524('0x4c')][_0xe524('0x50')](_0xe524('0x55')))),_0xe524('0x56')],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db[_0xe524('0x4c')]['fn']('IF',db[_0xe524('0x4c')]['literal'](_0xe524('0x57')))),_0xe524('0x58')],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db[_0xe524('0x4c')]['fn']('IF',db['sequelize'][_0xe524('0x50')](_0xe524('0x5b')))),_0xe524('0x5c')],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db[_0xe524('0x4c')]['fn']('IF',db[_0xe524('0x4c')]['literal'](_0xe524('0x59')))),_0xe524('0x5d')],[db[_0xe524('0x4c')]['fn'](_0xe524('0x4d'),db['sequelize']['fn']('IF',db[_0xe524('0x4c')]['literal'](_0xe524('0x5e')))),_0xe524('0x5f')]]})[_0xe524('0x3f')](handleEntityNotFound(_0x287ab8,null))['then'](respondWithResult(_0x287ab8,null))[_0xe524('0x44')](handleError(_0x287ab8,null));};exports[_0xe524('0x60')]=function(_0x43d125,_0x13905f,_0x4514d4){return db['VoiceQueue'][_0xe524('0x47')]({'where':{'id':_0x43d125[_0xe524('0x4b')]['id']}})[_0xe524('0x3f')](handleEntityNotFound(_0x13905f,null))[_0xe524('0x3f')](function(_0x109da1){var _0x57b6bb;if(_0x109da1){_0x57b6bb=squel[_0xe524('0x61')]()[_0xe524('0x62')](_0xe524('0x63'))[_0xe524('0x64')]([_0xe524('0x65'),_0xe524('0x66'),'ContactId',_0xe524('0x67'),_0xe524('0x68'),_0xe524('0x69'),'updatedAt'],squel[_0xe524('0x6a')]()[_0xe524('0x6b')]('ANY_VALUE(calleridnum)',_0xe524('0x65'))[_0xe524('0x6b')](_0xe524('0x6c'),_0xe524('0x66'))[_0xe524('0x6b')](_0xe524('0x6d'),'ContactId')[_0xe524('0x6b')](_0xe524('0x6e'),_0xe524('0x67'))[_0xe524('0x6b')](_0xe524('0x6f'),_0xe524('0x68'))[_0xe524('0x6b')](_0xe524('0x6c'),_0xe524('0x69'))[_0xe524('0x6b')](_0xe524('0x6c'),_0xe524('0x70'))[_0xe524('0x71')](_0xe524('0x72'))[_0xe524('0x38')]('VoiceQueueId\x20=\x20?',_0x43d125[_0xe524('0x4b')]['id'][_0xe524('0x73')]())[_0xe524('0x38')]('state\x20=\x20?',_0x43d125[_0xe524('0x49')][_0xe524('0x74')]['toString']())['where'](_0xe524('0x75'))['where'](_0xe524('0x76'),squel['select']()[_0xe524('0x6b')](_0xe524('0x65'))[_0xe524('0x71')](_0xe524('0x63'))['where']('VoiceQueueId\x20=\x20?',_0x43d125[_0xe524('0x4b')]['id'][_0xe524('0x73')]()))['where'](_0xe524('0x76'),squel[_0xe524('0x6a')]()[_0xe524('0x6b')]('calleridnum')[_0xe524('0x71')](_0xe524('0x72'))[_0xe524('0x38')](_0xe524('0x77'),_0x43d125[_0xe524('0x4b')]['id'][_0xe524('0x73')]())['where']('state\x20=\x204'))[_0xe524('0x78')]('ContactId'))[_0xe524('0x73')]();return db[_0xe524('0x4c')][_0xe524('0x35')](_0x57b6bb);}return[];})['then'](respondWithResult(_0x13905f,null))[_0xe524('0x44')](handleError(_0x13905f,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x1681c5,_0x41e693,_0xfc62e5){return db[_0xe524('0x79')][_0xe524('0x47')]({'where':{'id':_0x1681c5[_0xe524('0x4b')]['id']}})['then'](handleEntityNotFound(_0x41e693,null))[_0xe524('0x3f')](function(_0x35d0f4){var _0xa8334;if(_0x35d0f4){_0xa8334=squel['insert']()[_0xe524('0x62')](_0xe524('0x63'))['fromQuery']([_0xe524('0x65'),_0xe524('0x66'),_0xe524('0x7a'),_0xe524('0x67'),'CampaignId',_0xe524('0x69'),_0xe524('0x70')],squel[_0xe524('0x6a')]()['field'](_0xe524('0x7b'),'phone')[_0xe524('0x6b')](_0xe524('0x6c'),_0xe524('0x66'))['field'](_0xe524('0x6d'),_0xe524('0x7a'))[_0xe524('0x6b')]('ANY_VALUE(ListId)','ListId')[_0xe524('0x6b')]('ANY_VALUE(CampaignId)',_0xe524('0x7c'))['field'](_0xe524('0x6c'),_0xe524('0x69'))['field'](_0xe524('0x6c'),_0xe524('0x70'))['from']('cm_hopper_final')[_0xe524('0x38')](_0xe524('0x7d'),_0x1681c5[_0xe524('0x4b')]['id']['toString']())[_0xe524('0x38')](_0xe524('0x7e'),_0x1681c5[_0xe524('0x49')][_0xe524('0x74')][_0xe524('0x73')]())[_0xe524('0x38')]('calleridnum\x20IS\x20NOT\x20NULL')[_0xe524('0x38')](_0xe524('0x76'),squel['select']()['field'](_0xe524('0x65'))[_0xe524('0x71')](_0xe524('0x63'))[_0xe524('0x38')]('CampaignId\x20=\x20?',_0x1681c5[_0xe524('0x4b')]['id'][_0xe524('0x73')]()))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xe524('0x6a')]()[_0xe524('0x6b')](_0xe524('0x7f'))[_0xe524('0x71')](_0xe524('0x72'))[_0xe524('0x38')]('CampaignId\x20=\x20?',_0x1681c5['params']['id'][_0xe524('0x73')]())[_0xe524('0x38')]('state\x20=\x204'))['group'](_0xe524('0x7a')))[_0xe524('0x73')]();return db[_0xe524('0x4c')][_0xe524('0x35')](_0xa8334);}return[];})[_0xe524('0x3f')](respondWithResult(_0x41e693,null))[_0xe524('0x44')](handleError(_0x41e693,null));};exports['checkContactHopper']=function(_0x555801,_0x3e8668,_0x390093){return db[_0xe524('0x80')][_0xe524('0x81')]({'where':{'VoiceQueueId':_0x555801[_0xe524('0x49')][_0xe524('0x68')],'CampaignId':_0x555801[_0xe524('0x49')][_0xe524('0x7c')],'ContactId':_0x555801['body'][_0xe524('0x7a')]}})[_0xe524('0x3f')](handleEntityNotFound(_0x3e8668,null))[_0xe524('0x3f')](function(_0x5242b7){if(_0x5242b7){return _0x5242b7;}return null;})['then'](respondWithResult(_0x3e8668,null))[_0xe524('0x44')](handleError(_0x3e8668,null));}; \ No newline at end of file +var _0xb016=['error','name','send','index','map','CmHopperFinal','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','update','body','find','countContactsQueueCampaignHopperFinal','COUNT','sequelize','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','reCallContacts','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','state\x20=\x20?','toString','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','moveContactsIvrCampaignHopperFinal','Campaign','into','CampaignId','ANY_VALUE(ListId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','state','calleridnum','state\x20=\x204','group','checkContactHopper','CmHopper','eml-format','rimraf','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','end'];(function(_0x4538ea,_0x19e74c){var _0x503076=function(_0x36c73b){while(--_0x36c73b){_0x4538ea['push'](_0x4538ea['shift']());}};_0x503076(++_0x19e74c);}(_0xb016,0x159));var _0x6b01=function(_0x5058dd,_0x5e45b3){_0x5058dd=_0x5058dd-0x0;var _0x421a72=_0xb016[_0x5058dd];return _0x421a72;};'use strict';var emlformat=require(_0x6b01('0x0'));var rimraf=require(_0x6b01('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6b01('0x2'));var moment=require('moment');var BPromise=require(_0x6b01('0x3'));var Mustache=require(_0x6b01('0x4'));var util=require(_0x6b01('0x5'));var path=require(_0x6b01('0x6'));var sox=require('sox');var csv=require(_0x6b01('0x7'));var ejs=require(_0x6b01('0x8'));var fs=require('fs');var fs_extra=require(_0x6b01('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6b01('0xa'));var jsforce=require(_0x6b01('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6b01('0xc'));var Papa=require(_0x6b01('0xd'));var Redis=require(_0x6b01('0xe'));var authService=require(_0x6b01('0xf'));var qs=require(_0x6b01('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6b01('0x11'))(_0x6b01('0x12'));var utils=require(_0x6b01('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x6b01('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x51f976,_0x26f2a0){_0x26f2a0=_0x26f2a0||0xcc;return function(_0x4fa826){if(_0x4fa826){return _0x51f976[_0x6b01('0x15')](_0x26f2a0);}return _0x51f976[_0x6b01('0x16')](_0x26f2a0)['end']();};}function respondWithResult(_0x2c305e,_0x4ea5fa){_0x4ea5fa=_0x4ea5fa||0xc8;return function(_0x50d778){if(_0x50d778){return _0x2c305e['status'](_0x4ea5fa)[_0x6b01('0x17')](_0x50d778);}};}function respondWithFilteredResult(_0x4cbd38,_0x5b2f60){return function(_0x3a259f){if(_0x3a259f){var _0x327e86=typeof _0x5b2f60[_0x6b01('0x18')]===_0x6b01('0x19')&&typeof _0x5b2f60[_0x6b01('0x1a')]===_0x6b01('0x19');var _0x122769=_0x3a259f[_0x6b01('0x1b')];var _0x9c6571=_0x327e86?0x0:_0x5b2f60[_0x6b01('0x18')];var _0x18f336=_0x327e86?_0x3a259f['count']:_0x5b2f60[_0x6b01('0x18')]+_0x5b2f60[_0x6b01('0x1a')];var _0x3b0bab;if(_0x18f336>=_0x122769){_0x18f336=_0x122769;_0x3b0bab=0xc8;}else{_0x3b0bab=0xce;}_0x4cbd38[_0x6b01('0x16')](_0x3b0bab);return _0x4cbd38[_0x6b01('0x1c')](_0x6b01('0x1d'),_0x9c6571+'-'+_0x18f336+'/'+_0x122769)[_0x6b01('0x17')](_0x3a259f);}return null;};}function patchUpdates(_0x3c0573){return function(_0x54a942){try{jsonpatch[_0x6b01('0x1e')](_0x54a942,_0x3c0573,!![]);}catch(_0xc1f453){return BPromise[_0x6b01('0x1f')](_0xc1f453);}return _0x54a942[_0x6b01('0x20')]();};}function saveUpdates(_0x1fced4,_0x181b09){return function(_0x2cea6e){if(_0x2cea6e){return _0x2cea6e['update'](_0x1fced4)[_0x6b01('0x21')](function(_0xcf9200){return _0xcf9200;});}return null;};}function removeEntity(_0x42c990,_0x51243c){return function(_0x399808){if(_0x399808){return _0x399808[_0x6b01('0x22')]()[_0x6b01('0x21')](function(){_0x42c990[_0x6b01('0x16')](0xcc)[_0x6b01('0x23')]();});}};}function handleEntityNotFound(_0x2456e9,_0x1b46fb){return function(_0x136452){if(!_0x136452){_0x2456e9[_0x6b01('0x15')](0x194);}return _0x136452;};}function handleError(_0x152dda,_0x3c0607){_0x3c0607=_0x3c0607||0x1f4;return function(_0xa846d8){logger[_0x6b01('0x24')](_0xa846d8['stack']);if(_0xa846d8[_0x6b01('0x25')]){delete _0xa846d8[_0x6b01('0x25')];}_0x152dda[_0x6b01('0x16')](_0x3c0607)[_0x6b01('0x26')](_0xa846d8);};}exports[_0x6b01('0x27')]=function(_0x528cbd,_0x54f030){var _0x3fae61={},_0x3df3d4={},_0xc574c={'count':0x0,'rows':[]};var _0x8883d1=_[_0x6b01('0x28')](db[_0x6b01('0x29')]['rawAttributes'],function(_0x39f193){return{'name':_0x39f193['fieldName'],'type':_0x39f193[_0x6b01('0x2a')]['key']};});_0x3df3d4[_0x6b01('0x2b')]=_[_0x6b01('0x28')](_0x8883d1,_0x6b01('0x25'));_0x3df3d4[_0x6b01('0x2c')]=_[_0x6b01('0x2d')](_0x528cbd['query']);_0x3df3d4[_0x6b01('0x2e')]=_[_0x6b01('0x2f')](_0x3df3d4[_0x6b01('0x2b')],_0x3df3d4['query']);_0x3fae61['attributes']=_[_0x6b01('0x2f')](_0x3df3d4['model'],qs[_0x6b01('0x30')](_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x30')]));_0x3fae61['attributes']=_0x3fae61[_0x6b01('0x31')][_0x6b01('0x32')]?_0x3fae61[_0x6b01('0x31')]:_0x3df3d4['model'];if(!_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x33')](_0x6b01('0x34'))){_0x3fae61[_0x6b01('0x1a')]=qs[_0x6b01('0x1a')](_0x528cbd['query'][_0x6b01('0x1a')]);_0x3fae61[_0x6b01('0x18')]=qs[_0x6b01('0x18')](_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x18')]);}_0x3fae61[_0x6b01('0x35')]=qs[_0x6b01('0x36')](_0x528cbd[_0x6b01('0x2c')]['sort']);_0x3fae61[_0x6b01('0x37')]=qs['filters'](_[_0x6b01('0x38')](_0x528cbd[_0x6b01('0x2c')],_0x3df3d4[_0x6b01('0x2e')]),_0x8883d1);if(_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x39')]){_0x3fae61[_0x6b01('0x37')]=_[_0x6b01('0x3a')](_0x3fae61['where'],{'$or':_[_0x6b01('0x28')](_0x8883d1,function(_0x15f274){if(_0x15f274[_0x6b01('0x2a')]!==_0x6b01('0x3b')){var _0x1ca3aa={};_0x1ca3aa[_0x15f274[_0x6b01('0x25')]]={'$like':'%'+_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x39')]+'%'};return _0x1ca3aa;}})});}_0x3fae61=_['merge']({},_0x3fae61,_0x528cbd[_0x6b01('0x3c')]);var _0x55907f={'where':_0x3fae61[_0x6b01('0x37')]};return db[_0x6b01('0x29')]['count'](_0x55907f)[_0x6b01('0x21')](function(_0x2e661b){_0xc574c[_0x6b01('0x1b')]=_0x2e661b;if(_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x3d')]){_0x3fae61[_0x6b01('0x3e')]=[{'all':!![]}];}return db[_0x6b01('0x29')][_0x6b01('0x3f')](_0x3fae61);})[_0x6b01('0x21')](function(_0x17f335){_0xc574c['rows']=_0x17f335;return _0xc574c;})[_0x6b01('0x21')](respondWithFilteredResult(_0x54f030,_0x3fae61))[_0x6b01('0x40')](handleError(_0x54f030,null));};exports['show']=function(_0x52cec0,_0x32b9ec){var _0xd11195={'raw':!![],'where':{'id':_0x52cec0[_0x6b01('0x41')]['id']}},_0x558ec1={};_0x558ec1[_0x6b01('0x2b')]=_['keys'](db[_0x6b01('0x29')]['rawAttributes']);_0x558ec1[_0x6b01('0x2c')]=_[_0x6b01('0x2d')](_0x52cec0[_0x6b01('0x2c')]);_0x558ec1['filters']=_[_0x6b01('0x2f')](_0x558ec1[_0x6b01('0x2b')],_0x558ec1['query']);_0xd11195['attributes']=_['intersection'](_0x558ec1[_0x6b01('0x2b')],qs[_0x6b01('0x30')](_0x52cec0[_0x6b01('0x2c')][_0x6b01('0x30')]));_0xd11195[_0x6b01('0x31')]=_0xd11195[_0x6b01('0x31')]['length']?_0xd11195[_0x6b01('0x31')]:_0x558ec1[_0x6b01('0x2b')];if(_0x52cec0[_0x6b01('0x2c')][_0x6b01('0x3d')]){_0xd11195[_0x6b01('0x3e')]=[{'all':!![]}];}_0xd11195=_[_0x6b01('0x3a')]({},_0xd11195,_0x52cec0['options']);return db[_0x6b01('0x29')]['find'](_0xd11195)['then'](handleEntityNotFound(_0x32b9ec,null))[_0x6b01('0x21')](respondWithResult(_0x32b9ec,null))[_0x6b01('0x40')](handleError(_0x32b9ec,null));};exports['describe']=function(_0x408bb0,_0x27442e){return db[_0x6b01('0x29')]['describe']()['then'](respondWithResult(_0x27442e,null))['catch'](handleError(_0x27442e,null));};exports[_0x6b01('0x42')]=function(_0x12160f,_0x518d94){if(_0x12160f[_0x6b01('0x43')]['uniqueid']){delete _0x12160f['body']['uniqueid'];}return db[_0x6b01('0x29')][_0x6b01('0x44')]({'where':{'uniqueid':_0x12160f['params']['id']}})['then'](handleEntityNotFound(_0x518d94,null))[_0x6b01('0x21')](saveUpdates(_0x12160f['body'],null))[_0x6b01('0x21')](respondWithResult(_0x518d94,null))[_0x6b01('0x40')](handleError(_0x518d94,null));};exports[_0x6b01('0x45')]=function(_0x172a56,_0x13f6d7,_0x4d327f){return db[_0x6b01('0x29')][_0x6b01('0x3f')]({'raw':![],'where':{'VoiceQueueId':_0x172a56[_0x6b01('0x41')]['id']},'attributes':[[db['sequelize']['fn'](_0x6b01('0x46'),db[_0x6b01('0x47')]['fn']('IF',db['sequelize'][_0x6b01('0x48')](_0x6b01('0x49')))),_0x6b01('0x4a')],[db[_0x6b01('0x47')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x6b01('0x47')]['literal']('`state`\x20=\x203,\x201,\x20null'))),_0x6b01('0x4b')],[db[_0x6b01('0x47')]['fn']('COUNT',db[_0x6b01('0x47')]['fn']('IF',db[_0x6b01('0x47')]['literal'](_0x6b01('0x4c')))),_0x6b01('0x4d')],[db[_0x6b01('0x47')]['fn'](_0x6b01('0x46'),db[_0x6b01('0x47')]['fn']('IF',db['sequelize'][_0x6b01('0x48')]('`state`\x20=\x208,\x201,\x20null'))),_0x6b01('0x4e')],[db[_0x6b01('0x47')]['fn'](_0x6b01('0x46'),db['sequelize']['fn']('IF',db[_0x6b01('0x47')][_0x6b01('0x48')](_0x6b01('0x4f')))),_0x6b01('0x50')],[db['sequelize']['fn'](_0x6b01('0x46'),db[_0x6b01('0x47')]['fn']('IF',db[_0x6b01('0x47')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x6b01('0x51')],[db[_0x6b01('0x47')]['fn'](_0x6b01('0x46'),db['sequelize']['fn']('IF',db[_0x6b01('0x47')][_0x6b01('0x48')](_0x6b01('0x52')))),'reCallContacts'],[db['sequelize']['fn'](_0x6b01('0x46'),db[_0x6b01('0x47')]['fn']('IF',db['sequelize'][_0x6b01('0x48')](_0x6b01('0x53')))),_0x6b01('0x54')]]})[_0x6b01('0x21')](handleEntityNotFound(_0x13f6d7,null))[_0x6b01('0x21')](respondWithResult(_0x13f6d7,null))[_0x6b01('0x40')](handleError(_0x13f6d7,null));};exports[_0x6b01('0x55')]=function(_0x425d28,_0x132dda,_0x4c1345){return db[_0x6b01('0x29')][_0x6b01('0x3f')]({'raw':![],'where':{'CampaignId':_0x425d28[_0x6b01('0x41')]['id']},'attributes':[[db[_0x6b01('0x47')]['fn'](_0x6b01('0x46'),db[_0x6b01('0x47')]['fn']('IF',db[_0x6b01('0x47')][_0x6b01('0x48')](_0x6b01('0x49')))),'noSuchContacts'],[db[_0x6b01('0x47')]['fn'](_0x6b01('0x46'),db[_0x6b01('0x47')]['fn']('IF',db[_0x6b01('0x47')][_0x6b01('0x48')](_0x6b01('0x56')))),'noAnswerContacts'],[db['sequelize']['fn'](_0x6b01('0x46'),db[_0x6b01('0x47')]['fn']('IF',db[_0x6b01('0x47')][_0x6b01('0x48')](_0x6b01('0x4c')))),_0x6b01('0x4d')],[db['sequelize']['fn'](_0x6b01('0x46'),db[_0x6b01('0x47')]['fn']('IF',db[_0x6b01('0x47')][_0x6b01('0x48')](_0x6b01('0x57')))),_0x6b01('0x4e')],[db[_0x6b01('0x47')]['fn']('COUNT',db[_0x6b01('0x47')]['fn']('IF',db['sequelize'][_0x6b01('0x48')](_0x6b01('0x4f')))),_0x6b01('0x50')],[db['sequelize']['fn'](_0x6b01('0x46'),db[_0x6b01('0x47')]['fn']('IF',db[_0x6b01('0x47')][_0x6b01('0x48')](_0x6b01('0x58')))),_0x6b01('0x51')],[db[_0x6b01('0x47')]['fn'](_0x6b01('0x46'),db[_0x6b01('0x47')]['fn']('IF',db[_0x6b01('0x47')][_0x6b01('0x48')](_0x6b01('0x52')))),_0x6b01('0x59')],[db[_0x6b01('0x47')]['fn'](_0x6b01('0x46'),db[_0x6b01('0x47')]['fn']('IF',db[_0x6b01('0x47')][_0x6b01('0x48')](_0x6b01('0x53')))),'answeringMachine']]})[_0x6b01('0x21')](handleEntityNotFound(_0x132dda,null))[_0x6b01('0x21')](respondWithResult(_0x132dda,null))[_0x6b01('0x40')](handleError(_0x132dda,null));};exports[_0x6b01('0x5a')]=function(_0x1c419c,_0x250889,_0x40931a){return db[_0x6b01('0x5b')][_0x6b01('0x44')]({'where':{'id':_0x1c419c[_0x6b01('0x41')]['id']}})[_0x6b01('0x21')](handleEntityNotFound(_0x250889,null))[_0x6b01('0x21')](function(_0x468a0b){var _0x30171f;if(_0x468a0b){_0x30171f=squel[_0x6b01('0x5c')]()['into'](_0x6b01('0x5d'))[_0x6b01('0x5e')]([_0x6b01('0x5f'),_0x6b01('0x60'),_0x6b01('0x61'),_0x6b01('0x62'),_0x6b01('0x63'),_0x6b01('0x64'),_0x6b01('0x65')],squel[_0x6b01('0x66')]()[_0x6b01('0x67')](_0x6b01('0x68'),_0x6b01('0x5f'))[_0x6b01('0x67')](_0x6b01('0x69'),_0x6b01('0x60'))[_0x6b01('0x67')](_0x6b01('0x6a'),_0x6b01('0x61'))[_0x6b01('0x67')]('ANY_VALUE(ListId)','ListId')['field']('ANY_VALUE(VoiceQueueId)',_0x6b01('0x63'))['field']('NOW()','createdAt')[_0x6b01('0x67')]('NOW()',_0x6b01('0x65'))[_0x6b01('0x6b')](_0x6b01('0x6c'))[_0x6b01('0x37')](_0x6b01('0x6d'),_0x1c419c['params']['id']['toString']())[_0x6b01('0x37')](_0x6b01('0x6e'),_0x1c419c[_0x6b01('0x43')]['state'][_0x6b01('0x6f')]())[_0x6b01('0x37')](_0x6b01('0x70'))[_0x6b01('0x37')](_0x6b01('0x71'),squel['select']()[_0x6b01('0x67')]('phone')[_0x6b01('0x6b')](_0x6b01('0x5d'))[_0x6b01('0x37')](_0x6b01('0x6d'),_0x1c419c[_0x6b01('0x41')]['id']['toString']()))[_0x6b01('0x37')](_0x6b01('0x71'),squel[_0x6b01('0x66')]()[_0x6b01('0x67')]('calleridnum')[_0x6b01('0x6b')](_0x6b01('0x6c'))[_0x6b01('0x37')](_0x6b01('0x6d'),_0x1c419c[_0x6b01('0x41')]['id'][_0x6b01('0x6f')]())['where']('state\x20=\x204'))['group'](_0x6b01('0x61')))[_0x6b01('0x6f')]();return db['sequelize'][_0x6b01('0x2c')](_0x30171f);}return[];})[_0x6b01('0x21')](respondWithResult(_0x250889,null))[_0x6b01('0x40')](handleError(_0x250889,null));};exports[_0x6b01('0x72')]=function(_0x536748,_0x18066a,_0x4ccc00){return db[_0x6b01('0x73')]['find']({'where':{'id':_0x536748[_0x6b01('0x41')]['id']}})['then'](handleEntityNotFound(_0x18066a,null))[_0x6b01('0x21')](function(_0x3bc182){var _0x410303;if(_0x3bc182){_0x410303=squel[_0x6b01('0x5c')]()[_0x6b01('0x74')](_0x6b01('0x5d'))[_0x6b01('0x5e')](['phone',_0x6b01('0x60'),'ContactId',_0x6b01('0x62'),_0x6b01('0x75'),_0x6b01('0x64'),_0x6b01('0x65')],squel[_0x6b01('0x66')]()[_0x6b01('0x67')](_0x6b01('0x68'),_0x6b01('0x5f'))[_0x6b01('0x67')](_0x6b01('0x69'),_0x6b01('0x60'))['field'](_0x6b01('0x6a'),_0x6b01('0x61'))[_0x6b01('0x67')](_0x6b01('0x76'),'ListId')[_0x6b01('0x67')](_0x6b01('0x77'),_0x6b01('0x75'))[_0x6b01('0x67')](_0x6b01('0x69'),'createdAt')[_0x6b01('0x67')]('NOW()',_0x6b01('0x65'))[_0x6b01('0x6b')](_0x6b01('0x6c'))[_0x6b01('0x37')](_0x6b01('0x78'),_0x536748[_0x6b01('0x41')]['id'][_0x6b01('0x6f')]())[_0x6b01('0x37')](_0x6b01('0x6e'),_0x536748[_0x6b01('0x43')][_0x6b01('0x79')][_0x6b01('0x6f')]())[_0x6b01('0x37')](_0x6b01('0x70'))['where'](_0x6b01('0x71'),squel['select']()['field'](_0x6b01('0x5f'))[_0x6b01('0x6b')](_0x6b01('0x5d'))[_0x6b01('0x37')]('CampaignId\x20=\x20?',_0x536748[_0x6b01('0x41')]['id'][_0x6b01('0x6f')]()))[_0x6b01('0x37')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x6b01('0x66')]()[_0x6b01('0x67')](_0x6b01('0x7a'))[_0x6b01('0x6b')](_0x6b01('0x6c'))[_0x6b01('0x37')](_0x6b01('0x78'),_0x536748[_0x6b01('0x41')]['id']['toString']())[_0x6b01('0x37')](_0x6b01('0x7b')))[_0x6b01('0x7c')](_0x6b01('0x61')))['toString']();return db['sequelize'][_0x6b01('0x2c')](_0x410303);}return[];})[_0x6b01('0x21')](respondWithResult(_0x18066a,null))[_0x6b01('0x40')](handleError(_0x18066a,null));};exports[_0x6b01('0x7d')]=function(_0x6a33d7,_0x214f54,_0x1343af){return db[_0x6b01('0x7e')]['findOne']({'where':{'VoiceQueueId':_0x6a33d7[_0x6b01('0x43')][_0x6b01('0x63')],'CampaignId':_0x6a33d7[_0x6b01('0x43')][_0x6b01('0x75')],'ContactId':_0x6a33d7[_0x6b01('0x43')][_0x6b01('0x61')]}})[_0x6b01('0x21')](handleEntityNotFound(_0x214f54,null))['then'](function(_0x5140ba){if(_0x5140ba){return _0x5140ba;}return null;})['then'](respondWithResult(_0x214f54,null))[_0x6b01('0x40')](handleError(_0x214f54,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 7c1687b..6db7d2e 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 _0xb715=['lodash','util','api','request-promise','rimraf','../../config/environment','exports','define','calleridnum','uniqueid'];(function(_0x31ec29,_0x58915c){var _0x3275fc=function(_0x435075){while(--_0x435075){_0x31ec29['push'](_0x31ec29['shift']());}};_0x3275fc(++_0x58915c);}(_0xb715,0xdc));var _0x5b71=function(_0x349b96,_0x2b4616){_0x349b96=_0x349b96-0x0;var _0x5e6704=_0xb715[_0x349b96];return _0x5e6704;};'use strict';var _=require(_0x5b71('0x0'));var util=require(_0x5b71('0x1'));var logger=require('../../config/logger')(_0x5b71('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5b71('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5b71('0x4'));var config=require(_0x5b71('0x5'));var attributes=require('./cmHopperFinal.attributes');module[_0x5b71('0x6')]=function(_0x391097,_0x456a9c){return _0x391097[_0x5b71('0x7')]('CmHopperFinal',attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':'calleridnum','fields':[_0x5b71('0x8')]},{'name':'uniqueid','fields':[_0x5b71('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x52da=['request-promise','rimraf','../../config/environment','./cmHopperFinal.attributes','define','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger','api','bluebird'];(function(_0x163614,_0x4b0550){var _0x25af47=function(_0x3c0193){while(--_0x3c0193){_0x163614['push'](_0x163614['shift']());}};_0x25af47(++_0x4b0550);}(_0x52da,0x10c));var _0xa52d=function(_0x331f7f,_0x5c10b9){_0x331f7f=_0x331f7f-0x0;var _0xfa9d24=_0x52da[_0x331f7f];return _0xfa9d24;};'use strict';var _=require(_0xa52d('0x0'));var util=require(_0xa52d('0x1'));var logger=require(_0xa52d('0x2'))(_0xa52d('0x3'));var moment=require('moment');var BPromise=require(_0xa52d('0x4'));var rp=require(_0xa52d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa52d('0x6'));var config=require(_0xa52d('0x7'));var attributes=require(_0xa52d('0x8'));module['exports']=function(_0x42c37c,_0x559855){return _0x42c37c[_0xa52d('0x9')]('CmHopperFinal',attributes,{'tableName':_0xa52d('0xa'),'paranoid':![],'indexes':[{'name':'calleridnum','fields':[_0xa52d('0xb')]},{'name':_0xa52d('0xc'),'fields':[_0xa52d('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 85753b9..e27603f 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x5d9b75,_0x1f9034){var _0x549e4c=function(_0x509e3c){while(--_0x509e3c){_0x5d9b75['push'](_0x5d9b75['shift']());}};_0x549e4c(++_0x1f9034);}(_0x7a54,0x106));var _0x47a5=function(_0x25a314,_0x2fbaf4){_0x25a314=_0x25a314-0x0;var _0x22c4f9=_0x7a54[_0x25a314];return _0x22c4f9;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x4c9eef,_0x4f50bb){var _0x37a9d5=function(_0x4ec00b){while(--_0x4ec00b){_0x4c9eef['push'](_0x4c9eef['shift']());}};_0x37a9d5(++_0x4f50bb);}(_0xb10b,0x12a));var _0xbb10=function(_0xf2628e,_0x521bf7){_0xf2628e=_0xf2628e-0x0;var _0x13863a=_0xb10b[_0xf2628e];return _0x13863a;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index 92d74ba..fb72f6a 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 _0x4baf=['/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','put','update','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','isAuthenticated','get','/describe','describe','/:id','show','countContactsQueueCampaignHopperFinal','countContactsIvrCampaignHopperFinal','post','moveContactsQueueCampaignHopperFinal'];(function(_0x4e5189,_0x485df7){var _0x10e14a=function(_0x108f7c){while(--_0x108f7c){_0x4e5189['push'](_0x4e5189['shift']());}};_0x10e14a(++_0x485df7);}(_0x4baf,0xb4));var _0xf4ba=function(_0xf78337,_0x11b73b){_0xf78337=_0xf78337-0x0;var _0x48a4a2=_0x4baf[_0xf78337];return _0x48a4a2;};'use strict';var multer=require(_0xf4ba('0x0'));var util=require('util');var path=require(_0xf4ba('0x1'));var timeout=require(_0xf4ba('0x2'));var express=require(_0xf4ba('0x3'));var router=express[_0xf4ba('0x4')]();var fs_extra=require(_0xf4ba('0x5'));var auth=require(_0xf4ba('0x6'));var interaction=require(_0xf4ba('0x7'));var config=require(_0xf4ba('0x8'));var controller=require(_0xf4ba('0x9'));router['get']('/',auth[_0xf4ba('0xa')](),controller['index']);router[_0xf4ba('0xb')](_0xf4ba('0xc'),auth['isAuthenticated'](),controller[_0xf4ba('0xd')]);router[_0xf4ba('0xb')](_0xf4ba('0xe'),auth[_0xf4ba('0xa')](),controller[_0xf4ba('0xf')]);router['get']('/voice/queue/countAttributes/:id',auth[_0xf4ba('0xa')](),controller[_0xf4ba('0x10')]);router[_0xf4ba('0xb')]('/campaign/countAttributes/:id',auth[_0xf4ba('0xa')](),controller[_0xf4ba('0x11')]);router[_0xf4ba('0x12')]('/voice/queue/moveContacts/:id',auth[_0xf4ba('0xa')](),controller[_0xf4ba('0x13')]);router[_0xf4ba('0x12')](_0xf4ba('0x14'),auth[_0xf4ba('0xa')](),controller[_0xf4ba('0x15')]);router[_0xf4ba('0x12')](_0xf4ba('0x16'),auth[_0xf4ba('0xa')](),controller['checkContactHopper']);router[_0xf4ba('0x17')]('/:id',auth[_0xf4ba('0xa')](),controller[_0xf4ba('0x18')]);module['exports']=router; \ No newline at end of file +var _0x4c71=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/voice/queue/countAttributes/:id','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','update','exports','multer','util','path'];(function(_0x11b1b3,_0xf3cc69){var _0x437029=function(_0x40499a){while(--_0x40499a){_0x11b1b3['push'](_0x11b1b3['shift']());}};_0x437029(++_0xf3cc69);}(_0x4c71,0x185));var _0x14c7=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0x4c71[_0x45d55e];return _0x29812a;};'use strict';var multer=require(_0x14c7('0x0'));var util=require(_0x14c7('0x1'));var path=require(_0x14c7('0x2'));var timeout=require(_0x14c7('0x3'));var express=require(_0x14c7('0x4'));var router=express['Router']();var fs_extra=require(_0x14c7('0x5'));var auth=require(_0x14c7('0x6'));var interaction=require(_0x14c7('0x7'));var config=require(_0x14c7('0x8'));var controller=require(_0x14c7('0x9'));router[_0x14c7('0xa')]('/',auth[_0x14c7('0xb')](),controller[_0x14c7('0xc')]);router[_0x14c7('0xa')](_0x14c7('0xd'),auth[_0x14c7('0xb')](),controller[_0x14c7('0xe')]);router[_0x14c7('0xa')](_0x14c7('0xf'),auth['isAuthenticated'](),controller[_0x14c7('0x10')]);router[_0x14c7('0xa')](_0x14c7('0x11'),auth[_0x14c7('0xb')](),controller['countContactsQueueCampaignHopperFinal']);router['get'](_0x14c7('0x12'),auth[_0x14c7('0xb')](),controller[_0x14c7('0x13')]);router[_0x14c7('0x14')](_0x14c7('0x15'),auth[_0x14c7('0xb')](),controller['moveContactsQueueCampaignHopperFinal']);router['post'](_0x14c7('0x16'),auth['isAuthenticated'](),controller[_0x14c7('0x17')]);router[_0x14c7('0x14')](_0x14c7('0x18'),auth[_0x14c7('0xb')](),controller[_0x14c7('0x19')]);router['put'](_0x14c7('0xf'),auth['isAuthenticated'](),controller[_0x14c7('0x1a')]);module[_0x14c7('0x1b')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 50ce95b..ab917c1 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 _0xdc1a=['INTEGER','BOOLEAN','exports','STRING','DATE'];(function(_0x13a9d4,_0x165963){var _0x911f0f=function(_0x4d0770){while(--_0x4d0770){_0x13a9d4['push'](_0x13a9d4['shift']());}};_0x911f0f(++_0x165963);}(_0xdc1a,0x133));var _0xadc1=function(_0x2b62b0,_0x3a28c4){_0x2b62b0=_0x2b62b0-0x0;var _0x2f94ea=_0xdc1a[_0x2b62b0];return _0x2f94ea;};'use strict';var Sequelize=require('sequelize');module[_0xadc1('0x0')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xadc1('0x1')]},'scheduledat':{'type':Sequelize[_0xadc1('0x2')]},'countbusyretry':{'type':Sequelize[_0xadc1('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xadc1('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xadc1('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xadc1('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xadc1('0x1')]},'originatecalleridnum':{'type':Sequelize[_0xadc1('0x1')]},'originatecalleridname':{'type':Sequelize[_0xadc1('0x1')]},'calleridnum':{'type':Sequelize[_0xadc1('0x1')]},'calleridname':{'type':Sequelize[_0xadc1('0x1')]},'starttime':{'type':Sequelize[_0xadc1('0x2')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xadc1('0x2')]},'droptime':{'type':Sequelize[_0xadc1('0x2')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xadc1('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xadc1('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xadc1('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xadc1('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xadc1('0x1')]},'campaign':{'type':Sequelize[_0xadc1('0x1')]},'campaigntype':{'type':Sequelize[_0xadc1('0x1')]},'membername':{'type':Sequelize[_0xadc1('0x1')]},'reason':{'type':Sequelize[_0xadc1('0x1')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0xadc1('0x4')],'defaultValue':![]},'callback':{'type':Sequelize[_0xadc1('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xadc1('0x1')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xadc1('0x2')]},'recallme':{'type':Sequelize[_0xadc1('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xadc1('0x2')]},'edited':{'type':Sequelize[_0xadc1('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xadc1('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xadc1('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xadc1('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xadc1('0x3')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xadc1('0x1')]}}; \ No newline at end of file +var _0x6f85=['exports','INTEGER','STRING','DATE','BOOLEAN','sequelize'];(function(_0x10507e,_0x394116){var _0x1faafc=function(_0x27cd73){while(--_0x27cd73){_0x10507e['push'](_0x10507e['shift']());}};_0x1faafc(++_0x394116);}(_0x6f85,0xe9));var _0x56f8=function(_0x36f641,_0x1a3063){_0x36f641=_0x36f641-0x0;var _0x39b299=_0x6f85[_0x36f641];return _0x39b299;};'use strict';var Sequelize=require(_0x56f8('0x0'));module[_0x56f8('0x1')]={'state':{'type':Sequelize[_0x56f8('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x56f8('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x56f8('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x56f8('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x56f8('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x56f8('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x56f8('0x3')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x56f8('0x3')]},'calleridname':{'type':Sequelize[_0x56f8('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x56f8('0x4')]},'answertime':{'type':Sequelize[_0x56f8('0x4')]},'droptime':{'type':Sequelize[_0x56f8('0x4')]},'endtime':{'type':Sequelize[_0x56f8('0x4')]},'ringtime':{'type':Sequelize[_0x56f8('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x56f8('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x56f8('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x56f8('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x56f8('0x3')]},'campaign':{'type':Sequelize[_0x56f8('0x3')]},'campaigntype':{'type':Sequelize[_0x56f8('0x3')]},'membername':{'type':Sequelize[_0x56f8('0x3')]},'reason':{'type':Sequelize[_0x56f8('0x3')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x56f8('0x5')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x56f8('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x56f8('0x4')]},'recallme':{'type':Sequelize[_0x56f8('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x56f8('0x4')]},'edited':{'type':Sequelize[_0x56f8('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x56f8('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x56f8('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x56f8('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x56f8('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x56f8('0x3')]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 9c6f992..d661dce 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 _0x0ce5=['merge','VIRTUAL','options','findAll','rows','catch','includeAll','include','find','body','describe','uniqueid','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','limit','set','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','index','map','CmHopperHistory','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','filter','where'];(function(_0x23da82,_0x481f39){var _0x366697=function(_0x1187c2){while(--_0x1187c2){_0x23da82['push'](_0x23da82['shift']());}};_0x366697(++_0x481f39);}(_0x0ce5,0x9c));var _0x50ce=function(_0xf2628e,_0x521bf7){_0xf2628e=_0xf2628e-0x0;var _0x13863a=_0x0ce5[_0xf2628e];return _0x13863a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x50ce('0x0'));var zipdir=require(_0x50ce('0x1'));var jsonpatch=require(_0x50ce('0x2'));var rp=require(_0x50ce('0x3'));var moment=require(_0x50ce('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x50ce('0x5'));var util=require('util');var path=require('path');var sox=require(_0x50ce('0x6'));var csv=require(_0x50ce('0x7'));var ejs=require(_0x50ce('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x50ce('0x9'));var squel=require(_0x50ce('0xa'));var crypto=require(_0x50ce('0xb'));var jsforce=require(_0x50ce('0xc'));var deskjs=require(_0x50ce('0xd'));var toCsv=require(_0x50ce('0x7'));var querystring=require('querystring');var Papa=require(_0x50ce('0xe'));var Redis=require(_0x50ce('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x50ce('0x10'));var as=require(_0x50ce('0x11'));var hardwareService=require(_0x50ce('0x12'));var logger=require(_0x50ce('0x13'))(_0x50ce('0x14'));var utils=require(_0x50ce('0x15'));var config=require(_0x50ce('0x16'));var licenseUtil=require(_0x50ce('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x191cda,_0x261f7){_0x261f7=_0x261f7||0xcc;return function(_0x5c98b6){if(_0x5c98b6){return _0x191cda['sendStatus'](_0x261f7);}return _0x191cda[_0x50ce('0x18')](_0x261f7)[_0x50ce('0x19')]();};}function respondWithResult(_0x1d5283,_0x3673d8){_0x3673d8=_0x3673d8||0xc8;return function(_0x2a3737){if(_0x2a3737){return _0x1d5283[_0x50ce('0x18')](_0x3673d8)[_0x50ce('0x1a')](_0x2a3737);}};}function respondWithFilteredResult(_0x55fb25,_0x383bfd){return function(_0x20f397){if(_0x20f397){var _0x312b6f=typeof _0x383bfd[_0x50ce('0x1b')]===_0x50ce('0x1c')&&typeof _0x383bfd['limit']===_0x50ce('0x1c');var _0x3e7bdf=_0x20f397['count'];var _0x250b4b=_0x312b6f?0x0:_0x383bfd[_0x50ce('0x1b')];var _0x265672=_0x312b6f?_0x20f397[_0x50ce('0x1d')]:_0x383bfd[_0x50ce('0x1b')]+_0x383bfd[_0x50ce('0x1e')];var _0x33634c;if(_0x265672>=_0x3e7bdf){_0x265672=_0x3e7bdf;_0x33634c=0xc8;}else{_0x33634c=0xce;}_0x55fb25[_0x50ce('0x18')](_0x33634c);return _0x55fb25[_0x50ce('0x1f')]('Content-Range',_0x250b4b+'-'+_0x265672+'/'+_0x3e7bdf)[_0x50ce('0x1a')](_0x20f397);}return null;};}function patchUpdates(_0x4d2b9e){return function(_0x3a9bde){try{jsonpatch[_0x50ce('0x20')](_0x3a9bde,_0x4d2b9e,!![]);}catch(_0x1d885d){return BPromise[_0x50ce('0x21')](_0x1d885d);}return _0x3a9bde[_0x50ce('0x22')]();};}function saveUpdates(_0x1999e1,_0x311ac4){return function(_0x240af8){if(_0x240af8){return _0x240af8['update'](_0x1999e1)[_0x50ce('0x23')](function(_0x421184){return _0x421184;});}return null;};}function removeEntity(_0x1df3b6,_0x51bfc4){return function(_0x5a32b1){if(_0x5a32b1){return _0x5a32b1[_0x50ce('0x24')]()[_0x50ce('0x23')](function(){_0x1df3b6['status'](0xcc)[_0x50ce('0x19')]();});}};}function handleEntityNotFound(_0x171574,_0x57c9ff){return function(_0x21d9df){if(!_0x21d9df){_0x171574[_0x50ce('0x25')](0x194);}return _0x21d9df;};}function handleError(_0x5ec4c2,_0x176776){_0x176776=_0x176776||0x1f4;return function(_0xd7230c){logger[_0x50ce('0x26')](_0xd7230c[_0x50ce('0x27')]);if(_0xd7230c[_0x50ce('0x28')]){delete _0xd7230c[_0x50ce('0x28')];}_0x5ec4c2[_0x50ce('0x18')](_0x176776)[_0x50ce('0x29')](_0xd7230c);};}exports[_0x50ce('0x2a')]=function(_0xaf3c47,_0x29f8fc){var _0x367d48={},_0x44d2df={},_0x21b097={'count':0x0,'rows':[]};var _0x7147a5=_[_0x50ce('0x2b')](db[_0x50ce('0x2c')][_0x50ce('0x2d')],function(_0x3c8f79){return{'name':_0x3c8f79[_0x50ce('0x2e')],'type':_0x3c8f79[_0x50ce('0x2f')]['key']};});_0x44d2df[_0x50ce('0x30')]=_['map'](_0x7147a5,_0x50ce('0x28'));_0x44d2df[_0x50ce('0x31')]=_[_0x50ce('0x32')](_0xaf3c47['query']);_0x44d2df[_0x50ce('0x33')]=_[_0x50ce('0x34')](_0x44d2df[_0x50ce('0x30')],_0x44d2df[_0x50ce('0x31')]);_0x367d48['attributes']=_['intersection'](_0x44d2df[_0x50ce('0x30')],qs[_0x50ce('0x35')](_0xaf3c47[_0x50ce('0x31')][_0x50ce('0x35')]));_0x367d48[_0x50ce('0x36')]=_0x367d48[_0x50ce('0x36')][_0x50ce('0x37')]?_0x367d48[_0x50ce('0x36')]:_0x44d2df['model'];if(!_0xaf3c47['query']['hasOwnProperty'](_0x50ce('0x38'))){_0x367d48['limit']=qs['limit'](_0xaf3c47[_0x50ce('0x31')][_0x50ce('0x1e')]);_0x367d48[_0x50ce('0x1b')]=qs['offset'](_0xaf3c47['query'][_0x50ce('0x1b')]);}_0x367d48['order']=qs['sort'](_0xaf3c47[_0x50ce('0x31')][_0x50ce('0x39')]);_0x367d48['where']=qs[_0x50ce('0x33')](_['pick'](_0xaf3c47[_0x50ce('0x31')],_0x44d2df[_0x50ce('0x33')]),_0x7147a5);if(_0xaf3c47[_0x50ce('0x31')][_0x50ce('0x3a')]){_0x367d48[_0x50ce('0x3b')]=_[_0x50ce('0x3c')](_0x367d48[_0x50ce('0x3b')],{'$or':_[_0x50ce('0x2b')](_0x7147a5,function(_0x37f73f){if(_0x37f73f[_0x50ce('0x2f')]!==_0x50ce('0x3d')){var _0x20f60d={};_0x20f60d[_0x37f73f[_0x50ce('0x28')]]={'$like':'%'+_0xaf3c47['query'][_0x50ce('0x3a')]+'%'};return _0x20f60d;}})});}_0x367d48=_[_0x50ce('0x3c')]({},_0x367d48,_0xaf3c47[_0x50ce('0x3e')]);var _0x58153d={'where':_0x367d48[_0x50ce('0x3b')]};return db[_0x50ce('0x2c')][_0x50ce('0x1d')](_0x58153d)[_0x50ce('0x23')](function(_0x10dc53){_0x21b097[_0x50ce('0x1d')]=_0x10dc53;if(_0xaf3c47[_0x50ce('0x31')]['includeAll']){_0x367d48['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x50ce('0x3f')](_0x367d48);})['then'](function(_0x125f7f){_0x21b097[_0x50ce('0x40')]=_0x125f7f;return _0x21b097;})[_0x50ce('0x23')](respondWithFilteredResult(_0x29f8fc,_0x367d48))[_0x50ce('0x41')](handleError(_0x29f8fc,null));};exports['show']=function(_0x21b7b4,_0x5225e7){var _0x1a8acb={'raw':!![],'where':{'id':_0x21b7b4['params']['id']}},_0x1c4f1d={};_0x1c4f1d[_0x50ce('0x30')]=_['keys'](db['CmHopperHistory'][_0x50ce('0x2d')]);_0x1c4f1d[_0x50ce('0x31')]=_[_0x50ce('0x32')](_0x21b7b4['query']);_0x1c4f1d[_0x50ce('0x33')]=_['intersection'](_0x1c4f1d[_0x50ce('0x30')],_0x1c4f1d['query']);_0x1a8acb[_0x50ce('0x36')]=_[_0x50ce('0x34')](_0x1c4f1d[_0x50ce('0x30')],qs[_0x50ce('0x35')](_0x21b7b4[_0x50ce('0x31')][_0x50ce('0x35')]));_0x1a8acb[_0x50ce('0x36')]=_0x1a8acb[_0x50ce('0x36')][_0x50ce('0x37')]?_0x1a8acb[_0x50ce('0x36')]:_0x1c4f1d[_0x50ce('0x30')];if(_0x21b7b4[_0x50ce('0x31')][_0x50ce('0x42')]){_0x1a8acb[_0x50ce('0x43')]=[{'all':!![]}];}_0x1a8acb=_[_0x50ce('0x3c')]({},_0x1a8acb,_0x21b7b4[_0x50ce('0x3e')]);return db[_0x50ce('0x2c')][_0x50ce('0x44')](_0x1a8acb)[_0x50ce('0x23')](handleEntityNotFound(_0x5225e7,null))['then'](respondWithResult(_0x5225e7,null))[_0x50ce('0x41')](handleError(_0x5225e7,null));};exports['create']=function(_0x5427b5,_0x248498){return db[_0x50ce('0x2c')]['create'](_0x5427b5[_0x50ce('0x45')],{})[_0x50ce('0x23')](respondWithResult(_0x248498,0xc9))[_0x50ce('0x41')](handleError(_0x248498,null));};exports[_0x50ce('0x46')]=function(_0x3214fa,_0x3deb4a){return db['CmHopperHistory'][_0x50ce('0x46')]()[_0x50ce('0x23')](respondWithResult(_0x3deb4a,null))[_0x50ce('0x41')](handleError(_0x3deb4a,null));};exports['update']=function(_0x52658e,_0x30da18){if(_0x52658e[_0x50ce('0x45')][_0x50ce('0x47')]){delete _0x52658e[_0x50ce('0x45')][_0x50ce('0x47')];}return db[_0x50ce('0x2c')]['find']({'where':{'uniqueid':_0x52658e['params']['id']}})[_0x50ce('0x23')](handleEntityNotFound(_0x30da18,null))[_0x50ce('0x23')](saveUpdates(_0x52658e[_0x50ce('0x45')],null))['then'](respondWithResult(_0x30da18,null))['catch'](handleError(_0x30da18,null));}; \ No newline at end of file +var _0x6fee=['includeAll','include','findAll','params','fields','catch','create','describe','update','body','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','apply','reject','save','then','destroy','status','error','stack','name','send','index','map','rawAttributes','model','keys','intersection','query','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','type','VIRTUAL','merge','options','CmHopperHistory'];(function(_0xf34895,_0x21fb70){var _0x143f44=function(_0x2e7730){while(--_0x2e7730){_0xf34895['push'](_0xf34895['shift']());}};_0x143f44(++_0x21fb70);}(_0x6fee,0x1cd));var _0xe6fe=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6fee[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xe6fe('0x0'));var rimraf=require(_0xe6fe('0x1'));var zipdir=require(_0xe6fe('0x2'));var jsonpatch=require(_0xe6fe('0x3'));var rp=require(_0xe6fe('0x4'));var moment=require('moment');var BPromise=require(_0xe6fe('0x5'));var Mustache=require(_0xe6fe('0x6'));var util=require(_0xe6fe('0x7'));var path=require('path');var sox=require(_0xe6fe('0x8'));var csv=require(_0xe6fe('0x9'));var ejs=require(_0xe6fe('0xa'));var fs=require('fs');var fs_extra=require(_0xe6fe('0xb'));var _=require(_0xe6fe('0xc'));var squel=require(_0xe6fe('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe6fe('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe6fe('0xf'));var Redis=require(_0xe6fe('0x10'));var authService=require(_0xe6fe('0x11'));var qs=require(_0xe6fe('0x12'));var as=require(_0xe6fe('0x13'));var hardwareService=require(_0xe6fe('0x14'));var logger=require(_0xe6fe('0x15'))(_0xe6fe('0x16'));var utils=require(_0xe6fe('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe6fe('0x18'))['db'];function respondWithStatusCode(_0x839144,_0x267765){_0x267765=_0x267765||0xcc;return function(_0x3509ef){if(_0x3509ef){return _0x839144[_0xe6fe('0x19')](_0x267765);}return _0x839144['status'](_0x267765)[_0xe6fe('0x1a')]();};}function respondWithResult(_0x3e7d1a,_0xfa4098){_0xfa4098=_0xfa4098||0xc8;return function(_0x5e232b){if(_0x5e232b){return _0x3e7d1a['status'](_0xfa4098)[_0xe6fe('0x1b')](_0x5e232b);}};}function respondWithFilteredResult(_0xb4965e,_0x1c3676){return function(_0x210316){if(_0x210316){var _0x18dd88=typeof _0x1c3676[_0xe6fe('0x1c')]==='undefined'&&typeof _0x1c3676['limit']===_0xe6fe('0x1d');var _0x50476e=_0x210316[_0xe6fe('0x1e')];var _0xb185e0=_0x18dd88?0x0:_0x1c3676['offset'];var _0xe1da01=_0x18dd88?_0x210316[_0xe6fe('0x1e')]:_0x1c3676[_0xe6fe('0x1c')]+_0x1c3676[_0xe6fe('0x1f')];var _0x2511f7;if(_0xe1da01>=_0x50476e){_0xe1da01=_0x50476e;_0x2511f7=0xc8;}else{_0x2511f7=0xce;}_0xb4965e['status'](_0x2511f7);return _0xb4965e['set']('Content-Range',_0xb185e0+'-'+_0xe1da01+'/'+_0x50476e)[_0xe6fe('0x1b')](_0x210316);}return null;};}function patchUpdates(_0x1578ad){return function(_0x2b7f81){try{jsonpatch[_0xe6fe('0x20')](_0x2b7f81,_0x1578ad,!![]);}catch(_0x3eb83c){return BPromise[_0xe6fe('0x21')](_0x3eb83c);}return _0x2b7f81[_0xe6fe('0x22')]();};}function saveUpdates(_0x2dfcfb,_0x5b87bc){return function(_0x251211){if(_0x251211){return _0x251211['update'](_0x2dfcfb)[_0xe6fe('0x23')](function(_0x5b751f){return _0x5b751f;});}return null;};}function removeEntity(_0x2602ee,_0x3d0992){return function(_0x34fca8){if(_0x34fca8){return _0x34fca8[_0xe6fe('0x24')]()['then'](function(){_0x2602ee[_0xe6fe('0x25')](0xcc)[_0xe6fe('0x1a')]();});}};}function handleEntityNotFound(_0x46ea8d,_0x5e0fab){return function(_0x5d9ba0){if(!_0x5d9ba0){_0x46ea8d[_0xe6fe('0x19')](0x194);}return _0x5d9ba0;};}function handleError(_0x5b86a6,_0x3eea8d){_0x3eea8d=_0x3eea8d||0x1f4;return function(_0x50ef8b){logger[_0xe6fe('0x26')](_0x50ef8b[_0xe6fe('0x27')]);if(_0x50ef8b[_0xe6fe('0x28')]){delete _0x50ef8b[_0xe6fe('0x28')];}_0x5b86a6[_0xe6fe('0x25')](_0x3eea8d)[_0xe6fe('0x29')](_0x50ef8b);};}exports[_0xe6fe('0x2a')]=function(_0x5a4427,_0x5eaa6e){var _0x407229={},_0x296e0c={},_0x307292={'count':0x0,'rows':[]};var _0x578244=_[_0xe6fe('0x2b')](db['CmHopperHistory'][_0xe6fe('0x2c')],function(_0x20672b){return{'name':_0x20672b['fieldName'],'type':_0x20672b['type']['key']};});_0x296e0c[_0xe6fe('0x2d')]=_['map'](_0x578244,_0xe6fe('0x28'));_0x296e0c['query']=_[_0xe6fe('0x2e')](_0x5a4427['query']);_0x296e0c['filters']=_[_0xe6fe('0x2f')](_0x296e0c[_0xe6fe('0x2d')],_0x296e0c[_0xe6fe('0x30')]);_0x407229[_0xe6fe('0x31')]=_[_0xe6fe('0x2f')](_0x296e0c[_0xe6fe('0x2d')],qs['fields'](_0x5a4427['query']['fields']));_0x407229[_0xe6fe('0x31')]=_0x407229['attributes'][_0xe6fe('0x32')]?_0x407229[_0xe6fe('0x31')]:_0x296e0c[_0xe6fe('0x2d')];if(!_0x5a4427[_0xe6fe('0x30')][_0xe6fe('0x33')](_0xe6fe('0x34'))){_0x407229[_0xe6fe('0x1f')]=qs[_0xe6fe('0x1f')](_0x5a4427[_0xe6fe('0x30')][_0xe6fe('0x1f')]);_0x407229[_0xe6fe('0x1c')]=qs[_0xe6fe('0x1c')](_0x5a4427[_0xe6fe('0x30')][_0xe6fe('0x1c')]);}_0x407229[_0xe6fe('0x35')]=qs[_0xe6fe('0x36')](_0x5a4427[_0xe6fe('0x30')][_0xe6fe('0x36')]);_0x407229[_0xe6fe('0x37')]=qs['filters'](_[_0xe6fe('0x38')](_0x5a4427[_0xe6fe('0x30')],_0x296e0c[_0xe6fe('0x39')]),_0x578244);if(_0x5a4427[_0xe6fe('0x30')][_0xe6fe('0x3a')]){_0x407229[_0xe6fe('0x37')]=_['merge'](_0x407229[_0xe6fe('0x37')],{'$or':_[_0xe6fe('0x2b')](_0x578244,function(_0x2416d2){if(_0x2416d2[_0xe6fe('0x3b')]!==_0xe6fe('0x3c')){var _0x9ddd84={};_0x9ddd84[_0x2416d2[_0xe6fe('0x28')]]={'$like':'%'+_0x5a4427[_0xe6fe('0x30')][_0xe6fe('0x3a')]+'%'};return _0x9ddd84;}})});}_0x407229=_[_0xe6fe('0x3d')]({},_0x407229,_0x5a4427[_0xe6fe('0x3e')]);var _0x4865cd={'where':_0x407229[_0xe6fe('0x37')]};return db[_0xe6fe('0x3f')][_0xe6fe('0x1e')](_0x4865cd)[_0xe6fe('0x23')](function(_0x438a70){_0x307292['count']=_0x438a70;if(_0x5a4427['query'][_0xe6fe('0x40')]){_0x407229[_0xe6fe('0x41')]=[{'all':!![]}];}return db['CmHopperHistory'][_0xe6fe('0x42')](_0x407229);})[_0xe6fe('0x23')](function(_0xa5a691){_0x307292['rows']=_0xa5a691;return _0x307292;})[_0xe6fe('0x23')](respondWithFilteredResult(_0x5eaa6e,_0x407229))['catch'](handleError(_0x5eaa6e,null));};exports['show']=function(_0x33532c,_0x5f072a){var _0x4601d0={'raw':!![],'where':{'id':_0x33532c[_0xe6fe('0x43')]['id']}},_0x40bc38={};_0x40bc38[_0xe6fe('0x2d')]=_['keys'](db[_0xe6fe('0x3f')][_0xe6fe('0x2c')]);_0x40bc38['query']=_[_0xe6fe('0x2e')](_0x33532c[_0xe6fe('0x30')]);_0x40bc38[_0xe6fe('0x39')]=_[_0xe6fe('0x2f')](_0x40bc38[_0xe6fe('0x2d')],_0x40bc38[_0xe6fe('0x30')]);_0x4601d0['attributes']=_[_0xe6fe('0x2f')](_0x40bc38[_0xe6fe('0x2d')],qs[_0xe6fe('0x44')](_0x33532c[_0xe6fe('0x30')][_0xe6fe('0x44')]));_0x4601d0[_0xe6fe('0x31')]=_0x4601d0[_0xe6fe('0x31')][_0xe6fe('0x32')]?_0x4601d0[_0xe6fe('0x31')]:_0x40bc38[_0xe6fe('0x2d')];if(_0x33532c[_0xe6fe('0x30')]['includeAll']){_0x4601d0['include']=[{'all':!![]}];}_0x4601d0=_[_0xe6fe('0x3d')]({},_0x4601d0,_0x33532c[_0xe6fe('0x3e')]);return db[_0xe6fe('0x3f')]['find'](_0x4601d0)[_0xe6fe('0x23')](handleEntityNotFound(_0x5f072a,null))[_0xe6fe('0x23')](respondWithResult(_0x5f072a,null))[_0xe6fe('0x45')](handleError(_0x5f072a,null));};exports[_0xe6fe('0x46')]=function(_0x305f05,_0x28fd9c){return db[_0xe6fe('0x3f')]['create'](_0x305f05['body'],{})[_0xe6fe('0x23')](respondWithResult(_0x28fd9c,0xc9))['catch'](handleError(_0x28fd9c,null));};exports[_0xe6fe('0x47')]=function(_0x158714,_0x2ef014){return db[_0xe6fe('0x3f')][_0xe6fe('0x47')]()['then'](respondWithResult(_0x2ef014,null))[_0xe6fe('0x45')](handleError(_0x2ef014,null));};exports[_0xe6fe('0x48')]=function(_0x388f73,_0x348a9b){if(_0x388f73[_0xe6fe('0x49')][_0xe6fe('0x4a')]){delete _0x388f73[_0xe6fe('0x49')]['uniqueid'];}return db[_0xe6fe('0x3f')]['find']({'where':{'uniqueid':_0x388f73['params']['id']}})['then'](handleEntityNotFound(_0x348a9b,null))['then'](saveUpdates(_0x388f73[_0xe6fe('0x49')],null))['then'](respondWithResult(_0x348a9b,null))[_0xe6fe('0x45')](handleError(_0x348a9b,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 68f6a57..ccc34af 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 _0xed5c=['request-promise','path','rimraf','../../config/environment','exports','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xed5c,0x81));var _0xced5=function(_0x3f6512,_0x154da6){_0x3f6512=_0x3f6512-0x0;var _0x312dc8=_0xed5c[_0x3f6512];return _0x312dc8;};'use strict';var _=require(_0xced5('0x0'));var util=require(_0xced5('0x1'));var logger=require(_0xced5('0x2'))(_0xced5('0x3'));var moment=require(_0xced5('0x4'));var BPromise=require(_0xced5('0x5'));var rp=require(_0xced5('0x6'));var fs=require('fs');var path=require(_0xced5('0x7'));var rimraf=require(_0xced5('0x8'));var config=require(_0xced5('0x9'));var attributes=require('./cmHopperHistory.attributes');module[_0xced5('0xa')]=function(_0x20ff58,_0x4b7807){return _0x20ff58['define'](_0xced5('0xb'),attributes,{'tableName':_0xced5('0xc'),'paranoid':![],'indexes':[{'name':_0xced5('0xd'),'fields':[_0xced5('0xd')]},{'name':_0xced5('0xe'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x2bab=['../../config/logger','api','bluebird','request-promise','path','../../config/environment','./cmHopperHistory.attributes','define','cm_hopper_history','uniqueid','lodash','util'];(function(_0x3f3998,_0x26cbb7){var _0x40e0c1=function(_0x2def78){while(--_0x2def78){_0x3f3998['push'](_0x3f3998['shift']());}};_0x40e0c1(++_0x26cbb7);}(_0x2bab,0x1ba));var _0xb2ba=function(_0x2ffc16,_0x63d75f){_0x2ffc16=_0x2ffc16-0x0;var _0x5622ae=_0x2bab[_0x2ffc16];return _0x5622ae;};'use strict';var _=require(_0xb2ba('0x0'));var util=require(_0xb2ba('0x1'));var logger=require(_0xb2ba('0x2'))(_0xb2ba('0x3'));var moment=require('moment');var BPromise=require(_0xb2ba('0x4'));var rp=require(_0xb2ba('0x5'));var fs=require('fs');var path=require(_0xb2ba('0x6'));var rimraf=require('rimraf');var config=require(_0xb2ba('0x7'));var attributes=require(_0xb2ba('0x8'));module['exports']=function(_0x5ea667,_0x5ab92f){return _0x5ea667[_0xb2ba('0x9')]('CmHopperHistory',attributes,{'tableName':_0xb2ba('0xa'),'paranoid':![],'indexes':[{'name':'endtime','fields':['endtime']},{'name':_0xb2ba('0xb'),'fields':[_0xb2ba('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index f19a865..53cf5d3 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 _0x6b61=['outboundRejectCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','name','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','info','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','message','CmHopperHistory,\x20%s,\x20%s','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','AvgHandleTime','findAll','where','sequelize','COUNT','col','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','AVG','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','then','GetVoiceQueueHopperHistory','campaign','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null'];(function(_0x5f15c3,_0x5657e1){var _0x48405e=function(_0x1052c4){while(--_0x1052c4){_0x5f15c3['push'](_0x5f15c3['shift']());}};_0x48405e(++_0x5657e1);}(_0x6b61,0x16a));var _0x16b6=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x6b61[_0x56482c];return _0x5aae7a;};'use strict';var _=require(_0x16b6('0x0'));var util=require('util');var moment=require(_0x16b6('0x1'));var BPromise=require(_0x16b6('0x2'));var rs=require(_0x16b6('0x3'));var fs=require('fs');var Redis=require(_0x16b6('0x4'));var db=require(_0x16b6('0x5'))['db'];var utils=require(_0x16b6('0x6'));var logger=require(_0x16b6('0x7'))(_0x16b6('0x8'));var config=require('../../config/environment');var jayson=require(_0x16b6('0x9'));var client=jayson[_0x16b6('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3d06d6,_0x268d89,_0x59552d){return new BPromise(function(_0x460269,_0x3cd025){return client['request'](_0x3d06d6,_0x59552d)['then'](function(_0x5713bc){logger[_0x16b6('0xb')]('CmHopperHistory,\x20%s,\x20%s',_0x268d89,_0x16b6('0xc'));logger[_0x16b6('0xd')](_0x16b6('0xe'),_0x268d89,_0x16b6('0xc'),JSON[_0x16b6('0xf')](_0x5713bc));if(_0x5713bc[_0x16b6('0x10')]){if(_0x5713bc[_0x16b6('0x10')]['code']===0x1f4){logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x268d89,_0x5713bc[_0x16b6('0x10')][_0x16b6('0x11')]);return _0x3cd025(_0x5713bc[_0x16b6('0x10')][_0x16b6('0x11')]);}logger[_0x16b6('0x10')](_0x16b6('0x12'),_0x268d89,_0x5713bc[_0x16b6('0x10')]['message']);return _0x460269(_0x5713bc[_0x16b6('0x10')]['message']);}else{logger['info']('CmHopperHistory,\x20%s,\x20%s',_0x268d89,'request\x20sent');_0x460269(_0x5713bc['result']['message']);}})[_0x16b6('0x13')](function(_0x537eba){logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x268d89,_0x537eba);_0x3cd025(_0x537eba);});});}exports[_0x16b6('0x14')]=function(_0x2d6cb9){var _0x26e4fb=this;return new Promise(function(_0xdc0fa9,_0x27836a){return db[_0x16b6('0x15')][_0x16b6('0x16')](_0x2d6cb9[_0x16b6('0x17')],{'raw':_0x2d6cb9[_0x16b6('0x18')]?_0x2d6cb9['options'][_0x16b6('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x5307d1){logger['info']('CreateCmHopperHistory',_0x2d6cb9);logger[_0x16b6('0xd')](_0x16b6('0x14'),_0x2d6cb9,JSON[_0x16b6('0xf')](_0x5307d1));_0xdc0fa9(_0x5307d1);})[_0x16b6('0x13')](function(_0x22d2f7){logger[_0x16b6('0x10')](_0x16b6('0x14'),_0x22d2f7[_0x16b6('0x11')],_0x2d6cb9);_0x27836a(_0x26e4fb['error'](0x1f4,_0x22d2f7[_0x16b6('0x11')]));});});};exports[_0x16b6('0x1a')]=function(_0x47fcf0){var _0x182bcc=this;return new Promise(function(_0x3b19d9,_0x59a461){return db[_0x16b6('0x15')][_0x16b6('0x1b')]({'raw':_0x47fcf0['options']?_0x47fcf0[_0x16b6('0x18')][_0x16b6('0x19')]===undefined?!![]:![]:!![],'where':_0x47fcf0['options']?_0x47fcf0[_0x16b6('0x18')][_0x16b6('0x1c')]||null:null,'attributes':[[db[_0x16b6('0x1d')]['fn'](_0x16b6('0x1e'),db['sequelize'][_0x16b6('0x1f')]('id')),'predictiveIntervalTotalCalls'],[db[_0x16b6('0x1d')]['fn']('COUNT',db[_0x16b6('0x1d')]['fn']('IF',db['sequelize'][_0x16b6('0x20')](_0x16b6('0x21')))),_0x16b6('0x22')],[db[_0x16b6('0x1d')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x16b6('0x1d')][_0x16b6('0x20')](_0x16b6('0x23')))),_0x16b6('0x24')],[db[_0x16b6('0x1d')]['fn'](_0x16b6('0x1e'),db[_0x16b6('0x1d')]['fn']('IF',db[_0x16b6('0x1d')][_0x16b6('0x20')]('`state`\x20=\x2011,\x201,\x20null'))),_0x16b6('0x25')],[db[_0x16b6('0x1d')]['fn'](_0x16b6('0x26'),db[_0x16b6('0x1d')]['fn']('IF',db[_0x16b6('0x1d')][_0x16b6('0x20')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0x16b6('0x27')],[db[_0x16b6('0x1d')]['fn']('AVG',db[_0x16b6('0x1d')]['fn']('IF',db['sequelize'][_0x16b6('0x20')](_0x16b6('0x28')))),_0x16b6('0x29')]]})[_0x16b6('0x2a')](function(_0x197a5b){logger[_0x16b6('0xb')](_0x16b6('0x1a'),_0x47fcf0);logger[_0x16b6('0xd')](_0x16b6('0x1a'),_0x47fcf0,JSON[_0x16b6('0xf')](_0x197a5b));_0x3b19d9(_0x197a5b);})[_0x16b6('0x13')](function(_0xcbf35f){logger[_0x16b6('0x10')](_0x16b6('0x1a'),_0xcbf35f[_0x16b6('0x11')],_0x47fcf0);_0x59a461(_0x182bcc[_0x16b6('0x10')](0x1f4,_0xcbf35f[_0x16b6('0x11')]));});});};exports[_0x16b6('0x2b')]=function(_0x5a8be3){var _0x540d28=this;return new Promise(function(_0x71e904,_0x14c640){return db[_0x16b6('0x15')][_0x16b6('0x1b')]({'raw':_0x5a8be3['options']?_0x5a8be3[_0x16b6('0x18')][_0x16b6('0x19')]===undefined?!![]:![]:!![],'where':_0x5a8be3['options']?_0x5a8be3[_0x16b6('0x18')][_0x16b6('0x1c')]||null:null,'attributes':[[_0x16b6('0x2c'),'name'],[db[_0x16b6('0x1d')]['fn']('COUNT',db[_0x16b6('0x1d')]['fn']('IF',db['sequelize'][_0x16b6('0x20')](_0x16b6('0x2d')))),_0x16b6('0x2e')],[db[_0x16b6('0x1d')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x16b6('0x1d')][_0x16b6('0x20')]('`state`\x20=\x203,\x201,\x20null'))),_0x16b6('0x2f')],[db['sequelize']['fn'](_0x16b6('0x1e'),db['sequelize']['fn']('IF',db['sequelize'][_0x16b6('0x20')]('`state`\x20=\x204,\x201,\x20null'))),_0x16b6('0x30')],[db[_0x16b6('0x1d')]['fn'](_0x16b6('0x1e'),db[_0x16b6('0x1d')]['fn']('IF',db[_0x16b6('0x1d')][_0x16b6('0x20')](_0x16b6('0x31')))),_0x16b6('0x32')],[db[_0x16b6('0x1d')]['fn'](_0x16b6('0x1e'),db[_0x16b6('0x1d')]['fn']('IF',db[_0x16b6('0x1d')][_0x16b6('0x20')](_0x16b6('0x33')))),_0x16b6('0x34')],[db[_0x16b6('0x1d')]['fn'](_0x16b6('0x1e'),db[_0x16b6('0x1d')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x16b6('0x35')],[db['sequelize']['fn']('COUNT',db[_0x16b6('0x1d')]['fn']('IF',db[_0x16b6('0x1d')]['literal'](_0x16b6('0x36')))),_0x16b6('0x37')],[db['sequelize']['fn'](_0x16b6('0x1e'),db[_0x16b6('0x1d')]['fn']('IF',db[_0x16b6('0x1d')]['literal'](_0x16b6('0x38')))),_0x16b6('0x39')],[db[_0x16b6('0x1d')]['fn']('COUNT',db[_0x16b6('0x1d')]['fn']('IF',db['sequelize'][_0x16b6('0x20')](_0x16b6('0x3a')))),_0x16b6('0x3b')],[db[_0x16b6('0x1d')]['fn'](_0x16b6('0x1e'),db['sequelize']['fn']('IF',db[_0x16b6('0x1d')][_0x16b6('0x20')](_0x16b6('0x3c')))),'outboundOriginateFailureCallsDay'],[db[_0x16b6('0x1d')]['fn'](_0x16b6('0x1e'),db['sequelize']['fn']('IF',db[_0x16b6('0x1d')][_0x16b6('0x20')]('`state`\x20=\x2018,\x201,\x20null'))),'outboundRejectCallsDay'],[db[_0x16b6('0x1d')]['fn'](_0x16b6('0x1e'),db[_0x16b6('0x1d')]['fn']('IF',db[_0x16b6('0x1d')][_0x16b6('0x20')](_0x16b6('0x3d')))),_0x16b6('0x3e')],[db['sequelize']['fn'](_0x16b6('0x1e'),db[_0x16b6('0x1d')]['fn']('IF',db['sequelize'][_0x16b6('0x20')](_0x16b6('0x3f')))),_0x16b6('0x40')],[db[_0x16b6('0x1d')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x16b6('0x1d')][_0x16b6('0x20')](_0x16b6('0x41')))),_0x16b6('0x42')]],'group':[_0x16b6('0x2c')]})[_0x16b6('0x2a')](function(_0x10f1d8){logger[_0x16b6('0xb')](_0x16b6('0x2b'),_0x5a8be3);logger['debug'](_0x16b6('0x2b'),_0x5a8be3,JSON[_0x16b6('0xf')](_0x10f1d8));_0x71e904(_0x10f1d8);})[_0x16b6('0x13')](function(_0x126f23){logger[_0x16b6('0x10')]('GetVoiceQueueHopperHistory',_0x126f23[_0x16b6('0x11')],_0x5a8be3);_0x14c640(_0x540d28['error'](0x1f4,_0x126f23[_0x16b6('0x11')]));});});};exports[_0x16b6('0x43')]=function(_0x11ee47){var _0x404501=this;return new Promise(function(_0x43894e,_0x5c49bc){return db[_0x16b6('0x15')][_0x16b6('0x1b')]({'raw':_0x11ee47[_0x16b6('0x18')]?_0x11ee47[_0x16b6('0x18')][_0x16b6('0x19')]===undefined?!![]:![]:!![],'where':_0x11ee47[_0x16b6('0x18')]?_0x11ee47[_0x16b6('0x18')][_0x16b6('0x1c')]||null:null,'attributes':[[_0x16b6('0x2c'),_0x16b6('0x44')],[db[_0x16b6('0x1d')]['fn'](_0x16b6('0x1e'),db[_0x16b6('0x1d')][_0x16b6('0x1f')]('id')),_0x16b6('0x45')],[db[_0x16b6('0x1d')]['fn'](_0x16b6('0x1e'),db[_0x16b6('0x1d')]['fn']('IF',db[_0x16b6('0x1d')]['literal'](_0x16b6('0x21')))),_0x16b6('0x46')]],'group':['campaign']})[_0x16b6('0x2a')](function(_0x2b2af7){logger['info'](_0x16b6('0x43'),_0x11ee47);logger[_0x16b6('0xd')](_0x16b6('0x43'),_0x11ee47,JSON[_0x16b6('0xf')](_0x2b2af7));_0x43894e(_0x2b2af7);})['catch'](function(_0x4c70d4){logger[_0x16b6('0x10')](_0x16b6('0x43'),_0x4c70d4[_0x16b6('0x11')],_0x11ee47);_0x5c49bc(_0x404501[_0x16b6('0x10')](0x1f4,_0x4c70d4[_0x16b6('0x11')]));});});}; \ No newline at end of file +var _0xe739=['options','raw','AvgHandleTime','findAll','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','debug','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','stringify','ivrTotalCallsDays','ivrAnswerCallsDay','GetCampaignHopperHistory','lodash','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','error','code','CmHopperHistory,\x20%s,\x20%s','message','result','catch','CreateCmHopperHistory','CmHopperHistory','create','body'];(function(_0x3aca9e,_0x344bef){var _0x22a6a8=function(_0x55cf1e){while(--_0x55cf1e){_0x3aca9e['push'](_0x3aca9e['shift']());}};_0x22a6a8(++_0x344bef);}(_0xe739,0x105));var _0x9e73=function(_0x4cb45a,_0x173d76){_0x4cb45a=_0x4cb45a-0x0;var _0xc3d2d4=_0xe739[_0x4cb45a];return _0xc3d2d4;};'use strict';var _=require(_0x9e73('0x0'));var util=require('util');var moment=require(_0x9e73('0x1'));var BPromise=require(_0x9e73('0x2'));var rs=require(_0x9e73('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9e73('0x4'))(_0x9e73('0x5'));var config=require(_0x9e73('0x6'));var jayson=require(_0x9e73('0x7'));var client=jayson['client'][_0x9e73('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x26cb5b,_0xb37872,_0x5e46e7){return new BPromise(function(_0xa49f86,_0x1ee042){return client[_0x9e73('0x9')](_0x26cb5b,_0x5e46e7)[_0x9e73('0xa')](function(_0x14de8a){logger[_0x9e73('0xb')]('CmHopperHistory,\x20%s,\x20%s',_0xb37872,_0x9e73('0xc'));logger['debug']('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0xb37872,_0x9e73('0xc'),JSON['stringify'](_0x14de8a));if(_0x14de8a[_0x9e73('0xd')]){if(_0x14de8a[_0x9e73('0xd')][_0x9e73('0xe')]===0x1f4){logger['error'](_0x9e73('0xf'),_0xb37872,_0x14de8a[_0x9e73('0xd')][_0x9e73('0x10')]);return _0x1ee042(_0x14de8a[_0x9e73('0xd')]['message']);}logger[_0x9e73('0xd')](_0x9e73('0xf'),_0xb37872,_0x14de8a[_0x9e73('0xd')]['message']);return _0xa49f86(_0x14de8a[_0x9e73('0xd')][_0x9e73('0x10')]);}else{logger['info'](_0x9e73('0xf'),_0xb37872,_0x9e73('0xc'));_0xa49f86(_0x14de8a[_0x9e73('0x11')]['message']);}})[_0x9e73('0x12')](function(_0x51968a){logger[_0x9e73('0xd')]('CmHopperHistory,\x20%s,\x20%s',_0xb37872,_0x51968a);_0x1ee042(_0x51968a);});});}exports[_0x9e73('0x13')]=function(_0x48b1db){var _0x4dabb2=this;return new Promise(function(_0x419c5b,_0x3944fc){return db[_0x9e73('0x14')][_0x9e73('0x15')](_0x48b1db[_0x9e73('0x16')],{'raw':_0x48b1db[_0x9e73('0x17')]?_0x48b1db[_0x9e73('0x17')][_0x9e73('0x18')]===undefined?!![]:![]:!![]})[_0x9e73('0xa')](function(_0x3f56bf){logger['info'](_0x9e73('0x13'),_0x48b1db);logger['debug'](_0x9e73('0x13'),_0x48b1db,JSON['stringify'](_0x3f56bf));_0x419c5b(_0x3f56bf);})[_0x9e73('0x12')](function(_0x589a5d){logger[_0x9e73('0xd')](_0x9e73('0x13'),_0x589a5d['message'],_0x48b1db);_0x3944fc(_0x4dabb2['error'](0x1f4,_0x589a5d[_0x9e73('0x10')]));});});};exports[_0x9e73('0x19')]=function(_0x256ea1){var _0x257dca=this;return new Promise(function(_0x1214b5,_0x5117af){return db[_0x9e73('0x14')][_0x9e73('0x1a')]({'raw':_0x256ea1['options']?_0x256ea1['options'][_0x9e73('0x18')]===undefined?!![]:![]:!![],'where':_0x256ea1['options']?_0x256ea1['options'][_0x9e73('0x1b')]||null:null,'attributes':[[db[_0x9e73('0x1c')]['fn'](_0x9e73('0x1d'),db['sequelize'][_0x9e73('0x1e')]('id')),_0x9e73('0x1f')],[db['sequelize']['fn'](_0x9e73('0x1d'),db[_0x9e73('0x1c')]['fn']('IF',db[_0x9e73('0x1c')][_0x9e73('0x20')](_0x9e73('0x21')))),'predictiveIntervalAnsweredCalls'],[db[_0x9e73('0x1c')]['fn']('COUNT',db[_0x9e73('0x1c')]['fn']('IF',db[_0x9e73('0x1c')][_0x9e73('0x20')](_0x9e73('0x22')))),_0x9e73('0x23')],[db['sequelize']['fn'](_0x9e73('0x1d'),db[_0x9e73('0x1c')]['fn']('IF',db['sequelize']['literal'](_0x9e73('0x24')))),_0x9e73('0x25')],[db[_0x9e73('0x1c')]['fn'](_0x9e73('0x26'),db[_0x9e73('0x1c')]['fn']('IF',db[_0x9e73('0x1c')]['literal'](_0x9e73('0x27')))),_0x9e73('0x28')],[db[_0x9e73('0x1c')]['fn'](_0x9e73('0x26'),db[_0x9e73('0x1c')]['fn']('IF',db[_0x9e73('0x1c')][_0x9e73('0x20')](_0x9e73('0x29')))),_0x9e73('0x2a')]]})[_0x9e73('0xa')](function(_0x4cf402){logger[_0x9e73('0xb')](_0x9e73('0x19'),_0x256ea1);logger[_0x9e73('0x2b')](_0x9e73('0x19'),_0x256ea1,JSON['stringify'](_0x4cf402));_0x1214b5(_0x4cf402);})[_0x9e73('0x12')](function(_0x3186b0){logger['error']('AvgHandleTime',_0x3186b0[_0x9e73('0x10')],_0x256ea1);_0x5117af(_0x257dca[_0x9e73('0xd')](0x1f4,_0x3186b0[_0x9e73('0x10')]));});});};exports[_0x9e73('0x2c')]=function(_0x14fb70){var _0x430846=this;return new Promise(function(_0x5e6ffe,_0x574a8b){return db['CmHopperHistory'][_0x9e73('0x1a')]({'raw':_0x14fb70[_0x9e73('0x17')]?_0x14fb70[_0x9e73('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x14fb70['options']?_0x14fb70['options'][_0x9e73('0x1b')]||null:null,'attributes':[[_0x9e73('0x2d'),_0x9e73('0x2e')],[db[_0x9e73('0x1c')]['fn']('COUNT',db[_0x9e73('0x1c')]['fn']('IF',db[_0x9e73('0x1c')][_0x9e73('0x20')](_0x9e73('0x2f')))),_0x9e73('0x30')],[db[_0x9e73('0x1c')]['fn'](_0x9e73('0x1d'),db[_0x9e73('0x1c')]['fn']('IF',db[_0x9e73('0x1c')][_0x9e73('0x20')]('`state`\x20=\x203,\x201,\x20null'))),'outboundNoAnswerCallsDay'],[db['sequelize']['fn']('COUNT',db[_0x9e73('0x1c')]['fn']('IF',db[_0x9e73('0x1c')]['literal'](_0x9e73('0x21')))),_0x9e73('0x31')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x9e73('0x32')))),_0x9e73('0x33')],[db[_0x9e73('0x1c')]['fn'](_0x9e73('0x1d'),db['sequelize']['fn']('IF',db['sequelize'][_0x9e73('0x20')](_0x9e73('0x34')))),_0x9e73('0x35')],[db[_0x9e73('0x1c')]['fn'](_0x9e73('0x1d'),db[_0x9e73('0x1c')]['fn']('IF',db['sequelize'][_0x9e73('0x20')](_0x9e73('0x36')))),'outboundDropCallsDayTimeout'],[db[_0x9e73('0x1c')]['fn'](_0x9e73('0x1d'),db['sequelize']['fn']('IF',db[_0x9e73('0x1c')][_0x9e73('0x20')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x9e73('0x37')],[db[_0x9e73('0x1c')]['fn'](_0x9e73('0x1d'),db[_0x9e73('0x1c')]['fn']('IF',db[_0x9e73('0x1c')][_0x9e73('0x20')](_0x9e73('0x38')))),_0x9e73('0x39')],[db[_0x9e73('0x1c')]['fn'](_0x9e73('0x1d'),db[_0x9e73('0x1c')]['fn']('IF',db[_0x9e73('0x1c')][_0x9e73('0x20')](_0x9e73('0x3a')))),_0x9e73('0x3b')],[db[_0x9e73('0x1c')]['fn']('COUNT',db[_0x9e73('0x1c')]['fn']('IF',db['sequelize']['literal'](_0x9e73('0x3c')))),_0x9e73('0x3d')],[db['sequelize']['fn']('COUNT',db[_0x9e73('0x1c')]['fn']('IF',db[_0x9e73('0x1c')][_0x9e73('0x20')](_0x9e73('0x3e')))),_0x9e73('0x3f')],[db[_0x9e73('0x1c')]['fn'](_0x9e73('0x1d'),db[_0x9e73('0x1c')]['fn']('IF',db[_0x9e73('0x1c')][_0x9e73('0x20')](_0x9e73('0x40')))),_0x9e73('0x41')],[db[_0x9e73('0x1c')]['fn'](_0x9e73('0x1d'),db['sequelize']['fn']('IF',db[_0x9e73('0x1c')][_0x9e73('0x20')](_0x9e73('0x42')))),_0x9e73('0x3f')],[db[_0x9e73('0x1c')]['fn'](_0x9e73('0x1d'),db[_0x9e73('0x1c')]['fn']('IF',db[_0x9e73('0x1c')]['literal']('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),'outboundReCallsDay']],'group':[_0x9e73('0x2d')]})['then'](function(_0x22f69a){logger['info'](_0x9e73('0x2c'),_0x14fb70);logger['debug'](_0x9e73('0x2c'),_0x14fb70,JSON[_0x9e73('0x43')](_0x22f69a));_0x5e6ffe(_0x22f69a);})[_0x9e73('0x12')](function(_0x43c524){logger[_0x9e73('0xd')](_0x9e73('0x2c'),_0x43c524[_0x9e73('0x10')],_0x14fb70);_0x574a8b(_0x430846['error'](0x1f4,_0x43c524[_0x9e73('0x10')]));});});};exports['GetCampaignHopperHistory']=function(_0xe3ee0d){var _0x39aa72=this;return new Promise(function(_0x29b3e1,_0x5d4c99){return db[_0x9e73('0x14')][_0x9e73('0x1a')]({'raw':_0xe3ee0d['options']?_0xe3ee0d[_0x9e73('0x17')][_0x9e73('0x18')]===undefined?!![]:![]:!![],'where':_0xe3ee0d[_0x9e73('0x17')]?_0xe3ee0d[_0x9e73('0x17')][_0x9e73('0x1b')]||null:null,'attributes':[['campaign',_0x9e73('0x2e')],[db[_0x9e73('0x1c')]['fn']('COUNT',db[_0x9e73('0x1c')][_0x9e73('0x1e')]('id')),_0x9e73('0x44')],[db['sequelize']['fn'](_0x9e73('0x1d'),db[_0x9e73('0x1c')]['fn']('IF',db['sequelize'][_0x9e73('0x20')](_0x9e73('0x21')))),_0x9e73('0x45')]],'group':[_0x9e73('0x2d')]})[_0x9e73('0xa')](function(_0x34465a){logger[_0x9e73('0xb')](_0x9e73('0x46'),_0xe3ee0d);logger[_0x9e73('0x2b')](_0x9e73('0x46'),_0xe3ee0d,JSON[_0x9e73('0x43')](_0x34465a));_0x29b3e1(_0x34465a);})[_0x9e73('0x12')](function(_0x4dacf2){logger[_0x9e73('0xd')](_0x9e73('0x46'),_0x4dacf2[_0x9e73('0x10')],_0xe3ee0d);_0x5d4c99(_0x39aa72['error'](0x1f4,_0x4dacf2['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 951eca5..f8b06e8 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 _0xab44=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','post','create','put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x4fdbb0,_0x31b31e){var _0x290710=function(_0xd230b2){while(--_0xd230b2){_0x4fdbb0['push'](_0x4fdbb0['shift']());}};_0x290710(++_0x31b31e);}(_0xab44,0x19c));var _0x4ab4=function(_0x32cbc6,_0x155541){_0x32cbc6=_0x32cbc6-0x0;var _0x1734e4=_0xab44[_0x32cbc6];return _0x1734e4;};'use strict';var multer=require(_0x4ab4('0x0'));var util=require(_0x4ab4('0x1'));var path=require(_0x4ab4('0x2'));var timeout=require(_0x4ab4('0x3'));var express=require(_0x4ab4('0x4'));var router=express[_0x4ab4('0x5')]();var fs_extra=require(_0x4ab4('0x6'));var auth=require(_0x4ab4('0x7'));var interaction=require(_0x4ab4('0x8'));var config=require(_0x4ab4('0x9'));var controller=require('./cmHopperHistory.controller');router[_0x4ab4('0xa')]('/',auth[_0x4ab4('0xb')](),controller[_0x4ab4('0xc')]);router[_0x4ab4('0xa')](_0x4ab4('0xd'),auth[_0x4ab4('0xb')](),controller[_0x4ab4('0xe')]);router[_0x4ab4('0xa')]('/:id',auth[_0x4ab4('0xb')](),controller[_0x4ab4('0xf')]);router[_0x4ab4('0x10')]('/',auth[_0x4ab4('0xb')](),controller[_0x4ab4('0x11')]);router[_0x4ab4('0x12')]('/:id',auth[_0x4ab4('0xb')](),controller[_0x4ab4('0x13')]);module[_0x4ab4('0x14')]=router; \ No newline at end of file +var _0x8d38=['describe','/:id','show','put','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index','/describe'];(function(_0x4c4244,_0x45bda3){var _0x12fb70=function(_0x120156){while(--_0x120156){_0x4c4244['push'](_0x4c4244['shift']());}};_0x12fb70(++_0x45bda3);}(_0x8d38,0x149));var _0x88d3=function(_0x50d745,_0x945641){_0x50d745=_0x50d745-0x0;var _0x2a8119=_0x8d38[_0x50d745];return _0x2a8119;};'use strict';var multer=require(_0x88d3('0x0'));var util=require(_0x88d3('0x1'));var path=require(_0x88d3('0x2'));var timeout=require('connect-timeout');var express=require(_0x88d3('0x3'));var router=express[_0x88d3('0x4')]();var fs_extra=require(_0x88d3('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x88d3('0x6'));var config=require(_0x88d3('0x7'));var controller=require(_0x88d3('0x8'));router[_0x88d3('0x9')]('/',auth[_0x88d3('0xa')](),controller[_0x88d3('0xb')]);router['get'](_0x88d3('0xc'),auth['isAuthenticated'](),controller[_0x88d3('0xd')]);router['get'](_0x88d3('0xe'),auth[_0x88d3('0xa')](),controller[_0x88d3('0xf')]);router['post']('/',auth[_0x88d3('0xa')](),controller['create']);router[_0x88d3('0x10')](_0x88d3('0xe'),auth[_0x88d3('0xa')](),controller['update']);module[_0x88d3('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 458d2eb..384438a 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 _0x32ef=['name','sequelize','exports','STRING'];(function(_0xc930ac,_0x25f008){var _0x2fafae=function(_0x39e532){while(--_0x39e532){_0xc930ac['push'](_0xc930ac['shift']());}};_0x2fafae(++_0x25f008);}(_0x32ef,0xf9));var _0xf32e=function(_0x4a9265,_0x163d15){_0x4a9265=_0x4a9265-0x0;var _0x2a92b3=_0x32ef[_0x4a9265];return _0x2a92b3;};'use strict';var Sequelize=require(_0xf32e('0x0'));module[_0xf32e('0x1')]={'name':{'type':Sequelize[_0xf32e('0x2')],'unique':_0xf32e('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xf32e('0x2')]},'dialPrefix':{'type':Sequelize[_0xf32e('0x2')]}}; \ No newline at end of file +var _0x52b2=['STRING','name','sequelize','exports'];(function(_0xa87e35,_0x56c13b){var _0x10da27=function(_0x68d5e8){while(--_0x68d5e8){_0xa87e35['push'](_0xa87e35['shift']());}};_0x10da27(++_0x56c13b);}(_0x52b2,0x11e));var _0x252b=function(_0x2c3ded,_0x5e9155){_0x2c3ded=_0x2c3ded-0x0;var _0x445aa2=_0x52b2[_0x2c3ded];return _0x445aa2;};'use strict';var Sequelize=require(_0x252b('0x0'));module[_0x252b('0x1')]={'name':{'type':Sequelize[_0x252b('0x2')],'unique':_0x252b('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x252b('0x2')]},'dialPrefix':{'type':Sequelize[_0x252b('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index b13a80a..ea3efaf 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 _0x6530=['./cmList.socket','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','destroy','get','Lists','UserProfileResource','error','name','index','CmList','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','pick','filters','filter','merge','where','options','includeAll','include','findAll','rows','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','ListId','Disposition','getDispositions','findOne','sort','removeDispositions','CmContact','tags','isArray','push','each','omit','ids','success','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','format','cf_%d','raw','getContactsCsv','ContactItemType','OrderBy','select','from','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','c.cf_','alias','field','item','cm_contact_has_items','CmContactId\x20=\x20c.id','additionalPhone_','description','ItemTypeId\x20=\x20?','description_additionalPhone_','toString','now','writeFileSync','setHeader','Content-disposition','attachment;\x20filename=','Content-type','text/csv','addCustomField','transaction','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','sequelize','cm_contacts','getCustomFields','findAndCountAll','getGlobalCustomFields','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','User','info','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter'];(function(_0x158ffd,_0x4ddd42){var _0xa3f69c=function(_0x3d11f7){while(--_0x3d11f7){_0x158ffd['push'](_0x158ffd['shift']());}};_0xa3f69c(++_0x4ddd42);}(_0x6530,0x1c2));var _0x0653=function(_0x180216,_0x4ea427){_0x180216=_0x180216-0x0;var _0x2fc363=_0x6530[_0x180216];return _0x2fc363;};'use strict';var emlformat=require(_0x0653('0x0'));var rimraf=require(_0x0653('0x1'));var zipdir=require(_0x0653('0x2'));var jsonpatch=require(_0x0653('0x3'));var rp=require(_0x0653('0x4'));var moment=require('moment');var BPromise=require(_0x0653('0x5'));var Mustache=require(_0x0653('0x6'));var util=require(_0x0653('0x7'));var path=require(_0x0653('0x8'));var sox=require(_0x0653('0x9'));var csv=require(_0x0653('0xa'));var ejs=require(_0x0653('0xb'));var fs=require('fs');var fs_extra=require(_0x0653('0xc'));var _=require(_0x0653('0xd'));var squel=require(_0x0653('0xe'));var crypto=require('crypto');var jsforce=require(_0x0653('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x0653('0xa'));var querystring=require(_0x0653('0x10'));var Papa=require(_0x0653('0x11'));var Redis=require(_0x0653('0x12'));var authService=require(_0x0653('0x13'));var qs=require(_0x0653('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0653('0x15'));var logger=require(_0x0653('0x16'))(_0x0653('0x17'));var utils=require(_0x0653('0x18'));var config=require(_0x0653('0x19'));var licenseUtil=require(_0x0653('0x1a'));var db=require('../../mysqldb')['db'];var csv_results;config[_0x0653('0x1b')]=_['defaults'](config[_0x0653('0x1b')],{'host':_0x0653('0x1c'),'port':0x18eb});var socket=require(_0x0653('0x1d'))(new Redis(config[_0x0653('0x1b')]));require(_0x0653('0x1e'))['register'](socket);function respondWithStatusCode(_0x2f7ce,_0x3d36f4){_0x3d36f4=_0x3d36f4||0xcc;return function(_0x1767d9){if(_0x1767d9){return _0x2f7ce[_0x0653('0x1f')](_0x3d36f4);}return _0x2f7ce[_0x0653('0x20')](_0x3d36f4)[_0x0653('0x21')]();};}function respondWithResult(_0x15944d,_0x443e12){_0x443e12=_0x443e12||0xc8;return function(_0x196ddd){if(_0x196ddd){return _0x15944d[_0x0653('0x20')](_0x443e12)['json'](_0x196ddd);}};}function respondWithFilteredResult(_0x40b3d7,_0x589d8c){return function(_0x2db1ef){if(_0x2db1ef){var _0x15e73a=typeof _0x589d8c[_0x0653('0x22')]===_0x0653('0x23')&&typeof _0x589d8c[_0x0653('0x24')]===_0x0653('0x23');var _0x581d8b=_0x2db1ef[_0x0653('0x25')];var _0xc020bd=_0x15e73a?0x0:_0x589d8c['offset'];var _0x5d5dec=_0x15e73a?_0x2db1ef['count']:_0x589d8c['offset']+_0x589d8c[_0x0653('0x24')];var _0x4854f2;if(_0x5d5dec>=_0x581d8b){_0x5d5dec=_0x581d8b;_0x4854f2=0xc8;}else{_0x4854f2=0xce;}_0x40b3d7[_0x0653('0x20')](_0x4854f2);return _0x40b3d7[_0x0653('0x26')](_0x0653('0x27'),_0xc020bd+'-'+_0x5d5dec+'/'+_0x581d8b)[_0x0653('0x28')](_0x2db1ef);}return null;};}function patchUpdates(_0x4649af){return function(_0x37f1b9){try{jsonpatch['apply'](_0x37f1b9,_0x4649af,!![]);}catch(_0x19e08c){return BPromise[_0x0653('0x29')](_0x19e08c);}return _0x37f1b9[_0x0653('0x2a')]();};}function saveUpdates(_0x305593,_0x4cbbc4){return function(_0x53055d){if(_0x53055d){return _0x53055d[_0x0653('0x2b')](_0x305593)[_0x0653('0x2c')](function(_0x396f12){return _0x396f12;});}return null;};}function removeEntity(_0x2af0f8,_0x51ada9){return function(_0x1fea29){if(_0x1fea29){return _0x1fea29[_0x0653('0x2d')]()['then'](function(){var _0x200d77=_0x1fea29[_0x0653('0x2e')]({'plain':!![]});var _0x1addda=_0x0653('0x2f');return db[_0x0653('0x30')][_0x0653('0x2d')]({'where':{'type':_0x1addda,'resourceId':_0x200d77['id']}})[_0x0653('0x2c')](function(){return _0x1fea29;});})['then'](function(){_0x2af0f8[_0x0653('0x20')](0xcc)[_0x0653('0x21')]();});}};}function handleEntityNotFound(_0x2f1480,_0x402850){return function(_0x5d0ff4){if(!_0x5d0ff4){_0x2f1480[_0x0653('0x1f')](0x194);}return _0x5d0ff4;};}function handleError(_0x33f739,_0x5b8aa6){_0x5b8aa6=_0x5b8aa6||0x1f4;return function(_0x341396){logger[_0x0653('0x31')](_0x341396['stack']);if(_0x341396[_0x0653('0x32')]){delete _0x341396['name'];}_0x33f739[_0x0653('0x20')](_0x5b8aa6)['send'](_0x341396);};}exports[_0x0653('0x33')]=function(_0x30222e,_0x5928b4){var _0x58cc1b={},_0x3567c8={},_0x35582e={'count':0x0,'rows':[]};var _0x27c9e4=_['map'](db[_0x0653('0x34')][_0x0653('0x35')],function(_0x535e8d){return{'name':_0x535e8d[_0x0653('0x36')],'type':_0x535e8d[_0x0653('0x37')][_0x0653('0x38')]};});_0x3567c8[_0x0653('0x39')]=_[_0x0653('0x3a')](_0x27c9e4,_0x0653('0x32'));_0x3567c8[_0x0653('0x3b')]=_[_0x0653('0x3c')](_0x30222e[_0x0653('0x3b')]);_0x3567c8['filters']=_[_0x0653('0x3d')](_0x3567c8[_0x0653('0x39')],_0x3567c8[_0x0653('0x3b')]);_0x58cc1b[_0x0653('0x3e')]=_[_0x0653('0x3d')](_0x3567c8[_0x0653('0x39')],qs[_0x0653('0x3f')](_0x30222e[_0x0653('0x3b')][_0x0653('0x3f')]));_0x58cc1b['attributes']=_0x58cc1b['attributes'][_0x0653('0x40')]?_0x58cc1b[_0x0653('0x3e')]:_0x3567c8[_0x0653('0x39')];if(!_0x30222e['query'][_0x0653('0x41')](_0x0653('0x42'))){_0x58cc1b[_0x0653('0x24')]=qs[_0x0653('0x24')](_0x30222e[_0x0653('0x3b')]['limit']);_0x58cc1b['offset']=qs['offset'](_0x30222e[_0x0653('0x3b')][_0x0653('0x22')]);}_0x58cc1b[_0x0653('0x43')]=qs['sort'](_0x30222e['query']['sort']);_0x58cc1b['where']=qs['filters'](_[_0x0653('0x44')](_0x30222e['query'],_0x3567c8[_0x0653('0x45')]),_0x27c9e4);if(_0x30222e['query'][_0x0653('0x46')]){_0x58cc1b['where']=_[_0x0653('0x47')](_0x58cc1b[_0x0653('0x48')],{'$or':_['map'](_0x27c9e4,function(_0x1339e8){if(_0x1339e8[_0x0653('0x37')]!=='VIRTUAL'){var _0xfc3272={};_0xfc3272[_0x1339e8[_0x0653('0x32')]]={'$like':'%'+_0x30222e[_0x0653('0x3b')][_0x0653('0x46')]+'%'};return _0xfc3272;}})});}_0x58cc1b=_[_0x0653('0x47')]({},_0x58cc1b,_0x30222e[_0x0653('0x49')]);var _0x74eb26={'where':_0x58cc1b[_0x0653('0x48')]};return db['CmList']['count'](_0x74eb26)[_0x0653('0x2c')](function(_0x61c9a6){_0x35582e['count']=_0x61c9a6;if(_0x30222e['query'][_0x0653('0x4a')]){_0x58cc1b[_0x0653('0x4b')]=[{'all':!![]}];}return db[_0x0653('0x34')][_0x0653('0x4c')](_0x58cc1b);})['then'](function(_0x135427){_0x35582e[_0x0653('0x4d')]=_0x135427;return _0x35582e;})[_0x0653('0x2c')](respondWithFilteredResult(_0x5928b4,_0x58cc1b))[_0x0653('0x4e')](handleError(_0x5928b4,null));};exports[_0x0653('0x4f')]=function(_0x1cc432,_0x1ef8cc){var _0x60c9b9={'raw':![],'where':{'id':_0x1cc432['params']['id']}},_0x327b3f={};_0x327b3f[_0x0653('0x39')]=_[_0x0653('0x3c')](db[_0x0653('0x34')][_0x0653('0x35')]);_0x327b3f[_0x0653('0x3b')]=_[_0x0653('0x3c')](_0x1cc432['query']);_0x327b3f[_0x0653('0x45')]=_[_0x0653('0x3d')](_0x327b3f['model'],_0x327b3f[_0x0653('0x3b')]);_0x60c9b9['attributes']=_['intersection'](_0x327b3f['model'],qs[_0x0653('0x3f')](_0x1cc432[_0x0653('0x3b')]['fields']));_0x60c9b9[_0x0653('0x3e')]=_0x60c9b9[_0x0653('0x3e')]['length']?_0x60c9b9['attributes']:_0x327b3f[_0x0653('0x39')];if(_0x1cc432[_0x0653('0x3b')][_0x0653('0x4a')]){_0x60c9b9['include']=[{'all':!![]}];}_0x60c9b9=_['merge']({},_0x60c9b9,_0x1cc432['options']);return db[_0x0653('0x34')][_0x0653('0x50')](_0x60c9b9)[_0x0653('0x2c')](handleEntityNotFound(_0x1ef8cc,null))[_0x0653('0x2c')](respondWithResult(_0x1ef8cc,null))[_0x0653('0x4e')](handleError(_0x1ef8cc,null));};exports[_0x0653('0x51')]=function(_0x3dbc9a,_0x429668){return db[_0x0653('0x34')][_0x0653('0x51')](_0x3dbc9a[_0x0653('0x52')],{})[_0x0653('0x2c')](function(_0x39dce5){var _0x3262de=_0x3dbc9a[_0x0653('0x53')]['get']({'plain':!![]});if(!_0x3262de)throw new Error(_0x0653('0x54'));if(_0x3262de['role']===_0x0653('0x53')){var _0x51e2f2=_0x39dce5['get']({'plain':!![]});var _0x53d88c=_0x0653('0x2f');return db['UserProfileSection'][_0x0653('0x50')]({'where':{'name':_0x53d88c,'userProfileId':_0x3262de['userProfileId']},'raw':!![]})[_0x0653('0x2c')](function(_0x145e3c){if(_0x145e3c&&_0x145e3c[_0x0653('0x55')]===0x0){return db[_0x0653('0x30')][_0x0653('0x51')]({'name':_0x51e2f2[_0x0653('0x32')],'resourceId':_0x51e2f2['id'],'type':_0x145e3c['name'],'sectionId':_0x145e3c['id']},{})['then'](function(){return _0x39dce5;});}else{return _0x39dce5;}})[_0x0653('0x4e')](function(_0x22757f){logger[_0x0653('0x31')](_0x0653('0x56'),_0x22757f);throw _0x22757f;});}return _0x39dce5;})[_0x0653('0x2c')](respondWithResult(_0x429668,0xc9))[_0x0653('0x4e')](handleError(_0x429668,null));};exports['update']=function(_0x2d9113,_0x451102){if(_0x2d9113['body']['id']){delete _0x2d9113[_0x0653('0x52')]['id'];}return db[_0x0653('0x34')][_0x0653('0x50')]({'where':{'id':_0x2d9113['params']['id']}})[_0x0653('0x2c')](handleEntityNotFound(_0x451102,null))[_0x0653('0x2c')](saveUpdates(_0x2d9113[_0x0653('0x52')],null))[_0x0653('0x2c')](respondWithResult(_0x451102,null))[_0x0653('0x4e')](handleError(_0x451102,null));};exports[_0x0653('0x2d')]=function(_0x5f4823,_0x296e03){return db[_0x0653('0x34')]['find']({'where':{'id':_0x5f4823[_0x0653('0x57')]['id']}})[_0x0653('0x2c')](handleEntityNotFound(_0x296e03,null))[_0x0653('0x2c')](removeEntity(_0x296e03,null))[_0x0653('0x4e')](handleError(_0x296e03,null));};exports[_0x0653('0x58')]=function(_0x3c4617,_0x51906a){return db[_0x0653('0x34')][_0x0653('0x58')]()['then'](respondWithResult(_0x51906a,null))[_0x0653('0x4e')](handleError(_0x51906a,null));};exports[_0x0653('0x59')]=function(_0x1647e8,_0x40e1bf,_0x3798aa){if(_0x1647e8[_0x0653('0x52')]['id']){delete _0x1647e8[_0x0653('0x52')]['id'];}return db['CmList']['find']({'where':{'id':_0x1647e8[_0x0653('0x57')]['id']}})['then'](handleEntityNotFound(_0x40e1bf,null))[_0x0653('0x2c')](function(_0x2eccfc){if(_0x2eccfc){_0x1647e8['body'][_0x0653('0x5a')]=_0x2eccfc['id'];return db[_0x0653('0x5b')]['create'](_0x1647e8[_0x0653('0x52')]);}})[_0x0653('0x2c')](respondWithResult(_0x40e1bf,null))['catch'](handleError(_0x40e1bf,null));};exports[_0x0653('0x5c')]=function(_0x223746,_0x38fe52,_0x7f7456){var _0x4d3008={'raw':![],'where':{}};var _0x5b56d1={};var _0x2c615b={'count':0x0,'rows':[]};return db['CmList'][_0x0653('0x5d')]({'where':{'id':_0x223746['params']['id']}})['then'](handleEntityNotFound(_0x38fe52,null))[_0x0653('0x2c')](function(_0x2ad538){if(_0x2ad538){_0x5b56d1['model']=_[_0x0653('0x3c')](db[_0x0653('0x5b')][_0x0653('0x35')]);_0x5b56d1['query']=_[_0x0653('0x3c')](_0x223746[_0x0653('0x3b')]);_0x5b56d1[_0x0653('0x45')]=_[_0x0653('0x3d')](_0x5b56d1[_0x0653('0x39')],_0x5b56d1[_0x0653('0x3b')]);_0x4d3008[_0x0653('0x3e')]=_[_0x0653('0x3d')](_0x5b56d1['model'],qs[_0x0653('0x3f')](_0x223746[_0x0653('0x3b')]['fields']));_0x4d3008[_0x0653('0x3e')]=_0x4d3008['attributes'][_0x0653('0x40')]?_0x4d3008[_0x0653('0x3e')]:_0x5b56d1[_0x0653('0x39')];if(!_0x223746['query'][_0x0653('0x41')](_0x0653('0x42'))){_0x4d3008[_0x0653('0x24')]=qs['limit'](_0x223746['query']['limit']);_0x4d3008['offset']=qs[_0x0653('0x22')](_0x223746['query'][_0x0653('0x22')]);}_0x4d3008[_0x0653('0x43')]=qs[_0x0653('0x5e')](_0x223746[_0x0653('0x3b')][_0x0653('0x5e')]);_0x4d3008[_0x0653('0x48')]=qs[_0x0653('0x45')](_['pick'](_0x223746[_0x0653('0x3b')],_0x5b56d1['filters']));_0x4d3008['where'][_0x0653('0x5a')]=_0x2ad538['id'];if(_0x223746[_0x0653('0x3b')][_0x0653('0x46')]){_0x4d3008[_0x0653('0x48')]=_[_0x0653('0x47')](_0x4d3008['where'],{'$or':_[_0x0653('0x3a')](_0x4d3008[_0x0653('0x3e')],function(_0x58b8b3){var _0x235866={};_0x235866[_0x58b8b3]={'$like':'%'+_0x223746[_0x0653('0x3b')][_0x0653('0x46')]+'%'};return _0x235866;})});}_0x4d3008=_['merge']({},_0x4d3008,_0x223746[_0x0653('0x49')]);return db[_0x0653('0x5b')][_0x0653('0x25')]({'where':_0x4d3008[_0x0653('0x48')]})[_0x0653('0x2c')](function(_0xf126be){_0x2c615b['count']=_0xf126be;if(_0x223746[_0x0653('0x3b')][_0x0653('0x4a')]){_0x4d3008[_0x0653('0x4b')]=[{'all':!![]}];}return db['Disposition'][_0x0653('0x4c')](_0x4d3008);})['then'](function(_0x4ea0e8){_0x2c615b[_0x0653('0x4d')]=_0x4ea0e8;return _0x2c615b;});}})['then'](respondWithFilteredResult(_0x38fe52,_0x4d3008))[_0x0653('0x4e')](handleError(_0x38fe52,null));};exports['removeDispositions']=function(_0x53a7eb,_0x6f19ad,_0x381341){return db['CmList'][_0x0653('0x50')]({'where':{'id':_0x53a7eb[_0x0653('0x57')]['id']}})[_0x0653('0x2c')](handleEntityNotFound(_0x6f19ad,null))[_0x0653('0x2c')](function(_0x40066a){if(_0x40066a){return _0x40066a[_0x0653('0x5f')](_0x53a7eb[_0x0653('0x3b')]['ids']);}})[_0x0653('0x2c')](respondWithStatusCode(_0x6f19ad,null))['catch'](handleError(_0x6f19ad,null));};exports['addContacts']=function(_0x150126,_0xe3e09b,_0x139ebe){return db[_0x0653('0x34')][_0x0653('0x50')]({'where':{'id':_0x150126[_0x0653('0x57')]['id']}})[_0x0653('0x2c')](handleEntityNotFound(_0xe3e09b,null))[_0x0653('0x2c')](function(_0x3c03c8){if(_0x3c03c8){var _0x754e66=[];var _0x328dac={'success':[],'errors':[]};return db[_0x0653('0x60')][_0x0653('0x58')]()['then'](function(_0x4b3861){if(_0x150126[_0x0653('0x52')][_0x0653('0x61')]&&_[_0x0653('0x62')](_0x150126['body'][_0x0653('0x61')])){if(_0x150126[_0x0653('0x52')][_0x0653('0x61')][_0x0653('0x40')]){_0x150126['body'][_0x0653('0x61')]=_0x150126[_0x0653('0x52')][_0x0653('0x61')]['join'](';')+';';}else{_0x150126[_0x0653('0x52')][_0x0653('0x61')]=null;}}else{_0x150126[_0x0653('0x52')][_0x0653('0x61')]=null;}if(_0x150126[_0x0653('0x52')]&&_[_0x0653('0x62')](_0x150126[_0x0653('0x52')])){for(var _0x18961d=0x0;_0x18961d<_0x150126['body'][_0x0653('0x40')];_0x18961d+=0x1){_0x150126[_0x0653('0x52')][_0x18961d][_0x0653('0x5a')]=_0x150126['params']['id'];_0x754e66[_0x0653('0x63')](_0x150126[_0x0653('0x52')][_0x18961d]);}return BPromise[_0x0653('0x64')](_0x754e66,function(_0x4ff523){return db[_0x0653('0x60')][_0x0653('0x51')](_[_0x0653('0x65')](_0x4ff523,[_0x0653('0x66'),'id'])||{},{'fields':_[_0x0653('0x3c')](_0x4b3861),'raw':!![]})[_0x0653('0x2c')](function(_0x4b45ac){_0x328dac[_0x0653('0x67')]['push'](_0x4b45ac['dataValues']);})[_0x0653('0x4e')](function(_0x554c40){_0x328dac['errors']['push']({'data':_0x4ff523,'error':_0x554c40[_0x0653('0x68')]});});})[_0x0653('0x2c')](function(_0x5a413a){return _0x328dac;})[_0x0653('0x4e')](function(_0x3245fb){return _0x3245fb;});}else{_0xe3e09b[_0x0653('0x20')](0x190)[_0x0653('0x28')]({'message':_0x0653('0x69')});}});}})[_0x0653('0x2c')](respondWithResult(_0xe3e09b,null))['catch'](handleError(_0xe3e09b,null));};exports[_0x0653('0x6a')]=function(_0x39ab5b,_0x3c744c,_0x340b77){var _0x34d932;return db[_0x0653('0x34')]['find']({'where':{'id':_0x39ab5b[_0x0653('0x57')]['id']},'include':[{'model':db[_0x0653('0x6b')],'as':_0x0653('0x6c')}]})[_0x0653('0x2c')](handleEntityNotFound(_0x3c744c,null))[_0x0653('0x2c')](function(_0x417b1d){if(_0x417b1d){_0x34d932=_0x417b1d;return db[_0x0653('0x60')]['rawAttributes'];}})[_0x0653('0x2c')](function(_0x46121c){if(_0x46121c){var _0xc1732a={};var _0x2bb751={};_0x2bb751['model']=_[_0x0653('0x6d')](_['keys'](_0x46121c),_['map'](_0x34d932[_0x0653('0x6c')],function(_0x1dc365){return util[_0x0653('0x6e')](_0x0653('0x6f'),_0x1dc365['id']);}));_0x2bb751[_0x0653('0x3b')]=_[_0x0653('0x3c')](_0x39ab5b[_0x0653('0x3b')]);_0x2bb751[_0x0653('0x45')]=_[_0x0653('0x3d')](_0x2bb751[_0x0653('0x39')],_0x2bb751[_0x0653('0x3b')]);_0xc1732a[_0x0653('0x3e')]=_[_0x0653('0x3d')](_0x2bb751[_0x0653('0x39')],qs['fields'](_0x39ab5b[_0x0653('0x3b')][_0x0653('0x3f')]));_0xc1732a[_0x0653('0x3e')]=_0xc1732a[_0x0653('0x3e')][_0x0653('0x40')]?_0xc1732a[_0x0653('0x3e')]:_0x2bb751[_0x0653('0x39')];if(!_0x39ab5b[_0x0653('0x3b')][_0x0653('0x41')](_0x0653('0x42'))){_0xc1732a[_0x0653('0x24')]=qs[_0x0653('0x24')](_0x39ab5b['query'][_0x0653('0x24')]);_0xc1732a[_0x0653('0x22')]=qs['offset'](_0x39ab5b[_0x0653('0x3b')][_0x0653('0x22')]);}_0xc1732a[_0x0653('0x43')]=qs[_0x0653('0x5e')](_0x39ab5b['query'][_0x0653('0x5e')]);_0xc1732a[_0x0653('0x48')]=qs[_0x0653('0x45')](_[_0x0653('0x44')](_0x39ab5b[_0x0653('0x3b')],_0x2bb751[_0x0653('0x45')]));_0xc1732a[_0x0653('0x70')]=!![];if(_0x39ab5b[_0x0653('0x3b')][_0x0653('0x46')]){_0xc1732a[_0x0653('0x48')]=_[_0x0653('0x47')](_0xc1732a['where'],{'$or':_['map'](_0xc1732a[_0x0653('0x3e')],function(_0x2abcb6){var _0x1da466={};_0x1da466[_0x2abcb6]={'$like':'%'+_0x39ab5b[_0x0653('0x3b')][_0x0653('0x46')]+'%'};return _0x1da466;})});}_0xc1732a=_['merge']({},_0xc1732a,_0x39ab5b[_0x0653('0x49')]);return _0x34d932[_0x0653('0x6a')](_0xc1732a);}})[_0x0653('0x2c')](respondWithResult(_0x3c744c,null))[_0x0653('0x4e')](handleError(_0x3c744c,null));};exports[_0x0653('0x71')]=function(_0x32df4f,_0x4a8416,_0x11871d){var _0x23cc1d;var _0x3323d0;var _0x3aba2a;var _0x29e5d4=_0x32df4f[_0x0653('0x57')]['id'];csv_results=[];return db[_0x0653('0x72')][_0x0653('0x4c')]({'attributes':['id',_0x0653('0x32')],'raw':!![],'order':[_0x0653('0x73')]})[_0x0653('0x2c')](function(_0x5f5ae4){_0x23cc1d=_0x5f5ae4;var _0x4afa63=_[_0x0653('0x3c')](db['CmContact'][_0x0653('0x35')]);return db['CmCustomField'][_0x0653('0x4c')]({'raw':!![],'attributes':['id','alias']})[_0x0653('0x2c')](function(_0x14ca20){_0x3323d0=_0x14ca20;var _0x4068e6=squel[_0x0653('0x74')]()[_0x0653('0x3f')](_0x4afa63)[_0x0653('0x75')]('cm_contacts','c')['where'](_0x0653('0x76'),_0x29e5d4)[_0x0653('0x48')](_0x0653('0x77'))['distinct']();for(var _0x328d9b=0x0;_0x328d9b<_0x3323d0[_0x0653('0x40')];_0x328d9b++){_0x4068e6['field'](_0x0653('0x78')+_0x3323d0[_0x328d9b]['id'],'customField_'+_0x3323d0[_0x328d9b][_0x0653('0x79')]);}for(var _0x328d9b=0x0;_0x328d9b<_0x23cc1d[_0x0653('0x40')];_0x328d9b++){_0x4068e6[_0x0653('0x7a')](squel['select']()[_0x0653('0x7a')](_0x0653('0x7b'))[_0x0653('0x75')](_0x0653('0x7c'))[_0x0653('0x48')]('ItemTypeId\x20=\x20?',_0x23cc1d[_0x328d9b]['id'])['where'](_0x0653('0x7d')),_0x0653('0x7e')+_0x23cc1d[_0x328d9b][_0x0653('0x32')]);_0x4068e6[_0x0653('0x7a')](squel['select']()['field'](_0x0653('0x7f'))['from'](_0x0653('0x7c'))[_0x0653('0x48')](_0x0653('0x80'),_0x23cc1d[_0x328d9b]['id'])[_0x0653('0x48')](_0x0653('0x7d')),_0x0653('0x81')+_0x23cc1d[_0x328d9b][_0x0653('0x32')]);}var _0x3b9212=[];_0x3b9212['push'](_0x4068e6[_0x0653('0x82')]());BPromise[_0x0653('0x64')](_0x3b9212,handleQuery)['then'](function(_0x1cebf8){handleQuery(_0x4068e6['toString']());var _0x10674c=csv_results[0x0];if(!_['isEmpty'](_0x10674c)){var _0xc1cc32=toCsv(_0x10674c);var _0x48cf93=Date[_0x0653('0x83')]();fs[_0x0653('0x84')](util['format']('/tmp/list_%d_%s.csv',_0x29e5d4,_0x48cf93),_0xc1cc32);_0x4a8416[_0x0653('0x85')](_0x0653('0x86'),_0x0653('0x87')+util[_0x0653('0x6e')]('list_%d_%s.csv',_0x29e5d4,_0x48cf93));_0x4a8416['setHeader'](_0x0653('0x88'),_0x0653('0x89'));return _0x4a8416['download'](util[_0x0653('0x6e')]('/tmp/list_%d_%s.csv',_0x29e5d4,_0x48cf93));}else{return _0x4a8416[_0x0653('0x1f')](0xcc);}});});});};exports[_0x0653('0x8a')]=function(_0x42075d,_0x50d96f,_0x40b79){var _0xb7a214;delete _0x42075d[_0x0653('0x52')]['id'];return db[_0x0653('0x34')][_0x0653('0x5d')]({'where':{'id':_0x42075d[_0x0653('0x57')]['id']}})[_0x0653('0x2c')](handleEntityNotFound(_0x50d96f,null))[_0x0653('0x2c')](function(_0x42ee81){if(_0x42ee81){return db['sequelize'][_0x0653('0x8b')](function(_0x5727cf){return db[_0x0653('0x6b')][_0x0653('0x51')](_0x42075d['body'],{'transaction':_0x5727cf})[_0x0653('0x2c')](function(_0xbe325d){_0xb7a214=_0xbe325d;return _0x42ee81['addCustomFields'](_0xbe325d,{'transaction':_0x5727cf});})[_0x0653('0x2c')](function(){var _0x3b67be={'type':db[_0x0653('0x8c')][_0x0653('0x8d')],'transaction':_0x5727cf};switch(_0x42075d['body'][_0x0653('0x37')]){case _0x0653('0x8e'):_0x3b67be[_0x0653('0x37')]=db[_0x0653('0x8c')][_0x0653('0x8d')];break;case _0x0653('0x8f'):_0x3b67be[_0x0653('0x37')]=db[_0x0653('0x8c')][_0x0653('0x90')];break;case _0x0653('0x91'):_0x3b67be[_0x0653('0x37')]=db[_0x0653('0x8c')][_0x0653('0x92')];_0x3b67be['defaultValue']=![];break;default:}return db[_0x0653('0x93')]['queryInterface']['addColumn'](_0x0653('0x94'),util['format']('cf_%s',_0xb7a214['id']),_0x3b67be);})['then'](function(){return _0xb7a214;});});}})[_0x0653('0x2c')](respondWithResult(_0x50d96f,null))['catch'](handleError(_0x50d96f,null));};exports[_0x0653('0x95')]=function(_0x689a23,_0x2ed458,_0x5aa4d5){var _0x1f7f7b={};var _0x1d6fb2={};var _0x1dba7b;var _0x4e89b3;return db['CmList'][_0x0653('0x5d')]({'where':{'id':_0x689a23[_0x0653('0x57')]['id']}})[_0x0653('0x2c')](handleEntityNotFound(_0x2ed458,null))[_0x0653('0x2c')](function(_0x194b2e){if(_0x194b2e){_0x1dba7b=_0x194b2e;_0x1d6fb2[_0x0653('0x39')]=_[_0x0653('0x3c')](db[_0x0653('0x6b')][_0x0653('0x35')]);_0x1d6fb2[_0x0653('0x3b')]=_[_0x0653('0x3c')](_0x689a23['query']);_0x1d6fb2[_0x0653('0x45')]=_[_0x0653('0x3d')](_0x1d6fb2[_0x0653('0x39')],_0x1d6fb2[_0x0653('0x3b')]);_0x1f7f7b['attributes']=_[_0x0653('0x3d')](_0x1d6fb2[_0x0653('0x39')],qs[_0x0653('0x3f')](_0x689a23[_0x0653('0x3b')][_0x0653('0x3f')]));_0x1f7f7b['attributes']=_0x1f7f7b[_0x0653('0x3e')]['length']?_0x1f7f7b[_0x0653('0x3e')]:_0x1d6fb2[_0x0653('0x39')];_0x1f7f7b[_0x0653('0x43')]=qs[_0x0653('0x5e')](_0x689a23[_0x0653('0x3b')]['sort']);_0x1f7f7b[_0x0653('0x48')]=qs[_0x0653('0x45')](_[_0x0653('0x44')](_0x689a23[_0x0653('0x3b')],_0x1d6fb2['filters']));_0x1f7f7b[_0x0653('0x48')]=_[_0x0653('0x47')](_0x1f7f7b['where'],{'$or':[{'ListId':_0x194b2e['id']},{'ListId':null}]});if(_0x689a23[_0x0653('0x3b')][_0x0653('0x46')]){_0x1f7f7b['where']=_[_0x0653('0x47')](_0x1f7f7b[_0x0653('0x48')],{'$or':_['map'](_0x1f7f7b['attributes'],function(_0x5e6a60){var _0x47cebc={};_0x47cebc[_0x5e6a60]={'$like':'%'+_0x689a23[_0x0653('0x3b')]['filter']+'%'};return _0x47cebc;})});}_0x1f7f7b=_[_0x0653('0x47')]({},_0x1f7f7b,_0x689a23[_0x0653('0x49')]);return db[_0x0653('0x6b')][_0x0653('0x96')](_0x1f7f7b);}})[_0x0653('0x2c')](respondWithResult(_0x2ed458,null))[_0x0653('0x4e')](handleError(_0x2ed458,null));};exports[_0x0653('0x97')]=function(_0x5acc18,_0x20b9c7){return db['CmCustomField'][_0x0653('0x96')]({'where':{'ListId':null}})[_0x0653('0x2c')](handleEntityNotFound(_0x20b9c7,null))[_0x0653('0x2c')](function(_0x477589){return _0x477589;})[_0x0653('0x2c')](respondWithResult(_0x20b9c7,null))['catch'](handleError(_0x20b9c7,null));};exports[_0x0653('0x98')]=function(_0x130a64,_0x5e1554,_0x20f120){return db[_0x0653('0x34')][_0x0653('0x50')]({'where':{'id':_0x130a64[_0x0653('0x57')]['id']}})[_0x0653('0x2c')](handleEntityNotFound(_0x5e1554,null))[_0x0653('0x2c')](function(_0x37230d){if(_0x37230d){return _0x37230d[_0x0653('0x98')](_0x130a64['body'][_0x0653('0x66')],_[_0x0653('0x65')](_0x130a64[_0x0653('0x52')],[_0x0653('0x66'),'id'])||{})[_0x0653('0x99')](function(_0x226672){for(var _0x750823=0x0;_0x750823<_0x130a64[_0x0653('0x52')][_0x0653('0x66')][_0x0653('0x40')];_0x750823+=0x1){socket[_0x0653('0x9a')](_0x0653('0x9b'),{'UserId':Number(_0x130a64['body'][_0x0653('0x66')][_0x750823]),'CmListId':Number(_0x130a64[_0x0653('0x57')]['id'])});}return _0x226672;});}})[_0x0653('0x2c')](respondWithResult(_0x5e1554,null))['catch'](handleError(_0x5e1554,null));};exports[_0x0653('0x9c')]=function(_0x139a4a,_0x2a53cc,_0x51e0ce){return db['CmList'][_0x0653('0x50')]({'where':{'id':_0x139a4a[_0x0653('0x57')]['id']}})[_0x0653('0x2c')](handleEntityNotFound(_0x2a53cc,null))[_0x0653('0x2c')](function(_0x5dfa1f){if(_0x5dfa1f){return _0x5dfa1f[_0x0653('0x9c')](_0x139a4a[_0x0653('0x3b')][_0x0653('0x66')])[_0x0653('0x2c')](function(){if(_[_0x0653('0x62')](_0x139a4a[_0x0653('0x3b')][_0x0653('0x66')])){for(var _0x312731=0x0;_0x312731<_0x139a4a[_0x0653('0x3b')]['ids'][_0x0653('0x40')];_0x312731+=0x1){socket[_0x0653('0x9a')](_0x0653('0x9d'),{'UserId':Number(_0x139a4a[_0x0653('0x3b')][_0x0653('0x66')][_0x312731]),'CmListId':Number(_0x139a4a['params']['id'])});}}else{socket[_0x0653('0x9a')]('userCmList:remove',{'UserId':Number(_0x139a4a['query'][_0x0653('0x66')]),'CmListId':Number(_0x139a4a['params']['id'])});}});}})[_0x0653('0x2c')](respondWithStatusCode(_0x2a53cc,null))[_0x0653('0x4e')](handleError(_0x2a53cc,null));};exports['getAgents']=function(_0x4572c8,_0x488546,_0x5368d1){var _0x4fb12d={};var _0x272a86={};var _0x5bdf26;var _0x24b775;return db['CmList'][_0x0653('0x5d')]({'where':{'id':_0x4572c8['params']['id']}})['then'](handleEntityNotFound(_0x488546,null))['then'](function(_0x33e3ef){if(_0x33e3ef){_0x5bdf26=_0x33e3ef;_0x272a86['model']=_[_0x0653('0x3c')](db[_0x0653('0x9e')][_0x0653('0x35')]);_0x272a86[_0x0653('0x3b')]=_[_0x0653('0x3c')](_0x4572c8['query']);_0x272a86[_0x0653('0x45')]=_[_0x0653('0x3d')](_0x272a86['model'],_0x272a86[_0x0653('0x3b')]);_0x4fb12d[_0x0653('0x3e')]=_[_0x0653('0x3d')](_0x272a86[_0x0653('0x39')],qs[_0x0653('0x3f')](_0x4572c8[_0x0653('0x3b')][_0x0653('0x3f')]));_0x4fb12d[_0x0653('0x3e')]=_0x4fb12d['attributes']['length']?_0x4fb12d[_0x0653('0x3e')]:_0x272a86[_0x0653('0x39')];_0x4fb12d['order']=qs[_0x0653('0x5e')](_0x4572c8[_0x0653('0x3b')][_0x0653('0x5e')]);_0x4fb12d[_0x0653('0x48')]=qs[_0x0653('0x45')](_[_0x0653('0x44')](_0x4572c8[_0x0653('0x3b')],_0x272a86['filters']));if(_0x4572c8[_0x0653('0x3b')][_0x0653('0x46')]){_0x4fb12d[_0x0653('0x48')]=_[_0x0653('0x47')](_0x4fb12d[_0x0653('0x48')],{'$or':_[_0x0653('0x3a')](_0x4fb12d['attributes'],function(_0x30b3d8){var _0x5899bf={};_0x5899bf[_0x30b3d8]={'$like':'%'+_0x4572c8[_0x0653('0x3b')][_0x0653('0x46')]+'%'};return _0x5899bf;})});}_0x4fb12d=_['merge']({},_0x4fb12d,_0x4572c8[_0x0653('0x49')]);return _0x5bdf26['getAgents'](_0x4fb12d);}})['then'](function(_0x729850){if(_0x729850){_0x24b775=_0x729850[_0x0653('0x40')];if(!_0x4572c8['query'][_0x0653('0x41')](_0x0653('0x42'))){_0x4fb12d[_0x0653('0x24')]=qs[_0x0653('0x24')](_0x4572c8[_0x0653('0x3b')][_0x0653('0x24')]);_0x4fb12d[_0x0653('0x22')]=qs[_0x0653('0x22')](_0x4572c8[_0x0653('0x3b')][_0x0653('0x22')]);}return _0x5bdf26['getAgents'](_0x4fb12d);}})[_0x0653('0x2c')](function(_0x4d0eab){if(_0x4d0eab){return _0x4d0eab?{'count':_0x24b775,'rows':_0x4d0eab}:null;}})[_0x0653('0x2c')](respondWithResult(_0x488546,null))[_0x0653('0x4e')](handleError(_0x488546,null));};function handleQuery(_0x59e558){logger[_0x0653('0x9f')](_0x59e558);return db['sequelize'][_0x0653('0x3b')](_0x59e558)[_0x0653('0x99')](function(_0xbac7fc){csv_results[_0x0653('0x63')](_0xbac7fc);})['catch'](function(_0x223dc1){logger[_0x0653('0x31')](_0x223dc1[_0x0653('0x68')]);});} \ No newline at end of file +var _0x8c90=['c.deletedAt\x20is\x20null','field','c.cf_','customField_','item','cm_contact_has_items','CmContactId\x20=\x20c.id','additionalPhone_','description','ItemTypeId\x20=\x20?','description_additionalPhone_','toString','isEmpty','now','setHeader','list_%d_%s.csv','Content-type','text/csv','/tmp/list_%d_%s.csv','sequelize','transaction','addCustomFields','TEXT','Sequelize','switch','BOOLEAN','queryInterface','addColumn','cm_contacts','cf_%s','findAndCountAll','getGlobalCustomFields','addAgents','omit','spread','userCmList:save','removeAgents','emit','userCmList:remove','getAgents','User','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','Lists','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','CmList','includeAll','catch','include','options','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','body','params','describe','addDisposition','ListId','Disposition','getDispositions','findOne','hasOwnProperty','rows','removeDispositions','ids','CmContact','tags','isArray','each','success','push','dataValues','errors','message','json','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','format','pick','raw','getContactsCsv','ContactItemType','findAll','OrderBy','alias','select','from','c.ListId\x20=\x20?'];(function(_0x4668a6,_0x4e8a1f){var _0x23215d=function(_0x4f4cfc){while(--_0x4f4cfc){_0x4668a6['push'](_0x4668a6['shift']());}};_0x23215d(++_0x4e8a1f);}(_0x8c90,0x16d));var _0x08c9=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x8c90[_0x29b609];return _0x54c952;};'use strict';var emlformat=require(_0x08c9('0x0'));var rimraf=require(_0x08c9('0x1'));var zipdir=require(_0x08c9('0x2'));var jsonpatch=require(_0x08c9('0x3'));var rp=require(_0x08c9('0x4'));var moment=require(_0x08c9('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x08c9('0x6'));var sox=require(_0x08c9('0x7'));var csv=require('to-csv');var ejs=require(_0x08c9('0x8'));var fs=require('fs');var fs_extra=require(_0x08c9('0x9'));var _=require(_0x08c9('0xa'));var squel=require(_0x08c9('0xb'));var crypto=require(_0x08c9('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x08c9('0xd'));var toCsv=require('to-csv');var querystring=require(_0x08c9('0xe'));var Papa=require(_0x08c9('0xf'));var Redis=require(_0x08c9('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x08c9('0x11'));var as=require(_0x08c9('0x12'));var hardwareService=require(_0x08c9('0x13'));var logger=require(_0x08c9('0x14'))(_0x08c9('0x15'));var utils=require(_0x08c9('0x16'));var config=require(_0x08c9('0x17'));var licenseUtil=require(_0x08c9('0x18'));var db=require(_0x08c9('0x19'))['db'];var csv_results;config[_0x08c9('0x1a')]=_[_0x08c9('0x1b')](config['redis'],{'host':_0x08c9('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x08c9('0x1a')]));require('./cmList.socket')[_0x08c9('0x1d')](socket);function respondWithStatusCode(_0x44cac8,_0xf8828d){_0xf8828d=_0xf8828d||0xcc;return function(_0x44abb0){if(_0x44abb0){return _0x44cac8[_0x08c9('0x1e')](_0xf8828d);}return _0x44cac8[_0x08c9('0x1f')](_0xf8828d)[_0x08c9('0x20')]();};}function respondWithResult(_0x3e3533,_0xd39c84){_0xd39c84=_0xd39c84||0xc8;return function(_0x24d960){if(_0x24d960){return _0x3e3533[_0x08c9('0x1f')](_0xd39c84)['json'](_0x24d960);}};}function respondWithFilteredResult(_0x51bc61,_0x3a63e5){return function(_0x2153a8){if(_0x2153a8){var _0x4aa2bf=typeof _0x3a63e5[_0x08c9('0x21')]===_0x08c9('0x22')&&typeof _0x3a63e5[_0x08c9('0x23')]==='undefined';var _0x15519f=_0x2153a8[_0x08c9('0x24')];var _0x54fb02=_0x4aa2bf?0x0:_0x3a63e5['offset'];var _0x394e6e=_0x4aa2bf?_0x2153a8[_0x08c9('0x24')]:_0x3a63e5[_0x08c9('0x21')]+_0x3a63e5[_0x08c9('0x23')];var _0xb092f6;if(_0x394e6e>=_0x15519f){_0x394e6e=_0x15519f;_0xb092f6=0xc8;}else{_0xb092f6=0xce;}_0x51bc61[_0x08c9('0x1f')](_0xb092f6);return _0x51bc61[_0x08c9('0x25')](_0x08c9('0x26'),_0x54fb02+'-'+_0x394e6e+'/'+_0x15519f)['json'](_0x2153a8);}return null;};}function patchUpdates(_0x288137){return function(_0x18ef6f){try{jsonpatch[_0x08c9('0x27')](_0x18ef6f,_0x288137,!![]);}catch(_0x206c00){return BPromise[_0x08c9('0x28')](_0x206c00);}return _0x18ef6f['save']();};}function saveUpdates(_0x3c2d56,_0x3b8d23){return function(_0x103210){if(_0x103210){return _0x103210[_0x08c9('0x29')](_0x3c2d56)[_0x08c9('0x2a')](function(_0x327d71){return _0x327d71;});}return null;};}function removeEntity(_0x12cb23,_0x1d0fb3){return function(_0x321de7){if(_0x321de7){return _0x321de7[_0x08c9('0x2b')]()[_0x08c9('0x2a')](function(){var _0x13d062=_0x321de7['get']({'plain':!![]});var _0x5a2e81=_0x08c9('0x2c');return db[_0x08c9('0x2d')][_0x08c9('0x2b')]({'where':{'type':_0x5a2e81,'resourceId':_0x13d062['id']}})[_0x08c9('0x2a')](function(){return _0x321de7;});})[_0x08c9('0x2a')](function(){_0x12cb23[_0x08c9('0x1f')](0xcc)[_0x08c9('0x20')]();});}};}function handleEntityNotFound(_0x29d961,_0xc0a2bb){return function(_0x44b7a0){if(!_0x44b7a0){_0x29d961[_0x08c9('0x1e')](0x194);}return _0x44b7a0;};}function handleError(_0x4893b8,_0x9b287){_0x9b287=_0x9b287||0x1f4;return function(_0x5e7650){logger[_0x08c9('0x2e')](_0x5e7650[_0x08c9('0x2f')]);if(_0x5e7650[_0x08c9('0x30')]){delete _0x5e7650[_0x08c9('0x30')];}_0x4893b8[_0x08c9('0x1f')](_0x9b287)[_0x08c9('0x31')](_0x5e7650);};}exports[_0x08c9('0x32')]=function(_0xd4e334,_0x46ee4f){var _0xb6e63c={},_0x24034b={},_0x4ed501={'count':0x0,'rows':[]};var _0x5134b7=_[_0x08c9('0x33')](db['CmList'][_0x08c9('0x34')],function(_0x5e25c9){return{'name':_0x5e25c9[_0x08c9('0x35')],'type':_0x5e25c9[_0x08c9('0x36')][_0x08c9('0x37')]};});_0x24034b[_0x08c9('0x38')]=_[_0x08c9('0x33')](_0x5134b7,_0x08c9('0x30'));_0x24034b[_0x08c9('0x39')]=_[_0x08c9('0x3a')](_0xd4e334[_0x08c9('0x39')]);_0x24034b[_0x08c9('0x3b')]=_['intersection'](_0x24034b[_0x08c9('0x38')],_0x24034b['query']);_0xb6e63c[_0x08c9('0x3c')]=_[_0x08c9('0x3d')](_0x24034b[_0x08c9('0x38')],qs['fields'](_0xd4e334[_0x08c9('0x39')][_0x08c9('0x3e')]));_0xb6e63c[_0x08c9('0x3c')]=_0xb6e63c[_0x08c9('0x3c')][_0x08c9('0x3f')]?_0xb6e63c[_0x08c9('0x3c')]:_0x24034b[_0x08c9('0x38')];if(!_0xd4e334['query']['hasOwnProperty'](_0x08c9('0x40'))){_0xb6e63c[_0x08c9('0x23')]=qs[_0x08c9('0x23')](_0xd4e334[_0x08c9('0x39')][_0x08c9('0x23')]);_0xb6e63c[_0x08c9('0x21')]=qs[_0x08c9('0x21')](_0xd4e334[_0x08c9('0x39')][_0x08c9('0x21')]);}_0xb6e63c[_0x08c9('0x41')]=qs[_0x08c9('0x42')](_0xd4e334['query'][_0x08c9('0x42')]);_0xb6e63c[_0x08c9('0x43')]=qs[_0x08c9('0x3b')](_['pick'](_0xd4e334[_0x08c9('0x39')],_0x24034b[_0x08c9('0x3b')]),_0x5134b7);if(_0xd4e334[_0x08c9('0x39')][_0x08c9('0x44')]){_0xb6e63c[_0x08c9('0x43')]=_[_0x08c9('0x45')](_0xb6e63c[_0x08c9('0x43')],{'$or':_[_0x08c9('0x33')](_0x5134b7,function(_0x569660){if(_0x569660[_0x08c9('0x36')]!==_0x08c9('0x46')){var _0x37fe85={};_0x37fe85[_0x569660[_0x08c9('0x30')]]={'$like':'%'+_0xd4e334[_0x08c9('0x39')][_0x08c9('0x44')]+'%'};return _0x37fe85;}})});}_0xb6e63c=_[_0x08c9('0x45')]({},_0xb6e63c,_0xd4e334['options']);var _0x4eeaaa={'where':_0xb6e63c[_0x08c9('0x43')]};return db[_0x08c9('0x47')][_0x08c9('0x24')](_0x4eeaaa)[_0x08c9('0x2a')](function(_0x42b121){_0x4ed501[_0x08c9('0x24')]=_0x42b121;if(_0xd4e334[_0x08c9('0x39')][_0x08c9('0x48')]){_0xb6e63c['include']=[{'all':!![]}];}return db['CmList']['findAll'](_0xb6e63c);})['then'](function(_0x10c7c6){_0x4ed501['rows']=_0x10c7c6;return _0x4ed501;})[_0x08c9('0x2a')](respondWithFilteredResult(_0x46ee4f,_0xb6e63c))[_0x08c9('0x49')](handleError(_0x46ee4f,null));};exports['show']=function(_0x55bff2,_0x695f0e){var _0xcf1d52={'raw':![],'where':{'id':_0x55bff2['params']['id']}},_0x4a4831={};_0x4a4831[_0x08c9('0x38')]=_[_0x08c9('0x3a')](db[_0x08c9('0x47')]['rawAttributes']);_0x4a4831[_0x08c9('0x39')]=_[_0x08c9('0x3a')](_0x55bff2[_0x08c9('0x39')]);_0x4a4831[_0x08c9('0x3b')]=_['intersection'](_0x4a4831['model'],_0x4a4831['query']);_0xcf1d52[_0x08c9('0x3c')]=_[_0x08c9('0x3d')](_0x4a4831[_0x08c9('0x38')],qs[_0x08c9('0x3e')](_0x55bff2[_0x08c9('0x39')][_0x08c9('0x3e')]));_0xcf1d52[_0x08c9('0x3c')]=_0xcf1d52[_0x08c9('0x3c')][_0x08c9('0x3f')]?_0xcf1d52['attributes']:_0x4a4831[_0x08c9('0x38')];if(_0x55bff2[_0x08c9('0x39')]['includeAll']){_0xcf1d52[_0x08c9('0x4a')]=[{'all':!![]}];}_0xcf1d52=_['merge']({},_0xcf1d52,_0x55bff2[_0x08c9('0x4b')]);return db[_0x08c9('0x47')][_0x08c9('0x4c')](_0xcf1d52)[_0x08c9('0x2a')](handleEntityNotFound(_0x695f0e,null))[_0x08c9('0x2a')](respondWithResult(_0x695f0e,null))[_0x08c9('0x49')](handleError(_0x695f0e,null));};exports[_0x08c9('0x4d')]=function(_0x325a4f,_0x10e26d){return db[_0x08c9('0x47')][_0x08c9('0x4d')](_0x325a4f['body'],{})[_0x08c9('0x2a')](function(_0x4214ad){var _0x34ebe4=_0x325a4f['user'][_0x08c9('0x4e')]({'plain':!![]});if(!_0x34ebe4)throw new Error(_0x08c9('0x4f'));if(_0x34ebe4[_0x08c9('0x50')]==='user'){var _0x53b442=_0x4214ad['get']({'plain':!![]});var _0x56e3f2=_0x08c9('0x2c');return db[_0x08c9('0x51')]['find']({'where':{'name':_0x56e3f2,'userProfileId':_0x34ebe4['userProfileId']},'raw':!![]})[_0x08c9('0x2a')](function(_0x416bd8){if(_0x416bd8&&_0x416bd8[_0x08c9('0x52')]===0x0){return db[_0x08c9('0x2d')][_0x08c9('0x4d')]({'name':_0x53b442[_0x08c9('0x30')],'resourceId':_0x53b442['id'],'type':_0x416bd8[_0x08c9('0x30')],'sectionId':_0x416bd8['id']},{})[_0x08c9('0x2a')](function(){return _0x4214ad;});}else{return _0x4214ad;}})['catch'](function(_0x536d02){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x536d02);throw _0x536d02;});}return _0x4214ad;})[_0x08c9('0x2a')](respondWithResult(_0x10e26d,0xc9))['catch'](handleError(_0x10e26d,null));};exports[_0x08c9('0x29')]=function(_0x51bc39,_0x36ee22){if(_0x51bc39['body']['id']){delete _0x51bc39[_0x08c9('0x53')]['id'];}return db['CmList'][_0x08c9('0x4c')]({'where':{'id':_0x51bc39[_0x08c9('0x54')]['id']}})[_0x08c9('0x2a')](handleEntityNotFound(_0x36ee22,null))['then'](saveUpdates(_0x51bc39[_0x08c9('0x53')],null))[_0x08c9('0x2a')](respondWithResult(_0x36ee22,null))[_0x08c9('0x49')](handleError(_0x36ee22,null));};exports[_0x08c9('0x2b')]=function(_0x4b107d,_0x3a40e3){return db[_0x08c9('0x47')]['find']({'where':{'id':_0x4b107d[_0x08c9('0x54')]['id']}})[_0x08c9('0x2a')](handleEntityNotFound(_0x3a40e3,null))[_0x08c9('0x2a')](removeEntity(_0x3a40e3,null))['catch'](handleError(_0x3a40e3,null));};exports[_0x08c9('0x55')]=function(_0x111b49,_0x41d6f8){return db[_0x08c9('0x47')][_0x08c9('0x55')]()[_0x08c9('0x2a')](respondWithResult(_0x41d6f8,null))[_0x08c9('0x49')](handleError(_0x41d6f8,null));};exports[_0x08c9('0x56')]=function(_0x42351c,_0x3cb066,_0x4b8aa8){if(_0x42351c['body']['id']){delete _0x42351c['body']['id'];}return db[_0x08c9('0x47')]['find']({'where':{'id':_0x42351c[_0x08c9('0x54')]['id']}})[_0x08c9('0x2a')](handleEntityNotFound(_0x3cb066,null))[_0x08c9('0x2a')](function(_0x524465){if(_0x524465){_0x42351c[_0x08c9('0x53')][_0x08c9('0x57')]=_0x524465['id'];return db[_0x08c9('0x58')][_0x08c9('0x4d')](_0x42351c[_0x08c9('0x53')]);}})[_0x08c9('0x2a')](respondWithResult(_0x3cb066,null))[_0x08c9('0x49')](handleError(_0x3cb066,null));};exports[_0x08c9('0x59')]=function(_0x86fef2,_0x5126bd,_0x17d4b6){var _0x5d3f44={'raw':![],'where':{}};var _0xabdf0c={};var _0x3eae0f={'count':0x0,'rows':[]};return db[_0x08c9('0x47')][_0x08c9('0x5a')]({'where':{'id':_0x86fef2[_0x08c9('0x54')]['id']}})['then'](handleEntityNotFound(_0x5126bd,null))[_0x08c9('0x2a')](function(_0x33d322){if(_0x33d322){_0xabdf0c[_0x08c9('0x38')]=_[_0x08c9('0x3a')](db[_0x08c9('0x58')][_0x08c9('0x34')]);_0xabdf0c[_0x08c9('0x39')]=_['keys'](_0x86fef2['query']);_0xabdf0c[_0x08c9('0x3b')]=_[_0x08c9('0x3d')](_0xabdf0c[_0x08c9('0x38')],_0xabdf0c[_0x08c9('0x39')]);_0x5d3f44[_0x08c9('0x3c')]=_[_0x08c9('0x3d')](_0xabdf0c[_0x08c9('0x38')],qs[_0x08c9('0x3e')](_0x86fef2[_0x08c9('0x39')][_0x08c9('0x3e')]));_0x5d3f44[_0x08c9('0x3c')]=_0x5d3f44[_0x08c9('0x3c')][_0x08c9('0x3f')]?_0x5d3f44['attributes']:_0xabdf0c['model'];if(!_0x86fef2[_0x08c9('0x39')][_0x08c9('0x5b')](_0x08c9('0x40'))){_0x5d3f44[_0x08c9('0x23')]=qs[_0x08c9('0x23')](_0x86fef2[_0x08c9('0x39')][_0x08c9('0x23')]);_0x5d3f44[_0x08c9('0x21')]=qs[_0x08c9('0x21')](_0x86fef2[_0x08c9('0x39')][_0x08c9('0x21')]);}_0x5d3f44[_0x08c9('0x41')]=qs[_0x08c9('0x42')](_0x86fef2[_0x08c9('0x39')][_0x08c9('0x42')]);_0x5d3f44[_0x08c9('0x43')]=qs[_0x08c9('0x3b')](_['pick'](_0x86fef2[_0x08c9('0x39')],_0xabdf0c[_0x08c9('0x3b')]));_0x5d3f44[_0x08c9('0x43')][_0x08c9('0x57')]=_0x33d322['id'];if(_0x86fef2[_0x08c9('0x39')][_0x08c9('0x44')]){_0x5d3f44[_0x08c9('0x43')]=_[_0x08c9('0x45')](_0x5d3f44[_0x08c9('0x43')],{'$or':_[_0x08c9('0x33')](_0x5d3f44[_0x08c9('0x3c')],function(_0x13a43e){var _0x2ae430={};_0x2ae430[_0x13a43e]={'$like':'%'+_0x86fef2[_0x08c9('0x39')]['filter']+'%'};return _0x2ae430;})});}_0x5d3f44=_[_0x08c9('0x45')]({},_0x5d3f44,_0x86fef2['options']);return db[_0x08c9('0x58')]['count']({'where':_0x5d3f44[_0x08c9('0x43')]})[_0x08c9('0x2a')](function(_0x4ae90f){_0x3eae0f[_0x08c9('0x24')]=_0x4ae90f;if(_0x86fef2[_0x08c9('0x39')][_0x08c9('0x48')]){_0x5d3f44[_0x08c9('0x4a')]=[{'all':!![]}];}return db[_0x08c9('0x58')]['findAll'](_0x5d3f44);})[_0x08c9('0x2a')](function(_0x3cd91a){_0x3eae0f[_0x08c9('0x5c')]=_0x3cd91a;return _0x3eae0f;});}})[_0x08c9('0x2a')](respondWithFilteredResult(_0x5126bd,_0x5d3f44))['catch'](handleError(_0x5126bd,null));};exports[_0x08c9('0x5d')]=function(_0x548ec4,_0x293581,_0x24d85d){return db[_0x08c9('0x47')][_0x08c9('0x4c')]({'where':{'id':_0x548ec4[_0x08c9('0x54')]['id']}})[_0x08c9('0x2a')](handleEntityNotFound(_0x293581,null))[_0x08c9('0x2a')](function(_0x4af04d){if(_0x4af04d){return _0x4af04d['removeDispositions'](_0x548ec4[_0x08c9('0x39')][_0x08c9('0x5e')]);}})[_0x08c9('0x2a')](respondWithStatusCode(_0x293581,null))[_0x08c9('0x49')](handleError(_0x293581,null));};exports['addContacts']=function(_0x1ec5d5,_0x4e276,_0xd24a92){return db[_0x08c9('0x47')][_0x08c9('0x4c')]({'where':{'id':_0x1ec5d5[_0x08c9('0x54')]['id']}})[_0x08c9('0x2a')](handleEntityNotFound(_0x4e276,null))[_0x08c9('0x2a')](function(_0x21c2f8){if(_0x21c2f8){var _0x25a681=[];var _0x3e569a={'success':[],'errors':[]};return db[_0x08c9('0x5f')][_0x08c9('0x55')]()[_0x08c9('0x2a')](function(_0x1ac9ea){if(_0x1ec5d5[_0x08c9('0x53')][_0x08c9('0x60')]&&_[_0x08c9('0x61')](_0x1ec5d5[_0x08c9('0x53')][_0x08c9('0x60')])){if(_0x1ec5d5[_0x08c9('0x53')][_0x08c9('0x60')][_0x08c9('0x3f')]){_0x1ec5d5['body']['tags']=_0x1ec5d5[_0x08c9('0x53')][_0x08c9('0x60')]['join'](';')+';';}else{_0x1ec5d5[_0x08c9('0x53')][_0x08c9('0x60')]=null;}}else{_0x1ec5d5['body']['tags']=null;}if(_0x1ec5d5[_0x08c9('0x53')]&&_[_0x08c9('0x61')](_0x1ec5d5['body'])){for(var _0x39c91c=0x0;_0x39c91c<_0x1ec5d5[_0x08c9('0x53')][_0x08c9('0x3f')];_0x39c91c+=0x1){_0x1ec5d5[_0x08c9('0x53')][_0x39c91c][_0x08c9('0x57')]=_0x1ec5d5[_0x08c9('0x54')]['id'];_0x25a681['push'](_0x1ec5d5['body'][_0x39c91c]);}return BPromise[_0x08c9('0x62')](_0x25a681,function(_0x4cd6a0){return db['CmContact']['create'](_['omit'](_0x4cd6a0,[_0x08c9('0x5e'),'id'])||{},{'fields':_[_0x08c9('0x3a')](_0x1ac9ea),'raw':!![]})[_0x08c9('0x2a')](function(_0x1783c5){_0x3e569a[_0x08c9('0x63')][_0x08c9('0x64')](_0x1783c5[_0x08c9('0x65')]);})['catch'](function(_0x2c4f02){_0x3e569a[_0x08c9('0x66')][_0x08c9('0x64')]({'data':_0x4cd6a0,'error':_0x2c4f02[_0x08c9('0x67')]});});})[_0x08c9('0x2a')](function(_0x57dd89){return _0x3e569a;})[_0x08c9('0x49')](function(_0x3f37bb){return _0x3f37bb;});}else{_0x4e276[_0x08c9('0x1f')](0x190)[_0x08c9('0x68')]({'message':_0x08c9('0x69')});}});}})[_0x08c9('0x2a')](respondWithResult(_0x4e276,null))['catch'](handleError(_0x4e276,null));};exports[_0x08c9('0x6a')]=function(_0x2b50c4,_0x1ef0e6,_0x428a1){var _0x39be48;return db[_0x08c9('0x47')][_0x08c9('0x4c')]({'where':{'id':_0x2b50c4['params']['id']},'include':[{'model':db[_0x08c9('0x6b')],'as':_0x08c9('0x6c')}]})[_0x08c9('0x2a')](handleEntityNotFound(_0x1ef0e6,null))['then'](function(_0x29fcfd){if(_0x29fcfd){_0x39be48=_0x29fcfd;return db[_0x08c9('0x5f')]['rawAttributes'];}})['then'](function(_0x2af83d){if(_0x2af83d){var _0xeb58aa={};var _0x2b56a7={};_0x2b56a7['model']=_[_0x08c9('0x6d')](_[_0x08c9('0x3a')](_0x2af83d),_['map'](_0x39be48['CustomFields'],function(_0x6be58e){return util[_0x08c9('0x6e')]('cf_%d',_0x6be58e['id']);}));_0x2b56a7[_0x08c9('0x39')]=_[_0x08c9('0x3a')](_0x2b50c4[_0x08c9('0x39')]);_0x2b56a7[_0x08c9('0x3b')]=_[_0x08c9('0x3d')](_0x2b56a7[_0x08c9('0x38')],_0x2b56a7[_0x08c9('0x39')]);_0xeb58aa[_0x08c9('0x3c')]=_[_0x08c9('0x3d')](_0x2b56a7[_0x08c9('0x38')],qs[_0x08c9('0x3e')](_0x2b50c4['query'][_0x08c9('0x3e')]));_0xeb58aa[_0x08c9('0x3c')]=_0xeb58aa['attributes']['length']?_0xeb58aa[_0x08c9('0x3c')]:_0x2b56a7['model'];if(!_0x2b50c4['query']['hasOwnProperty'](_0x08c9('0x40'))){_0xeb58aa[_0x08c9('0x23')]=qs[_0x08c9('0x23')](_0x2b50c4[_0x08c9('0x39')][_0x08c9('0x23')]);_0xeb58aa[_0x08c9('0x21')]=qs[_0x08c9('0x21')](_0x2b50c4['query']['offset']);}_0xeb58aa['order']=qs[_0x08c9('0x42')](_0x2b50c4['query'][_0x08c9('0x42')]);_0xeb58aa[_0x08c9('0x43')]=qs[_0x08c9('0x3b')](_[_0x08c9('0x6f')](_0x2b50c4['query'],_0x2b56a7[_0x08c9('0x3b')]));_0xeb58aa[_0x08c9('0x70')]=!![];if(_0x2b50c4[_0x08c9('0x39')][_0x08c9('0x44')]){_0xeb58aa[_0x08c9('0x43')]=_[_0x08c9('0x45')](_0xeb58aa[_0x08c9('0x43')],{'$or':_[_0x08c9('0x33')](_0xeb58aa['attributes'],function(_0x292bea){var _0x12155d={};_0x12155d[_0x292bea]={'$like':'%'+_0x2b50c4[_0x08c9('0x39')][_0x08c9('0x44')]+'%'};return _0x12155d;})});}_0xeb58aa=_[_0x08c9('0x45')]({},_0xeb58aa,_0x2b50c4[_0x08c9('0x4b')]);return _0x39be48['getContacts'](_0xeb58aa);}})['then'](respondWithResult(_0x1ef0e6,null))[_0x08c9('0x49')](handleError(_0x1ef0e6,null));};exports[_0x08c9('0x71')]=function(_0x11b1d5,_0x1f85b8,_0x292f8d){var _0x48135d;var _0x42a6f4;var _0xa2a123;var _0x1d04d4=_0x11b1d5[_0x08c9('0x54')]['id'];csv_results=[];return db[_0x08c9('0x72')][_0x08c9('0x73')]({'attributes':['id',_0x08c9('0x30')],'raw':!![],'order':[_0x08c9('0x74')]})[_0x08c9('0x2a')](function(_0x2446a7){_0x48135d=_0x2446a7;var _0x5127b7=_['keys'](db[_0x08c9('0x5f')][_0x08c9('0x34')]);return db[_0x08c9('0x6b')][_0x08c9('0x73')]({'raw':!![],'attributes':['id',_0x08c9('0x75')]})[_0x08c9('0x2a')](function(_0xe4daf0){_0x42a6f4=_0xe4daf0;var _0x21c09c=squel[_0x08c9('0x76')]()[_0x08c9('0x3e')](_0x5127b7)[_0x08c9('0x77')]('cm_contacts','c')[_0x08c9('0x43')](_0x08c9('0x78'),_0x1d04d4)[_0x08c9('0x43')](_0x08c9('0x79'))['distinct']();for(var _0x3a4e98=0x0;_0x3a4e98<_0x42a6f4[_0x08c9('0x3f')];_0x3a4e98++){_0x21c09c[_0x08c9('0x7a')](_0x08c9('0x7b')+_0x42a6f4[_0x3a4e98]['id'],_0x08c9('0x7c')+_0x42a6f4[_0x3a4e98][_0x08c9('0x75')]);}for(var _0x3a4e98=0x0;_0x3a4e98<_0x48135d[_0x08c9('0x3f')];_0x3a4e98++){_0x21c09c[_0x08c9('0x7a')](squel[_0x08c9('0x76')]()[_0x08c9('0x7a')](_0x08c9('0x7d'))[_0x08c9('0x77')](_0x08c9('0x7e'))['where']('ItemTypeId\x20=\x20?',_0x48135d[_0x3a4e98]['id'])['where'](_0x08c9('0x7f')),_0x08c9('0x80')+_0x48135d[_0x3a4e98][_0x08c9('0x30')]);_0x21c09c[_0x08c9('0x7a')](squel[_0x08c9('0x76')]()['field'](_0x08c9('0x81'))['from'](_0x08c9('0x7e'))['where'](_0x08c9('0x82'),_0x48135d[_0x3a4e98]['id'])[_0x08c9('0x43')](_0x08c9('0x7f')),_0x08c9('0x83')+_0x48135d[_0x3a4e98]['name']);}var _0x487608=[];_0x487608[_0x08c9('0x64')](_0x21c09c[_0x08c9('0x84')]());BPromise[_0x08c9('0x62')](_0x487608,handleQuery)[_0x08c9('0x2a')](function(_0x21d9d9){handleQuery(_0x21c09c[_0x08c9('0x84')]());var _0x41a655=csv_results[0x0];if(!_[_0x08c9('0x85')](_0x41a655)){var _0xb1bc7b=toCsv(_0x41a655);var _0x3a3929=Date[_0x08c9('0x86')]();fs['writeFileSync'](util[_0x08c9('0x6e')]('/tmp/list_%d_%s.csv',_0x1d04d4,_0x3a3929),_0xb1bc7b);_0x1f85b8[_0x08c9('0x87')]('Content-disposition','attachment;\x20filename='+util[_0x08c9('0x6e')](_0x08c9('0x88'),_0x1d04d4,_0x3a3929));_0x1f85b8[_0x08c9('0x87')](_0x08c9('0x89'),_0x08c9('0x8a'));return _0x1f85b8['download'](util[_0x08c9('0x6e')](_0x08c9('0x8b'),_0x1d04d4,_0x3a3929));}else{return _0x1f85b8['sendStatus'](0xcc);}});});});};exports['addCustomField']=function(_0x4f53ca,_0x32fc8a,_0x24bc8c){var _0x2056b5;delete _0x4f53ca[_0x08c9('0x53')]['id'];return db[_0x08c9('0x47')][_0x08c9('0x5a')]({'where':{'id':_0x4f53ca['params']['id']}})[_0x08c9('0x2a')](handleEntityNotFound(_0x32fc8a,null))[_0x08c9('0x2a')](function(_0x510c8f){if(_0x510c8f){return db[_0x08c9('0x8c')][_0x08c9('0x8d')](function(_0x3566c5){return db['CmCustomField'][_0x08c9('0x4d')](_0x4f53ca[_0x08c9('0x53')],{'transaction':_0x3566c5})[_0x08c9('0x2a')](function(_0x17e4a1){_0x2056b5=_0x17e4a1;return _0x510c8f[_0x08c9('0x8e')](_0x17e4a1,{'transaction':_0x3566c5});})[_0x08c9('0x2a')](function(){var _0x197543={'type':db['Sequelize'][_0x08c9('0x8f')],'transaction':_0x3566c5};switch(_0x4f53ca[_0x08c9('0x53')][_0x08c9('0x36')]){case'text':_0x197543['type']=db['Sequelize'][_0x08c9('0x8f')];break;case'number':_0x197543['type']=db[_0x08c9('0x90')]['INTEGER'];break;case _0x08c9('0x91'):_0x197543['type']=db[_0x08c9('0x90')][_0x08c9('0x92')];_0x197543['defaultValue']=![];break;default:}return db[_0x08c9('0x8c')][_0x08c9('0x93')][_0x08c9('0x94')](_0x08c9('0x95'),util[_0x08c9('0x6e')](_0x08c9('0x96'),_0x2056b5['id']),_0x197543);})[_0x08c9('0x2a')](function(){return _0x2056b5;});});}})[_0x08c9('0x2a')](respondWithResult(_0x32fc8a,null))['catch'](handleError(_0x32fc8a,null));};exports['getCustomFields']=function(_0x2280e5,_0x1da6dd,_0x5f4d54){var _0x10e851={};var _0x2b9368={};var _0x3d9880;var _0x48da72;return db[_0x08c9('0x47')][_0x08c9('0x5a')]({'where':{'id':_0x2280e5[_0x08c9('0x54')]['id']}})[_0x08c9('0x2a')](handleEntityNotFound(_0x1da6dd,null))['then'](function(_0x3190e8){if(_0x3190e8){_0x3d9880=_0x3190e8;_0x2b9368[_0x08c9('0x38')]=_[_0x08c9('0x3a')](db['CmCustomField'][_0x08c9('0x34')]);_0x2b9368['query']=_['keys'](_0x2280e5[_0x08c9('0x39')]);_0x2b9368[_0x08c9('0x3b')]=_[_0x08c9('0x3d')](_0x2b9368[_0x08c9('0x38')],_0x2b9368['query']);_0x10e851['attributes']=_[_0x08c9('0x3d')](_0x2b9368['model'],qs[_0x08c9('0x3e')](_0x2280e5[_0x08c9('0x39')][_0x08c9('0x3e')]));_0x10e851['attributes']=_0x10e851[_0x08c9('0x3c')][_0x08c9('0x3f')]?_0x10e851[_0x08c9('0x3c')]:_0x2b9368[_0x08c9('0x38')];_0x10e851['order']=qs[_0x08c9('0x42')](_0x2280e5['query'][_0x08c9('0x42')]);_0x10e851[_0x08c9('0x43')]=qs[_0x08c9('0x3b')](_[_0x08c9('0x6f')](_0x2280e5[_0x08c9('0x39')],_0x2b9368[_0x08c9('0x3b')]));_0x10e851['where']=_['merge'](_0x10e851[_0x08c9('0x43')],{'$or':[{'ListId':_0x3190e8['id']},{'ListId':null}]});if(_0x2280e5[_0x08c9('0x39')]['filter']){_0x10e851[_0x08c9('0x43')]=_['merge'](_0x10e851[_0x08c9('0x43')],{'$or':_['map'](_0x10e851['attributes'],function(_0x57f225){var _0x59fc09={};_0x59fc09[_0x57f225]={'$like':'%'+_0x2280e5[_0x08c9('0x39')][_0x08c9('0x44')]+'%'};return _0x59fc09;})});}_0x10e851=_[_0x08c9('0x45')]({},_0x10e851,_0x2280e5[_0x08c9('0x4b')]);return db[_0x08c9('0x6b')][_0x08c9('0x97')](_0x10e851);}})[_0x08c9('0x2a')](respondWithResult(_0x1da6dd,null))[_0x08c9('0x49')](handleError(_0x1da6dd,null));};exports[_0x08c9('0x98')]=function(_0x3c7919,_0x402f64){return db[_0x08c9('0x6b')]['findAndCountAll']({'where':{'ListId':null}})[_0x08c9('0x2a')](handleEntityNotFound(_0x402f64,null))[_0x08c9('0x2a')](function(_0x544a3d){return _0x544a3d;})[_0x08c9('0x2a')](respondWithResult(_0x402f64,null))[_0x08c9('0x49')](handleError(_0x402f64,null));};exports[_0x08c9('0x99')]=function(_0x75274d,_0x291122,_0x1842e9){return db[_0x08c9('0x47')]['find']({'where':{'id':_0x75274d['params']['id']}})[_0x08c9('0x2a')](handleEntityNotFound(_0x291122,null))['then'](function(_0x23c12c){if(_0x23c12c){return _0x23c12c[_0x08c9('0x99')](_0x75274d['body'][_0x08c9('0x5e')],_[_0x08c9('0x9a')](_0x75274d[_0x08c9('0x53')],[_0x08c9('0x5e'),'id'])||{})[_0x08c9('0x9b')](function(_0x5ec630){for(var _0x517ed0=0x0;_0x517ed0<_0x75274d[_0x08c9('0x53')][_0x08c9('0x5e')][_0x08c9('0x3f')];_0x517ed0+=0x1){socket['emit'](_0x08c9('0x9c'),{'UserId':Number(_0x75274d[_0x08c9('0x53')]['ids'][_0x517ed0]),'CmListId':Number(_0x75274d['params']['id'])});}return _0x5ec630;});}})[_0x08c9('0x2a')](respondWithResult(_0x291122,null))['catch'](handleError(_0x291122,null));};exports[_0x08c9('0x9d')]=function(_0x32555a,_0x4ea643,_0x498b89){return db['CmList'][_0x08c9('0x4c')]({'where':{'id':_0x32555a[_0x08c9('0x54')]['id']}})[_0x08c9('0x2a')](handleEntityNotFound(_0x4ea643,null))['then'](function(_0x1b1ad9){if(_0x1b1ad9){return _0x1b1ad9[_0x08c9('0x9d')](_0x32555a[_0x08c9('0x39')][_0x08c9('0x5e')])[_0x08c9('0x2a')](function(){if(_['isArray'](_0x32555a['query'][_0x08c9('0x5e')])){for(var _0x3858b2=0x0;_0x3858b2<_0x32555a['query'][_0x08c9('0x5e')][_0x08c9('0x3f')];_0x3858b2+=0x1){socket[_0x08c9('0x9e')](_0x08c9('0x9f'),{'UserId':Number(_0x32555a['query'][_0x08c9('0x5e')][_0x3858b2]),'CmListId':Number(_0x32555a[_0x08c9('0x54')]['id'])});}}else{socket['emit'](_0x08c9('0x9f'),{'UserId':Number(_0x32555a['query'][_0x08c9('0x5e')]),'CmListId':Number(_0x32555a[_0x08c9('0x54')]['id'])});}});}})[_0x08c9('0x2a')](respondWithStatusCode(_0x4ea643,null))[_0x08c9('0x49')](handleError(_0x4ea643,null));};exports[_0x08c9('0xa0')]=function(_0xd23b63,_0x498d80,_0x34d908){var _0x15d1b0={};var _0x2764b7={};var _0x2b4e83;var _0x3628f8;return db['CmList'][_0x08c9('0x5a')]({'where':{'id':_0xd23b63[_0x08c9('0x54')]['id']}})[_0x08c9('0x2a')](handleEntityNotFound(_0x498d80,null))[_0x08c9('0x2a')](function(_0x5b9a75){if(_0x5b9a75){_0x2b4e83=_0x5b9a75;_0x2764b7[_0x08c9('0x38')]=_[_0x08c9('0x3a')](db[_0x08c9('0xa1')][_0x08c9('0x34')]);_0x2764b7[_0x08c9('0x39')]=_['keys'](_0xd23b63[_0x08c9('0x39')]);_0x2764b7['filters']=_['intersection'](_0x2764b7[_0x08c9('0x38')],_0x2764b7[_0x08c9('0x39')]);_0x15d1b0[_0x08c9('0x3c')]=_[_0x08c9('0x3d')](_0x2764b7['model'],qs[_0x08c9('0x3e')](_0xd23b63[_0x08c9('0x39')][_0x08c9('0x3e')]));_0x15d1b0[_0x08c9('0x3c')]=_0x15d1b0[_0x08c9('0x3c')][_0x08c9('0x3f')]?_0x15d1b0[_0x08c9('0x3c')]:_0x2764b7[_0x08c9('0x38')];_0x15d1b0[_0x08c9('0x41')]=qs[_0x08c9('0x42')](_0xd23b63[_0x08c9('0x39')][_0x08c9('0x42')]);_0x15d1b0['where']=qs['filters'](_[_0x08c9('0x6f')](_0xd23b63[_0x08c9('0x39')],_0x2764b7[_0x08c9('0x3b')]));if(_0xd23b63[_0x08c9('0x39')][_0x08c9('0x44')]){_0x15d1b0[_0x08c9('0x43')]=_[_0x08c9('0x45')](_0x15d1b0[_0x08c9('0x43')],{'$or':_['map'](_0x15d1b0['attributes'],function(_0x5b6a6a){var _0x3e54a2={};_0x3e54a2[_0x5b6a6a]={'$like':'%'+_0xd23b63[_0x08c9('0x39')]['filter']+'%'};return _0x3e54a2;})});}_0x15d1b0=_[_0x08c9('0x45')]({},_0x15d1b0,_0xd23b63[_0x08c9('0x4b')]);return _0x2b4e83[_0x08c9('0xa0')](_0x15d1b0);}})[_0x08c9('0x2a')](function(_0x593f17){if(_0x593f17){_0x3628f8=_0x593f17['length'];if(!_0xd23b63['query'][_0x08c9('0x5b')](_0x08c9('0x40'))){_0x15d1b0['limit']=qs[_0x08c9('0x23')](_0xd23b63[_0x08c9('0x39')]['limit']);_0x15d1b0[_0x08c9('0x21')]=qs[_0x08c9('0x21')](_0xd23b63['query'][_0x08c9('0x21')]);}return _0x2b4e83[_0x08c9('0xa0')](_0x15d1b0);}})[_0x08c9('0x2a')](function(_0x84f9d2){if(_0x84f9d2){return _0x84f9d2?{'count':_0x3628f8,'rows':_0x84f9d2}:null;}})['then'](respondWithResult(_0x498d80,null))[_0x08c9('0x49')](handleError(_0x498d80,null));};function handleQuery(_0xb28d31){logger['info'](_0xb28d31);return db['sequelize'][_0x08c9('0x39')](_0xb28d31)['spread'](function(_0xf80f32){csv_results['push'](_0xf80f32);})[_0x08c9('0x49')](function(_0x34f7bb){logger[_0x08c9('0x2e')](_0x34f7bb[_0x08c9('0x67')]);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index ba111cb..c4066db 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 _0x3e74=['hasOwnProperty','exports','events','CmList','setMaxListeners','save','emit'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x3e74,0x175));var _0x43e7=function(_0x570e02,_0xa2431d){_0x570e02=_0x570e02-0x0;var _0x42ee3a=_0x3e74[_0x570e02];return _0x42ee3a;};'use strict';var EventEmitter=require(_0x43e7('0x0'));var CmList=require('../../mysqldb')['db'][_0x43e7('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x43e7('0x2')](0x0);var events={'afterCreate':_0x43e7('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xc58479){return function(_0x4f9bbe,_0x128b0f,_0xe838b4){CmListEvents[_0x43e7('0x4')](_0xc58479+':'+_0x4f9bbe['id'],_0x4f9bbe);CmListEvents[_0x43e7('0x4')](_0xc58479,_0x4f9bbe);_0xe838b4(null);};}for(var e in events){if(events[_0x43e7('0x5')](e)){var event=events[e];CmList['hook'](e,emitEvent(event));}}module[_0x43e7('0x6')]=CmListEvents; \ No newline at end of file +var _0x55ca=['events','../../mysqldb','update','remove','emit','hasOwnProperty','hook'];(function(_0x11a220,_0x4e470a){var _0x20d8fe=function(_0xbedfd){while(--_0xbedfd){_0x11a220['push'](_0x11a220['shift']());}};_0x20d8fe(++_0x4e470a);}(_0x55ca,0x126));var _0xa55c=function(_0x4eb3ec,_0x51b871){_0x4eb3ec=_0x4eb3ec-0x0;var _0x1a3de8=_0x55ca[_0x4eb3ec];return _0x1a3de8;};'use strict';var EventEmitter=require(_0xa55c('0x0'));var CmList=require(_0xa55c('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa55c('0x2'),'afterDestroy':_0xa55c('0x3')};function emitEvent(_0x5dc716){return function(_0x3b478a,_0x2db02a,_0xcb02e3){CmListEvents[_0xa55c('0x4')](_0x5dc716+':'+_0x3b478a['id'],_0x3b478a);CmListEvents[_0xa55c('0x4')](_0x5dc716,_0x3b478a);_0xcb02e3(null);};}for(var e in events){if(events[_0xa55c('0x5')](e)){var event=events[e];CmList[_0xa55c('0x6')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 8fdc61e..f66b044 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 _0xb821=['rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','cm_lists','util','../../config/logger','bluebird'];(function(_0xb6c378,_0x352e16){var _0x5803dd=function(_0x45d8f4){while(--_0x45d8f4){_0xb6c378['push'](_0xb6c378['shift']());}};_0x5803dd(++_0x352e16);}(_0xb821,0xa7));var _0x1b82=function(_0x389902,_0x3567d6){_0x389902=_0x389902-0x0;var _0x40c764=_0xb821[_0x389902];return _0x40c764;};'use strict';var _=require('lodash');var util=require(_0x1b82('0x0'));var logger=require(_0x1b82('0x1'))('api');var moment=require('moment');var BPromise=require(_0x1b82('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1b82('0x3'));var config=require(_0x1b82('0x4'));var attributes=require(_0x1b82('0x5'));module[_0x1b82('0x6')]=function(_0x597ca7,_0x3e27c4){return _0x597ca7[_0x1b82('0x7')](_0x1b82('0x8'),attributes,{'tableName':_0x1b82('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9c44=['request-promise','path','./cmList.attributes','define','CmList','cm_lists','../../config/logger','api','moment','bluebird'];(function(_0x115695,_0x5f5614){var _0x1f52a7=function(_0xc64d32){while(--_0xc64d32){_0x115695['push'](_0x115695['shift']());}};_0x1f52a7(++_0x5f5614);}(_0x9c44,0x178));var _0x49c4=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x9c44[_0x16b9ed];return _0x66b1f8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x49c4('0x0'))(_0x49c4('0x1'));var moment=require(_0x49c4('0x2'));var BPromise=require(_0x49c4('0x3'));var rp=require(_0x49c4('0x4'));var fs=require('fs');var path=require(_0x49c4('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x49c4('0x6'));module['exports']=function(_0xc1278f,_0x6030ae){return _0xc1278f[_0x49c4('0x7')](_0x49c4('0x8'),attributes,{'tableName':_0x49c4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index 4872bda..407baf4 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 _0x9a82=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','defaults','redis','localhost','./cmList.socket','register','request','info','CmList,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','util','randomstring','ioredis'];(function(_0x1856ef,_0x532113){var _0x5cd781=function(_0x3e3fec){while(--_0x3e3fec){_0x1856ef['push'](_0x1856ef['shift']());}};_0x5cd781(++_0x532113);}(_0x9a82,0x6f));var _0x29a8=function(_0x2d36a9,_0x37c17f){_0x2d36a9=_0x2d36a9-0x0;var _0x47977c=_0x9a82[_0x2d36a9];return _0x47977c;};'use strict';var _=require(_0x29a8('0x0'));var util=require(_0x29a8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x29a8('0x2'));var fs=require('fs');var Redis=require(_0x29a8('0x3'));var db=require(_0x29a8('0x4'))['db'];var utils=require(_0x29a8('0x5'));var logger=require(_0x29a8('0x6'))('rpc');var config=require(_0x29a8('0x7'));var jayson=require(_0x29a8('0x8'));var client=jayson['client'][_0x29a8('0x9')]({'port':0x232a});config['redis']=_[_0x29a8('0xa')](config[_0x29a8('0xb')],{'host':_0x29a8('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x29a8('0xd'))[_0x29a8('0xe')](socket);function respondWithRpcPromise(_0x381675,_0x3dbf42,_0x5b72b6){return new BPromise(function(_0x237c69,_0x556fd6){return client[_0x29a8('0xf')](_0x381675,_0x5b72b6)['then'](function(_0x3c238e){logger[_0x29a8('0x10')](_0x29a8('0x11'),_0x3dbf42,_0x29a8('0x12'));logger['debug']('CmList,\x20%s,\x20%s,\x20%s',_0x3dbf42,_0x29a8('0x12'),JSON['stringify'](_0x3c238e));if(_0x3c238e['error']){if(_0x3c238e[_0x29a8('0x13')][_0x29a8('0x14')]===0x1f4){logger[_0x29a8('0x13')](_0x29a8('0x11'),_0x3dbf42,_0x3c238e[_0x29a8('0x13')][_0x29a8('0x15')]);return _0x556fd6(_0x3c238e[_0x29a8('0x13')][_0x29a8('0x15')]);}logger[_0x29a8('0x13')](_0x29a8('0x11'),_0x3dbf42,_0x3c238e[_0x29a8('0x13')][_0x29a8('0x15')]);return _0x237c69(_0x3c238e[_0x29a8('0x13')]['message']);}else{logger[_0x29a8('0x10')](_0x29a8('0x11'),_0x3dbf42,_0x29a8('0x12'));_0x237c69(_0x3c238e[_0x29a8('0x16')][_0x29a8('0x15')]);}})['catch'](function(_0x561f2b){logger['error'](_0x29a8('0x11'),_0x3dbf42,_0x561f2b);_0x556fd6(_0x561f2b);});});} \ No newline at end of file +var _0x19cf=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','redis','defaults','localhost','socket.io-emitter','request','then','info','request\x20sent','debug','stringify','error','code','message','CmList,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird'];(function(_0x496de8,_0x5c898d){var _0x5e2d4d=function(_0x551702){while(--_0x551702){_0x496de8['push'](_0x496de8['shift']());}};_0x5e2d4d(++_0x5c898d);}(_0x19cf,0x7e));var _0xf19c=function(_0x4e9c43,_0x1ab794){_0x4e9c43=_0x4e9c43-0x0;var _0x223254=_0x19cf[_0x4e9c43];return _0x223254;};'use strict';var _=require(_0xf19c('0x0'));var util=require(_0xf19c('0x1'));var moment=require(_0xf19c('0x2'));var BPromise=require(_0xf19c('0x3'));var rs=require(_0xf19c('0x4'));var fs=require('fs');var Redis=require(_0xf19c('0x5'));var db=require(_0xf19c('0x6'))['db'];var utils=require(_0xf19c('0x7'));var logger=require(_0xf19c('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf19c('0x9')]['http']({'port':0x232a});config[_0xf19c('0xa')]=_[_0xf19c('0xb')](config[_0xf19c('0xa')],{'host':_0xf19c('0xc'),'port':0x18eb});var socket=require(_0xf19c('0xd'))(new Redis(config[_0xf19c('0xa')]));require('./cmList.socket')['register'](socket);function respondWithRpcPromise(_0x3969d4,_0x519ef0,_0xc29a9e){return new BPromise(function(_0xc84f35,_0x4ee354){return client[_0xf19c('0xe')](_0x3969d4,_0xc29a9e)[_0xf19c('0xf')](function(_0x6ecdce){logger[_0xf19c('0x10')]('CmList,\x20%s,\x20%s',_0x519ef0,_0xf19c('0x11'));logger[_0xf19c('0x12')]('CmList,\x20%s,\x20%s,\x20%s',_0x519ef0,_0xf19c('0x11'),JSON[_0xf19c('0x13')](_0x6ecdce));if(_0x6ecdce[_0xf19c('0x14')]){if(_0x6ecdce[_0xf19c('0x14')][_0xf19c('0x15')]===0x1f4){logger['error']('CmList,\x20%s,\x20%s',_0x519ef0,_0x6ecdce[_0xf19c('0x14')][_0xf19c('0x16')]);return _0x4ee354(_0x6ecdce[_0xf19c('0x14')]['message']);}logger[_0xf19c('0x14')](_0xf19c('0x17'),_0x519ef0,_0x6ecdce[_0xf19c('0x14')][_0xf19c('0x16')]);return _0xc84f35(_0x6ecdce['error'][_0xf19c('0x16')]);}else{logger[_0xf19c('0x10')](_0xf19c('0x17'),_0x519ef0,_0xf19c('0x11'));_0xc84f35(_0x6ecdce[_0xf19c('0x18')][_0xf19c('0x16')]);}})[_0xf19c('0x19')](function(_0x4fce3b){logger[_0xf19c('0x14')](_0xf19c('0x17'),_0x519ef0,_0x4fce3b);_0x4ee354(_0x4fce3b);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 119ff9f..9443073 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 _0x9561=['remove','update','emit','removeListener','length','./cmList.events','save'];(function(_0x3aedd0,_0x3ffda5){var _0xbda51c=function(_0x26e47a){while(--_0x26e47a){_0x3aedd0['push'](_0x3aedd0['shift']());}};_0xbda51c(++_0x3ffda5);}(_0x9561,0x17f));var _0x1956=function(_0x4db537,_0x53a37b){_0x4db537=_0x4db537-0x0;var _0x25d062=_0x9561[_0x4db537];return _0x25d062;};'use strict';var CmListEvents=require(_0x1956('0x0'));var events=[_0x1956('0x1'),_0x1956('0x2'),_0x1956('0x3')];function createListener(_0x34afe3,_0x1201f5){return function(_0x20a960){_0x1201f5[_0x1956('0x4')](_0x34afe3,_0x20a960);};}function removeListener(_0x5dad6c,_0x252f01){return function(){CmListEvents[_0x1956('0x5')](_0x5dad6c,_0x252f01);};}exports['register']=function(_0x15676e){for(var _0x1ab67f=0x0,_0x500e9a=events[_0x1956('0x6')];_0x1ab67f<_0x500e9a;_0x1ab67f++){var _0x3201d9=events[_0x1ab67f];var _0x596295=createListener('cmList:'+_0x3201d9,_0x15676e);CmListEvents['on'](_0x3201d9,_0x596295);}}; \ No newline at end of file +var _0xaa78=['cmList:','./cmList.events','save','remove','emit','register','length'];(function(_0x273d90,_0x5ba87e){var _0x2c1889=function(_0x48cb36){while(--_0x48cb36){_0x273d90['push'](_0x273d90['shift']());}};_0x2c1889(++_0x5ba87e);}(_0xaa78,0x94));var _0x8aa7=function(_0x24c405,_0x56d6fb){_0x24c405=_0x24c405-0x0;var _0x383aef=_0xaa78[_0x24c405];return _0x383aef;};'use strict';var CmListEvents=require(_0x8aa7('0x0'));var events=[_0x8aa7('0x1'),_0x8aa7('0x2'),'update'];function createListener(_0x3de71a,_0x1c4888){return function(_0x2a2589){_0x1c4888[_0x8aa7('0x3')](_0x3de71a,_0x2a2589);};}function removeListener(_0x28f5a3,_0x1bb070){return function(){CmListEvents['removeListener'](_0x28f5a3,_0x1bb070);};}exports[_0x8aa7('0x4')]=function(_0x3b2030){for(var _0x5f382e=0x0,_0x26edac=events[_0x8aa7('0x5')];_0x5f382e<_0x26edac;_0x5f382e++){var _0x403488=events[_0x5f382e];var _0x3e12fb=createListener(_0x8aa7('0x6')+_0x403488,_0x3b2030);CmListEvents['on'](_0x403488,_0x3e12fb);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 0baa279..a63f28c 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 _0x4977=['isAuthenticated','index','/describe','describe','/global_fields','getGlobalCustomFields','/:id','show','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','getCustomFields','getAgents','post','create','addDisposition','addContacts','/:id/fields','addCustomField','addAgents','put','update','delete','destroy','removeDispositions','/:id/users','removeAgents','exports','util','path','Router','fs-extra','../../components/auth/service','./cmList.controller','get'];(function(_0x24f5d2,_0x114f1b){var _0x14fb3f=function(_0x342f53){while(--_0x342f53){_0x24f5d2['push'](_0x24f5d2['shift']());}};_0x14fb3f(++_0x114f1b);}(_0x4977,0x103));var _0x7497=function(_0xfdf75e,_0x12a18e){_0xfdf75e=_0xfdf75e-0x0;var _0x4833b9=_0x4977[_0xfdf75e];return _0x4833b9;};'use strict';var multer=require('multer');var util=require(_0x7497('0x0'));var path=require(_0x7497('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7497('0x2')]();var fs_extra=require(_0x7497('0x3'));var auth=require(_0x7497('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7497('0x5'));router[_0x7497('0x6')]('/',auth[_0x7497('0x7')](),controller[_0x7497('0x8')]);router['get'](_0x7497('0x9'),auth[_0x7497('0x7')](),controller[_0x7497('0xa')]);router[_0x7497('0x6')](_0x7497('0xb'),auth[_0x7497('0x7')](),controller[_0x7497('0xc')]);router[_0x7497('0x6')](_0x7497('0xd'),auth[_0x7497('0x7')](),controller[_0x7497('0xe')]);router[_0x7497('0x6')](_0x7497('0xf'),auth['isAuthenticated'](),controller[_0x7497('0x10')]);router[_0x7497('0x6')](_0x7497('0x11'),auth[_0x7497('0x7')](),controller[_0x7497('0x12')]);router[_0x7497('0x6')](_0x7497('0x13'),auth[_0x7497('0x7')](),controller[_0x7497('0x14')]);router['get']('/:id/fields',auth[_0x7497('0x7')](),controller[_0x7497('0x15')]);router['get']('/:id/users',auth[_0x7497('0x7')](),controller[_0x7497('0x16')]);router[_0x7497('0x17')]('/',auth[_0x7497('0x7')](),controller[_0x7497('0x18')]);router[_0x7497('0x17')](_0x7497('0xf'),auth[_0x7497('0x7')](),controller[_0x7497('0x19')]);router['post'](_0x7497('0x11'),auth[_0x7497('0x7')](),controller[_0x7497('0x1a')]);router[_0x7497('0x17')](_0x7497('0x1b'),auth[_0x7497('0x7')](),controller[_0x7497('0x1c')]);router[_0x7497('0x17')]('/:id/users',auth[_0x7497('0x7')](),controller[_0x7497('0x1d')]);router[_0x7497('0x1e')](_0x7497('0xd'),auth[_0x7497('0x7')](),controller[_0x7497('0x1f')]);router[_0x7497('0x20')]('/:id',auth[_0x7497('0x7')](),controller[_0x7497('0x21')]);router[_0x7497('0x20')](_0x7497('0xf'),auth[_0x7497('0x7')](),controller[_0x7497('0x22')]);router[_0x7497('0x20')](_0x7497('0x23'),auth[_0x7497('0x7')](),controller[_0x7497('0x24')]);module[_0x7497('0x25')]=router; \ No newline at end of file +var _0x72b1=['put','update','delete','destroy','removeDispositions','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','get','isAuthenticated','index','describe','/global_fields','getGlobalCustomFields','/:id','show','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','/:id/fields','getCustomFields','/:id/users','getAgents','post','create','addDisposition','addContacts','addCustomField'];(function(_0x2b9b7f,_0x4d47df){var _0x4ed19a=function(_0x72b5ff){while(--_0x72b5ff){_0x2b9b7f['push'](_0x2b9b7f['shift']());}};_0x4ed19a(++_0x4d47df);}(_0x72b1,0x103));var _0x172b=function(_0x332941,_0x2a2455){_0x332941=_0x332941-0x0;var _0x33429a=_0x72b1[_0x332941];return _0x33429a;};'use strict';var multer=require(_0x172b('0x0'));var util=require(_0x172b('0x1'));var path=require(_0x172b('0x2'));var timeout=require(_0x172b('0x3'));var express=require(_0x172b('0x4'));var router=express[_0x172b('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x172b('0x6'));var config=require('../../config/environment');var controller=require('./cmList.controller');router[_0x172b('0x7')]('/',auth[_0x172b('0x8')](),controller[_0x172b('0x9')]);router[_0x172b('0x7')]('/describe',auth[_0x172b('0x8')](),controller[_0x172b('0xa')]);router[_0x172b('0x7')](_0x172b('0xb'),auth[_0x172b('0x8')](),controller[_0x172b('0xc')]);router[_0x172b('0x7')](_0x172b('0xd'),auth[_0x172b('0x8')](),controller[_0x172b('0xe')]);router[_0x172b('0x7')](_0x172b('0xf'),auth[_0x172b('0x8')](),controller[_0x172b('0x10')]);router[_0x172b('0x7')](_0x172b('0x11'),auth[_0x172b('0x8')](),controller[_0x172b('0x12')]);router[_0x172b('0x7')](_0x172b('0x13'),auth[_0x172b('0x8')](),controller['getContactsCsv']);router[_0x172b('0x7')](_0x172b('0x14'),auth['isAuthenticated'](),controller[_0x172b('0x15')]);router['get'](_0x172b('0x16'),auth['isAuthenticated'](),controller[_0x172b('0x17')]);router[_0x172b('0x18')]('/',auth[_0x172b('0x8')](),controller[_0x172b('0x19')]);router[_0x172b('0x18')](_0x172b('0xf'),auth[_0x172b('0x8')](),controller[_0x172b('0x1a')]);router[_0x172b('0x18')](_0x172b('0x11'),auth[_0x172b('0x8')](),controller[_0x172b('0x1b')]);router[_0x172b('0x18')](_0x172b('0x14'),auth[_0x172b('0x8')](),controller[_0x172b('0x1c')]);router[_0x172b('0x18')]('/:id/users',auth[_0x172b('0x8')](),controller['addAgents']);router[_0x172b('0x1d')]('/:id',auth[_0x172b('0x8')](),controller[_0x172b('0x1e')]);router[_0x172b('0x1f')]('/:id',auth['isAuthenticated'](),controller[_0x172b('0x20')]);router[_0x172b('0x1f')](_0x172b('0xf'),auth[_0x172b('0x8')](),controller[_0x172b('0x21')]);router[_0x172b('0x1f')](_0x172b('0x16'),auth[_0x172b('0x8')](),controller[_0x172b('0x22')]);module[_0x172b('0x23')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 59adea0..aae6139 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 _0xd9eb=['sequelize','VIRTUAL','getDataValue','field','STRING'];(function(_0x56df36,_0x563414){var _0x5138c7=function(_0x419a23){while(--_0x419a23){_0x56df36['push'](_0x56df36['shift']());}};_0x5138c7(++_0x563414);}(_0xd9eb,0xc8));var _0xbd9e=function(_0x198541,_0x2e1dea){_0x198541=_0x198541-0x0;var _0x24c19a=_0xd9eb[_0x198541];return _0x24c19a;};'use strict';var Sequelize=require(_0xbd9e('0x0'));module['exports']={'name':{'type':Sequelize[_0xbd9e('0x1')],'get':function(_0x54d9f4){return this[_0xbd9e('0x2')](_0xbd9e('0x3'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0xbd9e('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0xbd9e('0x4')],'allowNull':![]}}; \ No newline at end of file +var _0xd906=['field','STRING','sequelize','VIRTUAL','getDataValue'];(function(_0x5945d3,_0x42c4a1){var _0xe3819a=function(_0x41c155){while(--_0x41c155){_0x5945d3['push'](_0x5945d3['shift']());}};_0xe3819a(++_0x42c4a1);}(_0xd906,0x11f));var _0x6d90=function(_0x5eb542,_0x382306){_0x5eb542=_0x5eb542-0x0;var _0x17d20b=_0xd906[_0x5eb542];return _0x17d20b;};'use strict';var Sequelize=require(_0x6d90('0x0'));module['exports']={'name':{'type':Sequelize[_0x6d90('0x1')],'get':function(_0x5dd72b){return this[_0x6d90('0x2')](_0x6d90('0x3'));}},'field':{'type':Sequelize[_0x6d90('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0x6d90('0x4')],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 361d0a8..66331d4 100644 --- a/server/api/condition/condition.controller.js +++ b/server/api/condition/condition.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0xae6d30,_0x5d51c1){var _0x17d489=function(_0x5480d5){while(--_0x5480d5){_0xae6d30['push'](_0xae6d30['shift']());}};_0x17d489(++_0x5d51c1);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file +var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x1691f8,_0xe81cf8){var _0x5c834c=function(_0x50a245){while(--_0x50a245){_0x1691f8['push'](_0x1691f8['shift']());}};_0x5c834c(++_0xe81cf8);}(_0x7a54,0x106));var _0x47a5=function(_0x552a54,_0x3bf4d8){_0x552a54=_0x552a54-0x0;var _0x12acd8=_0x7a54[_0x552a54];return _0x12acd8;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 8546c90..b66844c 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 _0x5157=['api','moment','bluebird','request-promise','path','./condition.attributes','define','Condition','tools_conditions','util','../../config/logger'];(function(_0x576133,_0x3e9d11){var _0x16da3c=function(_0x274b05){while(--_0x274b05){_0x576133['push'](_0x576133['shift']());}};_0x16da3c(++_0x3e9d11);}(_0x5157,0x77));var _0x7515=function(_0x35853b,_0x396bed){_0x35853b=_0x35853b-0x0;var _0x284eef=_0x5157[_0x35853b];return _0x284eef;};'use strict';var _=require('lodash');var util=require(_0x7515('0x0'));var logger=require(_0x7515('0x1'))(_0x7515('0x2'));var moment=require(_0x7515('0x3'));var BPromise=require(_0x7515('0x4'));var rp=require(_0x7515('0x5'));var fs=require('fs');var path=require(_0x7515('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7515('0x7'));module['exports']=function(_0x5b62d2,_0x334300){return _0x5b62d2[_0x7515('0x8')](_0x7515('0x9'),attributes,{'tableName':_0x7515('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa6b8=['util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./condition.attributes','tools_conditions','lodash'];(function(_0x51c819,_0xd812db){var _0x15c5d2=function(_0x2977f0){while(--_0x2977f0){_0x51c819['push'](_0x51c819['shift']());}};_0x15c5d2(++_0xd812db);}(_0xa6b8,0x1a3));var _0x8a6b=function(_0x1579be,_0x4f5834){_0x1579be=_0x1579be-0x0;var _0x4f4837=_0xa6b8[_0x1579be];return _0x4f4837;};'use strict';var _=require(_0x8a6b('0x0'));var util=require(_0x8a6b('0x1'));var logger=require(_0x8a6b('0x2'))('api');var moment=require(_0x8a6b('0x3'));var BPromise=require(_0x8a6b('0x4'));var rp=require(_0x8a6b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8a6b('0x6'));var config=require(_0x8a6b('0x7'));var attributes=require(_0x8a6b('0x8'));module['exports']=function(_0x22ec87,_0x46ebdd){return _0x22ec87['define']('Condition',attributes,{'tableName':_0x8a6b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/condition/condition.rpc.js b/server/api/condition/condition.rpc.js index 7a61d3e..1b0121d 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 _0xa265=['rpc','jayson/promise','client','http','request','then','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','Condition,\x20%s,\x20%s','message','info','request\x20sent','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x9657be,_0x2a7995){var _0x267e2b=function(_0x467c27){while(--_0x467c27){_0x9657be['push'](_0x9657be['shift']());}};_0x267e2b(++_0x2a7995);}(_0xa265,0x19f));var _0x5a26=function(_0x2d49e2,_0x14d19e){_0x2d49e2=_0x2d49e2-0x0;var _0x228572=_0xa265[_0x2d49e2];return _0x228572;};'use strict';var _=require('lodash');var util=require(_0x5a26('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5a26('0x1'));var fs=require('fs');var Redis=require(_0x5a26('0x2'));var db=require(_0x5a26('0x3'))['db'];var utils=require(_0x5a26('0x4'));var logger=require('../../config/logger')(_0x5a26('0x5'));var config=require('../../config/environment');var jayson=require(_0x5a26('0x6'));var client=jayson[_0x5a26('0x7')][_0x5a26('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5c4fb5,_0xa40007,_0x5da180){return new BPromise(function(_0x142620,_0xea7347){return client[_0x5a26('0x9')](_0x5c4fb5,_0x5da180)[_0x5a26('0xa')](function(_0x1a0bdb){logger['info']('Condition,\x20%s,\x20%s',_0xa40007,'request\x20sent');logger['debug'](_0x5a26('0xb'),_0xa40007,'request\x20sent',JSON[_0x5a26('0xc')](_0x1a0bdb));if(_0x1a0bdb[_0x5a26('0xd')]){if(_0x1a0bdb[_0x5a26('0xd')][_0x5a26('0xe')]===0x1f4){logger['error'](_0x5a26('0xf'),_0xa40007,_0x1a0bdb[_0x5a26('0xd')]['message']);return _0xea7347(_0x1a0bdb['error']['message']);}logger[_0x5a26('0xd')](_0x5a26('0xf'),_0xa40007,_0x1a0bdb[_0x5a26('0xd')][_0x5a26('0x10')]);return _0x142620(_0x1a0bdb['error']['message']);}else{logger[_0x5a26('0x11')]('Condition,\x20%s,\x20%s',_0xa40007,_0x5a26('0x12'));_0x142620(_0x1a0bdb[_0x5a26('0x13')][_0x5a26('0x10')]);}})[_0x5a26('0x14')](function(_0xf1fe07){logger['error'](_0x5a26('0xf'),_0xa40007,_0xf1fe07);_0xea7347(_0xf1fe07);});});} \ No newline at end of file +var _0x1fdc=['request\x20sent','debug','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Condition,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1fdc,0x139));var _0xc1fd=function(_0x45d1fd,_0x463212){_0x45d1fd=_0x45d1fd-0x0;var _0xd0e542=_0x1fdc[_0x45d1fd];return _0xd0e542;};'use strict';var _=require(_0xc1fd('0x0'));var util=require(_0xc1fd('0x1'));var moment=require(_0xc1fd('0x2'));var BPromise=require(_0xc1fd('0x3'));var rs=require(_0xc1fd('0x4'));var fs=require('fs');var Redis=require(_0xc1fd('0x5'));var db=require(_0xc1fd('0x6'))['db'];var utils=require(_0xc1fd('0x7'));var logger=require(_0xc1fd('0x8'))(_0xc1fd('0x9'));var config=require(_0xc1fd('0xa'));var jayson=require(_0xc1fd('0xb'));var client=jayson[_0xc1fd('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x572c10,_0x1486fc,_0x47ed83){return new BPromise(function(_0x571839,_0x4d8b33){return client[_0xc1fd('0xd')](_0x572c10,_0x47ed83)[_0xc1fd('0xe')](function(_0x14e879){logger[_0xc1fd('0xf')](_0xc1fd('0x10'),_0x1486fc,_0xc1fd('0x11'));logger[_0xc1fd('0x12')]('Condition,\x20%s,\x20%s,\x20%s',_0x1486fc,_0xc1fd('0x11'),JSON['stringify'](_0x14e879));if(_0x14e879[_0xc1fd('0x13')]){if(_0x14e879['error'][_0xc1fd('0x14')]===0x1f4){logger[_0xc1fd('0x13')](_0xc1fd('0x10'),_0x1486fc,_0x14e879[_0xc1fd('0x13')][_0xc1fd('0x15')]);return _0x4d8b33(_0x14e879[_0xc1fd('0x13')][_0xc1fd('0x15')]);}logger[_0xc1fd('0x13')](_0xc1fd('0x10'),_0x1486fc,_0x14e879[_0xc1fd('0x13')][_0xc1fd('0x15')]);return _0x571839(_0x14e879[_0xc1fd('0x13')][_0xc1fd('0x15')]);}else{logger[_0xc1fd('0xf')](_0xc1fd('0x10'),_0x1486fc,'request\x20sent');_0x571839(_0x14e879['result'][_0xc1fd('0x15')]);}})['catch'](function(_0x5e3f0c){logger[_0xc1fd('0x13')]('Condition,\x20%s,\x20%s',_0x1486fc,_0x5e3f0c);_0x4d8b33(_0x5e3f0c);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index f59347c..59492cc 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 _0x9988=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./condition.controller','put','/:id','isAuthenticated','update','delete','exports'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x9988,0x177));var _0x8998=function(_0x34e725,_0x5633f8){_0x34e725=_0x34e725-0x0;var _0x57acc4=_0x9988[_0x34e725];return _0x57acc4;};'use strict';var multer=require(_0x8998('0x0'));var util=require(_0x8998('0x1'));var path=require(_0x8998('0x2'));var timeout=require(_0x8998('0x3'));var express=require(_0x8998('0x4'));var router=express[_0x8998('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x8998('0x6'));var interaction=require(_0x8998('0x7'));var config=require('../../config/environment');var controller=require(_0x8998('0x8'));router[_0x8998('0x9')](_0x8998('0xa'),auth[_0x8998('0xb')](),controller[_0x8998('0xc')]);router[_0x8998('0xd')](_0x8998('0xa'),auth[_0x8998('0xb')](),controller['destroy']);module[_0x8998('0xe')]=router; \ No newline at end of file +var _0xa25d=['./condition.controller','/:id','update','delete','destroy','multer','util','path','Router','fs-extra'];(function(_0x1f9ff4,_0x1b6639){var _0x14f992=function(_0x1782fd){while(--_0x1782fd){_0x1f9ff4['push'](_0x1f9ff4['shift']());}};_0x14f992(++_0x1b6639);}(_0xa25d,0x1c7));var _0xda25=function(_0xbc550a,_0x2bb605){_0xbc550a=_0xbc550a-0x0;var _0xd16ba4=_0xa25d[_0xbc550a];return _0xd16ba4;};'use strict';var multer=require(_0xda25('0x0'));var util=require(_0xda25('0x1'));var path=require(_0xda25('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xda25('0x3')]();var fs_extra=require(_0xda25('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xda25('0x5'));router['put'](_0xda25('0x6'),auth['isAuthenticated'](),controller[_0xda25('0x7')]);router[_0xda25('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xda25('0x9')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js index c2d039f..b1368a3 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 _0xed3e=['sequelize','exports','STRING','name'];(function(_0x1be878,_0x529cda){var _0x234e56=function(_0x48c1c4){while(--_0x48c1c4){_0x1be878['push'](_0x1be878['shift']());}};_0x234e56(++_0x529cda);}(_0xed3e,0x1a0));var _0xeed3=function(_0xf96708,_0x2f8b23){_0xf96708=_0xf96708-0x0;var _0x2166db=_0xed3e[_0xf96708];return _0x2166db;};'use strict';var Sequelize=require(_0xeed3('0x0'));module[_0xeed3('0x1')]={'name':{'type':Sequelize[_0xeed3('0x2')],'allowNull':![],'unique':_0xeed3('0x3')},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0xeed3('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0xeb40=['name','INTEGER','sequelize','STRING'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0xeb40,0x176));var _0x0eb4=function(_0x468b0f,_0x408566){_0x468b0f=_0x468b0f-0x0;var _0x3e74d9=_0xeb40[_0x468b0f];return _0x3e74d9;};'use strict';var Sequelize=require(_0x0eb4('0x0'));module['exports']={'name':{'type':Sequelize[_0x0eb4('0x1')],'allowNull':![],'unique':_0x0eb4('0x2')},'OrderBy':{'type':Sequelize[_0x0eb4('0x3')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x0eb4('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 4e42122..bb12e09 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 _0x5f66=['fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','sort','where','filters','filter','merge','options','ContactItemType','include','findAll','rows','catch','show','params','rawAttributes','length','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','ContactItemTypes','UserProfileResource','name','send','index','map'];(function(_0xcf3265,_0x1bdac1){var _0x5bf268=function(_0x2bf060){while(--_0x2bf060){_0xcf3265['push'](_0xcf3265['shift']());}};_0x5bf268(++_0x1bdac1);}(_0x5f66,0x1a0));var _0x65f6=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x5f66[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65f6('0x1'));var rp=require(_0x65f6('0x2'));var moment=require(_0x65f6('0x3'));var BPromise=require(_0x65f6('0x4'));var Mustache=require(_0x65f6('0x5'));var util=require('util');var path=require(_0x65f6('0x6'));var sox=require('sox');var csv=require(_0x65f6('0x7'));var ejs=require(_0x65f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x7'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x65f6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419819,_0x4862a5){_0x4862a5=_0x4862a5||0xcc;return function(_0x2f964a){if(_0x2f964a){return _0x419819[_0x65f6('0x14')](_0x4862a5);}return _0x419819[_0x65f6('0x15')](_0x4862a5)[_0x65f6('0x16')]();};}function respondWithResult(_0x369f96,_0x1d29fd){_0x1d29fd=_0x1d29fd||0xc8;return function(_0x44144b){if(_0x44144b){return _0x369f96[_0x65f6('0x15')](_0x1d29fd)[_0x65f6('0x17')](_0x44144b);}};}function respondWithFilteredResult(_0x3440af,_0x59154e){return function(_0x19b9ff){if(_0x19b9ff){var _0x49a913=typeof _0x59154e['offset']===_0x65f6('0x18')&&typeof _0x59154e[_0x65f6('0x19')]===_0x65f6('0x18');var _0x1c955c=_0x19b9ff[_0x65f6('0x1a')];var _0x1f974c=_0x49a913?0x0:_0x59154e[_0x65f6('0x1b')];var _0x18380e=_0x49a913?_0x19b9ff['count']:_0x59154e['offset']+_0x59154e[_0x65f6('0x19')];var _0x5b4055;if(_0x18380e>=_0x1c955c){_0x18380e=_0x1c955c;_0x5b4055=0xc8;}else{_0x5b4055=0xce;}_0x3440af['status'](_0x5b4055);return _0x3440af['set'](_0x65f6('0x1c'),_0x1f974c+'-'+_0x18380e+'/'+_0x1c955c)[_0x65f6('0x17')](_0x19b9ff);}return null;};}function patchUpdates(_0x5114a4){return function(_0x39e19f){try{jsonpatch[_0x65f6('0x1d')](_0x39e19f,_0x5114a4,!![]);}catch(_0xbee6a4){return BPromise[_0x65f6('0x1e')](_0xbee6a4);}return _0x39e19f[_0x65f6('0x1f')]();};}function saveUpdates(_0xc139c2,_0x581374){return function(_0x197a49){if(_0x197a49){return _0x197a49['update'](_0xc139c2)['then'](function(_0x212247){return _0x212247;});}return null;};}function removeEntity(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(_0x1eeaaa){return _0x1eeaaa[_0x65f6('0x20')]()[_0x65f6('0x21')](function(){var _0x2774a1=_0x1eeaaa['get']({'plain':!![]});var _0x9d7bb0=_0x65f6('0x22');return db[_0x65f6('0x23')]['destroy']({'where':{'type':_0x9d7bb0,'resourceId':_0x2774a1['id']}})['then'](function(){return _0x1eeaaa;});})['then'](function(){_0xd173f4[_0x65f6('0x15')](0xcc)[_0x65f6('0x16')]();});}};}function handleEntityNotFound(_0x4b2292,_0x296cd9){return function(_0x28f710){if(!_0x28f710){_0x4b2292['sendStatus'](0x194);}return _0x28f710;};}function handleError(_0x325cb4,_0x2bff2b){_0x2bff2b=_0x2bff2b||0x1f4;return function(_0x28d0df){logger['error'](_0x28d0df['stack']);if(_0x28d0df['name']){delete _0x28d0df[_0x65f6('0x24')];}_0x325cb4[_0x65f6('0x15')](_0x2bff2b)[_0x65f6('0x25')](_0x28d0df);};}exports[_0x65f6('0x26')]=function(_0x518cac,_0x14a387){var _0x144e55={},_0x4ace4c={},_0x4ea23d={'count':0x0,'rows':[]};var _0x154cbd=_[_0x65f6('0x27')](db['ContactItemType']['rawAttributes'],function(_0x10b368){return{'name':_0x10b368[_0x65f6('0x28')],'type':_0x10b368[_0x65f6('0x29')][_0x65f6('0x2a')]};});_0x4ace4c[_0x65f6('0x2b')]=_[_0x65f6('0x27')](_0x154cbd,'name');_0x4ace4c[_0x65f6('0x2c')]=_[_0x65f6('0x2d')](_0x518cac[_0x65f6('0x2c')]);_0x4ace4c['filters']=_[_0x65f6('0x2e')](_0x4ace4c[_0x65f6('0x2b')],_0x4ace4c[_0x65f6('0x2c')]);_0x144e55[_0x65f6('0x2f')]=_[_0x65f6('0x2e')](_0x4ace4c[_0x65f6('0x2b')],qs['fields'](_0x518cac[_0x65f6('0x2c')][_0x65f6('0x30')]));_0x144e55['attributes']=_0x144e55[_0x65f6('0x2f')]['length']?_0x144e55[_0x65f6('0x2f')]:_0x4ace4c['model'];if(!_0x518cac[_0x65f6('0x2c')][_0x65f6('0x31')]('nolimit')){_0x144e55[_0x65f6('0x19')]=qs[_0x65f6('0x19')](_0x518cac[_0x65f6('0x2c')]['limit']);_0x144e55['offset']=qs[_0x65f6('0x1b')](_0x518cac['query'][_0x65f6('0x1b')]);}_0x144e55['order']=qs[_0x65f6('0x32')](_0x518cac[_0x65f6('0x2c')]['sort']);_0x144e55[_0x65f6('0x33')]=qs['filters'](_['pick'](_0x518cac[_0x65f6('0x2c')],_0x4ace4c[_0x65f6('0x34')]),_0x154cbd);if(_0x518cac[_0x65f6('0x2c')][_0x65f6('0x35')]){_0x144e55[_0x65f6('0x33')]=_[_0x65f6('0x36')](_0x144e55[_0x65f6('0x33')],{'$or':_[_0x65f6('0x27')](_0x154cbd,function(_0x4f933b){if(_0x4f933b[_0x65f6('0x29')]!=='VIRTUAL'){var _0x12a589={};_0x12a589[_0x4f933b[_0x65f6('0x24')]]={'$like':'%'+_0x518cac[_0x65f6('0x2c')][_0x65f6('0x35')]+'%'};return _0x12a589;}})});}_0x144e55=_['merge']({},_0x144e55,_0x518cac[_0x65f6('0x37')]);var _0x1d6421={'where':_0x144e55[_0x65f6('0x33')]};return db[_0x65f6('0x38')][_0x65f6('0x1a')](_0x1d6421)[_0x65f6('0x21')](function(_0xed4c96){_0x4ea23d[_0x65f6('0x1a')]=_0xed4c96;if(_0x518cac[_0x65f6('0x2c')]['includeAll']){_0x144e55[_0x65f6('0x39')]=[{'all':!![]}];}return db[_0x65f6('0x38')][_0x65f6('0x3a')](_0x144e55);})[_0x65f6('0x21')](function(_0x83e2d9){_0x4ea23d[_0x65f6('0x3b')]=_0x83e2d9;return _0x4ea23d;})[_0x65f6('0x21')](respondWithFilteredResult(_0x14a387,_0x144e55))[_0x65f6('0x3c')](handleError(_0x14a387,null));};exports[_0x65f6('0x3d')]=function(_0x2abbed,_0xcf19da){var _0x2c008a={'raw':!![],'where':{'id':_0x2abbed[_0x65f6('0x3e')]['id']}},_0x6c4d94={};_0x6c4d94[_0x65f6('0x2b')]=_[_0x65f6('0x2d')](db['ContactItemType'][_0x65f6('0x3f')]);_0x6c4d94[_0x65f6('0x2c')]=_[_0x65f6('0x2d')](_0x2abbed[_0x65f6('0x2c')]);_0x6c4d94['filters']=_[_0x65f6('0x2e')](_0x6c4d94[_0x65f6('0x2b')],_0x6c4d94[_0x65f6('0x2c')]);_0x2c008a['attributes']=_[_0x65f6('0x2e')](_0x6c4d94[_0x65f6('0x2b')],qs[_0x65f6('0x30')](_0x2abbed[_0x65f6('0x2c')]['fields']));_0x2c008a[_0x65f6('0x2f')]=_0x2c008a['attributes'][_0x65f6('0x40')]?_0x2c008a[_0x65f6('0x2f')]:_0x6c4d94['model'];if(_0x2abbed[_0x65f6('0x2c')]['includeAll']){_0x2c008a[_0x65f6('0x39')]=[{'all':!![]}];}_0x2c008a=_[_0x65f6('0x36')]({},_0x2c008a,_0x2abbed[_0x65f6('0x37')]);return db[_0x65f6('0x38')][_0x65f6('0x41')](_0x2c008a)[_0x65f6('0x21')](handleEntityNotFound(_0xcf19da,null))['then'](respondWithResult(_0xcf19da,null))['catch'](handleError(_0xcf19da,null));};exports[_0x65f6('0x42')]=function(_0x15d3ba,_0x3b647a){return db[_0x65f6('0x38')][_0x65f6('0x42')](_0x15d3ba[_0x65f6('0x43')],{})[_0x65f6('0x21')](function(_0x41690c){var _0x414f49=_0x15d3ba['user'][_0x65f6('0x44')]({'plain':!![]});if(!_0x414f49)throw new Error(_0x65f6('0x45'));if(_0x414f49[_0x65f6('0x46')]==='user'){var _0x47e749=_0x41690c[_0x65f6('0x44')]({'plain':!![]});var _0x49ba5a=_0x65f6('0x22');return db[_0x65f6('0x47')]['find']({'where':{'name':_0x49ba5a,'userProfileId':_0x414f49[_0x65f6('0x48')]},'raw':!![]})['then'](function(_0x247be3){if(_0x247be3&&_0x247be3[_0x65f6('0x49')]===0x0){return db[_0x65f6('0x23')]['create']({'name':_0x47e749[_0x65f6('0x24')],'resourceId':_0x47e749['id'],'type':_0x247be3[_0x65f6('0x24')],'sectionId':_0x247be3['id']},{})['then'](function(){return _0x41690c;});}else{return _0x41690c;}})[_0x65f6('0x3c')](function(_0x34312c){logger['error'](_0x65f6('0x4a'),_0x34312c);throw _0x34312c;});}return _0x41690c;})[_0x65f6('0x21')](respondWithResult(_0x3b647a,0xc9))[_0x65f6('0x3c')](handleError(_0x3b647a,null));};exports[_0x65f6('0x4b')]=function(_0x234fa7,_0x2350ca){if(_0x234fa7[_0x65f6('0x43')]['id']){delete _0x234fa7[_0x65f6('0x43')]['id'];}return db['ContactItemType']['find']({'where':{'id':_0x234fa7['params']['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x2350ca,null))[_0x65f6('0x21')](saveUpdates(_0x234fa7[_0x65f6('0x43')],null))[_0x65f6('0x21')](respondWithResult(_0x2350ca,null))['catch'](handleError(_0x2350ca,null));};exports[_0x65f6('0x20')]=function(_0x2032b9,_0x9ff849){return db['ContactItemType'][_0x65f6('0x41')]({'where':{'id':_0x2032b9[_0x65f6('0x3e')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x9ff849,null))['then'](db['CmContactHasItem'][_0x65f6('0x4b')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x2032b9[_0x65f6('0x3e')]['id']}}))[_0x65f6('0x21')](removeEntity(_0x9ff849,null))[_0x65f6('0x3c')](handleError(_0x9ff849,null));}; \ No newline at end of file +var _0x3d04=['nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','rows','show','params','rawAttributes','merge','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','ContactItemTypes','end','error','stack','name','send','map','ContactItemType','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty'];(function(_0x56d5d5,_0x3c7526){var _0x8ca113=function(_0xfd2f05){while(--_0xfd2f05){_0x56d5d5['push'](_0x56d5d5['shift']());}};_0x8ca113(++_0x3c7526);}(_0x3d04,0xbe));var _0x43d0=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x3d04[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x43d0('0x0'));var rimraf=require(_0x43d0('0x1'));var zipdir=require(_0x43d0('0x2'));var jsonpatch=require(_0x43d0('0x3'));var rp=require(_0x43d0('0x4'));var moment=require(_0x43d0('0x5'));var BPromise=require(_0x43d0('0x6'));var Mustache=require(_0x43d0('0x7'));var util=require('util');var path=require(_0x43d0('0x8'));var sox=require(_0x43d0('0x9'));var csv=require(_0x43d0('0xa'));var ejs=require(_0x43d0('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x43d0('0xc'));var deskjs=require(_0x43d0('0xd'));var toCsv=require(_0x43d0('0xa'));var querystring=require(_0x43d0('0xe'));var Papa=require(_0x43d0('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43d0('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x43d0('0x11'))(_0x43d0('0x12'));var utils=require(_0x43d0('0x13'));var config=require(_0x43d0('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x43d0('0x15'))['db'];function respondWithStatusCode(_0x23daaa,_0x546b23){_0x546b23=_0x546b23||0xcc;return function(_0x29773b){if(_0x29773b){return _0x23daaa[_0x43d0('0x16')](_0x546b23);}return _0x23daaa[_0x43d0('0x17')](_0x546b23)['end']();};}function respondWithResult(_0xd262a8,_0x2454fa){_0x2454fa=_0x2454fa||0xc8;return function(_0x436130){if(_0x436130){return _0xd262a8['status'](_0x2454fa)[_0x43d0('0x18')](_0x436130);}};}function respondWithFilteredResult(_0x357f87,_0x44e6ec){return function(_0x1218b5){if(_0x1218b5){var _0x91b4a1=typeof _0x44e6ec['offset']==='undefined'&&typeof _0x44e6ec[_0x43d0('0x19')]===_0x43d0('0x1a');var _0x35decf=_0x1218b5['count'];var _0x2c641e=_0x91b4a1?0x0:_0x44e6ec['offset'];var _0x2c9d06=_0x91b4a1?_0x1218b5[_0x43d0('0x1b')]:_0x44e6ec[_0x43d0('0x1c')]+_0x44e6ec['limit'];var _0x3d7dcc;if(_0x2c9d06>=_0x35decf){_0x2c9d06=_0x35decf;_0x3d7dcc=0xc8;}else{_0x3d7dcc=0xce;}_0x357f87[_0x43d0('0x17')](_0x3d7dcc);return _0x357f87['set'](_0x43d0('0x1d'),_0x2c641e+'-'+_0x2c9d06+'/'+_0x35decf)[_0x43d0('0x18')](_0x1218b5);}return null;};}function patchUpdates(_0x348429){return function(_0x248622){try{jsonpatch[_0x43d0('0x1e')](_0x248622,_0x348429,!![]);}catch(_0x28381b){return BPromise[_0x43d0('0x1f')](_0x28381b);}return _0x248622[_0x43d0('0x20')]();};}function saveUpdates(_0x30febc,_0xc8a644){return function(_0xec5f07){if(_0xec5f07){return _0xec5f07[_0x43d0('0x21')](_0x30febc)[_0x43d0('0x22')](function(_0xbc72e6){return _0xbc72e6;});}return null;};}function removeEntity(_0x2efd77,_0x48aa18){return function(_0x2c7b24){if(_0x2c7b24){return _0x2c7b24[_0x43d0('0x23')]()['then'](function(){var _0x1fe708=_0x2c7b24['get']({'plain':!![]});var _0x29c111=_0x43d0('0x24');return db['UserProfileResource'][_0x43d0('0x23')]({'where':{'type':_0x29c111,'resourceId':_0x1fe708['id']}})[_0x43d0('0x22')](function(){return _0x2c7b24;});})['then'](function(){_0x2efd77[_0x43d0('0x17')](0xcc)[_0x43d0('0x25')]();});}};}function handleEntityNotFound(_0x22ae3c,_0x5f16ac){return function(_0x447725){if(!_0x447725){_0x22ae3c[_0x43d0('0x16')](0x194);}return _0x447725;};}function handleError(_0x2c4f3f,_0x1eb771){_0x1eb771=_0x1eb771||0x1f4;return function(_0x37d78f){logger[_0x43d0('0x26')](_0x37d78f[_0x43d0('0x27')]);if(_0x37d78f['name']){delete _0x37d78f[_0x43d0('0x28')];}_0x2c4f3f[_0x43d0('0x17')](_0x1eb771)[_0x43d0('0x29')](_0x37d78f);};}exports['index']=function(_0x4bfce9,_0x52c37b){var _0x3c1ea3={},_0x2db9dc={},_0x10086b={'count':0x0,'rows':[]};var _0x13e3c9=_[_0x43d0('0x2a')](db[_0x43d0('0x2b')]['rawAttributes'],function(_0x77654d){return{'name':_0x77654d[_0x43d0('0x2c')],'type':_0x77654d[_0x43d0('0x2d')][_0x43d0('0x2e')]};});_0x2db9dc[_0x43d0('0x2f')]=_[_0x43d0('0x2a')](_0x13e3c9,_0x43d0('0x28'));_0x2db9dc[_0x43d0('0x30')]=_[_0x43d0('0x31')](_0x4bfce9[_0x43d0('0x30')]);_0x2db9dc[_0x43d0('0x32')]=_['intersection'](_0x2db9dc[_0x43d0('0x2f')],_0x2db9dc[_0x43d0('0x30')]);_0x3c1ea3[_0x43d0('0x33')]=_[_0x43d0('0x34')](_0x2db9dc['model'],qs[_0x43d0('0x35')](_0x4bfce9['query'][_0x43d0('0x35')]));_0x3c1ea3[_0x43d0('0x33')]=_0x3c1ea3['attributes'][_0x43d0('0x36')]?_0x3c1ea3[_0x43d0('0x33')]:_0x2db9dc[_0x43d0('0x2f')];if(!_0x4bfce9[_0x43d0('0x30')][_0x43d0('0x37')](_0x43d0('0x38'))){_0x3c1ea3[_0x43d0('0x19')]=qs[_0x43d0('0x19')](_0x4bfce9[_0x43d0('0x30')][_0x43d0('0x19')]);_0x3c1ea3[_0x43d0('0x1c')]=qs['offset'](_0x4bfce9[_0x43d0('0x30')][_0x43d0('0x1c')]);}_0x3c1ea3[_0x43d0('0x39')]=qs[_0x43d0('0x3a')](_0x4bfce9[_0x43d0('0x30')][_0x43d0('0x3a')]);_0x3c1ea3[_0x43d0('0x3b')]=qs[_0x43d0('0x32')](_[_0x43d0('0x3c')](_0x4bfce9[_0x43d0('0x30')],_0x2db9dc[_0x43d0('0x32')]),_0x13e3c9);if(_0x4bfce9[_0x43d0('0x30')][_0x43d0('0x3d')]){_0x3c1ea3[_0x43d0('0x3b')]=_['merge'](_0x3c1ea3[_0x43d0('0x3b')],{'$or':_[_0x43d0('0x2a')](_0x13e3c9,function(_0x38f330){if(_0x38f330[_0x43d0('0x2d')]!==_0x43d0('0x3e')){var _0x1e6c8b={};_0x1e6c8b[_0x38f330[_0x43d0('0x28')]]={'$like':'%'+_0x4bfce9[_0x43d0('0x30')]['filter']+'%'};return _0x1e6c8b;}})});}_0x3c1ea3=_['merge']({},_0x3c1ea3,_0x4bfce9[_0x43d0('0x3f')]);var _0x5ad2d0={'where':_0x3c1ea3['where']};return db[_0x43d0('0x2b')]['count'](_0x5ad2d0)[_0x43d0('0x22')](function(_0x5027d0){_0x10086b[_0x43d0('0x1b')]=_0x5027d0;if(_0x4bfce9['query'][_0x43d0('0x40')]){_0x3c1ea3[_0x43d0('0x41')]=[{'all':!![]}];}return db[_0x43d0('0x2b')]['findAll'](_0x3c1ea3);})[_0x43d0('0x22')](function(_0x520406){_0x10086b[_0x43d0('0x42')]=_0x520406;return _0x10086b;})['then'](respondWithFilteredResult(_0x52c37b,_0x3c1ea3))['catch'](handleError(_0x52c37b,null));};exports[_0x43d0('0x43')]=function(_0xcb5a02,_0x4d539f){var _0x2f2ac9={'raw':!![],'where':{'id':_0xcb5a02[_0x43d0('0x44')]['id']}},_0x1c87bc={};_0x1c87bc[_0x43d0('0x2f')]=_[_0x43d0('0x31')](db['ContactItemType'][_0x43d0('0x45')]);_0x1c87bc[_0x43d0('0x30')]=_[_0x43d0('0x31')](_0xcb5a02[_0x43d0('0x30')]);_0x1c87bc['filters']=_[_0x43d0('0x34')](_0x1c87bc[_0x43d0('0x2f')],_0x1c87bc[_0x43d0('0x30')]);_0x2f2ac9[_0x43d0('0x33')]=_[_0x43d0('0x34')](_0x1c87bc['model'],qs[_0x43d0('0x35')](_0xcb5a02[_0x43d0('0x30')]['fields']));_0x2f2ac9[_0x43d0('0x33')]=_0x2f2ac9[_0x43d0('0x33')][_0x43d0('0x36')]?_0x2f2ac9['attributes']:_0x1c87bc[_0x43d0('0x2f')];if(_0xcb5a02['query'][_0x43d0('0x40')]){_0x2f2ac9['include']=[{'all':!![]}];}_0x2f2ac9=_[_0x43d0('0x46')]({},_0x2f2ac9,_0xcb5a02[_0x43d0('0x3f')]);return db[_0x43d0('0x2b')][_0x43d0('0x47')](_0x2f2ac9)[_0x43d0('0x22')](handleEntityNotFound(_0x4d539f,null))['then'](respondWithResult(_0x4d539f,null))[_0x43d0('0x48')](handleError(_0x4d539f,null));};exports['create']=function(_0x5a6364,_0x3e7392){return db[_0x43d0('0x2b')][_0x43d0('0x49')](_0x5a6364[_0x43d0('0x4a')],{})[_0x43d0('0x22')](function(_0x3685cf){var _0x36c9d0=_0x5a6364[_0x43d0('0x4b')][_0x43d0('0x4c')]({'plain':!![]});if(!_0x36c9d0)throw new Error(_0x43d0('0x4d'));if(_0x36c9d0[_0x43d0('0x4e')]==='user'){var _0x338203=_0x3685cf[_0x43d0('0x4c')]({'plain':!![]});var _0x1503bc='ContactItemTypes';return db[_0x43d0('0x4f')]['find']({'where':{'name':_0x1503bc,'userProfileId':_0x36c9d0['userProfileId']},'raw':!![]})[_0x43d0('0x22')](function(_0x29a14a){if(_0x29a14a&&_0x29a14a[_0x43d0('0x50')]===0x0){return db[_0x43d0('0x51')][_0x43d0('0x49')]({'name':_0x338203['name'],'resourceId':_0x338203['id'],'type':_0x29a14a['name'],'sectionId':_0x29a14a['id']},{})[_0x43d0('0x22')](function(){return _0x3685cf;});}else{return _0x3685cf;}})['catch'](function(_0x32aab0){logger[_0x43d0('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x32aab0);throw _0x32aab0;});}return _0x3685cf;})['then'](respondWithResult(_0x3e7392,0xc9))['catch'](handleError(_0x3e7392,null));};exports[_0x43d0('0x21')]=function(_0x126863,_0x3d89d4){if(_0x126863[_0x43d0('0x4a')]['id']){delete _0x126863[_0x43d0('0x4a')]['id'];}return db[_0x43d0('0x2b')][_0x43d0('0x47')]({'where':{'id':_0x126863[_0x43d0('0x44')]['id']}})[_0x43d0('0x22')](handleEntityNotFound(_0x3d89d4,null))['then'](saveUpdates(_0x126863[_0x43d0('0x4a')],null))[_0x43d0('0x22')](respondWithResult(_0x3d89d4,null))[_0x43d0('0x48')](handleError(_0x3d89d4,null));};exports[_0x43d0('0x23')]=function(_0x44feea,_0x5e341f){return db[_0x43d0('0x2b')][_0x43d0('0x47')]({'where':{'id':_0x44feea[_0x43d0('0x44')]['id']}})[_0x43d0('0x22')](handleEntityNotFound(_0x5e341f,null))['then'](db['CmContactHasItem'][_0x43d0('0x21')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x44feea[_0x43d0('0x44')]['id']}}))[_0x43d0('0x22')](removeEntity(_0x5e341f,null))[_0x43d0('0x48')](handleError(_0x5e341f,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index 83c6f36..825de26 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 _0x1cc1=['api','moment','request-promise','rimraf','./contactItemType.attributes','exports','define','lodash','util','../../config/logger'];(function(_0x5d9b01,_0x287296){var _0x4d672c=function(_0x48173c){while(--_0x48173c){_0x5d9b01['push'](_0x5d9b01['shift']());}};_0x4d672c(++_0x287296);}(_0x1cc1,0x6b));var _0x11cc=function(_0x3c2fb1,_0x4e2450){_0x3c2fb1=_0x3c2fb1-0x0;var _0x4128cb=_0x1cc1[_0x3c2fb1];return _0x4128cb;};'use strict';var _=require(_0x11cc('0x0'));var util=require(_0x11cc('0x1'));var logger=require(_0x11cc('0x2'))(_0x11cc('0x3'));var moment=require(_0x11cc('0x4'));var BPromise=require('bluebird');var rp=require(_0x11cc('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x11cc('0x6'));var config=require('../../config/environment');var attributes=require(_0x11cc('0x7'));module[_0x11cc('0x8')]=function(_0x2b6e4f,_0x17fa77){return _0x2b6e4f[_0x11cc('0x9')]('ContactItemType',attributes,{'tableName':'tools_contact_item_types','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaeb6=['util','../../config/logger','api','moment','request-promise','path','rimraf','exports','define','tools_contact_item_types','lodash'];(function(_0x3caa91,_0x328bc0){var _0x309c51=function(_0x5be276){while(--_0x5be276){_0x3caa91['push'](_0x3caa91['shift']());}};_0x309c51(++_0x328bc0);}(_0xaeb6,0x180));var _0x6aeb=function(_0x270e70,_0x5344ae){_0x270e70=_0x270e70-0x0;var _0x26f003=_0xaeb6[_0x270e70];return _0x26f003;};'use strict';var _=require(_0x6aeb('0x0'));var util=require(_0x6aeb('0x1'));var logger=require(_0x6aeb('0x2'))(_0x6aeb('0x3'));var moment=require(_0x6aeb('0x4'));var BPromise=require('bluebird');var rp=require(_0x6aeb('0x5'));var fs=require('fs');var path=require(_0x6aeb('0x6'));var rimraf=require(_0x6aeb('0x7'));var config=require('../../config/environment');var attributes=require('./contactItemType.attributes');module[_0x6aeb('0x8')]=function(_0x264e12,_0x5f5b6b){return _0x264e12[_0x6aeb('0x9')]('ContactItemType',attributes,{'tableName':_0x6aeb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.rpc.js b/server/api/contactItemType/contactItemType.rpc.js index b83c02a..7506cda 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 _0x518b=['info','request\x20sent','debug','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','code','ContactItemType,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','client','http','then'];(function(_0xcaf223,_0xd39f07){var _0x17e00d=function(_0xe2852e){while(--_0xe2852e){_0xcaf223['push'](_0xcaf223['shift']());}};_0x17e00d(++_0xd39f07);}(_0x518b,0x15b));var _0xb518=function(_0x284e5f,_0x130a54){_0x284e5f=_0x284e5f-0x0;var _0x86d83=_0x518b[_0x284e5f];return _0x86d83;};'use strict';var _=require(_0xb518('0x0'));var util=require(_0xb518('0x1'));var moment=require(_0xb518('0x2'));var BPromise=require(_0xb518('0x3'));var rs=require(_0xb518('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb518('0x5'))(_0xb518('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb518('0x7')][_0xb518('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x17d6b9,_0x1ee23d,_0x7f21a2){return new BPromise(function(_0x47e3a0,_0x334fa5){return client['request'](_0x17d6b9,_0x7f21a2)[_0xb518('0x9')](function(_0x5002e3){logger[_0xb518('0xa')]('ContactItemType,\x20%s,\x20%s',_0x1ee23d,_0xb518('0xb'));logger[_0xb518('0xc')](_0xb518('0xd'),_0x1ee23d,_0xb518('0xb'),JSON[_0xb518('0xe')](_0x5002e3));if(_0x5002e3[_0xb518('0xf')]){if(_0x5002e3[_0xb518('0xf')][_0xb518('0x10')]===0x1f4){logger[_0xb518('0xf')](_0xb518('0x11'),_0x1ee23d,_0x5002e3[_0xb518('0xf')][_0xb518('0x12')]);return _0x334fa5(_0x5002e3[_0xb518('0xf')]['message']);}logger[_0xb518('0xf')](_0xb518('0x11'),_0x1ee23d,_0x5002e3[_0xb518('0xf')][_0xb518('0x12')]);return _0x47e3a0(_0x5002e3['error']['message']);}else{logger[_0xb518('0xa')](_0xb518('0x11'),_0x1ee23d,'request\x20sent');_0x47e3a0(_0x5002e3[_0xb518('0x13')]['message']);}})[_0xb518('0x14')](function(_0x51ae68){logger[_0xb518('0xf')](_0xb518('0x11'),_0x1ee23d,_0x51ae68);_0x334fa5(_0x51ae68);});});} \ No newline at end of file +var _0xbb8b=['ContactItemType,\x20%s,\x20%s','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info'];(function(_0x3b6e4c,_0x30864c){var _0x340e69=function(_0x3cf8b0){while(--_0x3cf8b0){_0x3b6e4c['push'](_0x3b6e4c['shift']());}};_0x340e69(++_0x30864c);}(_0xbb8b,0x1e8));var _0xbbb8=function(_0x658086,_0x2b369a){_0x658086=_0x658086-0x0;var _0x118a11=_0xbb8b[_0x658086];return _0x118a11;};'use strict';var _=require(_0xbbb8('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xbbb8('0x1'));var rs=require(_0xbbb8('0x2'));var fs=require('fs');var Redis=require(_0xbbb8('0x3'));var db=require(_0xbbb8('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xbbb8('0x5'))(_0xbbb8('0x6'));var config=require(_0xbbb8('0x7'));var jayson=require(_0xbbb8('0x8'));var client=jayson['client'][_0xbbb8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x171fe6,_0x2e7235,_0xd51132){return new BPromise(function(_0x47c66e,_0xd846aa){return client[_0xbbb8('0xa')](_0x171fe6,_0xd51132)['then'](function(_0x32daa3){logger[_0xbbb8('0xb')](_0xbbb8('0xc'),_0x2e7235,'request\x20sent');logger['debug'](_0xbbb8('0xd'),_0x2e7235,'request\x20sent',JSON[_0xbbb8('0xe')](_0x32daa3));if(_0x32daa3[_0xbbb8('0xf')]){if(_0x32daa3['error'][_0xbbb8('0x10')]===0x1f4){logger[_0xbbb8('0xf')]('ContactItemType,\x20%s,\x20%s',_0x2e7235,_0x32daa3[_0xbbb8('0xf')][_0xbbb8('0x11')]);return _0xd846aa(_0x32daa3[_0xbbb8('0xf')]['message']);}logger[_0xbbb8('0xf')](_0xbbb8('0xc'),_0x2e7235,_0x32daa3[_0xbbb8('0xf')]['message']);return _0x47c66e(_0x32daa3[_0xbbb8('0xf')]['message']);}else{logger[_0xbbb8('0xb')](_0xbbb8('0xc'),_0x2e7235,_0xbbb8('0x12'));_0x47c66e(_0x32daa3[_0xbbb8('0x13')][_0xbbb8('0x11')]);}})['catch'](function(_0xf47526){logger[_0xbbb8('0xf')]('ContactItemType,\x20%s,\x20%s',_0x2e7235,_0xf47526);_0xd846aa(_0xf47526);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index ee50e48..c562c85 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 _0xb44b=['multer','util','path','connect-timeout','../../components/auth/service','../../config/environment','./contactItemType.controller','get','isAuthenticated','/:id','post','create','put','update','delete','destroy'];(function(_0x609988,_0x507944){var _0x159984=function(_0x39d9ce){while(--_0x39d9ce){_0x609988['push'](_0x609988['shift']());}};_0x159984(++_0x507944);}(_0xb44b,0x160));var _0xbb44=function(_0x1c37a5,_0x59ee51){_0x1c37a5=_0x1c37a5-0x0;var _0x389d03=_0xb44b[_0x1c37a5];return _0x389d03;};'use strict';var multer=require(_0xbb44('0x0'));var util=require(_0xbb44('0x1'));var path=require(_0xbb44('0x2'));var timeout=require(_0xbb44('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xbb44('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xbb44('0x5'));var controller=require(_0xbb44('0x6'));router[_0xbb44('0x7')]('/',auth[_0xbb44('0x8')](),controller['index']);router[_0xbb44('0x7')](_0xbb44('0x9'),auth[_0xbb44('0x8')](),controller['show']);router[_0xbb44('0xa')]('/',auth['isAuthenticated'](),controller[_0xbb44('0xb')]);router[_0xbb44('0xc')](_0xbb44('0x9'),auth[_0xbb44('0x8')](),controller[_0xbb44('0xd')]);router[_0xbb44('0xe')]('/:id',auth[_0xbb44('0x8')](),controller[_0xbb44('0xf')]);module['exports']=router; \ No newline at end of file +var _0x45ad=['../../components/auth/service','../../components/interaction/service','./contactItemType.controller','get','isAuthenticated','index','/:id','show','post','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x3c4737,_0x2329ec){var _0x2bb926=function(_0x3b9605){while(--_0x3b9605){_0x3c4737['push'](_0x3c4737['shift']());}};_0x2bb926(++_0x2329ec);}(_0x45ad,0x19d));var _0xd45a=function(_0x427352,_0x1bce61){_0x427352=_0x427352-0x0;var _0x23e0e6=_0x45ad[_0x427352];return _0x23e0e6;};'use strict';var multer=require(_0xd45a('0x0'));var util=require(_0xd45a('0x1'));var path=require(_0xd45a('0x2'));var timeout=require(_0xd45a('0x3'));var express=require(_0xd45a('0x4'));var router=express[_0xd45a('0x5')]();var fs_extra=require(_0xd45a('0x6'));var auth=require(_0xd45a('0x7'));var interaction=require(_0xd45a('0x8'));var config=require('../../config/environment');var controller=require(_0xd45a('0x9'));router[_0xd45a('0xa')]('/',auth[_0xd45a('0xb')](),controller[_0xd45a('0xc')]);router[_0xd45a('0xa')](_0xd45a('0xd'),auth['isAuthenticated'](),controller[_0xd45a('0xe')]);router[_0xd45a('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xd45a('0xd'),auth[_0xd45a('0xb')](),controller[_0xd45a('0x10')]);router[_0xd45a('0x11')](_0xd45a('0xd'),auth[_0xd45a('0xb')](),controller[_0xd45a('0x12')]);module[_0xd45a('0x13')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 5fe8ffa..4bf566c 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 _0x0713=['STRING','name'];(function(_0xa4aaf4,_0x394844){var _0xf2770f=function(_0x2f6d57){while(--_0x2f6d57){_0xa4aaf4['push'](_0xa4aaf4['shift']());}};_0xf2770f(++_0x394844);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1')},'description':{'type':Sequelize[_0x3071('0x0')]}}; \ No newline at end of file +var _0xd8b0=['exports','sequelize'];(function(_0x4ae67f,_0x34081f){var _0xb981a9=function(_0x597650){while(--_0x597650){_0x4ae67f['push'](_0x4ae67f['shift']());}};_0xb981a9(++_0x34081f);}(_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')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index c0b9aae..7c85cd7 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 _0xa078=['order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','keys','Dashboard','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CustomDashboards','UserProfileSection','userProfileId','autoAssociation','omit','createdAt','updatedAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','attrUrl','attrs','https://','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','DashboardId','DashboardItem','getItems','pick','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./dashboard.socket','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update','then','get','UserProfileResource','error','stack','name','send','index','map','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit'];(function(_0x19a6c0,_0x46139a){var _0x268931=function(_0x248c8a){while(--_0x248c8a){_0x19a6c0['push'](_0x19a6c0['shift']());}};_0x268931(++_0x46139a);}(_0xa078,0xc1));var _0x8a07=function(_0x2b2c91,_0x4e4ecc){_0x2b2c91=_0x2b2c91-0x0;var _0x55e53b=_0xa078[_0x2b2c91];return _0x55e53b;};'use strict';var emlformat=require(_0x8a07('0x0'));var rimraf=require(_0x8a07('0x1'));var zipdir=require(_0x8a07('0x2'));var jsonpatch=require(_0x8a07('0x3'));var rp=require(_0x8a07('0x4'));var moment=require('moment');var BPromise=require(_0x8a07('0x5'));var Mustache=require(_0x8a07('0x6'));var util=require(_0x8a07('0x7'));var path=require(_0x8a07('0x8'));var sox=require(_0x8a07('0x9'));var csv=require(_0x8a07('0xa'));var ejs=require(_0x8a07('0xb'));var fs=require('fs');var fs_extra=require(_0x8a07('0xc'));var _=require(_0x8a07('0xd'));var squel=require(_0x8a07('0xe'));var crypto=require(_0x8a07('0xf'));var jsforce=require(_0x8a07('0x10'));var deskjs=require(_0x8a07('0x11'));var toCsv=require('to-csv');var querystring=require(_0x8a07('0x12'));var Papa=require(_0x8a07('0x13'));var Redis=require(_0x8a07('0x14'));var authService=require(_0x8a07('0x15'));var qs=require(_0x8a07('0x16'));var as=require(_0x8a07('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8a07('0x18'))(_0x8a07('0x19'));var utils=require('../../config/utils');var config=require(_0x8a07('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x8a07('0x1b'))['db'];config['redis']=_[_0x8a07('0x1c')](config['redis'],{'host':_0x8a07('0x1d'),'port':0x18eb});var socket=require(_0x8a07('0x1e'))(new Redis(config[_0x8a07('0x1f')]));require(_0x8a07('0x20'))['register'](socket);function respondWithStatusCode(_0x3866ad,_0x6c46f){_0x6c46f=_0x6c46f||0xcc;return function(_0x4b2bf7){if(_0x4b2bf7){return _0x3866ad[_0x8a07('0x21')](_0x6c46f);}return _0x3866ad[_0x8a07('0x22')](_0x6c46f)[_0x8a07('0x23')]();};}function respondWithResult(_0x5eba7e,_0xb0e71a){_0xb0e71a=_0xb0e71a||0xc8;return function(_0x3712ac){if(_0x3712ac){return _0x5eba7e['status'](_0xb0e71a)[_0x8a07('0x24')](_0x3712ac);}};}function respondWithFilteredResult(_0x1659e4,_0x281486){return function(_0x26626c){if(_0x26626c){var _0x5c9840=typeof _0x281486[_0x8a07('0x25')]===_0x8a07('0x26')&&typeof _0x281486['limit']===_0x8a07('0x26');var _0x2ef8bb=_0x26626c[_0x8a07('0x27')];var _0x3e4eae=_0x5c9840?0x0:_0x281486['offset'];var _0x1ebb51=_0x5c9840?_0x26626c[_0x8a07('0x27')]:_0x281486[_0x8a07('0x25')]+_0x281486['limit'];var _0x43d29a;if(_0x1ebb51>=_0x2ef8bb){_0x1ebb51=_0x2ef8bb;_0x43d29a=0xc8;}else{_0x43d29a=0xce;}_0x1659e4[_0x8a07('0x22')](_0x43d29a);return _0x1659e4[_0x8a07('0x28')](_0x8a07('0x29'),_0x3e4eae+'-'+_0x1ebb51+'/'+_0x2ef8bb)[_0x8a07('0x24')](_0x26626c);}return null;};}function patchUpdates(_0x40adf3){return function(_0xaf261b){try{jsonpatch[_0x8a07('0x2a')](_0xaf261b,_0x40adf3,!![]);}catch(_0x4b5743){return BPromise['reject'](_0x4b5743);}return _0xaf261b[_0x8a07('0x2b')]();};}function saveUpdates(_0x5d45f4,_0x35706a){return function(_0x4d23cb){if(_0x4d23cb){return _0x4d23cb[_0x8a07('0x2c')](_0x5d45f4)[_0x8a07('0x2d')](function(_0x3a5977){return _0x3a5977;});}return null;};}function removeEntity(_0x15cec8,_0x41c338){return function(_0x73a5c6){if(_0x73a5c6){return _0x73a5c6['destroy']()[_0x8a07('0x2d')](function(){var _0x265e6a=_0x73a5c6[_0x8a07('0x2e')]({'plain':!![]});var _0x43397c='CustomDashboards';return db[_0x8a07('0x2f')]['destroy']({'where':{'type':_0x43397c,'resourceId':_0x265e6a['id']}})[_0x8a07('0x2d')](function(){return _0x73a5c6;});})[_0x8a07('0x2d')](function(){_0x15cec8[_0x8a07('0x22')](0xcc)[_0x8a07('0x23')]();});}};}function handleEntityNotFound(_0x40cff1,_0x4f4fc2){return function(_0x206f92){if(!_0x206f92){_0x40cff1[_0x8a07('0x21')](0x194);}return _0x206f92;};}function handleError(_0x122231,_0x522915){_0x522915=_0x522915||0x1f4;return function(_0x4d9244){logger[_0x8a07('0x30')](_0x4d9244[_0x8a07('0x31')]);if(_0x4d9244[_0x8a07('0x32')]){delete _0x4d9244[_0x8a07('0x32')];}_0x122231[_0x8a07('0x22')](_0x522915)[_0x8a07('0x33')](_0x4d9244);};}exports[_0x8a07('0x34')]=function(_0x10e466,_0x4508e9){var _0x2b4a8d={},_0xd98302={},_0x4db154={'count':0x0,'rows':[]};var _0x3d43b4=_[_0x8a07('0x35')](db['Dashboard']['rawAttributes'],function(_0x1aabb9){return{'name':_0x1aabb9['fieldName'],'type':_0x1aabb9[_0x8a07('0x36')]['key']};});_0xd98302[_0x8a07('0x37')]=_['map'](_0x3d43b4,_0x8a07('0x32'));_0xd98302[_0x8a07('0x38')]=_['keys'](_0x10e466['query']);_0xd98302[_0x8a07('0x39')]=_[_0x8a07('0x3a')](_0xd98302[_0x8a07('0x37')],_0xd98302[_0x8a07('0x38')]);_0x2b4a8d[_0x8a07('0x3b')]=_[_0x8a07('0x3a')](_0xd98302[_0x8a07('0x37')],qs[_0x8a07('0x3c')](_0x10e466[_0x8a07('0x38')][_0x8a07('0x3c')]));_0x2b4a8d[_0x8a07('0x3b')]=_0x2b4a8d[_0x8a07('0x3b')][_0x8a07('0x3d')]?_0x2b4a8d[_0x8a07('0x3b')]:_0xd98302[_0x8a07('0x37')];if(!_0x10e466['query'][_0x8a07('0x3e')](_0x8a07('0x3f'))){_0x2b4a8d[_0x8a07('0x40')]=qs['limit'](_0x10e466['query']['limit']);_0x2b4a8d[_0x8a07('0x25')]=qs[_0x8a07('0x25')](_0x10e466[_0x8a07('0x38')][_0x8a07('0x25')]);}_0x2b4a8d[_0x8a07('0x41')]=qs[_0x8a07('0x42')](_0x10e466['query'][_0x8a07('0x42')]);_0x2b4a8d[_0x8a07('0x43')]=qs['filters'](_['pick'](_0x10e466[_0x8a07('0x38')],_0xd98302[_0x8a07('0x39')]),_0x3d43b4);if(_0x10e466[_0x8a07('0x38')][_0x8a07('0x44')]){_0x2b4a8d['where']=_[_0x8a07('0x45')](_0x2b4a8d[_0x8a07('0x43')],{'$or':_[_0x8a07('0x35')](_0x3d43b4,function(_0x1477b7){if(_0x1477b7[_0x8a07('0x36')]!==_0x8a07('0x46')){var _0x20ea3c={};_0x20ea3c[_0x1477b7['name']]={'$like':'%'+_0x10e466[_0x8a07('0x38')]['filter']+'%'};return _0x20ea3c;}})});}_0x2b4a8d=_['merge']({},_0x2b4a8d,_0x10e466[_0x8a07('0x47')]);var _0x4aa92b={'where':_0x2b4a8d[_0x8a07('0x43')]};return db['Dashboard'][_0x8a07('0x27')](_0x4aa92b)[_0x8a07('0x2d')](function(_0x74774d){_0x4db154['count']=_0x74774d;if(_0x10e466[_0x8a07('0x38')][_0x8a07('0x48')]){_0x2b4a8d[_0x8a07('0x49')]=[{'all':!![]}];}return db['Dashboard'][_0x8a07('0x4a')](_0x2b4a8d);})['then'](function(_0x1d69e1){_0x4db154['rows']=_0x1d69e1;return _0x4db154;})[_0x8a07('0x2d')](respondWithFilteredResult(_0x4508e9,_0x2b4a8d))[_0x8a07('0x4b')](handleError(_0x4508e9,null));};exports['show']=function(_0x12b8d9,_0x24d9c2){var _0x30e9c9={'raw':![],'where':{'id':_0x12b8d9[_0x8a07('0x4c')]['id']}},_0x120775={};_0x120775[_0x8a07('0x37')]=_[_0x8a07('0x4d')](db[_0x8a07('0x4e')][_0x8a07('0x4f')]);_0x120775['query']=_['keys'](_0x12b8d9[_0x8a07('0x38')]);_0x120775[_0x8a07('0x39')]=_[_0x8a07('0x3a')](_0x120775[_0x8a07('0x37')],_0x120775['query']);_0x30e9c9[_0x8a07('0x3b')]=_['intersection'](_0x120775[_0x8a07('0x37')],qs[_0x8a07('0x3c')](_0x12b8d9[_0x8a07('0x38')][_0x8a07('0x3c')]));_0x30e9c9[_0x8a07('0x3b')]=_0x30e9c9['attributes'][_0x8a07('0x3d')]?_0x30e9c9[_0x8a07('0x3b')]:_0x120775['model'];if(_0x12b8d9[_0x8a07('0x38')][_0x8a07('0x48')]){_0x30e9c9[_0x8a07('0x49')]=[{'all':!![]}];}_0x30e9c9=_['merge']({},_0x30e9c9,_0x12b8d9[_0x8a07('0x47')]);return db['Dashboard'][_0x8a07('0x50')](_0x30e9c9)[_0x8a07('0x2d')](handleEntityNotFound(_0x24d9c2,null))[_0x8a07('0x2d')](respondWithResult(_0x24d9c2,null))[_0x8a07('0x4b')](handleError(_0x24d9c2,null));};exports[_0x8a07('0x51')]=function(_0x5b1922,_0x5c8008){return db[_0x8a07('0x4e')]['create'](_0x5b1922[_0x8a07('0x52')],{})[_0x8a07('0x2d')](function(_0x7fff65){var _0x14f5eb=_0x5b1922[_0x8a07('0x53')][_0x8a07('0x2e')]({'plain':!![]});if(!_0x14f5eb)throw new Error(_0x8a07('0x54'));if(_0x14f5eb[_0x8a07('0x55')]===_0x8a07('0x53')){var _0xd9ecc8=_0x7fff65[_0x8a07('0x2e')]({'plain':!![]});var _0x354ce9=_0x8a07('0x56');return db[_0x8a07('0x57')][_0x8a07('0x50')]({'where':{'name':_0x354ce9,'userProfileId':_0x14f5eb[_0x8a07('0x58')]},'raw':!![]})[_0x8a07('0x2d')](function(_0x10ae72){if(_0x10ae72&&_0x10ae72[_0x8a07('0x59')]===0x0){return db[_0x8a07('0x2f')]['create']({'name':_0xd9ecc8['name'],'resourceId':_0xd9ecc8['id'],'type':_0x10ae72['name'],'sectionId':_0x10ae72['id']},{})[_0x8a07('0x2d')](function(){return _0x7fff65;});}else{return _0x7fff65;}})[_0x8a07('0x4b')](function(_0x4302fc){logger[_0x8a07('0x30')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4302fc);throw _0x4302fc;});}return _0x7fff65;})['then'](respondWithResult(_0x5c8008,0xc9))['catch'](handleError(_0x5c8008,null));};exports['clone']=function(_0x5f52e9,_0x58ace8){var _0x4b3bd1={'where':{'id':_0x5f52e9[_0x8a07('0x4c')]['id']}},_0x19412f={};_0x19412f[_0x8a07('0x37')]=_[_0x8a07('0x4d')](db[_0x8a07('0x4e')][_0x8a07('0x4f')]);_0x4b3bd1[_0x8a07('0x3b')]=_['intersection'](_0x19412f['model'],qs[_0x8a07('0x3c')](_0x5f52e9[_0x8a07('0x38')][_0x8a07('0x3c')]));_0x4b3bd1[_0x8a07('0x3b')]=_0x4b3bd1['attributes'][_0x8a07('0x3d')]?_0x4b3bd1[_0x8a07('0x3b')]:_0x19412f['model'];if(_0x5f52e9[_0x8a07('0x38')][_0x8a07('0x48')]){_0x4b3bd1[_0x8a07('0x49')]=[{'all':!![]}];}_0x4b3bd1=_['merge']({},_0x4b3bd1,_0x5f52e9[_0x8a07('0x47')]);return db[_0x8a07('0x4e')][_0x8a07('0x50')](_0x4b3bd1)[_0x8a07('0x2d')](handleEntityNotFound(_0x58ace8,null))[_0x8a07('0x2d')](function(_0x4095c4){if(_0x4095c4){var _0x302dbf=_0x4095c4[_0x8a07('0x2e')]({'plain':!![]});_0x302dbf=qs[_0x8a07('0x5a')](_0x302dbf,['id',_0x8a07('0x5b'),_0x8a07('0x5c')]);_0x5f52e9[_0x8a07('0x52')]=_['omit'](_0x5f52e9[_0x8a07('0x52')],['id',_0x8a07('0x5b'),_0x8a07('0x5c')]);return db['Dashboard'][_0x8a07('0x51')](_[_0x8a07('0x45')](_0x302dbf,_0x5f52e9[_0x8a07('0x52')]),{'include':_0x5f52e9[_0x8a07('0x38')]['includeAll']?[{'all':!![]}]:undefined})[_0x8a07('0x2d')](function(_0x13a2d3){var _0x2b5a91=_0x5f52e9[_0x8a07('0x53')]['get']({'plain':!![]});if(!_0x2b5a91)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2b5a91[_0x8a07('0x55')]===_0x8a07('0x53')){var _0x7509bb=_0x13a2d3[_0x8a07('0x2e')]({'plain':!![]});var _0x1f7164=_0x8a07('0x56');return db[_0x8a07('0x57')][_0x8a07('0x50')]({'where':{'name':_0x1f7164,'userProfileId':_0x2b5a91[_0x8a07('0x58')]},'raw':!![]})[_0x8a07('0x2d')](function(_0x4b4148){if(_0x4b4148&&_0x4b4148[_0x8a07('0x59')]===0x0){return db['UserProfileResource']['create']({'name':_0x7509bb['name'],'resourceId':_0x7509bb['id'],'type':_0x4b4148[_0x8a07('0x32')],'sectionId':_0x4b4148['id']},{})['then'](function(){return _0x13a2d3;});}else{return _0x13a2d3;}})[_0x8a07('0x4b')](function(_0x579255){logger['error'](_0x8a07('0x5d'),_0x579255);throw _0x579255;});}return _0x13a2d3;});}})['then'](respondWithResult(_0x58ace8,0xc9))[_0x8a07('0x4b')](handleError(_0x58ace8,null));};exports['update']=function(_0x493f20,_0x2986d7){if(_0x493f20[_0x8a07('0x52')]['id']){delete _0x493f20[_0x8a07('0x52')]['id'];}return db[_0x8a07('0x4e')]['find']({'where':{'id':_0x493f20[_0x8a07('0x4c')]['id']}})[_0x8a07('0x2d')](handleEntityNotFound(_0x2986d7,null))['then'](saveUpdates(_0x493f20[_0x8a07('0x52')],null))['then'](respondWithResult(_0x2986d7,null))[_0x8a07('0x4b')](handleError(_0x2986d7,null));};exports['destroy']=function(_0x2fc21f,_0xe6aba){return db[_0x8a07('0x4e')][_0x8a07('0x50')]({'where':{'id':_0x2fc21f['params']['id']}})[_0x8a07('0x2d')](handleEntityNotFound(_0xe6aba,null))[_0x8a07('0x2d')](removeEntity(_0xe6aba,null))[_0x8a07('0x4b')](handleError(_0xe6aba,null));};function widgetAttributes(_0x487d20){try{switch(_0x487d20[_0x8a07('0x36')]){case'iframe':return[{'name':_0x8a07('0x5e'),'value':_0x487d20['attrUrl']||(_0x487d20[_0x8a07('0x5f')]&&_0x487d20['attrs'][0x0]?_0x487d20[_0x8a07('0x5f')][0x0]['value']:undefined)||_0x8a07('0x60')}];case'custom':return[{'name':_0x8a07('0x61'),'value':_0x487d20['attrPath']||(_0x487d20[_0x8a07('0x5f')]&&_0x487d20[_0x8a07('0x5f')][0x0]?_0x487d20['attrs'][0x0][_0x8a07('0x62')]:undefined)||''}];case _0x8a07('0x63'):return[{'name':_0x8a07('0x64'),'value':_0x487d20[_0x8a07('0x64')]||(_0x487d20['attrs']&&_0x487d20[_0x8a07('0x5f')][0x0]?_0x487d20[_0x8a07('0x5f')][0x0][_0x8a07('0x62')]:undefined)||_0x8a07('0x65')},{'name':_0x8a07('0x66'),'value':_0x487d20[_0x8a07('0x66')]||(_0x487d20[_0x8a07('0x5f')]&&_0x487d20[_0x8a07('0x5f')][0x1]?_0x487d20[_0x8a07('0x5f')][0x1]['value']:undefined)||_0x8a07('0x67')},{'name':_0x8a07('0x68'),'value':_0x487d20[_0x8a07('0x68')]||(_0x487d20[_0x8a07('0x5f')]&&_0x487d20[_0x8a07('0x5f')][0x2]?_0x487d20[_0x8a07('0x5f')][0x2][_0x8a07('0x62')]:undefined)||0xc}];case _0x8a07('0x69'):return[{'name':_0x8a07('0x6a'),'value':_0x487d20[_0x8a07('0x6a')]||(_0x487d20['attrs']&&_0x487d20['attrs'][0x0]?_0x487d20[_0x8a07('0x5f')][0x0][_0x8a07('0x62')]:undefined)||_0x8a07('0x6b')},{'name':_0x8a07('0x6c'),'value':_0x487d20[_0x8a07('0x6c')]||(_0x487d20['attrs']&&_0x487d20[_0x8a07('0x5f')][0x1]?_0x487d20[_0x8a07('0x5f')][0x1][_0x8a07('0x62')]:undefined)||[]},{'name':_0x8a07('0x68'),'value':_0x487d20[_0x8a07('0x68')]||(_0x487d20['attrs']&&_0x487d20[_0x8a07('0x5f')][0x2]?_0x487d20['attrs'][0x2][_0x8a07('0x62')]:undefined)||0x14},{'name':'attrChannel','value':_0x487d20[_0x8a07('0x6d')]||(_0x487d20[_0x8a07('0x5f')]&&_0x487d20[_0x8a07('0x5f')][0x3]?_0x487d20[_0x8a07('0x5f')][0x3]['value']:undefined)||_0x8a07('0x6e')},{'name':_0x8a07('0x6f'),'value':_0x487d20['attrEmailAccounts']||(_0x487d20[_0x8a07('0x5f')]&&_0x487d20[_0x8a07('0x5f')][0x4]?_0x487d20['attrs'][0x4][_0x8a07('0x62')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x487d20[_0x8a07('0x70')]||(_0x487d20[_0x8a07('0x5f')]&&_0x487d20['attrs'][0x5]?_0x487d20[_0x8a07('0x5f')][0x5][_0x8a07('0x62')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x487d20[_0x8a07('0x71')]||(_0x487d20['attrs']&&_0x487d20[_0x8a07('0x5f')][0x6]?_0x487d20[_0x8a07('0x5f')][0x6][_0x8a07('0x62')]:undefined)||''},{'name':_0x8a07('0x72'),'value':_0x487d20[_0x8a07('0x72')]||(_0x487d20[_0x8a07('0x5f')]&&_0x487d20[_0x8a07('0x5f')][0x7]?_0x487d20[_0x8a07('0x5f')][0x7]['value']:undefined)||''},{'name':_0x8a07('0x73'),'value':_0x487d20[_0x8a07('0x73')]||(_0x487d20['attrs']&&_0x487d20[_0x8a07('0x5f')][0x8]?_0x487d20[_0x8a07('0x5f')][0x8][_0x8a07('0x62')]:undefined)||''},{'name':_0x8a07('0x74'),'value':_0x487d20[_0x8a07('0x74')]||(_0x487d20[_0x8a07('0x5f')]&&_0x487d20[_0x8a07('0x5f')][0x9]?_0x487d20[_0x8a07('0x5f')][0x9][_0x8a07('0x62')]:undefined)||''}];case _0x8a07('0x75'):case _0x8a07('0x76'):return[{'name':_0x8a07('0x77'),'value':_0x487d20['attrSerie1']||(_0x487d20[_0x8a07('0x5f')]&&_0x487d20[_0x8a07('0x5f')][0x0]?_0x487d20[_0x8a07('0x5f')][0x0][_0x8a07('0x62')]:undefined)||_0x8a07('0x6b')},{'name':_0x8a07('0x78'),'value':_0x487d20['attrSerie2']||(_0x487d20['attrs']&&_0x487d20[_0x8a07('0x5f')][0x1]?_0x487d20[_0x8a07('0x5f')][0x1][_0x8a07('0x62')]:undefined)||null},{'name':'attrSerie3','value':_0x487d20['attrSerie3']||(_0x487d20[_0x8a07('0x5f')]&&_0x487d20['attrs'][0x2]?_0x487d20[_0x8a07('0x5f')][0x2][_0x8a07('0x62')]:undefined)||null},{'name':_0x8a07('0x6c'),'value':_0x487d20[_0x8a07('0x6c')]||(_0x487d20[_0x8a07('0x5f')]&&_0x487d20[_0x8a07('0x5f')][0x3]?_0x487d20[_0x8a07('0x5f')][0x3][_0x8a07('0x62')]:undefined)||[]},{'name':'attrChannel','value':_0x487d20['attrChannel']||(_0x487d20['attrs']&&_0x487d20[_0x8a07('0x5f')][0x4]?_0x487d20[_0x8a07('0x5f')][0x4]['value']:undefined)||_0x8a07('0x6e')},{'name':_0x8a07('0x6f'),'value':_0x487d20[_0x8a07('0x6f')]||(_0x487d20[_0x8a07('0x5f')]&&_0x487d20[_0x8a07('0x5f')][0x5]?_0x487d20['attrs'][0x5][_0x8a07('0x62')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x487d20[_0x8a07('0x70')]||(_0x487d20[_0x8a07('0x5f')]&&_0x487d20[_0x8a07('0x5f')][0x6]?_0x487d20[_0x8a07('0x5f')][0x6][_0x8a07('0x62')]:undefined)||''},{'name':_0x8a07('0x71'),'value':_0x487d20[_0x8a07('0x71')]||(_0x487d20[_0x8a07('0x5f')]&&_0x487d20['attrs'][0x7]?_0x487d20[_0x8a07('0x5f')][0x7]['value']:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x487d20[_0x8a07('0x72')]||(_0x487d20[_0x8a07('0x5f')]&&_0x487d20[_0x8a07('0x5f')][0x8]?_0x487d20[_0x8a07('0x5f')][0x8][_0x8a07('0x62')]:undefined)||''},{'name':_0x8a07('0x73'),'value':_0x487d20['attrWhatsappAccounts']||(_0x487d20['attrs']&&_0x487d20[_0x8a07('0x5f')][0x9]?_0x487d20[_0x8a07('0x5f')][0x9][_0x8a07('0x62')]:undefined)||''},{'name':'attrChatWebsites','value':_0x487d20[_0x8a07('0x74')]||(_0x487d20[_0x8a07('0x5f')]&&_0x487d20[_0x8a07('0x5f')][0xa]?_0x487d20['attrs'][0xa]['value']:undefined)||''}];case'web-report':return[{'name':'attrReport','type':_0x487d20['reportType']||(_0x487d20[_0x8a07('0x5f')]&&_0x487d20[_0x8a07('0x5f')][0x0]?_0x487d20[_0x8a07('0x5f')][0x0]['type']:undefined)||null,'value':_0x487d20[_0x8a07('0x79')]||(_0x487d20[_0x8a07('0x5f')]&&_0x487d20[_0x8a07('0x5f')][0x0]?_0x487d20[_0x8a07('0x5f')][0x0][_0x8a07('0x62')]:undefined)||null},{'name':'attrRefresh','value':_0x487d20[_0x8a07('0x7a')]||(_0x487d20[_0x8a07('0x5f')]&&_0x487d20[_0x8a07('0x5f')][0x1]?_0x487d20[_0x8a07('0x5f')][0x1][_0x8a07('0x62')]:undefined)||0x0}];default:return[];}}catch(_0x49c135){logger[_0x8a07('0x30')](_0x8a07('0x7b'),JSON[_0x8a07('0x7c')](_0x49c135));return[];}}exports['addItem']=function(_0x5cce5f,_0x402f8b,_0x2a74d3){if(_0x5cce5f[_0x8a07('0x52')]['id']){delete _0x5cce5f[_0x8a07('0x52')]['id'];}return db[_0x8a07('0x4e')]['find']({'where':{'id':_0x5cce5f[_0x8a07('0x4c')]['id']}})[_0x8a07('0x2d')](handleEntityNotFound(_0x402f8b,null))['then'](function(_0x4b8a2a){if(_0x4b8a2a){_0x5cce5f[_0x8a07('0x52')][_0x8a07('0x7d')]=_0x4b8a2a['id'];_0x5cce5f['body'][_0x8a07('0x5f')]=widgetAttributes(_0x5cce5f[_0x8a07('0x52')]);return db[_0x8a07('0x7e')][_0x8a07('0x51')](_0x5cce5f['body']);}})[_0x8a07('0x2d')](respondWithResult(_0x402f8b,null))[_0x8a07('0x4b')](handleError(_0x402f8b,null));};exports[_0x8a07('0x7f')]=function(_0x38a40e,_0x10a102,_0x2501f9){var _0x72f262={};var _0x17dc6f={};var _0x433098;var _0x31b00d;return db['Dashboard']['findOne']({'where':{'id':_0x38a40e['params']['id']}})['then'](handleEntityNotFound(_0x10a102,null))[_0x8a07('0x2d')](function(_0x283cea){if(_0x283cea){_0x433098=_0x283cea;_0x17dc6f[_0x8a07('0x37')]=_['keys'](db['DashboardItem'][_0x8a07('0x4f')]);_0x17dc6f['query']=_[_0x8a07('0x4d')](_0x38a40e['query']);_0x17dc6f[_0x8a07('0x39')]=_[_0x8a07('0x3a')](_0x17dc6f[_0x8a07('0x37')],_0x17dc6f[_0x8a07('0x38')]);_0x72f262[_0x8a07('0x3b')]=_[_0x8a07('0x3a')](_0x17dc6f[_0x8a07('0x37')],qs[_0x8a07('0x3c')](_0x38a40e[_0x8a07('0x38')][_0x8a07('0x3c')]));_0x72f262[_0x8a07('0x3b')]=_0x72f262[_0x8a07('0x3b')]['length']?_0x72f262['attributes']:_0x17dc6f['model'];_0x72f262[_0x8a07('0x41')]=qs[_0x8a07('0x42')](_0x38a40e[_0x8a07('0x38')][_0x8a07('0x42')]);_0x72f262[_0x8a07('0x43')]=qs[_0x8a07('0x39')](_[_0x8a07('0x80')](_0x38a40e[_0x8a07('0x38')],_0x17dc6f['filters']));if(_0x38a40e[_0x8a07('0x38')]['filter']){_0x72f262[_0x8a07('0x43')]=_[_0x8a07('0x45')](_0x72f262['where'],{'$or':_['map'](_0x72f262['attributes'],function(_0x1f381c){var _0xc6f546={};_0xc6f546[_0x1f381c]={'$like':'%'+_0x38a40e[_0x8a07('0x38')][_0x8a07('0x44')]+'%'};return _0xc6f546;})});}_0x72f262=_[_0x8a07('0x45')]({},_0x72f262,_0x38a40e[_0x8a07('0x47')]);return _0x433098[_0x8a07('0x7f')](_0x72f262);}})[_0x8a07('0x2d')](function(_0x32b7b4){if(_0x32b7b4){_0x31b00d=_0x32b7b4[_0x8a07('0x3d')];if(!_0x38a40e['query']['hasOwnProperty'](_0x8a07('0x3f'))){_0x72f262['limit']=qs[_0x8a07('0x40')](_0x38a40e[_0x8a07('0x38')][_0x8a07('0x40')]);_0x72f262[_0x8a07('0x25')]=qs['offset'](_0x38a40e['query'][_0x8a07('0x25')]);}return _0x433098['getItems'](_0x72f262);}})[_0x8a07('0x2d')](function(_0x5d0f63){if(_0x5d0f63){return _0x5d0f63?{'count':_0x31b00d,'rows':_0x5d0f63}:null;}})[_0x8a07('0x2d')](respondWithResult(_0x10a102,null))[_0x8a07('0x4b')](handleError(_0x10a102,null));}; \ No newline at end of file +var _0x4778=['count','set','Content-Range','apply','reject','save','destroy','then','get','UserProfileResource','name','send','index','map','Dashboard','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','role','user','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','createdAt','updatedAt','omit','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','CustomDashboards','UserProfileSection','userProfileId','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','voice','web-report','attrReport','reportType','attrRefresh','stringify','addItem','getItems','findOne','DashboardItem','order','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','offset','undefined','limit'];(function(_0x2b0d88,_0x5b5ef2){var _0x1c9256=function(_0x1ea041){while(--_0x1ea041){_0x2b0d88['push'](_0x2b0d88['shift']());}};_0x1c9256(++_0x5b5ef2);}(_0x4778,0xe5));var _0x8477=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x4778[_0x42245d];return _0x4b211a;};'use strict';var emlformat=require(_0x8477('0x0'));var rimraf=require(_0x8477('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8477('0x2'));var moment=require(_0x8477('0x3'));var BPromise=require(_0x8477('0x4'));var Mustache=require(_0x8477('0x5'));var util=require(_0x8477('0x6'));var path=require('path');var sox=require(_0x8477('0x7'));var csv=require(_0x8477('0x8'));var ejs=require(_0x8477('0x9'));var fs=require('fs');var fs_extra=require(_0x8477('0xa'));var _=require(_0x8477('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8477('0xc'));var deskjs=require(_0x8477('0xd'));var toCsv=require('to-csv');var querystring=require(_0x8477('0xe'));var Papa=require(_0x8477('0xf'));var Redis=require(_0x8477('0x10'));var authService=require(_0x8477('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x8477('0x12'));var hardwareService=require(_0x8477('0x13'));var logger=require('../../config/logger')(_0x8477('0x14'));var utils=require('../../config/utils');var config=require(_0x8477('0x15'));var licenseUtil=require(_0x8477('0x16'));var db=require(_0x8477('0x17'))['db'];config[_0x8477('0x18')]=_[_0x8477('0x19')](config['redis'],{'host':_0x8477('0x1a'),'port':0x18eb});var socket=require(_0x8477('0x1b'))(new Redis(config[_0x8477('0x18')]));require('./dashboard.socket')[_0x8477('0x1c')](socket);function respondWithStatusCode(_0x58ed4a,_0x393b76){_0x393b76=_0x393b76||0xcc;return function(_0x44554b){if(_0x44554b){return _0x58ed4a[_0x8477('0x1d')](_0x393b76);}return _0x58ed4a[_0x8477('0x1e')](_0x393b76)[_0x8477('0x1f')]();};}function respondWithResult(_0x2c99b5,_0x3ee2d1){_0x3ee2d1=_0x3ee2d1||0xc8;return function(_0x1c1477){if(_0x1c1477){return _0x2c99b5[_0x8477('0x1e')](_0x3ee2d1)['json'](_0x1c1477);}};}function respondWithFilteredResult(_0x422408,_0xc29d8e){return function(_0x207ffa){if(_0x207ffa){var _0x528b8d=typeof _0xc29d8e[_0x8477('0x20')]===_0x8477('0x21')&&typeof _0xc29d8e[_0x8477('0x22')]===_0x8477('0x21');var _0x22b9f7=_0x207ffa[_0x8477('0x23')];var _0x9d17ec=_0x528b8d?0x0:_0xc29d8e[_0x8477('0x20')];var _0x55b13d=_0x528b8d?_0x207ffa[_0x8477('0x23')]:_0xc29d8e[_0x8477('0x20')]+_0xc29d8e[_0x8477('0x22')];var _0x56b2b2;if(_0x55b13d>=_0x22b9f7){_0x55b13d=_0x22b9f7;_0x56b2b2=0xc8;}else{_0x56b2b2=0xce;}_0x422408[_0x8477('0x1e')](_0x56b2b2);return _0x422408[_0x8477('0x24')](_0x8477('0x25'),_0x9d17ec+'-'+_0x55b13d+'/'+_0x22b9f7)['json'](_0x207ffa);}return null;};}function patchUpdates(_0x32367e){return function(_0x23759b){try{jsonpatch[_0x8477('0x26')](_0x23759b,_0x32367e,!![]);}catch(_0x105b99){return BPromise[_0x8477('0x27')](_0x105b99);}return _0x23759b[_0x8477('0x28')]();};}function saveUpdates(_0x24d17a,_0x48ecd3){return function(_0x1d8e37){if(_0x1d8e37){return _0x1d8e37['update'](_0x24d17a)['then'](function(_0x2a6432){return _0x2a6432;});}return null;};}function removeEntity(_0x208dd7,_0x1fafc1){return function(_0x253d1c){if(_0x253d1c){return _0x253d1c[_0x8477('0x29')]()[_0x8477('0x2a')](function(){var _0x3653f1=_0x253d1c[_0x8477('0x2b')]({'plain':!![]});var _0x741b35='CustomDashboards';return db[_0x8477('0x2c')]['destroy']({'where':{'type':_0x741b35,'resourceId':_0x3653f1['id']}})[_0x8477('0x2a')](function(){return _0x253d1c;});})['then'](function(){_0x208dd7['status'](0xcc)[_0x8477('0x1f')]();});}};}function handleEntityNotFound(_0x115a01,_0x58131d){return function(_0x210040){if(!_0x210040){_0x115a01[_0x8477('0x1d')](0x194);}return _0x210040;};}function handleError(_0x4a8fb8,_0x2b9c7c){_0x2b9c7c=_0x2b9c7c||0x1f4;return function(_0xa0ebff){logger['error'](_0xa0ebff['stack']);if(_0xa0ebff[_0x8477('0x2d')]){delete _0xa0ebff[_0x8477('0x2d')];}_0x4a8fb8[_0x8477('0x1e')](_0x2b9c7c)[_0x8477('0x2e')](_0xa0ebff);};}exports[_0x8477('0x2f')]=function(_0x1f3b88,_0x4d7d71){var _0x56ce5a={},_0x298289={},_0x3eeee2={'count':0x0,'rows':[]};var _0x1f5b97=_[_0x8477('0x30')](db[_0x8477('0x31')][_0x8477('0x32')],function(_0x38e2bc){return{'name':_0x38e2bc['fieldName'],'type':_0x38e2bc[_0x8477('0x33')][_0x8477('0x34')]};});_0x298289[_0x8477('0x35')]=_[_0x8477('0x30')](_0x1f5b97,'name');_0x298289[_0x8477('0x36')]=_['keys'](_0x1f3b88[_0x8477('0x36')]);_0x298289[_0x8477('0x37')]=_[_0x8477('0x38')](_0x298289[_0x8477('0x35')],_0x298289[_0x8477('0x36')]);_0x56ce5a[_0x8477('0x39')]=_[_0x8477('0x38')](_0x298289['model'],qs[_0x8477('0x3a')](_0x1f3b88[_0x8477('0x36')][_0x8477('0x3a')]));_0x56ce5a[_0x8477('0x39')]=_0x56ce5a[_0x8477('0x39')][_0x8477('0x3b')]?_0x56ce5a['attributes']:_0x298289['model'];if(!_0x1f3b88[_0x8477('0x36')][_0x8477('0x3c')](_0x8477('0x3d'))){_0x56ce5a[_0x8477('0x22')]=qs[_0x8477('0x22')](_0x1f3b88[_0x8477('0x36')]['limit']);_0x56ce5a[_0x8477('0x20')]=qs[_0x8477('0x20')](_0x1f3b88[_0x8477('0x36')][_0x8477('0x20')]);}_0x56ce5a['order']=qs[_0x8477('0x3e')](_0x1f3b88[_0x8477('0x36')][_0x8477('0x3e')]);_0x56ce5a[_0x8477('0x3f')]=qs['filters'](_[_0x8477('0x40')](_0x1f3b88['query'],_0x298289[_0x8477('0x37')]),_0x1f5b97);if(_0x1f3b88['query'][_0x8477('0x41')]){_0x56ce5a[_0x8477('0x3f')]=_['merge'](_0x56ce5a[_0x8477('0x3f')],{'$or':_[_0x8477('0x30')](_0x1f5b97,function(_0x1b8879){if(_0x1b8879[_0x8477('0x33')]!==_0x8477('0x42')){var _0x2fe536={};_0x2fe536[_0x1b8879[_0x8477('0x2d')]]={'$like':'%'+_0x1f3b88['query'][_0x8477('0x41')]+'%'};return _0x2fe536;}})});}_0x56ce5a=_[_0x8477('0x43')]({},_0x56ce5a,_0x1f3b88['options']);var _0x5a4b28={'where':_0x56ce5a[_0x8477('0x3f')]};return db[_0x8477('0x31')]['count'](_0x5a4b28)[_0x8477('0x2a')](function(_0x29fbb1){_0x3eeee2['count']=_0x29fbb1;if(_0x1f3b88[_0x8477('0x36')][_0x8477('0x44')]){_0x56ce5a[_0x8477('0x45')]=[{'all':!![]}];}return db['Dashboard'][_0x8477('0x46')](_0x56ce5a);})[_0x8477('0x2a')](function(_0xb0630a){_0x3eeee2[_0x8477('0x47')]=_0xb0630a;return _0x3eeee2;})[_0x8477('0x2a')](respondWithFilteredResult(_0x4d7d71,_0x56ce5a))[_0x8477('0x48')](handleError(_0x4d7d71,null));};exports[_0x8477('0x49')]=function(_0x56c60b,_0xdf551e){var _0x4a0f46={'raw':![],'where':{'id':_0x56c60b[_0x8477('0x4a')]['id']}},_0x2207f5={};_0x2207f5[_0x8477('0x35')]=_['keys'](db[_0x8477('0x31')][_0x8477('0x32')]);_0x2207f5[_0x8477('0x36')]=_[_0x8477('0x4b')](_0x56c60b[_0x8477('0x36')]);_0x2207f5[_0x8477('0x37')]=_['intersection'](_0x2207f5['model'],_0x2207f5[_0x8477('0x36')]);_0x4a0f46['attributes']=_[_0x8477('0x38')](_0x2207f5[_0x8477('0x35')],qs['fields'](_0x56c60b[_0x8477('0x36')]['fields']));_0x4a0f46[_0x8477('0x39')]=_0x4a0f46[_0x8477('0x39')]['length']?_0x4a0f46[_0x8477('0x39')]:_0x2207f5[_0x8477('0x35')];if(_0x56c60b[_0x8477('0x36')][_0x8477('0x44')]){_0x4a0f46[_0x8477('0x45')]=[{'all':!![]}];}_0x4a0f46=_['merge']({},_0x4a0f46,_0x56c60b[_0x8477('0x4c')]);return db[_0x8477('0x31')][_0x8477('0x4d')](_0x4a0f46)[_0x8477('0x2a')](handleEntityNotFound(_0xdf551e,null))[_0x8477('0x2a')](respondWithResult(_0xdf551e,null))[_0x8477('0x48')](handleError(_0xdf551e,null));};exports['create']=function(_0x3891f0,_0x360182){return db['Dashboard'][_0x8477('0x4e')](_0x3891f0['body'],{})['then'](function(_0x1d0cab){var _0x4aa4d7=_0x3891f0['user']['get']({'plain':!![]});if(!_0x4aa4d7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4aa4d7[_0x8477('0x4f')]===_0x8477('0x50')){var _0x5acc9f=_0x1d0cab['get']({'plain':!![]});var _0x3ef1db='CustomDashboards';return db['UserProfileSection']['find']({'where':{'name':_0x3ef1db,'userProfileId':_0x4aa4d7['userProfileId']},'raw':!![]})[_0x8477('0x2a')](function(_0x48156a){if(_0x48156a&&_0x48156a[_0x8477('0x51')]===0x0){return db[_0x8477('0x2c')][_0x8477('0x4e')]({'name':_0x5acc9f[_0x8477('0x2d')],'resourceId':_0x5acc9f['id'],'type':_0x48156a[_0x8477('0x2d')],'sectionId':_0x48156a['id']},{})[_0x8477('0x2a')](function(){return _0x1d0cab;});}else{return _0x1d0cab;}})[_0x8477('0x48')](function(_0x4b4f58){logger[_0x8477('0x52')](_0x8477('0x53'),_0x4b4f58);throw _0x4b4f58;});}return _0x1d0cab;})[_0x8477('0x2a')](respondWithResult(_0x360182,0xc9))[_0x8477('0x48')](handleError(_0x360182,null));};exports['clone']=function(_0x55301a,_0x26e46d){var _0x336958={'where':{'id':_0x55301a[_0x8477('0x4a')]['id']}},_0x2258c5={};_0x2258c5['model']=_[_0x8477('0x4b')](db[_0x8477('0x31')][_0x8477('0x32')]);_0x336958[_0x8477('0x39')]=_[_0x8477('0x38')](_0x2258c5['model'],qs[_0x8477('0x3a')](_0x55301a['query'][_0x8477('0x3a')]));_0x336958['attributes']=_0x336958['attributes'][_0x8477('0x3b')]?_0x336958[_0x8477('0x39')]:_0x2258c5[_0x8477('0x35')];if(_0x55301a['query'][_0x8477('0x44')]){_0x336958[_0x8477('0x45')]=[{'all':!![]}];}_0x336958=_[_0x8477('0x43')]({},_0x336958,_0x55301a['options']);return db[_0x8477('0x31')][_0x8477('0x4d')](_0x336958)[_0x8477('0x2a')](handleEntityNotFound(_0x26e46d,null))['then'](function(_0x249780){if(_0x249780){var _0x532a6e=_0x249780[_0x8477('0x2b')]({'plain':!![]});_0x532a6e=qs['omit'](_0x532a6e,['id',_0x8477('0x54'),_0x8477('0x55')]);_0x55301a['body']=_[_0x8477('0x56')](_0x55301a['body'],['id','createdAt',_0x8477('0x55')]);return db[_0x8477('0x31')][_0x8477('0x4e')](_['merge'](_0x532a6e,_0x55301a[_0x8477('0x57')]),{'include':_0x55301a[_0x8477('0x36')][_0x8477('0x44')]?[{'all':!![]}]:undefined})[_0x8477('0x2a')](function(_0x14374b){var _0x2a8fdc=_0x55301a[_0x8477('0x50')][_0x8477('0x2b')]({'plain':!![]});if(!_0x2a8fdc)throw new Error(_0x8477('0x58'));if(_0x2a8fdc[_0x8477('0x4f')]===_0x8477('0x50')){var _0x32a86f=_0x14374b[_0x8477('0x2b')]({'plain':!![]});var _0x47f428=_0x8477('0x59');return db[_0x8477('0x5a')]['find']({'where':{'name':_0x47f428,'userProfileId':_0x2a8fdc[_0x8477('0x5b')]},'raw':!![]})[_0x8477('0x2a')](function(_0x1ba47a){if(_0x1ba47a&&_0x1ba47a[_0x8477('0x51')]===0x0){return db[_0x8477('0x2c')]['create']({'name':_0x32a86f[_0x8477('0x2d')],'resourceId':_0x32a86f['id'],'type':_0x1ba47a[_0x8477('0x2d')],'sectionId':_0x1ba47a['id']},{})[_0x8477('0x2a')](function(){return _0x14374b;});}else{return _0x14374b;}})[_0x8477('0x48')](function(_0x180757){logger[_0x8477('0x52')](_0x8477('0x53'),_0x180757);throw _0x180757;});}return _0x14374b;});}})['then'](respondWithResult(_0x26e46d,0xc9))[_0x8477('0x48')](handleError(_0x26e46d,null));};exports['update']=function(_0x12dee1,_0x3fd93b){if(_0x12dee1['body']['id']){delete _0x12dee1[_0x8477('0x57')]['id'];}return db[_0x8477('0x31')][_0x8477('0x4d')]({'where':{'id':_0x12dee1['params']['id']}})['then'](handleEntityNotFound(_0x3fd93b,null))[_0x8477('0x2a')](saveUpdates(_0x12dee1[_0x8477('0x57')],null))['then'](respondWithResult(_0x3fd93b,null))[_0x8477('0x48')](handleError(_0x3fd93b,null));};exports[_0x8477('0x29')]=function(_0x570010,_0x341c1){return db[_0x8477('0x31')][_0x8477('0x4d')]({'where':{'id':_0x570010[_0x8477('0x4a')]['id']}})[_0x8477('0x2a')](handleEntityNotFound(_0x341c1,null))['then'](removeEntity(_0x341c1,null))[_0x8477('0x48')](handleError(_0x341c1,null));};function widgetAttributes(_0x4c1921){try{switch(_0x4c1921['type']){case _0x8477('0x5c'):return[{'name':'attrUrl','value':_0x4c1921[_0x8477('0x5d')]||(_0x4c1921[_0x8477('0x5e')]&&_0x4c1921['attrs'][0x0]?_0x4c1921[_0x8477('0x5e')][0x0][_0x8477('0x5f')]:undefined)||_0x8477('0x60')}];case _0x8477('0x61'):return[{'name':_0x8477('0x62'),'value':_0x4c1921['attrPath']||(_0x4c1921[_0x8477('0x5e')]&&_0x4c1921[_0x8477('0x5e')][0x0]?_0x4c1921[_0x8477('0x5e')][0x0][_0x8477('0x5f')]:undefined)||''}];case _0x8477('0x63'):return[{'name':_0x8477('0x64'),'value':_0x4c1921[_0x8477('0x64')]||(_0x4c1921[_0x8477('0x5e')]&&_0x4c1921[_0x8477('0x5e')][0x0]?_0x4c1921[_0x8477('0x5e')][0x0][_0x8477('0x5f')]:undefined)||_0x8477('0x65')},{'name':_0x8477('0x66'),'value':_0x4c1921[_0x8477('0x66')]||(_0x4c1921['attrs']&&_0x4c1921['attrs'][0x1]?_0x4c1921[_0x8477('0x5e')][0x1][_0x8477('0x5f')]:undefined)||_0x8477('0x67')},{'name':_0x8477('0x68'),'value':_0x4c1921['attrFontSize']||(_0x4c1921[_0x8477('0x5e')]&&_0x4c1921[_0x8477('0x5e')][0x2]?_0x4c1921[_0x8477('0x5e')][0x2][_0x8477('0x5f')]:undefined)||0xc}];case _0x8477('0x69'):return[{'name':_0x8477('0x6a'),'value':_0x4c1921[_0x8477('0x6a')]||(_0x4c1921['attrs']&&_0x4c1921['attrs'][0x0]?_0x4c1921[_0x8477('0x5e')][0x0][_0x8477('0x5f')]:undefined)||'total'},{'name':'attrVoiceQueues','value':_0x4c1921[_0x8477('0x6b')]||(_0x4c1921[_0x8477('0x5e')]&&_0x4c1921[_0x8477('0x5e')][0x1]?_0x4c1921[_0x8477('0x5e')][0x1]['value']:undefined)||[]},{'name':'attrFontSize','value':_0x4c1921['attrFontSize']||(_0x4c1921[_0x8477('0x5e')]&&_0x4c1921[_0x8477('0x5e')][0x2]?_0x4c1921[_0x8477('0x5e')][0x2][_0x8477('0x5f')]:undefined)||0x14},{'name':_0x8477('0x6c'),'value':_0x4c1921[_0x8477('0x6c')]||(_0x4c1921[_0x8477('0x5e')]&&_0x4c1921[_0x8477('0x5e')][0x3]?_0x4c1921[_0x8477('0x5e')][0x3][_0x8477('0x5f')]:undefined)||'voice'},{'name':_0x8477('0x6d'),'value':_0x4c1921['attrEmailAccounts']||(_0x4c1921[_0x8477('0x5e')]&&_0x4c1921[_0x8477('0x5e')][0x4]?_0x4c1921['attrs'][0x4][_0x8477('0x5f')]:undefined)||''},{'name':_0x8477('0x6e'),'value':_0x4c1921['attrFaxAccounts']||(_0x4c1921[_0x8477('0x5e')]&&_0x4c1921[_0x8477('0x5e')][0x5]?_0x4c1921[_0x8477('0x5e')][0x5][_0x8477('0x5f')]:undefined)||''},{'name':_0x8477('0x6f'),'value':_0x4c1921['attrSmsAccounts']||(_0x4c1921[_0x8477('0x5e')]&&_0x4c1921[_0x8477('0x5e')][0x6]?_0x4c1921[_0x8477('0x5e')][0x6][_0x8477('0x5f')]:undefined)||''},{'name':_0x8477('0x70'),'value':_0x4c1921[_0x8477('0x70')]||(_0x4c1921[_0x8477('0x5e')]&&_0x4c1921[_0x8477('0x5e')][0x7]?_0x4c1921[_0x8477('0x5e')][0x7][_0x8477('0x5f')]:undefined)||''},{'name':_0x8477('0x71'),'value':_0x4c1921['attrWhatsappAccounts']||(_0x4c1921[_0x8477('0x5e')]&&_0x4c1921[_0x8477('0x5e')][0x8]?_0x4c1921[_0x8477('0x5e')][0x8][_0x8477('0x5f')]:undefined)||''},{'name':_0x8477('0x72'),'value':_0x4c1921[_0x8477('0x72')]||(_0x4c1921['attrs']&&_0x4c1921['attrs'][0x9]?_0x4c1921[_0x8477('0x5e')][0x9][_0x8477('0x5f')]:undefined)||''}];case _0x8477('0x73'):case _0x8477('0x74'):return[{'name':_0x8477('0x75'),'value':_0x4c1921['attrSerie1']||(_0x4c1921[_0x8477('0x5e')]&&_0x4c1921[_0x8477('0x5e')][0x0]?_0x4c1921[_0x8477('0x5e')][0x0][_0x8477('0x5f')]:undefined)||_0x8477('0x76')},{'name':_0x8477('0x77'),'value':_0x4c1921[_0x8477('0x77')]||(_0x4c1921[_0x8477('0x5e')]&&_0x4c1921['attrs'][0x1]?_0x4c1921[_0x8477('0x5e')][0x1][_0x8477('0x5f')]:undefined)||null},{'name':_0x8477('0x78'),'value':_0x4c1921[_0x8477('0x78')]||(_0x4c1921[_0x8477('0x5e')]&&_0x4c1921[_0x8477('0x5e')][0x2]?_0x4c1921[_0x8477('0x5e')][0x2][_0x8477('0x5f')]:undefined)||null},{'name':_0x8477('0x6b'),'value':_0x4c1921['attrVoiceQueues']||(_0x4c1921[_0x8477('0x5e')]&&_0x4c1921[_0x8477('0x5e')][0x3]?_0x4c1921[_0x8477('0x5e')][0x3][_0x8477('0x5f')]:undefined)||[]},{'name':'attrChannel','value':_0x4c1921[_0x8477('0x6c')]||(_0x4c1921['attrs']&&_0x4c1921[_0x8477('0x5e')][0x4]?_0x4c1921[_0x8477('0x5e')][0x4][_0x8477('0x5f')]:undefined)||_0x8477('0x79')},{'name':_0x8477('0x6d'),'value':_0x4c1921[_0x8477('0x6d')]||(_0x4c1921[_0x8477('0x5e')]&&_0x4c1921[_0x8477('0x5e')][0x5]?_0x4c1921[_0x8477('0x5e')][0x5]['value']:undefined)||''},{'name':'attrFaxAccounts','value':_0x4c1921[_0x8477('0x6e')]||(_0x4c1921['attrs']&&_0x4c1921[_0x8477('0x5e')][0x6]?_0x4c1921[_0x8477('0x5e')][0x6][_0x8477('0x5f')]:undefined)||''},{'name':_0x8477('0x6f'),'value':_0x4c1921['attrSmsAccounts']||(_0x4c1921[_0x8477('0x5e')]&&_0x4c1921[_0x8477('0x5e')][0x7]?_0x4c1921[_0x8477('0x5e')][0x7]['value']:undefined)||''},{'name':_0x8477('0x70'),'value':_0x4c1921[_0x8477('0x70')]||(_0x4c1921[_0x8477('0x5e')]&&_0x4c1921['attrs'][0x8]?_0x4c1921['attrs'][0x8][_0x8477('0x5f')]:undefined)||''},{'name':_0x8477('0x71'),'value':_0x4c1921[_0x8477('0x71')]||(_0x4c1921[_0x8477('0x5e')]&&_0x4c1921[_0x8477('0x5e')][0x9]?_0x4c1921[_0x8477('0x5e')][0x9][_0x8477('0x5f')]:undefined)||''},{'name':'attrChatWebsites','value':_0x4c1921[_0x8477('0x72')]||(_0x4c1921[_0x8477('0x5e')]&&_0x4c1921[_0x8477('0x5e')][0xa]?_0x4c1921['attrs'][0xa]['value']:undefined)||''}];case _0x8477('0x7a'):return[{'name':_0x8477('0x7b'),'type':_0x4c1921[_0x8477('0x7c')]||(_0x4c1921['attrs']&&_0x4c1921[_0x8477('0x5e')][0x0]?_0x4c1921['attrs'][0x0][_0x8477('0x33')]:undefined)||null,'value':_0x4c1921[_0x8477('0x7b')]||(_0x4c1921['attrs']&&_0x4c1921[_0x8477('0x5e')][0x0]?_0x4c1921[_0x8477('0x5e')][0x0][_0x8477('0x5f')]:undefined)||null},{'name':_0x8477('0x7d'),'value':_0x4c1921[_0x8477('0x7d')]||(_0x4c1921[_0x8477('0x5e')]&&_0x4c1921[_0x8477('0x5e')][0x1]?_0x4c1921['attrs'][0x1][_0x8477('0x5f')]:undefined)||0x0}];default:return[];}}catch(_0x32bf19){logger[_0x8477('0x52')]('widgetAttributes:\x20%s',JSON[_0x8477('0x7e')](_0x32bf19));return[];}}exports[_0x8477('0x7f')]=function(_0x54e919,_0x33937c,_0x498109){if(_0x54e919[_0x8477('0x57')]['id']){delete _0x54e919['body']['id'];}return db['Dashboard'][_0x8477('0x4d')]({'where':{'id':_0x54e919[_0x8477('0x4a')]['id']}})['then'](handleEntityNotFound(_0x33937c,null))[_0x8477('0x2a')](function(_0x28cb4a){if(_0x28cb4a){_0x54e919['body']['DashboardId']=_0x28cb4a['id'];_0x54e919[_0x8477('0x57')][_0x8477('0x5e')]=widgetAttributes(_0x54e919[_0x8477('0x57')]);return db['DashboardItem'][_0x8477('0x4e')](_0x54e919[_0x8477('0x57')]);}})[_0x8477('0x2a')](respondWithResult(_0x33937c,null))[_0x8477('0x48')](handleError(_0x33937c,null));};exports[_0x8477('0x80')]=function(_0x315a05,_0x52ba9a,_0x5264bf){var _0x41cb01={};var _0x134cca={};var _0x58d327;var _0x224204;return db[_0x8477('0x31')][_0x8477('0x81')]({'where':{'id':_0x315a05['params']['id']}})[_0x8477('0x2a')](handleEntityNotFound(_0x52ba9a,null))[_0x8477('0x2a')](function(_0x39bc72){if(_0x39bc72){_0x58d327=_0x39bc72;_0x134cca['model']=_['keys'](db[_0x8477('0x82')]['rawAttributes']);_0x134cca[_0x8477('0x36')]=_[_0x8477('0x4b')](_0x315a05[_0x8477('0x36')]);_0x134cca['filters']=_[_0x8477('0x38')](_0x134cca[_0x8477('0x35')],_0x134cca['query']);_0x41cb01[_0x8477('0x39')]=_[_0x8477('0x38')](_0x134cca[_0x8477('0x35')],qs[_0x8477('0x3a')](_0x315a05[_0x8477('0x36')][_0x8477('0x3a')]));_0x41cb01['attributes']=_0x41cb01['attributes']['length']?_0x41cb01['attributes']:_0x134cca[_0x8477('0x35')];_0x41cb01[_0x8477('0x83')]=qs[_0x8477('0x3e')](_0x315a05[_0x8477('0x36')][_0x8477('0x3e')]);_0x41cb01[_0x8477('0x3f')]=qs[_0x8477('0x37')](_[_0x8477('0x40')](_0x315a05[_0x8477('0x36')],_0x134cca[_0x8477('0x37')]));if(_0x315a05['query']['filter']){_0x41cb01[_0x8477('0x3f')]=_[_0x8477('0x43')](_0x41cb01[_0x8477('0x3f')],{'$or':_['map'](_0x41cb01[_0x8477('0x39')],function(_0xfb7520){var _0x23a671={};_0x23a671[_0xfb7520]={'$like':'%'+_0x315a05[_0x8477('0x36')][_0x8477('0x41')]+'%'};return _0x23a671;})});}_0x41cb01=_[_0x8477('0x43')]({},_0x41cb01,_0x315a05[_0x8477('0x4c')]);return _0x58d327['getItems'](_0x41cb01);}})[_0x8477('0x2a')](function(_0x2d3b91){if(_0x2d3b91){_0x224204=_0x2d3b91[_0x8477('0x3b')];if(!_0x315a05[_0x8477('0x36')][_0x8477('0x3c')]('nolimit')){_0x41cb01[_0x8477('0x22')]=qs[_0x8477('0x22')](_0x315a05['query'][_0x8477('0x22')]);_0x41cb01[_0x8477('0x20')]=qs['offset'](_0x315a05['query'][_0x8477('0x20')]);}return _0x58d327[_0x8477('0x80')](_0x41cb01);}})[_0x8477('0x2a')](function(_0x3bf9ec){if(_0x3bf9ec){return _0x3bf9ec?{'count':_0x224204,'rows':_0x3bf9ec}:null;}})[_0x8477('0x2a')](respondWithResult(_0x52ba9a,null))['catch'](handleError(_0x52ba9a,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index bd9b440..fd7fcca 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 _0xe706=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','update','remove'];(function(_0x206a69,_0x4267f8){var _0x372f0f=function(_0x1745aa){while(--_0x1745aa){_0x206a69['push'](_0x206a69['shift']());}};_0x372f0f(++_0x4267f8);}(_0xe706,0x1ab));var _0x6e70=function(_0x255093,_0x4fe4fa){_0x255093=_0x255093-0x0;var _0x440166=_0xe706[_0x255093];return _0x440166;};'use strict';var EventEmitter=require(_0x6e70('0x0'));var Dashboard=require(_0x6e70('0x1'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0x6e70('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6e70('0x3'),'afterDestroy':_0x6e70('0x4')};function emitEvent(_0x35e727){return function(_0x5c9fb3,_0x26a1be,_0xdad23b){DashboardEvents[_0x6e70('0x5')](_0x35e727+':'+_0x5c9fb3['id'],_0x5c9fb3);DashboardEvents[_0x6e70('0x5')](_0x35e727,_0x5c9fb3);_0xdad23b(null);};}for(var e in events){if(events[_0x6e70('0x6')](e)){var event=events[e];Dashboard[_0x6e70('0x7')](e,emitEvent(event));}}module[_0x6e70('0x8')]=DashboardEvents; \ No newline at end of file +var _0x473a=['hook','exports','events','../../mysqldb','Dashboard','setMaxListeners','update','emit','hasOwnProperty'];(function(_0x197e06,_0x42c950){var _0xdff668=function(_0x21e7ec){while(--_0x21e7ec){_0x197e06['push'](_0x197e06['shift']());}};_0xdff668(++_0x42c950);}(_0x473a,0x173));var _0xa473=function(_0x449eb3,_0x23fdd4){_0x449eb3=_0x449eb3-0x0;var _0xb60e95=_0x473a[_0x449eb3];return _0xb60e95;};'use strict';var EventEmitter=require(_0xa473('0x0'));var Dashboard=require(_0xa473('0x1'))['db'][_0xa473('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xa473('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa473('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5c9ab6){return function(_0x502adb,_0x538241,_0x4fb489){DashboardEvents[_0xa473('0x5')](_0x5c9ab6+':'+_0x502adb['id'],_0x502adb);DashboardEvents[_0xa473('0x5')](_0x5c9ab6,_0x502adb);_0x4fb489(null);};}for(var e in events){if(events[_0xa473('0x6')](e)){var event=events[e];Dashboard[_0xa473('0x7')](e,emitEvent(event));}}module[_0xa473('0x8')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 0cc96fe..74bdd76 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 _0x209c=['./dashboard.attributes','define','Dashboard','dashboards','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x209c,0xba));var _0xc209=function(_0x4bac76,_0x13d59e){_0x4bac76=_0x4bac76-0x0;var _0x5bb31d=_0x209c[_0x4bac76];return _0x5bb31d;};'use strict';var _=require(_0xc209('0x0'));var util=require(_0xc209('0x1'));var logger=require(_0xc209('0x2'))(_0xc209('0x3'));var moment=require(_0xc209('0x4'));var BPromise=require('bluebird');var rp=require(_0xc209('0x5'));var fs=require('fs');var path=require(_0xc209('0x6'));var rimraf=require(_0xc209('0x7'));var config=require(_0xc209('0x8'));var attributes=require(_0xc209('0x9'));module['exports']=function(_0x3335d2,_0x133698){return _0x3335d2[_0xc209('0xa')](_0xc209('0xb'),attributes,{'tableName':_0xc209('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9153=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./dashboard.attributes','Dashboard','dashboards'];(function(_0x555c2b,_0x42f107){var _0x938e08=function(_0x5d3daf){while(--_0x5d3daf){_0x555c2b['push'](_0x555c2b['shift']());}};_0x938e08(++_0x42f107);}(_0x9153,0xd8));var _0x3915=function(_0xe9d0c8,_0x25972d){_0xe9d0c8=_0xe9d0c8-0x0;var _0xafd585=_0x9153[_0xe9d0c8];return _0xafd585;};'use strict';var _=require(_0x3915('0x0'));var util=require(_0x3915('0x1'));var logger=require(_0x3915('0x2'))(_0x3915('0x3'));var moment=require(_0x3915('0x4'));var BPromise=require(_0x3915('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3915('0x6'));var rimraf=require(_0x3915('0x7'));var config=require(_0x3915('0x8'));var attributes=require(_0x3915('0x9'));module['exports']=function(_0x1d9d5b,_0x494af8){return _0x1d9d5b['define'](_0x3915('0xa'),attributes,{'tableName':_0x3915('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 24cff63..913ee80 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 _0xae21=['message','result','catch','lodash','util','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','./dashboard.socket','register','request','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0xae21,0x121));var _0x1ae2=function(_0x1076a9,_0x37f26e){_0x1076a9=_0x1076a9-0x0;var _0x4d72ac=_0xae21[_0x1076a9];return _0x4d72ac;};'use strict';var _=require(_0x1ae2('0x0'));var util=require(_0x1ae2('0x1'));var moment=require('moment');var BPromise=require(_0x1ae2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1ae2('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x1ae2('0x4'))(_0x1ae2('0x5'));var config=require(_0x1ae2('0x6'));var jayson=require(_0x1ae2('0x7'));var client=jayson[_0x1ae2('0x8')]['http']({'port':0x232a});config[_0x1ae2('0x9')]=_[_0x1ae2('0xa')](config['redis'],{'host':_0x1ae2('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1ae2('0x9')]));require(_0x1ae2('0xc'))[_0x1ae2('0xd')](socket);function respondWithRpcPromise(_0x4446ab,_0x664230,_0x465e96){return new BPromise(function(_0x4831cf,_0x1ce8cc){return client[_0x1ae2('0xe')](_0x4446ab,_0x465e96)['then'](function(_0x4aadd9){logger[_0x1ae2('0xf')](_0x1ae2('0x10'),_0x664230,_0x1ae2('0x11'));logger[_0x1ae2('0x12')](_0x1ae2('0x13'),_0x664230,_0x1ae2('0x11'),JSON[_0x1ae2('0x14')](_0x4aadd9));if(_0x4aadd9[_0x1ae2('0x15')]){if(_0x4aadd9[_0x1ae2('0x15')][_0x1ae2('0x16')]===0x1f4){logger[_0x1ae2('0x15')](_0x1ae2('0x10'),_0x664230,_0x4aadd9['error'][_0x1ae2('0x17')]);return _0x1ce8cc(_0x4aadd9[_0x1ae2('0x15')][_0x1ae2('0x17')]);}logger['error'](_0x1ae2('0x10'),_0x664230,_0x4aadd9[_0x1ae2('0x15')]['message']);return _0x4831cf(_0x4aadd9['error']['message']);}else{logger[_0x1ae2('0xf')](_0x1ae2('0x10'),_0x664230,_0x1ae2('0x11'));_0x4831cf(_0x4aadd9[_0x1ae2('0x18')]['message']);}})[_0x1ae2('0x19')](function(_0x3b6dcc){logger[_0x1ae2('0x15')]('Dashboard,\x20%s,\x20%s',_0x664230,_0x3b6dcc);_0x1ce8cc(_0x3b6dcc);});});} \ No newline at end of file +var _0xe1e7=['client','defaults','redis','localhost','./dashboard.socket','register','request','request\x20sent','debug','stringify','error','Dashboard,\x20%s,\x20%s','message','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x350d86,_0x268906){var _0x3931e6=function(_0x2aa385){while(--_0x2aa385){_0x350d86['push'](_0x350d86['shift']());}};_0x3931e6(++_0x268906);}(_0xe1e7,0x157));var _0x7e1e=function(_0xc40a24,_0x29aef8){_0xc40a24=_0xc40a24-0x0;var _0x22e711=_0xe1e7[_0xc40a24];return _0x22e711;};'use strict';var _=require(_0x7e1e('0x0'));var util=require('util');var moment=require(_0x7e1e('0x1'));var BPromise=require(_0x7e1e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7e1e('0x3'));var db=require(_0x7e1e('0x4'))['db'];var utils=require(_0x7e1e('0x5'));var logger=require(_0x7e1e('0x6'))(_0x7e1e('0x7'));var config=require(_0x7e1e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7e1e('0x9')]['http']({'port':0x232a});config['redis']=_[_0x7e1e('0xa')](config[_0x7e1e('0xb')],{'host':_0x7e1e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7e1e('0xb')]));require(_0x7e1e('0xd'))[_0x7e1e('0xe')](socket);function respondWithRpcPromise(_0x41d732,_0x466dc8,_0x3562f0){return new BPromise(function(_0xc00347,_0x4932c6){return client[_0x7e1e('0xf')](_0x41d732,_0x3562f0)['then'](function(_0x1f30bc){logger['info']('Dashboard,\x20%s,\x20%s',_0x466dc8,_0x7e1e('0x10'));logger[_0x7e1e('0x11')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x466dc8,'request\x20sent',JSON[_0x7e1e('0x12')](_0x1f30bc));if(_0x1f30bc[_0x7e1e('0x13')]){if(_0x1f30bc[_0x7e1e('0x13')]['code']===0x1f4){logger['error'](_0x7e1e('0x14'),_0x466dc8,_0x1f30bc[_0x7e1e('0x13')][_0x7e1e('0x15')]);return _0x4932c6(_0x1f30bc[_0x7e1e('0x13')][_0x7e1e('0x15')]);}logger['error']('Dashboard,\x20%s,\x20%s',_0x466dc8,_0x1f30bc[_0x7e1e('0x13')]['message']);return _0xc00347(_0x1f30bc[_0x7e1e('0x13')][_0x7e1e('0x15')]);}else{logger['info'](_0x7e1e('0x14'),_0x466dc8,'request\x20sent');_0xc00347(_0x1f30bc['result'][_0x7e1e('0x15')]);}})['catch'](function(_0x437fad){logger[_0x7e1e('0x13')](_0x7e1e('0x14'),_0x466dc8,_0x437fad);_0x4932c6(_0x437fad);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 2b37d4a..cca0abe 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 _0xff8c=['removeListener','register','dashboard:','./dashboard.events','save'];(function(_0x1034ca,_0x14ecd6){var _0x1a023a=function(_0x2cfa65){while(--_0x2cfa65){_0x1034ca['push'](_0x1034ca['shift']());}};_0x1a023a(++_0x14ecd6);}(_0xff8c,0x10c));var _0xcff8=function(_0x1ceafa,_0x252713){_0x1ceafa=_0x1ceafa-0x0;var _0x2cb283=_0xff8c[_0x1ceafa];return _0x2cb283;};'use strict';var DashboardEvents=require(_0xcff8('0x0'));var events=[_0xcff8('0x1'),'remove','update'];function createListener(_0x1a23d2,_0x445c27){return function(_0x513a06){_0x445c27['emit'](_0x1a23d2,_0x513a06);};}function removeListener(_0x426f35,_0x22daf4){return function(){DashboardEvents[_0xcff8('0x2')](_0x426f35,_0x22daf4);};}exports[_0xcff8('0x3')]=function(_0x2e9aae){for(var _0x147749=0x0,_0x460bf8=events['length'];_0x147749<_0x460bf8;_0x147749++){var _0x363b22=events[_0x147749];var _0x126615=createListener(_0xcff8('0x4')+_0x363b22,_0x2e9aae);DashboardEvents['on'](_0x363b22,_0x126615);}}; \ No newline at end of file +var _0xb1cf=['register','dashboard:','./dashboard.events','save','remove','update','removeListener'];(function(_0x15203f,_0x85c12b){var _0x1c5d80=function(_0x18eb23){while(--_0x18eb23){_0x15203f['push'](_0x15203f['shift']());}};_0x1c5d80(++_0x85c12b);}(_0xb1cf,0x1de));var _0xfb1c=function(_0x3c68ac,_0x38b406){_0x3c68ac=_0x3c68ac-0x0;var _0x35d849=_0xb1cf[_0x3c68ac];return _0x35d849;};'use strict';var DashboardEvents=require(_0xfb1c('0x0'));var events=[_0xfb1c('0x1'),_0xfb1c('0x2'),_0xfb1c('0x3')];function createListener(_0x4200df,_0x3d4bd8){return function(_0x16e086){_0x3d4bd8['emit'](_0x4200df,_0x16e086);};}function removeListener(_0x28a4b7,_0x183cdc){return function(){DashboardEvents[_0xfb1c('0x4')](_0x28a4b7,_0x183cdc);};}exports[_0xfb1c('0x5')]=function(_0x3c2531){for(var _0xa24986=0x0,_0x50e646=events['length'];_0xa24986<_0x50e646;_0xa24986++){var _0x2c6b3a=events[_0xa24986];var _0x4f07c9=createListener(_0xfb1c('0x6')+_0x2c6b3a,_0x3c2531);DashboardEvents['on'](_0x2c6b3a,_0x4f07c9);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 8665c1c..076bb06 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 _0xff46=['post','create','/:id/clone','clone','addItem','put','/:id','update','delete','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','show','/:id/items'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xff46,0x1d6));var _0x6ff4=function(_0x3c1eeb,_0x5905a5){_0x3c1eeb=_0x3c1eeb-0x0;var _0x1ad9bd=_0xff46[_0x3c1eeb];return _0x1ad9bd;};'use strict';var multer=require(_0x6ff4('0x0'));var util=require(_0x6ff4('0x1'));var path=require('path');var timeout=require(_0x6ff4('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6ff4('0x3'));var auth=require(_0x6ff4('0x4'));var interaction=require(_0x6ff4('0x5'));var config=require(_0x6ff4('0x6'));var controller=require(_0x6ff4('0x7'));router[_0x6ff4('0x8')]('/',auth[_0x6ff4('0x9')](),controller[_0x6ff4('0xa')]);router[_0x6ff4('0x8')]('/:id',auth[_0x6ff4('0x9')](),controller[_0x6ff4('0xb')]);router[_0x6ff4('0x8')](_0x6ff4('0xc'),auth[_0x6ff4('0x9')](),controller['getItems']);router[_0x6ff4('0xd')]('/',auth['isAuthenticated'](),controller[_0x6ff4('0xe')]);router[_0x6ff4('0xd')](_0x6ff4('0xf'),auth['isAuthenticated'](),controller[_0x6ff4('0x10')]);router[_0x6ff4('0xd')]('/:id/items',auth[_0x6ff4('0x9')](),controller[_0x6ff4('0x11')]);router[_0x6ff4('0x12')](_0x6ff4('0x13'),auth['isAuthenticated'](),controller[_0x6ff4('0x14')]);router[_0x6ff4('0x15')](_0x6ff4('0x13'),auth['isAuthenticated'](),controller['destroy']);module[_0x6ff4('0x16')]=router; \ No newline at end of file +var _0xad93=['create','/:id/clone','clone','addItem','put','delete','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','/:id','/:id/items','getItems','post'];(function(_0x47234f,_0x4b4b38){var _0x1fc6ed=function(_0x34ce09){while(--_0x34ce09){_0x47234f['push'](_0x47234f['shift']());}};_0x1fc6ed(++_0x4b4b38);}(_0xad93,0x1bc));var _0x3ad9=function(_0x46ed0f,_0xab0142){_0x46ed0f=_0x46ed0f-0x0;var _0x4fcd95=_0xad93[_0x46ed0f];return _0x4fcd95;};'use strict';var multer=require(_0x3ad9('0x0'));var util=require(_0x3ad9('0x1'));var path=require(_0x3ad9('0x2'));var timeout=require('connect-timeout');var express=require(_0x3ad9('0x3'));var router=express[_0x3ad9('0x4')]();var fs_extra=require(_0x3ad9('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3ad9('0x6'));var config=require(_0x3ad9('0x7'));var controller=require(_0x3ad9('0x8'));router[_0x3ad9('0x9')]('/',auth[_0x3ad9('0xa')](),controller[_0x3ad9('0xb')]);router[_0x3ad9('0x9')](_0x3ad9('0xc'),auth[_0x3ad9('0xa')](),controller['show']);router['get'](_0x3ad9('0xd'),auth[_0x3ad9('0xa')](),controller[_0x3ad9('0xe')]);router[_0x3ad9('0xf')]('/',auth['isAuthenticated'](),controller[_0x3ad9('0x10')]);router[_0x3ad9('0xf')](_0x3ad9('0x11'),auth['isAuthenticated'](),controller[_0x3ad9('0x12')]);router[_0x3ad9('0xf')](_0x3ad9('0xd'),auth[_0x3ad9('0xa')](),controller[_0x3ad9('0x13')]);router[_0x3ad9('0x14')]('/:id',auth[_0x3ad9('0xa')](),controller['update']);router[_0x3ad9('0x15')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x3ad9('0x16')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 05db351..6727caa 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 _0xabce=['squel','lodash','exports','STRING','long','parse','getDataValue','attrs','setDataValue','INTEGER','#ffffff','#2196f3','sequelize'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xabce,0x103));var _0xeabc=function(_0x34021d,_0x753aa6){_0x34021d=_0x34021d-0x0;var _0x16597b=_0xabce[_0x34021d];return _0x16597b;};'use strict';var Sequelize=require(_0xeabc('0x0'));var squel=require(_0xeabc('0x1'));var _=require(_0xeabc('0x2'));module[_0xeabc('0x3')]={'title':{'type':Sequelize[_0xeabc('0x4')],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0xeabc('0x5')),'get':function(){try{return JSON[_0xeabc('0x6')](this[_0xeabc('0x7')]('attrs'));}catch(_0x54e4a8){return[];}},'set':function(_0x1b07a8){try{this['setDataValue'](_0xeabc('0x8'),JSON['stringify'](_0x1b07a8));}catch(_0x3bdc29){this[_0xeabc('0x9')](_0xeabc('0x8'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0xeabc('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xeabc('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xeabc('0xa')]},'col':{'type':Sequelize[_0xeabc('0xa')]},'background':{'type':Sequelize[_0xeabc('0x4')],'allowNull':![],'defaultValue':_0xeabc('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xeabc('0x4')],'allowNull':![],'defaultValue':_0xeabc('0xc'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xeabc('0x4')]},'titleFontSize':{'type':Sequelize[_0xeabc('0xa')],'defaultValue':0xc}}; \ No newline at end of file +var _0x814b=['lodash','exports','STRING','long','parse','getDataValue','attrs','stringify','setDataValue','INTEGER','#ffffff','#2196f3','sequelize','squel'];(function(_0x38febf,_0x1fdebc){var _0x36db7f=function(_0x4d13b8){while(--_0x4d13b8){_0x38febf['push'](_0x38febf['shift']());}};_0x36db7f(++_0x1fdebc);}(_0x814b,0x1a2));var _0xb814=function(_0x3c3e72,_0x3e1858){_0x3c3e72=_0x3c3e72-0x0;var _0x48a7e5=_0x814b[_0x3c3e72];return _0x48a7e5;};'use strict';var Sequelize=require(_0xb814('0x0'));var squel=require(_0xb814('0x1'));var _=require(_0xb814('0x2'));module[_0xb814('0x3')]={'title':{'type':Sequelize[_0xb814('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0xb814('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0xb814('0x5')),'get':function(){try{return JSON[_0xb814('0x6')](this[_0xb814('0x7')](_0xb814('0x8')));}catch(_0x44931c){return[];}},'set':function(_0x322a70){try{this['setDataValue'](_0xb814('0x8'),JSON[_0xb814('0x9')](_0x322a70));}catch(_0x5c8539){this[_0xb814('0xa')](_0xb814('0x8'),JSON[_0xb814('0x9')]([]));}}},'sizeX':{'type':Sequelize[_0xb814('0xb')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xb814('0xb')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xb814('0xb')]},'col':{'type':Sequelize[_0xb814('0xb')]},'background':{'type':Sequelize[_0xb814('0x4')],'allowNull':![],'defaultValue':_0xb814('0xc'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xb814('0x4')],'allowNull':![],'defaultValue':_0xb814('0xd'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']},'titleFontSize':{'type':Sequelize[_0xb814('0xb')],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index a4ce6c0..72fd2c4 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 _0x81d4=['DashboardItem','find','catch','iframe','attrUrl','attrs','value','https://','custom','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','pie-chart','attrSerie1','attrSerie3','web-report','attrReport','attrRefresh','create','body','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','./dashboardItem.socket','register','sendStatus','status','end','json','offset','limit','count','Content-Range','apply','save','update','then','destroy','error','stack','name','send','show','params','keys','filters','model','query','attributes','intersection','fields','length','includeAll','merge','options'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x81d4,0x197));var _0x481d=function(_0x1b3e49,_0x299f04){_0x1b3e49=_0x1b3e49-0x0;var _0x596fb2=_0x81d4[_0x1b3e49];return _0x596fb2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x481d('0x0'));var zipdir=require(_0x481d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x481d('0x2'));var moment=require(_0x481d('0x3'));var BPromise=require(_0x481d('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x481d('0x5'));var sox=require(_0x481d('0x6'));var csv=require(_0x481d('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x481d('0x8'));var _=require(_0x481d('0x9'));var squel=require(_0x481d('0xa'));var crypto=require(_0x481d('0xb'));var jsforce=require(_0x481d('0xc'));var deskjs=require(_0x481d('0xd'));var toCsv=require('to-csv');var querystring=require(_0x481d('0xe'));var Papa=require(_0x481d('0xf'));var Redis=require(_0x481d('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x481d('0x11'));var as=require(_0x481d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x481d('0x13'))(_0x481d('0x14'));var utils=require(_0x481d('0x15'));var config=require(_0x481d('0x16'));var licenseUtil=require(_0x481d('0x17'));var db=require(_0x481d('0x18'))['db'];config[_0x481d('0x19')]=_['defaults'](config[_0x481d('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x481d('0x19')]));require(_0x481d('0x1a'))[_0x481d('0x1b')](socket);function respondWithStatusCode(_0x5cbe7e,_0x1e4fe8){_0x1e4fe8=_0x1e4fe8||0xcc;return function(_0x573044){if(_0x573044){return _0x5cbe7e[_0x481d('0x1c')](_0x1e4fe8);}return _0x5cbe7e[_0x481d('0x1d')](_0x1e4fe8)[_0x481d('0x1e')]();};}function respondWithResult(_0x1bda12,_0x879e29){_0x879e29=_0x879e29||0xc8;return function(_0x59c5d5){if(_0x59c5d5){return _0x1bda12[_0x481d('0x1d')](_0x879e29)[_0x481d('0x1f')](_0x59c5d5);}};}function respondWithFilteredResult(_0x3e2a27,_0x4f399b){return function(_0x21e2a5){if(_0x21e2a5){var _0x5056c7=typeof _0x4f399b[_0x481d('0x20')]==='undefined'&&typeof _0x4f399b[_0x481d('0x21')]==='undefined';var _0x30ef03=_0x21e2a5['count'];var _0x2c52bc=_0x5056c7?0x0:_0x4f399b['offset'];var _0x408a94=_0x5056c7?_0x21e2a5[_0x481d('0x22')]:_0x4f399b['offset']+_0x4f399b[_0x481d('0x21')];var _0x3856b3;if(_0x408a94>=_0x30ef03){_0x408a94=_0x30ef03;_0x3856b3=0xc8;}else{_0x3856b3=0xce;}_0x3e2a27[_0x481d('0x1d')](_0x3856b3);return _0x3e2a27['set'](_0x481d('0x23'),_0x2c52bc+'-'+_0x408a94+'/'+_0x30ef03)['json'](_0x21e2a5);}return null;};}function patchUpdates(_0x560b33){return function(_0x53022c){try{jsonpatch[_0x481d('0x24')](_0x53022c,_0x560b33,!![]);}catch(_0x5a81e6){return BPromise['reject'](_0x5a81e6);}return _0x53022c[_0x481d('0x25')]();};}function saveUpdates(_0x237c02,_0x10e8a1){return function(_0x4cff7d){if(_0x4cff7d){return _0x4cff7d[_0x481d('0x26')](_0x237c02)[_0x481d('0x27')](function(_0x51e3a){return _0x51e3a;});}return null;};}function removeEntity(_0x3cc630,_0x485de5){return function(_0xa9c913){if(_0xa9c913){return _0xa9c913[_0x481d('0x28')]()['then'](function(){_0x3cc630[_0x481d('0x1d')](0xcc)[_0x481d('0x1e')]();});}};}function handleEntityNotFound(_0x4001b9,_0x5173b2){return function(_0x599e61){if(!_0x599e61){_0x4001b9[_0x481d('0x1c')](0x194);}return _0x599e61;};}function handleError(_0x312c7a,_0x59c9e1){_0x59c9e1=_0x59c9e1||0x1f4;return function(_0x55bf9c){logger[_0x481d('0x29')](_0x55bf9c[_0x481d('0x2a')]);if(_0x55bf9c[_0x481d('0x2b')]){delete _0x55bf9c[_0x481d('0x2b')];}_0x312c7a[_0x481d('0x1d')](_0x59c9e1)[_0x481d('0x2c')](_0x55bf9c);};}exports[_0x481d('0x2d')]=function(_0x1bfff7,_0x36bf9f){var _0x447ac3={'raw':![],'where':{'id':_0x1bfff7[_0x481d('0x2e')]['id']}},_0x46f01b={};_0x46f01b['model']=_[_0x481d('0x2f')](db['DashboardItem']['rawAttributes']);_0x46f01b['query']=_[_0x481d('0x2f')](_0x1bfff7['query']);_0x46f01b[_0x481d('0x30')]=_['intersection'](_0x46f01b[_0x481d('0x31')],_0x46f01b[_0x481d('0x32')]);_0x447ac3[_0x481d('0x33')]=_[_0x481d('0x34')](_0x46f01b[_0x481d('0x31')],qs[_0x481d('0x35')](_0x1bfff7[_0x481d('0x32')][_0x481d('0x35')]));_0x447ac3[_0x481d('0x33')]=_0x447ac3[_0x481d('0x33')][_0x481d('0x36')]?_0x447ac3[_0x481d('0x33')]:_0x46f01b[_0x481d('0x31')];if(_0x1bfff7[_0x481d('0x32')][_0x481d('0x37')]){_0x447ac3['include']=[{'all':!![]}];}_0x447ac3=_[_0x481d('0x38')]({},_0x447ac3,_0x1bfff7[_0x481d('0x39')]);return db[_0x481d('0x3a')][_0x481d('0x3b')](_0x447ac3)[_0x481d('0x27')](handleEntityNotFound(_0x36bf9f,null))[_0x481d('0x27')](respondWithResult(_0x36bf9f,null))[_0x481d('0x3c')](handleError(_0x36bf9f,null));};exports[_0x481d('0x28')]=function(_0x545639,_0x2f90e1){return db[_0x481d('0x3a')][_0x481d('0x3b')]({'where':{'id':_0x545639[_0x481d('0x2e')]['id']}})[_0x481d('0x27')](handleEntityNotFound(_0x2f90e1,null))['then'](removeEntity(_0x2f90e1,null))['catch'](handleError(_0x2f90e1,null));};function widgetAttributes(_0x3dbc31){try{switch(_0x3dbc31['type']){case _0x481d('0x3d'):return[{'name':_0x481d('0x3e'),'value':_0x3dbc31[_0x481d('0x3e')]||(_0x3dbc31[_0x481d('0x3f')]&&_0x3dbc31[_0x481d('0x3f')][0x0]?_0x3dbc31[_0x481d('0x3f')][0x0][_0x481d('0x40')]:undefined)||_0x481d('0x41')}];case _0x481d('0x42'):return[{'name':'attrPath','value':_0x3dbc31['attrPath']||(_0x3dbc31[_0x481d('0x3f')]&&_0x3dbc31[_0x481d('0x3f')][0x0]?_0x3dbc31['attrs'][0x0][_0x481d('0x40')]:undefined)||''}];case _0x481d('0x43'):return[{'name':'attrHourFormat','value':_0x3dbc31[_0x481d('0x44')]||(_0x3dbc31[_0x481d('0x3f')]&&_0x3dbc31[_0x481d('0x3f')][0x0]?_0x3dbc31[_0x481d('0x3f')][0x0][_0x481d('0x40')]:undefined)||_0x481d('0x45')},{'name':'attrTimezone','value':_0x3dbc31[_0x481d('0x46')]||(_0x3dbc31[_0x481d('0x3f')]&&_0x3dbc31[_0x481d('0x3f')][0x1]?_0x3dbc31[_0x481d('0x3f')][0x1]['value']:undefined)||_0x481d('0x47')},{'name':_0x481d('0x48'),'value':_0x3dbc31[_0x481d('0x48')]||(_0x3dbc31[_0x481d('0x3f')]&&_0x3dbc31['attrs'][0x2]?_0x3dbc31[_0x481d('0x3f')][0x2]['value']:undefined)||0xc}];case _0x481d('0x49'):return[{'name':_0x481d('0x4a'),'value':_0x3dbc31[_0x481d('0x4a')]||(_0x3dbc31[_0x481d('0x3f')]&&_0x3dbc31[_0x481d('0x3f')][0x0]?_0x3dbc31[_0x481d('0x3f')][0x0][_0x481d('0x40')]:undefined)||_0x481d('0x4b')},{'name':'attrVoiceQueues','value':_0x3dbc31[_0x481d('0x4c')]||(_0x3dbc31[_0x481d('0x3f')]&&_0x3dbc31[_0x481d('0x3f')][0x1]?_0x3dbc31[_0x481d('0x3f')][0x1]['value']:undefined)||[]},{'name':_0x481d('0x48'),'value':_0x3dbc31[_0x481d('0x48')]||(_0x3dbc31[_0x481d('0x3f')]&&_0x3dbc31[_0x481d('0x3f')][0x2]?_0x3dbc31[_0x481d('0x3f')][0x2][_0x481d('0x40')]:undefined)||0x14},{'name':_0x481d('0x4d'),'value':_0x3dbc31[_0x481d('0x4d')]||(_0x3dbc31[_0x481d('0x3f')]&&_0x3dbc31[_0x481d('0x3f')][0x3]?_0x3dbc31[_0x481d('0x3f')][0x3][_0x481d('0x40')]:undefined)||_0x481d('0x4e')},{'name':_0x481d('0x4f'),'value':_0x3dbc31['attrEmailAccounts']||(_0x3dbc31['attrs']&&_0x3dbc31[_0x481d('0x3f')][0x4]?_0x3dbc31[_0x481d('0x3f')][0x4][_0x481d('0x40')]:undefined)||''},{'name':_0x481d('0x50'),'value':_0x3dbc31['attrFaxAccounts']||(_0x3dbc31[_0x481d('0x3f')]&&_0x3dbc31[_0x481d('0x3f')][0x5]?_0x3dbc31['attrs'][0x5][_0x481d('0x40')]:undefined)||''},{'name':_0x481d('0x51'),'value':_0x3dbc31[_0x481d('0x51')]||(_0x3dbc31[_0x481d('0x3f')]&&_0x3dbc31['attrs'][0x6]?_0x3dbc31['attrs'][0x6][_0x481d('0x40')]:undefined)||''},{'name':_0x481d('0x52'),'value':_0x3dbc31[_0x481d('0x52')]||(_0x3dbc31[_0x481d('0x3f')]&&_0x3dbc31[_0x481d('0x3f')][0x7]?_0x3dbc31[_0x481d('0x3f')][0x7][_0x481d('0x40')]:undefined)||''},{'name':_0x481d('0x53'),'value':_0x3dbc31[_0x481d('0x53')]||(_0x3dbc31['attrs']&&_0x3dbc31['attrs'][0x8]?_0x3dbc31['attrs'][0x8][_0x481d('0x40')]:undefined)||''},{'name':_0x481d('0x54'),'value':_0x3dbc31[_0x481d('0x54')]||(_0x3dbc31[_0x481d('0x3f')]&&_0x3dbc31[_0x481d('0x3f')][0x9]?_0x3dbc31[_0x481d('0x3f')][0x9][_0x481d('0x40')]:undefined)||''}];case'multibar-chart':case _0x481d('0x55'):return[{'name':_0x481d('0x56'),'value':_0x3dbc31[_0x481d('0x56')]||(_0x3dbc31[_0x481d('0x3f')]&&_0x3dbc31[_0x481d('0x3f')][0x0]?_0x3dbc31[_0x481d('0x3f')][0x0][_0x481d('0x40')]:undefined)||'total'},{'name':'attrSerie2','value':_0x3dbc31['attrSerie2']||(_0x3dbc31[_0x481d('0x3f')]&&_0x3dbc31[_0x481d('0x3f')][0x1]?_0x3dbc31[_0x481d('0x3f')][0x1][_0x481d('0x40')]:undefined)||null},{'name':_0x481d('0x57'),'value':_0x3dbc31[_0x481d('0x57')]||(_0x3dbc31[_0x481d('0x3f')]&&_0x3dbc31[_0x481d('0x3f')][0x2]?_0x3dbc31[_0x481d('0x3f')][0x2]['value']:undefined)||null},{'name':'attrVoiceQueues','value':_0x3dbc31[_0x481d('0x4c')]||(_0x3dbc31['attrs']&&_0x3dbc31[_0x481d('0x3f')][0x3]?_0x3dbc31[_0x481d('0x3f')][0x3]['value']:undefined)||[]},{'name':_0x481d('0x4d'),'value':_0x3dbc31[_0x481d('0x4d')]||(_0x3dbc31[_0x481d('0x3f')]&&_0x3dbc31[_0x481d('0x3f')][0x4]?_0x3dbc31['attrs'][0x4][_0x481d('0x40')]:undefined)||'voice'},{'name':'attrEmailAccounts','value':_0x3dbc31[_0x481d('0x4f')]||(_0x3dbc31[_0x481d('0x3f')]&&_0x3dbc31['attrs'][0x5]?_0x3dbc31['attrs'][0x5][_0x481d('0x40')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x3dbc31[_0x481d('0x50')]||(_0x3dbc31[_0x481d('0x3f')]&&_0x3dbc31[_0x481d('0x3f')][0x6]?_0x3dbc31[_0x481d('0x3f')][0x6][_0x481d('0x40')]:undefined)||''},{'name':_0x481d('0x51'),'value':_0x3dbc31['attrSmsAccounts']||(_0x3dbc31['attrs']&&_0x3dbc31[_0x481d('0x3f')][0x7]?_0x3dbc31[_0x481d('0x3f')][0x7][_0x481d('0x40')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x3dbc31[_0x481d('0x52')]||(_0x3dbc31[_0x481d('0x3f')]&&_0x3dbc31[_0x481d('0x3f')][0x8]?_0x3dbc31[_0x481d('0x3f')][0x8]['value']:undefined)||''},{'name':_0x481d('0x53'),'value':_0x3dbc31[_0x481d('0x53')]||(_0x3dbc31[_0x481d('0x3f')]&&_0x3dbc31['attrs'][0x9]?_0x3dbc31[_0x481d('0x3f')][0x9][_0x481d('0x40')]:undefined)||''},{'name':'attrChatWebsites','value':_0x3dbc31['attrChatWebsites']||(_0x3dbc31[_0x481d('0x3f')]&&_0x3dbc31[_0x481d('0x3f')][0xa]?_0x3dbc31[_0x481d('0x3f')][0xa][_0x481d('0x40')]:undefined)||''}];case _0x481d('0x58'):return[{'name':_0x481d('0x59'),'type':_0x3dbc31['reportType']||(_0x3dbc31[_0x481d('0x3f')]&&_0x3dbc31[_0x481d('0x3f')][0x0]?_0x3dbc31[_0x481d('0x3f')][0x0]['type']:undefined)||null,'value':_0x3dbc31[_0x481d('0x59')]||(_0x3dbc31[_0x481d('0x3f')]&&_0x3dbc31['attrs'][0x0]?_0x3dbc31[_0x481d('0x3f')][0x0][_0x481d('0x40')]:undefined)||null},{'name':_0x481d('0x5a'),'value':_0x3dbc31[_0x481d('0x5a')]||(_0x3dbc31[_0x481d('0x3f')]&&_0x3dbc31[_0x481d('0x3f')][0x1]?_0x3dbc31[_0x481d('0x3f')][0x1][_0x481d('0x40')]:undefined)||0x0}];default:return[];}}catch(_0x1aa87c){logger[_0x481d('0x29')]('widgetAttributes:\x20%s',JSON['stringify'](_0x1aa87c));return[];}}exports[_0x481d('0x5b')]=function(_0x1bca6b,_0x4cbbd9){if(_0x1bca6b[_0x481d('0x5c')]){_0x1bca6b[_0x481d('0x5c')][_0x481d('0x3f')]=widgetAttributes(_0x1bca6b[_0x481d('0x5c')]);}return db['DashboardItem'][_0x481d('0x5b')](_0x1bca6b[_0x481d('0x5c')],{})[_0x481d('0x27')](respondWithResult(_0x4cbbd9,0xc9))[_0x481d('0x3c')](handleError(_0x4cbbd9,null));};exports[_0x481d('0x26')]=function(_0x113954,_0xf07245){if(_0x113954['body']['id']){delete _0x113954[_0x481d('0x5c')]['id'];}_0x113954['body'][_0x481d('0x3f')]=widgetAttributes(_0x113954['body']);return db[_0x481d('0x3a')]['find']({'where':{'id':_0x113954[_0x481d('0x2e')]['id']}})[_0x481d('0x27')](handleEntityNotFound(_0xf07245,null))[_0x481d('0x27')](saveUpdates(_0x113954['body'],null))['then'](respondWithResult(_0xf07245,null))[_0x481d('0x3c')](handleError(_0xf07245,null));}; \ No newline at end of file +var _0x5502=['widgetAttributes:\x20%s','stringify','body','create','eml-format','rimraf','zip-dir','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/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','end','json','limit','count','offset','set','Content-Range','apply','save','update','destroy','then','error','stack','name','send','show','model','keys','DashboardItem','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','merge','options','catch','find','params','type','iframe','attrs','https://','custom','attrPath','value','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrVoiceQueues','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrChannel','web-report','attrReport','reportType','attrRefresh'];(function(_0x14360a,_0x28497a){var _0x55e13e=function(_0x5a9e94){while(--_0x5a9e94){_0x14360a['push'](_0x14360a['shift']());}};_0x55e13e(++_0x28497a);}(_0x5502,0x69));var _0x2550=function(_0x39b5bd,_0x398098){_0x39b5bd=_0x39b5bd-0x0;var _0x3791cb=_0x5502[_0x39b5bd];return _0x3791cb;};'use strict';var emlformat=require(_0x2550('0x0'));var rimraf=require(_0x2550('0x1'));var zipdir=require(_0x2550('0x2'));var jsonpatch=require(_0x2550('0x3'));var rp=require(_0x2550('0x4'));var moment=require(_0x2550('0x5'));var BPromise=require(_0x2550('0x6'));var Mustache=require(_0x2550('0x7'));var util=require(_0x2550('0x8'));var path=require(_0x2550('0x9'));var sox=require(_0x2550('0xa'));var csv=require(_0x2550('0xb'));var ejs=require(_0x2550('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2550('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2550('0xe'));var deskjs=require(_0x2550('0xf'));var toCsv=require('to-csv');var querystring=require(_0x2550('0x10'));var Papa=require('papaparse');var Redis=require(_0x2550('0x11'));var authService=require(_0x2550('0x12'));var qs=require(_0x2550('0x13'));var as=require(_0x2550('0x14'));var hardwareService=require(_0x2550('0x15'));var logger=require(_0x2550('0x16'))('api');var utils=require(_0x2550('0x17'));var config=require(_0x2550('0x18'));var licenseUtil=require(_0x2550('0x19'));var db=require(_0x2550('0x1a'))['db'];config['redis']=_[_0x2550('0x1b')](config[_0x2550('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0x2550('0x1d'))(new Redis(config[_0x2550('0x1c')]));require(_0x2550('0x1e'))[_0x2550('0x1f')](socket);function respondWithStatusCode(_0x3fef28,_0x2ddec1){_0x2ddec1=_0x2ddec1||0xcc;return function(_0x5aed8d){if(_0x5aed8d){return _0x3fef28[_0x2550('0x20')](_0x2ddec1);}return _0x3fef28[_0x2550('0x21')](_0x2ddec1)[_0x2550('0x22')]();};}function respondWithResult(_0x179866,_0x3f480b){_0x3f480b=_0x3f480b||0xc8;return function(_0x21de36){if(_0x21de36){return _0x179866['status'](_0x3f480b)[_0x2550('0x23')](_0x21de36);}};}function respondWithFilteredResult(_0x2d06e1,_0x75cd16){return function(_0x5c1bcb){if(_0x5c1bcb){var _0x98f713=typeof _0x75cd16['offset']==='undefined'&&typeof _0x75cd16[_0x2550('0x24')]==='undefined';var _0x2324ce=_0x5c1bcb[_0x2550('0x25')];var _0xb666cd=_0x98f713?0x0:_0x75cd16[_0x2550('0x26')];var _0x3f9b60=_0x98f713?_0x5c1bcb['count']:_0x75cd16['offset']+_0x75cd16['limit'];var _0x15581e;if(_0x3f9b60>=_0x2324ce){_0x3f9b60=_0x2324ce;_0x15581e=0xc8;}else{_0x15581e=0xce;}_0x2d06e1[_0x2550('0x21')](_0x15581e);return _0x2d06e1[_0x2550('0x27')](_0x2550('0x28'),_0xb666cd+'-'+_0x3f9b60+'/'+_0x2324ce)[_0x2550('0x23')](_0x5c1bcb);}return null;};}function patchUpdates(_0x28359b){return function(_0x21b6fb){try{jsonpatch[_0x2550('0x29')](_0x21b6fb,_0x28359b,!![]);}catch(_0x1d3d19){return BPromise['reject'](_0x1d3d19);}return _0x21b6fb[_0x2550('0x2a')]();};}function saveUpdates(_0x4715f6,_0x5c024e){return function(_0x1adb08){if(_0x1adb08){return _0x1adb08[_0x2550('0x2b')](_0x4715f6)['then'](function(_0x418828){return _0x418828;});}return null;};}function removeEntity(_0x3e15d2,_0x1431ea){return function(_0x3da957){if(_0x3da957){return _0x3da957[_0x2550('0x2c')]()[_0x2550('0x2d')](function(){_0x3e15d2[_0x2550('0x21')](0xcc)[_0x2550('0x22')]();});}};}function handleEntityNotFound(_0x2839f2,_0x125452){return function(_0xe2744b){if(!_0xe2744b){_0x2839f2[_0x2550('0x20')](0x194);}return _0xe2744b;};}function handleError(_0x12ea94,_0x511b4a){_0x511b4a=_0x511b4a||0x1f4;return function(_0x2e1fc6){logger[_0x2550('0x2e')](_0x2e1fc6[_0x2550('0x2f')]);if(_0x2e1fc6[_0x2550('0x30')]){delete _0x2e1fc6[_0x2550('0x30')];}_0x12ea94[_0x2550('0x21')](_0x511b4a)[_0x2550('0x31')](_0x2e1fc6);};}exports[_0x2550('0x32')]=function(_0x2beed7,_0x256509){var _0x222f62={'raw':![],'where':{'id':_0x2beed7['params']['id']}},_0x3c6613={};_0x3c6613[_0x2550('0x33')]=_[_0x2550('0x34')](db[_0x2550('0x35')][_0x2550('0x36')]);_0x3c6613[_0x2550('0x37')]=_['keys'](_0x2beed7['query']);_0x3c6613[_0x2550('0x38')]=_[_0x2550('0x39')](_0x3c6613[_0x2550('0x33')],_0x3c6613['query']);_0x222f62[_0x2550('0x3a')]=_[_0x2550('0x39')](_0x3c6613[_0x2550('0x33')],qs['fields'](_0x2beed7[_0x2550('0x37')][_0x2550('0x3b')]));_0x222f62[_0x2550('0x3a')]=_0x222f62['attributes'][_0x2550('0x3c')]?_0x222f62['attributes']:_0x3c6613[_0x2550('0x33')];if(_0x2beed7[_0x2550('0x37')][_0x2550('0x3d')]){_0x222f62['include']=[{'all':!![]}];}_0x222f62=_[_0x2550('0x3e')]({},_0x222f62,_0x2beed7[_0x2550('0x3f')]);return db['DashboardItem']['find'](_0x222f62)[_0x2550('0x2d')](handleEntityNotFound(_0x256509,null))[_0x2550('0x2d')](respondWithResult(_0x256509,null))[_0x2550('0x40')](handleError(_0x256509,null));};exports[_0x2550('0x2c')]=function(_0x1ea349,_0x254456){return db[_0x2550('0x35')][_0x2550('0x41')]({'where':{'id':_0x1ea349[_0x2550('0x42')]['id']}})[_0x2550('0x2d')](handleEntityNotFound(_0x254456,null))[_0x2550('0x2d')](removeEntity(_0x254456,null))[_0x2550('0x40')](handleError(_0x254456,null));};function widgetAttributes(_0x1f7e04){try{switch(_0x1f7e04[_0x2550('0x43')]){case _0x2550('0x44'):return[{'name':'attrUrl','value':_0x1f7e04['attrUrl']||(_0x1f7e04[_0x2550('0x45')]&&_0x1f7e04['attrs'][0x0]?_0x1f7e04[_0x2550('0x45')][0x0]['value']:undefined)||_0x2550('0x46')}];case _0x2550('0x47'):return[{'name':_0x2550('0x48'),'value':_0x1f7e04['attrPath']||(_0x1f7e04['attrs']&&_0x1f7e04['attrs'][0x0]?_0x1f7e04['attrs'][0x0][_0x2550('0x49')]:undefined)||''}];case'clock':return[{'name':_0x2550('0x4a'),'value':_0x1f7e04[_0x2550('0x4a')]||(_0x1f7e04[_0x2550('0x45')]&&_0x1f7e04[_0x2550('0x45')][0x0]?_0x1f7e04[_0x2550('0x45')][0x0][_0x2550('0x49')]:undefined)||'HH:mm:ss'},{'name':_0x2550('0x4b'),'value':_0x1f7e04[_0x2550('0x4b')]||(_0x1f7e04[_0x2550('0x45')]&&_0x1f7e04['attrs'][0x1]?_0x1f7e04[_0x2550('0x45')][0x1]['value']:undefined)||_0x2550('0x4c')},{'name':_0x2550('0x4d'),'value':_0x1f7e04[_0x2550('0x4d')]||(_0x1f7e04[_0x2550('0x45')]&&_0x1f7e04[_0x2550('0x45')][0x2]?_0x1f7e04[_0x2550('0x45')][0x2][_0x2550('0x49')]:undefined)||0xc}];case _0x2550('0x4e'):return[{'name':'attrMetric','value':_0x1f7e04['attrMetric']||(_0x1f7e04[_0x2550('0x45')]&&_0x1f7e04[_0x2550('0x45')][0x0]?_0x1f7e04[_0x2550('0x45')][0x0][_0x2550('0x49')]:undefined)||'total'},{'name':'attrVoiceQueues','value':_0x1f7e04[_0x2550('0x4f')]||(_0x1f7e04[_0x2550('0x45')]&&_0x1f7e04[_0x2550('0x45')][0x1]?_0x1f7e04[_0x2550('0x45')][0x1][_0x2550('0x49')]:undefined)||[]},{'name':_0x2550('0x4d'),'value':_0x1f7e04[_0x2550('0x4d')]||(_0x1f7e04[_0x2550('0x45')]&&_0x1f7e04[_0x2550('0x45')][0x2]?_0x1f7e04[_0x2550('0x45')][0x2][_0x2550('0x49')]:undefined)||0x14},{'name':'attrChannel','value':_0x1f7e04['attrChannel']||(_0x1f7e04['attrs']&&_0x1f7e04['attrs'][0x3]?_0x1f7e04[_0x2550('0x45')][0x3][_0x2550('0x49')]:undefined)||_0x2550('0x50')},{'name':_0x2550('0x51'),'value':_0x1f7e04[_0x2550('0x51')]||(_0x1f7e04[_0x2550('0x45')]&&_0x1f7e04[_0x2550('0x45')][0x4]?_0x1f7e04[_0x2550('0x45')][0x4]['value']:undefined)||''},{'name':_0x2550('0x52'),'value':_0x1f7e04[_0x2550('0x52')]||(_0x1f7e04[_0x2550('0x45')]&&_0x1f7e04[_0x2550('0x45')][0x5]?_0x1f7e04[_0x2550('0x45')][0x5][_0x2550('0x49')]:undefined)||''},{'name':_0x2550('0x53'),'value':_0x1f7e04[_0x2550('0x53')]||(_0x1f7e04[_0x2550('0x45')]&&_0x1f7e04['attrs'][0x6]?_0x1f7e04['attrs'][0x6][_0x2550('0x49')]:undefined)||''},{'name':_0x2550('0x54'),'value':_0x1f7e04[_0x2550('0x54')]||(_0x1f7e04[_0x2550('0x45')]&&_0x1f7e04[_0x2550('0x45')][0x7]?_0x1f7e04[_0x2550('0x45')][0x7][_0x2550('0x49')]:undefined)||''},{'name':_0x2550('0x55'),'value':_0x1f7e04[_0x2550('0x55')]||(_0x1f7e04['attrs']&&_0x1f7e04[_0x2550('0x45')][0x8]?_0x1f7e04[_0x2550('0x45')][0x8][_0x2550('0x49')]:undefined)||''},{'name':_0x2550('0x56'),'value':_0x1f7e04[_0x2550('0x56')]||(_0x1f7e04[_0x2550('0x45')]&&_0x1f7e04[_0x2550('0x45')][0x9]?_0x1f7e04[_0x2550('0x45')][0x9]['value']:undefined)||''}];case _0x2550('0x57'):case _0x2550('0x58'):return[{'name':_0x2550('0x59'),'value':_0x1f7e04['attrSerie1']||(_0x1f7e04['attrs']&&_0x1f7e04[_0x2550('0x45')][0x0]?_0x1f7e04[_0x2550('0x45')][0x0]['value']:undefined)||_0x2550('0x5a')},{'name':_0x2550('0x5b'),'value':_0x1f7e04[_0x2550('0x5b')]||(_0x1f7e04[_0x2550('0x45')]&&_0x1f7e04[_0x2550('0x45')][0x1]?_0x1f7e04[_0x2550('0x45')][0x1]['value']:undefined)||null},{'name':'attrSerie3','value':_0x1f7e04['attrSerie3']||(_0x1f7e04['attrs']&&_0x1f7e04[_0x2550('0x45')][0x2]?_0x1f7e04[_0x2550('0x45')][0x2][_0x2550('0x49')]:undefined)||null},{'name':_0x2550('0x4f'),'value':_0x1f7e04['attrVoiceQueues']||(_0x1f7e04[_0x2550('0x45')]&&_0x1f7e04['attrs'][0x3]?_0x1f7e04[_0x2550('0x45')][0x3][_0x2550('0x49')]:undefined)||[]},{'name':_0x2550('0x5c'),'value':_0x1f7e04[_0x2550('0x5c')]||(_0x1f7e04[_0x2550('0x45')]&&_0x1f7e04[_0x2550('0x45')][0x4]?_0x1f7e04[_0x2550('0x45')][0x4][_0x2550('0x49')]:undefined)||_0x2550('0x50')},{'name':_0x2550('0x51'),'value':_0x1f7e04[_0x2550('0x51')]||(_0x1f7e04[_0x2550('0x45')]&&_0x1f7e04[_0x2550('0x45')][0x5]?_0x1f7e04['attrs'][0x5][_0x2550('0x49')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x1f7e04[_0x2550('0x52')]||(_0x1f7e04[_0x2550('0x45')]&&_0x1f7e04[_0x2550('0x45')][0x6]?_0x1f7e04[_0x2550('0x45')][0x6][_0x2550('0x49')]:undefined)||''},{'name':_0x2550('0x53'),'value':_0x1f7e04[_0x2550('0x53')]||(_0x1f7e04['attrs']&&_0x1f7e04[_0x2550('0x45')][0x7]?_0x1f7e04[_0x2550('0x45')][0x7][_0x2550('0x49')]:undefined)||''},{'name':_0x2550('0x54'),'value':_0x1f7e04[_0x2550('0x54')]||(_0x1f7e04['attrs']&&_0x1f7e04[_0x2550('0x45')][0x8]?_0x1f7e04[_0x2550('0x45')][0x8]['value']:undefined)||''},{'name':_0x2550('0x55'),'value':_0x1f7e04['attrWhatsappAccounts']||(_0x1f7e04['attrs']&&_0x1f7e04[_0x2550('0x45')][0x9]?_0x1f7e04[_0x2550('0x45')][0x9][_0x2550('0x49')]:undefined)||''},{'name':_0x2550('0x56'),'value':_0x1f7e04[_0x2550('0x56')]||(_0x1f7e04['attrs']&&_0x1f7e04[_0x2550('0x45')][0xa]?_0x1f7e04[_0x2550('0x45')][0xa][_0x2550('0x49')]:undefined)||''}];case _0x2550('0x5d'):return[{'name':_0x2550('0x5e'),'type':_0x1f7e04[_0x2550('0x5f')]||(_0x1f7e04['attrs']&&_0x1f7e04[_0x2550('0x45')][0x0]?_0x1f7e04[_0x2550('0x45')][0x0][_0x2550('0x43')]:undefined)||null,'value':_0x1f7e04[_0x2550('0x5e')]||(_0x1f7e04[_0x2550('0x45')]&&_0x1f7e04['attrs'][0x0]?_0x1f7e04[_0x2550('0x45')][0x0][_0x2550('0x49')]:undefined)||null},{'name':'attrRefresh','value':_0x1f7e04[_0x2550('0x60')]||(_0x1f7e04[_0x2550('0x45')]&&_0x1f7e04[_0x2550('0x45')][0x1]?_0x1f7e04[_0x2550('0x45')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x2fa07b){logger['error'](_0x2550('0x61'),JSON[_0x2550('0x62')](_0x2fa07b));return[];}}exports['create']=function(_0xd839c8,_0x507f93){if(_0xd839c8[_0x2550('0x63')]){_0xd839c8[_0x2550('0x63')][_0x2550('0x45')]=widgetAttributes(_0xd839c8[_0x2550('0x63')]);}return db['DashboardItem'][_0x2550('0x64')](_0xd839c8[_0x2550('0x63')],{})[_0x2550('0x2d')](respondWithResult(_0x507f93,0xc9))[_0x2550('0x40')](handleError(_0x507f93,null));};exports[_0x2550('0x2b')]=function(_0x81869e,_0x5a92da){if(_0x81869e[_0x2550('0x63')]['id']){delete _0x81869e[_0x2550('0x63')]['id'];}_0x81869e['body'][_0x2550('0x45')]=widgetAttributes(_0x81869e[_0x2550('0x63')]);return db['DashboardItem'][_0x2550('0x41')]({'where':{'id':_0x81869e[_0x2550('0x42')]['id']}})[_0x2550('0x2d')](handleEntityNotFound(_0x5a92da,null))[_0x2550('0x2d')](saveUpdates(_0x81869e[_0x2550('0x63')],null))['then'](respondWithResult(_0x5a92da,null))[_0x2550('0x40')](handleError(_0x5a92da,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 5af68c1..14af563 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 _0x01c2=['../../mysqldb','DashboardItem','setMaxListeners','save','update','remove','hasOwnProperty','hook','exports','events'];(function(_0x2179f1,_0x21c653){var _0x176ec9=function(_0x4c4a4c){while(--_0x4c4a4c){_0x2179f1['push'](_0x2179f1['shift']());}};_0x176ec9(++_0x21c653);}(_0x01c2,0x17b));var _0x201c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x01c2[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x201c('0x0'));var DashboardItem=require(_0x201c('0x1'))['db'][_0x201c('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x201c('0x3')](0x0);var events={'afterCreate':_0x201c('0x4'),'afterUpdate':_0x201c('0x5'),'afterDestroy':_0x201c('0x6')};function emitEvent(_0x1f9610){return function(_0x55fd92,_0x1961dc,_0x340703){DashboardItemEvents['emit'](_0x1f9610+':'+_0x55fd92['id'],_0x55fd92);DashboardItemEvents['emit'](_0x1f9610,_0x55fd92);_0x340703(null);};}for(var e in events){if(events[_0x201c('0x7')](e)){var event=events[e];DashboardItem[_0x201c('0x8')](e,emitEvent(event));}}module[_0x201c('0x9')]=DashboardItemEvents; \ No newline at end of file +var _0x16ef=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','DashboardItem','setMaxListeners'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x16ef,0x1e0));var _0xf16e=function(_0x4159df,_0x149030){_0x4159df=_0x4159df-0x0;var _0x391693=_0x16ef[_0x4159df];return _0x391693;};'use strict';var EventEmitter=require(_0xf16e('0x0'));var DashboardItem=require(_0xf16e('0x1'))['db'][_0xf16e('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xf16e('0x3')](0x0);var events={'afterCreate':_0xf16e('0x4'),'afterUpdate':_0xf16e('0x5'),'afterDestroy':_0xf16e('0x6')};function emitEvent(_0x259ea7){return function(_0xd6212c,_0x4135a8,_0x88cf89){DashboardItemEvents[_0xf16e('0x7')](_0x259ea7+':'+_0xd6212c['id'],_0xd6212c);DashboardItemEvents['emit'](_0x259ea7,_0xd6212c);_0x88cf89(null);};}for(var e in events){if(events[_0xf16e('0x8')](e)){var event=events[e];DashboardItem[_0xf16e('0x9')](e,emitEvent(event));}}module[_0xf16e('0xa')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 729afb0..5c8e8b8 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 _0x8250=['lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','./dashboardItem.attributes','define','dashboard_items'];(function(_0x37b5b3,_0x1ba380){var _0x567fb4=function(_0x18bc3b){while(--_0x18bc3b){_0x37b5b3['push'](_0x37b5b3['shift']());}};_0x567fb4(++_0x1ba380);}(_0x8250,0xfa));var _0x0825=function(_0x5776e4,_0x2f7731){_0x5776e4=_0x5776e4-0x0;var _0x179ce9=_0x8250[_0x5776e4];return _0x179ce9;};'use strict';var _=require(_0x0825('0x0'));var util=require(_0x0825('0x1'));var logger=require(_0x0825('0x2'))(_0x0825('0x3'));var moment=require('moment');var BPromise=require(_0x0825('0x4'));var rp=require(_0x0825('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0825('0x6'));var config=require('../../config/environment');var attributes=require(_0x0825('0x7'));module['exports']=function(_0x18733,_0x1a3bf8){return _0x18733[_0x0825('0x8')]('DashboardItem',attributes,{'tableName':_0x0825('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x824b=['path','rimraf','../../config/environment','./dashboardItem.attributes','DashboardItem','dashboard_items','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0x824b,0x10e));var _0xb824=function(_0x2301df,_0x19e4bc){_0x2301df=_0x2301df-0x0;var _0x12c0d3=_0x824b[_0x2301df];return _0x12c0d3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb824('0x0'))(_0xb824('0x1'));var moment=require(_0xb824('0x2'));var BPromise=require(_0xb824('0x3'));var rp=require(_0xb824('0x4'));var fs=require('fs');var path=require(_0xb824('0x5'));var rimraf=require(_0xb824('0x6'));var config=require(_0xb824('0x7'));var attributes=require(_0xb824('0x8'));module['exports']=function(_0x2e6309,_0xaccc95){return _0x2e6309['define'](_0xb824('0x9'),attributes,{'tableName':_0xb824('0xa'),'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 51b7f5a..ffbb606 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 _0xd41c=['localhost','socket.io-emitter','./dashboardItem.socket','DashboardItem,\x20%s,\x20%s','debug','DashboardItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','client','redis','defaults'];(function(_0x53aad8,_0x2fdbdc){var _0x12612c=function(_0x3b4bc5){while(--_0x3b4bc5){_0x53aad8['push'](_0x53aad8['shift']());}};_0x12612c(++_0x2fdbdc);}(_0xd41c,0x15d));var _0xcd41=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd41c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xcd41('0x0'));var util=require(_0xcd41('0x1'));var moment=require(_0xcd41('0x2'));var BPromise=require(_0xcd41('0x3'));var rs=require(_0xcd41('0x4'));var fs=require('fs');var Redis=require(_0xcd41('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xcd41('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xcd41('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xcd41('0x8')]['http']({'port':0x232a});config[_0xcd41('0x9')]=_[_0xcd41('0xa')](config['redis'],{'host':_0xcd41('0xb'),'port':0x18eb});var socket=require(_0xcd41('0xc'))(new Redis(config[_0xcd41('0x9')]));require(_0xcd41('0xd'))['register'](socket);function respondWithRpcPromise(_0x3f7256,_0x313102,_0x257221){return new BPromise(function(_0x19748c,_0x26592c){return client['request'](_0x3f7256,_0x257221)['then'](function(_0x937e3c){logger['info'](_0xcd41('0xe'),_0x313102,'request\x20sent');logger[_0xcd41('0xf')](_0xcd41('0x10'),_0x313102,_0xcd41('0x11'),JSON[_0xcd41('0x12')](_0x937e3c));if(_0x937e3c['error']){if(_0x937e3c[_0xcd41('0x13')][_0xcd41('0x14')]===0x1f4){logger[_0xcd41('0x13')](_0xcd41('0xe'),_0x313102,_0x937e3c[_0xcd41('0x13')][_0xcd41('0x15')]);return _0x26592c(_0x937e3c[_0xcd41('0x13')][_0xcd41('0x15')]);}logger['error'](_0xcd41('0xe'),_0x313102,_0x937e3c['error']['message']);return _0x19748c(_0x937e3c[_0xcd41('0x13')][_0xcd41('0x15')]);}else{logger['info']('DashboardItem,\x20%s,\x20%s',_0x313102,'request\x20sent');_0x19748c(_0x937e3c[_0xcd41('0x16')][_0xcd41('0x15')]);}})[_0xcd41('0x17')](function(_0x41c7b9){logger[_0xcd41('0x13')](_0xcd41('0xe'),_0x313102,_0x41c7b9);_0x26592c(_0x41c7b9);});});} \ No newline at end of file +var _0x0e6b=['request\x20sent','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','jayson/promise','client','socket.io-emitter','redis','./dashboardItem.socket','register','request','then','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','DashboardItem,\x20%s,\x20%s','message','info'];(function(_0x3d0405,_0x43ab9b){var _0x184621=function(_0x1df680){while(--_0x1df680){_0x3d0405['push'](_0x3d0405['shift']());}};_0x184621(++_0x43ab9b);}(_0x0e6b,0x98));var _0xb0e6=function(_0x575b72,_0x1a7eb1){_0x575b72=_0x575b72-0x0;var _0x561c57=_0x0e6b[_0x575b72];return _0x561c57;};'use strict';var _=require(_0xb0e6('0x0'));var util=require(_0xb0e6('0x1'));var moment=require(_0xb0e6('0x2'));var BPromise=require(_0xb0e6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb0e6('0x4'));var db=require(_0xb0e6('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb0e6('0x6'));var config=require('../../config/environment');var jayson=require(_0xb0e6('0x7'));var client=jayson[_0xb0e6('0x8')]['http']({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xb0e6('0x9'))(new Redis(config[_0xb0e6('0xa')]));require(_0xb0e6('0xb'))[_0xb0e6('0xc')](socket);function respondWithRpcPromise(_0x5376e8,_0x4f6221,_0x4e723a){return new BPromise(function(_0x25eeba,_0x237ed4){return client[_0xb0e6('0xd')](_0x5376e8,_0x4e723a)[_0xb0e6('0xe')](function(_0x4ed6bd){logger['info']('DashboardItem,\x20%s,\x20%s',_0x4f6221,'request\x20sent');logger[_0xb0e6('0xf')](_0xb0e6('0x10'),_0x4f6221,'request\x20sent',JSON[_0xb0e6('0x11')](_0x4ed6bd));if(_0x4ed6bd[_0xb0e6('0x12')]){if(_0x4ed6bd[_0xb0e6('0x12')][_0xb0e6('0x13')]===0x1f4){logger[_0xb0e6('0x12')](_0xb0e6('0x14'),_0x4f6221,_0x4ed6bd[_0xb0e6('0x12')][_0xb0e6('0x15')]);return _0x237ed4(_0x4ed6bd[_0xb0e6('0x12')][_0xb0e6('0x15')]);}logger['error']('DashboardItem,\x20%s,\x20%s',_0x4f6221,_0x4ed6bd['error'][_0xb0e6('0x15')]);return _0x25eeba(_0x4ed6bd[_0xb0e6('0x12')][_0xb0e6('0x15')]);}else{logger[_0xb0e6('0x16')](_0xb0e6('0x14'),_0x4f6221,_0xb0e6('0x17'));_0x25eeba(_0x4ed6bd[_0xb0e6('0x18')][_0xb0e6('0x15')]);}})['catch'](function(_0x4c419c){logger[_0xb0e6('0x12')](_0xb0e6('0x14'),_0x4f6221,_0x4c419c);_0x237ed4(_0x4c419c);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index d37cc34..91854da 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 _0x4547=['dashboardItem:','remove','removeListener','register','length'];(function(_0x331a2c,_0xc59b3e){var _0x508e83=function(_0x5e8d02){while(--_0x5e8d02){_0x331a2c['push'](_0x331a2c['shift']());}};_0x508e83(++_0xc59b3e);}(_0x4547,0xa1));var _0x7454=function(_0x996bc8,_0x291e01){_0x996bc8=_0x996bc8-0x0;var _0x20b0ea=_0x4547[_0x996bc8];return _0x20b0ea;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=['save',_0x7454('0x0'),'update'];function createListener(_0x22f0dd,_0x3de406){return function(_0x4ccfa5){_0x3de406['emit'](_0x22f0dd,_0x4ccfa5);};}function removeListener(_0x3a106c,_0x4cf1d0){return function(){DashboardItemEvents[_0x7454('0x1')](_0x3a106c,_0x4cf1d0);};}exports[_0x7454('0x2')]=function(_0x4fac9b){for(var _0x2bfe5f=0x0,_0x27df71=events[_0x7454('0x3')];_0x2bfe5f<_0x27df71;_0x2bfe5f++){var _0x36585e=events[_0x2bfe5f];var _0x61afaa=createListener(_0x7454('0x4')+_0x36585e,_0x4fac9b);DashboardItemEvents['on'](_0x36585e,_0x61afaa);}}; \ No newline at end of file +var _0x935b=['emit','removeListener','register','./dashboardItem.events','save','remove','update'];(function(_0x5651ef,_0x4fd99a){var _0x392fba=function(_0x14c7dd){while(--_0x14c7dd){_0x5651ef['push'](_0x5651ef['shift']());}};_0x392fba(++_0x4fd99a);}(_0x935b,0x81));var _0xb935=function(_0x31bd08,_0x2a576a){_0x31bd08=_0x31bd08-0x0;var _0x1c2773=_0x935b[_0x31bd08];return _0x1c2773;};'use strict';var DashboardItemEvents=require(_0xb935('0x0'));var events=[_0xb935('0x1'),_0xb935('0x2'),_0xb935('0x3')];function createListener(_0xc38ad5,_0x1d1ff1){return function(_0x7a4aa){_0x1d1ff1[_0xb935('0x4')](_0xc38ad5,_0x7a4aa);};}function removeListener(_0x8562f9,_0x3ab284){return function(){DashboardItemEvents[_0xb935('0x5')](_0x8562f9,_0x3ab284);};}exports[_0xb935('0x6')]=function(_0x49c0d1){for(var _0x3df259=0x0,_0x425739=events['length'];_0x3df259<_0x425739;_0x3df259++){var _0x26482f=events[_0x3df259];var _0x3620f9=createListener('dashboardItem:'+_0x26482f,_0x49c0d1);DashboardItemEvents['on'](_0x26482f,_0x3620f9);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 73a6476..b247a0a 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 _0xbcc3=['./dashboardItem.controller','/:id','isAuthenticated','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0xbcc3,0x6e));var _0x3bcc=function(_0x5db569,_0x25707b){_0x5db569=_0x5db569-0x0;var _0x247b44=_0xbcc3[_0x5db569];return _0x247b44;};'use strict';var multer=require(_0x3bcc('0x0'));var util=require(_0x3bcc('0x1'));var path=require(_0x3bcc('0x2'));var timeout=require(_0x3bcc('0x3'));var express=require(_0x3bcc('0x4'));var router=express[_0x3bcc('0x5')]();var fs_extra=require(_0x3bcc('0x6'));var auth=require(_0x3bcc('0x7'));var interaction=require(_0x3bcc('0x8'));var config=require(_0x3bcc('0x9'));var controller=require(_0x3bcc('0xa'));router['get'](_0x3bcc('0xb'),auth[_0x3bcc('0xc')](),controller[_0x3bcc('0xd')]);router[_0x3bcc('0xe')]('/',auth[_0x3bcc('0xc')](),controller[_0x3bcc('0xf')]);router[_0x3bcc('0x10')](_0x3bcc('0xb'),auth['isAuthenticated'](),controller[_0x3bcc('0x11')]);router[_0x3bcc('0x12')]('/:id',auth[_0x3bcc('0xc')](),controller['destroy']);module[_0x3bcc('0x13')]=router; \ No newline at end of file +var _0x4e63=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','show','post','isAuthenticated','create','put','delete','/:id','destroy','exports','multer','util'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x4e63,0xe2));var _0x34e6=function(_0xf21dd0,_0x45e57b){_0xf21dd0=_0xf21dd0-0x0;var _0x56a413=_0x4e63[_0xf21dd0];return _0x56a413;};'use strict';var multer=require(_0x34e6('0x0'));var util=require(_0x34e6('0x1'));var path=require(_0x34e6('0x2'));var timeout=require('connect-timeout');var express=require(_0x34e6('0x3'));var router=express[_0x34e6('0x4')]();var fs_extra=require(_0x34e6('0x5'));var auth=require(_0x34e6('0x6'));var interaction=require(_0x34e6('0x7'));var config=require(_0x34e6('0x8'));var controller=require(_0x34e6('0x9'));router['get']('/:id',auth['isAuthenticated'](),controller[_0x34e6('0xa')]);router[_0x34e6('0xb')]('/',auth[_0x34e6('0xc')](),controller[_0x34e6('0xd')]);router[_0x34e6('0xe')]('/:id',auth[_0x34e6('0xc')](),controller['update']);router[_0x34e6('0xf')](_0x34e6('0x10'),auth[_0x34e6('0xc')](),controller[_0x34e6('0x11')]);module[_0x34e6('0x12')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 666de2f..aee862b 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 _0x65d1=['second','third','sequelize','STRING','ENUM'];(function(_0x4b3dca,_0x25b547){var _0x38589c=function(_0x17ccdf){while(--_0x17ccdf){_0x4b3dca['push'](_0x4b3dca['shift']());}};_0x38589c(++_0x25b547);}(_0x65d1,0x110));var _0x165d=function(_0x434783,_0xff395d){_0x434783=_0x434783-0x0;var _0x13efcf=_0x65d1[_0x434783];return _0x13efcf;};'use strict';var Sequelize=require(_0x165d('0x0'));module['exports']={'name':{'type':Sequelize[_0x165d('0x1')],'allowNull':![]},'level':{'type':Sequelize[_0x165d('0x2')]('first',_0x165d('0x3'),_0x165d('0x4')),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize[_0x165d('0x1')]}}; \ No newline at end of file +var _0x8f20=['STRING','ENUM','first','second','third','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8f20,0x1a9));var _0x08f2=function(_0xa11029,_0x4e772a){_0xa11029=_0xa11029-0x0;var _0x14a649=_0x8f20[_0xa11029];return _0x14a649;};'use strict';var Sequelize=require('sequelize');module[_0x08f2('0x0')]={'name':{'type':Sequelize[_0x08f2('0x1')],'allowNull':![]},'level':{'type':Sequelize[_0x08f2('0x2')](_0x08f2('0x3'),_0x08f2('0x4'),_0x08f2('0x5')),'allowNull':![],'defaultValue':_0x08f2('0x3')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index ac33fc4..d7a0daa 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 _0xf97f=['stack','name','send','index','map','Disposition','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','update','then','destroy','get','Dispositions','UserProfileResource','error'];(function(_0x9eeab1,_0x8ac87f){var _0x34b8cc=function(_0x589560){while(--_0x589560){_0x9eeab1['push'](_0x9eeab1['shift']());}};_0x34b8cc(++_0x8ac87f);}(_0xf97f,0xc7));var _0xff97=function(_0xcb0ae7,_0x29344f){_0xcb0ae7=_0xcb0ae7-0x0;var _0x2c7ae1=_0xf97f[_0xcb0ae7];return _0x2c7ae1;};'use strict';var emlformat=require(_0xff97('0x0'));var rimraf=require(_0xff97('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xff97('0x2'));var BPromise=require(_0xff97('0x3'));var Mustache=require('mustache');var util=require(_0xff97('0x4'));var path=require(_0xff97('0x5'));var sox=require(_0xff97('0x6'));var csv=require(_0xff97('0x7'));var ejs=require(_0xff97('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xff97('0x9'));var squel=require(_0xff97('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xff97('0xb'));var toCsv=require(_0xff97('0x7'));var querystring=require('querystring');var Papa=require(_0xff97('0xc'));var Redis=require('ioredis');var authService=require(_0xff97('0xd'));var qs=require(_0xff97('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xff97('0xf'));var logger=require(_0xff97('0x10'))(_0xff97('0x11'));var utils=require(_0xff97('0x12'));var config=require(_0xff97('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xff97('0x14'))['db'];function respondWithStatusCode(_0x4a22e7,_0x5ab70c){_0x5ab70c=_0x5ab70c||0xcc;return function(_0x24f2db){if(_0x24f2db){return _0x4a22e7[_0xff97('0x15')](_0x5ab70c);}return _0x4a22e7[_0xff97('0x16')](_0x5ab70c)[_0xff97('0x17')]();};}function respondWithResult(_0x3ae946,_0x312030){_0x312030=_0x312030||0xc8;return function(_0x215b34){if(_0x215b34){return _0x3ae946[_0xff97('0x16')](_0x312030)[_0xff97('0x18')](_0x215b34);}};}function respondWithFilteredResult(_0x1c84dd,_0x39d39b){return function(_0x48a3a4){if(_0x48a3a4){var _0x27e235=typeof _0x39d39b[_0xff97('0x19')]==='undefined'&&typeof _0x39d39b['limit']===_0xff97('0x1a');var _0x1f06cf=_0x48a3a4['count'];var _0x3dba4b=_0x27e235?0x0:_0x39d39b[_0xff97('0x19')];var _0x291655=_0x27e235?_0x48a3a4[_0xff97('0x1b')]:_0x39d39b[_0xff97('0x19')]+_0x39d39b[_0xff97('0x1c')];var _0x5a6606;if(_0x291655>=_0x1f06cf){_0x291655=_0x1f06cf;_0x5a6606=0xc8;}else{_0x5a6606=0xce;}_0x1c84dd[_0xff97('0x16')](_0x5a6606);return _0x1c84dd[_0xff97('0x1d')](_0xff97('0x1e'),_0x3dba4b+'-'+_0x291655+'/'+_0x1f06cf)[_0xff97('0x18')](_0x48a3a4);}return null;};}function patchUpdates(_0x3606c2){return function(_0x4aea10){try{jsonpatch['apply'](_0x4aea10,_0x3606c2,!![]);}catch(_0x3b73f0){return BPromise['reject'](_0x3b73f0);}return _0x4aea10['save']();};}function saveUpdates(_0x2d652,_0x31e2f8){return function(_0x304026){if(_0x304026){return _0x304026[_0xff97('0x1f')](_0x2d652)[_0xff97('0x20')](function(_0x1c3012){return _0x1c3012;});}return null;};}function removeEntity(_0x2ce267,_0x160b0b){return function(_0x52f937){if(_0x52f937){return _0x52f937[_0xff97('0x21')]()[_0xff97('0x20')](function(){var _0x159c06=_0x52f937[_0xff97('0x22')]({'plain':!![]});var _0x40a484=_0xff97('0x23');return db[_0xff97('0x24')]['destroy']({'where':{'type':_0x40a484,'resourceId':_0x159c06['id']}})[_0xff97('0x20')](function(){return _0x52f937;});})[_0xff97('0x20')](function(){_0x2ce267[_0xff97('0x16')](0xcc)[_0xff97('0x17')]();});}};}function handleEntityNotFound(_0x4d5603,_0x483d86){return function(_0x4453a3){if(!_0x4453a3){_0x4d5603[_0xff97('0x15')](0x194);}return _0x4453a3;};}function handleError(_0x5d4de2,_0x3ee3e4){_0x3ee3e4=_0x3ee3e4||0x1f4;return function(_0x130a1e){logger[_0xff97('0x25')](_0x130a1e[_0xff97('0x26')]);if(_0x130a1e[_0xff97('0x27')]){delete _0x130a1e[_0xff97('0x27')];}_0x5d4de2[_0xff97('0x16')](_0x3ee3e4)[_0xff97('0x28')](_0x130a1e);};}exports[_0xff97('0x29')]=function(_0x219366,_0x4aff01){var _0x465f8a={},_0x52ff19={},_0xb10ff={'count':0x0,'rows':[]};var _0x57cf2e=_[_0xff97('0x2a')](db[_0xff97('0x2b')][_0xff97('0x2c')],function(_0x31cb19){return{'name':_0x31cb19[_0xff97('0x2d')],'type':_0x31cb19[_0xff97('0x2e')][_0xff97('0x2f')]};});_0x52ff19[_0xff97('0x30')]=_[_0xff97('0x2a')](_0x57cf2e,'name');_0x52ff19['query']=_[_0xff97('0x31')](_0x219366[_0xff97('0x32')]);_0x52ff19['filters']=_[_0xff97('0x33')](_0x52ff19[_0xff97('0x30')],_0x52ff19['query']);_0x465f8a[_0xff97('0x34')]=_['intersection'](_0x52ff19[_0xff97('0x30')],qs[_0xff97('0x35')](_0x219366['query'][_0xff97('0x35')]));_0x465f8a[_0xff97('0x34')]=_0x465f8a[_0xff97('0x34')][_0xff97('0x36')]?_0x465f8a[_0xff97('0x34')]:_0x52ff19[_0xff97('0x30')];if(!_0x219366[_0xff97('0x32')][_0xff97('0x37')]('nolimit')){_0x465f8a[_0xff97('0x1c')]=qs[_0xff97('0x1c')](_0x219366[_0xff97('0x32')][_0xff97('0x1c')]);_0x465f8a[_0xff97('0x19')]=qs[_0xff97('0x19')](_0x219366[_0xff97('0x32')][_0xff97('0x19')]);}_0x465f8a[_0xff97('0x38')]=qs['sort'](_0x219366[_0xff97('0x32')][_0xff97('0x39')]);_0x465f8a[_0xff97('0x3a')]=qs[_0xff97('0x3b')](_['pick'](_0x219366[_0xff97('0x32')],_0x52ff19[_0xff97('0x3b')]),_0x57cf2e);if(_0x219366[_0xff97('0x32')][_0xff97('0x3c')]){_0x465f8a[_0xff97('0x3a')]=_[_0xff97('0x3d')](_0x465f8a[_0xff97('0x3a')],{'$or':_['map'](_0x57cf2e,function(_0x2883a1){if(_0x2883a1[_0xff97('0x2e')]!==_0xff97('0x3e')){var _0xeb43c7={};_0xeb43c7[_0x2883a1[_0xff97('0x27')]]={'$like':'%'+_0x219366[_0xff97('0x32')]['filter']+'%'};return _0xeb43c7;}})});}_0x465f8a=_[_0xff97('0x3d')]({},_0x465f8a,_0x219366[_0xff97('0x3f')]);var _0x53a44f={'where':_0x465f8a['where']};return db[_0xff97('0x2b')][_0xff97('0x1b')](_0x53a44f)[_0xff97('0x20')](function(_0x1322cc){_0xb10ff[_0xff97('0x1b')]=_0x1322cc;if(_0x219366['query'][_0xff97('0x40')]){_0x465f8a[_0xff97('0x41')]=[{'all':!![]}];}return db['Disposition'][_0xff97('0x42')](_0x465f8a);})[_0xff97('0x20')](function(_0x36a354){_0xb10ff[_0xff97('0x43')]=_0x36a354;return _0xb10ff;})[_0xff97('0x20')](respondWithFilteredResult(_0x4aff01,_0x465f8a))[_0xff97('0x44')](handleError(_0x4aff01,null));};exports['show']=function(_0x4a4341,_0x2bff9b){var _0xc34ebf={'raw':!![],'where':{'id':_0x4a4341[_0xff97('0x45')]['id']}},_0x569630={};_0x569630[_0xff97('0x30')]=_['keys'](db[_0xff97('0x2b')][_0xff97('0x2c')]);_0x569630[_0xff97('0x32')]=_[_0xff97('0x31')](_0x4a4341['query']);_0x569630[_0xff97('0x3b')]=_[_0xff97('0x33')](_0x569630['model'],_0x569630[_0xff97('0x32')]);_0xc34ebf['attributes']=_[_0xff97('0x33')](_0x569630[_0xff97('0x30')],qs[_0xff97('0x35')](_0x4a4341[_0xff97('0x32')][_0xff97('0x35')]));_0xc34ebf[_0xff97('0x34')]=_0xc34ebf[_0xff97('0x34')][_0xff97('0x36')]?_0xc34ebf[_0xff97('0x34')]:_0x569630[_0xff97('0x30')];if(_0x4a4341[_0xff97('0x32')]['includeAll']){_0xc34ebf[_0xff97('0x41')]=[{'all':!![]}];}_0xc34ebf=_[_0xff97('0x3d')]({},_0xc34ebf,_0x4a4341[_0xff97('0x3f')]);return db[_0xff97('0x2b')][_0xff97('0x46')](_0xc34ebf)['then'](handleEntityNotFound(_0x2bff9b,null))[_0xff97('0x20')](respondWithResult(_0x2bff9b,null))[_0xff97('0x44')](handleError(_0x2bff9b,null));};exports[_0xff97('0x47')]=function(_0x4ab1b5,_0x78699b){return db[_0xff97('0x2b')]['create'](_0x4ab1b5['body'],{})[_0xff97('0x20')](function(_0x1ecaa0){var _0x235fa9=_0x4ab1b5['user']['get']({'plain':!![]});if(!_0x235fa9)throw new Error(_0xff97('0x48'));if(_0x235fa9['role']===_0xff97('0x49')){var _0x40a385=_0x1ecaa0[_0xff97('0x22')]({'plain':!![]});var _0x4ad56c=_0xff97('0x23');return db[_0xff97('0x4a')][_0xff97('0x46')]({'where':{'name':_0x4ad56c,'userProfileId':_0x235fa9[_0xff97('0x4b')]},'raw':!![]})[_0xff97('0x20')](function(_0x127c27){if(_0x127c27&&_0x127c27[_0xff97('0x4c')]===0x0){return db[_0xff97('0x24')]['create']({'name':_0x40a385['name'],'resourceId':_0x40a385['id'],'type':_0x127c27['name'],'sectionId':_0x127c27['id']},{})[_0xff97('0x20')](function(){return _0x1ecaa0;});}else{return _0x1ecaa0;}})['catch'](function(_0x46c029){logger[_0xff97('0x25')](_0xff97('0x4d'),_0x46c029);throw _0x46c029;});}return _0x1ecaa0;})[_0xff97('0x20')](respondWithResult(_0x78699b,0xc9))[_0xff97('0x44')](handleError(_0x78699b,null));};exports[_0xff97('0x1f')]=function(_0x106f2f,_0x10cd7c){if(_0x106f2f['body']['id']){delete _0x106f2f[_0xff97('0x4e')]['id'];}return db['Disposition'][_0xff97('0x46')]({'where':{'id':_0x106f2f['params']['id']}})[_0xff97('0x20')](handleEntityNotFound(_0x10cd7c,null))[_0xff97('0x20')](saveUpdates(_0x106f2f[_0xff97('0x4e')],null))[_0xff97('0x20')](respondWithResult(_0x10cd7c,null))[_0xff97('0x44')](handleError(_0x10cd7c,null));};exports[_0xff97('0x21')]=function(_0x5355c2,_0x1fcc3b){return db['Disposition']['find']({'where':{'id':_0x5355c2[_0xff97('0x45')]['id']}})['then'](handleEntityNotFound(_0x1fcc3b,null))[_0xff97('0x20')](removeEntity(_0x1fcc3b,null))['catch'](handleError(_0x1fcc3b,null));}; \ No newline at end of file +var _0x24dc=['hasOwnProperty','sort','where','pick','merge','VIRTUAL','options','Disposition','includeAll','include','show','filters','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','limit','count','set','apply','reject','save','then','get','Dispositions','destroy','error','stack','name','index','map','fieldName','type','key','model','query','intersection','attributes','fields','length'];(function(_0x367e37,_0x14ba27){var _0xabda19=function(_0x18d74f){while(--_0x18d74f){_0x367e37['push'](_0x367e37['shift']());}};_0xabda19(++_0x14ba27);}(_0x24dc,0x65));var _0xc24d=function(_0xa2c20b,_0x9e8a04){_0xa2c20b=_0xa2c20b-0x0;var _0x169cac=_0x24dc[_0xa2c20b];return _0x169cac;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc24d('0x0'));var jsonpatch=require(_0xc24d('0x1'));var rp=require(_0xc24d('0x2'));var moment=require(_0xc24d('0x3'));var BPromise=require(_0xc24d('0x4'));var Mustache=require(_0xc24d('0x5'));var util=require(_0xc24d('0x6'));var path=require(_0xc24d('0x7'));var sox=require(_0xc24d('0x8'));var csv=require(_0xc24d('0x9'));var ejs=require(_0xc24d('0xa'));var fs=require('fs');var fs_extra=require(_0xc24d('0xb'));var _=require(_0xc24d('0xc'));var squel=require('squel');var crypto=require(_0xc24d('0xd'));var jsforce=require(_0xc24d('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xc24d('0x9'));var querystring=require('querystring');var Papa=require(_0xc24d('0xf'));var Redis=require(_0xc24d('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xc24d('0x11'));var as=require(_0xc24d('0x12'));var hardwareService=require(_0xc24d('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xc24d('0x14'));var config=require(_0xc24d('0x15'));var licenseUtil=require(_0xc24d('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x10447a,_0x1d1ee0){_0x1d1ee0=_0x1d1ee0||0xcc;return function(_0x8f9b29){if(_0x8f9b29){return _0x10447a[_0xc24d('0x17')](_0x1d1ee0);}return _0x10447a[_0xc24d('0x18')](_0x1d1ee0)[_0xc24d('0x19')]();};}function respondWithResult(_0x2675f1,_0x3d6a19){_0x3d6a19=_0x3d6a19||0xc8;return function(_0x1a03b0){if(_0x1a03b0){return _0x2675f1[_0xc24d('0x18')](_0x3d6a19)['json'](_0x1a03b0);}};}function respondWithFilteredResult(_0x6d7594,_0x45608a){return function(_0x11dba2){if(_0x11dba2){var _0x4cd394=typeof _0x45608a[_0xc24d('0x1a')]==='undefined'&&typeof _0x45608a[_0xc24d('0x1b')]==='undefined';var _0x579b4e=_0x11dba2[_0xc24d('0x1c')];var _0x3c7255=_0x4cd394?0x0:_0x45608a['offset'];var _0x4c5fc2=_0x4cd394?_0x11dba2[_0xc24d('0x1c')]:_0x45608a[_0xc24d('0x1a')]+_0x45608a[_0xc24d('0x1b')];var _0x3025e0;if(_0x4c5fc2>=_0x579b4e){_0x4c5fc2=_0x579b4e;_0x3025e0=0xc8;}else{_0x3025e0=0xce;}_0x6d7594[_0xc24d('0x18')](_0x3025e0);return _0x6d7594[_0xc24d('0x1d')]('Content-Range',_0x3c7255+'-'+_0x4c5fc2+'/'+_0x579b4e)['json'](_0x11dba2);}return null;};}function patchUpdates(_0x25ae13){return function(_0x5c2c83){try{jsonpatch[_0xc24d('0x1e')](_0x5c2c83,_0x25ae13,!![]);}catch(_0xfa63f){return BPromise[_0xc24d('0x1f')](_0xfa63f);}return _0x5c2c83[_0xc24d('0x20')]();};}function saveUpdates(_0x150de6,_0x2ae2d0){return function(_0x38c47f){if(_0x38c47f){return _0x38c47f['update'](_0x150de6)[_0xc24d('0x21')](function(_0x35db6a){return _0x35db6a;});}return null;};}function removeEntity(_0x3cfdca,_0x43d6c9){return function(_0x4569d7){if(_0x4569d7){return _0x4569d7['destroy']()[_0xc24d('0x21')](function(){var _0x1be84b=_0x4569d7[_0xc24d('0x22')]({'plain':!![]});var _0x3d74e7=_0xc24d('0x23');return db['UserProfileResource'][_0xc24d('0x24')]({'where':{'type':_0x3d74e7,'resourceId':_0x1be84b['id']}})[_0xc24d('0x21')](function(){return _0x4569d7;});})[_0xc24d('0x21')](function(){_0x3cfdca[_0xc24d('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0xa9c275,_0x2366ce){return function(_0xe2bde3){if(!_0xe2bde3){_0xa9c275[_0xc24d('0x17')](0x194);}return _0xe2bde3;};}function handleError(_0x4c31ee,_0x1212fd){_0x1212fd=_0x1212fd||0x1f4;return function(_0x48d87f){logger[_0xc24d('0x25')](_0x48d87f[_0xc24d('0x26')]);if(_0x48d87f[_0xc24d('0x27')]){delete _0x48d87f[_0xc24d('0x27')];}_0x4c31ee[_0xc24d('0x18')](_0x1212fd)['send'](_0x48d87f);};}exports[_0xc24d('0x28')]=function(_0x46cbc6,_0x334417){var _0x28789d={},_0x170bac={},_0x3cb646={'count':0x0,'rows':[]};var _0x402ed3=_[_0xc24d('0x29')](db['Disposition']['rawAttributes'],function(_0x2fc92e){return{'name':_0x2fc92e[_0xc24d('0x2a')],'type':_0x2fc92e[_0xc24d('0x2b')][_0xc24d('0x2c')]};});_0x170bac[_0xc24d('0x2d')]=_[_0xc24d('0x29')](_0x402ed3,_0xc24d('0x27'));_0x170bac[_0xc24d('0x2e')]=_['keys'](_0x46cbc6[_0xc24d('0x2e')]);_0x170bac['filters']=_[_0xc24d('0x2f')](_0x170bac[_0xc24d('0x2d')],_0x170bac[_0xc24d('0x2e')]);_0x28789d[_0xc24d('0x30')]=_[_0xc24d('0x2f')](_0x170bac[_0xc24d('0x2d')],qs['fields'](_0x46cbc6[_0xc24d('0x2e')][_0xc24d('0x31')]));_0x28789d[_0xc24d('0x30')]=_0x28789d['attributes'][_0xc24d('0x32')]?_0x28789d[_0xc24d('0x30')]:_0x170bac['model'];if(!_0x46cbc6['query'][_0xc24d('0x33')]('nolimit')){_0x28789d[_0xc24d('0x1b')]=qs[_0xc24d('0x1b')](_0x46cbc6[_0xc24d('0x2e')][_0xc24d('0x1b')]);_0x28789d[_0xc24d('0x1a')]=qs['offset'](_0x46cbc6[_0xc24d('0x2e')][_0xc24d('0x1a')]);}_0x28789d['order']=qs[_0xc24d('0x34')](_0x46cbc6[_0xc24d('0x2e')][_0xc24d('0x34')]);_0x28789d[_0xc24d('0x35')]=qs['filters'](_[_0xc24d('0x36')](_0x46cbc6[_0xc24d('0x2e')],_0x170bac['filters']),_0x402ed3);if(_0x46cbc6[_0xc24d('0x2e')]['filter']){_0x28789d[_0xc24d('0x35')]=_[_0xc24d('0x37')](_0x28789d[_0xc24d('0x35')],{'$or':_[_0xc24d('0x29')](_0x402ed3,function(_0x3ab0ab){if(_0x3ab0ab[_0xc24d('0x2b')]!==_0xc24d('0x38')){var _0x8d5728={};_0x8d5728[_0x3ab0ab[_0xc24d('0x27')]]={'$like':'%'+_0x46cbc6[_0xc24d('0x2e')]['filter']+'%'};return _0x8d5728;}})});}_0x28789d=_[_0xc24d('0x37')]({},_0x28789d,_0x46cbc6[_0xc24d('0x39')]);var _0x3f8daa={'where':_0x28789d[_0xc24d('0x35')]};return db[_0xc24d('0x3a')]['count'](_0x3f8daa)['then'](function(_0x3462f7){_0x3cb646[_0xc24d('0x1c')]=_0x3462f7;if(_0x46cbc6[_0xc24d('0x2e')][_0xc24d('0x3b')]){_0x28789d[_0xc24d('0x3c')]=[{'all':!![]}];}return db[_0xc24d('0x3a')]['findAll'](_0x28789d);})[_0xc24d('0x21')](function(_0x599412){_0x3cb646['rows']=_0x599412;return _0x3cb646;})[_0xc24d('0x21')](respondWithFilteredResult(_0x334417,_0x28789d))['catch'](handleError(_0x334417,null));};exports[_0xc24d('0x3d')]=function(_0x2c62ca,_0x586c94){var _0x57e49b={'raw':!![],'where':{'id':_0x2c62ca['params']['id']}},_0x54208d={};_0x54208d['model']=_['keys'](db[_0xc24d('0x3a')]['rawAttributes']);_0x54208d[_0xc24d('0x2e')]=_['keys'](_0x2c62ca[_0xc24d('0x2e')]);_0x54208d[_0xc24d('0x3e')]=_[_0xc24d('0x2f')](_0x54208d[_0xc24d('0x2d')],_0x54208d[_0xc24d('0x2e')]);_0x57e49b['attributes']=_[_0xc24d('0x2f')](_0x54208d[_0xc24d('0x2d')],qs[_0xc24d('0x31')](_0x2c62ca[_0xc24d('0x2e')][_0xc24d('0x31')]));_0x57e49b['attributes']=_0x57e49b[_0xc24d('0x30')][_0xc24d('0x32')]?_0x57e49b[_0xc24d('0x30')]:_0x54208d[_0xc24d('0x2d')];if(_0x2c62ca[_0xc24d('0x2e')][_0xc24d('0x3b')]){_0x57e49b[_0xc24d('0x3c')]=[{'all':!![]}];}_0x57e49b=_[_0xc24d('0x37')]({},_0x57e49b,_0x2c62ca[_0xc24d('0x39')]);return db[_0xc24d('0x3a')][_0xc24d('0x3f')](_0x57e49b)[_0xc24d('0x21')](handleEntityNotFound(_0x586c94,null))[_0xc24d('0x21')](respondWithResult(_0x586c94,null))['catch'](handleError(_0x586c94,null));};exports['create']=function(_0x583b41,_0x470c60){return db[_0xc24d('0x3a')][_0xc24d('0x40')](_0x583b41['body'],{})[_0xc24d('0x21')](function(_0x7be2f8){var _0x48664c=_0x583b41['user'][_0xc24d('0x22')]({'plain':!![]});if(!_0x48664c)throw new Error(_0xc24d('0x41'));if(_0x48664c[_0xc24d('0x42')]===_0xc24d('0x43')){var _0x1051ea=_0x7be2f8[_0xc24d('0x22')]({'plain':!![]});var _0x388e9e=_0xc24d('0x23');return db['UserProfileSection']['find']({'where':{'name':_0x388e9e,'userProfileId':_0x48664c[_0xc24d('0x44')]},'raw':!![]})[_0xc24d('0x21')](function(_0x5748f4){if(_0x5748f4&&_0x5748f4[_0xc24d('0x45')]===0x0){return db[_0xc24d('0x46')][_0xc24d('0x40')]({'name':_0x1051ea['name'],'resourceId':_0x1051ea['id'],'type':_0x5748f4[_0xc24d('0x27')],'sectionId':_0x5748f4['id']},{})[_0xc24d('0x21')](function(){return _0x7be2f8;});}else{return _0x7be2f8;}})[_0xc24d('0x47')](function(_0x24a189){logger[_0xc24d('0x25')](_0xc24d('0x48'),_0x24a189);throw _0x24a189;});}return _0x7be2f8;})[_0xc24d('0x21')](respondWithResult(_0x470c60,0xc9))[_0xc24d('0x47')](handleError(_0x470c60,null));};exports[_0xc24d('0x49')]=function(_0x3b8ec5,_0x32801a){if(_0x3b8ec5['body']['id']){delete _0x3b8ec5[_0xc24d('0x4a')]['id'];}return db[_0xc24d('0x3a')][_0xc24d('0x3f')]({'where':{'id':_0x3b8ec5['params']['id']}})[_0xc24d('0x21')](handleEntityNotFound(_0x32801a,null))['then'](saveUpdates(_0x3b8ec5[_0xc24d('0x4a')],null))[_0xc24d('0x21')](respondWithResult(_0x32801a,null))['catch'](handleError(_0x32801a,null));};exports[_0xc24d('0x24')]=function(_0x5f228a,_0x3e0822){return db['Disposition'][_0xc24d('0x3f')]({'where':{'id':_0x5f228a[_0xc24d('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3e0822,null))[_0xc24d('0x21')](removeEntity(_0x3e0822,null))['catch'](handleError(_0x3e0822,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 0f3a582..a723f1a 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 _0xca95=['name_voice','name','ListId','name_chat','ChatWebsiteId','name_mail','name_sms','SmsAccountId','FaxAccountId','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./disposition.attributes','exports','define','Disposition'];(function(_0x35ba7b,_0x23edbf){var _0x13c052=function(_0x251dd8){while(--_0x251dd8){_0x35ba7b['push'](_0x35ba7b['shift']());}};_0x13c052(++_0x23edbf);}(_0xca95,0x15c));var _0x5ca9=function(_0x3db9ce,_0x395db8){_0x3db9ce=_0x3db9ce-0x0;var _0x4e5bd1=_0xca95[_0x3db9ce];return _0x4e5bd1;};'use strict';var _=require(_0x5ca9('0x0'));var util=require(_0x5ca9('0x1'));var logger=require(_0x5ca9('0x2'))(_0x5ca9('0x3'));var moment=require('moment');var BPromise=require(_0x5ca9('0x4'));var rp=require(_0x5ca9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5ca9('0x6'));var config=require(_0x5ca9('0x7'));var attributes=require(_0x5ca9('0x8'));module[_0x5ca9('0x9')]=function(_0x314eae,_0xd309aa){return _0x314eae[_0x5ca9('0xa')](_0x5ca9('0xb'),attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0x5ca9('0xc'),'fields':[_0x5ca9('0xd'),_0x5ca9('0xe')]},{'unique':!![],'name':_0x5ca9('0xf'),'fields':['name',_0x5ca9('0x10')]},{'unique':!![],'name':_0x5ca9('0x11'),'fields':['name','MailAccountId']},{'unique':!![],'name':_0x5ca9('0x12'),'fields':[_0x5ca9('0xd'),_0x5ca9('0x13')]},{'unique':!![],'name':'name_fax','fields':[_0x5ca9('0xd'),_0x5ca9('0x14')]},{'unique':!![],'name':'name_openchannel','fields':[_0x5ca9('0xd'),_0x5ca9('0x15')]},{'unique':!![],'name':_0x5ca9('0x16'),'fields':[_0x5ca9('0xd'),_0x5ca9('0x17')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2502=['name','ListId','name_chat','ChatWebsiteId','name_mail','MailAccountId','name_sms','SmsAccountId','name_fax','FaxAccountId','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','util','../../config/logger','moment','bluebird','path','define','tools_dispositions','name_voice'];(function(_0x3804da,_0x4b1678){var _0x1038e3=function(_0x46dbaf){while(--_0x46dbaf){_0x3804da['push'](_0x3804da['shift']());}};_0x1038e3(++_0x4b1678);}(_0x2502,0x141));var _0x2250=function(_0x2b70b6,_0x5704e9){_0x2b70b6=_0x2b70b6-0x0;var _0xd8ad96=_0x2502[_0x2b70b6];return _0xd8ad96;};'use strict';var _=require(_0x2250('0x0'));var util=require(_0x2250('0x1'));var logger=require(_0x2250('0x2'))('api');var moment=require(_0x2250('0x3'));var BPromise=require(_0x2250('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2250('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./disposition.attributes');module['exports']=function(_0x296195,_0x9fd6a6){return _0x296195[_0x2250('0x6')]('Disposition',attributes,{'tableName':_0x2250('0x7'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x2250('0x8'),'fields':[_0x2250('0x9'),_0x2250('0xa')]},{'unique':!![],'name':_0x2250('0xb'),'fields':['name',_0x2250('0xc')]},{'unique':!![],'name':_0x2250('0xd'),'fields':[_0x2250('0x9'),_0x2250('0xe')]},{'unique':!![],'name':_0x2250('0xf'),'fields':[_0x2250('0x9'),_0x2250('0x10')]},{'unique':!![],'name':_0x2250('0x11'),'fields':[_0x2250('0x9'),_0x2250('0x12')]},{'unique':!![],'name':'name_openchannel','fields':[_0x2250('0x9'),_0x2250('0x13')]},{'unique':!![],'name':_0x2250('0x14'),'fields':['name',_0x2250('0x15')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index b8844d0..3b9b1e6 100644 --- a/server/api/disposition/disposition.rpc.js +++ b/server/api/disposition/disposition.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['http','info','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xccc8ed,_0x30d087){var _0x53ad78=function(_0x56e10a){while(--_0x56e10a){_0xccc8ed['push'](_0xccc8ed['shift']());}};_0x53ad78(++_0x30d087);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +var _0xa9e0=['http','info','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x5bc30d,_0x53f399){var _0x30eb84=function(_0x3b1c9d){while(--_0x3b1c9d){_0x5bc30d['push'](_0x5bc30d['shift']());}};_0x30eb84(++_0x53f399);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js index a74e0a9..c285635 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 _0xa97b=['/:id','show','post','create','put','update','delete','destroy','exports','multer','connect-timeout','express','../../config/environment','get','isAuthenticated','index'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xa97b,0x79));var _0xba97=function(_0x56e511,_0x1d7a97){_0x56e511=_0x56e511-0x0;var _0x3b9b12=_0xa97b[_0x56e511];return _0x3b9b12;};'use strict';var multer=require(_0xba97('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xba97('0x1'));var express=require(_0xba97('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xba97('0x3'));var controller=require('./disposition.controller');router[_0xba97('0x4')]('/',auth[_0xba97('0x5')](),controller[_0xba97('0x6')]);router['get'](_0xba97('0x7'),auth[_0xba97('0x5')](),controller[_0xba97('0x8')]);router[_0xba97('0x9')]('/',auth[_0xba97('0x5')](),controller[_0xba97('0xa')]);router[_0xba97('0xb')](_0xba97('0x7'),auth['isAuthenticated'](),controller[_0xba97('0xc')]);router[_0xba97('0xd')](_0xba97('0x7'),auth[_0xba97('0x5')](),controller[_0xba97('0xe')]);module[_0xba97('0xf')]=router; \ No newline at end of file +var _0x8e7e=['post','isAuthenticated','create','delete','destroy','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./disposition.controller','get','index','/:id'];(function(_0x2b19aa,_0x595bb1){var _0x5ef563=function(_0x5b6805){while(--_0x5b6805){_0x2b19aa['push'](_0x2b19aa['shift']());}};_0x5ef563(++_0x595bb1);}(_0x8e7e,0xf5));var _0xe8e7=function(_0x2a5a8c,_0x29f93f){_0x2a5a8c=_0x2a5a8c-0x0;var _0x119d42=_0x8e7e[_0x2a5a8c];return _0x119d42;};'use strict';var multer=require(_0xe8e7('0x0'));var util=require(_0xe8e7('0x1'));var path=require('path');var timeout=require(_0xe8e7('0x2'));var express=require(_0xe8e7('0x3'));var router=express['Router']();var fs_extra=require(_0xe8e7('0x4'));var auth=require(_0xe8e7('0x5'));var interaction=require(_0xe8e7('0x6'));var config=require('../../config/environment');var controller=require(_0xe8e7('0x7'));router[_0xe8e7('0x8')]('/',auth['isAuthenticated'](),controller[_0xe8e7('0x9')]);router['get'](_0xe8e7('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xe8e7('0xb')]('/',auth[_0xe8e7('0xc')](),controller[_0xe8e7('0xd')]);router['put']('/:id',auth[_0xe8e7('0xc')](),controller['update']);router[_0xe8e7('0xe')](_0xe8e7('0xa'),auth[_0xe8e7('0xc')](),controller[_0xe8e7('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 86e1065..66f6c22 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 _0x10ce=['2400','7200','9600','12000','v17,v27,v29','INTEGER','SIP','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','4800','14400'];(function(_0x49d460,_0x19475c){var _0x12eb7f=function(_0x49fd1f){while(--_0x49fd1f){_0x49d460['push'](_0x49d460['shift']());}};_0x12eb7f(++_0x19475c);}(_0x10ce,0x1d7));var _0xe10c=function(_0x225b4b,_0x519a24){_0x225b4b=_0x225b4b-0x0;var _0x489be1=_0x10ce[_0x225b4b];return _0x489be1;};'use strict';var Sequelize=require(_0xe10c('0x0'));module[_0xe10c('0x1')]={'name':{'type':Sequelize[_0xe10c('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xe10c('0x2')]},'ecm':{'type':Sequelize[_0xe10c('0x3')]('yes','no'),'defaultValue':_0xe10c('0x4')},'headerinfo':{'type':Sequelize[_0xe10c('0x2')],'defaultValue':_0xe10c('0x5')},'localstationid':{'type':Sequelize[_0xe10c('0x2')],'unique':_0xe10c('0x6')},'minrate':{'type':Sequelize[_0xe10c('0x3')]('2400',_0xe10c('0x7'),'7200','9600','12000',_0xe10c('0x8')),'defaultValue':_0xe10c('0x7')},'maxrate':{'type':Sequelize[_0xe10c('0x3')](_0xe10c('0x9'),'4800',_0xe10c('0xa'),_0xe10c('0xb'),_0xe10c('0xc'),_0xe10c('0x8')),'defaultValue':_0xe10c('0x8')},'modem':{'type':Sequelize['STRING'],'defaultValue':_0xe10c('0xd')},'gateway':{'type':Sequelize[_0xe10c('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xe10c('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xe10c('0xe')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0xe10c('0xf'),'IAX','DADHI',_0xe10c('0x10')),'defaultValue':_0xe10c('0xf')},'key':{'type':Sequelize[_0xe10c('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xe10c('0x11')],'defaultValue':function(){return _0xe10c('0x12');}},'notificationSound':{'type':Sequelize[_0xe10c('0x13')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xe10c('0x13')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xe10c('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xe10c('0xe')],'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[_0xe10c('0xe')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xe10c('0x13')],'defaultValue':![],'comment':_0xe10c('0x14'),'set':function(_0x31ff35){if(!_0x31ff35)this[_0xe10c('0x15')](_0xe10c('0x16'),null);this[_0xe10c('0x15')](_0xe10c('0x17'),_0x31ff35);}}}; \ No newline at end of file +var _0x12f1=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','ENUM','yes','localstationid','2400','4800','7200','9600','12000','14400','v17,v27,v29','INTEGER','SIP','IAX','DADHI','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x8d87e8,_0x36e15c){var _0x1e6b99=function(_0x276ce0){while(--_0x276ce0){_0x8d87e8['push'](_0x8d87e8['shift']());}};_0x1e6b99(++_0x36e15c);}(_0x12f1,0xf4));var _0x112f=function(_0x1e28dc,_0x59cdf8){_0x1e28dc=_0x1e28dc-0x0;var _0x302c2c=_0x12f1[_0x1e28dc];return _0x302c2c;};'use strict';var Sequelize=require(_0x112f('0x0'));module['exports']={'name':{'type':Sequelize[_0x112f('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x112f('0x1')]},'ecm':{'type':Sequelize[_0x112f('0x2')](_0x112f('0x3'),'no'),'defaultValue':_0x112f('0x3')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize['STRING'],'unique':_0x112f('0x4')},'minrate':{'type':Sequelize['ENUM'](_0x112f('0x5'),_0x112f('0x6'),_0x112f('0x7'),_0x112f('0x8'),_0x112f('0x9'),_0x112f('0xa')),'defaultValue':_0x112f('0x6')},'maxrate':{'type':Sequelize[_0x112f('0x2')](_0x112f('0x5'),'4800',_0x112f('0x7'),_0x112f('0x8'),_0x112f('0x9'),_0x112f('0xa')),'defaultValue':_0x112f('0xa')},'modem':{'type':Sequelize[_0x112f('0x1')],'defaultValue':_0x112f('0xb')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x112f('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x112f('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x112f('0x2')](_0x112f('0xd'),_0x112f('0xe'),_0x112f('0xf'),'KHOMP'),'defaultValue':_0x112f('0xd')},'key':{'type':Sequelize[_0x112f('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x112f('0x10')],'defaultValue':function(){return _0x112f('0x11');}},'notificationSound':{'type':Sequelize[_0x112f('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x112f('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x112f('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x112f('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x112f('0xc')],'allowNull':!![],'defaultValue':null,'comment':_0x112f('0x13')},'mandatoryDisposition':{'type':Sequelize[_0x112f('0x12')],'defaultValue':![],'comment':_0x112f('0x14'),'set':function(_0x367b8a){if(!_0x367b8a)this[_0x112f('0x15')](_0x112f('0x16'),null);this[_0x112f('0x15')](_0x112f('0x17'),_0x367b8a);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index f9f9361..9914e17 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 _0x06a9=['push','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','headerinfo','maxrate','minrate','t38timeout','FAXOPT(','Wait','ReceiveFax','sequelize','transaction','VoiceExtension','bulkCreate','tech','createdAt','TrunkId','findById','getMessages','$gte','split','FaxMessage','CmList','List','Contacts','updatedAt','attachments','join','server/files/attachments','CheckAfterSend','isNil','from','format','fax','ListId','Send\x20Fax\x20failed','filename','Messages','out','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','omit','spread','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','User','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','get','UserProfileResource','destroy','stack','name','send','index','Pause','mandatoryDispositionPause','fieldName','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','map','options','FaxAccount','includeAll','include','findAll','rows','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','FaxAccounts','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addDisposition','Disposition','getDispositions','findOne','rawAttributes','order','FaxAccountId','removeDispositions','addAnswer','getAnswers','CannedAnswer','pick','removeAnswers','ids','addInteraction','FaxInteraction','getInteractions','CmContact','Contact','fullname','internal','Tag','Tags','color','tag','addApplications','ISOLATION_LEVELS','FaxApplication','findAndCountAll','priority','finally','json','getApplications','context','from-voip-provider','exten','localstationid','app','system','description','Fax\x20Extension','Answer'];(function(_0x401c21,_0x2e16d5){var _0x1a320e=function(_0x48065e){while(--_0x48065e){_0x401c21['push'](_0x401c21['shift']());}};_0x1a320e(++_0x2e16d5);}(_0x06a9,0xfd));var _0x906a=function(_0x187b01,_0x5d27a6){_0x187b01=_0x187b01-0x0;var _0x3f0877=_0x06a9[_0x187b01];return _0x3f0877;};'use strict';var emlformat=require(_0x906a('0x0'));var rimraf=require(_0x906a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x906a('0x2'));var moment=require(_0x906a('0x3'));var BPromise=require(_0x906a('0x4'));var Mustache=require(_0x906a('0x5'));var util=require('util');var path=require(_0x906a('0x6'));var sox=require('sox');var csv=require(_0x906a('0x7'));var ejs=require(_0x906a('0x8'));var fs=require('fs');var fs_extra=require(_0x906a('0x9'));var _=require('lodash');var squel=require(_0x906a('0xa'));var crypto=require('crypto');var jsforce=require(_0x906a('0xb'));var deskjs=require(_0x906a('0xc'));var toCsv=require(_0x906a('0x7'));var querystring=require(_0x906a('0xd'));var Papa=require(_0x906a('0xe'));var Redis=require('ioredis');var authService=require(_0x906a('0xf'));var qs=require(_0x906a('0x10'));var as=require(_0x906a('0x11'));var hardwareService=require(_0x906a('0x12'));var logger=require('../../config/logger')(_0x906a('0x13'));var utils=require(_0x906a('0x14'));var config=require(_0x906a('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x906a('0x16'))['db'];config[_0x906a('0x17')]=_[_0x906a('0x18')](config[_0x906a('0x17')],{'host':_0x906a('0x19'),'port':0x18eb});var socket=require(_0x906a('0x1a'))(new Redis(config[_0x906a('0x17')]));require(_0x906a('0x1b'))[_0x906a('0x1c')](socket);var jayson=require(_0x906a('0x1d'));var client=jayson[_0x906a('0x1e')][_0x906a('0x1f')]({'port':0x232c});var client9002=jayson[_0x906a('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1ea77c,_0x161bb1,_0x4f1f58,_0x334efb){return new BPromise(function(_0x267f36,_0x5a019a){var _0x5db58c=_0x334efb||client;return _0x5db58c['request'](_0x1ea77c,_0x4f1f58)['then'](function(_0x45cb2f){logger['info'](_0x906a('0x20'),_0x161bb1,_0x906a('0x21'));logger[_0x906a('0x22')](_0x906a('0x23'),_0x161bb1,_0x906a('0x21'),JSON[_0x906a('0x24')](_0x45cb2f));if(_0x45cb2f['error']){if(_0x45cb2f['error'][_0x906a('0x25')]===0x1f4){logger[_0x906a('0x26')](_0x906a('0x20'),_0x161bb1,_0x45cb2f[_0x906a('0x26')][_0x906a('0x27')]);return _0x5a019a(_0x45cb2f[_0x906a('0x26')]['message']);}logger[_0x906a('0x26')]('FaxAccount,\x20%s,\x20%s',_0x161bb1,_0x45cb2f[_0x906a('0x26')][_0x906a('0x27')]);return _0x267f36(_0x45cb2f[_0x906a('0x26')][_0x906a('0x27')]);}else{logger[_0x906a('0x28')](_0x906a('0x20'),_0x161bb1,_0x906a('0x21'));_0x267f36(_0x45cb2f['result'][_0x906a('0x27')]);}})[_0x906a('0x29')](function(_0x52d52b){logger[_0x906a('0x26')](_0x906a('0x20'),_0x161bb1,_0x52d52b);_0x5a019a(_0x52d52b);});});}function respondWithStatusCode(_0x27bd33,_0x3ad751){_0x3ad751=_0x3ad751||0xcc;return function(_0x253d7b){if(_0x253d7b){return _0x27bd33[_0x906a('0x2a')](_0x3ad751);}return _0x27bd33[_0x906a('0x2b')](_0x3ad751)[_0x906a('0x2c')]();};}function respondWithResult(_0x352fc3,_0x3300a0){_0x3300a0=_0x3300a0||0xc8;return function(_0x5b7ea3){if(_0x5b7ea3){return _0x352fc3[_0x906a('0x2b')](_0x3300a0)['json'](_0x5b7ea3);}};}function respondWithFilteredResult(_0x1e8f46,_0x53676c){return function(_0x46b438){if(_0x46b438){var _0x5962b2=typeof _0x53676c[_0x906a('0x2d')]===_0x906a('0x2e')&&typeof _0x53676c[_0x906a('0x2f')]===_0x906a('0x2e');var _0x2fe607=_0x46b438['count'];var _0x57b150=_0x5962b2?0x0:_0x53676c[_0x906a('0x2d')];var _0x4c4cbe=_0x5962b2?_0x46b438[_0x906a('0x30')]:_0x53676c[_0x906a('0x2d')]+_0x53676c[_0x906a('0x2f')];var _0x24c1a0;if(_0x4c4cbe>=_0x2fe607){_0x4c4cbe=_0x2fe607;_0x24c1a0=0xc8;}else{_0x24c1a0=0xce;}_0x1e8f46[_0x906a('0x2b')](_0x24c1a0);return _0x1e8f46[_0x906a('0x31')](_0x906a('0x32'),_0x57b150+'-'+_0x4c4cbe+'/'+_0x2fe607)['json'](_0x46b438);}return null;};}function patchUpdates(_0x1391f5){return function(_0x13f434){try{jsonpatch[_0x906a('0x33')](_0x13f434,_0x1391f5,!![]);}catch(_0x4134c0){return BPromise[_0x906a('0x34')](_0x4134c0);}return _0x13f434['save']();};}function saveUpdates(_0x2944bf,_0x4326a0){return function(_0x55e881){if(_0x55e881){return _0x55e881[_0x906a('0x35')](_0x2944bf)[_0x906a('0x36')](function(_0x1fd508){return _0x1fd508;});}return null;};}function removeEntity(_0x4b6438,_0x233677){return function(_0x36a23f){if(_0x36a23f){return _0x36a23f['destroy']()[_0x906a('0x36')](function(){var _0x3f5876=_0x36a23f[_0x906a('0x37')]({'plain':!![]});var _0x168ac8='FaxAccounts';return db[_0x906a('0x38')][_0x906a('0x39')]({'where':{'type':_0x168ac8,'resourceId':_0x3f5876['id']}})[_0x906a('0x36')](function(){return _0x36a23f;});})[_0x906a('0x36')](function(){_0x4b6438[_0x906a('0x2b')](0xcc)[_0x906a('0x2c')]();});}};}function handleEntityNotFound(_0x3e95a0,_0x78129d){return function(_0x3b6336){if(!_0x3b6336){_0x3e95a0[_0x906a('0x2a')](0x194);}return _0x3b6336;};}function handleError(_0x35d0d7,_0x4751be){_0x4751be=_0x4751be||0x1f4;return function(_0x152b13){logger[_0x906a('0x26')](_0x152b13[_0x906a('0x3a')]);if(_0x152b13[_0x906a('0x3b')]){delete _0x152b13[_0x906a('0x3b')];}_0x35d0d7[_0x906a('0x2b')](_0x4751be)[_0x906a('0x3c')](_0x152b13);};}exports[_0x906a('0x3d')]=function(_0x3b44b5,_0x5d9038){var _0xdd49c7={'include':[{'model':db[_0x906a('0x3e')],'as':_0x906a('0x3f')}]},_0x3157eb={},_0x362ac6={'count':0x0,'rows':[]};var _0x23fe50=_['map'](db['FaxAccount']['rawAttributes'],function(_0x30e572){return{'name':_0x30e572[_0x906a('0x40')],'type':_0x30e572['type']['key']};});_0x3157eb[_0x906a('0x41')]=_['map'](_0x23fe50,_0x906a('0x3b'));_0x3157eb[_0x906a('0x42')]=_['keys'](_0x3b44b5[_0x906a('0x42')]);_0x3157eb[_0x906a('0x43')]=_[_0x906a('0x44')](_0x3157eb[_0x906a('0x41')],_0x3157eb[_0x906a('0x42')]);_0xdd49c7[_0x906a('0x45')]=_[_0x906a('0x44')](_0x3157eb[_0x906a('0x41')],qs[_0x906a('0x46')](_0x3b44b5[_0x906a('0x42')][_0x906a('0x46')]));_0xdd49c7[_0x906a('0x45')]=_0xdd49c7[_0x906a('0x45')][_0x906a('0x47')]?_0xdd49c7[_0x906a('0x45')]:_0x3157eb[_0x906a('0x41')];if(!_0x3b44b5[_0x906a('0x42')][_0x906a('0x48')](_0x906a('0x49'))){_0xdd49c7['limit']=qs[_0x906a('0x2f')](_0x3b44b5[_0x906a('0x42')][_0x906a('0x2f')]);_0xdd49c7[_0x906a('0x2d')]=qs['offset'](_0x3b44b5[_0x906a('0x42')]['offset']);}_0xdd49c7['order']=qs[_0x906a('0x4a')](_0x3b44b5[_0x906a('0x42')]['sort']);_0xdd49c7[_0x906a('0x4b')]=qs['filters'](_['pick'](_0x3b44b5[_0x906a('0x42')],_0x3157eb[_0x906a('0x43')]),_0x23fe50);if(_0x3b44b5[_0x906a('0x42')][_0x906a('0x4c')]){_0xdd49c7[_0x906a('0x4b')]=_[_0x906a('0x4d')](_0xdd49c7[_0x906a('0x4b')],{'$or':_[_0x906a('0x4e')](_0x23fe50,function(_0x201f24){if(_0x201f24['type']!=='VIRTUAL'){var _0xcfd4d9={};_0xcfd4d9[_0x201f24[_0x906a('0x3b')]]={'$like':'%'+_0x3b44b5[_0x906a('0x42')][_0x906a('0x4c')]+'%'};return _0xcfd4d9;}})});}_0xdd49c7=_[_0x906a('0x4d')]({},_0xdd49c7,_0x3b44b5[_0x906a('0x4f')]);var _0x4ca7ad={'where':_0xdd49c7['where']};return db[_0x906a('0x50')]['count'](_0x4ca7ad)[_0x906a('0x36')](function(_0x615b41){_0x362ac6['count']=_0x615b41;if(_0x3b44b5[_0x906a('0x42')][_0x906a('0x51')]){_0xdd49c7[_0x906a('0x52')]=[{'all':!![]}];}return db[_0x906a('0x50')][_0x906a('0x53')](_0xdd49c7);})[_0x906a('0x36')](function(_0x2a1780){_0x362ac6[_0x906a('0x54')]=_0x2a1780;return _0x362ac6;})[_0x906a('0x36')](respondWithFilteredResult(_0x5d9038,_0xdd49c7))[_0x906a('0x29')](handleError(_0x5d9038,null));};exports[_0x906a('0x55')]=function(_0x2fcc06,_0x2bc4b4){var _0x432355={'raw':![],'where':{'id':_0x2fcc06[_0x906a('0x56')]['id']},'include':[{'model':db[_0x906a('0x3e')],'as':_0x906a('0x3f')}]},_0x58a97e={};_0x58a97e[_0x906a('0x41')]=_[_0x906a('0x57')](db[_0x906a('0x50')]['rawAttributes']);_0x58a97e[_0x906a('0x42')]=_['keys'](_0x2fcc06['query']);_0x58a97e[_0x906a('0x43')]=_[_0x906a('0x44')](_0x58a97e['model'],_0x58a97e[_0x906a('0x42')]);_0x432355['attributes']=_[_0x906a('0x44')](_0x58a97e[_0x906a('0x41')],qs[_0x906a('0x46')](_0x2fcc06[_0x906a('0x42')][_0x906a('0x46')]));_0x432355['attributes']=_0x432355[_0x906a('0x45')][_0x906a('0x47')]?_0x432355[_0x906a('0x45')]:_0x58a97e[_0x906a('0x41')];if(_0x2fcc06[_0x906a('0x42')]['includeAll']){_0x432355[_0x906a('0x52')]=[{'all':!![]}];}_0x432355=_[_0x906a('0x4d')]({},_0x432355,_0x2fcc06['options']);return db[_0x906a('0x50')][_0x906a('0x58')](_0x432355)[_0x906a('0x36')](handleEntityNotFound(_0x2bc4b4,null))['then'](respondWithResult(_0x2bc4b4,null))['catch'](handleError(_0x2bc4b4,null));};exports[_0x906a('0x59')]=function(_0x13ad0d,_0x475ce2){return db[_0x906a('0x50')]['create'](_0x13ad0d[_0x906a('0x5a')],{})[_0x906a('0x36')](function(_0x4d302f){var _0x5285a4=_0x13ad0d[_0x906a('0x5b')][_0x906a('0x37')]({'plain':!![]});if(!_0x5285a4)throw new Error(_0x906a('0x5c'));if(_0x5285a4[_0x906a('0x5d')]===_0x906a('0x5b')){var _0x37fcdb=_0x4d302f['get']({'plain':!![]});var _0xaac4e1=_0x906a('0x5e');return db[_0x906a('0x5f')]['find']({'where':{'name':_0xaac4e1,'userProfileId':_0x5285a4[_0x906a('0x60')]},'raw':!![]})[_0x906a('0x36')](function(_0x324746){if(_0x324746&&_0x324746[_0x906a('0x61')]===0x0){return db[_0x906a('0x38')][_0x906a('0x59')]({'name':_0x37fcdb[_0x906a('0x3b')],'resourceId':_0x37fcdb['id'],'type':_0x324746['name'],'sectionId':_0x324746['id']},{})['then'](function(){return _0x4d302f;});}else{return _0x4d302f;}})[_0x906a('0x29')](function(_0x529825){logger[_0x906a('0x26')](_0x906a('0x62'),_0x529825);throw _0x529825;});}return _0x4d302f;})[_0x906a('0x36')](respondWithResult(_0x475ce2,0xc9))[_0x906a('0x29')](handleError(_0x475ce2,null));};exports[_0x906a('0x35')]=function(_0x48614,_0x4ef0c4){if(_0x48614[_0x906a('0x5a')]['id']){delete _0x48614['body']['id'];}return db[_0x906a('0x50')][_0x906a('0x58')]({'where':{'id':_0x48614['params']['id']},'include':[{'model':db[_0x906a('0x3e')],'as':_0x906a('0x3f')}]})[_0x906a('0x36')](handleEntityNotFound(_0x4ef0c4,null))[_0x906a('0x36')](saveUpdates(_0x48614[_0x906a('0x5a')],null))[_0x906a('0x36')](respondWithResult(_0x4ef0c4,null))[_0x906a('0x29')](handleError(_0x4ef0c4,null));};exports[_0x906a('0x39')]=function(_0x4c4421,_0x4cfe91){return db[_0x906a('0x50')][_0x906a('0x58')]({'where':{'id':_0x4c4421['params']['id']}})['then'](handleEntityNotFound(_0x4cfe91,null))[_0x906a('0x36')](removeEntity(_0x4cfe91,null))[_0x906a('0x29')](handleError(_0x4cfe91,null));};exports['describe']=function(_0x4824f5,_0xdeda51){return db[_0x906a('0x50')]['describe']()[_0x906a('0x36')](respondWithResult(_0xdeda51,null))[_0x906a('0x29')](handleError(_0xdeda51,null));};exports[_0x906a('0x63')]=function(_0x1324ee,_0x566344,_0x53228e){if(_0x1324ee[_0x906a('0x5a')]['id']){delete _0x1324ee[_0x906a('0x5a')]['id'];}return db[_0x906a('0x50')][_0x906a('0x58')]({'where':{'id':_0x1324ee[_0x906a('0x56')]['id']}})[_0x906a('0x36')](handleEntityNotFound(_0x566344,null))[_0x906a('0x36')](function(_0x257d65){if(_0x257d65){_0x1324ee['body']['FaxAccountId']=_0x257d65['id'];return db[_0x906a('0x64')][_0x906a('0x59')](_0x1324ee[_0x906a('0x5a')]);}})[_0x906a('0x36')](respondWithResult(_0x566344,null))['catch'](handleError(_0x566344,null));};exports[_0x906a('0x65')]=function(_0xbca368,_0x10f2ad,_0x538c32){var _0x4b71d5={'raw':![],'where':{}};var _0x23b334={};var _0x1602aa={'count':0x0,'rows':[]};return db[_0x906a('0x50')][_0x906a('0x66')]({'where':{'id':_0xbca368['params']['id']}})[_0x906a('0x36')](handleEntityNotFound(_0x10f2ad,null))[_0x906a('0x36')](function(_0x220964){if(_0x220964){_0x23b334[_0x906a('0x41')]=_[_0x906a('0x57')](db[_0x906a('0x64')][_0x906a('0x67')]);_0x23b334[_0x906a('0x42')]=_[_0x906a('0x57')](_0xbca368[_0x906a('0x42')]);_0x23b334['filters']=_[_0x906a('0x44')](_0x23b334['model'],_0x23b334[_0x906a('0x42')]);_0x4b71d5[_0x906a('0x45')]=_[_0x906a('0x44')](_0x23b334[_0x906a('0x41')],qs['fields'](_0xbca368[_0x906a('0x42')][_0x906a('0x46')]));_0x4b71d5[_0x906a('0x45')]=_0x4b71d5[_0x906a('0x45')][_0x906a('0x47')]?_0x4b71d5[_0x906a('0x45')]:_0x23b334[_0x906a('0x41')];if(!_0xbca368[_0x906a('0x42')][_0x906a('0x48')](_0x906a('0x49'))){_0x4b71d5['limit']=qs[_0x906a('0x2f')](_0xbca368[_0x906a('0x42')][_0x906a('0x2f')]);_0x4b71d5[_0x906a('0x2d')]=qs[_0x906a('0x2d')](_0xbca368[_0x906a('0x42')]['offset']);}_0x4b71d5[_0x906a('0x68')]=qs[_0x906a('0x4a')](_0xbca368[_0x906a('0x42')][_0x906a('0x4a')]);_0x4b71d5[_0x906a('0x4b')]=qs['filters'](_['pick'](_0xbca368[_0x906a('0x42')],_0x23b334[_0x906a('0x43')]));_0x4b71d5[_0x906a('0x4b')][_0x906a('0x69')]=_0x220964['id'];if(_0xbca368[_0x906a('0x42')]['filter']){_0x4b71d5['where']=_[_0x906a('0x4d')](_0x4b71d5[_0x906a('0x4b')],{'$or':_[_0x906a('0x4e')](_0x4b71d5['attributes'],function(_0x299563){var _0x50fc1a={};_0x50fc1a[_0x299563]={'$like':'%'+_0xbca368[_0x906a('0x42')][_0x906a('0x4c')]+'%'};return _0x50fc1a;})});}_0x4b71d5=_[_0x906a('0x4d')]({},_0x4b71d5,_0xbca368[_0x906a('0x4f')]);return db['Disposition'][_0x906a('0x30')]({'where':_0x4b71d5['where']})[_0x906a('0x36')](function(_0x31b770){_0x1602aa[_0x906a('0x30')]=_0x31b770;if(_0xbca368[_0x906a('0x42')][_0x906a('0x51')]){_0x4b71d5['include']=[{'all':!![]}];}return db['Disposition'][_0x906a('0x53')](_0x4b71d5);})[_0x906a('0x36')](function(_0x490370){_0x1602aa[_0x906a('0x54')]=_0x490370;return _0x1602aa;});}})[_0x906a('0x36')](respondWithFilteredResult(_0x10f2ad,_0x4b71d5))[_0x906a('0x29')](handleError(_0x10f2ad,null));};exports[_0x906a('0x6a')]=function(_0x1abb7a,_0x194d5,_0x11ad33){return db[_0x906a('0x50')][_0x906a('0x58')]({'where':{'id':_0x1abb7a['params']['id']}})[_0x906a('0x36')](handleEntityNotFound(_0x194d5,null))[_0x906a('0x36')](function(_0x21be5c){if(_0x21be5c){return _0x21be5c['removeDispositions'](_0x1abb7a[_0x906a('0x42')]['ids']);}})['then'](respondWithStatusCode(_0x194d5,null))[_0x906a('0x29')](handleError(_0x194d5,null));};exports[_0x906a('0x6b')]=function(_0x42b52f,_0x1b5db9,_0x413f81){if(_0x42b52f[_0x906a('0x5a')]['id']){delete _0x42b52f[_0x906a('0x5a')]['id'];}return db[_0x906a('0x50')][_0x906a('0x58')]({'where':{'id':_0x42b52f['params']['id']}})['then'](handleEntityNotFound(_0x1b5db9,null))[_0x906a('0x36')](function(_0x3633de){if(_0x3633de){_0x42b52f[_0x906a('0x5a')][_0x906a('0x69')]=_0x3633de['id'];return db['CannedAnswer'][_0x906a('0x59')](_0x42b52f[_0x906a('0x5a')]);}})[_0x906a('0x36')](respondWithResult(_0x1b5db9,null))[_0x906a('0x29')](handleError(_0x1b5db9,null));};exports[_0x906a('0x6c')]=function(_0x281d7d,_0x26aca1,_0x46c557){var _0x1eaeab={'raw':![],'where':{}};var _0x3568d6={};var _0x568557={'count':0x0,'rows':[]};return db[_0x906a('0x50')][_0x906a('0x66')]({'where':{'id':_0x281d7d[_0x906a('0x56')]['id']}})[_0x906a('0x36')](handleEntityNotFound(_0x26aca1,null))[_0x906a('0x36')](function(_0x5eb91e){if(_0x5eb91e){_0x3568d6[_0x906a('0x41')]=_[_0x906a('0x57')](db[_0x906a('0x6d')][_0x906a('0x67')]);_0x3568d6['query']=_[_0x906a('0x57')](_0x281d7d['query']);_0x3568d6[_0x906a('0x43')]=_[_0x906a('0x44')](_0x3568d6[_0x906a('0x41')],_0x3568d6[_0x906a('0x42')]);_0x1eaeab[_0x906a('0x45')]=_[_0x906a('0x44')](_0x3568d6['model'],qs['fields'](_0x281d7d[_0x906a('0x42')][_0x906a('0x46')]));_0x1eaeab['attributes']=_0x1eaeab[_0x906a('0x45')][_0x906a('0x47')]?_0x1eaeab[_0x906a('0x45')]:_0x3568d6[_0x906a('0x41')];if(!_0x281d7d['query'][_0x906a('0x48')](_0x906a('0x49'))){_0x1eaeab[_0x906a('0x2f')]=qs[_0x906a('0x2f')](_0x281d7d['query'][_0x906a('0x2f')]);_0x1eaeab[_0x906a('0x2d')]=qs['offset'](_0x281d7d[_0x906a('0x42')][_0x906a('0x2d')]);}_0x1eaeab[_0x906a('0x68')]=qs[_0x906a('0x4a')](_0x281d7d[_0x906a('0x42')][_0x906a('0x4a')]);_0x1eaeab[_0x906a('0x4b')]=qs['filters'](_[_0x906a('0x6e')](_0x281d7d[_0x906a('0x42')],_0x3568d6[_0x906a('0x43')]));_0x1eaeab[_0x906a('0x4b')][_0x906a('0x69')]=_0x5eb91e['id'];if(_0x281d7d[_0x906a('0x42')][_0x906a('0x4c')]){_0x1eaeab[_0x906a('0x4b')]=_[_0x906a('0x4d')](_0x1eaeab[_0x906a('0x4b')],{'$or':_[_0x906a('0x4e')](_0x1eaeab['attributes'],function(_0x325022){var _0x5990c7={};_0x5990c7[_0x325022]={'$like':'%'+_0x281d7d[_0x906a('0x42')][_0x906a('0x4c')]+'%'};return _0x5990c7;})});}_0x1eaeab=_[_0x906a('0x4d')]({},_0x1eaeab,_0x281d7d[_0x906a('0x4f')]);return db[_0x906a('0x6d')]['count']({'where':_0x1eaeab['where']})[_0x906a('0x36')](function(_0x4eb72b){_0x568557[_0x906a('0x30')]=_0x4eb72b;if(_0x281d7d[_0x906a('0x42')][_0x906a('0x51')]){_0x1eaeab['include']=[{'all':!![]}];}return db[_0x906a('0x6d')][_0x906a('0x53')](_0x1eaeab);})[_0x906a('0x36')](function(_0x4bbd96){_0x568557[_0x906a('0x54')]=_0x4bbd96;return _0x568557;});}})[_0x906a('0x36')](respondWithFilteredResult(_0x26aca1,_0x1eaeab))[_0x906a('0x29')](handleError(_0x26aca1,null));};exports[_0x906a('0x6f')]=function(_0x42790a,_0x9d65e8,_0x5c0397){return db[_0x906a('0x50')][_0x906a('0x58')]({'where':{'id':_0x42790a[_0x906a('0x56')]['id']}})['then'](handleEntityNotFound(_0x9d65e8,null))[_0x906a('0x36')](function(_0x24ca78){if(_0x24ca78){return _0x24ca78['removeAnswers'](_0x42790a[_0x906a('0x42')][_0x906a('0x70')]);}})[_0x906a('0x36')](respondWithStatusCode(_0x9d65e8,null))['catch'](handleError(_0x9d65e8,null));};exports[_0x906a('0x71')]=function(_0x2cd366,_0x39cab5,_0x2fcfa8){return db[_0x906a('0x72')][_0x906a('0x58')]({'where':{'id':_0x2cd366[_0x906a('0x56')]['id']}})['then'](handleEntityNotFound(_0x39cab5,null))['then'](function(_0x5457c8){if(_0x5457c8){return _0x5457c8[_0x906a('0x71')](_0x2cd366['body'][_0x906a('0x70')],_['omit'](_0x2cd366[_0x906a('0x5a')],['ids','id'])||{});}})['then'](respondWithResult(_0x39cab5,null))[_0x906a('0x29')](handleError(_0x39cab5,null));};exports[_0x906a('0x73')]=function(_0x2cf9ac,_0x4212a6,_0x4090b5){var _0xed09f9={'raw':![],'where':{}};var _0x4c3fe5={};var _0x40b7e4={'count':0x0,'rows':[]};return db[_0x906a('0x50')][_0x906a('0x66')]({'where':{'id':_0x2cf9ac['params']['id']}})['then'](handleEntityNotFound(_0x4212a6,null))[_0x906a('0x36')](function(_0x517bd4){if(_0x517bd4){_0x4c3fe5['model']=_[_0x906a('0x57')](db[_0x906a('0x72')]['rawAttributes']);_0x4c3fe5[_0x906a('0x42')]=_['keys'](_0x2cf9ac[_0x906a('0x42')]);_0x4c3fe5[_0x906a('0x43')]=_['intersection'](_0x4c3fe5[_0x906a('0x41')],_0x4c3fe5[_0x906a('0x42')]);_0xed09f9[_0x906a('0x45')]=_[_0x906a('0x44')](_0x4c3fe5[_0x906a('0x41')],qs['fields'](_0x2cf9ac[_0x906a('0x42')][_0x906a('0x46')]));_0xed09f9[_0x906a('0x45')]=_0xed09f9[_0x906a('0x45')][_0x906a('0x47')]?_0xed09f9[_0x906a('0x45')]:_0x4c3fe5[_0x906a('0x41')];if(!_0x2cf9ac[_0x906a('0x42')][_0x906a('0x48')]('nolimit')){_0xed09f9['limit']=qs['limit'](_0x2cf9ac[_0x906a('0x42')]['limit']);_0xed09f9['offset']=qs[_0x906a('0x2d')](_0x2cf9ac[_0x906a('0x42')][_0x906a('0x2d')]);}_0xed09f9['order']=qs[_0x906a('0x4a')](_0x2cf9ac[_0x906a('0x42')]['sort']);_0xed09f9[_0x906a('0x4b')]=qs[_0x906a('0x43')](_[_0x906a('0x6e')](_0x2cf9ac['query'],_0x4c3fe5[_0x906a('0x43')]));_0xed09f9['where']['FaxAccountId']=_0x517bd4['id'];if(_0x2cf9ac[_0x906a('0x42')][_0x906a('0x4c')]){_0xed09f9['where']=_[_0x906a('0x4d')](_0xed09f9[_0x906a('0x4b')],{'$or':_[_0x906a('0x4e')](_0xed09f9[_0x906a('0x45')],function(_0xc3dba0){var _0x5eb599={};_0x5eb599[_0xc3dba0]={'$like':'%'+_0x2cf9ac[_0x906a('0x42')][_0x906a('0x4c')]+'%'};return _0x5eb599;})});}_0xed09f9=_[_0x906a('0x4d')]({},_0xed09f9,_0x2cf9ac[_0x906a('0x4f')]);return db['FaxInteraction']['count']({'where':_0xed09f9['where']})[_0x906a('0x36')](function(_0x2fc567){_0x40b7e4[_0x906a('0x30')]=_0x2fc567;if(_0x2cf9ac['query'][_0x906a('0x51')]){_0xed09f9[_0x906a('0x52')]=[{'model':db[_0x906a('0x74')],'as':_0x906a('0x75'),'required':![]},{'model':db['User'],'as':'Owner','attributes':['name',_0x906a('0x76'),_0x906a('0x77')],'required':![]},{'model':db[_0x906a('0x78')],'as':_0x906a('0x79'),'attributes':['id',_0x906a('0x3b'),_0x906a('0x7a')],'where':_0x2cf9ac[_0x906a('0x42')][_0x906a('0x7b')]?{'id':_0x2cf9ac[_0x906a('0x42')][_0x906a('0x7b')]}:undefined,'required':_0x2cf9ac[_0x906a('0x42')][_0x906a('0x7b')]?!![]:![]}];}return db[_0x906a('0x72')][_0x906a('0x53')](_0xed09f9);})[_0x906a('0x36')](function(_0x5db15d){_0x40b7e4[_0x906a('0x54')]=_0x5db15d;return _0x40b7e4;});}})[_0x906a('0x36')](respondWithFilteredResult(_0x4212a6,_0xed09f9))['catch'](handleError(_0x4212a6,null));};exports[_0x906a('0x7c')]=function(_0x2d57bb,_0x2154b1){var _0x2ee1f7=_0x2d57bb[_0x906a('0x56')]['id'];var _0x447e07=_0x2d57bb['body'];var _0x28bc45=0xc8;var _0x3bef7b=null;return db['sequelize']['transaction']({'isolationLevel':db['sequelize']['Transaction'][_0x906a('0x7d')]['READ_COMMITTED']},function(_0x10c55c){return db['FaxAccount'][_0x906a('0x66')]({'where':{'id':_0x2ee1f7},'transaction':_0x10c55c})[_0x906a('0x36')](function(_0x14f3c7){if(_0x14f3c7){return db[_0x906a('0x7e')][_0x906a('0x39')]({'where':{'FaxAccountId':_0x2ee1f7},'transaction':_0x10c55c})[_0x906a('0x36')](function(){var _0xca20e3=_[_0x906a('0x4e')](_0x447e07,function(_0x4b52f5){_0x4b52f5[_0x906a('0x69')]=_0x2ee1f7;return _0x4b52f5;});return db[_0x906a('0x7e')]['bulkCreate'](_0xca20e3,{'transaction':_0x10c55c});});}else{_0x28bc45=0x194;_0x3bef7b=[];}});})[_0x906a('0x36')](function(){if(_0x28bc45!==0x194){return db['FaxApplication'][_0x906a('0x7f')]({'where':{'FaxAccountId':_0x2ee1f7},'order':_0x906a('0x80')})['then'](function(_0x108617){_0x3bef7b=_0x108617;});}})[_0x906a('0x29')](function(_0x129a9b){_0x28bc45=0x1f4;logger[_0x906a('0x26')](_0x129a9b[_0x906a('0x3a')]);if(_0x129a9b['name']){delete _0x129a9b[_0x906a('0x3b')];}_0x3bef7b=_0x129a9b;})[_0x906a('0x81')](function(){if(_0x3bef7b===null){_0x2154b1[_0x906a('0x2a')](_0x28bc45);}else{if(_0x28bc45===0x1f4){_0x2154b1[_0x906a('0x2b')](_0x28bc45)[_0x906a('0x3c')](_0x3bef7b);}else{_0x2154b1[_0x906a('0x2b')](_0x28bc45)[_0x906a('0x82')](_0x3bef7b);}}});};exports['getApplications']=function(_0x4fcd64,_0x2096e8,_0x541d07){var _0x25e522={};var _0x6d71e3={};var _0x2e57bd;var _0x37223c;return db[_0x906a('0x50')][_0x906a('0x66')]({'where':{'id':_0x4fcd64['params']['id']}})[_0x906a('0x36')](handleEntityNotFound(_0x2096e8,null))[_0x906a('0x36')](function(_0x813b58){if(_0x813b58){_0x2e57bd=_0x813b58;_0x6d71e3[_0x906a('0x41')]=_[_0x906a('0x57')](db['FaxApplication'][_0x906a('0x67')]);_0x6d71e3[_0x906a('0x42')]=_[_0x906a('0x57')](_0x4fcd64['query']);_0x6d71e3[_0x906a('0x43')]=_['intersection'](_0x6d71e3[_0x906a('0x41')],_0x6d71e3[_0x906a('0x42')]);_0x25e522['attributes']=_['intersection'](_0x6d71e3[_0x906a('0x41')],qs[_0x906a('0x46')](_0x4fcd64[_0x906a('0x42')][_0x906a('0x46')]));_0x25e522[_0x906a('0x45')]=_0x25e522[_0x906a('0x45')][_0x906a('0x47')]?_0x25e522[_0x906a('0x45')]:_0x6d71e3[_0x906a('0x41')];_0x25e522[_0x906a('0x68')]=qs['sort'](_0x4fcd64['query']['sort']);_0x25e522[_0x906a('0x4b')]=qs[_0x906a('0x43')](_[_0x906a('0x6e')](_0x4fcd64[_0x906a('0x42')],_0x6d71e3[_0x906a('0x43')]));if(_0x4fcd64['query'][_0x906a('0x4c')]){_0x25e522[_0x906a('0x4b')]=_[_0x906a('0x4d')](_0x25e522[_0x906a('0x4b')],{'$or':_['map'](_0x25e522[_0x906a('0x45')],function(_0x4f3c6b){var _0x11b411={};_0x11b411[_0x4f3c6b]={'$like':'%'+_0x4fcd64[_0x906a('0x42')][_0x906a('0x4c')]+'%'};return _0x11b411;})});}_0x25e522=_[_0x906a('0x4d')]({},_0x25e522,_0x4fcd64[_0x906a('0x4f')]);return _0x2e57bd[_0x906a('0x83')](_0x25e522);}})[_0x906a('0x36')](function(_0x516fef){if(_0x516fef){_0x37223c=_0x516fef[_0x906a('0x47')];if(!_0x4fcd64[_0x906a('0x42')][_0x906a('0x48')](_0x906a('0x49'))){_0x25e522[_0x906a('0x2f')]=qs[_0x906a('0x2f')](_0x4fcd64[_0x906a('0x42')][_0x906a('0x2f')]);_0x25e522[_0x906a('0x2d')]=qs[_0x906a('0x2d')](_0x4fcd64['query'][_0x906a('0x2d')]);}return _0x2e57bd['getApplications'](_0x25e522);}})[_0x906a('0x36')](function(_0x588c1d){if(_0x588c1d){return _0x588c1d?{'count':_0x37223c,'rows':_0x588c1d}:null;}})['then'](respondWithResult(_0x2096e8,null))['catch'](handleError(_0x2096e8,null));};function Extension(_0x225589,_0x2cde28,_0x39e288,_0x109c1f){this[_0x906a('0x84')]=_0x906a('0x85');this[_0x906a('0x86')]=_0x225589[_0x906a('0x87')];this[_0x906a('0x88')]=_0x109c1f;this['type']=_0x906a('0x89');this[_0x906a('0x8a')]=_0x906a('0x8b');this[_0x906a('0x69')]=_0x225589['id'];this[_0x906a('0x80')]=_0x2cde28;this['appdata']=_0x39e288;}function createExtensionsReciveFax(_0x28a66e){var _0x43a4b9=0x1;var _0x3d5742=[];_0x3d5742['push'](new Extension(_0x28a66e,_0x43a4b9,'',_0x906a('0x8c')));_0x43a4b9+=0x1;_0x3d5742[_0x906a('0x8d')](new Extension(_0x28a66e,_0x43a4b9,_0x906a('0x8e'),_0x906a('0x8f')));_0x43a4b9+=0x1;for(var _0x451eac in _0x28a66e){if(_0x28a66e[_0x906a('0x48')](_0x451eac)&&(_0x451eac===_0x906a('0x90')||_0x451eac===_0x906a('0x87')||_0x451eac===_0x906a('0x91')||_0x451eac===_0x906a('0x92')||_0x451eac===_0x906a('0x93')||_0x451eac===_0x906a('0x94')||_0x451eac===_0x906a('0x95')||_0x451eac==='modem'||_0x451eac===_0x906a('0x96'))){_0x3d5742['push'](new Extension(_0x28a66e,_0x43a4b9,_0x906a('0x97')+_0x451eac+')='+_0x28a66e[_0x451eac],_0x906a('0x8f')));_0x43a4b9+=0x1;}}_0x3d5742[_0x906a('0x8d')](new Extension(_0x28a66e,_0x43a4b9,'6',_0x906a('0x98')));_0x43a4b9+=0x1;_0x3d5742['push'](new Extension(_0x28a66e,_0x43a4b9,'/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',_0x906a('0x99')));_0x43a4b9=0x0;return _0x3d5742;}exports['addAccountApplications']=function(_0x2ec40a,_0x27b114,_0xdf4f9e){var _0x3149ca;return db[_0x906a('0x9a')][_0x906a('0x9b')](function(_0x44212b){return db[_0x906a('0x50')][_0x906a('0x59')](_0x2ec40a[_0x906a('0x5a')],{'transaction':_0x44212b})[_0x906a('0x36')](function(_0x4fb5b8){_0x3149ca=_0x4fb5b8[_0x906a('0x37')]({'plain':!![]});return db[_0x906a('0x9c')][_0x906a('0x9d')](createExtensionsReciveFax(_0x3149ca),{'transaction':_0x44212b});});})[_0x906a('0x36')](function(){return _0x3149ca;})[_0x906a('0x36')](respondWithResult(_0x27b114,null))[_0x906a('0x29')](handleError(_0x27b114,null));};exports['updateAccountApplications']=function(_0x4132db,_0x3c92c7,_0x2126c4){var _0x2d4537;return db[_0x906a('0x9a')]['transaction'](function(_0x486a17){return db['FaxAccount'][_0x906a('0x35')](_0x4132db[_0x906a('0x5a')],{'where':{'id':_0x4132db[_0x906a('0x5a')]['id']},'transaction':_0x486a17})[_0x906a('0x36')](function(_0x48fea9){return db[_0x906a('0x9c')]['destroy']({'where':{'FaxAccountId':_0x4132db['body']['id']},'transaction':_0x486a17})[_0x906a('0x36')](function(_0x4b1586){return db[_0x906a('0x9c')][_0x906a('0x9d')](createExtensionsReciveFax(_['omit'](_0x4132db[_0x906a('0x5a')],[_0x906a('0x9e'),'key',_0x906a('0x9f'),'updatedAt',_0x906a('0xa0'),'ListId'])),{'transaction':_0x486a17});});});})[_0x906a('0x36')](function(){return db[_0x906a('0x50')][_0x906a('0xa1')](_0x4132db[_0x906a('0x5a')]['id']);})[_0x906a('0x36')](respondWithResult(_0x3c92c7,null))[_0x906a('0x29')](handleError(_0x3c92c7,null));};exports[_0x906a('0xa2')]=function(_0x592b6a,_0x248ffb,_0x6524bf){var _0x2e75d8={'raw':!![],'where':{}};var _0x246e8c={};var _0xb4b5fa={'count':0x0,'rows':[]};return db[_0x906a('0x50')][_0x906a('0x66')]({'where':{'id':_0x592b6a['params']['id']}})[_0x906a('0x36')](handleEntityNotFound(_0x248ffb,null))['then'](function(_0x18698a){if(_0x18698a){_0x246e8c[_0x906a('0x41')]=_[_0x906a('0x57')](db['FaxMessage']['rawAttributes']);_0x246e8c['query']=_[_0x906a('0x57')](_0x592b6a[_0x906a('0x42')]);_0x246e8c[_0x906a('0x43')]=_[_0x906a('0x44')](_0x246e8c['model'],_0x246e8c['query']);_0x2e75d8[_0x906a('0x45')]=_[_0x906a('0x44')](_0x246e8c[_0x906a('0x41')],qs[_0x906a('0x46')](_0x592b6a['query']['fields']));_0x2e75d8[_0x906a('0x45')]=_0x2e75d8[_0x906a('0x45')][_0x906a('0x47')]?_0x2e75d8[_0x906a('0x45')]:_0x246e8c[_0x906a('0x41')];if(!_0x592b6a[_0x906a('0x42')][_0x906a('0x48')](_0x906a('0x49'))){_0x2e75d8[_0x906a('0x2f')]=qs[_0x906a('0x2f')](_0x592b6a[_0x906a('0x42')][_0x906a('0x2f')]);_0x2e75d8[_0x906a('0x2d')]=qs[_0x906a('0x2d')](_0x592b6a[_0x906a('0x42')][_0x906a('0x2d')]);}_0x2e75d8['order']=qs[_0x906a('0x4a')](_0x592b6a[_0x906a('0x42')][_0x906a('0x4a')]);_0x2e75d8[_0x906a('0x4b')]=qs[_0x906a('0x43')](_[_0x906a('0x6e')](_0x592b6a[_0x906a('0x42')],_0x246e8c[_0x906a('0x43')]));_0x2e75d8[_0x906a('0x4b')][_0x906a('0x69')]=_0x18698a['id'];if(_0x592b6a['query'][_0x906a('0x4c')]){_0x2e75d8[_0x906a('0x4b')]=_[_0x906a('0x4d')](_0x2e75d8['where'],{'$or':_['map'](_0x2e75d8[_0x906a('0x45')],function(_0x3b4364){var _0x5d2e94={};_0x5d2e94[_0x3b4364]={'$like':'%'+_0x592b6a[_0x906a('0x42')][_0x906a('0x4c')]+'%'};return _0x5d2e94;})});}if(_0x592b6a['query'][_0x906a('0xa3')]){var _0x33b381=_0x592b6a[_0x906a('0x42')]['$gte'][_0x906a('0xa4')](',');var _0x43d6fc={};_0x43d6fc[_0x33b381[0x0]]={'$gte':moment(_0x33b381[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x2e75d8[_0x906a('0x4b')]=_[_0x906a('0x4d')](_0x2e75d8[_0x906a('0x4b')],_0x43d6fc);}_0x2e75d8=_[_0x906a('0x4d')]({},_0x2e75d8,_0x592b6a['options']);return db[_0x906a('0xa5')][_0x906a('0x30')]({'where':_0x2e75d8['where']})[_0x906a('0x36')](function(_0x316021){_0xb4b5fa[_0x906a('0x30')]=_0x316021;if(_0x592b6a[_0x906a('0x42')][_0x906a('0x51')]){_0x2e75d8[_0x906a('0x52')]=[{'all':!![]}];}return db['FaxMessage'][_0x906a('0x53')](_0x2e75d8);})['then'](function(_0x5edd45){_0xb4b5fa[_0x906a('0x54')]=_0x5edd45;return _0xb4b5fa;});}})[_0x906a('0x36')](respondWithFilteredResult(_0x248ffb,_0x2e75d8))[_0x906a('0x29')](handleError(_0x248ffb,null));};exports[_0x906a('0x3c')]=function(_0x2433a5,_0x3633e1,_0x5d09a6){var _0x52bdad,_0x2921dc={},_0x35a1ef;if(_0x2433a5[_0x906a('0x5a')]['to']){_0x35a1ef=_0x2433a5[_0x906a('0x5a')]['to'][0x0];}return db[_0x906a('0x50')][_0x906a('0x58')]({'where':{'id':_0x2433a5[_0x906a('0x56')]['id']},'include':[{'model':db[_0x906a('0xa6')],'as':_0x906a('0xa7'),'include':[{'model':db[_0x906a('0x74')],'as':_0x906a('0xa8'),'where':{'fax':_0x35a1ef},'limit':0x1,'order':[[_0x906a('0xa9'),'DESC']]}]}]})[_0x906a('0x36')](handleEntityNotFound(_0x3633e1,null))['then'](function(_0x173c74){_0x52bdad=_0x173c74;if(_0x2433a5[_0x906a('0x5a')]['attachments']&&_0x2433a5[_0x906a('0x5a')]['attachments']['length']){for(var _0x25150b=0x0;_0x25150b<_0x2433a5[_0x906a('0x5a')]['attachments'][_0x906a('0x47')];_0x25150b+=0x1){_0x2433a5[_0x906a('0x5a')][_0x906a('0xaa')][_0x25150b]={'filename':_0x2433a5[_0x906a('0x5a')][_0x906a('0xaa')][_0x25150b][_0x906a('0x3b')],'id':_0x2433a5['body'][_0x906a('0xaa')][_0x25150b]['id'],'path':path[_0x906a('0xab')](config['root'],_0x906a('0xac'),_0x2433a5[_0x906a('0x5a')][_0x906a('0xaa')][_0x25150b]['basename'])};}}return respondWithRpcPromise(_0x906a('0xad'),_0x906a('0xad'),{'FaxAccountId':_[_0x906a('0xae')](_0x2433a5['params']['id'])?undefined:_0x2433a5[_0x906a('0x56')]['id'],'path':_[_0x906a('0xae')](_0x2433a5[_0x906a('0x5a')][_0x906a('0xaa')][0x0][_0x906a('0x6')])?undefined:_0x2433a5[_0x906a('0x5a')]['attachments'][0x0][_0x906a('0x6')],'fax':_[_0x906a('0xae')](_0x2433a5[_0x906a('0x5a')]['to'][0x0])?undefined:_0x2433a5[_0x906a('0x5a')]['to'][0x0]},client9002);})[_0x906a('0x36')](function(){if(_0x52bdad){if(_['isNil'](_0x2433a5['body'][_0x906a('0xaf')])){_0x2433a5[_0x906a('0x5a')][_0x906a('0xaf')]=util[_0x906a('0xb0')]('\x22%s\x22\x20<%s>',_0x52bdad[_0x906a('0x3b')],_0x52bdad[_0x906a('0xb1')]);}if(_0x52bdad[_0x906a('0xa7')]){if(_0x52bdad[_0x906a('0xa7')][_0x906a('0xa8')]['length']){return _0x52bdad[_0x906a('0xa7')][_0x906a('0xa8')][0x0];}else{return db[_0x906a('0x74')][_0x906a('0x59')](_[_0x906a('0x18')](_0x2433a5['body'],{'firstName':_0x2433a5[_0x906a('0x5a')]['to'][0x0],'phone':_0x2433a5[_0x906a('0x5a')]['to'][0x0],'fax':_0x2433a5[_0x906a('0x5a')]['to'][0x0],'ListId':_0x52bdad[_0x906a('0xb2')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0x906a('0xb3'));}})[_0x906a('0x36')](function(_0x217744){if(_0x217744){return db[_0x906a('0x72')]['find']({'where':{'ContactId':_0x217744['id'],'closed':![],'FaxAccountId':_0x52bdad['id']}})[_0x906a('0x36')](function(_0x58281d){if(_0x58281d){return[_0x58281d,![]];}return db[_0x906a('0x72')][_0x906a('0x59')]({'UserId':_0x2433a5[_0x906a('0x5b')]['id'],'ContactId':_0x217744['id'],'FaxAccountId':_0x52bdad['id'],'fax':_0x2433a5[_0x906a('0x5a')]['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0x906a('0x4d')](_0x2433a5[_0x906a('0x5a')],{'read':![],'body':_0x2433a5[_0x906a('0x5a')][_0x906a('0xaa')][0x0][_0x906a('0xb4')],'FaxAccountId':_0x52bdad['id'],'UserId':_0x2433a5[_0x906a('0x5b')]['id'],'ContactId':_0x217744['id'],'AttachmentId':_0x2433a5[_0x906a('0x5a')][_0x906a('0xaa')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0x906a('0xb5')}]})[_0x906a('0x36')](function(_0x2c21d0){return[_0x2c21d0,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})['spread'](function(_0x152fcb,_0x558643){if(_0x558643){return _0x152fcb;}return db['FaxMessage'][_0x906a('0x59')]({'direction':_0x906a('0xb6'),'read':![],'body':_0x2433a5[_0x906a('0x5a')][_0x906a('0xaa')][0x0][_0x906a('0xb4')],'FaxAccountId':_0x52bdad['id'],'FaxInteractionId':_0x152fcb['id'],'UserId':_0x2433a5[_0x906a('0x5b')]['id'],'ContactId':_0x152fcb[_0x906a('0xb7')],'AttachmentId':_0x2433a5[_0x906a('0x5a')][_0x906a('0xaa')][0x0]['id']})['then'](function(_0x54ecac){_0x152fcb[_0x906a('0xb8')][_0x906a('0xb5')]=[];_0x152fcb['dataValues'][_0x906a('0xb5')][_0x906a('0x8d')](_0x54ecac[_0x906a('0xb8')]);return _0x152fcb;});})[_0x906a('0x36')](function(_0x34a0ed){respondWithRpcPromise(_0x906a('0xb9'),_0x906a('0xb9'),{'FaxAccountId':_[_0x906a('0xae')](_0x2433a5[_0x906a('0x56')]['id'])?undefined:_0x2433a5[_0x906a('0x56')]['id'],'path':_[_0x906a('0xae')](_0x2433a5[_0x906a('0x5a')][_0x906a('0xaa')][0x0][_0x906a('0x6')])?undefined:_0x2433a5[_0x906a('0x5a')][_0x906a('0xaa')][0x0][_0x906a('0x6')],'fax':_['isNil'](_0x2433a5[_0x906a('0x5a')]['to'][0x0])?undefined:_0x2433a5[_0x906a('0x5a')]['to'][0x0],'AttachmentId':_0x2433a5[_0x906a('0x5a')][_0x906a('0xaa')][0x0]['id']},client9002)[_0x906a('0x36')](function(_0x523cd1){logger[_0x906a('0x28')](_0x906a('0xba'),_0x523cd1);})[_0x906a('0x29')](function(_0x320593){logger['info'](_0x906a('0xba'),_0x320593);});return _0x34a0ed;})[_0x906a('0x36')](respondWithResult(_0x3633e1,null))[_0x906a('0x29')](handleError(_0x3633e1,null));};exports[_0x906a('0xbb')]=function(_0x1313ed,_0x27aa34,_0x26289b){return db['FaxAccount']['find']({'where':{'id':_0x1313ed['params']['id']}})[_0x906a('0x36')](handleEntityNotFound(_0x27aa34,null))[_0x906a('0x36')](function(_0x2638af){if(_0x2638af){return _0x2638af['addAgents'](_0x1313ed[_0x906a('0x5a')][_0x906a('0x70')],_[_0x906a('0xbc')](_0x1313ed[_0x906a('0x5a')],[_0x906a('0x70'),'id'])||{})[_0x906a('0xbd')](function(_0x453059){for(var _0x28c7f4=0x0;_0x28c7f4<_0x1313ed[_0x906a('0x5a')]['ids']['length'];_0x28c7f4+=0x1){socket[_0x906a('0xbe')](_0x906a('0xbf'),{'UserId':Number(_0x1313ed[_0x906a('0x5a')][_0x906a('0x70')][_0x28c7f4]),'FaxAccountId':Number(_0x1313ed[_0x906a('0x56')]['id'])});}return _0x453059;});}})[_0x906a('0x36')](respondWithResult(_0x27aa34,null))[_0x906a('0x29')](handleError(_0x27aa34,null));};exports[_0x906a('0xc0')]=function(_0x15dbd0,_0x1ece3f,_0x57c20f){return db[_0x906a('0x50')][_0x906a('0x58')]({'where':{'id':_0x15dbd0[_0x906a('0x56')]['id']}})[_0x906a('0x36')](handleEntityNotFound(_0x1ece3f,null))[_0x906a('0x36')](function(_0xbaf1f6){if(_0xbaf1f6){return _0xbaf1f6[_0x906a('0xc0')](_0x15dbd0[_0x906a('0x42')][_0x906a('0x70')])['then'](function(){if(_[_0x906a('0xc1')](_0x15dbd0[_0x906a('0x42')]['ids'])){for(var _0x16cb48=0x0;_0x16cb48<_0x15dbd0['query'][_0x906a('0x70')]['length'];_0x16cb48+=0x1){socket['emit'](_0x906a('0xc2'),{'UserId':Number(_0x15dbd0[_0x906a('0x42')][_0x906a('0x70')][_0x16cb48]),'FaxAccountId':Number(_0x15dbd0['params']['id'])});}}else{socket[_0x906a('0xbe')](_0x906a('0xc2'),{'UserId':Number(_0x15dbd0[_0x906a('0x42')][_0x906a('0x70')]),'FaxAccountId':Number(_0x15dbd0['params']['id'])});}});}})['then'](respondWithStatusCode(_0x1ece3f,null))['catch'](handleError(_0x1ece3f,null));};exports[_0x906a('0xc3')]=function(_0x459541,_0x38cbbd,_0xd824a3){var _0x42cb39={};var _0x17a7e9={};var _0x370767;var _0x162979;return db[_0x906a('0x50')][_0x906a('0x66')]({'where':{'id':_0x459541[_0x906a('0x56')]['id']}})['then'](handleEntityNotFound(_0x38cbbd,null))[_0x906a('0x36')](function(_0x4f85df){if(_0x4f85df){_0x370767=_0x4f85df;_0x17a7e9[_0x906a('0x41')]=_[_0x906a('0x57')](db[_0x906a('0xc4')][_0x906a('0x67')]);_0x17a7e9[_0x906a('0x42')]=_[_0x906a('0x57')](_0x459541[_0x906a('0x42')]);_0x17a7e9['filters']=_[_0x906a('0x44')](_0x17a7e9[_0x906a('0x41')],_0x17a7e9['query']);_0x42cb39[_0x906a('0x45')]=_['intersection'](_0x17a7e9[_0x906a('0x41')],qs[_0x906a('0x46')](_0x459541[_0x906a('0x42')][_0x906a('0x46')]));_0x42cb39['attributes']=_0x42cb39['attributes']['length']?_0x42cb39[_0x906a('0x45')]:_0x17a7e9[_0x906a('0x41')];_0x42cb39['order']=qs['sort'](_0x459541[_0x906a('0x42')][_0x906a('0x4a')]);_0x42cb39[_0x906a('0x4b')]=qs[_0x906a('0x43')](_['pick'](_0x459541[_0x906a('0x42')],_0x17a7e9['filters']));if(_0x459541[_0x906a('0x42')][_0x906a('0x4c')]){_0x42cb39['where']=_[_0x906a('0x4d')](_0x42cb39['where'],{'$or':_[_0x906a('0x4e')](_0x42cb39['attributes'],function(_0x3191db){var _0xd5c929={};_0xd5c929[_0x3191db]={'$like':'%'+_0x459541[_0x906a('0x42')][_0x906a('0x4c')]+'%'};return _0xd5c929;})});}_0x42cb39=_[_0x906a('0x4d')]({},_0x42cb39,_0x459541['options']);return _0x370767['getAgents'](_0x42cb39);}})[_0x906a('0x36')](function(_0x34214c){if(_0x34214c){_0x162979=_0x34214c[_0x906a('0x47')];if(!_0x459541[_0x906a('0x42')]['hasOwnProperty'](_0x906a('0x49'))){_0x42cb39[_0x906a('0x2f')]=qs[_0x906a('0x2f')](_0x459541[_0x906a('0x42')][_0x906a('0x2f')]);_0x42cb39[_0x906a('0x2d')]=qs[_0x906a('0x2d')](_0x459541['query'][_0x906a('0x2d')]);}return _0x370767[_0x906a('0xc3')](_0x42cb39);}})[_0x906a('0x36')](function(_0x8fdf5c){if(_0x8fdf5c){return _0x8fdf5c?{'count':_0x162979,'rows':_0x8fdf5c}:null;}})[_0x906a('0x36')](respondWithResult(_0x38cbbd,null))[_0x906a('0x29')](handleError(_0x38cbbd,null));}; \ No newline at end of file +var _0x5d9f=['out','filename','Contact\x20not\x20found','ContactId','Messages','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','spread','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','emit','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','./faxAccount.socket','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','destroy','get','sendStatus','stack','name','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','keys','query','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','FaxAccount','includeAll','findAll','intersection','include','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','FaxAccounts','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','FaxAccountId','Disposition','findOne','rows','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','nolimit','CmContact','Contact','User','Owner','Tags','tag','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','priority','finally','send','getApplications','from-voip-provider','app','system','description','Fax\x20Extension','appdata','push','Answer','Set','ecm','localstationid','gateway','faxdetect','minrate','t38timeout','Wait','ReceiveFax','addAccountApplications','VoiceExtension','updateAccountApplications','tech','createdAt','updatedAt','TrunkId','findById','getMessages','format','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','CmList','List','attachments','join','root','server/files/attachments','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','Contacts','Send\x20Fax\x20failed'];(function(_0x528097,_0x348b8f){var _0x541f4e=function(_0x3ce767){while(--_0x3ce767){_0x528097['push'](_0x528097['shift']());}};_0x541f4e(++_0x348b8f);}(_0x5d9f,0x188));var _0xf5d9=function(_0x5eb1f8,_0x4f7298){_0x5eb1f8=_0x5eb1f8-0x0;var _0xd68907=_0x5d9f[_0x5eb1f8];return _0xd68907;};'use strict';var emlformat=require(_0xf5d9('0x0'));var rimraf=require(_0xf5d9('0x1'));var zipdir=require(_0xf5d9('0x2'));var jsonpatch=require(_0xf5d9('0x3'));var rp=require(_0xf5d9('0x4'));var moment=require(_0xf5d9('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf5d9('0x6'));var path=require(_0xf5d9('0x7'));var sox=require(_0xf5d9('0x8'));var csv=require(_0xf5d9('0x9'));var ejs=require(_0xf5d9('0xa'));var fs=require('fs');var fs_extra=require(_0xf5d9('0xb'));var _=require(_0xf5d9('0xc'));var squel=require('squel');var crypto=require(_0xf5d9('0xd'));var jsforce=require(_0xf5d9('0xe'));var deskjs=require(_0xf5d9('0xf'));var toCsv=require(_0xf5d9('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf5d9('0x10'));var as=require(_0xf5d9('0x11'));var hardwareService=require(_0xf5d9('0x12'));var logger=require(_0xf5d9('0x13'))(_0xf5d9('0x14'));var utils=require(_0xf5d9('0x15'));var config=require(_0xf5d9('0x16'));var licenseUtil=require(_0xf5d9('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xf5d9('0x18')](config[_0xf5d9('0x19')],{'host':_0xf5d9('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf5d9('0x19')]));require(_0xf5d9('0x1b'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xf5d9('0x1c')][_0xf5d9('0x1d')]({'port':0x232c});var client9002=jayson['client'][_0xf5d9('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x4b84f5,_0x299e5c,_0x172fc7,_0x1d83a0){return new BPromise(function(_0x516c43,_0x39a982){var _0xa64106=_0x1d83a0||client;return _0xa64106[_0xf5d9('0x1e')](_0x4b84f5,_0x172fc7)[_0xf5d9('0x1f')](function(_0xcde7d0){logger[_0xf5d9('0x20')](_0xf5d9('0x21'),_0x299e5c,_0xf5d9('0x22'));logger[_0xf5d9('0x23')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x299e5c,'request\x20sent',JSON[_0xf5d9('0x24')](_0xcde7d0));if(_0xcde7d0[_0xf5d9('0x25')]){if(_0xcde7d0['error']['code']===0x1f4){logger[_0xf5d9('0x25')](_0xf5d9('0x21'),_0x299e5c,_0xcde7d0['error']['message']);return _0x39a982(_0xcde7d0[_0xf5d9('0x25')][_0xf5d9('0x26')]);}logger[_0xf5d9('0x25')](_0xf5d9('0x21'),_0x299e5c,_0xcde7d0[_0xf5d9('0x25')][_0xf5d9('0x26')]);return _0x516c43(_0xcde7d0[_0xf5d9('0x25')]['message']);}else{logger['info'](_0xf5d9('0x21'),_0x299e5c,_0xf5d9('0x22'));_0x516c43(_0xcde7d0[_0xf5d9('0x27')][_0xf5d9('0x26')]);}})[_0xf5d9('0x28')](function(_0x326885){logger[_0xf5d9('0x25')](_0xf5d9('0x21'),_0x299e5c,_0x326885);_0x39a982(_0x326885);});});}function respondWithStatusCode(_0x66c9ff,_0x51ef65){_0x51ef65=_0x51ef65||0xcc;return function(_0x489c09){if(_0x489c09){return _0x66c9ff['sendStatus'](_0x51ef65);}return _0x66c9ff[_0xf5d9('0x29')](_0x51ef65)[_0xf5d9('0x2a')]();};}function respondWithResult(_0x20a840,_0x29334c){_0x29334c=_0x29334c||0xc8;return function(_0x3c753f){if(_0x3c753f){return _0x20a840['status'](_0x29334c)[_0xf5d9('0x2b')](_0x3c753f);}};}function respondWithFilteredResult(_0x3a7c48,_0x23f1b6){return function(_0x2a0ba5){if(_0x2a0ba5){var _0x15c63a=typeof _0x23f1b6[_0xf5d9('0x2c')]===_0xf5d9('0x2d')&&typeof _0x23f1b6['limit']===_0xf5d9('0x2d');var _0x1fea0d=_0x2a0ba5[_0xf5d9('0x2e')];var _0x2156af=_0x15c63a?0x0:_0x23f1b6[_0xf5d9('0x2c')];var _0x30657d=_0x15c63a?_0x2a0ba5[_0xf5d9('0x2e')]:_0x23f1b6[_0xf5d9('0x2c')]+_0x23f1b6['limit'];var _0x87b1e0;if(_0x30657d>=_0x1fea0d){_0x30657d=_0x1fea0d;_0x87b1e0=0xc8;}else{_0x87b1e0=0xce;}_0x3a7c48[_0xf5d9('0x29')](_0x87b1e0);return _0x3a7c48[_0xf5d9('0x2f')](_0xf5d9('0x30'),_0x2156af+'-'+_0x30657d+'/'+_0x1fea0d)['json'](_0x2a0ba5);}return null;};}function patchUpdates(_0x1f72eb){return function(_0x5ae98c){try{jsonpatch[_0xf5d9('0x31')](_0x5ae98c,_0x1f72eb,!![]);}catch(_0x3a68ff){return BPromise[_0xf5d9('0x32')](_0x3a68ff);}return _0x5ae98c[_0xf5d9('0x33')]();};}function saveUpdates(_0xed08d9,_0x132fa4){return function(_0x2c32cd){if(_0x2c32cd){return _0x2c32cd[_0xf5d9('0x34')](_0xed08d9)[_0xf5d9('0x1f')](function(_0x502a35){return _0x502a35;});}return null;};}function removeEntity(_0x5e0c02,_0x2e1fe1){return function(_0x426fd8){if(_0x426fd8){return _0x426fd8[_0xf5d9('0x35')]()['then'](function(){var _0x1dba50=_0x426fd8[_0xf5d9('0x36')]({'plain':!![]});var _0x209776='FaxAccounts';return db['UserProfileResource'][_0xf5d9('0x35')]({'where':{'type':_0x209776,'resourceId':_0x1dba50['id']}})[_0xf5d9('0x1f')](function(){return _0x426fd8;});})[_0xf5d9('0x1f')](function(){_0x5e0c02[_0xf5d9('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x13df7d,_0x5c401a){return function(_0x1e3dc5){if(!_0x1e3dc5){_0x13df7d[_0xf5d9('0x37')](0x194);}return _0x1e3dc5;};}function handleError(_0x4adb2c,_0xa4b58d){_0xa4b58d=_0xa4b58d||0x1f4;return function(_0x170519){logger[_0xf5d9('0x25')](_0x170519[_0xf5d9('0x38')]);if(_0x170519[_0xf5d9('0x39')]){delete _0x170519[_0xf5d9('0x39')];}_0x4adb2c[_0xf5d9('0x29')](_0xa4b58d)['send'](_0x170519);};}exports['index']=function(_0x4fdb32,_0x41a263){var _0x237d84={'include':[{'model':db[_0xf5d9('0x3a')],'as':_0xf5d9('0x3b')}]},_0x3bb096={},_0x5f16e8={'count':0x0,'rows':[]};var _0x5e5ed6=_[_0xf5d9('0x3c')](db['FaxAccount'][_0xf5d9('0x3d')],function(_0x5d8a0f){return{'name':_0x5d8a0f[_0xf5d9('0x3e')],'type':_0x5d8a0f[_0xf5d9('0x3f')][_0xf5d9('0x40')]};});_0x3bb096[_0xf5d9('0x41')]=_['map'](_0x5e5ed6,_0xf5d9('0x39'));_0x3bb096['query']=_[_0xf5d9('0x42')](_0x4fdb32[_0xf5d9('0x43')]);_0x3bb096['filters']=_['intersection'](_0x3bb096['model'],_0x3bb096['query']);_0x237d84[_0xf5d9('0x44')]=_['intersection'](_0x3bb096[_0xf5d9('0x41')],qs[_0xf5d9('0x45')](_0x4fdb32[_0xf5d9('0x43')][_0xf5d9('0x45')]));_0x237d84[_0xf5d9('0x44')]=_0x237d84['attributes'][_0xf5d9('0x46')]?_0x237d84[_0xf5d9('0x44')]:_0x3bb096[_0xf5d9('0x41')];if(!_0x4fdb32[_0xf5d9('0x43')][_0xf5d9('0x47')]('nolimit')){_0x237d84[_0xf5d9('0x48')]=qs[_0xf5d9('0x48')](_0x4fdb32[_0xf5d9('0x43')][_0xf5d9('0x48')]);_0x237d84[_0xf5d9('0x2c')]=qs[_0xf5d9('0x2c')](_0x4fdb32[_0xf5d9('0x43')][_0xf5d9('0x2c')]);}_0x237d84[_0xf5d9('0x49')]=qs[_0xf5d9('0x4a')](_0x4fdb32[_0xf5d9('0x43')][_0xf5d9('0x4a')]);_0x237d84[_0xf5d9('0x4b')]=qs[_0xf5d9('0x4c')](_[_0xf5d9('0x4d')](_0x4fdb32['query'],_0x3bb096[_0xf5d9('0x4c')]),_0x5e5ed6);if(_0x4fdb32[_0xf5d9('0x43')][_0xf5d9('0x4e')]){_0x237d84[_0xf5d9('0x4b')]=_[_0xf5d9('0x4f')](_0x237d84['where'],{'$or':_[_0xf5d9('0x3c')](_0x5e5ed6,function(_0x44c296){if(_0x44c296[_0xf5d9('0x3f')]!==_0xf5d9('0x50')){var _0x2c5520={};_0x2c5520[_0x44c296[_0xf5d9('0x39')]]={'$like':'%'+_0x4fdb32[_0xf5d9('0x43')][_0xf5d9('0x4e')]+'%'};return _0x2c5520;}})});}_0x237d84=_[_0xf5d9('0x4f')]({},_0x237d84,_0x4fdb32['options']);var _0x3b2e84={'where':_0x237d84[_0xf5d9('0x4b')]};return db[_0xf5d9('0x51')][_0xf5d9('0x2e')](_0x3b2e84)[_0xf5d9('0x1f')](function(_0xfc062b){_0x5f16e8[_0xf5d9('0x2e')]=_0xfc062b;if(_0x4fdb32['query'][_0xf5d9('0x52')]){_0x237d84['include']=[{'all':!![]}];}return db[_0xf5d9('0x51')][_0xf5d9('0x53')](_0x237d84);})[_0xf5d9('0x1f')](function(_0x1c8836){_0x5f16e8['rows']=_0x1c8836;return _0x5f16e8;})[_0xf5d9('0x1f')](respondWithFilteredResult(_0x41a263,_0x237d84))[_0xf5d9('0x28')](handleError(_0x41a263,null));};exports['show']=function(_0x18598d,_0x54e0d1){var _0x2d8990={'raw':![],'where':{'id':_0x18598d['params']['id']},'include':[{'model':db['Pause'],'as':_0xf5d9('0x3b')}]},_0x3b133b={};_0x3b133b[_0xf5d9('0x41')]=_['keys'](db[_0xf5d9('0x51')]['rawAttributes']);_0x3b133b[_0xf5d9('0x43')]=_[_0xf5d9('0x42')](_0x18598d['query']);_0x3b133b[_0xf5d9('0x4c')]=_[_0xf5d9('0x54')](_0x3b133b[_0xf5d9('0x41')],_0x3b133b[_0xf5d9('0x43')]);_0x2d8990[_0xf5d9('0x44')]=_[_0xf5d9('0x54')](_0x3b133b['model'],qs[_0xf5d9('0x45')](_0x18598d[_0xf5d9('0x43')]['fields']));_0x2d8990['attributes']=_0x2d8990['attributes'][_0xf5d9('0x46')]?_0x2d8990[_0xf5d9('0x44')]:_0x3b133b[_0xf5d9('0x41')];if(_0x18598d[_0xf5d9('0x43')][_0xf5d9('0x52')]){_0x2d8990[_0xf5d9('0x55')]=[{'all':!![]}];}_0x2d8990=_[_0xf5d9('0x4f')]({},_0x2d8990,_0x18598d[_0xf5d9('0x56')]);return db[_0xf5d9('0x51')][_0xf5d9('0x57')](_0x2d8990)[_0xf5d9('0x1f')](handleEntityNotFound(_0x54e0d1,null))['then'](respondWithResult(_0x54e0d1,null))[_0xf5d9('0x28')](handleError(_0x54e0d1,null));};exports[_0xf5d9('0x58')]=function(_0x44a5d7,_0x446fa0){return db[_0xf5d9('0x51')]['create'](_0x44a5d7[_0xf5d9('0x59')],{})[_0xf5d9('0x1f')](function(_0x3321de){var _0x7c405c=_0x44a5d7['user'][_0xf5d9('0x36')]({'plain':!![]});if(!_0x7c405c)throw new Error(_0xf5d9('0x5a'));if(_0x7c405c[_0xf5d9('0x5b')]===_0xf5d9('0x5c')){var _0x14c7b2=_0x3321de[_0xf5d9('0x36')]({'plain':!![]});var _0x4e9782=_0xf5d9('0x5d');return db[_0xf5d9('0x5e')][_0xf5d9('0x57')]({'where':{'name':_0x4e9782,'userProfileId':_0x7c405c[_0xf5d9('0x5f')]},'raw':!![]})[_0xf5d9('0x1f')](function(_0x1abbbf){if(_0x1abbbf&&_0x1abbbf['autoAssociation']===0x0){return db['UserProfileResource'][_0xf5d9('0x58')]({'name':_0x14c7b2[_0xf5d9('0x39')],'resourceId':_0x14c7b2['id'],'type':_0x1abbbf[_0xf5d9('0x39')],'sectionId':_0x1abbbf['id']},{})['then'](function(){return _0x3321de;});}else{return _0x3321de;}})[_0xf5d9('0x28')](function(_0x50d2d9){logger[_0xf5d9('0x25')](_0xf5d9('0x60'),_0x50d2d9);throw _0x50d2d9;});}return _0x3321de;})[_0xf5d9('0x1f')](respondWithResult(_0x446fa0,0xc9))[_0xf5d9('0x28')](handleError(_0x446fa0,null));};exports[_0xf5d9('0x34')]=function(_0x39b07a,_0x438d88){if(_0x39b07a[_0xf5d9('0x59')]['id']){delete _0x39b07a[_0xf5d9('0x59')]['id'];}return db['FaxAccount'][_0xf5d9('0x57')]({'where':{'id':_0x39b07a['params']['id']},'include':[{'model':db['Pause'],'as':_0xf5d9('0x3b')}]})[_0xf5d9('0x1f')](handleEntityNotFound(_0x438d88,null))[_0xf5d9('0x1f')](saveUpdates(_0x39b07a[_0xf5d9('0x59')],null))[_0xf5d9('0x1f')](respondWithResult(_0x438d88,null))[_0xf5d9('0x28')](handleError(_0x438d88,null));};exports[_0xf5d9('0x35')]=function(_0x1224bd,_0x3e0cc9){return db[_0xf5d9('0x51')][_0xf5d9('0x57')]({'where':{'id':_0x1224bd[_0xf5d9('0x61')]['id']}})[_0xf5d9('0x1f')](handleEntityNotFound(_0x3e0cc9,null))[_0xf5d9('0x1f')](removeEntity(_0x3e0cc9,null))[_0xf5d9('0x28')](handleError(_0x3e0cc9,null));};exports['describe']=function(_0x8c9a88,_0xd85cbd){return db[_0xf5d9('0x51')][_0xf5d9('0x62')]()['then'](respondWithResult(_0xd85cbd,null))[_0xf5d9('0x28')](handleError(_0xd85cbd,null));};exports['addDisposition']=function(_0x41ba27,_0x54bf52,_0x5bbb44){if(_0x41ba27[_0xf5d9('0x59')]['id']){delete _0x41ba27['body']['id'];}return db[_0xf5d9('0x51')][_0xf5d9('0x57')]({'where':{'id':_0x41ba27[_0xf5d9('0x61')]['id']}})['then'](handleEntityNotFound(_0x54bf52,null))['then'](function(_0x18e935){if(_0x18e935){_0x41ba27[_0xf5d9('0x59')][_0xf5d9('0x63')]=_0x18e935['id'];return db[_0xf5d9('0x64')][_0xf5d9('0x58')](_0x41ba27['body']);}})[_0xf5d9('0x1f')](respondWithResult(_0x54bf52,null))[_0xf5d9('0x28')](handleError(_0x54bf52,null));};exports['getDispositions']=function(_0x55752d,_0x14d7fb,_0x43a775){var _0x31d2b4={'raw':![],'where':{}};var _0x4ca072={};var _0x1f79ee={'count':0x0,'rows':[]};return db['FaxAccount'][_0xf5d9('0x65')]({'where':{'id':_0x55752d[_0xf5d9('0x61')]['id']}})['then'](handleEntityNotFound(_0x14d7fb,null))['then'](function(_0x500b65){if(_0x500b65){_0x4ca072['model']=_[_0xf5d9('0x42')](db['Disposition']['rawAttributes']);_0x4ca072[_0xf5d9('0x43')]=_[_0xf5d9('0x42')](_0x55752d['query']);_0x4ca072[_0xf5d9('0x4c')]=_['intersection'](_0x4ca072[_0xf5d9('0x41')],_0x4ca072[_0xf5d9('0x43')]);_0x31d2b4['attributes']=_['intersection'](_0x4ca072['model'],qs[_0xf5d9('0x45')](_0x55752d['query'][_0xf5d9('0x45')]));_0x31d2b4[_0xf5d9('0x44')]=_0x31d2b4[_0xf5d9('0x44')][_0xf5d9('0x46')]?_0x31d2b4[_0xf5d9('0x44')]:_0x4ca072[_0xf5d9('0x41')];if(!_0x55752d[_0xf5d9('0x43')][_0xf5d9('0x47')]('nolimit')){_0x31d2b4['limit']=qs[_0xf5d9('0x48')](_0x55752d[_0xf5d9('0x43')][_0xf5d9('0x48')]);_0x31d2b4[_0xf5d9('0x2c')]=qs[_0xf5d9('0x2c')](_0x55752d[_0xf5d9('0x43')][_0xf5d9('0x2c')]);}_0x31d2b4[_0xf5d9('0x49')]=qs[_0xf5d9('0x4a')](_0x55752d['query']['sort']);_0x31d2b4[_0xf5d9('0x4b')]=qs[_0xf5d9('0x4c')](_[_0xf5d9('0x4d')](_0x55752d[_0xf5d9('0x43')],_0x4ca072[_0xf5d9('0x4c')]));_0x31d2b4[_0xf5d9('0x4b')][_0xf5d9('0x63')]=_0x500b65['id'];if(_0x55752d[_0xf5d9('0x43')]['filter']){_0x31d2b4['where']=_['merge'](_0x31d2b4[_0xf5d9('0x4b')],{'$or':_[_0xf5d9('0x3c')](_0x31d2b4[_0xf5d9('0x44')],function(_0x27d8f6){var _0x46c677={};_0x46c677[_0x27d8f6]={'$like':'%'+_0x55752d[_0xf5d9('0x43')]['filter']+'%'};return _0x46c677;})});}_0x31d2b4=_['merge']({},_0x31d2b4,_0x55752d[_0xf5d9('0x56')]);return db[_0xf5d9('0x64')][_0xf5d9('0x2e')]({'where':_0x31d2b4[_0xf5d9('0x4b')]})['then'](function(_0x5eb263){_0x1f79ee[_0xf5d9('0x2e')]=_0x5eb263;if(_0x55752d[_0xf5d9('0x43')]['includeAll']){_0x31d2b4['include']=[{'all':!![]}];}return db[_0xf5d9('0x64')][_0xf5d9('0x53')](_0x31d2b4);})[_0xf5d9('0x1f')](function(_0x217d91){_0x1f79ee[_0xf5d9('0x66')]=_0x217d91;return _0x1f79ee;});}})[_0xf5d9('0x1f')](respondWithFilteredResult(_0x14d7fb,_0x31d2b4))[_0xf5d9('0x28')](handleError(_0x14d7fb,null));};exports[_0xf5d9('0x67')]=function(_0xd7829f,_0x4ad5d6,_0x2835ed){return db[_0xf5d9('0x51')][_0xf5d9('0x57')]({'where':{'id':_0xd7829f[_0xf5d9('0x61')]['id']}})[_0xf5d9('0x1f')](handleEntityNotFound(_0x4ad5d6,null))['then'](function(_0x1080bd){if(_0x1080bd){return _0x1080bd[_0xf5d9('0x67')](_0xd7829f[_0xf5d9('0x43')][_0xf5d9('0x68')]);}})[_0xf5d9('0x1f')](respondWithStatusCode(_0x4ad5d6,null))['catch'](handleError(_0x4ad5d6,null));};exports[_0xf5d9('0x69')]=function(_0x48631e,_0x987755,_0x3adff4){if(_0x48631e[_0xf5d9('0x59')]['id']){delete _0x48631e['body']['id'];}return db['FaxAccount'][_0xf5d9('0x57')]({'where':{'id':_0x48631e[_0xf5d9('0x61')]['id']}})[_0xf5d9('0x1f')](handleEntityNotFound(_0x987755,null))['then'](function(_0x24ea82){if(_0x24ea82){_0x48631e['body'][_0xf5d9('0x63')]=_0x24ea82['id'];return db[_0xf5d9('0x6a')][_0xf5d9('0x58')](_0x48631e['body']);}})['then'](respondWithResult(_0x987755,null))['catch'](handleError(_0x987755,null));};exports['getAnswers']=function(_0x59ad08,_0x417562,_0x4688e4){var _0x23f8b6={'raw':![],'where':{}};var _0x620ff3={};var _0x31d089={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x59ad08['params']['id']}})[_0xf5d9('0x1f')](handleEntityNotFound(_0x417562,null))['then'](function(_0x5db89a){if(_0x5db89a){_0x620ff3[_0xf5d9('0x41')]=_[_0xf5d9('0x42')](db[_0xf5d9('0x6a')][_0xf5d9('0x3d')]);_0x620ff3['query']=_[_0xf5d9('0x42')](_0x59ad08[_0xf5d9('0x43')]);_0x620ff3['filters']=_[_0xf5d9('0x54')](_0x620ff3['model'],_0x620ff3[_0xf5d9('0x43')]);_0x23f8b6['attributes']=_[_0xf5d9('0x54')](_0x620ff3['model'],qs[_0xf5d9('0x45')](_0x59ad08[_0xf5d9('0x43')][_0xf5d9('0x45')]));_0x23f8b6[_0xf5d9('0x44')]=_0x23f8b6[_0xf5d9('0x44')]['length']?_0x23f8b6[_0xf5d9('0x44')]:_0x620ff3[_0xf5d9('0x41')];if(!_0x59ad08[_0xf5d9('0x43')]['hasOwnProperty']('nolimit')){_0x23f8b6['limit']=qs[_0xf5d9('0x48')](_0x59ad08['query'][_0xf5d9('0x48')]);_0x23f8b6['offset']=qs[_0xf5d9('0x2c')](_0x59ad08[_0xf5d9('0x43')][_0xf5d9('0x2c')]);}_0x23f8b6[_0xf5d9('0x49')]=qs[_0xf5d9('0x4a')](_0x59ad08[_0xf5d9('0x43')][_0xf5d9('0x4a')]);_0x23f8b6['where']=qs[_0xf5d9('0x4c')](_[_0xf5d9('0x4d')](_0x59ad08[_0xf5d9('0x43')],_0x620ff3[_0xf5d9('0x4c')]));_0x23f8b6['where']['FaxAccountId']=_0x5db89a['id'];if(_0x59ad08[_0xf5d9('0x43')]['filter']){_0x23f8b6['where']=_['merge'](_0x23f8b6[_0xf5d9('0x4b')],{'$or':_[_0xf5d9('0x3c')](_0x23f8b6[_0xf5d9('0x44')],function(_0x2628b7){var _0x2bdbd2={};_0x2bdbd2[_0x2628b7]={'$like':'%'+_0x59ad08['query'][_0xf5d9('0x4e')]+'%'};return _0x2bdbd2;})});}_0x23f8b6=_[_0xf5d9('0x4f')]({},_0x23f8b6,_0x59ad08['options']);return db[_0xf5d9('0x6a')][_0xf5d9('0x2e')]({'where':_0x23f8b6[_0xf5d9('0x4b')]})[_0xf5d9('0x1f')](function(_0x3633fd){_0x31d089[_0xf5d9('0x2e')]=_0x3633fd;if(_0x59ad08[_0xf5d9('0x43')][_0xf5d9('0x52')]){_0x23f8b6[_0xf5d9('0x55')]=[{'all':!![]}];}return db['CannedAnswer'][_0xf5d9('0x53')](_0x23f8b6);})[_0xf5d9('0x1f')](function(_0x36c09){_0x31d089[_0xf5d9('0x66')]=_0x36c09;return _0x31d089;});}})[_0xf5d9('0x1f')](respondWithFilteredResult(_0x417562,_0x23f8b6))[_0xf5d9('0x28')](handleError(_0x417562,null));};exports[_0xf5d9('0x6b')]=function(_0x415249,_0x3652d8,_0x2dd73d){return db[_0xf5d9('0x51')][_0xf5d9('0x57')]({'where':{'id':_0x415249['params']['id']}})[_0xf5d9('0x1f')](handleEntityNotFound(_0x3652d8,null))[_0xf5d9('0x1f')](function(_0x3fa812){if(_0x3fa812){return _0x3fa812['removeAnswers'](_0x415249[_0xf5d9('0x43')][_0xf5d9('0x68')]);}})[_0xf5d9('0x1f')](respondWithStatusCode(_0x3652d8,null))['catch'](handleError(_0x3652d8,null));};exports[_0xf5d9('0x6c')]=function(_0x4d5673,_0x35cea7,_0x28ad61){return db[_0xf5d9('0x6d')][_0xf5d9('0x57')]({'where':{'id':_0x4d5673['params']['id']}})[_0xf5d9('0x1f')](handleEntityNotFound(_0x35cea7,null))[_0xf5d9('0x1f')](function(_0x46f12e){if(_0x46f12e){return _0x46f12e['addInteraction'](_0x4d5673[_0xf5d9('0x59')][_0xf5d9('0x68')],_[_0xf5d9('0x6e')](_0x4d5673['body'],[_0xf5d9('0x68'),'id'])||{});}})[_0xf5d9('0x1f')](respondWithResult(_0x35cea7,null))[_0xf5d9('0x28')](handleError(_0x35cea7,null));};exports[_0xf5d9('0x6f')]=function(_0xa77925,_0x5ce10c,_0x36a326){var _0x237f89={'raw':![],'where':{}};var _0x6e361f={};var _0x132ba7={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0xa77925['params']['id']}})[_0xf5d9('0x1f')](handleEntityNotFound(_0x5ce10c,null))[_0xf5d9('0x1f')](function(_0x172485){if(_0x172485){_0x6e361f[_0xf5d9('0x41')]=_[_0xf5d9('0x42')](db[_0xf5d9('0x6d')][_0xf5d9('0x3d')]);_0x6e361f[_0xf5d9('0x43')]=_[_0xf5d9('0x42')](_0xa77925[_0xf5d9('0x43')]);_0x6e361f[_0xf5d9('0x4c')]=_[_0xf5d9('0x54')](_0x6e361f['model'],_0x6e361f[_0xf5d9('0x43')]);_0x237f89[_0xf5d9('0x44')]=_[_0xf5d9('0x54')](_0x6e361f[_0xf5d9('0x41')],qs[_0xf5d9('0x45')](_0xa77925[_0xf5d9('0x43')][_0xf5d9('0x45')]));_0x237f89['attributes']=_0x237f89[_0xf5d9('0x44')]['length']?_0x237f89[_0xf5d9('0x44')]:_0x6e361f[_0xf5d9('0x41')];if(!_0xa77925[_0xf5d9('0x43')][_0xf5d9('0x47')](_0xf5d9('0x70'))){_0x237f89[_0xf5d9('0x48')]=qs[_0xf5d9('0x48')](_0xa77925[_0xf5d9('0x43')][_0xf5d9('0x48')]);_0x237f89[_0xf5d9('0x2c')]=qs['offset'](_0xa77925['query'][_0xf5d9('0x2c')]);}_0x237f89[_0xf5d9('0x49')]=qs['sort'](_0xa77925[_0xf5d9('0x43')][_0xf5d9('0x4a')]);_0x237f89[_0xf5d9('0x4b')]=qs['filters'](_['pick'](_0xa77925[_0xf5d9('0x43')],_0x6e361f[_0xf5d9('0x4c')]));_0x237f89[_0xf5d9('0x4b')][_0xf5d9('0x63')]=_0x172485['id'];if(_0xa77925['query'][_0xf5d9('0x4e')]){_0x237f89['where']=_[_0xf5d9('0x4f')](_0x237f89[_0xf5d9('0x4b')],{'$or':_[_0xf5d9('0x3c')](_0x237f89['attributes'],function(_0x5706d6){var _0x50c0e2={};_0x50c0e2[_0x5706d6]={'$like':'%'+_0xa77925['query'][_0xf5d9('0x4e')]+'%'};return _0x50c0e2;})});}_0x237f89=_[_0xf5d9('0x4f')]({},_0x237f89,_0xa77925['options']);return db['FaxInteraction'][_0xf5d9('0x2e')]({'where':_0x237f89[_0xf5d9('0x4b')]})[_0xf5d9('0x1f')](function(_0x26208c){_0x132ba7[_0xf5d9('0x2e')]=_0x26208c;if(_0xa77925['query'][_0xf5d9('0x52')]){_0x237f89[_0xf5d9('0x55')]=[{'model':db[_0xf5d9('0x71')],'as':_0xf5d9('0x72'),'required':![]},{'model':db[_0xf5d9('0x73')],'as':_0xf5d9('0x74'),'attributes':[_0xf5d9('0x39'),'fullname','internal'],'required':![]},{'model':db['Tag'],'as':_0xf5d9('0x75'),'attributes':['id',_0xf5d9('0x39'),'color'],'where':_0xa77925[_0xf5d9('0x43')][_0xf5d9('0x76')]?{'id':_0xa77925['query'][_0xf5d9('0x76')]}:undefined,'required':_0xa77925[_0xf5d9('0x43')][_0xf5d9('0x76')]?!![]:![]}];}return db[_0xf5d9('0x6d')][_0xf5d9('0x53')](_0x237f89);})['then'](function(_0x5b6af2){_0x132ba7['rows']=_0x5b6af2;return _0x132ba7;});}})['then'](respondWithFilteredResult(_0x5ce10c,_0x237f89))[_0xf5d9('0x28')](handleError(_0x5ce10c,null));};exports[_0xf5d9('0x77')]=function(_0x3ea868,_0x37bcfb){var _0x3f9c2d=_0x3ea868[_0xf5d9('0x61')]['id'];var _0x1216c6=_0x3ea868[_0xf5d9('0x59')];var _0x5ec67b=0xc8;var _0x424098=null;return db[_0xf5d9('0x78')][_0xf5d9('0x79')]({'isolationLevel':db[_0xf5d9('0x78')][_0xf5d9('0x7a')]['ISOLATION_LEVELS'][_0xf5d9('0x7b')]},function(_0x176b40){return db[_0xf5d9('0x51')][_0xf5d9('0x65')]({'where':{'id':_0x3f9c2d},'transaction':_0x176b40})[_0xf5d9('0x1f')](function(_0x21d432){if(_0x21d432){return db[_0xf5d9('0x7c')][_0xf5d9('0x35')]({'where':{'FaxAccountId':_0x3f9c2d},'transaction':_0x176b40})[_0xf5d9('0x1f')](function(){var _0x454dc6=_[_0xf5d9('0x3c')](_0x1216c6,function(_0x23dc15){_0x23dc15[_0xf5d9('0x63')]=_0x3f9c2d;return _0x23dc15;});return db[_0xf5d9('0x7c')][_0xf5d9('0x7d')](_0x454dc6,{'transaction':_0x176b40});});}else{_0x5ec67b=0x194;_0x424098=[];}});})[_0xf5d9('0x1f')](function(){if(_0x5ec67b!==0x194){return db[_0xf5d9('0x7c')][_0xf5d9('0x7e')]({'where':{'FaxAccountId':_0x3f9c2d},'order':_0xf5d9('0x7f')})[_0xf5d9('0x1f')](function(_0x2c189a){_0x424098=_0x2c189a;});}})[_0xf5d9('0x28')](function(_0x51ad01){_0x5ec67b=0x1f4;logger[_0xf5d9('0x25')](_0x51ad01[_0xf5d9('0x38')]);if(_0x51ad01[_0xf5d9('0x39')]){delete _0x51ad01[_0xf5d9('0x39')];}_0x424098=_0x51ad01;})[_0xf5d9('0x80')](function(){if(_0x424098===null){_0x37bcfb[_0xf5d9('0x37')](_0x5ec67b);}else{if(_0x5ec67b===0x1f4){_0x37bcfb[_0xf5d9('0x29')](_0x5ec67b)[_0xf5d9('0x81')](_0x424098);}else{_0x37bcfb[_0xf5d9('0x29')](_0x5ec67b)['json'](_0x424098);}}});};exports[_0xf5d9('0x82')]=function(_0x3f4bd1,_0xabf61,_0x174cc3){var _0x594152={};var _0x14cb7a={};var _0x292586;var _0x41af7a;return db[_0xf5d9('0x51')][_0xf5d9('0x65')]({'where':{'id':_0x3f4bd1[_0xf5d9('0x61')]['id']}})[_0xf5d9('0x1f')](handleEntityNotFound(_0xabf61,null))[_0xf5d9('0x1f')](function(_0x2c543d){if(_0x2c543d){_0x292586=_0x2c543d;_0x14cb7a[_0xf5d9('0x41')]=_[_0xf5d9('0x42')](db[_0xf5d9('0x7c')][_0xf5d9('0x3d')]);_0x14cb7a[_0xf5d9('0x43')]=_['keys'](_0x3f4bd1['query']);_0x14cb7a[_0xf5d9('0x4c')]=_[_0xf5d9('0x54')](_0x14cb7a[_0xf5d9('0x41')],_0x14cb7a['query']);_0x594152[_0xf5d9('0x44')]=_['intersection'](_0x14cb7a[_0xf5d9('0x41')],qs[_0xf5d9('0x45')](_0x3f4bd1[_0xf5d9('0x43')][_0xf5d9('0x45')]));_0x594152[_0xf5d9('0x44')]=_0x594152['attributes']['length']?_0x594152['attributes']:_0x14cb7a[_0xf5d9('0x41')];_0x594152[_0xf5d9('0x49')]=qs['sort'](_0x3f4bd1[_0xf5d9('0x43')]['sort']);_0x594152[_0xf5d9('0x4b')]=qs[_0xf5d9('0x4c')](_['pick'](_0x3f4bd1[_0xf5d9('0x43')],_0x14cb7a[_0xf5d9('0x4c')]));if(_0x3f4bd1[_0xf5d9('0x43')]['filter']){_0x594152['where']=_[_0xf5d9('0x4f')](_0x594152[_0xf5d9('0x4b')],{'$or':_[_0xf5d9('0x3c')](_0x594152['attributes'],function(_0x149269){var _0x351b86={};_0x351b86[_0x149269]={'$like':'%'+_0x3f4bd1[_0xf5d9('0x43')][_0xf5d9('0x4e')]+'%'};return _0x351b86;})});}_0x594152=_[_0xf5d9('0x4f')]({},_0x594152,_0x3f4bd1[_0xf5d9('0x56')]);return _0x292586['getApplications'](_0x594152);}})[_0xf5d9('0x1f')](function(_0x4993c9){if(_0x4993c9){_0x41af7a=_0x4993c9[_0xf5d9('0x46')];if(!_0x3f4bd1[_0xf5d9('0x43')][_0xf5d9('0x47')](_0xf5d9('0x70'))){_0x594152[_0xf5d9('0x48')]=qs[_0xf5d9('0x48')](_0x3f4bd1[_0xf5d9('0x43')][_0xf5d9('0x48')]);_0x594152[_0xf5d9('0x2c')]=qs[_0xf5d9('0x2c')](_0x3f4bd1[_0xf5d9('0x43')][_0xf5d9('0x2c')]);}return _0x292586['getApplications'](_0x594152);}})[_0xf5d9('0x1f')](function(_0x31264f){if(_0x31264f){return _0x31264f?{'count':_0x41af7a,'rows':_0x31264f}:null;}})[_0xf5d9('0x1f')](respondWithResult(_0xabf61,null))['catch'](handleError(_0xabf61,null));};function Extension(_0x57383b,_0x4aa765,_0x533ab1,_0x534caa){this['context']=_0xf5d9('0x83');this['exten']=_0x57383b['localstationid'];this[_0xf5d9('0x84')]=_0x534caa;this[_0xf5d9('0x3f')]=_0xf5d9('0x85');this[_0xf5d9('0x86')]=_0xf5d9('0x87');this[_0xf5d9('0x63')]=_0x57383b['id'];this[_0xf5d9('0x7f')]=_0x4aa765;this[_0xf5d9('0x88')]=_0x533ab1;}function createExtensionsReciveFax(_0x21fca7){var _0x4acc22=0x1;var _0x8b605d=[];_0x8b605d[_0xf5d9('0x89')](new Extension(_0x21fca7,_0x4acc22,'',_0xf5d9('0x8a')));_0x4acc22+=0x1;_0x8b605d[_0xf5d9('0x89')](new Extension(_0x21fca7,_0x4acc22,'CDR(type)=inbound-fax',_0xf5d9('0x8b')));_0x4acc22+=0x1;for(var _0x244d9d in _0x21fca7){if(_0x21fca7['hasOwnProperty'](_0x244d9d)&&(_0x244d9d===_0xf5d9('0x8c')||_0x244d9d===_0xf5d9('0x8d')||_0x244d9d===_0xf5d9('0x8e')||_0x244d9d===_0xf5d9('0x8f')||_0x244d9d==='headerinfo'||_0x244d9d==='maxrate'||_0x244d9d===_0xf5d9('0x90')||_0x244d9d==='modem'||_0x244d9d===_0xf5d9('0x91'))){_0x8b605d[_0xf5d9('0x89')](new Extension(_0x21fca7,_0x4acc22,'FAXOPT('+_0x244d9d+')='+_0x21fca7[_0x244d9d],_0xf5d9('0x8b')));_0x4acc22+=0x1;}}_0x8b605d[_0xf5d9('0x89')](new Extension(_0x21fca7,_0x4acc22,'6',_0xf5d9('0x92')));_0x4acc22+=0x1;_0x8b605d[_0xf5d9('0x89')](new Extension(_0x21fca7,_0x4acc22,'/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',_0xf5d9('0x93')));_0x4acc22=0x0;return _0x8b605d;}exports[_0xf5d9('0x94')]=function(_0x1e0b55,_0x2f50f1,_0x2ed695){var _0x208de0;return db[_0xf5d9('0x78')][_0xf5d9('0x79')](function(_0x6e9488){return db[_0xf5d9('0x51')][_0xf5d9('0x58')](_0x1e0b55[_0xf5d9('0x59')],{'transaction':_0x6e9488})[_0xf5d9('0x1f')](function(_0x4b2ebb){_0x208de0=_0x4b2ebb[_0xf5d9('0x36')]({'plain':!![]});return db[_0xf5d9('0x95')][_0xf5d9('0x7d')](createExtensionsReciveFax(_0x208de0),{'transaction':_0x6e9488});});})[_0xf5d9('0x1f')](function(){return _0x208de0;})[_0xf5d9('0x1f')](respondWithResult(_0x2f50f1,null))[_0xf5d9('0x28')](handleError(_0x2f50f1,null));};exports[_0xf5d9('0x96')]=function(_0x36d1be,_0x47863b,_0x503782){var _0x117912;return db[_0xf5d9('0x78')][_0xf5d9('0x79')](function(_0x551cc4){return db['FaxAccount'][_0xf5d9('0x34')](_0x36d1be[_0xf5d9('0x59')],{'where':{'id':_0x36d1be[_0xf5d9('0x59')]['id']},'transaction':_0x551cc4})[_0xf5d9('0x1f')](function(_0x4d2fad){return db[_0xf5d9('0x95')][_0xf5d9('0x35')]({'where':{'FaxAccountId':_0x36d1be[_0xf5d9('0x59')]['id']},'transaction':_0x551cc4})['then'](function(_0x55ef92){return db[_0xf5d9('0x95')][_0xf5d9('0x7d')](createExtensionsReciveFax(_[_0xf5d9('0x6e')](_0x36d1be['body'],[_0xf5d9('0x97'),'key',_0xf5d9('0x98'),_0xf5d9('0x99'),_0xf5d9('0x9a'),'ListId'])),{'transaction':_0x551cc4});});});})[_0xf5d9('0x1f')](function(){return db[_0xf5d9('0x51')][_0xf5d9('0x9b')](_0x36d1be[_0xf5d9('0x59')]['id']);})[_0xf5d9('0x1f')](respondWithResult(_0x47863b,null))['catch'](handleError(_0x47863b,null));};exports[_0xf5d9('0x9c')]=function(_0x27ca18,_0x5a8c,_0x47dff6){var _0x3bc031={'raw':!![],'where':{}};var _0x2ee175={};var _0x4f476a={'count':0x0,'rows':[]};return db[_0xf5d9('0x51')][_0xf5d9('0x65')]({'where':{'id':_0x27ca18['params']['id']}})[_0xf5d9('0x1f')](handleEntityNotFound(_0x5a8c,null))['then'](function(_0x56c71c){if(_0x56c71c){_0x2ee175[_0xf5d9('0x41')]=_[_0xf5d9('0x42')](db['FaxMessage'][_0xf5d9('0x3d')]);_0x2ee175[_0xf5d9('0x43')]=_[_0xf5d9('0x42')](_0x27ca18[_0xf5d9('0x43')]);_0x2ee175[_0xf5d9('0x4c')]=_[_0xf5d9('0x54')](_0x2ee175[_0xf5d9('0x41')],_0x2ee175[_0xf5d9('0x43')]);_0x3bc031[_0xf5d9('0x44')]=_[_0xf5d9('0x54')](_0x2ee175[_0xf5d9('0x41')],qs[_0xf5d9('0x45')](_0x27ca18[_0xf5d9('0x43')][_0xf5d9('0x45')]));_0x3bc031[_0xf5d9('0x44')]=_0x3bc031[_0xf5d9('0x44')]['length']?_0x3bc031[_0xf5d9('0x44')]:_0x2ee175['model'];if(!_0x27ca18[_0xf5d9('0x43')][_0xf5d9('0x47')](_0xf5d9('0x70'))){_0x3bc031[_0xf5d9('0x48')]=qs[_0xf5d9('0x48')](_0x27ca18[_0xf5d9('0x43')][_0xf5d9('0x48')]);_0x3bc031[_0xf5d9('0x2c')]=qs[_0xf5d9('0x2c')](_0x27ca18[_0xf5d9('0x43')][_0xf5d9('0x2c')]);}_0x3bc031['order']=qs[_0xf5d9('0x4a')](_0x27ca18[_0xf5d9('0x43')][_0xf5d9('0x4a')]);_0x3bc031[_0xf5d9('0x4b')]=qs[_0xf5d9('0x4c')](_[_0xf5d9('0x4d')](_0x27ca18[_0xf5d9('0x43')],_0x2ee175[_0xf5d9('0x4c')]));_0x3bc031['where'][_0xf5d9('0x63')]=_0x56c71c['id'];if(_0x27ca18[_0xf5d9('0x43')][_0xf5d9('0x4e')]){_0x3bc031[_0xf5d9('0x4b')]=_[_0xf5d9('0x4f')](_0x3bc031[_0xf5d9('0x4b')],{'$or':_['map'](_0x3bc031[_0xf5d9('0x44')],function(_0x2ef361){var _0x22e94e={};_0x22e94e[_0x2ef361]={'$like':'%'+_0x27ca18[_0xf5d9('0x43')][_0xf5d9('0x4e')]+'%'};return _0x22e94e;})});}if(_0x27ca18['query']['$gte']){var _0x288510=_0x27ca18[_0xf5d9('0x43')]['$gte']['split'](',');var _0x60d4d4={};_0x60d4d4[_0x288510[0x0]]={'$gte':moment(_0x288510[0x1])[_0xf5d9('0x9d')](_0xf5d9('0x9e'))};_0x3bc031['where']=_[_0xf5d9('0x4f')](_0x3bc031['where'],_0x60d4d4);}_0x3bc031=_[_0xf5d9('0x4f')]({},_0x3bc031,_0x27ca18[_0xf5d9('0x56')]);return db[_0xf5d9('0x9f')][_0xf5d9('0x2e')]({'where':_0x3bc031[_0xf5d9('0x4b')]})[_0xf5d9('0x1f')](function(_0x247d5e){_0x4f476a[_0xf5d9('0x2e')]=_0x247d5e;if(_0x27ca18[_0xf5d9('0x43')][_0xf5d9('0x52')]){_0x3bc031[_0xf5d9('0x55')]=[{'all':!![]}];}return db['FaxMessage'][_0xf5d9('0x53')](_0x3bc031);})[_0xf5d9('0x1f')](function(_0x13f027){_0x4f476a['rows']=_0x13f027;return _0x4f476a;});}})[_0xf5d9('0x1f')](respondWithFilteredResult(_0x5a8c,_0x3bc031))['catch'](handleError(_0x5a8c,null));};exports[_0xf5d9('0x81')]=function(_0xd3c6f7,_0x15e168,_0x5e8921){var _0x4c37c1,_0xe3020b={},_0xf6c681;if(_0xd3c6f7[_0xf5d9('0x59')]['to']){_0xf6c681=_0xd3c6f7[_0xf5d9('0x59')]['to'][0x0];}return db[_0xf5d9('0x51')]['find']({'where':{'id':_0xd3c6f7[_0xf5d9('0x61')]['id']},'include':[{'model':db[_0xf5d9('0xa0')],'as':_0xf5d9('0xa1'),'include':[{'model':db[_0xf5d9('0x71')],'as':'Contacts','where':{'fax':_0xf6c681},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0xf5d9('0x1f')](handleEntityNotFound(_0x15e168,null))[_0xf5d9('0x1f')](function(_0x47a053){_0x4c37c1=_0x47a053;if(_0xd3c6f7[_0xf5d9('0x59')][_0xf5d9('0xa2')]&&_0xd3c6f7[_0xf5d9('0x59')][_0xf5d9('0xa2')]['length']){for(var _0x1f442c=0x0;_0x1f442c<_0xd3c6f7[_0xf5d9('0x59')][_0xf5d9('0xa2')][_0xf5d9('0x46')];_0x1f442c+=0x1){_0xd3c6f7[_0xf5d9('0x59')][_0xf5d9('0xa2')][_0x1f442c]={'filename':_0xd3c6f7[_0xf5d9('0x59')][_0xf5d9('0xa2')][_0x1f442c][_0xf5d9('0x39')],'id':_0xd3c6f7[_0xf5d9('0x59')][_0xf5d9('0xa2')][_0x1f442c]['id'],'path':path[_0xf5d9('0xa3')](config[_0xf5d9('0xa4')],_0xf5d9('0xa5'),_0xd3c6f7['body'][_0xf5d9('0xa2')][_0x1f442c]['basename'])};}}return respondWithRpcPromise(_0xf5d9('0xa6'),_0xf5d9('0xa6'),{'FaxAccountId':_['isNil'](_0xd3c6f7[_0xf5d9('0x61')]['id'])?undefined:_0xd3c6f7[_0xf5d9('0x61')]['id'],'path':_[_0xf5d9('0xa7')](_0xd3c6f7[_0xf5d9('0x59')][_0xf5d9('0xa2')][0x0]['path'])?undefined:_0xd3c6f7[_0xf5d9('0x59')][_0xf5d9('0xa2')][0x0][_0xf5d9('0x7')],'fax':_[_0xf5d9('0xa7')](_0xd3c6f7[_0xf5d9('0x59')]['to'][0x0])?undefined:_0xd3c6f7[_0xf5d9('0x59')]['to'][0x0]},client9002);})[_0xf5d9('0x1f')](function(){if(_0x4c37c1){if(_['isNil'](_0xd3c6f7['body']['from'])){_0xd3c6f7[_0xf5d9('0x59')][_0xf5d9('0xa8')]=util[_0xf5d9('0x9d')](_0xf5d9('0xa9'),_0x4c37c1['name'],_0x4c37c1['fax']);}if(_0x4c37c1[_0xf5d9('0xa1')]){if(_0x4c37c1['List'][_0xf5d9('0xaa')][_0xf5d9('0x46')]){return _0x4c37c1[_0xf5d9('0xa1')][_0xf5d9('0xaa')][0x0];}else{return db[_0xf5d9('0x71')][_0xf5d9('0x58')](_[_0xf5d9('0x18')](_0xd3c6f7[_0xf5d9('0x59')],{'firstName':_0xd3c6f7[_0xf5d9('0x59')]['to'][0x0],'phone':_0xd3c6f7['body']['to'][0x0],'fax':_0xd3c6f7[_0xf5d9('0x59')]['to'][0x0],'ListId':_0x4c37c1['ListId']}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0xf5d9('0xab'));}})[_0xf5d9('0x1f')](function(_0x50137c){if(_0x50137c){return db['FaxInteraction'][_0xf5d9('0x57')]({'where':{'ContactId':_0x50137c['id'],'closed':![],'FaxAccountId':_0x4c37c1['id']}})[_0xf5d9('0x1f')](function(_0x31d4f8){if(_0x31d4f8){return[_0x31d4f8,![]];}return db[_0xf5d9('0x6d')][_0xf5d9('0x58')]({'UserId':_0xd3c6f7['user']['id'],'ContactId':_0x50137c['id'],'FaxAccountId':_0x4c37c1['id'],'fax':_0xd3c6f7['body']['to'][0x0],'firstMsgDirection':_0xf5d9('0xac'),'Messages':[_[_0xf5d9('0x4f')](_0xd3c6f7[_0xf5d9('0x59')],{'read':![],'body':_0xd3c6f7[_0xf5d9('0x59')][_0xf5d9('0xa2')][0x0][_0xf5d9('0xad')],'FaxAccountId':_0x4c37c1['id'],'UserId':_0xd3c6f7[_0xf5d9('0x5c')]['id'],'ContactId':_0x50137c['id'],'AttachmentId':_0xd3c6f7[_0xf5d9('0x59')][_0xf5d9('0xa2')][0x0]['id']})]},{'include':[{'model':db[_0xf5d9('0x9f')],'as':'Messages'}]})[_0xf5d9('0x1f')](function(_0x2e638e){return[_0x2e638e,!![]];});});}else{throw new Error(_0xf5d9('0xae'));}})['spread'](function(_0x21daa9,_0x66da47){if(_0x66da47){return _0x21daa9;}return db[_0xf5d9('0x9f')][_0xf5d9('0x58')]({'direction':_0xf5d9('0xac'),'read':![],'body':_0xd3c6f7['body']['attachments'][0x0][_0xf5d9('0xad')],'FaxAccountId':_0x4c37c1['id'],'FaxInteractionId':_0x21daa9['id'],'UserId':_0xd3c6f7['user']['id'],'ContactId':_0x21daa9[_0xf5d9('0xaf')],'AttachmentId':_0xd3c6f7[_0xf5d9('0x59')][_0xf5d9('0xa2')][0x0]['id']})[_0xf5d9('0x1f')](function(_0x5b34a8){_0x21daa9['dataValues'][_0xf5d9('0xb0')]=[];_0x21daa9['dataValues'][_0xf5d9('0xb0')][_0xf5d9('0x89')](_0x5b34a8[_0xf5d9('0xb1')]);return _0x21daa9;});})['then'](function(_0x11ba93){respondWithRpcPromise('SendFax',_0xf5d9('0xb2'),{'FaxAccountId':_[_0xf5d9('0xa7')](_0xd3c6f7[_0xf5d9('0x61')]['id'])?undefined:_0xd3c6f7[_0xf5d9('0x61')]['id'],'path':_[_0xf5d9('0xa7')](_0xd3c6f7[_0xf5d9('0x59')][_0xf5d9('0xa2')][0x0][_0xf5d9('0x7')])?undefined:_0xd3c6f7[_0xf5d9('0x59')][_0xf5d9('0xa2')][0x0][_0xf5d9('0x7')],'fax':_[_0xf5d9('0xa7')](_0xd3c6f7[_0xf5d9('0x59')]['to'][0x0])?undefined:_0xd3c6f7[_0xf5d9('0x59')]['to'][0x0],'AttachmentId':_0xd3c6f7['body'][_0xf5d9('0xa2')][0x0]['id']},client9002)[_0xf5d9('0x1f')](function(_0x3254a2){logger[_0xf5d9('0x20')](_0xf5d9('0xb3'),_0x3254a2);})[_0xf5d9('0x28')](function(_0x429c47){logger[_0xf5d9('0x20')](_0xf5d9('0xb3'),_0x429c47);});return _0x11ba93;})[_0xf5d9('0x1f')](respondWithResult(_0x15e168,null))[_0xf5d9('0x28')](handleError(_0x15e168,null));};exports['addAgents']=function(_0x5e45f1,_0x386a70,_0x2f9a7d){return db['FaxAccount'][_0xf5d9('0x57')]({'where':{'id':_0x5e45f1['params']['id']}})['then'](handleEntityNotFound(_0x386a70,null))['then'](function(_0xfd9b94){if(_0xfd9b94){return _0xfd9b94[_0xf5d9('0xb4')](_0x5e45f1[_0xf5d9('0x59')][_0xf5d9('0x68')],_['omit'](_0x5e45f1[_0xf5d9('0x59')],[_0xf5d9('0x68'),'id'])||{})[_0xf5d9('0xb5')](function(_0x26fbb6){for(var _0x31db45=0x0;_0x31db45<_0x5e45f1[_0xf5d9('0x59')]['ids'][_0xf5d9('0x46')];_0x31db45+=0x1){socket['emit'](_0xf5d9('0xb6'),{'UserId':Number(_0x5e45f1['body'][_0xf5d9('0x68')][_0x31db45]),'FaxAccountId':Number(_0x5e45f1[_0xf5d9('0x61')]['id'])});}return _0x26fbb6;});}})['then'](respondWithResult(_0x386a70,null))[_0xf5d9('0x28')](handleError(_0x386a70,null));};exports[_0xf5d9('0xb7')]=function(_0x3fdbd0,_0x37e23e,_0x12260a){return db[_0xf5d9('0x51')][_0xf5d9('0x57')]({'where':{'id':_0x3fdbd0['params']['id']}})[_0xf5d9('0x1f')](handleEntityNotFound(_0x37e23e,null))[_0xf5d9('0x1f')](function(_0x3b0a5b){if(_0x3b0a5b){return _0x3b0a5b[_0xf5d9('0xb7')](_0x3fdbd0[_0xf5d9('0x43')][_0xf5d9('0x68')])[_0xf5d9('0x1f')](function(){if(_[_0xf5d9('0xb8')](_0x3fdbd0[_0xf5d9('0x43')]['ids'])){for(var _0x3107fb=0x0;_0x3107fb<_0x3fdbd0[_0xf5d9('0x43')][_0xf5d9('0x68')]['length'];_0x3107fb+=0x1){socket['emit'](_0xf5d9('0xb9'),{'UserId':Number(_0x3fdbd0[_0xf5d9('0x43')]['ids'][_0x3107fb]),'FaxAccountId':Number(_0x3fdbd0[_0xf5d9('0x61')]['id'])});}}else{socket[_0xf5d9('0xba')]('userFaxAccount:remove',{'UserId':Number(_0x3fdbd0['query']['ids']),'FaxAccountId':Number(_0x3fdbd0[_0xf5d9('0x61')]['id'])});}});}})[_0xf5d9('0x1f')](respondWithStatusCode(_0x37e23e,null))[_0xf5d9('0x28')](handleError(_0x37e23e,null));};exports[_0xf5d9('0xbb')]=function(_0x5eed74,_0x54b79d,_0x1020f6){var _0x3ca825={};var _0x118e21={};var _0x5552a4;var _0x2e7f9c;return db[_0xf5d9('0x51')]['findOne']({'where':{'id':_0x5eed74[_0xf5d9('0x61')]['id']}})[_0xf5d9('0x1f')](handleEntityNotFound(_0x54b79d,null))[_0xf5d9('0x1f')](function(_0x1fdc44){if(_0x1fdc44){_0x5552a4=_0x1fdc44;_0x118e21['model']=_[_0xf5d9('0x42')](db[_0xf5d9('0x73')][_0xf5d9('0x3d')]);_0x118e21['query']=_['keys'](_0x5eed74[_0xf5d9('0x43')]);_0x118e21[_0xf5d9('0x4c')]=_[_0xf5d9('0x54')](_0x118e21[_0xf5d9('0x41')],_0x118e21[_0xf5d9('0x43')]);_0x3ca825[_0xf5d9('0x44')]=_[_0xf5d9('0x54')](_0x118e21[_0xf5d9('0x41')],qs[_0xf5d9('0x45')](_0x5eed74[_0xf5d9('0x43')]['fields']));_0x3ca825[_0xf5d9('0x44')]=_0x3ca825[_0xf5d9('0x44')][_0xf5d9('0x46')]?_0x3ca825[_0xf5d9('0x44')]:_0x118e21[_0xf5d9('0x41')];_0x3ca825[_0xf5d9('0x49')]=qs['sort'](_0x5eed74['query'][_0xf5d9('0x4a')]);_0x3ca825[_0xf5d9('0x4b')]=qs[_0xf5d9('0x4c')](_[_0xf5d9('0x4d')](_0x5eed74['query'],_0x118e21[_0xf5d9('0x4c')]));if(_0x5eed74[_0xf5d9('0x43')][_0xf5d9('0x4e')]){_0x3ca825[_0xf5d9('0x4b')]=_[_0xf5d9('0x4f')](_0x3ca825[_0xf5d9('0x4b')],{'$or':_['map'](_0x3ca825['attributes'],function(_0x1fda90){var _0x5b61b6={};_0x5b61b6[_0x1fda90]={'$like':'%'+_0x5eed74[_0xf5d9('0x43')][_0xf5d9('0x4e')]+'%'};return _0x5b61b6;})});}_0x3ca825=_[_0xf5d9('0x4f')]({},_0x3ca825,_0x5eed74['options']);return _0x5552a4['getAgents'](_0x3ca825);}})[_0xf5d9('0x1f')](function(_0x138686){if(_0x138686){_0x2e7f9c=_0x138686[_0xf5d9('0x46')];if(!_0x5eed74[_0xf5d9('0x43')][_0xf5d9('0x47')](_0xf5d9('0x70'))){_0x3ca825[_0xf5d9('0x48')]=qs[_0xf5d9('0x48')](_0x5eed74[_0xf5d9('0x43')][_0xf5d9('0x48')]);_0x3ca825['offset']=qs['offset'](_0x5eed74['query'][_0xf5d9('0x2c')]);}return _0x5552a4[_0xf5d9('0xbb')](_0x3ca825);}})[_0xf5d9('0x1f')](function(_0x18ae51){if(_0x18ae51){return _0x18ae51?{'count':_0x2e7f9c,'rows':_0x18ae51}:null;}})[_0xf5d9('0x1f')](respondWithResult(_0x54b79d,null))[_0xf5d9('0x28')](handleError(_0x54b79d,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index e915622..834ab2f 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 _0x7be8=['FaxAccount','setMaxListeners','save','update','remove','emit','hook','exports','events','../../mysqldb'];(function(_0x4857c3,_0x220ee0){var _0x42a02d=function(_0x5afb0d){while(--_0x5afb0d){_0x4857c3['push'](_0x4857c3['shift']());}};_0x42a02d(++_0x220ee0);}(_0x7be8,0x148));var _0x87be=function(_0x5830b1,_0x565dc7){_0x5830b1=_0x5830b1-0x0;var _0x101474=_0x7be8[_0x5830b1];return _0x101474;};'use strict';var EventEmitter=require(_0x87be('0x0'));var FaxAccount=require(_0x87be('0x1'))['db'][_0x87be('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x87be('0x3')](0x0);var events={'afterCreate':_0x87be('0x4'),'afterUpdate':_0x87be('0x5'),'afterDestroy':_0x87be('0x6')};function emitEvent(_0x5eef54){return function(_0xc1fd1e,_0x2c8b33,_0xec7abc){FaxAccountEvents[_0x87be('0x7')](_0x5eef54+':'+_0xc1fd1e['id'],_0xc1fd1e);FaxAccountEvents[_0x87be('0x7')](_0x5eef54,_0xc1fd1e);_0xec7abc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0x87be('0x8')](e,emitEvent(event));}}module[_0x87be('0x9')]=FaxAccountEvents; \ No newline at end of file +var _0x4784=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxAccount','setMaxListeners','update','remove'];(function(_0x412c8f,_0x11ec94){var _0x27c005=function(_0x127059){while(--_0x127059){_0x412c8f['push'](_0x412c8f['shift']());}};_0x27c005(++_0x11ec94);}(_0x4784,0x1ee));var _0x4478=function(_0x5f5116,_0x2eb5cc){_0x5f5116=_0x5f5116-0x0;var _0x11398e=_0x4784[_0x5f5116];return _0x11398e;};'use strict';var EventEmitter=require(_0x4478('0x0'));var FaxAccount=require(_0x4478('0x1'))['db'][_0x4478('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x4478('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4478('0x4'),'afterDestroy':_0x4478('0x5')};function emitEvent(_0x4ee247){return function(_0x247902,_0x1b189d,_0x2a8b3d){FaxAccountEvents[_0x4478('0x6')](_0x4ee247+':'+_0x247902['id'],_0x247902);FaxAccountEvents[_0x4478('0x6')](_0x4ee247,_0x247902);_0x2a8b3d(null);};}for(var e in events){if(events[_0x4478('0x7')](e)){var event=events[e];FaxAccount[_0x4478('0x8')](e,emitEvent(event));}}module[_0x4478('0x9')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 049f24f..74bb86f 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 _0x2693=['../../config/environment','./faxAccount.attributes','exports','FaxAccount','lodash','util','bluebird','request-promise','path','rimraf'];(function(_0x11c5da,_0x5799cf){var _0x5cfbf1=function(_0x2d23b0){while(--_0x2d23b0){_0x11c5da['push'](_0x11c5da['shift']());}};_0x5cfbf1(++_0x5799cf);}(_0x2693,0x176));var _0x3269=function(_0x580a8a,_0x48f80e){_0x580a8a=_0x580a8a-0x0;var _0x3b1888=_0x2693[_0x580a8a];return _0x3b1888;};'use strict';var _=require(_0x3269('0x0'));var util=require(_0x3269('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x3269('0x2'));var rp=require(_0x3269('0x3'));var fs=require('fs');var path=require(_0x3269('0x4'));var rimraf=require(_0x3269('0x5'));var config=require(_0x3269('0x6'));var attributes=require(_0x3269('0x7'));module[_0x3269('0x8')]=function(_0x10af05,_0x3a44b7){return _0x10af05['define'](_0x3269('0x9'),attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x01ab=['./faxAccount.attributes','exports','define','FaxAccount','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x01ab,0x67));var _0xb01a=function(_0x1af1e1,_0x37bc24){_0x1af1e1=_0x1af1e1-0x0;var _0x5f3450=_0x01ab[_0x1af1e1];return _0x5f3450;};'use strict';var _=require('lodash');var util=require(_0xb01a('0x0'));var logger=require(_0xb01a('0x1'))(_0xb01a('0x2'));var moment=require(_0xb01a('0x3'));var BPromise=require(_0xb01a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb01a('0x5'));var config=require(_0xb01a('0x6'));var attributes=require(_0xb01a('0x7'));module[_0xb01a('0x8')]=function(_0x17aae1,_0x548e0a){return _0x17aae1[_0xb01a('0x9')](_0xb01a('0xa'),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 a471bfd..4baa0ff 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 _0xb2f8=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFaxAccount','FaxAccount','findAll','options','attributes','map','include','model','body','fax','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','isNil','from','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','List','Contacts','DESC','FaxApplication','Applications','get','applications','list','orderBy','priority','asc','length','ListId','CmContact','create','FaxInteraction','spread','autoclose','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','UserId','User','name','unshift','agent','waitForTheAssignedAgent','startRouting','Start','lodash','util','moment'];(function(_0x31b99a,_0x136733){var _0x5399cc=function(_0x5d2fc0){while(--_0x5d2fc0){_0x31b99a['push'](_0x31b99a['shift']());}};_0x5399cc(++_0x136733);}(_0xb2f8,0xb3));var _0x8b2f=function(_0x420d8d,_0x78b67f){_0x420d8d=_0x420d8d-0x0;var _0x4865d7=_0xb2f8[_0x420d8d];return _0x4865d7;};'use strict';var _=require(_0x8b2f('0x0'));var util=require(_0x8b2f('0x1'));var moment=require(_0x8b2f('0x2'));var BPromise=require(_0x8b2f('0x3'));var rs=require(_0x8b2f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8b2f('0x5'))['db'];var utils=require(_0x8b2f('0x6'));var logger=require(_0x8b2f('0x7'))(_0x8b2f('0x8'));var config=require(_0x8b2f('0x9'));var jayson=require(_0x8b2f('0xa'));var client=jayson[_0x8b2f('0xb')][_0x8b2f('0xc')]({'port':0x232c});config[_0x8b2f('0xd')]=_[_0x8b2f('0xe')](config[_0x8b2f('0xd')],{'host':_0x8b2f('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8b2f('0xd')]));require(_0x8b2f('0x10'))[_0x8b2f('0x11')](socket);function respondWithRpcPromise(_0x5bfdf3,_0xefcaf9,_0x19fa4a){return new BPromise(function(_0x458fdc,_0x3c5100){return client[_0x8b2f('0x12')](_0x5bfdf3,_0x19fa4a)[_0x8b2f('0x13')](function(_0x4c87f2){logger[_0x8b2f('0x14')](_0x8b2f('0x15'),_0xefcaf9,_0x8b2f('0x16'));logger[_0x8b2f('0x17')](_0x8b2f('0x18'),_0xefcaf9,_0x8b2f('0x16'),JSON[_0x8b2f('0x19')](_0x4c87f2));if(_0x4c87f2[_0x8b2f('0x1a')]){if(_0x4c87f2[_0x8b2f('0x1a')][_0x8b2f('0x1b')]===0x1f4){logger[_0x8b2f('0x1a')](_0x8b2f('0x15'),_0xefcaf9,_0x4c87f2[_0x8b2f('0x1a')][_0x8b2f('0x1c')]);return _0x3c5100(_0x4c87f2[_0x8b2f('0x1a')]['message']);}logger[_0x8b2f('0x1a')](_0x8b2f('0x15'),_0xefcaf9,_0x4c87f2[_0x8b2f('0x1a')][_0x8b2f('0x1c')]);return _0x458fdc(_0x4c87f2[_0x8b2f('0x1a')]['message']);}else{logger[_0x8b2f('0x14')](_0x8b2f('0x15'),_0xefcaf9,'request\x20sent');_0x458fdc(_0x4c87f2[_0x8b2f('0x1d')][_0x8b2f('0x1c')]);}})[_0x8b2f('0x1e')](function(_0x56aea9){logger[_0x8b2f('0x1a')](_0x8b2f('0x15'),_0xefcaf9,_0x56aea9);_0x3c5100(_0x56aea9);});});}exports[_0x8b2f('0x1f')]=function(_0x7ca4bc){var _0xdf4fef=this;return new Promise(function(_0x2ab04f,_0x4cea9e){return db[_0x8b2f('0x20')][_0x8b2f('0x21')]({'raw':_0x7ca4bc[_0x8b2f('0x22')]?_0x7ca4bc['options']['raw']===undefined?!![]:![]:!![],'where':_0x7ca4bc['options']?_0x7ca4bc[_0x8b2f('0x22')]['where']||null:null,'attributes':_0x7ca4bc[_0x8b2f('0x22')]?_0x7ca4bc[_0x8b2f('0x22')][_0x8b2f('0x23')]||null:null,'limit':_0x7ca4bc['options']?_0x7ca4bc[_0x8b2f('0x22')]['limit']||null:null,'include':_0x7ca4bc[_0x8b2f('0x22')]?_0x7ca4bc[_0x8b2f('0x22')]['include']?_[_0x8b2f('0x24')](_0x7ca4bc[_0x8b2f('0x22')][_0x8b2f('0x25')],function(_0x84f06d){return{'model':db[_0x84f06d[_0x8b2f('0x26')]],'as':_0x84f06d['as'],'attributes':_0x84f06d[_0x8b2f('0x23')],'include':_0x84f06d[_0x8b2f('0x25')]?_[_0x8b2f('0x24')](_0x84f06d[_0x8b2f('0x25')],function(_0x31008d){return{'model':db[_0x31008d[_0x8b2f('0x26')]],'as':_0x31008d['as'],'attributes':_0x31008d[_0x8b2f('0x23')],'include':_0x31008d['include']?_[_0x8b2f('0x24')](_0x31008d['include'],function(_0x3f6fab){return{'model':db[_0x3f6fab[_0x8b2f('0x26')]],'as':_0x3f6fab['as'],'attributes':_0x3f6fab[_0x8b2f('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x90eb51){logger[_0x8b2f('0x14')](_0x8b2f('0x1f'),_0x7ca4bc);logger[_0x8b2f('0x17')](_0x8b2f('0x1f'),_0x7ca4bc,JSON[_0x8b2f('0x19')](_0x90eb51));_0x2ab04f(_0x90eb51);})[_0x8b2f('0x1e')](function(_0x5677d8){logger[_0x8b2f('0x1a')](_0x8b2f('0x1f'),_0x5677d8[_0x8b2f('0x1c')],_0x7ca4bc);_0x4cea9e(_0xdf4fef[_0x8b2f('0x1a')](0x1f4,_0x5677d8['message']));});});};exports['NotifyFaxAccount']=function(_0x391a52,_0x207283,_0x4d19a2){var _0x3c91b1=this;return new Promise(function(_0x576fd9,_0x2c966b){var _0x21a573={'body':_0x391a52[_0x8b2f('0x27')],'channel':_0x8b2f('0x28')};var _0x3e0034=[];var _0x308885=[];var _0x956a54={};return db['CmContact'][_0x8b2f('0x29')]()[_0x8b2f('0x13')](function(_0x424193){if(!_0x424193){throw new db[(_0x8b2f('0x2a'))][(_0x8b2f('0x2b'))](_0x8b2f('0x2c'));}_0x3e0034=_[_0x8b2f('0x2d')](_[_0x8b2f('0x2e')](_0x424193),[_0x8b2f('0x2f'),_0x8b2f('0x30')]);_0x308885=_['difference'](_['keys'](_0x424193),['createdAt',_0x8b2f('0x30'),_0x8b2f('0x31'),'ListId']);if(_0x391a52[_0x8b2f('0x27')]['id']){delete _0x391a52[_0x8b2f('0x27')]['id'];}if(_[_0x8b2f('0x32')](_0x391a52[_0x8b2f('0x27')][_0x8b2f('0x33')])){throw new db[(_0x8b2f('0x2a'))]['ValidationError'](_0x8b2f('0x34'));}if(_[_0x8b2f('0x32')](_0x391a52['body'][_0x8b2f('0x27')])||_0x391a52[_0x8b2f('0x27')]['body']===''){throw new db[(_0x8b2f('0x2a'))][(_0x8b2f('0x2b'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x8b2f('0x32')](_0x391a52[_0x8b2f('0x27')][_0x8b2f('0x35')])){throw new db[(_0x8b2f('0x2a'))][(_0x8b2f('0x2b'))](_0x8b2f('0x36')+_0x308885);}if(!_['includes'](_0x308885,_0x391a52['body']['mapKey'])){throw new db['Sequelize']['ValidationError'](_0x8b2f('0x37')+_0x308885);}_0x956a54[_0x391a52[_0x8b2f('0x27')][_0x8b2f('0x35')]]=_0x391a52[_0x8b2f('0x27')]['from'];})[_0x8b2f('0x13')](function(){return db[_0x8b2f('0x20')][_0x8b2f('0x38')]({'where':{'id':_0x391a52[_0x8b2f('0x39')]['id']},'include':[{'model':db[_0x8b2f('0x3a')],'as':_0x8b2f('0x3b'),'include':[{'model':db['CmContact'],'as':_0x8b2f('0x3c'),'where':_0x956a54,'limit':0x1,'order':[[_0x8b2f('0x30'),_0x8b2f('0x3d')]]}]},{'model':db[_0x8b2f('0x3e')],'as':_0x8b2f('0x3f')}]});})['then'](function(_0x4b65e0){if(_0x4b65e0&&_0x4b65e0['List']){var _0x3cd05e=_0x4b65e0[_0x8b2f('0x40')]({'plain':!![]});_0x21a573[_0x8b2f('0x39')]=_0x3cd05e;_0x21a573[_0x8b2f('0x41')]=_0x3cd05e[_0x8b2f('0x3f')];_0x21a573[_0x8b2f('0x42')]=_0x3cd05e['List'];_0x21a573[_0x8b2f('0x41')]=_[_0x8b2f('0x43')](_0x21a573[_0x8b2f('0x41')],[_0x8b2f('0x44')],[_0x8b2f('0x45')]);if(_0x21a573[_0x8b2f('0x39')]['Applications']){delete _0x21a573['account']['Applications'];}if(_0x21a573['account'][_0x8b2f('0x3b')]&&_0x21a573['account'][_0x8b2f('0x3b')][_0x8b2f('0x3c')][_0x8b2f('0x46')]){return _0x21a573[_0x8b2f('0x39')]['List'][_0x8b2f('0x3c')][0x0];}var _0x2ff44c=_[_0x8b2f('0xe')](_0x391a52[_0x8b2f('0x27')],{'firstName':_0x391a52[_0x8b2f('0x27')]['from'],'ListId':_0x3cd05e[_0x8b2f('0x47')]});_0x2ff44c[_0x391a52[_0x8b2f('0x27')][_0x8b2f('0x35')]]=_0x391a52[_0x8b2f('0x27')]['from'];return db[_0x8b2f('0x48')][_0x8b2f('0x49')](_0x2ff44c,{'fields':_0x3e0034,'raw':!![]});}})[_0x8b2f('0x13')](function(_0x209f64){_0x21a573['contact']=_0x209f64;if(_0x209f64){var _0x3afcba={'ContactId':_0x209f64['id'],'FaxAccountId':_0x391a52[_0x8b2f('0x39')]['id'],'fax':_0x209f64[_0x8b2f('0x28')]};return db[_0x8b2f('0x4a')][_0x8b2f('0x38')]({'where':{'ContactId':_0x209f64['id'],'closed':![],'FaxAccountId':_0x391a52['account']['id']}})[_0x8b2f('0x13')](function(_0x4a9d4e){if(_0x4a9d4e){return[_0x4a9d4e,![]];}return db[_0x8b2f('0x4a')][_0x8b2f('0x49')](_0x3afcba)[_0x8b2f('0x13')](function(_0x26e89d){return[_0x26e89d,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x8b2f('0x4b')](function(_0x5f168b,_0x5f1b0c){var _0x82155d=_0x5f168b[_0x8b2f('0x40')]({'plain':!![]});if(_0x5f1b0c){if(_0x21a573['account'][_0x8b2f('0x4c')]){_0x21a573[_0x8b2f('0x41')]['push']({'id':0x0,'priority':_0x21a573[_0x8b2f('0x41')][_0x8b2f('0x46')]+0x1,'app':_0x8b2f('0x4d'),'appdata':_0x8b2f('0x4e'),'interval':_0x8b2f('0x4f')});}_0x82155d['created']=!![];}else{_0x82155d[_0x8b2f('0x50')]=![];}_0x21a573[_0x8b2f('0x51')]=_0x82155d;return db[_0x8b2f('0x52')][_0x8b2f('0x49')]({'body':_0x391a52[_0x8b2f('0x27')]['body'],'FaxAccountId':_0x391a52['account']['id'],'FaxInteractionId':_0x5f168b['id'],'direction':'in','ContactId':_0x5f168b['ContactId'],'AttachmentId':_0x391a52[_0x8b2f('0x27')]['AttachmentId']});})[_0x8b2f('0x13')](function(_0x2b1f81){_0x21a573[_0x8b2f('0x1c')]=_0x2b1f81;if(_0x21a573[_0x8b2f('0x51')][_0x8b2f('0x53')]){return db[_0x8b2f('0x54')][_0x8b2f('0x38')]({'attributes':['id',_0x8b2f('0x55')],'where':{'id':_0x21a573[_0x8b2f('0x51')][_0x8b2f('0x53')]}})[_0x8b2f('0x13')](function(_0x116faf){if(_0x116faf){_0x21a573['applications'][_0x8b2f('0x56')]({'id':0x0,'priority':0x0,'app':_0x8b2f('0x57'),'appdata':_0x116faf['name']+','+(_0x21a573[_0x8b2f('0x39')][_0x8b2f('0x58')]||0xa),'interval':_0x8b2f('0x4f')});}return respondWithRpcPromise('Start',_0x8b2f('0x59'),_0x21a573);});}return respondWithRpcPromise(_0x8b2f('0x5a'),'startRouting',_0x21a573);})[_0x8b2f('0x13')](function(_0x5dc157){_0x576fd9(_0x5dc157);})[_0x8b2f('0x1e')](function(_0x1b8f05){_0x2c966b(_0x3c91b1['error'](0x1f4,_0x1b8f05['message']));});});}; \ No newline at end of file +var _0x9a9f=['CompanyId','ListId','from','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','find','account','CmList','List','updatedAt','get','applications','Applications','orderBy','priority','asc','Contacts','length','defaults','create','contact','FaxInteraction','Contact\x20not\x20found','push','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','AttachmentId','UserId','User','unshift','agent','name','Start','startRouting','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','register','request','then','info','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','GetFaxAccount','FaxAccount','findAll','options','raw','where','attributes','limit','include','map','model','NotifyFaxAccount','body','fax','CmContact','describe','Sequelize','ValidationError','difference','keys','createdAt'];(function(_0x49c68e,_0x1c1673){var _0x33032b=function(_0x42ac31){while(--_0x42ac31){_0x49c68e['push'](_0x49c68e['shift']());}};_0x33032b(++_0x1c1673);}(_0x9a9f,0x82));var _0xf9a9=function(_0x38b1bf,_0x4632b2){_0x38b1bf=_0x38b1bf-0x0;var _0x2bd954=_0x9a9f[_0x38b1bf];return _0x2bd954;};'use strict';var _=require(_0xf9a9('0x0'));var util=require(_0xf9a9('0x1'));var moment=require(_0xf9a9('0x2'));var BPromise=require(_0xf9a9('0x3'));var rs=require(_0xf9a9('0x4'));var fs=require('fs');var Redis=require(_0xf9a9('0x5'));var db=require(_0xf9a9('0x6'))['db'];var utils=require(_0xf9a9('0x7'));var logger=require(_0xf9a9('0x8'))(_0xf9a9('0x9'));var config=require(_0xf9a9('0xa'));var jayson=require(_0xf9a9('0xb'));var client=jayson['client'][_0xf9a9('0xc')]({'port':0x232c});config[_0xf9a9('0xd')]=_['defaults'](config['redis'],{'host':_0xf9a9('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf9a9('0xd')]));require('./faxAccount.socket')[_0xf9a9('0xf')](socket);function respondWithRpcPromise(_0x1c65ab,_0x2e97fe,_0x2262cf){return new BPromise(function(_0x18867c,_0x4071f9){return client[_0xf9a9('0x10')](_0x1c65ab,_0x2262cf)[_0xf9a9('0x11')](function(_0x13575a){logger[_0xf9a9('0x12')](_0xf9a9('0x13'),_0x2e97fe,'request\x20sent');logger[_0xf9a9('0x14')](_0xf9a9('0x15'),_0x2e97fe,'request\x20sent',JSON[_0xf9a9('0x16')](_0x13575a));if(_0x13575a[_0xf9a9('0x17')]){if(_0x13575a[_0xf9a9('0x17')]['code']===0x1f4){logger[_0xf9a9('0x17')](_0xf9a9('0x13'),_0x2e97fe,_0x13575a[_0xf9a9('0x17')][_0xf9a9('0x18')]);return _0x4071f9(_0x13575a[_0xf9a9('0x17')][_0xf9a9('0x18')]);}logger['error'](_0xf9a9('0x13'),_0x2e97fe,_0x13575a[_0xf9a9('0x17')][_0xf9a9('0x18')]);return _0x18867c(_0x13575a['error']['message']);}else{logger[_0xf9a9('0x12')](_0xf9a9('0x13'),_0x2e97fe,_0xf9a9('0x19'));_0x18867c(_0x13575a[_0xf9a9('0x1a')][_0xf9a9('0x18')]);}})['catch'](function(_0x2c91b8){logger[_0xf9a9('0x17')](_0xf9a9('0x13'),_0x2e97fe,_0x2c91b8);_0x4071f9(_0x2c91b8);});});}exports[_0xf9a9('0x1b')]=function(_0x41c110){var _0x494404=this;return new Promise(function(_0x5c3e9b,_0x15f584){return db[_0xf9a9('0x1c')][_0xf9a9('0x1d')]({'raw':_0x41c110['options']?_0x41c110[_0xf9a9('0x1e')][_0xf9a9('0x1f')]===undefined?!![]:![]:!![],'where':_0x41c110[_0xf9a9('0x1e')]?_0x41c110['options'][_0xf9a9('0x20')]||null:null,'attributes':_0x41c110[_0xf9a9('0x1e')]?_0x41c110[_0xf9a9('0x1e')][_0xf9a9('0x21')]||null:null,'limit':_0x41c110[_0xf9a9('0x1e')]?_0x41c110[_0xf9a9('0x1e')][_0xf9a9('0x22')]||null:null,'include':_0x41c110[_0xf9a9('0x1e')]?_0x41c110['options'][_0xf9a9('0x23')]?_[_0xf9a9('0x24')](_0x41c110['options'][_0xf9a9('0x23')],function(_0x5966f8){return{'model':db[_0x5966f8[_0xf9a9('0x25')]],'as':_0x5966f8['as'],'attributes':_0x5966f8[_0xf9a9('0x21')],'include':_0x5966f8[_0xf9a9('0x23')]?_[_0xf9a9('0x24')](_0x5966f8[_0xf9a9('0x23')],function(_0x3affb9){return{'model':db[_0x3affb9[_0xf9a9('0x25')]],'as':_0x3affb9['as'],'attributes':_0x3affb9[_0xf9a9('0x21')],'include':_0x3affb9['include']?_['map'](_0x3affb9['include'],function(_0x23945f){return{'model':db[_0x23945f[_0xf9a9('0x25')]],'as':_0x23945f['as'],'attributes':_0x23945f['attributes']};}):[]};}):[]};}):[]:[]})[_0xf9a9('0x11')](function(_0x58b6ef){logger[_0xf9a9('0x12')](_0xf9a9('0x1b'),_0x41c110);logger[_0xf9a9('0x14')](_0xf9a9('0x1b'),_0x41c110,JSON[_0xf9a9('0x16')](_0x58b6ef));_0x5c3e9b(_0x58b6ef);})['catch'](function(_0x300062){logger[_0xf9a9('0x17')](_0xf9a9('0x1b'),_0x300062[_0xf9a9('0x18')],_0x41c110);_0x15f584(_0x494404[_0xf9a9('0x17')](0x1f4,_0x300062['message']));});});};exports[_0xf9a9('0x26')]=function(_0xcb04d3,_0x17db27,_0x1aa994){var _0x1fa5c5=this;return new Promise(function(_0x3c1306,_0x47ed62){var _0x3df401={'body':_0xcb04d3[_0xf9a9('0x27')],'channel':_0xf9a9('0x28')};var _0x33e02c=[];var _0x570bee=[];var _0x57b05a={};return db[_0xf9a9('0x29')][_0xf9a9('0x2a')]()[_0xf9a9('0x11')](function(_0xf613b4){if(!_0xf613b4){throw new db[(_0xf9a9('0x2b'))][(_0xf9a9('0x2c'))]('no\x20available\x20attributes');}_0x33e02c=_[_0xf9a9('0x2d')](_[_0xf9a9('0x2e')](_0xf613b4),[_0xf9a9('0x2f'),'updatedAt']);_0x570bee=_['difference'](_[_0xf9a9('0x2e')](_0xf613b4),[_0xf9a9('0x2f'),'updatedAt',_0xf9a9('0x30'),_0xf9a9('0x31')]);if(_0xcb04d3[_0xf9a9('0x27')]['id']){delete _0xcb04d3[_0xf9a9('0x27')]['id'];}if(_['isNil'](_0xcb04d3[_0xf9a9('0x27')][_0xf9a9('0x32')])){throw new db[(_0xf9a9('0x2b'))][(_0xf9a9('0x2c'))](_0xf9a9('0x33'));}if(_[_0xf9a9('0x34')](_0xcb04d3[_0xf9a9('0x27')]['body'])||_0xcb04d3[_0xf9a9('0x27')]['body']===''){throw new db[(_0xf9a9('0x2b'))]['ValidationError'](_0xf9a9('0x35'));}if(_['isNil'](_0xcb04d3[_0xf9a9('0x27')][_0xf9a9('0x36')])){throw new db['Sequelize'][(_0xf9a9('0x2c'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x570bee);}if(!_['includes'](_0x570bee,_0xcb04d3[_0xf9a9('0x27')][_0xf9a9('0x36')])){throw new db[(_0xf9a9('0x2b'))][(_0xf9a9('0x2c'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x570bee);}_0x57b05a[_0xcb04d3[_0xf9a9('0x27')][_0xf9a9('0x36')]]=_0xcb04d3[_0xf9a9('0x27')][_0xf9a9('0x32')];})['then'](function(){return db[_0xf9a9('0x1c')][_0xf9a9('0x37')]({'where':{'id':_0xcb04d3[_0xf9a9('0x38')]['id']},'include':[{'model':db[_0xf9a9('0x39')],'as':_0xf9a9('0x3a'),'include':[{'model':db[_0xf9a9('0x29')],'as':'Contacts','where':_0x57b05a,'limit':0x1,'order':[[_0xf9a9('0x3b'),'DESC']]}]},{'model':db['FaxApplication'],'as':'Applications'}]});})[_0xf9a9('0x11')](function(_0x4b844a){if(_0x4b844a&&_0x4b844a['List']){var _0x41e7a1=_0x4b844a[_0xf9a9('0x3c')]({'plain':!![]});_0x3df401['account']=_0x41e7a1;_0x3df401[_0xf9a9('0x3d')]=_0x41e7a1[_0xf9a9('0x3e')];_0x3df401['list']=_0x41e7a1['List'];_0x3df401[_0xf9a9('0x3d')]=_[_0xf9a9('0x3f')](_0x3df401['applications'],[_0xf9a9('0x40')],[_0xf9a9('0x41')]);if(_0x3df401[_0xf9a9('0x38')][_0xf9a9('0x3e')]){delete _0x3df401[_0xf9a9('0x38')][_0xf9a9('0x3e')];}if(_0x3df401[_0xf9a9('0x38')][_0xf9a9('0x3a')]&&_0x3df401[_0xf9a9('0x38')][_0xf9a9('0x3a')][_0xf9a9('0x42')][_0xf9a9('0x43')]){return _0x3df401[_0xf9a9('0x38')]['List']['Contacts'][0x0];}var _0x3328f0=_[_0xf9a9('0x44')](_0xcb04d3[_0xf9a9('0x27')],{'firstName':_0xcb04d3[_0xf9a9('0x27')][_0xf9a9('0x32')],'ListId':_0x41e7a1[_0xf9a9('0x31')]});_0x3328f0[_0xcb04d3[_0xf9a9('0x27')][_0xf9a9('0x36')]]=_0xcb04d3[_0xf9a9('0x27')][_0xf9a9('0x32')];return db[_0xf9a9('0x29')][_0xf9a9('0x45')](_0x3328f0,{'fields':_0x33e02c,'raw':!![]});}})[_0xf9a9('0x11')](function(_0x8fec46){_0x3df401[_0xf9a9('0x46')]=_0x8fec46;if(_0x8fec46){var _0x4a8ac0={'ContactId':_0x8fec46['id'],'FaxAccountId':_0xcb04d3[_0xf9a9('0x38')]['id'],'fax':_0x8fec46['fax']};return db['FaxInteraction'][_0xf9a9('0x37')]({'where':{'ContactId':_0x8fec46['id'],'closed':![],'FaxAccountId':_0xcb04d3[_0xf9a9('0x38')]['id']}})[_0xf9a9('0x11')](function(_0x19363f){if(_0x19363f){return[_0x19363f,![]];}return db[_0xf9a9('0x47')][_0xf9a9('0x45')](_0x4a8ac0)[_0xf9a9('0x11')](function(_0x3d175a){return[_0x3d175a,!![]];});});}else{throw new Error(_0xf9a9('0x48'));}})['spread'](function(_0x51489b,_0x202b7b){var _0x43e089=_0x51489b['get']({'plain':!![]});if(_0x202b7b){if(_0x3df401[_0xf9a9('0x38')]['autoclose']){_0x3df401[_0xf9a9('0x3d')][_0xf9a9('0x49')]({'id':0x0,'priority':_0x3df401[_0xf9a9('0x3d')]['length']+0x1,'app':_0xf9a9('0x4a'),'appdata':_0xf9a9('0x4b'),'interval':_0xf9a9('0x4c')});}_0x43e089[_0xf9a9('0x4d')]=!![];}else{_0x43e089['created']=![];}_0x3df401[_0xf9a9('0x4e')]=_0x43e089;return db[_0xf9a9('0x4f')][_0xf9a9('0x45')]({'body':_0xcb04d3[_0xf9a9('0x27')]['body'],'FaxAccountId':_0xcb04d3['account']['id'],'FaxInteractionId':_0x51489b['id'],'direction':'in','ContactId':_0x51489b['ContactId'],'AttachmentId':_0xcb04d3['body'][_0xf9a9('0x50')]});})[_0xf9a9('0x11')](function(_0x31da30){_0x3df401[_0xf9a9('0x18')]=_0x31da30;if(_0x3df401[_0xf9a9('0x4e')][_0xf9a9('0x51')]){return db[_0xf9a9('0x52')][_0xf9a9('0x37')]({'attributes':['id','name'],'where':{'id':_0x3df401['interaction'][_0xf9a9('0x51')]}})[_0xf9a9('0x11')](function(_0x56ac45){if(_0x56ac45){_0x3df401[_0xf9a9('0x3d')][_0xf9a9('0x53')]({'id':0x0,'priority':0x0,'app':_0xf9a9('0x54'),'appdata':_0x56ac45[_0xf9a9('0x55')]+','+(_0x3df401['account']['waitForTheAssignedAgent']||0xa),'interval':_0xf9a9('0x4c')});}return respondWithRpcPromise(_0xf9a9('0x56'),_0xf9a9('0x57'),_0x3df401);});}return respondWithRpcPromise(_0xf9a9('0x56'),_0xf9a9('0x57'),_0x3df401);})['then'](function(_0x28e49a){_0x3c1306(_0x28e49a);})[_0xf9a9('0x58')](function(_0x131aef){_0x47ed62(_0x1fa5c5[_0xf9a9('0x17')](0x1f4,_0x131aef[_0xf9a9('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 8619a52..7f6ee6a 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 _0xdfe1=['length','save','remove','emit','removeListener','register'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xdfe1,0x103));var _0x1dfe=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xdfe1[_0x14add3];return _0x4a174f;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=[_0x1dfe('0x0'),_0x1dfe('0x1'),'update'];function createListener(_0x17488c,_0x52a2d2){return function(_0x1dbe5e){_0x52a2d2[_0x1dfe('0x2')](_0x17488c,_0x1dbe5e);};}function removeListener(_0x864a73,_0x1e54bf){return function(){FaxAccountEvents[_0x1dfe('0x3')](_0x864a73,_0x1e54bf);};}exports[_0x1dfe('0x4')]=function(_0x43eed0){for(var _0x4c711c=0x0,_0x49fbb1=events[_0x1dfe('0x5')];_0x4c711c<_0x49fbb1;_0x4c711c++){var _0x4a6b09=events[_0x4c711c];var _0x526660=createListener('faxAccount:'+_0x4a6b09,_0x43eed0);FaxAccountEvents['on'](_0x4a6b09,_0x526660);}}; \ No newline at end of file +var _0xc577=['register','length','faxAccount:','save','remove','update','removeListener'];(function(_0x401c21,_0x2e16d5){var _0x1a320e=function(_0x48065e){while(--_0x48065e){_0x401c21['push'](_0x401c21['shift']());}};_0x1a320e(++_0x2e16d5);}(_0xc577,0x1a0));var _0x7c57=function(_0xa1f5c4,_0x247496){_0xa1f5c4=_0xa1f5c4-0x0;var _0x3f2f74=_0xc577[_0xa1f5c4];return _0x3f2f74;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=[_0x7c57('0x0'),_0x7c57('0x1'),_0x7c57('0x2')];function createListener(_0x285835,_0x59d63f){return function(_0x45e9e8){_0x59d63f['emit'](_0x285835,_0x45e9e8);};}function removeListener(_0x52c0e1,_0x27a390){return function(){FaxAccountEvents[_0x7c57('0x3')](_0x52c0e1,_0x27a390);};}exports[_0x7c57('0x4')]=function(_0x1b631c){for(var _0x5bd644=0x0,_0x42076d=events[_0x7c57('0x5')];_0x5bd644<_0x42076d;_0x5bd644++){var _0x5786d7=events[_0x5bd644];var _0x1899c2=createListener(_0x7c57('0x6')+_0x5786d7,_0x1b631c);FaxAccountEvents['on'](_0x5786d7,_0x1899c2);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 1c0b6d1..15e4e66 100644 --- a/server/api/faxAccount/index.js +++ b/server/api/faxAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x210718,_0x247b55){var _0x541bfc=function(_0x5dbcad){while(--_0x5dbcad){_0x210718['push'](_0x210718['shift']());}};_0x541bfc(++_0x247b55);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x184772,_0x169901){var _0x27b6fa=function(_0x48480d){while(--_0x48480d){_0x184772['push'](_0x184772['shift']());}};_0x27b6fa(++_0x169901);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index a7e8fca..32574cb 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 _0x650a=['INTEGER','STRING','noop','*,*,*,*','sequelize','exports'];(function(_0x3a544a,_0x73a217){var _0x342f1e=function(_0x519dce){while(--_0x519dce){_0x3a544a['push'](_0x3a544a['shift']());}};_0x342f1e(++_0x73a217);}(_0x650a,0x1ba));var _0xa650=function(_0x3910c6,_0x4625a2){_0x3910c6=_0x3910c6-0x0;var _0x28a833=_0x650a[_0x3910c6];return _0x28a833;};'use strict';var Sequelize=require(_0xa650('0x0'));module[_0xa650('0x1')]={'priority':{'type':Sequelize[_0xa650('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xa650('0x3')],'allowNull':![],'defaultValue':_0xa650('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xa650('0x3')]},'interval':{'type':Sequelize[_0xa650('0x3')],'defaultValue':_0xa650('0x5')}}; \ No newline at end of file +var _0x3313=['INTEGER','STRING','TEXT','exports'];(function(_0x322e29,_0xb046ec){var _0xb308dd=function(_0x49a46b){while(--_0x49a46b){_0x322e29['push'](_0x322e29['shift']());}};_0xb308dd(++_0xb046ec);}(_0x3313,0x19f));var _0x3331=function(_0x11b552,_0x35d33d){_0x11b552=_0x11b552-0x0;var _0x29ffd1=_0x3313[_0x11b552];return _0x29ffd1;};'use strict';var Sequelize=require('sequelize');module[_0x3331('0x0')]={'priority':{'type':Sequelize[_0x3331('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x3331('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x3331('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x3331('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 8afa937..0585064 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 _0xdc18=['fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','rows','params','options','find','catch','create','body','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','apply','save','then','destroy','error','name','send','index','map','FaxApplication','rawAttributes','type','query','keys','filters','intersection','model','attributes'];(function(_0x44689f,_0x1fb85f){var _0x5379fd=function(_0x1957c5){while(--_0x1957c5){_0x44689f['push'](_0x44689f['shift']());}};_0x5379fd(++_0x1fb85f);}(_0xdc18,0x9b));var _0x8dc1=function(_0x6f00bc,_0x1162a4){_0x6f00bc=_0x6f00bc-0x0;var _0x28511f=_0xdc18[_0x6f00bc];return _0x28511f;};'use strict';var emlformat=require(_0x8dc1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8dc1('0x1'));var jsonpatch=require(_0x8dc1('0x2'));var rp=require(_0x8dc1('0x3'));var moment=require('moment');var BPromise=require(_0x8dc1('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8dc1('0x5'));var sox=require(_0x8dc1('0x6'));var csv=require(_0x8dc1('0x7'));var ejs=require(_0x8dc1('0x8'));var fs=require('fs');var fs_extra=require(_0x8dc1('0x9'));var _=require(_0x8dc1('0xa'));var squel=require(_0x8dc1('0xb'));var crypto=require(_0x8dc1('0xc'));var jsforce=require(_0x8dc1('0xd'));var deskjs=require(_0x8dc1('0xe'));var toCsv=require(_0x8dc1('0x7'));var querystring=require(_0x8dc1('0xf'));var Papa=require(_0x8dc1('0x10'));var Redis=require(_0x8dc1('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8dc1('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8dc1('0x13'))(_0x8dc1('0x14'));var utils=require('../../config/utils');var config=require(_0x8dc1('0x15'));var licenseUtil=require(_0x8dc1('0x16'));var db=require(_0x8dc1('0x17'))['db'];function respondWithStatusCode(_0x4cc83a,_0x10f1fb){_0x10f1fb=_0x10f1fb||0xcc;return function(_0x1ac88e){if(_0x1ac88e){return _0x4cc83a[_0x8dc1('0x18')](_0x10f1fb);}return _0x4cc83a[_0x8dc1('0x19')](_0x10f1fb)['end']();};}function respondWithResult(_0x13e4ee,_0x135154){_0x135154=_0x135154||0xc8;return function(_0x49658a){if(_0x49658a){return _0x13e4ee[_0x8dc1('0x19')](_0x135154)[_0x8dc1('0x1a')](_0x49658a);}};}function respondWithFilteredResult(_0x59540e,_0x5bc12c){return function(_0x1083a6){if(_0x1083a6){var _0xed520d=typeof _0x5bc12c[_0x8dc1('0x1b')]===_0x8dc1('0x1c')&&typeof _0x5bc12c[_0x8dc1('0x1d')]===_0x8dc1('0x1c');var _0xe6885=_0x1083a6[_0x8dc1('0x1e')];var _0x4cc2d9=_0xed520d?0x0:_0x5bc12c[_0x8dc1('0x1b')];var _0x14f6a2=_0xed520d?_0x1083a6[_0x8dc1('0x1e')]:_0x5bc12c[_0x8dc1('0x1b')]+_0x5bc12c[_0x8dc1('0x1d')];var _0x490d0a;if(_0x14f6a2>=_0xe6885){_0x14f6a2=_0xe6885;_0x490d0a=0xc8;}else{_0x490d0a=0xce;}_0x59540e[_0x8dc1('0x19')](_0x490d0a);return _0x59540e['set']('Content-Range',_0x4cc2d9+'-'+_0x14f6a2+'/'+_0xe6885)[_0x8dc1('0x1a')](_0x1083a6);}return null;};}function patchUpdates(_0x4de5ec){return function(_0x5b58f0){try{jsonpatch[_0x8dc1('0x1f')](_0x5b58f0,_0x4de5ec,!![]);}catch(_0x4435f8){return BPromise['reject'](_0x4435f8);}return _0x5b58f0[_0x8dc1('0x20')]();};}function saveUpdates(_0x275dd6,_0x1a892d){return function(_0x595e09){if(_0x595e09){return _0x595e09['update'](_0x275dd6)[_0x8dc1('0x21')](function(_0x4e188d){return _0x4e188d;});}return null;};}function removeEntity(_0x444eb3,_0x275b2b){return function(_0x31f977){if(_0x31f977){return _0x31f977[_0x8dc1('0x22')]()[_0x8dc1('0x21')](function(){_0x444eb3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c3b9f,_0x5ec23d){return function(_0x419863){if(!_0x419863){_0x2c3b9f['sendStatus'](0x194);}return _0x419863;};}function handleError(_0x340554,_0x281bb7){_0x281bb7=_0x281bb7||0x1f4;return function(_0x4a4f17){logger[_0x8dc1('0x23')](_0x4a4f17['stack']);if(_0x4a4f17[_0x8dc1('0x24')]){delete _0x4a4f17['name'];}_0x340554[_0x8dc1('0x19')](_0x281bb7)[_0x8dc1('0x25')](_0x4a4f17);};}exports[_0x8dc1('0x26')]=function(_0x167613,_0x46132d){var _0x4540ff={},_0x4c509f={},_0x5031c2={'count':0x0,'rows':[]};var _0xce1410=_[_0x8dc1('0x27')](db[_0x8dc1('0x28')][_0x8dc1('0x29')],function(_0x3caa23){return{'name':_0x3caa23['fieldName'],'type':_0x3caa23[_0x8dc1('0x2a')]['key']};});_0x4c509f['model']=_[_0x8dc1('0x27')](_0xce1410,_0x8dc1('0x24'));_0x4c509f[_0x8dc1('0x2b')]=_[_0x8dc1('0x2c')](_0x167613[_0x8dc1('0x2b')]);_0x4c509f[_0x8dc1('0x2d')]=_[_0x8dc1('0x2e')](_0x4c509f[_0x8dc1('0x2f')],_0x4c509f[_0x8dc1('0x2b')]);_0x4540ff[_0x8dc1('0x30')]=_[_0x8dc1('0x2e')](_0x4c509f[_0x8dc1('0x2f')],qs[_0x8dc1('0x31')](_0x167613['query']['fields']));_0x4540ff[_0x8dc1('0x30')]=_0x4540ff[_0x8dc1('0x30')][_0x8dc1('0x32')]?_0x4540ff[_0x8dc1('0x30')]:_0x4c509f[_0x8dc1('0x2f')];if(!_0x167613[_0x8dc1('0x2b')][_0x8dc1('0x33')](_0x8dc1('0x34'))){_0x4540ff[_0x8dc1('0x1d')]=qs['limit'](_0x167613[_0x8dc1('0x2b')][_0x8dc1('0x1d')]);_0x4540ff['offset']=qs[_0x8dc1('0x1b')](_0x167613[_0x8dc1('0x2b')][_0x8dc1('0x1b')]);}_0x4540ff[_0x8dc1('0x35')]=qs[_0x8dc1('0x36')](_0x167613[_0x8dc1('0x2b')][_0x8dc1('0x36')]);_0x4540ff[_0x8dc1('0x37')]=qs[_0x8dc1('0x2d')](_[_0x8dc1('0x38')](_0x167613[_0x8dc1('0x2b')],_0x4c509f['filters']),_0xce1410);if(_0x167613['query'][_0x8dc1('0x39')]){_0x4540ff['where']=_[_0x8dc1('0x3a')](_0x4540ff['where'],{'$or':_[_0x8dc1('0x27')](_0xce1410,function(_0x37c416){if(_0x37c416['type']!=='VIRTUAL'){var _0x268270={};_0x268270[_0x37c416['name']]={'$like':'%'+_0x167613[_0x8dc1('0x2b')][_0x8dc1('0x39')]+'%'};return _0x268270;}})});}_0x4540ff=_[_0x8dc1('0x3a')]({},_0x4540ff,_0x167613['options']);var _0x3ebcb3={'where':_0x4540ff['where']};return db[_0x8dc1('0x28')][_0x8dc1('0x1e')](_0x3ebcb3)[_0x8dc1('0x21')](function(_0x2c01ec){_0x5031c2[_0x8dc1('0x1e')]=_0x2c01ec;if(_0x167613[_0x8dc1('0x2b')][_0x8dc1('0x3b')]){_0x4540ff[_0x8dc1('0x3c')]=[{'all':!![]}];}return db[_0x8dc1('0x28')]['findAll'](_0x4540ff);})[_0x8dc1('0x21')](function(_0x45fbde){_0x5031c2[_0x8dc1('0x3d')]=_0x45fbde;return _0x5031c2;})[_0x8dc1('0x21')](respondWithFilteredResult(_0x46132d,_0x4540ff))['catch'](handleError(_0x46132d,null));};exports['show']=function(_0x2af0bf,_0x176d60){var _0x4ed937={'raw':!![],'where':{'id':_0x2af0bf[_0x8dc1('0x3e')]['id']}},_0x21fb17={};_0x21fb17[_0x8dc1('0x2f')]=_[_0x8dc1('0x2c')](db[_0x8dc1('0x28')][_0x8dc1('0x29')]);_0x21fb17[_0x8dc1('0x2b')]=_[_0x8dc1('0x2c')](_0x2af0bf[_0x8dc1('0x2b')]);_0x21fb17['filters']=_[_0x8dc1('0x2e')](_0x21fb17[_0x8dc1('0x2f')],_0x21fb17[_0x8dc1('0x2b')]);_0x4ed937[_0x8dc1('0x30')]=_['intersection'](_0x21fb17[_0x8dc1('0x2f')],qs[_0x8dc1('0x31')](_0x2af0bf['query'][_0x8dc1('0x31')]));_0x4ed937[_0x8dc1('0x30')]=_0x4ed937['attributes']['length']?_0x4ed937[_0x8dc1('0x30')]:_0x21fb17[_0x8dc1('0x2f')];if(_0x2af0bf[_0x8dc1('0x2b')][_0x8dc1('0x3b')]){_0x4ed937['include']=[{'all':!![]}];}_0x4ed937=_[_0x8dc1('0x3a')]({},_0x4ed937,_0x2af0bf[_0x8dc1('0x3f')]);return db['FaxApplication'][_0x8dc1('0x40')](_0x4ed937)[_0x8dc1('0x21')](handleEntityNotFound(_0x176d60,null))[_0x8dc1('0x21')](respondWithResult(_0x176d60,null))[_0x8dc1('0x41')](handleError(_0x176d60,null));};exports[_0x8dc1('0x42')]=function(_0x2339e8,_0x107346){return db[_0x8dc1('0x28')]['create'](_0x2339e8[_0x8dc1('0x43')],{})[_0x8dc1('0x21')](respondWithResult(_0x107346,0xc9))[_0x8dc1('0x41')](handleError(_0x107346,null));};exports['update']=function(_0x17a304,_0x3b29c5){if(_0x17a304['body']['id']){delete _0x17a304[_0x8dc1('0x43')]['id'];}return db[_0x8dc1('0x28')][_0x8dc1('0x40')]({'where':{'id':_0x17a304[_0x8dc1('0x3e')]['id']}})[_0x8dc1('0x21')](handleEntityNotFound(_0x3b29c5,null))[_0x8dc1('0x21')](saveUpdates(_0x17a304['body'],null))[_0x8dc1('0x21')](respondWithResult(_0x3b29c5,null))[_0x8dc1('0x41')](handleError(_0x3b29c5,null));};exports[_0x8dc1('0x22')]=function(_0x4d136b,_0x197fa5){return db[_0x8dc1('0x28')][_0x8dc1('0x40')]({'where':{'id':_0x4d136b[_0x8dc1('0x3e')]['id']}})[_0x8dc1('0x21')](handleEntityNotFound(_0x197fa5,null))[_0x8dc1('0x21')](removeEntity(_0x197fa5,null))[_0x8dc1('0x41')](handleError(_0x197fa5,null));}; \ No newline at end of file +var _0x1072=['set','apply','save','update','end','error','name','index','map','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','then','includeAll','include','FaxApplication','findAll','rows','show','params','rawAttributes','find','catch','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset'];(function(_0x5ba74f,_0x200bf4){var _0x534d79=function(_0x50521a){while(--_0x50521a){_0x5ba74f['push'](_0x5ba74f['shift']());}};_0x534d79(++_0x200bf4);}(_0x1072,0x1a3));var _0x2107=function(_0xb24a3e,_0x4a3594){_0xb24a3e=_0xb24a3e-0x0;var _0x4038d7=_0x1072[_0xb24a3e];return _0x4038d7;};'use strict';var emlformat=require(_0x2107('0x0'));var rimraf=require(_0x2107('0x1'));var zipdir=require(_0x2107('0x2'));var jsonpatch=require(_0x2107('0x3'));var rp=require(_0x2107('0x4'));var moment=require(_0x2107('0x5'));var BPromise=require(_0x2107('0x6'));var Mustache=require(_0x2107('0x7'));var util=require(_0x2107('0x8'));var path=require(_0x2107('0x9'));var sox=require(_0x2107('0xa'));var csv=require(_0x2107('0xb'));var ejs=require(_0x2107('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2107('0xd'));var squel=require(_0x2107('0xe'));var crypto=require(_0x2107('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x2107('0x10'));var toCsv=require(_0x2107('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2107('0x11'));var authService=require(_0x2107('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2107('0x13'))(_0x2107('0x14'));var utils=require(_0x2107('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2107('0x16'));var db=require(_0x2107('0x17'))['db'];function respondWithStatusCode(_0x4f5938,_0x507354){_0x507354=_0x507354||0xcc;return function(_0x555ec0){if(_0x555ec0){return _0x4f5938[_0x2107('0x18')](_0x507354);}return _0x4f5938[_0x2107('0x19')](_0x507354)['end']();};}function respondWithResult(_0x5bf6f7,_0x1b3bcc){_0x1b3bcc=_0x1b3bcc||0xc8;return function(_0x40c301){if(_0x40c301){return _0x5bf6f7[_0x2107('0x19')](_0x1b3bcc)[_0x2107('0x1a')](_0x40c301);}};}function respondWithFilteredResult(_0x3273e3,_0x1defe1){return function(_0x2a22bb){if(_0x2a22bb){var _0x2545e3=typeof _0x1defe1['offset']==='undefined'&&typeof _0x1defe1[_0x2107('0x1b')]===_0x2107('0x1c');var _0x4e1d98=_0x2a22bb[_0x2107('0x1d')];var _0x5ad362=_0x2545e3?0x0:_0x1defe1[_0x2107('0x1e')];var _0x115bbc=_0x2545e3?_0x2a22bb[_0x2107('0x1d')]:_0x1defe1[_0x2107('0x1e')]+_0x1defe1[_0x2107('0x1b')];var _0x3b602e;if(_0x115bbc>=_0x4e1d98){_0x115bbc=_0x4e1d98;_0x3b602e=0xc8;}else{_0x3b602e=0xce;}_0x3273e3[_0x2107('0x19')](_0x3b602e);return _0x3273e3[_0x2107('0x1f')]('Content-Range',_0x5ad362+'-'+_0x115bbc+'/'+_0x4e1d98)[_0x2107('0x1a')](_0x2a22bb);}return null;};}function patchUpdates(_0x1eb48f){return function(_0x123764){try{jsonpatch[_0x2107('0x20')](_0x123764,_0x1eb48f,!![]);}catch(_0x4367f7){return BPromise['reject'](_0x4367f7);}return _0x123764[_0x2107('0x21')]();};}function saveUpdates(_0x5875b5,_0x5d1c76){return function(_0x589488){if(_0x589488){return _0x589488[_0x2107('0x22')](_0x5875b5)['then'](function(_0x18ac5f){return _0x18ac5f;});}return null;};}function removeEntity(_0x277a5c,_0x465425){return function(_0x5be0d0){if(_0x5be0d0){return _0x5be0d0['destroy']()['then'](function(){_0x277a5c[_0x2107('0x19')](0xcc)[_0x2107('0x23')]();});}};}function handleEntityNotFound(_0x46aafd,_0x25b2ee){return function(_0x59e904){if(!_0x59e904){_0x46aafd[_0x2107('0x18')](0x194);}return _0x59e904;};}function handleError(_0x6884ce,_0x2d2e25){_0x2d2e25=_0x2d2e25||0x1f4;return function(_0x4530ff){logger[_0x2107('0x24')](_0x4530ff['stack']);if(_0x4530ff[_0x2107('0x25')]){delete _0x4530ff[_0x2107('0x25')];}_0x6884ce[_0x2107('0x19')](_0x2d2e25)['send'](_0x4530ff);};}exports[_0x2107('0x26')]=function(_0x215c9d,_0x4993d0){var _0x44dc3a={},_0x57b916={},_0x35b08a={'count':0x0,'rows':[]};var _0x47f727=_[_0x2107('0x27')](db['FaxApplication']['rawAttributes'],function(_0x1ad61c){return{'name':_0x1ad61c[_0x2107('0x28')],'type':_0x1ad61c[_0x2107('0x29')][_0x2107('0x2a')]};});_0x57b916[_0x2107('0x2b')]=_[_0x2107('0x27')](_0x47f727,_0x2107('0x25'));_0x57b916[_0x2107('0x2c')]=_[_0x2107('0x2d')](_0x215c9d[_0x2107('0x2c')]);_0x57b916['filters']=_[_0x2107('0x2e')](_0x57b916['model'],_0x57b916[_0x2107('0x2c')]);_0x44dc3a[_0x2107('0x2f')]=_[_0x2107('0x2e')](_0x57b916[_0x2107('0x2b')],qs[_0x2107('0x30')](_0x215c9d[_0x2107('0x2c')][_0x2107('0x30')]));_0x44dc3a[_0x2107('0x2f')]=_0x44dc3a['attributes'][_0x2107('0x31')]?_0x44dc3a['attributes']:_0x57b916[_0x2107('0x2b')];if(!_0x215c9d[_0x2107('0x2c')][_0x2107('0x32')](_0x2107('0x33'))){_0x44dc3a[_0x2107('0x1b')]=qs[_0x2107('0x1b')](_0x215c9d[_0x2107('0x2c')]['limit']);_0x44dc3a[_0x2107('0x1e')]=qs[_0x2107('0x1e')](_0x215c9d[_0x2107('0x2c')][_0x2107('0x1e')]);}_0x44dc3a[_0x2107('0x34')]=qs[_0x2107('0x35')](_0x215c9d[_0x2107('0x2c')][_0x2107('0x35')]);_0x44dc3a[_0x2107('0x36')]=qs[_0x2107('0x37')](_[_0x2107('0x38')](_0x215c9d['query'],_0x57b916[_0x2107('0x37')]),_0x47f727);if(_0x215c9d[_0x2107('0x2c')][_0x2107('0x39')]){_0x44dc3a[_0x2107('0x36')]=_[_0x2107('0x3a')](_0x44dc3a[_0x2107('0x36')],{'$or':_[_0x2107('0x27')](_0x47f727,function(_0x2b130c){if(_0x2b130c['type']!==_0x2107('0x3b')){var _0x23a32b={};_0x23a32b[_0x2b130c[_0x2107('0x25')]]={'$like':'%'+_0x215c9d[_0x2107('0x2c')][_0x2107('0x39')]+'%'};return _0x23a32b;}})});}_0x44dc3a=_[_0x2107('0x3a')]({},_0x44dc3a,_0x215c9d[_0x2107('0x3c')]);var _0x366264={'where':_0x44dc3a[_0x2107('0x36')]};return db['FaxApplication']['count'](_0x366264)[_0x2107('0x3d')](function(_0x2e48ea){_0x35b08a['count']=_0x2e48ea;if(_0x215c9d[_0x2107('0x2c')][_0x2107('0x3e')]){_0x44dc3a[_0x2107('0x3f')]=[{'all':!![]}];}return db[_0x2107('0x40')][_0x2107('0x41')](_0x44dc3a);})[_0x2107('0x3d')](function(_0xaf137b){_0x35b08a[_0x2107('0x42')]=_0xaf137b;return _0x35b08a;})[_0x2107('0x3d')](respondWithFilteredResult(_0x4993d0,_0x44dc3a))['catch'](handleError(_0x4993d0,null));};exports[_0x2107('0x43')]=function(_0x5afd28,_0x384353){var _0xb89bd={'raw':!![],'where':{'id':_0x5afd28[_0x2107('0x44')]['id']}},_0x4a8036={};_0x4a8036['model']=_[_0x2107('0x2d')](db['FaxApplication'][_0x2107('0x45')]);_0x4a8036[_0x2107('0x2c')]=_[_0x2107('0x2d')](_0x5afd28[_0x2107('0x2c')]);_0x4a8036['filters']=_[_0x2107('0x2e')](_0x4a8036[_0x2107('0x2b')],_0x4a8036['query']);_0xb89bd['attributes']=_[_0x2107('0x2e')](_0x4a8036[_0x2107('0x2b')],qs['fields'](_0x5afd28['query']['fields']));_0xb89bd[_0x2107('0x2f')]=_0xb89bd[_0x2107('0x2f')][_0x2107('0x31')]?_0xb89bd[_0x2107('0x2f')]:_0x4a8036[_0x2107('0x2b')];if(_0x5afd28[_0x2107('0x2c')][_0x2107('0x3e')]){_0xb89bd['include']=[{'all':!![]}];}_0xb89bd=_[_0x2107('0x3a')]({},_0xb89bd,_0x5afd28[_0x2107('0x3c')]);return db['FaxApplication'][_0x2107('0x46')](_0xb89bd)[_0x2107('0x3d')](handleEntityNotFound(_0x384353,null))[_0x2107('0x3d')](respondWithResult(_0x384353,null))[_0x2107('0x47')](handleError(_0x384353,null));};exports[_0x2107('0x48')]=function(_0x4d525e,_0x5ed332){return db['FaxApplication']['create'](_0x4d525e[_0x2107('0x49')],{})[_0x2107('0x3d')](respondWithResult(_0x5ed332,0xc9))[_0x2107('0x47')](handleError(_0x5ed332,null));};exports[_0x2107('0x22')]=function(_0x5a9cc1,_0x127740){if(_0x5a9cc1['body']['id']){delete _0x5a9cc1[_0x2107('0x49')]['id'];}return db[_0x2107('0x40')][_0x2107('0x46')]({'where':{'id':_0x5a9cc1['params']['id']}})[_0x2107('0x3d')](handleEntityNotFound(_0x127740,null))[_0x2107('0x3d')](saveUpdates(_0x5a9cc1[_0x2107('0x49')],null))[_0x2107('0x3d')](respondWithResult(_0x127740,null))['catch'](handleError(_0x127740,null));};exports[_0x2107('0x4a')]=function(_0x2bf264,_0x568368){return db[_0x2107('0x40')][_0x2107('0x46')]({'where':{'id':_0x2bf264[_0x2107('0x44')]['id']}})[_0x2107('0x3d')](handleEntityNotFound(_0x568368,null))[_0x2107('0x3d')](removeEntity(_0x568368,null))[_0x2107('0x47')](handleError(_0x568368,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 2157627..38448f9 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 _0x6498=['fax_applications','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./faxApplication.attributes','define'];(function(_0x2b190c,_0x16a558){var _0x43dc14=function(_0x502be1){while(--_0x502be1){_0x2b190c['push'](_0x2b190c['shift']());}};_0x43dc14(++_0x16a558);}(_0x6498,0xc7));var _0x8649=function(_0x57803c,_0x489296){_0x57803c=_0x57803c-0x0;var _0x5434e0=_0x6498[_0x57803c];return _0x5434e0;};'use strict';var _=require(_0x8649('0x0'));var util=require(_0x8649('0x1'));var logger=require(_0x8649('0x2'))('api');var moment=require(_0x8649('0x3'));var BPromise=require(_0x8649('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8649('0x5'));var rimraf=require(_0x8649('0x6'));var config=require(_0x8649('0x7'));var attributes=require(_0x8649('0x8'));module['exports']=function(_0xfc5e48,_0x34c4c7){return _0xfc5e48[_0x8649('0x9')]('FaxApplication',attributes,{'tableName':_0x8649('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x2c21=['rimraf','exports','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','request-promise','path'];(function(_0x3d5470,_0x280f08){var _0x407f65=function(_0x211061){while(--_0x211061){_0x3d5470['push'](_0x3d5470['shift']());}};_0x407f65(++_0x280f08);}(_0x2c21,0x1c8));var _0x12c2=function(_0x1109db,_0x5c6dc7){_0x1109db=_0x1109db-0x0;var _0x27d529=_0x2c21[_0x1109db];return _0x27d529;};'use strict';var _=require('lodash');var util=require(_0x12c2('0x0'));var logger=require(_0x12c2('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x12c2('0x2'));var fs=require('fs');var path=require(_0x12c2('0x3'));var rimraf=require(_0x12c2('0x4'));var config=require('../../config/environment');var attributes=require('./faxApplication.attributes');module[_0x12c2('0x5')]=function(_0x10dfd3,_0x3ae5ca){return _0x10dfd3['define'](_0x12c2('0x6'),attributes,{'tableName':_0x12c2('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x12c2('0x8'),'collate':_0x12c2('0x9')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 653a55b..60f2cb9 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 _0x8ff4=['where','attributes','limit','moment','bluebird','../../config/environment','jayson/promise','client','http','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','UpdateFaxApplication','FaxApplication','update','body','options','raw'];(function(_0x56658a,_0x51d0b1){var _0x3bb601=function(_0x29d18b){while(--_0x29d18b){_0x56658a['push'](_0x56658a['shift']());}};_0x3bb601(++_0x51d0b1);}(_0x8ff4,0x111));var _0x48ff=function(_0x1d7466,_0x161771){_0x1d7466=_0x1d7466-0x0;var _0x3ebbb6=_0x8ff4[_0x1d7466];return _0x3ebbb6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x48ff('0x0'));var BPromise=require(_0x48ff('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x48ff('0x2'));var jayson=require(_0x48ff('0x3'));var client=jayson[_0x48ff('0x4')][_0x48ff('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x247cc3,_0x6ecd64,_0x1e23e3){return new BPromise(function(_0x57dfbb,_0x19b56c){return client[_0x48ff('0x6')](_0x247cc3,_0x1e23e3)[_0x48ff('0x7')](function(_0x31360b){logger[_0x48ff('0x8')](_0x48ff('0x9'),_0x6ecd64,_0x48ff('0xa'));logger[_0x48ff('0xb')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x6ecd64,_0x48ff('0xa'),JSON[_0x48ff('0xc')](_0x31360b));if(_0x31360b['error']){if(_0x31360b[_0x48ff('0xd')][_0x48ff('0xe')]===0x1f4){logger['error']('FaxApplication,\x20%s,\x20%s',_0x6ecd64,_0x31360b['error'][_0x48ff('0xf')]);return _0x19b56c(_0x31360b[_0x48ff('0xd')][_0x48ff('0xf')]);}logger[_0x48ff('0xd')](_0x48ff('0x9'),_0x6ecd64,_0x31360b[_0x48ff('0xd')][_0x48ff('0xf')]);return _0x57dfbb(_0x31360b[_0x48ff('0xd')][_0x48ff('0xf')]);}else{logger[_0x48ff('0x8')](_0x48ff('0x9'),_0x6ecd64,_0x48ff('0xa'));_0x57dfbb(_0x31360b[_0x48ff('0x10')][_0x48ff('0xf')]);}})[_0x48ff('0x11')](function(_0x52778b){logger['error']('FaxApplication,\x20%s,\x20%s',_0x6ecd64,_0x52778b);_0x19b56c(_0x52778b);});});}exports[_0x48ff('0x12')]=function(_0x121ca4){var _0x4bdb90=this;return new Promise(function(_0x4cb1e1,_0x55dd82){return db[_0x48ff('0x13')][_0x48ff('0x14')](_0x121ca4[_0x48ff('0x15')],{'raw':_0x121ca4['options']?_0x121ca4[_0x48ff('0x16')][_0x48ff('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x121ca4['options']?_0x121ca4[_0x48ff('0x16')][_0x48ff('0x18')]||null:null,'attributes':_0x121ca4[_0x48ff('0x16')]?_0x121ca4[_0x48ff('0x16')][_0x48ff('0x19')]||null:null,'limit':_0x121ca4['options']?_0x121ca4[_0x48ff('0x16')][_0x48ff('0x1a')]||null:null})[_0x48ff('0x7')](function(_0x509a34){logger[_0x48ff('0x8')](_0x48ff('0x12'),_0x121ca4);logger[_0x48ff('0xb')](_0x48ff('0x12'),_0x121ca4,JSON[_0x48ff('0xc')](_0x509a34));_0x4cb1e1(_0x509a34);})[_0x48ff('0x11')](function(_0x4d0676){logger[_0x48ff('0xd')](_0x48ff('0x12'),_0x4d0676[_0x48ff('0xf')],_0x121ca4);_0x55dd82(_0x4bdb90[_0x48ff('0xd')](0x1f4,_0x4d0676[_0x48ff('0xf')]));});});}; \ No newline at end of file +var _0xf5a9=['ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','FaxApplication,\x20%s,\x20%s','message','result','catch','FaxApplication','update','body','raw','options','where','attributes','limit','UpdateFaxApplication','lodash','util','bluebird','randomstring'];(function(_0x381366,_0x2ac79f){var _0x52869e=function(_0x57d6b7){while(--_0x57d6b7){_0x381366['push'](_0x381366['shift']());}};_0x52869e(++_0x2ac79f);}(_0xf5a9,0x97));var _0x9f5a=function(_0x54e9b9,_0x255a27){_0x54e9b9=_0x54e9b9-0x0;var _0x11815e=_0xf5a9[_0x54e9b9];return _0x11815e;};'use strict';var _=require(_0x9f5a('0x0'));var util=require(_0x9f5a('0x1'));var moment=require('moment');var BPromise=require(_0x9f5a('0x2'));var rs=require(_0x9f5a('0x3'));var fs=require('fs');var Redis=require(_0x9f5a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9f5a('0x5'));var logger=require('../../config/logger')(_0x9f5a('0x6'));var config=require(_0x9f5a('0x7'));var jayson=require(_0x9f5a('0x8'));var client=jayson[_0x9f5a('0x9')][_0x9f5a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b57eb,_0x3c86b9,_0x2d3f2f){return new BPromise(function(_0x1b1b97,_0x5af872){return client['request'](_0x2b57eb,_0x2d3f2f)[_0x9f5a('0xb')](function(_0x39a7c6){logger[_0x9f5a('0xc')]('FaxApplication,\x20%s,\x20%s',_0x3c86b9,_0x9f5a('0xd'));logger[_0x9f5a('0xe')](_0x9f5a('0xf'),_0x3c86b9,_0x9f5a('0xd'),JSON[_0x9f5a('0x10')](_0x39a7c6));if(_0x39a7c6[_0x9f5a('0x11')]){if(_0x39a7c6[_0x9f5a('0x11')]['code']===0x1f4){logger[_0x9f5a('0x11')](_0x9f5a('0x12'),_0x3c86b9,_0x39a7c6['error'][_0x9f5a('0x13')]);return _0x5af872(_0x39a7c6['error'][_0x9f5a('0x13')]);}logger['error'](_0x9f5a('0x12'),_0x3c86b9,_0x39a7c6['error'][_0x9f5a('0x13')]);return _0x1b1b97(_0x39a7c6[_0x9f5a('0x11')][_0x9f5a('0x13')]);}else{logger[_0x9f5a('0xc')](_0x9f5a('0x12'),_0x3c86b9,_0x9f5a('0xd'));_0x1b1b97(_0x39a7c6[_0x9f5a('0x14')][_0x9f5a('0x13')]);}})[_0x9f5a('0x15')](function(_0x5742ff){logger[_0x9f5a('0x11')]('FaxApplication,\x20%s,\x20%s',_0x3c86b9,_0x5742ff);_0x5af872(_0x5742ff);});});}exports['UpdateFaxApplication']=function(_0x57c8ab){var _0x36b0a5=this;return new Promise(function(_0x50af59,_0x5c434e){return db[_0x9f5a('0x16')][_0x9f5a('0x17')](_0x57c8ab[_0x9f5a('0x18')],{'raw':_0x57c8ab['options']?_0x57c8ab['options'][_0x9f5a('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x57c8ab[_0x9f5a('0x1a')]?_0x57c8ab[_0x9f5a('0x1a')][_0x9f5a('0x1b')]||null:null,'attributes':_0x57c8ab[_0x9f5a('0x1a')]?_0x57c8ab[_0x9f5a('0x1a')][_0x9f5a('0x1c')]||null:null,'limit':_0x57c8ab[_0x9f5a('0x1a')]?_0x57c8ab['options'][_0x9f5a('0x1d')]||null:null})['then'](function(_0x29f19e){logger[_0x9f5a('0xc')]('UpdateFaxApplication',_0x57c8ab);logger['debug'](_0x9f5a('0x1e'),_0x57c8ab,JSON[_0x9f5a('0x10')](_0x29f19e));_0x50af59(_0x29f19e);})['catch'](function(_0x1dbee6){logger['error'](_0x9f5a('0x1e'),_0x1dbee6['message'],_0x57c8ab);_0x5c434e(_0x36b0a5[_0x9f5a('0x11')](0x1f4,_0x1dbee6[_0x9f5a('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 5ae31ba..ae1c3a0 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 _0x4fc2=['show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./faxApplication.controller','isAuthenticated','index','/:id'];(function(_0x112147,_0x4e692e){var _0x3ba744=function(_0x191b87){while(--_0x191b87){_0x112147['push'](_0x112147['shift']());}};_0x3ba744(++_0x4e692e);}(_0x4fc2,0x111));var _0x24fc=function(_0x7097e8,_0x53e913){_0x7097e8=_0x7097e8-0x0;var _0x212772=_0x4fc2[_0x7097e8];return _0x212772;};'use strict';var multer=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var path=require(_0x24fc('0x2'));var timeout=require(_0x24fc('0x3'));var express=require('express');var router=express[_0x24fc('0x4')]();var fs_extra=require(_0x24fc('0x5'));var auth=require(_0x24fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x24fc('0x7'));var controller=require(_0x24fc('0x8'));router['get']('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0xa')]);router['get'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xc')]);router[_0x24fc('0xd')]('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0xe')]);router['put'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xf')]);router[_0x24fc('0x10')](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x11')]);module[_0x24fc('0x12')]=router; \ No newline at end of file +var _0x2032=['exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete'];(function(_0x521073,_0x467154){var _0x348236=function(_0x41edc3){while(--_0x41edc3){_0x521073['push'](_0x521073['shift']());}};_0x348236(++_0x467154);}(_0x2032,0xd9));var _0x2203=function(_0x25bdca,_0x583839){_0x25bdca=_0x25bdca-0x0;var _0x5a67de=_0x2032[_0x25bdca];return _0x5a67de;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2203('0xe')]('/:id',auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);router[_0x2203('0x10')]('/:id',auth[_0x2203('0x9')](),controller['destroy']);module[_0x2203('0x11')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 529c976..0bc8d8a 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 _0xc8b4=['ENUM','out','sequelize','exports','BOOLEAN','DATE','STRING'];(function(_0x568d8e,_0x5ccd89){var _0x4572c6=function(_0x5a6a3d){while(--_0x5a6a3d){_0x568d8e['push'](_0x568d8e['shift']());}};_0x4572c6(++_0x5ccd89);}(_0xc8b4,0x13d));var _0x4c8b=function(_0x492196,_0x2d8f59){_0x492196=_0x492196-0x0;var _0x3eb099=_0xc8b4[_0x492196];return _0x3eb099;};'use strict';var Sequelize=require(_0x4c8b('0x0'));module[_0x4c8b('0x1')]={'closed':{'type':Sequelize[_0x4c8b('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x4c8b('0x3')]},'disposition':{'type':Sequelize[_0x4c8b('0x4')]},'secondDisposition':{'type':Sequelize[_0x4c8b('0x4')]},'thirdDisposition':{'type':Sequelize[_0x4c8b('0x4')]},'note':{'type':Sequelize[_0x4c8b('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0x4c8b('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x4c8b('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x4c8b('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x4c8b('0x5')]('in',_0x4c8b('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x1aba=['STRING','ENUM','out','exports','DATE'];(function(_0x52f75c,_0x2778b7){var _0x24297d=function(_0x5b2984){while(--_0x5b2984){_0x52f75c['push'](_0x52f75c['shift']());}};_0x24297d(++_0x2778b7);}(_0x1aba,0x8f));var _0xa1ab=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x1aba[_0x465a0c];return _0x1e202e;};'use strict';var Sequelize=require('sequelize');module[_0xa1ab('0x0')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xa1ab('0x1')]},'disposition':{'type':Sequelize[_0xa1ab('0x2')]},'secondDisposition':{'type':Sequelize[_0xa1ab('0x2')]},'thirdDisposition':{'type':Sequelize[_0xa1ab('0x2')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xa1ab('0x1')]},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize[_0xa1ab('0x3')]('in',_0xa1ab('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xa1ab('0x1')]},'lastMsgDirection':{'type':Sequelize[_0xa1ab('0x3')]('in','out'),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index b9efc01..53dae5c 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 _0xc6f4=['find','catch','create','body','params','describe','addMessage','FaxMessage','ids','getMessages','hasOwnProperty','nolimit','sort','pick','where','FaxInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','omit','emit','faxInteractionTags:save','removeTags','download','unix','toString','join','server','files','tmp','root','transcript-%d-%s.zip','push','Attachment','Messages','createdAt','get','mkdirSync','basename','existsSync','createReadStream','pipe','createWriteStream','log','unlinkSync','zip-dir','bluebird','path','ioredis','../../components/interaction/service','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','end','json','offset','limit','undefined','count','status','set','update','then','destroy','error','stack','name','index','map','FaxInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','fax','query','user','keys','filters','model','attributes','intersection','fields','length','includeAll','include','merge','options'];(function(_0x3ccdf8,_0x584ceb){var _0x243dab=function(_0x1a90d1){while(--_0x1a90d1){_0x3ccdf8['push'](_0x3ccdf8['shift']());}};_0x243dab(++_0x584ceb);}(_0xc6f4,0x1c2));var _0x4c6f=function(_0x7b1a87,_0x28a382){_0x7b1a87=_0x7b1a87-0x0;var _0x38d452=_0xc6f4[_0x7b1a87];return _0x38d452;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x4c6f('0x0'));var moment=require('moment');var BPromise=require(_0x4c6f('0x1'));var util=require('util');var path=require(_0x4c6f('0x2'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x4c6f('0x3'));var interaction=require(_0x4c6f('0x4'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var config=require('../../config/environment');var db=require(_0x4c6f('0x5'))['db'];config[_0x4c6f('0x6')]=_[_0x4c6f('0x7')](config[_0x4c6f('0x6')],{'host':_0x4c6f('0x8'),'port':0x18eb});var socket=require(_0x4c6f('0x9'))(new Redis(config['redis']));require(_0x4c6f('0xa'))[_0x4c6f('0xb')](socket);function respondWithStatusCode(_0xa39d1a,_0x5cd653){_0x5cd653=_0x5cd653||0xcc;return function(_0x58ff6e){if(_0x58ff6e){return _0xa39d1a[_0x4c6f('0xc')](_0x5cd653);}return _0xa39d1a['status'](_0x5cd653)[_0x4c6f('0xd')]();};}function respondWithResult(_0xb3b492,_0x2b32e7){_0x2b32e7=_0x2b32e7||0xc8;return function(_0x49fa06){if(_0x49fa06){return _0xb3b492['status'](_0x2b32e7)[_0x4c6f('0xe')](_0x49fa06);}};}function respondWithFilteredResult(_0x35eae7,_0xa43fc5){return function(_0xe47d46){if(_0xe47d46){var _0x2cf9f5=typeof _0xa43fc5[_0x4c6f('0xf')]==='undefined'&&typeof _0xa43fc5[_0x4c6f('0x10')]===_0x4c6f('0x11');var _0xd6e6b2=_0xe47d46[_0x4c6f('0x12')];var _0x2a885b=_0x2cf9f5?0x0:_0xa43fc5[_0x4c6f('0xf')];var _0x3c345a=_0x2cf9f5?_0xe47d46[_0x4c6f('0x12')]:_0xa43fc5['offset']+_0xa43fc5[_0x4c6f('0x10')];var _0x5cb7a6;if(_0x3c345a>=_0xd6e6b2){_0x3c345a=_0xd6e6b2;_0x5cb7a6=0xc8;}else{_0x5cb7a6=0xce;}_0x35eae7[_0x4c6f('0x13')](_0x5cb7a6);return _0x35eae7[_0x4c6f('0x14')]('Content-Range',_0x2a885b+'-'+_0x3c345a+'/'+_0xd6e6b2)[_0x4c6f('0xe')](_0xe47d46);}return null;};}function saveUpdates(_0x44cbfb){return function(_0x10389c){if(_0x10389c){return _0x10389c[_0x4c6f('0x15')](_0x44cbfb)[_0x4c6f('0x16')](function(_0x672b70){return _0x672b70;});}return null;};}function removeEntity(_0xa5113){return function(_0x13f58d){if(_0x13f58d){return _0x13f58d[_0x4c6f('0x17')]()[_0x4c6f('0x16')](function(){_0xa5113['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x42f681){return function(_0x2a3854){if(!_0x2a3854){_0x42f681[_0x4c6f('0xc')](0x194);}return _0x2a3854;};}function handleError(_0x27a5d9,_0x45f9a0){_0x45f9a0=_0x45f9a0||0x1f4;return function(_0x2c7e39){logger[_0x4c6f('0x18')](_0x2c7e39[_0x4c6f('0x19')]);if(_0x2c7e39['name']){delete _0x2c7e39[_0x4c6f('0x1a')];}_0x27a5d9['status'](_0x45f9a0)['send'](_0x2c7e39);};}exports[_0x4c6f('0x1b')]=function(_0x56c796,_0x4adb91){var _0x4bdbb0={};var _0x5be8d9=_[_0x4c6f('0x1c')](db[_0x4c6f('0x1d')][_0x4c6f('0x1e')],function(_0x3db10d){return{'name':_0x3db10d[_0x4c6f('0x1f')],'type':_0x3db10d[_0x4c6f('0x20')][_0x4c6f('0x21')]};});_0x4bdbb0=qs[_0x4c6f('0x22')](_0x5be8d9,_0x56c796);return interaction[_0x4c6f('0x23')](_0x4c6f('0x24'),_0x56c796[_0x4c6f('0x25')],_0x56c796[_0x4c6f('0x26')],_0x4bdbb0,_0x5be8d9)[_0x4c6f('0x16')](respondWithFilteredResult(_0x4adb91,_0x4bdbb0))['catch'](handleError(_0x4adb91,null));};exports['show']=function(_0x249252,_0x1f601e){var _0x3ea593={'raw':![],'where':{'id':_0x249252['params']['id']}},_0x53301b={};_0x53301b['model']=_['keys'](db[_0x4c6f('0x1d')][_0x4c6f('0x1e')]);_0x53301b[_0x4c6f('0x25')]=_[_0x4c6f('0x27')](_0x249252['query']);_0x53301b[_0x4c6f('0x28')]=_['intersection'](_0x53301b[_0x4c6f('0x29')],_0x53301b[_0x4c6f('0x25')]);_0x3ea593[_0x4c6f('0x2a')]=_[_0x4c6f('0x2b')](_0x53301b['model'],qs['fields'](_0x249252[_0x4c6f('0x25')][_0x4c6f('0x2c')]));_0x3ea593[_0x4c6f('0x2a')]=_0x3ea593['attributes'][_0x4c6f('0x2d')]?_0x3ea593['attributes']:_0x53301b[_0x4c6f('0x29')];if(_0x249252[_0x4c6f('0x25')][_0x4c6f('0x2e')]){_0x3ea593[_0x4c6f('0x2f')]=[{'all':!![]}];}_0x3ea593=_[_0x4c6f('0x30')]({},_0x3ea593,_0x249252[_0x4c6f('0x31')]);return db[_0x4c6f('0x1d')][_0x4c6f('0x32')](_0x3ea593)[_0x4c6f('0x16')](handleEntityNotFound(_0x1f601e,null))[_0x4c6f('0x16')](respondWithResult(_0x1f601e,null))[_0x4c6f('0x33')](handleError(_0x1f601e,null));};exports['create']=function(_0x5c6215,_0x1311fc){return db['FaxInteraction'][_0x4c6f('0x34')](_0x5c6215['body'],{})['then'](respondWithResult(_0x1311fc,0xc9))['catch'](handleError(_0x1311fc,null));};exports[_0x4c6f('0x15')]=function(_0x18aaa8,_0x14b495){if(_0x18aaa8[_0x4c6f('0x35')]['id']){delete _0x18aaa8[_0x4c6f('0x35')]['id'];}return db['FaxInteraction']['find']({'where':{'id':_0x18aaa8[_0x4c6f('0x36')]['id']}})[_0x4c6f('0x16')](handleEntityNotFound(_0x14b495,null))[_0x4c6f('0x16')](saveUpdates(_0x18aaa8[_0x4c6f('0x35')],null))['then'](respondWithResult(_0x14b495,null))[_0x4c6f('0x33')](handleError(_0x14b495,null));};exports[_0x4c6f('0x17')]=function(_0x2ba3e8,_0x3e9971){return db['FaxInteraction'][_0x4c6f('0x32')]({'where':{'id':_0x2ba3e8[_0x4c6f('0x36')]['id']}})[_0x4c6f('0x16')](handleEntityNotFound(_0x3e9971,null))[_0x4c6f('0x16')](removeEntity(_0x3e9971,null))[_0x4c6f('0x33')](handleError(_0x3e9971,null));};exports['describe']=function(_0x4544fa,_0x4ad314){return db[_0x4c6f('0x1d')][_0x4c6f('0x37')]()['then'](respondWithResult(_0x4ad314,null))[_0x4c6f('0x33')](handleError(_0x4ad314,null));};exports[_0x4c6f('0x38')]=function(_0x2adcaa,_0x2a5167){return db[_0x4c6f('0x39')]['find']({'where':{'id':_0x2adcaa[_0x4c6f('0x36')]['id']}})['then'](handleEntityNotFound(_0x2a5167,null))[_0x4c6f('0x16')](function(_0x4f7e22){if(_0x4f7e22){return _0x4f7e22[_0x4c6f('0x38')](_0x2adcaa[_0x4c6f('0x35')][_0x4c6f('0x3a')],_['omit'](_0x2adcaa[_0x4c6f('0x35')],[_0x4c6f('0x3a'),'id'])||{});}})[_0x4c6f('0x16')](respondWithResult(_0x2a5167,null))[_0x4c6f('0x33')](handleError(_0x2a5167,null));};exports[_0x4c6f('0x3b')]=function(_0x166cc2,_0x3fe5f3){var _0x206135={'raw':![],'where':{}};var _0x323deb={};var _0x42cacc={'count':0x0,'rows':[]};return db[_0x4c6f('0x1d')]['findOne']({'where':{'id':_0x166cc2[_0x4c6f('0x36')]['id']}})[_0x4c6f('0x16')](handleEntityNotFound(_0x3fe5f3,null))[_0x4c6f('0x16')](function(_0x2d5727){if(_0x2d5727){_0x323deb[_0x4c6f('0x29')]=_[_0x4c6f('0x27')](db[_0x4c6f('0x39')][_0x4c6f('0x1e')]);_0x323deb['query']=_[_0x4c6f('0x27')](_0x166cc2['query']);_0x323deb['filters']=_[_0x4c6f('0x2b')](_0x323deb[_0x4c6f('0x29')],_0x323deb['query']);_0x206135[_0x4c6f('0x2a')]=_[_0x4c6f('0x2b')](_0x323deb[_0x4c6f('0x29')],qs[_0x4c6f('0x2c')](_0x166cc2[_0x4c6f('0x25')]['fields']));_0x206135[_0x4c6f('0x2a')]=_0x206135[_0x4c6f('0x2a')]['length']?_0x206135[_0x4c6f('0x2a')]:_0x323deb[_0x4c6f('0x29')];if(!_0x166cc2[_0x4c6f('0x25')][_0x4c6f('0x3c')](_0x4c6f('0x3d'))){_0x206135[_0x4c6f('0x10')]=qs[_0x4c6f('0x10')](_0x166cc2[_0x4c6f('0x25')][_0x4c6f('0x10')]);_0x206135[_0x4c6f('0xf')]=qs['offset'](_0x166cc2[_0x4c6f('0x25')][_0x4c6f('0xf')]);}_0x206135['order']=qs['sort'](_0x166cc2[_0x4c6f('0x25')][_0x4c6f('0x3e')]);_0x206135['where']=qs[_0x4c6f('0x28')](_[_0x4c6f('0x3f')](_0x166cc2[_0x4c6f('0x25')],_0x323deb[_0x4c6f('0x28')]));_0x206135[_0x4c6f('0x40')][_0x4c6f('0x41')]=_0x2d5727['id'];if(_0x166cc2[_0x4c6f('0x25')][_0x4c6f('0x42')]){_0x206135['where']=_[_0x4c6f('0x30')](_0x206135[_0x4c6f('0x40')],{'$or':_['map'](_0x206135[_0x4c6f('0x2a')],function(_0x11b09f){var _0x292264={};_0x292264[_0x11b09f]={'$like':'%'+_0x166cc2[_0x4c6f('0x25')][_0x4c6f('0x42')]+'%'};return _0x292264;})});}if(_0x166cc2[_0x4c6f('0x25')][_0x4c6f('0x43')]){var _0x4cbb44=_0x166cc2[_0x4c6f('0x25')][_0x4c6f('0x43')][_0x4c6f('0x44')](',');var _0x5c14d1={};_0x5c14d1[_0x4cbb44[0x0]]={'$gte':moment(_0x4cbb44[0x1])[_0x4c6f('0x45')](_0x4c6f('0x46'))};_0x206135['where']=_[_0x4c6f('0x30')](_0x206135[_0x4c6f('0x40')],_0x5c14d1);}_0x206135=_[_0x4c6f('0x30')]({},_0x206135,_0x166cc2[_0x4c6f('0x31')]);return db['FaxMessage']['count']({'where':_0x206135['where']})[_0x4c6f('0x16')](function(_0x2abe03){_0x42cacc[_0x4c6f('0x12')]=_0x2abe03;if(_0x166cc2['query'][_0x4c6f('0x2e')]){_0x206135['include']=[{'all':!![]}];}return db[_0x4c6f('0x39')]['findAll'](_0x206135);})[_0x4c6f('0x16')](function(_0x4b12a0){_0x42cacc[_0x4c6f('0x47')]=_0x4b12a0;return _0x42cacc;});}})['then'](respondWithFilteredResult(_0x3fe5f3,_0x206135))[_0x4c6f('0x33')](handleError(_0x3fe5f3,null));};exports[_0x4c6f('0x48')]=function(_0x4c97e9,_0x5773d8){return db[_0x4c6f('0x1d')][_0x4c6f('0x32')]({'where':{'id':_0x4c97e9['params']['id']}})[_0x4c6f('0x16')](handleEntityNotFound(_0x5773d8,null))['then'](function(_0x4fcac2){if(_0x4fcac2){return _0x4fcac2[_0x4c6f('0x49')](_0x4c97e9['body'][_0x4c6f('0x3a')],_[_0x4c6f('0x4a')](_0x4c97e9['body'],[_0x4c6f('0x3a'),'id'])||{})['spread'](function(){return db['Tag'][_0x4c6f('0x23')]({'attributes':['id',_0x4c6f('0x1a'),'color'],'where':{'id':_0x4c97e9[_0x4c6f('0x35')][_0x4c6f('0x3a')]}});})[_0x4c6f('0x16')](function(_0x5df73a){socket[_0x4c6f('0x4b')](_0x4c6f('0x4c'),{'id':Number(_0x4c97e9[_0x4c6f('0x36')]['id']),'tags':_0x5df73a||[]});return{'id':Number(_0x4c97e9[_0x4c6f('0x36')]['id']),'tags':_0x5df73a||[]};});}})[_0x4c6f('0x16')](respondWithResult(_0x5773d8,null))[_0x4c6f('0x33')](handleError(_0x5773d8,null));};exports['removeTags']=function(_0x5c462c,_0x594d65){return db[_0x4c6f('0x1d')][_0x4c6f('0x32')]({'where':{'id':_0x5c462c[_0x4c6f('0x36')]['id']}})[_0x4c6f('0x16')](handleEntityNotFound(_0x594d65,null))[_0x4c6f('0x16')](function(_0x43fa4a){if(_0x43fa4a){return _0x43fa4a[_0x4c6f('0x4d')](_0x5c462c['query'][_0x4c6f('0x3a')]);}})['then'](respondWithStatusCode(_0x594d65,null))['catch'](handleError(_0x594d65,null));};exports[_0x4c6f('0x4e')]=function(_0x21bacd,_0x156650){var _0x4d90a4=moment()[_0x4c6f('0x4f')]()[_0x4c6f('0x50')]();var _0x17c64e=path[_0x4c6f('0x51')](config['root'],_0x4c6f('0x52'),_0x4c6f('0x53'),_0x4c6f('0x54'));var _0x15f4d2=path[_0x4c6f('0x51')](config[_0x4c6f('0x55')],_0x4c6f('0x52'),_0x4c6f('0x53'),'attachments');var _0x83f533=path[_0x4c6f('0x51')](_0x17c64e,_0x4d90a4);var _0x4af3f7=util[_0x4c6f('0x45')](_0x4c6f('0x56'),_0x21bacd[_0x4c6f('0x36')]['id'],_0x4d90a4);var _0x52cd55=path[_0x4c6f('0x51')](_0x17c64e,_0x4af3f7);var _0x552eb9=[];_0x552eb9[_0x4c6f('0x57')]({'model':db[_0x4c6f('0x58')],'as':_0x4c6f('0x58'),'raw':!![]});var _0x5b5920=[{'model':db[_0x4c6f('0x39')],'as':_0x4c6f('0x59'),'attributes':['id',_0x4c6f('0x35'),_0x4c6f('0x5a')],'include':_0x552eb9}];return db[_0x4c6f('0x1d')][_0x4c6f('0x32')]({'where':{'id':_0x21bacd[_0x4c6f('0x36')]['id']},'include':_0x5b5920})[_0x4c6f('0x16')](handleEntityNotFound(_0x156650,null))[_0x4c6f('0x16')](function(_0x193dee){if(_0x193dee&&_0x193dee[_0x4c6f('0x59')]){var _0x51da8a=_0x193dee[_0x4c6f('0x5b')]({'plain':!![]});fs[_0x4c6f('0x5c')](_0x83f533);for(var _0x579810=0x0;_0x579810<_0x51da8a[_0x4c6f('0x59')][_0x4c6f('0x2d')];_0x579810++){var _0x5495a9=_0x51da8a['Messages'][_0x579810][_0x4c6f('0x58')];if(_0x5495a9){var _0x39aea1=path[_0x4c6f('0x51')](_0x15f4d2,_0x5495a9[_0x4c6f('0x5d')]);if(fs[_0x4c6f('0x5e')](_0x39aea1)){fs[_0x4c6f('0x5f')](_0x39aea1)[_0x4c6f('0x60')](fs[_0x4c6f('0x61')](path[_0x4c6f('0x51')](_0x83f533,_0x5495a9[_0x4c6f('0x5d')])));}}}return BPromise['resolve']()[_0x4c6f('0x16')](function(){return new BPromise(function(_0x15bdde,_0x297b2b){zipdir(_0x83f533,{'saveTo':_0x52cd55},function(_0x246c4c,_0x4f7ed0){if(_0x246c4c)return _0x297b2b(_0x246c4c);return _0x15bdde(_0x4f7ed0);});})[_0x4c6f('0x16')](function(){return new BPromise(function(_0x51369b,_0x11bde5){rimraf(_0x83f533,function(_0x5bbc24){if(_0x5bbc24)_0x11bde5(_0x5bbc24);return _0x51369b();});});})[_0x4c6f('0x16')](function(){return _0x156650['download'](_0x52cd55,_0x4af3f7,function(_0x5cd164){if(_0x5cd164){console[_0x4c6f('0x62')]('err',_0x5cd164);}else{fs[_0x4c6f('0x63')](_0x52cd55);}});});});}else{return _0x156650[_0x4c6f('0xc')](0xc8);}})[_0x4c6f('0x33')](handleError(_0x156650,null));}; \ No newline at end of file +var _0xa702=['limit','count','set','Content-Range','update','then','destroy','error','stack','name','send','index','FaxInteraction','rawAttributes','fieldName','type','key','findAll','fax','query','user','show','params','model','keys','filters','attributes','intersection','fields','length','includeAll','include','merge','catch','create','body','find','describe','FaxMessage','ids','omit','getMessages','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','$gte','format','YYYY-MM-DD\x20HH:mm:ss','options','addTags','setTags','spread','Tag','emit','faxInteractionTags:save','removeTags','unix','join','root','tmp','server','transcript-%d-%s.zip','push','Attachment','createdAt','Messages','get','mkdirSync','basename','existsSync','pipe','createWriteStream','resolve','log','err','unlinkSync','moment','bluebird','util','path','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','./faxInteraction.socket','register','sendStatus','status','end','json','offset','undefined'];(function(_0x1966f3,_0x210ea3){var _0x17575f=function(_0x7b18fb){while(--_0x7b18fb){_0x1966f3['push'](_0x1966f3['shift']());}};_0x17575f(++_0x210ea3);}(_0xa702,0x1e1));var _0x2a70=function(_0x2d5377,_0x4e249b){_0x2d5377=_0x2d5377-0x0;var _0x5b8e61=_0xa702[_0x2d5377];return _0x5b8e61;};'use strict';var rimraf=require('rimraf');var zipdir=require('zip-dir');var moment=require(_0x2a70('0x0'));var BPromise=require(_0x2a70('0x1'));var util=require(_0x2a70('0x2'));var path=require(_0x2a70('0x3'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x2a70('0x4'));var interaction=require(_0x2a70('0x5'));var qs=require(_0x2a70('0x6'));var logger=require(_0x2a70('0x7'))(_0x2a70('0x8'));var config=require('../../config/environment');var db=require(_0x2a70('0x9'))['db'];config['redis']=_['defaults'](config[_0x2a70('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2a70('0xa')]));require(_0x2a70('0xb'))[_0x2a70('0xc')](socket);function respondWithStatusCode(_0x37684b,_0x19c0c4){_0x19c0c4=_0x19c0c4||0xcc;return function(_0xe1ab69){if(_0xe1ab69){return _0x37684b[_0x2a70('0xd')](_0x19c0c4);}return _0x37684b[_0x2a70('0xe')](_0x19c0c4)[_0x2a70('0xf')]();};}function respondWithResult(_0x5883d6,_0x4f5387){_0x4f5387=_0x4f5387||0xc8;return function(_0x292e3b){if(_0x292e3b){return _0x5883d6[_0x2a70('0xe')](_0x4f5387)[_0x2a70('0x10')](_0x292e3b);}};}function respondWithFilteredResult(_0x23b09c,_0x19597e){return function(_0x434aae){if(_0x434aae){var _0x5e3251=typeof _0x19597e[_0x2a70('0x11')]===_0x2a70('0x12')&&typeof _0x19597e[_0x2a70('0x13')]===_0x2a70('0x12');var _0x51cbad=_0x434aae[_0x2a70('0x14')];var _0x33469f=_0x5e3251?0x0:_0x19597e['offset'];var _0x1b6747=_0x5e3251?_0x434aae[_0x2a70('0x14')]:_0x19597e[_0x2a70('0x11')]+_0x19597e['limit'];var _0x1ab513;if(_0x1b6747>=_0x51cbad){_0x1b6747=_0x51cbad;_0x1ab513=0xc8;}else{_0x1ab513=0xce;}_0x23b09c[_0x2a70('0xe')](_0x1ab513);return _0x23b09c[_0x2a70('0x15')](_0x2a70('0x16'),_0x33469f+'-'+_0x1b6747+'/'+_0x51cbad)['json'](_0x434aae);}return null;};}function saveUpdates(_0xc5eec6){return function(_0xc89bc3){if(_0xc89bc3){return _0xc89bc3[_0x2a70('0x17')](_0xc5eec6)[_0x2a70('0x18')](function(_0x9be3b4){return _0x9be3b4;});}return null;};}function removeEntity(_0xabf5e6){return function(_0x54cb60){if(_0x54cb60){return _0x54cb60[_0x2a70('0x19')]()[_0x2a70('0x18')](function(){_0xabf5e6[_0x2a70('0xe')](0xcc)[_0x2a70('0xf')]();});}};}function handleEntityNotFound(_0x578a01){return function(_0x2514b1){if(!_0x2514b1){_0x578a01[_0x2a70('0xd')](0x194);}return _0x2514b1;};}function handleError(_0x287a94,_0x4c79f4){_0x4c79f4=_0x4c79f4||0x1f4;return function(_0x5af95a){logger[_0x2a70('0x1a')](_0x5af95a[_0x2a70('0x1b')]);if(_0x5af95a[_0x2a70('0x1c')]){delete _0x5af95a[_0x2a70('0x1c')];}_0x287a94[_0x2a70('0xe')](_0x4c79f4)[_0x2a70('0x1d')](_0x5af95a);};}exports[_0x2a70('0x1e')]=function(_0x2889f5,_0x20bcc9){var _0x323b15={};var _0x5a0939=_['map'](db[_0x2a70('0x1f')][_0x2a70('0x20')],function(_0x118a3a){return{'name':_0x118a3a[_0x2a70('0x21')],'type':_0x118a3a[_0x2a70('0x22')][_0x2a70('0x23')]};});_0x323b15=qs['getOptions'](_0x5a0939,_0x2889f5);return interaction[_0x2a70('0x24')](_0x2a70('0x25'),_0x2889f5[_0x2a70('0x26')],_0x2889f5[_0x2a70('0x27')],_0x323b15,_0x5a0939)[_0x2a70('0x18')](respondWithFilteredResult(_0x20bcc9,_0x323b15))['catch'](handleError(_0x20bcc9,null));};exports[_0x2a70('0x28')]=function(_0x432fe0,_0x242dd2){var _0x1c86d3={'raw':![],'where':{'id':_0x432fe0[_0x2a70('0x29')]['id']}},_0x532a5c={};_0x532a5c[_0x2a70('0x2a')]=_[_0x2a70('0x2b')](db[_0x2a70('0x1f')][_0x2a70('0x20')]);_0x532a5c[_0x2a70('0x26')]=_[_0x2a70('0x2b')](_0x432fe0[_0x2a70('0x26')]);_0x532a5c[_0x2a70('0x2c')]=_['intersection'](_0x532a5c[_0x2a70('0x2a')],_0x532a5c[_0x2a70('0x26')]);_0x1c86d3[_0x2a70('0x2d')]=_[_0x2a70('0x2e')](_0x532a5c[_0x2a70('0x2a')],qs[_0x2a70('0x2f')](_0x432fe0[_0x2a70('0x26')][_0x2a70('0x2f')]));_0x1c86d3['attributes']=_0x1c86d3[_0x2a70('0x2d')][_0x2a70('0x30')]?_0x1c86d3[_0x2a70('0x2d')]:_0x532a5c[_0x2a70('0x2a')];if(_0x432fe0[_0x2a70('0x26')][_0x2a70('0x31')]){_0x1c86d3[_0x2a70('0x32')]=[{'all':!![]}];}_0x1c86d3=_[_0x2a70('0x33')]({},_0x1c86d3,_0x432fe0['options']);return db[_0x2a70('0x1f')]['find'](_0x1c86d3)['then'](handleEntityNotFound(_0x242dd2,null))[_0x2a70('0x18')](respondWithResult(_0x242dd2,null))[_0x2a70('0x34')](handleError(_0x242dd2,null));};exports[_0x2a70('0x35')]=function(_0x1e926,_0x1f9c29){return db[_0x2a70('0x1f')][_0x2a70('0x35')](_0x1e926[_0x2a70('0x36')],{})[_0x2a70('0x18')](respondWithResult(_0x1f9c29,0xc9))[_0x2a70('0x34')](handleError(_0x1f9c29,null));};exports['update']=function(_0x4a597b,_0x270f10){if(_0x4a597b['body']['id']){delete _0x4a597b['body']['id'];}return db[_0x2a70('0x1f')][_0x2a70('0x37')]({'where':{'id':_0x4a597b['params']['id']}})[_0x2a70('0x18')](handleEntityNotFound(_0x270f10,null))[_0x2a70('0x18')](saveUpdates(_0x4a597b[_0x2a70('0x36')],null))[_0x2a70('0x18')](respondWithResult(_0x270f10,null))[_0x2a70('0x34')](handleError(_0x270f10,null));};exports[_0x2a70('0x19')]=function(_0xcf119d,_0x551aa9){return db[_0x2a70('0x1f')][_0x2a70('0x37')]({'where':{'id':_0xcf119d[_0x2a70('0x29')]['id']}})[_0x2a70('0x18')](handleEntityNotFound(_0x551aa9,null))[_0x2a70('0x18')](removeEntity(_0x551aa9,null))[_0x2a70('0x34')](handleError(_0x551aa9,null));};exports[_0x2a70('0x38')]=function(_0x1070c1,_0x58bd1b){return db[_0x2a70('0x1f')][_0x2a70('0x38')]()[_0x2a70('0x18')](respondWithResult(_0x58bd1b,null))['catch'](handleError(_0x58bd1b,null));};exports['addMessage']=function(_0x5f2db3,_0x14b587){return db[_0x2a70('0x39')][_0x2a70('0x37')]({'where':{'id':_0x5f2db3[_0x2a70('0x29')]['id']}})[_0x2a70('0x18')](handleEntityNotFound(_0x14b587,null))[_0x2a70('0x18')](function(_0x4f2071){if(_0x4f2071){return _0x4f2071['addMessage'](_0x5f2db3[_0x2a70('0x36')][_0x2a70('0x3a')],_[_0x2a70('0x3b')](_0x5f2db3[_0x2a70('0x36')],['ids','id'])||{});}})[_0x2a70('0x18')](respondWithResult(_0x14b587,null))['catch'](handleError(_0x14b587,null));};exports[_0x2a70('0x3c')]=function(_0x121d37,_0x5a3641){var _0x4d195d={'raw':![],'where':{}};var _0x147c0c={};var _0x10bca4={'count':0x0,'rows':[]};return db[_0x2a70('0x1f')]['findOne']({'where':{'id':_0x121d37['params']['id']}})[_0x2a70('0x18')](handleEntityNotFound(_0x5a3641,null))[_0x2a70('0x18')](function(_0x33eb7a){if(_0x33eb7a){_0x147c0c['model']=_[_0x2a70('0x2b')](db[_0x2a70('0x39')][_0x2a70('0x20')]);_0x147c0c[_0x2a70('0x26')]=_[_0x2a70('0x2b')](_0x121d37[_0x2a70('0x26')]);_0x147c0c[_0x2a70('0x2c')]=_[_0x2a70('0x2e')](_0x147c0c[_0x2a70('0x2a')],_0x147c0c[_0x2a70('0x26')]);_0x4d195d[_0x2a70('0x2d')]=_[_0x2a70('0x2e')](_0x147c0c[_0x2a70('0x2a')],qs[_0x2a70('0x2f')](_0x121d37[_0x2a70('0x26')]['fields']));_0x4d195d[_0x2a70('0x2d')]=_0x4d195d['attributes'][_0x2a70('0x30')]?_0x4d195d[_0x2a70('0x2d')]:_0x147c0c['model'];if(!_0x121d37[_0x2a70('0x26')][_0x2a70('0x3d')](_0x2a70('0x3e'))){_0x4d195d[_0x2a70('0x13')]=qs[_0x2a70('0x13')](_0x121d37['query'][_0x2a70('0x13')]);_0x4d195d[_0x2a70('0x11')]=qs[_0x2a70('0x11')](_0x121d37[_0x2a70('0x26')]['offset']);}_0x4d195d[_0x2a70('0x3f')]=qs[_0x2a70('0x40')](_0x121d37[_0x2a70('0x26')][_0x2a70('0x40')]);_0x4d195d[_0x2a70('0x41')]=qs[_0x2a70('0x2c')](_[_0x2a70('0x42')](_0x121d37[_0x2a70('0x26')],_0x147c0c[_0x2a70('0x2c')]));_0x4d195d['where']['FaxInteractionId']=_0x33eb7a['id'];if(_0x121d37[_0x2a70('0x26')][_0x2a70('0x43')]){_0x4d195d['where']=_[_0x2a70('0x33')](_0x4d195d[_0x2a70('0x41')],{'$or':_[_0x2a70('0x44')](_0x4d195d[_0x2a70('0x2d')],function(_0x575ad2){var _0x5521d6={};_0x5521d6[_0x575ad2]={'$like':'%'+_0x121d37[_0x2a70('0x26')][_0x2a70('0x43')]+'%'};return _0x5521d6;})});}if(_0x121d37[_0x2a70('0x26')][_0x2a70('0x45')]){var _0x37a9f1=_0x121d37[_0x2a70('0x26')][_0x2a70('0x45')]['split'](',');var _0x207dff={};_0x207dff[_0x37a9f1[0x0]]={'$gte':moment(_0x37a9f1[0x1])[_0x2a70('0x46')](_0x2a70('0x47'))};_0x4d195d[_0x2a70('0x41')]=_[_0x2a70('0x33')](_0x4d195d[_0x2a70('0x41')],_0x207dff);}_0x4d195d=_[_0x2a70('0x33')]({},_0x4d195d,_0x121d37[_0x2a70('0x48')]);return db[_0x2a70('0x39')][_0x2a70('0x14')]({'where':_0x4d195d[_0x2a70('0x41')]})[_0x2a70('0x18')](function(_0x8bde06){_0x10bca4[_0x2a70('0x14')]=_0x8bde06;if(_0x121d37[_0x2a70('0x26')]['includeAll']){_0x4d195d[_0x2a70('0x32')]=[{'all':!![]}];}return db[_0x2a70('0x39')]['findAll'](_0x4d195d);})[_0x2a70('0x18')](function(_0x11337e){_0x10bca4['rows']=_0x11337e;return _0x10bca4;});}})['then'](respondWithFilteredResult(_0x5a3641,_0x4d195d))[_0x2a70('0x34')](handleError(_0x5a3641,null));};exports[_0x2a70('0x49')]=function(_0x418544,_0x115018){return db[_0x2a70('0x1f')][_0x2a70('0x37')]({'where':{'id':_0x418544['params']['id']}})[_0x2a70('0x18')](handleEntityNotFound(_0x115018,null))[_0x2a70('0x18')](function(_0x9d0e98){if(_0x9d0e98){return _0x9d0e98[_0x2a70('0x4a')](_0x418544[_0x2a70('0x36')][_0x2a70('0x3a')],_['omit'](_0x418544[_0x2a70('0x36')],[_0x2a70('0x3a'),'id'])||{})[_0x2a70('0x4b')](function(){return db[_0x2a70('0x4c')][_0x2a70('0x24')]({'attributes':['id',_0x2a70('0x1c'),'color'],'where':{'id':_0x418544['body'][_0x2a70('0x3a')]}});})['then'](function(_0x34af76){socket[_0x2a70('0x4d')](_0x2a70('0x4e'),{'id':Number(_0x418544[_0x2a70('0x29')]['id']),'tags':_0x34af76||[]});return{'id':Number(_0x418544[_0x2a70('0x29')]['id']),'tags':_0x34af76||[]};});}})[_0x2a70('0x18')](respondWithResult(_0x115018,null))[_0x2a70('0x34')](handleError(_0x115018,null));};exports[_0x2a70('0x4f')]=function(_0x4e9832,_0x1547b7){return db[_0x2a70('0x1f')]['find']({'where':{'id':_0x4e9832[_0x2a70('0x29')]['id']}})['then'](handleEntityNotFound(_0x1547b7,null))[_0x2a70('0x18')](function(_0x20942a){if(_0x20942a){return _0x20942a[_0x2a70('0x4f')](_0x4e9832[_0x2a70('0x26')]['ids']);}})['then'](respondWithStatusCode(_0x1547b7,null))['catch'](handleError(_0x1547b7,null));};exports['download']=function(_0x4aa22b,_0x5dfb5a){var _0x3b02c5=moment()[_0x2a70('0x50')]()['toString']();var _0x4082b8=path[_0x2a70('0x51')](config[_0x2a70('0x52')],'server','files',_0x2a70('0x53'));var _0xeefdbb=path['join'](config['root'],_0x2a70('0x54'),'files','attachments');var _0x8b4af7=path['join'](_0x4082b8,_0x3b02c5);var _0x3e170a=util[_0x2a70('0x46')](_0x2a70('0x55'),_0x4aa22b[_0x2a70('0x29')]['id'],_0x3b02c5);var _0x348597=path[_0x2a70('0x51')](_0x4082b8,_0x3e170a);var _0x180568=[];_0x180568[_0x2a70('0x56')]({'model':db[_0x2a70('0x57')],'as':_0x2a70('0x57'),'raw':!![]});var _0x49cd29=[{'model':db['FaxMessage'],'as':'Messages','attributes':['id',_0x2a70('0x36'),_0x2a70('0x58')],'include':_0x180568}];return db[_0x2a70('0x1f')][_0x2a70('0x37')]({'where':{'id':_0x4aa22b[_0x2a70('0x29')]['id']},'include':_0x49cd29})['then'](handleEntityNotFound(_0x5dfb5a,null))[_0x2a70('0x18')](function(_0x222fa0){if(_0x222fa0&&_0x222fa0[_0x2a70('0x59')]){var _0x1d9b7b=_0x222fa0[_0x2a70('0x5a')]({'plain':!![]});fs[_0x2a70('0x5b')](_0x8b4af7);for(var _0x749d9b=0x0;_0x749d9b<_0x1d9b7b[_0x2a70('0x59')][_0x2a70('0x30')];_0x749d9b++){var _0xbf1e5=_0x1d9b7b[_0x2a70('0x59')][_0x749d9b][_0x2a70('0x57')];if(_0xbf1e5){var _0x53c20c=path[_0x2a70('0x51')](_0xeefdbb,_0xbf1e5[_0x2a70('0x5c')]);if(fs[_0x2a70('0x5d')](_0x53c20c)){fs['createReadStream'](_0x53c20c)[_0x2a70('0x5e')](fs[_0x2a70('0x5f')](path['join'](_0x8b4af7,_0xbf1e5[_0x2a70('0x5c')])));}}}return BPromise[_0x2a70('0x60')]()['then'](function(){return new BPromise(function(_0x5b5253,_0x58c503){zipdir(_0x8b4af7,{'saveTo':_0x348597},function(_0x578ba4,_0x1fc419){if(_0x578ba4)return _0x58c503(_0x578ba4);return _0x5b5253(_0x1fc419);});})[_0x2a70('0x18')](function(){return new BPromise(function(_0x18b8ea,_0x4bfb3c){rimraf(_0x8b4af7,function(_0x5a0f3f){if(_0x5a0f3f)_0x4bfb3c(_0x5a0f3f);return _0x18b8ea();});});})['then'](function(){return _0x5dfb5a['download'](_0x348597,_0x3e170a,function(_0x523e21){if(_0x523e21){console[_0x2a70('0x61')](_0x2a70('0x62'),_0x523e21);}else{fs[_0x2a70('0x63')](_0x348597);}});});});}else{return _0x5dfb5a['sendStatus'](0xc8);}})[_0x2a70('0x34')](handleError(_0x5dfb5a,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index fbb870e..60c0d3d 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 _0xf95f=['setMaxListeners','update','remove','getUsers','then','Users','map','findAll','setDataValue','emit','catch','hook','events','../../mysqldb','FaxInteraction'];(function(_0xa63ea3,_0x4367ff){var _0x2aa5ff=function(_0x30dc84){while(--_0x30dc84){_0xa63ea3['push'](_0xa63ea3['shift']());}};_0x2aa5ff(++_0x4367ff);}(_0xf95f,0x66));var _0xff95=function(_0xbe40ad,_0x44343c){_0xbe40ad=_0xbe40ad-0x0;var _0x50fac9=_0xf95f[_0xbe40ad];return _0x50fac9;};'use strict';var EventEmitter=require(_0xff95('0x0'));var FaxInteraction=require(_0xff95('0x1'))['db'][_0xff95('0x2')];var FaxMessage=require('../../mysqldb')['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xff95('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xff95('0x4'),'afterDestroy':_0xff95('0x5')};function emitEvent(_0x3187b9){return function(_0x22cec0,_0x1b9b1c,_0x36749d){_0x22cec0[_0xff95('0x6')]({'attributes':['id'],'raw':!![]})[_0xff95('0x7')](function(_0x551485){_0x22cec0['setDataValue'](_0xff95('0x8'),_0x551485[_0xff95('0x9')](function(_0xc6867a){return{'id':_0xc6867a['id']};}));return FaxMessage[_0xff95('0xa')]({'where':{'FaxInteractionId':_0x22cec0['id'],'direction':'in','read':![]},'raw':!![]});})[_0xff95('0x7')](function(_0x3157e4){_0x22cec0[_0xff95('0xb')]('unreadMessages',_0x3157e4['length']);FaxInteractionEvents['emit'](_0x3187b9+':'+_0x22cec0['id'],_0x22cec0);FaxInteractionEvents[_0xff95('0xc')](_0x3187b9,_0x22cec0);_0x36749d(null);})[_0xff95('0xd')](_0x36749d(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction[_0xff95('0xe')](e,emitEvent(event));}}module['exports']=FaxInteractionEvents; \ No newline at end of file +var _0x06f5=['catch','hook','exports','events','../../mysqldb','FaxMessage','setMaxListeners','update','remove','getUsers','then','setDataValue','Users','findAll','unreadMessages','length','emit'];(function(_0x5c3514,_0x18e281){var _0x56e259=function(_0x4914e3){while(--_0x4914e3){_0x5c3514['push'](_0x5c3514['shift']());}};_0x56e259(++_0x18e281);}(_0x06f5,0x146));var _0x506f=function(_0x456f91,_0x2fc6b8){_0x456f91=_0x456f91-0x0;var _0x3a6400=_0x06f5[_0x456f91];return _0x3a6400;};'use strict';var EventEmitter=require(_0x506f('0x0'));var FaxInteraction=require(_0x506f('0x1'))['db']['FaxInteraction'];var FaxMessage=require(_0x506f('0x1'))['db'][_0x506f('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x506f('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x506f('0x4'),'afterDestroy':_0x506f('0x5')};function emitEvent(_0x24086e){return function(_0x33915f,_0x187618,_0xf62b54){_0x33915f[_0x506f('0x6')]({'attributes':['id'],'raw':!![]})[_0x506f('0x7')](function(_0x4d62c8){_0x33915f[_0x506f('0x8')](_0x506f('0x9'),_0x4d62c8['map'](function(_0xff06a7){return{'id':_0xff06a7['id']};}));return FaxMessage[_0x506f('0xa')]({'where':{'FaxInteractionId':_0x33915f['id'],'direction':'in','read':![]},'raw':!![]});})[_0x506f('0x7')](function(_0x14855f){_0x33915f['setDataValue'](_0x506f('0xb'),_0x14855f[_0x506f('0xc')]);FaxInteractionEvents[_0x506f('0xd')](_0x24086e+':'+_0x33915f['id'],_0x33915f);FaxInteractionEvents[_0x506f('0xd')](_0x24086e,_0x33915f);_0xf62b54(null);})[_0x506f('0xe')](_0xf62b54(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction[_0x506f('0xf')](e,emitEvent(event));}}module[_0x506f('0x10')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 4f1a97f..2c33b64 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 _0xf57e=['api','moment','request-promise','path','exports','fax_interactions','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xf57e,0x1e9));var _0xef57=function(_0x5e7d21,_0x1071bd){_0x5e7d21=_0x5e7d21-0x0;var _0x236124=_0xf57e[_0x5e7d21];return _0x236124;};'use strict';var _=require(_0xef57('0x0'));var util=require(_0xef57('0x1'));var logger=require(_0xef57('0x2'))(_0xef57('0x3'));var moment=require(_0xef57('0x4'));var BPromise=require('bluebird');var rp=require(_0xef57('0x5'));var fs=require('fs');var path=require(_0xef57('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./faxInteraction.attributes');module[_0xef57('0x7')]=function(_0x3da419,_0x5ee7e5){return _0x3da419['define']('FaxInteraction',attributes,{'tableName':_0xef57('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x351426,_0x2c674c,_0x3ec70b){if(_0x351426['changed'](_0xef57('0x9'))){_0x351426[_0xef57('0xa')]=moment()['format'](_0xef57('0xb'));}_0x3ec70b(null,_0x351426);}}});}; \ No newline at end of file +var _0xa3e8=['request-promise','path','rimraf','define','fax_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','bluebird'];(function(_0x1d10ae,_0x29931e){var _0x24bcfe=function(_0x15bebf){while(--_0x15bebf){_0x1d10ae['push'](_0x1d10ae['shift']());}};_0x24bcfe(++_0x29931e);}(_0xa3e8,0x127));var _0x8a3e=function(_0x366076,_0x5c77fa){_0x366076=_0x366076-0x0;var _0x2a257c=_0xa3e8[_0x366076];return _0x2a257c;};'use strict';var _=require(_0x8a3e('0x0'));var util=require(_0x8a3e('0x1'));var logger=require(_0x8a3e('0x2'))('api');var moment=require(_0x8a3e('0x3'));var BPromise=require(_0x8a3e('0x4'));var rp=require(_0x8a3e('0x5'));var fs=require('fs');var path=require(_0x8a3e('0x6'));var rimraf=require(_0x8a3e('0x7'));var config=require('../../config/environment');var attributes=require('./faxInteraction.attributes');module['exports']=function(_0x920901,_0xe682f5){return _0x920901[_0x8a3e('0x8')]('FaxInteraction',attributes,{'tableName':_0x8a3e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4c7f41,_0x437cde,_0x3eb1e0){if(_0x4c7f41[_0x8a3e('0xa')](_0x8a3e('0xb'))){_0x4c7f41[_0x8a3e('0xc')]=moment()[_0x8a3e('0xd')](_0x8a3e('0xe'));}_0x3eb1e0(null,_0x4c7f41);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index bfbdb6e..2414958 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 _0x4947=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','socket.io-emitter','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateFaxInteraction','FaxInteraction','update','options','where','attributes','find','addTags','body','ids','omit','spread','AddTags','lodash','moment','bluebird','ioredis','../../mysqldb'];(function(_0x39d22c,_0x288d71){var _0x56bb90=function(_0x27c276){while(--_0x27c276){_0x39d22c['push'](_0x39d22c['shift']());}};_0x56bb90(++_0x288d71);}(_0x4947,0xe5));var _0x7494=function(_0x44c768,_0x552a5e){_0x44c768=_0x44c768-0x0;var _0x55daf5=_0x4947[_0x44c768];return _0x55daf5;};'use strict';var _=require(_0x7494('0x0'));var util=require('util');var moment=require(_0x7494('0x1'));var BPromise=require(_0x7494('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7494('0x3'));var db=require(_0x7494('0x4'))['db'];var utils=require(_0x7494('0x5'));var logger=require(_0x7494('0x6'))(_0x7494('0x7'));var config=require('../../config/environment');var jayson=require(_0x7494('0x8'));var client=jayson[_0x7494('0x9')][_0x7494('0xa')]({'port':0x232a});config[_0x7494('0xb')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x7494('0xc'))(new Redis(config['redis']));require('./faxInteraction.socket')[_0x7494('0xd')](socket);function respondWithRpcPromise(_0x33d90e,_0x137840,_0x5a75cf){return new BPromise(function(_0x4927bb,_0x30cbd0){return client[_0x7494('0xe')](_0x33d90e,_0x5a75cf)[_0x7494('0xf')](function(_0xf5aa7e){logger[_0x7494('0x10')](_0x7494('0x11'),_0x137840,_0x7494('0x12'));logger[_0x7494('0x13')](_0x7494('0x14'),_0x137840,_0x7494('0x12'),JSON[_0x7494('0x15')](_0xf5aa7e));if(_0xf5aa7e[_0x7494('0x16')]){if(_0xf5aa7e['error'][_0x7494('0x17')]===0x1f4){logger[_0x7494('0x16')](_0x7494('0x11'),_0x137840,_0xf5aa7e[_0x7494('0x16')][_0x7494('0x18')]);return _0x30cbd0(_0xf5aa7e[_0x7494('0x16')][_0x7494('0x18')]);}logger[_0x7494('0x16')](_0x7494('0x11'),_0x137840,_0xf5aa7e[_0x7494('0x16')]['message']);return _0x4927bb(_0xf5aa7e['error']['message']);}else{logger[_0x7494('0x10')](_0x7494('0x11'),_0x137840,'request\x20sent');_0x4927bb(_0xf5aa7e['result'][_0x7494('0x18')]);}})[_0x7494('0x19')](function(_0x34547f){logger[_0x7494('0x16')](_0x7494('0x11'),_0x137840,_0x34547f);_0x30cbd0(_0x34547f);});});}exports[_0x7494('0x1a')]=function(_0xfeab01){var _0x599fec=this;return new Promise(function(_0x3352c7,_0x22ef89){return db[_0x7494('0x1b')][_0x7494('0x1c')](_0xfeab01['body'],{'raw':_0xfeab01[_0x7494('0x1d')]?_0xfeab01[_0x7494('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xfeab01[_0x7494('0x1d')]?_0xfeab01[_0x7494('0x1d')][_0x7494('0x1e')]||null:null,'attributes':_0xfeab01[_0x7494('0x1d')]?_0xfeab01[_0x7494('0x1d')][_0x7494('0x1f')]||null:null,'limit':_0xfeab01[_0x7494('0x1d')]?_0xfeab01[_0x7494('0x1d')]['limit']||null:null})['then'](function(_0x44a6fd){logger['info'](_0x7494('0x1a'),_0xfeab01);logger[_0x7494('0x13')](_0x7494('0x1a'),_0xfeab01,JSON[_0x7494('0x15')](_0x44a6fd));_0x3352c7(_0x44a6fd);})[_0x7494('0x19')](function(_0x41d83f){logger['error'](_0x7494('0x1a'),_0x41d83f[_0x7494('0x18')],_0xfeab01);_0x22ef89(_0x599fec[_0x7494('0x16')](0x1f4,_0x41d83f['message']));});});};exports['AddTagsToFaxInteraction']=function(_0x59d7e2){return new Promise(function(_0x5ece20,_0x20a921){return db[_0x7494('0x1b')][_0x7494('0x20')]({'where':_0x59d7e2[_0x7494('0x1d')]?_0x59d7e2[_0x7494('0x1d')][_0x7494('0x1e')]||null:null})['then'](function(_0x40cf5d){if(_0x40cf5d){return _0x40cf5d[_0x7494('0x21')](_0x59d7e2[_0x7494('0x22')][_0x7494('0x23')],_[_0x7494('0x24')](_0x59d7e2['body'],[_0x7494('0x23'),'id'])||{});}})[_0x7494('0x25')](function(_0x54f508){logger[_0x7494('0x10')](_0x7494('0x26'),_0x59d7e2);logger['debug'](_0x7494('0x26'),_0x59d7e2,JSON[_0x7494('0x15')](_0x54f508));_0x5ece20(_0x54f508);})['catch'](function(_0x534f9a){logger[_0x7494('0x16')]('AddTags',_0x534f9a[_0x7494('0x18')],_0x59d7e2);_0x20a921(_this[_0x7494('0x16')](0x1f4,_0x534f9a[_0x7494('0x18')]));});});}; \ No newline at end of file +var _0x406d=['message','info','result','UpdateFaxInteraction','FaxInteraction','update','options','where','attributes','then','debug','stringify','AddTagsToFaxInteraction','addTags','ids','omit','body','spread','AddTags','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','FaxInteraction,\x20%s,\x20%s','FaxInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','code','error'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x406d,0x1b8));var _0xd406=function(_0x20b69c,_0x2f2bad){_0x20b69c=_0x20b69c-0x0;var _0x5c432f=_0x406d[_0x20b69c];return _0x5c432f;};'use strict';var _=require(_0xd406('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd406('0x1'));var rs=require(_0xd406('0x2'));var fs=require('fs');var Redis=require(_0xd406('0x3'));var db=require(_0xd406('0x4'))['db'];var utils=require(_0xd406('0x5'));var logger=require(_0xd406('0x6'))(_0xd406('0x7'));var config=require(_0xd406('0x8'));var jayson=require(_0xd406('0x9'));var client=jayson[_0xd406('0xa')]['http']({'port':0x232a});config[_0xd406('0xb')]=_[_0xd406('0xc')](config['redis'],{'host':_0xd406('0xd'),'port':0x18eb});var socket=require(_0xd406('0xe'))(new Redis(config[_0xd406('0xb')]));require('./faxInteraction.socket')[_0xd406('0xf')](socket);function respondWithRpcPromise(_0xae1021,_0x135230,_0x18dbdf){return new BPromise(function(_0x184bbc,_0x358c2d){return client[_0xd406('0x10')](_0xae1021,_0x18dbdf)['then'](function(_0x3a33eb){logger['info'](_0xd406('0x11'),_0x135230,'request\x20sent');logger['debug'](_0xd406('0x12'),_0x135230,_0xd406('0x13'),JSON['stringify'](_0x3a33eb));if(_0x3a33eb['error']){if(_0x3a33eb['error'][_0xd406('0x14')]===0x1f4){logger[_0xd406('0x15')](_0xd406('0x11'),_0x135230,_0x3a33eb[_0xd406('0x15')][_0xd406('0x16')]);return _0x358c2d(_0x3a33eb[_0xd406('0x15')][_0xd406('0x16')]);}logger[_0xd406('0x15')](_0xd406('0x11'),_0x135230,_0x3a33eb['error'][_0xd406('0x16')]);return _0x184bbc(_0x3a33eb['error'][_0xd406('0x16')]);}else{logger[_0xd406('0x17')](_0xd406('0x11'),_0x135230,_0xd406('0x13'));_0x184bbc(_0x3a33eb[_0xd406('0x18')]['message']);}})['catch'](function(_0x31bedf){logger[_0xd406('0x15')]('FaxInteraction,\x20%s,\x20%s',_0x135230,_0x31bedf);_0x358c2d(_0x31bedf);});});}exports[_0xd406('0x19')]=function(_0x104f11){var _0x14ea76=this;return new Promise(function(_0x343387,_0xe07ee8){return db[_0xd406('0x1a')][_0xd406('0x1b')](_0x104f11['body'],{'raw':_0x104f11['options']?_0x104f11[_0xd406('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x104f11['options']?_0x104f11['options'][_0xd406('0x1d')]||null:null,'attributes':_0x104f11[_0xd406('0x1c')]?_0x104f11['options'][_0xd406('0x1e')]||null:null,'limit':_0x104f11[_0xd406('0x1c')]?_0x104f11['options']['limit']||null:null})[_0xd406('0x1f')](function(_0x3c8c87){logger[_0xd406('0x17')]('UpdateFaxInteraction',_0x104f11);logger[_0xd406('0x20')](_0xd406('0x19'),_0x104f11,JSON[_0xd406('0x21')](_0x3c8c87));_0x343387(_0x3c8c87);})['catch'](function(_0x32c248){logger[_0xd406('0x15')](_0xd406('0x19'),_0x32c248[_0xd406('0x16')],_0x104f11);_0xe07ee8(_0x14ea76[_0xd406('0x15')](0x1f4,_0x32c248[_0xd406('0x16')]));});});};exports[_0xd406('0x22')]=function(_0x41a8b9){return new Promise(function(_0x504950,_0x34fc92){return db[_0xd406('0x1a')]['find']({'where':_0x41a8b9[_0xd406('0x1c')]?_0x41a8b9['options'][_0xd406('0x1d')]||null:null})[_0xd406('0x1f')](function(_0x94eac5){if(_0x94eac5){return _0x94eac5[_0xd406('0x23')](_0x41a8b9['body'][_0xd406('0x24')],_[_0xd406('0x25')](_0x41a8b9[_0xd406('0x26')],['ids','id'])||{});}})[_0xd406('0x27')](function(_0x7889ea){logger['info'](_0xd406('0x28'),_0x41a8b9);logger[_0xd406('0x20')](_0xd406('0x28'),_0x41a8b9,JSON[_0xd406('0x21')](_0x7889ea));_0x504950(_0x7889ea);})[_0xd406('0x29')](function(_0x17b973){logger[_0xd406('0x15')](_0xd406('0x28'),_0x17b973[_0xd406('0x16')],_0x41a8b9);_0x34fc92(_this[_0xd406('0x15')](0x1f4,_0x17b973[_0xd406('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 9b4e29f..e56b912 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 _0x3729=['register','length','faxInteraction:','save','remove'];(function(_0x124f9c,_0x128bbb){var _0x2a7cb7=function(_0x2575c2){while(--_0x2575c2){_0x124f9c['push'](_0x124f9c['shift']());}};_0x2a7cb7(++_0x128bbb);}(_0x3729,0x8a));var _0x9372=function(_0xfc1f94,_0x5c9f15){_0xfc1f94=_0xfc1f94-0x0;var _0x3a5884=_0x3729[_0xfc1f94];return _0x3a5884;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0x9372('0x0'),_0x9372('0x1'),'update'];function createListener(_0x56bde2,_0x370b5b){return function(_0x16d426){_0x370b5b['emit'](_0x56bde2,_0x16d426);};}function removeListener(_0x146149,_0x16a83e){return function(){FaxInteractionEvents['removeListener'](_0x146149,_0x16a83e);};}exports[_0x9372('0x2')]=function(_0x169bc3){for(var _0x795157=0x0,_0x251170=events[_0x9372('0x3')];_0x795157<_0x251170;_0x795157++){var _0x595046=events[_0x795157];var _0x309467=createListener(_0x9372('0x4')+_0x595046,_0x169bc3);FaxInteractionEvents['on'](_0x595046,_0x309467);}}; \ No newline at end of file +var _0xc37b=['faxInteraction:','./faxInteraction.events','save','update','removeListener','register'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc37b,0x127));var _0xbc37=function(_0x39109d,_0x84e5ce){_0x39109d=_0x39109d-0x0;var _0x138412=_0xc37b[_0x39109d];return _0x138412;};'use strict';var FaxInteractionEvents=require(_0xbc37('0x0'));var events=[_0xbc37('0x1'),'remove',_0xbc37('0x2')];function createListener(_0x19327a,_0x51a1cc){return function(_0x5c22b8){_0x51a1cc['emit'](_0x19327a,_0x5c22b8);};}function removeListener(_0x2656bc,_0x39c491){return function(){FaxInteractionEvents[_0xbc37('0x3')](_0x2656bc,_0x39c491);};}exports[_0xbc37('0x4')]=function(_0x3cc391){for(var _0x47a5f9=0x0,_0x395034=events['length'];_0x47a5f9<_0x395034;_0x47a5f9++){var _0x96c61c=events[_0x47a5f9];var _0x185d9c=createListener(_0xbc37('0x5')+_0x96c61c,_0x3cc391);FaxInteractionEvents['on'](_0x96c61c,_0x185d9c);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 972df7b..7a43383 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 _0xd931=['describe','show','/:id/messages','getMessages','post','addMessage','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','put','/:id','faxinteraction:update','update','faxinteraction:destroy','destroy','delete','removeTags','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','/describe'];(function(_0x1cca13,_0x283555){var _0x559744=function(_0x149cd0){while(--_0x149cd0){_0x1cca13['push'](_0x1cca13['shift']());}};_0x559744(++_0x283555);}(_0xd931,0xa4));var _0x1d93=function(_0x277b55,_0x8ba28){_0x277b55=_0x277b55-0x0;var _0xff0d15=_0xd931[_0x277b55];return _0xff0d15;};'use strict';var multer=require(_0x1d93('0x0'));var util=require(_0x1d93('0x1'));var path=require('path');var timeout=require(_0x1d93('0x2'));var express=require(_0x1d93('0x3'));var router=express[_0x1d93('0x4')]();var fs_extra=require(_0x1d93('0x5'));var auth=require(_0x1d93('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./faxInteraction.controller');router[_0x1d93('0x7')]('/',auth[_0x1d93('0x8')](),controller['index']);router[_0x1d93('0x7')](_0x1d93('0x9'),auth['isAuthenticated'](),controller[_0x1d93('0xa')]);router['get']('/:id',auth[_0x1d93('0x8')](),controller[_0x1d93('0xb')]);router[_0x1d93('0x7')](_0x1d93('0xc'),auth[_0x1d93('0x8')](),controller[_0x1d93('0xd')]);router[_0x1d93('0x7')]('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0x1d93('0xe')]('/',auth[_0x1d93('0x8')](),controller['create']);router[_0x1d93('0xe')](_0x1d93('0xc'),auth[_0x1d93('0x8')](),controller[_0x1d93('0xf')]);router[_0x1d93('0xe')](_0x1d93('0x10'),auth[_0x1d93('0x8')](),interaction[_0x1d93('0x11')](_0x1d93('0x12'),_0x1d93('0x13')),controller[_0x1d93('0x14')]);router[_0x1d93('0x15')](_0x1d93('0x16'),auth[_0x1d93('0x8')](),interaction[_0x1d93('0x11')](_0x1d93('0x12'),_0x1d93('0x17')),controller[_0x1d93('0x18')]);router['delete'](_0x1d93('0x16'),auth[_0x1d93('0x8')](),interaction['tracked'](_0x1d93('0x12'),_0x1d93('0x19')),controller[_0x1d93('0x1a')]);router[_0x1d93('0x1b')](_0x1d93('0x10'),auth[_0x1d93('0x8')](),controller[_0x1d93('0x1c')]);module['exports']=router; \ No newline at end of file +var _0x4374=['/:id/tags','faxinteraction:addtags','faxinteraction:update','update','delete','fax','faxinteraction:destroy','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','index','/describe','/:id','isAuthenticated','/:id/messages','getMessages','/:id/download','download','post','create'];(function(_0x7bc06,_0x494b70){var _0x251cb5=function(_0x157485){while(--_0x157485){_0x7bc06['push'](_0x7bc06['shift']());}};_0x251cb5(++_0x494b70);}(_0x4374,0x10e));var _0x4437=function(_0x2bf67f,_0x18212c){_0x2bf67f=_0x2bf67f-0x0;var _0x3e1104=_0x4374[_0x2bf67f];return _0x3e1104;};'use strict';var multer=require(_0x4437('0x0'));var util=require(_0x4437('0x1'));var path=require('path');var timeout=require(_0x4437('0x2'));var express=require(_0x4437('0x3'));var router=express[_0x4437('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4437('0x5'));var interaction=require(_0x4437('0x6'));var config=require(_0x4437('0x7'));var controller=require(_0x4437('0x8'));router[_0x4437('0x9')]('/',auth['isAuthenticated'](),controller[_0x4437('0xa')]);router[_0x4437('0x9')](_0x4437('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x4437('0xc'),auth[_0x4437('0xd')](),controller['show']);router[_0x4437('0x9')](_0x4437('0xe'),auth[_0x4437('0xd')](),controller[_0x4437('0xf')]);router[_0x4437('0x9')](_0x4437('0x10'),auth[_0x4437('0xd')](),controller[_0x4437('0x11')]);router[_0x4437('0x12')]('/',auth[_0x4437('0xd')](),controller[_0x4437('0x13')]);router['post'](_0x4437('0xe'),auth[_0x4437('0xd')](),controller['addMessage']);router['post'](_0x4437('0x14'),auth['isAuthenticated'](),interaction['tracked']('fax',_0x4437('0x15')),controller['addTags']);router['put'](_0x4437('0xc'),auth[_0x4437('0xd')](),interaction['tracked']('fax',_0x4437('0x16')),controller[_0x4437('0x17')]);router[_0x4437('0x18')](_0x4437('0xc'),auth[_0x4437('0xd')](),interaction['tracked'](_0x4437('0x19'),_0x4437('0x1a')),controller[_0x4437('0x1b')]);router[_0x4437('0x18')](_0x4437('0x14'),auth[_0x4437('0xd')](),controller['removeTags']);module[_0x4437('0x1c')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 4592088..e292612 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 _0x1306=['out','DATE','sequelize','exports','TEXT','medium','BOOLEAN','ENUM'];(function(_0x2a5bb7,_0x3a0bf3){var _0x503330=function(_0x61d76b){while(--_0x61d76b){_0x2a5bb7['push'](_0x2a5bb7['shift']());}};_0x503330(++_0x3a0bf3);}(_0x1306,0x17a));var _0x6130=function(_0xde0390,_0x38b16a){_0xde0390=_0xde0390-0x0;var _0x72b00e=_0x1306[_0xde0390];return _0x72b00e;};'use strict';var Sequelize=require(_0x6130('0x0'));module[_0x6130('0x1')]={'body':{'type':Sequelize[_0x6130('0x2')](_0x6130('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x6130('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x6130('0x5')]('in',_0x6130('0x6')),'defaultValue':_0x6130('0x6'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x6130('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0x6130('0x7')]}}; \ No newline at end of file +var _0x4876=['TEXT','ENUM','out','DATE'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x4876,0x84));var _0x6487=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4876[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x6487('0x0')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x6487('0x1')]('in','out'),'defaultValue':_0x6487('0x2'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x6487('0x0')],'defaultValue':null},'readAt':{'type':Sequelize[_0x6487('0x3')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 668eb5a..662c9aa 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 _0x8e92=['acceptmessage','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','interface','rejectmessage','create','CmContact','Attachment','findOne','AttachmentId','SendFax','FaxAccountId','basename','download','root','server','files','join','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','destroy','stack','name','map','FaxMessage','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','params','keys','find','body','describe','../../config/logger','fax-interactions','accept','fax','read','format','UserId','user','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','agent','fullname','email','internal','channel','motionChannel','event','EventManager'];(function(_0x9cede6,_0x435984){var _0x48aa48=function(_0x310993){while(--_0x310993){_0x9cede6['push'](_0x9cede6['shift']());}};_0x48aa48(++_0x435984);}(_0x8e92,0x1d1));var _0x28e9=function(_0x50bbed,_0xaf0ae2){_0x50bbed=_0x50bbed-0x0;var _0x4e53c2=_0x8e92[_0x50bbed];return _0x4e53c2;};'use strict';var emlformat=require(_0x28e9('0x0'));var rimraf=require(_0x28e9('0x1'));var zipdir=require(_0x28e9('0x2'));var jsonpatch=require(_0x28e9('0x3'));var rp=require(_0x28e9('0x4'));var moment=require(_0x28e9('0x5'));var BPromise=require(_0x28e9('0x6'));var Mustache=require(_0x28e9('0x7'));var util=require(_0x28e9('0x8'));var path=require(_0x28e9('0x9'));var sox=require(_0x28e9('0xa'));var csv=require(_0x28e9('0xb'));var ejs=require(_0x28e9('0xc'));var fs=require('fs');var fs_extra=require(_0x28e9('0xd'));var _=require(_0x28e9('0xe'));var squel=require(_0x28e9('0xf'));var crypto=require('crypto');var jsforce=require(_0x28e9('0x10'));var deskjs=require(_0x28e9('0x11'));var toCsv=require(_0x28e9('0xb'));var querystring=require(_0x28e9('0x12'));var Papa=require(_0x28e9('0x13'));var Redis=require(_0x28e9('0x14'));var authService=require(_0x28e9('0x15'));var qs=require(_0x28e9('0x16'));var as=require(_0x28e9('0x17'));var hardwareService=require(_0x28e9('0x18'));var logger=require('../../config/logger')(_0x28e9('0x19'));var utils=require('../../config/utils');var config=require(_0x28e9('0x1a'));var licenseUtil=require(_0x28e9('0x1b'));var db=require(_0x28e9('0x1c'))['db'];config['redis']=_[_0x28e9('0x1d')](config[_0x28e9('0x1e')],{'host':_0x28e9('0x1f'),'port':0x18eb});var socket=require(_0x28e9('0x20'))(new Redis(config[_0x28e9('0x1e')]));require(_0x28e9('0x21'))[_0x28e9('0x22')](socket);var jayson=require(_0x28e9('0x23'));var client=jayson[_0x28e9('0x24')]['http']({'port':0x232c});var client9002=jayson[_0x28e9('0x24')][_0x28e9('0x25')]({'port':0x232a});function respondWithRpcPromise(_0x4bada5,_0x5e83ff,_0x2863cc,_0xaee4d0){return new BPromise(function(_0xfe535c,_0x54bfdb){var _0x7fd161=_0xaee4d0||client;return _0x7fd161[_0x28e9('0x26')](_0x4bada5,_0x2863cc)[_0x28e9('0x27')](function(_0x5dc3d6){logger[_0x28e9('0x28')](_0x28e9('0x29'),_0x5e83ff,_0x28e9('0x2a'));logger[_0x28e9('0x2b')](_0x28e9('0x2c'),_0x5e83ff,_0x28e9('0x2a'),JSON[_0x28e9('0x2d')](_0x5dc3d6));if(_0x5dc3d6['error']){if(_0x5dc3d6[_0x28e9('0x2e')][_0x28e9('0x2f')]===0x1f4){logger['error'](_0x28e9('0x29'),_0x5e83ff,_0x5dc3d6[_0x28e9('0x2e')][_0x28e9('0x30')]);return _0x54bfdb(_0x5dc3d6[_0x28e9('0x2e')][_0x28e9('0x30')]);}logger['error'](_0x28e9('0x29'),_0x5e83ff,_0x5dc3d6['error']['message']);return _0xfe535c(_0x5dc3d6['error'][_0x28e9('0x30')]);}else{logger[_0x28e9('0x28')](_0x28e9('0x29'),_0x5e83ff,_0x28e9('0x2a'));_0xfe535c(_0x5dc3d6[_0x28e9('0x31')][_0x28e9('0x30')]);}})[_0x28e9('0x32')](function(_0x2bdc3a){logger[_0x28e9('0x2e')]('FaxMessage,\x20%s,\x20%s',_0x5e83ff,_0x2bdc3a);_0x54bfdb(_0x2bdc3a);});});}function respondWithStatusCode(_0x4c83c2,_0x8d4c0b){_0x8d4c0b=_0x8d4c0b||0xcc;return function(_0x41e7e3){if(_0x41e7e3){return _0x4c83c2[_0x28e9('0x33')](_0x8d4c0b);}return _0x4c83c2[_0x28e9('0x34')](_0x8d4c0b)[_0x28e9('0x35')]();};}function respondWithResult(_0x4708f4,_0x3feb44){_0x3feb44=_0x3feb44||0xc8;return function(_0x567c44){if(_0x567c44){return _0x4708f4[_0x28e9('0x34')](_0x3feb44)['json'](_0x567c44);}};}function respondWithFilteredResult(_0x4e6838,_0x4d4050){return function(_0x33fcc4){if(_0x33fcc4){var _0x11a887=typeof _0x4d4050['offset']==='undefined'&&typeof _0x4d4050[_0x28e9('0x36')]===_0x28e9('0x37');var _0x452228=_0x33fcc4[_0x28e9('0x38')];var _0x5a8276=_0x11a887?0x0:_0x4d4050[_0x28e9('0x39')];var _0x331b48=_0x11a887?_0x33fcc4[_0x28e9('0x38')]:_0x4d4050[_0x28e9('0x39')]+_0x4d4050['limit'];var _0x579b34;if(_0x331b48>=_0x452228){_0x331b48=_0x452228;_0x579b34=0xc8;}else{_0x579b34=0xce;}_0x4e6838[_0x28e9('0x34')](_0x579b34);return _0x4e6838[_0x28e9('0x3a')](_0x28e9('0x3b'),_0x5a8276+'-'+_0x331b48+'/'+_0x452228)['json'](_0x33fcc4);}return null;};}function patchUpdates(_0x56e0b5){return function(_0x1c0c37){try{jsonpatch[_0x28e9('0x3c')](_0x1c0c37,_0x56e0b5,!![]);}catch(_0x2cade6){return BPromise[_0x28e9('0x3d')](_0x2cade6);}return _0x1c0c37[_0x28e9('0x3e')]();};}function saveUpdates(_0x17e1ff,_0x49944a){return function(_0x2f4b0c){if(_0x2f4b0c){return _0x2f4b0c[_0x28e9('0x3f')](_0x17e1ff)['then'](function(_0x1751d5){return _0x1751d5;});}return null;};}function removeEntity(_0x36ac02,_0x24efaf){return function(_0x26accc){if(_0x26accc){return _0x26accc[_0x28e9('0x40')]()['then'](function(){_0x36ac02[_0x28e9('0x34')](0xcc)['end']();});}};}function handleEntityNotFound(_0x55e2da,_0x10fa34){return function(_0x5c3e6f){if(!_0x5c3e6f){_0x55e2da[_0x28e9('0x33')](0x194);}return _0x5c3e6f;};}function handleError(_0x1add78,_0x4c2630){_0x4c2630=_0x4c2630||0x1f4;return function(_0x331290){logger[_0x28e9('0x2e')](_0x331290[_0x28e9('0x41')]);if(_0x331290['name']){delete _0x331290[_0x28e9('0x42')];}_0x1add78[_0x28e9('0x34')](_0x4c2630)['send'](_0x331290);};}exports['index']=function(_0x420c13,_0x1e6cca){var _0x39169e={},_0x21cd26={},_0x2498c3={'count':0x0,'rows':[]};var _0x554b8a=_[_0x28e9('0x43')](db[_0x28e9('0x44')][_0x28e9('0x45')],function(_0xd09d68){return{'name':_0xd09d68[_0x28e9('0x46')],'type':_0xd09d68[_0x28e9('0x47')]['key']};});_0x21cd26[_0x28e9('0x48')]=_[_0x28e9('0x43')](_0x554b8a,_0x28e9('0x42'));_0x21cd26[_0x28e9('0x49')]=_['keys'](_0x420c13[_0x28e9('0x49')]);_0x21cd26[_0x28e9('0x4a')]=_[_0x28e9('0x4b')](_0x21cd26['model'],_0x21cd26['query']);_0x39169e[_0x28e9('0x4c')]=_[_0x28e9('0x4b')](_0x21cd26[_0x28e9('0x48')],qs[_0x28e9('0x4d')](_0x420c13[_0x28e9('0x49')][_0x28e9('0x4d')]));_0x39169e[_0x28e9('0x4c')]=_0x39169e[_0x28e9('0x4c')][_0x28e9('0x4e')]?_0x39169e[_0x28e9('0x4c')]:_0x21cd26[_0x28e9('0x48')];if(!_0x420c13[_0x28e9('0x49')][_0x28e9('0x4f')](_0x28e9('0x50'))){_0x39169e['limit']=qs[_0x28e9('0x36')](_0x420c13['query'][_0x28e9('0x36')]);_0x39169e[_0x28e9('0x39')]=qs['offset'](_0x420c13[_0x28e9('0x49')][_0x28e9('0x39')]);}_0x39169e[_0x28e9('0x51')]=qs[_0x28e9('0x52')](_0x420c13[_0x28e9('0x49')][_0x28e9('0x52')]);_0x39169e[_0x28e9('0x53')]=qs[_0x28e9('0x4a')](_[_0x28e9('0x54')](_0x420c13[_0x28e9('0x49')],_0x21cd26['filters']),_0x554b8a);if(_0x420c13[_0x28e9('0x49')][_0x28e9('0x55')]){_0x39169e[_0x28e9('0x53')]=_['merge'](_0x39169e[_0x28e9('0x53')],{'$or':_[_0x28e9('0x43')](_0x554b8a,function(_0x2ce9e1){if(_0x2ce9e1[_0x28e9('0x47')]!=='VIRTUAL'){var _0x2b7d5e={};_0x2b7d5e[_0x2ce9e1[_0x28e9('0x42')]]={'$like':'%'+_0x420c13[_0x28e9('0x49')][_0x28e9('0x55')]+'%'};return _0x2b7d5e;}})});}_0x39169e=_[_0x28e9('0x56')]({},_0x39169e,_0x420c13['options']);var _0x31c037={'where':_0x39169e[_0x28e9('0x53')]};return db['FaxMessage'][_0x28e9('0x38')](_0x31c037)[_0x28e9('0x27')](function(_0x3fb75b){_0x2498c3[_0x28e9('0x38')]=_0x3fb75b;if(_0x420c13[_0x28e9('0x49')][_0x28e9('0x57')]){_0x39169e[_0x28e9('0x58')]=[{'all':!![]}];}return db['FaxMessage'][_0x28e9('0x59')](_0x39169e);})['then'](function(_0x204d00){_0x2498c3[_0x28e9('0x5a')]=_0x204d00;return _0x2498c3;})['then'](respondWithFilteredResult(_0x1e6cca,_0x39169e))['catch'](handleError(_0x1e6cca,null));};exports['show']=function(_0x4dee24,_0x272b49){var _0x3ea4aa={'raw':!![],'where':{'id':_0x4dee24[_0x28e9('0x5b')]['id']}},_0x17fa33={};_0x17fa33[_0x28e9('0x48')]=_[_0x28e9('0x5c')](db[_0x28e9('0x44')][_0x28e9('0x45')]);_0x17fa33[_0x28e9('0x49')]=_[_0x28e9('0x5c')](_0x4dee24[_0x28e9('0x49')]);_0x17fa33[_0x28e9('0x4a')]=_[_0x28e9('0x4b')](_0x17fa33[_0x28e9('0x48')],_0x17fa33[_0x28e9('0x49')]);_0x3ea4aa[_0x28e9('0x4c')]=_[_0x28e9('0x4b')](_0x17fa33[_0x28e9('0x48')],qs[_0x28e9('0x4d')](_0x4dee24[_0x28e9('0x49')][_0x28e9('0x4d')]));_0x3ea4aa['attributes']=_0x3ea4aa['attributes'][_0x28e9('0x4e')]?_0x3ea4aa['attributes']:_0x17fa33[_0x28e9('0x48')];if(_0x4dee24[_0x28e9('0x49')][_0x28e9('0x57')]){_0x3ea4aa['include']=[{'all':!![]}];}_0x3ea4aa=_[_0x28e9('0x56')]({},_0x3ea4aa,_0x4dee24['options']);return db['FaxMessage'][_0x28e9('0x5d')](_0x3ea4aa)['then'](handleEntityNotFound(_0x272b49,null))['then'](respondWithResult(_0x272b49,null))[_0x28e9('0x32')](handleError(_0x272b49,null));};exports[_0x28e9('0x3f')]=function(_0x25dd08,_0x3d718a){if(_0x25dd08['body']['id']){delete _0x25dd08[_0x28e9('0x5e')]['id'];}return db[_0x28e9('0x44')][_0x28e9('0x5d')]({'where':{'id':_0x25dd08[_0x28e9('0x5b')]['id']}})[_0x28e9('0x27')](handleEntityNotFound(_0x3d718a,null))[_0x28e9('0x27')](saveUpdates(_0x25dd08[_0x28e9('0x5e')],null))[_0x28e9('0x27')](respondWithResult(_0x3d718a,null))[_0x28e9('0x32')](handleError(_0x3d718a,null));};exports[_0x28e9('0x40')]=function(_0x5d12a4,_0x273bf6){return db[_0x28e9('0x44')][_0x28e9('0x5d')]({'where':{'id':_0x5d12a4[_0x28e9('0x5b')]['id']}})[_0x28e9('0x27')](handleEntityNotFound(_0x273bf6,null))[_0x28e9('0x27')](removeEntity(_0x273bf6,null))[_0x28e9('0x32')](handleError(_0x273bf6,null));};exports[_0x28e9('0x5f')]=function(_0x3a11af,_0xe8e679){return db['FaxMessage'][_0x28e9('0x5f')]()[_0x28e9('0x27')](respondWithResult(_0xe8e679,null))[_0x28e9('0x32')](handleError(_0xe8e679,null));};var interaction_log=require(_0x28e9('0x60'))(_0x28e9('0x61'));exports[_0x28e9('0x62')]=function(_0x1651ea,_0x542737,_0x15391e){var _0x266d27={'agent':{},'channel':_0x28e9('0x63')};if(_0x1651ea[_0x28e9('0x5e')]['id']){delete _0x1651ea[_0x28e9('0x5e')]['id'];}_0x1651ea[_0x28e9('0x5e')][_0x28e9('0x64')]=!![];_0x1651ea[_0x28e9('0x5e')]['readAt']=moment()[_0x28e9('0x65')]('YYYY-MM-DD\x20HH:mm:ss');_0x1651ea[_0x28e9('0x5e')][_0x28e9('0x66')]=_0x1651ea[_0x28e9('0x5e')][_0x28e9('0x66')]||_0x1651ea[_0x28e9('0x67')]['id'];_0x266d27['agent']['id']=_0x1651ea[_0x28e9('0x5e')][_0x28e9('0x66')];return db['FaxMessage']['find']({'where':{'id':_0x1651ea[_0x28e9('0x5b')]['id'],'UserId':null}})[_0x28e9('0x27')](handleEntityNotFound(_0x542737,null))[_0x28e9('0x27')](saveUpdates(_0x1651ea[_0x28e9('0x5e')],null))[_0x28e9('0x27')](function(_0x433998){if(_0x433998){_0x266d27[_0x28e9('0x30')]=_0x433998[_0x28e9('0x68')]({'plain':!![]});return db[_0x28e9('0x69')][_0x28e9('0x5d')]({'where':{'id':_0x433998[_0x28e9('0x6a')]}});}return null;})[_0x28e9('0x27')](handleEntityNotFound(_0x542737,null))[_0x28e9('0x27')](function(_0x394654){if(_0x394654){return _0x394654[_0x28e9('0x3f')]({'UserId':_0x1651ea[_0x28e9('0x5e')][_0x28e9('0x66')],'read1stAt':_[_0x28e9('0x6b')](_0x394654[_0x28e9('0x6c')])?moment()['format'](_0x28e9('0x6d')):undefined});}return null;})['then'](function(_0x4b06a3){if(_0x4b06a3){_0x266d27[_0x28e9('0x6e')]=_0x4b06a3[_0x28e9('0x68')]({'plain':!![]});interaction_log[_0x28e9('0x28')](_0x28e9('0x6f'),_0x1651ea[_0x28e9('0x67')]['id'],_0x1651ea[_0x28e9('0x67')][_0x28e9('0x42')],_0x1651ea['user'][_0x28e9('0x70')],_0x266d27['interaction']['id'],_0x1651ea[_0x28e9('0x5e')]?JSON[_0x28e9('0x2d')](_0x1651ea[_0x28e9('0x5e')]):_0x28e9('0x71'));return respondWithRpcPromise(_0x28e9('0x72'),'acceptMessage',_0x266d27);}return null;})[_0x28e9('0x27')](function(_0xbfe57b){var _0x32a6bc=_0x28e9('0x73')+_0xbfe57b[_0x28e9('0x30')][_0x28e9('0x74')];return db[_0x28e9('0x75')]['query'](_0x32a6bc,{'type':db[_0x28e9('0x76')][_0x28e9('0x77')][_0x28e9('0x78')],'raw':!![]})[_0x28e9('0x27')](function(_0x5b16d8){return _0x5b16d8;});})[_0x28e9('0x27')](function(_0x1d5ebb){if(_0x1d5ebb){_0x266d27[_0x28e9('0x30')][_0x28e9('0x79')]=_0x1d5ebb[0x0];if(!_0x1651ea[_0x28e9('0x5e')][_0x28e9('0x66')])return;return db[_0x28e9('0x7a')]['find']({'where':{'id':_0x1651ea[_0x28e9('0x5e')]['UserId'],'role':_0x28e9('0x7b')},'attributes':['id','name',_0x28e9('0x7c'),_0x28e9('0x7d'),_0x28e9('0x7e')],'raw':!![]});}return null;})['then'](function(_0x39e458){if(!_0x39e458)return null;_0x266d27['message']['agent']=_0x39e458;return _0x266d27;})[_0x28e9('0x27')](function(_0x15027d){if(_0x15027d){if(_0x1651ea[_0x28e9('0x5e')]['manual']){_0x266d27[_0x28e9('0x30')]['interface']=util[_0x28e9('0x65')]('SIP/%s',_0x1651ea[_0x28e9('0x67')][_0x28e9('0x42')]);_0x266d27[_0x28e9('0x30')][_0x28e9('0x7f')]=_0x266d27[_0x28e9('0x7f')];_0x266d27[_0x28e9('0x30')][_0x28e9('0x80')]=_0x266d27[_0x28e9('0x7f')];_0x266d27[_0x28e9('0x30')][_0x28e9('0x81')]=_0x28e9('0x62');return respondWithRpcPromise(_0x28e9('0x82'),_0x28e9('0x82'),{'event':_0x28e9('0x83'),'message':_0x266d27[_0x28e9('0x30')]},client9002)['then'](function(){return _0x266d27;});}return _0x266d27;}return null;})[_0x28e9('0x27')](respondWithResult(_0x542737,null))['catch'](handleError(_0x542737,null));};var interaction_log=require(_0x28e9('0x60'))('fax-interactions');exports[_0x28e9('0x3d')]=function(_0x4aba67,_0x91e872,_0x1614a0){var _0x2632e6={'agent':{},'channel':'fax'};if(_0x4aba67[_0x28e9('0x5e')]['id']){delete _0x4aba67[_0x28e9('0x5e')]['id'];}_0x4aba67[_0x28e9('0x5e')][_0x28e9('0x66')]=_0x4aba67[_0x28e9('0x5e')][_0x28e9('0x66')]||_0x4aba67[_0x28e9('0x67')]['id'];_0x2632e6[_0x28e9('0x7b')]['id']=_0x4aba67[_0x28e9('0x5e')]['UserId'];return db[_0x28e9('0x44')][_0x28e9('0x5d')]({'where':{'id':_0x4aba67['params']['id'],'UserId':null}})[_0x28e9('0x27')](handleEntityNotFound(_0x91e872,null))['then'](function(_0x54d485){if(_0x54d485){_0x2632e6[_0x28e9('0x30')]=_0x54d485[_0x28e9('0x68')]({'plain':!![]});return db[_0x28e9('0x69')][_0x28e9('0x5d')]({'where':{'id':_0x54d485['FaxInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x91e872,null))[_0x28e9('0x27')](function(_0x1e893b){if(_0x1e893b){_0x2632e6['interaction']=_0x1e893b[_0x28e9('0x68')]({'plain':!![]});interaction_log[_0x28e9('0x28')](_0x28e9('0x84'),_0x4aba67[_0x28e9('0x67')]['id'],_0x4aba67[_0x28e9('0x67')][_0x28e9('0x42')],_0x4aba67[_0x28e9('0x67')]['role'],_0x2632e6[_0x28e9('0x6e')]['id'],_0x4aba67['body']?JSON[_0x28e9('0x2d')](_0x4aba67[_0x28e9('0x5e')]):_0x28e9('0x71'));return respondWithRpcPromise('RejectMessage',_0x28e9('0x85'),_0x2632e6);}return null;})[_0x28e9('0x27')](function(_0x4d4be5){var _0xda4b6d=_0x28e9('0x73')+_0x4d4be5[_0x28e9('0x30')][_0x28e9('0x74')];return db[_0x28e9('0x75')][_0x28e9('0x49')](_0xda4b6d,{'type':db['Sequelize'][_0x28e9('0x77')][_0x28e9('0x78')],'raw':!![]})[_0x28e9('0x27')](function(_0x5b126d){return _0x5b126d;});})['then'](function(_0x9f4c77){if(_0x9f4c77){_0x2632e6[_0x28e9('0x30')][_0x28e9('0x79')]=_0x9f4c77[0x0];if(!_0x4aba67[_0x28e9('0x5e')]['UserId'])return;return db['User'][_0x28e9('0x5d')]({'where':{'id':_0x4aba67[_0x28e9('0x5e')][_0x28e9('0x66')],'role':'agent'},'attributes':['id',_0x28e9('0x42'),_0x28e9('0x7c'),'email','internal'],'raw':!![]});}return null;})[_0x28e9('0x27')](function(_0xc37dff){if(!_0xc37dff)return null;_0x2632e6[_0x28e9('0x30')][_0x28e9('0x7b')]=_0xc37dff;return _0x2632e6;})['then'](function(_0x47d5c5){if(_0x47d5c5){_0x47d5c5[_0x28e9('0x30')][_0x28e9('0x86')]=util[_0x28e9('0x65')]('SIP/%s',_0x4aba67['user'][_0x28e9('0x42')]);_0x47d5c5[_0x28e9('0x30')][_0x28e9('0x7f')]=_0x2632e6['channel'];_0x47d5c5[_0x28e9('0x30')][_0x28e9('0x80')]=_0x2632e6['channel'];_0x47d5c5[_0x28e9('0x30')][_0x28e9('0x81')]=_0x28e9('0x3d');respondWithRpcPromise(_0x28e9('0x82'),_0x28e9('0x82'),{'event':_0x28e9('0x87'),'message':_0x47d5c5[_0x28e9('0x30')]},client9002);return _0x2632e6;}return null;})[_0x28e9('0x27')](respondWithResult(_0x91e872,null))[_0x28e9('0x32')](handleError(_0x91e872,null));};exports[_0x28e9('0x88')]=function(_0x13b946,_0x1c90d2){var _0x4888e8;return db[_0x28e9('0x44')][_0x28e9('0x88')](_0x13b946[_0x28e9('0x5e')],{})['then'](function(_0x1b6822){_0x4888e8=_0x1b6822;return db[_0x28e9('0x89')]['findOne']({'where':{'id':_0x4888e8[_0x28e9('0x74')]}});})[_0x28e9('0x27')](function(_0x13f076){if(_[_0x28e9('0x6b')](_0x13f076)){return;}else{_0x4888e8[_0x28e9('0x63')]=_0x13f076[_0x28e9('0x63')];return db[_0x28e9('0x8a')][_0x28e9('0x8b')]({'where':{'id':_0x4888e8[_0x28e9('0x8c')]}});}})['then'](function(_0x3cc13b){return respondWithRpcPromise('SendFax',_0x28e9('0x8d'),{'FaxAccountId':_[_0x28e9('0x6b')](_0x13b946['body'])?undefined:_0x13b946[_0x28e9('0x5e')][_0x28e9('0x8e')],'path':_[_0x28e9('0x6b')](_0x3cc13b)?undefined:util[_0x28e9('0x65')]('/var/opt/motion2/server/files/attachments/%s',_0x3cc13b[_0x28e9('0x8f')]),'fax':_['isNil'](_0x4888e8[_0x28e9('0x63')])?undefined:_0x4888e8[_0x28e9('0x63')],'AttachmentId':_0x4888e8[_0x28e9('0x8c')]},client9002);})['then'](respondWithResult(_0x1c90d2,0xc9))[_0x28e9('0x32')](handleError(_0x1c90d2,null));};exports[_0x28e9('0x90')]=function(_0x14b03a,_0x12f523){var _0x14f8d7=path['join'](config[_0x28e9('0x91')],_0x28e9('0x92'),_0x28e9('0x93'),'attachments');return db['FaxMessage']['find']({'where':{'id':_0x14b03a[_0x28e9('0x5b')]['id']},'include':[{'model':db['Attachment'],'as':_0x28e9('0x8a')}]})['then'](handleEntityNotFound(_0x12f523,null))[_0x28e9('0x27')](function(_0x416a00){if(_0x416a00){return _0x12f523[_0x28e9('0x90')](path[_0x28e9('0x94')](_0x14f8d7,_0x416a00[_0x28e9('0x8a')][_0x28e9('0x8f')]));}})[_0x28e9('0x32')](handleError(_0x12f523,null));}; \ No newline at end of file +var _0x2485=['map','FaxMessage','rawAttributes','type','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','params','fields','body','find','describe','fax-interactions','accept','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','contact','User','fullname','internal','manual','SIP/%s','channel','EventManager','acceptmessage','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','QueryTypes','SELECT','interface','motionChannel','rejectmessage','create','CmContact','findOne','Attachment','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','AttachmentId','download','join','root','server','files','attachments','basename','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','to-csv','lodash','squel','crypto','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./faxMessage.socket','register','jayson/promise','client','http','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','undefined','limit','offset','count','Content-Range','json','apply','reject','update','destroy','end','sendStatus','name','send','index'];(function(_0x49d95f,_0x44481a){var _0x3768fb=function(_0x8059fe){while(--_0x8059fe){_0x49d95f['push'](_0x49d95f['shift']());}};_0x3768fb(++_0x44481a);}(_0x2485,0x16f));var _0x5248=function(_0x26307f,_0x562b44){_0x26307f=_0x26307f-0x0;var _0x5ac553=_0x2485[_0x26307f];return _0x5ac553;};'use strict';var emlformat=require(_0x5248('0x0'));var rimraf=require(_0x5248('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5248('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5248('0x3'));var Mustache=require(_0x5248('0x4'));var util=require(_0x5248('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x5248('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5248('0x7'));var squel=require(_0x5248('0x8'));var crypto=require(_0x5248('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5248('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5248('0xa'));var qs=require(_0x5248('0xb'));var as=require(_0x5248('0xc'));var hardwareService=require(_0x5248('0xd'));var logger=require(_0x5248('0xe'))(_0x5248('0xf'));var utils=require(_0x5248('0x10'));var config=require(_0x5248('0x11'));var licenseUtil=require(_0x5248('0x12'));var db=require(_0x5248('0x13'))['db'];config['redis']=_[_0x5248('0x14')](config[_0x5248('0x15')],{'host':_0x5248('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5248('0x15')]));require(_0x5248('0x17'))[_0x5248('0x18')](socket);var jayson=require(_0x5248('0x19'));var client=jayson[_0x5248('0x1a')][_0x5248('0x1b')]({'port':0x232c});var client9002=jayson[_0x5248('0x1a')][_0x5248('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0xe6ed27,_0x5ed389,_0xae732d,_0x48fe6a){return new BPromise(function(_0x2320aa,_0x366c1d){var _0x75dedc=_0x48fe6a||client;return _0x75dedc[_0x5248('0x1c')](_0xe6ed27,_0xae732d)[_0x5248('0x1d')](function(_0x35dbcf){logger[_0x5248('0x1e')](_0x5248('0x1f'),_0x5ed389,_0x5248('0x20'));logger['debug'](_0x5248('0x21'),_0x5ed389,_0x5248('0x20'),JSON[_0x5248('0x22')](_0x35dbcf));if(_0x35dbcf[_0x5248('0x23')]){if(_0x35dbcf[_0x5248('0x23')][_0x5248('0x24')]===0x1f4){logger[_0x5248('0x23')](_0x5248('0x1f'),_0x5ed389,_0x35dbcf[_0x5248('0x23')]['message']);return _0x366c1d(_0x35dbcf[_0x5248('0x23')][_0x5248('0x25')]);}logger[_0x5248('0x23')](_0x5248('0x1f'),_0x5ed389,_0x35dbcf[_0x5248('0x23')][_0x5248('0x25')]);return _0x2320aa(_0x35dbcf['error'][_0x5248('0x25')]);}else{logger[_0x5248('0x1e')](_0x5248('0x1f'),_0x5ed389,'request\x20sent');_0x2320aa(_0x35dbcf[_0x5248('0x26')][_0x5248('0x25')]);}})[_0x5248('0x27')](function(_0x4647a4){logger[_0x5248('0x23')]('FaxMessage,\x20%s,\x20%s',_0x5ed389,_0x4647a4);_0x366c1d(_0x4647a4);});});}function respondWithStatusCode(_0x2b1a9d,_0x11469){_0x11469=_0x11469||0xcc;return function(_0x3391b2){if(_0x3391b2){return _0x2b1a9d['sendStatus'](_0x11469);}return _0x2b1a9d[_0x5248('0x28')](_0x11469)['end']();};}function respondWithResult(_0x4685c7,_0x36049f){_0x36049f=_0x36049f||0xc8;return function(_0x23a8e0){if(_0x23a8e0){return _0x4685c7[_0x5248('0x28')](_0x36049f)['json'](_0x23a8e0);}};}function respondWithFilteredResult(_0x10c2bd,_0x1596ec){return function(_0xe21dca){if(_0xe21dca){var _0x39942d=typeof _0x1596ec['offset']===_0x5248('0x29')&&typeof _0x1596ec[_0x5248('0x2a')]===_0x5248('0x29');var _0x5901f5=_0xe21dca['count'];var _0x442147=_0x39942d?0x0:_0x1596ec[_0x5248('0x2b')];var _0x28d644=_0x39942d?_0xe21dca[_0x5248('0x2c')]:_0x1596ec[_0x5248('0x2b')]+_0x1596ec[_0x5248('0x2a')];var _0x298b3b;if(_0x28d644>=_0x5901f5){_0x28d644=_0x5901f5;_0x298b3b=0xc8;}else{_0x298b3b=0xce;}_0x10c2bd['status'](_0x298b3b);return _0x10c2bd['set'](_0x5248('0x2d'),_0x442147+'-'+_0x28d644+'/'+_0x5901f5)[_0x5248('0x2e')](_0xe21dca);}return null;};}function patchUpdates(_0x42a12f){return function(_0x175b39){try{jsonpatch[_0x5248('0x2f')](_0x175b39,_0x42a12f,!![]);}catch(_0x831df8){return BPromise[_0x5248('0x30')](_0x831df8);}return _0x175b39['save']();};}function saveUpdates(_0x3ca678,_0x563598){return function(_0x19d412){if(_0x19d412){return _0x19d412[_0x5248('0x31')](_0x3ca678)[_0x5248('0x1d')](function(_0x39f0b2){return _0x39f0b2;});}return null;};}function removeEntity(_0x17e74b,_0x938999){return function(_0x10cc9a){if(_0x10cc9a){return _0x10cc9a[_0x5248('0x32')]()[_0x5248('0x1d')](function(){_0x17e74b['status'](0xcc)[_0x5248('0x33')]();});}};}function handleEntityNotFound(_0xbabe0d,_0x1bded7){return function(_0x3f3497){if(!_0x3f3497){_0xbabe0d[_0x5248('0x34')](0x194);}return _0x3f3497;};}function handleError(_0x3df542,_0x421231){_0x421231=_0x421231||0x1f4;return function(_0x140803){logger[_0x5248('0x23')](_0x140803['stack']);if(_0x140803[_0x5248('0x35')]){delete _0x140803[_0x5248('0x35')];}_0x3df542[_0x5248('0x28')](_0x421231)[_0x5248('0x36')](_0x140803);};}exports[_0x5248('0x37')]=function(_0x3e8302,_0x143f39){var _0x4a70a5={},_0x57cf31={},_0x41789d={'count':0x0,'rows':[]};var _0x138c2c=_[_0x5248('0x38')](db[_0x5248('0x39')][_0x5248('0x3a')],function(_0x194426){return{'name':_0x194426['fieldName'],'type':_0x194426[_0x5248('0x3b')]['key']};});_0x57cf31[_0x5248('0x3c')]=_[_0x5248('0x38')](_0x138c2c,'name');_0x57cf31[_0x5248('0x3d')]=_[_0x5248('0x3e')](_0x3e8302[_0x5248('0x3d')]);_0x57cf31[_0x5248('0x3f')]=_[_0x5248('0x40')](_0x57cf31[_0x5248('0x3c')],_0x57cf31[_0x5248('0x3d')]);_0x4a70a5[_0x5248('0x41')]=_[_0x5248('0x40')](_0x57cf31['model'],qs['fields'](_0x3e8302[_0x5248('0x3d')]['fields']));_0x4a70a5[_0x5248('0x41')]=_0x4a70a5[_0x5248('0x41')][_0x5248('0x42')]?_0x4a70a5[_0x5248('0x41')]:_0x57cf31[_0x5248('0x3c')];if(!_0x3e8302['query'][_0x5248('0x43')](_0x5248('0x44'))){_0x4a70a5[_0x5248('0x2a')]=qs[_0x5248('0x2a')](_0x3e8302[_0x5248('0x3d')][_0x5248('0x2a')]);_0x4a70a5[_0x5248('0x2b')]=qs['offset'](_0x3e8302[_0x5248('0x3d')]['offset']);}_0x4a70a5[_0x5248('0x45')]=qs[_0x5248('0x46')](_0x3e8302[_0x5248('0x3d')][_0x5248('0x46')]);_0x4a70a5['where']=qs['filters'](_[_0x5248('0x47')](_0x3e8302['query'],_0x57cf31[_0x5248('0x3f')]),_0x138c2c);if(_0x3e8302[_0x5248('0x3d')][_0x5248('0x48')]){_0x4a70a5[_0x5248('0x49')]=_[_0x5248('0x4a')](_0x4a70a5[_0x5248('0x49')],{'$or':_[_0x5248('0x38')](_0x138c2c,function(_0x3dbd78){if(_0x3dbd78[_0x5248('0x3b')]!==_0x5248('0x4b')){var _0x341572={};_0x341572[_0x3dbd78['name']]={'$like':'%'+_0x3e8302['query'][_0x5248('0x48')]+'%'};return _0x341572;}})});}_0x4a70a5=_['merge']({},_0x4a70a5,_0x3e8302[_0x5248('0x4c')]);var _0x5ef30b={'where':_0x4a70a5[_0x5248('0x49')]};return db['FaxMessage']['count'](_0x5ef30b)['then'](function(_0x229a65){_0x41789d[_0x5248('0x2c')]=_0x229a65;if(_0x3e8302['query'][_0x5248('0x4d')]){_0x4a70a5['include']=[{'all':!![]}];}return db[_0x5248('0x39')][_0x5248('0x4e')](_0x4a70a5);})['then'](function(_0x33548c){_0x41789d[_0x5248('0x4f')]=_0x33548c;return _0x41789d;})[_0x5248('0x1d')](respondWithFilteredResult(_0x143f39,_0x4a70a5))[_0x5248('0x27')](handleError(_0x143f39,null));};exports['show']=function(_0x54a14f,_0x4e95c2){var _0xd8388d={'raw':!![],'where':{'id':_0x54a14f[_0x5248('0x50')]['id']}},_0x16fe43={};_0x16fe43[_0x5248('0x3c')]=_[_0x5248('0x3e')](db[_0x5248('0x39')][_0x5248('0x3a')]);_0x16fe43['query']=_[_0x5248('0x3e')](_0x54a14f['query']);_0x16fe43['filters']=_[_0x5248('0x40')](_0x16fe43[_0x5248('0x3c')],_0x16fe43[_0x5248('0x3d')]);_0xd8388d[_0x5248('0x41')]=_[_0x5248('0x40')](_0x16fe43['model'],qs[_0x5248('0x51')](_0x54a14f[_0x5248('0x3d')]['fields']));_0xd8388d[_0x5248('0x41')]=_0xd8388d[_0x5248('0x41')][_0x5248('0x42')]?_0xd8388d[_0x5248('0x41')]:_0x16fe43[_0x5248('0x3c')];if(_0x54a14f[_0x5248('0x3d')]['includeAll']){_0xd8388d['include']=[{'all':!![]}];}_0xd8388d=_[_0x5248('0x4a')]({},_0xd8388d,_0x54a14f[_0x5248('0x4c')]);return db['FaxMessage']['find'](_0xd8388d)[_0x5248('0x1d')](handleEntityNotFound(_0x4e95c2,null))[_0x5248('0x1d')](respondWithResult(_0x4e95c2,null))[_0x5248('0x27')](handleError(_0x4e95c2,null));};exports[_0x5248('0x31')]=function(_0x345b5d,_0x14d5ea){if(_0x345b5d[_0x5248('0x52')]['id']){delete _0x345b5d['body']['id'];}return db[_0x5248('0x39')][_0x5248('0x53')]({'where':{'id':_0x345b5d['params']['id']}})[_0x5248('0x1d')](handleEntityNotFound(_0x14d5ea,null))[_0x5248('0x1d')](saveUpdates(_0x345b5d[_0x5248('0x52')],null))['then'](respondWithResult(_0x14d5ea,null))[_0x5248('0x27')](handleError(_0x14d5ea,null));};exports[_0x5248('0x32')]=function(_0x5701a4,_0x541124){return db[_0x5248('0x39')]['find']({'where':{'id':_0x5701a4[_0x5248('0x50')]['id']}})[_0x5248('0x1d')](handleEntityNotFound(_0x541124,null))[_0x5248('0x1d')](removeEntity(_0x541124,null))[_0x5248('0x27')](handleError(_0x541124,null));};exports[_0x5248('0x54')]=function(_0xd901c2,_0x496622){return db[_0x5248('0x39')][_0x5248('0x54')]()[_0x5248('0x1d')](respondWithResult(_0x496622,null))['catch'](handleError(_0x496622,null));};var interaction_log=require(_0x5248('0xe'))(_0x5248('0x55'));exports[_0x5248('0x56')]=function(_0x1ea540,_0x15d492,_0x379b6d){var _0x52e14d={'agent':{},'channel':_0x5248('0x57')};if(_0x1ea540['body']['id']){delete _0x1ea540['body']['id'];}_0x1ea540[_0x5248('0x52')][_0x5248('0x58')]=!![];_0x1ea540[_0x5248('0x52')][_0x5248('0x59')]=moment()[_0x5248('0x5a')](_0x5248('0x5b'));_0x1ea540[_0x5248('0x52')][_0x5248('0x5c')]=_0x1ea540[_0x5248('0x52')][_0x5248('0x5c')]||_0x1ea540[_0x5248('0x5d')]['id'];_0x52e14d[_0x5248('0x5e')]['id']=_0x1ea540[_0x5248('0x52')][_0x5248('0x5c')];return db[_0x5248('0x39')][_0x5248('0x53')]({'where':{'id':_0x1ea540[_0x5248('0x50')]['id'],'UserId':null}})[_0x5248('0x1d')](handleEntityNotFound(_0x15d492,null))['then'](saveUpdates(_0x1ea540[_0x5248('0x52')],null))[_0x5248('0x1d')](function(_0xeb4245){if(_0xeb4245){_0x52e14d[_0x5248('0x25')]=_0xeb4245[_0x5248('0x5f')]({'plain':!![]});return db[_0x5248('0x60')]['find']({'where':{'id':_0xeb4245[_0x5248('0x61')]}});}return null;})[_0x5248('0x1d')](handleEntityNotFound(_0x15d492,null))[_0x5248('0x1d')](function(_0xb70df6){if(_0xb70df6){return _0xb70df6[_0x5248('0x31')]({'UserId':_0x1ea540[_0x5248('0x52')][_0x5248('0x5c')],'read1stAt':_[_0x5248('0x62')](_0xb70df6[_0x5248('0x63')])?moment()[_0x5248('0x5a')](_0x5248('0x5b')):undefined});}return null;})[_0x5248('0x1d')](function(_0x33bfbe){if(_0x33bfbe){_0x52e14d[_0x5248('0x64')]=_0x33bfbe[_0x5248('0x5f')]({'plain':!![]});interaction_log[_0x5248('0x1e')](_0x5248('0x65'),_0x1ea540[_0x5248('0x5d')]['id'],_0x1ea540[_0x5248('0x5d')]['name'],_0x1ea540[_0x5248('0x5d')][_0x5248('0x66')],_0x52e14d[_0x5248('0x64')]['id'],_0x1ea540['body']?JSON['stringify'](_0x1ea540[_0x5248('0x52')]):_0x5248('0x67'));return respondWithRpcPromise(_0x5248('0x68'),_0x5248('0x69'),_0x52e14d);}return null;})['then'](function(_0x5a373e){var _0xa8534f='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5a373e[_0x5248('0x25')][_0x5248('0x6a')];return db[_0x5248('0x6b')][_0x5248('0x3d')](_0xa8534f,{'type':db[_0x5248('0x6c')]['QueryTypes']['SELECT'],'raw':!![]})[_0x5248('0x1d')](function(_0xd92d69){return _0xd92d69;});})[_0x5248('0x1d')](function(_0x36410c){if(_0x36410c){_0x52e14d[_0x5248('0x25')][_0x5248('0x6d')]=_0x36410c[0x0];if(!_0x1ea540[_0x5248('0x52')][_0x5248('0x5c')])return;return db[_0x5248('0x6e')][_0x5248('0x53')]({'where':{'id':_0x1ea540[_0x5248('0x52')][_0x5248('0x5c')],'role':_0x5248('0x5e')},'attributes':['id',_0x5248('0x35'),_0x5248('0x6f'),'email',_0x5248('0x70')],'raw':!![]});}return null;})[_0x5248('0x1d')](function(_0xff129e){if(!_0xff129e)return null;_0x52e14d[_0x5248('0x25')][_0x5248('0x5e')]=_0xff129e;return _0x52e14d;})[_0x5248('0x1d')](function(_0x100b79){if(_0x100b79){if(_0x1ea540[_0x5248('0x52')][_0x5248('0x71')]){_0x52e14d[_0x5248('0x25')]['interface']=util[_0x5248('0x5a')](_0x5248('0x72'),_0x1ea540[_0x5248('0x5d')][_0x5248('0x35')]);_0x52e14d[_0x5248('0x25')]['channel']=_0x52e14d['channel'];_0x52e14d[_0x5248('0x25')]['motionChannel']=_0x52e14d[_0x5248('0x73')];_0x52e14d['message']['event']=_0x5248('0x56');return respondWithRpcPromise(_0x5248('0x74'),_0x5248('0x74'),{'event':_0x5248('0x75'),'message':_0x52e14d[_0x5248('0x25')]},client9002)[_0x5248('0x1d')](function(){return _0x52e14d;});}return _0x52e14d;}return null;})[_0x5248('0x1d')](respondWithResult(_0x15d492,null))[_0x5248('0x27')](handleError(_0x15d492,null));};var interaction_log=require('../../config/logger')('fax-interactions');exports[_0x5248('0x30')]=function(_0x266479,_0x554f2f,_0x220ee4){var _0xc41692={'agent':{},'channel':'fax'};if(_0x266479[_0x5248('0x52')]['id']){delete _0x266479[_0x5248('0x52')]['id'];}_0x266479['body'][_0x5248('0x5c')]=_0x266479[_0x5248('0x52')][_0x5248('0x5c')]||_0x266479[_0x5248('0x5d')]['id'];_0xc41692[_0x5248('0x5e')]['id']=_0x266479[_0x5248('0x52')][_0x5248('0x5c')];return db[_0x5248('0x39')]['find']({'where':{'id':_0x266479[_0x5248('0x50')]['id'],'UserId':null}})[_0x5248('0x1d')](handleEntityNotFound(_0x554f2f,null))[_0x5248('0x1d')](function(_0x509c94){if(_0x509c94){_0xc41692[_0x5248('0x25')]=_0x509c94[_0x5248('0x5f')]({'plain':!![]});return db[_0x5248('0x60')][_0x5248('0x53')]({'where':{'id':_0x509c94[_0x5248('0x61')]}});}return null;})['then'](handleEntityNotFound(_0x554f2f,null))['then'](function(_0x5cc82b){if(_0x5cc82b){_0xc41692[_0x5248('0x64')]=_0x5cc82b[_0x5248('0x5f')]({'plain':!![]});interaction_log[_0x5248('0x1e')](_0x5248('0x76'),_0x266479[_0x5248('0x5d')]['id'],_0x266479['user'][_0x5248('0x35')],_0x266479['user'][_0x5248('0x66')],_0xc41692[_0x5248('0x64')]['id'],_0x266479[_0x5248('0x52')]?JSON[_0x5248('0x22')](_0x266479[_0x5248('0x52')]):'null');return respondWithRpcPromise(_0x5248('0x77'),'rejectMessage',_0xc41692);}return null;})[_0x5248('0x1d')](function(_0x5be88){var _0x35ad52=_0x5248('0x78')+_0x5be88['message'][_0x5248('0x6a')];return db[_0x5248('0x6b')][_0x5248('0x3d')](_0x35ad52,{'type':db[_0x5248('0x6c')][_0x5248('0x79')][_0x5248('0x7a')],'raw':!![]})[_0x5248('0x1d')](function(_0x29ad99){return _0x29ad99;});})['then'](function(_0x1f7243){if(_0x1f7243){_0xc41692[_0x5248('0x25')][_0x5248('0x6d')]=_0x1f7243[0x0];if(!_0x266479[_0x5248('0x52')]['UserId'])return;return db[_0x5248('0x6e')]['find']({'where':{'id':_0x266479['body'][_0x5248('0x5c')],'role':'agent'},'attributes':['id',_0x5248('0x35'),_0x5248('0x6f'),'email',_0x5248('0x70')],'raw':!![]});}return null;})['then'](function(_0x2e6a44){if(!_0x2e6a44)return null;_0xc41692['message'][_0x5248('0x5e')]=_0x2e6a44;return _0xc41692;})[_0x5248('0x1d')](function(_0x251f6e){if(_0x251f6e){_0x251f6e['message'][_0x5248('0x7b')]=util['format'](_0x5248('0x72'),_0x266479['user'][_0x5248('0x35')]);_0x251f6e[_0x5248('0x25')][_0x5248('0x73')]=_0xc41692[_0x5248('0x73')];_0x251f6e[_0x5248('0x25')][_0x5248('0x7c')]=_0xc41692[_0x5248('0x73')];_0x251f6e[_0x5248('0x25')]['event']=_0x5248('0x30');respondWithRpcPromise(_0x5248('0x74'),_0x5248('0x74'),{'event':_0x5248('0x7d'),'message':_0x251f6e[_0x5248('0x25')]},client9002);return _0xc41692;}return null;})[_0x5248('0x1d')](respondWithResult(_0x554f2f,null))['catch'](handleError(_0x554f2f,null));};exports['create']=function(_0x110619,_0x2185a9){var _0x41680a;return db['FaxMessage'][_0x5248('0x7e')](_0x110619[_0x5248('0x52')],{})[_0x5248('0x1d')](function(_0x230762){_0x41680a=_0x230762;return db[_0x5248('0x7f')][_0x5248('0x80')]({'where':{'id':_0x41680a[_0x5248('0x6a')]}});})[_0x5248('0x1d')](function(_0x3ba530){if(_[_0x5248('0x62')](_0x3ba530)){return;}else{_0x41680a[_0x5248('0x57')]=_0x3ba530[_0x5248('0x57')];return db[_0x5248('0x81')][_0x5248('0x80')]({'where':{'id':_0x41680a['AttachmentId']}});}})[_0x5248('0x1d')](function(_0x1ba4f9){return respondWithRpcPromise(_0x5248('0x82'),'SendFax',{'FaxAccountId':_[_0x5248('0x62')](_0x110619[_0x5248('0x52')])?undefined:_0x110619['body'][_0x5248('0x83')],'path':_[_0x5248('0x62')](_0x1ba4f9)?undefined:util[_0x5248('0x5a')](_0x5248('0x84'),_0x1ba4f9['basename']),'fax':_[_0x5248('0x62')](_0x41680a['fax'])?undefined:_0x41680a[_0x5248('0x57')],'AttachmentId':_0x41680a[_0x5248('0x85')]},client9002);})[_0x5248('0x1d')](respondWithResult(_0x2185a9,0xc9))[_0x5248('0x27')](handleError(_0x2185a9,null));};exports[_0x5248('0x86')]=function(_0x385d47,_0x412b48){var _0x384ce2=path[_0x5248('0x87')](config[_0x5248('0x88')],_0x5248('0x89'),_0x5248('0x8a'),_0x5248('0x8b'));return db[_0x5248('0x39')][_0x5248('0x53')]({'where':{'id':_0x385d47[_0x5248('0x50')]['id']},'include':[{'model':db['Attachment'],'as':_0x5248('0x81')}]})[_0x5248('0x1d')](handleEntityNotFound(_0x412b48,null))['then'](function(_0x4984f1){if(_0x4984f1){return _0x412b48[_0x5248('0x86')](path[_0x5248('0x87')](_0x384ce2,_0x4984f1['Attachment'][_0x5248('0x8c')]));}})[_0x5248('0x27')](handleError(_0x412b48,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index ef2013b..7d456ce 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 _0x5fdc=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','FaxMessage','setMaxListeners','save'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x5fdc,0x127));var _0xc5fd=function(_0x15b991,_0x4306cf){_0x15b991=_0x15b991-0x0;var _0x1b703a=_0x5fdc[_0x15b991];return _0x1b703a;};'use strict';var EventEmitter=require(_0xc5fd('0x0'));var FaxMessage=require(_0xc5fd('0x1'))['db'][_0xc5fd('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xc5fd('0x3')](0x0);var events={'afterCreate':_0xc5fd('0x4'),'afterUpdate':_0xc5fd('0x5'),'afterDestroy':_0xc5fd('0x6')};function emitEvent(_0x4d015c){return function(_0xfdf928,_0x1b6205,_0xca27a0){FaxMessageEvents[_0xc5fd('0x7')](_0x4d015c+':'+_0xfdf928['id'],_0xfdf928);FaxMessageEvents[_0xc5fd('0x7')](_0x4d015c,_0xfdf928);_0xca27a0(null);};}for(var e in events){if(events[_0xc5fd('0x8')](e)){var event=events[e];FaxMessage[_0xc5fd('0x9')](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file +var _0xadb5=['update','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save'];(function(_0x14a0a0,_0x45d0cf){var _0x56b651=function(_0x1fae09){while(--_0x1fae09){_0x14a0a0['push'](_0x14a0a0['shift']());}};_0x56b651(++_0x45d0cf);}(_0xadb5,0xad));var _0x5adb=function(_0x19b2aa,_0x1efa27){_0x19b2aa=_0x19b2aa-0x0;var _0x4c72c6=_0xadb5[_0x19b2aa];return _0x4c72c6;};'use strict';var EventEmitter=require('events');var FaxMessage=require(_0x5adb('0x0'))['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x5adb('0x1')](0x0);var events={'afterCreate':_0x5adb('0x2'),'afterUpdate':_0x5adb('0x3'),'afterDestroy':'remove'};function emitEvent(_0x248dc6){return function(_0x31457,_0x2e3ef4,_0x4cb1d1){FaxMessageEvents[_0x5adb('0x4')](_0x248dc6+':'+_0x31457['id'],_0x31457);FaxMessageEvents[_0x5adb('0x4')](_0x248dc6,_0x31457);_0x4cb1d1(null);};}for(var e in events){if(events[_0x5adb('0x5')](e)){var event=events[e];FaxMessage[_0x5adb('0x6')](e,emitEvent(event));}}module[_0x5adb('0x7')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 637c9b7..ce49fde 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 _0xcbcd=['bluebird','path','rimraf','../../config/environment','./faxMessage.attributes','exports','define','fti_fax_messages','body','get','direction','toLowerCase','secret','isNil','UserId','findOne','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment'];(function(_0x40cee1,_0x3b2e83){var _0x4e6c53=function(_0x5b2bcb){while(--_0x5b2bcb){_0x40cee1['push'](_0x40cee1['shift']());}};_0x4e6c53(++_0x3b2e83);}(_0xcbcd,0xd4));var _0xdcbc=function(_0x59d0cc,_0xa7c52b){_0x59d0cc=_0x59d0cc-0x0;var _0x2ae79f=_0xcbcd[_0x59d0cc];return _0x2ae79f;};'use strict';var _=require(_0xdcbc('0x0'));var util=require(_0xdcbc('0x1'));var logger=require('../../config/logger')(_0xdcbc('0x2'));var moment=require(_0xdcbc('0x3'));var BPromise=require(_0xdcbc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdcbc('0x5'));var rimraf=require(_0xdcbc('0x6'));var config=require(_0xdcbc('0x7'));var attributes=require(_0xdcbc('0x8'));module[_0xdcbc('0x9')]=function(_0x55f6a0,_0xec23f9){return _0x55f6a0[_0xdcbc('0xa')]('FaxMessage',attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0xdcbc('0xb'),'fields':[_0xdcbc('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x41215f,_0x16db50,_0x40223f){var _0x570c5d=_0x55f6a0['models'];var _0x1f8e79=_0x41215f[_0xdcbc('0xd')]({'plain':!![]});if(_0x1f8e79[_0xdcbc('0xe')]['toLowerCase']()==='in'||_0x1f8e79[_0xdcbc('0xe')][_0xdcbc('0xf')]()==='out'&&!_0x1f8e79[_0xdcbc('0x10')]&&!_[_0xdcbc('0x11')](_0x1f8e79[_0xdcbc('0x12')])){_0x570c5d['FaxInteraction'][_0xdcbc('0x13')]({'where':{'id':_0x1f8e79['FaxInteractionId']}})[_0xdcbc('0x14')](function(_0x50cc05){if(_0x50cc05){_0x50cc05[_0xdcbc('0x15')]({'lastMsgAt':_0x1f8e79[_0xdcbc('0x16')],'lastMsgDirection':_0x1f8e79[_0xdcbc('0xe')][_0xdcbc('0xf')]()});}})[_0xdcbc('0x17')](function(_0x177666){console[_0xdcbc('0x18')](_0x177666);});}_0x40223f();}},'charset':_0xdcbc('0x19'),'collate':_0xdcbc('0x1a')});}; \ No newline at end of file +var _0x499a=['utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./faxMessage.attributes','exports','define','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','findOne','FaxInteractionId','then','createdAt','catch'];(function(_0x540314,_0x30e8a5){var _0xff9b2a=function(_0x292a71){while(--_0x292a71){_0x540314['push'](_0x540314['shift']());}};_0xff9b2a(++_0x30e8a5);}(_0x499a,0x1a5));var _0xa499=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x499a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa499('0x0'))(_0xa499('0x1'));var moment=require(_0xa499('0x2'));var BPromise=require(_0xa499('0x3'));var rp=require(_0xa499('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa499('0x5'));var config=require(_0xa499('0x6'));var attributes=require(_0xa499('0x7'));module[_0xa499('0x8')]=function(_0x2558f7,_0x24e4d8){return _0x2558f7[_0xa499('0x9')](_0xa499('0xa'),attributes,{'tableName':_0xa499('0xb'),'paranoid':![],'indexes':[{'name':_0xa499('0xc'),'fields':[_0xa499('0xd')],'type':_0xa499('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3d228a,_0xf6a93a,_0x222243){var _0x10dbcb=_0x2558f7[_0xa499('0xf')];var _0xd7bfd3=_0x3d228a[_0xa499('0x10')]({'plain':!![]});if(_0xd7bfd3[_0xa499('0x11')][_0xa499('0x12')]()==='in'||_0xd7bfd3[_0xa499('0x11')][_0xa499('0x12')]()===_0xa499('0x13')&&!_0xd7bfd3[_0xa499('0x14')]&&!_[_0xa499('0x15')](_0xd7bfd3['UserId'])){_0x10dbcb['FaxInteraction'][_0xa499('0x16')]({'where':{'id':_0xd7bfd3[_0xa499('0x17')]}})[_0xa499('0x18')](function(_0x5062dc){if(_0x5062dc){_0x5062dc['update']({'lastMsgAt':_0xd7bfd3[_0xa499('0x19')],'lastMsgDirection':_0xd7bfd3['direction'][_0xa499('0x12')]()});}})[_0xa499('0x1a')](function(_0x3807f6){console['error'](_0x3807f6);});}_0x222243();}},'charset':'utf8mb4','collate':_0xa499('0x1b')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index c97f916..2471474 100644 --- a/server/api/faxMessage/faxMessage.rpc.js +++ b/server/api/faxMessage/faxMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fd1=['debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateFaxMessage','FaxMessage','create','body','raw','catch','UpdateFaxMessage','options','where','attributes','limit','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5fd1,0x155));var _0x15fd=function(_0x115eea,_0x3098ff){_0x115eea=_0x115eea-0x0;var _0x147c64=_0x5fd1[_0x115eea];return _0x147c64;};'use strict';var _=require(_0x15fd('0x0'));var util=require('util');var moment=require(_0x15fd('0x1'));var BPromise=require(_0x15fd('0x2'));var rs=require(_0x15fd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x15fd('0x4'));var logger=require(_0x15fd('0x5'))(_0x15fd('0x6'));var config=require('../../config/environment');var jayson=require(_0x15fd('0x7'));var client=jayson[_0x15fd('0x8')][_0x15fd('0x9')]({'port':0x232a});config[_0x15fd('0xa')]=_[_0x15fd('0xb')](config['redis'],{'host':_0x15fd('0xc'),'port':0x18eb});var socket=require(_0x15fd('0xd'))(new Redis(config[_0x15fd('0xa')]));require('./faxMessage.socket')[_0x15fd('0xe')](socket);function respondWithRpcPromise(_0x5c9c63,_0x3dfdbb,_0x250457){return new BPromise(function(_0x4c226a,_0x4883fd){return client['request'](_0x5c9c63,_0x250457)[_0x15fd('0xf')](function(_0x2a4d55){logger[_0x15fd('0x10')](_0x15fd('0x11'),_0x3dfdbb,_0x15fd('0x12'));logger[_0x15fd('0x13')](_0x15fd('0x14'),_0x3dfdbb,_0x15fd('0x12'),JSON[_0x15fd('0x15')](_0x2a4d55));if(_0x2a4d55['error']){if(_0x2a4d55['error']['code']===0x1f4){logger[_0x15fd('0x16')](_0x15fd('0x11'),_0x3dfdbb,_0x2a4d55[_0x15fd('0x16')][_0x15fd('0x17')]);return _0x4883fd(_0x2a4d55[_0x15fd('0x16')][_0x15fd('0x17')]);}logger[_0x15fd('0x16')](_0x15fd('0x11'),_0x3dfdbb,_0x2a4d55['error']['message']);return _0x4c226a(_0x2a4d55[_0x15fd('0x16')]['message']);}else{logger[_0x15fd('0x10')]('FaxMessage,\x20%s,\x20%s',_0x3dfdbb,_0x15fd('0x12'));_0x4c226a(_0x2a4d55[_0x15fd('0x18')][_0x15fd('0x17')]);}})['catch'](function(_0x367c36){logger[_0x15fd('0x16')](_0x15fd('0x11'),_0x3dfdbb,_0x367c36);_0x4883fd(_0x367c36);});});}exports[_0x15fd('0x19')]=function(_0x2fb919){var _0x36a90e=this;return new Promise(function(_0x3761db,_0x2f46f1){return db[_0x15fd('0x1a')][_0x15fd('0x1b')](_0x2fb919[_0x15fd('0x1c')],{'raw':_0x2fb919['options']?_0x2fb919['options'][_0x15fd('0x1d')]===undefined?!![]:![]:!![]})[_0x15fd('0xf')](function(_0x252a1c){logger[_0x15fd('0x10')](_0x15fd('0x19'),_0x2fb919);logger[_0x15fd('0x13')](_0x15fd('0x19'),_0x2fb919,JSON['stringify'](_0x252a1c));_0x3761db(_0x252a1c);})[_0x15fd('0x1e')](function(_0x2d19ac){logger[_0x15fd('0x16')]('CreateFaxMessage',_0x2d19ac[_0x15fd('0x17')],_0x2fb919);_0x2f46f1(_0x36a90e['error'](0x1f4,_0x2d19ac[_0x15fd('0x17')]));});});};exports[_0x15fd('0x1f')]=function(_0x21601d){var _0x4c9708=this;return new Promise(function(_0x16b87c,_0x1cbf2c){return db[_0x15fd('0x1a')]['update'](_0x21601d[_0x15fd('0x1c')],{'raw':_0x21601d['options']?_0x21601d[_0x15fd('0x20')][_0x15fd('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x21601d[_0x15fd('0x20')]?_0x21601d[_0x15fd('0x20')][_0x15fd('0x21')]||null:null,'attributes':_0x21601d[_0x15fd('0x20')]?_0x21601d[_0x15fd('0x20')][_0x15fd('0x22')]||null:null,'limit':_0x21601d[_0x15fd('0x20')]?_0x21601d[_0x15fd('0x20')][_0x15fd('0x23')]||null:null})['then'](function(_0x47c22c){logger[_0x15fd('0x10')]('UpdateFaxMessage',_0x21601d);logger[_0x15fd('0x13')](_0x15fd('0x1f'),_0x21601d,JSON['stringify'](_0x47c22c));_0x16b87c(_0x47c22c);})[_0x15fd('0x1e')](function(_0x197d15){logger['error'](_0x15fd('0x1f'),_0x197d15[_0x15fd('0x17')],_0x21601d);_0x1cbf2c(_0x4c9708[_0x15fd('0x16')](0x1f4,_0x197d15[_0x15fd('0x17')]));});});}; \ No newline at end of file +var _0xac31=['attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','redis','defaults','socket.io-emitter','./faxMessage.socket','register','request','then','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateFaxMessage','FaxMessage','create','body','options','raw','UpdateFaxMessage','update','where'];(function(_0x4037b0,_0x5ac8c6){var _0x589511=function(_0x3f2ecf){while(--_0x3f2ecf){_0x4037b0['push'](_0x4037b0['shift']());}};_0x589511(++_0x5ac8c6);}(_0xac31,0xca));var _0x1ac3=function(_0x1d211a,_0x492c8e){_0x1d211a=_0x1d211a-0x0;var _0x350b88=_0xac31[_0x1d211a];return _0x350b88;};'use strict';var _=require(_0x1ac3('0x0'));var util=require(_0x1ac3('0x1'));var moment=require(_0x1ac3('0x2'));var BPromise=require(_0x1ac3('0x3'));var rs=require(_0x1ac3('0x4'));var fs=require('fs');var Redis=require(_0x1ac3('0x5'));var db=require(_0x1ac3('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1ac3('0x7'))(_0x1ac3('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1ac3('0x9')][_0x1ac3('0xa')]({'port':0x232a});config[_0x1ac3('0xb')]=_[_0x1ac3('0xc')](config[_0x1ac3('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x1ac3('0xd'))(new Redis(config['redis']));require(_0x1ac3('0xe'))[_0x1ac3('0xf')](socket);function respondWithRpcPromise(_0x344674,_0x53500b,_0xa26c88){return new BPromise(function(_0x1e2642,_0x3e835b){return client[_0x1ac3('0x10')](_0x344674,_0xa26c88)[_0x1ac3('0x11')](function(_0x422d19){logger['info'](_0x1ac3('0x12'),_0x53500b,_0x1ac3('0x13'));logger[_0x1ac3('0x14')](_0x1ac3('0x15'),_0x53500b,'request\x20sent',JSON[_0x1ac3('0x16')](_0x422d19));if(_0x422d19[_0x1ac3('0x17')]){if(_0x422d19[_0x1ac3('0x17')][_0x1ac3('0x18')]===0x1f4){logger['error'](_0x1ac3('0x12'),_0x53500b,_0x422d19[_0x1ac3('0x17')]['message']);return _0x3e835b(_0x422d19[_0x1ac3('0x17')][_0x1ac3('0x19')]);}logger[_0x1ac3('0x17')]('FaxMessage,\x20%s,\x20%s',_0x53500b,_0x422d19[_0x1ac3('0x17')][_0x1ac3('0x19')]);return _0x1e2642(_0x422d19[_0x1ac3('0x17')]['message']);}else{logger[_0x1ac3('0x1a')]('FaxMessage,\x20%s,\x20%s',_0x53500b,_0x1ac3('0x13'));_0x1e2642(_0x422d19[_0x1ac3('0x1b')][_0x1ac3('0x19')]);}})[_0x1ac3('0x1c')](function(_0x18b985){logger['error'](_0x1ac3('0x12'),_0x53500b,_0x18b985);_0x3e835b(_0x18b985);});});}exports[_0x1ac3('0x1d')]=function(_0x296abf){var _0x257f60=this;return new Promise(function(_0x5f1918,_0x48d18a){return db[_0x1ac3('0x1e')][_0x1ac3('0x1f')](_0x296abf[_0x1ac3('0x20')],{'raw':_0x296abf[_0x1ac3('0x21')]?_0x296abf[_0x1ac3('0x21')][_0x1ac3('0x22')]===undefined?!![]:![]:!![]})[_0x1ac3('0x11')](function(_0x10912a){logger[_0x1ac3('0x1a')]('CreateFaxMessage',_0x296abf);logger[_0x1ac3('0x14')](_0x1ac3('0x1d'),_0x296abf,JSON['stringify'](_0x10912a));_0x5f1918(_0x10912a);})[_0x1ac3('0x1c')](function(_0x10f30c){logger['error'](_0x1ac3('0x1d'),_0x10f30c[_0x1ac3('0x19')],_0x296abf);_0x48d18a(_0x257f60[_0x1ac3('0x17')](0x1f4,_0x10f30c[_0x1ac3('0x19')]));});});};exports[_0x1ac3('0x23')]=function(_0x565a0f){var _0x5a2ab2=this;return new Promise(function(_0x503a64,_0x528807){return db['FaxMessage'][_0x1ac3('0x24')](_0x565a0f['body'],{'raw':_0x565a0f[_0x1ac3('0x21')]?_0x565a0f[_0x1ac3('0x21')][_0x1ac3('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x565a0f[_0x1ac3('0x21')]?_0x565a0f['options'][_0x1ac3('0x25')]||null:null,'attributes':_0x565a0f['options']?_0x565a0f[_0x1ac3('0x21')][_0x1ac3('0x26')]||null:null,'limit':_0x565a0f[_0x1ac3('0x21')]?_0x565a0f[_0x1ac3('0x21')][_0x1ac3('0x27')]||null:null})[_0x1ac3('0x11')](function(_0x9c17c2){logger['info'](_0x1ac3('0x23'),_0x565a0f);logger[_0x1ac3('0x14')](_0x1ac3('0x23'),_0x565a0f,JSON[_0x1ac3('0x16')](_0x9c17c2));_0x503a64(_0x9c17c2);})['catch'](function(_0x3591a9){logger[_0x1ac3('0x17')](_0x1ac3('0x23'),_0x3591a9[_0x1ac3('0x19')],_0x565a0f);_0x528807(_0x5a2ab2[_0x1ac3('0x17')](0x1f4,_0x3591a9['message']));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 2fe5f66..cd5a9b0 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 _0x78a9=['emit','removeListener','register','length','faxMessage:','remove','update'];(function(_0x3f021a,_0x2c8463){var _0x61fce8=function(_0x56316a){while(--_0x56316a){_0x3f021a['push'](_0x3f021a['shift']());}};_0x61fce8(++_0x2c8463);}(_0x78a9,0xde));var _0x978a=function(_0xcd0a21,_0x48f7a9){_0xcd0a21=_0xcd0a21-0x0;var _0x38322a=_0x78a9[_0xcd0a21];return _0x38322a;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=['save',_0x978a('0x0'),_0x978a('0x1')];function createListener(_0x35e4d8,_0x153b1f){return function(_0xb94747){_0x153b1f[_0x978a('0x2')](_0x35e4d8,_0xb94747);};}function removeListener(_0x2472a9,_0x3e863b){return function(){FaxMessageEvents[_0x978a('0x3')](_0x2472a9,_0x3e863b);};}exports[_0x978a('0x4')]=function(_0x5b3178){for(var _0x19beb6=0x0,_0x1ab6ec=events[_0x978a('0x5')];_0x19beb6<_0x1ab6ec;_0x19beb6++){var _0x744ea2=events[_0x19beb6];var _0x35670f=createListener(_0x978a('0x6')+_0x744ea2,_0x5b3178);FaxMessageEvents['on'](_0x744ea2,_0x35670f);}}; \ No newline at end of file +var _0x098b=['./faxMessage.events','save','removeListener','faxMessage:'];(function(_0x591f36,_0x227718){var _0x5d28a3=function(_0xae8dd4){while(--_0xae8dd4){_0x591f36['push'](_0x591f36['shift']());}};_0x5d28a3(++_0x227718);}(_0x098b,0x1ac));var _0xb098=function(_0xcf3958,_0x62c9ee){_0xcf3958=_0xcf3958-0x0;var _0x1352c2=_0x098b[_0xcf3958];return _0x1352c2;};'use strict';var FaxMessageEvents=require(_0xb098('0x0'));var events=[_0xb098('0x1'),'remove','update'];function createListener(_0x17e1fe,_0x4c843f){return function(_0x5d5c62){_0x4c843f['emit'](_0x17e1fe,_0x5d5c62);};}function removeListener(_0x5e907e,_0x5ce24d){return function(){FaxMessageEvents[_0xb098('0x2')](_0x5e907e,_0x5ce24d);};}exports['register']=function(_0x391365){for(var _0xb236b6=0x0,_0x11dd2b=events['length'];_0xb236b6<_0x11dd2b;_0xb236b6++){var _0xfbf786=events[_0xb236b6];var _0x2d2f55=createListener(_0xb098('0x3')+_0xfbf786,_0x391365);FaxMessageEvents['on'](_0xfbf786,_0x2d2f55);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index f55917e..2244112 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 _0xc788=['describe','/:id','show','post','fax','faxmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xc788,0xc4));var _0x8c78=function(_0x496590,_0x3426e9){_0x496590=_0x496590-0x0;var _0x585ebc=_0xc788[_0x496590];return _0x585ebc;};'use strict';var multer=require(_0x8c78('0x0'));var util=require(_0x8c78('0x1'));var path=require(_0x8c78('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8c78('0x3')]();var fs_extra=require(_0x8c78('0x4'));var auth=require(_0x8c78('0x5'));var interaction=require(_0x8c78('0x6'));var config=require(_0x8c78('0x7'));var controller=require('./faxMessage.controller');router[_0x8c78('0x8')]('/',auth[_0x8c78('0x9')](),controller[_0x8c78('0xa')]);router[_0x8c78('0x8')](_0x8c78('0xb'),auth['isAuthenticated'](),controller[_0x8c78('0xc')]);router[_0x8c78('0x8')](_0x8c78('0xd'),auth[_0x8c78('0x9')](),controller[_0x8c78('0xe')]);router[_0x8c78('0x8')]('/:id/download',auth[_0x8c78('0x9')](),controller['download']);router[_0x8c78('0xf')]('/',auth[_0x8c78('0x9')](),interaction['tracked'](_0x8c78('0x10'),_0x8c78('0x11')),controller['create']);router[_0x8c78('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x8c78('0x13')]);router[_0x8c78('0x12')](_0x8c78('0x14'),auth[_0x8c78('0x9')](),controller[_0x8c78('0x15')]);router[_0x8c78('0x12')](_0x8c78('0x16'),auth[_0x8c78('0x9')](),controller[_0x8c78('0x17')]);router[_0x8c78('0x18')]('/:id',auth[_0x8c78('0x9')](),controller[_0x8c78('0x19')]);module['exports']=router; \ No newline at end of file +var _0x7072=['/:id/download','download','post','tracked','fax','faxmessage:create','create','put','accept','/:id/reject','delete','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','./faxMessage.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x2104ef,_0x3693e7){var _0x18ddc6=function(_0x3adfeb){while(--_0x3adfeb){_0x2104ef['push'](_0x2104ef['shift']());}};_0x18ddc6(++_0x3693e7);}(_0x7072,0x138));var _0x2707=function(_0x166742,_0x55520c){_0x166742=_0x166742-0x0;var _0xb7814a=_0x7072[_0x166742];return _0xb7814a;};'use strict';var multer=require('multer');var util=require(_0x2707('0x0'));var path=require(_0x2707('0x1'));var timeout=require(_0x2707('0x2'));var express=require(_0x2707('0x3'));var router=express[_0x2707('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2707('0x5'));var config=require('../../config/environment');var controller=require(_0x2707('0x6'));router[_0x2707('0x7')]('/',auth[_0x2707('0x8')](),controller[_0x2707('0x9')]);router[_0x2707('0x7')](_0x2707('0xa'),auth[_0x2707('0x8')](),controller[_0x2707('0xb')]);router[_0x2707('0x7')](_0x2707('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x2707('0x7')](_0x2707('0xd'),auth[_0x2707('0x8')](),controller[_0x2707('0xe')]);router[_0x2707('0xf')]('/',auth[_0x2707('0x8')](),interaction[_0x2707('0x10')](_0x2707('0x11'),_0x2707('0x12')),controller[_0x2707('0x13')]);router[_0x2707('0x14')](_0x2707('0xc'),auth[_0x2707('0x8')](),controller['update']);router[_0x2707('0x14')]('/:id/accept',auth[_0x2707('0x8')](),controller[_0x2707('0x15')]);router[_0x2707('0x14')](_0x2707('0x16'),auth[_0x2707('0x8')](),controller['reject']);router[_0x2707('0x17')](_0x2707('0xc'),auth[_0x2707('0x8')](),controller['destroy']);module[_0x2707('0x18')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 143842d..e7aaeed 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 _0xa5b8=['sequelize','exports','name','STRING','INTEGER','rrmemory','beepall','roundrobin'];(function(_0x4f5d78,_0x51038f){var _0x3190a5=function(_0x154f97){while(--_0x154f97){_0x4f5d78['push'](_0x4f5d78['shift']());}};_0x3190a5(++_0x51038f);}(_0xa5b8,0x148));var _0x8a5b=function(_0x708ab2,_0x19acba){_0x708ab2=_0x708ab2-0x0;var _0x1237d1=_0xa5b8[_0x708ab2];return _0x1237d1;};'use strict';var Sequelize=require(_0x8a5b('0x0'));module[_0x8a5b('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x8a5b('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8a5b('0x3')]},'timeout':{'type':Sequelize[_0x8a5b('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x8a5b('0x5'),_0x8a5b('0x6'),_0x8a5b('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x8a5b('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x3f54=['ENUM','beepall','roundrobin','INTEGER','sequelize','exports','STRING','name'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0x3f54,0xe4));var _0x43f5=function(_0x5b740b,_0x381833){_0x5b740b=_0x5b740b-0x0;var _0x6f8f4e=_0x3f54[_0x5b740b];return _0x6f8f4e;};'use strict';var Sequelize=require(_0x43f5('0x0'));module[_0x43f5('0x1')]={'name':{'type':Sequelize[_0x43f5('0x2')],'unique':_0x43f5('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x43f5('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x43f5('0x4')]('rrmemory',_0x43f5('0x5'),_0x43f5('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x43f5('0x7')],'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 99c5ad4..f3e3a43 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 _0x77ef=['create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserFaxQueue','pick','FaxQueueId','findAll','findAndCountAll','UserId','agent','updatedAt','createdAt','%s/%s','getTeams','Team','addTeams','ids','User','Agents','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','emit','removeTeams','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','all','union','compact','value','isEmpty','removeAgents','userFaxQueue:remove','addAgents','omit','spread','userFaxQueue:save','isArray','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./faxQueue.socket','sendStatus','status','end','undefined','offset','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','FaxQueues','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','options','FaxQueue','rows','catch','show','params','keys','include'];(function(_0x7185f7,_0x37065){var _0x182e45=function(_0x519e0d){while(--_0x519e0d){_0x7185f7['push'](_0x7185f7['shift']());}};_0x182e45(++_0x37065);}(_0x77ef,0x1ea));var _0xf77e=function(_0x30aada,_0x10da91){_0x30aada=_0x30aada-0x0;var _0x29c964=_0x77ef[_0x30aada];return _0x29c964;};'use strict';var emlformat=require(_0xf77e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf77e('0x1'));var jsonpatch=require(_0xf77e('0x2'));var rp=require(_0xf77e('0x3'));var moment=require(_0xf77e('0x4'));var BPromise=require(_0xf77e('0x5'));var Mustache=require(_0xf77e('0x6'));var util=require(_0xf77e('0x7'));var path=require(_0xf77e('0x8'));var sox=require(_0xf77e('0x9'));var csv=require(_0xf77e('0xa'));var ejs=require(_0xf77e('0xb'));var fs=require('fs');var fs_extra=require(_0xf77e('0xc'));var _=require(_0xf77e('0xd'));var squel=require(_0xf77e('0xe'));var crypto=require('crypto');var jsforce=require(_0xf77e('0xf'));var deskjs=require(_0xf77e('0x10'));var toCsv=require(_0xf77e('0xa'));var querystring=require(_0xf77e('0x11'));var Papa=require('papaparse');var Redis=require(_0xf77e('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xf77e('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf77e('0x14'));var logger=require(_0xf77e('0x15'))(_0xf77e('0x16'));var utils=require(_0xf77e('0x17'));var config=require(_0xf77e('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xf77e('0x19'))['db'];config['redis']=_[_0xf77e('0x1a')](config['redis'],{'host':_0xf77e('0x1b'),'port':0x18eb});var socket=require(_0xf77e('0x1c'))(new Redis(config[_0xf77e('0x1d')]));require(_0xf77e('0x1e'))['register'](socket);function respondWithStatusCode(_0x43262c,_0x34cb43){_0x34cb43=_0x34cb43||0xcc;return function(_0x305379){if(_0x305379){return _0x43262c[_0xf77e('0x1f')](_0x34cb43);}return _0x43262c[_0xf77e('0x20')](_0x34cb43)[_0xf77e('0x21')]();};}function respondWithResult(_0x230ae5,_0x15e9b2){_0x15e9b2=_0x15e9b2||0xc8;return function(_0x34be52){if(_0x34be52){return _0x230ae5[_0xf77e('0x20')](_0x15e9b2)['json'](_0x34be52);}};}function respondWithFilteredResult(_0x518f86,_0x329690){return function(_0x2d3db4){if(_0x2d3db4){var _0x455ea9=typeof _0x329690['offset']==='undefined'&&typeof _0x329690['limit']===_0xf77e('0x22');var _0x57e8c3=_0x2d3db4['count'];var _0x155343=_0x455ea9?0x0:_0x329690[_0xf77e('0x23')];var _0x38008f=_0x455ea9?_0x2d3db4[_0xf77e('0x24')]:_0x329690[_0xf77e('0x23')]+_0x329690[_0xf77e('0x25')];var _0x371df3;if(_0x38008f>=_0x57e8c3){_0x38008f=_0x57e8c3;_0x371df3=0xc8;}else{_0x371df3=0xce;}_0x518f86['status'](_0x371df3);return _0x518f86[_0xf77e('0x26')](_0xf77e('0x27'),_0x155343+'-'+_0x38008f+'/'+_0x57e8c3)['json'](_0x2d3db4);}return null;};}function patchUpdates(_0x5e6a16){return function(_0x3b5f0e){try{jsonpatch[_0xf77e('0x28')](_0x3b5f0e,_0x5e6a16,!![]);}catch(_0x357fa8){return BPromise[_0xf77e('0x29')](_0x357fa8);}return _0x3b5f0e[_0xf77e('0x2a')]();};}function saveUpdates(_0x14bcc3,_0x58becb){return function(_0x1b4b88){if(_0x1b4b88){return _0x1b4b88[_0xf77e('0x2b')](_0x14bcc3)[_0xf77e('0x2c')](function(_0x3bb706){return _0x3bb706;});}return null;};}function removeEntity(_0x540efa,_0x30459e){return function(_0x163194){if(_0x163194){return _0x163194[_0xf77e('0x2d')]()[_0xf77e('0x2c')](function(){var _0x2c9d0e=_0x163194[_0xf77e('0x2e')]({'plain':!![]});var _0x236b37=_0xf77e('0x2f');return db['UserProfileResource'][_0xf77e('0x2d')]({'where':{'type':_0x236b37,'resourceId':_0x2c9d0e['id']}})[_0xf77e('0x2c')](function(){return _0x163194;});})['then'](function(){_0x540efa[_0xf77e('0x20')](0xcc)[_0xf77e('0x21')]();});}};}function handleEntityNotFound(_0xad3f75,_0x4ad0e3){return function(_0x1baf8c){if(!_0x1baf8c){_0xad3f75['sendStatus'](0x194);}return _0x1baf8c;};}function handleError(_0x52ba7d,_0x5944ee){_0x5944ee=_0x5944ee||0x1f4;return function(_0x3ebcfc){logger['error'](_0x3ebcfc[_0xf77e('0x30')]);if(_0x3ebcfc[_0xf77e('0x31')]){delete _0x3ebcfc[_0xf77e('0x31')];}_0x52ba7d[_0xf77e('0x20')](_0x5944ee)['send'](_0x3ebcfc);};}exports[_0xf77e('0x32')]=function(_0x2feb05,_0x57e06d){var _0x3fb126={},_0x3a27e8={},_0x18f59b={'count':0x0,'rows':[]};var _0x4fdf4b=_[_0xf77e('0x33')](db['FaxQueue'][_0xf77e('0x34')],function(_0x573fed){return{'name':_0x573fed[_0xf77e('0x35')],'type':_0x573fed[_0xf77e('0x36')][_0xf77e('0x37')]};});_0x3a27e8[_0xf77e('0x38')]=_['map'](_0x4fdf4b,_0xf77e('0x31'));_0x3a27e8[_0xf77e('0x39')]=_['keys'](_0x2feb05[_0xf77e('0x39')]);_0x3a27e8['filters']=_[_0xf77e('0x3a')](_0x3a27e8['model'],_0x3a27e8[_0xf77e('0x39')]);_0x3fb126['attributes']=_[_0xf77e('0x3a')](_0x3a27e8[_0xf77e('0x38')],qs[_0xf77e('0x3b')](_0x2feb05[_0xf77e('0x39')][_0xf77e('0x3b')]));_0x3fb126[_0xf77e('0x3c')]=_0x3fb126[_0xf77e('0x3c')][_0xf77e('0x3d')]?_0x3fb126[_0xf77e('0x3c')]:_0x3a27e8[_0xf77e('0x38')];if(!_0x2feb05['query'][_0xf77e('0x3e')](_0xf77e('0x3f'))){_0x3fb126[_0xf77e('0x25')]=qs['limit'](_0x2feb05[_0xf77e('0x39')]['limit']);_0x3fb126[_0xf77e('0x23')]=qs[_0xf77e('0x23')](_0x2feb05[_0xf77e('0x39')]['offset']);}_0x3fb126[_0xf77e('0x40')]=qs[_0xf77e('0x41')](_0x2feb05['query'][_0xf77e('0x41')]);_0x3fb126[_0xf77e('0x42')]=qs[_0xf77e('0x43')](_['pick'](_0x2feb05[_0xf77e('0x39')],_0x3a27e8[_0xf77e('0x43')]),_0x4fdf4b);if(_0x2feb05[_0xf77e('0x39')][_0xf77e('0x44')]){_0x3fb126[_0xf77e('0x42')]=_['merge'](_0x3fb126[_0xf77e('0x42')],{'$or':_[_0xf77e('0x33')](_0x4fdf4b,function(_0x343c26){if(_0x343c26[_0xf77e('0x36')]!=='VIRTUAL'){var _0x10a371={};_0x10a371[_0x343c26['name']]={'$like':'%'+_0x2feb05[_0xf77e('0x39')][_0xf77e('0x44')]+'%'};return _0x10a371;}})});}_0x3fb126=_[_0xf77e('0x45')]({},_0x3fb126,_0x2feb05[_0xf77e('0x46')]);var _0x9b6f70={'where':_0x3fb126[_0xf77e('0x42')]};return db[_0xf77e('0x47')][_0xf77e('0x24')](_0x9b6f70)[_0xf77e('0x2c')](function(_0x6d6d46){_0x18f59b[_0xf77e('0x24')]=_0x6d6d46;if(_0x2feb05[_0xf77e('0x39')]['includeAll']){_0x3fb126['include']=[{'all':!![]}];}return db[_0xf77e('0x47')]['findAll'](_0x3fb126);})['then'](function(_0x3a51d4){_0x18f59b[_0xf77e('0x48')]=_0x3a51d4;return _0x18f59b;})[_0xf77e('0x2c')](respondWithFilteredResult(_0x57e06d,_0x3fb126))[_0xf77e('0x49')](handleError(_0x57e06d,null));};exports[_0xf77e('0x4a')]=function(_0x4a6c3d,_0x37ca9b){var _0x2e0fa8={'raw':!![],'where':{'id':_0x4a6c3d[_0xf77e('0x4b')]['id']}},_0x5b38d4={};_0x5b38d4[_0xf77e('0x38')]=_[_0xf77e('0x4c')](db['FaxQueue'][_0xf77e('0x34')]);_0x5b38d4[_0xf77e('0x39')]=_[_0xf77e('0x4c')](_0x4a6c3d[_0xf77e('0x39')]);_0x5b38d4[_0xf77e('0x43')]=_[_0xf77e('0x3a')](_0x5b38d4['model'],_0x5b38d4['query']);_0x2e0fa8[_0xf77e('0x3c')]=_['intersection'](_0x5b38d4['model'],qs[_0xf77e('0x3b')](_0x4a6c3d[_0xf77e('0x39')][_0xf77e('0x3b')]));_0x2e0fa8['attributes']=_0x2e0fa8['attributes'][_0xf77e('0x3d')]?_0x2e0fa8[_0xf77e('0x3c')]:_0x5b38d4['model'];if(_0x4a6c3d['query']['includeAll']){_0x2e0fa8[_0xf77e('0x4d')]=[{'all':!![]}];}_0x2e0fa8=_['merge']({},_0x2e0fa8,_0x4a6c3d['options']);return db[_0xf77e('0x47')]['find'](_0x2e0fa8)[_0xf77e('0x2c')](handleEntityNotFound(_0x37ca9b,null))['then'](respondWithResult(_0x37ca9b,null))['catch'](handleError(_0x37ca9b,null));};exports['create']=function(_0x55a1f6,_0x3e462c){return db[_0xf77e('0x47')][_0xf77e('0x4e')](_0x55a1f6[_0xf77e('0x4f')],{})[_0xf77e('0x2c')](function(_0x2329dd){var _0x165e49=_0x55a1f6['user'][_0xf77e('0x2e')]({'plain':!![]});if(!_0x165e49)throw new Error(_0xf77e('0x50'));if(_0x165e49[_0xf77e('0x51')]===_0xf77e('0x52')){var _0x28b27d=_0x2329dd[_0xf77e('0x2e')]({'plain':!![]});var _0x574570=_0xf77e('0x2f');return db[_0xf77e('0x53')][_0xf77e('0x54')]({'where':{'name':_0x574570,'userProfileId':_0x165e49[_0xf77e('0x55')]},'raw':!![]})[_0xf77e('0x2c')](function(_0x44ab13){if(_0x44ab13&&_0x44ab13[_0xf77e('0x56')]===0x0){return db[_0xf77e('0x57')][_0xf77e('0x4e')]({'name':_0x28b27d['name'],'resourceId':_0x28b27d['id'],'type':_0x44ab13['name'],'sectionId':_0x44ab13['id']},{})[_0xf77e('0x2c')](function(){return _0x2329dd;});}else{return _0x2329dd;}})[_0xf77e('0x49')](function(_0x3d26d9){logger['error'](_0xf77e('0x58'),_0x3d26d9);throw _0x3d26d9;});}return _0x2329dd;})['then'](respondWithResult(_0x3e462c,0xc9))[_0xf77e('0x49')](handleError(_0x3e462c,null));};exports[_0xf77e('0x2b')]=function(_0x28ff79,_0x1086d9){if(_0x28ff79[_0xf77e('0x4f')]['id']){delete _0x28ff79[_0xf77e('0x4f')]['id'];}return db[_0xf77e('0x47')][_0xf77e('0x54')]({'where':{'id':_0x28ff79['params']['id']}})['then'](handleEntityNotFound(_0x1086d9,null))[_0xf77e('0x2c')](saveUpdates(_0x28ff79[_0xf77e('0x4f')],null))[_0xf77e('0x2c')](respondWithResult(_0x1086d9,null))[_0xf77e('0x49')](handleError(_0x1086d9,null));};exports[_0xf77e('0x2d')]=function(_0x204456,_0x38f187){return db[_0xf77e('0x47')][_0xf77e('0x54')]({'where':{'id':_0x204456[_0xf77e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x38f187,null))['then'](removeEntity(_0x38f187,null))['catch'](handleError(_0x38f187,null));};exports[_0xf77e('0x59')]=function(_0x298c9d,_0x491721){return db[_0xf77e('0x47')]['describe']()[_0xf77e('0x2c')](respondWithResult(_0x491721,null))['catch'](handleError(_0x491721,null));};exports[_0xf77e('0x5a')]=function(_0x3c7c34,_0x1453ac,_0x14af53){var _0x26090c={'raw':!![],'where':{}},_0x59536b={},_0x515fb5;return db['FaxQueue'][_0xf77e('0x5b')]({'where':{'id':_0x3c7c34[_0xf77e('0x4b')]['id']}})[_0xf77e('0x2c')](handleEntityNotFound(_0x1453ac,null))[_0xf77e('0x2c')](function(_0x5c366d){if(_0x5c366d){_0x515fb5=_0x5c366d[_0xf77e('0x2e')]({'plain':!![]});_0x59536b[_0xf77e('0x38')]=_[_0xf77e('0x4c')](db[_0xf77e('0x5c')][_0xf77e('0x34')]);_0x59536b[_0xf77e('0x39')]=_[_0xf77e('0x4c')](_0x3c7c34[_0xf77e('0x39')]);_0x59536b[_0xf77e('0x43')]=_[_0xf77e('0x3a')](_0x59536b[_0xf77e('0x38')],_0x59536b[_0xf77e('0x39')]);_0x26090c[_0xf77e('0x3c')]=_[_0xf77e('0x3a')](_0x59536b[_0xf77e('0x38')],qs['fields'](_0x3c7c34[_0xf77e('0x39')][_0xf77e('0x3b')]));_0x26090c[_0xf77e('0x3c')]=_0x26090c['attributes'][_0xf77e('0x3d')]?_0x26090c[_0xf77e('0x3c')]:_0x59536b[_0xf77e('0x38')];if(!_0x3c7c34['query'][_0xf77e('0x3e')](_0xf77e('0x3f'))){_0x26090c[_0xf77e('0x25')]=qs[_0xf77e('0x25')](_0x3c7c34['query'][_0xf77e('0x25')]);_0x26090c[_0xf77e('0x23')]=qs[_0xf77e('0x23')](_0x3c7c34[_0xf77e('0x39')][_0xf77e('0x23')]);}_0x26090c[_0xf77e('0x40')]=qs[_0xf77e('0x41')](_0x3c7c34['query'][_0xf77e('0x41')]);_0x26090c['where']=qs[_0xf77e('0x43')](_[_0xf77e('0x5d')](_0x3c7c34[_0xf77e('0x39')],_0x59536b[_0xf77e('0x43')]));_0x26090c['where'][_0xf77e('0x5e')]=_0x5c366d['id'];if(_0x3c7c34[_0xf77e('0x39')][_0xf77e('0x44')]){_0x26090c[_0xf77e('0x42')]=_[_0xf77e('0x45')](_0x26090c[_0xf77e('0x42')],{'$or':_[_0xf77e('0x33')](_0x26090c[_0xf77e('0x3c')],function(_0x16ee36){var _0x41e3ff={};_0x41e3ff[_0x16ee36]={'$like':'%'+_0x3c7c34[_0xf77e('0x39')][_0xf77e('0x44')]+'%'};return _0x41e3ff;})});}_0x26090c=_[_0xf77e('0x45')]({},_0x26090c,_0x3c7c34['options']);return db['UserFaxQueue'][_0xf77e('0x5f')](_0x26090c);}})[_0xf77e('0x2c')](function(_0x31e349){if(_0x31e349){return db['User'][_0xf77e('0x60')]({'where':{'id':_[_0xf77e('0x33')](_0x31e349,_0xf77e('0x61')),'role':_0xf77e('0x62')},'attributes':['id','name','faxPause',_0xf77e('0x63'),_0xf77e('0x64')]});}})[_0xf77e('0x2c')](function(_0x4475df){if(_0x4475df){return{'count':_0x4475df[_0xf77e('0x24')],'rows':_[_0xf77e('0x33')](_0x4475df[_0xf77e('0x48')],function(_0x124015){return{'membername':_0x124015[_0xf77e('0x31')],'UserId':_0x124015['id'],'queue_name':_0x515fb5[_0xf77e('0x31')],'FaxQueueId':_0x515fb5['id'],'interface':util['format'](_0xf77e('0x65'),'SIP',_0x124015[_0xf77e('0x31')]),'penalty':0x0,'paused':_0x124015['faxPause'],'createdAt':_0x124015['createdAt'],'updatedAt':_0x124015['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xf77e('0x2c')](respondWithFilteredResult(_0x1453ac,_0x26090c))[_0xf77e('0x49')](handleError(_0x1453ac,null));};exports[_0xf77e('0x66')]=function(_0x14987f,_0x2b7efe,_0x573794){var _0xa7cccb={};var _0x4d56de={};var _0x4d29fd;var _0x44e13f;return db[_0xf77e('0x47')]['findOne']({'where':{'id':_0x14987f[_0xf77e('0x4b')]['id']}})[_0xf77e('0x2c')](handleEntityNotFound(_0x2b7efe,null))[_0xf77e('0x2c')](function(_0x93e004){if(_0x93e004){_0x4d29fd=_0x93e004;_0x4d56de['model']=_[_0xf77e('0x4c')](db[_0xf77e('0x67')][_0xf77e('0x34')]);_0x4d56de[_0xf77e('0x39')]=_['keys'](_0x14987f[_0xf77e('0x39')]);_0x4d56de[_0xf77e('0x43')]=_['intersection'](_0x4d56de[_0xf77e('0x38')],_0x4d56de[_0xf77e('0x39')]);_0xa7cccb[_0xf77e('0x3c')]=_[_0xf77e('0x3a')](_0x4d56de[_0xf77e('0x38')],qs[_0xf77e('0x3b')](_0x14987f['query'][_0xf77e('0x3b')]));_0xa7cccb[_0xf77e('0x3c')]=_0xa7cccb['attributes'][_0xf77e('0x3d')]?_0xa7cccb['attributes']:_0x4d56de[_0xf77e('0x38')];_0xa7cccb[_0xf77e('0x40')]=qs['sort'](_0x14987f[_0xf77e('0x39')][_0xf77e('0x41')]);_0xa7cccb[_0xf77e('0x42')]=qs['filters'](_[_0xf77e('0x5d')](_0x14987f[_0xf77e('0x39')],_0x4d56de['filters']));if(_0x14987f[_0xf77e('0x39')]['filter']){_0xa7cccb['where']=_[_0xf77e('0x45')](_0xa7cccb['where'],{'$or':_[_0xf77e('0x33')](_0xa7cccb[_0xf77e('0x3c')],function(_0x3857e4){var _0x77f8a2={};_0x77f8a2[_0x3857e4]={'$like':'%'+_0x14987f[_0xf77e('0x39')][_0xf77e('0x44')]+'%'};return _0x77f8a2;})});}_0xa7cccb=_[_0xf77e('0x45')]({},_0xa7cccb,_0x14987f['options']);return _0x4d29fd['getTeams'](_0xa7cccb);}})[_0xf77e('0x2c')](function(_0x2448f1){if(_0x2448f1){_0x44e13f=_0x2448f1[_0xf77e('0x3d')];if(!_0x14987f['query'][_0xf77e('0x3e')](_0xf77e('0x3f'))){_0xa7cccb[_0xf77e('0x25')]=qs[_0xf77e('0x25')](_0x14987f[_0xf77e('0x39')][_0xf77e('0x25')]);_0xa7cccb[_0xf77e('0x23')]=qs[_0xf77e('0x23')](_0x14987f[_0xf77e('0x39')]['offset']);}return _0x4d29fd[_0xf77e('0x66')](_0xa7cccb);}})['then'](function(_0x5279dd){if(_0x5279dd){return _0x5279dd?{'count':_0x44e13f,'rows':_0x5279dd}:null;}})['then'](respondWithResult(_0x2b7efe,null))[_0xf77e('0x49')](handleError(_0x2b7efe,null));};exports[_0xf77e('0x68')]=function(_0x2d68cb,_0x3c522f,_0x1af15a){var _0x406113=_0x2d68cb[_0xf77e('0x4f')][_0xf77e('0x69')];return db[_0xf77e('0x67')][_0xf77e('0x5f')]({'where':{'id':_0x406113},'attributes':['id'],'include':[{'model':db[_0xf77e('0x6a')],'as':_0xf77e('0x6b'),'attributes':['id',_0xf77e('0x31'),'online',_0xf77e('0x6c'),_0xf77e('0x6d')],'raw':!![]}]})[_0xf77e('0x2c')](function(_0x3259af){if(_0x3259af){var _0x1d685b=_[_0xf77e('0x6e')](_0x3259af,function(_0x2127c6){var _0x447357=_0x2127c6[_0xf77e('0x2e')]({'plain':!![]});return _0x447357['Agents'];});return db[_0xf77e('0x47')]['find']({'where':{'id':_0x2d68cb[_0xf77e('0x4b')]['id']}})[_0xf77e('0x2c')](function(_0x2acf97){return db[_0xf77e('0x6f')][_0xf77e('0x70')](function(_0x300f0c){return _0x2acf97[_0xf77e('0x68')](_0x406113,{'transaction':_0x300f0c})[_0xf77e('0x2c')](function(){return BPromise[_0xf77e('0x71')](_0x1d685b,function(_0x4f53d1){return db[_0xf77e('0x5c')][_0xf77e('0x72')]({'where':{'UserId':_0x4f53d1['id'],'FaxQueueId':_0x2d68cb['params']['id']},'transaction':_0x300f0c});});})[_0xf77e('0x2c')](function(){_0x1d685b['forEach'](function(_0x24d575){socket[_0xf77e('0x73')]('userFaxQueue:save',{'UserId':_0x24d575['id'],'FaxQueueId':_0x2acf97['id']});});});});});}})[_0xf77e('0x2c')](respondWithStatusCode(_0x3c522f,null))[_0xf77e('0x49')](handleError(_0x3c522f,null));};exports[_0xf77e('0x74')]=function(_0x453236,_0x461c30,_0x512926){return db[_0xf77e('0x67')][_0xf77e('0x5f')]({'where':{'id':_0x453236[_0xf77e('0x39')]['ids']},'attributes':['id'],'include':[{'model':db[_0xf77e('0x6a')],'as':_0xf77e('0x6b'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x461c30,null))['then'](function(_0x26a598){var _0x543354=_[_0xf77e('0x33')](_0x26a598,'id');var _0x36f6c6=[];var _0x554054=[];var _0x14919d=squel['select']();_0x14919d['field']('tq.TeamId')[_0xf77e('0x75')](_0xf77e('0x76'),'tq')[_0xf77e('0x77')](_0xf77e('0x78'),'ut',_0xf77e('0x79'))[_0xf77e('0x42')]('FaxQueueId\x20=\x20?',_0x453236[_0xf77e('0x4b')]['id']);for(var _0x337dba=0x0;_0x337dba<_0x26a598[_0xf77e('0x3d')];_0x337dba+=0x1){let _0x109a67=_0x26a598[_0x337dba];for(var _0x45f4b2=0x0;_0x45f4b2<_0x109a67[_0xf77e('0x6b')]['length'];_0x45f4b2+=0x1){let _0x196ddc=_0x109a67[_0xf77e('0x6b')][_0x45f4b2];var _0x26672d=_0x14919d[_0xf77e('0x7a')]();_0x26672d[_0xf77e('0x42')](_0xf77e('0x7b'),_0x196ddc['id']);_0x554054[_0xf77e('0x7c')](db['sequelize']['query'](_0x26672d[_0xf77e('0x7d')](),{'type':db[_0xf77e('0x6f')][_0xf77e('0x7e')][_0xf77e('0x7f')]})[_0xf77e('0x2c')](function(_0x574f6a){if(_0x574f6a['length']===0x1){return _0x196ddc['id'];}else{var _0x4a69a7=_[_0xf77e('0x80')](_[_0xf77e('0x33')](_0x574f6a,'TeamId'),function(_0x24eb52){return _['includes'](_0x543354,_0x24eb52);});if(_0x4a69a7){return _0x196ddc['id'];}}}));}}return BPromise[_0xf77e('0x81')](_0x554054)[_0xf77e('0x2c')](function(_0x59a2f3){_0x36f6c6=_(_0x36f6c6)[_0xf77e('0x82')](_0x59a2f3)[_0xf77e('0x83')]()[_0xf77e('0x84')]();return db[_0xf77e('0x47')][_0xf77e('0x54')]({'where':{'id':_0x453236[_0xf77e('0x4b')]['id']}})[_0xf77e('0x2c')](function(_0xa714aa){return db['sequelize'][_0xf77e('0x70')](function(_0x189fd5){return _0xa714aa['removeTeams'](_0x453236[_0xf77e('0x39')]['ids'],{'transaction':_0x189fd5})[_0xf77e('0x2c')](function(){if(!_[_0xf77e('0x85')](_0x36f6c6)){return _0xa714aa[_0xf77e('0x86')](_0x36f6c6,{'transaction':_0x189fd5});}})[_0xf77e('0x2c')](function(){_0x36f6c6['forEach'](function(_0x13b071){socket['emit'](_0xf77e('0x87'),{'UserId':_0x13b071,'FaxQueueId':_0xa714aa['id']});});});});});});})[_0xf77e('0x2c')](respondWithStatusCode(_0x461c30,null))[_0xf77e('0x49')](handleError(_0x461c30,null));};exports[_0xf77e('0x88')]=function(_0x29c8e8,_0x266a7f,_0x3e8bf6){return db[_0xf77e('0x47')]['find']({'where':{'id':_0x29c8e8['params']['id']}})[_0xf77e('0x2c')](handleEntityNotFound(_0x266a7f,null))[_0xf77e('0x2c')](function(_0x6b473a){if(_0x6b473a){return _0x6b473a[_0xf77e('0x88')](_0x29c8e8[_0xf77e('0x4f')][_0xf77e('0x69')],_[_0xf77e('0x89')](_0x29c8e8[_0xf77e('0x4f')],[_0xf77e('0x69'),'id'])||{})[_0xf77e('0x8a')](function(_0x379ddf){for(var _0x3f5e14=0x0;_0x3f5e14<_0x29c8e8[_0xf77e('0x4f')][_0xf77e('0x69')][_0xf77e('0x3d')];_0x3f5e14+=0x1){socket[_0xf77e('0x73')](_0xf77e('0x8b'),{'UserId':Number(_0x29c8e8['body']['ids'][_0x3f5e14]),'FaxQueueId':Number(_0x29c8e8['params']['id'])});}return _0x379ddf;});}})[_0xf77e('0x2c')](respondWithResult(_0x266a7f,null))[_0xf77e('0x49')](handleError(_0x266a7f,null));};exports['removeAgents']=function(_0x539395,_0x3017d9,_0x2db008){return db[_0xf77e('0x47')]['find']({'where':{'id':_0x539395[_0xf77e('0x4b')]['id']}})[_0xf77e('0x2c')](handleEntityNotFound(_0x3017d9,null))[_0xf77e('0x2c')](function(_0x8e1341){if(_0x8e1341){return _0x8e1341[_0xf77e('0x86')](_0x539395[_0xf77e('0x39')][_0xf77e('0x69')])[_0xf77e('0x2c')](function(){if(_[_0xf77e('0x8c')](_0x539395[_0xf77e('0x39')]['ids'])){for(var _0x201fe2=0x0;_0x201fe2<_0x539395[_0xf77e('0x39')][_0xf77e('0x69')][_0xf77e('0x3d')];_0x201fe2+=0x1){socket[_0xf77e('0x73')](_0xf77e('0x87'),{'UserId':Number(_0x539395['query']['ids'][_0x201fe2]),'FaxQueueId':Number(_0x539395['params']['id'])});}}else{socket[_0xf77e('0x73')](_0xf77e('0x87'),{'UserId':Number(_0x539395[_0xf77e('0x39')][_0xf77e('0x69')]),'FaxQueueId':Number(_0x539395[_0xf77e('0x4b')]['id'])});}});}})[_0xf77e('0x2c')](respondWithStatusCode(_0x3017d9,null))[_0xf77e('0x49')](handleError(_0x3017d9,null));};exports[_0xf77e('0x8d')]=function(_0x53035d,_0x3b850e,_0x14536d){var _0x3cb583={};var _0x197f4a={};var _0x4a8b38;var _0x2f1d67;return db['FaxQueue'][_0xf77e('0x5b')]({'where':{'id':_0x53035d[_0xf77e('0x4b')]['id']}})[_0xf77e('0x2c')](handleEntityNotFound(_0x3b850e,null))['then'](function(_0x5f38d3){if(_0x5f38d3){_0x4a8b38=_0x5f38d3;_0x197f4a[_0xf77e('0x38')]=_[_0xf77e('0x4c')](db[_0xf77e('0x6a')]['rawAttributes']);_0x197f4a[_0xf77e('0x39')]=_[_0xf77e('0x4c')](_0x53035d[_0xf77e('0x39')]);_0x197f4a[_0xf77e('0x43')]=_[_0xf77e('0x3a')](_0x197f4a[_0xf77e('0x38')],_0x197f4a[_0xf77e('0x39')]);_0x3cb583[_0xf77e('0x3c')]=_[_0xf77e('0x3a')](_0x197f4a[_0xf77e('0x38')],qs[_0xf77e('0x3b')](_0x53035d[_0xf77e('0x39')][_0xf77e('0x3b')]));_0x3cb583[_0xf77e('0x3c')]=_0x3cb583['attributes'][_0xf77e('0x3d')]?_0x3cb583['attributes']:_0x197f4a[_0xf77e('0x38')];_0x3cb583['order']=qs['sort'](_0x53035d['query'][_0xf77e('0x41')]);_0x3cb583['where']=qs[_0xf77e('0x43')](_['pick'](_0x53035d[_0xf77e('0x39')],_0x197f4a[_0xf77e('0x43')]));if(_0x53035d[_0xf77e('0x39')][_0xf77e('0x44')]){_0x3cb583[_0xf77e('0x42')]=_['merge'](_0x3cb583['where'],{'$or':_[_0xf77e('0x33')](_0x3cb583['attributes'],function(_0x28030c){var _0x1e1a60={};_0x1e1a60[_0x28030c]={'$like':'%'+_0x53035d[_0xf77e('0x39')][_0xf77e('0x44')]+'%'};return _0x1e1a60;})});}_0x3cb583=_['merge']({},_0x3cb583,_0x53035d[_0xf77e('0x46')]);return _0x4a8b38[_0xf77e('0x8d')](_0x3cb583);}})['then'](function(_0x17a00a){if(_0x17a00a){_0x2f1d67=_0x17a00a['length'];if(!_0x53035d[_0xf77e('0x39')][_0xf77e('0x3e')](_0xf77e('0x3f'))){_0x3cb583['limit']=qs['limit'](_0x53035d[_0xf77e('0x39')][_0xf77e('0x25')]);_0x3cb583[_0xf77e('0x23')]=qs['offset'](_0x53035d[_0xf77e('0x39')][_0xf77e('0x23')]);}return _0x4a8b38['getAgents'](_0x3cb583);}})[_0xf77e('0x2c')](function(_0x1834bb){if(_0x1834bb){return _0x1834bb?{'count':_0x2f1d67,'rows':_0x1834bb}:null;}})[_0xf77e('0x2c')](respondWithResult(_0x3b850e,null))[_0xf77e('0x49')](handleError(_0x3b850e,null));}; \ No newline at end of file +var _0x1bbe=['end','status','offset','undefined','limit','count','set','apply','update','then','destroy','get','FaxQueues','UserProfileResource','sendStatus','error','stack','name','send','index','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','FaxQueue','includeAll','include','findAll','rows','catch','show','params','keys','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserFaxQueue','FaxQueueId','findAndCountAll','faxPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','ids','Agents','online','voicePause','interface','flatMap','sequelize','addTeams','each','findOrCreate','forEach','emit','userFaxQueue:save','removeTeams','User','field','tq.TeamId','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','push','toString','QueryTypes','SELECT','TeamId','includes','all','union','value','transaction','isEmpty','removeAgents','userFaxQueue:remove','addAgents','spread','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket'];(function(_0x4cf950,_0x5aa18b){var _0x36f361=function(_0x8c7b95){while(--_0x8c7b95){_0x4cf950['push'](_0x4cf950['shift']());}};_0x36f361(++_0x5aa18b);}(_0x1bbe,0xfc));var _0xe1bb=function(_0x4e00da,_0x6c9063){_0x4e00da=_0x4e00da-0x0;var _0x2f9c7a=_0x1bbe[_0x4e00da];return _0x2f9c7a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe1bb('0x0'));var zipdir=require(_0xe1bb('0x1'));var jsonpatch=require(_0xe1bb('0x2'));var rp=require(_0xe1bb('0x3'));var moment=require(_0xe1bb('0x4'));var BPromise=require(_0xe1bb('0x5'));var Mustache=require(_0xe1bb('0x6'));var util=require(_0xe1bb('0x7'));var path=require(_0xe1bb('0x8'));var sox=require(_0xe1bb('0x9'));var csv=require(_0xe1bb('0xa'));var ejs=require(_0xe1bb('0xb'));var fs=require('fs');var fs_extra=require(_0xe1bb('0xc'));var _=require(_0xe1bb('0xd'));var squel=require('squel');var crypto=require(_0xe1bb('0xe'));var jsforce=require(_0xe1bb('0xf'));var deskjs=require(_0xe1bb('0x10'));var toCsv=require(_0xe1bb('0xa'));var querystring=require(_0xe1bb('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe1bb('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xe1bb('0x13'));var hardwareService=require(_0xe1bb('0x14'));var logger=require(_0xe1bb('0x15'))(_0xe1bb('0x16'));var utils=require(_0xe1bb('0x17'));var config=require(_0xe1bb('0x18'));var licenseUtil=require(_0xe1bb('0x19'));var db=require(_0xe1bb('0x1a'))['db'];config[_0xe1bb('0x1b')]=_[_0xe1bb('0x1c')](config['redis'],{'host':_0xe1bb('0x1d'),'port':0x18eb});var socket=require(_0xe1bb('0x1e'))(new Redis(config[_0xe1bb('0x1b')]));require(_0xe1bb('0x1f'))['register'](socket);function respondWithStatusCode(_0x4fd8f7,_0x346b40){_0x346b40=_0x346b40||0xcc;return function(_0x3f82cf){if(_0x3f82cf){return _0x4fd8f7['sendStatus'](_0x346b40);}return _0x4fd8f7['status'](_0x346b40)[_0xe1bb('0x20')]();};}function respondWithResult(_0x24b912,_0x19807a){_0x19807a=_0x19807a||0xc8;return function(_0x34bb8a){if(_0x34bb8a){return _0x24b912[_0xe1bb('0x21')](_0x19807a)['json'](_0x34bb8a);}};}function respondWithFilteredResult(_0x372418,_0x17d0fd){return function(_0x5d8d70){if(_0x5d8d70){var _0x1a6215=typeof _0x17d0fd[_0xe1bb('0x22')]===_0xe1bb('0x23')&&typeof _0x17d0fd[_0xe1bb('0x24')]===_0xe1bb('0x23');var _0x4c1b3b=_0x5d8d70[_0xe1bb('0x25')];var _0x2eccfb=_0x1a6215?0x0:_0x17d0fd['offset'];var _0x269015=_0x1a6215?_0x5d8d70[_0xe1bb('0x25')]:_0x17d0fd[_0xe1bb('0x22')]+_0x17d0fd[_0xe1bb('0x24')];var _0x509bfb;if(_0x269015>=_0x4c1b3b){_0x269015=_0x4c1b3b;_0x509bfb=0xc8;}else{_0x509bfb=0xce;}_0x372418[_0xe1bb('0x21')](_0x509bfb);return _0x372418[_0xe1bb('0x26')]('Content-Range',_0x2eccfb+'-'+_0x269015+'/'+_0x4c1b3b)['json'](_0x5d8d70);}return null;};}function patchUpdates(_0x4f14df){return function(_0x335129){try{jsonpatch[_0xe1bb('0x27')](_0x335129,_0x4f14df,!![]);}catch(_0x4e7fd9){return BPromise['reject'](_0x4e7fd9);}return _0x335129['save']();};}function saveUpdates(_0xe47820,_0x4f36fb){return function(_0xc2ebd0){if(_0xc2ebd0){return _0xc2ebd0[_0xe1bb('0x28')](_0xe47820)[_0xe1bb('0x29')](function(_0x42a228){return _0x42a228;});}return null;};}function removeEntity(_0x43bf09,_0x2428fd){return function(_0x43d357){if(_0x43d357){return _0x43d357[_0xe1bb('0x2a')]()[_0xe1bb('0x29')](function(){var _0x21f7d3=_0x43d357[_0xe1bb('0x2b')]({'plain':!![]});var _0x4e5a0a=_0xe1bb('0x2c');return db[_0xe1bb('0x2d')][_0xe1bb('0x2a')]({'where':{'type':_0x4e5a0a,'resourceId':_0x21f7d3['id']}})['then'](function(){return _0x43d357;});})[_0xe1bb('0x29')](function(){_0x43bf09[_0xe1bb('0x21')](0xcc)[_0xe1bb('0x20')]();});}};}function handleEntityNotFound(_0xfb234a,_0x21402d){return function(_0x34e446){if(!_0x34e446){_0xfb234a[_0xe1bb('0x2e')](0x194);}return _0x34e446;};}function handleError(_0x2ae9f7,_0x18aec5){_0x18aec5=_0x18aec5||0x1f4;return function(_0x505053){logger[_0xe1bb('0x2f')](_0x505053[_0xe1bb('0x30')]);if(_0x505053[_0xe1bb('0x31')]){delete _0x505053['name'];}_0x2ae9f7[_0xe1bb('0x21')](_0x18aec5)[_0xe1bb('0x32')](_0x505053);};}exports[_0xe1bb('0x33')]=function(_0x12fa78,_0x39b3b7){var _0x3e96b2={},_0x1f256f={},_0x812f75={'count':0x0,'rows':[]};var _0x4523eb=_[_0xe1bb('0x34')](db['FaxQueue'][_0xe1bb('0x35')],function(_0x104fd1){return{'name':_0x104fd1['fieldName'],'type':_0x104fd1[_0xe1bb('0x36')][_0xe1bb('0x37')]};});_0x1f256f[_0xe1bb('0x38')]=_['map'](_0x4523eb,_0xe1bb('0x31'));_0x1f256f['query']=_['keys'](_0x12fa78[_0xe1bb('0x39')]);_0x1f256f[_0xe1bb('0x3a')]=_[_0xe1bb('0x3b')](_0x1f256f[_0xe1bb('0x38')],_0x1f256f[_0xe1bb('0x39')]);_0x3e96b2[_0xe1bb('0x3c')]=_[_0xe1bb('0x3b')](_0x1f256f[_0xe1bb('0x38')],qs['fields'](_0x12fa78[_0xe1bb('0x39')][_0xe1bb('0x3d')]));_0x3e96b2[_0xe1bb('0x3c')]=_0x3e96b2[_0xe1bb('0x3c')][_0xe1bb('0x3e')]?_0x3e96b2[_0xe1bb('0x3c')]:_0x1f256f[_0xe1bb('0x38')];if(!_0x12fa78['query'][_0xe1bb('0x3f')](_0xe1bb('0x40'))){_0x3e96b2['limit']=qs['limit'](_0x12fa78['query'][_0xe1bb('0x24')]);_0x3e96b2['offset']=qs[_0xe1bb('0x22')](_0x12fa78['query'][_0xe1bb('0x22')]);}_0x3e96b2[_0xe1bb('0x41')]=qs[_0xe1bb('0x42')](_0x12fa78['query'][_0xe1bb('0x42')]);_0x3e96b2[_0xe1bb('0x43')]=qs[_0xe1bb('0x3a')](_[_0xe1bb('0x44')](_0x12fa78[_0xe1bb('0x39')],_0x1f256f[_0xe1bb('0x3a')]),_0x4523eb);if(_0x12fa78[_0xe1bb('0x39')][_0xe1bb('0x45')]){_0x3e96b2[_0xe1bb('0x43')]=_[_0xe1bb('0x46')](_0x3e96b2[_0xe1bb('0x43')],{'$or':_['map'](_0x4523eb,function(_0xecb10){if(_0xecb10[_0xe1bb('0x36')]!==_0xe1bb('0x47')){var _0x2a30bb={};_0x2a30bb[_0xecb10['name']]={'$like':'%'+_0x12fa78[_0xe1bb('0x39')]['filter']+'%'};return _0x2a30bb;}})});}_0x3e96b2=_[_0xe1bb('0x46')]({},_0x3e96b2,_0x12fa78[_0xe1bb('0x48')]);var _0x4ae60f={'where':_0x3e96b2['where']};return db[_0xe1bb('0x49')][_0xe1bb('0x25')](_0x4ae60f)[_0xe1bb('0x29')](function(_0x179979){_0x812f75['count']=_0x179979;if(_0x12fa78['query'][_0xe1bb('0x4a')]){_0x3e96b2[_0xe1bb('0x4b')]=[{'all':!![]}];}return db[_0xe1bb('0x49')][_0xe1bb('0x4c')](_0x3e96b2);})[_0xe1bb('0x29')](function(_0x400539){_0x812f75[_0xe1bb('0x4d')]=_0x400539;return _0x812f75;})['then'](respondWithFilteredResult(_0x39b3b7,_0x3e96b2))[_0xe1bb('0x4e')](handleError(_0x39b3b7,null));};exports[_0xe1bb('0x4f')]=function(_0x5b1e46,_0x355c1a){var _0x2e5a4d={'raw':!![],'where':{'id':_0x5b1e46[_0xe1bb('0x50')]['id']}},_0x42f218={};_0x42f218['model']=_['keys'](db[_0xe1bb('0x49')][_0xe1bb('0x35')]);_0x42f218[_0xe1bb('0x39')]=_[_0xe1bb('0x51')](_0x5b1e46[_0xe1bb('0x39')]);_0x42f218['filters']=_['intersection'](_0x42f218['model'],_0x42f218[_0xe1bb('0x39')]);_0x2e5a4d[_0xe1bb('0x3c')]=_[_0xe1bb('0x3b')](_0x42f218['model'],qs[_0xe1bb('0x3d')](_0x5b1e46[_0xe1bb('0x39')]['fields']));_0x2e5a4d[_0xe1bb('0x3c')]=_0x2e5a4d['attributes'][_0xe1bb('0x3e')]?_0x2e5a4d[_0xe1bb('0x3c')]:_0x42f218[_0xe1bb('0x38')];if(_0x5b1e46[_0xe1bb('0x39')][_0xe1bb('0x4a')]){_0x2e5a4d[_0xe1bb('0x4b')]=[{'all':!![]}];}_0x2e5a4d=_['merge']({},_0x2e5a4d,_0x5b1e46[_0xe1bb('0x48')]);return db[_0xe1bb('0x49')][_0xe1bb('0x52')](_0x2e5a4d)['then'](handleEntityNotFound(_0x355c1a,null))[_0xe1bb('0x29')](respondWithResult(_0x355c1a,null))[_0xe1bb('0x4e')](handleError(_0x355c1a,null));};exports[_0xe1bb('0x53')]=function(_0x3037b0,_0x38de93){return db[_0xe1bb('0x49')]['create'](_0x3037b0['body'],{})[_0xe1bb('0x29')](function(_0x38ff0e){var _0x33331e=_0x3037b0[_0xe1bb('0x54')]['get']({'plain':!![]});if(!_0x33331e)throw new Error(_0xe1bb('0x55'));if(_0x33331e[_0xe1bb('0x56')]===_0xe1bb('0x54')){var _0xae46=_0x38ff0e[_0xe1bb('0x2b')]({'plain':!![]});var _0x3b0069=_0xe1bb('0x2c');return db[_0xe1bb('0x57')]['find']({'where':{'name':_0x3b0069,'userProfileId':_0x33331e['userProfileId']},'raw':!![]})['then'](function(_0x285f88){if(_0x285f88&&_0x285f88['autoAssociation']===0x0){return db[_0xe1bb('0x2d')]['create']({'name':_0xae46[_0xe1bb('0x31')],'resourceId':_0xae46['id'],'type':_0x285f88[_0xe1bb('0x31')],'sectionId':_0x285f88['id']},{})[_0xe1bb('0x29')](function(){return _0x38ff0e;});}else{return _0x38ff0e;}})[_0xe1bb('0x4e')](function(_0x124cb1){logger[_0xe1bb('0x2f')](_0xe1bb('0x58'),_0x124cb1);throw _0x124cb1;});}return _0x38ff0e;})[_0xe1bb('0x29')](respondWithResult(_0x38de93,0xc9))[_0xe1bb('0x4e')](handleError(_0x38de93,null));};exports['update']=function(_0x48ae68,_0x53f0c7){if(_0x48ae68[_0xe1bb('0x59')]['id']){delete _0x48ae68['body']['id'];}return db[_0xe1bb('0x49')][_0xe1bb('0x52')]({'where':{'id':_0x48ae68['params']['id']}})['then'](handleEntityNotFound(_0x53f0c7,null))[_0xe1bb('0x29')](saveUpdates(_0x48ae68[_0xe1bb('0x59')],null))['then'](respondWithResult(_0x53f0c7,null))[_0xe1bb('0x4e')](handleError(_0x53f0c7,null));};exports[_0xe1bb('0x2a')]=function(_0xb7d4ec,_0xca5c7f){return db['FaxQueue'][_0xe1bb('0x52')]({'where':{'id':_0xb7d4ec[_0xe1bb('0x50')]['id']}})['then'](handleEntityNotFound(_0xca5c7f,null))[_0xe1bb('0x29')](removeEntity(_0xca5c7f,null))[_0xe1bb('0x4e')](handleError(_0xca5c7f,null));};exports[_0xe1bb('0x5a')]=function(_0x27b930,_0x31600e){return db[_0xe1bb('0x49')][_0xe1bb('0x5a')]()[_0xe1bb('0x29')](respondWithResult(_0x31600e,null))[_0xe1bb('0x4e')](handleError(_0x31600e,null));};exports[_0xe1bb('0x5b')]=function(_0x2811ac,_0xfceb91,_0x535224){var _0xe8449b={'raw':!![],'where':{}},_0x36d398={},_0x5a883a;return db[_0xe1bb('0x49')][_0xe1bb('0x5c')]({'where':{'id':_0x2811ac[_0xe1bb('0x50')]['id']}})[_0xe1bb('0x29')](handleEntityNotFound(_0xfceb91,null))['then'](function(_0xb23686){if(_0xb23686){_0x5a883a=_0xb23686[_0xe1bb('0x2b')]({'plain':!![]});_0x36d398['model']=_[_0xe1bb('0x51')](db[_0xe1bb('0x5d')]['rawAttributes']);_0x36d398['query']=_['keys'](_0x2811ac[_0xe1bb('0x39')]);_0x36d398['filters']=_[_0xe1bb('0x3b')](_0x36d398[_0xe1bb('0x38')],_0x36d398['query']);_0xe8449b[_0xe1bb('0x3c')]=_[_0xe1bb('0x3b')](_0x36d398['model'],qs[_0xe1bb('0x3d')](_0x2811ac[_0xe1bb('0x39')][_0xe1bb('0x3d')]));_0xe8449b[_0xe1bb('0x3c')]=_0xe8449b[_0xe1bb('0x3c')][_0xe1bb('0x3e')]?_0xe8449b[_0xe1bb('0x3c')]:_0x36d398['model'];if(!_0x2811ac[_0xe1bb('0x39')][_0xe1bb('0x3f')](_0xe1bb('0x40'))){_0xe8449b['limit']=qs['limit'](_0x2811ac[_0xe1bb('0x39')][_0xe1bb('0x24')]);_0xe8449b['offset']=qs[_0xe1bb('0x22')](_0x2811ac['query']['offset']);}_0xe8449b[_0xe1bb('0x41')]=qs[_0xe1bb('0x42')](_0x2811ac[_0xe1bb('0x39')]['sort']);_0xe8449b['where']=qs[_0xe1bb('0x3a')](_[_0xe1bb('0x44')](_0x2811ac['query'],_0x36d398[_0xe1bb('0x3a')]));_0xe8449b[_0xe1bb('0x43')][_0xe1bb('0x5e')]=_0xb23686['id'];if(_0x2811ac[_0xe1bb('0x39')]['filter']){_0xe8449b[_0xe1bb('0x43')]=_[_0xe1bb('0x46')](_0xe8449b[_0xe1bb('0x43')],{'$or':_['map'](_0xe8449b[_0xe1bb('0x3c')],function(_0x1e0897){var _0x5017ce={};_0x5017ce[_0x1e0897]={'$like':'%'+_0x2811ac[_0xe1bb('0x39')][_0xe1bb('0x45')]+'%'};return _0x5017ce;})});}_0xe8449b=_['merge']({},_0xe8449b,_0x2811ac[_0xe1bb('0x48')]);return db[_0xe1bb('0x5d')][_0xe1bb('0x4c')](_0xe8449b);}})[_0xe1bb('0x29')](function(_0x29c1e1){if(_0x29c1e1){return db['User'][_0xe1bb('0x5f')]({'where':{'id':_[_0xe1bb('0x34')](_0x29c1e1,'UserId'),'role':'agent'},'attributes':['id',_0xe1bb('0x31'),_0xe1bb('0x60'),_0xe1bb('0x61'),_0xe1bb('0x62')]});}})[_0xe1bb('0x29')](function(_0x178674){if(_0x178674){return{'count':_0x178674[_0xe1bb('0x25')],'rows':_['map'](_0x178674[_0xe1bb('0x4d')],function(_0x2865b5){return{'membername':_0x2865b5[_0xe1bb('0x31')],'UserId':_0x2865b5['id'],'queue_name':_0x5a883a[_0xe1bb('0x31')],'FaxQueueId':_0x5a883a['id'],'interface':util[_0xe1bb('0x63')](_0xe1bb('0x64'),_0xe1bb('0x65'),_0x2865b5[_0xe1bb('0x31')]),'penalty':0x0,'paused':_0x2865b5[_0xe1bb('0x60')],'createdAt':_0x2865b5[_0xe1bb('0x62')],'updatedAt':_0x2865b5[_0xe1bb('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xe1bb('0x29')](respondWithFilteredResult(_0xfceb91,_0xe8449b))['catch'](handleError(_0xfceb91,null));};exports[_0xe1bb('0x66')]=function(_0x11b78d,_0x85a38c,_0x3a10de){var _0x370c7a={};var _0xceb92e={};var _0x261ea8;var _0x2cb9c2;return db['FaxQueue'][_0xe1bb('0x5c')]({'where':{'id':_0x11b78d['params']['id']}})[_0xe1bb('0x29')](handleEntityNotFound(_0x85a38c,null))[_0xe1bb('0x29')](function(_0x5ac910){if(_0x5ac910){_0x261ea8=_0x5ac910;_0xceb92e[_0xe1bb('0x38')]=_['keys'](db[_0xe1bb('0x67')][_0xe1bb('0x35')]);_0xceb92e[_0xe1bb('0x39')]=_[_0xe1bb('0x51')](_0x11b78d['query']);_0xceb92e[_0xe1bb('0x3a')]=_[_0xe1bb('0x3b')](_0xceb92e[_0xe1bb('0x38')],_0xceb92e['query']);_0x370c7a[_0xe1bb('0x3c')]=_[_0xe1bb('0x3b')](_0xceb92e[_0xe1bb('0x38')],qs['fields'](_0x11b78d[_0xe1bb('0x39')][_0xe1bb('0x3d')]));_0x370c7a['attributes']=_0x370c7a[_0xe1bb('0x3c')][_0xe1bb('0x3e')]?_0x370c7a['attributes']:_0xceb92e[_0xe1bb('0x38')];_0x370c7a['order']=qs[_0xe1bb('0x42')](_0x11b78d[_0xe1bb('0x39')][_0xe1bb('0x42')]);_0x370c7a[_0xe1bb('0x43')]=qs[_0xe1bb('0x3a')](_[_0xe1bb('0x44')](_0x11b78d['query'],_0xceb92e[_0xe1bb('0x3a')]));if(_0x11b78d[_0xe1bb('0x39')][_0xe1bb('0x45')]){_0x370c7a[_0xe1bb('0x43')]=_['merge'](_0x370c7a['where'],{'$or':_['map'](_0x370c7a[_0xe1bb('0x3c')],function(_0x4c7b24){var _0x2b1ce8={};_0x2b1ce8[_0x4c7b24]={'$like':'%'+_0x11b78d[_0xe1bb('0x39')][_0xe1bb('0x45')]+'%'};return _0x2b1ce8;})});}_0x370c7a=_[_0xe1bb('0x46')]({},_0x370c7a,_0x11b78d[_0xe1bb('0x48')]);return _0x261ea8[_0xe1bb('0x66')](_0x370c7a);}})[_0xe1bb('0x29')](function(_0x4cefb9){if(_0x4cefb9){_0x2cb9c2=_0x4cefb9[_0xe1bb('0x3e')];if(!_0x11b78d[_0xe1bb('0x39')][_0xe1bb('0x3f')](_0xe1bb('0x40'))){_0x370c7a[_0xe1bb('0x24')]=qs[_0xe1bb('0x24')](_0x11b78d[_0xe1bb('0x39')]['limit']);_0x370c7a[_0xe1bb('0x22')]=qs[_0xe1bb('0x22')](_0x11b78d['query'][_0xe1bb('0x22')]);}return _0x261ea8['getTeams'](_0x370c7a);}})[_0xe1bb('0x29')](function(_0x5ea1de){if(_0x5ea1de){return _0x5ea1de?{'count':_0x2cb9c2,'rows':_0x5ea1de}:null;}})[_0xe1bb('0x29')](respondWithResult(_0x85a38c,null))[_0xe1bb('0x4e')](handleError(_0x85a38c,null));};exports['addTeams']=function(_0x10c1d2,_0x59fee6,_0x2686d9){var _0x26969d=_0x10c1d2[_0xe1bb('0x59')][_0xe1bb('0x68')];return db[_0xe1bb('0x67')]['findAll']({'where':{'id':_0x26969d},'attributes':['id'],'include':[{'model':db['User'],'as':_0xe1bb('0x69'),'attributes':['id','name',_0xe1bb('0x6a'),_0xe1bb('0x6b'),_0xe1bb('0x6c')],'raw':!![]}]})['then'](function(_0x20e9a7){if(_0x20e9a7){var _0x1d5576=_[_0xe1bb('0x6d')](_0x20e9a7,function(_0x5c50c5){var _0x4d47fd=_0x5c50c5[_0xe1bb('0x2b')]({'plain':!![]});return _0x4d47fd[_0xe1bb('0x69')];});return db['FaxQueue'][_0xe1bb('0x52')]({'where':{'id':_0x10c1d2[_0xe1bb('0x50')]['id']}})[_0xe1bb('0x29')](function(_0x5b2369){return db[_0xe1bb('0x6e')]['transaction'](function(_0x2e8ea4){return _0x5b2369[_0xe1bb('0x6f')](_0x26969d,{'transaction':_0x2e8ea4})[_0xe1bb('0x29')](function(){return BPromise[_0xe1bb('0x70')](_0x1d5576,function(_0x2a49c5){return db[_0xe1bb('0x5d')][_0xe1bb('0x71')]({'where':{'UserId':_0x2a49c5['id'],'FaxQueueId':_0x10c1d2[_0xe1bb('0x50')]['id']},'transaction':_0x2e8ea4});});})['then'](function(){_0x1d5576[_0xe1bb('0x72')](function(_0x193cd3){socket[_0xe1bb('0x73')](_0xe1bb('0x74'),{'UserId':_0x193cd3['id'],'FaxQueueId':_0x5b2369['id']});});});});});}})[_0xe1bb('0x29')](respondWithStatusCode(_0x59fee6,null))[_0xe1bb('0x4e')](handleError(_0x59fee6,null));};exports[_0xe1bb('0x75')]=function(_0x5d6e33,_0x21e1a0,_0x41a430){return db[_0xe1bb('0x67')][_0xe1bb('0x4c')]({'where':{'id':_0x5d6e33[_0xe1bb('0x39')][_0xe1bb('0x68')]},'attributes':['id'],'include':[{'model':db[_0xe1bb('0x76')],'as':_0xe1bb('0x69'),'attributes':['id'],'raw':!![]}]})[_0xe1bb('0x29')](handleEntityNotFound(_0x21e1a0,null))[_0xe1bb('0x29')](function(_0x2ce2d6){var _0x1b6279=_[_0xe1bb('0x34')](_0x2ce2d6,'id');var _0x446192=[];var _0x5081dc=[];var _0x3ae0a1=squel['select']();_0x3ae0a1[_0xe1bb('0x77')](_0xe1bb('0x78'))['from']('team_has_fax_queues','tq')[_0xe1bb('0x79')](_0xe1bb('0x7a'),'ut',_0xe1bb('0x7b'))[_0xe1bb('0x43')]('FaxQueueId\x20=\x20?',_0x5d6e33[_0xe1bb('0x50')]['id']);for(var _0x30068d=0x0;_0x30068d<_0x2ce2d6[_0xe1bb('0x3e')];_0x30068d+=0x1){let _0x24489f=_0x2ce2d6[_0x30068d];for(var _0x38b56c=0x0;_0x38b56c<_0x24489f[_0xe1bb('0x69')][_0xe1bb('0x3e')];_0x38b56c+=0x1){let _0x325a22=_0x24489f['Agents'][_0x38b56c];var _0x1c6e65=_0x3ae0a1[_0xe1bb('0x7c')]();_0x1c6e65[_0xe1bb('0x43')]('ut.UserId\x20=\x20?',_0x325a22['id']);_0x5081dc[_0xe1bb('0x7d')](db[_0xe1bb('0x6e')]['query'](_0x1c6e65[_0xe1bb('0x7e')](),{'type':db[_0xe1bb('0x6e')][_0xe1bb('0x7f')][_0xe1bb('0x80')]})[_0xe1bb('0x29')](function(_0x23aac6){if(_0x23aac6['length']===0x1){return _0x325a22['id'];}else{var _0x6f8f61=_['every'](_[_0xe1bb('0x34')](_0x23aac6,_0xe1bb('0x81')),function(_0x450856){return _[_0xe1bb('0x82')](_0x1b6279,_0x450856);});if(_0x6f8f61){return _0x325a22['id'];}}}));}}return BPromise[_0xe1bb('0x83')](_0x5081dc)['then'](function(_0x3eb604){_0x446192=_(_0x446192)[_0xe1bb('0x84')](_0x3eb604)['compact']()[_0xe1bb('0x85')]();return db[_0xe1bb('0x49')][_0xe1bb('0x52')]({'where':{'id':_0x5d6e33[_0xe1bb('0x50')]['id']}})['then'](function(_0x361a58){return db[_0xe1bb('0x6e')][_0xe1bb('0x86')](function(_0x4820fe){return _0x361a58[_0xe1bb('0x75')](_0x5d6e33['query']['ids'],{'transaction':_0x4820fe})['then'](function(){if(!_[_0xe1bb('0x87')](_0x446192)){return _0x361a58[_0xe1bb('0x88')](_0x446192,{'transaction':_0x4820fe});}})[_0xe1bb('0x29')](function(){_0x446192[_0xe1bb('0x72')](function(_0x345aeb){socket[_0xe1bb('0x73')](_0xe1bb('0x89'),{'UserId':_0x345aeb,'FaxQueueId':_0x361a58['id']});});});});});});})[_0xe1bb('0x29')](respondWithStatusCode(_0x21e1a0,null))[_0xe1bb('0x4e')](handleError(_0x21e1a0,null));};exports[_0xe1bb('0x8a')]=function(_0x44140b,_0x55aa38,_0x4c2306){return db[_0xe1bb('0x49')][_0xe1bb('0x52')]({'where':{'id':_0x44140b[_0xe1bb('0x50')]['id']}})[_0xe1bb('0x29')](handleEntityNotFound(_0x55aa38,null))[_0xe1bb('0x29')](function(_0x2d2bc7){if(_0x2d2bc7){return _0x2d2bc7['addAgents'](_0x44140b[_0xe1bb('0x59')]['ids'],_['omit'](_0x44140b[_0xe1bb('0x59')],[_0xe1bb('0x68'),'id'])||{})[_0xe1bb('0x8b')](function(_0x530d4b){for(var _0x57b52f=0x0;_0x57b52f<_0x44140b[_0xe1bb('0x59')][_0xe1bb('0x68')]['length'];_0x57b52f+=0x1){socket['emit'](_0xe1bb('0x74'),{'UserId':Number(_0x44140b['body']['ids'][_0x57b52f]),'FaxQueueId':Number(_0x44140b[_0xe1bb('0x50')]['id'])});}return _0x530d4b;});}})[_0xe1bb('0x29')](respondWithResult(_0x55aa38,null))[_0xe1bb('0x4e')](handleError(_0x55aa38,null));};exports[_0xe1bb('0x88')]=function(_0x5721e4,_0x4ec97c,_0x1a91b5){return db['FaxQueue']['find']({'where':{'id':_0x5721e4[_0xe1bb('0x50')]['id']}})[_0xe1bb('0x29')](handleEntityNotFound(_0x4ec97c,null))['then'](function(_0x3cf3c8){if(_0x3cf3c8){return _0x3cf3c8[_0xe1bb('0x88')](_0x5721e4[_0xe1bb('0x39')]['ids'])[_0xe1bb('0x29')](function(){if(_[_0xe1bb('0x8c')](_0x5721e4[_0xe1bb('0x39')][_0xe1bb('0x68')])){for(var _0x549f1b=0x0;_0x549f1b<_0x5721e4[_0xe1bb('0x39')][_0xe1bb('0x68')][_0xe1bb('0x3e')];_0x549f1b+=0x1){socket[_0xe1bb('0x73')](_0xe1bb('0x89'),{'UserId':Number(_0x5721e4[_0xe1bb('0x39')][_0xe1bb('0x68')][_0x549f1b]),'FaxQueueId':Number(_0x5721e4[_0xe1bb('0x50')]['id'])});}}else{socket[_0xe1bb('0x73')](_0xe1bb('0x89'),{'UserId':Number(_0x5721e4[_0xe1bb('0x39')][_0xe1bb('0x68')]),'FaxQueueId':Number(_0x5721e4[_0xe1bb('0x50')]['id'])});}});}})['then'](respondWithStatusCode(_0x4ec97c,null))['catch'](handleError(_0x4ec97c,null));};exports['getAgents']=function(_0x5ea3e7,_0x3579d5,_0x1d0505){var _0x5e85dd={};var _0x26585a={};var _0x232407;var _0x1f390c;return db[_0xe1bb('0x49')][_0xe1bb('0x5c')]({'where':{'id':_0x5ea3e7[_0xe1bb('0x50')]['id']}})[_0xe1bb('0x29')](handleEntityNotFound(_0x3579d5,null))[_0xe1bb('0x29')](function(_0x279a29){if(_0x279a29){_0x232407=_0x279a29;_0x26585a[_0xe1bb('0x38')]=_['keys'](db[_0xe1bb('0x76')][_0xe1bb('0x35')]);_0x26585a[_0xe1bb('0x39')]=_[_0xe1bb('0x51')](_0x5ea3e7[_0xe1bb('0x39')]);_0x26585a['filters']=_[_0xe1bb('0x3b')](_0x26585a['model'],_0x26585a[_0xe1bb('0x39')]);_0x5e85dd[_0xe1bb('0x3c')]=_[_0xe1bb('0x3b')](_0x26585a[_0xe1bb('0x38')],qs['fields'](_0x5ea3e7[_0xe1bb('0x39')][_0xe1bb('0x3d')]));_0x5e85dd['attributes']=_0x5e85dd[_0xe1bb('0x3c')][_0xe1bb('0x3e')]?_0x5e85dd[_0xe1bb('0x3c')]:_0x26585a[_0xe1bb('0x38')];_0x5e85dd[_0xe1bb('0x41')]=qs[_0xe1bb('0x42')](_0x5ea3e7[_0xe1bb('0x39')][_0xe1bb('0x42')]);_0x5e85dd['where']=qs[_0xe1bb('0x3a')](_[_0xe1bb('0x44')](_0x5ea3e7[_0xe1bb('0x39')],_0x26585a[_0xe1bb('0x3a')]));if(_0x5ea3e7['query'][_0xe1bb('0x45')]){_0x5e85dd[_0xe1bb('0x43')]=_[_0xe1bb('0x46')](_0x5e85dd['where'],{'$or':_[_0xe1bb('0x34')](_0x5e85dd[_0xe1bb('0x3c')],function(_0x19a377){var _0x1f19c6={};_0x1f19c6[_0x19a377]={'$like':'%'+_0x5ea3e7[_0xe1bb('0x39')][_0xe1bb('0x45')]+'%'};return _0x1f19c6;})});}_0x5e85dd=_['merge']({},_0x5e85dd,_0x5ea3e7[_0xe1bb('0x48')]);return _0x232407['getAgents'](_0x5e85dd);}})[_0xe1bb('0x29')](function(_0x4e645b){if(_0x4e645b){_0x1f390c=_0x4e645b['length'];if(!_0x5ea3e7[_0xe1bb('0x39')][_0xe1bb('0x3f')](_0xe1bb('0x40'))){_0x5e85dd[_0xe1bb('0x24')]=qs[_0xe1bb('0x24')](_0x5ea3e7[_0xe1bb('0x39')]['limit']);_0x5e85dd[_0xe1bb('0x22')]=qs['offset'](_0x5ea3e7[_0xe1bb('0x39')][_0xe1bb('0x22')]);}return _0x232407[_0xe1bb('0x8d')](_0x5e85dd);}})['then'](function(_0x568005){if(_0x568005){return _0x568005?{'count':_0x1f390c,'rows':_0x568005}:null;}})['then'](respondWithResult(_0x3579d5,null))[_0xe1bb('0x4e')](handleError(_0x3579d5,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 1c08f1a..8a1b039 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 _0x24f2=['events','../../mysqldb','FaxQueue','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x215fba,_0x1b6a2a){var _0x5e31f3=function(_0x2ca5c8){while(--_0x2ca5c8){_0x215fba['push'](_0x215fba['shift']());}};_0x5e31f3(++_0x1b6a2a);}(_0x24f2,0xd2));var _0x224f=function(_0x2053ea,_0x1ab2d4){_0x2053ea=_0x2053ea-0x0;var _0x2232c4=_0x24f2[_0x2053ea];return _0x2232c4;};'use strict';var EventEmitter=require(_0x224f('0x0'));var FaxQueue=require(_0x224f('0x1'))['db'][_0x224f('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x224f('0x3')](0x0);var events={'afterCreate':_0x224f('0x4'),'afterUpdate':'update','afterDestroy':_0x224f('0x5')};function emitEvent(_0x4f8d22){return function(_0x1a2711,_0x18df97,_0x2d6f06){FaxQueueEvents['emit'](_0x4f8d22+':'+_0x1a2711['id'],_0x1a2711);FaxQueueEvents[_0x224f('0x6')](_0x4f8d22,_0x1a2711);_0x2d6f06(null);};}for(var e in events){if(events[_0x224f('0x7')](e)){var event=events[e];FaxQueue[_0x224f('0x8')](e,emitEvent(event));}}module[_0x224f('0x9')]=FaxQueueEvents; \ No newline at end of file +var _0x609e=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x580647,_0x43d2c3){var _0x5f0792=function(_0x386cef){while(--_0x386cef){_0x580647['push'](_0x580647['shift']());}};_0x5f0792(++_0x43d2c3);}(_0x609e,0x1cb));var _0xe609=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0x609e[_0x47b58b];return _0x46bebe;};'use strict';var EventEmitter=require(_0xe609('0x0'));var FaxQueue=require(_0xe609('0x1'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xe609('0x2')](0x0);var events={'afterCreate':_0xe609('0x3'),'afterUpdate':_0xe609('0x4'),'afterDestroy':_0xe609('0x5')};function emitEvent(_0xf6f6ed){return function(_0x4aaab3,_0x56a8ab,_0xf58bb4){FaxQueueEvents[_0xe609('0x6')](_0xf6f6ed+':'+_0x4aaab3['id'],_0x4aaab3);FaxQueueEvents[_0xe609('0x6')](_0xf6f6ed,_0x4aaab3);_0xf58bb4(null);};}for(var e in events){if(events[_0xe609('0x7')](e)){var event=events[e];FaxQueue[_0xe609('0x8')](e,emitEvent(event));}}module[_0xe609('0x9')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index a2046df..704dd67 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 _0xd9f6=['../../config/environment','exports','fax_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3e0e13,_0x2aebb3){var _0x3626eb=function(_0x290d46){while(--_0x290d46){_0x3e0e13['push'](_0x3e0e13['shift']());}};_0x3626eb(++_0x2aebb3);}(_0xd9f6,0xff));var _0x6d9f=function(_0x3c0fb0,_0x30329f){_0x3c0fb0=_0x3c0fb0-0x0;var _0x726751=_0xd9f6[_0x3c0fb0];return _0x726751;};'use strict';var _=require(_0x6d9f('0x0'));var util=require(_0x6d9f('0x1'));var logger=require(_0x6d9f('0x2'))(_0x6d9f('0x3'));var moment=require(_0x6d9f('0x4'));var BPromise=require(_0x6d9f('0x5'));var rp=require(_0x6d9f('0x6'));var fs=require('fs');var path=require(_0x6d9f('0x7'));var rimraf=require(_0x6d9f('0x8'));var config=require(_0x6d9f('0x9'));var attributes=require('./faxQueue.attributes');module[_0x6d9f('0xa')]=function(_0x485c5f,_0x33e537){return _0x485c5f['define']('FaxQueue',attributes,{'tableName':_0x6d9f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe935=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueue.attributes','exports','define','FaxQueue','fax_queues','lodash','util','../../config/logger','api'];(function(_0x1ac90e,_0x3a47d4){var _0x225a59=function(_0x20a402){while(--_0x20a402){_0x1ac90e['push'](_0x1ac90e['shift']());}};_0x225a59(++_0x3a47d4);}(_0xe935,0x137));var _0x5e93=function(_0x4f9cf3,_0x1cef2c){_0x4f9cf3=_0x4f9cf3-0x0;var _0x239998=_0xe935[_0x4f9cf3];return _0x239998;};'use strict';var _=require(_0x5e93('0x0'));var util=require(_0x5e93('0x1'));var logger=require(_0x5e93('0x2'))(_0x5e93('0x3'));var moment=require(_0x5e93('0x4'));var BPromise=require(_0x5e93('0x5'));var rp=require(_0x5e93('0x6'));var fs=require('fs');var path=require(_0x5e93('0x7'));var rimraf=require(_0x5e93('0x8'));var config=require(_0x5e93('0x9'));var attributes=require(_0x5e93('0xa'));module[_0x5e93('0xb')]=function(_0xa694f6,_0x2e3bec){return _0xa694f6[_0x5e93('0xc')](_0x5e93('0xd'),attributes,{'tableName':_0x5e93('0xe'),'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 bd61408..039f31e 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 _0xbe59=['defaults','redis','socket.io-emitter','./faxQueue.socket','request','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFaxQueue','options','where','limit','include','model','attributes','map','then','ShowFaxQueue','FaxQueue','find','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x5a3b7c,_0x2443aa){var _0xb5c229=function(_0x55cfee){while(--_0x55cfee){_0x5a3b7c['push'](_0x5a3b7c['shift']());}};_0xb5c229(++_0x2443aa);}(_0xbe59,0x13c));var _0x9be5=function(_0x36fb06,_0x110b93){_0x36fb06=_0x36fb06-0x0;var _0x4dcb9d=_0xbe59[_0x36fb06];return _0x4dcb9d;};'use strict';var _=require(_0x9be5('0x0'));var util=require(_0x9be5('0x1'));var moment=require(_0x9be5('0x2'));var BPromise=require(_0x9be5('0x3'));var rs=require(_0x9be5('0x4'));var fs=require('fs');var Redis=require(_0x9be5('0x5'));var db=require(_0x9be5('0x6'))['db'];var utils=require(_0x9be5('0x7'));var logger=require(_0x9be5('0x8'))('rpc');var config=require(_0x9be5('0x9'));var jayson=require(_0x9be5('0xa'));var client=jayson[_0x9be5('0xb')]['http']({'port':0x232a});config['redis']=_[_0x9be5('0xc')](config[_0x9be5('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x9be5('0xe'))(new Redis(config[_0x9be5('0xd')]));require(_0x9be5('0xf'))['register'](socket);function respondWithRpcPromise(_0x238657,_0x1c161b,_0x24171c){return new BPromise(function(_0x161b97,_0x2ec465){return client[_0x9be5('0x10')](_0x238657,_0x24171c)['then'](function(_0x3eeb6d){logger[_0x9be5('0x11')](_0x9be5('0x12'),_0x1c161b,_0x9be5('0x13'));logger[_0x9be5('0x14')](_0x9be5('0x15'),_0x1c161b,_0x9be5('0x13'),JSON[_0x9be5('0x16')](_0x3eeb6d));if(_0x3eeb6d[_0x9be5('0x17')]){if(_0x3eeb6d['error'][_0x9be5('0x18')]===0x1f4){logger[_0x9be5('0x17')]('FaxQueue,\x20%s,\x20%s',_0x1c161b,_0x3eeb6d['error'][_0x9be5('0x19')]);return _0x2ec465(_0x3eeb6d[_0x9be5('0x17')]['message']);}logger[_0x9be5('0x17')](_0x9be5('0x12'),_0x1c161b,_0x3eeb6d[_0x9be5('0x17')][_0x9be5('0x19')]);return _0x161b97(_0x3eeb6d['error'][_0x9be5('0x19')]);}else{logger[_0x9be5('0x11')](_0x9be5('0x12'),_0x1c161b,_0x9be5('0x13'));_0x161b97(_0x3eeb6d[_0x9be5('0x1a')][_0x9be5('0x19')]);}})[_0x9be5('0x1b')](function(_0x4f2d92){logger['error'](_0x9be5('0x12'),_0x1c161b,_0x4f2d92);_0x2ec465(_0x4f2d92);});});}exports[_0x9be5('0x1c')]=function(_0x3870c3){var _0xec0125=this;return new Promise(function(_0x4bc446,_0x49c52d){return db['FaxQueue']['findAll']({'raw':_0x3870c3[_0x9be5('0x1d')]?_0x3870c3[_0x9be5('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x3870c3[_0x9be5('0x1d')]?_0x3870c3['options'][_0x9be5('0x1e')]||null:null,'attributes':_0x3870c3[_0x9be5('0x1d')]?_0x3870c3[_0x9be5('0x1d')]['attributes']||null:null,'limit':_0x3870c3['options']?_0x3870c3[_0x9be5('0x1d')][_0x9be5('0x1f')]||null:null,'include':_0x3870c3[_0x9be5('0x1d')]?_0x3870c3['options'][_0x9be5('0x20')]?_['map'](_0x3870c3[_0x9be5('0x1d')][_0x9be5('0x20')],function(_0x5b065c){return{'model':db[_0x5b065c[_0x9be5('0x21')]],'as':_0x5b065c['as'],'attributes':_0x5b065c[_0x9be5('0x22')],'include':_0x5b065c[_0x9be5('0x20')]?_[_0x9be5('0x23')](_0x5b065c[_0x9be5('0x20')],function(_0x556f62){return{'model':db[_0x556f62[_0x9be5('0x21')]],'as':_0x556f62['as'],'attributes':_0x556f62[_0x9be5('0x22')],'include':_0x556f62[_0x9be5('0x20')]?_[_0x9be5('0x23')](_0x556f62['include'],function(_0x3e88e0){return{'model':db[_0x3e88e0[_0x9be5('0x21')]],'as':_0x3e88e0['as'],'attributes':_0x3e88e0[_0x9be5('0x22')]};}):[]};}):[]};}):[]:[]})[_0x9be5('0x24')](function(_0x381883){logger[_0x9be5('0x11')](_0x9be5('0x1c'),_0x3870c3);logger['debug'](_0x9be5('0x1c'),_0x3870c3,JSON['stringify'](_0x381883));_0x4bc446(_0x381883);})[_0x9be5('0x1b')](function(_0x95dd86){logger['error'](_0x9be5('0x1c'),_0x95dd86[_0x9be5('0x19')],_0x3870c3);_0x49c52d(_0xec0125[_0x9be5('0x17')](0x1f4,_0x95dd86[_0x9be5('0x19')]));});});};exports[_0x9be5('0x25')]=function(_0x2dcad4){var _0x307dd9=this;return new Promise(function(_0x1a8955,_0x1bf9eb){return db[_0x9be5('0x26')][_0x9be5('0x27')]({'raw':_0x2dcad4[_0x9be5('0x1d')]?_0x2dcad4['options'][_0x9be5('0x28')]===undefined?!![]:![]:!![],'where':_0x2dcad4[_0x9be5('0x1d')]?_0x2dcad4[_0x9be5('0x1d')][_0x9be5('0x1e')]||null:null,'attributes':_0x2dcad4[_0x9be5('0x1d')]?_0x2dcad4[_0x9be5('0x1d')][_0x9be5('0x22')]||null:null,'include':_0x2dcad4[_0x9be5('0x1d')]?_0x2dcad4[_0x9be5('0x1d')][_0x9be5('0x20')]?_[_0x9be5('0x23')](_0x2dcad4[_0x9be5('0x1d')]['include'],function(_0x1f5641){return{'model':db[_0x1f5641[_0x9be5('0x21')]],'as':_0x1f5641['as'],'attributes':_0x1f5641[_0x9be5('0x22')],'include':_0x1f5641[_0x9be5('0x20')]?_['map'](_0x1f5641[_0x9be5('0x20')],function(_0x54b959){return{'model':db[_0x54b959[_0x9be5('0x21')]],'as':_0x54b959['as'],'attributes':_0x54b959[_0x9be5('0x22')],'include':_0x54b959[_0x9be5('0x20')]?_[_0x9be5('0x23')](_0x54b959['include'],function(_0x5a2c18){return{'model':db[_0x5a2c18[_0x9be5('0x21')]],'as':_0x5a2c18['as'],'attributes':_0x5a2c18[_0x9be5('0x22')]};}):[]};}):[]};}):[]:[]})[_0x9be5('0x24')](function(_0x25ad9f){logger[_0x9be5('0x11')](_0x9be5('0x25'),_0x2dcad4);logger[_0x9be5('0x14')](_0x9be5('0x25'),_0x2dcad4,JSON[_0x9be5('0x16')](_0x25ad9f));_0x1a8955(_0x25ad9f);})[_0x9be5('0x1b')](function(_0x5ae739){logger[_0x9be5('0x17')](_0x9be5('0x25'),_0x5ae739['message'],_0x2dcad4);_0x1bf9eb(_0x307dd9[_0x9be5('0x17')](0x1f4,_0x5ae739[_0x9be5('0x19')]));});});}; \ No newline at end of file +var _0x38e3=['http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','GetFaxQueue','options','where','limit','map','include','model','attributes','debug','catch','FaxQueue','ShowFaxQueue','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x38e3,0x87));var _0x338e=function(_0x1ec06d,_0xe71dfb){_0x1ec06d=_0x1ec06d-0x0;var _0x2a434f=_0x38e3[_0x1ec06d];return _0x2a434f;};'use strict';var _=require('lodash');var util=require(_0x338e('0x0'));var moment=require(_0x338e('0x1'));var BPromise=require(_0x338e('0x2'));var rs=require(_0x338e('0x3'));var fs=require('fs');var Redis=require(_0x338e('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x338e('0x5'))(_0x338e('0x6'));var config=require(_0x338e('0x7'));var jayson=require(_0x338e('0x8'));var client=jayson['client'][_0x338e('0x9')]({'port':0x232a});config[_0x338e('0xa')]=_[_0x338e('0xb')](config[_0x338e('0xa')],{'host':_0x338e('0xc'),'port':0x18eb});var socket=require(_0x338e('0xd'))(new Redis(config['redis']));require('./faxQueue.socket')[_0x338e('0xe')](socket);function respondWithRpcPromise(_0x256c80,_0x5ad97c,_0x31c268){return new BPromise(function(_0xf5a78b,_0x60d443){return client[_0x338e('0xf')](_0x256c80,_0x31c268)[_0x338e('0x10')](function(_0xc44585){logger[_0x338e('0x11')](_0x338e('0x12'),_0x5ad97c,_0x338e('0x13'));logger['debug']('FaxQueue,\x20%s,\x20%s,\x20%s',_0x5ad97c,_0x338e('0x13'),JSON[_0x338e('0x14')](_0xc44585));if(_0xc44585[_0x338e('0x15')]){if(_0xc44585[_0x338e('0x15')][_0x338e('0x16')]===0x1f4){logger[_0x338e('0x15')](_0x338e('0x12'),_0x5ad97c,_0xc44585[_0x338e('0x15')][_0x338e('0x17')]);return _0x60d443(_0xc44585['error'][_0x338e('0x17')]);}logger[_0x338e('0x15')](_0x338e('0x12'),_0x5ad97c,_0xc44585[_0x338e('0x15')][_0x338e('0x17')]);return _0xf5a78b(_0xc44585['error'][_0x338e('0x17')]);}else{logger[_0x338e('0x11')](_0x338e('0x12'),_0x5ad97c,_0x338e('0x13'));_0xf5a78b(_0xc44585['result'][_0x338e('0x17')]);}})['catch'](function(_0x462e67){logger[_0x338e('0x15')](_0x338e('0x12'),_0x5ad97c,_0x462e67);_0x60d443(_0x462e67);});});}exports[_0x338e('0x18')]=function(_0x24e6ba){var _0x30bc67=this;return new Promise(function(_0x3fe32e,_0x419377){return db['FaxQueue']['findAll']({'raw':_0x24e6ba[_0x338e('0x19')]?_0x24e6ba[_0x338e('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x24e6ba[_0x338e('0x19')]?_0x24e6ba['options'][_0x338e('0x1a')]||null:null,'attributes':_0x24e6ba[_0x338e('0x19')]?_0x24e6ba['options']['attributes']||null:null,'limit':_0x24e6ba[_0x338e('0x19')]?_0x24e6ba[_0x338e('0x19')][_0x338e('0x1b')]||null:null,'include':_0x24e6ba['options']?_0x24e6ba['options']['include']?_[_0x338e('0x1c')](_0x24e6ba[_0x338e('0x19')][_0x338e('0x1d')],function(_0x25928f){return{'model':db[_0x25928f[_0x338e('0x1e')]],'as':_0x25928f['as'],'attributes':_0x25928f[_0x338e('0x1f')],'include':_0x25928f['include']?_[_0x338e('0x1c')](_0x25928f[_0x338e('0x1d')],function(_0x3a5454){return{'model':db[_0x3a5454['model']],'as':_0x3a5454['as'],'attributes':_0x3a5454['attributes'],'include':_0x3a5454[_0x338e('0x1d')]?_[_0x338e('0x1c')](_0x3a5454[_0x338e('0x1d')],function(_0x29959c){return{'model':db[_0x29959c[_0x338e('0x1e')]],'as':_0x29959c['as'],'attributes':_0x29959c[_0x338e('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x338e('0x10')](function(_0x440e93){logger['info']('GetFaxQueue',_0x24e6ba);logger[_0x338e('0x20')]('GetFaxQueue',_0x24e6ba,JSON[_0x338e('0x14')](_0x440e93));_0x3fe32e(_0x440e93);})[_0x338e('0x21')](function(_0x11b289){logger[_0x338e('0x15')](_0x338e('0x18'),_0x11b289['message'],_0x24e6ba);_0x419377(_0x30bc67[_0x338e('0x15')](0x1f4,_0x11b289[_0x338e('0x17')]));});});};exports['ShowFaxQueue']=function(_0x56cdc2){var _0x465b6c=this;return new Promise(function(_0x53a79e,_0x3e06c8){return db[_0x338e('0x22')]['find']({'raw':_0x56cdc2['options']?_0x56cdc2[_0x338e('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x56cdc2[_0x338e('0x19')]?_0x56cdc2[_0x338e('0x19')][_0x338e('0x1a')]||null:null,'attributes':_0x56cdc2['options']?_0x56cdc2[_0x338e('0x19')][_0x338e('0x1f')]||null:null,'include':_0x56cdc2[_0x338e('0x19')]?_0x56cdc2[_0x338e('0x19')]['include']?_[_0x338e('0x1c')](_0x56cdc2[_0x338e('0x19')][_0x338e('0x1d')],function(_0x51de10){return{'model':db[_0x51de10['model']],'as':_0x51de10['as'],'attributes':_0x51de10[_0x338e('0x1f')],'include':_0x51de10['include']?_[_0x338e('0x1c')](_0x51de10[_0x338e('0x1d')],function(_0x5a6441){return{'model':db[_0x5a6441[_0x338e('0x1e')]],'as':_0x5a6441['as'],'attributes':_0x5a6441['attributes'],'include':_0x5a6441[_0x338e('0x1d')]?_[_0x338e('0x1c')](_0x5a6441[_0x338e('0x1d')],function(_0x638f90){return{'model':db[_0x638f90[_0x338e('0x1e')]],'as':_0x638f90['as'],'attributes':_0x638f90[_0x338e('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x338e('0x10')](function(_0x33c5b5){logger[_0x338e('0x11')](_0x338e('0x23'),_0x56cdc2);logger[_0x338e('0x20')]('ShowFaxQueue',_0x56cdc2,JSON['stringify'](_0x33c5b5));_0x53a79e(_0x33c5b5);})[_0x338e('0x21')](function(_0xdba998){logger[_0x338e('0x15')](_0x338e('0x23'),_0xdba998[_0x338e('0x17')],_0x56cdc2);_0x3e06c8(_0x465b6c['error'](0x1f4,_0xdba998[_0x338e('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 84774fe..fffd909 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 _0x0b06=['save','remove','update','removeListener','register','length','faxQueue:','./faxQueue.events'];(function(_0x57844c,_0x3bcae3){var _0x31f44c=function(_0x3c4625){while(--_0x3c4625){_0x57844c['push'](_0x57844c['shift']());}};_0x31f44c(++_0x3bcae3);}(_0x0b06,0x11f));var _0x60b0=function(_0x441a4d,_0x2e4b44){_0x441a4d=_0x441a4d-0x0;var _0x4f810c=_0x0b06[_0x441a4d];return _0x4f810c;};'use strict';var FaxQueueEvents=require(_0x60b0('0x0'));var events=[_0x60b0('0x1'),_0x60b0('0x2'),_0x60b0('0x3')];function createListener(_0x226099,_0x5db1e6){return function(_0x1fc6e7){_0x5db1e6['emit'](_0x226099,_0x1fc6e7);};}function removeListener(_0x2edc42,_0x15f198){return function(){FaxQueueEvents[_0x60b0('0x4')](_0x2edc42,_0x15f198);};}exports[_0x60b0('0x5')]=function(_0xd7ef6e){for(var _0xd73191=0x0,_0x24b05c=events[_0x60b0('0x6')];_0xd73191<_0x24b05c;_0xd73191++){var _0xcbd3e6=events[_0xd73191];var _0x5b8b45=createListener(_0x60b0('0x7')+_0xcbd3e6,_0xd7ef6e);FaxQueueEvents['on'](_0xcbd3e6,_0x5b8b45);}}; \ No newline at end of file +var _0x1f44=['./faxQueue.events','remove','length'];(function(_0x2c9a36,_0x1b1fb8){var _0x556a9e=function(_0x2cc111){while(--_0x2cc111){_0x2c9a36['push'](_0x2c9a36['shift']());}};_0x556a9e(++_0x1b1fb8);}(_0x1f44,0x14a));var _0x41f4=function(_0x34f2e4,_0x8d721b){_0x34f2e4=_0x34f2e4-0x0;var _0x5b839b=_0x1f44[_0x34f2e4];return _0x5b839b;};'use strict';var FaxQueueEvents=require(_0x41f4('0x0'));var events=['save',_0x41f4('0x1'),'update'];function createListener(_0x3e47af,_0x4c89b1){return function(_0x50238e){_0x4c89b1['emit'](_0x3e47af,_0x50238e);};}function removeListener(_0x3b3a38,_0x328a2e){return function(){FaxQueueEvents['removeListener'](_0x3b3a38,_0x328a2e);};}exports['register']=function(_0x59d18d){for(var _0x3801c0=0x0,_0x5e5c50=events[_0x41f4('0x2')];_0x3801c0<_0x5e5c50;_0x3801c0++){var _0x2c9a7a=events[_0x3801c0];var _0x1adf63=createListener('faxQueue:'+_0x2c9a7a,_0x59d18d);FaxQueueEvents['on'](_0x2c9a7a,_0x1adf63);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 66b9571..2de82bc 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 _0x2da6=['connect-timeout','express','Router','fs-extra','../../components/auth/service','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','put','/:id','update','delete','removeTeams','removeAgents','multer','util','path'];(function(_0x1cf22b,_0x323f8c){var _0x10cf48=function(_0x3bf324){while(--_0x3bf324){_0x1cf22b['push'](_0x1cf22b['shift']());}};_0x10cf48(++_0x323f8c);}(_0x2da6,0x1dd));var _0x62da=function(_0x1fda72,_0x5cd5cd){_0x1fda72=_0x1fda72-0x0;var _0x148213=_0x2da6[_0x1fda72];return _0x148213;};'use strict';var multer=require(_0x62da('0x0'));var util=require(_0x62da('0x1'));var path=require(_0x62da('0x2'));var timeout=require(_0x62da('0x3'));var express=require(_0x62da('0x4'));var router=express[_0x62da('0x5')]();var fs_extra=require(_0x62da('0x6'));var auth=require(_0x62da('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x62da('0x8'));router[_0x62da('0x9')]('/',auth[_0x62da('0xa')](),controller[_0x62da('0xb')]);router[_0x62da('0x9')](_0x62da('0xc'),auth[_0x62da('0xa')](),controller[_0x62da('0xd')]);router[_0x62da('0x9')]('/:id',auth[_0x62da('0xa')](),controller[_0x62da('0xe')]);router[_0x62da('0x9')](_0x62da('0xf'),auth['isAuthenticated'](),controller[_0x62da('0x10')]);router[_0x62da('0x9')](_0x62da('0x11'),auth[_0x62da('0xa')](),controller[_0x62da('0x12')]);router['get'](_0x62da('0x13'),auth[_0x62da('0xa')](),controller[_0x62da('0x14')]);router[_0x62da('0x15')]('/',auth[_0x62da('0xa')](),controller['create']);router['post'](_0x62da('0x11'),auth[_0x62da('0xa')](),controller[_0x62da('0x16')]);router[_0x62da('0x15')](_0x62da('0x13'),auth[_0x62da('0xa')](),controller[_0x62da('0x17')]);router[_0x62da('0x18')](_0x62da('0x19'),auth[_0x62da('0xa')](),controller[_0x62da('0x1a')]);router[_0x62da('0x1b')](_0x62da('0x19'),auth[_0x62da('0xa')](),controller['destroy']);router['delete'](_0x62da('0x11'),auth['isAuthenticated'](),controller[_0x62da('0x1c')]);router[_0x62da('0x1b')](_0x62da('0x13'),auth['isAuthenticated'](),controller[_0x62da('0x1d')]);module['exports']=router; \ No newline at end of file +var _0x1115=['addAgents','put','/:id','destroy','delete','removeAgents','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe','get','show','getTeams','/:id/users','getAgents','post','create','/:id/teams','addTeams'];(function(_0x5a7521,_0x2d1d5e){var _0x3d6e6a=function(_0x1ea2b8){while(--_0x1ea2b8){_0x5a7521['push'](_0x5a7521['shift']());}};_0x3d6e6a(++_0x2d1d5e);}(_0x1115,0x1b6));var _0x5111=function(_0x1c75de,_0x1b228b){_0x1c75de=_0x1c75de-0x0;var _0x2cdc56=_0x1115[_0x1c75de];return _0x2cdc56;};'use strict';var multer=require('multer');var util=require(_0x5111('0x0'));var path=require(_0x5111('0x1'));var timeout=require(_0x5111('0x2'));var express=require(_0x5111('0x3'));var router=express[_0x5111('0x4')]();var fs_extra=require(_0x5111('0x5'));var auth=require(_0x5111('0x6'));var interaction=require(_0x5111('0x7'));var config=require(_0x5111('0x8'));var controller=require('./faxQueue.controller');router['get']('/',auth[_0x5111('0x9')](),controller[_0x5111('0xa')]);router['get'](_0x5111('0xb'),auth[_0x5111('0x9')](),controller['describe']);router[_0x5111('0xc')]('/:id',auth[_0x5111('0x9')](),controller[_0x5111('0xd')]);router['get']('/:id/members',auth[_0x5111('0x9')](),controller['getMembers']);router[_0x5111('0xc')]('/:id/teams',auth[_0x5111('0x9')](),controller[_0x5111('0xe')]);router[_0x5111('0xc')](_0x5111('0xf'),auth[_0x5111('0x9')](),controller[_0x5111('0x10')]);router[_0x5111('0x11')]('/',auth[_0x5111('0x9')](),controller[_0x5111('0x12')]);router[_0x5111('0x11')](_0x5111('0x13'),auth[_0x5111('0x9')](),controller[_0x5111('0x14')]);router[_0x5111('0x11')](_0x5111('0xf'),auth[_0x5111('0x9')](),controller[_0x5111('0x15')]);router[_0x5111('0x16')]('/:id',auth[_0x5111('0x9')](),controller['update']);router['delete'](_0x5111('0x17'),auth[_0x5111('0x9')](),controller[_0x5111('0x18')]);router['delete'](_0x5111('0x13'),auth[_0x5111('0x9')](),controller['removeTeams']);router[_0x5111('0x19')](_0x5111('0xf'),auth[_0x5111('0x9')](),controller[_0x5111('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 296d9c0..f626b33 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 _0x61c7=['STRING','DATE','exports'];(function(_0x3fbb37,_0x3a872c){var _0x32878e=function(_0x1d5266){while(--_0x1d5266){_0x3fbb37['push'](_0x3fbb37['shift']());}};_0x32878e(++_0x3a872c);}(_0x61c7,0x176));var _0x761c=function(_0x1fb023,_0xcb018f){_0x1fb023=_0x1fb023-0x0;var _0x36ba1c=_0x61c7[_0x1fb023];return _0x36ba1c;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x761c('0x0')]={'uniqueid':{'type':Sequelize[_0x761c('0x1')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x761c('0x2')]},'leaveAt':{'type':Sequelize[_0x761c('0x2')]},'acceptAt':{'type':Sequelize[_0x761c('0x2')]},'exitAt':{'type':Sequelize[_0x761c('0x2')]},'reason':{'type':Sequelize[_0x761c('0x1')]}}; \ No newline at end of file +var _0x35f5=['moment','exports','STRING','DATE'];(function(_0x567751,_0x4287c3){var _0x21a84c=function(_0x2471d4){while(--_0x2471d4){_0x567751['push'](_0x567751['shift']());}};_0x21a84c(++_0x4287c3);}(_0x35f5,0x100));var _0x535f=function(_0x46c1d5,_0x5ca335){_0x46c1d5=_0x46c1d5-0x0;var _0x40fe7b=_0x35f5[_0x46c1d5];return _0x40fe7b;};'use strict';var moment=require(_0x535f('0x0'));var Sequelize=require('sequelize');module[_0x535f('0x1')]={'uniqueid':{'type':Sequelize[_0x535f('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x535f('0x2')]},'joinAt':{'type':Sequelize[_0x535f('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x535f('0x2')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index f7de20e..04a4526 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 _0x652b=['rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','filter','merge','where','VIRTUAL','options','includeAll','include','FaxQueueReport','findAll','show','params','catch','create','body','update','find','destroy','describe','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','ejs','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','Content-Range','apply','then','end','sendStatus','stack','name','send','index','map'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x652b,0x68));var _0xb652=function(_0x2932cf,_0x362fd9){_0x2932cf=_0x2932cf-0x0;var _0x1711dd=_0x652b[_0x2932cf];return _0x1711dd;};'use strict';var emlformat=require(_0xb652('0x0'));var rimraf=require(_0xb652('0x1'));var zipdir=require(_0xb652('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb652('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb652('0x4'));var util=require(_0xb652('0x5'));var path=require(_0xb652('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb652('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb652('0x8'));var crypto=require('crypto');var jsforce=require(_0xb652('0x9'));var deskjs=require(_0xb652('0xa'));var toCsv=require(_0xb652('0xb'));var querystring=require(_0xb652('0xc'));var Papa=require(_0xb652('0xd'));var Redis=require(_0xb652('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xb652('0xf'));var hardwareService=require(_0xb652('0x10'));var logger=require(_0xb652('0x11'))(_0xb652('0x12'));var utils=require('../../config/utils');var config=require(_0xb652('0x13'));var licenseUtil=require(_0xb652('0x14'));var db=require(_0xb652('0x15'))['db'];function respondWithStatusCode(_0x54c2e2,_0x1c182c){_0x1c182c=_0x1c182c||0xcc;return function(_0x813e0c){if(_0x813e0c){return _0x54c2e2['sendStatus'](_0x1c182c);}return _0x54c2e2['status'](_0x1c182c)['end']();};}function respondWithResult(_0x4921a0,_0x21ce7f){_0x21ce7f=_0x21ce7f||0xc8;return function(_0x4dda37){if(_0x4dda37){return _0x4921a0[_0xb652('0x16')](_0x21ce7f)[_0xb652('0x17')](_0x4dda37);}};}function respondWithFilteredResult(_0x16fbac,_0x50889e){return function(_0x1d6f1c){if(_0x1d6f1c){var _0x3621a4=typeof _0x50889e[_0xb652('0x18')]===_0xb652('0x19')&&typeof _0x50889e['limit']===_0xb652('0x19');var _0x289911=_0x1d6f1c[_0xb652('0x1a')];var _0x3bf3b0=_0x3621a4?0x0:_0x50889e['offset'];var _0x94d0b3=_0x3621a4?_0x1d6f1c['count']:_0x50889e[_0xb652('0x18')]+_0x50889e[_0xb652('0x1b')];var _0x22288e;if(_0x94d0b3>=_0x289911){_0x94d0b3=_0x289911;_0x22288e=0xc8;}else{_0x22288e=0xce;}_0x16fbac[_0xb652('0x16')](_0x22288e);return _0x16fbac['set'](_0xb652('0x1c'),_0x3bf3b0+'-'+_0x94d0b3+'/'+_0x289911)[_0xb652('0x17')](_0x1d6f1c);}return null;};}function patchUpdates(_0x3fc43e){return function(_0x169f41){try{jsonpatch[_0xb652('0x1d')](_0x169f41,_0x3fc43e,!![]);}catch(_0x3fb365){return BPromise['reject'](_0x3fb365);}return _0x169f41['save']();};}function saveUpdates(_0x71465c,_0x39a4e3){return function(_0x49a2b2){if(_0x49a2b2){return _0x49a2b2['update'](_0x71465c)[_0xb652('0x1e')](function(_0x48ae93){return _0x48ae93;});}return null;};}function removeEntity(_0x1884a0,_0x3756fb){return function(_0x52d51f){if(_0x52d51f){return _0x52d51f['destroy']()[_0xb652('0x1e')](function(){_0x1884a0[_0xb652('0x16')](0xcc)[_0xb652('0x1f')]();});}};}function handleEntityNotFound(_0x432a86,_0x15ea86){return function(_0x2f7186){if(!_0x2f7186){_0x432a86[_0xb652('0x20')](0x194);}return _0x2f7186;};}function handleError(_0x44ccf3,_0x56eade){_0x56eade=_0x56eade||0x1f4;return function(_0x4dcc1b){logger['error'](_0x4dcc1b[_0xb652('0x21')]);if(_0x4dcc1b['name']){delete _0x4dcc1b[_0xb652('0x22')];}_0x44ccf3['status'](_0x56eade)[_0xb652('0x23')](_0x4dcc1b);};}exports[_0xb652('0x24')]=function(_0x3b74eb,_0x2b91ff){var _0x147b8d={},_0x5f39cb={},_0x459c03={'count':0x0,'rows':[]};var _0x52d918=_[_0xb652('0x25')](db['FaxQueueReport'][_0xb652('0x26')],function(_0x23e529){return{'name':_0x23e529[_0xb652('0x27')],'type':_0x23e529[_0xb652('0x28')][_0xb652('0x29')]};});_0x5f39cb[_0xb652('0x2a')]=_[_0xb652('0x25')](_0x52d918,_0xb652('0x22'));_0x5f39cb[_0xb652('0x2b')]=_[_0xb652('0x2c')](_0x3b74eb[_0xb652('0x2b')]);_0x5f39cb['filters']=_[_0xb652('0x2d')](_0x5f39cb[_0xb652('0x2a')],_0x5f39cb[_0xb652('0x2b')]);_0x147b8d[_0xb652('0x2e')]=_[_0xb652('0x2d')](_0x5f39cb[_0xb652('0x2a')],qs['fields'](_0x3b74eb[_0xb652('0x2b')][_0xb652('0x2f')]));_0x147b8d[_0xb652('0x2e')]=_0x147b8d[_0xb652('0x2e')][_0xb652('0x30')]?_0x147b8d[_0xb652('0x2e')]:_0x5f39cb[_0xb652('0x2a')];if(!_0x3b74eb[_0xb652('0x2b')][_0xb652('0x31')](_0xb652('0x32'))){_0x147b8d['limit']=qs[_0xb652('0x1b')](_0x3b74eb['query']['limit']);_0x147b8d['offset']=qs[_0xb652('0x18')](_0x3b74eb[_0xb652('0x2b')][_0xb652('0x18')]);}_0x147b8d['order']=qs[_0xb652('0x33')](_0x3b74eb['query'][_0xb652('0x33')]);_0x147b8d['where']=qs[_0xb652('0x34')](_['pick'](_0x3b74eb[_0xb652('0x2b')],_0x5f39cb[_0xb652('0x34')]),_0x52d918);if(_0x3b74eb[_0xb652('0x2b')][_0xb652('0x35')]){_0x147b8d['where']=_[_0xb652('0x36')](_0x147b8d[_0xb652('0x37')],{'$or':_[_0xb652('0x25')](_0x52d918,function(_0xd20e40){if(_0xd20e40['type']!==_0xb652('0x38')){var _0x6deca9={};_0x6deca9[_0xd20e40['name']]={'$like':'%'+_0x3b74eb[_0xb652('0x2b')]['filter']+'%'};return _0x6deca9;}})});}_0x147b8d=_['merge']({},_0x147b8d,_0x3b74eb[_0xb652('0x39')]);var _0xb8f377={'where':_0x147b8d[_0xb652('0x37')]};return db['FaxQueueReport'][_0xb652('0x1a')](_0xb8f377)[_0xb652('0x1e')](function(_0x22edb1){_0x459c03[_0xb652('0x1a')]=_0x22edb1;if(_0x3b74eb[_0xb652('0x2b')][_0xb652('0x3a')]){_0x147b8d[_0xb652('0x3b')]=[{'all':!![]}];}return db[_0xb652('0x3c')][_0xb652('0x3d')](_0x147b8d);})[_0xb652('0x1e')](function(_0x501cb7){_0x459c03['rows']=_0x501cb7;return _0x459c03;})[_0xb652('0x1e')](respondWithFilteredResult(_0x2b91ff,_0x147b8d))['catch'](handleError(_0x2b91ff,null));};exports[_0xb652('0x3e')]=function(_0x20e887,_0x6499a7){var _0x3b6c98={'raw':!![],'where':{'id':_0x20e887[_0xb652('0x3f')]['id']}},_0x190c7={};_0x190c7['model']=_['keys'](db[_0xb652('0x3c')][_0xb652('0x26')]);_0x190c7[_0xb652('0x2b')]=_[_0xb652('0x2c')](_0x20e887['query']);_0x190c7[_0xb652('0x34')]=_[_0xb652('0x2d')](_0x190c7[_0xb652('0x2a')],_0x190c7[_0xb652('0x2b')]);_0x3b6c98[_0xb652('0x2e')]=_[_0xb652('0x2d')](_0x190c7[_0xb652('0x2a')],qs[_0xb652('0x2f')](_0x20e887[_0xb652('0x2b')][_0xb652('0x2f')]));_0x3b6c98[_0xb652('0x2e')]=_0x3b6c98[_0xb652('0x2e')][_0xb652('0x30')]?_0x3b6c98[_0xb652('0x2e')]:_0x190c7['model'];if(_0x20e887['query'][_0xb652('0x3a')]){_0x3b6c98[_0xb652('0x3b')]=[{'all':!![]}];}_0x3b6c98=_[_0xb652('0x36')]({},_0x3b6c98,_0x20e887['options']);return db[_0xb652('0x3c')]['find'](_0x3b6c98)[_0xb652('0x1e')](handleEntityNotFound(_0x6499a7,null))[_0xb652('0x1e')](respondWithResult(_0x6499a7,null))[_0xb652('0x40')](handleError(_0x6499a7,null));};exports[_0xb652('0x41')]=function(_0x3739b3,_0xdbe9a2){return db[_0xb652('0x3c')][_0xb652('0x41')](_0x3739b3[_0xb652('0x42')],{})['then'](respondWithResult(_0xdbe9a2,0xc9))[_0xb652('0x40')](handleError(_0xdbe9a2,null));};exports[_0xb652('0x43')]=function(_0x5a4d6c,_0x33eb79){if(_0x5a4d6c['body']['id']){delete _0x5a4d6c[_0xb652('0x42')]['id'];}return db[_0xb652('0x3c')][_0xb652('0x44')]({'where':{'id':_0x5a4d6c['params']['id']}})[_0xb652('0x1e')](handleEntityNotFound(_0x33eb79,null))[_0xb652('0x1e')](saveUpdates(_0x5a4d6c[_0xb652('0x42')],null))[_0xb652('0x1e')](respondWithResult(_0x33eb79,null))[_0xb652('0x40')](handleError(_0x33eb79,null));};exports[_0xb652('0x45')]=function(_0x3e067c,_0x1bebc7){return db['FaxQueueReport']['find']({'where':{'id':_0x3e067c[_0xb652('0x3f')]['id']}})[_0xb652('0x1e')](handleEntityNotFound(_0x1bebc7,null))['then'](removeEntity(_0x1bebc7,null))['catch'](handleError(_0x1bebc7,null));};exports['describe']=function(_0x10ca6c,_0x938dbf){return db[_0xb652('0x3c')][_0xb652('0x46')]()['then'](respondWithResult(_0x938dbf,null))['catch'](handleError(_0x938dbf,null));}; \ No newline at end of file +var _0x6be1=['rimraf','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','update','then','destroy','error','stack','name','index','map','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','order','pick','filter','where','merge','VIRTUAL','FaxQueueReport','includeAll','include','findAll','rows','show','rawAttributes','options','find','catch','create','body','params','describe','eml-format'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6be1,0x12f));var _0x16be=function(_0xe9f03a,_0x5f5baf){_0xe9f03a=_0xe9f03a-0x0;var _0x577ef9=_0x6be1[_0xe9f03a];return _0x577ef9;};'use strict';var emlformat=require(_0x16be('0x0'));var rimraf=require(_0x16be('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x16be('0x2'));var Mustache=require(_0x16be('0x3'));var util=require(_0x16be('0x4'));var path=require(_0x16be('0x5'));var sox=require(_0x16be('0x6'));var csv=require(_0x16be('0x7'));var ejs=require(_0x16be('0x8'));var fs=require('fs');var fs_extra=require(_0x16be('0x9'));var _=require(_0x16be('0xa'));var squel=require(_0x16be('0xb'));var crypto=require('crypto');var jsforce=require(_0x16be('0xc'));var deskjs=require(_0x16be('0xd'));var toCsv=require(_0x16be('0x7'));var querystring=require(_0x16be('0xe'));var Papa=require(_0x16be('0xf'));var Redis=require(_0x16be('0x10'));var authService=require(_0x16be('0x11'));var qs=require(_0x16be('0x12'));var as=require(_0x16be('0x13'));var hardwareService=require(_0x16be('0x14'));var logger=require(_0x16be('0x15'))(_0x16be('0x16'));var utils=require(_0x16be('0x17'));var config=require(_0x16be('0x18'));var licenseUtil=require(_0x16be('0x19'));var db=require(_0x16be('0x1a'))['db'];function respondWithStatusCode(_0x597c4d,_0x13aa8c){_0x13aa8c=_0x13aa8c||0xcc;return function(_0xb321f1){if(_0xb321f1){return _0x597c4d[_0x16be('0x1b')](_0x13aa8c);}return _0x597c4d[_0x16be('0x1c')](_0x13aa8c)[_0x16be('0x1d')]();};}function respondWithResult(_0x5b40b5,_0x16e9f1){_0x16e9f1=_0x16e9f1||0xc8;return function(_0xcf91fc){if(_0xcf91fc){return _0x5b40b5['status'](_0x16e9f1)[_0x16be('0x1e')](_0xcf91fc);}};}function respondWithFilteredResult(_0x5a00e6,_0x557de5){return function(_0x5f3095){if(_0x5f3095){var _0x74e610=typeof _0x557de5[_0x16be('0x1f')]===_0x16be('0x20')&&typeof _0x557de5['limit']===_0x16be('0x20');var _0x4e8072=_0x5f3095[_0x16be('0x21')];var _0x173da3=_0x74e610?0x0:_0x557de5[_0x16be('0x1f')];var _0x26d381=_0x74e610?_0x5f3095['count']:_0x557de5[_0x16be('0x1f')]+_0x557de5[_0x16be('0x22')];var _0x57fcaf;if(_0x26d381>=_0x4e8072){_0x26d381=_0x4e8072;_0x57fcaf=0xc8;}else{_0x57fcaf=0xce;}_0x5a00e6[_0x16be('0x1c')](_0x57fcaf);return _0x5a00e6[_0x16be('0x23')]('Content-Range',_0x173da3+'-'+_0x26d381+'/'+_0x4e8072)[_0x16be('0x1e')](_0x5f3095);}return null;};}function patchUpdates(_0xac15db){return function(_0x5944cc){try{jsonpatch[_0x16be('0x24')](_0x5944cc,_0xac15db,!![]);}catch(_0x2ade6d){return BPromise['reject'](_0x2ade6d);}return _0x5944cc['save']();};}function saveUpdates(_0x2975cc,_0xd99f60){return function(_0x57f0fe){if(_0x57f0fe){return _0x57f0fe[_0x16be('0x25')](_0x2975cc)[_0x16be('0x26')](function(_0x410dcd){return _0x410dcd;});}return null;};}function removeEntity(_0x110caa,_0x4a966b){return function(_0x71a798){if(_0x71a798){return _0x71a798[_0x16be('0x27')]()['then'](function(){_0x110caa[_0x16be('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e16dc,_0x2c5f97){return function(_0x2feb94){if(!_0x2feb94){_0x4e16dc['sendStatus'](0x194);}return _0x2feb94;};}function handleError(_0x23182c,_0x334bc6){_0x334bc6=_0x334bc6||0x1f4;return function(_0x3cd6cb){logger[_0x16be('0x28')](_0x3cd6cb[_0x16be('0x29')]);if(_0x3cd6cb[_0x16be('0x2a')]){delete _0x3cd6cb[_0x16be('0x2a')];}_0x23182c[_0x16be('0x1c')](_0x334bc6)['send'](_0x3cd6cb);};}exports[_0x16be('0x2b')]=function(_0x5b0921,_0x8f8394){var _0x37d1dd={},_0x132848={},_0x94f5d={'count':0x0,'rows':[]};var _0x19be4f=_[_0x16be('0x2c')](db['FaxQueueReport']['rawAttributes'],function(_0x4545bc){return{'name':_0x4545bc[_0x16be('0x2d')],'type':_0x4545bc[_0x16be('0x2e')][_0x16be('0x2f')]};});_0x132848['model']=_[_0x16be('0x2c')](_0x19be4f,'name');_0x132848[_0x16be('0x30')]=_[_0x16be('0x31')](_0x5b0921[_0x16be('0x30')]);_0x132848[_0x16be('0x32')]=_[_0x16be('0x33')](_0x132848[_0x16be('0x34')],_0x132848['query']);_0x37d1dd[_0x16be('0x35')]=_[_0x16be('0x33')](_0x132848[_0x16be('0x34')],qs['fields'](_0x5b0921['query'][_0x16be('0x36')]));_0x37d1dd[_0x16be('0x35')]=_0x37d1dd[_0x16be('0x35')][_0x16be('0x37')]?_0x37d1dd[_0x16be('0x35')]:_0x132848[_0x16be('0x34')];if(!_0x5b0921[_0x16be('0x30')]['hasOwnProperty']('nolimit')){_0x37d1dd[_0x16be('0x22')]=qs[_0x16be('0x22')](_0x5b0921[_0x16be('0x30')][_0x16be('0x22')]);_0x37d1dd['offset']=qs[_0x16be('0x1f')](_0x5b0921[_0x16be('0x30')][_0x16be('0x1f')]);}_0x37d1dd[_0x16be('0x38')]=qs['sort'](_0x5b0921[_0x16be('0x30')]['sort']);_0x37d1dd['where']=qs[_0x16be('0x32')](_[_0x16be('0x39')](_0x5b0921['query'],_0x132848[_0x16be('0x32')]),_0x19be4f);if(_0x5b0921[_0x16be('0x30')][_0x16be('0x3a')]){_0x37d1dd[_0x16be('0x3b')]=_[_0x16be('0x3c')](_0x37d1dd['where'],{'$or':_[_0x16be('0x2c')](_0x19be4f,function(_0x4bfe0c){if(_0x4bfe0c['type']!==_0x16be('0x3d')){var _0x1fb847={};_0x1fb847[_0x4bfe0c[_0x16be('0x2a')]]={'$like':'%'+_0x5b0921['query'][_0x16be('0x3a')]+'%'};return _0x1fb847;}})});}_0x37d1dd=_[_0x16be('0x3c')]({},_0x37d1dd,_0x5b0921['options']);var _0x8e52f9={'where':_0x37d1dd['where']};return db[_0x16be('0x3e')][_0x16be('0x21')](_0x8e52f9)[_0x16be('0x26')](function(_0x3b05e0){_0x94f5d[_0x16be('0x21')]=_0x3b05e0;if(_0x5b0921[_0x16be('0x30')][_0x16be('0x3f')]){_0x37d1dd[_0x16be('0x40')]=[{'all':!![]}];}return db[_0x16be('0x3e')][_0x16be('0x41')](_0x37d1dd);})['then'](function(_0x3865eb){_0x94f5d[_0x16be('0x42')]=_0x3865eb;return _0x94f5d;})[_0x16be('0x26')](respondWithFilteredResult(_0x8f8394,_0x37d1dd))['catch'](handleError(_0x8f8394,null));};exports[_0x16be('0x43')]=function(_0x2a99cd,_0x1e9e4f){var _0x47b61e={'raw':!![],'where':{'id':_0x2a99cd['params']['id']}},_0x2814c3={};_0x2814c3[_0x16be('0x34')]=_[_0x16be('0x31')](db['FaxQueueReport'][_0x16be('0x44')]);_0x2814c3['query']=_[_0x16be('0x31')](_0x2a99cd['query']);_0x2814c3[_0x16be('0x32')]=_[_0x16be('0x33')](_0x2814c3[_0x16be('0x34')],_0x2814c3['query']);_0x47b61e[_0x16be('0x35')]=_['intersection'](_0x2814c3[_0x16be('0x34')],qs[_0x16be('0x36')](_0x2a99cd['query'][_0x16be('0x36')]));_0x47b61e[_0x16be('0x35')]=_0x47b61e[_0x16be('0x35')][_0x16be('0x37')]?_0x47b61e[_0x16be('0x35')]:_0x2814c3[_0x16be('0x34')];if(_0x2a99cd[_0x16be('0x30')]['includeAll']){_0x47b61e[_0x16be('0x40')]=[{'all':!![]}];}_0x47b61e=_[_0x16be('0x3c')]({},_0x47b61e,_0x2a99cd[_0x16be('0x45')]);return db[_0x16be('0x3e')][_0x16be('0x46')](_0x47b61e)['then'](handleEntityNotFound(_0x1e9e4f,null))[_0x16be('0x26')](respondWithResult(_0x1e9e4f,null))[_0x16be('0x47')](handleError(_0x1e9e4f,null));};exports[_0x16be('0x48')]=function(_0x3561cf,_0x5ce6e9){return db['FaxQueueReport'][_0x16be('0x48')](_0x3561cf[_0x16be('0x49')],{})['then'](respondWithResult(_0x5ce6e9,0xc9))['catch'](handleError(_0x5ce6e9,null));};exports[_0x16be('0x25')]=function(_0x469229,_0x84f107){if(_0x469229[_0x16be('0x49')]['id']){delete _0x469229[_0x16be('0x49')]['id'];}return db[_0x16be('0x3e')][_0x16be('0x46')]({'where':{'id':_0x469229[_0x16be('0x4a')]['id']}})[_0x16be('0x26')](handleEntityNotFound(_0x84f107,null))[_0x16be('0x26')](saveUpdates(_0x469229[_0x16be('0x49')],null))['then'](respondWithResult(_0x84f107,null))[_0x16be('0x47')](handleError(_0x84f107,null));};exports[_0x16be('0x27')]=function(_0x28add6,_0x297aad){return db[_0x16be('0x3e')][_0x16be('0x46')]({'where':{'id':_0x28add6[_0x16be('0x4a')]['id']}})[_0x16be('0x26')](handleEntityNotFound(_0x297aad,null))[_0x16be('0x26')](removeEntity(_0x297aad,null))[_0x16be('0x47')](handleError(_0x297aad,null));};exports['describe']=function(_0x3c70d6,_0x448316){return db[_0x16be('0x3e')][_0x16be('0x4b')]()['then'](respondWithResult(_0x448316,null))[_0x16be('0x47')](handleError(_0x448316,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index f5fb3d0..a06d806 100644 --- a/server/api/faxQueueReport/faxQueueReport.model.js +++ b/server/api/faxQueueReport/faxQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fab=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport','report_fax_queue','uniqueid','lodash','util','api'];(function(_0x3aece7,_0x2f7bd0){var _0x31e759=function(_0x34352d){while(--_0x34352d){_0x3aece7['push'](_0x3aece7['shift']());}};_0x31e759(++_0x2f7bd0);}(_0x5fab,0x177));var _0xb5fa=function(_0x34f9a6,_0x4bf60b){_0x34f9a6=_0x34f9a6-0x0;var _0x5a94a2=_0x5fab[_0x34f9a6];return _0x5a94a2;};'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 _0x1cb9=['api','moment','bluebird','path','rimraf','./faxQueueReport.attributes','exports','define','FaxQueueReport','uniqueid','lodash','../../config/logger'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x1cb9,0x14e));var _0x91cb=function(_0x36242c,_0x4d2643){_0x36242c=_0x36242c-0x0;var _0x1a9f88=_0x1cb9[_0x36242c];return _0x1a9f88;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var logger=require(_0x91cb('0x1'))(_0x91cb('0x2'));var moment=require(_0x91cb('0x3'));var BPromise=require(_0x91cb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91cb('0x5'));var rimraf=require(_0x91cb('0x6'));var config=require('../../config/environment');var attributes=require(_0x91cb('0x7'));module[_0x91cb('0x8')]=function(_0x186dc3,_0x28543e){return _0x186dc3[_0x91cb('0x9')](_0x91cb('0xa'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0x91cb('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 041c65b..f600a02 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 _0x1f48=['../../config/environment','jayson/promise','client','http','request','info','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','FaxQueueReport,\x20%s,\x20%s','result','catch','CreateFaxQueueReport','FaxQueueReport','create','options','raw','stringify','UpdateFaxQueueReport','body','attributes','limit','then','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0xe97338,_0x477947){var _0x89d79b=function(_0x333d50){while(--_0x333d50){_0xe97338['push'](_0xe97338['shift']());}};_0x89d79b(++_0x477947);}(_0x1f48,0x1e7));var _0x81f4=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x1f48[_0x5d2803];return _0xdcad2c;};'use strict';var _=require(_0x81f4('0x0'));var util=require(_0x81f4('0x1'));var moment=require('moment');var BPromise=require(_0x81f4('0x2'));var rs=require(_0x81f4('0x3'));var fs=require('fs');var Redis=require(_0x81f4('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x81f4('0x5'));var logger=require(_0x81f4('0x6'))(_0x81f4('0x7'));var config=require(_0x81f4('0x8'));var jayson=require(_0x81f4('0x9'));var client=jayson[_0x81f4('0xa')][_0x81f4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x489f7c,_0x2010ea,_0xe4bdd){return new BPromise(function(_0x1a4ee4,_0x1ca445){return client[_0x81f4('0xc')](_0x489f7c,_0xe4bdd)['then'](function(_0x1a4d44){logger[_0x81f4('0xd')]('FaxQueueReport,\x20%s,\x20%s',_0x2010ea,'request\x20sent');logger[_0x81f4('0xe')](_0x81f4('0xf'),_0x2010ea,_0x81f4('0x10'),JSON['stringify'](_0x1a4d44));if(_0x1a4d44[_0x81f4('0x11')]){if(_0x1a4d44[_0x81f4('0x11')]['code']===0x1f4){logger['error']('FaxQueueReport,\x20%s,\x20%s',_0x2010ea,_0x1a4d44[_0x81f4('0x11')][_0x81f4('0x12')]);return _0x1ca445(_0x1a4d44['error'][_0x81f4('0x12')]);}logger[_0x81f4('0x11')](_0x81f4('0x13'),_0x2010ea,_0x1a4d44[_0x81f4('0x11')]['message']);return _0x1a4ee4(_0x1a4d44[_0x81f4('0x11')][_0x81f4('0x12')]);}else{logger[_0x81f4('0xd')](_0x81f4('0x13'),_0x2010ea,_0x81f4('0x10'));_0x1a4ee4(_0x1a4d44[_0x81f4('0x14')][_0x81f4('0x12')]);}})[_0x81f4('0x15')](function(_0x53a84f){logger[_0x81f4('0x11')](_0x81f4('0x13'),_0x2010ea,_0x53a84f);_0x1ca445(_0x53a84f);});});}exports[_0x81f4('0x16')]=function(_0x526975){var _0x32ef7f=this;return new Promise(function(_0x1109f5,_0x56c242){return db[_0x81f4('0x17')][_0x81f4('0x18')](_0x526975['body'],{'raw':_0x526975[_0x81f4('0x19')]?_0x526975[_0x81f4('0x19')][_0x81f4('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x5f0b86){logger['info']('CreateFaxQueueReport',_0x526975);logger[_0x81f4('0xe')](_0x81f4('0x16'),_0x526975,JSON[_0x81f4('0x1b')](_0x5f0b86));_0x1109f5(_0x5f0b86);})['catch'](function(_0xd7294b){logger[_0x81f4('0x11')](_0x81f4('0x16'),_0xd7294b[_0x81f4('0x12')],_0x526975);_0x56c242(_0x32ef7f[_0x81f4('0x11')](0x1f4,_0xd7294b[_0x81f4('0x12')]));});});};exports[_0x81f4('0x1c')]=function(_0x5616bb){var _0x16f16b=this;return new Promise(function(_0x55ecd3,_0x16fd0f){return db[_0x81f4('0x17')]['update'](_0x5616bb[_0x81f4('0x1d')],{'raw':_0x5616bb[_0x81f4('0x19')]?_0x5616bb['options'][_0x81f4('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5616bb[_0x81f4('0x19')]?_0x5616bb[_0x81f4('0x19')]['where']||null:null,'attributes':_0x5616bb['options']?_0x5616bb[_0x81f4('0x19')][_0x81f4('0x1e')]||null:null,'limit':_0x5616bb[_0x81f4('0x19')]?_0x5616bb[_0x81f4('0x19')][_0x81f4('0x1f')]||null:null})[_0x81f4('0x20')](function(_0x550af8){logger[_0x81f4('0xd')](_0x81f4('0x1c'),_0x5616bb);logger['debug'](_0x81f4('0x1c'),_0x5616bb,JSON[_0x81f4('0x1b')](_0x550af8));_0x55ecd3(_0x550af8);})[_0x81f4('0x15')](function(_0x64abd5){logger[_0x81f4('0x11')](_0x81f4('0x1c'),_0x64abd5[_0x81f4('0x12')],_0x5616bb);_0x16fd0f(_0x16f16b[_0x81f4('0x11')](0x1f4,_0x64abd5[_0x81f4('0x12')]));});});}; \ No newline at end of file +var _0x3cd2=['info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateFaxQueueReport','create','options','raw','stringify','FaxQueueReport','attributes','limit','UpdateFaxQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request'];(function(_0x336a2c,_0x13c7da){var _0x32ed7e=function(_0x57194e){while(--_0x57194e){_0x336a2c['push'](_0x336a2c['shift']());}};_0x32ed7e(++_0x13c7da);}(_0x3cd2,0x149));var _0x23cd=function(_0x5bf3bf,_0x3f5c08){_0x5bf3bf=_0x5bf3bf-0x0;var _0x23e174=_0x3cd2[_0x5bf3bf];return _0x23e174;};'use strict';var _=require(_0x23cd('0x0'));var util=require(_0x23cd('0x1'));var moment=require(_0x23cd('0x2'));var BPromise=require(_0x23cd('0x3'));var rs=require(_0x23cd('0x4'));var fs=require('fs');var Redis=require(_0x23cd('0x5'));var db=require(_0x23cd('0x6'))['db'];var utils=require(_0x23cd('0x7'));var logger=require('../../config/logger')(_0x23cd('0x8'));var config=require('../../config/environment');var jayson=require(_0x23cd('0x9'));var client=jayson[_0x23cd('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27c830,_0xd13dc2,_0x48366d){return new BPromise(function(_0x3ca6ce,_0x3d04f8){return client[_0x23cd('0xb')](_0x27c830,_0x48366d)['then'](function(_0x6ad02a){logger[_0x23cd('0xc')](_0x23cd('0xd'),_0xd13dc2,_0x23cd('0xe'));logger[_0x23cd('0xf')](_0x23cd('0x10'),_0xd13dc2,_0x23cd('0xe'),JSON['stringify'](_0x6ad02a));if(_0x6ad02a[_0x23cd('0x11')]){if(_0x6ad02a[_0x23cd('0x11')][_0x23cd('0x12')]===0x1f4){logger[_0x23cd('0x11')](_0x23cd('0xd'),_0xd13dc2,_0x6ad02a['error'][_0x23cd('0x13')]);return _0x3d04f8(_0x6ad02a[_0x23cd('0x11')]['message']);}logger[_0x23cd('0x11')](_0x23cd('0xd'),_0xd13dc2,_0x6ad02a[_0x23cd('0x11')][_0x23cd('0x13')]);return _0x3ca6ce(_0x6ad02a['error']['message']);}else{logger['info'](_0x23cd('0xd'),_0xd13dc2,_0x23cd('0xe'));_0x3ca6ce(_0x6ad02a[_0x23cd('0x14')][_0x23cd('0x13')]);}})[_0x23cd('0x15')](function(_0x18502a){logger['error']('FaxQueueReport,\x20%s,\x20%s',_0xd13dc2,_0x18502a);_0x3d04f8(_0x18502a);});});}exports[_0x23cd('0x16')]=function(_0x1d7cb9){var _0x36cbd0=this;return new Promise(function(_0x420ce7,_0x2d7e77){return db['FaxQueueReport'][_0x23cd('0x17')](_0x1d7cb9['body'],{'raw':_0x1d7cb9[_0x23cd('0x18')]?_0x1d7cb9['options'][_0x23cd('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0xcd059){logger['info'](_0x23cd('0x16'),_0x1d7cb9);logger[_0x23cd('0xf')]('CreateFaxQueueReport',_0x1d7cb9,JSON[_0x23cd('0x1a')](_0xcd059));_0x420ce7(_0xcd059);})[_0x23cd('0x15')](function(_0x23e008){logger['error'](_0x23cd('0x16'),_0x23e008[_0x23cd('0x13')],_0x1d7cb9);_0x2d7e77(_0x36cbd0[_0x23cd('0x11')](0x1f4,_0x23e008['message']));});});};exports['UpdateFaxQueueReport']=function(_0x24a229){var _0x43f23f=this;return new Promise(function(_0x355829,_0x85b7d7){return db[_0x23cd('0x1b')]['update'](_0x24a229['body'],{'raw':_0x24a229['options']?_0x24a229['options'][_0x23cd('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x24a229['options']?_0x24a229[_0x23cd('0x18')]['where']||null:null,'attributes':_0x24a229[_0x23cd('0x18')]?_0x24a229['options'][_0x23cd('0x1c')]||null:null,'limit':_0x24a229['options']?_0x24a229[_0x23cd('0x18')][_0x23cd('0x1d')]||null:null})['then'](function(_0x2821e1){logger[_0x23cd('0xc')]('UpdateFaxQueueReport',_0x24a229);logger['debug'](_0x23cd('0x1e'),_0x24a229,JSON[_0x23cd('0x1a')](_0x2821e1));_0x355829(_0x2821e1);})[_0x23cd('0x15')](function(_0x4dbc9e){logger[_0x23cd('0x11')](_0x23cd('0x1e'),_0x4dbc9e[_0x23cd('0x13')],_0x24a229);_0x85b7d7(_0x43f23f['error'](0x1f4,_0x4dbc9e['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 9c0ae5b..12530db 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 _0x771f=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxQueueReport.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x35aaf0,_0x141848){var _0x29acbb=function(_0x25d141){while(--_0x25d141){_0x35aaf0['push'](_0x35aaf0['shift']());}};_0x29acbb(++_0x141848);}(_0x771f,0x13d));var _0xf771=function(_0x8d6c7a,_0x2d4c3c){_0x8d6c7a=_0x8d6c7a-0x0;var _0x2c305a=_0x771f[_0x8d6c7a];return _0x2c305a;};'use strict';var multer=require(_0xf771('0x0'));var util=require(_0xf771('0x1'));var path=require(_0xf771('0x2'));var timeout=require(_0xf771('0x3'));var express=require('express');var router=express[_0xf771('0x4')]();var fs_extra=require(_0xf771('0x5'));var auth=require(_0xf771('0x6'));var interaction=require(_0xf771('0x7'));var config=require('../../config/environment');var controller=require(_0xf771('0x8'));router[_0xf771('0x9')]('/',auth[_0xf771('0xa')](),controller[_0xf771('0xb')]);router[_0xf771('0x9')]('/describe',auth[_0xf771('0xa')](),controller['describe']);router[_0xf771('0x9')](_0xf771('0xc'),auth[_0xf771('0xa')](),controller[_0xf771('0xd')]);router['post']('/',auth[_0xf771('0xa')](),controller[_0xf771('0xe')]);router[_0xf771('0xf')]('/:id',auth[_0xf771('0xa')](),controller[_0xf771('0x10')]);router[_0xf771('0x11')](_0xf771('0xc'),auth['isAuthenticated'](),controller[_0xf771('0x12')]);module[_0xf771('0x13')]=router; \ No newline at end of file +var _0x545f=['../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','index','/describe','isAuthenticated','describe','show','post','create','put','/:id','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x42a275,_0x43ff1b){var _0x4cb153=function(_0x344892){while(--_0x344892){_0x42a275['push'](_0x42a275['shift']());}};_0x4cb153(++_0x43ff1b);}(_0x545f,0x180));var _0xf545=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x545f[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require('multer');var util=require(_0xf545('0x0'));var path=require(_0xf545('0x1'));var timeout=require(_0xf545('0x2'));var express=require(_0xf545('0x3'));var router=express[_0xf545('0x4')]();var fs_extra=require(_0xf545('0x5'));var auth=require(_0xf545('0x6'));var interaction=require(_0xf545('0x7'));var config=require(_0xf545('0x8'));var controller=require(_0xf545('0x9'));router[_0xf545('0xa')]('/',auth['isAuthenticated'](),controller[_0xf545('0xb')]);router[_0xf545('0xa')](_0xf545('0xc'),auth[_0xf545('0xd')](),controller[_0xf545('0xe')]);router[_0xf545('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xf545('0xf')]);router[_0xf545('0x10')]('/',auth['isAuthenticated'](),controller[_0xf545('0x11')]);router[_0xf545('0x12')](_0xf545('0x13'),auth['isAuthenticated'](),controller[_0xf545('0x14')]);router[_0xf545('0x15')](_0xf545('0x13'),auth['isAuthenticated'](),controller[_0xf545('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 547d17e..75551ad 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 _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x16169b,_0x1fe209){var _0x7a7d78=function(_0x5d6fb5){while(--_0x5d6fb5){_0x16169b['push'](_0x16169b['shift']());}};_0x7a7d78(++_0x1fe209);}(_0x34e8,0x12c));var _0x834e=function(_0xdfd1b8,_0x46d49e){_0xdfd1b8=_0xdfd1b8-0x0;var _0xf3b0eb=_0x34e8[_0xdfd1b8];return _0xf3b0eb;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}}; \ No newline at end of file +var _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0xfb9aaa,_0x37935d){var _0x103bf7=function(_0x1e9f2a){while(--_0x1e9f2a){_0xfb9aaa['push'](_0xfb9aaa['shift']());}};_0x103bf7(++_0x37935d);}(_0x34e8,0x12c));var _0x834e=function(_0x4fc978,_0x48c60a){_0x4fc978=_0x4fc978-0x0;var _0x406f2b=_0x34e8[_0x4fc978];return _0x406f2b;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index d4bd175..630c6d9 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 _0xbaa7=['send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','FaxTransferReport','then','include','findAll','rows','show','params','includeAll','find','create','catch','update','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','save','destroy','sendStatus','error','stack','name'];(function(_0x43b2e1,_0x5e0497){var _0xaa8f9a=function(_0x55526c){while(--_0x55526c){_0x43b2e1['push'](_0x43b2e1['shift']());}};_0xaa8f9a(++_0x5e0497);}(_0xbaa7,0x1ac));var _0x7baa=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xbaa7[_0x1035c1];return _0x308d67;};'use strict';var emlformat=require(_0x7baa('0x0'));var rimraf=require(_0x7baa('0x1'));var zipdir=require(_0x7baa('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7baa('0x3'));var moment=require(_0x7baa('0x4'));var BPromise=require(_0x7baa('0x5'));var Mustache=require(_0x7baa('0x6'));var util=require(_0x7baa('0x7'));var path=require(_0x7baa('0x8'));var sox=require(_0x7baa('0x9'));var csv=require(_0x7baa('0xa'));var ejs=require(_0x7baa('0xb'));var fs=require('fs');var fs_extra=require(_0x7baa('0xc'));var _=require(_0x7baa('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7baa('0xe'));var toCsv=require(_0x7baa('0xa'));var querystring=require('querystring');var Papa=require(_0x7baa('0xf'));var Redis=require(_0x7baa('0x10'));var authService=require(_0x7baa('0x11'));var qs=require(_0x7baa('0x12'));var as=require(_0x7baa('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7baa('0x14'))(_0x7baa('0x15'));var utils=require('../../config/utils');var config=require(_0x7baa('0x16'));var licenseUtil=require(_0x7baa('0x17'));var db=require(_0x7baa('0x18'))['db'];function respondWithStatusCode(_0x1e85ad,_0x5826d1){_0x5826d1=_0x5826d1||0xcc;return function(_0x3ff6d5){if(_0x3ff6d5){return _0x1e85ad['sendStatus'](_0x5826d1);}return _0x1e85ad[_0x7baa('0x19')](_0x5826d1)[_0x7baa('0x1a')]();};}function respondWithResult(_0x59ddbb,_0x3097a5){_0x3097a5=_0x3097a5||0xc8;return function(_0x1b99d3){if(_0x1b99d3){return _0x59ddbb[_0x7baa('0x19')](_0x3097a5)[_0x7baa('0x1b')](_0x1b99d3);}};}function respondWithFilteredResult(_0x2f0ab4,_0x3a2ef0){return function(_0x50087f){if(_0x50087f){var _0x1aaa51=typeof _0x3a2ef0[_0x7baa('0x1c')]===_0x7baa('0x1d')&&typeof _0x3a2ef0[_0x7baa('0x1e')]===_0x7baa('0x1d');var _0x49c0ba=_0x50087f[_0x7baa('0x1f')];var _0xc71c34=_0x1aaa51?0x0:_0x3a2ef0['offset'];var _0x14f7f4=_0x1aaa51?_0x50087f[_0x7baa('0x1f')]:_0x3a2ef0[_0x7baa('0x1c')]+_0x3a2ef0[_0x7baa('0x1e')];var _0x2316c4;if(_0x14f7f4>=_0x49c0ba){_0x14f7f4=_0x49c0ba;_0x2316c4=0xc8;}else{_0x2316c4=0xce;}_0x2f0ab4[_0x7baa('0x19')](_0x2316c4);return _0x2f0ab4[_0x7baa('0x20')]('Content-Range',_0xc71c34+'-'+_0x14f7f4+'/'+_0x49c0ba)[_0x7baa('0x1b')](_0x50087f);}return null;};}function patchUpdates(_0x7737e0){return function(_0x564640){try{jsonpatch[_0x7baa('0x21')](_0x564640,_0x7737e0,!![]);}catch(_0x431947){return BPromise['reject'](_0x431947);}return _0x564640[_0x7baa('0x22')]();};}function saveUpdates(_0x3eaebd,_0x3ed102){return function(_0x2334a5){if(_0x2334a5){return _0x2334a5['update'](_0x3eaebd)['then'](function(_0x2856c1){return _0x2856c1;});}return null;};}function removeEntity(_0xf69381,_0x3bc291){return function(_0x5327cc){if(_0x5327cc){return _0x5327cc[_0x7baa('0x23')]()['then'](function(){_0xf69381[_0x7baa('0x19')](0xcc)[_0x7baa('0x1a')]();});}};}function handleEntityNotFound(_0x46429c,_0x1b78ab){return function(_0xe45789){if(!_0xe45789){_0x46429c[_0x7baa('0x24')](0x194);}return _0xe45789;};}function handleError(_0x49ec69,_0x377b91){_0x377b91=_0x377b91||0x1f4;return function(_0x150675){logger[_0x7baa('0x25')](_0x150675[_0x7baa('0x26')]);if(_0x150675[_0x7baa('0x27')]){delete _0x150675[_0x7baa('0x27')];}_0x49ec69['status'](_0x377b91)[_0x7baa('0x28')](_0x150675);};}exports[_0x7baa('0x29')]=function(_0x17538b,_0x525693){var _0x31426d={},_0x3467dc={},_0x5a6dff={'count':0x0,'rows':[]};var _0x1e8a33=_[_0x7baa('0x2a')](db['FaxTransferReport'][_0x7baa('0x2b')],function(_0x423762){return{'name':_0x423762[_0x7baa('0x2c')],'type':_0x423762[_0x7baa('0x2d')][_0x7baa('0x2e')]};});_0x3467dc['model']=_[_0x7baa('0x2a')](_0x1e8a33,_0x7baa('0x27'));_0x3467dc[_0x7baa('0x2f')]=_[_0x7baa('0x30')](_0x17538b[_0x7baa('0x2f')]);_0x3467dc[_0x7baa('0x31')]=_[_0x7baa('0x32')](_0x3467dc[_0x7baa('0x33')],_0x3467dc[_0x7baa('0x2f')]);_0x31426d[_0x7baa('0x34')]=_[_0x7baa('0x32')](_0x3467dc[_0x7baa('0x33')],qs[_0x7baa('0x35')](_0x17538b['query'][_0x7baa('0x35')]));_0x31426d['attributes']=_0x31426d[_0x7baa('0x34')][_0x7baa('0x36')]?_0x31426d[_0x7baa('0x34')]:_0x3467dc['model'];if(!_0x17538b['query'][_0x7baa('0x37')](_0x7baa('0x38'))){_0x31426d['limit']=qs[_0x7baa('0x1e')](_0x17538b[_0x7baa('0x2f')][_0x7baa('0x1e')]);_0x31426d[_0x7baa('0x1c')]=qs['offset'](_0x17538b['query'][_0x7baa('0x1c')]);}_0x31426d[_0x7baa('0x39')]=qs[_0x7baa('0x3a')](_0x17538b[_0x7baa('0x2f')][_0x7baa('0x3a')]);_0x31426d[_0x7baa('0x3b')]=qs[_0x7baa('0x31')](_[_0x7baa('0x3c')](_0x17538b['query'],_0x3467dc['filters']),_0x1e8a33);if(_0x17538b[_0x7baa('0x2f')][_0x7baa('0x3d')]){_0x31426d[_0x7baa('0x3b')]=_[_0x7baa('0x3e')](_0x31426d[_0x7baa('0x3b')],{'$or':_[_0x7baa('0x2a')](_0x1e8a33,function(_0xb944c2){if(_0xb944c2[_0x7baa('0x2d')]!==_0x7baa('0x3f')){var _0x28a392={};_0x28a392[_0xb944c2[_0x7baa('0x27')]]={'$like':'%'+_0x17538b[_0x7baa('0x2f')]['filter']+'%'};return _0x28a392;}})});}_0x31426d=_[_0x7baa('0x3e')]({},_0x31426d,_0x17538b['options']);var _0x907df9={'where':_0x31426d[_0x7baa('0x3b')]};return db[_0x7baa('0x40')][_0x7baa('0x1f')](_0x907df9)[_0x7baa('0x41')](function(_0x1688fa){_0x5a6dff[_0x7baa('0x1f')]=_0x1688fa;if(_0x17538b[_0x7baa('0x2f')]['includeAll']){_0x31426d[_0x7baa('0x42')]=[{'all':!![]}];}return db['FaxTransferReport'][_0x7baa('0x43')](_0x31426d);})[_0x7baa('0x41')](function(_0x17178d){_0x5a6dff[_0x7baa('0x44')]=_0x17178d;return _0x5a6dff;})['then'](respondWithFilteredResult(_0x525693,_0x31426d))['catch'](handleError(_0x525693,null));};exports[_0x7baa('0x45')]=function(_0xa9e168,_0x58d9b8){var _0x37c838={'raw':!![],'where':{'id':_0xa9e168[_0x7baa('0x46')]['id']}},_0x5eb5a4={};_0x5eb5a4[_0x7baa('0x33')]=_[_0x7baa('0x30')](db['FaxTransferReport']['rawAttributes']);_0x5eb5a4[_0x7baa('0x2f')]=_[_0x7baa('0x30')](_0xa9e168[_0x7baa('0x2f')]);_0x5eb5a4[_0x7baa('0x31')]=_[_0x7baa('0x32')](_0x5eb5a4[_0x7baa('0x33')],_0x5eb5a4['query']);_0x37c838[_0x7baa('0x34')]=_['intersection'](_0x5eb5a4['model'],qs['fields'](_0xa9e168['query'][_0x7baa('0x35')]));_0x37c838['attributes']=_0x37c838[_0x7baa('0x34')][_0x7baa('0x36')]?_0x37c838[_0x7baa('0x34')]:_0x5eb5a4['model'];if(_0xa9e168['query'][_0x7baa('0x47')]){_0x37c838[_0x7baa('0x42')]=[{'all':!![]}];}_0x37c838=_[_0x7baa('0x3e')]({},_0x37c838,_0xa9e168['options']);return db[_0x7baa('0x40')][_0x7baa('0x48')](_0x37c838)[_0x7baa('0x41')](handleEntityNotFound(_0x58d9b8,null))['then'](respondWithResult(_0x58d9b8,null))['catch'](handleError(_0x58d9b8,null));};exports[_0x7baa('0x49')]=function(_0x182234,_0x1857f4){return db[_0x7baa('0x40')][_0x7baa('0x49')](_0x182234['body'],{})['then'](respondWithResult(_0x1857f4,0xc9))[_0x7baa('0x4a')](handleError(_0x1857f4,null));};exports[_0x7baa('0x4b')]=function(_0x4c8220,_0x3ad5f6){if(_0x4c8220['body']['id']){delete _0x4c8220[_0x7baa('0x4c')]['id'];}return db[_0x7baa('0x40')]['find']({'where':{'id':_0x4c8220[_0x7baa('0x46')]['id']}})[_0x7baa('0x41')](handleEntityNotFound(_0x3ad5f6,null))[_0x7baa('0x41')](saveUpdates(_0x4c8220['body'],null))[_0x7baa('0x41')](respondWithResult(_0x3ad5f6,null))[_0x7baa('0x4a')](handleError(_0x3ad5f6,null));};exports[_0x7baa('0x23')]=function(_0x37d971,_0x522fe3){return db[_0x7baa('0x40')][_0x7baa('0x48')]({'where':{'id':_0x37d971[_0x7baa('0x46')]['id']}})[_0x7baa('0x41')](handleEntityNotFound(_0x522fe3,null))[_0x7baa('0x41')](removeEntity(_0x522fe3,null))[_0x7baa('0x4a')](handleError(_0x522fe3,null));};exports[_0x7baa('0x4d')]=function(_0x57be9b,_0x557ba9){return db[_0x7baa('0x40')][_0x7baa('0x4d')]()['then'](respondWithResult(_0x557ba9,null))['catch'](handleError(_0x557ba9,null));}; \ No newline at end of file +var _0x8e78=['where','pick','filter','merge','type','include','FaxTransferReport','rows','show','params','fields','includeAll','find','create','catch','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','name','index','map','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','order','sort'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x8e78,0x1c1));var _0x88e7=function(_0x378c3d,_0x1fe16f){_0x378c3d=_0x378c3d-0x0;var _0x4fa8b8=_0x8e78[_0x378c3d];return _0x4fa8b8;};'use strict';var emlformat=require(_0x88e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x88e7('0x1'));var jsonpatch=require(_0x88e7('0x2'));var rp=require(_0x88e7('0x3'));var moment=require(_0x88e7('0x4'));var BPromise=require(_0x88e7('0x5'));var Mustache=require(_0x88e7('0x6'));var util=require(_0x88e7('0x7'));var path=require(_0x88e7('0x8'));var sox=require('sox');var csv=require(_0x88e7('0x9'));var ejs=require(_0x88e7('0xa'));var fs=require('fs');var fs_extra=require(_0x88e7('0xb'));var _=require('lodash');var squel=require(_0x88e7('0xc'));var crypto=require(_0x88e7('0xd'));var jsforce=require(_0x88e7('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x88e7('0x9'));var querystring=require('querystring');var Papa=require(_0x88e7('0xf'));var Redis=require(_0x88e7('0x10'));var authService=require(_0x88e7('0x11'));var qs=require(_0x88e7('0x12'));var as=require(_0x88e7('0x13'));var hardwareService=require(_0x88e7('0x14'));var logger=require(_0x88e7('0x15'))(_0x88e7('0x16'));var utils=require('../../config/utils');var config=require(_0x88e7('0x17'));var licenseUtil=require(_0x88e7('0x18'));var db=require(_0x88e7('0x19'))['db'];function respondWithStatusCode(_0x225365,_0x2a792f){_0x2a792f=_0x2a792f||0xcc;return function(_0xd06e39){if(_0xd06e39){return _0x225365[_0x88e7('0x1a')](_0x2a792f);}return _0x225365[_0x88e7('0x1b')](_0x2a792f)[_0x88e7('0x1c')]();};}function respondWithResult(_0x157bc5,_0x477eaa){_0x477eaa=_0x477eaa||0xc8;return function(_0x5a5192){if(_0x5a5192){return _0x157bc5[_0x88e7('0x1b')](_0x477eaa)[_0x88e7('0x1d')](_0x5a5192);}};}function respondWithFilteredResult(_0x5540d9,_0x15ae4d){return function(_0x30f784){if(_0x30f784){var _0x458346=typeof _0x15ae4d[_0x88e7('0x1e')]===_0x88e7('0x1f')&&typeof _0x15ae4d[_0x88e7('0x20')]===_0x88e7('0x1f');var _0x2d5b38=_0x30f784['count'];var _0x1e09bd=_0x458346?0x0:_0x15ae4d[_0x88e7('0x1e')];var _0x46ffbb=_0x458346?_0x30f784[_0x88e7('0x21')]:_0x15ae4d[_0x88e7('0x1e')]+_0x15ae4d[_0x88e7('0x20')];var _0x4cb2b2;if(_0x46ffbb>=_0x2d5b38){_0x46ffbb=_0x2d5b38;_0x4cb2b2=0xc8;}else{_0x4cb2b2=0xce;}_0x5540d9[_0x88e7('0x1b')](_0x4cb2b2);return _0x5540d9['set'](_0x88e7('0x22'),_0x1e09bd+'-'+_0x46ffbb+'/'+_0x2d5b38)[_0x88e7('0x1d')](_0x30f784);}return null;};}function patchUpdates(_0x3ed10a){return function(_0x11f437){try{jsonpatch['apply'](_0x11f437,_0x3ed10a,!![]);}catch(_0x5d91dc){return BPromise[_0x88e7('0x23')](_0x5d91dc);}return _0x11f437[_0x88e7('0x24')]();};}function saveUpdates(_0x32ccb4,_0x2583d2){return function(_0x112ec8){if(_0x112ec8){return _0x112ec8[_0x88e7('0x25')](_0x32ccb4)[_0x88e7('0x26')](function(_0x49f838){return _0x49f838;});}return null;};}function removeEntity(_0x507b7d,_0x4656d6){return function(_0x57e81c){if(_0x57e81c){return _0x57e81c[_0x88e7('0x27')]()['then'](function(){_0x507b7d[_0x88e7('0x1b')](0xcc)[_0x88e7('0x1c')]();});}};}function handleEntityNotFound(_0x2e39e9,_0x338339){return function(_0x385290){if(!_0x385290){_0x2e39e9[_0x88e7('0x1a')](0x194);}return _0x385290;};}function handleError(_0x2cfac0,_0x237875){_0x237875=_0x237875||0x1f4;return function(_0x5851f5){logger['error'](_0x5851f5['stack']);if(_0x5851f5[_0x88e7('0x28')]){delete _0x5851f5[_0x88e7('0x28')];}_0x2cfac0[_0x88e7('0x1b')](_0x237875)['send'](_0x5851f5);};}exports[_0x88e7('0x29')]=function(_0x1c74d5,_0x53bcaa){var _0xb363bc={},_0x28062d={},_0x50628d={'count':0x0,'rows':[]};var _0x4bd84a=_[_0x88e7('0x2a')](db['FaxTransferReport'][_0x88e7('0x2b')],function(_0x12f5af){return{'name':_0x12f5af[_0x88e7('0x2c')],'type':_0x12f5af['type']['key']};});_0x28062d[_0x88e7('0x2d')]=_[_0x88e7('0x2a')](_0x4bd84a,'name');_0x28062d[_0x88e7('0x2e')]=_[_0x88e7('0x2f')](_0x1c74d5['query']);_0x28062d[_0x88e7('0x30')]=_[_0x88e7('0x31')](_0x28062d[_0x88e7('0x2d')],_0x28062d[_0x88e7('0x2e')]);_0xb363bc[_0x88e7('0x32')]=_['intersection'](_0x28062d[_0x88e7('0x2d')],qs['fields'](_0x1c74d5['query']['fields']));_0xb363bc[_0x88e7('0x32')]=_0xb363bc[_0x88e7('0x32')][_0x88e7('0x33')]?_0xb363bc[_0x88e7('0x32')]:_0x28062d['model'];if(!_0x1c74d5[_0x88e7('0x2e')][_0x88e7('0x34')]('nolimit')){_0xb363bc[_0x88e7('0x20')]=qs[_0x88e7('0x20')](_0x1c74d5[_0x88e7('0x2e')][_0x88e7('0x20')]);_0xb363bc[_0x88e7('0x1e')]=qs[_0x88e7('0x1e')](_0x1c74d5[_0x88e7('0x2e')][_0x88e7('0x1e')]);}_0xb363bc[_0x88e7('0x35')]=qs[_0x88e7('0x36')](_0x1c74d5['query']['sort']);_0xb363bc[_0x88e7('0x37')]=qs[_0x88e7('0x30')](_[_0x88e7('0x38')](_0x1c74d5[_0x88e7('0x2e')],_0x28062d['filters']),_0x4bd84a);if(_0x1c74d5[_0x88e7('0x2e')][_0x88e7('0x39')]){_0xb363bc[_0x88e7('0x37')]=_[_0x88e7('0x3a')](_0xb363bc[_0x88e7('0x37')],{'$or':_['map'](_0x4bd84a,function(_0xb0571f){if(_0xb0571f[_0x88e7('0x3b')]!=='VIRTUAL'){var _0x4fa574={};_0x4fa574[_0xb0571f[_0x88e7('0x28')]]={'$like':'%'+_0x1c74d5['query']['filter']+'%'};return _0x4fa574;}})});}_0xb363bc=_[_0x88e7('0x3a')]({},_0xb363bc,_0x1c74d5['options']);var _0x1db2b0={'where':_0xb363bc['where']};return db['FaxTransferReport'][_0x88e7('0x21')](_0x1db2b0)['then'](function(_0x3289ec){_0x50628d[_0x88e7('0x21')]=_0x3289ec;if(_0x1c74d5['query']['includeAll']){_0xb363bc[_0x88e7('0x3c')]=[{'all':!![]}];}return db[_0x88e7('0x3d')]['findAll'](_0xb363bc);})[_0x88e7('0x26')](function(_0x4a1e4d){_0x50628d[_0x88e7('0x3e')]=_0x4a1e4d;return _0x50628d;})['then'](respondWithFilteredResult(_0x53bcaa,_0xb363bc))['catch'](handleError(_0x53bcaa,null));};exports[_0x88e7('0x3f')]=function(_0x55bc6e,_0x2d79ca){var _0x4aef72={'raw':!![],'where':{'id':_0x55bc6e[_0x88e7('0x40')]['id']}},_0x10be50={};_0x10be50[_0x88e7('0x2d')]=_['keys'](db['FaxTransferReport'][_0x88e7('0x2b')]);_0x10be50[_0x88e7('0x2e')]=_[_0x88e7('0x2f')](_0x55bc6e[_0x88e7('0x2e')]);_0x10be50['filters']=_[_0x88e7('0x31')](_0x10be50[_0x88e7('0x2d')],_0x10be50[_0x88e7('0x2e')]);_0x4aef72[_0x88e7('0x32')]=_[_0x88e7('0x31')](_0x10be50[_0x88e7('0x2d')],qs[_0x88e7('0x41')](_0x55bc6e['query'][_0x88e7('0x41')]));_0x4aef72[_0x88e7('0x32')]=_0x4aef72['attributes']['length']?_0x4aef72['attributes']:_0x10be50['model'];if(_0x55bc6e[_0x88e7('0x2e')][_0x88e7('0x42')]){_0x4aef72[_0x88e7('0x3c')]=[{'all':!![]}];}_0x4aef72=_[_0x88e7('0x3a')]({},_0x4aef72,_0x55bc6e['options']);return db[_0x88e7('0x3d')][_0x88e7('0x43')](_0x4aef72)[_0x88e7('0x26')](handleEntityNotFound(_0x2d79ca,null))['then'](respondWithResult(_0x2d79ca,null))['catch'](handleError(_0x2d79ca,null));};exports[_0x88e7('0x44')]=function(_0x3e835c,_0x4ad212){return db['FaxTransferReport'][_0x88e7('0x44')](_0x3e835c['body'],{})['then'](respondWithResult(_0x4ad212,0xc9))[_0x88e7('0x45')](handleError(_0x4ad212,null));};exports[_0x88e7('0x25')]=function(_0x72f89b,_0x4c92ad){if(_0x72f89b['body']['id']){delete _0x72f89b[_0x88e7('0x46')]['id'];}return db[_0x88e7('0x3d')]['find']({'where':{'id':_0x72f89b[_0x88e7('0x40')]['id']}})[_0x88e7('0x26')](handleEntityNotFound(_0x4c92ad,null))[_0x88e7('0x26')](saveUpdates(_0x72f89b['body'],null))[_0x88e7('0x26')](respondWithResult(_0x4c92ad,null))['catch'](handleError(_0x4c92ad,null));};exports[_0x88e7('0x27')]=function(_0x3d0c46,_0x4fa3e3){return db[_0x88e7('0x3d')][_0x88e7('0x43')]({'where':{'id':_0x3d0c46[_0x88e7('0x40')]['id']}})['then'](handleEntityNotFound(_0x4fa3e3,null))[_0x88e7('0x26')](removeEntity(_0x4fa3e3,null))[_0x88e7('0x45')](handleError(_0x4fa3e3,null));};exports[_0x88e7('0x47')]=function(_0x55f1e1,_0x3f10fb){return db['FaxTransferReport'][_0x88e7('0x47')]()[_0x88e7('0x26')](respondWithResult(_0x3f10fb,null))[_0x88e7('0x45')](handleError(_0x3f10fb,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 796e516..a6c95fc 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 _0x2bb2=['FaxTransferReport','uniqueid','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','exports','define'];(function(_0x187422,_0x3a17bd){var _0x53d59d=function(_0x351b5c){while(--_0x351b5c){_0x187422['push'](_0x187422['shift']());}};_0x53d59d(++_0x3a17bd);}(_0x2bb2,0x1db));var _0x22bb=function(_0x2b6f0a,_0x415b73){_0x2b6f0a=_0x2b6f0a-0x0;var _0x27713d=_0x2bb2[_0x2b6f0a];return _0x27713d;};'use strict';var _=require(_0x22bb('0x0'));var util=require('util');var logger=require(_0x22bb('0x1'))(_0x22bb('0x2'));var moment=require('moment');var BPromise=require(_0x22bb('0x3'));var rp=require(_0x22bb('0x4'));var fs=require('fs');var path=require(_0x22bb('0x5'));var rimraf=require(_0x22bb('0x6'));var config=require('../../config/environment');var attributes=require('./faxTransferReport.attributes');module[_0x22bb('0x7')]=function(_0x47cfe3,_0x1decb7){return _0x47cfe3[_0x22bb('0x8')](_0x22bb('0x9'),attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0x22bb('0xa'),'fields':[_0x22bb('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf56c=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define','report_fax_transfer','uniqueid','util'];(function(_0x556646,_0x517a4b){var _0x2d105e=function(_0x3df17b){while(--_0x3df17b){_0x556646['push'](_0x556646['shift']());}};_0x2d105e(++_0x517a4b);}(_0xf56c,0x67));var _0xcf56=function(_0x4f7e4f,_0xebbe5d){_0x4f7e4f=_0x4f7e4f-0x0;var _0x5ec1ed=_0xf56c[_0x4f7e4f];return _0x5ec1ed;};'use strict';var _=require('lodash');var util=require(_0xcf56('0x0'));var logger=require(_0xcf56('0x1'))(_0xcf56('0x2'));var moment=require(_0xcf56('0x3'));var BPromise=require('bluebird');var rp=require(_0xcf56('0x4'));var fs=require('fs');var path=require(_0xcf56('0x5'));var rimraf=require(_0xcf56('0x6'));var config=require(_0xcf56('0x7'));var attributes=require(_0xcf56('0x8'));module[_0xcf56('0x9')]=function(_0x33ce84,_0x503792){return _0x33ce84[_0xcf56('0xa')]('FaxTransferReport',attributes,{'tableName':_0xcf56('0xb'),'paranoid':![],'indexes':[{'name':_0xcf56('0xc'),'fields':[_0xcf56('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index ff3c189..e91191b 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 _0x176b=['FaxTransferReport,\x20%s,\x20%s','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','then','info'];(function(_0x2a4684,_0x5bb4d2){var _0x20c2f6=function(_0x161ba6){while(--_0x161ba6){_0x2a4684['push'](_0x2a4684['shift']());}};_0x20c2f6(++_0x5bb4d2);}(_0x176b,0xd1));var _0xb176=function(_0x4688f3,_0x1d5a1a){_0x4688f3=_0x4688f3-0x0;var _0x470c84=_0x176b[_0x4688f3];return _0x470c84;};'use strict';var _=require(_0xb176('0x0'));var util=require(_0xb176('0x1'));var moment=require('moment');var BPromise=require(_0xb176('0x2'));var rs=require(_0xb176('0x3'));var fs=require('fs');var Redis=require(_0xb176('0x4'));var db=require(_0xb176('0x5'))['db'];var utils=require(_0xb176('0x6'));var logger=require('../../config/logger')(_0xb176('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb176('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x40d136,_0x57ad30,_0x39b900){return new BPromise(function(_0x4cb70b,_0x28e3f4){return client['request'](_0x40d136,_0x39b900)[_0xb176('0x9')](function(_0x56a542){logger[_0xb176('0xa')](_0xb176('0xb'),_0x57ad30,'request\x20sent');logger[_0xb176('0xc')](_0xb176('0xd'),_0x57ad30,_0xb176('0xe'),JSON['stringify'](_0x56a542));if(_0x56a542[_0xb176('0xf')]){if(_0x56a542[_0xb176('0xf')][_0xb176('0x10')]===0x1f4){logger['error'](_0xb176('0xb'),_0x57ad30,_0x56a542[_0xb176('0xf')]['message']);return _0x28e3f4(_0x56a542[_0xb176('0xf')][_0xb176('0x11')]);}logger[_0xb176('0xf')](_0xb176('0xb'),_0x57ad30,_0x56a542[_0xb176('0xf')][_0xb176('0x11')]);return _0x4cb70b(_0x56a542['error'][_0xb176('0x11')]);}else{logger[_0xb176('0xa')]('FaxTransferReport,\x20%s,\x20%s',_0x57ad30,'request\x20sent');_0x4cb70b(_0x56a542[_0xb176('0x12')][_0xb176('0x11')]);}})[_0xb176('0x13')](function(_0x3c5d54){logger[_0xb176('0xf')](_0xb176('0xb'),_0x57ad30,_0x3c5d54);_0x28e3f4(_0x3c5d54);});});} \ No newline at end of file +var _0xa6e5=['code','message','result','catch','lodash','moment','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','FaxTransferReport,\x20%s,\x20%s','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x408b1e,_0x4fd20f){var _0x231e81=function(_0x438658){while(--_0x438658){_0x408b1e['push'](_0x408b1e['shift']());}};_0x231e81(++_0x4fd20f);}(_0xa6e5,0x89));var _0x5a6e=function(_0x248151,_0x1a972b){_0x248151=_0x248151-0x0;var _0x5e0ec5=_0xa6e5[_0x248151];return _0x5e0ec5;};'use strict';var _=require(_0x5a6e('0x0'));var util=require('util');var moment=require(_0x5a6e('0x1'));var BPromise=require('bluebird');var rs=require(_0x5a6e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5a6e('0x3'))(_0x5a6e('0x4'));var config=require(_0x5a6e('0x5'));var jayson=require(_0x5a6e('0x6'));var client=jayson['client'][_0x5a6e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3416ad,_0x139939,_0x421201){return new BPromise(function(_0x15d156,_0x40b69b){return client[_0x5a6e('0x8')](_0x3416ad,_0x421201)['then'](function(_0x3aca09){logger[_0x5a6e('0x9')](_0x5a6e('0xa'),_0x139939,'request\x20sent');logger[_0x5a6e('0xb')](_0x5a6e('0xc'),_0x139939,_0x5a6e('0xd'),JSON['stringify'](_0x3aca09));if(_0x3aca09[_0x5a6e('0xe')]){if(_0x3aca09['error'][_0x5a6e('0xf')]===0x1f4){logger[_0x5a6e('0xe')](_0x5a6e('0xa'),_0x139939,_0x3aca09['error'][_0x5a6e('0x10')]);return _0x40b69b(_0x3aca09[_0x5a6e('0xe')][_0x5a6e('0x10')]);}logger['error'](_0x5a6e('0xa'),_0x139939,_0x3aca09[_0x5a6e('0xe')]['message']);return _0x15d156(_0x3aca09[_0x5a6e('0xe')][_0x5a6e('0x10')]);}else{logger[_0x5a6e('0x9')](_0x5a6e('0xa'),_0x139939,_0x5a6e('0xd'));_0x15d156(_0x3aca09[_0x5a6e('0x11')][_0x5a6e('0x10')]);}})[_0x5a6e('0x12')](function(_0x2166f9){logger[_0x5a6e('0xe')](_0x5a6e('0xa'),_0x139939,_0x2166f9);_0x40b69b(_0x2166f9);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 1934e45..cb2f510 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 _0xf954=['put','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','create'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xf954,0x75));var _0x4f95=function(_0x26e782,_0x2f9b47){_0x26e782=_0x26e782-0x0;var _0x823b67=_0xf954[_0x26e782];return _0x823b67;};'use strict';var multer=require(_0x4f95('0x0'));var util=require(_0x4f95('0x1'));var path=require(_0x4f95('0x2'));var timeout=require(_0x4f95('0x3'));var express=require(_0x4f95('0x4'));var router=express[_0x4f95('0x5')]();var fs_extra=require(_0x4f95('0x6'));var auth=require(_0x4f95('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x4f95('0x8'));var controller=require('./faxTransferReport.controller');router[_0x4f95('0x9')]('/',auth[_0x4f95('0xa')](),controller[_0x4f95('0xb')]);router['get']('/describe',auth[_0x4f95('0xa')](),controller[_0x4f95('0xc')]);router[_0x4f95('0x9')](_0x4f95('0xd'),auth[_0x4f95('0xa')](),controller[_0x4f95('0xe')]);router['post']('/',auth[_0x4f95('0xa')](),controller[_0x4f95('0xf')]);router[_0x4f95('0x10')](_0x4f95('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x4f95('0x11')]('/:id',auth[_0x4f95('0xa')](),controller['destroy']);module[_0x4f95('0x12')]=router; \ No newline at end of file +var _0x013e=['fs-extra','../../components/auth/service','../../components/interaction/service','./faxTransferReport.controller','get','/describe','isAuthenticated','show','post','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express'];(function(_0x59f503,_0x527a16){var _0x248927=function(_0x118bf7){while(--_0x118bf7){_0x59f503['push'](_0x59f503['shift']());}};_0x248927(++_0x527a16);}(_0x013e,0x19a));var _0xe013=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0x013e[_0xf0bcac];return _0x4e4c65;};'use strict';var multer=require(_0xe013('0x0'));var util=require(_0xe013('0x1'));var path=require('path');var timeout=require(_0xe013('0x2'));var express=require(_0xe013('0x3'));var router=express['Router']();var fs_extra=require(_0xe013('0x4'));var auth=require(_0xe013('0x5'));var interaction=require(_0xe013('0x6'));var config=require('../../config/environment');var controller=require(_0xe013('0x7'));router[_0xe013('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe013('0x8')](_0xe013('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0xe013('0x8')]('/:id',auth[_0xe013('0xa')](),controller[_0xe013('0xb')]);router[_0xe013('0xc')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xe013('0xd'),auth[_0xe013('0xa')](),controller[_0xe013('0xe')]);router[_0xe013('0xf')](_0xe013('0xd'),auth['isAuthenticated'](),controller[_0xe013('0x10')]);module[_0xe013('0x11')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index aba5004..620e3ff 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 _0xced1=['isAuthenticated','index','/:id','show','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','update','destroy','path','connect-timeout','express','Router','fs-extra','../../config/environment','./intDeskAccount.controller','get'];(function(_0x945c80,_0x2397fb){var _0x41be19=function(_0x456519){while(--_0x456519){_0x945c80['push'](_0x945c80['shift']());}};_0x41be19(++_0x2397fb);}(_0xced1,0xca));var _0x1ced=function(_0x3826ad,_0x49a30d){_0x3826ad=_0x3826ad-0x0;var _0x17b900=_0xced1[_0x3826ad];return _0x17b900;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1ced('0x0'));var timeout=require(_0x1ced('0x1'));var express=require(_0x1ced('0x2'));var router=express[_0x1ced('0x3')]();var fs_extra=require(_0x1ced('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1ced('0x5'));var controller=require(_0x1ced('0x6'));router[_0x1ced('0x7')]('/',auth[_0x1ced('0x8')](),controller[_0x1ced('0x9')]);router[_0x1ced('0x7')](_0x1ced('0xa'),auth['isAuthenticated'](),controller[_0x1ced('0xb')]);router['get']('/:id/configurations',auth[_0x1ced('0x8')](),controller['getConfigurations']);router['get'](_0x1ced('0xc'),auth['isAuthenticated'](),controller[_0x1ced('0xd')]);router[_0x1ced('0xe')]('/',auth[_0x1ced('0x8')](),controller[_0x1ced('0xf')]);router[_0x1ced('0xe')](_0x1ced('0x10'),auth['isAuthenticated'](),controller[_0x1ced('0x11')]);router[_0x1ced('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x1ced('0x13')]);router['delete'](_0x1ced('0xa'),auth[_0x1ced('0x8')](),controller[_0x1ced('0x14')]);module['exports']=router; \ No newline at end of file +var _0x8b87=['fs-extra','../../components/auth/service','./intDeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','put','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x3d6137,_0x13d351){var _0x5daf34=function(_0x46d844){while(--_0x46d844){_0x3d6137['push'](_0x3d6137['shift']());}};_0x5daf34(++_0x13d351);}(_0x8b87,0xd7));var _0x78b8=function(_0x5c7b7e,_0x9b1a8f){_0x5c7b7e=_0x5c7b7e-0x0;var _0xc7b20d=_0x8b87[_0x5c7b7e];return _0xc7b20d;};'use strict';var multer=require(_0x78b8('0x0'));var util=require('util');var path=require(_0x78b8('0x1'));var timeout=require(_0x78b8('0x2'));var express=require(_0x78b8('0x3'));var router=express[_0x78b8('0x4')]();var fs_extra=require(_0x78b8('0x5'));var auth=require(_0x78b8('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x78b8('0x7'));router[_0x78b8('0x8')]('/',auth[_0x78b8('0x9')](),controller[_0x78b8('0xa')]);router[_0x78b8('0x8')](_0x78b8('0xb'),auth[_0x78b8('0x9')](),controller[_0x78b8('0xc')]);router[_0x78b8('0x8')](_0x78b8('0xd'),auth[_0x78b8('0x9')](),controller[_0x78b8('0xe')]);router['get'](_0x78b8('0xf'),auth[_0x78b8('0x9')](),controller[_0x78b8('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x78b8('0x11')]);router[_0x78b8('0x12')]('/:id/configurations',auth[_0x78b8('0x9')](),controller['addConfiguration']);router[_0x78b8('0x13')](_0x78b8('0xb'),auth[_0x78b8('0x9')](),controller['update']);router['delete'](_0x78b8('0xb'),auth[_0x78b8('0x9')](),controller[_0x78b8('0x14')]);module[_0x78b8('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index e891459..87b92c4 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 _0x9498=['integrationTab','newTab','sequelize','exports','STRING','ENUM','basic'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x9498,0x105));var _0x8949=function(_0x378c2b,_0x3c3f89){_0x378c2b=_0x378c2b-0x0;var _0x559fdd=_0x9498[_0x378c2b];return _0x559fdd;};'use strict';var Sequelize=require(_0x8949('0x0'));module[_0x8949('0x1')]={'name':{'type':Sequelize[_0x8949('0x2')]},'description':{'type':Sequelize[_0x8949('0x2')]},'username':{'type':Sequelize[_0x8949('0x2')]},'remoteUri':{'type':Sequelize[_0x8949('0x2')]},'authType':{'type':Sequelize[_0x8949('0x3')](_0x8949('0x4')),'defaultValue':_0x8949('0x4')},'password':{'type':Sequelize[_0x8949('0x2')]},'consumerKey':{'type':Sequelize[_0x8949('0x2')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x8949('0x2')]},'tokenSecret':{'type':Sequelize[_0x8949('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x8949('0x3')](_0x8949('0x5'),_0x8949('0x6')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x81c3=['exports','STRING','ENUM','basic','newTab','integrationTab','sequelize'];(function(_0x24079b,_0x473683){var _0x40276d=function(_0x2b143c){while(--_0x2b143c){_0x24079b['push'](_0x24079b['shift']());}};_0x40276d(++_0x473683);}(_0x81c3,0xdf));var _0x381c=function(_0x517679,_0x1860cc){_0x517679=_0x517679-0x0;var _0x94131=_0x81c3[_0x517679];return _0x94131;};'use strict';var Sequelize=require(_0x381c('0x0'));module[_0x381c('0x1')]={'name':{'type':Sequelize[_0x381c('0x2')]},'description':{'type':Sequelize[_0x381c('0x2')]},'username':{'type':Sequelize[_0x381c('0x2')]},'remoteUri':{'type':Sequelize[_0x381c('0x2')]},'authType':{'type':Sequelize[_0x381c('0x3')](_0x381c('0x4')),'defaultValue':_0x381c('0x4')},'password':{'type':Sequelize[_0x381c('0x2')]},'consumerKey':{'type':Sequelize[_0x381c('0x2')]},'consumerSecret':{'type':Sequelize[_0x381c('0x2')]},'token':{'type':Sequelize[_0x381c('0x2')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM']('integrationTab',_0x381c('0x5')),'defaultValue':_0x381c('0x6')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 50fbdca..043e0ab 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 _0x67b7=['consumerSecret','token','tokenSecret','substring','lastIndexOf','format','%s/custom_fields','application/json','basic','Authorization','Basic\x20%s','%s:%s','toString','base64','concat','_embedded','entries','active','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','end','error','stack','send','index','map','DeskAccount','rawAttributes','fieldName','type','model','name','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','includeAll','findAll','rows','catch','show','params','length','merge','find','create','body','getConfigurations','findOne','DeskConfiguration','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','DeskField','priority','remoteUri','authType','username','password','consumerKey'];(function(_0x4f004b,_0x97e983){var _0x4d760b=function(_0x226b69){while(--_0x226b69){_0x4f004b['push'](_0x4f004b['shift']());}};_0x4d760b(++_0x97e983);}(_0x67b7,0x180));var _0x767b=function(_0x587452,_0x5d9670){_0x587452=_0x587452-0x0;var _0x2c71ae=_0x67b7[_0x587452];return _0x2c71ae;};'use strict';var emlformat=require(_0x767b('0x0'));var rimraf=require(_0x767b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x767b('0x2'));var rp=require(_0x767b('0x3'));var moment=require(_0x767b('0x4'));var BPromise=require(_0x767b('0x5'));var Mustache=require(_0x767b('0x6'));var util=require(_0x767b('0x7'));var path=require(_0x767b('0x8'));var sox=require(_0x767b('0x9'));var csv=require('to-csv');var ejs=require(_0x767b('0xa'));var fs=require('fs');var fs_extra=require(_0x767b('0xb'));var _=require(_0x767b('0xc'));var squel=require(_0x767b('0xd'));var crypto=require(_0x767b('0xe'));var jsforce=require(_0x767b('0xf'));var deskjs=require(_0x767b('0x10'));var toCsv=require(_0x767b('0x11'));var querystring=require(_0x767b('0x12'));var Papa=require(_0x767b('0x13'));var Redis=require(_0x767b('0x14'));var authService=require(_0x767b('0x15'));var qs=require(_0x767b('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x767b('0x17'));var logger=require(_0x767b('0x18'))(_0x767b('0x19'));var utils=require(_0x767b('0x1a'));var config=require(_0x767b('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x767b('0x1c'))['db'];var integrations=require(_0x767b('0x1d'));function respondWithStatusCode(_0x3520df,_0x8a52db){_0x8a52db=_0x8a52db||0xcc;return function(_0x7be77d){if(_0x7be77d){return _0x3520df[_0x767b('0x1e')](_0x8a52db);}return _0x3520df[_0x767b('0x1f')](_0x8a52db)['end']();};}function respondWithResult(_0x1b6317,_0x4d5736){_0x4d5736=_0x4d5736||0xc8;return function(_0x394f5e){if(_0x394f5e){return _0x1b6317[_0x767b('0x1f')](_0x4d5736)[_0x767b('0x20')](_0x394f5e);}};}function respondWithFilteredResult(_0x2b394a,_0x54d9ee){return function(_0x3dafe0){if(_0x3dafe0){var _0x502252=typeof _0x54d9ee[_0x767b('0x21')]===_0x767b('0x22')&&typeof _0x54d9ee[_0x767b('0x23')]===_0x767b('0x22');var _0x48d543=_0x3dafe0[_0x767b('0x24')];var _0x4e5b85=_0x502252?0x0:_0x54d9ee[_0x767b('0x21')];var _0x38e80a=_0x502252?_0x3dafe0['count']:_0x54d9ee['offset']+_0x54d9ee[_0x767b('0x23')];var _0x5e0f47;if(_0x38e80a>=_0x48d543){_0x38e80a=_0x48d543;_0x5e0f47=0xc8;}else{_0x5e0f47=0xce;}_0x2b394a[_0x767b('0x1f')](_0x5e0f47);return _0x2b394a[_0x767b('0x25')]('Content-Range',_0x4e5b85+'-'+_0x38e80a+'/'+_0x48d543)[_0x767b('0x20')](_0x3dafe0);}return null;};}function patchUpdates(_0x3964a4){return function(_0x281fa9){try{jsonpatch[_0x767b('0x26')](_0x281fa9,_0x3964a4,!![]);}catch(_0x28294f){return BPromise[_0x767b('0x27')](_0x28294f);}return _0x281fa9[_0x767b('0x28')]();};}function saveUpdates(_0x1134b6,_0x26a65a){return function(_0x1fa85d){if(_0x1fa85d){return _0x1fa85d[_0x767b('0x29')](_0x1134b6)['then'](function(_0x297be6){return _0x297be6;});}return null;};}function removeEntity(_0x305722,_0x487f29){return function(_0x539e86){if(_0x539e86){return _0x539e86[_0x767b('0x2a')]()[_0x767b('0x2b')](function(){_0x305722[_0x767b('0x1f')](0xcc)[_0x767b('0x2c')]();});}};}function handleEntityNotFound(_0x5a8bf1,_0xda50cf){return function(_0x8a45aa){if(!_0x8a45aa){_0x5a8bf1[_0x767b('0x1e')](0x194);}return _0x8a45aa;};}function handleError(_0x176e29,_0x41d884){_0x41d884=_0x41d884||0x1f4;return function(_0x25ddbd){logger[_0x767b('0x2d')](_0x25ddbd[_0x767b('0x2e')]);if(_0x25ddbd['name']){delete _0x25ddbd['name'];}_0x176e29[_0x767b('0x1f')](_0x41d884)[_0x767b('0x2f')](_0x25ddbd);};}exports[_0x767b('0x30')]=function(_0x188b25,_0x4e8fbd){var _0x6b5e13={},_0x2af11b={},_0x217096={'count':0x0,'rows':[]};var _0x1ace9c=_[_0x767b('0x31')](db[_0x767b('0x32')][_0x767b('0x33')],function(_0x10816f){return{'name':_0x10816f[_0x767b('0x34')],'type':_0x10816f[_0x767b('0x35')]['key']};});_0x2af11b[_0x767b('0x36')]=_[_0x767b('0x31')](_0x1ace9c,_0x767b('0x37'));_0x2af11b[_0x767b('0x38')]=_[_0x767b('0x39')](_0x188b25[_0x767b('0x38')]);_0x2af11b[_0x767b('0x3a')]=_[_0x767b('0x3b')](_0x2af11b['model'],_0x2af11b[_0x767b('0x38')]);_0x6b5e13[_0x767b('0x3c')]=_[_0x767b('0x3b')](_0x2af11b['model'],qs[_0x767b('0x3d')](_0x188b25[_0x767b('0x38')][_0x767b('0x3d')]));_0x6b5e13[_0x767b('0x3c')]=_0x6b5e13[_0x767b('0x3c')]['length']?_0x6b5e13[_0x767b('0x3c')]:_0x2af11b['model'];if(!_0x188b25[_0x767b('0x38')][_0x767b('0x3e')]('nolimit')){_0x6b5e13[_0x767b('0x23')]=qs[_0x767b('0x23')](_0x188b25['query'][_0x767b('0x23')]);_0x6b5e13[_0x767b('0x21')]=qs[_0x767b('0x21')](_0x188b25[_0x767b('0x38')][_0x767b('0x21')]);}_0x6b5e13[_0x767b('0x3f')]=qs[_0x767b('0x40')](_0x188b25[_0x767b('0x38')]['sort']);_0x6b5e13[_0x767b('0x41')]=qs[_0x767b('0x3a')](_[_0x767b('0x42')](_0x188b25['query'],_0x2af11b[_0x767b('0x3a')]),_0x1ace9c);if(_0x188b25['query'][_0x767b('0x43')]){_0x6b5e13[_0x767b('0x41')]=_['merge'](_0x6b5e13[_0x767b('0x41')],{'$or':_[_0x767b('0x31')](_0x1ace9c,function(_0x588a1a){if(_0x588a1a['type']!=='VIRTUAL'){var _0x342c1d={};_0x342c1d[_0x588a1a[_0x767b('0x37')]]={'$like':'%'+_0x188b25[_0x767b('0x38')][_0x767b('0x43')]+'%'};return _0x342c1d;}})});}_0x6b5e13=_['merge']({},_0x6b5e13,_0x188b25['options']);var _0x4a1df5={'where':_0x6b5e13[_0x767b('0x41')]};return db['DeskAccount'][_0x767b('0x24')](_0x4a1df5)['then'](function(_0x1a65ff){_0x217096[_0x767b('0x24')]=_0x1a65ff;if(_0x188b25['query'][_0x767b('0x44')]){_0x6b5e13['include']=[{'all':!![]}];}return db[_0x767b('0x32')][_0x767b('0x45')](_0x6b5e13);})[_0x767b('0x2b')](function(_0x47fa53){_0x217096[_0x767b('0x46')]=_0x47fa53;return _0x217096;})[_0x767b('0x2b')](respondWithFilteredResult(_0x4e8fbd,_0x6b5e13))[_0x767b('0x47')](handleError(_0x4e8fbd,null));};exports[_0x767b('0x48')]=function(_0xfb7732,_0xec03de){var _0x3819ff={'raw':![],'where':{'id':_0xfb7732[_0x767b('0x49')]['id']}},_0x4ac488={};_0x4ac488[_0x767b('0x36')]=_['keys'](db[_0x767b('0x32')][_0x767b('0x33')]);_0x4ac488[_0x767b('0x38')]=_[_0x767b('0x39')](_0xfb7732['query']);_0x4ac488[_0x767b('0x3a')]=_[_0x767b('0x3b')](_0x4ac488[_0x767b('0x36')],_0x4ac488['query']);_0x3819ff['attributes']=_[_0x767b('0x3b')](_0x4ac488['model'],qs[_0x767b('0x3d')](_0xfb7732[_0x767b('0x38')][_0x767b('0x3d')]));_0x3819ff[_0x767b('0x3c')]=_0x3819ff[_0x767b('0x3c')][_0x767b('0x4a')]?_0x3819ff[_0x767b('0x3c')]:_0x4ac488['model'];if(_0xfb7732[_0x767b('0x38')][_0x767b('0x44')]){_0x3819ff['include']=[{'all':!![]}];}_0x3819ff=_[_0x767b('0x4b')]({},_0x3819ff,_0xfb7732['options']);return db[_0x767b('0x32')][_0x767b('0x4c')](_0x3819ff)[_0x767b('0x2b')](handleEntityNotFound(_0xec03de,null))[_0x767b('0x2b')](respondWithResult(_0xec03de,null))[_0x767b('0x47')](handleError(_0xec03de,null));};exports[_0x767b('0x4d')]=function(_0x3c72f7,_0x2c1a8c){return db[_0x767b('0x32')]['create'](_0x3c72f7[_0x767b('0x4e')],{})[_0x767b('0x2b')](respondWithResult(_0x2c1a8c,0xc9))[_0x767b('0x47')](handleError(_0x2c1a8c,null));};exports[_0x767b('0x29')]=function(_0x1ab30e,_0x27a8f4){if(_0x1ab30e[_0x767b('0x4e')]['id']){delete _0x1ab30e[_0x767b('0x4e')]['id'];}return db[_0x767b('0x32')][_0x767b('0x4c')]({'where':{'id':_0x1ab30e[_0x767b('0x49')]['id']}})[_0x767b('0x2b')](handleEntityNotFound(_0x27a8f4,null))[_0x767b('0x2b')](saveUpdates(_0x1ab30e['body'],null))[_0x767b('0x2b')](respondWithResult(_0x27a8f4,null))[_0x767b('0x47')](handleError(_0x27a8f4,null));};exports['destroy']=function(_0x56a089,_0x335a42){return db[_0x767b('0x32')][_0x767b('0x4c')]({'where':{'id':_0x56a089[_0x767b('0x49')]['id']}})[_0x767b('0x2b')](handleEntityNotFound(_0x335a42,null))[_0x767b('0x2b')](removeEntity(_0x335a42,null))['catch'](handleError(_0x335a42,null));};exports[_0x767b('0x4f')]=function(_0x509db1,_0xcd7ebe,_0x189e23){var _0x2169d0={};var _0x5b9242={};var _0x445869;var _0x39fc86;return db['DeskAccount'][_0x767b('0x50')]({'where':{'id':_0x509db1['params']['id']}})[_0x767b('0x2b')](handleEntityNotFound(_0xcd7ebe,null))['then'](function(_0x2d65c8){if(_0x2d65c8){_0x445869=_0x2d65c8;_0x5b9242[_0x767b('0x36')]=_[_0x767b('0x39')](db[_0x767b('0x51')][_0x767b('0x33')]);_0x5b9242[_0x767b('0x38')]=_[_0x767b('0x39')](_0x509db1['query']);_0x5b9242['filters']=_['intersection'](_0x5b9242[_0x767b('0x36')],_0x5b9242['query']);_0x2169d0['attributes']=_[_0x767b('0x3b')](_0x5b9242['model'],qs[_0x767b('0x3d')](_0x509db1[_0x767b('0x38')][_0x767b('0x3d')]));_0x2169d0['attributes']=_0x2169d0['attributes']['length']?_0x2169d0['attributes']:_0x5b9242['model'];_0x2169d0[_0x767b('0x3f')]=qs[_0x767b('0x40')](_0x509db1[_0x767b('0x38')][_0x767b('0x40')]);_0x2169d0['where']=qs[_0x767b('0x3a')](_[_0x767b('0x42')](_0x509db1['query'],_0x5b9242[_0x767b('0x3a')]));if(_0x509db1[_0x767b('0x38')][_0x767b('0x43')]){_0x2169d0[_0x767b('0x41')]=_[_0x767b('0x4b')](_0x2169d0[_0x767b('0x41')],{'$or':_[_0x767b('0x31')](_0x2169d0[_0x767b('0x3c')],function(_0x2756b2){var _0x209a56={};_0x209a56[_0x2756b2]={'$like':'%'+_0x509db1[_0x767b('0x38')][_0x767b('0x43')]+'%'};return _0x209a56;})});}_0x2169d0=_[_0x767b('0x4b')]({},_0x2169d0,_0x509db1['options']);return _0x445869[_0x767b('0x4f')](_0x2169d0);}})[_0x767b('0x2b')](function(_0x13ad82){if(_0x13ad82){_0x39fc86=_0x13ad82[_0x767b('0x4a')];if(!_0x509db1[_0x767b('0x38')][_0x767b('0x3e')](_0x767b('0x52'))){_0x2169d0[_0x767b('0x23')]=qs['limit'](_0x509db1[_0x767b('0x38')]['limit']);_0x2169d0['offset']=qs[_0x767b('0x21')](_0x509db1[_0x767b('0x38')][_0x767b('0x21')]);}return _0x445869[_0x767b('0x4f')](_0x2169d0);}})['then'](function(_0x49fb86){if(_0x49fb86){return _0x49fb86?{'count':_0x39fc86,'rows':_0x49fb86}:null;}})[_0x767b('0x2b')](respondWithResult(_0xcd7ebe,null))[_0x767b('0x47')](handleError(_0xcd7ebe,null));};exports[_0x767b('0x53')]=function(_0x2f6f65,_0x424aab,_0x100d0c){if(_0x2f6f65[_0x767b('0x4e')]['id']){delete _0x2f6f65['body']['id'];}return db[_0x767b('0x32')][_0x767b('0x50')]({'where':{'id':_0x2f6f65[_0x767b('0x49')]['id']}})[_0x767b('0x2b')](handleEntityNotFound(_0x424aab,null))[_0x767b('0x2b')](function(_0x486f5d){if(_0x486f5d){_0x2f6f65[_0x767b('0x4e')][_0x767b('0x54')]=_0x486f5d['id'];_0x2f6f65['body'][_0x767b('0x55')]=integrations[_0x767b('0x56')](_0x2f6f65[_0x767b('0x4e')][_0x767b('0x57')],_0x2f6f65['body'][_0x767b('0x35')]);_0x2f6f65[_0x767b('0x4e')][_0x767b('0x58')]=integrations['getDescriptions'](_0x2f6f65['body']['channel'],_0x2f6f65[_0x767b('0x4e')][_0x767b('0x35')]);return db['DeskConfiguration'][_0x767b('0x4d')](_0x2f6f65[_0x767b('0x4e')],{'include':[{'model':db[_0x767b('0x59')],'as':_0x767b('0x55')},{'model':db[_0x767b('0x59')],'as':'Descriptions'}]});}return null;})[_0x767b('0x2b')](respondWithResult(_0x424aab,null))[_0x767b('0x47')](handleError(_0x424aab,null));};exports['getFields']=function(_0x413745,_0x180bde,_0x9ebc76){var _0x1e7cbc=[{'name':_0x767b('0x5a'),'label':_0x767b('0x5a'),'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 _0x261c73='';return db[_0x767b('0x32')][_0x767b('0x50')]({'where':{'id':_0x413745['params']['id']},'attributes':['id',_0x767b('0x5b'),_0x767b('0x5c'),_0x767b('0x5d'),_0x767b('0x5e'),_0x767b('0x5f'),_0x767b('0x60'),_0x767b('0x61'),_0x767b('0x62')]})[_0x767b('0x2b')](handleEntityNotFound(_0x180bde,null))[_0x767b('0x2b')](function(_0x3396fc){if(_0x3396fc){_0x261c73=_0x3396fc[_0x767b('0x5b')];var _0x54bacc=_0x261c73['slice'](-0x1);if(_0x54bacc==='/'){_0x261c73=_0x261c73[_0x767b('0x63')](0x0,_0x261c73[_0x767b('0x64')](_0x54bacc));}var _0x21e3cc={'method':'GET','uri':util[_0x767b('0x65')](_0x767b('0x66'),_0x261c73),'headers':{'Content-Type':_0x767b('0x67'),'Accept':_0x767b('0x67')},'json':!![]};if(_0x3396fc[_0x767b('0x5c')]===_0x767b('0x68')){_0x21e3cc['headers'][_0x767b('0x69')]=util[_0x767b('0x65')](_0x767b('0x6a'),new Buffer(util[_0x767b('0x65')](_0x767b('0x6b'),_0x3396fc[_0x767b('0x5d')],_0x3396fc[_0x767b('0x5e')]))[_0x767b('0x6c')](_0x767b('0x6d')));}return rp(_0x21e3cc)[_0x767b('0x2b')](function(_0x450695){return _0x1e7cbc[_0x767b('0x6e')](_['map'](_0x450695[_0x767b('0x6f')][_0x767b('0x70')],function(_0x4df549){return{'id':_0x4df549[_0x767b('0x37')],'name':_0x4df549[_0x767b('0x37')],'type':_0x4df549[_0x767b('0x35')],'active':_0x4df549[_0x767b('0x71')],'label':_0x4df549[_0x767b('0x72')],'custom':!![]};}));});}})[_0x767b('0x2b')](function(_0x37393a){return{'count':_0x37393a[_0x767b('0x4a')],'rows':_0x37393a};})[_0x767b('0x2b')](respondWithResult(_0x180bde,null))[_0x767b('0x47')](function(_0x5c3920){var _0x36fb6c=_0x413745[_0x767b('0x38')][_0x767b('0x73')]?0x1f4:_0x5c3920[_0x767b('0x74')]||0x1f4;logger['error'](_0x767b('0x75'),_0x767b('0x76'),_0x36fb6c,JSON[_0x767b('0x77')](_0x5c3920));delete _0x5c3920[_0x767b('0x37')];if(_0x36fb6c===0x191){_0x36fb6c=0x190;}_0x180bde[_0x767b('0x1f')](_0x36fb6c)[_0x767b('0x2f')](_0x413745[_0x767b('0x38')][_0x767b('0x73')]?{'message':'Wrong\x20credentials','statusCode':_0x5c3920['statusCode']}:_0x5c3920);});}; \ No newline at end of file +var _0x8248=['querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','name','send','index','map','DeskAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','getConfigurations','pick','findOne','AccountId','Subjects','channel','DeskConfiguration','DeskField','Descriptions','remoteUri','password','consumerKey','consumerSecret','token','tokenSecret','GET','format','%s/custom_fields','application/json','authType','Authorization','Basic\x20%s','username','toString','base64','_embedded','entries','active','test','statusCode','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','path','to-csv','ejs','squel','crypto','desk.js'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x8248,0x195));var _0x8824=function(_0xc66461,_0x38bf3c){_0xc66461=_0xc66461-0x0;var _0x17a69a=_0x8248[_0xc66461];return _0x17a69a;};'use strict';var emlformat=require(_0x8824('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8824('0x1'));var jsonpatch=require(_0x8824('0x2'));var rp=require(_0x8824('0x3'));var moment=require('moment');var BPromise=require(_0x8824('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8824('0x5'));var sox=require('sox');var csv=require(_0x8824('0x6'));var ejs=require(_0x8824('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8824('0x8'));var crypto=require(_0x8824('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x8824('0xa'));var toCsv=require(_0x8824('0x6'));var querystring=require(_0x8824('0xb'));var Papa=require(_0x8824('0xc'));var Redis=require('ioredis');var authService=require(_0x8824('0xd'));var qs=require(_0x8824('0xe'));var as=require(_0x8824('0xf'));var hardwareService=require(_0x8824('0x10'));var logger=require('../../config/logger')(_0x8824('0x11'));var utils=require(_0x8824('0x12'));var config=require(_0x8824('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x8824('0x14'));function respondWithStatusCode(_0x457d3b,_0x156f05){_0x156f05=_0x156f05||0xcc;return function(_0x512d0b){if(_0x512d0b){return _0x457d3b[_0x8824('0x15')](_0x156f05);}return _0x457d3b[_0x8824('0x16')](_0x156f05)[_0x8824('0x17')]();};}function respondWithResult(_0x117ea5,_0x4de93f){_0x4de93f=_0x4de93f||0xc8;return function(_0x44898a){if(_0x44898a){return _0x117ea5[_0x8824('0x16')](_0x4de93f)[_0x8824('0x18')](_0x44898a);}};}function respondWithFilteredResult(_0x928808,_0x10cbfa){return function(_0x486f35){if(_0x486f35){var _0x13ba08=typeof _0x10cbfa[_0x8824('0x19')]==='undefined'&&typeof _0x10cbfa['limit']===_0x8824('0x1a');var _0x5e8ad1=_0x486f35[_0x8824('0x1b')];var _0xbd941e=_0x13ba08?0x0:_0x10cbfa[_0x8824('0x19')];var _0x3e5d89=_0x13ba08?_0x486f35['count']:_0x10cbfa[_0x8824('0x19')]+_0x10cbfa['limit'];var _0x403219;if(_0x3e5d89>=_0x5e8ad1){_0x3e5d89=_0x5e8ad1;_0x403219=0xc8;}else{_0x403219=0xce;}_0x928808['status'](_0x403219);return _0x928808[_0x8824('0x1c')](_0x8824('0x1d'),_0xbd941e+'-'+_0x3e5d89+'/'+_0x5e8ad1)[_0x8824('0x18')](_0x486f35);}return null;};}function patchUpdates(_0x2d1d0a){return function(_0x31f40e){try{jsonpatch[_0x8824('0x1e')](_0x31f40e,_0x2d1d0a,!![]);}catch(_0x3ab2de){return BPromise['reject'](_0x3ab2de);}return _0x31f40e[_0x8824('0x1f')]();};}function saveUpdates(_0x5bf7b3,_0x20ec44){return function(_0x88c93e){if(_0x88c93e){return _0x88c93e[_0x8824('0x20')](_0x5bf7b3)[_0x8824('0x21')](function(_0x44bae7){return _0x44bae7;});}return null;};}function removeEntity(_0x392fdf,_0x2d7f0b){return function(_0x4abe77){if(_0x4abe77){return _0x4abe77[_0x8824('0x22')]()[_0x8824('0x21')](function(){_0x392fdf[_0x8824('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x236edb,_0x3797f7){return function(_0x2d474f){if(!_0x2d474f){_0x236edb[_0x8824('0x15')](0x194);}return _0x2d474f;};}function handleError(_0x731cff,_0xdbcb64){_0xdbcb64=_0xdbcb64||0x1f4;return function(_0xee2365){logger[_0x8824('0x23')](_0xee2365['stack']);if(_0xee2365['name']){delete _0xee2365[_0x8824('0x24')];}_0x731cff['status'](_0xdbcb64)[_0x8824('0x25')](_0xee2365);};}exports[_0x8824('0x26')]=function(_0x3738b6,_0x3efd58){var _0x562556={},_0x55a680={},_0x3fb465={'count':0x0,'rows':[]};var _0x4dc01=_[_0x8824('0x27')](db[_0x8824('0x28')][_0x8824('0x29')],function(_0x456a99){return{'name':_0x456a99[_0x8824('0x2a')],'type':_0x456a99[_0x8824('0x2b')][_0x8824('0x2c')]};});_0x55a680[_0x8824('0x2d')]=_[_0x8824('0x27')](_0x4dc01,'name');_0x55a680[_0x8824('0x2e')]=_[_0x8824('0x2f')](_0x3738b6['query']);_0x55a680[_0x8824('0x30')]=_[_0x8824('0x31')](_0x55a680['model'],_0x55a680[_0x8824('0x2e')]);_0x562556[_0x8824('0x32')]=_[_0x8824('0x31')](_0x55a680[_0x8824('0x2d')],qs['fields'](_0x3738b6[_0x8824('0x2e')][_0x8824('0x33')]));_0x562556[_0x8824('0x32')]=_0x562556['attributes'][_0x8824('0x34')]?_0x562556[_0x8824('0x32')]:_0x55a680[_0x8824('0x2d')];if(!_0x3738b6[_0x8824('0x2e')][_0x8824('0x35')](_0x8824('0x36'))){_0x562556[_0x8824('0x37')]=qs[_0x8824('0x37')](_0x3738b6[_0x8824('0x2e')][_0x8824('0x37')]);_0x562556[_0x8824('0x19')]=qs[_0x8824('0x19')](_0x3738b6['query'][_0x8824('0x19')]);}_0x562556[_0x8824('0x38')]=qs[_0x8824('0x39')](_0x3738b6[_0x8824('0x2e')][_0x8824('0x39')]);_0x562556[_0x8824('0x3a')]=qs[_0x8824('0x30')](_['pick'](_0x3738b6[_0x8824('0x2e')],_0x55a680[_0x8824('0x30')]),_0x4dc01);if(_0x3738b6[_0x8824('0x2e')][_0x8824('0x3b')]){_0x562556[_0x8824('0x3a')]=_['merge'](_0x562556[_0x8824('0x3a')],{'$or':_[_0x8824('0x27')](_0x4dc01,function(_0x1eabb7){if(_0x1eabb7['type']!==_0x8824('0x3c')){var _0x50d226={};_0x50d226[_0x1eabb7[_0x8824('0x24')]]={'$like':'%'+_0x3738b6[_0x8824('0x2e')]['filter']+'%'};return _0x50d226;}})});}_0x562556=_[_0x8824('0x3d')]({},_0x562556,_0x3738b6['options']);var _0x5bf019={'where':_0x562556['where']};return db[_0x8824('0x28')]['count'](_0x5bf019)[_0x8824('0x21')](function(_0x4a9376){_0x3fb465['count']=_0x4a9376;if(_0x3738b6['query'][_0x8824('0x3e')]){_0x562556[_0x8824('0x3f')]=[{'all':!![]}];}return db[_0x8824('0x28')][_0x8824('0x40')](_0x562556);})[_0x8824('0x21')](function(_0x2ed006){_0x3fb465[_0x8824('0x41')]=_0x2ed006;return _0x3fb465;})[_0x8824('0x21')](respondWithFilteredResult(_0x3efd58,_0x562556))[_0x8824('0x42')](handleError(_0x3efd58,null));};exports[_0x8824('0x43')]=function(_0xfa2dc4,_0x594e4b){var _0xeafec9={'raw':![],'where':{'id':_0xfa2dc4[_0x8824('0x44')]['id']}},_0x113433={};_0x113433['model']=_['keys'](db['DeskAccount'][_0x8824('0x29')]);_0x113433[_0x8824('0x2e')]=_[_0x8824('0x2f')](_0xfa2dc4[_0x8824('0x2e')]);_0x113433[_0x8824('0x30')]=_[_0x8824('0x31')](_0x113433[_0x8824('0x2d')],_0x113433[_0x8824('0x2e')]);_0xeafec9[_0x8824('0x32')]=_[_0x8824('0x31')](_0x113433[_0x8824('0x2d')],qs[_0x8824('0x33')](_0xfa2dc4[_0x8824('0x2e')]['fields']));_0xeafec9['attributes']=_0xeafec9['attributes'][_0x8824('0x34')]?_0xeafec9[_0x8824('0x32')]:_0x113433[_0x8824('0x2d')];if(_0xfa2dc4[_0x8824('0x2e')][_0x8824('0x3e')]){_0xeafec9['include']=[{'all':!![]}];}_0xeafec9=_['merge']({},_0xeafec9,_0xfa2dc4[_0x8824('0x45')]);return db[_0x8824('0x28')][_0x8824('0x46')](_0xeafec9)['then'](handleEntityNotFound(_0x594e4b,null))[_0x8824('0x21')](respondWithResult(_0x594e4b,null))[_0x8824('0x42')](handleError(_0x594e4b,null));};exports[_0x8824('0x47')]=function(_0x23c011,_0x4f713e){return db[_0x8824('0x28')][_0x8824('0x47')](_0x23c011[_0x8824('0x48')],{})[_0x8824('0x21')](respondWithResult(_0x4f713e,0xc9))[_0x8824('0x42')](handleError(_0x4f713e,null));};exports[_0x8824('0x20')]=function(_0x507704,_0x555664){if(_0x507704[_0x8824('0x48')]['id']){delete _0x507704[_0x8824('0x48')]['id'];}return db[_0x8824('0x28')]['find']({'where':{'id':_0x507704[_0x8824('0x44')]['id']}})[_0x8824('0x21')](handleEntityNotFound(_0x555664,null))['then'](saveUpdates(_0x507704[_0x8824('0x48')],null))[_0x8824('0x21')](respondWithResult(_0x555664,null))[_0x8824('0x42')](handleError(_0x555664,null));};exports[_0x8824('0x22')]=function(_0x1b7d21,_0x114a50){return db['DeskAccount'][_0x8824('0x46')]({'where':{'id':_0x1b7d21[_0x8824('0x44')]['id']}})[_0x8824('0x21')](handleEntityNotFound(_0x114a50,null))[_0x8824('0x21')](removeEntity(_0x114a50,null))[_0x8824('0x42')](handleError(_0x114a50,null));};exports[_0x8824('0x49')]=function(_0x5d4405,_0x2aa90e,_0x7f0e8e){var _0x4ab1a6={};var _0x2760d6={};var _0x11bc3c;var _0x196e43;return db[_0x8824('0x28')]['findOne']({'where':{'id':_0x5d4405[_0x8824('0x44')]['id']}})['then'](handleEntityNotFound(_0x2aa90e,null))[_0x8824('0x21')](function(_0x130587){if(_0x130587){_0x11bc3c=_0x130587;_0x2760d6[_0x8824('0x2d')]=_[_0x8824('0x2f')](db['DeskConfiguration']['rawAttributes']);_0x2760d6[_0x8824('0x2e')]=_[_0x8824('0x2f')](_0x5d4405['query']);_0x2760d6[_0x8824('0x30')]=_['intersection'](_0x2760d6[_0x8824('0x2d')],_0x2760d6['query']);_0x4ab1a6['attributes']=_[_0x8824('0x31')](_0x2760d6[_0x8824('0x2d')],qs[_0x8824('0x33')](_0x5d4405[_0x8824('0x2e')][_0x8824('0x33')]));_0x4ab1a6[_0x8824('0x32')]=_0x4ab1a6[_0x8824('0x32')]['length']?_0x4ab1a6[_0x8824('0x32')]:_0x2760d6[_0x8824('0x2d')];_0x4ab1a6[_0x8824('0x38')]=qs[_0x8824('0x39')](_0x5d4405[_0x8824('0x2e')]['sort']);_0x4ab1a6['where']=qs[_0x8824('0x30')](_[_0x8824('0x4a')](_0x5d4405[_0x8824('0x2e')],_0x2760d6[_0x8824('0x30')]));if(_0x5d4405[_0x8824('0x2e')][_0x8824('0x3b')]){_0x4ab1a6[_0x8824('0x3a')]=_['merge'](_0x4ab1a6['where'],{'$or':_['map'](_0x4ab1a6['attributes'],function(_0x435cdb){var _0x134724={};_0x134724[_0x435cdb]={'$like':'%'+_0x5d4405[_0x8824('0x2e')][_0x8824('0x3b')]+'%'};return _0x134724;})});}_0x4ab1a6=_['merge']({},_0x4ab1a6,_0x5d4405[_0x8824('0x45')]);return _0x11bc3c[_0x8824('0x49')](_0x4ab1a6);}})[_0x8824('0x21')](function(_0x50a5a0){if(_0x50a5a0){_0x196e43=_0x50a5a0[_0x8824('0x34')];if(!_0x5d4405[_0x8824('0x2e')][_0x8824('0x35')]('nolimit')){_0x4ab1a6[_0x8824('0x37')]=qs['limit'](_0x5d4405[_0x8824('0x2e')]['limit']);_0x4ab1a6[_0x8824('0x19')]=qs['offset'](_0x5d4405[_0x8824('0x2e')][_0x8824('0x19')]);}return _0x11bc3c['getConfigurations'](_0x4ab1a6);}})[_0x8824('0x21')](function(_0x582b67){if(_0x582b67){return _0x582b67?{'count':_0x196e43,'rows':_0x582b67}:null;}})[_0x8824('0x21')](respondWithResult(_0x2aa90e,null))['catch'](handleError(_0x2aa90e,null));};exports['addConfiguration']=function(_0x469a17,_0x352246,_0x24faa1){if(_0x469a17[_0x8824('0x48')]['id']){delete _0x469a17[_0x8824('0x48')]['id'];}return db[_0x8824('0x28')][_0x8824('0x4b')]({'where':{'id':_0x469a17[_0x8824('0x44')]['id']}})[_0x8824('0x21')](handleEntityNotFound(_0x352246,null))['then'](function(_0x7aba61){if(_0x7aba61){_0x469a17['body'][_0x8824('0x4c')]=_0x7aba61['id'];_0x469a17[_0x8824('0x48')][_0x8824('0x4d')]=integrations['getSubjects'](_0x469a17[_0x8824('0x48')][_0x8824('0x4e')],_0x469a17['body']['type']);_0x469a17[_0x8824('0x48')]['Descriptions']=integrations['getDescriptions'](_0x469a17['body'][_0x8824('0x4e')],_0x469a17['body']['type']);return db[_0x8824('0x4f')][_0x8824('0x47')](_0x469a17[_0x8824('0x48')],{'include':[{'model':db['DeskField'],'as':_0x8824('0x4d')},{'model':db[_0x8824('0x50')],'as':_0x8824('0x51')}]});}return null;})[_0x8824('0x21')](respondWithResult(_0x352246,null))[_0x8824('0x42')](handleError(_0x352246,null));};exports['getFields']=function(_0x264d34,_0x66a46c,_0x1dd140){var _0x33d178=[{'name':'priority','label':'priority','custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x28f8cd='';return db[_0x8824('0x28')][_0x8824('0x4b')]({'where':{'id':_0x264d34[_0x8824('0x44')]['id']},'attributes':['id',_0x8824('0x52'),'authType','username',_0x8824('0x53'),_0x8824('0x54'),_0x8824('0x55'),_0x8824('0x56'),_0x8824('0x57')]})['then'](handleEntityNotFound(_0x66a46c,null))['then'](function(_0x491135){if(_0x491135){_0x28f8cd=_0x491135[_0x8824('0x52')];var _0x3f4fa2=_0x28f8cd['slice'](-0x1);if(_0x3f4fa2==='/'){_0x28f8cd=_0x28f8cd['substring'](0x0,_0x28f8cd['lastIndexOf'](_0x3f4fa2));}var _0x461b57={'method':_0x8824('0x58'),'uri':util[_0x8824('0x59')](_0x8824('0x5a'),_0x28f8cd),'headers':{'Content-Type':_0x8824('0x5b'),'Accept':_0x8824('0x5b')},'json':!![]};if(_0x491135[_0x8824('0x5c')]==='basic'){_0x461b57['headers'][_0x8824('0x5d')]=util[_0x8824('0x59')](_0x8824('0x5e'),new Buffer(util[_0x8824('0x59')]('%s:%s',_0x491135[_0x8824('0x5f')],_0x491135[_0x8824('0x53')]))[_0x8824('0x60')](_0x8824('0x61')));}return rp(_0x461b57)[_0x8824('0x21')](function(_0x89c072){return _0x33d178['concat'](_[_0x8824('0x27')](_0x89c072[_0x8824('0x62')][_0x8824('0x63')],function(_0x1af7fb){return{'id':_0x1af7fb[_0x8824('0x24')],'name':_0x1af7fb[_0x8824('0x24')],'type':_0x1af7fb[_0x8824('0x2b')],'active':_0x1af7fb[_0x8824('0x64')],'label':_0x1af7fb['label'],'custom':!![]};}));});}})[_0x8824('0x21')](function(_0x5ebc86){return{'count':_0x5ebc86[_0x8824('0x34')],'rows':_0x5ebc86};})[_0x8824('0x21')](respondWithResult(_0x66a46c,null))[_0x8824('0x42')](function(_0x2f8492){var _0x155cf3=_0x264d34[_0x8824('0x2e')][_0x8824('0x65')]?0x1f4:_0x2f8492[_0x8824('0x66')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x155cf3,JSON['stringify'](_0x2f8492));delete _0x2f8492[_0x8824('0x24')];if(_0x155cf3===0x191){_0x155cf3=0x190;}_0x66a46c[_0x8824('0x16')](_0x155cf3)[_0x8824('0x25')](_0x264d34['query']['test']?{'message':_0x8824('0x67'),'statusCode':_0x2f8492[_0x8824('0x66')]}:_0x2f8492);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 59127d1..1928638 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 _0x20d3=['int_desk_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskAccount.attributes','exports','define','DeskAccount'];(function(_0x74eed7,_0x36526c){var _0x2665e9=function(_0x2abdb0){while(--_0x2abdb0){_0x74eed7['push'](_0x74eed7['shift']());}};_0x2665e9(++_0x36526c);}(_0x20d3,0x10b));var _0x320d=function(_0xee6740,_0x872f44){_0xee6740=_0xee6740-0x0;var _0x5cec84=_0x20d3[_0xee6740];return _0x5cec84;};'use strict';var _=require(_0x320d('0x0'));var util=require(_0x320d('0x1'));var logger=require(_0x320d('0x2'))(_0x320d('0x3'));var moment=require('moment');var BPromise=require(_0x320d('0x4'));var rp=require(_0x320d('0x5'));var fs=require('fs');var path=require(_0x320d('0x6'));var rimraf=require(_0x320d('0x7'));var config=require(_0x320d('0x8'));var attributes=require(_0x320d('0x9'));var integrations=require('../../components/integrations/configuration');module[_0x320d('0xa')]=function(_0xeeae7c,_0x48c1db){return _0xeeae7c[_0x320d('0xb')](_0x320d('0xc'),attributes,{'tableName':_0x320d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5493=['api','bluebird','request-promise','path','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','DeskAccount','int_desk_accounts','lodash','util','../../config/logger'];(function(_0x35d59c,_0x252c26){var _0x2db571=function(_0x51b039){while(--_0x51b039){_0x35d59c['push'](_0x35d59c['shift']());}};_0x2db571(++_0x252c26);}(_0x5493,0x101));var _0x3549=function(_0x5aca54,_0x5d4def){_0x5aca54=_0x5aca54-0x0;var _0x2a0610=_0x5493[_0x5aca54];return _0x2a0610;};'use strict';var _=require(_0x3549('0x0'));var util=require(_0x3549('0x1'));var logger=require(_0x3549('0x2'))(_0x3549('0x3'));var moment=require('moment');var BPromise=require(_0x3549('0x4'));var rp=require(_0x3549('0x5'));var fs=require('fs');var path=require(_0x3549('0x6'));var rimraf=require('rimraf');var config=require(_0x3549('0x7'));var attributes=require(_0x3549('0x8'));var integrations=require(_0x3549('0x9'));module[_0x3549('0xa')]=function(_0x571858,_0x57b20c){return _0x571858['define'](_0x3549('0xb'),attributes,{'tableName':_0x3549('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 1a53d16..35c1225 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 _0xe020=['request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetDeskAccount','DeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowDeskAccount','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','DeskAccount,\x20%s,\x20%s'];(function(_0x2d604d,_0x51a1f5){var _0x159761=function(_0x26d263){while(--_0x26d263){_0x2d604d['push'](_0x2d604d['shift']());}};_0x159761(++_0x51a1f5);}(_0xe020,0x15a));var _0x0e02=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xe020[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x0e02('0x0'));var util=require('util');var moment=require(_0x0e02('0x1'));var BPromise=require(_0x0e02('0x2'));var rs=require(_0x0e02('0x3'));var fs=require('fs');var Redis=require(_0x0e02('0x4'));var db=require(_0x0e02('0x5'))['db'];var utils=require(_0x0e02('0x6'));var logger=require(_0x0e02('0x7'))(_0x0e02('0x8'));var config=require('../../config/environment');var jayson=require(_0x0e02('0x9'));var client=jayson[_0x0e02('0xa')][_0x0e02('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a2824,_0x195743,_0x51d0d8){return new BPromise(function(_0x88e44c,_0x1f18fa){return client['request'](_0x1a2824,_0x51d0d8)[_0x0e02('0xc')](function(_0x43027f){logger['info'](_0x0e02('0xd'),_0x195743,_0x0e02('0xe'));logger[_0x0e02('0xf')](_0x0e02('0x10'),_0x195743,_0x0e02('0xe'),JSON[_0x0e02('0x11')](_0x43027f));if(_0x43027f[_0x0e02('0x12')]){if(_0x43027f[_0x0e02('0x12')][_0x0e02('0x13')]===0x1f4){logger[_0x0e02('0x12')](_0x0e02('0xd'),_0x195743,_0x43027f['error'][_0x0e02('0x14')]);return _0x1f18fa(_0x43027f[_0x0e02('0x12')][_0x0e02('0x14')]);}logger[_0x0e02('0x12')](_0x0e02('0xd'),_0x195743,_0x43027f['error'][_0x0e02('0x14')]);return _0x88e44c(_0x43027f[_0x0e02('0x12')][_0x0e02('0x14')]);}else{logger[_0x0e02('0x15')](_0x0e02('0xd'),_0x195743,'request\x20sent');_0x88e44c(_0x43027f[_0x0e02('0x16')][_0x0e02('0x14')]);}})[_0x0e02('0x17')](function(_0xc06b12){logger[_0x0e02('0x12')](_0x0e02('0xd'),_0x195743,_0xc06b12);_0x1f18fa(_0xc06b12);});});}exports[_0x0e02('0x18')]=function(_0x36434e){var _0x2df7c8=this;return new Promise(function(_0x417ac1,_0x5c3486){return db[_0x0e02('0x19')][_0x0e02('0x1a')]({'raw':_0x36434e[_0x0e02('0x1b')]?_0x36434e[_0x0e02('0x1b')][_0x0e02('0x1c')]===undefined?!![]:![]:!![],'where':_0x36434e[_0x0e02('0x1b')]?_0x36434e['options'][_0x0e02('0x1d')]||null:null,'attributes':_0x36434e['options']?_0x36434e[_0x0e02('0x1b')][_0x0e02('0x1e')]||null:null,'limit':_0x36434e['options']?_0x36434e[_0x0e02('0x1b')][_0x0e02('0x1f')]||null:null,'include':_0x36434e['options']?_0x36434e[_0x0e02('0x1b')][_0x0e02('0x20')]?_[_0x0e02('0x21')](_0x36434e[_0x0e02('0x1b')][_0x0e02('0x20')],function(_0x3a2cab){return{'model':db[_0x3a2cab['model']],'as':_0x3a2cab['as'],'attributes':_0x3a2cab[_0x0e02('0x1e')],'include':_0x3a2cab['include']?_[_0x0e02('0x21')](_0x3a2cab[_0x0e02('0x20')],function(_0x265167){return{'model':db[_0x265167[_0x0e02('0x22')]],'as':_0x265167['as'],'attributes':_0x265167[_0x0e02('0x1e')],'include':_0x265167[_0x0e02('0x20')]?_['map'](_0x265167['include'],function(_0x5f5c74){return{'model':db[_0x5f5c74[_0x0e02('0x22')]],'as':_0x5f5c74['as'],'attributes':_0x5f5c74[_0x0e02('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0e02('0xc')](function(_0x2511a0){logger['info'](_0x0e02('0x18'),_0x36434e);logger['debug']('GetDeskAccount',_0x36434e,JSON['stringify'](_0x2511a0));_0x417ac1(_0x2511a0);})[_0x0e02('0x17')](function(_0x32f5c7){logger[_0x0e02('0x12')](_0x0e02('0x18'),_0x32f5c7['message'],_0x36434e);_0x5c3486(_0x2df7c8['error'](0x1f4,_0x32f5c7[_0x0e02('0x14')]));});});};exports[_0x0e02('0x23')]=function(_0x3dc12f){var _0x39ce0d=this;return new Promise(function(_0x54d41b,_0x12a94c){return db[_0x0e02('0x19')]['find']({'raw':_0x3dc12f[_0x0e02('0x1b')]?_0x3dc12f[_0x0e02('0x1b')][_0x0e02('0x1c')]===undefined?!![]:![]:!![],'where':_0x3dc12f['options']?_0x3dc12f[_0x0e02('0x1b')]['where']||null:null,'attributes':_0x3dc12f['options']?_0x3dc12f['options'][_0x0e02('0x1e')]||null:null,'include':_0x3dc12f[_0x0e02('0x1b')]?_0x3dc12f[_0x0e02('0x1b')][_0x0e02('0x20')]?_['map'](_0x3dc12f['options'][_0x0e02('0x20')],function(_0x23df76){return{'model':db[_0x23df76[_0x0e02('0x22')]],'as':_0x23df76['as'],'attributes':_0x23df76[_0x0e02('0x1e')],'include':_0x23df76[_0x0e02('0x20')]?_[_0x0e02('0x21')](_0x23df76['include'],function(_0x46cd33){return{'model':db[_0x46cd33[_0x0e02('0x22')]],'as':_0x46cd33['as'],'attributes':_0x46cd33['attributes'],'include':_0x46cd33['include']?_[_0x0e02('0x21')](_0x46cd33[_0x0e02('0x20')],function(_0x2ac133){return{'model':db[_0x2ac133[_0x0e02('0x22')]],'as':_0x2ac133['as'],'attributes':_0x2ac133[_0x0e02('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0e02('0xc')](function(_0x3e74bf){logger[_0x0e02('0x15')](_0x0e02('0x23'),_0x3dc12f);logger[_0x0e02('0xf')]('ShowDeskAccount',_0x3dc12f,JSON[_0x0e02('0x11')](_0x3e74bf));_0x54d41b(_0x3e74bf);})[_0x0e02('0x17')](function(_0x991dc4){logger[_0x0e02('0x12')](_0x0e02('0x23'),_0x991dc4[_0x0e02('0x14')],_0x3dc12f);_0x12a94c(_0x39ce0d[_0x0e02('0x12')](0x1f4,_0x991dc4[_0x0e02('0x14')]));});});}; \ No newline at end of file +var _0xf58c=['http','request','then','info','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','error','code','DeskAccount,\x20%s,\x20%s','message','result','catch','GetDeskAccount','DeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowDeskAccount','find','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x1a8132,_0x1d4978){var _0x5b9329=function(_0x1f1447){while(--_0x1f1447){_0x1a8132['push'](_0x1a8132['shift']());}};_0x5b9329(++_0x1d4978);}(_0xf58c,0x14b));var _0xcf58=function(_0x256e32,_0x4013bc){_0x256e32=_0x256e32-0x0;var _0x464070=_0xf58c[_0x256e32];return _0x464070;};'use strict';var _=require(_0xcf58('0x0'));var util=require(_0xcf58('0x1'));var moment=require(_0xcf58('0x2'));var BPromise=require(_0xcf58('0x3'));var rs=require(_0xcf58('0x4'));var fs=require('fs');var Redis=require(_0xcf58('0x5'));var db=require(_0xcf58('0x6'))['db'];var utils=require(_0xcf58('0x7'));var logger=require(_0xcf58('0x8'))(_0xcf58('0x9'));var config=require(_0xcf58('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0xcf58('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5ab626,_0x4ee03b,_0x4d00c4){return new BPromise(function(_0x2af9ae,_0x1e638f){return client[_0xcf58('0xc')](_0x5ab626,_0x4d00c4)[_0xcf58('0xd')](function(_0x406393){logger[_0xcf58('0xe')]('DeskAccount,\x20%s,\x20%s',_0x4ee03b,_0xcf58('0xf'));logger[_0xcf58('0x10')](_0xcf58('0x11'),_0x4ee03b,_0xcf58('0xf'),JSON['stringify'](_0x406393));if(_0x406393[_0xcf58('0x12')]){if(_0x406393['error'][_0xcf58('0x13')]===0x1f4){logger[_0xcf58('0x12')](_0xcf58('0x14'),_0x4ee03b,_0x406393['error'][_0xcf58('0x15')]);return _0x1e638f(_0x406393[_0xcf58('0x12')][_0xcf58('0x15')]);}logger[_0xcf58('0x12')](_0xcf58('0x14'),_0x4ee03b,_0x406393[_0xcf58('0x12')][_0xcf58('0x15')]);return _0x2af9ae(_0x406393[_0xcf58('0x12')][_0xcf58('0x15')]);}else{logger[_0xcf58('0xe')](_0xcf58('0x14'),_0x4ee03b,_0xcf58('0xf'));_0x2af9ae(_0x406393[_0xcf58('0x16')][_0xcf58('0x15')]);}})[_0xcf58('0x17')](function(_0x15b51e){logger[_0xcf58('0x12')]('DeskAccount,\x20%s,\x20%s',_0x4ee03b,_0x15b51e);_0x1e638f(_0x15b51e);});});}exports[_0xcf58('0x18')]=function(_0x5b5acb){var _0x47646d=this;return new Promise(function(_0x1d05d7,_0x1bcea8){return db[_0xcf58('0x19')][_0xcf58('0x1a')]({'raw':_0x5b5acb[_0xcf58('0x1b')]?_0x5b5acb[_0xcf58('0x1b')][_0xcf58('0x1c')]===undefined?!![]:![]:!![],'where':_0x5b5acb['options']?_0x5b5acb['options'][_0xcf58('0x1d')]||null:null,'attributes':_0x5b5acb[_0xcf58('0x1b')]?_0x5b5acb[_0xcf58('0x1b')][_0xcf58('0x1e')]||null:null,'limit':_0x5b5acb[_0xcf58('0x1b')]?_0x5b5acb[_0xcf58('0x1b')][_0xcf58('0x1f')]||null:null,'include':_0x5b5acb[_0xcf58('0x1b')]?_0x5b5acb['options'][_0xcf58('0x20')]?_[_0xcf58('0x21')](_0x5b5acb[_0xcf58('0x1b')]['include'],function(_0xde0e9f){return{'model':db[_0xde0e9f['model']],'as':_0xde0e9f['as'],'attributes':_0xde0e9f[_0xcf58('0x1e')],'include':_0xde0e9f[_0xcf58('0x20')]?_[_0xcf58('0x21')](_0xde0e9f[_0xcf58('0x20')],function(_0x3a26ab){return{'model':db[_0x3a26ab[_0xcf58('0x22')]],'as':_0x3a26ab['as'],'attributes':_0x3a26ab[_0xcf58('0x1e')],'include':_0x3a26ab['include']?_[_0xcf58('0x21')](_0x3a26ab['include'],function(_0x289bd0){return{'model':db[_0x289bd0[_0xcf58('0x22')]],'as':_0x289bd0['as'],'attributes':_0x289bd0['attributes']};}):[]};}):[]};}):[]:[]})[_0xcf58('0xd')](function(_0x4eb423){logger[_0xcf58('0xe')](_0xcf58('0x18'),_0x5b5acb);logger[_0xcf58('0x10')]('GetDeskAccount',_0x5b5acb,JSON['stringify'](_0x4eb423));_0x1d05d7(_0x4eb423);})['catch'](function(_0x2408a3){logger[_0xcf58('0x12')](_0xcf58('0x18'),_0x2408a3[_0xcf58('0x15')],_0x5b5acb);_0x1bcea8(_0x47646d['error'](0x1f4,_0x2408a3[_0xcf58('0x15')]));});});};exports[_0xcf58('0x23')]=function(_0x4bce90){var _0x2bb8a4=this;return new Promise(function(_0x487f36,_0x3530c4){return db['DeskAccount'][_0xcf58('0x24')]({'raw':_0x4bce90[_0xcf58('0x1b')]?_0x4bce90[_0xcf58('0x1b')][_0xcf58('0x1c')]===undefined?!![]:![]:!![],'where':_0x4bce90[_0xcf58('0x1b')]?_0x4bce90[_0xcf58('0x1b')][_0xcf58('0x1d')]||null:null,'attributes':_0x4bce90[_0xcf58('0x1b')]?_0x4bce90[_0xcf58('0x1b')][_0xcf58('0x1e')]||null:null,'include':_0x4bce90[_0xcf58('0x1b')]?_0x4bce90['options']['include']?_[_0xcf58('0x21')](_0x4bce90['options'][_0xcf58('0x20')],function(_0x1dcd99){return{'model':db[_0x1dcd99['model']],'as':_0x1dcd99['as'],'attributes':_0x1dcd99['attributes'],'include':_0x1dcd99['include']?_['map'](_0x1dcd99[_0xcf58('0x20')],function(_0x2e6efa){return{'model':db[_0x2e6efa['model']],'as':_0x2e6efa['as'],'attributes':_0x2e6efa[_0xcf58('0x1e')],'include':_0x2e6efa[_0xcf58('0x20')]?_[_0xcf58('0x21')](_0x2e6efa[_0xcf58('0x20')],function(_0x48c6e6){return{'model':db[_0x48c6e6[_0xcf58('0x22')]],'as':_0x48c6e6['as'],'attributes':_0x48c6e6[_0xcf58('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xcf58('0xd')](function(_0x480da5){logger['info'](_0xcf58('0x23'),_0x4bce90);logger[_0xcf58('0x10')](_0xcf58('0x23'),_0x4bce90,JSON[_0xcf58('0x25')](_0x480da5));_0x487f36(_0x480da5);})[_0xcf58('0x17')](function(_0x4e5720){logger['error'](_0xcf58('0x23'),_0x4e5720[_0xcf58('0x15')],_0x4bce90);_0x3530c4(_0x2bb8a4['error'](0x1f4,_0x4e5720[_0xcf58('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 4e928db..0550d5a 100644 --- a/server/api/intDeskConfiguration/index.js +++ b/server/api/intDeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','getFields','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','setTags','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x20eed3,_0xb2529e){var _0xda8712=function(_0x40c2a1){while(--_0x40c2a1){_0x20eed3['push'](_0x20eed3['shift']());}};_0xda8712(++_0xb2529e);}(_0x008c,0x188));var _0xc008=function(_0x137f1a,_0x2887df){_0x137f1a=_0x137f1a-0x0;var _0x439923=_0x008c[_0x137f1a];return _0x439923;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0x10'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x14')](_0xc008('0x15'),auth[_0xc008('0xb')](),controller[_0xc008('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x17')]);module[_0xc008('0x18')]=router; \ No newline at end of file +var _0x9957=['/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags','post','create','setTags','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields'];(function(_0x33f681,_0x46ee9e){var _0x5d796e=function(_0x28b796){while(--_0x28b796){_0x33f681['push'](_0x33f681['shift']());}};_0x5d796e(++_0x46ee9e);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/fields',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/descriptions',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/tags',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x17')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller['destroy']);module[_0x7995('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index f2c19a9..7516aa4 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 _0xdd64=['STRING','sequelize'];(function(_0x1c2f29,_0x5a2668){var _0x258465=function(_0x30332f){while(--_0x30332f){_0x1c2f29['push'](_0x1c2f29['shift']());}};_0x258465(++_0x5a2668);}(_0xdd64,0x8f));var _0x4dd6=function(_0x595954,_0x2c8c03){_0x595954=_0x595954-0x0;var _0x17b29d=_0xdd64[_0x595954];return _0x17b29d;};'use strict';var Sequelize=require(_0x4dd6('0x0'));module['exports']={'name':{'type':Sequelize[_0x4dd6('0x1')]},'description':{'type':Sequelize[_0x4dd6('0x1')]}}; \ No newline at end of file +var _0xb082=['sequelize','STRING'];(function(_0x4f6f23,_0x2dd114){var _0x2ef456=function(_0x573551){while(--_0x573551){_0x4f6f23['push'](_0x4f6f23['shift']());}};_0x2ef456(++_0x2dd114);}(_0xb082,0xe0));var _0x2b08=function(_0x4b8172,_0x293d47){_0x4b8172=_0x4b8172-0x0;var _0x249817=_0xb082[_0x4b8172];return _0x249817;};'use strict';var Sequelize=require(_0x2b08('0x0'));module['exports']={'name':{'type':Sequelize[_0x2b08('0x1')]},'description':{'type':Sequelize[_0x2b08('0x1')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 2cd388b..ed8d6f7 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 _0x42d1=['rawAttributes','fieldName','key','map','query','keys','intersection','model','attributes','fields','length','order','sort','where','pick','filters','merge','type','VIRTUAL','includeAll','rows','include','options','catch','create','body','find','params','getFields','filter','hasOwnProperty','nolimit','getSubjects','DeskField','getDescriptions','findOne','Tag','getTags','setTags','ids','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','destroy','error','name','index','DeskConfiguration'];(function(_0x42e6c7,_0x4eaedd){var _0xe80e84=function(_0x41ec19){while(--_0x41ec19){_0x42e6c7['push'](_0x42e6c7['shift']());}};_0xe80e84(++_0x4eaedd);}(_0x42d1,0x1db));var _0x142d=function(_0xb5f992,_0xd3893d){_0xb5f992=_0xb5f992-0x0;var _0x530070=_0x42d1[_0xb5f992];return _0x530070;};'use strict';var emlformat=require(_0x142d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x142d('0x1'));var jsonpatch=require(_0x142d('0x2'));var rp=require(_0x142d('0x3'));var moment=require('moment');var BPromise=require(_0x142d('0x4'));var Mustache=require(_0x142d('0x5'));var util=require(_0x142d('0x6'));var path=require(_0x142d('0x7'));var sox=require(_0x142d('0x8'));var csv=require('to-csv');var ejs=require(_0x142d('0x9'));var fs=require('fs');var fs_extra=require(_0x142d('0xa'));var _=require(_0x142d('0xb'));var squel=require(_0x142d('0xc'));var crypto=require(_0x142d('0xd'));var jsforce=require(_0x142d('0xe'));var deskjs=require(_0x142d('0xf'));var toCsv=require(_0x142d('0x10'));var querystring=require('querystring');var Papa=require(_0x142d('0x11'));var Redis=require(_0x142d('0x12'));var authService=require(_0x142d('0x13'));var qs=require(_0x142d('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x142d('0x15'));var logger=require(_0x142d('0x16'))(_0x142d('0x17'));var utils=require(_0x142d('0x18'));var config=require(_0x142d('0x19'));var licenseUtil=require(_0x142d('0x1a'));var db=require(_0x142d('0x1b'))['db'];function respondWithStatusCode(_0x368235,_0x1abc93){_0x1abc93=_0x1abc93||0xcc;return function(_0x56efcf){if(_0x56efcf){return _0x368235[_0x142d('0x1c')](_0x1abc93);}return _0x368235[_0x142d('0x1d')](_0x1abc93)[_0x142d('0x1e')]();};}function respondWithResult(_0x3f5ff9,_0x295e02){_0x295e02=_0x295e02||0xc8;return function(_0x5435ef){if(_0x5435ef){return _0x3f5ff9['status'](_0x295e02)['json'](_0x5435ef);}};}function respondWithFilteredResult(_0x3ece95,_0x51c1af){return function(_0x5c6f48){if(_0x5c6f48){var _0x45a19f=typeof _0x51c1af[_0x142d('0x1f')]===_0x142d('0x20')&&typeof _0x51c1af[_0x142d('0x21')]===_0x142d('0x20');var _0x492fe3=_0x5c6f48[_0x142d('0x22')];var _0x108e0a=_0x45a19f?0x0:_0x51c1af[_0x142d('0x1f')];var _0x5ee02a=_0x45a19f?_0x5c6f48[_0x142d('0x22')]:_0x51c1af[_0x142d('0x1f')]+_0x51c1af[_0x142d('0x21')];var _0x582d5b;if(_0x5ee02a>=_0x492fe3){_0x5ee02a=_0x492fe3;_0x582d5b=0xc8;}else{_0x582d5b=0xce;}_0x3ece95[_0x142d('0x1d')](_0x582d5b);return _0x3ece95[_0x142d('0x23')](_0x142d('0x24'),_0x108e0a+'-'+_0x5ee02a+'/'+_0x492fe3)[_0x142d('0x25')](_0x5c6f48);}return null;};}function patchUpdates(_0x7e8ae4){return function(_0x5d1098){try{jsonpatch['apply'](_0x5d1098,_0x7e8ae4,!![]);}catch(_0x16f9f1){return BPromise[_0x142d('0x26')](_0x16f9f1);}return _0x5d1098[_0x142d('0x27')]();};}function saveUpdates(_0x48911e,_0x347403){return function(_0xa45d4e){if(_0xa45d4e){return _0xa45d4e[_0x142d('0x28')](_0x48911e)[_0x142d('0x29')](function(_0x2f2fd7){return _0x2f2fd7;});}return null;};}function removeEntity(_0xad3e7d,_0x412092){return function(_0x44907c){if(_0x44907c){return _0x44907c[_0x142d('0x2a')]()[_0x142d('0x29')](function(){_0xad3e7d[_0x142d('0x1d')](0xcc)[_0x142d('0x1e')]();});}};}function handleEntityNotFound(_0x4ab855,_0xb72b7){return function(_0xbb56a3){if(!_0xbb56a3){_0x4ab855['sendStatus'](0x194);}return _0xbb56a3;};}function handleError(_0x3fe5a8,_0x2bdc71){_0x2bdc71=_0x2bdc71||0x1f4;return function(_0x281921){logger[_0x142d('0x2b')](_0x281921['stack']);if(_0x281921[_0x142d('0x2c')]){delete _0x281921[_0x142d('0x2c')];}_0x3fe5a8['status'](_0x2bdc71)['send'](_0x281921);};}exports[_0x142d('0x2d')]=function(_0x2bf1b5,_0x853021){var _0x2d1cd5={},_0x27d3cc={},_0x17e877={'count':0x0,'rows':[]};var _0x2ceffa=_['map'](db[_0x142d('0x2e')][_0x142d('0x2f')],function(_0x2d0a2e){return{'name':_0x2d0a2e[_0x142d('0x30')],'type':_0x2d0a2e['type'][_0x142d('0x31')]};});_0x27d3cc['model']=_[_0x142d('0x32')](_0x2ceffa,_0x142d('0x2c'));_0x27d3cc[_0x142d('0x33')]=_[_0x142d('0x34')](_0x2bf1b5['query']);_0x27d3cc['filters']=_[_0x142d('0x35')](_0x27d3cc[_0x142d('0x36')],_0x27d3cc[_0x142d('0x33')]);_0x2d1cd5[_0x142d('0x37')]=_['intersection'](_0x27d3cc[_0x142d('0x36')],qs[_0x142d('0x38')](_0x2bf1b5[_0x142d('0x33')][_0x142d('0x38')]));_0x2d1cd5[_0x142d('0x37')]=_0x2d1cd5[_0x142d('0x37')][_0x142d('0x39')]?_0x2d1cd5[_0x142d('0x37')]:_0x27d3cc['model'];if(!_0x2bf1b5[_0x142d('0x33')]['hasOwnProperty']('nolimit')){_0x2d1cd5[_0x142d('0x21')]=qs[_0x142d('0x21')](_0x2bf1b5[_0x142d('0x33')][_0x142d('0x21')]);_0x2d1cd5['offset']=qs['offset'](_0x2bf1b5['query'][_0x142d('0x1f')]);}_0x2d1cd5[_0x142d('0x3a')]=qs[_0x142d('0x3b')](_0x2bf1b5[_0x142d('0x33')][_0x142d('0x3b')]);_0x2d1cd5[_0x142d('0x3c')]=qs['filters'](_[_0x142d('0x3d')](_0x2bf1b5[_0x142d('0x33')],_0x27d3cc[_0x142d('0x3e')]),_0x2ceffa);if(_0x2bf1b5['query']['filter']){_0x2d1cd5[_0x142d('0x3c')]=_[_0x142d('0x3f')](_0x2d1cd5['where'],{'$or':_[_0x142d('0x32')](_0x2ceffa,function(_0x29fb8f){if(_0x29fb8f[_0x142d('0x40')]!==_0x142d('0x41')){var _0x2efb65={};_0x2efb65[_0x29fb8f[_0x142d('0x2c')]]={'$like':'%'+_0x2bf1b5['query']['filter']+'%'};return _0x2efb65;}})});}_0x2d1cd5=_['merge']({},_0x2d1cd5,_0x2bf1b5['options']);var _0x2c68f6={'where':_0x2d1cd5[_0x142d('0x3c')]};return db[_0x142d('0x2e')][_0x142d('0x22')](_0x2c68f6)[_0x142d('0x29')](function(_0x28c079){_0x17e877[_0x142d('0x22')]=_0x28c079;if(_0x2bf1b5[_0x142d('0x33')][_0x142d('0x42')]){_0x2d1cd5['include']=[{'all':!![]}];}return db[_0x142d('0x2e')]['findAll'](_0x2d1cd5);})[_0x142d('0x29')](function(_0x50bd4b){_0x17e877[_0x142d('0x43')]=_0x50bd4b;return _0x17e877;})[_0x142d('0x29')](respondWithFilteredResult(_0x853021,_0x2d1cd5))['catch'](handleError(_0x853021,null));};exports['show']=function(_0x44d82b,_0x51a9a5){var _0x18b58d={'raw':![],'where':{'id':_0x44d82b['params']['id']}},_0x644b0a={};_0x644b0a[_0x142d('0x36')]=_[_0x142d('0x34')](db[_0x142d('0x2e')][_0x142d('0x2f')]);_0x644b0a[_0x142d('0x33')]=_[_0x142d('0x34')](_0x44d82b['query']);_0x644b0a[_0x142d('0x3e')]=_['intersection'](_0x644b0a[_0x142d('0x36')],_0x644b0a['query']);_0x18b58d['attributes']=_['intersection'](_0x644b0a['model'],qs['fields'](_0x44d82b[_0x142d('0x33')]['fields']));_0x18b58d[_0x142d('0x37')]=_0x18b58d[_0x142d('0x37')][_0x142d('0x39')]?_0x18b58d[_0x142d('0x37')]:_0x644b0a[_0x142d('0x36')];if(_0x44d82b[_0x142d('0x33')]['includeAll']){_0x18b58d[_0x142d('0x44')]=[{'all':!![]}];}_0x18b58d=_['merge']({},_0x18b58d,_0x44d82b[_0x142d('0x45')]);return db[_0x142d('0x2e')]['find'](_0x18b58d)['then'](handleEntityNotFound(_0x51a9a5,null))[_0x142d('0x29')](respondWithResult(_0x51a9a5,null))[_0x142d('0x46')](handleError(_0x51a9a5,null));};exports[_0x142d('0x47')]=function(_0x2e62b4,_0x560338){return db[_0x142d('0x2e')][_0x142d('0x47')](_0x2e62b4['body'],{})['then'](respondWithResult(_0x560338,0xc9))['catch'](handleError(_0x560338,null));};exports[_0x142d('0x28')]=function(_0x2ab141,_0x2380cc){if(_0x2ab141[_0x142d('0x48')]['id']){delete _0x2ab141[_0x142d('0x48')]['id'];}return db[_0x142d('0x2e')][_0x142d('0x49')]({'where':{'id':_0x2ab141[_0x142d('0x4a')]['id']}})[_0x142d('0x29')](handleEntityNotFound(_0x2380cc,null))[_0x142d('0x29')](saveUpdates(_0x2ab141['body'],null))['then'](respondWithResult(_0x2380cc,null))[_0x142d('0x46')](handleError(_0x2380cc,null));};exports[_0x142d('0x2a')]=function(_0x3b77a7,_0x28c02c){return db[_0x142d('0x2e')][_0x142d('0x49')]({'where':{'id':_0x3b77a7[_0x142d('0x4a')]['id']}})[_0x142d('0x29')](handleEntityNotFound(_0x28c02c,null))[_0x142d('0x29')](removeEntity(_0x28c02c,null))[_0x142d('0x46')](handleError(_0x28c02c,null));};exports[_0x142d('0x4b')]=function(_0x4794fa,_0x1c1a3a,_0x52531a){var _0x1c0458={};var _0x62025f={};var _0x4ae572;var _0xe8de9;return db[_0x142d('0x2e')]['findOne']({'where':{'id':_0x4794fa[_0x142d('0x4a')]['id']}})[_0x142d('0x29')](handleEntityNotFound(_0x1c1a3a,null))[_0x142d('0x29')](function(_0x208eb4){if(_0x208eb4){_0x4ae572=_0x208eb4;_0x62025f[_0x142d('0x36')]=_[_0x142d('0x34')](db['DeskField'][_0x142d('0x2f')]);_0x62025f[_0x142d('0x33')]=_[_0x142d('0x34')](_0x4794fa[_0x142d('0x33')]);_0x62025f['filters']=_[_0x142d('0x35')](_0x62025f[_0x142d('0x36')],_0x62025f[_0x142d('0x33')]);_0x1c0458[_0x142d('0x37')]=_[_0x142d('0x35')](_0x62025f['model'],qs[_0x142d('0x38')](_0x4794fa[_0x142d('0x33')][_0x142d('0x38')]));_0x1c0458['attributes']=_0x1c0458['attributes'][_0x142d('0x39')]?_0x1c0458[_0x142d('0x37')]:_0x62025f[_0x142d('0x36')];_0x1c0458[_0x142d('0x3a')]=qs[_0x142d('0x3b')](_0x4794fa[_0x142d('0x33')]['sort']);_0x1c0458[_0x142d('0x3c')]=qs['filters'](_[_0x142d('0x3d')](_0x4794fa['query'],_0x62025f[_0x142d('0x3e')]));if(_0x4794fa[_0x142d('0x33')]['filter']){_0x1c0458['where']=_[_0x142d('0x3f')](_0x1c0458[_0x142d('0x3c')],{'$or':_[_0x142d('0x32')](_0x1c0458['attributes'],function(_0x2920bf){var _0x180f44={};_0x180f44[_0x2920bf]={'$like':'%'+_0x4794fa[_0x142d('0x33')][_0x142d('0x4c')]+'%'};return _0x180f44;})});}_0x1c0458=_[_0x142d('0x3f')]({},_0x1c0458,_0x4794fa['options']);return _0x4ae572[_0x142d('0x4b')](_0x1c0458);}})['then'](function(_0x20bb39){if(_0x20bb39){_0xe8de9=_0x20bb39[_0x142d('0x39')];if(!_0x4794fa['query'][_0x142d('0x4d')](_0x142d('0x4e'))){_0x1c0458[_0x142d('0x21')]=qs[_0x142d('0x21')](_0x4794fa[_0x142d('0x33')][_0x142d('0x21')]);_0x1c0458[_0x142d('0x1f')]=qs[_0x142d('0x1f')](_0x4794fa[_0x142d('0x33')][_0x142d('0x1f')]);}return _0x4ae572[_0x142d('0x4b')](_0x1c0458);}})[_0x142d('0x29')](function(_0x59346d){if(_0x59346d){return _0x59346d?{'count':_0xe8de9,'rows':_0x59346d}:null;}})['then'](respondWithResult(_0x1c1a3a,null))['catch'](handleError(_0x1c1a3a,null));};exports[_0x142d('0x4f')]=function(_0xb3582d,_0x3217b8,_0x527e43){var _0x236495={};var _0x31cbe6={};var _0x529c33;var _0x53e44e;return db[_0x142d('0x2e')]['findOne']({'where':{'id':_0xb3582d[_0x142d('0x4a')]['id']}})[_0x142d('0x29')](handleEntityNotFound(_0x3217b8,null))[_0x142d('0x29')](function(_0x36a0fc){if(_0x36a0fc){_0x529c33=_0x36a0fc;_0x31cbe6['model']=_[_0x142d('0x34')](db[_0x142d('0x50')][_0x142d('0x2f')]);_0x31cbe6[_0x142d('0x33')]=_[_0x142d('0x34')](_0xb3582d['query']);_0x31cbe6[_0x142d('0x3e')]=_[_0x142d('0x35')](_0x31cbe6[_0x142d('0x36')],_0x31cbe6[_0x142d('0x33')]);_0x236495[_0x142d('0x37')]=_[_0x142d('0x35')](_0x31cbe6[_0x142d('0x36')],qs['fields'](_0xb3582d['query'][_0x142d('0x38')]));_0x236495[_0x142d('0x37')]=_0x236495[_0x142d('0x37')][_0x142d('0x39')]?_0x236495[_0x142d('0x37')]:_0x31cbe6[_0x142d('0x36')];_0x236495[_0x142d('0x3a')]=qs['sort'](_0xb3582d[_0x142d('0x33')][_0x142d('0x3b')]);_0x236495[_0x142d('0x3c')]=qs[_0x142d('0x3e')](_[_0x142d('0x3d')](_0xb3582d[_0x142d('0x33')],_0x31cbe6[_0x142d('0x3e')]));if(_0xb3582d[_0x142d('0x33')][_0x142d('0x4c')]){_0x236495[_0x142d('0x3c')]=_[_0x142d('0x3f')](_0x236495[_0x142d('0x3c')],{'$or':_[_0x142d('0x32')](_0x236495[_0x142d('0x37')],function(_0x1096c5){var _0x85231a={};_0x85231a[_0x1096c5]={'$like':'%'+_0xb3582d[_0x142d('0x33')]['filter']+'%'};return _0x85231a;})});}_0x236495=_[_0x142d('0x3f')]({},_0x236495,_0xb3582d[_0x142d('0x45')]);return _0x529c33[_0x142d('0x4f')](_0x236495);}})[_0x142d('0x29')](function(_0x3ac405){if(_0x3ac405){_0x53e44e=_0x3ac405[_0x142d('0x39')];if(!_0xb3582d[_0x142d('0x33')][_0x142d('0x4d')]('nolimit')){_0x236495[_0x142d('0x21')]=qs[_0x142d('0x21')](_0xb3582d[_0x142d('0x33')]['limit']);_0x236495[_0x142d('0x1f')]=qs[_0x142d('0x1f')](_0xb3582d[_0x142d('0x33')][_0x142d('0x1f')]);}return _0x529c33[_0x142d('0x4f')](_0x236495);}})[_0x142d('0x29')](function(_0x34956d){if(_0x34956d){return _0x34956d?{'count':_0x53e44e,'rows':_0x34956d}:null;}})[_0x142d('0x29')](respondWithResult(_0x3217b8,null))['catch'](handleError(_0x3217b8,null));};exports[_0x142d('0x51')]=function(_0x5ec974,_0x4e0ade,_0x5958ea){var _0x5530a1={};var _0x4cfe36={};var _0x49d625;var _0x2863de;return db[_0x142d('0x2e')]['findOne']({'where':{'id':_0x5ec974['params']['id']}})[_0x142d('0x29')](handleEntityNotFound(_0x4e0ade,null))[_0x142d('0x29')](function(_0x15dba0){if(_0x15dba0){_0x49d625=_0x15dba0;_0x4cfe36[_0x142d('0x36')]=_[_0x142d('0x34')](db['DeskField']['rawAttributes']);_0x4cfe36[_0x142d('0x33')]=_['keys'](_0x5ec974[_0x142d('0x33')]);_0x4cfe36[_0x142d('0x3e')]=_[_0x142d('0x35')](_0x4cfe36[_0x142d('0x36')],_0x4cfe36[_0x142d('0x33')]);_0x5530a1[_0x142d('0x37')]=_[_0x142d('0x35')](_0x4cfe36[_0x142d('0x36')],qs[_0x142d('0x38')](_0x5ec974[_0x142d('0x33')][_0x142d('0x38')]));_0x5530a1[_0x142d('0x37')]=_0x5530a1[_0x142d('0x37')][_0x142d('0x39')]?_0x5530a1[_0x142d('0x37')]:_0x4cfe36[_0x142d('0x36')];_0x5530a1[_0x142d('0x3a')]=qs[_0x142d('0x3b')](_0x5ec974['query'][_0x142d('0x3b')]);_0x5530a1[_0x142d('0x3c')]=qs[_0x142d('0x3e')](_[_0x142d('0x3d')](_0x5ec974[_0x142d('0x33')],_0x4cfe36[_0x142d('0x3e')]));if(_0x5ec974[_0x142d('0x33')]['filter']){_0x5530a1[_0x142d('0x3c')]=_['merge'](_0x5530a1[_0x142d('0x3c')],{'$or':_[_0x142d('0x32')](_0x5530a1['attributes'],function(_0x1c2215){var _0x417712={};_0x417712[_0x1c2215]={'$like':'%'+_0x5ec974[_0x142d('0x33')][_0x142d('0x4c')]+'%'};return _0x417712;})});}_0x5530a1=_[_0x142d('0x3f')]({},_0x5530a1,_0x5ec974[_0x142d('0x45')]);return _0x49d625[_0x142d('0x51')](_0x5530a1);}})[_0x142d('0x29')](function(_0x522ebf){if(_0x522ebf){_0x2863de=_0x522ebf['length'];if(!_0x5ec974[_0x142d('0x33')][_0x142d('0x4d')](_0x142d('0x4e'))){_0x5530a1[_0x142d('0x21')]=qs[_0x142d('0x21')](_0x5ec974[_0x142d('0x33')][_0x142d('0x21')]);_0x5530a1[_0x142d('0x1f')]=qs[_0x142d('0x1f')](_0x5ec974[_0x142d('0x33')][_0x142d('0x1f')]);}return _0x49d625[_0x142d('0x51')](_0x5530a1);}})[_0x142d('0x29')](function(_0x2eb4dc){if(_0x2eb4dc){return _0x2eb4dc?{'count':_0x2863de,'rows':_0x2eb4dc}:null;}})[_0x142d('0x29')](respondWithResult(_0x4e0ade,null))[_0x142d('0x46')](handleError(_0x4e0ade,null));};exports['getTags']=function(_0x4d9bb6,_0x2b02a3,_0x38e531){var _0x284fab={};var _0x1aa714={};var _0x303410;var _0x388744;return db[_0x142d('0x2e')][_0x142d('0x52')]({'where':{'id':_0x4d9bb6[_0x142d('0x4a')]['id']}})[_0x142d('0x29')](handleEntityNotFound(_0x2b02a3,null))[_0x142d('0x29')](function(_0x3b0b0d){if(_0x3b0b0d){_0x303410=_0x3b0b0d;_0x1aa714[_0x142d('0x36')]=_[_0x142d('0x34')](db[_0x142d('0x53')][_0x142d('0x2f')]);_0x1aa714['query']=_[_0x142d('0x34')](_0x4d9bb6[_0x142d('0x33')]);_0x1aa714['filters']=_[_0x142d('0x35')](_0x1aa714[_0x142d('0x36')],_0x1aa714[_0x142d('0x33')]);_0x284fab[_0x142d('0x37')]=_[_0x142d('0x35')](_0x1aa714[_0x142d('0x36')],qs[_0x142d('0x38')](_0x4d9bb6[_0x142d('0x33')][_0x142d('0x38')]));_0x284fab['attributes']=_0x284fab[_0x142d('0x37')][_0x142d('0x39')]?_0x284fab[_0x142d('0x37')]:_0x1aa714[_0x142d('0x36')];_0x284fab['order']=qs['sort'](_0x4d9bb6['query'][_0x142d('0x3b')]);_0x284fab[_0x142d('0x3c')]=qs[_0x142d('0x3e')](_[_0x142d('0x3d')](_0x4d9bb6[_0x142d('0x33')],_0x1aa714[_0x142d('0x3e')]));if(_0x4d9bb6['query']['filter']){_0x284fab['where']=_[_0x142d('0x3f')](_0x284fab[_0x142d('0x3c')],{'$or':_[_0x142d('0x32')](_0x284fab[_0x142d('0x37')],function(_0x46404c){var _0x3cf701={};_0x3cf701[_0x46404c]={'$like':'%'+_0x4d9bb6[_0x142d('0x33')]['filter']+'%'};return _0x3cf701;})});}_0x284fab=_['merge']({},_0x284fab,_0x4d9bb6[_0x142d('0x45')]);return _0x303410[_0x142d('0x54')](_0x284fab);}})[_0x142d('0x29')](function(_0x53916d){if(_0x53916d){_0x388744=_0x53916d['length'];if(!_0x4d9bb6[_0x142d('0x33')]['hasOwnProperty']('nolimit')){_0x284fab[_0x142d('0x21')]=qs['limit'](_0x4d9bb6['query'][_0x142d('0x21')]);_0x284fab[_0x142d('0x1f')]=qs[_0x142d('0x1f')](_0x4d9bb6['query'][_0x142d('0x1f')]);}return _0x303410[_0x142d('0x54')](_0x284fab);}})['then'](function(_0x383e9b){if(_0x383e9b){return _0x383e9b?{'count':_0x388744,'rows':_0x383e9b}:null;}})['then'](respondWithResult(_0x2b02a3,null))[_0x142d('0x46')](handleError(_0x2b02a3,null));};exports[_0x142d('0x55')]=function(_0x7344a7,_0x3595ee,_0x1bbfd4){if(_0x7344a7[_0x142d('0x48')]['id']){delete _0x7344a7['body']['id'];}return db[_0x142d('0x2e')][_0x142d('0x52')]({'where':{'id':_0x7344a7[_0x142d('0x4a')]['id']}})[_0x142d('0x29')](handleEntityNotFound(_0x3595ee,null))[_0x142d('0x29')](function(_0x266e87){if(_0x266e87){return _0x266e87[_0x142d('0x55')](_0x7344a7[_0x142d('0x48')][_0x142d('0x56')]||[]);}return null;})[_0x142d('0x29')](respondWithResult(_0x3595ee,null))[_0x142d('0x46')](handleError(_0x3595ee,null));}; \ No newline at end of file +var _0x80f3=['save','update','destroy','then','end','sendStatus','error','stack','index','DeskConfiguration','rawAttributes','type','key','query','keys','filters','intersection','attributes','model','fields','length','nolimit','limit','sort','where','pick','filter','merge','map','VIRTUAL','name','options','includeAll','include','findAll','catch','show','params','create','body','find','getFields','findOne','DeskField','order','hasOwnProperty','getSubjects','getDescriptions','Tag','getTags','setTags','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','offset','undefined','count','status','set','Content-Range','json','apply'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x80f3,0x135));var _0x380f=function(_0x27e811,_0x20137c){_0x27e811=_0x27e811-0x0;var _0x1627fa=_0x80f3[_0x27e811];return _0x1627fa;};'use strict';var emlformat=require(_0x380f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x380f('0x1'));var jsonpatch=require(_0x380f('0x2'));var rp=require('request-promise');var moment=require(_0x380f('0x3'));var BPromise=require(_0x380f('0x4'));var Mustache=require(_0x380f('0x5'));var util=require(_0x380f('0x6'));var path=require(_0x380f('0x7'));var sox=require(_0x380f('0x8'));var csv=require(_0x380f('0x9'));var ejs=require(_0x380f('0xa'));var fs=require('fs');var fs_extra=require(_0x380f('0xb'));var _=require(_0x380f('0xc'));var squel=require(_0x380f('0xd'));var crypto=require(_0x380f('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x380f('0xf'));var toCsv=require('to-csv');var querystring=require(_0x380f('0x10'));var Papa=require(_0x380f('0x11'));var Redis=require(_0x380f('0x12'));var authService=require(_0x380f('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x380f('0x14'));var hardwareService=require(_0x380f('0x15'));var logger=require(_0x380f('0x16'))('api');var utils=require(_0x380f('0x17'));var config=require(_0x380f('0x18'));var licenseUtil=require(_0x380f('0x19'));var db=require(_0x380f('0x1a'))['db'];function respondWithStatusCode(_0x1facb7,_0xaf5cc4){_0xaf5cc4=_0xaf5cc4||0xcc;return function(_0x2ff5fe){if(_0x2ff5fe){return _0x1facb7['sendStatus'](_0xaf5cc4);}return _0x1facb7['status'](_0xaf5cc4)['end']();};}function respondWithResult(_0x56bc74,_0x147ec1){_0x147ec1=_0x147ec1||0xc8;return function(_0x4676c0){if(_0x4676c0){return _0x56bc74['status'](_0x147ec1)['json'](_0x4676c0);}};}function respondWithFilteredResult(_0x23cd94,_0x2539d3){return function(_0x135fb9){if(_0x135fb9){var _0x16bced=typeof _0x2539d3[_0x380f('0x1b')]==='undefined'&&typeof _0x2539d3['limit']===_0x380f('0x1c');var _0xd0d0a8=_0x135fb9[_0x380f('0x1d')];var _0x322022=_0x16bced?0x0:_0x2539d3[_0x380f('0x1b')];var _0x5563c7=_0x16bced?_0x135fb9[_0x380f('0x1d')]:_0x2539d3[_0x380f('0x1b')]+_0x2539d3['limit'];var _0x27ca92;if(_0x5563c7>=_0xd0d0a8){_0x5563c7=_0xd0d0a8;_0x27ca92=0xc8;}else{_0x27ca92=0xce;}_0x23cd94[_0x380f('0x1e')](_0x27ca92);return _0x23cd94[_0x380f('0x1f')](_0x380f('0x20'),_0x322022+'-'+_0x5563c7+'/'+_0xd0d0a8)[_0x380f('0x21')](_0x135fb9);}return null;};}function patchUpdates(_0x1b82ac){return function(_0x191641){try{jsonpatch[_0x380f('0x22')](_0x191641,_0x1b82ac,!![]);}catch(_0x15fe54){return BPromise['reject'](_0x15fe54);}return _0x191641[_0x380f('0x23')]();};}function saveUpdates(_0x55b216,_0x263a7c){return function(_0x1c006d){if(_0x1c006d){return _0x1c006d[_0x380f('0x24')](_0x55b216)['then'](function(_0x3ea9e1){return _0x3ea9e1;});}return null;};}function removeEntity(_0x599f02,_0x1df7a0){return function(_0x110d34){if(_0x110d34){return _0x110d34[_0x380f('0x25')]()[_0x380f('0x26')](function(){_0x599f02[_0x380f('0x1e')](0xcc)[_0x380f('0x27')]();});}};}function handleEntityNotFound(_0x49eb8b,_0x4d5427){return function(_0x83c721){if(!_0x83c721){_0x49eb8b[_0x380f('0x28')](0x194);}return _0x83c721;};}function handleError(_0x495cdf,_0x161a26){_0x161a26=_0x161a26||0x1f4;return function(_0x217c0a){logger[_0x380f('0x29')](_0x217c0a[_0x380f('0x2a')]);if(_0x217c0a['name']){delete _0x217c0a['name'];}_0x495cdf['status'](_0x161a26)['send'](_0x217c0a);};}exports[_0x380f('0x2b')]=function(_0x54d780,_0x421b64){var _0x2a6a7e={},_0x1712f5={},_0x5a8d7e={'count':0x0,'rows':[]};var _0x6b7438=_['map'](db[_0x380f('0x2c')][_0x380f('0x2d')],function(_0x1c91d5){return{'name':_0x1c91d5['fieldName'],'type':_0x1c91d5[_0x380f('0x2e')][_0x380f('0x2f')]};});_0x1712f5['model']=_['map'](_0x6b7438,'name');_0x1712f5[_0x380f('0x30')]=_[_0x380f('0x31')](_0x54d780[_0x380f('0x30')]);_0x1712f5[_0x380f('0x32')]=_[_0x380f('0x33')](_0x1712f5['model'],_0x1712f5[_0x380f('0x30')]);_0x2a6a7e[_0x380f('0x34')]=_[_0x380f('0x33')](_0x1712f5[_0x380f('0x35')],qs[_0x380f('0x36')](_0x54d780[_0x380f('0x30')]['fields']));_0x2a6a7e[_0x380f('0x34')]=_0x2a6a7e[_0x380f('0x34')][_0x380f('0x37')]?_0x2a6a7e[_0x380f('0x34')]:_0x1712f5[_0x380f('0x35')];if(!_0x54d780[_0x380f('0x30')]['hasOwnProperty'](_0x380f('0x38'))){_0x2a6a7e[_0x380f('0x39')]=qs[_0x380f('0x39')](_0x54d780[_0x380f('0x30')][_0x380f('0x39')]);_0x2a6a7e[_0x380f('0x1b')]=qs[_0x380f('0x1b')](_0x54d780[_0x380f('0x30')]['offset']);}_0x2a6a7e['order']=qs[_0x380f('0x3a')](_0x54d780[_0x380f('0x30')][_0x380f('0x3a')]);_0x2a6a7e[_0x380f('0x3b')]=qs['filters'](_[_0x380f('0x3c')](_0x54d780[_0x380f('0x30')],_0x1712f5[_0x380f('0x32')]),_0x6b7438);if(_0x54d780[_0x380f('0x30')][_0x380f('0x3d')]){_0x2a6a7e[_0x380f('0x3b')]=_[_0x380f('0x3e')](_0x2a6a7e[_0x380f('0x3b')],{'$or':_[_0x380f('0x3f')](_0x6b7438,function(_0x5f46e8){if(_0x5f46e8['type']!==_0x380f('0x40')){var _0x13dece={};_0x13dece[_0x5f46e8[_0x380f('0x41')]]={'$like':'%'+_0x54d780[_0x380f('0x30')][_0x380f('0x3d')]+'%'};return _0x13dece;}})});}_0x2a6a7e=_[_0x380f('0x3e')]({},_0x2a6a7e,_0x54d780[_0x380f('0x42')]);var _0x42c57e={'where':_0x2a6a7e[_0x380f('0x3b')]};return db[_0x380f('0x2c')]['count'](_0x42c57e)[_0x380f('0x26')](function(_0x47029a){_0x5a8d7e[_0x380f('0x1d')]=_0x47029a;if(_0x54d780[_0x380f('0x30')][_0x380f('0x43')]){_0x2a6a7e[_0x380f('0x44')]=[{'all':!![]}];}return db['DeskConfiguration'][_0x380f('0x45')](_0x2a6a7e);})[_0x380f('0x26')](function(_0x12933e){_0x5a8d7e['rows']=_0x12933e;return _0x5a8d7e;})['then'](respondWithFilteredResult(_0x421b64,_0x2a6a7e))[_0x380f('0x46')](handleError(_0x421b64,null));};exports[_0x380f('0x47')]=function(_0x465ee8,_0x12b013){var _0x8f4394={'raw':![],'where':{'id':_0x465ee8[_0x380f('0x48')]['id']}},_0x3964a4={};_0x3964a4[_0x380f('0x35')]=_['keys'](db[_0x380f('0x2c')][_0x380f('0x2d')]);_0x3964a4[_0x380f('0x30')]=_['keys'](_0x465ee8['query']);_0x3964a4[_0x380f('0x32')]=_[_0x380f('0x33')](_0x3964a4[_0x380f('0x35')],_0x3964a4[_0x380f('0x30')]);_0x8f4394[_0x380f('0x34')]=_[_0x380f('0x33')](_0x3964a4[_0x380f('0x35')],qs[_0x380f('0x36')](_0x465ee8[_0x380f('0x30')]['fields']));_0x8f4394[_0x380f('0x34')]=_0x8f4394[_0x380f('0x34')][_0x380f('0x37')]?_0x8f4394[_0x380f('0x34')]:_0x3964a4[_0x380f('0x35')];if(_0x465ee8[_0x380f('0x30')]['includeAll']){_0x8f4394[_0x380f('0x44')]=[{'all':!![]}];}_0x8f4394=_['merge']({},_0x8f4394,_0x465ee8[_0x380f('0x42')]);return db[_0x380f('0x2c')]['find'](_0x8f4394)[_0x380f('0x26')](handleEntityNotFound(_0x12b013,null))[_0x380f('0x26')](respondWithResult(_0x12b013,null))[_0x380f('0x46')](handleError(_0x12b013,null));};exports[_0x380f('0x49')]=function(_0x50f0df,_0x2a042e){return db[_0x380f('0x2c')][_0x380f('0x49')](_0x50f0df[_0x380f('0x4a')],{})[_0x380f('0x26')](respondWithResult(_0x2a042e,0xc9))[_0x380f('0x46')](handleError(_0x2a042e,null));};exports[_0x380f('0x24')]=function(_0x1839af,_0x46b1c4){if(_0x1839af[_0x380f('0x4a')]['id']){delete _0x1839af[_0x380f('0x4a')]['id'];}return db[_0x380f('0x2c')][_0x380f('0x4b')]({'where':{'id':_0x1839af[_0x380f('0x48')]['id']}})['then'](handleEntityNotFound(_0x46b1c4,null))[_0x380f('0x26')](saveUpdates(_0x1839af['body'],null))['then'](respondWithResult(_0x46b1c4,null))['catch'](handleError(_0x46b1c4,null));};exports['destroy']=function(_0x1d8f30,_0x1b29df){return db[_0x380f('0x2c')][_0x380f('0x4b')]({'where':{'id':_0x1d8f30[_0x380f('0x48')]['id']}})['then'](handleEntityNotFound(_0x1b29df,null))[_0x380f('0x26')](removeEntity(_0x1b29df,null))['catch'](handleError(_0x1b29df,null));};exports[_0x380f('0x4c')]=function(_0xb6b21f,_0x4764d6,_0xe9144f){var _0x332d03={};var _0x4d5335={};var _0x49c4bb;var _0x1aef6;return db[_0x380f('0x2c')][_0x380f('0x4d')]({'where':{'id':_0xb6b21f['params']['id']}})[_0x380f('0x26')](handleEntityNotFound(_0x4764d6,null))[_0x380f('0x26')](function(_0x5760bb){if(_0x5760bb){_0x49c4bb=_0x5760bb;_0x4d5335[_0x380f('0x35')]=_[_0x380f('0x31')](db[_0x380f('0x4e')][_0x380f('0x2d')]);_0x4d5335[_0x380f('0x30')]=_[_0x380f('0x31')](_0xb6b21f[_0x380f('0x30')]);_0x4d5335[_0x380f('0x32')]=_['intersection'](_0x4d5335[_0x380f('0x35')],_0x4d5335[_0x380f('0x30')]);_0x332d03['attributes']=_[_0x380f('0x33')](_0x4d5335['model'],qs['fields'](_0xb6b21f[_0x380f('0x30')][_0x380f('0x36')]));_0x332d03['attributes']=_0x332d03[_0x380f('0x34')][_0x380f('0x37')]?_0x332d03['attributes']:_0x4d5335['model'];_0x332d03[_0x380f('0x4f')]=qs[_0x380f('0x3a')](_0xb6b21f['query'][_0x380f('0x3a')]);_0x332d03[_0x380f('0x3b')]=qs[_0x380f('0x32')](_['pick'](_0xb6b21f[_0x380f('0x30')],_0x4d5335[_0x380f('0x32')]));if(_0xb6b21f[_0x380f('0x30')][_0x380f('0x3d')]){_0x332d03[_0x380f('0x3b')]=_[_0x380f('0x3e')](_0x332d03['where'],{'$or':_['map'](_0x332d03[_0x380f('0x34')],function(_0x1a048d){var _0x52a0c7={};_0x52a0c7[_0x1a048d]={'$like':'%'+_0xb6b21f['query'][_0x380f('0x3d')]+'%'};return _0x52a0c7;})});}_0x332d03=_[_0x380f('0x3e')]({},_0x332d03,_0xb6b21f[_0x380f('0x42')]);return _0x49c4bb[_0x380f('0x4c')](_0x332d03);}})[_0x380f('0x26')](function(_0x420c12){if(_0x420c12){_0x1aef6=_0x420c12[_0x380f('0x37')];if(!_0xb6b21f[_0x380f('0x30')][_0x380f('0x50')]('nolimit')){_0x332d03['limit']=qs[_0x380f('0x39')](_0xb6b21f['query'][_0x380f('0x39')]);_0x332d03[_0x380f('0x1b')]=qs['offset'](_0xb6b21f[_0x380f('0x30')][_0x380f('0x1b')]);}return _0x49c4bb[_0x380f('0x4c')](_0x332d03);}})['then'](function(_0x2b393b){if(_0x2b393b){return _0x2b393b?{'count':_0x1aef6,'rows':_0x2b393b}:null;}})['then'](respondWithResult(_0x4764d6,null))[_0x380f('0x46')](handleError(_0x4764d6,null));};exports[_0x380f('0x51')]=function(_0x42b898,_0x4b475c,_0x30f61b){var _0x243d62={};var _0x39b48c={};var _0x16bb56;var _0x327954;return db['DeskConfiguration'][_0x380f('0x4d')]({'where':{'id':_0x42b898['params']['id']}})[_0x380f('0x26')](handleEntityNotFound(_0x4b475c,null))[_0x380f('0x26')](function(_0x15a271){if(_0x15a271){_0x16bb56=_0x15a271;_0x39b48c[_0x380f('0x35')]=_['keys'](db[_0x380f('0x4e')][_0x380f('0x2d')]);_0x39b48c[_0x380f('0x30')]=_[_0x380f('0x31')](_0x42b898[_0x380f('0x30')]);_0x39b48c['filters']=_[_0x380f('0x33')](_0x39b48c[_0x380f('0x35')],_0x39b48c[_0x380f('0x30')]);_0x243d62['attributes']=_[_0x380f('0x33')](_0x39b48c[_0x380f('0x35')],qs[_0x380f('0x36')](_0x42b898[_0x380f('0x30')][_0x380f('0x36')]));_0x243d62[_0x380f('0x34')]=_0x243d62[_0x380f('0x34')][_0x380f('0x37')]?_0x243d62[_0x380f('0x34')]:_0x39b48c[_0x380f('0x35')];_0x243d62[_0x380f('0x4f')]=qs[_0x380f('0x3a')](_0x42b898[_0x380f('0x30')]['sort']);_0x243d62[_0x380f('0x3b')]=qs[_0x380f('0x32')](_[_0x380f('0x3c')](_0x42b898[_0x380f('0x30')],_0x39b48c['filters']));if(_0x42b898[_0x380f('0x30')][_0x380f('0x3d')]){_0x243d62['where']=_['merge'](_0x243d62[_0x380f('0x3b')],{'$or':_['map'](_0x243d62[_0x380f('0x34')],function(_0x33d925){var _0x4e46c0={};_0x4e46c0[_0x33d925]={'$like':'%'+_0x42b898[_0x380f('0x30')][_0x380f('0x3d')]+'%'};return _0x4e46c0;})});}_0x243d62=_[_0x380f('0x3e')]({},_0x243d62,_0x42b898[_0x380f('0x42')]);return _0x16bb56[_0x380f('0x51')](_0x243d62);}})['then'](function(_0x40100f){if(_0x40100f){_0x327954=_0x40100f[_0x380f('0x37')];if(!_0x42b898['query']['hasOwnProperty'](_0x380f('0x38'))){_0x243d62[_0x380f('0x39')]=qs['limit'](_0x42b898['query'][_0x380f('0x39')]);_0x243d62[_0x380f('0x1b')]=qs['offset'](_0x42b898[_0x380f('0x30')]['offset']);}return _0x16bb56['getSubjects'](_0x243d62);}})['then'](function(_0xc18090){if(_0xc18090){return _0xc18090?{'count':_0x327954,'rows':_0xc18090}:null;}})['then'](respondWithResult(_0x4b475c,null))[_0x380f('0x46')](handleError(_0x4b475c,null));};exports[_0x380f('0x52')]=function(_0x22b937,_0x5e719e,_0x51ca81){var _0x4b4f99={};var _0x35563e={};var _0x5350ef;var _0x11568f;return db[_0x380f('0x2c')]['findOne']({'where':{'id':_0x22b937[_0x380f('0x48')]['id']}})[_0x380f('0x26')](handleEntityNotFound(_0x5e719e,null))[_0x380f('0x26')](function(_0x392948){if(_0x392948){_0x5350ef=_0x392948;_0x35563e[_0x380f('0x35')]=_[_0x380f('0x31')](db[_0x380f('0x4e')][_0x380f('0x2d')]);_0x35563e['query']=_[_0x380f('0x31')](_0x22b937['query']);_0x35563e[_0x380f('0x32')]=_['intersection'](_0x35563e[_0x380f('0x35')],_0x35563e['query']);_0x4b4f99[_0x380f('0x34')]=_[_0x380f('0x33')](_0x35563e[_0x380f('0x35')],qs[_0x380f('0x36')](_0x22b937[_0x380f('0x30')][_0x380f('0x36')]));_0x4b4f99[_0x380f('0x34')]=_0x4b4f99[_0x380f('0x34')][_0x380f('0x37')]?_0x4b4f99[_0x380f('0x34')]:_0x35563e['model'];_0x4b4f99['order']=qs[_0x380f('0x3a')](_0x22b937['query'][_0x380f('0x3a')]);_0x4b4f99[_0x380f('0x3b')]=qs['filters'](_[_0x380f('0x3c')](_0x22b937[_0x380f('0x30')],_0x35563e[_0x380f('0x32')]));if(_0x22b937[_0x380f('0x30')]['filter']){_0x4b4f99[_0x380f('0x3b')]=_[_0x380f('0x3e')](_0x4b4f99[_0x380f('0x3b')],{'$or':_[_0x380f('0x3f')](_0x4b4f99[_0x380f('0x34')],function(_0x42d634){var _0x3b87d5={};_0x3b87d5[_0x42d634]={'$like':'%'+_0x22b937['query'][_0x380f('0x3d')]+'%'};return _0x3b87d5;})});}_0x4b4f99=_[_0x380f('0x3e')]({},_0x4b4f99,_0x22b937['options']);return _0x5350ef[_0x380f('0x52')](_0x4b4f99);}})[_0x380f('0x26')](function(_0xf9b836){if(_0xf9b836){_0x11568f=_0xf9b836[_0x380f('0x37')];if(!_0x22b937[_0x380f('0x30')][_0x380f('0x50')](_0x380f('0x38'))){_0x4b4f99[_0x380f('0x39')]=qs[_0x380f('0x39')](_0x22b937[_0x380f('0x30')][_0x380f('0x39')]);_0x4b4f99['offset']=qs[_0x380f('0x1b')](_0x22b937[_0x380f('0x30')]['offset']);}return _0x5350ef['getDescriptions'](_0x4b4f99);}})[_0x380f('0x26')](function(_0x22d432){if(_0x22d432){return _0x22d432?{'count':_0x11568f,'rows':_0x22d432}:null;}})[_0x380f('0x26')](respondWithResult(_0x5e719e,null))[_0x380f('0x46')](handleError(_0x5e719e,null));};exports['getTags']=function(_0x451611,_0xd44184,_0x7e4b4b){var _0x2b90c4={};var _0x15397d={};var _0x31c394;var _0x1639ad;return db[_0x380f('0x2c')][_0x380f('0x4d')]({'where':{'id':_0x451611['params']['id']}})['then'](handleEntityNotFound(_0xd44184,null))[_0x380f('0x26')](function(_0x50b488){if(_0x50b488){_0x31c394=_0x50b488;_0x15397d[_0x380f('0x35')]=_[_0x380f('0x31')](db[_0x380f('0x53')][_0x380f('0x2d')]);_0x15397d[_0x380f('0x30')]=_[_0x380f('0x31')](_0x451611['query']);_0x15397d[_0x380f('0x32')]=_[_0x380f('0x33')](_0x15397d[_0x380f('0x35')],_0x15397d['query']);_0x2b90c4['attributes']=_['intersection'](_0x15397d[_0x380f('0x35')],qs['fields'](_0x451611['query']['fields']));_0x2b90c4[_0x380f('0x34')]=_0x2b90c4[_0x380f('0x34')][_0x380f('0x37')]?_0x2b90c4[_0x380f('0x34')]:_0x15397d[_0x380f('0x35')];_0x2b90c4[_0x380f('0x4f')]=qs[_0x380f('0x3a')](_0x451611[_0x380f('0x30')][_0x380f('0x3a')]);_0x2b90c4[_0x380f('0x3b')]=qs[_0x380f('0x32')](_[_0x380f('0x3c')](_0x451611[_0x380f('0x30')],_0x15397d[_0x380f('0x32')]));if(_0x451611[_0x380f('0x30')][_0x380f('0x3d')]){_0x2b90c4[_0x380f('0x3b')]=_[_0x380f('0x3e')](_0x2b90c4[_0x380f('0x3b')],{'$or':_[_0x380f('0x3f')](_0x2b90c4['attributes'],function(_0x57cd96){var _0x7f1cc5={};_0x7f1cc5[_0x57cd96]={'$like':'%'+_0x451611['query'][_0x380f('0x3d')]+'%'};return _0x7f1cc5;})});}_0x2b90c4=_[_0x380f('0x3e')]({},_0x2b90c4,_0x451611[_0x380f('0x42')]);return _0x31c394[_0x380f('0x54')](_0x2b90c4);}})[_0x380f('0x26')](function(_0x133d0e){if(_0x133d0e){_0x1639ad=_0x133d0e[_0x380f('0x37')];if(!_0x451611['query'][_0x380f('0x50')](_0x380f('0x38'))){_0x2b90c4[_0x380f('0x39')]=qs[_0x380f('0x39')](_0x451611[_0x380f('0x30')][_0x380f('0x39')]);_0x2b90c4[_0x380f('0x1b')]=qs[_0x380f('0x1b')](_0x451611[_0x380f('0x30')]['offset']);}return _0x31c394[_0x380f('0x54')](_0x2b90c4);}})[_0x380f('0x26')](function(_0x392b12){if(_0x392b12){return _0x392b12?{'count':_0x1639ad,'rows':_0x392b12}:null;}})[_0x380f('0x26')](respondWithResult(_0xd44184,null))[_0x380f('0x46')](handleError(_0xd44184,null));};exports[_0x380f('0x55')]=function(_0x1a5a60,_0x4be237,_0x2a4c53){if(_0x1a5a60[_0x380f('0x4a')]['id']){delete _0x1a5a60[_0x380f('0x4a')]['id'];}return db[_0x380f('0x2c')][_0x380f('0x4d')]({'where':{'id':_0x1a5a60['params']['id']}})[_0x380f('0x26')](handleEntityNotFound(_0x4be237,null))[_0x380f('0x26')](function(_0x5d7818){if(_0x5d7818){return _0x5d7818['setTags'](_0x1a5a60['body']['ids']||[]);}return null;})[_0x380f('0x26')](respondWithResult(_0x4be237,null))[_0x380f('0x46')](handleError(_0x4be237,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 12f629e..cfde525 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 _0x80ed=['api','moment','request-promise','path','rimraf','../../config/environment','exports','DeskConfiguration','int_desk_configurations','lodash','../../config/logger'];(function(_0x10fc93,_0x21777e){var _0x8e0807=function(_0xc5874d){while(--_0xc5874d){_0x10fc93['push'](_0x10fc93['shift']());}};_0x8e0807(++_0x21777e);}(_0x80ed,0x11c));var _0xd80e=function(_0x3afd4a,_0x18d9f1){_0x3afd4a=_0x3afd4a-0x0;var _0x563dd3=_0x80ed[_0x3afd4a];return _0x563dd3;};'use strict';var _=require(_0xd80e('0x0'));var util=require('util');var logger=require(_0xd80e('0x1'))(_0xd80e('0x2'));var moment=require(_0xd80e('0x3'));var BPromise=require('bluebird');var rp=require(_0xd80e('0x4'));var fs=require('fs');var path=require(_0xd80e('0x5'));var rimraf=require(_0xd80e('0x6'));var config=require(_0xd80e('0x7'));var attributes=require('./intDeskConfiguration.attributes');module[_0xd80e('0x8')]=function(_0x2b4742,_0x252fec){return _0x2b4742['define'](_0xd80e('0x9'),attributes,{'tableName':_0xd80e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2a9f=['DeskConfiguration','int_desk_configurations','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define'];(function(_0xf83ad3,_0x1540cb){var _0x2ff6c8=function(_0x434dd8){while(--_0x434dd8){_0xf83ad3['push'](_0xf83ad3['shift']());}};_0x2ff6c8(++_0x1540cb);}(_0x2a9f,0x15e));var _0xf2a9=function(_0x5f0c50,_0x388b62){_0x5f0c50=_0x5f0c50-0x0;var _0x412f1a=_0x2a9f[_0x5f0c50];return _0x412f1a;};'use strict';var _=require(_0xf2a9('0x0'));var util=require('util');var logger=require(_0xf2a9('0x1'))(_0xf2a9('0x2'));var moment=require(_0xf2a9('0x3'));var BPromise=require(_0xf2a9('0x4'));var rp=require(_0xf2a9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf2a9('0x6'));var config=require(_0xf2a9('0x7'));var attributes=require('./intDeskConfiguration.attributes');module[_0xf2a9('0x8')]=function(_0x41bca7,_0x2d54c2){return _0x41bca7[_0xf2a9('0x9')](_0xf2a9('0xa'),attributes,{'tableName':_0xf2a9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index 36c1bfd..e1cdd6e 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 _0x078f=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','util','moment','randomstring','ioredis'];(function(_0x192e24,_0xf5c129){var _0x4c0ce0=function(_0x2bde51){while(--_0x2bde51){_0x192e24['push'](_0x192e24['shift']());}};_0x4c0ce0(++_0xf5c129);}(_0x078f,0x1b4));var _0xf078=function(_0x5944bc,_0x2136e6){_0x5944bc=_0x5944bc-0x0;var _0x567aee=_0x078f[_0x5944bc];return _0x567aee;};'use strict';var _=require('lodash');var util=require(_0xf078('0x0'));var moment=require(_0xf078('0x1'));var BPromise=require('bluebird');var rs=require(_0xf078('0x2'));var fs=require('fs');var Redis=require(_0xf078('0x3'));var db=require(_0xf078('0x4'))['db'];var utils=require(_0xf078('0x5'));var logger=require('../../config/logger')(_0xf078('0x6'));var config=require(_0xf078('0x7'));var jayson=require(_0xf078('0x8'));var client=jayson[_0xf078('0x9')][_0xf078('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x353874,_0xa80959,_0x6ae98a){return new BPromise(function(_0x17d7dc,_0x33c869){return client['request'](_0x353874,_0x6ae98a)[_0xf078('0xb')](function(_0x52943d){logger[_0xf078('0xc')](_0xf078('0xd'),_0xa80959,_0xf078('0xe'));logger[_0xf078('0xf')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0xa80959,_0xf078('0xe'),JSON['stringify'](_0x52943d));if(_0x52943d[_0xf078('0x10')]){if(_0x52943d[_0xf078('0x10')][_0xf078('0x11')]===0x1f4){logger['error']('DeskConfiguration,\x20%s,\x20%s',_0xa80959,_0x52943d[_0xf078('0x10')][_0xf078('0x12')]);return _0x33c869(_0x52943d[_0xf078('0x10')]['message']);}logger[_0xf078('0x10')](_0xf078('0xd'),_0xa80959,_0x52943d['error'][_0xf078('0x12')]);return _0x17d7dc(_0x52943d[_0xf078('0x10')][_0xf078('0x12')]);}else{logger[_0xf078('0xc')](_0xf078('0xd'),_0xa80959,'request\x20sent');_0x17d7dc(_0x52943d['result']['message']);}})[_0xf078('0x13')](function(_0xd5ec14){logger['error']('DeskConfiguration,\x20%s,\x20%s',_0xa80959,_0xd5ec14);_0x33c869(_0xd5ec14);});});} \ No newline at end of file +var _0xd2f5=['result','catch','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','client','http','info','request\x20sent','debug','stringify','error','code','DeskConfiguration,\x20%s,\x20%s','message'];(function(_0x4c58e1,_0x20b18e){var _0x3831c0=function(_0x5aa4c4){while(--_0x5aa4c4){_0x4c58e1['push'](_0x4c58e1['shift']());}};_0x3831c0(++_0x20b18e);}(_0xd2f5,0x12e));var _0x5d2f=function(_0x479ee0,_0x115fbd){_0x479ee0=_0x479ee0-0x0;var _0x2af08b=_0xd2f5[_0x479ee0];return _0x2af08b;};'use strict';var _=require(_0x5d2f('0x0'));var util=require(_0x5d2f('0x1'));var moment=require(_0x5d2f('0x2'));var BPromise=require(_0x5d2f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5d2f('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5d2f('0x5'))(_0x5d2f('0x6'));var config=require(_0x5d2f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5d2f('0x8')][_0x5d2f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xbf53b,_0x57673f,_0x3062bf){return new BPromise(function(_0x72bf9f,_0x330195){return client['request'](_0xbf53b,_0x3062bf)['then'](function(_0x43293d){logger[_0x5d2f('0xa')]('DeskConfiguration,\x20%s,\x20%s',_0x57673f,_0x5d2f('0xb'));logger[_0x5d2f('0xc')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x57673f,'request\x20sent',JSON[_0x5d2f('0xd')](_0x43293d));if(_0x43293d[_0x5d2f('0xe')]){if(_0x43293d['error'][_0x5d2f('0xf')]===0x1f4){logger[_0x5d2f('0xe')](_0x5d2f('0x10'),_0x57673f,_0x43293d[_0x5d2f('0xe')][_0x5d2f('0x11')]);return _0x330195(_0x43293d[_0x5d2f('0xe')][_0x5d2f('0x11')]);}logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x57673f,_0x43293d['error']['message']);return _0x72bf9f(_0x43293d[_0x5d2f('0xe')]['message']);}else{logger[_0x5d2f('0xa')](_0x5d2f('0x10'),_0x57673f,_0x5d2f('0xb'));_0x72bf9f(_0x43293d[_0x5d2f('0x12')]['message']);}})[_0x5d2f('0x13')](function(_0x875750){logger['error'](_0x5d2f('0x10'),_0x57673f,_0x875750);_0x330195(_0x875750);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index a993b04..7b710d0 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 _0x19b6=['update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','/:id','isAuthenticated','post'];(function(_0x200025,_0xd05a72){var _0x5dc99f=function(_0x7ba0bc){while(--_0x7ba0bc){_0x200025['push'](_0x200025['shift']());}};_0x5dc99f(++_0xd05a72);}(_0x19b6,0xa6));var _0x619b=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x19b6[_0x2641f9];return _0x585741;};'use strict';var multer=require('multer');var util=require(_0x619b('0x0'));var path=require(_0x619b('0x1'));var timeout=require(_0x619b('0x2'));var express=require(_0x619b('0x3'));var router=express[_0x619b('0x4')]();var fs_extra=require(_0x619b('0x5'));var auth=require(_0x619b('0x6'));var interaction=require(_0x619b('0x7'));var config=require(_0x619b('0x8'));var controller=require(_0x619b('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x619b('0xa')](_0x619b('0xb'),auth[_0x619b('0xc')](),controller['show']);router[_0x619b('0xd')]('/',auth[_0x619b('0xc')](),controller['create']);router['put'](_0x619b('0xb'),auth['isAuthenticated'](),controller[_0x619b('0xe')]);router[_0x619b('0xf')](_0x619b('0xb'),auth[_0x619b('0xc')](),controller[_0x619b('0x10')]);module[_0x619b('0x11')]=router; \ No newline at end of file +var _0xa0da=['index','isAuthenticated','show','create','put','update','delete','/:id','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intDeskField.controller','get'];(function(_0x4f433e,_0x685d56){var _0x1a58ed=function(_0x43b6d8){while(--_0x43b6d8){_0x4f433e['push'](_0x4f433e['shift']());}};_0x1a58ed(++_0x685d56);}(_0xa0da,0x183));var _0xaa0d=function(_0x4726f6,_0x103cc3){_0x4726f6=_0x4726f6-0x0;var _0x78d355=_0xa0da[_0x4726f6];return _0x78d355;};'use strict';var multer=require(_0xaa0d('0x0'));var util=require('util');var path=require(_0xaa0d('0x1'));var timeout=require(_0xaa0d('0x2'));var express=require(_0xaa0d('0x3'));var router=express[_0xaa0d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xaa0d('0x5'));var interaction=require(_0xaa0d('0x6'));var config=require('../../config/environment');var controller=require(_0xaa0d('0x7'));router[_0xaa0d('0x8')]('/',auth['isAuthenticated'](),controller[_0xaa0d('0x9')]);router[_0xaa0d('0x8')]('/:id',auth[_0xaa0d('0xa')](),controller[_0xaa0d('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xaa0d('0xc')]);router[_0xaa0d('0xd')]('/:id',auth[_0xaa0d('0xa')](),controller[_0xaa0d('0xe')]);router[_0xaa0d('0xf')](_0xaa0d('0x10'),auth[_0xaa0d('0xa')](),controller['destroy']);module[_0xaa0d('0x11')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index baa15a0..f0fa702 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 _0xc3e2=['customVariable','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0xc3e2,0xdb));var _0x2c3e=function(_0x5a194a,_0x3c5897){_0x5a194a=_0x5a194a-0x0;var _0x42ff9e=_0xc3e2[_0x5a194a];return _0x42ff9e;};'use strict';var Sequelize=require(_0x2c3e('0x0'));module[_0x2c3e('0x1')]={'type':{'type':Sequelize[_0x2c3e('0x2')](_0x2c3e('0x3'),'variable','customVariable','keyValue','picklist'),'defaultValue':_0x2c3e('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x2c3e('0x2')](_0x2c3e('0x3'),_0x2c3e('0x4'),_0x2c3e('0x5'))},'keyContent':{'type':Sequelize[_0x2c3e('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x2c3e('0x6')]},'customField':{'type':Sequelize[_0x2c3e('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2c3e('0x6')]}}; \ No newline at end of file +var _0x7fc9=['sequelize','exports','ENUM','string','variable','keyValue','picklist','STRING','BOOLEAN'];(function(_0x1e1636,_0x52ac2b){var _0x310b67=function(_0x18887d){while(--_0x18887d){_0x1e1636['push'](_0x1e1636['shift']());}};_0x310b67(++_0x52ac2b);}(_0x7fc9,0x75));var _0x97fc=function(_0x1297c7,_0x1ff2a5){_0x1297c7=_0x1297c7-0x0;var _0x5c1916=_0x7fc9[_0x1297c7];return _0x5c1916;};'use strict';var Sequelize=require(_0x97fc('0x0'));module[_0x97fc('0x1')]={'type':{'type':Sequelize[_0x97fc('0x2')](_0x97fc('0x3'),_0x97fc('0x4'),'customVariable',_0x97fc('0x5'),_0x97fc('0x6')),'defaultValue':_0x97fc('0x3')},'content':{'type':Sequelize[_0x97fc('0x7')]},'key':{'type':Sequelize[_0x97fc('0x7')]},'keyType':{'type':Sequelize[_0x97fc('0x2')](_0x97fc('0x3'),_0x97fc('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x97fc('0x7')]},'idField':{'type':Sequelize[_0x97fc('0x7')]},'nameField':{'type':Sequelize[_0x97fc('0x7')]},'customField':{'type':Sequelize[_0x97fc('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 4bd71ee..a0e0ff3 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 _0xf30f=['api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','undefined','count','limit','set','Content-Range','json','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','type','DeskField','include','rows','includeAll','options','find','catch','create','body','params','eml-format','rimraf','zip-dir','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x2351fd,_0x5698b1){var _0x17321b=function(_0x6995a7){while(--_0x6995a7){_0x2351fd['push'](_0x2351fd['shift']());}};_0x17321b(++_0x5698b1);}(_0xf30f,0x1a2));var _0xff30=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xf30f[_0x53ccf2];return _0x5a2964;};'use strict';var emlformat=require(_0xff30('0x0'));var rimraf=require(_0xff30('0x1'));var zipdir=require(_0xff30('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xff30('0x3'));var util=require(_0xff30('0x4'));var path=require('path');var sox=require(_0xff30('0x5'));var csv=require(_0xff30('0x6'));var ejs=require(_0xff30('0x7'));var fs=require('fs');var fs_extra=require(_0xff30('0x8'));var _=require(_0xff30('0x9'));var squel=require(_0xff30('0xa'));var crypto=require(_0xff30('0xb'));var jsforce=require(_0xff30('0xc'));var deskjs=require(_0xff30('0xd'));var toCsv=require(_0xff30('0x6'));var querystring=require(_0xff30('0xe'));var Papa=require(_0xff30('0xf'));var Redis=require('ioredis');var authService=require(_0xff30('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xff30('0x11'));var hardwareService=require(_0xff30('0x12'));var logger=require(_0xff30('0x13'))(_0xff30('0x14'));var utils=require(_0xff30('0x15'));var config=require(_0xff30('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xff30('0x17'))['db'];function respondWithStatusCode(_0x2caa62,_0x3ca013){_0x3ca013=_0x3ca013||0xcc;return function(_0x458ec4){if(_0x458ec4){return _0x2caa62['sendStatus'](_0x3ca013);}return _0x2caa62[_0xff30('0x18')](_0x3ca013)[_0xff30('0x19')]();};}function respondWithResult(_0xb88dea,_0x3dcc48){_0x3dcc48=_0x3dcc48||0xc8;return function(_0x37ff55){if(_0x37ff55){return _0xb88dea[_0xff30('0x18')](_0x3dcc48)['json'](_0x37ff55);}};}function respondWithFilteredResult(_0x312d3c,_0x158680){return function(_0x150684){if(_0x150684){var _0x4a777e=typeof _0x158680[_0xff30('0x1a')]==='undefined'&&typeof _0x158680['limit']===_0xff30('0x1b');var _0x3d6a8e=_0x150684[_0xff30('0x1c')];var _0x5788f2=_0x4a777e?0x0:_0x158680[_0xff30('0x1a')];var _0x2205a1=_0x4a777e?_0x150684['count']:_0x158680['offset']+_0x158680[_0xff30('0x1d')];var _0x334b99;if(_0x2205a1>=_0x3d6a8e){_0x2205a1=_0x3d6a8e;_0x334b99=0xc8;}else{_0x334b99=0xce;}_0x312d3c[_0xff30('0x18')](_0x334b99);return _0x312d3c[_0xff30('0x1e')](_0xff30('0x1f'),_0x5788f2+'-'+_0x2205a1+'/'+_0x3d6a8e)[_0xff30('0x20')](_0x150684);}return null;};}function patchUpdates(_0x361cec){return function(_0x1df675){try{jsonpatch['apply'](_0x1df675,_0x361cec,!![]);}catch(_0xd1f5b0){return BPromise[_0xff30('0x21')](_0xd1f5b0);}return _0x1df675['save']();};}function saveUpdates(_0x3ab38c,_0x1a07eb){return function(_0x551d81){if(_0x551d81){return _0x551d81[_0xff30('0x22')](_0x3ab38c)[_0xff30('0x23')](function(_0x280efe){return _0x280efe;});}return null;};}function removeEntity(_0x4c873c,_0x3033f0){return function(_0x21a4a6){if(_0x21a4a6){return _0x21a4a6[_0xff30('0x24')]()[_0xff30('0x23')](function(){_0x4c873c[_0xff30('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x269d4a,_0x2dd7fa){return function(_0xe9c6e4){if(!_0xe9c6e4){_0x269d4a[_0xff30('0x25')](0x194);}return _0xe9c6e4;};}function handleError(_0x22beab,_0xf42bfb){_0xf42bfb=_0xf42bfb||0x1f4;return function(_0x1318d9){logger[_0xff30('0x26')](_0x1318d9[_0xff30('0x27')]);if(_0x1318d9[_0xff30('0x28')]){delete _0x1318d9[_0xff30('0x28')];}_0x22beab[_0xff30('0x18')](_0xf42bfb)[_0xff30('0x29')](_0x1318d9);};}exports[_0xff30('0x2a')]=function(_0x13c591,_0x246aa3){var _0x1a3919={},_0x5bfb7d={},_0xe4cff6={'count':0x0,'rows':[]};var _0x5bdb59=_[_0xff30('0x2b')](db['DeskField'][_0xff30('0x2c')],function(_0x4a9e61){return{'name':_0x4a9e61[_0xff30('0x2d')],'type':_0x4a9e61['type'][_0xff30('0x2e')]};});_0x5bfb7d[_0xff30('0x2f')]=_['map'](_0x5bdb59,_0xff30('0x28'));_0x5bfb7d['query']=_[_0xff30('0x30')](_0x13c591[_0xff30('0x31')]);_0x5bfb7d[_0xff30('0x32')]=_['intersection'](_0x5bfb7d['model'],_0x5bfb7d[_0xff30('0x31')]);_0x1a3919[_0xff30('0x33')]=_[_0xff30('0x34')](_0x5bfb7d[_0xff30('0x2f')],qs[_0xff30('0x35')](_0x13c591['query'][_0xff30('0x35')]));_0x1a3919[_0xff30('0x33')]=_0x1a3919[_0xff30('0x33')][_0xff30('0x36')]?_0x1a3919[_0xff30('0x33')]:_0x5bfb7d[_0xff30('0x2f')];if(!_0x13c591['query']['hasOwnProperty'](_0xff30('0x37'))){_0x1a3919[_0xff30('0x1d')]=qs[_0xff30('0x1d')](_0x13c591['query'][_0xff30('0x1d')]);_0x1a3919[_0xff30('0x1a')]=qs[_0xff30('0x1a')](_0x13c591['query'][_0xff30('0x1a')]);}_0x1a3919[_0xff30('0x38')]=qs[_0xff30('0x39')](_0x13c591[_0xff30('0x31')][_0xff30('0x39')]);_0x1a3919[_0xff30('0x3a')]=qs[_0xff30('0x32')](_[_0xff30('0x3b')](_0x13c591[_0xff30('0x31')],_0x5bfb7d[_0xff30('0x32')]),_0x5bdb59);if(_0x13c591[_0xff30('0x31')][_0xff30('0x3c')]){_0x1a3919['where']=_[_0xff30('0x3d')](_0x1a3919[_0xff30('0x3a')],{'$or':_[_0xff30('0x2b')](_0x5bdb59,function(_0x206f41){if(_0x206f41[_0xff30('0x3e')]!=='VIRTUAL'){var _0x54bd58={};_0x54bd58[_0x206f41[_0xff30('0x28')]]={'$like':'%'+_0x13c591[_0xff30('0x31')]['filter']+'%'};return _0x54bd58;}})});}_0x1a3919=_[_0xff30('0x3d')]({},_0x1a3919,_0x13c591['options']);var _0x5bb2b2={'where':_0x1a3919[_0xff30('0x3a')]};return db[_0xff30('0x3f')]['count'](_0x5bb2b2)[_0xff30('0x23')](function(_0x2f955b){_0xe4cff6['count']=_0x2f955b;if(_0x13c591[_0xff30('0x31')]['includeAll']){_0x1a3919[_0xff30('0x40')]=[{'all':!![]}];}return db[_0xff30('0x3f')]['findAll'](_0x1a3919);})[_0xff30('0x23')](function(_0x4f239b){_0xe4cff6[_0xff30('0x41')]=_0x4f239b;return _0xe4cff6;})[_0xff30('0x23')](respondWithFilteredResult(_0x246aa3,_0x1a3919))['catch'](handleError(_0x246aa3,null));};exports['show']=function(_0x36140d,_0x1256da){var _0x22f91c={'raw':!![],'where':{'id':_0x36140d['params']['id']}},_0x3c18ec={};_0x3c18ec['model']=_['keys'](db[_0xff30('0x3f')]['rawAttributes']);_0x3c18ec[_0xff30('0x31')]=_['keys'](_0x36140d['query']);_0x3c18ec[_0xff30('0x32')]=_['intersection'](_0x3c18ec[_0xff30('0x2f')],_0x3c18ec[_0xff30('0x31')]);_0x22f91c['attributes']=_[_0xff30('0x34')](_0x3c18ec[_0xff30('0x2f')],qs['fields'](_0x36140d['query'][_0xff30('0x35')]));_0x22f91c[_0xff30('0x33')]=_0x22f91c['attributes'][_0xff30('0x36')]?_0x22f91c['attributes']:_0x3c18ec[_0xff30('0x2f')];if(_0x36140d[_0xff30('0x31')][_0xff30('0x42')]){_0x22f91c['include']=[{'all':!![]}];}_0x22f91c=_['merge']({},_0x22f91c,_0x36140d[_0xff30('0x43')]);return db[_0xff30('0x3f')][_0xff30('0x44')](_0x22f91c)[_0xff30('0x23')](handleEntityNotFound(_0x1256da,null))[_0xff30('0x23')](respondWithResult(_0x1256da,null))[_0xff30('0x45')](handleError(_0x1256da,null));};exports['create']=function(_0x7c33f7,_0x4675c7){return db[_0xff30('0x3f')][_0xff30('0x46')](_0x7c33f7['body'],{})[_0xff30('0x23')](respondWithResult(_0x4675c7,0xc9))[_0xff30('0x45')](handleError(_0x4675c7,null));};exports[_0xff30('0x22')]=function(_0x224cf2,_0x39b3d4){if(_0x224cf2['body']['id']){delete _0x224cf2[_0xff30('0x47')]['id'];}return db[_0xff30('0x3f')][_0xff30('0x44')]({'where':{'id':_0x224cf2[_0xff30('0x48')]['id']}})[_0xff30('0x23')](handleEntityNotFound(_0x39b3d4,null))['then'](saveUpdates(_0x224cf2[_0xff30('0x47')],null))[_0xff30('0x23')](respondWithResult(_0x39b3d4,null))[_0xff30('0x45')](handleError(_0x39b3d4,null));};exports[_0xff30('0x24')]=function(_0x571813,_0x902532){return db['DeskField']['find']({'where':{'id':_0x571813[_0xff30('0x48')]['id']}})['then'](handleEntityNotFound(_0x902532,null))[_0xff30('0x23')](removeEntity(_0x902532,null))[_0xff30('0x45')](handleError(_0x902532,null));}; \ No newline at end of file +var _0x196b=['includeAll','include','rows','params','keys','find','catch','create','update','body','destroy','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','Content-Range','reject','save','sendStatus','stack','send','index','map','DeskField','rawAttributes','type','key','model','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','options','then'];(function(_0x38537f,_0x252124){var _0x141e23=function(_0x2809b5){while(--_0x2809b5){_0x38537f['push'](_0x38537f['shift']());}};_0x141e23(++_0x252124);}(_0x196b,0x9d));var _0xb196=function(_0x18b6da,_0x3aa88c){_0x18b6da=_0x18b6da-0x0;var _0x19d506=_0x196b[_0x18b6da];return _0x19d506;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb196('0x0'));var jsonpatch=require(_0xb196('0x1'));var rp=require(_0xb196('0x2'));var moment=require(_0xb196('0x3'));var BPromise=require(_0xb196('0x4'));var Mustache=require(_0xb196('0x5'));var util=require(_0xb196('0x6'));var path=require(_0xb196('0x7'));var sox=require(_0xb196('0x8'));var csv=require('to-csv');var ejs=require(_0xb196('0x9'));var fs=require('fs');var fs_extra=require(_0xb196('0xa'));var _=require(_0xb196('0xb'));var squel=require(_0xb196('0xc'));var crypto=require('crypto');var jsforce=require(_0xb196('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb196('0xe'));var querystring=require(_0xb196('0xf'));var Papa=require(_0xb196('0x10'));var Redis=require(_0xb196('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xb196('0x12'));var as=require(_0xb196('0x13'));var hardwareService=require(_0xb196('0x14'));var logger=require(_0xb196('0x15'))('api');var utils=require(_0xb196('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xb196('0x17'));var db=require(_0xb196('0x18'))['db'];function respondWithStatusCode(_0x292915,_0x3deb0f){_0x3deb0f=_0x3deb0f||0xcc;return function(_0x30dd59){if(_0x30dd59){return _0x292915['sendStatus'](_0x3deb0f);}return _0x292915[_0xb196('0x19')](_0x3deb0f)[_0xb196('0x1a')]();};}function respondWithResult(_0x1473f3,_0x44b7fa){_0x44b7fa=_0x44b7fa||0xc8;return function(_0x184886){if(_0x184886){return _0x1473f3[_0xb196('0x19')](_0x44b7fa)[_0xb196('0x1b')](_0x184886);}};}function respondWithFilteredResult(_0x24b266,_0x5d059f){return function(_0x3e8cb1){if(_0x3e8cb1){var _0x411dc0=typeof _0x5d059f[_0xb196('0x1c')]===_0xb196('0x1d')&&typeof _0x5d059f['limit']===_0xb196('0x1d');var _0x32402f=_0x3e8cb1['count'];var _0x2a85c4=_0x411dc0?0x0:_0x5d059f[_0xb196('0x1c')];var _0x3f8adf=_0x411dc0?_0x3e8cb1[_0xb196('0x1e')]:_0x5d059f[_0xb196('0x1c')]+_0x5d059f['limit'];var _0x28d593;if(_0x3f8adf>=_0x32402f){_0x3f8adf=_0x32402f;_0x28d593=0xc8;}else{_0x28d593=0xce;}_0x24b266[_0xb196('0x19')](_0x28d593);return _0x24b266['set'](_0xb196('0x1f'),_0x2a85c4+'-'+_0x3f8adf+'/'+_0x32402f)[_0xb196('0x1b')](_0x3e8cb1);}return null;};}function patchUpdates(_0x2d0519){return function(_0x3f3ac2){try{jsonpatch['apply'](_0x3f3ac2,_0x2d0519,!![]);}catch(_0x5ba94d){return BPromise[_0xb196('0x20')](_0x5ba94d);}return _0x3f3ac2[_0xb196('0x21')]();};}function saveUpdates(_0x3d3f69,_0x290296){return function(_0x3839f0){if(_0x3839f0){return _0x3839f0['update'](_0x3d3f69)['then'](function(_0x585176){return _0x585176;});}return null;};}function removeEntity(_0x4deb2b,_0x342745){return function(_0x349c5e){if(_0x349c5e){return _0x349c5e['destroy']()['then'](function(){_0x4deb2b['status'](0xcc)[_0xb196('0x1a')]();});}};}function handleEntityNotFound(_0x8209ac,_0x2b9e84){return function(_0x925535){if(!_0x925535){_0x8209ac[_0xb196('0x22')](0x194);}return _0x925535;};}function handleError(_0x855ae2,_0x3b902f){_0x3b902f=_0x3b902f||0x1f4;return function(_0x1e2140){logger['error'](_0x1e2140[_0xb196('0x23')]);if(_0x1e2140['name']){delete _0x1e2140['name'];}_0x855ae2['status'](_0x3b902f)[_0xb196('0x24')](_0x1e2140);};}exports[_0xb196('0x25')]=function(_0x16dd6d,_0x3cf946){var _0x1a0049={},_0x50de49={},_0x205e5f={'count':0x0,'rows':[]};var _0x34a1ab=_[_0xb196('0x26')](db[_0xb196('0x27')][_0xb196('0x28')],function(_0x1988af){return{'name':_0x1988af['fieldName'],'type':_0x1988af[_0xb196('0x29')][_0xb196('0x2a')]};});_0x50de49[_0xb196('0x2b')]=_[_0xb196('0x26')](_0x34a1ab,_0xb196('0x2c'));_0x50de49[_0xb196('0x2d')]=_['keys'](_0x16dd6d[_0xb196('0x2d')]);_0x50de49[_0xb196('0x2e')]=_[_0xb196('0x2f')](_0x50de49[_0xb196('0x2b')],_0x50de49[_0xb196('0x2d')]);_0x1a0049[_0xb196('0x30')]=_[_0xb196('0x2f')](_0x50de49['model'],qs['fields'](_0x16dd6d[_0xb196('0x2d')][_0xb196('0x31')]));_0x1a0049[_0xb196('0x30')]=_0x1a0049[_0xb196('0x30')][_0xb196('0x32')]?_0x1a0049[_0xb196('0x30')]:_0x50de49['model'];if(!_0x16dd6d[_0xb196('0x2d')][_0xb196('0x33')](_0xb196('0x34'))){_0x1a0049['limit']=qs[_0xb196('0x35')](_0x16dd6d['query'][_0xb196('0x35')]);_0x1a0049[_0xb196('0x1c')]=qs[_0xb196('0x1c')](_0x16dd6d[_0xb196('0x2d')][_0xb196('0x1c')]);}_0x1a0049[_0xb196('0x36')]=qs['sort'](_0x16dd6d[_0xb196('0x2d')][_0xb196('0x37')]);_0x1a0049[_0xb196('0x38')]=qs['filters'](_['pick'](_0x16dd6d[_0xb196('0x2d')],_0x50de49['filters']),_0x34a1ab);if(_0x16dd6d[_0xb196('0x2d')][_0xb196('0x39')]){_0x1a0049[_0xb196('0x38')]=_[_0xb196('0x3a')](_0x1a0049[_0xb196('0x38')],{'$or':_['map'](_0x34a1ab,function(_0x148a99){if(_0x148a99[_0xb196('0x29')]!==_0xb196('0x3b')){var _0x38748d={};_0x38748d[_0x148a99['name']]={'$like':'%'+_0x16dd6d[_0xb196('0x2d')][_0xb196('0x39')]+'%'};return _0x38748d;}})});}_0x1a0049=_[_0xb196('0x3a')]({},_0x1a0049,_0x16dd6d[_0xb196('0x3c')]);var _0x42c8a4={'where':_0x1a0049[_0xb196('0x38')]};return db['DeskField'][_0xb196('0x1e')](_0x42c8a4)[_0xb196('0x3d')](function(_0x33a6c4){_0x205e5f[_0xb196('0x1e')]=_0x33a6c4;if(_0x16dd6d['query'][_0xb196('0x3e')]){_0x1a0049[_0xb196('0x3f')]=[{'all':!![]}];}return db[_0xb196('0x27')]['findAll'](_0x1a0049);})['then'](function(_0x390f7d){_0x205e5f[_0xb196('0x40')]=_0x390f7d;return _0x205e5f;})[_0xb196('0x3d')](respondWithFilteredResult(_0x3cf946,_0x1a0049))['catch'](handleError(_0x3cf946,null));};exports['show']=function(_0x357d9a,_0x1eb1f1){var _0x41f9ec={'raw':!![],'where':{'id':_0x357d9a[_0xb196('0x41')]['id']}},_0x12a460={};_0x12a460[_0xb196('0x2b')]=_[_0xb196('0x42')](db['DeskField'][_0xb196('0x28')]);_0x12a460[_0xb196('0x2d')]=_[_0xb196('0x42')](_0x357d9a[_0xb196('0x2d')]);_0x12a460[_0xb196('0x2e')]=_[_0xb196('0x2f')](_0x12a460[_0xb196('0x2b')],_0x12a460['query']);_0x41f9ec[_0xb196('0x30')]=_['intersection'](_0x12a460[_0xb196('0x2b')],qs[_0xb196('0x31')](_0x357d9a[_0xb196('0x2d')][_0xb196('0x31')]));_0x41f9ec[_0xb196('0x30')]=_0x41f9ec['attributes'][_0xb196('0x32')]?_0x41f9ec['attributes']:_0x12a460['model'];if(_0x357d9a[_0xb196('0x2d')][_0xb196('0x3e')]){_0x41f9ec[_0xb196('0x3f')]=[{'all':!![]}];}_0x41f9ec=_[_0xb196('0x3a')]({},_0x41f9ec,_0x357d9a[_0xb196('0x3c')]);return db[_0xb196('0x27')][_0xb196('0x43')](_0x41f9ec)[_0xb196('0x3d')](handleEntityNotFound(_0x1eb1f1,null))['then'](respondWithResult(_0x1eb1f1,null))[_0xb196('0x44')](handleError(_0x1eb1f1,null));};exports[_0xb196('0x45')]=function(_0x53d826,_0x312212){return db[_0xb196('0x27')][_0xb196('0x45')](_0x53d826['body'],{})[_0xb196('0x3d')](respondWithResult(_0x312212,0xc9))[_0xb196('0x44')](handleError(_0x312212,null));};exports[_0xb196('0x46')]=function(_0x5f2be5,_0x56d4a8){if(_0x5f2be5[_0xb196('0x47')]['id']){delete _0x5f2be5[_0xb196('0x47')]['id'];}return db[_0xb196('0x27')][_0xb196('0x43')]({'where':{'id':_0x5f2be5[_0xb196('0x41')]['id']}})[_0xb196('0x3d')](handleEntityNotFound(_0x56d4a8,null))[_0xb196('0x3d')](saveUpdates(_0x5f2be5[_0xb196('0x47')],null))[_0xb196('0x3d')](respondWithResult(_0x56d4a8,null))[_0xb196('0x44')](handleError(_0x56d4a8,null));};exports[_0xb196('0x48')]=function(_0x37bf20,_0x360418){return db[_0xb196('0x27')][_0xb196('0x43')]({'where':{'id':_0x37bf20[_0xb196('0x41')]['id']}})['then'](handleEntityNotFound(_0x360418,null))[_0xb196('0x3d')](removeEntity(_0x360418,null))[_0xb196('0x44')](handleError(_0x360418,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 9a66326..d703fd4 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 _0xccff=['./intDeskField.attributes','exports','DeskField','int_desk_fields','desk_unique_index','idField','FieldId','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x872b02,_0x4f4458){var _0x1a6b24=function(_0x1dfb4e){while(--_0x1dfb4e){_0x872b02['push'](_0x872b02['shift']());}};_0x1a6b24(++_0x4f4458);}(_0xccff,0xca));var _0xfccf=function(_0xff5ccf,_0x52fc10){_0xff5ccf=_0xff5ccf-0x0;var _0x41dbec=_0xccff[_0xff5ccf];return _0x41dbec;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xfccf('0x0'));var moment=require(_0xfccf('0x1'));var BPromise=require(_0xfccf('0x2'));var rp=require(_0xfccf('0x3'));var fs=require('fs');var path=require(_0xfccf('0x4'));var rimraf=require('rimraf');var config=require(_0xfccf('0x5'));var attributes=require(_0xfccf('0x6'));module[_0xfccf('0x7')]=function(_0x3b439f,_0x3170e9){return _0x3b439f['define'](_0xfccf('0x8'),attributes,{'tableName':_0xfccf('0x9'),'paranoid':![],'indexes':[{'name':_0xfccf('0xa'),'fields':[_0xfccf('0xb'),_0xfccf('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcbdb=['util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskField.attributes','exports','DeskField','int_desk_fields','desk_unique_index','idField','FieldId','lodash'];(function(_0x1970cb,_0x4c7d7f){var _0x587d33=function(_0x5ca06b){while(--_0x5ca06b){_0x1970cb['push'](_0x1970cb['shift']());}};_0x587d33(++_0x4c7d7f);}(_0xcbdb,0xfe));var _0xbcbd=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0xcbdb[_0x1e7b16];return _0x37fadc;};'use strict';var _=require(_0xbcbd('0x0'));var util=require(_0xbcbd('0x1'));var logger=require(_0xbcbd('0x2'))('api');var moment=require('moment');var BPromise=require(_0xbcbd('0x3'));var rp=require(_0xbcbd('0x4'));var fs=require('fs');var path=require(_0xbcbd('0x5'));var rimraf=require(_0xbcbd('0x6'));var config=require(_0xbcbd('0x7'));var attributes=require(_0xbcbd('0x8'));module[_0xbcbd('0x9')]=function(_0x59204f,_0x10ea94){return _0x59204f['define'](_0xbcbd('0xa'),attributes,{'tableName':_0xbcbd('0xb'),'paranoid':![],'indexes':[{'name':_0xbcbd('0xc'),'fields':[_0xbcbd('0xd'),_0xbcbd('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index 6643ec5..d1e2db7 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 _0x2b9f=['catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','DeskField,\x20%s,\x20%s','request\x20sent','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x2ecb8b,_0x4d2942){var _0x4769c5=function(_0x159613){while(--_0x159613){_0x2ecb8b['push'](_0x2ecb8b['shift']());}};_0x4769c5(++_0x4d2942);}(_0x2b9f,0x12c));var _0xf2b9=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0x2b9f[_0x1ccdf7];return _0x52a0ae;};'use strict';var _=require(_0xf2b9('0x0'));var util=require(_0xf2b9('0x1'));var moment=require(_0xf2b9('0x2'));var BPromise=require(_0xf2b9('0x3'));var rs=require(_0xf2b9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf2b9('0x5'))['db'];var utils=require(_0xf2b9('0x6'));var logger=require(_0xf2b9('0x7'))(_0xf2b9('0x8'));var config=require(_0xf2b9('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf2b9('0xa')][_0xf2b9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x41afd7,_0x5610d9,_0x103b05){return new BPromise(function(_0x50fa46,_0x2321ea){return client[_0xf2b9('0xc')](_0x41afd7,_0x103b05)[_0xf2b9('0xd')](function(_0x5b0207){logger['info'](_0xf2b9('0xe'),_0x5610d9,_0xf2b9('0xf'));logger['debug'](_0xf2b9('0x10'),_0x5610d9,_0xf2b9('0xf'),JSON[_0xf2b9('0x11')](_0x5b0207));if(_0x5b0207[_0xf2b9('0x12')]){if(_0x5b0207[_0xf2b9('0x12')][_0xf2b9('0x13')]===0x1f4){logger[_0xf2b9('0x12')](_0xf2b9('0xe'),_0x5610d9,_0x5b0207[_0xf2b9('0x12')][_0xf2b9('0x14')]);return _0x2321ea(_0x5b0207['error'][_0xf2b9('0x14')]);}logger[_0xf2b9('0x12')](_0xf2b9('0xe'),_0x5610d9,_0x5b0207['error'][_0xf2b9('0x14')]);return _0x50fa46(_0x5b0207['error']['message']);}else{logger['info'](_0xf2b9('0xe'),_0x5610d9,_0xf2b9('0xf'));_0x50fa46(_0x5b0207[_0xf2b9('0x15')][_0xf2b9('0x14')]);}})[_0xf2b9('0x16')](function(_0x5045e4){logger[_0xf2b9('0x12')]('DeskField,\x20%s,\x20%s',_0x5610d9,_0x5045e4);_0x2321ea(_0x5045e4);});});} \ No newline at end of file +var _0x1567=['info','result','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','client','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0xcddf96,_0x314ee1){var _0x3a9b24=function(_0x1dc134){while(--_0x1dc134){_0xcddf96['push'](_0xcddf96['shift']());}};_0x3a9b24(++_0x314ee1);}(_0x1567,0x1c4));var _0x7156=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x1567[_0x2be8c2];return _0x97f531;};'use strict';var _=require(_0x7156('0x0'));var util=require(_0x7156('0x1'));var moment=require(_0x7156('0x2'));var BPromise=require(_0x7156('0x3'));var rs=require(_0x7156('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7156('0x5'));var logger=require(_0x7156('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7156('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1aec27,_0x15b066,_0x3c5fc9){return new BPromise(function(_0x4e278b,_0x5a293f){return client['request'](_0x1aec27,_0x3c5fc9)['then'](function(_0xfc77b2){logger['info'](_0x7156('0x8'),_0x15b066,_0x7156('0x9'));logger[_0x7156('0xa')](_0x7156('0xb'),_0x15b066,_0x7156('0x9'),JSON[_0x7156('0xc')](_0xfc77b2));if(_0xfc77b2[_0x7156('0xd')]){if(_0xfc77b2[_0x7156('0xd')][_0x7156('0xe')]===0x1f4){logger[_0x7156('0xd')]('DeskField,\x20%s,\x20%s',_0x15b066,_0xfc77b2['error'][_0x7156('0xf')]);return _0x5a293f(_0xfc77b2['error'][_0x7156('0xf')]);}logger[_0x7156('0xd')](_0x7156('0x8'),_0x15b066,_0xfc77b2[_0x7156('0xd')][_0x7156('0xf')]);return _0x4e278b(_0xfc77b2[_0x7156('0xd')][_0x7156('0xf')]);}else{logger[_0x7156('0x10')]('DeskField,\x20%s,\x20%s',_0x15b066,'request\x20sent');_0x4e278b(_0xfc77b2[_0x7156('0x11')][_0x7156('0xf')]);}})['catch'](function(_0x45791d){logger[_0x7156('0xd')](_0x7156('0x8'),_0x15b066,_0x45791d);_0x5a293f(_0x45791d);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index a030f29..1dfe56c 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 _0xaa5e=['index','get','isAuthenticated','/:id/fields','getFields','post','/:id/configurations','addConfiguration','/:id','update','delete','destroy','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller'];(function(_0x232c93,_0x3863ec){var _0x4ce391=function(_0x123c4a){while(--_0x123c4a){_0x232c93['push'](_0x232c93['shift']());}};_0x4ce391(++_0x3863ec);}(_0xaa5e,0x109));var _0xeaa5=function(_0x13a138,_0x177583){_0x13a138=_0x13a138-0x0;var _0x3dcd7e=_0xaa5e[_0x13a138];return _0x3dcd7e;};'use strict';var multer=require('multer');var util=require(_0xeaa5('0x0'));var path=require('path');var timeout=require(_0xeaa5('0x1'));var express=require(_0xeaa5('0x2'));var router=express['Router']();var fs_extra=require(_0xeaa5('0x3'));var auth=require(_0xeaa5('0x4'));var interaction=require(_0xeaa5('0x5'));var config=require(_0xeaa5('0x6'));var controller=require(_0xeaa5('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xeaa5('0x8')]);router[_0xeaa5('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xeaa5('0x9')]('/:id/configurations',auth[_0xeaa5('0xa')](),controller['getConfigurations']);router[_0xeaa5('0x9')](_0xeaa5('0xb'),auth[_0xeaa5('0xa')](),controller[_0xeaa5('0xc')]);router[_0xeaa5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xeaa5('0xd')](_0xeaa5('0xe'),auth['isAuthenticated'](),controller[_0xeaa5('0xf')]);router['put'](_0xeaa5('0x10'),auth['isAuthenticated'](),controller[_0xeaa5('0x11')]);router[_0xeaa5('0x12')](_0xeaa5('0x10'),auth[_0xeaa5('0xa')](),controller[_0xeaa5('0x13')]);module[_0xeaa5('0x14')]=router; \ No newline at end of file +var _0xc712=['/:id','show','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','get','isAuthenticated','index'];(function(_0x59f7e2,_0x2d663d){var _0x345a54=function(_0x4d7fff){while(--_0x4d7fff){_0x59f7e2['push'](_0x59f7e2['shift']());}};_0x345a54(++_0x2d663d);}(_0xc712,0x14f));var _0x2c71=function(_0x3873c7,_0x4711c9){_0x3873c7=_0x3873c7-0x0;var _0x32d6ab=_0xc712[_0x3873c7];return _0x32d6ab;};'use strict';var multer=require(_0x2c71('0x0'));var util=require('util');var path=require(_0x2c71('0x1'));var timeout=require(_0x2c71('0x2'));var express=require(_0x2c71('0x3'));var router=express[_0x2c71('0x4')]();var fs_extra=require(_0x2c71('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2c71('0x6'));var controller=require('./intDynamics365Account.controller');router[_0x2c71('0x7')]('/',auth[_0x2c71('0x8')](),controller[_0x2c71('0x9')]);router[_0x2c71('0x7')](_0x2c71('0xa'),auth[_0x2c71('0x8')](),controller[_0x2c71('0xb')]);router[_0x2c71('0x7')](_0x2c71('0xc'),auth[_0x2c71('0x8')](),controller[_0x2c71('0xd')]);router[_0x2c71('0x7')]('/:id/fields',auth['isAuthenticated'](),controller[_0x2c71('0xe')]);router[_0x2c71('0xf')]('/',auth[_0x2c71('0x8')](),controller[_0x2c71('0x10')]);router['post']('/:id/configurations',auth[_0x2c71('0x8')](),controller[_0x2c71('0x11')]);router[_0x2c71('0x12')](_0x2c71('0xa'),auth['isAuthenticated'](),controller[_0x2c71('0x13')]);router[_0x2c71('0x14')](_0x2c71('0xa'),auth[_0x2c71('0x8')](),controller[_0x2c71('0x15')]);module[_0x2c71('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 1979fcf..6dd8840 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 _0x0c23=['STRING','BOOLEAN','sequelize','exports'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x0c23,0x13e));var _0x30c2=function(_0x161d8c,_0x11c402){_0x161d8c=_0x161d8c-0x0;var _0xac3f68=_0x0c23[_0x161d8c];return _0xac3f68;};'use strict';var Sequelize=require(_0x30c2('0x0'));module[_0x30c2('0x1')]={'name':{'type':Sequelize[_0x30c2('0x2')]},'username':{'type':Sequelize[_0x30c2('0x2')]},'password':{'type':Sequelize[_0x30c2('0x2')]},'remoteUri':{'type':Sequelize[_0x30c2('0x2')]},'tenantId':{'type':Sequelize[_0x30c2('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x30c2('0x2')]},'serverUrl':{'type':Sequelize[_0x30c2('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x30c2('0x2')]},'modernAuthentication':{'type':Sequelize[_0x30c2('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x644f=['STRING','BOOLEAN','sequelize','exports'];(function(_0x4d0f63,_0x5afb65){var _0x188a87=function(_0x20066d){while(--_0x20066d){_0x4d0f63['push'](_0x4d0f63['shift']());}};_0x188a87(++_0x5afb65);}(_0x644f,0xc2));var _0xf644=function(_0x5d8631,_0x44944b){_0x5d8631=_0x5d8631-0x0;var _0x34c15e=_0x644f[_0x5d8631];return _0x34c15e;};'use strict';var Sequelize=require(_0xf644('0x0'));module[_0xf644('0x1')]={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xf644('0x2')]},'remoteUri':{'type':Sequelize[_0xf644('0x2')]},'tenantId':{'type':Sequelize[_0xf644('0x2')]},'clientId':{'type':Sequelize[_0xf644('0x2')]},'clientSecret':{'type':Sequelize[_0xf644('0x2')]},'serverUrl':{'type':Sequelize[_0xf644('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xf644('0x2')]},'modernAuthentication':{'type':Sequelize[_0xf644('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 17c16e6..3b14deb 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 _0xde44=['../../components/integrations/configuration','status','offset','undefined','limit','count','Content-Range','json','update','then','end','sendStatus','error','stack','name','send','index','map','Dynamics365Account','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','filter','merge','options','findAll','catch','params','length','includeAll','include','body','find','destroy','getConfigurations','findOne','pick','hasOwnProperty','AccountId','Subjects','getSubjects','channel','getDescriptions','Dynamics365Configuration','create','Dynamics365Field','substring','%s/api/data/v9.0/','ticketType','Incident','title','description','ownerid','caseorigincode','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdonbehalfbyname','emailaddress','entitlementidname','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','responseby','responsiblecontactidname','responsiblecontactidyominame','slaname','socialprofileidname','statuscode','subjectidname','ticketnumber','traversedpath','utcconversiontimezonecode','concat','password','tenantId','clientId','clientSecret','modernAuthentication','data7','CloudProvider','remoteUri','POST','https://login.microsoftonline.com/','/oauth2/token','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','EntityDefinitions(','Attributes','forEach','@odata.type','lastIndexOf','push','MetadataId','all','BooleanAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','MemoAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Label','UserLocalizedLabel','Value',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','OptionSet','FalseOption','false','LogicalName',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','DisplayName','request-promise','util','lodash','../../components/parsers/qs','api','../../mysqldb'];(function(_0x39cf92,_0x54def2){var _0x30a962=function(_0x50dcda){while(--_0x50dcda){_0x39cf92['push'](_0x39cf92['shift']());}};_0x30a962(++_0x54def2);}(_0xde44,0x160));var _0x4de4=function(_0x4a7815,_0x494224){_0x4a7815=_0x4a7815-0x0;var _0x1b8b86=_0xde44[_0x4a7815];return _0x1b8b86;};'use strict';var rp=require(_0x4de4('0x0'));var util=require(_0x4de4('0x1'));var _=require(_0x4de4('0x2'));var qs=require(_0x4de4('0x3'));var logger=require('../../config/logger')(_0x4de4('0x4'));var db=require(_0x4de4('0x5'))['db'];var integrations=require(_0x4de4('0x6'));function respondWithResult(_0x34fb68,_0x85c4fe){_0x85c4fe=_0x85c4fe||0xc8;return function(_0x4c906b){if(_0x4c906b){return _0x34fb68[_0x4de4('0x7')](_0x85c4fe)['json'](_0x4c906b);}};}function respondWithFilteredResult(_0x1794e1,_0x406f08){return function(_0x4f0c11){if(_0x4f0c11){var _0x4f13e7=typeof _0x406f08[_0x4de4('0x8')]===_0x4de4('0x9')&&typeof _0x406f08[_0x4de4('0xa')]==='undefined';var _0xcd37c7=_0x4f0c11['count'];var _0x448ff2=_0x4f13e7?0x0:_0x406f08['offset'];var _0x2bae4b=_0x4f13e7?_0x4f0c11[_0x4de4('0xb')]:_0x406f08['offset']+_0x406f08[_0x4de4('0xa')];var _0x22b204;if(_0x2bae4b>=_0xcd37c7){_0x2bae4b=_0xcd37c7;_0x22b204=0xc8;}else{_0x22b204=0xce;}_0x1794e1['status'](_0x22b204);return _0x1794e1['set'](_0x4de4('0xc'),_0x448ff2+'-'+_0x2bae4b+'/'+_0xcd37c7)[_0x4de4('0xd')](_0x4f0c11);}return null;};}function saveUpdates(_0x2fc62a){return function(_0x4c45f6){if(_0x4c45f6){return _0x4c45f6[_0x4de4('0xe')](_0x2fc62a)[_0x4de4('0xf')](function(_0x1e4851){return _0x1e4851;});}return null;};}function removeEntity(_0x510c05){return function(_0x2a3513){if(_0x2a3513){return _0x2a3513['destroy']()[_0x4de4('0xf')](function(){_0x510c05[_0x4de4('0x7')](0xcc)[_0x4de4('0x10')]();});}};}function handleEntityNotFound(_0x41ffdf){return function(_0x1af75d){if(!_0x1af75d){_0x41ffdf[_0x4de4('0x11')](0x194);}return _0x1af75d;};}function handleError(_0x290843,_0x908533){_0x908533=_0x908533||0x1f4;return function(_0x5c2ef2){logger[_0x4de4('0x12')](_0x5c2ef2[_0x4de4('0x13')]);if(_0x5c2ef2[_0x4de4('0x14')]){delete _0x5c2ef2['name'];}_0x290843[_0x4de4('0x7')](_0x908533)[_0x4de4('0x15')](_0x5c2ef2);};}exports[_0x4de4('0x16')]=function(_0x2c09d8,_0x390422){var _0x3619c6={},_0xf59a2a={},_0xa316a4={'count':0x0,'rows':[]};var _0x446971=_[_0x4de4('0x17')](db[_0x4de4('0x18')][_0x4de4('0x19')],function(_0x2aa440){return{'name':_0x2aa440['fieldName'],'type':_0x2aa440[_0x4de4('0x1a')]['key']};});_0xf59a2a[_0x4de4('0x1b')]=_[_0x4de4('0x17')](_0x446971,_0x4de4('0x14'));_0xf59a2a[_0x4de4('0x1c')]=_[_0x4de4('0x1d')](_0x2c09d8[_0x4de4('0x1c')]);_0xf59a2a[_0x4de4('0x1e')]=_[_0x4de4('0x1f')](_0xf59a2a['model'],_0xf59a2a[_0x4de4('0x1c')]);_0x3619c6[_0x4de4('0x20')]=_[_0x4de4('0x1f')](_0xf59a2a['model'],qs[_0x4de4('0x21')](_0x2c09d8[_0x4de4('0x1c')][_0x4de4('0x21')]));_0x3619c6[_0x4de4('0x20')]=_0x3619c6['attributes']['length']?_0x3619c6[_0x4de4('0x20')]:_0xf59a2a[_0x4de4('0x1b')];if(!_0x2c09d8['query']['hasOwnProperty'](_0x4de4('0x22'))){_0x3619c6['limit']=qs['limit'](_0x2c09d8[_0x4de4('0x1c')][_0x4de4('0xa')]);_0x3619c6[_0x4de4('0x8')]=qs[_0x4de4('0x8')](_0x2c09d8[_0x4de4('0x1c')]['offset']);}_0x3619c6[_0x4de4('0x23')]=qs['sort'](_0x2c09d8[_0x4de4('0x1c')][_0x4de4('0x24')]);_0x3619c6[_0x4de4('0x25')]=qs[_0x4de4('0x1e')](_['pick'](_0x2c09d8[_0x4de4('0x1c')],_0xf59a2a[_0x4de4('0x1e')]),_0x446971);if(_0x2c09d8['query'][_0x4de4('0x26')]){_0x3619c6['where']=_[_0x4de4('0x27')](_0x3619c6[_0x4de4('0x25')],{'$or':_[_0x4de4('0x17')](_0x446971,function(_0x1fb282){if(_0x1fb282[_0x4de4('0x1a')]!=='VIRTUAL'){var _0x41cc49={};_0x41cc49[_0x1fb282['name']]={'$like':'%'+_0x2c09d8[_0x4de4('0x1c')][_0x4de4('0x26')]+'%'};return _0x41cc49;}})});}_0x3619c6=_[_0x4de4('0x27')]({},_0x3619c6,_0x2c09d8[_0x4de4('0x28')]);var _0x2f8f83={'where':_0x3619c6[_0x4de4('0x25')]};return db['Dynamics365Account']['count'](_0x2f8f83)[_0x4de4('0xf')](function(_0x50f683){_0xa316a4[_0x4de4('0xb')]=_0x50f683;if(_0x2c09d8[_0x4de4('0x1c')]['includeAll']){_0x3619c6['include']=[{'all':!![]}];}return db[_0x4de4('0x18')][_0x4de4('0x29')](_0x3619c6);})['then'](function(_0x116968){_0xa316a4['rows']=_0x116968;return _0xa316a4;})[_0x4de4('0xf')](respondWithFilteredResult(_0x390422,_0x3619c6))[_0x4de4('0x2a')](handleError(_0x390422,null));};exports['show']=function(_0x3d6e25,_0x4a8aae){var _0x505bf1={'raw':![],'where':{'id':_0x3d6e25[_0x4de4('0x2b')]['id']}},_0x5dadb9={};_0x5dadb9['model']=_['keys'](db[_0x4de4('0x18')]['rawAttributes']);_0x5dadb9[_0x4de4('0x1c')]=_[_0x4de4('0x1d')](_0x3d6e25[_0x4de4('0x1c')]);_0x5dadb9[_0x4de4('0x1e')]=_[_0x4de4('0x1f')](_0x5dadb9['model'],_0x5dadb9[_0x4de4('0x1c')]);_0x505bf1[_0x4de4('0x20')]=_[_0x4de4('0x1f')](_0x5dadb9[_0x4de4('0x1b')],qs[_0x4de4('0x21')](_0x3d6e25[_0x4de4('0x1c')][_0x4de4('0x21')]));_0x505bf1[_0x4de4('0x20')]=_0x505bf1[_0x4de4('0x20')][_0x4de4('0x2c')]?_0x505bf1[_0x4de4('0x20')]:_0x5dadb9[_0x4de4('0x1b')];if(_0x3d6e25['query'][_0x4de4('0x2d')]){_0x505bf1[_0x4de4('0x2e')]=[{'all':!![]}];}_0x505bf1=_['merge']({},_0x505bf1,_0x3d6e25[_0x4de4('0x28')]);return db[_0x4de4('0x18')]['find'](_0x505bf1)[_0x4de4('0xf')](handleEntityNotFound(_0x4a8aae,null))[_0x4de4('0xf')](respondWithResult(_0x4a8aae,null))[_0x4de4('0x2a')](handleError(_0x4a8aae,null));};exports['create']=function(_0x36f2ce,_0x21c086){return db[_0x4de4('0x18')]['create'](_0x36f2ce[_0x4de4('0x2f')],{})[_0x4de4('0xf')](respondWithResult(_0x21c086,0xc9))[_0x4de4('0x2a')](handleError(_0x21c086,null));};exports[_0x4de4('0xe')]=function(_0x2e9a3d,_0x2af21b){if(_0x2e9a3d[_0x4de4('0x2f')]['id']){delete _0x2e9a3d[_0x4de4('0x2f')]['id'];}return db[_0x4de4('0x18')][_0x4de4('0x30')]({'where':{'id':_0x2e9a3d[_0x4de4('0x2b')]['id']}})[_0x4de4('0xf')](handleEntityNotFound(_0x2af21b,null))[_0x4de4('0xf')](saveUpdates(_0x2e9a3d[_0x4de4('0x2f')],null))['then'](respondWithResult(_0x2af21b,null))[_0x4de4('0x2a')](handleError(_0x2af21b,null));};exports[_0x4de4('0x31')]=function(_0x43cc6f,_0x576d2d){return db[_0x4de4('0x18')][_0x4de4('0x30')]({'where':{'id':_0x43cc6f[_0x4de4('0x2b')]['id']}})[_0x4de4('0xf')](handleEntityNotFound(_0x576d2d,null))[_0x4de4('0xf')](removeEntity(_0x576d2d,null))[_0x4de4('0x2a')](handleError(_0x576d2d,null));};exports[_0x4de4('0x32')]=function(_0x3ebd0d,_0x2c4fe8){var _0x175fa7={};var _0x3ac1c7={};var _0x439f29;var _0x4b95c4;return db[_0x4de4('0x18')][_0x4de4('0x33')]({'where':{'id':_0x3ebd0d[_0x4de4('0x2b')]['id']}})[_0x4de4('0xf')](handleEntityNotFound(_0x2c4fe8,null))[_0x4de4('0xf')](function(_0x219eba){if(_0x219eba){_0x439f29=_0x219eba;_0x3ac1c7['model']=_[_0x4de4('0x1d')](db['Dynamics365Configuration'][_0x4de4('0x19')]);_0x3ac1c7['query']=_[_0x4de4('0x1d')](_0x3ebd0d['query']);_0x3ac1c7[_0x4de4('0x1e')]=_[_0x4de4('0x1f')](_0x3ac1c7[_0x4de4('0x1b')],_0x3ac1c7['query']);_0x175fa7['attributes']=_['intersection'](_0x3ac1c7['model'],qs[_0x4de4('0x21')](_0x3ebd0d[_0x4de4('0x1c')][_0x4de4('0x21')]));_0x175fa7[_0x4de4('0x20')]=_0x175fa7[_0x4de4('0x20')][_0x4de4('0x2c')]?_0x175fa7[_0x4de4('0x20')]:_0x3ac1c7[_0x4de4('0x1b')];_0x175fa7[_0x4de4('0x23')]=qs[_0x4de4('0x24')](_0x3ebd0d[_0x4de4('0x1c')][_0x4de4('0x24')]);_0x175fa7[_0x4de4('0x25')]=qs['filters'](_[_0x4de4('0x34')](_0x3ebd0d['query'],_0x3ac1c7['filters']));if(_0x3ebd0d[_0x4de4('0x1c')][_0x4de4('0x26')]){_0x175fa7[_0x4de4('0x25')]=_[_0x4de4('0x27')](_0x175fa7[_0x4de4('0x25')],{'$or':_[_0x4de4('0x17')](_0x175fa7[_0x4de4('0x20')],function(_0xf01ac){var _0x5e47b4={};_0x5e47b4[_0xf01ac]={'$like':'%'+_0x3ebd0d[_0x4de4('0x1c')][_0x4de4('0x26')]+'%'};return _0x5e47b4;})});}_0x175fa7=_[_0x4de4('0x27')]({},_0x175fa7,_0x3ebd0d[_0x4de4('0x28')]);return _0x439f29[_0x4de4('0x32')](_0x175fa7);}})[_0x4de4('0xf')](function(_0x1281df){if(_0x1281df){_0x4b95c4=_0x1281df[_0x4de4('0x2c')];if(!_0x3ebd0d[_0x4de4('0x1c')][_0x4de4('0x35')](_0x4de4('0x22'))){_0x175fa7[_0x4de4('0xa')]=qs[_0x4de4('0xa')](_0x3ebd0d[_0x4de4('0x1c')][_0x4de4('0xa')]);_0x175fa7[_0x4de4('0x8')]=qs[_0x4de4('0x8')](_0x3ebd0d[_0x4de4('0x1c')]['offset']);}return _0x439f29[_0x4de4('0x32')](_0x175fa7);}})[_0x4de4('0xf')](function(_0x554471){if(_0x554471){return _0x554471?{'count':_0x4b95c4,'rows':_0x554471}:null;}})['then'](respondWithResult(_0x2c4fe8,null))['catch'](handleError(_0x2c4fe8,null));};exports['addConfiguration']=function(_0x58482e,_0x727e91){if(_0x58482e[_0x4de4('0x2f')]['id']){delete _0x58482e[_0x4de4('0x2f')]['id'];}return db['Dynamics365Account'][_0x4de4('0x33')]({'where':{'id':_0x58482e['params']['id']}})['then'](handleEntityNotFound(_0x727e91,null))[_0x4de4('0xf')](function(_0x113162){if(_0x113162){_0x58482e[_0x4de4('0x2f')][_0x4de4('0x36')]=_0x113162['id'];_0x58482e['body'][_0x4de4('0x37')]=integrations[_0x4de4('0x38')](_0x58482e['body'][_0x4de4('0x39')],_0x58482e[_0x4de4('0x2f')][_0x4de4('0x1a')]);_0x58482e[_0x4de4('0x2f')]['Descriptions']=integrations[_0x4de4('0x3a')](_0x58482e['body'][_0x4de4('0x39')],_0x58482e['body'][_0x4de4('0x1a')]);return db[_0x4de4('0x3b')][_0x4de4('0x3c')](_0x58482e['body'],{'include':[{'model':db[_0x4de4('0x3d')],'as':_0x4de4('0x37')},{'model':db['Dynamics365Field'],'as':'Descriptions'}]});}return null;})[_0x4de4('0xf')](respondWithResult(_0x727e91,null))['catch'](handleError(_0x727e91,null));};function sanitizeRemoteUri(_0x257465){var _0x2e6101=_0x257465['slice'](-0x1);if(_0x2e6101==='/')return _0x257465[_0x4de4('0x3e')](0x0,_0x257465['lastIndexOf'](_0x2e6101));return _0x257465;}function getWebApiUrl(_0x19e063){return util['format'](_0x4de4('0x3f'),_0x19e063);}exports['getFields']=function(_0xa6afd6,_0x50e058){var _0x3a9756=_0xa6afd6[_0x4de4('0x1c')][_0x4de4('0x40')];var _0x5d6555=_0x3a9756==='incident'?_0x4de4('0x41'):'PhoneCall';var _0x76ef6='';var _0x1a4044='';var _0x1bbf73='';var _0x36b64a='';var _0x204688='';var _0x4fd2c3='';var _0x31b0a7='';var _0x82c887='';var _0x4f8668=[_0x4de4('0x42'),_0x4de4('0x43'),'customerid',_0x4de4('0x44'),_0x4de4('0x45'),'subject',_0x4de4('0x46'),_0x4de4('0x47'),_0x4de4('0x48'),_0x4de4('0x49')];var _0x1652da=[_0x4de4('0x4a'),_0x4de4('0x4b'),_0x4de4('0x4c'),_0x4de4('0x4d'),_0x4de4('0x4e'),_0x4de4('0x4f'),_0x4de4('0x50'),_0x4de4('0x51'),_0x4de4('0x52'),_0x4de4('0x53'),_0x4de4('0x54'),_0x4de4('0x55'),'createdon',_0x4de4('0x56'),'createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame',_0x4de4('0x57'),_0x4de4('0x58'),'entityimage_timestamp',_0x4de4('0x59'),_0x4de4('0x5a'),_0x4de4('0x5b'),_0x4de4('0x5c'),_0x4de4('0x5d'),_0x4de4('0x5e'),_0x4de4('0x5f'),_0x4de4('0x60'),_0x4de4('0x61'),_0x4de4('0x62'),_0x4de4('0x63'),_0x4de4('0x64'),'modifiedbyname',_0x4de4('0x65'),_0x4de4('0x66'),_0x4de4('0x67'),_0x4de4('0x68'),_0x4de4('0x69'),_0x4de4('0x6a'),_0x4de4('0x6b'),_0x4de4('0x6c'),'overriddencreatedon',_0x4de4('0x6d'),_0x4de4('0x6e'),_0x4de4('0x6f'),_0x4de4('0x70'),_0x4de4('0x71'),_0x4de4('0x72'),_0x4de4('0x73'),_0x4de4('0x74'),_0x4de4('0x75'),_0x4de4('0x76'),'resolvebykpiidname',_0x4de4('0x77'),_0x4de4('0x78'),_0x4de4('0x79'),'sentimentvalue','slainvokedidname',_0x4de4('0x7a'),_0x4de4('0x7b'),'statecode',_0x4de4('0x7c'),_0x4de4('0x7d'),_0x4de4('0x7e'),'timezoneruleversionnumber','transactioncurrencyidname',_0x4de4('0x7f'),_0x4de4('0x80'),'versionnumber'];var _0x40a04c=_0x4f8668[_0x4de4('0x81')](_0x1652da);return db[_0x4de4('0x18')][_0x4de4('0x33')]({'where':{'id':_0xa6afd6[_0x4de4('0x2b')]['id']},'attributes':['id','username',_0x4de4('0x82'),'remoteUri',_0x4de4('0x83'),_0x4de4('0x84'),_0x4de4('0x85'),_0x4de4('0x86')],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','attributes':['id','data5',_0x4de4('0x87')]}]})[_0x4de4('0xf')](handleEntityNotFound(_0x50e058,null))['then'](function(_0x42babe){if(_0x42babe){if(_0x42babe[_0x4de4('0x86')]){_0x42babe['access_token']=_0x42babe[_0x4de4('0x88')]['data5'];_0x82c887=sanitizeRemoteUri(_0x42babe[_0x4de4('0x88')][_0x4de4('0x87')]);_0x31b0a7=getWebApiUrl(_0x82c887);return _0x42babe;}_0x82c887=sanitizeRemoteUri(_0x42babe[_0x4de4('0x89')]);_0x31b0a7=getWebApiUrl(_0x82c887);var _0x2e3038={'method':_0x4de4('0x8a'),'uri':_0x4de4('0x8b')+_0x42babe[_0x4de4('0x83')]+_0x4de4('0x8c'),'form':{'client_id':_0x42babe[_0x4de4('0x84')],'resource':_0x82c887,'username':_0x42babe['username'],'password':_0x42babe[_0x4de4('0x82')],'grant_type':_0x4de4('0x82'),'client_secret':_0x42babe['clientSecret']},'json':!![]};return rp(_0x2e3038);}})[_0x4de4('0xf')](function(_0x21b46d){_0x4fd2c3=_0x21b46d[_0x4de4('0x8d')];var _0x3aaf94={'method':_0x4de4('0x8e'),'uri':encodeURI(_0x31b0a7+_0x4de4('0x8f')+_0x5d6555+'\x27'),'headers':{'Authorization':_0x4de4('0x90')+_0x4fd2c3,'If-None-Match':null,'OData-Version':_0x4de4('0x91')},'json':!![]};return rp(_0x3aaf94);})[_0x4de4('0xf')](function(_0x548ffc){var _0x95e005=_0x548ffc['value'][0x0];var _0x4344cc=_0x95e005['MetadataId'];var _0xcac774={'method':_0x4de4('0x8e'),'uri':_0x31b0a7+_0x4de4('0x92')+_0x4344cc+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0x4de4('0x90')+_0x4fd2c3,'If-None-Match':null,'OData-Version':_0x4de4('0x91')},'json':!![]};return rp(_0xcac774);})[_0x4de4('0xf')](function(_0x54baf3){_0x76ef6=_0x54baf3;_0x1a4044=_0x76ef6[_0x4de4('0x93')];_0x1a4044=_['remove'](_0x1a4044,function(_0x2185d5){return!_0x40a04c['includes'](_0x2185d5['LogicalName']);});var _0x4e392d=[];var _0x58cb04=[];_0x1a4044[_0x4de4('0x94')](function(_0x122875){if(_0x122875['@odata.type']){var _0x1b98e0=_0x122875[_0x4de4('0x95')][_0x4de4('0x3e')](_0x122875[_0x4de4('0x95')][_0x4de4('0x96')]('.')+0x1);if(_0x1b98e0==='PicklistAttributeMetadata'){_0x4e392d[_0x4de4('0x97')](getSelectList(_0x31b0a7,_0x3a9756,_0x58cb04,_0x76ef6[_0x4de4('0x98')],_0x122875[_0x4de4('0x98')],_0x4fd2c3));}}});return Promise[_0x4de4('0x99')](_0x4e392d);})[_0x4de4('0xf')](function(_0x155e45){_0x1bbf73=_0x155e45[0x0];var _0x400ade=[];var _0x4359c7=[];_0x1a4044[_0x4de4('0x94')](function(_0x57a904){if(!_['isNil'](_0x57a904['@odata.type'])){var _0x47be39=_0x57a904[_0x4de4('0x95')][_0x4de4('0x3e')](_0x57a904['@odata.type'][_0x4de4('0x96')]('.')+0x1);if(_0x47be39===_0x4de4('0x9a')){_0x400ade['push'](getBooleanList(_0x31b0a7,_0x3a9756,_0x4359c7,_0x76ef6[_0x4de4('0x98')],_0x57a904['MetadataId'],_0x4fd2c3));}}});return Promise[_0x4de4('0x99')](_0x400ade);})[_0x4de4('0xf')](function(_0xb52a63){_0x36b64a=_0xb52a63[0x0];var _0x1786ee=[];var _0x3c4987=[];_0x1a4044['forEach'](function(_0x3f4c81){if(_0x3f4c81['@odata.type']){var _0x238d31=_0x3f4c81[_0x4de4('0x95')][_0x4de4('0x3e')](_0x3f4c81[_0x4de4('0x95')][_0x4de4('0x96')]('.')+0x1);if(_0x238d31==='StringAttributeMetadata'||_0x238d31===_0x4de4('0x9b')||_0x238d31===_0x4de4('0x9c')||_0x238d31==='IntegerAttributeMetadata'||_0x238d31===_0x4de4('0x9d')||_0x238d31==='DateTimeAttributeMetadata'||_0x238d31===_0x4de4('0x9e')||_0x238d31===_0x4de4('0x9f')||_0x238d31===_0x4de4('0xa0')||_0x238d31===_0x4de4('0xa1')){_0x1786ee[_0x4de4('0x97')](getInputList(_0x31b0a7,_0x3a9756,_0x238d31,_0x3c4987,_0x76ef6[_0x4de4('0x98')],_0x3f4c81[_0x4de4('0x98')],_0x4fd2c3));}}});return Promise['all'](_0x1786ee);})[_0x4de4('0xf')](function(_0x4fe4fe){_0x204688=_0x4fe4fe[0x0];var _0x3fb432=_0x1bbf73[_0x4de4('0x81')](_0x36b64a)[_0x4de4('0x81')](_0x204688);var _0x168c12={'count':_0x3fb432[_0x4de4('0x2c')],'rows':_0x3fb432};return _0x168c12;})[_0x4de4('0xf')](respondWithResult(_0x50e058,null))['catch'](function(_0x11ddce){var _0x19dcdf=_0xa6afd6[_0x4de4('0x1c')][_0x4de4('0xa2')]?0x1f4:_0x11ddce[_0x4de4('0xa3')]||0x1f4;logger['error'](_0x11ddce[_0x4de4('0x13')]);delete _0x11ddce['name'];if(_0x19dcdf===0x191){_0x19dcdf=0x190;}_0x50e058[_0x4de4('0x7')](_0x19dcdf)[_0x4de4('0x15')](_0xa6afd6[_0x4de4('0x1c')][_0x4de4('0xa2')]?{'message':_0x4de4('0xa4'),'statusCode':_0x11ddce[_0x4de4('0xa3')]}:_0x11ddce);});};function getSelectList(_0x557f44,_0x1b40af,_0xb78044,_0x185c38,_0xde0612,_0x12220b){var _0x229727={'method':_0x4de4('0x8e'),'uri':_0x557f44+_0x4de4('0x92')+_0x185c38+_0x4de4('0xa5')+_0xde0612+_0x4de4('0xa6')+_0x4de4('0xa7'),'headers':{'Authorization':'Bearer\x20'+_0x12220b,'If-None-Match':null,'OData-Version':_0x4de4('0x91')},'json':!![]};return rp(_0x229727)[_0x4de4('0xf')](function(_0x4162f7){var _0x1c7124=[];var _0x372690=_0x4162f7['OptionSet']['Options'];_0x372690[_0x4de4('0x94')](function(_0x408baf){_0x1c7124[_0x4de4('0x97')]({'name':_0x408baf[_0x4de4('0xa8')][_0x4de4('0xa9')][_0x4de4('0xa8')],'value':String(_0x408baf[_0x4de4('0xaa')])});});var _0x5a31c5={'id':_0x1b40af+'_'+_0x4162f7['LogicalName'],'name':_0x4162f7['DisplayName'][_0x4de4('0xa9')]['Label'],'custom':![],'options':_0x1c7124};_0xb78044[_0x4de4('0x97')](_0x5a31c5);return _0xb78044;});}function getBooleanList(_0x84b01c,_0x24e2c5,_0x11dbbc,_0x3adc7f,_0x4ac61a,_0x611e32){var _0x1e4945={'method':_0x4de4('0x8e'),'uri':_0x84b01c+_0x4de4('0x92')+_0x3adc7f+_0x4de4('0xa5')+_0x4ac61a+_0x4de4('0xab'),'headers':{'Authorization':'Bearer\x20'+_0x611e32,'If-None-Match':null,'OData-Version':_0x4de4('0x91')},'json':!![]};return rp(_0x1e4945)[_0x4de4('0xf')](function(_0x30a4b4){var _0x16bfc4=[];_0x16bfc4[_0x4de4('0x97')]({'name':_0x30a4b4[_0x4de4('0xac')]['TrueOption'][_0x4de4('0xa8')][_0x4de4('0xa9')][_0x4de4('0xa8')],'value':'true'},{'name':_0x30a4b4[_0x4de4('0xac')][_0x4de4('0xad')][_0x4de4('0xa8')]['UserLocalizedLabel'][_0x4de4('0xa8')],'value':_0x4de4('0xae')});var _0x1f8781={'id':_0x24e2c5+'_'+_0x30a4b4[_0x4de4('0xaf')],'name':_0x30a4b4['DisplayName'][_0x4de4('0xa9')][_0x4de4('0xa8')],'custom':![],'options':_0x16bfc4};_0x11dbbc[_0x4de4('0x97')](_0x1f8781);return _0x11dbbc;});}function getInputList(_0x1da974,_0x46251a,_0x4b1897,_0x1579d9,_0x2b6e3b,_0xc05f9f,_0x94c153){var _0x5d31f9={'method':_0x4de4('0x8e'),'uri':_0x1da974+_0x4de4('0x92')+_0x2b6e3b+_0x4de4('0xa5')+_0xc05f9f+_0x4de4('0xb0')+_0x4b1897+_0x4de4('0xb1'),'headers':{'Authorization':_0x4de4('0x90')+_0x94c153,'If-None-Match':null,'OData-Version':_0x4de4('0x91')},'json':!![]};return rp(_0x5d31f9)[_0x4de4('0xf')](function(_0x1b6c43){var _0x41012={'id':_0x46251a+'_'+_0x1b6c43[_0x4de4('0xaf')],'name':_0x1b6c43[_0x4de4('0xb2')][_0x4de4('0xa9')]?_0x1b6c43['DisplayName'][_0x4de4('0xa9')][_0x4de4('0xa8')]:_0x1b6c43['LogicalName'],'custom':![],'options':[]};_0x1579d9[_0x4de4('0x97')](_0x41012);return _0x1579d9;});} \ No newline at end of file +var _0x9f51=['modernAuthentication','access_token','POST','https://login.microsoftonline.com/','tenantId','/oauth2/token','clientId','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','4.0','Attributes','remove','includes','LogicalName','forEach','@odata.type','push','all','isNil','BooleanAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','concat','test','Wrong\x20credentials','statusCode',')/Attributes(','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','util','lodash','../../components/parsers/qs','../../config/logger','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','count','Content-Range','update','then','destroy','end','sendStatus','error','stack','send','index','map','Dynamics365Account','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','show','params','rawAttributes','find','catch','create','body','getConfigurations','findOne','Dynamics365Configuration','order','nolimit','addConfiguration','AccountId','getSubjects','Descriptions','Subjects','Dynamics365Field','slice','substring','lastIndexOf','%s/api/data/v9.0/','getFields','ticketType','incident','Incident','description','customerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractidname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','entitlementidname','entityimage_timestamp','entityimage_url','exchangerate','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridyominame','parentcaseidname','primarycontactidname','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','sentimentvalue','slaname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','versionnumber','username','password','remoteUri','CloudProvider','data5','data7'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9f51,0x1af));var _0x19f5=function(_0x151732,_0x82b764){_0x151732=_0x151732-0x0;var _0x1cda86=_0x9f51[_0x151732];return _0x1cda86;};'use strict';var rp=require('request-promise');var util=require(_0x19f5('0x0'));var _=require(_0x19f5('0x1'));var qs=require(_0x19f5('0x2'));var logger=require(_0x19f5('0x3'))('api');var db=require(_0x19f5('0x4'))['db'];var integrations=require(_0x19f5('0x5'));function respondWithResult(_0x21f794,_0x497112){_0x497112=_0x497112||0xc8;return function(_0x181541){if(_0x181541){return _0x21f794[_0x19f5('0x6')](_0x497112)[_0x19f5('0x7')](_0x181541);}};}function respondWithFilteredResult(_0xd8bdac,_0x1fa6dd){return function(_0x5c7eb5){if(_0x5c7eb5){var _0x174970=typeof _0x1fa6dd[_0x19f5('0x8')]===_0x19f5('0x9')&&typeof _0x1fa6dd['limit']===_0x19f5('0x9');var _0xbe65ac=_0x5c7eb5[_0x19f5('0xa')];var _0xc1242f=_0x174970?0x0:_0x1fa6dd['offset'];var _0x20f36c=_0x174970?_0x5c7eb5['count']:_0x1fa6dd['offset']+_0x1fa6dd['limit'];var _0x179b57;if(_0x20f36c>=_0xbe65ac){_0x20f36c=_0xbe65ac;_0x179b57=0xc8;}else{_0x179b57=0xce;}_0xd8bdac[_0x19f5('0x6')](_0x179b57);return _0xd8bdac['set'](_0x19f5('0xb'),_0xc1242f+'-'+_0x20f36c+'/'+_0xbe65ac)[_0x19f5('0x7')](_0x5c7eb5);}return null;};}function saveUpdates(_0x3d0947){return function(_0x5615e0){if(_0x5615e0){return _0x5615e0[_0x19f5('0xc')](_0x3d0947)[_0x19f5('0xd')](function(_0x3aadf5){return _0x3aadf5;});}return null;};}function removeEntity(_0x4eebc2){return function(_0x25f2ef){if(_0x25f2ef){return _0x25f2ef[_0x19f5('0xe')]()[_0x19f5('0xd')](function(){_0x4eebc2[_0x19f5('0x6')](0xcc)[_0x19f5('0xf')]();});}};}function handleEntityNotFound(_0x4e7728){return function(_0x45ebb9){if(!_0x45ebb9){_0x4e7728[_0x19f5('0x10')](0x194);}return _0x45ebb9;};}function handleError(_0x5a41d6,_0x39529c){_0x39529c=_0x39529c||0x1f4;return function(_0xc48b8b){logger[_0x19f5('0x11')](_0xc48b8b[_0x19f5('0x12')]);if(_0xc48b8b['name']){delete _0xc48b8b['name'];}_0x5a41d6[_0x19f5('0x6')](_0x39529c)[_0x19f5('0x13')](_0xc48b8b);};}exports[_0x19f5('0x14')]=function(_0xf6d2be,_0x195ab4){var _0x47e2bb={},_0xa4764c={},_0x27aeec={'count':0x0,'rows':[]};var _0x399bb5=_[_0x19f5('0x15')](db[_0x19f5('0x16')]['rawAttributes'],function(_0xf57be7){return{'name':_0xf57be7[_0x19f5('0x17')],'type':_0xf57be7[_0x19f5('0x18')][_0x19f5('0x19')]};});_0xa4764c[_0x19f5('0x1a')]=_[_0x19f5('0x15')](_0x399bb5,_0x19f5('0x1b'));_0xa4764c[_0x19f5('0x1c')]=_[_0x19f5('0x1d')](_0xf6d2be['query']);_0xa4764c[_0x19f5('0x1e')]=_[_0x19f5('0x1f')](_0xa4764c[_0x19f5('0x1a')],_0xa4764c[_0x19f5('0x1c')]);_0x47e2bb[_0x19f5('0x20')]=_[_0x19f5('0x1f')](_0xa4764c[_0x19f5('0x1a')],qs[_0x19f5('0x21')](_0xf6d2be[_0x19f5('0x1c')][_0x19f5('0x21')]));_0x47e2bb['attributes']=_0x47e2bb[_0x19f5('0x20')][_0x19f5('0x22')]?_0x47e2bb[_0x19f5('0x20')]:_0xa4764c[_0x19f5('0x1a')];if(!_0xf6d2be[_0x19f5('0x1c')][_0x19f5('0x23')]('nolimit')){_0x47e2bb[_0x19f5('0x24')]=qs[_0x19f5('0x24')](_0xf6d2be[_0x19f5('0x1c')][_0x19f5('0x24')]);_0x47e2bb[_0x19f5('0x8')]=qs['offset'](_0xf6d2be['query'][_0x19f5('0x8')]);}_0x47e2bb['order']=qs['sort'](_0xf6d2be[_0x19f5('0x1c')][_0x19f5('0x25')]);_0x47e2bb[_0x19f5('0x26')]=qs[_0x19f5('0x1e')](_[_0x19f5('0x27')](_0xf6d2be[_0x19f5('0x1c')],_0xa4764c[_0x19f5('0x1e')]),_0x399bb5);if(_0xf6d2be[_0x19f5('0x1c')]['filter']){_0x47e2bb[_0x19f5('0x26')]=_[_0x19f5('0x28')](_0x47e2bb[_0x19f5('0x26')],{'$or':_[_0x19f5('0x15')](_0x399bb5,function(_0xfc27e1){if(_0xfc27e1[_0x19f5('0x18')]!==_0x19f5('0x29')){var _0x3b555b={};_0x3b555b[_0xfc27e1[_0x19f5('0x1b')]]={'$like':'%'+_0xf6d2be[_0x19f5('0x1c')][_0x19f5('0x2a')]+'%'};return _0x3b555b;}})});}_0x47e2bb=_[_0x19f5('0x28')]({},_0x47e2bb,_0xf6d2be[_0x19f5('0x2b')]);var _0x2ad2e8={'where':_0x47e2bb[_0x19f5('0x26')]};return db['Dynamics365Account'][_0x19f5('0xa')](_0x2ad2e8)[_0x19f5('0xd')](function(_0x272cd5){_0x27aeec[_0x19f5('0xa')]=_0x272cd5;if(_0xf6d2be[_0x19f5('0x1c')][_0x19f5('0x2c')]){_0x47e2bb[_0x19f5('0x2d')]=[{'all':!![]}];}return db[_0x19f5('0x16')]['findAll'](_0x47e2bb);})[_0x19f5('0xd')](function(_0x3badb2){_0x27aeec['rows']=_0x3badb2;return _0x27aeec;})['then'](respondWithFilteredResult(_0x195ab4,_0x47e2bb))['catch'](handleError(_0x195ab4,null));};exports[_0x19f5('0x2e')]=function(_0x477207,_0x437a05){var _0x147533={'raw':![],'where':{'id':_0x477207[_0x19f5('0x2f')]['id']}},_0x5640db={};_0x5640db['model']=_[_0x19f5('0x1d')](db[_0x19f5('0x16')][_0x19f5('0x30')]);_0x5640db[_0x19f5('0x1c')]=_[_0x19f5('0x1d')](_0x477207[_0x19f5('0x1c')]);_0x5640db[_0x19f5('0x1e')]=_['intersection'](_0x5640db['model'],_0x5640db[_0x19f5('0x1c')]);_0x147533[_0x19f5('0x20')]=_['intersection'](_0x5640db['model'],qs[_0x19f5('0x21')](_0x477207['query'][_0x19f5('0x21')]));_0x147533[_0x19f5('0x20')]=_0x147533[_0x19f5('0x20')][_0x19f5('0x22')]?_0x147533[_0x19f5('0x20')]:_0x5640db['model'];if(_0x477207[_0x19f5('0x1c')][_0x19f5('0x2c')]){_0x147533[_0x19f5('0x2d')]=[{'all':!![]}];}_0x147533=_['merge']({},_0x147533,_0x477207[_0x19f5('0x2b')]);return db['Dynamics365Account'][_0x19f5('0x31')](_0x147533)[_0x19f5('0xd')](handleEntityNotFound(_0x437a05,null))[_0x19f5('0xd')](respondWithResult(_0x437a05,null))[_0x19f5('0x32')](handleError(_0x437a05,null));};exports[_0x19f5('0x33')]=function(_0xf433b9,_0x1886fd){return db[_0x19f5('0x16')]['create'](_0xf433b9['body'],{})['then'](respondWithResult(_0x1886fd,0xc9))[_0x19f5('0x32')](handleError(_0x1886fd,null));};exports[_0x19f5('0xc')]=function(_0x498838,_0x33eecd){if(_0x498838[_0x19f5('0x34')]['id']){delete _0x498838[_0x19f5('0x34')]['id'];}return db[_0x19f5('0x16')]['find']({'where':{'id':_0x498838[_0x19f5('0x2f')]['id']}})['then'](handleEntityNotFound(_0x33eecd,null))[_0x19f5('0xd')](saveUpdates(_0x498838[_0x19f5('0x34')],null))[_0x19f5('0xd')](respondWithResult(_0x33eecd,null))['catch'](handleError(_0x33eecd,null));};exports[_0x19f5('0xe')]=function(_0xac2181,_0x3d4459){return db['Dynamics365Account'][_0x19f5('0x31')]({'where':{'id':_0xac2181[_0x19f5('0x2f')]['id']}})['then'](handleEntityNotFound(_0x3d4459,null))[_0x19f5('0xd')](removeEntity(_0x3d4459,null))['catch'](handleError(_0x3d4459,null));};exports[_0x19f5('0x35')]=function(_0x2bb227,_0x3e08b2){var _0x21222d={};var _0x375143={};var _0xed3657;var _0x15ebd2;return db[_0x19f5('0x16')][_0x19f5('0x36')]({'where':{'id':_0x2bb227['params']['id']}})[_0x19f5('0xd')](handleEntityNotFound(_0x3e08b2,null))[_0x19f5('0xd')](function(_0x15d04e){if(_0x15d04e){_0xed3657=_0x15d04e;_0x375143[_0x19f5('0x1a')]=_[_0x19f5('0x1d')](db[_0x19f5('0x37')][_0x19f5('0x30')]);_0x375143['query']=_['keys'](_0x2bb227[_0x19f5('0x1c')]);_0x375143[_0x19f5('0x1e')]=_[_0x19f5('0x1f')](_0x375143['model'],_0x375143[_0x19f5('0x1c')]);_0x21222d[_0x19f5('0x20')]=_[_0x19f5('0x1f')](_0x375143[_0x19f5('0x1a')],qs['fields'](_0x2bb227[_0x19f5('0x1c')][_0x19f5('0x21')]));_0x21222d[_0x19f5('0x20')]=_0x21222d['attributes'][_0x19f5('0x22')]?_0x21222d[_0x19f5('0x20')]:_0x375143[_0x19f5('0x1a')];_0x21222d[_0x19f5('0x38')]=qs[_0x19f5('0x25')](_0x2bb227[_0x19f5('0x1c')][_0x19f5('0x25')]);_0x21222d[_0x19f5('0x26')]=qs['filters'](_['pick'](_0x2bb227['query'],_0x375143[_0x19f5('0x1e')]));if(_0x2bb227['query'][_0x19f5('0x2a')]){_0x21222d[_0x19f5('0x26')]=_[_0x19f5('0x28')](_0x21222d[_0x19f5('0x26')],{'$or':_[_0x19f5('0x15')](_0x21222d['attributes'],function(_0x571853){var _0x1d386a={};_0x1d386a[_0x571853]={'$like':'%'+_0x2bb227[_0x19f5('0x1c')][_0x19f5('0x2a')]+'%'};return _0x1d386a;})});}_0x21222d=_['merge']({},_0x21222d,_0x2bb227['options']);return _0xed3657[_0x19f5('0x35')](_0x21222d);}})['then'](function(_0x423d3d){if(_0x423d3d){_0x15ebd2=_0x423d3d[_0x19f5('0x22')];if(!_0x2bb227[_0x19f5('0x1c')]['hasOwnProperty'](_0x19f5('0x39'))){_0x21222d['limit']=qs['limit'](_0x2bb227[_0x19f5('0x1c')][_0x19f5('0x24')]);_0x21222d[_0x19f5('0x8')]=qs[_0x19f5('0x8')](_0x2bb227['query']['offset']);}return _0xed3657[_0x19f5('0x35')](_0x21222d);}})[_0x19f5('0xd')](function(_0x4df672){if(_0x4df672){return _0x4df672?{'count':_0x15ebd2,'rows':_0x4df672}:null;}})[_0x19f5('0xd')](respondWithResult(_0x3e08b2,null))[_0x19f5('0x32')](handleError(_0x3e08b2,null));};exports[_0x19f5('0x3a')]=function(_0x569337,_0x4f0ddd){if(_0x569337[_0x19f5('0x34')]['id']){delete _0x569337[_0x19f5('0x34')]['id'];}return db['Dynamics365Account']['findOne']({'where':{'id':_0x569337[_0x19f5('0x2f')]['id']}})[_0x19f5('0xd')](handleEntityNotFound(_0x4f0ddd,null))[_0x19f5('0xd')](function(_0xa6eecd){if(_0xa6eecd){_0x569337[_0x19f5('0x34')][_0x19f5('0x3b')]=_0xa6eecd['id'];_0x569337[_0x19f5('0x34')]['Subjects']=integrations[_0x19f5('0x3c')](_0x569337[_0x19f5('0x34')]['channel'],_0x569337[_0x19f5('0x34')][_0x19f5('0x18')]);_0x569337[_0x19f5('0x34')][_0x19f5('0x3d')]=integrations['getDescriptions'](_0x569337[_0x19f5('0x34')]['channel'],_0x569337['body'][_0x19f5('0x18')]);return db['Dynamics365Configuration']['create'](_0x569337[_0x19f5('0x34')],{'include':[{'model':db['Dynamics365Field'],'as':_0x19f5('0x3e')},{'model':db[_0x19f5('0x3f')],'as':_0x19f5('0x3d')}]});}return null;})[_0x19f5('0xd')](respondWithResult(_0x4f0ddd,null))[_0x19f5('0x32')](handleError(_0x4f0ddd,null));};function sanitizeRemoteUri(_0x2881d3){var _0x561876=_0x2881d3[_0x19f5('0x40')](-0x1);if(_0x561876==='/')return _0x2881d3[_0x19f5('0x41')](0x0,_0x2881d3[_0x19f5('0x42')](_0x561876));return _0x2881d3;}function getWebApiUrl(_0x17090c){return util['format'](_0x19f5('0x43'),_0x17090c);}exports[_0x19f5('0x44')]=function(_0x3a02ad,_0xcc756){var _0x562da9=_0x3a02ad[_0x19f5('0x1c')][_0x19f5('0x45')];var _0x2aa67f=_0x562da9===_0x19f5('0x46')?_0x19f5('0x47'):'PhoneCall';var _0x5e5883='';var _0x5cc7fa='';var _0x44636a='';var _0x3a8011='';var _0x2aae82='';var _0x457cc3='';var _0x2c1a7e='';var _0x257c90='';var _0x6608e2=['title',_0x19f5('0x48'),_0x19f5('0x49'),'ownerid',_0x19f5('0x4a'),_0x19f5('0x4b'),_0x19f5('0x4c'),_0x19f5('0x4d'),_0x19f5('0x4e'),_0x19f5('0x4f')];var _0x3760a6=['accountidname',_0x19f5('0x50'),_0x19f5('0x51'),_0x19f5('0x52'),_0x19f5('0x53'),_0x19f5('0x54'),'contractdetailidname',_0x19f5('0x55'),'createdbyexternalpartyname',_0x19f5('0x56'),_0x19f5('0x57'),_0x19f5('0x58'),_0x19f5('0x59'),_0x19f5('0x5a'),_0x19f5('0x5b'),'customeridname','customeridtype','customeridyominame','emailaddress',_0x19f5('0x5c'),_0x19f5('0x5d'),_0x19f5('0x5e'),'escalatedon',_0x19f5('0x5f'),'firstresponsebykpiidname',_0x19f5('0x60'),_0x19f5('0x61'),_0x19f5('0x62'),_0x19f5('0x63'),_0x19f5('0x64'),'masteridname',_0x19f5('0x65'),_0x19f5('0x66'),_0x19f5('0x67'),_0x19f5('0x68'),'modifiedon',_0x19f5('0x69'),_0x19f5('0x6a'),'msdyn_incidenttypename',_0x19f5('0x6b'),_0x19f5('0x6c'),_0x19f5('0x6d'),_0x19f5('0x6e'),_0x19f5('0x6f'),'owneridtype',_0x19f5('0x70'),_0x19f5('0x71'),_0x19f5('0x72'),'primarycontactidyominame',_0x19f5('0x73'),_0x19f5('0x74'),_0x19f5('0x75'),_0x19f5('0x76'),_0x19f5('0x77'),_0x19f5('0x78'),_0x19f5('0x79'),'responsiblecontactidyominame',_0x19f5('0x7a'),'slainvokedidname',_0x19f5('0x7b'),_0x19f5('0x7c'),_0x19f5('0x7d'),_0x19f5('0x7e'),_0x19f5('0x7f'),_0x19f5('0x80'),_0x19f5('0x81'),_0x19f5('0x82'),_0x19f5('0x83'),'utcconversiontimezonecode',_0x19f5('0x84')];var _0x6677df=_0x6608e2['concat'](_0x3760a6);return db[_0x19f5('0x16')][_0x19f5('0x36')]({'where':{'id':_0x3a02ad[_0x19f5('0x2f')]['id']},'attributes':['id',_0x19f5('0x85'),_0x19f5('0x86'),_0x19f5('0x87'),'tenantId','clientId','clientSecret','modernAuthentication'],'include':[{'model':db[_0x19f5('0x88')],'as':'CloudProvider','attributes':['id',_0x19f5('0x89'),_0x19f5('0x8a')]}]})['then'](handleEntityNotFound(_0xcc756,null))[_0x19f5('0xd')](function(_0x3d2ac6){if(_0x3d2ac6){if(_0x3d2ac6[_0x19f5('0x8b')]){_0x3d2ac6[_0x19f5('0x8c')]=_0x3d2ac6[_0x19f5('0x88')]['data5'];_0x257c90=sanitizeRemoteUri(_0x3d2ac6[_0x19f5('0x88')][_0x19f5('0x8a')]);_0x2c1a7e=getWebApiUrl(_0x257c90);return _0x3d2ac6;}_0x257c90=sanitizeRemoteUri(_0x3d2ac6[_0x19f5('0x87')]);_0x2c1a7e=getWebApiUrl(_0x257c90);var _0x2dc213={'method':_0x19f5('0x8d'),'uri':_0x19f5('0x8e')+_0x3d2ac6[_0x19f5('0x8f')]+_0x19f5('0x90'),'form':{'client_id':_0x3d2ac6[_0x19f5('0x91')],'resource':_0x257c90,'username':_0x3d2ac6[_0x19f5('0x85')],'password':_0x3d2ac6[_0x19f5('0x86')],'grant_type':_0x19f5('0x86'),'client_secret':_0x3d2ac6['clientSecret']},'json':!![]};return rp(_0x2dc213);}})['then'](function(_0x46b4db){_0x457cc3=_0x46b4db['access_token'];var _0x3325ec={'method':_0x19f5('0x92'),'uri':encodeURI(_0x2c1a7e+_0x19f5('0x93')+_0x2aa67f+'\x27'),'headers':{'Authorization':_0x19f5('0x94')+_0x457cc3,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x3325ec);})[_0x19f5('0xd')](function(_0x51fcc8){var _0x14364=_0x51fcc8[_0x19f5('0x95')][0x0];var _0x3ab76a=_0x14364[_0x19f5('0x96')];var _0x4e10cd={'method':_0x19f5('0x92'),'uri':_0x2c1a7e+_0x19f5('0x97')+_0x3ab76a+_0x19f5('0x98'),'headers':{'Authorization':'Bearer\x20'+_0x457cc3,'If-None-Match':null,'OData-Version':_0x19f5('0x99')},'json':!![]};return rp(_0x4e10cd);})[_0x19f5('0xd')](function(_0x1afae0){_0x5e5883=_0x1afae0;_0x5cc7fa=_0x5e5883[_0x19f5('0x9a')];_0x5cc7fa=_[_0x19f5('0x9b')](_0x5cc7fa,function(_0x14e818){return!_0x6677df[_0x19f5('0x9c')](_0x14e818[_0x19f5('0x9d')]);});var _0x478e60=[];var _0x22a4c5=[];_0x5cc7fa[_0x19f5('0x9e')](function(_0x50f037){if(_0x50f037[_0x19f5('0x9f')]){var _0x3c269b=_0x50f037[_0x19f5('0x9f')][_0x19f5('0x41')](_0x50f037['@odata.type'][_0x19f5('0x42')]('.')+0x1);if(_0x3c269b==='PicklistAttributeMetadata'){_0x478e60[_0x19f5('0xa0')](getSelectList(_0x2c1a7e,_0x562da9,_0x22a4c5,_0x5e5883['MetadataId'],_0x50f037[_0x19f5('0x96')],_0x457cc3));}}});return Promise[_0x19f5('0xa1')](_0x478e60);})[_0x19f5('0xd')](function(_0x959301){_0x44636a=_0x959301[0x0];var _0x4b85d8=[];var _0x261efa=[];_0x5cc7fa[_0x19f5('0x9e')](function(_0x3b798d){if(!_[_0x19f5('0xa2')](_0x3b798d[_0x19f5('0x9f')])){var _0x2b5e8c=_0x3b798d[_0x19f5('0x9f')][_0x19f5('0x41')](_0x3b798d[_0x19f5('0x9f')]['lastIndexOf']('.')+0x1);if(_0x2b5e8c===_0x19f5('0xa3')){_0x4b85d8[_0x19f5('0xa0')](getBooleanList(_0x2c1a7e,_0x562da9,_0x261efa,_0x5e5883['MetadataId'],_0x3b798d[_0x19f5('0x96')],_0x457cc3));}}});return Promise['all'](_0x4b85d8);})[_0x19f5('0xd')](function(_0x344d07){_0x3a8011=_0x344d07[0x0];var _0x1e0a63=[];var _0x48c22d=[];_0x5cc7fa[_0x19f5('0x9e')](function(_0x26e176){if(_0x26e176[_0x19f5('0x9f')]){var _0x41ec7d=_0x26e176[_0x19f5('0x9f')][_0x19f5('0x41')](_0x26e176[_0x19f5('0x9f')][_0x19f5('0x42')]('.')+0x1);if(_0x41ec7d==='StringAttributeMetadata'||_0x41ec7d===_0x19f5('0xa4')||_0x41ec7d===_0x19f5('0xa5')||_0x41ec7d===_0x19f5('0xa6')||_0x41ec7d===_0x19f5('0xa7')||_0x41ec7d==='DateTimeAttributeMetadata'||_0x41ec7d===_0x19f5('0xa8')||_0x41ec7d===_0x19f5('0xa9')||_0x41ec7d===_0x19f5('0xaa')||_0x41ec7d===_0x19f5('0xab')){_0x1e0a63[_0x19f5('0xa0')](getInputList(_0x2c1a7e,_0x562da9,_0x41ec7d,_0x48c22d,_0x5e5883['MetadataId'],_0x26e176[_0x19f5('0x96')],_0x457cc3));}}});return Promise[_0x19f5('0xa1')](_0x1e0a63);})['then'](function(_0x5b7ec9){_0x2aae82=_0x5b7ec9[0x0];var _0x18d78b=_0x44636a[_0x19f5('0xac')](_0x3a8011)[_0x19f5('0xac')](_0x2aae82);var _0x5f2b9d={'count':_0x18d78b[_0x19f5('0x22')],'rows':_0x18d78b};return _0x5f2b9d;})[_0x19f5('0xd')](respondWithResult(_0xcc756,null))[_0x19f5('0x32')](function(_0x5ab098){var _0x423a14=_0x3a02ad[_0x19f5('0x1c')][_0x19f5('0xad')]?0x1f4:_0x5ab098['statusCode']||0x1f4;logger[_0x19f5('0x11')](_0x5ab098['stack']);delete _0x5ab098[_0x19f5('0x1b')];if(_0x423a14===0x191){_0x423a14=0x190;}_0xcc756[_0x19f5('0x6')](_0x423a14)[_0x19f5('0x13')](_0x3a02ad[_0x19f5('0x1c')][_0x19f5('0xad')]?{'message':_0x19f5('0xae'),'statusCode':_0x5ab098[_0x19f5('0xaf')]}:_0x5ab098);});};function getSelectList(_0x4c74a6,_0x337a2c,_0x26e070,_0xdc4f13,_0xf51137,_0xdb2623){var _0x3ca883={'method':_0x19f5('0x92'),'uri':_0x4c74a6+_0x19f5('0x97')+_0xdc4f13+_0x19f5('0xb0')+_0xf51137+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0x19f5('0xb1'),'headers':{'Authorization':_0x19f5('0x94')+_0xdb2623,'If-None-Match':null,'OData-Version':_0x19f5('0x99')},'json':!![]};return rp(_0x3ca883)['then'](function(_0x14983b){var _0x5475e8=[];var _0x35d791=_0x14983b[_0x19f5('0xb2')][_0x19f5('0xb3')];_0x35d791[_0x19f5('0x9e')](function(_0x19b200){_0x5475e8[_0x19f5('0xa0')]({'name':_0x19b200[_0x19f5('0xb4')][_0x19f5('0xb5')][_0x19f5('0xb4')],'value':String(_0x19b200[_0x19f5('0xb6')])});});var _0x56155d={'id':_0x337a2c+'_'+_0x14983b[_0x19f5('0x9d')],'name':_0x14983b[_0x19f5('0xb7')][_0x19f5('0xb5')]['Label'],'custom':![],'options':_0x5475e8};_0x26e070[_0x19f5('0xa0')](_0x56155d);return _0x26e070;});}function getBooleanList(_0x580afb,_0x12ec93,_0x187124,_0x5ced2b,_0x1aba64,_0x32314d){var _0x47d99b={'method':'GET','uri':_0x580afb+'EntityDefinitions('+_0x5ced2b+_0x19f5('0xb0')+_0x1aba64+_0x19f5('0xb8'),'headers':{'Authorization':'Bearer\x20'+_0x32314d,'If-None-Match':null,'OData-Version':_0x19f5('0x99')},'json':!![]};return rp(_0x47d99b)['then'](function(_0x773187){var _0x3fbc10=[];_0x3fbc10[_0x19f5('0xa0')]({'name':_0x773187[_0x19f5('0xb2')][_0x19f5('0xb9')][_0x19f5('0xb4')]['UserLocalizedLabel'][_0x19f5('0xb4')],'value':'true'},{'name':_0x773187['OptionSet'][_0x19f5('0xba')]['Label'][_0x19f5('0xb5')][_0x19f5('0xb4')],'value':_0x19f5('0xbb')});var _0x58f537={'id':_0x12ec93+'_'+_0x773187[_0x19f5('0x9d')],'name':_0x773187[_0x19f5('0xb7')]['UserLocalizedLabel'][_0x19f5('0xb4')],'custom':![],'options':_0x3fbc10};_0x187124[_0x19f5('0xa0')](_0x58f537);return _0x187124;});}function getInputList(_0x5952dc,_0x54e8f2,_0x22606d,_0x34495c,_0x4a7f04,_0x579fe8,_0x276e82){var _0x395399={'method':_0x19f5('0x92'),'uri':_0x5952dc+_0x19f5('0x97')+_0x4a7f04+_0x19f5('0xb0')+_0x579fe8+_0x19f5('0xbc')+_0x22606d+_0x19f5('0xbd'),'headers':{'Authorization':'Bearer\x20'+_0x276e82,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x395399)[_0x19f5('0xd')](function(_0x3445ad){var _0x34add4={'id':_0x54e8f2+'_'+_0x3445ad['LogicalName'],'name':_0x3445ad[_0x19f5('0xb7')]['UserLocalizedLabel']?_0x3445ad['DisplayName'][_0x19f5('0xb5')]['Label']:_0x3445ad['LogicalName'],'custom':![],'options':[]};_0x34495c[_0x19f5('0xa0')](_0x34add4);return _0x34495c;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 03212e5..26d962a 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 _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts','lodash','util'];(function(_0x43cb63,_0x100a74){var _0x47a76f=function(_0x5a8f86){while(--_0x5a8f86){_0x43cb63['push'](_0x43cb63['shift']());}};_0x47a76f(++_0x100a74);}(_0xe706,0xa3));var _0x6e70=function(_0x499e28,_0x2d0c3e){_0x499e28=_0x499e28-0x0;var _0x4b8c09=_0xe706[_0x499e28];return _0x4b8c09;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));var integrations=require(_0x6e70('0xa'));module[_0x6e70('0xb')]=function(_0x4381d1,_0x36357b){return _0x4381d1[_0x6e70('0xc')](_0x6e70('0xd'),attributes,{'tableName':_0x6e70('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd8b0=['exports','Dynamics365Account','int_dynamics365_accounts','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5d8560,_0x130100){var _0x5ba6a1=function(_0x2f8912){while(--_0x2f8912){_0x5d8560['push'](_0x5d8560['shift']());}};_0x5ba6a1(++_0x130100);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./intDynamics365Account.attributes');var integrations=require('../../components/integrations/configuration');module[_0x0d8b('0x7')]=function(_0x227c63,_0x39f43a){return _0x227c63['define'](_0x0d8b('0x8'),attributes,{'tableName':_0x0d8b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index db9fd9d..07e9853 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 _0xdbe9=['request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetDynamics365Account','options','raw','where','attributes','include','map','model','then','debug','Dynamics365Account','ShowDynamics365Account','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','info','Dynamics365Account,\x20%s,\x20%s'];(function(_0x3ff685,_0x304b9e){var _0x2046c9=function(_0x7a10e9){while(--_0x7a10e9){_0x3ff685['push'](_0x3ff685['shift']());}};_0x2046c9(++_0x304b9e);}(_0xdbe9,0x7a));var _0x9dbe=function(_0x172faa,_0x41491d){_0x172faa=_0x172faa-0x0;var _0x1ddacb=_0xdbe9[_0x172faa];return _0x1ddacb;};'use strict';var _=require('lodash');var util=require(_0x9dbe('0x0'));var moment=require(_0x9dbe('0x1'));var BPromise=require(_0x9dbe('0x2'));var rs=require(_0x9dbe('0x3'));var fs=require('fs');var Redis=require(_0x9dbe('0x4'));var db=require(_0x9dbe('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9dbe('0x6'))(_0x9dbe('0x7'));var config=require('../../config/environment');var jayson=require(_0x9dbe('0x8'));var client=jayson[_0x9dbe('0x9')][_0x9dbe('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1635b9,_0x5953d6,_0x45328d){return new BPromise(function(_0x20dd35,_0x32de2f){return client[_0x9dbe('0xb')](_0x1635b9,_0x45328d)['then'](function(_0x573a2e){logger[_0x9dbe('0xc')](_0x9dbe('0xd'),_0x5953d6,_0x9dbe('0xe'));logger['debug'](_0x9dbe('0xf'),_0x5953d6,_0x9dbe('0xe'),JSON[_0x9dbe('0x10')](_0x573a2e));if(_0x573a2e[_0x9dbe('0x11')]){if(_0x573a2e['error'][_0x9dbe('0x12')]===0x1f4){logger['error'](_0x9dbe('0xd'),_0x5953d6,_0x573a2e[_0x9dbe('0x11')]['message']);return _0x32de2f(_0x573a2e[_0x9dbe('0x11')][_0x9dbe('0x13')]);}logger['error'](_0x9dbe('0xd'),_0x5953d6,_0x573a2e['error'][_0x9dbe('0x13')]);return _0x20dd35(_0x573a2e[_0x9dbe('0x11')]['message']);}else{logger['info']('Dynamics365Account,\x20%s,\x20%s',_0x5953d6,_0x9dbe('0xe'));_0x20dd35(_0x573a2e[_0x9dbe('0x14')][_0x9dbe('0x13')]);}})[_0x9dbe('0x15')](function(_0x2581fe){logger[_0x9dbe('0x11')]('Dynamics365Account,\x20%s,\x20%s',_0x5953d6,_0x2581fe);_0x32de2f(_0x2581fe);});});}exports[_0x9dbe('0x16')]=function(_0x1422be){var _0x38ab1d=this;return new Promise(function(_0x2754ac,_0x4b5898){return db['Dynamics365Account']['findAll']({'raw':_0x1422be[_0x9dbe('0x17')]?_0x1422be[_0x9dbe('0x17')][_0x9dbe('0x18')]===undefined?!![]:![]:!![],'where':_0x1422be[_0x9dbe('0x17')]?_0x1422be[_0x9dbe('0x17')][_0x9dbe('0x19')]||null:null,'attributes':_0x1422be[_0x9dbe('0x17')]?_0x1422be[_0x9dbe('0x17')][_0x9dbe('0x1a')]||null:null,'limit':_0x1422be[_0x9dbe('0x17')]?_0x1422be[_0x9dbe('0x17')]['limit']||null:null,'include':_0x1422be[_0x9dbe('0x17')]?_0x1422be[_0x9dbe('0x17')][_0x9dbe('0x1b')]?_[_0x9dbe('0x1c')](_0x1422be['options'][_0x9dbe('0x1b')],function(_0x57ecc0){return{'model':db[_0x57ecc0[_0x9dbe('0x1d')]],'as':_0x57ecc0['as'],'attributes':_0x57ecc0[_0x9dbe('0x1a')],'include':_0x57ecc0[_0x9dbe('0x1b')]?_[_0x9dbe('0x1c')](_0x57ecc0['include'],function(_0x2fe727){return{'model':db[_0x2fe727[_0x9dbe('0x1d')]],'as':_0x2fe727['as'],'attributes':_0x2fe727[_0x9dbe('0x1a')],'include':_0x2fe727[_0x9dbe('0x1b')]?_['map'](_0x2fe727['include'],function(_0x4bdd6b){return{'model':db[_0x4bdd6b[_0x9dbe('0x1d')]],'as':_0x4bdd6b['as'],'attributes':_0x4bdd6b['attributes']};}):[]};}):[]};}):[]:[]})[_0x9dbe('0x1e')](function(_0x2a3d80){logger['info'](_0x9dbe('0x16'),_0x1422be);logger[_0x9dbe('0x1f')](_0x9dbe('0x16'),_0x1422be,JSON[_0x9dbe('0x10')](_0x2a3d80));_0x2754ac(_0x2a3d80);})[_0x9dbe('0x15')](function(_0x15ab03){logger[_0x9dbe('0x11')](_0x9dbe('0x16'),_0x15ab03['message'],_0x1422be);_0x4b5898(_0x38ab1d['error'](0x1f4,_0x15ab03[_0x9dbe('0x13')]));});});};exports['ShowDynamics365Account']=function(_0x1a2e39){var _0x482e9c=this;return new Promise(function(_0xf93db2,_0xd62d9d){return db[_0x9dbe('0x20')]['find']({'raw':_0x1a2e39[_0x9dbe('0x17')]?_0x1a2e39[_0x9dbe('0x17')][_0x9dbe('0x18')]===undefined?!![]:![]:!![],'where':_0x1a2e39[_0x9dbe('0x17')]?_0x1a2e39[_0x9dbe('0x17')][_0x9dbe('0x19')]||null:null,'attributes':_0x1a2e39[_0x9dbe('0x17')]?_0x1a2e39[_0x9dbe('0x17')]['attributes']||null:null,'include':_0x1a2e39[_0x9dbe('0x17')]?_0x1a2e39[_0x9dbe('0x17')][_0x9dbe('0x1b')]?_[_0x9dbe('0x1c')](_0x1a2e39[_0x9dbe('0x17')][_0x9dbe('0x1b')],function(_0x3ef188){return{'model':db[_0x3ef188['model']],'as':_0x3ef188['as'],'attributes':_0x3ef188[_0x9dbe('0x1a')],'include':_0x3ef188[_0x9dbe('0x1b')]?_[_0x9dbe('0x1c')](_0x3ef188['include'],function(_0x56b42c){return{'model':db[_0x56b42c[_0x9dbe('0x1d')]],'as':_0x56b42c['as'],'attributes':_0x56b42c['attributes'],'include':_0x56b42c['include']?_['map'](_0x56b42c['include'],function(_0x622193){return{'model':db[_0x622193[_0x9dbe('0x1d')]],'as':_0x622193['as'],'attributes':_0x622193[_0x9dbe('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x9dbe('0x1e')](function(_0x1ecc5b){logger[_0x9dbe('0xc')]('ShowDynamics365Account',_0x1a2e39);logger[_0x9dbe('0x1f')](_0x9dbe('0x21'),_0x1a2e39,JSON[_0x9dbe('0x10')](_0x1ecc5b));_0xf93db2(_0x1ecc5b);})[_0x9dbe('0x15')](function(_0x5a8e5f){logger['error']('ShowDynamics365Account',_0x5a8e5f[_0x9dbe('0x13')],_0x1a2e39);_0xd62d9d(_0x482e9c[_0x9dbe('0x11')](0x1f4,_0x5a8e5f[_0x9dbe('0x13')]));});});}; \ No newline at end of file +var _0x6d47=['info','Dynamics365Account,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','attributes','include','map','model','ShowDynamics365Account','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then'];(function(_0x268832,_0x315138){var _0x2007e6=function(_0x354584){while(--_0x354584){_0x268832['push'](_0x268832['shift']());}};_0x2007e6(++_0x315138);}(_0x6d47,0x13e));var _0x76d4=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x6d47[_0x29b609];return _0x54c952;};'use strict';var _=require(_0x76d4('0x0'));var util=require(_0x76d4('0x1'));var moment=require('moment');var BPromise=require(_0x76d4('0x2'));var rs=require(_0x76d4('0x3'));var fs=require('fs');var Redis=require(_0x76d4('0x4'));var db=require(_0x76d4('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x76d4('0x6'))('rpc');var config=require(_0x76d4('0x7'));var jayson=require(_0x76d4('0x8'));var client=jayson[_0x76d4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5973c6,_0x6ebf43,_0x897a42){return new BPromise(function(_0x9d052c,_0x1a4218){return client[_0x76d4('0xa')](_0x5973c6,_0x897a42)[_0x76d4('0xb')](function(_0x2405bc){logger[_0x76d4('0xc')](_0x76d4('0xd'),_0x6ebf43,'request\x20sent');logger[_0x76d4('0xe')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x6ebf43,_0x76d4('0xf'),JSON[_0x76d4('0x10')](_0x2405bc));if(_0x2405bc[_0x76d4('0x11')]){if(_0x2405bc[_0x76d4('0x11')]['code']===0x1f4){logger['error'](_0x76d4('0xd'),_0x6ebf43,_0x2405bc[_0x76d4('0x11')][_0x76d4('0x12')]);return _0x1a4218(_0x2405bc[_0x76d4('0x11')]['message']);}logger[_0x76d4('0x11')]('Dynamics365Account,\x20%s,\x20%s',_0x6ebf43,_0x2405bc[_0x76d4('0x11')][_0x76d4('0x12')]);return _0x9d052c(_0x2405bc[_0x76d4('0x11')][_0x76d4('0x12')]);}else{logger[_0x76d4('0xc')](_0x76d4('0xd'),_0x6ebf43,_0x76d4('0xf'));_0x9d052c(_0x2405bc[_0x76d4('0x13')]['message']);}})[_0x76d4('0x14')](function(_0x26b7c5){logger[_0x76d4('0x11')](_0x76d4('0xd'),_0x6ebf43,_0x26b7c5);_0x1a4218(_0x26b7c5);});});}exports[_0x76d4('0x15')]=function(_0x588f64){var _0x493b5f=this;return new Promise(function(_0x458eea,_0x56bb72){return db[_0x76d4('0x16')][_0x76d4('0x17')]({'raw':_0x588f64[_0x76d4('0x18')]?_0x588f64['options'][_0x76d4('0x19')]===undefined?!![]:![]:!![],'where':_0x588f64[_0x76d4('0x18')]?_0x588f64[_0x76d4('0x18')][_0x76d4('0x1a')]||null:null,'attributes':_0x588f64[_0x76d4('0x18')]?_0x588f64[_0x76d4('0x18')][_0x76d4('0x1b')]||null:null,'limit':_0x588f64[_0x76d4('0x18')]?_0x588f64['options']['limit']||null:null,'include':_0x588f64['options']?_0x588f64[_0x76d4('0x18')][_0x76d4('0x1c')]?_[_0x76d4('0x1d')](_0x588f64[_0x76d4('0x18')][_0x76d4('0x1c')],function(_0x1346b9){return{'model':db[_0x1346b9[_0x76d4('0x1e')]],'as':_0x1346b9['as'],'attributes':_0x1346b9[_0x76d4('0x1b')],'include':_0x1346b9['include']?_[_0x76d4('0x1d')](_0x1346b9['include'],function(_0x26c14b){return{'model':db[_0x26c14b[_0x76d4('0x1e')]],'as':_0x26c14b['as'],'attributes':_0x26c14b[_0x76d4('0x1b')],'include':_0x26c14b[_0x76d4('0x1c')]?_[_0x76d4('0x1d')](_0x26c14b['include'],function(_0x10eb0d){return{'model':db[_0x10eb0d[_0x76d4('0x1e')]],'as':_0x10eb0d['as'],'attributes':_0x10eb0d[_0x76d4('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x31f23d){logger['info'](_0x76d4('0x15'),_0x588f64);logger['debug'](_0x76d4('0x15'),_0x588f64,JSON[_0x76d4('0x10')](_0x31f23d));_0x458eea(_0x31f23d);})[_0x76d4('0x14')](function(_0x291140){logger[_0x76d4('0x11')](_0x76d4('0x15'),_0x291140[_0x76d4('0x12')],_0x588f64);_0x56bb72(_0x493b5f[_0x76d4('0x11')](0x1f4,_0x291140['message']));});});};exports[_0x76d4('0x1f')]=function(_0x272afa){var _0x262185=this;return new Promise(function(_0x31c376,_0x14c1e4){return db[_0x76d4('0x16')][_0x76d4('0x20')]({'raw':_0x272afa[_0x76d4('0x18')]?_0x272afa[_0x76d4('0x18')][_0x76d4('0x19')]===undefined?!![]:![]:!![],'where':_0x272afa['options']?_0x272afa['options'][_0x76d4('0x1a')]||null:null,'attributes':_0x272afa[_0x76d4('0x18')]?_0x272afa[_0x76d4('0x18')][_0x76d4('0x1b')]||null:null,'include':_0x272afa[_0x76d4('0x18')]?_0x272afa[_0x76d4('0x18')]['include']?_[_0x76d4('0x1d')](_0x272afa['options'][_0x76d4('0x1c')],function(_0x17f7c3){return{'model':db[_0x17f7c3['model']],'as':_0x17f7c3['as'],'attributes':_0x17f7c3[_0x76d4('0x1b')],'include':_0x17f7c3[_0x76d4('0x1c')]?_[_0x76d4('0x1d')](_0x17f7c3['include'],function(_0x255151){return{'model':db[_0x255151[_0x76d4('0x1e')]],'as':_0x255151['as'],'attributes':_0x255151[_0x76d4('0x1b')],'include':_0x255151[_0x76d4('0x1c')]?_['map'](_0x255151[_0x76d4('0x1c')],function(_0x2697bf){return{'model':db[_0x2697bf[_0x76d4('0x1e')]],'as':_0x2697bf['as'],'attributes':_0x2697bf[_0x76d4('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x76d4('0xb')](function(_0x1982a2){logger[_0x76d4('0xc')](_0x76d4('0x1f'),_0x272afa);logger[_0x76d4('0xe')](_0x76d4('0x1f'),_0x272afa,JSON[_0x76d4('0x10')](_0x1982a2));_0x31c376(_0x1982a2);})[_0x76d4('0x14')](function(_0x28f3c6){logger[_0x76d4('0x11')](_0x76d4('0x1f'),_0x28f3c6[_0x76d4('0x12')],_0x272afa);_0x14c1e4(_0x262185[_0x76d4('0x11')](0x1f4,_0x28f3c6['message']));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 1f74cf3..67051b5 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 _0xb44a=['/:id/subjects','getSubjects','getDescriptions','post','create','put','update','destroy','exports','path','express','../../components/auth/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields'];(function(_0x1450f9,_0x58e69f){var _0x13080b=function(_0x23988e){while(--_0x23988e){_0x1450f9['push'](_0x1450f9['shift']());}};_0x13080b(++_0x58e69f);}(_0xb44a,0x1c2));var _0xab44=function(_0x12aaee,_0x5bf50c){_0x12aaee=_0x12aaee-0x0;var _0x37c350=_0xb44a[_0x12aaee];return _0x37c350;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xab44('0x0'));var timeout=require('connect-timeout');var express=require(_0xab44('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xab44('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0xab44('0x3'));var controller=require(_0xab44('0x4'));router[_0xab44('0x5')]('/',auth[_0xab44('0x6')](),controller[_0xab44('0x7')]);router[_0xab44('0x5')](_0xab44('0x8'),auth[_0xab44('0x6')](),controller[_0xab44('0x9')]);router[_0xab44('0x5')](_0xab44('0xa'),auth[_0xab44('0x6')](),controller[_0xab44('0xb')]);router['get'](_0xab44('0xc'),auth['isAuthenticated'](),controller[_0xab44('0xd')]);router['get']('/:id/descriptions',auth[_0xab44('0x6')](),controller[_0xab44('0xe')]);router[_0xab44('0xf')]('/',auth[_0xab44('0x6')](),controller[_0xab44('0x10')]);router[_0xab44('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xab44('0x12')]);router['delete'](_0xab44('0x8'),auth['isAuthenticated'](),controller[_0xab44('0x13')]);module[_0xab44('0x14')]=router; \ No newline at end of file +var _0x56ff=['put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../config/environment','./intDynamics365Configuration.controller','get','index','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','post','create'];(function(_0x5891a8,_0x5ca617){var _0x125df1=function(_0x166eae){while(--_0x166eae){_0x5891a8['push'](_0x5891a8['shift']());}};_0x125df1(++_0x5ca617);}(_0x56ff,0x66));var _0xf56f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x56ff[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xf56f('0x0'));var util=require(_0xf56f('0x1'));var path=require('path');var timeout=require(_0xf56f('0x2'));var express=require(_0xf56f('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf56f('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xf56f('0x5'));var controller=require(_0xf56f('0x6'));router[_0xf56f('0x7')]('/',auth['isAuthenticated'](),controller[_0xf56f('0x8')]);router['get']('/:id',auth[_0xf56f('0x9')](),controller[_0xf56f('0xa')]);router['get'](_0xf56f('0xb'),auth['isAuthenticated'](),controller[_0xf56f('0xc')]);router[_0xf56f('0x7')](_0xf56f('0xd'),auth[_0xf56f('0x9')](),controller[_0xf56f('0xe')]);router[_0xf56f('0x7')]('/:id/descriptions',auth[_0xf56f('0x9')](),controller[_0xf56f('0xf')]);router[_0xf56f('0x10')]('/',auth[_0xf56f('0x9')](),controller[_0xf56f('0x11')]);router[_0xf56f('0x12')](_0xf56f('0x13'),auth[_0xf56f('0x9')](),controller[_0xf56f('0x14')]);router[_0xf56f('0x15')]('/:id',auth[_0xf56f('0x9')](),controller[_0xf56f('0x16')]);module[_0xf56f('0x17')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 67b1979..90282af 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 _0x8b6a=['sequelize','exports','STRING','ENUM','incident','phonecall','contact','BOOLEAN'];(function(_0x1ae449,_0x2a9790){var _0x4a7ba2=function(_0x5a8c34){while(--_0x5a8c34){_0x1ae449['push'](_0x1ae449['shift']());}};_0x4a7ba2(++_0x2a9790);}(_0x8b6a,0xa0));var _0xa8b6=function(_0x3b429c,_0x12f39d){_0x3b429c=_0x3b429c-0x0;var _0x46dcf3=_0x8b6a[_0x3b429c];return _0x46dcf3;};'use strict';var Sequelize=require(_0xa8b6('0x0'));module[_0xa8b6('0x1')]={'name':{'type':Sequelize[_0xa8b6('0x2')]},'description':{'type':Sequelize[_0xa8b6('0x2')]},'ticketType':{'type':Sequelize[_0xa8b6('0x3')](_0xa8b6('0x4'),_0xa8b6('0x5')),'defaultValue':_0xa8b6('0x4')},'moduleCreate':{'type':Sequelize['ENUM'](_0xa8b6('0x6'),'nothing'),'defaultValue':'contact','allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0xa8b6('0x2')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0xa8b6('0x7')],'defaultValue':!![]}}; \ No newline at end of file +var _0x2081=['incident','phonecall','contact','BOOLEAN','STRING','ENUM'];(function(_0x4ccc4b,_0x534a08){var _0x4dddd9=function(_0x5a3e1e){while(--_0x5a3e1e){_0x4ccc4b['push'](_0x4ccc4b['shift']());}};_0x4dddd9(++_0x534a08);}(_0x2081,0xc4));var _0x1208=function(_0x3b5ad9,_0x223867){_0x3b5ad9=_0x3b5ad9-0x0;var _0x611ae9=_0x2081[_0x3b5ad9];return _0x611ae9;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x1208('0x0')]},'description':{'type':Sequelize[_0x1208('0x0')]},'ticketType':{'type':Sequelize[_0x1208('0x1')](_0x1208('0x2'),_0x1208('0x3')),'defaultValue':_0x1208('0x2')},'moduleCreate':{'type':Sequelize[_0x1208('0x1')](_0x1208('0x4'),'nothing'),'defaultValue':'contact','allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0x1208('0x0')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0x1208('0x5')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index fecb4f9..04f5579 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 _0xfbd2=['apply','reject','save','update','then','end','error','stack','name','index','map','Dynamics365Configuration','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','filter','merge','type','VIRTUAL','includeAll','rows','catch','params','rawAttributes','include','options','create','body','destroy','Dynamics365Field','order','pick','hasOwnProperty','getFields','getSubjects','findOne','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xfbd2,0x1f1));var _0x2fbd=function(_0x4c2554,_0x180ab1){_0x4c2554=_0x4c2554-0x0;var _0x4ad3ad=_0xfbd2[_0x4c2554];return _0x4ad3ad;};'use strict';var emlformat=require(_0x2fbd('0x0'));var rimraf=require(_0x2fbd('0x1'));var zipdir=require(_0x2fbd('0x2'));var jsonpatch=require(_0x2fbd('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2fbd('0x4'));var Mustache=require('mustache');var util=require(_0x2fbd('0x5'));var path=require(_0x2fbd('0x6'));var sox=require(_0x2fbd('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2fbd('0x8'));var _=require('lodash');var squel=require(_0x2fbd('0x9'));var crypto=require(_0x2fbd('0xa'));var jsforce=require(_0x2fbd('0xb'));var deskjs=require(_0x2fbd('0xc'));var toCsv=require('to-csv');var querystring=require(_0x2fbd('0xd'));var Papa=require('papaparse');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(_0x2fbd('0xe'));var logger=require(_0x2fbd('0xf'))(_0x2fbd('0x10'));var utils=require(_0x2fbd('0x11'));var config=require(_0x2fbd('0x12'));var licenseUtil=require(_0x2fbd('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xd8c1a1,_0x1fcc89){_0x1fcc89=_0x1fcc89||0xcc;return function(_0x4496d1){if(_0x4496d1){return _0xd8c1a1['sendStatus'](_0x1fcc89);}return _0xd8c1a1[_0x2fbd('0x14')](_0x1fcc89)['end']();};}function respondWithResult(_0x55d92e,_0x199c19){_0x199c19=_0x199c19||0xc8;return function(_0x170d33){if(_0x170d33){return _0x55d92e[_0x2fbd('0x14')](_0x199c19)[_0x2fbd('0x15')](_0x170d33);}};}function respondWithFilteredResult(_0x30d70a,_0x3888b7){return function(_0x209eb8){if(_0x209eb8){var _0xd69a35=typeof _0x3888b7[_0x2fbd('0x16')]===_0x2fbd('0x17')&&typeof _0x3888b7[_0x2fbd('0x18')]===_0x2fbd('0x17');var _0xe35a24=_0x209eb8[_0x2fbd('0x19')];var _0x4f4803=_0xd69a35?0x0:_0x3888b7['offset'];var _0x2d3de8=_0xd69a35?_0x209eb8[_0x2fbd('0x19')]:_0x3888b7[_0x2fbd('0x16')]+_0x3888b7['limit'];var _0x32a116;if(_0x2d3de8>=_0xe35a24){_0x2d3de8=_0xe35a24;_0x32a116=0xc8;}else{_0x32a116=0xce;}_0x30d70a[_0x2fbd('0x14')](_0x32a116);return _0x30d70a[_0x2fbd('0x1a')](_0x2fbd('0x1b'),_0x4f4803+'-'+_0x2d3de8+'/'+_0xe35a24)[_0x2fbd('0x15')](_0x209eb8);}return null;};}function patchUpdates(_0x45a39a){return function(_0x1e0c07){try{jsonpatch[_0x2fbd('0x1c')](_0x1e0c07,_0x45a39a,!![]);}catch(_0x4c6934){return BPromise[_0x2fbd('0x1d')](_0x4c6934);}return _0x1e0c07[_0x2fbd('0x1e')]();};}function saveUpdates(_0x3de86f,_0x1d9526){return function(_0x284a8f){if(_0x284a8f){return _0x284a8f[_0x2fbd('0x1f')](_0x3de86f)[_0x2fbd('0x20')](function(_0x15ecaa){return _0x15ecaa;});}return null;};}function removeEntity(_0x2b8a70,_0x3c1282){return function(_0xb58112){if(_0xb58112){return _0xb58112['destroy']()[_0x2fbd('0x20')](function(){_0x2b8a70[_0x2fbd('0x14')](0xcc)[_0x2fbd('0x21')]();});}};}function handleEntityNotFound(_0x35982a,_0x38982b){return function(_0x43fbae){if(!_0x43fbae){_0x35982a['sendStatus'](0x194);}return _0x43fbae;};}function handleError(_0x2b8e77,_0x48e27f){_0x48e27f=_0x48e27f||0x1f4;return function(_0x112281){logger[_0x2fbd('0x22')](_0x112281[_0x2fbd('0x23')]);if(_0x112281[_0x2fbd('0x24')]){delete _0x112281['name'];}_0x2b8e77['status'](_0x48e27f)['send'](_0x112281);};}exports[_0x2fbd('0x25')]=function(_0x25d07f,_0x158b1d){var _0x1556fe={},_0x5b51f8={},_0x333555={'count':0x0,'rows':[]};var _0x5bffe0=_[_0x2fbd('0x26')](db[_0x2fbd('0x27')]['rawAttributes'],function(_0x25c131){return{'name':_0x25c131[_0x2fbd('0x28')],'type':_0x25c131['type'][_0x2fbd('0x29')]};});_0x5b51f8[_0x2fbd('0x2a')]=_[_0x2fbd('0x26')](_0x5bffe0,'name');_0x5b51f8['query']=_[_0x2fbd('0x2b')](_0x25d07f[_0x2fbd('0x2c')]);_0x5b51f8[_0x2fbd('0x2d')]=_[_0x2fbd('0x2e')](_0x5b51f8['model'],_0x5b51f8[_0x2fbd('0x2c')]);_0x1556fe[_0x2fbd('0x2f')]=_[_0x2fbd('0x2e')](_0x5b51f8[_0x2fbd('0x2a')],qs[_0x2fbd('0x30')](_0x25d07f['query']['fields']));_0x1556fe[_0x2fbd('0x2f')]=_0x1556fe[_0x2fbd('0x2f')][_0x2fbd('0x31')]?_0x1556fe[_0x2fbd('0x2f')]:_0x5b51f8['model'];if(!_0x25d07f['query']['hasOwnProperty'](_0x2fbd('0x32'))){_0x1556fe[_0x2fbd('0x18')]=qs[_0x2fbd('0x18')](_0x25d07f[_0x2fbd('0x2c')][_0x2fbd('0x18')]);_0x1556fe['offset']=qs['offset'](_0x25d07f['query'][_0x2fbd('0x16')]);}_0x1556fe['order']=qs['sort'](_0x25d07f['query'][_0x2fbd('0x33')]);_0x1556fe[_0x2fbd('0x34')]=qs[_0x2fbd('0x2d')](_['pick'](_0x25d07f['query'],_0x5b51f8[_0x2fbd('0x2d')]),_0x5bffe0);if(_0x25d07f[_0x2fbd('0x2c')][_0x2fbd('0x35')]){_0x1556fe[_0x2fbd('0x34')]=_[_0x2fbd('0x36')](_0x1556fe[_0x2fbd('0x34')],{'$or':_[_0x2fbd('0x26')](_0x5bffe0,function(_0x2fd272){if(_0x2fd272[_0x2fbd('0x37')]!==_0x2fbd('0x38')){var _0x23590c={};_0x23590c[_0x2fd272[_0x2fbd('0x24')]]={'$like':'%'+_0x25d07f[_0x2fbd('0x2c')][_0x2fbd('0x35')]+'%'};return _0x23590c;}})});}_0x1556fe=_[_0x2fbd('0x36')]({},_0x1556fe,_0x25d07f['options']);var _0x15419d={'where':_0x1556fe[_0x2fbd('0x34')]};return db[_0x2fbd('0x27')][_0x2fbd('0x19')](_0x15419d)[_0x2fbd('0x20')](function(_0x47fe68){_0x333555['count']=_0x47fe68;if(_0x25d07f['query'][_0x2fbd('0x39')]){_0x1556fe['include']=[{'all':!![]}];}return db[_0x2fbd('0x27')]['findAll'](_0x1556fe);})[_0x2fbd('0x20')](function(_0x20102c){_0x333555[_0x2fbd('0x3a')]=_0x20102c;return _0x333555;})[_0x2fbd('0x20')](respondWithFilteredResult(_0x158b1d,_0x1556fe))[_0x2fbd('0x3b')](handleError(_0x158b1d,null));};exports['show']=function(_0x5d2eb1,_0x13244a){var _0x451af1={'raw':![],'where':{'id':_0x5d2eb1[_0x2fbd('0x3c')]['id']}},_0x2ee3aa={};_0x2ee3aa[_0x2fbd('0x2a')]=_[_0x2fbd('0x2b')](db[_0x2fbd('0x27')][_0x2fbd('0x3d')]);_0x2ee3aa[_0x2fbd('0x2c')]=_[_0x2fbd('0x2b')](_0x5d2eb1[_0x2fbd('0x2c')]);_0x2ee3aa[_0x2fbd('0x2d')]=_['intersection'](_0x2ee3aa['model'],_0x2ee3aa[_0x2fbd('0x2c')]);_0x451af1['attributes']=_[_0x2fbd('0x2e')](_0x2ee3aa[_0x2fbd('0x2a')],qs[_0x2fbd('0x30')](_0x5d2eb1[_0x2fbd('0x2c')][_0x2fbd('0x30')]));_0x451af1[_0x2fbd('0x2f')]=_0x451af1['attributes'][_0x2fbd('0x31')]?_0x451af1[_0x2fbd('0x2f')]:_0x2ee3aa[_0x2fbd('0x2a')];if(_0x5d2eb1[_0x2fbd('0x2c')]['includeAll']){_0x451af1[_0x2fbd('0x3e')]=[{'all':!![]}];}_0x451af1=_[_0x2fbd('0x36')]({},_0x451af1,_0x5d2eb1[_0x2fbd('0x3f')]);return db['Dynamics365Configuration']['find'](_0x451af1)['then'](handleEntityNotFound(_0x13244a,null))['then'](respondWithResult(_0x13244a,null))[_0x2fbd('0x3b')](handleError(_0x13244a,null));};exports[_0x2fbd('0x40')]=function(_0x34815c,_0x5ba9ac){return db[_0x2fbd('0x27')][_0x2fbd('0x40')](_0x34815c['body'],{})[_0x2fbd('0x20')](respondWithResult(_0x5ba9ac,0xc9))[_0x2fbd('0x3b')](handleError(_0x5ba9ac,null));};exports['update']=function(_0x1edb34,_0x1b3d32){if(_0x1edb34['body']['id']){delete _0x1edb34['body']['id'];}return db[_0x2fbd('0x27')]['find']({'where':{'id':_0x1edb34[_0x2fbd('0x3c')]['id']}})[_0x2fbd('0x20')](handleEntityNotFound(_0x1b3d32,null))[_0x2fbd('0x20')](saveUpdates(_0x1edb34[_0x2fbd('0x41')],null))['then'](respondWithResult(_0x1b3d32,null))['catch'](handleError(_0x1b3d32,null));};exports[_0x2fbd('0x42')]=function(_0x128546,_0x424181){return db['Dynamics365Configuration']['find']({'where':{'id':_0x128546[_0x2fbd('0x3c')]['id']}})['then'](handleEntityNotFound(_0x424181,null))[_0x2fbd('0x20')](removeEntity(_0x424181,null))[_0x2fbd('0x3b')](handleError(_0x424181,null));};exports['getFields']=function(_0x4965a8,_0x4b13ca,_0x487626){var _0x7112b5={};var _0x4fcf7a={};var _0x1d3a37;var _0x1c2b37;return db[_0x2fbd('0x27')]['findOne']({'where':{'id':_0x4965a8[_0x2fbd('0x3c')]['id']}})[_0x2fbd('0x20')](handleEntityNotFound(_0x4b13ca,null))[_0x2fbd('0x20')](function(_0x543d12){if(_0x543d12){_0x1d3a37=_0x543d12;_0x4fcf7a[_0x2fbd('0x2a')]=_[_0x2fbd('0x2b')](db[_0x2fbd('0x43')]['rawAttributes']);_0x4fcf7a['query']=_[_0x2fbd('0x2b')](_0x4965a8[_0x2fbd('0x2c')]);_0x4fcf7a[_0x2fbd('0x2d')]=_[_0x2fbd('0x2e')](_0x4fcf7a[_0x2fbd('0x2a')],_0x4fcf7a[_0x2fbd('0x2c')]);_0x7112b5[_0x2fbd('0x2f')]=_[_0x2fbd('0x2e')](_0x4fcf7a[_0x2fbd('0x2a')],qs['fields'](_0x4965a8[_0x2fbd('0x2c')]['fields']));_0x7112b5[_0x2fbd('0x2f')]=_0x7112b5[_0x2fbd('0x2f')][_0x2fbd('0x31')]?_0x7112b5[_0x2fbd('0x2f')]:_0x4fcf7a[_0x2fbd('0x2a')];_0x7112b5[_0x2fbd('0x44')]=qs[_0x2fbd('0x33')](_0x4965a8[_0x2fbd('0x2c')][_0x2fbd('0x33')]);_0x7112b5[_0x2fbd('0x34')]=qs[_0x2fbd('0x2d')](_[_0x2fbd('0x45')](_0x4965a8[_0x2fbd('0x2c')],_0x4fcf7a[_0x2fbd('0x2d')]));if(_0x4965a8['query'][_0x2fbd('0x35')]){_0x7112b5['where']=_[_0x2fbd('0x36')](_0x7112b5[_0x2fbd('0x34')],{'$or':_[_0x2fbd('0x26')](_0x7112b5[_0x2fbd('0x2f')],function(_0x19465f){var _0x1d95a7={};_0x1d95a7[_0x19465f]={'$like':'%'+_0x4965a8['query'][_0x2fbd('0x35')]+'%'};return _0x1d95a7;})});}_0x7112b5=_['merge']({},_0x7112b5,_0x4965a8[_0x2fbd('0x3f')]);return _0x1d3a37['getFields'](_0x7112b5);}})[_0x2fbd('0x20')](function(_0x53bd22){if(_0x53bd22){_0x1c2b37=_0x53bd22[_0x2fbd('0x31')];if(!_0x4965a8[_0x2fbd('0x2c')][_0x2fbd('0x46')](_0x2fbd('0x32'))){_0x7112b5[_0x2fbd('0x18')]=qs[_0x2fbd('0x18')](_0x4965a8[_0x2fbd('0x2c')]['limit']);_0x7112b5[_0x2fbd('0x16')]=qs[_0x2fbd('0x16')](_0x4965a8['query'][_0x2fbd('0x16')]);}return _0x1d3a37[_0x2fbd('0x47')](_0x7112b5);}})[_0x2fbd('0x20')](function(_0x7ea9f3){if(_0x7ea9f3){return _0x7ea9f3?{'count':_0x1c2b37,'rows':_0x7ea9f3}:null;}})[_0x2fbd('0x20')](respondWithResult(_0x4b13ca,null))[_0x2fbd('0x3b')](handleError(_0x4b13ca,null));};exports[_0x2fbd('0x48')]=function(_0x1a8700,_0x8700e1,_0x5387a8){var _0xeb43a4={};var _0x296a06={};var _0x386db8;var _0x42501a;return db[_0x2fbd('0x27')][_0x2fbd('0x49')]({'where':{'id':_0x1a8700[_0x2fbd('0x3c')]['id']}})['then'](handleEntityNotFound(_0x8700e1,null))[_0x2fbd('0x20')](function(_0x4f196b){if(_0x4f196b){_0x386db8=_0x4f196b;_0x296a06[_0x2fbd('0x2a')]=_[_0x2fbd('0x2b')](db[_0x2fbd('0x43')][_0x2fbd('0x3d')]);_0x296a06[_0x2fbd('0x2c')]=_[_0x2fbd('0x2b')](_0x1a8700['query']);_0x296a06[_0x2fbd('0x2d')]=_[_0x2fbd('0x2e')](_0x296a06[_0x2fbd('0x2a')],_0x296a06[_0x2fbd('0x2c')]);_0xeb43a4[_0x2fbd('0x2f')]=_[_0x2fbd('0x2e')](_0x296a06[_0x2fbd('0x2a')],qs[_0x2fbd('0x30')](_0x1a8700[_0x2fbd('0x2c')][_0x2fbd('0x30')]));_0xeb43a4[_0x2fbd('0x2f')]=_0xeb43a4[_0x2fbd('0x2f')]['length']?_0xeb43a4[_0x2fbd('0x2f')]:_0x296a06[_0x2fbd('0x2a')];_0xeb43a4[_0x2fbd('0x44')]=qs[_0x2fbd('0x33')](_0x1a8700[_0x2fbd('0x2c')][_0x2fbd('0x33')]);_0xeb43a4[_0x2fbd('0x34')]=qs[_0x2fbd('0x2d')](_[_0x2fbd('0x45')](_0x1a8700[_0x2fbd('0x2c')],_0x296a06[_0x2fbd('0x2d')]));if(_0x1a8700['query'][_0x2fbd('0x35')]){_0xeb43a4['where']=_[_0x2fbd('0x36')](_0xeb43a4[_0x2fbd('0x34')],{'$or':_[_0x2fbd('0x26')](_0xeb43a4[_0x2fbd('0x2f')],function(_0x2ef195){var _0x3f6e4a={};_0x3f6e4a[_0x2ef195]={'$like':'%'+_0x1a8700[_0x2fbd('0x2c')]['filter']+'%'};return _0x3f6e4a;})});}_0xeb43a4=_[_0x2fbd('0x36')]({},_0xeb43a4,_0x1a8700[_0x2fbd('0x3f')]);return _0x386db8[_0x2fbd('0x48')](_0xeb43a4);}})['then'](function(_0x33b650){if(_0x33b650){_0x42501a=_0x33b650[_0x2fbd('0x31')];if(!_0x1a8700[_0x2fbd('0x2c')][_0x2fbd('0x46')](_0x2fbd('0x32'))){_0xeb43a4[_0x2fbd('0x18')]=qs[_0x2fbd('0x18')](_0x1a8700[_0x2fbd('0x2c')][_0x2fbd('0x18')]);_0xeb43a4['offset']=qs['offset'](_0x1a8700[_0x2fbd('0x2c')]['offset']);}return _0x386db8[_0x2fbd('0x48')](_0xeb43a4);}})[_0x2fbd('0x20')](function(_0x19d7d3){if(_0x19d7d3){return _0x19d7d3?{'count':_0x42501a,'rows':_0x19d7d3}:null;}})[_0x2fbd('0x20')](respondWithResult(_0x8700e1,null))['catch'](handleError(_0x8700e1,null));};exports[_0x2fbd('0x4a')]=function(_0x439fc8,_0x5e7990,_0x18f524){var _0x18e8ef={};var _0x27fef7={};var _0x1f7434;var _0x3f6a5d;return db[_0x2fbd('0x27')][_0x2fbd('0x49')]({'where':{'id':_0x439fc8['params']['id']}})['then'](handleEntityNotFound(_0x5e7990,null))[_0x2fbd('0x20')](function(_0x111f9e){if(_0x111f9e){_0x1f7434=_0x111f9e;_0x27fef7['model']=_['keys'](db[_0x2fbd('0x43')][_0x2fbd('0x3d')]);_0x27fef7[_0x2fbd('0x2c')]=_[_0x2fbd('0x2b')](_0x439fc8[_0x2fbd('0x2c')]);_0x27fef7[_0x2fbd('0x2d')]=_[_0x2fbd('0x2e')](_0x27fef7[_0x2fbd('0x2a')],_0x27fef7[_0x2fbd('0x2c')]);_0x18e8ef[_0x2fbd('0x2f')]=_[_0x2fbd('0x2e')](_0x27fef7[_0x2fbd('0x2a')],qs[_0x2fbd('0x30')](_0x439fc8[_0x2fbd('0x2c')][_0x2fbd('0x30')]));_0x18e8ef[_0x2fbd('0x2f')]=_0x18e8ef[_0x2fbd('0x2f')]['length']?_0x18e8ef['attributes']:_0x27fef7[_0x2fbd('0x2a')];_0x18e8ef[_0x2fbd('0x44')]=qs['sort'](_0x439fc8['query'][_0x2fbd('0x33')]);_0x18e8ef[_0x2fbd('0x34')]=qs['filters'](_[_0x2fbd('0x45')](_0x439fc8[_0x2fbd('0x2c')],_0x27fef7[_0x2fbd('0x2d')]));if(_0x439fc8[_0x2fbd('0x2c')][_0x2fbd('0x35')]){_0x18e8ef[_0x2fbd('0x34')]=_[_0x2fbd('0x36')](_0x18e8ef[_0x2fbd('0x34')],{'$or':_[_0x2fbd('0x26')](_0x18e8ef[_0x2fbd('0x2f')],function(_0xab977b){var _0x195645={};_0x195645[_0xab977b]={'$like':'%'+_0x439fc8[_0x2fbd('0x2c')]['filter']+'%'};return _0x195645;})});}_0x18e8ef=_[_0x2fbd('0x36')]({},_0x18e8ef,_0x439fc8[_0x2fbd('0x3f')]);return _0x1f7434[_0x2fbd('0x4a')](_0x18e8ef);}})['then'](function(_0x292df3){if(_0x292df3){_0x3f6a5d=_0x292df3[_0x2fbd('0x31')];if(!_0x439fc8[_0x2fbd('0x2c')][_0x2fbd('0x46')](_0x2fbd('0x32'))){_0x18e8ef['limit']=qs[_0x2fbd('0x18')](_0x439fc8[_0x2fbd('0x2c')][_0x2fbd('0x18')]);_0x18e8ef['offset']=qs[_0x2fbd('0x16')](_0x439fc8[_0x2fbd('0x2c')][_0x2fbd('0x16')]);}return _0x1f7434[_0x2fbd('0x4a')](_0x18e8ef);}})[_0x2fbd('0x20')](function(_0x4f2134){if(_0x4f2134){return _0x4f2134?{'count':_0x3f6a5d,'rows':_0x4f2134}:null;}})[_0x2fbd('0x20')](respondWithResult(_0x5e7990,null))[_0x2fbd('0x3b')](handleError(_0x5e7990,null));}; \ No newline at end of file +var _0x80c2=['includeAll','findAll','catch','show','params','include','options','find','create','body','getFields','Dynamics365Field','rawAttributes','order','getSubjects','findOne','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','apply','reject','update','then','destroy','error','name','send','index','map','Dynamics365Configuration','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x80c2,0x1ab));var _0x280c=function(_0x3f695d,_0xb5434c){_0x3f695d=_0x3f695d-0x0;var _0xff2260=_0x80c2[_0x3f695d];return _0xff2260;};'use strict';var emlformat=require(_0x280c('0x0'));var rimraf=require(_0x280c('0x1'));var zipdir=require(_0x280c('0x2'));var jsonpatch=require(_0x280c('0x3'));var rp=require(_0x280c('0x4'));var moment=require(_0x280c('0x5'));var BPromise=require(_0x280c('0x6'));var Mustache=require(_0x280c('0x7'));var util=require(_0x280c('0x8'));var path=require('path');var sox=require(_0x280c('0x9'));var csv=require(_0x280c('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x280c('0xb'));var _=require(_0x280c('0xc'));var squel=require(_0x280c('0xd'));var crypto=require(_0x280c('0xe'));var jsforce=require(_0x280c('0xf'));var deskjs=require(_0x280c('0x10'));var toCsv=require(_0x280c('0xa'));var querystring=require(_0x280c('0x11'));var Papa=require('papaparse');var Redis=require(_0x280c('0x12'));var authService=require(_0x280c('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x280c('0x14'));var hardwareService=require(_0x280c('0x15'));var logger=require(_0x280c('0x16'))(_0x280c('0x17'));var utils=require(_0x280c('0x18'));var config=require(_0x280c('0x19'));var licenseUtil=require(_0x280c('0x1a'));var db=require(_0x280c('0x1b'))['db'];function respondWithStatusCode(_0x35d2d8,_0xd2d9e1){_0xd2d9e1=_0xd2d9e1||0xcc;return function(_0x3af5dd){if(_0x3af5dd){return _0x35d2d8[_0x280c('0x1c')](_0xd2d9e1);}return _0x35d2d8[_0x280c('0x1d')](_0xd2d9e1)[_0x280c('0x1e')]();};}function respondWithResult(_0x1a05fe,_0x11b313){_0x11b313=_0x11b313||0xc8;return function(_0x1137dc){if(_0x1137dc){return _0x1a05fe[_0x280c('0x1d')](_0x11b313)['json'](_0x1137dc);}};}function respondWithFilteredResult(_0x438065,_0x72348e){return function(_0x239d43){if(_0x239d43){var _0x580a8c=typeof _0x72348e[_0x280c('0x1f')]===_0x280c('0x20')&&typeof _0x72348e[_0x280c('0x21')]===_0x280c('0x20');var _0x4a1839=_0x239d43[_0x280c('0x22')];var _0x1ba46a=_0x580a8c?0x0:_0x72348e[_0x280c('0x1f')];var _0xe84511=_0x580a8c?_0x239d43[_0x280c('0x22')]:_0x72348e[_0x280c('0x1f')]+_0x72348e['limit'];var _0x25b03e;if(_0xe84511>=_0x4a1839){_0xe84511=_0x4a1839;_0x25b03e=0xc8;}else{_0x25b03e=0xce;}_0x438065[_0x280c('0x1d')](_0x25b03e);return _0x438065[_0x280c('0x23')]('Content-Range',_0x1ba46a+'-'+_0xe84511+'/'+_0x4a1839)['json'](_0x239d43);}return null;};}function patchUpdates(_0x7d0aea){return function(_0x63bf08){try{jsonpatch[_0x280c('0x24')](_0x63bf08,_0x7d0aea,!![]);}catch(_0x472789){return BPromise[_0x280c('0x25')](_0x472789);}return _0x63bf08['save']();};}function saveUpdates(_0x4a7a03,_0x28a50a){return function(_0x49a64d){if(_0x49a64d){return _0x49a64d[_0x280c('0x26')](_0x4a7a03)[_0x280c('0x27')](function(_0xf62eff){return _0xf62eff;});}return null;};}function removeEntity(_0x1e2262,_0x4876a3){return function(_0x86bcf2){if(_0x86bcf2){return _0x86bcf2[_0x280c('0x28')]()[_0x280c('0x27')](function(){_0x1e2262[_0x280c('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x11e394,_0x3eaee9){return function(_0x164e6c){if(!_0x164e6c){_0x11e394[_0x280c('0x1c')](0x194);}return _0x164e6c;};}function handleError(_0x58c30f,_0x162754){_0x162754=_0x162754||0x1f4;return function(_0x2a3679){logger[_0x280c('0x29')](_0x2a3679['stack']);if(_0x2a3679['name']){delete _0x2a3679[_0x280c('0x2a')];}_0x58c30f[_0x280c('0x1d')](_0x162754)[_0x280c('0x2b')](_0x2a3679);};}exports[_0x280c('0x2c')]=function(_0x2d03a3,_0x1ca8dd){var _0x253c6f={},_0x505d13={},_0x560633={'count':0x0,'rows':[]};var _0xca6316=_[_0x280c('0x2d')](db[_0x280c('0x2e')]['rawAttributes'],function(_0x331769){return{'name':_0x331769[_0x280c('0x2f')],'type':_0x331769[_0x280c('0x30')][_0x280c('0x31')]};});_0x505d13['model']=_['map'](_0xca6316,_0x280c('0x2a'));_0x505d13[_0x280c('0x32')]=_[_0x280c('0x33')](_0x2d03a3[_0x280c('0x32')]);_0x505d13[_0x280c('0x34')]=_[_0x280c('0x35')](_0x505d13[_0x280c('0x36')],_0x505d13['query']);_0x253c6f['attributes']=_['intersection'](_0x505d13[_0x280c('0x36')],qs[_0x280c('0x37')](_0x2d03a3['query']['fields']));_0x253c6f[_0x280c('0x38')]=_0x253c6f[_0x280c('0x38')][_0x280c('0x39')]?_0x253c6f[_0x280c('0x38')]:_0x505d13['model'];if(!_0x2d03a3[_0x280c('0x32')][_0x280c('0x3a')](_0x280c('0x3b'))){_0x253c6f[_0x280c('0x21')]=qs[_0x280c('0x21')](_0x2d03a3['query'][_0x280c('0x21')]);_0x253c6f[_0x280c('0x1f')]=qs[_0x280c('0x1f')](_0x2d03a3[_0x280c('0x32')][_0x280c('0x1f')]);}_0x253c6f['order']=qs[_0x280c('0x3c')](_0x2d03a3[_0x280c('0x32')]['sort']);_0x253c6f[_0x280c('0x3d')]=qs[_0x280c('0x34')](_[_0x280c('0x3e')](_0x2d03a3['query'],_0x505d13[_0x280c('0x34')]),_0xca6316);if(_0x2d03a3[_0x280c('0x32')][_0x280c('0x3f')]){_0x253c6f[_0x280c('0x3d')]=_[_0x280c('0x40')](_0x253c6f[_0x280c('0x3d')],{'$or':_[_0x280c('0x2d')](_0xca6316,function(_0x397e89){if(_0x397e89[_0x280c('0x30')]!=='VIRTUAL'){var _0x769fb5={};_0x769fb5[_0x397e89[_0x280c('0x2a')]]={'$like':'%'+_0x2d03a3[_0x280c('0x32')][_0x280c('0x3f')]+'%'};return _0x769fb5;}})});}_0x253c6f=_['merge']({},_0x253c6f,_0x2d03a3['options']);var _0x27bf06={'where':_0x253c6f[_0x280c('0x3d')]};return db['Dynamics365Configuration'][_0x280c('0x22')](_0x27bf06)[_0x280c('0x27')](function(_0xc2d472){_0x560633[_0x280c('0x22')]=_0xc2d472;if(_0x2d03a3[_0x280c('0x32')][_0x280c('0x41')]){_0x253c6f['include']=[{'all':!![]}];}return db['Dynamics365Configuration'][_0x280c('0x42')](_0x253c6f);})['then'](function(_0x31919c){_0x560633['rows']=_0x31919c;return _0x560633;})[_0x280c('0x27')](respondWithFilteredResult(_0x1ca8dd,_0x253c6f))[_0x280c('0x43')](handleError(_0x1ca8dd,null));};exports[_0x280c('0x44')]=function(_0x2d235f,_0x29e70e){var _0x50bde3={'raw':![],'where':{'id':_0x2d235f[_0x280c('0x45')]['id']}},_0x3bad26={};_0x3bad26[_0x280c('0x36')]=_[_0x280c('0x33')](db[_0x280c('0x2e')]['rawAttributes']);_0x3bad26[_0x280c('0x32')]=_['keys'](_0x2d235f[_0x280c('0x32')]);_0x3bad26[_0x280c('0x34')]=_[_0x280c('0x35')](_0x3bad26[_0x280c('0x36')],_0x3bad26[_0x280c('0x32')]);_0x50bde3[_0x280c('0x38')]=_[_0x280c('0x35')](_0x3bad26[_0x280c('0x36')],qs['fields'](_0x2d235f['query'][_0x280c('0x37')]));_0x50bde3[_0x280c('0x38')]=_0x50bde3[_0x280c('0x38')][_0x280c('0x39')]?_0x50bde3[_0x280c('0x38')]:_0x3bad26[_0x280c('0x36')];if(_0x2d235f[_0x280c('0x32')][_0x280c('0x41')]){_0x50bde3[_0x280c('0x46')]=[{'all':!![]}];}_0x50bde3=_['merge']({},_0x50bde3,_0x2d235f[_0x280c('0x47')]);return db[_0x280c('0x2e')][_0x280c('0x48')](_0x50bde3)[_0x280c('0x27')](handleEntityNotFound(_0x29e70e,null))[_0x280c('0x27')](respondWithResult(_0x29e70e,null))[_0x280c('0x43')](handleError(_0x29e70e,null));};exports['create']=function(_0x1dd843,_0xb2741b){return db[_0x280c('0x2e')][_0x280c('0x49')](_0x1dd843[_0x280c('0x4a')],{})['then'](respondWithResult(_0xb2741b,0xc9))[_0x280c('0x43')](handleError(_0xb2741b,null));};exports[_0x280c('0x26')]=function(_0x4afade,_0x2bb255){if(_0x4afade[_0x280c('0x4a')]['id']){delete _0x4afade['body']['id'];}return db['Dynamics365Configuration'][_0x280c('0x48')]({'where':{'id':_0x4afade[_0x280c('0x45')]['id']}})[_0x280c('0x27')](handleEntityNotFound(_0x2bb255,null))['then'](saveUpdates(_0x4afade[_0x280c('0x4a')],null))[_0x280c('0x27')](respondWithResult(_0x2bb255,null))['catch'](handleError(_0x2bb255,null));};exports[_0x280c('0x28')]=function(_0xe731b9,_0x126255){return db[_0x280c('0x2e')]['find']({'where':{'id':_0xe731b9[_0x280c('0x45')]['id']}})[_0x280c('0x27')](handleEntityNotFound(_0x126255,null))[_0x280c('0x27')](removeEntity(_0x126255,null))[_0x280c('0x43')](handleError(_0x126255,null));};exports[_0x280c('0x4b')]=function(_0x596ce4,_0x1cbd56,_0x34634c){var _0x509e62={};var _0x584ac8={};var _0x9b9e68;var _0x5436ab;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x596ce4[_0x280c('0x45')]['id']}})[_0x280c('0x27')](handleEntityNotFound(_0x1cbd56,null))[_0x280c('0x27')](function(_0x436f09){if(_0x436f09){_0x9b9e68=_0x436f09;_0x584ac8['model']=_[_0x280c('0x33')](db[_0x280c('0x4c')][_0x280c('0x4d')]);_0x584ac8[_0x280c('0x32')]=_[_0x280c('0x33')](_0x596ce4[_0x280c('0x32')]);_0x584ac8[_0x280c('0x34')]=_[_0x280c('0x35')](_0x584ac8[_0x280c('0x36')],_0x584ac8['query']);_0x509e62['attributes']=_['intersection'](_0x584ac8[_0x280c('0x36')],qs['fields'](_0x596ce4['query']['fields']));_0x509e62[_0x280c('0x38')]=_0x509e62[_0x280c('0x38')][_0x280c('0x39')]?_0x509e62['attributes']:_0x584ac8[_0x280c('0x36')];_0x509e62[_0x280c('0x4e')]=qs['sort'](_0x596ce4[_0x280c('0x32')][_0x280c('0x3c')]);_0x509e62['where']=qs['filters'](_[_0x280c('0x3e')](_0x596ce4[_0x280c('0x32')],_0x584ac8['filters']));if(_0x596ce4[_0x280c('0x32')][_0x280c('0x3f')]){_0x509e62[_0x280c('0x3d')]=_[_0x280c('0x40')](_0x509e62[_0x280c('0x3d')],{'$or':_[_0x280c('0x2d')](_0x509e62[_0x280c('0x38')],function(_0x4dc403){var _0x5c77c0={};_0x5c77c0[_0x4dc403]={'$like':'%'+_0x596ce4[_0x280c('0x32')]['filter']+'%'};return _0x5c77c0;})});}_0x509e62=_['merge']({},_0x509e62,_0x596ce4[_0x280c('0x47')]);return _0x9b9e68[_0x280c('0x4b')](_0x509e62);}})[_0x280c('0x27')](function(_0xa60e3a){if(_0xa60e3a){_0x5436ab=_0xa60e3a['length'];if(!_0x596ce4[_0x280c('0x32')][_0x280c('0x3a')](_0x280c('0x3b'))){_0x509e62[_0x280c('0x21')]=qs[_0x280c('0x21')](_0x596ce4['query'][_0x280c('0x21')]);_0x509e62[_0x280c('0x1f')]=qs[_0x280c('0x1f')](_0x596ce4['query']['offset']);}return _0x9b9e68[_0x280c('0x4b')](_0x509e62);}})['then'](function(_0x2a2cc0){if(_0x2a2cc0){return _0x2a2cc0?{'count':_0x5436ab,'rows':_0x2a2cc0}:null;}})[_0x280c('0x27')](respondWithResult(_0x1cbd56,null))[_0x280c('0x43')](handleError(_0x1cbd56,null));};exports[_0x280c('0x4f')]=function(_0x330d80,_0x52e6d0,_0x49f84d){var _0x400cbb={};var _0x4890f2={};var _0x4a2013;var _0x260d9f;return db[_0x280c('0x2e')]['findOne']({'where':{'id':_0x330d80[_0x280c('0x45')]['id']}})[_0x280c('0x27')](handleEntityNotFound(_0x52e6d0,null))['then'](function(_0x46dfa5){if(_0x46dfa5){_0x4a2013=_0x46dfa5;_0x4890f2[_0x280c('0x36')]=_['keys'](db[_0x280c('0x4c')][_0x280c('0x4d')]);_0x4890f2[_0x280c('0x32')]=_[_0x280c('0x33')](_0x330d80[_0x280c('0x32')]);_0x4890f2[_0x280c('0x34')]=_[_0x280c('0x35')](_0x4890f2[_0x280c('0x36')],_0x4890f2[_0x280c('0x32')]);_0x400cbb['attributes']=_[_0x280c('0x35')](_0x4890f2[_0x280c('0x36')],qs[_0x280c('0x37')](_0x330d80[_0x280c('0x32')][_0x280c('0x37')]));_0x400cbb[_0x280c('0x38')]=_0x400cbb['attributes'][_0x280c('0x39')]?_0x400cbb[_0x280c('0x38')]:_0x4890f2[_0x280c('0x36')];_0x400cbb[_0x280c('0x4e')]=qs[_0x280c('0x3c')](_0x330d80[_0x280c('0x32')]['sort']);_0x400cbb['where']=qs[_0x280c('0x34')](_[_0x280c('0x3e')](_0x330d80[_0x280c('0x32')],_0x4890f2[_0x280c('0x34')]));if(_0x330d80[_0x280c('0x32')][_0x280c('0x3f')]){_0x400cbb['where']=_['merge'](_0x400cbb['where'],{'$or':_['map'](_0x400cbb[_0x280c('0x38')],function(_0x48c1f2){var _0x3ef783={};_0x3ef783[_0x48c1f2]={'$like':'%'+_0x330d80['query']['filter']+'%'};return _0x3ef783;})});}_0x400cbb=_[_0x280c('0x40')]({},_0x400cbb,_0x330d80['options']);return _0x4a2013[_0x280c('0x4f')](_0x400cbb);}})[_0x280c('0x27')](function(_0x51340a){if(_0x51340a){_0x260d9f=_0x51340a['length'];if(!_0x330d80[_0x280c('0x32')][_0x280c('0x3a')](_0x280c('0x3b'))){_0x400cbb['limit']=qs[_0x280c('0x21')](_0x330d80[_0x280c('0x32')]['limit']);_0x400cbb[_0x280c('0x1f')]=qs[_0x280c('0x1f')](_0x330d80[_0x280c('0x32')][_0x280c('0x1f')]);}return _0x4a2013[_0x280c('0x4f')](_0x400cbb);}})[_0x280c('0x27')](function(_0x5ac15e){if(_0x5ac15e){return _0x5ac15e?{'count':_0x260d9f,'rows':_0x5ac15e}:null;}})[_0x280c('0x27')](respondWithResult(_0x52e6d0,null))['catch'](handleError(_0x52e6d0,null));};exports['getDescriptions']=function(_0x557dcc,_0x5f27a4,_0x4afb36){var _0xc000a3={};var _0x23276b={};var _0x2a4eb6;var _0x4e926a;return db['Dynamics365Configuration'][_0x280c('0x50')]({'where':{'id':_0x557dcc[_0x280c('0x45')]['id']}})['then'](handleEntityNotFound(_0x5f27a4,null))[_0x280c('0x27')](function(_0xc434aa){if(_0xc434aa){_0x2a4eb6=_0xc434aa;_0x23276b[_0x280c('0x36')]=_['keys'](db[_0x280c('0x4c')][_0x280c('0x4d')]);_0x23276b[_0x280c('0x32')]=_['keys'](_0x557dcc[_0x280c('0x32')]);_0x23276b[_0x280c('0x34')]=_[_0x280c('0x35')](_0x23276b[_0x280c('0x36')],_0x23276b[_0x280c('0x32')]);_0xc000a3[_0x280c('0x38')]=_[_0x280c('0x35')](_0x23276b[_0x280c('0x36')],qs[_0x280c('0x37')](_0x557dcc['query']['fields']));_0xc000a3['attributes']=_0xc000a3[_0x280c('0x38')][_0x280c('0x39')]?_0xc000a3[_0x280c('0x38')]:_0x23276b[_0x280c('0x36')];_0xc000a3['order']=qs[_0x280c('0x3c')](_0x557dcc['query'][_0x280c('0x3c')]);_0xc000a3['where']=qs['filters'](_[_0x280c('0x3e')](_0x557dcc['query'],_0x23276b['filters']));if(_0x557dcc[_0x280c('0x32')][_0x280c('0x3f')]){_0xc000a3[_0x280c('0x3d')]=_[_0x280c('0x40')](_0xc000a3[_0x280c('0x3d')],{'$or':_[_0x280c('0x2d')](_0xc000a3['attributes'],function(_0xd6070a){var _0x5e3fd5={};_0x5e3fd5[_0xd6070a]={'$like':'%'+_0x557dcc['query'][_0x280c('0x3f')]+'%'};return _0x5e3fd5;})});}_0xc000a3=_[_0x280c('0x40')]({},_0xc000a3,_0x557dcc[_0x280c('0x47')]);return _0x2a4eb6['getDescriptions'](_0xc000a3);}})[_0x280c('0x27')](function(_0x393c05){if(_0x393c05){_0x4e926a=_0x393c05['length'];if(!_0x557dcc[_0x280c('0x32')][_0x280c('0x3a')](_0x280c('0x3b'))){_0xc000a3['limit']=qs[_0x280c('0x21')](_0x557dcc['query']['limit']);_0xc000a3[_0x280c('0x1f')]=qs[_0x280c('0x1f')](_0x557dcc['query'][_0x280c('0x1f')]);}return _0x2a4eb6[_0x280c('0x51')](_0xc000a3);}})[_0x280c('0x27')](function(_0x5161d6){if(_0x5161d6){return _0x5161d6?{'count':_0x4e926a,'rows':_0x5161d6}:null;}})['then'](respondWithResult(_0x5f27a4,null))[_0x280c('0x43')](handleError(_0x5f27a4,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 9586184..83a9cbc 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 _0xf109=['Dynamics365Configuration','int_dynamics365_configurations','lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define'];(function(_0x4473e3,_0x41d379){var _0x4e20dd=function(_0x4f6c42){while(--_0x4f6c42){_0x4473e3['push'](_0x4473e3['shift']());}};_0x4e20dd(++_0x41d379);}(_0xf109,0xce));var _0x9f10=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xf109[_0x199572];return _0x13cfa3;};'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':[],'timestamps':!![]});}; \ No newline at end of file +var _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intDynamics365Configuration.attributes','exports','Dynamics365Configuration','util'];(function(_0xf848e3,_0x76b216){var _0x2c8a51=function(_0x1a829c){while(--_0x1a829c){_0xf848e3['push'](_0xf848e3['shift']());}};_0x2c8a51(++_0x76b216);}(_0xedd9,0xfc));var _0x9edd=function(_0x559060,_0x38a41c){_0x559060=_0x559060-0x0;var _0x9b469e=_0xedd9[_0x559060];return _0x9b469e;};'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':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index 3f8ac57..baa8cfa 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 _0xfb01=['Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xfb01,0x102));var _0x1fb0=function(_0x3bab09,_0x217c29){_0x3bab09=_0x3bab09-0x0;var _0x164376=_0xfb01[_0x3bab09];return _0x164376;};'use strict';var _=require(_0x1fb0('0x0'));var util=require(_0x1fb0('0x1'));var moment=require(_0x1fb0('0x2'));var BPromise=require(_0x1fb0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1fb0('0x4'));var db=require(_0x1fb0('0x5'))['db'];var utils=require(_0x1fb0('0x6'));var logger=require(_0x1fb0('0x7'))('rpc');var config=require(_0x1fb0('0x8'));var jayson=require(_0x1fb0('0x9'));var client=jayson[_0x1fb0('0xa')][_0x1fb0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x27ff0f,_0x3205f6,_0x14f22d){return new BPromise(function(_0xf11d4b,_0x29346a){return client[_0x1fb0('0xc')](_0x27ff0f,_0x14f22d)[_0x1fb0('0xd')](function(_0x13cbf5){logger[_0x1fb0('0xe')](_0x1fb0('0xf'),_0x3205f6,_0x1fb0('0x10'));logger['debug'](_0x1fb0('0x11'),_0x3205f6,_0x1fb0('0x10'),JSON['stringify'](_0x13cbf5));if(_0x13cbf5['error']){if(_0x13cbf5[_0x1fb0('0x12')]['code']===0x1f4){logger[_0x1fb0('0x12')](_0x1fb0('0xf'),_0x3205f6,_0x13cbf5[_0x1fb0('0x12')][_0x1fb0('0x13')]);return _0x29346a(_0x13cbf5[_0x1fb0('0x12')][_0x1fb0('0x13')]);}logger[_0x1fb0('0x12')](_0x1fb0('0xf'),_0x3205f6,_0x13cbf5[_0x1fb0('0x12')]['message']);return _0xf11d4b(_0x13cbf5['error'][_0x1fb0('0x13')]);}else{logger[_0x1fb0('0xe')]('Dynamics365Configuration,\x20%s,\x20%s',_0x3205f6,'request\x20sent');_0xf11d4b(_0x13cbf5['result']['message']);}})[_0x1fb0('0x14')](function(_0x47e0ae){logger[_0x1fb0('0x12')]('Dynamics365Configuration,\x20%s,\x20%s',_0x3205f6,_0x47e0ae);_0x29346a(_0x47e0ae);});});} \ No newline at end of file +var _0x4db2=['debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4db2,0x189));var _0x24db=function(_0x235d85,_0x2db080){_0x235d85=_0x235d85-0x0;var _0x559ead=_0x4db2[_0x235d85];return _0x559ead;};'use strict';var _=require(_0x24db('0x0'));var util=require(_0x24db('0x1'));var moment=require('moment');var BPromise=require(_0x24db('0x2'));var rs=require(_0x24db('0x3'));var fs=require('fs');var Redis=require(_0x24db('0x4'));var db=require(_0x24db('0x5'))['db'];var utils=require(_0x24db('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x24db('0x7'));var jayson=require(_0x24db('0x8'));var client=jayson[_0x24db('0x9')][_0x24db('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2359d5,_0x3a7241,_0x496df9){return new BPromise(function(_0x47b91b,_0x59b362){return client[_0x24db('0xb')](_0x2359d5,_0x496df9)[_0x24db('0xc')](function(_0x1990ef){logger[_0x24db('0xd')](_0x24db('0xe'),_0x3a7241,'request\x20sent');logger[_0x24db('0xf')](_0x24db('0x10'),_0x3a7241,_0x24db('0x11'),JSON[_0x24db('0x12')](_0x1990ef));if(_0x1990ef['error']){if(_0x1990ef['error'][_0x24db('0x13')]===0x1f4){logger[_0x24db('0x14')](_0x24db('0xe'),_0x3a7241,_0x1990ef[_0x24db('0x14')][_0x24db('0x15')]);return _0x59b362(_0x1990ef['error'][_0x24db('0x15')]);}logger[_0x24db('0x14')]('Dynamics365Configuration,\x20%s,\x20%s',_0x3a7241,_0x1990ef['error'][_0x24db('0x15')]);return _0x47b91b(_0x1990ef['error'][_0x24db('0x15')]);}else{logger[_0x24db('0xd')](_0x24db('0xe'),_0x3a7241,'request\x20sent');_0x47b91b(_0x1990ef[_0x24db('0x16')]['message']);}})[_0x24db('0x17')](function(_0x27c793){logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x3a7241,_0x27c793);_0x59b362(_0x27c793);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 7b7dc49..263c578 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 _0x32b5=['connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','post','create','put','update','delete','/:id','exports','multer','path'];(function(_0xefeb78,_0xc8bdcf){var _0x418124=function(_0x2a7767){while(--_0x2a7767){_0xefeb78['push'](_0xefeb78['shift']());}};_0x418124(++_0xc8bdcf);}(_0x32b5,0x1ee));var _0x532b=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x32b5[_0x110c3d];return _0x226d67;};'use strict';var multer=require(_0x532b('0x0'));var util=require('util');var path=require(_0x532b('0x1'));var timeout=require(_0x532b('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x532b('0x3'));var auth=require(_0x532b('0x4'));var interaction=require(_0x532b('0x5'));var config=require(_0x532b('0x6'));var controller=require('./intDynamics365Field.controller');router['get']('/',auth[_0x532b('0x7')](),controller['index']);router[_0x532b('0x8')]('/:id',auth[_0x532b('0x7')](),controller['show']);router[_0x532b('0x9')]('/',auth[_0x532b('0x7')](),controller[_0x532b('0xa')]);router[_0x532b('0xb')]('/:id',auth[_0x532b('0x7')](),controller[_0x532b('0xc')]);router[_0x532b('0xd')](_0x532b('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x532b('0xf')]=router; \ No newline at end of file +var _0xfce8=['/:id','show','post','create','put','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get'];(function(_0x3e3e86,_0x12dc19){var _0x4bfbd6=function(_0x38a92f){while(--_0x38a92f){_0x3e3e86['push'](_0x3e3e86['shift']());}};_0x4bfbd6(++_0x12dc19);}(_0xfce8,0x15c));var _0x8fce=function(_0x52f8fd,_0x489690){_0x52f8fd=_0x52f8fd-0x0;var _0x2c26e3=_0xfce8[_0x52f8fd];return _0x2c26e3;};'use strict';var multer=require(_0x8fce('0x0'));var util=require('util');var path=require(_0x8fce('0x1'));var timeout=require(_0x8fce('0x2'));var express=require(_0x8fce('0x3'));var router=express[_0x8fce('0x4')]();var fs_extra=require(_0x8fce('0x5'));var auth=require(_0x8fce('0x6'));var interaction=require(_0x8fce('0x7'));var config=require(_0x8fce('0x8'));var controller=require('./intDynamics365Field.controller');router['get']('/',auth[_0x8fce('0x9')](),controller[_0x8fce('0xa')]);router[_0x8fce('0xb')](_0x8fce('0xc'),auth[_0x8fce('0x9')](),controller[_0x8fce('0xd')]);router[_0x8fce('0xe')]('/',auth[_0x8fce('0x9')](),controller[_0x8fce('0xf')]);router[_0x8fce('0x10')](_0x8fce('0xc'),auth[_0x8fce('0x9')](),controller['update']);router['delete'](_0x8fce('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x8fce('0x11')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index ee2271f..589015e 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 _0x0f88=['STRING','customVariable','BOOLEAN','sequelize','exports','string','variable','picklist'];(function(_0xbc936,_0x32490a){var _0xf2a76=function(_0x46b9fa){while(--_0x46b9fa){_0xbc936['push'](_0xbc936['shift']());}};_0xf2a76(++_0x32490a);}(_0x0f88,0x8b));var _0x80f8=function(_0x319cb9,_0x4b8d35){_0x319cb9=_0x319cb9-0x0;var _0x1735fc=_0x0f88[_0x319cb9];return _0x1735fc;};'use strict';var Sequelize=require(_0x80f8('0x0'));module[_0x80f8('0x1')]={'type':{'type':Sequelize['ENUM'](_0x80f8('0x2'),_0x80f8('0x3'),'customVariable','keyValue',_0x80f8('0x4')),'defaultValue':_0x80f8('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x80f8('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x80f8('0x2'),_0x80f8('0x3'),_0x80f8('0x6'))},'keyContent':{'type':Sequelize[_0x80f8('0x5')]},'idField':{'type':Sequelize[_0x80f8('0x5')]},'nameField':{'type':Sequelize[_0x80f8('0x5')]},'customField':{'type':Sequelize[_0x80f8('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x80f8('0x5')]}}; \ No newline at end of file +var _0x030b=['sequelize','string','picklist','STRING','ENUM','variable','customVariable','BOOLEAN'];(function(_0x4b4f36,_0x4fc345){var _0x24189f=function(_0x3360f6){while(--_0x3360f6){_0x4b4f36['push'](_0x4b4f36['shift']());}};_0x24189f(++_0x4fc345);}(_0x030b,0x150));var _0xb030=function(_0x1020ae,_0x2f42bc){_0x1020ae=_0x1020ae-0x0;var _0x14f168=_0x030b[_0x1020ae];return _0x14f168;};'use strict';var Sequelize=require(_0xb030('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0xb030('0x1'),'variable','customVariable','keyValue',_0xb030('0x2')),'defaultValue':_0xb030('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xb030('0x3')]},'keyType':{'type':Sequelize[_0xb030('0x4')](_0xb030('0x1'),_0xb030('0x5'),_0xb030('0x6'))},'keyContent':{'type':Sequelize[_0xb030('0x3')]},'idField':{'type':Sequelize[_0xb030('0x3')]},'nameField':{'type':Sequelize[_0xb030('0x3')]},'customField':{'type':Sequelize[_0xb030('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb030('0x3')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 46a8160..920f3c4 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 _0x5921=['fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','limit','undefined','count','status','set','Content-Range','reject','save','update','then','destroy','stack','name','send','map','Dynamics365Field','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','pick','filter','where','merge','VIRTUAL','findAll','rows','catch','show','length','includeAll','include','options','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x480788,_0x4f1ddb){var _0x7271f7=function(_0x424ec4){while(--_0x424ec4){_0x480788['push'](_0x480788['shift']());}};_0x7271f7(++_0x4f1ddb);}(_0x5921,0x170));var _0x1592=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x5921[_0x422905];return _0x33dc6c;};'use strict';var emlformat=require(_0x1592('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1592('0x1'));var jsonpatch=require(_0x1592('0x2'));var rp=require(_0x1592('0x3'));var moment=require(_0x1592('0x4'));var BPromise=require(_0x1592('0x5'));var Mustache=require(_0x1592('0x6'));var util=require(_0x1592('0x7'));var path=require(_0x1592('0x8'));var sox=require(_0x1592('0x9'));var csv=require(_0x1592('0xa'));var ejs=require(_0x1592('0xb'));var fs=require('fs');var fs_extra=require(_0x1592('0xc'));var _=require(_0x1592('0xd'));var squel=require(_0x1592('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1592('0xf'));var toCsv=require(_0x1592('0xa'));var querystring=require(_0x1592('0x10'));var Papa=require(_0x1592('0x11'));var Redis=require(_0x1592('0x12'));var authService=require(_0x1592('0x13'));var qs=require(_0x1592('0x14'));var as=require(_0x1592('0x15'));var hardwareService=require(_0x1592('0x16'));var logger=require(_0x1592('0x17'))(_0x1592('0x18'));var utils=require('../../config/utils');var config=require(_0x1592('0x19'));var licenseUtil=require(_0x1592('0x1a'));var db=require(_0x1592('0x1b'))['db'];function respondWithStatusCode(_0x1b2d4e,_0x4d85f3){_0x4d85f3=_0x4d85f3||0xcc;return function(_0x23cec4){if(_0x23cec4){return _0x1b2d4e[_0x1592('0x1c')](_0x4d85f3);}return _0x1b2d4e['status'](_0x4d85f3)[_0x1592('0x1d')]();};}function respondWithResult(_0x40407c,_0x4b19da){_0x4b19da=_0x4b19da||0xc8;return function(_0x2658af){if(_0x2658af){return _0x40407c['status'](_0x4b19da)[_0x1592('0x1e')](_0x2658af);}};}function respondWithFilteredResult(_0x1beb8b,_0x1a634b){return function(_0x551c1a){if(_0x551c1a){var _0x4cff8e=typeof _0x1a634b[_0x1592('0x1f')]==='undefined'&&typeof _0x1a634b[_0x1592('0x20')]===_0x1592('0x21');var _0x4ea52d=_0x551c1a[_0x1592('0x22')];var _0x57ba22=_0x4cff8e?0x0:_0x1a634b[_0x1592('0x1f')];var _0x5de5a4=_0x4cff8e?_0x551c1a[_0x1592('0x22')]:_0x1a634b[_0x1592('0x1f')]+_0x1a634b['limit'];var _0x363060;if(_0x5de5a4>=_0x4ea52d){_0x5de5a4=_0x4ea52d;_0x363060=0xc8;}else{_0x363060=0xce;}_0x1beb8b[_0x1592('0x23')](_0x363060);return _0x1beb8b[_0x1592('0x24')](_0x1592('0x25'),_0x57ba22+'-'+_0x5de5a4+'/'+_0x4ea52d)['json'](_0x551c1a);}return null;};}function patchUpdates(_0x2e2121){return function(_0x47e0b1){try{jsonpatch['apply'](_0x47e0b1,_0x2e2121,!![]);}catch(_0x3cbcdf){return BPromise[_0x1592('0x26')](_0x3cbcdf);}return _0x47e0b1[_0x1592('0x27')]();};}function saveUpdates(_0x2b5739,_0x5acd19){return function(_0x295ca2){if(_0x295ca2){return _0x295ca2[_0x1592('0x28')](_0x2b5739)[_0x1592('0x29')](function(_0x7c9343){return _0x7c9343;});}return null;};}function removeEntity(_0x3a4f5c,_0x39c886){return function(_0x25f13f){if(_0x25f13f){return _0x25f13f[_0x1592('0x2a')]()[_0x1592('0x29')](function(){_0x3a4f5c[_0x1592('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1cbc44,_0x346ae9){return function(_0xb44bcf){if(!_0xb44bcf){_0x1cbc44[_0x1592('0x1c')](0x194);}return _0xb44bcf;};}function handleError(_0x8c33f,_0x4f78e0){_0x4f78e0=_0x4f78e0||0x1f4;return function(_0x3cb65f){logger['error'](_0x3cb65f[_0x1592('0x2b')]);if(_0x3cb65f[_0x1592('0x2c')]){delete _0x3cb65f[_0x1592('0x2c')];}_0x8c33f[_0x1592('0x23')](_0x4f78e0)[_0x1592('0x2d')](_0x3cb65f);};}exports['index']=function(_0x50c8ca,_0x4e7ff3){var _0x384f5f={},_0xfda0dc={},_0x3a34c7={'count':0x0,'rows':[]};var _0x44f3fc=_[_0x1592('0x2e')](db[_0x1592('0x2f')][_0x1592('0x30')],function(_0x5e73b3){return{'name':_0x5e73b3[_0x1592('0x31')],'type':_0x5e73b3['type'][_0x1592('0x32')]};});_0xfda0dc[_0x1592('0x33')]=_[_0x1592('0x2e')](_0x44f3fc,_0x1592('0x2c'));_0xfda0dc[_0x1592('0x34')]=_[_0x1592('0x35')](_0x50c8ca[_0x1592('0x34')]);_0xfda0dc[_0x1592('0x36')]=_[_0x1592('0x37')](_0xfda0dc[_0x1592('0x33')],_0xfda0dc[_0x1592('0x34')]);_0x384f5f[_0x1592('0x38')]=_[_0x1592('0x37')](_0xfda0dc[_0x1592('0x33')],qs['fields'](_0x50c8ca[_0x1592('0x34')][_0x1592('0x39')]));_0x384f5f['attributes']=_0x384f5f['attributes']['length']?_0x384f5f[_0x1592('0x38')]:_0xfda0dc[_0x1592('0x33')];if(!_0x50c8ca[_0x1592('0x34')]['hasOwnProperty'](_0x1592('0x3a'))){_0x384f5f[_0x1592('0x20')]=qs[_0x1592('0x20')](_0x50c8ca[_0x1592('0x34')][_0x1592('0x20')]);_0x384f5f[_0x1592('0x1f')]=qs['offset'](_0x50c8ca['query'][_0x1592('0x1f')]);}_0x384f5f[_0x1592('0x3b')]=qs['sort'](_0x50c8ca[_0x1592('0x34')]['sort']);_0x384f5f['where']=qs['filters'](_[_0x1592('0x3c')](_0x50c8ca[_0x1592('0x34')],_0xfda0dc[_0x1592('0x36')]),_0x44f3fc);if(_0x50c8ca[_0x1592('0x34')][_0x1592('0x3d')]){_0x384f5f[_0x1592('0x3e')]=_[_0x1592('0x3f')](_0x384f5f[_0x1592('0x3e')],{'$or':_['map'](_0x44f3fc,function(_0x356e44){if(_0x356e44['type']!==_0x1592('0x40')){var _0x56d9bf={};_0x56d9bf[_0x356e44['name']]={'$like':'%'+_0x50c8ca[_0x1592('0x34')]['filter']+'%'};return _0x56d9bf;}})});}_0x384f5f=_[_0x1592('0x3f')]({},_0x384f5f,_0x50c8ca['options']);var _0x5a25e2={'where':_0x384f5f[_0x1592('0x3e')]};return db[_0x1592('0x2f')][_0x1592('0x22')](_0x5a25e2)['then'](function(_0x1e1585){_0x3a34c7[_0x1592('0x22')]=_0x1e1585;if(_0x50c8ca[_0x1592('0x34')]['includeAll']){_0x384f5f['include']=[{'all':!![]}];}return db[_0x1592('0x2f')][_0x1592('0x41')](_0x384f5f);})['then'](function(_0x313839){_0x3a34c7[_0x1592('0x42')]=_0x313839;return _0x3a34c7;})[_0x1592('0x29')](respondWithFilteredResult(_0x4e7ff3,_0x384f5f))[_0x1592('0x43')](handleError(_0x4e7ff3,null));};exports[_0x1592('0x44')]=function(_0x4a63b4,_0x342c5f){var _0x4b9680={'raw':!![],'where':{'id':_0x4a63b4['params']['id']}},_0x594aa3={};_0x594aa3[_0x1592('0x33')]=_[_0x1592('0x35')](db[_0x1592('0x2f')]['rawAttributes']);_0x594aa3['query']=_[_0x1592('0x35')](_0x4a63b4[_0x1592('0x34')]);_0x594aa3[_0x1592('0x36')]=_[_0x1592('0x37')](_0x594aa3[_0x1592('0x33')],_0x594aa3[_0x1592('0x34')]);_0x4b9680[_0x1592('0x38')]=_[_0x1592('0x37')](_0x594aa3['model'],qs[_0x1592('0x39')](_0x4a63b4['query'][_0x1592('0x39')]));_0x4b9680[_0x1592('0x38')]=_0x4b9680[_0x1592('0x38')][_0x1592('0x45')]?_0x4b9680[_0x1592('0x38')]:_0x594aa3[_0x1592('0x33')];if(_0x4a63b4[_0x1592('0x34')][_0x1592('0x46')]){_0x4b9680[_0x1592('0x47')]=[{'all':!![]}];}_0x4b9680=_['merge']({},_0x4b9680,_0x4a63b4[_0x1592('0x48')]);return db['Dynamics365Field'][_0x1592('0x49')](_0x4b9680)[_0x1592('0x29')](handleEntityNotFound(_0x342c5f,null))['then'](respondWithResult(_0x342c5f,null))[_0x1592('0x43')](handleError(_0x342c5f,null));};exports['create']=function(_0x4ebc40,_0x102e74){return db[_0x1592('0x2f')][_0x1592('0x4a')](_0x4ebc40[_0x1592('0x4b')],{})[_0x1592('0x29')](respondWithResult(_0x102e74,0xc9))['catch'](handleError(_0x102e74,null));};exports[_0x1592('0x28')]=function(_0x595723,_0x65ed33){if(_0x595723[_0x1592('0x4b')]['id']){delete _0x595723[_0x1592('0x4b')]['id'];}return db[_0x1592('0x2f')][_0x1592('0x49')]({'where':{'id':_0x595723['params']['id']}})[_0x1592('0x29')](handleEntityNotFound(_0x65ed33,null))[_0x1592('0x29')](saveUpdates(_0x595723[_0x1592('0x4b')],null))[_0x1592('0x29')](respondWithResult(_0x65ed33,null))['catch'](handleError(_0x65ed33,null));};exports[_0x1592('0x2a')]=function(_0x53eff8,_0xc2a8e3){return db[_0x1592('0x2f')]['find']({'where':{'id':_0x53eff8['params']['id']}})[_0x1592('0x29')](handleEntityNotFound(_0xc2a8e3,null))[_0x1592('0x29')](removeEntity(_0xc2a8e3,null))['catch'](handleError(_0xc2a8e3,null));}; \ No newline at end of file +var _0xd8f1=['end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','Dynamics365Field','rawAttributes','fieldName','key','model','keys','filters','intersection','attributes','fields','query','length','hasOwnProperty','sort','where','pick','merge','map','type','VIRTUAL','filter','options','includeAll','include','rows','show','params','find','catch','body','eml-format','zip-dir','fast-json-patch','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','status'];(function(_0xc2912a,_0xb75d4f){var _0x286c0a=function(_0x4dfb99){while(--_0x4dfb99){_0xc2912a['push'](_0xc2912a['shift']());}};_0x286c0a(++_0xb75d4f);}(_0xd8f1,0x189));var _0x1d8f=function(_0x4c06cf,_0x2fb629){_0x4c06cf=_0x4c06cf-0x0;var _0x532fc3=_0xd8f1[_0x4c06cf];return _0x532fc3;};'use strict';var emlformat=require(_0x1d8f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1d8f('0x1'));var jsonpatch=require(_0x1d8f('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1d8f('0x3'));var Mustache=require('mustache');var util=require(_0x1d8f('0x4'));var path=require(_0x1d8f('0x5'));var sox=require('sox');var csv=require(_0x1d8f('0x6'));var ejs=require(_0x1d8f('0x7'));var fs=require('fs');var fs_extra=require(_0x1d8f('0x8'));var _=require(_0x1d8f('0x9'));var squel=require(_0x1d8f('0xa'));var crypto=require(_0x1d8f('0xb'));var jsforce=require(_0x1d8f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x1d8f('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1d8f('0xd'));var authService=require(_0x1d8f('0xe'));var qs=require(_0x1d8f('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1d8f('0x10'));var logger=require(_0x1d8f('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x1d8f('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x1d8f('0x13'))['db'];function respondWithStatusCode(_0x626d83,_0x1c96c4){_0x1c96c4=_0x1c96c4||0xcc;return function(_0x364d0d){if(_0x364d0d){return _0x626d83['sendStatus'](_0x1c96c4);}return _0x626d83[_0x1d8f('0x14')](_0x1c96c4)[_0x1d8f('0x15')]();};}function respondWithResult(_0x11a165,_0x1a987a){_0x1a987a=_0x1a987a||0xc8;return function(_0xab0f43){if(_0xab0f43){return _0x11a165['status'](_0x1a987a)[_0x1d8f('0x16')](_0xab0f43);}};}function respondWithFilteredResult(_0x943379,_0x219d14){return function(_0x2e2ed8){if(_0x2e2ed8){var _0x526772=typeof _0x219d14[_0x1d8f('0x17')]===_0x1d8f('0x18')&&typeof _0x219d14[_0x1d8f('0x19')]===_0x1d8f('0x18');var _0x42247d=_0x2e2ed8['count'];var _0x40c5a2=_0x526772?0x0:_0x219d14[_0x1d8f('0x17')];var _0x2039de=_0x526772?_0x2e2ed8[_0x1d8f('0x1a')]:_0x219d14[_0x1d8f('0x17')]+_0x219d14[_0x1d8f('0x19')];var _0x1ef1a4;if(_0x2039de>=_0x42247d){_0x2039de=_0x42247d;_0x1ef1a4=0xc8;}else{_0x1ef1a4=0xce;}_0x943379[_0x1d8f('0x14')](_0x1ef1a4);return _0x943379[_0x1d8f('0x1b')](_0x1d8f('0x1c'),_0x40c5a2+'-'+_0x2039de+'/'+_0x42247d)[_0x1d8f('0x16')](_0x2e2ed8);}return null;};}function patchUpdates(_0x169c6e){return function(_0x596579){try{jsonpatch[_0x1d8f('0x1d')](_0x596579,_0x169c6e,!![]);}catch(_0x1d9932){return BPromise['reject'](_0x1d9932);}return _0x596579[_0x1d8f('0x1e')]();};}function saveUpdates(_0x1202fb,_0x185c20){return function(_0x387430){if(_0x387430){return _0x387430[_0x1d8f('0x1f')](_0x1202fb)[_0x1d8f('0x20')](function(_0x25bf50){return _0x25bf50;});}return null;};}function removeEntity(_0x72e319,_0x16efa5){return function(_0x1a0f2d){if(_0x1a0f2d){return _0x1a0f2d[_0x1d8f('0x21')]()[_0x1d8f('0x20')](function(){_0x72e319[_0x1d8f('0x14')](0xcc)[_0x1d8f('0x15')]();});}};}function handleEntityNotFound(_0xbca6fb,_0x1fc13b){return function(_0x22dabc){if(!_0x22dabc){_0xbca6fb[_0x1d8f('0x22')](0x194);}return _0x22dabc;};}function handleError(_0x22f5ad,_0x4e0d52){_0x4e0d52=_0x4e0d52||0x1f4;return function(_0x503e4b){logger[_0x1d8f('0x23')](_0x503e4b[_0x1d8f('0x24')]);if(_0x503e4b[_0x1d8f('0x25')]){delete _0x503e4b[_0x1d8f('0x25')];}_0x22f5ad['status'](_0x4e0d52)[_0x1d8f('0x26')](_0x503e4b);};}exports['index']=function(_0x433cfa,_0xdf9ce7){var _0x345018={},_0x75221f={},_0x1f7aa6={'count':0x0,'rows':[]};var _0x2dc392=_['map'](db[_0x1d8f('0x27')][_0x1d8f('0x28')],function(_0x356932){return{'name':_0x356932[_0x1d8f('0x29')],'type':_0x356932['type'][_0x1d8f('0x2a')]};});_0x75221f[_0x1d8f('0x2b')]=_['map'](_0x2dc392,_0x1d8f('0x25'));_0x75221f['query']=_[_0x1d8f('0x2c')](_0x433cfa['query']);_0x75221f[_0x1d8f('0x2d')]=_[_0x1d8f('0x2e')](_0x75221f[_0x1d8f('0x2b')],_0x75221f['query']);_0x345018[_0x1d8f('0x2f')]=_[_0x1d8f('0x2e')](_0x75221f[_0x1d8f('0x2b')],qs[_0x1d8f('0x30')](_0x433cfa[_0x1d8f('0x31')]['fields']));_0x345018[_0x1d8f('0x2f')]=_0x345018['attributes'][_0x1d8f('0x32')]?_0x345018[_0x1d8f('0x2f')]:_0x75221f[_0x1d8f('0x2b')];if(!_0x433cfa[_0x1d8f('0x31')][_0x1d8f('0x33')]('nolimit')){_0x345018[_0x1d8f('0x19')]=qs[_0x1d8f('0x19')](_0x433cfa[_0x1d8f('0x31')][_0x1d8f('0x19')]);_0x345018[_0x1d8f('0x17')]=qs[_0x1d8f('0x17')](_0x433cfa[_0x1d8f('0x31')][_0x1d8f('0x17')]);}_0x345018['order']=qs[_0x1d8f('0x34')](_0x433cfa[_0x1d8f('0x31')][_0x1d8f('0x34')]);_0x345018[_0x1d8f('0x35')]=qs[_0x1d8f('0x2d')](_[_0x1d8f('0x36')](_0x433cfa['query'],_0x75221f['filters']),_0x2dc392);if(_0x433cfa[_0x1d8f('0x31')]['filter']){_0x345018[_0x1d8f('0x35')]=_[_0x1d8f('0x37')](_0x345018['where'],{'$or':_[_0x1d8f('0x38')](_0x2dc392,function(_0x51146f){if(_0x51146f[_0x1d8f('0x39')]!==_0x1d8f('0x3a')){var _0x5ca626={};_0x5ca626[_0x51146f[_0x1d8f('0x25')]]={'$like':'%'+_0x433cfa[_0x1d8f('0x31')][_0x1d8f('0x3b')]+'%'};return _0x5ca626;}})});}_0x345018=_[_0x1d8f('0x37')]({},_0x345018,_0x433cfa[_0x1d8f('0x3c')]);var _0x1b339f={'where':_0x345018[_0x1d8f('0x35')]};return db[_0x1d8f('0x27')][_0x1d8f('0x1a')](_0x1b339f)['then'](function(_0x2a1b56){_0x1f7aa6['count']=_0x2a1b56;if(_0x433cfa[_0x1d8f('0x31')][_0x1d8f('0x3d')]){_0x345018[_0x1d8f('0x3e')]=[{'all':!![]}];}return db[_0x1d8f('0x27')]['findAll'](_0x345018);})[_0x1d8f('0x20')](function(_0x1ccff3){_0x1f7aa6[_0x1d8f('0x3f')]=_0x1ccff3;return _0x1f7aa6;})[_0x1d8f('0x20')](respondWithFilteredResult(_0xdf9ce7,_0x345018))['catch'](handleError(_0xdf9ce7,null));};exports[_0x1d8f('0x40')]=function(_0x2026c0,_0x5d339f){var _0x9760a9={'raw':!![],'where':{'id':_0x2026c0[_0x1d8f('0x41')]['id']}},_0x2d5d3a={};_0x2d5d3a['model']=_['keys'](db['Dynamics365Field'][_0x1d8f('0x28')]);_0x2d5d3a[_0x1d8f('0x31')]=_[_0x1d8f('0x2c')](_0x2026c0[_0x1d8f('0x31')]);_0x2d5d3a[_0x1d8f('0x2d')]=_[_0x1d8f('0x2e')](_0x2d5d3a[_0x1d8f('0x2b')],_0x2d5d3a[_0x1d8f('0x31')]);_0x9760a9[_0x1d8f('0x2f')]=_[_0x1d8f('0x2e')](_0x2d5d3a[_0x1d8f('0x2b')],qs[_0x1d8f('0x30')](_0x2026c0[_0x1d8f('0x31')]['fields']));_0x9760a9[_0x1d8f('0x2f')]=_0x9760a9[_0x1d8f('0x2f')][_0x1d8f('0x32')]?_0x9760a9[_0x1d8f('0x2f')]:_0x2d5d3a[_0x1d8f('0x2b')];if(_0x2026c0[_0x1d8f('0x31')]['includeAll']){_0x9760a9['include']=[{'all':!![]}];}_0x9760a9=_['merge']({},_0x9760a9,_0x2026c0[_0x1d8f('0x3c')]);return db[_0x1d8f('0x27')][_0x1d8f('0x42')](_0x9760a9)['then'](handleEntityNotFound(_0x5d339f,null))[_0x1d8f('0x20')](respondWithResult(_0x5d339f,null))[_0x1d8f('0x43')](handleError(_0x5d339f,null));};exports['create']=function(_0x15b86e,_0x15ee88){return db[_0x1d8f('0x27')]['create'](_0x15b86e[_0x1d8f('0x44')],{})[_0x1d8f('0x20')](respondWithResult(_0x15ee88,0xc9))['catch'](handleError(_0x15ee88,null));};exports[_0x1d8f('0x1f')]=function(_0xf639dd,_0x113239){if(_0xf639dd[_0x1d8f('0x44')]['id']){delete _0xf639dd[_0x1d8f('0x44')]['id'];}return db['Dynamics365Field'][_0x1d8f('0x42')]({'where':{'id':_0xf639dd[_0x1d8f('0x41')]['id']}})[_0x1d8f('0x20')](handleEntityNotFound(_0x113239,null))['then'](saveUpdates(_0xf639dd['body'],null))['then'](respondWithResult(_0x113239,null))[_0x1d8f('0x43')](handleError(_0x113239,null));};exports['destroy']=function(_0x5a2be2,_0x194e5c){return db[_0x1d8f('0x27')][_0x1d8f('0x42')]({'where':{'id':_0x5a2be2['params']['id']}})[_0x1d8f('0x20')](handleEntityNotFound(_0x194e5c,null))['then'](removeEntity(_0x194e5c,null))[_0x1d8f('0x43')](handleError(_0x194e5c,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index a2a8aee..654caa9 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 _0x75c5=['idField','FieldId','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index'];(function(_0x8fe0a4,_0x47d44a){var _0x456068=function(_0x51e0bb){while(--_0x51e0bb){_0x8fe0a4['push'](_0x8fe0a4['shift']());}};_0x456068(++_0x47d44a);}(_0x75c5,0x122));var _0x575c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x75c5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x575c('0x0'));var util=require(_0x575c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x575c('0x2'));var rp=require(_0x575c('0x3'));var fs=require('fs');var path=require(_0x575c('0x4'));var rimraf=require(_0x575c('0x5'));var config=require(_0x575c('0x6'));var attributes=require('./intDynamics365Field.attributes');module['exports']=function(_0x279a47,_0x1d4028){return _0x279a47['define'](_0x575c('0x7'),attributes,{'tableName':_0x575c('0x8'),'paranoid':![],'indexes':[{'name':_0x575c('0x9'),'fields':[_0x575c('0xa'),_0x575c('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4bc9=['./intDynamics365Field.attributes','define','Dynamics365Field','dynamics365_unique_index','FieldId','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x56b5bb,_0x230531){var _0x5f02b3=function(_0x516d0f){while(--_0x516d0f){_0x56b5bb['push'](_0x56b5bb['shift']());}};_0x5f02b3(++_0x230531);}(_0x4bc9,0xc8));var _0x94bc=function(_0xe338de,_0x51c92d){_0xe338de=_0xe338de-0x0;var _0x55f97e=_0x4bc9[_0xe338de];return _0x55f97e;};'use strict';var _=require(_0x94bc('0x0'));var util=require(_0x94bc('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x94bc('0x2'));var BPromise=require(_0x94bc('0x3'));var rp=require(_0x94bc('0x4'));var fs=require('fs');var path=require(_0x94bc('0x5'));var rimraf=require(_0x94bc('0x6'));var config=require(_0x94bc('0x7'));var attributes=require(_0x94bc('0x8'));module['exports']=function(_0x4c56a1,_0x6428c4){return _0x4c56a1[_0x94bc('0x9')](_0x94bc('0xa'),attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':_0x94bc('0xb'),'fields':['idField',_0x94bc('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.rpc.js b/server/api/intDynamics365Field/intDynamics365Field.rpc.js index ab62f38..d9ed722 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 _0xce53=['message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x559da0,_0x371559){var _0x284239=function(_0xee9b8c){while(--_0xee9b8c){_0x559da0['push'](_0x559da0['shift']());}};_0x284239(++_0x371559);}(_0xce53,0x1d1));var _0x3ce5=function(_0x562e5f,_0x5ca433){_0x562e5f=_0x562e5f-0x0;var _0x59cd67=_0xce53[_0x562e5f];return _0x59cd67;};'use strict';var _=require(_0x3ce5('0x0'));var util=require(_0x3ce5('0x1'));var moment=require(_0x3ce5('0x2'));var BPromise=require(_0x3ce5('0x3'));var rs=require(_0x3ce5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3ce5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3ce5('0x6'))(_0x3ce5('0x7'));var config=require(_0x3ce5('0x8'));var jayson=require(_0x3ce5('0x9'));var client=jayson[_0x3ce5('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a46dc,_0x117cbe,_0x2041fe){return new BPromise(function(_0x73c9d,_0x4e6a86){return client['request'](_0x3a46dc,_0x2041fe)['then'](function(_0x3b31b3){logger[_0x3ce5('0xb')](_0x3ce5('0xc'),_0x117cbe,_0x3ce5('0xd'));logger[_0x3ce5('0xe')](_0x3ce5('0xf'),_0x117cbe,_0x3ce5('0xd'),JSON[_0x3ce5('0x10')](_0x3b31b3));if(_0x3b31b3[_0x3ce5('0x11')]){if(_0x3b31b3[_0x3ce5('0x11')]['code']===0x1f4){logger['error'](_0x3ce5('0xc'),_0x117cbe,_0x3b31b3[_0x3ce5('0x11')]['message']);return _0x4e6a86(_0x3b31b3[_0x3ce5('0x11')]['message']);}logger[_0x3ce5('0x11')](_0x3ce5('0xc'),_0x117cbe,_0x3b31b3[_0x3ce5('0x11')][_0x3ce5('0x12')]);return _0x73c9d(_0x3b31b3['error'][_0x3ce5('0x12')]);}else{logger[_0x3ce5('0xb')](_0x3ce5('0xc'),_0x117cbe,_0x3ce5('0xd'));_0x73c9d(_0x3b31b3[_0x3ce5('0x13')][_0x3ce5('0x12')]);}})[_0x3ce5('0x14')](function(_0x180fea){logger['error'](_0x3ce5('0xc'),_0x117cbe,_0x180fea);_0x4e6a86(_0x180fea);});});} \ No newline at end of file +var _0x1252=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x32349f,_0x30fd65){var _0x2209ae=function(_0x228a31){while(--_0x228a31){_0x32349f['push'](_0x32349f['shift']());}};_0x2209ae(++_0x30fd65);}(_0x1252,0xcf));var _0x2125=function(_0xacd474,_0x121823){_0xacd474=_0xacd474-0x0;var _0x5bed09=_0x1252[_0xacd474];return _0x5bed09;};'use strict';var _=require(_0x2125('0x0'));var util=require(_0x2125('0x1'));var moment=require('moment');var BPromise=require(_0x2125('0x2'));var rs=require(_0x2125('0x3'));var fs=require('fs');var Redis=require(_0x2125('0x4'));var db=require(_0x2125('0x5'))['db'];var utils=require(_0x2125('0x6'));var logger=require('../../config/logger')(_0x2125('0x7'));var config=require('../../config/environment');var jayson=require(_0x2125('0x8'));var client=jayson[_0x2125('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x31ec67,_0x4de819,_0x56f3df){return new BPromise(function(_0x40bffb,_0x20a7bf){return client[_0x2125('0xa')](_0x31ec67,_0x56f3df)[_0x2125('0xb')](function(_0xad9441){logger[_0x2125('0xc')](_0x2125('0xd'),_0x4de819,_0x2125('0xe'));logger[_0x2125('0xf')](_0x2125('0x10'),_0x4de819,_0x2125('0xe'),JSON[_0x2125('0x11')](_0xad9441));if(_0xad9441[_0x2125('0x12')]){if(_0xad9441['error'][_0x2125('0x13')]===0x1f4){logger[_0x2125('0x12')](_0x2125('0xd'),_0x4de819,_0xad9441['error'][_0x2125('0x14')]);return _0x20a7bf(_0xad9441['error']['message']);}logger[_0x2125('0x12')](_0x2125('0xd'),_0x4de819,_0xad9441['error']['message']);return _0x40bffb(_0xad9441[_0x2125('0x12')][_0x2125('0x14')]);}else{logger[_0x2125('0xc')](_0x2125('0xd'),_0x4de819,_0x2125('0xe'));_0x40bffb(_0xad9441[_0x2125('0x15')]['message']);}})[_0x2125('0x16')](function(_0x55bdc7){logger[_0x2125('0x12')](_0x2125('0xd'),_0x4de819,_0x55bdc7);_0x20a7bf(_0x55bdc7);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 42902f7..8a40188 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 _0x5b02=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update'];(function(_0x2bb468,_0x5d5f9c){var _0x3283ba=function(_0xbfb7f9){while(--_0xbfb7f9){_0x2bb468['push'](_0x2bb468['shift']());}};_0x3283ba(++_0x5d5f9c);}(_0x5b02,0x12e));var _0x25b0=function(_0x4631dc,_0x56cd39){_0x4631dc=_0x4631dc-0x0;var _0x6d8c91=_0x5b02[_0x4631dc];return _0x6d8c91;};'use strict';var multer=require(_0x25b0('0x0'));var util=require(_0x25b0('0x1'));var path=require(_0x25b0('0x2'));var timeout=require(_0x25b0('0x3'));var express=require(_0x25b0('0x4'));var router=express[_0x25b0('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x25b0('0x6'));var interaction=require(_0x25b0('0x7'));var config=require(_0x25b0('0x8'));var controller=require('./intFreshdeskAccount.controller');router[_0x25b0('0x9')]('/',auth[_0x25b0('0xa')](),controller[_0x25b0('0xb')]);router['get'](_0x25b0('0xc'),auth[_0x25b0('0xa')](),controller[_0x25b0('0xd')]);router[_0x25b0('0x9')](_0x25b0('0xe'),auth[_0x25b0('0xa')](),controller[_0x25b0('0xf')]);router[_0x25b0('0x9')](_0x25b0('0x10'),auth[_0x25b0('0xa')](),controller[_0x25b0('0x11')]);router[_0x25b0('0x12')]('/',auth[_0x25b0('0xa')](),controller[_0x25b0('0x13')]);router[_0x25b0('0x12')](_0x25b0('0xe'),auth['isAuthenticated'](),controller[_0x25b0('0x14')]);router[_0x25b0('0x15')]('/:id',auth[_0x25b0('0xa')](),controller[_0x25b0('0x16')]);router['delete'](_0x25b0('0xc'),auth['isAuthenticated'](),controller[_0x25b0('0x17')]);module[_0x25b0('0x18')]=router; \ No newline at end of file +var _0x630b=['./intFreshdeskAccount.controller','get','index','isAuthenticated','show','/:id/configurations','/:id/fields','getFields','post','addConfiguration','put','/:id','update','exports','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x5366ea,_0x11dcea){var _0x5e248a=function(_0x1be5d2){while(--_0x1be5d2){_0x5366ea['push'](_0x5366ea['shift']());}};_0x5e248a(++_0x11dcea);}(_0x630b,0x77));var _0xb630=function(_0x3fccaa,_0xab5ad3){_0x3fccaa=_0x3fccaa-0x0;var _0x3d0937=_0x630b[_0x3fccaa];return _0x3d0937;};'use strict';var multer=require(_0xb630('0x0'));var util=require('util');var path=require(_0xb630('0x1'));var timeout=require(_0xb630('0x2'));var express=require('express');var router=express[_0xb630('0x3')]();var fs_extra=require(_0xb630('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb630('0x5'));var config=require(_0xb630('0x6'));var controller=require(_0xb630('0x7'));router[_0xb630('0x8')]('/',auth['isAuthenticated'](),controller[_0xb630('0x9')]);router[_0xb630('0x8')]('/:id',auth[_0xb630('0xa')](),controller[_0xb630('0xb')]);router[_0xb630('0x8')](_0xb630('0xc'),auth[_0xb630('0xa')](),controller['getConfigurations']);router['get'](_0xb630('0xd'),auth[_0xb630('0xa')](),controller[_0xb630('0xe')]);router[_0xb630('0xf')]('/',auth[_0xb630('0xa')](),controller['create']);router[_0xb630('0xf')](_0xb630('0xc'),auth[_0xb630('0xa')](),controller[_0xb630('0x10')]);router[_0xb630('0x11')](_0xb630('0x12'),auth[_0xb630('0xa')](),controller[_0xb630('0x13')]);router['delete'](_0xb630('0x12'),auth[_0xb630('0xa')](),controller['destroy']);module[_0xb630('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 0dd6c63..ee4d1e3 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 _0x7880=['exports','STRING','username','remoteUri'];(function(_0x39ded1,_0xaee436){var _0x2e248e=function(_0x193df3){while(--_0x193df3){_0x39ded1['push'](_0x39ded1['shift']());}};_0x2e248e(++_0xaee436);}(_0x7880,0x1f4));var _0x0788=function(_0x5f23d9,_0x431d9a){_0x5f23d9=_0x5f23d9-0x0;var _0x68fb9e=_0x7880[_0x5f23d9];return _0x68fb9e;};'use strict';var Sequelize=require('sequelize');module[_0x0788('0x0')]={'name':{'type':Sequelize[_0x0788('0x1')]},'description':{'type':Sequelize[_0x0788('0x1')]},'username':{'type':Sequelize[_0x0788('0x1')],'unique':_0x0788('0x2')},'apiKey':{'type':Sequelize[_0x0788('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x0788('0x3')},'serverUrl':{'type':Sequelize[_0x0788('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xef0f=['sequelize','STRING','remoteUri'];(function(_0x165d3f,_0x1040b6){var _0x3c9c45=function(_0x83a18b){while(--_0x83a18b){_0x165d3f['push'](_0x165d3f['shift']());}};_0x3c9c45(++_0x1040b6);}(_0xef0f,0x168));var _0xfef0=function(_0x1b86a6,_0x4b865c){_0x1b86a6=_0x1b86a6-0x0;var _0x41db95=_0xef0f[_0x1b86a6];return _0x41db95;};'use strict';var Sequelize=require(_0xfef0('0x0'));module['exports']={'name':{'type':Sequelize[_0xfef0('0x1')]},'description':{'type':Sequelize[_0xfef0('0x1')]},'username':{'type':Sequelize[_0xfef0('0x1')],'unique':'username'},'apiKey':{'type':Sequelize[_0xfef0('0x1')]},'remoteUri':{'type':Sequelize[_0xfef0('0x1')],'unique':_0xfef0('0x2')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 5a2cd73..e17266f 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 _0x1948=['../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','FreshdeskAccount','rawAttributes','fieldName','key','map','query','keys','intersection','model','fields','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','findOne','FreshdeskConfiguration','getConfigurations','hasOwnProperty','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshdeskField','getFields','remoteUri','slice','substring','lastIndexOf','format','api/v2/ticket_fields','Basic\x20%s','apiKey','toString','base64','requester','subject','agent','description','ticket_type','group','company','includes','type','custom_text','custom_dropdown','default','choices','capitalize','test','statusCode','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils'];(function(_0x2ffc98,_0x5a0140){var _0x1bb50a=function(_0x77385){while(--_0x77385){_0x2ffc98['push'](_0x2ffc98['shift']());}};_0x1bb50a(++_0x5a0140);}(_0x1948,0x145));var _0x8194=function(_0x46fc56,_0x4c2443){_0x46fc56=_0x46fc56-0x0;var _0x184955=_0x1948[_0x46fc56];return _0x184955;};'use strict';var emlformat=require(_0x8194('0x0'));var rimraf=require(_0x8194('0x1'));var zipdir=require(_0x8194('0x2'));var jsonpatch=require(_0x8194('0x3'));var rp=require(_0x8194('0x4'));var moment=require('moment');var BPromise=require(_0x8194('0x5'));var Mustache=require(_0x8194('0x6'));var util=require(_0x8194('0x7'));var path=require(_0x8194('0x8'));var sox=require(_0x8194('0x9'));var csv=require(_0x8194('0xa'));var ejs=require(_0x8194('0xb'));var fs=require('fs');var fs_extra=require(_0x8194('0xc'));var _=require('lodash');var squel=require(_0x8194('0xd'));var crypto=require(_0x8194('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x8194('0xf'));var toCsv=require(_0x8194('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8194('0x10'));var authService=require(_0x8194('0x11'));var qs=require(_0x8194('0x12'));var as=require(_0x8194('0x13'));var hardwareService=require(_0x8194('0x14'));var logger=require('../../config/logger')(_0x8194('0x15'));var utils=require(_0x8194('0x16'));var config=require(_0x8194('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x8194('0x18'))['db'];var integrations=require(_0x8194('0x19'));function respondWithStatusCode(_0x1aa698,_0xeba106){_0xeba106=_0xeba106||0xcc;return function(_0x3e9d1f){if(_0x3e9d1f){return _0x1aa698[_0x8194('0x1a')](_0xeba106);}return _0x1aa698['status'](_0xeba106)[_0x8194('0x1b')]();};}function respondWithResult(_0x215b95,_0xfd031c){_0xfd031c=_0xfd031c||0xc8;return function(_0x2ab425){if(_0x2ab425){return _0x215b95[_0x8194('0x1c')](_0xfd031c)[_0x8194('0x1d')](_0x2ab425);}};}function respondWithFilteredResult(_0x112d44,_0x13e166){return function(_0x19c23e){if(_0x19c23e){var _0x5abd09=typeof _0x13e166[_0x8194('0x1e')]===_0x8194('0x1f')&&typeof _0x13e166['limit']===_0x8194('0x1f');var _0x4afbe3=_0x19c23e['count'];var _0x5f2172=_0x5abd09?0x0:_0x13e166[_0x8194('0x1e')];var _0x43a192=_0x5abd09?_0x19c23e[_0x8194('0x20')]:_0x13e166[_0x8194('0x1e')]+_0x13e166[_0x8194('0x21')];var _0x1d7bcc;if(_0x43a192>=_0x4afbe3){_0x43a192=_0x4afbe3;_0x1d7bcc=0xc8;}else{_0x1d7bcc=0xce;}_0x112d44['status'](_0x1d7bcc);return _0x112d44['set'](_0x8194('0x22'),_0x5f2172+'-'+_0x43a192+'/'+_0x4afbe3)['json'](_0x19c23e);}return null;};}function patchUpdates(_0x43d763){return function(_0x24d1ff){try{jsonpatch[_0x8194('0x23')](_0x24d1ff,_0x43d763,!![]);}catch(_0x59a758){return BPromise[_0x8194('0x24')](_0x59a758);}return _0x24d1ff[_0x8194('0x25')]();};}function saveUpdates(_0x41641d,_0x28df4f){return function(_0x1babf1){if(_0x1babf1){return _0x1babf1[_0x8194('0x26')](_0x41641d)[_0x8194('0x27')](function(_0xe593e9){return _0xe593e9;});}return null;};}function removeEntity(_0x269a22,_0x263093){return function(_0xbb64b7){if(_0xbb64b7){return _0xbb64b7[_0x8194('0x28')]()['then'](function(){_0x269a22[_0x8194('0x1c')](0xcc)[_0x8194('0x1b')]();});}};}function handleEntityNotFound(_0x21e92d,_0x46a242){return function(_0x55b0d9){if(!_0x55b0d9){_0x21e92d[_0x8194('0x1a')](0x194);}return _0x55b0d9;};}function handleError(_0x381dec,_0x425a1d){_0x425a1d=_0x425a1d||0x1f4;return function(_0x42c3b0){logger[_0x8194('0x29')](_0x42c3b0['stack']);if(_0x42c3b0['name']){delete _0x42c3b0[_0x8194('0x2a')];}_0x381dec[_0x8194('0x1c')](_0x425a1d)[_0x8194('0x2b')](_0x42c3b0);};}exports[_0x8194('0x2c')]=function(_0x181b8e,_0x56c512){var _0x4af9cc={},_0x5624a0={},_0x1ea1f={'count':0x0,'rows':[]};var _0x56b5bc=_['map'](db[_0x8194('0x2d')][_0x8194('0x2e')],function(_0x4ee84e){return{'name':_0x4ee84e[_0x8194('0x2f')],'type':_0x4ee84e['type'][_0x8194('0x30')]};});_0x5624a0['model']=_[_0x8194('0x31')](_0x56b5bc,_0x8194('0x2a'));_0x5624a0[_0x8194('0x32')]=_[_0x8194('0x33')](_0x181b8e[_0x8194('0x32')]);_0x5624a0['filters']=_[_0x8194('0x34')](_0x5624a0['model'],_0x5624a0[_0x8194('0x32')]);_0x4af9cc['attributes']=_[_0x8194('0x34')](_0x5624a0[_0x8194('0x35')],qs[_0x8194('0x36')](_0x181b8e['query']['fields']));_0x4af9cc[_0x8194('0x37')]=_0x4af9cc[_0x8194('0x37')][_0x8194('0x38')]?_0x4af9cc[_0x8194('0x37')]:_0x5624a0['model'];if(!_0x181b8e['query']['hasOwnProperty'](_0x8194('0x39'))){_0x4af9cc[_0x8194('0x21')]=qs[_0x8194('0x21')](_0x181b8e[_0x8194('0x32')][_0x8194('0x21')]);_0x4af9cc[_0x8194('0x1e')]=qs['offset'](_0x181b8e[_0x8194('0x32')][_0x8194('0x1e')]);}_0x4af9cc[_0x8194('0x3a')]=qs[_0x8194('0x3b')](_0x181b8e[_0x8194('0x32')][_0x8194('0x3b')]);_0x4af9cc[_0x8194('0x3c')]=qs[_0x8194('0x3d')](_[_0x8194('0x3e')](_0x181b8e[_0x8194('0x32')],_0x5624a0[_0x8194('0x3d')]),_0x56b5bc);if(_0x181b8e[_0x8194('0x32')]['filter']){_0x4af9cc[_0x8194('0x3c')]=_['merge'](_0x4af9cc['where'],{'$or':_[_0x8194('0x31')](_0x56b5bc,function(_0x841b4c){if(_0x841b4c['type']!=='VIRTUAL'){var _0x568aa5={};_0x568aa5[_0x841b4c['name']]={'$like':'%'+_0x181b8e['query'][_0x8194('0x3f')]+'%'};return _0x568aa5;}})});}_0x4af9cc=_[_0x8194('0x40')]({},_0x4af9cc,_0x181b8e[_0x8194('0x41')]);var _0x4fea56={'where':_0x4af9cc['where']};return db['FreshdeskAccount'][_0x8194('0x20')](_0x4fea56)[_0x8194('0x27')](function(_0x2d5809){_0x1ea1f[_0x8194('0x20')]=_0x2d5809;if(_0x181b8e['query'][_0x8194('0x42')]){_0x4af9cc[_0x8194('0x43')]=[{'all':!![]}];}return db[_0x8194('0x2d')][_0x8194('0x44')](_0x4af9cc);})[_0x8194('0x27')](function(_0x4ba548){_0x1ea1f[_0x8194('0x45')]=_0x4ba548;return _0x1ea1f;})[_0x8194('0x27')](respondWithFilteredResult(_0x56c512,_0x4af9cc))[_0x8194('0x46')](handleError(_0x56c512,null));};exports[_0x8194('0x47')]=function(_0x32f215,_0xb3f9ec){var _0x36789b={'raw':![],'where':{'id':_0x32f215[_0x8194('0x48')]['id']}},_0x5be9a0={};_0x5be9a0[_0x8194('0x35')]=_[_0x8194('0x33')](db[_0x8194('0x2d')]['rawAttributes']);_0x5be9a0['query']=_[_0x8194('0x33')](_0x32f215['query']);_0x5be9a0[_0x8194('0x3d')]=_['intersection'](_0x5be9a0[_0x8194('0x35')],_0x5be9a0['query']);_0x36789b[_0x8194('0x37')]=_[_0x8194('0x34')](_0x5be9a0[_0x8194('0x35')],qs[_0x8194('0x36')](_0x32f215['query'][_0x8194('0x36')]));_0x36789b[_0x8194('0x37')]=_0x36789b[_0x8194('0x37')]['length']?_0x36789b[_0x8194('0x37')]:_0x5be9a0[_0x8194('0x35')];if(_0x32f215[_0x8194('0x32')][_0x8194('0x42')]){_0x36789b[_0x8194('0x43')]=[{'all':!![]}];}_0x36789b=_['merge']({},_0x36789b,_0x32f215[_0x8194('0x41')]);return db['FreshdeskAccount'][_0x8194('0x49')](_0x36789b)[_0x8194('0x27')](handleEntityNotFound(_0xb3f9ec,null))[_0x8194('0x27')](respondWithResult(_0xb3f9ec,null))[_0x8194('0x46')](handleError(_0xb3f9ec,null));};exports[_0x8194('0x4a')]=function(_0x32a1cd,_0x3c0a84){return db[_0x8194('0x2d')][_0x8194('0x4a')](_0x32a1cd[_0x8194('0x4b')],{})[_0x8194('0x27')](respondWithResult(_0x3c0a84,0xc9))[_0x8194('0x46')](handleError(_0x3c0a84,null));};exports[_0x8194('0x26')]=function(_0x349e27,_0x2f828c){if(_0x349e27[_0x8194('0x4b')]['id']){delete _0x349e27[_0x8194('0x4b')]['id'];}return db[_0x8194('0x2d')]['find']({'where':{'id':_0x349e27[_0x8194('0x48')]['id']}})[_0x8194('0x27')](handleEntityNotFound(_0x2f828c,null))['then'](saveUpdates(_0x349e27['body'],null))[_0x8194('0x27')](respondWithResult(_0x2f828c,null))[_0x8194('0x46')](handleError(_0x2f828c,null));};exports[_0x8194('0x28')]=function(_0x3029fe,_0x3f85af){return db[_0x8194('0x2d')][_0x8194('0x49')]({'where':{'id':_0x3029fe[_0x8194('0x48')]['id']}})[_0x8194('0x27')](handleEntityNotFound(_0x3f85af,null))[_0x8194('0x27')](removeEntity(_0x3f85af,null))['catch'](handleError(_0x3f85af,null));};exports['getConfigurations']=function(_0x510f6d,_0x5b6d09,_0x12354c){var _0x87d151={};var _0x899688={};var _0x40fe60;var _0x381091;return db[_0x8194('0x2d')][_0x8194('0x4c')]({'where':{'id':_0x510f6d[_0x8194('0x48')]['id']}})[_0x8194('0x27')](handleEntityNotFound(_0x5b6d09,null))['then'](function(_0x5ec3dd){if(_0x5ec3dd){_0x40fe60=_0x5ec3dd;_0x899688[_0x8194('0x35')]=_[_0x8194('0x33')](db[_0x8194('0x4d')][_0x8194('0x2e')]);_0x899688[_0x8194('0x32')]=_[_0x8194('0x33')](_0x510f6d['query']);_0x899688[_0x8194('0x3d')]=_[_0x8194('0x34')](_0x899688[_0x8194('0x35')],_0x899688[_0x8194('0x32')]);_0x87d151[_0x8194('0x37')]=_[_0x8194('0x34')](_0x899688[_0x8194('0x35')],qs[_0x8194('0x36')](_0x510f6d['query'][_0x8194('0x36')]));_0x87d151[_0x8194('0x37')]=_0x87d151[_0x8194('0x37')][_0x8194('0x38')]?_0x87d151[_0x8194('0x37')]:_0x899688[_0x8194('0x35')];_0x87d151[_0x8194('0x3a')]=qs[_0x8194('0x3b')](_0x510f6d[_0x8194('0x32')][_0x8194('0x3b')]);_0x87d151[_0x8194('0x3c')]=qs['filters'](_[_0x8194('0x3e')](_0x510f6d[_0x8194('0x32')],_0x899688[_0x8194('0x3d')]));if(_0x510f6d[_0x8194('0x32')]['filter']){_0x87d151['where']=_[_0x8194('0x40')](_0x87d151[_0x8194('0x3c')],{'$or':_[_0x8194('0x31')](_0x87d151[_0x8194('0x37')],function(_0x46136d){var _0x4cf5cc={};_0x4cf5cc[_0x46136d]={'$like':'%'+_0x510f6d[_0x8194('0x32')][_0x8194('0x3f')]+'%'};return _0x4cf5cc;})});}_0x87d151=_[_0x8194('0x40')]({},_0x87d151,_0x510f6d[_0x8194('0x41')]);return _0x40fe60[_0x8194('0x4e')](_0x87d151);}})[_0x8194('0x27')](function(_0x37a727){if(_0x37a727){_0x381091=_0x37a727[_0x8194('0x38')];if(!_0x510f6d[_0x8194('0x32')][_0x8194('0x4f')](_0x8194('0x39'))){_0x87d151[_0x8194('0x21')]=qs[_0x8194('0x21')](_0x510f6d['query']['limit']);_0x87d151['offset']=qs[_0x8194('0x1e')](_0x510f6d[_0x8194('0x32')][_0x8194('0x1e')]);}return _0x40fe60['getConfigurations'](_0x87d151);}})[_0x8194('0x27')](function(_0x19c7ee){if(_0x19c7ee){return _0x19c7ee?{'count':_0x381091,'rows':_0x19c7ee}:null;}})['then'](respondWithResult(_0x5b6d09,null))[_0x8194('0x46')](handleError(_0x5b6d09,null));};exports['addConfiguration']=function(_0x5ce807,_0x4f557f,_0x4866c5){if(_0x5ce807[_0x8194('0x4b')]['id']){delete _0x5ce807[_0x8194('0x4b')]['id'];}return db[_0x8194('0x2d')][_0x8194('0x4c')]({'where':{'id':_0x5ce807['params']['id']}})[_0x8194('0x27')](handleEntityNotFound(_0x4f557f,null))[_0x8194('0x27')](function(_0x5df7a2){if(_0x5df7a2){_0x5ce807[_0x8194('0x4b')][_0x8194('0x50')]=_0x5df7a2['id'];_0x5ce807[_0x8194('0x4b')][_0x8194('0x51')]=integrations[_0x8194('0x52')](_0x5ce807[_0x8194('0x4b')][_0x8194('0x53')],_0x5ce807['body']['type']);_0x5ce807['body'][_0x8194('0x54')]=integrations[_0x8194('0x55')](_0x5ce807['body'][_0x8194('0x53')],_0x5ce807[_0x8194('0x4b')]['type']);return db['FreshdeskConfiguration'][_0x8194('0x4a')](_0x5ce807[_0x8194('0x4b')],{'include':[{'model':db[_0x8194('0x56')],'as':_0x8194('0x51')},{'model':db[_0x8194('0x56')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x4f557f,null))['catch'](handleError(_0x4f557f,null));};exports[_0x8194('0x57')]=function(_0x1773d2,_0x13f881,_0x4ea859){var _0x24b6f9='';return db['FreshdeskAccount'][_0x8194('0x4c')]({'where':{'id':_0x1773d2[_0x8194('0x48')]['id']},'attributes':['id',_0x8194('0x58'),'apiKey']})[_0x8194('0x27')](handleEntityNotFound(_0x13f881,null))['then'](function(_0x5e0778){if(_0x5e0778){_0x24b6f9=_0x5e0778['remoteUri'];var _0x19d22a=_0x24b6f9[_0x8194('0x59')](-0x1);if(_0x19d22a==='/'){_0x24b6f9=_0x24b6f9[_0x8194('0x5a')](0x0,_0x24b6f9[_0x8194('0x5b')](_0x19d22a));}return rp({'method':'GET','uri':util[_0x8194('0x5c')]('%s/%s',_0x24b6f9,_0x8194('0x5d')),'headers':{'Authorization':util[_0x8194('0x5c')](_0x8194('0x5e'),new Buffer(util['format']('%s:X',_0x5e0778[_0x8194('0x5f')]))[_0x8194('0x60')](_0x8194('0x61')))},'json':!![]});}})[_0x8194('0x27')](function(_0x41d813){if(_0x41d813){var _0x221e7a=[_0x8194('0x62'),_0x8194('0x63'),_0x8194('0x64'),_0x8194('0x65'),_0x8194('0x1c'),'priority','group','source',_0x8194('0x66'),_0x8194('0x67'),_0x8194('0x68')];_['remove'](_0x41d813,function(_0xd8482b){return _0x221e7a[_0x8194('0x69')](_0xd8482b[_0x8194('0x2a')])||!_0xd8482b['default']&&_0xd8482b[_0x8194('0x6a')]!==_0x8194('0x6b')&&_0xd8482b[_0x8194('0x6a')]!==_0x8194('0x6c');});return{'count':_0x41d813[_0x8194('0x38')],'rows':_['map'](_0x41d813,function(_0x457d9f){return{'id':_0x457d9f[_0x8194('0x2a')],'name':_0x457d9f['label'],'custom':!_0x457d9f[_0x8194('0x6d')],'options':_0x457d9f['choices']?_[_0x8194('0x31')](_0x457d9f[_0x8194('0x6e')],function(_0x2e1a66){return{'name':_[_0x8194('0x6f')](_0x2e1a66),'value':_0x2e1a66};}):[]};})};}})[_0x8194('0x27')](respondWithResult(_0x13f881,null))[_0x8194('0x46')](function(_0x29aaa6){var _0x26e1e6=_0x1773d2['query'][_0x8194('0x70')]?0x1f4:_0x29aaa6[_0x8194('0x71')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x8194('0x57'),_0x26e1e6,JSON[_0x8194('0x72')](_0x29aaa6));delete _0x29aaa6[_0x8194('0x2a')];if(_0x26e1e6===0x191){_0x26e1e6=0x190;}_0x13f881[_0x8194('0x1c')](_0x26e1e6)[_0x8194('0x2b')](_0x1773d2['query'][_0x8194('0x70')]?{'message':_0x8194('0x73'),'statusCode':_0x29aaa6['statusCode']}:_0x29aaa6);});}; \ No newline at end of file +var _0x570f=['rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','map','FreshdeskAccount','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','sort','pick','filter','where','merge','type','options','includeAll','include','catch','show','create','body','find','getConfigurations','findOne','params','FreshdeskConfiguration','order','hasOwnProperty','nolimit','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','FreshdeskField','remoteUri','apiKey','slice','GET','format','%s/%s','api/v2/ticket_fields','%s:X','toString','base64','requester','agent','description','group','source','company','remove','includes','default','custom_text','custom_dropdown','label','choices','capitalize','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','test','Wrong\x20credentials','statusCode','eml-format'];(function(_0x3fc42f,_0x16130e){var _0x140221=function(_0x2828db){while(--_0x2828db){_0x3fc42f['push'](_0x3fc42f['shift']());}};_0x140221(++_0x16130e);}(_0x570f,0x152));var _0xf570=function(_0x1413b6,_0x46a66d){_0x1413b6=_0x1413b6-0x0;var _0x133fd9=_0x570f[_0x1413b6];return _0x133fd9;};'use strict';var emlformat=require(_0xf570('0x0'));var rimraf=require(_0xf570('0x1'));var zipdir=require(_0xf570('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf570('0x3'));var BPromise=require(_0xf570('0x4'));var Mustache=require(_0xf570('0x5'));var util=require(_0xf570('0x6'));var path=require(_0xf570('0x7'));var sox=require(_0xf570('0x8'));var csv=require(_0xf570('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf570('0xa'));var _=require('lodash');var squel=require(_0xf570('0xb'));var crypto=require('crypto');var jsforce=require(_0xf570('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xf570('0x9'));var querystring=require('querystring');var Papa=require(_0xf570('0xd'));var Redis=require(_0xf570('0xe'));var authService=require(_0xf570('0xf'));var qs=require(_0xf570('0x10'));var as=require(_0xf570('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf570('0x12'))(_0xf570('0x13'));var utils=require(_0xf570('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xf570('0x15'));var db=require(_0xf570('0x16'))['db'];var integrations=require(_0xf570('0x17'));function respondWithStatusCode(_0x51cb42,_0x32e0b0){_0x32e0b0=_0x32e0b0||0xcc;return function(_0xe2d1a4){if(_0xe2d1a4){return _0x51cb42[_0xf570('0x18')](_0x32e0b0);}return _0x51cb42[_0xf570('0x19')](_0x32e0b0)['end']();};}function respondWithResult(_0x9a5e4f,_0x2e0329){_0x2e0329=_0x2e0329||0xc8;return function(_0x31c58e){if(_0x31c58e){return _0x9a5e4f[_0xf570('0x19')](_0x2e0329)[_0xf570('0x1a')](_0x31c58e);}};}function respondWithFilteredResult(_0xf3423e,_0x2531f9){return function(_0x1065a9){if(_0x1065a9){var _0x14456a=typeof _0x2531f9[_0xf570('0x1b')]===_0xf570('0x1c')&&typeof _0x2531f9['limit']===_0xf570('0x1c');var _0x97f023=_0x1065a9[_0xf570('0x1d')];var _0x438e5b=_0x14456a?0x0:_0x2531f9[_0xf570('0x1b')];var _0x5cde47=_0x14456a?_0x1065a9[_0xf570('0x1d')]:_0x2531f9[_0xf570('0x1b')]+_0x2531f9[_0xf570('0x1e')];var _0x4e2649;if(_0x5cde47>=_0x97f023){_0x5cde47=_0x97f023;_0x4e2649=0xc8;}else{_0x4e2649=0xce;}_0xf3423e[_0xf570('0x19')](_0x4e2649);return _0xf3423e[_0xf570('0x1f')](_0xf570('0x20'),_0x438e5b+'-'+_0x5cde47+'/'+_0x97f023)[_0xf570('0x1a')](_0x1065a9);}return null;};}function patchUpdates(_0x576a2f){return function(_0x2f20a0){try{jsonpatch[_0xf570('0x21')](_0x2f20a0,_0x576a2f,!![]);}catch(_0x14fdef){return BPromise[_0xf570('0x22')](_0x14fdef);}return _0x2f20a0[_0xf570('0x23')]();};}function saveUpdates(_0x570703,_0xe71f1){return function(_0x101d2d){if(_0x101d2d){return _0x101d2d[_0xf570('0x24')](_0x570703)[_0xf570('0x25')](function(_0x4844e5){return _0x4844e5;});}return null;};}function removeEntity(_0x46bd4a,_0x40c4f1){return function(_0x3eb3cb){if(_0x3eb3cb){return _0x3eb3cb[_0xf570('0x26')]()[_0xf570('0x25')](function(){_0x46bd4a[_0xf570('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39d487,_0x23c6f0){return function(_0x2a8701){if(!_0x2a8701){_0x39d487[_0xf570('0x18')](0x194);}return _0x2a8701;};}function handleError(_0xe4b67f,_0x268be7){_0x268be7=_0x268be7||0x1f4;return function(_0x40a638){logger[_0xf570('0x27')](_0x40a638[_0xf570('0x28')]);if(_0x40a638[_0xf570('0x29')]){delete _0x40a638[_0xf570('0x29')];}_0xe4b67f[_0xf570('0x19')](_0x268be7)['send'](_0x40a638);};}exports['index']=function(_0x2eece8,_0x29ee27){var _0x18680a={},_0x3929e3={},_0x170eca={'count':0x0,'rows':[]};var _0x116f50=_[_0xf570('0x2a')](db[_0xf570('0x2b')][_0xf570('0x2c')],function(_0x47aff8){return{'name':_0x47aff8[_0xf570('0x2d')],'type':_0x47aff8['type'][_0xf570('0x2e')]};});_0x3929e3[_0xf570('0x2f')]=_[_0xf570('0x2a')](_0x116f50,'name');_0x3929e3[_0xf570('0x30')]=_[_0xf570('0x31')](_0x2eece8['query']);_0x3929e3[_0xf570('0x32')]=_['intersection'](_0x3929e3[_0xf570('0x2f')],_0x3929e3[_0xf570('0x30')]);_0x18680a[_0xf570('0x33')]=_[_0xf570('0x34')](_0x3929e3['model'],qs['fields'](_0x2eece8[_0xf570('0x30')][_0xf570('0x35')]));_0x18680a[_0xf570('0x33')]=_0x18680a[_0xf570('0x33')][_0xf570('0x36')]?_0x18680a['attributes']:_0x3929e3[_0xf570('0x2f')];if(!_0x2eece8['query']['hasOwnProperty']('nolimit')){_0x18680a[_0xf570('0x1e')]=qs['limit'](_0x2eece8[_0xf570('0x30')][_0xf570('0x1e')]);_0x18680a['offset']=qs['offset'](_0x2eece8[_0xf570('0x30')]['offset']);}_0x18680a['order']=qs[_0xf570('0x37')](_0x2eece8['query']['sort']);_0x18680a['where']=qs[_0xf570('0x32')](_[_0xf570('0x38')](_0x2eece8[_0xf570('0x30')],_0x3929e3[_0xf570('0x32')]),_0x116f50);if(_0x2eece8[_0xf570('0x30')][_0xf570('0x39')]){_0x18680a[_0xf570('0x3a')]=_[_0xf570('0x3b')](_0x18680a[_0xf570('0x3a')],{'$or':_[_0xf570('0x2a')](_0x116f50,function(_0x77f74f){if(_0x77f74f[_0xf570('0x3c')]!=='VIRTUAL'){var _0x417a37={};_0x417a37[_0x77f74f[_0xf570('0x29')]]={'$like':'%'+_0x2eece8[_0xf570('0x30')]['filter']+'%'};return _0x417a37;}})});}_0x18680a=_[_0xf570('0x3b')]({},_0x18680a,_0x2eece8[_0xf570('0x3d')]);var _0x22b201={'where':_0x18680a[_0xf570('0x3a')]};return db[_0xf570('0x2b')][_0xf570('0x1d')](_0x22b201)[_0xf570('0x25')](function(_0x3ae19e){_0x170eca[_0xf570('0x1d')]=_0x3ae19e;if(_0x2eece8[_0xf570('0x30')][_0xf570('0x3e')]){_0x18680a[_0xf570('0x3f')]=[{'all':!![]}];}return db[_0xf570('0x2b')]['findAll'](_0x18680a);})[_0xf570('0x25')](function(_0x8ad932){_0x170eca['rows']=_0x8ad932;return _0x170eca;})[_0xf570('0x25')](respondWithFilteredResult(_0x29ee27,_0x18680a))[_0xf570('0x40')](handleError(_0x29ee27,null));};exports[_0xf570('0x41')]=function(_0x164d2b,_0x934d12){var _0xabf891={'raw':![],'where':{'id':_0x164d2b['params']['id']}},_0x4a337={};_0x4a337[_0xf570('0x2f')]=_[_0xf570('0x31')](db[_0xf570('0x2b')][_0xf570('0x2c')]);_0x4a337[_0xf570('0x30')]=_[_0xf570('0x31')](_0x164d2b['query']);_0x4a337['filters']=_[_0xf570('0x34')](_0x4a337[_0xf570('0x2f')],_0x4a337[_0xf570('0x30')]);_0xabf891[_0xf570('0x33')]=_['intersection'](_0x4a337[_0xf570('0x2f')],qs[_0xf570('0x35')](_0x164d2b[_0xf570('0x30')]['fields']));_0xabf891[_0xf570('0x33')]=_0xabf891['attributes'][_0xf570('0x36')]?_0xabf891[_0xf570('0x33')]:_0x4a337[_0xf570('0x2f')];if(_0x164d2b[_0xf570('0x30')][_0xf570('0x3e')]){_0xabf891[_0xf570('0x3f')]=[{'all':!![]}];}_0xabf891=_[_0xf570('0x3b')]({},_0xabf891,_0x164d2b[_0xf570('0x3d')]);return db['FreshdeskAccount']['find'](_0xabf891)[_0xf570('0x25')](handleEntityNotFound(_0x934d12,null))['then'](respondWithResult(_0x934d12,null))[_0xf570('0x40')](handleError(_0x934d12,null));};exports[_0xf570('0x42')]=function(_0x31c94f,_0x42e69){return db[_0xf570('0x2b')][_0xf570('0x42')](_0x31c94f[_0xf570('0x43')],{})[_0xf570('0x25')](respondWithResult(_0x42e69,0xc9))[_0xf570('0x40')](handleError(_0x42e69,null));};exports['update']=function(_0x3698d6,_0x5b9858){if(_0x3698d6[_0xf570('0x43')]['id']){delete _0x3698d6[_0xf570('0x43')]['id'];}return db[_0xf570('0x2b')]['find']({'where':{'id':_0x3698d6['params']['id']}})[_0xf570('0x25')](handleEntityNotFound(_0x5b9858,null))['then'](saveUpdates(_0x3698d6[_0xf570('0x43')],null))['then'](respondWithResult(_0x5b9858,null))['catch'](handleError(_0x5b9858,null));};exports[_0xf570('0x26')]=function(_0x1e0964,_0x2991e9){return db[_0xf570('0x2b')][_0xf570('0x44')]({'where':{'id':_0x1e0964['params']['id']}})[_0xf570('0x25')](handleEntityNotFound(_0x2991e9,null))[_0xf570('0x25')](removeEntity(_0x2991e9,null))['catch'](handleError(_0x2991e9,null));};exports[_0xf570('0x45')]=function(_0x4d442d,_0x4673c,_0x3d6adc){var _0x3d566e={};var _0xb5247f={};var _0x273cda;var _0x563e3f;return db['FreshdeskAccount'][_0xf570('0x46')]({'where':{'id':_0x4d442d[_0xf570('0x47')]['id']}})[_0xf570('0x25')](handleEntityNotFound(_0x4673c,null))[_0xf570('0x25')](function(_0x5d84c4){if(_0x5d84c4){_0x273cda=_0x5d84c4;_0xb5247f[_0xf570('0x2f')]=_['keys'](db[_0xf570('0x48')][_0xf570('0x2c')]);_0xb5247f[_0xf570('0x30')]=_[_0xf570('0x31')](_0x4d442d['query']);_0xb5247f[_0xf570('0x32')]=_['intersection'](_0xb5247f['model'],_0xb5247f[_0xf570('0x30')]);_0x3d566e['attributes']=_['intersection'](_0xb5247f[_0xf570('0x2f')],qs[_0xf570('0x35')](_0x4d442d['query'][_0xf570('0x35')]));_0x3d566e[_0xf570('0x33')]=_0x3d566e['attributes'][_0xf570('0x36')]?_0x3d566e['attributes']:_0xb5247f[_0xf570('0x2f')];_0x3d566e[_0xf570('0x49')]=qs[_0xf570('0x37')](_0x4d442d[_0xf570('0x30')][_0xf570('0x37')]);_0x3d566e['where']=qs[_0xf570('0x32')](_[_0xf570('0x38')](_0x4d442d['query'],_0xb5247f[_0xf570('0x32')]));if(_0x4d442d['query'][_0xf570('0x39')]){_0x3d566e[_0xf570('0x3a')]=_['merge'](_0x3d566e[_0xf570('0x3a')],{'$or':_['map'](_0x3d566e[_0xf570('0x33')],function(_0x193b47){var _0xa3a1e9={};_0xa3a1e9[_0x193b47]={'$like':'%'+_0x4d442d[_0xf570('0x30')][_0xf570('0x39')]+'%'};return _0xa3a1e9;})});}_0x3d566e=_[_0xf570('0x3b')]({},_0x3d566e,_0x4d442d['options']);return _0x273cda['getConfigurations'](_0x3d566e);}})['then'](function(_0x4b443f){if(_0x4b443f){_0x563e3f=_0x4b443f['length'];if(!_0x4d442d[_0xf570('0x30')][_0xf570('0x4a')](_0xf570('0x4b'))){_0x3d566e['limit']=qs[_0xf570('0x1e')](_0x4d442d[_0xf570('0x30')][_0xf570('0x1e')]);_0x3d566e[_0xf570('0x1b')]=qs['offset'](_0x4d442d[_0xf570('0x30')][_0xf570('0x1b')]);}return _0x273cda[_0xf570('0x45')](_0x3d566e);}})['then'](function(_0x4983c2){if(_0x4983c2){return _0x4983c2?{'count':_0x563e3f,'rows':_0x4983c2}:null;}})[_0xf570('0x25')](respondWithResult(_0x4673c,null))[_0xf570('0x40')](handleError(_0x4673c,null));};exports['addConfiguration']=function(_0x11c1d4,_0x4efc54,_0x534efc){if(_0x11c1d4['body']['id']){delete _0x11c1d4['body']['id'];}return db[_0xf570('0x2b')]['findOne']({'where':{'id':_0x11c1d4[_0xf570('0x47')]['id']}})[_0xf570('0x25')](handleEntityNotFound(_0x4efc54,null))[_0xf570('0x25')](function(_0x511e08){if(_0x511e08){_0x11c1d4[_0xf570('0x43')][_0xf570('0x4c')]=_0x511e08['id'];_0x11c1d4['body'][_0xf570('0x4d')]=integrations[_0xf570('0x4e')](_0x11c1d4[_0xf570('0x43')]['channel'],_0x11c1d4[_0xf570('0x43')][_0xf570('0x3c')]);_0x11c1d4[_0xf570('0x43')][_0xf570('0x4f')]=integrations[_0xf570('0x50')](_0x11c1d4[_0xf570('0x43')][_0xf570('0x51')],_0x11c1d4[_0xf570('0x43')]['type']);return db[_0xf570('0x48')][_0xf570('0x42')](_0x11c1d4[_0xf570('0x43')],{'include':[{'model':db[_0xf570('0x52')],'as':'Subjects'},{'model':db[_0xf570('0x52')],'as':_0xf570('0x4f')}]});}return null;})['then'](respondWithResult(_0x4efc54,null))[_0xf570('0x40')](handleError(_0x4efc54,null));};exports['getFields']=function(_0x4bb2ed,_0x5b0abd,_0x172c88){var _0xcb8228='';return db[_0xf570('0x2b')][_0xf570('0x46')]({'where':{'id':_0x4bb2ed[_0xf570('0x47')]['id']},'attributes':['id',_0xf570('0x53'),_0xf570('0x54')]})['then'](handleEntityNotFound(_0x5b0abd,null))[_0xf570('0x25')](function(_0x5c1372){if(_0x5c1372){_0xcb8228=_0x5c1372[_0xf570('0x53')];var _0x437246=_0xcb8228[_0xf570('0x55')](-0x1);if(_0x437246==='/'){_0xcb8228=_0xcb8228['substring'](0x0,_0xcb8228['lastIndexOf'](_0x437246));}return rp({'method':_0xf570('0x56'),'uri':util[_0xf570('0x57')](_0xf570('0x58'),_0xcb8228,_0xf570('0x59')),'headers':{'Authorization':util[_0xf570('0x57')]('Basic\x20%s',new Buffer(util[_0xf570('0x57')](_0xf570('0x5a'),_0x5c1372[_0xf570('0x54')]))[_0xf570('0x5b')](_0xf570('0x5c')))},'json':!![]});}})['then'](function(_0x5b004e){if(_0x5b004e){var _0x43be69=[_0xf570('0x5d'),'subject',_0xf570('0x5e'),_0xf570('0x5f'),_0xf570('0x19'),'priority',_0xf570('0x60'),_0xf570('0x61'),'ticket_type',_0xf570('0x60'),_0xf570('0x62')];_[_0xf570('0x63')](_0x5b004e,function(_0x4b3118){return _0x43be69[_0xf570('0x64')](_0x4b3118[_0xf570('0x29')])||!_0x4b3118[_0xf570('0x65')]&&_0x4b3118[_0xf570('0x3c')]!==_0xf570('0x66')&&_0x4b3118['type']!==_0xf570('0x67');});return{'count':_0x5b004e[_0xf570('0x36')],'rows':_[_0xf570('0x2a')](_0x5b004e,function(_0x138e17){return{'id':_0x138e17[_0xf570('0x29')],'name':_0x138e17[_0xf570('0x68')],'custom':!_0x138e17[_0xf570('0x65')],'options':_0x138e17[_0xf570('0x69')]?_[_0xf570('0x2a')](_0x138e17['choices'],function(_0x45e9c7){return{'name':_[_0xf570('0x6a')](_0x45e9c7),'value':_0x45e9c7};}):[]};})};}})[_0xf570('0x25')](respondWithResult(_0x5b0abd,null))[_0xf570('0x40')](function(_0x37611b){var _0x551fda=_0x4bb2ed['query']['test']?0x1f4:_0x37611b['statusCode']||0x1f4;logger[_0xf570('0x27')](_0xf570('0x6b'),_0xf570('0x6c'),_0x551fda,JSON[_0xf570('0x6d')](_0x37611b));delete _0x37611b['name'];if(_0x551fda===0x191){_0x551fda=0x190;}_0x5b0abd[_0xf570('0x19')](_0x551fda)['send'](_0x4bb2ed[_0xf570('0x30')][_0xf570('0x6e')]?{'message':_0xf570('0x6f'),'statusCode':_0x37611b[_0xf570('0x70')]}:_0x37611b);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 73d65ce..a639737 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 _0x8c36=['./intFreshdeskAccount.attributes','exports','define','FreshdeskAccount','int_freshdesk_accounts','lodash','../../config/logger','moment','bluebird','path'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0x8c36,0x87));var _0x68c3=function(_0x540a61,_0x305a2){_0x540a61=_0x540a61-0x0;var _0x5c35c5=_0x8c36[_0x540a61];return _0x5c35c5;};'use strict';var _=require(_0x68c3('0x0'));var util=require('util');var logger=require(_0x68c3('0x1'))('api');var moment=require(_0x68c3('0x2'));var BPromise=require(_0x68c3('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x68c3('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x68c3('0x5'));var integrations=require('../../components/integrations/configuration');module[_0x68c3('0x6')]=function(_0x324e0c,_0x1efd8a){return _0x324e0c[_0x68c3('0x7')](_0x68c3('0x8'),attributes,{'tableName':_0x68c3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x90e0=['../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount','int_freshdesk_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x5678b5,_0x1c4aa8){var _0x4c09a5=function(_0x2aa89a){while(--_0x2aa89a){_0x5678b5['push'](_0x5678b5['shift']());}};_0x4c09a5(++_0x1c4aa8);}(_0x90e0,0xe8));var _0x090e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x90e0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x090e('0x0'));var util=require(_0x090e('0x1'));var logger=require(_0x090e('0x2'))(_0x090e('0x3'));var moment=require('moment');var BPromise=require(_0x090e('0x4'));var rp=require(_0x090e('0x5'));var fs=require('fs');var path=require(_0x090e('0x6'));var rimraf=require(_0x090e('0x7'));var config=require(_0x090e('0x8'));var attributes=require(_0x090e('0x9'));var integrations=require(_0x090e('0xa'));module[_0x090e('0xb')]=function(_0xb4a10c,_0x35339b){return _0xb4a10c[_0x090e('0xc')](_0x090e('0xd'),attributes,{'tableName':_0x090e('0xe'),'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 1f7aaee..bde4963 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 _0x60a9=['raw','where','limit','include','map','model','attributes','GetFreshdeskAccount','stringify','ShowFreshdeskAccount','FreshdeskAccount','find','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','client','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','findAll','options'];(function(_0x1186b7,_0x42f09e){var _0x1964d7=function(_0x40f150){while(--_0x40f150){_0x1186b7['push'](_0x1186b7['shift']());}};_0x1964d7(++_0x42f09e);}(_0x60a9,0x1b9));var _0x960a=function(_0x49e7e1,_0x24fe6f){_0x49e7e1=_0x49e7e1-0x0;var _0x125781=_0x60a9[_0x49e7e1];return _0x125781;};'use strict';var _=require(_0x960a('0x0'));var util=require(_0x960a('0x1'));var moment=require(_0x960a('0x2'));var BPromise=require('bluebird');var rs=require(_0x960a('0x3'));var fs=require('fs');var Redis=require(_0x960a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x960a('0x5'));var logger=require(_0x960a('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x960a('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x40ed56,_0x44ef8a,_0x4377ad){return new BPromise(function(_0x4339f6,_0x1b4759){return client[_0x960a('0x8')](_0x40ed56,_0x4377ad)[_0x960a('0x9')](function(_0x5d55e7){logger[_0x960a('0xa')](_0x960a('0xb'),_0x44ef8a,_0x960a('0xc'));logger[_0x960a('0xd')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x44ef8a,_0x960a('0xc'),JSON['stringify'](_0x5d55e7));if(_0x5d55e7['error']){if(_0x5d55e7[_0x960a('0xe')][_0x960a('0xf')]===0x1f4){logger[_0x960a('0xe')](_0x960a('0xb'),_0x44ef8a,_0x5d55e7['error']['message']);return _0x1b4759(_0x5d55e7[_0x960a('0xe')][_0x960a('0x10')]);}logger[_0x960a('0xe')]('FreshdeskAccount,\x20%s,\x20%s',_0x44ef8a,_0x5d55e7['error'][_0x960a('0x10')]);return _0x4339f6(_0x5d55e7['error'][_0x960a('0x10')]);}else{logger['info']('FreshdeskAccount,\x20%s,\x20%s',_0x44ef8a,_0x960a('0xc'));_0x4339f6(_0x5d55e7[_0x960a('0x11')][_0x960a('0x10')]);}})[_0x960a('0x12')](function(_0x86655e){logger[_0x960a('0xe')](_0x960a('0xb'),_0x44ef8a,_0x86655e);_0x1b4759(_0x86655e);});});}exports['GetFreshdeskAccount']=function(_0x9713f7){var _0x4cab09=this;return new Promise(function(_0x18341a,_0x3ca5ac){return db['FreshdeskAccount'][_0x960a('0x13')]({'raw':_0x9713f7[_0x960a('0x14')]?_0x9713f7[_0x960a('0x14')][_0x960a('0x15')]===undefined?!![]:![]:!![],'where':_0x9713f7[_0x960a('0x14')]?_0x9713f7[_0x960a('0x14')][_0x960a('0x16')]||null:null,'attributes':_0x9713f7[_0x960a('0x14')]?_0x9713f7[_0x960a('0x14')]['attributes']||null:null,'limit':_0x9713f7[_0x960a('0x14')]?_0x9713f7[_0x960a('0x14')][_0x960a('0x17')]||null:null,'include':_0x9713f7[_0x960a('0x14')]?_0x9713f7['options'][_0x960a('0x18')]?_[_0x960a('0x19')](_0x9713f7[_0x960a('0x14')][_0x960a('0x18')],function(_0x34a263){return{'model':db[_0x34a263[_0x960a('0x1a')]],'as':_0x34a263['as'],'attributes':_0x34a263['attributes'],'include':_0x34a263[_0x960a('0x18')]?_[_0x960a('0x19')](_0x34a263['include'],function(_0x193ad6){return{'model':db[_0x193ad6[_0x960a('0x1a')]],'as':_0x193ad6['as'],'attributes':_0x193ad6['attributes'],'include':_0x193ad6[_0x960a('0x18')]?_[_0x960a('0x19')](_0x193ad6[_0x960a('0x18')],function(_0x4e3541){return{'model':db[_0x4e3541[_0x960a('0x1a')]],'as':_0x4e3541['as'],'attributes':_0x4e3541[_0x960a('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x960a('0x9')](function(_0x5d9503){logger[_0x960a('0xa')](_0x960a('0x1c'),_0x9713f7);logger[_0x960a('0xd')](_0x960a('0x1c'),_0x9713f7,JSON[_0x960a('0x1d')](_0x5d9503));_0x18341a(_0x5d9503);})[_0x960a('0x12')](function(_0x17cd7f){logger[_0x960a('0xe')](_0x960a('0x1c'),_0x17cd7f[_0x960a('0x10')],_0x9713f7);_0x3ca5ac(_0x4cab09[_0x960a('0xe')](0x1f4,_0x17cd7f[_0x960a('0x10')]));});});};exports[_0x960a('0x1e')]=function(_0x304f14){var _0xaac53f=this;return new Promise(function(_0x4ba20f,_0x596530){return db[_0x960a('0x1f')][_0x960a('0x20')]({'raw':_0x304f14[_0x960a('0x14')]?_0x304f14['options'][_0x960a('0x15')]===undefined?!![]:![]:!![],'where':_0x304f14[_0x960a('0x14')]?_0x304f14['options']['where']||null:null,'attributes':_0x304f14[_0x960a('0x14')]?_0x304f14[_0x960a('0x14')][_0x960a('0x1b')]||null:null,'include':_0x304f14[_0x960a('0x14')]?_0x304f14[_0x960a('0x14')]['include']?_['map'](_0x304f14['options'][_0x960a('0x18')],function(_0x5c1f5c){return{'model':db[_0x5c1f5c[_0x960a('0x1a')]],'as':_0x5c1f5c['as'],'attributes':_0x5c1f5c[_0x960a('0x1b')],'include':_0x5c1f5c[_0x960a('0x18')]?_[_0x960a('0x19')](_0x5c1f5c[_0x960a('0x18')],function(_0x37e535){return{'model':db[_0x37e535['model']],'as':_0x37e535['as'],'attributes':_0x37e535[_0x960a('0x1b')],'include':_0x37e535[_0x960a('0x18')]?_['map'](_0x37e535[_0x960a('0x18')],function(_0x6f0c6f){return{'model':db[_0x6f0c6f['model']],'as':_0x6f0c6f['as'],'attributes':_0x6f0c6f[_0x960a('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4f9c39){logger[_0x960a('0xa')](_0x960a('0x1e'),_0x304f14);logger[_0x960a('0xd')](_0x960a('0x1e'),_0x304f14,JSON[_0x960a('0x1d')](_0x4f9c39));_0x4ba20f(_0x4f9c39);})[_0x960a('0x12')](function(_0x5126b1){logger[_0x960a('0xe')](_0x960a('0x1e'),_0x5126b1[_0x960a('0x10')],_0x304f14);_0x596530(_0xaac53f[_0x960a('0xe')](0x1f4,_0x5126b1[_0x960a('0x10')]));});});}; \ No newline at end of file +var _0x7c91=['error','message','result','catch','GetFreshdeskAccount','findAll','options','raw','where','include','map','model','attributes','stringify','ShowFreshdeskAccount','FreshdeskAccount','find','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2e3934,_0x28cce5){var _0x3c9590=function(_0xe79cc3){while(--_0xe79cc3){_0x2e3934['push'](_0x2e3934['shift']());}};_0x3c9590(++_0x28cce5);}(_0x7c91,0x119));var _0x17c9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7c91[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x17c9('0x0'));var util=require('util');var moment=require(_0x17c9('0x1'));var BPromise=require(_0x17c9('0x2'));var rs=require(_0x17c9('0x3'));var fs=require('fs');var Redis=require(_0x17c9('0x4'));var db=require(_0x17c9('0x5'))['db'];var utils=require(_0x17c9('0x6'));var logger=require('../../config/logger')(_0x17c9('0x7'));var config=require(_0x17c9('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x17c9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4b5030,_0x58ec9e,_0xfbd1d4){return new BPromise(function(_0x4d7861,_0x3285ea){return client[_0x17c9('0xa')](_0x4b5030,_0xfbd1d4)[_0x17c9('0xb')](function(_0x494f97){logger[_0x17c9('0xc')](_0x17c9('0xd'),_0x58ec9e,_0x17c9('0xe'));logger[_0x17c9('0xf')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x58ec9e,_0x17c9('0xe'),JSON['stringify'](_0x494f97));if(_0x494f97[_0x17c9('0x10')]){if(_0x494f97['error']['code']===0x1f4){logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0x58ec9e,_0x494f97[_0x17c9('0x10')][_0x17c9('0x11')]);return _0x3285ea(_0x494f97[_0x17c9('0x10')][_0x17c9('0x11')]);}logger[_0x17c9('0x10')]('FreshdeskAccount,\x20%s,\x20%s',_0x58ec9e,_0x494f97[_0x17c9('0x10')][_0x17c9('0x11')]);return _0x4d7861(_0x494f97[_0x17c9('0x10')][_0x17c9('0x11')]);}else{logger[_0x17c9('0xc')](_0x17c9('0xd'),_0x58ec9e,_0x17c9('0xe'));_0x4d7861(_0x494f97[_0x17c9('0x12')][_0x17c9('0x11')]);}})[_0x17c9('0x13')](function(_0x4d6316){logger['error'](_0x17c9('0xd'),_0x58ec9e,_0x4d6316);_0x3285ea(_0x4d6316);});});}exports[_0x17c9('0x14')]=function(_0xa334ed){var _0x13135c=this;return new Promise(function(_0x5cf765,_0x14235c){return db['FreshdeskAccount'][_0x17c9('0x15')]({'raw':_0xa334ed[_0x17c9('0x16')]?_0xa334ed[_0x17c9('0x16')][_0x17c9('0x17')]===undefined?!![]:![]:!![],'where':_0xa334ed[_0x17c9('0x16')]?_0xa334ed[_0x17c9('0x16')][_0x17c9('0x18')]||null:null,'attributes':_0xa334ed[_0x17c9('0x16')]?_0xa334ed[_0x17c9('0x16')]['attributes']||null:null,'limit':_0xa334ed[_0x17c9('0x16')]?_0xa334ed[_0x17c9('0x16')]['limit']||null:null,'include':_0xa334ed[_0x17c9('0x16')]?_0xa334ed[_0x17c9('0x16')][_0x17c9('0x19')]?_[_0x17c9('0x1a')](_0xa334ed['options'][_0x17c9('0x19')],function(_0x3278df){return{'model':db[_0x3278df[_0x17c9('0x1b')]],'as':_0x3278df['as'],'attributes':_0x3278df[_0x17c9('0x1c')],'include':_0x3278df[_0x17c9('0x19')]?_['map'](_0x3278df[_0x17c9('0x19')],function(_0x146ddc){return{'model':db[_0x146ddc['model']],'as':_0x146ddc['as'],'attributes':_0x146ddc[_0x17c9('0x1c')],'include':_0x146ddc[_0x17c9('0x19')]?_[_0x17c9('0x1a')](_0x146ddc[_0x17c9('0x19')],function(_0x4a0cd1){return{'model':db[_0x4a0cd1[_0x17c9('0x1b')]],'as':_0x4a0cd1['as'],'attributes':_0x4a0cd1[_0x17c9('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x487637){logger[_0x17c9('0xc')](_0x17c9('0x14'),_0xa334ed);logger[_0x17c9('0xf')]('GetFreshdeskAccount',_0xa334ed,JSON[_0x17c9('0x1d')](_0x487637));_0x5cf765(_0x487637);})[_0x17c9('0x13')](function(_0x52b513){logger[_0x17c9('0x10')]('GetFreshdeskAccount',_0x52b513[_0x17c9('0x11')],_0xa334ed);_0x14235c(_0x13135c[_0x17c9('0x10')](0x1f4,_0x52b513[_0x17c9('0x11')]));});});};exports[_0x17c9('0x1e')]=function(_0x299595){var _0x45d3cf=this;return new Promise(function(_0x200736,_0x45c235){return db[_0x17c9('0x1f')][_0x17c9('0x20')]({'raw':_0x299595[_0x17c9('0x16')]?_0x299595[_0x17c9('0x16')][_0x17c9('0x17')]===undefined?!![]:![]:!![],'where':_0x299595['options']?_0x299595['options'][_0x17c9('0x18')]||null:null,'attributes':_0x299595[_0x17c9('0x16')]?_0x299595[_0x17c9('0x16')][_0x17c9('0x1c')]||null:null,'include':_0x299595['options']?_0x299595[_0x17c9('0x16')][_0x17c9('0x19')]?_[_0x17c9('0x1a')](_0x299595['options'][_0x17c9('0x19')],function(_0x87a9a5){return{'model':db[_0x87a9a5[_0x17c9('0x1b')]],'as':_0x87a9a5['as'],'attributes':_0x87a9a5[_0x17c9('0x1c')],'include':_0x87a9a5[_0x17c9('0x19')]?_[_0x17c9('0x1a')](_0x87a9a5['include'],function(_0x29c646){return{'model':db[_0x29c646[_0x17c9('0x1b')]],'as':_0x29c646['as'],'attributes':_0x29c646[_0x17c9('0x1c')],'include':_0x29c646[_0x17c9('0x19')]?_[_0x17c9('0x1a')](_0x29c646[_0x17c9('0x19')],function(_0x412193){return{'model':db[_0x412193['model']],'as':_0x412193['as'],'attributes':_0x412193['attributes']};}):[]};}):[]};}):[]:[]})[_0x17c9('0xb')](function(_0x234afc){logger[_0x17c9('0xc')](_0x17c9('0x1e'),_0x299595);logger[_0x17c9('0xf')](_0x17c9('0x1e'),_0x299595,JSON['stringify'](_0x234afc));_0x200736(_0x234afc);})[_0x17c9('0x13')](function(_0x3a2645){logger[_0x17c9('0x10')]('ShowFreshdeskAccount',_0x3a2645[_0x17c9('0x11')],_0x299595);_0x45c235(_0x45d3cf[_0x17c9('0x10')](0x1f4,_0x3a2645[_0x17c9('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index c954d9c..5c72f6a 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 _0xb135=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','create','post','put','update','delete','destroy','exports','util','connect-timeout','Router'];(function(_0x4c1e64,_0x41ddc2){var _0x58c93c=function(_0x34b0dd){while(--_0x34b0dd){_0x4c1e64['push'](_0x4c1e64['shift']());}};_0x58c93c(++_0x41ddc2);}(_0xb135,0x14d));var _0x5b13=function(_0x3c9d97,_0x43de04){_0x3c9d97=_0x3c9d97-0x0;var _0x21b4eb=_0xb135[_0x3c9d97];return _0x21b4eb;};'use strict';var multer=require('multer');var util=require(_0x5b13('0x0'));var path=require('path');var timeout=require(_0x5b13('0x1'));var express=require('express');var router=express[_0x5b13('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x5b13('0x3'));var interaction=require(_0x5b13('0x4'));var config=require(_0x5b13('0x5'));var controller=require('./intFreshdeskConfiguration.controller');router[_0x5b13('0x6')]('/',auth[_0x5b13('0x7')](),controller['index']);router[_0x5b13('0x6')](_0x5b13('0x8'),auth[_0x5b13('0x7')](),controller['show']);router[_0x5b13('0x6')](_0x5b13('0x9'),auth[_0x5b13('0x7')](),controller[_0x5b13('0xa')]);router[_0x5b13('0x6')](_0x5b13('0xb'),auth[_0x5b13('0x7')](),controller[_0x5b13('0xc')]);router['get'](_0x5b13('0xd'),auth[_0x5b13('0x7')](),controller[_0x5b13('0xe')]);router[_0x5b13('0x6')](_0x5b13('0xf'),auth['isAuthenticated'](),controller[_0x5b13('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x5b13('0x11')]);router[_0x5b13('0x12')](_0x5b13('0xf'),auth[_0x5b13('0x7')](),controller['setTags']);router[_0x5b13('0x13')](_0x5b13('0x8'),auth[_0x5b13('0x7')](),controller[_0x5b13('0x14')]);router[_0x5b13('0x15')](_0x5b13('0x8'),auth[_0x5b13('0x7')](),controller[_0x5b13('0x16')]);module[_0x5b13('0x17')]=router; \ No newline at end of file +var _0xa65b=['show','getFields','/:id/subjects','/:id/tags','getTags','setTags','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','/:id'];(function(_0x16c4ef,_0x22724c){var _0x26a684=function(_0x1ec512){while(--_0x1ec512){_0x16c4ef['push'](_0x16c4ef['shift']());}};_0x26a684(++_0x22724c);}(_0xa65b,0x1cc));var _0xba65=function(_0x4bc778,_0x22d8b5){_0x4bc778=_0x4bc778-0x0;var _0x2c8c60=_0xa65b[_0x4bc778];return _0x2c8c60;};'use strict';var multer=require(_0xba65('0x0'));var util=require(_0xba65('0x1'));var path=require(_0xba65('0x2'));var timeout=require(_0xba65('0x3'));var express=require(_0xba65('0x4'));var router=express[_0xba65('0x5')]();var fs_extra=require(_0xba65('0x6'));var auth=require(_0xba65('0x7'));var interaction=require(_0xba65('0x8'));var config=require(_0xba65('0x9'));var controller=require(_0xba65('0xa'));router[_0xba65('0xb')]('/',auth[_0xba65('0xc')](),controller[_0xba65('0xd')]);router['get'](_0xba65('0xe'),auth[_0xba65('0xc')](),controller[_0xba65('0xf')]);router[_0xba65('0xb')]('/:id/fields',auth['isAuthenticated'](),controller[_0xba65('0x10')]);router['get'](_0xba65('0x11'),auth[_0xba65('0xc')](),controller['getSubjects']);router['get']('/:id/descriptions',auth[_0xba65('0xc')](),controller['getDescriptions']);router[_0xba65('0xb')](_0xba65('0x12'),auth['isAuthenticated'](),controller[_0xba65('0x13')]);router['post']('/',auth[_0xba65('0xc')](),controller['create']);router['post']('/:id/tags',auth[_0xba65('0xc')](),controller[_0xba65('0x14')]);router[_0xba65('0x15')](_0xba65('0xe'),auth[_0xba65('0xc')](),controller[_0xba65('0x16')]);router[_0xba65('0x17')](_0xba65('0xe'),auth['isAuthenticated'](),controller[_0xba65('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index f157118..e1d87d8 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 _0xbe60=['sequelize','exports','STRING'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0xbe60,0x1b3));var _0x0be6=function(_0x19ca1e,_0x385dc7){_0x19ca1e=_0x19ca1e-0x0;var _0x40a86=_0xbe60[_0x19ca1e];return _0x40a86;};'use strict';var Sequelize=require(_0x0be6('0x0'));module[_0x0be6('0x1')]={'name':{'type':Sequelize[_0x0be6('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa38b=['STRING','exports'];(function(_0x7322ec,_0x20d9d1){var _0x606b8b=function(_0x4b5887){while(--_0x4b5887){_0x7322ec['push'](_0x7322ec['shift']());}};_0x606b8b(++_0x20d9d1);}(_0xa38b,0x69));var _0xba38=function(_0x3b5ca7,_0x95c2b9){_0x3b5ca7=_0x3b5ca7-0x0;var _0xd39672=_0xa38b[_0x3b5ca7];return _0xd39672;};'use strict';var Sequelize=require('sequelize');module[_0xba38('0x0')]={'name':{'type':Sequelize[_0xba38('0x1')]},'description':{'type':Sequelize[_0xba38('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index fa2cbe4..fda4ada 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 _0xc159=['pick','getSubjects','getDescriptions','Tag','getTags','setTags','ids','eml-format','rimraf','fast-json-patch','request-promise','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','save','then','destroy','error','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','FreshdeskConfiguration','includeAll','rows','catch','show','merge','options','create','body','find','getFields','findOne','params','FreshdeskField'];(function(_0xf51c06,_0x388e5b){var _0x1d5420=function(_0x5e077b){while(--_0x5e077b){_0xf51c06['push'](_0xf51c06['shift']());}};_0x1d5420(++_0x388e5b);}(_0xc159,0x13b));var _0x9c15=function(_0x3df3c6,_0x496e1a){_0x3df3c6=_0x3df3c6-0x0;var _0x254c43=_0xc159[_0x3df3c6];return _0x254c43;};'use strict';var emlformat=require(_0x9c15('0x0'));var rimraf=require(_0x9c15('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9c15('0x2'));var rp=require(_0x9c15('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x9c15('0x4'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9c15('0x5'));var _=require(_0x9c15('0x6'));var squel=require('squel');var crypto=require(_0x9c15('0x7'));var jsforce=require(_0x9c15('0x8'));var deskjs=require(_0x9c15('0x9'));var toCsv=require(_0x9c15('0x4'));var querystring=require('querystring');var Papa=require(_0x9c15('0xa'));var Redis=require('ioredis');var authService=require(_0x9c15('0xb'));var qs=require(_0x9c15('0xc'));var as=require(_0x9c15('0xd'));var hardwareService=require(_0x9c15('0xe'));var logger=require(_0x9c15('0xf'))(_0x9c15('0x10'));var utils=require('../../config/utils');var config=require(_0x9c15('0x11'));var licenseUtil=require(_0x9c15('0x12'));var db=require(_0x9c15('0x13'))['db'];function respondWithStatusCode(_0x2eb99,_0x5da264){_0x5da264=_0x5da264||0xcc;return function(_0x3e6910){if(_0x3e6910){return _0x2eb99[_0x9c15('0x14')](_0x5da264);}return _0x2eb99[_0x9c15('0x15')](_0x5da264)[_0x9c15('0x16')]();};}function respondWithResult(_0x432736,_0x451e87){_0x451e87=_0x451e87||0xc8;return function(_0x40bfd3){if(_0x40bfd3){return _0x432736['status'](_0x451e87)['json'](_0x40bfd3);}};}function respondWithFilteredResult(_0x33238f,_0x289d36){return function(_0x4bfce4){if(_0x4bfce4){var _0x463bf5=typeof _0x289d36[_0x9c15('0x17')]==='undefined'&&typeof _0x289d36[_0x9c15('0x18')]===_0x9c15('0x19');var _0x572b07=_0x4bfce4['count'];var _0x7ccf01=_0x463bf5?0x0:_0x289d36[_0x9c15('0x17')];var _0x6b02bb=_0x463bf5?_0x4bfce4[_0x9c15('0x1a')]:_0x289d36[_0x9c15('0x17')]+_0x289d36['limit'];var _0x360500;if(_0x6b02bb>=_0x572b07){_0x6b02bb=_0x572b07;_0x360500=0xc8;}else{_0x360500=0xce;}_0x33238f['status'](_0x360500);return _0x33238f[_0x9c15('0x1b')](_0x9c15('0x1c'),_0x7ccf01+'-'+_0x6b02bb+'/'+_0x572b07)[_0x9c15('0x1d')](_0x4bfce4);}return null;};}function patchUpdates(_0x104ec3){return function(_0x5aa65b){try{jsonpatch['apply'](_0x5aa65b,_0x104ec3,!![]);}catch(_0x177204){return BPromise['reject'](_0x177204);}return _0x5aa65b[_0x9c15('0x1e')]();};}function saveUpdates(_0x23d782,_0x6fc768){return function(_0x48aa56){if(_0x48aa56){return _0x48aa56['update'](_0x23d782)[_0x9c15('0x1f')](function(_0x38438a){return _0x38438a;});}return null;};}function removeEntity(_0x503f72,_0x1d367f){return function(_0x2adbb9){if(_0x2adbb9){return _0x2adbb9[_0x9c15('0x20')]()[_0x9c15('0x1f')](function(){_0x503f72[_0x9c15('0x15')](0xcc)[_0x9c15('0x16')]();});}};}function handleEntityNotFound(_0x2222bb,_0x340204){return function(_0x3ad91f){if(!_0x3ad91f){_0x2222bb[_0x9c15('0x14')](0x194);}return _0x3ad91f;};}function handleError(_0x548f43,_0x4cc57c){_0x4cc57c=_0x4cc57c||0x1f4;return function(_0x304e1a){logger[_0x9c15('0x21')](_0x304e1a['stack']);if(_0x304e1a[_0x9c15('0x22')]){delete _0x304e1a[_0x9c15('0x22')];}_0x548f43[_0x9c15('0x15')](_0x4cc57c)[_0x9c15('0x23')](_0x304e1a);};}exports[_0x9c15('0x24')]=function(_0x5b4c7c,_0xfb0a23){var _0x23002d={},_0x5bea51={},_0x1158fb={'count':0x0,'rows':[]};var _0x20087f=_[_0x9c15('0x25')](db['FreshdeskConfiguration'][_0x9c15('0x26')],function(_0x59a62d){return{'name':_0x59a62d['fieldName'],'type':_0x59a62d[_0x9c15('0x27')][_0x9c15('0x28')]};});_0x5bea51[_0x9c15('0x29')]=_['map'](_0x20087f,_0x9c15('0x22'));_0x5bea51[_0x9c15('0x2a')]=_[_0x9c15('0x2b')](_0x5b4c7c[_0x9c15('0x2a')]);_0x5bea51[_0x9c15('0x2c')]=_['intersection'](_0x5bea51['model'],_0x5bea51[_0x9c15('0x2a')]);_0x23002d[_0x9c15('0x2d')]=_[_0x9c15('0x2e')](_0x5bea51[_0x9c15('0x29')],qs['fields'](_0x5b4c7c['query'][_0x9c15('0x2f')]));_0x23002d[_0x9c15('0x2d')]=_0x23002d[_0x9c15('0x2d')][_0x9c15('0x30')]?_0x23002d[_0x9c15('0x2d')]:_0x5bea51['model'];if(!_0x5b4c7c[_0x9c15('0x2a')][_0x9c15('0x31')](_0x9c15('0x32'))){_0x23002d['limit']=qs[_0x9c15('0x18')](_0x5b4c7c[_0x9c15('0x2a')][_0x9c15('0x18')]);_0x23002d[_0x9c15('0x17')]=qs[_0x9c15('0x17')](_0x5b4c7c['query'][_0x9c15('0x17')]);}_0x23002d[_0x9c15('0x33')]=qs[_0x9c15('0x34')](_0x5b4c7c['query'][_0x9c15('0x34')]);_0x23002d[_0x9c15('0x35')]=qs[_0x9c15('0x2c')](_['pick'](_0x5b4c7c[_0x9c15('0x2a')],_0x5bea51[_0x9c15('0x2c')]),_0x20087f);if(_0x5b4c7c[_0x9c15('0x2a')][_0x9c15('0x36')]){_0x23002d[_0x9c15('0x35')]=_['merge'](_0x23002d[_0x9c15('0x35')],{'$or':_[_0x9c15('0x25')](_0x20087f,function(_0x2ffbb1){if(_0x2ffbb1[_0x9c15('0x27')]!==_0x9c15('0x37')){var _0x5000ab={};_0x5000ab[_0x2ffbb1[_0x9c15('0x22')]]={'$like':'%'+_0x5b4c7c[_0x9c15('0x2a')][_0x9c15('0x36')]+'%'};return _0x5000ab;}})});}_0x23002d=_['merge']({},_0x23002d,_0x5b4c7c['options']);var _0x42b555={'where':_0x23002d[_0x9c15('0x35')]};return db[_0x9c15('0x38')][_0x9c15('0x1a')](_0x42b555)[_0x9c15('0x1f')](function(_0x554939){_0x1158fb['count']=_0x554939;if(_0x5b4c7c['query'][_0x9c15('0x39')]){_0x23002d['include']=[{'all':!![]}];}return db[_0x9c15('0x38')]['findAll'](_0x23002d);})[_0x9c15('0x1f')](function(_0xd7e8b){_0x1158fb[_0x9c15('0x3a')]=_0xd7e8b;return _0x1158fb;})[_0x9c15('0x1f')](respondWithFilteredResult(_0xfb0a23,_0x23002d))[_0x9c15('0x3b')](handleError(_0xfb0a23,null));};exports[_0x9c15('0x3c')]=function(_0x5d768d,_0x75a76){var _0x482a77={'raw':![],'where':{'id':_0x5d768d['params']['id']}},_0x1b8017={};_0x1b8017[_0x9c15('0x29')]=_[_0x9c15('0x2b')](db[_0x9c15('0x38')][_0x9c15('0x26')]);_0x1b8017[_0x9c15('0x2a')]=_[_0x9c15('0x2b')](_0x5d768d['query']);_0x1b8017['filters']=_['intersection'](_0x1b8017[_0x9c15('0x29')],_0x1b8017[_0x9c15('0x2a')]);_0x482a77[_0x9c15('0x2d')]=_[_0x9c15('0x2e')](_0x1b8017[_0x9c15('0x29')],qs['fields'](_0x5d768d['query'][_0x9c15('0x2f')]));_0x482a77[_0x9c15('0x2d')]=_0x482a77[_0x9c15('0x2d')][_0x9c15('0x30')]?_0x482a77[_0x9c15('0x2d')]:_0x1b8017[_0x9c15('0x29')];if(_0x5d768d[_0x9c15('0x2a')][_0x9c15('0x39')]){_0x482a77['include']=[{'all':!![]}];}_0x482a77=_[_0x9c15('0x3d')]({},_0x482a77,_0x5d768d[_0x9c15('0x3e')]);return db[_0x9c15('0x38')]['find'](_0x482a77)[_0x9c15('0x1f')](handleEntityNotFound(_0x75a76,null))['then'](respondWithResult(_0x75a76,null))[_0x9c15('0x3b')](handleError(_0x75a76,null));};exports[_0x9c15('0x3f')]=function(_0x29d53c,_0x1cea17){return db['FreshdeskConfiguration']['create'](_0x29d53c[_0x9c15('0x40')],{})[_0x9c15('0x1f')](respondWithResult(_0x1cea17,0xc9))['catch'](handleError(_0x1cea17,null));};exports['update']=function(_0x48ec6d,_0x2ce295){if(_0x48ec6d['body']['id']){delete _0x48ec6d['body']['id'];}return db['FreshdeskConfiguration']['find']({'where':{'id':_0x48ec6d['params']['id']}})[_0x9c15('0x1f')](handleEntityNotFound(_0x2ce295,null))['then'](saveUpdates(_0x48ec6d[_0x9c15('0x40')],null))[_0x9c15('0x1f')](respondWithResult(_0x2ce295,null))[_0x9c15('0x3b')](handleError(_0x2ce295,null));};exports[_0x9c15('0x20')]=function(_0xace787,_0x5a349c){return db[_0x9c15('0x38')][_0x9c15('0x41')]({'where':{'id':_0xace787['params']['id']}})[_0x9c15('0x1f')](handleEntityNotFound(_0x5a349c,null))[_0x9c15('0x1f')](removeEntity(_0x5a349c,null))[_0x9c15('0x3b')](handleError(_0x5a349c,null));};exports[_0x9c15('0x42')]=function(_0x2bee6e,_0x180ad9,_0x4191a0){var _0x3d81ae={};var _0x371f9c={};var _0x39ce96;var _0xc1bc1b;return db[_0x9c15('0x38')][_0x9c15('0x43')]({'where':{'id':_0x2bee6e[_0x9c15('0x44')]['id']}})[_0x9c15('0x1f')](handleEntityNotFound(_0x180ad9,null))[_0x9c15('0x1f')](function(_0x1a7c46){if(_0x1a7c46){_0x39ce96=_0x1a7c46;_0x371f9c[_0x9c15('0x29')]=_[_0x9c15('0x2b')](db[_0x9c15('0x45')][_0x9c15('0x26')]);_0x371f9c[_0x9c15('0x2a')]=_[_0x9c15('0x2b')](_0x2bee6e[_0x9c15('0x2a')]);_0x371f9c[_0x9c15('0x2c')]=_[_0x9c15('0x2e')](_0x371f9c[_0x9c15('0x29')],_0x371f9c[_0x9c15('0x2a')]);_0x3d81ae[_0x9c15('0x2d')]=_['intersection'](_0x371f9c[_0x9c15('0x29')],qs[_0x9c15('0x2f')](_0x2bee6e[_0x9c15('0x2a')][_0x9c15('0x2f')]));_0x3d81ae[_0x9c15('0x2d')]=_0x3d81ae[_0x9c15('0x2d')]['length']?_0x3d81ae[_0x9c15('0x2d')]:_0x371f9c['model'];_0x3d81ae[_0x9c15('0x33')]=qs[_0x9c15('0x34')](_0x2bee6e[_0x9c15('0x2a')]['sort']);_0x3d81ae['where']=qs[_0x9c15('0x2c')](_[_0x9c15('0x46')](_0x2bee6e['query'],_0x371f9c[_0x9c15('0x2c')]));if(_0x2bee6e[_0x9c15('0x2a')][_0x9c15('0x36')]){_0x3d81ae['where']=_['merge'](_0x3d81ae[_0x9c15('0x35')],{'$or':_[_0x9c15('0x25')](_0x3d81ae[_0x9c15('0x2d')],function(_0x379bbd){var _0x26aa79={};_0x26aa79[_0x379bbd]={'$like':'%'+_0x2bee6e[_0x9c15('0x2a')]['filter']+'%'};return _0x26aa79;})});}_0x3d81ae=_[_0x9c15('0x3d')]({},_0x3d81ae,_0x2bee6e[_0x9c15('0x3e')]);return _0x39ce96[_0x9c15('0x42')](_0x3d81ae);}})[_0x9c15('0x1f')](function(_0x28bf64){if(_0x28bf64){_0xc1bc1b=_0x28bf64['length'];if(!_0x2bee6e[_0x9c15('0x2a')][_0x9c15('0x31')](_0x9c15('0x32'))){_0x3d81ae[_0x9c15('0x18')]=qs['limit'](_0x2bee6e[_0x9c15('0x2a')]['limit']);_0x3d81ae[_0x9c15('0x17')]=qs[_0x9c15('0x17')](_0x2bee6e[_0x9c15('0x2a')][_0x9c15('0x17')]);}return _0x39ce96[_0x9c15('0x42')](_0x3d81ae);}})[_0x9c15('0x1f')](function(_0x258d14){if(_0x258d14){return _0x258d14?{'count':_0xc1bc1b,'rows':_0x258d14}:null;}})[_0x9c15('0x1f')](respondWithResult(_0x180ad9,null))[_0x9c15('0x3b')](handleError(_0x180ad9,null));};exports[_0x9c15('0x47')]=function(_0x3f8505,_0x39d6ce,_0x1a1cdc){var _0x28cc2f={};var _0x53008d={};var _0x4ce7fc;var _0xbb8c22;return db[_0x9c15('0x38')]['findOne']({'where':{'id':_0x3f8505['params']['id']}})[_0x9c15('0x1f')](handleEntityNotFound(_0x39d6ce,null))[_0x9c15('0x1f')](function(_0x40aa58){if(_0x40aa58){_0x4ce7fc=_0x40aa58;_0x53008d['model']=_[_0x9c15('0x2b')](db[_0x9c15('0x45')][_0x9c15('0x26')]);_0x53008d[_0x9c15('0x2a')]=_[_0x9c15('0x2b')](_0x3f8505[_0x9c15('0x2a')]);_0x53008d[_0x9c15('0x2c')]=_[_0x9c15('0x2e')](_0x53008d[_0x9c15('0x29')],_0x53008d['query']);_0x28cc2f[_0x9c15('0x2d')]=_[_0x9c15('0x2e')](_0x53008d[_0x9c15('0x29')],qs[_0x9c15('0x2f')](_0x3f8505[_0x9c15('0x2a')][_0x9c15('0x2f')]));_0x28cc2f[_0x9c15('0x2d')]=_0x28cc2f[_0x9c15('0x2d')][_0x9c15('0x30')]?_0x28cc2f[_0x9c15('0x2d')]:_0x53008d[_0x9c15('0x29')];_0x28cc2f[_0x9c15('0x33')]=qs[_0x9c15('0x34')](_0x3f8505[_0x9c15('0x2a')][_0x9c15('0x34')]);_0x28cc2f[_0x9c15('0x35')]=qs[_0x9c15('0x2c')](_[_0x9c15('0x46')](_0x3f8505[_0x9c15('0x2a')],_0x53008d['filters']));if(_0x3f8505[_0x9c15('0x2a')]['filter']){_0x28cc2f['where']=_[_0x9c15('0x3d')](_0x28cc2f[_0x9c15('0x35')],{'$or':_[_0x9c15('0x25')](_0x28cc2f[_0x9c15('0x2d')],function(_0x57fd59){var _0x194e1e={};_0x194e1e[_0x57fd59]={'$like':'%'+_0x3f8505[_0x9c15('0x2a')][_0x9c15('0x36')]+'%'};return _0x194e1e;})});}_0x28cc2f=_[_0x9c15('0x3d')]({},_0x28cc2f,_0x3f8505['options']);return _0x4ce7fc[_0x9c15('0x47')](_0x28cc2f);}})[_0x9c15('0x1f')](function(_0x9911e8){if(_0x9911e8){_0xbb8c22=_0x9911e8[_0x9c15('0x30')];if(!_0x3f8505[_0x9c15('0x2a')]['hasOwnProperty']('nolimit')){_0x28cc2f[_0x9c15('0x18')]=qs['limit'](_0x3f8505[_0x9c15('0x2a')][_0x9c15('0x18')]);_0x28cc2f[_0x9c15('0x17')]=qs[_0x9c15('0x17')](_0x3f8505['query'][_0x9c15('0x17')]);}return _0x4ce7fc[_0x9c15('0x47')](_0x28cc2f);}})[_0x9c15('0x1f')](function(_0x5869de){if(_0x5869de){return _0x5869de?{'count':_0xbb8c22,'rows':_0x5869de}:null;}})[_0x9c15('0x1f')](respondWithResult(_0x39d6ce,null))[_0x9c15('0x3b')](handleError(_0x39d6ce,null));};exports[_0x9c15('0x48')]=function(_0x5e1e6a,_0x413fa3,_0x2635e9){var _0x2f560f={};var _0x1c8bad={};var _0x4a3c7f;var _0x3a5081;return db[_0x9c15('0x38')][_0x9c15('0x43')]({'where':{'id':_0x5e1e6a['params']['id']}})['then'](handleEntityNotFound(_0x413fa3,null))[_0x9c15('0x1f')](function(_0x2199fc){if(_0x2199fc){_0x4a3c7f=_0x2199fc;_0x1c8bad['model']=_['keys'](db[_0x9c15('0x45')][_0x9c15('0x26')]);_0x1c8bad[_0x9c15('0x2a')]=_[_0x9c15('0x2b')](_0x5e1e6a[_0x9c15('0x2a')]);_0x1c8bad[_0x9c15('0x2c')]=_[_0x9c15('0x2e')](_0x1c8bad[_0x9c15('0x29')],_0x1c8bad[_0x9c15('0x2a')]);_0x2f560f[_0x9c15('0x2d')]=_[_0x9c15('0x2e')](_0x1c8bad[_0x9c15('0x29')],qs['fields'](_0x5e1e6a[_0x9c15('0x2a')][_0x9c15('0x2f')]));_0x2f560f[_0x9c15('0x2d')]=_0x2f560f[_0x9c15('0x2d')][_0x9c15('0x30')]?_0x2f560f[_0x9c15('0x2d')]:_0x1c8bad[_0x9c15('0x29')];_0x2f560f[_0x9c15('0x33')]=qs[_0x9c15('0x34')](_0x5e1e6a[_0x9c15('0x2a')][_0x9c15('0x34')]);_0x2f560f[_0x9c15('0x35')]=qs[_0x9c15('0x2c')](_['pick'](_0x5e1e6a['query'],_0x1c8bad['filters']));if(_0x5e1e6a[_0x9c15('0x2a')][_0x9c15('0x36')]){_0x2f560f['where']=_[_0x9c15('0x3d')](_0x2f560f[_0x9c15('0x35')],{'$or':_[_0x9c15('0x25')](_0x2f560f[_0x9c15('0x2d')],function(_0x3bf6ef){var _0x1a6f65={};_0x1a6f65[_0x3bf6ef]={'$like':'%'+_0x5e1e6a[_0x9c15('0x2a')]['filter']+'%'};return _0x1a6f65;})});}_0x2f560f=_[_0x9c15('0x3d')]({},_0x2f560f,_0x5e1e6a[_0x9c15('0x3e')]);return _0x4a3c7f['getDescriptions'](_0x2f560f);}})[_0x9c15('0x1f')](function(_0x3d72a6){if(_0x3d72a6){_0x3a5081=_0x3d72a6['length'];if(!_0x5e1e6a[_0x9c15('0x2a')][_0x9c15('0x31')](_0x9c15('0x32'))){_0x2f560f[_0x9c15('0x18')]=qs[_0x9c15('0x18')](_0x5e1e6a[_0x9c15('0x2a')][_0x9c15('0x18')]);_0x2f560f[_0x9c15('0x17')]=qs[_0x9c15('0x17')](_0x5e1e6a[_0x9c15('0x2a')][_0x9c15('0x17')]);}return _0x4a3c7f[_0x9c15('0x48')](_0x2f560f);}})['then'](function(_0x33048d){if(_0x33048d){return _0x33048d?{'count':_0x3a5081,'rows':_0x33048d}:null;}})[_0x9c15('0x1f')](respondWithResult(_0x413fa3,null))['catch'](handleError(_0x413fa3,null));};exports['getTags']=function(_0x16a8b1,_0x5dba5c,_0x3c1c65){var _0x10ce53={};var _0x1f478e={};var _0x549c8e;var _0x168a18;return db['FreshdeskConfiguration'][_0x9c15('0x43')]({'where':{'id':_0x16a8b1['params']['id']}})[_0x9c15('0x1f')](handleEntityNotFound(_0x5dba5c,null))['then'](function(_0x1e7b98){if(_0x1e7b98){_0x549c8e=_0x1e7b98;_0x1f478e[_0x9c15('0x29')]=_['keys'](db[_0x9c15('0x49')][_0x9c15('0x26')]);_0x1f478e[_0x9c15('0x2a')]=_[_0x9c15('0x2b')](_0x16a8b1[_0x9c15('0x2a')]);_0x1f478e['filters']=_[_0x9c15('0x2e')](_0x1f478e['model'],_0x1f478e[_0x9c15('0x2a')]);_0x10ce53[_0x9c15('0x2d')]=_[_0x9c15('0x2e')](_0x1f478e['model'],qs[_0x9c15('0x2f')](_0x16a8b1[_0x9c15('0x2a')][_0x9c15('0x2f')]));_0x10ce53['attributes']=_0x10ce53[_0x9c15('0x2d')][_0x9c15('0x30')]?_0x10ce53[_0x9c15('0x2d')]:_0x1f478e[_0x9c15('0x29')];_0x10ce53[_0x9c15('0x33')]=qs['sort'](_0x16a8b1['query']['sort']);_0x10ce53[_0x9c15('0x35')]=qs[_0x9c15('0x2c')](_[_0x9c15('0x46')](_0x16a8b1['query'],_0x1f478e['filters']));if(_0x16a8b1[_0x9c15('0x2a')][_0x9c15('0x36')]){_0x10ce53[_0x9c15('0x35')]=_[_0x9c15('0x3d')](_0x10ce53[_0x9c15('0x35')],{'$or':_[_0x9c15('0x25')](_0x10ce53[_0x9c15('0x2d')],function(_0x63a888){var _0x2c3aba={};_0x2c3aba[_0x63a888]={'$like':'%'+_0x16a8b1[_0x9c15('0x2a')][_0x9c15('0x36')]+'%'};return _0x2c3aba;})});}_0x10ce53=_[_0x9c15('0x3d')]({},_0x10ce53,_0x16a8b1[_0x9c15('0x3e')]);return _0x549c8e[_0x9c15('0x4a')](_0x10ce53);}})[_0x9c15('0x1f')](function(_0x57df32){if(_0x57df32){_0x168a18=_0x57df32[_0x9c15('0x30')];if(!_0x16a8b1[_0x9c15('0x2a')]['hasOwnProperty'](_0x9c15('0x32'))){_0x10ce53[_0x9c15('0x18')]=qs['limit'](_0x16a8b1[_0x9c15('0x2a')][_0x9c15('0x18')]);_0x10ce53['offset']=qs[_0x9c15('0x17')](_0x16a8b1['query'][_0x9c15('0x17')]);}return _0x549c8e['getTags'](_0x10ce53);}})['then'](function(_0x712bcd){if(_0x712bcd){return _0x712bcd?{'count':_0x168a18,'rows':_0x712bcd}:null;}})[_0x9c15('0x1f')](respondWithResult(_0x5dba5c,null))['catch'](handleError(_0x5dba5c,null));};exports['setTags']=function(_0x4a13a1,_0x409807,_0x2c7b3b){if(_0x4a13a1[_0x9c15('0x40')]['id']){delete _0x4a13a1[_0x9c15('0x40')]['id'];}return db['FreshdeskConfiguration'][_0x9c15('0x43')]({'where':{'id':_0x4a13a1[_0x9c15('0x44')]['id']}})['then'](handleEntityNotFound(_0x409807,null))['then'](function(_0x44199f){if(_0x44199f){return _0x44199f[_0x9c15('0x4b')](_0x4a13a1[_0x9c15('0x40')][_0x9c15('0x4c')]||[]);}return null;})[_0x9c15('0x1f')](respondWithResult(_0x409807,null))[_0x9c15('0x3b')](handleError(_0x409807,null));}; \ No newline at end of file +var _0x5093=['FreshdeskField','pick','getSubjects','nolimit','getDescriptions','getTags','findOne','Tag','ids','eml-format','zip-dir','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','count','limit','set','apply','reject','save','then','destroy','stack','name','index','map','FreshdeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','length','includeAll','find','create','body','update','getFields','order'];(function(_0x26df9c,_0x471823){var _0x3d2195=function(_0x35d1ed){while(--_0x35d1ed){_0x26df9c['push'](_0x26df9c['shift']());}};_0x3d2195(++_0x471823);}(_0x5093,0x13d));var _0x3509=function(_0xf3f1ed,_0x57e63e){_0xf3f1ed=_0xf3f1ed-0x0;var _0x3f5837=_0x5093[_0xf3f1ed];return _0x3f5837;};'use strict';var emlformat=require(_0x3509('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3509('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3509('0x2'));var path=require(_0x3509('0x3'));var sox=require(_0x3509('0x4'));var csv=require(_0x3509('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3509('0x6'));var _=require(_0x3509('0x7'));var squel=require('squel');var crypto=require(_0x3509('0x8'));var jsforce=require(_0x3509('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x3509('0x5'));var querystring=require(_0x3509('0xa'));var Papa=require('papaparse');var Redis=require(_0x3509('0xb'));var authService=require(_0x3509('0xc'));var qs=require(_0x3509('0xd'));var as=require(_0x3509('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x3509('0xf'));var licenseUtil=require(_0x3509('0x10'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x43fee6,_0x5c67c2){_0x5c67c2=_0x5c67c2||0xcc;return function(_0x2c31fb){if(_0x2c31fb){return _0x43fee6[_0x3509('0x11')](_0x5c67c2);}return _0x43fee6['status'](_0x5c67c2)[_0x3509('0x12')]();};}function respondWithResult(_0xc2a14,_0xa10e31){_0xa10e31=_0xa10e31||0xc8;return function(_0x2ed570){if(_0x2ed570){return _0xc2a14[_0x3509('0x13')](_0xa10e31)[_0x3509('0x14')](_0x2ed570);}};}function respondWithFilteredResult(_0x4ea41c,_0x25595b){return function(_0x400d10){if(_0x400d10){var _0x52d250=typeof _0x25595b[_0x3509('0x15')]===_0x3509('0x16')&&typeof _0x25595b['limit']==='undefined';var _0x27556e=_0x400d10[_0x3509('0x17')];var _0x6f6ef2=_0x52d250?0x0:_0x25595b['offset'];var _0x437455=_0x52d250?_0x400d10[_0x3509('0x17')]:_0x25595b[_0x3509('0x15')]+_0x25595b[_0x3509('0x18')];var _0x3ee8d2;if(_0x437455>=_0x27556e){_0x437455=_0x27556e;_0x3ee8d2=0xc8;}else{_0x3ee8d2=0xce;}_0x4ea41c[_0x3509('0x13')](_0x3ee8d2);return _0x4ea41c[_0x3509('0x19')]('Content-Range',_0x6f6ef2+'-'+_0x437455+'/'+_0x27556e)[_0x3509('0x14')](_0x400d10);}return null;};}function patchUpdates(_0x25db22){return function(_0x1a4a72){try{jsonpatch[_0x3509('0x1a')](_0x1a4a72,_0x25db22,!![]);}catch(_0x5d9a83){return BPromise[_0x3509('0x1b')](_0x5d9a83);}return _0x1a4a72[_0x3509('0x1c')]();};}function saveUpdates(_0x3065a1,_0xa61610){return function(_0x5d4637){if(_0x5d4637){return _0x5d4637['update'](_0x3065a1)[_0x3509('0x1d')](function(_0x105bd6){return _0x105bd6;});}return null;};}function removeEntity(_0x5c1031,_0x22cb02){return function(_0x5eeea0){if(_0x5eeea0){return _0x5eeea0[_0x3509('0x1e')]()[_0x3509('0x1d')](function(){_0x5c1031[_0x3509('0x13')](0xcc)[_0x3509('0x12')]();});}};}function handleEntityNotFound(_0x38d9c7,_0x568dfd){return function(_0xe0de89){if(!_0xe0de89){_0x38d9c7['sendStatus'](0x194);}return _0xe0de89;};}function handleError(_0x4d913a,_0x5a7296){_0x5a7296=_0x5a7296||0x1f4;return function(_0x403adf){logger['error'](_0x403adf[_0x3509('0x1f')]);if(_0x403adf[_0x3509('0x20')]){delete _0x403adf['name'];}_0x4d913a[_0x3509('0x13')](_0x5a7296)['send'](_0x403adf);};}exports[_0x3509('0x21')]=function(_0x25d872,_0x188411){var _0x400b30={},_0x3e8d53={},_0x40d7dd={'count':0x0,'rows':[]};var _0xa0b999=_[_0x3509('0x22')](db[_0x3509('0x23')][_0x3509('0x24')],function(_0xc761ae){return{'name':_0xc761ae[_0x3509('0x25')],'type':_0xc761ae[_0x3509('0x26')][_0x3509('0x27')]};});_0x3e8d53[_0x3509('0x28')]=_[_0x3509('0x22')](_0xa0b999,_0x3509('0x20'));_0x3e8d53[_0x3509('0x29')]=_[_0x3509('0x2a')](_0x25d872[_0x3509('0x29')]);_0x3e8d53[_0x3509('0x2b')]=_[_0x3509('0x2c')](_0x3e8d53[_0x3509('0x28')],_0x3e8d53['query']);_0x400b30['attributes']=_[_0x3509('0x2c')](_0x3e8d53[_0x3509('0x28')],qs[_0x3509('0x2d')](_0x25d872[_0x3509('0x29')][_0x3509('0x2d')]));_0x400b30['attributes']=_0x400b30['attributes']['length']?_0x400b30[_0x3509('0x2e')]:_0x3e8d53[_0x3509('0x28')];if(!_0x25d872[_0x3509('0x29')][_0x3509('0x2f')]('nolimit')){_0x400b30[_0x3509('0x18')]=qs[_0x3509('0x18')](_0x25d872[_0x3509('0x29')]['limit']);_0x400b30['offset']=qs[_0x3509('0x15')](_0x25d872[_0x3509('0x29')][_0x3509('0x15')]);}_0x400b30['order']=qs[_0x3509('0x30')](_0x25d872[_0x3509('0x29')]['sort']);_0x400b30[_0x3509('0x31')]=qs[_0x3509('0x2b')](_['pick'](_0x25d872['query'],_0x3e8d53[_0x3509('0x2b')]),_0xa0b999);if(_0x25d872['query'][_0x3509('0x32')]){_0x400b30['where']=_[_0x3509('0x33')](_0x400b30[_0x3509('0x31')],{'$or':_[_0x3509('0x22')](_0xa0b999,function(_0x5c3e74){if(_0x5c3e74[_0x3509('0x26')]!==_0x3509('0x34')){var _0x4e9bbe={};_0x4e9bbe[_0x5c3e74[_0x3509('0x20')]]={'$like':'%'+_0x25d872[_0x3509('0x29')]['filter']+'%'};return _0x4e9bbe;}})});}_0x400b30=_[_0x3509('0x33')]({},_0x400b30,_0x25d872[_0x3509('0x35')]);var _0x2ab651={'where':_0x400b30[_0x3509('0x31')]};return db['FreshdeskConfiguration']['count'](_0x2ab651)[_0x3509('0x1d')](function(_0x25cc10){_0x40d7dd[_0x3509('0x17')]=_0x25cc10;if(_0x25d872[_0x3509('0x29')]['includeAll']){_0x400b30[_0x3509('0x36')]=[{'all':!![]}];}return db[_0x3509('0x23')][_0x3509('0x37')](_0x400b30);})[_0x3509('0x1d')](function(_0x59e697){_0x40d7dd[_0x3509('0x38')]=_0x59e697;return _0x40d7dd;})[_0x3509('0x1d')](respondWithFilteredResult(_0x188411,_0x400b30))[_0x3509('0x39')](handleError(_0x188411,null));};exports[_0x3509('0x3a')]=function(_0x2a793b,_0x56bb93){var _0xc0fa71={'raw':![],'where':{'id':_0x2a793b[_0x3509('0x3b')]['id']}},_0x189afd={};_0x189afd[_0x3509('0x28')]=_[_0x3509('0x2a')](db['FreshdeskConfiguration'][_0x3509('0x24')]);_0x189afd[_0x3509('0x29')]=_[_0x3509('0x2a')](_0x2a793b[_0x3509('0x29')]);_0x189afd[_0x3509('0x2b')]=_[_0x3509('0x2c')](_0x189afd[_0x3509('0x28')],_0x189afd[_0x3509('0x29')]);_0xc0fa71[_0x3509('0x2e')]=_[_0x3509('0x2c')](_0x189afd[_0x3509('0x28')],qs[_0x3509('0x2d')](_0x2a793b[_0x3509('0x29')][_0x3509('0x2d')]));_0xc0fa71[_0x3509('0x2e')]=_0xc0fa71[_0x3509('0x2e')][_0x3509('0x3c')]?_0xc0fa71['attributes']:_0x189afd[_0x3509('0x28')];if(_0x2a793b['query'][_0x3509('0x3d')]){_0xc0fa71[_0x3509('0x36')]=[{'all':!![]}];}_0xc0fa71=_[_0x3509('0x33')]({},_0xc0fa71,_0x2a793b[_0x3509('0x35')]);return db[_0x3509('0x23')][_0x3509('0x3e')](_0xc0fa71)[_0x3509('0x1d')](handleEntityNotFound(_0x56bb93,null))[_0x3509('0x1d')](respondWithResult(_0x56bb93,null))['catch'](handleError(_0x56bb93,null));};exports['create']=function(_0x5da78c,_0x2e978a){return db[_0x3509('0x23')][_0x3509('0x3f')](_0x5da78c[_0x3509('0x40')],{})[_0x3509('0x1d')](respondWithResult(_0x2e978a,0xc9))[_0x3509('0x39')](handleError(_0x2e978a,null));};exports[_0x3509('0x41')]=function(_0x493220,_0x4d8b66){if(_0x493220[_0x3509('0x40')]['id']){delete _0x493220['body']['id'];}return db[_0x3509('0x23')][_0x3509('0x3e')]({'where':{'id':_0x493220[_0x3509('0x3b')]['id']}})[_0x3509('0x1d')](handleEntityNotFound(_0x4d8b66,null))[_0x3509('0x1d')](saveUpdates(_0x493220[_0x3509('0x40')],null))['then'](respondWithResult(_0x4d8b66,null))[_0x3509('0x39')](handleError(_0x4d8b66,null));};exports[_0x3509('0x1e')]=function(_0x38bb39,_0x422dbc){return db['FreshdeskConfiguration'][_0x3509('0x3e')]({'where':{'id':_0x38bb39[_0x3509('0x3b')]['id']}})['then'](handleEntityNotFound(_0x422dbc,null))['then'](removeEntity(_0x422dbc,null))[_0x3509('0x39')](handleError(_0x422dbc,null));};exports[_0x3509('0x42')]=function(_0x5ef1d0,_0x1589f8,_0x181370){var _0x229287={};var _0x329c1d={};var _0x57f7d5;var _0x564f8f;return db[_0x3509('0x23')]['findOne']({'where':{'id':_0x5ef1d0[_0x3509('0x3b')]['id']}})[_0x3509('0x1d')](handleEntityNotFound(_0x1589f8,null))[_0x3509('0x1d')](function(_0x1d97cc){if(_0x1d97cc){_0x57f7d5=_0x1d97cc;_0x329c1d[_0x3509('0x28')]=_['keys'](db['FreshdeskField'][_0x3509('0x24')]);_0x329c1d[_0x3509('0x29')]=_[_0x3509('0x2a')](_0x5ef1d0[_0x3509('0x29')]);_0x329c1d[_0x3509('0x2b')]=_[_0x3509('0x2c')](_0x329c1d['model'],_0x329c1d['query']);_0x229287['attributes']=_[_0x3509('0x2c')](_0x329c1d['model'],qs[_0x3509('0x2d')](_0x5ef1d0[_0x3509('0x29')]['fields']));_0x229287['attributes']=_0x229287[_0x3509('0x2e')][_0x3509('0x3c')]?_0x229287[_0x3509('0x2e')]:_0x329c1d[_0x3509('0x28')];_0x229287[_0x3509('0x43')]=qs[_0x3509('0x30')](_0x5ef1d0['query'][_0x3509('0x30')]);_0x229287['where']=qs['filters'](_['pick'](_0x5ef1d0['query'],_0x329c1d[_0x3509('0x2b')]));if(_0x5ef1d0[_0x3509('0x29')]['filter']){_0x229287['where']=_['merge'](_0x229287[_0x3509('0x31')],{'$or':_[_0x3509('0x22')](_0x229287[_0x3509('0x2e')],function(_0x4d7cdb){var _0x1a0c74={};_0x1a0c74[_0x4d7cdb]={'$like':'%'+_0x5ef1d0[_0x3509('0x29')]['filter']+'%'};return _0x1a0c74;})});}_0x229287=_[_0x3509('0x33')]({},_0x229287,_0x5ef1d0[_0x3509('0x35')]);return _0x57f7d5['getFields'](_0x229287);}})[_0x3509('0x1d')](function(_0x1f9497){if(_0x1f9497){_0x564f8f=_0x1f9497[_0x3509('0x3c')];if(!_0x5ef1d0[_0x3509('0x29')][_0x3509('0x2f')]('nolimit')){_0x229287[_0x3509('0x18')]=qs['limit'](_0x5ef1d0['query'][_0x3509('0x18')]);_0x229287[_0x3509('0x15')]=qs[_0x3509('0x15')](_0x5ef1d0[_0x3509('0x29')][_0x3509('0x15')]);}return _0x57f7d5[_0x3509('0x42')](_0x229287);}})[_0x3509('0x1d')](function(_0x50c63f){if(_0x50c63f){return _0x50c63f?{'count':_0x564f8f,'rows':_0x50c63f}:null;}})[_0x3509('0x1d')](respondWithResult(_0x1589f8,null))[_0x3509('0x39')](handleError(_0x1589f8,null));};exports['getSubjects']=function(_0x52255f,_0x774c7b,_0x19c42e){var _0x56c723={};var _0x5e0022={};var _0x60da86;var _0x16df65;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x52255f[_0x3509('0x3b')]['id']}})[_0x3509('0x1d')](handleEntityNotFound(_0x774c7b,null))[_0x3509('0x1d')](function(_0x37fcad){if(_0x37fcad){_0x60da86=_0x37fcad;_0x5e0022[_0x3509('0x28')]=_[_0x3509('0x2a')](db[_0x3509('0x44')]['rawAttributes']);_0x5e0022[_0x3509('0x29')]=_['keys'](_0x52255f['query']);_0x5e0022[_0x3509('0x2b')]=_[_0x3509('0x2c')](_0x5e0022['model'],_0x5e0022[_0x3509('0x29')]);_0x56c723[_0x3509('0x2e')]=_[_0x3509('0x2c')](_0x5e0022[_0x3509('0x28')],qs[_0x3509('0x2d')](_0x52255f[_0x3509('0x29')][_0x3509('0x2d')]));_0x56c723[_0x3509('0x2e')]=_0x56c723[_0x3509('0x2e')][_0x3509('0x3c')]?_0x56c723[_0x3509('0x2e')]:_0x5e0022[_0x3509('0x28')];_0x56c723[_0x3509('0x43')]=qs[_0x3509('0x30')](_0x52255f[_0x3509('0x29')][_0x3509('0x30')]);_0x56c723['where']=qs['filters'](_[_0x3509('0x45')](_0x52255f[_0x3509('0x29')],_0x5e0022[_0x3509('0x2b')]));if(_0x52255f[_0x3509('0x29')][_0x3509('0x32')]){_0x56c723['where']=_[_0x3509('0x33')](_0x56c723[_0x3509('0x31')],{'$or':_[_0x3509('0x22')](_0x56c723[_0x3509('0x2e')],function(_0x33a914){var _0x37226d={};_0x37226d[_0x33a914]={'$like':'%'+_0x52255f[_0x3509('0x29')][_0x3509('0x32')]+'%'};return _0x37226d;})});}_0x56c723=_[_0x3509('0x33')]({},_0x56c723,_0x52255f[_0x3509('0x35')]);return _0x60da86[_0x3509('0x46')](_0x56c723);}})[_0x3509('0x1d')](function(_0x2980cf){if(_0x2980cf){_0x16df65=_0x2980cf['length'];if(!_0x52255f['query'][_0x3509('0x2f')](_0x3509('0x47'))){_0x56c723['limit']=qs[_0x3509('0x18')](_0x52255f['query'][_0x3509('0x18')]);_0x56c723[_0x3509('0x15')]=qs[_0x3509('0x15')](_0x52255f[_0x3509('0x29')][_0x3509('0x15')]);}return _0x60da86[_0x3509('0x46')](_0x56c723);}})[_0x3509('0x1d')](function(_0x2bb7ae){if(_0x2bb7ae){return _0x2bb7ae?{'count':_0x16df65,'rows':_0x2bb7ae}:null;}})[_0x3509('0x1d')](respondWithResult(_0x774c7b,null))[_0x3509('0x39')](handleError(_0x774c7b,null));};exports[_0x3509('0x48')]=function(_0x224b26,_0x5dcc42,_0xc1876e){var _0x188663={};var _0x16cdda={};var _0xdc4115;var _0x2fe53b;return db[_0x3509('0x23')]['findOne']({'where':{'id':_0x224b26['params']['id']}})[_0x3509('0x1d')](handleEntityNotFound(_0x5dcc42,null))['then'](function(_0x1feb09){if(_0x1feb09){_0xdc4115=_0x1feb09;_0x16cdda[_0x3509('0x28')]=_[_0x3509('0x2a')](db[_0x3509('0x44')]['rawAttributes']);_0x16cdda[_0x3509('0x29')]=_['keys'](_0x224b26[_0x3509('0x29')]);_0x16cdda[_0x3509('0x2b')]=_['intersection'](_0x16cdda[_0x3509('0x28')],_0x16cdda[_0x3509('0x29')]);_0x188663[_0x3509('0x2e')]=_[_0x3509('0x2c')](_0x16cdda[_0x3509('0x28')],qs['fields'](_0x224b26['query']['fields']));_0x188663[_0x3509('0x2e')]=_0x188663[_0x3509('0x2e')]['length']?_0x188663[_0x3509('0x2e')]:_0x16cdda[_0x3509('0x28')];_0x188663[_0x3509('0x43')]=qs[_0x3509('0x30')](_0x224b26[_0x3509('0x29')][_0x3509('0x30')]);_0x188663[_0x3509('0x31')]=qs['filters'](_[_0x3509('0x45')](_0x224b26[_0x3509('0x29')],_0x16cdda[_0x3509('0x2b')]));if(_0x224b26[_0x3509('0x29')][_0x3509('0x32')]){_0x188663[_0x3509('0x31')]=_[_0x3509('0x33')](_0x188663[_0x3509('0x31')],{'$or':_[_0x3509('0x22')](_0x188663[_0x3509('0x2e')],function(_0x2345b2){var _0x51531f={};_0x51531f[_0x2345b2]={'$like':'%'+_0x224b26[_0x3509('0x29')][_0x3509('0x32')]+'%'};return _0x51531f;})});}_0x188663=_['merge']({},_0x188663,_0x224b26[_0x3509('0x35')]);return _0xdc4115['getDescriptions'](_0x188663);}})[_0x3509('0x1d')](function(_0x33c626){if(_0x33c626){_0x2fe53b=_0x33c626['length'];if(!_0x224b26[_0x3509('0x29')][_0x3509('0x2f')](_0x3509('0x47'))){_0x188663[_0x3509('0x18')]=qs[_0x3509('0x18')](_0x224b26['query'][_0x3509('0x18')]);_0x188663[_0x3509('0x15')]=qs[_0x3509('0x15')](_0x224b26[_0x3509('0x29')]['offset']);}return _0xdc4115['getDescriptions'](_0x188663);}})[_0x3509('0x1d')](function(_0x396a6e){if(_0x396a6e){return _0x396a6e?{'count':_0x2fe53b,'rows':_0x396a6e}:null;}})['then'](respondWithResult(_0x5dcc42,null))['catch'](handleError(_0x5dcc42,null));};exports[_0x3509('0x49')]=function(_0x599c59,_0x56a561,_0x2a6950){var _0x168030={};var _0x526995={};var _0x47dd93;var _0x402768;return db['FreshdeskConfiguration'][_0x3509('0x4a')]({'where':{'id':_0x599c59['params']['id']}})[_0x3509('0x1d')](handleEntityNotFound(_0x56a561,null))[_0x3509('0x1d')](function(_0x5877da){if(_0x5877da){_0x47dd93=_0x5877da;_0x526995[_0x3509('0x28')]=_[_0x3509('0x2a')](db[_0x3509('0x4b')][_0x3509('0x24')]);_0x526995[_0x3509('0x29')]=_[_0x3509('0x2a')](_0x599c59[_0x3509('0x29')]);_0x526995[_0x3509('0x2b')]=_[_0x3509('0x2c')](_0x526995[_0x3509('0x28')],_0x526995['query']);_0x168030['attributes']=_[_0x3509('0x2c')](_0x526995[_0x3509('0x28')],qs[_0x3509('0x2d')](_0x599c59[_0x3509('0x29')][_0x3509('0x2d')]));_0x168030[_0x3509('0x2e')]=_0x168030['attributes'][_0x3509('0x3c')]?_0x168030['attributes']:_0x526995[_0x3509('0x28')];_0x168030[_0x3509('0x43')]=qs[_0x3509('0x30')](_0x599c59['query'][_0x3509('0x30')]);_0x168030[_0x3509('0x31')]=qs[_0x3509('0x2b')](_[_0x3509('0x45')](_0x599c59[_0x3509('0x29')],_0x526995[_0x3509('0x2b')]));if(_0x599c59[_0x3509('0x29')][_0x3509('0x32')]){_0x168030['where']=_['merge'](_0x168030['where'],{'$or':_[_0x3509('0x22')](_0x168030['attributes'],function(_0x8b1296){var _0x431d21={};_0x431d21[_0x8b1296]={'$like':'%'+_0x599c59[_0x3509('0x29')][_0x3509('0x32')]+'%'};return _0x431d21;})});}_0x168030=_[_0x3509('0x33')]({},_0x168030,_0x599c59[_0x3509('0x35')]);return _0x47dd93[_0x3509('0x49')](_0x168030);}})[_0x3509('0x1d')](function(_0x2480db){if(_0x2480db){_0x402768=_0x2480db[_0x3509('0x3c')];if(!_0x599c59['query'][_0x3509('0x2f')](_0x3509('0x47'))){_0x168030[_0x3509('0x18')]=qs[_0x3509('0x18')](_0x599c59[_0x3509('0x29')][_0x3509('0x18')]);_0x168030[_0x3509('0x15')]=qs[_0x3509('0x15')](_0x599c59['query'][_0x3509('0x15')]);}return _0x47dd93[_0x3509('0x49')](_0x168030);}})[_0x3509('0x1d')](function(_0x1614de){if(_0x1614de){return _0x1614de?{'count':_0x402768,'rows':_0x1614de}:null;}})['then'](respondWithResult(_0x56a561,null))[_0x3509('0x39')](handleError(_0x56a561,null));};exports['setTags']=function(_0x284fa5,_0x2272ab,_0x3116f2){if(_0x284fa5[_0x3509('0x40')]['id']){delete _0x284fa5['body']['id'];}return db['FreshdeskConfiguration'][_0x3509('0x4a')]({'where':{'id':_0x284fa5[_0x3509('0x3b')]['id']}})[_0x3509('0x1d')](handleEntityNotFound(_0x2272ab,null))[_0x3509('0x1d')](function(_0x2b571b){if(_0x2b571b){return _0x2b571b['setTags'](_0x284fa5[_0x3509('0x40')][_0x3509('0x4c')]||[]);}return null;})[_0x3509('0x1d')](respondWithResult(_0x2272ab,null))[_0x3509('0x39')](handleError(_0x2272ab,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 6b1e082..ad78ae1 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 _0x3547=['lodash','util','moment','bluebird','request-promise','../../config/environment','exports','define','FreshdeskConfiguration','int_freshdesk_configurations'];(function(_0x45e992,_0xc27e9a){var _0x162e84=function(_0x3503e8){while(--_0x3503e8){_0x45e992['push'](_0x45e992['shift']());}};_0x162e84(++_0xc27e9a);}(_0x3547,0x1ae));var _0x7354=function(_0x34fe6f,_0x3b5b5c){_0x34fe6f=_0x34fe6f-0x0;var _0xef2857=_0x3547[_0x34fe6f];return _0xef2857;};'use strict';var _=require(_0x7354('0x0'));var util=require(_0x7354('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x7354('0x2'));var BPromise=require(_0x7354('0x3'));var rp=require(_0x7354('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7354('0x5'));var attributes=require('./intFreshdeskConfiguration.attributes');module[_0x7354('0x6')]=function(_0x4167aa,_0x95e225){return _0x4167aa[_0x7354('0x7')](_0x7354('0x8'),attributes,{'tableName':_0x7354('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xed5f=['./intFreshdeskConfiguration.attributes','exports','define','int_freshdesk_configurations','lodash','util','../../config/logger','bluebird','rimraf','../../config/environment'];(function(_0x15cdcb,_0x4340e9){var _0x37b069=function(_0x304cfb){while(--_0x304cfb){_0x15cdcb['push'](_0x15cdcb['shift']());}};_0x37b069(++_0x4340e9);}(_0xed5f,0x13a));var _0xfed5=function(_0x1968ae,_0x283c05){_0x1968ae=_0x1968ae-0x0;var _0x33f755=_0xed5f[_0x1968ae];return _0x33f755;};'use strict';var _=require(_0xfed5('0x0'));var util=require(_0xfed5('0x1'));var logger=require(_0xfed5('0x2'))('api');var moment=require('moment');var BPromise=require(_0xfed5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xfed5('0x4'));var config=require(_0xfed5('0x5'));var attributes=require(_0xfed5('0x6'));module[_0xfed5('0x7')]=function(_0x4ea564,_0x2a91b5){return _0x4ea564[_0xfed5('0x8')]('FreshdeskConfiguration',attributes,{'tableName':_0xfed5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js index 634bd2f..4df4620 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 _0xba40=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','info','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','FreshdeskConfiguration,\x20%s,\x20%s','result','catch'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0xba40,0x73));var _0x0ba4=function(_0x683723,_0x568943){_0x683723=_0x683723-0x0;var _0x1e4abe=_0xba40[_0x683723];return _0x1e4abe;};'use strict';var _=require(_0x0ba4('0x0'));var util=require(_0x0ba4('0x1'));var moment=require(_0x0ba4('0x2'));var BPromise=require(_0x0ba4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0ba4('0x4'));var db=require(_0x0ba4('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0ba4('0x6'))('rpc');var config=require(_0x0ba4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0ba4('0x8')][_0x0ba4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3c3c90,_0x3d898e,_0x14f4ce){return new BPromise(function(_0x2af741,_0x475269){return client[_0x0ba4('0xa')](_0x3c3c90,_0x14f4ce)[_0x0ba4('0xb')](function(_0x806677){logger[_0x0ba4('0xc')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x3d898e,_0x0ba4('0xd'));logger[_0x0ba4('0xe')](_0x0ba4('0xf'),_0x3d898e,_0x0ba4('0xd'),JSON[_0x0ba4('0x10')](_0x806677));if(_0x806677['error']){if(_0x806677['error'][_0x0ba4('0x11')]===0x1f4){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x3d898e,_0x806677[_0x0ba4('0x12')][_0x0ba4('0x13')]);return _0x475269(_0x806677['error']['message']);}logger[_0x0ba4('0x12')](_0x0ba4('0x14'),_0x3d898e,_0x806677['error'][_0x0ba4('0x13')]);return _0x2af741(_0x806677[_0x0ba4('0x12')]['message']);}else{logger[_0x0ba4('0xc')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x3d898e,'request\x20sent');_0x2af741(_0x806677[_0x0ba4('0x15')][_0x0ba4('0x13')]);}})[_0x0ba4('0x16')](function(_0x3b0064){logger[_0x0ba4('0x12')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x3d898e,_0x3b0064);_0x475269(_0x3b0064);});});} \ No newline at end of file +var _0x4832=['http','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x4cd326,_0x3da4ec){var _0x25a825=function(_0x1ac678){while(--_0x1ac678){_0x4cd326['push'](_0x4cd326['shift']());}};_0x25a825(++_0x3da4ec);}(_0x4832,0x1d8));var _0x2483=function(_0x1ebc6c,_0x58a00b){_0x1ebc6c=_0x1ebc6c-0x0;var _0x3a826d=_0x4832[_0x1ebc6c];return _0x3a826d;};'use strict';var _=require('lodash');var util=require(_0x2483('0x0'));var moment=require(_0x2483('0x1'));var BPromise=require(_0x2483('0x2'));var rs=require(_0x2483('0x3'));var fs=require('fs');var Redis=require(_0x2483('0x4'));var db=require(_0x2483('0x5'))['db'];var utils=require(_0x2483('0x6'));var logger=require(_0x2483('0x7'))(_0x2483('0x8'));var config=require('../../config/environment');var jayson=require(_0x2483('0x9'));var client=jayson[_0x2483('0xa')][_0x2483('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x517b90,_0x25dcdc,_0x4e79af){return new BPromise(function(_0x33e32f,_0x2deef9){return client['request'](_0x517b90,_0x4e79af)[_0x2483('0xc')](function(_0x3034e3){logger[_0x2483('0xd')](_0x2483('0xe'),_0x25dcdc,_0x2483('0xf'));logger['debug'](_0x2483('0x10'),_0x25dcdc,_0x2483('0xf'),JSON[_0x2483('0x11')](_0x3034e3));if(_0x3034e3[_0x2483('0x12')]){if(_0x3034e3[_0x2483('0x12')][_0x2483('0x13')]===0x1f4){logger[_0x2483('0x12')](_0x2483('0xe'),_0x25dcdc,_0x3034e3[_0x2483('0x12')]['message']);return _0x2deef9(_0x3034e3[_0x2483('0x12')][_0x2483('0x14')]);}logger[_0x2483('0x12')](_0x2483('0xe'),_0x25dcdc,_0x3034e3[_0x2483('0x12')]['message']);return _0x33e32f(_0x3034e3['error']['message']);}else{logger[_0x2483('0xd')](_0x2483('0xe'),_0x25dcdc,_0x2483('0xf'));_0x33e32f(_0x3034e3[_0x2483('0x15')][_0x2483('0x14')]);}})[_0x2483('0x16')](function(_0x36f771){logger['error'](_0x2483('0xe'),_0x25dcdc,_0x36f771);_0x2deef9(_0x36f771);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index ed8d0c1..06f1c46 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 _0xad09=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./intFreshdeskField.controller','index','get','isAuthenticated','show','create','put','/:id','delete','destroy','util','path'];(function(_0x4e5552,_0x19ec4e){var _0x60a338=function(_0x40c70e){while(--_0x40c70e){_0x4e5552['push'](_0x4e5552['shift']());}};_0x60a338(++_0x19ec4e);}(_0xad09,0x1ee));var _0x9ad0=function(_0x54d197,_0x5c5884){_0x54d197=_0x54d197-0x0;var _0x5aa343=_0xad09[_0x54d197];return _0x5aa343;};'use strict';var multer=require('multer');var util=require(_0x9ad0('0x0'));var path=require(_0x9ad0('0x1'));var timeout=require(_0x9ad0('0x2'));var express=require('express');var router=express[_0x9ad0('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x9ad0('0x4'));var interaction=require(_0x9ad0('0x5'));var config=require('../../config/environment');var controller=require(_0x9ad0('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x9ad0('0x7')]);router[_0x9ad0('0x8')]('/:id',auth[_0x9ad0('0x9')](),controller[_0x9ad0('0xa')]);router['post']('/',auth[_0x9ad0('0x9')](),controller[_0x9ad0('0xb')]);router[_0x9ad0('0xc')](_0x9ad0('0xd'),auth[_0x9ad0('0x9')](),controller['update']);router[_0x9ad0('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x9ad0('0xf')]);module['exports']=router; \ No newline at end of file +var _0x2c02=['/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./intFreshdeskField.controller','get','index'];(function(_0x4f7339,_0x1dc41e){var _0x241781=function(_0x50d5f2){while(--_0x50d5f2){_0x4f7339['push'](_0x4f7339['shift']());}};_0x241781(++_0x1dc41e);}(_0x2c02,0x1ed));var _0x22c0=function(_0x4cd17b,_0x27f781){_0x4cd17b=_0x4cd17b-0x0;var _0x555470=_0x2c02[_0x4cd17b];return _0x555470;};'use strict';var multer=require(_0x22c0('0x0'));var util=require(_0x22c0('0x1'));var path=require(_0x22c0('0x2'));var timeout=require(_0x22c0('0x3'));var express=require(_0x22c0('0x4'));var router=express[_0x22c0('0x5')]();var fs_extra=require(_0x22c0('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x22c0('0x7'));var controller=require(_0x22c0('0x8'));router[_0x22c0('0x9')]('/',auth['isAuthenticated'](),controller[_0x22c0('0xa')]);router[_0x22c0('0x9')](_0x22c0('0xb'),auth[_0x22c0('0xc')](),controller[_0x22c0('0xd')]);router[_0x22c0('0xe')]('/',auth[_0x22c0('0xc')](),controller[_0x22c0('0xf')]);router[_0x22c0('0x10')](_0x22c0('0xb'),auth[_0x22c0('0xc')](),controller[_0x22c0('0x11')]);router[_0x22c0('0x12')](_0x22c0('0xb'),auth[_0x22c0('0xc')](),controller[_0x22c0('0x13')]);module[_0x22c0('0x14')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 6a6e6f9..3d340a1 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 _0x1d9b=['variable','STRING','BOOLEAN','sequelize','exports','string'];(function(_0x2ea8a3,_0x16cf24){var _0xc6d377=function(_0x10fb6a){while(--_0x10fb6a){_0x2ea8a3['push'](_0x2ea8a3['shift']());}};_0xc6d377(++_0x16cf24);}(_0x1d9b,0x15f));var _0xb1d9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1d9b[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xb1d9('0x0'));module[_0xb1d9('0x1')]={'type':{'type':Sequelize['ENUM'](_0xb1d9('0x2'),_0xb1d9('0x3'),'customVariable','keyValue','picklist'),'defaultValue':_0xb1d9('0x2')},'content':{'type':Sequelize[_0xb1d9('0x4')]},'key':{'type':Sequelize[_0xb1d9('0x4')]},'keyType':{'type':Sequelize['ENUM']('string',_0xb1d9('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0xb1d9('0x4')]},'idField':{'type':Sequelize[_0xb1d9('0x4')]},'nameField':{'type':Sequelize[_0xb1d9('0x4')]},'customField':{'type':Sequelize[_0xb1d9('0x5')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb1d9('0x4')]}}; \ No newline at end of file +var _0x1509=['keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1509,0x19e));var _0x9150=function(_0x453b78,_0x49fa4a){_0x453b78=_0x453b78-0x0;var _0x27b22b=_0x1509[_0x453b78];return _0x27b22b;};'use strict';var Sequelize=require(_0x9150('0x0'));module[_0x9150('0x1')]={'type':{'type':Sequelize[_0x9150('0x2')](_0x9150('0x3'),_0x9150('0x4'),_0x9150('0x5'),_0x9150('0x6'),_0x9150('0x7')),'defaultValue':'string'},'content':{'type':Sequelize[_0x9150('0x8')]},'key':{'type':Sequelize[_0x9150('0x8')]},'keyType':{'type':Sequelize[_0x9150('0x2')]('string',_0x9150('0x4'),_0x9150('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x9150('0x8')]},'nameField':{'type':Sequelize[_0x9150('0x8')]},'customField':{'type':Sequelize[_0x9150('0x9')],'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 c44d3e9..59d0f9d 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 _0xd757=['type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','show','params','keys','includeAll','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','FreshdeskField','rawAttributes','fieldName'];(function(_0x289fb0,_0x1e7005){var _0x5bf597=function(_0x3d2750){while(--_0x3d2750){_0x289fb0['push'](_0x289fb0['shift']());}};_0x5bf597(++_0x1e7005);}(_0xd757,0x1e5));var _0x7d75=function(_0x4022ed,_0x1d9e36){_0x4022ed=_0x4022ed-0x0;var _0x2852fb=_0xd757[_0x4022ed];return _0x2852fb;};'use strict';var emlformat=require(_0x7d75('0x0'));var rimraf=require(_0x7d75('0x1'));var zipdir=require(_0x7d75('0x2'));var jsonpatch=require(_0x7d75('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7d75('0x4'));var Mustache=require(_0x7d75('0x5'));var util=require('util');var path=require(_0x7d75('0x6'));var sox=require(_0x7d75('0x7'));var csv=require(_0x7d75('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7d75('0x9'));var squel=require(_0x7d75('0xa'));var crypto=require(_0x7d75('0xb'));var jsforce=require(_0x7d75('0xc'));var deskjs=require(_0x7d75('0xd'));var toCsv=require(_0x7d75('0x8'));var querystring=require(_0x7d75('0xe'));var Papa=require(_0x7d75('0xf'));var Redis=require(_0x7d75('0x10'));var authService=require(_0x7d75('0x11'));var qs=require(_0x7d75('0x12'));var as=require(_0x7d75('0x13'));var hardwareService=require(_0x7d75('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x7d75('0x15'));var config=require(_0x7d75('0x16'));var licenseUtil=require(_0x7d75('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3e7b97,_0x3a5ca5){_0x3a5ca5=_0x3a5ca5||0xcc;return function(_0x5c9fcf){if(_0x5c9fcf){return _0x3e7b97[_0x7d75('0x18')](_0x3a5ca5);}return _0x3e7b97[_0x7d75('0x19')](_0x3a5ca5)[_0x7d75('0x1a')]();};}function respondWithResult(_0x43e546,_0x2b5d23){_0x2b5d23=_0x2b5d23||0xc8;return function(_0x3be8b2){if(_0x3be8b2){return _0x43e546['status'](_0x2b5d23)[_0x7d75('0x1b')](_0x3be8b2);}};}function respondWithFilteredResult(_0x1a460b,_0x14100f){return function(_0x1a9778){if(_0x1a9778){var _0x44041e=typeof _0x14100f[_0x7d75('0x1c')]==='undefined'&&typeof _0x14100f[_0x7d75('0x1d')]==='undefined';var _0x3896c3=_0x1a9778[_0x7d75('0x1e')];var _0x40edfc=_0x44041e?0x0:_0x14100f[_0x7d75('0x1c')];var _0x356b44=_0x44041e?_0x1a9778[_0x7d75('0x1e')]:_0x14100f[_0x7d75('0x1c')]+_0x14100f[_0x7d75('0x1d')];var _0x55b89d;if(_0x356b44>=_0x3896c3){_0x356b44=_0x3896c3;_0x55b89d=0xc8;}else{_0x55b89d=0xce;}_0x1a460b['status'](_0x55b89d);return _0x1a460b[_0x7d75('0x1f')](_0x7d75('0x20'),_0x40edfc+'-'+_0x356b44+'/'+_0x3896c3)[_0x7d75('0x1b')](_0x1a9778);}return null;};}function patchUpdates(_0xbb0322){return function(_0x47a5f0){try{jsonpatch[_0x7d75('0x21')](_0x47a5f0,_0xbb0322,!![]);}catch(_0x31bfa8){return BPromise[_0x7d75('0x22')](_0x31bfa8);}return _0x47a5f0[_0x7d75('0x23')]();};}function saveUpdates(_0x232c46,_0x187093){return function(_0x486ce1){if(_0x486ce1){return _0x486ce1[_0x7d75('0x24')](_0x232c46)[_0x7d75('0x25')](function(_0x1c0327){return _0x1c0327;});}return null;};}function removeEntity(_0x3be591,_0x21211b){return function(_0x323e20){if(_0x323e20){return _0x323e20[_0x7d75('0x26')]()[_0x7d75('0x25')](function(){_0x3be591[_0x7d75('0x19')](0xcc)[_0x7d75('0x1a')]();});}};}function handleEntityNotFound(_0x3103d6,_0x5a1218){return function(_0xec279d){if(!_0xec279d){_0x3103d6[_0x7d75('0x18')](0x194);}return _0xec279d;};}function handleError(_0x4f67e6,_0x19a230){_0x19a230=_0x19a230||0x1f4;return function(_0x50d798){logger[_0x7d75('0x27')](_0x50d798[_0x7d75('0x28')]);if(_0x50d798[_0x7d75('0x29')]){delete _0x50d798[_0x7d75('0x29')];}_0x4f67e6[_0x7d75('0x19')](_0x19a230)['send'](_0x50d798);};}exports[_0x7d75('0x2a')]=function(_0x31055c,_0x2f783b){var _0xb0c225={},_0x1121a6={},_0x11ba6c={'count':0x0,'rows':[]};var _0x5dd4f1=_[_0x7d75('0x2b')](db[_0x7d75('0x2c')][_0x7d75('0x2d')],function(_0x2a1c5b){return{'name':_0x2a1c5b[_0x7d75('0x2e')],'type':_0x2a1c5b[_0x7d75('0x2f')][_0x7d75('0x30')]};});_0x1121a6['model']=_['map'](_0x5dd4f1,'name');_0x1121a6[_0x7d75('0x31')]=_['keys'](_0x31055c[_0x7d75('0x31')]);_0x1121a6[_0x7d75('0x32')]=_[_0x7d75('0x33')](_0x1121a6[_0x7d75('0x34')],_0x1121a6[_0x7d75('0x31')]);_0xb0c225['attributes']=_[_0x7d75('0x33')](_0x1121a6[_0x7d75('0x34')],qs[_0x7d75('0x35')](_0x31055c[_0x7d75('0x31')][_0x7d75('0x35')]));_0xb0c225[_0x7d75('0x36')]=_0xb0c225[_0x7d75('0x36')][_0x7d75('0x37')]?_0xb0c225[_0x7d75('0x36')]:_0x1121a6[_0x7d75('0x34')];if(!_0x31055c['query'][_0x7d75('0x38')](_0x7d75('0x39'))){_0xb0c225[_0x7d75('0x1d')]=qs[_0x7d75('0x1d')](_0x31055c[_0x7d75('0x31')][_0x7d75('0x1d')]);_0xb0c225['offset']=qs[_0x7d75('0x1c')](_0x31055c[_0x7d75('0x31')]['offset']);}_0xb0c225['order']=qs[_0x7d75('0x3a')](_0x31055c[_0x7d75('0x31')][_0x7d75('0x3a')]);_0xb0c225[_0x7d75('0x3b')]=qs[_0x7d75('0x32')](_[_0x7d75('0x3c')](_0x31055c['query'],_0x1121a6[_0x7d75('0x32')]),_0x5dd4f1);if(_0x31055c[_0x7d75('0x31')]['filter']){_0xb0c225[_0x7d75('0x3b')]=_[_0x7d75('0x3d')](_0xb0c225[_0x7d75('0x3b')],{'$or':_[_0x7d75('0x2b')](_0x5dd4f1,function(_0x30aeab){if(_0x30aeab[_0x7d75('0x2f')]!==_0x7d75('0x3e')){var _0x815d03={};_0x815d03[_0x30aeab[_0x7d75('0x29')]]={'$like':'%'+_0x31055c[_0x7d75('0x31')][_0x7d75('0x3f')]+'%'};return _0x815d03;}})});}_0xb0c225=_[_0x7d75('0x3d')]({},_0xb0c225,_0x31055c[_0x7d75('0x40')]);var _0x35ac15={'where':_0xb0c225[_0x7d75('0x3b')]};return db[_0x7d75('0x2c')][_0x7d75('0x1e')](_0x35ac15)[_0x7d75('0x25')](function(_0x304c32){_0x11ba6c[_0x7d75('0x1e')]=_0x304c32;if(_0x31055c['query']['includeAll']){_0xb0c225[_0x7d75('0x41')]=[{'all':!![]}];}return db[_0x7d75('0x2c')][_0x7d75('0x42')](_0xb0c225);})[_0x7d75('0x25')](function(_0x222ece){_0x11ba6c[_0x7d75('0x43')]=_0x222ece;return _0x11ba6c;})[_0x7d75('0x25')](respondWithFilteredResult(_0x2f783b,_0xb0c225))['catch'](handleError(_0x2f783b,null));};exports[_0x7d75('0x44')]=function(_0x23e6f9,_0x42a57e){var _0x5edd82={'raw':!![],'where':{'id':_0x23e6f9[_0x7d75('0x45')]['id']}},_0x2e1f36={};_0x2e1f36[_0x7d75('0x34')]=_[_0x7d75('0x46')](db[_0x7d75('0x2c')][_0x7d75('0x2d')]);_0x2e1f36[_0x7d75('0x31')]=_[_0x7d75('0x46')](_0x23e6f9[_0x7d75('0x31')]);_0x2e1f36[_0x7d75('0x32')]=_[_0x7d75('0x33')](_0x2e1f36['model'],_0x2e1f36[_0x7d75('0x31')]);_0x5edd82['attributes']=_['intersection'](_0x2e1f36[_0x7d75('0x34')],qs['fields'](_0x23e6f9[_0x7d75('0x31')][_0x7d75('0x35')]));_0x5edd82['attributes']=_0x5edd82[_0x7d75('0x36')][_0x7d75('0x37')]?_0x5edd82[_0x7d75('0x36')]:_0x2e1f36[_0x7d75('0x34')];if(_0x23e6f9[_0x7d75('0x31')][_0x7d75('0x47')]){_0x5edd82[_0x7d75('0x41')]=[{'all':!![]}];}_0x5edd82=_[_0x7d75('0x3d')]({},_0x5edd82,_0x23e6f9['options']);return db[_0x7d75('0x2c')][_0x7d75('0x48')](_0x5edd82)[_0x7d75('0x25')](handleEntityNotFound(_0x42a57e,null))['then'](respondWithResult(_0x42a57e,null))[_0x7d75('0x49')](handleError(_0x42a57e,null));};exports[_0x7d75('0x4a')]=function(_0x34ff66,_0x277788){return db[_0x7d75('0x2c')][_0x7d75('0x4a')](_0x34ff66['body'],{})[_0x7d75('0x25')](respondWithResult(_0x277788,0xc9))[_0x7d75('0x49')](handleError(_0x277788,null));};exports[_0x7d75('0x24')]=function(_0x31b9be,_0x4cb900){if(_0x31b9be[_0x7d75('0x4b')]['id']){delete _0x31b9be['body']['id'];}return db[_0x7d75('0x2c')][_0x7d75('0x48')]({'where':{'id':_0x31b9be[_0x7d75('0x45')]['id']}})['then'](handleEntityNotFound(_0x4cb900,null))[_0x7d75('0x25')](saveUpdates(_0x31b9be['body'],null))[_0x7d75('0x25')](respondWithResult(_0x4cb900,null))['catch'](handleError(_0x4cb900,null));};exports[_0x7d75('0x26')]=function(_0x27a11f,_0x1009eb){return db['FreshdeskField'][_0x7d75('0x48')]({'where':{'id':_0x27a11f['params']['id']}})[_0x7d75('0x25')](handleEntityNotFound(_0x1009eb,null))[_0x7d75('0x25')](removeEntity(_0x1009eb,null))[_0x7d75('0x49')](handleError(_0x1009eb,null));}; \ No newline at end of file +var _0xe600=['attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','name','options','include','FreshdeskField','findAll','rows','catch','show','includeAll','create','body','find','params','rimraf','fast-json-patch','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','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields'];(function(_0x3b6d03,_0x518294){var _0x1de3af=function(_0x405640){while(--_0x405640){_0x3b6d03['push'](_0x3b6d03['shift']());}};_0x1de3af(++_0x518294);}(_0xe600,0x159));var _0x0e60=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe600[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0e60('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0e60('0x1'));var rp=require(_0x0e60('0x2'));var moment=require(_0x0e60('0x3'));var BPromise=require(_0x0e60('0x4'));var Mustache=require(_0x0e60('0x5'));var util=require(_0x0e60('0x6'));var path=require(_0x0e60('0x7'));var sox=require(_0x0e60('0x8'));var csv=require(_0x0e60('0x9'));var ejs=require(_0x0e60('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0e60('0xb'));var squel=require(_0x0e60('0xc'));var crypto=require(_0x0e60('0xd'));var jsforce=require(_0x0e60('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x0e60('0x9'));var querystring=require(_0x0e60('0xf'));var Papa=require(_0x0e60('0x10'));var Redis=require(_0x0e60('0x11'));var authService=require(_0x0e60('0x12'));var qs=require(_0x0e60('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0e60('0x14'));var logger=require(_0x0e60('0x15'))(_0x0e60('0x16'));var utils=require(_0x0e60('0x17'));var config=require(_0x0e60('0x18'));var licenseUtil=require(_0x0e60('0x19'));var db=require(_0x0e60('0x1a'))['db'];function respondWithStatusCode(_0x2f5ee4,_0x540411){_0x540411=_0x540411||0xcc;return function(_0x2d848f){if(_0x2d848f){return _0x2f5ee4[_0x0e60('0x1b')](_0x540411);}return _0x2f5ee4[_0x0e60('0x1c')](_0x540411)[_0x0e60('0x1d')]();};}function respondWithResult(_0x45328b,_0x37bf95){_0x37bf95=_0x37bf95||0xc8;return function(_0x5d7f84){if(_0x5d7f84){return _0x45328b[_0x0e60('0x1c')](_0x37bf95)['json'](_0x5d7f84);}};}function respondWithFilteredResult(_0x91cd1,_0x128887){return function(_0x170890){if(_0x170890){var _0x5ab4ba=typeof _0x128887[_0x0e60('0x1e')]===_0x0e60('0x1f')&&typeof _0x128887[_0x0e60('0x20')]===_0x0e60('0x1f');var _0x2e6270=_0x170890['count'];var _0x992490=_0x5ab4ba?0x0:_0x128887[_0x0e60('0x1e')];var _0x599c1d=_0x5ab4ba?_0x170890[_0x0e60('0x21')]:_0x128887[_0x0e60('0x1e')]+_0x128887[_0x0e60('0x20')];var _0x504b31;if(_0x599c1d>=_0x2e6270){_0x599c1d=_0x2e6270;_0x504b31=0xc8;}else{_0x504b31=0xce;}_0x91cd1[_0x0e60('0x1c')](_0x504b31);return _0x91cd1['set'](_0x0e60('0x22'),_0x992490+'-'+_0x599c1d+'/'+_0x2e6270)[_0x0e60('0x23')](_0x170890);}return null;};}function patchUpdates(_0xb9f037){return function(_0xabf953){try{jsonpatch[_0x0e60('0x24')](_0xabf953,_0xb9f037,!![]);}catch(_0x31a63e){return BPromise[_0x0e60('0x25')](_0x31a63e);}return _0xabf953[_0x0e60('0x26')]();};}function saveUpdates(_0x352633,_0x10f875){return function(_0x22c0e0){if(_0x22c0e0){return _0x22c0e0[_0x0e60('0x27')](_0x352633)[_0x0e60('0x28')](function(_0x16985f){return _0x16985f;});}return null;};}function removeEntity(_0x4702f,_0x33f9f3){return function(_0x41642c){if(_0x41642c){return _0x41642c[_0x0e60('0x29')]()[_0x0e60('0x28')](function(){_0x4702f['status'](0xcc)[_0x0e60('0x1d')]();});}};}function handleEntityNotFound(_0x41ad9a,_0x5ea254){return function(_0x10451f){if(!_0x10451f){_0x41ad9a['sendStatus'](0x194);}return _0x10451f;};}function handleError(_0x3ddc19,_0x5665c2){_0x5665c2=_0x5665c2||0x1f4;return function(_0x48d950){logger[_0x0e60('0x2a')](_0x48d950[_0x0e60('0x2b')]);if(_0x48d950['name']){delete _0x48d950['name'];}_0x3ddc19[_0x0e60('0x1c')](_0x5665c2)['send'](_0x48d950);};}exports[_0x0e60('0x2c')]=function(_0x548919,_0x4e6b41){var _0x154478={},_0x3d3c13={},_0x2a282d={'count':0x0,'rows':[]};var _0x4d9b18=_[_0x0e60('0x2d')](db['FreshdeskField'][_0x0e60('0x2e')],function(_0x1d54c0){return{'name':_0x1d54c0[_0x0e60('0x2f')],'type':_0x1d54c0['type'][_0x0e60('0x30')]};});_0x3d3c13[_0x0e60('0x31')]=_[_0x0e60('0x2d')](_0x4d9b18,'name');_0x3d3c13[_0x0e60('0x32')]=_[_0x0e60('0x33')](_0x548919[_0x0e60('0x32')]);_0x3d3c13[_0x0e60('0x34')]=_[_0x0e60('0x35')](_0x3d3c13['model'],_0x3d3c13[_0x0e60('0x32')]);_0x154478['attributes']=_[_0x0e60('0x35')](_0x3d3c13['model'],qs[_0x0e60('0x36')](_0x548919[_0x0e60('0x32')][_0x0e60('0x36')]));_0x154478['attributes']=_0x154478[_0x0e60('0x37')][_0x0e60('0x38')]?_0x154478[_0x0e60('0x37')]:_0x3d3c13[_0x0e60('0x31')];if(!_0x548919[_0x0e60('0x32')][_0x0e60('0x39')](_0x0e60('0x3a'))){_0x154478[_0x0e60('0x20')]=qs[_0x0e60('0x20')](_0x548919[_0x0e60('0x32')][_0x0e60('0x20')]);_0x154478[_0x0e60('0x1e')]=qs['offset'](_0x548919[_0x0e60('0x32')][_0x0e60('0x1e')]);}_0x154478[_0x0e60('0x3b')]=qs[_0x0e60('0x3c')](_0x548919['query']['sort']);_0x154478[_0x0e60('0x3d')]=qs['filters'](_[_0x0e60('0x3e')](_0x548919['query'],_0x3d3c13[_0x0e60('0x34')]),_0x4d9b18);if(_0x548919[_0x0e60('0x32')][_0x0e60('0x3f')]){_0x154478[_0x0e60('0x3d')]=_[_0x0e60('0x40')](_0x154478[_0x0e60('0x3d')],{'$or':_[_0x0e60('0x2d')](_0x4d9b18,function(_0x39fac1){if(_0x39fac1[_0x0e60('0x41')]!==_0x0e60('0x42')){var _0xb0a66c={};_0xb0a66c[_0x39fac1[_0x0e60('0x43')]]={'$like':'%'+_0x548919['query'][_0x0e60('0x3f')]+'%'};return _0xb0a66c;}})});}_0x154478=_['merge']({},_0x154478,_0x548919[_0x0e60('0x44')]);var _0x266cae={'where':_0x154478['where']};return db['FreshdeskField'][_0x0e60('0x21')](_0x266cae)[_0x0e60('0x28')](function(_0x50b793){_0x2a282d[_0x0e60('0x21')]=_0x50b793;if(_0x548919[_0x0e60('0x32')]['includeAll']){_0x154478[_0x0e60('0x45')]=[{'all':!![]}];}return db[_0x0e60('0x46')][_0x0e60('0x47')](_0x154478);})[_0x0e60('0x28')](function(_0x3ac0f0){_0x2a282d[_0x0e60('0x48')]=_0x3ac0f0;return _0x2a282d;})[_0x0e60('0x28')](respondWithFilteredResult(_0x4e6b41,_0x154478))[_0x0e60('0x49')](handleError(_0x4e6b41,null));};exports[_0x0e60('0x4a')]=function(_0x4c89b4,_0x4a2a10){var _0x535c06={'raw':!![],'where':{'id':_0x4c89b4['params']['id']}},_0x39c7d4={};_0x39c7d4[_0x0e60('0x31')]=_[_0x0e60('0x33')](db[_0x0e60('0x46')]['rawAttributes']);_0x39c7d4[_0x0e60('0x32')]=_[_0x0e60('0x33')](_0x4c89b4['query']);_0x39c7d4['filters']=_[_0x0e60('0x35')](_0x39c7d4[_0x0e60('0x31')],_0x39c7d4[_0x0e60('0x32')]);_0x535c06[_0x0e60('0x37')]=_[_0x0e60('0x35')](_0x39c7d4[_0x0e60('0x31')],qs['fields'](_0x4c89b4[_0x0e60('0x32')][_0x0e60('0x36')]));_0x535c06[_0x0e60('0x37')]=_0x535c06[_0x0e60('0x37')][_0x0e60('0x38')]?_0x535c06['attributes']:_0x39c7d4['model'];if(_0x4c89b4['query'][_0x0e60('0x4b')]){_0x535c06[_0x0e60('0x45')]=[{'all':!![]}];}_0x535c06=_[_0x0e60('0x40')]({},_0x535c06,_0x4c89b4[_0x0e60('0x44')]);return db['FreshdeskField']['find'](_0x535c06)['then'](handleEntityNotFound(_0x4a2a10,null))[_0x0e60('0x28')](respondWithResult(_0x4a2a10,null))[_0x0e60('0x49')](handleError(_0x4a2a10,null));};exports[_0x0e60('0x4c')]=function(_0x5fe304,_0x8777f4){return db['FreshdeskField']['create'](_0x5fe304[_0x0e60('0x4d')],{})[_0x0e60('0x28')](respondWithResult(_0x8777f4,0xc9))[_0x0e60('0x49')](handleError(_0x8777f4,null));};exports[_0x0e60('0x27')]=function(_0x4ad156,_0x36a999){if(_0x4ad156[_0x0e60('0x4d')]['id']){delete _0x4ad156[_0x0e60('0x4d')]['id'];}return db['FreshdeskField'][_0x0e60('0x4e')]({'where':{'id':_0x4ad156[_0x0e60('0x4f')]['id']}})['then'](handleEntityNotFound(_0x36a999,null))[_0x0e60('0x28')](saveUpdates(_0x4ad156['body'],null))[_0x0e60('0x28')](respondWithResult(_0x36a999,null))[_0x0e60('0x49')](handleError(_0x36a999,null));};exports[_0x0e60('0x29')]=function(_0x2e887c,_0x477a99){return db['FreshdeskField'][_0x0e60('0x4e')]({'where':{'id':_0x2e887c[_0x0e60('0x4f')]['id']}})[_0x0e60('0x28')](handleEntityNotFound(_0x477a99,null))[_0x0e60('0x28')](removeEntity(_0x477a99,null))['catch'](handleError(_0x477a99,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index cc44e0c..7c1a53e 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 _0x8bd4=['FreshdeskField','int_freshdesk_fields','idField','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x46162f,_0xe70c35){var _0x136f4f=function(_0x3e6f4e){while(--_0x3e6f4e){_0x46162f['push'](_0x46162f['shift']());}};_0x136f4f(++_0xe70c35);}(_0x8bd4,0xb9));var _0x48bd=function(_0x1cbd9f,_0x177e23){_0x1cbd9f=_0x1cbd9f-0x0;var _0xe31867=_0x8bd4[_0x1cbd9f];return _0xe31867;};'use strict';var _=require('lodash');var util=require(_0x48bd('0x0'));var logger=require('../../config/logger')(_0x48bd('0x1'));var moment=require(_0x48bd('0x2'));var BPromise=require(_0x48bd('0x3'));var rp=require(_0x48bd('0x4'));var fs=require('fs');var path=require(_0x48bd('0x5'));var rimraf=require(_0x48bd('0x6'));var config=require(_0x48bd('0x7'));var attributes=require('./intFreshdeskField.attributes');module[_0x48bd('0x8')]=function(_0xd6fe07,_0x58b0f8){return _0xd6fe07[_0x48bd('0x9')](_0x48bd('0xa'),attributes,{'tableName':_0x48bd('0xb'),'paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':[_0x48bd('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6e8b=['int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','FreshdeskField'];(function(_0x2b47a0,_0x43a401){var _0x57a03c=function(_0x2a119d){while(--_0x2a119d){_0x2b47a0['push'](_0x2b47a0['shift']());}};_0x57a03c(++_0x43a401);}(_0x6e8b,0x6a));var _0xb6e8=function(_0x593467,_0x14e615){_0x593467=_0x593467-0x0;var _0x67a71b=_0x6e8b[_0x593467];return _0x67a71b;};'use strict';var _=require(_0xb6e8('0x0'));var util=require(_0xb6e8('0x1'));var logger=require(_0xb6e8('0x2'))(_0xb6e8('0x3'));var moment=require(_0xb6e8('0x4'));var BPromise=require(_0xb6e8('0x5'));var rp=require(_0xb6e8('0x6'));var fs=require('fs');var path=require(_0xb6e8('0x7'));var rimraf=require(_0xb6e8('0x8'));var config=require(_0xb6e8('0x9'));var attributes=require(_0xb6e8('0xa'));module[_0xb6e8('0xb')]=function(_0x32ef57,_0x2a4201){return _0x32ef57['define'](_0xb6e8('0xc'),attributes,{'tableName':_0xb6e8('0xd'),'paranoid':![],'indexes':[{'name':_0xb6e8('0xe'),'fields':[_0xb6e8('0xf'),_0xb6e8('0x10')],'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 4a1372f..32dc611 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 _0xb944=['debug','FreshdeskField,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent'];(function(_0x21ba22,_0x38908f){var _0x997b34=function(_0x5630f5){while(--_0x5630f5){_0x21ba22['push'](_0x21ba22['shift']());}};_0x997b34(++_0x38908f);}(_0xb944,0x1d2));var _0x4b94=function(_0x5317b5,_0x4dfd6e){_0x5317b5=_0x5317b5-0x0;var _0x3b7ce2=_0xb944[_0x5317b5];return _0x3b7ce2;};'use strict';var _=require(_0x4b94('0x0'));var util=require(_0x4b94('0x1'));var moment=require('moment');var BPromise=require(_0x4b94('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4b94('0x3'));var db=require(_0x4b94('0x4'))['db'];var utils=require(_0x4b94('0x5'));var logger=require('../../config/logger')(_0x4b94('0x6'));var config=require(_0x4b94('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4b94('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5c9d79,_0x5eff74,_0x4daf8f){return new BPromise(function(_0x230c90,_0x506f15){return client[_0x4b94('0x9')](_0x5c9d79,_0x4daf8f)[_0x4b94('0xa')](function(_0x2ce6da){logger[_0x4b94('0xb')](_0x4b94('0xc'),_0x5eff74,_0x4b94('0xd'));logger[_0x4b94('0xe')](_0x4b94('0xf'),_0x5eff74,_0x4b94('0xd'),JSON['stringify'](_0x2ce6da));if(_0x2ce6da[_0x4b94('0x10')]){if(_0x2ce6da[_0x4b94('0x10')][_0x4b94('0x11')]===0x1f4){logger[_0x4b94('0x10')]('FreshdeskField,\x20%s,\x20%s',_0x5eff74,_0x2ce6da[_0x4b94('0x10')][_0x4b94('0x12')]);return _0x506f15(_0x2ce6da[_0x4b94('0x10')][_0x4b94('0x12')]);}logger[_0x4b94('0x10')](_0x4b94('0xc'),_0x5eff74,_0x2ce6da[_0x4b94('0x10')][_0x4b94('0x12')]);return _0x230c90(_0x2ce6da['error']['message']);}else{logger[_0x4b94('0xb')](_0x4b94('0xc'),_0x5eff74,'request\x20sent');_0x230c90(_0x2ce6da[_0x4b94('0x13')][_0x4b94('0x12')]);}})['catch'](function(_0x52aa67){logger['error']('FreshdeskField,\x20%s,\x20%s',_0x5eff74,_0x52aa67);_0x506f15(_0x52aa67);});});} \ No newline at end of file +var _0xd349=['error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','FreshdeskField,\x20%s,\x20%s,\x20%s'];(function(_0x4c41e2,_0x311274){var _0x2d264d=function(_0x310df5){while(--_0x310df5){_0x4c41e2['push'](_0x4c41e2['shift']());}};_0x2d264d(++_0x311274);}(_0xd349,0x1d3));var _0x9d34=function(_0x2c8467,_0x5c26fb){_0x2c8467=_0x2c8467-0x0;var _0x399c57=_0xd349[_0x2c8467];return _0x399c57;};'use strict';var _=require(_0x9d34('0x0'));var util=require(_0x9d34('0x1'));var moment=require('moment');var BPromise=require(_0x9d34('0x2'));var rs=require(_0x9d34('0x3'));var fs=require('fs');var Redis=require(_0x9d34('0x4'));var db=require(_0x9d34('0x5'))['db'];var utils=require(_0x9d34('0x6'));var logger=require(_0x9d34('0x7'))(_0x9d34('0x8'));var config=require('../../config/environment');var jayson=require(_0x9d34('0x9'));var client=jayson['client'][_0x9d34('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cb398,_0x113b7e,_0x3ca214){return new BPromise(function(_0x4da382,_0x2318c0){return client[_0x9d34('0xb')](_0x3cb398,_0x3ca214)[_0x9d34('0xc')](function(_0x28fe85){logger[_0x9d34('0xd')](_0x9d34('0xe'),_0x113b7e,_0x9d34('0xf'));logger['debug'](_0x9d34('0x10'),_0x113b7e,'request\x20sent',JSON['stringify'](_0x28fe85));if(_0x28fe85[_0x9d34('0x11')]){if(_0x28fe85[_0x9d34('0x11')][_0x9d34('0x12')]===0x1f4){logger[_0x9d34('0x11')](_0x9d34('0xe'),_0x113b7e,_0x28fe85[_0x9d34('0x11')][_0x9d34('0x13')]);return _0x2318c0(_0x28fe85['error'][_0x9d34('0x13')]);}logger['error']('FreshdeskField,\x20%s,\x20%s',_0x113b7e,_0x28fe85[_0x9d34('0x11')]['message']);return _0x4da382(_0x28fe85[_0x9d34('0x11')]['message']);}else{logger[_0x9d34('0xd')](_0x9d34('0xe'),_0x113b7e,_0x9d34('0xf'));_0x4da382(_0x28fe85[_0x9d34('0x14')][_0x9d34('0x13')]);}})[_0x9d34('0x15')](function(_0x49787e){logger[_0x9d34('0x11')](_0x9d34('0xe'),_0x113b7e,_0x49787e);_0x2318c0(_0x49787e);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index e80ead6..35493a3 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 _0x41bb=['/:id/fields','getFields','post','addConfiguration','put','update','delete','/:id','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshsalesAccount.controller','get','isAuthenticated','show','/:id/configurations','getConfigurations'];(function(_0x414827,_0x3ac211){var _0x15859d=function(_0x1b1133){while(--_0x1b1133){_0x414827['push'](_0x414827['shift']());}};_0x15859d(++_0x3ac211);}(_0x41bb,0xc5));var _0xb41b=function(_0x5011ae,_0x46fefb){_0x5011ae=_0x5011ae-0x0;var _0x2d0ece=_0x41bb[_0x5011ae];return _0x2d0ece;};'use strict';var multer=require(_0xb41b('0x0'));var util=require(_0xb41b('0x1'));var path=require('path');var timeout=require(_0xb41b('0x2'));var express=require('express');var router=express[_0xb41b('0x3')]();var fs_extra=require(_0xb41b('0x4'));var auth=require(_0xb41b('0x5'));var interaction=require(_0xb41b('0x6'));var config=require('../../config/environment');var controller=require(_0xb41b('0x7'));router[_0xb41b('0x8')]('/',auth[_0xb41b('0x9')](),controller['index']);router['get']('/:id',auth[_0xb41b('0x9')](),controller[_0xb41b('0xa')]);router['get'](_0xb41b('0xb'),auth[_0xb41b('0x9')](),controller[_0xb41b('0xc')]);router[_0xb41b('0x8')](_0xb41b('0xd'),auth[_0xb41b('0x9')](),controller[_0xb41b('0xe')]);router['post']('/',auth[_0xb41b('0x9')](),controller['create']);router[_0xb41b('0xf')](_0xb41b('0xb'),auth[_0xb41b('0x9')](),controller[_0xb41b('0x10')]);router[_0xb41b('0x11')]('/:id',auth[_0xb41b('0x9')](),controller[_0xb41b('0x12')]);router[_0xb41b('0x13')](_0xb41b('0x14'),auth[_0xb41b('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xe605=['destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','getConfigurations','/:id/fields','getFields','post','/:id/configurations','put','/:id','update','delete'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0xe605,0x92));var _0x5e60=function(_0x17f52c,_0x25196a){_0x17f52c=_0x17f52c-0x0;var _0x55b3e8=_0xe605[_0x17f52c];return _0x55b3e8;};'use strict';var multer=require(_0x5e60('0x0'));var util=require(_0x5e60('0x1'));var path=require('path');var timeout=require(_0x5e60('0x2'));var express=require(_0x5e60('0x3'));var router=express[_0x5e60('0x4')]();var fs_extra=require(_0x5e60('0x5'));var auth=require(_0x5e60('0x6'));var interaction=require(_0x5e60('0x7'));var config=require(_0x5e60('0x8'));var controller=require(_0x5e60('0x9'));router[_0x5e60('0xa')]('/',auth[_0x5e60('0xb')](),controller[_0x5e60('0xc')]);router[_0x5e60('0xa')]('/:id',auth[_0x5e60('0xb')](),controller['show']);router['get']('/:id/configurations',auth[_0x5e60('0xb')](),controller[_0x5e60('0xd')]);router[_0x5e60('0xa')](_0x5e60('0xe'),auth[_0x5e60('0xb')](),controller[_0x5e60('0xf')]);router['post']('/',auth[_0x5e60('0xb')](),controller['create']);router[_0x5e60('0x10')](_0x5e60('0x11'),auth[_0x5e60('0xb')](),controller['addConfiguration']);router[_0x5e60('0x12')](_0x5e60('0x13'),auth[_0x5e60('0xb')](),controller[_0x5e60('0x14')]);router[_0x5e60('0x15')](_0x5e60('0x13'),auth['isAuthenticated'](),controller[_0x5e60('0x16')]);module[_0x5e60('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 30be764..66b9bc1 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 _0xdd4f=['username','remoteUri','sequelize','STRING'];(function(_0x3bf2d5,_0x36116c){var _0x29e958=function(_0x18ba76){while(--_0x18ba76){_0x3bf2d5['push'](_0x3bf2d5['shift']());}};_0x29e958(++_0x36116c);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x329d45,_0x2068a1){_0x329d45=_0x329d45-0x0;var _0x483c3c=_0xdd4f[_0x329d45];return _0x483c3c;};'use strict';var Sequelize=require(_0xfdd4('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xfdd4('0x1')],'unique':_0xfdd4('0x2')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xfdd4('0x1')],'unique':_0xfdd4('0x3')},'serverUrl':{'type':Sequelize[_0xfdd4('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xaebd=['remoteUri','sequelize','STRING','username'];(function(_0x12807b,_0x7c0dfb){var _0x5a676e=function(_0x2cb9d9){while(--_0x2cb9d9){_0x12807b['push'](_0x12807b['shift']());}};_0x5a676e(++_0x7c0dfb);}(_0xaebd,0x1e9));var _0xdaeb=function(_0x4631bc,_0x1a6727){_0x4631bc=_0x4631bc-0x0;var _0x6e1019=_0xaebd[_0x4631bc];return _0x6e1019;};'use strict';var Sequelize=require(_0xdaeb('0x0'));module['exports']={'name':{'type':Sequelize[_0xdaeb('0x1')]},'description':{'type':Sequelize[_0xdaeb('0x1')]},'username':{'type':Sequelize[_0xdaeb('0x1')],'unique':_0xdaeb('0x2')},'apiKey':{'type':Sequelize[_0xdaeb('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xdaeb('0x3')},'serverUrl':{'type':Sequelize[_0xdaeb('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index e2c242d..5050265 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 _0x3b29=['fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','FreshsalesAccount','includeAll','include','rows','rawAttributes','catch','create','body','find','params','destroy','getConfigurations','FreshsalesConfiguration','addConfiguration','findOne','AccountId','Subjects','channel','getDescriptions','FreshsalesField','Descriptions','username','apiKey','remoteUri','slice','substring','lastIndexOf','GET','format','%s%s','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','index'];(function(_0x4a7631,_0x2c85b9){var _0x1a5a6f=function(_0x1ee3fd){while(--_0x1ee3fd){_0x4a7631['push'](_0x4a7631['shift']());}};_0x1a5a6f(++_0x2c85b9);}(_0x3b29,0x110));var _0x93b2=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x3b29[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x93b2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x93b2('0x1'));var jsonpatch=require(_0x93b2('0x2'));var rp=require(_0x93b2('0x3'));var moment=require(_0x93b2('0x4'));var BPromise=require(_0x93b2('0x5'));var Mustache=require(_0x93b2('0x6'));var util=require(_0x93b2('0x7'));var path=require(_0x93b2('0x8'));var sox=require('sox');var csv=require(_0x93b2('0x9'));var ejs=require(_0x93b2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x93b2('0xb'));var squel=require(_0x93b2('0xc'));var crypto=require('crypto');var jsforce=require(_0x93b2('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x93b2('0xe'));var Papa=require(_0x93b2('0xf'));var Redis=require(_0x93b2('0x10'));var authService=require(_0x93b2('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x93b2('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x93b2('0x13'))('api');var utils=require(_0x93b2('0x14'));var config=require(_0x93b2('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x93b2('0x16'));function respondWithStatusCode(_0x133c6b,_0x5a2707){_0x5a2707=_0x5a2707||0xcc;return function(_0x4c5076){if(_0x4c5076){return _0x133c6b[_0x93b2('0x17')](_0x5a2707);}return _0x133c6b[_0x93b2('0x18')](_0x5a2707)[_0x93b2('0x19')]();};}function respondWithResult(_0x31a178,_0xf59dc2){_0xf59dc2=_0xf59dc2||0xc8;return function(_0x462f8a){if(_0x462f8a){return _0x31a178['status'](_0xf59dc2)['json'](_0x462f8a);}};}function respondWithFilteredResult(_0x3d849c,_0x3b5d6c){return function(_0x136f90){if(_0x136f90){var _0x4b5126=typeof _0x3b5d6c[_0x93b2('0x1a')]===_0x93b2('0x1b')&&typeof _0x3b5d6c['limit']===_0x93b2('0x1b');var _0xb981cd=_0x136f90[_0x93b2('0x1c')];var _0x48f33=_0x4b5126?0x0:_0x3b5d6c['offset'];var _0x5ca66e=_0x4b5126?_0x136f90[_0x93b2('0x1c')]:_0x3b5d6c[_0x93b2('0x1a')]+_0x3b5d6c[_0x93b2('0x1d')];var _0x269134;if(_0x5ca66e>=_0xb981cd){_0x5ca66e=_0xb981cd;_0x269134=0xc8;}else{_0x269134=0xce;}_0x3d849c[_0x93b2('0x18')](_0x269134);return _0x3d849c[_0x93b2('0x1e')](_0x93b2('0x1f'),_0x48f33+'-'+_0x5ca66e+'/'+_0xb981cd)[_0x93b2('0x20')](_0x136f90);}return null;};}function patchUpdates(_0x58ed65){return function(_0xefccd1){try{jsonpatch[_0x93b2('0x21')](_0xefccd1,_0x58ed65,!![]);}catch(_0x180153){return BPromise[_0x93b2('0x22')](_0x180153);}return _0xefccd1[_0x93b2('0x23')]();};}function saveUpdates(_0x462e07,_0x109d99){return function(_0x5c0ebb){if(_0x5c0ebb){return _0x5c0ebb[_0x93b2('0x24')](_0x462e07)[_0x93b2('0x25')](function(_0x2372c4){return _0x2372c4;});}return null;};}function removeEntity(_0x46a6bb,_0x3ff37a){return function(_0x270504){if(_0x270504){return _0x270504['destroy']()[_0x93b2('0x25')](function(){_0x46a6bb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x23d514,_0x16cf88){return function(_0x24e0a6){if(!_0x24e0a6){_0x23d514[_0x93b2('0x17')](0x194);}return _0x24e0a6;};}function handleError(_0x28267c,_0x129d67){_0x129d67=_0x129d67||0x1f4;return function(_0x31a773){logger[_0x93b2('0x26')](_0x31a773[_0x93b2('0x27')]);if(_0x31a773[_0x93b2('0x28')]){delete _0x31a773[_0x93b2('0x28')];}_0x28267c[_0x93b2('0x18')](_0x129d67)[_0x93b2('0x29')](_0x31a773);};}exports[_0x93b2('0x2a')]=function(_0x173d8e,_0x4fd9d4){var _0x38ab32={},_0x25285b={},_0x30d877={'count':0x0,'rows':[]};var _0x1e22bb=_['map'](db['FreshsalesAccount']['rawAttributes'],function(_0x3ffcec){return{'name':_0x3ffcec[_0x93b2('0x2b')],'type':_0x3ffcec[_0x93b2('0x2c')][_0x93b2('0x2d')]};});_0x25285b[_0x93b2('0x2e')]=_[_0x93b2('0x2f')](_0x1e22bb,_0x93b2('0x28'));_0x25285b[_0x93b2('0x30')]=_[_0x93b2('0x31')](_0x173d8e[_0x93b2('0x30')]);_0x25285b[_0x93b2('0x32')]=_[_0x93b2('0x33')](_0x25285b['model'],_0x25285b[_0x93b2('0x30')]);_0x38ab32[_0x93b2('0x34')]=_[_0x93b2('0x33')](_0x25285b[_0x93b2('0x2e')],qs['fields'](_0x173d8e['query'][_0x93b2('0x35')]));_0x38ab32[_0x93b2('0x34')]=_0x38ab32['attributes'][_0x93b2('0x36')]?_0x38ab32[_0x93b2('0x34')]:_0x25285b[_0x93b2('0x2e')];if(!_0x173d8e['query'][_0x93b2('0x37')](_0x93b2('0x38'))){_0x38ab32[_0x93b2('0x1d')]=qs[_0x93b2('0x1d')](_0x173d8e[_0x93b2('0x30')][_0x93b2('0x1d')]);_0x38ab32[_0x93b2('0x1a')]=qs['offset'](_0x173d8e[_0x93b2('0x30')][_0x93b2('0x1a')]);}_0x38ab32[_0x93b2('0x39')]=qs[_0x93b2('0x3a')](_0x173d8e[_0x93b2('0x30')]['sort']);_0x38ab32[_0x93b2('0x3b')]=qs[_0x93b2('0x32')](_[_0x93b2('0x3c')](_0x173d8e[_0x93b2('0x30')],_0x25285b[_0x93b2('0x32')]),_0x1e22bb);if(_0x173d8e['query'][_0x93b2('0x3d')]){_0x38ab32[_0x93b2('0x3b')]=_[_0x93b2('0x3e')](_0x38ab32[_0x93b2('0x3b')],{'$or':_['map'](_0x1e22bb,function(_0x2d214f){if(_0x2d214f['type']!==_0x93b2('0x3f')){var _0x167b98={};_0x167b98[_0x2d214f['name']]={'$like':'%'+_0x173d8e[_0x93b2('0x30')]['filter']+'%'};return _0x167b98;}})});}_0x38ab32=_[_0x93b2('0x3e')]({},_0x38ab32,_0x173d8e[_0x93b2('0x40')]);var _0x225638={'where':_0x38ab32[_0x93b2('0x3b')]};return db[_0x93b2('0x41')][_0x93b2('0x1c')](_0x225638)[_0x93b2('0x25')](function(_0x36423e){_0x30d877['count']=_0x36423e;if(_0x173d8e['query'][_0x93b2('0x42')]){_0x38ab32[_0x93b2('0x43')]=[{'all':!![]}];}return db['FreshsalesAccount']['findAll'](_0x38ab32);})[_0x93b2('0x25')](function(_0x23a75c){_0x30d877[_0x93b2('0x44')]=_0x23a75c;return _0x30d877;})['then'](respondWithFilteredResult(_0x4fd9d4,_0x38ab32))['catch'](handleError(_0x4fd9d4,null));};exports['show']=function(_0x55058d,_0x5b60c3){var _0x4234f9={'raw':![],'where':{'id':_0x55058d['params']['id']}},_0x45cd17={};_0x45cd17['model']=_[_0x93b2('0x31')](db[_0x93b2('0x41')][_0x93b2('0x45')]);_0x45cd17['query']=_['keys'](_0x55058d[_0x93b2('0x30')]);_0x45cd17[_0x93b2('0x32')]=_[_0x93b2('0x33')](_0x45cd17[_0x93b2('0x2e')],_0x45cd17[_0x93b2('0x30')]);_0x4234f9['attributes']=_[_0x93b2('0x33')](_0x45cd17[_0x93b2('0x2e')],qs['fields'](_0x55058d[_0x93b2('0x30')][_0x93b2('0x35')]));_0x4234f9[_0x93b2('0x34')]=_0x4234f9[_0x93b2('0x34')]['length']?_0x4234f9[_0x93b2('0x34')]:_0x45cd17[_0x93b2('0x2e')];if(_0x55058d['query'][_0x93b2('0x42')]){_0x4234f9['include']=[{'all':!![]}];}_0x4234f9=_[_0x93b2('0x3e')]({},_0x4234f9,_0x55058d[_0x93b2('0x40')]);return db[_0x93b2('0x41')]['find'](_0x4234f9)['then'](handleEntityNotFound(_0x5b60c3,null))[_0x93b2('0x25')](respondWithResult(_0x5b60c3,null))[_0x93b2('0x46')](handleError(_0x5b60c3,null));};exports['create']=function(_0x15a43e,_0x167e12){return db[_0x93b2('0x41')][_0x93b2('0x47')](_0x15a43e['body'],{})[_0x93b2('0x25')](respondWithResult(_0x167e12,0xc9))[_0x93b2('0x46')](handleError(_0x167e12,null));};exports[_0x93b2('0x24')]=function(_0x1aab08,_0x14ad4f){if(_0x1aab08[_0x93b2('0x48')]['id']){delete _0x1aab08[_0x93b2('0x48')]['id'];}return db[_0x93b2('0x41')][_0x93b2('0x49')]({'where':{'id':_0x1aab08[_0x93b2('0x4a')]['id']}})[_0x93b2('0x25')](handleEntityNotFound(_0x14ad4f,null))['then'](saveUpdates(_0x1aab08[_0x93b2('0x48')],null))[_0x93b2('0x25')](respondWithResult(_0x14ad4f,null))[_0x93b2('0x46')](handleError(_0x14ad4f,null));};exports[_0x93b2('0x4b')]=function(_0xcbdfba,_0x25d308){return db['FreshsalesAccount'][_0x93b2('0x49')]({'where':{'id':_0xcbdfba[_0x93b2('0x4a')]['id']}})[_0x93b2('0x25')](handleEntityNotFound(_0x25d308,null))['then'](removeEntity(_0x25d308,null))['catch'](handleError(_0x25d308,null));};exports[_0x93b2('0x4c')]=function(_0x12b0f4,_0x318b7b,_0xb9430f){var _0x325a81={};var _0x2d37e0={};var _0xea74d3;var _0x4c669c;return db[_0x93b2('0x41')]['findOne']({'where':{'id':_0x12b0f4['params']['id']}})[_0x93b2('0x25')](handleEntityNotFound(_0x318b7b,null))[_0x93b2('0x25')](function(_0x5022bf){if(_0x5022bf){_0xea74d3=_0x5022bf;_0x2d37e0['model']=_[_0x93b2('0x31')](db[_0x93b2('0x4d')][_0x93b2('0x45')]);_0x2d37e0['query']=_['keys'](_0x12b0f4[_0x93b2('0x30')]);_0x2d37e0[_0x93b2('0x32')]=_['intersection'](_0x2d37e0['model'],_0x2d37e0['query']);_0x325a81['attributes']=_[_0x93b2('0x33')](_0x2d37e0[_0x93b2('0x2e')],qs[_0x93b2('0x35')](_0x12b0f4['query'][_0x93b2('0x35')]));_0x325a81[_0x93b2('0x34')]=_0x325a81[_0x93b2('0x34')][_0x93b2('0x36')]?_0x325a81[_0x93b2('0x34')]:_0x2d37e0[_0x93b2('0x2e')];_0x325a81[_0x93b2('0x39')]=qs[_0x93b2('0x3a')](_0x12b0f4[_0x93b2('0x30')]['sort']);_0x325a81[_0x93b2('0x3b')]=qs[_0x93b2('0x32')](_[_0x93b2('0x3c')](_0x12b0f4[_0x93b2('0x30')],_0x2d37e0[_0x93b2('0x32')]));if(_0x12b0f4[_0x93b2('0x30')][_0x93b2('0x3d')]){_0x325a81[_0x93b2('0x3b')]=_[_0x93b2('0x3e')](_0x325a81[_0x93b2('0x3b')],{'$or':_[_0x93b2('0x2f')](_0x325a81[_0x93b2('0x34')],function(_0x10f869){var _0x20a15e={};_0x20a15e[_0x10f869]={'$like':'%'+_0x12b0f4[_0x93b2('0x30')]['filter']+'%'};return _0x20a15e;})});}_0x325a81=_[_0x93b2('0x3e')]({},_0x325a81,_0x12b0f4[_0x93b2('0x40')]);return _0xea74d3[_0x93b2('0x4c')](_0x325a81);}})[_0x93b2('0x25')](function(_0x5254f3){if(_0x5254f3){_0x4c669c=_0x5254f3['length'];if(!_0x12b0f4[_0x93b2('0x30')][_0x93b2('0x37')](_0x93b2('0x38'))){_0x325a81[_0x93b2('0x1d')]=qs[_0x93b2('0x1d')](_0x12b0f4['query'][_0x93b2('0x1d')]);_0x325a81[_0x93b2('0x1a')]=qs[_0x93b2('0x1a')](_0x12b0f4[_0x93b2('0x30')]['offset']);}return _0xea74d3[_0x93b2('0x4c')](_0x325a81);}})[_0x93b2('0x25')](function(_0x1764a4){if(_0x1764a4){return _0x1764a4?{'count':_0x4c669c,'rows':_0x1764a4}:null;}})[_0x93b2('0x25')](respondWithResult(_0x318b7b,null))[_0x93b2('0x46')](handleError(_0x318b7b,null));};exports[_0x93b2('0x4e')]=function(_0x3b6445,_0x52bdc1,_0x9ce32b){if(_0x3b6445[_0x93b2('0x48')]['id']){delete _0x3b6445[_0x93b2('0x48')]['id'];}return db[_0x93b2('0x41')][_0x93b2('0x4f')]({'where':{'id':_0x3b6445['params']['id']}})[_0x93b2('0x25')](handleEntityNotFound(_0x52bdc1,null))[_0x93b2('0x25')](function(_0x36c061){if(_0x36c061){_0x3b6445[_0x93b2('0x48')][_0x93b2('0x50')]=_0x36c061['id'];_0x3b6445[_0x93b2('0x48')][_0x93b2('0x51')]=integrations['getSubjects'](_0x3b6445[_0x93b2('0x48')][_0x93b2('0x52')],_0x3b6445['body'][_0x93b2('0x2c')]);_0x3b6445[_0x93b2('0x48')]['Descriptions']=integrations[_0x93b2('0x53')](_0x3b6445['body'][_0x93b2('0x52')],_0x3b6445[_0x93b2('0x48')][_0x93b2('0x2c')]);return db[_0x93b2('0x4d')][_0x93b2('0x47')](_0x3b6445[_0x93b2('0x48')],{'include':[{'model':db[_0x93b2('0x54')],'as':_0x93b2('0x51')},{'model':db[_0x93b2('0x54')],'as':_0x93b2('0x55')}]});}return null;})[_0x93b2('0x25')](respondWithResult(_0x52bdc1,null))[_0x93b2('0x46')](handleError(_0x52bdc1,null));};exports['getFields']=function(_0x1f06d0,_0x5cc54f,_0xcee5d6){var _0xab7366='';var _0x228fb9='';return db['FreshsalesAccount'][_0x93b2('0x4f')]({'where':{'id':_0x1f06d0[_0x93b2('0x4a')]['id']},'attributes':['id',_0x93b2('0x56'),'remoteUri',_0x93b2('0x57')]})[_0x93b2('0x25')](handleEntityNotFound(_0x5cc54f,null))['then'](function(_0x525082){if(_0x525082){_0x228fb9=_0x525082['username'];_0xab7366=_0x525082[_0x93b2('0x58')];var _0x224ad9=_0x525082['remoteUri'][_0x93b2('0x59')](-0x1);if(_0x224ad9==='/'){_0xab7366=_0xab7366[_0x93b2('0x5a')](0x0,_0xab7366[_0x93b2('0x5b')](_0x224ad9));}return rp({'method':_0x93b2('0x5c'),'uri':util[_0x93b2('0x5d')](_0x93b2('0x5e'),_0xab7366,'/api/selector/owners'),'headers':{'Authorization':_0x93b2('0x5f')+_0x525082[_0x93b2('0x57')]},'json':!![]});}})['then'](function(_0x509733){if(_0x509733){var _0x29527b=_0x509733[_0x93b2('0x60')];var _0x5393b5=![];var _0x327420=null;for(_0x327420=0x0;_0x327420<_0x29527b['length'];_0x327420++){if(_0x29527b[_0x327420][_0x93b2('0x61')]===_0x228fb9){_0x5393b5=!![];}}if(_0x5393b5){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x93b2('0x62')});}}})['then'](respondWithResult(_0x5cc54f,null))[_0x93b2('0x46')](function(_0x41d3d7){var _0x59d96e=_0x1f06d0[_0x93b2('0x30')][_0x93b2('0x63')]?0x1f4:_0x41d3d7[_0x93b2('0x64')]||0x1f4;logger[_0x93b2('0x26')](_0x93b2('0x65'),_0x93b2('0x66'),_0x59d96e,JSON[_0x93b2('0x67')](_0x41d3d7));delete _0x41d3d7[_0x93b2('0x28')];if(_0x59d96e===0x191){_0x59d96e=0x190;}_0x5cc54f[_0x93b2('0x18')](_0x59d96e)[_0x93b2('0x29')](_0x1f06d0[_0x93b2('0x30')]['test']?{'message':_0x93b2('0x68'),'statusCode':_0x41d3d7[_0x93b2('0x64')]}:_0x41d3d7);});}; \ No newline at end of file +var _0x27a6=['send','index','map','FreshsalesAccount','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','destroy','getConfigurations','findOne','FreshsalesConfiguration','length','addConfiguration','AccountId','Subjects','getSubjects','type','Descriptions','getDescriptions','channel','FreshsalesField','getFields','username','remoteUri','apiKey','slice','substring','lastIndexOf','GET','%s%s','/api/selector/owners','Token\x20token=','users','Requested\x20Resource\x20not\x20Found','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','name'];(function(_0x428584,_0x2e24a0){var _0x43bc08=function(_0x832db9){while(--_0x832db9){_0x428584['push'](_0x428584['shift']());}};_0x43bc08(++_0x2e24a0);}(_0x27a6,0x10e));var _0x627a=function(_0xc3f0cd,_0x3886a2){_0xc3f0cd=_0xc3f0cd-0x0;var _0x14a8c4=_0x27a6[_0xc3f0cd];return _0x14a8c4;};'use strict';var emlformat=require(_0x627a('0x0'));var rimraf=require(_0x627a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x627a('0x2'));var moment=require(_0x627a('0x3'));var BPromise=require(_0x627a('0x4'));var Mustache=require(_0x627a('0x5'));var util=require(_0x627a('0x6'));var path=require(_0x627a('0x7'));var sox=require('sox');var csv=require(_0x627a('0x8'));var ejs=require(_0x627a('0x9'));var fs=require('fs');var fs_extra=require(_0x627a('0xa'));var _=require(_0x627a('0xb'));var squel=require(_0x627a('0xc'));var crypto=require('crypto');var jsforce=require(_0x627a('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x627a('0xe'));var Papa=require(_0x627a('0xf'));var Redis=require(_0x627a('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x627a('0x11'));var hardwareService=require(_0x627a('0x12'));var logger=require(_0x627a('0x13'))(_0x627a('0x14'));var utils=require(_0x627a('0x15'));var config=require(_0x627a('0x16'));var licenseUtil=require(_0x627a('0x17'));var db=require(_0x627a('0x18'))['db'];var integrations=require(_0x627a('0x19'));function respondWithStatusCode(_0x181950,_0x1bb128){_0x1bb128=_0x1bb128||0xcc;return function(_0x216b0c){if(_0x216b0c){return _0x181950[_0x627a('0x1a')](_0x1bb128);}return _0x181950[_0x627a('0x1b')](_0x1bb128)['end']();};}function respondWithResult(_0x5cebe6,_0x484896){_0x484896=_0x484896||0xc8;return function(_0x4965b1){if(_0x4965b1){return _0x5cebe6[_0x627a('0x1b')](_0x484896)[_0x627a('0x1c')](_0x4965b1);}};}function respondWithFilteredResult(_0x44ac68,_0x45b356){return function(_0x2e8d3b){if(_0x2e8d3b){var _0x364b48=typeof _0x45b356[_0x627a('0x1d')]===_0x627a('0x1e')&&typeof _0x45b356[_0x627a('0x1f')]===_0x627a('0x1e');var _0x45fca3=_0x2e8d3b[_0x627a('0x20')];var _0x538884=_0x364b48?0x0:_0x45b356[_0x627a('0x1d')];var _0x4be2ad=_0x364b48?_0x2e8d3b[_0x627a('0x20')]:_0x45b356[_0x627a('0x1d')]+_0x45b356[_0x627a('0x1f')];var _0x227749;if(_0x4be2ad>=_0x45fca3){_0x4be2ad=_0x45fca3;_0x227749=0xc8;}else{_0x227749=0xce;}_0x44ac68[_0x627a('0x1b')](_0x227749);return _0x44ac68[_0x627a('0x21')](_0x627a('0x22'),_0x538884+'-'+_0x4be2ad+'/'+_0x45fca3)[_0x627a('0x1c')](_0x2e8d3b);}return null;};}function patchUpdates(_0x1a10db){return function(_0x4c64e4){try{jsonpatch[_0x627a('0x23')](_0x4c64e4,_0x1a10db,!![]);}catch(_0x1824ec){return BPromise[_0x627a('0x24')](_0x1824ec);}return _0x4c64e4[_0x627a('0x25')]();};}function saveUpdates(_0x5e27d0,_0x5eb5a4){return function(_0x3936ca){if(_0x3936ca){return _0x3936ca[_0x627a('0x26')](_0x5e27d0)[_0x627a('0x27')](function(_0x1647d6){return _0x1647d6;});}return null;};}function removeEntity(_0x38fb8f,_0x5a6810){return function(_0x352b10){if(_0x352b10){return _0x352b10['destroy']()[_0x627a('0x27')](function(){_0x38fb8f[_0x627a('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0xb8e309,_0x285642){return function(_0x7e5839){if(!_0x7e5839){_0xb8e309['sendStatus'](0x194);}return _0x7e5839;};}function handleError(_0x332c58,_0x441a13){_0x441a13=_0x441a13||0x1f4;return function(_0x45253f){logger[_0x627a('0x28')](_0x45253f['stack']);if(_0x45253f[_0x627a('0x29')]){delete _0x45253f[_0x627a('0x29')];}_0x332c58[_0x627a('0x1b')](_0x441a13)[_0x627a('0x2a')](_0x45253f);};}exports[_0x627a('0x2b')]=function(_0x12f073,_0x5f148f){var _0x1b9264={},_0xffaa2b={},_0x3cb95a={'count':0x0,'rows':[]};var _0x1e4615=_[_0x627a('0x2c')](db[_0x627a('0x2d')][_0x627a('0x2e')],function(_0xe8a5d1){return{'name':_0xe8a5d1[_0x627a('0x2f')],'type':_0xe8a5d1['type'][_0x627a('0x30')]};});_0xffaa2b[_0x627a('0x31')]=_[_0x627a('0x2c')](_0x1e4615,'name');_0xffaa2b[_0x627a('0x32')]=_[_0x627a('0x33')](_0x12f073[_0x627a('0x32')]);_0xffaa2b['filters']=_[_0x627a('0x34')](_0xffaa2b['model'],_0xffaa2b[_0x627a('0x32')]);_0x1b9264[_0x627a('0x35')]=_['intersection'](_0xffaa2b['model'],qs[_0x627a('0x36')](_0x12f073[_0x627a('0x32')][_0x627a('0x36')]));_0x1b9264[_0x627a('0x35')]=_0x1b9264[_0x627a('0x35')]['length']?_0x1b9264[_0x627a('0x35')]:_0xffaa2b[_0x627a('0x31')];if(!_0x12f073[_0x627a('0x32')][_0x627a('0x37')](_0x627a('0x38'))){_0x1b9264[_0x627a('0x1f')]=qs[_0x627a('0x1f')](_0x12f073['query'][_0x627a('0x1f')]);_0x1b9264[_0x627a('0x1d')]=qs[_0x627a('0x1d')](_0x12f073[_0x627a('0x32')]['offset']);}_0x1b9264[_0x627a('0x39')]=qs['sort'](_0x12f073['query'][_0x627a('0x3a')]);_0x1b9264[_0x627a('0x3b')]=qs['filters'](_[_0x627a('0x3c')](_0x12f073[_0x627a('0x32')],_0xffaa2b[_0x627a('0x3d')]),_0x1e4615);if(_0x12f073['query'][_0x627a('0x3e')]){_0x1b9264[_0x627a('0x3b')]=_[_0x627a('0x3f')](_0x1b9264[_0x627a('0x3b')],{'$or':_[_0x627a('0x2c')](_0x1e4615,function(_0x5451fe){if(_0x5451fe['type']!=='VIRTUAL'){var _0x22b29a={};_0x22b29a[_0x5451fe['name']]={'$like':'%'+_0x12f073[_0x627a('0x32')][_0x627a('0x3e')]+'%'};return _0x22b29a;}})});}_0x1b9264=_[_0x627a('0x3f')]({},_0x1b9264,_0x12f073[_0x627a('0x40')]);var _0x679c11={'where':_0x1b9264[_0x627a('0x3b')]};return db['FreshsalesAccount'][_0x627a('0x20')](_0x679c11)[_0x627a('0x27')](function(_0x49cd11){_0x3cb95a[_0x627a('0x20')]=_0x49cd11;if(_0x12f073[_0x627a('0x32')][_0x627a('0x41')]){_0x1b9264[_0x627a('0x42')]=[{'all':!![]}];}return db[_0x627a('0x2d')][_0x627a('0x43')](_0x1b9264);})[_0x627a('0x27')](function(_0x4cc350){_0x3cb95a[_0x627a('0x44')]=_0x4cc350;return _0x3cb95a;})['then'](respondWithFilteredResult(_0x5f148f,_0x1b9264))['catch'](handleError(_0x5f148f,null));};exports[_0x627a('0x45')]=function(_0x1d8c79,_0x2b7226){var _0x356574={'raw':![],'where':{'id':_0x1d8c79[_0x627a('0x46')]['id']}},_0x1871bd={};_0x1871bd[_0x627a('0x31')]=_['keys'](db['FreshsalesAccount'][_0x627a('0x2e')]);_0x1871bd['query']=_[_0x627a('0x33')](_0x1d8c79[_0x627a('0x32')]);_0x1871bd[_0x627a('0x3d')]=_[_0x627a('0x34')](_0x1871bd[_0x627a('0x31')],_0x1871bd[_0x627a('0x32')]);_0x356574[_0x627a('0x35')]=_[_0x627a('0x34')](_0x1871bd['model'],qs['fields'](_0x1d8c79[_0x627a('0x32')][_0x627a('0x36')]));_0x356574[_0x627a('0x35')]=_0x356574[_0x627a('0x35')]['length']?_0x356574[_0x627a('0x35')]:_0x1871bd[_0x627a('0x31')];if(_0x1d8c79[_0x627a('0x32')]['includeAll']){_0x356574[_0x627a('0x42')]=[{'all':!![]}];}_0x356574=_[_0x627a('0x3f')]({},_0x356574,_0x1d8c79[_0x627a('0x40')]);return db['FreshsalesAccount'][_0x627a('0x47')](_0x356574)['then'](handleEntityNotFound(_0x2b7226,null))['then'](respondWithResult(_0x2b7226,null))[_0x627a('0x48')](handleError(_0x2b7226,null));};exports[_0x627a('0x49')]=function(_0x265dd3,_0x386ce7){return db[_0x627a('0x2d')][_0x627a('0x49')](_0x265dd3[_0x627a('0x4a')],{})[_0x627a('0x27')](respondWithResult(_0x386ce7,0xc9))['catch'](handleError(_0x386ce7,null));};exports['update']=function(_0x5b9b68,_0x298e4d){if(_0x5b9b68[_0x627a('0x4a')]['id']){delete _0x5b9b68[_0x627a('0x4a')]['id'];}return db[_0x627a('0x2d')][_0x627a('0x47')]({'where':{'id':_0x5b9b68[_0x627a('0x46')]['id']}})[_0x627a('0x27')](handleEntityNotFound(_0x298e4d,null))[_0x627a('0x27')](saveUpdates(_0x5b9b68[_0x627a('0x4a')],null))['then'](respondWithResult(_0x298e4d,null))[_0x627a('0x48')](handleError(_0x298e4d,null));};exports[_0x627a('0x4b')]=function(_0x322d49,_0xd0cb4e){return db['FreshsalesAccount'][_0x627a('0x47')]({'where':{'id':_0x322d49[_0x627a('0x46')]['id']}})[_0x627a('0x27')](handleEntityNotFound(_0xd0cb4e,null))['then'](removeEntity(_0xd0cb4e,null))[_0x627a('0x48')](handleError(_0xd0cb4e,null));};exports[_0x627a('0x4c')]=function(_0x4af0d3,_0xdbd535,_0x4abaf8){var _0xd6dc20={};var _0x20e305={};var _0x3ce08a;var _0x3c3e80;return db[_0x627a('0x2d')][_0x627a('0x4d')]({'where':{'id':_0x4af0d3['params']['id']}})[_0x627a('0x27')](handleEntityNotFound(_0xdbd535,null))[_0x627a('0x27')](function(_0x3bc314){if(_0x3bc314){_0x3ce08a=_0x3bc314;_0x20e305[_0x627a('0x31')]=_[_0x627a('0x33')](db[_0x627a('0x4e')][_0x627a('0x2e')]);_0x20e305[_0x627a('0x32')]=_[_0x627a('0x33')](_0x4af0d3[_0x627a('0x32')]);_0x20e305[_0x627a('0x3d')]=_[_0x627a('0x34')](_0x20e305['model'],_0x20e305[_0x627a('0x32')]);_0xd6dc20[_0x627a('0x35')]=_['intersection'](_0x20e305[_0x627a('0x31')],qs[_0x627a('0x36')](_0x4af0d3[_0x627a('0x32')][_0x627a('0x36')]));_0xd6dc20[_0x627a('0x35')]=_0xd6dc20[_0x627a('0x35')][_0x627a('0x4f')]?_0xd6dc20[_0x627a('0x35')]:_0x20e305[_0x627a('0x31')];_0xd6dc20['order']=qs[_0x627a('0x3a')](_0x4af0d3[_0x627a('0x32')][_0x627a('0x3a')]);_0xd6dc20['where']=qs['filters'](_[_0x627a('0x3c')](_0x4af0d3[_0x627a('0x32')],_0x20e305[_0x627a('0x3d')]));if(_0x4af0d3[_0x627a('0x32')][_0x627a('0x3e')]){_0xd6dc20[_0x627a('0x3b')]=_['merge'](_0xd6dc20[_0x627a('0x3b')],{'$or':_[_0x627a('0x2c')](_0xd6dc20['attributes'],function(_0x1ba9d7){var _0x3ef2e9={};_0x3ef2e9[_0x1ba9d7]={'$like':'%'+_0x4af0d3['query'][_0x627a('0x3e')]+'%'};return _0x3ef2e9;})});}_0xd6dc20=_[_0x627a('0x3f')]({},_0xd6dc20,_0x4af0d3[_0x627a('0x40')]);return _0x3ce08a[_0x627a('0x4c')](_0xd6dc20);}})[_0x627a('0x27')](function(_0x9e55d4){if(_0x9e55d4){_0x3c3e80=_0x9e55d4[_0x627a('0x4f')];if(!_0x4af0d3[_0x627a('0x32')][_0x627a('0x37')](_0x627a('0x38'))){_0xd6dc20[_0x627a('0x1f')]=qs[_0x627a('0x1f')](_0x4af0d3['query']['limit']);_0xd6dc20[_0x627a('0x1d')]=qs[_0x627a('0x1d')](_0x4af0d3[_0x627a('0x32')][_0x627a('0x1d')]);}return _0x3ce08a[_0x627a('0x4c')](_0xd6dc20);}})[_0x627a('0x27')](function(_0x1bad60){if(_0x1bad60){return _0x1bad60?{'count':_0x3c3e80,'rows':_0x1bad60}:null;}})[_0x627a('0x27')](respondWithResult(_0xdbd535,null))['catch'](handleError(_0xdbd535,null));};exports[_0x627a('0x50')]=function(_0x2580c7,_0x456e78,_0x533806){if(_0x2580c7['body']['id']){delete _0x2580c7[_0x627a('0x4a')]['id'];}return db['FreshsalesAccount']['findOne']({'where':{'id':_0x2580c7['params']['id']}})['then'](handleEntityNotFound(_0x456e78,null))['then'](function(_0x1ddbbb){if(_0x1ddbbb){_0x2580c7[_0x627a('0x4a')][_0x627a('0x51')]=_0x1ddbbb['id'];_0x2580c7['body'][_0x627a('0x52')]=integrations[_0x627a('0x53')](_0x2580c7['body']['channel'],_0x2580c7[_0x627a('0x4a')][_0x627a('0x54')]);_0x2580c7[_0x627a('0x4a')][_0x627a('0x55')]=integrations[_0x627a('0x56')](_0x2580c7[_0x627a('0x4a')][_0x627a('0x57')],_0x2580c7[_0x627a('0x4a')][_0x627a('0x54')]);return db[_0x627a('0x4e')]['create'](_0x2580c7[_0x627a('0x4a')],{'include':[{'model':db[_0x627a('0x58')],'as':_0x627a('0x52')},{'model':db['FreshsalesField'],'as':_0x627a('0x55')}]});}return null;})[_0x627a('0x27')](respondWithResult(_0x456e78,null))[_0x627a('0x48')](handleError(_0x456e78,null));};exports[_0x627a('0x59')]=function(_0x156cc7,_0x172386,_0x1ec49d){var _0x3587e0='';var _0x481932='';return db[_0x627a('0x2d')][_0x627a('0x4d')]({'where':{'id':_0x156cc7[_0x627a('0x46')]['id']},'attributes':['id',_0x627a('0x5a'),_0x627a('0x5b'),_0x627a('0x5c')]})[_0x627a('0x27')](handleEntityNotFound(_0x172386,null))[_0x627a('0x27')](function(_0x44d412){if(_0x44d412){_0x481932=_0x44d412['username'];_0x3587e0=_0x44d412['remoteUri'];var _0x3ec628=_0x44d412['remoteUri'][_0x627a('0x5d')](-0x1);if(_0x3ec628==='/'){_0x3587e0=_0x3587e0[_0x627a('0x5e')](0x0,_0x3587e0[_0x627a('0x5f')](_0x3ec628));}return rp({'method':_0x627a('0x60'),'uri':util['format'](_0x627a('0x61'),_0x3587e0,_0x627a('0x62')),'headers':{'Authorization':_0x627a('0x63')+_0x44d412[_0x627a('0x5c')]},'json':!![]});}})[_0x627a('0x27')](function(_0xd9c381){if(_0xd9c381){var _0x27a8b0=_0xd9c381[_0x627a('0x64')];var _0x36f4e1=![];var _0x25385f=null;for(_0x25385f=0x0;_0x25385f<_0x27a8b0[_0x627a('0x4f')];_0x25385f++){if(_0x27a8b0[_0x25385f]['email']===_0x481932){_0x36f4e1=!![];}}if(_0x36f4e1){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x627a('0x65')});}}})['then'](respondWithResult(_0x172386,null))[_0x627a('0x48')](function(_0x576316){var _0xb12154=_0x156cc7[_0x627a('0x32')]['test']?0x1f4:_0x576316['statusCode']||0x1f4;logger[_0x627a('0x28')](_0x627a('0x66'),_0x627a('0x59'),_0xb12154,JSON['stringify'](_0x576316));delete _0x576316['name'];if(_0xb12154===0x191){_0xb12154=0x190;}_0x172386[_0x627a('0x1b')](_0xb12154)[_0x627a('0x2a')](_0x156cc7[_0x627a('0x32')]['test']?{'message':_0x627a('0x67'),'statusCode':_0x576316['statusCode']}:_0x576316);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 855821b..55609c2 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 _0x781d=['rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts','lodash','util','moment','bluebird','request-promise','path'];(function(_0xe47dea,_0x423e89){var _0x36f139=function(_0x5880ba){while(--_0x5880ba){_0xe47dea['push'](_0xe47dea['shift']());}};_0x36f139(++_0x423e89);}(_0x781d,0x14a));var _0xd781=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x781d[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0xd781('0x0'));var util=require(_0xd781('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xd781('0x2'));var BPromise=require(_0xd781('0x3'));var rp=require(_0xd781('0x4'));var fs=require('fs');var path=require(_0xd781('0x5'));var rimraf=require(_0xd781('0x6'));var config=require(_0xd781('0x7'));var attributes=require(_0xd781('0x8'));var integrations=require(_0xd781('0x9'));module[_0xd781('0xa')]=function(_0x2f98ee,_0x5a07f0){return _0x2f98ee[_0xd781('0xb')](_0xd781('0xc'),attributes,{'tableName':_0xd781('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4c60=['exports','define','FreshsalesAccount','lodash','util','../../config/logger','api','bluebird','./intFreshsalesAccount.attributes','../../components/integrations/configuration'];(function(_0x49a3f7,_0x30e828){var _0x404170=function(_0x219d13){while(--_0x219d13){_0x49a3f7['push'](_0x49a3f7['shift']());}};_0x404170(++_0x30e828);}(_0x4c60,0xc1));var _0x04c6=function(_0x145726,_0x156786){_0x145726=_0x145726-0x0;var _0x1aace1=_0x4c60[_0x145726];return _0x1aace1;};'use strict';var _=require(_0x04c6('0x0'));var util=require(_0x04c6('0x1'));var logger=require(_0x04c6('0x2'))(_0x04c6('0x3'));var moment=require('moment');var BPromise=require(_0x04c6('0x4'));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(_0x04c6('0x5'));var integrations=require(_0x04c6('0x6'));module[_0x04c6('0x7')]=function(_0x12bd5d,_0x2b9041){return _0x12bd5d[_0x04c6('0x8')](_0x04c6('0x9'),attributes,{'tableName':'int_freshsales_accounts','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 3b65123..8b9a9b8 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 _0x2da6=['info','FreshsalesAccount,\x20%s,\x20%s','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','FreshsalesAccount','options','raw','where','attributes','include','map','model','GetFreshsalesAccount','ShowFreshsalesAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then'];(function(_0xdfcf22,_0x322509){var _0x59b62f=function(_0x3a745f){while(--_0x3a745f){_0xdfcf22['push'](_0xdfcf22['shift']());}};_0x59b62f(++_0x322509);}(_0x2da6,0x1dd));var _0x62da=function(_0x30c40e,_0x348e35){_0x30c40e=_0x30c40e-0x0;var _0x46b9fc=_0x2da6[_0x30c40e];return _0x46b9fc;};'use strict';var _=require(_0x62da('0x0'));var util=require(_0x62da('0x1'));var moment=require(_0x62da('0x2'));var BPromise=require(_0x62da('0x3'));var rs=require(_0x62da('0x4'));var fs=require('fs');var Redis=require(_0x62da('0x5'));var db=require(_0x62da('0x6'))['db'];var utils=require(_0x62da('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x62da('0x8'));var jayson=require(_0x62da('0x9'));var client=jayson[_0x62da('0xa')][_0x62da('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x100e73,_0x9d9139,_0x310c15){return new BPromise(function(_0x16f919,_0xbfd2b0){return client['request'](_0x100e73,_0x310c15)[_0x62da('0xc')](function(_0x2a3937){logger[_0x62da('0xd')](_0x62da('0xe'),_0x9d9139,'request\x20sent');logger[_0x62da('0xf')](_0x62da('0x10'),_0x9d9139,_0x62da('0x11'),JSON[_0x62da('0x12')](_0x2a3937));if(_0x2a3937[_0x62da('0x13')]){if(_0x2a3937['error'][_0x62da('0x14')]===0x1f4){logger[_0x62da('0x13')](_0x62da('0xe'),_0x9d9139,_0x2a3937[_0x62da('0x13')][_0x62da('0x15')]);return _0xbfd2b0(_0x2a3937['error']['message']);}logger[_0x62da('0x13')](_0x62da('0xe'),_0x9d9139,_0x2a3937[_0x62da('0x13')][_0x62da('0x15')]);return _0x16f919(_0x2a3937[_0x62da('0x13')][_0x62da('0x15')]);}else{logger[_0x62da('0xd')](_0x62da('0xe'),_0x9d9139,_0x62da('0x11'));_0x16f919(_0x2a3937[_0x62da('0x16')][_0x62da('0x15')]);}})[_0x62da('0x17')](function(_0x1f6bc8){logger[_0x62da('0x13')]('FreshsalesAccount,\x20%s,\x20%s',_0x9d9139,_0x1f6bc8);_0xbfd2b0(_0x1f6bc8);});});}exports['GetFreshsalesAccount']=function(_0xa7050b){var _0x4ae4fb=this;return new Promise(function(_0x4d6482,_0x264366){return db[_0x62da('0x18')]['findAll']({'raw':_0xa7050b[_0x62da('0x19')]?_0xa7050b['options'][_0x62da('0x1a')]===undefined?!![]:![]:!![],'where':_0xa7050b[_0x62da('0x19')]?_0xa7050b[_0x62da('0x19')][_0x62da('0x1b')]||null:null,'attributes':_0xa7050b[_0x62da('0x19')]?_0xa7050b[_0x62da('0x19')][_0x62da('0x1c')]||null:null,'limit':_0xa7050b[_0x62da('0x19')]?_0xa7050b[_0x62da('0x19')]['limit']||null:null,'include':_0xa7050b[_0x62da('0x19')]?_0xa7050b[_0x62da('0x19')][_0x62da('0x1d')]?_[_0x62da('0x1e')](_0xa7050b[_0x62da('0x19')][_0x62da('0x1d')],function(_0x24298a){return{'model':db[_0x24298a['model']],'as':_0x24298a['as'],'attributes':_0x24298a['attributes'],'include':_0x24298a['include']?_[_0x62da('0x1e')](_0x24298a[_0x62da('0x1d')],function(_0x14897c){return{'model':db[_0x14897c[_0x62da('0x1f')]],'as':_0x14897c['as'],'attributes':_0x14897c['attributes'],'include':_0x14897c[_0x62da('0x1d')]?_[_0x62da('0x1e')](_0x14897c['include'],function(_0x3ccf96){return{'model':db[_0x3ccf96[_0x62da('0x1f')]],'as':_0x3ccf96['as'],'attributes':_0x3ccf96[_0x62da('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x41de3a){logger[_0x62da('0xd')](_0x62da('0x20'),_0xa7050b);logger['debug']('GetFreshsalesAccount',_0xa7050b,JSON[_0x62da('0x12')](_0x41de3a));_0x4d6482(_0x41de3a);})[_0x62da('0x17')](function(_0x220ffc){logger['error'](_0x62da('0x20'),_0x220ffc[_0x62da('0x15')],_0xa7050b);_0x264366(_0x4ae4fb[_0x62da('0x13')](0x1f4,_0x220ffc[_0x62da('0x15')]));});});};exports[_0x62da('0x21')]=function(_0x1cf765){var _0x592c6c=this;return new Promise(function(_0xbe398f,_0x4f71bc){return db[_0x62da('0x18')][_0x62da('0x22')]({'raw':_0x1cf765[_0x62da('0x19')]?_0x1cf765[_0x62da('0x19')][_0x62da('0x1a')]===undefined?!![]:![]:!![],'where':_0x1cf765[_0x62da('0x19')]?_0x1cf765['options'][_0x62da('0x1b')]||null:null,'attributes':_0x1cf765[_0x62da('0x19')]?_0x1cf765[_0x62da('0x19')]['attributes']||null:null,'include':_0x1cf765[_0x62da('0x19')]?_0x1cf765[_0x62da('0x19')][_0x62da('0x1d')]?_['map'](_0x1cf765[_0x62da('0x19')][_0x62da('0x1d')],function(_0x55eda7){return{'model':db[_0x55eda7[_0x62da('0x1f')]],'as':_0x55eda7['as'],'attributes':_0x55eda7[_0x62da('0x1c')],'include':_0x55eda7['include']?_[_0x62da('0x1e')](_0x55eda7[_0x62da('0x1d')],function(_0x11bf73){return{'model':db[_0x11bf73[_0x62da('0x1f')]],'as':_0x11bf73['as'],'attributes':_0x11bf73[_0x62da('0x1c')],'include':_0x11bf73[_0x62da('0x1d')]?_[_0x62da('0x1e')](_0x11bf73[_0x62da('0x1d')],function(_0x2f1115){return{'model':db[_0x2f1115[_0x62da('0x1f')]],'as':_0x2f1115['as'],'attributes':_0x2f1115[_0x62da('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x62da('0xc')](function(_0x3057f6){logger[_0x62da('0xd')](_0x62da('0x21'),_0x1cf765);logger[_0x62da('0xf')](_0x62da('0x21'),_0x1cf765,JSON['stringify'](_0x3057f6));_0xbe398f(_0x3057f6);})[_0x62da('0x17')](function(_0x5e9295){logger[_0x62da('0x13')](_0x62da('0x21'),_0x5e9295[_0x62da('0x15')],_0x1cf765);_0x4f71bc(_0x592c6c['error'](0x1f4,_0x5e9295[_0x62da('0x15')]));});});}; \ No newline at end of file +var _0x1883=['GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','attributes','limit','include','map','model','then','info','find','where','ShowFreshsalesAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x2f0903,_0x36ad12){var _0xec6d69=function(_0x17f4d2){while(--_0x17f4d2){_0x2f0903['push'](_0x2f0903['shift']());}};_0xec6d69(++_0x36ad12);}(_0x1883,0xab));var _0x3188=function(_0x44a46c,_0x34c4a9){_0x44a46c=_0x44a46c-0x0;var _0x4faa43=_0x1883[_0x44a46c];return _0x4faa43;};'use strict';var _=require(_0x3188('0x0'));var util=require(_0x3188('0x1'));var moment=require(_0x3188('0x2'));var BPromise=require(_0x3188('0x3'));var rs=require(_0x3188('0x4'));var fs=require('fs');var Redis=require(_0x3188('0x5'));var db=require(_0x3188('0x6'))['db'];var utils=require(_0x3188('0x7'));var logger=require(_0x3188('0x8'))(_0x3188('0x9'));var config=require(_0x3188('0xa'));var jayson=require(_0x3188('0xb'));var client=jayson[_0x3188('0xc')][_0x3188('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x24f2f1,_0x3ce7fd,_0x3e3afb){return new BPromise(function(_0x5c8f26,_0x446ab7){return client[_0x3188('0xe')](_0x24f2f1,_0x3e3afb)['then'](function(_0x2213b5){logger['info'](_0x3188('0xf'),_0x3ce7fd,_0x3188('0x10'));logger[_0x3188('0x11')](_0x3188('0x12'),_0x3ce7fd,'request\x20sent',JSON[_0x3188('0x13')](_0x2213b5));if(_0x2213b5[_0x3188('0x14')]){if(_0x2213b5['error']['code']===0x1f4){logger[_0x3188('0x14')](_0x3188('0xf'),_0x3ce7fd,_0x2213b5[_0x3188('0x14')][_0x3188('0x15')]);return _0x446ab7(_0x2213b5[_0x3188('0x14')][_0x3188('0x15')]);}logger['error'](_0x3188('0xf'),_0x3ce7fd,_0x2213b5['error']['message']);return _0x5c8f26(_0x2213b5[_0x3188('0x14')]['message']);}else{logger['info'](_0x3188('0xf'),_0x3ce7fd,_0x3188('0x10'));_0x5c8f26(_0x2213b5[_0x3188('0x16')][_0x3188('0x15')]);}})[_0x3188('0x17')](function(_0x259321){logger['error'](_0x3188('0xf'),_0x3ce7fd,_0x259321);_0x446ab7(_0x259321);});});}exports[_0x3188('0x18')]=function(_0x3f5b35){var _0x37e646=this;return new Promise(function(_0x18a71a,_0x4f27b0){return db[_0x3188('0x19')][_0x3188('0x1a')]({'raw':_0x3f5b35['options']?_0x3f5b35[_0x3188('0x1b')][_0x3188('0x1c')]===undefined?!![]:![]:!![],'where':_0x3f5b35['options']?_0x3f5b35['options']['where']||null:null,'attributes':_0x3f5b35[_0x3188('0x1b')]?_0x3f5b35[_0x3188('0x1b')][_0x3188('0x1d')]||null:null,'limit':_0x3f5b35['options']?_0x3f5b35['options'][_0x3188('0x1e')]||null:null,'include':_0x3f5b35[_0x3188('0x1b')]?_0x3f5b35[_0x3188('0x1b')][_0x3188('0x1f')]?_[_0x3188('0x20')](_0x3f5b35['options'][_0x3188('0x1f')],function(_0x33f882){return{'model':db[_0x33f882['model']],'as':_0x33f882['as'],'attributes':_0x33f882[_0x3188('0x1d')],'include':_0x33f882['include']?_['map'](_0x33f882[_0x3188('0x1f')],function(_0x129bd7){return{'model':db[_0x129bd7[_0x3188('0x21')]],'as':_0x129bd7['as'],'attributes':_0x129bd7[_0x3188('0x1d')],'include':_0x129bd7[_0x3188('0x1f')]?_[_0x3188('0x20')](_0x129bd7[_0x3188('0x1f')],function(_0x11021c){return{'model':db[_0x11021c['model']],'as':_0x11021c['as'],'attributes':_0x11021c[_0x3188('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3188('0x22')](function(_0x52bb13){logger[_0x3188('0x23')](_0x3188('0x18'),_0x3f5b35);logger[_0x3188('0x11')](_0x3188('0x18'),_0x3f5b35,JSON[_0x3188('0x13')](_0x52bb13));_0x18a71a(_0x52bb13);})[_0x3188('0x17')](function(_0x8f810f){logger[_0x3188('0x14')]('GetFreshsalesAccount',_0x8f810f[_0x3188('0x15')],_0x3f5b35);_0x4f27b0(_0x37e646['error'](0x1f4,_0x8f810f[_0x3188('0x15')]));});});};exports['ShowFreshsalesAccount']=function(_0x3f82ce){var _0x80f9a8=this;return new Promise(function(_0x3be4f7,_0xacdad7){return db[_0x3188('0x19')][_0x3188('0x24')]({'raw':_0x3f82ce[_0x3188('0x1b')]?_0x3f82ce[_0x3188('0x1b')][_0x3188('0x1c')]===undefined?!![]:![]:!![],'where':_0x3f82ce[_0x3188('0x1b')]?_0x3f82ce[_0x3188('0x1b')][_0x3188('0x25')]||null:null,'attributes':_0x3f82ce[_0x3188('0x1b')]?_0x3f82ce[_0x3188('0x1b')][_0x3188('0x1d')]||null:null,'include':_0x3f82ce[_0x3188('0x1b')]?_0x3f82ce[_0x3188('0x1b')][_0x3188('0x1f')]?_['map'](_0x3f82ce[_0x3188('0x1b')]['include'],function(_0x1c945e){return{'model':db[_0x1c945e[_0x3188('0x21')]],'as':_0x1c945e['as'],'attributes':_0x1c945e['attributes'],'include':_0x1c945e[_0x3188('0x1f')]?_[_0x3188('0x20')](_0x1c945e[_0x3188('0x1f')],function(_0x6d503d){return{'model':db[_0x6d503d[_0x3188('0x21')]],'as':_0x6d503d['as'],'attributes':_0x6d503d[_0x3188('0x1d')],'include':_0x6d503d[_0x3188('0x1f')]?_['map'](_0x6d503d['include'],function(_0xa876c8){return{'model':db[_0xa876c8[_0x3188('0x21')]],'as':_0xa876c8['as'],'attributes':_0xa876c8[_0x3188('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3188('0x22')](function(_0x4a64a4){logger[_0x3188('0x23')](_0x3188('0x26'),_0x3f82ce);logger[_0x3188('0x11')](_0x3188('0x26'),_0x3f82ce,JSON['stringify'](_0x4a64a4));_0x3be4f7(_0x4a64a4);})[_0x3188('0x17')](function(_0x4a290f){logger[_0x3188('0x14')]('ShowFreshsalesAccount',_0x4a290f[_0x3188('0x15')],_0x3f82ce);_0xacdad7(_0x80f9a8[_0x3188('0x14')](0x1f4,_0x4a290f[_0x3188('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 59ba266..4215621 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 _0x24da=['isAuthenticated','/:id','show','/:id/subjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','post','create','put','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get'];(function(_0x3cbde3,_0x491a1a){var _0x1d3a31=function(_0xcf9e3b){while(--_0xcf9e3b){_0x3cbde3['push'](_0x3cbde3['shift']());}};_0x1d3a31(++_0x491a1a);}(_0x24da,0xef));var _0xa24d=function(_0x2fee96,_0x2f735d){_0x2fee96=_0x2fee96-0x0;var _0x2e6ad1=_0x24da[_0x2fee96];return _0x2e6ad1;};'use strict';var multer=require(_0xa24d('0x0'));var util=require(_0xa24d('0x1'));var path=require('path');var timeout=require(_0xa24d('0x2'));var express=require(_0xa24d('0x3'));var router=express[_0xa24d('0x4')]();var fs_extra=require(_0xa24d('0x5'));var auth=require(_0xa24d('0x6'));var interaction=require(_0xa24d('0x7'));var config=require(_0xa24d('0x8'));var controller=require(_0xa24d('0x9'));router[_0xa24d('0xa')]('/',auth[_0xa24d('0xb')](),controller['index']);router[_0xa24d('0xa')](_0xa24d('0xc'),auth[_0xa24d('0xb')](),controller[_0xa24d('0xd')]);router[_0xa24d('0xa')](_0xa24d('0xe'),auth[_0xa24d('0xb')](),controller['getSubjects']);router[_0xa24d('0xa')](_0xa24d('0xf'),auth[_0xa24d('0xb')](),controller[_0xa24d('0x10')]);router[_0xa24d('0xa')](_0xa24d('0x11'),auth['isAuthenticated'](),controller[_0xa24d('0x12')]);router[_0xa24d('0x13')]('/',auth['isAuthenticated'](),controller[_0xa24d('0x14')]);router[_0xa24d('0x15')](_0xa24d('0xc'),auth[_0xa24d('0xb')](),controller[_0xa24d('0x16')]);router[_0xa24d('0x17')]('/:id',auth[_0xa24d('0xb')](),controller['destroy']);module[_0xa24d('0x18')]=router; \ No newline at end of file +var _0x2ef6=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/subjects','getSubjects','/:id/descriptions','getFields','post','put','update','delete','destroy','exports'];(function(_0x462fe4,_0x394d3e){var _0x82b23a=function(_0x2c071f){while(--_0x2c071f){_0x462fe4['push'](_0x462fe4['shift']());}};_0x82b23a(++_0x394d3e);}(_0x2ef6,0x8a));var _0x62ef=function(_0x477491,_0x5ca700){_0x477491=_0x477491-0x0;var _0xac6aec=_0x2ef6[_0x477491];return _0xac6aec;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x62ef('0x0'));var express=require(_0x62ef('0x1'));var router=express[_0x62ef('0x2')]();var fs_extra=require(_0x62ef('0x3'));var auth=require(_0x62ef('0x4'));var interaction=require(_0x62ef('0x5'));var config=require(_0x62ef('0x6'));var controller=require(_0x62ef('0x7'));router[_0x62ef('0x8')]('/',auth[_0x62ef('0x9')](),controller[_0x62ef('0xa')]);router[_0x62ef('0x8')](_0x62ef('0xb'),auth[_0x62ef('0x9')](),controller[_0x62ef('0xc')]);router[_0x62ef('0x8')](_0x62ef('0xd'),auth[_0x62ef('0x9')](),controller[_0x62ef('0xe')]);router[_0x62ef('0x8')](_0x62ef('0xf'),auth[_0x62ef('0x9')](),controller['getDescriptions']);router['get']('/:id/fields',auth['isAuthenticated'](),controller[_0x62ef('0x10')]);router[_0x62ef('0x11')]('/',auth[_0x62ef('0x9')](),controller['create']);router[_0x62ef('0x12')](_0x62ef('0xb'),auth['isAuthenticated'](),controller[_0x62ef('0x13')]);router[_0x62ef('0x14')](_0x62ef('0xb'),auth[_0x62ef('0x9')](),controller[_0x62ef('0x15')]);module[_0x62ef('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 06ae387..268d96a 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 _0xb834=['exports','STRING','sequelize'];(function(_0x536eae,_0x2224a8){var _0x5bc386=function(_0x46978b){while(--_0x46978b){_0x536eae['push'](_0x536eae['shift']());}};_0x5bc386(++_0x2224a8);}(_0xb834,0x188));var _0x4b83=function(_0x416a0a,_0x24f91f){_0x416a0a=_0x416a0a-0x0;var _0x574c9f=_0xb834[_0x416a0a];return _0x574c9f;};'use strict';var Sequelize=require(_0x4b83('0x0'));module[_0x4b83('0x1')]={'name':{'type':Sequelize[_0x4b83('0x2')]},'description':{'type':Sequelize[_0x4b83('0x2')]}}; \ No newline at end of file +var _0xe6b9=['STRING','sequelize'];(function(_0x4f6d66,_0x28679a){var _0x5eb44c=function(_0x239616){while(--_0x239616){_0x4f6d66['push'](_0x4f6d66['shift']());}};_0x5eb44c(++_0x28679a);}(_0xe6b9,0x1d3));var _0x9e6b=function(_0x3818c0,_0x542521){_0x3818c0=_0x3818c0-0x0;var _0x55ec33=_0xe6b9[_0x3818c0];return _0x55ec33;};'use strict';var Sequelize=require(_0x9e6b('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9e6b('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index a3040e9..ca4f88c 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 _0xdf24=['map','FreshsalesConfiguration','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','type','VIRTUAL','merge','then','includeAll','include','findAll','rows','catch','show','rawAttributes','options','create','body','find','params','destroy','getSubjects','findOne','FreshsalesField','order','getDescriptions','getFields','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','update','end','error','name','send'];(function(_0x3e2343,_0xe30c53){var _0x5414a0=function(_0x360f3d){while(--_0x360f3d){_0x3e2343['push'](_0x3e2343['shift']());}};_0x5414a0(++_0xe30c53);}(_0xdf24,0x16d));var _0x4df2=function(_0x39cf21,_0x533bf7){_0x39cf21=_0x39cf21-0x0;var _0x12fdca=_0xdf24[_0x39cf21];return _0x12fdca;};'use strict';var emlformat=require(_0x4df2('0x0'));var rimraf=require(_0x4df2('0x1'));var zipdir=require(_0x4df2('0x2'));var jsonpatch=require(_0x4df2('0x3'));var rp=require(_0x4df2('0x4'));var moment=require(_0x4df2('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4df2('0x6'));var util=require(_0x4df2('0x7'));var path=require(_0x4df2('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4df2('0x9'));var fs=require('fs');var fs_extra=require(_0x4df2('0xa'));var _=require(_0x4df2('0xb'));var squel=require(_0x4df2('0xc'));var crypto=require(_0x4df2('0xd'));var jsforce=require(_0x4df2('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4df2('0xf'));var querystring=require(_0x4df2('0x10'));var Papa=require('papaparse');var Redis=require(_0x4df2('0x11'));var authService=require(_0x4df2('0x12'));var qs=require(_0x4df2('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4df2('0x14'));var logger=require(_0x4df2('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x4df2('0x16'));var licenseUtil=require(_0x4df2('0x17'));var db=require(_0x4df2('0x18'))['db'];function respondWithStatusCode(_0x543bb1,_0xb74a86){_0xb74a86=_0xb74a86||0xcc;return function(_0x25fd35){if(_0x25fd35){return _0x543bb1[_0x4df2('0x19')](_0xb74a86);}return _0x543bb1[_0x4df2('0x1a')](_0xb74a86)['end']();};}function respondWithResult(_0x244489,_0xbf7a3b){_0xbf7a3b=_0xbf7a3b||0xc8;return function(_0x55e792){if(_0x55e792){return _0x244489[_0x4df2('0x1a')](_0xbf7a3b)[_0x4df2('0x1b')](_0x55e792);}};}function respondWithFilteredResult(_0x48bfce,_0x2dd6c0){return function(_0x15579d){if(_0x15579d){var _0x4fb8ac=typeof _0x2dd6c0['offset']===_0x4df2('0x1c')&&typeof _0x2dd6c0['limit']===_0x4df2('0x1c');var _0x4003c3=_0x15579d[_0x4df2('0x1d')];var _0x49b2a1=_0x4fb8ac?0x0:_0x2dd6c0[_0x4df2('0x1e')];var _0x4b7af5=_0x4fb8ac?_0x15579d[_0x4df2('0x1d')]:_0x2dd6c0['offset']+_0x2dd6c0[_0x4df2('0x1f')];var _0x1f55ce;if(_0x4b7af5>=_0x4003c3){_0x4b7af5=_0x4003c3;_0x1f55ce=0xc8;}else{_0x1f55ce=0xce;}_0x48bfce[_0x4df2('0x1a')](_0x1f55ce);return _0x48bfce[_0x4df2('0x20')](_0x4df2('0x21'),_0x49b2a1+'-'+_0x4b7af5+'/'+_0x4003c3)[_0x4df2('0x1b')](_0x15579d);}return null;};}function patchUpdates(_0x16ce64){return function(_0x27e117){try{jsonpatch['apply'](_0x27e117,_0x16ce64,!![]);}catch(_0x3b9a3f){return BPromise[_0x4df2('0x22')](_0x3b9a3f);}return _0x27e117['save']();};}function saveUpdates(_0x29d5ad,_0x4429f4){return function(_0x2af99d){if(_0x2af99d){return _0x2af99d[_0x4df2('0x23')](_0x29d5ad)['then'](function(_0x4754b7){return _0x4754b7;});}return null;};}function removeEntity(_0x4bcecf,_0x6a8ceb){return function(_0x1f09f3){if(_0x1f09f3){return _0x1f09f3['destroy']()['then'](function(){_0x4bcecf[_0x4df2('0x1a')](0xcc)[_0x4df2('0x24')]();});}};}function handleEntityNotFound(_0x59e43c,_0x479fd3){return function(_0x52def7){if(!_0x52def7){_0x59e43c['sendStatus'](0x194);}return _0x52def7;};}function handleError(_0x5024d1,_0x3c2229){_0x3c2229=_0x3c2229||0x1f4;return function(_0x188099){logger[_0x4df2('0x25')](_0x188099['stack']);if(_0x188099[_0x4df2('0x26')]){delete _0x188099[_0x4df2('0x26')];}_0x5024d1[_0x4df2('0x1a')](_0x3c2229)[_0x4df2('0x27')](_0x188099);};}exports['index']=function(_0x55d4f9,_0x10ea92){var _0x3f31a7={},_0x42376d={},_0x56e3ac={'count':0x0,'rows':[]};var _0x59ce66=_[_0x4df2('0x28')](db[_0x4df2('0x29')]['rawAttributes'],function(_0x19ccf9){return{'name':_0x19ccf9[_0x4df2('0x2a')],'type':_0x19ccf9['type'][_0x4df2('0x2b')]};});_0x42376d[_0x4df2('0x2c')]=_[_0x4df2('0x28')](_0x59ce66,_0x4df2('0x26'));_0x42376d[_0x4df2('0x2d')]=_[_0x4df2('0x2e')](_0x55d4f9[_0x4df2('0x2d')]);_0x42376d[_0x4df2('0x2f')]=_[_0x4df2('0x30')](_0x42376d[_0x4df2('0x2c')],_0x42376d[_0x4df2('0x2d')]);_0x3f31a7[_0x4df2('0x31')]=_[_0x4df2('0x30')](_0x42376d['model'],qs[_0x4df2('0x32')](_0x55d4f9[_0x4df2('0x2d')][_0x4df2('0x32')]));_0x3f31a7[_0x4df2('0x31')]=_0x3f31a7[_0x4df2('0x31')][_0x4df2('0x33')]?_0x3f31a7[_0x4df2('0x31')]:_0x42376d['model'];if(!_0x55d4f9[_0x4df2('0x2d')][_0x4df2('0x34')](_0x4df2('0x35'))){_0x3f31a7[_0x4df2('0x1f')]=qs[_0x4df2('0x1f')](_0x55d4f9[_0x4df2('0x2d')]['limit']);_0x3f31a7[_0x4df2('0x1e')]=qs[_0x4df2('0x1e')](_0x55d4f9[_0x4df2('0x2d')]['offset']);}_0x3f31a7['order']=qs['sort'](_0x55d4f9[_0x4df2('0x2d')][_0x4df2('0x36')]);_0x3f31a7[_0x4df2('0x37')]=qs[_0x4df2('0x2f')](_[_0x4df2('0x38')](_0x55d4f9[_0x4df2('0x2d')],_0x42376d[_0x4df2('0x2f')]),_0x59ce66);if(_0x55d4f9[_0x4df2('0x2d')][_0x4df2('0x39')]){_0x3f31a7['where']=_['merge'](_0x3f31a7[_0x4df2('0x37')],{'$or':_[_0x4df2('0x28')](_0x59ce66,function(_0x3b905a){if(_0x3b905a[_0x4df2('0x3a')]!==_0x4df2('0x3b')){var _0x11cefe={};_0x11cefe[_0x3b905a[_0x4df2('0x26')]]={'$like':'%'+_0x55d4f9[_0x4df2('0x2d')][_0x4df2('0x39')]+'%'};return _0x11cefe;}})});}_0x3f31a7=_[_0x4df2('0x3c')]({},_0x3f31a7,_0x55d4f9['options']);var _0x483116={'where':_0x3f31a7[_0x4df2('0x37')]};return db[_0x4df2('0x29')][_0x4df2('0x1d')](_0x483116)[_0x4df2('0x3d')](function(_0x16a4de){_0x56e3ac[_0x4df2('0x1d')]=_0x16a4de;if(_0x55d4f9[_0x4df2('0x2d')][_0x4df2('0x3e')]){_0x3f31a7[_0x4df2('0x3f')]=[{'all':!![]}];}return db['FreshsalesConfiguration'][_0x4df2('0x40')](_0x3f31a7);})[_0x4df2('0x3d')](function(_0x27d4fe){_0x56e3ac[_0x4df2('0x41')]=_0x27d4fe;return _0x56e3ac;})['then'](respondWithFilteredResult(_0x10ea92,_0x3f31a7))[_0x4df2('0x42')](handleError(_0x10ea92,null));};exports[_0x4df2('0x43')]=function(_0x3ca01e,_0x195b26){var _0xdea6d4={'raw':![],'where':{'id':_0x3ca01e['params']['id']}},_0xd1c954={};_0xd1c954['model']=_[_0x4df2('0x2e')](db[_0x4df2('0x29')][_0x4df2('0x44')]);_0xd1c954[_0x4df2('0x2d')]=_[_0x4df2('0x2e')](_0x3ca01e[_0x4df2('0x2d')]);_0xd1c954['filters']=_[_0x4df2('0x30')](_0xd1c954[_0x4df2('0x2c')],_0xd1c954[_0x4df2('0x2d')]);_0xdea6d4[_0x4df2('0x31')]=_[_0x4df2('0x30')](_0xd1c954[_0x4df2('0x2c')],qs[_0x4df2('0x32')](_0x3ca01e[_0x4df2('0x2d')][_0x4df2('0x32')]));_0xdea6d4[_0x4df2('0x31')]=_0xdea6d4[_0x4df2('0x31')]['length']?_0xdea6d4[_0x4df2('0x31')]:_0xd1c954[_0x4df2('0x2c')];if(_0x3ca01e[_0x4df2('0x2d')][_0x4df2('0x3e')]){_0xdea6d4[_0x4df2('0x3f')]=[{'all':!![]}];}_0xdea6d4=_[_0x4df2('0x3c')]({},_0xdea6d4,_0x3ca01e[_0x4df2('0x45')]);return db[_0x4df2('0x29')]['find'](_0xdea6d4)[_0x4df2('0x3d')](handleEntityNotFound(_0x195b26,null))['then'](respondWithResult(_0x195b26,null))['catch'](handleError(_0x195b26,null));};exports['create']=function(_0x50e672,_0x559830){return db[_0x4df2('0x29')][_0x4df2('0x46')](_0x50e672[_0x4df2('0x47')],{})[_0x4df2('0x3d')](respondWithResult(_0x559830,0xc9))[_0x4df2('0x42')](handleError(_0x559830,null));};exports['update']=function(_0x3345a5,_0x16ebb8){if(_0x3345a5[_0x4df2('0x47')]['id']){delete _0x3345a5[_0x4df2('0x47')]['id'];}return db[_0x4df2('0x29')][_0x4df2('0x48')]({'where':{'id':_0x3345a5[_0x4df2('0x49')]['id']}})[_0x4df2('0x3d')](handleEntityNotFound(_0x16ebb8,null))[_0x4df2('0x3d')](saveUpdates(_0x3345a5['body'],null))['then'](respondWithResult(_0x16ebb8,null))[_0x4df2('0x42')](handleError(_0x16ebb8,null));};exports[_0x4df2('0x4a')]=function(_0x2deec4,_0x154a2e){return db[_0x4df2('0x29')][_0x4df2('0x48')]({'where':{'id':_0x2deec4[_0x4df2('0x49')]['id']}})[_0x4df2('0x3d')](handleEntityNotFound(_0x154a2e,null))['then'](removeEntity(_0x154a2e,null))[_0x4df2('0x42')](handleError(_0x154a2e,null));};exports[_0x4df2('0x4b')]=function(_0x2c4afd,_0x1992c1,_0x10f012){var _0x12b80f={};var _0x40e504={};var _0x15d4bf;var _0x5693b2;return db[_0x4df2('0x29')][_0x4df2('0x4c')]({'where':{'id':_0x2c4afd['params']['id']}})['then'](handleEntityNotFound(_0x1992c1,null))[_0x4df2('0x3d')](function(_0x5dafe2){if(_0x5dafe2){_0x15d4bf=_0x5dafe2;_0x40e504[_0x4df2('0x2c')]=_[_0x4df2('0x2e')](db[_0x4df2('0x4d')][_0x4df2('0x44')]);_0x40e504[_0x4df2('0x2d')]=_[_0x4df2('0x2e')](_0x2c4afd[_0x4df2('0x2d')]);_0x40e504[_0x4df2('0x2f')]=_['intersection'](_0x40e504['model'],_0x40e504[_0x4df2('0x2d')]);_0x12b80f[_0x4df2('0x31')]=_[_0x4df2('0x30')](_0x40e504[_0x4df2('0x2c')],qs[_0x4df2('0x32')](_0x2c4afd[_0x4df2('0x2d')][_0x4df2('0x32')]));_0x12b80f[_0x4df2('0x31')]=_0x12b80f[_0x4df2('0x31')][_0x4df2('0x33')]?_0x12b80f[_0x4df2('0x31')]:_0x40e504[_0x4df2('0x2c')];_0x12b80f[_0x4df2('0x4e')]=qs[_0x4df2('0x36')](_0x2c4afd[_0x4df2('0x2d')][_0x4df2('0x36')]);_0x12b80f[_0x4df2('0x37')]=qs['filters'](_[_0x4df2('0x38')](_0x2c4afd[_0x4df2('0x2d')],_0x40e504[_0x4df2('0x2f')]));if(_0x2c4afd[_0x4df2('0x2d')][_0x4df2('0x39')]){_0x12b80f['where']=_['merge'](_0x12b80f[_0x4df2('0x37')],{'$or':_[_0x4df2('0x28')](_0x12b80f[_0x4df2('0x31')],function(_0x29b89c){var _0xa9b7ac={};_0xa9b7ac[_0x29b89c]={'$like':'%'+_0x2c4afd[_0x4df2('0x2d')][_0x4df2('0x39')]+'%'};return _0xa9b7ac;})});}_0x12b80f=_[_0x4df2('0x3c')]({},_0x12b80f,_0x2c4afd[_0x4df2('0x45')]);return _0x15d4bf[_0x4df2('0x4b')](_0x12b80f);}})[_0x4df2('0x3d')](function(_0x5597da){if(_0x5597da){_0x5693b2=_0x5597da[_0x4df2('0x33')];if(!_0x2c4afd['query'][_0x4df2('0x34')](_0x4df2('0x35'))){_0x12b80f[_0x4df2('0x1f')]=qs[_0x4df2('0x1f')](_0x2c4afd[_0x4df2('0x2d')][_0x4df2('0x1f')]);_0x12b80f[_0x4df2('0x1e')]=qs[_0x4df2('0x1e')](_0x2c4afd['query'][_0x4df2('0x1e')]);}return _0x15d4bf['getSubjects'](_0x12b80f);}})['then'](function(_0x3fddbf){if(_0x3fddbf){return _0x3fddbf?{'count':_0x5693b2,'rows':_0x3fddbf}:null;}})['then'](respondWithResult(_0x1992c1,null))[_0x4df2('0x42')](handleError(_0x1992c1,null));};exports[_0x4df2('0x4f')]=function(_0xd4d35c,_0x1ad939,_0x273343){var _0x59afb0={};var _0x4e9f84={};var _0x1f2fc0;var _0x45d679;return db[_0x4df2('0x29')][_0x4df2('0x4c')]({'where':{'id':_0xd4d35c[_0x4df2('0x49')]['id']}})[_0x4df2('0x3d')](handleEntityNotFound(_0x1ad939,null))['then'](function(_0x37f44e){if(_0x37f44e){_0x1f2fc0=_0x37f44e;_0x4e9f84[_0x4df2('0x2c')]=_[_0x4df2('0x2e')](db[_0x4df2('0x4d')][_0x4df2('0x44')]);_0x4e9f84[_0x4df2('0x2d')]=_[_0x4df2('0x2e')](_0xd4d35c[_0x4df2('0x2d')]);_0x4e9f84[_0x4df2('0x2f')]=_['intersection'](_0x4e9f84[_0x4df2('0x2c')],_0x4e9f84[_0x4df2('0x2d')]);_0x59afb0[_0x4df2('0x31')]=_[_0x4df2('0x30')](_0x4e9f84[_0x4df2('0x2c')],qs['fields'](_0xd4d35c[_0x4df2('0x2d')][_0x4df2('0x32')]));_0x59afb0[_0x4df2('0x31')]=_0x59afb0['attributes'][_0x4df2('0x33')]?_0x59afb0[_0x4df2('0x31')]:_0x4e9f84[_0x4df2('0x2c')];_0x59afb0['order']=qs[_0x4df2('0x36')](_0xd4d35c[_0x4df2('0x2d')][_0x4df2('0x36')]);_0x59afb0[_0x4df2('0x37')]=qs[_0x4df2('0x2f')](_['pick'](_0xd4d35c[_0x4df2('0x2d')],_0x4e9f84[_0x4df2('0x2f')]));if(_0xd4d35c[_0x4df2('0x2d')][_0x4df2('0x39')]){_0x59afb0[_0x4df2('0x37')]=_['merge'](_0x59afb0[_0x4df2('0x37')],{'$or':_[_0x4df2('0x28')](_0x59afb0[_0x4df2('0x31')],function(_0x334ded){var _0x199aef={};_0x199aef[_0x334ded]={'$like':'%'+_0xd4d35c[_0x4df2('0x2d')][_0x4df2('0x39')]+'%'};return _0x199aef;})});}_0x59afb0=_[_0x4df2('0x3c')]({},_0x59afb0,_0xd4d35c[_0x4df2('0x45')]);return _0x1f2fc0[_0x4df2('0x4f')](_0x59afb0);}})['then'](function(_0x4b43dc){if(_0x4b43dc){_0x45d679=_0x4b43dc['length'];if(!_0xd4d35c['query'][_0x4df2('0x34')]('nolimit')){_0x59afb0[_0x4df2('0x1f')]=qs[_0x4df2('0x1f')](_0xd4d35c['query'][_0x4df2('0x1f')]);_0x59afb0[_0x4df2('0x1e')]=qs['offset'](_0xd4d35c['query'][_0x4df2('0x1e')]);}return _0x1f2fc0['getDescriptions'](_0x59afb0);}})[_0x4df2('0x3d')](function(_0x4f2bd5){if(_0x4f2bd5){return _0x4f2bd5?{'count':_0x45d679,'rows':_0x4f2bd5}:null;}})['then'](respondWithResult(_0x1ad939,null))[_0x4df2('0x42')](handleError(_0x1ad939,null));};exports[_0x4df2('0x50')]=function(_0x20f921,_0x1119d6,_0x4c1a4d){var _0x4d4280={};var _0x2c6131={};var _0x314e1e;var _0x3d7d26;return db[_0x4df2('0x29')][_0x4df2('0x4c')]({'where':{'id':_0x20f921[_0x4df2('0x49')]['id']}})[_0x4df2('0x3d')](handleEntityNotFound(_0x1119d6,null))[_0x4df2('0x3d')](function(_0x5921b3){if(_0x5921b3){_0x314e1e=_0x5921b3;_0x2c6131[_0x4df2('0x2c')]=_[_0x4df2('0x2e')](db[_0x4df2('0x4d')]['rawAttributes']);_0x2c6131[_0x4df2('0x2d')]=_[_0x4df2('0x2e')](_0x20f921[_0x4df2('0x2d')]);_0x2c6131['filters']=_[_0x4df2('0x30')](_0x2c6131[_0x4df2('0x2c')],_0x2c6131[_0x4df2('0x2d')]);_0x4d4280['attributes']=_[_0x4df2('0x30')](_0x2c6131[_0x4df2('0x2c')],qs['fields'](_0x20f921[_0x4df2('0x2d')][_0x4df2('0x32')]));_0x4d4280[_0x4df2('0x31')]=_0x4d4280[_0x4df2('0x31')][_0x4df2('0x33')]?_0x4d4280[_0x4df2('0x31')]:_0x2c6131[_0x4df2('0x2c')];_0x4d4280[_0x4df2('0x4e')]=qs['sort'](_0x20f921[_0x4df2('0x2d')][_0x4df2('0x36')]);_0x4d4280['where']=qs[_0x4df2('0x2f')](_[_0x4df2('0x38')](_0x20f921[_0x4df2('0x2d')],_0x2c6131[_0x4df2('0x2f')]));if(_0x20f921[_0x4df2('0x2d')][_0x4df2('0x39')]){_0x4d4280[_0x4df2('0x37')]=_[_0x4df2('0x3c')](_0x4d4280[_0x4df2('0x37')],{'$or':_[_0x4df2('0x28')](_0x4d4280[_0x4df2('0x31')],function(_0x1265c7){var _0x2bdf82={};_0x2bdf82[_0x1265c7]={'$like':'%'+_0x20f921[_0x4df2('0x2d')]['filter']+'%'};return _0x2bdf82;})});}_0x4d4280=_[_0x4df2('0x3c')]({},_0x4d4280,_0x20f921[_0x4df2('0x45')]);return _0x314e1e[_0x4df2('0x50')](_0x4d4280);}})[_0x4df2('0x3d')](function(_0x2062e4){if(_0x2062e4){_0x3d7d26=_0x2062e4[_0x4df2('0x33')];if(!_0x20f921[_0x4df2('0x2d')][_0x4df2('0x34')]('nolimit')){_0x4d4280[_0x4df2('0x1f')]=qs[_0x4df2('0x1f')](_0x20f921['query'][_0x4df2('0x1f')]);_0x4d4280[_0x4df2('0x1e')]=qs[_0x4df2('0x1e')](_0x20f921[_0x4df2('0x2d')][_0x4df2('0x1e')]);}return _0x314e1e[_0x4df2('0x50')](_0x4d4280);}})[_0x4df2('0x3d')](function(_0x3b4dc7){if(_0x3b4dc7){return _0x3b4dc7?{'count':_0x3d7d26,'rows':_0x3b4dc7}:null;}})[_0x4df2('0x3d')](respondWithResult(_0x1119d6,null))[_0x4df2('0x42')](handleError(_0x1119d6,null));}; \ No newline at end of file +var _0x1567=['pick','filter','merge','VIRTUAL','options','where','includeAll','rows','then','catch','show','params','include','find','create','body','getSubjects','findOne','order','getDescriptions','FreshsalesField','getFields','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','destroy','sendStatus','error','stack','name','send','index','map','FreshsalesConfiguration','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort'];(function(_0x5c1205,_0x183cbf){var _0xd1651e=function(_0x2dd0a4){while(--_0x2dd0a4){_0x5c1205['push'](_0x5c1205['shift']());}};_0xd1651e(++_0x183cbf);}(_0x1567,0x1bf));var _0x7156=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x1567[_0x413feb];return _0x40ee88;};'use strict';var emlformat=require(_0x7156('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7156('0x1'));var jsonpatch=require(_0x7156('0x2'));var rp=require(_0x7156('0x3'));var moment=require(_0x7156('0x4'));var BPromise=require(_0x7156('0x5'));var Mustache=require(_0x7156('0x6'));var util=require('util');var path=require(_0x7156('0x7'));var sox=require(_0x7156('0x8'));var csv=require(_0x7156('0x9'));var ejs=require(_0x7156('0xa'));var fs=require('fs');var fs_extra=require(_0x7156('0xb'));var _=require('lodash');var squel=require(_0x7156('0xc'));var crypto=require('crypto');var jsforce=require(_0x7156('0xd'));var deskjs=require(_0x7156('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7156('0xf'));var Papa=require(_0x7156('0x10'));var Redis=require(_0x7156('0x11'));var authService=require(_0x7156('0x12'));var qs=require(_0x7156('0x13'));var as=require(_0x7156('0x14'));var hardwareService=require(_0x7156('0x15'));var logger=require('../../config/logger')(_0x7156('0x16'));var utils=require(_0x7156('0x17'));var config=require(_0x7156('0x18'));var licenseUtil=require(_0x7156('0x19'));var db=require(_0x7156('0x1a'))['db'];function respondWithStatusCode(_0x430c76,_0x417f2c){_0x417f2c=_0x417f2c||0xcc;return function(_0x336735){if(_0x336735){return _0x430c76['sendStatus'](_0x417f2c);}return _0x430c76[_0x7156('0x1b')](_0x417f2c)[_0x7156('0x1c')]();};}function respondWithResult(_0x632cd6,_0x87e34c){_0x87e34c=_0x87e34c||0xc8;return function(_0x827100){if(_0x827100){return _0x632cd6['status'](_0x87e34c)['json'](_0x827100);}};}function respondWithFilteredResult(_0x45b047,_0x7f5fa1){return function(_0xf9871c){if(_0xf9871c){var _0x576461=typeof _0x7f5fa1[_0x7156('0x1d')]===_0x7156('0x1e')&&typeof _0x7f5fa1[_0x7156('0x1f')]===_0x7156('0x1e');var _0x5956ed=_0xf9871c[_0x7156('0x20')];var _0x195b46=_0x576461?0x0:_0x7f5fa1['offset'];var _0x3ea567=_0x576461?_0xf9871c[_0x7156('0x20')]:_0x7f5fa1[_0x7156('0x1d')]+_0x7f5fa1[_0x7156('0x1f')];var _0x18718e;if(_0x3ea567>=_0x5956ed){_0x3ea567=_0x5956ed;_0x18718e=0xc8;}else{_0x18718e=0xce;}_0x45b047['status'](_0x18718e);return _0x45b047[_0x7156('0x21')](_0x7156('0x22'),_0x195b46+'-'+_0x3ea567+'/'+_0x5956ed)[_0x7156('0x23')](_0xf9871c);}return null;};}function patchUpdates(_0x4a60ff){return function(_0x53cf9a){try{jsonpatch[_0x7156('0x24')](_0x53cf9a,_0x4a60ff,!![]);}catch(_0x2a8180){return BPromise[_0x7156('0x25')](_0x2a8180);}return _0x53cf9a[_0x7156('0x26')]();};}function saveUpdates(_0x1850ff,_0x21258c){return function(_0xd393f8){if(_0xd393f8){return _0xd393f8['update'](_0x1850ff)['then'](function(_0xdd97e8){return _0xdd97e8;});}return null;};}function removeEntity(_0x7769b9,_0x353afd){return function(_0x5be637){if(_0x5be637){return _0x5be637[_0x7156('0x27')]()['then'](function(){_0x7769b9[_0x7156('0x1b')](0xcc)[_0x7156('0x1c')]();});}};}function handleEntityNotFound(_0x231491,_0x52b58c){return function(_0x2e1dbd){if(!_0x2e1dbd){_0x231491[_0x7156('0x28')](0x194);}return _0x2e1dbd;};}function handleError(_0x4a8404,_0x1c8beb){_0x1c8beb=_0x1c8beb||0x1f4;return function(_0x3193da){logger[_0x7156('0x29')](_0x3193da[_0x7156('0x2a')]);if(_0x3193da[_0x7156('0x2b')]){delete _0x3193da['name'];}_0x4a8404[_0x7156('0x1b')](_0x1c8beb)[_0x7156('0x2c')](_0x3193da);};}exports[_0x7156('0x2d')]=function(_0xcf131d,_0xa18c36){var _0x47259d={},_0x2a0160={},_0x7685f0={'count':0x0,'rows':[]};var _0x37e96e=_[_0x7156('0x2e')](db[_0x7156('0x2f')][_0x7156('0x30')],function(_0x51e69a){return{'name':_0x51e69a[_0x7156('0x31')],'type':_0x51e69a[_0x7156('0x32')][_0x7156('0x33')]};});_0x2a0160['model']=_['map'](_0x37e96e,_0x7156('0x2b'));_0x2a0160[_0x7156('0x34')]=_[_0x7156('0x35')](_0xcf131d[_0x7156('0x34')]);_0x2a0160[_0x7156('0x36')]=_[_0x7156('0x37')](_0x2a0160[_0x7156('0x38')],_0x2a0160[_0x7156('0x34')]);_0x47259d[_0x7156('0x39')]=_[_0x7156('0x37')](_0x2a0160[_0x7156('0x38')],qs[_0x7156('0x3a')](_0xcf131d['query']['fields']));_0x47259d[_0x7156('0x39')]=_0x47259d['attributes'][_0x7156('0x3b')]?_0x47259d[_0x7156('0x39')]:_0x2a0160[_0x7156('0x38')];if(!_0xcf131d[_0x7156('0x34')][_0x7156('0x3c')](_0x7156('0x3d'))){_0x47259d[_0x7156('0x1f')]=qs[_0x7156('0x1f')](_0xcf131d[_0x7156('0x34')][_0x7156('0x1f')]);_0x47259d[_0x7156('0x1d')]=qs['offset'](_0xcf131d['query']['offset']);}_0x47259d['order']=qs['sort'](_0xcf131d[_0x7156('0x34')][_0x7156('0x3e')]);_0x47259d['where']=qs[_0x7156('0x36')](_[_0x7156('0x3f')](_0xcf131d[_0x7156('0x34')],_0x2a0160['filters']),_0x37e96e);if(_0xcf131d[_0x7156('0x34')][_0x7156('0x40')]){_0x47259d['where']=_[_0x7156('0x41')](_0x47259d['where'],{'$or':_[_0x7156('0x2e')](_0x37e96e,function(_0x3149b5){if(_0x3149b5['type']!==_0x7156('0x42')){var _0x56cfca={};_0x56cfca[_0x3149b5[_0x7156('0x2b')]]={'$like':'%'+_0xcf131d['query'][_0x7156('0x40')]+'%'};return _0x56cfca;}})});}_0x47259d=_[_0x7156('0x41')]({},_0x47259d,_0xcf131d[_0x7156('0x43')]);var _0x21d7ab={'where':_0x47259d[_0x7156('0x44')]};return db['FreshsalesConfiguration'][_0x7156('0x20')](_0x21d7ab)['then'](function(_0x251d11){_0x7685f0[_0x7156('0x20')]=_0x251d11;if(_0xcf131d[_0x7156('0x34')][_0x7156('0x45')]){_0x47259d['include']=[{'all':!![]}];}return db[_0x7156('0x2f')]['findAll'](_0x47259d);})['then'](function(_0x3e57d5){_0x7685f0[_0x7156('0x46')]=_0x3e57d5;return _0x7685f0;})[_0x7156('0x47')](respondWithFilteredResult(_0xa18c36,_0x47259d))[_0x7156('0x48')](handleError(_0xa18c36,null));};exports[_0x7156('0x49')]=function(_0x5bf7f4,_0x48fdf1){var _0x4848d2={'raw':![],'where':{'id':_0x5bf7f4[_0x7156('0x4a')]['id']}},_0x5377d6={};_0x5377d6[_0x7156('0x38')]=_[_0x7156('0x35')](db[_0x7156('0x2f')][_0x7156('0x30')]);_0x5377d6['query']=_['keys'](_0x5bf7f4[_0x7156('0x34')]);_0x5377d6[_0x7156('0x36')]=_['intersection'](_0x5377d6[_0x7156('0x38')],_0x5377d6[_0x7156('0x34')]);_0x4848d2[_0x7156('0x39')]=_[_0x7156('0x37')](_0x5377d6[_0x7156('0x38')],qs[_0x7156('0x3a')](_0x5bf7f4[_0x7156('0x34')][_0x7156('0x3a')]));_0x4848d2[_0x7156('0x39')]=_0x4848d2[_0x7156('0x39')][_0x7156('0x3b')]?_0x4848d2[_0x7156('0x39')]:_0x5377d6[_0x7156('0x38')];if(_0x5bf7f4[_0x7156('0x34')]['includeAll']){_0x4848d2[_0x7156('0x4b')]=[{'all':!![]}];}_0x4848d2=_[_0x7156('0x41')]({},_0x4848d2,_0x5bf7f4[_0x7156('0x43')]);return db[_0x7156('0x2f')][_0x7156('0x4c')](_0x4848d2)['then'](handleEntityNotFound(_0x48fdf1,null))[_0x7156('0x47')](respondWithResult(_0x48fdf1,null))[_0x7156('0x48')](handleError(_0x48fdf1,null));};exports[_0x7156('0x4d')]=function(_0x4184bf,_0x539199){return db[_0x7156('0x2f')][_0x7156('0x4d')](_0x4184bf[_0x7156('0x4e')],{})[_0x7156('0x47')](respondWithResult(_0x539199,0xc9))[_0x7156('0x48')](handleError(_0x539199,null));};exports['update']=function(_0x4fe0f3,_0xf9bd97){if(_0x4fe0f3[_0x7156('0x4e')]['id']){delete _0x4fe0f3[_0x7156('0x4e')]['id'];}return db[_0x7156('0x2f')][_0x7156('0x4c')]({'where':{'id':_0x4fe0f3['params']['id']}})['then'](handleEntityNotFound(_0xf9bd97,null))['then'](saveUpdates(_0x4fe0f3[_0x7156('0x4e')],null))[_0x7156('0x47')](respondWithResult(_0xf9bd97,null))['catch'](handleError(_0xf9bd97,null));};exports[_0x7156('0x27')]=function(_0xef7042,_0x3cfaaa){return db[_0x7156('0x2f')][_0x7156('0x4c')]({'where':{'id':_0xef7042[_0x7156('0x4a')]['id']}})[_0x7156('0x47')](handleEntityNotFound(_0x3cfaaa,null))['then'](removeEntity(_0x3cfaaa,null))['catch'](handleError(_0x3cfaaa,null));};exports[_0x7156('0x4f')]=function(_0x2e5020,_0x26577b,_0xe67ce7){var _0x8d3cdf={};var _0x36ef43={};var _0x41d878;var _0xf9d43c;return db[_0x7156('0x2f')][_0x7156('0x50')]({'where':{'id':_0x2e5020['params']['id']}})[_0x7156('0x47')](handleEntityNotFound(_0x26577b,null))[_0x7156('0x47')](function(_0xc29afe){if(_0xc29afe){_0x41d878=_0xc29afe;_0x36ef43[_0x7156('0x38')]=_[_0x7156('0x35')](db['FreshsalesField'][_0x7156('0x30')]);_0x36ef43['query']=_[_0x7156('0x35')](_0x2e5020[_0x7156('0x34')]);_0x36ef43['filters']=_[_0x7156('0x37')](_0x36ef43[_0x7156('0x38')],_0x36ef43[_0x7156('0x34')]);_0x8d3cdf[_0x7156('0x39')]=_[_0x7156('0x37')](_0x36ef43[_0x7156('0x38')],qs[_0x7156('0x3a')](_0x2e5020[_0x7156('0x34')][_0x7156('0x3a')]));_0x8d3cdf[_0x7156('0x39')]=_0x8d3cdf['attributes'][_0x7156('0x3b')]?_0x8d3cdf['attributes']:_0x36ef43[_0x7156('0x38')];_0x8d3cdf[_0x7156('0x51')]=qs[_0x7156('0x3e')](_0x2e5020[_0x7156('0x34')][_0x7156('0x3e')]);_0x8d3cdf['where']=qs[_0x7156('0x36')](_[_0x7156('0x3f')](_0x2e5020[_0x7156('0x34')],_0x36ef43['filters']));if(_0x2e5020[_0x7156('0x34')][_0x7156('0x40')]){_0x8d3cdf[_0x7156('0x44')]=_[_0x7156('0x41')](_0x8d3cdf[_0x7156('0x44')],{'$or':_[_0x7156('0x2e')](_0x8d3cdf[_0x7156('0x39')],function(_0x1a7030){var _0x23376f={};_0x23376f[_0x1a7030]={'$like':'%'+_0x2e5020['query']['filter']+'%'};return _0x23376f;})});}_0x8d3cdf=_['merge']({},_0x8d3cdf,_0x2e5020['options']);return _0x41d878[_0x7156('0x4f')](_0x8d3cdf);}})[_0x7156('0x47')](function(_0x52ebec){if(_0x52ebec){_0xf9d43c=_0x52ebec[_0x7156('0x3b')];if(!_0x2e5020[_0x7156('0x34')][_0x7156('0x3c')](_0x7156('0x3d'))){_0x8d3cdf['limit']=qs[_0x7156('0x1f')](_0x2e5020[_0x7156('0x34')]['limit']);_0x8d3cdf[_0x7156('0x1d')]=qs[_0x7156('0x1d')](_0x2e5020[_0x7156('0x34')][_0x7156('0x1d')]);}return _0x41d878[_0x7156('0x4f')](_0x8d3cdf);}})['then'](function(_0x5779d2){if(_0x5779d2){return _0x5779d2?{'count':_0xf9d43c,'rows':_0x5779d2}:null;}})[_0x7156('0x47')](respondWithResult(_0x26577b,null))[_0x7156('0x48')](handleError(_0x26577b,null));};exports[_0x7156('0x52')]=function(_0x4af9a8,_0x2a32ac,_0x4edee2){var _0x40eec0={};var _0x13e675={};var _0x5753d7;var _0x5997c3;return db[_0x7156('0x2f')][_0x7156('0x50')]({'where':{'id':_0x4af9a8['params']['id']}})['then'](handleEntityNotFound(_0x2a32ac,null))[_0x7156('0x47')](function(_0x2994f5){if(_0x2994f5){_0x5753d7=_0x2994f5;_0x13e675[_0x7156('0x38')]=_[_0x7156('0x35')](db[_0x7156('0x53')][_0x7156('0x30')]);_0x13e675[_0x7156('0x34')]=_['keys'](_0x4af9a8[_0x7156('0x34')]);_0x13e675[_0x7156('0x36')]=_[_0x7156('0x37')](_0x13e675[_0x7156('0x38')],_0x13e675[_0x7156('0x34')]);_0x40eec0[_0x7156('0x39')]=_['intersection'](_0x13e675[_0x7156('0x38')],qs[_0x7156('0x3a')](_0x4af9a8[_0x7156('0x34')]['fields']));_0x40eec0[_0x7156('0x39')]=_0x40eec0[_0x7156('0x39')]['length']?_0x40eec0[_0x7156('0x39')]:_0x13e675[_0x7156('0x38')];_0x40eec0[_0x7156('0x51')]=qs[_0x7156('0x3e')](_0x4af9a8['query'][_0x7156('0x3e')]);_0x40eec0[_0x7156('0x44')]=qs[_0x7156('0x36')](_[_0x7156('0x3f')](_0x4af9a8[_0x7156('0x34')],_0x13e675[_0x7156('0x36')]));if(_0x4af9a8['query'][_0x7156('0x40')]){_0x40eec0[_0x7156('0x44')]=_['merge'](_0x40eec0[_0x7156('0x44')],{'$or':_[_0x7156('0x2e')](_0x40eec0[_0x7156('0x39')],function(_0x931e31){var _0x537715={};_0x537715[_0x931e31]={'$like':'%'+_0x4af9a8['query'][_0x7156('0x40')]+'%'};return _0x537715;})});}_0x40eec0=_['merge']({},_0x40eec0,_0x4af9a8[_0x7156('0x43')]);return _0x5753d7[_0x7156('0x52')](_0x40eec0);}})[_0x7156('0x47')](function(_0x20d3cd){if(_0x20d3cd){_0x5997c3=_0x20d3cd['length'];if(!_0x4af9a8[_0x7156('0x34')][_0x7156('0x3c')](_0x7156('0x3d'))){_0x40eec0['limit']=qs[_0x7156('0x1f')](_0x4af9a8['query'][_0x7156('0x1f')]);_0x40eec0[_0x7156('0x1d')]=qs[_0x7156('0x1d')](_0x4af9a8[_0x7156('0x34')]['offset']);}return _0x5753d7[_0x7156('0x52')](_0x40eec0);}})[_0x7156('0x47')](function(_0x148f23){if(_0x148f23){return _0x148f23?{'count':_0x5997c3,'rows':_0x148f23}:null;}})[_0x7156('0x47')](respondWithResult(_0x2a32ac,null))[_0x7156('0x48')](handleError(_0x2a32ac,null));};exports['getFields']=function(_0x395bd9,_0x296aae,_0x7a12b5){var _0x539707={};var _0x55e1d1={};var _0x454d6d;var _0x5192d7;return db[_0x7156('0x2f')]['findOne']({'where':{'id':_0x395bd9[_0x7156('0x4a')]['id']}})[_0x7156('0x47')](handleEntityNotFound(_0x296aae,null))[_0x7156('0x47')](function(_0x196c39){if(_0x196c39){_0x454d6d=_0x196c39;_0x55e1d1[_0x7156('0x38')]=_[_0x7156('0x35')](db[_0x7156('0x53')][_0x7156('0x30')]);_0x55e1d1[_0x7156('0x34')]=_[_0x7156('0x35')](_0x395bd9[_0x7156('0x34')]);_0x55e1d1['filters']=_[_0x7156('0x37')](_0x55e1d1['model'],_0x55e1d1[_0x7156('0x34')]);_0x539707[_0x7156('0x39')]=_[_0x7156('0x37')](_0x55e1d1['model'],qs[_0x7156('0x3a')](_0x395bd9[_0x7156('0x34')]['fields']));_0x539707[_0x7156('0x39')]=_0x539707['attributes'][_0x7156('0x3b')]?_0x539707[_0x7156('0x39')]:_0x55e1d1[_0x7156('0x38')];_0x539707[_0x7156('0x51')]=qs[_0x7156('0x3e')](_0x395bd9[_0x7156('0x34')][_0x7156('0x3e')]);_0x539707['where']=qs[_0x7156('0x36')](_['pick'](_0x395bd9[_0x7156('0x34')],_0x55e1d1[_0x7156('0x36')]));if(_0x395bd9['query']['filter']){_0x539707['where']=_['merge'](_0x539707[_0x7156('0x44')],{'$or':_[_0x7156('0x2e')](_0x539707['attributes'],function(_0x5830cf){var _0x546da3={};_0x546da3[_0x5830cf]={'$like':'%'+_0x395bd9[_0x7156('0x34')]['filter']+'%'};return _0x546da3;})});}_0x539707=_['merge']({},_0x539707,_0x395bd9[_0x7156('0x43')]);return _0x454d6d['getFields'](_0x539707);}})[_0x7156('0x47')](function(_0x2cfddc){if(_0x2cfddc){_0x5192d7=_0x2cfddc[_0x7156('0x3b')];if(!_0x395bd9[_0x7156('0x34')][_0x7156('0x3c')]('nolimit')){_0x539707[_0x7156('0x1f')]=qs[_0x7156('0x1f')](_0x395bd9[_0x7156('0x34')][_0x7156('0x1f')]);_0x539707[_0x7156('0x1d')]=qs[_0x7156('0x1d')](_0x395bd9[_0x7156('0x34')]['offset']);}return _0x454d6d[_0x7156('0x54')](_0x539707);}})[_0x7156('0x47')](function(_0x565686){if(_0x565686){return _0x565686?{'count':_0x5192d7,'rows':_0x565686}:null;}})[_0x7156('0x47')](respondWithResult(_0x296aae,null))['catch'](handleError(_0x296aae,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 465f02a..1d997c6 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 _0xf671=['bluebird','request-promise','path','../../config/environment','./intFreshsalesConfiguration.attributes','exports','FreshsalesConfiguration','int_freshsales_configurations','lodash','util','../../config/logger','api','moment'];(function(_0x5bdbff,_0x8bbf61){var _0x4734b4=function(_0x401224){while(--_0x401224){_0x5bdbff['push'](_0x5bdbff['shift']());}};_0x4734b4(++_0x8bbf61);}(_0xf671,0xf2));var _0x1f67=function(_0x1bcff1,_0x221cf0){_0x1bcff1=_0x1bcff1-0x0;var _0x292d73=_0xf671[_0x1bcff1];return _0x292d73;};'use strict';var _=require(_0x1f67('0x0'));var util=require(_0x1f67('0x1'));var logger=require(_0x1f67('0x2'))(_0x1f67('0x3'));var moment=require(_0x1f67('0x4'));var BPromise=require(_0x1f67('0x5'));var rp=require(_0x1f67('0x6'));var fs=require('fs');var path=require(_0x1f67('0x7'));var rimraf=require('rimraf');var config=require(_0x1f67('0x8'));var attributes=require(_0x1f67('0x9'));module[_0x1f67('0xa')]=function(_0x2a266a,_0x53a9e3){return _0x2a266a['define'](_0x1f67('0xb'),attributes,{'tableName':_0x1f67('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa35f=['path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration','int_freshsales_configurations','util','api','bluebird'];(function(_0x312398,_0x3c7663){var _0x2c2b96=function(_0x2f6c51){while(--_0x2f6c51){_0x312398['push'](_0x312398['shift']());}};_0x2c2b96(++_0x3c7663);}(_0xa35f,0x15d));var _0xfa35=function(_0x3a07c1,_0x34d57f){_0x3a07c1=_0x3a07c1-0x0;var _0x2bbe15=_0xa35f[_0x3a07c1];return _0x2bbe15;};'use strict';var _=require('lodash');var util=require(_0xfa35('0x0'));var logger=require('../../config/logger')(_0xfa35('0x1'));var moment=require('moment');var BPromise=require(_0xfa35('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfa35('0x3'));var rimraf=require(_0xfa35('0x4'));var config=require(_0xfa35('0x5'));var attributes=require(_0xfa35('0x6'));module[_0xfa35('0x7')]=function(_0x416a58,_0x42c359){return _0x416a58[_0xfa35('0x8')](_0xfa35('0x9'),attributes,{'tableName':_0xfa35('0xa'),'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 a254413..364afe6 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 _0x5365=['../../config/logger','rpc','jayson/promise','client','http','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../config/utils'];(function(_0x5ae105,_0x581670){var _0x33d7a3=function(_0x5f52a2){while(--_0x5f52a2){_0x5ae105['push'](_0x5ae105['shift']());}};_0x33d7a3(++_0x581670);}(_0x5365,0x19c));var _0x5536=function(_0x19fd25,_0x10a445){_0x19fd25=_0x19fd25-0x0;var _0x39735d=_0x5365[_0x19fd25];return _0x39735d;};'use strict';var _=require(_0x5536('0x0'));var util=require(_0x5536('0x1'));var moment=require(_0x5536('0x2'));var BPromise=require('bluebird');var rs=require(_0x5536('0x3'));var fs=require('fs');var Redis=require(_0x5536('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5536('0x5'));var logger=require(_0x5536('0x6'))(_0x5536('0x7'));var config=require('../../config/environment');var jayson=require(_0x5536('0x8'));var client=jayson[_0x5536('0x9')][_0x5536('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e402a,_0x19bc04,_0x268843){return new BPromise(function(_0x23ffb8,_0x9b97f4){return client['request'](_0x1e402a,_0x268843)[_0x5536('0xb')](function(_0x26c06b){logger[_0x5536('0xc')](_0x5536('0xd'),_0x19bc04,_0x5536('0xe'));logger['debug']('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x19bc04,_0x5536('0xe'),JSON['stringify'](_0x26c06b));if(_0x26c06b[_0x5536('0xf')]){if(_0x26c06b[_0x5536('0xf')][_0x5536('0x10')]===0x1f4){logger[_0x5536('0xf')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x19bc04,_0x26c06b[_0x5536('0xf')][_0x5536('0x11')]);return _0x9b97f4(_0x26c06b[_0x5536('0xf')][_0x5536('0x11')]);}logger[_0x5536('0xf')](_0x5536('0xd'),_0x19bc04,_0x26c06b['error'][_0x5536('0x11')]);return _0x23ffb8(_0x26c06b[_0x5536('0xf')][_0x5536('0x11')]);}else{logger[_0x5536('0xc')](_0x5536('0xd'),_0x19bc04,_0x5536('0xe'));_0x23ffb8(_0x26c06b['result'][_0x5536('0x11')]);}})[_0x5536('0x12')](function(_0x44b52a){logger[_0x5536('0xf')](_0x5536('0xd'),_0x19bc04,_0x44b52a);_0x9b97f4(_0x44b52a);});});} \ No newline at end of file +var _0xd13b=['FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','FreshsalesConfiguration,\x20%s,\x20%s'];(function(_0x372ca1,_0x48269b){var _0x281a18=function(_0x511b45){while(--_0x511b45){_0x372ca1['push'](_0x372ca1['shift']());}};_0x281a18(++_0x48269b);}(_0xd13b,0xc4));var _0xbd13=function(_0x2e7619,_0x1fae91){_0x2e7619=_0x2e7619-0x0;var _0x5cbd2e=_0xd13b[_0x2e7619];return _0x5cbd2e;};'use strict';var _=require('lodash');var util=require(_0xbd13('0x0'));var moment=require('moment');var BPromise=require(_0xbd13('0x1'));var rs=require(_0xbd13('0x2'));var fs=require('fs');var Redis=require(_0xbd13('0x3'));var db=require(_0xbd13('0x4'))['db'];var utils=require(_0xbd13('0x5'));var logger=require(_0xbd13('0x6'))('rpc');var config=require(_0xbd13('0x7'));var jayson=require(_0xbd13('0x8'));var client=jayson[_0xbd13('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x34f6a5,_0x8f7141,_0x52aff0){return new BPromise(function(_0x54aff1,_0x17d800){return client['request'](_0x34f6a5,_0x52aff0)[_0xbd13('0xa')](function(_0x1c609b){logger[_0xbd13('0xb')](_0xbd13('0xc'),_0x8f7141,'request\x20sent');logger['debug'](_0xbd13('0xd'),_0x8f7141,_0xbd13('0xe'),JSON[_0xbd13('0xf')](_0x1c609b));if(_0x1c609b[_0xbd13('0x10')]){if(_0x1c609b[_0xbd13('0x10')][_0xbd13('0x11')]===0x1f4){logger[_0xbd13('0x10')](_0xbd13('0xc'),_0x8f7141,_0x1c609b[_0xbd13('0x10')]['message']);return _0x17d800(_0x1c609b[_0xbd13('0x10')][_0xbd13('0x12')]);}logger[_0xbd13('0x10')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x8f7141,_0x1c609b[_0xbd13('0x10')]['message']);return _0x54aff1(_0x1c609b['error'][_0xbd13('0x12')]);}else{logger[_0xbd13('0xb')](_0xbd13('0xc'),_0x8f7141,_0xbd13('0xe'));_0x54aff1(_0x1c609b['result'][_0xbd13('0x12')]);}})['catch'](function(_0x59f27a){logger[_0xbd13('0x10')](_0xbd13('0xc'),_0x8f7141,_0x59f27a);_0x17d800(_0x59f27a);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index cbb80fc..838f94e 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 _0x6f7f=['exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intFreshsalesField.controller','get','index','/:id','isAuthenticated','show','post','create','destroy'];(function(_0x193ddf,_0x6f30bb){var _0x5bc6df=function(_0x70fd9e){while(--_0x70fd9e){_0x193ddf['push'](_0x193ddf['shift']());}};_0x5bc6df(++_0x6f30bb);}(_0x6f7f,0x177));var _0xf6f7=function(_0x5c0c9a,_0x432eb2){_0x5c0c9a=_0x5c0c9a-0x0;var _0x3472b3=_0x6f7f[_0x5c0c9a];return _0x3472b3;};'use strict';var multer=require('multer');var util=require(_0xf6f7('0x0'));var path=require(_0xf6f7('0x1'));var timeout=require(_0xf6f7('0x2'));var express=require(_0xf6f7('0x3'));var router=express[_0xf6f7('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf6f7('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf6f7('0x6'));var controller=require(_0xf6f7('0x7'));router[_0xf6f7('0x8')]('/',auth['isAuthenticated'](),controller[_0xf6f7('0x9')]);router['get'](_0xf6f7('0xa'),auth[_0xf6f7('0xb')](),controller[_0xf6f7('0xc')]);router[_0xf6f7('0xd')]('/',auth[_0xf6f7('0xb')](),controller[_0xf6f7('0xe')]);router['put'](_0xf6f7('0xa'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xf6f7('0xa'),auth[_0xf6f7('0xb')](),controller[_0xf6f7('0xf')]);module[_0xf6f7('0x10')]=router; \ No newline at end of file +var _0xcffe=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','post','create','put','update','destroy','exports','multer','util','path'];(function(_0x3fc161,_0x1e7597){var _0xc4c27d=function(_0x58c5a3){while(--_0x58c5a3){_0x3fc161['push'](_0x3fc161['shift']());}};_0xc4c27d(++_0x1e7597);}(_0xcffe,0x1a1));var _0xecff=function(_0x3c2b2e,_0x3e6e53){_0x3c2b2e=_0x3c2b2e-0x0;var _0x27a338=_0xcffe[_0x3c2b2e];return _0x27a338;};'use strict';var multer=require(_0xecff('0x0'));var util=require(_0xecff('0x1'));var path=require(_0xecff('0x2'));var timeout=require(_0xecff('0x3'));var express=require(_0xecff('0x4'));var router=express[_0xecff('0x5')]();var fs_extra=require(_0xecff('0x6'));var auth=require(_0xecff('0x7'));var interaction=require(_0xecff('0x8'));var config=require(_0xecff('0x9'));var controller=require('./intFreshsalesField.controller');router['get']('/',auth[_0xecff('0xa')](),controller[_0xecff('0xb')]);router[_0xecff('0xc')](_0xecff('0xd'),auth[_0xecff('0xa')](),controller[_0xecff('0xe')]);router[_0xecff('0xf')]('/',auth['isAuthenticated'](),controller[_0xecff('0x10')]);router[_0xecff('0x11')](_0xecff('0xd'),auth[_0xecff('0xa')](),controller[_0xecff('0x12')]);router['delete'](_0xecff('0xd'),auth[_0xecff('0xa')](),controller[_0xecff('0x13')]);module[_0xecff('0x14')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 3baf3dd..6d52937 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 _0xd0df=['ENUM','string','STRING','variable','customVariable','BOOLEAN','sequelize','exports'];(function(_0x5c12ba,_0x229eee){var _0x4ed0fa=function(_0x410943){while(--_0x410943){_0x5c12ba['push'](_0x5c12ba['shift']());}};_0x4ed0fa(++_0x229eee);}(_0xd0df,0x66));var _0xfd0d=function(_0x421eeb,_0x3d3e3e){_0x421eeb=_0x421eeb-0x0;var _0x2c7371=_0xd0df[_0x421eeb];return _0x2c7371;};'use strict';var Sequelize=require(_0xfd0d('0x0'));module[_0xfd0d('0x1')]={'type':{'type':Sequelize[_0xfd0d('0x2')](_0xfd0d('0x3'),'variable','customVariable','keyValue','picklist'),'defaultValue':_0xfd0d('0x3')},'content':{'type':Sequelize[_0xfd0d('0x4')]},'key':{'type':Sequelize[_0xfd0d('0x4')]},'keyType':{'type':Sequelize[_0xfd0d('0x2')](_0xfd0d('0x3'),_0xfd0d('0x5'),_0xfd0d('0x6'))},'keyContent':{'type':Sequelize[_0xfd0d('0x4')]},'idField':{'type':Sequelize[_0xfd0d('0x4')]},'nameField':{'type':Sequelize[_0xfd0d('0x4')]},'customField':{'type':Sequelize[_0xfd0d('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf392=['BOOLEAN','sequelize','exports','string','variable','customVariable','keyValue','STRING','ENUM'];(function(_0x11f310,_0x566f6f){var _0x49012b=function(_0x34b5e5){while(--_0x34b5e5){_0x11f310['push'](_0x11f310['shift']());}};_0x49012b(++_0x566f6f);}(_0xf392,0x1ba));var _0x2f39=function(_0x4d7c2f,_0x33b5ed){_0x4d7c2f=_0x4d7c2f-0x0;var _0x1d6a4f=_0xf392[_0x4d7c2f];return _0x1d6a4f;};'use strict';var Sequelize=require(_0x2f39('0x0'));module[_0x2f39('0x1')]={'type':{'type':Sequelize['ENUM'](_0x2f39('0x2'),_0x2f39('0x3'),_0x2f39('0x4'),_0x2f39('0x5'),'picklist'),'defaultValue':_0x2f39('0x2')},'content':{'type':Sequelize[_0x2f39('0x6')]},'key':{'type':Sequelize[_0x2f39('0x6')]},'keyType':{'type':Sequelize[_0x2f39('0x7')](_0x2f39('0x2'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x2f39('0x6')]},'idField':{'type':Sequelize[_0x2f39('0x6')]},'nameField':{'type':Sequelize[_0x2f39('0x6')]},'customField':{'type':Sequelize[_0x2f39('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2f39('0x6')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index c28b572..ae5835e 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 _0x2d76=['find','create','body','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','sendStatus','error','stack','name','send','index','map','FreshsalesField','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','findAll','catch','params','include','merge'];(function(_0x4c5899,_0x54ac0b){var _0x3656ba=function(_0x56bbcd){while(--_0x56bbcd){_0x4c5899['push'](_0x4c5899['shift']());}};_0x3656ba(++_0x54ac0b);}(_0x2d76,0x16b));var _0x62d7=function(_0x22c479,_0x290971){_0x22c479=_0x22c479-0x0;var _0x5b99a4=_0x2d76[_0x22c479];return _0x5b99a4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x62d7('0x0'));var rp=require(_0x62d7('0x1'));var moment=require(_0x62d7('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x62d7('0x3'));var util=require('util');var path=require(_0x62d7('0x4'));var sox=require(_0x62d7('0x5'));var csv=require(_0x62d7('0x6'));var ejs=require(_0x62d7('0x7'));var fs=require('fs');var fs_extra=require(_0x62d7('0x8'));var _=require(_0x62d7('0x9'));var squel=require(_0x62d7('0xa'));var crypto=require(_0x62d7('0xb'));var jsforce=require(_0x62d7('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x62d7('0x6'));var querystring=require('querystring');var Papa=require(_0x62d7('0xd'));var Redis=require(_0x62d7('0xe'));var authService=require(_0x62d7('0xf'));var qs=require(_0x62d7('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x62d7('0x11'));var logger=require(_0x62d7('0x12'))(_0x62d7('0x13'));var utils=require(_0x62d7('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x62d7('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5ad984,_0x18ad38){_0x18ad38=_0x18ad38||0xcc;return function(_0xbb2c6a){if(_0xbb2c6a){return _0x5ad984['sendStatus'](_0x18ad38);}return _0x5ad984[_0x62d7('0x16')](_0x18ad38)[_0x62d7('0x17')]();};}function respondWithResult(_0x5361d7,_0x342bca){_0x342bca=_0x342bca||0xc8;return function(_0x49cce6){if(_0x49cce6){return _0x5361d7[_0x62d7('0x16')](_0x342bca)['json'](_0x49cce6);}};}function respondWithFilteredResult(_0x20dec7,_0x2c9a3d){return function(_0x317a36){if(_0x317a36){var _0x3576d4=typeof _0x2c9a3d[_0x62d7('0x18')]===_0x62d7('0x19')&&typeof _0x2c9a3d[_0x62d7('0x1a')]===_0x62d7('0x19');var _0x51487a=_0x317a36['count'];var _0x2032a3=_0x3576d4?0x0:_0x2c9a3d['offset'];var _0x3e241f=_0x3576d4?_0x317a36[_0x62d7('0x1b')]:_0x2c9a3d[_0x62d7('0x18')]+_0x2c9a3d[_0x62d7('0x1a')];var _0x36f295;if(_0x3e241f>=_0x51487a){_0x3e241f=_0x51487a;_0x36f295=0xc8;}else{_0x36f295=0xce;}_0x20dec7['status'](_0x36f295);return _0x20dec7[_0x62d7('0x1c')](_0x62d7('0x1d'),_0x2032a3+'-'+_0x3e241f+'/'+_0x51487a)[_0x62d7('0x1e')](_0x317a36);}return null;};}function patchUpdates(_0x2dd023){return function(_0x534865){try{jsonpatch[_0x62d7('0x1f')](_0x534865,_0x2dd023,!![]);}catch(_0x449600){return BPromise['reject'](_0x449600);}return _0x534865[_0x62d7('0x20')]();};}function saveUpdates(_0x201eb3,_0x366252){return function(_0x228967){if(_0x228967){return _0x228967[_0x62d7('0x21')](_0x201eb3)[_0x62d7('0x22')](function(_0x2cfc63){return _0x2cfc63;});}return null;};}function removeEntity(_0x503b68,_0x185c1f){return function(_0x1befa6){if(_0x1befa6){return _0x1befa6['destroy']()[_0x62d7('0x22')](function(){_0x503b68['status'](0xcc)[_0x62d7('0x17')]();});}};}function handleEntityNotFound(_0x3b2df2,_0x33fba9){return function(_0x4c7554){if(!_0x4c7554){_0x3b2df2[_0x62d7('0x23')](0x194);}return _0x4c7554;};}function handleError(_0xbc675b,_0x4082b1){_0x4082b1=_0x4082b1||0x1f4;return function(_0x29385f){logger[_0x62d7('0x24')](_0x29385f[_0x62d7('0x25')]);if(_0x29385f[_0x62d7('0x26')]){delete _0x29385f[_0x62d7('0x26')];}_0xbc675b[_0x62d7('0x16')](_0x4082b1)[_0x62d7('0x27')](_0x29385f);};}exports[_0x62d7('0x28')]=function(_0x563c53,_0x35afb6){var _0x241d3c={},_0xbaaf5d={},_0x21d206={'count':0x0,'rows':[]};var _0x4ed286=_[_0x62d7('0x29')](db[_0x62d7('0x2a')][_0x62d7('0x2b')],function(_0x42d508){return{'name':_0x42d508['fieldName'],'type':_0x42d508[_0x62d7('0x2c')][_0x62d7('0x2d')]};});_0xbaaf5d[_0x62d7('0x2e')]=_[_0x62d7('0x29')](_0x4ed286,_0x62d7('0x26'));_0xbaaf5d[_0x62d7('0x2f')]=_[_0x62d7('0x30')](_0x563c53[_0x62d7('0x2f')]);_0xbaaf5d[_0x62d7('0x31')]=_[_0x62d7('0x32')](_0xbaaf5d[_0x62d7('0x2e')],_0xbaaf5d['query']);_0x241d3c['attributes']=_[_0x62d7('0x32')](_0xbaaf5d['model'],qs[_0x62d7('0x33')](_0x563c53[_0x62d7('0x2f')]['fields']));_0x241d3c[_0x62d7('0x34')]=_0x241d3c['attributes'][_0x62d7('0x35')]?_0x241d3c[_0x62d7('0x34')]:_0xbaaf5d[_0x62d7('0x2e')];if(!_0x563c53[_0x62d7('0x2f')][_0x62d7('0x36')](_0x62d7('0x37'))){_0x241d3c[_0x62d7('0x1a')]=qs[_0x62d7('0x1a')](_0x563c53[_0x62d7('0x2f')][_0x62d7('0x1a')]);_0x241d3c[_0x62d7('0x18')]=qs[_0x62d7('0x18')](_0x563c53['query'][_0x62d7('0x18')]);}_0x241d3c[_0x62d7('0x38')]=qs[_0x62d7('0x39')](_0x563c53[_0x62d7('0x2f')]['sort']);_0x241d3c[_0x62d7('0x3a')]=qs['filters'](_[_0x62d7('0x3b')](_0x563c53[_0x62d7('0x2f')],_0xbaaf5d['filters']),_0x4ed286);if(_0x563c53[_0x62d7('0x2f')][_0x62d7('0x3c')]){_0x241d3c[_0x62d7('0x3a')]=_['merge'](_0x241d3c['where'],{'$or':_[_0x62d7('0x29')](_0x4ed286,function(_0x545761){if(_0x545761['type']!==_0x62d7('0x3d')){var _0x558efa={};_0x558efa[_0x545761[_0x62d7('0x26')]]={'$like':'%'+_0x563c53[_0x62d7('0x2f')][_0x62d7('0x3c')]+'%'};return _0x558efa;}})});}_0x241d3c=_['merge']({},_0x241d3c,_0x563c53[_0x62d7('0x3e')]);var _0x35c9af={'where':_0x241d3c['where']};return db[_0x62d7('0x2a')][_0x62d7('0x1b')](_0x35c9af)[_0x62d7('0x22')](function(_0x65e3b){_0x21d206['count']=_0x65e3b;if(_0x563c53[_0x62d7('0x2f')][_0x62d7('0x3f')]){_0x241d3c['include']=[{'all':!![]}];}return db[_0x62d7('0x2a')][_0x62d7('0x40')](_0x241d3c);})[_0x62d7('0x22')](function(_0x312e7f){_0x21d206['rows']=_0x312e7f;return _0x21d206;})[_0x62d7('0x22')](respondWithFilteredResult(_0x35afb6,_0x241d3c))[_0x62d7('0x41')](handleError(_0x35afb6,null));};exports['show']=function(_0x13d79e,_0x5c13df){var _0x30a2d9={'raw':!![],'where':{'id':_0x13d79e[_0x62d7('0x42')]['id']}},_0x3c8a2e={};_0x3c8a2e[_0x62d7('0x2e')]=_[_0x62d7('0x30')](db[_0x62d7('0x2a')][_0x62d7('0x2b')]);_0x3c8a2e[_0x62d7('0x2f')]=_[_0x62d7('0x30')](_0x13d79e[_0x62d7('0x2f')]);_0x3c8a2e[_0x62d7('0x31')]=_[_0x62d7('0x32')](_0x3c8a2e[_0x62d7('0x2e')],_0x3c8a2e[_0x62d7('0x2f')]);_0x30a2d9[_0x62d7('0x34')]=_[_0x62d7('0x32')](_0x3c8a2e[_0x62d7('0x2e')],qs['fields'](_0x13d79e[_0x62d7('0x2f')]['fields']));_0x30a2d9[_0x62d7('0x34')]=_0x30a2d9[_0x62d7('0x34')]['length']?_0x30a2d9[_0x62d7('0x34')]:_0x3c8a2e[_0x62d7('0x2e')];if(_0x13d79e['query'][_0x62d7('0x3f')]){_0x30a2d9[_0x62d7('0x43')]=[{'all':!![]}];}_0x30a2d9=_[_0x62d7('0x44')]({},_0x30a2d9,_0x13d79e[_0x62d7('0x3e')]);return db[_0x62d7('0x2a')][_0x62d7('0x45')](_0x30a2d9)['then'](handleEntityNotFound(_0x5c13df,null))[_0x62d7('0x22')](respondWithResult(_0x5c13df,null))[_0x62d7('0x41')](handleError(_0x5c13df,null));};exports['create']=function(_0x3e033c,_0x471e40){return db[_0x62d7('0x2a')][_0x62d7('0x46')](_0x3e033c[_0x62d7('0x47')],{})[_0x62d7('0x22')](respondWithResult(_0x471e40,0xc9))[_0x62d7('0x41')](handleError(_0x471e40,null));};exports['update']=function(_0xde856f,_0x526035){if(_0xde856f[_0x62d7('0x47')]['id']){delete _0xde856f['body']['id'];}return db[_0x62d7('0x2a')][_0x62d7('0x45')]({'where':{'id':_0xde856f['params']['id']}})[_0x62d7('0x22')](handleEntityNotFound(_0x526035,null))[_0x62d7('0x22')](saveUpdates(_0xde856f['body'],null))[_0x62d7('0x22')](respondWithResult(_0x526035,null))[_0x62d7('0x41')](handleError(_0x526035,null));};exports['destroy']=function(_0x5e73f6,_0x4f7bbd){return db[_0x62d7('0x2a')][_0x62d7('0x45')]({'where':{'id':_0x5e73f6[_0x62d7('0x42')]['id']}})[_0x62d7('0x22')](handleEntityNotFound(_0x4f7bbd,null))[_0x62d7('0x22')](removeEntity(_0x4f7bbd,null))[_0x62d7('0x41')](handleError(_0x4f7bbd,null));}; \ No newline at end of file +var _0x8836=['nolimit','order','sort','where','pick','filter','merge','VIRTUAL','FreshsalesField','findAll','then','rows','catch','show','params','includeAll','include','options','find','create','body','destroy','eml-format','rimraf','request-promise','bluebird','util','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','end','error','name','send','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x317c7a,_0x31641c){var _0x49d02f=function(_0x55bd49){while(--_0x55bd49){_0x317c7a['push'](_0x317c7a['shift']());}};_0x49d02f(++_0x31641c);}(_0x8836,0xa8));var _0x6883=function(_0x3363b5,_0x57c9e7){_0x3363b5=_0x3363b5-0x0;var _0x3b195b=_0x8836[_0x3363b5];return _0x3b195b;};'use strict';var emlformat=require(_0x6883('0x0'));var rimraf=require(_0x6883('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6883('0x2'));var moment=require('moment');var BPromise=require(_0x6883('0x3'));var Mustache=require('mustache');var util=require(_0x6883('0x4'));var path=require('path');var sox=require(_0x6883('0x5'));var csv=require(_0x6883('0x6'));var ejs=require(_0x6883('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6883('0x8'));var crypto=require('crypto');var jsforce=require(_0x6883('0x9'));var deskjs=require(_0x6883('0xa'));var toCsv=require(_0x6883('0x6'));var querystring=require(_0x6883('0xb'));var Papa=require('papaparse');var Redis=require(_0x6883('0xc'));var authService=require(_0x6883('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x6883('0xe'));var hardwareService=require(_0x6883('0xf'));var logger=require(_0x6883('0x10'))(_0x6883('0x11'));var utils=require(_0x6883('0x12'));var config=require(_0x6883('0x13'));var licenseUtil=require(_0x6883('0x14'));var db=require(_0x6883('0x15'))['db'];function respondWithStatusCode(_0x26c2fd,_0x3030d7){_0x3030d7=_0x3030d7||0xcc;return function(_0x280830){if(_0x280830){return _0x26c2fd[_0x6883('0x16')](_0x3030d7);}return _0x26c2fd['status'](_0x3030d7)['end']();};}function respondWithResult(_0x21d983,_0x5aee63){_0x5aee63=_0x5aee63||0xc8;return function(_0x33b13c){if(_0x33b13c){return _0x21d983[_0x6883('0x17')](_0x5aee63)[_0x6883('0x18')](_0x33b13c);}};}function respondWithFilteredResult(_0x53a85f,_0x2c450e){return function(_0x3b76bb){if(_0x3b76bb){var _0x3dbfa8=typeof _0x2c450e[_0x6883('0x19')]===_0x6883('0x1a')&&typeof _0x2c450e[_0x6883('0x1b')]===_0x6883('0x1a');var _0x59a3cc=_0x3b76bb[_0x6883('0x1c')];var _0x7a0b08=_0x3dbfa8?0x0:_0x2c450e[_0x6883('0x19')];var _0x383ae4=_0x3dbfa8?_0x3b76bb[_0x6883('0x1c')]:_0x2c450e['offset']+_0x2c450e[_0x6883('0x1b')];var _0xc55e59;if(_0x383ae4>=_0x59a3cc){_0x383ae4=_0x59a3cc;_0xc55e59=0xc8;}else{_0xc55e59=0xce;}_0x53a85f[_0x6883('0x17')](_0xc55e59);return _0x53a85f[_0x6883('0x1d')](_0x6883('0x1e'),_0x7a0b08+'-'+_0x383ae4+'/'+_0x59a3cc)[_0x6883('0x18')](_0x3b76bb);}return null;};}function patchUpdates(_0x1954db){return function(_0x24da03){try{jsonpatch[_0x6883('0x1f')](_0x24da03,_0x1954db,!![]);}catch(_0x262cff){return BPromise[_0x6883('0x20')](_0x262cff);}return _0x24da03['save']();};}function saveUpdates(_0x3ff946,_0x1d723d){return function(_0x3b7303){if(_0x3b7303){return _0x3b7303[_0x6883('0x21')](_0x3ff946)['then'](function(_0x39ffaa){return _0x39ffaa;});}return null;};}function removeEntity(_0x5253ee,_0x4c1340){return function(_0x4fa942){if(_0x4fa942){return _0x4fa942['destroy']()['then'](function(){_0x5253ee['status'](0xcc)[_0x6883('0x22')]();});}};}function handleEntityNotFound(_0x5012f0,_0x2c39b5){return function(_0x2d38e1){if(!_0x2d38e1){_0x5012f0[_0x6883('0x16')](0x194);}return _0x2d38e1;};}function handleError(_0x5965c9,_0x4320e5){_0x4320e5=_0x4320e5||0x1f4;return function(_0x10bf8f){logger[_0x6883('0x23')](_0x10bf8f['stack']);if(_0x10bf8f[_0x6883('0x24')]){delete _0x10bf8f[_0x6883('0x24')];}_0x5965c9[_0x6883('0x17')](_0x4320e5)[_0x6883('0x25')](_0x10bf8f);};}exports['index']=function(_0x4db6fe,_0x55400b){var _0x13590a={},_0x1cdc1a={},_0x3b5240={'count':0x0,'rows':[]};var _0xbd43f8=_[_0x6883('0x26')](db['FreshsalesField'][_0x6883('0x27')],function(_0x3b3524){return{'name':_0x3b3524['fieldName'],'type':_0x3b3524[_0x6883('0x28')][_0x6883('0x29')]};});_0x1cdc1a[_0x6883('0x2a')]=_[_0x6883('0x26')](_0xbd43f8,_0x6883('0x24'));_0x1cdc1a[_0x6883('0x2b')]=_[_0x6883('0x2c')](_0x4db6fe[_0x6883('0x2b')]);_0x1cdc1a[_0x6883('0x2d')]=_[_0x6883('0x2e')](_0x1cdc1a[_0x6883('0x2a')],_0x1cdc1a[_0x6883('0x2b')]);_0x13590a[_0x6883('0x2f')]=_[_0x6883('0x2e')](_0x1cdc1a[_0x6883('0x2a')],qs[_0x6883('0x30')](_0x4db6fe[_0x6883('0x2b')][_0x6883('0x30')]));_0x13590a[_0x6883('0x2f')]=_0x13590a[_0x6883('0x2f')][_0x6883('0x31')]?_0x13590a[_0x6883('0x2f')]:_0x1cdc1a[_0x6883('0x2a')];if(!_0x4db6fe['query'][_0x6883('0x32')](_0x6883('0x33'))){_0x13590a[_0x6883('0x1b')]=qs[_0x6883('0x1b')](_0x4db6fe[_0x6883('0x2b')]['limit']);_0x13590a[_0x6883('0x19')]=qs[_0x6883('0x19')](_0x4db6fe['query'][_0x6883('0x19')]);}_0x13590a[_0x6883('0x34')]=qs[_0x6883('0x35')](_0x4db6fe[_0x6883('0x2b')][_0x6883('0x35')]);_0x13590a[_0x6883('0x36')]=qs['filters'](_[_0x6883('0x37')](_0x4db6fe['query'],_0x1cdc1a[_0x6883('0x2d')]),_0xbd43f8);if(_0x4db6fe[_0x6883('0x2b')][_0x6883('0x38')]){_0x13590a[_0x6883('0x36')]=_[_0x6883('0x39')](_0x13590a[_0x6883('0x36')],{'$or':_['map'](_0xbd43f8,function(_0x1ffd60){if(_0x1ffd60['type']!==_0x6883('0x3a')){var _0x419457={};_0x419457[_0x1ffd60[_0x6883('0x24')]]={'$like':'%'+_0x4db6fe[_0x6883('0x2b')]['filter']+'%'};return _0x419457;}})});}_0x13590a=_[_0x6883('0x39')]({},_0x13590a,_0x4db6fe['options']);var _0x2f3850={'where':_0x13590a[_0x6883('0x36')]};return db[_0x6883('0x3b')][_0x6883('0x1c')](_0x2f3850)['then'](function(_0x32f299){_0x3b5240[_0x6883('0x1c')]=_0x32f299;if(_0x4db6fe['query']['includeAll']){_0x13590a['include']=[{'all':!![]}];}return db[_0x6883('0x3b')][_0x6883('0x3c')](_0x13590a);})[_0x6883('0x3d')](function(_0x1f4a7d){_0x3b5240[_0x6883('0x3e')]=_0x1f4a7d;return _0x3b5240;})[_0x6883('0x3d')](respondWithFilteredResult(_0x55400b,_0x13590a))[_0x6883('0x3f')](handleError(_0x55400b,null));};exports[_0x6883('0x40')]=function(_0x40a815,_0xcef44b){var _0x97ae98={'raw':!![],'where':{'id':_0x40a815[_0x6883('0x41')]['id']}},_0xd58ec={};_0xd58ec[_0x6883('0x2a')]=_['keys'](db[_0x6883('0x3b')][_0x6883('0x27')]);_0xd58ec[_0x6883('0x2b')]=_[_0x6883('0x2c')](_0x40a815['query']);_0xd58ec['filters']=_['intersection'](_0xd58ec[_0x6883('0x2a')],_0xd58ec['query']);_0x97ae98[_0x6883('0x2f')]=_[_0x6883('0x2e')](_0xd58ec[_0x6883('0x2a')],qs[_0x6883('0x30')](_0x40a815[_0x6883('0x2b')][_0x6883('0x30')]));_0x97ae98['attributes']=_0x97ae98['attributes'][_0x6883('0x31')]?_0x97ae98['attributes']:_0xd58ec[_0x6883('0x2a')];if(_0x40a815[_0x6883('0x2b')][_0x6883('0x42')]){_0x97ae98[_0x6883('0x43')]=[{'all':!![]}];}_0x97ae98=_[_0x6883('0x39')]({},_0x97ae98,_0x40a815[_0x6883('0x44')]);return db[_0x6883('0x3b')][_0x6883('0x45')](_0x97ae98)[_0x6883('0x3d')](handleEntityNotFound(_0xcef44b,null))[_0x6883('0x3d')](respondWithResult(_0xcef44b,null))[_0x6883('0x3f')](handleError(_0xcef44b,null));};exports[_0x6883('0x46')]=function(_0x5dcd50,_0x2f8acb){return db[_0x6883('0x3b')]['create'](_0x5dcd50[_0x6883('0x47')],{})['then'](respondWithResult(_0x2f8acb,0xc9))['catch'](handleError(_0x2f8acb,null));};exports[_0x6883('0x21')]=function(_0x1f1e72,_0x129d26){if(_0x1f1e72['body']['id']){delete _0x1f1e72[_0x6883('0x47')]['id'];}return db[_0x6883('0x3b')][_0x6883('0x45')]({'where':{'id':_0x1f1e72[_0x6883('0x41')]['id']}})[_0x6883('0x3d')](handleEntityNotFound(_0x129d26,null))['then'](saveUpdates(_0x1f1e72[_0x6883('0x47')],null))[_0x6883('0x3d')](respondWithResult(_0x129d26,null))[_0x6883('0x3f')](handleError(_0x129d26,null));};exports[_0x6883('0x48')]=function(_0x3f2545,_0x4c1dde){return db[_0x6883('0x3b')]['find']({'where':{'id':_0x3f2545[_0x6883('0x41')]['id']}})[_0x6883('0x3d')](handleEntityNotFound(_0x4c1dde,null))['then'](removeEntity(_0x4c1dde,null))[_0x6883('0x3f')](handleError(_0x4c1dde,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 7705fe9..615a8ed 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 _0x6efe=['define','idField','FieldId','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./intFreshsalesField.attributes','exports'];(function(_0x46f613,_0x6855b0){var _0x19e324=function(_0x45ba0b){while(--_0x45ba0b){_0x46f613['push'](_0x46f613['shift']());}};_0x19e324(++_0x6855b0);}(_0x6efe,0xc6));var _0xe6ef=function(_0x62fff1,_0x1fad17){_0x62fff1=_0x62fff1-0x0;var _0x1abb5c=_0x6efe[_0x62fff1];return _0x1abb5c;};'use strict';var _=require(_0xe6ef('0x0'));var util=require(_0xe6ef('0x1'));var logger=require(_0xe6ef('0x2'))(_0xe6ef('0x3'));var moment=require(_0xe6ef('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe6ef('0x5'));var rimraf=require(_0xe6ef('0x6'));var config=require(_0xe6ef('0x7'));var attributes=require(_0xe6ef('0x8'));module[_0xe6ef('0x9')]=function(_0x573395,_0x17fc74){return _0x573395[_0xe6ef('0xa')]('FreshsalesField',attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0xe6ef('0xb'),_0xe6ef('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd9eb=['int_freshsales_fields','freshsales_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesField.attributes','exports','define','FreshsalesField'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xd9eb,0xca));var _0xbd9e=function(_0x2a7210,_0x2f3d23){_0x2a7210=_0x2a7210-0x0;var _0x460766=_0xd9eb[_0x2a7210];return _0x460766;};'use strict';var _=require(_0xbd9e('0x0'));var util=require(_0xbd9e('0x1'));var logger=require(_0xbd9e('0x2'))(_0xbd9e('0x3'));var moment=require(_0xbd9e('0x4'));var BPromise=require(_0xbd9e('0x5'));var rp=require(_0xbd9e('0x6'));var fs=require('fs');var path=require(_0xbd9e('0x7'));var rimraf=require(_0xbd9e('0x8'));var config=require(_0xbd9e('0x9'));var attributes=require(_0xbd9e('0xa'));module[_0xbd9e('0xb')]=function(_0x20c36a,_0x4ade3f){return _0x20c36a[_0xbd9e('0xc')](_0xbd9e('0xd'),attributes,{'tableName':_0xbd9e('0xe'),'paranoid':![],'indexes':[{'name':_0xbd9e('0xf'),'fields':[_0xbd9e('0x10'),_0xbd9e('0x11')],'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 6691be5..ab042a0 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 _0x53ec=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','stringify','code'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x53ec,0x192));var _0xc53e=function(_0x39c65b,_0x4b5a02){_0x39c65b=_0x39c65b-0x0;var _0x487fee=_0x53ec[_0x39c65b];return _0x487fee;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var moment=require(_0xc53e('0x2'));var BPromise=require(_0xc53e('0x3'));var rs=require(_0xc53e('0x4'));var fs=require('fs');var Redis=require(_0xc53e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc53e('0x6'));var logger=require('../../config/logger')(_0xc53e('0x7'));var config=require(_0xc53e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc53e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41a9e8,_0x2de88b,_0x5d3b28){return new BPromise(function(_0x1616ac,_0x1ac6c0){return client[_0xc53e('0xa')](_0x41a9e8,_0x5d3b28)[_0xc53e('0xb')](function(_0xd9612){logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));logger[_0xc53e('0xf')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x2de88b,'request\x20sent',JSON[_0xc53e('0x10')](_0xd9612));if(_0xd9612['error']){if(_0xd9612['error'][_0xc53e('0x11')]===0x1f4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')]['message']);return _0x1ac6c0(_0xd9612['error'][_0xc53e('0x13')]);}logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);return _0x1616ac(_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);}else{logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));_0x1616ac(_0xd9612['result'][_0xc53e('0x13')]);}})[_0xc53e('0x14')](function(_0x535cd4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0x535cd4);_0x1ac6c0(_0x535cd4);});});} \ No newline at end of file +var _0xf494=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','FreshsalesField,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x5a6de2,_0x5c8b10){var _0x2c0525=function(_0x59d072){while(--_0x59d072){_0x5a6de2['push'](_0x5a6de2['shift']());}};_0x2c0525(++_0x5c8b10);}(_0xf494,0x1c6));var _0x4f49=function(_0xb5a342,_0x25fe14){_0xb5a342=_0xb5a342-0x0;var _0x4e0797=_0xf494[_0xb5a342];return _0x4e0797;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var moment=require(_0x4f49('0x2'));var BPromise=require('bluebird');var rs=require(_0x4f49('0x3'));var fs=require('fs');var Redis=require(_0x4f49('0x4'));var db=require(_0x4f49('0x5'))['db'];var utils=require(_0x4f49('0x6'));var logger=require(_0x4f49('0x7'))(_0x4f49('0x8'));var config=require(_0x4f49('0x9'));var jayson=require(_0x4f49('0xa'));var client=jayson[_0x4f49('0xb')][_0x4f49('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x42b0e8,_0x5eb186,_0x58e9a0){return new BPromise(function(_0x169c95,_0x327bd5){return client[_0x4f49('0xd')](_0x42b0e8,_0x58e9a0)[_0x4f49('0xe')](function(_0x185174){logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,_0x4f49('0x11'));logger['debug'](_0x4f49('0x12'),_0x5eb186,_0x4f49('0x11'),JSON['stringify'](_0x185174));if(_0x185174[_0x4f49('0x13')]){if(_0x185174['error']['code']===0x1f4){logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174['error'][_0x4f49('0x14')]);return _0x327bd5(_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);}logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);return _0x169c95(_0x185174['error'][_0x4f49('0x14')]);}else{logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,'request\x20sent');_0x169c95(_0x185174['result'][_0x4f49('0x14')]);}})[_0x4f49('0x15')](function(_0x74886e){logger['error'](_0x4f49('0x10'),_0x5eb186,_0x74886e);_0x327bd5(_0x74886e);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 1fdb2d6..2622a00 100644 --- a/server/api/intSalesforceAccount/index.js +++ b/server/api/intSalesforceAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x172afa,_0x46938e){var _0x4a3a5c=function(_0x2b12c9){while(--_0x2b12c9){_0x172afa['push'](_0x172afa['shift']());}};_0x4a3a5c(++_0x46938e);}(_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 fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x2bdb48,_0x5e7722){var _0x3d23b4=function(_0x1b854d){while(--_0x1b854d){_0x2bdb48['push'](_0x2bdb48['shift']());}};_0x3d23b4(++_0x5e7722);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 25ae6ab..0fae8ce 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 _0x6124=['STRING','username','ENUM','integrationTab','newTab','sequelize','exports'];(function(_0x1e6d81,_0xf7d233){var _0x4c719f=function(_0x203592){while(--_0x203592){_0x1e6d81['push'](_0x1e6d81['shift']());}};_0x4c719f(++_0xf7d233);}(_0x6124,0x140));var _0x4612=function(_0x7d3d9,_0x4335e0){_0x7d3d9=_0x7d3d9-0x0;var _0x111155=_0x6124[_0x7d3d9];return _0x111155;};'use strict';var Sequelize=require(_0x4612('0x0'));module[_0x4612('0x1')]={'name':{'type':Sequelize[_0x4612('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x4612('0x2')],'unique':_0x4612('0x3')},'remoteUri':{'type':Sequelize[_0x4612('0x2')]},'password':{'type':Sequelize[_0x4612('0x2')]},'clientId':{'type':Sequelize[_0x4612('0x2')]},'clientSecret':{'type':Sequelize[_0x4612('0x2')]},'securityToken':{'type':Sequelize[_0x4612('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x4612('0x4')](_0x4612('0x5'),_0x4612('0x6')),'defaultValue':_0x4612('0x5')}}; \ No newline at end of file +var _0x89d6=['newTab','sequelize','exports','STRING','username','ENUM','integrationTab'];(function(_0x33cc31,_0x3e573f){var _0x12257b=function(_0x4621e1){while(--_0x4621e1){_0x33cc31['push'](_0x33cc31['shift']());}};_0x12257b(++_0x3e573f);}(_0x89d6,0x119));var _0x689d=function(_0x4e69a8,_0x20783f){_0x4e69a8=_0x4e69a8-0x0;var _0x4ea8da=_0x89d6[_0x4e69a8];return _0x4ea8da;};'use strict';var Sequelize=require(_0x689d('0x0'));module[_0x689d('0x1')]={'name':{'type':Sequelize[_0x689d('0x2')]},'description':{'type':Sequelize[_0x689d('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x689d('0x3')},'remoteUri':{'type':Sequelize[_0x689d('0x2')]},'password':{'type':Sequelize[_0x689d('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x689d('0x2')]},'securityToken':{'type':Sequelize[_0x689d('0x2')]},'serverUrl':{'type':Sequelize[_0x689d('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x689d('0x4')](_0x689d('0x5'),_0x689d('0x6')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index bdf2958..9e251f4 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 _0x37b3=['True','False','false','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','name','send','index','map','SalesforceAccount','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','body','find','getConfigurations','findOne','SalesforceConfiguration','Subjects','getSubjects','channel','Descriptions','create','SalesforceField','Task','clientId','clientSecret','username','password','securityToken','remoteUri','slice','substring','lastIndexOf','login','concat','ticketType','sobject','describe','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','int','picklist','boolean','email','phone','includes','label','custom','picklistValues','value'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x37b3,0xf6));var _0x337b=function(_0x3c08ea,_0x419b25){_0x3c08ea=_0x3c08ea-0x0;var _0x4b6e51=_0x37b3[_0x3c08ea];return _0x4b6e51;};'use strict';var emlformat=require(_0x337b('0x0'));var rimraf=require(_0x337b('0x1'));var zipdir=require(_0x337b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x337b('0x3'));var moment=require('moment');var BPromise=require(_0x337b('0x4'));var Mustache=require(_0x337b('0x5'));var util=require(_0x337b('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x337b('0x7'));var ejs=require(_0x337b('0x8'));var fs=require('fs');var fs_extra=require(_0x337b('0x9'));var _=require(_0x337b('0xa'));var squel=require(_0x337b('0xb'));var crypto=require(_0x337b('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x337b('0xd'));var toCsv=require(_0x337b('0x7'));var querystring=require('querystring');var Papa=require(_0x337b('0xe'));var Redis=require(_0x337b('0xf'));var authService=require(_0x337b('0x10'));var qs=require(_0x337b('0x11'));var as=require(_0x337b('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x337b('0x13'))(_0x337b('0x14'));var utils=require(_0x337b('0x15'));var config=require(_0x337b('0x16'));var licenseUtil=require(_0x337b('0x17'));var db=require(_0x337b('0x18'))['db'];var integrations=require(_0x337b('0x19'));function respondWithStatusCode(_0x4c6e89,_0x574770){_0x574770=_0x574770||0xcc;return function(_0x3c22d0){if(_0x3c22d0){return _0x4c6e89['sendStatus'](_0x574770);}return _0x4c6e89[_0x337b('0x1a')](_0x574770)[_0x337b('0x1b')]();};}function respondWithResult(_0x5e440c,_0x28dbc8){_0x28dbc8=_0x28dbc8||0xc8;return function(_0x3a615b){if(_0x3a615b){return _0x5e440c[_0x337b('0x1a')](_0x28dbc8)[_0x337b('0x1c')](_0x3a615b);}};}function respondWithFilteredResult(_0x212031,_0x347162){return function(_0x4c4995){if(_0x4c4995){var _0x574928=typeof _0x347162[_0x337b('0x1d')]===_0x337b('0x1e')&&typeof _0x347162[_0x337b('0x1f')]==='undefined';var _0x26d76a=_0x4c4995['count'];var _0x12e9dc=_0x574928?0x0:_0x347162['offset'];var _0x106eb3=_0x574928?_0x4c4995[_0x337b('0x20')]:_0x347162[_0x337b('0x1d')]+_0x347162['limit'];var _0x26add0;if(_0x106eb3>=_0x26d76a){_0x106eb3=_0x26d76a;_0x26add0=0xc8;}else{_0x26add0=0xce;}_0x212031['status'](_0x26add0);return _0x212031['set'](_0x337b('0x21'),_0x12e9dc+'-'+_0x106eb3+'/'+_0x26d76a)[_0x337b('0x1c')](_0x4c4995);}return null;};}function patchUpdates(_0x3e3698){return function(_0x3f9f46){try{jsonpatch[_0x337b('0x22')](_0x3f9f46,_0x3e3698,!![]);}catch(_0x26b0b5){return BPromise[_0x337b('0x23')](_0x26b0b5);}return _0x3f9f46['save']();};}function saveUpdates(_0x349f16,_0x1f8493){return function(_0x105d64){if(_0x105d64){return _0x105d64[_0x337b('0x24')](_0x349f16)[_0x337b('0x25')](function(_0x27e27b){return _0x27e27b;});}return null;};}function removeEntity(_0x4987a0,_0x2850ac){return function(_0x34f605){if(_0x34f605){return _0x34f605[_0x337b('0x26')]()[_0x337b('0x25')](function(){_0x4987a0['status'](0xcc)[_0x337b('0x1b')]();});}};}function handleEntityNotFound(_0xcd3270,_0x1807e9){return function(_0x2b7b19){if(!_0x2b7b19){_0xcd3270['sendStatus'](0x194);}return _0x2b7b19;};}function handleError(_0x38db41,_0x323050){_0x323050=_0x323050||0x1f4;return function(_0x1bc97e){logger['error'](_0x1bc97e['stack']);if(_0x1bc97e['name']){delete _0x1bc97e[_0x337b('0x27')];}_0x38db41[_0x337b('0x1a')](_0x323050)[_0x337b('0x28')](_0x1bc97e);};}exports[_0x337b('0x29')]=function(_0x3564af,_0xbccfd0){var _0x545896={},_0x49db07={},_0x59a960={'count':0x0,'rows':[]};var _0x58f5c9=_[_0x337b('0x2a')](db[_0x337b('0x2b')][_0x337b('0x2c')],function(_0x5dbb12){return{'name':_0x5dbb12['fieldName'],'type':_0x5dbb12['type']['key']};});_0x49db07[_0x337b('0x2d')]=_['map'](_0x58f5c9,_0x337b('0x27'));_0x49db07['query']=_[_0x337b('0x2e')](_0x3564af[_0x337b('0x2f')]);_0x49db07['filters']=_[_0x337b('0x30')](_0x49db07[_0x337b('0x2d')],_0x49db07['query']);_0x545896[_0x337b('0x31')]=_[_0x337b('0x30')](_0x49db07[_0x337b('0x2d')],qs['fields'](_0x3564af[_0x337b('0x2f')][_0x337b('0x32')]));_0x545896[_0x337b('0x31')]=_0x545896[_0x337b('0x31')][_0x337b('0x33')]?_0x545896['attributes']:_0x49db07[_0x337b('0x2d')];if(!_0x3564af[_0x337b('0x2f')][_0x337b('0x34')](_0x337b('0x35'))){_0x545896['limit']=qs[_0x337b('0x1f')](_0x3564af['query']['limit']);_0x545896[_0x337b('0x1d')]=qs[_0x337b('0x1d')](_0x3564af[_0x337b('0x2f')][_0x337b('0x1d')]);}_0x545896[_0x337b('0x36')]=qs[_0x337b('0x37')](_0x3564af[_0x337b('0x2f')][_0x337b('0x37')]);_0x545896[_0x337b('0x38')]=qs[_0x337b('0x39')](_[_0x337b('0x3a')](_0x3564af['query'],_0x49db07[_0x337b('0x39')]),_0x58f5c9);if(_0x3564af[_0x337b('0x2f')][_0x337b('0x3b')]){_0x545896[_0x337b('0x38')]=_[_0x337b('0x3c')](_0x545896[_0x337b('0x38')],{'$or':_[_0x337b('0x2a')](_0x58f5c9,function(_0x122721){if(_0x122721[_0x337b('0x3d')]!==_0x337b('0x3e')){var _0x3f628c={};_0x3f628c[_0x122721[_0x337b('0x27')]]={'$like':'%'+_0x3564af[_0x337b('0x2f')][_0x337b('0x3b')]+'%'};return _0x3f628c;}})});}_0x545896=_[_0x337b('0x3c')]({},_0x545896,_0x3564af['options']);var _0x4fd50d={'where':_0x545896[_0x337b('0x38')]};return db[_0x337b('0x2b')][_0x337b('0x20')](_0x4fd50d)[_0x337b('0x25')](function(_0xaeca4d){_0x59a960[_0x337b('0x20')]=_0xaeca4d;if(_0x3564af['query'][_0x337b('0x3f')]){_0x545896[_0x337b('0x40')]=[{'all':!![]}];}return db[_0x337b('0x2b')][_0x337b('0x41')](_0x545896);})[_0x337b('0x25')](function(_0x2d3dac){_0x59a960[_0x337b('0x42')]=_0x2d3dac;return _0x59a960;})[_0x337b('0x25')](respondWithFilteredResult(_0xbccfd0,_0x545896))[_0x337b('0x43')](handleError(_0xbccfd0,null));};exports[_0x337b('0x44')]=function(_0x8698c4,_0x2395bc){var _0x4cc4ee={'raw':![],'where':{'id':_0x8698c4[_0x337b('0x45')]['id']}},_0x4fd501={};_0x4fd501['model']=_[_0x337b('0x2e')](db[_0x337b('0x2b')][_0x337b('0x2c')]);_0x4fd501[_0x337b('0x2f')]=_['keys'](_0x8698c4[_0x337b('0x2f')]);_0x4fd501[_0x337b('0x39')]=_[_0x337b('0x30')](_0x4fd501[_0x337b('0x2d')],_0x4fd501[_0x337b('0x2f')]);_0x4cc4ee[_0x337b('0x31')]=_[_0x337b('0x30')](_0x4fd501['model'],qs[_0x337b('0x32')](_0x8698c4[_0x337b('0x2f')][_0x337b('0x32')]));_0x4cc4ee['attributes']=_0x4cc4ee['attributes']['length']?_0x4cc4ee['attributes']:_0x4fd501[_0x337b('0x2d')];if(_0x8698c4[_0x337b('0x2f')][_0x337b('0x3f')]){_0x4cc4ee[_0x337b('0x40')]=[{'all':!![]}];}_0x4cc4ee=_[_0x337b('0x3c')]({},_0x4cc4ee,_0x8698c4['options']);return db[_0x337b('0x2b')]['find'](_0x4cc4ee)['then'](handleEntityNotFound(_0x2395bc,null))[_0x337b('0x25')](respondWithResult(_0x2395bc,null))['catch'](handleError(_0x2395bc,null));};exports['create']=function(_0x517f98,_0x329df7){return db['SalesforceAccount']['create'](_0x517f98[_0x337b('0x46')],{})[_0x337b('0x25')](respondWithResult(_0x329df7,0xc9))[_0x337b('0x43')](handleError(_0x329df7,null));};exports[_0x337b('0x24')]=function(_0x12787e,_0x4e66eb){if(_0x12787e['body']['id']){delete _0x12787e[_0x337b('0x46')]['id'];}return db['SalesforceAccount'][_0x337b('0x47')]({'where':{'id':_0x12787e[_0x337b('0x45')]['id']}})[_0x337b('0x25')](handleEntityNotFound(_0x4e66eb,null))[_0x337b('0x25')](saveUpdates(_0x12787e['body'],null))['then'](respondWithResult(_0x4e66eb,null))['catch'](handleError(_0x4e66eb,null));};exports[_0x337b('0x26')]=function(_0x25693c,_0x89091){return db['SalesforceAccount'][_0x337b('0x47')]({'where':{'id':_0x25693c[_0x337b('0x45')]['id']}})[_0x337b('0x25')](handleEntityNotFound(_0x89091,null))[_0x337b('0x25')](removeEntity(_0x89091,null))[_0x337b('0x43')](handleError(_0x89091,null));};exports[_0x337b('0x48')]=function(_0x1e94af,_0x568516,_0x29c260){var _0x2bb233={};var _0xd18b5e={};var _0x32cd0b;var _0x32f84d;return db[_0x337b('0x2b')][_0x337b('0x49')]({'where':{'id':_0x1e94af[_0x337b('0x45')]['id']}})['then'](handleEntityNotFound(_0x568516,null))[_0x337b('0x25')](function(_0x4b5bb6){if(_0x4b5bb6){_0x32cd0b=_0x4b5bb6;_0xd18b5e[_0x337b('0x2d')]=_[_0x337b('0x2e')](db[_0x337b('0x4a')][_0x337b('0x2c')]);_0xd18b5e[_0x337b('0x2f')]=_[_0x337b('0x2e')](_0x1e94af[_0x337b('0x2f')]);_0xd18b5e['filters']=_[_0x337b('0x30')](_0xd18b5e[_0x337b('0x2d')],_0xd18b5e[_0x337b('0x2f')]);_0x2bb233['attributes']=_[_0x337b('0x30')](_0xd18b5e[_0x337b('0x2d')],qs[_0x337b('0x32')](_0x1e94af[_0x337b('0x2f')][_0x337b('0x32')]));_0x2bb233['attributes']=_0x2bb233[_0x337b('0x31')][_0x337b('0x33')]?_0x2bb233[_0x337b('0x31')]:_0xd18b5e[_0x337b('0x2d')];_0x2bb233[_0x337b('0x36')]=qs['sort'](_0x1e94af['query'][_0x337b('0x37')]);_0x2bb233['where']=qs[_0x337b('0x39')](_['pick'](_0x1e94af['query'],_0xd18b5e[_0x337b('0x39')]));if(_0x1e94af[_0x337b('0x2f')][_0x337b('0x3b')]){_0x2bb233[_0x337b('0x38')]=_[_0x337b('0x3c')](_0x2bb233['where'],{'$or':_[_0x337b('0x2a')](_0x2bb233[_0x337b('0x31')],function(_0x21d8bd){var _0x5985d6={};_0x5985d6[_0x21d8bd]={'$like':'%'+_0x1e94af[_0x337b('0x2f')][_0x337b('0x3b')]+'%'};return _0x5985d6;})});}_0x2bb233=_[_0x337b('0x3c')]({},_0x2bb233,_0x1e94af['options']);return _0x32cd0b[_0x337b('0x48')](_0x2bb233);}})['then'](function(_0x249eb8){if(_0x249eb8){_0x32f84d=_0x249eb8[_0x337b('0x33')];if(!_0x1e94af[_0x337b('0x2f')]['hasOwnProperty']('nolimit')){_0x2bb233[_0x337b('0x1f')]=qs[_0x337b('0x1f')](_0x1e94af[_0x337b('0x2f')]['limit']);_0x2bb233[_0x337b('0x1d')]=qs['offset'](_0x1e94af[_0x337b('0x2f')][_0x337b('0x1d')]);}return _0x32cd0b[_0x337b('0x48')](_0x2bb233);}})[_0x337b('0x25')](function(_0x3c7990){if(_0x3c7990){return _0x3c7990?{'count':_0x32f84d,'rows':_0x3c7990}:null;}})['then'](respondWithResult(_0x568516,null))[_0x337b('0x43')](handleError(_0x568516,null));};exports['addConfiguration']=function(_0x4708a2,_0x461025,_0x73d97c){if(_0x4708a2[_0x337b('0x46')]['id']){delete _0x4708a2[_0x337b('0x46')]['id'];}return db[_0x337b('0x2b')][_0x337b('0x49')]({'where':{'id':_0x4708a2[_0x337b('0x45')]['id']}})[_0x337b('0x25')](handleEntityNotFound(_0x461025,null))[_0x337b('0x25')](function(_0x2a7c0b){if(_0x2a7c0b){_0x4708a2['body']['AccountId']=_0x2a7c0b['id'];_0x4708a2[_0x337b('0x46')][_0x337b('0x4b')]=integrations[_0x337b('0x4c')](_0x4708a2['body'][_0x337b('0x4d')],_0x4708a2[_0x337b('0x46')]['type']);_0x4708a2['body'][_0x337b('0x4e')]=integrations['getDescriptions'](_0x4708a2['body']['channel'],_0x4708a2[_0x337b('0x46')][_0x337b('0x3d')]);return db['SalesforceConfiguration'][_0x337b('0x4f')](_0x4708a2['body'],{'include':[{'model':db['SalesforceField'],'as':_0x337b('0x4b')},{'model':db[_0x337b('0x50')],'as':'Descriptions'}]});}return null;})[_0x337b('0x25')](respondWithResult(_0x461025,null))['catch'](handleError(_0x461025,null));};exports['getFields']=function(_0x2fb1ab,_0x4df698,_0x2c8107){var _0x432d43;var _0x8cc6a3='';var _0x2beafc=_0x337b('0x51');return db[_0x337b('0x2b')][_0x337b('0x49')]({'where':{'id':_0x2fb1ab['params']['id']},'attributes':['id','remoteUri',_0x337b('0x52'),_0x337b('0x53'),_0x337b('0x54'),_0x337b('0x55'),_0x337b('0x56')]})[_0x337b('0x25')](handleEntityNotFound(_0x4df698,null))[_0x337b('0x25')](function(_0x4264ae){if(_0x4264ae){_0x8cc6a3=_0x4264ae[_0x337b('0x57')];var _0x434b4a=_0x8cc6a3[_0x337b('0x58')](-0x1);if(_0x434b4a==='/'){_0x8cc6a3=_0x8cc6a3[_0x337b('0x59')](0x0,_0x8cc6a3[_0x337b('0x5a')](_0x434b4a));}_0x432d43=new jsforce['Connection']({'oauth2':{'loginUrl':_0x8cc6a3,'clientId':_0x4264ae[_0x337b('0x52')],'clientSecret':_0x4264ae['clientSecret']}});return _0x432d43[_0x337b('0x5b')](_0x4264ae[_0x337b('0x54')],_0x4264ae[_0x337b('0x55')][_0x337b('0x5c')](_0x4264ae[_0x337b('0x56')]));}})['then'](function(_0xcb9f54){if(_0xcb9f54){if(!_['isNil'](_0x2fb1ab[_0x337b('0x2f')][_0x337b('0x5d')])){_0x2beafc=_0x2fb1ab[_0x337b('0x2f')][_0x337b('0x5d')];}return _0x432d43[_0x337b('0x5e')](_0x2beafc)[_0x337b('0x5f')]();}})[_0x337b('0x25')](function(_0x2f5e14){var _0x5c4a38=['OwnerId',_0x337b('0x60'),_0x337b('0x61'),_0x337b('0x62'),_0x337b('0x63'),_0x337b('0x64')];var _0x3ae74a=['string',_0x337b('0x65'),_0x337b('0x66'),_0x337b('0x67'),_0x337b('0x68'),'textarea',_0x337b('0x69')];if(_0x2f5e14){_['remove'](_0x2f5e14[_0x337b('0x32')],function(_0x3eab2e){return _0x5c4a38['includes'](_0x3eab2e[_0x337b('0x27')])||!_0x3ae74a[_0x337b('0x6a')](_0x3eab2e[_0x337b('0x3d')]);});return{'count':_0x2f5e14[_0x337b('0x32')]['length'],'rows':_['map'](_0x2f5e14[_0x337b('0x32')],function(_0x1e259c){return{'id':_0x1e259c[_0x337b('0x27')],'name':_0x1e259c[_0x337b('0x6b')],'custom':_0x1e259c[_0x337b('0x6c')],'options':_0x1e259c[_0x337b('0x6d')][_0x337b('0x33')]>0x0?_[_0x337b('0x2a')](_0x1e259c[_0x337b('0x6d')],function(_0x41d775){return{'name':_0x41d775[_0x337b('0x6b')],'value':_0x41d775[_0x337b('0x6e')]};}):_0x1e259c[_0x337b('0x3d')]==_0x337b('0x67')?[{'name':_0x337b('0x6f'),'value':'true'},{'name':_0x337b('0x70'),'value':_0x337b('0x71')}]:[]};})};}})['then'](respondWithResult(_0x4df698,null))[_0x337b('0x43')](function(_0x125575){var _0x31d20f=_0x2fb1ab['query']['test']?0x1f4:_0x125575[_0x337b('0x72')]||0x1f4;logger['error'](_0x337b('0x73'),_0x337b('0x74'),_0x31d20f,JSON[_0x337b('0x75')](_0x125575));delete _0x125575['name'];if(_0x31d20f===0x191){_0x31d20f=0x190;}_0x4df698[_0x337b('0x1a')](_0x31d20f)[_0x337b('0x28')](_0x2fb1ab[_0x337b('0x2f')]['test']?{'message':_0x337b('0x76'),'statusCode':_0x125575[_0x337b('0x72')]}:_0x125575);});}; \ No newline at end of file +var _0x5616=['count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','map','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','SalesforceAccount','include','findAll','rows','catch','show','params','keys','includeAll','create','body','find','getConfigurations','SalesforceConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','SalesforceField','getFields','findOne','remoteUri','clientId','clientSecret','password','securityToken','slice','substring','Connection','concat','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','string','int','picklist','textarea','phone','includes','custom','picklistValues','label','value','boolean','true','False','false','statusCode','getFields,\x20%s,\x20%s,\x20%s','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit'];(function(_0x7cdf38,_0xa78eaa){var _0x21f864=function(_0x3a2d51){while(--_0x3a2d51){_0x7cdf38['push'](_0x7cdf38['shift']());}};_0x21f864(++_0xa78eaa);}(_0x5616,0x156));var _0x6561=function(_0x4910e0,_0x5c5dc9){_0x4910e0=_0x4910e0-0x0;var _0x51938a=_0x5616[_0x4910e0];return _0x51938a;};'use strict';var emlformat=require(_0x6561('0x0'));var rimraf=require(_0x6561('0x1'));var zipdir=require(_0x6561('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6561('0x3'));var moment=require('moment');var BPromise=require(_0x6561('0x4'));var Mustache=require('mustache');var util=require(_0x6561('0x5'));var path=require(_0x6561('0x6'));var sox=require('sox');var csv=require(_0x6561('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6561('0x8'));var _=require(_0x6561('0x9'));var squel=require(_0x6561('0xa'));var crypto=require(_0x6561('0xb'));var jsforce=require(_0x6561('0xc'));var deskjs=require(_0x6561('0xd'));var toCsv=require(_0x6561('0x7'));var querystring=require(_0x6561('0xe'));var Papa=require(_0x6561('0xf'));var Redis=require(_0x6561('0x10'));var authService=require(_0x6561('0x11'));var qs=require(_0x6561('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6561('0x13'))(_0x6561('0x14'));var utils=require(_0x6561('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x6561('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0x6561('0x17'));function respondWithStatusCode(_0x58001c,_0x4c1429){_0x4c1429=_0x4c1429||0xcc;return function(_0x4283cd){if(_0x4283cd){return _0x58001c[_0x6561('0x18')](_0x4c1429);}return _0x58001c[_0x6561('0x19')](_0x4c1429)['end']();};}function respondWithResult(_0x5f477f,_0x16ec38){_0x16ec38=_0x16ec38||0xc8;return function(_0x40e285){if(_0x40e285){return _0x5f477f[_0x6561('0x19')](_0x16ec38)[_0x6561('0x1a')](_0x40e285);}};}function respondWithFilteredResult(_0x4a977b,_0x2de52e){return function(_0x39e6dd){if(_0x39e6dd){var _0x58ca18=typeof _0x2de52e[_0x6561('0x1b')]===_0x6561('0x1c')&&typeof _0x2de52e[_0x6561('0x1d')]===_0x6561('0x1c');var _0x59fa50=_0x39e6dd[_0x6561('0x1e')];var _0x1a3f62=_0x58ca18?0x0:_0x2de52e[_0x6561('0x1b')];var _0x3236f1=_0x58ca18?_0x39e6dd['count']:_0x2de52e[_0x6561('0x1b')]+_0x2de52e[_0x6561('0x1d')];var _0x188f5f;if(_0x3236f1>=_0x59fa50){_0x3236f1=_0x59fa50;_0x188f5f=0xc8;}else{_0x188f5f=0xce;}_0x4a977b['status'](_0x188f5f);return _0x4a977b[_0x6561('0x1f')](_0x6561('0x20'),_0x1a3f62+'-'+_0x3236f1+'/'+_0x59fa50)['json'](_0x39e6dd);}return null;};}function patchUpdates(_0x1931b7){return function(_0x3494a8){try{jsonpatch[_0x6561('0x21')](_0x3494a8,_0x1931b7,!![]);}catch(_0x34bbfc){return BPromise[_0x6561('0x22')](_0x34bbfc);}return _0x3494a8[_0x6561('0x23')]();};}function saveUpdates(_0x15ca6d,_0x2acdad){return function(_0x1e2299){if(_0x1e2299){return _0x1e2299[_0x6561('0x24')](_0x15ca6d)[_0x6561('0x25')](function(_0x43e0ef){return _0x43e0ef;});}return null;};}function removeEntity(_0x4a0bd9,_0x209b98){return function(_0x285779){if(_0x285779){return _0x285779[_0x6561('0x26')]()['then'](function(){_0x4a0bd9[_0x6561('0x19')](0xcc)[_0x6561('0x27')]();});}};}function handleEntityNotFound(_0x196925,_0x4f3b7a){return function(_0x125f5d){if(!_0x125f5d){_0x196925[_0x6561('0x18')](0x194);}return _0x125f5d;};}function handleError(_0x10a994,_0x24dd2c){_0x24dd2c=_0x24dd2c||0x1f4;return function(_0x41b510){logger[_0x6561('0x28')](_0x41b510[_0x6561('0x29')]);if(_0x41b510[_0x6561('0x2a')]){delete _0x41b510[_0x6561('0x2a')];}_0x10a994[_0x6561('0x19')](_0x24dd2c)[_0x6561('0x2b')](_0x41b510);};}exports['index']=function(_0x15f56d,_0x474637){var _0x1d9647={},_0x3b4daf={},_0x43b94a={'count':0x0,'rows':[]};var _0x3e112e=_[_0x6561('0x2c')](db['SalesforceAccount'][_0x6561('0x2d')],function(_0x500a9c){return{'name':_0x500a9c['fieldName'],'type':_0x500a9c['type'][_0x6561('0x2e')]};});_0x3b4daf[_0x6561('0x2f')]=_['map'](_0x3e112e,_0x6561('0x2a'));_0x3b4daf[_0x6561('0x30')]=_['keys'](_0x15f56d[_0x6561('0x30')]);_0x3b4daf[_0x6561('0x31')]=_[_0x6561('0x32')](_0x3b4daf['model'],_0x3b4daf[_0x6561('0x30')]);_0x1d9647[_0x6561('0x33')]=_[_0x6561('0x32')](_0x3b4daf[_0x6561('0x2f')],qs[_0x6561('0x34')](_0x15f56d['query'][_0x6561('0x34')]));_0x1d9647[_0x6561('0x33')]=_0x1d9647[_0x6561('0x33')][_0x6561('0x35')]?_0x1d9647[_0x6561('0x33')]:_0x3b4daf['model'];if(!_0x15f56d[_0x6561('0x30')][_0x6561('0x36')](_0x6561('0x37'))){_0x1d9647[_0x6561('0x1d')]=qs[_0x6561('0x1d')](_0x15f56d[_0x6561('0x30')][_0x6561('0x1d')]);_0x1d9647[_0x6561('0x1b')]=qs[_0x6561('0x1b')](_0x15f56d[_0x6561('0x30')][_0x6561('0x1b')]);}_0x1d9647[_0x6561('0x38')]=qs[_0x6561('0x39')](_0x15f56d[_0x6561('0x30')][_0x6561('0x39')]);_0x1d9647['where']=qs[_0x6561('0x31')](_[_0x6561('0x3a')](_0x15f56d[_0x6561('0x30')],_0x3b4daf[_0x6561('0x31')]),_0x3e112e);if(_0x15f56d[_0x6561('0x30')][_0x6561('0x3b')]){_0x1d9647[_0x6561('0x3c')]=_[_0x6561('0x3d')](_0x1d9647[_0x6561('0x3c')],{'$or':_['map'](_0x3e112e,function(_0x766377){if(_0x766377[_0x6561('0x3e')]!==_0x6561('0x3f')){var _0x3ab59c={};_0x3ab59c[_0x766377['name']]={'$like':'%'+_0x15f56d[_0x6561('0x30')][_0x6561('0x3b')]+'%'};return _0x3ab59c;}})});}_0x1d9647=_[_0x6561('0x3d')]({},_0x1d9647,_0x15f56d[_0x6561('0x40')]);var _0x2e388f={'where':_0x1d9647[_0x6561('0x3c')]};return db[_0x6561('0x41')][_0x6561('0x1e')](_0x2e388f)[_0x6561('0x25')](function(_0x228a62){_0x43b94a[_0x6561('0x1e')]=_0x228a62;if(_0x15f56d[_0x6561('0x30')]['includeAll']){_0x1d9647[_0x6561('0x42')]=[{'all':!![]}];}return db[_0x6561('0x41')][_0x6561('0x43')](_0x1d9647);})[_0x6561('0x25')](function(_0x3ad05a){_0x43b94a[_0x6561('0x44')]=_0x3ad05a;return _0x43b94a;})[_0x6561('0x25')](respondWithFilteredResult(_0x474637,_0x1d9647))[_0x6561('0x45')](handleError(_0x474637,null));};exports[_0x6561('0x46')]=function(_0x2a76d6,_0x3be9be){var _0x5e5b29={'raw':![],'where':{'id':_0x2a76d6[_0x6561('0x47')]['id']}},_0x38fa72={};_0x38fa72[_0x6561('0x2f')]=_[_0x6561('0x48')](db[_0x6561('0x41')][_0x6561('0x2d')]);_0x38fa72['query']=_[_0x6561('0x48')](_0x2a76d6['query']);_0x38fa72['filters']=_[_0x6561('0x32')](_0x38fa72[_0x6561('0x2f')],_0x38fa72[_0x6561('0x30')]);_0x5e5b29[_0x6561('0x33')]=_[_0x6561('0x32')](_0x38fa72['model'],qs[_0x6561('0x34')](_0x2a76d6[_0x6561('0x30')][_0x6561('0x34')]));_0x5e5b29[_0x6561('0x33')]=_0x5e5b29[_0x6561('0x33')][_0x6561('0x35')]?_0x5e5b29[_0x6561('0x33')]:_0x38fa72['model'];if(_0x2a76d6[_0x6561('0x30')][_0x6561('0x49')]){_0x5e5b29[_0x6561('0x42')]=[{'all':!![]}];}_0x5e5b29=_[_0x6561('0x3d')]({},_0x5e5b29,_0x2a76d6[_0x6561('0x40')]);return db[_0x6561('0x41')]['find'](_0x5e5b29)[_0x6561('0x25')](handleEntityNotFound(_0x3be9be,null))[_0x6561('0x25')](respondWithResult(_0x3be9be,null))[_0x6561('0x45')](handleError(_0x3be9be,null));};exports[_0x6561('0x4a')]=function(_0xf4e0db,_0x3da0f1){return db['SalesforceAccount']['create'](_0xf4e0db[_0x6561('0x4b')],{})[_0x6561('0x25')](respondWithResult(_0x3da0f1,0xc9))[_0x6561('0x45')](handleError(_0x3da0f1,null));};exports['update']=function(_0x2bc09f,_0x38f069){if(_0x2bc09f[_0x6561('0x4b')]['id']){delete _0x2bc09f[_0x6561('0x4b')]['id'];}return db[_0x6561('0x41')][_0x6561('0x4c')]({'where':{'id':_0x2bc09f[_0x6561('0x47')]['id']}})[_0x6561('0x25')](handleEntityNotFound(_0x38f069,null))[_0x6561('0x25')](saveUpdates(_0x2bc09f[_0x6561('0x4b')],null))[_0x6561('0x25')](respondWithResult(_0x38f069,null))[_0x6561('0x45')](handleError(_0x38f069,null));};exports[_0x6561('0x26')]=function(_0x51bcac,_0x5ae3b2){return db[_0x6561('0x41')][_0x6561('0x4c')]({'where':{'id':_0x51bcac[_0x6561('0x47')]['id']}})['then'](handleEntityNotFound(_0x5ae3b2,null))[_0x6561('0x25')](removeEntity(_0x5ae3b2,null))[_0x6561('0x45')](handleError(_0x5ae3b2,null));};exports[_0x6561('0x4d')]=function(_0x4f2ca7,_0x507d69,_0xf09bf){var _0x945d49={};var _0xd6e67e={};var _0x5a2916;var _0x5cfd0c;return db[_0x6561('0x41')]['findOne']({'where':{'id':_0x4f2ca7[_0x6561('0x47')]['id']}})[_0x6561('0x25')](handleEntityNotFound(_0x507d69,null))['then'](function(_0x45f7a5){if(_0x45f7a5){_0x5a2916=_0x45f7a5;_0xd6e67e['model']=_[_0x6561('0x48')](db[_0x6561('0x4e')]['rawAttributes']);_0xd6e67e[_0x6561('0x30')]=_['keys'](_0x4f2ca7[_0x6561('0x30')]);_0xd6e67e[_0x6561('0x31')]=_['intersection'](_0xd6e67e[_0x6561('0x2f')],_0xd6e67e[_0x6561('0x30')]);_0x945d49[_0x6561('0x33')]=_['intersection'](_0xd6e67e[_0x6561('0x2f')],qs['fields'](_0x4f2ca7['query']['fields']));_0x945d49[_0x6561('0x33')]=_0x945d49[_0x6561('0x33')][_0x6561('0x35')]?_0x945d49[_0x6561('0x33')]:_0xd6e67e[_0x6561('0x2f')];_0x945d49[_0x6561('0x38')]=qs[_0x6561('0x39')](_0x4f2ca7[_0x6561('0x30')]['sort']);_0x945d49['where']=qs[_0x6561('0x31')](_['pick'](_0x4f2ca7[_0x6561('0x30')],_0xd6e67e[_0x6561('0x31')]));if(_0x4f2ca7['query'][_0x6561('0x3b')]){_0x945d49[_0x6561('0x3c')]=_[_0x6561('0x3d')](_0x945d49['where'],{'$or':_[_0x6561('0x2c')](_0x945d49[_0x6561('0x33')],function(_0x35dd84){var _0x37efcc={};_0x37efcc[_0x35dd84]={'$like':'%'+_0x4f2ca7['query'][_0x6561('0x3b')]+'%'};return _0x37efcc;})});}_0x945d49=_[_0x6561('0x3d')]({},_0x945d49,_0x4f2ca7[_0x6561('0x40')]);return _0x5a2916['getConfigurations'](_0x945d49);}})[_0x6561('0x25')](function(_0x2b192d){if(_0x2b192d){_0x5cfd0c=_0x2b192d['length'];if(!_0x4f2ca7['query'][_0x6561('0x36')](_0x6561('0x37'))){_0x945d49['limit']=qs[_0x6561('0x1d')](_0x4f2ca7[_0x6561('0x30')][_0x6561('0x1d')]);_0x945d49[_0x6561('0x1b')]=qs[_0x6561('0x1b')](_0x4f2ca7[_0x6561('0x30')][_0x6561('0x1b')]);}return _0x5a2916[_0x6561('0x4d')](_0x945d49);}})['then'](function(_0x4ca0f4){if(_0x4ca0f4){return _0x4ca0f4?{'count':_0x5cfd0c,'rows':_0x4ca0f4}:null;}})[_0x6561('0x25')](respondWithResult(_0x507d69,null))['catch'](handleError(_0x507d69,null));};exports['addConfiguration']=function(_0x23dccc,_0x2f1f16,_0x23e696){if(_0x23dccc[_0x6561('0x4b')]['id']){delete _0x23dccc[_0x6561('0x4b')]['id'];}return db[_0x6561('0x41')]['findOne']({'where':{'id':_0x23dccc[_0x6561('0x47')]['id']}})[_0x6561('0x25')](handleEntityNotFound(_0x2f1f16,null))[_0x6561('0x25')](function(_0xd2942d){if(_0xd2942d){_0x23dccc[_0x6561('0x4b')][_0x6561('0x4f')]=_0xd2942d['id'];_0x23dccc[_0x6561('0x4b')][_0x6561('0x50')]=integrations[_0x6561('0x51')](_0x23dccc['body'][_0x6561('0x52')],_0x23dccc[_0x6561('0x4b')][_0x6561('0x3e')]);_0x23dccc[_0x6561('0x4b')][_0x6561('0x53')]=integrations['getDescriptions'](_0x23dccc['body']['channel'],_0x23dccc[_0x6561('0x4b')][_0x6561('0x3e')]);return db['SalesforceConfiguration']['create'](_0x23dccc[_0x6561('0x4b')],{'include':[{'model':db[_0x6561('0x54')],'as':_0x6561('0x50')},{'model':db[_0x6561('0x54')],'as':_0x6561('0x53')}]});}return null;})[_0x6561('0x25')](respondWithResult(_0x2f1f16,null))[_0x6561('0x45')](handleError(_0x2f1f16,null));};exports[_0x6561('0x55')]=function(_0x89afe,_0x402110,_0x235a91){var _0xb42d41;var _0x15e224='';var _0x303c2f='Task';return db['SalesforceAccount'][_0x6561('0x56')]({'where':{'id':_0x89afe[_0x6561('0x47')]['id']},'attributes':['id',_0x6561('0x57'),_0x6561('0x58'),_0x6561('0x59'),'username',_0x6561('0x5a'),_0x6561('0x5b')]})[_0x6561('0x25')](handleEntityNotFound(_0x402110,null))['then'](function(_0x16ee01){if(_0x16ee01){_0x15e224=_0x16ee01[_0x6561('0x57')];var _0x2881ac=_0x15e224[_0x6561('0x5c')](-0x1);if(_0x2881ac==='/'){_0x15e224=_0x15e224[_0x6561('0x5d')](0x0,_0x15e224['lastIndexOf'](_0x2881ac));}_0xb42d41=new jsforce[(_0x6561('0x5e'))]({'oauth2':{'loginUrl':_0x15e224,'clientId':_0x16ee01[_0x6561('0x58')],'clientSecret':_0x16ee01[_0x6561('0x59')]}});return _0xb42d41['login'](_0x16ee01['username'],_0x16ee01[_0x6561('0x5a')][_0x6561('0x5f')](_0x16ee01[_0x6561('0x5b')]));}})['then'](function(_0xf06294){if(_0xf06294){if(!_[_0x6561('0x60')](_0x89afe[_0x6561('0x30')][_0x6561('0x61')])){_0x303c2f=_0x89afe[_0x6561('0x30')][_0x6561('0x61')];}return _0xb42d41[_0x6561('0x62')](_0x303c2f)[_0x6561('0x63')]();}})['then'](function(_0x3ad83c){var _0x574b8a=[_0x6561('0x64'),_0x6561('0x65'),_0x6561('0x66'),_0x6561('0x67'),_0x6561('0x68'),_0x6561('0x69')];var _0x1e9ea3=[_0x6561('0x6a'),_0x6561('0x6b'),_0x6561('0x6c'),'boolean','email',_0x6561('0x6d'),_0x6561('0x6e')];if(_0x3ad83c){_['remove'](_0x3ad83c['fields'],function(_0x31616b){return _0x574b8a[_0x6561('0x6f')](_0x31616b['name'])||!_0x1e9ea3[_0x6561('0x6f')](_0x31616b[_0x6561('0x3e')]);});return{'count':_0x3ad83c['fields']['length'],'rows':_['map'](_0x3ad83c[_0x6561('0x34')],function(_0x186d03){return{'id':_0x186d03[_0x6561('0x2a')],'name':_0x186d03['label'],'custom':_0x186d03[_0x6561('0x70')],'options':_0x186d03[_0x6561('0x71')][_0x6561('0x35')]>0x0?_['map'](_0x186d03[_0x6561('0x71')],function(_0x2262ed){return{'name':_0x2262ed[_0x6561('0x72')],'value':_0x2262ed[_0x6561('0x73')]};}):_0x186d03[_0x6561('0x3e')]==_0x6561('0x74')?[{'name':'True','value':_0x6561('0x75')},{'name':_0x6561('0x76'),'value':_0x6561('0x77')}]:[]};})};}})[_0x6561('0x25')](respondWithResult(_0x402110,null))[_0x6561('0x45')](function(_0x4f2ad0){var _0xbd8413=_0x89afe[_0x6561('0x30')]['test']?0x1f4:_0x4f2ad0[_0x6561('0x78')]||0x1f4;logger[_0x6561('0x28')](_0x6561('0x79'),'getFields',_0xbd8413,JSON['stringify'](_0x4f2ad0));delete _0x4f2ad0[_0x6561('0x2a')];if(_0xbd8413===0x191){_0xbd8413=0x190;}_0x402110[_0x6561('0x19')](_0xbd8413)[_0x6561('0x2b')](_0x89afe[_0x6561('0x30')][_0x6561('0x7a')]?{'message':_0x6561('0x7b'),'statusCode':_0x4f2ad0[_0x6561('0x78')]}:_0x4f2ad0);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index b287554..b822fb9 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 _0x64ea=['../../config/logger','api','moment','request-promise','../../config/environment','exports','int_salesforce_accounts','lodash','util'];(function(_0x11c8f9,_0x28cae4){var _0x351246=function(_0xf4f31a){while(--_0xf4f31a){_0x11c8f9['push'](_0x11c8f9['shift']());}};_0x351246(++_0x28cae4);}(_0x64ea,0x127));var _0xa64e=function(_0x434db2,_0x113541){_0x434db2=_0x434db2-0x0;var _0x4e9284=_0x64ea[_0x434db2];return _0x4e9284;};'use strict';var _=require(_0xa64e('0x0'));var util=require(_0xa64e('0x1'));var logger=require(_0xa64e('0x2'))(_0xa64e('0x3'));var moment=require(_0xa64e('0x4'));var BPromise=require('bluebird');var rp=require(_0xa64e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa64e('0x6'));var attributes=require('./intSalesforceAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0xa64e('0x7')]=function(_0x454c32,_0xd64c6f){return _0x454c32['define']('SalesforceAccount',attributes,{'tableName':_0xa64e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5ce6=['api','moment','bluebird','request-promise','path','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','util','../../config/logger'];(function(_0x1529a3,_0x529f63){var _0x1a0d4b=function(_0x6f1058){while(--_0x6f1058){_0x1529a3['push'](_0x1529a3['shift']());}};_0x1a0d4b(++_0x529f63);}(_0x5ce6,0xee));var _0x65ce=function(_0x29a009,_0x3655e7){_0x29a009=_0x29a009-0x0;var _0x37ae51=_0x5ce6[_0x29a009];return _0x37ae51;};'use strict';var _=require('lodash');var util=require(_0x65ce('0x0'));var logger=require(_0x65ce('0x1'))(_0x65ce('0x2'));var moment=require(_0x65ce('0x3'));var BPromise=require(_0x65ce('0x4'));var rp=require(_0x65ce('0x5'));var fs=require('fs');var path=require(_0x65ce('0x6'));var rimraf=require('rimraf');var config=require(_0x65ce('0x7'));var attributes=require(_0x65ce('0x8'));var integrations=require(_0x65ce('0x9'));module[_0x65ce('0xa')]=function(_0x53afee,_0x1a6018){return _0x53afee[_0x65ce('0xb')]('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 972e3d3..a964fb1 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 _0x646e=['then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetSalesforceAccount','findAll','options','raw','where','limit','include','map','model','attributes','stringify','ShowSalesforceAccount','SalesforceAccount','find','util','moment','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x53a066,_0x5eca99){var _0x16e6b6=function(_0x40944e){while(--_0x40944e){_0x53a066['push'](_0x53a066['shift']());}};_0x16e6b6(++_0x5eca99);}(_0x646e,0xc2));var _0xe646=function(_0x3d9497,_0x3adb0d){_0x3d9497=_0x3d9497-0x0;var _0xb5ac83=_0x646e[_0x3d9497];return _0xb5ac83;};'use strict';var _=require('lodash');var util=require(_0xe646('0x0'));var moment=require(_0xe646('0x1'));var BPromise=require('bluebird');var rs=require(_0xe646('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe646('0x3'));var logger=require('../../config/logger')(_0xe646('0x4'));var config=require(_0xe646('0x5'));var jayson=require(_0xe646('0x6'));var client=jayson[_0xe646('0x7')][_0xe646('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5d981f,_0x41ca08,_0x45a12a){return new BPromise(function(_0xbf528a,_0x4472b9){return client[_0xe646('0x9')](_0x5d981f,_0x45a12a)[_0xe646('0xa')](function(_0x2d472c){logger[_0xe646('0xb')](_0xe646('0xc'),_0x41ca08,_0xe646('0xd'));logger[_0xe646('0xe')](_0xe646('0xf'),_0x41ca08,_0xe646('0xd'),JSON['stringify'](_0x2d472c));if(_0x2d472c[_0xe646('0x10')]){if(_0x2d472c[_0xe646('0x10')]['code']===0x1f4){logger['error'](_0xe646('0xc'),_0x41ca08,_0x2d472c[_0xe646('0x10')][_0xe646('0x11')]);return _0x4472b9(_0x2d472c[_0xe646('0x10')][_0xe646('0x11')]);}logger[_0xe646('0x10')](_0xe646('0xc'),_0x41ca08,_0x2d472c['error']['message']);return _0xbf528a(_0x2d472c[_0xe646('0x10')]['message']);}else{logger[_0xe646('0xb')]('SalesforceAccount,\x20%s,\x20%s',_0x41ca08,_0xe646('0xd'));_0xbf528a(_0x2d472c[_0xe646('0x12')][_0xe646('0x11')]);}})[_0xe646('0x13')](function(_0x838807){logger[_0xe646('0x10')](_0xe646('0xc'),_0x41ca08,_0x838807);_0x4472b9(_0x838807);});});}exports[_0xe646('0x14')]=function(_0x4394ea){var _0x4589f7=this;return new Promise(function(_0x119bdd,_0x453da7){return db['SalesforceAccount'][_0xe646('0x15')]({'raw':_0x4394ea[_0xe646('0x16')]?_0x4394ea[_0xe646('0x16')][_0xe646('0x17')]===undefined?!![]:![]:!![],'where':_0x4394ea['options']?_0x4394ea[_0xe646('0x16')][_0xe646('0x18')]||null:null,'attributes':_0x4394ea[_0xe646('0x16')]?_0x4394ea['options']['attributes']||null:null,'limit':_0x4394ea['options']?_0x4394ea[_0xe646('0x16')][_0xe646('0x19')]||null:null,'include':_0x4394ea['options']?_0x4394ea[_0xe646('0x16')][_0xe646('0x1a')]?_[_0xe646('0x1b')](_0x4394ea[_0xe646('0x16')][_0xe646('0x1a')],function(_0x51dee7){return{'model':db[_0x51dee7[_0xe646('0x1c')]],'as':_0x51dee7['as'],'attributes':_0x51dee7[_0xe646('0x1d')],'include':_0x51dee7['include']?_['map'](_0x51dee7['include'],function(_0x7ed25b){return{'model':db[_0x7ed25b[_0xe646('0x1c')]],'as':_0x7ed25b['as'],'attributes':_0x7ed25b[_0xe646('0x1d')],'include':_0x7ed25b[_0xe646('0x1a')]?_['map'](_0x7ed25b[_0xe646('0x1a')],function(_0x5a5060){return{'model':db[_0x5a5060[_0xe646('0x1c')]],'as':_0x5a5060['as'],'attributes':_0x5a5060['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x23baff){logger['info'](_0xe646('0x14'),_0x4394ea);logger[_0xe646('0xe')](_0xe646('0x14'),_0x4394ea,JSON[_0xe646('0x1e')](_0x23baff));_0x119bdd(_0x23baff);})[_0xe646('0x13')](function(_0x3f6c28){logger[_0xe646('0x10')](_0xe646('0x14'),_0x3f6c28[_0xe646('0x11')],_0x4394ea);_0x453da7(_0x4589f7[_0xe646('0x10')](0x1f4,_0x3f6c28[_0xe646('0x11')]));});});};exports[_0xe646('0x1f')]=function(_0x119fb6){var _0x351ac7=this;return new Promise(function(_0x168908,_0x49e4c5){return db[_0xe646('0x20')][_0xe646('0x21')]({'raw':_0x119fb6['options']?_0x119fb6[_0xe646('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x119fb6[_0xe646('0x16')]?_0x119fb6[_0xe646('0x16')][_0xe646('0x18')]||null:null,'attributes':_0x119fb6[_0xe646('0x16')]?_0x119fb6[_0xe646('0x16')][_0xe646('0x1d')]||null:null,'include':_0x119fb6[_0xe646('0x16')]?_0x119fb6['options'][_0xe646('0x1a')]?_['map'](_0x119fb6['options'][_0xe646('0x1a')],function(_0x245aaf){return{'model':db[_0x245aaf[_0xe646('0x1c')]],'as':_0x245aaf['as'],'attributes':_0x245aaf[_0xe646('0x1d')],'include':_0x245aaf['include']?_[_0xe646('0x1b')](_0x245aaf[_0xe646('0x1a')],function(_0x41a3e1){return{'model':db[_0x41a3e1[_0xe646('0x1c')]],'as':_0x41a3e1['as'],'attributes':_0x41a3e1['attributes'],'include':_0x41a3e1[_0xe646('0x1a')]?_[_0xe646('0x1b')](_0x41a3e1['include'],function(_0x2ca15e){return{'model':db[_0x2ca15e[_0xe646('0x1c')]],'as':_0x2ca15e['as'],'attributes':_0x2ca15e[_0xe646('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xe646('0xa')](function(_0x3d53f9){logger[_0xe646('0xb')]('ShowSalesforceAccount',_0x119fb6);logger[_0xe646('0xe')](_0xe646('0x1f'),_0x119fb6,JSON['stringify'](_0x3d53f9));_0x168908(_0x3d53f9);})[_0xe646('0x13')](function(_0x2ff06e){logger[_0xe646('0x10')](_0xe646('0x1f'),_0x2ff06e['message'],_0x119fb6);_0x49e4c5(_0x351ac7[_0xe646('0x10')](0x1f4,_0x2ff06e['message']));});});}; \ No newline at end of file +var _0xec2f=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetSalesforceAccount','options','attributes','limit','include','model','map','debug','ShowSalesforceAccount','SalesforceAccount','raw','where','lodash','moment','bluebird','randomstring'];(function(_0x6fbccf,_0x13be0e){var _0x4d7cd1=function(_0x57a66c){while(--_0x57a66c){_0x6fbccf['push'](_0x6fbccf['shift']());}};_0x4d7cd1(++_0x13be0e);}(_0xec2f,0x11c));var _0xfec2=function(_0x147331,_0x3c2a32){_0x147331=_0x147331-0x0;var _0x5524fb=_0xec2f[_0x147331];return _0x5524fb;};'use strict';var _=require(_0xfec2('0x0'));var util=require('util');var moment=require(_0xfec2('0x1'));var BPromise=require(_0xfec2('0x2'));var rs=require(_0xfec2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfec2('0x4'))['db'];var utils=require(_0xfec2('0x5'));var logger=require(_0xfec2('0x6'))(_0xfec2('0x7'));var config=require('../../config/environment');var jayson=require(_0xfec2('0x8'));var client=jayson[_0xfec2('0x9')][_0xfec2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2e27a4,_0xc38c4,_0x38a796){return new BPromise(function(_0x519f1c,_0x556a17){return client['request'](_0x2e27a4,_0x38a796)[_0xfec2('0xb')](function(_0x10b852){logger[_0xfec2('0xc')](_0xfec2('0xd'),_0xc38c4,_0xfec2('0xe'));logger['debug'](_0xfec2('0xf'),_0xc38c4,_0xfec2('0xe'),JSON[_0xfec2('0x10')](_0x10b852));if(_0x10b852['error']){if(_0x10b852[_0xfec2('0x11')]['code']===0x1f4){logger[_0xfec2('0x11')]('SalesforceAccount,\x20%s,\x20%s',_0xc38c4,_0x10b852[_0xfec2('0x11')][_0xfec2('0x12')]);return _0x556a17(_0x10b852['error']['message']);}logger['error'](_0xfec2('0xd'),_0xc38c4,_0x10b852[_0xfec2('0x11')]['message']);return _0x519f1c(_0x10b852[_0xfec2('0x11')]['message']);}else{logger[_0xfec2('0xc')]('SalesforceAccount,\x20%s,\x20%s',_0xc38c4,'request\x20sent');_0x519f1c(_0x10b852['result'][_0xfec2('0x12')]);}})[_0xfec2('0x13')](function(_0x565d5d){logger[_0xfec2('0x11')](_0xfec2('0xd'),_0xc38c4,_0x565d5d);_0x556a17(_0x565d5d);});});}exports[_0xfec2('0x14')]=function(_0x389507){var _0x430aa0=this;return new Promise(function(_0x16771b,_0x2984e7){return db['SalesforceAccount']['findAll']({'raw':_0x389507[_0xfec2('0x15')]?_0x389507[_0xfec2('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x389507['options']?_0x389507[_0xfec2('0x15')]['where']||null:null,'attributes':_0x389507['options']?_0x389507[_0xfec2('0x15')][_0xfec2('0x16')]||null:null,'limit':_0x389507['options']?_0x389507[_0xfec2('0x15')][_0xfec2('0x17')]||null:null,'include':_0x389507[_0xfec2('0x15')]?_0x389507[_0xfec2('0x15')][_0xfec2('0x18')]?_['map'](_0x389507[_0xfec2('0x15')][_0xfec2('0x18')],function(_0x37a752){return{'model':db[_0x37a752[_0xfec2('0x19')]],'as':_0x37a752['as'],'attributes':_0x37a752[_0xfec2('0x16')],'include':_0x37a752['include']?_[_0xfec2('0x1a')](_0x37a752['include'],function(_0x2e3b13){return{'model':db[_0x2e3b13['model']],'as':_0x2e3b13['as'],'attributes':_0x2e3b13[_0xfec2('0x16')],'include':_0x2e3b13[_0xfec2('0x18')]?_[_0xfec2('0x1a')](_0x2e3b13[_0xfec2('0x18')],function(_0x1340d5){return{'model':db[_0x1340d5[_0xfec2('0x19')]],'as':_0x1340d5['as'],'attributes':_0x1340d5[_0xfec2('0x16')]};}):[]};}):[]};}):[]:[]})[_0xfec2('0xb')](function(_0x2a5ecc){logger[_0xfec2('0xc')](_0xfec2('0x14'),_0x389507);logger[_0xfec2('0x1b')](_0xfec2('0x14'),_0x389507,JSON[_0xfec2('0x10')](_0x2a5ecc));_0x16771b(_0x2a5ecc);})[_0xfec2('0x13')](function(_0x3c1776){logger[_0xfec2('0x11')](_0xfec2('0x14'),_0x3c1776[_0xfec2('0x12')],_0x389507);_0x2984e7(_0x430aa0[_0xfec2('0x11')](0x1f4,_0x3c1776[_0xfec2('0x12')]));});});};exports[_0xfec2('0x1c')]=function(_0x3e32a0){var _0x5e3555=this;return new Promise(function(_0x573b17,_0x3637b6){return db[_0xfec2('0x1d')]['find']({'raw':_0x3e32a0[_0xfec2('0x15')]?_0x3e32a0[_0xfec2('0x15')][_0xfec2('0x1e')]===undefined?!![]:![]:!![],'where':_0x3e32a0[_0xfec2('0x15')]?_0x3e32a0[_0xfec2('0x15')][_0xfec2('0x1f')]||null:null,'attributes':_0x3e32a0['options']?_0x3e32a0[_0xfec2('0x15')][_0xfec2('0x16')]||null:null,'include':_0x3e32a0[_0xfec2('0x15')]?_0x3e32a0[_0xfec2('0x15')][_0xfec2('0x18')]?_['map'](_0x3e32a0['options'][_0xfec2('0x18')],function(_0x3abb01){return{'model':db[_0x3abb01[_0xfec2('0x19')]],'as':_0x3abb01['as'],'attributes':_0x3abb01['attributes'],'include':_0x3abb01[_0xfec2('0x18')]?_[_0xfec2('0x1a')](_0x3abb01[_0xfec2('0x18')],function(_0x2b430f){return{'model':db[_0x2b430f['model']],'as':_0x2b430f['as'],'attributes':_0x2b430f[_0xfec2('0x16')],'include':_0x2b430f[_0xfec2('0x18')]?_['map'](_0x2b430f[_0xfec2('0x18')],function(_0x4a728a){return{'model':db[_0x4a728a['model']],'as':_0x4a728a['as'],'attributes':_0x4a728a['attributes']};}):[]};}):[]};}):[]:[]})[_0xfec2('0xb')](function(_0x586a73){logger[_0xfec2('0xc')](_0xfec2('0x1c'),_0x3e32a0);logger[_0xfec2('0x1b')]('ShowSalesforceAccount',_0x3e32a0,JSON['stringify'](_0x586a73));_0x573b17(_0x586a73);})[_0xfec2('0x13')](function(_0x329c38){logger[_0xfec2('0x11')](_0xfec2('0x1c'),_0x329c38['message'],_0x3e32a0);_0x3637b6(_0x5e3555[_0xfec2('0x11')](0x1f4,_0x329c38[_0xfec2('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 2f613a2..7abb909 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 _0x0b0e=['post','create','put','/:id','update','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x0b0e,0x187));var _0xe0b0=function(_0x11f226,_0x491e30){_0x11f226=_0x11f226-0x0;var _0x30be77=_0x0b0e[_0x11f226];return _0x30be77;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['getFields']);router[_0xe0b0('0x9')](_0xe0b0('0xe'),auth['isAuthenticated'](),controller[_0xe0b0('0xf')]);router[_0xe0b0('0x9')]('/:id/descriptions',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x10')]);router[_0xe0b0('0x11')]('/',auth['isAuthenticated'](),controller[_0xe0b0('0x12')]);router[_0xe0b0('0x13')](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x15')]);router['delete'](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x16')]);module[_0xe0b0('0x17')]=router; \ No newline at end of file +var _0x2ef3=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intSalesforceConfiguration.controller','get','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','exports','multer','util','path'];(function(_0x1ef501,_0x5cadc2){var _0x404eec=function(_0x307bc8){while(--_0x307bc8){_0x1ef501['push'](_0x1ef501['shift']());}};_0x404eec(++_0x5cadc2);}(_0x2ef3,0xba));var _0x32ef=function(_0x3f2dd5,_0x4c7da3){_0x3f2dd5=_0x3f2dd5-0x0;var _0x9d1fd0=_0x2ef3[_0x3f2dd5];return _0x9d1fd0;};'use strict';var multer=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var path=require(_0x32ef('0x2'));var timeout=require(_0x32ef('0x3'));var express=require(_0x32ef('0x4'));var router=express[_0x32ef('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x32ef('0x6'));var interaction=require(_0x32ef('0x7'));var config=require('../../config/environment');var controller=require(_0x32ef('0x8'));router[_0x32ef('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x32ef('0x9')](_0x32ef('0xa'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x9')](_0x32ef('0xd'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xe')]);router[_0x32ef('0x9')](_0x32ef('0xf'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x32ef('0x9')](_0x32ef('0x10'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x11')]);router['post']('/',auth[_0x32ef('0xb')](),controller['create']);router[_0x32ef('0x12')]('/:id',auth[_0x32ef('0xb')](),controller[_0x32ef('0x13')]);router['delete']('/:id',auth[_0x32ef('0xb')](),controller['destroy']);module[_0x32ef('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 0377b32..cee23dd 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 _0x2055=['account_contact_lead','account','sequelize','exports','STRING','ENUM','Task','Case','contact_lead','contact','lead'];(function(_0x495c7f,_0x226ca9){var _0x283ff7=function(_0x31d45d){while(--_0x31d45d){_0x495c7f['push'](_0x495c7f['shift']());}};_0x283ff7(++_0x226ca9);}(_0x2055,0x157));var _0x5205=function(_0x3b531e,_0x57be15){_0x3b531e=_0x3b531e-0x0;var _0x1ebaf2=_0x2055[_0x3b531e];return _0x1ebaf2;};'use strict';var Sequelize=require(_0x5205('0x0'));module[_0x5205('0x1')]={'name':{'type':Sequelize[_0x5205('0x2')]},'description':{'type':Sequelize[_0x5205('0x2')]},'ticketType':{'type':Sequelize[_0x5205('0x3')](_0x5205('0x4'),_0x5205('0x5')),'defaultValue':_0x5205('0x4')},'moduleSearch':{'type':Sequelize[_0x5205('0x3')](_0x5205('0x6'),_0x5205('0x7'),_0x5205('0x8'),_0x5205('0x9'),_0x5205('0xa')),'defaultValue':_0x5205('0x6')},'moduleCreate':{'type':Sequelize[_0x5205('0x3')]('nothing',_0x5205('0x7'),'lead','account'),'defaultValue':'lead'},'leadId':{'type':Sequelize[_0x5205('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0x5205('0x2')]},'additionalSearchContact':{'type':Sequelize[_0x5205('0x2')]},'additionalSearchLead':{'type':Sequelize[_0x5205('0x2')]}}; \ No newline at end of file +var _0xe2db=['sequelize','ENUM','Task','Case','contact_lead','contact','lead','account_contact_lead','account','STRING'];(function(_0x12e3e3,_0x501eaf){var _0x26602e=function(_0x427882){while(--_0x427882){_0x12e3e3['push'](_0x12e3e3['shift']());}};_0x26602e(++_0x501eaf);}(_0xe2db,0x8c));var _0xbe2d=function(_0x2aad90,_0x1b74bc){_0x2aad90=_0x2aad90-0x0;var _0x469340=_0xe2db[_0x2aad90];return _0x469340;};'use strict';var Sequelize=require(_0xbe2d('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0xbe2d('0x1')](_0xbe2d('0x2'),_0xbe2d('0x3')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize[_0xbe2d('0x1')](_0xbe2d('0x4'),_0xbe2d('0x5'),_0xbe2d('0x6'),_0xbe2d('0x7'),_0xbe2d('0x8')),'defaultValue':_0xbe2d('0x4')},'moduleCreate':{'type':Sequelize[_0xbe2d('0x1')]('nothing',_0xbe2d('0x5'),_0xbe2d('0x6'),_0xbe2d('0x8')),'defaultValue':_0xbe2d('0x6')},'leadId':{'type':Sequelize[_0xbe2d('0x9')]},'additionalSearchAccount':{'type':Sequelize[_0xbe2d('0x9')]},'additionalSearchContact':{'type':Sequelize[_0xbe2d('0x9')]},'additionalSearchLead':{'type':Sequelize[_0xbe2d('0x9')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index da29d60..5ea2313 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 _0x9c0c=['pick','filter','merge','VIRTUAL','findAll','rows','catch','options','find','create','body','params','getFields','findOne','SalesforceField','getSubjects','nolimit','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','map','SalesforceConfiguration','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where'];(function(_0xcdf809,_0x2881f0){var _0x4d4d70=function(_0x277c61){while(--_0x277c61){_0xcdf809['push'](_0xcdf809['shift']());}};_0x4d4d70(++_0x2881f0);}(_0x9c0c,0xb4));var _0xc9c0=function(_0x2e7f96,_0x2ffe43){_0x2e7f96=_0x2e7f96-0x0;var _0x315277=_0x9c0c[_0x2e7f96];return _0x315277;};'use strict';var emlformat=require(_0xc9c0('0x0'));var rimraf=require(_0xc9c0('0x1'));var zipdir=require(_0xc9c0('0x2'));var jsonpatch=require(_0xc9c0('0x3'));var rp=require('request-promise');var moment=require(_0xc9c0('0x4'));var BPromise=require(_0xc9c0('0x5'));var Mustache=require(_0xc9c0('0x6'));var util=require(_0xc9c0('0x7'));var path=require(_0xc9c0('0x8'));var sox=require(_0xc9c0('0x9'));var csv=require(_0xc9c0('0xa'));var ejs=require(_0xc9c0('0xb'));var fs=require('fs');var fs_extra=require(_0xc9c0('0xc'));var _=require('lodash');var squel=require(_0xc9c0('0xd'));var crypto=require(_0xc9c0('0xe'));var jsforce=require(_0xc9c0('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xc9c0('0xa'));var querystring=require(_0xc9c0('0x10'));var Papa=require(_0xc9c0('0x11'));var Redis=require(_0xc9c0('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xc9c0('0x13'));var as=require(_0xc9c0('0x14'));var hardwareService=require(_0xc9c0('0x15'));var logger=require(_0xc9c0('0x16'))(_0xc9c0('0x17'));var utils=require('../../config/utils');var config=require(_0xc9c0('0x18'));var licenseUtil=require(_0xc9c0('0x19'));var db=require(_0xc9c0('0x1a'))['db'];function respondWithStatusCode(_0x15833d,_0x96142d){_0x96142d=_0x96142d||0xcc;return function(_0x3ab63b){if(_0x3ab63b){return _0x15833d[_0xc9c0('0x1b')](_0x96142d);}return _0x15833d[_0xc9c0('0x1c')](_0x96142d)[_0xc9c0('0x1d')]();};}function respondWithResult(_0x5ab2c8,_0x4dfdd9){_0x4dfdd9=_0x4dfdd9||0xc8;return function(_0x126011){if(_0x126011){return _0x5ab2c8[_0xc9c0('0x1c')](_0x4dfdd9)[_0xc9c0('0x1e')](_0x126011);}};}function respondWithFilteredResult(_0x244ba6,_0x513080){return function(_0x44d1ac){if(_0x44d1ac){var _0x45ce82=typeof _0x513080[_0xc9c0('0x1f')]===_0xc9c0('0x20')&&typeof _0x513080[_0xc9c0('0x21')]===_0xc9c0('0x20');var _0x19fd6=_0x44d1ac[_0xc9c0('0x22')];var _0x56a473=_0x45ce82?0x0:_0x513080[_0xc9c0('0x1f')];var _0x5676d2=_0x45ce82?_0x44d1ac[_0xc9c0('0x22')]:_0x513080[_0xc9c0('0x1f')]+_0x513080['limit'];var _0x531f31;if(_0x5676d2>=_0x19fd6){_0x5676d2=_0x19fd6;_0x531f31=0xc8;}else{_0x531f31=0xce;}_0x244ba6[_0xc9c0('0x1c')](_0x531f31);return _0x244ba6[_0xc9c0('0x23')](_0xc9c0('0x24'),_0x56a473+'-'+_0x5676d2+'/'+_0x19fd6)['json'](_0x44d1ac);}return null;};}function patchUpdates(_0x17a984){return function(_0x9a684){try{jsonpatch[_0xc9c0('0x25')](_0x9a684,_0x17a984,!![]);}catch(_0x3f04c6){return BPromise[_0xc9c0('0x26')](_0x3f04c6);}return _0x9a684[_0xc9c0('0x27')]();};}function saveUpdates(_0x4df459,_0x1369be){return function(_0x240cdc){if(_0x240cdc){return _0x240cdc[_0xc9c0('0x28')](_0x4df459)[_0xc9c0('0x29')](function(_0x58244f){return _0x58244f;});}return null;};}function removeEntity(_0x210ade,_0x59d252){return function(_0x336e4a){if(_0x336e4a){return _0x336e4a[_0xc9c0('0x2a')]()[_0xc9c0('0x29')](function(){_0x210ade[_0xc9c0('0x1c')](0xcc)[_0xc9c0('0x1d')]();});}};}function handleEntityNotFound(_0x438c14,_0x2eb5e2){return function(_0x402b49){if(!_0x402b49){_0x438c14[_0xc9c0('0x1b')](0x194);}return _0x402b49;};}function handleError(_0x155ded,_0x34b5f2){_0x34b5f2=_0x34b5f2||0x1f4;return function(_0x4576d9){logger['error'](_0x4576d9[_0xc9c0('0x2b')]);if(_0x4576d9[_0xc9c0('0x2c')]){delete _0x4576d9[_0xc9c0('0x2c')];}_0x155ded[_0xc9c0('0x1c')](_0x34b5f2)[_0xc9c0('0x2d')](_0x4576d9);};}exports['index']=function(_0x1e4166,_0xa8f859){var _0x5d4204={},_0x4b6c22={},_0x1dc6bf={'count':0x0,'rows':[]};var _0x204562=_[_0xc9c0('0x2e')](db[_0xc9c0('0x2f')][_0xc9c0('0x30')],function(_0x5f409e){return{'name':_0x5f409e[_0xc9c0('0x31')],'type':_0x5f409e[_0xc9c0('0x32')]['key']};});_0x4b6c22[_0xc9c0('0x33')]=_[_0xc9c0('0x2e')](_0x204562,_0xc9c0('0x2c'));_0x4b6c22[_0xc9c0('0x34')]=_[_0xc9c0('0x35')](_0x1e4166[_0xc9c0('0x34')]);_0x4b6c22[_0xc9c0('0x36')]=_[_0xc9c0('0x37')](_0x4b6c22[_0xc9c0('0x33')],_0x4b6c22[_0xc9c0('0x34')]);_0x5d4204['attributes']=_['intersection'](_0x4b6c22[_0xc9c0('0x33')],qs[_0xc9c0('0x38')](_0x1e4166[_0xc9c0('0x34')][_0xc9c0('0x38')]));_0x5d4204[_0xc9c0('0x39')]=_0x5d4204[_0xc9c0('0x39')][_0xc9c0('0x3a')]?_0x5d4204['attributes']:_0x4b6c22[_0xc9c0('0x33')];if(!_0x1e4166[_0xc9c0('0x34')][_0xc9c0('0x3b')]('nolimit')){_0x5d4204[_0xc9c0('0x21')]=qs[_0xc9c0('0x21')](_0x1e4166['query'][_0xc9c0('0x21')]);_0x5d4204[_0xc9c0('0x1f')]=qs[_0xc9c0('0x1f')](_0x1e4166[_0xc9c0('0x34')][_0xc9c0('0x1f')]);}_0x5d4204[_0xc9c0('0x3c')]=qs[_0xc9c0('0x3d')](_0x1e4166['query'][_0xc9c0('0x3d')]);_0x5d4204[_0xc9c0('0x3e')]=qs[_0xc9c0('0x36')](_[_0xc9c0('0x3f')](_0x1e4166[_0xc9c0('0x34')],_0x4b6c22[_0xc9c0('0x36')]),_0x204562);if(_0x1e4166['query'][_0xc9c0('0x40')]){_0x5d4204[_0xc9c0('0x3e')]=_[_0xc9c0('0x41')](_0x5d4204[_0xc9c0('0x3e')],{'$or':_[_0xc9c0('0x2e')](_0x204562,function(_0x30af1a){if(_0x30af1a[_0xc9c0('0x32')]!==_0xc9c0('0x42')){var _0x206e2b={};_0x206e2b[_0x30af1a[_0xc9c0('0x2c')]]={'$like':'%'+_0x1e4166[_0xc9c0('0x34')][_0xc9c0('0x40')]+'%'};return _0x206e2b;}})});}_0x5d4204=_[_0xc9c0('0x41')]({},_0x5d4204,_0x1e4166['options']);var _0x5dddaa={'where':_0x5d4204[_0xc9c0('0x3e')]};return db[_0xc9c0('0x2f')]['count'](_0x5dddaa)['then'](function(_0x5cbd2a){_0x1dc6bf['count']=_0x5cbd2a;if(_0x1e4166[_0xc9c0('0x34')]['includeAll']){_0x5d4204['include']=[{'all':!![]}];}return db[_0xc9c0('0x2f')][_0xc9c0('0x43')](_0x5d4204);})[_0xc9c0('0x29')](function(_0x6224bb){_0x1dc6bf[_0xc9c0('0x44')]=_0x6224bb;return _0x1dc6bf;})[_0xc9c0('0x29')](respondWithFilteredResult(_0xa8f859,_0x5d4204))[_0xc9c0('0x45')](handleError(_0xa8f859,null));};exports['show']=function(_0x53cc83,_0x5448ac){var _0x3a002f={'raw':![],'where':{'id':_0x53cc83['params']['id']}},_0x534f57={};_0x534f57[_0xc9c0('0x33')]=_['keys'](db[_0xc9c0('0x2f')][_0xc9c0('0x30')]);_0x534f57[_0xc9c0('0x34')]=_['keys'](_0x53cc83['query']);_0x534f57[_0xc9c0('0x36')]=_[_0xc9c0('0x37')](_0x534f57[_0xc9c0('0x33')],_0x534f57[_0xc9c0('0x34')]);_0x3a002f[_0xc9c0('0x39')]=_[_0xc9c0('0x37')](_0x534f57[_0xc9c0('0x33')],qs[_0xc9c0('0x38')](_0x53cc83[_0xc9c0('0x34')]['fields']));_0x3a002f['attributes']=_0x3a002f[_0xc9c0('0x39')][_0xc9c0('0x3a')]?_0x3a002f[_0xc9c0('0x39')]:_0x534f57[_0xc9c0('0x33')];if(_0x53cc83['query']['includeAll']){_0x3a002f['include']=[{'all':!![]}];}_0x3a002f=_[_0xc9c0('0x41')]({},_0x3a002f,_0x53cc83[_0xc9c0('0x46')]);return db[_0xc9c0('0x2f')][_0xc9c0('0x47')](_0x3a002f)[_0xc9c0('0x29')](handleEntityNotFound(_0x5448ac,null))[_0xc9c0('0x29')](respondWithResult(_0x5448ac,null))['catch'](handleError(_0x5448ac,null));};exports[_0xc9c0('0x48')]=function(_0x17bcae,_0x11d7b8){return db['SalesforceConfiguration'][_0xc9c0('0x48')](_0x17bcae[_0xc9c0('0x49')],{})[_0xc9c0('0x29')](respondWithResult(_0x11d7b8,0xc9))[_0xc9c0('0x45')](handleError(_0x11d7b8,null));};exports[_0xc9c0('0x28')]=function(_0x20a155,_0x2e3220){if(_0x20a155[_0xc9c0('0x49')]['id']){delete _0x20a155['body']['id'];}return db[_0xc9c0('0x2f')][_0xc9c0('0x47')]({'where':{'id':_0x20a155[_0xc9c0('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2e3220,null))[_0xc9c0('0x29')](saveUpdates(_0x20a155[_0xc9c0('0x49')],null))[_0xc9c0('0x29')](respondWithResult(_0x2e3220,null))[_0xc9c0('0x45')](handleError(_0x2e3220,null));};exports[_0xc9c0('0x2a')]=function(_0x2bf76f,_0xf75a2f){return db[_0xc9c0('0x2f')][_0xc9c0('0x47')]({'where':{'id':_0x2bf76f[_0xc9c0('0x4a')]['id']}})[_0xc9c0('0x29')](handleEntityNotFound(_0xf75a2f,null))[_0xc9c0('0x29')](removeEntity(_0xf75a2f,null))[_0xc9c0('0x45')](handleError(_0xf75a2f,null));};exports[_0xc9c0('0x4b')]=function(_0x215a13,_0x1195bf,_0x410e05){var _0x1c088e={};var _0x3f298b={};var _0x1bc03e;var _0x56f858;return db[_0xc9c0('0x2f')][_0xc9c0('0x4c')]({'where':{'id':_0x215a13[_0xc9c0('0x4a')]['id']}})[_0xc9c0('0x29')](handleEntityNotFound(_0x1195bf,null))['then'](function(_0x3041e9){if(_0x3041e9){_0x1bc03e=_0x3041e9;_0x3f298b[_0xc9c0('0x33')]=_[_0xc9c0('0x35')](db[_0xc9c0('0x4d')][_0xc9c0('0x30')]);_0x3f298b['query']=_[_0xc9c0('0x35')](_0x215a13[_0xc9c0('0x34')]);_0x3f298b[_0xc9c0('0x36')]=_['intersection'](_0x3f298b['model'],_0x3f298b[_0xc9c0('0x34')]);_0x1c088e[_0xc9c0('0x39')]=_[_0xc9c0('0x37')](_0x3f298b['model'],qs[_0xc9c0('0x38')](_0x215a13[_0xc9c0('0x34')][_0xc9c0('0x38')]));_0x1c088e['attributes']=_0x1c088e[_0xc9c0('0x39')]['length']?_0x1c088e['attributes']:_0x3f298b['model'];_0x1c088e[_0xc9c0('0x3c')]=qs['sort'](_0x215a13[_0xc9c0('0x34')][_0xc9c0('0x3d')]);_0x1c088e[_0xc9c0('0x3e')]=qs[_0xc9c0('0x36')](_[_0xc9c0('0x3f')](_0x215a13[_0xc9c0('0x34')],_0x3f298b[_0xc9c0('0x36')]));if(_0x215a13['query'][_0xc9c0('0x40')]){_0x1c088e['where']=_['merge'](_0x1c088e['where'],{'$or':_['map'](_0x1c088e[_0xc9c0('0x39')],function(_0x66035a){var _0x4fd625={};_0x4fd625[_0x66035a]={'$like':'%'+_0x215a13[_0xc9c0('0x34')][_0xc9c0('0x40')]+'%'};return _0x4fd625;})});}_0x1c088e=_[_0xc9c0('0x41')]({},_0x1c088e,_0x215a13[_0xc9c0('0x46')]);return _0x1bc03e[_0xc9c0('0x4b')](_0x1c088e);}})[_0xc9c0('0x29')](function(_0x1f659e){if(_0x1f659e){_0x56f858=_0x1f659e['length'];if(!_0x215a13[_0xc9c0('0x34')][_0xc9c0('0x3b')]('nolimit')){_0x1c088e['limit']=qs[_0xc9c0('0x21')](_0x215a13[_0xc9c0('0x34')]['limit']);_0x1c088e['offset']=qs[_0xc9c0('0x1f')](_0x215a13['query']['offset']);}return _0x1bc03e[_0xc9c0('0x4b')](_0x1c088e);}})[_0xc9c0('0x29')](function(_0x236565){if(_0x236565){return _0x236565?{'count':_0x56f858,'rows':_0x236565}:null;}})[_0xc9c0('0x29')](respondWithResult(_0x1195bf,null))['catch'](handleError(_0x1195bf,null));};exports[_0xc9c0('0x4e')]=function(_0x21196b,_0x21b42e,_0x53e9ee){var _0x2061ca={};var _0xb8ed18={};var _0x23ace6;var _0x3c72e5;return db[_0xc9c0('0x2f')][_0xc9c0('0x4c')]({'where':{'id':_0x21196b[_0xc9c0('0x4a')]['id']}})[_0xc9c0('0x29')](handleEntityNotFound(_0x21b42e,null))[_0xc9c0('0x29')](function(_0x79aa91){if(_0x79aa91){_0x23ace6=_0x79aa91;_0xb8ed18[_0xc9c0('0x33')]=_[_0xc9c0('0x35')](db[_0xc9c0('0x4d')][_0xc9c0('0x30')]);_0xb8ed18[_0xc9c0('0x34')]=_[_0xc9c0('0x35')](_0x21196b[_0xc9c0('0x34')]);_0xb8ed18[_0xc9c0('0x36')]=_['intersection'](_0xb8ed18['model'],_0xb8ed18[_0xc9c0('0x34')]);_0x2061ca[_0xc9c0('0x39')]=_['intersection'](_0xb8ed18[_0xc9c0('0x33')],qs[_0xc9c0('0x38')](_0x21196b[_0xc9c0('0x34')][_0xc9c0('0x38')]));_0x2061ca[_0xc9c0('0x39')]=_0x2061ca[_0xc9c0('0x39')]['length']?_0x2061ca[_0xc9c0('0x39')]:_0xb8ed18['model'];_0x2061ca[_0xc9c0('0x3c')]=qs[_0xc9c0('0x3d')](_0x21196b[_0xc9c0('0x34')][_0xc9c0('0x3d')]);_0x2061ca[_0xc9c0('0x3e')]=qs[_0xc9c0('0x36')](_[_0xc9c0('0x3f')](_0x21196b[_0xc9c0('0x34')],_0xb8ed18[_0xc9c0('0x36')]));if(_0x21196b['query'][_0xc9c0('0x40')]){_0x2061ca['where']=_[_0xc9c0('0x41')](_0x2061ca[_0xc9c0('0x3e')],{'$or':_[_0xc9c0('0x2e')](_0x2061ca[_0xc9c0('0x39')],function(_0x1c2f3d){var _0x591c07={};_0x591c07[_0x1c2f3d]={'$like':'%'+_0x21196b[_0xc9c0('0x34')][_0xc9c0('0x40')]+'%'};return _0x591c07;})});}_0x2061ca=_['merge']({},_0x2061ca,_0x21196b[_0xc9c0('0x46')]);return _0x23ace6[_0xc9c0('0x4e')](_0x2061ca);}})['then'](function(_0x324060){if(_0x324060){_0x3c72e5=_0x324060[_0xc9c0('0x3a')];if(!_0x21196b['query'][_0xc9c0('0x3b')](_0xc9c0('0x4f'))){_0x2061ca[_0xc9c0('0x21')]=qs[_0xc9c0('0x21')](_0x21196b[_0xc9c0('0x34')][_0xc9c0('0x21')]);_0x2061ca[_0xc9c0('0x1f')]=qs[_0xc9c0('0x1f')](_0x21196b[_0xc9c0('0x34')][_0xc9c0('0x1f')]);}return _0x23ace6['getSubjects'](_0x2061ca);}})['then'](function(_0x5142b5){if(_0x5142b5){return _0x5142b5?{'count':_0x3c72e5,'rows':_0x5142b5}:null;}})['then'](respondWithResult(_0x21b42e,null))[_0xc9c0('0x45')](handleError(_0x21b42e,null));};exports[_0xc9c0('0x50')]=function(_0xc8da46,_0x12bcd0,_0x40f30b){var _0x1e011a={};var _0x53abc7={};var _0x522f53;var _0x1fc898;return db[_0xc9c0('0x2f')]['findOne']({'where':{'id':_0xc8da46[_0xc9c0('0x4a')]['id']}})[_0xc9c0('0x29')](handleEntityNotFound(_0x12bcd0,null))[_0xc9c0('0x29')](function(_0x49b6dd){if(_0x49b6dd){_0x522f53=_0x49b6dd;_0x53abc7[_0xc9c0('0x33')]=_['keys'](db[_0xc9c0('0x4d')]['rawAttributes']);_0x53abc7[_0xc9c0('0x34')]=_[_0xc9c0('0x35')](_0xc8da46['query']);_0x53abc7[_0xc9c0('0x36')]=_[_0xc9c0('0x37')](_0x53abc7[_0xc9c0('0x33')],_0x53abc7[_0xc9c0('0x34')]);_0x1e011a[_0xc9c0('0x39')]=_[_0xc9c0('0x37')](_0x53abc7[_0xc9c0('0x33')],qs[_0xc9c0('0x38')](_0xc8da46[_0xc9c0('0x34')]['fields']));_0x1e011a[_0xc9c0('0x39')]=_0x1e011a[_0xc9c0('0x39')][_0xc9c0('0x3a')]?_0x1e011a['attributes']:_0x53abc7['model'];_0x1e011a[_0xc9c0('0x3c')]=qs['sort'](_0xc8da46[_0xc9c0('0x34')][_0xc9c0('0x3d')]);_0x1e011a[_0xc9c0('0x3e')]=qs[_0xc9c0('0x36')](_[_0xc9c0('0x3f')](_0xc8da46[_0xc9c0('0x34')],_0x53abc7['filters']));if(_0xc8da46[_0xc9c0('0x34')][_0xc9c0('0x40')]){_0x1e011a[_0xc9c0('0x3e')]=_['merge'](_0x1e011a[_0xc9c0('0x3e')],{'$or':_[_0xc9c0('0x2e')](_0x1e011a[_0xc9c0('0x39')],function(_0x3d57dd){var _0x5561e7={};_0x5561e7[_0x3d57dd]={'$like':'%'+_0xc8da46[_0xc9c0('0x34')][_0xc9c0('0x40')]+'%'};return _0x5561e7;})});}_0x1e011a=_[_0xc9c0('0x41')]({},_0x1e011a,_0xc8da46[_0xc9c0('0x46')]);return _0x522f53[_0xc9c0('0x50')](_0x1e011a);}})['then'](function(_0x21fcdf){if(_0x21fcdf){_0x1fc898=_0x21fcdf[_0xc9c0('0x3a')];if(!_0xc8da46[_0xc9c0('0x34')][_0xc9c0('0x3b')](_0xc9c0('0x4f'))){_0x1e011a[_0xc9c0('0x21')]=qs[_0xc9c0('0x21')](_0xc8da46['query'][_0xc9c0('0x21')]);_0x1e011a['offset']=qs[_0xc9c0('0x1f')](_0xc8da46['query'][_0xc9c0('0x1f')]);}return _0x522f53[_0xc9c0('0x50')](_0x1e011a);}})[_0xc9c0('0x29')](function(_0xb73907){if(_0xb73907){return _0xb73907?{'count':_0x1fc898,'rows':_0xb73907}:null;}})[_0xc9c0('0x29')](respondWithResult(_0x12bcd0,null))['catch'](handleError(_0x12bcd0,null));}; \ No newline at end of file +var _0x4986=['hasOwnProperty','nolimit','sort','where','pick','merge','map','VIRTUAL','filter','SalesforceConfiguration','includeAll','include','findAll','catch','show','keys','fields','length','options','find','create','body','update','params','getFields','findOne','SalesforceField','order','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','error','stack','name','send','index','rawAttributes','fieldName','type','model','query','filters','attributes','intersection'];(function(_0x44d778,_0x32f171){var _0x2bf7ff=function(_0x226cfc){while(--_0x226cfc){_0x44d778['push'](_0x44d778['shift']());}};_0x2bf7ff(++_0x32f171);}(_0x4986,0x6e));var _0x6498=function(_0x1e015d,_0x544694){_0x1e015d=_0x1e015d-0x0;var _0x5eee5c=_0x4986[_0x1e015d];return _0x5eee5c;};'use strict';var emlformat=require(_0x6498('0x0'));var rimraf=require(_0x6498('0x1'));var zipdir=require(_0x6498('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6498('0x3'));var BPromise=require(_0x6498('0x4'));var Mustache=require('mustache');var util=require(_0x6498('0x5'));var path=require(_0x6498('0x6'));var sox=require(_0x6498('0x7'));var csv=require(_0x6498('0x8'));var ejs=require(_0x6498('0x9'));var fs=require('fs');var fs_extra=require(_0x6498('0xa'));var _=require(_0x6498('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6498('0xc'));var deskjs=require(_0x6498('0xd'));var toCsv=require(_0x6498('0x8'));var querystring=require(_0x6498('0xe'));var Papa=require(_0x6498('0xf'));var Redis=require('ioredis');var authService=require(_0x6498('0x10'));var qs=require(_0x6498('0x11'));var as=require(_0x6498('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6498('0x13'));var utils=require('../../config/utils');var config=require(_0x6498('0x14'));var licenseUtil=require(_0x6498('0x15'));var db=require(_0x6498('0x16'))['db'];function respondWithStatusCode(_0x17d497,_0x380c74){_0x380c74=_0x380c74||0xcc;return function(_0x3771b1){if(_0x3771b1){return _0x17d497[_0x6498('0x17')](_0x380c74);}return _0x17d497['status'](_0x380c74)['end']();};}function respondWithResult(_0x4769ab,_0xfde02b){_0xfde02b=_0xfde02b||0xc8;return function(_0x3ae8e5){if(_0x3ae8e5){return _0x4769ab[_0x6498('0x18')](_0xfde02b)[_0x6498('0x19')](_0x3ae8e5);}};}function respondWithFilteredResult(_0x59833d,_0x318b75){return function(_0x2ab98d){if(_0x2ab98d){var _0x172b0e=typeof _0x318b75[_0x6498('0x1a')]===_0x6498('0x1b')&&typeof _0x318b75[_0x6498('0x1c')]===_0x6498('0x1b');var _0x500d3f=_0x2ab98d[_0x6498('0x1d')];var _0x8b41fe=_0x172b0e?0x0:_0x318b75[_0x6498('0x1a')];var _0x2f8fdb=_0x172b0e?_0x2ab98d[_0x6498('0x1d')]:_0x318b75['offset']+_0x318b75['limit'];var _0x334ee9;if(_0x2f8fdb>=_0x500d3f){_0x2f8fdb=_0x500d3f;_0x334ee9=0xc8;}else{_0x334ee9=0xce;}_0x59833d[_0x6498('0x18')](_0x334ee9);return _0x59833d[_0x6498('0x1e')](_0x6498('0x1f'),_0x8b41fe+'-'+_0x2f8fdb+'/'+_0x500d3f)[_0x6498('0x19')](_0x2ab98d);}return null;};}function patchUpdates(_0x46c830){return function(_0x32a297){try{jsonpatch[_0x6498('0x20')](_0x32a297,_0x46c830,!![]);}catch(_0x377aef){return BPromise[_0x6498('0x21')](_0x377aef);}return _0x32a297[_0x6498('0x22')]();};}function saveUpdates(_0x1ccaec,_0x39b8d0){return function(_0x87685c){if(_0x87685c){return _0x87685c['update'](_0x1ccaec)['then'](function(_0x2a34d0){return _0x2a34d0;});}return null;};}function removeEntity(_0x514544,_0x46c3f7){return function(_0x30d261){if(_0x30d261){return _0x30d261[_0x6498('0x23')]()[_0x6498('0x24')](function(){_0x514544['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x43b1d2,_0x4f9d95){return function(_0x3e8dc7){if(!_0x3e8dc7){_0x43b1d2[_0x6498('0x17')](0x194);}return _0x3e8dc7;};}function handleError(_0x41d43f,_0x271048){_0x271048=_0x271048||0x1f4;return function(_0x1ce28d){logger[_0x6498('0x25')](_0x1ce28d[_0x6498('0x26')]);if(_0x1ce28d[_0x6498('0x27')]){delete _0x1ce28d[_0x6498('0x27')];}_0x41d43f[_0x6498('0x18')](_0x271048)[_0x6498('0x28')](_0x1ce28d);};}exports[_0x6498('0x29')]=function(_0x64df19,_0x4be06f){var _0x12c9d2={},_0x383d8b={},_0x5eda63={'count':0x0,'rows':[]};var _0x4f78b7=_['map'](db['SalesforceConfiguration'][_0x6498('0x2a')],function(_0x20e342){return{'name':_0x20e342[_0x6498('0x2b')],'type':_0x20e342[_0x6498('0x2c')]['key']};});_0x383d8b[_0x6498('0x2d')]=_['map'](_0x4f78b7,'name');_0x383d8b['query']=_['keys'](_0x64df19[_0x6498('0x2e')]);_0x383d8b[_0x6498('0x2f')]=_['intersection'](_0x383d8b[_0x6498('0x2d')],_0x383d8b['query']);_0x12c9d2[_0x6498('0x30')]=_[_0x6498('0x31')](_0x383d8b['model'],qs['fields'](_0x64df19[_0x6498('0x2e')]['fields']));_0x12c9d2[_0x6498('0x30')]=_0x12c9d2[_0x6498('0x30')]['length']?_0x12c9d2[_0x6498('0x30')]:_0x383d8b['model'];if(!_0x64df19[_0x6498('0x2e')][_0x6498('0x32')](_0x6498('0x33'))){_0x12c9d2[_0x6498('0x1c')]=qs[_0x6498('0x1c')](_0x64df19[_0x6498('0x2e')][_0x6498('0x1c')]);_0x12c9d2['offset']=qs[_0x6498('0x1a')](_0x64df19['query'][_0x6498('0x1a')]);}_0x12c9d2['order']=qs[_0x6498('0x34')](_0x64df19['query'][_0x6498('0x34')]);_0x12c9d2[_0x6498('0x35')]=qs[_0x6498('0x2f')](_[_0x6498('0x36')](_0x64df19[_0x6498('0x2e')],_0x383d8b[_0x6498('0x2f')]),_0x4f78b7);if(_0x64df19[_0x6498('0x2e')]['filter']){_0x12c9d2[_0x6498('0x35')]=_[_0x6498('0x37')](_0x12c9d2[_0x6498('0x35')],{'$or':_[_0x6498('0x38')](_0x4f78b7,function(_0xc09391){if(_0xc09391[_0x6498('0x2c')]!==_0x6498('0x39')){var _0x427964={};_0x427964[_0xc09391['name']]={'$like':'%'+_0x64df19[_0x6498('0x2e')][_0x6498('0x3a')]+'%'};return _0x427964;}})});}_0x12c9d2=_[_0x6498('0x37')]({},_0x12c9d2,_0x64df19['options']);var _0x395a50={'where':_0x12c9d2[_0x6498('0x35')]};return db[_0x6498('0x3b')][_0x6498('0x1d')](_0x395a50)[_0x6498('0x24')](function(_0xd5c337){_0x5eda63[_0x6498('0x1d')]=_0xd5c337;if(_0x64df19[_0x6498('0x2e')][_0x6498('0x3c')]){_0x12c9d2[_0x6498('0x3d')]=[{'all':!![]}];}return db[_0x6498('0x3b')][_0x6498('0x3e')](_0x12c9d2);})['then'](function(_0x4d05d2){_0x5eda63['rows']=_0x4d05d2;return _0x5eda63;})[_0x6498('0x24')](respondWithFilteredResult(_0x4be06f,_0x12c9d2))[_0x6498('0x3f')](handleError(_0x4be06f,null));};exports[_0x6498('0x40')]=function(_0x4b60b7,_0x274ed1){var _0x2ae059={'raw':![],'where':{'id':_0x4b60b7['params']['id']}},_0x3cc682={};_0x3cc682[_0x6498('0x2d')]=_[_0x6498('0x41')](db[_0x6498('0x3b')][_0x6498('0x2a')]);_0x3cc682[_0x6498('0x2e')]=_[_0x6498('0x41')](_0x4b60b7['query']);_0x3cc682[_0x6498('0x2f')]=_[_0x6498('0x31')](_0x3cc682['model'],_0x3cc682['query']);_0x2ae059[_0x6498('0x30')]=_[_0x6498('0x31')](_0x3cc682[_0x6498('0x2d')],qs['fields'](_0x4b60b7['query'][_0x6498('0x42')]));_0x2ae059['attributes']=_0x2ae059[_0x6498('0x30')][_0x6498('0x43')]?_0x2ae059[_0x6498('0x30')]:_0x3cc682[_0x6498('0x2d')];if(_0x4b60b7[_0x6498('0x2e')][_0x6498('0x3c')]){_0x2ae059['include']=[{'all':!![]}];}_0x2ae059=_[_0x6498('0x37')]({},_0x2ae059,_0x4b60b7[_0x6498('0x44')]);return db[_0x6498('0x3b')][_0x6498('0x45')](_0x2ae059)['then'](handleEntityNotFound(_0x274ed1,null))[_0x6498('0x24')](respondWithResult(_0x274ed1,null))[_0x6498('0x3f')](handleError(_0x274ed1,null));};exports[_0x6498('0x46')]=function(_0x1a1fe2,_0x172076){return db[_0x6498('0x3b')][_0x6498('0x46')](_0x1a1fe2[_0x6498('0x47')],{})['then'](respondWithResult(_0x172076,0xc9))[_0x6498('0x3f')](handleError(_0x172076,null));};exports[_0x6498('0x48')]=function(_0x1a1065,_0x30d30b){if(_0x1a1065[_0x6498('0x47')]['id']){delete _0x1a1065[_0x6498('0x47')]['id'];}return db[_0x6498('0x3b')][_0x6498('0x45')]({'where':{'id':_0x1a1065[_0x6498('0x49')]['id']}})[_0x6498('0x24')](handleEntityNotFound(_0x30d30b,null))[_0x6498('0x24')](saveUpdates(_0x1a1065[_0x6498('0x47')],null))[_0x6498('0x24')](respondWithResult(_0x30d30b,null))[_0x6498('0x3f')](handleError(_0x30d30b,null));};exports[_0x6498('0x23')]=function(_0x14b1f9,_0x1ba879){return db[_0x6498('0x3b')][_0x6498('0x45')]({'where':{'id':_0x14b1f9[_0x6498('0x49')]['id']}})[_0x6498('0x24')](handleEntityNotFound(_0x1ba879,null))['then'](removeEntity(_0x1ba879,null))[_0x6498('0x3f')](handleError(_0x1ba879,null));};exports[_0x6498('0x4a')]=function(_0x3d531c,_0x3c0d42,_0x15d2f8){var _0x24083a={};var _0x5ab08c={};var _0x552a9e;var _0x26580e;return db['SalesforceConfiguration'][_0x6498('0x4b')]({'where':{'id':_0x3d531c[_0x6498('0x49')]['id']}})[_0x6498('0x24')](handleEntityNotFound(_0x3c0d42,null))[_0x6498('0x24')](function(_0x25cd9){if(_0x25cd9){_0x552a9e=_0x25cd9;_0x5ab08c['model']=_[_0x6498('0x41')](db[_0x6498('0x4c')][_0x6498('0x2a')]);_0x5ab08c[_0x6498('0x2e')]=_['keys'](_0x3d531c['query']);_0x5ab08c[_0x6498('0x2f')]=_['intersection'](_0x5ab08c[_0x6498('0x2d')],_0x5ab08c[_0x6498('0x2e')]);_0x24083a[_0x6498('0x30')]=_[_0x6498('0x31')](_0x5ab08c[_0x6498('0x2d')],qs[_0x6498('0x42')](_0x3d531c[_0x6498('0x2e')][_0x6498('0x42')]));_0x24083a['attributes']=_0x24083a[_0x6498('0x30')][_0x6498('0x43')]?_0x24083a[_0x6498('0x30')]:_0x5ab08c[_0x6498('0x2d')];_0x24083a['order']=qs[_0x6498('0x34')](_0x3d531c['query'][_0x6498('0x34')]);_0x24083a['where']=qs[_0x6498('0x2f')](_[_0x6498('0x36')](_0x3d531c['query'],_0x5ab08c['filters']));if(_0x3d531c['query'][_0x6498('0x3a')]){_0x24083a[_0x6498('0x35')]=_['merge'](_0x24083a[_0x6498('0x35')],{'$or':_[_0x6498('0x38')](_0x24083a['attributes'],function(_0x5eccb8){var _0x2ef113={};_0x2ef113[_0x5eccb8]={'$like':'%'+_0x3d531c[_0x6498('0x2e')][_0x6498('0x3a')]+'%'};return _0x2ef113;})});}_0x24083a=_[_0x6498('0x37')]({},_0x24083a,_0x3d531c[_0x6498('0x44')]);return _0x552a9e[_0x6498('0x4a')](_0x24083a);}})[_0x6498('0x24')](function(_0x335460){if(_0x335460){_0x26580e=_0x335460[_0x6498('0x43')];if(!_0x3d531c['query']['hasOwnProperty'](_0x6498('0x33'))){_0x24083a[_0x6498('0x1c')]=qs['limit'](_0x3d531c[_0x6498('0x2e')][_0x6498('0x1c')]);_0x24083a[_0x6498('0x1a')]=qs[_0x6498('0x1a')](_0x3d531c[_0x6498('0x2e')][_0x6498('0x1a')]);}return _0x552a9e['getFields'](_0x24083a);}})['then'](function(_0x57652c){if(_0x57652c){return _0x57652c?{'count':_0x26580e,'rows':_0x57652c}:null;}})[_0x6498('0x24')](respondWithResult(_0x3c0d42,null))[_0x6498('0x3f')](handleError(_0x3c0d42,null));};exports['getSubjects']=function(_0x3adb26,_0x1f2308,_0x1e5f52){var _0x2f3d53={};var _0x318573={};var _0xa5d0eb;var _0x11f3f7;return db[_0x6498('0x3b')][_0x6498('0x4b')]({'where':{'id':_0x3adb26[_0x6498('0x49')]['id']}})['then'](handleEntityNotFound(_0x1f2308,null))[_0x6498('0x24')](function(_0x2e8ed8){if(_0x2e8ed8){_0xa5d0eb=_0x2e8ed8;_0x318573['model']=_['keys'](db['SalesforceField']['rawAttributes']);_0x318573[_0x6498('0x2e')]=_[_0x6498('0x41')](_0x3adb26[_0x6498('0x2e')]);_0x318573[_0x6498('0x2f')]=_['intersection'](_0x318573[_0x6498('0x2d')],_0x318573['query']);_0x2f3d53[_0x6498('0x30')]=_[_0x6498('0x31')](_0x318573[_0x6498('0x2d')],qs[_0x6498('0x42')](_0x3adb26[_0x6498('0x2e')][_0x6498('0x42')]));_0x2f3d53[_0x6498('0x30')]=_0x2f3d53[_0x6498('0x30')][_0x6498('0x43')]?_0x2f3d53[_0x6498('0x30')]:_0x318573['model'];_0x2f3d53[_0x6498('0x4d')]=qs[_0x6498('0x34')](_0x3adb26['query']['sort']);_0x2f3d53['where']=qs[_0x6498('0x2f')](_[_0x6498('0x36')](_0x3adb26['query'],_0x318573['filters']));if(_0x3adb26[_0x6498('0x2e')][_0x6498('0x3a')]){_0x2f3d53[_0x6498('0x35')]=_['merge'](_0x2f3d53[_0x6498('0x35')],{'$or':_[_0x6498('0x38')](_0x2f3d53[_0x6498('0x30')],function(_0x259549){var _0x3f0e36={};_0x3f0e36[_0x259549]={'$like':'%'+_0x3adb26[_0x6498('0x2e')][_0x6498('0x3a')]+'%'};return _0x3f0e36;})});}_0x2f3d53=_[_0x6498('0x37')]({},_0x2f3d53,_0x3adb26['options']);return _0xa5d0eb[_0x6498('0x4e')](_0x2f3d53);}})[_0x6498('0x24')](function(_0x349cfe){if(_0x349cfe){_0x11f3f7=_0x349cfe[_0x6498('0x43')];if(!_0x3adb26['query'][_0x6498('0x32')](_0x6498('0x33'))){_0x2f3d53[_0x6498('0x1c')]=qs['limit'](_0x3adb26[_0x6498('0x2e')][_0x6498('0x1c')]);_0x2f3d53[_0x6498('0x1a')]=qs[_0x6498('0x1a')](_0x3adb26[_0x6498('0x2e')][_0x6498('0x1a')]);}return _0xa5d0eb['getSubjects'](_0x2f3d53);}})[_0x6498('0x24')](function(_0x1d69d6){if(_0x1d69d6){return _0x1d69d6?{'count':_0x11f3f7,'rows':_0x1d69d6}:null;}})[_0x6498('0x24')](respondWithResult(_0x1f2308,null))['catch'](handleError(_0x1f2308,null));};exports[_0x6498('0x4f')]=function(_0x154d27,_0x4834fa,_0x27728e){var _0x1d995c={};var _0x3728d5={};var _0x3ea69b;var _0x5c041c;return db[_0x6498('0x3b')][_0x6498('0x4b')]({'where':{'id':_0x154d27[_0x6498('0x49')]['id']}})[_0x6498('0x24')](handleEntityNotFound(_0x4834fa,null))[_0x6498('0x24')](function(_0x32616c){if(_0x32616c){_0x3ea69b=_0x32616c;_0x3728d5[_0x6498('0x2d')]=_[_0x6498('0x41')](db[_0x6498('0x4c')]['rawAttributes']);_0x3728d5[_0x6498('0x2e')]=_[_0x6498('0x41')](_0x154d27[_0x6498('0x2e')]);_0x3728d5[_0x6498('0x2f')]=_[_0x6498('0x31')](_0x3728d5[_0x6498('0x2d')],_0x3728d5[_0x6498('0x2e')]);_0x1d995c[_0x6498('0x30')]=_[_0x6498('0x31')](_0x3728d5[_0x6498('0x2d')],qs[_0x6498('0x42')](_0x154d27[_0x6498('0x2e')][_0x6498('0x42')]));_0x1d995c[_0x6498('0x30')]=_0x1d995c[_0x6498('0x30')][_0x6498('0x43')]?_0x1d995c[_0x6498('0x30')]:_0x3728d5[_0x6498('0x2d')];_0x1d995c[_0x6498('0x4d')]=qs[_0x6498('0x34')](_0x154d27[_0x6498('0x2e')][_0x6498('0x34')]);_0x1d995c[_0x6498('0x35')]=qs[_0x6498('0x2f')](_[_0x6498('0x36')](_0x154d27[_0x6498('0x2e')],_0x3728d5[_0x6498('0x2f')]));if(_0x154d27['query']['filter']){_0x1d995c[_0x6498('0x35')]=_[_0x6498('0x37')](_0x1d995c[_0x6498('0x35')],{'$or':_[_0x6498('0x38')](_0x1d995c[_0x6498('0x30')],function(_0x2bf343){var _0x1422a4={};_0x1422a4[_0x2bf343]={'$like':'%'+_0x154d27[_0x6498('0x2e')][_0x6498('0x3a')]+'%'};return _0x1422a4;})});}_0x1d995c=_[_0x6498('0x37')]({},_0x1d995c,_0x154d27['options']);return _0x3ea69b[_0x6498('0x4f')](_0x1d995c);}})[_0x6498('0x24')](function(_0xaea748){if(_0xaea748){_0x5c041c=_0xaea748[_0x6498('0x43')];if(!_0x154d27['query'][_0x6498('0x32')](_0x6498('0x33'))){_0x1d995c[_0x6498('0x1c')]=qs[_0x6498('0x1c')](_0x154d27[_0x6498('0x2e')][_0x6498('0x1c')]);_0x1d995c['offset']=qs['offset'](_0x154d27[_0x6498('0x2e')][_0x6498('0x1a')]);}return _0x3ea69b[_0x6498('0x4f')](_0x1d995c);}})['then'](function(_0xcff59){if(_0xcff59){return _0xcff59?{'count':_0x5c041c,'rows':_0xcff59}:null;}})[_0x6498('0x24')](respondWithResult(_0x4834fa,null))[_0x6498('0x3f')](handleError(_0x4834fa,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 74e02dd..8d136b6 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 _0x2d79=['moment','bluebird','request-promise','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration','lodash','util','../../config/logger','api'];(function(_0x3296d4,_0xf31492){var _0xb7d805=function(_0x1dcc45){while(--_0x1dcc45){_0x3296d4['push'](_0x3296d4['shift']());}};_0xb7d805(++_0xf31492);}(_0x2d79,0x141));var _0x92d7=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x2d79[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x92d7('0x0'));var util=require(_0x92d7('0x1'));var logger=require(_0x92d7('0x2'))(_0x92d7('0x3'));var moment=require(_0x92d7('0x4'));var BPromise=require(_0x92d7('0x5'));var rp=require(_0x92d7('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x92d7('0x7'));var config=require(_0x92d7('0x8'));var attributes=require(_0x92d7('0x9'));module[_0x92d7('0xa')]=function(_0x1ac5f4,_0x286a58){return _0x1ac5f4[_0x92d7('0xb')](_0x92d7('0xc'),attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x166d=['SalesforceConfiguration','int_salesforce_configurations','../../config/logger','api','moment','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','exports','define'];(function(_0x523a82,_0x455fae){var _0x5aba13=function(_0x2788dd){while(--_0x2788dd){_0x523a82['push'](_0x523a82['shift']());}};_0x5aba13(++_0x455fae);}(_0x166d,0xd3));var _0xd166=function(_0x720bfe,_0x5ef6e9){_0x720bfe=_0x720bfe-0x0;var _0x4624dd=_0x166d[_0x720bfe];return _0x4624dd;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd166('0x0'))(_0xd166('0x1'));var moment=require(_0xd166('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd166('0x3'));var rimraf=require(_0xd166('0x4'));var config=require(_0xd166('0x5'));var attributes=require(_0xd166('0x6'));module[_0xd166('0x7')]=function(_0x373615,_0x5aedb2){return _0x373615[_0xd166('0x8')](_0xd166('0x9'),attributes,{'tableName':_0xd166('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js index f73bf00..17e5bc1 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 _0x2a35=['SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x5a7f64,_0x347d57){var _0x3d30f1=function(_0x4bd1d6){while(--_0x4bd1d6){_0x5a7f64['push'](_0x5a7f64['shift']());}};_0x3d30f1(++_0x347d57);}(_0x2a35,0x1d2));var _0x52a3=function(_0x4156ed,_0x560baa){_0x4156ed=_0x4156ed-0x0;var _0x2b59af=_0x2a35[_0x4156ed];return _0x2b59af;};'use strict';var _=require(_0x52a3('0x0'));var util=require(_0x52a3('0x1'));var moment=require(_0x52a3('0x2'));var BPromise=require(_0x52a3('0x3'));var rs=require(_0x52a3('0x4'));var fs=require('fs');var Redis=require(_0x52a3('0x5'));var db=require(_0x52a3('0x6'))['db'];var utils=require(_0x52a3('0x7'));var logger=require(_0x52a3('0x8'))(_0x52a3('0x9'));var config=require('../../config/environment');var jayson=require(_0x52a3('0xa'));var client=jayson[_0x52a3('0xb')][_0x52a3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x137dff,_0x176022,_0x1d84fe){return new BPromise(function(_0x79a7ac,_0x4b208f){return client[_0x52a3('0xd')](_0x137dff,_0x1d84fe)['then'](function(_0x3b0aaa){logger['info'](_0x52a3('0xe'),_0x176022,_0x52a3('0xf'));logger['debug'](_0x52a3('0x10'),_0x176022,_0x52a3('0xf'),JSON[_0x52a3('0x11')](_0x3b0aaa));if(_0x3b0aaa['error']){if(_0x3b0aaa[_0x52a3('0x12')][_0x52a3('0x13')]===0x1f4){logger[_0x52a3('0x12')](_0x52a3('0xe'),_0x176022,_0x3b0aaa['error'][_0x52a3('0x14')]);return _0x4b208f(_0x3b0aaa[_0x52a3('0x12')][_0x52a3('0x14')]);}logger[_0x52a3('0x12')](_0x52a3('0xe'),_0x176022,_0x3b0aaa[_0x52a3('0x12')][_0x52a3('0x14')]);return _0x79a7ac(_0x3b0aaa[_0x52a3('0x12')]['message']);}else{logger[_0x52a3('0x15')](_0x52a3('0xe'),_0x176022,_0x52a3('0xf'));_0x79a7ac(_0x3b0aaa[_0x52a3('0x16')]['message']);}})[_0x52a3('0x17')](function(_0x4f81e8){logger['error'](_0x52a3('0xe'),_0x176022,_0x4f81e8);_0x4b208f(_0x4f81e8);});});} \ No newline at end of file +var _0xdb87=['ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment','bluebird'];(function(_0x3ff9b4,_0x2363b2){var _0x518154=function(_0x33b182){while(--_0x33b182){_0x3ff9b4['push'](_0x3ff9b4['shift']());}};_0x518154(++_0x2363b2);}(_0xdb87,0x189));var _0x7db8=function(_0x1b8814,_0x47f957){_0x1b8814=_0x1b8814-0x0;var _0x338631=_0xdb87[_0x1b8814];return _0x338631;};'use strict';var _=require('lodash');var util=require(_0x7db8('0x0'));var moment=require(_0x7db8('0x1'));var BPromise=require(_0x7db8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7db8('0x3'));var db=require(_0x7db8('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7db8('0x5'));var config=require(_0x7db8('0x6'));var jayson=require(_0x7db8('0x7'));var client=jayson[_0x7db8('0x8')][_0x7db8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1053c1,_0x174f21,_0x109759){return new BPromise(function(_0x46389c,_0x39beee){return client[_0x7db8('0xa')](_0x1053c1,_0x109759)[_0x7db8('0xb')](function(_0x32cf12){logger['info'](_0x7db8('0xc'),_0x174f21,_0x7db8('0xd'));logger['debug'](_0x7db8('0xe'),_0x174f21,_0x7db8('0xd'),JSON[_0x7db8('0xf')](_0x32cf12));if(_0x32cf12[_0x7db8('0x10')]){if(_0x32cf12['error'][_0x7db8('0x11')]===0x1f4){logger[_0x7db8('0x10')](_0x7db8('0xc'),_0x174f21,_0x32cf12[_0x7db8('0x10')][_0x7db8('0x12')]);return _0x39beee(_0x32cf12['error'][_0x7db8('0x12')]);}logger[_0x7db8('0x10')]('SalesforceConfiguration,\x20%s,\x20%s',_0x174f21,_0x32cf12[_0x7db8('0x10')][_0x7db8('0x12')]);return _0x46389c(_0x32cf12['error'][_0x7db8('0x12')]);}else{logger[_0x7db8('0x13')]('SalesforceConfiguration,\x20%s,\x20%s',_0x174f21,_0x7db8('0xd'));_0x46389c(_0x32cf12[_0x7db8('0x14')][_0x7db8('0x12')]);}})[_0x7db8('0x15')](function(_0x3487e1){logger[_0x7db8('0x10')](_0x7db8('0xc'),_0x174f21,_0x3487e1);_0x39beee(_0x3487e1);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index a7b2e1e..c41af7f 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 _0xd8f1=['post','create','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id'];(function(_0x1b22bd,_0x3dc362){var _0x1dce3e=function(_0x294320){while(--_0x294320){_0x1b22bd['push'](_0x1b22bd['shift']());}};_0x1dce3e(++_0x3dc362);}(_0xd8f1,0xf4));var _0x1d8f=function(_0x30901f,_0x11b926){_0x30901f=_0x30901f-0x0;var _0x29ef65=_0xd8f1[_0x30901f];return _0x29ef65;};'use strict';var multer=require(_0x1d8f('0x0'));var util=require(_0x1d8f('0x1'));var path=require(_0x1d8f('0x2'));var timeout=require(_0x1d8f('0x3'));var express=require(_0x1d8f('0x4'));var router=express[_0x1d8f('0x5')]();var fs_extra=require(_0x1d8f('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x1d8f('0x7'));var config=require(_0x1d8f('0x8'));var controller=require('./intSalesforceField.controller');router[_0x1d8f('0x9')]('/',auth[_0x1d8f('0xa')](),controller['index']);router[_0x1d8f('0x9')](_0x1d8f('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x1d8f('0xc')]('/',auth[_0x1d8f('0xa')](),controller[_0x1d8f('0xd')]);router['put'](_0x1d8f('0xb'),auth[_0x1d8f('0xa')](),controller[_0x1d8f('0xe')]);router['delete'](_0x1d8f('0xb'),auth[_0x1d8f('0xa')](),controller['destroy']);module[_0x1d8f('0xf')]=router; \ No newline at end of file +var _0xe72e=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','/:id','post','create','put','delete','destroy','exports','util','path'];(function(_0x122354,_0x5bba72){var _0xb68790=function(_0x539fda){while(--_0x539fda){_0x122354['push'](_0x122354['shift']());}};_0xb68790(++_0x5bba72);}(_0xe72e,0x70));var _0xee72=function(_0x4171,_0x50ab0d){_0x4171=_0x4171-0x0;var _0x35dcaa=_0xe72e[_0x4171];return _0x35dcaa;};'use strict';var multer=require('multer');var util=require(_0xee72('0x0'));var path=require(_0xee72('0x1'));var timeout=require(_0xee72('0x2'));var express=require(_0xee72('0x3'));var router=express[_0xee72('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xee72('0x5'));var interaction=require(_0xee72('0x6'));var config=require(_0xee72('0x7'));var controller=require(_0xee72('0x8'));router[_0xee72('0x9')]('/',auth[_0xee72('0xa')](),controller[_0xee72('0xb')]);router[_0xee72('0x9')](_0xee72('0xc'),auth[_0xee72('0xa')](),controller['show']);router[_0xee72('0xd')]('/',auth['isAuthenticated'](),controller[_0xee72('0xe')]);router[_0xee72('0xf')](_0xee72('0xc'),auth[_0xee72('0xa')](),controller['update']);router[_0xee72('0x10')](_0xee72('0xc'),auth['isAuthenticated'](),controller[_0xee72('0x11')]);module[_0xee72('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 9677765..afb0f31 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 _0x2c4e=['string','variable','STRING','sequelize','exports','customVariable','picklist','ENUM'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x2c4e,0x1a3));var _0xe2c4=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x2c4e[_0x2d7f0e];return _0x110b07;};'use strict';var Sequelize=require(_0xe2c4('0x0'));module[_0xe2c4('0x1')]={'type':{'type':Sequelize['ENUM']('string','variable',_0xe2c4('0x2'),'keyValue',_0xe2c4('0x3')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xe2c4('0x4')](_0xe2c4('0x5'),_0xe2c4('0x6'),_0xe2c4('0x2'))},'keyContent':{'type':Sequelize[_0xe2c4('0x7')]},'idField':{'type':Sequelize[_0xe2c4('0x7')]},'variableName':{'type':Sequelize[_0xe2c4('0x7')]}}; \ No newline at end of file +var _0x1a23=['string','STRING','sequelize','exports','ENUM','customVariable','picklist'];(function(_0x3510bf,_0x35ee2c){var _0x28994b=function(_0x4c1223){while(--_0x4c1223){_0x3510bf['push'](_0x3510bf['shift']());}};_0x28994b(++_0x35ee2c);}(_0x1a23,0x17c));var _0x31a2=function(_0x593787,_0x499774){_0x593787=_0x593787-0x0;var _0x10a2bd=_0x1a23[_0x593787];return _0x10a2bd;};'use strict';var Sequelize=require(_0x31a2('0x0'));module[_0x31a2('0x1')]={'type':{'type':Sequelize[_0x31a2('0x2')]('string','variable',_0x31a2('0x3'),'keyValue',_0x31a2('0x4')),'defaultValue':_0x31a2('0x5')},'content':{'type':Sequelize[_0x31a2('0x6')]},'key':{'type':Sequelize[_0x31a2('0x6')]},'keyType':{'type':Sequelize[_0x31a2('0x2')](_0x31a2('0x5'),'variable',_0x31a2('0x3'))},'keyContent':{'type':Sequelize[_0x31a2('0x6')]},'idField':{'type':Sequelize[_0x31a2('0x6')]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 9d6aaf9..1ed9396 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 _0x32cf=['ejs','lodash','squel','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','filter','merge','where','map','VIRTUAL','options','SalesforceField','includeAll','include','rows','catch','params','length','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox'];(function(_0x24e893,_0x130483){var _0x437e82=function(_0x5dbb8c){while(--_0x5dbb8c){_0x24e893['push'](_0x24e893['shift']());}};_0x437e82(++_0x130483);}(_0x32cf,0x1b3));var _0xf32c=function(_0x725b8e,_0xc22b48){_0x725b8e=_0x725b8e-0x0;var _0x43ac45=_0x32cf[_0x725b8e];return _0x43ac45;};'use strict';var emlformat=require(_0xf32c('0x0'));var rimraf=require(_0xf32c('0x1'));var zipdir=require(_0xf32c('0x2'));var jsonpatch=require(_0xf32c('0x3'));var rp=require(_0xf32c('0x4'));var moment=require(_0xf32c('0x5'));var BPromise=require(_0xf32c('0x6'));var Mustache=require(_0xf32c('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf32c('0x8'));var csv=require('to-csv');var ejs=require(_0xf32c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf32c('0xa'));var squel=require(_0xf32c('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf32c('0xc'));var toCsv=require(_0xf32c('0xd'));var querystring=require(_0xf32c('0xe'));var Papa=require(_0xf32c('0xf'));var Redis=require('ioredis');var authService=require(_0xf32c('0x10'));var qs=require(_0xf32c('0x11'));var as=require(_0xf32c('0x12'));var hardwareService=require(_0xf32c('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xf32c('0x14'));var config=require(_0xf32c('0x15'));var licenseUtil=require(_0xf32c('0x16'));var db=require(_0xf32c('0x17'))['db'];function respondWithStatusCode(_0x5d8834,_0x5ad861){_0x5ad861=_0x5ad861||0xcc;return function(_0x5d11e1){if(_0x5d11e1){return _0x5d8834[_0xf32c('0x18')](_0x5ad861);}return _0x5d8834[_0xf32c('0x19')](_0x5ad861)['end']();};}function respondWithResult(_0xaea7e8,_0x1b67cc){_0x1b67cc=_0x1b67cc||0xc8;return function(_0x1925ee){if(_0x1925ee){return _0xaea7e8[_0xf32c('0x19')](_0x1b67cc)[_0xf32c('0x1a')](_0x1925ee);}};}function respondWithFilteredResult(_0x3eaeb2,_0x509f27){return function(_0x17843b){if(_0x17843b){var _0x36df27=typeof _0x509f27[_0xf32c('0x1b')]===_0xf32c('0x1c')&&typeof _0x509f27['limit']===_0xf32c('0x1c');var _0x20c7b8=_0x17843b[_0xf32c('0x1d')];var _0x431a3d=_0x36df27?0x0:_0x509f27[_0xf32c('0x1b')];var _0x4a1658=_0x36df27?_0x17843b[_0xf32c('0x1d')]:_0x509f27['offset']+_0x509f27['limit'];var _0x34b060;if(_0x4a1658>=_0x20c7b8){_0x4a1658=_0x20c7b8;_0x34b060=0xc8;}else{_0x34b060=0xce;}_0x3eaeb2[_0xf32c('0x19')](_0x34b060);return _0x3eaeb2['set'](_0xf32c('0x1e'),_0x431a3d+'-'+_0x4a1658+'/'+_0x20c7b8)[_0xf32c('0x1a')](_0x17843b);}return null;};}function patchUpdates(_0x5c3cbd){return function(_0x2d7107){try{jsonpatch[_0xf32c('0x1f')](_0x2d7107,_0x5c3cbd,!![]);}catch(_0x397489){return BPromise[_0xf32c('0x20')](_0x397489);}return _0x2d7107[_0xf32c('0x21')]();};}function saveUpdates(_0x4ec7b9,_0x5abddc){return function(_0x51ff83){if(_0x51ff83){return _0x51ff83[_0xf32c('0x22')](_0x4ec7b9)[_0xf32c('0x23')](function(_0x3cd923){return _0x3cd923;});}return null;};}function removeEntity(_0x2256c5,_0x2475a2){return function(_0x489d3b){if(_0x489d3b){return _0x489d3b['destroy']()[_0xf32c('0x23')](function(){_0x2256c5[_0xf32c('0x19')](0xcc)[_0xf32c('0x24')]();});}};}function handleEntityNotFound(_0x15dabf,_0x513c59){return function(_0xa90d57){if(!_0xa90d57){_0x15dabf['sendStatus'](0x194);}return _0xa90d57;};}function handleError(_0x15be38,_0x57ff4e){_0x57ff4e=_0x57ff4e||0x1f4;return function(_0x4564f3){logger[_0xf32c('0x25')](_0x4564f3[_0xf32c('0x26')]);if(_0x4564f3['name']){delete _0x4564f3[_0xf32c('0x27')];}_0x15be38['status'](_0x57ff4e)[_0xf32c('0x28')](_0x4564f3);};}exports['index']=function(_0x57d4d8,_0x43a91d){var _0x102226={},_0x303e89={},_0x41f914={'count':0x0,'rows':[]};var _0x16d5b3=_['map'](db['SalesforceField'][_0xf32c('0x29')],function(_0x225068){return{'name':_0x225068[_0xf32c('0x2a')],'type':_0x225068[_0xf32c('0x2b')][_0xf32c('0x2c')]};});_0x303e89[_0xf32c('0x2d')]=_['map'](_0x16d5b3,_0xf32c('0x27'));_0x303e89[_0xf32c('0x2e')]=_[_0xf32c('0x2f')](_0x57d4d8[_0xf32c('0x2e')]);_0x303e89[_0xf32c('0x30')]=_[_0xf32c('0x31')](_0x303e89[_0xf32c('0x2d')],_0x303e89[_0xf32c('0x2e')]);_0x102226[_0xf32c('0x32')]=_[_0xf32c('0x31')](_0x303e89['model'],qs['fields'](_0x57d4d8['query'][_0xf32c('0x33')]));_0x102226[_0xf32c('0x32')]=_0x102226[_0xf32c('0x32')]['length']?_0x102226[_0xf32c('0x32')]:_0x303e89['model'];if(!_0x57d4d8[_0xf32c('0x2e')][_0xf32c('0x34')](_0xf32c('0x35'))){_0x102226['limit']=qs[_0xf32c('0x36')](_0x57d4d8[_0xf32c('0x2e')]['limit']);_0x102226[_0xf32c('0x1b')]=qs[_0xf32c('0x1b')](_0x57d4d8[_0xf32c('0x2e')][_0xf32c('0x1b')]);}_0x102226[_0xf32c('0x37')]=qs[_0xf32c('0x38')](_0x57d4d8['query']['sort']);_0x102226['where']=qs['filters'](_['pick'](_0x57d4d8['query'],_0x303e89[_0xf32c('0x30')]),_0x16d5b3);if(_0x57d4d8[_0xf32c('0x2e')][_0xf32c('0x39')]){_0x102226['where']=_[_0xf32c('0x3a')](_0x102226[_0xf32c('0x3b')],{'$or':_[_0xf32c('0x3c')](_0x16d5b3,function(_0x68ed65){if(_0x68ed65[_0xf32c('0x2b')]!==_0xf32c('0x3d')){var _0x3814a0={};_0x3814a0[_0x68ed65[_0xf32c('0x27')]]={'$like':'%'+_0x57d4d8['query'][_0xf32c('0x39')]+'%'};return _0x3814a0;}})});}_0x102226=_[_0xf32c('0x3a')]({},_0x102226,_0x57d4d8[_0xf32c('0x3e')]);var _0x217664={'where':_0x102226[_0xf32c('0x3b')]};return db[_0xf32c('0x3f')][_0xf32c('0x1d')](_0x217664)[_0xf32c('0x23')](function(_0x251226){_0x41f914[_0xf32c('0x1d')]=_0x251226;if(_0x57d4d8[_0xf32c('0x2e')][_0xf32c('0x40')]){_0x102226[_0xf32c('0x41')]=[{'all':!![]}];}return db[_0xf32c('0x3f')]['findAll'](_0x102226);})[_0xf32c('0x23')](function(_0x19f70f){_0x41f914[_0xf32c('0x42')]=_0x19f70f;return _0x41f914;})['then'](respondWithFilteredResult(_0x43a91d,_0x102226))[_0xf32c('0x43')](handleError(_0x43a91d,null));};exports['show']=function(_0x51bcde,_0x4d4293){var _0x1a0fb8={'raw':!![],'where':{'id':_0x51bcde[_0xf32c('0x44')]['id']}},_0x35ff64={};_0x35ff64['model']=_['keys'](db[_0xf32c('0x3f')][_0xf32c('0x29')]);_0x35ff64[_0xf32c('0x2e')]=_[_0xf32c('0x2f')](_0x51bcde[_0xf32c('0x2e')]);_0x35ff64['filters']=_[_0xf32c('0x31')](_0x35ff64[_0xf32c('0x2d')],_0x35ff64[_0xf32c('0x2e')]);_0x1a0fb8[_0xf32c('0x32')]=_[_0xf32c('0x31')](_0x35ff64[_0xf32c('0x2d')],qs[_0xf32c('0x33')](_0x51bcde['query'][_0xf32c('0x33')]));_0x1a0fb8[_0xf32c('0x32')]=_0x1a0fb8[_0xf32c('0x32')][_0xf32c('0x45')]?_0x1a0fb8[_0xf32c('0x32')]:_0x35ff64[_0xf32c('0x2d')];if(_0x51bcde['query']['includeAll']){_0x1a0fb8[_0xf32c('0x41')]=[{'all':!![]}];}_0x1a0fb8=_[_0xf32c('0x3a')]({},_0x1a0fb8,_0x51bcde['options']);return db[_0xf32c('0x3f')][_0xf32c('0x46')](_0x1a0fb8)[_0xf32c('0x23')](handleEntityNotFound(_0x4d4293,null))[_0xf32c('0x23')](respondWithResult(_0x4d4293,null))['catch'](handleError(_0x4d4293,null));};exports[_0xf32c('0x47')]=function(_0x487168,_0x179d72){return db[_0xf32c('0x3f')][_0xf32c('0x47')](_0x487168[_0xf32c('0x48')],{})[_0xf32c('0x23')](respondWithResult(_0x179d72,0xc9))[_0xf32c('0x43')](handleError(_0x179d72,null));};exports[_0xf32c('0x22')]=function(_0x2f1c46,_0x25e2e1){if(_0x2f1c46[_0xf32c('0x48')]['id']){delete _0x2f1c46['body']['id'];}return db[_0xf32c('0x3f')]['find']({'where':{'id':_0x2f1c46[_0xf32c('0x44')]['id']}})[_0xf32c('0x23')](handleEntityNotFound(_0x25e2e1,null))[_0xf32c('0x23')](saveUpdates(_0x2f1c46['body'],null))[_0xf32c('0x23')](respondWithResult(_0x25e2e1,null))[_0xf32c('0x43')](handleError(_0x25e2e1,null));};exports[_0xf32c('0x49')]=function(_0x13288d,_0x36c065){return db['SalesforceField'][_0xf32c('0x46')]({'where':{'id':_0x13288d[_0xf32c('0x44')]['id']}})['then'](handleEntityNotFound(_0x36c065,null))[_0xf32c('0x23')](removeEntity(_0x36c065,null))[_0xf32c('0x43')](handleError(_0x36c065,null));}; \ No newline at end of file +var _0x436b=['../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','stack','name','send','index','map','SalesforceField','rawAttributes','fieldName','type','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','params','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x45c3ae,_0x2d1529){var _0x48e4b8=function(_0x54f9bf){while(--_0x54f9bf){_0x45c3ae['push'](_0x45c3ae['shift']());}};_0x48e4b8(++_0x2d1529);}(_0x436b,0x1ab));var _0xb436=function(_0x213f27,_0x2aa23c){_0x213f27=_0x213f27-0x0;var _0x16b479=_0x436b[_0x213f27];return _0x16b479;};'use strict';var emlformat=require(_0xb436('0x0'));var rimraf=require(_0xb436('0x1'));var zipdir=require(_0xb436('0x2'));var jsonpatch=require(_0xb436('0x3'));var rp=require(_0xb436('0x4'));var moment=require(_0xb436('0x5'));var BPromise=require(_0xb436('0x6'));var Mustache=require('mustache');var util=require(_0xb436('0x7'));var path=require(_0xb436('0x8'));var sox=require(_0xb436('0x9'));var csv=require(_0xb436('0xa'));var ejs=require(_0xb436('0xb'));var fs=require('fs');var fs_extra=require(_0xb436('0xc'));var _=require(_0xb436('0xd'));var squel=require('squel');var crypto=require(_0xb436('0xe'));var jsforce=require(_0xb436('0xf'));var deskjs=require(_0xb436('0x10'));var toCsv=require(_0xb436('0xa'));var querystring=require(_0xb436('0x11'));var Papa=require(_0xb436('0x12'));var Redis=require(_0xb436('0x13'));var authService=require(_0xb436('0x14'));var qs=require(_0xb436('0x15'));var as=require(_0xb436('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb436('0x17'))('api');var utils=require(_0xb436('0x18'));var config=require(_0xb436('0x19'));var licenseUtil=require(_0xb436('0x1a'));var db=require(_0xb436('0x1b'))['db'];function respondWithStatusCode(_0x4543cc,_0x3486db){_0x3486db=_0x3486db||0xcc;return function(_0x327131){if(_0x327131){return _0x4543cc[_0xb436('0x1c')](_0x3486db);}return _0x4543cc[_0xb436('0x1d')](_0x3486db)[_0xb436('0x1e')]();};}function respondWithResult(_0x468439,_0x569ea5){_0x569ea5=_0x569ea5||0xc8;return function(_0x569f9b){if(_0x569f9b){return _0x468439[_0xb436('0x1d')](_0x569ea5)[_0xb436('0x1f')](_0x569f9b);}};}function respondWithFilteredResult(_0x14f8ad,_0xbcb4c6){return function(_0x451e77){if(_0x451e77){var _0x102aaf=typeof _0xbcb4c6[_0xb436('0x20')]===_0xb436('0x21')&&typeof _0xbcb4c6[_0xb436('0x22')]===_0xb436('0x21');var _0x4f3798=_0x451e77['count'];var _0x46df7d=_0x102aaf?0x0:_0xbcb4c6[_0xb436('0x20')];var _0x42cf3d=_0x102aaf?_0x451e77[_0xb436('0x23')]:_0xbcb4c6[_0xb436('0x20')]+_0xbcb4c6[_0xb436('0x22')];var _0x2f57b7;if(_0x42cf3d>=_0x4f3798){_0x42cf3d=_0x4f3798;_0x2f57b7=0xc8;}else{_0x2f57b7=0xce;}_0x14f8ad['status'](_0x2f57b7);return _0x14f8ad[_0xb436('0x24')]('Content-Range',_0x46df7d+'-'+_0x42cf3d+'/'+_0x4f3798)[_0xb436('0x1f')](_0x451e77);}return null;};}function patchUpdates(_0x1fffe8){return function(_0x342e7b){try{jsonpatch[_0xb436('0x25')](_0x342e7b,_0x1fffe8,!![]);}catch(_0x4e1867){return BPromise[_0xb436('0x26')](_0x4e1867);}return _0x342e7b['save']();};}function saveUpdates(_0x4395be,_0x3b27e6){return function(_0x371b94){if(_0x371b94){return _0x371b94[_0xb436('0x27')](_0x4395be)[_0xb436('0x28')](function(_0x331411){return _0x331411;});}return null;};}function removeEntity(_0x47c112,_0xf95ee7){return function(_0x1d4729){if(_0x1d4729){return _0x1d4729[_0xb436('0x29')]()[_0xb436('0x28')](function(){_0x47c112[_0xb436('0x1d')](0xcc)[_0xb436('0x1e')]();});}};}function handleEntityNotFound(_0xff5708,_0x1cd056){return function(_0x353791){if(!_0x353791){_0xff5708[_0xb436('0x1c')](0x194);}return _0x353791;};}function handleError(_0xf658a4,_0x593ce5){_0x593ce5=_0x593ce5||0x1f4;return function(_0x44a2bf){logger['error'](_0x44a2bf[_0xb436('0x2a')]);if(_0x44a2bf[_0xb436('0x2b')]){delete _0x44a2bf['name'];}_0xf658a4[_0xb436('0x1d')](_0x593ce5)[_0xb436('0x2c')](_0x44a2bf);};}exports[_0xb436('0x2d')]=function(_0x3c18cb,_0x4e4881){var _0x56c0aa={},_0x32006f={},_0xa9c072={'count':0x0,'rows':[]};var _0x525148=_[_0xb436('0x2e')](db[_0xb436('0x2f')][_0xb436('0x30')],function(_0x342513){return{'name':_0x342513[_0xb436('0x31')],'type':_0x342513[_0xb436('0x32')]['key']};});_0x32006f[_0xb436('0x33')]=_[_0xb436('0x2e')](_0x525148,_0xb436('0x2b'));_0x32006f['query']=_[_0xb436('0x34')](_0x3c18cb['query']);_0x32006f[_0xb436('0x35')]=_[_0xb436('0x36')](_0x32006f['model'],_0x32006f[_0xb436('0x37')]);_0x56c0aa[_0xb436('0x38')]=_[_0xb436('0x36')](_0x32006f[_0xb436('0x33')],qs[_0xb436('0x39')](_0x3c18cb[_0xb436('0x37')]['fields']));_0x56c0aa[_0xb436('0x38')]=_0x56c0aa[_0xb436('0x38')][_0xb436('0x3a')]?_0x56c0aa['attributes']:_0x32006f['model'];if(!_0x3c18cb['query'][_0xb436('0x3b')](_0xb436('0x3c'))){_0x56c0aa['limit']=qs[_0xb436('0x22')](_0x3c18cb[_0xb436('0x37')][_0xb436('0x22')]);_0x56c0aa[_0xb436('0x20')]=qs[_0xb436('0x20')](_0x3c18cb[_0xb436('0x37')]['offset']);}_0x56c0aa['order']=qs['sort'](_0x3c18cb['query']['sort']);_0x56c0aa[_0xb436('0x3d')]=qs['filters'](_['pick'](_0x3c18cb['query'],_0x32006f[_0xb436('0x35')]),_0x525148);if(_0x3c18cb[_0xb436('0x37')][_0xb436('0x3e')]){_0x56c0aa[_0xb436('0x3d')]=_['merge'](_0x56c0aa['where'],{'$or':_['map'](_0x525148,function(_0x2aacc1){if(_0x2aacc1['type']!==_0xb436('0x3f')){var _0xdbf7d8={};_0xdbf7d8[_0x2aacc1[_0xb436('0x2b')]]={'$like':'%'+_0x3c18cb['query'][_0xb436('0x3e')]+'%'};return _0xdbf7d8;}})});}_0x56c0aa=_[_0xb436('0x40')]({},_0x56c0aa,_0x3c18cb[_0xb436('0x41')]);var _0x207dd0={'where':_0x56c0aa[_0xb436('0x3d')]};return db[_0xb436('0x2f')][_0xb436('0x23')](_0x207dd0)[_0xb436('0x28')](function(_0x1c8334){_0xa9c072[_0xb436('0x23')]=_0x1c8334;if(_0x3c18cb[_0xb436('0x37')][_0xb436('0x42')]){_0x56c0aa[_0xb436('0x43')]=[{'all':!![]}];}return db[_0xb436('0x2f')][_0xb436('0x44')](_0x56c0aa);})[_0xb436('0x28')](function(_0x4a05c2){_0xa9c072[_0xb436('0x45')]=_0x4a05c2;return _0xa9c072;})[_0xb436('0x28')](respondWithFilteredResult(_0x4e4881,_0x56c0aa))['catch'](handleError(_0x4e4881,null));};exports['show']=function(_0xda9231,_0x2d81bb){var _0x3ad98f={'raw':!![],'where':{'id':_0xda9231[_0xb436('0x46')]['id']}},_0x4e933e={};_0x4e933e['model']=_[_0xb436('0x34')](db[_0xb436('0x2f')]['rawAttributes']);_0x4e933e['query']=_[_0xb436('0x34')](_0xda9231[_0xb436('0x37')]);_0x4e933e[_0xb436('0x35')]=_[_0xb436('0x36')](_0x4e933e[_0xb436('0x33')],_0x4e933e['query']);_0x3ad98f[_0xb436('0x38')]=_[_0xb436('0x36')](_0x4e933e[_0xb436('0x33')],qs[_0xb436('0x39')](_0xda9231[_0xb436('0x37')][_0xb436('0x39')]));_0x3ad98f[_0xb436('0x38')]=_0x3ad98f[_0xb436('0x38')][_0xb436('0x3a')]?_0x3ad98f[_0xb436('0x38')]:_0x4e933e[_0xb436('0x33')];if(_0xda9231['query'][_0xb436('0x42')]){_0x3ad98f['include']=[{'all':!![]}];}_0x3ad98f=_[_0xb436('0x40')]({},_0x3ad98f,_0xda9231[_0xb436('0x41')]);return db[_0xb436('0x2f')][_0xb436('0x47')](_0x3ad98f)[_0xb436('0x28')](handleEntityNotFound(_0x2d81bb,null))[_0xb436('0x28')](respondWithResult(_0x2d81bb,null))[_0xb436('0x48')](handleError(_0x2d81bb,null));};exports['create']=function(_0x3b52ca,_0x54de54){return db[_0xb436('0x2f')][_0xb436('0x49')](_0x3b52ca['body'],{})['then'](respondWithResult(_0x54de54,0xc9))[_0xb436('0x48')](handleError(_0x54de54,null));};exports[_0xb436('0x27')]=function(_0x418659,_0x402d45){if(_0x418659[_0xb436('0x4a')]['id']){delete _0x418659[_0xb436('0x4a')]['id'];}return db[_0xb436('0x2f')][_0xb436('0x47')]({'where':{'id':_0x418659[_0xb436('0x46')]['id']}})['then'](handleEntityNotFound(_0x402d45,null))[_0xb436('0x28')](saveUpdates(_0x418659[_0xb436('0x4a')],null))[_0xb436('0x28')](respondWithResult(_0x402d45,null))['catch'](handleError(_0x402d45,null));};exports[_0xb436('0x29')]=function(_0x3d7a7d,_0x53aaa0){return db[_0xb436('0x2f')][_0xb436('0x47')]({'where':{'id':_0x3d7a7d[_0xb436('0x46')]['id']}})['then'](handleEntityNotFound(_0x53aaa0,null))[_0xb436('0x28')](removeEntity(_0x53aaa0,null))[_0xb436('0x48')](handleError(_0x53aaa0,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 7de3647..8756768 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 _0xfae4=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields','idField','FieldId','lodash','util'];(function(_0x8de54f,_0x271987){var _0x14cba4=function(_0x58ed41){while(--_0x58ed41){_0x8de54f['push'](_0x8de54f['shift']());}};_0x14cba4(++_0x271987);}(_0xfae4,0x1ce));var _0x4fae=function(_0x4876fa,_0x4d4906){_0x4876fa=_0x4876fa-0x0;var _0x176cf6=_0xfae4[_0x4876fa];return _0x176cf6;};'use strict';var _=require(_0x4fae('0x0'));var util=require(_0x4fae('0x1'));var logger=require(_0x4fae('0x2'))(_0x4fae('0x3'));var moment=require(_0x4fae('0x4'));var BPromise=require(_0x4fae('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4fae('0x6'));var rimraf=require(_0x4fae('0x7'));var config=require(_0x4fae('0x8'));var attributes=require(_0x4fae('0x9'));module[_0x4fae('0xa')]=function(_0x4d7568,_0x42b16b){return _0x4d7568[_0x4fae('0xb')](_0x4fae('0xc'),attributes,{'tableName':_0x4fae('0xd'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0x4fae('0xe'),_0x4fae('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9d9c=['idField','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceField.attributes','exports','SalesforceField','int_salesforce_fields'];(function(_0x531ec4,_0x203380){var _0x43fd6f=function(_0x350608){while(--_0x350608){_0x531ec4['push'](_0x531ec4['shift']());}};_0x43fd6f(++_0x203380);}(_0x9d9c,0x15a));var _0xc9d9=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x9d9c[_0x27af45];return _0x18df21;};'use strict';var _=require(_0xc9d9('0x0'));var util=require(_0xc9d9('0x1'));var logger=require(_0xc9d9('0x2'))(_0xc9d9('0x3'));var moment=require(_0xc9d9('0x4'));var BPromise=require(_0xc9d9('0x5'));var rp=require(_0xc9d9('0x6'));var fs=require('fs');var path=require(_0xc9d9('0x7'));var rimraf=require(_0xc9d9('0x8'));var config=require(_0xc9d9('0x9'));var attributes=require(_0xc9d9('0xa'));module[_0xc9d9('0xb')]=function(_0xee29cb,_0x261340){return _0xee29cb['define'](_0xc9d9('0xc'),attributes,{'tableName':_0xc9d9('0xd'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0xc9d9('0xe'),'FieldId'],'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 eaa3ea0..4ec7a71 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 _0x06e4=['message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1a843a,_0xf30d95){var _0x1025a7=function(_0x2da2dd){while(--_0x2da2dd){_0x1a843a['push'](_0x1a843a['shift']());}};_0x1025a7(++_0xf30d95);}(_0x06e4,0x163));var _0x406e=function(_0xe58ae2,_0x30a065){_0xe58ae2=_0xe58ae2-0x0;var _0x369b69=_0x06e4[_0xe58ae2];return _0x369b69;};'use strict';var _=require(_0x406e('0x0'));var util=require(_0x406e('0x1'));var moment=require('moment');var BPromise=require(_0x406e('0x2'));var rs=require(_0x406e('0x3'));var fs=require('fs');var Redis=require(_0x406e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x406e('0x5'));var logger=require('../../config/logger')(_0x406e('0x6'));var config=require(_0x406e('0x7'));var jayson=require(_0x406e('0x8'));var client=jayson['client'][_0x406e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2adac1,_0x2f8c89,_0xfe8b96){return new BPromise(function(_0x17064,_0x199481){return client['request'](_0x2adac1,_0xfe8b96)[_0x406e('0xa')](function(_0x4a71ba){logger[_0x406e('0xb')](_0x406e('0xc'),_0x2f8c89,_0x406e('0xd'));logger[_0x406e('0xe')](_0x406e('0xf'),_0x2f8c89,_0x406e('0xd'),JSON[_0x406e('0x10')](_0x4a71ba));if(_0x4a71ba['error']){if(_0x4a71ba[_0x406e('0x11')][_0x406e('0x12')]===0x1f4){logger[_0x406e('0x11')](_0x406e('0xc'),_0x2f8c89,_0x4a71ba[_0x406e('0x11')][_0x406e('0x13')]);return _0x199481(_0x4a71ba[_0x406e('0x11')][_0x406e('0x13')]);}logger[_0x406e('0x11')](_0x406e('0xc'),_0x2f8c89,_0x4a71ba[_0x406e('0x11')][_0x406e('0x13')]);return _0x17064(_0x4a71ba[_0x406e('0x11')][_0x406e('0x13')]);}else{logger['info']('SalesforceField,\x20%s,\x20%s',_0x2f8c89,_0x406e('0xd'));_0x17064(_0x4a71ba[_0x406e('0x14')][_0x406e('0x13')]);}})[_0x406e('0x15')](function(_0x370797){logger[_0x406e('0x11')](_0x406e('0xc'),_0x2f8c89,_0x370797);_0x199481(_0x370797);});});} \ No newline at end of file +var _0xec32=['SalesforceField,\x20%s,\x20%s','debug','SalesforceField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x1a161f,_0x49f589){var _0x53ecc3=function(_0x228553){while(--_0x228553){_0x1a161f['push'](_0x1a161f['shift']());}};_0x53ecc3(++_0x49f589);}(_0xec32,0x175));var _0x2ec3=function(_0x4c9ba2,_0x33461f){_0x4c9ba2=_0x4c9ba2-0x0;var _0x151260=_0xec32[_0x4c9ba2];return _0x151260;};'use strict';var _=require(_0x2ec3('0x0'));var util=require(_0x2ec3('0x1'));var moment=require(_0x2ec3('0x2'));var BPromise=require(_0x2ec3('0x3'));var rs=require(_0x2ec3('0x4'));var fs=require('fs');var Redis=require(_0x2ec3('0x5'));var db=require(_0x2ec3('0x6'))['db'];var utils=require(_0x2ec3('0x7'));var logger=require(_0x2ec3('0x8'))(_0x2ec3('0x9'));var config=require(_0x2ec3('0xa'));var jayson=require(_0x2ec3('0xb'));var client=jayson[_0x2ec3('0xc')][_0x2ec3('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x293ca9,_0x229bec,_0x1b21d4){return new BPromise(function(_0x57e9b9,_0x1f791f){return client[_0x2ec3('0xe')](_0x293ca9,_0x1b21d4)[_0x2ec3('0xf')](function(_0x13447f){logger[_0x2ec3('0x10')](_0x2ec3('0x11'),_0x229bec,'request\x20sent');logger[_0x2ec3('0x12')](_0x2ec3('0x13'),_0x229bec,_0x2ec3('0x14'),JSON[_0x2ec3('0x15')](_0x13447f));if(_0x13447f['error']){if(_0x13447f['error'][_0x2ec3('0x16')]===0x1f4){logger[_0x2ec3('0x17')](_0x2ec3('0x11'),_0x229bec,_0x13447f[_0x2ec3('0x17')]['message']);return _0x1f791f(_0x13447f[_0x2ec3('0x17')]['message']);}logger[_0x2ec3('0x17')](_0x2ec3('0x11'),_0x229bec,_0x13447f[_0x2ec3('0x17')][_0x2ec3('0x18')]);return _0x57e9b9(_0x13447f[_0x2ec3('0x17')]['message']);}else{logger[_0x2ec3('0x10')](_0x2ec3('0x11'),_0x229bec,_0x2ec3('0x14'));_0x57e9b9(_0x13447f[_0x2ec3('0x19')][_0x2ec3('0x18')]);}})['catch'](function(_0x546dab){logger[_0x2ec3('0x17')](_0x2ec3('0x11'),_0x229bec,_0x546dab);_0x1f791f(_0x546dab);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 0281247..0c3cd7c 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 _0x26bc=['getConfigurations','/:id/fields','getFields','create','post','addConfiguration','/:id','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intServicenowAccount.controller','isAuthenticated','index','get','show','/:id/configurations'];(function(_0x50499c,_0x188984){var _0xd422b3=function(_0x35e6cf){while(--_0x35e6cf){_0x50499c['push'](_0x50499c['shift']());}};_0xd422b3(++_0x188984);}(_0x26bc,0x162));var _0xc26b=function(_0x7a57c6,_0x18f747){_0x7a57c6=_0x7a57c6-0x0;var _0x14fb82=_0x26bc[_0x7a57c6];return _0x14fb82;};'use strict';var multer=require(_0xc26b('0x0'));var util=require(_0xc26b('0x1'));var path=require(_0xc26b('0x2'));var timeout=require(_0xc26b('0x3'));var express=require(_0xc26b('0x4'));var router=express['Router']();var fs_extra=require(_0xc26b('0x5'));var auth=require(_0xc26b('0x6'));var interaction=require(_0xc26b('0x7'));var config=require('../../config/environment');var controller=require(_0xc26b('0x8'));router['get']('/',auth[_0xc26b('0x9')](),controller[_0xc26b('0xa')]);router[_0xc26b('0xb')]('/:id',auth[_0xc26b('0x9')](),controller[_0xc26b('0xc')]);router[_0xc26b('0xb')](_0xc26b('0xd'),auth[_0xc26b('0x9')](),controller[_0xc26b('0xe')]);router[_0xc26b('0xb')](_0xc26b('0xf'),auth[_0xc26b('0x9')](),controller[_0xc26b('0x10')]);router['post']('/',auth[_0xc26b('0x9')](),controller[_0xc26b('0x11')]);router[_0xc26b('0x12')](_0xc26b('0xd'),auth[_0xc26b('0x9')](),controller[_0xc26b('0x13')]);router['put'](_0xc26b('0x14'),auth['isAuthenticated'](),controller['update']);router[_0xc26b('0x15')](_0xc26b('0x14'),auth[_0xc26b('0x9')](),controller[_0xc26b('0x16')]);module['exports']=router; \ No newline at end of file +var _0x20b4=['update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/configurations','/:id/fields','getFields','create','post','addConfiguration','put'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x20b4,0x146));var _0x420b=function(_0x1c3386,_0x2868c0){_0x1c3386=_0x1c3386-0x0;var _0x2cc8e9=_0x20b4[_0x1c3386];return _0x2cc8e9;};'use strict';var multer=require(_0x420b('0x0'));var util=require(_0x420b('0x1'));var path=require(_0x420b('0x2'));var timeout=require(_0x420b('0x3'));var express=require('express');var router=express[_0x420b('0x4')]();var fs_extra=require(_0x420b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x420b('0x6'));var config=require(_0x420b('0x7'));var controller=require('./intServicenowAccount.controller');router[_0x420b('0x8')]('/',auth[_0x420b('0x9')](),controller[_0x420b('0xa')]);router[_0x420b('0x8')](_0x420b('0xb'),auth[_0x420b('0x9')](),controller['show']);router[_0x420b('0x8')](_0x420b('0xc'),auth[_0x420b('0x9')](),controller['getConfigurations']);router[_0x420b('0x8')](_0x420b('0xd'),auth[_0x420b('0x9')](),controller[_0x420b('0xe')]);router['post']('/',auth[_0x420b('0x9')](),controller[_0x420b('0xf')]);router[_0x420b('0x10')](_0x420b('0xc'),auth[_0x420b('0x9')](),controller[_0x420b('0x11')]);router[_0x420b('0x12')](_0x420b('0xb'),auth[_0x420b('0x9')](),controller[_0x420b('0x13')]);router[_0x420b('0x14')](_0x420b('0xb'),auth['isAuthenticated'](),controller[_0x420b('0x15')]);module[_0x420b('0x16')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 65830df..c73f828 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 _0x21a5=['STRING','sequelize'];(function(_0x499693,_0xa317be){var _0x37c104=function(_0x53e906){while(--_0x53e906){_0x499693['push'](_0x499693['shift']());}};_0x37c104(++_0xa317be);}(_0x21a5,0x197));var _0x521a=function(_0x11e05d,_0x3a4491){_0x11e05d=_0x11e05d-0x0;var _0x335588=_0x21a5[_0x11e05d];return _0x335588;};'use strict';var Sequelize=require(_0x521a('0x0'));module['exports']={'name':{'type':Sequelize[_0x521a('0x1')]},'description':{'type':Sequelize[_0x521a('0x1')]},'username':{'type':Sequelize[_0x521a('0x1')],'unique':'username'},'password':{'type':Sequelize[_0x521a('0x1')]},'email':{'type':Sequelize[_0x521a('0x1')]},'remoteUri':{'type':Sequelize[_0x521a('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x2584=['STRING','username'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2584,0x1ec));var _0x4258=function(_0x7791d5,_0xdab65f){_0x7791d5=_0x7791d5-0x0;var _0x5ce288=_0x2584[_0x7791d5];return _0x5ce288;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4258('0x0')]},'description':{'type':Sequelize[_0x4258('0x0')]},'username':{'type':Sequelize[_0x4258('0x0')],'unique':_0x4258('0x1')},'password':{'type':Sequelize[_0x4258('0x0')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x4258('0x0')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x4258('0x0')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index d2695f5..b29280e 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 _0x279a=['key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','find','create','body','getConfigurations','findOne','ServicenowConfiguration','order','map','catch','addConfiguration','Subjects','getSubjects','channel','Descriptions','ServicenowField','getFields','incident_state','severity','category','parent','made_sla','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','number','resolved_by','sys_updated_by','user_input','sys_created_on','state','sys_created_by','knowledge','closed_at','cmdb_ci','delivery_plan','sys_domain_path','rfc','time_worked','opened_at','business_duration','group_list','reopened_time','resolved_at','caller_id','subcategory','short_description','close_code','correlation_display','delivery_task','work_start','assignment_group','description','calendar_duration','sys_class_name','closed_by','reopened_by','problem_id','company','reassignment_count','activity_due','assigned_to','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','escalation','upon_approval','location','username','email','remoteUri','serverUrl','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','password','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','includes','forEach','internalType','all','TCL:\x20_object','remove','label','push','ServiceNow\x20error:\x20','test','statusCode','error','stack','Wrong\x20credentials','True','true','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../components/integrations/configuration','sendStatus','status','offset','limit','undefined','count','set','json','reject','save','update','then','destroy','name','send','index','ServicenowAccount','rawAttributes','type'];(function(_0x3bfa6f,_0x4e5948){var _0x56e02e=function(_0x4e83f3){while(--_0x4e83f3){_0x3bfa6f['push'](_0x3bfa6f['shift']());}};_0x56e02e(++_0x4e5948);}(_0x279a,0x84));var _0xa279=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x279a[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xa279('0x0'));var rimraf=require(_0xa279('0x1'));var zipdir=require(_0xa279('0x2'));var jsonpatch=require(_0xa279('0x3'));var rp=require(_0xa279('0x4'));var moment=require(_0xa279('0x5'));var BPromise=require(_0xa279('0x6'));var Mustache=require(_0xa279('0x7'));var util=require(_0xa279('0x8'));var path=require(_0xa279('0x9'));var sox=require(_0xa279('0xa'));var csv=require(_0xa279('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa279('0xc'));var _=require(_0xa279('0xd'));var squel=require(_0xa279('0xe'));var crypto=require('crypto');var jsforce=require(_0xa279('0xf'));var deskjs=require(_0xa279('0x10'));var toCsv=require('to-csv');var querystring=require(_0xa279('0x11'));var Papa=require('papaparse');var Redis=require(_0xa279('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xa279('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa279('0x14'))('api');var utils=require(_0xa279('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xa279('0x16'));function respondWithStatusCode(_0x4ace02,_0xaf7096){_0xaf7096=_0xaf7096||0xcc;return function(_0x12c988){if(_0x12c988){return _0x4ace02[_0xa279('0x17')](_0xaf7096);}return _0x4ace02[_0xa279('0x18')](_0xaf7096)['end']();};}function respondWithResult(_0x308927,_0x5377d){_0x5377d=_0x5377d||0xc8;return function(_0x1eeddc){if(_0x1eeddc){return _0x308927[_0xa279('0x18')](_0x5377d)['json'](_0x1eeddc);}};}function respondWithFilteredResult(_0x2e5e99,_0x16aec){return function(_0x15a527){if(_0x15a527){var _0x2bd4d1=typeof _0x16aec[_0xa279('0x19')]==='undefined'&&typeof _0x16aec[_0xa279('0x1a')]===_0xa279('0x1b');var _0x33a3a2=_0x15a527[_0xa279('0x1c')];var _0x5aab76=_0x2bd4d1?0x0:_0x16aec['offset'];var _0x3fcb7a=_0x2bd4d1?_0x15a527[_0xa279('0x1c')]:_0x16aec[_0xa279('0x19')]+_0x16aec[_0xa279('0x1a')];var _0x2cbe8a;if(_0x3fcb7a>=_0x33a3a2){_0x3fcb7a=_0x33a3a2;_0x2cbe8a=0xc8;}else{_0x2cbe8a=0xce;}_0x2e5e99[_0xa279('0x18')](_0x2cbe8a);return _0x2e5e99[_0xa279('0x1d')]('Content-Range',_0x5aab76+'-'+_0x3fcb7a+'/'+_0x33a3a2)[_0xa279('0x1e')](_0x15a527);}return null;};}function patchUpdates(_0x1a8990){return function(_0x4ed927){try{jsonpatch['apply'](_0x4ed927,_0x1a8990,!![]);}catch(_0x280507){return BPromise[_0xa279('0x1f')](_0x280507);}return _0x4ed927[_0xa279('0x20')]();};}function saveUpdates(_0x4ff6bb,_0x38dba9){return function(_0x2a3f4d){if(_0x2a3f4d){return _0x2a3f4d[_0xa279('0x21')](_0x4ff6bb)[_0xa279('0x22')](function(_0x68dbe3){return _0x68dbe3;});}return null;};}function removeEntity(_0x1eae08,_0x73d41){return function(_0x42aeff){if(_0x42aeff){return _0x42aeff[_0xa279('0x23')]()[_0xa279('0x22')](function(){_0x1eae08[_0xa279('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0xb801b3,_0xb58bec){return function(_0x588371){if(!_0x588371){_0xb801b3['sendStatus'](0x194);}return _0x588371;};}function handleError(_0x297245,_0x413973){_0x413973=_0x413973||0x1f4;return function(_0x55edfb){logger['error'](_0x55edfb['stack']);if(_0x55edfb['name']){delete _0x55edfb[_0xa279('0x24')];}_0x297245[_0xa279('0x18')](_0x413973)[_0xa279('0x25')](_0x55edfb);};}exports[_0xa279('0x26')]=function(_0x570cc1,_0x3d2701){var _0xb17878={},_0x138e34={},_0x89a5db={'count':0x0,'rows':[]};var _0x3f7470=_['map'](db[_0xa279('0x27')][_0xa279('0x28')],function(_0x2f639c){return{'name':_0x2f639c['fieldName'],'type':_0x2f639c[_0xa279('0x29')][_0xa279('0x2a')]};});_0x138e34[_0xa279('0x2b')]=_['map'](_0x3f7470,_0xa279('0x24'));_0x138e34['query']=_[_0xa279('0x2c')](_0x570cc1[_0xa279('0x2d')]);_0x138e34['filters']=_['intersection'](_0x138e34[_0xa279('0x2b')],_0x138e34[_0xa279('0x2d')]);_0xb17878['attributes']=_[_0xa279('0x2e')](_0x138e34[_0xa279('0x2b')],qs[_0xa279('0x2f')](_0x570cc1['query'][_0xa279('0x2f')]));_0xb17878['attributes']=_0xb17878[_0xa279('0x30')][_0xa279('0x31')]?_0xb17878[_0xa279('0x30')]:_0x138e34[_0xa279('0x2b')];if(!_0x570cc1[_0xa279('0x2d')][_0xa279('0x32')](_0xa279('0x33'))){_0xb17878[_0xa279('0x1a')]=qs[_0xa279('0x1a')](_0x570cc1[_0xa279('0x2d')][_0xa279('0x1a')]);_0xb17878['offset']=qs['offset'](_0x570cc1[_0xa279('0x2d')]['offset']);}_0xb17878['order']=qs[_0xa279('0x34')](_0x570cc1['query'][_0xa279('0x34')]);_0xb17878['where']=qs[_0xa279('0x35')](_[_0xa279('0x36')](_0x570cc1[_0xa279('0x2d')],_0x138e34[_0xa279('0x35')]),_0x3f7470);if(_0x570cc1[_0xa279('0x2d')][_0xa279('0x37')]){_0xb17878['where']=_['merge'](_0xb17878[_0xa279('0x38')],{'$or':_['map'](_0x3f7470,function(_0x3f4e67){if(_0x3f4e67[_0xa279('0x29')]!==_0xa279('0x39')){var _0x4f8358={};_0x4f8358[_0x3f4e67[_0xa279('0x24')]]={'$like':'%'+_0x570cc1[_0xa279('0x2d')][_0xa279('0x37')]+'%'};return _0x4f8358;}})});}_0xb17878=_[_0xa279('0x3a')]({},_0xb17878,_0x570cc1[_0xa279('0x3b')]);var _0x75890f={'where':_0xb17878[_0xa279('0x38')]};return db[_0xa279('0x27')][_0xa279('0x1c')](_0x75890f)[_0xa279('0x22')](function(_0x414368){_0x89a5db[_0xa279('0x1c')]=_0x414368;if(_0x570cc1[_0xa279('0x2d')][_0xa279('0x3c')]){_0xb17878[_0xa279('0x3d')]=[{'all':!![]}];}return db[_0xa279('0x27')][_0xa279('0x3e')](_0xb17878);})[_0xa279('0x22')](function(_0x21e96f){_0x89a5db[_0xa279('0x3f')]=_0x21e96f;return _0x89a5db;})[_0xa279('0x22')](respondWithFilteredResult(_0x3d2701,_0xb17878))['catch'](handleError(_0x3d2701,null));};exports[_0xa279('0x40')]=function(_0x2b46dc,_0x289fba){var _0x5644ce={'raw':![],'where':{'id':_0x2b46dc[_0xa279('0x41')]['id']}},_0x5c5394={};_0x5c5394[_0xa279('0x2b')]=_[_0xa279('0x2c')](db[_0xa279('0x27')][_0xa279('0x28')]);_0x5c5394[_0xa279('0x2d')]=_[_0xa279('0x2c')](_0x2b46dc[_0xa279('0x2d')]);_0x5c5394['filters']=_['intersection'](_0x5c5394[_0xa279('0x2b')],_0x5c5394[_0xa279('0x2d')]);_0x5644ce[_0xa279('0x30')]=_['intersection'](_0x5c5394[_0xa279('0x2b')],qs[_0xa279('0x2f')](_0x2b46dc[_0xa279('0x2d')][_0xa279('0x2f')]));_0x5644ce[_0xa279('0x30')]=_0x5644ce[_0xa279('0x30')][_0xa279('0x31')]?_0x5644ce['attributes']:_0x5c5394[_0xa279('0x2b')];if(_0x2b46dc[_0xa279('0x2d')][_0xa279('0x3c')]){_0x5644ce[_0xa279('0x3d')]=[{'all':!![]}];}_0x5644ce=_['merge']({},_0x5644ce,_0x2b46dc[_0xa279('0x3b')]);return db[_0xa279('0x27')][_0xa279('0x42')](_0x5644ce)[_0xa279('0x22')](handleEntityNotFound(_0x289fba,null))[_0xa279('0x22')](respondWithResult(_0x289fba,null))['catch'](handleError(_0x289fba,null));};exports['create']=function(_0xe446e5,_0x2768e3){return db[_0xa279('0x27')][_0xa279('0x43')](_0xe446e5['body'],{})[_0xa279('0x22')](respondWithResult(_0x2768e3,0xc9))['catch'](handleError(_0x2768e3,null));};exports[_0xa279('0x21')]=function(_0x569417,_0x1d6d1d){if(_0x569417[_0xa279('0x44')]['id']){delete _0x569417[_0xa279('0x44')]['id'];}return db[_0xa279('0x27')][_0xa279('0x42')]({'where':{'id':_0x569417[_0xa279('0x41')]['id']}})[_0xa279('0x22')](handleEntityNotFound(_0x1d6d1d,null))[_0xa279('0x22')](saveUpdates(_0x569417[_0xa279('0x44')],null))[_0xa279('0x22')](respondWithResult(_0x1d6d1d,null))['catch'](handleError(_0x1d6d1d,null));};exports[_0xa279('0x23')]=function(_0x2275df,_0x5554be){return db['ServicenowAccount'][_0xa279('0x42')]({'where':{'id':_0x2275df['params']['id']}})['then'](handleEntityNotFound(_0x5554be,null))[_0xa279('0x22')](removeEntity(_0x5554be,null))['catch'](handleError(_0x5554be,null));};exports[_0xa279('0x45')]=function(_0x175001,_0x3379fe,_0x34d91a){var _0x191565={};var _0x24f02f={};var _0x190b85;var _0x1cd2cc;return db[_0xa279('0x27')][_0xa279('0x46')]({'where':{'id':_0x175001[_0xa279('0x41')]['id']}})[_0xa279('0x22')](handleEntityNotFound(_0x3379fe,null))[_0xa279('0x22')](function(_0x52af92){if(_0x52af92){_0x190b85=_0x52af92;_0x24f02f[_0xa279('0x2b')]=_[_0xa279('0x2c')](db[_0xa279('0x47')][_0xa279('0x28')]);_0x24f02f[_0xa279('0x2d')]=_[_0xa279('0x2c')](_0x175001[_0xa279('0x2d')]);_0x24f02f[_0xa279('0x35')]=_['intersection'](_0x24f02f[_0xa279('0x2b')],_0x24f02f[_0xa279('0x2d')]);_0x191565[_0xa279('0x30')]=_['intersection'](_0x24f02f[_0xa279('0x2b')],qs['fields'](_0x175001[_0xa279('0x2d')][_0xa279('0x2f')]));_0x191565['attributes']=_0x191565[_0xa279('0x30')]['length']?_0x191565['attributes']:_0x24f02f[_0xa279('0x2b')];_0x191565[_0xa279('0x48')]=qs[_0xa279('0x34')](_0x175001[_0xa279('0x2d')][_0xa279('0x34')]);_0x191565[_0xa279('0x38')]=qs[_0xa279('0x35')](_['pick'](_0x175001[_0xa279('0x2d')],_0x24f02f[_0xa279('0x35')]));if(_0x175001['query']['filter']){_0x191565[_0xa279('0x38')]=_['merge'](_0x191565[_0xa279('0x38')],{'$or':_[_0xa279('0x49')](_0x191565[_0xa279('0x30')],function(_0x3394a1){var _0x132967={};_0x132967[_0x3394a1]={'$like':'%'+_0x175001[_0xa279('0x2d')]['filter']+'%'};return _0x132967;})});}_0x191565=_[_0xa279('0x3a')]({},_0x191565,_0x175001[_0xa279('0x3b')]);return _0x190b85['getConfigurations'](_0x191565);}})[_0xa279('0x22')](function(_0x5d5bcd){if(_0x5d5bcd){_0x1cd2cc=_0x5d5bcd[_0xa279('0x31')];if(!_0x175001[_0xa279('0x2d')][_0xa279('0x32')]('nolimit')){_0x191565[_0xa279('0x1a')]=qs['limit'](_0x175001[_0xa279('0x2d')][_0xa279('0x1a')]);_0x191565['offset']=qs[_0xa279('0x19')](_0x175001[_0xa279('0x2d')][_0xa279('0x19')]);}return _0x190b85[_0xa279('0x45')](_0x191565);}})['then'](function(_0x24cdf0){if(_0x24cdf0){return _0x24cdf0?{'count':_0x1cd2cc,'rows':_0x24cdf0}:null;}})[_0xa279('0x22')](respondWithResult(_0x3379fe,null))[_0xa279('0x4a')](handleError(_0x3379fe,null));};exports[_0xa279('0x4b')]=function(_0x390463,_0x1edd12,_0x1945dc){if(_0x390463[_0xa279('0x44')]['id']){delete _0x390463['body']['id'];}return db[_0xa279('0x27')][_0xa279('0x46')]({'where':{'id':_0x390463[_0xa279('0x41')]['id']}})[_0xa279('0x22')](handleEntityNotFound(_0x1edd12,null))[_0xa279('0x22')](function(_0x7632e8){if(_0x7632e8){_0x390463[_0xa279('0x44')]['AccountId']=_0x7632e8['id'];_0x390463['body'][_0xa279('0x4c')]=integrations[_0xa279('0x4d')](_0x390463[_0xa279('0x44')][_0xa279('0x4e')],_0x390463[_0xa279('0x44')]['type']);_0x390463[_0xa279('0x44')][_0xa279('0x4f')]=integrations['getDescriptions'](_0x390463[_0xa279('0x44')][_0xa279('0x4e')],_0x390463['body'][_0xa279('0x29')]);return db[_0xa279('0x47')]['create'](_0x390463[_0xa279('0x44')],{'include':[{'model':db[_0xa279('0x50')],'as':'Subjects'},{'model':db['ServicenowField'],'as':_0xa279('0x4f')}]});}return null;})[_0xa279('0x22')](respondWithResult(_0x1edd12,null))[_0xa279('0x4a')](handleError(_0x1edd12,null));};exports[_0xa279('0x51')]=function(_0x375db0,_0x54ec5d,_0x4b5f99){var _0x26478c=['made_sla','hold_reason','knowledge','subcategory','close_code','notify',_0xa279('0x52'),_0xa279('0x53'),_0xa279('0x54')];var _0x496b7d=[_0xa279('0x55'),_0xa279('0x56'),_0xa279('0x57'),_0xa279('0x58'),_0xa279('0x59'),_0xa279('0x5a'),_0xa279('0x5b'),'hold_reason','approval_history',_0xa279('0x5c'),_0xa279('0x5d'),_0xa279('0x5e'),'opened_by',_0xa279('0x5f'),_0xa279('0x60'),'sys_domain',_0xa279('0x61'),_0xa279('0x62'),_0xa279('0x63'),_0xa279('0x48'),'calendar_stc',_0xa279('0x64'),_0xa279('0x65'),_0xa279('0x66'),'impact','active','work_notes_list','business_service','priority',_0xa279('0x67'),_0xa279('0x68'),_0xa279('0x69'),'expected_start',_0xa279('0x6a'),_0xa279('0x6b'),_0xa279('0x6c'),'work_end',_0xa279('0x6d'),_0xa279('0x6e'),_0xa279('0x6f'),'approval_set',_0xa279('0x70'),'work_notes',_0xa279('0x71'),_0xa279('0x72'),_0xa279('0x73'),_0xa279('0x74'),_0xa279('0x75'),_0xa279('0x76'),'business_stc','additional_assignee_list',_0xa279('0x77'),_0xa279('0x78'),'notify',_0xa279('0x79'),'close_notes',_0xa279('0x7a'),'follow_up','parent_incident','sys_id','contact_type',_0xa279('0x7b'),_0xa279('0x52'),'urgency',_0xa279('0x7c'),_0xa279('0x7d'),_0xa279('0x7e'),_0xa279('0x7f'),_0xa279('0x80'),_0xa279('0x53'),'comments',_0xa279('0x81'),_0xa279('0x82'),_0xa279('0x83'),_0xa279('0x84'),_0xa279('0x85'),_0xa279('0x86'),'sys_tags',_0xa279('0x87'),_0xa279('0x88'),'correlation_id',_0xa279('0x89'),_0xa279('0x54')];var _0x1ef3ba='';var _0x286651='';var _0x517c36=[];var _0x4d67f7='';var _0x45cb38='';var _0x2e81c6=[];var _0x378dc7='';var _0xbd3ef5='';var _0x370785={};var _0x437935='';return db['ServicenowAccount'][_0xa279('0x46')]({'where':{'id':_0x375db0['params']['id']},'attributes':['id',_0xa279('0x8a'),'password',_0xa279('0x8b'),_0xa279('0x8c'),_0xa279('0x8d')]})[_0xa279('0x22')](handleEntityNotFound(_0x54ec5d,null))[_0xa279('0x22')](function(_0x4b361e){if(_0x4b361e){_0x437935=_0x4b361e[_0xa279('0x8c')];var _0x187053=_0x437935['slice'](-0x1);if(_0x187053==='/'){_0x437935=_0x437935[_0xa279('0x8e')](0x0,_0x437935[_0xa279('0x8f')](_0x187053));}_0xbd3ef5=util[_0xa279('0x90')](_0xa279('0x91'),_0x437935);_0x378dc7=util[_0xa279('0x90')](_0xa279('0x92'),_0x437935);_0x370785={'user':_0x4b361e[_0xa279('0x8a')],'pass':_0x4b361e[_0xa279('0x93')]};var _0xaf5f2={'method':_0xa279('0x94'),'uri':_0xbd3ef5+_0xa279('0x95'),'auth':_0x370785,'json':!![]};return rp(_0xaf5f2);}})['then'](function(_0x5c5e22){if(_0x5c5e22['result'][_0xa279('0x31')]>0x0){_0x1ef3ba=_0x5c5e22[_0xa279('0x96')];}console[_0xa279('0x97')](_0xa279('0x98'),_0x1ef3ba);_0x2e81c6=[];_0x286651=Object[_0xa279('0x99')]([],_0x1ef3ba);_['remove'](_0x286651,function(_0x15f75f){return!_0x26478c[_0xa279('0x9a')](_0x15f75f[_0xa279('0x24')]);});_0x286651[_0xa279('0x9b')](function(_0x428e65){var _0x33f836=createFieldObject(_0x378dc7,_0x370785,_0x428e65[_0xa279('0x9c')],_0x428e65['name'],_0x428e65['label'],![]);_0x2e81c6['push'](_0x33f836);});return Promise[_0xa279('0x9d')](_0x2e81c6);})[_0xa279('0x22')](function(_0x2e146b){_0x517c36=_0x2e146b;_0x4d67f7=Object['assign']([],_0x1ef3ba);console[_0xa279('0x97')](_0xa279('0x9e'),_0x1ef3ba);_[_0xa279('0x9f')](_0x4d67f7,function(_0x5eb0a1){return _0x496b7d[_0xa279('0x9a')](_0x5eb0a1[_0xa279('0x24')]);});console['log']('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x4d67f7);_0x2e81c6=[];_0x4d67f7['forEach'](function(_0x5e82ab){var _0x425ff6=createFieldObject(_0x378dc7,_0x370785,_0x5e82ab[_0xa279('0x9c')],_0x5e82ab[_0xa279('0x24')],_0x5e82ab[_0xa279('0xa0')],!![]);_0x2e81c6[_0xa279('0xa1')](_0x425ff6);});return Promise[_0xa279('0x9d')](_0x2e81c6);})[_0xa279('0x22')](function(_0xab851a){_0x45cb38=_0xab851a;var _0x2b05da=_0x517c36['concat'](_0x45cb38);return{'count':_0x2b05da[_0xa279('0x31')],'rows':_0x2b05da};})[_0xa279('0x22')](respondWithResult(_0x54ec5d,null))[_0xa279('0x4a')](function(_0x6a2f6d){console[_0xa279('0x97')](_0xa279('0xa2')+_0x6a2f6d);var _0x3e5403=_0x375db0['query'][_0xa279('0xa3')]?0x1f4:_0x6a2f6d[_0xa279('0xa4')]||0x1f4;logger[_0xa279('0xa5')](_0x6a2f6d[_0xa279('0xa6')]);delete _0x6a2f6d['name'];if(_0x3e5403===0x191){_0x3e5403=0x190;}_0x54ec5d['status'](_0x3e5403)[_0xa279('0x25')](_0x375db0[_0xa279('0x2d')][_0xa279('0xa3')]?{'message':_0xa279('0xa7'),'statusCode':_0x6a2f6d['statusCode']}:_0x6a2f6d);});};function createFieldObject(_0xb9bc91,_0x4e1b32,_0x2199c1,_0x58b378,_0x4f76eb,_0x260a8f){return new Promise(function(_0x2035e9,_0x8175a1){var _0x4de775={'id':_0x58b378,'name':_0x4f76eb,'custom':_0x260a8f};if(_0x2199c1==='boolean'){_0x4de775['options']=[{'name':_0xa279('0xa8'),'value':_0xa279('0xa9')},{'name':'False','value':_0xa279('0xaa')}];_0x2035e9(_0x4de775);}else{var _0x566f4e={'method':_0xa279('0x94'),'uri':_0xb9bc91+_0xa279('0xab')+_0x58b378,'auth':_0x4e1b32,'json':!![]};return rp(_0x566f4e)[_0xa279('0x22')](function(_0x3aa441){var _0x2ab746=[];if(_0x3aa441[_0xa279('0x96')]['length']>0x0){_0x3aa441[_0xa279('0x96')][_0xa279('0x9b')](function(_0x3f4cdc){if(_0x3f4cdc[_0xa279('0xac')]==='false'){var _0x271781={'name':_0x3f4cdc[_0xa279('0xa0')],'value':_0x3f4cdc[_0xa279('0xad')]};_0x2ab746[_0xa279('0xa1')](_0x271781);}});}_0x4de775[_0xa279('0x3b')]=_0x2ab746;if(_0x4de775[_0xa279('0x3b')]['length']>0x0){_0x2035e9(_0x4de775);}else{if(_0x260a8f==![]){_0x2035e9();}else{_0x2035e9(_0x4de775);}}});}});} \ No newline at end of file +var _0xe894=['ServicenowConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','ServicenowField','hold_reason','knowledge','subcategory','close_code','notify','severity','category','parent','made_sla','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','approval_history','number','sys_updated_by','opened_by','user_input','sys_created_on','state','sys_created_by','calendar_stc','closed_at','delivery_plan','impact','active','work_notes_list','business_service','rfc','time_worked','expected_start','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','correlation_display','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','sys_class_name','close_notes','follow_up','parent_incident','contact_type','reopened_by','incident_state','urgency','problem_id','company','reassignment_count','assigned_to','comments','approval','comments_and_work_notes','due_date','sys_mod_count','sys_tags','escalation','location','username','password','email','remoteUri','substring','format','%s/api/now/doc/table/schema/','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','forEach','internalType','label','push','all','TCL:\x20_object','includes','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','ServiceNow\x20error:\x20','statusCode','send','test','Wrong\x20credentials','boolean','True','true','False','false','value','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','index','map','rawAttributes','type','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','ServicenowAccount','includeAll','include','findAll','catch','params','keys','intersection','options','create','body','find','getConfigurations','findOne'];(function(_0xc87d08,_0x59c9be){var _0x30a714=function(_0x437c0d){while(--_0x437c0d){_0xc87d08['push'](_0xc87d08['shift']());}};_0x30a714(++_0x59c9be);}(_0xe894,0x124));var _0x4e89=function(_0x3e4cbb,_0x1ec2fd){_0x3e4cbb=_0x3e4cbb-0x0;var _0x78c593=_0xe894[_0x3e4cbb];return _0x78c593;};'use strict';var emlformat=require(_0x4e89('0x0'));var rimraf=require(_0x4e89('0x1'));var zipdir=require(_0x4e89('0x2'));var jsonpatch=require(_0x4e89('0x3'));var rp=require(_0x4e89('0x4'));var moment=require(_0x4e89('0x5'));var BPromise=require(_0x4e89('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4e89('0x7'));var sox=require(_0x4e89('0x8'));var csv=require(_0x4e89('0x9'));var ejs=require(_0x4e89('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4e89('0xb'));var crypto=require(_0x4e89('0xc'));var jsforce=require(_0x4e89('0xd'));var deskjs=require(_0x4e89('0xe'));var toCsv=require(_0x4e89('0x9'));var querystring=require(_0x4e89('0xf'));var Papa=require(_0x4e89('0x10'));var Redis=require(_0x4e89('0x11'));var authService=require(_0x4e89('0x12'));var qs=require(_0x4e89('0x13'));var as=require(_0x4e89('0x14'));var hardwareService=require(_0x4e89('0x15'));var logger=require(_0x4e89('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x4e89('0x17'));var licenseUtil=require(_0x4e89('0x18'));var db=require(_0x4e89('0x19'))['db'];var integrations=require(_0x4e89('0x1a'));function respondWithStatusCode(_0x5e951e,_0x5bbf92){_0x5bbf92=_0x5bbf92||0xcc;return function(_0x3ca57d){if(_0x3ca57d){return _0x5e951e['sendStatus'](_0x5bbf92);}return _0x5e951e['status'](_0x5bbf92)['end']();};}function respondWithResult(_0x2f1978,_0x39ab91){_0x39ab91=_0x39ab91||0xc8;return function(_0x25373b){if(_0x25373b){return _0x2f1978[_0x4e89('0x1b')](_0x39ab91)[_0x4e89('0x1c')](_0x25373b);}};}function respondWithFilteredResult(_0x2d4851,_0x3b5c33){return function(_0x142eb1){if(_0x142eb1){var _0x23611d=typeof _0x3b5c33[_0x4e89('0x1d')]===_0x4e89('0x1e')&&typeof _0x3b5c33['limit']===_0x4e89('0x1e');var _0x5816bb=_0x142eb1[_0x4e89('0x1f')];var _0xddd79a=_0x23611d?0x0:_0x3b5c33[_0x4e89('0x1d')];var _0x4b2727=_0x23611d?_0x142eb1[_0x4e89('0x1f')]:_0x3b5c33[_0x4e89('0x1d')]+_0x3b5c33[_0x4e89('0x20')];var _0x3f1f75;if(_0x4b2727>=_0x5816bb){_0x4b2727=_0x5816bb;_0x3f1f75=0xc8;}else{_0x3f1f75=0xce;}_0x2d4851[_0x4e89('0x1b')](_0x3f1f75);return _0x2d4851['set'](_0x4e89('0x21'),_0xddd79a+'-'+_0x4b2727+'/'+_0x5816bb)[_0x4e89('0x1c')](_0x142eb1);}return null;};}function patchUpdates(_0x125207){return function(_0x209d29){try{jsonpatch[_0x4e89('0x22')](_0x209d29,_0x125207,!![]);}catch(_0x5d90f4){return BPromise[_0x4e89('0x23')](_0x5d90f4);}return _0x209d29[_0x4e89('0x24')]();};}function saveUpdates(_0x22a3e9,_0x96a962){return function(_0x3274ec){if(_0x3274ec){return _0x3274ec[_0x4e89('0x25')](_0x22a3e9)[_0x4e89('0x26')](function(_0x2c7f39){return _0x2c7f39;});}return null;};}function removeEntity(_0x3ee2c1,_0x4f70e1){return function(_0x319d76){if(_0x319d76){return _0x319d76[_0x4e89('0x27')]()[_0x4e89('0x26')](function(){_0x3ee2c1['status'](0xcc)[_0x4e89('0x28')]();});}};}function handleEntityNotFound(_0x411521,_0x68092){return function(_0x4f6a22){if(!_0x4f6a22){_0x411521[_0x4e89('0x29')](0x194);}return _0x4f6a22;};}function handleError(_0x1605b8,_0x561fd4){_0x561fd4=_0x561fd4||0x1f4;return function(_0x4ed3a4){logger[_0x4e89('0x2a')](_0x4ed3a4[_0x4e89('0x2b')]);if(_0x4ed3a4[_0x4e89('0x2c')]){delete _0x4ed3a4[_0x4e89('0x2c')];}_0x1605b8[_0x4e89('0x1b')](_0x561fd4)['send'](_0x4ed3a4);};}exports[_0x4e89('0x2d')]=function(_0x5cae78,_0x2ca655){var _0x140c35={},_0x5fff0b={},_0x31dc56={'count':0x0,'rows':[]};var _0x378384=_[_0x4e89('0x2e')](db['ServicenowAccount'][_0x4e89('0x2f')],function(_0x20395b){return{'name':_0x20395b['fieldName'],'type':_0x20395b[_0x4e89('0x30')]['key']};});_0x5fff0b[_0x4e89('0x31')]=_[_0x4e89('0x2e')](_0x378384,_0x4e89('0x2c'));_0x5fff0b['query']=_['keys'](_0x5cae78[_0x4e89('0x32')]);_0x5fff0b[_0x4e89('0x33')]=_['intersection'](_0x5fff0b['model'],_0x5fff0b['query']);_0x140c35[_0x4e89('0x34')]=_['intersection'](_0x5fff0b[_0x4e89('0x31')],qs[_0x4e89('0x35')](_0x5cae78[_0x4e89('0x32')][_0x4e89('0x35')]));_0x140c35[_0x4e89('0x34')]=_0x140c35[_0x4e89('0x34')][_0x4e89('0x36')]?_0x140c35[_0x4e89('0x34')]:_0x5fff0b['model'];if(!_0x5cae78[_0x4e89('0x32')][_0x4e89('0x37')](_0x4e89('0x38'))){_0x140c35[_0x4e89('0x20')]=qs[_0x4e89('0x20')](_0x5cae78[_0x4e89('0x32')][_0x4e89('0x20')]);_0x140c35[_0x4e89('0x1d')]=qs[_0x4e89('0x1d')](_0x5cae78[_0x4e89('0x32')]['offset']);}_0x140c35[_0x4e89('0x39')]=qs[_0x4e89('0x3a')](_0x5cae78[_0x4e89('0x32')][_0x4e89('0x3a')]);_0x140c35[_0x4e89('0x3b')]=qs[_0x4e89('0x33')](_[_0x4e89('0x3c')](_0x5cae78[_0x4e89('0x32')],_0x5fff0b[_0x4e89('0x33')]),_0x378384);if(_0x5cae78[_0x4e89('0x32')][_0x4e89('0x3d')]){_0x140c35['where']=_[_0x4e89('0x3e')](_0x140c35[_0x4e89('0x3b')],{'$or':_[_0x4e89('0x2e')](_0x378384,function(_0x3f4972){if(_0x3f4972[_0x4e89('0x30')]!==_0x4e89('0x3f')){var _0x3149ac={};_0x3149ac[_0x3f4972[_0x4e89('0x2c')]]={'$like':'%'+_0x5cae78[_0x4e89('0x32')][_0x4e89('0x3d')]+'%'};return _0x3149ac;}})});}_0x140c35=_['merge']({},_0x140c35,_0x5cae78['options']);var _0x59dc7f={'where':_0x140c35['where']};return db[_0x4e89('0x40')][_0x4e89('0x1f')](_0x59dc7f)['then'](function(_0x382f9c){_0x31dc56[_0x4e89('0x1f')]=_0x382f9c;if(_0x5cae78[_0x4e89('0x32')][_0x4e89('0x41')]){_0x140c35[_0x4e89('0x42')]=[{'all':!![]}];}return db['ServicenowAccount'][_0x4e89('0x43')](_0x140c35);})[_0x4e89('0x26')](function(_0x11e67e){_0x31dc56['rows']=_0x11e67e;return _0x31dc56;})[_0x4e89('0x26')](respondWithFilteredResult(_0x2ca655,_0x140c35))[_0x4e89('0x44')](handleError(_0x2ca655,null));};exports['show']=function(_0x374e04,_0x26136c){var _0x15eb6c={'raw':![],'where':{'id':_0x374e04[_0x4e89('0x45')]['id']}},_0x2db738={};_0x2db738[_0x4e89('0x31')]=_['keys'](db[_0x4e89('0x40')][_0x4e89('0x2f')]);_0x2db738[_0x4e89('0x32')]=_[_0x4e89('0x46')](_0x374e04[_0x4e89('0x32')]);_0x2db738['filters']=_[_0x4e89('0x47')](_0x2db738['model'],_0x2db738['query']);_0x15eb6c[_0x4e89('0x34')]=_[_0x4e89('0x47')](_0x2db738[_0x4e89('0x31')],qs['fields'](_0x374e04[_0x4e89('0x32')][_0x4e89('0x35')]));_0x15eb6c[_0x4e89('0x34')]=_0x15eb6c[_0x4e89('0x34')][_0x4e89('0x36')]?_0x15eb6c[_0x4e89('0x34')]:_0x2db738[_0x4e89('0x31')];if(_0x374e04['query'][_0x4e89('0x41')]){_0x15eb6c[_0x4e89('0x42')]=[{'all':!![]}];}_0x15eb6c=_['merge']({},_0x15eb6c,_0x374e04[_0x4e89('0x48')]);return db[_0x4e89('0x40')]['find'](_0x15eb6c)[_0x4e89('0x26')](handleEntityNotFound(_0x26136c,null))[_0x4e89('0x26')](respondWithResult(_0x26136c,null))[_0x4e89('0x44')](handleError(_0x26136c,null));};exports[_0x4e89('0x49')]=function(_0x45cdf7,_0x13578e){return db['ServicenowAccount'][_0x4e89('0x49')](_0x45cdf7[_0x4e89('0x4a')],{})['then'](respondWithResult(_0x13578e,0xc9))[_0x4e89('0x44')](handleError(_0x13578e,null));};exports[_0x4e89('0x25')]=function(_0x581684,_0x4960b1){if(_0x581684[_0x4e89('0x4a')]['id']){delete _0x581684['body']['id'];}return db[_0x4e89('0x40')][_0x4e89('0x4b')]({'where':{'id':_0x581684[_0x4e89('0x45')]['id']}})['then'](handleEntityNotFound(_0x4960b1,null))[_0x4e89('0x26')](saveUpdates(_0x581684[_0x4e89('0x4a')],null))[_0x4e89('0x26')](respondWithResult(_0x4960b1,null))[_0x4e89('0x44')](handleError(_0x4960b1,null));};exports[_0x4e89('0x27')]=function(_0x1e5b03,_0x54651e){return db['ServicenowAccount'][_0x4e89('0x4b')]({'where':{'id':_0x1e5b03[_0x4e89('0x45')]['id']}})[_0x4e89('0x26')](handleEntityNotFound(_0x54651e,null))[_0x4e89('0x26')](removeEntity(_0x54651e,null))[_0x4e89('0x44')](handleError(_0x54651e,null));};exports[_0x4e89('0x4c')]=function(_0x441e1e,_0x32dabc,_0x4edf7a){var _0x31b82c={};var _0x4dea64={};var _0x1e6177;var _0x4b16aa;return db[_0x4e89('0x40')][_0x4e89('0x4d')]({'where':{'id':_0x441e1e[_0x4e89('0x45')]['id']}})[_0x4e89('0x26')](handleEntityNotFound(_0x32dabc,null))['then'](function(_0x4652cb){if(_0x4652cb){_0x1e6177=_0x4652cb;_0x4dea64['model']=_[_0x4e89('0x46')](db[_0x4e89('0x4e')][_0x4e89('0x2f')]);_0x4dea64[_0x4e89('0x32')]=_[_0x4e89('0x46')](_0x441e1e[_0x4e89('0x32')]);_0x4dea64[_0x4e89('0x33')]=_['intersection'](_0x4dea64[_0x4e89('0x31')],_0x4dea64[_0x4e89('0x32')]);_0x31b82c['attributes']=_[_0x4e89('0x47')](_0x4dea64[_0x4e89('0x31')],qs[_0x4e89('0x35')](_0x441e1e[_0x4e89('0x32')][_0x4e89('0x35')]));_0x31b82c[_0x4e89('0x34')]=_0x31b82c[_0x4e89('0x34')]['length']?_0x31b82c[_0x4e89('0x34')]:_0x4dea64[_0x4e89('0x31')];_0x31b82c['order']=qs[_0x4e89('0x3a')](_0x441e1e['query'][_0x4e89('0x3a')]);_0x31b82c['where']=qs['filters'](_[_0x4e89('0x3c')](_0x441e1e['query'],_0x4dea64['filters']));if(_0x441e1e[_0x4e89('0x32')][_0x4e89('0x3d')]){_0x31b82c[_0x4e89('0x3b')]=_[_0x4e89('0x3e')](_0x31b82c[_0x4e89('0x3b')],{'$or':_[_0x4e89('0x2e')](_0x31b82c['attributes'],function(_0x369fab){var _0x49e8f8={};_0x49e8f8[_0x369fab]={'$like':'%'+_0x441e1e['query']['filter']+'%'};return _0x49e8f8;})});}_0x31b82c=_[_0x4e89('0x3e')]({},_0x31b82c,_0x441e1e[_0x4e89('0x48')]);return _0x1e6177['getConfigurations'](_0x31b82c);}})[_0x4e89('0x26')](function(_0x42db3f){if(_0x42db3f){_0x4b16aa=_0x42db3f['length'];if(!_0x441e1e['query'][_0x4e89('0x37')](_0x4e89('0x38'))){_0x31b82c[_0x4e89('0x20')]=qs[_0x4e89('0x20')](_0x441e1e[_0x4e89('0x32')][_0x4e89('0x20')]);_0x31b82c[_0x4e89('0x1d')]=qs['offset'](_0x441e1e[_0x4e89('0x32')]['offset']);}return _0x1e6177[_0x4e89('0x4c')](_0x31b82c);}})[_0x4e89('0x26')](function(_0x1b0456){if(_0x1b0456){return _0x1b0456?{'count':_0x4b16aa,'rows':_0x1b0456}:null;}})[_0x4e89('0x26')](respondWithResult(_0x32dabc,null))[_0x4e89('0x44')](handleError(_0x32dabc,null));};exports[_0x4e89('0x4f')]=function(_0x505817,_0x32dfcc,_0x2e8c92){if(_0x505817['body']['id']){delete _0x505817['body']['id'];}return db[_0x4e89('0x40')]['findOne']({'where':{'id':_0x505817[_0x4e89('0x45')]['id']}})[_0x4e89('0x26')](handleEntityNotFound(_0x32dfcc,null))[_0x4e89('0x26')](function(_0x1919b5){if(_0x1919b5){_0x505817['body'][_0x4e89('0x50')]=_0x1919b5['id'];_0x505817[_0x4e89('0x4a')][_0x4e89('0x51')]=integrations[_0x4e89('0x52')](_0x505817[_0x4e89('0x4a')][_0x4e89('0x53')],_0x505817[_0x4e89('0x4a')]['type']);_0x505817[_0x4e89('0x4a')][_0x4e89('0x54')]=integrations['getDescriptions'](_0x505817[_0x4e89('0x4a')][_0x4e89('0x53')],_0x505817[_0x4e89('0x4a')][_0x4e89('0x30')]);return db['ServicenowConfiguration'][_0x4e89('0x49')](_0x505817['body'],{'include':[{'model':db['ServicenowField'],'as':_0x4e89('0x51')},{'model':db[_0x4e89('0x55')],'as':_0x4e89('0x54')}]});}return null;})[_0x4e89('0x26')](respondWithResult(_0x32dfcc,null))['catch'](handleError(_0x32dfcc,null));};exports['getFields']=function(_0x4e06e3,_0x5b1d3a,_0x21c8e5){var _0x113692=['made_sla',_0x4e89('0x56'),_0x4e89('0x57'),_0x4e89('0x58'),_0x4e89('0x59'),_0x4e89('0x5a'),'incident_state',_0x4e89('0x5b'),_0x4e89('0x5c')];var _0x9030ec=[_0x4e89('0x5d'),_0x4e89('0x5e'),_0x4e89('0x5f'),_0x4e89('0x60'),_0x4e89('0x61'),_0x4e89('0x62'),_0x4e89('0x63'),_0x4e89('0x56'),_0x4e89('0x64'),_0x4e89('0x65'),'resolved_by',_0x4e89('0x66'),_0x4e89('0x67'),_0x4e89('0x68'),_0x4e89('0x69'),'sys_domain',_0x4e89('0x6a'),_0x4e89('0x6b'),_0x4e89('0x57'),_0x4e89('0x39'),_0x4e89('0x6c'),_0x4e89('0x6d'),'cmdb_ci',_0x4e89('0x6e'),_0x4e89('0x6f'),_0x4e89('0x70'),_0x4e89('0x71'),_0x4e89('0x72'),'priority','sys_domain_path',_0x4e89('0x73'),_0x4e89('0x74'),_0x4e89('0x75'),'opened_at','business_duration',_0x4e89('0x76'),_0x4e89('0x77'),_0x4e89('0x78'),_0x4e89('0x79'),_0x4e89('0x7a'),_0x4e89('0x7b'),_0x4e89('0x58'),_0x4e89('0x7c'),'short_description',_0x4e89('0x59'),_0x4e89('0x7d'),'delivery_task',_0x4e89('0x7e'),_0x4e89('0x7f'),_0x4e89('0x80'),_0x4e89('0x81'),_0x4e89('0x82'),_0x4e89('0x83'),'notify',_0x4e89('0x84'),_0x4e89('0x85'),'closed_by',_0x4e89('0x86'),_0x4e89('0x87'),'sys_id',_0x4e89('0x88'),_0x4e89('0x89'),_0x4e89('0x8a'),_0x4e89('0x8b'),_0x4e89('0x8c'),_0x4e89('0x8d'),_0x4e89('0x8e'),'activity_due',_0x4e89('0x8f'),'severity',_0x4e89('0x90'),'sla_due',_0x4e89('0x91'),_0x4e89('0x92'),_0x4e89('0x93'),_0x4e89('0x94'),'reopen_count',_0x4e89('0x95'),_0x4e89('0x96'),'upon_approval','correlation_id',_0x4e89('0x97'),_0x4e89('0x5c')];var _0x3e739e='';var _0x42464a='';var _0xcdd228=[];var _0x1c4a61='';var _0x30c58a='';var _0x338a9f=[];var _0x449ed8='';var _0x316cc5='';var _0x3defc2={};var _0x276810='';return db[_0x4e89('0x40')]['findOne']({'where':{'id':_0x4e06e3[_0x4e89('0x45')]['id']},'attributes':['id',_0x4e89('0x98'),_0x4e89('0x99'),_0x4e89('0x9a'),_0x4e89('0x9b'),'serverUrl']})[_0x4e89('0x26')](handleEntityNotFound(_0x5b1d3a,null))['then'](function(_0x5eacf7){if(_0x5eacf7){_0x276810=_0x5eacf7[_0x4e89('0x9b')];var _0x3d0fc2=_0x276810['slice'](-0x1);if(_0x3d0fc2==='/'){_0x276810=_0x276810[_0x4e89('0x9c')](0x0,_0x276810['lastIndexOf'](_0x3d0fc2));}_0x316cc5=util[_0x4e89('0x9d')](_0x4e89('0x9e'),_0x276810);_0x449ed8=util['format']('%s/api/now/table/',_0x276810);_0x3defc2={'user':_0x5eacf7['username'],'pass':_0x5eacf7['password']};var _0x433fc9={'method':'GET','uri':_0x316cc5+_0x4e89('0x9f'),'auth':_0x3defc2,'json':!![]};return rp(_0x433fc9);}})[_0x4e89('0x26')](function(_0x177f2e){if(_0x177f2e[_0x4e89('0xa0')]['length']>0x0){_0x3e739e=_0x177f2e['result'];}console[_0x4e89('0xa1')](_0x4e89('0xa2'),_0x3e739e);_0x338a9f=[];_0x42464a=Object[_0x4e89('0xa3')]([],_0x3e739e);_[_0x4e89('0xa4')](_0x42464a,function(_0x1eb386){return!_0x113692['includes'](_0x1eb386[_0x4e89('0x2c')]);});_0x42464a[_0x4e89('0xa5')](function(_0x16a5c6){var _0x532fdd=createFieldObject(_0x449ed8,_0x3defc2,_0x16a5c6[_0x4e89('0xa6')],_0x16a5c6[_0x4e89('0x2c')],_0x16a5c6[_0x4e89('0xa7')],![]);_0x338a9f[_0x4e89('0xa8')](_0x532fdd);});return Promise[_0x4e89('0xa9')](_0x338a9f);})[_0x4e89('0x26')](function(_0x4a48dc){_0xcdd228=_0x4a48dc;_0x1c4a61=Object['assign']([],_0x3e739e);console['log'](_0x4e89('0xaa'),_0x3e739e);_[_0x4e89('0xa4')](_0x1c4a61,function(_0x11ffb5){return _0x9030ec[_0x4e89('0xab')](_0x11ffb5['name']);});console['log'](_0x4e89('0xac'),_0x1c4a61);_0x338a9f=[];_0x1c4a61['forEach'](function(_0x544b78){var _0xdb8930=createFieldObject(_0x449ed8,_0x3defc2,_0x544b78['internalType'],_0x544b78[_0x4e89('0x2c')],_0x544b78[_0x4e89('0xa7')],!![]);_0x338a9f['push'](_0xdb8930);});return Promise[_0x4e89('0xa9')](_0x338a9f);})['then'](function(_0x236b02){_0x30c58a=_0x236b02;var _0x193325=_0xcdd228[_0x4e89('0xad')](_0x30c58a);return{'count':_0x193325[_0x4e89('0x36')],'rows':_0x193325};})[_0x4e89('0x26')](respondWithResult(_0x5b1d3a,null))[_0x4e89('0x44')](function(_0x207dcd){console[_0x4e89('0xa1')](_0x4e89('0xae')+_0x207dcd);var _0x3c3ea5=_0x4e06e3[_0x4e89('0x32')]['test']?0x1f4:_0x207dcd[_0x4e89('0xaf')]||0x1f4;logger[_0x4e89('0x2a')](_0x207dcd[_0x4e89('0x2b')]);delete _0x207dcd['name'];if(_0x3c3ea5===0x191){_0x3c3ea5=0x190;}_0x5b1d3a[_0x4e89('0x1b')](_0x3c3ea5)[_0x4e89('0xb0')](_0x4e06e3['query'][_0x4e89('0xb1')]?{'message':_0x4e89('0xb2'),'statusCode':_0x207dcd[_0x4e89('0xaf')]}:_0x207dcd);});};function createFieldObject(_0x5ec231,_0x358bf1,_0x3e0fe1,_0x5e97e0,_0x15b60b,_0x57597f){return new Promise(function(_0x2350e3,_0x24ae85){var _0x4dfffa={'id':_0x5e97e0,'name':_0x15b60b,'custom':_0x57597f};if(_0x3e0fe1===_0x4e89('0xb3')){_0x4dfffa['options']=[{'name':_0x4e89('0xb4'),'value':_0x4e89('0xb5')},{'name':_0x4e89('0xb6'),'value':_0x4e89('0xb7')}];_0x2350e3(_0x4dfffa);}else{var _0x44c81e={'method':'GET','uri':_0x5ec231+'sys_choice?sysparm_query=name=incident^element='+_0x5e97e0,'auth':_0x358bf1,'json':!![]};return rp(_0x44c81e)[_0x4e89('0x26')](function(_0x3cb21a){var _0x2de794=[];if(_0x3cb21a[_0x4e89('0xa0')][_0x4e89('0x36')]>0x0){_0x3cb21a[_0x4e89('0xa0')][_0x4e89('0xa5')](function(_0x5c108b){if(_0x5c108b['inactive']===_0x4e89('0xb7')){var _0x57c747={'name':_0x5c108b[_0x4e89('0xa7')],'value':_0x5c108b[_0x4e89('0xb8')]};_0x2de794[_0x4e89('0xa8')](_0x57c747);}});}_0x4dfffa[_0x4e89('0x48')]=_0x2de794;if(_0x4dfffa['options'][_0x4e89('0x36')]>0x0){_0x2350e3(_0x4dfffa);}else{if(_0x57597f==![]){_0x2350e3();}else{_0x2350e3(_0x4dfffa);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 11919e8..22cb2c7 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 _0x4c60=['exports','define','ServicenowAccount','lodash','util','../../config/logger','api','bluebird','./intServicenowAccount.attributes','../../components/integrations/configuration'];(function(_0x36cb6d,_0x522d82){var _0x1e7e03=function(_0x4ed3bf){while(--_0x4ed3bf){_0x36cb6d['push'](_0x36cb6d['shift']());}};_0x1e7e03(++_0x522d82);}(_0x4c60,0xc1));var _0x04c6=function(_0x8da33f,_0x3a3cd8){_0x8da33f=_0x8da33f-0x0;var _0x163f2b=_0x4c60[_0x8da33f];return _0x163f2b;};'use strict';var _=require(_0x04c6('0x0'));var util=require(_0x04c6('0x1'));var logger=require(_0x04c6('0x2'))(_0x04c6('0x3'));var moment=require('moment');var BPromise=require(_0x04c6('0x4'));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(_0x04c6('0x5'));var integrations=require(_0x04c6('0x6'));module[_0x04c6('0x7')]=function(_0x12bd5d,_0x2b9041){return _0x12bd5d[_0x04c6('0x8')](_0x04c6('0x9'),attributes,{'tableName':'int_servicenow_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','int_servicenow_accounts','lodash','util'];(function(_0x42dabf,_0x2f0428){var _0x5d8dfd=function(_0x439101){while(--_0x439101){_0x42dabf['push'](_0x42dabf['shift']());}};_0x5d8dfd(++_0x2f0428);}(_0x814b,0x1a2));var _0xb814=function(_0x5d6e30,_0xc21d51){_0x5d6e30=_0x5d6e30-0x0;var _0x3d3f3b=_0x814b[_0x5d6e30];return _0x3d3f3b;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));var integrations=require(_0xb814('0xa'));module[_0xb814('0xb')]=function(_0x53e507,_0x3b0829){return _0x53e507[_0xb814('0xc')]('ServicenowAccount',attributes,{'tableName':_0xb814('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index 1b9ba5e..65e81fa 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 _0xd6fe=['where','limit','include','map','model','attributes','GetServicenowAccount','ShowServicenowAccount','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ServicenowAccount','findAll','options','raw'];(function(_0x180ead,_0xb796f9){var _0xb2e3da=function(_0x10f370){while(--_0x10f370){_0x180ead['push'](_0x180ead['shift']());}};_0xb2e3da(++_0xb796f9);}(_0xd6fe,0x185));var _0xed6f=function(_0x405126,_0xcf073d){_0x405126=_0x405126-0x0;var _0x204cc4=_0xd6fe[_0x405126];return _0x204cc4;};'use strict';var _=require(_0xed6f('0x0'));var util=require(_0xed6f('0x1'));var moment=require(_0xed6f('0x2'));var BPromise=require(_0xed6f('0x3'));var rs=require(_0xed6f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xed6f('0x5'))['db'];var utils=require(_0xed6f('0x6'));var logger=require(_0xed6f('0x7'))(_0xed6f('0x8'));var config=require(_0xed6f('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xed6f('0xa')][_0xed6f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xc4213b,_0x4b232c,_0x6ada67){return new BPromise(function(_0x58fe2d,_0x2417d2){return client[_0xed6f('0xc')](_0xc4213b,_0x6ada67)[_0xed6f('0xd')](function(_0x6ff54e){logger[_0xed6f('0xe')](_0xed6f('0xf'),_0x4b232c,_0xed6f('0x10'));logger[_0xed6f('0x11')](_0xed6f('0x12'),_0x4b232c,_0xed6f('0x10'),JSON[_0xed6f('0x13')](_0x6ff54e));if(_0x6ff54e[_0xed6f('0x14')]){if(_0x6ff54e[_0xed6f('0x14')][_0xed6f('0x15')]===0x1f4){logger[_0xed6f('0x14')]('ServicenowAccount,\x20%s,\x20%s',_0x4b232c,_0x6ff54e[_0xed6f('0x14')]['message']);return _0x2417d2(_0x6ff54e[_0xed6f('0x14')][_0xed6f('0x16')]);}logger[_0xed6f('0x14')](_0xed6f('0xf'),_0x4b232c,_0x6ff54e[_0xed6f('0x14')][_0xed6f('0x16')]);return _0x58fe2d(_0x6ff54e[_0xed6f('0x14')]['message']);}else{logger[_0xed6f('0xe')](_0xed6f('0xf'),_0x4b232c,'request\x20sent');_0x58fe2d(_0x6ff54e[_0xed6f('0x17')][_0xed6f('0x16')]);}})[_0xed6f('0x18')](function(_0x50b632){logger['error'](_0xed6f('0xf'),_0x4b232c,_0x50b632);_0x2417d2(_0x50b632);});});}exports['GetServicenowAccount']=function(_0x260485){var _0x4d5ba5=this;return new Promise(function(_0x26d4a6,_0xe63181){return db[_0xed6f('0x19')][_0xed6f('0x1a')]({'raw':_0x260485[_0xed6f('0x1b')]?_0x260485['options'][_0xed6f('0x1c')]===undefined?!![]:![]:!![],'where':_0x260485['options']?_0x260485['options'][_0xed6f('0x1d')]||null:null,'attributes':_0x260485[_0xed6f('0x1b')]?_0x260485[_0xed6f('0x1b')]['attributes']||null:null,'limit':_0x260485['options']?_0x260485['options'][_0xed6f('0x1e')]||null:null,'include':_0x260485['options']?_0x260485['options'][_0xed6f('0x1f')]?_[_0xed6f('0x20')](_0x260485['options'][_0xed6f('0x1f')],function(_0x565171){return{'model':db[_0x565171[_0xed6f('0x21')]],'as':_0x565171['as'],'attributes':_0x565171['attributes'],'include':_0x565171[_0xed6f('0x1f')]?_[_0xed6f('0x20')](_0x565171[_0xed6f('0x1f')],function(_0xd52198){return{'model':db[_0xd52198['model']],'as':_0xd52198['as'],'attributes':_0xd52198[_0xed6f('0x22')],'include':_0xd52198[_0xed6f('0x1f')]?_[_0xed6f('0x20')](_0xd52198[_0xed6f('0x1f')],function(_0x10fa84){return{'model':db[_0x10fa84[_0xed6f('0x21')]],'as':_0x10fa84['as'],'attributes':_0x10fa84[_0xed6f('0x22')]};}):[]};}):[]};}):[]:[]})[_0xed6f('0xd')](function(_0x4cdad7){logger[_0xed6f('0xe')]('GetServicenowAccount',_0x260485);logger[_0xed6f('0x11')](_0xed6f('0x23'),_0x260485,JSON['stringify'](_0x4cdad7));_0x26d4a6(_0x4cdad7);})['catch'](function(_0x1a0fb6){logger[_0xed6f('0x14')](_0xed6f('0x23'),_0x1a0fb6[_0xed6f('0x16')],_0x260485);_0xe63181(_0x4d5ba5['error'](0x1f4,_0x1a0fb6[_0xed6f('0x16')]));});});};exports[_0xed6f('0x24')]=function(_0x128a24){var _0x102487=this;return new Promise(function(_0x504373,_0x13bc66){return db[_0xed6f('0x19')][_0xed6f('0x25')]({'raw':_0x128a24[_0xed6f('0x1b')]?_0x128a24[_0xed6f('0x1b')][_0xed6f('0x1c')]===undefined?!![]:![]:!![],'where':_0x128a24[_0xed6f('0x1b')]?_0x128a24[_0xed6f('0x1b')][_0xed6f('0x1d')]||null:null,'attributes':_0x128a24[_0xed6f('0x1b')]?_0x128a24[_0xed6f('0x1b')]['attributes']||null:null,'include':_0x128a24[_0xed6f('0x1b')]?_0x128a24[_0xed6f('0x1b')]['include']?_[_0xed6f('0x20')](_0x128a24[_0xed6f('0x1b')][_0xed6f('0x1f')],function(_0x4cb1c6){return{'model':db[_0x4cb1c6[_0xed6f('0x21')]],'as':_0x4cb1c6['as'],'attributes':_0x4cb1c6[_0xed6f('0x22')],'include':_0x4cb1c6[_0xed6f('0x1f')]?_[_0xed6f('0x20')](_0x4cb1c6[_0xed6f('0x1f')],function(_0x26b085){return{'model':db[_0x26b085[_0xed6f('0x21')]],'as':_0x26b085['as'],'attributes':_0x26b085['attributes'],'include':_0x26b085[_0xed6f('0x1f')]?_[_0xed6f('0x20')](_0x26b085[_0xed6f('0x1f')],function(_0x4a5d2d){return{'model':db[_0x4a5d2d['model']],'as':_0x4a5d2d['as'],'attributes':_0x4a5d2d[_0xed6f('0x22')]};}):[]};}):[]};}):[]:[]})[_0xed6f('0xd')](function(_0x4bf25c){logger['info'](_0xed6f('0x24'),_0x128a24);logger[_0xed6f('0x11')]('ShowServicenowAccount',_0x128a24,JSON[_0xed6f('0x13')](_0x4bf25c));_0x504373(_0x4bf25c);})[_0xed6f('0x18')](function(_0x32ea1c){logger['error'](_0xed6f('0x24'),_0x32ea1c['message'],_0x128a24);_0x13bc66(_0x102487[_0xed6f('0x14')](0x1f4,_0x32ea1c['message']));});});}; \ No newline at end of file +var _0x89f2=['ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetServicenowAccount','findAll','raw','options','where','attributes','include','map','model','ShowServicenowAccount','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then'];(function(_0x1c8c18,_0x558a03){var _0x3c60d9=function(_0x367616){while(--_0x367616){_0x1c8c18['push'](_0x1c8c18['shift']());}};_0x3c60d9(++_0x558a03);}(_0x89f2,0x1ba));var _0x289f=function(_0x1b7368,_0x3286ed){_0x1b7368=_0x1b7368-0x0;var _0x25d54c=_0x89f2[_0x1b7368];return _0x25d54c;};'use strict';var _=require(_0x289f('0x0'));var util=require(_0x289f('0x1'));var moment=require('moment');var BPromise=require(_0x289f('0x2'));var rs=require(_0x289f('0x3'));var fs=require('fs');var Redis=require(_0x289f('0x4'));var db=require(_0x289f('0x5'))['db'];var utils=require(_0x289f('0x6'));var logger=require(_0x289f('0x7'))(_0x289f('0x8'));var config=require('../../config/environment');var jayson=require(_0x289f('0x9'));var client=jayson[_0x289f('0xa')][_0x289f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3bce97,_0x30ecc1,_0x30a497){return new BPromise(function(_0x4bdddb,_0x43e637){return client['request'](_0x3bce97,_0x30a497)[_0x289f('0xc')](function(_0x2fa7de){logger['info'](_0x289f('0xd'),_0x30ecc1,_0x289f('0xe'));logger[_0x289f('0xf')](_0x289f('0x10'),_0x30ecc1,'request\x20sent',JSON[_0x289f('0x11')](_0x2fa7de));if(_0x2fa7de['error']){if(_0x2fa7de[_0x289f('0x12')][_0x289f('0x13')]===0x1f4){logger[_0x289f('0x12')](_0x289f('0xd'),_0x30ecc1,_0x2fa7de['error'][_0x289f('0x14')]);return _0x43e637(_0x2fa7de[_0x289f('0x12')][_0x289f('0x14')]);}logger[_0x289f('0x12')](_0x289f('0xd'),_0x30ecc1,_0x2fa7de['error'][_0x289f('0x14')]);return _0x4bdddb(_0x2fa7de[_0x289f('0x12')]['message']);}else{logger[_0x289f('0x15')]('ServicenowAccount,\x20%s,\x20%s',_0x30ecc1,_0x289f('0xe'));_0x4bdddb(_0x2fa7de[_0x289f('0x16')][_0x289f('0x14')]);}})[_0x289f('0x17')](function(_0xf22209){logger[_0x289f('0x12')](_0x289f('0xd'),_0x30ecc1,_0xf22209);_0x43e637(_0xf22209);});});}exports[_0x289f('0x18')]=function(_0x15f36e){var _0x10cca8=this;return new Promise(function(_0x1ecfd3,_0x180a04){return db['ServicenowAccount'][_0x289f('0x19')]({'raw':_0x15f36e['options']?_0x15f36e['options'][_0x289f('0x1a')]===undefined?!![]:![]:!![],'where':_0x15f36e[_0x289f('0x1b')]?_0x15f36e['options'][_0x289f('0x1c')]||null:null,'attributes':_0x15f36e['options']?_0x15f36e[_0x289f('0x1b')][_0x289f('0x1d')]||null:null,'limit':_0x15f36e[_0x289f('0x1b')]?_0x15f36e[_0x289f('0x1b')]['limit']||null:null,'include':_0x15f36e['options']?_0x15f36e[_0x289f('0x1b')][_0x289f('0x1e')]?_[_0x289f('0x1f')](_0x15f36e[_0x289f('0x1b')][_0x289f('0x1e')],function(_0x698360){return{'model':db[_0x698360[_0x289f('0x20')]],'as':_0x698360['as'],'attributes':_0x698360['attributes'],'include':_0x698360[_0x289f('0x1e')]?_['map'](_0x698360[_0x289f('0x1e')],function(_0x442e78){return{'model':db[_0x442e78[_0x289f('0x20')]],'as':_0x442e78['as'],'attributes':_0x442e78[_0x289f('0x1d')],'include':_0x442e78[_0x289f('0x1e')]?_[_0x289f('0x1f')](_0x442e78[_0x289f('0x1e')],function(_0x49b258){return{'model':db[_0x49b258[_0x289f('0x20')]],'as':_0x49b258['as'],'attributes':_0x49b258[_0x289f('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x19414f){logger[_0x289f('0x15')]('GetServicenowAccount',_0x15f36e);logger[_0x289f('0xf')]('GetServicenowAccount',_0x15f36e,JSON[_0x289f('0x11')](_0x19414f));_0x1ecfd3(_0x19414f);})[_0x289f('0x17')](function(_0x1bf2a2){logger['error'](_0x289f('0x18'),_0x1bf2a2[_0x289f('0x14')],_0x15f36e);_0x180a04(_0x10cca8[_0x289f('0x12')](0x1f4,_0x1bf2a2[_0x289f('0x14')]));});});};exports[_0x289f('0x21')]=function(_0x485636){var _0xa219bc=this;return new Promise(function(_0x1247a9,_0x2031f4){return db['ServicenowAccount'][_0x289f('0x22')]({'raw':_0x485636[_0x289f('0x1b')]?_0x485636[_0x289f('0x1b')][_0x289f('0x1a')]===undefined?!![]:![]:!![],'where':_0x485636[_0x289f('0x1b')]?_0x485636[_0x289f('0x1b')][_0x289f('0x1c')]||null:null,'attributes':_0x485636['options']?_0x485636[_0x289f('0x1b')][_0x289f('0x1d')]||null:null,'include':_0x485636[_0x289f('0x1b')]?_0x485636[_0x289f('0x1b')][_0x289f('0x1e')]?_['map'](_0x485636[_0x289f('0x1b')][_0x289f('0x1e')],function(_0x4304db){return{'model':db[_0x4304db[_0x289f('0x20')]],'as':_0x4304db['as'],'attributes':_0x4304db[_0x289f('0x1d')],'include':_0x4304db['include']?_['map'](_0x4304db[_0x289f('0x1e')],function(_0x334dcd){return{'model':db[_0x334dcd[_0x289f('0x20')]],'as':_0x334dcd['as'],'attributes':_0x334dcd[_0x289f('0x1d')],'include':_0x334dcd[_0x289f('0x1e')]?_[_0x289f('0x1f')](_0x334dcd[_0x289f('0x1e')],function(_0x564daa){return{'model':db[_0x564daa['model']],'as':_0x564daa['as'],'attributes':_0x564daa[_0x289f('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x289f('0xc')](function(_0x5408ec){logger['info'](_0x289f('0x21'),_0x485636);logger[_0x289f('0xf')]('ShowServicenowAccount',_0x485636,JSON['stringify'](_0x5408ec));_0x1247a9(_0x5408ec);})[_0x289f('0x17')](function(_0x421989){logger['error'](_0x289f('0x21'),_0x421989[_0x289f('0x14')],_0x485636);_0x2031f4(_0xa219bc[_0x289f('0x12')](0x1f4,_0x421989[_0x289f('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 61b647a..d59b685 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 _0xecec=['index','get','/:id','show','/:id/fields','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../config/environment','isAuthenticated'];(function(_0x39336d,_0x36b4cf){var _0x34dc4d=function(_0xa40cc8){while(--_0xa40cc8){_0x39336d['push'](_0x39336d['shift']());}};_0x34dc4d(++_0x36b4cf);}(_0xecec,0x19d));var _0xcece=function(_0xf1f195,_0x1ba8e3){_0xf1f195=_0xf1f195-0x0;var _0x48b3b5=_0xecec[_0xf1f195];return _0x48b3b5;};'use strict';var multer=require(_0xcece('0x0'));var util=require('util');var path=require(_0xcece('0x1'));var timeout=require(_0xcece('0x2'));var express=require('express');var router=express[_0xcece('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xcece('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xcece('0x5'));var controller=require('./intServicenowConfiguration.controller');router['get']('/',auth[_0xcece('0x6')](),controller[_0xcece('0x7')]);router[_0xcece('0x8')](_0xcece('0x9'),auth[_0xcece('0x6')](),controller[_0xcece('0xa')]);router[_0xcece('0x8')](_0xcece('0xb'),auth['isAuthenticated'](),controller['getFields']);router[_0xcece('0x8')]('/:id/subjects',auth[_0xcece('0x6')](),controller[_0xcece('0xc')]);router[_0xcece('0x8')](_0xcece('0xd'),auth[_0xcece('0x6')](),controller[_0xcece('0xe')]);router[_0xcece('0xf')]('/',auth[_0xcece('0x6')](),controller[_0xcece('0x10')]);router[_0xcece('0x11')]('/:id',auth[_0xcece('0x6')](),controller[_0xcece('0x12')]);router['delete'](_0xcece('0x9'),auth[_0xcece('0x6')](),controller[_0xcece('0x13')]);module[_0xcece('0x14')]=router; \ No newline at end of file +var _0xaa21=['exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','put','update','delete','destroy'];(function(_0x131c37,_0x433467){var _0x44fd5a=function(_0x4d6cdf){while(--_0x4d6cdf){_0x131c37['push'](_0x131c37['shift']());}};_0x44fd5a(++_0x433467);}(_0xaa21,0xa2));var _0x1aa2=function(_0x57c70b,_0x3e3560){_0x57c70b=_0x57c70b-0x0;var _0x701f56=_0xaa21[_0x57c70b];return _0x701f56;};'use strict';var multer=require(_0x1aa2('0x0'));var util=require(_0x1aa2('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1aa2('0x2'));var router=express[_0x1aa2('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1aa2('0x4'));var interaction=require(_0x1aa2('0x5'));var config=require(_0x1aa2('0x6'));var controller=require(_0x1aa2('0x7'));router[_0x1aa2('0x8')]('/',auth[_0x1aa2('0x9')](),controller[_0x1aa2('0xa')]);router[_0x1aa2('0x8')](_0x1aa2('0xb'),auth['isAuthenticated'](),controller['show']);router['get'](_0x1aa2('0xc'),auth[_0x1aa2('0x9')](),controller[_0x1aa2('0xd')]);router[_0x1aa2('0x8')](_0x1aa2('0xe'),auth[_0x1aa2('0x9')](),controller[_0x1aa2('0xf')]);router[_0x1aa2('0x8')](_0x1aa2('0x10'),auth['isAuthenticated'](),controller[_0x1aa2('0x11')]);router['post']('/',auth[_0x1aa2('0x9')](),controller['create']);router[_0x1aa2('0x12')](_0x1aa2('0xb'),auth['isAuthenticated'](),controller[_0x1aa2('0x13')]);router[_0x1aa2('0x14')](_0x1aa2('0xb'),auth[_0x1aa2('0x9')](),controller[_0x1aa2('0x15')]);module[_0x1aa2('0x16')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index c5c69f6..06eddc0 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 _0xfcdd=['sequelize','exports','STRING'];(function(_0x3c2bfe,_0x2aa0c5){var _0x93f16=function(_0x573428){while(--_0x573428){_0x3c2bfe['push'](_0x3c2bfe['shift']());}};_0x93f16(++_0x2aa0c5);}(_0xfcdd,0x1c5));var _0xdfcd=function(_0x3a5435,_0x243b9f){_0x3a5435=_0x3a5435-0x0;var _0x384193=_0xfcdd[_0x3a5435];return _0x384193;};'use strict';var Sequelize=require(_0xdfcd('0x0'));module[_0xdfcd('0x1')]={'name':{'type':Sequelize[_0xdfcd('0x2')]},'description':{'type':Sequelize[_0xdfcd('0x2')]}}; \ No newline at end of file +var _0x5ab4=['STRING','sequelize','exports'];(function(_0x4b67ec,_0x1e6c44){var _0x3a4ed8=function(_0x55a7b1){while(--_0x55a7b1){_0x4b67ec['push'](_0x4b67ec['shift']());}};_0x3a4ed8(++_0x1e6c44);}(_0x5ab4,0x1ea));var _0x45ab=function(_0xb1e319,_0x39afde){_0xb1e319=_0xb1e319-0x0;var _0x1172c4=_0x5ab4[_0xb1e319];return _0x1172c4;};'use strict';var Sequelize=require(_0x45ab('0x0'));module[_0x45ab('0x1')]={'name':{'type':Sequelize[_0x45ab('0x2')]},'description':{'type':Sequelize[_0x45ab('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index d1bbd0b..4542dbc 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 _0xf0ed=['jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','end','error','stack','name','send','index','map','ServicenowConfiguration','rawAttributes','fieldName','type','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','findAll','rows','catch','params','includeAll','options','find','create','body','getFields','findOne','ServicenowField','pick','nolimit','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x48a5ec,_0x18476f){var _0x2664af=function(_0x3fa8b4){while(--_0x3fa8b4){_0x48a5ec['push'](_0x48a5ec['shift']());}};_0x2664af(++_0x18476f);}(_0xf0ed,0x194));var _0xdf0e=function(_0x2ce9d,_0x4ff962){_0x2ce9d=_0x2ce9d-0x0;var _0x578428=_0xf0ed[_0x2ce9d];return _0x578428;};'use strict';var emlformat=require(_0xdf0e('0x0'));var rimraf=require(_0xdf0e('0x1'));var zipdir=require(_0xdf0e('0x2'));var jsonpatch=require(_0xdf0e('0x3'));var rp=require(_0xdf0e('0x4'));var moment=require(_0xdf0e('0x5'));var BPromise=require(_0xdf0e('0x6'));var Mustache=require(_0xdf0e('0x7'));var util=require(_0xdf0e('0x8'));var path=require('path');var sox=require(_0xdf0e('0x9'));var csv=require(_0xdf0e('0xa'));var ejs=require(_0xdf0e('0xb'));var fs=require('fs');var fs_extra=require(_0xdf0e('0xc'));var _=require(_0xdf0e('0xd'));var squel=require(_0xdf0e('0xe'));var crypto=require(_0xdf0e('0xf'));var jsforce=require(_0xdf0e('0x10'));var deskjs=require(_0xdf0e('0x11'));var toCsv=require(_0xdf0e('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xdf0e('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xdf0e('0x13'));var as=require(_0xdf0e('0x14'));var hardwareService=require(_0xdf0e('0x15'));var logger=require(_0xdf0e('0x16'))(_0xdf0e('0x17'));var utils=require(_0xdf0e('0x18'));var config=require(_0xdf0e('0x19'));var licenseUtil=require(_0xdf0e('0x1a'));var db=require(_0xdf0e('0x1b'))['db'];function respondWithStatusCode(_0x204b58,_0x284345){_0x284345=_0x284345||0xcc;return function(_0x3a0f16){if(_0x3a0f16){return _0x204b58[_0xdf0e('0x1c')](_0x284345);}return _0x204b58[_0xdf0e('0x1d')](_0x284345)['end']();};}function respondWithResult(_0x695413,_0x4ee929){_0x4ee929=_0x4ee929||0xc8;return function(_0x3294cc){if(_0x3294cc){return _0x695413[_0xdf0e('0x1d')](_0x4ee929)[_0xdf0e('0x1e')](_0x3294cc);}};}function respondWithFilteredResult(_0x51be29,_0x524a7b){return function(_0x591cfb){if(_0x591cfb){var _0x31f4fe=typeof _0x524a7b[_0xdf0e('0x1f')]===_0xdf0e('0x20')&&typeof _0x524a7b[_0xdf0e('0x21')]===_0xdf0e('0x20');var _0x3c8609=_0x591cfb[_0xdf0e('0x22')];var _0x4b3ca1=_0x31f4fe?0x0:_0x524a7b[_0xdf0e('0x1f')];var _0x19d750=_0x31f4fe?_0x591cfb[_0xdf0e('0x22')]:_0x524a7b[_0xdf0e('0x1f')]+_0x524a7b[_0xdf0e('0x21')];var _0x3fc708;if(_0x19d750>=_0x3c8609){_0x19d750=_0x3c8609;_0x3fc708=0xc8;}else{_0x3fc708=0xce;}_0x51be29['status'](_0x3fc708);return _0x51be29[_0xdf0e('0x23')](_0xdf0e('0x24'),_0x4b3ca1+'-'+_0x19d750+'/'+_0x3c8609)[_0xdf0e('0x1e')](_0x591cfb);}return null;};}function patchUpdates(_0x47b4b4){return function(_0x4558b3){try{jsonpatch['apply'](_0x4558b3,_0x47b4b4,!![]);}catch(_0xea292a){return BPromise[_0xdf0e('0x25')](_0xea292a);}return _0x4558b3[_0xdf0e('0x26')]();};}function saveUpdates(_0x8fe0fb,_0x460f80){return function(_0x429d50){if(_0x429d50){return _0x429d50[_0xdf0e('0x27')](_0x8fe0fb)[_0xdf0e('0x28')](function(_0x3b06e3){return _0x3b06e3;});}return null;};}function removeEntity(_0x13cec2,_0x3dd7c7){return function(_0x2e565c){if(_0x2e565c){return _0x2e565c[_0xdf0e('0x29')]()[_0xdf0e('0x28')](function(){_0x13cec2['status'](0xcc)[_0xdf0e('0x2a')]();});}};}function handleEntityNotFound(_0x598224,_0x3af731){return function(_0x148edf){if(!_0x148edf){_0x598224[_0xdf0e('0x1c')](0x194);}return _0x148edf;};}function handleError(_0x3eb8c0,_0x5646f5){_0x5646f5=_0x5646f5||0x1f4;return function(_0x4f3aff){logger[_0xdf0e('0x2b')](_0x4f3aff[_0xdf0e('0x2c')]);if(_0x4f3aff[_0xdf0e('0x2d')]){delete _0x4f3aff[_0xdf0e('0x2d')];}_0x3eb8c0[_0xdf0e('0x1d')](_0x5646f5)[_0xdf0e('0x2e')](_0x4f3aff);};}exports[_0xdf0e('0x2f')]=function(_0x4a97aa,_0x51a704){var _0x359c44={},_0x2e29e8={},_0x5d8b0f={'count':0x0,'rows':[]};var _0x15133a=_[_0xdf0e('0x30')](db[_0xdf0e('0x31')][_0xdf0e('0x32')],function(_0x4ad61b){return{'name':_0x4ad61b[_0xdf0e('0x33')],'type':_0x4ad61b[_0xdf0e('0x34')]['key']};});_0x2e29e8['model']=_[_0xdf0e('0x30')](_0x15133a,'name');_0x2e29e8[_0xdf0e('0x35')]=_[_0xdf0e('0x36')](_0x4a97aa[_0xdf0e('0x35')]);_0x2e29e8[_0xdf0e('0x37')]=_['intersection'](_0x2e29e8[_0xdf0e('0x38')],_0x2e29e8[_0xdf0e('0x35')]);_0x359c44[_0xdf0e('0x39')]=_[_0xdf0e('0x3a')](_0x2e29e8[_0xdf0e('0x38')],qs[_0xdf0e('0x3b')](_0x4a97aa[_0xdf0e('0x35')][_0xdf0e('0x3b')]));_0x359c44[_0xdf0e('0x39')]=_0x359c44['attributes'][_0xdf0e('0x3c')]?_0x359c44['attributes']:_0x2e29e8[_0xdf0e('0x38')];if(!_0x4a97aa[_0xdf0e('0x35')][_0xdf0e('0x3d')]('nolimit')){_0x359c44[_0xdf0e('0x21')]=qs[_0xdf0e('0x21')](_0x4a97aa[_0xdf0e('0x35')][_0xdf0e('0x21')]);_0x359c44[_0xdf0e('0x1f')]=qs['offset'](_0x4a97aa[_0xdf0e('0x35')][_0xdf0e('0x1f')]);}_0x359c44[_0xdf0e('0x3e')]=qs['sort'](_0x4a97aa['query'][_0xdf0e('0x3f')]);_0x359c44[_0xdf0e('0x40')]=qs[_0xdf0e('0x37')](_['pick'](_0x4a97aa[_0xdf0e('0x35')],_0x2e29e8[_0xdf0e('0x37')]),_0x15133a);if(_0x4a97aa['query'][_0xdf0e('0x41')]){_0x359c44[_0xdf0e('0x40')]=_[_0xdf0e('0x42')](_0x359c44[_0xdf0e('0x40')],{'$or':_[_0xdf0e('0x30')](_0x15133a,function(_0x49bad2){if(_0x49bad2['type']!==_0xdf0e('0x43')){var _0x204496={};_0x204496[_0x49bad2[_0xdf0e('0x2d')]]={'$like':'%'+_0x4a97aa[_0xdf0e('0x35')][_0xdf0e('0x41')]+'%'};return _0x204496;}})});}_0x359c44=_[_0xdf0e('0x42')]({},_0x359c44,_0x4a97aa['options']);var _0x34b673={'where':_0x359c44['where']};return db[_0xdf0e('0x31')][_0xdf0e('0x22')](_0x34b673)[_0xdf0e('0x28')](function(_0x4e8f95){_0x5d8b0f[_0xdf0e('0x22')]=_0x4e8f95;if(_0x4a97aa[_0xdf0e('0x35')]['includeAll']){_0x359c44['include']=[{'all':!![]}];}return db[_0xdf0e('0x31')][_0xdf0e('0x44')](_0x359c44);})[_0xdf0e('0x28')](function(_0x1b4e78){_0x5d8b0f[_0xdf0e('0x45')]=_0x1b4e78;return _0x5d8b0f;})[_0xdf0e('0x28')](respondWithFilteredResult(_0x51a704,_0x359c44))[_0xdf0e('0x46')](handleError(_0x51a704,null));};exports['show']=function(_0x240868,_0x14e273){var _0x41241f={'raw':![],'where':{'id':_0x240868[_0xdf0e('0x47')]['id']}},_0x302b7f={};_0x302b7f[_0xdf0e('0x38')]=_[_0xdf0e('0x36')](db[_0xdf0e('0x31')][_0xdf0e('0x32')]);_0x302b7f['query']=_[_0xdf0e('0x36')](_0x240868[_0xdf0e('0x35')]);_0x302b7f[_0xdf0e('0x37')]=_[_0xdf0e('0x3a')](_0x302b7f['model'],_0x302b7f[_0xdf0e('0x35')]);_0x41241f['attributes']=_[_0xdf0e('0x3a')](_0x302b7f['model'],qs['fields'](_0x240868[_0xdf0e('0x35')][_0xdf0e('0x3b')]));_0x41241f[_0xdf0e('0x39')]=_0x41241f['attributes'][_0xdf0e('0x3c')]?_0x41241f['attributes']:_0x302b7f[_0xdf0e('0x38')];if(_0x240868[_0xdf0e('0x35')][_0xdf0e('0x48')]){_0x41241f['include']=[{'all':!![]}];}_0x41241f=_[_0xdf0e('0x42')]({},_0x41241f,_0x240868[_0xdf0e('0x49')]);return db[_0xdf0e('0x31')][_0xdf0e('0x4a')](_0x41241f)[_0xdf0e('0x28')](handleEntityNotFound(_0x14e273,null))[_0xdf0e('0x28')](respondWithResult(_0x14e273,null))[_0xdf0e('0x46')](handleError(_0x14e273,null));};exports[_0xdf0e('0x4b')]=function(_0x16104c,_0xf05b7c){return db['ServicenowConfiguration'][_0xdf0e('0x4b')](_0x16104c['body'],{})[_0xdf0e('0x28')](respondWithResult(_0xf05b7c,0xc9))[_0xdf0e('0x46')](handleError(_0xf05b7c,null));};exports[_0xdf0e('0x27')]=function(_0x44e732,_0x18c302){if(_0x44e732['body']['id']){delete _0x44e732[_0xdf0e('0x4c')]['id'];}return db[_0xdf0e('0x31')][_0xdf0e('0x4a')]({'where':{'id':_0x44e732['params']['id']}})[_0xdf0e('0x28')](handleEntityNotFound(_0x18c302,null))[_0xdf0e('0x28')](saveUpdates(_0x44e732[_0xdf0e('0x4c')],null))['then'](respondWithResult(_0x18c302,null))['catch'](handleError(_0x18c302,null));};exports[_0xdf0e('0x29')]=function(_0x10e261,_0x595fd6){return db[_0xdf0e('0x31')]['find']({'where':{'id':_0x10e261[_0xdf0e('0x47')]['id']}})[_0xdf0e('0x28')](handleEntityNotFound(_0x595fd6,null))[_0xdf0e('0x28')](removeEntity(_0x595fd6,null))[_0xdf0e('0x46')](handleError(_0x595fd6,null));};exports[_0xdf0e('0x4d')]=function(_0x5a17bf,_0x544c2e,_0x5cd294){var _0x50816a={};var _0x53b433={};var _0x4b1a85;var _0x1db679;return db[_0xdf0e('0x31')][_0xdf0e('0x4e')]({'where':{'id':_0x5a17bf[_0xdf0e('0x47')]['id']}})[_0xdf0e('0x28')](handleEntityNotFound(_0x544c2e,null))['then'](function(_0x149884){if(_0x149884){_0x4b1a85=_0x149884;_0x53b433[_0xdf0e('0x38')]=_[_0xdf0e('0x36')](db[_0xdf0e('0x4f')]['rawAttributes']);_0x53b433[_0xdf0e('0x35')]=_['keys'](_0x5a17bf[_0xdf0e('0x35')]);_0x53b433[_0xdf0e('0x37')]=_[_0xdf0e('0x3a')](_0x53b433['model'],_0x53b433[_0xdf0e('0x35')]);_0x50816a['attributes']=_[_0xdf0e('0x3a')](_0x53b433[_0xdf0e('0x38')],qs[_0xdf0e('0x3b')](_0x5a17bf[_0xdf0e('0x35')][_0xdf0e('0x3b')]));_0x50816a['attributes']=_0x50816a[_0xdf0e('0x39')]['length']?_0x50816a[_0xdf0e('0x39')]:_0x53b433[_0xdf0e('0x38')];_0x50816a['order']=qs['sort'](_0x5a17bf[_0xdf0e('0x35')][_0xdf0e('0x3f')]);_0x50816a['where']=qs[_0xdf0e('0x37')](_[_0xdf0e('0x50')](_0x5a17bf[_0xdf0e('0x35')],_0x53b433[_0xdf0e('0x37')]));if(_0x5a17bf[_0xdf0e('0x35')][_0xdf0e('0x41')]){_0x50816a[_0xdf0e('0x40')]=_['merge'](_0x50816a[_0xdf0e('0x40')],{'$or':_[_0xdf0e('0x30')](_0x50816a[_0xdf0e('0x39')],function(_0x4a9ef0){var _0x52e697={};_0x52e697[_0x4a9ef0]={'$like':'%'+_0x5a17bf[_0xdf0e('0x35')]['filter']+'%'};return _0x52e697;})});}_0x50816a=_[_0xdf0e('0x42')]({},_0x50816a,_0x5a17bf[_0xdf0e('0x49')]);return _0x4b1a85[_0xdf0e('0x4d')](_0x50816a);}})[_0xdf0e('0x28')](function(_0x49411f){if(_0x49411f){_0x1db679=_0x49411f[_0xdf0e('0x3c')];if(!_0x5a17bf[_0xdf0e('0x35')][_0xdf0e('0x3d')](_0xdf0e('0x51'))){_0x50816a['limit']=qs['limit'](_0x5a17bf['query'][_0xdf0e('0x21')]);_0x50816a[_0xdf0e('0x1f')]=qs['offset'](_0x5a17bf[_0xdf0e('0x35')][_0xdf0e('0x1f')]);}return _0x4b1a85[_0xdf0e('0x4d')](_0x50816a);}})[_0xdf0e('0x28')](function(_0x34ecaa){if(_0x34ecaa){return _0x34ecaa?{'count':_0x1db679,'rows':_0x34ecaa}:null;}})[_0xdf0e('0x28')](respondWithResult(_0x544c2e,null))['catch'](handleError(_0x544c2e,null));};exports['getSubjects']=function(_0x2aea3b,_0xd9de0c,_0x2dd7e2){var _0x121097={};var _0x472062={};var _0x2e7521;var _0x262a1b;return db['ServicenowConfiguration'][_0xdf0e('0x4e')]({'where':{'id':_0x2aea3b[_0xdf0e('0x47')]['id']}})[_0xdf0e('0x28')](handleEntityNotFound(_0xd9de0c,null))['then'](function(_0x216e54){if(_0x216e54){_0x2e7521=_0x216e54;_0x472062['model']=_['keys'](db[_0xdf0e('0x4f')][_0xdf0e('0x32')]);_0x472062[_0xdf0e('0x35')]=_[_0xdf0e('0x36')](_0x2aea3b[_0xdf0e('0x35')]);_0x472062['filters']=_['intersection'](_0x472062['model'],_0x472062[_0xdf0e('0x35')]);_0x121097[_0xdf0e('0x39')]=_[_0xdf0e('0x3a')](_0x472062['model'],qs[_0xdf0e('0x3b')](_0x2aea3b[_0xdf0e('0x35')]['fields']));_0x121097[_0xdf0e('0x39')]=_0x121097[_0xdf0e('0x39')][_0xdf0e('0x3c')]?_0x121097[_0xdf0e('0x39')]:_0x472062[_0xdf0e('0x38')];_0x121097[_0xdf0e('0x3e')]=qs[_0xdf0e('0x3f')](_0x2aea3b[_0xdf0e('0x35')][_0xdf0e('0x3f')]);_0x121097[_0xdf0e('0x40')]=qs[_0xdf0e('0x37')](_[_0xdf0e('0x50')](_0x2aea3b[_0xdf0e('0x35')],_0x472062[_0xdf0e('0x37')]));if(_0x2aea3b[_0xdf0e('0x35')][_0xdf0e('0x41')]){_0x121097[_0xdf0e('0x40')]=_[_0xdf0e('0x42')](_0x121097[_0xdf0e('0x40')],{'$or':_[_0xdf0e('0x30')](_0x121097[_0xdf0e('0x39')],function(_0x1ddc07){var _0x465f75={};_0x465f75[_0x1ddc07]={'$like':'%'+_0x2aea3b[_0xdf0e('0x35')][_0xdf0e('0x41')]+'%'};return _0x465f75;})});}_0x121097=_[_0xdf0e('0x42')]({},_0x121097,_0x2aea3b[_0xdf0e('0x49')]);return _0x2e7521[_0xdf0e('0x52')](_0x121097);}})['then'](function(_0x24addc){if(_0x24addc){_0x262a1b=_0x24addc[_0xdf0e('0x3c')];if(!_0x2aea3b['query'][_0xdf0e('0x3d')](_0xdf0e('0x51'))){_0x121097[_0xdf0e('0x21')]=qs[_0xdf0e('0x21')](_0x2aea3b[_0xdf0e('0x35')][_0xdf0e('0x21')]);_0x121097[_0xdf0e('0x1f')]=qs['offset'](_0x2aea3b['query']['offset']);}return _0x2e7521['getSubjects'](_0x121097);}})[_0xdf0e('0x28')](function(_0x1b392e){if(_0x1b392e){return _0x1b392e?{'count':_0x262a1b,'rows':_0x1b392e}:null;}})[_0xdf0e('0x28')](respondWithResult(_0xd9de0c,null))['catch'](handleError(_0xd9de0c,null));};exports[_0xdf0e('0x53')]=function(_0x1ae5b4,_0x522cb2,_0x74fcd2){var _0x37f58e={};var _0x462f13={};var _0x1dcc05;var _0x43bb5f;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x1ae5b4[_0xdf0e('0x47')]['id']}})[_0xdf0e('0x28')](handleEntityNotFound(_0x522cb2,null))['then'](function(_0x1193fe){if(_0x1193fe){_0x1dcc05=_0x1193fe;_0x462f13[_0xdf0e('0x38')]=_['keys'](db[_0xdf0e('0x4f')][_0xdf0e('0x32')]);_0x462f13['query']=_[_0xdf0e('0x36')](_0x1ae5b4[_0xdf0e('0x35')]);_0x462f13[_0xdf0e('0x37')]=_[_0xdf0e('0x3a')](_0x462f13[_0xdf0e('0x38')],_0x462f13[_0xdf0e('0x35')]);_0x37f58e[_0xdf0e('0x39')]=_[_0xdf0e('0x3a')](_0x462f13[_0xdf0e('0x38')],qs[_0xdf0e('0x3b')](_0x1ae5b4[_0xdf0e('0x35')]['fields']));_0x37f58e['attributes']=_0x37f58e[_0xdf0e('0x39')][_0xdf0e('0x3c')]?_0x37f58e[_0xdf0e('0x39')]:_0x462f13[_0xdf0e('0x38')];_0x37f58e[_0xdf0e('0x3e')]=qs[_0xdf0e('0x3f')](_0x1ae5b4[_0xdf0e('0x35')][_0xdf0e('0x3f')]);_0x37f58e[_0xdf0e('0x40')]=qs['filters'](_[_0xdf0e('0x50')](_0x1ae5b4[_0xdf0e('0x35')],_0x462f13['filters']));if(_0x1ae5b4[_0xdf0e('0x35')][_0xdf0e('0x41')]){_0x37f58e[_0xdf0e('0x40')]=_[_0xdf0e('0x42')](_0x37f58e['where'],{'$or':_[_0xdf0e('0x30')](_0x37f58e[_0xdf0e('0x39')],function(_0x71b242){var _0x2163d2={};_0x2163d2[_0x71b242]={'$like':'%'+_0x1ae5b4[_0xdf0e('0x35')]['filter']+'%'};return _0x2163d2;})});}_0x37f58e=_['merge']({},_0x37f58e,_0x1ae5b4[_0xdf0e('0x49')]);return _0x1dcc05[_0xdf0e('0x53')](_0x37f58e);}})['then'](function(_0xe59220){if(_0xe59220){_0x43bb5f=_0xe59220[_0xdf0e('0x3c')];if(!_0x1ae5b4[_0xdf0e('0x35')][_0xdf0e('0x3d')](_0xdf0e('0x51'))){_0x37f58e[_0xdf0e('0x21')]=qs[_0xdf0e('0x21')](_0x1ae5b4['query']['limit']);_0x37f58e[_0xdf0e('0x1f')]=qs[_0xdf0e('0x1f')](_0x1ae5b4['query'][_0xdf0e('0x1f')]);}return _0x1dcc05[_0xdf0e('0x53')](_0x37f58e);}})[_0xdf0e('0x28')](function(_0x19ef3c){if(_0x19ef3c){return _0x19ef3c?{'count':_0x43bb5f,'rows':_0x19ef3c}:null;}})[_0xdf0e('0x28')](respondWithResult(_0x522cb2,null))[_0xdf0e('0x46')](handleError(_0x522cb2,null));}; \ No newline at end of file +var _0x733c=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','offset','undefined','limit','count','status','Content-Range','apply','reject','save','then','end','error','name','send','index','ServicenowConfiguration','rawAttributes','fieldName','key','model','map','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','includeAll','include','rows','show','params','keys','create','update','body','find','catch','destroy','findOne','options','getFields','hasOwnProperty','getSubjects','ServicenowField','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x380575,_0xc72d46){var _0x15080a=function(_0x5f1ac5){while(--_0x5f1ac5){_0x380575['push'](_0x380575['shift']());}};_0x15080a(++_0xc72d46);}(_0x733c,0x18c));var _0xc733=function(_0x14e89d,_0x4a5ee2){_0x14e89d=_0x14e89d-0x0;var _0x2f895e=_0x733c[_0x14e89d];return _0x2f895e;};'use strict';var emlformat=require(_0xc733('0x0'));var rimraf=require(_0xc733('0x1'));var zipdir=require(_0xc733('0x2'));var jsonpatch=require(_0xc733('0x3'));var rp=require(_0xc733('0x4'));var moment=require(_0xc733('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc733('0x6'));var path=require(_0xc733('0x7'));var sox=require(_0xc733('0x8'));var csv=require(_0xc733('0x9'));var ejs=require(_0xc733('0xa'));var fs=require('fs');var fs_extra=require(_0xc733('0xb'));var _=require(_0xc733('0xc'));var squel=require(_0xc733('0xd'));var crypto=require('crypto');var jsforce=require(_0xc733('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xc733('0x9'));var querystring=require(_0xc733('0xf'));var Papa=require(_0xc733('0x10'));var Redis=require(_0xc733('0x11'));var authService=require(_0xc733('0x12'));var qs=require(_0xc733('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc733('0x14'));var logger=require(_0xc733('0x15'))(_0xc733('0x16'));var utils=require(_0xc733('0x17'));var config=require(_0xc733('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xc733('0x19'))['db'];function respondWithStatusCode(_0x43d921,_0x2c7c13){_0x2c7c13=_0x2c7c13||0xcc;return function(_0x49c9e9){if(_0x49c9e9){return _0x43d921[_0xc733('0x1a')](_0x2c7c13);}return _0x43d921['status'](_0x2c7c13)['end']();};}function respondWithResult(_0x82826d,_0x5e0305){_0x5e0305=_0x5e0305||0xc8;return function(_0x46343c){if(_0x46343c){return _0x82826d['status'](_0x5e0305)[_0xc733('0x1b')](_0x46343c);}};}function respondWithFilteredResult(_0x56e4c7,_0x103b90){return function(_0x5db9a4){if(_0x5db9a4){var _0x2d9a3e=typeof _0x103b90[_0xc733('0x1c')]===_0xc733('0x1d')&&typeof _0x103b90[_0xc733('0x1e')]===_0xc733('0x1d');var _0x56bc7f=_0x5db9a4[_0xc733('0x1f')];var _0x328621=_0x2d9a3e?0x0:_0x103b90[_0xc733('0x1c')];var _0x8ea8f=_0x2d9a3e?_0x5db9a4[_0xc733('0x1f')]:_0x103b90[_0xc733('0x1c')]+_0x103b90[_0xc733('0x1e')];var _0x266ea3;if(_0x8ea8f>=_0x56bc7f){_0x8ea8f=_0x56bc7f;_0x266ea3=0xc8;}else{_0x266ea3=0xce;}_0x56e4c7[_0xc733('0x20')](_0x266ea3);return _0x56e4c7['set'](_0xc733('0x21'),_0x328621+'-'+_0x8ea8f+'/'+_0x56bc7f)[_0xc733('0x1b')](_0x5db9a4);}return null;};}function patchUpdates(_0x3dd1cb){return function(_0x11a199){try{jsonpatch[_0xc733('0x22')](_0x11a199,_0x3dd1cb,!![]);}catch(_0x2992e7){return BPromise[_0xc733('0x23')](_0x2992e7);}return _0x11a199[_0xc733('0x24')]();};}function saveUpdates(_0x1de4ef,_0x5d4ac6){return function(_0x275956){if(_0x275956){return _0x275956['update'](_0x1de4ef)['then'](function(_0x1abaaf){return _0x1abaaf;});}return null;};}function removeEntity(_0x3d8576,_0x453db0){return function(_0x394eb8){if(_0x394eb8){return _0x394eb8['destroy']()[_0xc733('0x25')](function(){_0x3d8576[_0xc733('0x20')](0xcc)[_0xc733('0x26')]();});}};}function handleEntityNotFound(_0x340ffc,_0x48f795){return function(_0x53b580){if(!_0x53b580){_0x340ffc[_0xc733('0x1a')](0x194);}return _0x53b580;};}function handleError(_0x3991d9,_0x4d28e1){_0x4d28e1=_0x4d28e1||0x1f4;return function(_0x39a475){logger[_0xc733('0x27')](_0x39a475['stack']);if(_0x39a475['name']){delete _0x39a475[_0xc733('0x28')];}_0x3991d9[_0xc733('0x20')](_0x4d28e1)[_0xc733('0x29')](_0x39a475);};}exports[_0xc733('0x2a')]=function(_0x48aaf8,_0x13ce24){var _0x2b1f89={},_0x2f67b3={},_0x123c7f={'count':0x0,'rows':[]};var _0x4746d8=_['map'](db[_0xc733('0x2b')][_0xc733('0x2c')],function(_0x3ff40f){return{'name':_0x3ff40f[_0xc733('0x2d')],'type':_0x3ff40f['type'][_0xc733('0x2e')]};});_0x2f67b3[_0xc733('0x2f')]=_[_0xc733('0x30')](_0x4746d8,_0xc733('0x28'));_0x2f67b3[_0xc733('0x31')]=_['keys'](_0x48aaf8[_0xc733('0x31')]);_0x2f67b3[_0xc733('0x32')]=_[_0xc733('0x33')](_0x2f67b3[_0xc733('0x2f')],_0x2f67b3['query']);_0x2b1f89[_0xc733('0x34')]=_['intersection'](_0x2f67b3[_0xc733('0x2f')],qs[_0xc733('0x35')](_0x48aaf8[_0xc733('0x31')][_0xc733('0x35')]));_0x2b1f89[_0xc733('0x34')]=_0x2b1f89['attributes'][_0xc733('0x36')]?_0x2b1f89[_0xc733('0x34')]:_0x2f67b3['model'];if(!_0x48aaf8[_0xc733('0x31')]['hasOwnProperty'](_0xc733('0x37'))){_0x2b1f89[_0xc733('0x1e')]=qs[_0xc733('0x1e')](_0x48aaf8[_0xc733('0x31')][_0xc733('0x1e')]);_0x2b1f89[_0xc733('0x1c')]=qs['offset'](_0x48aaf8[_0xc733('0x31')][_0xc733('0x1c')]);}_0x2b1f89[_0xc733('0x38')]=qs[_0xc733('0x39')](_0x48aaf8['query'][_0xc733('0x39')]);_0x2b1f89[_0xc733('0x3a')]=qs[_0xc733('0x32')](_[_0xc733('0x3b')](_0x48aaf8['query'],_0x2f67b3[_0xc733('0x32')]),_0x4746d8);if(_0x48aaf8[_0xc733('0x31')][_0xc733('0x3c')]){_0x2b1f89[_0xc733('0x3a')]=_['merge'](_0x2b1f89[_0xc733('0x3a')],{'$or':_[_0xc733('0x30')](_0x4746d8,function(_0x2e8777){if(_0x2e8777[_0xc733('0x3d')]!==_0xc733('0x3e')){var _0x4179b5={};_0x4179b5[_0x2e8777[_0xc733('0x28')]]={'$like':'%'+_0x48aaf8[_0xc733('0x31')]['filter']+'%'};return _0x4179b5;}})});}_0x2b1f89=_[_0xc733('0x3f')]({},_0x2b1f89,_0x48aaf8['options']);var _0x2bbe4c={'where':_0x2b1f89[_0xc733('0x3a')]};return db[_0xc733('0x2b')][_0xc733('0x1f')](_0x2bbe4c)['then'](function(_0x2d1e0a){_0x123c7f[_0xc733('0x1f')]=_0x2d1e0a;if(_0x48aaf8['query'][_0xc733('0x40')]){_0x2b1f89[_0xc733('0x41')]=[{'all':!![]}];}return db[_0xc733('0x2b')]['findAll'](_0x2b1f89);})[_0xc733('0x25')](function(_0x24e0f7){_0x123c7f[_0xc733('0x42')]=_0x24e0f7;return _0x123c7f;})[_0xc733('0x25')](respondWithFilteredResult(_0x13ce24,_0x2b1f89))['catch'](handleError(_0x13ce24,null));};exports[_0xc733('0x43')]=function(_0x61e6db,_0x4ad1ed){var _0x1298a6={'raw':![],'where':{'id':_0x61e6db[_0xc733('0x44')]['id']}},_0x4a9cb4={};_0x4a9cb4[_0xc733('0x2f')]=_[_0xc733('0x45')](db[_0xc733('0x2b')][_0xc733('0x2c')]);_0x4a9cb4[_0xc733('0x31')]=_['keys'](_0x61e6db['query']);_0x4a9cb4[_0xc733('0x32')]=_[_0xc733('0x33')](_0x4a9cb4[_0xc733('0x2f')],_0x4a9cb4[_0xc733('0x31')]);_0x1298a6[_0xc733('0x34')]=_['intersection'](_0x4a9cb4[_0xc733('0x2f')],qs[_0xc733('0x35')](_0x61e6db[_0xc733('0x31')][_0xc733('0x35')]));_0x1298a6[_0xc733('0x34')]=_0x1298a6[_0xc733('0x34')][_0xc733('0x36')]?_0x1298a6[_0xc733('0x34')]:_0x4a9cb4['model'];if(_0x61e6db[_0xc733('0x31')][_0xc733('0x40')]){_0x1298a6['include']=[{'all':!![]}];}_0x1298a6=_[_0xc733('0x3f')]({},_0x1298a6,_0x61e6db['options']);return db[_0xc733('0x2b')]['find'](_0x1298a6)['then'](handleEntityNotFound(_0x4ad1ed,null))['then'](respondWithResult(_0x4ad1ed,null))['catch'](handleError(_0x4ad1ed,null));};exports[_0xc733('0x46')]=function(_0x5d53ba,_0x54cf6c){return db['ServicenowConfiguration']['create'](_0x5d53ba['body'],{})[_0xc733('0x25')](respondWithResult(_0x54cf6c,0xc9))['catch'](handleError(_0x54cf6c,null));};exports[_0xc733('0x47')]=function(_0x43478b,_0x2798fa){if(_0x43478b[_0xc733('0x48')]['id']){delete _0x43478b['body']['id'];}return db[_0xc733('0x2b')][_0xc733('0x49')]({'where':{'id':_0x43478b[_0xc733('0x44')]['id']}})[_0xc733('0x25')](handleEntityNotFound(_0x2798fa,null))['then'](saveUpdates(_0x43478b[_0xc733('0x48')],null))[_0xc733('0x25')](respondWithResult(_0x2798fa,null))[_0xc733('0x4a')](handleError(_0x2798fa,null));};exports[_0xc733('0x4b')]=function(_0x1ed68c,_0x3144de){return db[_0xc733('0x2b')][_0xc733('0x49')]({'where':{'id':_0x1ed68c[_0xc733('0x44')]['id']}})['then'](handleEntityNotFound(_0x3144de,null))[_0xc733('0x25')](removeEntity(_0x3144de,null))[_0xc733('0x4a')](handleError(_0x3144de,null));};exports['getFields']=function(_0x5406ca,_0x46d887,_0x10be3d){var _0x184632={};var _0x5cb67c={};var _0x5e7e4c;var _0x2502d9;return db[_0xc733('0x2b')][_0xc733('0x4c')]({'where':{'id':_0x5406ca[_0xc733('0x44')]['id']}})[_0xc733('0x25')](handleEntityNotFound(_0x46d887,null))['then'](function(_0x380b3b){if(_0x380b3b){_0x5e7e4c=_0x380b3b;_0x5cb67c['model']=_['keys'](db['ServicenowField']['rawAttributes']);_0x5cb67c[_0xc733('0x31')]=_[_0xc733('0x45')](_0x5406ca['query']);_0x5cb67c['filters']=_[_0xc733('0x33')](_0x5cb67c['model'],_0x5cb67c[_0xc733('0x31')]);_0x184632['attributes']=_[_0xc733('0x33')](_0x5cb67c[_0xc733('0x2f')],qs[_0xc733('0x35')](_0x5406ca[_0xc733('0x31')][_0xc733('0x35')]));_0x184632[_0xc733('0x34')]=_0x184632[_0xc733('0x34')][_0xc733('0x36')]?_0x184632[_0xc733('0x34')]:_0x5cb67c[_0xc733('0x2f')];_0x184632['order']=qs[_0xc733('0x39')](_0x5406ca[_0xc733('0x31')][_0xc733('0x39')]);_0x184632[_0xc733('0x3a')]=qs[_0xc733('0x32')](_[_0xc733('0x3b')](_0x5406ca['query'],_0x5cb67c['filters']));if(_0x5406ca['query'][_0xc733('0x3c')]){_0x184632[_0xc733('0x3a')]=_['merge'](_0x184632[_0xc733('0x3a')],{'$or':_['map'](_0x184632[_0xc733('0x34')],function(_0x52c205){var _0x4ff5aa={};_0x4ff5aa[_0x52c205]={'$like':'%'+_0x5406ca['query'][_0xc733('0x3c')]+'%'};return _0x4ff5aa;})});}_0x184632=_[_0xc733('0x3f')]({},_0x184632,_0x5406ca[_0xc733('0x4d')]);return _0x5e7e4c[_0xc733('0x4e')](_0x184632);}})['then'](function(_0x259f9f){if(_0x259f9f){_0x2502d9=_0x259f9f[_0xc733('0x36')];if(!_0x5406ca['query'][_0xc733('0x4f')](_0xc733('0x37'))){_0x184632[_0xc733('0x1e')]=qs[_0xc733('0x1e')](_0x5406ca[_0xc733('0x31')][_0xc733('0x1e')]);_0x184632[_0xc733('0x1c')]=qs[_0xc733('0x1c')](_0x5406ca[_0xc733('0x31')][_0xc733('0x1c')]);}return _0x5e7e4c['getFields'](_0x184632);}})['then'](function(_0x88aed5){if(_0x88aed5){return _0x88aed5?{'count':_0x2502d9,'rows':_0x88aed5}:null;}})['then'](respondWithResult(_0x46d887,null))['catch'](handleError(_0x46d887,null));};exports[_0xc733('0x50')]=function(_0x140bb7,_0x316780,_0x487bf6){var _0xec01aa={};var _0x25c537={};var _0x524f59;var _0x4e5029;return db[_0xc733('0x2b')][_0xc733('0x4c')]({'where':{'id':_0x140bb7['params']['id']}})[_0xc733('0x25')](handleEntityNotFound(_0x316780,null))[_0xc733('0x25')](function(_0x4c4f4d){if(_0x4c4f4d){_0x524f59=_0x4c4f4d;_0x25c537[_0xc733('0x2f')]=_['keys'](db[_0xc733('0x51')][_0xc733('0x2c')]);_0x25c537[_0xc733('0x31')]=_[_0xc733('0x45')](_0x140bb7['query']);_0x25c537[_0xc733('0x32')]=_[_0xc733('0x33')](_0x25c537[_0xc733('0x2f')],_0x25c537['query']);_0xec01aa['attributes']=_[_0xc733('0x33')](_0x25c537[_0xc733('0x2f')],qs['fields'](_0x140bb7[_0xc733('0x31')][_0xc733('0x35')]));_0xec01aa[_0xc733('0x34')]=_0xec01aa[_0xc733('0x34')][_0xc733('0x36')]?_0xec01aa[_0xc733('0x34')]:_0x25c537['model'];_0xec01aa[_0xc733('0x38')]=qs['sort'](_0x140bb7[_0xc733('0x31')][_0xc733('0x39')]);_0xec01aa[_0xc733('0x3a')]=qs[_0xc733('0x32')](_[_0xc733('0x3b')](_0x140bb7[_0xc733('0x31')],_0x25c537[_0xc733('0x32')]));if(_0x140bb7['query'][_0xc733('0x3c')]){_0xec01aa['where']=_[_0xc733('0x3f')](_0xec01aa['where'],{'$or':_['map'](_0xec01aa[_0xc733('0x34')],function(_0x1882e8){var _0x16f4c2={};_0x16f4c2[_0x1882e8]={'$like':'%'+_0x140bb7[_0xc733('0x31')][_0xc733('0x3c')]+'%'};return _0x16f4c2;})});}_0xec01aa=_[_0xc733('0x3f')]({},_0xec01aa,_0x140bb7[_0xc733('0x4d')]);return _0x524f59['getSubjects'](_0xec01aa);}})[_0xc733('0x25')](function(_0x36b362){if(_0x36b362){_0x4e5029=_0x36b362[_0xc733('0x36')];if(!_0x140bb7[_0xc733('0x31')][_0xc733('0x4f')](_0xc733('0x37'))){_0xec01aa[_0xc733('0x1e')]=qs[_0xc733('0x1e')](_0x140bb7[_0xc733('0x31')]['limit']);_0xec01aa[_0xc733('0x1c')]=qs[_0xc733('0x1c')](_0x140bb7[_0xc733('0x31')][_0xc733('0x1c')]);}return _0x524f59['getSubjects'](_0xec01aa);}})[_0xc733('0x25')](function(_0xd5306f){if(_0xd5306f){return _0xd5306f?{'count':_0x4e5029,'rows':_0xd5306f}:null;}})['then'](respondWithResult(_0x316780,null))['catch'](handleError(_0x316780,null));};exports[_0xc733('0x52')]=function(_0x4c02c8,_0x219801,_0x18d0dd){var _0x4c1be4={};var _0x426e8c={};var _0x527cf6;var _0x5429e0;return db['ServicenowConfiguration'][_0xc733('0x4c')]({'where':{'id':_0x4c02c8[_0xc733('0x44')]['id']}})[_0xc733('0x25')](handleEntityNotFound(_0x219801,null))['then'](function(_0x246488){if(_0x246488){_0x527cf6=_0x246488;_0x426e8c['model']=_[_0xc733('0x45')](db[_0xc733('0x51')][_0xc733('0x2c')]);_0x426e8c[_0xc733('0x31')]=_[_0xc733('0x45')](_0x4c02c8['query']);_0x426e8c['filters']=_['intersection'](_0x426e8c[_0xc733('0x2f')],_0x426e8c[_0xc733('0x31')]);_0x4c1be4[_0xc733('0x34')]=_[_0xc733('0x33')](_0x426e8c[_0xc733('0x2f')],qs[_0xc733('0x35')](_0x4c02c8[_0xc733('0x31')][_0xc733('0x35')]));_0x4c1be4[_0xc733('0x34')]=_0x4c1be4[_0xc733('0x34')][_0xc733('0x36')]?_0x4c1be4[_0xc733('0x34')]:_0x426e8c[_0xc733('0x2f')];_0x4c1be4[_0xc733('0x38')]=qs[_0xc733('0x39')](_0x4c02c8[_0xc733('0x31')][_0xc733('0x39')]);_0x4c1be4[_0xc733('0x3a')]=qs[_0xc733('0x32')](_[_0xc733('0x3b')](_0x4c02c8[_0xc733('0x31')],_0x426e8c['filters']));if(_0x4c02c8[_0xc733('0x31')][_0xc733('0x3c')]){_0x4c1be4['where']=_[_0xc733('0x3f')](_0x4c1be4[_0xc733('0x3a')],{'$or':_['map'](_0x4c1be4[_0xc733('0x34')],function(_0x24aed8){var _0x357814={};_0x357814[_0x24aed8]={'$like':'%'+_0x4c02c8[_0xc733('0x31')][_0xc733('0x3c')]+'%'};return _0x357814;})});}_0x4c1be4=_[_0xc733('0x3f')]({},_0x4c1be4,_0x4c02c8[_0xc733('0x4d')]);return _0x527cf6[_0xc733('0x52')](_0x4c1be4);}})['then'](function(_0x1d1e99){if(_0x1d1e99){_0x5429e0=_0x1d1e99[_0xc733('0x36')];if(!_0x4c02c8[_0xc733('0x31')]['hasOwnProperty']('nolimit')){_0x4c1be4[_0xc733('0x1e')]=qs[_0xc733('0x1e')](_0x4c02c8[_0xc733('0x31')][_0xc733('0x1e')]);_0x4c1be4['offset']=qs['offset'](_0x4c02c8['query'][_0xc733('0x1c')]);}return _0x527cf6['getDescriptions'](_0x4c1be4);}})[_0xc733('0x25')](function(_0x45e81d){if(_0x45e81d){return _0x45e81d?{'count':_0x5429e0,'rows':_0x45e81d}:null;}})['then'](respondWithResult(_0x219801,null))['catch'](handleError(_0x219801,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 2680dbe..165f7ef 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 _0x86c0=['path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','define','ServicenowConfiguration','int_servicenow_configurations','lodash','../../config/logger','api','moment','bluebird'];(function(_0xa4c85,_0x2b52a7){var _0x172c1f=function(_0x149473){while(--_0x149473){_0xa4c85['push'](_0xa4c85['shift']());}};_0x172c1f(++_0x2b52a7);}(_0x86c0,0x133));var _0x086c=function(_0xfa9b97,_0x24a570){_0xfa9b97=_0xfa9b97-0x0;var _0x48cc61=_0x86c0[_0xfa9b97];return _0x48cc61;};'use strict';var _=require(_0x086c('0x0'));var util=require('util');var logger=require(_0x086c('0x1'))(_0x086c('0x2'));var moment=require(_0x086c('0x3'));var BPromise=require(_0x086c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x086c('0x5'));var rimraf=require(_0x086c('0x6'));var config=require(_0x086c('0x7'));var attributes=require(_0x086c('0x8'));module['exports']=function(_0x3c681a,_0x19e58d){return _0x3c681a[_0x086c('0x9')](_0x086c('0xa'),attributes,{'tableName':_0x086c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7fea=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ServicenowConfiguration','int_servicenow_configurations','util'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x7fea,0x149));var _0xa7fe=function(_0x31d35c,_0x5cae5b){_0x31d35c=_0x31d35c-0x0;var _0x533b24=_0x7fea[_0x31d35c];return _0x533b24;};'use strict';var _=require('lodash');var util=require(_0xa7fe('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xa7fe('0x1'));var BPromise=require(_0xa7fe('0x2'));var rp=require(_0xa7fe('0x3'));var fs=require('fs');var path=require(_0xa7fe('0x4'));var rimraf=require(_0xa7fe('0x5'));var config=require(_0xa7fe('0x6'));var attributes=require('./intServicenowConfiguration.attributes');module[_0xa7fe('0x7')]=function(_0x2bcfad,_0x1fbc99){return _0x2bcfad[_0xa7fe('0x8')](_0xa7fe('0x9'),attributes,{'tableName':_0xa7fe('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js index 4638582..b0d323e 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 _0x5b5a=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','message','result','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x543b28,_0x3225eb){var _0x216b35=function(_0x1c0872){while(--_0x1c0872){_0x543b28['push'](_0x543b28['shift']());}};_0x216b35(++_0x3225eb);}(_0x5b5a,0xc3));var _0xa5b5=function(_0x5ea7a8,_0x257068){_0x5ea7a8=_0x5ea7a8-0x0;var _0x1b2e3a=_0x5b5a[_0x5ea7a8];return _0x1b2e3a;};'use strict';var _=require('lodash');var util=require(_0xa5b5('0x0'));var moment=require(_0xa5b5('0x1'));var BPromise=require('bluebird');var rs=require(_0xa5b5('0x2'));var fs=require('fs');var Redis=require(_0xa5b5('0x3'));var db=require(_0xa5b5('0x4'))['db'];var utils=require(_0xa5b5('0x5'));var logger=require(_0xa5b5('0x6'))(_0xa5b5('0x7'));var config=require(_0xa5b5('0x8'));var jayson=require(_0xa5b5('0x9'));var client=jayson['client'][_0xa5b5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x29c137,_0x513641,_0x32a09a){return new BPromise(function(_0x1936d6,_0x1157ee){return client[_0xa5b5('0xb')](_0x29c137,_0x32a09a)[_0xa5b5('0xc')](function(_0x307afa){logger[_0xa5b5('0xd')](_0xa5b5('0xe'),_0x513641,_0xa5b5('0xf'));logger[_0xa5b5('0x10')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x513641,'request\x20sent',JSON['stringify'](_0x307afa));if(_0x307afa['error']){if(_0x307afa[_0xa5b5('0x11')]['code']===0x1f4){logger[_0xa5b5('0x11')]('ServicenowConfiguration,\x20%s,\x20%s',_0x513641,_0x307afa[_0xa5b5('0x11')][_0xa5b5('0x12')]);return _0x1157ee(_0x307afa[_0xa5b5('0x11')][_0xa5b5('0x12')]);}logger[_0xa5b5('0x11')](_0xa5b5('0xe'),_0x513641,_0x307afa[_0xa5b5('0x11')]['message']);return _0x1936d6(_0x307afa['error'][_0xa5b5('0x12')]);}else{logger['info'](_0xa5b5('0xe'),_0x513641,_0xa5b5('0xf'));_0x1936d6(_0x307afa[_0xa5b5('0x13')]['message']);}})['catch'](function(_0x4d3274){logger['error'](_0xa5b5('0xe'),_0x513641,_0x4d3274);_0x1157ee(_0x4d3274);});});} \ No newline at end of file +var _0x7fd1=['debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','jayson/promise','client','http','request','then','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x35fd53,_0x3d4699){var _0x10d6a0=function(_0x45e9cb){while(--_0x45e9cb){_0x35fd53['push'](_0x35fd53['shift']());}};_0x10d6a0(++_0x3d4699);}(_0x7fd1,0x6a));var _0x17fd=function(_0x223653,_0x50007c){_0x223653=_0x223653-0x0;var _0x254c8d=_0x7fd1[_0x223653];return _0x254c8d;};'use strict';var _=require(_0x17fd('0x0'));var util=require(_0x17fd('0x1'));var moment=require(_0x17fd('0x2'));var BPromise=require(_0x17fd('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x17fd('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x17fd('0x5'));var logger=require('../../config/logger')(_0x17fd('0x6'));var config=require('../../config/environment');var jayson=require(_0x17fd('0x7'));var client=jayson[_0x17fd('0x8')][_0x17fd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x55db38,_0x4bf786,_0x44fe13){return new BPromise(function(_0xedec47,_0x23e925){return client[_0x17fd('0xa')](_0x55db38,_0x44fe13)[_0x17fd('0xb')](function(_0x29224b){logger['info'](_0x17fd('0xc'),_0x4bf786,_0x17fd('0xd'));logger[_0x17fd('0xe')](_0x17fd('0xf'),_0x4bf786,_0x17fd('0xd'),JSON['stringify'](_0x29224b));if(_0x29224b[_0x17fd('0x10')]){if(_0x29224b['error'][_0x17fd('0x11')]===0x1f4){logger[_0x17fd('0x10')](_0x17fd('0xc'),_0x4bf786,_0x29224b['error']['message']);return _0x23e925(_0x29224b['error'][_0x17fd('0x12')]);}logger[_0x17fd('0x10')]('ServicenowConfiguration,\x20%s,\x20%s',_0x4bf786,_0x29224b[_0x17fd('0x10')][_0x17fd('0x12')]);return _0xedec47(_0x29224b[_0x17fd('0x10')][_0x17fd('0x12')]);}else{logger['info'](_0x17fd('0xc'),_0x4bf786,_0x17fd('0xd'));_0xedec47(_0x29224b[_0x17fd('0x13')][_0x17fd('0x12')]);}})['catch'](function(_0xcf159c){logger[_0x17fd('0x10')](_0x17fd('0xc'),_0x4bf786,_0xcf159c);_0x23e925(_0xcf159c);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 4bc1717..edfe81c 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 _0x3d4e=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x43cf86,_0x55abca){var _0x1b6c1a=function(_0x307eb1){while(--_0x307eb1){_0x43cf86['push'](_0x43cf86['shift']());}};_0x1b6c1a(++_0x55abca);}(_0x3d4e,0xfc));var _0xe3d4=function(_0x22aac3,_0x354607){_0x22aac3=_0x22aac3-0x0;var _0x26bb84=_0x3d4e[_0x22aac3];return _0x26bb84;};'use strict';var multer=require(_0xe3d4('0x0'));var util=require(_0xe3d4('0x1'));var path=require(_0xe3d4('0x2'));var timeout=require(_0xe3d4('0x3'));var express=require(_0xe3d4('0x4'));var router=express[_0xe3d4('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xe3d4('0x6'));var interaction=require(_0xe3d4('0x7'));var config=require(_0xe3d4('0x8'));var controller=require('./intServicenowField.controller');router[_0xe3d4('0x9')]('/',auth[_0xe3d4('0xa')](),controller[_0xe3d4('0xb')]);router[_0xe3d4('0x9')](_0xe3d4('0xc'),auth[_0xe3d4('0xa')](),controller[_0xe3d4('0xd')]);router[_0xe3d4('0xe')]('/',auth[_0xe3d4('0xa')](),controller[_0xe3d4('0xf')]);router[_0xe3d4('0x10')]('/:id',auth[_0xe3d4('0xa')](),controller[_0xe3d4('0x11')]);router[_0xe3d4('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xe3d4('0x13')]);module[_0xe3d4('0x14')]=router; \ No newline at end of file +var _0x3b43=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','index','/:id','isAuthenticated','show','post','create','put','destroy','multer','util','path'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x3b43,0x7d));var _0x33b4=function(_0x2b7b1d,_0xfc11f2){_0x2b7b1d=_0x2b7b1d-0x0;var _0x3d9e62=_0x3b43[_0x2b7b1d];return _0x3d9e62;};'use strict';var multer=require(_0x33b4('0x0'));var util=require(_0x33b4('0x1'));var path=require(_0x33b4('0x2'));var timeout=require('connect-timeout');var express=require(_0x33b4('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x33b4('0x4'));var interaction=require(_0x33b4('0x5'));var config=require(_0x33b4('0x6'));var controller=require(_0x33b4('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x33b4('0x8')]);router['get'](_0x33b4('0x9'),auth[_0x33b4('0xa')](),controller[_0x33b4('0xb')]);router[_0x33b4('0xc')]('/',auth[_0x33b4('0xa')](),controller[_0x33b4('0xd')]);router[_0x33b4('0xe')](_0x33b4('0x9'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x33b4('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 145aeae..5cf13f4 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 _0xccde=['exports','ENUM','variable','customVariable','keyValue','picklist','STRING','string','BOOLEAN','sequelize'];(function(_0x4918a5,_0x528d80){var _0x50e059=function(_0x534e27){while(--_0x534e27){_0x4918a5['push'](_0x4918a5['shift']());}};_0x50e059(++_0x528d80);}(_0xccde,0xef));var _0xeccd=function(_0x2ec2bf,_0x64e983){_0x2ec2bf=_0x2ec2bf-0x0;var _0x2c279c=_0xccde[_0x2ec2bf];return _0x2c279c;};'use strict';var Sequelize=require(_0xeccd('0x0'));module[_0xeccd('0x1')]={'type':{'type':Sequelize[_0xeccd('0x2')]('string',_0xeccd('0x3'),_0xeccd('0x4'),_0xeccd('0x5'),_0xeccd('0x6')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xeccd('0x7')]},'keyType':{'type':Sequelize[_0xeccd('0x2')](_0xeccd('0x8'),_0xeccd('0x3'),_0xeccd('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xeccd('0x7')]},'nameField':{'type':Sequelize[_0xeccd('0x7')]},'customField':{'type':Sequelize[_0xeccd('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xeccd('0x7')]}}; \ No newline at end of file +var _0x4d3f=['STRING','sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist'];(function(_0x482e88,_0x58c604){var _0x156dc0=function(_0x493739){while(--_0x493739){_0x482e88['push'](_0x482e88['shift']());}};_0x156dc0(++_0x58c604);}(_0x4d3f,0x1ba));var _0xf4d3=function(_0x2aee2f,_0xad9887){_0x2aee2f=_0x2aee2f-0x0;var _0x19337f=_0x4d3f[_0x2aee2f];return _0x19337f;};'use strict';var Sequelize=require(_0xf4d3('0x0'));module[_0xf4d3('0x1')]={'type':{'type':Sequelize[_0xf4d3('0x2')](_0xf4d3('0x3'),_0xf4d3('0x4'),_0xf4d3('0x5'),_0xf4d3('0x6'),_0xf4d3('0x7')),'defaultValue':_0xf4d3('0x3')},'content':{'type':Sequelize[_0xf4d3('0x8')]},'key':{'type':Sequelize[_0xf4d3('0x8')]},'keyType':{'type':Sequelize['ENUM'](_0xf4d3('0x3'),'variable',_0xf4d3('0x5'))},'keyContent':{'type':Sequelize[_0xf4d3('0x8')]},'idField':{'type':Sequelize[_0xf4d3('0x8')]},'nameField':{'type':Sequelize[_0xf4d3('0x8')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf4d3('0x8')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index f1eb6c1..101d3cd 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 _0x2bb1=['eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','update','sendStatus','name','fieldName','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','type','VIRTUAL','ServicenowField','includeAll','include','findAll','then','rows','catch','params','options','find','create','body','destroy'];(function(_0x212d2f,_0x5a7a54){var _0x3773ca=function(_0x46777d){while(--_0x46777d){_0x212d2f['push'](_0x212d2f['shift']());}};_0x3773ca(++_0x5a7a54);}(_0x2bb1,0x19e));var _0x12bb=function(_0x21668e,_0x1ea18f){_0x21668e=_0x21668e-0x0;var _0x48808f=_0x2bb1[_0x21668e];return _0x48808f;};'use strict';var emlformat=require(_0x12bb('0x0'));var rimraf=require(_0x12bb('0x1'));var zipdir=require(_0x12bb('0x2'));var jsonpatch=require(_0x12bb('0x3'));var rp=require('request-promise');var moment=require(_0x12bb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x12bb('0x5'));var util=require(_0x12bb('0x6'));var path=require(_0x12bb('0x7'));var sox=require(_0x12bb('0x8'));var csv=require(_0x12bb('0x9'));var ejs=require(_0x12bb('0xa'));var fs=require('fs');var fs_extra=require(_0x12bb('0xb'));var _=require('lodash');var squel=require(_0x12bb('0xc'));var crypto=require(_0x12bb('0xd'));var jsforce=require(_0x12bb('0xe'));var deskjs=require(_0x12bb('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x12bb('0x10'));var authService=require(_0x12bb('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x12bb('0x12'));var hardwareService=require(_0x12bb('0x13'));var logger=require('../../config/logger')(_0x12bb('0x14'));var utils=require(_0x12bb('0x15'));var config=require(_0x12bb('0x16'));var licenseUtil=require(_0x12bb('0x17'));var db=require(_0x12bb('0x18'))['db'];function respondWithStatusCode(_0x33e18a,_0x326530){_0x326530=_0x326530||0xcc;return function(_0x19fe1f){if(_0x19fe1f){return _0x33e18a['sendStatus'](_0x326530);}return _0x33e18a[_0x12bb('0x19')](_0x326530)[_0x12bb('0x1a')]();};}function respondWithResult(_0x4cc578,_0x55ed11){_0x55ed11=_0x55ed11||0xc8;return function(_0x56fd86){if(_0x56fd86){return _0x4cc578[_0x12bb('0x19')](_0x55ed11)[_0x12bb('0x1b')](_0x56fd86);}};}function respondWithFilteredResult(_0x104060,_0x42bb){return function(_0x508e73){if(_0x508e73){var _0x33da5=typeof _0x42bb[_0x12bb('0x1c')]===_0x12bb('0x1d')&&typeof _0x42bb[_0x12bb('0x1e')]===_0x12bb('0x1d');var _0x519459=_0x508e73[_0x12bb('0x1f')];var _0x5a1169=_0x33da5?0x0:_0x42bb[_0x12bb('0x1c')];var _0x28715c=_0x33da5?_0x508e73['count']:_0x42bb[_0x12bb('0x1c')]+_0x42bb[_0x12bb('0x1e')];var _0x507ad2;if(_0x28715c>=_0x519459){_0x28715c=_0x519459;_0x507ad2=0xc8;}else{_0x507ad2=0xce;}_0x104060['status'](_0x507ad2);return _0x104060[_0x12bb('0x20')]('Content-Range',_0x5a1169+'-'+_0x28715c+'/'+_0x519459)['json'](_0x508e73);}return null;};}function patchUpdates(_0x4efd92){return function(_0x258e53){try{jsonpatch[_0x12bb('0x21')](_0x258e53,_0x4efd92,!![]);}catch(_0x31f149){return BPromise[_0x12bb('0x22')](_0x31f149);}return _0x258e53['save']();};}function saveUpdates(_0x558cf8,_0x244d6a){return function(_0x52acf1){if(_0x52acf1){return _0x52acf1[_0x12bb('0x23')](_0x558cf8)['then'](function(_0x2bd5e8){return _0x2bd5e8;});}return null;};}function removeEntity(_0x954c79,_0x56e484){return function(_0x46a8d8){if(_0x46a8d8){return _0x46a8d8['destroy']()['then'](function(){_0x954c79[_0x12bb('0x19')](0xcc)[_0x12bb('0x1a')]();});}};}function handleEntityNotFound(_0x24b1b7,_0x57429d){return function(_0x3bc23b){if(!_0x3bc23b){_0x24b1b7[_0x12bb('0x24')](0x194);}return _0x3bc23b;};}function handleError(_0x1db255,_0x59874d){_0x59874d=_0x59874d||0x1f4;return function(_0x3936f5){logger['error'](_0x3936f5['stack']);if(_0x3936f5[_0x12bb('0x25')]){delete _0x3936f5[_0x12bb('0x25')];}_0x1db255['status'](_0x59874d)['send'](_0x3936f5);};}exports['index']=function(_0x3ed5b5,_0x1747f0){var _0x2b4dac={},_0x4c33b2={},_0x2607e2={'count':0x0,'rows':[]};var _0xa12067=_['map'](db['ServicenowField']['rawAttributes'],function(_0x31ed1a){return{'name':_0x31ed1a[_0x12bb('0x26')],'type':_0x31ed1a['type']['key']};});_0x4c33b2['model']=_[_0x12bb('0x27')](_0xa12067,_0x12bb('0x25'));_0x4c33b2[_0x12bb('0x28')]=_[_0x12bb('0x29')](_0x3ed5b5['query']);_0x4c33b2[_0x12bb('0x2a')]=_[_0x12bb('0x2b')](_0x4c33b2[_0x12bb('0x2c')],_0x4c33b2[_0x12bb('0x28')]);_0x2b4dac[_0x12bb('0x2d')]=_[_0x12bb('0x2b')](_0x4c33b2['model'],qs[_0x12bb('0x2e')](_0x3ed5b5['query'][_0x12bb('0x2e')]));_0x2b4dac[_0x12bb('0x2d')]=_0x2b4dac[_0x12bb('0x2d')][_0x12bb('0x2f')]?_0x2b4dac['attributes']:_0x4c33b2['model'];if(!_0x3ed5b5[_0x12bb('0x28')][_0x12bb('0x30')](_0x12bb('0x31'))){_0x2b4dac['limit']=qs[_0x12bb('0x1e')](_0x3ed5b5['query']['limit']);_0x2b4dac[_0x12bb('0x1c')]=qs['offset'](_0x3ed5b5[_0x12bb('0x28')][_0x12bb('0x1c')]);}_0x2b4dac['order']=qs['sort'](_0x3ed5b5[_0x12bb('0x28')][_0x12bb('0x32')]);_0x2b4dac[_0x12bb('0x33')]=qs[_0x12bb('0x2a')](_['pick'](_0x3ed5b5[_0x12bb('0x28')],_0x4c33b2[_0x12bb('0x2a')]),_0xa12067);if(_0x3ed5b5[_0x12bb('0x28')][_0x12bb('0x34')]){_0x2b4dac[_0x12bb('0x33')]=_[_0x12bb('0x35')](_0x2b4dac[_0x12bb('0x33')],{'$or':_[_0x12bb('0x27')](_0xa12067,function(_0x57a16c){if(_0x57a16c[_0x12bb('0x36')]!==_0x12bb('0x37')){var _0x4e0d75={};_0x4e0d75[_0x57a16c['name']]={'$like':'%'+_0x3ed5b5[_0x12bb('0x28')][_0x12bb('0x34')]+'%'};return _0x4e0d75;}})});}_0x2b4dac=_['merge']({},_0x2b4dac,_0x3ed5b5['options']);var _0x11f811={'where':_0x2b4dac[_0x12bb('0x33')]};return db[_0x12bb('0x38')]['count'](_0x11f811)['then'](function(_0xe705b5){_0x2607e2[_0x12bb('0x1f')]=_0xe705b5;if(_0x3ed5b5['query'][_0x12bb('0x39')]){_0x2b4dac[_0x12bb('0x3a')]=[{'all':!![]}];}return db[_0x12bb('0x38')][_0x12bb('0x3b')](_0x2b4dac);})[_0x12bb('0x3c')](function(_0x342023){_0x2607e2[_0x12bb('0x3d')]=_0x342023;return _0x2607e2;})[_0x12bb('0x3c')](respondWithFilteredResult(_0x1747f0,_0x2b4dac))[_0x12bb('0x3e')](handleError(_0x1747f0,null));};exports['show']=function(_0x5c0dc4,_0x2d23f6){var _0x44c21f={'raw':!![],'where':{'id':_0x5c0dc4[_0x12bb('0x3f')]['id']}},_0x40dae4={};_0x40dae4[_0x12bb('0x2c')]=_[_0x12bb('0x29')](db[_0x12bb('0x38')]['rawAttributes']);_0x40dae4[_0x12bb('0x28')]=_[_0x12bb('0x29')](_0x5c0dc4[_0x12bb('0x28')]);_0x40dae4['filters']=_[_0x12bb('0x2b')](_0x40dae4[_0x12bb('0x2c')],_0x40dae4[_0x12bb('0x28')]);_0x44c21f[_0x12bb('0x2d')]=_[_0x12bb('0x2b')](_0x40dae4['model'],qs[_0x12bb('0x2e')](_0x5c0dc4[_0x12bb('0x28')]['fields']));_0x44c21f[_0x12bb('0x2d')]=_0x44c21f[_0x12bb('0x2d')][_0x12bb('0x2f')]?_0x44c21f[_0x12bb('0x2d')]:_0x40dae4[_0x12bb('0x2c')];if(_0x5c0dc4[_0x12bb('0x28')][_0x12bb('0x39')]){_0x44c21f[_0x12bb('0x3a')]=[{'all':!![]}];}_0x44c21f=_[_0x12bb('0x35')]({},_0x44c21f,_0x5c0dc4[_0x12bb('0x40')]);return db[_0x12bb('0x38')][_0x12bb('0x41')](_0x44c21f)[_0x12bb('0x3c')](handleEntityNotFound(_0x2d23f6,null))[_0x12bb('0x3c')](respondWithResult(_0x2d23f6,null))[_0x12bb('0x3e')](handleError(_0x2d23f6,null));};exports[_0x12bb('0x42')]=function(_0xf6b0ad,_0x1cc8f1){return db['ServicenowField'][_0x12bb('0x42')](_0xf6b0ad[_0x12bb('0x43')],{})['then'](respondWithResult(_0x1cc8f1,0xc9))[_0x12bb('0x3e')](handleError(_0x1cc8f1,null));};exports[_0x12bb('0x23')]=function(_0xa3b549,_0x5b9946){if(_0xa3b549[_0x12bb('0x43')]['id']){delete _0xa3b549[_0x12bb('0x43')]['id'];}return db['ServicenowField']['find']({'where':{'id':_0xa3b549[_0x12bb('0x3f')]['id']}})[_0x12bb('0x3c')](handleEntityNotFound(_0x5b9946,null))[_0x12bb('0x3c')](saveUpdates(_0xa3b549[_0x12bb('0x43')],null))[_0x12bb('0x3c')](respondWithResult(_0x5b9946,null))['catch'](handleError(_0x5b9946,null));};exports[_0x12bb('0x44')]=function(_0x19bf60,_0x17eb58){return db[_0x12bb('0x38')][_0x12bb('0x41')]({'where':{'id':_0x19bf60[_0x12bb('0x3f')]['id']}})['then'](handleEntityNotFound(_0x17eb58,null))['then'](removeEntity(_0x17eb58,null))['catch'](handleError(_0x17eb58,null));}; \ No newline at end of file +var _0x3b06=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','destroy','then','error','name','send','ServicenowField','rawAttributes','fieldName','key','model','map','keys','query','filters','intersection','attributes','fields','nolimit','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','length','find','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x3b06,0xc8));var _0x63b0=function(_0x3725ee,_0x543bd9){_0x3725ee=_0x3725ee-0x0;var _0x399c71=_0x3b06[_0x3725ee];return _0x399c71;};'use strict';var emlformat=require(_0x63b0('0x0'));var rimraf=require(_0x63b0('0x1'));var zipdir=require(_0x63b0('0x2'));var jsonpatch=require(_0x63b0('0x3'));var rp=require(_0x63b0('0x4'));var moment=require(_0x63b0('0x5'));var BPromise=require(_0x63b0('0x6'));var Mustache=require(_0x63b0('0x7'));var util=require('util');var path=require(_0x63b0('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x63b0('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x63b0('0xa'));var squel=require(_0x63b0('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x63b0('0xc'));var toCsv=require('to-csv');var querystring=require(_0x63b0('0xd'));var Papa=require(_0x63b0('0xe'));var Redis=require(_0x63b0('0xf'));var authService=require(_0x63b0('0x10'));var qs=require(_0x63b0('0x11'));var as=require(_0x63b0('0x12'));var hardwareService=require(_0x63b0('0x13'));var logger=require(_0x63b0('0x14'))(_0x63b0('0x15'));var utils=require(_0x63b0('0x16'));var config=require(_0x63b0('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f274b,_0x530c9b){_0x530c9b=_0x530c9b||0xcc;return function(_0x4a41ec){if(_0x4a41ec){return _0x2f274b[_0x63b0('0x18')](_0x530c9b);}return _0x2f274b['status'](_0x530c9b)[_0x63b0('0x19')]();};}function respondWithResult(_0x235fed,_0x2c2409){_0x2c2409=_0x2c2409||0xc8;return function(_0x11b5d0){if(_0x11b5d0){return _0x235fed[_0x63b0('0x1a')](_0x2c2409)[_0x63b0('0x1b')](_0x11b5d0);}};}function respondWithFilteredResult(_0x4e7bcf,_0x6c50d7){return function(_0x451438){if(_0x451438){var _0x2bbecf=typeof _0x6c50d7[_0x63b0('0x1c')]==='undefined'&&typeof _0x6c50d7[_0x63b0('0x1d')]===_0x63b0('0x1e');var _0x26be85=_0x451438[_0x63b0('0x1f')];var _0xf451da=_0x2bbecf?0x0:_0x6c50d7[_0x63b0('0x1c')];var _0x493dc5=_0x2bbecf?_0x451438[_0x63b0('0x1f')]:_0x6c50d7[_0x63b0('0x1c')]+_0x6c50d7[_0x63b0('0x1d')];var _0x3f5c4f;if(_0x493dc5>=_0x26be85){_0x493dc5=_0x26be85;_0x3f5c4f=0xc8;}else{_0x3f5c4f=0xce;}_0x4e7bcf[_0x63b0('0x1a')](_0x3f5c4f);return _0x4e7bcf[_0x63b0('0x20')](_0x63b0('0x21'),_0xf451da+'-'+_0x493dc5+'/'+_0x26be85)[_0x63b0('0x1b')](_0x451438);}return null;};}function patchUpdates(_0x870e9a){return function(_0x3dd3ae){try{jsonpatch[_0x63b0('0x22')](_0x3dd3ae,_0x870e9a,!![]);}catch(_0x1f7135){return BPromise[_0x63b0('0x23')](_0x1f7135);}return _0x3dd3ae['save']();};}function saveUpdates(_0x267cae,_0xf2f0d){return function(_0x59aadb){if(_0x59aadb){return _0x59aadb[_0x63b0('0x24')](_0x267cae)['then'](function(_0x53c011){return _0x53c011;});}return null;};}function removeEntity(_0x4fc856,_0x296715){return function(_0x9ac39c){if(_0x9ac39c){return _0x9ac39c[_0x63b0('0x25')]()[_0x63b0('0x26')](function(){_0x4fc856[_0x63b0('0x1a')](0xcc)[_0x63b0('0x19')]();});}};}function handleEntityNotFound(_0x4233f7,_0x19e202){return function(_0x1bb520){if(!_0x1bb520){_0x4233f7['sendStatus'](0x194);}return _0x1bb520;};}function handleError(_0x45b165,_0x3eee79){_0x3eee79=_0x3eee79||0x1f4;return function(_0x1ff534){logger[_0x63b0('0x27')](_0x1ff534['stack']);if(_0x1ff534[_0x63b0('0x28')]){delete _0x1ff534['name'];}_0x45b165['status'](_0x3eee79)[_0x63b0('0x29')](_0x1ff534);};}exports['index']=function(_0x155dc5,_0x42b151){var _0x4b7bb8={},_0x4d9938={},_0x140680={'count':0x0,'rows':[]};var _0x87d8ec=_['map'](db[_0x63b0('0x2a')][_0x63b0('0x2b')],function(_0x3c084e){return{'name':_0x3c084e[_0x63b0('0x2c')],'type':_0x3c084e['type'][_0x63b0('0x2d')]};});_0x4d9938[_0x63b0('0x2e')]=_[_0x63b0('0x2f')](_0x87d8ec,_0x63b0('0x28'));_0x4d9938['query']=_[_0x63b0('0x30')](_0x155dc5[_0x63b0('0x31')]);_0x4d9938[_0x63b0('0x32')]=_[_0x63b0('0x33')](_0x4d9938[_0x63b0('0x2e')],_0x4d9938[_0x63b0('0x31')]);_0x4b7bb8[_0x63b0('0x34')]=_['intersection'](_0x4d9938[_0x63b0('0x2e')],qs['fields'](_0x155dc5[_0x63b0('0x31')][_0x63b0('0x35')]));_0x4b7bb8[_0x63b0('0x34')]=_0x4b7bb8[_0x63b0('0x34')]['length']?_0x4b7bb8[_0x63b0('0x34')]:_0x4d9938[_0x63b0('0x2e')];if(!_0x155dc5[_0x63b0('0x31')]['hasOwnProperty'](_0x63b0('0x36'))){_0x4b7bb8['limit']=qs[_0x63b0('0x1d')](_0x155dc5[_0x63b0('0x31')][_0x63b0('0x1d')]);_0x4b7bb8[_0x63b0('0x1c')]=qs[_0x63b0('0x1c')](_0x155dc5[_0x63b0('0x31')][_0x63b0('0x1c')]);}_0x4b7bb8['order']=qs[_0x63b0('0x37')](_0x155dc5[_0x63b0('0x31')][_0x63b0('0x37')]);_0x4b7bb8['where']=qs[_0x63b0('0x32')](_[_0x63b0('0x38')](_0x155dc5[_0x63b0('0x31')],_0x4d9938[_0x63b0('0x32')]),_0x87d8ec);if(_0x155dc5[_0x63b0('0x31')][_0x63b0('0x39')]){_0x4b7bb8[_0x63b0('0x3a')]=_[_0x63b0('0x3b')](_0x4b7bb8['where'],{'$or':_['map'](_0x87d8ec,function(_0x322274){if(_0x322274[_0x63b0('0x3c')]!==_0x63b0('0x3d')){var _0x33b6cc={};_0x33b6cc[_0x322274[_0x63b0('0x28')]]={'$like':'%'+_0x155dc5['query']['filter']+'%'};return _0x33b6cc;}})});}_0x4b7bb8=_[_0x63b0('0x3b')]({},_0x4b7bb8,_0x155dc5[_0x63b0('0x3e')]);var _0x3b6d7b={'where':_0x4b7bb8[_0x63b0('0x3a')]};return db[_0x63b0('0x2a')][_0x63b0('0x1f')](_0x3b6d7b)[_0x63b0('0x26')](function(_0x2ddcbd){_0x140680[_0x63b0('0x1f')]=_0x2ddcbd;if(_0x155dc5[_0x63b0('0x31')][_0x63b0('0x3f')]){_0x4b7bb8[_0x63b0('0x40')]=[{'all':!![]}];}return db['ServicenowField']['findAll'](_0x4b7bb8);})[_0x63b0('0x26')](function(_0x3666b5){_0x140680[_0x63b0('0x41')]=_0x3666b5;return _0x140680;})[_0x63b0('0x26')](respondWithFilteredResult(_0x42b151,_0x4b7bb8))[_0x63b0('0x42')](handleError(_0x42b151,null));};exports[_0x63b0('0x43')]=function(_0x1e8aaa,_0x4b9d85){var _0x4223bf={'raw':!![],'where':{'id':_0x1e8aaa[_0x63b0('0x44')]['id']}},_0x2fbca4={};_0x2fbca4[_0x63b0('0x2e')]=_[_0x63b0('0x30')](db['ServicenowField'][_0x63b0('0x2b')]);_0x2fbca4[_0x63b0('0x31')]=_[_0x63b0('0x30')](_0x1e8aaa[_0x63b0('0x31')]);_0x2fbca4[_0x63b0('0x32')]=_[_0x63b0('0x33')](_0x2fbca4[_0x63b0('0x2e')],_0x2fbca4[_0x63b0('0x31')]);_0x4223bf['attributes']=_[_0x63b0('0x33')](_0x2fbca4[_0x63b0('0x2e')],qs[_0x63b0('0x35')](_0x1e8aaa[_0x63b0('0x31')]['fields']));_0x4223bf[_0x63b0('0x34')]=_0x4223bf[_0x63b0('0x34')][_0x63b0('0x45')]?_0x4223bf[_0x63b0('0x34')]:_0x2fbca4['model'];if(_0x1e8aaa[_0x63b0('0x31')][_0x63b0('0x3f')]){_0x4223bf[_0x63b0('0x40')]=[{'all':!![]}];}_0x4223bf=_[_0x63b0('0x3b')]({},_0x4223bf,_0x1e8aaa['options']);return db[_0x63b0('0x2a')][_0x63b0('0x46')](_0x4223bf)[_0x63b0('0x26')](handleEntityNotFound(_0x4b9d85,null))[_0x63b0('0x26')](respondWithResult(_0x4b9d85,null))[_0x63b0('0x42')](handleError(_0x4b9d85,null));};exports['create']=function(_0x1597b6,_0x1f3836){return db[_0x63b0('0x2a')]['create'](_0x1597b6[_0x63b0('0x47')],{})['then'](respondWithResult(_0x1f3836,0xc9))[_0x63b0('0x42')](handleError(_0x1f3836,null));};exports[_0x63b0('0x24')]=function(_0x5a3b23,_0x341d72){if(_0x5a3b23[_0x63b0('0x47')]['id']){delete _0x5a3b23['body']['id'];}return db[_0x63b0('0x2a')][_0x63b0('0x46')]({'where':{'id':_0x5a3b23[_0x63b0('0x44')]['id']}})[_0x63b0('0x26')](handleEntityNotFound(_0x341d72,null))[_0x63b0('0x26')](saveUpdates(_0x5a3b23[_0x63b0('0x47')],null))[_0x63b0('0x26')](respondWithResult(_0x341d72,null))[_0x63b0('0x42')](handleError(_0x341d72,null));};exports[_0x63b0('0x25')]=function(_0x29c340,_0x3a26e4){return db['ServicenowField']['find']({'where':{'id':_0x29c340[_0x63b0('0x44')]['id']}})[_0x63b0('0x26')](handleEntityNotFound(_0x3a26e4,null))[_0x63b0('0x26')](removeEntity(_0x3a26e4,null))['catch'](handleError(_0x3a26e4,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 82b4c90..5a717e5 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 _0x839c=['path','rimraf','../../config/environment','define','int_servicenow_fields','servicenow_unique_index','idField','FieldId','util','bluebird'];(function(_0x9f2329,_0x4b3699){var _0x2916b9=function(_0x4ddfce){while(--_0x4ddfce){_0x9f2329['push'](_0x9f2329['shift']());}};_0x2916b9(++_0x4b3699);}(_0x839c,0x120));var _0xc839=function(_0x4601f3,_0x4d2401){_0x4601f3=_0x4601f3-0x0;var _0x2afb49=_0x839c[_0x4601f3];return _0x2afb49;};'use strict';var _=require('lodash');var util=require(_0xc839('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xc839('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc839('0x2'));var rimraf=require(_0xc839('0x3'));var config=require(_0xc839('0x4'));var attributes=require('./intServicenowField.attributes');module['exports']=function(_0xde6858,_0x30c712){return _0xde6858[_0xc839('0x5')]('ServicenowField',attributes,{'tableName':_0xc839('0x6'),'paranoid':![],'indexes':[{'name':_0xc839('0x7'),'fields':[_0xc839('0x8'),_0xc839('0x9')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x37dd=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','FieldId'];(function(_0x3c2666,_0x15fd23){var _0x10c814=function(_0x4660c0){while(--_0x4660c0){_0x3c2666['push'](_0x3c2666['shift']());}};_0x10c814(++_0x15fd23);}(_0x37dd,0x1c0));var _0xd37d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x37dd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xd37d('0x0'));var logger=require(_0xd37d('0x1'))(_0xd37d('0x2'));var moment=require(_0xd37d('0x3'));var BPromise=require(_0xd37d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd37d('0x5'));var rimraf=require(_0xd37d('0x6'));var config=require(_0xd37d('0x7'));var attributes=require('./intServicenowField.attributes');module['exports']=function(_0x497ed8,_0x585842){return _0x497ed8[_0xd37d('0x8')](_0xd37d('0x9'),attributes,{'tableName':_0xd37d('0xa'),'paranoid':![],'indexes':[{'name':_0xd37d('0xb'),'fields':[_0xd37d('0xc'),_0xd37d('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.rpc.js b/server/api/intServicenowField/intServicenowField.rpc.js index 416f097..152d357 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 _0xaa88=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','error','ServicenowField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0x244cef,_0xbce3ec){var _0x32139b=function(_0x12d1f4){while(--_0x12d1f4){_0x244cef['push'](_0x244cef['shift']());}};_0x32139b(++_0xbce3ec);}(_0xaa88,0x137));var _0x8aa8=function(_0x28394f,_0x5ebdd2){_0x28394f=_0x28394f-0x0;var _0x2618d2=_0xaa88[_0x28394f];return _0x2618d2;};'use strict';var _=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var moment=require(_0x8aa8('0x2'));var BPromise=require(_0x8aa8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8aa8('0x4'));var db=require(_0x8aa8('0x5'))['db'];var utils=require(_0x8aa8('0x6'));var logger=require(_0x8aa8('0x7'))(_0x8aa8('0x8'));var config=require(_0x8aa8('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8aa8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5264ff,_0x449d2d,_0x1ed84d){return new BPromise(function(_0x27c08d,_0x40826f){return client['request'](_0x5264ff,_0x1ed84d)[_0x8aa8('0xb')](function(_0x2d974c){logger[_0x8aa8('0xc')]('ServicenowField,\x20%s,\x20%s',_0x449d2d,_0x8aa8('0xd'));logger[_0x8aa8('0xe')](_0x8aa8('0xf'),_0x449d2d,_0x8aa8('0xd'),JSON['stringify'](_0x2d974c));if(_0x2d974c[_0x8aa8('0x10')]){if(_0x2d974c[_0x8aa8('0x10')]['code']===0x1f4){logger[_0x8aa8('0x10')](_0x8aa8('0x11'),_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x40826f(_0x2d974c[_0x8aa8('0x10')][_0x8aa8('0x12')]);}logger[_0x8aa8('0x10')]('ServicenowField,\x20%s,\x20%s',_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x27c08d(_0x2d974c['error'][_0x8aa8('0x12')]);}else{logger[_0x8aa8('0xc')](_0x8aa8('0x11'),_0x449d2d,_0x8aa8('0xd'));_0x27c08d(_0x2d974c[_0x8aa8('0x13')][_0x8aa8('0x12')]);}})[_0x8aa8('0x14')](function(_0xd59fb8){logger[_0x8aa8('0x10')]('ServicenowField,\x20%s,\x20%s',_0x449d2d,_0xd59fb8);_0x40826f(_0xd59fb8);});});} \ No newline at end of file +var _0xa9e0=['http','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\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(_0x4cdb8e,_0x19a1e1){var _0x4e0fad=function(_0x94acb3){while(--_0x94acb3){_0x4cdb8e['push'](_0x4cdb8e['shift']());}};_0x4e0fad(++_0x19a1e1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'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/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 3d5b1d5..135bc20 100644 --- a/server/api/intSugarcrmAccount/index.js +++ b/server/api/intSugarcrmAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x7fb51,_0xba2a96){var _0x5760f3=function(_0x42bb57){while(--_0x42bb57){_0x7fb51['push'](_0x7fb51['shift']());}};_0x5760f3(++_0xba2a96);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x1a0ce2,_0x25f7ef){var _0x1800d6=function(_0x5d4e65){while(--_0x5d4e65){_0x1a0ce2['push'](_0x1a0ce2['shift']());}};_0x1800d6(++_0x25f7ef);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index a514dcc..ceee90a 100644 --- a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js +++ b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0x431bcd,_0x1159ef){var _0x4a9ca5=function(_0x280fc4){while(--_0x280fc4){_0x431bcd['push'](_0x431bcd['shift']());}};_0x4a9ca5(++_0x1159ef);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x0a9e('0x3')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0a9e('0x2')],'unique':_0x0a9e('0x4')},'serverUrl':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0x509692,_0x24c743){var _0x25d8c2=function(_0x3ee14f){while(--_0x3ee14f){_0x509692['push'](_0x509692['shift']());}};_0x25d8c2(++_0x24c743);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x0a9e('0x3')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0a9e('0x2')],'unique':_0x0a9e('0x4')},'serverUrl':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js index 9564d2b..40b20e6 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 _0xc120=['crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy','then','end','sendStatus','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','length','attributes','nolimit','sort','pick','filter','where','merge','options','SugarcrmAccount','includeAll','include','rows','catch','params','find','create','body','getConfigurations','findOne','order','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','SugarcrmConfiguration','SugarcrmField','Descriptions','getFields','assigned_user_id','created_by','date_start','duration_hours','parent_id','parent_name','password','remoteUri','substring','lastIndexOf','/service/v4_1/rest.php','login','JSON','stringify','username','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','POST','format','get_module_fields','values','remove','includes','label','endsWith','value','statusCode','error','send','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash'];(function(_0x499210,_0x325b29){var _0x2e153d=function(_0x951263){while(--_0x951263){_0x499210['push'](_0x499210['shift']());}};_0x2e153d(++_0x325b29);}(_0xc120,0x1cd));var _0x0c12=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0xc120[_0x4d8ed9];return _0x1e2140;};'use strict';var emlformat=require(_0x0c12('0x0'));var rimraf=require(_0x0c12('0x1'));var zipdir=require(_0x0c12('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0c12('0x3'));var moment=require('moment');var BPromise=require(_0x0c12('0x4'));var Mustache=require(_0x0c12('0x5'));var util=require(_0x0c12('0x6'));var path=require('path');var sox=require(_0x0c12('0x7'));var csv=require(_0x0c12('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0c12('0x9'));var _=require(_0x0c12('0xa'));var squel=require('squel');var crypto=require(_0x0c12('0xb'));var jsforce=require(_0x0c12('0xc'));var deskjs=require(_0x0c12('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0c12('0xe'));var Redis=require(_0x0c12('0xf'));var authService=require(_0x0c12('0x10'));var qs=require(_0x0c12('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0c12('0x12'));var logger=require('../../config/logger')(_0x0c12('0x13'));var utils=require(_0x0c12('0x14'));var config=require(_0x0c12('0x15'));var licenseUtil=require(_0x0c12('0x16'));var db=require(_0x0c12('0x17'))['db'];var integrations=require(_0x0c12('0x18'));function respondWithStatusCode(_0x53bd31,_0x35ef80){_0x35ef80=_0x35ef80||0xcc;return function(_0xcc0351){if(_0xcc0351){return _0x53bd31['sendStatus'](_0x35ef80);}return _0x53bd31[_0x0c12('0x19')](_0x35ef80)['end']();};}function respondWithResult(_0x22f405,_0x11be41){_0x11be41=_0x11be41||0xc8;return function(_0x307be9){if(_0x307be9){return _0x22f405[_0x0c12('0x19')](_0x11be41)[_0x0c12('0x1a')](_0x307be9);}};}function respondWithFilteredResult(_0x232cae,_0x1451a1){return function(_0x13b15d){if(_0x13b15d){var _0x32bb28=typeof _0x1451a1[_0x0c12('0x1b')]===_0x0c12('0x1c')&&typeof _0x1451a1[_0x0c12('0x1d')]===_0x0c12('0x1c');var _0x2efbe0=_0x13b15d[_0x0c12('0x1e')];var _0x3671b6=_0x32bb28?0x0:_0x1451a1[_0x0c12('0x1b')];var _0xb43e69=_0x32bb28?_0x13b15d['count']:_0x1451a1[_0x0c12('0x1b')]+_0x1451a1['limit'];var _0x5c9014;if(_0xb43e69>=_0x2efbe0){_0xb43e69=_0x2efbe0;_0x5c9014=0xc8;}else{_0x5c9014=0xce;}_0x232cae[_0x0c12('0x19')](_0x5c9014);return _0x232cae['set'](_0x0c12('0x1f'),_0x3671b6+'-'+_0xb43e69+'/'+_0x2efbe0)[_0x0c12('0x1a')](_0x13b15d);}return null;};}function patchUpdates(_0x2c96ef){return function(_0x43253b){try{jsonpatch[_0x0c12('0x20')](_0x43253b,_0x2c96ef,!![]);}catch(_0x24047f){return BPromise[_0x0c12('0x21')](_0x24047f);}return _0x43253b['save']();};}function saveUpdates(_0x22ae17,_0x346597){return function(_0x5f2f00){if(_0x5f2f00){return _0x5f2f00[_0x0c12('0x22')](_0x22ae17)['then'](function(_0x27ca36){return _0x27ca36;});}return null;};}function removeEntity(_0x5758b3,_0x3e0555){return function(_0x1916dd){if(_0x1916dd){return _0x1916dd[_0x0c12('0x23')]()[_0x0c12('0x24')](function(){_0x5758b3['status'](0xcc)[_0x0c12('0x25')]();});}};}function handleEntityNotFound(_0xa06150,_0x14d663){return function(_0x5306f1){if(!_0x5306f1){_0xa06150[_0x0c12('0x26')](0x194);}return _0x5306f1;};}function handleError(_0x3d45ea,_0x4e65f7){_0x4e65f7=_0x4e65f7||0x1f4;return function(_0x26595e){logger['error'](_0x26595e[_0x0c12('0x27')]);if(_0x26595e[_0x0c12('0x28')]){delete _0x26595e['name'];}_0x3d45ea['status'](_0x4e65f7)['send'](_0x26595e);};}exports[_0x0c12('0x29')]=function(_0x358896,_0x530cb7){var _0x5dd01c={},_0x1aca19={},_0x47523c={'count':0x0,'rows':[]};var _0x29cb9c=_[_0x0c12('0x2a')](db['SugarcrmAccount'][_0x0c12('0x2b')],function(_0x4a63cf){return{'name':_0x4a63cf[_0x0c12('0x2c')],'type':_0x4a63cf[_0x0c12('0x2d')][_0x0c12('0x2e')]};});_0x1aca19[_0x0c12('0x2f')]=_['map'](_0x29cb9c,_0x0c12('0x28'));_0x1aca19[_0x0c12('0x30')]=_[_0x0c12('0x31')](_0x358896['query']);_0x1aca19[_0x0c12('0x32')]=_[_0x0c12('0x33')](_0x1aca19[_0x0c12('0x2f')],_0x1aca19[_0x0c12('0x30')]);_0x5dd01c['attributes']=_['intersection'](_0x1aca19[_0x0c12('0x2f')],qs[_0x0c12('0x34')](_0x358896[_0x0c12('0x30')][_0x0c12('0x34')]));_0x5dd01c['attributes']=_0x5dd01c['attributes'][_0x0c12('0x35')]?_0x5dd01c[_0x0c12('0x36')]:_0x1aca19['model'];if(!_0x358896[_0x0c12('0x30')]['hasOwnProperty'](_0x0c12('0x37'))){_0x5dd01c['limit']=qs['limit'](_0x358896[_0x0c12('0x30')][_0x0c12('0x1d')]);_0x5dd01c[_0x0c12('0x1b')]=qs['offset'](_0x358896['query']['offset']);}_0x5dd01c['order']=qs[_0x0c12('0x38')](_0x358896['query'][_0x0c12('0x38')]);_0x5dd01c['where']=qs[_0x0c12('0x32')](_[_0x0c12('0x39')](_0x358896[_0x0c12('0x30')],_0x1aca19[_0x0c12('0x32')]),_0x29cb9c);if(_0x358896['query'][_0x0c12('0x3a')]){_0x5dd01c['where']=_['merge'](_0x5dd01c[_0x0c12('0x3b')],{'$or':_[_0x0c12('0x2a')](_0x29cb9c,function(_0x5d68eb){if(_0x5d68eb[_0x0c12('0x2d')]!=='VIRTUAL'){var _0x223c2a={};_0x223c2a[_0x5d68eb[_0x0c12('0x28')]]={'$like':'%'+_0x358896[_0x0c12('0x30')]['filter']+'%'};return _0x223c2a;}})});}_0x5dd01c=_[_0x0c12('0x3c')]({},_0x5dd01c,_0x358896[_0x0c12('0x3d')]);var _0x289b0e={'where':_0x5dd01c[_0x0c12('0x3b')]};return db[_0x0c12('0x3e')][_0x0c12('0x1e')](_0x289b0e)['then'](function(_0x275a7d){_0x47523c[_0x0c12('0x1e')]=_0x275a7d;if(_0x358896[_0x0c12('0x30')][_0x0c12('0x3f')]){_0x5dd01c[_0x0c12('0x40')]=[{'all':!![]}];}return db[_0x0c12('0x3e')]['findAll'](_0x5dd01c);})[_0x0c12('0x24')](function(_0x2816ce){_0x47523c[_0x0c12('0x41')]=_0x2816ce;return _0x47523c;})[_0x0c12('0x24')](respondWithFilteredResult(_0x530cb7,_0x5dd01c))[_0x0c12('0x42')](handleError(_0x530cb7,null));};exports['show']=function(_0x56c1ed,_0x32a784){var _0x2d6f2e={'raw':![],'where':{'id':_0x56c1ed[_0x0c12('0x43')]['id']}},_0x4bc039={};_0x4bc039[_0x0c12('0x2f')]=_[_0x0c12('0x31')](db[_0x0c12('0x3e')]['rawAttributes']);_0x4bc039['query']=_[_0x0c12('0x31')](_0x56c1ed[_0x0c12('0x30')]);_0x4bc039[_0x0c12('0x32')]=_[_0x0c12('0x33')](_0x4bc039['model'],_0x4bc039['query']);_0x2d6f2e[_0x0c12('0x36')]=_[_0x0c12('0x33')](_0x4bc039[_0x0c12('0x2f')],qs[_0x0c12('0x34')](_0x56c1ed['query']['fields']));_0x2d6f2e[_0x0c12('0x36')]=_0x2d6f2e['attributes'][_0x0c12('0x35')]?_0x2d6f2e[_0x0c12('0x36')]:_0x4bc039[_0x0c12('0x2f')];if(_0x56c1ed[_0x0c12('0x30')][_0x0c12('0x3f')]){_0x2d6f2e['include']=[{'all':!![]}];}_0x2d6f2e=_[_0x0c12('0x3c')]({},_0x2d6f2e,_0x56c1ed[_0x0c12('0x3d')]);return db[_0x0c12('0x3e')][_0x0c12('0x44')](_0x2d6f2e)[_0x0c12('0x24')](handleEntityNotFound(_0x32a784,null))[_0x0c12('0x24')](respondWithResult(_0x32a784,null))['catch'](handleError(_0x32a784,null));};exports[_0x0c12('0x45')]=function(_0x3df854,_0x543f01){return db[_0x0c12('0x3e')][_0x0c12('0x45')](_0x3df854[_0x0c12('0x46')],{})[_0x0c12('0x24')](respondWithResult(_0x543f01,0xc9))[_0x0c12('0x42')](handleError(_0x543f01,null));};exports[_0x0c12('0x22')]=function(_0x4929ac,_0x122dd5){if(_0x4929ac[_0x0c12('0x46')]['id']){delete _0x4929ac['body']['id'];}return db['SugarcrmAccount']['find']({'where':{'id':_0x4929ac[_0x0c12('0x43')]['id']}})[_0x0c12('0x24')](handleEntityNotFound(_0x122dd5,null))['then'](saveUpdates(_0x4929ac[_0x0c12('0x46')],null))[_0x0c12('0x24')](respondWithResult(_0x122dd5,null))['catch'](handleError(_0x122dd5,null));};exports[_0x0c12('0x23')]=function(_0x538d02,_0x2873cc){return db[_0x0c12('0x3e')][_0x0c12('0x44')]({'where':{'id':_0x538d02[_0x0c12('0x43')]['id']}})[_0x0c12('0x24')](handleEntityNotFound(_0x2873cc,null))['then'](removeEntity(_0x2873cc,null))[_0x0c12('0x42')](handleError(_0x2873cc,null));};exports[_0x0c12('0x47')]=function(_0x2a58a1,_0x11c799,_0x10c82c){var _0x2322d3={};var _0x392d9d={};var _0x395a34;var _0x35c026;return db[_0x0c12('0x3e')][_0x0c12('0x48')]({'where':{'id':_0x2a58a1[_0x0c12('0x43')]['id']}})[_0x0c12('0x24')](handleEntityNotFound(_0x11c799,null))[_0x0c12('0x24')](function(_0x3691e3){if(_0x3691e3){_0x395a34=_0x3691e3;_0x392d9d[_0x0c12('0x2f')]=_[_0x0c12('0x31')](db['SugarcrmConfiguration'][_0x0c12('0x2b')]);_0x392d9d['query']=_[_0x0c12('0x31')](_0x2a58a1['query']);_0x392d9d['filters']=_[_0x0c12('0x33')](_0x392d9d[_0x0c12('0x2f')],_0x392d9d['query']);_0x2322d3[_0x0c12('0x36')]=_[_0x0c12('0x33')](_0x392d9d[_0x0c12('0x2f')],qs['fields'](_0x2a58a1[_0x0c12('0x30')][_0x0c12('0x34')]));_0x2322d3[_0x0c12('0x36')]=_0x2322d3['attributes'][_0x0c12('0x35')]?_0x2322d3['attributes']:_0x392d9d[_0x0c12('0x2f')];_0x2322d3[_0x0c12('0x49')]=qs[_0x0c12('0x38')](_0x2a58a1[_0x0c12('0x30')][_0x0c12('0x38')]);_0x2322d3[_0x0c12('0x3b')]=qs[_0x0c12('0x32')](_[_0x0c12('0x39')](_0x2a58a1[_0x0c12('0x30')],_0x392d9d[_0x0c12('0x32')]));if(_0x2a58a1[_0x0c12('0x30')][_0x0c12('0x3a')]){_0x2322d3['where']=_['merge'](_0x2322d3[_0x0c12('0x3b')],{'$or':_[_0x0c12('0x2a')](_0x2322d3['attributes'],function(_0x2cca7d){var _0x410c1c={};_0x410c1c[_0x2cca7d]={'$like':'%'+_0x2a58a1[_0x0c12('0x30')][_0x0c12('0x3a')]+'%'};return _0x410c1c;})});}_0x2322d3=_[_0x0c12('0x3c')]({},_0x2322d3,_0x2a58a1[_0x0c12('0x3d')]);return _0x395a34[_0x0c12('0x47')](_0x2322d3);}})['then'](function(_0x2769ed){if(_0x2769ed){_0x35c026=_0x2769ed[_0x0c12('0x35')];if(!_0x2a58a1['query'][_0x0c12('0x4a')]('nolimit')){_0x2322d3[_0x0c12('0x1d')]=qs['limit'](_0x2a58a1[_0x0c12('0x30')][_0x0c12('0x1d')]);_0x2322d3[_0x0c12('0x1b')]=qs[_0x0c12('0x1b')](_0x2a58a1[_0x0c12('0x30')]['offset']);}return _0x395a34[_0x0c12('0x47')](_0x2322d3);}})[_0x0c12('0x24')](function(_0x408685){if(_0x408685){return _0x408685?{'count':_0x35c026,'rows':_0x408685}:null;}})[_0x0c12('0x24')](respondWithResult(_0x11c799,null))[_0x0c12('0x42')](handleError(_0x11c799,null));};exports[_0x0c12('0x4b')]=function(_0x5c4396,_0x1af039,_0x19b372){if(_0x5c4396[_0x0c12('0x46')]['id']){delete _0x5c4396[_0x0c12('0x46')]['id'];}return db[_0x0c12('0x3e')][_0x0c12('0x48')]({'where':{'id':_0x5c4396[_0x0c12('0x43')]['id']}})['then'](handleEntityNotFound(_0x1af039,null))[_0x0c12('0x24')](function(_0x1c0535){if(_0x1c0535){_0x5c4396[_0x0c12('0x46')][_0x0c12('0x4c')]=_0x1c0535['id'];_0x5c4396[_0x0c12('0x46')][_0x0c12('0x4d')]=integrations[_0x0c12('0x4e')](_0x5c4396['body'][_0x0c12('0x4f')],_0x5c4396[_0x0c12('0x46')][_0x0c12('0x2d')]);_0x5c4396['body']['Descriptions']=integrations[_0x0c12('0x50')](_0x5c4396[_0x0c12('0x46')][_0x0c12('0x4f')],_0x5c4396[_0x0c12('0x46')][_0x0c12('0x2d')]);return db[_0x0c12('0x51')][_0x0c12('0x45')](_0x5c4396[_0x0c12('0x46')],{'include':[{'model':db[_0x0c12('0x52')],'as':'Subjects'},{'model':db['SugarcrmField'],'as':_0x0c12('0x53')}]});}return null;})[_0x0c12('0x24')](respondWithResult(_0x1af039,null))[_0x0c12('0x42')](handleError(_0x1af039,null));};exports[_0x0c12('0x54')]=function(_0x4f85a1,_0x46b5e8,_0x29bf85){var _0x1efdfd='';var _0x546ba=['id',_0x0c12('0x28'),_0x0c12('0x55'),_0x0c12('0x56'),'description',_0x0c12('0x57'),_0x0c12('0x58'),'duration_minutes',_0x0c12('0x59'),'parent_type',_0x0c12('0x5a'),'direction'];return db[_0x0c12('0x3e')]['findOne']({'where':{'id':_0x4f85a1[_0x0c12('0x43')]['id']},'attributes':['id','username',_0x0c12('0x5b'),_0x0c12('0x5c')]})[_0x0c12('0x24')](handleEntityNotFound(_0x46b5e8,null))[_0x0c12('0x24')](function(_0xc24ea6){if(_0xc24ea6){_0x1efdfd=_0xc24ea6[_0x0c12('0x5c')];var _0x2a2512=_0x1efdfd['slice'](-0x1);if(_0x2a2512==='/'){_0x1efdfd=_0x1efdfd[_0x0c12('0x5d')](0x0,_0x1efdfd[_0x0c12('0x5e')](_0x2a2512));}return rp({'method':'POST','uri':util['format']('%s%s',_0x1efdfd,_0x0c12('0x5f')),'json':!![],'form':{'method':_0x0c12('0x60'),'input_type':_0x0c12('0x61'),'response_type':_0x0c12('0x61'),'rest_data':JSON[_0x0c12('0x62')]({'user_auth':{'user_name':_0xc24ea6[_0x0c12('0x63')],'password':_0xc24ea6[_0x0c12('0x5b')],'encryption':_0x0c12('0x64')},'application':_0x0c12('0x65')})}});}})[_0x0c12('0x24')](function(_0x7ad6af){if(_0x7ad6af&&_0x7ad6af[_0x0c12('0x28')]!==_0x0c12('0x66')&&_0x7ad6af[_0x0c12('0x28')]!==_0x0c12('0x67')){return rp({'method':_0x0c12('0x68'),'uri':util[_0x0c12('0x69')]('%s%s',_0x1efdfd,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x0c12('0x6a'),'input_type':_0x0c12('0x61'),'response_type':_0x0c12('0x61'),'rest_data':JSON[_0x0c12('0x62')]({'session':_0x7ad6af['id'],'module_name':'Calls'})}})[_0x0c12('0x24')](function(_0xa7627c){if(_0xa7627c){var _0x33e162=_[_0x0c12('0x6b')](_0xa7627c['module_fields']);_[_0x0c12('0x6c')](_0x33e162,function(_0xc793a7){return _0x546ba[_0x0c12('0x6d')](_0xc793a7[_0x0c12('0x28')]);});return{'count':_0x33e162[_0x0c12('0x35')],'rows':_[_0x0c12('0x2a')](_0x33e162,function(_0x2ff0ad){return{'id':_0x2ff0ad[_0x0c12('0x28')],'name':_0x2ff0ad[_0x0c12('0x6e')],'custom':_[_0x0c12('0x6f')](_0x2ff0ad['name'],'_c')?!![]:![],'options':_0x2ff0ad['options']?_[_0x0c12('0x2a')](_['values'](_0x2ff0ad[_0x0c12('0x3d')]),function(_0x43f929){return{'name':_0x43f929[_0x0c12('0x70')],'value':_0x43f929[_0x0c12('0x28')]};}):[]};})};}})['then'](respondWithResult(_0x46b5e8,null))['catch'](function(_0x500614){var _0x18e89b=_0x4f85a1[_0x0c12('0x30')]['test']?0x1f4:_0x500614[_0x0c12('0x71')]||0x1f4;logger[_0x0c12('0x72')]('getFields,\x20%s,\x20%s,\x20%s',_0x0c12('0x54'),_0x18e89b,JSON[_0x0c12('0x62')](_0x500614));delete _0x500614[_0x0c12('0x28')];if(_0x18e89b===0x191){_0x18e89b=0x190;}_0x46b5e8[_0x0c12('0x19')](_0x18e89b)[_0x0c12('0x73')](_0x4f85a1[_0x0c12('0x30')][_0x0c12('0x74')]?{'message':_0x0c12('0x75'),'statusCode':_0x500614['statusCode']}:_0x500614);});}else{var _0x370cfb=0x1f4;_0x46b5e8[_0x0c12('0x19')](_0x370cfb)[_0x0c12('0x73')]({'message':_0x0c12('0x75'),'statusCode':0x190});}});}; \ No newline at end of file +var _0xc71f=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','undefined','limit','offset','count','json','apply','reject','save','then','destroy','stack','send','index','SugarcrmAccount','rawAttributes','fieldName','key','model','map','name','query','attributes','intersection','fields','length','nolimit','order','sort','filters','filter','where','merge','type','VIRTUAL','options','includeAll','include','show','params','keys','find','catch','body','update','getConfigurations','findOne','SugarcrmConfiguration','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','SugarcrmField','Descriptions','getFields','assigned_user_id','description','date_start','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','username','password','remoteUri','slice','substring','lastIndexOf','POST','%s%s','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','format','/service/v4_1/rest.php','get_module_fields','JSON','Calls','module_fields','includes','label','endsWith','values','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0xc71f,0x69));var _0xfc71=function(_0x420513,_0x30eae3){_0x420513=_0x420513-0x0;var _0x1b44ec=_0xc71f[_0x420513];return _0x1b44ec;};'use strict';var emlformat=require(_0xfc71('0x0'));var rimraf=require(_0xfc71('0x1'));var zipdir=require(_0xfc71('0x2'));var jsonpatch=require(_0xfc71('0x3'));var rp=require(_0xfc71('0x4'));var moment=require('moment');var BPromise=require(_0xfc71('0x5'));var Mustache=require(_0xfc71('0x6'));var util=require(_0xfc71('0x7'));var path=require('path');var sox=require(_0xfc71('0x8'));var csv=require(_0xfc71('0x9'));var ejs=require(_0xfc71('0xa'));var fs=require('fs');var fs_extra=require(_0xfc71('0xb'));var _=require('lodash');var squel=require(_0xfc71('0xc'));var crypto=require(_0xfc71('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xfc71('0x9'));var querystring=require('querystring');var Papa=require(_0xfc71('0xe'));var Redis=require(_0xfc71('0xf'));var authService=require(_0xfc71('0x10'));var qs=require(_0xfc71('0x11'));var as=require(_0xfc71('0x12'));var hardwareService=require(_0xfc71('0x13'));var logger=require(_0xfc71('0x14'))(_0xfc71('0x15'));var utils=require('../../config/utils');var config=require(_0xfc71('0x16'));var licenseUtil=require(_0xfc71('0x17'));var db=require(_0xfc71('0x18'))['db'];var integrations=require(_0xfc71('0x19'));function respondWithStatusCode(_0x3842f6,_0x43fffb){_0x43fffb=_0x43fffb||0xcc;return function(_0x403657){if(_0x403657){return _0x3842f6[_0xfc71('0x1a')](_0x43fffb);}return _0x3842f6[_0xfc71('0x1b')](_0x43fffb)[_0xfc71('0x1c')]();};}function respondWithResult(_0x5148cf,_0x1f233e){_0x1f233e=_0x1f233e||0xc8;return function(_0x54826a){if(_0x54826a){return _0x5148cf['status'](_0x1f233e)['json'](_0x54826a);}};}function respondWithFilteredResult(_0xce0795,_0x3b1638){return function(_0x490d32){if(_0x490d32){var _0x346f8b=typeof _0x3b1638['offset']===_0xfc71('0x1d')&&typeof _0x3b1638[_0xfc71('0x1e')]===_0xfc71('0x1d');var _0x423b93=_0x490d32['count'];var _0x414e70=_0x346f8b?0x0:_0x3b1638[_0xfc71('0x1f')];var _0x1b1642=_0x346f8b?_0x490d32[_0xfc71('0x20')]:_0x3b1638[_0xfc71('0x1f')]+_0x3b1638[_0xfc71('0x1e')];var _0x27bc1c;if(_0x1b1642>=_0x423b93){_0x1b1642=_0x423b93;_0x27bc1c=0xc8;}else{_0x27bc1c=0xce;}_0xce0795[_0xfc71('0x1b')](_0x27bc1c);return _0xce0795['set']('Content-Range',_0x414e70+'-'+_0x1b1642+'/'+_0x423b93)[_0xfc71('0x21')](_0x490d32);}return null;};}function patchUpdates(_0x240909){return function(_0x1b2885){try{jsonpatch[_0xfc71('0x22')](_0x1b2885,_0x240909,!![]);}catch(_0x56a16f){return BPromise[_0xfc71('0x23')](_0x56a16f);}return _0x1b2885[_0xfc71('0x24')]();};}function saveUpdates(_0x4176c3,_0x5962f9){return function(_0x1ea775){if(_0x1ea775){return _0x1ea775['update'](_0x4176c3)[_0xfc71('0x25')](function(_0xd30577){return _0xd30577;});}return null;};}function removeEntity(_0x4761d3,_0x2420df){return function(_0x51ea77){if(_0x51ea77){return _0x51ea77[_0xfc71('0x26')]()['then'](function(){_0x4761d3[_0xfc71('0x1b')](0xcc)[_0xfc71('0x1c')]();});}};}function handleEntityNotFound(_0x398e84,_0x3a3b4e){return function(_0x55b371){if(!_0x55b371){_0x398e84[_0xfc71('0x1a')](0x194);}return _0x55b371;};}function handleError(_0x1e765a,_0x319d19){_0x319d19=_0x319d19||0x1f4;return function(_0x5d376b){logger['error'](_0x5d376b[_0xfc71('0x27')]);if(_0x5d376b['name']){delete _0x5d376b['name'];}_0x1e765a[_0xfc71('0x1b')](_0x319d19)[_0xfc71('0x28')](_0x5d376b);};}exports[_0xfc71('0x29')]=function(_0x52fbe2,_0x5d0065){var _0x43a106={},_0x15780b={},_0x50ce4c={'count':0x0,'rows':[]};var _0x364475=_['map'](db[_0xfc71('0x2a')][_0xfc71('0x2b')],function(_0x1841fb){return{'name':_0x1841fb[_0xfc71('0x2c')],'type':_0x1841fb['type'][_0xfc71('0x2d')]};});_0x15780b[_0xfc71('0x2e')]=_[_0xfc71('0x2f')](_0x364475,_0xfc71('0x30'));_0x15780b[_0xfc71('0x31')]=_['keys'](_0x52fbe2[_0xfc71('0x31')]);_0x15780b['filters']=_['intersection'](_0x15780b[_0xfc71('0x2e')],_0x15780b['query']);_0x43a106[_0xfc71('0x32')]=_[_0xfc71('0x33')](_0x15780b['model'],qs[_0xfc71('0x34')](_0x52fbe2[_0xfc71('0x31')][_0xfc71('0x34')]));_0x43a106[_0xfc71('0x32')]=_0x43a106[_0xfc71('0x32')][_0xfc71('0x35')]?_0x43a106['attributes']:_0x15780b['model'];if(!_0x52fbe2['query']['hasOwnProperty'](_0xfc71('0x36'))){_0x43a106[_0xfc71('0x1e')]=qs[_0xfc71('0x1e')](_0x52fbe2['query']['limit']);_0x43a106['offset']=qs[_0xfc71('0x1f')](_0x52fbe2['query'][_0xfc71('0x1f')]);}_0x43a106[_0xfc71('0x37')]=qs['sort'](_0x52fbe2[_0xfc71('0x31')][_0xfc71('0x38')]);_0x43a106['where']=qs['filters'](_['pick'](_0x52fbe2[_0xfc71('0x31')],_0x15780b[_0xfc71('0x39')]),_0x364475);if(_0x52fbe2[_0xfc71('0x31')][_0xfc71('0x3a')]){_0x43a106[_0xfc71('0x3b')]=_[_0xfc71('0x3c')](_0x43a106['where'],{'$or':_[_0xfc71('0x2f')](_0x364475,function(_0x5bf7a3){if(_0x5bf7a3[_0xfc71('0x3d')]!==_0xfc71('0x3e')){var _0x178e21={};_0x178e21[_0x5bf7a3['name']]={'$like':'%'+_0x52fbe2[_0xfc71('0x31')][_0xfc71('0x3a')]+'%'};return _0x178e21;}})});}_0x43a106=_['merge']({},_0x43a106,_0x52fbe2[_0xfc71('0x3f')]);var _0x124a81={'where':_0x43a106[_0xfc71('0x3b')]};return db[_0xfc71('0x2a')][_0xfc71('0x20')](_0x124a81)['then'](function(_0x589518){_0x50ce4c[_0xfc71('0x20')]=_0x589518;if(_0x52fbe2[_0xfc71('0x31')][_0xfc71('0x40')]){_0x43a106[_0xfc71('0x41')]=[{'all':!![]}];}return db['SugarcrmAccount']['findAll'](_0x43a106);})[_0xfc71('0x25')](function(_0x206e96){_0x50ce4c['rows']=_0x206e96;return _0x50ce4c;})[_0xfc71('0x25')](respondWithFilteredResult(_0x5d0065,_0x43a106))['catch'](handleError(_0x5d0065,null));};exports[_0xfc71('0x42')]=function(_0x1ec57f,_0x3d2018){var _0x3351ca={'raw':![],'where':{'id':_0x1ec57f[_0xfc71('0x43')]['id']}},_0x4f9364={};_0x4f9364['model']=_[_0xfc71('0x44')](db['SugarcrmAccount'][_0xfc71('0x2b')]);_0x4f9364['query']=_['keys'](_0x1ec57f[_0xfc71('0x31')]);_0x4f9364[_0xfc71('0x39')]=_[_0xfc71('0x33')](_0x4f9364['model'],_0x4f9364[_0xfc71('0x31')]);_0x3351ca[_0xfc71('0x32')]=_[_0xfc71('0x33')](_0x4f9364[_0xfc71('0x2e')],qs[_0xfc71('0x34')](_0x1ec57f[_0xfc71('0x31')][_0xfc71('0x34')]));_0x3351ca[_0xfc71('0x32')]=_0x3351ca['attributes'][_0xfc71('0x35')]?_0x3351ca[_0xfc71('0x32')]:_0x4f9364[_0xfc71('0x2e')];if(_0x1ec57f['query'][_0xfc71('0x40')]){_0x3351ca[_0xfc71('0x41')]=[{'all':!![]}];}_0x3351ca=_[_0xfc71('0x3c')]({},_0x3351ca,_0x1ec57f[_0xfc71('0x3f')]);return db[_0xfc71('0x2a')][_0xfc71('0x45')](_0x3351ca)[_0xfc71('0x25')](handleEntityNotFound(_0x3d2018,null))[_0xfc71('0x25')](respondWithResult(_0x3d2018,null))[_0xfc71('0x46')](handleError(_0x3d2018,null));};exports['create']=function(_0x2c1925,_0x540328){return db[_0xfc71('0x2a')]['create'](_0x2c1925[_0xfc71('0x47')],{})['then'](respondWithResult(_0x540328,0xc9))[_0xfc71('0x46')](handleError(_0x540328,null));};exports[_0xfc71('0x48')]=function(_0xd15224,_0xdddf83){if(_0xd15224[_0xfc71('0x47')]['id']){delete _0xd15224[_0xfc71('0x47')]['id'];}return db[_0xfc71('0x2a')][_0xfc71('0x45')]({'where':{'id':_0xd15224[_0xfc71('0x43')]['id']}})[_0xfc71('0x25')](handleEntityNotFound(_0xdddf83,null))[_0xfc71('0x25')](saveUpdates(_0xd15224[_0xfc71('0x47')],null))['then'](respondWithResult(_0xdddf83,null))[_0xfc71('0x46')](handleError(_0xdddf83,null));};exports[_0xfc71('0x26')]=function(_0x38c0a6,_0x49678e){return db[_0xfc71('0x2a')][_0xfc71('0x45')]({'where':{'id':_0x38c0a6['params']['id']}})[_0xfc71('0x25')](handleEntityNotFound(_0x49678e,null))[_0xfc71('0x25')](removeEntity(_0x49678e,null))[_0xfc71('0x46')](handleError(_0x49678e,null));};exports[_0xfc71('0x49')]=function(_0xb47c8d,_0x5f4369,_0x15a35f){var _0x2dbb24={};var _0x5a830c={};var _0x2dced6;var _0x280874;return db[_0xfc71('0x2a')][_0xfc71('0x4a')]({'where':{'id':_0xb47c8d[_0xfc71('0x43')]['id']}})[_0xfc71('0x25')](handleEntityNotFound(_0x5f4369,null))[_0xfc71('0x25')](function(_0xeaaab7){if(_0xeaaab7){_0x2dced6=_0xeaaab7;_0x5a830c[_0xfc71('0x2e')]=_['keys'](db[_0xfc71('0x4b')][_0xfc71('0x2b')]);_0x5a830c[_0xfc71('0x31')]=_[_0xfc71('0x44')](_0xb47c8d[_0xfc71('0x31')]);_0x5a830c[_0xfc71('0x39')]=_[_0xfc71('0x33')](_0x5a830c[_0xfc71('0x2e')],_0x5a830c[_0xfc71('0x31')]);_0x2dbb24[_0xfc71('0x32')]=_[_0xfc71('0x33')](_0x5a830c[_0xfc71('0x2e')],qs[_0xfc71('0x34')](_0xb47c8d['query'][_0xfc71('0x34')]));_0x2dbb24[_0xfc71('0x32')]=_0x2dbb24[_0xfc71('0x32')][_0xfc71('0x35')]?_0x2dbb24['attributes']:_0x5a830c[_0xfc71('0x2e')];_0x2dbb24[_0xfc71('0x37')]=qs[_0xfc71('0x38')](_0xb47c8d[_0xfc71('0x31')][_0xfc71('0x38')]);_0x2dbb24['where']=qs[_0xfc71('0x39')](_[_0xfc71('0x4c')](_0xb47c8d[_0xfc71('0x31')],_0x5a830c[_0xfc71('0x39')]));if(_0xb47c8d['query'][_0xfc71('0x3a')]){_0x2dbb24[_0xfc71('0x3b')]=_['merge'](_0x2dbb24[_0xfc71('0x3b')],{'$or':_[_0xfc71('0x2f')](_0x2dbb24[_0xfc71('0x32')],function(_0x402c22){var _0xd055fd={};_0xd055fd[_0x402c22]={'$like':'%'+_0xb47c8d['query']['filter']+'%'};return _0xd055fd;})});}_0x2dbb24=_['merge']({},_0x2dbb24,_0xb47c8d['options']);return _0x2dced6[_0xfc71('0x49')](_0x2dbb24);}})[_0xfc71('0x25')](function(_0x39db7b){if(_0x39db7b){_0x280874=_0x39db7b[_0xfc71('0x35')];if(!_0xb47c8d[_0xfc71('0x31')]['hasOwnProperty'](_0xfc71('0x36'))){_0x2dbb24[_0xfc71('0x1e')]=qs['limit'](_0xb47c8d['query'][_0xfc71('0x1e')]);_0x2dbb24[_0xfc71('0x1f')]=qs[_0xfc71('0x1f')](_0xb47c8d[_0xfc71('0x31')][_0xfc71('0x1f')]);}return _0x2dced6[_0xfc71('0x49')](_0x2dbb24);}})[_0xfc71('0x25')](function(_0x20435b){if(_0x20435b){return _0x20435b?{'count':_0x280874,'rows':_0x20435b}:null;}})[_0xfc71('0x25')](respondWithResult(_0x5f4369,null))[_0xfc71('0x46')](handleError(_0x5f4369,null));};exports[_0xfc71('0x4d')]=function(_0x2fb8cd,_0x15f77d,_0x30fe86){if(_0x2fb8cd['body']['id']){delete _0x2fb8cd[_0xfc71('0x47')]['id'];}return db[_0xfc71('0x2a')][_0xfc71('0x4a')]({'where':{'id':_0x2fb8cd[_0xfc71('0x43')]['id']}})[_0xfc71('0x25')](handleEntityNotFound(_0x15f77d,null))[_0xfc71('0x25')](function(_0x347c37){if(_0x347c37){_0x2fb8cd[_0xfc71('0x47')][_0xfc71('0x4e')]=_0x347c37['id'];_0x2fb8cd[_0xfc71('0x47')][_0xfc71('0x4f')]=integrations[_0xfc71('0x50')](_0x2fb8cd[_0xfc71('0x47')][_0xfc71('0x51')],_0x2fb8cd[_0xfc71('0x47')][_0xfc71('0x3d')]);_0x2fb8cd[_0xfc71('0x47')]['Descriptions']=integrations[_0xfc71('0x52')](_0x2fb8cd[_0xfc71('0x47')][_0xfc71('0x51')],_0x2fb8cd['body'][_0xfc71('0x3d')]);return db['SugarcrmConfiguration']['create'](_0x2fb8cd['body'],{'include':[{'model':db[_0xfc71('0x53')],'as':'Subjects'},{'model':db[_0xfc71('0x53')],'as':_0xfc71('0x54')}]});}return null;})[_0xfc71('0x25')](respondWithResult(_0x15f77d,null))[_0xfc71('0x46')](handleError(_0x15f77d,null));};exports[_0xfc71('0x55')]=function(_0x2dc0e6,_0x308df5,_0x3095ad){var _0x9796f9='';var _0x4f0747=['id','name',_0xfc71('0x56'),'created_by',_0xfc71('0x57'),_0xfc71('0x58'),_0xfc71('0x59'),_0xfc71('0x5a'),_0xfc71('0x5b'),_0xfc71('0x5c'),_0xfc71('0x5d'),_0xfc71('0x5e')];return db['SugarcrmAccount'][_0xfc71('0x4a')]({'where':{'id':_0x2dc0e6[_0xfc71('0x43')]['id']},'attributes':['id',_0xfc71('0x5f'),_0xfc71('0x60'),'remoteUri']})[_0xfc71('0x25')](handleEntityNotFound(_0x308df5,null))['then'](function(_0x4998d8){if(_0x4998d8){_0x9796f9=_0x4998d8[_0xfc71('0x61')];var _0x2c6b20=_0x9796f9[_0xfc71('0x62')](-0x1);if(_0x2c6b20==='/'){_0x9796f9=_0x9796f9[_0xfc71('0x63')](0x0,_0x9796f9[_0xfc71('0x64')](_0x2c6b20));}return rp({'method':_0xfc71('0x65'),'uri':util['format'](_0xfc71('0x66'),_0x9796f9,'/service/v4_1/rest.php'),'json':!![],'form':{'method':'login','input_type':'JSON','response_type':'JSON','rest_data':JSON[_0xfc71('0x67')]({'user_auth':{'user_name':_0x4998d8[_0xfc71('0x5f')],'password':_0x4998d8[_0xfc71('0x60')],'encryption':_0xfc71('0x68')},'application':_0xfc71('0x69')})}});}})[_0xfc71('0x25')](function(_0x19ec33){if(_0x19ec33&&_0x19ec33[_0xfc71('0x30')]!==_0xfc71('0x6a')&&_0x19ec33['name']!==_0xfc71('0x6b')){return rp({'method':_0xfc71('0x65'),'uri':util[_0xfc71('0x6c')](_0xfc71('0x66'),_0x9796f9,_0xfc71('0x6d')),'json':!![],'form':{'method':_0xfc71('0x6e'),'input_type':'JSON','response_type':_0xfc71('0x6f'),'rest_data':JSON[_0xfc71('0x67')]({'session':_0x19ec33['id'],'module_name':_0xfc71('0x70')})}})[_0xfc71('0x25')](function(_0x214b50){if(_0x214b50){var _0x4dc2a=_['values'](_0x214b50[_0xfc71('0x71')]);_['remove'](_0x4dc2a,function(_0x22d32){return _0x4f0747[_0xfc71('0x72')](_0x22d32['name']);});return{'count':_0x4dc2a[_0xfc71('0x35')],'rows':_[_0xfc71('0x2f')](_0x4dc2a,function(_0x2e71e1){return{'id':_0x2e71e1[_0xfc71('0x30')],'name':_0x2e71e1[_0xfc71('0x73')],'custom':_[_0xfc71('0x74')](_0x2e71e1['name'],'_c')?!![]:![],'options':_0x2e71e1[_0xfc71('0x3f')]?_[_0xfc71('0x2f')](_[_0xfc71('0x75')](_0x2e71e1[_0xfc71('0x3f')]),function(_0x452a8c){return{'name':_0x452a8c['value'],'value':_0x452a8c[_0xfc71('0x30')]};}):[]};})};}})[_0xfc71('0x25')](respondWithResult(_0x308df5,null))[_0xfc71('0x46')](function(_0x278fbd){var _0x321eeb=_0x2dc0e6[_0xfc71('0x31')][_0xfc71('0x76')]?0x1f4:_0x278fbd[_0xfc71('0x77')]||0x1f4;logger[_0xfc71('0x78')](_0xfc71('0x79'),'getFields',_0x321eeb,JSON[_0xfc71('0x67')](_0x278fbd));delete _0x278fbd[_0xfc71('0x30')];if(_0x321eeb===0x191){_0x321eeb=0x190;}_0x308df5['status'](_0x321eeb)[_0xfc71('0x28')](_0x2dc0e6[_0xfc71('0x31')][_0xfc71('0x76')]?{'message':_0xfc71('0x7a'),'statusCode':_0x278fbd[_0xfc71('0x77')]}:_0x278fbd);});}else{var _0x15e967=0x1f4;_0x308df5[_0xfc71('0x1b')](_0x15e967)['send']({'message':'Wrong\x20credentials','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 a7a66e8..b510712 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 _0xdfa0=['./intSugarcrmAccount.attributes','../../components/integrations/configuration','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x2a0dce,_0x2c6bb7){var _0xaa908e=function(_0x4f6bef){while(--_0x4f6bef){_0x2a0dce['push'](_0x2a0dce['shift']());}};_0xaa908e(++_0x2c6bb7);}(_0xdfa0,0x109));var _0x0dfa=function(_0x1cae4b,_0x33f773){_0x1cae4b=_0x1cae4b-0x0;var _0x5be2c2=_0xdfa0[_0x1cae4b];return _0x5be2c2;};'use strict';var _=require(_0x0dfa('0x0'));var util=require(_0x0dfa('0x1'));var logger=require('../../config/logger')(_0x0dfa('0x2'));var moment=require(_0x0dfa('0x3'));var BPromise=require(_0x0dfa('0x4'));var rp=require(_0x0dfa('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0dfa('0x6'));var config=require(_0x0dfa('0x7'));var attributes=require(_0x0dfa('0x8'));var integrations=require(_0x0dfa('0x9'));module['exports']=function(_0x1e1c2a,_0x209035){return _0x1e1c2a[_0x0dfa('0xa')](_0x0dfa('0xb'),attributes,{'tableName':_0x0dfa('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc4ee=['api','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','../../config/logger'];(function(_0x31e584,_0x4d9f7f){var _0x5686d0=function(_0x1f9e99){while(--_0x1f9e99){_0x31e584['push'](_0x31e584['shift']());}};_0x5686d0(++_0x4d9f7f);}(_0xc4ee,0x147));var _0xec4e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc4ee[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xec4e('0x0'));var util=require(_0xec4e('0x1'));var logger=require(_0xec4e('0x2'))(_0xec4e('0x3'));var moment=require('moment');var BPromise=require(_0xec4e('0x4'));var rp=require(_0xec4e('0x5'));var fs=require('fs');var path=require(_0xec4e('0x6'));var rimraf=require(_0xec4e('0x7'));var config=require(_0xec4e('0x8'));var attributes=require(_0xec4e('0x9'));var integrations=require(_0xec4e('0xa'));module[_0xec4e('0xb')]=function(_0xf8ec68,_0x3b750d){return _0xf8ec68[_0xec4e('0xc')](_0xec4e('0xd'),attributes,{'tableName':_0xec4e('0xe'),'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 ba94620..9283b74 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 _0x043e=['find','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SugarcrmAccount,\x20%s,\x20%s','SugarcrmAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','attributes','limit','include','map','model','debug','message','ShowSugarcrmAccount'];(function(_0x5e7634,_0x5356a1){var _0x563eb3=function(_0x1f73f7){while(--_0x1f73f7){_0x5e7634['push'](_0x5e7634['shift']());}};_0x563eb3(++_0x5356a1);}(_0x043e,0x6d));var _0xe043=function(_0x224aa6,_0x268b06){_0x224aa6=_0x224aa6-0x0;var _0x1f621c=_0x043e[_0x224aa6];return _0x1f621c;};'use strict';var _=require(_0xe043('0x0'));var util=require(_0xe043('0x1'));var moment=require('moment');var BPromise=require(_0xe043('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe043('0x3'));var db=require(_0xe043('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe043('0x5'))(_0xe043('0x6'));var config=require(_0xe043('0x7'));var jayson=require(_0xe043('0x8'));var client=jayson[_0xe043('0x9')][_0xe043('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4c953e,_0x53edfc,_0x4d1324){return new BPromise(function(_0x127f18,_0x2aca97){return client['request'](_0x4c953e,_0x4d1324)[_0xe043('0xb')](function(_0x203693){logger[_0xe043('0xc')](_0xe043('0xd'),_0x53edfc,'request\x20sent');logger['debug'](_0xe043('0xe'),_0x53edfc,_0xe043('0xf'),JSON[_0xe043('0x10')](_0x203693));if(_0x203693[_0xe043('0x11')]){if(_0x203693['error'][_0xe043('0x12')]===0x1f4){logger[_0xe043('0x11')]('SugarcrmAccount,\x20%s,\x20%s',_0x53edfc,_0x203693[_0xe043('0x11')]['message']);return _0x2aca97(_0x203693[_0xe043('0x11')]['message']);}logger[_0xe043('0x11')]('SugarcrmAccount,\x20%s,\x20%s',_0x53edfc,_0x203693['error']['message']);return _0x127f18(_0x203693[_0xe043('0x11')]['message']);}else{logger[_0xe043('0xc')](_0xe043('0xd'),_0x53edfc,_0xe043('0xf'));_0x127f18(_0x203693[_0xe043('0x13')]['message']);}})[_0xe043('0x14')](function(_0x4cb645){logger[_0xe043('0x11')](_0xe043('0xd'),_0x53edfc,_0x4cb645);_0x2aca97(_0x4cb645);});});}exports[_0xe043('0x15')]=function(_0xe419bc){var _0x3013cd=this;return new Promise(function(_0x10e6fd,_0x4ec288){return db[_0xe043('0x16')][_0xe043('0x17')]({'raw':_0xe419bc[_0xe043('0x18')]?_0xe419bc['options'][_0xe043('0x19')]===undefined?!![]:![]:!![],'where':_0xe419bc[_0xe043('0x18')]?_0xe419bc[_0xe043('0x18')][_0xe043('0x1a')]||null:null,'attributes':_0xe419bc['options']?_0xe419bc[_0xe043('0x18')][_0xe043('0x1b')]||null:null,'limit':_0xe419bc[_0xe043('0x18')]?_0xe419bc['options'][_0xe043('0x1c')]||null:null,'include':_0xe419bc[_0xe043('0x18')]?_0xe419bc[_0xe043('0x18')][_0xe043('0x1d')]?_[_0xe043('0x1e')](_0xe419bc[_0xe043('0x18')]['include'],function(_0x4ab7db){return{'model':db[_0x4ab7db['model']],'as':_0x4ab7db['as'],'attributes':_0x4ab7db[_0xe043('0x1b')],'include':_0x4ab7db[_0xe043('0x1d')]?_[_0xe043('0x1e')](_0x4ab7db['include'],function(_0x2b24ca){return{'model':db[_0x2b24ca[_0xe043('0x1f')]],'as':_0x2b24ca['as'],'attributes':_0x2b24ca[_0xe043('0x1b')],'include':_0x2b24ca[_0xe043('0x1d')]?_[_0xe043('0x1e')](_0x2b24ca[_0xe043('0x1d')],function(_0x2aaf82){return{'model':db[_0x2aaf82[_0xe043('0x1f')]],'as':_0x2aaf82['as'],'attributes':_0x2aaf82[_0xe043('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xe043('0xb')](function(_0x59ba82){logger['info'](_0xe043('0x15'),_0xe419bc);logger[_0xe043('0x20')]('GetSugarcrmAccount',_0xe419bc,JSON[_0xe043('0x10')](_0x59ba82));_0x10e6fd(_0x59ba82);})[_0xe043('0x14')](function(_0x180346){logger[_0xe043('0x11')]('GetSugarcrmAccount',_0x180346[_0xe043('0x21')],_0xe419bc);_0x4ec288(_0x3013cd[_0xe043('0x11')](0x1f4,_0x180346[_0xe043('0x21')]));});});};exports[_0xe043('0x22')]=function(_0x24cba9){var _0x1b71bc=this;return new Promise(function(_0x1fd3b1,_0x3cee5e){return db['SugarcrmAccount'][_0xe043('0x23')]({'raw':_0x24cba9[_0xe043('0x18')]?_0x24cba9[_0xe043('0x18')][_0xe043('0x19')]===undefined?!![]:![]:!![],'where':_0x24cba9[_0xe043('0x18')]?_0x24cba9['options'][_0xe043('0x1a')]||null:null,'attributes':_0x24cba9[_0xe043('0x18')]?_0x24cba9['options'][_0xe043('0x1b')]||null:null,'include':_0x24cba9[_0xe043('0x18')]?_0x24cba9['options']['include']?_[_0xe043('0x1e')](_0x24cba9[_0xe043('0x18')]['include'],function(_0x5ab3ea){return{'model':db[_0x5ab3ea['model']],'as':_0x5ab3ea['as'],'attributes':_0x5ab3ea[_0xe043('0x1b')],'include':_0x5ab3ea[_0xe043('0x1d')]?_['map'](_0x5ab3ea[_0xe043('0x1d')],function(_0x49bf60){return{'model':db[_0x49bf60[_0xe043('0x1f')]],'as':_0x49bf60['as'],'attributes':_0x49bf60['attributes'],'include':_0x49bf60['include']?_[_0xe043('0x1e')](_0x49bf60[_0xe043('0x1d')],function(_0x4b3d8a){return{'model':db[_0x4b3d8a[_0xe043('0x1f')]],'as':_0x4b3d8a['as'],'attributes':_0x4b3d8a[_0xe043('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xe043('0xb')](function(_0x5bb880){logger['info'](_0xe043('0x22'),_0x24cba9);logger[_0xe043('0x20')]('ShowSugarcrmAccount',_0x24cba9,JSON[_0xe043('0x10')](_0x5bb880));_0x1fd3b1(_0x5bb880);})[_0xe043('0x14')](function(_0x5731c8){logger[_0xe043('0x11')](_0xe043('0x22'),_0x5731c8[_0xe043('0x21')],_0x24cba9);_0x3cee5e(_0x1b71bc[_0xe043('0x11')](0x1f4,_0x5731c8[_0xe043('0x21')]));});});}; \ No newline at end of file +var _0x09bb=['debug','stringify','error','code','message','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','limit','include','map','model','attributes','ShowSugarcrmAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x4b5fdf,_0xc95a9b){var _0x6fe2eb=function(_0x352b01){while(--_0x352b01){_0x4b5fdf['push'](_0x4b5fdf['shift']());}};_0x6fe2eb(++_0xc95a9b);}(_0x09bb,0xc6));var _0xb09b=function(_0x58cc6e,_0x291cc6){_0x58cc6e=_0x58cc6e-0x0;var _0x571e81=_0x09bb[_0x58cc6e];return _0x571e81;};'use strict';var _=require(_0xb09b('0x0'));var util=require(_0xb09b('0x1'));var moment=require(_0xb09b('0x2'));var BPromise=require(_0xb09b('0x3'));var rs=require(_0xb09b('0x4'));var fs=require('fs');var Redis=require(_0xb09b('0x5'));var db=require(_0xb09b('0x6'))['db'];var utils=require(_0xb09b('0x7'));var logger=require(_0xb09b('0x8'))(_0xb09b('0x9'));var config=require(_0xb09b('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xb09b('0xb')][_0xb09b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5f19b7,_0x40f062,_0x7879e){return new BPromise(function(_0x53207a,_0x3141d5){return client[_0xb09b('0xd')](_0x5f19b7,_0x7879e)[_0xb09b('0xe')](function(_0x231f34){logger[_0xb09b('0xf')](_0xb09b('0x10'),_0x40f062,_0xb09b('0x11'));logger[_0xb09b('0x12')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x40f062,_0xb09b('0x11'),JSON[_0xb09b('0x13')](_0x231f34));if(_0x231f34[_0xb09b('0x14')]){if(_0x231f34['error'][_0xb09b('0x15')]===0x1f4){logger[_0xb09b('0x14')](_0xb09b('0x10'),_0x40f062,_0x231f34[_0xb09b('0x14')][_0xb09b('0x16')]);return _0x3141d5(_0x231f34[_0xb09b('0x14')][_0xb09b('0x16')]);}logger[_0xb09b('0x14')](_0xb09b('0x10'),_0x40f062,_0x231f34[_0xb09b('0x14')]['message']);return _0x53207a(_0x231f34[_0xb09b('0x14')]['message']);}else{logger[_0xb09b('0xf')](_0xb09b('0x10'),_0x40f062,'request\x20sent');_0x53207a(_0x231f34[_0xb09b('0x17')][_0xb09b('0x16')]);}})[_0xb09b('0x18')](function(_0x2ff08e){logger['error'](_0xb09b('0x10'),_0x40f062,_0x2ff08e);_0x3141d5(_0x2ff08e);});});}exports[_0xb09b('0x19')]=function(_0x147f99){var _0x5c413b=this;return new Promise(function(_0x598b95,_0x55f0c5){return db[_0xb09b('0x1a')][_0xb09b('0x1b')]({'raw':_0x147f99[_0xb09b('0x1c')]?_0x147f99['options'][_0xb09b('0x1d')]===undefined?!![]:![]:!![],'where':_0x147f99['options']?_0x147f99['options']['where']||null:null,'attributes':_0x147f99[_0xb09b('0x1c')]?_0x147f99['options']['attributes']||null:null,'limit':_0x147f99[_0xb09b('0x1c')]?_0x147f99[_0xb09b('0x1c')][_0xb09b('0x1e')]||null:null,'include':_0x147f99[_0xb09b('0x1c')]?_0x147f99[_0xb09b('0x1c')][_0xb09b('0x1f')]?_[_0xb09b('0x20')](_0x147f99[_0xb09b('0x1c')]['include'],function(_0x2d22e8){return{'model':db[_0x2d22e8[_0xb09b('0x21')]],'as':_0x2d22e8['as'],'attributes':_0x2d22e8['attributes'],'include':_0x2d22e8[_0xb09b('0x1f')]?_[_0xb09b('0x20')](_0x2d22e8[_0xb09b('0x1f')],function(_0x1397fa){return{'model':db[_0x1397fa['model']],'as':_0x1397fa['as'],'attributes':_0x1397fa['attributes'],'include':_0x1397fa[_0xb09b('0x1f')]?_[_0xb09b('0x20')](_0x1397fa[_0xb09b('0x1f')],function(_0x1ec768){return{'model':db[_0x1ec768[_0xb09b('0x21')]],'as':_0x1ec768['as'],'attributes':_0x1ec768[_0xb09b('0x22')]};}):[]};}):[]};}):[]:[]})[_0xb09b('0xe')](function(_0x183d27){logger[_0xb09b('0xf')](_0xb09b('0x19'),_0x147f99);logger[_0xb09b('0x12')](_0xb09b('0x19'),_0x147f99,JSON['stringify'](_0x183d27));_0x598b95(_0x183d27);})[_0xb09b('0x18')](function(_0x76a846){logger[_0xb09b('0x14')]('GetSugarcrmAccount',_0x76a846[_0xb09b('0x16')],_0x147f99);_0x55f0c5(_0x5c413b['error'](0x1f4,_0x76a846[_0xb09b('0x16')]));});});};exports[_0xb09b('0x23')]=function(_0x5aea6c){var _0x225232=this;return new Promise(function(_0x3052d7,_0x177468){return db[_0xb09b('0x1a')]['find']({'raw':_0x5aea6c['options']?_0x5aea6c['options']['raw']===undefined?!![]:![]:!![],'where':_0x5aea6c[_0xb09b('0x1c')]?_0x5aea6c['options']['where']||null:null,'attributes':_0x5aea6c['options']?_0x5aea6c[_0xb09b('0x1c')]['attributes']||null:null,'include':_0x5aea6c[_0xb09b('0x1c')]?_0x5aea6c['options'][_0xb09b('0x1f')]?_[_0xb09b('0x20')](_0x5aea6c[_0xb09b('0x1c')][_0xb09b('0x1f')],function(_0x572dd1){return{'model':db[_0x572dd1['model']],'as':_0x572dd1['as'],'attributes':_0x572dd1[_0xb09b('0x22')],'include':_0x572dd1[_0xb09b('0x1f')]?_[_0xb09b('0x20')](_0x572dd1[_0xb09b('0x1f')],function(_0x3107a2){return{'model':db[_0x3107a2[_0xb09b('0x21')]],'as':_0x3107a2['as'],'attributes':_0x3107a2[_0xb09b('0x22')],'include':_0x3107a2[_0xb09b('0x1f')]?_[_0xb09b('0x20')](_0x3107a2[_0xb09b('0x1f')],function(_0x4bdf66){return{'model':db[_0x4bdf66['model']],'as':_0x4bdf66['as'],'attributes':_0x4bdf66[_0xb09b('0x22')]};}):[]};}):[]};}):[]:[]})[_0xb09b('0xe')](function(_0x20d01f){logger[_0xb09b('0xf')](_0xb09b('0x23'),_0x5aea6c);logger[_0xb09b('0x12')](_0xb09b('0x23'),_0x5aea6c,JSON[_0xb09b('0x13')](_0x20d01f));_0x3052d7(_0x20d01f);})[_0xb09b('0x18')](function(_0x5be950){logger['error'](_0xb09b('0x23'),_0x5be950[_0xb09b('0x16')],_0x5aea6c);_0x177468(_0x225232[_0xb09b('0x14')](0x1f4,_0x5be950['message']));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index adadfa4..ea0e7f3 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 _0x84c3=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','post','update','destroy','util'];(function(_0x768bd2,_0xf0237b){var _0x57bd72=function(_0x5ab531){while(--_0x5ab531){_0x768bd2['push'](_0x768bd2['shift']());}};_0x57bd72(++_0xf0237b);}(_0x84c3,0xdb));var _0x384c=function(_0x68ee8b,_0x3cc6c5){_0x68ee8b=_0x68ee8b-0x0;var _0x5148f7=_0x84c3[_0x68ee8b];return _0x5148f7;};'use strict';var multer=require('multer');var util=require(_0x384c('0x0'));var path=require(_0x384c('0x1'));var timeout=require(_0x384c('0x2'));var express=require(_0x384c('0x3'));var router=express[_0x384c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x384c('0x5'));var interaction=require(_0x384c('0x6'));var config=require(_0x384c('0x7'));var controller=require(_0x384c('0x8'));router[_0x384c('0x9')]('/',auth['isAuthenticated'](),controller[_0x384c('0xa')]);router[_0x384c('0x9')](_0x384c('0xb'),auth[_0x384c('0xc')](),controller[_0x384c('0xd')]);router['get'](_0x384c('0xe'),auth[_0x384c('0xc')](),controller[_0x384c('0xf')]);router[_0x384c('0x9')](_0x384c('0x10'),auth[_0x384c('0xc')](),controller[_0x384c('0x11')]);router[_0x384c('0x9')]('/:id/descriptions',auth[_0x384c('0xc')](),controller[_0x384c('0x12')]);router[_0x384c('0x13')]('/',auth[_0x384c('0xc')](),controller['create']);router['put']('/:id',auth[_0x384c('0xc')](),controller[_0x384c('0x14')]);router['delete']('/:id',auth[_0x384c('0xc')](),controller[_0x384c('0x15')]);module['exports']=router; \ No newline at end of file +var _0x552a=['./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects','getDescriptions','post','put','update','destroy','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1410d6,_0x31b6d){var _0xad291c=function(_0x4dfa90){while(--_0x4dfa90){_0x1410d6['push'](_0x1410d6['shift']());}};_0xad291c(++_0x31b6d);}(_0x552a,0xa1));var _0xa552=function(_0x2f43f4,_0x2428b1){_0x2f43f4=_0x2f43f4-0x0;var _0x4f4223=_0x552a[_0x2f43f4];return _0x4f4223;};'use strict';var multer=require(_0xa552('0x0'));var util=require(_0xa552('0x1'));var path=require(_0xa552('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa552('0x3'));var auth=require(_0xa552('0x4'));var interaction=require(_0xa552('0x5'));var config=require(_0xa552('0x6'));var controller=require(_0xa552('0x7'));router[_0xa552('0x8')]('/',auth[_0xa552('0x9')](),controller[_0xa552('0xa')]);router[_0xa552('0x8')](_0xa552('0xb'),auth[_0xa552('0x9')](),controller[_0xa552('0xc')]);router[_0xa552('0x8')]('/:id/fields',auth[_0xa552('0x9')](),controller[_0xa552('0xd')]);router[_0xa552('0x8')](_0xa552('0xe'),auth[_0xa552('0x9')](),controller[_0xa552('0xf')]);router[_0xa552('0x8')]('/:id/descriptions',auth[_0xa552('0x9')](),controller[_0xa552('0x10')]);router[_0xa552('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa552('0x12')](_0xa552('0xb'),auth[_0xa552('0x9')](),controller[_0xa552('0x13')]);router['delete'](_0xa552('0xb'),auth[_0xa552('0x9')](),controller[_0xa552('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index f1f87b9..3a4f9fb 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 _0x0dbd=['sequelize','exports','STRING'];(function(_0x40d558,_0x7fe151){var _0x574b85=function(_0x309dbf){while(--_0x309dbf){_0x40d558['push'](_0x40d558['shift']());}};_0x574b85(++_0x7fe151);}(_0x0dbd,0x1b3));var _0xd0db=function(_0x59fffa,_0x5a61db){_0x59fffa=_0x59fffa-0x0;var _0x281d4e=_0x0dbd[_0x59fffa];return _0x281d4e;};'use strict';var Sequelize=require(_0xd0db('0x0'));module[_0xd0db('0x1')]={'name':{'type':Sequelize[_0xd0db('0x2')]},'description':{'type':Sequelize[_0xd0db('0x2')]}}; \ No newline at end of file +var _0xfa5b=['sequelize','STRING'];(function(_0x29d2af,_0x4163a5){var _0x4de08a=function(_0x3fefa9){while(--_0x3fefa9){_0x29d2af['push'](_0x29d2af['shift']());}};_0x4de08a(++_0x4163a5);}(_0xfa5b,0x16a));var _0xbfa5=function(_0x2e04ef,_0x31a596){_0x2e04ef=_0x2e04ef-0x0;var _0x5722b0=_0xfa5b[_0x2e04ef];return _0x5722b0;};'use strict';var Sequelize=require(_0xbfa5('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xbfa5('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 9f8ee0b..490fb95 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 _0xca10=['model','map','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','VIRTUAL','includeAll','include','findAll','rows','show','rawAttributes','find','catch','create','body','getFields','findOne','params','SugarcrmField','length','filter','options','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','end','error','stack','name','send','index','SugarcrmConfiguration','fieldName','type','key'];(function(_0x5c02be,_0x4ced60){var _0x3c7e6b=function(_0x36ca4f){while(--_0x36ca4f){_0x5c02be['push'](_0x5c02be['shift']());}};_0x3c7e6b(++_0x4ced60);}(_0xca10,0xc7));var _0x0ca1=function(_0x4627c9,_0x150589){_0x4627c9=_0x4627c9-0x0;var _0x578942=_0xca10[_0x4627c9];return _0x578942;};'use strict';var emlformat=require(_0x0ca1('0x0'));var rimraf=require(_0x0ca1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0ca1('0x2'));var rp=require('request-promise');var moment=require(_0x0ca1('0x3'));var BPromise=require(_0x0ca1('0x4'));var Mustache=require('mustache');var util=require(_0x0ca1('0x5'));var path=require(_0x0ca1('0x6'));var sox=require(_0x0ca1('0x7'));var csv=require(_0x0ca1('0x8'));var ejs=require(_0x0ca1('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0ca1('0xa'));var squel=require(_0x0ca1('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0ca1('0xc'));var toCsv=require(_0x0ca1('0x8'));var querystring=require(_0x0ca1('0xd'));var Papa=require(_0x0ca1('0xe'));var Redis=require(_0x0ca1('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x0ca1('0x10'));var as=require(_0x0ca1('0x11'));var hardwareService=require(_0x0ca1('0x12'));var logger=require(_0x0ca1('0x13'))(_0x0ca1('0x14'));var utils=require(_0x0ca1('0x15'));var config=require(_0x0ca1('0x16'));var licenseUtil=require(_0x0ca1('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3877c1,_0x3895cc){_0x3895cc=_0x3895cc||0xcc;return function(_0x56c418){if(_0x56c418){return _0x3877c1[_0x0ca1('0x18')](_0x3895cc);}return _0x3877c1[_0x0ca1('0x19')](_0x3895cc)['end']();};}function respondWithResult(_0x1f90e5,_0x3f448d){_0x3f448d=_0x3f448d||0xc8;return function(_0x288937){if(_0x288937){return _0x1f90e5[_0x0ca1('0x19')](_0x3f448d)[_0x0ca1('0x1a')](_0x288937);}};}function respondWithFilteredResult(_0x2e1a78,_0x2aadaf){return function(_0x34d8a9){if(_0x34d8a9){var _0x4f499c=typeof _0x2aadaf[_0x0ca1('0x1b')]===_0x0ca1('0x1c')&&typeof _0x2aadaf[_0x0ca1('0x1d')]===_0x0ca1('0x1c');var _0x3e3e59=_0x34d8a9[_0x0ca1('0x1e')];var _0x45d5b2=_0x4f499c?0x0:_0x2aadaf['offset'];var _0xe24b29=_0x4f499c?_0x34d8a9[_0x0ca1('0x1e')]:_0x2aadaf[_0x0ca1('0x1b')]+_0x2aadaf[_0x0ca1('0x1d')];var _0x2f1cfb;if(_0xe24b29>=_0x3e3e59){_0xe24b29=_0x3e3e59;_0x2f1cfb=0xc8;}else{_0x2f1cfb=0xce;}_0x2e1a78[_0x0ca1('0x19')](_0x2f1cfb);return _0x2e1a78['set'](_0x0ca1('0x1f'),_0x45d5b2+'-'+_0xe24b29+'/'+_0x3e3e59)[_0x0ca1('0x1a')](_0x34d8a9);}return null;};}function patchUpdates(_0x230a74){return function(_0x19c5a7){try{jsonpatch['apply'](_0x19c5a7,_0x230a74,!![]);}catch(_0x30979d){return BPromise[_0x0ca1('0x20')](_0x30979d);}return _0x19c5a7[_0x0ca1('0x21')]();};}function saveUpdates(_0x498ac9,_0x3f6685){return function(_0x4498bd){if(_0x4498bd){return _0x4498bd[_0x0ca1('0x22')](_0x498ac9)[_0x0ca1('0x23')](function(_0x221860){return _0x221860;});}return null;};}function removeEntity(_0x54a82d,_0x241b33){return function(_0x67aec5){if(_0x67aec5){return _0x67aec5[_0x0ca1('0x24')]()[_0x0ca1('0x23')](function(){_0x54a82d[_0x0ca1('0x19')](0xcc)[_0x0ca1('0x25')]();});}};}function handleEntityNotFound(_0x4a06b3,_0x4c7a72){return function(_0x12c621){if(!_0x12c621){_0x4a06b3[_0x0ca1('0x18')](0x194);}return _0x12c621;};}function handleError(_0x27ca98,_0x47c293){_0x47c293=_0x47c293||0x1f4;return function(_0x48916f){logger[_0x0ca1('0x26')](_0x48916f[_0x0ca1('0x27')]);if(_0x48916f[_0x0ca1('0x28')]){delete _0x48916f[_0x0ca1('0x28')];}_0x27ca98[_0x0ca1('0x19')](_0x47c293)[_0x0ca1('0x29')](_0x48916f);};}exports[_0x0ca1('0x2a')]=function(_0x31bdf6,_0xbedc0f){var _0x2a4bd4={},_0xc39a32={},_0x4f26d3={'count':0x0,'rows':[]};var _0x3cd3fb=_['map'](db[_0x0ca1('0x2b')]['rawAttributes'],function(_0x1cc5db){return{'name':_0x1cc5db[_0x0ca1('0x2c')],'type':_0x1cc5db[_0x0ca1('0x2d')][_0x0ca1('0x2e')]};});_0xc39a32[_0x0ca1('0x2f')]=_[_0x0ca1('0x30')](_0x3cd3fb,_0x0ca1('0x28'));_0xc39a32[_0x0ca1('0x31')]=_[_0x0ca1('0x32')](_0x31bdf6[_0x0ca1('0x31')]);_0xc39a32['filters']=_[_0x0ca1('0x33')](_0xc39a32[_0x0ca1('0x2f')],_0xc39a32[_0x0ca1('0x31')]);_0x2a4bd4[_0x0ca1('0x34')]=_['intersection'](_0xc39a32['model'],qs['fields'](_0x31bdf6[_0x0ca1('0x31')][_0x0ca1('0x35')]));_0x2a4bd4[_0x0ca1('0x34')]=_0x2a4bd4[_0x0ca1('0x34')]['length']?_0x2a4bd4['attributes']:_0xc39a32['model'];if(!_0x31bdf6[_0x0ca1('0x31')][_0x0ca1('0x36')](_0x0ca1('0x37'))){_0x2a4bd4[_0x0ca1('0x1d')]=qs[_0x0ca1('0x1d')](_0x31bdf6[_0x0ca1('0x31')][_0x0ca1('0x1d')]);_0x2a4bd4[_0x0ca1('0x1b')]=qs[_0x0ca1('0x1b')](_0x31bdf6[_0x0ca1('0x31')][_0x0ca1('0x1b')]);}_0x2a4bd4[_0x0ca1('0x38')]=qs[_0x0ca1('0x39')](_0x31bdf6['query'][_0x0ca1('0x39')]);_0x2a4bd4[_0x0ca1('0x3a')]=qs['filters'](_[_0x0ca1('0x3b')](_0x31bdf6[_0x0ca1('0x31')],_0xc39a32[_0x0ca1('0x3c')]),_0x3cd3fb);if(_0x31bdf6['query']['filter']){_0x2a4bd4['where']=_[_0x0ca1('0x3d')](_0x2a4bd4[_0x0ca1('0x3a')],{'$or':_['map'](_0x3cd3fb,function(_0x2ec1ad){if(_0x2ec1ad['type']!==_0x0ca1('0x3e')){var _0x1a42dd={};_0x1a42dd[_0x2ec1ad[_0x0ca1('0x28')]]={'$like':'%'+_0x31bdf6['query']['filter']+'%'};return _0x1a42dd;}})});}_0x2a4bd4=_['merge']({},_0x2a4bd4,_0x31bdf6['options']);var _0x18cb33={'where':_0x2a4bd4[_0x0ca1('0x3a')]};return db['SugarcrmConfiguration']['count'](_0x18cb33)[_0x0ca1('0x23')](function(_0xec0b09){_0x4f26d3[_0x0ca1('0x1e')]=_0xec0b09;if(_0x31bdf6['query'][_0x0ca1('0x3f')]){_0x2a4bd4[_0x0ca1('0x40')]=[{'all':!![]}];}return db[_0x0ca1('0x2b')][_0x0ca1('0x41')](_0x2a4bd4);})['then'](function(_0x1eab81){_0x4f26d3[_0x0ca1('0x42')]=_0x1eab81;return _0x4f26d3;})[_0x0ca1('0x23')](respondWithFilteredResult(_0xbedc0f,_0x2a4bd4))['catch'](handleError(_0xbedc0f,null));};exports[_0x0ca1('0x43')]=function(_0xf94d9c,_0x2c389c){var _0x2d829b={'raw':![],'where':{'id':_0xf94d9c['params']['id']}},_0x2d57fd={};_0x2d57fd[_0x0ca1('0x2f')]=_[_0x0ca1('0x32')](db[_0x0ca1('0x2b')][_0x0ca1('0x44')]);_0x2d57fd[_0x0ca1('0x31')]=_[_0x0ca1('0x32')](_0xf94d9c[_0x0ca1('0x31')]);_0x2d57fd['filters']=_['intersection'](_0x2d57fd[_0x0ca1('0x2f')],_0x2d57fd[_0x0ca1('0x31')]);_0x2d829b[_0x0ca1('0x34')]=_[_0x0ca1('0x33')](_0x2d57fd[_0x0ca1('0x2f')],qs[_0x0ca1('0x35')](_0xf94d9c[_0x0ca1('0x31')]['fields']));_0x2d829b[_0x0ca1('0x34')]=_0x2d829b[_0x0ca1('0x34')]['length']?_0x2d829b[_0x0ca1('0x34')]:_0x2d57fd[_0x0ca1('0x2f')];if(_0xf94d9c[_0x0ca1('0x31')][_0x0ca1('0x3f')]){_0x2d829b[_0x0ca1('0x40')]=[{'all':!![]}];}_0x2d829b=_['merge']({},_0x2d829b,_0xf94d9c['options']);return db['SugarcrmConfiguration'][_0x0ca1('0x45')](_0x2d829b)['then'](handleEntityNotFound(_0x2c389c,null))[_0x0ca1('0x23')](respondWithResult(_0x2c389c,null))[_0x0ca1('0x46')](handleError(_0x2c389c,null));};exports[_0x0ca1('0x47')]=function(_0x7a545a,_0x3626c2){return db['SugarcrmConfiguration'][_0x0ca1('0x47')](_0x7a545a[_0x0ca1('0x48')],{})[_0x0ca1('0x23')](respondWithResult(_0x3626c2,0xc9))[_0x0ca1('0x46')](handleError(_0x3626c2,null));};exports[_0x0ca1('0x22')]=function(_0x23c840,_0x113ccf){if(_0x23c840[_0x0ca1('0x48')]['id']){delete _0x23c840[_0x0ca1('0x48')]['id'];}return db[_0x0ca1('0x2b')][_0x0ca1('0x45')]({'where':{'id':_0x23c840['params']['id']}})[_0x0ca1('0x23')](handleEntityNotFound(_0x113ccf,null))[_0x0ca1('0x23')](saveUpdates(_0x23c840[_0x0ca1('0x48')],null))[_0x0ca1('0x23')](respondWithResult(_0x113ccf,null))[_0x0ca1('0x46')](handleError(_0x113ccf,null));};exports[_0x0ca1('0x24')]=function(_0x3e8726,_0x12fb0e){return db[_0x0ca1('0x2b')][_0x0ca1('0x45')]({'where':{'id':_0x3e8726['params']['id']}})['then'](handleEntityNotFound(_0x12fb0e,null))[_0x0ca1('0x23')](removeEntity(_0x12fb0e,null))['catch'](handleError(_0x12fb0e,null));};exports[_0x0ca1('0x49')]=function(_0x38d544,_0x39f153,_0xec7f11){var _0x4c4641={};var _0x26f1a2={};var _0x2eb66f;var _0x3828ca;return db['SugarcrmConfiguration'][_0x0ca1('0x4a')]({'where':{'id':_0x38d544[_0x0ca1('0x4b')]['id']}})[_0x0ca1('0x23')](handleEntityNotFound(_0x39f153,null))[_0x0ca1('0x23')](function(_0x5a8caa){if(_0x5a8caa){_0x2eb66f=_0x5a8caa;_0x26f1a2[_0x0ca1('0x2f')]=_['keys'](db[_0x0ca1('0x4c')][_0x0ca1('0x44')]);_0x26f1a2[_0x0ca1('0x31')]=_[_0x0ca1('0x32')](_0x38d544[_0x0ca1('0x31')]);_0x26f1a2['filters']=_[_0x0ca1('0x33')](_0x26f1a2['model'],_0x26f1a2[_0x0ca1('0x31')]);_0x4c4641[_0x0ca1('0x34')]=_[_0x0ca1('0x33')](_0x26f1a2[_0x0ca1('0x2f')],qs[_0x0ca1('0x35')](_0x38d544[_0x0ca1('0x31')]['fields']));_0x4c4641[_0x0ca1('0x34')]=_0x4c4641[_0x0ca1('0x34')][_0x0ca1('0x4d')]?_0x4c4641[_0x0ca1('0x34')]:_0x26f1a2[_0x0ca1('0x2f')];_0x4c4641[_0x0ca1('0x38')]=qs[_0x0ca1('0x39')](_0x38d544[_0x0ca1('0x31')][_0x0ca1('0x39')]);_0x4c4641['where']=qs[_0x0ca1('0x3c')](_[_0x0ca1('0x3b')](_0x38d544[_0x0ca1('0x31')],_0x26f1a2['filters']));if(_0x38d544[_0x0ca1('0x31')][_0x0ca1('0x4e')]){_0x4c4641[_0x0ca1('0x3a')]=_['merge'](_0x4c4641[_0x0ca1('0x3a')],{'$or':_[_0x0ca1('0x30')](_0x4c4641[_0x0ca1('0x34')],function(_0x3485c9){var _0x2e23b3={};_0x2e23b3[_0x3485c9]={'$like':'%'+_0x38d544['query'][_0x0ca1('0x4e')]+'%'};return _0x2e23b3;})});}_0x4c4641=_[_0x0ca1('0x3d')]({},_0x4c4641,_0x38d544[_0x0ca1('0x4f')]);return _0x2eb66f['getFields'](_0x4c4641);}})[_0x0ca1('0x23')](function(_0x386ff7){if(_0x386ff7){_0x3828ca=_0x386ff7[_0x0ca1('0x4d')];if(!_0x38d544[_0x0ca1('0x31')][_0x0ca1('0x36')](_0x0ca1('0x37'))){_0x4c4641[_0x0ca1('0x1d')]=qs['limit'](_0x38d544[_0x0ca1('0x31')][_0x0ca1('0x1d')]);_0x4c4641[_0x0ca1('0x1b')]=qs['offset'](_0x38d544[_0x0ca1('0x31')][_0x0ca1('0x1b')]);}return _0x2eb66f[_0x0ca1('0x49')](_0x4c4641);}})['then'](function(_0x4ef71c){if(_0x4ef71c){return _0x4ef71c?{'count':_0x3828ca,'rows':_0x4ef71c}:null;}})['then'](respondWithResult(_0x39f153,null))[_0x0ca1('0x46')](handleError(_0x39f153,null));};exports[_0x0ca1('0x50')]=function(_0x3a7a14,_0x3a6ee9,_0x23970c){var _0x1b7f8a={};var _0x25ebfc={};var _0x3d061d;var _0x1e9a61;return db[_0x0ca1('0x2b')]['findOne']({'where':{'id':_0x3a7a14[_0x0ca1('0x4b')]['id']}})[_0x0ca1('0x23')](handleEntityNotFound(_0x3a6ee9,null))['then'](function(_0x10a36d){if(_0x10a36d){_0x3d061d=_0x10a36d;_0x25ebfc[_0x0ca1('0x2f')]=_[_0x0ca1('0x32')](db['SugarcrmField'][_0x0ca1('0x44')]);_0x25ebfc[_0x0ca1('0x31')]=_[_0x0ca1('0x32')](_0x3a7a14[_0x0ca1('0x31')]);_0x25ebfc[_0x0ca1('0x3c')]=_[_0x0ca1('0x33')](_0x25ebfc['model'],_0x25ebfc['query']);_0x1b7f8a[_0x0ca1('0x34')]=_['intersection'](_0x25ebfc[_0x0ca1('0x2f')],qs[_0x0ca1('0x35')](_0x3a7a14[_0x0ca1('0x31')]['fields']));_0x1b7f8a[_0x0ca1('0x34')]=_0x1b7f8a['attributes'][_0x0ca1('0x4d')]?_0x1b7f8a[_0x0ca1('0x34')]:_0x25ebfc[_0x0ca1('0x2f')];_0x1b7f8a['order']=qs[_0x0ca1('0x39')](_0x3a7a14['query'][_0x0ca1('0x39')]);_0x1b7f8a[_0x0ca1('0x3a')]=qs[_0x0ca1('0x3c')](_[_0x0ca1('0x3b')](_0x3a7a14[_0x0ca1('0x31')],_0x25ebfc[_0x0ca1('0x3c')]));if(_0x3a7a14['query'][_0x0ca1('0x4e')]){_0x1b7f8a[_0x0ca1('0x3a')]=_['merge'](_0x1b7f8a[_0x0ca1('0x3a')],{'$or':_[_0x0ca1('0x30')](_0x1b7f8a[_0x0ca1('0x34')],function(_0x54b089){var _0x5424a8={};_0x5424a8[_0x54b089]={'$like':'%'+_0x3a7a14[_0x0ca1('0x31')][_0x0ca1('0x4e')]+'%'};return _0x5424a8;})});}_0x1b7f8a=_[_0x0ca1('0x3d')]({},_0x1b7f8a,_0x3a7a14['options']);return _0x3d061d[_0x0ca1('0x50')](_0x1b7f8a);}})[_0x0ca1('0x23')](function(_0x261a0b){if(_0x261a0b){_0x1e9a61=_0x261a0b[_0x0ca1('0x4d')];if(!_0x3a7a14[_0x0ca1('0x31')][_0x0ca1('0x36')](_0x0ca1('0x37'))){_0x1b7f8a[_0x0ca1('0x1d')]=qs[_0x0ca1('0x1d')](_0x3a7a14['query'][_0x0ca1('0x1d')]);_0x1b7f8a['offset']=qs[_0x0ca1('0x1b')](_0x3a7a14[_0x0ca1('0x31')][_0x0ca1('0x1b')]);}return _0x3d061d[_0x0ca1('0x50')](_0x1b7f8a);}})[_0x0ca1('0x23')](function(_0xf0d79e){if(_0xf0d79e){return _0xf0d79e?{'count':_0x1e9a61,'rows':_0xf0d79e}:null;}})[_0x0ca1('0x23')](respondWithResult(_0x3a6ee9,null))[_0x0ca1('0x46')](handleError(_0x3a6ee9,null));};exports[_0x0ca1('0x51')]=function(_0x24597b,_0xdcb4d9,_0x3f5851){var _0x3770ae={};var _0x287f45={};var _0x4e31c8;var _0x758393;return db[_0x0ca1('0x2b')][_0x0ca1('0x4a')]({'where':{'id':_0x24597b[_0x0ca1('0x4b')]['id']}})[_0x0ca1('0x23')](handleEntityNotFound(_0xdcb4d9,null))[_0x0ca1('0x23')](function(_0x37afba){if(_0x37afba){_0x4e31c8=_0x37afba;_0x287f45[_0x0ca1('0x2f')]=_[_0x0ca1('0x32')](db[_0x0ca1('0x4c')]['rawAttributes']);_0x287f45[_0x0ca1('0x31')]=_[_0x0ca1('0x32')](_0x24597b[_0x0ca1('0x31')]);_0x287f45[_0x0ca1('0x3c')]=_[_0x0ca1('0x33')](_0x287f45['model'],_0x287f45[_0x0ca1('0x31')]);_0x3770ae[_0x0ca1('0x34')]=_[_0x0ca1('0x33')](_0x287f45['model'],qs[_0x0ca1('0x35')](_0x24597b[_0x0ca1('0x31')]['fields']));_0x3770ae['attributes']=_0x3770ae['attributes'][_0x0ca1('0x4d')]?_0x3770ae['attributes']:_0x287f45[_0x0ca1('0x2f')];_0x3770ae[_0x0ca1('0x38')]=qs[_0x0ca1('0x39')](_0x24597b[_0x0ca1('0x31')][_0x0ca1('0x39')]);_0x3770ae[_0x0ca1('0x3a')]=qs[_0x0ca1('0x3c')](_[_0x0ca1('0x3b')](_0x24597b[_0x0ca1('0x31')],_0x287f45[_0x0ca1('0x3c')]));if(_0x24597b['query'][_0x0ca1('0x4e')]){_0x3770ae[_0x0ca1('0x3a')]=_['merge'](_0x3770ae[_0x0ca1('0x3a')],{'$or':_['map'](_0x3770ae[_0x0ca1('0x34')],function(_0x385d57){var _0x2a0a33={};_0x2a0a33[_0x385d57]={'$like':'%'+_0x24597b[_0x0ca1('0x31')][_0x0ca1('0x4e')]+'%'};return _0x2a0a33;})});}_0x3770ae=_[_0x0ca1('0x3d')]({},_0x3770ae,_0x24597b['options']);return _0x4e31c8[_0x0ca1('0x51')](_0x3770ae);}})['then'](function(_0xe5e2be){if(_0xe5e2be){_0x758393=_0xe5e2be[_0x0ca1('0x4d')];if(!_0x24597b[_0x0ca1('0x31')]['hasOwnProperty'](_0x0ca1('0x37'))){_0x3770ae[_0x0ca1('0x1d')]=qs[_0x0ca1('0x1d')](_0x24597b[_0x0ca1('0x31')][_0x0ca1('0x1d')]);_0x3770ae[_0x0ca1('0x1b')]=qs[_0x0ca1('0x1b')](_0x24597b[_0x0ca1('0x31')][_0x0ca1('0x1b')]);}return _0x4e31c8[_0x0ca1('0x51')](_0x3770ae);}})[_0x0ca1('0x23')](function(_0x10bd03){if(_0x10bd03){return _0x10bd03?{'count':_0x758393,'rows':_0x10bd03}:null;}})[_0x0ca1('0x23')](respondWithResult(_0xdcb4d9,null))[_0x0ca1('0x46')](handleError(_0xdcb4d9,null));}; \ No newline at end of file +var _0x3765=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','error','stack','name','send','index','rawAttributes','fieldName','key','model','map','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','options','SugarcrmConfiguration','includeAll','include','show','params','keys','length','merge','find','create','body','catch','update','destroy','getFields','SugarcrmField','getSubjects','findOne','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3765,0x1e5));var _0x5376=function(_0x3ebe06,_0x25a180){_0x3ebe06=_0x3ebe06-0x0;var _0xa9cdd2=_0x3765[_0x3ebe06];return _0xa9cdd2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5376('0x0'));var zipdir=require(_0x5376('0x1'));var jsonpatch=require(_0x5376('0x2'));var rp=require(_0x5376('0x3'));var moment=require('moment');var BPromise=require(_0x5376('0x4'));var Mustache=require(_0x5376('0x5'));var util=require(_0x5376('0x6'));var path=require('path');var sox=require(_0x5376('0x7'));var csv=require('to-csv');var ejs=require(_0x5376('0x8'));var fs=require('fs');var fs_extra=require(_0x5376('0x9'));var _=require(_0x5376('0xa'));var squel=require(_0x5376('0xb'));var crypto=require(_0x5376('0xc'));var jsforce=require(_0x5376('0xd'));var deskjs=require(_0x5376('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5376('0xf'));var Papa=require('papaparse');var Redis=require(_0x5376('0x10'));var authService=require(_0x5376('0x11'));var qs=require(_0x5376('0x12'));var as=require(_0x5376('0x13'));var hardwareService=require(_0x5376('0x14'));var logger=require(_0x5376('0x15'))(_0x5376('0x16'));var utils=require(_0x5376('0x17'));var config=require(_0x5376('0x18'));var licenseUtil=require(_0x5376('0x19'));var db=require(_0x5376('0x1a'))['db'];function respondWithStatusCode(_0x558c8d,_0x5bcb7b){_0x5bcb7b=_0x5bcb7b||0xcc;return function(_0x2f0858){if(_0x2f0858){return _0x558c8d[_0x5376('0x1b')](_0x5bcb7b);}return _0x558c8d[_0x5376('0x1c')](_0x5bcb7b)[_0x5376('0x1d')]();};}function respondWithResult(_0x3ea3e3,_0x55c930){_0x55c930=_0x55c930||0xc8;return function(_0x5abee4){if(_0x5abee4){return _0x3ea3e3[_0x5376('0x1c')](_0x55c930)[_0x5376('0x1e')](_0x5abee4);}};}function respondWithFilteredResult(_0x1f828e,_0xf3de7b){return function(_0x1a300e){if(_0x1a300e){var _0x5c65ca=typeof _0xf3de7b[_0x5376('0x1f')]===_0x5376('0x20')&&typeof _0xf3de7b[_0x5376('0x21')]===_0x5376('0x20');var _0x5f40f9=_0x1a300e['count'];var _0x4ae8f1=_0x5c65ca?0x0:_0xf3de7b['offset'];var _0x530d92=_0x5c65ca?_0x1a300e[_0x5376('0x22')]:_0xf3de7b[_0x5376('0x1f')]+_0xf3de7b['limit'];var _0x534b5f;if(_0x530d92>=_0x5f40f9){_0x530d92=_0x5f40f9;_0x534b5f=0xc8;}else{_0x534b5f=0xce;}_0x1f828e[_0x5376('0x1c')](_0x534b5f);return _0x1f828e[_0x5376('0x23')](_0x5376('0x24'),_0x4ae8f1+'-'+_0x530d92+'/'+_0x5f40f9)['json'](_0x1a300e);}return null;};}function patchUpdates(_0x23478e){return function(_0x46a997){try{jsonpatch[_0x5376('0x25')](_0x46a997,_0x23478e,!![]);}catch(_0x144ae0){return BPromise[_0x5376('0x26')](_0x144ae0);}return _0x46a997[_0x5376('0x27')]();};}function saveUpdates(_0x15da48,_0x19db58){return function(_0x1d6f42){if(_0x1d6f42){return _0x1d6f42['update'](_0x15da48)[_0x5376('0x28')](function(_0x347cd8){return _0x347cd8;});}return null;};}function removeEntity(_0x5db950,_0xdb2732){return function(_0x356214){if(_0x356214){return _0x356214['destroy']()[_0x5376('0x28')](function(){_0x5db950['status'](0xcc)[_0x5376('0x1d')]();});}};}function handleEntityNotFound(_0xfa5339,_0x2c18b1){return function(_0x440905){if(!_0x440905){_0xfa5339[_0x5376('0x1b')](0x194);}return _0x440905;};}function handleError(_0x247f1a,_0xf6a7a){_0xf6a7a=_0xf6a7a||0x1f4;return function(_0x4e3a6e){logger[_0x5376('0x29')](_0x4e3a6e[_0x5376('0x2a')]);if(_0x4e3a6e[_0x5376('0x2b')]){delete _0x4e3a6e[_0x5376('0x2b')];}_0x247f1a[_0x5376('0x1c')](_0xf6a7a)[_0x5376('0x2c')](_0x4e3a6e);};}exports[_0x5376('0x2d')]=function(_0x5acb15,_0x65c529){var _0x4f3d1c={},_0x18595e={},_0x4e482a={'count':0x0,'rows':[]};var _0x587819=_['map'](db['SugarcrmConfiguration'][_0x5376('0x2e')],function(_0x1e0760){return{'name':_0x1e0760[_0x5376('0x2f')],'type':_0x1e0760['type'][_0x5376('0x30')]};});_0x18595e[_0x5376('0x31')]=_[_0x5376('0x32')](_0x587819,_0x5376('0x2b'));_0x18595e[_0x5376('0x33')]=_['keys'](_0x5acb15[_0x5376('0x33')]);_0x18595e[_0x5376('0x34')]=_[_0x5376('0x35')](_0x18595e[_0x5376('0x31')],_0x18595e['query']);_0x4f3d1c['attributes']=_['intersection'](_0x18595e[_0x5376('0x31')],qs[_0x5376('0x36')](_0x5acb15[_0x5376('0x33')][_0x5376('0x36')]));_0x4f3d1c[_0x5376('0x37')]=_0x4f3d1c[_0x5376('0x37')]['length']?_0x4f3d1c[_0x5376('0x37')]:_0x18595e[_0x5376('0x31')];if(!_0x5acb15['query'][_0x5376('0x38')](_0x5376('0x39'))){_0x4f3d1c[_0x5376('0x21')]=qs[_0x5376('0x21')](_0x5acb15[_0x5376('0x33')]['limit']);_0x4f3d1c['offset']=qs[_0x5376('0x1f')](_0x5acb15[_0x5376('0x33')][_0x5376('0x1f')]);}_0x4f3d1c[_0x5376('0x3a')]=qs[_0x5376('0x3b')](_0x5acb15[_0x5376('0x33')][_0x5376('0x3b')]);_0x4f3d1c['where']=qs['filters'](_[_0x5376('0x3c')](_0x5acb15[_0x5376('0x33')],_0x18595e[_0x5376('0x34')]),_0x587819);if(_0x5acb15[_0x5376('0x33')][_0x5376('0x3d')]){_0x4f3d1c[_0x5376('0x3e')]=_['merge'](_0x4f3d1c['where'],{'$or':_[_0x5376('0x32')](_0x587819,function(_0xb74550){if(_0xb74550['type']!==_0x5376('0x3f')){var _0x4b3878={};_0x4b3878[_0xb74550[_0x5376('0x2b')]]={'$like':'%'+_0x5acb15[_0x5376('0x33')][_0x5376('0x3d')]+'%'};return _0x4b3878;}})});}_0x4f3d1c=_['merge']({},_0x4f3d1c,_0x5acb15[_0x5376('0x40')]);var _0x2bd776={'where':_0x4f3d1c[_0x5376('0x3e')]};return db[_0x5376('0x41')]['count'](_0x2bd776)[_0x5376('0x28')](function(_0x586d0a){_0x4e482a[_0x5376('0x22')]=_0x586d0a;if(_0x5acb15[_0x5376('0x33')][_0x5376('0x42')]){_0x4f3d1c[_0x5376('0x43')]=[{'all':!![]}];}return db[_0x5376('0x41')]['findAll'](_0x4f3d1c);})['then'](function(_0x4a2553){_0x4e482a['rows']=_0x4a2553;return _0x4e482a;})[_0x5376('0x28')](respondWithFilteredResult(_0x65c529,_0x4f3d1c))['catch'](handleError(_0x65c529,null));};exports[_0x5376('0x44')]=function(_0x16429a,_0x4bbd70){var _0x16bd2c={'raw':![],'where':{'id':_0x16429a[_0x5376('0x45')]['id']}},_0x4df0a7={};_0x4df0a7[_0x5376('0x31')]=_[_0x5376('0x46')](db[_0x5376('0x41')][_0x5376('0x2e')]);_0x4df0a7[_0x5376('0x33')]=_['keys'](_0x16429a[_0x5376('0x33')]);_0x4df0a7[_0x5376('0x34')]=_[_0x5376('0x35')](_0x4df0a7[_0x5376('0x31')],_0x4df0a7[_0x5376('0x33')]);_0x16bd2c[_0x5376('0x37')]=_['intersection'](_0x4df0a7[_0x5376('0x31')],qs[_0x5376('0x36')](_0x16429a[_0x5376('0x33')]['fields']));_0x16bd2c[_0x5376('0x37')]=_0x16bd2c[_0x5376('0x37')][_0x5376('0x47')]?_0x16bd2c['attributes']:_0x4df0a7[_0x5376('0x31')];if(_0x16429a[_0x5376('0x33')][_0x5376('0x42')]){_0x16bd2c[_0x5376('0x43')]=[{'all':!![]}];}_0x16bd2c=_[_0x5376('0x48')]({},_0x16bd2c,_0x16429a[_0x5376('0x40')]);return db[_0x5376('0x41')][_0x5376('0x49')](_0x16bd2c)['then'](handleEntityNotFound(_0x4bbd70,null))['then'](respondWithResult(_0x4bbd70,null))['catch'](handleError(_0x4bbd70,null));};exports[_0x5376('0x4a')]=function(_0x5b3222,_0xbbdbc5){return db[_0x5376('0x41')][_0x5376('0x4a')](_0x5b3222[_0x5376('0x4b')],{})['then'](respondWithResult(_0xbbdbc5,0xc9))[_0x5376('0x4c')](handleError(_0xbbdbc5,null));};exports[_0x5376('0x4d')]=function(_0x209a7f,_0x1b99e4){if(_0x209a7f[_0x5376('0x4b')]['id']){delete _0x209a7f[_0x5376('0x4b')]['id'];}return db[_0x5376('0x41')]['find']({'where':{'id':_0x209a7f[_0x5376('0x45')]['id']}})[_0x5376('0x28')](handleEntityNotFound(_0x1b99e4,null))['then'](saveUpdates(_0x209a7f[_0x5376('0x4b')],null))['then'](respondWithResult(_0x1b99e4,null))[_0x5376('0x4c')](handleError(_0x1b99e4,null));};exports[_0x5376('0x4e')]=function(_0x305e0b,_0x1db561){return db[_0x5376('0x41')]['find']({'where':{'id':_0x305e0b[_0x5376('0x45')]['id']}})[_0x5376('0x28')](handleEntityNotFound(_0x1db561,null))[_0x5376('0x28')](removeEntity(_0x1db561,null))[_0x5376('0x4c')](handleError(_0x1db561,null));};exports[_0x5376('0x4f')]=function(_0x514775,_0x43635b,_0x150742){var _0x190eea={};var _0x144fe7={};var _0x56ebd0;var _0x135781;return db[_0x5376('0x41')]['findOne']({'where':{'id':_0x514775[_0x5376('0x45')]['id']}})[_0x5376('0x28')](handleEntityNotFound(_0x43635b,null))[_0x5376('0x28')](function(_0x210ea9){if(_0x210ea9){_0x56ebd0=_0x210ea9;_0x144fe7[_0x5376('0x31')]=_[_0x5376('0x46')](db[_0x5376('0x50')][_0x5376('0x2e')]);_0x144fe7[_0x5376('0x33')]=_[_0x5376('0x46')](_0x514775['query']);_0x144fe7[_0x5376('0x34')]=_[_0x5376('0x35')](_0x144fe7['model'],_0x144fe7[_0x5376('0x33')]);_0x190eea[_0x5376('0x37')]=_[_0x5376('0x35')](_0x144fe7[_0x5376('0x31')],qs['fields'](_0x514775[_0x5376('0x33')][_0x5376('0x36')]));_0x190eea[_0x5376('0x37')]=_0x190eea['attributes'][_0x5376('0x47')]?_0x190eea[_0x5376('0x37')]:_0x144fe7['model'];_0x190eea[_0x5376('0x3a')]=qs[_0x5376('0x3b')](_0x514775[_0x5376('0x33')][_0x5376('0x3b')]);_0x190eea['where']=qs[_0x5376('0x34')](_['pick'](_0x514775['query'],_0x144fe7[_0x5376('0x34')]));if(_0x514775[_0x5376('0x33')][_0x5376('0x3d')]){_0x190eea[_0x5376('0x3e')]=_[_0x5376('0x48')](_0x190eea[_0x5376('0x3e')],{'$or':_[_0x5376('0x32')](_0x190eea[_0x5376('0x37')],function(_0x10fc98){var _0x2da181={};_0x2da181[_0x10fc98]={'$like':'%'+_0x514775[_0x5376('0x33')]['filter']+'%'};return _0x2da181;})});}_0x190eea=_[_0x5376('0x48')]({},_0x190eea,_0x514775[_0x5376('0x40')]);return _0x56ebd0[_0x5376('0x4f')](_0x190eea);}})[_0x5376('0x28')](function(_0x5e9d62){if(_0x5e9d62){_0x135781=_0x5e9d62[_0x5376('0x47')];if(!_0x514775[_0x5376('0x33')][_0x5376('0x38')](_0x5376('0x39'))){_0x190eea[_0x5376('0x21')]=qs[_0x5376('0x21')](_0x514775[_0x5376('0x33')][_0x5376('0x21')]);_0x190eea['offset']=qs['offset'](_0x514775[_0x5376('0x33')][_0x5376('0x1f')]);}return _0x56ebd0[_0x5376('0x4f')](_0x190eea);}})[_0x5376('0x28')](function(_0x15b21a){if(_0x15b21a){return _0x15b21a?{'count':_0x135781,'rows':_0x15b21a}:null;}})[_0x5376('0x28')](respondWithResult(_0x43635b,null))['catch'](handleError(_0x43635b,null));};exports[_0x5376('0x51')]=function(_0x560e9f,_0x4b1b69,_0x422046){var _0x2bd880={};var _0x2c7b50={};var _0x1f5a1f;var _0x3014d4;return db[_0x5376('0x41')]['findOne']({'where':{'id':_0x560e9f[_0x5376('0x45')]['id']}})[_0x5376('0x28')](handleEntityNotFound(_0x4b1b69,null))[_0x5376('0x28')](function(_0x480beb){if(_0x480beb){_0x1f5a1f=_0x480beb;_0x2c7b50[_0x5376('0x31')]=_[_0x5376('0x46')](db['SugarcrmField']['rawAttributes']);_0x2c7b50[_0x5376('0x33')]=_['keys'](_0x560e9f[_0x5376('0x33')]);_0x2c7b50[_0x5376('0x34')]=_[_0x5376('0x35')](_0x2c7b50['model'],_0x2c7b50[_0x5376('0x33')]);_0x2bd880[_0x5376('0x37')]=_[_0x5376('0x35')](_0x2c7b50['model'],qs[_0x5376('0x36')](_0x560e9f[_0x5376('0x33')]['fields']));_0x2bd880[_0x5376('0x37')]=_0x2bd880[_0x5376('0x37')][_0x5376('0x47')]?_0x2bd880['attributes']:_0x2c7b50[_0x5376('0x31')];_0x2bd880[_0x5376('0x3a')]=qs['sort'](_0x560e9f[_0x5376('0x33')][_0x5376('0x3b')]);_0x2bd880[_0x5376('0x3e')]=qs[_0x5376('0x34')](_[_0x5376('0x3c')](_0x560e9f[_0x5376('0x33')],_0x2c7b50[_0x5376('0x34')]));if(_0x560e9f[_0x5376('0x33')][_0x5376('0x3d')]){_0x2bd880[_0x5376('0x3e')]=_[_0x5376('0x48')](_0x2bd880['where'],{'$or':_['map'](_0x2bd880[_0x5376('0x37')],function(_0x498681){var _0x32ea18={};_0x32ea18[_0x498681]={'$like':'%'+_0x560e9f[_0x5376('0x33')][_0x5376('0x3d')]+'%'};return _0x32ea18;})});}_0x2bd880=_[_0x5376('0x48')]({},_0x2bd880,_0x560e9f['options']);return _0x1f5a1f[_0x5376('0x51')](_0x2bd880);}})[_0x5376('0x28')](function(_0x1e1704){if(_0x1e1704){_0x3014d4=_0x1e1704['length'];if(!_0x560e9f[_0x5376('0x33')][_0x5376('0x38')](_0x5376('0x39'))){_0x2bd880[_0x5376('0x21')]=qs[_0x5376('0x21')](_0x560e9f['query'][_0x5376('0x21')]);_0x2bd880[_0x5376('0x1f')]=qs[_0x5376('0x1f')](_0x560e9f[_0x5376('0x33')][_0x5376('0x1f')]);}return _0x1f5a1f[_0x5376('0x51')](_0x2bd880);}})[_0x5376('0x28')](function(_0x12ce3d){if(_0x12ce3d){return _0x12ce3d?{'count':_0x3014d4,'rows':_0x12ce3d}:null;}})['then'](respondWithResult(_0x4b1b69,null))[_0x5376('0x4c')](handleError(_0x4b1b69,null));};exports['getDescriptions']=function(_0x7d04a6,_0x3e2118,_0x22167c){var _0x3f20b3={};var _0xe7232b={};var _0x3279fe;var _0x2e7369;return db[_0x5376('0x41')][_0x5376('0x52')]({'where':{'id':_0x7d04a6[_0x5376('0x45')]['id']}})[_0x5376('0x28')](handleEntityNotFound(_0x3e2118,null))[_0x5376('0x28')](function(_0x72cdc7){if(_0x72cdc7){_0x3279fe=_0x72cdc7;_0xe7232b[_0x5376('0x31')]=_[_0x5376('0x46')](db[_0x5376('0x50')][_0x5376('0x2e')]);_0xe7232b[_0x5376('0x33')]=_['keys'](_0x7d04a6[_0x5376('0x33')]);_0xe7232b[_0x5376('0x34')]=_[_0x5376('0x35')](_0xe7232b[_0x5376('0x31')],_0xe7232b['query']);_0x3f20b3[_0x5376('0x37')]=_[_0x5376('0x35')](_0xe7232b['model'],qs[_0x5376('0x36')](_0x7d04a6[_0x5376('0x33')][_0x5376('0x36')]));_0x3f20b3['attributes']=_0x3f20b3[_0x5376('0x37')][_0x5376('0x47')]?_0x3f20b3[_0x5376('0x37')]:_0xe7232b[_0x5376('0x31')];_0x3f20b3[_0x5376('0x3a')]=qs['sort'](_0x7d04a6['query'][_0x5376('0x3b')]);_0x3f20b3[_0x5376('0x3e')]=qs[_0x5376('0x34')](_['pick'](_0x7d04a6[_0x5376('0x33')],_0xe7232b[_0x5376('0x34')]));if(_0x7d04a6[_0x5376('0x33')]['filter']){_0x3f20b3[_0x5376('0x3e')]=_['merge'](_0x3f20b3[_0x5376('0x3e')],{'$or':_[_0x5376('0x32')](_0x3f20b3[_0x5376('0x37')],function(_0x3bc965){var _0x326693={};_0x326693[_0x3bc965]={'$like':'%'+_0x7d04a6[_0x5376('0x33')][_0x5376('0x3d')]+'%'};return _0x326693;})});}_0x3f20b3=_[_0x5376('0x48')]({},_0x3f20b3,_0x7d04a6[_0x5376('0x40')]);return _0x3279fe[_0x5376('0x53')](_0x3f20b3);}})['then'](function(_0x5a847f){if(_0x5a847f){_0x2e7369=_0x5a847f['length'];if(!_0x7d04a6[_0x5376('0x33')][_0x5376('0x38')](_0x5376('0x39'))){_0x3f20b3['limit']=qs[_0x5376('0x21')](_0x7d04a6[_0x5376('0x33')][_0x5376('0x21')]);_0x3f20b3[_0x5376('0x1f')]=qs[_0x5376('0x1f')](_0x7d04a6[_0x5376('0x33')][_0x5376('0x1f')]);}return _0x3279fe[_0x5376('0x53')](_0x3f20b3);}})[_0x5376('0x28')](function(_0x5779db){if(_0x5779db){return _0x5779db?{'count':_0x2e7369,'rows':_0x5779db}:null;}})['then'](respondWithResult(_0x3e2118,null))[_0x5376('0x4c')](handleError(_0x3e2118,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index b3b104f..17c2a3e 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 _0xdded=['./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3e278e,_0xf71e81){var _0x5c2a5c=function(_0x3c1b09){while(--_0x3c1b09){_0x3e278e['push'](_0x3e278e['shift']());}};_0x5c2a5c(++_0xf71e81);}(_0xdded,0x115));var _0xddde=function(_0x2b8971,_0x581f63){_0x2b8971=_0x2b8971-0x0;var _0x1aaddc=_0xdded[_0x2b8971];return _0x1aaddc;};'use strict';var _=require(_0xddde('0x0'));var util=require(_0xddde('0x1'));var logger=require(_0xddde('0x2'))('api');var moment=require(_0xddde('0x3'));var BPromise=require(_0xddde('0x4'));var rp=require(_0xddde('0x5'));var fs=require('fs');var path=require(_0xddde('0x6'));var rimraf=require(_0xddde('0x7'));var config=require(_0xddde('0x8'));var attributes=require(_0xddde('0x9'));module[_0xddde('0xa')]=function(_0x5b9a7c,_0x47197d){return _0x5b9a7c[_0xddde('0xb')](_0xddde('0xc'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd71f=['util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','define','int_sugarcrm_configurations','lodash'];(function(_0x2c7dc6,_0x3c4ce0){var _0x10002b=function(_0x26f390){while(--_0x26f390){_0x2c7dc6['push'](_0x2c7dc6['shift']());}};_0x10002b(++_0x3c4ce0);}(_0xd71f,0x1b7));var _0xfd71=function(_0x2301eb,_0x2e248f){_0x2301eb=_0x2301eb-0x0;var _0x144052=_0xd71f[_0x2301eb];return _0x144052;};'use strict';var _=require(_0xfd71('0x0'));var util=require(_0xfd71('0x1'));var logger=require(_0xfd71('0x2'))('api');var moment=require(_0xfd71('0x3'));var BPromise=require(_0xfd71('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfd71('0x5'));var rimraf=require(_0xfd71('0x6'));var config=require(_0xfd71('0x7'));var attributes=require(_0xfd71('0x8'));module['exports']=function(_0x3cc9b0,_0x178893){return _0x3cc9b0[_0xfd71('0x9')]('SugarcrmConfiguration',attributes,{'tableName':_0xfd71('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 f5b95d6..b55a040 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 _0xb7ca=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x486f4a,_0x478dc7){var _0x135d99=function(_0x434008){while(--_0x434008){_0x486f4a['push'](_0x486f4a['shift']());}};_0x135d99(++_0x478dc7);}(_0xb7ca,0x10b));var _0xab7c=function(_0x2ba636,_0x5c8b08){_0x2ba636=_0x2ba636-0x0;var _0x251c5c=_0xb7ca[_0x2ba636];return _0x251c5c;};'use strict';var _=require(_0xab7c('0x0'));var util=require(_0xab7c('0x1'));var moment=require(_0xab7c('0x2'));var BPromise=require(_0xab7c('0x3'));var rs=require(_0xab7c('0x4'));var fs=require('fs');var Redis=require(_0xab7c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xab7c('0x6'));var logger=require(_0xab7c('0x7'))(_0xab7c('0x8'));var config=require('../../config/environment');var jayson=require(_0xab7c('0x9'));var client=jayson[_0xab7c('0xa')][_0xab7c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4c8eec,_0x4d6eb8,_0x3e548c){return new BPromise(function(_0x5e95f6,_0x6ea782){return client[_0xab7c('0xc')](_0x4c8eec,_0x3e548c)[_0xab7c('0xd')](function(_0x1d81d9){logger[_0xab7c('0xe')](_0xab7c('0xf'),_0x4d6eb8,_0xab7c('0x10'));logger[_0xab7c('0x11')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x4d6eb8,_0xab7c('0x10'),JSON[_0xab7c('0x12')](_0x1d81d9));if(_0x1d81d9[_0xab7c('0x13')]){if(_0x1d81d9[_0xab7c('0x13')][_0xab7c('0x14')]===0x1f4){logger[_0xab7c('0x13')](_0xab7c('0xf'),_0x4d6eb8,_0x1d81d9[_0xab7c('0x13')]['message']);return _0x6ea782(_0x1d81d9[_0xab7c('0x13')][_0xab7c('0x15')]);}logger[_0xab7c('0x13')](_0xab7c('0xf'),_0x4d6eb8,_0x1d81d9['error'][_0xab7c('0x15')]);return _0x5e95f6(_0x1d81d9[_0xab7c('0x13')][_0xab7c('0x15')]);}else{logger['info'](_0xab7c('0xf'),_0x4d6eb8,_0xab7c('0x10'));_0x5e95f6(_0x1d81d9[_0xab7c('0x16')][_0xab7c('0x15')]);}})[_0xab7c('0x17')](function(_0x28a6af){logger[_0xab7c('0x13')](_0xab7c('0xf'),_0x4d6eb8,_0x28a6af);_0x6ea782(_0x28a6af);});});} \ No newline at end of file +var _0xc8a5=['debug','stringify','error','code','message','result','catch','lodash','util','moment','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x270860,_0x3adaa0){var _0x4f74e4=function(_0x3d96b2){while(--_0x3d96b2){_0x270860['push'](_0x270860['shift']());}};_0x4f74e4(++_0x3adaa0);}(_0xc8a5,0x1bf));var _0x5c8a=function(_0x5c4e24,_0x511057){_0x5c4e24=_0x5c4e24-0x0;var _0x2537e7=_0xc8a5[_0x5c4e24];return _0x2537e7;};'use strict';var _=require(_0x5c8a('0x0'));var util=require(_0x5c8a('0x1'));var moment=require(_0x5c8a('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('../../config/utils');var logger=require(_0x5c8a('0x3'))(_0x5c8a('0x4'));var config=require(_0x5c8a('0x5'));var jayson=require(_0x5c8a('0x6'));var client=jayson[_0x5c8a('0x7')][_0x5c8a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x29aa7d,_0xab1499,_0x12588a){return new BPromise(function(_0x214bdd,_0x2c62d2){return client['request'](_0x29aa7d,_0x12588a)[_0x5c8a('0x9')](function(_0xf3f965){logger[_0x5c8a('0xa')](_0x5c8a('0xb'),_0xab1499,_0x5c8a('0xc'));logger[_0x5c8a('0xd')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0xab1499,_0x5c8a('0xc'),JSON[_0x5c8a('0xe')](_0xf3f965));if(_0xf3f965['error']){if(_0xf3f965[_0x5c8a('0xf')][_0x5c8a('0x10')]===0x1f4){logger[_0x5c8a('0xf')](_0x5c8a('0xb'),_0xab1499,_0xf3f965['error']['message']);return _0x2c62d2(_0xf3f965[_0x5c8a('0xf')][_0x5c8a('0x11')]);}logger[_0x5c8a('0xf')](_0x5c8a('0xb'),_0xab1499,_0xf3f965[_0x5c8a('0xf')][_0x5c8a('0x11')]);return _0x214bdd(_0xf3f965['error'][_0x5c8a('0x11')]);}else{logger[_0x5c8a('0xa')]('SugarcrmConfiguration,\x20%s,\x20%s',_0xab1499,'request\x20sent');_0x214bdd(_0xf3f965[_0x5c8a('0x12')][_0x5c8a('0x11')]);}})[_0x5c8a('0x13')](function(_0x2771de){logger[_0x5c8a('0xf')](_0x5c8a('0xb'),_0xab1499,_0x2771de);_0x2c62d2(_0x2771de);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 639ffc1..d285e36 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 _0x6aa2=['multer','util','path','connect-timeout','Router','../../components/auth/service','get','isAuthenticated','/:id','show','create','put','update','delete','destroy','exports'];(function(_0x5264c6,_0x5100e6){var _0x24230d=function(_0x18cdc3){while(--_0x18cdc3){_0x5264c6['push'](_0x5264c6['shift']());}};_0x24230d(++_0x5100e6);}(_0x6aa2,0xb0));var _0x26aa=function(_0x3ce2c4,_0x4544c1){_0x3ce2c4=_0x3ce2c4-0x0;var _0x4047c1=_0x6aa2[_0x3ce2c4];return _0x4047c1;};'use strict';var multer=require(_0x26aa('0x0'));var util=require(_0x26aa('0x1'));var path=require(_0x26aa('0x2'));var timeout=require(_0x26aa('0x3'));var express=require('express');var router=express[_0x26aa('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x26aa('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intSugarcrmField.controller');router[_0x26aa('0x6')]('/',auth[_0x26aa('0x7')](),controller['index']);router[_0x26aa('0x6')](_0x26aa('0x8'),auth['isAuthenticated'](),controller[_0x26aa('0x9')]);router['post']('/',auth['isAuthenticated'](),controller[_0x26aa('0xa')]);router[_0x26aa('0xb')]('/:id',auth[_0x26aa('0x7')](),controller[_0x26aa('0xc')]);router[_0x26aa('0xd')]('/:id',auth[_0x26aa('0x7')](),controller[_0x26aa('0xe')]);module[_0x26aa('0xf')]=router; \ No newline at end of file +var _0xd5ba=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','isAuthenticated','index','get','/:id','post','create','put','delete'];(function(_0x4ee419,_0x40f30b){var _0x41e2a7=function(_0x18373c){while(--_0x18373c){_0x4ee419['push'](_0x4ee419['shift']());}};_0x41e2a7(++_0x40f30b);}(_0xd5ba,0xbf));var _0xad5b=function(_0xd0b415,_0x149675){_0xd0b415=_0xd0b415-0x0;var _0x2bdf2c=_0xd5ba[_0xd0b415];return _0x2bdf2c;};'use strict';var multer=require(_0xad5b('0x0'));var util=require(_0xad5b('0x1'));var path=require(_0xad5b('0x2'));var timeout=require(_0xad5b('0x3'));var express=require(_0xad5b('0x4'));var router=express[_0xad5b('0x5')]();var fs_extra=require(_0xad5b('0x6'));var auth=require(_0xad5b('0x7'));var interaction=require(_0xad5b('0x8'));var config=require(_0xad5b('0x9'));var controller=require(_0xad5b('0xa'));router['get']('/',auth[_0xad5b('0xb')](),controller[_0xad5b('0xc')]);router[_0xad5b('0xd')](_0xad5b('0xe'),auth[_0xad5b('0xb')](),controller['show']);router[_0xad5b('0xf')]('/',auth[_0xad5b('0xb')](),controller[_0xad5b('0x10')]);router[_0xad5b('0x11')](_0xad5b('0xe'),auth['isAuthenticated'](),controller['update']);router[_0xad5b('0x12')](_0xad5b('0xe'),auth[_0xad5b('0xb')](),controller[_0xad5b('0x13')]);module[_0xad5b('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 3ca8fe3..d9280a8 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 _0xdfdf=['customVariable','keyValue','STRING','BOOLEAN','exports','ENUM','string','variable'];(function(_0x6b7ccd,_0x4ab05d){var _0x5764ca=function(_0x55bbd9){while(--_0x55bbd9){_0x6b7ccd['push'](_0x6b7ccd['shift']());}};_0x5764ca(++_0x4ab05d);}(_0xdfdf,0xd4));var _0xfdfd=function(_0x34e803,_0x4c68bf){_0x34e803=_0x34e803-0x0;var _0x2a3172=_0xdfdf[_0x34e803];return _0x2a3172;};'use strict';var Sequelize=require('sequelize');module[_0xfdfd('0x0')]={'type':{'type':Sequelize[_0xfdfd('0x1')](_0xfdfd('0x2'),_0xfdfd('0x3'),_0xfdfd('0x4'),_0xfdfd('0x5'),'picklist'),'defaultValue':_0xfdfd('0x2')},'content':{'type':Sequelize[_0xfdfd('0x6')]},'key':{'type':Sequelize[_0xfdfd('0x6')]},'keyType':{'type':Sequelize[_0xfdfd('0x1')](_0xfdfd('0x2'),_0xfdfd('0x3'),_0xfdfd('0x4'))},'keyContent':{'type':Sequelize[_0xfdfd('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xfdfd('0x6')]},'customField':{'type':Sequelize[_0xfdfd('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xfdfd('0x6')]}}; \ No newline at end of file +var _0x44e0=['variable','customVariable','keyValue','picklist','string','STRING','sequelize','exports','ENUM'];(function(_0x52c06d,_0x1e4207){var _0x396a1e=function(_0x3b7435){while(--_0x3b7435){_0x52c06d['push'](_0x52c06d['shift']());}};_0x396a1e(++_0x1e4207);}(_0x44e0,0x189));var _0x044e=function(_0x45a236,_0x20f28a){_0x45a236=_0x45a236-0x0;var _0x3608b6=_0x44e0[_0x45a236];return _0x3608b6;};'use strict';var Sequelize=require(_0x044e('0x0'));module[_0x044e('0x1')]={'type':{'type':Sequelize[_0x044e('0x2')]('string',_0x044e('0x3'),_0x044e('0x4'),_0x044e('0x5'),_0x044e('0x6')),'defaultValue':_0x044e('0x7')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x044e('0x2')](_0x044e('0x7'),_0x044e('0x3'),_0x044e('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x044e('0x8')]},'nameField':{'type':Sequelize[_0x044e('0x8')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x044e('0x8')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 146b28a..e499d2c 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 _0x9e63=['moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','end','sendStatus','error','stack','name','map','SugarcrmField','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','eml-format','rimraf','zip-dir','request-promise'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0x9e63,0x98));var _0x39e6=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9e63[_0x2f5ac5];return _0x37c9a8;};'use strict';var emlformat=require(_0x39e6('0x0'));var rimraf=require(_0x39e6('0x1'));var zipdir=require(_0x39e6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x39e6('0x3'));var moment=require(_0x39e6('0x4'));var BPromise=require(_0x39e6('0x5'));var Mustache=require(_0x39e6('0x6'));var util=require(_0x39e6('0x7'));var path=require(_0x39e6('0x8'));var sox=require(_0x39e6('0x9'));var csv=require(_0x39e6('0xa'));var ejs=require(_0x39e6('0xb'));var fs=require('fs');var fs_extra=require(_0x39e6('0xc'));var _=require(_0x39e6('0xd'));var squel=require(_0x39e6('0xe'));var crypto=require(_0x39e6('0xf'));var jsforce=require(_0x39e6('0x10'));var deskjs=require(_0x39e6('0x11'));var toCsv=require(_0x39e6('0xa'));var querystring=require(_0x39e6('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x39e6('0x13'));var qs=require(_0x39e6('0x14'));var as=require(_0x39e6('0x15'));var hardwareService=require(_0x39e6('0x16'));var logger=require(_0x39e6('0x17'))(_0x39e6('0x18'));var utils=require(_0x39e6('0x19'));var config=require(_0x39e6('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x440920,_0x2c1e6b){_0x2c1e6b=_0x2c1e6b||0xcc;return function(_0x32f7fa){if(_0x32f7fa){return _0x440920['sendStatus'](_0x2c1e6b);}return _0x440920[_0x39e6('0x1b')](_0x2c1e6b)['end']();};}function respondWithResult(_0x220220,_0x7955f4){_0x7955f4=_0x7955f4||0xc8;return function(_0x2ff4a4){if(_0x2ff4a4){return _0x220220['status'](_0x7955f4)[_0x39e6('0x1c')](_0x2ff4a4);}};}function respondWithFilteredResult(_0x450fe1,_0x435e31){return function(_0x4930b1){if(_0x4930b1){var _0x30a9ed=typeof _0x435e31[_0x39e6('0x1d')]==='undefined'&&typeof _0x435e31[_0x39e6('0x1e')]===_0x39e6('0x1f');var _0x59f21c=_0x4930b1[_0x39e6('0x20')];var _0xd53173=_0x30a9ed?0x0:_0x435e31['offset'];var _0x46b63a=_0x30a9ed?_0x4930b1[_0x39e6('0x20')]:_0x435e31['offset']+_0x435e31[_0x39e6('0x1e')];var _0x16a71d;if(_0x46b63a>=_0x59f21c){_0x46b63a=_0x59f21c;_0x16a71d=0xc8;}else{_0x16a71d=0xce;}_0x450fe1[_0x39e6('0x1b')](_0x16a71d);return _0x450fe1[_0x39e6('0x21')](_0x39e6('0x22'),_0xd53173+'-'+_0x46b63a+'/'+_0x59f21c)['json'](_0x4930b1);}return null;};}function patchUpdates(_0x5966bd){return function(_0x651a75){try{jsonpatch[_0x39e6('0x23')](_0x651a75,_0x5966bd,!![]);}catch(_0xbe4992){return BPromise[_0x39e6('0x24')](_0xbe4992);}return _0x651a75['save']();};}function saveUpdates(_0x45f657,_0x142a27){return function(_0x5f08d3){if(_0x5f08d3){return _0x5f08d3[_0x39e6('0x25')](_0x45f657)[_0x39e6('0x26')](function(_0x192007){return _0x192007;});}return null;};}function removeEntity(_0x35a55,_0x5279c8){return function(_0x3b1390){if(_0x3b1390){return _0x3b1390[_0x39e6('0x27')]()['then'](function(){_0x35a55[_0x39e6('0x1b')](0xcc)[_0x39e6('0x28')]();});}};}function handleEntityNotFound(_0x154195,_0x482ab7){return function(_0x1be980){if(!_0x1be980){_0x154195[_0x39e6('0x29')](0x194);}return _0x1be980;};}function handleError(_0x39dfc4,_0x3ceb7b){_0x3ceb7b=_0x3ceb7b||0x1f4;return function(_0x1c0d20){logger[_0x39e6('0x2a')](_0x1c0d20[_0x39e6('0x2b')]);if(_0x1c0d20[_0x39e6('0x2c')]){delete _0x1c0d20['name'];}_0x39dfc4['status'](_0x3ceb7b)['send'](_0x1c0d20);};}exports['index']=function(_0x16c5bc,_0x1ea8c4){var _0x11fdfd={},_0x50798e={},_0x4eaa8d={'count':0x0,'rows':[]};var _0x33042c=_[_0x39e6('0x2d')](db[_0x39e6('0x2e')][_0x39e6('0x2f')],function(_0x387eb0){return{'name':_0x387eb0[_0x39e6('0x30')],'type':_0x387eb0[_0x39e6('0x31')][_0x39e6('0x32')]};});_0x50798e[_0x39e6('0x33')]=_[_0x39e6('0x2d')](_0x33042c,_0x39e6('0x2c'));_0x50798e[_0x39e6('0x34')]=_['keys'](_0x16c5bc['query']);_0x50798e['filters']=_[_0x39e6('0x35')](_0x50798e[_0x39e6('0x33')],_0x50798e['query']);_0x11fdfd[_0x39e6('0x36')]=_[_0x39e6('0x35')](_0x50798e[_0x39e6('0x33')],qs[_0x39e6('0x37')](_0x16c5bc[_0x39e6('0x34')][_0x39e6('0x37')]));_0x11fdfd['attributes']=_0x11fdfd['attributes'][_0x39e6('0x38')]?_0x11fdfd['attributes']:_0x50798e['model'];if(!_0x16c5bc[_0x39e6('0x34')][_0x39e6('0x39')]('nolimit')){_0x11fdfd[_0x39e6('0x1e')]=qs[_0x39e6('0x1e')](_0x16c5bc[_0x39e6('0x34')]['limit']);_0x11fdfd[_0x39e6('0x1d')]=qs[_0x39e6('0x1d')](_0x16c5bc[_0x39e6('0x34')]['offset']);}_0x11fdfd[_0x39e6('0x3a')]=qs[_0x39e6('0x3b')](_0x16c5bc[_0x39e6('0x34')][_0x39e6('0x3b')]);_0x11fdfd[_0x39e6('0x3c')]=qs[_0x39e6('0x3d')](_[_0x39e6('0x3e')](_0x16c5bc[_0x39e6('0x34')],_0x50798e['filters']),_0x33042c);if(_0x16c5bc[_0x39e6('0x34')][_0x39e6('0x3f')]){_0x11fdfd[_0x39e6('0x3c')]=_[_0x39e6('0x40')](_0x11fdfd[_0x39e6('0x3c')],{'$or':_[_0x39e6('0x2d')](_0x33042c,function(_0x1b345f){if(_0x1b345f['type']!==_0x39e6('0x41')){var _0x4476bf={};_0x4476bf[_0x1b345f[_0x39e6('0x2c')]]={'$like':'%'+_0x16c5bc['query'][_0x39e6('0x3f')]+'%'};return _0x4476bf;}})});}_0x11fdfd=_['merge']({},_0x11fdfd,_0x16c5bc[_0x39e6('0x42')]);var _0xf3fd06={'where':_0x11fdfd[_0x39e6('0x3c')]};return db[_0x39e6('0x2e')]['count'](_0xf3fd06)[_0x39e6('0x26')](function(_0x2d323d){_0x4eaa8d[_0x39e6('0x20')]=_0x2d323d;if(_0x16c5bc['query'][_0x39e6('0x43')]){_0x11fdfd[_0x39e6('0x44')]=[{'all':!![]}];}return db[_0x39e6('0x2e')][_0x39e6('0x45')](_0x11fdfd);})['then'](function(_0x2aa38d){_0x4eaa8d[_0x39e6('0x46')]=_0x2aa38d;return _0x4eaa8d;})[_0x39e6('0x26')](respondWithFilteredResult(_0x1ea8c4,_0x11fdfd))[_0x39e6('0x47')](handleError(_0x1ea8c4,null));};exports[_0x39e6('0x48')]=function(_0x2cb62d,_0x45fd2c){var _0x3cd04d={'raw':!![],'where':{'id':_0x2cb62d[_0x39e6('0x49')]['id']}},_0x25afac={};_0x25afac[_0x39e6('0x33')]=_['keys'](db[_0x39e6('0x2e')][_0x39e6('0x2f')]);_0x25afac[_0x39e6('0x34')]=_[_0x39e6('0x4a')](_0x2cb62d['query']);_0x25afac['filters']=_[_0x39e6('0x35')](_0x25afac['model'],_0x25afac[_0x39e6('0x34')]);_0x3cd04d[_0x39e6('0x36')]=_[_0x39e6('0x35')](_0x25afac[_0x39e6('0x33')],qs[_0x39e6('0x37')](_0x2cb62d[_0x39e6('0x34')][_0x39e6('0x37')]));_0x3cd04d[_0x39e6('0x36')]=_0x3cd04d[_0x39e6('0x36')]['length']?_0x3cd04d[_0x39e6('0x36')]:_0x25afac['model'];if(_0x2cb62d[_0x39e6('0x34')][_0x39e6('0x43')]){_0x3cd04d[_0x39e6('0x44')]=[{'all':!![]}];}_0x3cd04d=_[_0x39e6('0x40')]({},_0x3cd04d,_0x2cb62d[_0x39e6('0x42')]);return db[_0x39e6('0x2e')][_0x39e6('0x4b')](_0x3cd04d)[_0x39e6('0x26')](handleEntityNotFound(_0x45fd2c,null))['then'](respondWithResult(_0x45fd2c,null))[_0x39e6('0x47')](handleError(_0x45fd2c,null));};exports['create']=function(_0x95d843,_0x5e761c){return db[_0x39e6('0x2e')][_0x39e6('0x4c')](_0x95d843[_0x39e6('0x4d')],{})[_0x39e6('0x26')](respondWithResult(_0x5e761c,0xc9))[_0x39e6('0x47')](handleError(_0x5e761c,null));};exports[_0x39e6('0x25')]=function(_0x41fdef,_0x1f87e5){if(_0x41fdef[_0x39e6('0x4d')]['id']){delete _0x41fdef[_0x39e6('0x4d')]['id'];}return db[_0x39e6('0x2e')][_0x39e6('0x4b')]({'where':{'id':_0x41fdef[_0x39e6('0x49')]['id']}})[_0x39e6('0x26')](handleEntityNotFound(_0x1f87e5,null))[_0x39e6('0x26')](saveUpdates(_0x41fdef[_0x39e6('0x4d')],null))['then'](respondWithResult(_0x1f87e5,null))[_0x39e6('0x47')](handleError(_0x1f87e5,null));};exports['destroy']=function(_0x3fced9,_0x5d259b){return db[_0x39e6('0x2e')]['find']({'where':{'id':_0x3fced9[_0x39e6('0x49')]['id']}})[_0x39e6('0x26')](handleEntityNotFound(_0x5d259b,null))[_0x39e6('0x26')](removeEntity(_0x5d259b,null))[_0x39e6('0x47')](handleError(_0x5d259b,null));}; \ No newline at end of file +var _0x4948=['sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','stack','name','rawAttributes','type','key','map','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','merge','SugarcrmField','findAll','rows','show','params','keys','includeAll','include','find','create','body','catch','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x3c59fc,_0x10dbd2){var _0x2b78d4=function(_0x5f161a){while(--_0x5f161a){_0x3c59fc['push'](_0x3c59fc['shift']());}};_0x2b78d4(++_0x10dbd2);}(_0x4948,0x1f0));var _0x8494=function(_0x364cf5,_0x447983){_0x364cf5=_0x364cf5-0x0;var _0x51cb9a=_0x4948[_0x364cf5];return _0x51cb9a;};'use strict';var emlformat=require(_0x8494('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8494('0x1'));var jsonpatch=require(_0x8494('0x2'));var rp=require(_0x8494('0x3'));var moment=require(_0x8494('0x4'));var BPromise=require(_0x8494('0x5'));var Mustache=require(_0x8494('0x6'));var util=require(_0x8494('0x7'));var path=require('path');var sox=require(_0x8494('0x8'));var csv=require(_0x8494('0x9'));var ejs=require(_0x8494('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8494('0xb'));var squel=require('squel');var crypto=require(_0x8494('0xc'));var jsforce=require(_0x8494('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x8494('0x9'));var querystring=require(_0x8494('0xe'));var Papa=require(_0x8494('0xf'));var Redis=require(_0x8494('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x8494('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8494('0x12'));var logger=require(_0x8494('0x13'))(_0x8494('0x14'));var utils=require(_0x8494('0x15'));var config=require(_0x8494('0x16'));var licenseUtil=require(_0x8494('0x17'));var db=require(_0x8494('0x18'))['db'];function respondWithStatusCode(_0x41c186,_0x37af67){_0x37af67=_0x37af67||0xcc;return function(_0x341a57){if(_0x341a57){return _0x41c186[_0x8494('0x19')](_0x37af67);}return _0x41c186[_0x8494('0x1a')](_0x37af67)[_0x8494('0x1b')]();};}function respondWithResult(_0x16be3f,_0x45e1a3){_0x45e1a3=_0x45e1a3||0xc8;return function(_0xa837fd){if(_0xa837fd){return _0x16be3f[_0x8494('0x1a')](_0x45e1a3)[_0x8494('0x1c')](_0xa837fd);}};}function respondWithFilteredResult(_0x3ad43a,_0x2fa5b0){return function(_0x5c75bb){if(_0x5c75bb){var _0x937150=typeof _0x2fa5b0[_0x8494('0x1d')]===_0x8494('0x1e')&&typeof _0x2fa5b0['limit']===_0x8494('0x1e');var _0x17caef=_0x5c75bb['count'];var _0x12c175=_0x937150?0x0:_0x2fa5b0[_0x8494('0x1d')];var _0x1655ae=_0x937150?_0x5c75bb[_0x8494('0x1f')]:_0x2fa5b0['offset']+_0x2fa5b0[_0x8494('0x20')];var _0x36755c;if(_0x1655ae>=_0x17caef){_0x1655ae=_0x17caef;_0x36755c=0xc8;}else{_0x36755c=0xce;}_0x3ad43a[_0x8494('0x1a')](_0x36755c);return _0x3ad43a[_0x8494('0x21')](_0x8494('0x22'),_0x12c175+'-'+_0x1655ae+'/'+_0x17caef)[_0x8494('0x1c')](_0x5c75bb);}return null;};}function patchUpdates(_0x2a2bcb){return function(_0x31298c){try{jsonpatch['apply'](_0x31298c,_0x2a2bcb,!![]);}catch(_0x3d9784){return BPromise[_0x8494('0x23')](_0x3d9784);}return _0x31298c[_0x8494('0x24')]();};}function saveUpdates(_0x512a10,_0x203d2e){return function(_0x514ce3){if(_0x514ce3){return _0x514ce3[_0x8494('0x25')](_0x512a10)[_0x8494('0x26')](function(_0x397590){return _0x397590;});}return null;};}function removeEntity(_0x6a13aa,_0x1a4004){return function(_0x9aec3f){if(_0x9aec3f){return _0x9aec3f['destroy']()['then'](function(){_0x6a13aa[_0x8494('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d8f42,_0x5f268d){return function(_0x1c44b8){if(!_0x1c44b8){_0x3d8f42['sendStatus'](0x194);}return _0x1c44b8;};}function handleError(_0x339a38,_0x43295a){_0x43295a=_0x43295a||0x1f4;return function(_0x4b9d5f){logger['error'](_0x4b9d5f[_0x8494('0x27')]);if(_0x4b9d5f[_0x8494('0x28')]){delete _0x4b9d5f[_0x8494('0x28')];}_0x339a38['status'](_0x43295a)['send'](_0x4b9d5f);};}exports['index']=function(_0x5da74b,_0x346a28){var _0x240dd7={},_0x6a0f8={},_0x58eb55={'count':0x0,'rows':[]};var _0x258f32=_['map'](db['SugarcrmField'][_0x8494('0x29')],function(_0x282e36){return{'name':_0x282e36['fieldName'],'type':_0x282e36[_0x8494('0x2a')][_0x8494('0x2b')]};});_0x6a0f8['model']=_[_0x8494('0x2c')](_0x258f32,_0x8494('0x28'));_0x6a0f8[_0x8494('0x2d')]=_['keys'](_0x5da74b[_0x8494('0x2d')]);_0x6a0f8[_0x8494('0x2e')]=_['intersection'](_0x6a0f8[_0x8494('0x2f')],_0x6a0f8['query']);_0x240dd7[_0x8494('0x30')]=_[_0x8494('0x31')](_0x6a0f8[_0x8494('0x2f')],qs[_0x8494('0x32')](_0x5da74b[_0x8494('0x2d')][_0x8494('0x32')]));_0x240dd7[_0x8494('0x30')]=_0x240dd7['attributes'][_0x8494('0x33')]?_0x240dd7[_0x8494('0x30')]:_0x6a0f8[_0x8494('0x2f')];if(!_0x5da74b[_0x8494('0x2d')][_0x8494('0x34')](_0x8494('0x35'))){_0x240dd7[_0x8494('0x20')]=qs[_0x8494('0x20')](_0x5da74b[_0x8494('0x2d')][_0x8494('0x20')]);_0x240dd7['offset']=qs[_0x8494('0x1d')](_0x5da74b[_0x8494('0x2d')][_0x8494('0x1d')]);}_0x240dd7[_0x8494('0x36')]=qs[_0x8494('0x37')](_0x5da74b['query'][_0x8494('0x37')]);_0x240dd7[_0x8494('0x38')]=qs[_0x8494('0x2e')](_['pick'](_0x5da74b[_0x8494('0x2d')],_0x6a0f8[_0x8494('0x2e')]),_0x258f32);if(_0x5da74b[_0x8494('0x2d')]['filter']){_0x240dd7[_0x8494('0x38')]=_['merge'](_0x240dd7[_0x8494('0x38')],{'$or':_['map'](_0x258f32,function(_0x320ad4){if(_0x320ad4[_0x8494('0x2a')]!==_0x8494('0x39')){var _0x404a09={};_0x404a09[_0x320ad4[_0x8494('0x28')]]={'$like':'%'+_0x5da74b[_0x8494('0x2d')]['filter']+'%'};return _0x404a09;}})});}_0x240dd7=_[_0x8494('0x3a')]({},_0x240dd7,_0x5da74b['options']);var _0x23e297={'where':_0x240dd7[_0x8494('0x38')]};return db['SugarcrmField'][_0x8494('0x1f')](_0x23e297)[_0x8494('0x26')](function(_0x2115e9){_0x58eb55[_0x8494('0x1f')]=_0x2115e9;if(_0x5da74b['query']['includeAll']){_0x240dd7['include']=[{'all':!![]}];}return db[_0x8494('0x3b')][_0x8494('0x3c')](_0x240dd7);})[_0x8494('0x26')](function(_0x49fc92){_0x58eb55[_0x8494('0x3d')]=_0x49fc92;return _0x58eb55;})[_0x8494('0x26')](respondWithFilteredResult(_0x346a28,_0x240dd7))['catch'](handleError(_0x346a28,null));};exports[_0x8494('0x3e')]=function(_0x5a91e9,_0x84a3f8){var _0x39e9d6={'raw':!![],'where':{'id':_0x5a91e9[_0x8494('0x3f')]['id']}},_0xe85477={};_0xe85477[_0x8494('0x2f')]=_[_0x8494('0x40')](db[_0x8494('0x3b')][_0x8494('0x29')]);_0xe85477[_0x8494('0x2d')]=_[_0x8494('0x40')](_0x5a91e9[_0x8494('0x2d')]);_0xe85477[_0x8494('0x2e')]=_[_0x8494('0x31')](_0xe85477[_0x8494('0x2f')],_0xe85477['query']);_0x39e9d6[_0x8494('0x30')]=_['intersection'](_0xe85477[_0x8494('0x2f')],qs['fields'](_0x5a91e9[_0x8494('0x2d')]['fields']));_0x39e9d6[_0x8494('0x30')]=_0x39e9d6[_0x8494('0x30')][_0x8494('0x33')]?_0x39e9d6[_0x8494('0x30')]:_0xe85477[_0x8494('0x2f')];if(_0x5a91e9[_0x8494('0x2d')][_0x8494('0x41')]){_0x39e9d6[_0x8494('0x42')]=[{'all':!![]}];}_0x39e9d6=_[_0x8494('0x3a')]({},_0x39e9d6,_0x5a91e9['options']);return db[_0x8494('0x3b')][_0x8494('0x43')](_0x39e9d6)[_0x8494('0x26')](handleEntityNotFound(_0x84a3f8,null))['then'](respondWithResult(_0x84a3f8,null))['catch'](handleError(_0x84a3f8,null));};exports[_0x8494('0x44')]=function(_0x3d9143,_0x394af5){return db[_0x8494('0x3b')]['create'](_0x3d9143[_0x8494('0x45')],{})[_0x8494('0x26')](respondWithResult(_0x394af5,0xc9))[_0x8494('0x46')](handleError(_0x394af5,null));};exports[_0x8494('0x25')]=function(_0x53668e,_0x5b81c1){if(_0x53668e[_0x8494('0x45')]['id']){delete _0x53668e['body']['id'];}return db[_0x8494('0x3b')][_0x8494('0x43')]({'where':{'id':_0x53668e[_0x8494('0x3f')]['id']}})[_0x8494('0x26')](handleEntityNotFound(_0x5b81c1,null))[_0x8494('0x26')](saveUpdates(_0x53668e[_0x8494('0x45')],null))[_0x8494('0x26')](respondWithResult(_0x5b81c1,null))['catch'](handleError(_0x5b81c1,null));};exports[_0x8494('0x47')]=function(_0xe2b546,_0xd9d70a){return db[_0x8494('0x3b')][_0x8494('0x43')]({'where':{'id':_0xe2b546[_0x8494('0x3f')]['id']}})[_0x8494('0x26')](handleEntityNotFound(_0xd9d70a,null))[_0x8494('0x26')](removeEntity(_0xd9d70a,null))[_0x8494('0x46')](handleError(_0xd9d70a,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 2806f81..fc5f1fb 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 _0x4b38=['path','rimraf','../../config/environment','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','lodash','../../config/logger','api','moment','request-promise'];(function(_0x34b0fc,_0x97425c){var _0x3bc630=function(_0x5a6934){while(--_0x5a6934){_0x34b0fc['push'](_0x34b0fc['shift']());}};_0x3bc630(++_0x97425c);}(_0x4b38,0x14d));var _0x84b3=function(_0x28d563,_0x1dd084){_0x28d563=_0x28d563-0x0;var _0x3c4909=_0x4b38[_0x28d563];return _0x3c4909;};'use strict';var _=require(_0x84b3('0x0'));var util=require('util');var logger=require(_0x84b3('0x1'))(_0x84b3('0x2'));var moment=require(_0x84b3('0x3'));var BPromise=require('bluebird');var rp=require(_0x84b3('0x4'));var fs=require('fs');var path=require(_0x84b3('0x5'));var rimraf=require(_0x84b3('0x6'));var config=require(_0x84b3('0x7'));var attributes=require('./intSugarcrmField.attributes');module['exports']=function(_0x2f096f,_0x235f25){return _0x2f096f[_0x84b3('0x8')](_0x84b3('0x9'),attributes,{'tableName':_0x84b3('0xa'),'paranoid':![],'indexes':[{'name':_0x84b3('0xb'),'fields':[_0x84b3('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x17c3=['FieldId','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./intSugarcrmField.attributes','SugarcrmField','sugarcrm_unique_index','idField'];(function(_0x2829fd,_0x2fb3d0){var _0x55c9b7=function(_0x75d6f1){while(--_0x75d6f1){_0x2829fd['push'](_0x2829fd['shift']());}};_0x55c9b7(++_0x2fb3d0);}(_0x17c3,0x112));var _0x317c=function(_0x2f0d10,_0x4cabbe){_0x2f0d10=_0x2f0d10-0x0;var _0x1919b9=_0x17c3[_0x2f0d10];return _0x1919b9;};'use strict';var _=require(_0x317c('0x0'));var util=require(_0x317c('0x1'));var logger=require(_0x317c('0x2'))('api');var moment=require(_0x317c('0x3'));var BPromise=require('bluebird');var rp=require(_0x317c('0x4'));var fs=require('fs');var path=require(_0x317c('0x5'));var rimraf=require(_0x317c('0x6'));var config=require(_0x317c('0x7'));var attributes=require(_0x317c('0x8'));module['exports']=function(_0x29ba59,_0x44b6ef){return _0x29ba59['define'](_0x317c('0x9'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0x317c('0xa'),'fields':[_0x317c('0xb'),_0x317c('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.rpc.js b/server/api/intSugarcrmField/intSugarcrmField.rpc.js index 3024fd3..0d3c4b2 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 _0xa9f1=['client','http','request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise'];(function(_0x3d9176,_0x399d6f){var _0x12adc5=function(_0x700b01){while(--_0x700b01){_0x3d9176['push'](_0x3d9176['shift']());}};_0x12adc5(++_0x399d6f);}(_0xa9f1,0xb5));var _0x1a9f=function(_0x1e8bf6,_0x1cc6d8){_0x1e8bf6=_0x1e8bf6-0x0;var _0x1d273b=_0xa9f1[_0x1e8bf6];return _0x1d273b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1a9f('0x0'));var BPromise=require(_0x1a9f('0x1'));var rs=require(_0x1a9f('0x2'));var fs=require('fs');var Redis=require(_0x1a9f('0x3'));var db=require(_0x1a9f('0x4'))['db'];var utils=require(_0x1a9f('0x5'));var logger=require(_0x1a9f('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x1a9f('0x7'));var client=jayson[_0x1a9f('0x8')][_0x1a9f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x218a15,_0x2cfd63,_0x4d984c){return new BPromise(function(_0xdcfab3,_0x19b54d){return client[_0x1a9f('0xa')](_0x218a15,_0x4d984c)[_0x1a9f('0xb')](function(_0x3f2e22){logger[_0x1a9f('0xc')](_0x1a9f('0xd'),_0x2cfd63,_0x1a9f('0xe'));logger[_0x1a9f('0xf')](_0x1a9f('0x10'),_0x2cfd63,_0x1a9f('0xe'),JSON['stringify'](_0x3f2e22));if(_0x3f2e22[_0x1a9f('0x11')]){if(_0x3f2e22[_0x1a9f('0x11')][_0x1a9f('0x12')]===0x1f4){logger['error'](_0x1a9f('0xd'),_0x2cfd63,_0x3f2e22[_0x1a9f('0x11')][_0x1a9f('0x13')]);return _0x19b54d(_0x3f2e22[_0x1a9f('0x11')][_0x1a9f('0x13')]);}logger['error'](_0x1a9f('0xd'),_0x2cfd63,_0x3f2e22[_0x1a9f('0x11')][_0x1a9f('0x13')]);return _0xdcfab3(_0x3f2e22[_0x1a9f('0x11')]['message']);}else{logger['info'](_0x1a9f('0xd'),_0x2cfd63,_0x1a9f('0xe'));_0xdcfab3(_0x3f2e22['result']['message']);}})[_0x1a9f('0x14')](function(_0x289138){logger[_0x1a9f('0x11')]('SugarcrmField,\x20%s,\x20%s',_0x2cfd63,_0x289138);_0x19b54d(_0x289138);});});} \ No newline at end of file +var _0x7ab4=['lodash','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','code','error','message','info','result'];(function(_0x46f776,_0x461f3d){var _0x426388=function(_0x5d320f){while(--_0x5d320f){_0x46f776['push'](_0x46f776['shift']());}};_0x426388(++_0x461f3d);}(_0x7ab4,0x104));var _0x47ab=function(_0x3d9312,_0x3363fc){_0x3d9312=_0x3d9312-0x0;var _0x3a0a42=_0x7ab4[_0x3d9312];return _0x3a0a42;};'use strict';var _=require(_0x47ab('0x0'));var util=require('util');var moment=require(_0x47ab('0x1'));var BPromise=require(_0x47ab('0x2'));var rs=require(_0x47ab('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x47ab('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x47ab('0x5'));var config=require(_0x47ab('0x6'));var jayson=require(_0x47ab('0x7'));var client=jayson[_0x47ab('0x8')][_0x47ab('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x566eae,_0x545f35,_0x240885){return new BPromise(function(_0xc86c7a,_0x264634){return client['request'](_0x566eae,_0x240885)[_0x47ab('0xa')](function(_0x47c234){logger['info'](_0x47ab('0xb'),_0x545f35,_0x47ab('0xc'));logger[_0x47ab('0xd')](_0x47ab('0xe'),_0x545f35,_0x47ab('0xc'),JSON['stringify'](_0x47c234));if(_0x47c234['error']){if(_0x47c234['error'][_0x47ab('0xf')]===0x1f4){logger[_0x47ab('0x10')](_0x47ab('0xb'),_0x545f35,_0x47c234[_0x47ab('0x10')]['message']);return _0x264634(_0x47c234[_0x47ab('0x10')]['message']);}logger[_0x47ab('0x10')](_0x47ab('0xb'),_0x545f35,_0x47c234[_0x47ab('0x10')][_0x47ab('0x11')]);return _0xc86c7a(_0x47c234[_0x47ab('0x10')][_0x47ab('0x11')]);}else{logger[_0x47ab('0x12')](_0x47ab('0xb'),_0x545f35,'request\x20sent');_0xc86c7a(_0x47c234[_0x47ab('0x13')][_0x47ab('0x11')]);}})['catch'](function(_0x5e242d){logger[_0x47ab('0x10')]('SugarcrmField,\x20%s,\x20%s',_0x545f35,_0x5e242d);_0x264634(_0x5e242d);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 7a0186b..821ba9e 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 _0xa98d=['exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerAccount.controller','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','update','destroy'];(function(_0x2b911c,_0x58f7e9){var _0x3fb0da=function(_0x30474f){while(--_0x30474f){_0x2b911c['push'](_0x2b911c['shift']());}};_0x3fb0da(++_0x58f7e9);}(_0xa98d,0x171));var _0xda98=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xa98d[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0xda98('0x0'));var util=require(_0xda98('0x1'));var path=require(_0xda98('0x2'));var timeout=require(_0xda98('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xda98('0x4'));var auth=require(_0xda98('0x5'));var interaction=require(_0xda98('0x6'));var config=require('../../config/environment');var controller=require(_0xda98('0x7'));router[_0xda98('0x8')]('/',auth['isAuthenticated'](),controller[_0xda98('0x9')]);router[_0xda98('0x8')](_0xda98('0xa'),auth[_0xda98('0xb')](),controller[_0xda98('0xc')]);router['get'](_0xda98('0xd'),auth[_0xda98('0xb')](),controller[_0xda98('0xe')]);router['get'](_0xda98('0xf'),auth['isAuthenticated'](),controller[_0xda98('0x10')]);router[_0xda98('0x11')]('/',auth[_0xda98('0xb')](),controller[_0xda98('0x12')]);router['post'](_0xda98('0xd'),auth[_0xda98('0xb')](),controller[_0xda98('0x13')]);router['put'](_0xda98('0xa'),auth[_0xda98('0xb')](),controller[_0xda98('0x14')]);router['delete'](_0xda98('0xa'),auth[_0xda98('0xb')](),controller[_0xda98('0x15')]);module[_0xda98('0x16')]=router; \ No newline at end of file +var _0x740a=['addConfiguration','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/:id','show','getConfigurations','/:id/fields','post','/:id/configurations'];(function(_0x57af00,_0x45b14e){var _0x5f5bdc=function(_0x1d8b15){while(--_0x1d8b15){_0x57af00['push'](_0x57af00['shift']());}};_0x5f5bdc(++_0x45b14e);}(_0x740a,0x175));var _0xa740=function(_0xc7674a,_0x39a38a){_0xc7674a=_0xc7674a-0x0;var _0x153dad=_0x740a[_0xc7674a];return _0x153dad;};'use strict';var multer=require(_0xa740('0x0'));var util=require(_0xa740('0x1'));var path=require(_0xa740('0x2'));var timeout=require(_0xa740('0x3'));var express=require(_0xa740('0x4'));var router=express[_0xa740('0x5')]();var fs_extra=require(_0xa740('0x6'));var auth=require(_0xa740('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xa740('0x8'));var controller=require('./intVtigerAccount.controller');router['get']('/',auth[_0xa740('0x9')](),controller[_0xa740('0xa')]);router[_0xa740('0xb')](_0xa740('0xc'),auth[_0xa740('0x9')](),controller[_0xa740('0xd')]);router[_0xa740('0xb')]('/:id/configurations',auth[_0xa740('0x9')](),controller[_0xa740('0xe')]);router[_0xa740('0xb')](_0xa740('0xf'),auth[_0xa740('0x9')](),controller['getFields']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xa740('0x10')](_0xa740('0x11'),auth[_0xa740('0x9')](),controller[_0xa740('0x12')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xa740('0x13')]);router[_0xa740('0x14')](_0xa740('0xc'),auth[_0xa740('0x9')](),controller[_0xa740('0x15')]);module[_0xa740('0x16')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 63fcecc..e0da395 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 _0xebdf=['exports','STRING','sequelize'];(function(_0x33ab8a,_0x2052ce){var _0x3136f9=function(_0x2a64c2){while(--_0x2a64c2){_0x33ab8a['push'](_0x33ab8a['shift']());}};_0x3136f9(++_0x2052ce);}(_0xebdf,0xa4));var _0xfebd=function(_0x31295c,_0x2f2b82){_0x31295c=_0x31295c-0x0;var _0x2c150e=_0xebdf[_0x31295c];return _0x2c150e;};'use strict';var Sequelize=require(_0xfebd('0x0'));module[_0xfebd('0x1')]={'name':{'type':Sequelize[_0xfebd('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xfebd('0x2')]},'username':{'type':Sequelize[_0xfebd('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xfebd('0x2')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0xfebd('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xfebd('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x3618=['HelpDesk','sequelize','exports','STRING'];(function(_0x16a958,_0x5d0d42){var _0x57d9e7=function(_0x107651){while(--_0x107651){_0x16a958['push'](_0x16a958['shift']());}};_0x57d9e7(++_0x5d0d42);}(_0x3618,0xa9));var _0x8361=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x3618[_0x422905];return _0x33dc6c;};'use strict';var Sequelize=require(_0x8361('0x0'));module[_0x8361('0x1')]={'name':{'type':Sequelize[_0x8361('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x8361('0x2')]},'username':{'type':Sequelize[_0x8361('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x8361('0x2')],'allowNull':![],'defaultValue':_0x8361('0x3')},'remoteUri':{'type':Sequelize[_0x8361('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x8361('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x8361('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 ad0a01f..398d20b 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 _0x1185=['lastIndexOf','format','%s/webservice.php','success','POST','login','token','describe','result','sessionName','autogenerated','owner','includes','remove','false','label','startsWith','picklistValues','value','log','vTiger\x20error:\x20','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','send','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','update','destroy','end','stack','name','map','VtigerAccount','rawAttributes','fieldName','type','model','query','keys','filters','attributes','fields','length','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','then','includeAll','include','rows','catch','show','intersection','create','body','find','params','findOne','getConfigurations','hasOwnProperty','AccountId','getSubjects','channel','Descriptions','getDescriptions','VtigerField','Subjects','md5','getFields','username','description','remoteUri','accessKey','moduleName','slice','substring'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0x1185,0x96));var _0x5118=function(_0x28a8fa,_0x3682c1){_0x28a8fa=_0x28a8fa-0x0;var _0x5cda46=_0x1185[_0x28a8fa];return _0x5cda46;};'use strict';var emlformat=require(_0x5118('0x0'));var rimraf=require(_0x5118('0x1'));var zipdir=require(_0x5118('0x2'));var jsonpatch=require(_0x5118('0x3'));var rp=require(_0x5118('0x4'));var moment=require('moment');var BPromise=require(_0x5118('0x5'));var Mustache=require(_0x5118('0x6'));var util=require(_0x5118('0x7'));var path=require('path');var sox=require(_0x5118('0x8'));var csv=require(_0x5118('0x9'));var ejs=require(_0x5118('0xa'));var fs=require('fs');var fs_extra=require(_0x5118('0xb'));var _=require(_0x5118('0xc'));var squel=require(_0x5118('0xd'));var crypto=require(_0x5118('0xe'));var jsforce=require(_0x5118('0xf'));var deskjs=require(_0x5118('0x10'));var toCsv=require(_0x5118('0x9'));var querystring=require(_0x5118('0x11'));var Papa=require(_0x5118('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5118('0x13'));var as=require(_0x5118('0x14'));var hardwareService=require(_0x5118('0x15'));var logger=require(_0x5118('0x16'))(_0x5118('0x17'));var utils=require('../../config/utils');var config=require(_0x5118('0x18'));var licenseUtil=require(_0x5118('0x19'));var db=require(_0x5118('0x1a'))['db'];var integrations=require(_0x5118('0x1b'));function respondWithStatusCode(_0x514379,_0x46351b){_0x46351b=_0x46351b||0xcc;return function(_0x1ce031){if(_0x1ce031){return _0x514379[_0x5118('0x1c')](_0x46351b);}return _0x514379[_0x5118('0x1d')](_0x46351b)['end']();};}function respondWithResult(_0x5bbe26,_0x1bc3a7){_0x1bc3a7=_0x1bc3a7||0xc8;return function(_0x4533e3){if(_0x4533e3){return _0x5bbe26['status'](_0x1bc3a7)[_0x5118('0x1e')](_0x4533e3);}};}function respondWithFilteredResult(_0x3d6b0a,_0x53e9a5){return function(_0x1e6485){if(_0x1e6485){var _0x3c0580=typeof _0x53e9a5['offset']==='undefined'&&typeof _0x53e9a5['limit']==='undefined';var _0x23111f=_0x1e6485[_0x5118('0x1f')];var _0x5e06e6=_0x3c0580?0x0:_0x53e9a5[_0x5118('0x20')];var _0x1a41c3=_0x3c0580?_0x1e6485[_0x5118('0x1f')]:_0x53e9a5[_0x5118('0x20')]+_0x53e9a5['limit'];var _0x20f9b6;if(_0x1a41c3>=_0x23111f){_0x1a41c3=_0x23111f;_0x20f9b6=0xc8;}else{_0x20f9b6=0xce;}_0x3d6b0a[_0x5118('0x1d')](_0x20f9b6);return _0x3d6b0a[_0x5118('0x21')](_0x5118('0x22'),_0x5e06e6+'-'+_0x1a41c3+'/'+_0x23111f)[_0x5118('0x1e')](_0x1e6485);}return null;};}function patchUpdates(_0x4ffc06){return function(_0x5f0146){try{jsonpatch[_0x5118('0x23')](_0x5f0146,_0x4ffc06,!![]);}catch(_0x226819){return BPromise[_0x5118('0x24')](_0x226819);}return _0x5f0146['save']();};}function saveUpdates(_0x383903,_0x1a5085){return function(_0x41da7c){if(_0x41da7c){return _0x41da7c[_0x5118('0x25')](_0x383903)['then'](function(_0x3f9591){return _0x3f9591;});}return null;};}function removeEntity(_0x1399db,_0x3ab811){return function(_0x124b23){if(_0x124b23){return _0x124b23[_0x5118('0x26')]()['then'](function(){_0x1399db[_0x5118('0x1d')](0xcc)[_0x5118('0x27')]();});}};}function handleEntityNotFound(_0x2c44f8,_0x47f966){return function(_0x2ab8e0){if(!_0x2ab8e0){_0x2c44f8['sendStatus'](0x194);}return _0x2ab8e0;};}function handleError(_0xf2de41,_0x666eee){_0x666eee=_0x666eee||0x1f4;return function(_0x1d4399){logger['error'](_0x1d4399[_0x5118('0x28')]);if(_0x1d4399[_0x5118('0x29')]){delete _0x1d4399[_0x5118('0x29')];}_0xf2de41['status'](_0x666eee)['send'](_0x1d4399);};}exports['index']=function(_0x589cba,_0x344269){var _0x41f73f={},_0x4de9f8={},_0x36f7be={'count':0x0,'rows':[]};var _0x30a0bb=_[_0x5118('0x2a')](db[_0x5118('0x2b')][_0x5118('0x2c')],function(_0x179d9a){return{'name':_0x179d9a[_0x5118('0x2d')],'type':_0x179d9a[_0x5118('0x2e')]['key']};});_0x4de9f8[_0x5118('0x2f')]=_[_0x5118('0x2a')](_0x30a0bb,_0x5118('0x29'));_0x4de9f8[_0x5118('0x30')]=_[_0x5118('0x31')](_0x589cba[_0x5118('0x30')]);_0x4de9f8[_0x5118('0x32')]=_['intersection'](_0x4de9f8[_0x5118('0x2f')],_0x4de9f8['query']);_0x41f73f[_0x5118('0x33')]=_['intersection'](_0x4de9f8[_0x5118('0x2f')],qs[_0x5118('0x34')](_0x589cba['query'][_0x5118('0x34')]));_0x41f73f[_0x5118('0x33')]=_0x41f73f[_0x5118('0x33')][_0x5118('0x35')]?_0x41f73f['attributes']:_0x4de9f8[_0x5118('0x2f')];if(!_0x589cba[_0x5118('0x30')]['hasOwnProperty'](_0x5118('0x36'))){_0x41f73f[_0x5118('0x37')]=qs[_0x5118('0x37')](_0x589cba['query'][_0x5118('0x37')]);_0x41f73f[_0x5118('0x20')]=qs['offset'](_0x589cba[_0x5118('0x30')][_0x5118('0x20')]);}_0x41f73f[_0x5118('0x38')]=qs['sort'](_0x589cba[_0x5118('0x30')][_0x5118('0x39')]);_0x41f73f['where']=qs['filters'](_[_0x5118('0x3a')](_0x589cba[_0x5118('0x30')],_0x4de9f8['filters']),_0x30a0bb);if(_0x589cba['query'][_0x5118('0x3b')]){_0x41f73f[_0x5118('0x3c')]=_[_0x5118('0x3d')](_0x41f73f[_0x5118('0x3c')],{'$or':_[_0x5118('0x2a')](_0x30a0bb,function(_0x2ab3f8){if(_0x2ab3f8[_0x5118('0x2e')]!==_0x5118('0x3e')){var _0x1fce82={};_0x1fce82[_0x2ab3f8[_0x5118('0x29')]]={'$like':'%'+_0x589cba[_0x5118('0x30')]['filter']+'%'};return _0x1fce82;}})});}_0x41f73f=_[_0x5118('0x3d')]({},_0x41f73f,_0x589cba[_0x5118('0x3f')]);var _0x8d9b6a={'where':_0x41f73f[_0x5118('0x3c')]};return db[_0x5118('0x2b')][_0x5118('0x1f')](_0x8d9b6a)[_0x5118('0x40')](function(_0x1fd4ae){_0x36f7be['count']=_0x1fd4ae;if(_0x589cba[_0x5118('0x30')][_0x5118('0x41')]){_0x41f73f[_0x5118('0x42')]=[{'all':!![]}];}return db[_0x5118('0x2b')]['findAll'](_0x41f73f);})[_0x5118('0x40')](function(_0x470d18){_0x36f7be[_0x5118('0x43')]=_0x470d18;return _0x36f7be;})[_0x5118('0x40')](respondWithFilteredResult(_0x344269,_0x41f73f))[_0x5118('0x44')](handleError(_0x344269,null));};exports[_0x5118('0x45')]=function(_0x30a6c6,_0x467a00){var _0x1365a6={'raw':![],'where':{'id':_0x30a6c6['params']['id']}},_0x2bc6b9={};_0x2bc6b9[_0x5118('0x2f')]=_[_0x5118('0x31')](db['VtigerAccount']['rawAttributes']);_0x2bc6b9[_0x5118('0x30')]=_[_0x5118('0x31')](_0x30a6c6[_0x5118('0x30')]);_0x2bc6b9[_0x5118('0x32')]=_[_0x5118('0x46')](_0x2bc6b9[_0x5118('0x2f')],_0x2bc6b9[_0x5118('0x30')]);_0x1365a6[_0x5118('0x33')]=_[_0x5118('0x46')](_0x2bc6b9[_0x5118('0x2f')],qs[_0x5118('0x34')](_0x30a6c6[_0x5118('0x30')]['fields']));_0x1365a6['attributes']=_0x1365a6[_0x5118('0x33')][_0x5118('0x35')]?_0x1365a6[_0x5118('0x33')]:_0x2bc6b9['model'];if(_0x30a6c6[_0x5118('0x30')][_0x5118('0x41')]){_0x1365a6['include']=[{'all':!![]}];}_0x1365a6=_['merge']({},_0x1365a6,_0x30a6c6[_0x5118('0x3f')]);return db[_0x5118('0x2b')]['find'](_0x1365a6)[_0x5118('0x40')](handleEntityNotFound(_0x467a00,null))[_0x5118('0x40')](respondWithResult(_0x467a00,null))['catch'](handleError(_0x467a00,null));};exports[_0x5118('0x47')]=function(_0x5a53a5,_0x299d60){return db[_0x5118('0x2b')][_0x5118('0x47')](_0x5a53a5['body'],{})[_0x5118('0x40')](respondWithResult(_0x299d60,0xc9))['catch'](handleError(_0x299d60,null));};exports[_0x5118('0x25')]=function(_0x6f58e4,_0x31842d){if(_0x6f58e4[_0x5118('0x48')]['id']){delete _0x6f58e4['body']['id'];}return db[_0x5118('0x2b')][_0x5118('0x49')]({'where':{'id':_0x6f58e4[_0x5118('0x4a')]['id']}})[_0x5118('0x40')](handleEntityNotFound(_0x31842d,null))[_0x5118('0x40')](saveUpdates(_0x6f58e4[_0x5118('0x48')],null))[_0x5118('0x40')](respondWithResult(_0x31842d,null))['catch'](handleError(_0x31842d,null));};exports[_0x5118('0x26')]=function(_0x3c8bfb,_0x453733){return db[_0x5118('0x2b')][_0x5118('0x49')]({'where':{'id':_0x3c8bfb['params']['id']}})[_0x5118('0x40')](handleEntityNotFound(_0x453733,null))[_0x5118('0x40')](removeEntity(_0x453733,null))[_0x5118('0x44')](handleError(_0x453733,null));};exports['getConfigurations']=function(_0x41087e,_0x446815,_0x30ae73){var _0x2a35a3={};var _0x1b571d={};var _0xc01f5e;var _0x54e4a2;return db[_0x5118('0x2b')][_0x5118('0x4b')]({'where':{'id':_0x41087e[_0x5118('0x4a')]['id']}})[_0x5118('0x40')](handleEntityNotFound(_0x446815,null))[_0x5118('0x40')](function(_0x45072e){if(_0x45072e){_0xc01f5e=_0x45072e;_0x1b571d[_0x5118('0x2f')]=_[_0x5118('0x31')](db['VtigerConfiguration'][_0x5118('0x2c')]);_0x1b571d[_0x5118('0x30')]=_[_0x5118('0x31')](_0x41087e[_0x5118('0x30')]);_0x1b571d[_0x5118('0x32')]=_[_0x5118('0x46')](_0x1b571d[_0x5118('0x2f')],_0x1b571d[_0x5118('0x30')]);_0x2a35a3['attributes']=_[_0x5118('0x46')](_0x1b571d[_0x5118('0x2f')],qs[_0x5118('0x34')](_0x41087e['query'][_0x5118('0x34')]));_0x2a35a3['attributes']=_0x2a35a3[_0x5118('0x33')][_0x5118('0x35')]?_0x2a35a3[_0x5118('0x33')]:_0x1b571d[_0x5118('0x2f')];_0x2a35a3[_0x5118('0x38')]=qs[_0x5118('0x39')](_0x41087e[_0x5118('0x30')][_0x5118('0x39')]);_0x2a35a3[_0x5118('0x3c')]=qs[_0x5118('0x32')](_['pick'](_0x41087e[_0x5118('0x30')],_0x1b571d[_0x5118('0x32')]));if(_0x41087e[_0x5118('0x30')][_0x5118('0x3b')]){_0x2a35a3[_0x5118('0x3c')]=_['merge'](_0x2a35a3[_0x5118('0x3c')],{'$or':_[_0x5118('0x2a')](_0x2a35a3[_0x5118('0x33')],function(_0x4976bd){var _0xf0a170={};_0xf0a170[_0x4976bd]={'$like':'%'+_0x41087e[_0x5118('0x30')][_0x5118('0x3b')]+'%'};return _0xf0a170;})});}_0x2a35a3=_[_0x5118('0x3d')]({},_0x2a35a3,_0x41087e['options']);return _0xc01f5e[_0x5118('0x4c')](_0x2a35a3);}})[_0x5118('0x40')](function(_0xb26291){if(_0xb26291){_0x54e4a2=_0xb26291[_0x5118('0x35')];if(!_0x41087e[_0x5118('0x30')][_0x5118('0x4d')]('nolimit')){_0x2a35a3[_0x5118('0x37')]=qs['limit'](_0x41087e[_0x5118('0x30')][_0x5118('0x37')]);_0x2a35a3[_0x5118('0x20')]=qs[_0x5118('0x20')](_0x41087e[_0x5118('0x30')][_0x5118('0x20')]);}return _0xc01f5e[_0x5118('0x4c')](_0x2a35a3);}})[_0x5118('0x40')](function(_0x52ba9b){if(_0x52ba9b){return _0x52ba9b?{'count':_0x54e4a2,'rows':_0x52ba9b}:null;}})['then'](respondWithResult(_0x446815,null))['catch'](handleError(_0x446815,null));};exports['addConfiguration']=function(_0x348bb5,_0x35b1cf,_0x4ae57f){if(_0x348bb5['body']['id']){delete _0x348bb5[_0x5118('0x48')]['id'];}return db[_0x5118('0x2b')][_0x5118('0x4b')]({'where':{'id':_0x348bb5[_0x5118('0x4a')]['id']}})[_0x5118('0x40')](handleEntityNotFound(_0x35b1cf,null))[_0x5118('0x40')](function(_0x341193){if(_0x341193){_0x348bb5[_0x5118('0x48')][_0x5118('0x4e')]=_0x341193['id'];_0x348bb5[_0x5118('0x48')]['Subjects']=integrations[_0x5118('0x4f')](_0x348bb5[_0x5118('0x48')][_0x5118('0x50')],_0x348bb5[_0x5118('0x48')][_0x5118('0x2e')]);_0x348bb5[_0x5118('0x48')][_0x5118('0x51')]=integrations[_0x5118('0x52')](_0x348bb5[_0x5118('0x48')][_0x5118('0x50')],_0x348bb5['body'][_0x5118('0x2e')]);return db['VtigerConfiguration'][_0x5118('0x47')](_0x348bb5['body'],{'include':[{'model':db[_0x5118('0x53')],'as':_0x5118('0x54')},{'model':db['VtigerField'],'as':_0x5118('0x51')}]});}return null;})['then'](respondWithResult(_0x35b1cf,null))[_0x5118('0x44')](handleError(_0x35b1cf,null));};var md5=require(_0x5118('0x55'));exports[_0x5118('0x56')]=function(_0x445480,_0x541f4f,_0x4af73f){var _0x4a718d=null;var _0x329bbc=null;var _0x486f5b=null;var _0x1ee088=null;var _0x3706bc='';return db[_0x5118('0x2b')][_0x5118('0x4b')]({'where':{'id':_0x445480[_0x5118('0x4a')]['id']},'attributes':['id',_0x5118('0x29'),_0x5118('0x57'),_0x5118('0x58'),'moduleName',_0x5118('0x59'),'serverUrl',_0x5118('0x5a')]})[_0x5118('0x40')](handleEntityNotFound(_0x541f4f,null))[_0x5118('0x40')](function(_0x235b50){if(_0x235b50){_0x4a718d=_0x235b50[_0x5118('0x57')];_0x329bbc=_0x235b50['accessKey'];_0x486f5b=_0x235b50[_0x5118('0x5b')];_0x3706bc=_0x235b50[_0x5118('0x59')];var _0x3cdd74=_0x3706bc[_0x5118('0x5c')](-0x1);if(_0x3cdd74==='/'){_0x3706bc=_0x3706bc[_0x5118('0x5d')](0x0,_0x3706bc[_0x5118('0x5e')](_0x3cdd74));}_0x1ee088=util[_0x5118('0x5f')](_0x5118('0x60'),_0x3706bc);var _0x360627={'method':'GET','uri':_0x1ee088,'qs':{'operation':'getchallenge','username':_0x235b50[_0x5118('0x57')]},'json':!![]};return rp(_0x360627);}})[_0x5118('0x40')](function(_0x35337b){if(_0x35337b[_0x5118('0x61')]){var _0x330864={'method':_0x5118('0x62'),'uri':_0x1ee088,'form':{'operation':_0x5118('0x63'),'username':_0x4a718d,'accessKey':md5(_0x35337b['result'][_0x5118('0x64')]+_0x329bbc)},'json':!![]};return rp(_0x330864);}})[_0x5118('0x40')](function(_0x515d61){if(_0x515d61[_0x5118('0x61')]){var _0x46fd9f={'method':'GET','uri':_0x1ee088,'qs':{'operation':_0x5118('0x65'),'username':_0x4a718d,'sessionName':_0x515d61[_0x5118('0x66')][_0x5118('0x67')],'elementType':_0x486f5b},'json':!![]};return rp(_0x46fd9f);}})[_0x5118('0x40')](function(_0x56a921){if(_0x56a921['success']){var _0x472d8b=[_0x5118('0x68'),'reference',_0x5118('0x69')];_['remove'](_0x56a921['result'][_0x5118('0x34')],function(_0x233716){return _0x472d8b[_0x5118('0x6a')](_0x233716[_0x5118('0x2e')][_0x5118('0x29')]);});_[_0x5118('0x6b')](_0x56a921[_0x5118('0x66')]['fields'],function(_0x50c0e0){return _0x50c0e0['editable']===_0x5118('0x6c');});return{'count':_0x56a921['result'][_0x5118('0x34')][_0x5118('0x35')],'rows':_[_0x5118('0x2a')](_0x56a921[_0x5118('0x66')][_0x5118('0x34')],function(_0xdf4e39){return{'id':_0xdf4e39[_0x5118('0x29')],'name':_0xdf4e39[_0x5118('0x6d')],'custom':_[_0x5118('0x6e')](_0xdf4e39[_0x5118('0x29')],'cf_')?!![]:![],'options':_0xdf4e39[_0x5118('0x2e')][_0x5118('0x29')]==='picklist'&&_0xdf4e39[_0x5118('0x2e')][_0x5118('0x6f')][_0x5118('0x35')]>0x0?_[_0x5118('0x2a')](_0xdf4e39[_0x5118('0x2e')][_0x5118('0x6f')],function(_0x14561a){return{'name':_0x14561a[_0x5118('0x6d')],'value':_0x14561a[_0x5118('0x70')]};}):[]};})};}})[_0x5118('0x40')](respondWithResult(_0x541f4f,null))['catch'](function(_0x2f9f0e){console[_0x5118('0x71')](_0x5118('0x72')+_0x2f9f0e);var _0x32ca9a=_0x445480[_0x5118('0x30')]['test']?0x1f4:_0x2f9f0e[_0x5118('0x73')]||0x1f4;logger[_0x5118('0x74')](_0x5118('0x75'),_0x5118('0x56'),_0x32ca9a,JSON[_0x5118('0x76')](_0x2f9f0e));delete _0x2f9f0e[_0x5118('0x29')];if(_0x32ca9a===0x191){_0x32ca9a=0x190;}_0x541f4f[_0x5118('0x1d')](_0x32ca9a)[_0x5118('0x77')](_0x445480[_0x5118('0x30')][_0x5118('0x78')]?{'message':_0x5118('0x79'),'statusCode':_0x2f9f0e['statusCode']}:_0x2f9f0e);});}; \ No newline at end of file +var _0x8596=['bluebird','mustache','util','path','sox','ejs','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','VtigerAccount','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','options','find','create','body','getConfigurations','findOne','VtigerConfiguration','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','type','VtigerField','Descriptions','md5','getFields','username','serverUrl','accessKey','remoteUri','slice','substring','lastIndexOf','format','%s/webservice.php','GET','getchallenge','success','POST','result','token','describe','sessionName','autogenerated','reference','owner','remove','includes','editable','label','startsWith','picklist','picklistValues','value','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','request-promise','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8596,0x76));var _0x6859=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x8596[_0x502c7d];return _0x30b7ed;};'use strict';var emlformat=require(_0x6859('0x0'));var rimraf=require(_0x6859('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6859('0x2'));var moment=require(_0x6859('0x3'));var BPromise=require(_0x6859('0x4'));var Mustache=require(_0x6859('0x5'));var util=require(_0x6859('0x6'));var path=require(_0x6859('0x7'));var sox=require(_0x6859('0x8'));var csv=require('to-csv');var ejs=require(_0x6859('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x6859('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x6859('0xb'));var toCsv=require(_0x6859('0xc'));var querystring=require(_0x6859('0xd'));var Papa=require(_0x6859('0xe'));var Redis=require(_0x6859('0xf'));var authService=require(_0x6859('0x10'));var qs=require(_0x6859('0x11'));var as=require(_0x6859('0x12'));var hardwareService=require(_0x6859('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x6859('0x14'));var config=require(_0x6859('0x15'));var licenseUtil=require(_0x6859('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0x6859('0x17'));function respondWithStatusCode(_0x140e93,_0x30263c){_0x30263c=_0x30263c||0xcc;return function(_0x13258d){if(_0x13258d){return _0x140e93['sendStatus'](_0x30263c);}return _0x140e93[_0x6859('0x18')](_0x30263c)[_0x6859('0x19')]();};}function respondWithResult(_0xc45d00,_0x5849d6){_0x5849d6=_0x5849d6||0xc8;return function(_0x5b5cf2){if(_0x5b5cf2){return _0xc45d00['status'](_0x5849d6)['json'](_0x5b5cf2);}};}function respondWithFilteredResult(_0x573940,_0x3c9c3c){return function(_0x41477d){if(_0x41477d){var _0x1c8ed0=typeof _0x3c9c3c[_0x6859('0x1a')]===_0x6859('0x1b')&&typeof _0x3c9c3c['limit']===_0x6859('0x1b');var _0x100310=_0x41477d['count'];var _0x1bb45f=_0x1c8ed0?0x0:_0x3c9c3c['offset'];var _0x1c2637=_0x1c8ed0?_0x41477d[_0x6859('0x1c')]:_0x3c9c3c[_0x6859('0x1a')]+_0x3c9c3c[_0x6859('0x1d')];var _0x59ecb8;if(_0x1c2637>=_0x100310){_0x1c2637=_0x100310;_0x59ecb8=0xc8;}else{_0x59ecb8=0xce;}_0x573940[_0x6859('0x18')](_0x59ecb8);return _0x573940[_0x6859('0x1e')](_0x6859('0x1f'),_0x1bb45f+'-'+_0x1c2637+'/'+_0x100310)[_0x6859('0x20')](_0x41477d);}return null;};}function patchUpdates(_0x13a41a){return function(_0x261092){try{jsonpatch[_0x6859('0x21')](_0x261092,_0x13a41a,!![]);}catch(_0x56742b){return BPromise[_0x6859('0x22')](_0x56742b);}return _0x261092[_0x6859('0x23')]();};}function saveUpdates(_0x44d2e2,_0x3046e2){return function(_0x2c8744){if(_0x2c8744){return _0x2c8744[_0x6859('0x24')](_0x44d2e2)[_0x6859('0x25')](function(_0x3c3553){return _0x3c3553;});}return null;};}function removeEntity(_0x3bb116,_0x13679e){return function(_0x1a2672){if(_0x1a2672){return _0x1a2672[_0x6859('0x26')]()[_0x6859('0x25')](function(){_0x3bb116['status'](0xcc)[_0x6859('0x19')]();});}};}function handleEntityNotFound(_0x23f4f5,_0x3d4b59){return function(_0x228a54){if(!_0x228a54){_0x23f4f5[_0x6859('0x27')](0x194);}return _0x228a54;};}function handleError(_0x32c169,_0x203573){_0x203573=_0x203573||0x1f4;return function(_0x428d73){logger[_0x6859('0x28')](_0x428d73[_0x6859('0x29')]);if(_0x428d73[_0x6859('0x2a')]){delete _0x428d73[_0x6859('0x2a')];}_0x32c169[_0x6859('0x18')](_0x203573)[_0x6859('0x2b')](_0x428d73);};}exports[_0x6859('0x2c')]=function(_0x31c99,_0x26708a){var _0x359bc1={},_0x11ec88={},_0x341409={'count':0x0,'rows':[]};var _0x12fecc=_[_0x6859('0x2d')](db[_0x6859('0x2e')][_0x6859('0x2f')],function(_0x5ecee1){return{'name':_0x5ecee1[_0x6859('0x30')],'type':_0x5ecee1['type']['key']};});_0x11ec88[_0x6859('0x31')]=_[_0x6859('0x2d')](_0x12fecc,_0x6859('0x2a'));_0x11ec88[_0x6859('0x32')]=_[_0x6859('0x33')](_0x31c99[_0x6859('0x32')]);_0x11ec88[_0x6859('0x34')]=_[_0x6859('0x35')](_0x11ec88['model'],_0x11ec88[_0x6859('0x32')]);_0x359bc1[_0x6859('0x36')]=_['intersection'](_0x11ec88['model'],qs[_0x6859('0x37')](_0x31c99[_0x6859('0x32')][_0x6859('0x37')]));_0x359bc1[_0x6859('0x36')]=_0x359bc1['attributes'][_0x6859('0x38')]?_0x359bc1[_0x6859('0x36')]:_0x11ec88[_0x6859('0x31')];if(!_0x31c99[_0x6859('0x32')][_0x6859('0x39')]('nolimit')){_0x359bc1[_0x6859('0x1d')]=qs[_0x6859('0x1d')](_0x31c99[_0x6859('0x32')][_0x6859('0x1d')]);_0x359bc1['offset']=qs[_0x6859('0x1a')](_0x31c99[_0x6859('0x32')][_0x6859('0x1a')]);}_0x359bc1['order']=qs[_0x6859('0x3a')](_0x31c99[_0x6859('0x32')][_0x6859('0x3a')]);_0x359bc1[_0x6859('0x3b')]=qs['filters'](_[_0x6859('0x3c')](_0x31c99['query'],_0x11ec88[_0x6859('0x34')]),_0x12fecc);if(_0x31c99[_0x6859('0x32')][_0x6859('0x3d')]){_0x359bc1[_0x6859('0x3b')]=_[_0x6859('0x3e')](_0x359bc1['where'],{'$or':_['map'](_0x12fecc,function(_0x21a8eb){if(_0x21a8eb['type']!==_0x6859('0x3f')){var _0x2be957={};_0x2be957[_0x21a8eb[_0x6859('0x2a')]]={'$like':'%'+_0x31c99[_0x6859('0x32')]['filter']+'%'};return _0x2be957;}})});}_0x359bc1=_[_0x6859('0x3e')]({},_0x359bc1,_0x31c99['options']);var _0x1fca19={'where':_0x359bc1[_0x6859('0x3b')]};return db[_0x6859('0x2e')][_0x6859('0x1c')](_0x1fca19)[_0x6859('0x25')](function(_0x4bad18){_0x341409[_0x6859('0x1c')]=_0x4bad18;if(_0x31c99[_0x6859('0x32')][_0x6859('0x40')]){_0x359bc1[_0x6859('0x41')]=[{'all':!![]}];}return db[_0x6859('0x2e')]['findAll'](_0x359bc1);})[_0x6859('0x25')](function(_0x139329){_0x341409[_0x6859('0x42')]=_0x139329;return _0x341409;})[_0x6859('0x25')](respondWithFilteredResult(_0x26708a,_0x359bc1))[_0x6859('0x43')](handleError(_0x26708a,null));};exports[_0x6859('0x44')]=function(_0x1db500,_0x5eb962){var _0x33cf13={'raw':![],'where':{'id':_0x1db500[_0x6859('0x45')]['id']}},_0x5b934d={};_0x5b934d[_0x6859('0x31')]=_['keys'](db[_0x6859('0x2e')][_0x6859('0x2f')]);_0x5b934d['query']=_[_0x6859('0x33')](_0x1db500[_0x6859('0x32')]);_0x5b934d[_0x6859('0x34')]=_[_0x6859('0x35')](_0x5b934d['model'],_0x5b934d['query']);_0x33cf13['attributes']=_[_0x6859('0x35')](_0x5b934d[_0x6859('0x31')],qs['fields'](_0x1db500['query'][_0x6859('0x37')]));_0x33cf13[_0x6859('0x36')]=_0x33cf13['attributes'][_0x6859('0x38')]?_0x33cf13[_0x6859('0x36')]:_0x5b934d[_0x6859('0x31')];if(_0x1db500['query']['includeAll']){_0x33cf13[_0x6859('0x41')]=[{'all':!![]}];}_0x33cf13=_[_0x6859('0x3e')]({},_0x33cf13,_0x1db500[_0x6859('0x46')]);return db['VtigerAccount'][_0x6859('0x47')](_0x33cf13)['then'](handleEntityNotFound(_0x5eb962,null))[_0x6859('0x25')](respondWithResult(_0x5eb962,null))[_0x6859('0x43')](handleError(_0x5eb962,null));};exports[_0x6859('0x48')]=function(_0x3c814a,_0x52c93b){return db[_0x6859('0x2e')][_0x6859('0x48')](_0x3c814a['body'],{})['then'](respondWithResult(_0x52c93b,0xc9))['catch'](handleError(_0x52c93b,null));};exports[_0x6859('0x24')]=function(_0x4a02f5,_0x2c0c72){if(_0x4a02f5[_0x6859('0x49')]['id']){delete _0x4a02f5[_0x6859('0x49')]['id'];}return db[_0x6859('0x2e')][_0x6859('0x47')]({'where':{'id':_0x4a02f5[_0x6859('0x45')]['id']}})[_0x6859('0x25')](handleEntityNotFound(_0x2c0c72,null))[_0x6859('0x25')](saveUpdates(_0x4a02f5[_0x6859('0x49')],null))[_0x6859('0x25')](respondWithResult(_0x2c0c72,null))['catch'](handleError(_0x2c0c72,null));};exports[_0x6859('0x26')]=function(_0x2d847c,_0x3c9e63){return db[_0x6859('0x2e')][_0x6859('0x47')]({'where':{'id':_0x2d847c[_0x6859('0x45')]['id']}})[_0x6859('0x25')](handleEntityNotFound(_0x3c9e63,null))['then'](removeEntity(_0x3c9e63,null))[_0x6859('0x43')](handleError(_0x3c9e63,null));};exports[_0x6859('0x4a')]=function(_0x35c3dc,_0x8a3a41,_0xfc8267){var _0x34ce7d={};var _0x5ec82b={};var _0xf3910b;var _0x325bb1;return db[_0x6859('0x2e')][_0x6859('0x4b')]({'where':{'id':_0x35c3dc['params']['id']}})[_0x6859('0x25')](handleEntityNotFound(_0x8a3a41,null))[_0x6859('0x25')](function(_0x5646d2){if(_0x5646d2){_0xf3910b=_0x5646d2;_0x5ec82b[_0x6859('0x31')]=_[_0x6859('0x33')](db[_0x6859('0x4c')]['rawAttributes']);_0x5ec82b[_0x6859('0x32')]=_[_0x6859('0x33')](_0x35c3dc[_0x6859('0x32')]);_0x5ec82b[_0x6859('0x34')]=_[_0x6859('0x35')](_0x5ec82b[_0x6859('0x31')],_0x5ec82b[_0x6859('0x32')]);_0x34ce7d[_0x6859('0x36')]=_[_0x6859('0x35')](_0x5ec82b[_0x6859('0x31')],qs[_0x6859('0x37')](_0x35c3dc['query']['fields']));_0x34ce7d[_0x6859('0x36')]=_0x34ce7d[_0x6859('0x36')][_0x6859('0x38')]?_0x34ce7d[_0x6859('0x36')]:_0x5ec82b[_0x6859('0x31')];_0x34ce7d['order']=qs[_0x6859('0x3a')](_0x35c3dc['query'][_0x6859('0x3a')]);_0x34ce7d[_0x6859('0x3b')]=qs[_0x6859('0x34')](_['pick'](_0x35c3dc[_0x6859('0x32')],_0x5ec82b[_0x6859('0x34')]));if(_0x35c3dc['query'][_0x6859('0x3d')]){_0x34ce7d[_0x6859('0x3b')]=_[_0x6859('0x3e')](_0x34ce7d[_0x6859('0x3b')],{'$or':_[_0x6859('0x2d')](_0x34ce7d[_0x6859('0x36')],function(_0x5696c0){var _0x404d7e={};_0x404d7e[_0x5696c0]={'$like':'%'+_0x35c3dc['query'][_0x6859('0x3d')]+'%'};return _0x404d7e;})});}_0x34ce7d=_[_0x6859('0x3e')]({},_0x34ce7d,_0x35c3dc[_0x6859('0x46')]);return _0xf3910b[_0x6859('0x4a')](_0x34ce7d);}})[_0x6859('0x25')](function(_0x2ab645){if(_0x2ab645){_0x325bb1=_0x2ab645[_0x6859('0x38')];if(!_0x35c3dc[_0x6859('0x32')]['hasOwnProperty'](_0x6859('0x4d'))){_0x34ce7d[_0x6859('0x1d')]=qs['limit'](_0x35c3dc['query'][_0x6859('0x1d')]);_0x34ce7d[_0x6859('0x1a')]=qs[_0x6859('0x1a')](_0x35c3dc[_0x6859('0x32')][_0x6859('0x1a')]);}return _0xf3910b[_0x6859('0x4a')](_0x34ce7d);}})[_0x6859('0x25')](function(_0x4de07c){if(_0x4de07c){return _0x4de07c?{'count':_0x325bb1,'rows':_0x4de07c}:null;}})[_0x6859('0x25')](respondWithResult(_0x8a3a41,null))[_0x6859('0x43')](handleError(_0x8a3a41,null));};exports[_0x6859('0x4e')]=function(_0x24f08c,_0x145a7f,_0x57808b){if(_0x24f08c['body']['id']){delete _0x24f08c['body']['id'];}return db[_0x6859('0x2e')][_0x6859('0x4b')]({'where':{'id':_0x24f08c['params']['id']}})['then'](handleEntityNotFound(_0x145a7f,null))[_0x6859('0x25')](function(_0x31c2e8){if(_0x31c2e8){_0x24f08c[_0x6859('0x49')][_0x6859('0x4f')]=_0x31c2e8['id'];_0x24f08c[_0x6859('0x49')][_0x6859('0x50')]=integrations[_0x6859('0x51')](_0x24f08c['body'][_0x6859('0x52')],_0x24f08c['body']['type']);_0x24f08c['body']['Descriptions']=integrations[_0x6859('0x53')](_0x24f08c[_0x6859('0x49')][_0x6859('0x52')],_0x24f08c[_0x6859('0x49')][_0x6859('0x54')]);return db['VtigerConfiguration'][_0x6859('0x48')](_0x24f08c[_0x6859('0x49')],{'include':[{'model':db[_0x6859('0x55')],'as':_0x6859('0x50')},{'model':db[_0x6859('0x55')],'as':_0x6859('0x56')}]});}return null;})['then'](respondWithResult(_0x145a7f,null))[_0x6859('0x43')](handleError(_0x145a7f,null));};var md5=require(_0x6859('0x57'));exports[_0x6859('0x58')]=function(_0xe20b1e,_0x51feed,_0x4ce20b){var _0x1fc6ca=null;var _0x269439=null;var _0x18a1fd=null;var _0x10b5a5=null;var _0x253a90='';return db[_0x6859('0x2e')][_0x6859('0x4b')]({'where':{'id':_0xe20b1e[_0x6859('0x45')]['id']},'attributes':['id','name',_0x6859('0x59'),'description','moduleName','remoteUri',_0x6859('0x5a'),'accessKey']})[_0x6859('0x25')](handleEntityNotFound(_0x51feed,null))[_0x6859('0x25')](function(_0x707bfb){if(_0x707bfb){_0x1fc6ca=_0x707bfb[_0x6859('0x59')];_0x269439=_0x707bfb[_0x6859('0x5b')];_0x18a1fd=_0x707bfb['moduleName'];_0x253a90=_0x707bfb[_0x6859('0x5c')];var _0x3c6401=_0x253a90[_0x6859('0x5d')](-0x1);if(_0x3c6401==='/'){_0x253a90=_0x253a90[_0x6859('0x5e')](0x0,_0x253a90[_0x6859('0x5f')](_0x3c6401));}_0x10b5a5=util[_0x6859('0x60')](_0x6859('0x61'),_0x253a90);var _0x76394a={'method':_0x6859('0x62'),'uri':_0x10b5a5,'qs':{'operation':_0x6859('0x63'),'username':_0x707bfb[_0x6859('0x59')]},'json':!![]};return rp(_0x76394a);}})[_0x6859('0x25')](function(_0x397675){if(_0x397675[_0x6859('0x64')]){var _0x5656ac={'method':_0x6859('0x65'),'uri':_0x10b5a5,'form':{'operation':'login','username':_0x1fc6ca,'accessKey':md5(_0x397675[_0x6859('0x66')][_0x6859('0x67')]+_0x269439)},'json':!![]};return rp(_0x5656ac);}})['then'](function(_0x372066){if(_0x372066[_0x6859('0x64')]){var _0x93753b={'method':_0x6859('0x62'),'uri':_0x10b5a5,'qs':{'operation':_0x6859('0x68'),'username':_0x1fc6ca,'sessionName':_0x372066[_0x6859('0x66')][_0x6859('0x69')],'elementType':_0x18a1fd},'json':!![]};return rp(_0x93753b);}})[_0x6859('0x25')](function(_0xd903df){if(_0xd903df[_0x6859('0x64')]){var _0x2d192a=[_0x6859('0x6a'),_0x6859('0x6b'),_0x6859('0x6c')];_[_0x6859('0x6d')](_0xd903df['result'][_0x6859('0x37')],function(_0x748b3){return _0x2d192a[_0x6859('0x6e')](_0x748b3[_0x6859('0x54')]['name']);});_[_0x6859('0x6d')](_0xd903df[_0x6859('0x66')][_0x6859('0x37')],function(_0x503f3c){return _0x503f3c[_0x6859('0x6f')]==='false';});return{'count':_0xd903df[_0x6859('0x66')][_0x6859('0x37')]['length'],'rows':_[_0x6859('0x2d')](_0xd903df[_0x6859('0x66')][_0x6859('0x37')],function(_0x43cf5b){return{'id':_0x43cf5b[_0x6859('0x2a')],'name':_0x43cf5b[_0x6859('0x70')],'custom':_[_0x6859('0x71')](_0x43cf5b[_0x6859('0x2a')],'cf_')?!![]:![],'options':_0x43cf5b[_0x6859('0x54')][_0x6859('0x2a')]===_0x6859('0x72')&&_0x43cf5b[_0x6859('0x54')][_0x6859('0x73')]['length']>0x0?_[_0x6859('0x2d')](_0x43cf5b[_0x6859('0x54')][_0x6859('0x73')],function(_0x2f10dc){return{'name':_0x2f10dc['label'],'value':_0x2f10dc[_0x6859('0x74')]};}):[]};})};}})['then'](respondWithResult(_0x51feed,null))[_0x6859('0x43')](function(_0x170d62){console['log'](_0x6859('0x75')+_0x170d62);var _0x5ba359=_0xe20b1e[_0x6859('0x32')][_0x6859('0x76')]?0x1f4:_0x170d62[_0x6859('0x77')]||0x1f4;logger[_0x6859('0x28')](_0x6859('0x78'),'getFields',_0x5ba359,JSON[_0x6859('0x79')](_0x170d62));delete _0x170d62[_0x6859('0x2a')];if(_0x5ba359===0x191){_0x5ba359=0x190;}_0x51feed[_0x6859('0x18')](_0x5ba359)[_0x6859('0x2b')](_0xe20b1e[_0x6859('0x32')][_0x6859('0x76')]?{'message':'Wrong\x20credentials','statusCode':_0x170d62[_0x6859('0x77')]}:_0x170d62);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index cc7b1e0..584f7dc 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 _0xf539=['rimraf','../../config/environment','./intVtigerAccount.attributes','exports','define','VtigerAccount','int_vtiger_accounts','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x474ed8,_0x189131){var _0x33f09d=function(_0x1bd7e5){while(--_0x1bd7e5){_0x474ed8['push'](_0x474ed8['shift']());}};_0x33f09d(++_0x189131);}(_0xf539,0x180));var _0x9f53=function(_0x293253,_0x539cd3){_0x293253=_0x293253-0x0;var _0x111c43=_0xf539[_0x293253];return _0x111c43;};'use strict';var _=require(_0x9f53('0x0'));var util=require(_0x9f53('0x1'));var logger=require(_0x9f53('0x2'))(_0x9f53('0x3'));var moment=require('moment');var BPromise=require(_0x9f53('0x4'));var rp=require(_0x9f53('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9f53('0x6'));var config=require(_0x9f53('0x7'));var attributes=require(_0x9f53('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x9f53('0x9')]=function(_0x23a2c8,_0x12eff6){return _0x23a2c8[_0x9f53('0xa')](_0x9f53('0xb'),attributes,{'tableName':_0x9f53('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x617a=['../../components/integrations/configuration','exports','VtigerAccount','int_vtiger_accounts','lodash','../../config/logger','api','moment','bluebird','path','./intVtigerAccount.attributes'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x617a,0xf6));var _0xa617=function(_0x492e84,_0x1fd145){_0x492e84=_0x492e84-0x0;var _0x3c947d=_0x617a[_0x492e84];return _0x3c947d;};'use strict';var _=require(_0xa617('0x0'));var util=require('util');var logger=require(_0xa617('0x1'))(_0xa617('0x2'));var moment=require(_0xa617('0x3'));var BPromise=require(_0xa617('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa617('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa617('0x6'));var integrations=require(_0xa617('0x7'));module[_0xa617('0x8')]=function(_0x2d02fa,_0x4bb88a){return _0x2d02fa['define'](_0xa617('0x9'),attributes,{'tableName':_0xa617('0xa'),'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 c1d0b50..3bb388a 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 _0x8f59=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','error','message','result','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','attributes','limit','map','include','model','then','debug','catch','ShowVtigerAccount','stringify','lodash','util','moment'];(function(_0x528575,_0x2e067d){var _0x3063b7=function(_0x1ee183){while(--_0x1ee183){_0x528575['push'](_0x528575['shift']());}};_0x3063b7(++_0x2e067d);}(_0x8f59,0x11d));var _0x98f5=function(_0x11539d,_0x2b3499){_0x11539d=_0x11539d-0x0;var _0x43e15e=_0x8f59[_0x11539d];return _0x43e15e;};'use strict';var _=require(_0x98f5('0x0'));var util=require(_0x98f5('0x1'));var moment=require(_0x98f5('0x2'));var BPromise=require(_0x98f5('0x3'));var rs=require(_0x98f5('0x4'));var fs=require('fs');var Redis=require(_0x98f5('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x98f5('0x6'));var logger=require(_0x98f5('0x7'))(_0x98f5('0x8'));var config=require(_0x98f5('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x98f5('0xa')][_0x98f5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2e2acf,_0x5869ee,_0x5e91b3){return new BPromise(function(_0x109417,_0x1cd8a8){return client[_0x98f5('0xc')](_0x2e2acf,_0x5e91b3)['then'](function(_0x456329){logger[_0x98f5('0xd')](_0x98f5('0xe'),_0x5869ee,_0x98f5('0xf'));logger['debug'](_0x98f5('0x10'),_0x5869ee,'request\x20sent',JSON['stringify'](_0x456329));if(_0x456329[_0x98f5('0x11')]){if(_0x456329[_0x98f5('0x11')]['code']===0x1f4){logger[_0x98f5('0x11')](_0x98f5('0xe'),_0x5869ee,_0x456329[_0x98f5('0x11')][_0x98f5('0x12')]);return _0x1cd8a8(_0x456329[_0x98f5('0x11')][_0x98f5('0x12')]);}logger['error'](_0x98f5('0xe'),_0x5869ee,_0x456329[_0x98f5('0x11')]['message']);return _0x109417(_0x456329[_0x98f5('0x11')][_0x98f5('0x12')]);}else{logger[_0x98f5('0xd')]('VtigerAccount,\x20%s,\x20%s',_0x5869ee,_0x98f5('0xf'));_0x109417(_0x456329[_0x98f5('0x13')][_0x98f5('0x12')]);}})['catch'](function(_0x440cfa){logger[_0x98f5('0x11')]('VtigerAccount,\x20%s,\x20%s',_0x5869ee,_0x440cfa);_0x1cd8a8(_0x440cfa);});});}exports[_0x98f5('0x14')]=function(_0x51a567){var _0x10c57c=this;return new Promise(function(_0x9e42dd,_0x2291d5){return db[_0x98f5('0x15')][_0x98f5('0x16')]({'raw':_0x51a567[_0x98f5('0x17')]?_0x51a567['options'][_0x98f5('0x18')]===undefined?!![]:![]:!![],'where':_0x51a567['options']?_0x51a567[_0x98f5('0x17')][_0x98f5('0x19')]||null:null,'attributes':_0x51a567['options']?_0x51a567[_0x98f5('0x17')][_0x98f5('0x1a')]||null:null,'limit':_0x51a567[_0x98f5('0x17')]?_0x51a567[_0x98f5('0x17')][_0x98f5('0x1b')]||null:null,'include':_0x51a567[_0x98f5('0x17')]?_0x51a567[_0x98f5('0x17')]['include']?_[_0x98f5('0x1c')](_0x51a567['options'][_0x98f5('0x1d')],function(_0x495889){return{'model':db[_0x495889[_0x98f5('0x1e')]],'as':_0x495889['as'],'attributes':_0x495889[_0x98f5('0x1a')],'include':_0x495889[_0x98f5('0x1d')]?_[_0x98f5('0x1c')](_0x495889[_0x98f5('0x1d')],function(_0x18052d){return{'model':db[_0x18052d[_0x98f5('0x1e')]],'as':_0x18052d['as'],'attributes':_0x18052d['attributes'],'include':_0x18052d[_0x98f5('0x1d')]?_[_0x98f5('0x1c')](_0x18052d['include'],function(_0x1a1c55){return{'model':db[_0x1a1c55[_0x98f5('0x1e')]],'as':_0x1a1c55['as'],'attributes':_0x1a1c55[_0x98f5('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x98f5('0x1f')](function(_0x230d1b){logger[_0x98f5('0xd')](_0x98f5('0x14'),_0x51a567);logger[_0x98f5('0x20')]('GetVtigerAccount',_0x51a567,JSON['stringify'](_0x230d1b));_0x9e42dd(_0x230d1b);})[_0x98f5('0x21')](function(_0x71661e){logger[_0x98f5('0x11')](_0x98f5('0x14'),_0x71661e[_0x98f5('0x12')],_0x51a567);_0x2291d5(_0x10c57c[_0x98f5('0x11')](0x1f4,_0x71661e['message']));});});};exports[_0x98f5('0x22')]=function(_0x6d7418){var _0x7a922b=this;return new Promise(function(_0xd20823,_0x1e7138){return db[_0x98f5('0x15')]['find']({'raw':_0x6d7418[_0x98f5('0x17')]?_0x6d7418[_0x98f5('0x17')][_0x98f5('0x18')]===undefined?!![]:![]:!![],'where':_0x6d7418[_0x98f5('0x17')]?_0x6d7418['options'][_0x98f5('0x19')]||null:null,'attributes':_0x6d7418[_0x98f5('0x17')]?_0x6d7418[_0x98f5('0x17')][_0x98f5('0x1a')]||null:null,'include':_0x6d7418[_0x98f5('0x17')]?_0x6d7418[_0x98f5('0x17')][_0x98f5('0x1d')]?_[_0x98f5('0x1c')](_0x6d7418[_0x98f5('0x17')][_0x98f5('0x1d')],function(_0x12d874){return{'model':db[_0x12d874[_0x98f5('0x1e')]],'as':_0x12d874['as'],'attributes':_0x12d874[_0x98f5('0x1a')],'include':_0x12d874[_0x98f5('0x1d')]?_[_0x98f5('0x1c')](_0x12d874[_0x98f5('0x1d')],function(_0x2227f1){return{'model':db[_0x2227f1[_0x98f5('0x1e')]],'as':_0x2227f1['as'],'attributes':_0x2227f1[_0x98f5('0x1a')],'include':_0x2227f1[_0x98f5('0x1d')]?_['map'](_0x2227f1[_0x98f5('0x1d')],function(_0x4aba7a){return{'model':db[_0x4aba7a['model']],'as':_0x4aba7a['as'],'attributes':_0x4aba7a[_0x98f5('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x98f5('0x1f')](function(_0x65c03b){logger[_0x98f5('0xd')]('ShowVtigerAccount',_0x6d7418);logger[_0x98f5('0x20')](_0x98f5('0x22'),_0x6d7418,JSON[_0x98f5('0x23')](_0x65c03b));_0xd20823(_0x65c03b);})['catch'](function(_0x17bfe2){logger[_0x98f5('0x11')]('ShowVtigerAccount',_0x17bfe2[_0x98f5('0x12')],_0x6d7418);_0x1e7138(_0x7a922b[_0x98f5('0x11')](0x1f4,_0x17bfe2[_0x98f5('0x12')]));});});}; \ No newline at end of file +var _0x282b=['map','model','ShowVtigerAccount','VtigerAccount','debug','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','VtigerAccount,\x20%s,\x20%s','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetVtigerAccount','findAll','options','raw','where','attributes','include'];(function(_0x13c810,_0x161a54){var _0xf90256=function(_0x5b5887){while(--_0x5b5887){_0x13c810['push'](_0x13c810['shift']());}};_0xf90256(++_0x161a54);}(_0x282b,0xec));var _0xb282=function(_0x33c1fc,_0x12e019){_0x33c1fc=_0x33c1fc-0x0;var _0x2ae56f=_0x282b[_0x33c1fc];return _0x2ae56f;};'use strict';var _=require(_0xb282('0x0'));var util=require(_0xb282('0x1'));var moment=require(_0xb282('0x2'));var BPromise=require(_0xb282('0x3'));var rs=require(_0xb282('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb282('0x5'));var logger=require('../../config/logger')(_0xb282('0x6'));var config=require(_0xb282('0x7'));var jayson=require(_0xb282('0x8'));var client=jayson[_0xb282('0x9')][_0xb282('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x33635f,_0x4f0410,_0x4a0d28){return new BPromise(function(_0x17fba1,_0x436eaa){return client['request'](_0x33635f,_0x4a0d28)[_0xb282('0xb')](function(_0x20f517){logger[_0xb282('0xc')](_0xb282('0xd'),_0x4f0410,'request\x20sent');logger['debug'](_0xb282('0xe'),_0x4f0410,_0xb282('0xf'),JSON[_0xb282('0x10')](_0x20f517));if(_0x20f517[_0xb282('0x11')]){if(_0x20f517[_0xb282('0x11')]['code']===0x1f4){logger['error'](_0xb282('0xd'),_0x4f0410,_0x20f517[_0xb282('0x11')][_0xb282('0x12')]);return _0x436eaa(_0x20f517[_0xb282('0x11')][_0xb282('0x12')]);}logger['error'](_0xb282('0xd'),_0x4f0410,_0x20f517['error'][_0xb282('0x12')]);return _0x17fba1(_0x20f517[_0xb282('0x11')]['message']);}else{logger['info']('VtigerAccount,\x20%s,\x20%s',_0x4f0410,_0xb282('0xf'));_0x17fba1(_0x20f517[_0xb282('0x13')][_0xb282('0x12')]);}})[_0xb282('0x14')](function(_0x438a05){logger['error'](_0xb282('0xd'),_0x4f0410,_0x438a05);_0x436eaa(_0x438a05);});});}exports[_0xb282('0x15')]=function(_0xca5f12){var _0x45b070=this;return new Promise(function(_0x3f8a3f,_0x492d20){return db['VtigerAccount'][_0xb282('0x16')]({'raw':_0xca5f12[_0xb282('0x17')]?_0xca5f12['options'][_0xb282('0x18')]===undefined?!![]:![]:!![],'where':_0xca5f12[_0xb282('0x17')]?_0xca5f12[_0xb282('0x17')][_0xb282('0x19')]||null:null,'attributes':_0xca5f12[_0xb282('0x17')]?_0xca5f12['options'][_0xb282('0x1a')]||null:null,'limit':_0xca5f12[_0xb282('0x17')]?_0xca5f12[_0xb282('0x17')]['limit']||null:null,'include':_0xca5f12[_0xb282('0x17')]?_0xca5f12[_0xb282('0x17')][_0xb282('0x1b')]?_[_0xb282('0x1c')](_0xca5f12[_0xb282('0x17')]['include'],function(_0x4d624f){return{'model':db[_0x4d624f[_0xb282('0x1d')]],'as':_0x4d624f['as'],'attributes':_0x4d624f[_0xb282('0x1a')],'include':_0x4d624f['include']?_['map'](_0x4d624f[_0xb282('0x1b')],function(_0x114f77){return{'model':db[_0x114f77[_0xb282('0x1d')]],'as':_0x114f77['as'],'attributes':_0x114f77[_0xb282('0x1a')],'include':_0x114f77[_0xb282('0x1b')]?_[_0xb282('0x1c')](_0x114f77['include'],function(_0xa0d7fb){return{'model':db[_0xa0d7fb[_0xb282('0x1d')]],'as':_0xa0d7fb['as'],'attributes':_0xa0d7fb['attributes']};}):[]};}):[]};}):[]:[]})[_0xb282('0xb')](function(_0x38a1f8){logger[_0xb282('0xc')](_0xb282('0x15'),_0xca5f12);logger['debug'](_0xb282('0x15'),_0xca5f12,JSON[_0xb282('0x10')](_0x38a1f8));_0x3f8a3f(_0x38a1f8);})[_0xb282('0x14')](function(_0x433ad5){logger[_0xb282('0x11')](_0xb282('0x15'),_0x433ad5[_0xb282('0x12')],_0xca5f12);_0x492d20(_0x45b070['error'](0x1f4,_0x433ad5[_0xb282('0x12')]));});});};exports[_0xb282('0x1e')]=function(_0x3eb294){var _0xd8780b=this;return new Promise(function(_0x42ef75,_0x5f3ddf){return db[_0xb282('0x1f')]['find']({'raw':_0x3eb294[_0xb282('0x17')]?_0x3eb294[_0xb282('0x17')][_0xb282('0x18')]===undefined?!![]:![]:!![],'where':_0x3eb294['options']?_0x3eb294[_0xb282('0x17')]['where']||null:null,'attributes':_0x3eb294[_0xb282('0x17')]?_0x3eb294[_0xb282('0x17')][_0xb282('0x1a')]||null:null,'include':_0x3eb294[_0xb282('0x17')]?_0x3eb294[_0xb282('0x17')][_0xb282('0x1b')]?_['map'](_0x3eb294[_0xb282('0x17')][_0xb282('0x1b')],function(_0x4ede9d){return{'model':db[_0x4ede9d['model']],'as':_0x4ede9d['as'],'attributes':_0x4ede9d[_0xb282('0x1a')],'include':_0x4ede9d[_0xb282('0x1b')]?_[_0xb282('0x1c')](_0x4ede9d['include'],function(_0x4a76ce){return{'model':db[_0x4a76ce['model']],'as':_0x4a76ce['as'],'attributes':_0x4a76ce[_0xb282('0x1a')],'include':_0x4a76ce[_0xb282('0x1b')]?_[_0xb282('0x1c')](_0x4a76ce[_0xb282('0x1b')],function(_0x17c1e4){return{'model':db[_0x17c1e4[_0xb282('0x1d')]],'as':_0x17c1e4['as'],'attributes':_0x17c1e4[_0xb282('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3dc171){logger['info'](_0xb282('0x1e'),_0x3eb294);logger[_0xb282('0x20')](_0xb282('0x1e'),_0x3eb294,JSON['stringify'](_0x3dc171));_0x42ef75(_0x3dc171);})[_0xb282('0x14')](function(_0x4beef2){logger[_0xb282('0x11')](_0xb282('0x1e'),_0x4beef2[_0xb282('0x12')],_0x3eb294);_0x5f3ddf(_0xd8780b[_0xb282('0x11')](0x1f4,_0x4beef2['message']));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 6abfd01..f9380b0 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 _0x34da=['./intVtigerConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x23283f,_0x2ac4b9){var _0x1da232=function(_0x3f8960){while(--_0x3f8960){_0x23283f['push'](_0x23283f['shift']());}};_0x1da232(++_0x2ac4b9);}(_0x34da,0x14a));var _0xa34d=function(_0x3a4b08,_0x4e373d){_0x3a4b08=_0x3a4b08-0x0;var _0x6bf83c=_0x34da[_0x3a4b08];return _0x6bf83c;};'use strict';var multer=require('multer');var util=require(_0xa34d('0x0'));var path=require(_0xa34d('0x1'));var timeout=require(_0xa34d('0x2'));var express=require(_0xa34d('0x3'));var router=express['Router']();var fs_extra=require(_0xa34d('0x4'));var auth=require(_0xa34d('0x5'));var interaction=require(_0xa34d('0x6'));var config=require(_0xa34d('0x7'));var controller=require(_0xa34d('0x8'));router[_0xa34d('0x9')]('/',auth[_0xa34d('0xa')](),controller['index']);router[_0xa34d('0x9')](_0xa34d('0xb'),auth[_0xa34d('0xa')](),controller[_0xa34d('0xc')]);router[_0xa34d('0x9')](_0xa34d('0xd'),auth['isAuthenticated'](),controller[_0xa34d('0xe')]);router[_0xa34d('0x9')](_0xa34d('0xf'),auth[_0xa34d('0xa')](),controller[_0xa34d('0x10')]);router['get'](_0xa34d('0x11'),auth[_0xa34d('0xa')](),controller[_0xa34d('0x12')]);router[_0xa34d('0x13')]('/',auth[_0xa34d('0xa')](),controller[_0xa34d('0x14')]);router[_0xa34d('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xa34d('0x16')]);router[_0xa34d('0x17')](_0xa34d('0xb'),auth['isAuthenticated'](),controller[_0xa34d('0x18')]);module[_0xa34d('0x19')]=router; \ No newline at end of file +var _0xde29=['show','isAuthenticated','getFields','getDescriptions','post','create','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','index','/:id'];(function(_0x18c8ef,_0xc71ce3){var _0x422448=function(_0x30d392){while(--_0x30d392){_0x18c8ef['push'](_0x18c8ef['shift']());}};_0x422448(++_0xc71ce3);}(_0xde29,0x146));var _0x9de2=function(_0x241119,_0x426e1e){_0x241119=_0x241119-0x0;var _0x417add=_0xde29[_0x241119];return _0x417add;};'use strict';var multer=require('multer');var util=require(_0x9de2('0x0'));var path=require('path');var timeout=require(_0x9de2('0x1'));var express=require(_0x9de2('0x2'));var router=express[_0x9de2('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x9de2('0x4'));var config=require(_0x9de2('0x5'));var controller=require(_0x9de2('0x6'));router[_0x9de2('0x7')]('/',auth['isAuthenticated'](),controller[_0x9de2('0x8')]);router[_0x9de2('0x7')](_0x9de2('0x9'),auth['isAuthenticated'](),controller[_0x9de2('0xa')]);router['get']('/:id/fields',auth[_0x9de2('0xb')](),controller[_0x9de2('0xc')]);router['get']('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0x9de2('0x7')]('/:id/descriptions',auth[_0x9de2('0xb')](),controller[_0x9de2('0xd')]);router[_0x9de2('0xe')]('/',auth[_0x9de2('0xb')](),controller[_0x9de2('0xf')]);router[_0x9de2('0x10')](_0x9de2('0x9'),auth[_0x9de2('0xb')](),controller[_0x9de2('0x11')]);router[_0x9de2('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x9de2('0x13')]);module[_0x9de2('0x14')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 7cc46b3..7933d8d 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 _0x7ed8=['sequelize','STRING'];(function(_0x2e9cf9,_0x1bf743){var _0x5d0124=function(_0x20467c){while(--_0x20467c){_0x2e9cf9['push'](_0x2e9cf9['shift']());}};_0x5d0124(++_0x1bf743);}(_0x7ed8,0x114));var _0x87ed=function(_0x180184,_0x45ab66){_0x180184=_0x180184-0x0;var _0x3d14e7=_0x7ed8[_0x180184];return _0x3d14e7;};'use strict';var Sequelize=require(_0x87ed('0x0'));module['exports']={'name':{'type':Sequelize[_0x87ed('0x1')]},'description':{'type':Sequelize[_0x87ed('0x1')]}}; \ No newline at end of file +var _0xac29=['exports','sequelize'];(function(_0x5679fb,_0x4ba54c){var _0x5df78a=function(_0x56b1fd){while(--_0x56b1fd){_0x5679fb['push'](_0x5679fb['shift']());}};_0x5df78a(++_0x4ba54c);}(_0xac29,0xe7));var _0x9ac2=function(_0x21fc80,_0x4bd215){_0x21fc80=_0x21fc80-0x0;var _0x4b44ea=_0xac29[_0x21fc80];return _0x4b44ea;};'use strict';var Sequelize=require(_0x9ac2('0x0'));module[_0x9ac2('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 42178aa..1799f0d 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 _0xd0db=['destroy','error','stack','name','send','index','map','VtigerConfiguration','rawAttributes','fieldName','type','key','model','query','filters','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','include','findAll','rows','catch','params','keys','intersection','includeAll','create','body','find','getFields','VtigerField','length','order','options','getSubjects','findOne','getDescriptions','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','update','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd0db,0x7c));var _0xbd0d=function(_0xac0068,_0x52bb67){_0xac0068=_0xac0068-0x0;var _0x353b41=_0xd0db[_0xac0068];return _0x353b41;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbd0d('0x0'));var zipdir=require(_0xbd0d('0x1'));var jsonpatch=require(_0xbd0d('0x2'));var rp=require('request-promise');var moment=require(_0xbd0d('0x3'));var BPromise=require(_0xbd0d('0x4'));var Mustache=require(_0xbd0d('0x5'));var util=require(_0xbd0d('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbd0d('0x7'));var _=require(_0xbd0d('0x8'));var squel=require(_0xbd0d('0x9'));var crypto=require('crypto');var jsforce=require(_0xbd0d('0xa'));var deskjs=require(_0xbd0d('0xb'));var toCsv=require(_0xbd0d('0xc'));var querystring=require(_0xbd0d('0xd'));var Papa=require('papaparse');var Redis=require(_0xbd0d('0xe'));var authService=require(_0xbd0d('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbd0d('0x10'));var logger=require(_0xbd0d('0x11'))(_0xbd0d('0x12'));var utils=require(_0xbd0d('0x13'));var config=require(_0xbd0d('0x14'));var licenseUtil=require(_0xbd0d('0x15'));var db=require(_0xbd0d('0x16'))['db'];function respondWithStatusCode(_0x27812a,_0x13e3f2){_0x13e3f2=_0x13e3f2||0xcc;return function(_0x9e7bdf){if(_0x9e7bdf){return _0x27812a[_0xbd0d('0x17')](_0x13e3f2);}return _0x27812a[_0xbd0d('0x18')](_0x13e3f2)[_0xbd0d('0x19')]();};}function respondWithResult(_0x112f2d,_0x19fdf5){_0x19fdf5=_0x19fdf5||0xc8;return function(_0x432f7d){if(_0x432f7d){return _0x112f2d[_0xbd0d('0x18')](_0x19fdf5)[_0xbd0d('0x1a')](_0x432f7d);}};}function respondWithFilteredResult(_0x514ff3,_0x2791d7){return function(_0x578feb){if(_0x578feb){var _0x580feb=typeof _0x2791d7['offset']===_0xbd0d('0x1b')&&typeof _0x2791d7[_0xbd0d('0x1c')]===_0xbd0d('0x1b');var _0x13de90=_0x578feb[_0xbd0d('0x1d')];var _0x4f308f=_0x580feb?0x0:_0x2791d7[_0xbd0d('0x1e')];var _0x4f3b6f=_0x580feb?_0x578feb['count']:_0x2791d7[_0xbd0d('0x1e')]+_0x2791d7[_0xbd0d('0x1c')];var _0x4dd44f;if(_0x4f3b6f>=_0x13de90){_0x4f3b6f=_0x13de90;_0x4dd44f=0xc8;}else{_0x4dd44f=0xce;}_0x514ff3[_0xbd0d('0x18')](_0x4dd44f);return _0x514ff3[_0xbd0d('0x1f')](_0xbd0d('0x20'),_0x4f308f+'-'+_0x4f3b6f+'/'+_0x13de90)[_0xbd0d('0x1a')](_0x578feb);}return null;};}function patchUpdates(_0x8a0333){return function(_0x3c0b60){try{jsonpatch['apply'](_0x3c0b60,_0x8a0333,!![]);}catch(_0xf38109){return BPromise[_0xbd0d('0x21')](_0xf38109);}return _0x3c0b60['save']();};}function saveUpdates(_0x461d7c,_0x3fe852){return function(_0x5c4085){if(_0x5c4085){return _0x5c4085[_0xbd0d('0x22')](_0x461d7c)[_0xbd0d('0x23')](function(_0x138336){return _0x138336;});}return null;};}function removeEntity(_0x2bd083,_0x102fe6){return function(_0x487eff){if(_0x487eff){return _0x487eff[_0xbd0d('0x24')]()[_0xbd0d('0x23')](function(){_0x2bd083[_0xbd0d('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39460f,_0x3b7693){return function(_0x323b82){if(!_0x323b82){_0x39460f[_0xbd0d('0x17')](0x194);}return _0x323b82;};}function handleError(_0x4efdbd,_0xb22e66){_0xb22e66=_0xb22e66||0x1f4;return function(_0xebc4b){logger[_0xbd0d('0x25')](_0xebc4b[_0xbd0d('0x26')]);if(_0xebc4b[_0xbd0d('0x27')]){delete _0xebc4b[_0xbd0d('0x27')];}_0x4efdbd[_0xbd0d('0x18')](_0xb22e66)[_0xbd0d('0x28')](_0xebc4b);};}exports[_0xbd0d('0x29')]=function(_0xabb632,_0x542c2){var _0x3ce4e9={},_0x34e49a={},_0x338151={'count':0x0,'rows':[]};var _0x1d8ae5=_[_0xbd0d('0x2a')](db[_0xbd0d('0x2b')][_0xbd0d('0x2c')],function(_0x3bde1f){return{'name':_0x3bde1f[_0xbd0d('0x2d')],'type':_0x3bde1f[_0xbd0d('0x2e')][_0xbd0d('0x2f')]};});_0x34e49a[_0xbd0d('0x30')]=_['map'](_0x1d8ae5,_0xbd0d('0x27'));_0x34e49a[_0xbd0d('0x31')]=_['keys'](_0xabb632[_0xbd0d('0x31')]);_0x34e49a[_0xbd0d('0x32')]=_['intersection'](_0x34e49a[_0xbd0d('0x30')],_0x34e49a[_0xbd0d('0x31')]);_0x3ce4e9[_0xbd0d('0x33')]=_['intersection'](_0x34e49a['model'],qs[_0xbd0d('0x34')](_0xabb632[_0xbd0d('0x31')][_0xbd0d('0x34')]));_0x3ce4e9[_0xbd0d('0x33')]=_0x3ce4e9[_0xbd0d('0x33')]['length']?_0x3ce4e9[_0xbd0d('0x33')]:_0x34e49a[_0xbd0d('0x30')];if(!_0xabb632[_0xbd0d('0x31')][_0xbd0d('0x35')](_0xbd0d('0x36'))){_0x3ce4e9[_0xbd0d('0x1c')]=qs['limit'](_0xabb632[_0xbd0d('0x31')][_0xbd0d('0x1c')]);_0x3ce4e9[_0xbd0d('0x1e')]=qs[_0xbd0d('0x1e')](_0xabb632['query'][_0xbd0d('0x1e')]);}_0x3ce4e9['order']=qs[_0xbd0d('0x37')](_0xabb632['query'][_0xbd0d('0x37')]);_0x3ce4e9['where']=qs['filters'](_[_0xbd0d('0x38')](_0xabb632[_0xbd0d('0x31')],_0x34e49a['filters']),_0x1d8ae5);if(_0xabb632[_0xbd0d('0x31')][_0xbd0d('0x39')]){_0x3ce4e9['where']=_['merge'](_0x3ce4e9[_0xbd0d('0x3a')],{'$or':_[_0xbd0d('0x2a')](_0x1d8ae5,function(_0x3e0e18){if(_0x3e0e18[_0xbd0d('0x2e')]!==_0xbd0d('0x3b')){var _0x549490={};_0x549490[_0x3e0e18[_0xbd0d('0x27')]]={'$like':'%'+_0xabb632[_0xbd0d('0x31')]['filter']+'%'};return _0x549490;}})});}_0x3ce4e9=_[_0xbd0d('0x3c')]({},_0x3ce4e9,_0xabb632['options']);var _0x51c500={'where':_0x3ce4e9['where']};return db[_0xbd0d('0x2b')][_0xbd0d('0x1d')](_0x51c500)['then'](function(_0x139823){_0x338151[_0xbd0d('0x1d')]=_0x139823;if(_0xabb632[_0xbd0d('0x31')]['includeAll']){_0x3ce4e9[_0xbd0d('0x3d')]=[{'all':!![]}];}return db[_0xbd0d('0x2b')][_0xbd0d('0x3e')](_0x3ce4e9);})[_0xbd0d('0x23')](function(_0x26df28){_0x338151[_0xbd0d('0x3f')]=_0x26df28;return _0x338151;})[_0xbd0d('0x23')](respondWithFilteredResult(_0x542c2,_0x3ce4e9))[_0xbd0d('0x40')](handleError(_0x542c2,null));};exports['show']=function(_0x432672,_0x5824ff){var _0x20dfbc={'raw':![],'where':{'id':_0x432672[_0xbd0d('0x41')]['id']}},_0x537763={};_0x537763[_0xbd0d('0x30')]=_[_0xbd0d('0x42')](db[_0xbd0d('0x2b')]['rawAttributes']);_0x537763['query']=_[_0xbd0d('0x42')](_0x432672['query']);_0x537763[_0xbd0d('0x32')]=_[_0xbd0d('0x43')](_0x537763['model'],_0x537763[_0xbd0d('0x31')]);_0x20dfbc[_0xbd0d('0x33')]=_[_0xbd0d('0x43')](_0x537763[_0xbd0d('0x30')],qs[_0xbd0d('0x34')](_0x432672['query']['fields']));_0x20dfbc[_0xbd0d('0x33')]=_0x20dfbc[_0xbd0d('0x33')]['length']?_0x20dfbc[_0xbd0d('0x33')]:_0x537763[_0xbd0d('0x30')];if(_0x432672[_0xbd0d('0x31')][_0xbd0d('0x44')]){_0x20dfbc['include']=[{'all':!![]}];}_0x20dfbc=_[_0xbd0d('0x3c')]({},_0x20dfbc,_0x432672['options']);return db[_0xbd0d('0x2b')]['find'](_0x20dfbc)[_0xbd0d('0x23')](handleEntityNotFound(_0x5824ff,null))[_0xbd0d('0x23')](respondWithResult(_0x5824ff,null))[_0xbd0d('0x40')](handleError(_0x5824ff,null));};exports['create']=function(_0x4a5276,_0xc786a1){return db['VtigerConfiguration'][_0xbd0d('0x45')](_0x4a5276['body'],{})['then'](respondWithResult(_0xc786a1,0xc9))[_0xbd0d('0x40')](handleError(_0xc786a1,null));};exports[_0xbd0d('0x22')]=function(_0x136cc1,_0x18858e){if(_0x136cc1[_0xbd0d('0x46')]['id']){delete _0x136cc1[_0xbd0d('0x46')]['id'];}return db['VtigerConfiguration']['find']({'where':{'id':_0x136cc1[_0xbd0d('0x41')]['id']}})[_0xbd0d('0x23')](handleEntityNotFound(_0x18858e,null))[_0xbd0d('0x23')](saveUpdates(_0x136cc1['body'],null))[_0xbd0d('0x23')](respondWithResult(_0x18858e,null))[_0xbd0d('0x40')](handleError(_0x18858e,null));};exports[_0xbd0d('0x24')]=function(_0x295e01,_0x453ebd){return db[_0xbd0d('0x2b')][_0xbd0d('0x47')]({'where':{'id':_0x295e01['params']['id']}})[_0xbd0d('0x23')](handleEntityNotFound(_0x453ebd,null))[_0xbd0d('0x23')](removeEntity(_0x453ebd,null))[_0xbd0d('0x40')](handleError(_0x453ebd,null));};exports[_0xbd0d('0x48')]=function(_0x573c19,_0x12bd85,_0x1ba601){var _0x44d8ab={};var _0x4f5819={};var _0x203b3e;var _0x583518;return db[_0xbd0d('0x2b')]['findOne']({'where':{'id':_0x573c19[_0xbd0d('0x41')]['id']}})[_0xbd0d('0x23')](handleEntityNotFound(_0x12bd85,null))[_0xbd0d('0x23')](function(_0x4110d6){if(_0x4110d6){_0x203b3e=_0x4110d6;_0x4f5819[_0xbd0d('0x30')]=_[_0xbd0d('0x42')](db[_0xbd0d('0x49')][_0xbd0d('0x2c')]);_0x4f5819[_0xbd0d('0x31')]=_[_0xbd0d('0x42')](_0x573c19['query']);_0x4f5819[_0xbd0d('0x32')]=_[_0xbd0d('0x43')](_0x4f5819[_0xbd0d('0x30')],_0x4f5819['query']);_0x44d8ab[_0xbd0d('0x33')]=_['intersection'](_0x4f5819[_0xbd0d('0x30')],qs[_0xbd0d('0x34')](_0x573c19[_0xbd0d('0x31')][_0xbd0d('0x34')]));_0x44d8ab[_0xbd0d('0x33')]=_0x44d8ab[_0xbd0d('0x33')][_0xbd0d('0x4a')]?_0x44d8ab[_0xbd0d('0x33')]:_0x4f5819[_0xbd0d('0x30')];_0x44d8ab[_0xbd0d('0x4b')]=qs[_0xbd0d('0x37')](_0x573c19[_0xbd0d('0x31')]['sort']);_0x44d8ab[_0xbd0d('0x3a')]=qs['filters'](_[_0xbd0d('0x38')](_0x573c19[_0xbd0d('0x31')],_0x4f5819[_0xbd0d('0x32')]));if(_0x573c19[_0xbd0d('0x31')][_0xbd0d('0x39')]){_0x44d8ab[_0xbd0d('0x3a')]=_[_0xbd0d('0x3c')](_0x44d8ab[_0xbd0d('0x3a')],{'$or':_[_0xbd0d('0x2a')](_0x44d8ab[_0xbd0d('0x33')],function(_0x18aab6){var _0x59dd98={};_0x59dd98[_0x18aab6]={'$like':'%'+_0x573c19[_0xbd0d('0x31')][_0xbd0d('0x39')]+'%'};return _0x59dd98;})});}_0x44d8ab=_[_0xbd0d('0x3c')]({},_0x44d8ab,_0x573c19[_0xbd0d('0x4c')]);return _0x203b3e['getFields'](_0x44d8ab);}})['then'](function(_0x49e53f){if(_0x49e53f){_0x583518=_0x49e53f['length'];if(!_0x573c19[_0xbd0d('0x31')][_0xbd0d('0x35')](_0xbd0d('0x36'))){_0x44d8ab[_0xbd0d('0x1c')]=qs[_0xbd0d('0x1c')](_0x573c19[_0xbd0d('0x31')][_0xbd0d('0x1c')]);_0x44d8ab[_0xbd0d('0x1e')]=qs[_0xbd0d('0x1e')](_0x573c19['query'][_0xbd0d('0x1e')]);}return _0x203b3e['getFields'](_0x44d8ab);}})[_0xbd0d('0x23')](function(_0x3aee74){if(_0x3aee74){return _0x3aee74?{'count':_0x583518,'rows':_0x3aee74}:null;}})[_0xbd0d('0x23')](respondWithResult(_0x12bd85,null))[_0xbd0d('0x40')](handleError(_0x12bd85,null));};exports[_0xbd0d('0x4d')]=function(_0x4d0039,_0x3e7d80,_0x2fdb57){var _0x34897e={};var _0x4f9925={};var _0xbf3410;var _0x11932a;return db['VtigerConfiguration'][_0xbd0d('0x4e')]({'where':{'id':_0x4d0039[_0xbd0d('0x41')]['id']}})['then'](handleEntityNotFound(_0x3e7d80,null))[_0xbd0d('0x23')](function(_0xe705bc){if(_0xe705bc){_0xbf3410=_0xe705bc;_0x4f9925['model']=_[_0xbd0d('0x42')](db['VtigerField'][_0xbd0d('0x2c')]);_0x4f9925[_0xbd0d('0x31')]=_[_0xbd0d('0x42')](_0x4d0039[_0xbd0d('0x31')]);_0x4f9925['filters']=_[_0xbd0d('0x43')](_0x4f9925[_0xbd0d('0x30')],_0x4f9925[_0xbd0d('0x31')]);_0x34897e['attributes']=_['intersection'](_0x4f9925[_0xbd0d('0x30')],qs[_0xbd0d('0x34')](_0x4d0039[_0xbd0d('0x31')][_0xbd0d('0x34')]));_0x34897e[_0xbd0d('0x33')]=_0x34897e['attributes'][_0xbd0d('0x4a')]?_0x34897e[_0xbd0d('0x33')]:_0x4f9925[_0xbd0d('0x30')];_0x34897e[_0xbd0d('0x4b')]=qs[_0xbd0d('0x37')](_0x4d0039[_0xbd0d('0x31')][_0xbd0d('0x37')]);_0x34897e[_0xbd0d('0x3a')]=qs[_0xbd0d('0x32')](_['pick'](_0x4d0039['query'],_0x4f9925[_0xbd0d('0x32')]));if(_0x4d0039['query'][_0xbd0d('0x39')]){_0x34897e[_0xbd0d('0x3a')]=_[_0xbd0d('0x3c')](_0x34897e['where'],{'$or':_[_0xbd0d('0x2a')](_0x34897e[_0xbd0d('0x33')],function(_0x254382){var _0x17551d={};_0x17551d[_0x254382]={'$like':'%'+_0x4d0039[_0xbd0d('0x31')][_0xbd0d('0x39')]+'%'};return _0x17551d;})});}_0x34897e=_[_0xbd0d('0x3c')]({},_0x34897e,_0x4d0039[_0xbd0d('0x4c')]);return _0xbf3410[_0xbd0d('0x4d')](_0x34897e);}})[_0xbd0d('0x23')](function(_0x16f986){if(_0x16f986){_0x11932a=_0x16f986[_0xbd0d('0x4a')];if(!_0x4d0039[_0xbd0d('0x31')][_0xbd0d('0x35')](_0xbd0d('0x36'))){_0x34897e[_0xbd0d('0x1c')]=qs['limit'](_0x4d0039['query'][_0xbd0d('0x1c')]);_0x34897e[_0xbd0d('0x1e')]=qs[_0xbd0d('0x1e')](_0x4d0039['query'][_0xbd0d('0x1e')]);}return _0xbf3410[_0xbd0d('0x4d')](_0x34897e);}})[_0xbd0d('0x23')](function(_0x539f81){if(_0x539f81){return _0x539f81?{'count':_0x11932a,'rows':_0x539f81}:null;}})[_0xbd0d('0x23')](respondWithResult(_0x3e7d80,null))[_0xbd0d('0x40')](handleError(_0x3e7d80,null));};exports[_0xbd0d('0x4f')]=function(_0x4a12e9,_0x42fe63,_0x301d5a){var _0x1bbd52={};var _0x1bf53={};var _0x4c8b94;var _0x3f6b4e;return db[_0xbd0d('0x2b')]['findOne']({'where':{'id':_0x4a12e9[_0xbd0d('0x41')]['id']}})[_0xbd0d('0x23')](handleEntityNotFound(_0x42fe63,null))[_0xbd0d('0x23')](function(_0x3fc9c6){if(_0x3fc9c6){_0x4c8b94=_0x3fc9c6;_0x1bf53[_0xbd0d('0x30')]=_[_0xbd0d('0x42')](db[_0xbd0d('0x49')]['rawAttributes']);_0x1bf53[_0xbd0d('0x31')]=_[_0xbd0d('0x42')](_0x4a12e9[_0xbd0d('0x31')]);_0x1bf53[_0xbd0d('0x32')]=_[_0xbd0d('0x43')](_0x1bf53[_0xbd0d('0x30')],_0x1bf53[_0xbd0d('0x31')]);_0x1bbd52['attributes']=_['intersection'](_0x1bf53[_0xbd0d('0x30')],qs[_0xbd0d('0x34')](_0x4a12e9[_0xbd0d('0x31')][_0xbd0d('0x34')]));_0x1bbd52['attributes']=_0x1bbd52[_0xbd0d('0x33')][_0xbd0d('0x4a')]?_0x1bbd52[_0xbd0d('0x33')]:_0x1bf53[_0xbd0d('0x30')];_0x1bbd52['order']=qs[_0xbd0d('0x37')](_0x4a12e9[_0xbd0d('0x31')][_0xbd0d('0x37')]);_0x1bbd52['where']=qs[_0xbd0d('0x32')](_[_0xbd0d('0x38')](_0x4a12e9[_0xbd0d('0x31')],_0x1bf53[_0xbd0d('0x32')]));if(_0x4a12e9['query'][_0xbd0d('0x39')]){_0x1bbd52['where']=_[_0xbd0d('0x3c')](_0x1bbd52[_0xbd0d('0x3a')],{'$or':_[_0xbd0d('0x2a')](_0x1bbd52[_0xbd0d('0x33')],function(_0x431280){var _0x4bcb64={};_0x4bcb64[_0x431280]={'$like':'%'+_0x4a12e9['query']['filter']+'%'};return _0x4bcb64;})});}_0x1bbd52=_[_0xbd0d('0x3c')]({},_0x1bbd52,_0x4a12e9[_0xbd0d('0x4c')]);return _0x4c8b94[_0xbd0d('0x4f')](_0x1bbd52);}})[_0xbd0d('0x23')](function(_0x213a53){if(_0x213a53){_0x3f6b4e=_0x213a53[_0xbd0d('0x4a')];if(!_0x4a12e9[_0xbd0d('0x31')][_0xbd0d('0x35')](_0xbd0d('0x36'))){_0x1bbd52['limit']=qs[_0xbd0d('0x1c')](_0x4a12e9['query'][_0xbd0d('0x1c')]);_0x1bbd52[_0xbd0d('0x1e')]=qs[_0xbd0d('0x1e')](_0x4a12e9[_0xbd0d('0x31')][_0xbd0d('0x1e')]);}return _0x4c8b94[_0xbd0d('0x4f')](_0x1bbd52);}})[_0xbd0d('0x23')](function(_0x4c36c1){if(_0x4c36c1){return _0x4c36c1?{'count':_0x3f6b4e,'rows':_0x4c36c1}:null;}})[_0xbd0d('0x23')](respondWithResult(_0x42fe63,null))['catch'](handleError(_0x42fe63,null));}; \ No newline at end of file +var _0x2e31=['findAll','catch','params','rawAttributes','options','create','body','find','getFields','findOne','VtigerField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','reject','save','update','then','destroy','end','stack','name','send','index','VtigerConfiguration','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','includeAll','include'];(function(_0x5a0197,_0xefb861){var _0x25a7e0=function(_0x4561c8){while(--_0x4561c8){_0x5a0197['push'](_0x5a0197['shift']());}};_0x25a7e0(++_0xefb861);}(_0x2e31,0x145));var _0x12e3=function(_0x2f07b7,_0x5d0972){_0x2f07b7=_0x2f07b7-0x0;var _0x5c2206=_0x2e31[_0x2f07b7];return _0x5c2206;};'use strict';var emlformat=require(_0x12e3('0x0'));var rimraf=require(_0x12e3('0x1'));var zipdir=require(_0x12e3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x12e3('0x3'));var moment=require(_0x12e3('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x12e3('0x5'));var path=require(_0x12e3('0x6'));var sox=require(_0x12e3('0x7'));var csv=require('to-csv');var ejs=require(_0x12e3('0x8'));var fs=require('fs');var fs_extra=require(_0x12e3('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x12e3('0xa'));var jsforce=require(_0x12e3('0xb'));var deskjs=require(_0x12e3('0xc'));var toCsv=require(_0x12e3('0xd'));var querystring=require('querystring');var Papa=require(_0x12e3('0xe'));var Redis=require(_0x12e3('0xf'));var authService=require(_0x12e3('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x12e3('0x11'));var logger=require(_0x12e3('0x12'))(_0x12e3('0x13'));var utils=require(_0x12e3('0x14'));var config=require(_0x12e3('0x15'));var licenseUtil=require(_0x12e3('0x16'));var db=require(_0x12e3('0x17'))['db'];function respondWithStatusCode(_0xc2c4c8,_0x2b5dc3){_0x2b5dc3=_0x2b5dc3||0xcc;return function(_0x464b63){if(_0x464b63){return _0xc2c4c8[_0x12e3('0x18')](_0x2b5dc3);}return _0xc2c4c8[_0x12e3('0x19')](_0x2b5dc3)['end']();};}function respondWithResult(_0x2b5352,_0x19de67){_0x19de67=_0x19de67||0xc8;return function(_0xd9f80f){if(_0xd9f80f){return _0x2b5352['status'](_0x19de67)[_0x12e3('0x1a')](_0xd9f80f);}};}function respondWithFilteredResult(_0x1f7b14,_0x4a29e8){return function(_0x5434fd){if(_0x5434fd){var _0x583ca3=typeof _0x4a29e8[_0x12e3('0x1b')]==='undefined'&&typeof _0x4a29e8[_0x12e3('0x1c')]===_0x12e3('0x1d');var _0x114a83=_0x5434fd[_0x12e3('0x1e')];var _0x211c6a=_0x583ca3?0x0:_0x4a29e8[_0x12e3('0x1b')];var _0x5a63c8=_0x583ca3?_0x5434fd[_0x12e3('0x1e')]:_0x4a29e8[_0x12e3('0x1b')]+_0x4a29e8['limit'];var _0x527dc6;if(_0x5a63c8>=_0x114a83){_0x5a63c8=_0x114a83;_0x527dc6=0xc8;}else{_0x527dc6=0xce;}_0x1f7b14['status'](_0x527dc6);return _0x1f7b14[_0x12e3('0x1f')]('Content-Range',_0x211c6a+'-'+_0x5a63c8+'/'+_0x114a83)[_0x12e3('0x1a')](_0x5434fd);}return null;};}function patchUpdates(_0x2ddfbf){return function(_0x5a1990){try{jsonpatch['apply'](_0x5a1990,_0x2ddfbf,!![]);}catch(_0x37151c){return BPromise[_0x12e3('0x20')](_0x37151c);}return _0x5a1990[_0x12e3('0x21')]();};}function saveUpdates(_0x1f1873,_0x4b8617){return function(_0x55380a){if(_0x55380a){return _0x55380a[_0x12e3('0x22')](_0x1f1873)[_0x12e3('0x23')](function(_0x607255){return _0x607255;});}return null;};}function removeEntity(_0x2705e8,_0x2cf78a){return function(_0x553982){if(_0x553982){return _0x553982[_0x12e3('0x24')]()[_0x12e3('0x23')](function(){_0x2705e8[_0x12e3('0x19')](0xcc)[_0x12e3('0x25')]();});}};}function handleEntityNotFound(_0x43a59f,_0x3361d2){return function(_0x578681){if(!_0x578681){_0x43a59f[_0x12e3('0x18')](0x194);}return _0x578681;};}function handleError(_0x1c5344,_0x4213db){_0x4213db=_0x4213db||0x1f4;return function(_0x42765f){logger['error'](_0x42765f[_0x12e3('0x26')]);if(_0x42765f[_0x12e3('0x27')]){delete _0x42765f[_0x12e3('0x27')];}_0x1c5344['status'](_0x4213db)[_0x12e3('0x28')](_0x42765f);};}exports[_0x12e3('0x29')]=function(_0x329d32,_0x337790){var _0x5a5dd1={},_0x342ad2={},_0x2859d2={'count':0x0,'rows':[]};var _0x40aefe=_['map'](db[_0x12e3('0x2a')]['rawAttributes'],function(_0x3c92be){return{'name':_0x3c92be[_0x12e3('0x2b')],'type':_0x3c92be[_0x12e3('0x2c')][_0x12e3('0x2d')]};});_0x342ad2[_0x12e3('0x2e')]=_[_0x12e3('0x2f')](_0x40aefe,'name');_0x342ad2[_0x12e3('0x30')]=_[_0x12e3('0x31')](_0x329d32['query']);_0x342ad2[_0x12e3('0x32')]=_[_0x12e3('0x33')](_0x342ad2['model'],_0x342ad2[_0x12e3('0x30')]);_0x5a5dd1[_0x12e3('0x34')]=_['intersection'](_0x342ad2[_0x12e3('0x2e')],qs[_0x12e3('0x35')](_0x329d32[_0x12e3('0x30')]['fields']));_0x5a5dd1[_0x12e3('0x34')]=_0x5a5dd1[_0x12e3('0x34')][_0x12e3('0x36')]?_0x5a5dd1[_0x12e3('0x34')]:_0x342ad2[_0x12e3('0x2e')];if(!_0x329d32[_0x12e3('0x30')][_0x12e3('0x37')](_0x12e3('0x38'))){_0x5a5dd1[_0x12e3('0x1c')]=qs[_0x12e3('0x1c')](_0x329d32[_0x12e3('0x30')][_0x12e3('0x1c')]);_0x5a5dd1[_0x12e3('0x1b')]=qs['offset'](_0x329d32[_0x12e3('0x30')]['offset']);}_0x5a5dd1[_0x12e3('0x39')]=qs['sort'](_0x329d32[_0x12e3('0x30')][_0x12e3('0x3a')]);_0x5a5dd1['where']=qs[_0x12e3('0x32')](_[_0x12e3('0x3b')](_0x329d32['query'],_0x342ad2[_0x12e3('0x32')]),_0x40aefe);if(_0x329d32[_0x12e3('0x30')][_0x12e3('0x3c')]){_0x5a5dd1['where']=_[_0x12e3('0x3d')](_0x5a5dd1[_0x12e3('0x3e')],{'$or':_[_0x12e3('0x2f')](_0x40aefe,function(_0x4c3c4b){if(_0x4c3c4b[_0x12e3('0x2c')]!=='VIRTUAL'){var _0x50e1b9={};_0x50e1b9[_0x4c3c4b[_0x12e3('0x27')]]={'$like':'%'+_0x329d32[_0x12e3('0x30')][_0x12e3('0x3c')]+'%'};return _0x50e1b9;}})});}_0x5a5dd1=_['merge']({},_0x5a5dd1,_0x329d32['options']);var _0x1fbf30={'where':_0x5a5dd1['where']};return db[_0x12e3('0x2a')]['count'](_0x1fbf30)[_0x12e3('0x23')](function(_0xa10deb){_0x2859d2[_0x12e3('0x1e')]=_0xa10deb;if(_0x329d32['query'][_0x12e3('0x3f')]){_0x5a5dd1[_0x12e3('0x40')]=[{'all':!![]}];}return db[_0x12e3('0x2a')][_0x12e3('0x41')](_0x5a5dd1);})[_0x12e3('0x23')](function(_0xf0dc31){_0x2859d2['rows']=_0xf0dc31;return _0x2859d2;})[_0x12e3('0x23')](respondWithFilteredResult(_0x337790,_0x5a5dd1))[_0x12e3('0x42')](handleError(_0x337790,null));};exports['show']=function(_0x9d413c,_0x448d96){var _0x52c1c5={'raw':![],'where':{'id':_0x9d413c[_0x12e3('0x43')]['id']}},_0x433ca4={};_0x433ca4[_0x12e3('0x2e')]=_[_0x12e3('0x31')](db[_0x12e3('0x2a')][_0x12e3('0x44')]);_0x433ca4[_0x12e3('0x30')]=_['keys'](_0x9d413c[_0x12e3('0x30')]);_0x433ca4[_0x12e3('0x32')]=_[_0x12e3('0x33')](_0x433ca4[_0x12e3('0x2e')],_0x433ca4[_0x12e3('0x30')]);_0x52c1c5[_0x12e3('0x34')]=_[_0x12e3('0x33')](_0x433ca4[_0x12e3('0x2e')],qs['fields'](_0x9d413c['query'][_0x12e3('0x35')]));_0x52c1c5[_0x12e3('0x34')]=_0x52c1c5['attributes'][_0x12e3('0x36')]?_0x52c1c5['attributes']:_0x433ca4[_0x12e3('0x2e')];if(_0x9d413c[_0x12e3('0x30')][_0x12e3('0x3f')]){_0x52c1c5[_0x12e3('0x40')]=[{'all':!![]}];}_0x52c1c5=_[_0x12e3('0x3d')]({},_0x52c1c5,_0x9d413c[_0x12e3('0x45')]);return db['VtigerConfiguration']['find'](_0x52c1c5)['then'](handleEntityNotFound(_0x448d96,null))[_0x12e3('0x23')](respondWithResult(_0x448d96,null))[_0x12e3('0x42')](handleError(_0x448d96,null));};exports['create']=function(_0x54ab00,_0x34a629){return db['VtigerConfiguration'][_0x12e3('0x46')](_0x54ab00[_0x12e3('0x47')],{})[_0x12e3('0x23')](respondWithResult(_0x34a629,0xc9))[_0x12e3('0x42')](handleError(_0x34a629,null));};exports[_0x12e3('0x22')]=function(_0x1b129a,_0x20fb60){if(_0x1b129a['body']['id']){delete _0x1b129a[_0x12e3('0x47')]['id'];}return db[_0x12e3('0x2a')]['find']({'where':{'id':_0x1b129a['params']['id']}})[_0x12e3('0x23')](handleEntityNotFound(_0x20fb60,null))[_0x12e3('0x23')](saveUpdates(_0x1b129a[_0x12e3('0x47')],null))['then'](respondWithResult(_0x20fb60,null))[_0x12e3('0x42')](handleError(_0x20fb60,null));};exports[_0x12e3('0x24')]=function(_0x38bc69,_0x498cdb){return db[_0x12e3('0x2a')][_0x12e3('0x48')]({'where':{'id':_0x38bc69[_0x12e3('0x43')]['id']}})['then'](handleEntityNotFound(_0x498cdb,null))[_0x12e3('0x23')](removeEntity(_0x498cdb,null))[_0x12e3('0x42')](handleError(_0x498cdb,null));};exports[_0x12e3('0x49')]=function(_0x36e8de,_0x3e772d,_0x220d97){var _0x60e6fc={};var _0x2d409f={};var _0x4159ab;var _0x2d9ed0;return db[_0x12e3('0x2a')][_0x12e3('0x4a')]({'where':{'id':_0x36e8de[_0x12e3('0x43')]['id']}})[_0x12e3('0x23')](handleEntityNotFound(_0x3e772d,null))[_0x12e3('0x23')](function(_0x57ffe0){if(_0x57ffe0){_0x4159ab=_0x57ffe0;_0x2d409f['model']=_[_0x12e3('0x31')](db[_0x12e3('0x4b')][_0x12e3('0x44')]);_0x2d409f[_0x12e3('0x30')]=_[_0x12e3('0x31')](_0x36e8de[_0x12e3('0x30')]);_0x2d409f[_0x12e3('0x32')]=_['intersection'](_0x2d409f[_0x12e3('0x2e')],_0x2d409f[_0x12e3('0x30')]);_0x60e6fc['attributes']=_[_0x12e3('0x33')](_0x2d409f[_0x12e3('0x2e')],qs['fields'](_0x36e8de['query'][_0x12e3('0x35')]));_0x60e6fc[_0x12e3('0x34')]=_0x60e6fc[_0x12e3('0x34')][_0x12e3('0x36')]?_0x60e6fc[_0x12e3('0x34')]:_0x2d409f[_0x12e3('0x2e')];_0x60e6fc[_0x12e3('0x39')]=qs[_0x12e3('0x3a')](_0x36e8de[_0x12e3('0x30')]['sort']);_0x60e6fc[_0x12e3('0x3e')]=qs['filters'](_[_0x12e3('0x3b')](_0x36e8de[_0x12e3('0x30')],_0x2d409f[_0x12e3('0x32')]));if(_0x36e8de[_0x12e3('0x30')][_0x12e3('0x3c')]){_0x60e6fc[_0x12e3('0x3e')]=_[_0x12e3('0x3d')](_0x60e6fc[_0x12e3('0x3e')],{'$or':_[_0x12e3('0x2f')](_0x60e6fc[_0x12e3('0x34')],function(_0x3be2ca){var _0x35cd26={};_0x35cd26[_0x3be2ca]={'$like':'%'+_0x36e8de[_0x12e3('0x30')][_0x12e3('0x3c')]+'%'};return _0x35cd26;})});}_0x60e6fc=_[_0x12e3('0x3d')]({},_0x60e6fc,_0x36e8de['options']);return _0x4159ab[_0x12e3('0x49')](_0x60e6fc);}})[_0x12e3('0x23')](function(_0x5270b8){if(_0x5270b8){_0x2d9ed0=_0x5270b8[_0x12e3('0x36')];if(!_0x36e8de[_0x12e3('0x30')][_0x12e3('0x37')]('nolimit')){_0x60e6fc[_0x12e3('0x1c')]=qs[_0x12e3('0x1c')](_0x36e8de[_0x12e3('0x30')][_0x12e3('0x1c')]);_0x60e6fc['offset']=qs[_0x12e3('0x1b')](_0x36e8de[_0x12e3('0x30')][_0x12e3('0x1b')]);}return _0x4159ab[_0x12e3('0x49')](_0x60e6fc);}})[_0x12e3('0x23')](function(_0x1f98b0){if(_0x1f98b0){return _0x1f98b0?{'count':_0x2d9ed0,'rows':_0x1f98b0}:null;}})['then'](respondWithResult(_0x3e772d,null))[_0x12e3('0x42')](handleError(_0x3e772d,null));};exports[_0x12e3('0x4c')]=function(_0x3c28ac,_0x4307d7,_0x238aa6){var _0x2da056={};var _0xa1527c={};var _0x5ba457;var _0x3b4cd7;return db[_0x12e3('0x2a')]['findOne']({'where':{'id':_0x3c28ac[_0x12e3('0x43')]['id']}})[_0x12e3('0x23')](handleEntityNotFound(_0x4307d7,null))[_0x12e3('0x23')](function(_0x6aedcc){if(_0x6aedcc){_0x5ba457=_0x6aedcc;_0xa1527c[_0x12e3('0x2e')]=_['keys'](db[_0x12e3('0x4b')]['rawAttributes']);_0xa1527c['query']=_[_0x12e3('0x31')](_0x3c28ac[_0x12e3('0x30')]);_0xa1527c[_0x12e3('0x32')]=_[_0x12e3('0x33')](_0xa1527c[_0x12e3('0x2e')],_0xa1527c['query']);_0x2da056[_0x12e3('0x34')]=_[_0x12e3('0x33')](_0xa1527c['model'],qs[_0x12e3('0x35')](_0x3c28ac[_0x12e3('0x30')][_0x12e3('0x35')]));_0x2da056[_0x12e3('0x34')]=_0x2da056[_0x12e3('0x34')]['length']?_0x2da056[_0x12e3('0x34')]:_0xa1527c[_0x12e3('0x2e')];_0x2da056[_0x12e3('0x39')]=qs[_0x12e3('0x3a')](_0x3c28ac[_0x12e3('0x30')]['sort']);_0x2da056[_0x12e3('0x3e')]=qs[_0x12e3('0x32')](_[_0x12e3('0x3b')](_0x3c28ac[_0x12e3('0x30')],_0xa1527c['filters']));if(_0x3c28ac[_0x12e3('0x30')][_0x12e3('0x3c')]){_0x2da056['where']=_[_0x12e3('0x3d')](_0x2da056[_0x12e3('0x3e')],{'$or':_['map'](_0x2da056['attributes'],function(_0x77aa9a){var _0x3a0598={};_0x3a0598[_0x77aa9a]={'$like':'%'+_0x3c28ac[_0x12e3('0x30')][_0x12e3('0x3c')]+'%'};return _0x3a0598;})});}_0x2da056=_[_0x12e3('0x3d')]({},_0x2da056,_0x3c28ac['options']);return _0x5ba457[_0x12e3('0x4c')](_0x2da056);}})['then'](function(_0x41750f){if(_0x41750f){_0x3b4cd7=_0x41750f['length'];if(!_0x3c28ac[_0x12e3('0x30')]['hasOwnProperty'](_0x12e3('0x38'))){_0x2da056[_0x12e3('0x1c')]=qs[_0x12e3('0x1c')](_0x3c28ac[_0x12e3('0x30')][_0x12e3('0x1c')]);_0x2da056['offset']=qs[_0x12e3('0x1b')](_0x3c28ac[_0x12e3('0x30')][_0x12e3('0x1b')]);}return _0x5ba457[_0x12e3('0x4c')](_0x2da056);}})[_0x12e3('0x23')](function(_0x1c8422){if(_0x1c8422){return _0x1c8422?{'count':_0x3b4cd7,'rows':_0x1c8422}:null;}})['then'](respondWithResult(_0x4307d7,null))[_0x12e3('0x42')](handleError(_0x4307d7,null));};exports['getDescriptions']=function(_0x317501,_0x5b711d,_0x256049){var _0x2ab227={};var _0x472745={};var _0x3122ad;var _0x593008;return db['VtigerConfiguration'][_0x12e3('0x4a')]({'where':{'id':_0x317501[_0x12e3('0x43')]['id']}})[_0x12e3('0x23')](handleEntityNotFound(_0x5b711d,null))[_0x12e3('0x23')](function(_0x29f6b4){if(_0x29f6b4){_0x3122ad=_0x29f6b4;_0x472745[_0x12e3('0x2e')]=_[_0x12e3('0x31')](db['VtigerField'][_0x12e3('0x44')]);_0x472745[_0x12e3('0x30')]=_[_0x12e3('0x31')](_0x317501[_0x12e3('0x30')]);_0x472745['filters']=_['intersection'](_0x472745[_0x12e3('0x2e')],_0x472745[_0x12e3('0x30')]);_0x2ab227[_0x12e3('0x34')]=_[_0x12e3('0x33')](_0x472745[_0x12e3('0x2e')],qs['fields'](_0x317501['query'][_0x12e3('0x35')]));_0x2ab227[_0x12e3('0x34')]=_0x2ab227[_0x12e3('0x34')]['length']?_0x2ab227[_0x12e3('0x34')]:_0x472745[_0x12e3('0x2e')];_0x2ab227[_0x12e3('0x39')]=qs[_0x12e3('0x3a')](_0x317501[_0x12e3('0x30')][_0x12e3('0x3a')]);_0x2ab227[_0x12e3('0x3e')]=qs[_0x12e3('0x32')](_['pick'](_0x317501[_0x12e3('0x30')],_0x472745[_0x12e3('0x32')]));if(_0x317501['query'][_0x12e3('0x3c')]){_0x2ab227[_0x12e3('0x3e')]=_['merge'](_0x2ab227[_0x12e3('0x3e')],{'$or':_[_0x12e3('0x2f')](_0x2ab227[_0x12e3('0x34')],function(_0x15ac0f){var _0x25d851={};_0x25d851[_0x15ac0f]={'$like':'%'+_0x317501[_0x12e3('0x30')]['filter']+'%'};return _0x25d851;})});}_0x2ab227=_[_0x12e3('0x3d')]({},_0x2ab227,_0x317501[_0x12e3('0x45')]);return _0x3122ad[_0x12e3('0x4d')](_0x2ab227);}})['then'](function(_0x3ce684){if(_0x3ce684){_0x593008=_0x3ce684[_0x12e3('0x36')];if(!_0x317501['query'][_0x12e3('0x37')](_0x12e3('0x38'))){_0x2ab227['limit']=qs[_0x12e3('0x1c')](_0x317501[_0x12e3('0x30')][_0x12e3('0x1c')]);_0x2ab227['offset']=qs[_0x12e3('0x1b')](_0x317501[_0x12e3('0x30')]['offset']);}return _0x3122ad[_0x12e3('0x4d')](_0x2ab227);}})[_0x12e3('0x23')](function(_0x510da8){if(_0x510da8){return _0x510da8?{'count':_0x593008,'rows':_0x510da8}:null;}})['then'](respondWithResult(_0x5b711d,null))['catch'](handleError(_0x5b711d,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 3d63bc3..51d2777 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 _0xd090=['../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations','lodash','bluebird','request-promise'];(function(_0x4f748a,_0x37e73d){var _0x41a415=function(_0x1d0982){while(--_0x1d0982){_0x4f748a['push'](_0x4f748a['shift']());}};_0x41a415(++_0x37e73d);}(_0xd090,0x1da));var _0x0d09=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd090[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0d09('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d09('0x1'));var rp=require(_0x0d09('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0d09('0x3'));var attributes=require(_0x0d09('0x4'));module[_0x0d09('0x5')]=function(_0x4e1bf9,_0x5e9605){return _0x4e1bf9[_0x0d09('0x6')](_0x0d09('0x7'),attributes,{'tableName':_0x0d09('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc303=['../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations','util'];(function(_0x38a7ac,_0x45514b){var _0x53061a=function(_0x1d2469){while(--_0x1d2469){_0x38a7ac['push'](_0x38a7ac['shift']());}};_0x53061a(++_0x45514b);}(_0xc303,0xfb));var _0x3c30=function(_0x7feb90,_0x28e700){_0x7feb90=_0x7feb90-0x0;var _0x3c5b33=_0xc303[_0x7feb90];return _0x3c5b33;};'use strict';var _=require('lodash');var util=require(_0x3c30('0x0'));var logger=require(_0x3c30('0x1'))(_0x3c30('0x2'));var moment=require(_0x3c30('0x3'));var BPromise=require(_0x3c30('0x4'));var rp=require(_0x3c30('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3c30('0x6'));var attributes=require(_0x3c30('0x7'));module[_0x3c30('0x8')]=function(_0x3b88ef,_0x29ee00){return _0x3b88ef[_0x3c30('0x9')](_0x3c30('0xa'),attributes,{'tableName':_0x3c30('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js index 93cb357..eded705 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 _0x5fcd=['util','randomstring','ioredis','../../mysqldb','../../config/environment','http','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x5fcd,0x179));var _0xd5fc=function(_0x3c7995,_0x1cc42c){_0x3c7995=_0x3c7995-0x0;var _0x6f2665=_0x5fcd[_0x3c7995];return _0x6f2665;};'use strict';var _=require(_0xd5fc('0x0'));var util=require(_0xd5fc('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd5fc('0x2'));var fs=require('fs');var Redis=require(_0xd5fc('0x3'));var db=require(_0xd5fc('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xd5fc('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd5fc('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x339984,_0x4d8aec,_0xa0b34d){return new BPromise(function(_0x3ca4d6,_0xaa6dce){return client['request'](_0x339984,_0xa0b34d)[_0xd5fc('0x7')](function(_0x32a00b){logger[_0xd5fc('0x8')](_0xd5fc('0x9'),_0x4d8aec,_0xd5fc('0xa'));logger[_0xd5fc('0xb')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x4d8aec,_0xd5fc('0xa'),JSON[_0xd5fc('0xc')](_0x32a00b));if(_0x32a00b[_0xd5fc('0xd')]){if(_0x32a00b[_0xd5fc('0xd')][_0xd5fc('0xe')]===0x1f4){logger[_0xd5fc('0xd')]('VtigerConfiguration,\x20%s,\x20%s',_0x4d8aec,_0x32a00b[_0xd5fc('0xd')][_0xd5fc('0xf')]);return _0xaa6dce(_0x32a00b[_0xd5fc('0xd')][_0xd5fc('0xf')]);}logger[_0xd5fc('0xd')](_0xd5fc('0x9'),_0x4d8aec,_0x32a00b['error']['message']);return _0x3ca4d6(_0x32a00b[_0xd5fc('0xd')]['message']);}else{logger[_0xd5fc('0x8')](_0xd5fc('0x9'),_0x4d8aec,_0xd5fc('0xa'));_0x3ca4d6(_0x32a00b[_0xd5fc('0x10')][_0xd5fc('0xf')]);}})[_0xd5fc('0x11')](function(_0x24c670){logger[_0xd5fc('0xd')](_0xd5fc('0x9'),_0x4d8aec,_0x24c670);_0xaa6dce(_0x24c670);});});} \ No newline at end of file +var _0x0f44=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment'];(function(_0x1a3751,_0x1c846d){var _0x251c06=function(_0x541bdb){while(--_0x541bdb){_0x1a3751['push'](_0x1a3751['shift']());}};_0x251c06(++_0x1c846d);}(_0x0f44,0x75));var _0x40f4=function(_0x25c988,_0xce8221){_0x25c988=_0x25c988-0x0;var _0x45fcc2=_0x0f44[_0x25c988];return _0x45fcc2;};'use strict';var _=require(_0x40f4('0x0'));var util=require(_0x40f4('0x1'));var moment=require(_0x40f4('0x2'));var BPromise=require(_0x40f4('0x3'));var rs=require(_0x40f4('0x4'));var fs=require('fs');var Redis=require(_0x40f4('0x5'));var db=require(_0x40f4('0x6'))['db'];var utils=require(_0x40f4('0x7'));var logger=require(_0x40f4('0x8'))(_0x40f4('0x9'));var config=require(_0x40f4('0xa'));var jayson=require(_0x40f4('0xb'));var client=jayson['client'][_0x40f4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x94e807,_0x4e0f91,_0x3789ce){return new BPromise(function(_0x80a3c5,_0xf81d20){return client['request'](_0x94e807,_0x3789ce)['then'](function(_0x540552){logger['info'](_0x40f4('0xd'),_0x4e0f91,_0x40f4('0xe'));logger[_0x40f4('0xf')](_0x40f4('0x10'),_0x4e0f91,_0x40f4('0xe'),JSON[_0x40f4('0x11')](_0x540552));if(_0x540552[_0x40f4('0x12')]){if(_0x540552['error'][_0x40f4('0x13')]===0x1f4){logger[_0x40f4('0x12')]('VtigerConfiguration,\x20%s,\x20%s',_0x4e0f91,_0x540552[_0x40f4('0x12')]['message']);return _0xf81d20(_0x540552[_0x40f4('0x12')]['message']);}logger['error'](_0x40f4('0xd'),_0x4e0f91,_0x540552[_0x40f4('0x12')][_0x40f4('0x14')]);return _0x80a3c5(_0x540552[_0x40f4('0x12')][_0x40f4('0x14')]);}else{logger[_0x40f4('0x15')](_0x40f4('0xd'),_0x4e0f91,'request\x20sent');_0x80a3c5(_0x540552[_0x40f4('0x16')][_0x40f4('0x14')]);}})[_0x40f4('0x17')](function(_0x44ffff){logger['error'](_0x40f4('0xd'),_0x4e0f91,_0x44ffff);_0xf81d20(_0x44ffff);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 678b657..536e3ef 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 _0x6e70=['isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get'];(function(_0x3d7da9,_0x40bb4a){var _0x2470eb=function(_0x2253e3){while(--_0x2253e3){_0x3d7da9['push'](_0x3d7da9['shift']());}};_0x2470eb(++_0x40bb4a);}(_0x6e70,0xb5));var _0x06e7=function(_0x51144f,_0x5c8a7e){_0x51144f=_0x51144f-0x0;var _0xef47a6=_0x6e70[_0x51144f];return _0xef47a6;};'use strict';var multer=require('multer');var util=require(_0x06e7('0x0'));var path=require(_0x06e7('0x1'));var timeout=require('connect-timeout');var express=require(_0x06e7('0x2'));var router=express[_0x06e7('0x3')]();var fs_extra=require(_0x06e7('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x06e7('0x5'));var config=require(_0x06e7('0x6'));var controller=require(_0x06e7('0x7'));router[_0x06e7('0x8')]('/',auth[_0x06e7('0x9')](),controller[_0x06e7('0xa')]);router[_0x06e7('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x06e7('0xb')]);router[_0x06e7('0xc')]('/',auth[_0x06e7('0x9')](),controller[_0x06e7('0xd')]);router[_0x06e7('0xe')](_0x06e7('0xf'),auth['isAuthenticated'](),controller[_0x06e7('0x10')]);router[_0x06e7('0x11')](_0x06e7('0xf'),auth['isAuthenticated'](),controller[_0x06e7('0x12')]);module['exports']=router; \ No newline at end of file +var _0x9529=['isAuthenticated','show','post','create','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intVtigerField.controller','get','index','/:id'];(function(_0x17a048,_0x1adff2){var _0x32b970=function(_0x3f46b5){while(--_0x3f46b5){_0x17a048['push'](_0x17a048['shift']());}};_0x32b970(++_0x1adff2);}(_0x9529,0x8c));var _0x9952=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9529[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x9952('0x0'));var util=require(_0x9952('0x1'));var path=require(_0x9952('0x2'));var timeout=require(_0x9952('0x3'));var express=require(_0x9952('0x4'));var router=express[_0x9952('0x5')]();var fs_extra=require(_0x9952('0x6'));var auth=require(_0x9952('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9952('0x8'));router[_0x9952('0x9')]('/',auth['isAuthenticated'](),controller[_0x9952('0xa')]);router[_0x9952('0x9')](_0x9952('0xb'),auth[_0x9952('0xc')](),controller[_0x9952('0xd')]);router[_0x9952('0xe')]('/',auth[_0x9952('0xc')](),controller[_0x9952('0xf')]);router['put'](_0x9952('0xb'),auth[_0x9952('0xc')](),controller['update']);router[_0x9952('0x10')]('/:id',auth[_0x9952('0xc')](),controller[_0x9952('0x11')]);module[_0x9952('0x12')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 6cc3a12..bca3d71 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 _0xc809=['picklist','STRING','BOOLEAN','string','variable','customVariable','keyValue'];(function(_0x51658c,_0xbfe5b3){var _0x109648=function(_0x378883){while(--_0x378883){_0x51658c['push'](_0x51658c['shift']());}};_0x109648(++_0xbfe5b3);}(_0xc809,0xea));var _0x9c80=function(_0x2fe97b,_0xf74a35){_0x2fe97b=_0x2fe97b-0x0;var _0x146b45=_0xc809[_0x2fe97b];return _0x146b45;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize['ENUM'](_0x9c80('0x0'),_0x9c80('0x1'),_0x9c80('0x2'),_0x9c80('0x3'),_0x9c80('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x9c80('0x5')]},'key':{'type':Sequelize[_0x9c80('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x9c80('0x0'),_0x9c80('0x1'),_0x9c80('0x2'))},'keyContent':{'type':Sequelize[_0x9c80('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x9c80('0x5')]},'customField':{'type':Sequelize[_0x9c80('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9c80('0x5')]}}; \ No newline at end of file +var _0x0662=['variable','customVariable','keyValue','STRING','sequelize','exports','ENUM','string'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x0662,0xac));var _0x2066=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x0662[_0x5b561d];return _0x431060;};'use strict';var Sequelize=require(_0x2066('0x0'));module[_0x2066('0x1')]={'type':{'type':Sequelize[_0x2066('0x2')](_0x2066('0x3'),_0x2066('0x4'),_0x2066('0x5'),_0x2066('0x6'),'picklist'),'defaultValue':_0x2066('0x3')},'content':{'type':Sequelize[_0x2066('0x7')]},'key':{'type':Sequelize[_0x2066('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x2066('0x3'),_0x2066('0x4'),_0x2066('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x2066('0x7')]},'nameField':{'type':Sequelize[_0x2066('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2066('0x7')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 5217757..139a5c5 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 _0x6395=['status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','error','stack','name','send','index','map','VtigerField','rawAttributes','fieldName','type','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','show','find','create','body','params','catch','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','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','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x532f7f,_0x197b5d){var _0x149d4c=function(_0x47c654){while(--_0x47c654){_0x532f7f['push'](_0x532f7f['shift']());}};_0x149d4c(++_0x197b5d);}(_0x6395,0x11d));var _0x5639=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x6395[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5639('0x0'));var zipdir=require(_0x5639('0x1'));var jsonpatch=require(_0x5639('0x2'));var rp=require(_0x5639('0x3'));var moment=require(_0x5639('0x4'));var BPromise=require(_0x5639('0x5'));var Mustache=require(_0x5639('0x6'));var util=require('util');var path=require(_0x5639('0x7'));var sox=require('sox');var csv=require(_0x5639('0x8'));var ejs=require(_0x5639('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5639('0xa'));var squel=require(_0x5639('0xb'));var crypto=require('crypto');var jsforce=require(_0x5639('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x5639('0x8'));var querystring=require(_0x5639('0xd'));var Papa=require(_0x5639('0xe'));var Redis=require(_0x5639('0xf'));var authService=require(_0x5639('0x10'));var qs=require(_0x5639('0x11'));var as=require(_0x5639('0x12'));var hardwareService=require(_0x5639('0x13'));var logger=require(_0x5639('0x14'))(_0x5639('0x15'));var utils=require(_0x5639('0x16'));var config=require(_0x5639('0x17'));var licenseUtil=require(_0x5639('0x18'));var db=require(_0x5639('0x19'))['db'];function respondWithStatusCode(_0x29724c,_0x152982){_0x152982=_0x152982||0xcc;return function(_0x57bf03){if(_0x57bf03){return _0x29724c[_0x5639('0x1a')](_0x152982);}return _0x29724c[_0x5639('0x1b')](_0x152982)[_0x5639('0x1c')]();};}function respondWithResult(_0x5b56bf,_0x16a27c){_0x16a27c=_0x16a27c||0xc8;return function(_0xc40088){if(_0xc40088){return _0x5b56bf[_0x5639('0x1b')](_0x16a27c)[_0x5639('0x1d')](_0xc40088);}};}function respondWithFilteredResult(_0x3b611e,_0x53a266){return function(_0x5922b7){if(_0x5922b7){var _0x2b8f45=typeof _0x53a266[_0x5639('0x1e')]===_0x5639('0x1f')&&typeof _0x53a266[_0x5639('0x20')]===_0x5639('0x1f');var _0x377b7f=_0x5922b7[_0x5639('0x21')];var _0x23fbef=_0x2b8f45?0x0:_0x53a266['offset'];var _0x27b59d=_0x2b8f45?_0x5922b7['count']:_0x53a266['offset']+_0x53a266[_0x5639('0x20')];var _0x476745;if(_0x27b59d>=_0x377b7f){_0x27b59d=_0x377b7f;_0x476745=0xc8;}else{_0x476745=0xce;}_0x3b611e[_0x5639('0x1b')](_0x476745);return _0x3b611e[_0x5639('0x22')](_0x5639('0x23'),_0x23fbef+'-'+_0x27b59d+'/'+_0x377b7f)[_0x5639('0x1d')](_0x5922b7);}return null;};}function patchUpdates(_0x3d5073){return function(_0x2b429b){try{jsonpatch[_0x5639('0x24')](_0x2b429b,_0x3d5073,!![]);}catch(_0xebd610){return BPromise['reject'](_0xebd610);}return _0x2b429b[_0x5639('0x25')]();};}function saveUpdates(_0x44334f,_0x4a6e66){return function(_0x7ebb20){if(_0x7ebb20){return _0x7ebb20[_0x5639('0x26')](_0x44334f)[_0x5639('0x27')](function(_0x3cbe60){return _0x3cbe60;});}return null;};}function removeEntity(_0x5a10f3,_0x4d3156){return function(_0x59ccf8){if(_0x59ccf8){return _0x59ccf8['destroy']()[_0x5639('0x27')](function(){_0x5a10f3['status'](0xcc)[_0x5639('0x1c')]();});}};}function handleEntityNotFound(_0x48d733,_0x365422){return function(_0x3716f4){if(!_0x3716f4){_0x48d733[_0x5639('0x1a')](0x194);}return _0x3716f4;};}function handleError(_0x35d2d7,_0x195198){_0x195198=_0x195198||0x1f4;return function(_0x56f5ef){logger[_0x5639('0x28')](_0x56f5ef[_0x5639('0x29')]);if(_0x56f5ef[_0x5639('0x2a')]){delete _0x56f5ef[_0x5639('0x2a')];}_0x35d2d7[_0x5639('0x1b')](_0x195198)[_0x5639('0x2b')](_0x56f5ef);};}exports[_0x5639('0x2c')]=function(_0x507c68,_0x5df5fe){var _0x497cf0={},_0x50c173={},_0x356ab7={'count':0x0,'rows':[]};var _0x1e83cb=_[_0x5639('0x2d')](db[_0x5639('0x2e')][_0x5639('0x2f')],function(_0x181da1){return{'name':_0x181da1[_0x5639('0x30')],'type':_0x181da1[_0x5639('0x31')]['key']};});_0x50c173[_0x5639('0x32')]=_[_0x5639('0x2d')](_0x1e83cb,_0x5639('0x2a'));_0x50c173['query']=_[_0x5639('0x33')](_0x507c68[_0x5639('0x34')]);_0x50c173['filters']=_[_0x5639('0x35')](_0x50c173[_0x5639('0x32')],_0x50c173[_0x5639('0x34')]);_0x497cf0['attributes']=_[_0x5639('0x35')](_0x50c173[_0x5639('0x32')],qs['fields'](_0x507c68[_0x5639('0x34')][_0x5639('0x36')]));_0x497cf0['attributes']=_0x497cf0[_0x5639('0x37')][_0x5639('0x38')]?_0x497cf0[_0x5639('0x37')]:_0x50c173[_0x5639('0x32')];if(!_0x507c68[_0x5639('0x34')][_0x5639('0x39')](_0x5639('0x3a'))){_0x497cf0[_0x5639('0x20')]=qs['limit'](_0x507c68[_0x5639('0x34')][_0x5639('0x20')]);_0x497cf0[_0x5639('0x1e')]=qs[_0x5639('0x1e')](_0x507c68[_0x5639('0x34')][_0x5639('0x1e')]);}_0x497cf0[_0x5639('0x3b')]=qs[_0x5639('0x3c')](_0x507c68['query'][_0x5639('0x3c')]);_0x497cf0[_0x5639('0x3d')]=qs[_0x5639('0x3e')](_[_0x5639('0x3f')](_0x507c68[_0x5639('0x34')],_0x50c173[_0x5639('0x3e')]),_0x1e83cb);if(_0x507c68[_0x5639('0x34')][_0x5639('0x40')]){_0x497cf0[_0x5639('0x3d')]=_['merge'](_0x497cf0[_0x5639('0x3d')],{'$or':_['map'](_0x1e83cb,function(_0x2653b4){if(_0x2653b4[_0x5639('0x31')]!==_0x5639('0x41')){var _0x2cf77d={};_0x2cf77d[_0x2653b4[_0x5639('0x2a')]]={'$like':'%'+_0x507c68[_0x5639('0x34')][_0x5639('0x40')]+'%'};return _0x2cf77d;}})});}_0x497cf0=_['merge']({},_0x497cf0,_0x507c68[_0x5639('0x42')]);var _0x20618b={'where':_0x497cf0['where']};return db['VtigerField'][_0x5639('0x21')](_0x20618b)[_0x5639('0x27')](function(_0x461c55){_0x356ab7[_0x5639('0x21')]=_0x461c55;if(_0x507c68['query'][_0x5639('0x43')]){_0x497cf0[_0x5639('0x44')]=[{'all':!![]}];}return db['VtigerField'][_0x5639('0x45')](_0x497cf0);})[_0x5639('0x27')](function(_0x3d7a0c){_0x356ab7[_0x5639('0x46')]=_0x3d7a0c;return _0x356ab7;})['then'](respondWithFilteredResult(_0x5df5fe,_0x497cf0))['catch'](handleError(_0x5df5fe,null));};exports[_0x5639('0x47')]=function(_0x1d6faa,_0x3a5ff1){var _0x1158d7={'raw':!![],'where':{'id':_0x1d6faa['params']['id']}},_0x1b45ad={};_0x1b45ad[_0x5639('0x32')]=_[_0x5639('0x33')](db[_0x5639('0x2e')][_0x5639('0x2f')]);_0x1b45ad[_0x5639('0x34')]=_[_0x5639('0x33')](_0x1d6faa[_0x5639('0x34')]);_0x1b45ad[_0x5639('0x3e')]=_[_0x5639('0x35')](_0x1b45ad[_0x5639('0x32')],_0x1b45ad[_0x5639('0x34')]);_0x1158d7[_0x5639('0x37')]=_[_0x5639('0x35')](_0x1b45ad[_0x5639('0x32')],qs['fields'](_0x1d6faa[_0x5639('0x34')][_0x5639('0x36')]));_0x1158d7[_0x5639('0x37')]=_0x1158d7[_0x5639('0x37')]['length']?_0x1158d7[_0x5639('0x37')]:_0x1b45ad['model'];if(_0x1d6faa[_0x5639('0x34')]['includeAll']){_0x1158d7['include']=[{'all':!![]}];}_0x1158d7=_['merge']({},_0x1158d7,_0x1d6faa[_0x5639('0x42')]);return db[_0x5639('0x2e')][_0x5639('0x48')](_0x1158d7)['then'](handleEntityNotFound(_0x3a5ff1,null))[_0x5639('0x27')](respondWithResult(_0x3a5ff1,null))['catch'](handleError(_0x3a5ff1,null));};exports[_0x5639('0x49')]=function(_0x43d488,_0x2619cb){return db[_0x5639('0x2e')][_0x5639('0x49')](_0x43d488[_0x5639('0x4a')],{})[_0x5639('0x27')](respondWithResult(_0x2619cb,0xc9))['catch'](handleError(_0x2619cb,null));};exports[_0x5639('0x26')]=function(_0x10642a,_0x4af547){if(_0x10642a[_0x5639('0x4a')]['id']){delete _0x10642a[_0x5639('0x4a')]['id'];}return db[_0x5639('0x2e')][_0x5639('0x48')]({'where':{'id':_0x10642a[_0x5639('0x4b')]['id']}})[_0x5639('0x27')](handleEntityNotFound(_0x4af547,null))[_0x5639('0x27')](saveUpdates(_0x10642a[_0x5639('0x4a')],null))[_0x5639('0x27')](respondWithResult(_0x4af547,null))[_0x5639('0x4c')](handleError(_0x4af547,null));};exports[_0x5639('0x4d')]=function(_0x2cc7a8,_0x44a369){return db[_0x5639('0x2e')]['find']({'where':{'id':_0x2cc7a8[_0x5639('0x4b')]['id']}})['then'](handleEntityNotFound(_0x44a369,null))['then'](removeEntity(_0x44a369,null))['catch'](handleError(_0x44a369,null));}; \ No newline at end of file +var _0x6090=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','offset','limit','undefined','count','Content-Range','json','apply','save','update','then','destroy','sendStatus','error','stack','send','index','map','VtigerField','rawAttributes','fieldName','type','key','name','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','VIRTUAL','options','where','includeAll','include','rows','catch','show','params','create','body','find'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x6090,0x1da));var _0x0609=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x6090[_0x2bf141];return _0x48277b;};'use strict';var emlformat=require(_0x0609('0x0'));var rimraf=require(_0x0609('0x1'));var zipdir=require(_0x0609('0x2'));var jsonpatch=require(_0x0609('0x3'));var rp=require(_0x0609('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0609('0x5'));var util=require(_0x0609('0x6'));var path=require(_0x0609('0x7'));var sox=require(_0x0609('0x8'));var csv=require(_0x0609('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0609('0xa'));var _=require(_0x0609('0xb'));var squel=require('squel');var crypto=require(_0x0609('0xc'));var jsforce=require(_0x0609('0xd'));var deskjs=require(_0x0609('0xe'));var toCsv=require(_0x0609('0x9'));var querystring=require(_0x0609('0xf'));var Papa=require(_0x0609('0x10'));var Redis=require(_0x0609('0x11'));var authService=require(_0x0609('0x12'));var qs=require(_0x0609('0x13'));var as=require(_0x0609('0x14'));var hardwareService=require(_0x0609('0x15'));var logger=require('../../config/logger')(_0x0609('0x16'));var utils=require(_0x0609('0x17'));var config=require(_0x0609('0x18'));var licenseUtil=require(_0x0609('0x19'));var db=require(_0x0609('0x1a'))['db'];function respondWithStatusCode(_0x193678,_0x100ab3){_0x100ab3=_0x100ab3||0xcc;return function(_0x30e49a){if(_0x30e49a){return _0x193678['sendStatus'](_0x100ab3);}return _0x193678['status'](_0x100ab3)[_0x0609('0x1b')]();};}function respondWithResult(_0x22fc15,_0x4d1e5c){_0x4d1e5c=_0x4d1e5c||0xc8;return function(_0x4583ac){if(_0x4583ac){return _0x22fc15[_0x0609('0x1c')](_0x4d1e5c)['json'](_0x4583ac);}};}function respondWithFilteredResult(_0x3d25d8,_0x3b6462){return function(_0xd80f13){if(_0xd80f13){var _0x34bce5=typeof _0x3b6462[_0x0609('0x1d')]==='undefined'&&typeof _0x3b6462[_0x0609('0x1e')]===_0x0609('0x1f');var _0x4daba2=_0xd80f13[_0x0609('0x20')];var _0x47cd74=_0x34bce5?0x0:_0x3b6462[_0x0609('0x1d')];var _0x584634=_0x34bce5?_0xd80f13['count']:_0x3b6462[_0x0609('0x1d')]+_0x3b6462['limit'];var _0x5d503d;if(_0x584634>=_0x4daba2){_0x584634=_0x4daba2;_0x5d503d=0xc8;}else{_0x5d503d=0xce;}_0x3d25d8[_0x0609('0x1c')](_0x5d503d);return _0x3d25d8['set'](_0x0609('0x21'),_0x47cd74+'-'+_0x584634+'/'+_0x4daba2)[_0x0609('0x22')](_0xd80f13);}return null;};}function patchUpdates(_0x4db388){return function(_0x5a8c17){try{jsonpatch[_0x0609('0x23')](_0x5a8c17,_0x4db388,!![]);}catch(_0x3ddc6c){return BPromise['reject'](_0x3ddc6c);}return _0x5a8c17[_0x0609('0x24')]();};}function saveUpdates(_0x4bded1,_0x466f8a){return function(_0x112f6d){if(_0x112f6d){return _0x112f6d[_0x0609('0x25')](_0x4bded1)[_0x0609('0x26')](function(_0x15d875){return _0x15d875;});}return null;};}function removeEntity(_0x25fc8f,_0x18a8e3){return function(_0x564826){if(_0x564826){return _0x564826[_0x0609('0x27')]()[_0x0609('0x26')](function(){_0x25fc8f[_0x0609('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a6119,_0x553945){return function(_0x580797){if(!_0x580797){_0x1a6119[_0x0609('0x28')](0x194);}return _0x580797;};}function handleError(_0x4d07be,_0x35faf){_0x35faf=_0x35faf||0x1f4;return function(_0x18b121){logger[_0x0609('0x29')](_0x18b121[_0x0609('0x2a')]);if(_0x18b121['name']){delete _0x18b121['name'];}_0x4d07be[_0x0609('0x1c')](_0x35faf)[_0x0609('0x2b')](_0x18b121);};}exports[_0x0609('0x2c')]=function(_0x10a103,_0x4d2d41){var _0x24fdfa={},_0x11b33c={},_0x3f64ba={'count':0x0,'rows':[]};var _0x3b23c1=_[_0x0609('0x2d')](db[_0x0609('0x2e')][_0x0609('0x2f')],function(_0x439ae9){return{'name':_0x439ae9[_0x0609('0x30')],'type':_0x439ae9[_0x0609('0x31')][_0x0609('0x32')]};});_0x11b33c['model']=_['map'](_0x3b23c1,_0x0609('0x33'));_0x11b33c[_0x0609('0x34')]=_[_0x0609('0x35')](_0x10a103['query']);_0x11b33c[_0x0609('0x36')]=_[_0x0609('0x37')](_0x11b33c[_0x0609('0x38')],_0x11b33c[_0x0609('0x34')]);_0x24fdfa['attributes']=_[_0x0609('0x37')](_0x11b33c[_0x0609('0x38')],qs[_0x0609('0x39')](_0x10a103[_0x0609('0x34')][_0x0609('0x39')]));_0x24fdfa[_0x0609('0x3a')]=_0x24fdfa[_0x0609('0x3a')][_0x0609('0x3b')]?_0x24fdfa[_0x0609('0x3a')]:_0x11b33c[_0x0609('0x38')];if(!_0x10a103[_0x0609('0x34')][_0x0609('0x3c')](_0x0609('0x3d'))){_0x24fdfa[_0x0609('0x1e')]=qs[_0x0609('0x1e')](_0x10a103[_0x0609('0x34')]['limit']);_0x24fdfa[_0x0609('0x1d')]=qs[_0x0609('0x1d')](_0x10a103['query'][_0x0609('0x1d')]);}_0x24fdfa[_0x0609('0x3e')]=qs[_0x0609('0x3f')](_0x10a103[_0x0609('0x34')][_0x0609('0x3f')]);_0x24fdfa['where']=qs[_0x0609('0x36')](_[_0x0609('0x40')](_0x10a103[_0x0609('0x34')],_0x11b33c[_0x0609('0x36')]),_0x3b23c1);if(_0x10a103['query'][_0x0609('0x41')]){_0x24fdfa['where']=_[_0x0609('0x42')](_0x24fdfa['where'],{'$or':_[_0x0609('0x2d')](_0x3b23c1,function(_0x4a1556){if(_0x4a1556[_0x0609('0x31')]!==_0x0609('0x43')){var _0x4aba2f={};_0x4aba2f[_0x4a1556[_0x0609('0x33')]]={'$like':'%'+_0x10a103[_0x0609('0x34')][_0x0609('0x41')]+'%'};return _0x4aba2f;}})});}_0x24fdfa=_['merge']({},_0x24fdfa,_0x10a103[_0x0609('0x44')]);var _0x284961={'where':_0x24fdfa[_0x0609('0x45')]};return db[_0x0609('0x2e')]['count'](_0x284961)[_0x0609('0x26')](function(_0x2e7cf5){_0x3f64ba['count']=_0x2e7cf5;if(_0x10a103[_0x0609('0x34')][_0x0609('0x46')]){_0x24fdfa[_0x0609('0x47')]=[{'all':!![]}];}return db['VtigerField']['findAll'](_0x24fdfa);})[_0x0609('0x26')](function(_0x5862ca){_0x3f64ba[_0x0609('0x48')]=_0x5862ca;return _0x3f64ba;})[_0x0609('0x26')](respondWithFilteredResult(_0x4d2d41,_0x24fdfa))[_0x0609('0x49')](handleError(_0x4d2d41,null));};exports[_0x0609('0x4a')]=function(_0x441427,_0x2d6e80){var _0x45b709={'raw':!![],'where':{'id':_0x441427[_0x0609('0x4b')]['id']}},_0x221e6c={};_0x221e6c[_0x0609('0x38')]=_[_0x0609('0x35')](db[_0x0609('0x2e')][_0x0609('0x2f')]);_0x221e6c[_0x0609('0x34')]=_[_0x0609('0x35')](_0x441427[_0x0609('0x34')]);_0x221e6c[_0x0609('0x36')]=_[_0x0609('0x37')](_0x221e6c[_0x0609('0x38')],_0x221e6c[_0x0609('0x34')]);_0x45b709[_0x0609('0x3a')]=_[_0x0609('0x37')](_0x221e6c[_0x0609('0x38')],qs[_0x0609('0x39')](_0x441427['query']['fields']));_0x45b709['attributes']=_0x45b709[_0x0609('0x3a')][_0x0609('0x3b')]?_0x45b709[_0x0609('0x3a')]:_0x221e6c[_0x0609('0x38')];if(_0x441427['query']['includeAll']){_0x45b709['include']=[{'all':!![]}];}_0x45b709=_[_0x0609('0x42')]({},_0x45b709,_0x441427[_0x0609('0x44')]);return db[_0x0609('0x2e')]['find'](_0x45b709)['then'](handleEntityNotFound(_0x2d6e80,null))[_0x0609('0x26')](respondWithResult(_0x2d6e80,null))[_0x0609('0x49')](handleError(_0x2d6e80,null));};exports['create']=function(_0x48ce92,_0x8c3f6a){return db[_0x0609('0x2e')][_0x0609('0x4c')](_0x48ce92[_0x0609('0x4d')],{})[_0x0609('0x26')](respondWithResult(_0x8c3f6a,0xc9))[_0x0609('0x49')](handleError(_0x8c3f6a,null));};exports[_0x0609('0x25')]=function(_0x3c242d,_0x56d892){if(_0x3c242d[_0x0609('0x4d')]['id']){delete _0x3c242d[_0x0609('0x4d')]['id'];}return db['VtigerField'][_0x0609('0x4e')]({'where':{'id':_0x3c242d[_0x0609('0x4b')]['id']}})['then'](handleEntityNotFound(_0x56d892,null))[_0x0609('0x26')](saveUpdates(_0x3c242d[_0x0609('0x4d')],null))[_0x0609('0x26')](respondWithResult(_0x56d892,null))['catch'](handleError(_0x56d892,null));};exports[_0x0609('0x27')]=function(_0x43edbf,_0x352180){return db['VtigerField'][_0x0609('0x4e')]({'where':{'id':_0x43edbf['params']['id']}})[_0x0609('0x26')](handleEntityNotFound(_0x352180,null))[_0x0609('0x26')](removeEntity(_0x352180,null))['catch'](handleError(_0x352180,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 3810974..e2f7289 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 _0x5ca9=['define','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./intVtigerField.attributes','exports'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x5ca9,0x66));var _0x95ca=function(_0x5ac41b,_0x4aade9){_0x5ac41b=_0x5ac41b-0x0;var _0xd206a5=_0x5ca9[_0x5ac41b];return _0xd206a5;};'use strict';var _=require(_0x95ca('0x0'));var util=require(_0x95ca('0x1'));var logger=require(_0x95ca('0x2'))(_0x95ca('0x3'));var moment=require(_0x95ca('0x4'));var BPromise=require('bluebird');var rp=require(_0x95ca('0x5'));var fs=require('fs');var path=require(_0x95ca('0x6'));var rimraf=require('rimraf');var config=require(_0x95ca('0x7'));var attributes=require(_0x95ca('0x8'));module[_0x95ca('0x9')]=function(_0x37d020,_0x13c306){return _0x37d020[_0x95ca('0xa')](_0x95ca('0xb'),attributes,{'tableName':_0x95ca('0xc'),'paranoid':![],'indexes':[{'name':_0x95ca('0xd'),'fields':[_0x95ca('0xe'),_0x95ca('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x26e0=['request-promise','path','rimraf','../../config/environment','./intVtigerField.attributes','exports','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','lodash','../../config/logger','moment','bluebird'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x26e0,0xa4));var _0x026e=function(_0x206711,_0x4125b4){_0x206711=_0x206711-0x0;var _0x4fe02b=_0x26e0[_0x206711];return _0x4fe02b;};'use strict';var _=require(_0x026e('0x0'));var util=require('util');var logger=require(_0x026e('0x1'))('api');var moment=require(_0x026e('0x2'));var BPromise=require(_0x026e('0x3'));var rp=require(_0x026e('0x4'));var fs=require('fs');var path=require(_0x026e('0x5'));var rimraf=require(_0x026e('0x6'));var config=require(_0x026e('0x7'));var attributes=require(_0x026e('0x8'));module[_0x026e('0x9')]=function(_0x5bc3ce,_0x50f008){return _0x5bc3ce['define'](_0x026e('0xa'),attributes,{'tableName':_0x026e('0xb'),'paranoid':![],'indexes':[{'name':_0x026e('0xc'),'fields':[_0x026e('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js index e49d839..5b54552 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 _0x3643=['request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','error','VtigerField,\x20%s,\x20%s','message','result','lodash','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','request','then','info'];(function(_0x3711a5,_0x306d34){var _0x2ffb29=function(_0x48f9fe){while(--_0x48f9fe){_0x3711a5['push'](_0x3711a5['shift']());}};_0x2ffb29(++_0x306d34);}(_0x3643,0xa9));var _0x3364=function(_0x290104,_0x32951a){_0x290104=_0x290104-0x0;var _0x1ac6fa=_0x3643[_0x290104];return _0x1ac6fa;};'use strict';var _=require(_0x3364('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3364('0x1'));var rs=require(_0x3364('0x2'));var fs=require('fs');var Redis=require(_0x3364('0x3'));var db=require(_0x3364('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3364('0x5'));var config=require('../../config/environment');var jayson=require(_0x3364('0x6'));var client=jayson[_0x3364('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x19d5e6,_0x1898f7,_0x5776f3){return new BPromise(function(_0x2cb3ab,_0x3ca2ad){return client[_0x3364('0x8')](_0x19d5e6,_0x5776f3)[_0x3364('0x9')](function(_0x1de78e){logger[_0x3364('0xa')]('VtigerField,\x20%s,\x20%s',_0x1898f7,_0x3364('0xb'));logger[_0x3364('0xc')](_0x3364('0xd'),_0x1898f7,'request\x20sent',JSON['stringify'](_0x1de78e));if(_0x1de78e[_0x3364('0xe')]){if(_0x1de78e['error']['code']===0x1f4){logger['error'](_0x3364('0xf'),_0x1898f7,_0x1de78e[_0x3364('0xe')][_0x3364('0x10')]);return _0x3ca2ad(_0x1de78e[_0x3364('0xe')][_0x3364('0x10')]);}logger[_0x3364('0xe')](_0x3364('0xf'),_0x1898f7,_0x1de78e[_0x3364('0xe')][_0x3364('0x10')]);return _0x2cb3ab(_0x1de78e[_0x3364('0xe')][_0x3364('0x10')]);}else{logger[_0x3364('0xa')](_0x3364('0xf'),_0x1898f7,_0x3364('0xb'));_0x2cb3ab(_0x1de78e[_0x3364('0x11')][_0x3364('0x10')]);}})['catch'](function(_0x550e92){logger[_0x3364('0xe')](_0x3364('0xf'),_0x1898f7,_0x550e92);_0x3ca2ad(_0x550e92);});});} \ No newline at end of file +var _0xbfbc=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','VtigerField,\x20%s,\x20%s','debug','stringify','error','code','message','info','request\x20sent','result','catch','lodash','moment'];(function(_0x118134,_0x55110f){var _0x8e62ee=function(_0x377d21){while(--_0x377d21){_0x118134['push'](_0x118134['shift']());}};_0x8e62ee(++_0x55110f);}(_0xbfbc,0x185));var _0xcbfb=function(_0x56c243,_0x23b721){_0x56c243=_0x56c243-0x0;var _0x3653f5=_0xbfbc[_0x56c243];return _0x3653f5;};'use strict';var _=require(_0xcbfb('0x0'));var util=require('util');var moment=require(_0xcbfb('0x1'));var BPromise=require(_0xcbfb('0x2'));var rs=require(_0xcbfb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcbfb('0x4'))['db'];var utils=require(_0xcbfb('0x5'));var logger=require(_0xcbfb('0x6'))(_0xcbfb('0x7'));var config=require(_0xcbfb('0x8'));var jayson=require(_0xcbfb('0x9'));var client=jayson[_0xcbfb('0xa')][_0xcbfb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3ab5ed,_0x4f2dc1,_0x4f02af){return new BPromise(function(_0x3bc918,_0x5c083d){return client[_0xcbfb('0xc')](_0x3ab5ed,_0x4f02af)['then'](function(_0xf36f31){logger['info'](_0xcbfb('0xd'),_0x4f2dc1,'request\x20sent');logger[_0xcbfb('0xe')]('VtigerField,\x20%s,\x20%s,\x20%s',_0x4f2dc1,'request\x20sent',JSON[_0xcbfb('0xf')](_0xf36f31));if(_0xf36f31[_0xcbfb('0x10')]){if(_0xf36f31['error'][_0xcbfb('0x11')]===0x1f4){logger['error'](_0xcbfb('0xd'),_0x4f2dc1,_0xf36f31[_0xcbfb('0x10')][_0xcbfb('0x12')]);return _0x5c083d(_0xf36f31[_0xcbfb('0x10')]['message']);}logger[_0xcbfb('0x10')](_0xcbfb('0xd'),_0x4f2dc1,_0xf36f31[_0xcbfb('0x10')][_0xcbfb('0x12')]);return _0x3bc918(_0xf36f31[_0xcbfb('0x10')][_0xcbfb('0x12')]);}else{logger[_0xcbfb('0x13')](_0xcbfb('0xd'),_0x4f2dc1,_0xcbfb('0x14'));_0x3bc918(_0xf36f31[_0xcbfb('0x15')][_0xcbfb('0x12')]);}})[_0xcbfb('0x16')](function(_0x3f8022){logger['error'](_0xcbfb('0xd'),_0x4f2dc1,_0x3f8022);_0x5c083d(_0x3f8022);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 72be98d..42779b3 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 _0x065f=['util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','delete','exports','multer'];(function(_0x12e898,_0x1ef073){var _0x190631=function(_0x1f193d){while(--_0x1f193d){_0x12e898['push'](_0x12e898['shift']());}};_0x190631(++_0x1ef073);}(_0x065f,0x175));var _0xf065=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x065f[_0x59ee6f];return _0x4c0979;};'use strict';var multer=require(_0xf065('0x0'));var util=require(_0xf065('0x1'));var path=require(_0xf065('0x2'));var timeout=require('connect-timeout');var express=require(_0xf065('0x3'));var router=express['Router']();var fs_extra=require(_0xf065('0x4'));var auth=require(_0xf065('0x5'));var interaction=require(_0xf065('0x6'));var config=require(_0xf065('0x7'));var controller=require(_0xf065('0x8'));router[_0xf065('0x9')]('/',auth[_0xf065('0xa')](),controller[_0xf065('0xb')]);router['get'](_0xf065('0xc'),auth[_0xf065('0xa')](),controller[_0xf065('0xd')]);router[_0xf065('0x9')](_0xf065('0xe'),auth[_0xf065('0xa')](),controller[_0xf065('0xf')]);router[_0xf065('0x9')](_0xf065('0x10'),auth[_0xf065('0xa')](),controller[_0xf065('0x11')]);router[_0xf065('0x12')]('/',auth[_0xf065('0xa')](),controller['create']);router[_0xf065('0x12')](_0xf065('0xe'),auth['isAuthenticated'](),controller[_0xf065('0x13')]);router['put']('/:id',auth[_0xf065('0xa')](),controller['update']);router[_0xf065('0x14')]('/:id',auth[_0xf065('0xa')](),controller['destroy']);module[_0xf065('0x15')]=router; \ No newline at end of file +var _0xda5b=['post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields'];(function(_0x382df9,_0x54352a){var _0x58e81e=function(_0x320852){while(--_0x320852){_0x382df9['push'](_0x382df9['shift']());}};_0x58e81e(++_0x54352a);}(_0xda5b,0xc8));var _0xbda5=function(_0x187193,_0x24e49d){_0x187193=_0x187193-0x0;var _0x5002aa=_0xda5b[_0x187193];return _0x5002aa;};'use strict';var multer=require(_0xbda5('0x0'));var util=require(_0xbda5('0x1'));var path=require('path');var timeout=require(_0xbda5('0x2'));var express=require(_0xbda5('0x3'));var router=express['Router']();var fs_extra=require(_0xbda5('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xbda5('0x5'));var config=require(_0xbda5('0x6'));var controller=require(_0xbda5('0x7'));router[_0xbda5('0x8')]('/',auth[_0xbda5('0x9')](),controller[_0xbda5('0xa')]);router[_0xbda5('0x8')](_0xbda5('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xbda5('0x8')](_0xbda5('0xc'),auth['isAuthenticated'](),controller[_0xbda5('0xd')]);router['get'](_0xbda5('0xe'),auth[_0xbda5('0x9')](),controller[_0xbda5('0xf')]);router[_0xbda5('0x10')]('/',auth['isAuthenticated'](),controller[_0xbda5('0x11')]);router[_0xbda5('0x10')](_0xbda5('0xc'),auth[_0xbda5('0x9')](),controller[_0xbda5('0x12')]);router[_0xbda5('0x13')](_0xbda5('0xb'),auth[_0xbda5('0x9')](),controller[_0xbda5('0x14')]);router[_0xbda5('0x15')](_0xbda5('0xb'),auth[_0xbda5('0x9')](),controller[_0xbda5('0x16')]);module[_0xbda5('0x17')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 81fd99a..8b0a8d2 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 _0x6c65=['password','integrationTab','newTab','sequelize','exports','STRING','username','remoteUri','ENUM'];(function(_0x8e4355,_0x156e9d){var _0x39b02d=function(_0x3e7068){while(--_0x3e7068){_0x8e4355['push'](_0x8e4355['shift']());}};_0x39b02d(++_0x156e9d);}(_0x6c65,0x78));var _0x56c6=function(_0x4ac4d4,_0x5d7418){_0x4ac4d4=_0x4ac4d4-0x0;var _0x272afb=_0x6c65[_0x4ac4d4];return _0x272afb;};'use strict';var Sequelize=require(_0x56c6('0x0'));module[_0x56c6('0x1')]={'name':{'type':Sequelize[_0x56c6('0x2')]},'description':{'type':Sequelize[_0x56c6('0x2')]},'username':{'type':Sequelize[_0x56c6('0x2')],'unique':_0x56c6('0x3')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x56c6('0x2')]},'remoteUri':{'type':Sequelize[_0x56c6('0x2')],'unique':_0x56c6('0x4')},'authType':{'type':Sequelize[_0x56c6('0x5')](_0x56c6('0x6'),'token'),'defaultValue':_0x56c6('0x6')},'serverUrl':{'type':Sequelize[_0x56c6('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x56c6('0x5')](_0x56c6('0x7'),_0x56c6('0x8')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x4c60=['integrationTab','sequelize','exports','STRING','username','ENUM','password','token'];(function(_0x21a27e,_0x597360){var _0x5d8852=function(_0x372826){while(--_0x372826){_0x21a27e['push'](_0x21a27e['shift']());}};_0x5d8852(++_0x597360);}(_0x4c60,0xc1));var _0x04c6=function(_0x3a7166,_0x5bb5c4){_0x3a7166=_0x3a7166-0x0;var _0x12a2ce=_0x4c60[_0x3a7166];return _0x12a2ce;};'use strict';var Sequelize=require(_0x04c6('0x0'));module[_0x04c6('0x1')]={'name':{'type':Sequelize[_0x04c6('0x2')]},'description':{'type':Sequelize[_0x04c6('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x04c6('0x3')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'authType':{'type':Sequelize[_0x04c6('0x4')](_0x04c6('0x5'),_0x04c6('0x6')),'defaultValue':_0x04c6('0x5')},'serverUrl':{'type':Sequelize[_0x04c6('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x04c6('0x4')](_0x04c6('0x7'),'newTab'),'defaultValue':_0x04c6('0x7')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 834285b..f51ecb6 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 _0xe706=['getConfigurations','findOne','ZendeskConfiguration','pick','hasOwnProperty','AccountId','Subjects','getSubjects','Descriptions','channel','ZendeskField','getFields','username','token','authType','remoteUri','slice','substring','GET','format','password','headers','Basic\x20%s','base64','%s/token:%s','toString','Sequelize','ValidationError','Unknown\x20authentication\x20type','description','remove','includes','ticket_fields','title','position','system_field_options','custom_field_options','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','json','offset','undefined','limit','status','set','Content-Range','apply','reject','save','update','then','stack','name','send','map','ZendeskAccount','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','count','findAll','rows','show','includeAll','include','find','create','body','catch','params'];(function(_0x211bc3,_0x5860c8){var _0x34c9a2=function(_0x4bfa37){while(--_0x4bfa37){_0x211bc3['push'](_0x211bc3['shift']());}};_0x34c9a2(++_0x5860c8);}(_0xe706,0xa3));var _0x6e70=function(_0x49036e,_0x1eed49){_0x49036e=_0x49036e-0x0;var _0xb21daf=_0xe706[_0x49036e];return _0xb21daf;};'use strict';var emlformat=require(_0x6e70('0x0'));var rimraf=require(_0x6e70('0x1'));var zipdir=require(_0x6e70('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6e70('0x3'));var moment=require(_0x6e70('0x4'));var BPromise=require(_0x6e70('0x5'));var Mustache=require(_0x6e70('0x6'));var util=require(_0x6e70('0x7'));var path=require(_0x6e70('0x8'));var sox=require(_0x6e70('0x9'));var csv=require(_0x6e70('0xa'));var ejs=require(_0x6e70('0xb'));var fs=require('fs');var fs_extra=require(_0x6e70('0xc'));var _=require(_0x6e70('0xd'));var squel=require(_0x6e70('0xe'));var crypto=require(_0x6e70('0xf'));var jsforce=require(_0x6e70('0x10'));var deskjs=require(_0x6e70('0x11'));var toCsv=require(_0x6e70('0xa'));var querystring=require(_0x6e70('0x12'));var Papa=require(_0x6e70('0x13'));var Redis=require(_0x6e70('0x14'));var authService=require(_0x6e70('0x15'));var qs=require(_0x6e70('0x16'));var as=require(_0x6e70('0x17'));var hardwareService=require(_0x6e70('0x18'));var logger=require(_0x6e70('0x19'))('api');var utils=require('../../config/utils');var config=require(_0x6e70('0x1a'));var licenseUtil=require(_0x6e70('0x1b'));var db=require(_0x6e70('0x1c'))['db'];var integrations=require(_0x6e70('0x1d'));function respondWithStatusCode(_0x3b38f3,_0x310eb7){_0x310eb7=_0x310eb7||0xcc;return function(_0xa1eb74){if(_0xa1eb74){return _0x3b38f3[_0x6e70('0x1e')](_0x310eb7);}return _0x3b38f3['status'](_0x310eb7)['end']();};}function respondWithResult(_0x48bc72,_0x257e81){_0x257e81=_0x257e81||0xc8;return function(_0x5a37a6){if(_0x5a37a6){return _0x48bc72['status'](_0x257e81)[_0x6e70('0x1f')](_0x5a37a6);}};}function respondWithFilteredResult(_0x22c50c,_0x5d9263){return function(_0x24f3ac){if(_0x24f3ac){var _0x5c3fe7=typeof _0x5d9263[_0x6e70('0x20')]===_0x6e70('0x21')&&typeof _0x5d9263['limit']==='undefined';var _0x3bd572=_0x24f3ac['count'];var _0x28a21f=_0x5c3fe7?0x0:_0x5d9263[_0x6e70('0x20')];var _0x53acdc=_0x5c3fe7?_0x24f3ac['count']:_0x5d9263[_0x6e70('0x20')]+_0x5d9263[_0x6e70('0x22')];var _0x2368eb;if(_0x53acdc>=_0x3bd572){_0x53acdc=_0x3bd572;_0x2368eb=0xc8;}else{_0x2368eb=0xce;}_0x22c50c[_0x6e70('0x23')](_0x2368eb);return _0x22c50c[_0x6e70('0x24')](_0x6e70('0x25'),_0x28a21f+'-'+_0x53acdc+'/'+_0x3bd572)[_0x6e70('0x1f')](_0x24f3ac);}return null;};}function patchUpdates(_0x44a49f){return function(_0x29326f){try{jsonpatch[_0x6e70('0x26')](_0x29326f,_0x44a49f,!![]);}catch(_0x4a0cfe){return BPromise[_0x6e70('0x27')](_0x4a0cfe);}return _0x29326f[_0x6e70('0x28')]();};}function saveUpdates(_0x27b294,_0x502b2d){return function(_0x3ccd87){if(_0x3ccd87){return _0x3ccd87[_0x6e70('0x29')](_0x27b294)[_0x6e70('0x2a')](function(_0x50da2c){return _0x50da2c;});}return null;};}function removeEntity(_0x10fc91,_0x538b9c){return function(_0x50aec2){if(_0x50aec2){return _0x50aec2['destroy']()[_0x6e70('0x2a')](function(){_0x10fc91[_0x6e70('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ecdf1,_0x1196ed){return function(_0x5f268f){if(!_0x5f268f){_0x3ecdf1[_0x6e70('0x1e')](0x194);}return _0x5f268f;};}function handleError(_0x67fb43,_0x2bb231){_0x2bb231=_0x2bb231||0x1f4;return function(_0x4a67ac){logger['error'](_0x4a67ac[_0x6e70('0x2b')]);if(_0x4a67ac[_0x6e70('0x2c')]){delete _0x4a67ac[_0x6e70('0x2c')];}_0x67fb43[_0x6e70('0x23')](_0x2bb231)[_0x6e70('0x2d')](_0x4a67ac);};}exports['index']=function(_0x1952ea,_0x406f29){var _0xecf336={},_0x2864a0={},_0x396a67={'count':0x0,'rows':[]};var _0x20a225=_[_0x6e70('0x2e')](db[_0x6e70('0x2f')][_0x6e70('0x30')],function(_0x3a5d30){return{'name':_0x3a5d30['fieldName'],'type':_0x3a5d30[_0x6e70('0x31')]['key']};});_0x2864a0[_0x6e70('0x32')]=_['map'](_0x20a225,_0x6e70('0x2c'));_0x2864a0[_0x6e70('0x33')]=_[_0x6e70('0x34')](_0x1952ea['query']);_0x2864a0[_0x6e70('0x35')]=_[_0x6e70('0x36')](_0x2864a0['model'],_0x2864a0[_0x6e70('0x33')]);_0xecf336[_0x6e70('0x37')]=_['intersection'](_0x2864a0[_0x6e70('0x32')],qs[_0x6e70('0x38')](_0x1952ea[_0x6e70('0x33')][_0x6e70('0x38')]));_0xecf336[_0x6e70('0x37')]=_0xecf336[_0x6e70('0x37')][_0x6e70('0x39')]?_0xecf336[_0x6e70('0x37')]:_0x2864a0[_0x6e70('0x32')];if(!_0x1952ea[_0x6e70('0x33')]['hasOwnProperty'](_0x6e70('0x3a'))){_0xecf336['limit']=qs[_0x6e70('0x22')](_0x1952ea[_0x6e70('0x33')][_0x6e70('0x22')]);_0xecf336[_0x6e70('0x20')]=qs[_0x6e70('0x20')](_0x1952ea[_0x6e70('0x33')][_0x6e70('0x20')]);}_0xecf336[_0x6e70('0x3b')]=qs[_0x6e70('0x3c')](_0x1952ea[_0x6e70('0x33')][_0x6e70('0x3c')]);_0xecf336[_0x6e70('0x3d')]=qs[_0x6e70('0x35')](_['pick'](_0x1952ea['query'],_0x2864a0['filters']),_0x20a225);if(_0x1952ea[_0x6e70('0x33')][_0x6e70('0x3e')]){_0xecf336[_0x6e70('0x3d')]=_[_0x6e70('0x3f')](_0xecf336[_0x6e70('0x3d')],{'$or':_[_0x6e70('0x2e')](_0x20a225,function(_0x572a71){if(_0x572a71[_0x6e70('0x31')]!==_0x6e70('0x40')){var _0x1c5cde={};_0x1c5cde[_0x572a71[_0x6e70('0x2c')]]={'$like':'%'+_0x1952ea[_0x6e70('0x33')][_0x6e70('0x3e')]+'%'};return _0x1c5cde;}})});}_0xecf336=_[_0x6e70('0x3f')]({},_0xecf336,_0x1952ea[_0x6e70('0x41')]);var _0x5be100={'where':_0xecf336[_0x6e70('0x3d')]};return db[_0x6e70('0x2f')][_0x6e70('0x42')](_0x5be100)[_0x6e70('0x2a')](function(_0x201da9){_0x396a67[_0x6e70('0x42')]=_0x201da9;if(_0x1952ea[_0x6e70('0x33')]['includeAll']){_0xecf336['include']=[{'all':!![]}];}return db['ZendeskAccount'][_0x6e70('0x43')](_0xecf336);})[_0x6e70('0x2a')](function(_0x83847b){_0x396a67[_0x6e70('0x44')]=_0x83847b;return _0x396a67;})[_0x6e70('0x2a')](respondWithFilteredResult(_0x406f29,_0xecf336))['catch'](handleError(_0x406f29,null));};exports[_0x6e70('0x45')]=function(_0x2a58d7,_0x2a2aca){var _0x52b197={'raw':![],'where':{'id':_0x2a58d7['params']['id']}},_0x544ad0={};_0x544ad0[_0x6e70('0x32')]=_['keys'](db[_0x6e70('0x2f')][_0x6e70('0x30')]);_0x544ad0[_0x6e70('0x33')]=_[_0x6e70('0x34')](_0x2a58d7['query']);_0x544ad0[_0x6e70('0x35')]=_['intersection'](_0x544ad0[_0x6e70('0x32')],_0x544ad0[_0x6e70('0x33')]);_0x52b197[_0x6e70('0x37')]=_[_0x6e70('0x36')](_0x544ad0['model'],qs[_0x6e70('0x38')](_0x2a58d7[_0x6e70('0x33')][_0x6e70('0x38')]));_0x52b197[_0x6e70('0x37')]=_0x52b197[_0x6e70('0x37')][_0x6e70('0x39')]?_0x52b197[_0x6e70('0x37')]:_0x544ad0['model'];if(_0x2a58d7[_0x6e70('0x33')][_0x6e70('0x46')]){_0x52b197[_0x6e70('0x47')]=[{'all':!![]}];}_0x52b197=_[_0x6e70('0x3f')]({},_0x52b197,_0x2a58d7[_0x6e70('0x41')]);return db[_0x6e70('0x2f')][_0x6e70('0x48')](_0x52b197)['then'](handleEntityNotFound(_0x2a2aca,null))[_0x6e70('0x2a')](respondWithResult(_0x2a2aca,null))['catch'](handleError(_0x2a2aca,null));};exports[_0x6e70('0x49')]=function(_0x3836e4,_0x4b351e){return db['ZendeskAccount'][_0x6e70('0x49')](_0x3836e4[_0x6e70('0x4a')],{})[_0x6e70('0x2a')](respondWithResult(_0x4b351e,0xc9))['catch'](handleError(_0x4b351e,null));};exports['update']=function(_0x238ebb,_0x11ac3d){if(_0x238ebb[_0x6e70('0x4a')]['id']){delete _0x238ebb[_0x6e70('0x4a')]['id'];}return db[_0x6e70('0x2f')][_0x6e70('0x48')]({'where':{'id':_0x238ebb['params']['id']}})[_0x6e70('0x2a')](handleEntityNotFound(_0x11ac3d,null))[_0x6e70('0x2a')](saveUpdates(_0x238ebb[_0x6e70('0x4a')],null))[_0x6e70('0x2a')](respondWithResult(_0x11ac3d,null))[_0x6e70('0x4b')](handleError(_0x11ac3d,null));};exports['destroy']=function(_0x4ae901,_0x2c5538){return db[_0x6e70('0x2f')][_0x6e70('0x48')]({'where':{'id':_0x4ae901[_0x6e70('0x4c')]['id']}})[_0x6e70('0x2a')](handleEntityNotFound(_0x2c5538,null))['then'](removeEntity(_0x2c5538,null))[_0x6e70('0x4b')](handleError(_0x2c5538,null));};exports[_0x6e70('0x4d')]=function(_0x1fa320,_0x23ebfb,_0x3aba34){var _0x4a111a={};var _0x1142cd={};var _0x1dd242;var _0x2c20d3;return db[_0x6e70('0x2f')][_0x6e70('0x4e')]({'where':{'id':_0x1fa320[_0x6e70('0x4c')]['id']}})['then'](handleEntityNotFound(_0x23ebfb,null))[_0x6e70('0x2a')](function(_0x8d425d){if(_0x8d425d){_0x1dd242=_0x8d425d;_0x1142cd['model']=_[_0x6e70('0x34')](db[_0x6e70('0x4f')]['rawAttributes']);_0x1142cd[_0x6e70('0x33')]=_[_0x6e70('0x34')](_0x1fa320[_0x6e70('0x33')]);_0x1142cd[_0x6e70('0x35')]=_[_0x6e70('0x36')](_0x1142cd['model'],_0x1142cd[_0x6e70('0x33')]);_0x4a111a[_0x6e70('0x37')]=_[_0x6e70('0x36')](_0x1142cd[_0x6e70('0x32')],qs[_0x6e70('0x38')](_0x1fa320[_0x6e70('0x33')][_0x6e70('0x38')]));_0x4a111a[_0x6e70('0x37')]=_0x4a111a[_0x6e70('0x37')][_0x6e70('0x39')]?_0x4a111a[_0x6e70('0x37')]:_0x1142cd[_0x6e70('0x32')];_0x4a111a[_0x6e70('0x3b')]=qs[_0x6e70('0x3c')](_0x1fa320[_0x6e70('0x33')][_0x6e70('0x3c')]);_0x4a111a[_0x6e70('0x3d')]=qs[_0x6e70('0x35')](_[_0x6e70('0x50')](_0x1fa320[_0x6e70('0x33')],_0x1142cd['filters']));if(_0x1fa320[_0x6e70('0x33')][_0x6e70('0x3e')]){_0x4a111a[_0x6e70('0x3d')]=_[_0x6e70('0x3f')](_0x4a111a[_0x6e70('0x3d')],{'$or':_[_0x6e70('0x2e')](_0x4a111a['attributes'],function(_0x42bd85){var _0x6cabf0={};_0x6cabf0[_0x42bd85]={'$like':'%'+_0x1fa320['query'][_0x6e70('0x3e')]+'%'};return _0x6cabf0;})});}_0x4a111a=_[_0x6e70('0x3f')]({},_0x4a111a,_0x1fa320[_0x6e70('0x41')]);return _0x1dd242['getConfigurations'](_0x4a111a);}})['then'](function(_0x2f9be4){if(_0x2f9be4){_0x2c20d3=_0x2f9be4[_0x6e70('0x39')];if(!_0x1fa320[_0x6e70('0x33')][_0x6e70('0x51')](_0x6e70('0x3a'))){_0x4a111a[_0x6e70('0x22')]=qs[_0x6e70('0x22')](_0x1fa320['query']['limit']);_0x4a111a[_0x6e70('0x20')]=qs[_0x6e70('0x20')](_0x1fa320[_0x6e70('0x33')][_0x6e70('0x20')]);}return _0x1dd242['getConfigurations'](_0x4a111a);}})['then'](function(_0x2e972b){if(_0x2e972b){return _0x2e972b?{'count':_0x2c20d3,'rows':_0x2e972b}:null;}})[_0x6e70('0x2a')](respondWithResult(_0x23ebfb,null))['catch'](handleError(_0x23ebfb,null));};exports['addConfiguration']=function(_0x355708,_0x47fbed,_0x2a8fb7){if(_0x355708[_0x6e70('0x4a')]['id']){delete _0x355708[_0x6e70('0x4a')]['id'];}return db[_0x6e70('0x2f')][_0x6e70('0x4e')]({'where':{'id':_0x355708[_0x6e70('0x4c')]['id']}})[_0x6e70('0x2a')](handleEntityNotFound(_0x47fbed,null))[_0x6e70('0x2a')](function(_0x570115){if(_0x570115){_0x355708[_0x6e70('0x4a')][_0x6e70('0x52')]=_0x570115['id'];_0x355708[_0x6e70('0x4a')][_0x6e70('0x53')]=integrations[_0x6e70('0x54')](_0x355708['body']['channel'],_0x355708['body'][_0x6e70('0x31')]);_0x355708[_0x6e70('0x4a')][_0x6e70('0x55')]=integrations['getDescriptions'](_0x355708['body'][_0x6e70('0x56')],_0x355708[_0x6e70('0x4a')][_0x6e70('0x31')]);return db[_0x6e70('0x4f')][_0x6e70('0x49')](_0x355708[_0x6e70('0x4a')],{'include':[{'model':db['ZendeskField'],'as':_0x6e70('0x53')},{'model':db[_0x6e70('0x57')],'as':_0x6e70('0x55')}]});}return null;})[_0x6e70('0x2a')](respondWithResult(_0x47fbed,null))['catch'](handleError(_0x47fbed,null));};exports[_0x6e70('0x58')]=function(_0x531097,_0x5b4046,_0x30487b){var _0x3249a5='';return db[_0x6e70('0x2f')][_0x6e70('0x4e')]({'where':{'id':_0x531097[_0x6e70('0x4c')]['id']},'attributes':['id',_0x6e70('0x59'),'password',_0x6e70('0x5a'),_0x6e70('0x5b'),_0x6e70('0x5c')]})[_0x6e70('0x2a')](handleEntityNotFound(_0x5b4046,null))[_0x6e70('0x2a')](function(_0x13c092){if(_0x13c092){_0x3249a5=_0x13c092[_0x6e70('0x5c')];var _0xd9b4a9=_0x3249a5[_0x6e70('0x5d')](-0x1);if(_0xd9b4a9==='/'){_0x3249a5=_0x3249a5[_0x6e70('0x5e')](0x0,_0x3249a5['lastIndexOf'](_0xd9b4a9));}var _0x44c877={'method':_0x6e70('0x5f'),'uri':util[_0x6e70('0x60')]('%s/%s',_0x3249a5,'ticket_fields'),'json':!![]};switch(_0x13c092[_0x6e70('0x5b')]){case _0x6e70('0x61'):_0x44c877[_0x6e70('0x62')]={'Authorization':util[_0x6e70('0x60')](_0x6e70('0x63'),new Buffer(util['format']('%s:%s',_0x13c092[_0x6e70('0x59')],_0x13c092[_0x6e70('0x61')]))['toString'](_0x6e70('0x64')))};break;case _0x6e70('0x5a'):_0x44c877[_0x6e70('0x62')]={'Authorization':util[_0x6e70('0x60')](_0x6e70('0x63'),new Buffer(util[_0x6e70('0x60')](_0x6e70('0x65'),_0x13c092[_0x6e70('0x59')],_0x13c092[_0x6e70('0x5a')]))[_0x6e70('0x66')](_0x6e70('0x64')))};break;default:throw new db[(_0x6e70('0x67'))][(_0x6e70('0x68'))](_0x6e70('0x69'));}return rp(_0x44c877);}})['then'](function(_0x5b3cb0){if(_0x5b3cb0){var _0x39ed95=['subject',_0x6e70('0x6a'),'group','assignee'];_[_0x6e70('0x6b')](_0x5b3cb0['ticket_fields'],function(_0x576069){return _0x39ed95[_0x6e70('0x6c')](_0x576069[_0x6e70('0x31')]);});return{'count':_0x5b3cb0[_0x6e70('0x6d')]['length'],'rows':_['map'](_0x5b3cb0['ticket_fields'],function(_0x3e7be7){return{'id':_0x3e7be7['id'],'name':_0x3e7be7['position']>0x7?_0x3e7be7[_0x6e70('0x6e')]:_0x3e7be7[_0x6e70('0x31')],'custom':_0x3e7be7[_0x6e70('0x6f')]>0x7?!![]:![],'options':_0x3e7be7[_0x6e70('0x70')]?_0x3e7be7[_0x6e70('0x70')]:_0x3e7be7[_0x6e70('0x71')]?_0x3e7be7[_0x6e70('0x71')]:[]};})};}})['then'](respondWithResult(_0x5b4046,null))[_0x6e70('0x4b')](function(_0x2493b0){var _0xb649a6=_0x531097['query'][_0x6e70('0x72')]?0x1f4:_0x2493b0[_0x6e70('0x73')]||0x1f4;logger[_0x6e70('0x74')](_0x6e70('0x75'),_0x6e70('0x58'),_0xb649a6,JSON[_0x6e70('0x76')](_0x2493b0));delete _0x2493b0[_0x6e70('0x2c')];if(_0xb649a6===0x191){_0xb649a6=0x190;}_0x5b4046[_0x6e70('0x23')](_0xb649a6)[_0x6e70('0x2d')](_0x531097['query'][_0x6e70('0x72')]?{'message':_0x6e70('0x77'),'statusCode':_0x2493b0['statusCode']}:_0x2493b0);});}; \ No newline at end of file +var _0x3c81=['toString','base64','headers','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','group','remove','ticket_fields','includes','position','title','system_field_options','custom_field_options','test','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','statusCode','eml-format','rimraf','fast-json-patch','request-promise','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','name','map','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','where','merge','options','ZendeskAccount','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','destroy','getConfigurations','findOne','order','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','type','ZendeskConfiguration','ZendeskField','getFields','username','password','token','remoteUri','slice','lastIndexOf','GET','format','%s/%s','authType','Basic\x20%s','%s:%s'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x3c81,0x102));var _0x13c8=function(_0x45dee0,_0x4f91f0){_0x45dee0=_0x45dee0-0x0;var _0x52dbd0=_0x3c81[_0x45dee0];return _0x52dbd0;};'use strict';var emlformat=require(_0x13c8('0x0'));var rimraf=require(_0x13c8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x13c8('0x2'));var rp=require(_0x13c8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x13c8('0x4'));var sox=require(_0x13c8('0x5'));var csv=require(_0x13c8('0x6'));var ejs=require(_0x13c8('0x7'));var fs=require('fs');var fs_extra=require(_0x13c8('0x8'));var _=require(_0x13c8('0x9'));var squel=require(_0x13c8('0xa'));var crypto=require('crypto');var jsforce=require(_0x13c8('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x13c8('0x6'));var querystring=require(_0x13c8('0xc'));var Papa=require(_0x13c8('0xd'));var Redis=require(_0x13c8('0xe'));var authService=require(_0x13c8('0xf'));var qs=require(_0x13c8('0x10'));var as=require(_0x13c8('0x11'));var hardwareService=require(_0x13c8('0x12'));var logger=require(_0x13c8('0x13'))(_0x13c8('0x14'));var utils=require(_0x13c8('0x15'));var config=require(_0x13c8('0x16'));var licenseUtil=require(_0x13c8('0x17'));var db=require(_0x13c8('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x21442d,_0x7b6da8){_0x7b6da8=_0x7b6da8||0xcc;return function(_0x2304b5){if(_0x2304b5){return _0x21442d[_0x13c8('0x19')](_0x7b6da8);}return _0x21442d['status'](_0x7b6da8)[_0x13c8('0x1a')]();};}function respondWithResult(_0x515681,_0x4d7a88){_0x4d7a88=_0x4d7a88||0xc8;return function(_0x589636){if(_0x589636){return _0x515681[_0x13c8('0x1b')](_0x4d7a88)['json'](_0x589636);}};}function respondWithFilteredResult(_0x337397,_0x17a3c1){return function(_0x23f64e){if(_0x23f64e){var _0x7cbfb=typeof _0x17a3c1['offset']===_0x13c8('0x1c')&&typeof _0x17a3c1[_0x13c8('0x1d')]===_0x13c8('0x1c');var _0x3bc5a9=_0x23f64e[_0x13c8('0x1e')];var _0x28f07e=_0x7cbfb?0x0:_0x17a3c1[_0x13c8('0x1f')];var _0x251c38=_0x7cbfb?_0x23f64e[_0x13c8('0x1e')]:_0x17a3c1[_0x13c8('0x1f')]+_0x17a3c1[_0x13c8('0x1d')];var _0x5ac776;if(_0x251c38>=_0x3bc5a9){_0x251c38=_0x3bc5a9;_0x5ac776=0xc8;}else{_0x5ac776=0xce;}_0x337397[_0x13c8('0x1b')](_0x5ac776);return _0x337397[_0x13c8('0x20')](_0x13c8('0x21'),_0x28f07e+'-'+_0x251c38+'/'+_0x3bc5a9)[_0x13c8('0x22')](_0x23f64e);}return null;};}function patchUpdates(_0x513085){return function(_0x1fb714){try{jsonpatch[_0x13c8('0x23')](_0x1fb714,_0x513085,!![]);}catch(_0x3e3951){return BPromise[_0x13c8('0x24')](_0x3e3951);}return _0x1fb714[_0x13c8('0x25')]();};}function saveUpdates(_0x2fc123,_0x5ab47f){return function(_0x28f99c){if(_0x28f99c){return _0x28f99c[_0x13c8('0x26')](_0x2fc123)[_0x13c8('0x27')](function(_0xcf41d2){return _0xcf41d2;});}return null;};}function removeEntity(_0x577df6,_0x1770e5){return function(_0x458217){if(_0x458217){return _0x458217['destroy']()['then'](function(){_0x577df6[_0x13c8('0x1b')](0xcc)[_0x13c8('0x1a')]();});}};}function handleEntityNotFound(_0x47e8ae,_0x5ad0dc){return function(_0x288c3c){if(!_0x288c3c){_0x47e8ae[_0x13c8('0x19')](0x194);}return _0x288c3c;};}function handleError(_0x53ada9,_0x4df077){_0x4df077=_0x4df077||0x1f4;return function(_0x196983){logger['error'](_0x196983['stack']);if(_0x196983[_0x13c8('0x28')]){delete _0x196983[_0x13c8('0x28')];}_0x53ada9[_0x13c8('0x1b')](_0x4df077)['send'](_0x196983);};}exports['index']=function(_0x277a89,_0x1071a0){var _0x399840={},_0x441182={},_0x138017={'count':0x0,'rows':[]};var _0x220d40=_[_0x13c8('0x29')](db['ZendeskAccount'][_0x13c8('0x2a')],function(_0xcbc9b7){return{'name':_0xcbc9b7['fieldName'],'type':_0xcbc9b7['type'][_0x13c8('0x2b')]};});_0x441182[_0x13c8('0x2c')]=_['map'](_0x220d40,_0x13c8('0x28'));_0x441182[_0x13c8('0x2d')]=_['keys'](_0x277a89[_0x13c8('0x2d')]);_0x441182[_0x13c8('0x2e')]=_[_0x13c8('0x2f')](_0x441182[_0x13c8('0x2c')],_0x441182[_0x13c8('0x2d')]);_0x399840[_0x13c8('0x30')]=_[_0x13c8('0x2f')](_0x441182[_0x13c8('0x2c')],qs['fields'](_0x277a89['query'][_0x13c8('0x31')]));_0x399840[_0x13c8('0x30')]=_0x399840['attributes'][_0x13c8('0x32')]?_0x399840['attributes']:_0x441182[_0x13c8('0x2c')];if(!_0x277a89['query'][_0x13c8('0x33')](_0x13c8('0x34'))){_0x399840[_0x13c8('0x1d')]=qs[_0x13c8('0x1d')](_0x277a89[_0x13c8('0x2d')][_0x13c8('0x1d')]);_0x399840[_0x13c8('0x1f')]=qs['offset'](_0x277a89[_0x13c8('0x2d')][_0x13c8('0x1f')]);}_0x399840['order']=qs[_0x13c8('0x35')](_0x277a89[_0x13c8('0x2d')][_0x13c8('0x35')]);_0x399840['where']=qs['filters'](_['pick'](_0x277a89[_0x13c8('0x2d')],_0x441182[_0x13c8('0x2e')]),_0x220d40);if(_0x277a89[_0x13c8('0x2d')][_0x13c8('0x36')]){_0x399840[_0x13c8('0x37')]=_[_0x13c8('0x38')](_0x399840[_0x13c8('0x37')],{'$or':_[_0x13c8('0x29')](_0x220d40,function(_0xf818be){if(_0xf818be['type']!=='VIRTUAL'){var _0x27e11b={};_0x27e11b[_0xf818be[_0x13c8('0x28')]]={'$like':'%'+_0x277a89[_0x13c8('0x2d')][_0x13c8('0x36')]+'%'};return _0x27e11b;}})});}_0x399840=_['merge']({},_0x399840,_0x277a89[_0x13c8('0x39')]);var _0x4bd627={'where':_0x399840[_0x13c8('0x37')]};return db[_0x13c8('0x3a')][_0x13c8('0x1e')](_0x4bd627)[_0x13c8('0x27')](function(_0xbb1d49){_0x138017[_0x13c8('0x1e')]=_0xbb1d49;if(_0x277a89[_0x13c8('0x2d')][_0x13c8('0x3b')]){_0x399840[_0x13c8('0x3c')]=[{'all':!![]}];}return db[_0x13c8('0x3a')][_0x13c8('0x3d')](_0x399840);})[_0x13c8('0x27')](function(_0x89bbab){_0x138017[_0x13c8('0x3e')]=_0x89bbab;return _0x138017;})[_0x13c8('0x27')](respondWithFilteredResult(_0x1071a0,_0x399840))[_0x13c8('0x3f')](handleError(_0x1071a0,null));};exports[_0x13c8('0x40')]=function(_0x1505fb,_0xc5eb86){var _0x1cff99={'raw':![],'where':{'id':_0x1505fb[_0x13c8('0x41')]['id']}},_0x3622d6={};_0x3622d6[_0x13c8('0x2c')]=_[_0x13c8('0x42')](db[_0x13c8('0x3a')]['rawAttributes']);_0x3622d6[_0x13c8('0x2d')]=_[_0x13c8('0x42')](_0x1505fb[_0x13c8('0x2d')]);_0x3622d6[_0x13c8('0x2e')]=_[_0x13c8('0x2f')](_0x3622d6['model'],_0x3622d6['query']);_0x1cff99[_0x13c8('0x30')]=_[_0x13c8('0x2f')](_0x3622d6[_0x13c8('0x2c')],qs['fields'](_0x1505fb['query']['fields']));_0x1cff99[_0x13c8('0x30')]=_0x1cff99['attributes'][_0x13c8('0x32')]?_0x1cff99['attributes']:_0x3622d6[_0x13c8('0x2c')];if(_0x1505fb[_0x13c8('0x2d')][_0x13c8('0x3b')]){_0x1cff99[_0x13c8('0x3c')]=[{'all':!![]}];}_0x1cff99=_[_0x13c8('0x38')]({},_0x1cff99,_0x1505fb[_0x13c8('0x39')]);return db['ZendeskAccount'][_0x13c8('0x43')](_0x1cff99)[_0x13c8('0x27')](handleEntityNotFound(_0xc5eb86,null))['then'](respondWithResult(_0xc5eb86,null))[_0x13c8('0x3f')](handleError(_0xc5eb86,null));};exports[_0x13c8('0x44')]=function(_0x2e925f,_0x162918){return db[_0x13c8('0x3a')]['create'](_0x2e925f[_0x13c8('0x45')],{})[_0x13c8('0x27')](respondWithResult(_0x162918,0xc9))[_0x13c8('0x3f')](handleError(_0x162918,null));};exports[_0x13c8('0x26')]=function(_0x185d18,_0x59ec9f){if(_0x185d18[_0x13c8('0x45')]['id']){delete _0x185d18[_0x13c8('0x45')]['id'];}return db[_0x13c8('0x3a')][_0x13c8('0x43')]({'where':{'id':_0x185d18[_0x13c8('0x41')]['id']}})[_0x13c8('0x27')](handleEntityNotFound(_0x59ec9f,null))[_0x13c8('0x27')](saveUpdates(_0x185d18[_0x13c8('0x45')],null))[_0x13c8('0x27')](respondWithResult(_0x59ec9f,null))[_0x13c8('0x3f')](handleError(_0x59ec9f,null));};exports[_0x13c8('0x46')]=function(_0x5e1fe5,_0x10ba7c){return db[_0x13c8('0x3a')][_0x13c8('0x43')]({'where':{'id':_0x5e1fe5[_0x13c8('0x41')]['id']}})[_0x13c8('0x27')](handleEntityNotFound(_0x10ba7c,null))[_0x13c8('0x27')](removeEntity(_0x10ba7c,null))['catch'](handleError(_0x10ba7c,null));};exports[_0x13c8('0x47')]=function(_0x416e4f,_0x2f1e83,_0x481205){var _0x54e0c8={};var _0x3d4863={};var _0x14a738;var _0x55d353;return db[_0x13c8('0x3a')][_0x13c8('0x48')]({'where':{'id':_0x416e4f['params']['id']}})[_0x13c8('0x27')](handleEntityNotFound(_0x2f1e83,null))['then'](function(_0x242791){if(_0x242791){_0x14a738=_0x242791;_0x3d4863[_0x13c8('0x2c')]=_[_0x13c8('0x42')](db['ZendeskConfiguration'][_0x13c8('0x2a')]);_0x3d4863[_0x13c8('0x2d')]=_['keys'](_0x416e4f[_0x13c8('0x2d')]);_0x3d4863['filters']=_[_0x13c8('0x2f')](_0x3d4863[_0x13c8('0x2c')],_0x3d4863[_0x13c8('0x2d')]);_0x54e0c8[_0x13c8('0x30')]=_[_0x13c8('0x2f')](_0x3d4863['model'],qs[_0x13c8('0x31')](_0x416e4f['query']['fields']));_0x54e0c8['attributes']=_0x54e0c8['attributes']['length']?_0x54e0c8[_0x13c8('0x30')]:_0x3d4863[_0x13c8('0x2c')];_0x54e0c8[_0x13c8('0x49')]=qs[_0x13c8('0x35')](_0x416e4f[_0x13c8('0x2d')][_0x13c8('0x35')]);_0x54e0c8[_0x13c8('0x37')]=qs['filters'](_['pick'](_0x416e4f[_0x13c8('0x2d')],_0x3d4863[_0x13c8('0x2e')]));if(_0x416e4f[_0x13c8('0x2d')][_0x13c8('0x36')]){_0x54e0c8[_0x13c8('0x37')]=_[_0x13c8('0x38')](_0x54e0c8[_0x13c8('0x37')],{'$or':_[_0x13c8('0x29')](_0x54e0c8['attributes'],function(_0x371410){var _0x326f90={};_0x326f90[_0x371410]={'$like':'%'+_0x416e4f['query'][_0x13c8('0x36')]+'%'};return _0x326f90;})});}_0x54e0c8=_[_0x13c8('0x38')]({},_0x54e0c8,_0x416e4f[_0x13c8('0x39')]);return _0x14a738[_0x13c8('0x47')](_0x54e0c8);}})[_0x13c8('0x27')](function(_0x1f823f){if(_0x1f823f){_0x55d353=_0x1f823f[_0x13c8('0x32')];if(!_0x416e4f[_0x13c8('0x2d')][_0x13c8('0x33')](_0x13c8('0x34'))){_0x54e0c8[_0x13c8('0x1d')]=qs[_0x13c8('0x1d')](_0x416e4f[_0x13c8('0x2d')][_0x13c8('0x1d')]);_0x54e0c8[_0x13c8('0x1f')]=qs[_0x13c8('0x1f')](_0x416e4f['query'][_0x13c8('0x1f')]);}return _0x14a738['getConfigurations'](_0x54e0c8);}})[_0x13c8('0x27')](function(_0xe861ad){if(_0xe861ad){return _0xe861ad?{'count':_0x55d353,'rows':_0xe861ad}:null;}})['then'](respondWithResult(_0x2f1e83,null))[_0x13c8('0x3f')](handleError(_0x2f1e83,null));};exports[_0x13c8('0x4a')]=function(_0x5539e8,_0x38fd82,_0x19330c){if(_0x5539e8[_0x13c8('0x45')]['id']){delete _0x5539e8[_0x13c8('0x45')]['id'];}return db[_0x13c8('0x3a')][_0x13c8('0x48')]({'where':{'id':_0x5539e8[_0x13c8('0x41')]['id']}})[_0x13c8('0x27')](handleEntityNotFound(_0x38fd82,null))[_0x13c8('0x27')](function(_0xee69b){if(_0xee69b){_0x5539e8[_0x13c8('0x45')]['AccountId']=_0xee69b['id'];_0x5539e8[_0x13c8('0x45')][_0x13c8('0x4b')]=integrations[_0x13c8('0x4c')](_0x5539e8[_0x13c8('0x45')][_0x13c8('0x4d')],_0x5539e8[_0x13c8('0x45')]['type']);_0x5539e8[_0x13c8('0x45')][_0x13c8('0x4e')]=integrations[_0x13c8('0x4f')](_0x5539e8['body'][_0x13c8('0x4d')],_0x5539e8[_0x13c8('0x45')][_0x13c8('0x50')]);return db[_0x13c8('0x51')][_0x13c8('0x44')](_0x5539e8[_0x13c8('0x45')],{'include':[{'model':db['ZendeskField'],'as':_0x13c8('0x4b')},{'model':db[_0x13c8('0x52')],'as':_0x13c8('0x4e')}]});}return null;})[_0x13c8('0x27')](respondWithResult(_0x38fd82,null))['catch'](handleError(_0x38fd82,null));};exports[_0x13c8('0x53')]=function(_0x2d552d,_0x258447,_0x308482){var _0x179a86='';return db[_0x13c8('0x3a')][_0x13c8('0x48')]({'where':{'id':_0x2d552d['params']['id']},'attributes':['id',_0x13c8('0x54'),_0x13c8('0x55'),_0x13c8('0x56'),'authType',_0x13c8('0x57')]})[_0x13c8('0x27')](handleEntityNotFound(_0x258447,null))['then'](function(_0x58728a){if(_0x58728a){_0x179a86=_0x58728a[_0x13c8('0x57')];var _0x5eb649=_0x179a86[_0x13c8('0x58')](-0x1);if(_0x5eb649==='/'){_0x179a86=_0x179a86['substring'](0x0,_0x179a86[_0x13c8('0x59')](_0x5eb649));}var _0x39aefc={'method':_0x13c8('0x5a'),'uri':util[_0x13c8('0x5b')](_0x13c8('0x5c'),_0x179a86,'ticket_fields'),'json':!![]};switch(_0x58728a[_0x13c8('0x5d')]){case _0x13c8('0x55'):_0x39aefc['headers']={'Authorization':util[_0x13c8('0x5b')](_0x13c8('0x5e'),new Buffer(util[_0x13c8('0x5b')](_0x13c8('0x5f'),_0x58728a[_0x13c8('0x54')],_0x58728a[_0x13c8('0x55')]))[_0x13c8('0x60')](_0x13c8('0x61')))};break;case _0x13c8('0x56'):_0x39aefc[_0x13c8('0x62')]={'Authorization':util['format'](_0x13c8('0x5e'),new Buffer(util[_0x13c8('0x5b')]('%s/token:%s',_0x58728a['username'],_0x58728a[_0x13c8('0x56')]))[_0x13c8('0x60')](_0x13c8('0x61')))};break;default:throw new db[(_0x13c8('0x63'))][(_0x13c8('0x64'))](_0x13c8('0x65'));}return rp(_0x39aefc);}})['then'](function(_0x18afe7){if(_0x18afe7){var _0x368f45=[_0x13c8('0x66'),_0x13c8('0x67'),_0x13c8('0x68'),'assignee'];_[_0x13c8('0x69')](_0x18afe7[_0x13c8('0x6a')],function(_0x564cc9){return _0x368f45[_0x13c8('0x6b')](_0x564cc9[_0x13c8('0x50')]);});return{'count':_0x18afe7['ticket_fields'][_0x13c8('0x32')],'rows':_['map'](_0x18afe7[_0x13c8('0x6a')],function(_0x5a4e0a){return{'id':_0x5a4e0a['id'],'name':_0x5a4e0a[_0x13c8('0x6c')]>0x7?_0x5a4e0a[_0x13c8('0x6d')]:_0x5a4e0a[_0x13c8('0x50')],'custom':_0x5a4e0a['position']>0x7?!![]:![],'options':_0x5a4e0a[_0x13c8('0x6e')]?_0x5a4e0a['system_field_options']:_0x5a4e0a['custom_field_options']?_0x5a4e0a[_0x13c8('0x6f')]:[]};})};}})[_0x13c8('0x27')](respondWithResult(_0x258447,null))[_0x13c8('0x3f')](function(_0x1e3097){var _0x4d6477=_0x2d552d['query'][_0x13c8('0x70')]?0x1f4:_0x1e3097['statusCode']||0x1f4;logger['error'](_0x13c8('0x71'),_0x13c8('0x53'),_0x4d6477,JSON[_0x13c8('0x72')](_0x1e3097));delete _0x1e3097[_0x13c8('0x28')];if(_0x4d6477===0x191){_0x4d6477=0x190;}_0x258447['status'](_0x4d6477)[_0x13c8('0x73')](_0x2d552d['query']['test']?{'message':_0x13c8('0x74'),'statusCode':_0x1e3097[_0x13c8('0x75')]}:_0x1e3097);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index faddf4b..a5aeda9 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 _0x95ae=['api','moment','bluebird','request-promise','path','rimraf','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts','util','../../config/logger'];(function(_0x135ef8,_0x10b0b6){var _0x2ac71b=function(_0x1af204){while(--_0x1af204){_0x135ef8['push'](_0x135ef8['shift']());}};_0x2ac71b(++_0x10b0b6);}(_0x95ae,0x98));var _0xe95a=function(_0x11c573,_0x9e7c6e){_0x11c573=_0x11c573-0x0;var _0x6b72de=_0x95ae[_0x11c573];return _0x6b72de;};'use strict';var _=require('lodash');var util=require(_0xe95a('0x0'));var logger=require(_0xe95a('0x1'))(_0xe95a('0x2'));var moment=require(_0xe95a('0x3'));var BPromise=require(_0xe95a('0x4'));var rp=require(_0xe95a('0x5'));var fs=require('fs');var path=require(_0xe95a('0x6'));var rimraf=require(_0xe95a('0x7'));var config=require('../../config/environment');var attributes=require(_0xe95a('0x8'));var integrations=require(_0xe95a('0x9'));module[_0xe95a('0xa')]=function(_0x2d3c39,_0x2c6184){return _0x2d3c39[_0xe95a('0xb')](_0xe95a('0xc'),attributes,{'tableName':_0xe95a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6dd1=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','int_zendesk_accounts','util','../../config/logger'];(function(_0x28141f,_0x3652cb){var _0x1269dd=function(_0x481f32){while(--_0x481f32){_0x28141f['push'](_0x28141f['shift']());}};_0x1269dd(++_0x3652cb);}(_0x6dd1,0x1d2));var _0x16dd=function(_0x5b0a3a,_0x1eaa3f){_0x5b0a3a=_0x5b0a3a-0x0;var _0x594079=_0x6dd1[_0x5b0a3a];return _0x594079;};'use strict';var _=require('lodash');var util=require(_0x16dd('0x0'));var logger=require(_0x16dd('0x1'))(_0x16dd('0x2'));var moment=require(_0x16dd('0x3'));var BPromise=require(_0x16dd('0x4'));var rp=require(_0x16dd('0x5'));var fs=require('fs');var path=require(_0x16dd('0x6'));var rimraf=require(_0x16dd('0x7'));var config=require(_0x16dd('0x8'));var attributes=require('./intZendeskAccount.attributes');var integrations=require(_0x16dd('0x9'));module[_0x16dd('0xa')]=function(_0x4a76b8,_0x2611b8){return _0x4a76b8[_0x16dd('0xb')]('ZendeskAccount',attributes,{'tableName':_0x16dd('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 aec768c..233b2c1 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 _0xb93f=['limit','include','map','model','GetZendeskAccount','debug','ShowZendeskAccount','find','then','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','ZendeskAccount,\x20%s,\x20%s','ZendeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','findAll','options','raw','where','attributes'];(function(_0x59b1d7,_0x72689){var _0x270e97=function(_0x3ea191){while(--_0x3ea191){_0x59b1d7['push'](_0x59b1d7['shift']());}};_0x270e97(++_0x72689);}(_0xb93f,0x9d));var _0xfb93=function(_0x3ebb69,_0x3e612e){_0x3ebb69=_0x3ebb69-0x0;var _0x421e59=_0xb93f[_0x3ebb69];return _0x421e59;};'use strict';var _=require(_0xfb93('0x0'));var util=require(_0xfb93('0x1'));var moment=require(_0xfb93('0x2'));var BPromise=require(_0xfb93('0x3'));var rs=require(_0xfb93('0x4'));var fs=require('fs');var Redis=require(_0xfb93('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xfb93('0x6'));var logger=require('../../config/logger')(_0xfb93('0x7'));var config=require(_0xfb93('0x8'));var jayson=require(_0xfb93('0x9'));var client=jayson[_0xfb93('0xa')][_0xfb93('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x23bc90,_0x186689,_0x676e66){return new BPromise(function(_0x319452,_0x11c29d){return client[_0xfb93('0xc')](_0x23bc90,_0x676e66)['then'](function(_0x36ad03){logger[_0xfb93('0xd')](_0xfb93('0xe'),_0x186689,'request\x20sent');logger['debug'](_0xfb93('0xf'),_0x186689,_0xfb93('0x10'),JSON[_0xfb93('0x11')](_0x36ad03));if(_0x36ad03[_0xfb93('0x12')]){if(_0x36ad03['error'][_0xfb93('0x13')]===0x1f4){logger[_0xfb93('0x12')](_0xfb93('0xe'),_0x186689,_0x36ad03[_0xfb93('0x12')][_0xfb93('0x14')]);return _0x11c29d(_0x36ad03[_0xfb93('0x12')]['message']);}logger[_0xfb93('0x12')]('ZendeskAccount,\x20%s,\x20%s',_0x186689,_0x36ad03['error'][_0xfb93('0x14')]);return _0x319452(_0x36ad03[_0xfb93('0x12')][_0xfb93('0x14')]);}else{logger[_0xfb93('0xd')](_0xfb93('0xe'),_0x186689,_0xfb93('0x10'));_0x319452(_0x36ad03[_0xfb93('0x15')]['message']);}})[_0xfb93('0x16')](function(_0x3a9a50){logger[_0xfb93('0x12')](_0xfb93('0xe'),_0x186689,_0x3a9a50);_0x11c29d(_0x3a9a50);});});}exports['GetZendeskAccount']=function(_0x2c32d2){var _0x17e798=this;return new Promise(function(_0x2424b6,_0x555dbc){return db['ZendeskAccount'][_0xfb93('0x17')]({'raw':_0x2c32d2[_0xfb93('0x18')]?_0x2c32d2[_0xfb93('0x18')][_0xfb93('0x19')]===undefined?!![]:![]:!![],'where':_0x2c32d2[_0xfb93('0x18')]?_0x2c32d2[_0xfb93('0x18')][_0xfb93('0x1a')]||null:null,'attributes':_0x2c32d2[_0xfb93('0x18')]?_0x2c32d2[_0xfb93('0x18')][_0xfb93('0x1b')]||null:null,'limit':_0x2c32d2[_0xfb93('0x18')]?_0x2c32d2[_0xfb93('0x18')][_0xfb93('0x1c')]||null:null,'include':_0x2c32d2[_0xfb93('0x18')]?_0x2c32d2[_0xfb93('0x18')]['include']?_['map'](_0x2c32d2[_0xfb93('0x18')]['include'],function(_0x267176){return{'model':db[_0x267176['model']],'as':_0x267176['as'],'attributes':_0x267176[_0xfb93('0x1b')],'include':_0x267176[_0xfb93('0x1d')]?_[_0xfb93('0x1e')](_0x267176[_0xfb93('0x1d')],function(_0x331e85){return{'model':db[_0x331e85['model']],'as':_0x331e85['as'],'attributes':_0x331e85[_0xfb93('0x1b')],'include':_0x331e85['include']?_[_0xfb93('0x1e')](_0x331e85[_0xfb93('0x1d')],function(_0x49ea5e){return{'model':db[_0x49ea5e[_0xfb93('0x1f')]],'as':_0x49ea5e['as'],'attributes':_0x49ea5e[_0xfb93('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3a6c93){logger['info'](_0xfb93('0x20'),_0x2c32d2);logger[_0xfb93('0x21')]('GetZendeskAccount',_0x2c32d2,JSON[_0xfb93('0x11')](_0x3a6c93));_0x2424b6(_0x3a6c93);})[_0xfb93('0x16')](function(_0x38da83){logger[_0xfb93('0x12')](_0xfb93('0x20'),_0x38da83['message'],_0x2c32d2);_0x555dbc(_0x17e798[_0xfb93('0x12')](0x1f4,_0x38da83[_0xfb93('0x14')]));});});};exports[_0xfb93('0x22')]=function(_0x46cf9b){var _0xe38595=this;return new Promise(function(_0x1597e9,_0x3ccb61){return db['ZendeskAccount'][_0xfb93('0x23')]({'raw':_0x46cf9b[_0xfb93('0x18')]?_0x46cf9b[_0xfb93('0x18')][_0xfb93('0x19')]===undefined?!![]:![]:!![],'where':_0x46cf9b['options']?_0x46cf9b[_0xfb93('0x18')][_0xfb93('0x1a')]||null:null,'attributes':_0x46cf9b[_0xfb93('0x18')]?_0x46cf9b[_0xfb93('0x18')]['attributes']||null:null,'include':_0x46cf9b[_0xfb93('0x18')]?_0x46cf9b[_0xfb93('0x18')]['include']?_[_0xfb93('0x1e')](_0x46cf9b[_0xfb93('0x18')][_0xfb93('0x1d')],function(_0x7f062d){return{'model':db[_0x7f062d[_0xfb93('0x1f')]],'as':_0x7f062d['as'],'attributes':_0x7f062d[_0xfb93('0x1b')],'include':_0x7f062d[_0xfb93('0x1d')]?_['map'](_0x7f062d[_0xfb93('0x1d')],function(_0x38ee8c){return{'model':db[_0x38ee8c['model']],'as':_0x38ee8c['as'],'attributes':_0x38ee8c[_0xfb93('0x1b')],'include':_0x38ee8c[_0xfb93('0x1d')]?_[_0xfb93('0x1e')](_0x38ee8c[_0xfb93('0x1d')],function(_0x2fc543){return{'model':db[_0x2fc543[_0xfb93('0x1f')]],'as':_0x2fc543['as'],'attributes':_0x2fc543['attributes']};}):[]};}):[]};}):[]:[]})[_0xfb93('0x24')](function(_0x4908d6){logger[_0xfb93('0xd')](_0xfb93('0x22'),_0x46cf9b);logger[_0xfb93('0x21')](_0xfb93('0x22'),_0x46cf9b,JSON[_0xfb93('0x11')](_0x4908d6));_0x1597e9(_0x4908d6);})[_0xfb93('0x16')](function(_0xca9a17){logger['error'](_0xfb93('0x22'),_0xca9a17[_0xfb93('0x14')],_0x46cf9b);_0x3ccb61(_0xe38595[_0xfb93('0x12')](0x1f4,_0xca9a17['message']));});});}; \ No newline at end of file +var _0xd6fb=['util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetZendeskAccount','ZendeskAccount','findAll','raw','where','options','attributes','include','map','model','then','ShowZendeskAccount','find','lodash'];(function(_0x5828d0,_0x2c3e93){var _0x239b02=function(_0x702fe4){while(--_0x702fe4){_0x5828d0['push'](_0x5828d0['shift']());}};_0x239b02(++_0x2c3e93);}(_0xd6fb,0x143));var _0xbd6f=function(_0x49b0b8,_0x134053){_0x49b0b8=_0x49b0b8-0x0;var _0xfccca8=_0xd6fb[_0x49b0b8];return _0xfccca8;};'use strict';var _=require(_0xbd6f('0x0'));var util=require(_0xbd6f('0x1'));var moment=require(_0xbd6f('0x2'));var BPromise=require(_0xbd6f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbd6f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbd6f('0x5'));var logger=require('../../config/logger')(_0xbd6f('0x6'));var config=require(_0xbd6f('0x7'));var jayson=require(_0xbd6f('0x8'));var client=jayson[_0xbd6f('0x9')][_0xbd6f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x158463,_0x4cfa60,_0x5eee0d){return new BPromise(function(_0x19ecdc,_0x3ee7b8){return client[_0xbd6f('0xb')](_0x158463,_0x5eee0d)['then'](function(_0x9040f0){logger[_0xbd6f('0xc')](_0xbd6f('0xd'),_0x4cfa60,_0xbd6f('0xe'));logger[_0xbd6f('0xf')](_0xbd6f('0x10'),_0x4cfa60,_0xbd6f('0xe'),JSON[_0xbd6f('0x11')](_0x9040f0));if(_0x9040f0['error']){if(_0x9040f0[_0xbd6f('0x12')][_0xbd6f('0x13')]===0x1f4){logger[_0xbd6f('0x12')](_0xbd6f('0xd'),_0x4cfa60,_0x9040f0[_0xbd6f('0x12')]['message']);return _0x3ee7b8(_0x9040f0['error'][_0xbd6f('0x14')]);}logger[_0xbd6f('0x12')](_0xbd6f('0xd'),_0x4cfa60,_0x9040f0[_0xbd6f('0x12')][_0xbd6f('0x14')]);return _0x19ecdc(_0x9040f0[_0xbd6f('0x12')]['message']);}else{logger['info'](_0xbd6f('0xd'),_0x4cfa60,_0xbd6f('0xe'));_0x19ecdc(_0x9040f0[_0xbd6f('0x15')]['message']);}})[_0xbd6f('0x16')](function(_0x225438){logger[_0xbd6f('0x12')]('ZendeskAccount,\x20%s,\x20%s',_0x4cfa60,_0x225438);_0x3ee7b8(_0x225438);});});}exports[_0xbd6f('0x17')]=function(_0x3bb1a1){var _0x31ef10=this;return new Promise(function(_0x204d03,_0x26c961){return db[_0xbd6f('0x18')][_0xbd6f('0x19')]({'raw':_0x3bb1a1['options']?_0x3bb1a1['options'][_0xbd6f('0x1a')]===undefined?!![]:![]:!![],'where':_0x3bb1a1['options']?_0x3bb1a1['options'][_0xbd6f('0x1b')]||null:null,'attributes':_0x3bb1a1[_0xbd6f('0x1c')]?_0x3bb1a1[_0xbd6f('0x1c')][_0xbd6f('0x1d')]||null:null,'limit':_0x3bb1a1[_0xbd6f('0x1c')]?_0x3bb1a1['options']['limit']||null:null,'include':_0x3bb1a1[_0xbd6f('0x1c')]?_0x3bb1a1['options'][_0xbd6f('0x1e')]?_[_0xbd6f('0x1f')](_0x3bb1a1[_0xbd6f('0x1c')][_0xbd6f('0x1e')],function(_0x49c7f5){return{'model':db[_0x49c7f5[_0xbd6f('0x20')]],'as':_0x49c7f5['as'],'attributes':_0x49c7f5['attributes'],'include':_0x49c7f5[_0xbd6f('0x1e')]?_[_0xbd6f('0x1f')](_0x49c7f5[_0xbd6f('0x1e')],function(_0x5a0526){return{'model':db[_0x5a0526[_0xbd6f('0x20')]],'as':_0x5a0526['as'],'attributes':_0x5a0526[_0xbd6f('0x1d')],'include':_0x5a0526[_0xbd6f('0x1e')]?_[_0xbd6f('0x1f')](_0x5a0526[_0xbd6f('0x1e')],function(_0x662f06){return{'model':db[_0x662f06[_0xbd6f('0x20')]],'as':_0x662f06['as'],'attributes':_0x662f06['attributes']};}):[]};}):[]};}):[]:[]})[_0xbd6f('0x21')](function(_0x1c808e){logger[_0xbd6f('0xc')](_0xbd6f('0x17'),_0x3bb1a1);logger[_0xbd6f('0xf')](_0xbd6f('0x17'),_0x3bb1a1,JSON[_0xbd6f('0x11')](_0x1c808e));_0x204d03(_0x1c808e);})[_0xbd6f('0x16')](function(_0x36dc0e){logger[_0xbd6f('0x12')](_0xbd6f('0x17'),_0x36dc0e['message'],_0x3bb1a1);_0x26c961(_0x31ef10[_0xbd6f('0x12')](0x1f4,_0x36dc0e[_0xbd6f('0x14')]));});});};exports[_0xbd6f('0x22')]=function(_0x319e0d){var _0x4ae722=this;return new Promise(function(_0x3e2e4b,_0x4308d9){return db[_0xbd6f('0x18')][_0xbd6f('0x23')]({'raw':_0x319e0d['options']?_0x319e0d[_0xbd6f('0x1c')][_0xbd6f('0x1a')]===undefined?!![]:![]:!![],'where':_0x319e0d['options']?_0x319e0d[_0xbd6f('0x1c')]['where']||null:null,'attributes':_0x319e0d[_0xbd6f('0x1c')]?_0x319e0d[_0xbd6f('0x1c')]['attributes']||null:null,'include':_0x319e0d[_0xbd6f('0x1c')]?_0x319e0d[_0xbd6f('0x1c')][_0xbd6f('0x1e')]?_[_0xbd6f('0x1f')](_0x319e0d[_0xbd6f('0x1c')][_0xbd6f('0x1e')],function(_0x32359c){return{'model':db[_0x32359c[_0xbd6f('0x20')]],'as':_0x32359c['as'],'attributes':_0x32359c[_0xbd6f('0x1d')],'include':_0x32359c['include']?_[_0xbd6f('0x1f')](_0x32359c[_0xbd6f('0x1e')],function(_0x3aec0d){return{'model':db[_0x3aec0d['model']],'as':_0x3aec0d['as'],'attributes':_0x3aec0d['attributes'],'include':_0x3aec0d[_0xbd6f('0x1e')]?_[_0xbd6f('0x1f')](_0x3aec0d['include'],function(_0x4cad76){return{'model':db[_0x4cad76[_0xbd6f('0x20')]],'as':_0x4cad76['as'],'attributes':_0x4cad76[_0xbd6f('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xbd6f('0x21')](function(_0xc7eed0){logger[_0xbd6f('0xc')]('ShowZendeskAccount',_0x319e0d);logger[_0xbd6f('0xf')](_0xbd6f('0x22'),_0x319e0d,JSON[_0xbd6f('0x11')](_0xc7eed0));_0x3e2e4b(_0xc7eed0);})[_0xbd6f('0x16')](function(_0x11e0e9){logger['error']('ShowZendeskAccount',_0x11e0e9[_0xbd6f('0x14')],_0x319e0d);_0x4308d9(_0x4ae722[_0xbd6f('0x12')](0x1f4,_0x11e0e9[_0xbd6f('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index d49b578..5b39167 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 _0xa571=['util','path','connect-timeout','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/:id','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','getTags','post','create','put','update','exports','multer'];(function(_0x11ea58,_0x4ecf21){var _0x5a8f56=function(_0x2a2dd3){while(--_0x2a2dd3){_0x11ea58['push'](_0x11ea58['shift']());}};_0x5a8f56(++_0x4ecf21);}(_0xa571,0x107));var _0x1a57=function(_0x4702ac,_0x2e9fbb){_0x4702ac=_0x4702ac-0x0;var _0x3a1e52=_0xa571[_0x4702ac];return _0x3a1e52;};'use strict';var multer=require(_0x1a57('0x0'));var util=require(_0x1a57('0x1'));var path=require(_0x1a57('0x2'));var timeout=require(_0x1a57('0x3'));var express=require('express');var router=express[_0x1a57('0x4')]();var fs_extra=require(_0x1a57('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1a57('0x6'));var controller=require('./intZendeskConfiguration.controller');router[_0x1a57('0x7')]('/',auth[_0x1a57('0x8')](),controller[_0x1a57('0x9')]);router[_0x1a57('0x7')](_0x1a57('0xa'),auth[_0x1a57('0x8')](),controller['show']);router[_0x1a57('0x7')](_0x1a57('0xb'),auth[_0x1a57('0x8')](),controller['getFields']);router[_0x1a57('0x7')](_0x1a57('0xc'),auth[_0x1a57('0x8')](),controller[_0x1a57('0xd')]);router[_0x1a57('0x7')](_0x1a57('0xe'),auth[_0x1a57('0x8')](),controller[_0x1a57('0xf')]);router['get']('/:id/tags',auth[_0x1a57('0x8')](),controller[_0x1a57('0x10')]);router[_0x1a57('0x11')]('/',auth['isAuthenticated'](),controller[_0x1a57('0x12')]);router[_0x1a57('0x11')]('/:id/tags',auth[_0x1a57('0x8')](),controller['setTags']);router[_0x1a57('0x13')](_0x1a57('0xa'),auth[_0x1a57('0x8')](),controller[_0x1a57('0x14')]);router['delete'](_0x1a57('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x1a57('0x15')]=router; \ No newline at end of file +var _0xb688=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','update','exports','util'];(function(_0x3ee55a,_0x19aeea){var _0x581800=function(_0x636cb7){while(--_0x636cb7){_0x3ee55a['push'](_0x3ee55a['shift']());}};_0x581800(++_0x19aeea);}(_0xb688,0xcf));var _0x8b68=function(_0x32000a,_0x5edb39){_0x32000a=_0x32000a-0x0;var _0x34c355=_0xb688[_0x32000a];return _0x34c355;};'use strict';var multer=require('multer');var util=require(_0x8b68('0x0'));var path=require(_0x8b68('0x1'));var timeout=require(_0x8b68('0x2'));var express=require(_0x8b68('0x3'));var router=express[_0x8b68('0x4')]();var fs_extra=require(_0x8b68('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8b68('0x6'));var config=require(_0x8b68('0x7'));var controller=require(_0x8b68('0x8'));router[_0x8b68('0x9')]('/',auth['isAuthenticated'](),controller[_0x8b68('0xa')]);router['get'](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller[_0x8b68('0xd')]);router[_0x8b68('0x9')](_0x8b68('0xe'),auth[_0x8b68('0xc')](),controller[_0x8b68('0xf')]);router[_0x8b68('0x9')](_0x8b68('0x10'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x11')]);router[_0x8b68('0x9')](_0x8b68('0x12'),auth['isAuthenticated'](),controller[_0x8b68('0x13')]);router[_0x8b68('0x9')](_0x8b68('0x14'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x15')]);router[_0x8b68('0x16')]('/',auth[_0x8b68('0xc')](),controller[_0x8b68('0x17')]);router[_0x8b68('0x16')]('/:id/tags',auth[_0x8b68('0xc')](),controller['setTags']);router['put'](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x18')]);router['delete']('/:id',auth[_0x8b68('0xc')](),controller['destroy']);module[_0x8b68('0x19')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index ca9138c..cd65250 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 _0x09bc=['sequelize','exports'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x09bc,0xb6));var _0xc09b=function(_0x291f8b,_0x3b5591){_0x291f8b=_0x291f8b-0x0;var _0x275171=_0x09bc[_0x291f8b];return _0x275171;};'use strict';var Sequelize=require(_0xc09b('0x0'));module[_0xc09b('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd1d8=['STRING','sequelize','exports'];(function(_0x5da9a9,_0x4cb7b1){var _0x441d42=function(_0x4a1a06){while(--_0x4a1a06){_0x5da9a9['push'](_0x5da9a9['shift']());}};_0x441d42(++_0x4cb7b1);}(_0xd1d8,0x19f));var _0x8d1d=function(_0x5b4615,_0x3fad71){_0x5b4615=_0x5b4615-0x0;var _0x44eb78=_0xd1d8[_0x5b4615];return _0x44eb78;};'use strict';var Sequelize=require(_0x8d1d('0x0'));module[_0x8d1d('0x1')]={'name':{'type':Sequelize[_0x8d1d('0x2')]},'description':{'type':Sequelize[_0x8d1d('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index afc092e..0ca3f3f 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 _0xb399=['../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','stack','name','send','ZendeskConfiguration','rawAttributes','fieldName','type','key','model','map','keys','query','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','intersection','find','body','getFields','length','pick','getSubjects','getDescriptions','findOne','ZendeskField','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x207b92,_0x16778b){var _0xa32e72=function(_0x4bc0c7){while(--_0x4bc0c7){_0x207b92['push'](_0x207b92['shift']());}};_0xa32e72(++_0x16778b);}(_0xb399,0x1ee));var _0x9b39=function(_0x3f2228,_0x3b27d5){_0x3f2228=_0x3f2228-0x0;var _0x285ae4=_0xb399[_0x3f2228];return _0x285ae4;};'use strict';var emlformat=require(_0x9b39('0x0'));var rimraf=require(_0x9b39('0x1'));var zipdir=require(_0x9b39('0x2'));var jsonpatch=require(_0x9b39('0x3'));var rp=require(_0x9b39('0x4'));var moment=require(_0x9b39('0x5'));var BPromise=require(_0x9b39('0x6'));var Mustache=require(_0x9b39('0x7'));var util=require(_0x9b39('0x8'));var path=require(_0x9b39('0x9'));var sox=require('sox');var csv=require(_0x9b39('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9b39('0xb'));var _=require(_0x9b39('0xc'));var squel=require(_0x9b39('0xd'));var crypto=require(_0x9b39('0xe'));var jsforce=require(_0x9b39('0xf'));var deskjs=require(_0x9b39('0x10'));var toCsv=require(_0x9b39('0xa'));var querystring=require(_0x9b39('0x11'));var Papa=require(_0x9b39('0x12'));var Redis=require('ioredis');var authService=require(_0x9b39('0x13'));var qs=require(_0x9b39('0x14'));var as=require(_0x9b39('0x15'));var hardwareService=require(_0x9b39('0x16'));var logger=require(_0x9b39('0x17'))(_0x9b39('0x18'));var utils=require(_0x9b39('0x19'));var config=require(_0x9b39('0x1a'));var licenseUtil=require(_0x9b39('0x1b'));var db=require(_0x9b39('0x1c'))['db'];function respondWithStatusCode(_0x1bbdb5,_0x334ea2){_0x334ea2=_0x334ea2||0xcc;return function(_0x35d3e6){if(_0x35d3e6){return _0x1bbdb5[_0x9b39('0x1d')](_0x334ea2);}return _0x1bbdb5[_0x9b39('0x1e')](_0x334ea2)[_0x9b39('0x1f')]();};}function respondWithResult(_0x2dd7ee,_0x197104){_0x197104=_0x197104||0xc8;return function(_0x1764bb){if(_0x1764bb){return _0x2dd7ee[_0x9b39('0x1e')](_0x197104)[_0x9b39('0x20')](_0x1764bb);}};}function respondWithFilteredResult(_0x3af6bc,_0x9b8c11){return function(_0x4d76ef){if(_0x4d76ef){var _0x18c50e=typeof _0x9b8c11[_0x9b39('0x21')]===_0x9b39('0x22')&&typeof _0x9b8c11['limit']===_0x9b39('0x22');var _0x59a49e=_0x4d76ef[_0x9b39('0x23')];var _0x457f57=_0x18c50e?0x0:_0x9b8c11[_0x9b39('0x21')];var _0x3f2cb5=_0x18c50e?_0x4d76ef[_0x9b39('0x23')]:_0x9b8c11[_0x9b39('0x21')]+_0x9b8c11[_0x9b39('0x24')];var _0x939cf5;if(_0x3f2cb5>=_0x59a49e){_0x3f2cb5=_0x59a49e;_0x939cf5=0xc8;}else{_0x939cf5=0xce;}_0x3af6bc[_0x9b39('0x1e')](_0x939cf5);return _0x3af6bc[_0x9b39('0x25')]('Content-Range',_0x457f57+'-'+_0x3f2cb5+'/'+_0x59a49e)[_0x9b39('0x20')](_0x4d76ef);}return null;};}function patchUpdates(_0x40efb5){return function(_0x30bb84){try{jsonpatch[_0x9b39('0x26')](_0x30bb84,_0x40efb5,!![]);}catch(_0xdd2aa8){return BPromise[_0x9b39('0x27')](_0xdd2aa8);}return _0x30bb84[_0x9b39('0x28')]();};}function saveUpdates(_0x328524,_0x164dfa){return function(_0x45851b){if(_0x45851b){return _0x45851b[_0x9b39('0x29')](_0x328524)[_0x9b39('0x2a')](function(_0x3f6c15){return _0x3f6c15;});}return null;};}function removeEntity(_0x12630c,_0x4ea93f){return function(_0x3b72f1){if(_0x3b72f1){return _0x3b72f1[_0x9b39('0x2b')]()[_0x9b39('0x2a')](function(){_0x12630c[_0x9b39('0x1e')](0xcc)[_0x9b39('0x1f')]();});}};}function handleEntityNotFound(_0xdcea51,_0x6cfde4){return function(_0x52934b){if(!_0x52934b){_0xdcea51['sendStatus'](0x194);}return _0x52934b;};}function handleError(_0x492962,_0x11af2c){_0x11af2c=_0x11af2c||0x1f4;return function(_0x1dfb66){logger['error'](_0x1dfb66[_0x9b39('0x2c')]);if(_0x1dfb66[_0x9b39('0x2d')]){delete _0x1dfb66[_0x9b39('0x2d')];}_0x492962[_0x9b39('0x1e')](_0x11af2c)[_0x9b39('0x2e')](_0x1dfb66);};}exports['index']=function(_0x25c280,_0x4ec07e){var _0x1d35c5={},_0x200f86={},_0x5e1e1f={'count':0x0,'rows':[]};var _0x5176e5=_['map'](db[_0x9b39('0x2f')][_0x9b39('0x30')],function(_0x438528){return{'name':_0x438528[_0x9b39('0x31')],'type':_0x438528[_0x9b39('0x32')][_0x9b39('0x33')]};});_0x200f86[_0x9b39('0x34')]=_[_0x9b39('0x35')](_0x5176e5,_0x9b39('0x2d'));_0x200f86['query']=_[_0x9b39('0x36')](_0x25c280[_0x9b39('0x37')]);_0x200f86['filters']=_['intersection'](_0x200f86['model'],_0x200f86[_0x9b39('0x37')]);_0x1d35c5['attributes']=_['intersection'](_0x200f86[_0x9b39('0x34')],qs[_0x9b39('0x38')](_0x25c280[_0x9b39('0x37')][_0x9b39('0x38')]));_0x1d35c5[_0x9b39('0x39')]=_0x1d35c5['attributes']['length']?_0x1d35c5[_0x9b39('0x39')]:_0x200f86[_0x9b39('0x34')];if(!_0x25c280[_0x9b39('0x37')][_0x9b39('0x3a')](_0x9b39('0x3b'))){_0x1d35c5[_0x9b39('0x24')]=qs[_0x9b39('0x24')](_0x25c280[_0x9b39('0x37')][_0x9b39('0x24')]);_0x1d35c5[_0x9b39('0x21')]=qs[_0x9b39('0x21')](_0x25c280['query']['offset']);}_0x1d35c5[_0x9b39('0x3c')]=qs[_0x9b39('0x3d')](_0x25c280[_0x9b39('0x37')]['sort']);_0x1d35c5[_0x9b39('0x3e')]=qs[_0x9b39('0x3f')](_['pick'](_0x25c280['query'],_0x200f86['filters']),_0x5176e5);if(_0x25c280[_0x9b39('0x37')][_0x9b39('0x40')]){_0x1d35c5[_0x9b39('0x3e')]=_[_0x9b39('0x41')](_0x1d35c5['where'],{'$or':_[_0x9b39('0x35')](_0x5176e5,function(_0x129cc7){if(_0x129cc7[_0x9b39('0x32')]!==_0x9b39('0x42')){var _0x35b727={};_0x35b727[_0x129cc7[_0x9b39('0x2d')]]={'$like':'%'+_0x25c280[_0x9b39('0x37')][_0x9b39('0x40')]+'%'};return _0x35b727;}})});}_0x1d35c5=_[_0x9b39('0x41')]({},_0x1d35c5,_0x25c280[_0x9b39('0x43')]);var _0x5dff3d={'where':_0x1d35c5[_0x9b39('0x3e')]};return db[_0x9b39('0x2f')]['count'](_0x5dff3d)['then'](function(_0x4012d2){_0x5e1e1f['count']=_0x4012d2;if(_0x25c280['query'][_0x9b39('0x44')]){_0x1d35c5[_0x9b39('0x45')]=[{'all':!![]}];}return db['ZendeskConfiguration'][_0x9b39('0x46')](_0x1d35c5);})[_0x9b39('0x2a')](function(_0x193b6f){_0x5e1e1f['rows']=_0x193b6f;return _0x5e1e1f;})[_0x9b39('0x2a')](respondWithFilteredResult(_0x4ec07e,_0x1d35c5))[_0x9b39('0x47')](handleError(_0x4ec07e,null));};exports[_0x9b39('0x48')]=function(_0x44276b,_0x3b6909){var _0x3023cf={'raw':![],'where':{'id':_0x44276b[_0x9b39('0x49')]['id']}},_0x52b97a={};_0x52b97a[_0x9b39('0x34')]=_[_0x9b39('0x36')](db[_0x9b39('0x2f')][_0x9b39('0x30')]);_0x52b97a[_0x9b39('0x37')]=_['keys'](_0x44276b[_0x9b39('0x37')]);_0x52b97a[_0x9b39('0x3f')]=_[_0x9b39('0x4a')](_0x52b97a[_0x9b39('0x34')],_0x52b97a[_0x9b39('0x37')]);_0x3023cf['attributes']=_[_0x9b39('0x4a')](_0x52b97a[_0x9b39('0x34')],qs[_0x9b39('0x38')](_0x44276b[_0x9b39('0x37')]['fields']));_0x3023cf['attributes']=_0x3023cf[_0x9b39('0x39')]['length']?_0x3023cf[_0x9b39('0x39')]:_0x52b97a[_0x9b39('0x34')];if(_0x44276b['query'][_0x9b39('0x44')]){_0x3023cf['include']=[{'all':!![]}];}_0x3023cf=_[_0x9b39('0x41')]({},_0x3023cf,_0x44276b['options']);return db[_0x9b39('0x2f')][_0x9b39('0x4b')](_0x3023cf)[_0x9b39('0x2a')](handleEntityNotFound(_0x3b6909,null))[_0x9b39('0x2a')](respondWithResult(_0x3b6909,null))['catch'](handleError(_0x3b6909,null));};exports['create']=function(_0x411fc6,_0x41ea9e){return db[_0x9b39('0x2f')]['create'](_0x411fc6[_0x9b39('0x4c')],{})['then'](respondWithResult(_0x41ea9e,0xc9))[_0x9b39('0x47')](handleError(_0x41ea9e,null));};exports[_0x9b39('0x29')]=function(_0x4c35eb,_0x224714){if(_0x4c35eb['body']['id']){delete _0x4c35eb[_0x9b39('0x4c')]['id'];}return db[_0x9b39('0x2f')][_0x9b39('0x4b')]({'where':{'id':_0x4c35eb[_0x9b39('0x49')]['id']}})['then'](handleEntityNotFound(_0x224714,null))['then'](saveUpdates(_0x4c35eb['body'],null))['then'](respondWithResult(_0x224714,null))[_0x9b39('0x47')](handleError(_0x224714,null));};exports[_0x9b39('0x2b')]=function(_0xa0635,_0x353a1c){return db[_0x9b39('0x2f')][_0x9b39('0x4b')]({'where':{'id':_0xa0635['params']['id']}})['then'](handleEntityNotFound(_0x353a1c,null))[_0x9b39('0x2a')](removeEntity(_0x353a1c,null))['catch'](handleError(_0x353a1c,null));};exports[_0x9b39('0x4d')]=function(_0x4af234,_0x3e0120,_0x1e191c){var _0x2609b7={};var _0x398974={};var _0x240ca6;var _0xe5c475;return db[_0x9b39('0x2f')]['findOne']({'where':{'id':_0x4af234['params']['id']}})[_0x9b39('0x2a')](handleEntityNotFound(_0x3e0120,null))[_0x9b39('0x2a')](function(_0x338c23){if(_0x338c23){_0x240ca6=_0x338c23;_0x398974[_0x9b39('0x34')]=_[_0x9b39('0x36')](db['ZendeskField'][_0x9b39('0x30')]);_0x398974[_0x9b39('0x37')]=_['keys'](_0x4af234[_0x9b39('0x37')]);_0x398974['filters']=_[_0x9b39('0x4a')](_0x398974[_0x9b39('0x34')],_0x398974['query']);_0x2609b7[_0x9b39('0x39')]=_[_0x9b39('0x4a')](_0x398974['model'],qs[_0x9b39('0x38')](_0x4af234[_0x9b39('0x37')][_0x9b39('0x38')]));_0x2609b7[_0x9b39('0x39')]=_0x2609b7[_0x9b39('0x39')][_0x9b39('0x4e')]?_0x2609b7[_0x9b39('0x39')]:_0x398974[_0x9b39('0x34')];_0x2609b7['order']=qs[_0x9b39('0x3d')](_0x4af234[_0x9b39('0x37')][_0x9b39('0x3d')]);_0x2609b7[_0x9b39('0x3e')]=qs[_0x9b39('0x3f')](_[_0x9b39('0x4f')](_0x4af234[_0x9b39('0x37')],_0x398974[_0x9b39('0x3f')]));if(_0x4af234[_0x9b39('0x37')][_0x9b39('0x40')]){_0x2609b7[_0x9b39('0x3e')]=_[_0x9b39('0x41')](_0x2609b7[_0x9b39('0x3e')],{'$or':_[_0x9b39('0x35')](_0x2609b7[_0x9b39('0x39')],function(_0x15ff1f){var _0x563613={};_0x563613[_0x15ff1f]={'$like':'%'+_0x4af234[_0x9b39('0x37')][_0x9b39('0x40')]+'%'};return _0x563613;})});}_0x2609b7=_[_0x9b39('0x41')]({},_0x2609b7,_0x4af234[_0x9b39('0x43')]);return _0x240ca6[_0x9b39('0x4d')](_0x2609b7);}})['then'](function(_0x50d1b5){if(_0x50d1b5){_0xe5c475=_0x50d1b5['length'];if(!_0x4af234[_0x9b39('0x37')][_0x9b39('0x3a')]('nolimit')){_0x2609b7['limit']=qs[_0x9b39('0x24')](_0x4af234['query']['limit']);_0x2609b7[_0x9b39('0x21')]=qs['offset'](_0x4af234[_0x9b39('0x37')][_0x9b39('0x21')]);}return _0x240ca6[_0x9b39('0x4d')](_0x2609b7);}})[_0x9b39('0x2a')](function(_0x18b4e3){if(_0x18b4e3){return _0x18b4e3?{'count':_0xe5c475,'rows':_0x18b4e3}:null;}})[_0x9b39('0x2a')](respondWithResult(_0x3e0120,null))[_0x9b39('0x47')](handleError(_0x3e0120,null));};exports[_0x9b39('0x50')]=function(_0x1b6d9f,_0x415f43,_0x9291a4){var _0x5264f1={};var _0x45f162={};var _0x2ec833;var _0x39ecf;return db[_0x9b39('0x2f')]['findOne']({'where':{'id':_0x1b6d9f[_0x9b39('0x49')]['id']}})[_0x9b39('0x2a')](handleEntityNotFound(_0x415f43,null))[_0x9b39('0x2a')](function(_0x10566f){if(_0x10566f){_0x2ec833=_0x10566f;_0x45f162[_0x9b39('0x34')]=_['keys'](db['ZendeskField'][_0x9b39('0x30')]);_0x45f162[_0x9b39('0x37')]=_[_0x9b39('0x36')](_0x1b6d9f[_0x9b39('0x37')]);_0x45f162[_0x9b39('0x3f')]=_[_0x9b39('0x4a')](_0x45f162['model'],_0x45f162[_0x9b39('0x37')]);_0x5264f1['attributes']=_['intersection'](_0x45f162[_0x9b39('0x34')],qs[_0x9b39('0x38')](_0x1b6d9f[_0x9b39('0x37')][_0x9b39('0x38')]));_0x5264f1[_0x9b39('0x39')]=_0x5264f1[_0x9b39('0x39')]['length']?_0x5264f1['attributes']:_0x45f162[_0x9b39('0x34')];_0x5264f1['order']=qs[_0x9b39('0x3d')](_0x1b6d9f[_0x9b39('0x37')][_0x9b39('0x3d')]);_0x5264f1[_0x9b39('0x3e')]=qs[_0x9b39('0x3f')](_['pick'](_0x1b6d9f['query'],_0x45f162['filters']));if(_0x1b6d9f[_0x9b39('0x37')]['filter']){_0x5264f1[_0x9b39('0x3e')]=_[_0x9b39('0x41')](_0x5264f1[_0x9b39('0x3e')],{'$or':_['map'](_0x5264f1[_0x9b39('0x39')],function(_0x5233c1){var _0xba57c4={};_0xba57c4[_0x5233c1]={'$like':'%'+_0x1b6d9f[_0x9b39('0x37')][_0x9b39('0x40')]+'%'};return _0xba57c4;})});}_0x5264f1=_['merge']({},_0x5264f1,_0x1b6d9f[_0x9b39('0x43')]);return _0x2ec833['getSubjects'](_0x5264f1);}})[_0x9b39('0x2a')](function(_0x663eec){if(_0x663eec){_0x39ecf=_0x663eec['length'];if(!_0x1b6d9f[_0x9b39('0x37')][_0x9b39('0x3a')]('nolimit')){_0x5264f1[_0x9b39('0x24')]=qs[_0x9b39('0x24')](_0x1b6d9f['query'][_0x9b39('0x24')]);_0x5264f1[_0x9b39('0x21')]=qs[_0x9b39('0x21')](_0x1b6d9f[_0x9b39('0x37')][_0x9b39('0x21')]);}return _0x2ec833[_0x9b39('0x50')](_0x5264f1);}})[_0x9b39('0x2a')](function(_0x42338f){if(_0x42338f){return _0x42338f?{'count':_0x39ecf,'rows':_0x42338f}:null;}})[_0x9b39('0x2a')](respondWithResult(_0x415f43,null))[_0x9b39('0x47')](handleError(_0x415f43,null));};exports[_0x9b39('0x51')]=function(_0x4ac0c5,_0x303571,_0x1572b0){var _0x583758={};var _0x307be8={};var _0x27662c;var _0x2ce76f;return db['ZendeskConfiguration'][_0x9b39('0x52')]({'where':{'id':_0x4ac0c5[_0x9b39('0x49')]['id']}})[_0x9b39('0x2a')](handleEntityNotFound(_0x303571,null))[_0x9b39('0x2a')](function(_0x46094c){if(_0x46094c){_0x27662c=_0x46094c;_0x307be8[_0x9b39('0x34')]=_['keys'](db[_0x9b39('0x53')]['rawAttributes']);_0x307be8[_0x9b39('0x37')]=_[_0x9b39('0x36')](_0x4ac0c5[_0x9b39('0x37')]);_0x307be8[_0x9b39('0x3f')]=_['intersection'](_0x307be8[_0x9b39('0x34')],_0x307be8[_0x9b39('0x37')]);_0x583758['attributes']=_[_0x9b39('0x4a')](_0x307be8[_0x9b39('0x34')],qs[_0x9b39('0x38')](_0x4ac0c5['query'][_0x9b39('0x38')]));_0x583758[_0x9b39('0x39')]=_0x583758['attributes']['length']?_0x583758[_0x9b39('0x39')]:_0x307be8['model'];_0x583758['order']=qs[_0x9b39('0x3d')](_0x4ac0c5['query'][_0x9b39('0x3d')]);_0x583758['where']=qs[_0x9b39('0x3f')](_['pick'](_0x4ac0c5['query'],_0x307be8[_0x9b39('0x3f')]));if(_0x4ac0c5['query'][_0x9b39('0x40')]){_0x583758[_0x9b39('0x3e')]=_['merge'](_0x583758[_0x9b39('0x3e')],{'$or':_['map'](_0x583758[_0x9b39('0x39')],function(_0x1d74dc){var _0xc97a={};_0xc97a[_0x1d74dc]={'$like':'%'+_0x4ac0c5[_0x9b39('0x37')]['filter']+'%'};return _0xc97a;})});}_0x583758=_['merge']({},_0x583758,_0x4ac0c5[_0x9b39('0x43')]);return _0x27662c[_0x9b39('0x51')](_0x583758);}})[_0x9b39('0x2a')](function(_0x2447b9){if(_0x2447b9){_0x2ce76f=_0x2447b9[_0x9b39('0x4e')];if(!_0x4ac0c5[_0x9b39('0x37')]['hasOwnProperty']('nolimit')){_0x583758['limit']=qs[_0x9b39('0x24')](_0x4ac0c5['query'][_0x9b39('0x24')]);_0x583758[_0x9b39('0x21')]=qs[_0x9b39('0x21')](_0x4ac0c5[_0x9b39('0x37')]['offset']);}return _0x27662c['getDescriptions'](_0x583758);}})['then'](function(_0x4aeefb){if(_0x4aeefb){return _0x4aeefb?{'count':_0x2ce76f,'rows':_0x4aeefb}:null;}})[_0x9b39('0x2a')](respondWithResult(_0x303571,null))['catch'](handleError(_0x303571,null));};exports[_0x9b39('0x54')]=function(_0x1b14df,_0x21d62f,_0x2e4b34){var _0x3b6208={};var _0x4eab9f={};var _0x75a97c;var _0x96ff7f;return db['ZendeskConfiguration'][_0x9b39('0x52')]({'where':{'id':_0x1b14df['params']['id']}})[_0x9b39('0x2a')](handleEntityNotFound(_0x21d62f,null))[_0x9b39('0x2a')](function(_0x589aff){if(_0x589aff){_0x75a97c=_0x589aff;_0x4eab9f[_0x9b39('0x34')]=_[_0x9b39('0x36')](db['Tag'][_0x9b39('0x30')]);_0x4eab9f[_0x9b39('0x37')]=_[_0x9b39('0x36')](_0x1b14df['query']);_0x4eab9f[_0x9b39('0x3f')]=_['intersection'](_0x4eab9f[_0x9b39('0x34')],_0x4eab9f[_0x9b39('0x37')]);_0x3b6208[_0x9b39('0x39')]=_[_0x9b39('0x4a')](_0x4eab9f['model'],qs[_0x9b39('0x38')](_0x1b14df[_0x9b39('0x37')][_0x9b39('0x38')]));_0x3b6208[_0x9b39('0x39')]=_0x3b6208[_0x9b39('0x39')]['length']?_0x3b6208[_0x9b39('0x39')]:_0x4eab9f[_0x9b39('0x34')];_0x3b6208[_0x9b39('0x3c')]=qs[_0x9b39('0x3d')](_0x1b14df['query'][_0x9b39('0x3d')]);_0x3b6208[_0x9b39('0x3e')]=qs[_0x9b39('0x3f')](_[_0x9b39('0x4f')](_0x1b14df['query'],_0x4eab9f[_0x9b39('0x3f')]));if(_0x1b14df[_0x9b39('0x37')]['filter']){_0x3b6208[_0x9b39('0x3e')]=_[_0x9b39('0x41')](_0x3b6208['where'],{'$or':_[_0x9b39('0x35')](_0x3b6208[_0x9b39('0x39')],function(_0x47e0e5){var _0x481c7a={};_0x481c7a[_0x47e0e5]={'$like':'%'+_0x1b14df[_0x9b39('0x37')][_0x9b39('0x40')]+'%'};return _0x481c7a;})});}_0x3b6208=_['merge']({},_0x3b6208,_0x1b14df[_0x9b39('0x43')]);return _0x75a97c[_0x9b39('0x54')](_0x3b6208);}})[_0x9b39('0x2a')](function(_0xa891ac){if(_0xa891ac){_0x96ff7f=_0xa891ac[_0x9b39('0x4e')];if(!_0x1b14df[_0x9b39('0x37')]['hasOwnProperty'](_0x9b39('0x3b'))){_0x3b6208[_0x9b39('0x24')]=qs[_0x9b39('0x24')](_0x1b14df['query'][_0x9b39('0x24')]);_0x3b6208[_0x9b39('0x21')]=qs[_0x9b39('0x21')](_0x1b14df[_0x9b39('0x37')][_0x9b39('0x21')]);}return _0x75a97c[_0x9b39('0x54')](_0x3b6208);}})[_0x9b39('0x2a')](function(_0x38e844){if(_0x38e844){return _0x38e844?{'count':_0x96ff7f,'rows':_0x38e844}:null;}})['then'](respondWithResult(_0x21d62f,null))[_0x9b39('0x47')](handleError(_0x21d62f,null));};exports[_0x9b39('0x55')]=function(_0x1cedb1,_0x361528,_0x20dbe0){if(_0x1cedb1[_0x9b39('0x4c')]['id']){delete _0x1cedb1[_0x9b39('0x4c')]['id'];}return db[_0x9b39('0x2f')][_0x9b39('0x52')]({'where':{'id':_0x1cedb1[_0x9b39('0x49')]['id']}})[_0x9b39('0x2a')](handleEntityNotFound(_0x361528,null))['then'](function(_0x5e6420){if(_0x5e6420){return _0x5e6420['setTags'](_0x1cedb1[_0x9b39('0x4c')][_0x9b39('0x56')]||[]);}return null;})['then'](respondWithResult(_0x361528,null))[_0x9b39('0x47')](handleError(_0x361528,null));}; \ No newline at end of file +var _0xc7ad=['nolimit','where','pick','filter','merge','VIRTUAL','catch','show','params','length','includeAll','options','find','create','body','update','getFields','order','sort','hasOwnProperty','findOne','getSubjects','getDescriptions','ZendeskField','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','error','name','send','index','map','ZendeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields'];(function(_0x2966ed,_0x367c3f){var _0x5ab1b9=function(_0xed1ffb){while(--_0xed1ffb){_0x2966ed['push'](_0x2966ed['shift']());}};_0x5ab1b9(++_0x367c3f);}(_0xc7ad,0x1c5));var _0xdc7a=function(_0xb5ab88,_0x505ef1){_0xb5ab88=_0xb5ab88-0x0;var _0x232459=_0xc7ad[_0xb5ab88];return _0x232459;};'use strict';var emlformat=require(_0xdc7a('0x0'));var rimraf=require(_0xdc7a('0x1'));var zipdir=require(_0xdc7a('0x2'));var jsonpatch=require(_0xdc7a('0x3'));var rp=require(_0xdc7a('0x4'));var moment=require(_0xdc7a('0x5'));var BPromise=require(_0xdc7a('0x6'));var Mustache=require(_0xdc7a('0x7'));var util=require(_0xdc7a('0x8'));var path=require(_0xdc7a('0x9'));var sox=require(_0xdc7a('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdc7a('0xb'));var _=require('lodash');var squel=require(_0xdc7a('0xc'));var crypto=require(_0xdc7a('0xd'));var jsforce=require(_0xdc7a('0xe'));var deskjs=require(_0xdc7a('0xf'));var toCsv=require(_0xdc7a('0x10'));var querystring=require(_0xdc7a('0x11'));var Papa=require(_0xdc7a('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xdc7a('0x13'));var as=require(_0xdc7a('0x14'));var hardwareService=require(_0xdc7a('0x15'));var logger=require(_0xdc7a('0x16'))(_0xdc7a('0x17'));var utils=require('../../config/utils');var config=require(_0xdc7a('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xdc7a('0x19'))['db'];function respondWithStatusCode(_0x24b56c,_0x4302b9){_0x4302b9=_0x4302b9||0xcc;return function(_0x3aa955){if(_0x3aa955){return _0x24b56c[_0xdc7a('0x1a')](_0x4302b9);}return _0x24b56c[_0xdc7a('0x1b')](_0x4302b9)[_0xdc7a('0x1c')]();};}function respondWithResult(_0x5efabb,_0x4c9d67){_0x4c9d67=_0x4c9d67||0xc8;return function(_0x2d4e7b){if(_0x2d4e7b){return _0x5efabb[_0xdc7a('0x1b')](_0x4c9d67)[_0xdc7a('0x1d')](_0x2d4e7b);}};}function respondWithFilteredResult(_0x458829,_0x5e07bd){return function(_0xcfa59a){if(_0xcfa59a){var _0x2183b8=typeof _0x5e07bd[_0xdc7a('0x1e')]===_0xdc7a('0x1f')&&typeof _0x5e07bd[_0xdc7a('0x20')]===_0xdc7a('0x1f');var _0xcaab9b=_0xcfa59a[_0xdc7a('0x21')];var _0x3c9ea0=_0x2183b8?0x0:_0x5e07bd[_0xdc7a('0x1e')];var _0x15027d=_0x2183b8?_0xcfa59a[_0xdc7a('0x21')]:_0x5e07bd[_0xdc7a('0x1e')]+_0x5e07bd[_0xdc7a('0x20')];var _0x3aa3ec;if(_0x15027d>=_0xcaab9b){_0x15027d=_0xcaab9b;_0x3aa3ec=0xc8;}else{_0x3aa3ec=0xce;}_0x458829['status'](_0x3aa3ec);return _0x458829[_0xdc7a('0x22')](_0xdc7a('0x23'),_0x3c9ea0+'-'+_0x15027d+'/'+_0xcaab9b)[_0xdc7a('0x1d')](_0xcfa59a);}return null;};}function patchUpdates(_0x5ee628){return function(_0x10a9b7){try{jsonpatch[_0xdc7a('0x24')](_0x10a9b7,_0x5ee628,!![]);}catch(_0x2ac71d){return BPromise[_0xdc7a('0x25')](_0x2ac71d);}return _0x10a9b7['save']();};}function saveUpdates(_0x18b424,_0x36b962){return function(_0x24710f){if(_0x24710f){return _0x24710f['update'](_0x18b424)[_0xdc7a('0x26')](function(_0x42aa98){return _0x42aa98;});}return null;};}function removeEntity(_0x1405c5,_0xfcf1a5){return function(_0x46dcf4){if(_0x46dcf4){return _0x46dcf4[_0xdc7a('0x27')]()['then'](function(){_0x1405c5[_0xdc7a('0x1b')](0xcc)[_0xdc7a('0x1c')]();});}};}function handleEntityNotFound(_0x58c216,_0x1a9354){return function(_0x57b8f0){if(!_0x57b8f0){_0x58c216['sendStatus'](0x194);}return _0x57b8f0;};}function handleError(_0x2ffc40,_0x3e0d3f){_0x3e0d3f=_0x3e0d3f||0x1f4;return function(_0x76675d){logger[_0xdc7a('0x28')](_0x76675d['stack']);if(_0x76675d['name']){delete _0x76675d[_0xdc7a('0x29')];}_0x2ffc40['status'](_0x3e0d3f)[_0xdc7a('0x2a')](_0x76675d);};}exports[_0xdc7a('0x2b')]=function(_0x3467d2,_0xc63dd8){var _0x42d259={},_0x462f56={},_0x4d313b={'count':0x0,'rows':[]};var _0x4b8937=_[_0xdc7a('0x2c')](db[_0xdc7a('0x2d')][_0xdc7a('0x2e')],function(_0x2c8789){return{'name':_0x2c8789[_0xdc7a('0x2f')],'type':_0x2c8789[_0xdc7a('0x30')][_0xdc7a('0x31')]};});_0x462f56[_0xdc7a('0x32')]=_[_0xdc7a('0x2c')](_0x4b8937,_0xdc7a('0x29'));_0x462f56[_0xdc7a('0x33')]=_[_0xdc7a('0x34')](_0x3467d2[_0xdc7a('0x33')]);_0x462f56[_0xdc7a('0x35')]=_[_0xdc7a('0x36')](_0x462f56[_0xdc7a('0x32')],_0x462f56[_0xdc7a('0x33')]);_0x42d259[_0xdc7a('0x37')]=_['intersection'](_0x462f56['model'],qs[_0xdc7a('0x38')](_0x3467d2[_0xdc7a('0x33')][_0xdc7a('0x38')]));_0x42d259['attributes']=_0x42d259[_0xdc7a('0x37')]['length']?_0x42d259['attributes']:_0x462f56[_0xdc7a('0x32')];if(!_0x3467d2[_0xdc7a('0x33')]['hasOwnProperty'](_0xdc7a('0x39'))){_0x42d259[_0xdc7a('0x20')]=qs[_0xdc7a('0x20')](_0x3467d2['query'][_0xdc7a('0x20')]);_0x42d259[_0xdc7a('0x1e')]=qs[_0xdc7a('0x1e')](_0x3467d2[_0xdc7a('0x33')][_0xdc7a('0x1e')]);}_0x42d259['order']=qs['sort'](_0x3467d2['query']['sort']);_0x42d259[_0xdc7a('0x3a')]=qs[_0xdc7a('0x35')](_[_0xdc7a('0x3b')](_0x3467d2[_0xdc7a('0x33')],_0x462f56[_0xdc7a('0x35')]),_0x4b8937);if(_0x3467d2[_0xdc7a('0x33')][_0xdc7a('0x3c')]){_0x42d259['where']=_[_0xdc7a('0x3d')](_0x42d259['where'],{'$or':_[_0xdc7a('0x2c')](_0x4b8937,function(_0x3d24ea){if(_0x3d24ea['type']!==_0xdc7a('0x3e')){var _0x21eaa7={};_0x21eaa7[_0x3d24ea['name']]={'$like':'%'+_0x3467d2[_0xdc7a('0x33')]['filter']+'%'};return _0x21eaa7;}})});}_0x42d259=_[_0xdc7a('0x3d')]({},_0x42d259,_0x3467d2['options']);var _0x406826={'where':_0x42d259['where']};return db[_0xdc7a('0x2d')]['count'](_0x406826)['then'](function(_0x231c7b){_0x4d313b['count']=_0x231c7b;if(_0x3467d2['query']['includeAll']){_0x42d259['include']=[{'all':!![]}];}return db['ZendeskConfiguration']['findAll'](_0x42d259);})['then'](function(_0x2c6b43){_0x4d313b['rows']=_0x2c6b43;return _0x4d313b;})[_0xdc7a('0x26')](respondWithFilteredResult(_0xc63dd8,_0x42d259))[_0xdc7a('0x3f')](handleError(_0xc63dd8,null));};exports[_0xdc7a('0x40')]=function(_0x408b12,_0x5794d7){var _0x7bf750={'raw':![],'where':{'id':_0x408b12[_0xdc7a('0x41')]['id']}},_0x208ef5={};_0x208ef5[_0xdc7a('0x32')]=_[_0xdc7a('0x34')](db[_0xdc7a('0x2d')][_0xdc7a('0x2e')]);_0x208ef5[_0xdc7a('0x33')]=_[_0xdc7a('0x34')](_0x408b12[_0xdc7a('0x33')]);_0x208ef5[_0xdc7a('0x35')]=_[_0xdc7a('0x36')](_0x208ef5[_0xdc7a('0x32')],_0x208ef5[_0xdc7a('0x33')]);_0x7bf750['attributes']=_[_0xdc7a('0x36')](_0x208ef5[_0xdc7a('0x32')],qs[_0xdc7a('0x38')](_0x408b12[_0xdc7a('0x33')][_0xdc7a('0x38')]));_0x7bf750[_0xdc7a('0x37')]=_0x7bf750[_0xdc7a('0x37')][_0xdc7a('0x42')]?_0x7bf750[_0xdc7a('0x37')]:_0x208ef5['model'];if(_0x408b12['query'][_0xdc7a('0x43')]){_0x7bf750['include']=[{'all':!![]}];}_0x7bf750=_[_0xdc7a('0x3d')]({},_0x7bf750,_0x408b12[_0xdc7a('0x44')]);return db[_0xdc7a('0x2d')][_0xdc7a('0x45')](_0x7bf750)[_0xdc7a('0x26')](handleEntityNotFound(_0x5794d7,null))[_0xdc7a('0x26')](respondWithResult(_0x5794d7,null))[_0xdc7a('0x3f')](handleError(_0x5794d7,null));};exports[_0xdc7a('0x46')]=function(_0xbe68ab,_0x569dfc){return db[_0xdc7a('0x2d')]['create'](_0xbe68ab[_0xdc7a('0x47')],{})['then'](respondWithResult(_0x569dfc,0xc9))['catch'](handleError(_0x569dfc,null));};exports[_0xdc7a('0x48')]=function(_0x887f0,_0x1ced49){if(_0x887f0[_0xdc7a('0x47')]['id']){delete _0x887f0[_0xdc7a('0x47')]['id'];}return db[_0xdc7a('0x2d')][_0xdc7a('0x45')]({'where':{'id':_0x887f0[_0xdc7a('0x41')]['id']}})[_0xdc7a('0x26')](handleEntityNotFound(_0x1ced49,null))[_0xdc7a('0x26')](saveUpdates(_0x887f0[_0xdc7a('0x47')],null))[_0xdc7a('0x26')](respondWithResult(_0x1ced49,null))['catch'](handleError(_0x1ced49,null));};exports[_0xdc7a('0x27')]=function(_0x1f8294,_0x131b0c){return db[_0xdc7a('0x2d')][_0xdc7a('0x45')]({'where':{'id':_0x1f8294[_0xdc7a('0x41')]['id']}})[_0xdc7a('0x26')](handleEntityNotFound(_0x131b0c,null))[_0xdc7a('0x26')](removeEntity(_0x131b0c,null))['catch'](handleError(_0x131b0c,null));};exports[_0xdc7a('0x49')]=function(_0x6925be,_0x2894a3,_0x243a75){var _0xcb0d76={};var _0x18bf5e={};var _0x438313;var _0x200c5f;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x6925be[_0xdc7a('0x41')]['id']}})['then'](handleEntityNotFound(_0x2894a3,null))['then'](function(_0x52dca7){if(_0x52dca7){_0x438313=_0x52dca7;_0x18bf5e[_0xdc7a('0x32')]=_[_0xdc7a('0x34')](db['ZendeskField'][_0xdc7a('0x2e')]);_0x18bf5e[_0xdc7a('0x33')]=_[_0xdc7a('0x34')](_0x6925be[_0xdc7a('0x33')]);_0x18bf5e['filters']=_[_0xdc7a('0x36')](_0x18bf5e[_0xdc7a('0x32')],_0x18bf5e[_0xdc7a('0x33')]);_0xcb0d76[_0xdc7a('0x37')]=_[_0xdc7a('0x36')](_0x18bf5e['model'],qs['fields'](_0x6925be[_0xdc7a('0x33')][_0xdc7a('0x38')]));_0xcb0d76['attributes']=_0xcb0d76[_0xdc7a('0x37')][_0xdc7a('0x42')]?_0xcb0d76['attributes']:_0x18bf5e[_0xdc7a('0x32')];_0xcb0d76[_0xdc7a('0x4a')]=qs['sort'](_0x6925be[_0xdc7a('0x33')][_0xdc7a('0x4b')]);_0xcb0d76[_0xdc7a('0x3a')]=qs['filters'](_['pick'](_0x6925be['query'],_0x18bf5e[_0xdc7a('0x35')]));if(_0x6925be[_0xdc7a('0x33')][_0xdc7a('0x3c')]){_0xcb0d76[_0xdc7a('0x3a')]=_[_0xdc7a('0x3d')](_0xcb0d76[_0xdc7a('0x3a')],{'$or':_['map'](_0xcb0d76[_0xdc7a('0x37')],function(_0x476a0e){var _0x430312={};_0x430312[_0x476a0e]={'$like':'%'+_0x6925be[_0xdc7a('0x33')]['filter']+'%'};return _0x430312;})});}_0xcb0d76=_[_0xdc7a('0x3d')]({},_0xcb0d76,_0x6925be[_0xdc7a('0x44')]);return _0x438313['getFields'](_0xcb0d76);}})[_0xdc7a('0x26')](function(_0x8d8064){if(_0x8d8064){_0x200c5f=_0x8d8064[_0xdc7a('0x42')];if(!_0x6925be[_0xdc7a('0x33')][_0xdc7a('0x4c')](_0xdc7a('0x39'))){_0xcb0d76[_0xdc7a('0x20')]=qs[_0xdc7a('0x20')](_0x6925be[_0xdc7a('0x33')][_0xdc7a('0x20')]);_0xcb0d76[_0xdc7a('0x1e')]=qs[_0xdc7a('0x1e')](_0x6925be['query'][_0xdc7a('0x1e')]);}return _0x438313[_0xdc7a('0x49')](_0xcb0d76);}})[_0xdc7a('0x26')](function(_0x547876){if(_0x547876){return _0x547876?{'count':_0x200c5f,'rows':_0x547876}:null;}})[_0xdc7a('0x26')](respondWithResult(_0x2894a3,null))['catch'](handleError(_0x2894a3,null));};exports['getSubjects']=function(_0x155a81,_0x14e7f0,_0x3b9423){var _0x2c8fc3={};var _0x58df20={};var _0x5b205e;var _0x2116f9;return db['ZendeskConfiguration'][_0xdc7a('0x4d')]({'where':{'id':_0x155a81['params']['id']}})[_0xdc7a('0x26')](handleEntityNotFound(_0x14e7f0,null))['then'](function(_0x4dd1cb){if(_0x4dd1cb){_0x5b205e=_0x4dd1cb;_0x58df20[_0xdc7a('0x32')]=_['keys'](db['ZendeskField']['rawAttributes']);_0x58df20['query']=_[_0xdc7a('0x34')](_0x155a81[_0xdc7a('0x33')]);_0x58df20[_0xdc7a('0x35')]=_[_0xdc7a('0x36')](_0x58df20[_0xdc7a('0x32')],_0x58df20[_0xdc7a('0x33')]);_0x2c8fc3[_0xdc7a('0x37')]=_[_0xdc7a('0x36')](_0x58df20[_0xdc7a('0x32')],qs['fields'](_0x155a81[_0xdc7a('0x33')][_0xdc7a('0x38')]));_0x2c8fc3['attributes']=_0x2c8fc3[_0xdc7a('0x37')][_0xdc7a('0x42')]?_0x2c8fc3[_0xdc7a('0x37')]:_0x58df20[_0xdc7a('0x32')];_0x2c8fc3[_0xdc7a('0x4a')]=qs[_0xdc7a('0x4b')](_0x155a81[_0xdc7a('0x33')][_0xdc7a('0x4b')]);_0x2c8fc3['where']=qs[_0xdc7a('0x35')](_[_0xdc7a('0x3b')](_0x155a81[_0xdc7a('0x33')],_0x58df20['filters']));if(_0x155a81['query'][_0xdc7a('0x3c')]){_0x2c8fc3[_0xdc7a('0x3a')]=_[_0xdc7a('0x3d')](_0x2c8fc3[_0xdc7a('0x3a')],{'$or':_[_0xdc7a('0x2c')](_0x2c8fc3[_0xdc7a('0x37')],function(_0x1a1d2d){var _0x59a8bc={};_0x59a8bc[_0x1a1d2d]={'$like':'%'+_0x155a81[_0xdc7a('0x33')]['filter']+'%'};return _0x59a8bc;})});}_0x2c8fc3=_[_0xdc7a('0x3d')]({},_0x2c8fc3,_0x155a81[_0xdc7a('0x44')]);return _0x5b205e['getSubjects'](_0x2c8fc3);}})['then'](function(_0xc4451a){if(_0xc4451a){_0x2116f9=_0xc4451a[_0xdc7a('0x42')];if(!_0x155a81[_0xdc7a('0x33')]['hasOwnProperty'](_0xdc7a('0x39'))){_0x2c8fc3[_0xdc7a('0x20')]=qs[_0xdc7a('0x20')](_0x155a81['query'][_0xdc7a('0x20')]);_0x2c8fc3['offset']=qs[_0xdc7a('0x1e')](_0x155a81['query'][_0xdc7a('0x1e')]);}return _0x5b205e[_0xdc7a('0x4e')](_0x2c8fc3);}})[_0xdc7a('0x26')](function(_0x3cb978){if(_0x3cb978){return _0x3cb978?{'count':_0x2116f9,'rows':_0x3cb978}:null;}})[_0xdc7a('0x26')](respondWithResult(_0x14e7f0,null))['catch'](handleError(_0x14e7f0,null));};exports[_0xdc7a('0x4f')]=function(_0x26554e,_0x2bd4db,_0x1b2fa9){var _0x7f5bad={};var _0x418e73={};var _0x431cbd;var _0x3f3424;return db['ZendeskConfiguration'][_0xdc7a('0x4d')]({'where':{'id':_0x26554e[_0xdc7a('0x41')]['id']}})[_0xdc7a('0x26')](handleEntityNotFound(_0x2bd4db,null))['then'](function(_0x4c2fe1){if(_0x4c2fe1){_0x431cbd=_0x4c2fe1;_0x418e73['model']=_[_0xdc7a('0x34')](db[_0xdc7a('0x50')][_0xdc7a('0x2e')]);_0x418e73[_0xdc7a('0x33')]=_['keys'](_0x26554e['query']);_0x418e73[_0xdc7a('0x35')]=_[_0xdc7a('0x36')](_0x418e73['model'],_0x418e73[_0xdc7a('0x33')]);_0x7f5bad[_0xdc7a('0x37')]=_['intersection'](_0x418e73[_0xdc7a('0x32')],qs['fields'](_0x26554e[_0xdc7a('0x33')][_0xdc7a('0x38')]));_0x7f5bad['attributes']=_0x7f5bad['attributes'][_0xdc7a('0x42')]?_0x7f5bad[_0xdc7a('0x37')]:_0x418e73[_0xdc7a('0x32')];_0x7f5bad[_0xdc7a('0x4a')]=qs[_0xdc7a('0x4b')](_0x26554e['query'][_0xdc7a('0x4b')]);_0x7f5bad['where']=qs[_0xdc7a('0x35')](_['pick'](_0x26554e[_0xdc7a('0x33')],_0x418e73[_0xdc7a('0x35')]));if(_0x26554e[_0xdc7a('0x33')][_0xdc7a('0x3c')]){_0x7f5bad[_0xdc7a('0x3a')]=_['merge'](_0x7f5bad[_0xdc7a('0x3a')],{'$or':_['map'](_0x7f5bad[_0xdc7a('0x37')],function(_0x2c168d){var _0xb4ceed={};_0xb4ceed[_0x2c168d]={'$like':'%'+_0x26554e[_0xdc7a('0x33')]['filter']+'%'};return _0xb4ceed;})});}_0x7f5bad=_[_0xdc7a('0x3d')]({},_0x7f5bad,_0x26554e['options']);return _0x431cbd['getDescriptions'](_0x7f5bad);}})[_0xdc7a('0x26')](function(_0x5cca0f){if(_0x5cca0f){_0x3f3424=_0x5cca0f['length'];if(!_0x26554e[_0xdc7a('0x33')][_0xdc7a('0x4c')](_0xdc7a('0x39'))){_0x7f5bad[_0xdc7a('0x20')]=qs['limit'](_0x26554e['query'][_0xdc7a('0x20')]);_0x7f5bad['offset']=qs[_0xdc7a('0x1e')](_0x26554e['query']['offset']);}return _0x431cbd[_0xdc7a('0x4f')](_0x7f5bad);}})[_0xdc7a('0x26')](function(_0x397b41){if(_0x397b41){return _0x397b41?{'count':_0x3f3424,'rows':_0x397b41}:null;}})['then'](respondWithResult(_0x2bd4db,null))[_0xdc7a('0x3f')](handleError(_0x2bd4db,null));};exports[_0xdc7a('0x51')]=function(_0x2f7317,_0x674fd,_0x1d82b4){var _0x297e8d={};var _0x228aae={};var _0x462f8c;var _0x36843e;return db[_0xdc7a('0x2d')]['findOne']({'where':{'id':_0x2f7317['params']['id']}})[_0xdc7a('0x26')](handleEntityNotFound(_0x674fd,null))['then'](function(_0x2b71f5){if(_0x2b71f5){_0x462f8c=_0x2b71f5;_0x228aae['model']=_[_0xdc7a('0x34')](db[_0xdc7a('0x52')][_0xdc7a('0x2e')]);_0x228aae[_0xdc7a('0x33')]=_['keys'](_0x2f7317[_0xdc7a('0x33')]);_0x228aae['filters']=_[_0xdc7a('0x36')](_0x228aae[_0xdc7a('0x32')],_0x228aae[_0xdc7a('0x33')]);_0x297e8d[_0xdc7a('0x37')]=_[_0xdc7a('0x36')](_0x228aae[_0xdc7a('0x32')],qs[_0xdc7a('0x38')](_0x2f7317['query'][_0xdc7a('0x38')]));_0x297e8d['attributes']=_0x297e8d[_0xdc7a('0x37')]['length']?_0x297e8d[_0xdc7a('0x37')]:_0x228aae[_0xdc7a('0x32')];_0x297e8d[_0xdc7a('0x4a')]=qs[_0xdc7a('0x4b')](_0x2f7317['query'][_0xdc7a('0x4b')]);_0x297e8d['where']=qs[_0xdc7a('0x35')](_[_0xdc7a('0x3b')](_0x2f7317[_0xdc7a('0x33')],_0x228aae[_0xdc7a('0x35')]));if(_0x2f7317[_0xdc7a('0x33')][_0xdc7a('0x3c')]){_0x297e8d[_0xdc7a('0x3a')]=_[_0xdc7a('0x3d')](_0x297e8d[_0xdc7a('0x3a')],{'$or':_[_0xdc7a('0x2c')](_0x297e8d[_0xdc7a('0x37')],function(_0xfe802b){var _0x3a4408={};_0x3a4408[_0xfe802b]={'$like':'%'+_0x2f7317[_0xdc7a('0x33')]['filter']+'%'};return _0x3a4408;})});}_0x297e8d=_[_0xdc7a('0x3d')]({},_0x297e8d,_0x2f7317[_0xdc7a('0x44')]);return _0x462f8c[_0xdc7a('0x51')](_0x297e8d);}})['then'](function(_0xd36d77){if(_0xd36d77){_0x36843e=_0xd36d77['length'];if(!_0x2f7317[_0xdc7a('0x33')]['hasOwnProperty']('nolimit')){_0x297e8d['limit']=qs['limit'](_0x2f7317[_0xdc7a('0x33')][_0xdc7a('0x20')]);_0x297e8d[_0xdc7a('0x1e')]=qs['offset'](_0x2f7317[_0xdc7a('0x33')][_0xdc7a('0x1e')]);}return _0x462f8c['getTags'](_0x297e8d);}})[_0xdc7a('0x26')](function(_0x15b0e2){if(_0x15b0e2){return _0x15b0e2?{'count':_0x36843e,'rows':_0x15b0e2}:null;}})[_0xdc7a('0x26')](respondWithResult(_0x674fd,null))[_0xdc7a('0x3f')](handleError(_0x674fd,null));};exports[_0xdc7a('0x53')]=function(_0xfaffe3,_0x39a460,_0x4df51d){if(_0xfaffe3[_0xdc7a('0x47')]['id']){delete _0xfaffe3[_0xdc7a('0x47')]['id'];}return db[_0xdc7a('0x2d')][_0xdc7a('0x4d')]({'where':{'id':_0xfaffe3[_0xdc7a('0x41')]['id']}})[_0xdc7a('0x26')](handleEntityNotFound(_0x39a460,null))['then'](function(_0x5e9570){if(_0x5e9570){return _0x5e9570[_0xdc7a('0x53')](_0xfaffe3[_0xdc7a('0x47')][_0xdc7a('0x54')]||[]);}return null;})[_0xdc7a('0x26')](respondWithResult(_0x39a460,null))['catch'](handleError(_0x39a460,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 83e38bb..ac78a1e 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 _0x8f59=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','define','lodash'];(function(_0x252d6b,_0x4cd8ab){var _0x13632c=function(_0x4424af){while(--_0x4424af){_0x252d6b['push'](_0x252d6b['shift']());}};_0x13632c(++_0x4cd8ab);}(_0x8f59,0x11d));var _0x98f5=function(_0x1ccb4b,_0x1c5bdc){_0x1ccb4b=_0x1ccb4b-0x0;var _0x2fd92c=_0x8f59[_0x1ccb4b];return _0x2fd92c;};'use strict';var _=require(_0x98f5('0x0'));var util=require(_0x98f5('0x1'));var logger=require(_0x98f5('0x2'))(_0x98f5('0x3'));var moment=require(_0x98f5('0x4'));var BPromise=require(_0x98f5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x98f5('0x6'));var rimraf=require(_0x98f5('0x7'));var config=require(_0x98f5('0x8'));var attributes=require(_0x98f5('0x9'));module['exports']=function(_0xdcce7a,_0x358618){return _0xdcce7a[_0x98f5('0xa')]('ZendeskConfiguration',attributes,{'tableName':'int_zendesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5c00=['moment','request-promise','path','rimraf','../../config/environment','exports','define','int_zendesk_configurations','lodash','util','../../config/logger'];(function(_0x2d9c8f,_0x4f491a){var _0x3df3d9=function(_0x13aff2){while(--_0x13aff2){_0x2d9c8f['push'](_0x2d9c8f['shift']());}};_0x3df3d9(++_0x4f491a);}(_0x5c00,0x17e));var _0x05c0=function(_0x557bf4,_0x1f8dad){_0x557bf4=_0x557bf4-0x0;var _0x2916e2=_0x5c00[_0x557bf4];return _0x2916e2;};'use strict';var _=require(_0x05c0('0x0'));var util=require(_0x05c0('0x1'));var logger=require(_0x05c0('0x2'))('api');var moment=require(_0x05c0('0x3'));var BPromise=require('bluebird');var rp=require(_0x05c0('0x4'));var fs=require('fs');var path=require(_0x05c0('0x5'));var rimraf=require(_0x05c0('0x6'));var config=require(_0x05c0('0x7'));var attributes=require('./intZendeskConfiguration.attributes');module[_0x05c0('0x8')]=function(_0x3521fe,_0x261624){return _0x3521fe[_0x05c0('0x9')]('ZendeskConfiguration',attributes,{'tableName':_0x05c0('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 4bab71e..5633114 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 _0xd172=['stringify','error','code','message','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x2a3e2e,_0x361676){var _0x272aaa=function(_0x31d93c){while(--_0x31d93c){_0x2a3e2e['push'](_0x2a3e2e['shift']());}};_0x272aaa(++_0x361676);}(_0xd172,0xb5));var _0x2d17=function(_0x261398,_0x582760){_0x261398=_0x261398-0x0;var _0x514364=_0xd172[_0x261398];return _0x514364;};'use strict';var _=require(_0x2d17('0x0'));var util=require('util');var moment=require(_0x2d17('0x1'));var BPromise=require('bluebird');var rs=require(_0x2d17('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2d17('0x3'))['db'];var utils=require(_0x2d17('0x4'));var logger=require(_0x2d17('0x5'))(_0x2d17('0x6'));var config=require(_0x2d17('0x7'));var jayson=require(_0x2d17('0x8'));var client=jayson[_0x2d17('0x9')][_0x2d17('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x28d33c,_0x2425d2,_0x33f44b){return new BPromise(function(_0x35c850,_0x40b743){return client[_0x2d17('0xb')](_0x28d33c,_0x33f44b)[_0x2d17('0xc')](function(_0x5b48bd){logger[_0x2d17('0xd')](_0x2d17('0xe'),_0x2425d2,'request\x20sent');logger['debug'](_0x2d17('0xf'),_0x2425d2,_0x2d17('0x10'),JSON[_0x2d17('0x11')](_0x5b48bd));if(_0x5b48bd[_0x2d17('0x12')]){if(_0x5b48bd[_0x2d17('0x12')][_0x2d17('0x13')]===0x1f4){logger[_0x2d17('0x12')](_0x2d17('0xe'),_0x2425d2,_0x5b48bd[_0x2d17('0x12')][_0x2d17('0x14')]);return _0x40b743(_0x5b48bd[_0x2d17('0x12')][_0x2d17('0x14')]);}logger[_0x2d17('0x12')](_0x2d17('0xe'),_0x2425d2,_0x5b48bd[_0x2d17('0x12')]['message']);return _0x35c850(_0x5b48bd[_0x2d17('0x12')]['message']);}else{logger[_0x2d17('0xd')](_0x2d17('0xe'),_0x2425d2,'request\x20sent');_0x35c850(_0x5b48bd['result'][_0x2d17('0x14')]);}})[_0x2d17('0x15')](function(_0x38ef6f){logger[_0x2d17('0x12')]('ZendeskConfiguration,\x20%s,\x20%s',_0x2425d2,_0x38ef6f);_0x40b743(_0x38ef6f);});});} \ No newline at end of file +var _0x0e76=['debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x5a4b6f,_0x333af4){var _0x1ec39d=function(_0x15d4ea){while(--_0x15d4ea){_0x5a4b6f['push'](_0x5a4b6f['shift']());}};_0x1ec39d(++_0x333af4);}(_0x0e76,0xa1));var _0x60e7=function(_0x2a2766,_0x475265){_0x2a2766=_0x2a2766-0x0;var _0x30a56c=_0x0e76[_0x2a2766];return _0x30a56c;};'use strict';var _=require(_0x60e7('0x0'));var util=require(_0x60e7('0x1'));var moment=require(_0x60e7('0x2'));var BPromise=require('bluebird');var rs=require(_0x60e7('0x3'));var fs=require('fs');var Redis=require(_0x60e7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x60e7('0x5'));var logger=require(_0x60e7('0x6'))(_0x60e7('0x7'));var config=require('../../config/environment');var jayson=require(_0x60e7('0x8'));var client=jayson[_0x60e7('0x9')][_0x60e7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1ef9b0,_0x8321d3,_0x4d4adb){return new BPromise(function(_0x556457,_0xc44386){return client[_0x60e7('0xb')](_0x1ef9b0,_0x4d4adb)[_0x60e7('0xc')](function(_0x9e08fd){logger['info'](_0x60e7('0xd'),_0x8321d3,_0x60e7('0xe'));logger[_0x60e7('0xf')](_0x60e7('0x10'),_0x8321d3,_0x60e7('0xe'),JSON['stringify'](_0x9e08fd));if(_0x9e08fd[_0x60e7('0x11')]){if(_0x9e08fd[_0x60e7('0x11')][_0x60e7('0x12')]===0x1f4){logger['error'](_0x60e7('0xd'),_0x8321d3,_0x9e08fd['error'][_0x60e7('0x13')]);return _0xc44386(_0x9e08fd[_0x60e7('0x11')][_0x60e7('0x13')]);}logger[_0x60e7('0x11')]('ZendeskConfiguration,\x20%s,\x20%s',_0x8321d3,_0x9e08fd[_0x60e7('0x11')]['message']);return _0x556457(_0x9e08fd['error'][_0x60e7('0x13')]);}else{logger['info'](_0x60e7('0xd'),_0x8321d3,_0x60e7('0xe'));_0x556457(_0x9e08fd[_0x60e7('0x14')][_0x60e7('0x13')]);}})[_0x60e7('0x15')](function(_0x10a4c3){logger[_0x60e7('0x11')](_0x60e7('0xd'),_0x8321d3,_0x10a4c3);_0xc44386(_0x10a4c3);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 542cf81..9d9ac89 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 _0x7453=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','exports','multer'];(function(_0x300f88,_0x4daa84){var _0x56bb46=function(_0x292355){while(--_0x292355){_0x300f88['push'](_0x300f88['shift']());}};_0x56bb46(++_0x4daa84);}(_0x7453,0x1a1));var _0x3745=function(_0x5acdc7,_0x4dcae6){_0x5acdc7=_0x5acdc7-0x0;var _0xa91a9b=_0x7453[_0x5acdc7];return _0xa91a9b;};'use strict';var multer=require(_0x3745('0x0'));var util=require(_0x3745('0x1'));var path=require(_0x3745('0x2'));var timeout=require(_0x3745('0x3'));var express=require(_0x3745('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3745('0x5'));var interaction=require(_0x3745('0x6'));var config=require(_0x3745('0x7'));var controller=require(_0x3745('0x8'));router[_0x3745('0x9')]('/',auth[_0x3745('0xa')](),controller['index']);router['get'](_0x3745('0xb'),auth[_0x3745('0xa')](),controller[_0x3745('0xc')]);router[_0x3745('0xd')]('/',auth[_0x3745('0xa')](),controller['create']);router[_0x3745('0xe')](_0x3745('0xb'),auth['isAuthenticated'](),controller[_0x3745('0xf')]);router[_0x3745('0x10')](_0x3745('0xb'),auth['isAuthenticated'](),controller[_0x3745('0x11')]);module[_0x3745('0x12')]=router; \ No newline at end of file +var _0x6b15=['/:id','show','create','delete','destroy','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index'];(function(_0x1167b4,_0x226442){var _0x26e268=function(_0x1b959b){while(--_0x1b959b){_0x1167b4['push'](_0x1167b4['shift']());}};_0x26e268(++_0x226442);}(_0x6b15,0x106));var _0x56b1=function(_0x5d8adb,_0x423191){_0x5d8adb=_0x5d8adb-0x0;var _0x4b22cd=_0x6b15[_0x5d8adb];return _0x4b22cd;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x56b1('0x0'));var express=require(_0x56b1('0x1'));var router=express[_0x56b1('0x2')]();var fs_extra=require(_0x56b1('0x3'));var auth=require(_0x56b1('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x56b1('0x5'));var controller=require(_0x56b1('0x6'));router[_0x56b1('0x7')]('/',auth[_0x56b1('0x8')](),controller[_0x56b1('0x9')]);router[_0x56b1('0x7')](_0x56b1('0xa'),auth['isAuthenticated'](),controller[_0x56b1('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x56b1('0xc')]);router['put'](_0x56b1('0xa'),auth[_0x56b1('0x8')](),controller['update']);router[_0x56b1('0xd')](_0x56b1('0xa'),auth[_0x56b1('0x8')](),controller[_0x56b1('0xe')]);module[_0x56b1('0xf')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 8004be6..6a18d64 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 _0x0aa9=['string','STRING','variable','BOOLEAN','sequelize','customVariable','keyValue','picklist'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0x0aa9,0xac));var _0x90aa=function(_0x3a2a6,_0x3b8d74){_0x3a2a6=_0x3a2a6-0x0;var _0x51db8c=_0x0aa9[_0x3a2a6];return _0x51db8c;};'use strict';var Sequelize=require(_0x90aa('0x0'));module['exports']={'type':{'type':Sequelize['ENUM']('string','variable',_0x90aa('0x1'),_0x90aa('0x2'),_0x90aa('0x3')),'defaultValue':_0x90aa('0x4')},'content':{'type':Sequelize[_0x90aa('0x5')]},'key':{'type':Sequelize[_0x90aa('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x90aa('0x4'),_0x90aa('0x6'),_0x90aa('0x1'))},'keyContent':{'type':Sequelize[_0x90aa('0x5')]},'idField':{'type':Sequelize[_0x90aa('0x5')]},'nameField':{'type':Sequelize[_0x90aa('0x5')]},'customField':{'type':Sequelize[_0x90aa('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1994=['STRING','customVariable','BOOLEAN','sequelize','exports','ENUM','string','variable','keyValue','picklist'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x1994,0x1b1));var _0x4199=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x1994[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x4199('0x0'));module[_0x4199('0x1')]={'type':{'type':Sequelize[_0x4199('0x2')](_0x4199('0x3'),_0x4199('0x4'),'customVariable',_0x4199('0x5'),_0x4199('0x6')),'defaultValue':_0x4199('0x3')},'content':{'type':Sequelize[_0x4199('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x4199('0x3'),_0x4199('0x4'),_0x4199('0x8'))},'keyContent':{'type':Sequelize[_0x4199('0x7')]},'idField':{'type':Sequelize[_0x4199('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x4199('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 9c2b533..f4670c7 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 _0xc7e9=['VIRTUAL','ZendeskField','includeAll','include','findAll','rows','catch','params','options','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','end','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x5e9876,_0x16052d){var _0x576c48=function(_0x338c97){while(--_0x338c97){_0x5e9876['push'](_0x5e9876['shift']());}};_0x576c48(++_0x16052d);}(_0xc7e9,0x1ef));var _0x9c7e=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0xc7e9[_0x35885a];return _0xe86249;};'use strict';var emlformat=require(_0x9c7e('0x0'));var rimraf=require(_0x9c7e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9c7e('0x2'));var rp=require(_0x9c7e('0x3'));var moment=require(_0x9c7e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9c7e('0x5'));var util=require(_0x9c7e('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x9c7e('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9c7e('0x8'));var _=require(_0x9c7e('0x9'));var squel=require(_0x9c7e('0xa'));var crypto=require(_0x9c7e('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x9c7e('0xc'));var toCsv=require(_0x9c7e('0x7'));var querystring=require(_0x9c7e('0xd'));var Papa=require(_0x9c7e('0xe'));var Redis=require('ioredis');var authService=require(_0x9c7e('0xf'));var qs=require(_0x9c7e('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9c7e('0x11'));var logger=require('../../config/logger')(_0x9c7e('0x12'));var utils=require(_0x9c7e('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x9c7e('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x19843b,_0x1f8d8b){_0x1f8d8b=_0x1f8d8b||0xcc;return function(_0x2828ab){if(_0x2828ab){return _0x19843b[_0x9c7e('0x15')](_0x1f8d8b);}return _0x19843b[_0x9c7e('0x16')](_0x1f8d8b)['end']();};}function respondWithResult(_0xd474b7,_0x77e81c){_0x77e81c=_0x77e81c||0xc8;return function(_0x322d98){if(_0x322d98){return _0xd474b7[_0x9c7e('0x16')](_0x77e81c)[_0x9c7e('0x17')](_0x322d98);}};}function respondWithFilteredResult(_0x1dc25b,_0x4b26a8){return function(_0x438a38){if(_0x438a38){var _0x161f74=typeof _0x4b26a8[_0x9c7e('0x18')]===_0x9c7e('0x19')&&typeof _0x4b26a8[_0x9c7e('0x1a')]==='undefined';var _0x192f86=_0x438a38[_0x9c7e('0x1b')];var _0x5af216=_0x161f74?0x0:_0x4b26a8[_0x9c7e('0x18')];var _0x26dd66=_0x161f74?_0x438a38[_0x9c7e('0x1b')]:_0x4b26a8[_0x9c7e('0x18')]+_0x4b26a8[_0x9c7e('0x1a')];var _0x592b16;if(_0x26dd66>=_0x192f86){_0x26dd66=_0x192f86;_0x592b16=0xc8;}else{_0x592b16=0xce;}_0x1dc25b[_0x9c7e('0x16')](_0x592b16);return _0x1dc25b['set'](_0x9c7e('0x1c'),_0x5af216+'-'+_0x26dd66+'/'+_0x192f86)['json'](_0x438a38);}return null;};}function patchUpdates(_0x52abd4){return function(_0x2ee013){try{jsonpatch[_0x9c7e('0x1d')](_0x2ee013,_0x52abd4,!![]);}catch(_0x2f67d1){return BPromise[_0x9c7e('0x1e')](_0x2f67d1);}return _0x2ee013[_0x9c7e('0x1f')]();};}function saveUpdates(_0x5350a5,_0x49689d){return function(_0x14696f){if(_0x14696f){return _0x14696f[_0x9c7e('0x20')](_0x5350a5)[_0x9c7e('0x21')](function(_0x44b96a){return _0x44b96a;});}return null;};}function removeEntity(_0x28f031,_0x376e0c){return function(_0x1ce4d2){if(_0x1ce4d2){return _0x1ce4d2[_0x9c7e('0x22')]()[_0x9c7e('0x21')](function(){_0x28f031[_0x9c7e('0x16')](0xcc)[_0x9c7e('0x23')]();});}};}function handleEntityNotFound(_0x4a8a46,_0x9780f8){return function(_0x2eaebb){if(!_0x2eaebb){_0x4a8a46[_0x9c7e('0x15')](0x194);}return _0x2eaebb;};}function handleError(_0x467918,_0x17779b){_0x17779b=_0x17779b||0x1f4;return function(_0x224056){logger['error'](_0x224056['stack']);if(_0x224056[_0x9c7e('0x24')]){delete _0x224056[_0x9c7e('0x24')];}_0x467918[_0x9c7e('0x16')](_0x17779b)[_0x9c7e('0x25')](_0x224056);};}exports[_0x9c7e('0x26')]=function(_0x33d696,_0x324691){var _0xc02abf={},_0x531544={},_0x339e21={'count':0x0,'rows':[]};var _0x48dc1f=_[_0x9c7e('0x27')](db['ZendeskField']['rawAttributes'],function(_0x1114d2){return{'name':_0x1114d2[_0x9c7e('0x28')],'type':_0x1114d2[_0x9c7e('0x29')][_0x9c7e('0x2a')]};});_0x531544[_0x9c7e('0x2b')]=_[_0x9c7e('0x27')](_0x48dc1f,_0x9c7e('0x24'));_0x531544[_0x9c7e('0x2c')]=_[_0x9c7e('0x2d')](_0x33d696[_0x9c7e('0x2c')]);_0x531544[_0x9c7e('0x2e')]=_[_0x9c7e('0x2f')](_0x531544[_0x9c7e('0x2b')],_0x531544['query']);_0xc02abf[_0x9c7e('0x30')]=_[_0x9c7e('0x2f')](_0x531544['model'],qs[_0x9c7e('0x31')](_0x33d696[_0x9c7e('0x2c')]['fields']));_0xc02abf[_0x9c7e('0x30')]=_0xc02abf[_0x9c7e('0x30')][_0x9c7e('0x32')]?_0xc02abf['attributes']:_0x531544[_0x9c7e('0x2b')];if(!_0x33d696[_0x9c7e('0x2c')][_0x9c7e('0x33')](_0x9c7e('0x34'))){_0xc02abf[_0x9c7e('0x1a')]=qs[_0x9c7e('0x1a')](_0x33d696[_0x9c7e('0x2c')]['limit']);_0xc02abf[_0x9c7e('0x18')]=qs[_0x9c7e('0x18')](_0x33d696['query'][_0x9c7e('0x18')]);}_0xc02abf['order']=qs[_0x9c7e('0x35')](_0x33d696[_0x9c7e('0x2c')][_0x9c7e('0x35')]);_0xc02abf[_0x9c7e('0x36')]=qs[_0x9c7e('0x2e')](_['pick'](_0x33d696['query'],_0x531544[_0x9c7e('0x2e')]),_0x48dc1f);if(_0x33d696[_0x9c7e('0x2c')][_0x9c7e('0x37')]){_0xc02abf[_0x9c7e('0x36')]=_[_0x9c7e('0x38')](_0xc02abf['where'],{'$or':_['map'](_0x48dc1f,function(_0x3e1034){if(_0x3e1034[_0x9c7e('0x29')]!==_0x9c7e('0x39')){var _0x27b3dd={};_0x27b3dd[_0x3e1034[_0x9c7e('0x24')]]={'$like':'%'+_0x33d696[_0x9c7e('0x2c')][_0x9c7e('0x37')]+'%'};return _0x27b3dd;}})});}_0xc02abf=_['merge']({},_0xc02abf,_0x33d696['options']);var _0x3a1609={'where':_0xc02abf['where']};return db[_0x9c7e('0x3a')][_0x9c7e('0x1b')](_0x3a1609)[_0x9c7e('0x21')](function(_0x3d90d5){_0x339e21['count']=_0x3d90d5;if(_0x33d696[_0x9c7e('0x2c')][_0x9c7e('0x3b')]){_0xc02abf[_0x9c7e('0x3c')]=[{'all':!![]}];}return db[_0x9c7e('0x3a')][_0x9c7e('0x3d')](_0xc02abf);})[_0x9c7e('0x21')](function(_0x26d7f1){_0x339e21[_0x9c7e('0x3e')]=_0x26d7f1;return _0x339e21;})['then'](respondWithFilteredResult(_0x324691,_0xc02abf))[_0x9c7e('0x3f')](handleError(_0x324691,null));};exports['show']=function(_0x298744,_0x1e8b88){var _0x216a31={'raw':!![],'where':{'id':_0x298744[_0x9c7e('0x40')]['id']}},_0x170fa6={};_0x170fa6[_0x9c7e('0x2b')]=_[_0x9c7e('0x2d')](db[_0x9c7e('0x3a')]['rawAttributes']);_0x170fa6[_0x9c7e('0x2c')]=_['keys'](_0x298744['query']);_0x170fa6['filters']=_[_0x9c7e('0x2f')](_0x170fa6['model'],_0x170fa6[_0x9c7e('0x2c')]);_0x216a31[_0x9c7e('0x30')]=_['intersection'](_0x170fa6[_0x9c7e('0x2b')],qs[_0x9c7e('0x31')](_0x298744['query']['fields']));_0x216a31[_0x9c7e('0x30')]=_0x216a31[_0x9c7e('0x30')][_0x9c7e('0x32')]?_0x216a31[_0x9c7e('0x30')]:_0x170fa6[_0x9c7e('0x2b')];if(_0x298744[_0x9c7e('0x2c')][_0x9c7e('0x3b')]){_0x216a31[_0x9c7e('0x3c')]=[{'all':!![]}];}_0x216a31=_[_0x9c7e('0x38')]({},_0x216a31,_0x298744[_0x9c7e('0x41')]);return db['ZendeskField'][_0x9c7e('0x42')](_0x216a31)[_0x9c7e('0x21')](handleEntityNotFound(_0x1e8b88,null))[_0x9c7e('0x21')](respondWithResult(_0x1e8b88,null))[_0x9c7e('0x3f')](handleError(_0x1e8b88,null));};exports[_0x9c7e('0x43')]=function(_0x453f73,_0x2aefe4){return db['ZendeskField'][_0x9c7e('0x43')](_0x453f73[_0x9c7e('0x44')],{})[_0x9c7e('0x21')](respondWithResult(_0x2aefe4,0xc9))['catch'](handleError(_0x2aefe4,null));};exports[_0x9c7e('0x20')]=function(_0x3d9ad2,_0x29e253){if(_0x3d9ad2[_0x9c7e('0x44')]['id']){delete _0x3d9ad2['body']['id'];}return db[_0x9c7e('0x3a')][_0x9c7e('0x42')]({'where':{'id':_0x3d9ad2[_0x9c7e('0x40')]['id']}})[_0x9c7e('0x21')](handleEntityNotFound(_0x29e253,null))[_0x9c7e('0x21')](saveUpdates(_0x3d9ad2['body'],null))['then'](respondWithResult(_0x29e253,null))['catch'](handleError(_0x29e253,null));};exports[_0x9c7e('0x22')]=function(_0x11f836,_0x44ad2f){return db[_0x9c7e('0x3a')][_0x9c7e('0x42')]({'where':{'id':_0x11f836[_0x9c7e('0x40')]['id']}})[_0x9c7e('0x21')](handleEntityNotFound(_0x44ad2f,null))[_0x9c7e('0x21')](removeEntity(_0x44ad2f,null))[_0x9c7e('0x3f')](handleError(_0x44ad2f,null));}; \ No newline at end of file +var _0x87d0=['destroy','error','stack','name','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','where','merge','VIRTUAL','filter','options','includeAll','include','ZendeskField','findAll','rows','catch','show','length','find','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then'];(function(_0x3f78a5,_0x4da21f){var _0x23bdb7=function(_0x5f011a){while(--_0x5f011a){_0x3f78a5['push'](_0x3f78a5['shift']());}};_0x23bdb7(++_0x4da21f);}(_0x87d0,0x193));var _0x087d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x87d0[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x087d('0x0'));var rimraf=require(_0x087d('0x1'));var zipdir=require(_0x087d('0x2'));var jsonpatch=require(_0x087d('0x3'));var rp=require(_0x087d('0x4'));var moment=require(_0x087d('0x5'));var BPromise=require(_0x087d('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x087d('0x7'));var sox=require(_0x087d('0x8'));var csv=require('to-csv');var ejs=require(_0x087d('0x9'));var fs=require('fs');var fs_extra=require(_0x087d('0xa'));var _=require(_0x087d('0xb'));var squel=require('squel');var crypto=require(_0x087d('0xc'));var jsforce=require(_0x087d('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x087d('0xe'));var querystring=require(_0x087d('0xf'));var Papa=require(_0x087d('0x10'));var Redis=require(_0x087d('0x11'));var authService=require(_0x087d('0x12'));var qs=require(_0x087d('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x087d('0x14'));var logger=require(_0x087d('0x15'))(_0x087d('0x16'));var utils=require(_0x087d('0x17'));var config=require(_0x087d('0x18'));var licenseUtil=require(_0x087d('0x19'));var db=require(_0x087d('0x1a'))['db'];function respondWithStatusCode(_0x51798b,_0x4b4ef4){_0x4b4ef4=_0x4b4ef4||0xcc;return function(_0x5c58e2){if(_0x5c58e2){return _0x51798b['sendStatus'](_0x4b4ef4);}return _0x51798b[_0x087d('0x1b')](_0x4b4ef4)[_0x087d('0x1c')]();};}function respondWithResult(_0x1517d7,_0x3a1b5e){_0x3a1b5e=_0x3a1b5e||0xc8;return function(_0x4d3973){if(_0x4d3973){return _0x1517d7[_0x087d('0x1b')](_0x3a1b5e)['json'](_0x4d3973);}};}function respondWithFilteredResult(_0x3ec144,_0x28e3f4){return function(_0x721c80){if(_0x721c80){var _0x56ab33=typeof _0x28e3f4[_0x087d('0x1d')]===_0x087d('0x1e')&&typeof _0x28e3f4[_0x087d('0x1f')]===_0x087d('0x1e');var _0x5c5343=_0x721c80[_0x087d('0x20')];var _0x50c45d=_0x56ab33?0x0:_0x28e3f4[_0x087d('0x1d')];var _0x3dc843=_0x56ab33?_0x721c80[_0x087d('0x20')]:_0x28e3f4[_0x087d('0x1d')]+_0x28e3f4['limit'];var _0x364634;if(_0x3dc843>=_0x5c5343){_0x3dc843=_0x5c5343;_0x364634=0xc8;}else{_0x364634=0xce;}_0x3ec144[_0x087d('0x1b')](_0x364634);return _0x3ec144[_0x087d('0x21')](_0x087d('0x22'),_0x50c45d+'-'+_0x3dc843+'/'+_0x5c5343)[_0x087d('0x23')](_0x721c80);}return null;};}function patchUpdates(_0x4e93d6){return function(_0x3562eb){try{jsonpatch[_0x087d('0x24')](_0x3562eb,_0x4e93d6,!![]);}catch(_0x2924ae){return BPromise[_0x087d('0x25')](_0x2924ae);}return _0x3562eb[_0x087d('0x26')]();};}function saveUpdates(_0x1f02c9,_0x43a82e){return function(_0x322f40){if(_0x322f40){return _0x322f40[_0x087d('0x27')](_0x1f02c9)[_0x087d('0x28')](function(_0x2edde1){return _0x2edde1;});}return null;};}function removeEntity(_0xa0a24d,_0x174f95){return function(_0x308c42){if(_0x308c42){return _0x308c42[_0x087d('0x29')]()['then'](function(){_0xa0a24d[_0x087d('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5f3619,_0x16b78d){return function(_0xc1ba18){if(!_0xc1ba18){_0x5f3619['sendStatus'](0x194);}return _0xc1ba18;};}function handleError(_0xfbcd2b,_0x414376){_0x414376=_0x414376||0x1f4;return function(_0x1f81c9){logger[_0x087d('0x2a')](_0x1f81c9[_0x087d('0x2b')]);if(_0x1f81c9['name']){delete _0x1f81c9[_0x087d('0x2c')];}_0xfbcd2b['status'](_0x414376)['send'](_0x1f81c9);};}exports['index']=function(_0x3246bc,_0x262019){var _0xeecd15={},_0x207c51={},_0x574d42={'count':0x0,'rows':[]};var _0x34dcd9=_['map'](db['ZendeskField'][_0x087d('0x2d')],function(_0x141742){return{'name':_0x141742[_0x087d('0x2e')],'type':_0x141742[_0x087d('0x2f')]['key']};});_0x207c51[_0x087d('0x30')]=_[_0x087d('0x31')](_0x34dcd9,'name');_0x207c51[_0x087d('0x32')]=_[_0x087d('0x33')](_0x3246bc[_0x087d('0x32')]);_0x207c51[_0x087d('0x34')]=_[_0x087d('0x35')](_0x207c51[_0x087d('0x30')],_0x207c51[_0x087d('0x32')]);_0xeecd15[_0x087d('0x36')]=_[_0x087d('0x35')](_0x207c51['model'],qs[_0x087d('0x37')](_0x3246bc[_0x087d('0x32')][_0x087d('0x37')]));_0xeecd15[_0x087d('0x36')]=_0xeecd15[_0x087d('0x36')]['length']?_0xeecd15['attributes']:_0x207c51['model'];if(!_0x3246bc[_0x087d('0x32')][_0x087d('0x38')]('nolimit')){_0xeecd15[_0x087d('0x1f')]=qs[_0x087d('0x1f')](_0x3246bc[_0x087d('0x32')][_0x087d('0x1f')]);_0xeecd15[_0x087d('0x1d')]=qs[_0x087d('0x1d')](_0x3246bc[_0x087d('0x32')][_0x087d('0x1d')]);}_0xeecd15[_0x087d('0x39')]=qs['sort'](_0x3246bc['query']['sort']);_0xeecd15[_0x087d('0x3a')]=qs[_0x087d('0x34')](_['pick'](_0x3246bc['query'],_0x207c51[_0x087d('0x34')]),_0x34dcd9);if(_0x3246bc[_0x087d('0x32')]['filter']){_0xeecd15['where']=_[_0x087d('0x3b')](_0xeecd15[_0x087d('0x3a')],{'$or':_['map'](_0x34dcd9,function(_0x1c0998){if(_0x1c0998[_0x087d('0x2f')]!==_0x087d('0x3c')){var _0x1aed93={};_0x1aed93[_0x1c0998['name']]={'$like':'%'+_0x3246bc['query'][_0x087d('0x3d')]+'%'};return _0x1aed93;}})});}_0xeecd15=_['merge']({},_0xeecd15,_0x3246bc[_0x087d('0x3e')]);var _0x3efa43={'where':_0xeecd15['where']};return db['ZendeskField'][_0x087d('0x20')](_0x3efa43)[_0x087d('0x28')](function(_0x7f17c6){_0x574d42[_0x087d('0x20')]=_0x7f17c6;if(_0x3246bc[_0x087d('0x32')][_0x087d('0x3f')]){_0xeecd15[_0x087d('0x40')]=[{'all':!![]}];}return db[_0x087d('0x41')][_0x087d('0x42')](_0xeecd15);})[_0x087d('0x28')](function(_0x156d22){_0x574d42[_0x087d('0x43')]=_0x156d22;return _0x574d42;})[_0x087d('0x28')](respondWithFilteredResult(_0x262019,_0xeecd15))[_0x087d('0x44')](handleError(_0x262019,null));};exports[_0x087d('0x45')]=function(_0xc1f010,_0x1e07b2){var _0x2dc18b={'raw':!![],'where':{'id':_0xc1f010['params']['id']}},_0x11f340={};_0x11f340[_0x087d('0x30')]=_[_0x087d('0x33')](db['ZendeskField'][_0x087d('0x2d')]);_0x11f340[_0x087d('0x32')]=_[_0x087d('0x33')](_0xc1f010['query']);_0x11f340[_0x087d('0x34')]=_[_0x087d('0x35')](_0x11f340['model'],_0x11f340[_0x087d('0x32')]);_0x2dc18b['attributes']=_[_0x087d('0x35')](_0x11f340[_0x087d('0x30')],qs['fields'](_0xc1f010[_0x087d('0x32')]['fields']));_0x2dc18b['attributes']=_0x2dc18b[_0x087d('0x36')][_0x087d('0x46')]?_0x2dc18b[_0x087d('0x36')]:_0x11f340[_0x087d('0x30')];if(_0xc1f010['query'][_0x087d('0x3f')]){_0x2dc18b['include']=[{'all':!![]}];}_0x2dc18b=_[_0x087d('0x3b')]({},_0x2dc18b,_0xc1f010[_0x087d('0x3e')]);return db['ZendeskField'][_0x087d('0x47')](_0x2dc18b)[_0x087d('0x28')](handleEntityNotFound(_0x1e07b2,null))['then'](respondWithResult(_0x1e07b2,null))[_0x087d('0x44')](handleError(_0x1e07b2,null));};exports['create']=function(_0x217a4e,_0x260079){return db[_0x087d('0x41')]['create'](_0x217a4e['body'],{})['then'](respondWithResult(_0x260079,0xc9))['catch'](handleError(_0x260079,null));};exports['update']=function(_0x2c9adf,_0x4d7c8a){if(_0x2c9adf['body']['id']){delete _0x2c9adf[_0x087d('0x48')]['id'];}return db['ZendeskField'][_0x087d('0x47')]({'where':{'id':_0x2c9adf[_0x087d('0x49')]['id']}})['then'](handleEntityNotFound(_0x4d7c8a,null))['then'](saveUpdates(_0x2c9adf[_0x087d('0x48')],null))[_0x087d('0x28')](respondWithResult(_0x4d7c8a,null))[_0x087d('0x44')](handleError(_0x4d7c8a,null));};exports[_0x087d('0x29')]=function(_0x4b89c3,_0xaf019c){return db[_0x087d('0x41')][_0x087d('0x47')]({'where':{'id':_0x4b89c3['params']['id']}})[_0x087d('0x28')](handleEntityNotFound(_0xaf019c,null))[_0x087d('0x28')](removeEntity(_0xaf019c,null))[_0x087d('0x44')](handleError(_0xaf019c,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 478967f..e6fc8bf 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 _0x5e7c=['./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','FieldId','lodash','util','api','moment','request-promise','path','rimraf'];(function(_0xd0a0ae,_0x239a61){var _0x4da1a4=function(_0x10554c){while(--_0x10554c){_0xd0a0ae['push'](_0xd0a0ae['shift']());}};_0x4da1a4(++_0x239a61);}(_0x5e7c,0x17f));var _0xc5e7=function(_0x469bf7,_0x5ab886){_0x469bf7=_0x469bf7-0x0;var _0x33bd7b=_0x5e7c[_0x469bf7];return _0x33bd7b;};'use strict';var _=require(_0xc5e7('0x0'));var util=require(_0xc5e7('0x1'));var logger=require('../../config/logger')(_0xc5e7('0x2'));var moment=require(_0xc5e7('0x3'));var BPromise=require('bluebird');var rp=require(_0xc5e7('0x4'));var fs=require('fs');var path=require(_0xc5e7('0x5'));var rimraf=require(_0xc5e7('0x6'));var config=require('../../config/environment');var attributes=require(_0xc5e7('0x7'));module[_0xc5e7('0x8')]=function(_0x29ac5c,_0x3d6695){return _0x29ac5c[_0xc5e7('0x9')](_0xc5e7('0xa'),attributes,{'tableName':_0xc5e7('0xb'),'paranoid':![],'indexes':[{'name':_0xc5e7('0xc'),'fields':[_0xc5e7('0xd'),_0xc5e7('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x079d=['bluebird','request-promise','../../config/environment','exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','lodash','../../config/logger','api'];(function(_0x1131e1,_0x584dda){var _0x24688e=function(_0x2334d6){while(--_0x2334d6){_0x1131e1['push'](_0x1131e1['shift']());}};_0x24688e(++_0x584dda);}(_0x079d,0x1d1));var _0xd079=function(_0x1ee4e4,_0x559683){_0x1ee4e4=_0x1ee4e4-0x0;var _0x4c8bf0=_0x079d[_0x1ee4e4];return _0x4c8bf0;};'use strict';var _=require(_0xd079('0x0'));var util=require('util');var logger=require(_0xd079('0x1'))(_0xd079('0x2'));var moment=require('moment');var BPromise=require(_0xd079('0x3'));var rp=require(_0xd079('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd079('0x5'));var attributes=require('./intZendeskField.attributes');module[_0xd079('0x6')]=function(_0x104e36,_0x31b8ff){return _0x104e36[_0xd079('0x7')](_0xd079('0x8'),attributes,{'tableName':_0xd079('0x9'),'paranoid':![],'indexes':[{'name':_0xd079('0xa'),'fields':[_0xd079('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js index ee6e15c..87637ca 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 _0xe9e4=['error','message','info','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','code'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xe9e4,0x1e4));var _0x4e9e=function(_0x3cb458,_0x7c10b3){_0x3cb458=_0x3cb458-0x0;var _0x195d2a=_0xe9e4[_0x3cb458];return _0x195d2a;};'use strict';var _=require(_0x4e9e('0x0'));var util=require(_0x4e9e('0x1'));var moment=require(_0x4e9e('0x2'));var BPromise=require(_0x4e9e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4e9e('0x4'));var db=require(_0x4e9e('0x5'))['db'];var utils=require(_0x4e9e('0x6'));var logger=require(_0x4e9e('0x7'))(_0x4e9e('0x8'));var config=require('../../config/environment');var jayson=require(_0x4e9e('0x9'));var client=jayson[_0x4e9e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x466f32,_0x5123be,_0x1390ea){return new BPromise(function(_0x319a04,_0x15451b){return client['request'](_0x466f32,_0x1390ea)[_0x4e9e('0xb')](function(_0x5c8ab0){logger['info'](_0x4e9e('0xc'),_0x5123be,_0x4e9e('0xd'));logger[_0x4e9e('0xe')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x5123be,_0x4e9e('0xd'),JSON['stringify'](_0x5c8ab0));if(_0x5c8ab0['error']){if(_0x5c8ab0['error'][_0x4e9e('0xf')]===0x1f4){logger[_0x4e9e('0x10')](_0x4e9e('0xc'),_0x5123be,_0x5c8ab0['error']['message']);return _0x15451b(_0x5c8ab0['error'][_0x4e9e('0x11')]);}logger[_0x4e9e('0x10')](_0x4e9e('0xc'),_0x5123be,_0x5c8ab0[_0x4e9e('0x10')][_0x4e9e('0x11')]);return _0x319a04(_0x5c8ab0[_0x4e9e('0x10')]['message']);}else{logger[_0x4e9e('0x12')](_0x4e9e('0xc'),_0x5123be,_0x4e9e('0xd'));_0x319a04(_0x5c8ab0[_0x4e9e('0x13')][_0x4e9e('0x11')]);}})['catch'](function(_0x564c9d){logger[_0x4e9e('0x10')](_0x4e9e('0xc'),_0x5123be,_0x564c9d);_0x15451b(_0x564c9d);});});} \ No newline at end of file +var _0x818e=['catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result'];(function(_0x18991b,_0x373014){var _0x3f80ea=function(_0x322b02){while(--_0x322b02){_0x18991b['push'](_0x18991b['shift']());}};_0x3f80ea(++_0x373014);}(_0x818e,0x1e4));var _0xe818=function(_0xc35f41,_0x205f2d){_0xc35f41=_0xc35f41-0x0;var _0x33a703=_0x818e[_0xc35f41];return _0x33a703;};'use strict';var _=require(_0xe818('0x0'));var util=require(_0xe818('0x1'));var moment=require('moment');var BPromise=require(_0xe818('0x2'));var rs=require(_0xe818('0x3'));var fs=require('fs');var Redis=require(_0xe818('0x4'));var db=require(_0xe818('0x5'))['db'];var utils=require(_0xe818('0x6'));var logger=require(_0xe818('0x7'))(_0xe818('0x8'));var config=require(_0xe818('0x9'));var jayson=require(_0xe818('0xa'));var client=jayson[_0xe818('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x58f6b2,_0x4e9ec3,_0x26c6b2){return new BPromise(function(_0xb14d79,_0x3fa177){return client[_0xe818('0xc')](_0x58f6b2,_0x26c6b2)[_0xe818('0xd')](function(_0x5046a8){logger[_0xe818('0xe')](_0xe818('0xf'),_0x4e9ec3,_0xe818('0x10'));logger[_0xe818('0x11')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x4e9ec3,_0xe818('0x10'),JSON[_0xe818('0x12')](_0x5046a8));if(_0x5046a8[_0xe818('0x13')]){if(_0x5046a8[_0xe818('0x13')]['code']===0x1f4){logger[_0xe818('0x13')]('ZendeskField,\x20%s,\x20%s',_0x4e9ec3,_0x5046a8['error'][_0xe818('0x14')]);return _0x3fa177(_0x5046a8[_0xe818('0x13')]['message']);}logger['error']('ZendeskField,\x20%s,\x20%s',_0x4e9ec3,_0x5046a8[_0xe818('0x13')][_0xe818('0x14')]);return _0xb14d79(_0x5046a8[_0xe818('0x13')][_0xe818('0x14')]);}else{logger[_0xe818('0xe')](_0xe818('0xf'),_0x4e9ec3,_0xe818('0x10'));_0xb14d79(_0x5046a8[_0xe818('0x15')][_0xe818('0x14')]);}})[_0xe818('0x16')](function(_0x5c5b5e){logger['error']('ZendeskField,\x20%s,\x20%s',_0x4e9ec3,_0x5c5b5e);_0x3fa177(_0x5c5b5e);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index f4779a1..38bcf79 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 _0x3be5=['path','connect-timeout','express','fs-extra','./intZohoAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','/:id/fields','getFields','create','put','update','delete','destroy','exports','multer'];(function(_0x2d6536,_0x228f3e){var _0x3be835=function(_0x5c26d9){while(--_0x5c26d9){_0x2d6536['push'](_0x2d6536['shift']());}};_0x3be835(++_0x228f3e);}(_0x3be5,0x155));var _0x53be=function(_0x1f9e23,_0x115918){_0x1f9e23=_0x1f9e23-0x0;var _0x24793d=_0x3be5[_0x1f9e23];return _0x24793d;};'use strict';var multer=require(_0x53be('0x0'));var util=require('util');var path=require(_0x53be('0x1'));var timeout=require(_0x53be('0x2'));var express=require(_0x53be('0x3'));var router=express['Router']();var fs_extra=require(_0x53be('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x53be('0x5'));router[_0x53be('0x6')]('/',auth[_0x53be('0x7')](),controller[_0x53be('0x8')]);router[_0x53be('0x6')](_0x53be('0x9'),auth[_0x53be('0x7')](),controller['show']);router['get'](_0x53be('0xa'),auth[_0x53be('0x7')](),controller['getConfigurations']);router[_0x53be('0x6')](_0x53be('0xb'),auth[_0x53be('0x7')](),controller[_0x53be('0xc')]);router['post']('/',auth[_0x53be('0x7')](),controller[_0x53be('0xd')]);router['post']('/:id/configurations',auth[_0x53be('0x7')](),controller['addConfiguration']);router[_0x53be('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x53be('0xf')]);router[_0x53be('0x10')](_0x53be('0x9'),auth['isAuthenticated'](),controller[_0x53be('0x11')]);module[_0x53be('0x12')]=router; \ No newline at end of file +var _0x7ad8=['update','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x7ad8,0x76));var _0x87ad=function(_0x569caa,_0x5174ce){_0x569caa=_0x569caa-0x0;var _0x44cb5a=_0x7ad8[_0x569caa];return _0x44cb5a;};'use strict';var multer=require(_0x87ad('0x0'));var util=require('util');var path=require(_0x87ad('0x1'));var timeout=require(_0x87ad('0x2'));var express=require(_0x87ad('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x87ad('0x4'));var interaction=require(_0x87ad('0x5'));var config=require(_0x87ad('0x6'));var controller=require(_0x87ad('0x7'));router['get']('/',auth[_0x87ad('0x8')](),controller[_0x87ad('0x9')]);router[_0x87ad('0xa')](_0x87ad('0xb'),auth['isAuthenticated'](),controller[_0x87ad('0xc')]);router['get'](_0x87ad('0xd'),auth['isAuthenticated'](),controller[_0x87ad('0xe')]);router[_0x87ad('0xa')](_0x87ad('0xf'),auth['isAuthenticated'](),controller[_0x87ad('0x10')]);router[_0x87ad('0x11')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x87ad('0xd'),auth[_0x87ad('0x8')](),controller[_0x87ad('0x12')]);router[_0x87ad('0x13')](_0x87ad('0xb'),auth[_0x87ad('0x8')](),controller[_0x87ad('0x14')]);router[_0x87ad('0x15')]('/:id',auth[_0x87ad('0x8')](),controller['destroy']);module[_0x87ad('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index c209fa9..f955107 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 _0x34e8=['sequelize','exports','STRING'];(function(_0x1526a9,_0x48fb64){var _0x9f4049=function(_0x13271a){while(--_0x13271a){_0x1526a9['push'](_0x1526a9['shift']());}};_0x9f4049(++_0x48fb64);}(_0x34e8,0x12c));var _0x834e=function(_0x43a478,_0xfdc465){_0x43a478=_0x43a478-0x0;var _0x28031b=_0x34e8[_0x43a478];return _0x28031b;};'use strict';var Sequelize=require(_0x834e('0x0'));module[_0x834e('0x1')]={'name':{'type':Sequelize[_0x834e('0x2')]},'description':{'type':Sequelize[_0x834e('0x2')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0x834e('0x2')]},'clientId':{'type':Sequelize[_0x834e('0x2')]},'clientSecret':{'type':Sequelize[_0x834e('0x2')]},'serverUrl':{'type':Sequelize[_0x834e('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0x834e('0x2')]},'refreshToken':{'type':Sequelize[_0x834e('0x2')]}}; \ No newline at end of file +var _0x22fb=['STRING'];(function(_0x2da9ed,_0x4c5c6c){var _0x32244f=function(_0x2d7d1f){while(--_0x2d7d1f){_0x2da9ed['push'](_0x2da9ed['shift']());}};_0x32244f(++_0x4c5c6c);}(_0x22fb,0x192));var _0xb22f=function(_0x418b6c,_0x290f82){_0x418b6c=_0x418b6c-0x0;var _0x1af0d5=_0x22fb[_0x418b6c];return _0x1af0d5;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xb22f('0x0')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xb22f('0x0')]},'zone':{'type':Sequelize[_0xb22f('0x0')]},'clientId':{'type':Sequelize[_0xb22f('0x0')]},'clientSecret':{'type':Sequelize[_0xb22f('0x0')]},'serverUrl':{'type':Sequelize[_0xb22f('0x0')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0xb22f('0x0')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index a40fe68..0d7cb26 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 _0x7922=['host','serverUrl','code','refreshToken','zoho.eu','com','slice','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','message','Owner','Subject','Description','Call_Duration','Call_Start_Time','Call_Type','remove','api_name','system_mandatory','display_label','custom_field','data_type','pick_list_values','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','ZohoAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','catch','params','keys','length','find','body','getConfigurations','findOne','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','ZohoConfiguration','create','Subjects','ZohoField','zone','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','/oauth/v2/token','clientId','clientSecret','refresh_token','access_token','getFields'];(function(_0x16dca1,_0x20cc81){var _0x5cdc7d=function(_0x25a861){while(--_0x25a861){_0x16dca1['push'](_0x16dca1['shift']());}};_0x5cdc7d(++_0x20cc81);}(_0x7922,0xa0));var _0x2792=function(_0x4b7a96,_0x551fd1){_0x4b7a96=_0x4b7a96-0x0;var _0x55bb69=_0x7922[_0x4b7a96];return _0x55bb69;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2792('0x0'));var jsonpatch=require(_0x2792('0x1'));var rp=require(_0x2792('0x2'));var moment=require(_0x2792('0x3'));var BPromise=require(_0x2792('0x4'));var Mustache=require(_0x2792('0x5'));var util=require(_0x2792('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x2792('0x7'));var ejs=require(_0x2792('0x8'));var fs=require('fs');var fs_extra=require(_0x2792('0x9'));var _=require(_0x2792('0xa'));var squel=require(_0x2792('0xb'));var crypto=require(_0x2792('0xc'));var jsforce=require(_0x2792('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2792('0x7'));var querystring=require(_0x2792('0xe'));var Papa=require(_0x2792('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2792('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2792('0x11'))(_0x2792('0x12'));var utils=require('../../config/utils');var config=require(_0x2792('0x13'));var licenseUtil=require(_0x2792('0x14'));var db=require(_0x2792('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x90e4c8,_0x3715ca){_0x3715ca=_0x3715ca||0xcc;return function(_0x54d78f){if(_0x54d78f){return _0x90e4c8[_0x2792('0x16')](_0x3715ca);}return _0x90e4c8[_0x2792('0x17')](_0x3715ca)['end']();};}function respondWithResult(_0x2fd431,_0x55379d){_0x55379d=_0x55379d||0xc8;return function(_0x1cbd41){if(_0x1cbd41){return _0x2fd431[_0x2792('0x17')](_0x55379d)[_0x2792('0x18')](_0x1cbd41);}};}function respondWithFilteredResult(_0x32ab29,_0x41a519){return function(_0x581599){if(_0x581599){var _0x43c458=typeof _0x41a519[_0x2792('0x19')]===_0x2792('0x1a')&&typeof _0x41a519[_0x2792('0x1b')]===_0x2792('0x1a');var _0x3c2f93=_0x581599[_0x2792('0x1c')];var _0x228157=_0x43c458?0x0:_0x41a519[_0x2792('0x19')];var _0x525fcc=_0x43c458?_0x581599[_0x2792('0x1c')]:_0x41a519['offset']+_0x41a519[_0x2792('0x1b')];var _0x42d193;if(_0x525fcc>=_0x3c2f93){_0x525fcc=_0x3c2f93;_0x42d193=0xc8;}else{_0x42d193=0xce;}_0x32ab29[_0x2792('0x17')](_0x42d193);return _0x32ab29[_0x2792('0x1d')](_0x2792('0x1e'),_0x228157+'-'+_0x525fcc+'/'+_0x3c2f93)[_0x2792('0x18')](_0x581599);}return null;};}function patchUpdates(_0x46b060){return function(_0x2d4f43){try{jsonpatch[_0x2792('0x1f')](_0x2d4f43,_0x46b060,!![]);}catch(_0x4d1320){return BPromise[_0x2792('0x20')](_0x4d1320);}return _0x2d4f43[_0x2792('0x21')]();};}function saveUpdates(_0x352d3c,_0x5c1996){return function(_0x4e1755){if(_0x4e1755){return _0x4e1755[_0x2792('0x22')](_0x352d3c)[_0x2792('0x23')](function(_0x394d1c){return _0x394d1c;});}return null;};}function removeEntity(_0x3d15c9,_0x4daf0e){return function(_0xbf257b){if(_0xbf257b){return _0xbf257b[_0x2792('0x24')]()[_0x2792('0x23')](function(){_0x3d15c9['status'](0xcc)[_0x2792('0x25')]();});}};}function handleEntityNotFound(_0x3a96bd,_0x29ac5e){return function(_0x3c3292){if(!_0x3c3292){_0x3a96bd[_0x2792('0x16')](0x194);}return _0x3c3292;};}function handleError(_0x486322,_0x42713e){_0x42713e=_0x42713e||0x1f4;return function(_0x1d4119){logger[_0x2792('0x26')](_0x1d4119['stack']);if(_0x1d4119[_0x2792('0x27')]){delete _0x1d4119[_0x2792('0x27')];}_0x486322[_0x2792('0x17')](_0x42713e)[_0x2792('0x28')](_0x1d4119);};}exports[_0x2792('0x29')]=function(_0x1a32f9,_0x1a83ee){var _0x10e0ea={},_0x1369c3={},_0x2a603a={'count':0x0,'rows':[]};var _0x1095a6=_[_0x2792('0x2a')](db[_0x2792('0x2b')][_0x2792('0x2c')],function(_0x22e66d){return{'name':_0x22e66d[_0x2792('0x2d')],'type':_0x22e66d[_0x2792('0x2e')][_0x2792('0x2f')]};});_0x1369c3[_0x2792('0x30')]=_[_0x2792('0x2a')](_0x1095a6,_0x2792('0x27'));_0x1369c3[_0x2792('0x31')]=_['keys'](_0x1a32f9[_0x2792('0x31')]);_0x1369c3[_0x2792('0x32')]=_[_0x2792('0x33')](_0x1369c3['model'],_0x1369c3['query']);_0x10e0ea[_0x2792('0x34')]=_[_0x2792('0x33')](_0x1369c3[_0x2792('0x30')],qs[_0x2792('0x35')](_0x1a32f9[_0x2792('0x31')]['fields']));_0x10e0ea[_0x2792('0x34')]=_0x10e0ea[_0x2792('0x34')]['length']?_0x10e0ea['attributes']:_0x1369c3[_0x2792('0x30')];if(!_0x1a32f9['query'][_0x2792('0x36')](_0x2792('0x37'))){_0x10e0ea[_0x2792('0x1b')]=qs[_0x2792('0x1b')](_0x1a32f9[_0x2792('0x31')][_0x2792('0x1b')]);_0x10e0ea[_0x2792('0x19')]=qs['offset'](_0x1a32f9['query'][_0x2792('0x19')]);}_0x10e0ea[_0x2792('0x38')]=qs[_0x2792('0x39')](_0x1a32f9['query']['sort']);_0x10e0ea['where']=qs[_0x2792('0x32')](_[_0x2792('0x3a')](_0x1a32f9['query'],_0x1369c3['filters']),_0x1095a6);if(_0x1a32f9[_0x2792('0x31')][_0x2792('0x3b')]){_0x10e0ea[_0x2792('0x3c')]=_[_0x2792('0x3d')](_0x10e0ea['where'],{'$or':_[_0x2792('0x2a')](_0x1095a6,function(_0x579e97){if(_0x579e97['type']!=='VIRTUAL'){var _0x5f16af={};_0x5f16af[_0x579e97[_0x2792('0x27')]]={'$like':'%'+_0x1a32f9['query'][_0x2792('0x3b')]+'%'};return _0x5f16af;}})});}_0x10e0ea=_[_0x2792('0x3d')]({},_0x10e0ea,_0x1a32f9[_0x2792('0x3e')]);var _0x381aa0={'where':_0x10e0ea[_0x2792('0x3c')]};return db[_0x2792('0x2b')]['count'](_0x381aa0)[_0x2792('0x23')](function(_0x3295bc){_0x2a603a[_0x2792('0x1c')]=_0x3295bc;if(_0x1a32f9['query'][_0x2792('0x3f')]){_0x10e0ea[_0x2792('0x40')]=[{'all':!![]}];}return db[_0x2792('0x2b')]['findAll'](_0x10e0ea);})[_0x2792('0x23')](function(_0x59c2ee){_0x2a603a['rows']=_0x59c2ee;return _0x2a603a;})[_0x2792('0x23')](respondWithFilteredResult(_0x1a83ee,_0x10e0ea))[_0x2792('0x41')](handleError(_0x1a83ee,null));};exports['show']=function(_0x239e19,_0xade7e4){var _0x13f1f0={'raw':![],'where':{'id':_0x239e19[_0x2792('0x42')]['id']}},_0x398c65={};_0x398c65['model']=_[_0x2792('0x43')](db[_0x2792('0x2b')][_0x2792('0x2c')]);_0x398c65[_0x2792('0x31')]=_[_0x2792('0x43')](_0x239e19[_0x2792('0x31')]);_0x398c65[_0x2792('0x32')]=_[_0x2792('0x33')](_0x398c65[_0x2792('0x30')],_0x398c65[_0x2792('0x31')]);_0x13f1f0[_0x2792('0x34')]=_[_0x2792('0x33')](_0x398c65[_0x2792('0x30')],qs[_0x2792('0x35')](_0x239e19['query'][_0x2792('0x35')]));_0x13f1f0['attributes']=_0x13f1f0[_0x2792('0x34')][_0x2792('0x44')]?_0x13f1f0['attributes']:_0x398c65[_0x2792('0x30')];if(_0x239e19['query']['includeAll']){_0x13f1f0[_0x2792('0x40')]=[{'all':!![]}];}_0x13f1f0=_[_0x2792('0x3d')]({},_0x13f1f0,_0x239e19[_0x2792('0x3e')]);return db[_0x2792('0x2b')][_0x2792('0x45')](_0x13f1f0)[_0x2792('0x23')](handleEntityNotFound(_0xade7e4,null))[_0x2792('0x23')](respondWithResult(_0xade7e4,null))[_0x2792('0x41')](handleError(_0xade7e4,null));};exports['create']=function(_0x4030be,_0x2cd9ee){return db[_0x2792('0x2b')]['create'](_0x4030be[_0x2792('0x46')],{})['then'](respondWithResult(_0x2cd9ee,0xc9))[_0x2792('0x41')](handleError(_0x2cd9ee,null));};exports[_0x2792('0x22')]=function(_0x1bb10c,_0x155aef){if(_0x1bb10c[_0x2792('0x46')]['id']){delete _0x1bb10c[_0x2792('0x46')]['id'];}return db[_0x2792('0x2b')][_0x2792('0x45')]({'where':{'id':_0x1bb10c[_0x2792('0x42')]['id']}})[_0x2792('0x23')](handleEntityNotFound(_0x155aef,null))[_0x2792('0x23')](saveUpdates(_0x1bb10c[_0x2792('0x46')],null))[_0x2792('0x23')](respondWithResult(_0x155aef,null))[_0x2792('0x41')](handleError(_0x155aef,null));};exports[_0x2792('0x24')]=function(_0x4d261c,_0x1fb947){return db[_0x2792('0x2b')][_0x2792('0x45')]({'where':{'id':_0x4d261c[_0x2792('0x42')]['id']}})[_0x2792('0x23')](handleEntityNotFound(_0x1fb947,null))[_0x2792('0x23')](removeEntity(_0x1fb947,null))['catch'](handleError(_0x1fb947,null));};exports[_0x2792('0x47')]=function(_0x22fdda,_0x1d04fa,_0x1356a2){var _0x254e08={};var _0x3c7215={};var _0xb4eaa7;var _0x2bdbf5;return db['ZohoAccount'][_0x2792('0x48')]({'where':{'id':_0x22fdda[_0x2792('0x42')]['id']}})[_0x2792('0x23')](handleEntityNotFound(_0x1d04fa,null))[_0x2792('0x23')](function(_0x4fe2f9){if(_0x4fe2f9){_0xb4eaa7=_0x4fe2f9;_0x3c7215[_0x2792('0x30')]=_['keys'](db['ZohoConfiguration'][_0x2792('0x2c')]);_0x3c7215[_0x2792('0x31')]=_[_0x2792('0x43')](_0x22fdda[_0x2792('0x31')]);_0x3c7215[_0x2792('0x32')]=_[_0x2792('0x33')](_0x3c7215[_0x2792('0x30')],_0x3c7215['query']);_0x254e08['attributes']=_[_0x2792('0x33')](_0x3c7215[_0x2792('0x30')],qs['fields'](_0x22fdda[_0x2792('0x31')]['fields']));_0x254e08[_0x2792('0x34')]=_0x254e08[_0x2792('0x34')]['length']?_0x254e08['attributes']:_0x3c7215[_0x2792('0x30')];_0x254e08[_0x2792('0x38')]=qs[_0x2792('0x39')](_0x22fdda['query'][_0x2792('0x39')]);_0x254e08[_0x2792('0x3c')]=qs[_0x2792('0x32')](_[_0x2792('0x3a')](_0x22fdda[_0x2792('0x31')],_0x3c7215[_0x2792('0x32')]));if(_0x22fdda[_0x2792('0x31')][_0x2792('0x3b')]){_0x254e08[_0x2792('0x3c')]=_[_0x2792('0x3d')](_0x254e08[_0x2792('0x3c')],{'$or':_[_0x2792('0x2a')](_0x254e08[_0x2792('0x34')],function(_0x5c87f5){var _0x2f875a={};_0x2f875a[_0x5c87f5]={'$like':'%'+_0x22fdda[_0x2792('0x31')][_0x2792('0x3b')]+'%'};return _0x2f875a;})});}_0x254e08=_[_0x2792('0x3d')]({},_0x254e08,_0x22fdda[_0x2792('0x3e')]);return _0xb4eaa7[_0x2792('0x47')](_0x254e08);}})['then'](function(_0x5e0788){if(_0x5e0788){_0x2bdbf5=_0x5e0788['length'];if(!_0x22fdda[_0x2792('0x31')]['hasOwnProperty'](_0x2792('0x37'))){_0x254e08['limit']=qs[_0x2792('0x1b')](_0x22fdda[_0x2792('0x31')][_0x2792('0x1b')]);_0x254e08[_0x2792('0x19')]=qs['offset'](_0x22fdda[_0x2792('0x31')][_0x2792('0x19')]);}return _0xb4eaa7[_0x2792('0x47')](_0x254e08);}})[_0x2792('0x23')](function(_0x1b07a4){if(_0x1b07a4){return _0x1b07a4?{'count':_0x2bdbf5,'rows':_0x1b07a4}:null;}})[_0x2792('0x23')](respondWithResult(_0x1d04fa,null))[_0x2792('0x41')](handleError(_0x1d04fa,null));};exports[_0x2792('0x49')]=function(_0x5a104f,_0x2f5f71,_0x32c70c){if(_0x5a104f['body']['id']){delete _0x5a104f[_0x2792('0x46')]['id'];}return db[_0x2792('0x2b')][_0x2792('0x48')]({'where':{'id':_0x5a104f[_0x2792('0x42')]['id']}})[_0x2792('0x23')](handleEntityNotFound(_0x2f5f71,null))[_0x2792('0x23')](function(_0xda54b5){if(_0xda54b5){_0x5a104f[_0x2792('0x46')][_0x2792('0x4a')]=_0xda54b5['id'];_0x5a104f[_0x2792('0x46')]['Subjects']=integrations[_0x2792('0x4b')](_0x5a104f[_0x2792('0x46')][_0x2792('0x4c')],_0x5a104f[_0x2792('0x46')][_0x2792('0x2e')]);_0x5a104f[_0x2792('0x46')][_0x2792('0x4d')]=integrations[_0x2792('0x4e')](_0x5a104f[_0x2792('0x46')]['channel'],_0x5a104f[_0x2792('0x46')][_0x2792('0x2e')]);return db[_0x2792('0x4f')][_0x2792('0x50')](_0x5a104f[_0x2792('0x46')],{'include':[{'model':db['ZohoField'],'as':_0x2792('0x51')},{'model':db[_0x2792('0x52')],'as':_0x2792('0x4d')}]});}return null;})[_0x2792('0x23')](respondWithResult(_0x2f5f71,null))[_0x2792('0x41')](handleError(_0x2f5f71,null));};function getAccessToken(_0x2a7753){return new Promise(function(_0x5d6ea1,_0x29775d){var _0x4ff0b5;switch(_0x2a7753[_0x2792('0x53')]){case'US':_0x4ff0b5='https://accounts.zoho.com';break;case'AU':_0x4ff0b5=_0x2792('0x54');break;case'EU':_0x4ff0b5=_0x2792('0x55');break;case'IN':_0x4ff0b5='https://accounts.zoho.in';break;case'CN':_0x4ff0b5=_0x2792('0x56');break;default:_0x4ff0b5=_0x2792('0x55');break;}var _0x185be7={'method':_0x2792('0x57'),'uri':_0x4ff0b5+_0x2792('0x58'),'qs':{'refresh_token':_0x2a7753['refreshToken'],'client_id':_0x2a7753[_0x2792('0x59')],'client_secret':_0x2a7753[_0x2792('0x5a')],'grant_type':_0x2792('0x5b')},'json':!![]};return rp(_0x185be7)[_0x2792('0x23')](function(_0x36d461){if(_0x36d461[_0x2792('0x5c')]){_0x5d6ea1(_0x36d461[_0x2792('0x5c')]);}else{_0x29775d('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})['catch'](function(_0x2bbdf7){_0x29775d(_0x2bbdf7);});});}exports[_0x2792('0x5d')]=function(_0xc94fdc,_0x381e58,_0x24633e){var _0x31997d,_0x3768d2,_0x2f9cee,_0x5ecdf7,_0x53cec8;return db[_0x2792('0x2b')][_0x2792('0x48')]({'where':{'id':_0xc94fdc[_0x2792('0x42')]['id']},'attributes':['id',_0x2792('0x5e'),_0x2792('0x53'),_0x2792('0x59'),_0x2792('0x5a'),_0x2792('0x5f'),_0x2792('0x60'),_0x2792('0x61')]})[_0x2792('0x23')](handleEntityNotFound(_0x381e58,null))[_0x2792('0x23')](function(_0x3426b3){_0x53cec8=_0x3426b3;_0x31997d=_0x53cec8[_0x2792('0x5e')];_0x3768d2=_0x31997d===_0x2792('0x62')?'eu':_0x2792('0x63');_0x2f9cee=_0x53cec8[_0x2792('0x5f')];var _0x444a6d=_0x2f9cee[_0x2792('0x64')](-0x1);if(_0x444a6d==='/'||_0x444a6d==='\x5c'||_0x444a6d===':'){_0x2f9cee=_0x2f9cee['substring'](0x0,_0x2f9cee[_0x2792('0x65')](_0x444a6d));}if(!_0x53cec8['refreshToken']){throw new Error(_0x2792('0x66'));}return getAccessToken(_0x53cec8);})[_0x2792('0x23')](function(_0x345a69){if(_0x345a69){return rp({'method':_0x2792('0x67'),'uri':util[_0x2792('0x68')](_0x2792('0x69'),_0x3768d2),'qs':{'module':_0x2792('0x6a')},'headers':{'Authorization':_0x2792('0x6b')+_0x345a69},'json':!![]});}})[_0x2792('0x23')](function(_0x1e07e1){if(_0x1e07e1){if(_0x1e07e1[_0x2792('0x6c')]&&_0x1e07e1[_0x2792('0x6c')][_0x2792('0x26')]){throw new Error(_0x1e07e1[_0x2792('0x6c')][_0x2792('0x26')][_0x2792('0x6d')]);}var _0x2d3925=[];var _0x3800d7=[];var _0x4eed73=[_0x2792('0x6e'),_0x2792('0x6f'),_0x2792('0x70'),'WhoId',_0x2792('0x71'),'Call_Result',_0x2792('0x72'),_0x2792('0x73')];_0x3800d7=_[_0x2792('0x74')](_0x1e07e1[_0x2792('0x35')],function(_0x511f8c){return _0x4eed73['includes'](_0x511f8c[_0x2792('0x75')]);});for(var _0x2577b2=0x0;_0x2577b2<_0x3800d7[_0x2792('0x44')];_0x2577b2++){if(_0x3800d7[_0x2577b2][_0x2792('0x76')]===![]){_0x2d3925['push']({'id':_0x3800d7[_0x2577b2]['id'],'name':_0x3800d7[_0x2577b2][_0x2792('0x77')],'custom':_0x3800d7[_0x2577b2][_0x2792('0x78')],'options':_0x3800d7[_0x2577b2][_0x2792('0x79')]==='picklist'&&_0x3800d7[_0x2577b2][_0x2792('0x7a')][_0x2792('0x44')]>-0x1?_[_0x2792('0x2a')](_0x3800d7[_0x2577b2][_0x2792('0x7a')],function(_0xbcd948){return{'name':_0xbcd948,'value':_0xbcd948};}):[]});}}return{'count':_0x2d3925[_0x2792('0x44')],'rows':_0x2d3925};}else{return{'count':0x0,'rows':[]};}})[_0x2792('0x23')](respondWithResult(_0x381e58,null))[_0x2792('0x41')](function(_0x13f988){var _0x17cdc5=_0xc94fdc['query']['test']?0x1f4:_0x13f988[_0x2792('0x7b')]||0x1f4;logger[_0x2792('0x26')](_0x2792('0x7c'),_0x2792('0x5d'),_0x17cdc5,JSON[_0x2792('0x7d')](_0x13f988));delete _0x13f988['name'];if(_0x17cdc5===0x191){_0x17cdc5=0x190;}_0x381e58[_0x2792('0x17')](_0x17cdc5)['send'](_0xc94fdc[_0x2792('0x31')]['test']?{'message':_0x2792('0x7e'),'statusCode':_0x13f988['statusCode']}:_0x13f988);});}; \ No newline at end of file +var _0x8898=['stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','ZohoAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','show','params','find','catch','create','body','getConfigurations','findOne','ZohoConfiguration','hasOwnProperty','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','serverUrl','code','refreshToken','com','substring','lastIndexOf','format','Zoho-oauthtoken\x20','response','message','Owner','Subject','Description','WhoId','Call_Duration','Call_Start_Time','Call_Type','includes','api_name','custom_field','picklist','statusCode','getFields,\x20%s,\x20%s,\x20%s'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x8898,0x7d));var _0x8889=function(_0x4beb8c,_0x57144d){_0x4beb8c=_0x4beb8c-0x0;var _0x4fd010=_0x8898[_0x4beb8c];return _0x4fd010;};'use strict';var emlformat=require(_0x8889('0x0'));var rimraf=require(_0x8889('0x1'));var zipdir=require(_0x8889('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8889('0x3'));var BPromise=require(_0x8889('0x4'));var Mustache=require(_0x8889('0x5'));var util=require(_0x8889('0x6'));var path=require(_0x8889('0x7'));var sox=require(_0x8889('0x8'));var csv=require(_0x8889('0x9'));var ejs=require(_0x8889('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8889('0xb'));var squel=require('squel');var crypto=require(_0x8889('0xc'));var jsforce=require(_0x8889('0xd'));var deskjs=require(_0x8889('0xe'));var toCsv=require(_0x8889('0x9'));var querystring=require(_0x8889('0xf'));var Papa=require('papaparse');var Redis=require(_0x8889('0x10'));var authService=require(_0x8889('0x11'));var qs=require(_0x8889('0x12'));var as=require(_0x8889('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8889('0x14'));var utils=require(_0x8889('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x8889('0x16'));var db=require(_0x8889('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x481c85,_0x3134d1){_0x3134d1=_0x3134d1||0xcc;return function(_0xb7faee){if(_0xb7faee){return _0x481c85[_0x8889('0x18')](_0x3134d1);}return _0x481c85['status'](_0x3134d1)[_0x8889('0x19')]();};}function respondWithResult(_0x384b2c,_0x5ef9c4){_0x5ef9c4=_0x5ef9c4||0xc8;return function(_0xb04e1f){if(_0xb04e1f){return _0x384b2c[_0x8889('0x1a')](_0x5ef9c4)[_0x8889('0x1b')](_0xb04e1f);}};}function respondWithFilteredResult(_0x536350,_0x1dfbdb){return function(_0x5f58c5){if(_0x5f58c5){var _0x47ce9e=typeof _0x1dfbdb[_0x8889('0x1c')]==='undefined'&&typeof _0x1dfbdb[_0x8889('0x1d')]==='undefined';var _0x4894ef=_0x5f58c5[_0x8889('0x1e')];var _0x4072b4=_0x47ce9e?0x0:_0x1dfbdb[_0x8889('0x1c')];var _0x489d1b=_0x47ce9e?_0x5f58c5[_0x8889('0x1e')]:_0x1dfbdb[_0x8889('0x1c')]+_0x1dfbdb['limit'];var _0x244c2;if(_0x489d1b>=_0x4894ef){_0x489d1b=_0x4894ef;_0x244c2=0xc8;}else{_0x244c2=0xce;}_0x536350[_0x8889('0x1a')](_0x244c2);return _0x536350[_0x8889('0x1f')](_0x8889('0x20'),_0x4072b4+'-'+_0x489d1b+'/'+_0x4894ef)[_0x8889('0x1b')](_0x5f58c5);}return null;};}function patchUpdates(_0x4cf8b5){return function(_0x2288f3){try{jsonpatch[_0x8889('0x21')](_0x2288f3,_0x4cf8b5,!![]);}catch(_0x42c843){return BPromise['reject'](_0x42c843);}return _0x2288f3[_0x8889('0x22')]();};}function saveUpdates(_0x3fc9df,_0x517512){return function(_0x339016){if(_0x339016){return _0x339016[_0x8889('0x23')](_0x3fc9df)[_0x8889('0x24')](function(_0xf1e0a3){return _0xf1e0a3;});}return null;};}function removeEntity(_0x5866e6,_0x5d9092){return function(_0x352a63){if(_0x352a63){return _0x352a63[_0x8889('0x25')]()[_0x8889('0x24')](function(){_0x5866e6[_0x8889('0x1a')](0xcc)[_0x8889('0x19')]();});}};}function handleEntityNotFound(_0x21ad11,_0x212a17){return function(_0x18d4ba){if(!_0x18d4ba){_0x21ad11['sendStatus'](0x194);}return _0x18d4ba;};}function handleError(_0x126e81,_0x50cf12){_0x50cf12=_0x50cf12||0x1f4;return function(_0xb56cef){logger[_0x8889('0x26')](_0xb56cef[_0x8889('0x27')]);if(_0xb56cef[_0x8889('0x28')]){delete _0xb56cef[_0x8889('0x28')];}_0x126e81[_0x8889('0x1a')](_0x50cf12)[_0x8889('0x29')](_0xb56cef);};}exports[_0x8889('0x2a')]=function(_0x3967e6,_0x16acc7){var _0x359f21={},_0x14771a={},_0x15c2dc={'count':0x0,'rows':[]};var _0x233872=_[_0x8889('0x2b')](db[_0x8889('0x2c')][_0x8889('0x2d')],function(_0x110e7c){return{'name':_0x110e7c[_0x8889('0x2e')],'type':_0x110e7c[_0x8889('0x2f')]['key']};});_0x14771a[_0x8889('0x30')]=_[_0x8889('0x2b')](_0x233872,_0x8889('0x28'));_0x14771a[_0x8889('0x31')]=_[_0x8889('0x32')](_0x3967e6[_0x8889('0x31')]);_0x14771a[_0x8889('0x33')]=_[_0x8889('0x34')](_0x14771a['model'],_0x14771a[_0x8889('0x31')]);_0x359f21['attributes']=_[_0x8889('0x34')](_0x14771a[_0x8889('0x30')],qs['fields'](_0x3967e6[_0x8889('0x31')][_0x8889('0x35')]));_0x359f21[_0x8889('0x36')]=_0x359f21['attributes'][_0x8889('0x37')]?_0x359f21[_0x8889('0x36')]:_0x14771a[_0x8889('0x30')];if(!_0x3967e6['query']['hasOwnProperty'](_0x8889('0x38'))){_0x359f21['limit']=qs[_0x8889('0x1d')](_0x3967e6[_0x8889('0x31')]['limit']);_0x359f21['offset']=qs['offset'](_0x3967e6[_0x8889('0x31')]['offset']);}_0x359f21[_0x8889('0x39')]=qs['sort'](_0x3967e6[_0x8889('0x31')][_0x8889('0x3a')]);_0x359f21[_0x8889('0x3b')]=qs['filters'](_[_0x8889('0x3c')](_0x3967e6[_0x8889('0x31')],_0x14771a[_0x8889('0x33')]),_0x233872);if(_0x3967e6[_0x8889('0x31')][_0x8889('0x3d')]){_0x359f21[_0x8889('0x3b')]=_['merge'](_0x359f21[_0x8889('0x3b')],{'$or':_[_0x8889('0x2b')](_0x233872,function(_0x2db763){if(_0x2db763[_0x8889('0x2f')]!==_0x8889('0x3e')){var _0xe7b385={};_0xe7b385[_0x2db763['name']]={'$like':'%'+_0x3967e6[_0x8889('0x31')][_0x8889('0x3d')]+'%'};return _0xe7b385;}})});}_0x359f21=_[_0x8889('0x3f')]({},_0x359f21,_0x3967e6['options']);var _0x95c5db={'where':_0x359f21[_0x8889('0x3b')]};return db[_0x8889('0x2c')]['count'](_0x95c5db)[_0x8889('0x24')](function(_0xfa4c7f){_0x15c2dc[_0x8889('0x1e')]=_0xfa4c7f;if(_0x3967e6['query'][_0x8889('0x40')]){_0x359f21[_0x8889('0x41')]=[{'all':!![]}];}return db[_0x8889('0x2c')][_0x8889('0x42')](_0x359f21);})[_0x8889('0x24')](function(_0x517eb0){_0x15c2dc['rows']=_0x517eb0;return _0x15c2dc;})[_0x8889('0x24')](respondWithFilteredResult(_0x16acc7,_0x359f21))['catch'](handleError(_0x16acc7,null));};exports[_0x8889('0x43')]=function(_0x30386e,_0x200a45){var _0x3bcbc0={'raw':![],'where':{'id':_0x30386e[_0x8889('0x44')]['id']}},_0x3df5dc={};_0x3df5dc['model']=_[_0x8889('0x32')](db['ZohoAccount'][_0x8889('0x2d')]);_0x3df5dc[_0x8889('0x31')]=_['keys'](_0x30386e[_0x8889('0x31')]);_0x3df5dc[_0x8889('0x33')]=_[_0x8889('0x34')](_0x3df5dc[_0x8889('0x30')],_0x3df5dc[_0x8889('0x31')]);_0x3bcbc0[_0x8889('0x36')]=_['intersection'](_0x3df5dc[_0x8889('0x30')],qs[_0x8889('0x35')](_0x30386e[_0x8889('0x31')][_0x8889('0x35')]));_0x3bcbc0[_0x8889('0x36')]=_0x3bcbc0['attributes'][_0x8889('0x37')]?_0x3bcbc0[_0x8889('0x36')]:_0x3df5dc[_0x8889('0x30')];if(_0x30386e[_0x8889('0x31')][_0x8889('0x40')]){_0x3bcbc0['include']=[{'all':!![]}];}_0x3bcbc0=_[_0x8889('0x3f')]({},_0x3bcbc0,_0x30386e['options']);return db[_0x8889('0x2c')][_0x8889('0x45')](_0x3bcbc0)[_0x8889('0x24')](handleEntityNotFound(_0x200a45,null))[_0x8889('0x24')](respondWithResult(_0x200a45,null))[_0x8889('0x46')](handleError(_0x200a45,null));};exports[_0x8889('0x47')]=function(_0x1f76b1,_0x58c1cb){return db[_0x8889('0x2c')][_0x8889('0x47')](_0x1f76b1['body'],{})['then'](respondWithResult(_0x58c1cb,0xc9))[_0x8889('0x46')](handleError(_0x58c1cb,null));};exports[_0x8889('0x23')]=function(_0x4759c0,_0x56cf22){if(_0x4759c0[_0x8889('0x48')]['id']){delete _0x4759c0[_0x8889('0x48')]['id'];}return db[_0x8889('0x2c')][_0x8889('0x45')]({'where':{'id':_0x4759c0[_0x8889('0x44')]['id']}})['then'](handleEntityNotFound(_0x56cf22,null))[_0x8889('0x24')](saveUpdates(_0x4759c0[_0x8889('0x48')],null))[_0x8889('0x24')](respondWithResult(_0x56cf22,null))['catch'](handleError(_0x56cf22,null));};exports[_0x8889('0x25')]=function(_0x2b989e,_0x343fbf){return db[_0x8889('0x2c')][_0x8889('0x45')]({'where':{'id':_0x2b989e[_0x8889('0x44')]['id']}})[_0x8889('0x24')](handleEntityNotFound(_0x343fbf,null))[_0x8889('0x24')](removeEntity(_0x343fbf,null))[_0x8889('0x46')](handleError(_0x343fbf,null));};exports[_0x8889('0x49')]=function(_0x14bb37,_0x26fc45,_0x5ed600){var _0x2c43b9={};var _0x6e9025={};var _0x80494;var _0x5605a0;return db[_0x8889('0x2c')][_0x8889('0x4a')]({'where':{'id':_0x14bb37['params']['id']}})[_0x8889('0x24')](handleEntityNotFound(_0x26fc45,null))[_0x8889('0x24')](function(_0x47f39f){if(_0x47f39f){_0x80494=_0x47f39f;_0x6e9025['model']=_['keys'](db[_0x8889('0x4b')]['rawAttributes']);_0x6e9025[_0x8889('0x31')]=_[_0x8889('0x32')](_0x14bb37['query']);_0x6e9025['filters']=_['intersection'](_0x6e9025['model'],_0x6e9025[_0x8889('0x31')]);_0x2c43b9[_0x8889('0x36')]=_['intersection'](_0x6e9025['model'],qs[_0x8889('0x35')](_0x14bb37['query'][_0x8889('0x35')]));_0x2c43b9[_0x8889('0x36')]=_0x2c43b9['attributes']['length']?_0x2c43b9['attributes']:_0x6e9025[_0x8889('0x30')];_0x2c43b9[_0x8889('0x39')]=qs[_0x8889('0x3a')](_0x14bb37['query']['sort']);_0x2c43b9[_0x8889('0x3b')]=qs['filters'](_[_0x8889('0x3c')](_0x14bb37[_0x8889('0x31')],_0x6e9025[_0x8889('0x33')]));if(_0x14bb37['query'][_0x8889('0x3d')]){_0x2c43b9[_0x8889('0x3b')]=_[_0x8889('0x3f')](_0x2c43b9['where'],{'$or':_[_0x8889('0x2b')](_0x2c43b9[_0x8889('0x36')],function(_0x4cccb8){var _0x2ae199={};_0x2ae199[_0x4cccb8]={'$like':'%'+_0x14bb37[_0x8889('0x31')][_0x8889('0x3d')]+'%'};return _0x2ae199;})});}_0x2c43b9=_[_0x8889('0x3f')]({},_0x2c43b9,_0x14bb37['options']);return _0x80494[_0x8889('0x49')](_0x2c43b9);}})[_0x8889('0x24')](function(_0xb1857b){if(_0xb1857b){_0x5605a0=_0xb1857b[_0x8889('0x37')];if(!_0x14bb37['query'][_0x8889('0x4c')](_0x8889('0x38'))){_0x2c43b9[_0x8889('0x1d')]=qs['limit'](_0x14bb37['query'][_0x8889('0x1d')]);_0x2c43b9[_0x8889('0x1c')]=qs[_0x8889('0x1c')](_0x14bb37[_0x8889('0x31')][_0x8889('0x1c')]);}return _0x80494[_0x8889('0x49')](_0x2c43b9);}})[_0x8889('0x24')](function(_0x50e8ba){if(_0x50e8ba){return _0x50e8ba?{'count':_0x5605a0,'rows':_0x50e8ba}:null;}})[_0x8889('0x24')](respondWithResult(_0x26fc45,null))['catch'](handleError(_0x26fc45,null));};exports[_0x8889('0x4d')]=function(_0x479360,_0x4e7d1e,_0x9cca4e){if(_0x479360['body']['id']){delete _0x479360['body']['id'];}return db['ZohoAccount'][_0x8889('0x4a')]({'where':{'id':_0x479360['params']['id']}})['then'](handleEntityNotFound(_0x4e7d1e,null))['then'](function(_0x1f4fee){if(_0x1f4fee){_0x479360[_0x8889('0x48')][_0x8889('0x4e')]=_0x1f4fee['id'];_0x479360[_0x8889('0x48')]['Subjects']=integrations[_0x8889('0x4f')](_0x479360[_0x8889('0x48')][_0x8889('0x50')],_0x479360[_0x8889('0x48')][_0x8889('0x2f')]);_0x479360[_0x8889('0x48')][_0x8889('0x51')]=integrations[_0x8889('0x52')](_0x479360['body']['channel'],_0x479360['body']['type']);return db['ZohoConfiguration'][_0x8889('0x47')](_0x479360[_0x8889('0x48')],{'include':[{'model':db['ZohoField'],'as':'Subjects'},{'model':db[_0x8889('0x53')],'as':_0x8889('0x51')}]});}return null;})['then'](respondWithResult(_0x4e7d1e,null))[_0x8889('0x46')](handleError(_0x4e7d1e,null));};function getAccessToken(_0x38f435){return new Promise(function(_0x22c73b,_0x33c2da){var _0x18e891;switch(_0x38f435[_0x8889('0x54')]){case'US':_0x18e891=_0x8889('0x55');break;case'AU':_0x18e891='https://accounts.zoho.com.au';break;case'EU':_0x18e891=_0x8889('0x56');break;case'IN':_0x18e891=_0x8889('0x57');break;case'CN':_0x18e891=_0x8889('0x58');break;default:_0x18e891=_0x8889('0x56');break;}var _0x50f547={'method':_0x8889('0x59'),'uri':_0x18e891+_0x8889('0x5a'),'qs':{'refresh_token':_0x38f435['refreshToken'],'client_id':_0x38f435[_0x8889('0x5b')],'client_secret':_0x38f435[_0x8889('0x5c')],'grant_type':_0x8889('0x5d')},'json':!![]};return rp(_0x50f547)[_0x8889('0x24')](function(_0x5f416a){if(_0x5f416a['access_token']){_0x22c73b(_0x5f416a[_0x8889('0x5e')]);}else{_0x33c2da(_0x8889('0x5f'));}})['catch'](function(_0x1b805d){_0x33c2da(_0x1b805d);});});}exports[_0x8889('0x60')]=function(_0x4099aa,_0x6150df,_0x3b38ce){var _0x43fff1,_0x29b1f8,_0x300d3a,_0x2c352d,_0x59edad;return db[_0x8889('0x2c')][_0x8889('0x4a')]({'where':{'id':_0x4099aa[_0x8889('0x44')]['id']},'attributes':['id',_0x8889('0x61'),_0x8889('0x54'),_0x8889('0x5b'),_0x8889('0x5c'),_0x8889('0x62'),_0x8889('0x63'),_0x8889('0x64')]})[_0x8889('0x24')](handleEntityNotFound(_0x6150df,null))[_0x8889('0x24')](function(_0x2781dd){_0x59edad=_0x2781dd;_0x43fff1=_0x59edad[_0x8889('0x61')];_0x29b1f8=_0x43fff1==='zoho.eu'?'eu':_0x8889('0x65');_0x300d3a=_0x59edad[_0x8889('0x62')];var _0x384909=_0x300d3a['slice'](-0x1);if(_0x384909==='/'||_0x384909==='\x5c'||_0x384909===':'){_0x300d3a=_0x300d3a[_0x8889('0x66')](0x0,_0x300d3a[_0x8889('0x67')](_0x384909));}if(!_0x59edad['refreshToken']){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x59edad);})[_0x8889('0x24')](function(_0x292899){if(_0x292899){return rp({'method':'GET','uri':util[_0x8889('0x68')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x29b1f8),'qs':{'module':'Calls'},'headers':{'Authorization':_0x8889('0x69')+_0x292899},'json':!![]});}})[_0x8889('0x24')](function(_0x1e0203){if(_0x1e0203){if(_0x1e0203[_0x8889('0x6a')]&&_0x1e0203[_0x8889('0x6a')]['error']){throw new Error(_0x1e0203[_0x8889('0x6a')][_0x8889('0x26')][_0x8889('0x6b')]);}var _0x31c964=[];var _0x5f23e3=[];var _0x45eac1=[_0x8889('0x6c'),_0x8889('0x6d'),_0x8889('0x6e'),_0x8889('0x6f'),_0x8889('0x70'),'Call_Result',_0x8889('0x71'),_0x8889('0x72')];_0x5f23e3=_['remove'](_0x1e0203[_0x8889('0x35')],function(_0x208e1d){return _0x45eac1[_0x8889('0x73')](_0x208e1d[_0x8889('0x74')]);});for(var _0x1a8cd7=0x0;_0x1a8cd7<_0x5f23e3[_0x8889('0x37')];_0x1a8cd7++){if(_0x5f23e3[_0x1a8cd7]['system_mandatory']===![]){_0x31c964['push']({'id':_0x5f23e3[_0x1a8cd7]['id'],'name':_0x5f23e3[_0x1a8cd7]['display_label'],'custom':_0x5f23e3[_0x1a8cd7][_0x8889('0x75')],'options':_0x5f23e3[_0x1a8cd7]['data_type']===_0x8889('0x76')&&_0x5f23e3[_0x1a8cd7]['pick_list_values'][_0x8889('0x37')]>-0x1?_[_0x8889('0x2b')](_0x5f23e3[_0x1a8cd7]['pick_list_values'],function(_0x1b4241){return{'name':_0x1b4241,'value':_0x1b4241};}):[]});}}return{'count':_0x31c964[_0x8889('0x37')],'rows':_0x31c964};}else{return{'count':0x0,'rows':[]};}})[_0x8889('0x24')](respondWithResult(_0x6150df,null))[_0x8889('0x46')](function(_0x3d257d){var _0xfd895a=_0x4099aa['query']['test']?0x1f4:_0x3d257d[_0x8889('0x77')]||0x1f4;logger['error'](_0x8889('0x78'),_0x8889('0x60'),_0xfd895a,JSON[_0x8889('0x79')](_0x3d257d));delete _0x3d257d[_0x8889('0x28')];if(_0xfd895a===0x191){_0xfd895a=0x190;}_0x6150df[_0x8889('0x1a')](_0xfd895a)[_0x8889('0x29')](_0x4099aa[_0x8889('0x31')]['test']?{'message':_0x8889('0x7a'),'statusCode':_0x3d257d[_0x8889('0x77')]}:_0x3d257d);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 318351e..71fe2b7 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 _0xa5ba=['exports','define','ZohoAccount','changed','zone','serverUrl','clientId','clientSecret','host','slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','code','parse','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','error','name','inspect','catch','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','https://accounts.zoho.com.cn','application/x-www-form-urlencoded','then','util','../../config/logger','api','moment','rimraf','../../config/environment','../../components/integrations/configuration'];(function(_0x4d07cc,_0x587613){var _0x42de3b=function(_0x201f78){while(--_0x201f78){_0x4d07cc['push'](_0x4d07cc['shift']());}};_0x42de3b(++_0x587613);}(_0xa5ba,0x118));var _0xaa5b=function(_0x17e61a,_0x13d01b){_0x17e61a=_0x17e61a-0x0;var _0x50534d=_0xa5ba[_0x17e61a];return _0x50534d;};'use strict';var _=require('lodash');var util=require(_0xaa5b('0x0'));var logger=require(_0xaa5b('0x1'))(_0xaa5b('0x2'));var moment=require(_0xaa5b('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xaa5b('0x4'));var config=require(_0xaa5b('0x5'));var attributes=require('./intZohoAccount.attributes');var integrations=require(_0xaa5b('0x6'));module[_0xaa5b('0x7')]=function(_0x5c131c,_0xfd9b8c){return _0x5c131c[_0xaa5b('0x8')](_0xaa5b('0x9'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x50a68a,_0x36ba0a,_0x3bc279){if(_0x50a68a[_0xaa5b('0xa')](_0xaa5b('0xb'))||_0x50a68a[_0xaa5b('0xa')](_0xaa5b('0xc'))||_0x50a68a[_0xaa5b('0xa')](_0xaa5b('0xd'))||_0x50a68a[_0xaa5b('0xa')](_0xaa5b('0xe'))||_0x50a68a['changed']('code')||_0x50a68a[_0xaa5b('0xa')](_0xaa5b('0xf'))){var _0x3a8409,_0x332e6b;_0x3a8409=_0x50a68a[_0xaa5b('0xc')];var _0x185a5c=_0x3a8409[_0xaa5b('0x10')](-0x1);if(_0x185a5c==='/'||_0x185a5c==='\x5c'||_0x185a5c===':'){_0x3a8409=_0x3a8409[_0xaa5b('0x11')](0x0,_0x3a8409[_0xaa5b('0x12')](_0x185a5c));}switch(_0x50a68a[_0xaa5b('0xb')]){case'US':_0x332e6b=_0xaa5b('0x13');break;case'AU':_0x332e6b=_0xaa5b('0x14');break;case'IN':_0x332e6b=_0xaa5b('0x15');break;case'CN':_0x332e6b='https://accounts.zoho.com.cn';break;default:_0x332e6b=_0xaa5b('0x16');break;}var _0x35c0c8={'method':_0xaa5b('0x17'),'uri':_0x332e6b+_0xaa5b('0x18'),'form':{'grant_type':_0xaa5b('0x19'),'client_id':_0x50a68a[_0xaa5b('0xd')],'client_secret':_0x50a68a[_0xaa5b('0xe')],'redirect_uri':_0x50a68a[_0xaa5b('0xc')],'code':_0x50a68a[_0xaa5b('0x1a')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x35c0c8)['then'](function(_0x563cc1){var _0x4c2a98=JSON[_0xaa5b('0x1b')](_0x563cc1);if(_0x4c2a98[_0xaa5b('0x1c')]){_0x50a68a[_0xaa5b('0x1d')]=_0x4c2a98[_0xaa5b('0x1c')];logger[_0xaa5b('0x1e')](util[_0xaa5b('0x1f')](_0xaa5b('0x20'),_0x50a68a['name'],_0x50a68a['id']));}else{logger[_0xaa5b('0x21')](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x50a68a[_0xaa5b('0x22')],_0x50a68a['id']),util[_0xaa5b('0x23')](_0x4c2a98,{'showHidden':![],'depth':null}));}return _0x3bc279(null,_0x36ba0a);})[_0xaa5b('0x24')](function(_0x5f0b7e){logger['error'](util['format'](_0xaa5b('0x25'),_0x50a68a['name'],_0x50a68a['id']),util[_0xaa5b('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0x3bc279(_0x5f0b7e);});}else{return _0x3bc279(null,_0x36ba0a);}},'beforeUpdate':function(_0x523309,_0x2251bd,_0x39fa97){if(_0x523309[_0xaa5b('0xa')](_0xaa5b('0xb'))||_0x523309['changed'](_0xaa5b('0xc'))||_0x523309[_0xaa5b('0xa')](_0xaa5b('0xd'))||_0x523309[_0xaa5b('0xa')]('clientSecret')||_0x523309[_0xaa5b('0xa')](_0xaa5b('0x1a'))||_0x523309[_0xaa5b('0xa')](_0xaa5b('0xf'))){var _0x285db7,_0x3221c5;_0x285db7=_0x523309['serverUrl'];var _0x104f3f=_0x285db7[_0xaa5b('0x10')](-0x1);if(_0x104f3f==='/'||_0x104f3f==='\x5c'||_0x104f3f===':'){_0x285db7=_0x285db7[_0xaa5b('0x11')](0x0,_0x285db7[_0xaa5b('0x12')](_0x104f3f));}switch(_0x523309['zone']){case'US':_0x3221c5='https://accounts.zoho.com';break;case'AU':_0x3221c5=_0xaa5b('0x14');break;case'IN':_0x3221c5=_0xaa5b('0x15');break;case'CN':_0x3221c5=_0xaa5b('0x26');break;default:_0x3221c5=_0xaa5b('0x16');break;}var _0x41f5ed={'method':'POST','uri':_0x3221c5+'/oauth/v2/token','form':{'grant_type':'authorization_code','client_id':_0x523309[_0xaa5b('0xd')],'client_secret':_0x523309['clientSecret'],'redirect_uri':_0x523309['serverUrl'],'code':_0x523309[_0xaa5b('0x1a')]},'headers':{'Content-Type':_0xaa5b('0x27')}};return rp(_0x41f5ed)[_0xaa5b('0x28')](function(_0x433234){var _0x5bf5ad=JSON[_0xaa5b('0x1b')](_0x433234);if(_0x5bf5ad[_0xaa5b('0x1c')]){_0x523309[_0xaa5b('0x1d')]=_0x5bf5ad[_0xaa5b('0x1c')];logger[_0xaa5b('0x1e')](util[_0xaa5b('0x1f')](_0xaa5b('0x20'),_0x523309[_0xaa5b('0x22')],_0x523309['id']));}else{logger[_0xaa5b('0x21')](util[_0xaa5b('0x1f')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x523309[_0xaa5b('0x22')],_0x523309['id']),util[_0xaa5b('0x23')](_0x5bf5ad,{'showHidden':![],'depth':null}));}return _0x39fa97(null,_0x2251bd);})[_0xaa5b('0x24')](function(_0x463825){logger['error'](util[_0xaa5b('0x1f')](_0xaa5b('0x25'),_0x523309[_0xaa5b('0x22')],_0x523309['id']),util[_0xaa5b('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0x39fa97(_0x463825);});}else{return _0x39fa97(null,_0x2251bd);}}}});}; \ No newline at end of file +var _0xb1cf=['changed','serverUrl','clientId','code','host','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','clientSecret','application/x-www-form-urlencoded','parse','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','error','slice','substring','lastIndexOf','authorization_code','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts'];(function(_0xe9f194,_0x38afc5){var _0x2f30c0=function(_0x4088b2){while(--_0x4088b2){_0xe9f194['push'](_0xe9f194['shift']());}};_0x2f30c0(++_0x38afc5);}(_0xb1cf,0x1a1));var _0xfb1c=function(_0x39bf66,_0x35c96c){_0x39bf66=_0x39bf66-0x0;var _0x431030=_0xb1cf[_0x39bf66];return _0x431030;};'use strict';var _=require('lodash');var util=require(_0xfb1c('0x0'));var logger=require(_0xfb1c('0x1'))(_0xfb1c('0x2'));var moment=require('moment');var BPromise=require(_0xfb1c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfb1c('0x4'));var rimraf=require(_0xfb1c('0x5'));var config=require(_0xfb1c('0x6'));var attributes=require(_0xfb1c('0x7'));var integrations=require(_0xfb1c('0x8'));module[_0xfb1c('0x9')]=function(_0x3edb00,_0x17a2f6){return _0x3edb00[_0xfb1c('0xa')](_0xfb1c('0xb'),attributes,{'tableName':_0xfb1c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0xc015c8,_0x552e78,_0x300183){if(_0xc015c8[_0xfb1c('0xd')]('zone')||_0xc015c8[_0xfb1c('0xd')](_0xfb1c('0xe'))||_0xc015c8[_0xfb1c('0xd')](_0xfb1c('0xf'))||_0xc015c8[_0xfb1c('0xd')]('clientSecret')||_0xc015c8['changed'](_0xfb1c('0x10'))||_0xc015c8[_0xfb1c('0xd')](_0xfb1c('0x11'))){var _0x4a3674,_0x5d4d8c;_0x4a3674=_0xc015c8[_0xfb1c('0xe')];var _0xe902c1=_0x4a3674['slice'](-0x1);if(_0xe902c1==='/'||_0xe902c1==='\x5c'||_0xe902c1===':'){_0x4a3674=_0x4a3674['substring'](0x0,_0x4a3674['lastIndexOf'](_0xe902c1));}switch(_0xc015c8[_0xfb1c('0x12')]){case'US':_0x5d4d8c=_0xfb1c('0x13');break;case'AU':_0x5d4d8c=_0xfb1c('0x14');break;case'IN':_0x5d4d8c=_0xfb1c('0x15');break;case'CN':_0x5d4d8c=_0xfb1c('0x16');break;default:_0x5d4d8c=_0xfb1c('0x17');break;}var _0x201b1d={'method':_0xfb1c('0x18'),'uri':_0x5d4d8c+_0xfb1c('0x19'),'form':{'grant_type':'authorization_code','client_id':_0xc015c8['clientId'],'client_secret':_0xc015c8[_0xfb1c('0x1a')],'redirect_uri':_0xc015c8[_0xfb1c('0xe')],'code':_0xc015c8['code']},'headers':{'Content-Type':_0xfb1c('0x1b')}};return rp(_0x201b1d)['then'](function(_0x864970){var _0x3f3e18=JSON[_0xfb1c('0x1c')](_0x864970);if(_0x3f3e18[_0xfb1c('0x1d')]){_0xc015c8[_0xfb1c('0x1e')]=_0x3f3e18[_0xfb1c('0x1d')];logger[_0xfb1c('0x1f')](util[_0xfb1c('0x20')](_0xfb1c('0x21'),_0xc015c8[_0xfb1c('0x22')],_0xc015c8['id']));}else{logger['error'](util[_0xfb1c('0x20')](_0xfb1c('0x23'),_0xc015c8[_0xfb1c('0x22')],_0xc015c8['id']),util[_0xfb1c('0x24')](_0x3f3e18,{'showHidden':![],'depth':null}));}return _0x300183(null,_0x552e78);})[_0xfb1c('0x25')](function(_0x10085f){logger[_0xfb1c('0x26')](util[_0xfb1c('0x20')](_0xfb1c('0x23'),_0xc015c8[_0xfb1c('0x22')],_0xc015c8['id']),util[_0xfb1c('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x300183(_0x10085f);});}else{return _0x300183(null,_0x552e78);}},'beforeUpdate':function(_0x2f4547,_0x51fa12,_0x1cb98e){if(_0x2f4547[_0xfb1c('0xd')](_0xfb1c('0x12'))||_0x2f4547[_0xfb1c('0xd')](_0xfb1c('0xe'))||_0x2f4547[_0xfb1c('0xd')](_0xfb1c('0xf'))||_0x2f4547['changed'](_0xfb1c('0x1a'))||_0x2f4547[_0xfb1c('0xd')]('code')||_0x2f4547[_0xfb1c('0xd')]('host')){var _0x306fbd,_0x531bbe;_0x306fbd=_0x2f4547[_0xfb1c('0xe')];var _0x5ea70f=_0x306fbd[_0xfb1c('0x27')](-0x1);if(_0x5ea70f==='/'||_0x5ea70f==='\x5c'||_0x5ea70f===':'){_0x306fbd=_0x306fbd[_0xfb1c('0x28')](0x0,_0x306fbd[_0xfb1c('0x29')](_0x5ea70f));}switch(_0x2f4547[_0xfb1c('0x12')]){case'US':_0x531bbe=_0xfb1c('0x13');break;case'AU':_0x531bbe=_0xfb1c('0x14');break;case'IN':_0x531bbe=_0xfb1c('0x15');break;case'CN':_0x531bbe=_0xfb1c('0x16');break;default:_0x531bbe='https://accounts.zoho.eu';break;}var _0x2e1ec8={'method':_0xfb1c('0x18'),'uri':_0x531bbe+_0xfb1c('0x19'),'form':{'grant_type':_0xfb1c('0x2a'),'client_id':_0x2f4547[_0xfb1c('0xf')],'client_secret':_0x2f4547[_0xfb1c('0x1a')],'redirect_uri':_0x2f4547[_0xfb1c('0xe')],'code':_0x2f4547[_0xfb1c('0x10')]},'headers':{'Content-Type':_0xfb1c('0x1b')}};return rp(_0x2e1ec8)['then'](function(_0x3c34b6){var _0xda425c=JSON[_0xfb1c('0x1c')](_0x3c34b6);if(_0xda425c['refresh_token']){_0x2f4547[_0xfb1c('0x1e')]=_0xda425c[_0xfb1c('0x1d')];logger[_0xfb1c('0x1f')](util[_0xfb1c('0x20')](_0xfb1c('0x21'),_0x2f4547[_0xfb1c('0x22')],_0x2f4547['id']));}else{logger[_0xfb1c('0x26')](util['format'](_0xfb1c('0x23'),_0x2f4547[_0xfb1c('0x22')],_0x2f4547['id']),util[_0xfb1c('0x24')](_0xda425c,{'showHidden':![],'depth':null}));}return _0x1cb98e(null,_0x51fa12);})[_0xfb1c('0x25')](function(_0x5f0eb2){logger[_0xfb1c('0x26')](util[_0xfb1c('0x20')](_0xfb1c('0x23'),_0x2f4547[_0xfb1c('0x22')],_0x2f4547['id']),util[_0xfb1c('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x1cb98e(_0x5f0eb2);});}else{return _0x1cb98e(null,_0x51fa12);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index aaf4e6a..4bf2b23 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 _0xd1d3=['model','GetZohoAccount','ShowZohoAccount','find','raw','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','ZohoAccount','findAll','options','where','attributes','limit','include','map'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0xd1d3,0xd7));var _0x3d1d=function(_0x20759f,_0x3c9604){_0x20759f=_0x20759f-0x0;var _0x45fae7=_0xd1d3[_0x20759f];return _0x45fae7;};'use strict';var _=require(_0x3d1d('0x0'));var util=require('util');var moment=require(_0x3d1d('0x1'));var BPromise=require('bluebird');var rs=require(_0x3d1d('0x2'));var fs=require('fs');var Redis=require(_0x3d1d('0x3'));var db=require(_0x3d1d('0x4'))['db'];var utils=require(_0x3d1d('0x5'));var logger=require(_0x3d1d('0x6'))('rpc');var config=require(_0x3d1d('0x7'));var jayson=require(_0x3d1d('0x8'));var client=jayson['client'][_0x3d1d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4431f6,_0x57d7db,_0x160c87){return new BPromise(function(_0x70ca94,_0x7ba595){return client[_0x3d1d('0xa')](_0x4431f6,_0x160c87)[_0x3d1d('0xb')](function(_0x41e786){logger[_0x3d1d('0xc')](_0x3d1d('0xd'),_0x57d7db,_0x3d1d('0xe'));logger[_0x3d1d('0xf')](_0x3d1d('0x10'),_0x57d7db,_0x3d1d('0xe'),JSON[_0x3d1d('0x11')](_0x41e786));if(_0x41e786[_0x3d1d('0x12')]){if(_0x41e786[_0x3d1d('0x12')][_0x3d1d('0x13')]===0x1f4){logger[_0x3d1d('0x12')](_0x3d1d('0xd'),_0x57d7db,_0x41e786[_0x3d1d('0x12')]['message']);return _0x7ba595(_0x41e786[_0x3d1d('0x12')][_0x3d1d('0x14')]);}logger[_0x3d1d('0x12')](_0x3d1d('0xd'),_0x57d7db,_0x41e786[_0x3d1d('0x12')][_0x3d1d('0x14')]);return _0x70ca94(_0x41e786[_0x3d1d('0x12')][_0x3d1d('0x14')]);}else{logger['info'](_0x3d1d('0xd'),_0x57d7db,_0x3d1d('0xe'));_0x70ca94(_0x41e786['result']['message']);}})[_0x3d1d('0x15')](function(_0x2c9c51){logger[_0x3d1d('0x12')](_0x3d1d('0xd'),_0x57d7db,_0x2c9c51);_0x7ba595(_0x2c9c51);});});}exports['GetZohoAccount']=function(_0x1898ce){var _0x46bc02=this;return new Promise(function(_0x1f6035,_0x328374){return db[_0x3d1d('0x16')][_0x3d1d('0x17')]({'raw':_0x1898ce['options']?_0x1898ce['options']['raw']===undefined?!![]:![]:!![],'where':_0x1898ce[_0x3d1d('0x18')]?_0x1898ce[_0x3d1d('0x18')][_0x3d1d('0x19')]||null:null,'attributes':_0x1898ce[_0x3d1d('0x18')]?_0x1898ce[_0x3d1d('0x18')][_0x3d1d('0x1a')]||null:null,'limit':_0x1898ce[_0x3d1d('0x18')]?_0x1898ce[_0x3d1d('0x18')][_0x3d1d('0x1b')]||null:null,'include':_0x1898ce['options']?_0x1898ce[_0x3d1d('0x18')][_0x3d1d('0x1c')]?_[_0x3d1d('0x1d')](_0x1898ce[_0x3d1d('0x18')]['include'],function(_0x228735){return{'model':db[_0x228735[_0x3d1d('0x1e')]],'as':_0x228735['as'],'attributes':_0x228735[_0x3d1d('0x1a')],'include':_0x228735[_0x3d1d('0x1c')]?_[_0x3d1d('0x1d')](_0x228735['include'],function(_0xb56ae1){return{'model':db[_0xb56ae1[_0x3d1d('0x1e')]],'as':_0xb56ae1['as'],'attributes':_0xb56ae1[_0x3d1d('0x1a')],'include':_0xb56ae1[_0x3d1d('0x1c')]?_[_0x3d1d('0x1d')](_0xb56ae1[_0x3d1d('0x1c')],function(_0x49b800){return{'model':db[_0x49b800['model']],'as':_0x49b800['as'],'attributes':_0x49b800['attributes']};}):[]};}):[]};}):[]:[]})[_0x3d1d('0xb')](function(_0x2a983f){logger[_0x3d1d('0xc')](_0x3d1d('0x1f'),_0x1898ce);logger['debug']('GetZohoAccount',_0x1898ce,JSON[_0x3d1d('0x11')](_0x2a983f));_0x1f6035(_0x2a983f);})['catch'](function(_0x181d71){logger[_0x3d1d('0x12')](_0x3d1d('0x1f'),_0x181d71[_0x3d1d('0x14')],_0x1898ce);_0x328374(_0x46bc02[_0x3d1d('0x12')](0x1f4,_0x181d71[_0x3d1d('0x14')]));});});};exports[_0x3d1d('0x20')]=function(_0x635ca5){var _0x33bbed=this;return new Promise(function(_0x58b541,_0x1de5cf){return db[_0x3d1d('0x16')][_0x3d1d('0x21')]({'raw':_0x635ca5[_0x3d1d('0x18')]?_0x635ca5[_0x3d1d('0x18')][_0x3d1d('0x22')]===undefined?!![]:![]:!![],'where':_0x635ca5[_0x3d1d('0x18')]?_0x635ca5[_0x3d1d('0x18')]['where']||null:null,'attributes':_0x635ca5[_0x3d1d('0x18')]?_0x635ca5[_0x3d1d('0x18')][_0x3d1d('0x1a')]||null:null,'include':_0x635ca5[_0x3d1d('0x18')]?_0x635ca5[_0x3d1d('0x18')][_0x3d1d('0x1c')]?_[_0x3d1d('0x1d')](_0x635ca5[_0x3d1d('0x18')][_0x3d1d('0x1c')],function(_0xb65cbc){return{'model':db[_0xb65cbc['model']],'as':_0xb65cbc['as'],'attributes':_0xb65cbc[_0x3d1d('0x1a')],'include':_0xb65cbc[_0x3d1d('0x1c')]?_[_0x3d1d('0x1d')](_0xb65cbc[_0x3d1d('0x1c')],function(_0x183063){return{'model':db[_0x183063[_0x3d1d('0x1e')]],'as':_0x183063['as'],'attributes':_0x183063[_0x3d1d('0x1a')],'include':_0x183063[_0x3d1d('0x1c')]?_[_0x3d1d('0x1d')](_0x183063[_0x3d1d('0x1c')],function(_0x2f1362){return{'model':db[_0x2f1362[_0x3d1d('0x1e')]],'as':_0x2f1362['as'],'attributes':_0x2f1362['attributes']};}):[]};}):[]};}):[]:[]})[_0x3d1d('0xb')](function(_0x41c260){logger[_0x3d1d('0xc')]('ShowZohoAccount',_0x635ca5);logger[_0x3d1d('0xf')](_0x3d1d('0x20'),_0x635ca5,JSON[_0x3d1d('0x11')](_0x41c260));_0x58b541(_0x41c260);})['catch'](function(_0x4c9b95){logger[_0x3d1d('0x12')]('ShowZohoAccount',_0x4c9b95['message'],_0x635ca5);_0x1de5cf(_0x33bbed[_0x3d1d('0x12')](0x1f4,_0x4c9b95[_0x3d1d('0x14')]));});});}; \ No newline at end of file +var _0x202a=['http','request','then','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ZohoAccount','findAll','options','raw','where','attributes','limit','map','model','include','GetZohoAccount','ShowZohoAccount','find','util','moment','bluebird','ioredis','rpc','../../config/environment'];(function(_0x587344,_0xca701c){var _0x59b7a8=function(_0x30958f){while(--_0x30958f){_0x587344['push'](_0x587344['shift']());}};_0x59b7a8(++_0xca701c);}(_0x202a,0xc0));var _0xa202=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x202a[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0xa202('0x0'));var moment=require(_0xa202('0x1'));var BPromise=require(_0xa202('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa202('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa202('0x4'));var config=require(_0xa202('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa202('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x4cb469,_0x4f0a59,_0x4d8dcc){return new BPromise(function(_0x216b4c,_0xcd59fb){return client[_0xa202('0x7')](_0x4cb469,_0x4d8dcc)[_0xa202('0x8')](function(_0x572036){logger['info'](_0xa202('0x9'),_0x4f0a59,_0xa202('0xa'));logger[_0xa202('0xb')](_0xa202('0xc'),_0x4f0a59,'request\x20sent',JSON[_0xa202('0xd')](_0x572036));if(_0x572036['error']){if(_0x572036[_0xa202('0xe')][_0xa202('0xf')]===0x1f4){logger[_0xa202('0xe')]('ZohoAccount,\x20%s,\x20%s',_0x4f0a59,_0x572036[_0xa202('0xe')][_0xa202('0x10')]);return _0xcd59fb(_0x572036[_0xa202('0xe')][_0xa202('0x10')]);}logger[_0xa202('0xe')](_0xa202('0x9'),_0x4f0a59,_0x572036['error'][_0xa202('0x10')]);return _0x216b4c(_0x572036[_0xa202('0xe')][_0xa202('0x10')]);}else{logger[_0xa202('0x11')](_0xa202('0x9'),_0x4f0a59,'request\x20sent');_0x216b4c(_0x572036[_0xa202('0x12')][_0xa202('0x10')]);}})[_0xa202('0x13')](function(_0x3fcc66){logger[_0xa202('0xe')](_0xa202('0x9'),_0x4f0a59,_0x3fcc66);_0xcd59fb(_0x3fcc66);});});}exports['GetZohoAccount']=function(_0x44a1b6){var _0x53ff78=this;return new Promise(function(_0x130df2,_0x55d39b){return db[_0xa202('0x14')][_0xa202('0x15')]({'raw':_0x44a1b6[_0xa202('0x16')]?_0x44a1b6[_0xa202('0x16')][_0xa202('0x17')]===undefined?!![]:![]:!![],'where':_0x44a1b6['options']?_0x44a1b6[_0xa202('0x16')][_0xa202('0x18')]||null:null,'attributes':_0x44a1b6[_0xa202('0x16')]?_0x44a1b6[_0xa202('0x16')][_0xa202('0x19')]||null:null,'limit':_0x44a1b6['options']?_0x44a1b6[_0xa202('0x16')][_0xa202('0x1a')]||null:null,'include':_0x44a1b6[_0xa202('0x16')]?_0x44a1b6[_0xa202('0x16')]['include']?_[_0xa202('0x1b')](_0x44a1b6[_0xa202('0x16')]['include'],function(_0x565685){return{'model':db[_0x565685[_0xa202('0x1c')]],'as':_0x565685['as'],'attributes':_0x565685[_0xa202('0x19')],'include':_0x565685['include']?_[_0xa202('0x1b')](_0x565685['include'],function(_0x5373b6){return{'model':db[_0x5373b6[_0xa202('0x1c')]],'as':_0x5373b6['as'],'attributes':_0x5373b6[_0xa202('0x19')],'include':_0x5373b6[_0xa202('0x1d')]?_[_0xa202('0x1b')](_0x5373b6[_0xa202('0x1d')],function(_0x1d6704){return{'model':db[_0x1d6704['model']],'as':_0x1d6704['as'],'attributes':_0x1d6704['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4d33fe){logger[_0xa202('0x11')](_0xa202('0x1e'),_0x44a1b6);logger[_0xa202('0xb')]('GetZohoAccount',_0x44a1b6,JSON[_0xa202('0xd')](_0x4d33fe));_0x130df2(_0x4d33fe);})[_0xa202('0x13')](function(_0xf73ab4){logger[_0xa202('0xe')](_0xa202('0x1e'),_0xf73ab4[_0xa202('0x10')],_0x44a1b6);_0x55d39b(_0x53ff78[_0xa202('0xe')](0x1f4,_0xf73ab4[_0xa202('0x10')]));});});};exports[_0xa202('0x1f')]=function(_0x106b89){var _0x213749=this;return new Promise(function(_0x144afd,_0xb0fda6){return db[_0xa202('0x14')][_0xa202('0x20')]({'raw':_0x106b89[_0xa202('0x16')]?_0x106b89['options'][_0xa202('0x17')]===undefined?!![]:![]:!![],'where':_0x106b89[_0xa202('0x16')]?_0x106b89[_0xa202('0x16')][_0xa202('0x18')]||null:null,'attributes':_0x106b89[_0xa202('0x16')]?_0x106b89[_0xa202('0x16')]['attributes']||null:null,'include':_0x106b89[_0xa202('0x16')]?_0x106b89[_0xa202('0x16')]['include']?_[_0xa202('0x1b')](_0x106b89[_0xa202('0x16')]['include'],function(_0x4c6830){return{'model':db[_0x4c6830['model']],'as':_0x4c6830['as'],'attributes':_0x4c6830[_0xa202('0x19')],'include':_0x4c6830[_0xa202('0x1d')]?_[_0xa202('0x1b')](_0x4c6830[_0xa202('0x1d')],function(_0x2c158c){return{'model':db[_0x2c158c['model']],'as':_0x2c158c['as'],'attributes':_0x2c158c[_0xa202('0x19')],'include':_0x2c158c['include']?_[_0xa202('0x1b')](_0x2c158c[_0xa202('0x1d')],function(_0x130806){return{'model':db[_0x130806['model']],'as':_0x130806['as'],'attributes':_0x130806[_0xa202('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5ebac8){logger[_0xa202('0x11')](_0xa202('0x1f'),_0x106b89);logger['debug'](_0xa202('0x1f'),_0x106b89,JSON['stringify'](_0x5ebac8));_0x144afd(_0x5ebac8);})['catch'](function(_0x20369c){logger[_0xa202('0xe')]('ShowZohoAccount',_0x20369c[_0xa202('0x10')],_0x106b89);_0xb0fda6(_0x213749[_0xa202('0xe')](0x1f4,_0x20369c[_0xa202('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 0352a02..7b1d851 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 _0x279e=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','/:id','isAuthenticated','show','getFields','getSubjects','/:id/descriptions','getDescriptions','post','create','update','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x279e,0xd5));var _0xe279=function(_0x44a755,_0xa965d){_0x44a755=_0x44a755-0x0;var _0x506d0a=_0x279e[_0x44a755];return _0x506d0a;};'use strict';var multer=require(_0xe279('0x0'));var util=require(_0xe279('0x1'));var path=require('path');var timeout=require(_0xe279('0x2'));var express=require(_0xe279('0x3'));var router=express[_0xe279('0x4')]();var fs_extra=require(_0xe279('0x5'));var auth=require(_0xe279('0x6'));var interaction=require(_0xe279('0x7'));var config=require(_0xe279('0x8'));var controller=require(_0xe279('0x9'));router[_0xe279('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe279('0xa')](_0xe279('0xb'),auth[_0xe279('0xc')](),controller[_0xe279('0xd')]);router[_0xe279('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0xe279('0xe')]);router['get']('/:id/subjects',auth['isAuthenticated'](),controller[_0xe279('0xf')]);router['get'](_0xe279('0x10'),auth[_0xe279('0xc')](),controller[_0xe279('0x11')]);router[_0xe279('0x12')]('/',auth['isAuthenticated'](),controller[_0xe279('0x13')]);router['put'](_0xe279('0xb'),auth['isAuthenticated'](),controller[_0xe279('0x14')]);router[_0xe279('0x15')]('/:id',auth[_0xe279('0xc')](),controller[_0xe279('0x16')]);module[_0xe279('0x17')]=router; \ No newline at end of file +var _0x70dc=['destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','post','create','put','update','delete'];(function(_0x10479a,_0x4fae3d){var _0x57b2fc=function(_0x532141){while(--_0x532141){_0x10479a['push'](_0x10479a['shift']());}};_0x57b2fc(++_0x4fae3d);}(_0x70dc,0x15f));var _0xc70d=function(_0x3ae6b4,_0x2462fe){_0x3ae6b4=_0x3ae6b4-0x0;var _0x2df21b=_0x70dc[_0x3ae6b4];return _0x2df21b;};'use strict';var multer=require(_0xc70d('0x0'));var util=require(_0xc70d('0x1'));var path=require(_0xc70d('0x2'));var timeout=require(_0xc70d('0x3'));var express=require(_0xc70d('0x4'));var router=express[_0xc70d('0x5')]();var fs_extra=require(_0xc70d('0x6'));var auth=require(_0xc70d('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xc70d('0x8'));var controller=require('./intZohoConfiguration.controller');router['get']('/',auth[_0xc70d('0x9')](),controller[_0xc70d('0xa')]);router[_0xc70d('0xb')](_0xc70d('0xc'),auth[_0xc70d('0x9')](),controller[_0xc70d('0xd')]);router[_0xc70d('0xb')](_0xc70d('0xe'),auth[_0xc70d('0x9')](),controller[_0xc70d('0xf')]);router[_0xc70d('0xb')](_0xc70d('0x10'),auth[_0xc70d('0x9')](),controller[_0xc70d('0x11')]);router[_0xc70d('0xb')]('/:id/descriptions',auth[_0xc70d('0x9')](),controller[_0xc70d('0x12')]);router[_0xc70d('0x13')]('/',auth[_0xc70d('0x9')](),controller[_0xc70d('0x14')]);router[_0xc70d('0x15')](_0xc70d('0xc'),auth[_0xc70d('0x9')](),controller[_0xc70d('0x16')]);router[_0xc70d('0x17')](_0xc70d('0xc'),auth[_0xc70d('0x9')](),controller[_0xc70d('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 4a6eba2..0c26a95 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 _0x89f2=['ENUM','contact_lead','exports','STRING','lead','contact','nothing'];(function(_0x1fcf1b,_0x214549){var _0x5d2952=function(_0x3331b7){while(--_0x3331b7){_0x1fcf1b['push'](_0x1fcf1b['shift']());}};_0x5d2952(++_0x214549);}(_0x89f2,0x1e5));var _0x289f=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0x89f2[_0x4b7b62];return _0x2280df;};'use strict';var Sequelize=require('sequelize');module[_0x289f('0x0')]={'name':{'type':Sequelize[_0x289f('0x1')]},'moduleCreate':{'type':Sequelize['ENUM'](_0x289f('0x2'),_0x289f('0x3'),_0x289f('0x4')),'defaultValue':_0x289f('0x2')},'moduleSearch':{'type':Sequelize[_0x289f('0x5')](_0x289f('0x6'),'contact',_0x289f('0x2')),'defaultValue':_0x289f('0x6')},'description':{'type':Sequelize[_0x289f('0x1')]}}; \ No newline at end of file +var _0xa1aa=['nothing','STRING','ENUM','lead','contact'];(function(_0x5941a9,_0x5a5caa){var _0x4f8499=function(_0x462127){while(--_0x462127){_0x5941a9['push'](_0x5941a9['shift']());}};_0x4f8499(++_0x5a5caa);}(_0xa1aa,0x88));var _0xaa1a=function(_0x7149f7,_0x42c603){_0x7149f7=_0x7149f7-0x0;var _0x258584=_0xa1aa[_0x7149f7];return _0x258584;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xaa1a('0x0')]},'moduleCreate':{'type':Sequelize[_0xaa1a('0x1')](_0xaa1a('0x2'),_0xaa1a('0x3'),_0xaa1a('0x4')),'defaultValue':_0xaa1a('0x2')},'moduleSearch':{'type':Sequelize[_0xaa1a('0x1')]('contact_lead',_0xaa1a('0x3'),_0xaa1a('0x2')),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0xaa1a('0x0')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index db34729..f759975 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 _0x3e77=['pick','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','length','find','create','update','body','params','getFields','order','filter','findOne','ZohoField','rawAttributes','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','then','destroy','error','name','index','map','ZohoConfiguration','fieldName','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where'];(function(_0x944a91,_0xb69c6f){var _0x3afbe3=function(_0x3a483d){while(--_0x3a483d){_0x944a91['push'](_0x944a91['shift']());}};_0x3afbe3(++_0xb69c6f);}(_0x3e77,0x1f2));var _0x73e7=function(_0x250669,_0xb15e88){_0x250669=_0x250669-0x0;var _0x131447=_0x3e77[_0x250669];return _0x131447;};'use strict';var emlformat=require(_0x73e7('0x0'));var rimraf=require(_0x73e7('0x1'));var zipdir=require(_0x73e7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x73e7('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x73e7('0x4'));var util=require(_0x73e7('0x5'));var path=require(_0x73e7('0x6'));var sox=require(_0x73e7('0x7'));var csv=require(_0x73e7('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x73e7('0x9'));var _=require(_0x73e7('0xa'));var squel=require('squel');var crypto=require(_0x73e7('0xb'));var jsforce=require(_0x73e7('0xc'));var deskjs=require(_0x73e7('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x73e7('0xe'));var Redis=require('ioredis');var authService=require(_0x73e7('0xf'));var qs=require(_0x73e7('0x10'));var as=require(_0x73e7('0x11'));var hardwareService=require(_0x73e7('0x12'));var logger=require(_0x73e7('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x73e7('0x14'));var licenseUtil=require(_0x73e7('0x15'));var db=require(_0x73e7('0x16'))['db'];function respondWithStatusCode(_0x42fea4,_0x2f2b48){_0x2f2b48=_0x2f2b48||0xcc;return function(_0x227acf){if(_0x227acf){return _0x42fea4[_0x73e7('0x17')](_0x2f2b48);}return _0x42fea4['status'](_0x2f2b48)[_0x73e7('0x18')]();};}function respondWithResult(_0x2df76a,_0x21066d){_0x21066d=_0x21066d||0xc8;return function(_0x103722){if(_0x103722){return _0x2df76a[_0x73e7('0x19')](_0x21066d)[_0x73e7('0x1a')](_0x103722);}};}function respondWithFilteredResult(_0x399791,_0x39fce9){return function(_0x1a769c){if(_0x1a769c){var _0x5815be=typeof _0x39fce9[_0x73e7('0x1b')]==='undefined'&&typeof _0x39fce9[_0x73e7('0x1c')]===_0x73e7('0x1d');var _0x50e791=_0x1a769c[_0x73e7('0x1e')];var _0x1bf8de=_0x5815be?0x0:_0x39fce9[_0x73e7('0x1b')];var _0x12cdd4=_0x5815be?_0x1a769c[_0x73e7('0x1e')]:_0x39fce9[_0x73e7('0x1b')]+_0x39fce9['limit'];var _0x52e611;if(_0x12cdd4>=_0x50e791){_0x12cdd4=_0x50e791;_0x52e611=0xc8;}else{_0x52e611=0xce;}_0x399791[_0x73e7('0x19')](_0x52e611);return _0x399791[_0x73e7('0x1f')](_0x73e7('0x20'),_0x1bf8de+'-'+_0x12cdd4+'/'+_0x50e791)[_0x73e7('0x1a')](_0x1a769c);}return null;};}function patchUpdates(_0x2989e2){return function(_0x4e49e8){try{jsonpatch[_0x73e7('0x21')](_0x4e49e8,_0x2989e2,!![]);}catch(_0x50ba2d){return BPromise[_0x73e7('0x22')](_0x50ba2d);}return _0x4e49e8['save']();};}function saveUpdates(_0x1133bb,_0x2600e5){return function(_0x10b921){if(_0x10b921){return _0x10b921['update'](_0x1133bb)[_0x73e7('0x23')](function(_0x4035cb){return _0x4035cb;});}return null;};}function removeEntity(_0x4699c8,_0x292eec){return function(_0x3e312a){if(_0x3e312a){return _0x3e312a[_0x73e7('0x24')]()[_0x73e7('0x23')](function(){_0x4699c8[_0x73e7('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x11b22a,_0x3baec0){return function(_0x53bf55){if(!_0x53bf55){_0x11b22a['sendStatus'](0x194);}return _0x53bf55;};}function handleError(_0x2bc2f0,_0x434f7f){_0x434f7f=_0x434f7f||0x1f4;return function(_0x4d569b){logger[_0x73e7('0x25')](_0x4d569b['stack']);if(_0x4d569b['name']){delete _0x4d569b[_0x73e7('0x26')];}_0x2bc2f0[_0x73e7('0x19')](_0x434f7f)['send'](_0x4d569b);};}exports[_0x73e7('0x27')]=function(_0x584faf,_0x4b1915){var _0x333172={},_0x594b24={},_0x2b4f7b={'count':0x0,'rows':[]};var _0x1cb422=_[_0x73e7('0x28')](db[_0x73e7('0x29')]['rawAttributes'],function(_0x41842d){return{'name':_0x41842d[_0x73e7('0x2a')],'type':_0x41842d['type'][_0x73e7('0x2b')]};});_0x594b24['model']=_[_0x73e7('0x28')](_0x1cb422,_0x73e7('0x26'));_0x594b24[_0x73e7('0x2c')]=_[_0x73e7('0x2d')](_0x584faf['query']);_0x594b24[_0x73e7('0x2e')]=_[_0x73e7('0x2f')](_0x594b24[_0x73e7('0x30')],_0x594b24[_0x73e7('0x2c')]);_0x333172[_0x73e7('0x31')]=_[_0x73e7('0x2f')](_0x594b24['model'],qs[_0x73e7('0x32')](_0x584faf['query'][_0x73e7('0x32')]));_0x333172[_0x73e7('0x31')]=_0x333172[_0x73e7('0x31')]['length']?_0x333172['attributes']:_0x594b24['model'];if(!_0x584faf[_0x73e7('0x2c')][_0x73e7('0x33')](_0x73e7('0x34'))){_0x333172['limit']=qs[_0x73e7('0x1c')](_0x584faf['query'][_0x73e7('0x1c')]);_0x333172[_0x73e7('0x1b')]=qs[_0x73e7('0x1b')](_0x584faf[_0x73e7('0x2c')][_0x73e7('0x1b')]);}_0x333172['order']=qs[_0x73e7('0x35')](_0x584faf[_0x73e7('0x2c')][_0x73e7('0x35')]);_0x333172[_0x73e7('0x36')]=qs[_0x73e7('0x2e')](_[_0x73e7('0x37')](_0x584faf[_0x73e7('0x2c')],_0x594b24['filters']),_0x1cb422);if(_0x584faf[_0x73e7('0x2c')]['filter']){_0x333172[_0x73e7('0x36')]=_[_0x73e7('0x38')](_0x333172[_0x73e7('0x36')],{'$or':_[_0x73e7('0x28')](_0x1cb422,function(_0x4823cc){if(_0x4823cc[_0x73e7('0x39')]!==_0x73e7('0x3a')){var _0x37b78f={};_0x37b78f[_0x4823cc[_0x73e7('0x26')]]={'$like':'%'+_0x584faf[_0x73e7('0x2c')]['filter']+'%'};return _0x37b78f;}})});}_0x333172=_[_0x73e7('0x38')]({},_0x333172,_0x584faf[_0x73e7('0x3b')]);var _0x5cc818={'where':_0x333172[_0x73e7('0x36')]};return db['ZohoConfiguration'][_0x73e7('0x1e')](_0x5cc818)[_0x73e7('0x23')](function(_0x497022){_0x2b4f7b['count']=_0x497022;if(_0x584faf['query'][_0x73e7('0x3c')]){_0x333172[_0x73e7('0x3d')]=[{'all':!![]}];}return db[_0x73e7('0x29')]['findAll'](_0x333172);})[_0x73e7('0x23')](function(_0x5ac11c){_0x2b4f7b[_0x73e7('0x3e')]=_0x5ac11c;return _0x2b4f7b;})[_0x73e7('0x23')](respondWithFilteredResult(_0x4b1915,_0x333172))[_0x73e7('0x3f')](handleError(_0x4b1915,null));};exports[_0x73e7('0x40')]=function(_0x51cf17,_0x31a896){var _0x857c54={'raw':![],'where':{'id':_0x51cf17['params']['id']}},_0x2b7ed3={};_0x2b7ed3[_0x73e7('0x30')]=_['keys'](db[_0x73e7('0x29')]['rawAttributes']);_0x2b7ed3[_0x73e7('0x2c')]=_['keys'](_0x51cf17[_0x73e7('0x2c')]);_0x2b7ed3[_0x73e7('0x2e')]=_[_0x73e7('0x2f')](_0x2b7ed3[_0x73e7('0x30')],_0x2b7ed3['query']);_0x857c54[_0x73e7('0x31')]=_[_0x73e7('0x2f')](_0x2b7ed3[_0x73e7('0x30')],qs[_0x73e7('0x32')](_0x51cf17[_0x73e7('0x2c')][_0x73e7('0x32')]));_0x857c54[_0x73e7('0x31')]=_0x857c54[_0x73e7('0x31')][_0x73e7('0x41')]?_0x857c54[_0x73e7('0x31')]:_0x2b7ed3[_0x73e7('0x30')];if(_0x51cf17['query'][_0x73e7('0x3c')]){_0x857c54[_0x73e7('0x3d')]=[{'all':!![]}];}_0x857c54=_[_0x73e7('0x38')]({},_0x857c54,_0x51cf17[_0x73e7('0x3b')]);return db[_0x73e7('0x29')][_0x73e7('0x42')](_0x857c54)[_0x73e7('0x23')](handleEntityNotFound(_0x31a896,null))[_0x73e7('0x23')](respondWithResult(_0x31a896,null))[_0x73e7('0x3f')](handleError(_0x31a896,null));};exports[_0x73e7('0x43')]=function(_0x51f68f,_0x25028d){return db['ZohoConfiguration'][_0x73e7('0x43')](_0x51f68f['body'],{})[_0x73e7('0x23')](respondWithResult(_0x25028d,0xc9))['catch'](handleError(_0x25028d,null));};exports[_0x73e7('0x44')]=function(_0x3a04f6,_0x34f7fe){if(_0x3a04f6[_0x73e7('0x45')]['id']){delete _0x3a04f6['body']['id'];}return db['ZohoConfiguration'][_0x73e7('0x42')]({'where':{'id':_0x3a04f6[_0x73e7('0x46')]['id']}})[_0x73e7('0x23')](handleEntityNotFound(_0x34f7fe,null))['then'](saveUpdates(_0x3a04f6[_0x73e7('0x45')],null))[_0x73e7('0x23')](respondWithResult(_0x34f7fe,null))[_0x73e7('0x3f')](handleError(_0x34f7fe,null));};exports[_0x73e7('0x24')]=function(_0xca6577,_0x491818){return db[_0x73e7('0x29')]['find']({'where':{'id':_0xca6577[_0x73e7('0x46')]['id']}})[_0x73e7('0x23')](handleEntityNotFound(_0x491818,null))['then'](removeEntity(_0x491818,null))[_0x73e7('0x3f')](handleError(_0x491818,null));};exports[_0x73e7('0x47')]=function(_0x1c8711,_0x43ff4c,_0x3dc13a){var _0xe49f94={};var _0x4afdf3={};var _0x393f1e;var _0x3dbbc5;return db['ZohoConfiguration']['findOne']({'where':{'id':_0x1c8711[_0x73e7('0x46')]['id']}})['then'](handleEntityNotFound(_0x43ff4c,null))[_0x73e7('0x23')](function(_0x5961c3){if(_0x5961c3){_0x393f1e=_0x5961c3;_0x4afdf3[_0x73e7('0x30')]=_[_0x73e7('0x2d')](db['ZohoField']['rawAttributes']);_0x4afdf3[_0x73e7('0x2c')]=_[_0x73e7('0x2d')](_0x1c8711[_0x73e7('0x2c')]);_0x4afdf3[_0x73e7('0x2e')]=_[_0x73e7('0x2f')](_0x4afdf3['model'],_0x4afdf3[_0x73e7('0x2c')]);_0xe49f94[_0x73e7('0x31')]=_['intersection'](_0x4afdf3[_0x73e7('0x30')],qs[_0x73e7('0x32')](_0x1c8711[_0x73e7('0x2c')]['fields']));_0xe49f94[_0x73e7('0x31')]=_0xe49f94[_0x73e7('0x31')][_0x73e7('0x41')]?_0xe49f94[_0x73e7('0x31')]:_0x4afdf3[_0x73e7('0x30')];_0xe49f94[_0x73e7('0x48')]=qs[_0x73e7('0x35')](_0x1c8711[_0x73e7('0x2c')][_0x73e7('0x35')]);_0xe49f94[_0x73e7('0x36')]=qs[_0x73e7('0x2e')](_[_0x73e7('0x37')](_0x1c8711[_0x73e7('0x2c')],_0x4afdf3[_0x73e7('0x2e')]));if(_0x1c8711['query'][_0x73e7('0x49')]){_0xe49f94[_0x73e7('0x36')]=_[_0x73e7('0x38')](_0xe49f94['where'],{'$or':_[_0x73e7('0x28')](_0xe49f94[_0x73e7('0x31')],function(_0x499700){var _0x51033c={};_0x51033c[_0x499700]={'$like':'%'+_0x1c8711[_0x73e7('0x2c')][_0x73e7('0x49')]+'%'};return _0x51033c;})});}_0xe49f94=_[_0x73e7('0x38')]({},_0xe49f94,_0x1c8711['options']);return _0x393f1e[_0x73e7('0x47')](_0xe49f94);}})[_0x73e7('0x23')](function(_0x1f07ca){if(_0x1f07ca){_0x3dbbc5=_0x1f07ca[_0x73e7('0x41')];if(!_0x1c8711[_0x73e7('0x2c')]['hasOwnProperty'](_0x73e7('0x34'))){_0xe49f94['limit']=qs['limit'](_0x1c8711[_0x73e7('0x2c')][_0x73e7('0x1c')]);_0xe49f94[_0x73e7('0x1b')]=qs[_0x73e7('0x1b')](_0x1c8711[_0x73e7('0x2c')][_0x73e7('0x1b')]);}return _0x393f1e[_0x73e7('0x47')](_0xe49f94);}})[_0x73e7('0x23')](function(_0x325d00){if(_0x325d00){return _0x325d00?{'count':_0x3dbbc5,'rows':_0x325d00}:null;}})[_0x73e7('0x23')](respondWithResult(_0x43ff4c,null))[_0x73e7('0x3f')](handleError(_0x43ff4c,null));};exports['getSubjects']=function(_0x59d0e6,_0x13c822,_0x5292b9){var _0x157a75={};var _0x31b545={};var _0x397528;var _0x52f674;return db[_0x73e7('0x29')][_0x73e7('0x4a')]({'where':{'id':_0x59d0e6[_0x73e7('0x46')]['id']}})[_0x73e7('0x23')](handleEntityNotFound(_0x13c822,null))['then'](function(_0x1f6a38){if(_0x1f6a38){_0x397528=_0x1f6a38;_0x31b545[_0x73e7('0x30')]=_[_0x73e7('0x2d')](db[_0x73e7('0x4b')][_0x73e7('0x4c')]);_0x31b545[_0x73e7('0x2c')]=_[_0x73e7('0x2d')](_0x59d0e6['query']);_0x31b545[_0x73e7('0x2e')]=_[_0x73e7('0x2f')](_0x31b545[_0x73e7('0x30')],_0x31b545[_0x73e7('0x2c')]);_0x157a75['attributes']=_[_0x73e7('0x2f')](_0x31b545['model'],qs[_0x73e7('0x32')](_0x59d0e6[_0x73e7('0x2c')][_0x73e7('0x32')]));_0x157a75[_0x73e7('0x31')]=_0x157a75[_0x73e7('0x31')][_0x73e7('0x41')]?_0x157a75[_0x73e7('0x31')]:_0x31b545[_0x73e7('0x30')];_0x157a75[_0x73e7('0x48')]=qs[_0x73e7('0x35')](_0x59d0e6[_0x73e7('0x2c')][_0x73e7('0x35')]);_0x157a75[_0x73e7('0x36')]=qs[_0x73e7('0x2e')](_[_0x73e7('0x37')](_0x59d0e6['query'],_0x31b545[_0x73e7('0x2e')]));if(_0x59d0e6['query']['filter']){_0x157a75[_0x73e7('0x36')]=_[_0x73e7('0x38')](_0x157a75['where'],{'$or':_['map'](_0x157a75['attributes'],function(_0x1f1ed8){var _0x1f5119={};_0x1f5119[_0x1f1ed8]={'$like':'%'+_0x59d0e6[_0x73e7('0x2c')][_0x73e7('0x49')]+'%'};return _0x1f5119;})});}_0x157a75=_[_0x73e7('0x38')]({},_0x157a75,_0x59d0e6[_0x73e7('0x3b')]);return _0x397528[_0x73e7('0x4d')](_0x157a75);}})['then'](function(_0x1704a3){if(_0x1704a3){_0x52f674=_0x1704a3[_0x73e7('0x41')];if(!_0x59d0e6['query']['hasOwnProperty'](_0x73e7('0x34'))){_0x157a75['limit']=qs[_0x73e7('0x1c')](_0x59d0e6[_0x73e7('0x2c')][_0x73e7('0x1c')]);_0x157a75[_0x73e7('0x1b')]=qs[_0x73e7('0x1b')](_0x59d0e6[_0x73e7('0x2c')][_0x73e7('0x1b')]);}return _0x397528['getSubjects'](_0x157a75);}})['then'](function(_0x768911){if(_0x768911){return _0x768911?{'count':_0x52f674,'rows':_0x768911}:null;}})[_0x73e7('0x23')](respondWithResult(_0x13c822,null))[_0x73e7('0x3f')](handleError(_0x13c822,null));};exports[_0x73e7('0x4e')]=function(_0x24555d,_0x28944b,_0x45b6ce){var _0x3be8a7={};var _0x514b7c={};var _0x1e8752;var _0x2a68dd;return db[_0x73e7('0x29')][_0x73e7('0x4a')]({'where':{'id':_0x24555d[_0x73e7('0x46')]['id']}})['then'](handleEntityNotFound(_0x28944b,null))['then'](function(_0x4d47e5){if(_0x4d47e5){_0x1e8752=_0x4d47e5;_0x514b7c['model']=_[_0x73e7('0x2d')](db['ZohoField'][_0x73e7('0x4c')]);_0x514b7c['query']=_['keys'](_0x24555d[_0x73e7('0x2c')]);_0x514b7c[_0x73e7('0x2e')]=_['intersection'](_0x514b7c[_0x73e7('0x30')],_0x514b7c[_0x73e7('0x2c')]);_0x3be8a7[_0x73e7('0x31')]=_['intersection'](_0x514b7c[_0x73e7('0x30')],qs['fields'](_0x24555d[_0x73e7('0x2c')]['fields']));_0x3be8a7[_0x73e7('0x31')]=_0x3be8a7[_0x73e7('0x31')][_0x73e7('0x41')]?_0x3be8a7[_0x73e7('0x31')]:_0x514b7c[_0x73e7('0x30')];_0x3be8a7['order']=qs[_0x73e7('0x35')](_0x24555d[_0x73e7('0x2c')][_0x73e7('0x35')]);_0x3be8a7[_0x73e7('0x36')]=qs['filters'](_[_0x73e7('0x37')](_0x24555d['query'],_0x514b7c['filters']));if(_0x24555d['query'][_0x73e7('0x49')]){_0x3be8a7['where']=_['merge'](_0x3be8a7[_0x73e7('0x36')],{'$or':_[_0x73e7('0x28')](_0x3be8a7[_0x73e7('0x31')],function(_0x3b1961){var _0x206496={};_0x206496[_0x3b1961]={'$like':'%'+_0x24555d['query'][_0x73e7('0x49')]+'%'};return _0x206496;})});}_0x3be8a7=_[_0x73e7('0x38')]({},_0x3be8a7,_0x24555d['options']);return _0x1e8752[_0x73e7('0x4e')](_0x3be8a7);}})[_0x73e7('0x23')](function(_0x163a66){if(_0x163a66){_0x2a68dd=_0x163a66[_0x73e7('0x41')];if(!_0x24555d['query'][_0x73e7('0x33')]('nolimit')){_0x3be8a7[_0x73e7('0x1c')]=qs[_0x73e7('0x1c')](_0x24555d[_0x73e7('0x2c')][_0x73e7('0x1c')]);_0x3be8a7[_0x73e7('0x1b')]=qs[_0x73e7('0x1b')](_0x24555d['query'][_0x73e7('0x1b')]);}return _0x1e8752[_0x73e7('0x4e')](_0x3be8a7);}})[_0x73e7('0x23')](function(_0x1ecf9c){if(_0x1ecf9c){return _0x1ecf9c?{'count':_0x2a68dd,'rows':_0x1ecf9c}:null;}})['then'](respondWithResult(_0x28944b,null))[_0x73e7('0x3f')](handleError(_0x28944b,null));}; \ No newline at end of file +var _0x1d6f=['save','update','then','destroy','end','error','stack','name','index','ZohoConfiguration','rawAttributes','type','key','map','query','keys','filters','intersection','model','attributes','fields','order','sort','where','pick','merge','VIRTUAL','filter','include','findAll','rows','catch','params','length','options','find','create','body','getFields','findOne','ZohoField','hasOwnProperty','nolimit','getSubjects','getDescriptions','eml-format','rimraf','request-promise','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject'];(function(_0x40001a,_0x57f2ae){var _0x4cec45=function(_0x5e4166){while(--_0x5e4166){_0x40001a['push'](_0x40001a['shift']());}};_0x4cec45(++_0x57f2ae);}(_0x1d6f,0x1b8));var _0xf1d6=function(_0x120fea,_0x28f524){_0x120fea=_0x120fea-0x0;var _0x44e4d4=_0x1d6f[_0x120fea];return _0x44e4d4;};'use strict';var emlformat=require(_0xf1d6('0x0'));var rimraf=require(_0xf1d6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf1d6('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf1d6('0x3'));var util=require(_0xf1d6('0x4'));var path=require(_0xf1d6('0x5'));var sox=require('sox');var csv=require(_0xf1d6('0x6'));var ejs=require(_0xf1d6('0x7'));var fs=require('fs');var fs_extra=require(_0xf1d6('0x8'));var _=require(_0xf1d6('0x9'));var squel=require(_0xf1d6('0xa'));var crypto=require(_0xf1d6('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xf1d6('0xc'));var toCsv=require(_0xf1d6('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf1d6('0xd'));var authService=require(_0xf1d6('0xe'));var qs=require(_0xf1d6('0xf'));var as=require(_0xf1d6('0x10'));var hardwareService=require(_0xf1d6('0x11'));var logger=require('../../config/logger')(_0xf1d6('0x12'));var utils=require(_0xf1d6('0x13'));var config=require(_0xf1d6('0x14'));var licenseUtil=require(_0xf1d6('0x15'));var db=require(_0xf1d6('0x16'))['db'];function respondWithStatusCode(_0x10b771,_0x42f63f){_0x42f63f=_0x42f63f||0xcc;return function(_0x13af6f){if(_0x13af6f){return _0x10b771[_0xf1d6('0x17')](_0x42f63f);}return _0x10b771['status'](_0x42f63f)['end']();};}function respondWithResult(_0x486623,_0x107344){_0x107344=_0x107344||0xc8;return function(_0x37a506){if(_0x37a506){return _0x486623[_0xf1d6('0x18')](_0x107344)[_0xf1d6('0x19')](_0x37a506);}};}function respondWithFilteredResult(_0x414d6d,_0x26b5d4){return function(_0x4a9ef7){if(_0x4a9ef7){var _0x11ddbc=typeof _0x26b5d4[_0xf1d6('0x1a')]===_0xf1d6('0x1b')&&typeof _0x26b5d4['limit']===_0xf1d6('0x1b');var _0x265c97=_0x4a9ef7[_0xf1d6('0x1c')];var _0x46295d=_0x11ddbc?0x0:_0x26b5d4[_0xf1d6('0x1a')];var _0x1e7f63=_0x11ddbc?_0x4a9ef7[_0xf1d6('0x1c')]:_0x26b5d4[_0xf1d6('0x1a')]+_0x26b5d4[_0xf1d6('0x1d')];var _0x56770d;if(_0x1e7f63>=_0x265c97){_0x1e7f63=_0x265c97;_0x56770d=0xc8;}else{_0x56770d=0xce;}_0x414d6d[_0xf1d6('0x18')](_0x56770d);return _0x414d6d[_0xf1d6('0x1e')](_0xf1d6('0x1f'),_0x46295d+'-'+_0x1e7f63+'/'+_0x265c97)['json'](_0x4a9ef7);}return null;};}function patchUpdates(_0x3b18bd){return function(_0x22a287){try{jsonpatch[_0xf1d6('0x20')](_0x22a287,_0x3b18bd,!![]);}catch(_0x56748b){return BPromise[_0xf1d6('0x21')](_0x56748b);}return _0x22a287[_0xf1d6('0x22')]();};}function saveUpdates(_0x14fa33,_0x186a34){return function(_0xebecaa){if(_0xebecaa){return _0xebecaa[_0xf1d6('0x23')](_0x14fa33)[_0xf1d6('0x24')](function(_0x3b790b){return _0x3b790b;});}return null;};}function removeEntity(_0xbe348a,_0x133d4d){return function(_0x34d513){if(_0x34d513){return _0x34d513[_0xf1d6('0x25')]()['then'](function(){_0xbe348a[_0xf1d6('0x18')](0xcc)[_0xf1d6('0x26')]();});}};}function handleEntityNotFound(_0x20a229,_0x367a64){return function(_0x52614d){if(!_0x52614d){_0x20a229[_0xf1d6('0x17')](0x194);}return _0x52614d;};}function handleError(_0x32ff00,_0x11c54f){_0x11c54f=_0x11c54f||0x1f4;return function(_0x40c0c3){logger[_0xf1d6('0x27')](_0x40c0c3[_0xf1d6('0x28')]);if(_0x40c0c3[_0xf1d6('0x29')]){delete _0x40c0c3[_0xf1d6('0x29')];}_0x32ff00[_0xf1d6('0x18')](_0x11c54f)['send'](_0x40c0c3);};}exports[_0xf1d6('0x2a')]=function(_0x5ffcd0,_0x48d116){var _0x351e1f={},_0x5481dd={},_0x627f8={'count':0x0,'rows':[]};var _0x2a062c=_['map'](db[_0xf1d6('0x2b')][_0xf1d6('0x2c')],function(_0xf6e586){return{'name':_0xf6e586['fieldName'],'type':_0xf6e586[_0xf1d6('0x2d')][_0xf1d6('0x2e')]};});_0x5481dd['model']=_[_0xf1d6('0x2f')](_0x2a062c,_0xf1d6('0x29'));_0x5481dd[_0xf1d6('0x30')]=_[_0xf1d6('0x31')](_0x5ffcd0[_0xf1d6('0x30')]);_0x5481dd[_0xf1d6('0x32')]=_[_0xf1d6('0x33')](_0x5481dd[_0xf1d6('0x34')],_0x5481dd[_0xf1d6('0x30')]);_0x351e1f[_0xf1d6('0x35')]=_[_0xf1d6('0x33')](_0x5481dd[_0xf1d6('0x34')],qs['fields'](_0x5ffcd0[_0xf1d6('0x30')][_0xf1d6('0x36')]));_0x351e1f[_0xf1d6('0x35')]=_0x351e1f[_0xf1d6('0x35')]['length']?_0x351e1f['attributes']:_0x5481dd[_0xf1d6('0x34')];if(!_0x5ffcd0[_0xf1d6('0x30')]['hasOwnProperty']('nolimit')){_0x351e1f['limit']=qs[_0xf1d6('0x1d')](_0x5ffcd0[_0xf1d6('0x30')][_0xf1d6('0x1d')]);_0x351e1f[_0xf1d6('0x1a')]=qs['offset'](_0x5ffcd0['query'][_0xf1d6('0x1a')]);}_0x351e1f[_0xf1d6('0x37')]=qs['sort'](_0x5ffcd0[_0xf1d6('0x30')][_0xf1d6('0x38')]);_0x351e1f[_0xf1d6('0x39')]=qs['filters'](_[_0xf1d6('0x3a')](_0x5ffcd0[_0xf1d6('0x30')],_0x5481dd[_0xf1d6('0x32')]),_0x2a062c);if(_0x5ffcd0[_0xf1d6('0x30')]['filter']){_0x351e1f[_0xf1d6('0x39')]=_[_0xf1d6('0x3b')](_0x351e1f[_0xf1d6('0x39')],{'$or':_[_0xf1d6('0x2f')](_0x2a062c,function(_0xa8cf65){if(_0xa8cf65[_0xf1d6('0x2d')]!==_0xf1d6('0x3c')){var _0x5a64c6={};_0x5a64c6[_0xa8cf65['name']]={'$like':'%'+_0x5ffcd0[_0xf1d6('0x30')][_0xf1d6('0x3d')]+'%'};return _0x5a64c6;}})});}_0x351e1f=_[_0xf1d6('0x3b')]({},_0x351e1f,_0x5ffcd0['options']);var _0x1154bc={'where':_0x351e1f[_0xf1d6('0x39')]};return db[_0xf1d6('0x2b')]['count'](_0x1154bc)[_0xf1d6('0x24')](function(_0x557f5d){_0x627f8[_0xf1d6('0x1c')]=_0x557f5d;if(_0x5ffcd0[_0xf1d6('0x30')]['includeAll']){_0x351e1f[_0xf1d6('0x3e')]=[{'all':!![]}];}return db[_0xf1d6('0x2b')][_0xf1d6('0x3f')](_0x351e1f);})['then'](function(_0x227112){_0x627f8[_0xf1d6('0x40')]=_0x227112;return _0x627f8;})[_0xf1d6('0x24')](respondWithFilteredResult(_0x48d116,_0x351e1f))[_0xf1d6('0x41')](handleError(_0x48d116,null));};exports['show']=function(_0x40a2de,_0x3199d2){var _0x1a3815={'raw':![],'where':{'id':_0x40a2de[_0xf1d6('0x42')]['id']}},_0x284ffb={};_0x284ffb[_0xf1d6('0x34')]=_[_0xf1d6('0x31')](db[_0xf1d6('0x2b')]['rawAttributes']);_0x284ffb['query']=_[_0xf1d6('0x31')](_0x40a2de[_0xf1d6('0x30')]);_0x284ffb[_0xf1d6('0x32')]=_[_0xf1d6('0x33')](_0x284ffb[_0xf1d6('0x34')],_0x284ffb[_0xf1d6('0x30')]);_0x1a3815[_0xf1d6('0x35')]=_[_0xf1d6('0x33')](_0x284ffb[_0xf1d6('0x34')],qs[_0xf1d6('0x36')](_0x40a2de['query'][_0xf1d6('0x36')]));_0x1a3815['attributes']=_0x1a3815['attributes'][_0xf1d6('0x43')]?_0x1a3815[_0xf1d6('0x35')]:_0x284ffb[_0xf1d6('0x34')];if(_0x40a2de[_0xf1d6('0x30')]['includeAll']){_0x1a3815['include']=[{'all':!![]}];}_0x1a3815=_['merge']({},_0x1a3815,_0x40a2de[_0xf1d6('0x44')]);return db[_0xf1d6('0x2b')][_0xf1d6('0x45')](_0x1a3815)[_0xf1d6('0x24')](handleEntityNotFound(_0x3199d2,null))[_0xf1d6('0x24')](respondWithResult(_0x3199d2,null))[_0xf1d6('0x41')](handleError(_0x3199d2,null));};exports[_0xf1d6('0x46')]=function(_0x2be618,_0x3d79ba){return db[_0xf1d6('0x2b')][_0xf1d6('0x46')](_0x2be618[_0xf1d6('0x47')],{})[_0xf1d6('0x24')](respondWithResult(_0x3d79ba,0xc9))[_0xf1d6('0x41')](handleError(_0x3d79ba,null));};exports[_0xf1d6('0x23')]=function(_0x5a4292,_0x36d249){if(_0x5a4292[_0xf1d6('0x47')]['id']){delete _0x5a4292[_0xf1d6('0x47')]['id'];}return db[_0xf1d6('0x2b')][_0xf1d6('0x45')]({'where':{'id':_0x5a4292[_0xf1d6('0x42')]['id']}})[_0xf1d6('0x24')](handleEntityNotFound(_0x36d249,null))[_0xf1d6('0x24')](saveUpdates(_0x5a4292[_0xf1d6('0x47')],null))[_0xf1d6('0x24')](respondWithResult(_0x36d249,null))[_0xf1d6('0x41')](handleError(_0x36d249,null));};exports[_0xf1d6('0x25')]=function(_0x22eb16,_0x48fabe){return db[_0xf1d6('0x2b')]['find']({'where':{'id':_0x22eb16[_0xf1d6('0x42')]['id']}})[_0xf1d6('0x24')](handleEntityNotFound(_0x48fabe,null))[_0xf1d6('0x24')](removeEntity(_0x48fabe,null))['catch'](handleError(_0x48fabe,null));};exports[_0xf1d6('0x48')]=function(_0x5e4796,_0x2a900d,_0x146cb4){var _0x557d55={};var _0xa82ebf={};var _0x78f1b7;var _0x55ea86;return db[_0xf1d6('0x2b')][_0xf1d6('0x49')]({'where':{'id':_0x5e4796[_0xf1d6('0x42')]['id']}})['then'](handleEntityNotFound(_0x2a900d,null))[_0xf1d6('0x24')](function(_0x387866){if(_0x387866){_0x78f1b7=_0x387866;_0xa82ebf[_0xf1d6('0x34')]=_[_0xf1d6('0x31')](db[_0xf1d6('0x4a')][_0xf1d6('0x2c')]);_0xa82ebf[_0xf1d6('0x30')]=_[_0xf1d6('0x31')](_0x5e4796[_0xf1d6('0x30')]);_0xa82ebf['filters']=_[_0xf1d6('0x33')](_0xa82ebf[_0xf1d6('0x34')],_0xa82ebf[_0xf1d6('0x30')]);_0x557d55[_0xf1d6('0x35')]=_[_0xf1d6('0x33')](_0xa82ebf['model'],qs['fields'](_0x5e4796[_0xf1d6('0x30')][_0xf1d6('0x36')]));_0x557d55[_0xf1d6('0x35')]=_0x557d55[_0xf1d6('0x35')][_0xf1d6('0x43')]?_0x557d55['attributes']:_0xa82ebf['model'];_0x557d55[_0xf1d6('0x37')]=qs[_0xf1d6('0x38')](_0x5e4796[_0xf1d6('0x30')][_0xf1d6('0x38')]);_0x557d55[_0xf1d6('0x39')]=qs['filters'](_[_0xf1d6('0x3a')](_0x5e4796['query'],_0xa82ebf[_0xf1d6('0x32')]));if(_0x5e4796[_0xf1d6('0x30')][_0xf1d6('0x3d')]){_0x557d55[_0xf1d6('0x39')]=_[_0xf1d6('0x3b')](_0x557d55['where'],{'$or':_[_0xf1d6('0x2f')](_0x557d55[_0xf1d6('0x35')],function(_0x384d4d){var _0x4796f3={};_0x4796f3[_0x384d4d]={'$like':'%'+_0x5e4796[_0xf1d6('0x30')][_0xf1d6('0x3d')]+'%'};return _0x4796f3;})});}_0x557d55=_[_0xf1d6('0x3b')]({},_0x557d55,_0x5e4796[_0xf1d6('0x44')]);return _0x78f1b7[_0xf1d6('0x48')](_0x557d55);}})[_0xf1d6('0x24')](function(_0x3e05dd){if(_0x3e05dd){_0x55ea86=_0x3e05dd[_0xf1d6('0x43')];if(!_0x5e4796[_0xf1d6('0x30')][_0xf1d6('0x4b')](_0xf1d6('0x4c'))){_0x557d55['limit']=qs[_0xf1d6('0x1d')](_0x5e4796[_0xf1d6('0x30')][_0xf1d6('0x1d')]);_0x557d55[_0xf1d6('0x1a')]=qs[_0xf1d6('0x1a')](_0x5e4796[_0xf1d6('0x30')][_0xf1d6('0x1a')]);}return _0x78f1b7[_0xf1d6('0x48')](_0x557d55);}})[_0xf1d6('0x24')](function(_0x33afad){if(_0x33afad){return _0x33afad?{'count':_0x55ea86,'rows':_0x33afad}:null;}})[_0xf1d6('0x24')](respondWithResult(_0x2a900d,null))['catch'](handleError(_0x2a900d,null));};exports['getSubjects']=function(_0x2c9a1f,_0x10f70a,_0x3ed2e1){var _0x43161a={};var _0x420bd9={};var _0x348ae7;var _0x2d7b93;return db[_0xf1d6('0x2b')][_0xf1d6('0x49')]({'where':{'id':_0x2c9a1f[_0xf1d6('0x42')]['id']}})['then'](handleEntityNotFound(_0x10f70a,null))['then'](function(_0x32b49d){if(_0x32b49d){_0x348ae7=_0x32b49d;_0x420bd9[_0xf1d6('0x34')]=_['keys'](db[_0xf1d6('0x4a')]['rawAttributes']);_0x420bd9[_0xf1d6('0x30')]=_[_0xf1d6('0x31')](_0x2c9a1f[_0xf1d6('0x30')]);_0x420bd9['filters']=_[_0xf1d6('0x33')](_0x420bd9[_0xf1d6('0x34')],_0x420bd9[_0xf1d6('0x30')]);_0x43161a['attributes']=_[_0xf1d6('0x33')](_0x420bd9[_0xf1d6('0x34')],qs[_0xf1d6('0x36')](_0x2c9a1f[_0xf1d6('0x30')][_0xf1d6('0x36')]));_0x43161a[_0xf1d6('0x35')]=_0x43161a['attributes']['length']?_0x43161a[_0xf1d6('0x35')]:_0x420bd9['model'];_0x43161a[_0xf1d6('0x37')]=qs[_0xf1d6('0x38')](_0x2c9a1f[_0xf1d6('0x30')]['sort']);_0x43161a[_0xf1d6('0x39')]=qs[_0xf1d6('0x32')](_[_0xf1d6('0x3a')](_0x2c9a1f['query'],_0x420bd9[_0xf1d6('0x32')]));if(_0x2c9a1f[_0xf1d6('0x30')][_0xf1d6('0x3d')]){_0x43161a['where']=_['merge'](_0x43161a[_0xf1d6('0x39')],{'$or':_[_0xf1d6('0x2f')](_0x43161a[_0xf1d6('0x35')],function(_0x200466){var _0x469102={};_0x469102[_0x200466]={'$like':'%'+_0x2c9a1f[_0xf1d6('0x30')]['filter']+'%'};return _0x469102;})});}_0x43161a=_[_0xf1d6('0x3b')]({},_0x43161a,_0x2c9a1f[_0xf1d6('0x44')]);return _0x348ae7['getSubjects'](_0x43161a);}})[_0xf1d6('0x24')](function(_0x2a7700){if(_0x2a7700){_0x2d7b93=_0x2a7700[_0xf1d6('0x43')];if(!_0x2c9a1f[_0xf1d6('0x30')]['hasOwnProperty'](_0xf1d6('0x4c'))){_0x43161a[_0xf1d6('0x1d')]=qs[_0xf1d6('0x1d')](_0x2c9a1f['query'][_0xf1d6('0x1d')]);_0x43161a['offset']=qs[_0xf1d6('0x1a')](_0x2c9a1f[_0xf1d6('0x30')][_0xf1d6('0x1a')]);}return _0x348ae7[_0xf1d6('0x4d')](_0x43161a);}})['then'](function(_0x2a046d){if(_0x2a046d){return _0x2a046d?{'count':_0x2d7b93,'rows':_0x2a046d}:null;}})[_0xf1d6('0x24')](respondWithResult(_0x10f70a,null))[_0xf1d6('0x41')](handleError(_0x10f70a,null));};exports[_0xf1d6('0x4e')]=function(_0x5c922c,_0x5e2fb5,_0x165bd0){var _0x5174b9={};var _0xaabbf5={};var _0x5a9f1b;var _0x56ab26;return db[_0xf1d6('0x2b')][_0xf1d6('0x49')]({'where':{'id':_0x5c922c[_0xf1d6('0x42')]['id']}})[_0xf1d6('0x24')](handleEntityNotFound(_0x5e2fb5,null))[_0xf1d6('0x24')](function(_0x4294a1){if(_0x4294a1){_0x5a9f1b=_0x4294a1;_0xaabbf5[_0xf1d6('0x34')]=_['keys'](db[_0xf1d6('0x4a')][_0xf1d6('0x2c')]);_0xaabbf5['query']=_[_0xf1d6('0x31')](_0x5c922c[_0xf1d6('0x30')]);_0xaabbf5['filters']=_['intersection'](_0xaabbf5[_0xf1d6('0x34')],_0xaabbf5[_0xf1d6('0x30')]);_0x5174b9[_0xf1d6('0x35')]=_['intersection'](_0xaabbf5[_0xf1d6('0x34')],qs[_0xf1d6('0x36')](_0x5c922c[_0xf1d6('0x30')][_0xf1d6('0x36')]));_0x5174b9[_0xf1d6('0x35')]=_0x5174b9[_0xf1d6('0x35')][_0xf1d6('0x43')]?_0x5174b9[_0xf1d6('0x35')]:_0xaabbf5[_0xf1d6('0x34')];_0x5174b9[_0xf1d6('0x37')]=qs[_0xf1d6('0x38')](_0x5c922c[_0xf1d6('0x30')][_0xf1d6('0x38')]);_0x5174b9[_0xf1d6('0x39')]=qs['filters'](_[_0xf1d6('0x3a')](_0x5c922c[_0xf1d6('0x30')],_0xaabbf5[_0xf1d6('0x32')]));if(_0x5c922c[_0xf1d6('0x30')]['filter']){_0x5174b9[_0xf1d6('0x39')]=_[_0xf1d6('0x3b')](_0x5174b9[_0xf1d6('0x39')],{'$or':_[_0xf1d6('0x2f')](_0x5174b9[_0xf1d6('0x35')],function(_0x4370ff){var _0x1b5029={};_0x1b5029[_0x4370ff]={'$like':'%'+_0x5c922c[_0xf1d6('0x30')]['filter']+'%'};return _0x1b5029;})});}_0x5174b9=_[_0xf1d6('0x3b')]({},_0x5174b9,_0x5c922c[_0xf1d6('0x44')]);return _0x5a9f1b[_0xf1d6('0x4e')](_0x5174b9);}})[_0xf1d6('0x24')](function(_0x3e0608){if(_0x3e0608){_0x56ab26=_0x3e0608[_0xf1d6('0x43')];if(!_0x5c922c[_0xf1d6('0x30')]['hasOwnProperty'](_0xf1d6('0x4c'))){_0x5174b9[_0xf1d6('0x1d')]=qs[_0xf1d6('0x1d')](_0x5c922c[_0xf1d6('0x30')]['limit']);_0x5174b9[_0xf1d6('0x1a')]=qs[_0xf1d6('0x1a')](_0x5c922c[_0xf1d6('0x30')][_0xf1d6('0x1a')]);}return _0x5a9f1b['getDescriptions'](_0x5174b9);}})[_0xf1d6('0x24')](function(_0x1f3b3e){if(_0x1f3b3e){return _0x1f3b3e?{'count':_0x56ab26,'rows':_0x1f3b3e}:null;}})[_0xf1d6('0x24')](respondWithResult(_0x5e2fb5,null))[_0xf1d6('0x41')](handleError(_0x5e2fb5,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 11c5018..d7e5aa3 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 _0x18f7=['exports','define','ZohoConfiguration','int_zoho_configurations','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoConfiguration.attributes'];(function(_0x7f1eea,_0x89199c){var _0x172778=function(_0x50097a){while(--_0x50097a){_0x7f1eea['push'](_0x7f1eea['shift']());}};_0x172778(++_0x89199c);}(_0x18f7,0x1e5));var _0x718f=function(_0x41f96e,_0x333851){_0x41f96e=_0x41f96e-0x0;var _0x48a4ac=_0x18f7[_0x41f96e];return _0x48a4ac;};'use strict';var _=require(_0x718f('0x0'));var util=require('util');var logger=require(_0x718f('0x1'))('api');var moment=require(_0x718f('0x2'));var BPromise=require(_0x718f('0x3'));var rp=require(_0x718f('0x4'));var fs=require('fs');var path=require(_0x718f('0x5'));var rimraf=require(_0x718f('0x6'));var config=require(_0x718f('0x7'));var attributes=require(_0x718f('0x8'));module[_0x718f('0x9')]=function(_0x4dfa42,_0x16f24f){return _0x4dfa42[_0x718f('0xa')](_0x718f('0xb'),attributes,{'tableName':_0x718f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdff4=['path','rimraf','exports','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x37b529,_0x6724e7){var _0x116152=function(_0x36d367){while(--_0x36d367){_0x37b529['push'](_0x37b529['shift']());}};_0x116152(++_0x6724e7);}(_0xdff4,0x179));var _0x4dff=function(_0x22b983,_0x244e2e){_0x22b983=_0x22b983-0x0;var _0x2b28da=_0xdff4[_0x22b983];return _0x2b28da;};'use strict';var _=require(_0x4dff('0x0'));var util=require(_0x4dff('0x1'));var logger=require(_0x4dff('0x2'))(_0x4dff('0x3'));var moment=require(_0x4dff('0x4'));var BPromise=require(_0x4dff('0x5'));var rp=require(_0x4dff('0x6'));var fs=require('fs');var path=require(_0x4dff('0x7'));var rimraf=require(_0x4dff('0x8'));var config=require('../../config/environment');var attributes=require('./intZohoConfiguration.attributes');module[_0x4dff('0x9')]=function(_0x4ed75e,_0x3f52a3){return _0x4ed75e['define'](_0x4dff('0xa'),attributes,{'tableName':_0x4dff('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 e6a657c..75a6484 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 _0x6c37=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment'];(function(_0x1f2c1d,_0x526384){var _0x164943=function(_0x37a2e4){while(--_0x37a2e4){_0x1f2c1d['push'](_0x1f2c1d['shift']());}};_0x164943(++_0x526384);}(_0x6c37,0x10e));var _0x76c3=function(_0x53bca6,_0x293a86){_0x53bca6=_0x53bca6-0x0;var _0x12c505=_0x6c37[_0x53bca6];return _0x12c505;};'use strict';var _=require(_0x76c3('0x0'));var util=require(_0x76c3('0x1'));var moment=require(_0x76c3('0x2'));var BPromise=require(_0x76c3('0x3'));var rs=require(_0x76c3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x76c3('0x5'))['db'];var utils=require(_0x76c3('0x6'));var logger=require(_0x76c3('0x7'))(_0x76c3('0x8'));var config=require(_0x76c3('0x9'));var jayson=require(_0x76c3('0xa'));var client=jayson['client'][_0x76c3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x26732b,_0xe4cacf,_0x4d5cf0){return new BPromise(function(_0x393189,_0x4a1ac3){return client['request'](_0x26732b,_0x4d5cf0)['then'](function(_0x21a64d){logger[_0x76c3('0xc')](_0x76c3('0xd'),_0xe4cacf,_0x76c3('0xe'));logger[_0x76c3('0xf')](_0x76c3('0x10'),_0xe4cacf,_0x76c3('0xe'),JSON['stringify'](_0x21a64d));if(_0x21a64d[_0x76c3('0x11')]){if(_0x21a64d[_0x76c3('0x11')][_0x76c3('0x12')]===0x1f4){logger[_0x76c3('0x11')](_0x76c3('0xd'),_0xe4cacf,_0x21a64d[_0x76c3('0x11')][_0x76c3('0x13')]);return _0x4a1ac3(_0x21a64d['error'][_0x76c3('0x13')]);}logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0xe4cacf,_0x21a64d[_0x76c3('0x11')][_0x76c3('0x13')]);return _0x393189(_0x21a64d['error'][_0x76c3('0x13')]);}else{logger['info']('ZohoConfiguration,\x20%s,\x20%s',_0xe4cacf,_0x76c3('0xe'));_0x393189(_0x21a64d[_0x76c3('0x14')]['message']);}})['catch'](function(_0x4f38a0){logger[_0x76c3('0x11')](_0x76c3('0xd'),_0xe4cacf,_0x4f38a0);_0x4a1ac3(_0x4f38a0);});});} \ No newline at end of file +var _0xa4eb=['ZohoConfiguration,\x20%s,\x20%s','message','info','result','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','request\x20sent','debug','stringify','error','code'];(function(_0x4f89ff,_0x5e466b){var _0x42f34c=function(_0x2806d6){while(--_0x2806d6){_0x4f89ff['push'](_0x4f89ff['shift']());}};_0x42f34c(++_0x5e466b);}(_0xa4eb,0xa4));var _0xba4e=function(_0x39148d,_0x169f77){_0x39148d=_0x39148d-0x0;var _0x11c54d=_0xa4eb[_0x39148d];return _0x11c54d;};'use strict';var _=require(_0xba4e('0x0'));var util=require('util');var moment=require(_0xba4e('0x1'));var BPromise=require(_0xba4e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xba4e('0x3'));var db=require(_0xba4e('0x4'))['db'];var utils=require(_0xba4e('0x5'));var logger=require('../../config/logger')(_0xba4e('0x6'));var config=require(_0xba4e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xba4e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2b375d,_0x6fbf88,_0x243c4c){return new BPromise(function(_0x28e2e3,_0x260bd5){return client[_0xba4e('0x9')](_0x2b375d,_0x243c4c)[_0xba4e('0xa')](function(_0x4a3951){logger['info']('ZohoConfiguration,\x20%s,\x20%s',_0x6fbf88,_0xba4e('0xb'));logger[_0xba4e('0xc')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x6fbf88,_0xba4e('0xb'),JSON[_0xba4e('0xd')](_0x4a3951));if(_0x4a3951[_0xba4e('0xe')]){if(_0x4a3951['error'][_0xba4e('0xf')]===0x1f4){logger[_0xba4e('0xe')](_0xba4e('0x10'),_0x6fbf88,_0x4a3951[_0xba4e('0xe')]['message']);return _0x260bd5(_0x4a3951[_0xba4e('0xe')][_0xba4e('0x11')]);}logger[_0xba4e('0xe')](_0xba4e('0x10'),_0x6fbf88,_0x4a3951['error'][_0xba4e('0x11')]);return _0x28e2e3(_0x4a3951[_0xba4e('0xe')][_0xba4e('0x11')]);}else{logger[_0xba4e('0x12')]('ZohoConfiguration,\x20%s,\x20%s',_0x6fbf88,_0xba4e('0xb'));_0x28e2e3(_0x4a3951[_0xba4e('0x13')]['message']);}})['catch'](function(_0x4da59f){logger[_0xba4e('0xe')](_0xba4e('0x10'),_0x6fbf88,_0x4da59f);_0x260bd5(_0x4da59f);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 2092d0d..d701403 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 _0x0781=['put','update','delete','/:id','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','isAuthenticated','index','get','post'];(function(_0x1627ec,_0x81809){var _0x5b4aa9=function(_0x4fd057){while(--_0x4fd057){_0x1627ec['push'](_0x1627ec['shift']());}};_0x5b4aa9(++_0x81809);}(_0x0781,0x15b));var _0x1078=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0781[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x1078('0x0'));var util=require(_0x1078('0x1'));var path=require(_0x1078('0x2'));var timeout=require('connect-timeout');var express=require(_0x1078('0x3'));var router=express[_0x1078('0x4')]();var fs_extra=require(_0x1078('0x5'));var auth=require(_0x1078('0x6'));var interaction=require(_0x1078('0x7'));var config=require(_0x1078('0x8'));var controller=require(_0x1078('0x9'));router['get']('/',auth[_0x1078('0xa')](),controller[_0x1078('0xb')]);router[_0x1078('0xc')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x1078('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1078('0xe')]('/:id',auth[_0x1078('0xa')](),controller[_0x1078('0xf')]);router[_0x1078('0x10')](_0x1078('0x11'),auth[_0x1078('0xa')](),controller['destroy']);module[_0x1078('0x12')]=router; \ No newline at end of file +var _0x73e1=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','index','show','post','create','/:id','update','delete','destroy','exports','multer','util'];(function(_0x1237b5,_0x4786ad){var _0x5a2b68=function(_0x369986){while(--_0x369986){_0x1237b5['push'](_0x1237b5['shift']());}};_0x5a2b68(++_0x4786ad);}(_0x73e1,0x106));var _0x173e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x73e1[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x173e('0x0'));var util=require(_0x173e('0x1'));var path=require(_0x173e('0x2'));var timeout=require(_0x173e('0x3'));var express=require(_0x173e('0x4'));var router=express[_0x173e('0x5')]();var fs_extra=require(_0x173e('0x6'));var auth=require(_0x173e('0x7'));var interaction=require(_0x173e('0x8'));var config=require(_0x173e('0x9'));var controller=require(_0x173e('0xa'));router[_0x173e('0xb')]('/',auth[_0x173e('0xc')](),controller[_0x173e('0xd')]);router[_0x173e('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x173e('0xe')]);router[_0x173e('0xf')]('/',auth[_0x173e('0xc')](),controller[_0x173e('0x10')]);router['put'](_0x173e('0x11'),auth['isAuthenticated'](),controller[_0x173e('0x12')]);router[_0x173e('0x13')](_0x173e('0x11'),auth[_0x173e('0xc')](),controller[_0x173e('0x14')]);module[_0x173e('0x15')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 31d55ce..cdd4407 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 _0xc4eb=['customVariable','keyValue','picklist','string','STRING','sequelize','exports','ENUM','variable'];(function(_0x595013,_0x65a215){var _0x2a29e3=function(_0x307bf8){while(--_0x307bf8){_0x595013['push'](_0x595013['shift']());}};_0x2a29e3(++_0x65a215);}(_0xc4eb,0x19a));var _0xbc4e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xc4eb[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0xbc4e('0x0'));module[_0xbc4e('0x1')]={'type':{'type':Sequelize[_0xbc4e('0x2')]('string',_0xbc4e('0x3'),_0xbc4e('0x4'),_0xbc4e('0x5'),_0xbc4e('0x6')),'defaultValue':_0xbc4e('0x7')},'content':{'type':Sequelize[_0xbc4e('0x8')]},'key':{'type':Sequelize[_0xbc4e('0x8')]},'keyType':{'type':Sequelize['ENUM'](_0xbc4e('0x7'),_0xbc4e('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0xbc4e('0x8')]},'idField':{'type':Sequelize[_0xbc4e('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xec52=['STRING','sequelize','exports','ENUM','variable','customVariable','keyValue','picklist','string'];(function(_0x15f603,_0x19466a){var _0x26fd2e=function(_0x57f840){while(--_0x57f840){_0x15f603['push'](_0x15f603['shift']());}};_0x26fd2e(++_0x19466a);}(_0xec52,0xac));var _0x2ec5=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xec52[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x2ec5('0x0'));module[_0x2ec5('0x1')]={'type':{'type':Sequelize[_0x2ec5('0x2')]('string',_0x2ec5('0x3'),_0x2ec5('0x4'),_0x2ec5('0x5'),_0x2ec5('0x6')),'defaultValue':_0x2ec5('0x7')},'content':{'type':Sequelize[_0x2ec5('0x8')]},'key':{'type':Sequelize[_0x2ec5('0x8')]},'keyType':{'type':Sequelize['ENUM'](_0x2ec5('0x7'),'variable',_0x2ec5('0x4'))},'keyContent':{'type':Sequelize[_0x2ec5('0x8')]},'idField':{'type':Sequelize[_0x2ec5('0x8')]},'nameField':{'type':Sequelize[_0x2ec5('0x8')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2ec5('0x8')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 12e889f..06c4399 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 _0x7fe2=['merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','include','options','find','create','update','body','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','sox','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','destroy','then','sendStatus','stack','name','send','index','map','ZohoField','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter'];(function(_0x4d0ebd,_0x17ab0b){var _0x594e9c=function(_0x4d22ab){while(--_0x4d22ab){_0x4d0ebd['push'](_0x4d0ebd['shift']());}};_0x594e9c(++_0x17ab0b);}(_0x7fe2,0x96));var _0x27fe=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0x7fe2[_0x1ccdf7];return _0x52a0ae;};'use strict';var emlformat=require(_0x27fe('0x0'));var rimraf=require(_0x27fe('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x27fe('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x27fe('0x3'));var Mustache=require(_0x27fe('0x4'));var util=require(_0x27fe('0x5'));var path=require('path');var sox=require(_0x27fe('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x27fe('0x7'));var _=require(_0x27fe('0x8'));var squel=require('squel');var crypto=require(_0x27fe('0x9'));var jsforce=require(_0x27fe('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x27fe('0xb'));var Papa=require(_0x27fe('0xc'));var Redis=require('ioredis');var authService=require(_0x27fe('0xd'));var qs=require(_0x27fe('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x27fe('0xf'));var logger=require('../../config/logger')(_0x27fe('0x10'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4eca9a,_0x23cd2f){_0x23cd2f=_0x23cd2f||0xcc;return function(_0xfc7d93){if(_0xfc7d93){return _0x4eca9a['sendStatus'](_0x23cd2f);}return _0x4eca9a[_0x27fe('0x11')](_0x23cd2f)[_0x27fe('0x12')]();};}function respondWithResult(_0x3681c4,_0xfe2ede){_0xfe2ede=_0xfe2ede||0xc8;return function(_0x29b9f2){if(_0x29b9f2){return _0x3681c4[_0x27fe('0x11')](_0xfe2ede)[_0x27fe('0x13')](_0x29b9f2);}};}function respondWithFilteredResult(_0x405185,_0xd88d48){return function(_0x3fa332){if(_0x3fa332){var _0x18abbe=typeof _0xd88d48[_0x27fe('0x14')]===_0x27fe('0x15')&&typeof _0xd88d48[_0x27fe('0x16')]==='undefined';var _0x31e71c=_0x3fa332['count'];var _0x56b7da=_0x18abbe?0x0:_0xd88d48[_0x27fe('0x14')];var _0x49eafd=_0x18abbe?_0x3fa332['count']:_0xd88d48[_0x27fe('0x14')]+_0xd88d48[_0x27fe('0x16')];var _0x134c82;if(_0x49eafd>=_0x31e71c){_0x49eafd=_0x31e71c;_0x134c82=0xc8;}else{_0x134c82=0xce;}_0x405185['status'](_0x134c82);return _0x405185[_0x27fe('0x17')](_0x27fe('0x18'),_0x56b7da+'-'+_0x49eafd+'/'+_0x31e71c)[_0x27fe('0x13')](_0x3fa332);}return null;};}function patchUpdates(_0x279de2){return function(_0x67c19f){try{jsonpatch[_0x27fe('0x19')](_0x67c19f,_0x279de2,!![]);}catch(_0x27545a){return BPromise[_0x27fe('0x1a')](_0x27545a);}return _0x67c19f[_0x27fe('0x1b')]();};}function saveUpdates(_0x4b9208,_0xcb6fa2){return function(_0x499f92){if(_0x499f92){return _0x499f92['update'](_0x4b9208)['then'](function(_0x2d161b){return _0x2d161b;});}return null;};}function removeEntity(_0x1fdc46,_0x4847fc){return function(_0xe333b4){if(_0xe333b4){return _0xe333b4[_0x27fe('0x1c')]()[_0x27fe('0x1d')](function(){_0x1fdc46['status'](0xcc)[_0x27fe('0x12')]();});}};}function handleEntityNotFound(_0x227218,_0xfd2153){return function(_0x4ec04c){if(!_0x4ec04c){_0x227218[_0x27fe('0x1e')](0x194);}return _0x4ec04c;};}function handleError(_0x3c5a25,_0x20e787){_0x20e787=_0x20e787||0x1f4;return function(_0x35b8e7){logger['error'](_0x35b8e7[_0x27fe('0x1f')]);if(_0x35b8e7[_0x27fe('0x20')]){delete _0x35b8e7[_0x27fe('0x20')];}_0x3c5a25[_0x27fe('0x11')](_0x20e787)[_0x27fe('0x21')](_0x35b8e7);};}exports[_0x27fe('0x22')]=function(_0x4a614a,_0x47ee8f){var _0x29a9b4={},_0x19b742={},_0x29de7d={'count':0x0,'rows':[]};var _0x1d25ad=_[_0x27fe('0x23')](db[_0x27fe('0x24')][_0x27fe('0x25')],function(_0x2741db){return{'name':_0x2741db['fieldName'],'type':_0x2741db['type'][_0x27fe('0x26')]};});_0x19b742[_0x27fe('0x27')]=_['map'](_0x1d25ad,_0x27fe('0x20'));_0x19b742[_0x27fe('0x28')]=_[_0x27fe('0x29')](_0x4a614a['query']);_0x19b742[_0x27fe('0x2a')]=_[_0x27fe('0x2b')](_0x19b742[_0x27fe('0x27')],_0x19b742[_0x27fe('0x28')]);_0x29a9b4[_0x27fe('0x2c')]=_[_0x27fe('0x2b')](_0x19b742[_0x27fe('0x27')],qs[_0x27fe('0x2d')](_0x4a614a[_0x27fe('0x28')][_0x27fe('0x2d')]));_0x29a9b4['attributes']=_0x29a9b4[_0x27fe('0x2c')][_0x27fe('0x2e')]?_0x29a9b4[_0x27fe('0x2c')]:_0x19b742[_0x27fe('0x27')];if(!_0x4a614a[_0x27fe('0x28')][_0x27fe('0x2f')](_0x27fe('0x30'))){_0x29a9b4[_0x27fe('0x16')]=qs['limit'](_0x4a614a[_0x27fe('0x28')][_0x27fe('0x16')]);_0x29a9b4[_0x27fe('0x14')]=qs[_0x27fe('0x14')](_0x4a614a['query'][_0x27fe('0x14')]);}_0x29a9b4[_0x27fe('0x31')]=qs[_0x27fe('0x32')](_0x4a614a[_0x27fe('0x28')][_0x27fe('0x32')]);_0x29a9b4[_0x27fe('0x33')]=qs['filters'](_[_0x27fe('0x34')](_0x4a614a[_0x27fe('0x28')],_0x19b742[_0x27fe('0x2a')]),_0x1d25ad);if(_0x4a614a[_0x27fe('0x28')][_0x27fe('0x35')]){_0x29a9b4[_0x27fe('0x33')]=_[_0x27fe('0x36')](_0x29a9b4[_0x27fe('0x33')],{'$or':_[_0x27fe('0x23')](_0x1d25ad,function(_0x4209aa){if(_0x4209aa['type']!==_0x27fe('0x37')){var _0x1c2bc6={};_0x1c2bc6[_0x4209aa[_0x27fe('0x20')]]={'$like':'%'+_0x4a614a['query'][_0x27fe('0x35')]+'%'};return _0x1c2bc6;}})});}_0x29a9b4=_[_0x27fe('0x36')]({},_0x29a9b4,_0x4a614a['options']);var _0x4c2659={'where':_0x29a9b4[_0x27fe('0x33')]};return db[_0x27fe('0x24')]['count'](_0x4c2659)[_0x27fe('0x1d')](function(_0x2e7e4d){_0x29de7d['count']=_0x2e7e4d;if(_0x4a614a[_0x27fe('0x28')][_0x27fe('0x38')]){_0x29a9b4['include']=[{'all':!![]}];}return db[_0x27fe('0x24')][_0x27fe('0x39')](_0x29a9b4);})[_0x27fe('0x1d')](function(_0x424d79){_0x29de7d[_0x27fe('0x3a')]=_0x424d79;return _0x29de7d;})['then'](respondWithFilteredResult(_0x47ee8f,_0x29a9b4))[_0x27fe('0x3b')](handleError(_0x47ee8f,null));};exports[_0x27fe('0x3c')]=function(_0x27a571,_0x3b8619){var _0x1c1fb5={'raw':!![],'where':{'id':_0x27a571[_0x27fe('0x3d')]['id']}},_0xabdef8={};_0xabdef8[_0x27fe('0x27')]=_['keys'](db[_0x27fe('0x24')][_0x27fe('0x25')]);_0xabdef8[_0x27fe('0x28')]=_[_0x27fe('0x29')](_0x27a571[_0x27fe('0x28')]);_0xabdef8[_0x27fe('0x2a')]=_[_0x27fe('0x2b')](_0xabdef8[_0x27fe('0x27')],_0xabdef8[_0x27fe('0x28')]);_0x1c1fb5[_0x27fe('0x2c')]=_['intersection'](_0xabdef8['model'],qs['fields'](_0x27a571[_0x27fe('0x28')]['fields']));_0x1c1fb5[_0x27fe('0x2c')]=_0x1c1fb5['attributes'][_0x27fe('0x2e')]?_0x1c1fb5[_0x27fe('0x2c')]:_0xabdef8['model'];if(_0x27a571[_0x27fe('0x28')][_0x27fe('0x38')]){_0x1c1fb5[_0x27fe('0x3e')]=[{'all':!![]}];}_0x1c1fb5=_[_0x27fe('0x36')]({},_0x1c1fb5,_0x27a571[_0x27fe('0x3f')]);return db[_0x27fe('0x24')][_0x27fe('0x40')](_0x1c1fb5)[_0x27fe('0x1d')](handleEntityNotFound(_0x3b8619,null))['then'](respondWithResult(_0x3b8619,null))[_0x27fe('0x3b')](handleError(_0x3b8619,null));};exports[_0x27fe('0x41')]=function(_0x14e807,_0x565d47){return db['ZohoField'][_0x27fe('0x41')](_0x14e807['body'],{})[_0x27fe('0x1d')](respondWithResult(_0x565d47,0xc9))[_0x27fe('0x3b')](handleError(_0x565d47,null));};exports[_0x27fe('0x42')]=function(_0x32fcd3,_0xd801e){if(_0x32fcd3[_0x27fe('0x43')]['id']){delete _0x32fcd3[_0x27fe('0x43')]['id'];}return db[_0x27fe('0x24')][_0x27fe('0x40')]({'where':{'id':_0x32fcd3[_0x27fe('0x3d')]['id']}})['then'](handleEntityNotFound(_0xd801e,null))['then'](saveUpdates(_0x32fcd3['body'],null))[_0x27fe('0x1d')](respondWithResult(_0xd801e,null))['catch'](handleError(_0xd801e,null));};exports['destroy']=function(_0x13efee,_0x3cd822){return db[_0x27fe('0x24')]['find']({'where':{'id':_0x13efee[_0x27fe('0x3d')]['id']}})[_0x27fe('0x1d')](handleEntityNotFound(_0x3cd822,null))[_0x27fe('0x1d')](removeEntity(_0x3cd822,null))['catch'](handleError(_0x3cd822,null));}; \ No newline at end of file +var _0x14d1=['querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','stack','name','send','index','map','ZohoField','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','VIRTUAL','filter','options','include','findAll','rows','params','includeAll','find','create','body','catch','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0x14d1,0x84));var _0x114d=function(_0x4c6fd0,_0x15b1c2){_0x4c6fd0=_0x4c6fd0-0x0;var _0x3efadc=_0x14d1[_0x4c6fd0];return _0x3efadc;};'use strict';var emlformat=require(_0x114d('0x0'));var rimraf=require(_0x114d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x114d('0x2'));var rp=require(_0x114d('0x3'));var moment=require(_0x114d('0x4'));var BPromise=require(_0x114d('0x5'));var Mustache=require(_0x114d('0x6'));var util=require(_0x114d('0x7'));var path=require(_0x114d('0x8'));var sox=require(_0x114d('0x9'));var csv=require('to-csv');var ejs=require(_0x114d('0xa'));var fs=require('fs');var fs_extra=require(_0x114d('0xb'));var _=require(_0x114d('0xc'));var squel=require(_0x114d('0xd'));var crypto=require(_0x114d('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x114d('0xf'));var toCsv=require('to-csv');var querystring=require(_0x114d('0x10'));var Papa=require('papaparse');var Redis=require(_0x114d('0x11'));var authService=require(_0x114d('0x12'));var qs=require(_0x114d('0x13'));var as=require(_0x114d('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x114d('0x15'))(_0x114d('0x16'));var utils=require('../../config/utils');var config=require(_0x114d('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x114d('0x18'))['db'];function respondWithStatusCode(_0x510269,_0x2fc4f9){_0x2fc4f9=_0x2fc4f9||0xcc;return function(_0x1dbc64){if(_0x1dbc64){return _0x510269[_0x114d('0x19')](_0x2fc4f9);}return _0x510269[_0x114d('0x1a')](_0x2fc4f9)[_0x114d('0x1b')]();};}function respondWithResult(_0x134a9d,_0x180043){_0x180043=_0x180043||0xc8;return function(_0x360584){if(_0x360584){return _0x134a9d[_0x114d('0x1a')](_0x180043)[_0x114d('0x1c')](_0x360584);}};}function respondWithFilteredResult(_0x3232f2,_0x10c04c){return function(_0x1215ff){if(_0x1215ff){var _0x2f001a=typeof _0x10c04c[_0x114d('0x1d')]==='undefined'&&typeof _0x10c04c[_0x114d('0x1e')]===_0x114d('0x1f');var _0x57d465=_0x1215ff[_0x114d('0x20')];var _0x27dd78=_0x2f001a?0x0:_0x10c04c[_0x114d('0x1d')];var _0x2afafc=_0x2f001a?_0x1215ff[_0x114d('0x20')]:_0x10c04c[_0x114d('0x1d')]+_0x10c04c[_0x114d('0x1e')];var _0x34b1e0;if(_0x2afafc>=_0x57d465){_0x2afafc=_0x57d465;_0x34b1e0=0xc8;}else{_0x34b1e0=0xce;}_0x3232f2['status'](_0x34b1e0);return _0x3232f2[_0x114d('0x21')]('Content-Range',_0x27dd78+'-'+_0x2afafc+'/'+_0x57d465)['json'](_0x1215ff);}return null;};}function patchUpdates(_0x1b02be){return function(_0x4028ee){try{jsonpatch[_0x114d('0x22')](_0x4028ee,_0x1b02be,!![]);}catch(_0x4f837d){return BPromise[_0x114d('0x23')](_0x4f837d);}return _0x4028ee[_0x114d('0x24')]();};}function saveUpdates(_0x2bec6b,_0x2699ff){return function(_0x368822){if(_0x368822){return _0x368822[_0x114d('0x25')](_0x2bec6b)[_0x114d('0x26')](function(_0x4d9011){return _0x4d9011;});}return null;};}function removeEntity(_0x27ab5,_0x3b29f2){return function(_0x6e9248){if(_0x6e9248){return _0x6e9248['destroy']()[_0x114d('0x26')](function(){_0x27ab5[_0x114d('0x1a')](0xcc)[_0x114d('0x1b')]();});}};}function handleEntityNotFound(_0x5a0dfc,_0x32f3c3){return function(_0x531e1d){if(!_0x531e1d){_0x5a0dfc[_0x114d('0x19')](0x194);}return _0x531e1d;};}function handleError(_0x158a05,_0x3a0f9a){_0x3a0f9a=_0x3a0f9a||0x1f4;return function(_0x19bf33){logger['error'](_0x19bf33[_0x114d('0x27')]);if(_0x19bf33[_0x114d('0x28')]){delete _0x19bf33['name'];}_0x158a05[_0x114d('0x1a')](_0x3a0f9a)[_0x114d('0x29')](_0x19bf33);};}exports[_0x114d('0x2a')]=function(_0x3336e4,_0x4374ba){var _0x592465={},_0x362584={},_0x385be6={'count':0x0,'rows':[]};var _0x1d7fee=_[_0x114d('0x2b')](db[_0x114d('0x2c')]['rawAttributes'],function(_0x1dbee3){return{'name':_0x1dbee3['fieldName'],'type':_0x1dbee3[_0x114d('0x2d')][_0x114d('0x2e')]};});_0x362584['model']=_['map'](_0x1d7fee,_0x114d('0x28'));_0x362584[_0x114d('0x2f')]=_[_0x114d('0x30')](_0x3336e4[_0x114d('0x2f')]);_0x362584['filters']=_[_0x114d('0x31')](_0x362584[_0x114d('0x32')],_0x362584[_0x114d('0x2f')]);_0x592465[_0x114d('0x33')]=_[_0x114d('0x31')](_0x362584[_0x114d('0x32')],qs[_0x114d('0x34')](_0x3336e4[_0x114d('0x2f')]['fields']));_0x592465['attributes']=_0x592465[_0x114d('0x33')][_0x114d('0x35')]?_0x592465['attributes']:_0x362584[_0x114d('0x32')];if(!_0x3336e4[_0x114d('0x2f')][_0x114d('0x36')](_0x114d('0x37'))){_0x592465['limit']=qs['limit'](_0x3336e4[_0x114d('0x2f')]['limit']);_0x592465[_0x114d('0x1d')]=qs[_0x114d('0x1d')](_0x3336e4[_0x114d('0x2f')][_0x114d('0x1d')]);}_0x592465[_0x114d('0x38')]=qs[_0x114d('0x39')](_0x3336e4[_0x114d('0x2f')][_0x114d('0x39')]);_0x592465[_0x114d('0x3a')]=qs['filters'](_[_0x114d('0x3b')](_0x3336e4[_0x114d('0x2f')],_0x362584[_0x114d('0x3c')]),_0x1d7fee);if(_0x3336e4[_0x114d('0x2f')]['filter']){_0x592465[_0x114d('0x3a')]=_[_0x114d('0x3d')](_0x592465['where'],{'$or':_[_0x114d('0x2b')](_0x1d7fee,function(_0xcb90de){if(_0xcb90de['type']!==_0x114d('0x3e')){var _0x321e0a={};_0x321e0a[_0xcb90de[_0x114d('0x28')]]={'$like':'%'+_0x3336e4[_0x114d('0x2f')][_0x114d('0x3f')]+'%'};return _0x321e0a;}})});}_0x592465=_[_0x114d('0x3d')]({},_0x592465,_0x3336e4[_0x114d('0x40')]);var _0x344488={'where':_0x592465[_0x114d('0x3a')]};return db[_0x114d('0x2c')][_0x114d('0x20')](_0x344488)['then'](function(_0x1aaeb6){_0x385be6[_0x114d('0x20')]=_0x1aaeb6;if(_0x3336e4[_0x114d('0x2f')]['includeAll']){_0x592465[_0x114d('0x41')]=[{'all':!![]}];}return db[_0x114d('0x2c')][_0x114d('0x42')](_0x592465);})['then'](function(_0x2e2b4b){_0x385be6[_0x114d('0x43')]=_0x2e2b4b;return _0x385be6;})[_0x114d('0x26')](respondWithFilteredResult(_0x4374ba,_0x592465))['catch'](handleError(_0x4374ba,null));};exports['show']=function(_0x2252ac,_0x3a144b){var _0x271927={'raw':!![],'where':{'id':_0x2252ac[_0x114d('0x44')]['id']}},_0x253baf={};_0x253baf[_0x114d('0x32')]=_[_0x114d('0x30')](db[_0x114d('0x2c')]['rawAttributes']);_0x253baf['query']=_[_0x114d('0x30')](_0x2252ac[_0x114d('0x2f')]);_0x253baf[_0x114d('0x3c')]=_[_0x114d('0x31')](_0x253baf[_0x114d('0x32')],_0x253baf[_0x114d('0x2f')]);_0x271927['attributes']=_['intersection'](_0x253baf[_0x114d('0x32')],qs['fields'](_0x2252ac[_0x114d('0x2f')][_0x114d('0x34')]));_0x271927[_0x114d('0x33')]=_0x271927[_0x114d('0x33')]['length']?_0x271927[_0x114d('0x33')]:_0x253baf[_0x114d('0x32')];if(_0x2252ac[_0x114d('0x2f')][_0x114d('0x45')]){_0x271927[_0x114d('0x41')]=[{'all':!![]}];}_0x271927=_[_0x114d('0x3d')]({},_0x271927,_0x2252ac[_0x114d('0x40')]);return db[_0x114d('0x2c')][_0x114d('0x46')](_0x271927)[_0x114d('0x26')](handleEntityNotFound(_0x3a144b,null))['then'](respondWithResult(_0x3a144b,null))['catch'](handleError(_0x3a144b,null));};exports[_0x114d('0x47')]=function(_0x17780f,_0x7f9049){return db[_0x114d('0x2c')][_0x114d('0x47')](_0x17780f['body'],{})[_0x114d('0x26')](respondWithResult(_0x7f9049,0xc9))['catch'](handleError(_0x7f9049,null));};exports[_0x114d('0x25')]=function(_0x57cd04,_0x3c6e7b){if(_0x57cd04[_0x114d('0x48')]['id']){delete _0x57cd04[_0x114d('0x48')]['id'];}return db[_0x114d('0x2c')]['find']({'where':{'id':_0x57cd04[_0x114d('0x44')]['id']}})[_0x114d('0x26')](handleEntityNotFound(_0x3c6e7b,null))[_0x114d('0x26')](saveUpdates(_0x57cd04[_0x114d('0x48')],null))[_0x114d('0x26')](respondWithResult(_0x3c6e7b,null))[_0x114d('0x49')](handleError(_0x3c6e7b,null));};exports['destroy']=function(_0x5effbc,_0x50cd26){return db['ZohoField'][_0x114d('0x46')]({'where':{'id':_0x5effbc[_0x114d('0x44')]['id']}})[_0x114d('0x26')](handleEntityNotFound(_0x50cd26,null))['then'](removeEntity(_0x50cd26,null))[_0x114d('0x49')](handleError(_0x50cd26,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index d042481..d67df29 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 _0x8aad=['request-promise','../../config/environment','define','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash','util','api','bluebird'];(function(_0x28d18d,_0x55896b){var _0x470640=function(_0x57e78b){while(--_0x57e78b){_0x28d18d['push'](_0x28d18d['shift']());}};_0x470640(++_0x55896b);}(_0x8aad,0x146));var _0xd8aa=function(_0x5bacac,_0x3809b2){_0x5bacac=_0x5bacac-0x0;var _0x1100d9=_0x8aad[_0x5bacac];return _0x1100d9;};'use strict';var _=require(_0xd8aa('0x0'));var util=require(_0xd8aa('0x1'));var logger=require('../../config/logger')(_0xd8aa('0x2'));var moment=require('moment');var BPromise=require(_0xd8aa('0x3'));var rp=require(_0xd8aa('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd8aa('0x5'));var attributes=require('./intZohoField.attributes');module['exports']=function(_0x16b648,_0x43ddeb){return _0x16b648[_0xd8aa('0x6')]('ZohoField',attributes,{'tableName':_0xd8aa('0x7'),'paranoid':![],'indexes':[{'name':_0xd8aa('0x8'),'fields':[_0xd8aa('0x9'),_0xd8aa('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0a6b=['int_zoho_fields','zoho_unique_index','lodash','moment','request-promise','path','rimraf','./intZohoField.attributes','ZohoField'];(function(_0x279a93,_0x3b5aeb){var _0x5ca181=function(_0x25dc81){while(--_0x25dc81){_0x279a93['push'](_0x279a93['shift']());}};_0x5ca181(++_0x3b5aeb);}(_0x0a6b,0x18e));var _0xb0a6=function(_0x17fc20,_0x7d3f2f){_0x17fc20=_0x17fc20-0x0;var _0x29d108=_0x0a6b[_0x17fc20];return _0x29d108;};'use strict';var _=require(_0xb0a6('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xb0a6('0x1'));var BPromise=require('bluebird');var rp=require(_0xb0a6('0x2'));var fs=require('fs');var path=require(_0xb0a6('0x3'));var rimraf=require(_0xb0a6('0x4'));var config=require('../../config/environment');var attributes=require(_0xb0a6('0x5'));module['exports']=function(_0xbbdf89,_0x415e9e){return _0xbbdf89['define'](_0xb0a6('0x6'),attributes,{'tableName':_0xb0a6('0x7'),'paranoid':![],'indexes':[{'name':_0xb0a6('0x8'),'fields':['idField','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 29bd1c4..aa6018b 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 _0x3915=['../../config/environment','client','request','then','info','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','error','code','ZohoField,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x4eba75,_0x339353){var _0x310967=function(_0x2f66a2){while(--_0x2f66a2){_0x4eba75['push'](_0x4eba75['shift']());}};_0x310967(++_0x339353);}(_0x3915,0xca));var _0x5391=function(_0x2002b3,_0x11e91c){_0x2002b3=_0x2002b3-0x0;var _0x2756f0=_0x3915[_0x2002b3];return _0x2756f0;};'use strict';var _=require(_0x5391('0x0'));var util=require(_0x5391('0x1'));var moment=require(_0x5391('0x2'));var BPromise=require(_0x5391('0x3'));var rs=require(_0x5391('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5391('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5391('0x6'))('rpc');var config=require(_0x5391('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5391('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xdb4043,_0x4c00b1,_0x198551){return new BPromise(function(_0x5c071b,_0x47de4f){return client[_0x5391('0x9')](_0xdb4043,_0x198551)[_0x5391('0xa')](function(_0x58fc78){logger[_0x5391('0xb')]('ZohoField,\x20%s,\x20%s',_0x4c00b1,_0x5391('0xc'));logger[_0x5391('0xd')](_0x5391('0xe'),_0x4c00b1,_0x5391('0xc'),JSON['stringify'](_0x58fc78));if(_0x58fc78[_0x5391('0xf')]){if(_0x58fc78['error'][_0x5391('0x10')]===0x1f4){logger['error'](_0x5391('0x11'),_0x4c00b1,_0x58fc78['error'][_0x5391('0x12')]);return _0x47de4f(_0x58fc78['error'][_0x5391('0x12')]);}logger[_0x5391('0xf')](_0x5391('0x11'),_0x4c00b1,_0x58fc78['error'][_0x5391('0x12')]);return _0x5c071b(_0x58fc78['error'][_0x5391('0x12')]);}else{logger[_0x5391('0xb')](_0x5391('0x11'),_0x4c00b1,_0x5391('0xc'));_0x5c071b(_0x58fc78['result'][_0x5391('0x12')]);}})['catch'](function(_0x452972){logger[_0x5391('0xf')]('ZohoField,\x20%s,\x20%s',_0x4c00b1,_0x452972);_0x47de4f(_0x452972);});});} \ No newline at end of file +var _0x57bb=['request\x20sent','ZohoField,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ZohoField,\x20%s,\x20%s'];(function(_0x3d81fe,_0x2e89c1){var _0x3e5d8a=function(_0x1a67eb){while(--_0x1a67eb){_0x3d81fe['push'](_0x3d81fe['shift']());}};_0x3e5d8a(++_0x2e89c1);}(_0x57bb,0xd7));var _0xb57b=function(_0x23a874,_0x1b059a){_0x23a874=_0x23a874-0x0;var _0x3dcfbf=_0x57bb[_0x23a874];return _0x3dcfbf;};'use strict';var _=require(_0xb57b('0x0'));var util=require(_0xb57b('0x1'));var moment=require('moment');var BPromise=require(_0xb57b('0x2'));var rs=require(_0xb57b('0x3'));var fs=require('fs');var Redis=require(_0xb57b('0x4'));var db=require(_0xb57b('0x5'))['db'];var utils=require(_0xb57b('0x6'));var logger=require(_0xb57b('0x7'))(_0xb57b('0x8'));var config=require(_0xb57b('0x9'));var jayson=require(_0xb57b('0xa'));var client=jayson['client'][_0xb57b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x40e35f,_0x57d4fa,_0x55ebf2){return new BPromise(function(_0x2b740d,_0x51471a){return client[_0xb57b('0xc')](_0x40e35f,_0x55ebf2)[_0xb57b('0xd')](function(_0x235160){logger[_0xb57b('0xe')](_0xb57b('0xf'),_0x57d4fa,_0xb57b('0x10'));logger['debug'](_0xb57b('0x11'),_0x57d4fa,'request\x20sent',JSON['stringify'](_0x235160));if(_0x235160[_0xb57b('0x12')]){if(_0x235160['error']['code']===0x1f4){logger[_0xb57b('0x12')](_0xb57b('0xf'),_0x57d4fa,_0x235160[_0xb57b('0x12')][_0xb57b('0x13')]);return _0x51471a(_0x235160[_0xb57b('0x12')][_0xb57b('0x13')]);}logger[_0xb57b('0x12')](_0xb57b('0xf'),_0x57d4fa,_0x235160['error'][_0xb57b('0x13')]);return _0x2b740d(_0x235160[_0xb57b('0x12')][_0xb57b('0x13')]);}else{logger[_0xb57b('0xe')]('ZohoField,\x20%s,\x20%s',_0x57d4fa,_0xb57b('0x10'));_0x2b740d(_0x235160['result'][_0xb57b('0x13')]);}})[_0xb57b('0x14')](function(_0x23e003){logger[_0xb57b('0x12')](_0xb57b('0xf'),_0x57d4fa,_0x23e003);_0x51471a(_0x23e003);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 57a906b..f35ae40 100644 --- a/server/api/integration/index.js +++ b/server/api/integration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x3fc2ce,_0x5638f4){var _0xd3e9f1=function(_0x3178a5){while(--_0x3178a5){_0x3fc2ce['push'](_0x3fc2ce['shift']());}};_0xd3e9f1(++_0x5638f4);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x56bbf6,_0x2ff73d){var _0x399d68=function(_0x3112c5){while(--_0x3112c5){_0x56bbf6['push'](_0x56bbf6['shift']());}};_0x399d68(++_0x2ff73d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 0ae0227..f483b54 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 _0x5718=['exports','STRING','unique_name_and_version','app.js','state','sequelize'];(function(_0x5c5aa8,_0x1e700c){var _0x32e990=function(_0x39230c){while(--_0x39230c){_0x5c5aa8['push'](_0x5c5aa8['shift']());}};_0x32e990(++_0x1e700c);}(_0x5718,0xb9));var _0x8571=function(_0x3ebb9f,_0x14f819){_0x3ebb9f=_0x3ebb9f-0x0;var _0x4a8d69=_0x5718[_0x3ebb9f];return _0x4a8d69;};'use strict';var Sequelize=require(_0x8571('0x0'));module[_0x8571('0x1')]={'name':{'type':Sequelize[_0x8571('0x2')],'allowNull':![],'unique':_0x8571('0x3')},'version':{'type':Sequelize[_0x8571('0x2')],'allowNull':![],'unique':_0x8571('0x3')},'main':{'type':Sequelize[_0x8571('0x2')],'defaultValue':_0x8571('0x4')},'filename':{'type':Sequelize[_0x8571('0x2')]},'path':{'type':Sequelize[_0x8571('0x2')]},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize[_0x8571('0x2')]},'logo':{'type':Sequelize[_0x8571('0x2')]},'state':{'type':Sequelize['STRING'],'unique':_0x8571('0x5')},'description':{'type':Sequelize[_0x8571('0x2')]},'title':{'type':Sequelize[_0x8571('0x2')]},'remoteUri':{'type':Sequelize[_0x8571('0x2')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file +var _0xf248=['sequelize','exports','STRING','unique_name_and_version','app.js','BOOLEAN'];(function(_0x5e6b35,_0x4c9f1a){var _0xc9b82d=function(_0xf47cee){while(--_0xf47cee){_0x5e6b35['push'](_0x5e6b35['shift']());}};_0xc9b82d(++_0x4c9f1a);}(_0xf248,0xfc));var _0x8f24=function(_0x8b62cb,_0x513a11){_0x8b62cb=_0x8b62cb-0x0;var _0x831de8=_0xf248[_0x8b62cb];return _0x831de8;};'use strict';var Sequelize=require(_0x8f24('0x0'));module[_0x8f24('0x1')]={'name':{'type':Sequelize[_0x8f24('0x2')],'allowNull':![],'unique':_0x8f24('0x3')},'version':{'type':Sequelize[_0x8f24('0x2')],'allowNull':![],'unique':_0x8f24('0x3')},'main':{'type':Sequelize[_0x8f24('0x2')],'defaultValue':_0x8f24('0x4')},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x8f24('0x2')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0x8f24('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0x8f24('0x2')]},'logo':{'type':Sequelize[_0x8f24('0x2')]},'state':{'type':Sequelize['STRING'],'unique':'state'},'description':{'type':Sequelize[_0x8f24('0x2')]},'title':{'type':Sequelize[_0x8f24('0x2')]},'remoteUri':{'type':Sequelize[_0x8f24('0x2')]},'link':{'type':Sequelize[_0x8f24('0x2')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 0ee91a0..e264fab 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 _0x896e=['model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','filter','Integration','includeAll','include','findAll','rows','catch','keys','length','options','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','destroy','then','end','error','stack','name','send','index','rawAttributes','fieldName','type','key'];(function(_0x1e1970,_0x42a940){var _0x2d232c=function(_0x2006f6){while(--_0x2006f6){_0x1e1970['push'](_0x1e1970['shift']());}};_0x2d232c(++_0x42a940);}(_0x896e,0x1e9));var _0xe896=function(_0x332310,_0x57dc83){_0x332310=_0x332310-0x0;var _0x39de81=_0x896e[_0x332310];return _0x39de81;};'use strict';var emlformat=require(_0xe896('0x0'));var rimraf=require(_0xe896('0x1'));var zipdir=require(_0xe896('0x2'));var jsonpatch=require(_0xe896('0x3'));var rp=require(_0xe896('0x4'));var moment=require(_0xe896('0x5'));var BPromise=require(_0xe896('0x6'));var Mustache=require(_0xe896('0x7'));var util=require(_0xe896('0x8'));var path=require(_0xe896('0x9'));var sox=require(_0xe896('0xa'));var csv=require(_0xe896('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe896('0xc'));var _=require(_0xe896('0xd'));var squel=require(_0xe896('0xe'));var crypto=require(_0xe896('0xf'));var jsforce=require(_0xe896('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xe896('0xb'));var querystring=require(_0xe896('0x11'));var Papa=require(_0xe896('0x12'));var Redis=require('ioredis');var authService=require(_0xe896('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xe896('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe896('0x15'))(_0xe896('0x16'));var utils=require(_0xe896('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xe896('0x18'));var db=require(_0xe896('0x19'))['db'];function respondWithStatusCode(_0x3e8ac9,_0x580aac){_0x580aac=_0x580aac||0xcc;return function(_0x2aa522){if(_0x2aa522){return _0x3e8ac9[_0xe896('0x1a')](_0x580aac);}return _0x3e8ac9[_0xe896('0x1b')](_0x580aac)['end']();};}function respondWithResult(_0x2d0e46,_0x7dcf8a){_0x7dcf8a=_0x7dcf8a||0xc8;return function(_0x1e7ef8){if(_0x1e7ef8){return _0x2d0e46['status'](_0x7dcf8a)['json'](_0x1e7ef8);}};}function respondWithFilteredResult(_0x446ce2,_0x25606b){return function(_0x51e7b7){if(_0x51e7b7){var _0x5e78d6=typeof _0x25606b[_0xe896('0x1c')]===_0xe896('0x1d')&&typeof _0x25606b['limit']===_0xe896('0x1d');var _0x4e062a=_0x51e7b7[_0xe896('0x1e')];var _0x32f86d=_0x5e78d6?0x0:_0x25606b[_0xe896('0x1c')];var _0x5dc89d=_0x5e78d6?_0x51e7b7[_0xe896('0x1e')]:_0x25606b[_0xe896('0x1c')]+_0x25606b[_0xe896('0x1f')];var _0xbebbe1;if(_0x5dc89d>=_0x4e062a){_0x5dc89d=_0x4e062a;_0xbebbe1=0xc8;}else{_0xbebbe1=0xce;}_0x446ce2[_0xe896('0x1b')](_0xbebbe1);return _0x446ce2[_0xe896('0x20')](_0xe896('0x21'),_0x32f86d+'-'+_0x5dc89d+'/'+_0x4e062a)[_0xe896('0x22')](_0x51e7b7);}return null;};}function patchUpdates(_0x49547b){return function(_0x180d46){try{jsonpatch['apply'](_0x180d46,_0x49547b,!![]);}catch(_0x5d2c8d){return BPromise[_0xe896('0x23')](_0x5d2c8d);}return _0x180d46[_0xe896('0x24')]();};}function saveUpdates(_0x40502b,_0xeeec7c){return function(_0x498469){if(_0x498469){return _0x498469[_0xe896('0x25')](_0x40502b)['then'](function(_0x5001f7){return _0x5001f7;});}return null;};}function removeEntity(_0x45dd49,_0x41e689){return function(_0x1e952a){if(_0x1e952a){return _0x1e952a[_0xe896('0x26')]()[_0xe896('0x27')](function(){_0x45dd49[_0xe896('0x1b')](0xcc)[_0xe896('0x28')]();});}};}function handleEntityNotFound(_0x4b71cc,_0x390128){return function(_0x163a75){if(!_0x163a75){_0x4b71cc[_0xe896('0x1a')](0x194);}return _0x163a75;};}function handleError(_0x569d5f,_0x26635e){_0x26635e=_0x26635e||0x1f4;return function(_0xd50fe2){logger[_0xe896('0x29')](_0xd50fe2[_0xe896('0x2a')]);if(_0xd50fe2[_0xe896('0x2b')]){delete _0xd50fe2[_0xe896('0x2b')];}_0x569d5f['status'](_0x26635e)[_0xe896('0x2c')](_0xd50fe2);};}exports[_0xe896('0x2d')]=function(_0x201653,_0xbfb15b){var _0xace03f={},_0x5e0d9b={},_0x47c268={'count':0x0,'rows':[]};var _0x5c7dae=_['map'](db['Integration'][_0xe896('0x2e')],function(_0x29a18e){return{'name':_0x29a18e[_0xe896('0x2f')],'type':_0x29a18e[_0xe896('0x30')][_0xe896('0x31')]};});_0x5e0d9b[_0xe896('0x32')]=_[_0xe896('0x33')](_0x5c7dae,_0xe896('0x2b'));_0x5e0d9b['query']=_['keys'](_0x201653[_0xe896('0x34')]);_0x5e0d9b[_0xe896('0x35')]=_[_0xe896('0x36')](_0x5e0d9b[_0xe896('0x32')],_0x5e0d9b['query']);_0xace03f[_0xe896('0x37')]=_['intersection'](_0x5e0d9b['model'],qs[_0xe896('0x38')](_0x201653[_0xe896('0x34')][_0xe896('0x38')]));_0xace03f['attributes']=_0xace03f['attributes']['length']?_0xace03f[_0xe896('0x37')]:_0x5e0d9b[_0xe896('0x32')];if(!_0x201653[_0xe896('0x34')][_0xe896('0x39')](_0xe896('0x3a'))){_0xace03f['limit']=qs[_0xe896('0x1f')](_0x201653[_0xe896('0x34')][_0xe896('0x1f')]);_0xace03f[_0xe896('0x1c')]=qs[_0xe896('0x1c')](_0x201653[_0xe896('0x34')][_0xe896('0x1c')]);}_0xace03f[_0xe896('0x3b')]=qs['sort'](_0x201653[_0xe896('0x34')][_0xe896('0x3c')]);_0xace03f['where']=qs[_0xe896('0x35')](_['pick'](_0x201653[_0xe896('0x34')],_0x5e0d9b['filters']),_0x5c7dae);if(_0x201653[_0xe896('0x34')]['filter']){_0xace03f[_0xe896('0x3d')]=_[_0xe896('0x3e')](_0xace03f[_0xe896('0x3d')],{'$or':_[_0xe896('0x33')](_0x5c7dae,function(_0xeb9bbf){if(_0xeb9bbf['type']!=='VIRTUAL'){var _0x203aea={};_0x203aea[_0xeb9bbf[_0xe896('0x2b')]]={'$like':'%'+_0x201653[_0xe896('0x34')][_0xe896('0x3f')]+'%'};return _0x203aea;}})});}_0xace03f=_[_0xe896('0x3e')]({},_0xace03f,_0x201653['options']);var _0x5b8131={'where':_0xace03f[_0xe896('0x3d')]};return db[_0xe896('0x40')]['count'](_0x5b8131)['then'](function(_0x19d2fd){_0x47c268[_0xe896('0x1e')]=_0x19d2fd;if(_0x201653[_0xe896('0x34')][_0xe896('0x41')]){_0xace03f[_0xe896('0x42')]=[{'all':!![]}];}return db[_0xe896('0x40')][_0xe896('0x43')](_0xace03f);})[_0xe896('0x27')](function(_0x372c71){_0x47c268[_0xe896('0x44')]=_0x372c71;return _0x47c268;})[_0xe896('0x27')](respondWithFilteredResult(_0xbfb15b,_0xace03f))[_0xe896('0x45')](handleError(_0xbfb15b,null));};exports['show']=function(_0x1e5434,_0x143ad4){var _0x59b97f={'raw':![],'where':{'id':_0x1e5434['params']['id']}},_0x57366b={};_0x57366b[_0xe896('0x32')]=_[_0xe896('0x46')](db[_0xe896('0x40')]['rawAttributes']);_0x57366b[_0xe896('0x34')]=_[_0xe896('0x46')](_0x1e5434['query']);_0x57366b['filters']=_['intersection'](_0x57366b[_0xe896('0x32')],_0x57366b[_0xe896('0x34')]);_0x59b97f[_0xe896('0x37')]=_[_0xe896('0x36')](_0x57366b[_0xe896('0x32')],qs[_0xe896('0x38')](_0x1e5434['query'][_0xe896('0x38')]));_0x59b97f[_0xe896('0x37')]=_0x59b97f['attributes'][_0xe896('0x47')]?_0x59b97f[_0xe896('0x37')]:_0x57366b[_0xe896('0x32')];if(_0x1e5434[_0xe896('0x34')]['includeAll']){_0x59b97f[_0xe896('0x42')]=[{'all':!![]}];}_0x59b97f=_[_0xe896('0x3e')]({},_0x59b97f,_0x1e5434[_0xe896('0x48')]);return db[_0xe896('0x40')][_0xe896('0x49')](_0x59b97f)[_0xe896('0x27')](handleEntityNotFound(_0x143ad4,null))['then'](respondWithResult(_0x143ad4,null))[_0xe896('0x45')](handleError(_0x143ad4,null));};exports['create']=function(_0x234a22,_0x1c6ae1){return db[_0xe896('0x40')][_0xe896('0x4a')](_0x234a22[_0xe896('0x4b')],{})[_0xe896('0x27')](respondWithResult(_0x1c6ae1,0xc9))['catch'](handleError(_0x1c6ae1,null));};exports[_0xe896('0x25')]=function(_0x206ad3,_0x4818cd){if(_0x206ad3[_0xe896('0x4b')]['id']){delete _0x206ad3[_0xe896('0x4b')]['id'];}return db['Integration'][_0xe896('0x49')]({'where':{'id':_0x206ad3['params']['id']}})[_0xe896('0x27')](handleEntityNotFound(_0x4818cd,null))[_0xe896('0x27')](saveUpdates(_0x206ad3[_0xe896('0x4b')],null))[_0xe896('0x27')](respondWithResult(_0x4818cd,null))[_0xe896('0x45')](handleError(_0x4818cd,null));};exports['destroy']=function(_0x1fa3fd,_0x819c8a){return db[_0xe896('0x40')]['find']({'where':{'id':_0x1fa3fd[_0xe896('0x4c')]['id']}})['then'](handleEntityNotFound(_0x819c8a,null))['then'](removeEntity(_0x819c8a,null))[_0xe896('0x45')](handleError(_0x819c8a,null));}; \ No newline at end of file +var _0x187d=['body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','update','destroy','error','stack','name','index','map','Integration','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','where','filter','merge','includeAll','include','findAll','then','rows','catch','show','params','fields','options','find','create'];(function(_0x5a4ad5,_0x4d83a7){var _0x44ebda=function(_0x3080b1){while(--_0x3080b1){_0x5a4ad5['push'](_0x5a4ad5['shift']());}};_0x44ebda(++_0x4d83a7);}(_0x187d,0x93));var _0xd187=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0x187d[_0x3e112d];return _0x531c31;};'use strict';var emlformat=require(_0xd187('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd187('0x1'));var jsonpatch=require(_0xd187('0x2'));var rp=require(_0xd187('0x3'));var moment=require(_0xd187('0x4'));var BPromise=require(_0xd187('0x5'));var Mustache=require(_0xd187('0x6'));var util=require('util');var path=require(_0xd187('0x7'));var sox=require(_0xd187('0x8'));var csv=require('to-csv');var ejs=require(_0xd187('0x9'));var fs=require('fs');var fs_extra=require(_0xd187('0xa'));var _=require(_0xd187('0xb'));var squel=require(_0xd187('0xc'));var crypto=require(_0xd187('0xd'));var jsforce=require(_0xd187('0xe'));var deskjs=require(_0xd187('0xf'));var toCsv=require(_0xd187('0x10'));var querystring=require('querystring');var Papa=require(_0xd187('0x11'));var Redis=require(_0xd187('0x12'));var authService=require(_0xd187('0x13'));var qs=require(_0xd187('0x14'));var as=require(_0xd187('0x15'));var hardwareService=require(_0xd187('0x16'));var logger=require('../../config/logger')(_0xd187('0x17'));var utils=require(_0xd187('0x18'));var config=require(_0xd187('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xd187('0x1a'))['db'];function respondWithStatusCode(_0x4545cf,_0x32ba07){_0x32ba07=_0x32ba07||0xcc;return function(_0x59ee4a){if(_0x59ee4a){return _0x4545cf[_0xd187('0x1b')](_0x32ba07);}return _0x4545cf[_0xd187('0x1c')](_0x32ba07)[_0xd187('0x1d')]();};}function respondWithResult(_0x126d1a,_0x517b25){_0x517b25=_0x517b25||0xc8;return function(_0x39a927){if(_0x39a927){return _0x126d1a[_0xd187('0x1c')](_0x517b25)[_0xd187('0x1e')](_0x39a927);}};}function respondWithFilteredResult(_0x188cfe,_0x4c8f68){return function(_0x245d3e){if(_0x245d3e){var _0x52a208=typeof _0x4c8f68['offset']===_0xd187('0x1f')&&typeof _0x4c8f68['limit']==='undefined';var _0x207b36=_0x245d3e[_0xd187('0x20')];var _0x374fe0=_0x52a208?0x0:_0x4c8f68[_0xd187('0x21')];var _0x21df74=_0x52a208?_0x245d3e[_0xd187('0x20')]:_0x4c8f68[_0xd187('0x21')]+_0x4c8f68[_0xd187('0x22')];var _0x4f2f88;if(_0x21df74>=_0x207b36){_0x21df74=_0x207b36;_0x4f2f88=0xc8;}else{_0x4f2f88=0xce;}_0x188cfe[_0xd187('0x1c')](_0x4f2f88);return _0x188cfe[_0xd187('0x23')](_0xd187('0x24'),_0x374fe0+'-'+_0x21df74+'/'+_0x207b36)[_0xd187('0x1e')](_0x245d3e);}return null;};}function patchUpdates(_0x5204ee){return function(_0x2f7fb3){try{jsonpatch[_0xd187('0x25')](_0x2f7fb3,_0x5204ee,!![]);}catch(_0xc5bba5){return BPromise['reject'](_0xc5bba5);}return _0x2f7fb3['save']();};}function saveUpdates(_0x57cf1d,_0x435d94){return function(_0x33741d){if(_0x33741d){return _0x33741d[_0xd187('0x26')](_0x57cf1d)['then'](function(_0x2c07c8){return _0x2c07c8;});}return null;};}function removeEntity(_0x57186b,_0x145771){return function(_0x5a7a23){if(_0x5a7a23){return _0x5a7a23[_0xd187('0x27')]()['then'](function(){_0x57186b['status'](0xcc)[_0xd187('0x1d')]();});}};}function handleEntityNotFound(_0x4d992b,_0x12da33){return function(_0x598aa4){if(!_0x598aa4){_0x4d992b['sendStatus'](0x194);}return _0x598aa4;};}function handleError(_0x4eac6a,_0x848ddd){_0x848ddd=_0x848ddd||0x1f4;return function(_0xeff822){logger[_0xd187('0x28')](_0xeff822[_0xd187('0x29')]);if(_0xeff822['name']){delete _0xeff822[_0xd187('0x2a')];}_0x4eac6a[_0xd187('0x1c')](_0x848ddd)['send'](_0xeff822);};}exports[_0xd187('0x2b')]=function(_0x1c87ee,_0x34febe){var _0x4c50a5={},_0x15e2e8={},_0x56e292={'count':0x0,'rows':[]};var _0x263e31=_[_0xd187('0x2c')](db[_0xd187('0x2d')][_0xd187('0x2e')],function(_0x489f2e){return{'name':_0x489f2e[_0xd187('0x2f')],'type':_0x489f2e[_0xd187('0x30')]['key']};});_0x15e2e8['model']=_[_0xd187('0x2c')](_0x263e31,_0xd187('0x2a'));_0x15e2e8[_0xd187('0x31')]=_[_0xd187('0x32')](_0x1c87ee[_0xd187('0x31')]);_0x15e2e8[_0xd187('0x33')]=_[_0xd187('0x34')](_0x15e2e8[_0xd187('0x35')],_0x15e2e8['query']);_0x4c50a5[_0xd187('0x36')]=_[_0xd187('0x34')](_0x15e2e8[_0xd187('0x35')],qs['fields'](_0x1c87ee[_0xd187('0x31')]['fields']));_0x4c50a5[_0xd187('0x36')]=_0x4c50a5[_0xd187('0x36')][_0xd187('0x37')]?_0x4c50a5['attributes']:_0x15e2e8['model'];if(!_0x1c87ee[_0xd187('0x31')][_0xd187('0x38')]('nolimit')){_0x4c50a5[_0xd187('0x22')]=qs[_0xd187('0x22')](_0x1c87ee[_0xd187('0x31')]['limit']);_0x4c50a5['offset']=qs[_0xd187('0x21')](_0x1c87ee[_0xd187('0x31')]['offset']);}_0x4c50a5['order']=qs['sort'](_0x1c87ee[_0xd187('0x31')]['sort']);_0x4c50a5[_0xd187('0x39')]=qs[_0xd187('0x33')](_['pick'](_0x1c87ee[_0xd187('0x31')],_0x15e2e8['filters']),_0x263e31);if(_0x1c87ee[_0xd187('0x31')][_0xd187('0x3a')]){_0x4c50a5['where']=_[_0xd187('0x3b')](_0x4c50a5[_0xd187('0x39')],{'$or':_['map'](_0x263e31,function(_0x4399a5){if(_0x4399a5['type']!=='VIRTUAL'){var _0x26b06d={};_0x26b06d[_0x4399a5[_0xd187('0x2a')]]={'$like':'%'+_0x1c87ee[_0xd187('0x31')][_0xd187('0x3a')]+'%'};return _0x26b06d;}})});}_0x4c50a5=_[_0xd187('0x3b')]({},_0x4c50a5,_0x1c87ee['options']);var _0x8860c={'where':_0x4c50a5[_0xd187('0x39')]};return db[_0xd187('0x2d')]['count'](_0x8860c)['then'](function(_0x538c05){_0x56e292['count']=_0x538c05;if(_0x1c87ee[_0xd187('0x31')][_0xd187('0x3c')]){_0x4c50a5[_0xd187('0x3d')]=[{'all':!![]}];}return db[_0xd187('0x2d')][_0xd187('0x3e')](_0x4c50a5);})[_0xd187('0x3f')](function(_0x4699e1){_0x56e292[_0xd187('0x40')]=_0x4699e1;return _0x56e292;})['then'](respondWithFilteredResult(_0x34febe,_0x4c50a5))[_0xd187('0x41')](handleError(_0x34febe,null));};exports[_0xd187('0x42')]=function(_0x31d9d2,_0x51c7fc){var _0x21cbf6={'raw':![],'where':{'id':_0x31d9d2[_0xd187('0x43')]['id']}},_0x48c100={};_0x48c100[_0xd187('0x35')]=_[_0xd187('0x32')](db[_0xd187('0x2d')][_0xd187('0x2e')]);_0x48c100['query']=_[_0xd187('0x32')](_0x31d9d2[_0xd187('0x31')]);_0x48c100[_0xd187('0x33')]=_[_0xd187('0x34')](_0x48c100['model'],_0x48c100[_0xd187('0x31')]);_0x21cbf6[_0xd187('0x36')]=_['intersection'](_0x48c100[_0xd187('0x35')],qs[_0xd187('0x44')](_0x31d9d2['query']['fields']));_0x21cbf6[_0xd187('0x36')]=_0x21cbf6[_0xd187('0x36')]['length']?_0x21cbf6['attributes']:_0x48c100['model'];if(_0x31d9d2[_0xd187('0x31')][_0xd187('0x3c')]){_0x21cbf6[_0xd187('0x3d')]=[{'all':!![]}];}_0x21cbf6=_[_0xd187('0x3b')]({},_0x21cbf6,_0x31d9d2[_0xd187('0x45')]);return db[_0xd187('0x2d')][_0xd187('0x46')](_0x21cbf6)['then'](handleEntityNotFound(_0x51c7fc,null))[_0xd187('0x3f')](respondWithResult(_0x51c7fc,null))[_0xd187('0x41')](handleError(_0x51c7fc,null));};exports[_0xd187('0x47')]=function(_0x3ce4a1,_0x3f5def){return db[_0xd187('0x2d')][_0xd187('0x47')](_0x3ce4a1[_0xd187('0x48')],{})['then'](respondWithResult(_0x3f5def,0xc9))[_0xd187('0x41')](handleError(_0x3f5def,null));};exports[_0xd187('0x26')]=function(_0x4523c8,_0x1449d7){if(_0x4523c8[_0xd187('0x48')]['id']){delete _0x4523c8['body']['id'];}return db[_0xd187('0x2d')][_0xd187('0x46')]({'where':{'id':_0x4523c8['params']['id']}})[_0xd187('0x3f')](handleEntityNotFound(_0x1449d7,null))[_0xd187('0x3f')](saveUpdates(_0x4523c8['body'],null))['then'](respondWithResult(_0x1449d7,null))['catch'](handleError(_0x1449d7,null));};exports['destroy']=function(_0x473bef,_0x22f432){return db[_0xd187('0x2d')][_0xd187('0x46')]({'where':{'id':_0x473bef[_0xd187('0x43')]['id']}})[_0xd187('0x3f')](handleEntityNotFound(_0x22f432,null))[_0xd187('0x3f')](removeEntity(_0x22f432,null))['catch'](handleError(_0x22f432,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 005d4fa..dd3acaf 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 _0x59dc=['path','./integration.attributes','exports','define','integrations','lodash','util','api','moment','bluebird'];(function(_0x147865,_0x5666c1){var _0x36c54a=function(_0x3cfb42){while(--_0x3cfb42){_0x147865['push'](_0x147865['shift']());}};_0x36c54a(++_0x5666c1);}(_0x59dc,0x11d));var _0xc59d=function(_0x3e3d07,_0xeb0f69){_0x3e3d07=_0x3e3d07-0x0;var _0x2650f6=_0x59dc[_0x3e3d07];return _0x2650f6;};'use strict';var _=require(_0xc59d('0x0'));var util=require(_0xc59d('0x1'));var logger=require('../../config/logger')(_0xc59d('0x2'));var moment=require(_0xc59d('0x3'));var BPromise=require(_0xc59d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc59d('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc59d('0x6'));module[_0xc59d('0x7')]=function(_0x25ac91,_0xe24448){return _0x25ac91[_0xc59d('0x8')]('Integration',attributes,{'tableName':_0xc59d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd582=['request-promise','path','rimraf','../../config/environment','./integration.attributes','exports','define','Integration','integrations','util','api','moment','bluebird'];(function(_0x2ec859,_0x558f6f){var _0x17b48e=function(_0xca621e){while(--_0xca621e){_0x2ec859['push'](_0x2ec859['shift']());}};_0x17b48e(++_0x558f6f);}(_0xd582,0x98));var _0x2d58=function(_0x105560,_0x3c407a){_0x105560=_0x105560-0x0;var _0x135dac=_0xd582[_0x105560];return _0x135dac;};'use strict';var _=require('lodash');var util=require(_0x2d58('0x0'));var logger=require('../../config/logger')(_0x2d58('0x1'));var moment=require(_0x2d58('0x2'));var BPromise=require(_0x2d58('0x3'));var rp=require(_0x2d58('0x4'));var fs=require('fs');var path=require(_0x2d58('0x5'));var rimraf=require(_0x2d58('0x6'));var config=require(_0x2d58('0x7'));var attributes=require(_0x2d58('0x8'));module[_0x2d58('0x9')]=function(_0x160e01,_0x208932){return _0x160e01[_0x2d58('0xa')](_0x2d58('0xb'),attributes,{'tableName':_0x2d58('0xc'),'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 817f479..55d8652 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 _0x4137=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','Integration,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring'];(function(_0x318840,_0x561b1e){var _0x223da4=function(_0x510071){while(--_0x510071){_0x318840['push'](_0x318840['shift']());}};_0x223da4(++_0x561b1e);}(_0x4137,0xf8));var _0x7413=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4137[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x7413('0x0'));var util=require(_0x7413('0x1'));var moment=require(_0x7413('0x2'));var BPromise=require(_0x7413('0x3'));var rs=require(_0x7413('0x4'));var fs=require('fs');var Redis=require(_0x7413('0x5'));var db=require(_0x7413('0x6'))['db'];var utils=require(_0x7413('0x7'));var logger=require(_0x7413('0x8'))(_0x7413('0x9'));var config=require(_0x7413('0xa'));var jayson=require(_0x7413('0xb'));var client=jayson['client'][_0x7413('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x188d89,_0x5b39ac,_0x15af0d){return new BPromise(function(_0x5f4cd0,_0x3236ec){return client[_0x7413('0xd')](_0x188d89,_0x15af0d)['then'](function(_0x422bf5){logger[_0x7413('0xe')]('Integration,\x20%s,\x20%s',_0x5b39ac,_0x7413('0xf'));logger[_0x7413('0x10')](_0x7413('0x11'),_0x5b39ac,_0x7413('0xf'),JSON[_0x7413('0x12')](_0x422bf5));if(_0x422bf5['error']){if(_0x422bf5[_0x7413('0x13')][_0x7413('0x14')]===0x1f4){logger['error'](_0x7413('0x15'),_0x5b39ac,_0x422bf5[_0x7413('0x13')][_0x7413('0x16')]);return _0x3236ec(_0x422bf5['error']['message']);}logger['error'](_0x7413('0x15'),_0x5b39ac,_0x422bf5[_0x7413('0x13')]['message']);return _0x5f4cd0(_0x422bf5[_0x7413('0x13')][_0x7413('0x16')]);}else{logger['info'](_0x7413('0x15'),_0x5b39ac,'request\x20sent');_0x5f4cd0(_0x422bf5['result'][_0x7413('0x16')]);}})['catch'](function(_0x195c72){logger['error'](_0x7413('0x15'),_0x5b39ac,_0x195c72);_0x3236ec(_0x195c72);});});} \ No newline at end of file +var _0x0b0e=['Integration,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Integration,\x20%s,\x20%s','debug'];(function(_0x12aaee,_0x5bf50c){var _0x37c350=function(_0x182775){while(--_0x182775){_0x12aaee['push'](_0x12aaee['shift']());}};_0x37c350(++_0x5bf50c);}(_0x0b0e,0x187));var _0xe0b0=function(_0x159f91,_0xe8a30f){_0x159f91=_0x159f91-0x0;var _0x26bd65=_0x0b0e[_0x159f91];return _0x26bd65;};'use strict';var _=require(_0xe0b0('0x0'));var util=require('util');var moment=require(_0xe0b0('0x1'));var BPromise=require('bluebird');var rs=require(_0xe0b0('0x2'));var fs=require('fs');var Redis=require(_0xe0b0('0x3'));var db=require(_0xe0b0('0x4'))['db'];var utils=require(_0xe0b0('0x5'));var logger=require(_0xe0b0('0x6'))(_0xe0b0('0x7'));var config=require(_0xe0b0('0x8'));var jayson=require(_0xe0b0('0x9'));var client=jayson[_0xe0b0('0xa')][_0xe0b0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x219b1c,_0x5cf9cc,_0x50be7f){return new BPromise(function(_0x11effc,_0x435060){return client[_0xe0b0('0xc')](_0x219b1c,_0x50be7f)[_0xe0b0('0xd')](function(_0x4c24f9){logger[_0xe0b0('0xe')](_0xe0b0('0xf'),_0x5cf9cc,'request\x20sent');logger[_0xe0b0('0x10')](_0xe0b0('0x11'),_0x5cf9cc,'request\x20sent',JSON[_0xe0b0('0x12')](_0x4c24f9));if(_0x4c24f9[_0xe0b0('0x13')]){if(_0x4c24f9[_0xe0b0('0x13')]['code']===0x1f4){logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4c24f9[_0xe0b0('0x13')][_0xe0b0('0x14')]);return _0x435060(_0x4c24f9[_0xe0b0('0x13')]['message']);}logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4c24f9[_0xe0b0('0x13')][_0xe0b0('0x14')]);return _0x11effc(_0x4c24f9[_0xe0b0('0x13')]['message']);}else{logger[_0xe0b0('0xe')]('Integration,\x20%s,\x20%s',_0x5cf9cc,_0xe0b0('0x15'));_0x11effc(_0x4c24f9[_0xe0b0('0x16')]['message']);}})[_0xe0b0('0x17')](function(_0x4a4cc0){logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4a4cc0);_0x435060(_0x4a4cc0);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 0a7b828..67ca2b6 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 _0x5f66=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','create','put','update','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5f66,0x1a0));var _0x65f6=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x5f66[_0x502c7d];return _0x30b7ed;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./integrationReport.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['show']);router['post']('/',auth[_0x65f6('0x8')](),controller[_0x65f6('0xc')]);router[_0x65f6('0xd')](_0x65f6('0xb'),auth['isAuthenticated'](),controller[_0x65f6('0xe')]);router['delete']('/:id',auth[_0x65f6('0x8')](),controller['destroy']);module[_0x65f6('0xf')]=router; \ No newline at end of file +var _0x2ef3=['express','Router','../../components/auth/service','../../components/interaction/service','./integrationReport.controller','get','/describe','isAuthenticated','describe','/:id','show','post','update','delete','exports','multer','util','path','connect-timeout'];(function(_0x188dd9,_0x1c06f0){var _0x4e1ffb=function(_0x19a7c9){while(--_0x19a7c9){_0x188dd9['push'](_0x188dd9['shift']());}};_0x4e1ffb(++_0x1c06f0);}(_0x2ef3,0xba));var _0x32ef=function(_0x1e8315,_0x53bb7b){_0x1e8315=_0x1e8315-0x0;var _0x175091=_0x2ef3[_0x1e8315];return _0x175091;};'use strict';var multer=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var path=require(_0x32ef('0x2'));var timeout=require(_0x32ef('0x3'));var express=require(_0x32ef('0x4'));var router=express[_0x32ef('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x32ef('0x6'));var interaction=require(_0x32ef('0x7'));var config=require('../../config/environment');var controller=require(_0x32ef('0x8'));router[_0x32ef('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x32ef('0x9')](_0x32ef('0xa'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x9')](_0x32ef('0xd'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xe')]);router[_0x32ef('0xf')]('/',auth[_0x32ef('0xb')](),controller['create']);router['put'](_0x32ef('0xd'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x10')]);router[_0x32ef('0x11')]('/:id',auth[_0x32ef('0xb')](),controller['destroy']);module[_0x32ef('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 8bee58f..080c2b8 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 _0x5bdc=['TEXT','ENUM','SENDING','RECEIVED','FAILED','STRING','INTEGER','DATE','BOOLEAN'];(function(_0x9c75f4,_0xc54e83){var _0x57f1db=function(_0x42c906){while(--_0x42c906){_0x9c75f4['push'](_0x9c75f4['shift']());}};_0x57f1db(++_0xc54e83);}(_0x5bdc,0xef));var _0xc5bd=function(_0x583f6e,_0x1ac5e0){_0x583f6e=_0x583f6e-0x0;var _0x89e6c4=_0x5bdc[_0x583f6e];return _0x89e6c4;};'use strict';var Sequelize=require('sequelize');module['exports']={'integration':{'type':Sequelize[_0xc5bd('0x0')]},'eventChannel':{'type':Sequelize[_0xc5bd('0x0')]},'exitStatus':{'type':Sequelize[_0xc5bd('0x0')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0xc5bd('0x1')]},'contacts':{'type':Sequelize[_0xc5bd('0x0')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xc5bd('0x0')]},'calleridname':{'type':Sequelize[_0xc5bd('0x0')]},'queue':{'type':Sequelize[_0xc5bd('0x0')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0xc5bd('0x2')]},'agentconnectAt':{'type':Sequelize[_0xc5bd('0x2')]},'holdtime':{'type':Sequelize[_0xc5bd('0x1')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0xc5bd('0x1')]},'agentacw':{'type':Sequelize[_0xc5bd('0x3')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0xc5bd('0x0')]},'agentringnoanswer':{'type':Sequelize[_0xc5bd('0x3')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xc5bd('0x2')]},'agentdump':{'type':Sequelize[_0xc5bd('0x3')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xc5bd('0x2')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xc5bd('0x0')]},'channelstate':{'type':Sequelize[_0xc5bd('0x1')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xc5bd('0x0')]},'connectedlinename':{'type':Sequelize[_0xc5bd('0x0')]},'language':{'type':Sequelize[_0xc5bd('0x0')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xc5bd('0x0')]},'exten':{'type':Sequelize[_0xc5bd('0x0')]},'priority':{'type':Sequelize[_0xc5bd('0x0')]},'destchannel':{'type':Sequelize[_0xc5bd('0x0')]},'destchannelstate':{'type':Sequelize[_0xc5bd('0x1')]},'destchannelstatedesc':{'type':Sequelize[_0xc5bd('0x0')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xc5bd('0x0')]},'destconnectedlinenum':{'type':Sequelize[_0xc5bd('0x0')]},'destconnectedlinename':{'type':Sequelize[_0xc5bd('0x0')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0xc5bd('0x0')]},'destcontext':{'type':Sequelize[_0xc5bd('0x0')]},'destexten':{'type':Sequelize[_0xc5bd('0x0')]},'destpriority':{'type':Sequelize[_0xc5bd('0x0')]},'destuniqueid':{'type':Sequelize[_0xc5bd('0x0')]},'messageId':{'type':Sequelize[_0xc5bd('0x0')]},'inReplyTo':{'type':Sequelize[_0xc5bd('0x0')]},'subject':{'type':Sequelize[_0xc5bd('0x0')]},'from':{'type':Sequelize[_0xc5bd('0x0')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0xc5bd('0x0')]},'attachment':{'type':Sequelize[_0xc5bd('0x4')]},'html':{'type':Sequelize[_0xc5bd('0x4')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0xc5bd('0x5')]('SENT',_0xc5bd('0x6'),_0xc5bd('0x7'),_0xc5bd('0x8'))},'url':{'type':Sequelize[_0xc5bd('0x0')]},'app':{'type':Sequelize[_0xc5bd('0x0')]},'appdata':{'type':Sequelize[_0xc5bd('0x0')]},'projectId':{'type':Sequelize[_0xc5bd('0x1')]}}; \ No newline at end of file +var _0xecf4=['BOOLEAN','TEXT','ENUM','SENT','SENDING','FAILED','STRING','INTEGER','DATE'];(function(_0x384d07,_0x35b32f){var _0x4fdb50=function(_0x3588f3){while(--_0x3588f3){_0x384d07['push'](_0x384d07['shift']());}};_0x4fdb50(++_0x35b32f);}(_0xecf4,0xcc));var _0x4ecf=function(_0x25701b,_0x2a6976){_0x25701b=_0x25701b-0x0;var _0x3a8a2c=_0xecf4[_0x25701b];return _0x3a8a2c;};'use strict';var Sequelize=require('sequelize');module['exports']={'integration':{'type':Sequelize[_0x4ecf('0x0')]},'eventChannel':{'type':Sequelize[_0x4ecf('0x0')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0x4ecf('0x1')]},'contacts':{'type':Sequelize[_0x4ecf('0x0')]},'uniqueid':{'type':Sequelize[_0x4ecf('0x0')]},'calleridnum':{'type':Sequelize[_0x4ecf('0x0')]},'calleridname':{'type':Sequelize[_0x4ecf('0x0')]},'queue':{'type':Sequelize[_0x4ecf('0x0')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x4ecf('0x0')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x4ecf('0x2')]},'holdtime':{'type':Sequelize[_0x4ecf('0x1')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x4ecf('0x2')]},'talktime':{'type':Sequelize[_0x4ecf('0x1')]},'agentacw':{'type':Sequelize[_0x4ecf('0x3')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x4ecf('0x1')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize[_0x4ecf('0x3')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x4ecf('0x2')]},'agentdump':{'type':Sequelize[_0x4ecf('0x3')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x4ecf('0x2')]},'lastevent':{'type':Sequelize[_0x4ecf('0x0')]},'channel':{'type':Sequelize[_0x4ecf('0x0')]},'channelstate':{'type':Sequelize[_0x4ecf('0x1')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x4ecf('0x0')]},'connectedlinename':{'type':Sequelize[_0x4ecf('0x0')]},'language':{'type':Sequelize[_0x4ecf('0x0')]},'accountcode':{'type':Sequelize[_0x4ecf('0x0')]},'context':{'type':Sequelize[_0x4ecf('0x0')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x4ecf('0x0')]},'destchannel':{'type':Sequelize[_0x4ecf('0x0')]},'destchannelstate':{'type':Sequelize[_0x4ecf('0x1')]},'destchannelstatedesc':{'type':Sequelize[_0x4ecf('0x0')]},'destcalleridnum':{'type':Sequelize[_0x4ecf('0x0')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x4ecf('0x0')]},'destconnectedlinename':{'type':Sequelize[_0x4ecf('0x0')]},'destlanguage':{'type':Sequelize[_0x4ecf('0x0')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x4ecf('0x0')]},'messageId':{'type':Sequelize[_0x4ecf('0x0')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0x4ecf('0x0')]},'from':{'type':Sequelize[_0x4ecf('0x0')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x4ecf('0x0')]},'attachment':{'type':Sequelize[_0x4ecf('0x4')]},'html':{'type':Sequelize[_0x4ecf('0x4')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0x4ecf('0x5')](_0x4ecf('0x6'),_0x4ecf('0x7'),'RECEIVED',_0x4ecf('0x8'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0x4ecf('0x0')]},'projectId':{'type':Sequelize[_0x4ecf('0x1')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index e0ec225..4205a7e 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 _0x53ca=['offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','IntegrationReport','includeAll','include','findAll','rows','catch','show','params','length','options','create','body','update','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','fs-extra','lodash','crypto','ioredis','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0xd5a980,_0x77f34f){var _0x1dc99b=function(_0x1b8b25){while(--_0x1b8b25){_0xd5a980['push'](_0xd5a980['shift']());}};_0x1dc99b(++_0x77f34f);}(_0x53ca,0x73));var _0xa53c=function(_0x1dfebf,_0x1d6791){_0x1dfebf=_0x1dfebf-0x0;var _0x5ec3fe=_0x53ca[_0x1dfebf];return _0x5ec3fe;};'use strict';var emlformat=require(_0xa53c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa53c('0x1'));var jsonpatch=require(_0xa53c('0x2'));var rp=require(_0xa53c('0x3'));var moment=require(_0xa53c('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa53c('0x5'));var path=require(_0xa53c('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa53c('0x7'));var _=require(_0xa53c('0x8'));var squel=require('squel');var crypto=require(_0xa53c('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa53c('0xa'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa53c('0xb'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa53c('0xc'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa53c('0xd'));var db=require(_0xa53c('0xe'))['db'];function respondWithStatusCode(_0x34d553,_0x1854d7){_0x1854d7=_0x1854d7||0xcc;return function(_0x2c25e4){if(_0x2c25e4){return _0x34d553[_0xa53c('0xf')](_0x1854d7);}return _0x34d553[_0xa53c('0x10')](_0x1854d7)[_0xa53c('0x11')]();};}function respondWithResult(_0x2c12f7,_0x1f4a57){_0x1f4a57=_0x1f4a57||0xc8;return function(_0x5e43ae){if(_0x5e43ae){return _0x2c12f7['status'](_0x1f4a57)[_0xa53c('0x12')](_0x5e43ae);}};}function respondWithFilteredResult(_0x260b53,_0x5ac243){return function(_0x4f54bf){if(_0x4f54bf){var _0x345914=typeof _0x5ac243[_0xa53c('0x13')]===_0xa53c('0x14')&&typeof _0x5ac243[_0xa53c('0x15')]===_0xa53c('0x14');var _0x29e271=_0x4f54bf[_0xa53c('0x16')];var _0x190a61=_0x345914?0x0:_0x5ac243[_0xa53c('0x13')];var _0x3c2d42=_0x345914?_0x4f54bf[_0xa53c('0x16')]:_0x5ac243['offset']+_0x5ac243[_0xa53c('0x15')];var _0x5bfa27;if(_0x3c2d42>=_0x29e271){_0x3c2d42=_0x29e271;_0x5bfa27=0xc8;}else{_0x5bfa27=0xce;}_0x260b53['status'](_0x5bfa27);return _0x260b53['set'](_0xa53c('0x17'),_0x190a61+'-'+_0x3c2d42+'/'+_0x29e271)['json'](_0x4f54bf);}return null;};}function patchUpdates(_0xc6f728){return function(_0x517850){try{jsonpatch[_0xa53c('0x18')](_0x517850,_0xc6f728,!![]);}catch(_0x388975){return BPromise[_0xa53c('0x19')](_0x388975);}return _0x517850[_0xa53c('0x1a')]();};}function saveUpdates(_0x45237e,_0x270445){return function(_0x2d3845){if(_0x2d3845){return _0x2d3845['update'](_0x45237e)[_0xa53c('0x1b')](function(_0x295a8c){return _0x295a8c;});}return null;};}function removeEntity(_0xeff361,_0x403773){return function(_0x66bcf4){if(_0x66bcf4){return _0x66bcf4[_0xa53c('0x1c')]()[_0xa53c('0x1b')](function(){_0xeff361[_0xa53c('0x10')](0xcc)[_0xa53c('0x11')]();});}};}function handleEntityNotFound(_0x565857,_0x2afaff){return function(_0x35e4f6){if(!_0x35e4f6){_0x565857[_0xa53c('0xf')](0x194);}return _0x35e4f6;};}function handleError(_0x262c73,_0x2716a1){_0x2716a1=_0x2716a1||0x1f4;return function(_0x34d270){logger['error'](_0x34d270[_0xa53c('0x1d')]);if(_0x34d270[_0xa53c('0x1e')]){delete _0x34d270[_0xa53c('0x1e')];}_0x262c73[_0xa53c('0x10')](_0x2716a1)['send'](_0x34d270);};}exports[_0xa53c('0x1f')]=function(_0x594034,_0x3e5087){var _0x3447c1={},_0x4d52e2={},_0x57a275={'count':0x0,'rows':[]};var _0x45b5c1=_[_0xa53c('0x20')](db['IntegrationReport'][_0xa53c('0x21')],function(_0xa9e1d2){return{'name':_0xa9e1d2[_0xa53c('0x22')],'type':_0xa9e1d2[_0xa53c('0x23')][_0xa53c('0x24')]};});_0x4d52e2[_0xa53c('0x25')]=_[_0xa53c('0x20')](_0x45b5c1,_0xa53c('0x1e'));_0x4d52e2[_0xa53c('0x26')]=_[_0xa53c('0x27')](_0x594034[_0xa53c('0x26')]);_0x4d52e2['filters']=_[_0xa53c('0x28')](_0x4d52e2['model'],_0x4d52e2[_0xa53c('0x26')]);_0x3447c1['attributes']=_[_0xa53c('0x28')](_0x4d52e2['model'],qs[_0xa53c('0x29')](_0x594034[_0xa53c('0x26')][_0xa53c('0x29')]));_0x3447c1[_0xa53c('0x2a')]=_0x3447c1[_0xa53c('0x2a')]['length']?_0x3447c1[_0xa53c('0x2a')]:_0x4d52e2['model'];if(!_0x594034['query'][_0xa53c('0x2b')](_0xa53c('0x2c'))){_0x3447c1[_0xa53c('0x15')]=qs['limit'](_0x594034[_0xa53c('0x26')]['limit']);_0x3447c1[_0xa53c('0x13')]=qs['offset'](_0x594034[_0xa53c('0x26')][_0xa53c('0x13')]);}_0x3447c1[_0xa53c('0x2d')]=qs[_0xa53c('0x2e')](_0x594034[_0xa53c('0x26')][_0xa53c('0x2e')]);_0x3447c1['where']=qs[_0xa53c('0x2f')](_[_0xa53c('0x30')](_0x594034['query'],_0x4d52e2[_0xa53c('0x2f')]),_0x45b5c1);if(_0x594034[_0xa53c('0x26')][_0xa53c('0x31')]){_0x3447c1[_0xa53c('0x32')]=_[_0xa53c('0x33')](_0x3447c1['where'],{'$or':_['map'](_0x45b5c1,function(_0x32372b){if(_0x32372b[_0xa53c('0x23')]!=='VIRTUAL'){var _0x3554ac={};_0x3554ac[_0x32372b[_0xa53c('0x1e')]]={'$like':'%'+_0x594034['query'][_0xa53c('0x31')]+'%'};return _0x3554ac;}})});}_0x3447c1=_[_0xa53c('0x33')]({},_0x3447c1,_0x594034['options']);var _0x1a88e3={'where':_0x3447c1[_0xa53c('0x32')]};return db[_0xa53c('0x34')][_0xa53c('0x16')](_0x1a88e3)['then'](function(_0x5efb9e){_0x57a275[_0xa53c('0x16')]=_0x5efb9e;if(_0x594034[_0xa53c('0x26')][_0xa53c('0x35')]){_0x3447c1[_0xa53c('0x36')]=[{'all':!![]}];}return db['IntegrationReport'][_0xa53c('0x37')](_0x3447c1);})[_0xa53c('0x1b')](function(_0x30c901){_0x57a275[_0xa53c('0x38')]=_0x30c901;return _0x57a275;})['then'](respondWithFilteredResult(_0x3e5087,_0x3447c1))[_0xa53c('0x39')](handleError(_0x3e5087,null));};exports[_0xa53c('0x3a')]=function(_0x2f86ea,_0x434824){var _0x345bf5={'raw':![],'where':{'id':_0x2f86ea[_0xa53c('0x3b')]['id']}},_0x39735e={};_0x39735e[_0xa53c('0x25')]=_[_0xa53c('0x27')](db['IntegrationReport'][_0xa53c('0x21')]);_0x39735e[_0xa53c('0x26')]=_[_0xa53c('0x27')](_0x2f86ea['query']);_0x39735e[_0xa53c('0x2f')]=_['intersection'](_0x39735e['model'],_0x39735e[_0xa53c('0x26')]);_0x345bf5[_0xa53c('0x2a')]=_[_0xa53c('0x28')](_0x39735e[_0xa53c('0x25')],qs[_0xa53c('0x29')](_0x2f86ea['query'][_0xa53c('0x29')]));_0x345bf5[_0xa53c('0x2a')]=_0x345bf5[_0xa53c('0x2a')][_0xa53c('0x3c')]?_0x345bf5[_0xa53c('0x2a')]:_0x39735e['model'];if(_0x2f86ea[_0xa53c('0x26')][_0xa53c('0x35')]){_0x345bf5[_0xa53c('0x36')]=[{'all':!![]}];}_0x345bf5=_[_0xa53c('0x33')]({},_0x345bf5,_0x2f86ea[_0xa53c('0x3d')]);return db[_0xa53c('0x34')]['find'](_0x345bf5)[_0xa53c('0x1b')](handleEntityNotFound(_0x434824,null))[_0xa53c('0x1b')](respondWithResult(_0x434824,null))[_0xa53c('0x39')](handleError(_0x434824,null));};exports[_0xa53c('0x3e')]=function(_0x467ad6,_0x4515f8){return db[_0xa53c('0x34')]['create'](_0x467ad6[_0xa53c('0x3f')],{})['then'](respondWithResult(_0x4515f8,0xc9))['catch'](handleError(_0x4515f8,null));};exports[_0xa53c('0x40')]=function(_0xa34a87,_0x4b9079){if(_0xa34a87[_0xa53c('0x3f')]['id']){delete _0xa34a87[_0xa53c('0x3f')]['id'];}return db[_0xa53c('0x34')][_0xa53c('0x41')]({'where':{'id':_0xa34a87[_0xa53c('0x3b')]['id']}})[_0xa53c('0x1b')](handleEntityNotFound(_0x4b9079,null))[_0xa53c('0x1b')](saveUpdates(_0xa34a87[_0xa53c('0x3f')],null))['then'](respondWithResult(_0x4b9079,null))[_0xa53c('0x39')](handleError(_0x4b9079,null));};exports[_0xa53c('0x1c')]=function(_0x3cb400,_0x4b592e){return db[_0xa53c('0x34')]['find']({'where':{'id':_0x3cb400[_0xa53c('0x3b')]['id']}})[_0xa53c('0x1b')](handleEntityNotFound(_0x4b592e,null))[_0xa53c('0x1b')](removeEntity(_0x4b592e,null))[_0xa53c('0x39')](handleError(_0x4b592e,null));};exports['describe']=function(_0x397426,_0x190f1a){return db[_0xa53c('0x34')][_0xa53c('0x42')]()[_0xa53c('0x1b')](respondWithResult(_0x190f1a,null))[_0xa53c('0x39')](handleError(_0x190f1a,null));}; \ No newline at end of file +var _0x9091=['order','sort','where','filters','filter','merge','options','count','includeAll','include','findAll','rows','show','params','find','body','catch','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','IntegrationReport','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit'];(function(_0x20c9b2,_0x55d7b1){var _0x2c6030=function(_0x10845f){while(--_0x10845f){_0x20c9b2['push'](_0x20c9b2['shift']());}};_0x2c6030(++_0x55d7b1);}(_0x9091,0x1da));var _0x1909=function(_0x5b7226,_0x1f91a2){_0x5b7226=_0x5b7226-0x0;var _0x369855=_0x9091[_0x5b7226];return _0x369855;};'use strict';var emlformat=require(_0x1909('0x0'));var rimraf=require(_0x1909('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1909('0x2'));var rp=require('request-promise');var moment=require(_0x1909('0x3'));var BPromise=require(_0x1909('0x4'));var Mustache=require(_0x1909('0x5'));var util=require(_0x1909('0x6'));var path=require(_0x1909('0x7'));var sox=require('sox');var csv=require(_0x1909('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1909('0x9'));var _=require(_0x1909('0xa'));var squel=require('squel');var crypto=require(_0x1909('0xb'));var jsforce=require(_0x1909('0xc'));var deskjs=require(_0x1909('0xd'));var toCsv=require(_0x1909('0x8'));var querystring=require(_0x1909('0xe'));var Papa=require('papaparse');var Redis=require(_0x1909('0xf'));var authService=require(_0x1909('0x10'));var qs=require(_0x1909('0x11'));var as=require(_0x1909('0x12'));var hardwareService=require(_0x1909('0x13'));var logger=require(_0x1909('0x14'))(_0x1909('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1909('0x16'));var db=require(_0x1909('0x17'))['db'];function respondWithStatusCode(_0x5564ee,_0x523513){_0x523513=_0x523513||0xcc;return function(_0xb74cd9){if(_0xb74cd9){return _0x5564ee[_0x1909('0x18')](_0x523513);}return _0x5564ee[_0x1909('0x19')](_0x523513)['end']();};}function respondWithResult(_0xf45df3,_0x27f677){_0x27f677=_0x27f677||0xc8;return function(_0x23b1b0){if(_0x23b1b0){return _0xf45df3[_0x1909('0x19')](_0x27f677)[_0x1909('0x1a')](_0x23b1b0);}};}function respondWithFilteredResult(_0x39bdfc,_0x15f875){return function(_0x34fb85){if(_0x34fb85){var _0x3bd60f=typeof _0x15f875[_0x1909('0x1b')]===_0x1909('0x1c')&&typeof _0x15f875[_0x1909('0x1d')]==='undefined';var _0x559208=_0x34fb85['count'];var _0x3484f6=_0x3bd60f?0x0:_0x15f875[_0x1909('0x1b')];var _0x92896e=_0x3bd60f?_0x34fb85['count']:_0x15f875['offset']+_0x15f875[_0x1909('0x1d')];var _0x39af1b;if(_0x92896e>=_0x559208){_0x92896e=_0x559208;_0x39af1b=0xc8;}else{_0x39af1b=0xce;}_0x39bdfc[_0x1909('0x19')](_0x39af1b);return _0x39bdfc[_0x1909('0x1e')](_0x1909('0x1f'),_0x3484f6+'-'+_0x92896e+'/'+_0x559208)['json'](_0x34fb85);}return null;};}function patchUpdates(_0x3a50e7){return function(_0x55586d){try{jsonpatch[_0x1909('0x20')](_0x55586d,_0x3a50e7,!![]);}catch(_0x58b26a){return BPromise[_0x1909('0x21')](_0x58b26a);}return _0x55586d[_0x1909('0x22')]();};}function saveUpdates(_0x3a1880,_0x3bf7e0){return function(_0x58109d){if(_0x58109d){return _0x58109d[_0x1909('0x23')](_0x3a1880)[_0x1909('0x24')](function(_0x1f5412){return _0x1f5412;});}return null;};}function removeEntity(_0x3d0d2f,_0x33309d){return function(_0x4b140e){if(_0x4b140e){return _0x4b140e[_0x1909('0x25')]()[_0x1909('0x24')](function(){_0x3d0d2f['status'](0xcc)[_0x1909('0x26')]();});}};}function handleEntityNotFound(_0x55362c,_0x39c976){return function(_0x33fe97){if(!_0x33fe97){_0x55362c[_0x1909('0x18')](0x194);}return _0x33fe97;};}function handleError(_0x3532de,_0x549a40){_0x549a40=_0x549a40||0x1f4;return function(_0x509f6d){logger[_0x1909('0x27')](_0x509f6d[_0x1909('0x28')]);if(_0x509f6d[_0x1909('0x29')]){delete _0x509f6d[_0x1909('0x29')];}_0x3532de[_0x1909('0x19')](_0x549a40)[_0x1909('0x2a')](_0x509f6d);};}exports[_0x1909('0x2b')]=function(_0x3c1441,_0x5dde15){var _0x1dd8da={},_0x4d302f={},_0xf99f2f={'count':0x0,'rows':[]};var _0x5e3ed0=_[_0x1909('0x2c')](db[_0x1909('0x2d')][_0x1909('0x2e')],function(_0x3e3c81){return{'name':_0x3e3c81[_0x1909('0x2f')],'type':_0x3e3c81[_0x1909('0x30')]['key']};});_0x4d302f[_0x1909('0x31')]=_['map'](_0x5e3ed0,_0x1909('0x29'));_0x4d302f[_0x1909('0x32')]=_[_0x1909('0x33')](_0x3c1441[_0x1909('0x32')]);_0x4d302f['filters']=_['intersection'](_0x4d302f['model'],_0x4d302f[_0x1909('0x32')]);_0x1dd8da[_0x1909('0x34')]=_[_0x1909('0x35')](_0x4d302f[_0x1909('0x31')],qs[_0x1909('0x36')](_0x3c1441[_0x1909('0x32')][_0x1909('0x36')]));_0x1dd8da[_0x1909('0x34')]=_0x1dd8da[_0x1909('0x34')][_0x1909('0x37')]?_0x1dd8da['attributes']:_0x4d302f[_0x1909('0x31')];if(!_0x3c1441[_0x1909('0x32')][_0x1909('0x38')](_0x1909('0x39'))){_0x1dd8da[_0x1909('0x1d')]=qs[_0x1909('0x1d')](_0x3c1441[_0x1909('0x32')][_0x1909('0x1d')]);_0x1dd8da[_0x1909('0x1b')]=qs[_0x1909('0x1b')](_0x3c1441[_0x1909('0x32')]['offset']);}_0x1dd8da[_0x1909('0x3a')]=qs[_0x1909('0x3b')](_0x3c1441[_0x1909('0x32')]['sort']);_0x1dd8da[_0x1909('0x3c')]=qs['filters'](_['pick'](_0x3c1441['query'],_0x4d302f[_0x1909('0x3d')]),_0x5e3ed0);if(_0x3c1441['query'][_0x1909('0x3e')]){_0x1dd8da[_0x1909('0x3c')]=_[_0x1909('0x3f')](_0x1dd8da[_0x1909('0x3c')],{'$or':_[_0x1909('0x2c')](_0x5e3ed0,function(_0x1427ce){if(_0x1427ce['type']!=='VIRTUAL'){var _0x3c8b23={};_0x3c8b23[_0x1427ce[_0x1909('0x29')]]={'$like':'%'+_0x3c1441[_0x1909('0x32')][_0x1909('0x3e')]+'%'};return _0x3c8b23;}})});}_0x1dd8da=_['merge']({},_0x1dd8da,_0x3c1441[_0x1909('0x40')]);var _0x260873={'where':_0x1dd8da[_0x1909('0x3c')]};return db[_0x1909('0x2d')]['count'](_0x260873)[_0x1909('0x24')](function(_0xb27f91){_0xf99f2f[_0x1909('0x41')]=_0xb27f91;if(_0x3c1441[_0x1909('0x32')][_0x1909('0x42')]){_0x1dd8da[_0x1909('0x43')]=[{'all':!![]}];}return db[_0x1909('0x2d')][_0x1909('0x44')](_0x1dd8da);})[_0x1909('0x24')](function(_0x439239){_0xf99f2f[_0x1909('0x45')]=_0x439239;return _0xf99f2f;})[_0x1909('0x24')](respondWithFilteredResult(_0x5dde15,_0x1dd8da))['catch'](handleError(_0x5dde15,null));};exports[_0x1909('0x46')]=function(_0x5abc80,_0x1ce636){var _0x426a17={'raw':![],'where':{'id':_0x5abc80[_0x1909('0x47')]['id']}},_0x624177={};_0x624177[_0x1909('0x31')]=_['keys'](db['IntegrationReport'][_0x1909('0x2e')]);_0x624177['query']=_[_0x1909('0x33')](_0x5abc80[_0x1909('0x32')]);_0x624177[_0x1909('0x3d')]=_['intersection'](_0x624177['model'],_0x624177[_0x1909('0x32')]);_0x426a17[_0x1909('0x34')]=_['intersection'](_0x624177[_0x1909('0x31')],qs[_0x1909('0x36')](_0x5abc80['query']['fields']));_0x426a17[_0x1909('0x34')]=_0x426a17[_0x1909('0x34')][_0x1909('0x37')]?_0x426a17[_0x1909('0x34')]:_0x624177[_0x1909('0x31')];if(_0x5abc80[_0x1909('0x32')][_0x1909('0x42')]){_0x426a17[_0x1909('0x43')]=[{'all':!![]}];}_0x426a17=_['merge']({},_0x426a17,_0x5abc80[_0x1909('0x40')]);return db[_0x1909('0x2d')][_0x1909('0x48')](_0x426a17)[_0x1909('0x24')](handleEntityNotFound(_0x1ce636,null))[_0x1909('0x24')](respondWithResult(_0x1ce636,null))['catch'](handleError(_0x1ce636,null));};exports['create']=function(_0x4528e0,_0x5af44b){return db[_0x1909('0x2d')]['create'](_0x4528e0[_0x1909('0x49')],{})[_0x1909('0x24')](respondWithResult(_0x5af44b,0xc9))[_0x1909('0x4a')](handleError(_0x5af44b,null));};exports['update']=function(_0x9dfec5,_0x4e6cc1){if(_0x9dfec5['body']['id']){delete _0x9dfec5['body']['id'];}return db[_0x1909('0x2d')][_0x1909('0x48')]({'where':{'id':_0x9dfec5[_0x1909('0x47')]['id']}})['then'](handleEntityNotFound(_0x4e6cc1,null))[_0x1909('0x24')](saveUpdates(_0x9dfec5[_0x1909('0x49')],null))[_0x1909('0x24')](respondWithResult(_0x4e6cc1,null))[_0x1909('0x4a')](handleError(_0x4e6cc1,null));};exports['destroy']=function(_0x3e7e2c,_0x266aa0){return db[_0x1909('0x2d')]['find']({'where':{'id':_0x3e7e2c['params']['id']}})[_0x1909('0x24')](handleEntityNotFound(_0x266aa0,null))[_0x1909('0x24')](removeEntity(_0x266aa0,null))[_0x1909('0x4a')](handleError(_0x266aa0,null));};exports['describe']=function(_0x40f25c,_0x730643){return db[_0x1909('0x2d')][_0x1909('0x4b')]()['then'](respondWithResult(_0x730643,null))['catch'](handleError(_0x730643,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index a1f2b89..7b5e905 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 _0xdad8=['request-promise','path','rimraf','./integrationReport.attributes','exports','define','IntegrationReport','report_integration','lodash','util','../../config/logger','bluebird'];(function(_0x5ca9e9,_0x2f1590){var _0x3f8549=function(_0x5e4312){while(--_0x5e4312){_0x5ca9e9['push'](_0x5ca9e9['shift']());}};_0x3f8549(++_0x2f1590);}(_0xdad8,0xec));var _0x8dad=function(_0x585385,_0x4698d8){_0x585385=_0x585385-0x0;var _0x13221c=_0xdad8[_0x585385];return _0x13221c;};'use strict';var _=require(_0x8dad('0x0'));var util=require(_0x8dad('0x1'));var logger=require(_0x8dad('0x2'))('api');var moment=require('moment');var BPromise=require(_0x8dad('0x3'));var rp=require(_0x8dad('0x4'));var fs=require('fs');var path=require(_0x8dad('0x5'));var rimraf=require(_0x8dad('0x6'));var config=require('../../config/environment');var attributes=require(_0x8dad('0x7'));module[_0x8dad('0x8')]=function(_0x429805,_0x4d75b0){return _0x429805[_0x8dad('0x9')](_0x8dad('0xa'),attributes,{'tableName':_0x8dad('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd0fb=['../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./integrationReport.attributes','exports','IntegrationReport','util'];(function(_0x476031,_0x41aef3){var _0x4950fb=function(_0xbdcc95){while(--_0xbdcc95){_0x476031['push'](_0x476031['shift']());}};_0x4950fb(++_0x41aef3);}(_0xd0fb,0xb3));var _0xbd0f=function(_0x5010d0,_0x1527e5){_0x5010d0=_0x5010d0-0x0;var _0x43ed57=_0xd0fb[_0x5010d0];return _0x43ed57;};'use strict';var _=require('lodash');var util=require(_0xbd0f('0x0'));var logger=require(_0xbd0f('0x1'))(_0xbd0f('0x2'));var moment=require(_0xbd0f('0x3'));var BPromise=require('bluebird');var rp=require(_0xbd0f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbd0f('0x5'));var config=require(_0xbd0f('0x6'));var attributes=require(_0xbd0f('0x7'));module[_0xbd0f('0x8')]=function(_0x562c33,_0xbc036e){return _0x562c33['define'](_0xbd0f('0x9'),attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.rpc.js b/server/api/integrationReport/integrationReport.rpc.js index 9721b5d..b7c5501 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 _0xc6ac=['http','request','then','info','IntegrationReport,\x20%s,\x20%s','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x1036f1,_0x489731){var _0x8eecda=function(_0x1ab065){while(--_0x1ab065){_0x1036f1['push'](_0x1036f1['shift']());}};_0x8eecda(++_0x489731);}(_0xc6ac,0x15b));var _0xcc6a=function(_0xfb4ca,_0x434164){_0xfb4ca=_0xfb4ca-0x0;var _0x178c4b=_0xc6ac[_0xfb4ca];return _0x178c4b;};'use strict';var _=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var moment=require(_0xcc6a('0x2'));var BPromise=require(_0xcc6a('0x3'));var rs=require(_0xcc6a('0x4'));var fs=require('fs');var Redis=require(_0xcc6a('0x5'));var db=require(_0xcc6a('0x6'))['db'];var utils=require(_0xcc6a('0x7'));var logger=require(_0xcc6a('0x8'))(_0xcc6a('0x9'));var config=require(_0xcc6a('0xa'));var jayson=require(_0xcc6a('0xb'));var client=jayson[_0xcc6a('0xc')][_0xcc6a('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5f3887,_0x3dd497,_0x11b919){return new BPromise(function(_0xf02261,_0x560cc4){return client[_0xcc6a('0xe')](_0x5f3887,_0x11b919)[_0xcc6a('0xf')](function(_0x7806a0){logger[_0xcc6a('0x10')](_0xcc6a('0x11'),_0x3dd497,'request\x20sent');logger[_0xcc6a('0x12')](_0xcc6a('0x13'),_0x3dd497,_0xcc6a('0x14'),JSON['stringify'](_0x7806a0));if(_0x7806a0[_0xcc6a('0x15')]){if(_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x16')]===0x1f4){logger['error']('IntegrationReport,\x20%s,\x20%s',_0x3dd497,_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);return _0x560cc4(_0x7806a0[_0xcc6a('0x15')]['message']);}logger['error'](_0xcc6a('0x11'),_0x3dd497,_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);return _0xf02261(_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);}else{logger[_0xcc6a('0x10')](_0xcc6a('0x11'),_0x3dd497,_0xcc6a('0x14'));_0xf02261(_0x7806a0['result']['message']);}})['catch'](function(_0x395a55){logger[_0xcc6a('0x15')](_0xcc6a('0x11'),_0x3dd497,_0x395a55);_0x560cc4(_0x395a55);});});} \ No newline at end of file +var _0x187d=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch'];(function(_0x1ae334,_0x45fca6){var _0x3f4c2e=function(_0x2bde4c){while(--_0x2bde4c){_0x1ae334['push'](_0x1ae334['shift']());}};_0x3f4c2e(++_0x45fca6);}(_0x187d,0x93));var _0xd187=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0x187d[_0x36dfbd];return _0x4ecad9;};'use strict';var _=require(_0xd187('0x0'));var util=require('util');var moment=require(_0xd187('0x1'));var BPromise=require(_0xd187('0x2'));var rs=require(_0xd187('0x3'));var fs=require('fs');var Redis=require(_0xd187('0x4'));var db=require(_0xd187('0x5'))['db'];var utils=require(_0xd187('0x6'));var logger=require('../../config/logger')(_0xd187('0x7'));var config=require(_0xd187('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd187('0x9')][_0xd187('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x444a60,_0x1d3fe4,_0x28ce2f){return new BPromise(function(_0x2d6992,_0x358c45){return client[_0xd187('0xb')](_0x444a60,_0x28ce2f)['then'](function(_0x342539){logger[_0xd187('0xc')](_0xd187('0xd'),_0x1d3fe4,_0xd187('0xe'));logger[_0xd187('0xf')](_0xd187('0x10'),_0x1d3fe4,'request\x20sent',JSON[_0xd187('0x11')](_0x342539));if(_0x342539[_0xd187('0x12')]){if(_0x342539[_0xd187('0x12')]['code']===0x1f4){logger[_0xd187('0x12')](_0xd187('0xd'),_0x1d3fe4,_0x342539[_0xd187('0x12')]['message']);return _0x358c45(_0x342539[_0xd187('0x12')][_0xd187('0x13')]);}logger[_0xd187('0x12')](_0xd187('0xd'),_0x1d3fe4,_0x342539['error'][_0xd187('0x13')]);return _0x2d6992(_0x342539[_0xd187('0x12')][_0xd187('0x13')]);}else{logger[_0xd187('0xc')]('IntegrationReport,\x20%s,\x20%s',_0x1d3fe4,_0xd187('0xe'));_0x2d6992(_0x342539['result']['message']);}})[_0xd187('0x14')](function(_0x5a4986){logger['error'](_0xd187('0xd'),_0x1d3fe4,_0x5a4986);_0x358c45(_0x5a4986);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 7c7c81e..7a6c81f 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 _0xac8d=['../../components/interaction/service','./interval.controller','get','isAuthenticated','index','/:id','show','post','create','/:id/sub_intervals','addInterval','/:id/sub_intervals/create_many','addIntervals','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x5bb4ce,_0x3bb7de){var _0x1c62db=function(_0x142968){while(--_0x142968){_0x5bb4ce['push'](_0x5bb4ce['shift']());}};_0x1c62db(++_0x3bb7de);}(_0xac8d,0x1d8));var _0xdac8=function(_0x4e54da,_0x150e54){_0x4e54da=_0x4e54da-0x0;var _0xf81db4=_0xac8d[_0x4e54da];return _0xf81db4;};'use strict';var multer=require(_0xdac8('0x0'));var util=require(_0xdac8('0x1'));var path=require(_0xdac8('0x2'));var timeout=require(_0xdac8('0x3'));var express=require(_0xdac8('0x4'));var router=express[_0xdac8('0x5')]();var fs_extra=require(_0xdac8('0x6'));var auth=require(_0xdac8('0x7'));var interaction=require(_0xdac8('0x8'));var config=require('../../config/environment');var controller=require(_0xdac8('0x9'));router[_0xdac8('0xa')]('/',auth[_0xdac8('0xb')](),controller[_0xdac8('0xc')]);router[_0xdac8('0xa')](_0xdac8('0xd'),auth[_0xdac8('0xb')](),controller[_0xdac8('0xe')]);router[_0xdac8('0xa')]('/:id/sub_intervals',auth[_0xdac8('0xb')](),controller['getIntervals']);router[_0xdac8('0xf')]('/',auth[_0xdac8('0xb')](),controller[_0xdac8('0x10')]);router[_0xdac8('0xf')](_0xdac8('0x11'),auth['isAuthenticated'](),controller[_0xdac8('0x12')]);router['post'](_0xdac8('0x13'),auth[_0xdac8('0xb')](),controller[_0xdac8('0x14')]);router['put'](_0xdac8('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xdac8('0x15')]('/:id',auth[_0xdac8('0xb')](),controller[_0xdac8('0x16')]);module[_0xdac8('0x17')]=router; \ No newline at end of file +var _0xf3fe=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','get','/:id','isAuthenticated','show','/:id/sub_intervals','getIntervals','post','create','addInterval','addIntervals','update','destroy','exports','util'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xf3fe,0x1cd));var _0xef3f=function(_0x369508,_0x5cc3bf){_0x369508=_0x369508-0x0;var _0x53ed1f=_0xf3fe[_0x369508];return _0x53ed1f;};'use strict';var multer=require('multer');var util=require(_0xef3f('0x0'));var path=require(_0xef3f('0x1'));var timeout=require(_0xef3f('0x2'));var express=require(_0xef3f('0x3'));var router=express[_0xef3f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xef3f('0x5'));var interaction=require(_0xef3f('0x6'));var config=require(_0xef3f('0x7'));var controller=require(_0xef3f('0x8'));router[_0xef3f('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xef3f('0x9')](_0xef3f('0xa'),auth[_0xef3f('0xb')](),controller[_0xef3f('0xc')]);router[_0xef3f('0x9')](_0xef3f('0xd'),auth[_0xef3f('0xb')](),controller[_0xef3f('0xe')]);router[_0xef3f('0xf')]('/',auth['isAuthenticated'](),controller[_0xef3f('0x10')]);router['post'](_0xef3f('0xd'),auth[_0xef3f('0xb')](),controller[_0xef3f('0x11')]);router[_0xef3f('0xf')]('/:id/sub_intervals/create_many',auth[_0xef3f('0xb')](),controller[_0xef3f('0x12')]);router['put'](_0xef3f('0xa'),auth['isAuthenticated'](),controller[_0xef3f('0x13')]);router['delete'](_0xef3f('0xa'),auth[_0xef3f('0xb')](),controller[_0xef3f('0x14')]);module[_0xef3f('0x15')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index f898c6b..2aa13b4 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 _0x8a56=['STRING','sequelize','exports'];(function(_0x58cff1,_0x5a7f1b){var _0x56457e=function(_0x43f8bd){while(--_0x43f8bd){_0x58cff1['push'](_0x58cff1['shift']());}};_0x56457e(++_0x5a7f1b);}(_0x8a56,0xc4));var _0x68a5=function(_0x31a576,_0x424419){_0x31a576=_0x31a576-0x0;var _0x30b1d3=_0x8a56[_0x31a576];return _0x30b1d3;};'use strict';var Sequelize=require(_0x68a5('0x0'));module[_0x68a5('0x1')]={'name':{'type':Sequelize[_0x68a5('0x2')]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x68a5('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x962f=['sequelize','STRING'];(function(_0x3ee890,_0x4e16a6){var _0x43cc0d=function(_0x24bd1b){while(--_0x24bd1b){_0x3ee890['push'](_0x3ee890['shift']());}};_0x43cc0d(++_0x4e16a6);}(_0x962f,0x1f4));var _0xf962=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x962f[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xf962('0x0'));module['exports']={'name':{'type':Sequelize[_0xf962('0x1')]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xf962('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 59662b4..a852946 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 _0x1475=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','Interval','includeAll','rows','catch','show','params','include','find','create','user','get','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addInterval','IntervalId','getIntervals','findOne','pick','sequelize','transaction','bulkCreate','findAll','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs'];(function(_0x14c700,_0xfd10f2){var _0x4a84ce=function(_0x1c33bf){while(--_0x1c33bf){_0x14c700['push'](_0x14c700['shift']());}};_0x4a84ce(++_0xfd10f2);}(_0x1475,0x109));var _0x5147=function(_0x2850c0,_0x1363a7){_0x2850c0=_0x2850c0-0x0;var _0x21e830=_0x1475[_0x2850c0];return _0x21e830;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5147('0x0'));var zipdir=require(_0x5147('0x1'));var jsonpatch=require(_0x5147('0x2'));var rp=require(_0x5147('0x3'));var moment=require(_0x5147('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5147('0x5'));var util=require('util');var path=require(_0x5147('0x6'));var sox=require('sox');var csv=require(_0x5147('0x7'));var ejs=require(_0x5147('0x8'));var fs=require('fs');var fs_extra=require(_0x5147('0x9'));var _=require(_0x5147('0xa'));var squel=require(_0x5147('0xb'));var crypto=require(_0x5147('0xc'));var jsforce=require(_0x5147('0xd'));var deskjs=require(_0x5147('0xe'));var toCsv=require(_0x5147('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5147('0xf'));var qs=require(_0x5147('0x10'));var as=require(_0x5147('0x11'));var hardwareService=require(_0x5147('0x12'));var logger=require(_0x5147('0x13'))(_0x5147('0x14'));var utils=require(_0x5147('0x15'));var config=require(_0x5147('0x16'));var licenseUtil=require(_0x5147('0x17'));var db=require(_0x5147('0x18'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x43be14,_0x9ba5d4){_0x9ba5d4=_0x9ba5d4||0xcc;return function(_0x12c98f){if(_0x12c98f){return _0x43be14[_0x5147('0x19')](_0x9ba5d4);}return _0x43be14[_0x5147('0x1a')](_0x9ba5d4)[_0x5147('0x1b')]();};}function respondWithResult(_0x5b128b,_0x15de9a){_0x15de9a=_0x15de9a||0xc8;return function(_0x12b13a){if(_0x12b13a){return _0x5b128b[_0x5147('0x1a')](_0x15de9a)[_0x5147('0x1c')](_0x12b13a);}};}function respondWithFilteredResult(_0x25dc09,_0x581755){return function(_0x302029){if(_0x302029){var _0x196976=typeof _0x581755[_0x5147('0x1d')]===_0x5147('0x1e')&&typeof _0x581755[_0x5147('0x1f')]==='undefined';var _0x153381=_0x302029[_0x5147('0x20')];var _0x21d401=_0x196976?0x0:_0x581755['offset'];var _0x273fba=_0x196976?_0x302029[_0x5147('0x20')]:_0x581755[_0x5147('0x1d')]+_0x581755[_0x5147('0x1f')];var _0x5a2774;if(_0x273fba>=_0x153381){_0x273fba=_0x153381;_0x5a2774=0xc8;}else{_0x5a2774=0xce;}_0x25dc09[_0x5147('0x1a')](_0x5a2774);return _0x25dc09['set'](_0x5147('0x21'),_0x21d401+'-'+_0x273fba+'/'+_0x153381)[_0x5147('0x1c')](_0x302029);}return null;};}function patchUpdates(_0x4ecffe){return function(_0x206951){try{jsonpatch[_0x5147('0x22')](_0x206951,_0x4ecffe,!![]);}catch(_0x18eefc){return BPromise[_0x5147('0x23')](_0x18eefc);}return _0x206951[_0x5147('0x24')]();};}function saveUpdates(_0x1d521d,_0x244f07){return function(_0x1cc62c){if(_0x1cc62c){return _0x1cc62c[_0x5147('0x25')](_0x1d521d)['then'](function(_0xffb41a){return _0xffb41a;});}return null;};}function removeEntity(_0x207cfc,_0x2523a8){return function(_0x3fe3d4){if(_0x3fe3d4){return _0x3fe3d4[_0x5147('0x26')]()[_0x5147('0x27')](function(){var _0x2c1a69=_0x3fe3d4['get']({'plain':!![]});var _0x476633='Intervals';return db[_0x5147('0x28')][_0x5147('0x26')]({'where':{'type':_0x476633,'resourceId':_0x2c1a69['id']}})[_0x5147('0x27')](function(){return _0x3fe3d4;});})[_0x5147('0x27')](function(){_0x207cfc['status'](0xcc)[_0x5147('0x1b')]();});}};}function handleEntityNotFound(_0x2ce014,_0x426412){return function(_0x20268d){if(!_0x20268d){_0x2ce014['sendStatus'](0x194);}return _0x20268d;};}function handleError(_0x1d7336,_0x4fde35){_0x4fde35=_0x4fde35||0x1f4;return function(_0x4699f6){logger[_0x5147('0x29')](_0x4699f6[_0x5147('0x2a')]);if(_0x4699f6[_0x5147('0x2b')]){delete _0x4699f6['name'];}_0x1d7336['status'](_0x4fde35)[_0x5147('0x2c')](_0x4699f6);};}exports[_0x5147('0x2d')]=function(_0x41d216,_0x180e49){var _0x4f8a0a={},_0x3adbcc={},_0x2d0c21={'count':0x0,'rows':[]};var _0x4b0de4=_[_0x5147('0x2e')](db['Interval'][_0x5147('0x2f')],function(_0x4cb367){return{'name':_0x4cb367[_0x5147('0x30')],'type':_0x4cb367[_0x5147('0x31')][_0x5147('0x32')]};});_0x3adbcc[_0x5147('0x33')]=_[_0x5147('0x2e')](_0x4b0de4,_0x5147('0x2b'));_0x3adbcc[_0x5147('0x34')]=_[_0x5147('0x35')](_0x41d216[_0x5147('0x34')]);_0x3adbcc[_0x5147('0x36')]=_[_0x5147('0x37')](_0x3adbcc['model'],_0x3adbcc['query']);_0x4f8a0a['attributes']=_[_0x5147('0x37')](_0x3adbcc[_0x5147('0x33')],qs[_0x5147('0x38')](_0x41d216[_0x5147('0x34')][_0x5147('0x38')]));_0x4f8a0a['attributes']=_0x4f8a0a[_0x5147('0x39')][_0x5147('0x3a')]?_0x4f8a0a[_0x5147('0x39')]:_0x3adbcc[_0x5147('0x33')];if(!_0x41d216[_0x5147('0x34')][_0x5147('0x3b')](_0x5147('0x3c'))){_0x4f8a0a[_0x5147('0x1f')]=qs[_0x5147('0x1f')](_0x41d216[_0x5147('0x34')][_0x5147('0x1f')]);_0x4f8a0a[_0x5147('0x1d')]=qs[_0x5147('0x1d')](_0x41d216[_0x5147('0x34')][_0x5147('0x1d')]);}_0x4f8a0a[_0x5147('0x3d')]=qs[_0x5147('0x3e')](_0x41d216[_0x5147('0x34')]['sort']);_0x4f8a0a[_0x5147('0x3f')]=qs[_0x5147('0x36')](_['pick'](_0x41d216[_0x5147('0x34')],_0x3adbcc['filters']),_0x4b0de4);if(_0x41d216['query'][_0x5147('0x40')]){_0x4f8a0a[_0x5147('0x3f')]=_[_0x5147('0x41')](_0x4f8a0a[_0x5147('0x3f')],{'$or':_[_0x5147('0x2e')](_0x4b0de4,function(_0x5eaf09){if(_0x5eaf09[_0x5147('0x31')]!==_0x5147('0x42')){var _0x3101d0={};_0x3101d0[_0x5eaf09[_0x5147('0x2b')]]={'$like':'%'+_0x41d216['query'][_0x5147('0x40')]+'%'};return _0x3101d0;}})});}_0x4f8a0a=_['merge']({},_0x4f8a0a,_0x41d216[_0x5147('0x43')]);var _0x133774={'where':_0x4f8a0a[_0x5147('0x3f')]};return db[_0x5147('0x44')][_0x5147('0x20')](_0x133774)[_0x5147('0x27')](function(_0xc76008){_0x2d0c21[_0x5147('0x20')]=_0xc76008;if(_0x41d216[_0x5147('0x34')][_0x5147('0x45')]){_0x4f8a0a['include']=[{'all':!![]}];}return db[_0x5147('0x44')]['findAll'](_0x4f8a0a);})[_0x5147('0x27')](function(_0x5799e3){_0x2d0c21[_0x5147('0x46')]=_0x5799e3;return _0x2d0c21;})[_0x5147('0x27')](respondWithFilteredResult(_0x180e49,_0x4f8a0a))[_0x5147('0x47')](handleError(_0x180e49,null));};exports[_0x5147('0x48')]=function(_0x34c18b,_0x1fb8d0){var _0x11b85f={'raw':!![],'where':{'id':_0x34c18b[_0x5147('0x49')]['id']}},_0x4419c2={};_0x4419c2[_0x5147('0x33')]=_[_0x5147('0x35')](db['Interval']['rawAttributes']);_0x4419c2['query']=_['keys'](_0x34c18b[_0x5147('0x34')]);_0x4419c2[_0x5147('0x36')]=_[_0x5147('0x37')](_0x4419c2['model'],_0x4419c2['query']);_0x11b85f[_0x5147('0x39')]=_[_0x5147('0x37')](_0x4419c2['model'],qs['fields'](_0x34c18b['query'][_0x5147('0x38')]));_0x11b85f[_0x5147('0x39')]=_0x11b85f[_0x5147('0x39')][_0x5147('0x3a')]?_0x11b85f['attributes']:_0x4419c2[_0x5147('0x33')];if(_0x34c18b[_0x5147('0x34')][_0x5147('0x45')]){_0x11b85f[_0x5147('0x4a')]=[{'all':!![]}];}_0x11b85f=_['merge']({},_0x11b85f,_0x34c18b['options']);return db[_0x5147('0x44')][_0x5147('0x4b')](_0x11b85f)['then'](handleEntityNotFound(_0x1fb8d0,null))[_0x5147('0x27')](respondWithResult(_0x1fb8d0,null))[_0x5147('0x47')](handleError(_0x1fb8d0,null));};exports[_0x5147('0x4c')]=function(_0x4593bc,_0x246fd8){return db[_0x5147('0x44')][_0x5147('0x4c')](_0x4593bc['body'],{})[_0x5147('0x27')](function(_0x4ea769){var _0x20538e=_0x4593bc[_0x5147('0x4d')][_0x5147('0x4e')]({'plain':!![]});if(!_0x20538e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x20538e[_0x5147('0x4f')]===_0x5147('0x4d')){var _0x121ba4=_0x4ea769['get']({'plain':!![]});var _0x3e189c='Intervals';return db[_0x5147('0x50')]['find']({'where':{'name':_0x3e189c,'userProfileId':_0x20538e[_0x5147('0x51')]},'raw':!![]})[_0x5147('0x27')](function(_0x3171cc){if(_0x3171cc&&_0x3171cc[_0x5147('0x52')]===0x0){return db['UserProfileResource']['create']({'name':_0x121ba4['name'],'resourceId':_0x121ba4['id'],'type':_0x3171cc['name'],'sectionId':_0x3171cc['id']},{})['then'](function(){return _0x4ea769;});}else{return _0x4ea769;}})[_0x5147('0x47')](function(_0x155065){logger[_0x5147('0x29')](_0x5147('0x53'),_0x155065);throw _0x155065;});}return _0x4ea769;})['then'](respondWithResult(_0x246fd8,0xc9))[_0x5147('0x47')](handleError(_0x246fd8,null));};exports['update']=function(_0xb2d597,_0x2fd510){if(_0xb2d597[_0x5147('0x54')]['id']){delete _0xb2d597[_0x5147('0x54')]['id'];}return db[_0x5147('0x44')][_0x5147('0x4b')]({'where':{'id':_0xb2d597[_0x5147('0x49')]['id']}})[_0x5147('0x27')](handleEntityNotFound(_0x2fd510,null))[_0x5147('0x27')](saveUpdates(_0xb2d597[_0x5147('0x54')],null))['then'](respondWithResult(_0x2fd510,null))[_0x5147('0x47')](handleError(_0x2fd510,null));};exports[_0x5147('0x26')]=function(_0xb818a1,_0x203549){return db[_0x5147('0x44')][_0x5147('0x4b')]({'where':{'id':_0xb818a1[_0x5147('0x49')]['id']}})[_0x5147('0x27')](handleEntityNotFound(_0x203549,null))[_0x5147('0x27')](removeEntity(_0x203549,null))[_0x5147('0x47')](handleError(_0x203549,null));};exports[_0x5147('0x55')]=function(_0x1f03f7,_0x32cd9e,_0x2f2beb){if(_0x1f03f7[_0x5147('0x54')]['id']){delete _0x1f03f7[_0x5147('0x54')]['id'];}return db[_0x5147('0x44')][_0x5147('0x4b')]({'where':{'id':_0x1f03f7['params']['id']}})['then'](handleEntityNotFound(_0x32cd9e,null))[_0x5147('0x27')](function(_0x224627){if(_0x224627){_0x1f03f7['body'][_0x5147('0x56')]=_0x224627['id'];return db['Interval']['create'](_0x1f03f7[_0x5147('0x54')]);}})[_0x5147('0x27')](respondWithResult(_0x32cd9e,null))['catch'](handleError(_0x32cd9e,null));};exports[_0x5147('0x57')]=function(_0x56c42a,_0x163937,_0x29c090){var _0x55dcfd={};var _0x3cf1e7={};var _0x57919d;var _0x4d6abc;return db['Interval'][_0x5147('0x58')]({'where':{'id':_0x56c42a[_0x5147('0x49')]['id']}})[_0x5147('0x27')](handleEntityNotFound(_0x163937,null))[_0x5147('0x27')](function(_0x1799d9){if(_0x1799d9){_0x57919d=_0x1799d9;_0x3cf1e7[_0x5147('0x33')]=_[_0x5147('0x35')](db[_0x5147('0x44')]['rawAttributes']);_0x3cf1e7[_0x5147('0x34')]=_[_0x5147('0x35')](_0x56c42a[_0x5147('0x34')]);_0x3cf1e7[_0x5147('0x36')]=_[_0x5147('0x37')](_0x3cf1e7['model'],_0x3cf1e7[_0x5147('0x34')]);_0x55dcfd[_0x5147('0x39')]=_['intersection'](_0x3cf1e7[_0x5147('0x33')],qs[_0x5147('0x38')](_0x56c42a[_0x5147('0x34')][_0x5147('0x38')]));_0x55dcfd[_0x5147('0x39')]=_0x55dcfd[_0x5147('0x39')][_0x5147('0x3a')]?_0x55dcfd[_0x5147('0x39')]:_0x3cf1e7[_0x5147('0x33')];_0x55dcfd[_0x5147('0x3d')]=qs[_0x5147('0x3e')](_0x56c42a['query']['sort']);_0x55dcfd[_0x5147('0x3f')]=qs['filters'](_[_0x5147('0x59')](_0x56c42a['query'],_0x3cf1e7[_0x5147('0x36')]));if(_0x56c42a['query'][_0x5147('0x40')]){_0x55dcfd[_0x5147('0x3f')]=_['merge'](_0x55dcfd[_0x5147('0x3f')],{'$or':_[_0x5147('0x2e')](_0x55dcfd[_0x5147('0x39')],function(_0x381553){var _0x5cacfe={};_0x5cacfe[_0x381553]={'$like':'%'+_0x56c42a[_0x5147('0x34')][_0x5147('0x40')]+'%'};return _0x5cacfe;})});}_0x55dcfd=_[_0x5147('0x41')]({},_0x55dcfd,_0x56c42a[_0x5147('0x43')]);return _0x57919d['getIntervals'](_0x55dcfd);}})[_0x5147('0x27')](function(_0x50a0c0){if(_0x50a0c0){_0x4d6abc=_0x50a0c0[_0x5147('0x3a')];if(!_0x56c42a[_0x5147('0x34')][_0x5147('0x3b')]('nolimit')){_0x55dcfd['limit']=qs[_0x5147('0x1f')](_0x56c42a[_0x5147('0x34')][_0x5147('0x1f')]);_0x55dcfd[_0x5147('0x1d')]=qs['offset'](_0x56c42a[_0x5147('0x34')][_0x5147('0x1d')]);}return _0x57919d[_0x5147('0x57')](_0x55dcfd);}})['then'](function(_0x214f8e){if(_0x214f8e){return _0x214f8e?{'count':_0x4d6abc,'rows':_0x214f8e}:null;}})['then'](respondWithResult(_0x163937,null))[_0x5147('0x47')](handleError(_0x163937,null));};exports['addIntervals']=function(_0xa81cf5,_0xe8d2cc,_0x3b93c6){return db[_0x5147('0x44')][_0x5147('0x58')]({'where':{'id':_0xa81cf5[_0x5147('0x49')]['id']}})[_0x5147('0x27')](handleEntityNotFound(_0xe8d2cc,null))[_0x5147('0x27')](function(_0x3dddff){if(_0x3dddff){return db[_0x5147('0x5a')][_0x5147('0x5b')](function(_0x581c24){return db[_0x5147('0x44')][_0x5147('0x26')]({'where':{'IntervalId':_0xa81cf5[_0x5147('0x49')]['id']},'transaction':_0x581c24})['then'](function(_0x253be2){var _0x483503=_['map'](_0xa81cf5[_0x5147('0x54')],function(_0x1702a9){delete _0x1702a9['id'];_0x1702a9['IntervalId']=_0xa81cf5[_0x5147('0x49')]['id'];return _0x1702a9;});return db[_0x5147('0x44')][_0x5147('0x5c')](_0x483503,{'transaction':_0x581c24});});})[_0x5147('0x27')](function(){return db[_0x5147('0x44')][_0x5147('0x5d')]({'where':{'IntervalId':_0xa81cf5[_0x5147('0x49')]['id']}});});}})[_0x5147('0x27')](respondWithResult(_0xe8d2cc,null))[_0x5147('0x47')](handleError(_0xe8d2cc,null));}; \ No newline at end of file +var _0xe753=['filter','merge','name','include','findAll','rows','catch','show','keys','includeAll','options','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Intervals','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','addInterval','IntervalId','create','getIntervals','findOne','addIntervals','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','status','json','offset','limit','count','Content-Range','apply','reject','save','update','then','destroy','UserProfileResource','end','sendStatus','error','send','index','map','Interval','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x4ee4c7,_0x5e5b5f){var _0x9a8b85=function(_0x21a78e){while(--_0x21a78e){_0x4ee4c7['push'](_0x4ee4c7['shift']());}};_0x9a8b85(++_0x5e5b5f);}(_0xe753,0x132));var _0x3e75=function(_0x34c8ff,_0x674110){_0x34c8ff=_0x34c8ff-0x0;var _0x42601c=_0xe753[_0x34c8ff];return _0x42601c;};'use strict';var emlformat=require(_0x3e75('0x0'));var rimraf=require(_0x3e75('0x1'));var zipdir=require(_0x3e75('0x2'));var jsonpatch=require(_0x3e75('0x3'));var rp=require(_0x3e75('0x4'));var moment=require(_0x3e75('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x3e75('0x6'));var util=require(_0x3e75('0x7'));var path=require(_0x3e75('0x8'));var sox=require(_0x3e75('0x9'));var csv=require(_0x3e75('0xa'));var ejs=require(_0x3e75('0xb'));var fs=require('fs');var fs_extra=require(_0x3e75('0xc'));var _=require(_0x3e75('0xd'));var squel=require(_0x3e75('0xe'));var crypto=require('crypto');var jsforce=require(_0x3e75('0xf'));var deskjs=require(_0x3e75('0x10'));var toCsv=require(_0x3e75('0xa'));var querystring=require(_0x3e75('0x11'));var Papa=require(_0x3e75('0x12'));var Redis=require(_0x3e75('0x13'));var authService=require(_0x3e75('0x14'));var qs=require(_0x3e75('0x15'));var as=require(_0x3e75('0x16'));var hardwareService=require(_0x3e75('0x17'));var logger=require(_0x3e75('0x18'))(_0x3e75('0x19'));var utils=require('../../config/utils');var config=require(_0x3e75('0x1a'));var licenseUtil=require(_0x3e75('0x1b'));var db=require(_0x3e75('0x1c'))['db'];var extensions=require(_0x3e75('0x1d'));function respondWithStatusCode(_0x22842e,_0x1a14b4){_0x1a14b4=_0x1a14b4||0xcc;return function(_0x356067){if(_0x356067){return _0x22842e['sendStatus'](_0x1a14b4);}return _0x22842e['status'](_0x1a14b4)['end']();};}function respondWithResult(_0x5a0476,_0x52ed77){_0x52ed77=_0x52ed77||0xc8;return function(_0x172d06){if(_0x172d06){return _0x5a0476[_0x3e75('0x1e')](_0x52ed77)[_0x3e75('0x1f')](_0x172d06);}};}function respondWithFilteredResult(_0x3ac01a,_0x45681e){return function(_0xa644e){if(_0xa644e){var _0x4ac686=typeof _0x45681e[_0x3e75('0x20')]==='undefined'&&typeof _0x45681e[_0x3e75('0x21')]==='undefined';var _0x5d6c7a=_0xa644e[_0x3e75('0x22')];var _0x4b3f8d=_0x4ac686?0x0:_0x45681e['offset'];var _0x1e2d7e=_0x4ac686?_0xa644e[_0x3e75('0x22')]:_0x45681e[_0x3e75('0x20')]+_0x45681e['limit'];var _0x537970;if(_0x1e2d7e>=_0x5d6c7a){_0x1e2d7e=_0x5d6c7a;_0x537970=0xc8;}else{_0x537970=0xce;}_0x3ac01a[_0x3e75('0x1e')](_0x537970);return _0x3ac01a['set'](_0x3e75('0x23'),_0x4b3f8d+'-'+_0x1e2d7e+'/'+_0x5d6c7a)[_0x3e75('0x1f')](_0xa644e);}return null;};}function patchUpdates(_0x101fad){return function(_0xd2a191){try{jsonpatch[_0x3e75('0x24')](_0xd2a191,_0x101fad,!![]);}catch(_0x29e77c){return BPromise[_0x3e75('0x25')](_0x29e77c);}return _0xd2a191[_0x3e75('0x26')]();};}function saveUpdates(_0x7f91f4,_0x33a717){return function(_0x316649){if(_0x316649){return _0x316649[_0x3e75('0x27')](_0x7f91f4)[_0x3e75('0x28')](function(_0x12b176){return _0x12b176;});}return null;};}function removeEntity(_0x210378,_0x5001b0){return function(_0x3b1bae){if(_0x3b1bae){return _0x3b1bae[_0x3e75('0x29')]()[_0x3e75('0x28')](function(){var _0x28a8d9=_0x3b1bae['get']({'plain':!![]});var _0x5eec6a='Intervals';return db[_0x3e75('0x2a')][_0x3e75('0x29')]({'where':{'type':_0x5eec6a,'resourceId':_0x28a8d9['id']}})['then'](function(){return _0x3b1bae;});})[_0x3e75('0x28')](function(){_0x210378['status'](0xcc)[_0x3e75('0x2b')]();});}};}function handleEntityNotFound(_0x143b7c,_0x86da47){return function(_0x9433ea){if(!_0x9433ea){_0x143b7c[_0x3e75('0x2c')](0x194);}return _0x9433ea;};}function handleError(_0x2f44ff,_0x1be919){_0x1be919=_0x1be919||0x1f4;return function(_0x469ed1){logger[_0x3e75('0x2d')](_0x469ed1['stack']);if(_0x469ed1['name']){delete _0x469ed1['name'];}_0x2f44ff[_0x3e75('0x1e')](_0x1be919)[_0x3e75('0x2e')](_0x469ed1);};}exports[_0x3e75('0x2f')]=function(_0x2562b6,_0x4a9743){var _0x3f9c0c={},_0x7c66ba={},_0x493c9f={'count':0x0,'rows':[]};var _0x461436=_[_0x3e75('0x30')](db[_0x3e75('0x31')][_0x3e75('0x32')],function(_0x19ce40){return{'name':_0x19ce40[_0x3e75('0x33')],'type':_0x19ce40[_0x3e75('0x34')][_0x3e75('0x35')]};});_0x7c66ba[_0x3e75('0x36')]=_[_0x3e75('0x30')](_0x461436,'name');_0x7c66ba[_0x3e75('0x37')]=_['keys'](_0x2562b6[_0x3e75('0x37')]);_0x7c66ba[_0x3e75('0x38')]=_[_0x3e75('0x39')](_0x7c66ba[_0x3e75('0x36')],_0x7c66ba[_0x3e75('0x37')]);_0x3f9c0c[_0x3e75('0x3a')]=_[_0x3e75('0x39')](_0x7c66ba[_0x3e75('0x36')],qs['fields'](_0x2562b6[_0x3e75('0x37')][_0x3e75('0x3b')]));_0x3f9c0c['attributes']=_0x3f9c0c['attributes'][_0x3e75('0x3c')]?_0x3f9c0c[_0x3e75('0x3a')]:_0x7c66ba[_0x3e75('0x36')];if(!_0x2562b6[_0x3e75('0x37')][_0x3e75('0x3d')](_0x3e75('0x3e'))){_0x3f9c0c[_0x3e75('0x21')]=qs[_0x3e75('0x21')](_0x2562b6['query'][_0x3e75('0x21')]);_0x3f9c0c[_0x3e75('0x20')]=qs[_0x3e75('0x20')](_0x2562b6[_0x3e75('0x37')][_0x3e75('0x20')]);}_0x3f9c0c[_0x3e75('0x3f')]=qs[_0x3e75('0x40')](_0x2562b6[_0x3e75('0x37')][_0x3e75('0x40')]);_0x3f9c0c[_0x3e75('0x41')]=qs[_0x3e75('0x38')](_['pick'](_0x2562b6[_0x3e75('0x37')],_0x7c66ba[_0x3e75('0x38')]),_0x461436);if(_0x2562b6[_0x3e75('0x37')][_0x3e75('0x42')]){_0x3f9c0c[_0x3e75('0x41')]=_[_0x3e75('0x43')](_0x3f9c0c[_0x3e75('0x41')],{'$or':_[_0x3e75('0x30')](_0x461436,function(_0x402399){if(_0x402399['type']!=='VIRTUAL'){var _0x3317ca={};_0x3317ca[_0x402399[_0x3e75('0x44')]]={'$like':'%'+_0x2562b6[_0x3e75('0x37')]['filter']+'%'};return _0x3317ca;}})});}_0x3f9c0c=_['merge']({},_0x3f9c0c,_0x2562b6['options']);var _0x2602d6={'where':_0x3f9c0c[_0x3e75('0x41')]};return db[_0x3e75('0x31')]['count'](_0x2602d6)[_0x3e75('0x28')](function(_0x47ba03){_0x493c9f[_0x3e75('0x22')]=_0x47ba03;if(_0x2562b6[_0x3e75('0x37')]['includeAll']){_0x3f9c0c[_0x3e75('0x45')]=[{'all':!![]}];}return db[_0x3e75('0x31')][_0x3e75('0x46')](_0x3f9c0c);})[_0x3e75('0x28')](function(_0x45ae57){_0x493c9f[_0x3e75('0x47')]=_0x45ae57;return _0x493c9f;})[_0x3e75('0x28')](respondWithFilteredResult(_0x4a9743,_0x3f9c0c))[_0x3e75('0x48')](handleError(_0x4a9743,null));};exports[_0x3e75('0x49')]=function(_0x2dc220,_0xdbe7bd){var _0x2a9099={'raw':!![],'where':{'id':_0x2dc220['params']['id']}},_0x42c8ef={};_0x42c8ef[_0x3e75('0x36')]=_[_0x3e75('0x4a')](db[_0x3e75('0x31')][_0x3e75('0x32')]);_0x42c8ef[_0x3e75('0x37')]=_['keys'](_0x2dc220[_0x3e75('0x37')]);_0x42c8ef['filters']=_[_0x3e75('0x39')](_0x42c8ef[_0x3e75('0x36')],_0x42c8ef[_0x3e75('0x37')]);_0x2a9099['attributes']=_[_0x3e75('0x39')](_0x42c8ef[_0x3e75('0x36')],qs['fields'](_0x2dc220[_0x3e75('0x37')]['fields']));_0x2a9099[_0x3e75('0x3a')]=_0x2a9099[_0x3e75('0x3a')][_0x3e75('0x3c')]?_0x2a9099[_0x3e75('0x3a')]:_0x42c8ef['model'];if(_0x2dc220[_0x3e75('0x37')][_0x3e75('0x4b')]){_0x2a9099[_0x3e75('0x45')]=[{'all':!![]}];}_0x2a9099=_[_0x3e75('0x43')]({},_0x2a9099,_0x2dc220[_0x3e75('0x4c')]);return db[_0x3e75('0x31')]['find'](_0x2a9099)['then'](handleEntityNotFound(_0xdbe7bd,null))[_0x3e75('0x28')](respondWithResult(_0xdbe7bd,null))[_0x3e75('0x48')](handleError(_0xdbe7bd,null));};exports['create']=function(_0x28c9ee,_0x57e46a){return db[_0x3e75('0x31')]['create'](_0x28c9ee['body'],{})[_0x3e75('0x28')](function(_0x10ce8c){var _0x2b1f28=_0x28c9ee[_0x3e75('0x4d')]['get']({'plain':!![]});if(!_0x2b1f28)throw new Error(_0x3e75('0x4e'));if(_0x2b1f28[_0x3e75('0x4f')]===_0x3e75('0x4d')){var _0x3e7b6a=_0x10ce8c['get']({'plain':!![]});var _0x476a72=_0x3e75('0x50');return db[_0x3e75('0x51')][_0x3e75('0x52')]({'where':{'name':_0x476a72,'userProfileId':_0x2b1f28[_0x3e75('0x53')]},'raw':!![]})[_0x3e75('0x28')](function(_0x456a85){if(_0x456a85&&_0x456a85['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x3e7b6a[_0x3e75('0x44')],'resourceId':_0x3e7b6a['id'],'type':_0x456a85[_0x3e75('0x44')],'sectionId':_0x456a85['id']},{})[_0x3e75('0x28')](function(){return _0x10ce8c;});}else{return _0x10ce8c;}})[_0x3e75('0x48')](function(_0xd6f9c4){logger[_0x3e75('0x2d')](_0x3e75('0x54'),_0xd6f9c4);throw _0xd6f9c4;});}return _0x10ce8c;})[_0x3e75('0x28')](respondWithResult(_0x57e46a,0xc9))[_0x3e75('0x48')](handleError(_0x57e46a,null));};exports[_0x3e75('0x27')]=function(_0x353c29,_0x41d461){if(_0x353c29[_0x3e75('0x55')]['id']){delete _0x353c29['body']['id'];}return db['Interval'][_0x3e75('0x52')]({'where':{'id':_0x353c29[_0x3e75('0x56')]['id']}})['then'](handleEntityNotFound(_0x41d461,null))[_0x3e75('0x28')](saveUpdates(_0x353c29[_0x3e75('0x55')],null))['then'](respondWithResult(_0x41d461,null))[_0x3e75('0x48')](handleError(_0x41d461,null));};exports[_0x3e75('0x29')]=function(_0x5a299b,_0x7280ce){return db[_0x3e75('0x31')][_0x3e75('0x52')]({'where':{'id':_0x5a299b[_0x3e75('0x56')]['id']}})[_0x3e75('0x28')](handleEntityNotFound(_0x7280ce,null))[_0x3e75('0x28')](removeEntity(_0x7280ce,null))[_0x3e75('0x48')](handleError(_0x7280ce,null));};exports[_0x3e75('0x57')]=function(_0x1053ec,_0x3b748e,_0x50fc13){if(_0x1053ec[_0x3e75('0x55')]['id']){delete _0x1053ec['body']['id'];}return db['Interval']['find']({'where':{'id':_0x1053ec['params']['id']}})[_0x3e75('0x28')](handleEntityNotFound(_0x3b748e,null))[_0x3e75('0x28')](function(_0x596492){if(_0x596492){_0x1053ec[_0x3e75('0x55')][_0x3e75('0x58')]=_0x596492['id'];return db[_0x3e75('0x31')][_0x3e75('0x59')](_0x1053ec[_0x3e75('0x55')]);}})[_0x3e75('0x28')](respondWithResult(_0x3b748e,null))[_0x3e75('0x48')](handleError(_0x3b748e,null));};exports[_0x3e75('0x5a')]=function(_0x592991,_0x37a75d,_0x563809){var _0xfa3e62={};var _0x3227f5={};var _0x3346a9;var _0x5d9730;return db[_0x3e75('0x31')][_0x3e75('0x5b')]({'where':{'id':_0x592991['params']['id']}})[_0x3e75('0x28')](handleEntityNotFound(_0x37a75d,null))[_0x3e75('0x28')](function(_0x4a4c4c){if(_0x4a4c4c){_0x3346a9=_0x4a4c4c;_0x3227f5['model']=_[_0x3e75('0x4a')](db['Interval'][_0x3e75('0x32')]);_0x3227f5['query']=_['keys'](_0x592991[_0x3e75('0x37')]);_0x3227f5[_0x3e75('0x38')]=_[_0x3e75('0x39')](_0x3227f5['model'],_0x3227f5[_0x3e75('0x37')]);_0xfa3e62[_0x3e75('0x3a')]=_[_0x3e75('0x39')](_0x3227f5[_0x3e75('0x36')],qs[_0x3e75('0x3b')](_0x592991[_0x3e75('0x37')][_0x3e75('0x3b')]));_0xfa3e62[_0x3e75('0x3a')]=_0xfa3e62[_0x3e75('0x3a')][_0x3e75('0x3c')]?_0xfa3e62[_0x3e75('0x3a')]:_0x3227f5[_0x3e75('0x36')];_0xfa3e62['order']=qs[_0x3e75('0x40')](_0x592991[_0x3e75('0x37')][_0x3e75('0x40')]);_0xfa3e62[_0x3e75('0x41')]=qs['filters'](_['pick'](_0x592991[_0x3e75('0x37')],_0x3227f5[_0x3e75('0x38')]));if(_0x592991['query'][_0x3e75('0x42')]){_0xfa3e62[_0x3e75('0x41')]=_[_0x3e75('0x43')](_0xfa3e62[_0x3e75('0x41')],{'$or':_['map'](_0xfa3e62[_0x3e75('0x3a')],function(_0x3abf2e){var _0x55e2a7={};_0x55e2a7[_0x3abf2e]={'$like':'%'+_0x592991[_0x3e75('0x37')][_0x3e75('0x42')]+'%'};return _0x55e2a7;})});}_0xfa3e62=_['merge']({},_0xfa3e62,_0x592991[_0x3e75('0x4c')]);return _0x3346a9[_0x3e75('0x5a')](_0xfa3e62);}})[_0x3e75('0x28')](function(_0xeb5cc5){if(_0xeb5cc5){_0x5d9730=_0xeb5cc5[_0x3e75('0x3c')];if(!_0x592991[_0x3e75('0x37')][_0x3e75('0x3d')](_0x3e75('0x3e'))){_0xfa3e62['limit']=qs['limit'](_0x592991[_0x3e75('0x37')]['limit']);_0xfa3e62[_0x3e75('0x20')]=qs['offset'](_0x592991['query']['offset']);}return _0x3346a9[_0x3e75('0x5a')](_0xfa3e62);}})[_0x3e75('0x28')](function(_0x14a4ad){if(_0x14a4ad){return _0x14a4ad?{'count':_0x5d9730,'rows':_0x14a4ad}:null;}})[_0x3e75('0x28')](respondWithResult(_0x37a75d,null))[_0x3e75('0x48')](handleError(_0x37a75d,null));};exports[_0x3e75('0x5c')]=function(_0x235bc5,_0x1facc6,_0x2cf4a3){return db[_0x3e75('0x31')][_0x3e75('0x5b')]({'where':{'id':_0x235bc5[_0x3e75('0x56')]['id']}})['then'](handleEntityNotFound(_0x1facc6,null))['then'](function(_0x1b9e97){if(_0x1b9e97){return db['sequelize']['transaction'](function(_0xf38d0d){return db[_0x3e75('0x31')][_0x3e75('0x29')]({'where':{'IntervalId':_0x235bc5['params']['id']},'transaction':_0xf38d0d})[_0x3e75('0x28')](function(_0x1294bd){var _0x32702b=_[_0x3e75('0x30')](_0x235bc5[_0x3e75('0x55')],function(_0x29a38c){delete _0x29a38c['id'];_0x29a38c[_0x3e75('0x58')]=_0x235bc5['params']['id'];return _0x29a38c;});return db[_0x3e75('0x31')]['bulkCreate'](_0x32702b,{'transaction':_0xf38d0d});});})['then'](function(){return db[_0x3e75('0x31')][_0x3e75('0x46')]({'where':{'IntervalId':_0x235bc5[_0x3e75('0x56')]['id']}});});}})[_0x3e75('0x28')](respondWithResult(_0x1facc6,null))[_0x3e75('0x48')](handleError(_0x1facc6,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index aab88be..3a3dca0 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 _0x26bf=['getIntervals','then','all','map','reduce','../../components/extensions/rewrite','exports','define','Interval','tools_intervals','rewrite','interval'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x26bf,0xad));var _0xf26b=function(_0x326e1e,_0x1a3b88){_0x326e1e=_0x326e1e-0x0;var _0x325660=_0x26bf[_0x326e1e];return _0x325660;};'use strict';var attributes=require('./interval.attributes');var extensions=require(_0xf26b('0x0'));var iftime=require('../../utils/iftime')['iftime'];module[_0xf26b('0x1')]=function(_0x205051){return _0x205051[_0xf26b('0x2')](_0xf26b('0x3'),attributes,{'tableName':_0xf26b('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x3667bc){extensions['rewrite'](_0x205051,_0x3667bc);},'afterBulkCreate':function(_0x3af042,_0x53660c,_0x41eb89){_0x41eb89();extensions['rewrite'](_0x205051,_0x3af042[0x0]);},'afterUpdate':function(_0xb41c7a){extensions[_0xf26b('0x5')](_0x205051,_0xb41c7a);},'afterDestroy':function(_0x429cb0){extensions[_0xf26b('0x5')](_0x205051,_0x429cb0);}},'instanceMethods':{'ifTime':function(_0x553a7d=undefined,_0x3c1b1b=new Date()){if(typeof this[_0xf26b('0x6')]==='string'){return iftime(this[_0xf26b('0x6')],_0x553a7d,_0x3c1b1b);}else{return this[_0xf26b('0x7')]()[_0xf26b('0x8')](function(_0x3510d9){return Promise[_0xf26b('0x9')](_0x3510d9[_0xf26b('0xa')](function(_0x2cb17f){return _0x2cb17f['ifTime'](_0x553a7d,_0x3c1b1b);}));})[_0xf26b('0x8')](function(_0x32b92a){return _0x32b92a[_0xf26b('0xb')](function(_0x30d5c1,_0x394056){return _0x30d5c1||_0x394056;},![]);});}}}});}; \ No newline at end of file +var _0x0df1=['all','ifTime','reduce','./interval.attributes','../../components/extensions/rewrite','iftime','define','tools_intervals','rewrite','interval','string','getIntervals','then'];(function(_0x920609,_0x293824){var _0x5ec34a=function(_0x483e31){while(--_0x483e31){_0x920609['push'](_0x920609['shift']());}};_0x5ec34a(++_0x293824);}(_0x0df1,0x1b0));var _0x10df=function(_0x4e602c,_0x2dde69){_0x4e602c=_0x4e602c-0x0;var _0x3c0f41=_0x0df1[_0x4e602c];return _0x3c0f41;};'use strict';var attributes=require(_0x10df('0x0'));var extensions=require(_0x10df('0x1'));var iftime=require('../../utils/iftime')[_0x10df('0x2')];module['exports']=function(_0x26938c){return _0x26938c[_0x10df('0x3')]('Interval',attributes,{'tableName':_0x10df('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x483853){extensions['rewrite'](_0x26938c,_0x483853);},'afterBulkCreate':function(_0x923519,_0x43c7fd,_0x2e65df){_0x2e65df();extensions[_0x10df('0x5')](_0x26938c,_0x923519[0x0]);},'afterUpdate':function(_0x267775){extensions[_0x10df('0x5')](_0x26938c,_0x267775);},'afterDestroy':function(_0x566550){extensions[_0x10df('0x5')](_0x26938c,_0x566550);}},'instanceMethods':{'ifTime':function(_0x371c7a=undefined,_0x2ff0db=new Date()){if(typeof this[_0x10df('0x6')]===_0x10df('0x7')){return iftime(this[_0x10df('0x6')],_0x371c7a,_0x2ff0db);}else{return this[_0x10df('0x8')]()[_0x10df('0x9')](function(_0x1a0487){return Promise[_0x10df('0xa')](_0x1a0487['map'](function(_0x10bb2a){return _0x10bb2a[_0x10df('0xb')](_0x371c7a,_0x2ff0db);}));})[_0x10df('0x9')](function(_0x1548a2){return _0x1548a2[_0x10df('0xc')](function(_0x58bc53,_0x13df31){return _0x58bc53||_0x13df31;},![]);});}}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 7787f17..de6a032 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 _0xcd95=['raw','where','all','ifTime','info','format','name','join','findById','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','IntervalIftime','intervalIds','isArray','intervals','timezone','length','IntervalIftime:\x20interval\x20strings\x20=\x20%s','IntervalIftime:\x20timezone\x20=\x20%s','resolve','reduce','lodash','util','../../utils/iftime','iftime','rpc','GetInterval','Interval','findAll','options','limit','map','include','model','attributes','then','debug','stringify','catch','error','message','ShowInterval','find'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0xcd95,0x92));var _0x5cd9=function(_0x163beb,_0x4de43b){_0x163beb=_0x163beb-0x0;var _0x53cb8a=_0xcd95[_0x163beb];return _0x53cb8a;};'use strict';var _=require(_0x5cd9('0x0'));var util=require(_0x5cd9('0x1'));var db=require('../../mysqldb')['db'];var iftime=require(_0x5cd9('0x2'))[_0x5cd9('0x3')];var logger=require('../../config/logger')(_0x5cd9('0x4'));exports[_0x5cd9('0x5')]=function(_0x1c8d03){var _0xaaeff=this;return new Promise(function(_0x28519d,_0x58ec55){return db[_0x5cd9('0x6')][_0x5cd9('0x7')]({'raw':_0x1c8d03[_0x5cd9('0x8')]?_0x1c8d03['options']['raw']===undefined?!![]:![]:!![],'where':_0x1c8d03['options']?_0x1c8d03[_0x5cd9('0x8')]['where']||null:null,'attributes':_0x1c8d03['options']?_0x1c8d03['options']['attributes']||null:null,'limit':_0x1c8d03[_0x5cd9('0x8')]?_0x1c8d03['options'][_0x5cd9('0x9')]||null:null,'include':_0x1c8d03[_0x5cd9('0x8')]?_0x1c8d03['options']['include']?_[_0x5cd9('0xa')](_0x1c8d03[_0x5cd9('0x8')][_0x5cd9('0xb')],function(_0x3faae9){return{'model':db[_0x3faae9[_0x5cd9('0xc')]],'as':_0x3faae9['as'],'attributes':_0x3faae9[_0x5cd9('0xd')],'include':_0x3faae9[_0x5cd9('0xb')]?_[_0x5cd9('0xa')](_0x3faae9[_0x5cd9('0xb')],function(_0xe0634f){return{'model':db[_0xe0634f[_0x5cd9('0xc')]],'as':_0xe0634f['as'],'attributes':_0xe0634f[_0x5cd9('0xd')],'include':_0xe0634f[_0x5cd9('0xb')]?_[_0x5cd9('0xa')](_0xe0634f[_0x5cd9('0xb')],function(_0x4af266){return{'model':db[_0x4af266['model']],'as':_0x4af266['as'],'attributes':_0x4af266['attributes']};}):[]};}):[]};}):[]:[]})[_0x5cd9('0xe')](function(_0x156be8){logger['info'](_0x5cd9('0x5'),_0x1c8d03);logger[_0x5cd9('0xf')](_0x5cd9('0x5'),_0x1c8d03,JSON[_0x5cd9('0x10')](_0x156be8));_0x28519d(_0x156be8);})[_0x5cd9('0x11')](function(_0x1164e5){logger[_0x5cd9('0x12')]('GetInterval',_0x1164e5[_0x5cd9('0x13')],_0x1c8d03);_0x58ec55(_0xaaeff[_0x5cd9('0x12')](0x1f4,_0x1164e5['message']));});});};exports[_0x5cd9('0x14')]=function(_0x3e3466){var _0x63ceb7=this;return new Promise(function(_0x1d3add,_0x3318d4){return db[_0x5cd9('0x6')][_0x5cd9('0x15')]({'raw':_0x3e3466[_0x5cd9('0x8')]?_0x3e3466[_0x5cd9('0x8')][_0x5cd9('0x16')]===undefined?!![]:![]:!![],'where':_0x3e3466['options']?_0x3e3466[_0x5cd9('0x8')][_0x5cd9('0x17')]||null:null,'attributes':_0x3e3466[_0x5cd9('0x8')]?_0x3e3466[_0x5cd9('0x8')][_0x5cd9('0xd')]||null:null,'include':_0x3e3466[_0x5cd9('0x8')]?_0x3e3466[_0x5cd9('0x8')][_0x5cd9('0xb')]?_[_0x5cd9('0xa')](_0x3e3466[_0x5cd9('0x8')][_0x5cd9('0xb')],function(_0x179e2b){return{'model':db[_0x179e2b[_0x5cd9('0xc')]],'as':_0x179e2b['as'],'attributes':_0x179e2b[_0x5cd9('0xd')],'include':_0x179e2b['include']?_[_0x5cd9('0xa')](_0x179e2b[_0x5cd9('0xb')],function(_0x15764b){return{'model':db[_0x15764b[_0x5cd9('0xc')]],'as':_0x15764b['as'],'attributes':_0x15764b[_0x5cd9('0xd')],'include':_0x15764b[_0x5cd9('0xb')]?_[_0x5cd9('0xa')](_0x15764b[_0x5cd9('0xb')],function(_0x1e0248){return{'model':db[_0x1e0248[_0x5cd9('0xc')]],'as':_0x1e0248['as'],'attributes':_0x1e0248[_0x5cd9('0xd')]};}):[]};}):[]};}):[]:[]})[_0x5cd9('0xe')](function(_0x2e68b8){logger['info'](_0x5cd9('0x14'),_0x3e3466);logger[_0x5cd9('0xf')](_0x5cd9('0x14'),_0x3e3466,JSON['stringify'](_0x2e68b8));_0x1d3add(_0x2e68b8);})[_0x5cd9('0x11')](function(_0x1180fa){logger[_0x5cd9('0x12')]('ShowInterval',_0x1180fa[_0x5cd9('0x13')],_0x3e3466);_0x3318d4(_0x63ceb7['error'](0x1f4,_0x1180fa['message']));});});};function checkArrayOfIntervals(_0x12d95f,_0x51a7fc){var _0x152989=[];return db[_0x5cd9('0x6')]['findAll']({'where':{'id':_0x12d95f}})['then'](function(_0x2b54fd){_0x152989=_0x2b54fd;return Promise[_0x5cd9('0x18')](_0x152989[_0x5cd9('0xa')](function(_0x5f4dd2){return _0x5f4dd2[_0x5cd9('0x19')](_0x51a7fc);}));})[_0x5cd9('0xe')](function(_0x1b7999){var _0x41f1e7=_0x1b7999['reduce'](function(_0x3c9ec9,_0x1b9bff){return _0x3c9ec9||_0x1b9bff;},![]);logger[_0x5cd9('0x1a')](util[_0x5cd9('0x1b')]('IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)',_0x152989[_0x5cd9('0xa')](function(_0x538f5a){return _0x538f5a[_0x5cd9('0x1c')];})[_0x5cd9('0x1d')](',\x20'),_0x152989[_0x5cd9('0xa')](function(_0x518baf){return _0x518baf['id'];})[_0x5cd9('0x1d')](',\x20')));return _0x41f1e7;});}function checkSingleInterval(_0x579c0c,_0x3810ca){return db[_0x5cd9('0x6')][_0x5cd9('0x1e')](_0x579c0c)[_0x5cd9('0xe')](function(_0x41bef7){if(_0x41bef7){logger['info'](util[_0x5cd9('0x1b')](_0x5cd9('0x1f'),_0x41bef7[_0x5cd9('0x1c')],_0x41bef7['id']));return _0x41bef7[_0x5cd9('0x19')](_0x3810ca);}});}exports[_0x5cd9('0x20')]=function(_0x412b1f){var _0x2aebf7=_0x412b1f[_0x5cd9('0x21')];var _0x122fdd=Array[_0x5cd9('0x22')](_0x412b1f[_0x5cd9('0x23')])?_0x412b1f[_0x5cd9('0x23')]:typeof _0x412b1f[_0x5cd9('0x23')]==='string'?[_0x412b1f[_0x5cd9('0x23')]]:[];var _0x347240=_0x412b1f[_0x5cd9('0x24')]||undefined;var _0x5d7be7=![];if(_0x122fdd[_0x5cd9('0x25')]){logger[_0x5cd9('0x1a')](util[_0x5cd9('0x1b')](_0x5cd9('0x26'),_0x122fdd[_0x5cd9('0x1d')](';\x20')));}if(_0x347240){logger[_0x5cd9('0x1a')](util[_0x5cd9('0x1b')](_0x5cd9('0x27'),_0x347240));}logger[_0x5cd9('0xf')]('Iftime',_0x5d7be7);logger['silly'](_0x5cd9('0x20'),_0x412b1f);return Promise[_0x5cd9('0x28')]()[_0x5cd9('0xe')](function(){if(Array[_0x5cd9('0x22')](_0x2aebf7)){return checkArrayOfIntervals(_0x2aebf7,_0x347240);}else if(_0x2aebf7){return checkSingleInterval(_0x2aebf7,_0x347240);}})['then'](function(_0x39982a){var _0xfce3b5=_0x122fdd[_0x5cd9('0x29')](function(_0x13b864,_0x7db6e6){return _0x13b864||iftime(_0x7db6e6,_0x347240);},![]);_0x5d7be7=_0x39982a||_0xfce3b5;return _0x5d7be7;})[_0x5cd9('0x11')](function(_0x1556b3){logger[_0x5cd9('0x12')](_0x5cd9('0x20'),_0x412b1f,_0x1556b3);throw this['error'](0x1f4,_0x1556b3[_0x5cd9('0x13')]);});}; \ No newline at end of file +var _0x4540=['lodash','util','../../utils/iftime','iftime','GetInterval','Interval','options','raw','where','attributes','limit','include','map','model','then','info','error','message','ShowInterval','find','debug','stringify','catch','findAll','all','ifTime','reduce','format','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','name','join','findById','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','IntervalIftime','intervalIds','isArray','intervals','string','length','IntervalIftime:\x20timezone\x20=\x20%s'];(function(_0x34ad17,_0x246dce){var _0x3dc241=function(_0xa8a137){while(--_0xa8a137){_0x34ad17['push'](_0x34ad17['shift']());}};_0x3dc241(++_0x246dce);}(_0x4540,0x118));var _0x0454=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4540[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0454('0x0'));var util=require(_0x0454('0x1'));var db=require('../../mysqldb')['db'];var iftime=require(_0x0454('0x2'))[_0x0454('0x3')];var logger=require('../../config/logger')('rpc');exports[_0x0454('0x4')]=function(_0x152223){var _0x5eb63a=this;return new Promise(function(_0x8edd8c,_0x17d940){return db[_0x0454('0x5')]['findAll']({'raw':_0x152223[_0x0454('0x6')]?_0x152223[_0x0454('0x6')][_0x0454('0x7')]===undefined?!![]:![]:!![],'where':_0x152223[_0x0454('0x6')]?_0x152223[_0x0454('0x6')][_0x0454('0x8')]||null:null,'attributes':_0x152223[_0x0454('0x6')]?_0x152223[_0x0454('0x6')][_0x0454('0x9')]||null:null,'limit':_0x152223[_0x0454('0x6')]?_0x152223[_0x0454('0x6')][_0x0454('0xa')]||null:null,'include':_0x152223['options']?_0x152223['options'][_0x0454('0xb')]?_[_0x0454('0xc')](_0x152223[_0x0454('0x6')][_0x0454('0xb')],function(_0x4898d5){return{'model':db[_0x4898d5['model']],'as':_0x4898d5['as'],'attributes':_0x4898d5[_0x0454('0x9')],'include':_0x4898d5[_0x0454('0xb')]?_[_0x0454('0xc')](_0x4898d5[_0x0454('0xb')],function(_0x532c22){return{'model':db[_0x532c22[_0x0454('0xd')]],'as':_0x532c22['as'],'attributes':_0x532c22['attributes'],'include':_0x532c22[_0x0454('0xb')]?_[_0x0454('0xc')](_0x532c22[_0x0454('0xb')],function(_0x3615c8){return{'model':db[_0x3615c8['model']],'as':_0x3615c8['as'],'attributes':_0x3615c8['attributes']};}):[]};}):[]};}):[]:[]})[_0x0454('0xe')](function(_0x15f0ef){logger[_0x0454('0xf')](_0x0454('0x4'),_0x152223);logger['debug']('GetInterval',_0x152223,JSON['stringify'](_0x15f0ef));_0x8edd8c(_0x15f0ef);})['catch'](function(_0x3013e2){logger[_0x0454('0x10')](_0x0454('0x4'),_0x3013e2['message'],_0x152223);_0x17d940(_0x5eb63a[_0x0454('0x10')](0x1f4,_0x3013e2[_0x0454('0x11')]));});});};exports[_0x0454('0x12')]=function(_0x1cb7d3){var _0x4a31cd=this;return new Promise(function(_0x44c531,_0x2b1f7d){return db[_0x0454('0x5')][_0x0454('0x13')]({'raw':_0x1cb7d3['options']?_0x1cb7d3[_0x0454('0x6')]['raw']===undefined?!![]:![]:!![],'where':_0x1cb7d3[_0x0454('0x6')]?_0x1cb7d3[_0x0454('0x6')]['where']||null:null,'attributes':_0x1cb7d3[_0x0454('0x6')]?_0x1cb7d3[_0x0454('0x6')][_0x0454('0x9')]||null:null,'include':_0x1cb7d3[_0x0454('0x6')]?_0x1cb7d3[_0x0454('0x6')][_0x0454('0xb')]?_[_0x0454('0xc')](_0x1cb7d3[_0x0454('0x6')][_0x0454('0xb')],function(_0x4b748b){return{'model':db[_0x4b748b[_0x0454('0xd')]],'as':_0x4b748b['as'],'attributes':_0x4b748b[_0x0454('0x9')],'include':_0x4b748b[_0x0454('0xb')]?_['map'](_0x4b748b[_0x0454('0xb')],function(_0x445a80){return{'model':db[_0x445a80['model']],'as':_0x445a80['as'],'attributes':_0x445a80['attributes'],'include':_0x445a80[_0x0454('0xb')]?_['map'](_0x445a80[_0x0454('0xb')],function(_0x12877b){return{'model':db[_0x12877b[_0x0454('0xd')]],'as':_0x12877b['as'],'attributes':_0x12877b[_0x0454('0x9')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x140574){logger[_0x0454('0xf')](_0x0454('0x12'),_0x1cb7d3);logger[_0x0454('0x14')](_0x0454('0x12'),_0x1cb7d3,JSON[_0x0454('0x15')](_0x140574));_0x44c531(_0x140574);})[_0x0454('0x16')](function(_0xe32f72){logger['error']('ShowInterval',_0xe32f72[_0x0454('0x11')],_0x1cb7d3);_0x2b1f7d(_0x4a31cd[_0x0454('0x10')](0x1f4,_0xe32f72[_0x0454('0x11')]));});});};function checkArrayOfIntervals(_0x48a1ee,_0xea98ed){var _0x192f90=[];return db[_0x0454('0x5')][_0x0454('0x17')]({'where':{'id':_0x48a1ee}})[_0x0454('0xe')](function(_0x1f9a0a){_0x192f90=_0x1f9a0a;return Promise[_0x0454('0x18')](_0x192f90[_0x0454('0xc')](function(_0x2d43e4){return _0x2d43e4[_0x0454('0x19')](_0xea98ed);}));})[_0x0454('0xe')](function(_0x4856bc){var _0x567509=_0x4856bc[_0x0454('0x1a')](function(_0x32c16b,_0x552c73){return _0x32c16b||_0x552c73;},![]);logger[_0x0454('0xf')](util[_0x0454('0x1b')](_0x0454('0x1c'),_0x192f90[_0x0454('0xc')](function(_0x317ace){return _0x317ace[_0x0454('0x1d')];})[_0x0454('0x1e')](',\x20'),_0x192f90['map'](function(_0xd16f5a){return _0xd16f5a['id'];})['join'](',\x20')));return _0x567509;});}function checkSingleInterval(_0x1a6f1c,_0x31af96){return db['Interval'][_0x0454('0x1f')](_0x1a6f1c)[_0x0454('0xe')](function(_0x45ca7b){if(_0x45ca7b){logger[_0x0454('0xf')](util['format'](_0x0454('0x20'),_0x45ca7b[_0x0454('0x1d')],_0x45ca7b['id']));return _0x45ca7b[_0x0454('0x19')](_0x31af96);}});}exports[_0x0454('0x21')]=function(_0x2ecad4){var _0x44adc3=_0x2ecad4[_0x0454('0x22')];var _0x31d189=Array[_0x0454('0x23')](_0x2ecad4[_0x0454('0x24')])?_0x2ecad4[_0x0454('0x24')]:typeof _0x2ecad4[_0x0454('0x24')]===_0x0454('0x25')?[_0x2ecad4[_0x0454('0x24')]]:[];var _0x1e5ff4=_0x2ecad4['timezone']||undefined;var _0xdbfd6f=![];if(_0x31d189[_0x0454('0x26')]){logger['info'](util[_0x0454('0x1b')]('IntervalIftime:\x20interval\x20strings\x20=\x20%s',_0x31d189[_0x0454('0x1e')](';\x20')));}if(_0x1e5ff4){logger[_0x0454('0xf')](util[_0x0454('0x1b')](_0x0454('0x27'),_0x1e5ff4));}logger[_0x0454('0x14')]('Iftime',_0xdbfd6f);logger['silly'](_0x0454('0x21'),_0x2ecad4);return Promise['resolve']()['then'](function(){if(Array[_0x0454('0x23')](_0x44adc3)){return checkArrayOfIntervals(_0x44adc3,_0x1e5ff4);}else if(_0x44adc3){return checkSingleInterval(_0x44adc3,_0x1e5ff4);}})[_0x0454('0xe')](function(_0x364c8b){var _0x27ebc3=_0x31d189[_0x0454('0x1a')](function(_0x50d5da,_0x3c4846){return _0x50d5da||iftime(_0x3c4846,_0x1e5ff4);},![]);_0xdbfd6f=_0x364c8b||_0x27ebc3;return _0xdbfd6f;})['catch'](function(_0x3ca6fc){logger[_0x0454('0x10')]('IntervalIftime',_0x2ecad4,_0x3ca6fc);throw this['error'](0x1f4,_0x3ca6fc[_0x0454('0x11')]);});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index 2e82043..c3d4fd9 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 _0xdb28=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller'];(function(_0x16c34b,_0x3f9007){var _0x1f34a5=function(_0x44f6dc){while(--_0x44f6dc){_0x16c34b['push'](_0x16c34b['shift']());}};_0x1f34a5(++_0x3f9007);}(_0xdb28,0x106));var _0x8db2=function(_0x436d5d,_0x37e865){_0x436d5d=_0x436d5d-0x0;var _0x470dfa=_0xdb28[_0x436d5d];return _0x470dfa;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['post']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);module[_0x8db2('0x6')]=router; \ No newline at end of file +var _0x2ef3=['./jira.controller','post','isAuthenticated','exports','express','Router','../../components/auth/service'];(function(_0x539c5f,_0x287147){var _0x23f5c8=function(_0x129657){while(--_0x129657){_0x539c5f['push'](_0x539c5f['shift']());}};_0x23f5c8(++_0x287147);}(_0x2ef3,0xba));var _0x32ef=function(_0x4418d7,_0x1ba876){_0x4418d7=_0x4418d7-0x0;var _0x27f152=_0x2ef3[_0x4418d7];return _0x27f152;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['send']);module[_0x32ef('0x6')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 4334a1b..00390b6 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 _0xe95a=['summary','Report','\x20from\x20','description','stringify','issuetype','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','name','reason','customfield_10102','track.xcallymotion.com','application/json','toString','request','setEncoding','utf8','data','end','statusCode','json','error','status','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','write','send','body','headers','connection','remoteAddress','socket','https','api','support','3eAmWpBVP0','key','MOTGUI'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe95a,0x127));var _0xae95=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xe95a[_0x47b58b];return _0x46bebe;};'use strict';var BPromise=require('bluebird');var https=require(_0xae95('0x0'));var logger=require('../../config/logger')(_0xae95('0x1'));var USERNAME=_0xae95('0x2');var PASSWORD=_0xae95('0x3');function openIssue(_0x1b4b98,_0x43bda1){var _0x50ac87={'fields':{'project':{'key':_0x1b4b98[_0xae95('0x4')]||_0xae95('0x5')},'summary':(_0x1b4b98[_0xae95('0x6')]||_0xae95('0x7'))+_0xae95('0x8')+_0x1b4b98['ip'],'description':_0x1b4b98[_0xae95('0x9')]||JSON[_0xae95('0xa')](_0x1b4b98),'issuetype':{'name':_0x1b4b98[_0xae95('0xb')]||'Bug'}}};_0x50ac87[_0xae95('0xc')][_0xae95('0xd')]=_0x1b4b98[_0xae95('0xe')];_0x50ac87[_0xae95('0xc')][_0xae95('0xf')]=_0x1b4b98[_0xae95('0x10')];_0x50ac87[_0xae95('0xc')][_0xae95('0x11')]=_0x1b4b98[_0xae95('0x12')];_0x50ac87[_0xae95('0xc')][_0xae95('0x13')]=_0x1b4b98[_0xae95('0x14')];_0x50ac87[_0xae95('0xc')]['customfield_11504']=_0x1b4b98[_0xae95('0x15')];_0x50ac87[_0xae95('0xc')][_0xae95('0x16')]=_0x1b4b98['ip'];var _0xbeae0e={'host':_0xae95('0x17'),'port':0x1bb,'path':'/rest/api/2/issue','method':'POST','timeout':0x4e20,'headers':{'Content-Type':_0xae95('0x18'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0xae95('0x19')]('base64')}};var _0x1af3ab=JSON[_0xae95('0xa')](_0x50ac87);var _0x2b81e8=https[_0xae95('0x1a')](_0xbeae0e,function(_0x4f2eb7){_0x4f2eb7[_0xae95('0x1b')](_0xae95('0x1c'));var _0xf1a36b='';_0x4f2eb7['on'](_0xae95('0x1d'),function(_0x35b5b8){_0xf1a36b+=_0x35b5b8;});_0x4f2eb7['on'](_0xae95('0x1e'),function(){if(_0x43bda1){return _0x43bda1['status'](_0x4f2eb7[_0xae95('0x1f')])[_0xae95('0x20')](JSON['parse'](_0xf1a36b));}});});_0x2b81e8['on'](_0xae95('0x21'),function(_0x57ce1f){if(_0x43bda1){return _0x43bda1[_0xae95('0x22')](0x1f4)[_0xae95('0x20')]({'errors':[{'message':_0xae95('0x23'),'type':'api.jira'}]});}});_0x2b81e8[_0xae95('0x24')](_0x1af3ab);_0x2b81e8[_0xae95('0x1e')]();}exports['openIssue']=openIssue;exports[_0xae95('0x25')]=function(_0x54e566,_0xf74bd5){_0x54e566[_0xae95('0x26')]['ip']=_0x54e566[_0xae95('0x27')]['x-forwarded-for']||_0x54e566[_0xae95('0x28')][_0xae95('0x29')]||_0x54e566[_0xae95('0x2a')][_0xae95('0x29')]||_0x54e566[_0xae95('0x28')]['socket'][_0xae95('0x29')];return openIssue(_0x54e566[_0xae95('0x26')],_0xf74bd5);}; \ No newline at end of file +var _0x5fac=['Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','body','headers','connection','remoteAddress','socket','bluebird','https','../../config/logger','api','3eAmWpBVP0','key','MOTGUI','summary','Report','\x20from\x20','description','stringify','issuetype','Bug','fields','customfield_11500','email','oldToken','customfield_11502','customfield_11503','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','Basic\x20','base64','request','setEncoding','utf8','end','status','statusCode','json','error'];(function(_0x454b99,_0x4b6743){var _0x620423=function(_0x18d3f3){while(--_0x18d3f3){_0x454b99['push'](_0x454b99['shift']());}};_0x620423(++_0x4b6743);}(_0x5fac,0x1e0));var _0xc5fa=function(_0x268eb6,_0x4b936c){_0x268eb6=_0x268eb6-0x0;var _0x2bf553=_0x5fac[_0x268eb6];return _0x2bf553;};'use strict';var BPromise=require(_0xc5fa('0x0'));var https=require(_0xc5fa('0x1'));var logger=require(_0xc5fa('0x2'))(_0xc5fa('0x3'));var USERNAME='support';var PASSWORD=_0xc5fa('0x4');function openIssue(_0x332354,_0x35f51c){var _0x3adcf2={'fields':{'project':{'key':_0x332354[_0xc5fa('0x5')]||_0xc5fa('0x6')},'summary':(_0x332354[_0xc5fa('0x7')]||_0xc5fa('0x8'))+_0xc5fa('0x9')+_0x332354['ip'],'description':_0x332354[_0xc5fa('0xa')]||JSON[_0xc5fa('0xb')](_0x332354),'issuetype':{'name':_0x332354[_0xc5fa('0xc')]||_0xc5fa('0xd')}}};_0x3adcf2[_0xc5fa('0xe')][_0xc5fa('0xf')]=_0x332354[_0xc5fa('0x10')];_0x3adcf2[_0xc5fa('0xe')]['customfield_11501']=_0x332354[_0xc5fa('0x11')];_0x3adcf2[_0xc5fa('0xe')][_0xc5fa('0x12')]=_0x332354['newToken'];_0x3adcf2[_0xc5fa('0xe')][_0xc5fa('0x13')]=_0x332354[_0xc5fa('0x14')];_0x3adcf2[_0xc5fa('0xe')][_0xc5fa('0x15')]=_0x332354[_0xc5fa('0x16')];_0x3adcf2[_0xc5fa('0xe')][_0xc5fa('0x17')]=_0x332354['ip'];var _0x23a92a={'host':_0xc5fa('0x18'),'port':0x1bb,'path':_0xc5fa('0x19'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':_0xc5fa('0x1a')+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0xc5fa('0x1b'))}};var _0x5bdc53=JSON[_0xc5fa('0xb')](_0x3adcf2);var _0x586905=https[_0xc5fa('0x1c')](_0x23a92a,function(_0x5f414b){_0x5f414b[_0xc5fa('0x1d')](_0xc5fa('0x1e'));var _0x314ad5='';_0x5f414b['on']('data',function(_0x5a5d63){_0x314ad5+=_0x5a5d63;});_0x5f414b['on'](_0xc5fa('0x1f'),function(){if(_0x35f51c){return _0x35f51c[_0xc5fa('0x20')](_0x5f414b[_0xc5fa('0x21')])[_0xc5fa('0x22')](JSON['parse'](_0x314ad5));}});});_0x586905['on'](_0xc5fa('0x23'),function(_0xab6609){if(_0x35f51c){return _0x35f51c[_0xc5fa('0x20')](0x1f4)['json']({'errors':[{'message':_0xc5fa('0x24'),'type':_0xc5fa('0x25')}]});}});_0x586905['write'](_0x5bdc53);_0x586905['end']();}exports['openIssue']=openIssue;exports['send']=function(_0x503822,_0x14d543){_0x503822[_0xc5fa('0x26')]['ip']=_0x503822[_0xc5fa('0x27')]['x-forwarded-for']||_0x503822[_0xc5fa('0x28')][_0xc5fa('0x29')]||_0x503822['socket'][_0xc5fa('0x29')]||_0x503822[_0xc5fa('0x28')][_0xc5fa('0x2a')][_0xc5fa('0x29')];return openIssue(_0x503822[_0xc5fa('0x26')],_0x14d543);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 4ef7c7d..b7b58a8 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 _0xfd28=['show','put','delete','destroy','exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyAnswerReport.controller','get','isAuthenticated','index','describe','/:id'];(function(_0x20acdb,_0x210c8e){var _0x383b0d=function(_0x5d0919){while(--_0x5d0919){_0x20acdb['push'](_0x20acdb['shift']());}};_0x383b0d(++_0x210c8e);}(_0xfd28,0x148));var _0x8fd2=function(_0xf73c09,_0x4e424e){_0xf73c09=_0xf73c09-0x0;var _0xa8923c=_0xfd28[_0xf73c09];return _0xa8923c;};'use strict';var multer=require('multer');var util=require(_0x8fd2('0x0'));var path=require(_0x8fd2('0x1'));var timeout=require('connect-timeout');var express=require(_0x8fd2('0x2'));var router=express['Router']();var fs_extra=require(_0x8fd2('0x3'));var auth=require(_0x8fd2('0x4'));var interaction=require(_0x8fd2('0x5'));var config=require('../../config/environment');var controller=require(_0x8fd2('0x6'));router[_0x8fd2('0x7')]('/',auth[_0x8fd2('0x8')](),controller[_0x8fd2('0x9')]);router[_0x8fd2('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x8fd2('0xa')]);router[_0x8fd2('0x7')](_0x8fd2('0xb'),auth['isAuthenticated'](),controller[_0x8fd2('0xc')]);router['post']('/',auth[_0x8fd2('0x8')](),controller['create']);router[_0x8fd2('0xd')]('/:id',auth[_0x8fd2('0x8')](),controller['update']);router[_0x8fd2('0xe')]('/:id',auth[_0x8fd2('0x8')](),controller[_0x8fd2('0xf')]);module[_0x8fd2('0x10')]=router; \ No newline at end of file +var _0xaa88=['/describe','isAuthenticated','describe','get','show','post','create','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','index'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0xaa88,0x137));var _0x8aa8=function(_0x3a7a9c,_0x24f7d6){_0x3a7a9c=_0x3a7a9c-0x0;var _0x59156e=_0xaa88[_0x3a7a9c];return _0x59156e;};'use strict';var multer=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var path=require(_0x8aa8('0x2'));var timeout=require(_0x8aa8('0x3'));var express=require('express');var router=express[_0x8aa8('0x4')]();var fs_extra=require(_0x8aa8('0x5'));var auth=require(_0x8aa8('0x6'));var interaction=require(_0x8aa8('0x7'));var config=require(_0x8aa8('0x8'));var controller=require(_0x8aa8('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x8aa8('0xa')]);router['get'](_0x8aa8('0xb'),auth[_0x8aa8('0xc')](),controller[_0x8aa8('0xd')]);router[_0x8aa8('0xe')]('/:id',auth[_0x8aa8('0xc')](),controller[_0x8aa8('0xf')]);router[_0x8aa8('0x10')]('/',auth['isAuthenticated'](),controller[_0x8aa8('0x11')]);router[_0x8aa8('0x12')](_0x8aa8('0x13'),auth[_0x8aa8('0xc')](),controller['update']);router[_0x8aa8('0x14')](_0x8aa8('0x13'),auth['isAuthenticated'](),controller[_0x8aa8('0x15')]);module[_0x8aa8('0x16')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 76aa23d..728e4a8 100644 --- a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js +++ b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0x7a54,0x106));var _0x47a5=function(_0x21ea43,_0x6c9c17){_0x21ea43=_0x21ea43-0x0;var _0x4da34c=_0x7a54[_0x21ea43];return _0x4da34c;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file +var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0x7a54,0x106));var _0x47a5=function(_0x3f355a,_0x3841b0){_0x3f355a=_0x3f355a-0x0;var _0xfe9cff=_0x7a54[_0x3f355a];return _0xfe9cff;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js index 7cd6625..e0ac068 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 _0x1501=['update','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','then','stack','name','send','index','map','JscriptyAnswerReport','fieldName','type','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','create','body'];(function(_0x2724b0,_0xeb362){var _0xeba497=function(_0x5e8122){while(--_0x5e8122){_0x2724b0['push'](_0x2724b0['shift']());}};_0xeba497(++_0xeb362);}(_0x1501,0x126));var _0x1150=function(_0x316752,_0x4068d5){_0x316752=_0x316752-0x0;var _0x510986=_0x1501[_0x316752];return _0x510986;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1150('0x0'));var zipdir=require(_0x1150('0x1'));var jsonpatch=require(_0x1150('0x2'));var rp=require('request-promise');var moment=require(_0x1150('0x3'));var BPromise=require(_0x1150('0x4'));var Mustache=require(_0x1150('0x5'));var util=require(_0x1150('0x6'));var path=require('path');var sox=require(_0x1150('0x7'));var csv=require('to-csv');var ejs=require(_0x1150('0x8'));var fs=require('fs');var fs_extra=require(_0x1150('0x9'));var _=require(_0x1150('0xa'));var squel=require(_0x1150('0xb'));var crypto=require(_0x1150('0xc'));var jsforce=require(_0x1150('0xd'));var deskjs=require(_0x1150('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1150('0xf'));var Redis=require(_0x1150('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1150('0x11'));var hardwareService=require(_0x1150('0x12'));var logger=require(_0x1150('0x13'))(_0x1150('0x14'));var utils=require('../../config/utils');var config=require(_0x1150('0x15'));var licenseUtil=require(_0x1150('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3bcf2e,_0x4ca5ef){_0x4ca5ef=_0x4ca5ef||0xcc;return function(_0x1d2549){if(_0x1d2549){return _0x3bcf2e[_0x1150('0x17')](_0x4ca5ef);}return _0x3bcf2e[_0x1150('0x18')](_0x4ca5ef)[_0x1150('0x19')]();};}function respondWithResult(_0x787aac,_0x18f378){_0x18f378=_0x18f378||0xc8;return function(_0x474069){if(_0x474069){return _0x787aac[_0x1150('0x18')](_0x18f378)['json'](_0x474069);}};}function respondWithFilteredResult(_0x498bab,_0x3cc5e7){return function(_0x146d70){if(_0x146d70){var _0x54df42=typeof _0x3cc5e7[_0x1150('0x1a')]===_0x1150('0x1b')&&typeof _0x3cc5e7[_0x1150('0x1c')]===_0x1150('0x1b');var _0x378eb8=_0x146d70[_0x1150('0x1d')];var _0x35664d=_0x54df42?0x0:_0x3cc5e7['offset'];var _0x517569=_0x54df42?_0x146d70[_0x1150('0x1d')]:_0x3cc5e7[_0x1150('0x1a')]+_0x3cc5e7['limit'];var _0x1bac5b;if(_0x517569>=_0x378eb8){_0x517569=_0x378eb8;_0x1bac5b=0xc8;}else{_0x1bac5b=0xce;}_0x498bab['status'](_0x1bac5b);return _0x498bab[_0x1150('0x1e')]('Content-Range',_0x35664d+'-'+_0x517569+'/'+_0x378eb8)[_0x1150('0x1f')](_0x146d70);}return null;};}function patchUpdates(_0x4bdae2){return function(_0x5a96f8){try{jsonpatch[_0x1150('0x20')](_0x5a96f8,_0x4bdae2,!![]);}catch(_0x2f4fec){return BPromise[_0x1150('0x21')](_0x2f4fec);}return _0x5a96f8[_0x1150('0x22')]();};}function saveUpdates(_0xd10701,_0x3e25da){return function(_0x3f5fcf){if(_0x3f5fcf){return _0x3f5fcf['update'](_0xd10701)['then'](function(_0x30ca9c){return _0x30ca9c;});}return null;};}function removeEntity(_0x28b396,_0x37da51){return function(_0x440b93){if(_0x440b93){return _0x440b93['destroy']()[_0x1150('0x23')](function(){_0x28b396[_0x1150('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b82ba,_0x497ef2){return function(_0x39b1bd){if(!_0x39b1bd){_0x4b82ba[_0x1150('0x17')](0x194);}return _0x39b1bd;};}function handleError(_0x5707ce,_0x2fbda8){_0x2fbda8=_0x2fbda8||0x1f4;return function(_0x1ebf83){logger['error'](_0x1ebf83[_0x1150('0x24')]);if(_0x1ebf83[_0x1150('0x25')]){delete _0x1ebf83[_0x1150('0x25')];}_0x5707ce[_0x1150('0x18')](_0x2fbda8)[_0x1150('0x26')](_0x1ebf83);};}exports[_0x1150('0x27')]=function(_0x213e81,_0x3a88df){var _0x4ad8f3={},_0x32c245={},_0x3b67f9={'count':0x0,'rows':[]};var _0x26f6dd=_[_0x1150('0x28')](db[_0x1150('0x29')]['rawAttributes'],function(_0x1e3691){return{'name':_0x1e3691[_0x1150('0x2a')],'type':_0x1e3691[_0x1150('0x2b')]['key']};});_0x32c245['model']=_[_0x1150('0x28')](_0x26f6dd,_0x1150('0x25'));_0x32c245[_0x1150('0x2c')]=_[_0x1150('0x2d')](_0x213e81[_0x1150('0x2c')]);_0x32c245[_0x1150('0x2e')]=_[_0x1150('0x2f')](_0x32c245['model'],_0x32c245[_0x1150('0x2c')]);_0x4ad8f3[_0x1150('0x30')]=_['intersection'](_0x32c245[_0x1150('0x31')],qs['fields'](_0x213e81['query'][_0x1150('0x32')]));_0x4ad8f3[_0x1150('0x30')]=_0x4ad8f3[_0x1150('0x30')][_0x1150('0x33')]?_0x4ad8f3['attributes']:_0x32c245[_0x1150('0x31')];if(!_0x213e81[_0x1150('0x2c')][_0x1150('0x34')](_0x1150('0x35'))){_0x4ad8f3[_0x1150('0x1c')]=qs[_0x1150('0x1c')](_0x213e81[_0x1150('0x2c')]['limit']);_0x4ad8f3[_0x1150('0x1a')]=qs[_0x1150('0x1a')](_0x213e81[_0x1150('0x2c')]['offset']);}_0x4ad8f3[_0x1150('0x36')]=qs[_0x1150('0x37')](_0x213e81[_0x1150('0x2c')]['sort']);_0x4ad8f3['where']=qs[_0x1150('0x2e')](_[_0x1150('0x38')](_0x213e81[_0x1150('0x2c')],_0x32c245['filters']),_0x26f6dd);if(_0x213e81['query'][_0x1150('0x39')]){_0x4ad8f3[_0x1150('0x3a')]=_['merge'](_0x4ad8f3[_0x1150('0x3a')],{'$or':_[_0x1150('0x28')](_0x26f6dd,function(_0x1435d3){if(_0x1435d3['type']!=='VIRTUAL'){var _0x10572e={};_0x10572e[_0x1435d3[_0x1150('0x25')]]={'$like':'%'+_0x213e81['query'][_0x1150('0x39')]+'%'};return _0x10572e;}})});}_0x4ad8f3=_[_0x1150('0x3b')]({},_0x4ad8f3,_0x213e81[_0x1150('0x3c')]);var _0x51e2cf={'where':_0x4ad8f3[_0x1150('0x3a')]};return db[_0x1150('0x29')][_0x1150('0x1d')](_0x51e2cf)[_0x1150('0x23')](function(_0x10429c){_0x3b67f9[_0x1150('0x1d')]=_0x10429c;if(_0x213e81[_0x1150('0x2c')][_0x1150('0x3d')]){_0x4ad8f3['include']=[{'all':!![]}];}return db[_0x1150('0x29')][_0x1150('0x3e')](_0x4ad8f3);})['then'](function(_0x3e56b6){_0x3b67f9[_0x1150('0x3f')]=_0x3e56b6;return _0x3b67f9;})[_0x1150('0x23')](respondWithFilteredResult(_0x3a88df,_0x4ad8f3))[_0x1150('0x40')](handleError(_0x3a88df,null));};exports[_0x1150('0x41')]=function(_0x15e483,_0x539cff){var _0x11a7ed={'raw':!![],'where':{'id':_0x15e483[_0x1150('0x42')]['id']}},_0x4db1cf={};_0x4db1cf['model']=_[_0x1150('0x2d')](db['JscriptyAnswerReport'][_0x1150('0x43')]);_0x4db1cf[_0x1150('0x2c')]=_[_0x1150('0x2d')](_0x15e483['query']);_0x4db1cf['filters']=_[_0x1150('0x2f')](_0x4db1cf[_0x1150('0x31')],_0x4db1cf['query']);_0x11a7ed[_0x1150('0x30')]=_[_0x1150('0x2f')](_0x4db1cf[_0x1150('0x31')],qs[_0x1150('0x32')](_0x15e483[_0x1150('0x2c')][_0x1150('0x32')]));_0x11a7ed[_0x1150('0x30')]=_0x11a7ed['attributes'][_0x1150('0x33')]?_0x11a7ed[_0x1150('0x30')]:_0x4db1cf[_0x1150('0x31')];if(_0x15e483['query'][_0x1150('0x3d')]){_0x11a7ed[_0x1150('0x44')]=[{'all':!![]}];}_0x11a7ed=_['merge']({},_0x11a7ed,_0x15e483['options']);return db[_0x1150('0x29')]['find'](_0x11a7ed)[_0x1150('0x23')](handleEntityNotFound(_0x539cff,null))[_0x1150('0x23')](respondWithResult(_0x539cff,null))[_0x1150('0x40')](handleError(_0x539cff,null));};exports['create']=function(_0x2160a0,_0x41f1eb){return db[_0x1150('0x29')][_0x1150('0x45')](_0x2160a0[_0x1150('0x46')],{})[_0x1150('0x23')](respondWithResult(_0x41f1eb,0xc9))[_0x1150('0x40')](handleError(_0x41f1eb,null));};exports[_0x1150('0x47')]=function(_0xedd0b7,_0x4f10a1){if(_0xedd0b7[_0x1150('0x46')]['id']){delete _0xedd0b7[_0x1150('0x46')]['id'];}return db['JscriptyAnswerReport']['find']({'where':{'id':_0xedd0b7[_0x1150('0x42')]['id']}})['then'](handleEntityNotFound(_0x4f10a1,null))['then'](saveUpdates(_0xedd0b7['body'],null))[_0x1150('0x23')](respondWithResult(_0x4f10a1,null))[_0x1150('0x40')](handleError(_0x4f10a1,null));};exports['destroy']=function(_0x18bf8b,_0x3e77f1){return db[_0x1150('0x29')]['find']({'where':{'id':_0x18bf8b[_0x1150('0x42')]['id']}})[_0x1150('0x23')](handleEntityNotFound(_0x3e77f1,null))['then'](removeEntity(_0x3e77f1,null))[_0x1150('0x40')](handleError(_0x3e77f1,null));};exports[_0x1150('0x48')]=function(_0x1f9062,_0x357854){return db[_0x1150('0x29')]['describe']()['then'](respondWithResult(_0x357854,null))[_0x1150('0x40')](handleError(_0x357854,null));}; \ No newline at end of file +var _0xafdd=['pick','filter','merge','type','VIRTUAL','options','JscriptyAnswerReport','includeAll','findAll','rows','catch','show','params','rawAttributes','intersection','include','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','send','fieldName','model','map','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','sort','where'];(function(_0x2c4d9f,_0x266437){var _0x3c558a=function(_0xe83d03){while(--_0xe83d03){_0x2c4d9f['push'](_0x2c4d9f['shift']());}};_0x3c558a(++_0x266437);}(_0xafdd,0x19a));var _0xdafd=function(_0x37c378,_0xdf16f5){_0x37c378=_0x37c378-0x0;var _0x2df80c=_0xafdd[_0x37c378];return _0x2df80c;};'use strict';var emlformat=require(_0xdafd('0x0'));var rimraf=require(_0xdafd('0x1'));var zipdir=require(_0xdafd('0x2'));var jsonpatch=require(_0xdafd('0x3'));var rp=require(_0xdafd('0x4'));var moment=require(_0xdafd('0x5'));var BPromise=require(_0xdafd('0x6'));var Mustache=require(_0xdafd('0x7'));var util=require('util');var path=require(_0xdafd('0x8'));var sox=require(_0xdafd('0x9'));var csv=require(_0xdafd('0xa'));var ejs=require(_0xdafd('0xb'));var fs=require('fs');var fs_extra=require(_0xdafd('0xc'));var _=require(_0xdafd('0xd'));var squel=require(_0xdafd('0xe'));var crypto=require('crypto');var jsforce=require(_0xdafd('0xf'));var deskjs=require(_0xdafd('0x10'));var toCsv=require(_0xdafd('0xa'));var querystring=require('querystring');var Papa=require(_0xdafd('0x11'));var Redis=require(_0xdafd('0x12'));var authService=require(_0xdafd('0x13'));var qs=require(_0xdafd('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdafd('0x15'));var logger=require(_0xdafd('0x16'))(_0xdafd('0x17'));var utils=require(_0xdafd('0x18'));var config=require(_0xdafd('0x19'));var licenseUtil=require(_0xdafd('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x166176,_0x594f47){_0x594f47=_0x594f47||0xcc;return function(_0x553508){if(_0x553508){return _0x166176[_0xdafd('0x1b')](_0x594f47);}return _0x166176[_0xdafd('0x1c')](_0x594f47)['end']();};}function respondWithResult(_0x43a716,_0x490382){_0x490382=_0x490382||0xc8;return function(_0x4b09da){if(_0x4b09da){return _0x43a716[_0xdafd('0x1c')](_0x490382)[_0xdafd('0x1d')](_0x4b09da);}};}function respondWithFilteredResult(_0x583b1d,_0x267bfc){return function(_0x186379){if(_0x186379){var _0x496515=typeof _0x267bfc[_0xdafd('0x1e')]===_0xdafd('0x1f')&&typeof _0x267bfc[_0xdafd('0x20')]==='undefined';var _0xb382ca=_0x186379[_0xdafd('0x21')];var _0x4fc3a4=_0x496515?0x0:_0x267bfc['offset'];var _0x2569b2=_0x496515?_0x186379['count']:_0x267bfc[_0xdafd('0x1e')]+_0x267bfc[_0xdafd('0x20')];var _0x1e64d3;if(_0x2569b2>=_0xb382ca){_0x2569b2=_0xb382ca;_0x1e64d3=0xc8;}else{_0x1e64d3=0xce;}_0x583b1d[_0xdafd('0x1c')](_0x1e64d3);return _0x583b1d[_0xdafd('0x22')](_0xdafd('0x23'),_0x4fc3a4+'-'+_0x2569b2+'/'+_0xb382ca)[_0xdafd('0x1d')](_0x186379);}return null;};}function patchUpdates(_0x42e0f9){return function(_0x8480a8){try{jsonpatch[_0xdafd('0x24')](_0x8480a8,_0x42e0f9,!![]);}catch(_0xee767e){return BPromise[_0xdafd('0x25')](_0xee767e);}return _0x8480a8[_0xdafd('0x26')]();};}function saveUpdates(_0xf4a521,_0x491d96){return function(_0x230495){if(_0x230495){return _0x230495['update'](_0xf4a521)[_0xdafd('0x27')](function(_0x5e96cc){return _0x5e96cc;});}return null;};}function removeEntity(_0x439bbf,_0x35ef78){return function(_0x7f10f6){if(_0x7f10f6){return _0x7f10f6[_0xdafd('0x28')]()[_0xdafd('0x27')](function(){_0x439bbf[_0xdafd('0x1c')](0xcc)[_0xdafd('0x29')]();});}};}function handleEntityNotFound(_0x30cba9,_0x3846dd){return function(_0x5cd11d){if(!_0x5cd11d){_0x30cba9[_0xdafd('0x1b')](0x194);}return _0x5cd11d;};}function handleError(_0x2ab575,_0x18554c){_0x18554c=_0x18554c||0x1f4;return function(_0x1feb5b){logger[_0xdafd('0x2a')](_0x1feb5b[_0xdafd('0x2b')]);if(_0x1feb5b[_0xdafd('0x2c')]){delete _0x1feb5b[_0xdafd('0x2c')];}_0x2ab575[_0xdafd('0x1c')](_0x18554c)[_0xdafd('0x2d')](_0x1feb5b);};}exports['index']=function(_0x243182,_0x14626b){var _0x13ab81={},_0x249743={},_0x21edb6={'count':0x0,'rows':[]};var _0x324f0f=_['map'](db['JscriptyAnswerReport']['rawAttributes'],function(_0xcca4f){return{'name':_0xcca4f[_0xdafd('0x2e')],'type':_0xcca4f['type']['key']};});_0x249743[_0xdafd('0x2f')]=_[_0xdafd('0x30')](_0x324f0f,_0xdafd('0x2c'));_0x249743[_0xdafd('0x31')]=_[_0xdafd('0x32')](_0x243182[_0xdafd('0x31')]);_0x249743[_0xdafd('0x33')]=_['intersection'](_0x249743[_0xdafd('0x2f')],_0x249743[_0xdafd('0x31')]);_0x13ab81[_0xdafd('0x34')]=_['intersection'](_0x249743[_0xdafd('0x2f')],qs[_0xdafd('0x35')](_0x243182['query'][_0xdafd('0x35')]));_0x13ab81[_0xdafd('0x34')]=_0x13ab81[_0xdafd('0x34')]['length']?_0x13ab81[_0xdafd('0x34')]:_0x249743[_0xdafd('0x2f')];if(!_0x243182[_0xdafd('0x31')][_0xdafd('0x36')](_0xdafd('0x37'))){_0x13ab81[_0xdafd('0x20')]=qs[_0xdafd('0x20')](_0x243182['query'][_0xdafd('0x20')]);_0x13ab81[_0xdafd('0x1e')]=qs[_0xdafd('0x1e')](_0x243182[_0xdafd('0x31')][_0xdafd('0x1e')]);}_0x13ab81['order']=qs[_0xdafd('0x38')](_0x243182[_0xdafd('0x31')]['sort']);_0x13ab81[_0xdafd('0x39')]=qs[_0xdafd('0x33')](_[_0xdafd('0x3a')](_0x243182[_0xdafd('0x31')],_0x249743[_0xdafd('0x33')]),_0x324f0f);if(_0x243182[_0xdafd('0x31')][_0xdafd('0x3b')]){_0x13ab81[_0xdafd('0x39')]=_[_0xdafd('0x3c')](_0x13ab81[_0xdafd('0x39')],{'$or':_[_0xdafd('0x30')](_0x324f0f,function(_0x245163){if(_0x245163[_0xdafd('0x3d')]!==_0xdafd('0x3e')){var _0xb1e264={};_0xb1e264[_0x245163[_0xdafd('0x2c')]]={'$like':'%'+_0x243182[_0xdafd('0x31')][_0xdafd('0x3b')]+'%'};return _0xb1e264;}})});}_0x13ab81=_[_0xdafd('0x3c')]({},_0x13ab81,_0x243182[_0xdafd('0x3f')]);var _0x3f25c2={'where':_0x13ab81[_0xdafd('0x39')]};return db[_0xdafd('0x40')][_0xdafd('0x21')](_0x3f25c2)[_0xdafd('0x27')](function(_0x21d43d){_0x21edb6['count']=_0x21d43d;if(_0x243182['query'][_0xdafd('0x41')]){_0x13ab81['include']=[{'all':!![]}];}return db[_0xdafd('0x40')][_0xdafd('0x42')](_0x13ab81);})['then'](function(_0x4b463c){_0x21edb6[_0xdafd('0x43')]=_0x4b463c;return _0x21edb6;})[_0xdafd('0x27')](respondWithFilteredResult(_0x14626b,_0x13ab81))[_0xdafd('0x44')](handleError(_0x14626b,null));};exports[_0xdafd('0x45')]=function(_0xbc5159,_0x184a59){var _0x3a3a14={'raw':!![],'where':{'id':_0xbc5159[_0xdafd('0x46')]['id']}},_0x2417f8={};_0x2417f8['model']=_['keys'](db[_0xdafd('0x40')][_0xdafd('0x47')]);_0x2417f8[_0xdafd('0x31')]=_[_0xdafd('0x32')](_0xbc5159[_0xdafd('0x31')]);_0x2417f8[_0xdafd('0x33')]=_[_0xdafd('0x48')](_0x2417f8[_0xdafd('0x2f')],_0x2417f8[_0xdafd('0x31')]);_0x3a3a14[_0xdafd('0x34')]=_[_0xdafd('0x48')](_0x2417f8[_0xdafd('0x2f')],qs[_0xdafd('0x35')](_0xbc5159['query'][_0xdafd('0x35')]));_0x3a3a14['attributes']=_0x3a3a14[_0xdafd('0x34')]['length']?_0x3a3a14[_0xdafd('0x34')]:_0x2417f8[_0xdafd('0x2f')];if(_0xbc5159[_0xdafd('0x31')][_0xdafd('0x41')]){_0x3a3a14[_0xdafd('0x49')]=[{'all':!![]}];}_0x3a3a14=_[_0xdafd('0x3c')]({},_0x3a3a14,_0xbc5159['options']);return db[_0xdafd('0x40')][_0xdafd('0x4a')](_0x3a3a14)[_0xdafd('0x27')](handleEntityNotFound(_0x184a59,null))[_0xdafd('0x27')](respondWithResult(_0x184a59,null))[_0xdafd('0x44')](handleError(_0x184a59,null));};exports['create']=function(_0x48cc85,_0x189d61){return db[_0xdafd('0x40')][_0xdafd('0x4b')](_0x48cc85[_0xdafd('0x4c')],{})[_0xdafd('0x27')](respondWithResult(_0x189d61,0xc9))[_0xdafd('0x44')](handleError(_0x189d61,null));};exports[_0xdafd('0x4d')]=function(_0x2f5e4c,_0x2ae4cd){if(_0x2f5e4c['body']['id']){delete _0x2f5e4c[_0xdafd('0x4c')]['id'];}return db[_0xdafd('0x40')][_0xdafd('0x4a')]({'where':{'id':_0x2f5e4c[_0xdafd('0x46')]['id']}})['then'](handleEntityNotFound(_0x2ae4cd,null))[_0xdafd('0x27')](saveUpdates(_0x2f5e4c[_0xdafd('0x4c')],null))[_0xdafd('0x27')](respondWithResult(_0x2ae4cd,null))[_0xdafd('0x44')](handleError(_0x2ae4cd,null));};exports[_0xdafd('0x28')]=function(_0x4b6fbb,_0x5af1a8){return db[_0xdafd('0x40')][_0xdafd('0x4a')]({'where':{'id':_0x4b6fbb['params']['id']}})['then'](handleEntityNotFound(_0x5af1a8,null))[_0xdafd('0x27')](removeEntity(_0x5af1a8,null))[_0xdafd('0x44')](handleError(_0x5af1a8,null));};exports['describe']=function(_0x2dde06,_0x5dc9a0){return db[_0xdafd('0x40')]['describe']()['then'](respondWithResult(_0x5dc9a0,null))[_0xdafd('0x44')](handleError(_0x5dc9a0,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index a723a5f..110ce7f 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 _0x4681=['define','report_jscripty_answers','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4681,0xde));var _0x1468=function(_0x4a1a41,_0x323aa4){_0x4a1a41=_0x4a1a41-0x0;var _0x2db1d3=_0x4681[_0x4a1a41];return _0x2db1d3;};'use strict';var _=require(_0x1468('0x0'));var util=require(_0x1468('0x1'));var logger=require(_0x1468('0x2'))(_0x1468('0x3'));var moment=require(_0x1468('0x4'));var BPromise=require('bluebird');var rp=require(_0x1468('0x5'));var fs=require('fs');var path=require(_0x1468('0x6'));var rimraf=require(_0x1468('0x7'));var config=require('../../config/environment');var attributes=require('./jscriptyAnswerReport.attributes');module['exports']=function(_0x35163c,_0x53cad6){return _0x35163c[_0x1468('0x8')]('JscriptyAnswerReport',attributes,{'tableName':_0x1468('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd905=['request-promise','rimraf','../../config/environment','exports','report_jscripty_answers','lodash','util','../../config/logger'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0xd905,0x165));var _0x5d90=function(_0x1334d5,_0x3f368c){_0x1334d5=_0x1334d5-0x0;var _0x14146b=_0xd905[_0x1334d5];return _0x14146b;};'use strict';var _=require(_0x5d90('0x0'));var util=require(_0x5d90('0x1'));var logger=require(_0x5d90('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5d90('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5d90('0x4'));var config=require(_0x5d90('0x5'));var attributes=require('./jscriptyAnswerReport.attributes');module[_0x5d90('0x6')]=function(_0x491a9d,_0x102e22){return _0x491a9d['define']('JscriptyAnswerReport',attributes,{'tableName':_0x5d90('0x7'),'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 1123280..b47717f 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 _0x476a=['debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent'];(function(_0x246f0c,_0x39f734){var _0x30fe50=function(_0x9a975c){while(--_0x9a975c){_0x246f0c['push'](_0x246f0c['shift']());}};_0x30fe50(++_0x39f734);}(_0x476a,0x160));var _0xa476=function(_0x3ccfe5,_0x4e9bba){_0x3ccfe5=_0x3ccfe5-0x0;var _0x3d0bad=_0x476a[_0x3ccfe5];return _0x3d0bad;};'use strict';var _=require(_0xa476('0x0'));var util=require(_0xa476('0x1'));var moment=require(_0xa476('0x2'));var BPromise=require(_0xa476('0x3'));var rs=require(_0xa476('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa476('0x5'))['db'];var utils=require(_0xa476('0x6'));var logger=require(_0xa476('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa476('0x8'));var client=jayson[_0xa476('0x9')][_0xa476('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15eb24,_0x276a45,_0x4d7f6d){return new BPromise(function(_0x14f306,_0x359c30){return client[_0xa476('0xb')](_0x15eb24,_0x4d7f6d)[_0xa476('0xc')](function(_0x2f0287){logger[_0xa476('0xd')](_0xa476('0xe'),_0x276a45,_0xa476('0xf'));logger[_0xa476('0x10')](_0xa476('0x11'),_0x276a45,_0xa476('0xf'),JSON[_0xa476('0x12')](_0x2f0287));if(_0x2f0287[_0xa476('0x13')]){if(_0x2f0287[_0xa476('0x13')]['code']===0x1f4){logger[_0xa476('0x13')](_0xa476('0xe'),_0x276a45,_0x2f0287[_0xa476('0x13')][_0xa476('0x14')]);return _0x359c30(_0x2f0287['error'][_0xa476('0x14')]);}logger[_0xa476('0x13')](_0xa476('0xe'),_0x276a45,_0x2f0287[_0xa476('0x13')][_0xa476('0x14')]);return _0x14f306(_0x2f0287[_0xa476('0x13')][_0xa476('0x14')]);}else{logger[_0xa476('0xd')](_0xa476('0xe'),_0x276a45,'request\x20sent');_0x14f306(_0x2f0287[_0xa476('0x15')][_0xa476('0x14')]);}})[_0xa476('0x16')](function(_0x59a500){logger[_0xa476('0x13')](_0xa476('0xe'),_0x276a45,_0x59a500);_0x359c30(_0x59a500);});});} \ No newline at end of file +var _0xe6c1=['stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','then','info','JscriptyAnswerReport,\x20%s,\x20%s','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x1e9300,_0x1cd496){var _0x39573d=function(_0x327de2){while(--_0x327de2){_0x1e9300['push'](_0x1e9300['shift']());}};_0x39573d(++_0x1cd496);}(_0xe6c1,0x12b));var _0x1e6c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe6c1[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x1e6c('0x0'));var util=require(_0x1e6c('0x1'));var moment=require(_0x1e6c('0x2'));var BPromise=require(_0x1e6c('0x3'));var rs=require(_0x1e6c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1e6c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1e6c('0x6'))('rpc');var config=require(_0x1e6c('0x7'));var jayson=require(_0x1e6c('0x8'));var client=jayson[_0x1e6c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2ab045,_0x577efb,_0x1a87c4){return new BPromise(function(_0xa66d21,_0x441d5b){return client['request'](_0x2ab045,_0x1a87c4)[_0x1e6c('0xa')](function(_0x2204bf){logger[_0x1e6c('0xb')](_0x1e6c('0xc'),_0x577efb,'request\x20sent');logger[_0x1e6c('0xd')](_0x1e6c('0xe'),_0x577efb,_0x1e6c('0xf'),JSON[_0x1e6c('0x10')](_0x2204bf));if(_0x2204bf['error']){if(_0x2204bf[_0x1e6c('0x11')]['code']===0x1f4){logger[_0x1e6c('0x11')](_0x1e6c('0xc'),_0x577efb,_0x2204bf[_0x1e6c('0x11')][_0x1e6c('0x12')]);return _0x441d5b(_0x2204bf[_0x1e6c('0x11')]['message']);}logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0x577efb,_0x2204bf[_0x1e6c('0x11')]['message']);return _0xa66d21(_0x2204bf[_0x1e6c('0x11')]['message']);}else{logger['info'](_0x1e6c('0xc'),_0x577efb,_0x1e6c('0xf'));_0xa66d21(_0x2204bf[_0x1e6c('0x13')][_0x1e6c('0x12')]);}})[_0x1e6c('0x14')](function(_0x131958){logger[_0x1e6c('0x11')](_0x1e6c('0xc'),_0x577efb,_0x131958);_0x441d5b(_0x131958);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 885a9c4..bc63714 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 _0x6ec7=['delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','getSessions','getAnswers','30s','getSummary','post','create','/:id/clone','clone','put','update'];(function(_0x5576b1,_0x419bad){var _0xe2eda5=function(_0x15f40b){while(--_0x15f40b){_0x5576b1['push'](_0x5576b1['shift']());}};_0xe2eda5(++_0x419bad);}(_0x6ec7,0xda));var _0x76ec=function(_0x54279b,_0x5e56b0){_0x54279b=_0x54279b-0x0;var _0x29a697=_0x6ec7[_0x54279b];return _0x29a697;};'use strict';var multer=require(_0x76ec('0x0'));var util=require(_0x76ec('0x1'));var path=require('path');var timeout=require(_0x76ec('0x2'));var express=require(_0x76ec('0x3'));var router=express[_0x76ec('0x4')]();var fs_extra=require(_0x76ec('0x5'));var auth=require(_0x76ec('0x6'));var interaction=require(_0x76ec('0x7'));var config=require('../../config/environment');var controller=require('./jscriptyProject.controller');router[_0x76ec('0x8')]('/',auth[_0x76ec('0x9')](),controller[_0x76ec('0xa')]);router['get'](_0x76ec('0xb'),auth[_0x76ec('0x9')](),controller['show']);router['get']('/:id/sessions',auth[_0x76ec('0x9')](),controller[_0x76ec('0xc')]);router[_0x76ec('0x8')]('/:id/answers',auth[_0x76ec('0x9')](),controller[_0x76ec('0xd')]);router['get']('/:id/summary',auth['isAuthenticated'](),timeout(_0x76ec('0xe')),controller[_0x76ec('0xf')]);router[_0x76ec('0x10')]('/',auth[_0x76ec('0x9')](),controller[_0x76ec('0x11')]);router[_0x76ec('0x10')](_0x76ec('0x12'),auth[_0x76ec('0x9')](),controller[_0x76ec('0x13')]);router[_0x76ec('0x14')](_0x76ec('0xb'),auth['isAuthenticated'](),controller[_0x76ec('0x15')]);router[_0x76ec('0x16')](_0x76ec('0xb'),auth[_0x76ec('0x9')](),controller[_0x76ec('0x17')]);module['exports']=router; \ No newline at end of file +var _0x65cd=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/sessions','getSessions','/:id/answers','30s','getSummary','create','clone','put','destroy','exports','multer','util','connect-timeout'];(function(_0x12807b,_0x7c0dfb){var _0x5a676e=function(_0x2cb9d9){while(--_0x2cb9d9){_0x12807b['push'](_0x12807b['shift']());}};_0x5a676e(++_0x7c0dfb);}(_0x65cd,0x195));var _0xd65c=function(_0x420746,_0x26dd66){_0x420746=_0x420746-0x0;var _0x1c6de2=_0x65cd[_0x420746];return _0x1c6de2;};'use strict';var multer=require(_0xd65c('0x0'));var util=require(_0xd65c('0x1'));var path=require('path');var timeout=require(_0xd65c('0x2'));var express=require(_0xd65c('0x3'));var router=express[_0xd65c('0x4')]();var fs_extra=require(_0xd65c('0x5'));var auth=require(_0xd65c('0x6'));var interaction=require(_0xd65c('0x7'));var config=require(_0xd65c('0x8'));var controller=require('./jscriptyProject.controller');router[_0xd65c('0x9')]('/',auth[_0xd65c('0xa')](),controller[_0xd65c('0xb')]);router[_0xd65c('0x9')](_0xd65c('0xc'),auth[_0xd65c('0xa')](),controller[_0xd65c('0xd')]);router[_0xd65c('0x9')](_0xd65c('0xe'),auth[_0xd65c('0xa')](),controller[_0xd65c('0xf')]);router['get'](_0xd65c('0x10'),auth[_0xd65c('0xa')](),controller['getAnswers']);router['get']('/:id/summary',auth[_0xd65c('0xa')](),timeout(_0xd65c('0x11')),controller[_0xd65c('0x12')]);router['post']('/',auth[_0xd65c('0xa')](),controller[_0xd65c('0x13')]);router['post']('/:id/clone',auth[_0xd65c('0xa')](),controller[_0xd65c('0x14')]);router[_0xd65c('0x15')](_0xd65c('0xc'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xd65c('0x16')]);module[_0xd65c('0x17')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index af9380b..70241ad 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 _0x265f=['setDataValue','formData','stringify','isString','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','lodash','util','STRING','name','TEXT','long','isObjectLike'];(function(_0x103aee,_0x2fb02b){var _0x31bf04=function(_0x3f889b){while(--_0x3f889b){_0x103aee['push'](_0x103aee['shift']());}};_0x31bf04(++_0x2fb02b);}(_0x265f,0x1ca));var _0xf265=function(_0x200827,_0x4af951){_0x200827=_0x200827-0x0;var _0x120047=_0x265f[_0x200827];return _0x120047;};'use strict';var Sequelize=require('sequelize');var _=require(_0xf265('0x0'));var util=require(_0xf265('0x1'));module['exports']={'name':{'type':Sequelize[_0xf265('0x2')],'unique':_0xf265('0x3')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xf265('0x4')](_0xf265('0x5')),'set':function(_0x26eb87){if(_[_0xf265('0x6')](_0x26eb87)){this[_0xf265('0x7')](_0xf265('0x8'),JSON[_0xf265('0x9')](_0x26eb87));}else if(_[_0xf265('0xa')](_0x26eb87)){this[_0xf265('0x7')]('formData',_0x26eb87);}else{this[_0xf265('0x7')](_0xf265('0x8'),util['format'](_0xf265('0xb'),this[_0xf265('0xc')]('name')||'',this[_0xf265('0xc')](_0xf265('0xd'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xf265('0xe')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xf265('0xe')],'defaultValue':![]}}; \ No newline at end of file +var _0xafa1=['util','STRING','name','TEXT','long','isObjectLike','formData','stringify','setDataValue','format','getDataValue','description','BOOLEAN'];(function(_0x2f9709,_0xac7df4){var _0x1f3b29=function(_0x245321){while(--_0x245321){_0x2f9709['push'](_0x2f9709['shift']());}};_0x1f3b29(++_0xac7df4);}(_0xafa1,0x1ba));var _0x1afa=function(_0x1bd498,_0x14b925){_0x1bd498=_0x1bd498-0x0;var _0xb4473e=_0xafa1[_0x1bd498];return _0xb4473e;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');var util=require(_0x1afa('0x0'));module['exports']={'name':{'type':Sequelize[_0x1afa('0x1')],'unique':_0x1afa('0x2')},'description':{'type':Sequelize[_0x1afa('0x1')]},'formData':{'type':Sequelize[_0x1afa('0x3')](_0x1afa('0x4')),'set':function(_0xf21b24){if(_[_0x1afa('0x5')](_0xf21b24)){this['setDataValue'](_0x1afa('0x6'),JSON[_0x1afa('0x7')](_0xf21b24));}else if(_['isString'](_0xf21b24)){this[_0x1afa('0x8')](_0x1afa('0x6'),_0xf21b24);}else{this[_0x1afa('0x8')](_0x1afa('0x6'),util[_0x1afa('0x9')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0x1afa('0xa')](_0x1afa('0x2'))||'',this[_0x1afa('0xa')](_0x1afa('0xb'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x1afa('0xc')],'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 c01e01b..7d74dde 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 _0x23a3=['fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','userProfileId','getSessions','findOne','JscriptySessionReport','pick','getAnswers','JscriptyAnswerReport','ProjectId','number','fromCharCode','toString','indexOf','getSummary','starttime','parse','startTime','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','push','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','undefined','limit','count','offset','Content-Range','apply','save','update','destroy','then','get','Projects','UserProfileResource','end','sendStatus','error','stack','name','send','JscriptyProject','fieldName','type','key','model','keys','filters','intersection','query','attributes'];(function(_0xfc8008,_0x341fb5){var _0x4dd256=function(_0x12bafe){while(--_0x12bafe){_0xfc8008['push'](_0xfc8008['shift']());}};_0x4dd256(++_0x341fb5);}(_0x23a3,0x131));var _0x323a=function(_0x36c0c3,_0x22455a){_0x36c0c3=_0x36c0c3-0x0;var _0x5a16f9=_0x23a3[_0x36c0c3];return _0x5a16f9;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x323a('0x0'));var rp=require('request-promise');var moment=require(_0x323a('0x1'));var BPromise=require(_0x323a('0x2'));var Mustache=require(_0x323a('0x3'));var util=require(_0x323a('0x4'));var path=require(_0x323a('0x5'));var sox=require(_0x323a('0x6'));var csv=require(_0x323a('0x7'));var ejs=require(_0x323a('0x8'));var fs=require('fs');var fs_extra=require(_0x323a('0x9'));var _=require('lodash');var squel=require(_0x323a('0xa'));var crypto=require(_0x323a('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x323a('0xc'));var toCsv=require(_0x323a('0x7'));var querystring=require(_0x323a('0xd'));var Papa=require('papaparse');var Redis=require(_0x323a('0xe'));var authService=require(_0x323a('0xf'));var qs=require(_0x323a('0x10'));var as=require(_0x323a('0x11'));var hardwareService=require(_0x323a('0x12'));var logger=require(_0x323a('0x13'))(_0x323a('0x14'));var utils=require(_0x323a('0x15'));var config=require(_0x323a('0x16'));var licenseUtil=require(_0x323a('0x17'));var db=require(_0x323a('0x18'))['db'];function respondWithStatusCode(_0x33d226,_0x460fd8){_0x460fd8=_0x460fd8||0xcc;return function(_0x1ae315){if(_0x1ae315){return _0x33d226['sendStatus'](_0x460fd8);}return _0x33d226[_0x323a('0x19')](_0x460fd8)['end']();};}function respondWithResult(_0x16b92e,_0x4ccd19){_0x4ccd19=_0x4ccd19||0xc8;return function(_0x5f3922){if(_0x5f3922){return _0x16b92e[_0x323a('0x19')](_0x4ccd19)['json'](_0x5f3922);}};}function respondWithFilteredResult(_0x46c247,_0x582631){return function(_0x1cc64d){if(_0x1cc64d){var _0x64003=typeof _0x582631['offset']===_0x323a('0x1a')&&typeof _0x582631[_0x323a('0x1b')]==='undefined';var _0x5c1947=_0x1cc64d[_0x323a('0x1c')];var _0x221ae4=_0x64003?0x0:_0x582631[_0x323a('0x1d')];var _0x29dd21=_0x64003?_0x1cc64d[_0x323a('0x1c')]:_0x582631[_0x323a('0x1d')]+_0x582631['limit'];var _0x5bf1c9;if(_0x29dd21>=_0x5c1947){_0x29dd21=_0x5c1947;_0x5bf1c9=0xc8;}else{_0x5bf1c9=0xce;}_0x46c247['status'](_0x5bf1c9);return _0x46c247['set'](_0x323a('0x1e'),_0x221ae4+'-'+_0x29dd21+'/'+_0x5c1947)['json'](_0x1cc64d);}return null;};}function patchUpdates(_0xc0f3e4){return function(_0x38bc95){try{jsonpatch[_0x323a('0x1f')](_0x38bc95,_0xc0f3e4,!![]);}catch(_0xd35d83){return BPromise['reject'](_0xd35d83);}return _0x38bc95[_0x323a('0x20')]();};}function saveUpdates(_0x549e64,_0x12c8d7){return function(_0x323517){if(_0x323517){return _0x323517[_0x323a('0x21')](_0x549e64)['then'](function(_0x41ea3d){return _0x41ea3d;});}return null;};}function removeEntity(_0x358bcb,_0x36d4d9){return function(_0x2960e0){if(_0x2960e0){return _0x2960e0[_0x323a('0x22')]()[_0x323a('0x23')](function(){var _0x5ba015=_0x2960e0[_0x323a('0x24')]({'plain':!![]});var _0x5d82c2=_0x323a('0x25');return db[_0x323a('0x26')][_0x323a('0x22')]({'where':{'type':_0x5d82c2,'resourceId':_0x5ba015['id']}})[_0x323a('0x23')](function(){return _0x2960e0;});})[_0x323a('0x23')](function(){_0x358bcb['status'](0xcc)[_0x323a('0x27')]();});}};}function handleEntityNotFound(_0x384c93,_0x30dbe6){return function(_0x17907c){if(!_0x17907c){_0x384c93[_0x323a('0x28')](0x194);}return _0x17907c;};}function handleError(_0x4ba792,_0x23a989){_0x23a989=_0x23a989||0x1f4;return function(_0x571264){logger[_0x323a('0x29')](_0x571264[_0x323a('0x2a')]);if(_0x571264[_0x323a('0x2b')]){delete _0x571264[_0x323a('0x2b')];}_0x4ba792[_0x323a('0x19')](_0x23a989)[_0x323a('0x2c')](_0x571264);};}exports['index']=function(_0x2a1a85,_0x3f6809){var _0x580c2b={},_0x32c05b={},_0x4abf8d={'count':0x0,'rows':[]};var _0x4a70dd=_['map'](db[_0x323a('0x2d')]['rawAttributes'],function(_0x2a8da8){return{'name':_0x2a8da8[_0x323a('0x2e')],'type':_0x2a8da8[_0x323a('0x2f')][_0x323a('0x30')]};});_0x32c05b[_0x323a('0x31')]=_['map'](_0x4a70dd,_0x323a('0x2b'));_0x32c05b['query']=_[_0x323a('0x32')](_0x2a1a85['query']);_0x32c05b[_0x323a('0x33')]=_[_0x323a('0x34')](_0x32c05b['model'],_0x32c05b[_0x323a('0x35')]);_0x580c2b[_0x323a('0x36')]=_[_0x323a('0x34')](_0x32c05b[_0x323a('0x31')],qs[_0x323a('0x37')](_0x2a1a85[_0x323a('0x35')][_0x323a('0x37')]));_0x580c2b[_0x323a('0x36')]=_0x580c2b['attributes'][_0x323a('0x38')]?_0x580c2b[_0x323a('0x36')]:_0x32c05b[_0x323a('0x31')];if(!_0x2a1a85[_0x323a('0x35')][_0x323a('0x39')](_0x323a('0x3a'))){_0x580c2b[_0x323a('0x1b')]=qs['limit'](_0x2a1a85['query'][_0x323a('0x1b')]);_0x580c2b[_0x323a('0x1d')]=qs[_0x323a('0x1d')](_0x2a1a85['query'][_0x323a('0x1d')]);}_0x580c2b[_0x323a('0x3b')]=qs[_0x323a('0x3c')](_0x2a1a85[_0x323a('0x35')]['sort']);_0x580c2b[_0x323a('0x3d')]=qs[_0x323a('0x33')](_['pick'](_0x2a1a85['query'],_0x32c05b[_0x323a('0x33')]),_0x4a70dd);if(_0x2a1a85['query'][_0x323a('0x3e')]){_0x580c2b[_0x323a('0x3d')]=_[_0x323a('0x3f')](_0x580c2b['where'],{'$or':_[_0x323a('0x40')](_0x4a70dd,function(_0x52f80f){if(_0x52f80f[_0x323a('0x2f')]!==_0x323a('0x41')){var _0x2d6c6f={};_0x2d6c6f[_0x52f80f[_0x323a('0x2b')]]={'$like':'%'+_0x2a1a85[_0x323a('0x35')][_0x323a('0x3e')]+'%'};return _0x2d6c6f;}})});}_0x580c2b=_['merge']({},_0x580c2b,_0x2a1a85[_0x323a('0x42')]);var _0xcff0c6={'where':_0x580c2b[_0x323a('0x3d')]};return db[_0x323a('0x2d')][_0x323a('0x1c')](_0xcff0c6)['then'](function(_0x1482d2){_0x4abf8d[_0x323a('0x1c')]=_0x1482d2;if(_0x2a1a85['query'][_0x323a('0x43')]){_0x580c2b[_0x323a('0x44')]=[{'all':!![]}];}return db[_0x323a('0x2d')][_0x323a('0x45')](_0x580c2b);})[_0x323a('0x23')](function(_0x599b28){_0x4abf8d[_0x323a('0x46')]=_0x599b28;return _0x4abf8d;})['then'](respondWithFilteredResult(_0x3f6809,_0x580c2b))['catch'](handleError(_0x3f6809,null));};exports[_0x323a('0x47')]=function(_0x3543a7,_0x3d98ce){var _0x357a22={'raw':![],'where':{'id':_0x3543a7[_0x323a('0x48')]['id']}},_0x5284dd={};_0x5284dd[_0x323a('0x31')]=_[_0x323a('0x32')](db[_0x323a('0x2d')][_0x323a('0x49')]);_0x5284dd['query']=_[_0x323a('0x32')](_0x3543a7[_0x323a('0x35')]);_0x5284dd['filters']=_['intersection'](_0x5284dd[_0x323a('0x31')],_0x5284dd[_0x323a('0x35')]);_0x357a22[_0x323a('0x36')]=_['intersection'](_0x5284dd[_0x323a('0x31')],qs[_0x323a('0x37')](_0x3543a7[_0x323a('0x35')]['fields']));_0x357a22[_0x323a('0x36')]=_0x357a22[_0x323a('0x36')][_0x323a('0x38')]?_0x357a22[_0x323a('0x36')]:_0x5284dd[_0x323a('0x31')];if(_0x3543a7[_0x323a('0x35')][_0x323a('0x43')]){_0x357a22[_0x323a('0x44')]=[{'all':!![]}];}_0x357a22=_[_0x323a('0x3f')]({},_0x357a22,_0x3543a7[_0x323a('0x42')]);return db[_0x323a('0x2d')][_0x323a('0x4a')](_0x357a22)['then'](handleEntityNotFound(_0x3d98ce,null))[_0x323a('0x23')](respondWithResult(_0x3d98ce,null))[_0x323a('0x4b')](handleError(_0x3d98ce,null));};exports[_0x323a('0x4c')]=function(_0x4dc7da,_0x481f08){return db[_0x323a('0x2d')][_0x323a('0x4c')](_0x4dc7da[_0x323a('0x4d')],{})[_0x323a('0x23')](function(_0x5686f0){var _0x2616bd=_0x4dc7da['user'][_0x323a('0x24')]({'plain':!![]});if(!_0x2616bd)throw new Error(_0x323a('0x4e'));if(_0x2616bd[_0x323a('0x4f')]===_0x323a('0x50')){var _0x2cb64b=_0x5686f0['get']({'plain':!![]});var _0x2f1a14=_0x323a('0x25');return db[_0x323a('0x51')][_0x323a('0x4a')]({'where':{'name':_0x2f1a14,'userProfileId':_0x2616bd['userProfileId']},'raw':!![]})[_0x323a('0x23')](function(_0x5c590e){if(_0x5c590e&&_0x5c590e[_0x323a('0x52')]===0x0){return db[_0x323a('0x26')][_0x323a('0x4c')]({'name':_0x2cb64b[_0x323a('0x2b')],'resourceId':_0x2cb64b['id'],'type':_0x5c590e[_0x323a('0x2b')],'sectionId':_0x5c590e['id']},{})[_0x323a('0x23')](function(){return _0x5686f0;});}else{return _0x5686f0;}})[_0x323a('0x4b')](function(_0x101357){logger[_0x323a('0x29')](_0x323a('0x53'),_0x101357);throw _0x101357;});}return _0x5686f0;})['then'](respondWithResult(_0x481f08,0xc9))['catch'](handleError(_0x481f08,null));};exports[_0x323a('0x54')]=function(_0x14502c,_0x2d86dc){var _0x45ced7={'where':{'id':_0x14502c[_0x323a('0x48')]['id']}},_0x2875ce={};_0x2875ce['model']=_[_0x323a('0x32')](db[_0x323a('0x2d')][_0x323a('0x49')]);_0x45ced7['attributes']=_[_0x323a('0x34')](_0x2875ce[_0x323a('0x31')],qs['fields'](_0x14502c[_0x323a('0x35')]['fields']));_0x45ced7[_0x323a('0x36')]=_0x45ced7[_0x323a('0x36')][_0x323a('0x38')]?_0x45ced7[_0x323a('0x36')]:_0x2875ce['model'];if(_0x14502c[_0x323a('0x35')]['includeAll']){_0x45ced7[_0x323a('0x44')]=[{'all':!![]}];}_0x45ced7=_['merge']({},_0x45ced7,_0x14502c[_0x323a('0x42')]);return db[_0x323a('0x2d')]['find'](_0x45ced7)[_0x323a('0x23')](handleEntityNotFound(_0x2d86dc,null))['then'](function(_0x1aa6dd){if(_0x1aa6dd){var _0x387b40=_0x1aa6dd['get']({'plain':!![]});_0x387b40=qs[_0x323a('0x55')](_0x387b40,['id',_0x323a('0x56'),_0x323a('0x57')]);_0x14502c['body']=_[_0x323a('0x55')](_0x14502c[_0x323a('0x4d')],['id',_0x323a('0x56'),_0x323a('0x57')]);return db[_0x323a('0x2d')][_0x323a('0x4c')](_[_0x323a('0x3f')](_0x387b40,_0x14502c[_0x323a('0x4d')]),{'include':_0x14502c[_0x323a('0x35')][_0x323a('0x43')]?[{'all':!![]}]:undefined})[_0x323a('0x23')](function(_0x1e540e){var _0x181072=_0x14502c[_0x323a('0x50')][_0x323a('0x24')]({'plain':!![]});if(!_0x181072)throw new Error(_0x323a('0x4e'));if(_0x181072['role']===_0x323a('0x50')){var _0x188777=_0x1e540e[_0x323a('0x24')]({'plain':!![]});var _0x40df26='Projects';return db['UserProfileSection']['find']({'where':{'name':_0x40df26,'userProfileId':_0x181072[_0x323a('0x58')]},'raw':!![]})[_0x323a('0x23')](function(_0x17a608){if(_0x17a608&&_0x17a608[_0x323a('0x52')]===0x0){return db[_0x323a('0x26')][_0x323a('0x4c')]({'name':_0x188777[_0x323a('0x2b')],'resourceId':_0x188777['id'],'type':_0x17a608[_0x323a('0x2b')],'sectionId':_0x17a608['id']},{})[_0x323a('0x23')](function(){return _0x1e540e;});}else{return _0x1e540e;}})[_0x323a('0x4b')](function(_0x1291aa){logger[_0x323a('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1291aa);throw _0x1291aa;});}return _0x1e540e;});}})[_0x323a('0x23')](respondWithResult(_0x2d86dc,0xc9))[_0x323a('0x4b')](handleError(_0x2d86dc,null));};exports[_0x323a('0x21')]=function(_0x5e4fb3,_0x3744f9){if(_0x5e4fb3[_0x323a('0x4d')]['id']){delete _0x5e4fb3[_0x323a('0x4d')]['id'];}return db['JscriptyProject']['find']({'where':{'id':_0x5e4fb3['params']['id']}})[_0x323a('0x23')](handleEntityNotFound(_0x3744f9,null))[_0x323a('0x23')](saveUpdates(_0x5e4fb3[_0x323a('0x4d')],null))[_0x323a('0x23')](respondWithResult(_0x3744f9,null))[_0x323a('0x4b')](handleError(_0x3744f9,null));};exports[_0x323a('0x22')]=function(_0x205d9f,_0x484f2a){return db['JscriptyProject']['find']({'where':{'id':_0x205d9f['params']['id']}})['then'](handleEntityNotFound(_0x484f2a,null))[_0x323a('0x23')](removeEntity(_0x484f2a,null))[_0x323a('0x4b')](handleError(_0x484f2a,null));};exports[_0x323a('0x59')]=function(_0x605792,_0x1ee247,_0xed1022){var _0x11e7c8={'raw':!![],'where':{}};var _0x540b8c={};var _0x39e692={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x323a('0x5a')]({'where':{'id':_0x605792['params']['id']}})['then'](handleEntityNotFound(_0x1ee247,null))['then'](function(_0x4916e0){if(_0x4916e0){_0x540b8c[_0x323a('0x31')]=_['keys'](db[_0x323a('0x5b')]['rawAttributes']);_0x540b8c[_0x323a('0x35')]=_[_0x323a('0x32')](_0x605792[_0x323a('0x35')]);_0x540b8c['filters']=_['intersection'](_0x540b8c[_0x323a('0x31')],_0x540b8c[_0x323a('0x35')]);_0x11e7c8[_0x323a('0x36')]=_[_0x323a('0x34')](_0x540b8c['model'],qs[_0x323a('0x37')](_0x605792[_0x323a('0x35')][_0x323a('0x37')]));_0x11e7c8[_0x323a('0x36')]=_0x11e7c8[_0x323a('0x36')]['length']?_0x11e7c8[_0x323a('0x36')]:_0x540b8c[_0x323a('0x31')];if(!_0x605792[_0x323a('0x35')][_0x323a('0x39')](_0x323a('0x3a'))){_0x11e7c8[_0x323a('0x1b')]=qs[_0x323a('0x1b')](_0x605792['query']['limit']);_0x11e7c8[_0x323a('0x1d')]=qs['offset'](_0x605792[_0x323a('0x35')]['offset']);}_0x11e7c8[_0x323a('0x3b')]=qs[_0x323a('0x3c')](_0x605792['query'][_0x323a('0x3c')]);_0x11e7c8[_0x323a('0x3d')]=qs[_0x323a('0x33')](_[_0x323a('0x5c')](_0x605792['query'],_0x540b8c[_0x323a('0x33')]));_0x11e7c8[_0x323a('0x3d')]['ProjectId']=_0x4916e0['id'];if(_0x605792['query'][_0x323a('0x3e')]){_0x11e7c8['where']=_['merge'](_0x11e7c8[_0x323a('0x3d')],{'$or':_[_0x323a('0x40')](_0x11e7c8[_0x323a('0x36')],function(_0x1ec023){var _0x26e50d={};_0x26e50d[_0x1ec023]={'$like':'%'+_0x605792[_0x323a('0x35')][_0x323a('0x3e')]+'%'};return _0x26e50d;})});}_0x11e7c8=_[_0x323a('0x3f')]({},_0x11e7c8,_0x605792['options']);return db[_0x323a('0x5b')]['count']({'where':_0x11e7c8[_0x323a('0x3d')]})['then'](function(_0x540997){_0x39e692[_0x323a('0x1c')]=_0x540997;if(_0x605792[_0x323a('0x35')][_0x323a('0x43')]){_0x11e7c8[_0x323a('0x44')]=[{'all':!![]}];}return db[_0x323a('0x5b')][_0x323a('0x45')](_0x11e7c8);})[_0x323a('0x23')](function(_0xac7a0a){_0x39e692['rows']=_0xac7a0a;return _0x39e692;});}})[_0x323a('0x23')](respondWithFilteredResult(_0x1ee247,_0x11e7c8))[_0x323a('0x4b')](handleError(_0x1ee247,null));};exports[_0x323a('0x5d')]=function(_0x36db83,_0x1caf86,_0x3ab588){var _0x10dced={'raw':!![],'where':{}};var _0x390bed={};var _0x4ba690={'count':0x0,'rows':[]};return db[_0x323a('0x2d')][_0x323a('0x5a')]({'where':{'id':_0x36db83[_0x323a('0x48')]['id']}})[_0x323a('0x23')](handleEntityNotFound(_0x1caf86,null))[_0x323a('0x23')](function(_0x2c61b8){if(_0x2c61b8){_0x390bed[_0x323a('0x31')]=_['keys'](db[_0x323a('0x5e')]['rawAttributes']);_0x390bed[_0x323a('0x35')]=_[_0x323a('0x32')](_0x36db83[_0x323a('0x35')]);_0x390bed[_0x323a('0x33')]=_[_0x323a('0x34')](_0x390bed[_0x323a('0x31')],_0x390bed[_0x323a('0x35')]);_0x10dced['attributes']=_[_0x323a('0x34')](_0x390bed[_0x323a('0x31')],qs[_0x323a('0x37')](_0x36db83['query'][_0x323a('0x37')]));_0x10dced[_0x323a('0x36')]=_0x10dced[_0x323a('0x36')][_0x323a('0x38')]?_0x10dced['attributes']:_0x390bed['model'];if(!_0x36db83[_0x323a('0x35')][_0x323a('0x39')](_0x323a('0x3a'))){_0x10dced[_0x323a('0x1b')]=qs[_0x323a('0x1b')](_0x36db83[_0x323a('0x35')][_0x323a('0x1b')]);_0x10dced['offset']=qs[_0x323a('0x1d')](_0x36db83[_0x323a('0x35')][_0x323a('0x1d')]);}_0x10dced['order']=qs[_0x323a('0x3c')](_0x36db83[_0x323a('0x35')][_0x323a('0x3c')]);_0x10dced[_0x323a('0x3d')]=qs[_0x323a('0x33')](_[_0x323a('0x5c')](_0x36db83[_0x323a('0x35')],_0x390bed[_0x323a('0x33')]));_0x10dced[_0x323a('0x3d')][_0x323a('0x5f')]=_0x2c61b8['id'];if(_0x36db83[_0x323a('0x35')][_0x323a('0x3e')]){_0x10dced[_0x323a('0x3d')]=_['merge'](_0x10dced['where'],{'$or':_[_0x323a('0x40')](_0x10dced['attributes'],function(_0x3116ff){var _0x523b3a={};_0x523b3a[_0x3116ff]={'$like':'%'+_0x36db83[_0x323a('0x35')]['filter']+'%'};return _0x523b3a;})});}_0x10dced=_[_0x323a('0x3f')]({},_0x10dced,_0x36db83['options']);return db[_0x323a('0x5e')][_0x323a('0x1c')]({'where':_0x10dced[_0x323a('0x3d')]})[_0x323a('0x23')](function(_0x8e860f){_0x4ba690['count']=_0x8e860f;if(_0x36db83[_0x323a('0x35')][_0x323a('0x43')]){_0x10dced['include']=[{'all':!![]}];}return db[_0x323a('0x5e')][_0x323a('0x45')](_0x10dced);})[_0x323a('0x23')](function(_0x3a6183){_0x4ba690[_0x323a('0x46')]=_0x3a6183;return _0x4ba690;});}})[_0x323a('0x23')](respondWithFilteredResult(_0x1caf86,_0x10dced))[_0x323a('0x4b')](handleError(_0x1caf86,null));};function char(_0x5e3986){return _0x323a('0x60')===typeof _0x5e3986?String[_0x323a('0x61')][_0x323a('0x1f')](null,arguments):_0x5e3986;}function needsEncapsulation(_0x255a0a){return!!_0x255a0a&&(_0x255a0a[_0x323a('0x62')]()[_0x323a('0x63')](char(0xd))>=0x0||_0x255a0a[_0x323a('0x62')]()['indexOf'](char(0xa))>=0x0||_0x255a0a[_0x323a('0x62')]()['indexOf'](char(0x2c))>=0x0||_0x255a0a[_0x323a('0x62')]()[_0x323a('0x63')](char(0x22))>=0x0);}function encapsulate(_0x5ec090){var _0xf5ea70=char(0x22),_0x4f359b='\x5c'+char(0x22),_0x4ab9b3=_0x5ec090[_0x323a('0x62')]()['replace'](new RegExp(_0xf5ea70,'g'),_0x4f359b);return _0xf5ea70+_0x4ab9b3+_0xf5ea70;}exports[_0x323a('0x64')]=function(_0xbecdc2,_0x3b1e42,_0x2c3680){var _0x612998,_0x1d6647;var _0x2abd47={'where':{'ProjectId':_0xbecdc2[_0x323a('0x48')]['id']}};if(_0xbecdc2['query']['startTime']){_0x2abd47[_0x323a('0x3d')][_0x323a('0x65')]=JSON[_0x323a('0x66')](_0xbecdc2[_0x323a('0x35')][_0x323a('0x67')]);}return db['JscriptySessionReport'][_0x323a('0x45')](_0x2abd47)[_0x323a('0x23')](handleEntityNotFound(_0x3b1e42,null))[_0x323a('0x23')](function(_0x286f7d){if(_0x286f7d){_0x612998=_0x286f7d;return db['JscriptyQuestionReport'][_0x323a('0x45')]({'where':{'SessionId':{'$in':_[_0x323a('0x40')](_0x612998,'id')},'ProjectId':_0xbecdc2['params']['id']},'order':_0x323a('0x68')});}})['then'](handleEntityNotFound(_0x3b1e42,null))[_0x323a('0x23')](function(_0x6aa585){if(_0x6aa585){_0x1d6647=_0x6aa585;var _0x923da6={};for(var _0x2b3dcf=0x0,_0x5d1326=_0x1d6647[_0x323a('0x38')];_0x2b3dcf<_0x5d1326;_0x2b3dcf++){if(!_0x923da6[_0x323a('0x39')](_0x1d6647[_0x2b3dcf][_0x323a('0x69')])){_0x923da6[_0x1d6647[_0x2b3dcf]['questionId']]=needsEncapsulation(_0x1d6647[_0x2b3dcf]['question'])?encapsulate(_0x1d6647[_0x2b3dcf][_0x323a('0x6a')]):_0x1d6647[_0x2b3dcf][_0x323a('0x6a')];}}var _0x392b19=[],_0x543e08={};for(var _0x43457f=0x0,_0xd9e118=_0x612998[_0x323a('0x38')];_0x43457f<_0xd9e118;_0x43457f++){_0x543e08={'ProjectId':_0xbecdc2[_0x323a('0x48')]['id'],'SessionId':_0x612998[_0x43457f]['id'],'StartTime':moment(_0x612998[_0x43457f][_0x323a('0x65')])[_0x323a('0x6b')](_0x323a('0x6c'))};for(var _0x61ca84=0x0,_0x203bb1=_0x1d6647['length'];_0x61ca84<_0x203bb1;_0x61ca84++){if(_0x1d6647[_0x61ca84][_0x323a('0x6d')]==_0x612998[_0x43457f]['id']&&_0x923da6['hasOwnProperty'](_0x1d6647[_0x61ca84]['questionId'])){_0x543e08[_0x923da6[_0x1d6647[_0x61ca84]['questionId']]]=_0x1d6647[_0x61ca84]['answer'];}}for(var _0x29d978 in _0x923da6){if(!_0x543e08[_0x323a('0x39')](_0x923da6[_0x29d978])){_0x543e08[_0x923da6[_0x29d978]]=null;}}_0x392b19[_0x323a('0x6e')](_0x543e08);}return _0x392b19;}})[_0x323a('0x23')](function(_0x42332d){if(!_['isEmpty'](_0x42332d)){var _0x1d878d=toCsv(_0x42332d);var _0x3b80bd=Date[_0x323a('0x6f')]();fs[_0x323a('0x70')](util[_0x323a('0x6b')](_0x323a('0x71'),_0xbecdc2[_0x323a('0x48')]['id'],_0x3b80bd),_0x1d878d);_0x3b1e42[_0x323a('0x72')]('Content-disposition',_0x323a('0x73')+util['format'](_0x323a('0x74'),_0xbecdc2[_0x323a('0x48')]['id'],_0x3b80bd));_0x3b1e42[_0x323a('0x72')](_0x323a('0x75'),_0x323a('0x76'));return _0x3b1e42[_0x323a('0x77')](util[_0x323a('0x6b')](_0x323a('0x71'),_0xbecdc2['params']['id'],_0x3b80bd));}else{return _0x3b1e42[_0x323a('0x28')](0xcc);}})['catch'](handleError(_0x3b1e42,null));}; \ No newline at end of file +var _0x2c91=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','apply','reject','save','update','then','destroy','get','Projects','UserProfileResource','sendStatus','error','name','send','index','map','JscriptyProject','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','where','filters','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','length','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','body','updatedAt','getSessions','sort','ProjectId','JscriptySessionReport','getAnswers','findOne','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','getSummary','startTime','parse','-createdAt','questionId','question','starttime','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','now','writeFileSync','setHeader','Content-disposition','attachment;\x20filename=','Content-type','text/csv','/tmp/Jscripty_Project_%d_Summary_%s.csv','rimraf','fast-json-patch','request-promise','moment','mustache','path','fs-extra','lodash','squel','jsforce','to-csv','querystring'];(function(_0x2ca2ec,_0x56fbb5){var _0x458180=function(_0x1d0327){while(--_0x1d0327){_0x2ca2ec['push'](_0x2ca2ec['shift']());}};_0x458180(++_0x56fbb5);}(_0x2c91,0xe0));var _0x12c9=function(_0x440c05,_0x4925c6){_0x440c05=_0x440c05-0x0;var _0x89443b=_0x2c91[_0x440c05];return _0x89443b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x12c9('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x12c9('0x1'));var rp=require(_0x12c9('0x2'));var moment=require(_0x12c9('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x12c9('0x4'));var util=require('util');var path=require(_0x12c9('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x12c9('0x6'));var _=require(_0x12c9('0x7'));var squel=require(_0x12c9('0x8'));var crypto=require('crypto');var jsforce=require(_0x12c9('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x12c9('0xa'));var querystring=require(_0x12c9('0xb'));var Papa=require('papaparse');var Redis=require(_0x12c9('0xc'));var authService=require(_0x12c9('0xd'));var qs=require(_0x12c9('0xe'));var as=require(_0x12c9('0xf'));var hardwareService=require(_0x12c9('0x10'));var logger=require(_0x12c9('0x11'))(_0x12c9('0x12'));var utils=require(_0x12c9('0x13'));var config=require(_0x12c9('0x14'));var licenseUtil=require(_0x12c9('0x15'));var db=require(_0x12c9('0x16'))['db'];function respondWithStatusCode(_0x180d37,_0x503880){_0x503880=_0x503880||0xcc;return function(_0x43c54d){if(_0x43c54d){return _0x180d37['sendStatus'](_0x503880);}return _0x180d37[_0x12c9('0x17')](_0x503880)[_0x12c9('0x18')]();};}function respondWithResult(_0x2e73c9,_0x4f9825){_0x4f9825=_0x4f9825||0xc8;return function(_0x38c297){if(_0x38c297){return _0x2e73c9[_0x12c9('0x17')](_0x4f9825)[_0x12c9('0x19')](_0x38c297);}};}function respondWithFilteredResult(_0x4ef497,_0x34a18b){return function(_0x140dbd){if(_0x140dbd){var _0x1d4222=typeof _0x34a18b['offset']===_0x12c9('0x1a')&&typeof _0x34a18b[_0x12c9('0x1b')]===_0x12c9('0x1a');var _0x98a664=_0x140dbd[_0x12c9('0x1c')];var _0x3c6b6d=_0x1d4222?0x0:_0x34a18b['offset'];var _0x1fd9bf=_0x1d4222?_0x140dbd[_0x12c9('0x1c')]:_0x34a18b[_0x12c9('0x1d')]+_0x34a18b[_0x12c9('0x1b')];var _0xe948b2;if(_0x1fd9bf>=_0x98a664){_0x1fd9bf=_0x98a664;_0xe948b2=0xc8;}else{_0xe948b2=0xce;}_0x4ef497[_0x12c9('0x17')](_0xe948b2);return _0x4ef497['set']('Content-Range',_0x3c6b6d+'-'+_0x1fd9bf+'/'+_0x98a664)['json'](_0x140dbd);}return null;};}function patchUpdates(_0x260b85){return function(_0x4009a9){try{jsonpatch[_0x12c9('0x1e')](_0x4009a9,_0x260b85,!![]);}catch(_0x57566e){return BPromise[_0x12c9('0x1f')](_0x57566e);}return _0x4009a9[_0x12c9('0x20')]();};}function saveUpdates(_0x16a2f5,_0x595234){return function(_0x2e7f82){if(_0x2e7f82){return _0x2e7f82[_0x12c9('0x21')](_0x16a2f5)[_0x12c9('0x22')](function(_0x18ed27){return _0x18ed27;});}return null;};}function removeEntity(_0x4ac038,_0x238b4f){return function(_0x47cd3c){if(_0x47cd3c){return _0x47cd3c[_0x12c9('0x23')]()[_0x12c9('0x22')](function(){var _0x30998f=_0x47cd3c[_0x12c9('0x24')]({'plain':!![]});var _0x4cb069=_0x12c9('0x25');return db[_0x12c9('0x26')][_0x12c9('0x23')]({'where':{'type':_0x4cb069,'resourceId':_0x30998f['id']}})['then'](function(){return _0x47cd3c;});})[_0x12c9('0x22')](function(){_0x4ac038[_0x12c9('0x17')](0xcc)[_0x12c9('0x18')]();});}};}function handleEntityNotFound(_0x9c142e,_0x15ce86){return function(_0x2176f9){if(!_0x2176f9){_0x9c142e[_0x12c9('0x27')](0x194);}return _0x2176f9;};}function handleError(_0x246850,_0x1f4f09){_0x1f4f09=_0x1f4f09||0x1f4;return function(_0x27b97a){logger[_0x12c9('0x28')](_0x27b97a['stack']);if(_0x27b97a[_0x12c9('0x29')]){delete _0x27b97a[_0x12c9('0x29')];}_0x246850[_0x12c9('0x17')](_0x1f4f09)[_0x12c9('0x2a')](_0x27b97a);};}exports[_0x12c9('0x2b')]=function(_0x545e01,_0xd363cf){var _0x52e5a4={},_0x1906c3={},_0x184bd8={'count':0x0,'rows':[]};var _0x552ee6=_[_0x12c9('0x2c')](db[_0x12c9('0x2d')][_0x12c9('0x2e')],function(_0x59a5d3){return{'name':_0x59a5d3[_0x12c9('0x2f')],'type':_0x59a5d3[_0x12c9('0x30')][_0x12c9('0x31')]};});_0x1906c3[_0x12c9('0x32')]=_[_0x12c9('0x2c')](_0x552ee6,'name');_0x1906c3[_0x12c9('0x33')]=_[_0x12c9('0x34')](_0x545e01[_0x12c9('0x33')]);_0x1906c3['filters']=_[_0x12c9('0x35')](_0x1906c3['model'],_0x1906c3[_0x12c9('0x33')]);_0x52e5a4[_0x12c9('0x36')]=_[_0x12c9('0x35')](_0x1906c3[_0x12c9('0x32')],qs[_0x12c9('0x37')](_0x545e01['query']['fields']));_0x52e5a4[_0x12c9('0x36')]=_0x52e5a4['attributes']['length']?_0x52e5a4[_0x12c9('0x36')]:_0x1906c3[_0x12c9('0x32')];if(!_0x545e01[_0x12c9('0x33')][_0x12c9('0x38')]('nolimit')){_0x52e5a4[_0x12c9('0x1b')]=qs['limit'](_0x545e01['query'][_0x12c9('0x1b')]);_0x52e5a4[_0x12c9('0x1d')]=qs['offset'](_0x545e01[_0x12c9('0x33')][_0x12c9('0x1d')]);}_0x52e5a4[_0x12c9('0x39')]=qs['sort'](_0x545e01[_0x12c9('0x33')]['sort']);_0x52e5a4[_0x12c9('0x3a')]=qs[_0x12c9('0x3b')](_[_0x12c9('0x3c')](_0x545e01[_0x12c9('0x33')],_0x1906c3['filters']),_0x552ee6);if(_0x545e01['query']['filter']){_0x52e5a4[_0x12c9('0x3a')]=_[_0x12c9('0x3d')](_0x52e5a4['where'],{'$or':_['map'](_0x552ee6,function(_0x504953){if(_0x504953[_0x12c9('0x30')]!==_0x12c9('0x3e')){var _0x2db473={};_0x2db473[_0x504953[_0x12c9('0x29')]]={'$like':'%'+_0x545e01['query'][_0x12c9('0x3f')]+'%'};return _0x2db473;}})});}_0x52e5a4=_[_0x12c9('0x3d')]({},_0x52e5a4,_0x545e01['options']);var _0x5af74f={'where':_0x52e5a4[_0x12c9('0x3a')]};return db[_0x12c9('0x2d')][_0x12c9('0x1c')](_0x5af74f)[_0x12c9('0x22')](function(_0x10af4c){_0x184bd8[_0x12c9('0x1c')]=_0x10af4c;if(_0x545e01[_0x12c9('0x33')][_0x12c9('0x40')]){_0x52e5a4[_0x12c9('0x41')]=[{'all':!![]}];}return db[_0x12c9('0x2d')][_0x12c9('0x42')](_0x52e5a4);})['then'](function(_0x4de2ec){_0x184bd8[_0x12c9('0x43')]=_0x4de2ec;return _0x184bd8;})[_0x12c9('0x22')](respondWithFilteredResult(_0xd363cf,_0x52e5a4))[_0x12c9('0x44')](handleError(_0xd363cf,null));};exports[_0x12c9('0x45')]=function(_0x55e1d4,_0x45616c){var _0x548775={'raw':![],'where':{'id':_0x55e1d4['params']['id']}},_0x3ca682={};_0x3ca682[_0x12c9('0x32')]=_[_0x12c9('0x34')](db[_0x12c9('0x2d')][_0x12c9('0x2e')]);_0x3ca682[_0x12c9('0x33')]=_['keys'](_0x55e1d4[_0x12c9('0x33')]);_0x3ca682[_0x12c9('0x3b')]=_[_0x12c9('0x35')](_0x3ca682['model'],_0x3ca682['query']);_0x548775['attributes']=_['intersection'](_0x3ca682[_0x12c9('0x32')],qs[_0x12c9('0x37')](_0x55e1d4[_0x12c9('0x33')][_0x12c9('0x37')]));_0x548775[_0x12c9('0x36')]=_0x548775['attributes'][_0x12c9('0x46')]?_0x548775[_0x12c9('0x36')]:_0x3ca682[_0x12c9('0x32')];if(_0x55e1d4[_0x12c9('0x33')][_0x12c9('0x40')]){_0x548775[_0x12c9('0x41')]=[{'all':!![]}];}_0x548775=_[_0x12c9('0x3d')]({},_0x548775,_0x55e1d4[_0x12c9('0x47')]);return db['JscriptyProject'][_0x12c9('0x48')](_0x548775)['then'](handleEntityNotFound(_0x45616c,null))[_0x12c9('0x22')](respondWithResult(_0x45616c,null))[_0x12c9('0x44')](handleError(_0x45616c,null));};exports[_0x12c9('0x49')]=function(_0x3a00a3,_0x5b5d13){return db[_0x12c9('0x2d')]['create'](_0x3a00a3['body'],{})[_0x12c9('0x22')](function(_0x4350e8){var _0x1d9c7f=_0x3a00a3[_0x12c9('0x4a')][_0x12c9('0x24')]({'plain':!![]});if(!_0x1d9c7f)throw new Error(_0x12c9('0x4b'));if(_0x1d9c7f[_0x12c9('0x4c')]===_0x12c9('0x4a')){var _0x1a36ad=_0x4350e8['get']({'plain':!![]});var _0x257a28=_0x12c9('0x25');return db['UserProfileSection'][_0x12c9('0x48')]({'where':{'name':_0x257a28,'userProfileId':_0x1d9c7f[_0x12c9('0x4d')]},'raw':!![]})[_0x12c9('0x22')](function(_0x277fbf){if(_0x277fbf&&_0x277fbf[_0x12c9('0x4e')]===0x0){return db[_0x12c9('0x26')][_0x12c9('0x49')]({'name':_0x1a36ad[_0x12c9('0x29')],'resourceId':_0x1a36ad['id'],'type':_0x277fbf['name'],'sectionId':_0x277fbf['id']},{})['then'](function(){return _0x4350e8;});}else{return _0x4350e8;}})['catch'](function(_0x3da484){logger[_0x12c9('0x28')](_0x12c9('0x4f'),_0x3da484);throw _0x3da484;});}return _0x4350e8;})['then'](respondWithResult(_0x5b5d13,0xc9))[_0x12c9('0x44')](handleError(_0x5b5d13,null));};exports[_0x12c9('0x50')]=function(_0x154815,_0x2e5774){var _0x41c917={'where':{'id':_0x154815[_0x12c9('0x51')]['id']}},_0x53aba5={};_0x53aba5[_0x12c9('0x32')]=_[_0x12c9('0x34')](db[_0x12c9('0x2d')][_0x12c9('0x2e')]);_0x41c917[_0x12c9('0x36')]=_[_0x12c9('0x35')](_0x53aba5[_0x12c9('0x32')],qs[_0x12c9('0x37')](_0x154815[_0x12c9('0x33')]['fields']));_0x41c917[_0x12c9('0x36')]=_0x41c917[_0x12c9('0x36')]['length']?_0x41c917['attributes']:_0x53aba5[_0x12c9('0x32')];if(_0x154815[_0x12c9('0x33')][_0x12c9('0x40')]){_0x41c917[_0x12c9('0x41')]=[{'all':!![]}];}_0x41c917=_[_0x12c9('0x3d')]({},_0x41c917,_0x154815['options']);return db[_0x12c9('0x2d')][_0x12c9('0x48')](_0x41c917)[_0x12c9('0x22')](handleEntityNotFound(_0x2e5774,null))[_0x12c9('0x22')](function(_0x3f96a6){if(_0x3f96a6){var _0x124d1b=_0x3f96a6[_0x12c9('0x24')]({'plain':!![]});_0x124d1b=qs[_0x12c9('0x52')](_0x124d1b,['id',_0x12c9('0x53'),'updatedAt']);_0x154815['body']=_[_0x12c9('0x52')](_0x154815[_0x12c9('0x54')],['id',_0x12c9('0x53'),_0x12c9('0x55')]);return db['JscriptyProject'][_0x12c9('0x49')](_[_0x12c9('0x3d')](_0x124d1b,_0x154815[_0x12c9('0x54')]),{'include':_0x154815[_0x12c9('0x33')][_0x12c9('0x40')]?[{'all':!![]}]:undefined})[_0x12c9('0x22')](function(_0x35f612){var _0x170130=_0x154815['user'][_0x12c9('0x24')]({'plain':!![]});if(!_0x170130)throw new Error(_0x12c9('0x4b'));if(_0x170130[_0x12c9('0x4c')]===_0x12c9('0x4a')){var _0x46f6b4=_0x35f612[_0x12c9('0x24')]({'plain':!![]});var _0x281e2e=_0x12c9('0x25');return db['UserProfileSection'][_0x12c9('0x48')]({'where':{'name':_0x281e2e,'userProfileId':_0x170130[_0x12c9('0x4d')]},'raw':!![]})[_0x12c9('0x22')](function(_0x4b5f28){if(_0x4b5f28&&_0x4b5f28['autoAssociation']===0x0){return db[_0x12c9('0x26')][_0x12c9('0x49')]({'name':_0x46f6b4[_0x12c9('0x29')],'resourceId':_0x46f6b4['id'],'type':_0x4b5f28[_0x12c9('0x29')],'sectionId':_0x4b5f28['id']},{})[_0x12c9('0x22')](function(){return _0x35f612;});}else{return _0x35f612;}})['catch'](function(_0x59e3df){logger[_0x12c9('0x28')](_0x12c9('0x4f'),_0x59e3df);throw _0x59e3df;});}return _0x35f612;});}})[_0x12c9('0x22')](respondWithResult(_0x2e5774,0xc9))[_0x12c9('0x44')](handleError(_0x2e5774,null));};exports[_0x12c9('0x21')]=function(_0x4f9b1e,_0x22689c){if(_0x4f9b1e[_0x12c9('0x54')]['id']){delete _0x4f9b1e['body']['id'];}return db[_0x12c9('0x2d')][_0x12c9('0x48')]({'where':{'id':_0x4f9b1e['params']['id']}})[_0x12c9('0x22')](handleEntityNotFound(_0x22689c,null))[_0x12c9('0x22')](saveUpdates(_0x4f9b1e[_0x12c9('0x54')],null))['then'](respondWithResult(_0x22689c,null))[_0x12c9('0x44')](handleError(_0x22689c,null));};exports['destroy']=function(_0x5ebedf,_0x20b4cb){return db[_0x12c9('0x2d')][_0x12c9('0x48')]({'where':{'id':_0x5ebedf[_0x12c9('0x51')]['id']}})[_0x12c9('0x22')](handleEntityNotFound(_0x20b4cb,null))[_0x12c9('0x22')](removeEntity(_0x20b4cb,null))['catch'](handleError(_0x20b4cb,null));};exports[_0x12c9('0x56')]=function(_0xf5d20b,_0x3d2338,_0x28e628){var _0x46755f={'raw':!![],'where':{}};var _0x44a739={};var _0x38ef73={'count':0x0,'rows':[]};return db['JscriptyProject']['findOne']({'where':{'id':_0xf5d20b[_0x12c9('0x51')]['id']}})[_0x12c9('0x22')](handleEntityNotFound(_0x3d2338,null))[_0x12c9('0x22')](function(_0x236aa8){if(_0x236aa8){_0x44a739['model']=_['keys'](db['JscriptySessionReport'][_0x12c9('0x2e')]);_0x44a739['query']=_['keys'](_0xf5d20b[_0x12c9('0x33')]);_0x44a739[_0x12c9('0x3b')]=_[_0x12c9('0x35')](_0x44a739[_0x12c9('0x32')],_0x44a739[_0x12c9('0x33')]);_0x46755f[_0x12c9('0x36')]=_[_0x12c9('0x35')](_0x44a739['model'],qs[_0x12c9('0x37')](_0xf5d20b[_0x12c9('0x33')]['fields']));_0x46755f[_0x12c9('0x36')]=_0x46755f[_0x12c9('0x36')]['length']?_0x46755f[_0x12c9('0x36')]:_0x44a739[_0x12c9('0x32')];if(!_0xf5d20b[_0x12c9('0x33')][_0x12c9('0x38')]('nolimit')){_0x46755f[_0x12c9('0x1b')]=qs[_0x12c9('0x1b')](_0xf5d20b[_0x12c9('0x33')][_0x12c9('0x1b')]);_0x46755f['offset']=qs[_0x12c9('0x1d')](_0xf5d20b['query'][_0x12c9('0x1d')]);}_0x46755f[_0x12c9('0x39')]=qs[_0x12c9('0x57')](_0xf5d20b[_0x12c9('0x33')][_0x12c9('0x57')]);_0x46755f['where']=qs['filters'](_[_0x12c9('0x3c')](_0xf5d20b[_0x12c9('0x33')],_0x44a739[_0x12c9('0x3b')]));_0x46755f[_0x12c9('0x3a')][_0x12c9('0x58')]=_0x236aa8['id'];if(_0xf5d20b[_0x12c9('0x33')]['filter']){_0x46755f[_0x12c9('0x3a')]=_[_0x12c9('0x3d')](_0x46755f[_0x12c9('0x3a')],{'$or':_[_0x12c9('0x2c')](_0x46755f[_0x12c9('0x36')],function(_0x550451){var _0x13c36c={};_0x13c36c[_0x550451]={'$like':'%'+_0xf5d20b[_0x12c9('0x33')][_0x12c9('0x3f')]+'%'};return _0x13c36c;})});}_0x46755f=_[_0x12c9('0x3d')]({},_0x46755f,_0xf5d20b[_0x12c9('0x47')]);return db[_0x12c9('0x59')]['count']({'where':_0x46755f[_0x12c9('0x3a')]})['then'](function(_0x1e8baa){_0x38ef73[_0x12c9('0x1c')]=_0x1e8baa;if(_0xf5d20b['query'][_0x12c9('0x40')]){_0x46755f[_0x12c9('0x41')]=[{'all':!![]}];}return db[_0x12c9('0x59')]['findAll'](_0x46755f);})['then'](function(_0x3f02ca){_0x38ef73[_0x12c9('0x43')]=_0x3f02ca;return _0x38ef73;});}})['then'](respondWithFilteredResult(_0x3d2338,_0x46755f))[_0x12c9('0x44')](handleError(_0x3d2338,null));};exports[_0x12c9('0x5a')]=function(_0x2c3f4a,_0x2b2594,_0x20dec0){var _0x2b3d9b={'raw':!![],'where':{}};var _0x4f56c4={};var _0x2b240d={'count':0x0,'rows':[]};return db[_0x12c9('0x2d')][_0x12c9('0x5b')]({'where':{'id':_0x2c3f4a[_0x12c9('0x51')]['id']}})[_0x12c9('0x22')](handleEntityNotFound(_0x2b2594,null))[_0x12c9('0x22')](function(_0x206b8b){if(_0x206b8b){_0x4f56c4['model']=_[_0x12c9('0x34')](db[_0x12c9('0x5c')][_0x12c9('0x2e')]);_0x4f56c4[_0x12c9('0x33')]=_['keys'](_0x2c3f4a['query']);_0x4f56c4['filters']=_['intersection'](_0x4f56c4[_0x12c9('0x32')],_0x4f56c4[_0x12c9('0x33')]);_0x2b3d9b[_0x12c9('0x36')]=_['intersection'](_0x4f56c4[_0x12c9('0x32')],qs['fields'](_0x2c3f4a[_0x12c9('0x33')]['fields']));_0x2b3d9b[_0x12c9('0x36')]=_0x2b3d9b['attributes'][_0x12c9('0x46')]?_0x2b3d9b[_0x12c9('0x36')]:_0x4f56c4[_0x12c9('0x32')];if(!_0x2c3f4a[_0x12c9('0x33')][_0x12c9('0x38')]('nolimit')){_0x2b3d9b[_0x12c9('0x1b')]=qs[_0x12c9('0x1b')](_0x2c3f4a['query'][_0x12c9('0x1b')]);_0x2b3d9b[_0x12c9('0x1d')]=qs[_0x12c9('0x1d')](_0x2c3f4a[_0x12c9('0x33')]['offset']);}_0x2b3d9b['order']=qs[_0x12c9('0x57')](_0x2c3f4a[_0x12c9('0x33')][_0x12c9('0x57')]);_0x2b3d9b[_0x12c9('0x3a')]=qs[_0x12c9('0x3b')](_[_0x12c9('0x3c')](_0x2c3f4a[_0x12c9('0x33')],_0x4f56c4['filters']));_0x2b3d9b[_0x12c9('0x3a')][_0x12c9('0x58')]=_0x206b8b['id'];if(_0x2c3f4a[_0x12c9('0x33')][_0x12c9('0x3f')]){_0x2b3d9b['where']=_['merge'](_0x2b3d9b[_0x12c9('0x3a')],{'$or':_[_0x12c9('0x2c')](_0x2b3d9b[_0x12c9('0x36')],function(_0x1d480f){var _0x5b4a59={};_0x5b4a59[_0x1d480f]={'$like':'%'+_0x2c3f4a[_0x12c9('0x33')]['filter']+'%'};return _0x5b4a59;})});}_0x2b3d9b=_[_0x12c9('0x3d')]({},_0x2b3d9b,_0x2c3f4a[_0x12c9('0x47')]);return db[_0x12c9('0x5c')][_0x12c9('0x1c')]({'where':_0x2b3d9b['where']})[_0x12c9('0x22')](function(_0x45c825){_0x2b240d[_0x12c9('0x1c')]=_0x45c825;if(_0x2c3f4a['query'][_0x12c9('0x40')]){_0x2b3d9b['include']=[{'all':!![]}];}return db[_0x12c9('0x5c')][_0x12c9('0x42')](_0x2b3d9b);})[_0x12c9('0x22')](function(_0x5e8fbd){_0x2b240d['rows']=_0x5e8fbd;return _0x2b240d;});}})['then'](respondWithFilteredResult(_0x2b2594,_0x2b3d9b))[_0x12c9('0x44')](handleError(_0x2b2594,null));};function char(_0x2786b4){return _0x12c9('0x5d')===typeof _0x2786b4?String[_0x12c9('0x5e')][_0x12c9('0x1e')](null,arguments):_0x2786b4;}function needsEncapsulation(_0x5126cd){return!!_0x5126cd&&(_0x5126cd[_0x12c9('0x5f')]()[_0x12c9('0x60')](char(0xd))>=0x0||_0x5126cd[_0x12c9('0x5f')]()['indexOf'](char(0xa))>=0x0||_0x5126cd[_0x12c9('0x5f')]()[_0x12c9('0x60')](char(0x2c))>=0x0||_0x5126cd['toString']()[_0x12c9('0x60')](char(0x22))>=0x0);}function encapsulate(_0x2a1775){var _0x26680b=char(0x22),_0x2671c1='\x5c'+char(0x22),_0x5eb04b=_0x2a1775[_0x12c9('0x5f')]()['replace'](new RegExp(_0x26680b,'g'),_0x2671c1);return _0x26680b+_0x5eb04b+_0x26680b;}exports[_0x12c9('0x61')]=function(_0xffa2b5,_0x15d54f,_0x28d8ba){var _0x8af908,_0x30f21e;var _0x6ab36d={'where':{'ProjectId':_0xffa2b5[_0x12c9('0x51')]['id']}};if(_0xffa2b5[_0x12c9('0x33')][_0x12c9('0x62')]){_0x6ab36d[_0x12c9('0x3a')]['starttime']=JSON[_0x12c9('0x63')](_0xffa2b5[_0x12c9('0x33')]['startTime']);}return db['JscriptySessionReport']['findAll'](_0x6ab36d)[_0x12c9('0x22')](handleEntityNotFound(_0x15d54f,null))[_0x12c9('0x22')](function(_0x9c95c6){if(_0x9c95c6){_0x8af908=_0x9c95c6;return db['JscriptyQuestionReport']['findAll']({'where':{'SessionId':{'$in':_[_0x12c9('0x2c')](_0x8af908,'id')},'ProjectId':_0xffa2b5['params']['id']},'order':_0x12c9('0x64')});}})[_0x12c9('0x22')](handleEntityNotFound(_0x15d54f,null))[_0x12c9('0x22')](function(_0x38f224){if(_0x38f224){_0x30f21e=_0x38f224;var _0xad3c9f={};for(var _0x2b57f6=0x0,_0x380470=_0x30f21e['length'];_0x2b57f6<_0x380470;_0x2b57f6++){if(!_0xad3c9f[_0x12c9('0x38')](_0x30f21e[_0x2b57f6][_0x12c9('0x65')])){_0xad3c9f[_0x30f21e[_0x2b57f6]['questionId']]=needsEncapsulation(_0x30f21e[_0x2b57f6][_0x12c9('0x66')])?encapsulate(_0x30f21e[_0x2b57f6][_0x12c9('0x66')]):_0x30f21e[_0x2b57f6][_0x12c9('0x66')];}}var _0x3532ee=[],_0x25f71a={};for(var _0x3aae1e=0x0,_0x70c9fe=_0x8af908[_0x12c9('0x46')];_0x3aae1e<_0x70c9fe;_0x3aae1e++){_0x25f71a={'ProjectId':_0xffa2b5['params']['id'],'SessionId':_0x8af908[_0x3aae1e]['id'],'StartTime':moment(_0x8af908[_0x3aae1e][_0x12c9('0x67')])[_0x12c9('0x68')](_0x12c9('0x69'))};for(var _0x117544=0x0,_0x5ba25d=_0x30f21e[_0x12c9('0x46')];_0x117544<_0x5ba25d;_0x117544++){if(_0x30f21e[_0x117544][_0x12c9('0x6a')]==_0x8af908[_0x3aae1e]['id']&&_0xad3c9f['hasOwnProperty'](_0x30f21e[_0x117544][_0x12c9('0x65')])){_0x25f71a[_0xad3c9f[_0x30f21e[_0x117544]['questionId']]]=_0x30f21e[_0x117544][_0x12c9('0x6b')];}}for(var _0x533795 in _0xad3c9f){if(!_0x25f71a[_0x12c9('0x38')](_0xad3c9f[_0x533795])){_0x25f71a[_0xad3c9f[_0x533795]]=null;}}_0x3532ee[_0x12c9('0x6c')](_0x25f71a);}return _0x3532ee;}})[_0x12c9('0x22')](function(_0x5d9cd4){if(!_[_0x12c9('0x6d')](_0x5d9cd4)){var _0x4d4bbe=toCsv(_0x5d9cd4);var _0x26b767=Date[_0x12c9('0x6e')]();fs[_0x12c9('0x6f')](util['format']('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0xffa2b5[_0x12c9('0x51')]['id'],_0x26b767),_0x4d4bbe);_0x15d54f[_0x12c9('0x70')](_0x12c9('0x71'),_0x12c9('0x72')+util[_0x12c9('0x68')]('Jscripty_Project_%d_Summary_%s.csv',_0xffa2b5['params']['id'],_0x26b767));_0x15d54f[_0x12c9('0x70')](_0x12c9('0x73'),_0x12c9('0x74'));return _0x15d54f['download'](util[_0x12c9('0x68')](_0x12c9('0x75'),_0xffa2b5[_0x12c9('0x51')]['id'],_0x26b767));}else{return _0x15d54f['sendStatus'](0xcc);}})[_0x12c9('0x44')](handleError(_0x15d54f,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 796fc08..5fb332c 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 _0xbdb9=['jscripty_projects','lodash','util','../../config/logger','api','moment','request-promise','exports','JscriptyProject'];(function(_0x190acf,_0x3c0824){var _0x5bde5b=function(_0x55b7dc){while(--_0x55b7dc){_0x190acf['push'](_0x190acf['shift']());}};_0x5bde5b(++_0x3c0824);}(_0xbdb9,0xac));var _0x9bdb=function(_0x40b536,_0x2a9bbc){_0x40b536=_0x40b536-0x0;var _0x2f485b=_0xbdb9[_0x40b536];return _0x2f485b;};'use strict';var _=require(_0x9bdb('0x0'));var util=require(_0x9bdb('0x1'));var logger=require(_0x9bdb('0x2'))(_0x9bdb('0x3'));var moment=require(_0x9bdb('0x4'));var BPromise=require('bluebird');var rp=require(_0x9bdb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./jscriptyProject.attributes');module[_0x9bdb('0x6')]=function(_0x4f9fbe,_0x225a66){return _0x4f9fbe['define'](_0x9bdb('0x7'),attributes,{'tableName':_0x9bdb('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9305=['../../config/logger','api','bluebird','request-promise','path','rimraf','./jscriptyProject.attributes','exports','jscripty_projects','lodash','util'];(function(_0x5a70aa,_0x47c803){var _0x16bfa5=function(_0xb532a7){while(--_0xb532a7){_0x5a70aa['push'](_0x5a70aa['shift']());}};_0x16bfa5(++_0x47c803);}(_0x9305,0x1e2));var _0x5930=function(_0x195e6a,_0x379e1c){_0x195e6a=_0x195e6a-0x0;var _0x4aeab4=_0x9305[_0x195e6a];return _0x4aeab4;};'use strict';var _=require(_0x5930('0x0'));var util=require(_0x5930('0x1'));var logger=require(_0x5930('0x2'))(_0x5930('0x3'));var moment=require('moment');var BPromise=require(_0x5930('0x4'));var rp=require(_0x5930('0x5'));var fs=require('fs');var path=require(_0x5930('0x6'));var rimraf=require(_0x5930('0x7'));var config=require('../../config/environment');var attributes=require(_0x5930('0x8'));module[_0x5930('0x9')]=function(_0x70d74f,_0x2c4ada){return _0x70d74f['define']('JscriptyProject',attributes,{'tableName':_0x5930('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.rpc.js b/server/api/jscriptyProject/jscriptyProject.rpc.js index 9804eb9..bfa0ee1 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 _0xd8b0=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','ioredis'];(function(_0x305c8f,_0xc5f7fb){var _0x5ddc30=function(_0x1aed6f){while(--_0x1aed6f){_0x305c8f['push'](_0x305c8f['shift']());}};_0x5ddc30(++_0xc5f7fb);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});} \ No newline at end of file +var _0xbdb7=['request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','info','JscriptyProject,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbdb7,0x12e));var _0x7bdb=function(_0xbb9b40,_0x51b63a){_0xbb9b40=_0xbb9b40-0x0;var _0x4cd1b3=_0xbdb7[_0xbb9b40];return _0x4cd1b3;};'use strict';var _=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var moment=require(_0x7bdb('0x2'));var BPromise=require(_0x7bdb('0x3'));var rs=require(_0x7bdb('0x4'));var fs=require('fs');var Redis=require(_0x7bdb('0x5'));var db=require(_0x7bdb('0x6'))['db'];var utils=require(_0x7bdb('0x7'));var logger=require(_0x7bdb('0x8'))('rpc');var config=require(_0x7bdb('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7bdb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e23a3,_0x493bde,_0x513cba){return new BPromise(function(_0x468041,_0x11a877){return client['request'](_0x1e23a3,_0x513cba)['then'](function(_0xdc2ffc){logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));logger[_0x7bdb('0xe')](_0x7bdb('0xf'),_0x493bde,_0x7bdb('0xd'),JSON[_0x7bdb('0x10')](_0xdc2ffc));if(_0xdc2ffc['error']){if(_0xdc2ffc['error']['code']===0x1f4){logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error'][_0x7bdb('0x12')]);return _0x11a877(_0xdc2ffc['error']['message']);}logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error']['message']);return _0x468041(_0xdc2ffc['error'][_0x7bdb('0x12')]);}else{logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));_0x468041(_0xdc2ffc[_0x7bdb('0x13')][_0x7bdb('0x12')]);}})[_0x7bdb('0x14')](function(_0x1b2d9b){logger['error'](_0x7bdb('0xc'),_0x493bde,_0x1b2d9b);_0x11a877(_0x1b2d9b);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 05c6d7c..442caf2 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 _0x56b9=['create','put','/:id','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyQuestionReport.controller','index','get','/describe','isAuthenticated','describe','show'];(function(_0x52dd39,_0xdb90a5){var _0x1d4076=function(_0x19c184){while(--_0x19c184){_0x52dd39['push'](_0x52dd39['shift']());}};_0x1d4076(++_0xdb90a5);}(_0x56b9,0x1e5));var _0x956b=function(_0xee2540,_0x17a8e1){_0xee2540=_0xee2540-0x0;var _0x4bc584=_0x56b9[_0xee2540];return _0x4bc584;};'use strict';var multer=require(_0x956b('0x0'));var util=require(_0x956b('0x1'));var path=require(_0x956b('0x2'));var timeout=require(_0x956b('0x3'));var express=require('express');var router=express[_0x956b('0x4')]();var fs_extra=require(_0x956b('0x5'));var auth=require(_0x956b('0x6'));var interaction=require(_0x956b('0x7'));var config=require('../../config/environment');var controller=require(_0x956b('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x956b('0x9')]);router[_0x956b('0xa')](_0x956b('0xb'),auth[_0x956b('0xc')](),controller[_0x956b('0xd')]);router[_0x956b('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x956b('0xe')]);router['post']('/',auth[_0x956b('0xc')](),controller[_0x956b('0xf')]);router[_0x956b('0x10')](_0x956b('0x11'),auth['isAuthenticated'](),controller['update']);router[_0x956b('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x956b('0x13')]);module['exports']=router; \ No newline at end of file +var _0x85d3=['post','create','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show'];(function(_0x386c4c,_0x4a326b){var _0x24afbd=function(_0x201c12){while(--_0x201c12){_0x386c4c['push'](_0x386c4c['shift']());}};_0x24afbd(++_0x4a326b);}(_0x85d3,0xa3));var _0x385d=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x85d3[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0x385d('0x0'));var util=require(_0x385d('0x1'));var path=require(_0x385d('0x2'));var timeout=require(_0x385d('0x3'));var express=require(_0x385d('0x4'));var router=express[_0x385d('0x5')]();var fs_extra=require(_0x385d('0x6'));var auth=require(_0x385d('0x7'));var interaction=require(_0x385d('0x8'));var config=require(_0x385d('0x9'));var controller=require('./jscriptyQuestionReport.controller');router[_0x385d('0xa')]('/',auth['isAuthenticated'](),controller[_0x385d('0xb')]);router[_0x385d('0xa')](_0x385d('0xc'),auth[_0x385d('0xd')](),controller[_0x385d('0xe')]);router[_0x385d('0xa')](_0x385d('0xf'),auth[_0x385d('0xd')](),controller[_0x385d('0x10')]);router[_0x385d('0x11')]('/',auth[_0x385d('0xd')](),controller[_0x385d('0x12')]);router['put'](_0x385d('0xf'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x385d('0xf'),auth[_0x385d('0xd')](),controller['destroy']);module[_0x385d('0x13')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 68fbdc8..4bd24da 100644 --- a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js +++ b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x7a54,0x106));var _0x47a5=function(_0x182456,_0x226acf){_0x182456=_0x182456-0x0;var _0x5a071d=_0x7a54[_0x182456];return _0x5a071d;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file +var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x7a54,0x106));var _0x47a5=function(_0x321bee,_0x3b086e){_0x321bee=_0x321bee-0x0;var _0x55d635=_0x7a54[_0x321bee];return _0x55d635;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js index 993faff..200cbe6 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 _0x0abb=['limit','Content-Range','reject','save','then','end','sendStatus','error','stack','name','JscriptyQuestionReport','fieldName','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','update','destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../mysqldb','status','json','offset','undefined'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x0abb,0x111));var _0xb0ab=function(_0x291249,_0x5200cc){_0x291249=_0x291249-0x0;var _0x5f126d=_0x0abb[_0x291249];return _0x5f126d;};'use strict';var emlformat=require(_0xb0ab('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb0ab('0x1'));var jsonpatch=require(_0xb0ab('0x2'));var rp=require(_0xb0ab('0x3'));var moment=require(_0xb0ab('0x4'));var BPromise=require(_0xb0ab('0x5'));var Mustache=require(_0xb0ab('0x6'));var util=require('util');var path=require(_0xb0ab('0x7'));var sox=require(_0xb0ab('0x8'));var csv=require(_0xb0ab('0x9'));var ejs=require(_0xb0ab('0xa'));var fs=require('fs');var fs_extra=require(_0xb0ab('0xb'));var _=require(_0xb0ab('0xc'));var squel=require(_0xb0ab('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb0ab('0xe'));var toCsv=require(_0xb0ab('0x9'));var querystring=require(_0xb0ab('0xf'));var Papa=require(_0xb0ab('0x10'));var Redis=require(_0xb0ab('0x11'));var authService=require(_0xb0ab('0x12'));var qs=require(_0xb0ab('0x13'));var as=require(_0xb0ab('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xb0ab('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb0ab('0x16'))['db'];function respondWithStatusCode(_0x3532ff,_0x366ebe){_0x366ebe=_0x366ebe||0xcc;return function(_0x3205e7){if(_0x3205e7){return _0x3532ff['sendStatus'](_0x366ebe);}return _0x3532ff[_0xb0ab('0x17')](_0x366ebe)['end']();};}function respondWithResult(_0x39a8da,_0x1b96a6){_0x1b96a6=_0x1b96a6||0xc8;return function(_0x1761b5){if(_0x1761b5){return _0x39a8da['status'](_0x1b96a6)[_0xb0ab('0x18')](_0x1761b5);}};}function respondWithFilteredResult(_0x32c647,_0x3966fd){return function(_0x5f1b0c){if(_0x5f1b0c){var _0x40a7a9=typeof _0x3966fd[_0xb0ab('0x19')]===_0xb0ab('0x1a')&&typeof _0x3966fd[_0xb0ab('0x1b')]===_0xb0ab('0x1a');var _0xaa372d=_0x5f1b0c['count'];var _0x23aef5=_0x40a7a9?0x0:_0x3966fd['offset'];var _0x42eb64=_0x40a7a9?_0x5f1b0c['count']:_0x3966fd[_0xb0ab('0x19')]+_0x3966fd['limit'];var _0x1df10b;if(_0x42eb64>=_0xaa372d){_0x42eb64=_0xaa372d;_0x1df10b=0xc8;}else{_0x1df10b=0xce;}_0x32c647['status'](_0x1df10b);return _0x32c647['set'](_0xb0ab('0x1c'),_0x23aef5+'-'+_0x42eb64+'/'+_0xaa372d)[_0xb0ab('0x18')](_0x5f1b0c);}return null;};}function patchUpdates(_0x17b30e){return function(_0x1c11a4){try{jsonpatch['apply'](_0x1c11a4,_0x17b30e,!![]);}catch(_0x4494b6){return BPromise[_0xb0ab('0x1d')](_0x4494b6);}return _0x1c11a4[_0xb0ab('0x1e')]();};}function saveUpdates(_0x5f3f3e,_0x406102){return function(_0x271cae){if(_0x271cae){return _0x271cae['update'](_0x5f3f3e)['then'](function(_0x49cd59){return _0x49cd59;});}return null;};}function removeEntity(_0x3e9df3,_0x44b383){return function(_0x4ebbc2){if(_0x4ebbc2){return _0x4ebbc2['destroy']()[_0xb0ab('0x1f')](function(){_0x3e9df3[_0xb0ab('0x17')](0xcc)[_0xb0ab('0x20')]();});}};}function handleEntityNotFound(_0x421f19,_0x3af6e8){return function(_0x54558c){if(!_0x54558c){_0x421f19[_0xb0ab('0x21')](0x194);}return _0x54558c;};}function handleError(_0x486ad4,_0x3a208e){_0x3a208e=_0x3a208e||0x1f4;return function(_0x2ed495){logger[_0xb0ab('0x22')](_0x2ed495[_0xb0ab('0x23')]);if(_0x2ed495[_0xb0ab('0x24')]){delete _0x2ed495[_0xb0ab('0x24')];}_0x486ad4[_0xb0ab('0x17')](_0x3a208e)['send'](_0x2ed495);};}exports['index']=function(_0x1b7fb4,_0x29a5c1){var _0x57ba4a={},_0x290e8b={},_0x59ae5e={'count':0x0,'rows':[]};var _0x3095fe=_['map'](db[_0xb0ab('0x25')]['rawAttributes'],function(_0x3afa09){return{'name':_0x3afa09[_0xb0ab('0x26')],'type':_0x3afa09[_0xb0ab('0x27')][_0xb0ab('0x28')]};});_0x290e8b[_0xb0ab('0x29')]=_[_0xb0ab('0x2a')](_0x3095fe,_0xb0ab('0x24'));_0x290e8b[_0xb0ab('0x2b')]=_['keys'](_0x1b7fb4[_0xb0ab('0x2b')]);_0x290e8b['filters']=_[_0xb0ab('0x2c')](_0x290e8b[_0xb0ab('0x29')],_0x290e8b[_0xb0ab('0x2b')]);_0x57ba4a[_0xb0ab('0x2d')]=_[_0xb0ab('0x2c')](_0x290e8b[_0xb0ab('0x29')],qs[_0xb0ab('0x2e')](_0x1b7fb4[_0xb0ab('0x2b')][_0xb0ab('0x2e')]));_0x57ba4a['attributes']=_0x57ba4a[_0xb0ab('0x2d')][_0xb0ab('0x2f')]?_0x57ba4a[_0xb0ab('0x2d')]:_0x290e8b['model'];if(!_0x1b7fb4[_0xb0ab('0x2b')][_0xb0ab('0x30')](_0xb0ab('0x31'))){_0x57ba4a[_0xb0ab('0x1b')]=qs['limit'](_0x1b7fb4[_0xb0ab('0x2b')][_0xb0ab('0x1b')]);_0x57ba4a[_0xb0ab('0x19')]=qs['offset'](_0x1b7fb4[_0xb0ab('0x2b')][_0xb0ab('0x19')]);}_0x57ba4a[_0xb0ab('0x32')]=qs[_0xb0ab('0x33')](_0x1b7fb4['query'][_0xb0ab('0x33')]);_0x57ba4a[_0xb0ab('0x34')]=qs['filters'](_[_0xb0ab('0x35')](_0x1b7fb4[_0xb0ab('0x2b')],_0x290e8b[_0xb0ab('0x36')]),_0x3095fe);if(_0x1b7fb4[_0xb0ab('0x2b')][_0xb0ab('0x37')]){_0x57ba4a[_0xb0ab('0x34')]=_[_0xb0ab('0x38')](_0x57ba4a['where'],{'$or':_[_0xb0ab('0x2a')](_0x3095fe,function(_0x330dfa){if(_0x330dfa[_0xb0ab('0x27')]!==_0xb0ab('0x39')){var _0x2310a8={};_0x2310a8[_0x330dfa[_0xb0ab('0x24')]]={'$like':'%'+_0x1b7fb4['query'][_0xb0ab('0x37')]+'%'};return _0x2310a8;}})});}_0x57ba4a=_['merge']({},_0x57ba4a,_0x1b7fb4[_0xb0ab('0x3a')]);var _0x2e1631={'where':_0x57ba4a[_0xb0ab('0x34')]};return db[_0xb0ab('0x25')][_0xb0ab('0x3b')](_0x2e1631)[_0xb0ab('0x1f')](function(_0x4858f6){_0x59ae5e[_0xb0ab('0x3b')]=_0x4858f6;if(_0x1b7fb4[_0xb0ab('0x2b')][_0xb0ab('0x3c')]){_0x57ba4a[_0xb0ab('0x3d')]=[{'all':!![]}];}return db[_0xb0ab('0x25')][_0xb0ab('0x3e')](_0x57ba4a);})['then'](function(_0x5c0739){_0x59ae5e[_0xb0ab('0x3f')]=_0x5c0739;return _0x59ae5e;})[_0xb0ab('0x1f')](respondWithFilteredResult(_0x29a5c1,_0x57ba4a))[_0xb0ab('0x40')](handleError(_0x29a5c1,null));};exports[_0xb0ab('0x41')]=function(_0x3b4e52,_0x397786){var _0x5e365e={'raw':!![],'where':{'id':_0x3b4e52[_0xb0ab('0x42')]['id']}},_0x58c6c1={};_0x58c6c1['model']=_[_0xb0ab('0x43')](db[_0xb0ab('0x25')][_0xb0ab('0x44')]);_0x58c6c1[_0xb0ab('0x2b')]=_[_0xb0ab('0x43')](_0x3b4e52[_0xb0ab('0x2b')]);_0x58c6c1[_0xb0ab('0x36')]=_['intersection'](_0x58c6c1[_0xb0ab('0x29')],_0x58c6c1[_0xb0ab('0x2b')]);_0x5e365e[_0xb0ab('0x2d')]=_['intersection'](_0x58c6c1[_0xb0ab('0x29')],qs[_0xb0ab('0x2e')](_0x3b4e52[_0xb0ab('0x2b')][_0xb0ab('0x2e')]));_0x5e365e[_0xb0ab('0x2d')]=_0x5e365e[_0xb0ab('0x2d')][_0xb0ab('0x2f')]?_0x5e365e[_0xb0ab('0x2d')]:_0x58c6c1[_0xb0ab('0x29')];if(_0x3b4e52[_0xb0ab('0x2b')][_0xb0ab('0x3c')]){_0x5e365e[_0xb0ab('0x3d')]=[{'all':!![]}];}_0x5e365e=_[_0xb0ab('0x38')]({},_0x5e365e,_0x3b4e52['options']);return db[_0xb0ab('0x25')][_0xb0ab('0x45')](_0x5e365e)[_0xb0ab('0x1f')](handleEntityNotFound(_0x397786,null))[_0xb0ab('0x1f')](respondWithResult(_0x397786,null))['catch'](handleError(_0x397786,null));};exports[_0xb0ab('0x46')]=function(_0x14d74f,_0x257d56){return db[_0xb0ab('0x25')][_0xb0ab('0x46')](_0x14d74f[_0xb0ab('0x47')],{})[_0xb0ab('0x1f')](respondWithResult(_0x257d56,0xc9))[_0xb0ab('0x40')](handleError(_0x257d56,null));};exports[_0xb0ab('0x48')]=function(_0x261d23,_0x4dc44c){if(_0x261d23[_0xb0ab('0x47')]['id']){delete _0x261d23[_0xb0ab('0x47')]['id'];}return db[_0xb0ab('0x25')][_0xb0ab('0x45')]({'where':{'id':_0x261d23[_0xb0ab('0x42')]['id']}})['then'](handleEntityNotFound(_0x4dc44c,null))[_0xb0ab('0x1f')](saveUpdates(_0x261d23[_0xb0ab('0x47')],null))[_0xb0ab('0x1f')](respondWithResult(_0x4dc44c,null))[_0xb0ab('0x40')](handleError(_0x4dc44c,null));};exports[_0xb0ab('0x49')]=function(_0x34ed90,_0xbe06ef){return db[_0xb0ab('0x25')]['find']({'where':{'id':_0x34ed90['params']['id']}})['then'](handleEntityNotFound(_0xbe06ef,null))[_0xb0ab('0x1f')](removeEntity(_0xbe06ef,null))[_0xb0ab('0x40')](handleError(_0xbe06ef,null));};exports[_0xb0ab('0x4a')]=function(_0x24a0a2,_0x4d39ac){return db['JscriptyQuestionReport']['describe']()[_0xb0ab('0x1f')](respondWithResult(_0x4d39ac,null))[_0xb0ab('0x40')](handleError(_0x4d39ac,null));}; \ No newline at end of file +var _0x8adc=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','JscriptyQuestionReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','length','nolimit','sort','where','pick','filter','merge','include','rows','catch','show','params','fields','includeAll','find','create','body','describe','eml-format','rimraf','request-promise','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce'];(function(_0x2e4769,_0x58d672){var _0x12c57e=function(_0x32cb87){while(--_0x32cb87){_0x2e4769['push'](_0x2e4769['shift']());}};_0x12c57e(++_0x58d672);}(_0x8adc,0x11c));var _0xc8ad=function(_0x36feb2,_0x53abef){_0x36feb2=_0x36feb2-0x0;var _0x292b43=_0x8adc[_0x36feb2];return _0x292b43;};'use strict';var emlformat=require(_0xc8ad('0x0'));var rimraf=require(_0xc8ad('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc8ad('0x2'));var moment=require('moment');var BPromise=require(_0xc8ad('0x3'));var Mustache=require(_0xc8ad('0x4'));var util=require(_0xc8ad('0x5'));var path=require('path');var sox=require(_0xc8ad('0x6'));var csv=require(_0xc8ad('0x7'));var ejs=require(_0xc8ad('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc8ad('0x9'));var crypto=require(_0xc8ad('0xa'));var jsforce=require(_0xc8ad('0xb'));var deskjs=require(_0xc8ad('0xc'));var toCsv=require(_0xc8ad('0x7'));var querystring=require(_0xc8ad('0xd'));var Papa=require(_0xc8ad('0xe'));var Redis=require(_0xc8ad('0xf'));var authService=require(_0xc8ad('0x10'));var qs=require(_0xc8ad('0x11'));var as=require(_0xc8ad('0x12'));var hardwareService=require(_0xc8ad('0x13'));var logger=require(_0xc8ad('0x14'))(_0xc8ad('0x15'));var utils=require(_0xc8ad('0x16'));var config=require(_0xc8ad('0x17'));var licenseUtil=require(_0xc8ad('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x59ebae,_0x53a3f4){_0x53a3f4=_0x53a3f4||0xcc;return function(_0x13be89){if(_0x13be89){return _0x59ebae[_0xc8ad('0x19')](_0x53a3f4);}return _0x59ebae[_0xc8ad('0x1a')](_0x53a3f4)[_0xc8ad('0x1b')]();};}function respondWithResult(_0x1511f0,_0x881b97){_0x881b97=_0x881b97||0xc8;return function(_0x2ad0ef){if(_0x2ad0ef){return _0x1511f0['status'](_0x881b97)['json'](_0x2ad0ef);}};}function respondWithFilteredResult(_0x187489,_0x59ec5d){return function(_0x1d1354){if(_0x1d1354){var _0xa7b53b=typeof _0x59ec5d[_0xc8ad('0x1c')]===_0xc8ad('0x1d')&&typeof _0x59ec5d[_0xc8ad('0x1e')]===_0xc8ad('0x1d');var _0x4fe86b=_0x1d1354['count'];var _0x87f919=_0xa7b53b?0x0:_0x59ec5d[_0xc8ad('0x1c')];var _0x3d1c2c=_0xa7b53b?_0x1d1354[_0xc8ad('0x1f')]:_0x59ec5d[_0xc8ad('0x1c')]+_0x59ec5d[_0xc8ad('0x1e')];var _0xd44665;if(_0x3d1c2c>=_0x4fe86b){_0x3d1c2c=_0x4fe86b;_0xd44665=0xc8;}else{_0xd44665=0xce;}_0x187489[_0xc8ad('0x1a')](_0xd44665);return _0x187489[_0xc8ad('0x20')](_0xc8ad('0x21'),_0x87f919+'-'+_0x3d1c2c+'/'+_0x4fe86b)['json'](_0x1d1354);}return null;};}function patchUpdates(_0x3152d4){return function(_0x4b3429){try{jsonpatch[_0xc8ad('0x22')](_0x4b3429,_0x3152d4,!![]);}catch(_0x3683cb){return BPromise[_0xc8ad('0x23')](_0x3683cb);}return _0x4b3429[_0xc8ad('0x24')]();};}function saveUpdates(_0x4a8ef6,_0x349a40){return function(_0x47f8d8){if(_0x47f8d8){return _0x47f8d8[_0xc8ad('0x25')](_0x4a8ef6)[_0xc8ad('0x26')](function(_0x2a05ab){return _0x2a05ab;});}return null;};}function removeEntity(_0x304ff1,_0x10067d){return function(_0x1fa7a4){if(_0x1fa7a4){return _0x1fa7a4[_0xc8ad('0x27')]()[_0xc8ad('0x26')](function(){_0x304ff1['status'](0xcc)[_0xc8ad('0x1b')]();});}};}function handleEntityNotFound(_0x154c7a,_0x3532a9){return function(_0x2ade0c){if(!_0x2ade0c){_0x154c7a[_0xc8ad('0x19')](0x194);}return _0x2ade0c;};}function handleError(_0x1e1581,_0x4ba416){_0x4ba416=_0x4ba416||0x1f4;return function(_0x2ca930){logger[_0xc8ad('0x28')](_0x2ca930[_0xc8ad('0x29')]);if(_0x2ca930[_0xc8ad('0x2a')]){delete _0x2ca930[_0xc8ad('0x2a')];}_0x1e1581['status'](_0x4ba416)[_0xc8ad('0x2b')](_0x2ca930);};}exports[_0xc8ad('0x2c')]=function(_0x316bf3,_0x119944){var _0x2493fa={},_0xcedcf4={},_0x1beb51={'count':0x0,'rows':[]};var _0x57e07a=_[_0xc8ad('0x2d')](db[_0xc8ad('0x2e')][_0xc8ad('0x2f')],function(_0x49b4dd){return{'name':_0x49b4dd['fieldName'],'type':_0x49b4dd[_0xc8ad('0x30')][_0xc8ad('0x31')]};});_0xcedcf4[_0xc8ad('0x32')]=_[_0xc8ad('0x2d')](_0x57e07a,_0xc8ad('0x2a'));_0xcedcf4[_0xc8ad('0x33')]=_[_0xc8ad('0x34')](_0x316bf3[_0xc8ad('0x33')]);_0xcedcf4[_0xc8ad('0x35')]=_['intersection'](_0xcedcf4[_0xc8ad('0x32')],_0xcedcf4[_0xc8ad('0x33')]);_0x2493fa['attributes']=_[_0xc8ad('0x36')](_0xcedcf4[_0xc8ad('0x32')],qs['fields'](_0x316bf3['query']['fields']));_0x2493fa['attributes']=_0x2493fa[_0xc8ad('0x37')][_0xc8ad('0x38')]?_0x2493fa['attributes']:_0xcedcf4[_0xc8ad('0x32')];if(!_0x316bf3[_0xc8ad('0x33')]['hasOwnProperty'](_0xc8ad('0x39'))){_0x2493fa[_0xc8ad('0x1e')]=qs[_0xc8ad('0x1e')](_0x316bf3[_0xc8ad('0x33')][_0xc8ad('0x1e')]);_0x2493fa[_0xc8ad('0x1c')]=qs[_0xc8ad('0x1c')](_0x316bf3[_0xc8ad('0x33')][_0xc8ad('0x1c')]);}_0x2493fa['order']=qs[_0xc8ad('0x3a')](_0x316bf3[_0xc8ad('0x33')][_0xc8ad('0x3a')]);_0x2493fa[_0xc8ad('0x3b')]=qs['filters'](_[_0xc8ad('0x3c')](_0x316bf3[_0xc8ad('0x33')],_0xcedcf4[_0xc8ad('0x35')]),_0x57e07a);if(_0x316bf3['query'][_0xc8ad('0x3d')]){_0x2493fa[_0xc8ad('0x3b')]=_[_0xc8ad('0x3e')](_0x2493fa[_0xc8ad('0x3b')],{'$or':_[_0xc8ad('0x2d')](_0x57e07a,function(_0x27ff76){if(_0x27ff76['type']!=='VIRTUAL'){var _0x1e8b72={};_0x1e8b72[_0x27ff76[_0xc8ad('0x2a')]]={'$like':'%'+_0x316bf3['query'][_0xc8ad('0x3d')]+'%'};return _0x1e8b72;}})});}_0x2493fa=_[_0xc8ad('0x3e')]({},_0x2493fa,_0x316bf3['options']);var _0xe35081={'where':_0x2493fa[_0xc8ad('0x3b')]};return db[_0xc8ad('0x2e')][_0xc8ad('0x1f')](_0xe35081)[_0xc8ad('0x26')](function(_0x355d4c){_0x1beb51[_0xc8ad('0x1f')]=_0x355d4c;if(_0x316bf3[_0xc8ad('0x33')]['includeAll']){_0x2493fa[_0xc8ad('0x3f')]=[{'all':!![]}];}return db[_0xc8ad('0x2e')]['findAll'](_0x2493fa);})['then'](function(_0x21c49e){_0x1beb51[_0xc8ad('0x40')]=_0x21c49e;return _0x1beb51;})[_0xc8ad('0x26')](respondWithFilteredResult(_0x119944,_0x2493fa))[_0xc8ad('0x41')](handleError(_0x119944,null));};exports[_0xc8ad('0x42')]=function(_0x4fabc5,_0x336195){var _0x4d8b5a={'raw':!![],'where':{'id':_0x4fabc5[_0xc8ad('0x43')]['id']}},_0x4da606={};_0x4da606[_0xc8ad('0x32')]=_[_0xc8ad('0x34')](db[_0xc8ad('0x2e')][_0xc8ad('0x2f')]);_0x4da606[_0xc8ad('0x33')]=_[_0xc8ad('0x34')](_0x4fabc5[_0xc8ad('0x33')]);_0x4da606[_0xc8ad('0x35')]=_[_0xc8ad('0x36')](_0x4da606[_0xc8ad('0x32')],_0x4da606[_0xc8ad('0x33')]);_0x4d8b5a[_0xc8ad('0x37')]=_[_0xc8ad('0x36')](_0x4da606[_0xc8ad('0x32')],qs[_0xc8ad('0x44')](_0x4fabc5['query'][_0xc8ad('0x44')]));_0x4d8b5a[_0xc8ad('0x37')]=_0x4d8b5a['attributes'][_0xc8ad('0x38')]?_0x4d8b5a[_0xc8ad('0x37')]:_0x4da606[_0xc8ad('0x32')];if(_0x4fabc5[_0xc8ad('0x33')][_0xc8ad('0x45')]){_0x4d8b5a['include']=[{'all':!![]}];}_0x4d8b5a=_[_0xc8ad('0x3e')]({},_0x4d8b5a,_0x4fabc5['options']);return db[_0xc8ad('0x2e')][_0xc8ad('0x46')](_0x4d8b5a)[_0xc8ad('0x26')](handleEntityNotFound(_0x336195,null))['then'](respondWithResult(_0x336195,null))[_0xc8ad('0x41')](handleError(_0x336195,null));};exports[_0xc8ad('0x47')]=function(_0x4e559e,_0x295599){return db['JscriptyQuestionReport']['create'](_0x4e559e['body'],{})[_0xc8ad('0x26')](respondWithResult(_0x295599,0xc9))[_0xc8ad('0x41')](handleError(_0x295599,null));};exports[_0xc8ad('0x25')]=function(_0x1ffc22,_0x550e3b){if(_0x1ffc22[_0xc8ad('0x48')]['id']){delete _0x1ffc22[_0xc8ad('0x48')]['id'];}return db[_0xc8ad('0x2e')][_0xc8ad('0x46')]({'where':{'id':_0x1ffc22['params']['id']}})[_0xc8ad('0x26')](handleEntityNotFound(_0x550e3b,null))[_0xc8ad('0x26')](saveUpdates(_0x1ffc22[_0xc8ad('0x48')],null))[_0xc8ad('0x26')](respondWithResult(_0x550e3b,null))['catch'](handleError(_0x550e3b,null));};exports[_0xc8ad('0x27')]=function(_0x3bdc47,_0x5961ec){return db['JscriptyQuestionReport']['find']({'where':{'id':_0x3bdc47[_0xc8ad('0x43')]['id']}})['then'](handleEntityNotFound(_0x5961ec,null))[_0xc8ad('0x26')](removeEntity(_0x5961ec,null))['catch'](handleError(_0x5961ec,null));};exports[_0xc8ad('0x49')]=function(_0xc18047,_0x1707fe){return db[_0xc8ad('0x2e')][_0xc8ad('0x49')]()[_0xc8ad('0x26')](respondWithResult(_0x1707fe,null))['catch'](handleError(_0x1707fe,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index b71979c..5b8e2e5 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 _0x5d92=['rimraf','../../config/environment','./jscriptyQuestionReport.attributes','define','JscriptyQuestionReport','report_jscripty_questions','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4e6ae6,_0x49dba6){var _0x23c108=function(_0x1bc103){while(--_0x1bc103){_0x4e6ae6['push'](_0x4e6ae6['shift']());}};_0x23c108(++_0x49dba6);}(_0x5d92,0x14b));var _0x25d9=function(_0x3cd6e9,_0x3d5289){_0x3cd6e9=_0x3cd6e9-0x0;var _0x27d027=_0x5d92[_0x3cd6e9];return _0x27d027;};'use strict';var _=require('lodash');var util=require(_0x25d9('0x0'));var logger=require(_0x25d9('0x1'))(_0x25d9('0x2'));var moment=require(_0x25d9('0x3'));var BPromise=require(_0x25d9('0x4'));var rp=require(_0x25d9('0x5'));var fs=require('fs');var path=require(_0x25d9('0x6'));var rimraf=require(_0x25d9('0x7'));var config=require(_0x25d9('0x8'));var attributes=require(_0x25d9('0x9'));module['exports']=function(_0x4578dc,_0x3f8665){return _0x4578dc[_0x25d9('0xa')](_0x25d9('0xb'),attributes,{'tableName':_0x25d9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x31ed=['define','JscriptyQuestionReport','report_jscripty_questions','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x1ec69d,_0x512291){var _0x545ff0=function(_0xc03324){while(--_0xc03324){_0x1ec69d['push'](_0x1ec69d['shift']());}};_0x545ff0(++_0x512291);}(_0x31ed,0x78));var _0xd31e=function(_0x2be1c6,_0x4345cf){_0x2be1c6=_0x2be1c6-0x0;var _0x42b630=_0x31ed[_0x2be1c6];return _0x42b630;};'use strict';var _=require(_0xd31e('0x0'));var util=require(_0xd31e('0x1'));var logger=require('../../config/logger')(_0xd31e('0x2'));var moment=require(_0xd31e('0x3'));var BPromise=require(_0xd31e('0x4'));var rp=require(_0xd31e('0x5'));var fs=require('fs');var path=require(_0xd31e('0x6'));var rimraf=require(_0xd31e('0x7'));var config=require(_0xd31e('0x8'));var attributes=require('./jscriptyQuestionReport.attributes');module[_0xd31e('0x9')]=function(_0x57e137,_0x326de6){return _0x57e137[_0xd31e('0xa')](_0xd31e('0xb'),attributes,{'tableName':_0xd31e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index cbf16bd..7cb5b2e 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 _0x6d56=['request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s'];(function(_0x4de226,_0xf589ec){var _0x2fb276=function(_0x3f99ed){while(--_0x3f99ed){_0x4de226['push'](_0x4de226['shift']());}};_0x2fb276(++_0xf589ec);}(_0x6d56,0xb9));var _0x66d5=function(_0x2db392,_0x58a130){_0x2db392=_0x2db392-0x0;var _0x30da74=_0x6d56[_0x2db392];return _0x30da74;};'use strict';var _=require(_0x66d5('0x0'));var util=require(_0x66d5('0x1'));var moment=require(_0x66d5('0x2'));var BPromise=require(_0x66d5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x66d5('0x4'));var logger=require(_0x66d5('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x66d5('0x6'));var client=jayson[_0x66d5('0x7')][_0x66d5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5dd71c,_0x1d21b0,_0x35b2ac){return new BPromise(function(_0x4568c0,_0x49fb06){return client[_0x66d5('0x9')](_0x5dd71c,_0x35b2ac)[_0x66d5('0xa')](function(_0x29221d){logger[_0x66d5('0xb')](_0x66d5('0xc'),_0x1d21b0,_0x66d5('0xd'));logger[_0x66d5('0xe')](_0x66d5('0xf'),_0x1d21b0,_0x66d5('0xd'),JSON[_0x66d5('0x10')](_0x29221d));if(_0x29221d[_0x66d5('0x11')]){if(_0x29221d[_0x66d5('0x11')][_0x66d5('0x12')]===0x1f4){logger[_0x66d5('0x11')](_0x66d5('0xc'),_0x1d21b0,_0x29221d[_0x66d5('0x11')][_0x66d5('0x13')]);return _0x49fb06(_0x29221d[_0x66d5('0x11')][_0x66d5('0x13')]);}logger[_0x66d5('0x11')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x1d21b0,_0x29221d[_0x66d5('0x11')]['message']);return _0x4568c0(_0x29221d[_0x66d5('0x11')][_0x66d5('0x13')]);}else{logger['info'](_0x66d5('0xc'),_0x1d21b0,'request\x20sent');_0x4568c0(_0x29221d[_0x66d5('0x14')][_0x66d5('0x13')]);}})[_0x66d5('0x15')](function(_0x4794cc){logger[_0x66d5('0x11')](_0x66d5('0xc'),_0x1d21b0,_0x4794cc);_0x49fb06(_0x4794cc);});});} \ No newline at end of file +var _0x40b9=['JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','JscriptyQuestionReport,\x20%s,\x20%s'];(function(_0x4276aa,_0xbdba9b){var _0x2c49f8=function(_0x2640a4){while(--_0x2640a4){_0x4276aa['push'](_0x4276aa['shift']());}};_0x2c49f8(++_0xbdba9b);}(_0x40b9,0x99));var _0x940b=function(_0x39b710,_0x195461){_0x39b710=_0x39b710-0x0;var _0x1bbfe9=_0x40b9[_0x39b710];return _0x1bbfe9;};'use strict';var _=require(_0x940b('0x0'));var util=require('util');var moment=require(_0x940b('0x1'));var BPromise=require(_0x940b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x940b('0x3'));var db=require(_0x940b('0x4'))['db'];var utils=require(_0x940b('0x5'));var logger=require(_0x940b('0x6'))(_0x940b('0x7'));var config=require(_0x940b('0x8'));var jayson=require(_0x940b('0x9'));var client=jayson[_0x940b('0xa')][_0x940b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4e75c0,_0x418b42,_0x5e8ce1){return new BPromise(function(_0x75059e,_0x560b7e){return client[_0x940b('0xc')](_0x4e75c0,_0x5e8ce1)['then'](function(_0x245a51){logger[_0x940b('0xd')](_0x940b('0xe'),_0x418b42,'request\x20sent');logger['debug'](_0x940b('0xf'),_0x418b42,_0x940b('0x10'),JSON[_0x940b('0x11')](_0x245a51));if(_0x245a51[_0x940b('0x12')]){if(_0x245a51[_0x940b('0x12')]['code']===0x1f4){logger[_0x940b('0x12')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x418b42,_0x245a51[_0x940b('0x12')][_0x940b('0x13')]);return _0x560b7e(_0x245a51[_0x940b('0x12')][_0x940b('0x13')]);}logger['error'](_0x940b('0xe'),_0x418b42,_0x245a51[_0x940b('0x12')][_0x940b('0x13')]);return _0x75059e(_0x245a51['error'][_0x940b('0x13')]);}else{logger[_0x940b('0xd')](_0x940b('0xe'),_0x418b42,'request\x20sent');_0x75059e(_0x245a51['result'][_0x940b('0x13')]);}})[_0x940b('0x14')](function(_0x58f2ae){logger[_0x940b('0x12')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x418b42,_0x58f2ae);_0x560b7e(_0x58f2ae);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index f659b79..f378271 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 _0x7338=['/describe','/:id','show','getQuestions','post','put','update','delete','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get'];(function(_0x17fce8,_0x2c18ec){var _0x53612e=function(_0x3e30f5){while(--_0x3e30f5){_0x17fce8['push'](_0x17fce8['shift']());}};_0x53612e(++_0x2c18ec);}(_0x7338,0x129));var _0x8733=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0x7338[_0x5f309e];return _0x487b5e;};'use strict';var multer=require(_0x8733('0x0'));var util=require(_0x8733('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8733('0x2')]();var fs_extra=require(_0x8733('0x3'));var auth=require(_0x8733('0x4'));var interaction=require(_0x8733('0x5'));var config=require('../../config/environment');var controller=require('./jscriptySessionReport.controller');router['get']('/',auth[_0x8733('0x6')](),controller[_0x8733('0x7')]);router[_0x8733('0x8')](_0x8733('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x8733('0x8')](_0x8733('0xa'),auth['isAuthenticated'](),controller[_0x8733('0xb')]);router['get']('/:id/questions',auth['isAuthenticated'](),controller[_0x8733('0xc')]);router[_0x8733('0xd')]('/',auth[_0x8733('0x6')](),controller['create']);router[_0x8733('0xe')]('/:id',auth[_0x8733('0x6')](),controller[_0x8733('0xf')]);router[_0x8733('0x10')](_0x8733('0xa'),auth[_0x8733('0x6')](),controller['destroy']);module[_0x8733('0x11')]=router; \ No newline at end of file +var _0xba2a=['/describe','isAuthenticated','/:id','show','/:id/questions','getQuestions','post','put','update','delete','destroy','multer','util','fs-extra','../../components/interaction/service','./jscriptySessionReport.controller','index','get'];(function(_0x3311a8,_0x320bfd){var _0x31f079=function(_0x37b33d){while(--_0x37b33d){_0x3311a8['push'](_0x3311a8['shift']());}};_0x31f079(++_0x320bfd);}(_0xba2a,0x13d));var _0xaba2=function(_0x2561e3,_0x54bfae){_0x2561e3=_0x2561e3-0x0;var _0x6da30=_0xba2a[_0x2561e3];return _0x6da30;};'use strict';var multer=require(_0xaba2('0x0'));var util=require(_0xaba2('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xaba2('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xaba2('0x3'));var config=require('../../config/environment');var controller=require(_0xaba2('0x4'));router['get']('/',auth['isAuthenticated'](),controller[_0xaba2('0x5')]);router[_0xaba2('0x6')](_0xaba2('0x7'),auth[_0xaba2('0x8')](),controller['describe']);router[_0xaba2('0x6')](_0xaba2('0x9'),auth[_0xaba2('0x8')](),controller[_0xaba2('0xa')]);router[_0xaba2('0x6')](_0xaba2('0xb'),auth[_0xaba2('0x8')](),controller[_0xaba2('0xc')]);router[_0xaba2('0xd')]('/',auth[_0xaba2('0x8')](),controller['create']);router[_0xaba2('0xe')](_0xaba2('0x9'),auth[_0xaba2('0x8')](),controller[_0xaba2('0xf')]);router[_0xaba2('0x10')](_0xaba2('0x9'),auth['isAuthenticated'](),controller[_0xaba2('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 3d7fcdb..6862951 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 _0xe3da=['sequelize','exports','DATE','setDataValue','starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment'];(function(_0x1e3e56,_0x36e128){var _0x3cc372=function(_0x5f36c6){while(--_0x5f36c6){_0x1e3e56['push'](_0x1e3e56['shift']());}};_0x3cc372(++_0x36e128);}(_0xe3da,0x1cd));var _0xae3d=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xe3da[_0x19950b];return _0x3c6b41;};'use strict';var moment=require(_0xae3d('0x0'));var Sequelize=require(_0xae3d('0x1'));module[_0xae3d('0x2')]={'starttime':{'type':Sequelize[_0xae3d('0x3')],'set':function(_0x2bba92){this[_0xae3d('0x4')](_0xae3d('0x5'),_0x2bba92);this[_0xae3d('0x4')](_0xae3d('0x6'),moment()[_0xae3d('0x7')](_0xae3d('0x8')));}},'endtime':{'type':Sequelize[_0xae3d('0x3')]},'membername':{'type':Sequelize[_0xae3d('0x9')]},'projectname':{'type':Sequelize[_0xae3d('0x9')]},'queue':{'type':Sequelize[_0xae3d('0x9')]},'uniqueid':{'type':Sequelize[_0xae3d('0x9')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xae3d('0x9')]},'completed':{'type':Sequelize[_0xae3d('0xa')],'defaultValue':![]}}; \ No newline at end of file +var _0xffcf=['BOOLEAN','moment','sequelize','exports','DATE','setDataValue','starttime','endtime','format','STRING'];(function(_0x2ab1aa,_0x5a4c13){var _0x16fe66=function(_0x3aa0b7){while(--_0x3aa0b7){_0x2ab1aa['push'](_0x2ab1aa['shift']());}};_0x16fe66(++_0x5a4c13);}(_0xffcf,0x169));var _0xfffc=function(_0x141e03,_0x18340e){_0x141e03=_0x141e03-0x0;var _0x2074e3=_0xffcf[_0x141e03];return _0x2074e3;};'use strict';var moment=require(_0xfffc('0x0'));var Sequelize=require(_0xfffc('0x1'));module[_0xfffc('0x2')]={'starttime':{'type':Sequelize[_0xfffc('0x3')],'set':function(_0x25356d){this[_0xfffc('0x4')](_0xfffc('0x5'),_0x25356d);this['setDataValue'](_0xfffc('0x6'),moment()[_0xfffc('0x7')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0xfffc('0x8')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xfffc('0x8')]},'uniqueid':{'type':Sequelize[_0xfffc('0x8')]},'calleridname':{'type':Sequelize[_0xfffc('0x8')]},'calleridnum':{'type':Sequelize[_0xfffc('0x8')]},'completed':{'type':Sequelize[_0xfffc('0x9')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 668c41f..c0b3488 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 _0x01f2=['save','then','destroy','end','error','stack','name','index','map','JscriptySessionReport','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','update','describe','findOne','JscriptyQuestionReport','hasOwnProperty','SessionId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','apply','reject'];(function(_0x43a6cd,_0x503d1a){var _0x5acb36=function(_0x2dd95e){while(--_0x2dd95e){_0x43a6cd['push'](_0x43a6cd['shift']());}};_0x5acb36(++_0x503d1a);}(_0x01f2,0x170));var _0x201f=function(_0x57fb33,_0xbdf997){_0x57fb33=_0x57fb33-0x0;var _0x2e1d8c=_0x01f2[_0x57fb33];return _0x2e1d8c;};'use strict';var emlformat=require(_0x201f('0x0'));var rimraf=require(_0x201f('0x1'));var zipdir=require(_0x201f('0x2'));var jsonpatch=require(_0x201f('0x3'));var rp=require(_0x201f('0x4'));var moment=require(_0x201f('0x5'));var BPromise=require(_0x201f('0x6'));var Mustache=require(_0x201f('0x7'));var util=require(_0x201f('0x8'));var path=require('path');var sox=require(_0x201f('0x9'));var csv=require(_0x201f('0xa'));var ejs=require(_0x201f('0xb'));var fs=require('fs');var fs_extra=require(_0x201f('0xc'));var _=require(_0x201f('0xd'));var squel=require(_0x201f('0xe'));var crypto=require(_0x201f('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x201f('0x10'));var toCsv=require(_0x201f('0xa'));var querystring=require('querystring');var Papa=require(_0x201f('0x11'));var Redis=require(_0x201f('0x12'));var authService=require(_0x201f('0x13'));var qs=require(_0x201f('0x14'));var as=require(_0x201f('0x15'));var hardwareService=require(_0x201f('0x16'));var logger=require(_0x201f('0x17'))(_0x201f('0x18'));var utils=require(_0x201f('0x19'));var config=require(_0x201f('0x1a'));var licenseUtil=require(_0x201f('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2ff200,_0x226fa2){_0x226fa2=_0x226fa2||0xcc;return function(_0x1dd6aa){if(_0x1dd6aa){return _0x2ff200[_0x201f('0x1c')](_0x226fa2);}return _0x2ff200[_0x201f('0x1d')](_0x226fa2)['end']();};}function respondWithResult(_0x31dd2f,_0x2fc7be){_0x2fc7be=_0x2fc7be||0xc8;return function(_0x491417){if(_0x491417){return _0x31dd2f[_0x201f('0x1d')](_0x2fc7be)[_0x201f('0x1e')](_0x491417);}};}function respondWithFilteredResult(_0xf7f079,_0x39e066){return function(_0xd88b6d){if(_0xd88b6d){var _0x2ce6bb=typeof _0x39e066[_0x201f('0x1f')]===_0x201f('0x20')&&typeof _0x39e066[_0x201f('0x21')]===_0x201f('0x20');var _0x15eb88=_0xd88b6d[_0x201f('0x22')];var _0x57482f=_0x2ce6bb?0x0:_0x39e066['offset'];var _0x7fddc4=_0x2ce6bb?_0xd88b6d[_0x201f('0x22')]:_0x39e066[_0x201f('0x1f')]+_0x39e066['limit'];var _0x479543;if(_0x7fddc4>=_0x15eb88){_0x7fddc4=_0x15eb88;_0x479543=0xc8;}else{_0x479543=0xce;}_0xf7f079['status'](_0x479543);return _0xf7f079['set']('Content-Range',_0x57482f+'-'+_0x7fddc4+'/'+_0x15eb88)[_0x201f('0x1e')](_0xd88b6d);}return null;};}function patchUpdates(_0xdeb782){return function(_0x5971cd){try{jsonpatch[_0x201f('0x23')](_0x5971cd,_0xdeb782,!![]);}catch(_0x26c20b){return BPromise[_0x201f('0x24')](_0x26c20b);}return _0x5971cd[_0x201f('0x25')]();};}function saveUpdates(_0x3e4c83,_0x50393e){return function(_0x58ab52){if(_0x58ab52){return _0x58ab52['update'](_0x3e4c83)[_0x201f('0x26')](function(_0x1a2dfa){return _0x1a2dfa;});}return null;};}function removeEntity(_0x5bc7cc,_0x3e9c4c){return function(_0x37212a){if(_0x37212a){return _0x37212a[_0x201f('0x27')]()[_0x201f('0x26')](function(){_0x5bc7cc[_0x201f('0x1d')](0xcc)[_0x201f('0x28')]();});}};}function handleEntityNotFound(_0x519d7b,_0xe5943d){return function(_0x1b52d1){if(!_0x1b52d1){_0x519d7b[_0x201f('0x1c')](0x194);}return _0x1b52d1;};}function handleError(_0x270bb0,_0x402b97){_0x402b97=_0x402b97||0x1f4;return function(_0x58b7ae){logger[_0x201f('0x29')](_0x58b7ae[_0x201f('0x2a')]);if(_0x58b7ae[_0x201f('0x2b')]){delete _0x58b7ae[_0x201f('0x2b')];}_0x270bb0[_0x201f('0x1d')](_0x402b97)['send'](_0x58b7ae);};}exports[_0x201f('0x2c')]=function(_0xbb0da8,_0x44ce25){var _0x4c8b07={},_0x3f3df1={},_0x16ed01={'count':0x0,'rows':[]};var _0x54dbd8=_[_0x201f('0x2d')](db[_0x201f('0x2e')][_0x201f('0x2f')],function(_0x65fbd7){return{'name':_0x65fbd7['fieldName'],'type':_0x65fbd7['type']['key']};});_0x3f3df1[_0x201f('0x30')]=_[_0x201f('0x2d')](_0x54dbd8,_0x201f('0x2b'));_0x3f3df1[_0x201f('0x31')]=_[_0x201f('0x32')](_0xbb0da8['query']);_0x3f3df1[_0x201f('0x33')]=_[_0x201f('0x34')](_0x3f3df1[_0x201f('0x30')],_0x3f3df1['query']);_0x4c8b07[_0x201f('0x35')]=_['intersection'](_0x3f3df1[_0x201f('0x30')],qs[_0x201f('0x36')](_0xbb0da8['query'][_0x201f('0x36')]));_0x4c8b07[_0x201f('0x35')]=_0x4c8b07[_0x201f('0x35')][_0x201f('0x37')]?_0x4c8b07[_0x201f('0x35')]:_0x3f3df1[_0x201f('0x30')];if(!_0xbb0da8[_0x201f('0x31')]['hasOwnProperty'](_0x201f('0x38'))){_0x4c8b07[_0x201f('0x21')]=qs[_0x201f('0x21')](_0xbb0da8['query'][_0x201f('0x21')]);_0x4c8b07[_0x201f('0x1f')]=qs[_0x201f('0x1f')](_0xbb0da8[_0x201f('0x31')][_0x201f('0x1f')]);}_0x4c8b07[_0x201f('0x39')]=qs[_0x201f('0x3a')](_0xbb0da8[_0x201f('0x31')][_0x201f('0x3a')]);_0x4c8b07[_0x201f('0x3b')]=qs[_0x201f('0x33')](_[_0x201f('0x3c')](_0xbb0da8[_0x201f('0x31')],_0x3f3df1[_0x201f('0x33')]),_0x54dbd8);if(_0xbb0da8[_0x201f('0x31')][_0x201f('0x3d')]){_0x4c8b07[_0x201f('0x3b')]=_[_0x201f('0x3e')](_0x4c8b07[_0x201f('0x3b')],{'$or':_[_0x201f('0x2d')](_0x54dbd8,function(_0x5b798c){if(_0x5b798c[_0x201f('0x3f')]!==_0x201f('0x40')){var _0x48ea1d={};_0x48ea1d[_0x5b798c[_0x201f('0x2b')]]={'$like':'%'+_0xbb0da8['query'][_0x201f('0x3d')]+'%'};return _0x48ea1d;}})});}_0x4c8b07=_[_0x201f('0x3e')]({},_0x4c8b07,_0xbb0da8[_0x201f('0x41')]);var _0x2e19e0={'where':_0x4c8b07['where']};return db['JscriptySessionReport']['count'](_0x2e19e0)['then'](function(_0xafec8a){_0x16ed01['count']=_0xafec8a;if(_0xbb0da8['query'][_0x201f('0x42')]){_0x4c8b07[_0x201f('0x43')]=[{'all':!![]}];}return db[_0x201f('0x2e')][_0x201f('0x44')](_0x4c8b07);})[_0x201f('0x26')](function(_0x597736){_0x16ed01['rows']=_0x597736;return _0x16ed01;})['then'](respondWithFilteredResult(_0x44ce25,_0x4c8b07))[_0x201f('0x45')](handleError(_0x44ce25,null));};exports[_0x201f('0x46')]=function(_0x119ffd,_0x59cd5c){var _0x503c27={'raw':!![],'where':{'id':_0x119ffd[_0x201f('0x47')]['id']}},_0x3b4c2={};_0x3b4c2[_0x201f('0x30')]=_[_0x201f('0x32')](db[_0x201f('0x2e')]['rawAttributes']);_0x3b4c2[_0x201f('0x31')]=_['keys'](_0x119ffd['query']);_0x3b4c2[_0x201f('0x33')]=_[_0x201f('0x34')](_0x3b4c2['model'],_0x3b4c2[_0x201f('0x31')]);_0x503c27[_0x201f('0x35')]=_['intersection'](_0x3b4c2[_0x201f('0x30')],qs[_0x201f('0x36')](_0x119ffd[_0x201f('0x31')][_0x201f('0x36')]));_0x503c27[_0x201f('0x35')]=_0x503c27[_0x201f('0x35')][_0x201f('0x37')]?_0x503c27['attributes']:_0x3b4c2[_0x201f('0x30')];if(_0x119ffd['query'][_0x201f('0x42')]){_0x503c27[_0x201f('0x43')]=[{'all':!![]}];}_0x503c27=_[_0x201f('0x3e')]({},_0x503c27,_0x119ffd[_0x201f('0x41')]);return db['JscriptySessionReport'][_0x201f('0x48')](_0x503c27)[_0x201f('0x26')](handleEntityNotFound(_0x59cd5c,null))['then'](respondWithResult(_0x59cd5c,null))['catch'](handleError(_0x59cd5c,null));};exports[_0x201f('0x49')]=function(_0x466e01,_0xad8c85){return db[_0x201f('0x2e')][_0x201f('0x49')](_0x466e01[_0x201f('0x4a')],{})[_0x201f('0x26')](respondWithResult(_0xad8c85,0xc9))[_0x201f('0x45')](handleError(_0xad8c85,null));};exports[_0x201f('0x4b')]=function(_0x47802d,_0x41407c){if(_0x47802d[_0x201f('0x4a')]['id']){delete _0x47802d['body']['id'];}return db[_0x201f('0x2e')][_0x201f('0x48')]({'where':{'id':_0x47802d[_0x201f('0x47')]['id']}})[_0x201f('0x26')](handleEntityNotFound(_0x41407c,null))[_0x201f('0x26')](saveUpdates(_0x47802d['body'],null))['then'](respondWithResult(_0x41407c,null))[_0x201f('0x45')](handleError(_0x41407c,null));};exports['destroy']=function(_0x2c54d3,_0xfebf26){return db[_0x201f('0x2e')][_0x201f('0x48')]({'where':{'id':_0x2c54d3[_0x201f('0x47')]['id']}})[_0x201f('0x26')](handleEntityNotFound(_0xfebf26,null))[_0x201f('0x26')](removeEntity(_0xfebf26,null))[_0x201f('0x45')](handleError(_0xfebf26,null));};exports[_0x201f('0x4c')]=function(_0xe93050,_0x17365d){return db[_0x201f('0x2e')]['describe']()['then'](respondWithResult(_0x17365d,null))[_0x201f('0x45')](handleError(_0x17365d,null));};exports['getQuestions']=function(_0x4ffe27,_0x438cfb,_0x4f21bf){var _0x11ccda={'raw':!![],'where':{}};var _0x426f4e={};var _0xc0fb91={'count':0x0,'rows':[]};return db[_0x201f('0x2e')][_0x201f('0x4d')]({'where':{'id':_0x4ffe27[_0x201f('0x47')]['id']}})[_0x201f('0x26')](handleEntityNotFound(_0x438cfb,null))['then'](function(_0x1b0edd){if(_0x1b0edd){_0x426f4e['model']=_['keys'](db[_0x201f('0x4e')][_0x201f('0x2f')]);_0x426f4e[_0x201f('0x31')]=_[_0x201f('0x32')](_0x4ffe27['query']);_0x426f4e[_0x201f('0x33')]=_[_0x201f('0x34')](_0x426f4e[_0x201f('0x30')],_0x426f4e[_0x201f('0x31')]);_0x11ccda['attributes']=_[_0x201f('0x34')](_0x426f4e[_0x201f('0x30')],qs[_0x201f('0x36')](_0x4ffe27['query'][_0x201f('0x36')]));_0x11ccda[_0x201f('0x35')]=_0x11ccda[_0x201f('0x35')]['length']?_0x11ccda[_0x201f('0x35')]:_0x426f4e[_0x201f('0x30')];if(!_0x4ffe27[_0x201f('0x31')][_0x201f('0x4f')](_0x201f('0x38'))){_0x11ccda['limit']=qs['limit'](_0x4ffe27[_0x201f('0x31')][_0x201f('0x21')]);_0x11ccda[_0x201f('0x1f')]=qs['offset'](_0x4ffe27['query'][_0x201f('0x1f')]);}_0x11ccda[_0x201f('0x39')]=qs[_0x201f('0x3a')](_0x4ffe27[_0x201f('0x31')][_0x201f('0x3a')]);_0x11ccda[_0x201f('0x3b')]=qs[_0x201f('0x33')](_[_0x201f('0x3c')](_0x4ffe27['query'],_0x426f4e[_0x201f('0x33')]));_0x11ccda[_0x201f('0x3b')][_0x201f('0x50')]=_0x1b0edd['id'];if(_0x4ffe27['query'][_0x201f('0x3d')]){_0x11ccda[_0x201f('0x3b')]=_['merge'](_0x11ccda[_0x201f('0x3b')],{'$or':_[_0x201f('0x2d')](_0x11ccda[_0x201f('0x35')],function(_0x2e6843){var _0x44e622={};_0x44e622[_0x2e6843]={'$like':'%'+_0x4ffe27[_0x201f('0x31')][_0x201f('0x3d')]+'%'};return _0x44e622;})});}_0x11ccda=_[_0x201f('0x3e')]({},_0x11ccda,_0x4ffe27[_0x201f('0x41')]);return db[_0x201f('0x4e')][_0x201f('0x22')]({'where':_0x11ccda[_0x201f('0x3b')]})[_0x201f('0x26')](function(_0x3130d1){_0xc0fb91[_0x201f('0x22')]=_0x3130d1;if(_0x4ffe27[_0x201f('0x31')][_0x201f('0x42')]){_0x11ccda['include']=[{'all':!![]}];}return db[_0x201f('0x4e')][_0x201f('0x44')](_0x11ccda);})[_0x201f('0x26')](function(_0x5139a0){_0xc0fb91['rows']=_0x5139a0;return _0xc0fb91;});}})['then'](respondWithFilteredResult(_0x438cfb,_0x11ccda))[_0x201f('0x45')](handleError(_0x438cfb,null));}; \ No newline at end of file +var _0x2a7a=['key','query','keys','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','include','findAll','rows','includeAll','find','catch','create','body','update','params','describe','getQuestions','findOne','JscriptyQuestionReport','SessionId','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','then','destroy','error','name','send','index','JscriptySessionReport','rawAttributes','fieldName','type'];(function(_0x50bdcb,_0x148ed3){var _0x241039=function(_0x15df12){while(--_0x15df12){_0x50bdcb['push'](_0x50bdcb['shift']());}};_0x241039(++_0x148ed3);}(_0x2a7a,0x118));var _0xa2a7=function(_0x112e7a,_0x2c515f){_0x112e7a=_0x112e7a-0x0;var _0x245e87=_0x2a7a[_0x112e7a];return _0x245e87;};'use strict';var emlformat=require(_0xa2a7('0x0'));var rimraf=require(_0xa2a7('0x1'));var zipdir=require(_0xa2a7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa2a7('0x3'));var moment=require(_0xa2a7('0x4'));var BPromise=require(_0xa2a7('0x5'));var Mustache=require(_0xa2a7('0x6'));var util=require(_0xa2a7('0x7'));var path=require(_0xa2a7('0x8'));var sox=require(_0xa2a7('0x9'));var csv=require(_0xa2a7('0xa'));var ejs=require(_0xa2a7('0xb'));var fs=require('fs');var fs_extra=require(_0xa2a7('0xc'));var _=require('lodash');var squel=require(_0xa2a7('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa2a7('0xe'));var toCsv=require(_0xa2a7('0xa'));var querystring=require(_0xa2a7('0xf'));var Papa=require(_0xa2a7('0x10'));var Redis=require(_0xa2a7('0x11'));var authService=require(_0xa2a7('0x12'));var qs=require(_0xa2a7('0x13'));var as=require(_0xa2a7('0x14'));var hardwareService=require(_0xa2a7('0x15'));var logger=require(_0xa2a7('0x16'))('api');var utils=require(_0xa2a7('0x17'));var config=require(_0xa2a7('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xa2a7('0x19'))['db'];function respondWithStatusCode(_0x3d24b5,_0xbf4857){_0xbf4857=_0xbf4857||0xcc;return function(_0x25f011){if(_0x25f011){return _0x3d24b5[_0xa2a7('0x1a')](_0xbf4857);}return _0x3d24b5['status'](_0xbf4857)[_0xa2a7('0x1b')]();};}function respondWithResult(_0x171c4e,_0x22192d){_0x22192d=_0x22192d||0xc8;return function(_0x78013e){if(_0x78013e){return _0x171c4e[_0xa2a7('0x1c')](_0x22192d)[_0xa2a7('0x1d')](_0x78013e);}};}function respondWithFilteredResult(_0x43238c,_0x16c8e7){return function(_0x1139d7){if(_0x1139d7){var _0x9550d6=typeof _0x16c8e7[_0xa2a7('0x1e')]===_0xa2a7('0x1f')&&typeof _0x16c8e7['limit']===_0xa2a7('0x1f');var _0x29cfc1=_0x1139d7[_0xa2a7('0x20')];var _0x94355c=_0x9550d6?0x0:_0x16c8e7['offset'];var _0x4697d4=_0x9550d6?_0x1139d7[_0xa2a7('0x20')]:_0x16c8e7[_0xa2a7('0x1e')]+_0x16c8e7[_0xa2a7('0x21')];var _0x4c8af2;if(_0x4697d4>=_0x29cfc1){_0x4697d4=_0x29cfc1;_0x4c8af2=0xc8;}else{_0x4c8af2=0xce;}_0x43238c[_0xa2a7('0x1c')](_0x4c8af2);return _0x43238c['set'](_0xa2a7('0x22'),_0x94355c+'-'+_0x4697d4+'/'+_0x29cfc1)['json'](_0x1139d7);}return null;};}function patchUpdates(_0x47b066){return function(_0x9f578e){try{jsonpatch[_0xa2a7('0x23')](_0x9f578e,_0x47b066,!![]);}catch(_0x51dd52){return BPromise[_0xa2a7('0x24')](_0x51dd52);}return _0x9f578e[_0xa2a7('0x25')]();};}function saveUpdates(_0x114dd9,_0x1d7a7d){return function(_0x353c2a){if(_0x353c2a){return _0x353c2a['update'](_0x114dd9)[_0xa2a7('0x26')](function(_0x4e2fe7){return _0x4e2fe7;});}return null;};}function removeEntity(_0x2292dd,_0x25e6e0){return function(_0x16d3ef){if(_0x16d3ef){return _0x16d3ef[_0xa2a7('0x27')]()['then'](function(){_0x2292dd[_0xa2a7('0x1c')](0xcc)[_0xa2a7('0x1b')]();});}};}function handleEntityNotFound(_0x308045,_0x21e2ff){return function(_0x56e44b){if(!_0x56e44b){_0x308045['sendStatus'](0x194);}return _0x56e44b;};}function handleError(_0x28fef8,_0x598b6c){_0x598b6c=_0x598b6c||0x1f4;return function(_0x8ef702){logger[_0xa2a7('0x28')](_0x8ef702['stack']);if(_0x8ef702[_0xa2a7('0x29')]){delete _0x8ef702[_0xa2a7('0x29')];}_0x28fef8[_0xa2a7('0x1c')](_0x598b6c)[_0xa2a7('0x2a')](_0x8ef702);};}exports[_0xa2a7('0x2b')]=function(_0x324ae5,_0x155624){var _0x40a88b={},_0x430b5a={},_0xda49d3={'count':0x0,'rows':[]};var _0x9483ad=_['map'](db[_0xa2a7('0x2c')][_0xa2a7('0x2d')],function(_0x3fbbbc){return{'name':_0x3fbbbc[_0xa2a7('0x2e')],'type':_0x3fbbbc[_0xa2a7('0x2f')][_0xa2a7('0x30')]};});_0x430b5a['model']=_['map'](_0x9483ad,'name');_0x430b5a[_0xa2a7('0x31')]=_[_0xa2a7('0x32')](_0x324ae5['query']);_0x430b5a[_0xa2a7('0x33')]=_['intersection'](_0x430b5a[_0xa2a7('0x34')],_0x430b5a[_0xa2a7('0x31')]);_0x40a88b['attributes']=_[_0xa2a7('0x35')](_0x430b5a[_0xa2a7('0x34')],qs[_0xa2a7('0x36')](_0x324ae5[_0xa2a7('0x31')]['fields']));_0x40a88b['attributes']=_0x40a88b[_0xa2a7('0x37')][_0xa2a7('0x38')]?_0x40a88b[_0xa2a7('0x37')]:_0x430b5a[_0xa2a7('0x34')];if(!_0x324ae5[_0xa2a7('0x31')][_0xa2a7('0x39')](_0xa2a7('0x3a'))){_0x40a88b[_0xa2a7('0x21')]=qs[_0xa2a7('0x21')](_0x324ae5[_0xa2a7('0x31')][_0xa2a7('0x21')]);_0x40a88b['offset']=qs[_0xa2a7('0x1e')](_0x324ae5['query'][_0xa2a7('0x1e')]);}_0x40a88b[_0xa2a7('0x3b')]=qs[_0xa2a7('0x3c')](_0x324ae5[_0xa2a7('0x31')][_0xa2a7('0x3c')]);_0x40a88b[_0xa2a7('0x3d')]=qs[_0xa2a7('0x33')](_[_0xa2a7('0x3e')](_0x324ae5[_0xa2a7('0x31')],_0x430b5a[_0xa2a7('0x33')]),_0x9483ad);if(_0x324ae5[_0xa2a7('0x31')][_0xa2a7('0x3f')]){_0x40a88b['where']=_[_0xa2a7('0x40')](_0x40a88b[_0xa2a7('0x3d')],{'$or':_[_0xa2a7('0x41')](_0x9483ad,function(_0x4c7bb7){if(_0x4c7bb7[_0xa2a7('0x2f')]!==_0xa2a7('0x42')){var _0x4a6784={};_0x4a6784[_0x4c7bb7[_0xa2a7('0x29')]]={'$like':'%'+_0x324ae5['query']['filter']+'%'};return _0x4a6784;}})});}_0x40a88b=_[_0xa2a7('0x40')]({},_0x40a88b,_0x324ae5['options']);var _0x3fa6a0={'where':_0x40a88b[_0xa2a7('0x3d')]};return db[_0xa2a7('0x2c')][_0xa2a7('0x20')](_0x3fa6a0)[_0xa2a7('0x26')](function(_0x4c648b){_0xda49d3['count']=_0x4c648b;if(_0x324ae5[_0xa2a7('0x31')]['includeAll']){_0x40a88b[_0xa2a7('0x43')]=[{'all':!![]}];}return db[_0xa2a7('0x2c')][_0xa2a7('0x44')](_0x40a88b);})[_0xa2a7('0x26')](function(_0x2db41a){_0xda49d3[_0xa2a7('0x45')]=_0x2db41a;return _0xda49d3;})[_0xa2a7('0x26')](respondWithFilteredResult(_0x155624,_0x40a88b))['catch'](handleError(_0x155624,null));};exports['show']=function(_0x45f099,_0x387fb9){var _0x2c5edc={'raw':!![],'where':{'id':_0x45f099['params']['id']}},_0x4b3fac={};_0x4b3fac[_0xa2a7('0x34')]=_['keys'](db['JscriptySessionReport'][_0xa2a7('0x2d')]);_0x4b3fac[_0xa2a7('0x31')]=_[_0xa2a7('0x32')](_0x45f099[_0xa2a7('0x31')]);_0x4b3fac[_0xa2a7('0x33')]=_[_0xa2a7('0x35')](_0x4b3fac[_0xa2a7('0x34')],_0x4b3fac[_0xa2a7('0x31')]);_0x2c5edc[_0xa2a7('0x37')]=_[_0xa2a7('0x35')](_0x4b3fac['model'],qs[_0xa2a7('0x36')](_0x45f099[_0xa2a7('0x31')][_0xa2a7('0x36')]));_0x2c5edc[_0xa2a7('0x37')]=_0x2c5edc[_0xa2a7('0x37')][_0xa2a7('0x38')]?_0x2c5edc['attributes']:_0x4b3fac[_0xa2a7('0x34')];if(_0x45f099['query'][_0xa2a7('0x46')]){_0x2c5edc[_0xa2a7('0x43')]=[{'all':!![]}];}_0x2c5edc=_[_0xa2a7('0x40')]({},_0x2c5edc,_0x45f099['options']);return db[_0xa2a7('0x2c')][_0xa2a7('0x47')](_0x2c5edc)[_0xa2a7('0x26')](handleEntityNotFound(_0x387fb9,null))['then'](respondWithResult(_0x387fb9,null))[_0xa2a7('0x48')](handleError(_0x387fb9,null));};exports[_0xa2a7('0x49')]=function(_0x4fa6af,_0x4cb776){return db['JscriptySessionReport'][_0xa2a7('0x49')](_0x4fa6af[_0xa2a7('0x4a')],{})[_0xa2a7('0x26')](respondWithResult(_0x4cb776,0xc9))[_0xa2a7('0x48')](handleError(_0x4cb776,null));};exports[_0xa2a7('0x4b')]=function(_0x287f71,_0x1216c3){if(_0x287f71[_0xa2a7('0x4a')]['id']){delete _0x287f71[_0xa2a7('0x4a')]['id'];}return db[_0xa2a7('0x2c')][_0xa2a7('0x47')]({'where':{'id':_0x287f71[_0xa2a7('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1216c3,null))['then'](saveUpdates(_0x287f71[_0xa2a7('0x4a')],null))[_0xa2a7('0x26')](respondWithResult(_0x1216c3,null))[_0xa2a7('0x48')](handleError(_0x1216c3,null));};exports[_0xa2a7('0x27')]=function(_0x1dec8c,_0x15c2b3){return db[_0xa2a7('0x2c')][_0xa2a7('0x47')]({'where':{'id':_0x1dec8c['params']['id']}})[_0xa2a7('0x26')](handleEntityNotFound(_0x15c2b3,null))['then'](removeEntity(_0x15c2b3,null))[_0xa2a7('0x48')](handleError(_0x15c2b3,null));};exports[_0xa2a7('0x4d')]=function(_0x47b025,_0xb44929){return db[_0xa2a7('0x2c')][_0xa2a7('0x4d')]()[_0xa2a7('0x26')](respondWithResult(_0xb44929,null))[_0xa2a7('0x48')](handleError(_0xb44929,null));};exports[_0xa2a7('0x4e')]=function(_0xe5ab2b,_0x2afd3b,_0x1bfaf2){var _0x3ba0f8={'raw':!![],'where':{}};var _0x4fcc91={};var _0x3b14bc={'count':0x0,'rows':[]};return db[_0xa2a7('0x2c')][_0xa2a7('0x4f')]({'where':{'id':_0xe5ab2b[_0xa2a7('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2afd3b,null))[_0xa2a7('0x26')](function(_0x374fb6){if(_0x374fb6){_0x4fcc91[_0xa2a7('0x34')]=_[_0xa2a7('0x32')](db[_0xa2a7('0x50')][_0xa2a7('0x2d')]);_0x4fcc91[_0xa2a7('0x31')]=_[_0xa2a7('0x32')](_0xe5ab2b['query']);_0x4fcc91['filters']=_[_0xa2a7('0x35')](_0x4fcc91[_0xa2a7('0x34')],_0x4fcc91[_0xa2a7('0x31')]);_0x3ba0f8[_0xa2a7('0x37')]=_[_0xa2a7('0x35')](_0x4fcc91['model'],qs[_0xa2a7('0x36')](_0xe5ab2b[_0xa2a7('0x31')][_0xa2a7('0x36')]));_0x3ba0f8[_0xa2a7('0x37')]=_0x3ba0f8[_0xa2a7('0x37')]['length']?_0x3ba0f8[_0xa2a7('0x37')]:_0x4fcc91[_0xa2a7('0x34')];if(!_0xe5ab2b[_0xa2a7('0x31')][_0xa2a7('0x39')]('nolimit')){_0x3ba0f8[_0xa2a7('0x21')]=qs['limit'](_0xe5ab2b[_0xa2a7('0x31')]['limit']);_0x3ba0f8[_0xa2a7('0x1e')]=qs['offset'](_0xe5ab2b[_0xa2a7('0x31')][_0xa2a7('0x1e')]);}_0x3ba0f8[_0xa2a7('0x3b')]=qs[_0xa2a7('0x3c')](_0xe5ab2b[_0xa2a7('0x31')][_0xa2a7('0x3c')]);_0x3ba0f8['where']=qs[_0xa2a7('0x33')](_[_0xa2a7('0x3e')](_0xe5ab2b['query'],_0x4fcc91[_0xa2a7('0x33')]));_0x3ba0f8[_0xa2a7('0x3d')][_0xa2a7('0x51')]=_0x374fb6['id'];if(_0xe5ab2b[_0xa2a7('0x31')][_0xa2a7('0x3f')]){_0x3ba0f8['where']=_[_0xa2a7('0x40')](_0x3ba0f8[_0xa2a7('0x3d')],{'$or':_[_0xa2a7('0x41')](_0x3ba0f8[_0xa2a7('0x37')],function(_0x232cd4){var _0x4dd6d9={};_0x4dd6d9[_0x232cd4]={'$like':'%'+_0xe5ab2b['query'][_0xa2a7('0x3f')]+'%'};return _0x4dd6d9;})});}_0x3ba0f8=_[_0xa2a7('0x40')]({},_0x3ba0f8,_0xe5ab2b['options']);return db['JscriptyQuestionReport']['count']({'where':_0x3ba0f8['where']})['then'](function(_0x829878){_0x3b14bc[_0xa2a7('0x20')]=_0x829878;if(_0xe5ab2b['query'][_0xa2a7('0x46')]){_0x3ba0f8['include']=[{'all':!![]}];}return db[_0xa2a7('0x50')][_0xa2a7('0x44')](_0x3ba0f8);})['then'](function(_0x5a1c18){_0x3b14bc[_0xa2a7('0x45')]=_0x5a1c18;return _0x3b14bc;});}})[_0xa2a7('0x26')](respondWithFilteredResult(_0x2afd3b,_0x3ba0f8))[_0xa2a7('0x48')](handleError(_0x2afd3b,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index bbb7910..d69df7b 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 _0xba34=['rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','report_jscripty_sessions','lodash','util','../../config/logger','api','moment'];(function(_0x2baca1,_0x2f3557){var _0x9aa62a=function(_0x5c47d5){while(--_0x5c47d5){_0x2baca1['push'](_0x2baca1['shift']());}};_0x9aa62a(++_0x2f3557);}(_0xba34,0x119));var _0x4ba3=function(_0x3c927f,_0x194311){_0x3c927f=_0x3c927f-0x0;var _0x2f125f=_0xba34[_0x3c927f];return _0x2f125f;};'use strict';var _=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var logger=require(_0x4ba3('0x2'))(_0x4ba3('0x3'));var moment=require(_0x4ba3('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4ba3('0x5'));var config=require(_0x4ba3('0x6'));var attributes=require(_0x4ba3('0x7'));module[_0x4ba3('0x8')]=function(_0x3590a1,_0xb88621){return _0x3590a1[_0x4ba3('0x9')]('JscriptySessionReport',attributes,{'tableName':_0x4ba3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xabce=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','define','report_jscripty_sessions','lodash'];(function(_0x49d3f2,_0x3c573c){var _0x5b0554=function(_0x149c28){while(--_0x149c28){_0x49d3f2['push'](_0x49d3f2['shift']());}};_0x5b0554(++_0x3c573c);}(_0xabce,0x103));var _0xeabc=function(_0x397cfb,_0xb8f317){_0x397cfb=_0x397cfb-0x0;var _0x15fed9=_0xabce[_0x397cfb];return _0x15fed9;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var logger=require(_0xeabc('0x2'))(_0xeabc('0x3'));var moment=require(_0xeabc('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeabc('0x5'));var rimraf=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var attributes=require('./jscriptySessionReport.attributes');module['exports']=function(_0x1b07a8,_0x52a4d7){return _0x1b07a8[_0xeabc('0x8')]('JscriptySessionReport',attributes,{'tableName':_0xeabc('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 d1ed7fe..1c93885 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 _0x4975=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0x4975,0x86));var _0x5497=function(_0x45e628,_0x46a2a7){_0x45e628=_0x45e628-0x0;var _0x3b7d14=_0x4975[_0x45e628];return _0x3b7d14;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f563d,_0x1d0019,_0x674a2a){return new BPromise(function(_0x368e8b,_0x57f930){return client[_0x5497('0xc')](_0x4f563d,_0x674a2a)['then'](function(_0x1f63d8){logger[_0x5497('0xd')](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));logger[_0x5497('0x10')](_0x5497('0x11'),_0x1d0019,_0x5497('0xf'),JSON[_0x5497('0x12')](_0x1f63d8));if(_0x1f63d8['error']){if(_0x1f63d8['error']['code']===0x1f4){logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x57f930(_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);}logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x368e8b(_0x1f63d8['error'][_0x5497('0x14')]);}else{logger['info'](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));_0x368e8b(_0x1f63d8[_0x5497('0x15')][_0x5497('0x14')]);}})[_0x5497('0x16')](function(_0x4073e6){logger[_0x5497('0x13')]('JscriptySessionReport,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});} \ No newline at end of file +var _0xafb9=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash'];(function(_0x16ca40,_0x3f642e){var _0x1037a8=function(_0x29263f){while(--_0x29263f){_0x16ca40['push'](_0x16ca40['shift']());}};_0x1037a8(++_0x3f642e);}(_0xafb9,0x68));var _0x9afb=function(_0x2fd391,_0x43d155){_0x2fd391=_0x2fd391-0x0;var _0x544161=_0xafb9[_0x2fd391];return _0x544161;};'use strict';var _=require(_0x9afb('0x0'));var util=require(_0x9afb('0x1'));var moment=require(_0x9afb('0x2'));var BPromise=require(_0x9afb('0x3'));var rs=require(_0x9afb('0x4'));var fs=require('fs');var Redis=require(_0x9afb('0x5'));var db=require(_0x9afb('0x6'))['db'];var utils=require(_0x9afb('0x7'));var logger=require(_0x9afb('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9afb('0x9'));var client=jayson['client'][_0x9afb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x548b24,_0x556880,_0x4c0e9d){return new BPromise(function(_0x1edf77,_0x20b8c1){return client['request'](_0x548b24,_0x4c0e9d)[_0x9afb('0xb')](function(_0x3e0264){logger[_0x9afb('0xc')](_0x9afb('0xd'),_0x556880,_0x9afb('0xe'));logger['debug']('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x556880,_0x9afb('0xe'),JSON[_0x9afb('0xf')](_0x3e0264));if(_0x3e0264[_0x9afb('0x10')]){if(_0x3e0264[_0x9afb('0x10')][_0x9afb('0x11')]===0x1f4){logger[_0x9afb('0x10')](_0x9afb('0xd'),_0x556880,_0x3e0264[_0x9afb('0x10')][_0x9afb('0x12')]);return _0x20b8c1(_0x3e0264[_0x9afb('0x10')]['message']);}logger[_0x9afb('0x10')]('JscriptySessionReport,\x20%s,\x20%s',_0x556880,_0x3e0264['error'][_0x9afb('0x12')]);return _0x1edf77(_0x3e0264[_0x9afb('0x10')][_0x9afb('0x12')]);}else{logger[_0x9afb('0xc')](_0x9afb('0xd'),_0x556880,_0x9afb('0xe'));_0x1edf77(_0x3e0264[_0x9afb('0x13')]['message']);}})[_0x9afb('0x14')](function(_0x2145c2){logger[_0x9afb('0x10')](_0x9afb('0xd'),_0x556880,_0x2145c2);_0x20b8c1(_0x2145c2);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 31d4212..a5ebaa3 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 _0x8e7a=['get','index','put','isAuthenticated','update','/download_log_file','downloadLogFile','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./license.controller'];(function(_0xe3f93d,_0x8e7641){var _0x2ad7f6=function(_0x5b3606){while(--_0x5b3606){_0xe3f93d['push'](_0xe3f93d['shift']());}};_0x2ad7f6(++_0x8e7641);}(_0x8e7a,0x7f));var _0xa8e7=function(_0x1cfcd9,_0x8f2d7c){_0x1cfcd9=_0x1cfcd9-0x0;var _0x4df964=_0x8e7a[_0x1cfcd9];return _0x4df964;};'use strict';var multer=require('multer');var util=require(_0xa8e7('0x0'));var path=require(_0xa8e7('0x1'));var timeout=require(_0xa8e7('0x2'));var express=require(_0xa8e7('0x3'));var router=express[_0xa8e7('0x4')]();var fs_extra=require(_0xa8e7('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa8e7('0x6'));var config=require(_0xa8e7('0x7'));var controller=require(_0xa8e7('0x8'));router[_0xa8e7('0x9')]('/',controller[_0xa8e7('0xa')]);router[_0xa8e7('0xb')]('/:id',auth[_0xa8e7('0xc')](),controller[_0xa8e7('0xd')]);router[_0xa8e7('0x9')](_0xa8e7('0xe'),auth[_0xa8e7('0xc')](),controller[_0xa8e7('0xf')]);module[_0xa8e7('0x10')]=router; \ No newline at end of file +var _0x0995=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','update','downloadLogFile','exports','multer','util'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x0995,0x1cc));var _0x5099=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0995[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x5099('0x0'));var util=require(_0x5099('0x1'));var path=require('path');var timeout=require(_0x5099('0x2'));var express=require(_0x5099('0x3'));var router=express[_0x5099('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5099('0x5'));var interaction=require(_0x5099('0x6'));var config=require(_0x5099('0x7'));var controller=require('./license.controller');router[_0x5099('0x8')]('/',controller['index']);router['put'](_0x5099('0x9'),auth[_0x5099('0xa')](),controller[_0x5099('0xb')]);router[_0x5099('0x8')]('/download_log_file',auth[_0x5099('0xa')](),controller[_0x5099('0xc')]);module[_0x5099('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 195b6f1..19e3184 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 _0xf2bb=['sequelize','TEXT','STRING','INTEGER'];(function(_0x53bbcb,_0x33f004){var _0x4abaf8=function(_0x96bec8){while(--_0x96bec8){_0x53bbcb['push'](_0x53bbcb['shift']());}};_0x4abaf8(++_0x33f004);}(_0xf2bb,0x7c));var _0xbf2b=function(_0x28611e,_0x586726){_0x28611e=_0x28611e-0x0;var _0x530f69=_0xf2bb[_0x28611e];return _0x530f69;};'use strict';var Sequelize=require(_0xbf2b('0x0'));module['exports']={'license':{'type':Sequelize[_0xbf2b('0x1')]},'data1':{'type':Sequelize[_0xbf2b('0x2')]},'data2':{'type':Sequelize[_0xbf2b('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0xbf2b('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xf409=['TEXT','STRING','sequelize','exports'];(function(_0x9074e0,_0xa18935){var _0x31e3d6=function(_0x23c7c7){while(--_0x23c7c7){_0x9074e0['push'](_0x9074e0['shift']());}};_0x31e3d6(++_0xa18935);}(_0xf409,0xaa));var _0x9f40=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0xf409[_0x2dea24];return _0x309d58;};'use strict';var Sequelize=require(_0x9f40('0x0'));module[_0x9f40('0x1')]={'license':{'type':Sequelize[_0x9f40('0x2')]},'data1':{'type':Sequelize[_0x9f40('0x3')]},'data2':{'type':Sequelize[_0x9f40('0x3')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index 99f4cdf..446b58e 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 _0xe09b=['index','keys','License','rawAttributes','query','filters','intersection','model','attributes','fields','merge','options','then','catch','body','find','params','get','checkLicense','key','demo','downloadLogFile','license-info.log','xcally','setHeader','attachment;\x20filename=','Content-Type','download','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','destroy','end','sendStatus','error','stack','name'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xe09b,0x170));var _0xbe09=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe09b[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbe09('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbe09('0x1'));var rp=require(_0xbe09('0x2'));var moment=require(_0xbe09('0x3'));var BPromise=require(_0xbe09('0x4'));var Mustache=require(_0xbe09('0x5'));var util=require(_0xbe09('0x6'));var path=require(_0xbe09('0x7'));var sox=require(_0xbe09('0x8'));var csv=require(_0xbe09('0x9'));var ejs=require(_0xbe09('0xa'));var fs=require('fs');var fs_extra=require(_0xbe09('0xb'));var _=require(_0xbe09('0xc'));var squel=require(_0xbe09('0xd'));var crypto=require('crypto');var jsforce=require(_0xbe09('0xe'));var deskjs=require(_0xbe09('0xf'));var toCsv=require(_0xbe09('0x9'));var querystring=require(_0xbe09('0x10'));var Papa=require('papaparse');var Redis=require(_0xbe09('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xbe09('0x12'));var hardwareService=require(_0xbe09('0x13'));var logger=require(_0xbe09('0x14'))(_0xbe09('0x15'));var utils=require(_0xbe09('0x16'));var config=require(_0xbe09('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3a5fe7,_0x5bbf8f){_0x5bbf8f=_0x5bbf8f||0xcc;return function(_0x43472f){if(_0x43472f){return _0x3a5fe7['sendStatus'](_0x5bbf8f);}return _0x3a5fe7[_0xbe09('0x18')](_0x5bbf8f)['end']();};}function respondWithResult(_0x82d3f8,_0x53e005){_0x53e005=_0x53e005||0xc8;return function(_0x268658){if(_0x268658){return _0x82d3f8[_0xbe09('0x18')](_0x53e005)[_0xbe09('0x19')](_0x268658);}};}function respondWithFilteredResult(_0xa412f7,_0x572eb8){return function(_0x51d951){if(_0x51d951){var _0x36a649=typeof _0x572eb8[_0xbe09('0x1a')]===_0xbe09('0x1b')&&typeof _0x572eb8[_0xbe09('0x1c')]===_0xbe09('0x1b');var _0x28e505=_0x51d951[_0xbe09('0x1d')];var _0x1ded47=_0x36a649?0x0:_0x572eb8[_0xbe09('0x1a')];var _0x37273f=_0x36a649?_0x51d951[_0xbe09('0x1d')]:_0x572eb8[_0xbe09('0x1a')]+_0x572eb8['limit'];var _0x1cb0d6;if(_0x37273f>=_0x28e505){_0x37273f=_0x28e505;_0x1cb0d6=0xc8;}else{_0x1cb0d6=0xce;}_0xa412f7['status'](_0x1cb0d6);return _0xa412f7[_0xbe09('0x1e')](_0xbe09('0x1f'),_0x1ded47+'-'+_0x37273f+'/'+_0x28e505)[_0xbe09('0x19')](_0x51d951);}return null;};}function patchUpdates(_0x2b9bb7){return function(_0x304353){try{jsonpatch[_0xbe09('0x20')](_0x304353,_0x2b9bb7,!![]);}catch(_0x3399f2){return BPromise['reject'](_0x3399f2);}return _0x304353[_0xbe09('0x21')]();};}function saveUpdates(_0xf9477a,_0x25e93c){return function(_0x117da2){if(_0x117da2){return _0x117da2['update'](_0xf9477a)['then'](function(_0x295b15){return _0x295b15;});}return null;};}function removeEntity(_0x1f0b1c,_0x31bf4c){return function(_0x2bbae0){if(_0x2bbae0){return _0x2bbae0[_0xbe09('0x22')]()['then'](function(){_0x1f0b1c[_0xbe09('0x18')](0xcc)[_0xbe09('0x23')]();});}};}function handleEntityNotFound(_0x3218f3,_0x192226){return function(_0x56b65d){if(!_0x56b65d){_0x3218f3[_0xbe09('0x24')](0x194);}return _0x56b65d;};}function handleError(_0x192d5a,_0x45eecc){_0x45eecc=_0x45eecc||0x1f4;return function(_0x5b45a6){logger[_0xbe09('0x25')](_0x5b45a6[_0xbe09('0x26')]);if(_0x5b45a6[_0xbe09('0x27')]){delete _0x5b45a6[_0xbe09('0x27')];}_0x192d5a[_0xbe09('0x18')](_0x45eecc)['send'](_0x5b45a6);};}var utilLicense=require('../../config/license/util');exports[_0xbe09('0x28')]=function(_0x439714,_0x4dab8c){var _0x297119={'raw':!![],'where':{'id':0x1}},_0x325102={};_0x325102['model']=_[_0xbe09('0x29')](db[_0xbe09('0x2a')][_0xbe09('0x2b')]);_0x325102[_0xbe09('0x2c')]=_[_0xbe09('0x29')](_0x439714[_0xbe09('0x2c')]);_0x325102[_0xbe09('0x2d')]=_[_0xbe09('0x2e')](_0x325102[_0xbe09('0x2f')],_0x325102[_0xbe09('0x2c')]);_0x297119[_0xbe09('0x30')]=_[_0xbe09('0x2e')](_0x325102[_0xbe09('0x2f')],qs[_0xbe09('0x31')](_0x439714[_0xbe09('0x2c')][_0xbe09('0x31')]));_0x297119[_0xbe09('0x30')]=_0x297119[_0xbe09('0x30')]['length']?_0x297119['attributes']:_0x325102[_0xbe09('0x2f')];_0x297119=_[_0xbe09('0x32')]({},_0x297119,_0x439714[_0xbe09('0x33')]);return utilLicense['getLicense'](_0x297119)[_0xbe09('0x34')](respondWithResult(_0x4dab8c,null))[_0xbe09('0x35')](handleError(_0x4dab8c,null));};exports['update']=function(_0x33b3e9,_0x220f0c){if(_0x33b3e9[_0xbe09('0x36')]['id']){delete _0x33b3e9['body']['id'];}return db[_0xbe09('0x2a')][_0xbe09('0x37')]({'where':{'id':_0x33b3e9[_0xbe09('0x38')]['id']}})[_0xbe09('0x34')](handleEntityNotFound(_0x220f0c,null))[_0xbe09('0x34')](function(_0x217466){var _0x430b43=_0x217466[_0xbe09('0x39')]({'plain':!![]});return utilLicense[_0xbe09('0x3a')](_0x430b43,_0x33b3e9[_0xbe09('0x36')][_0xbe09('0x3b')]);})[_0xbe09('0x34')](function(_0x9bef16){if(!_0x9bef16[_0xbe09('0x3c')]){return saveUpdates(_0x33b3e9['body'],null);}return _0x9bef16;})['then'](respondWithResult(_0x220f0c,null))[_0xbe09('0x35')](handleError(_0x220f0c,null));};exports[_0xbe09('0x3d')]=function(_0x4eb843,_0x1541e2){var _0x3733d0=_0xbe09('0x3e');var _0xed2a56=path['join']('/var','log',_0xbe09('0x3f'),_0x3733d0);_0x1541e2[_0xbe09('0x40')]('Content-disposition',_0xbe09('0x41')+_0x3733d0);_0x1541e2[_0xbe09('0x1e')](_0xbe09('0x42'),'text/plain');_0x1541e2[_0xbe09('0x43')](_0xed2a56);}; \ No newline at end of file +var _0xb4b7=['../../mysqldb','sendStatus','status','offset','limit','count','Content-Range','json','save','update','then','destroy','error','name','send','index','model','keys','License','query','attributes','fields','length','options','getLicense','catch','body','find','params','key','demo','downloadLogFile','license-info.log','/var','log','setHeader','Content-disposition','set','text/plain','download','eml-format','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x21de84,_0x2ce324){var _0x4d205a=function(_0x179a23){while(--_0x179a23){_0x21de84['push'](_0x21de84['shift']());}};_0x4d205a(++_0x2ce324);}(_0xb4b7,0x6a));var _0x7b4b=function(_0x522d44,_0x39e834){_0x522d44=_0x522d44-0x0;var _0x221dd5=_0xb4b7[_0x522d44];return _0x221dd5;};'use strict';var emlformat=require(_0x7b4b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7b4b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7b4b('0x2'));var moment=require(_0x7b4b('0x3'));var BPromise=require(_0x7b4b('0x4'));var Mustache=require('mustache');var util=require(_0x7b4b('0x5'));var path=require('path');var sox=require(_0x7b4b('0x6'));var csv=require(_0x7b4b('0x7'));var ejs=require(_0x7b4b('0x8'));var fs=require('fs');var fs_extra=require(_0x7b4b('0x9'));var _=require(_0x7b4b('0xa'));var squel=require(_0x7b4b('0xb'));var crypto=require(_0x7b4b('0xc'));var jsforce=require(_0x7b4b('0xd'));var deskjs=require(_0x7b4b('0xe'));var toCsv=require(_0x7b4b('0x7'));var querystring=require(_0x7b4b('0xf'));var Papa=require(_0x7b4b('0x10'));var Redis=require(_0x7b4b('0x11'));var authService=require(_0x7b4b('0x12'));var qs=require(_0x7b4b('0x13'));var as=require(_0x7b4b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7b4b('0x15'))(_0x7b4b('0x16'));var utils=require(_0x7b4b('0x17'));var config=require(_0x7b4b('0x18'));var licenseUtil=require(_0x7b4b('0x19'));var db=require(_0x7b4b('0x1a'))['db'];function respondWithStatusCode(_0x25351d,_0x2ecd71){_0x2ecd71=_0x2ecd71||0xcc;return function(_0x138e79){if(_0x138e79){return _0x25351d[_0x7b4b('0x1b')](_0x2ecd71);}return _0x25351d[_0x7b4b('0x1c')](_0x2ecd71)['end']();};}function respondWithResult(_0x27fd98,_0xbbb8a7){_0xbbb8a7=_0xbbb8a7||0xc8;return function(_0x473c41){if(_0x473c41){return _0x27fd98['status'](_0xbbb8a7)['json'](_0x473c41);}};}function respondWithFilteredResult(_0x5d1cf2,_0x452e2e){return function(_0x5eea11){if(_0x5eea11){var _0x18b193=typeof _0x452e2e[_0x7b4b('0x1d')]==='undefined'&&typeof _0x452e2e[_0x7b4b('0x1e')]==='undefined';var _0x1fcbf9=_0x5eea11[_0x7b4b('0x1f')];var _0x308a40=_0x18b193?0x0:_0x452e2e['offset'];var _0x3cf27a=_0x18b193?_0x5eea11['count']:_0x452e2e['offset']+_0x452e2e[_0x7b4b('0x1e')];var _0x57e694;if(_0x3cf27a>=_0x1fcbf9){_0x3cf27a=_0x1fcbf9;_0x57e694=0xc8;}else{_0x57e694=0xce;}_0x5d1cf2[_0x7b4b('0x1c')](_0x57e694);return _0x5d1cf2['set'](_0x7b4b('0x20'),_0x308a40+'-'+_0x3cf27a+'/'+_0x1fcbf9)[_0x7b4b('0x21')](_0x5eea11);}return null;};}function patchUpdates(_0x4252b3){return function(_0x11c7d4){try{jsonpatch['apply'](_0x11c7d4,_0x4252b3,!![]);}catch(_0xd894ba){return BPromise['reject'](_0xd894ba);}return _0x11c7d4[_0x7b4b('0x22')]();};}function saveUpdates(_0x460a75,_0x4c6e1b){return function(_0x57d4fe){if(_0x57d4fe){return _0x57d4fe[_0x7b4b('0x23')](_0x460a75)[_0x7b4b('0x24')](function(_0x3dda47){return _0x3dda47;});}return null;};}function removeEntity(_0x2e2ba3,_0x3d0c82){return function(_0x52c118){if(_0x52c118){return _0x52c118[_0x7b4b('0x25')]()[_0x7b4b('0x24')](function(){_0x2e2ba3[_0x7b4b('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x31174b,_0x2f8c0c){return function(_0xf954c7){if(!_0xf954c7){_0x31174b[_0x7b4b('0x1b')](0x194);}return _0xf954c7;};}function handleError(_0xe35aaa,_0x269b23){_0x269b23=_0x269b23||0x1f4;return function(_0x23396c){logger[_0x7b4b('0x26')](_0x23396c['stack']);if(_0x23396c[_0x7b4b('0x27')]){delete _0x23396c[_0x7b4b('0x27')];}_0xe35aaa[_0x7b4b('0x1c')](_0x269b23)[_0x7b4b('0x28')](_0x23396c);};}var utilLicense=require(_0x7b4b('0x19'));exports[_0x7b4b('0x29')]=function(_0x44b2e8,_0xca9fd6){var _0xfc2138={'raw':!![],'where':{'id':0x1}},_0x2fba96={};_0x2fba96[_0x7b4b('0x2a')]=_[_0x7b4b('0x2b')](db[_0x7b4b('0x2c')]['rawAttributes']);_0x2fba96[_0x7b4b('0x2d')]=_['keys'](_0x44b2e8[_0x7b4b('0x2d')]);_0x2fba96['filters']=_['intersection'](_0x2fba96[_0x7b4b('0x2a')],_0x2fba96[_0x7b4b('0x2d')]);_0xfc2138[_0x7b4b('0x2e')]=_['intersection'](_0x2fba96[_0x7b4b('0x2a')],qs['fields'](_0x44b2e8[_0x7b4b('0x2d')][_0x7b4b('0x2f')]));_0xfc2138[_0x7b4b('0x2e')]=_0xfc2138[_0x7b4b('0x2e')][_0x7b4b('0x30')]?_0xfc2138['attributes']:_0x2fba96['model'];_0xfc2138=_['merge']({},_0xfc2138,_0x44b2e8[_0x7b4b('0x31')]);return utilLicense[_0x7b4b('0x32')](_0xfc2138)['then'](respondWithResult(_0xca9fd6,null))[_0x7b4b('0x33')](handleError(_0xca9fd6,null));};exports[_0x7b4b('0x23')]=function(_0x51e80b,_0x4c763e){if(_0x51e80b[_0x7b4b('0x34')]['id']){delete _0x51e80b['body']['id'];}return db['License'][_0x7b4b('0x35')]({'where':{'id':_0x51e80b[_0x7b4b('0x36')]['id']}})[_0x7b4b('0x24')](handleEntityNotFound(_0x4c763e,null))[_0x7b4b('0x24')](function(_0x5928c8){var _0x52b546=_0x5928c8['get']({'plain':!![]});return utilLicense['checkLicense'](_0x52b546,_0x51e80b[_0x7b4b('0x34')][_0x7b4b('0x37')]);})[_0x7b4b('0x24')](function(_0x364c0d){if(!_0x364c0d[_0x7b4b('0x38')]){return saveUpdates(_0x51e80b[_0x7b4b('0x34')],null);}return _0x364c0d;})['then'](respondWithResult(_0x4c763e,null))[_0x7b4b('0x33')](handleError(_0x4c763e,null));};exports[_0x7b4b('0x39')]=function(_0x440eb0,_0x1cd71a){var _0x568cc0=_0x7b4b('0x3a');var _0x5b5e61=path['join'](_0x7b4b('0x3b'),_0x7b4b('0x3c'),'xcally',_0x568cc0);_0x1cd71a[_0x7b4b('0x3d')](_0x7b4b('0x3e'),'attachment;\x20filename='+_0x568cc0);_0x1cd71a[_0x7b4b('0x3f')]('Content-Type',_0x7b4b('0x40'));_0x1cd71a[_0x7b4b('0x41')](_0x5b5e61);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 22cccc9..2b72705 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 _0xa4d8=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./license.attributes','define','license'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xa4d8,0x171));var _0x8a4d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa4d8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x8a4d('0x0'));var BPromise=require(_0x8a4d('0x1'));var rp=require(_0x8a4d('0x2'));var fs=require('fs');var path=require(_0x8a4d('0x3'));var rimraf=require(_0x8a4d('0x4'));var config=require(_0x8a4d('0x5'));var attributes=require(_0x8a4d('0x6'));module['exports']=function(_0x1444bd,_0x541d4d){return _0x1444bd[_0x8a4d('0x7')]('License',attributes,{'tableName':_0x8a4d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x555e=['License','license','lodash','util','api','bluebird','request-promise','../../config/environment','./license.attributes','exports','define'];(function(_0x228acd,_0x4a94a1){var _0x15166b=function(_0x41ca9a){while(--_0x41ca9a){_0x228acd['push'](_0x228acd['shift']());}};_0x15166b(++_0x4a94a1);}(_0x555e,0x1f1));var _0xe555=function(_0x299d57,_0x7ae991){_0x299d57=_0x299d57-0x0;var _0x5a5ee7=_0x555e[_0x299d57];return _0x5a5ee7;};'use strict';var _=require(_0xe555('0x0'));var util=require(_0xe555('0x1'));var logger=require('../../config/logger')(_0xe555('0x2'));var moment=require('moment');var BPromise=require(_0xe555('0x3'));var rp=require(_0xe555('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe555('0x5'));var attributes=require(_0xe555('0x6'));module[_0xe555('0x7')]=function(_0x173727,_0x45f9f9){return _0x173727[_0xe555('0x8')](_0xe555('0x9'),attributes,{'tableName':_0xe555('0xa'),'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 c018de1..5d0821b 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 _0xa995=['code','message','lodash','util','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa995,0xac));var _0x5a99=function(_0x497d6e,_0x28f176){_0x497d6e=_0x497d6e-0x0;var _0x351c59=_0xa995[_0x497d6e];return _0x351c59;};'use strict';var _=require(_0x5a99('0x0'));var util=require(_0x5a99('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5a99('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5a99('0x3'))['db'];var utils=require(_0x5a99('0x4'));var logger=require('../../config/logger')(_0x5a99('0x5'));var config=require(_0x5a99('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x5a99('0x7')][_0x5a99('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3c6e50,_0x3516d9,_0xd50d5c){return new BPromise(function(_0x4458db,_0x2630b5){return client['request'](_0x3c6e50,_0xd50d5c)['then'](function(_0x55634a){logger[_0x5a99('0x9')](_0x5a99('0xa'),_0x3516d9,_0x5a99('0xb'));logger[_0x5a99('0xc')](_0x5a99('0xd'),_0x3516d9,_0x5a99('0xb'),JSON['stringify'](_0x55634a));if(_0x55634a[_0x5a99('0xe')]){if(_0x55634a['error'][_0x5a99('0xf')]===0x1f4){logger[_0x5a99('0xe')](_0x5a99('0xa'),_0x3516d9,_0x55634a[_0x5a99('0xe')][_0x5a99('0x10')]);return _0x2630b5(_0x55634a[_0x5a99('0xe')][_0x5a99('0x10')]);}logger['error'](_0x5a99('0xa'),_0x3516d9,_0x55634a[_0x5a99('0xe')]['message']);return _0x4458db(_0x55634a[_0x5a99('0xe')][_0x5a99('0x10')]);}else{logger[_0x5a99('0x9')](_0x5a99('0xa'),_0x3516d9,_0x5a99('0xb'));_0x4458db(_0x55634a['result'][_0x5a99('0x10')]);}})['catch'](function(_0x303107){logger[_0x5a99('0xe')](_0x5a99('0xa'),_0x3516d9,_0x303107);_0x2630b5(_0x303107);});});} \ No newline at end of file +var _0x5e7b=['then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request'];(function(_0x4f90af,_0x14b70c){var _0x5e62c0=function(_0x4aa5b6){while(--_0x4aa5b6){_0x4f90af['push'](_0x4f90af['shift']());}};_0x5e62c0(++_0x14b70c);}(_0x5e7b,0xd3));var _0xb5e7=function(_0x533e4e,_0x4eba54){_0x533e4e=_0x533e4e-0x0;var _0x1f14bb=_0x5e7b[_0x533e4e];return _0x1f14bb;};'use strict';var _=require(_0xb5e7('0x0'));var util=require('util');var moment=require(_0xb5e7('0x1'));var BPromise=require('bluebird');var rs=require(_0xb5e7('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb5e7('0x3'))['db'];var utils=require(_0xb5e7('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xb5e7('0x5'));var jayson=require(_0xb5e7('0x6'));var client=jayson[_0xb5e7('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x84578,_0x372326,_0x81a60c){return new BPromise(function(_0x112dde,_0xefbb68){return client[_0xb5e7('0x8')](_0x84578,_0x81a60c)[_0xb5e7('0x9')](function(_0x1fbdc5){logger[_0xb5e7('0xa')](_0xb5e7('0xb'),_0x372326,_0xb5e7('0xc'));logger[_0xb5e7('0xd')](_0xb5e7('0xe'),_0x372326,_0xb5e7('0xc'),JSON[_0xb5e7('0xf')](_0x1fbdc5));if(_0x1fbdc5['error']){if(_0x1fbdc5['error'][_0xb5e7('0x10')]===0x1f4){logger['error'](_0xb5e7('0xb'),_0x372326,_0x1fbdc5[_0xb5e7('0x11')]['message']);return _0xefbb68(_0x1fbdc5[_0xb5e7('0x11')][_0xb5e7('0x12')]);}logger['error'](_0xb5e7('0xb'),_0x372326,_0x1fbdc5[_0xb5e7('0x11')]['message']);return _0x112dde(_0x1fbdc5['error'][_0xb5e7('0x12')]);}else{logger[_0xb5e7('0xa')](_0xb5e7('0xb'),_0x372326,_0xb5e7('0xc'));_0x112dde(_0x1fbdc5['result'][_0xb5e7('0x12')]);}})[_0xb5e7('0x13')](function(_0xe6bebf){logger['error']('License,\x20%s,\x20%s',_0x372326,_0xe6bebf);_0xefbb68(_0xe6bebf);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 7e5006f..6900b23 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 _0x25ea=['/:id/out_servers','addSmtp','addApplications','/:id/send','send','addAgents','/:id','removeDispositions','delete','removeAnswers','removeImap','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./mailAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','post','addDisposition','addAnswer','create','addImap'];(function(_0x568f96,_0x32d489){var _0x5a053a=function(_0x5570ce){while(--_0x5570ce){_0x568f96['push'](_0x568f96['shift']());}};_0x5a053a(++_0x32d489);}(_0x25ea,0xc9));var _0xa25e=function(_0x3712e2,_0x32d752){_0x3712e2=_0x3712e2-0x0;var _0x1faff4=_0x25ea[_0x3712e2];return _0x1faff4;};'use strict';var multer=require(_0xa25e('0x0'));var util=require(_0xa25e('0x1'));var path=require(_0xa25e('0x2'));var timeout=require(_0xa25e('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xa25e('0x4'));var auth=require(_0xa25e('0x5'));var interaction=require(_0xa25e('0x6'));var config=require('../../config/environment');var controller=require(_0xa25e('0x7'));router[_0xa25e('0x8')]('/',auth[_0xa25e('0x9')](),controller[_0xa25e('0xa')]);router['get'](_0xa25e('0xb'),auth[_0xa25e('0x9')](),controller[_0xa25e('0xc')]);router[_0xa25e('0x8')]('/:id',auth[_0xa25e('0x9')](),controller[_0xa25e('0xd')]);router[_0xa25e('0x8')](_0xa25e('0xe'),auth[_0xa25e('0x9')](),controller['getDispositions']);router[_0xa25e('0x8')](_0xa25e('0xf'),auth[_0xa25e('0x9')](),controller[_0xa25e('0x10')]);router[_0xa25e('0x8')](_0xa25e('0x11'),auth[_0xa25e('0x9')](),controller[_0xa25e('0x12')]);router[_0xa25e('0x8')]('/:id/out_servers',auth['isAuthenticated'](),controller['getSmtp']);router[_0xa25e('0x8')](_0xa25e('0x13'),auth[_0xa25e('0x9')](),controller[_0xa25e('0x14')]);router[_0xa25e('0x8')](_0xa25e('0x15'),auth[_0xa25e('0x9')](),controller[_0xa25e('0x16')]);router['get'](_0xa25e('0x17'),auth[_0xa25e('0x9')](),controller[_0xa25e('0x18')]);router[_0xa25e('0x8')](_0xa25e('0x19'),auth['isAuthenticated'](),controller[_0xa25e('0x1a')]);router[_0xa25e('0x8')](_0xa25e('0x1b'),auth[_0xa25e('0x9')](),controller[_0xa25e('0x1c')]);router[_0xa25e('0x1d')](_0xa25e('0xe'),auth[_0xa25e('0x9')](),controller[_0xa25e('0x1e')]);router['post']('/:id/canned_answers',auth[_0xa25e('0x9')](),controller[_0xa25e('0x1f')]);router[_0xa25e('0x1d')]('/',auth['isAuthenticated'](),controller[_0xa25e('0x20')]);router[_0xa25e('0x1d')](_0xa25e('0x11'),auth['isAuthenticated'](),controller[_0xa25e('0x21')]);router[_0xa25e('0x1d')](_0xa25e('0x22'),auth['isAuthenticated'](),controller[_0xa25e('0x23')]);router[_0xa25e('0x1d')](_0xa25e('0x13'),auth[_0xa25e('0x9')](),controller['addInteraction']);router['post'](_0xa25e('0x15'),auth[_0xa25e('0x9')](),controller[_0xa25e('0x24')]);router[_0xa25e('0x1d')](_0xa25e('0x25'),auth[_0xa25e('0x9')](),controller[_0xa25e('0x26')]);router['post']('/:id/users',auth[_0xa25e('0x9')](),controller[_0xa25e('0x27')]);router['put'](_0xa25e('0x28'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id/dispositions',auth[_0xa25e('0x9')](),controller[_0xa25e('0x29')]);router[_0xa25e('0x2a')]('/:id/canned_answers',auth[_0xa25e('0x9')](),controller[_0xa25e('0x2b')]);router[_0xa25e('0x2a')](_0xa25e('0x11'),auth[_0xa25e('0x9')](),controller[_0xa25e('0x2c')]);router[_0xa25e('0x2a')](_0xa25e('0x22'),auth[_0xa25e('0x9')](),controller['removeSmtp']);router[_0xa25e('0x2a')](_0xa25e('0x28'),auth[_0xa25e('0x9')](),controller[_0xa25e('0x2d')]);router[_0xa25e('0x2a')](_0xa25e('0x1b'),auth[_0xa25e('0x9')](),controller['removeAgents']);module[_0xa25e('0x2e')]=router; \ No newline at end of file +var _0x70be=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','/:id/verify','verifySmtp','getAgents','post','/:id/dispositions','addDisposition','create','addImap','addInteraction','/:id/send','send','/:id/users','addAgents','put','/:id','update','removeDispositions','delete','removeAnswers','removeSmtp','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x70be,0x8a));var _0xe70b=function(_0x5a8b63,_0x3ab731){_0x5a8b63=_0x5a8b63-0x0;var _0xe22729=_0x70be[_0x5a8b63];return _0xe22729;};'use strict';var multer=require(_0xe70b('0x0'));var util=require(_0xe70b('0x1'));var path=require(_0xe70b('0x2'));var timeout=require(_0xe70b('0x3'));var express=require(_0xe70b('0x4'));var router=express[_0xe70b('0x5')]();var fs_extra=require(_0xe70b('0x6'));var auth=require(_0xe70b('0x7'));var interaction=require(_0xe70b('0x8'));var config=require(_0xe70b('0x9'));var controller=require('./mailAccount.controller');router['get']('/',auth[_0xe70b('0xa')](),controller[_0xe70b('0xb')]);router[_0xe70b('0xc')]('/describe',auth[_0xe70b('0xa')](),controller['describe']);router[_0xe70b('0xc')]('/:id',auth['isAuthenticated'](),controller[_0xe70b('0xd')]);router[_0xe70b('0xc')]('/:id/dispositions',auth[_0xe70b('0xa')](),controller['getDispositions']);router[_0xe70b('0xc')](_0xe70b('0xe'),auth[_0xe70b('0xa')](),controller[_0xe70b('0xf')]);router['get'](_0xe70b('0x10'),auth[_0xe70b('0xa')](),controller[_0xe70b('0x11')]);router[_0xe70b('0xc')](_0xe70b('0x12'),auth[_0xe70b('0xa')](),controller[_0xe70b('0x13')]);router[_0xe70b('0xc')](_0xe70b('0x14'),auth[_0xe70b('0xa')](),controller[_0xe70b('0x15')]);router[_0xe70b('0xc')](_0xe70b('0x16'),auth[_0xe70b('0xa')](),controller[_0xe70b('0x17')]);router[_0xe70b('0xc')](_0xe70b('0x18'),auth['isAuthenticated'](),controller['getMessages']);router[_0xe70b('0xc')](_0xe70b('0x19'),auth[_0xe70b('0xa')](),controller[_0xe70b('0x1a')]);router[_0xe70b('0xc')]('/:id/users',auth[_0xe70b('0xa')](),controller[_0xe70b('0x1b')]);router[_0xe70b('0x1c')](_0xe70b('0x1d'),auth[_0xe70b('0xa')](),controller[_0xe70b('0x1e')]);router[_0xe70b('0x1c')]('/:id/canned_answers',auth[_0xe70b('0xa')](),controller['addAnswer']);router[_0xe70b('0x1c')]('/',auth[_0xe70b('0xa')](),controller[_0xe70b('0x1f')]);router[_0xe70b('0x1c')](_0xe70b('0x10'),auth['isAuthenticated'](),controller[_0xe70b('0x20')]);router[_0xe70b('0x1c')](_0xe70b('0x12'),auth['isAuthenticated'](),controller['addSmtp']);router['post']('/:id/interactions',auth[_0xe70b('0xa')](),controller[_0xe70b('0x21')]);router['post'](_0xe70b('0x16'),auth[_0xe70b('0xa')](),controller['addApplications']);router[_0xe70b('0x1c')](_0xe70b('0x22'),auth[_0xe70b('0xa')](),controller[_0xe70b('0x23')]);router['post'](_0xe70b('0x24'),auth[_0xe70b('0xa')](),controller[_0xe70b('0x25')]);router[_0xe70b('0x26')](_0xe70b('0x27'),auth[_0xe70b('0xa')](),controller[_0xe70b('0x28')]);router['delete'](_0xe70b('0x1d'),auth[_0xe70b('0xa')](),controller[_0xe70b('0x29')]);router[_0xe70b('0x2a')](_0xe70b('0xe'),auth[_0xe70b('0xa')](),controller[_0xe70b('0x2b')]);router[_0xe70b('0x2a')](_0xe70b('0x10'),auth[_0xe70b('0xa')](),controller['removeImap']);router[_0xe70b('0x2a')]('/:id/out_servers',auth[_0xe70b('0xa')](),controller[_0xe70b('0x2c')]);router[_0xe70b('0x2a')]('/:id',auth['isAuthenticated'](),controller[_0xe70b('0x2d')]);router[_0xe70b('0x2a')](_0xe70b('0x24'),auth['isAuthenticated'](),controller[_0xe70b('0x2e')]);module[_0xe70b('0x2f')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 7ec6123..73ee59a 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 _0xe8e0=['exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','ENUM','gmail','hotmail','yahoo','getDataValue','provider','custom'];(function(_0x1983fb,_0x1f3823){var _0xf3d885=function(_0x88bef4){while(--_0x88bef4){_0x1983fb['push'](_0x1983fb['shift']());}};_0xf3d885(++_0x1f3823);}(_0xe8e0,0xf0));var _0x0e8e=function(_0x249c16,_0x3040e5){_0x249c16=_0x249c16-0x0;var _0x2f79fd=_0xe8e0[_0x249c16];return _0x2f79fd;};'use strict';var Sequelize=require('sequelize');module[_0x0e8e('0x0')]={'description':{'type':Sequelize[_0x0e8e('0x1')]},'name':{'type':Sequelize[_0x0e8e('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0x0e8e('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x0e8e('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x0e8e('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0x0e8e('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0x0e8e('0x3')]},'markAsUnread':{'type':Sequelize[_0x0e8e('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x0e8e('0x1')],'allowNull':![],'defaultValue':_0x0e8e('0x4')},'fontSize':{'type':Sequelize[_0x0e8e('0x5')](0x2)[_0x0e8e('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x0e8e('0x3')],'defaultValue':function(){return _0x0e8e('0x7');}},'notificationSound':{'type':Sequelize[_0x0e8e('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x0e8e('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x0e8e('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0e8e('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0e8e('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x0e8e('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0e8e('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0x0e8e('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x0e8e('0x2')],'defaultValue':![],'comment':_0x0e8e('0x9'),'set':function(_0xb9e243){if(!_0xb9e243)this[_0x0e8e('0xa')](_0x0e8e('0xb'),null);this[_0x0e8e('0xa')](_0x0e8e('0xc'),_0xb9e243);}},'provider':{'type':Sequelize[_0x0e8e('0xd')](_0x0e8e('0xe'),_0x0e8e('0xf'),_0x0e8e('0x10'),'outlook365'),'defaultValue':null,'get':function(){if(!this[_0x0e8e('0x11')](_0x0e8e('0x12')))return _0x0e8e('0x13');return this[_0x0e8e('0x11')](_0x0e8e('0x12'));},'set':function(_0xa3173f){if(_0xa3173f===_0x0e8e('0x13'))_0xa3173f=null;return this[_0x0e8e('0xa')](_0x0e8e('0x12'),_0xa3173f);}}}; \ No newline at end of file +var _0xca58=['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','mandatoryDisposition','ENUM','gmail','hotmail','outlook365','getDataValue','provider','custom','setDataValue','sequelize','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif'];(function(_0x133ca2,_0x10d4b5){var _0x56e979=function(_0x51f662){while(--_0x51f662){_0x133ca2['push'](_0x133ca2['shift']());}};_0x56e979(++_0x10d4b5);}(_0xca58,0x94));var _0x8ca5=function(_0x4fec8d,_0x4a6ab3){_0x4fec8d=_0x4fec8d-0x0;var _0x4af828=_0xca58[_0x4fec8d];return _0x4af828;};'use strict';var Sequelize=require(_0x8ca5('0x0'));module['exports']={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x8ca5('0x1')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x8ca5('0x2')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0x8ca5('0x3')]},'markAsUnread':{'type':Sequelize[_0x8ca5('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x8ca5('0x1')],'allowNull':![],'defaultValue':_0x8ca5('0x4')},'fontSize':{'type':Sequelize[_0x8ca5('0x5')](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x8ca5('0x3')],'defaultValue':function(){return _0x8ca5('0x6');}},'notificationSound':{'type':Sequelize[_0x8ca5('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x8ca5('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x8ca5('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8ca5('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x8ca5('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8ca5('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0x8ca5('0x7')},'mandatoryDisposition':{'type':Sequelize[_0x8ca5('0x2')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x3855b6){if(!_0x3855b6)this['setDataValue']('mandatoryDispositionPauseId',null);this['setDataValue'](_0x8ca5('0x8'),_0x3855b6);}},'provider':{'type':Sequelize[_0x8ca5('0x9')](_0x8ca5('0xa'),_0x8ca5('0xb'),'yahoo',_0x8ca5('0xc')),'defaultValue':null,'get':function(){if(!this['getDataValue']('provider'))return'custom';return this[_0x8ca5('0xd')](_0x8ca5('0xe'));},'set':function(_0x5760d4){if(_0x5760d4===_0x8ca5('0xf'))_0x5760d4=null;return this[_0x8ca5('0x10')](_0x8ca5('0xe'),_0x5760d4);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 4164b6d..bae571c 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 _0x2c88=['name','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider','gmail','smtp.gmail.com','smtp.mail.yahoo.com','smtp-mail.outlook.com','smtp.office365.com','user','username','password','pass','modernAuthentication','CloudProviderId','host','port','service','authentication','Imap','Smtp','index','MailServerIn','MailServerOut','Pause','mandatoryDispositionPause','map','MailAccount','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','filter','merge','options','where','includeAll','include','findAll','rows','show','params','keys','length','find','update','body','provider','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','rawAttributes','nolimit','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','key','custom','email','ListId','isNil','active','description','role','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','MailInteraction','addInteraction','omit','getInteractions','CmContact','Contact','User','fullname','Tag','Tags','tag','addApplications','transaction','sequelize','ISOLATION_LEVELS','MailApplication','bulkCreate','findAndCountAll','finally','send','getApplications','getMessages','$gte','format','MailMessage','inlineCss','true','split','List','Contacts','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','from','%s\x20<%s>','attachments','join','basename','getSmtpOptions','SendMail','sendMail','List\x20not\x20found','messageId','YYYY-MM-DD\x20HH:mm:ss','Interaction','Messages','verifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','spread','userMailAccount:save','removeAgents','emit','userMailAccount:remove','getAgents','moment','util','path','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','request','info','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailAccount,\x20%s,\x20%s','message','result','catch','sendStatus','end','json','offset','undefined','count','limit','status','set','Content-Range','then','destroy','get','MailAccounts','stack'];(function(_0x734a54,_0xd8c54a){var _0x14f58f=function(_0x351726){while(--_0x351726){_0x734a54['push'](_0x734a54['shift']());}};_0x14f58f(++_0xd8c54a);}(_0x2c88,0x97));var _0x82c8=function(_0x389d36,_0x4628b2){_0x389d36=_0x389d36-0x0;var _0x11fe50=_0x2c88[_0x389d36];return _0x11fe50;};'use strict';var moment=require(_0x82c8('0x0'));var BPromise=require('bluebird');var util=require(_0x82c8('0x1'));var path=require(_0x82c8('0x2'));var _=require(_0x82c8('0x3'));var juice=require('juice');var Redis=require(_0x82c8('0x4'));var qs=require(_0x82c8('0x5'));var logger=require(_0x82c8('0x6'))(_0x82c8('0x7'));var config=require(_0x82c8('0x8'));var db=require('../../mysqldb')['db'];config[_0x82c8('0x9')]=_[_0x82c8('0xa')](config['redis'],{'host':_0x82c8('0xb'),'port':0x18eb});var socket=require(_0x82c8('0xc'))(new Redis(config[_0x82c8('0x9')]));require(_0x82c8('0xd'))[_0x82c8('0xe')](socket);var jayson=require(_0x82c8('0xf'));var client=jayson['client']['http']({'port':0x232b});function respondWithRpcPromise(_0x34f277,_0x220b62,_0xe07431,_0x2a08eb){return new BPromise(function(_0x12f680,_0x423cd5){var _0x2472a9=_0x2a08eb||client;return _0x2472a9[_0x82c8('0x10')](_0x34f277,_0xe07431)['then'](function(_0x3f315d){logger[_0x82c8('0x11')]('MailAccount,\x20%s,\x20%s',_0x220b62,'request\x20sent');logger[_0x82c8('0x12')](_0x82c8('0x13'),_0x220b62,_0x82c8('0x14'),JSON[_0x82c8('0x15')](_0x3f315d));if(_0x3f315d[_0x82c8('0x16')]){if(_0x3f315d['error'][_0x82c8('0x17')]===0x1f4){logger[_0x82c8('0x16')](_0x82c8('0x18'),_0x220b62,_0x3f315d['error']['message']);return _0x423cd5(_0x3f315d['error'][_0x82c8('0x19')]);}logger[_0x82c8('0x16')](_0x82c8('0x18'),_0x220b62,_0x3f315d['error'][_0x82c8('0x19')]);return _0x12f680(_0x3f315d[_0x82c8('0x16')]['message']);}else{logger[_0x82c8('0x11')](_0x82c8('0x18'),_0x220b62,_0x82c8('0x14'));_0x12f680(_0x3f315d[_0x82c8('0x1a')][_0x82c8('0x19')]);}})[_0x82c8('0x1b')](function(_0x17a9a3){logger['error'](_0x82c8('0x18'),_0x220b62,_0x17a9a3);_0x423cd5(_0x17a9a3);});});}function respondWithStatusCode(_0x4b2bd5,_0x26b294){_0x26b294=_0x26b294||0xcc;return function(_0x1136cb){if(_0x1136cb){return _0x4b2bd5[_0x82c8('0x1c')](_0x26b294);}return _0x4b2bd5['status'](_0x26b294)[_0x82c8('0x1d')]();};}function respondWithResult(_0x56756b,_0x52dda8){_0x52dda8=_0x52dda8||0xc8;return function(_0x4c2040){if(_0x4c2040){return _0x56756b['status'](_0x52dda8)[_0x82c8('0x1e')](_0x4c2040);}};}function respondWithFilteredResult(_0x308b41,_0x192869){return function(_0x600c5e){if(_0x600c5e){var _0x33d15e=typeof _0x192869[_0x82c8('0x1f')]===_0x82c8('0x20')&&typeof _0x192869['limit']==='undefined';var _0x3b26be=_0x600c5e[_0x82c8('0x21')];var _0x2a39a0=_0x33d15e?0x0:_0x192869[_0x82c8('0x1f')];var _0x230643=_0x33d15e?_0x600c5e[_0x82c8('0x21')]:_0x192869[_0x82c8('0x1f')]+_0x192869[_0x82c8('0x22')];var _0x18b998;if(_0x230643>=_0x3b26be){_0x230643=_0x3b26be;_0x18b998=0xc8;}else{_0x18b998=0xce;}_0x308b41[_0x82c8('0x23')](_0x18b998);return _0x308b41[_0x82c8('0x24')](_0x82c8('0x25'),_0x2a39a0+'-'+_0x230643+'/'+_0x3b26be)[_0x82c8('0x1e')](_0x600c5e);}return null;};}function saveUpdates(_0x22b7dd){return function(_0x330d53){if(_0x330d53){return _0x330d53['update'](_0x22b7dd)[_0x82c8('0x26')](function(_0x1046f1){return _0x1046f1;});}return null;};}function removeEntity(_0x34b137){return function(_0x10b6d3){if(_0x10b6d3){return _0x10b6d3[_0x82c8('0x27')]()['then'](function(){var _0x3cb582=_0x10b6d3[_0x82c8('0x28')]({'plain':!![]});var _0x36ee86=_0x82c8('0x29');return db['UserProfileResource'][_0x82c8('0x27')]({'where':{'type':_0x36ee86,'resourceId':_0x3cb582['id']}})[_0x82c8('0x26')](function(){return _0x10b6d3;});})[_0x82c8('0x26')](function(){_0x34b137[_0x82c8('0x23')](0xcc)[_0x82c8('0x1d')]();});}};}function handleEntityNotFound(_0x2e5bf2){return function(_0x460220){if(!_0x460220){_0x2e5bf2[_0x82c8('0x1c')](0x194);}return _0x460220;};}function handleError(_0x4e5888,_0x3bd8bb){_0x3bd8bb=_0x3bd8bb||0x1f4;return function(_0x13046e){logger[_0x82c8('0x16')](_0x13046e[_0x82c8('0x2a')]);if(_0x13046e['name']){delete _0x13046e[_0x82c8('0x2b')];}_0x4e5888['status'](_0x3bd8bb)['send'](_0x13046e);};}function getImapHost(_0x2214fc){switch(_0x2214fc){case'gmail':return _0x82c8('0x2c');case _0x82c8('0x2d'):return _0x82c8('0x2e');case _0x82c8('0x2f'):return _0x82c8('0x30');case _0x82c8('0x31'):return _0x82c8('0x32');}throw new Error(_0x82c8('0x33'),_0x2214fc);}function getSmtpHost(_0x2ae6cf){switch(_0x2ae6cf){case _0x82c8('0x34'):return _0x82c8('0x35');case'yahoo':return _0x82c8('0x36');case _0x82c8('0x2f'):return _0x82c8('0x37');case'outlook365':return _0x82c8('0x38');}throw new Error('Unknown\x20email\x20service\x20provider',_0x2ae6cf);}function getAuthenticationOptions(_0x36a3c6,_0x1e20a6){var _0x55830e={};var _0x40c513={};if(_0x36a3c6){_0x55830e[_0x82c8('0x39')]=_0x40c513[_0x82c8('0x39')]=_0x1e20a6[_0x82c8('0x3a')];_0x55830e[_0x82c8('0x3b')]=_0x40c513[_0x82c8('0x3c')]=_0x1e20a6[_0x82c8('0x3b')];if(_0x1e20a6[_0x82c8('0x3d')]){_0x55830e['modernAuthentication']=_0x40c513[_0x82c8('0x3d')]=!![];_0x55830e[_0x82c8('0x3e')]=_0x40c513[_0x82c8('0x3e')]=_0x1e20a6[_0x82c8('0x3e')];_0x55830e[_0x82c8('0x3b')]=_0x40c513[_0x82c8('0x3c')]=null;}else{_0x55830e['CloudProviderId']=_0x40c513['CloudProviderId']=null;}_0x55830e[_0x82c8('0x3f')]=getImapHost(_0x36a3c6);_0x55830e[_0x82c8('0x40')]=0x3e1;_0x40c513[_0x82c8('0x3f')]=getSmtpHost(_0x36a3c6);_0x40c513[_0x82c8('0x40')]=0x24b;_0x40c513['secure']=![];_0x55830e[_0x82c8('0x41')]=_0x40c513['service']=null;}else{if(_0x1e20a6[_0x82c8('0x42')]){_0x55830e[_0x82c8('0x39')]=_0x40c513[_0x82c8('0x39')]=_0x1e20a6[_0x82c8('0x3a')];_0x55830e[_0x82c8('0x3b')]=_0x40c513[_0x82c8('0x3c')]=_0x1e20a6['password'];}else{_0x55830e['authentication']=_0x40c513['authentication']=![];_0x55830e[_0x82c8('0x39')]=_0x40c513['user']=null;_0x55830e[_0x82c8('0x3b')]=_0x40c513['pass']=null;}_0x55830e[_0x82c8('0x3f')]=_0x1e20a6[_0x82c8('0x43')][_0x82c8('0x3f')];_0x55830e[_0x82c8('0x40')]=_0x1e20a6[_0x82c8('0x43')]['port'];_0x40c513[_0x82c8('0x3f')]=_0x1e20a6[_0x82c8('0x44')][_0x82c8('0x3f')];_0x40c513[_0x82c8('0x40')]=_0x1e20a6[_0x82c8('0x44')]['port'];}return{'Imap':_0x55830e,'Smtp':_0x40c513};}exports[_0x82c8('0x45')]=function(_0xaca012,_0x3530c7){var _0x567bac={'include':[{'model':db[_0x82c8('0x46')],'as':'Imap'},{'model':db[_0x82c8('0x47')],'as':'Smtp'},{'model':db[_0x82c8('0x48')],'as':_0x82c8('0x49')}]},_0x41000d={},_0x5f8c80={'count':0x0,'rows':[]};var _0x46f689=_[_0x82c8('0x4a')](db[_0x82c8('0x4b')]['rawAttributes'],function(_0x4dce59){return{'name':_0x4dce59[_0x82c8('0x4c')],'type':_0x4dce59[_0x82c8('0x4d')]['key']};});_0x41000d[_0x82c8('0x4e')]=_[_0x82c8('0x4a')](_0x46f689,'name');_0x41000d[_0x82c8('0x4f')]=_['keys'](_0xaca012['query']);_0x41000d[_0x82c8('0x50')]=_[_0x82c8('0x51')](_0x41000d[_0x82c8('0x4e')],_0x41000d[_0x82c8('0x4f')]);_0x567bac[_0x82c8('0x52')]=_['intersection'](_0x41000d[_0x82c8('0x4e')],qs[_0x82c8('0x53')](_0xaca012[_0x82c8('0x4f')][_0x82c8('0x53')]));_0x567bac[_0x82c8('0x52')]=_0x567bac[_0x82c8('0x52')]['length']?_0x567bac['attributes']:_0x41000d[_0x82c8('0x4e')];if(!_0xaca012[_0x82c8('0x4f')][_0x82c8('0x54')]('nolimit')){_0x567bac['limit']=qs[_0x82c8('0x22')](_0xaca012[_0x82c8('0x4f')][_0x82c8('0x22')]);_0x567bac[_0x82c8('0x1f')]=qs[_0x82c8('0x1f')](_0xaca012[_0x82c8('0x4f')]['offset']);}_0x567bac[_0x82c8('0x55')]=qs[_0x82c8('0x56')](_0xaca012[_0x82c8('0x4f')][_0x82c8('0x56')]);_0x567bac['where']=qs[_0x82c8('0x50')](_[_0x82c8('0x57')](_0xaca012['query'],_0x41000d['filters']),_0x46f689);if(_0xaca012['query'][_0x82c8('0x58')]){_0x567bac['where']=_['merge'](_0x567bac['where'],{'$or':_[_0x82c8('0x4a')](_0x46f689,function(_0x18787d){if(_0x18787d[_0x82c8('0x4d')]!=='VIRTUAL'){var _0x374688={};_0x374688[_0x18787d['name']]={'$like':'%'+_0xaca012[_0x82c8('0x4f')][_0x82c8('0x58')]+'%'};return _0x374688;}})});}_0x567bac=_[_0x82c8('0x59')]({},_0x567bac,_0xaca012[_0x82c8('0x5a')]);var _0x3db62e={'where':_0x567bac[_0x82c8('0x5b')]};return db[_0x82c8('0x4b')][_0x82c8('0x21')](_0x3db62e)[_0x82c8('0x26')](function(_0x480f11){_0x5f8c80[_0x82c8('0x21')]=_0x480f11;if(_0xaca012[_0x82c8('0x4f')][_0x82c8('0x5c')]){_0x567bac[_0x82c8('0x5d')]=[{'all':!![]}];}return db[_0x82c8('0x4b')][_0x82c8('0x5e')](_0x567bac);})['then'](function(_0x133ced){_0x5f8c80[_0x82c8('0x5f')]=_0x133ced;return _0x5f8c80;})['then'](respondWithFilteredResult(_0x3530c7,_0x567bac))[_0x82c8('0x1b')](handleError(_0x3530c7,null));};exports[_0x82c8('0x60')]=function(_0x254acf,_0x4b68f8){var _0x476484={'raw':![],'where':{'id':_0x254acf[_0x82c8('0x61')]['id']},'include':[{'model':db[_0x82c8('0x46')],'as':_0x82c8('0x43')},{'model':db[_0x82c8('0x47')],'as':_0x82c8('0x44')},{'model':db[_0x82c8('0x48')],'as':'mandatoryDispositionPause'}]},_0x1d25b9={};_0x1d25b9['model']=_[_0x82c8('0x62')](db[_0x82c8('0x4b')]['rawAttributes']);_0x1d25b9['query']=_[_0x82c8('0x62')](_0x254acf[_0x82c8('0x4f')]);_0x1d25b9['filters']=_['intersection'](_0x1d25b9[_0x82c8('0x4e')],_0x1d25b9[_0x82c8('0x4f')]);_0x476484[_0x82c8('0x52')]=_[_0x82c8('0x51')](_0x1d25b9['model'],qs[_0x82c8('0x53')](_0x254acf[_0x82c8('0x4f')][_0x82c8('0x53')]));_0x476484['attributes']=_0x476484[_0x82c8('0x52')][_0x82c8('0x63')]?_0x476484['attributes']:_0x1d25b9[_0x82c8('0x4e')];if(_0x254acf[_0x82c8('0x4f')]['includeAll']){_0x476484['include']=[{'all':!![]}];}_0x476484=_[_0x82c8('0x59')]({},_0x476484,_0x254acf[_0x82c8('0x5a')]);return db[_0x82c8('0x4b')][_0x82c8('0x64')](_0x476484)[_0x82c8('0x26')](handleEntityNotFound(_0x4b68f8,null))[_0x82c8('0x26')](respondWithResult(_0x4b68f8,null))[_0x82c8('0x1b')](handleError(_0x4b68f8,null));};exports[_0x82c8('0x65')]=function(_0x58a941,_0x3abe1d){if(_0x58a941['body']['id']){delete _0x58a941['body']['id'];}var _0x555a56=_0x58a941[_0x82c8('0x66')][_0x82c8('0x67')]==='custom'?null:_0x58a941[_0x82c8('0x66')]['provider'];var _0x3d6e0e=_0x58a941[_0x82c8('0x66')][_0x82c8('0x43')]||{};var _0x4503ae=_0x58a941[_0x82c8('0x66')][_0x82c8('0x44')]||{};if(_0x555a56){_0x3d6e0e[_0x82c8('0x3f')]=getImapHost(_0x555a56);_0x3d6e0e[_0x82c8('0x40')]=0x3e1;_0x4503ae[_0x82c8('0x3f')]=getSmtpHost(_0x555a56);_0x4503ae['port']=0x24b;_0x4503ae['secure']=![];}if(_0x4503ae[_0x82c8('0x3d')]){_0x4503ae['secure']=![];}else{_0x4503ae[_0x82c8('0x3e')]=null;}if(!_0x3d6e0e[_0x82c8('0x3d')])_0x3d6e0e[_0x82c8('0x3e')]=null;_0x58a941[_0x82c8('0x66')][_0x82c8('0x43')]=_0x3d6e0e;_0x58a941[_0x82c8('0x66')][_0x82c8('0x44')]=_0x4503ae;return db['MailAccount']['find']({'where':{'id':_0x58a941[_0x82c8('0x61')]['id']},'include':[{'model':db['MailServerIn'],'as':'Imap'},{'model':db['MailServerOut'],'as':_0x82c8('0x44')},{'model':db[_0x82c8('0x48')],'as':_0x82c8('0x49')}]})['then'](handleEntityNotFound(_0x3abe1d,null))[_0x82c8('0x26')](function(_0x42f021){if(!_0x42f021)throw new Error('Mail\x20Account\x20not\x20found');if(_0x42f021['service'])delete _0x58a941[_0x82c8('0x66')][_0x82c8('0x43')];return _0x42f021;})['then'](saveUpdates(_0x58a941[_0x82c8('0x66')],null))[_0x82c8('0x26')](function(_0x5c0eb6){if(!_0x58a941['body']['Imap'])return _0x5c0eb6;return db[_0x82c8('0x46')][_0x82c8('0x65')](_0x58a941[_0x82c8('0x66')][_0x82c8('0x43')],{'where':{'MailAccountId':_0x5c0eb6['id']}})[_0x82c8('0x26')](function(){return _0x5c0eb6;});})[_0x82c8('0x26')](function(_0x289a8e){if(!_0x58a941['body'][_0x82c8('0x44')])return _0x289a8e;return db['MailServerOut'][_0x82c8('0x65')](_0x58a941[_0x82c8('0x66')][_0x82c8('0x44')],{'where':{'MailAccountId':_0x289a8e['id']}})[_0x82c8('0x26')](function(){return _0x289a8e;});})[_0x82c8('0x26')](respondWithResult(_0x3abe1d,null))[_0x82c8('0x1b')](handleError(_0x3abe1d,null));};exports[_0x82c8('0x68')]=function(_0x358272,_0x4b4021){return db[_0x82c8('0x4b')]['describe']()[_0x82c8('0x26')](respondWithResult(_0x4b4021,null))['catch'](handleError(_0x4b4021,null));};exports[_0x82c8('0x69')]=function(_0x1c1fa2,_0x508564){if(_0x1c1fa2['body']['id']){delete _0x1c1fa2[_0x82c8('0x66')]['id'];}return db[_0x82c8('0x4b')][_0x82c8('0x64')]({'where':{'id':_0x1c1fa2[_0x82c8('0x61')]['id']}})['then'](handleEntityNotFound(_0x508564,null))[_0x82c8('0x26')](function(_0x460ec4){if(_0x460ec4){_0x1c1fa2[_0x82c8('0x66')][_0x82c8('0x6a')]=_0x460ec4['id'];return db[_0x82c8('0x6b')][_0x82c8('0x6c')](_0x1c1fa2[_0x82c8('0x66')]);}})[_0x82c8('0x26')](respondWithResult(_0x508564,null))[_0x82c8('0x1b')](handleError(_0x508564,null));};exports[_0x82c8('0x6d')]=function(_0x42d701,_0x300f66){var _0x469496={'raw':![],'where':{}};var _0xb8ba98={};var _0x123771={'count':0x0,'rows':[]};return db[_0x82c8('0x4b')][_0x82c8('0x6e')]({'where':{'id':_0x42d701['params']['id']}})['then'](handleEntityNotFound(_0x300f66,null))['then'](function(_0x11efee){if(_0x11efee){_0xb8ba98[_0x82c8('0x4e')]=_[_0x82c8('0x62')](db['Disposition'][_0x82c8('0x6f')]);_0xb8ba98[_0x82c8('0x4f')]=_[_0x82c8('0x62')](_0x42d701[_0x82c8('0x4f')]);_0xb8ba98[_0x82c8('0x50')]=_[_0x82c8('0x51')](_0xb8ba98[_0x82c8('0x4e')],_0xb8ba98[_0x82c8('0x4f')]);_0x469496[_0x82c8('0x52')]=_['intersection'](_0xb8ba98[_0x82c8('0x4e')],qs[_0x82c8('0x53')](_0x42d701['query']['fields']));_0x469496['attributes']=_0x469496['attributes'][_0x82c8('0x63')]?_0x469496[_0x82c8('0x52')]:_0xb8ba98[_0x82c8('0x4e')];if(!_0x42d701[_0x82c8('0x4f')][_0x82c8('0x54')](_0x82c8('0x70'))){_0x469496['limit']=qs[_0x82c8('0x22')](_0x42d701['query'][_0x82c8('0x22')]);_0x469496[_0x82c8('0x1f')]=qs[_0x82c8('0x1f')](_0x42d701[_0x82c8('0x4f')][_0x82c8('0x1f')]);}_0x469496['order']=qs[_0x82c8('0x56')](_0x42d701[_0x82c8('0x4f')][_0x82c8('0x56')]);_0x469496[_0x82c8('0x5b')]=qs[_0x82c8('0x50')](_[_0x82c8('0x57')](_0x42d701[_0x82c8('0x4f')],_0xb8ba98[_0x82c8('0x50')]));_0x469496[_0x82c8('0x5b')][_0x82c8('0x6a')]=_0x11efee['id'];if(_0x42d701[_0x82c8('0x4f')][_0x82c8('0x58')]){_0x469496[_0x82c8('0x5b')]=_[_0x82c8('0x59')](_0x469496[_0x82c8('0x5b')],{'$or':_[_0x82c8('0x4a')](_0x469496[_0x82c8('0x52')],function(_0x5a535f){var _0x5b501f={};_0x5b501f[_0x5a535f]={'$like':'%'+_0x42d701[_0x82c8('0x4f')][_0x82c8('0x58')]+'%'};return _0x5b501f;})});}_0x469496=_[_0x82c8('0x59')]({},_0x469496,_0x42d701[_0x82c8('0x5a')]);return db[_0x82c8('0x6b')]['count']({'where':_0x469496[_0x82c8('0x5b')]})['then'](function(_0x27b131){_0x123771['count']=_0x27b131;if(_0x42d701[_0x82c8('0x4f')][_0x82c8('0x5c')]){_0x469496[_0x82c8('0x5d')]=[{'all':!![]}];}return db[_0x82c8('0x6b')][_0x82c8('0x5e')](_0x469496);})[_0x82c8('0x26')](function(_0x4dce5f){_0x123771[_0x82c8('0x5f')]=_0x4dce5f;return _0x123771;});}})[_0x82c8('0x26')](respondWithFilteredResult(_0x300f66,_0x469496))[_0x82c8('0x1b')](handleError(_0x300f66,null));};exports[_0x82c8('0x71')]=function(_0x4883d8,_0x571c86){return db[_0x82c8('0x4b')][_0x82c8('0x64')]({'where':{'id':_0x4883d8[_0x82c8('0x61')]['id']}})[_0x82c8('0x26')](handleEntityNotFound(_0x571c86,null))[_0x82c8('0x26')](function(_0x2a1c3e){if(_0x2a1c3e){return _0x2a1c3e[_0x82c8('0x71')](_0x4883d8[_0x82c8('0x4f')][_0x82c8('0x72')]);}})['then'](respondWithStatusCode(_0x571c86,null))[_0x82c8('0x1b')](handleError(_0x571c86,null));};exports[_0x82c8('0x73')]=function(_0x2effc5,_0x3bf843){if(_0x2effc5[_0x82c8('0x66')]['id']){delete _0x2effc5[_0x82c8('0x66')]['id'];}return db[_0x82c8('0x4b')]['find']({'where':{'id':_0x2effc5[_0x82c8('0x61')]['id']}})[_0x82c8('0x26')](handleEntityNotFound(_0x3bf843,null))['then'](function(_0x1dd3d7){if(_0x1dd3d7){_0x2effc5[_0x82c8('0x66')]['MailAccountId']=_0x1dd3d7['id'];return db['CannedAnswer']['create'](_0x2effc5['body']);}})[_0x82c8('0x26')](respondWithResult(_0x3bf843,null))[_0x82c8('0x1b')](handleError(_0x3bf843,null));};exports['getAnswers']=function(_0x854b17,_0x58ae76){var _0x2c3b84={'raw':![],'where':{}};var _0xe8c658={};var _0x3cd5db={'count':0x0,'rows':[]};return db['MailAccount'][_0x82c8('0x6e')]({'where':{'id':_0x854b17[_0x82c8('0x61')]['id']}})[_0x82c8('0x26')](handleEntityNotFound(_0x58ae76,null))[_0x82c8('0x26')](function(_0x3a9a0d){if(_0x3a9a0d){_0xe8c658[_0x82c8('0x4e')]=_[_0x82c8('0x62')](db[_0x82c8('0x74')][_0x82c8('0x6f')]);_0xe8c658['query']=_[_0x82c8('0x62')](_0x854b17[_0x82c8('0x4f')]);_0xe8c658[_0x82c8('0x50')]=_[_0x82c8('0x51')](_0xe8c658[_0x82c8('0x4e')],_0xe8c658[_0x82c8('0x4f')]);_0x2c3b84[_0x82c8('0x52')]=_[_0x82c8('0x51')](_0xe8c658[_0x82c8('0x4e')],qs[_0x82c8('0x53')](_0x854b17[_0x82c8('0x4f')][_0x82c8('0x53')]));_0x2c3b84[_0x82c8('0x52')]=_0x2c3b84[_0x82c8('0x52')][_0x82c8('0x63')]?_0x2c3b84['attributes']:_0xe8c658['model'];if(!_0x854b17['query'][_0x82c8('0x54')](_0x82c8('0x70'))){_0x2c3b84[_0x82c8('0x22')]=qs[_0x82c8('0x22')](_0x854b17[_0x82c8('0x4f')][_0x82c8('0x22')]);_0x2c3b84['offset']=qs[_0x82c8('0x1f')](_0x854b17['query'][_0x82c8('0x1f')]);}_0x2c3b84[_0x82c8('0x55')]=qs[_0x82c8('0x56')](_0x854b17[_0x82c8('0x4f')]['sort']);_0x2c3b84[_0x82c8('0x5b')]=qs[_0x82c8('0x50')](_[_0x82c8('0x57')](_0x854b17['query'],_0xe8c658[_0x82c8('0x50')]));_0x2c3b84[_0x82c8('0x5b')][_0x82c8('0x6a')]=_0x3a9a0d['id'];if(_0x854b17[_0x82c8('0x4f')][_0x82c8('0x58')]){_0x2c3b84['where']=_['merge'](_0x2c3b84[_0x82c8('0x5b')],{'$or':_['map'](_0x2c3b84[_0x82c8('0x52')],function(_0x482c87){var _0x575458={};_0x575458[_0x482c87]={'$like':'%'+_0x854b17['query'][_0x82c8('0x58')]+'%'};return _0x575458;})});}_0x2c3b84=_['merge']({},_0x2c3b84,_0x854b17[_0x82c8('0x5a')]);return db[_0x82c8('0x74')][_0x82c8('0x21')]({'where':_0x2c3b84[_0x82c8('0x5b')]})[_0x82c8('0x26')](function(_0x588a29){_0x3cd5db[_0x82c8('0x21')]=_0x588a29;if(_0x854b17['query'][_0x82c8('0x5c')]){_0x2c3b84[_0x82c8('0x5d')]=[{'all':!![]}];}return db['CannedAnswer'][_0x82c8('0x5e')](_0x2c3b84);})[_0x82c8('0x26')](function(_0x57701b){_0x3cd5db['rows']=_0x57701b;return _0x3cd5db;});}})[_0x82c8('0x26')](respondWithFilteredResult(_0x58ae76,_0x2c3b84))['catch'](handleError(_0x58ae76,null));};exports[_0x82c8('0x75')]=function(_0x1bdbd3,_0x3b0c41){return db[_0x82c8('0x4b')][_0x82c8('0x64')]({'where':{'id':_0x1bdbd3[_0x82c8('0x61')]['id']}})[_0x82c8('0x26')](handleEntityNotFound(_0x3b0c41,null))['then'](function(_0x32a101){if(_0x32a101){return _0x32a101[_0x82c8('0x75')](_0x1bdbd3[_0x82c8('0x4f')][_0x82c8('0x72')]);}})[_0x82c8('0x26')](respondWithStatusCode(_0x3b0c41,null))['catch'](handleError(_0x3b0c41,null));};exports['create']=function(_0x1c6ed3,_0x56a5ab){var _0x9c5349={'name':_0x1c6ed3[_0x82c8('0x66')]['name'],'key':_0x1c6ed3['body'][_0x82c8('0x76')],'provider':_0x1c6ed3[_0x82c8('0x66')][_0x82c8('0x67')]===_0x82c8('0x77')?null:_0x1c6ed3[_0x82c8('0x66')][_0x82c8('0x67')],'email':_0x1c6ed3[_0x82c8('0x66')][_0x82c8('0x78')],'ListId':_0x1c6ed3['body'][_0x82c8('0x79')],'active':!_[_0x82c8('0x7a')](_0x1c6ed3['body']['active'])?_0x1c6ed3[_0x82c8('0x66')][_0x82c8('0x7b')]:!![],'description':_0x1c6ed3[_0x82c8('0x66')][_0x82c8('0x7c')]||null};var _0x7372ed=getAuthenticationOptions(_0x9c5349[_0x82c8('0x67')],_0x1c6ed3['body']);_0x9c5349[_0x82c8('0x43')]=_0x7372ed[_0x82c8('0x43')];_0x9c5349[_0x82c8('0x44')]=_0x7372ed[_0x82c8('0x44')];return db[_0x82c8('0x4b')][_0x82c8('0x6c')](_0x9c5349,{'include':[{'model':db[_0x82c8('0x47')],'as':_0x82c8('0x44')},{'model':db[_0x82c8('0x46')],'as':_0x82c8('0x43')}]})['then'](function(_0x5b730d){var _0x52a67f=_0x1c6ed3['user'][_0x82c8('0x28')]({'plain':!![]});if(!_0x52a67f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x52a67f[_0x82c8('0x7d')]===_0x82c8('0x39')){var _0x2f013d=_0x5b730d[_0x82c8('0x28')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':'MailAccounts','userProfileId':_0x52a67f['userProfileId']},'raw':!![]})[_0x82c8('0x26')](function(_0x530442){if(_0x530442&&_0x530442[_0x82c8('0x7e')]===0x0){return db[_0x82c8('0x7f')][_0x82c8('0x6c')]({'name':_0x2f013d['name'],'resourceId':_0x2f013d['id'],'type':_0x530442['name'],'sectionId':_0x530442['id']},{})[_0x82c8('0x26')](function(){return _0x5b730d;});}else{return _0x5b730d;}})['catch'](function(_0x619aeb){logger[_0x82c8('0x16')](_0x82c8('0x80'),_0x619aeb);throw _0x619aeb;});}return _0x5b730d;})[_0x82c8('0x26')](respondWithResult(_0x56a5ab,0xc9))[_0x82c8('0x1b')](handleError(_0x56a5ab,null));};exports[_0x82c8('0x81')]=function(_0x30c1e7,_0x19ad46){return db[_0x82c8('0x4b')][_0x82c8('0x6e')]({'where':{'id':_0x30c1e7[_0x82c8('0x61')]['id']}})['then'](handleEntityNotFound(_0x19ad46,null))[_0x82c8('0x26')](function(_0x17edcf){if(_0x17edcf){return _0x17edcf[_0x82c8('0x81')]();}return null;})[_0x82c8('0x26')](respondWithResult(_0x19ad46,null))[_0x82c8('0x1b')](handleError(_0x19ad46,null));};exports[_0x82c8('0x82')]=function(_0x533581,_0x45b44e){if(_0x533581[_0x82c8('0x66')]['id']){delete _0x533581[_0x82c8('0x66')]['id'];}return db[_0x82c8('0x4b')]['find']({'where':{'id':_0x533581[_0x82c8('0x61')]['id']}})['then'](handleEntityNotFound(_0x45b44e,null))[_0x82c8('0x26')](function(_0x48ab02){if(_0x48ab02){_0x533581[_0x82c8('0x66')]['MailAccountId']=_0x48ab02['id'];return db['MailServerIn']['create'](_0x533581[_0x82c8('0x66')]);}})[_0x82c8('0x26')](respondWithResult(_0x45b44e,null))[_0x82c8('0x1b')](handleError(_0x45b44e,null));};exports[_0x82c8('0x83')]=function(_0x23925f,_0x48c6f0){return db['MailAccount'][_0x82c8('0x6e')]({'where':{'id':_0x23925f[_0x82c8('0x61')]['id']}})[_0x82c8('0x26')](handleEntityNotFound(_0x48c6f0,null))[_0x82c8('0x26')](function(_0x3eba0b){if(_0x3eba0b){return _0x3eba0b[_0x82c8('0x84')](null);}return null;})[_0x82c8('0x26')](respondWithStatusCode(_0x48c6f0,null))[_0x82c8('0x1b')](handleError(_0x48c6f0,null));};exports[_0x82c8('0x85')]=function(_0x1f6bb6,_0x4ed0c0){return db[_0x82c8('0x4b')]['findOne']({'where':{'id':_0x1f6bb6[_0x82c8('0x61')]['id']}})['then'](handleEntityNotFound(_0x4ed0c0,null))[_0x82c8('0x26')](function(_0x13681d){if(_0x13681d){return _0x13681d[_0x82c8('0x85')]();}return null;})['then'](respondWithResult(_0x4ed0c0,null))[_0x82c8('0x1b')](handleError(_0x4ed0c0,null));};exports[_0x82c8('0x86')]=function(_0x4d481f,_0x1fe47d){if(_0x4d481f[_0x82c8('0x66')]['id']){delete _0x4d481f[_0x82c8('0x66')]['id'];}return db[_0x82c8('0x4b')][_0x82c8('0x64')]({'where':{'id':_0x4d481f['params']['id']}})[_0x82c8('0x26')](handleEntityNotFound(_0x1fe47d,null))[_0x82c8('0x26')](function(_0x27b83c){if(_0x27b83c){_0x4d481f[_0x82c8('0x66')]['MailAccountId']=_0x27b83c['id'];return db[_0x82c8('0x47')]['create'](_0x4d481f[_0x82c8('0x66')]);}})['then'](respondWithResult(_0x1fe47d,null))[_0x82c8('0x1b')](handleError(_0x1fe47d,null));};exports[_0x82c8('0x87')]=function(_0x1d60d7,_0x526553){return db[_0x82c8('0x4b')][_0x82c8('0x6e')]({'where':{'id':_0x1d60d7[_0x82c8('0x61')]['id']}})[_0x82c8('0x26')](handleEntityNotFound(_0x526553,null))[_0x82c8('0x26')](function(_0x9f766){if(_0x9f766){return _0x9f766[_0x82c8('0x88')](null);}return null;})[_0x82c8('0x26')](respondWithStatusCode(_0x526553,null))[_0x82c8('0x1b')](handleError(_0x526553,null));};exports['addInteraction']=function(_0xce34a8,_0x2c8b3e){return db[_0x82c8('0x89')][_0x82c8('0x64')]({'where':{'id':_0xce34a8[_0x82c8('0x61')]['id']}})[_0x82c8('0x26')](handleEntityNotFound(_0x2c8b3e,null))[_0x82c8('0x26')](function(_0x1e343a){if(_0x1e343a){return _0x1e343a[_0x82c8('0x8a')](_0xce34a8[_0x82c8('0x66')][_0x82c8('0x72')],_[_0x82c8('0x8b')](_0xce34a8[_0x82c8('0x66')],['ids','id'])||{});}})[_0x82c8('0x26')](respondWithResult(_0x2c8b3e,null))['catch'](handleError(_0x2c8b3e,null));};exports[_0x82c8('0x8c')]=function(_0xe683d9,_0x50a522){var _0x5d278d={'raw':![],'where':{}};var _0x2eb8b5={};var _0x11cdc8={'count':0x0,'rows':[]};return db['MailAccount'][_0x82c8('0x6e')]({'where':{'id':_0xe683d9[_0x82c8('0x61')]['id']}})[_0x82c8('0x26')](handleEntityNotFound(_0x50a522,null))['then'](function(_0x4b1914){if(_0x4b1914){_0x2eb8b5[_0x82c8('0x4e')]=_['keys'](db[_0x82c8('0x89')][_0x82c8('0x6f')]);_0x2eb8b5[_0x82c8('0x4f')]=_[_0x82c8('0x62')](_0xe683d9['query']);_0x2eb8b5['filters']=_[_0x82c8('0x51')](_0x2eb8b5[_0x82c8('0x4e')],_0x2eb8b5['query']);_0x5d278d[_0x82c8('0x52')]=_[_0x82c8('0x51')](_0x2eb8b5[_0x82c8('0x4e')],qs[_0x82c8('0x53')](_0xe683d9[_0x82c8('0x4f')][_0x82c8('0x53')]));_0x5d278d[_0x82c8('0x52')]=_0x5d278d[_0x82c8('0x52')][_0x82c8('0x63')]?_0x5d278d[_0x82c8('0x52')]:_0x2eb8b5[_0x82c8('0x4e')];if(!_0xe683d9[_0x82c8('0x4f')][_0x82c8('0x54')](_0x82c8('0x70'))){_0x5d278d['limit']=qs[_0x82c8('0x22')](_0xe683d9[_0x82c8('0x4f')][_0x82c8('0x22')]);_0x5d278d[_0x82c8('0x1f')]=qs['offset'](_0xe683d9[_0x82c8('0x4f')][_0x82c8('0x1f')]);}_0x5d278d[_0x82c8('0x55')]=qs[_0x82c8('0x56')](_0xe683d9['query']['sort']);_0x5d278d['where']=qs[_0x82c8('0x50')](_[_0x82c8('0x57')](_0xe683d9[_0x82c8('0x4f')],_0x2eb8b5[_0x82c8('0x50')]));_0x5d278d[_0x82c8('0x5b')][_0x82c8('0x6a')]=_0x4b1914['id'];if(_0xe683d9['query'][_0x82c8('0x58')]){_0x5d278d[_0x82c8('0x5b')]=_['merge'](_0x5d278d[_0x82c8('0x5b')],{'$or':_[_0x82c8('0x4a')](_0x5d278d[_0x82c8('0x52')],function(_0x2f1fae){var _0x1d7391={};_0x1d7391[_0x2f1fae]={'$like':'%'+_0xe683d9['query'][_0x82c8('0x58')]+'%'};return _0x1d7391;})});}_0x5d278d=_['merge']({},_0x5d278d,_0xe683d9['options']);return db[_0x82c8('0x89')][_0x82c8('0x21')]({'where':_0x5d278d[_0x82c8('0x5b')]})['then'](function(_0x39ca38){_0x11cdc8[_0x82c8('0x21')]=_0x39ca38;if(_0xe683d9['query'][_0x82c8('0x5c')]){_0x5d278d[_0x82c8('0x5d')]=[{'model':db[_0x82c8('0x8d')],'as':_0x82c8('0x8e'),'required':![]},{'model':db[_0x82c8('0x8f')],'as':'Owner','attributes':[_0x82c8('0x2b'),_0x82c8('0x90'),'internal'],'required':![]},{'model':db[_0x82c8('0x91')],'as':_0x82c8('0x92'),'attributes':['id',_0x82c8('0x2b'),'color'],'where':_0xe683d9['query']['tag']?{'id':_0xe683d9['query']['tag']}:undefined,'required':_0xe683d9[_0x82c8('0x4f')][_0x82c8('0x93')]?!![]:![]}];}return db[_0x82c8('0x89')][_0x82c8('0x5e')](_0x5d278d);})[_0x82c8('0x26')](function(_0x269d5f){_0x11cdc8[_0x82c8('0x5f')]=_0x269d5f;return _0x11cdc8;});}})[_0x82c8('0x26')](respondWithFilteredResult(_0x50a522,_0x5d278d))['catch'](handleError(_0x50a522,null));};exports[_0x82c8('0x94')]=function addApplications(_0x1c47a9,_0x331d24){var _0x3ea0fb=_0x1c47a9[_0x82c8('0x61')]['id'];var _0x34475d=_0x1c47a9[_0x82c8('0x66')];var _0x4e32d6=0xc8;var _0x1f7df8=null;return db['sequelize'][_0x82c8('0x95')]({'isolationLevel':db[_0x82c8('0x96')]['Transaction'][_0x82c8('0x97')]['READ_COMMITTED']},function(_0x2b3339){return db[_0x82c8('0x4b')][_0x82c8('0x6e')]({'where':{'id':_0x3ea0fb},'transaction':_0x2b3339})['then'](function(_0xe43701){if(_0xe43701){return db['MailApplication'][_0x82c8('0x27')]({'where':{'MailAccountId':_0x3ea0fb},'transaction':_0x2b3339})[_0x82c8('0x26')](function(){var _0x546436=_['map'](_0x34475d,function(_0x34b1fe){_0x34b1fe[_0x82c8('0x6a')]=_0x3ea0fb;return _0x34b1fe;});return db[_0x82c8('0x98')][_0x82c8('0x99')](_0x546436,{'transaction':_0x2b3339});});}else{_0x4e32d6=0x194;_0x1f7df8=[];}});})['then'](function(){if(_0x4e32d6!==0x194){return db[_0x82c8('0x98')][_0x82c8('0x9a')]({'where':{'MailAccountId':_0x3ea0fb},'order':'priority'})[_0x82c8('0x26')](function(_0x4add6f){_0x1f7df8=_0x4add6f;});}})[_0x82c8('0x1b')](function(_0x105372){_0x4e32d6=0x1f4;logger[_0x82c8('0x16')](_0x105372[_0x82c8('0x2a')]);if(_0x105372[_0x82c8('0x2b')]){delete _0x105372['name'];}_0x1f7df8=_0x105372;})[_0x82c8('0x9b')](function(){if(_0x1f7df8===null){_0x331d24[_0x82c8('0x1c')](_0x4e32d6);}else{if(_0x4e32d6===0x1f4){_0x331d24[_0x82c8('0x23')](_0x4e32d6)[_0x82c8('0x9c')](_0x1f7df8);}else{_0x331d24['status'](_0x4e32d6)[_0x82c8('0x1e')](_0x1f7df8);}}});};exports[_0x82c8('0x9d')]=function(_0x51d60a,_0x3c8457){var _0x839863={};var _0x2c7946={};var _0x349e7a;var _0x1830e0;return db[_0x82c8('0x4b')][_0x82c8('0x6e')]({'where':{'id':_0x51d60a[_0x82c8('0x61')]['id']}})['then'](handleEntityNotFound(_0x3c8457,null))[_0x82c8('0x26')](function(_0xc6819b){if(_0xc6819b){_0x349e7a=_0xc6819b;_0x2c7946['model']=_[_0x82c8('0x62')](db[_0x82c8('0x98')][_0x82c8('0x6f')]);_0x2c7946[_0x82c8('0x4f')]=_[_0x82c8('0x62')](_0x51d60a[_0x82c8('0x4f')]);_0x2c7946[_0x82c8('0x50')]=_[_0x82c8('0x51')](_0x2c7946[_0x82c8('0x4e')],_0x2c7946[_0x82c8('0x4f')]);_0x839863[_0x82c8('0x52')]=_[_0x82c8('0x51')](_0x2c7946['model'],qs[_0x82c8('0x53')](_0x51d60a[_0x82c8('0x4f')][_0x82c8('0x53')]));_0x839863[_0x82c8('0x52')]=_0x839863[_0x82c8('0x52')][_0x82c8('0x63')]?_0x839863['attributes']:_0x2c7946[_0x82c8('0x4e')];_0x839863[_0x82c8('0x55')]=qs[_0x82c8('0x56')](_0x51d60a[_0x82c8('0x4f')][_0x82c8('0x56')]);_0x839863['where']=qs[_0x82c8('0x50')](_[_0x82c8('0x57')](_0x51d60a[_0x82c8('0x4f')],_0x2c7946[_0x82c8('0x50')]));if(_0x51d60a[_0x82c8('0x4f')][_0x82c8('0x58')]){_0x839863[_0x82c8('0x5b')]=_[_0x82c8('0x59')](_0x839863[_0x82c8('0x5b')],{'$or':_[_0x82c8('0x4a')](_0x839863[_0x82c8('0x52')],function(_0x5ad06a){var _0x2c2e06={};_0x2c2e06[_0x5ad06a]={'$like':'%'+_0x51d60a['query'][_0x82c8('0x58')]+'%'};return _0x2c2e06;})});}_0x839863=_[_0x82c8('0x59')]({},_0x839863,_0x51d60a['options']);return _0x349e7a[_0x82c8('0x9d')](_0x839863);}})[_0x82c8('0x26')](function(_0x54f8c8){if(_0x54f8c8){_0x1830e0=_0x54f8c8[_0x82c8('0x63')];if(!_0x51d60a[_0x82c8('0x4f')][_0x82c8('0x54')](_0x82c8('0x70'))){_0x839863[_0x82c8('0x22')]=qs[_0x82c8('0x22')](_0x51d60a[_0x82c8('0x4f')][_0x82c8('0x22')]);_0x839863['offset']=qs[_0x82c8('0x1f')](_0x51d60a['query'][_0x82c8('0x1f')]);}return _0x349e7a[_0x82c8('0x9d')](_0x839863);}})[_0x82c8('0x26')](function(_0xd93b61){if(_0xd93b61){return _0xd93b61?{'count':_0x1830e0,'rows':_0xd93b61}:null;}})[_0x82c8('0x26')](respondWithResult(_0x3c8457,null))[_0x82c8('0x1b')](handleError(_0x3c8457,null));};exports[_0x82c8('0x9e')]=function(_0x160622,_0x195459){var _0x589c5e={'raw':!![],'where':{}};var _0x44a95b={};var _0x3bb20c={'count':0x0,'rows':[]};return db[_0x82c8('0x4b')][_0x82c8('0x6e')]({'where':{'id':_0x160622[_0x82c8('0x61')]['id']}})[_0x82c8('0x26')](handleEntityNotFound(_0x195459,null))['then'](function(_0x1d9dd5){if(_0x1d9dd5){_0x44a95b[_0x82c8('0x4e')]=_[_0x82c8('0x62')](db['MailMessage']['rawAttributes']);_0x44a95b['query']=_[_0x82c8('0x62')](_0x160622[_0x82c8('0x4f')]);_0x44a95b[_0x82c8('0x50')]=_[_0x82c8('0x51')](_0x44a95b[_0x82c8('0x4e')],_0x44a95b['query']);_0x589c5e[_0x82c8('0x52')]=_[_0x82c8('0x51')](_0x44a95b['model'],qs[_0x82c8('0x53')](_0x160622[_0x82c8('0x4f')][_0x82c8('0x53')]));_0x589c5e['attributes']=_0x589c5e[_0x82c8('0x52')][_0x82c8('0x63')]?_0x589c5e[_0x82c8('0x52')]:_0x44a95b[_0x82c8('0x4e')];if(!_0x160622['query'][_0x82c8('0x54')](_0x82c8('0x70'))){_0x589c5e[_0x82c8('0x22')]=qs['limit'](_0x160622[_0x82c8('0x4f')][_0x82c8('0x22')]);_0x589c5e[_0x82c8('0x1f')]=qs['offset'](_0x160622[_0x82c8('0x4f')][_0x82c8('0x1f')]);}_0x589c5e['order']=qs[_0x82c8('0x56')](_0x160622[_0x82c8('0x4f')][_0x82c8('0x56')]);_0x589c5e[_0x82c8('0x5b')]=qs['filters'](_['pick'](_0x160622['query'],_0x44a95b[_0x82c8('0x50')]));_0x589c5e[_0x82c8('0x5b')]['MailAccountId']=_0x1d9dd5['id'];if(_0x160622[_0x82c8('0x4f')]['filter']){_0x589c5e[_0x82c8('0x5b')]=_[_0x82c8('0x59')](_0x589c5e[_0x82c8('0x5b')],{'$or':_[_0x82c8('0x4a')](_0x589c5e['attributes'],function(_0x4b3e16){var _0x19f1fa={};_0x19f1fa[_0x4b3e16]={'$like':'%'+_0x160622[_0x82c8('0x4f')][_0x82c8('0x58')]+'%'};return _0x19f1fa;})});}if(_0x160622[_0x82c8('0x4f')][_0x82c8('0x9f')]){var _0x169e6e=_0x160622['query'][_0x82c8('0x9f')]['split'](',');var _0x5bc577={};_0x5bc577[_0x169e6e[0x0]]={'$gte':moment(_0x169e6e[0x1])[_0x82c8('0xa0')]('YYYY-MM-DD\x20HH:mm:ss')};_0x589c5e[_0x82c8('0x5b')]=_[_0x82c8('0x59')](_0x589c5e[_0x82c8('0x5b')],_0x5bc577);}_0x589c5e=_[_0x82c8('0x59')]({},_0x589c5e,_0x160622[_0x82c8('0x5a')]);return db[_0x82c8('0xa1')]['count']({'where':_0x589c5e[_0x82c8('0x5b')]})[_0x82c8('0x26')](function(_0x5319c9){_0x3bb20c[_0x82c8('0x21')]=_0x5319c9;if(_0x160622[_0x82c8('0x4f')][_0x82c8('0x5c')]){_0x589c5e[_0x82c8('0x5d')]=[{'all':!![]}];}return db[_0x82c8('0xa1')][_0x82c8('0x5e')](_0x589c5e);})[_0x82c8('0x26')](function(_0x1605a5){if(_0x160622[_0x82c8('0x4f')][_0x82c8('0xa2')]===_0x82c8('0xa3')){for(var _0x4714ab=0x0;_0x4714ab<_0x1605a5[_0x82c8('0x63')];_0x4714ab++){_0x1605a5[_0x4714ab][_0x82c8('0x66')]=juice(_0x1605a5[_0x4714ab][_0x82c8('0x66')]);}}_0x3bb20c['rows']=_0x1605a5;return _0x3bb20c;});}})[_0x82c8('0x26')](respondWithFilteredResult(_0x195459,_0x589c5e))[_0x82c8('0x1b')](handleError(_0x195459,null));};exports['send']=function(_0x1da17b,_0x110d4b){var _0x533db0,_0x44b87e={},_0x1ff28f;if(_0x1da17b[_0x82c8('0x66')]['to']){_0x1ff28f=_0x1da17b['body']['to'][_0x82c8('0xa4')](',')[0x0];}return db[_0x82c8('0x4b')][_0x82c8('0x64')]({'where':{'id':_0x1da17b[_0x82c8('0x61')]['id']},'include':[{'model':db['CmList'],'as':_0x82c8('0xa5'),'include':[{'model':db['CmContact'],'as':_0x82c8('0xa6'),'where':{'email':_0x1ff28f},'limit':0x1,'order':[[_0x82c8('0xa7'),_0x82c8('0xa8')]]}]},{'model':db[_0x82c8('0x47')],'as':_0x82c8('0x44'),'raw':!![],'include':[{'model':db[_0x82c8('0xa9')],'as':_0x82c8('0xa9'),'raw':!![]}]}]})[_0x82c8('0x26')](handleEntityNotFound(_0x110d4b,null))['then'](function(_0x260d59){if(!_0x260d59)return;_0x533db0=_0x260d59;if(!_0x260d59[_0x82c8('0x44')])throw new Error(_0x82c8('0xaa'));if(_['isNil'](_0x1da17b[_0x82c8('0x66')][_0x82c8('0xab')])){_0x1da17b[_0x82c8('0x66')][_0x82c8('0xab')]=util['format'](_0x82c8('0xac'),_0x260d59['name'],_0x260d59[_0x82c8('0x78')]||_0x260d59['Smtp'][_0x82c8('0x39')]);}if(_0x1da17b[_0x82c8('0x66')]['attachments']&&_0x1da17b['body'][_0x82c8('0xad')]['length']){for(var _0x3edf77=0x0;_0x3edf77<_0x1da17b[_0x82c8('0x66')][_0x82c8('0xad')][_0x82c8('0x63')];_0x3edf77+=0x1){_0x1da17b['body']['attachments'][_0x3edf77]={'filename':_0x1da17b['body'][_0x82c8('0xad')][_0x3edf77][_0x82c8('0x2b')],'path':path[_0x82c8('0xae')](config['root'],'server/files/attachments',_0x1da17b[_0x82c8('0x66')][_0x82c8('0xad')][_0x3edf77][_0x82c8('0xaf')])};}}var _0x5f10c3=_0x260d59[_0x82c8('0xb0')]();return respondWithRpcPromise(_0x82c8('0xb1'),_0x82c8('0xb2'),{'account':_0x5f10c3,'message':_0x1da17b[_0x82c8('0x66')]});})[_0x82c8('0x26')](function(_0x2194f6){if(!_0x2194f6)return;_0x44b87e=_0x2194f6;if(!_0x533db0[_0x82c8('0xa5')])throw new Error(_0x82c8('0xb3'));if(_0x533db0['List'][_0x82c8('0xa6')][_0x82c8('0x63')])return _0x533db0[_0x82c8('0xa5')][_0x82c8('0xa6')][0x0];return db[_0x82c8('0x8d')][_0x82c8('0x6c')](_[_0x82c8('0xa')](_0x1da17b[_0x82c8('0x66')],{'firstName':_0x1da17b[_0x82c8('0x66')]['to'],'email':_0x1da17b['body']['to'],'phone':_0x1da17b['body']['to'],'ListId':_0x533db0['ListId']}));})['then'](function(_0x32beec){if(!_0x32beec)return;var _0xa81535={'UserId':_0x1da17b['user']['id'],'ContactId':_0x32beec['id'],'MailAccountId':_0x533db0['id'],'inReplyTo':_0x44b87e[_0x82c8('0xb4')],'to':_0x1da17b[_0x82c8('0x66')][_0x82c8('0xab')],'cc':_0x1da17b[_0x82c8('0x66')]['cc'],'subject':_0x1da17b[_0x82c8('0x66')]['subject'],'attach':_0x1da17b['body']['attach'],'firstMsgDirection':'out','lastMsgAt':moment()['format'](_0x82c8('0xb5')),'lastMsgDirection':'out','Messages':[_[_0x82c8('0x59')](_0x1da17b[_0x82c8('0x66')],{'messageId':_0x44b87e[_0x82c8('0xb4')],'sentAt':moment()[_0x82c8('0xa0')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x533db0['id'],'UserId':_0x1da17b[_0x82c8('0x39')]['id'],'ContactId':_0x32beec['id']})]};if(_0x1da17b[_0x82c8('0x66')][_0x82c8('0xb6')]){_0xa81535=_[_0x82c8('0x59')](_0xa81535,_0x1da17b[_0x82c8('0x66')][_0x82c8('0xb6')]);}return db[_0x82c8('0x89')][_0x82c8('0x6c')](_0xa81535,{'include':[{'model':db[_0x82c8('0xa1')],'as':_0x82c8('0xb7')}]});})[_0x82c8('0x26')](respondWithResult(_0x110d4b,null))['catch'](handleError(_0x110d4b,null));};exports['verifySmtp']=function(_0x5979e9,_0x58c0d1){return db['MailAccount']['find']({'where':{'id':_0x5979e9[_0x82c8('0x61')]['id']},'include':[{'model':db[_0x82c8('0x47')],'as':_0x82c8('0x44'),'raw':!![],'include':[{'model':db[_0x82c8('0xa9')],'as':_0x82c8('0xa9'),'raw':!![]}]}]})[_0x82c8('0x26')](handleEntityNotFound(_0x58c0d1,null))[_0x82c8('0x26')](function(_0x1696b6){if(!_0x1696b6[_0x82c8('0x44')])return;var _0x353202=_0x1696b6[_0x82c8('0xb0')]();return respondWithRpcPromise('VerifySmtp',_0x82c8('0xb8'),{'account':_0x353202});})['then'](respondWithResult(_0x58c0d1,null))[_0x82c8('0x1b')](handleError(_0x58c0d1,null));};exports[_0x82c8('0x27')]=function(_0x7f9f07,_0x5238e3){return db['MailAccount'][_0x82c8('0x64')]({'where':{'id':_0x7f9f07[_0x82c8('0x61')]['id']}})['then'](handleEntityNotFound(_0x5238e3,null))[_0x82c8('0x26')](function(_0x160531){if(_0x160531&&_0x160531[_0x82c8('0x41')]){throw new db[(_0x82c8('0xb9'))][(_0x82c8('0xba'))](_0x82c8('0xbb'));}return _0x160531;})['then'](removeEntity(_0x5238e3,null))[_0x82c8('0x1b')](handleError(_0x5238e3,null));};exports['addAgents']=function(_0x195a1a,_0x315d9b){return db[_0x82c8('0x4b')][_0x82c8('0x64')]({'where':{'id':_0x195a1a['params']['id']}})['then'](handleEntityNotFound(_0x315d9b,null))[_0x82c8('0x26')](function(_0x59ceef){if(_0x59ceef){return _0x59ceef['addAgents'](_0x195a1a['body']['ids'],_[_0x82c8('0x8b')](_0x195a1a[_0x82c8('0x66')],['ids','id'])||{})[_0x82c8('0xbc')](function(_0x1f578d){for(var _0x3b1c87=0x0;_0x3b1c87<_0x195a1a[_0x82c8('0x66')][_0x82c8('0x72')][_0x82c8('0x63')];_0x3b1c87+=0x1){socket['emit'](_0x82c8('0xbd'),{'UserId':Number(_0x195a1a['body'][_0x82c8('0x72')][_0x3b1c87]),'MailAccountId':Number(_0x195a1a[_0x82c8('0x61')]['id'])});}return _0x1f578d;});}})[_0x82c8('0x26')](respondWithResult(_0x315d9b,null))[_0x82c8('0x1b')](handleError(_0x315d9b,null));};exports[_0x82c8('0xbe')]=function(_0x1db6ac,_0x7d08c9){return db['MailAccount'][_0x82c8('0x64')]({'where':{'id':_0x1db6ac[_0x82c8('0x61')]['id']}})['then'](handleEntityNotFound(_0x7d08c9,null))[_0x82c8('0x26')](function(_0x463738){if(_0x463738){return _0x463738[_0x82c8('0xbe')](_0x1db6ac['query'][_0x82c8('0x72')])[_0x82c8('0x26')](function(){if(_['isArray'](_0x1db6ac[_0x82c8('0x4f')][_0x82c8('0x72')])){for(var _0x3b3301=0x0;_0x3b3301<_0x1db6ac[_0x82c8('0x4f')]['ids'][_0x82c8('0x63')];_0x3b3301+=0x1){socket[_0x82c8('0xbf')](_0x82c8('0xc0'),{'UserId':Number(_0x1db6ac[_0x82c8('0x4f')][_0x82c8('0x72')][_0x3b3301]),'MailAccountId':Number(_0x1db6ac['params']['id'])});}}else{socket[_0x82c8('0xbf')]('userMailAccount:remove',{'UserId':Number(_0x1db6ac['query'][_0x82c8('0x72')]),'MailAccountId':Number(_0x1db6ac[_0x82c8('0x61')]['id'])});}});}})[_0x82c8('0x26')](respondWithStatusCode(_0x7d08c9,null))['catch'](handleError(_0x7d08c9,null));};exports[_0x82c8('0xc1')]=function(_0xef22e5,_0x575158){var _0x55a0c5={};var _0x2cd697={};var _0x5dd26d;var _0x337890;return db['MailAccount'][_0x82c8('0x6e')]({'where':{'id':_0xef22e5[_0x82c8('0x61')]['id']}})[_0x82c8('0x26')](handleEntityNotFound(_0x575158,null))['then'](function(_0x22fd22){if(_0x22fd22){_0x5dd26d=_0x22fd22;_0x2cd697[_0x82c8('0x4e')]=_[_0x82c8('0x62')](db[_0x82c8('0x8f')][_0x82c8('0x6f')]);_0x2cd697[_0x82c8('0x4f')]=_[_0x82c8('0x62')](_0xef22e5[_0x82c8('0x4f')]);_0x2cd697[_0x82c8('0x50')]=_[_0x82c8('0x51')](_0x2cd697[_0x82c8('0x4e')],_0x2cd697[_0x82c8('0x4f')]);_0x55a0c5[_0x82c8('0x52')]=_['intersection'](_0x2cd697[_0x82c8('0x4e')],qs['fields'](_0xef22e5[_0x82c8('0x4f')][_0x82c8('0x53')]));_0x55a0c5[_0x82c8('0x52')]=_0x55a0c5[_0x82c8('0x52')][_0x82c8('0x63')]?_0x55a0c5['attributes']:_0x2cd697[_0x82c8('0x4e')];_0x55a0c5[_0x82c8('0x55')]=qs[_0x82c8('0x56')](_0xef22e5[_0x82c8('0x4f')][_0x82c8('0x56')]);_0x55a0c5[_0x82c8('0x5b')]=qs['filters'](_[_0x82c8('0x57')](_0xef22e5[_0x82c8('0x4f')],_0x2cd697[_0x82c8('0x50')]));if(_0xef22e5['query'][_0x82c8('0x58')]){_0x55a0c5['where']=_[_0x82c8('0x59')](_0x55a0c5[_0x82c8('0x5b')],{'$or':_['map'](_0x55a0c5[_0x82c8('0x52')],function(_0x46f10b){var _0xc53086={};_0xc53086[_0x46f10b]={'$like':'%'+_0xef22e5[_0x82c8('0x4f')][_0x82c8('0x58')]+'%'};return _0xc53086;})});}_0x55a0c5=_['merge']({},_0x55a0c5,_0xef22e5[_0x82c8('0x5a')]);return _0x5dd26d[_0x82c8('0xc1')](_0x55a0c5);}})[_0x82c8('0x26')](function(_0x493a8b){if(_0x493a8b){_0x337890=_0x493a8b[_0x82c8('0x63')];if(!_0xef22e5[_0x82c8('0x4f')][_0x82c8('0x54')](_0x82c8('0x70'))){_0x55a0c5['limit']=qs[_0x82c8('0x22')](_0xef22e5[_0x82c8('0x4f')][_0x82c8('0x22')]);_0x55a0c5[_0x82c8('0x1f')]=qs['offset'](_0xef22e5[_0x82c8('0x4f')]['offset']);}return _0x5dd26d[_0x82c8('0xc1')](_0x55a0c5);}})['then'](function(_0x64d72){if(_0x64d72){return _0x64d72?{'count':_0x337890,'rows':_0x64d72}:null;}})[_0x82c8('0x26')](respondWithResult(_0x575158,null))[_0x82c8('0x1b')](handleError(_0x575158,null));}; \ No newline at end of file +var _0x60b1=['order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','show','params','options','find','body','provider','custom','Mail\x20Account\x20not\x20found','describe','addDisposition','create','getDispositions','findOne','Disposition','hasOwnProperty','MailAccountId','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','nolimit','removeAnswers','email','isNil','active','description','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addImap','removeImap','setImap','getSmtp','removeSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','Contact','fullname','Tag','Tags','tag','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','finally','getApplications','getMessages','MailMessage','split','YYYY-MM-DD\x20HH:mm:ss','inlineCss','CmList','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','from','format','%s\x20<%s>','attachments','join','server/files/attachments','getSmtpOptions','sendMail','Contacts','List','ListId','subject','attach','out','messageId','Interaction','Messages','verifySmtp','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','bluebird','path','lodash','juice','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./mailAccount.socket','client','http','request','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','get','MailAccounts','UserProfileResource','end','stack','name','send','gmail','imap.gmail.com','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','smtp.gmail.com','yahoo','smtp.mail.yahoo.com','smtp-mail.outlook.com','smtp.office365.com','Unknown\x20email\x20service\x20provider','user','username','password','pass','modernAuthentication','CloudProviderId','port','host','secure','service','authentication','Imap','Smtp','index','MailServerIn','MailServerOut','Pause','mandatoryDispositionPause','MailAccount','rawAttributes','type','key','model','map','query','keys','filters','intersection','fields','attributes','length'];(function(_0x25072b,_0x37e656){var _0x22e18a=function(_0x329815){while(--_0x329815){_0x25072b['push'](_0x25072b['shift']());}};_0x22e18a(++_0x37e656);}(_0x60b1,0x1f1));var _0x160b=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x60b1[_0x3947c9];return _0x2e7871;};'use strict';var moment=require('moment');var BPromise=require(_0x160b('0x0'));var util=require('util');var path=require(_0x160b('0x1'));var _=require(_0x160b('0x2'));var juice=require(_0x160b('0x3'));var Redis=require(_0x160b('0x4'));var qs=require('../../components/parsers/qs');var logger=require(_0x160b('0x5'))(_0x160b('0x6'));var config=require(_0x160b('0x7'));var db=require(_0x160b('0x8'))['db'];config['redis']=_[_0x160b('0x9')](config[_0x160b('0xa')],{'host':_0x160b('0xb'),'port':0x18eb});var socket=require(_0x160b('0xc'))(new Redis(config[_0x160b('0xa')]));require(_0x160b('0xd'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x160b('0xe')][_0x160b('0xf')]({'port':0x232b});function respondWithRpcPromise(_0x1165ab,_0x55baae,_0x1240e7,_0x28e7b4){return new BPromise(function(_0x58cb9a,_0x1efa79){var _0x51b570=_0x28e7b4||client;return _0x51b570[_0x160b('0x10')](_0x1165ab,_0x1240e7)['then'](function(_0x189a6e){logger[_0x160b('0x11')](_0x160b('0x12'),_0x55baae,_0x160b('0x13'));logger[_0x160b('0x14')](_0x160b('0x15'),_0x55baae,'request\x20sent',JSON[_0x160b('0x16')](_0x189a6e));if(_0x189a6e[_0x160b('0x17')]){if(_0x189a6e[_0x160b('0x17')][_0x160b('0x18')]===0x1f4){logger[_0x160b('0x17')]('MailAccount,\x20%s,\x20%s',_0x55baae,_0x189a6e[_0x160b('0x17')][_0x160b('0x19')]);return _0x1efa79(_0x189a6e['error'][_0x160b('0x19')]);}logger[_0x160b('0x17')](_0x160b('0x12'),_0x55baae,_0x189a6e[_0x160b('0x17')][_0x160b('0x19')]);return _0x58cb9a(_0x189a6e['error']['message']);}else{logger['info'](_0x160b('0x12'),_0x55baae,'request\x20sent');_0x58cb9a(_0x189a6e[_0x160b('0x1a')][_0x160b('0x19')]);}})[_0x160b('0x1b')](function(_0x5f473a){logger['error']('MailAccount,\x20%s,\x20%s',_0x55baae,_0x5f473a);_0x1efa79(_0x5f473a);});});}function respondWithStatusCode(_0x4d6807,_0x4f7d3c){_0x4f7d3c=_0x4f7d3c||0xcc;return function(_0x4769a1){if(_0x4769a1){return _0x4d6807[_0x160b('0x1c')](_0x4f7d3c);}return _0x4d6807['status'](_0x4f7d3c)['end']();};}function respondWithResult(_0x573201,_0x20e907){_0x20e907=_0x20e907||0xc8;return function(_0x1eb95d){if(_0x1eb95d){return _0x573201[_0x160b('0x1d')](_0x20e907)[_0x160b('0x1e')](_0x1eb95d);}};}function respondWithFilteredResult(_0x3b1bdc,_0x4c095b){return function(_0x17d1c8){if(_0x17d1c8){var _0x5d3e8f=typeof _0x4c095b[_0x160b('0x1f')]===_0x160b('0x20')&&typeof _0x4c095b[_0x160b('0x21')]===_0x160b('0x20');var _0x33d609=_0x17d1c8['count'];var _0x187e33=_0x5d3e8f?0x0:_0x4c095b[_0x160b('0x1f')];var _0x3fbec3=_0x5d3e8f?_0x17d1c8[_0x160b('0x22')]:_0x4c095b[_0x160b('0x1f')]+_0x4c095b[_0x160b('0x21')];var _0x5d7cc2;if(_0x3fbec3>=_0x33d609){_0x3fbec3=_0x33d609;_0x5d7cc2=0xc8;}else{_0x5d7cc2=0xce;}_0x3b1bdc[_0x160b('0x1d')](_0x5d7cc2);return _0x3b1bdc[_0x160b('0x23')](_0x160b('0x24'),_0x187e33+'-'+_0x3fbec3+'/'+_0x33d609)[_0x160b('0x1e')](_0x17d1c8);}return null;};}function saveUpdates(_0x56c17f){return function(_0x2a6587){if(_0x2a6587){return _0x2a6587[_0x160b('0x25')](_0x56c17f)[_0x160b('0x26')](function(_0x5f0ac9){return _0x5f0ac9;});}return null;};}function removeEntity(_0x491fcc){return function(_0x476329){if(_0x476329){return _0x476329[_0x160b('0x27')]()[_0x160b('0x26')](function(){var _0x1690f2=_0x476329[_0x160b('0x28')]({'plain':!![]});var _0x1014c1=_0x160b('0x29');return db[_0x160b('0x2a')]['destroy']({'where':{'type':_0x1014c1,'resourceId':_0x1690f2['id']}})[_0x160b('0x26')](function(){return _0x476329;});})[_0x160b('0x26')](function(){_0x491fcc[_0x160b('0x1d')](0xcc)[_0x160b('0x2b')]();});}};}function handleEntityNotFound(_0x120d94){return function(_0x4d98a9){if(!_0x4d98a9){_0x120d94['sendStatus'](0x194);}return _0x4d98a9;};}function handleError(_0x24504e,_0x52bc99){_0x52bc99=_0x52bc99||0x1f4;return function(_0x3ba20d){logger[_0x160b('0x17')](_0x3ba20d[_0x160b('0x2c')]);if(_0x3ba20d[_0x160b('0x2d')]){delete _0x3ba20d[_0x160b('0x2d')];}_0x24504e[_0x160b('0x1d')](_0x52bc99)[_0x160b('0x2e')](_0x3ba20d);};}function getImapHost(_0x46e2c6){switch(_0x46e2c6){case _0x160b('0x2f'):return _0x160b('0x30');case'yahoo':return _0x160b('0x31');case _0x160b('0x32'):return _0x160b('0x33');case _0x160b('0x34'):return _0x160b('0x35');}throw new Error('Unknown\x20email\x20service\x20provider',_0x46e2c6);}function getSmtpHost(_0xec729b){switch(_0xec729b){case _0x160b('0x2f'):return _0x160b('0x36');case _0x160b('0x37'):return _0x160b('0x38');case'hotmail':return _0x160b('0x39');case'outlook365':return _0x160b('0x3a');}throw new Error(_0x160b('0x3b'),_0xec729b);}function getAuthenticationOptions(_0x494968,_0x2dea23){var _0x12f15d={};var _0x16d21b={};if(_0x494968){_0x12f15d[_0x160b('0x3c')]=_0x16d21b[_0x160b('0x3c')]=_0x2dea23[_0x160b('0x3d')];_0x12f15d[_0x160b('0x3e')]=_0x16d21b[_0x160b('0x3f')]=_0x2dea23['password'];if(_0x2dea23['modernAuthentication']){_0x12f15d[_0x160b('0x40')]=_0x16d21b[_0x160b('0x40')]=!![];_0x12f15d[_0x160b('0x41')]=_0x16d21b[_0x160b('0x41')]=_0x2dea23[_0x160b('0x41')];_0x12f15d['password']=_0x16d21b['pass']=null;}else{_0x12f15d['CloudProviderId']=_0x16d21b[_0x160b('0x41')]=null;}_0x12f15d['host']=getImapHost(_0x494968);_0x12f15d[_0x160b('0x42')]=0x3e1;_0x16d21b[_0x160b('0x43')]=getSmtpHost(_0x494968);_0x16d21b[_0x160b('0x42')]=0x24b;_0x16d21b[_0x160b('0x44')]=![];_0x12f15d[_0x160b('0x45')]=_0x16d21b[_0x160b('0x45')]=null;}else{if(_0x2dea23['authentication']){_0x12f15d[_0x160b('0x3c')]=_0x16d21b[_0x160b('0x3c')]=_0x2dea23['username'];_0x12f15d[_0x160b('0x3e')]=_0x16d21b[_0x160b('0x3f')]=_0x2dea23['password'];}else{_0x12f15d['authentication']=_0x16d21b[_0x160b('0x46')]=![];_0x12f15d[_0x160b('0x3c')]=_0x16d21b[_0x160b('0x3c')]=null;_0x12f15d['password']=_0x16d21b[_0x160b('0x3f')]=null;}_0x12f15d['host']=_0x2dea23[_0x160b('0x47')][_0x160b('0x43')];_0x12f15d[_0x160b('0x42')]=_0x2dea23[_0x160b('0x47')][_0x160b('0x42')];_0x16d21b['host']=_0x2dea23['Smtp'][_0x160b('0x43')];_0x16d21b[_0x160b('0x42')]=_0x2dea23[_0x160b('0x48')][_0x160b('0x42')];}return{'Imap':_0x12f15d,'Smtp':_0x16d21b};}exports[_0x160b('0x49')]=function(_0x1d1ee9,_0x632ab8){var _0x800812={'include':[{'model':db[_0x160b('0x4a')],'as':_0x160b('0x47')},{'model':db[_0x160b('0x4b')],'as':_0x160b('0x48')},{'model':db[_0x160b('0x4c')],'as':_0x160b('0x4d')}]},_0x5081e8={},_0x126f22={'count':0x0,'rows':[]};var _0x3439e9=_['map'](db[_0x160b('0x4e')][_0x160b('0x4f')],function(_0x4441b0){return{'name':_0x4441b0['fieldName'],'type':_0x4441b0[_0x160b('0x50')][_0x160b('0x51')]};});_0x5081e8[_0x160b('0x52')]=_[_0x160b('0x53')](_0x3439e9,_0x160b('0x2d'));_0x5081e8[_0x160b('0x54')]=_[_0x160b('0x55')](_0x1d1ee9[_0x160b('0x54')]);_0x5081e8[_0x160b('0x56')]=_['intersection'](_0x5081e8[_0x160b('0x52')],_0x5081e8[_0x160b('0x54')]);_0x800812['attributes']=_[_0x160b('0x57')](_0x5081e8[_0x160b('0x52')],qs[_0x160b('0x58')](_0x1d1ee9[_0x160b('0x54')]['fields']));_0x800812['attributes']=_0x800812[_0x160b('0x59')][_0x160b('0x5a')]?_0x800812[_0x160b('0x59')]:_0x5081e8[_0x160b('0x52')];if(!_0x1d1ee9[_0x160b('0x54')]['hasOwnProperty']('nolimit')){_0x800812[_0x160b('0x21')]=qs[_0x160b('0x21')](_0x1d1ee9[_0x160b('0x54')][_0x160b('0x21')]);_0x800812[_0x160b('0x1f')]=qs[_0x160b('0x1f')](_0x1d1ee9[_0x160b('0x54')][_0x160b('0x1f')]);}_0x800812[_0x160b('0x5b')]=qs[_0x160b('0x5c')](_0x1d1ee9[_0x160b('0x54')]['sort']);_0x800812[_0x160b('0x5d')]=qs[_0x160b('0x56')](_[_0x160b('0x5e')](_0x1d1ee9[_0x160b('0x54')],_0x5081e8[_0x160b('0x56')]),_0x3439e9);if(_0x1d1ee9['query'][_0x160b('0x5f')]){_0x800812[_0x160b('0x5d')]=_[_0x160b('0x60')](_0x800812[_0x160b('0x5d')],{'$or':_['map'](_0x3439e9,function(_0x402ea1){if(_0x402ea1['type']!==_0x160b('0x61')){var _0x5744d7={};_0x5744d7[_0x402ea1[_0x160b('0x2d')]]={'$like':'%'+_0x1d1ee9[_0x160b('0x54')]['filter']+'%'};return _0x5744d7;}})});}_0x800812=_[_0x160b('0x60')]({},_0x800812,_0x1d1ee9['options']);var _0x5665c5={'where':_0x800812[_0x160b('0x5d')]};return db[_0x160b('0x4e')][_0x160b('0x22')](_0x5665c5)[_0x160b('0x26')](function(_0x23e618){_0x126f22[_0x160b('0x22')]=_0x23e618;if(_0x1d1ee9[_0x160b('0x54')][_0x160b('0x62')]){_0x800812[_0x160b('0x63')]=[{'all':!![]}];}return db[_0x160b('0x4e')]['findAll'](_0x800812);})['then'](function(_0x3130f2){_0x126f22[_0x160b('0x64')]=_0x3130f2;return _0x126f22;})['then'](respondWithFilteredResult(_0x632ab8,_0x800812))[_0x160b('0x1b')](handleError(_0x632ab8,null));};exports[_0x160b('0x65')]=function(_0x4548e2,_0x59941c){var _0x5c1d2a={'raw':![],'where':{'id':_0x4548e2[_0x160b('0x66')]['id']},'include':[{'model':db[_0x160b('0x4a')],'as':'Imap'},{'model':db[_0x160b('0x4b')],'as':_0x160b('0x48')},{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0xb9572f={};_0xb9572f['model']=_[_0x160b('0x55')](db[_0x160b('0x4e')][_0x160b('0x4f')]);_0xb9572f['query']=_[_0x160b('0x55')](_0x4548e2[_0x160b('0x54')]);_0xb9572f[_0x160b('0x56')]=_[_0x160b('0x57')](_0xb9572f[_0x160b('0x52')],_0xb9572f[_0x160b('0x54')]);_0x5c1d2a[_0x160b('0x59')]=_[_0x160b('0x57')](_0xb9572f[_0x160b('0x52')],qs[_0x160b('0x58')](_0x4548e2[_0x160b('0x54')][_0x160b('0x58')]));_0x5c1d2a[_0x160b('0x59')]=_0x5c1d2a[_0x160b('0x59')][_0x160b('0x5a')]?_0x5c1d2a[_0x160b('0x59')]:_0xb9572f[_0x160b('0x52')];if(_0x4548e2[_0x160b('0x54')][_0x160b('0x62')]){_0x5c1d2a[_0x160b('0x63')]=[{'all':!![]}];}_0x5c1d2a=_['merge']({},_0x5c1d2a,_0x4548e2[_0x160b('0x67')]);return db[_0x160b('0x4e')][_0x160b('0x68')](_0x5c1d2a)[_0x160b('0x26')](handleEntityNotFound(_0x59941c,null))[_0x160b('0x26')](respondWithResult(_0x59941c,null))[_0x160b('0x1b')](handleError(_0x59941c,null));};exports[_0x160b('0x25')]=function(_0xf3f6e1,_0x3afa08){if(_0xf3f6e1['body']['id']){delete _0xf3f6e1['body']['id'];}var _0x4c3db1=_0xf3f6e1[_0x160b('0x69')][_0x160b('0x6a')]===_0x160b('0x6b')?null:_0xf3f6e1['body'][_0x160b('0x6a')];var _0x35fd1c=_0xf3f6e1[_0x160b('0x69')][_0x160b('0x47')]||{};var _0x238b6d=_0xf3f6e1[_0x160b('0x69')][_0x160b('0x48')]||{};if(_0x4c3db1){_0x35fd1c[_0x160b('0x43')]=getImapHost(_0x4c3db1);_0x35fd1c[_0x160b('0x42')]=0x3e1;_0x238b6d[_0x160b('0x43')]=getSmtpHost(_0x4c3db1);_0x238b6d[_0x160b('0x42')]=0x24b;_0x238b6d[_0x160b('0x44')]=![];}if(_0x238b6d[_0x160b('0x40')]){_0x238b6d[_0x160b('0x44')]=![];}else{_0x238b6d[_0x160b('0x41')]=null;}if(!_0x35fd1c['modernAuthentication'])_0x35fd1c['CloudProviderId']=null;_0xf3f6e1['body']['Imap']=_0x35fd1c;_0xf3f6e1[_0x160b('0x69')]['Smtp']=_0x238b6d;return db[_0x160b('0x4e')][_0x160b('0x68')]({'where':{'id':_0xf3f6e1[_0x160b('0x66')]['id']},'include':[{'model':db[_0x160b('0x4a')],'as':_0x160b('0x47')},{'model':db[_0x160b('0x4b')],'as':_0x160b('0x48')},{'model':db['Pause'],'as':_0x160b('0x4d')}]})[_0x160b('0x26')](handleEntityNotFound(_0x3afa08,null))[_0x160b('0x26')](function(_0x38f64a){if(!_0x38f64a)throw new Error(_0x160b('0x6c'));if(_0x38f64a['service'])delete _0xf3f6e1[_0x160b('0x69')][_0x160b('0x47')];return _0x38f64a;})[_0x160b('0x26')](saveUpdates(_0xf3f6e1['body'],null))['then'](function(_0x221d71){if(!_0xf3f6e1[_0x160b('0x69')]['Imap'])return _0x221d71;return db[_0x160b('0x4a')][_0x160b('0x25')](_0xf3f6e1[_0x160b('0x69')][_0x160b('0x47')],{'where':{'MailAccountId':_0x221d71['id']}})['then'](function(){return _0x221d71;});})['then'](function(_0x641268){if(!_0xf3f6e1[_0x160b('0x69')][_0x160b('0x48')])return _0x641268;return db[_0x160b('0x4b')][_0x160b('0x25')](_0xf3f6e1[_0x160b('0x69')]['Smtp'],{'where':{'MailAccountId':_0x641268['id']}})[_0x160b('0x26')](function(){return _0x641268;});})['then'](respondWithResult(_0x3afa08,null))[_0x160b('0x1b')](handleError(_0x3afa08,null));};exports[_0x160b('0x6d')]=function(_0x11878c,_0x53fecf){return db['MailAccount']['describe']()['then'](respondWithResult(_0x53fecf,null))[_0x160b('0x1b')](handleError(_0x53fecf,null));};exports[_0x160b('0x6e')]=function(_0x574991,_0x4d662d){if(_0x574991['body']['id']){delete _0x574991[_0x160b('0x69')]['id'];}return db['MailAccount'][_0x160b('0x68')]({'where':{'id':_0x574991['params']['id']}})[_0x160b('0x26')](handleEntityNotFound(_0x4d662d,null))['then'](function(_0x26e2d0){if(_0x26e2d0){_0x574991[_0x160b('0x69')]['MailAccountId']=_0x26e2d0['id'];return db['Disposition'][_0x160b('0x6f')](_0x574991['body']);}})['then'](respondWithResult(_0x4d662d,null))['catch'](handleError(_0x4d662d,null));};exports[_0x160b('0x70')]=function(_0x326a17,_0x5cff39){var _0x34bab8={'raw':![],'where':{}};var _0x26d497={};var _0x12bdf8={'count':0x0,'rows':[]};return db[_0x160b('0x4e')][_0x160b('0x71')]({'where':{'id':_0x326a17[_0x160b('0x66')]['id']}})[_0x160b('0x26')](handleEntityNotFound(_0x5cff39,null))[_0x160b('0x26')](function(_0x4b8562){if(_0x4b8562){_0x26d497['model']=_[_0x160b('0x55')](db[_0x160b('0x72')][_0x160b('0x4f')]);_0x26d497[_0x160b('0x54')]=_[_0x160b('0x55')](_0x326a17[_0x160b('0x54')]);_0x26d497[_0x160b('0x56')]=_[_0x160b('0x57')](_0x26d497[_0x160b('0x52')],_0x26d497[_0x160b('0x54')]);_0x34bab8['attributes']=_[_0x160b('0x57')](_0x26d497['model'],qs[_0x160b('0x58')](_0x326a17['query'][_0x160b('0x58')]));_0x34bab8[_0x160b('0x59')]=_0x34bab8[_0x160b('0x59')][_0x160b('0x5a')]?_0x34bab8['attributes']:_0x26d497['model'];if(!_0x326a17[_0x160b('0x54')][_0x160b('0x73')]('nolimit')){_0x34bab8[_0x160b('0x21')]=qs[_0x160b('0x21')](_0x326a17[_0x160b('0x54')][_0x160b('0x21')]);_0x34bab8[_0x160b('0x1f')]=qs[_0x160b('0x1f')](_0x326a17[_0x160b('0x54')]['offset']);}_0x34bab8['order']=qs[_0x160b('0x5c')](_0x326a17[_0x160b('0x54')]['sort']);_0x34bab8['where']=qs['filters'](_['pick'](_0x326a17['query'],_0x26d497[_0x160b('0x56')]));_0x34bab8['where'][_0x160b('0x74')]=_0x4b8562['id'];if(_0x326a17[_0x160b('0x54')][_0x160b('0x5f')]){_0x34bab8[_0x160b('0x5d')]=_[_0x160b('0x60')](_0x34bab8[_0x160b('0x5d')],{'$or':_[_0x160b('0x53')](_0x34bab8[_0x160b('0x59')],function(_0x1ef83e){var _0x4208f9={};_0x4208f9[_0x1ef83e]={'$like':'%'+_0x326a17['query'][_0x160b('0x5f')]+'%'};return _0x4208f9;})});}_0x34bab8=_['merge']({},_0x34bab8,_0x326a17[_0x160b('0x67')]);return db[_0x160b('0x72')][_0x160b('0x22')]({'where':_0x34bab8[_0x160b('0x5d')]})[_0x160b('0x26')](function(_0x273af1){_0x12bdf8[_0x160b('0x22')]=_0x273af1;if(_0x326a17['query'][_0x160b('0x62')]){_0x34bab8['include']=[{'all':!![]}];}return db[_0x160b('0x72')][_0x160b('0x75')](_0x34bab8);})[_0x160b('0x26')](function(_0x2a4cab){_0x12bdf8[_0x160b('0x64')]=_0x2a4cab;return _0x12bdf8;});}})[_0x160b('0x26')](respondWithFilteredResult(_0x5cff39,_0x34bab8))[_0x160b('0x1b')](handleError(_0x5cff39,null));};exports[_0x160b('0x76')]=function(_0xad48e4,_0x5eaa0b){return db[_0x160b('0x4e')]['find']({'where':{'id':_0xad48e4[_0x160b('0x66')]['id']}})[_0x160b('0x26')](handleEntityNotFound(_0x5eaa0b,null))[_0x160b('0x26')](function(_0x1eec97){if(_0x1eec97){return _0x1eec97[_0x160b('0x76')](_0xad48e4[_0x160b('0x54')][_0x160b('0x77')]);}})[_0x160b('0x26')](respondWithStatusCode(_0x5eaa0b,null))[_0x160b('0x1b')](handleError(_0x5eaa0b,null));};exports[_0x160b('0x78')]=function(_0x163c27,_0x31f8b6){if(_0x163c27[_0x160b('0x69')]['id']){delete _0x163c27['body']['id'];}return db[_0x160b('0x4e')][_0x160b('0x68')]({'where':{'id':_0x163c27['params']['id']}})[_0x160b('0x26')](handleEntityNotFound(_0x31f8b6,null))[_0x160b('0x26')](function(_0x10287d){if(_0x10287d){_0x163c27[_0x160b('0x69')][_0x160b('0x74')]=_0x10287d['id'];return db[_0x160b('0x79')][_0x160b('0x6f')](_0x163c27[_0x160b('0x69')]);}})[_0x160b('0x26')](respondWithResult(_0x31f8b6,null))[_0x160b('0x1b')](handleError(_0x31f8b6,null));};exports[_0x160b('0x7a')]=function(_0x2608c5,_0x26e86b){var _0x5432c4={'raw':![],'where':{}};var _0x4b6a20={};var _0xdd9547={'count':0x0,'rows':[]};return db[_0x160b('0x4e')][_0x160b('0x71')]({'where':{'id':_0x2608c5[_0x160b('0x66')]['id']}})[_0x160b('0x26')](handleEntityNotFound(_0x26e86b,null))[_0x160b('0x26')](function(_0x1f2ec3){if(_0x1f2ec3){_0x4b6a20[_0x160b('0x52')]=_[_0x160b('0x55')](db[_0x160b('0x79')]['rawAttributes']);_0x4b6a20[_0x160b('0x54')]=_[_0x160b('0x55')](_0x2608c5[_0x160b('0x54')]);_0x4b6a20[_0x160b('0x56')]=_['intersection'](_0x4b6a20[_0x160b('0x52')],_0x4b6a20['query']);_0x5432c4[_0x160b('0x59')]=_[_0x160b('0x57')](_0x4b6a20['model'],qs[_0x160b('0x58')](_0x2608c5['query']['fields']));_0x5432c4['attributes']=_0x5432c4[_0x160b('0x59')][_0x160b('0x5a')]?_0x5432c4[_0x160b('0x59')]:_0x4b6a20['model'];if(!_0x2608c5[_0x160b('0x54')]['hasOwnProperty'](_0x160b('0x7b'))){_0x5432c4[_0x160b('0x21')]=qs['limit'](_0x2608c5[_0x160b('0x54')]['limit']);_0x5432c4[_0x160b('0x1f')]=qs[_0x160b('0x1f')](_0x2608c5[_0x160b('0x54')][_0x160b('0x1f')]);}_0x5432c4[_0x160b('0x5b')]=qs[_0x160b('0x5c')](_0x2608c5[_0x160b('0x54')][_0x160b('0x5c')]);_0x5432c4['where']=qs[_0x160b('0x56')](_[_0x160b('0x5e')](_0x2608c5[_0x160b('0x54')],_0x4b6a20[_0x160b('0x56')]));_0x5432c4['where'][_0x160b('0x74')]=_0x1f2ec3['id'];if(_0x2608c5[_0x160b('0x54')]['filter']){_0x5432c4[_0x160b('0x5d')]=_['merge'](_0x5432c4[_0x160b('0x5d')],{'$or':_[_0x160b('0x53')](_0x5432c4[_0x160b('0x59')],function(_0x1f9f03){var _0x3bcd6f={};_0x3bcd6f[_0x1f9f03]={'$like':'%'+_0x2608c5[_0x160b('0x54')][_0x160b('0x5f')]+'%'};return _0x3bcd6f;})});}_0x5432c4=_[_0x160b('0x60')]({},_0x5432c4,_0x2608c5[_0x160b('0x67')]);return db[_0x160b('0x79')][_0x160b('0x22')]({'where':_0x5432c4['where']})[_0x160b('0x26')](function(_0xbfd022){_0xdd9547['count']=_0xbfd022;if(_0x2608c5[_0x160b('0x54')]['includeAll']){_0x5432c4[_0x160b('0x63')]=[{'all':!![]}];}return db[_0x160b('0x79')]['findAll'](_0x5432c4);})[_0x160b('0x26')](function(_0x27aee1){_0xdd9547[_0x160b('0x64')]=_0x27aee1;return _0xdd9547;});}})[_0x160b('0x26')](respondWithFilteredResult(_0x26e86b,_0x5432c4))[_0x160b('0x1b')](handleError(_0x26e86b,null));};exports[_0x160b('0x7c')]=function(_0x21ea31,_0x1aada6){return db[_0x160b('0x4e')]['find']({'where':{'id':_0x21ea31[_0x160b('0x66')]['id']}})[_0x160b('0x26')](handleEntityNotFound(_0x1aada6,null))[_0x160b('0x26')](function(_0x299a7a){if(_0x299a7a){return _0x299a7a['removeAnswers'](_0x21ea31['query'][_0x160b('0x77')]);}})['then'](respondWithStatusCode(_0x1aada6,null))[_0x160b('0x1b')](handleError(_0x1aada6,null));};exports['create']=function(_0x56e872,_0xed5617){var _0x75ac29={'name':_0x56e872[_0x160b('0x69')][_0x160b('0x2d')],'key':_0x56e872[_0x160b('0x69')][_0x160b('0x51')],'provider':_0x56e872[_0x160b('0x69')][_0x160b('0x6a')]===_0x160b('0x6b')?null:_0x56e872[_0x160b('0x69')][_0x160b('0x6a')],'email':_0x56e872[_0x160b('0x69')][_0x160b('0x7d')],'ListId':_0x56e872[_0x160b('0x69')]['ListId'],'active':!_[_0x160b('0x7e')](_0x56e872[_0x160b('0x69')]['active'])?_0x56e872['body'][_0x160b('0x7f')]:!![],'description':_0x56e872[_0x160b('0x69')][_0x160b('0x80')]||null};var _0x5d712f=getAuthenticationOptions(_0x75ac29[_0x160b('0x6a')],_0x56e872['body']);_0x75ac29['Imap']=_0x5d712f[_0x160b('0x47')];_0x75ac29[_0x160b('0x48')]=_0x5d712f[_0x160b('0x48')];return db[_0x160b('0x4e')][_0x160b('0x6f')](_0x75ac29,{'include':[{'model':db[_0x160b('0x4b')],'as':_0x160b('0x48')},{'model':db['MailServerIn'],'as':_0x160b('0x47')}]})[_0x160b('0x26')](function(_0x270828){var _0x353ba2=_0x56e872[_0x160b('0x3c')][_0x160b('0x28')]({'plain':!![]});if(!_0x353ba2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x353ba2['role']==='user'){var _0x1c08f6=_0x270828[_0x160b('0x28')]({'plain':!![]});return db[_0x160b('0x81')][_0x160b('0x68')]({'where':{'name':_0x160b('0x29'),'userProfileId':_0x353ba2[_0x160b('0x82')]},'raw':!![]})[_0x160b('0x26')](function(_0x7a4fbd){if(_0x7a4fbd&&_0x7a4fbd['autoAssociation']===0x0){return db[_0x160b('0x2a')][_0x160b('0x6f')]({'name':_0x1c08f6[_0x160b('0x2d')],'resourceId':_0x1c08f6['id'],'type':_0x7a4fbd[_0x160b('0x2d')],'sectionId':_0x7a4fbd['id']},{})[_0x160b('0x26')](function(){return _0x270828;});}else{return _0x270828;}})[_0x160b('0x1b')](function(_0xfa4909){logger[_0x160b('0x17')](_0x160b('0x83'),_0xfa4909);throw _0xfa4909;});}return _0x270828;})[_0x160b('0x26')](respondWithResult(_0xed5617,0xc9))[_0x160b('0x1b')](handleError(_0xed5617,null));};exports['getImap']=function(_0x171ddd,_0x45e038){return db['MailAccount']['findOne']({'where':{'id':_0x171ddd['params']['id']}})[_0x160b('0x26')](handleEntityNotFound(_0x45e038,null))['then'](function(_0x4407ec){if(_0x4407ec){return _0x4407ec['getImap']();}return null;})[_0x160b('0x26')](respondWithResult(_0x45e038,null))[_0x160b('0x1b')](handleError(_0x45e038,null));};exports[_0x160b('0x84')]=function(_0x185a33,_0x82a502){if(_0x185a33[_0x160b('0x69')]['id']){delete _0x185a33[_0x160b('0x69')]['id'];}return db['MailAccount'][_0x160b('0x68')]({'where':{'id':_0x185a33[_0x160b('0x66')]['id']}})[_0x160b('0x26')](handleEntityNotFound(_0x82a502,null))['then'](function(_0x58d00b){if(_0x58d00b){_0x185a33['body'][_0x160b('0x74')]=_0x58d00b['id'];return db[_0x160b('0x4a')]['create'](_0x185a33[_0x160b('0x69')]);}})[_0x160b('0x26')](respondWithResult(_0x82a502,null))[_0x160b('0x1b')](handleError(_0x82a502,null));};exports[_0x160b('0x85')]=function(_0x109361,_0x556c35){return db['MailAccount'][_0x160b('0x71')]({'where':{'id':_0x109361[_0x160b('0x66')]['id']}})[_0x160b('0x26')](handleEntityNotFound(_0x556c35,null))['then'](function(_0x479cef){if(_0x479cef){return _0x479cef[_0x160b('0x86')](null);}return null;})[_0x160b('0x26')](respondWithStatusCode(_0x556c35,null))[_0x160b('0x1b')](handleError(_0x556c35,null));};exports['getSmtp']=function(_0x5158a3,_0x46c51d){return db[_0x160b('0x4e')][_0x160b('0x71')]({'where':{'id':_0x5158a3[_0x160b('0x66')]['id']}})['then'](handleEntityNotFound(_0x46c51d,null))[_0x160b('0x26')](function(_0x4c1462){if(_0x4c1462){return _0x4c1462[_0x160b('0x87')]();}return null;})[_0x160b('0x26')](respondWithResult(_0x46c51d,null))['catch'](handleError(_0x46c51d,null));};exports['addSmtp']=function(_0x5c6887,_0x162dc4){if(_0x5c6887[_0x160b('0x69')]['id']){delete _0x5c6887[_0x160b('0x69')]['id'];}return db[_0x160b('0x4e')]['find']({'where':{'id':_0x5c6887[_0x160b('0x66')]['id']}})[_0x160b('0x26')](handleEntityNotFound(_0x162dc4,null))[_0x160b('0x26')](function(_0x1d7486){if(_0x1d7486){_0x5c6887['body'][_0x160b('0x74')]=_0x1d7486['id'];return db[_0x160b('0x4b')][_0x160b('0x6f')](_0x5c6887[_0x160b('0x69')]);}})[_0x160b('0x26')](respondWithResult(_0x162dc4,null))[_0x160b('0x1b')](handleError(_0x162dc4,null));};exports[_0x160b('0x88')]=function(_0x2578b0,_0x1d1c25){return db['MailAccount']['findOne']({'where':{'id':_0x2578b0[_0x160b('0x66')]['id']}})[_0x160b('0x26')](handleEntityNotFound(_0x1d1c25,null))['then'](function(_0x119699){if(_0x119699){return _0x119699['setSmtp'](null);}return null;})['then'](respondWithStatusCode(_0x1d1c25,null))[_0x160b('0x1b')](handleError(_0x1d1c25,null));};exports[_0x160b('0x89')]=function(_0x2d70bd,_0xcc0567){return db[_0x160b('0x8a')][_0x160b('0x68')]({'where':{'id':_0x2d70bd[_0x160b('0x66')]['id']}})[_0x160b('0x26')](handleEntityNotFound(_0xcc0567,null))[_0x160b('0x26')](function(_0x14e164){if(_0x14e164){return _0x14e164[_0x160b('0x89')](_0x2d70bd[_0x160b('0x69')][_0x160b('0x77')],_[_0x160b('0x8b')](_0x2d70bd[_0x160b('0x69')],['ids','id'])||{});}})['then'](respondWithResult(_0xcc0567,null))[_0x160b('0x1b')](handleError(_0xcc0567,null));};exports[_0x160b('0x8c')]=function(_0x5a39f2,_0x5af5d0){var _0x209ed0={'raw':![],'where':{}};var _0x4fa23a={};var _0x5d43f8={'count':0x0,'rows':[]};return db[_0x160b('0x4e')][_0x160b('0x71')]({'where':{'id':_0x5a39f2['params']['id']}})[_0x160b('0x26')](handleEntityNotFound(_0x5af5d0,null))['then'](function(_0x9c79aa){if(_0x9c79aa){_0x4fa23a[_0x160b('0x52')]=_['keys'](db[_0x160b('0x8a')][_0x160b('0x4f')]);_0x4fa23a['query']=_[_0x160b('0x55')](_0x5a39f2[_0x160b('0x54')]);_0x4fa23a[_0x160b('0x56')]=_['intersection'](_0x4fa23a[_0x160b('0x52')],_0x4fa23a[_0x160b('0x54')]);_0x209ed0[_0x160b('0x59')]=_[_0x160b('0x57')](_0x4fa23a[_0x160b('0x52')],qs['fields'](_0x5a39f2[_0x160b('0x54')][_0x160b('0x58')]));_0x209ed0[_0x160b('0x59')]=_0x209ed0[_0x160b('0x59')][_0x160b('0x5a')]?_0x209ed0[_0x160b('0x59')]:_0x4fa23a[_0x160b('0x52')];if(!_0x5a39f2[_0x160b('0x54')][_0x160b('0x73')](_0x160b('0x7b'))){_0x209ed0['limit']=qs[_0x160b('0x21')](_0x5a39f2[_0x160b('0x54')]['limit']);_0x209ed0[_0x160b('0x1f')]=qs[_0x160b('0x1f')](_0x5a39f2[_0x160b('0x54')][_0x160b('0x1f')]);}_0x209ed0['order']=qs['sort'](_0x5a39f2['query']['sort']);_0x209ed0[_0x160b('0x5d')]=qs[_0x160b('0x56')](_[_0x160b('0x5e')](_0x5a39f2['query'],_0x4fa23a[_0x160b('0x56')]));_0x209ed0[_0x160b('0x5d')][_0x160b('0x74')]=_0x9c79aa['id'];if(_0x5a39f2[_0x160b('0x54')][_0x160b('0x5f')]){_0x209ed0[_0x160b('0x5d')]=_[_0x160b('0x60')](_0x209ed0[_0x160b('0x5d')],{'$or':_[_0x160b('0x53')](_0x209ed0[_0x160b('0x59')],function(_0x39a099){var _0x2ffbf2={};_0x2ffbf2[_0x39a099]={'$like':'%'+_0x5a39f2[_0x160b('0x54')][_0x160b('0x5f')]+'%'};return _0x2ffbf2;})});}_0x209ed0=_[_0x160b('0x60')]({},_0x209ed0,_0x5a39f2[_0x160b('0x67')]);return db['MailInteraction'][_0x160b('0x22')]({'where':_0x209ed0[_0x160b('0x5d')]})['then'](function(_0x574146){_0x5d43f8[_0x160b('0x22')]=_0x574146;if(_0x5a39f2[_0x160b('0x54')][_0x160b('0x62')]){_0x209ed0['include']=[{'model':db[_0x160b('0x8d')],'as':_0x160b('0x8e'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x160b('0x2d'),_0x160b('0x8f'),'internal'],'required':![]},{'model':db[_0x160b('0x90')],'as':_0x160b('0x91'),'attributes':['id',_0x160b('0x2d'),'color'],'where':_0x5a39f2[_0x160b('0x54')][_0x160b('0x92')]?{'id':_0x5a39f2[_0x160b('0x54')]['tag']}:undefined,'required':_0x5a39f2['query']['tag']?!![]:![]}];}return db[_0x160b('0x8a')][_0x160b('0x75')](_0x209ed0);})[_0x160b('0x26')](function(_0x2b6ebd){_0x5d43f8[_0x160b('0x64')]=_0x2b6ebd;return _0x5d43f8;});}})['then'](respondWithFilteredResult(_0x5af5d0,_0x209ed0))[_0x160b('0x1b')](handleError(_0x5af5d0,null));};exports[_0x160b('0x93')]=function addApplications(_0xf6a709,_0x1bf77e){var _0x9b5490=_0xf6a709[_0x160b('0x66')]['id'];var _0x176bd4=_0xf6a709[_0x160b('0x69')];var _0x4e4d71=0xc8;var _0x2b766c=null;return db[_0x160b('0x94')][_0x160b('0x95')]({'isolationLevel':db[_0x160b('0x94')]['Transaction'][_0x160b('0x96')][_0x160b('0x97')]},function(_0x3f56c7){return db[_0x160b('0x4e')]['findOne']({'where':{'id':_0x9b5490},'transaction':_0x3f56c7})['then'](function(_0x5c153e){if(_0x5c153e){return db['MailApplication']['destroy']({'where':{'MailAccountId':_0x9b5490},'transaction':_0x3f56c7})[_0x160b('0x26')](function(){var _0x376b05=_[_0x160b('0x53')](_0x176bd4,function(_0xb3bdae){_0xb3bdae['MailAccountId']=_0x9b5490;return _0xb3bdae;});return db[_0x160b('0x98')][_0x160b('0x99')](_0x376b05,{'transaction':_0x3f56c7});});}else{_0x4e4d71=0x194;_0x2b766c=[];}});})[_0x160b('0x26')](function(){if(_0x4e4d71!==0x194){return db[_0x160b('0x98')][_0x160b('0x9a')]({'where':{'MailAccountId':_0x9b5490},'order':'priority'})[_0x160b('0x26')](function(_0x58e80e){_0x2b766c=_0x58e80e;});}})[_0x160b('0x1b')](function(_0x33d71e){_0x4e4d71=0x1f4;logger[_0x160b('0x17')](_0x33d71e[_0x160b('0x2c')]);if(_0x33d71e[_0x160b('0x2d')]){delete _0x33d71e[_0x160b('0x2d')];}_0x2b766c=_0x33d71e;})[_0x160b('0x9b')](function(){if(_0x2b766c===null){_0x1bf77e[_0x160b('0x1c')](_0x4e4d71);}else{if(_0x4e4d71===0x1f4){_0x1bf77e[_0x160b('0x1d')](_0x4e4d71)['send'](_0x2b766c);}else{_0x1bf77e['status'](_0x4e4d71)[_0x160b('0x1e')](_0x2b766c);}}});};exports[_0x160b('0x9c')]=function(_0xc1476,_0x4881c7){var _0x38ea36={};var _0x34ca6e={};var _0x3543c2;var _0x4f074d;return db[_0x160b('0x4e')][_0x160b('0x71')]({'where':{'id':_0xc1476[_0x160b('0x66')]['id']}})['then'](handleEntityNotFound(_0x4881c7,null))[_0x160b('0x26')](function(_0x4f01c1){if(_0x4f01c1){_0x3543c2=_0x4f01c1;_0x34ca6e[_0x160b('0x52')]=_[_0x160b('0x55')](db[_0x160b('0x98')]['rawAttributes']);_0x34ca6e[_0x160b('0x54')]=_[_0x160b('0x55')](_0xc1476['query']);_0x34ca6e[_0x160b('0x56')]=_[_0x160b('0x57')](_0x34ca6e['model'],_0x34ca6e[_0x160b('0x54')]);_0x38ea36['attributes']=_['intersection'](_0x34ca6e['model'],qs[_0x160b('0x58')](_0xc1476['query']['fields']));_0x38ea36[_0x160b('0x59')]=_0x38ea36[_0x160b('0x59')]['length']?_0x38ea36[_0x160b('0x59')]:_0x34ca6e[_0x160b('0x52')];_0x38ea36[_0x160b('0x5b')]=qs[_0x160b('0x5c')](_0xc1476[_0x160b('0x54')][_0x160b('0x5c')]);_0x38ea36[_0x160b('0x5d')]=qs[_0x160b('0x56')](_['pick'](_0xc1476['query'],_0x34ca6e[_0x160b('0x56')]));if(_0xc1476['query']['filter']){_0x38ea36[_0x160b('0x5d')]=_[_0x160b('0x60')](_0x38ea36['where'],{'$or':_[_0x160b('0x53')](_0x38ea36[_0x160b('0x59')],function(_0x176e70){var _0x26cc09={};_0x26cc09[_0x176e70]={'$like':'%'+_0xc1476[_0x160b('0x54')]['filter']+'%'};return _0x26cc09;})});}_0x38ea36=_[_0x160b('0x60')]({},_0x38ea36,_0xc1476[_0x160b('0x67')]);return _0x3543c2[_0x160b('0x9c')](_0x38ea36);}})[_0x160b('0x26')](function(_0x2351ce){if(_0x2351ce){_0x4f074d=_0x2351ce['length'];if(!_0xc1476[_0x160b('0x54')][_0x160b('0x73')](_0x160b('0x7b'))){_0x38ea36['limit']=qs[_0x160b('0x21')](_0xc1476[_0x160b('0x54')][_0x160b('0x21')]);_0x38ea36['offset']=qs[_0x160b('0x1f')](_0xc1476[_0x160b('0x54')]['offset']);}return _0x3543c2[_0x160b('0x9c')](_0x38ea36);}})[_0x160b('0x26')](function(_0x316023){if(_0x316023){return _0x316023?{'count':_0x4f074d,'rows':_0x316023}:null;}})[_0x160b('0x26')](respondWithResult(_0x4881c7,null))[_0x160b('0x1b')](handleError(_0x4881c7,null));};exports[_0x160b('0x9d')]=function(_0x26ae4b,_0x5daa62){var _0x56267c={'raw':!![],'where':{}};var _0x3801af={};var _0x18f1f8={'count':0x0,'rows':[]};return db['MailAccount'][_0x160b('0x71')]({'where':{'id':_0x26ae4b[_0x160b('0x66')]['id']}})[_0x160b('0x26')](handleEntityNotFound(_0x5daa62,null))[_0x160b('0x26')](function(_0x1e416c){if(_0x1e416c){_0x3801af['model']=_[_0x160b('0x55')](db[_0x160b('0x9e')][_0x160b('0x4f')]);_0x3801af[_0x160b('0x54')]=_[_0x160b('0x55')](_0x26ae4b[_0x160b('0x54')]);_0x3801af[_0x160b('0x56')]=_[_0x160b('0x57')](_0x3801af[_0x160b('0x52')],_0x3801af['query']);_0x56267c[_0x160b('0x59')]=_[_0x160b('0x57')](_0x3801af[_0x160b('0x52')],qs[_0x160b('0x58')](_0x26ae4b[_0x160b('0x54')][_0x160b('0x58')]));_0x56267c['attributes']=_0x56267c[_0x160b('0x59')]['length']?_0x56267c['attributes']:_0x3801af[_0x160b('0x52')];if(!_0x26ae4b[_0x160b('0x54')]['hasOwnProperty'](_0x160b('0x7b'))){_0x56267c['limit']=qs[_0x160b('0x21')](_0x26ae4b[_0x160b('0x54')][_0x160b('0x21')]);_0x56267c[_0x160b('0x1f')]=qs[_0x160b('0x1f')](_0x26ae4b[_0x160b('0x54')]['offset']);}_0x56267c[_0x160b('0x5b')]=qs[_0x160b('0x5c')](_0x26ae4b[_0x160b('0x54')][_0x160b('0x5c')]);_0x56267c[_0x160b('0x5d')]=qs[_0x160b('0x56')](_[_0x160b('0x5e')](_0x26ae4b[_0x160b('0x54')],_0x3801af['filters']));_0x56267c[_0x160b('0x5d')]['MailAccountId']=_0x1e416c['id'];if(_0x26ae4b['query'][_0x160b('0x5f')]){_0x56267c[_0x160b('0x5d')]=_[_0x160b('0x60')](_0x56267c[_0x160b('0x5d')],{'$or':_[_0x160b('0x53')](_0x56267c[_0x160b('0x59')],function(_0x33b979){var _0x5aeefd={};_0x5aeefd[_0x33b979]={'$like':'%'+_0x26ae4b[_0x160b('0x54')][_0x160b('0x5f')]+'%'};return _0x5aeefd;})});}if(_0x26ae4b['query']['$gte']){var _0x30dc68=_0x26ae4b['query']['$gte'][_0x160b('0x9f')](',');var _0x3fe098={};_0x3fe098[_0x30dc68[0x0]]={'$gte':moment(_0x30dc68[0x1])['format'](_0x160b('0xa0'))};_0x56267c[_0x160b('0x5d')]=_[_0x160b('0x60')](_0x56267c['where'],_0x3fe098);}_0x56267c=_['merge']({},_0x56267c,_0x26ae4b[_0x160b('0x67')]);return db[_0x160b('0x9e')]['count']({'where':_0x56267c[_0x160b('0x5d')]})[_0x160b('0x26')](function(_0x37c708){_0x18f1f8[_0x160b('0x22')]=_0x37c708;if(_0x26ae4b[_0x160b('0x54')][_0x160b('0x62')]){_0x56267c[_0x160b('0x63')]=[{'all':!![]}];}return db[_0x160b('0x9e')][_0x160b('0x75')](_0x56267c);})[_0x160b('0x26')](function(_0x421ba4){if(_0x26ae4b[_0x160b('0x54')][_0x160b('0xa1')]==='true'){for(var _0x3d0fa3=0x0;_0x3d0fa3<_0x421ba4[_0x160b('0x5a')];_0x3d0fa3++){_0x421ba4[_0x3d0fa3][_0x160b('0x69')]=juice(_0x421ba4[_0x3d0fa3][_0x160b('0x69')]);}}_0x18f1f8['rows']=_0x421ba4;return _0x18f1f8;});}})[_0x160b('0x26')](respondWithFilteredResult(_0x5daa62,_0x56267c))[_0x160b('0x1b')](handleError(_0x5daa62,null));};exports[_0x160b('0x2e')]=function(_0x570913,_0x5192d7){var _0x1e63b9,_0x2e8258={},_0x2aae54;if(_0x570913[_0x160b('0x69')]['to']){_0x2aae54=_0x570913['body']['to'][_0x160b('0x9f')](',')[0x0];}return db[_0x160b('0x4e')][_0x160b('0x68')]({'where':{'id':_0x570913[_0x160b('0x66')]['id']},'include':[{'model':db[_0x160b('0xa2')],'as':'List','include':[{'model':db[_0x160b('0x8d')],'as':'Contacts','where':{'email':_0x2aae54},'limit':0x1,'order':[['updatedAt',_0x160b('0xa3')]]}]},{'model':db['MailServerOut'],'as':_0x160b('0x48'),'raw':!![],'include':[{'model':db[_0x160b('0xa4')],'as':_0x160b('0xa4'),'raw':!![]}]}]})[_0x160b('0x26')](handleEntityNotFound(_0x5192d7,null))[_0x160b('0x26')](function(_0x58922c){if(!_0x58922c)return;_0x1e63b9=_0x58922c;if(!_0x58922c[_0x160b('0x48')])throw new Error(_0x160b('0xa5'));if(_[_0x160b('0x7e')](_0x570913[_0x160b('0x69')]['from'])){_0x570913[_0x160b('0x69')][_0x160b('0xa6')]=util[_0x160b('0xa7')](_0x160b('0xa8'),_0x58922c['name'],_0x58922c['email']||_0x58922c['Smtp'][_0x160b('0x3c')]);}if(_0x570913[_0x160b('0x69')]['attachments']&&_0x570913[_0x160b('0x69')]['attachments']['length']){for(var _0x4b8b6c=0x0;_0x4b8b6c<_0x570913[_0x160b('0x69')][_0x160b('0xa9')][_0x160b('0x5a')];_0x4b8b6c+=0x1){_0x570913['body'][_0x160b('0xa9')][_0x4b8b6c]={'filename':_0x570913[_0x160b('0x69')][_0x160b('0xa9')][_0x4b8b6c][_0x160b('0x2d')],'path':path[_0x160b('0xaa')](config['root'],_0x160b('0xab'),_0x570913['body']['attachments'][_0x4b8b6c]['basename'])};}}var _0x234fbe=_0x58922c[_0x160b('0xac')]();return respondWithRpcPromise('SendMail',_0x160b('0xad'),{'account':_0x234fbe,'message':_0x570913[_0x160b('0x69')]});})['then'](function(_0x27a252){if(!_0x27a252)return;_0x2e8258=_0x27a252;if(!_0x1e63b9['List'])throw new Error('List\x20not\x20found');if(_0x1e63b9['List'][_0x160b('0xae')][_0x160b('0x5a')])return _0x1e63b9[_0x160b('0xaf')][_0x160b('0xae')][0x0];return db[_0x160b('0x8d')][_0x160b('0x6f')](_[_0x160b('0x9')](_0x570913[_0x160b('0x69')],{'firstName':_0x570913['body']['to'],'email':_0x570913[_0x160b('0x69')]['to'],'phone':_0x570913[_0x160b('0x69')]['to'],'ListId':_0x1e63b9[_0x160b('0xb0')]}));})[_0x160b('0x26')](function(_0x1b7ebe){if(!_0x1b7ebe)return;var _0x54b17a={'UserId':_0x570913[_0x160b('0x3c')]['id'],'ContactId':_0x1b7ebe['id'],'MailAccountId':_0x1e63b9['id'],'inReplyTo':_0x2e8258['messageId'],'to':_0x570913['body'][_0x160b('0xa6')],'cc':_0x570913[_0x160b('0x69')]['cc'],'subject':_0x570913[_0x160b('0x69')][_0x160b('0xb1')],'attach':_0x570913['body'][_0x160b('0xb2')],'firstMsgDirection':_0x160b('0xb3'),'lastMsgAt':moment()[_0x160b('0xa7')](_0x160b('0xa0')),'lastMsgDirection':_0x160b('0xb3'),'Messages':[_[_0x160b('0x60')](_0x570913[_0x160b('0x69')],{'messageId':_0x2e8258[_0x160b('0xb4')],'sentAt':moment()[_0x160b('0xa7')](_0x160b('0xa0')),'read':!![],'MailAccountId':_0x1e63b9['id'],'UserId':_0x570913[_0x160b('0x3c')]['id'],'ContactId':_0x1b7ebe['id']})]};if(_0x570913[_0x160b('0x69')][_0x160b('0xb5')]){_0x54b17a=_[_0x160b('0x60')](_0x54b17a,_0x570913[_0x160b('0x69')][_0x160b('0xb5')]);}return db[_0x160b('0x8a')]['create'](_0x54b17a,{'include':[{'model':db['MailMessage'],'as':_0x160b('0xb6')}]});})['then'](respondWithResult(_0x5192d7,null))[_0x160b('0x1b')](handleError(_0x5192d7,null));};exports[_0x160b('0xb7')]=function(_0x43319f,_0x2661c2){return db[_0x160b('0x4e')][_0x160b('0x68')]({'where':{'id':_0x43319f[_0x160b('0x66')]['id']},'include':[{'model':db[_0x160b('0x4b')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x160b('0xa4')],'as':'CloudProvider','raw':!![]}]}]})['then'](handleEntityNotFound(_0x2661c2,null))[_0x160b('0x26')](function(_0x1cb5af){if(!_0x1cb5af['Smtp'])return;var _0x1f8300=_0x1cb5af[_0x160b('0xac')]();return respondWithRpcPromise(_0x160b('0xb8'),_0x160b('0xb7'),{'account':_0x1f8300});})[_0x160b('0x26')](respondWithResult(_0x2661c2,null))[_0x160b('0x1b')](handleError(_0x2661c2,null));};exports[_0x160b('0x27')]=function(_0x3c1c8e,_0x499340){return db[_0x160b('0x4e')][_0x160b('0x68')]({'where':{'id':_0x3c1c8e[_0x160b('0x66')]['id']}})['then'](handleEntityNotFound(_0x499340,null))['then'](function(_0x47d483){if(_0x47d483&&_0x47d483[_0x160b('0x45')]){throw new db[(_0x160b('0xb9'))][(_0x160b('0xba'))](_0x160b('0xbb'));}return _0x47d483;})[_0x160b('0x26')](removeEntity(_0x499340,null))['catch'](handleError(_0x499340,null));};exports[_0x160b('0xbc')]=function(_0xd2cf77,_0x3315cc){return db['MailAccount'][_0x160b('0x68')]({'where':{'id':_0xd2cf77[_0x160b('0x66')]['id']}})['then'](handleEntityNotFound(_0x3315cc,null))[_0x160b('0x26')](function(_0x4a2b69){if(_0x4a2b69){return _0x4a2b69[_0x160b('0xbc')](_0xd2cf77[_0x160b('0x69')]['ids'],_[_0x160b('0x8b')](_0xd2cf77[_0x160b('0x69')],['ids','id'])||{})[_0x160b('0xbd')](function(_0x706d6b){for(var _0x2d2d9a=0x0;_0x2d2d9a<_0xd2cf77['body']['ids']['length'];_0x2d2d9a+=0x1){socket[_0x160b('0xbe')](_0x160b('0xbf'),{'UserId':Number(_0xd2cf77['body'][_0x160b('0x77')][_0x2d2d9a]),'MailAccountId':Number(_0xd2cf77[_0x160b('0x66')]['id'])});}return _0x706d6b;});}})['then'](respondWithResult(_0x3315cc,null))[_0x160b('0x1b')](handleError(_0x3315cc,null));};exports[_0x160b('0xc0')]=function(_0x1daf0d,_0x39cb26){return db[_0x160b('0x4e')][_0x160b('0x68')]({'where':{'id':_0x1daf0d[_0x160b('0x66')]['id']}})['then'](handleEntityNotFound(_0x39cb26,null))[_0x160b('0x26')](function(_0x35c33a){if(_0x35c33a){return _0x35c33a[_0x160b('0xc0')](_0x1daf0d[_0x160b('0x54')]['ids'])['then'](function(){if(_[_0x160b('0xc1')](_0x1daf0d['query']['ids'])){for(var _0x2ffcca=0x0;_0x2ffcca<_0x1daf0d[_0x160b('0x54')]['ids']['length'];_0x2ffcca+=0x1){socket['emit'](_0x160b('0xc2'),{'UserId':Number(_0x1daf0d[_0x160b('0x54')]['ids'][_0x2ffcca]),'MailAccountId':Number(_0x1daf0d[_0x160b('0x66')]['id'])});}}else{socket[_0x160b('0xbe')](_0x160b('0xc2'),{'UserId':Number(_0x1daf0d['query'][_0x160b('0x77')]),'MailAccountId':Number(_0x1daf0d['params']['id'])});}});}})[_0x160b('0x26')](respondWithStatusCode(_0x39cb26,null))['catch'](handleError(_0x39cb26,null));};exports['getAgents']=function(_0x275875,_0x51b63c){var _0x227c89={};var _0x1db067={};var _0x5dd5c9;var _0x2ff15e;return db[_0x160b('0x4e')][_0x160b('0x71')]({'where':{'id':_0x275875[_0x160b('0x66')]['id']}})[_0x160b('0x26')](handleEntityNotFound(_0x51b63c,null))[_0x160b('0x26')](function(_0x3cc8cf){if(_0x3cc8cf){_0x5dd5c9=_0x3cc8cf;_0x1db067[_0x160b('0x52')]=_[_0x160b('0x55')](db['User']['rawAttributes']);_0x1db067[_0x160b('0x54')]=_['keys'](_0x275875[_0x160b('0x54')]);_0x1db067['filters']=_['intersection'](_0x1db067['model'],_0x1db067[_0x160b('0x54')]);_0x227c89[_0x160b('0x59')]=_['intersection'](_0x1db067['model'],qs[_0x160b('0x58')](_0x275875['query']['fields']));_0x227c89[_0x160b('0x59')]=_0x227c89[_0x160b('0x59')][_0x160b('0x5a')]?_0x227c89[_0x160b('0x59')]:_0x1db067['model'];_0x227c89['order']=qs[_0x160b('0x5c')](_0x275875[_0x160b('0x54')][_0x160b('0x5c')]);_0x227c89[_0x160b('0x5d')]=qs[_0x160b('0x56')](_[_0x160b('0x5e')](_0x275875[_0x160b('0x54')],_0x1db067[_0x160b('0x56')]));if(_0x275875['query']['filter']){_0x227c89['where']=_[_0x160b('0x60')](_0x227c89[_0x160b('0x5d')],{'$or':_[_0x160b('0x53')](_0x227c89[_0x160b('0x59')],function(_0x795a29){var _0x20b152={};_0x20b152[_0x795a29]={'$like':'%'+_0x275875[_0x160b('0x54')]['filter']+'%'};return _0x20b152;})});}_0x227c89=_[_0x160b('0x60')]({},_0x227c89,_0x275875['options']);return _0x5dd5c9[_0x160b('0xc3')](_0x227c89);}})[_0x160b('0x26')](function(_0x2e44f1){if(_0x2e44f1){_0x2ff15e=_0x2e44f1[_0x160b('0x5a')];if(!_0x275875['query']['hasOwnProperty'](_0x160b('0x7b'))){_0x227c89[_0x160b('0x21')]=qs['limit'](_0x275875[_0x160b('0x54')][_0x160b('0x21')]);_0x227c89[_0x160b('0x1f')]=qs[_0x160b('0x1f')](_0x275875[_0x160b('0x54')][_0x160b('0x1f')]);}return _0x5dd5c9[_0x160b('0xc3')](_0x227c89);}})[_0x160b('0x26')](function(_0x24f62e){if(_0x24f62e){return _0x24f62e?{'count':_0x2ff15e,'rows':_0x24f62e}:null;}})[_0x160b('0x26')](respondWithResult(_0x51b63c,null))['catch'](handleError(_0x51b63c,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 0366f9c..882122f 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 _0xcf30=['events','../../mysqldb','MailAccount','setMaxListeners','update','remove','hook','exports'];(function(_0xb1496a,_0x190543){var _0x301916=function(_0x4e17ab){while(--_0x4e17ab){_0xb1496a['push'](_0xb1496a['shift']());}};_0x301916(++_0x190543);}(_0xcf30,0x128));var _0x0cf3=function(_0x3b1d28,_0x3203ac){_0x3b1d28=_0x3b1d28-0x0;var _0x377a8c=_0xcf30[_0x3b1d28];return _0x377a8c;};'use strict';var EventEmitter=require(_0x0cf3('0x0'));var MailAccount=require(_0x0cf3('0x1'))['db'][_0x0cf3('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x0cf3('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0cf3('0x4'),'afterDestroy':_0x0cf3('0x5')};function emitEvent(_0x4efae6){return function(_0x49ccb3,_0x5be27c,_0x238cb6){MailAccountEvents['emit'](_0x4efae6+':'+_0x49ccb3['id'],_0x49ccb3);MailAccountEvents['emit'](_0x4efae6,_0x49ccb3);_0x238cb6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount[_0x0cf3('0x6')](e,emitEvent(event));}}module[_0x0cf3('0x7')]=MailAccountEvents; \ No newline at end of file +var _0xdafc=['hook','exports','events','setMaxListeners','remove','emit','hasOwnProperty'];(function(_0x5b982d,_0x3b4dd6){var _0x3f221e=function(_0x356d98){while(--_0x356d98){_0x5b982d['push'](_0x5b982d['shift']());}};_0x3f221e(++_0x3b4dd6);}(_0xdafc,0x1a6));var _0xcdaf=function(_0x346474,_0x208dba){_0x346474=_0x346474-0x0;var _0x1bfa84=_0xdafc[_0x346474];return _0x1bfa84;};'use strict';var EventEmitter=require(_0xcdaf('0x0'));var MailAccount=require('../../mysqldb')['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xcdaf('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xcdaf('0x2')};function emitEvent(_0x1a7a6d){return function(_0x2da38c,_0x22479b,_0x56c616){MailAccountEvents[_0xcdaf('0x3')](_0x1a7a6d+':'+_0x2da38c['id'],_0x2da38c);MailAccountEvents['emit'](_0x1a7a6d,_0x2da38c);_0x56c616(null);};}for(var e in events){if(events[_0xcdaf('0x4')](e)){var event=events[e];MailAccount[_0xcdaf('0x5')](e,emitEvent(event));}}module[_0xcdaf('0x6')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 38825fd..7c5c662 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 _0x5a23=['CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','auth','OAuth2','user','data5','pass','./mailAccount.attributes','exports','define','MailAccount','mail_accounts','provider','service','host','Smtp','port','secure','authentication'];(function(_0x5b1438,_0xf76622){var _0x22865b=function(_0x140c30){while(--_0x140c30){_0x5b1438['push'](_0x5b1438['shift']());}};_0x22865b(++_0xf76622);}(_0x5a23,0x9f));var _0x35a2=function(_0x5536d3,_0x27814f){_0x5536d3=_0x5536d3-0x0;var _0x13a107=_0x5a23[_0x5536d3];return _0x13a107;};'use strict';var attributes=require(_0x35a2('0x0'));module[_0x35a2('0x1')]=function(_0x20078a){return _0x20078a[_0x35a2('0x2')](_0x35a2('0x3'),attributes,{'tableName':_0x35a2('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x8cd947=this;var _0x3098bb={'id':_0x8cd947['id'],'tls':{'rejectUnauthorized':![]}};if(_0x8cd947[_0x35a2('0x5')]!=='custom'){_0x3098bb[_0x35a2('0x6')]=_0x8cd947['provider'];}else{_0x3098bb[_0x35a2('0x7')]=_0x8cd947[_0x35a2('0x8')][_0x35a2('0x7')];_0x3098bb[_0x35a2('0x9')]=_0x8cd947['Smtp']['port'];_0x3098bb['secure']=_0x8cd947[_0x35a2('0x8')][_0x35a2('0xa')];}if(_0x8cd947['Smtp'][_0x35a2('0xb')]){if(_0x8cd947[_0x35a2('0x8')]['modernAuthentication']){if(!_0x8cd947[_0x35a2('0x8')][_0x35a2('0xc')])throw new Error(_0x35a2('0xd'));_0x3098bb[_0x35a2('0xe')]={'type':_0x35a2('0xf'),'user':_0x8cd947[_0x35a2('0x8')][_0x35a2('0x10')],'accessToken':_0x8cd947['Smtp'][_0x35a2('0xc')][_0x35a2('0x11')]};}else{_0x3098bb[_0x35a2('0xe')]={'user':_0x8cd947[_0x35a2('0x8')][_0x35a2('0x10')],'pass':_0x8cd947[_0x35a2('0x8')][_0x35a2('0x12')]};}}return _0x3098bb;}}});}; \ No newline at end of file +var _0xc762=['authentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','auth','user','pass','./mailAccount.attributes','define','MailAccount','provider','service','host','Smtp','port','secure'];(function(_0x5ecc63,_0x110d0d){var _0x56e65f=function(_0x138202){while(--_0x138202){_0x5ecc63['push'](_0x5ecc63['shift']());}};_0x56e65f(++_0x110d0d);}(_0xc762,0x114));var _0x2c76=function(_0x30d87a,_0xf3a07f){_0x30d87a=_0x30d87a-0x0;var _0x48f64b=_0xc762[_0x30d87a];return _0x48f64b;};'use strict';var attributes=require(_0x2c76('0x0'));module['exports']=function(_0x13f440){return _0x13f440[_0x2c76('0x1')](_0x2c76('0x2'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0xeb1f8=this;var _0x27a43b={'id':_0xeb1f8['id'],'tls':{'rejectUnauthorized':![]}};if(_0xeb1f8[_0x2c76('0x3')]!=='custom'){_0x27a43b[_0x2c76('0x4')]=_0xeb1f8[_0x2c76('0x3')];}else{_0x27a43b[_0x2c76('0x5')]=_0xeb1f8[_0x2c76('0x6')][_0x2c76('0x5')];_0x27a43b['port']=_0xeb1f8[_0x2c76('0x6')][_0x2c76('0x7')];_0x27a43b[_0x2c76('0x8')]=_0xeb1f8[_0x2c76('0x6')][_0x2c76('0x8')];}if(_0xeb1f8[_0x2c76('0x6')][_0x2c76('0x9')]){if(_0xeb1f8[_0x2c76('0x6')]['modernAuthentication']){if(!_0xeb1f8[_0x2c76('0x6')][_0x2c76('0xa')])throw new Error(_0x2c76('0xb'));_0x27a43b[_0x2c76('0xc')]={'type':'OAuth2','user':_0xeb1f8['Smtp'][_0x2c76('0xd')],'accessToken':_0xeb1f8[_0x2c76('0x6')][_0x2c76('0xa')]['data5']};}else{_0x27a43b[_0x2c76('0xc')]={'user':_0xeb1f8[_0x2c76('0x6')][_0x2c76('0xd')],'pass':_0xeb1f8[_0x2c76('0x6')][_0x2c76('0xe')]};}}return _0x27a43b;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 651e21a..868211a 100644 --- a/server/api/mailAccount/mailAccount.rpc.js +++ b/server/api/mailAccount/mailAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc2c7=['defaults','./mailAccount.socket','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailAccount','findAll','raw','options','where','attributes','include','map','model','ShowMailAccount','MailAccount','find','smtp','setDataValue','smtpOptions','getSmtpOptions','NotifyMailAccount','body','mail','difference','CmContact','rawAttributes','updatedAt','ListId','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','from','account','CmList','List','DESC','MailApplication','Smtp','CloudProvider','get','omit','Applications','applications','orderBy','asc','autoclose','push','close','Contacts','length','List\x20not\x20found','messageId','generate','subject','format','YYYY-MM-DD\x20HH:mm:ss','Messages','inReplyTo','MailInteraction','create','Contact\x20not\x20found','spread','update','attach','interaction','created','attachments','originTo','originCc','bcc','ChatWebsiteId','Email','Attachment','Attachments','User','name','UserId','unshift','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','redis'];(function(_0x224012,_0x2ca088){var _0x44a23f=function(_0x3de7c0){while(--_0x3de7c0){_0x224012['push'](_0x224012['shift']());}};_0x44a23f(++_0x2ca088);}(_0xc2c7,0x134));var _0x7c2c=function(_0x2cb57b,_0x4642aa){_0x2cb57b=_0x2cb57b-0x0;var _0x470876=_0xc2c7[_0x2cb57b];return _0x470876;};'use strict';var _=require('lodash');var moment=require(_0x7c2c('0x0'));var BPromise=require(_0x7c2c('0x1'));var rs=require(_0x7c2c('0x2'));var Redis=require(_0x7c2c('0x3'));var db=require(_0x7c2c('0x4'))['db'];var logger=require(_0x7c2c('0x5'))(_0x7c2c('0x6'));var config=require(_0x7c2c('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7c2c('0x8')]({'port':0x232c});config[_0x7c2c('0x9')]=_[_0x7c2c('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7c2c('0x9')]));require(_0x7c2c('0xb'))[_0x7c2c('0xc')](socket);function respondWithRpcPromise(_0x3b780b,_0x279cff,_0x57b107){return new BPromise(function(_0x3093d2,_0x307bec){return client[_0x7c2c('0xd')](_0x3b780b,_0x57b107)[_0x7c2c('0xe')](function(_0x2587ec){logger[_0x7c2c('0xf')](_0x7c2c('0x10'),_0x279cff,_0x7c2c('0x11'));logger[_0x7c2c('0x12')](_0x7c2c('0x13'),_0x279cff,_0x7c2c('0x11'),JSON[_0x7c2c('0x14')](_0x2587ec));if(_0x2587ec[_0x7c2c('0x15')]){if(_0x2587ec[_0x7c2c('0x15')][_0x7c2c('0x16')]===0x1f4){logger[_0x7c2c('0x15')]('MailAccount,\x20%s,\x20%s',_0x279cff,_0x2587ec['error'][_0x7c2c('0x17')]);return _0x307bec(_0x2587ec[_0x7c2c('0x15')][_0x7c2c('0x17')]);}logger['error'](_0x7c2c('0x10'),_0x279cff,_0x2587ec[_0x7c2c('0x15')]['message']);return _0x3093d2(_0x2587ec[_0x7c2c('0x15')]['message']);}else{logger[_0x7c2c('0xf')]('MailAccount,\x20%s,\x20%s',_0x279cff,_0x7c2c('0x11'));_0x3093d2(_0x2587ec[_0x7c2c('0x18')][_0x7c2c('0x17')]);}})[_0x7c2c('0x19')](function(_0x17df4a){logger[_0x7c2c('0x15')](_0x7c2c('0x10'),_0x279cff,_0x17df4a);_0x307bec(_0x17df4a);});});}exports[_0x7c2c('0x1a')]=function(_0x2d356e){var _0x39c5f3=this;return new Promise(function(_0x40eaef,_0x2381b4){return db['MailAccount'][_0x7c2c('0x1b')]({'raw':_0x2d356e['options']?_0x2d356e['options'][_0x7c2c('0x1c')]===undefined?!![]:![]:!![],'where':_0x2d356e[_0x7c2c('0x1d')]?_0x2d356e[_0x7c2c('0x1d')][_0x7c2c('0x1e')]||null:null,'attributes':_0x2d356e[_0x7c2c('0x1d')]?_0x2d356e[_0x7c2c('0x1d')][_0x7c2c('0x1f')]||null:null,'limit':_0x2d356e['options']?_0x2d356e[_0x7c2c('0x1d')]['limit']||null:null,'include':_0x2d356e[_0x7c2c('0x1d')]?_0x2d356e['options'][_0x7c2c('0x20')]?_[_0x7c2c('0x21')](_0x2d356e[_0x7c2c('0x1d')]['include'],function(_0x4d6ec7){return{'model':db[_0x4d6ec7[_0x7c2c('0x22')]],'as':_0x4d6ec7['as'],'attributes':_0x4d6ec7[_0x7c2c('0x1f')],'include':_0x4d6ec7[_0x7c2c('0x20')]?_[_0x7c2c('0x21')](_0x4d6ec7[_0x7c2c('0x20')],function(_0xa8e145){return{'model':db[_0xa8e145[_0x7c2c('0x22')]],'as':_0xa8e145['as'],'attributes':_0xa8e145['attributes'],'include':_0xa8e145[_0x7c2c('0x20')]?_[_0x7c2c('0x21')](_0xa8e145[_0x7c2c('0x20')],function(_0x22d03f){return{'model':db[_0x22d03f[_0x7c2c('0x22')]],'as':_0x22d03f['as'],'attributes':_0x22d03f[_0x7c2c('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x7c2c('0xe')](function(_0x26f472){logger[_0x7c2c('0xf')]('GetMailAccount',_0x2d356e);logger[_0x7c2c('0x12')](_0x7c2c('0x1a'),_0x2d356e,JSON[_0x7c2c('0x14')](_0x26f472));_0x40eaef(_0x26f472);})[_0x7c2c('0x19')](function(_0x53ad23){logger[_0x7c2c('0x15')](_0x7c2c('0x1a'),_0x53ad23[_0x7c2c('0x17')],_0x2d356e);_0x2381b4(_0x39c5f3[_0x7c2c('0x15')](0x1f4,_0x53ad23[_0x7c2c('0x17')]));});});};exports[_0x7c2c('0x23')]=function(_0x463ef7){var _0x57af44=this;return new Promise(function(_0x1969f4,_0x1acf75){return db[_0x7c2c('0x24')][_0x7c2c('0x25')]({'raw':_0x463ef7[_0x7c2c('0x1d')]?_0x463ef7['options']['raw']===undefined?!![]:![]:!![],'where':_0x463ef7[_0x7c2c('0x1d')]?_0x463ef7['options']['where']||null:null,'attributes':_0x463ef7[_0x7c2c('0x1d')]?_0x463ef7[_0x7c2c('0x1d')][_0x7c2c('0x1f')]||null:null,'include':_0x463ef7[_0x7c2c('0x1d')]?_0x463ef7['options'][_0x7c2c('0x20')]?_[_0x7c2c('0x21')](_0x463ef7[_0x7c2c('0x1d')][_0x7c2c('0x20')],function(_0x204968){return{'model':db[_0x204968[_0x7c2c('0x22')]],'as':_0x204968['as'],'attributes':_0x204968[_0x7c2c('0x1f')],'include':_0x204968[_0x7c2c('0x20')]?_[_0x7c2c('0x21')](_0x204968[_0x7c2c('0x20')],function(_0x3230a1){return{'model':db[_0x3230a1[_0x7c2c('0x22')]],'as':_0x3230a1['as'],'attributes':_0x3230a1[_0x7c2c('0x1f')],'include':_0x3230a1['include']?_['map'](_0x3230a1[_0x7c2c('0x20')],function(_0x4acc5d){return{'model':db[_0x4acc5d['model']],'as':_0x4acc5d['as'],'attributes':_0x4acc5d['attributes']};}):[]};}):[]};}):[]:[]})[_0x7c2c('0xe')](function(_0xc77f11){if(_0x463ef7[_0x7c2c('0x1d')][_0x7c2c('0x26')]===!![])_0xc77f11[_0x7c2c('0x27')](_0x7c2c('0x28'),_0xc77f11[_0x7c2c('0x29')]());logger[_0x7c2c('0xf')](_0x7c2c('0x23'),_0x463ef7);logger[_0x7c2c('0x12')](_0x7c2c('0x23'),_0x463ef7,JSON['stringify'](_0xc77f11));_0x1969f4(_0xc77f11);})['catch'](function(_0x3920b6){logger[_0x7c2c('0x15')](_0x7c2c('0x23'),_0x3920b6[_0x7c2c('0x17')],_0x463ef7);_0x1acf75(_0x57af44['error'](0x1f4,_0x3920b6[_0x7c2c('0x17')]));});});};exports[_0x7c2c('0x2a')]=function(_0x93e2a8){var _0x45fddf=this;return new Promise(function(_0x18e288,_0x8b0dc9){var _0x12c9cd={'body':_0x93e2a8[_0x7c2c('0x2b')],'channel':_0x7c2c('0x2c')};var _0x4e1f79=_[_0x7c2c('0x2d')](_['keys'](db[_0x7c2c('0x2e')][_0x7c2c('0x2f')]),['createdAt',_0x7c2c('0x30'),'CompanyId',_0x7c2c('0x31')]);var _0x33b2be=![];if(_0x93e2a8[_0x7c2c('0x2b')]['id']){delete _0x93e2a8[_0x7c2c('0x2b')]['id'];}if(_['isNil'](_0x93e2a8[_0x7c2c('0x2b')]['from'])){return _0x8b0dc9(_0x45fddf['error'](0x1f4,_0x7c2c('0x32')));}if(_[_0x7c2c('0x33')](_0x93e2a8[_0x7c2c('0x2b')]['body'])||_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x2b')]===''){return _0x8b0dc9(_0x45fddf['error'](0x1f4,_0x7c2c('0x34')));}if(_['isNil'](_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x35')])){return _0x8b0dc9(_0x45fddf['error'](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4e1f79));}if(!_[_0x7c2c('0x36')](_0x4e1f79,_0x93e2a8[_0x7c2c('0x2b')]['mapKey'])){return _0x8b0dc9(_0x45fddf[_0x7c2c('0x15')](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4e1f79));}var _0x51e3b7={};_0x51e3b7[_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x35')]]=_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x37')];return db[_0x7c2c('0x24')][_0x7c2c('0x25')]({'where':{'id':_0x93e2a8[_0x7c2c('0x38')]['id']},'include':[{'model':db[_0x7c2c('0x39')],'as':_0x7c2c('0x3a'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x51e3b7,'limit':0x1,'order':[[_0x7c2c('0x30'),_0x7c2c('0x3b')]]}]},{'model':db[_0x7c2c('0x3c')],'as':'Applications'},{'model':db['MailServerOut'],'as':_0x7c2c('0x3d'),'include':[{'model':db[_0x7c2c('0x3e')],'as':_0x7c2c('0x3e')}]}]})[_0x7c2c('0xe')](function(_0x5f3de8){if(_0x5f3de8&&_0x5f3de8['List']){var _0x587667=_0x5f3de8[_0x7c2c('0x3f')]({'plain':!![]});_0x12c9cd[_0x7c2c('0x38')]=_[_0x7c2c('0x40')](_0x587667,[_0x7c2c('0x41'),_0x7c2c('0x3a')]);_0x12c9cd['account'][_0x7c2c('0x28')]=_0x5f3de8[_0x7c2c('0x29')]();_0x12c9cd['applications']=_0x587667[_0x7c2c('0x41')];_0x12c9cd['list']=_0x587667[_0x7c2c('0x3a')];_0x12c9cd[_0x7c2c('0x42')]=_[_0x7c2c('0x43')](_0x12c9cd['applications'],['priority'],[_0x7c2c('0x44')]);if(_0x12c9cd['account']&&_0x12c9cd[_0x7c2c('0x38')][_0x7c2c('0x45')]){_0x12c9cd['applications'][_0x7c2c('0x46')]({'id':0x0,'priority':_0x12c9cd[_0x7c2c('0x42')]['length']+0x1,'app':_0x7c2c('0x47'),'appdata':_0x7c2c('0x45'),'interval':'*,*,*,*'});}if(_0x12c9cd[_0x7c2c('0x38')][_0x7c2c('0x41')]){delete _0x12c9cd[_0x7c2c('0x38')]['Applications'];}if(_0x12c9cd[_0x7c2c('0x38')]['List']){delete _0x12c9cd[_0x7c2c('0x38')][_0x7c2c('0x3a')];}if(_0x587667['List'][_0x7c2c('0x48')][_0x7c2c('0x49')]){return _0x587667[_0x7c2c('0x3a')][_0x7c2c('0x48')][0x0];}var _0x481b9e=_[_0x7c2c('0xa')](_0x93e2a8[_0x7c2c('0x2b')],{'firstName':_0x93e2a8['body'][_0x7c2c('0x37')],'ListId':_0x587667['ListId']});_0x481b9e[_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x35')]]=_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x37')];return db[_0x7c2c('0x2e')]['create'](_0x481b9e);}else{throw new Error(_0x7c2c('0x4a'));}})[_0x7c2c('0xe')](function(_0x4c4661){_0x12c9cd['contact']=_0x4c4661;if(_0x4c4661){if(!_0x93e2a8['body'][_0x7c2c('0x17')]['messageId']){_0x93e2a8[_0x7c2c('0x2b')]['message'][_0x7c2c('0x4b')]=rs[_0x7c2c('0x4c')]()+'\x20'+_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')][_0x7c2c('0x37')];}var _0x1ee34d={'ContactId':_0x4c4661['id'],'MailAccountId':_0x93e2a8[_0x7c2c('0x38')]['id'],'inReplyTo':_0x93e2a8[_0x7c2c('0x2b')]['message']['messageId'],'to':_0x93e2a8['body'][_0x7c2c('0x17')][_0x7c2c('0x37')],'cc':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')]['cc'],'subject':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')][_0x7c2c('0x4d')],'attach':_0x93e2a8[_0x7c2c('0x2b')]['message']['attach'],'lastMsgAt':moment()[_0x7c2c('0x4e')](_0x7c2c('0x4f')),'lastMsgDirection':'in'};return db['MailInteraction'][_0x7c2c('0x25')]({'where':{'closed':![],'MailAccountId':_0x93e2a8['account']['id']},'include':[{'model':db['MailMessage'],'as':_0x7c2c('0x50'),'attributes':[_0x7c2c('0x4b')],'where':{'messageId':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')][_0x7c2c('0x51')]}}]})[_0x7c2c('0xe')](function(_0x2d4459){if(_0x2d4459){return[_0x2d4459,![]];}return db[_0x7c2c('0x52')][_0x7c2c('0x53')](_0x1ee34d)[_0x7c2c('0xe')](function(_0xd01d59){return[_0xd01d59,!![]];});});}else{throw new Error(_0x7c2c('0x54'));}})[_0x7c2c('0x55')](function(_0x3d44f8,_0x559005){if(_0x3d44f8){_0x33b2be=_0x559005;if(!_0x559005){return _0x3d44f8[_0x7c2c('0x56')]({'inReplyTo':_0x93e2a8['body']['message']['messageId'],'to':_0x93e2a8['body'][_0x7c2c('0x17')][_0x7c2c('0x37')],'cc':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')]['cc'],'subject':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')]['subject'],'attach':_0x3d44f8[_0x7c2c('0x57')]?_0x3d44f8[_0x7c2c('0x57')]:_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')][_0x7c2c('0x57')],'substatus':null,'substatusAt':moment()[_0x7c2c('0x4e')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()[_0x7c2c('0x4e')](_0x7c2c('0x4f')),'lastMsgDirection':'in'});}else{return _0x3d44f8;}}})['then'](function(_0x39d319){_0x12c9cd[_0x7c2c('0x58')]=_0x39d319['get']({'plain':!![]});_0x12c9cd[_0x7c2c('0x58')][_0x7c2c('0x59')]=_0x33b2be;return db['MailMessage']['create']({'body':_0x93e2a8[_0x7c2c('0x2b')]['body'],'MailAccountId':_0x93e2a8[_0x7c2c('0x38')]['id'],'MailInteractionId':_0x39d319['id'],'direction':'in','ContactId':_0x12c9cd['contact']['id'],'messageId':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')]['messageId'],'from':_0x93e2a8[_0x7c2c('0x2b')]['message'][_0x7c2c('0x37')],'to':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')]['to'],'cc':_0x93e2a8['body'][_0x7c2c('0x17')]['cc'],'subject':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')][_0x7c2c('0x4d')],'attach':_0x93e2a8['body'][_0x7c2c('0x17')][_0x7c2c('0x57')],'Attachments':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')][_0x7c2c('0x5a')],'originTo':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')][_0x7c2c('0x5b')],'originCc':_0x93e2a8[_0x7c2c('0x2b')]['message'][_0x7c2c('0x5c')],'bcc':_0x93e2a8[_0x7c2c('0x2b')]['message'][_0x7c2c('0x5d')],'ChatWebsiteId':_0x93e2a8['body']['message'][_0x7c2c('0x5e')]||null,'originChannel':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')]['originChannel']||_0x7c2c('0x5f'),'ChatOfflineMessageId':_0x93e2a8[_0x7c2c('0x2b')][_0x7c2c('0x17')]['ChatOfflineMessageId']||null},{'include':[{'model':db[_0x7c2c('0x60')],'as':_0x7c2c('0x61')}]});})[_0x7c2c('0xe')](function(_0x8f8b42){_0x12c9cd['message']=_0x8f8b42;if(_0x12c9cd[_0x7c2c('0x58')]['UserId']){return db[_0x7c2c('0x62')]['find']({'attributes':['id',_0x7c2c('0x63')],'where':{'id':_0x12c9cd[_0x7c2c('0x58')][_0x7c2c('0x64')]}})[_0x7c2c('0xe')](function(_0x43eb9d){if(_0x43eb9d){_0x12c9cd[_0x7c2c('0x42')][_0x7c2c('0x65')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x43eb9d[_0x7c2c('0x63')]+','+(_0x12c9cd[_0x7c2c('0x38')][_0x7c2c('0x66')]||0xa),'interval':_0x7c2c('0x67')});}return respondWithRpcPromise(_0x7c2c('0x68'),_0x7c2c('0x69'),_0x12c9cd);});}return respondWithRpcPromise(_0x7c2c('0x68'),_0x7c2c('0x69'),_0x12c9cd);})['then'](function(_0x2d75b8){_0x18e288(_0x2d75b8);})[_0x7c2c('0x19')](function(_0x2391a7){_0x8b0dc9(_0x45fddf[_0x7c2c('0x15')](0x1f4,_0x2391a7[_0x7c2c('0x17')]));});});}; \ No newline at end of file +var _0x2542=['MailServerOut','Smtp','CloudProvider','get','omit','getSmtpOptions','applications','list','orderBy','priority','asc','push','length','*,*,*,*','Contacts','contact','messageId','generate','attach','format','MailMessage','Messages','inReplyTo','create','Contact\x20not\x20found','subject','YYYY-MM-DD\x20HH:mm:ss','interaction','created','originCc','ChatWebsiteId','originChannel','Email','Attachment','UserId','User','name','waitForTheAssignedAgent','Start','startRouting','lodash','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./mailAccount.socket','register','request','then','info','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','MailAccount,\x20%s,\x20%s','message','result','catch','GetMailAccount','MailAccount','options','raw','attributes','map','include','model','ShowMailAccount','find','where','smtp','setDataValue','smtpOptions','NotifyMailAccount','body','mail','difference','keys','rawAttributes','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','CmContact','DESC','MailApplication','Applications'];(function(_0xf0bc07,_0x510ebf){var _0x1c50c2=function(_0x2e2bdf){while(--_0x2e2bdf){_0xf0bc07['push'](_0xf0bc07['shift']());}};_0x1c50c2(++_0x510ebf);}(_0x2542,0x169));var _0x2254=function(_0x2fb55e,_0x464066){_0x2fb55e=_0x2fb55e-0x0;var _0x545c03=_0x2542[_0x2fb55e];return _0x545c03;};'use strict';var _=require(_0x2254('0x0'));var moment=require(_0x2254('0x1'));var BPromise=require(_0x2254('0x2'));var rs=require(_0x2254('0x3'));var Redis=require('ioredis');var db=require(_0x2254('0x4'))['db'];var logger=require('../../config/logger')(_0x2254('0x5'));var config=require(_0x2254('0x6'));var jayson=require(_0x2254('0x7'));var client=jayson[_0x2254('0x8')][_0x2254('0x9')]({'port':0x232c});config['redis']=_[_0x2254('0xa')](config[_0x2254('0xb')],{'host':_0x2254('0xc'),'port':0x18eb});var socket=require(_0x2254('0xd'))(new Redis(config[_0x2254('0xb')]));require(_0x2254('0xe'))[_0x2254('0xf')](socket);function respondWithRpcPromise(_0xbf1c18,_0xb395da,_0x1ae415){return new BPromise(function(_0x38fb2b,_0x5b1ab9){return client[_0x2254('0x10')](_0xbf1c18,_0x1ae415)[_0x2254('0x11')](function(_0x506abe){logger[_0x2254('0x12')]('MailAccount,\x20%s,\x20%s',_0xb395da,'request\x20sent');logger[_0x2254('0x13')](_0x2254('0x14'),_0xb395da,_0x2254('0x15'),JSON[_0x2254('0x16')](_0x506abe));if(_0x506abe[_0x2254('0x17')]){if(_0x506abe[_0x2254('0x17')]['code']===0x1f4){logger[_0x2254('0x17')](_0x2254('0x18'),_0xb395da,_0x506abe['error'][_0x2254('0x19')]);return _0x5b1ab9(_0x506abe[_0x2254('0x17')][_0x2254('0x19')]);}logger[_0x2254('0x17')](_0x2254('0x18'),_0xb395da,_0x506abe[_0x2254('0x17')]['message']);return _0x38fb2b(_0x506abe[_0x2254('0x17')]['message']);}else{logger[_0x2254('0x12')](_0x2254('0x18'),_0xb395da,_0x2254('0x15'));_0x38fb2b(_0x506abe[_0x2254('0x1a')][_0x2254('0x19')]);}})[_0x2254('0x1b')](function(_0x497724){logger['error']('MailAccount,\x20%s,\x20%s',_0xb395da,_0x497724);_0x5b1ab9(_0x497724);});});}exports[_0x2254('0x1c')]=function(_0x3a79f8){var _0x3c3a98=this;return new Promise(function(_0x1f1163,_0x2801d9){return db[_0x2254('0x1d')]['findAll']({'raw':_0x3a79f8[_0x2254('0x1e')]?_0x3a79f8[_0x2254('0x1e')][_0x2254('0x1f')]===undefined?!![]:![]:!![],'where':_0x3a79f8['options']?_0x3a79f8['options']['where']||null:null,'attributes':_0x3a79f8[_0x2254('0x1e')]?_0x3a79f8[_0x2254('0x1e')][_0x2254('0x20')]||null:null,'limit':_0x3a79f8['options']?_0x3a79f8['options']['limit']||null:null,'include':_0x3a79f8['options']?_0x3a79f8['options']['include']?_[_0x2254('0x21')](_0x3a79f8[_0x2254('0x1e')][_0x2254('0x22')],function(_0x265467){return{'model':db[_0x265467[_0x2254('0x23')]],'as':_0x265467['as'],'attributes':_0x265467[_0x2254('0x20')],'include':_0x265467['include']?_['map'](_0x265467[_0x2254('0x22')],function(_0x4f6877){return{'model':db[_0x4f6877[_0x2254('0x23')]],'as':_0x4f6877['as'],'attributes':_0x4f6877[_0x2254('0x20')],'include':_0x4f6877[_0x2254('0x22')]?_[_0x2254('0x21')](_0x4f6877[_0x2254('0x22')],function(_0x482688){return{'model':db[_0x482688[_0x2254('0x23')]],'as':_0x482688['as'],'attributes':_0x482688[_0x2254('0x20')]};}):[]};}):[]};}):[]:[]})[_0x2254('0x11')](function(_0x37af8b){logger[_0x2254('0x12')](_0x2254('0x1c'),_0x3a79f8);logger[_0x2254('0x13')](_0x2254('0x1c'),_0x3a79f8,JSON[_0x2254('0x16')](_0x37af8b));_0x1f1163(_0x37af8b);})[_0x2254('0x1b')](function(_0x21c641){logger[_0x2254('0x17')](_0x2254('0x1c'),_0x21c641[_0x2254('0x19')],_0x3a79f8);_0x2801d9(_0x3c3a98[_0x2254('0x17')](0x1f4,_0x21c641[_0x2254('0x19')]));});});};exports[_0x2254('0x24')]=function(_0x291894){var _0x2f32f8=this;return new Promise(function(_0x4e3658,_0xe29526){return db[_0x2254('0x1d')][_0x2254('0x25')]({'raw':_0x291894[_0x2254('0x1e')]?_0x291894[_0x2254('0x1e')][_0x2254('0x1f')]===undefined?!![]:![]:!![],'where':_0x291894[_0x2254('0x1e')]?_0x291894[_0x2254('0x1e')][_0x2254('0x26')]||null:null,'attributes':_0x291894['options']?_0x291894[_0x2254('0x1e')][_0x2254('0x20')]||null:null,'include':_0x291894['options']?_0x291894[_0x2254('0x1e')][_0x2254('0x22')]?_[_0x2254('0x21')](_0x291894[_0x2254('0x1e')]['include'],function(_0x4a2df0){return{'model':db[_0x4a2df0[_0x2254('0x23')]],'as':_0x4a2df0['as'],'attributes':_0x4a2df0['attributes'],'include':_0x4a2df0[_0x2254('0x22')]?_[_0x2254('0x21')](_0x4a2df0[_0x2254('0x22')],function(_0x141ddc){return{'model':db[_0x141ddc[_0x2254('0x23')]],'as':_0x141ddc['as'],'attributes':_0x141ddc[_0x2254('0x20')],'include':_0x141ddc[_0x2254('0x22')]?_['map'](_0x141ddc[_0x2254('0x22')],function(_0x192e9f){return{'model':db[_0x192e9f[_0x2254('0x23')]],'as':_0x192e9f['as'],'attributes':_0x192e9f[_0x2254('0x20')]};}):[]};}):[]};}):[]:[]})[_0x2254('0x11')](function(_0x3f6007){if(_0x291894[_0x2254('0x1e')][_0x2254('0x27')]===!![])_0x3f6007[_0x2254('0x28')](_0x2254('0x29'),_0x3f6007['getSmtpOptions']());logger[_0x2254('0x12')](_0x2254('0x24'),_0x291894);logger[_0x2254('0x13')](_0x2254('0x24'),_0x291894,JSON['stringify'](_0x3f6007));_0x4e3658(_0x3f6007);})[_0x2254('0x1b')](function(_0x160fec){logger[_0x2254('0x17')](_0x2254('0x24'),_0x160fec[_0x2254('0x19')],_0x291894);_0xe29526(_0x2f32f8[_0x2254('0x17')](0x1f4,_0x160fec[_0x2254('0x19')]));});});};exports[_0x2254('0x2a')]=function(_0x4db9a8){var _0x362ad1=this;return new Promise(function(_0x5c15d7,_0x1df9c3){var _0x19b580={'body':_0x4db9a8[_0x2254('0x2b')],'channel':_0x2254('0x2c')};var _0x460bb3=_[_0x2254('0x2d')](_[_0x2254('0x2e')](db['CmContact'][_0x2254('0x2f')]),[_0x2254('0x30'),_0x2254('0x31'),_0x2254('0x32'),_0x2254('0x33')]);var _0x57cda2=![];if(_0x4db9a8[_0x2254('0x2b')]['id']){delete _0x4db9a8[_0x2254('0x2b')]['id'];}if(_[_0x2254('0x34')](_0x4db9a8[_0x2254('0x2b')][_0x2254('0x35')])){return _0x1df9c3(_0x362ad1['error'](0x1f4,_0x2254('0x36')));}if(_['isNil'](_0x4db9a8[_0x2254('0x2b')][_0x2254('0x2b')])||_0x4db9a8[_0x2254('0x2b')][_0x2254('0x2b')]===''){return _0x1df9c3(_0x362ad1[_0x2254('0x17')](0x1f4,_0x2254('0x37')));}if(_[_0x2254('0x34')](_0x4db9a8[_0x2254('0x2b')][_0x2254('0x38')])){return _0x1df9c3(_0x362ad1[_0x2254('0x17')](0x1f4,_0x2254('0x39')+_0x460bb3));}if(!_[_0x2254('0x3a')](_0x460bb3,_0x4db9a8[_0x2254('0x2b')]['mapKey'])){return _0x1df9c3(_0x362ad1[_0x2254('0x17')](0x1f4,_0x2254('0x3b')+_0x460bb3));}var _0x2c5609={};_0x2c5609[_0x4db9a8['body'][_0x2254('0x38')]]=_0x4db9a8[_0x2254('0x2b')][_0x2254('0x35')];return db[_0x2254('0x1d')][_0x2254('0x25')]({'where':{'id':_0x4db9a8[_0x2254('0x3c')]['id']},'include':[{'model':db[_0x2254('0x3d')],'as':_0x2254('0x3e'),'include':[{'model':db[_0x2254('0x3f')],'as':'Contacts','where':_0x2c5609,'limit':0x1,'order':[[_0x2254('0x31'),_0x2254('0x40')]]}]},{'model':db[_0x2254('0x41')],'as':_0x2254('0x42')},{'model':db[_0x2254('0x43')],'as':_0x2254('0x44'),'include':[{'model':db[_0x2254('0x45')],'as':_0x2254('0x45')}]}]})[_0x2254('0x11')](function(_0xa103ea){if(_0xa103ea&&_0xa103ea['List']){var _0x36b977=_0xa103ea[_0x2254('0x46')]({'plain':!![]});_0x19b580['account']=_[_0x2254('0x47')](_0x36b977,[_0x2254('0x42'),_0x2254('0x3e')]);_0x19b580[_0x2254('0x3c')]['smtpOptions']=_0xa103ea[_0x2254('0x48')]();_0x19b580[_0x2254('0x49')]=_0x36b977['Applications'];_0x19b580[_0x2254('0x4a')]=_0x36b977[_0x2254('0x3e')];_0x19b580[_0x2254('0x49')]=_[_0x2254('0x4b')](_0x19b580['applications'],[_0x2254('0x4c')],[_0x2254('0x4d')]);if(_0x19b580[_0x2254('0x3c')]&&_0x19b580['account']['autoclose']){_0x19b580[_0x2254('0x49')][_0x2254('0x4e')]({'id':0x0,'priority':_0x19b580['applications'][_0x2254('0x4f')]+0x1,'app':'close','appdata':'autoclose','interval':_0x2254('0x50')});}if(_0x19b580[_0x2254('0x3c')][_0x2254('0x42')]){delete _0x19b580[_0x2254('0x3c')][_0x2254('0x42')];}if(_0x19b580['account']['List']){delete _0x19b580[_0x2254('0x3c')]['List'];}if(_0x36b977[_0x2254('0x3e')][_0x2254('0x51')][_0x2254('0x4f')]){return _0x36b977[_0x2254('0x3e')]['Contacts'][0x0];}var _0xd5fb20=_[_0x2254('0xa')](_0x4db9a8['body'],{'firstName':_0x4db9a8['body'][_0x2254('0x35')],'ListId':_0x36b977['ListId']});_0xd5fb20[_0x4db9a8[_0x2254('0x2b')][_0x2254('0x38')]]=_0x4db9a8[_0x2254('0x2b')][_0x2254('0x35')];return db[_0x2254('0x3f')]['create'](_0xd5fb20);}else{throw new Error('List\x20not\x20found');}})[_0x2254('0x11')](function(_0x5b1bd8){_0x19b580[_0x2254('0x52')]=_0x5b1bd8;if(_0x5b1bd8){if(!_0x4db9a8['body']['message']['messageId']){_0x4db9a8[_0x2254('0x2b')][_0x2254('0x19')][_0x2254('0x53')]=rs[_0x2254('0x54')]()+'\x20'+_0x4db9a8[_0x2254('0x2b')][_0x2254('0x19')][_0x2254('0x35')];}var _0x25137c={'ContactId':_0x5b1bd8['id'],'MailAccountId':_0x4db9a8[_0x2254('0x3c')]['id'],'inReplyTo':_0x4db9a8[_0x2254('0x2b')][_0x2254('0x19')][_0x2254('0x53')],'to':_0x4db9a8[_0x2254('0x2b')][_0x2254('0x19')][_0x2254('0x35')],'cc':_0x4db9a8[_0x2254('0x2b')][_0x2254('0x19')]['cc'],'subject':_0x4db9a8[_0x2254('0x2b')][_0x2254('0x19')]['subject'],'attach':_0x4db9a8[_0x2254('0x2b')][_0x2254('0x19')][_0x2254('0x55')],'lastMsgAt':moment()[_0x2254('0x56')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db['MailInteraction'][_0x2254('0x25')]({'where':{'closed':![],'MailAccountId':_0x4db9a8[_0x2254('0x3c')]['id']},'include':[{'model':db[_0x2254('0x57')],'as':_0x2254('0x58'),'attributes':[_0x2254('0x53')],'where':{'messageId':_0x4db9a8['body'][_0x2254('0x19')][_0x2254('0x59')]}}]})[_0x2254('0x11')](function(_0x4a7d36){if(_0x4a7d36){return[_0x4a7d36,![]];}return db['MailInteraction'][_0x2254('0x5a')](_0x25137c)['then'](function(_0x294931){return[_0x294931,!![]];});});}else{throw new Error(_0x2254('0x5b'));}})['spread'](function(_0x3c091e,_0x1b154f){if(_0x3c091e){_0x57cda2=_0x1b154f;if(!_0x1b154f){return _0x3c091e['update']({'inReplyTo':_0x4db9a8[_0x2254('0x2b')][_0x2254('0x19')]['messageId'],'to':_0x4db9a8['body'][_0x2254('0x19')][_0x2254('0x35')],'cc':_0x4db9a8['body']['message']['cc'],'subject':_0x4db9a8[_0x2254('0x2b')]['message'][_0x2254('0x5c')],'attach':_0x3c091e['attach']?_0x3c091e[_0x2254('0x55')]:_0x4db9a8[_0x2254('0x2b')][_0x2254('0x19')][_0x2254('0x55')],'substatus':null,'substatusAt':moment()['format'](_0x2254('0x5d')),'lastMsgAt':moment()['format'](_0x2254('0x5d')),'lastMsgDirection':'in'});}else{return _0x3c091e;}}})[_0x2254('0x11')](function(_0x5ed07f){_0x19b580[_0x2254('0x5e')]=_0x5ed07f[_0x2254('0x46')]({'plain':!![]});_0x19b580['interaction'][_0x2254('0x5f')]=_0x57cda2;return db[_0x2254('0x57')][_0x2254('0x5a')]({'body':_0x4db9a8[_0x2254('0x2b')]['body'],'MailAccountId':_0x4db9a8[_0x2254('0x3c')]['id'],'MailInteractionId':_0x5ed07f['id'],'direction':'in','ContactId':_0x19b580[_0x2254('0x52')]['id'],'messageId':_0x4db9a8['body'][_0x2254('0x19')][_0x2254('0x53')],'from':_0x4db9a8['body'][_0x2254('0x19')]['from'],'to':_0x4db9a8[_0x2254('0x2b')]['message']['to'],'cc':_0x4db9a8[_0x2254('0x2b')][_0x2254('0x19')]['cc'],'subject':_0x4db9a8['body'][_0x2254('0x19')]['subject'],'attach':_0x4db9a8[_0x2254('0x2b')][_0x2254('0x19')][_0x2254('0x55')],'Attachments':_0x4db9a8['body'][_0x2254('0x19')]['attachments'],'originTo':_0x4db9a8[_0x2254('0x2b')][_0x2254('0x19')]['originTo'],'originCc':_0x4db9a8['body'][_0x2254('0x19')][_0x2254('0x60')],'bcc':_0x4db9a8[_0x2254('0x2b')][_0x2254('0x19')]['bcc'],'ChatWebsiteId':_0x4db9a8[_0x2254('0x2b')][_0x2254('0x19')][_0x2254('0x61')]||null,'originChannel':_0x4db9a8[_0x2254('0x2b')]['message'][_0x2254('0x62')]||_0x2254('0x63'),'ChatOfflineMessageId':_0x4db9a8['body'][_0x2254('0x19')]['ChatOfflineMessageId']||null},{'include':[{'model':db[_0x2254('0x64')],'as':'Attachments'}]});})['then'](function(_0x4efb07){_0x19b580[_0x2254('0x19')]=_0x4efb07;if(_0x19b580['interaction'][_0x2254('0x65')]){return db[_0x2254('0x66')]['find']({'attributes':['id',_0x2254('0x67')],'where':{'id':_0x19b580[_0x2254('0x5e')][_0x2254('0x65')]}})[_0x2254('0x11')](function(_0x259e10){if(_0x259e10){_0x19b580[_0x2254('0x49')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x259e10[_0x2254('0x67')]+','+(_0x19b580[_0x2254('0x3c')][_0x2254('0x68')]||0xa),'interval':_0x2254('0x50')});}return respondWithRpcPromise(_0x2254('0x69'),_0x2254('0x6a'),_0x19b580);});}return respondWithRpcPromise(_0x2254('0x69'),_0x2254('0x6a'),_0x19b580);})[_0x2254('0x11')](function(_0x39b95b){_0x5c15d7(_0x39b95b);})['catch'](function(_0x25eb17){_0x1df9c3(_0x362ad1[_0x2254('0x17')](0x1f4,_0x25eb17['message']));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index f0b5fe3..1eabe80 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 _0xa109=['length','mailAccount:','./mailAccount.events','remove','update','emit','removeListener','register'];(function(_0x2a0332,_0x550661){var _0x1bc9c5=function(_0x378a61){while(--_0x378a61){_0x2a0332['push'](_0x2a0332['shift']());}};_0x1bc9c5(++_0x550661);}(_0xa109,0xf2));var _0x9a10=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa109[_0x3947c9];return _0x2e7871;};'use strict';var MailAccountEvents=require(_0x9a10('0x0'));var events=['save',_0x9a10('0x1'),_0x9a10('0x2')];function createListener(_0x312817,_0x5c37fd){return function(_0x2aa797){_0x5c37fd[_0x9a10('0x3')](_0x312817,_0x2aa797);};}function removeListener(_0x2c6556,_0x126897){return function(){MailAccountEvents[_0x9a10('0x4')](_0x2c6556,_0x126897);};}exports[_0x9a10('0x5')]=function(_0x3741e6){for(var _0x2e86bf=0x0,_0x19b3f5=events[_0x9a10('0x6')];_0x2e86bf<_0x19b3f5;_0x2e86bf++){var _0x51c0bd=events[_0x2e86bf];var _0xb16a3c=createListener(_0x9a10('0x7')+_0x51c0bd,_0x3741e6);MailAccountEvents['on'](_0x51c0bd,_0xb16a3c);}}; \ No newline at end of file +var _0x9173=['length','mailAccount:','./mailAccount.events','save','remove','emit','removeListener','register'];(function(_0x2678f5,_0x263c8c){var _0x4f96a4=function(_0x189705){while(--_0x189705){_0x2678f5['push'](_0x2678f5['shift']());}};_0x4f96a4(++_0x263c8c);}(_0x9173,0xc2));var _0x3917=function(_0x44a5af,_0x49d217){_0x44a5af=_0x44a5af-0x0;var _0x1c2257=_0x9173[_0x44a5af];return _0x1c2257;};'use strict';var MailAccountEvents=require(_0x3917('0x0'));var events=[_0x3917('0x1'),_0x3917('0x2'),'update'];function createListener(_0x230c19,_0x2d2d30){return function(_0x2b4003){_0x2d2d30[_0x3917('0x3')](_0x230c19,_0x2b4003);};}function removeListener(_0x33b166,_0x59d7b7){return function(){MailAccountEvents[_0x3917('0x4')](_0x33b166,_0x59d7b7);};}exports[_0x3917('0x5')]=function(_0x23f6c6){for(var _0x1df23f=0x0,_0x1ca665=events[_0x3917('0x6')];_0x1df23f<_0x1ca665;_0x1df23f++){var _0x560f0f=events[_0x1df23f];var _0x3bc970=createListener(_0x3917('0x7')+_0x560f0f,_0x23f6c6);MailAccountEvents['on'](_0x560f0f,_0x3bc970);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index aa509bc..7a779a5 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 _0x1ae0=['put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show'];(function(_0x11bd9e,_0x4bd911){var _0x2dcb2a=function(_0x353890){while(--_0x353890){_0x11bd9e['push'](_0x11bd9e['shift']());}};_0x2dcb2a(++_0x4bd911);}(_0x1ae0,0x16a));var _0x01ae=function(_0x1775d7,_0x19b4c1){_0x1775d7=_0x1775d7-0x0;var _0x2edb7e=_0x1ae0[_0x1775d7];return _0x2edb7e;};'use strict';var multer=require(_0x01ae('0x0'));var util=require('util');var path=require(_0x01ae('0x1'));var timeout=require(_0x01ae('0x2'));var express=require(_0x01ae('0x3'));var router=express[_0x01ae('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x01ae('0x5'));var interaction=require(_0x01ae('0x6'));var config=require(_0x01ae('0x7'));var controller=require('./mailApplication.controller');router[_0x01ae('0x8')](_0x01ae('0x9'),auth[_0x01ae('0xa')](),controller[_0x01ae('0xb')]);router[_0x01ae('0xc')](_0x01ae('0x9'),auth['isAuthenticated'](),controller[_0x01ae('0xd')]);router[_0x01ae('0xe')](_0x01ae('0x9'),auth[_0x01ae('0xa')](),controller[_0x01ae('0xf')]);module[_0x01ae('0x10')]=router; \ No newline at end of file +var _0x2e9a=['isAuthenticated','put','/:id','update','delete','destroy','exports','util','connect-timeout','Router','fs-extra','../../config/environment','get'];(function(_0x392f97,_0x220131){var _0x42d94b=function(_0x36ea51){while(--_0x36ea51){_0x392f97['push'](_0x392f97['shift']());}};_0x42d94b(++_0x220131);}(_0x2e9a,0x132));var _0xa2e9=function(_0x2bc7dc,_0x1e1b4e){_0x2bc7dc=_0x2bc7dc-0x0;var _0x230c28=_0x2e9a[_0x2bc7dc];return _0x230c28;};'use strict';var multer=require('multer');var util=require(_0xa2e9('0x0'));var path=require('path');var timeout=require(_0xa2e9('0x1'));var express=require('express');var router=express[_0xa2e9('0x2')]();var fs_extra=require(_0xa2e9('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa2e9('0x4'));var controller=require('./mailApplication.controller');router[_0xa2e9('0x5')]('/:id',auth[_0xa2e9('0x6')](),controller['show']);router[_0xa2e9('0x7')](_0xa2e9('0x8'),auth[_0xa2e9('0x6')](),controller[_0xa2e9('0x9')]);router[_0xa2e9('0xa')]('/:id',auth[_0xa2e9('0x6')](),controller[_0xa2e9('0xb')]);module[_0xa2e9('0xc')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 6fd744a..782eed2 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 _0x6e3c=['sequelize','INTEGER','STRING','noop','*,*,*,*'];(function(_0x27651c,_0x13103c){var _0x5e4c9a=function(_0x3b43fb){while(--_0x3b43fb){_0x27651c['push'](_0x27651c['shift']());}};_0x5e4c9a(++_0x13103c);}(_0x6e3c,0x1b3));var _0xc6e3=function(_0x54abc8,_0xd098e){_0x54abc8=_0x54abc8-0x0;var _0x4dfe6d=_0x6e3c[_0x54abc8];return _0x4dfe6d;};'use strict';var Sequelize=require(_0xc6e3('0x0'));module['exports']={'priority':{'type':Sequelize[_0xc6e3('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xc6e3('0x2')],'allowNull':![],'defaultValue':_0xc6e3('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xc6e3('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xc6e3('0x4')}}; \ No newline at end of file +var _0x8653=['INTEGER','TEXT','STRING','exports'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x8653,0xdb));var _0x3865=function(_0x2236bc,_0x5e7076){_0x2236bc=_0x2236bc-0x0;var _0xb7d789=_0x8653[_0x2236bc];return _0xb7d789;};'use strict';var Sequelize=require('sequelize');module[_0x3865('0x0')]={'priority':{'type':Sequelize[_0x3865('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x3865('0x2')]()},'description':{'type':Sequelize[_0x3865('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 30b93fa..94b4932 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 _0xd8b0=['attributes','length','include','merge','find','catch','body','params','eml-format','rimraf','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','name','show','model','MailApplication','query','keys','intersection','fields'];(function(_0x450c09,_0x15c01a){var _0x51cbe3=function(_0x133bc2){while(--_0x133bc2){_0x450c09['push'](_0x450c09['shift']());}};_0x51cbe3(++_0x15c01a);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x0d8b('0x0'));var rimraf=require(_0x0d8b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0d8b('0x2'));var BPromise=require(_0x0d8b('0x3'));var Mustache=require(_0x0d8b('0x4'));var util=require(_0x0d8b('0x5'));var path=require(_0x0d8b('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0d8b('0x7'));var fs=require('fs');var fs_extra=require(_0x0d8b('0x8'));var _=require(_0x0d8b('0x9'));var squel=require('squel');var crypto=require(_0x0d8b('0xa'));var jsforce=require(_0x0d8b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0d8b('0xc'));var querystring=require(_0x0d8b('0xd'));var Papa=require(_0x0d8b('0xe'));var Redis=require(_0x0d8b('0xf'));var authService=require(_0x0d8b('0x10'));var qs=require(_0x0d8b('0x11'));var as=require(_0x0d8b('0x12'));var hardwareService=require(_0x0d8b('0x13'));var logger=require('../../config/logger')(_0x0d8b('0x14'));var utils=require('../../config/utils');var config=require(_0x0d8b('0x15'));var licenseUtil=require(_0x0d8b('0x16'));var db=require(_0x0d8b('0x17'))['db'];function respondWithStatusCode(_0x92cdd8,_0x35a07b){_0x35a07b=_0x35a07b||0xcc;return function(_0x32bb1a){if(_0x32bb1a){return _0x92cdd8[_0x0d8b('0x18')](_0x35a07b);}return _0x92cdd8[_0x0d8b('0x19')](_0x35a07b)[_0x0d8b('0x1a')]();};}function respondWithResult(_0x2ce75e,_0x5ad086){_0x5ad086=_0x5ad086||0xc8;return function(_0xe65334){if(_0xe65334){return _0x2ce75e[_0x0d8b('0x19')](_0x5ad086)[_0x0d8b('0x1b')](_0xe65334);}};}function respondWithFilteredResult(_0x4f6f21,_0x23eb7b){return function(_0xa86349){if(_0xa86349){var _0x17f7df=typeof _0x23eb7b[_0x0d8b('0x1c')]===_0x0d8b('0x1d')&&typeof _0x23eb7b['limit']===_0x0d8b('0x1d');var _0x4586c2=_0xa86349[_0x0d8b('0x1e')];var _0x5fecbd=_0x17f7df?0x0:_0x23eb7b[_0x0d8b('0x1c')];var _0x18dd2d=_0x17f7df?_0xa86349[_0x0d8b('0x1e')]:_0x23eb7b[_0x0d8b('0x1c')]+_0x23eb7b['limit'];var _0x27512e;if(_0x18dd2d>=_0x4586c2){_0x18dd2d=_0x4586c2;_0x27512e=0xc8;}else{_0x27512e=0xce;}_0x4f6f21[_0x0d8b('0x19')](_0x27512e);return _0x4f6f21[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x5fecbd+'-'+_0x18dd2d+'/'+_0x4586c2)[_0x0d8b('0x1b')](_0xa86349);}return null;};}function patchUpdates(_0x5b709c){return function(_0x393beb){try{jsonpatch[_0x0d8b('0x21')](_0x393beb,_0x5b709c,!![]);}catch(_0x50ec1e){return BPromise['reject'](_0x50ec1e);}return _0x393beb[_0x0d8b('0x22')]();};}function saveUpdates(_0x54a9a7,_0x56c729){return function(_0x5527d8){if(_0x5527d8){return _0x5527d8[_0x0d8b('0x23')](_0x54a9a7)[_0x0d8b('0x24')](function(_0x214778){return _0x214778;});}return null;};}function removeEntity(_0x38efc8,_0x221071){return function(_0x2c64e2){if(_0x2c64e2){return _0x2c64e2[_0x0d8b('0x25')]()[_0x0d8b('0x24')](function(){_0x38efc8[_0x0d8b('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe8bbee,_0x4463ee){return function(_0x5363e3){if(!_0x5363e3){_0xe8bbee[_0x0d8b('0x18')](0x194);}return _0x5363e3;};}function handleError(_0x4a0ae4,_0x3dd149){_0x3dd149=_0x3dd149||0x1f4;return function(_0x234bdd){logger[_0x0d8b('0x26')](_0x234bdd['stack']);if(_0x234bdd['name']){delete _0x234bdd[_0x0d8b('0x27')];}_0x4a0ae4[_0x0d8b('0x19')](_0x3dd149)['send'](_0x234bdd);};}exports[_0x0d8b('0x28')]=function(_0x59aa83,_0x1b2b59){var _0x4b59e5={'raw':!![],'where':{'id':_0x59aa83['params']['id']}},_0x97050a={};_0x97050a[_0x0d8b('0x29')]=_['keys'](db[_0x0d8b('0x2a')]['rawAttributes']);_0x97050a[_0x0d8b('0x2b')]=_[_0x0d8b('0x2c')](_0x59aa83[_0x0d8b('0x2b')]);_0x97050a['filters']=_['intersection'](_0x97050a['model'],_0x97050a[_0x0d8b('0x2b')]);_0x4b59e5['attributes']=_[_0x0d8b('0x2d')](_0x97050a['model'],qs['fields'](_0x59aa83[_0x0d8b('0x2b')][_0x0d8b('0x2e')]));_0x4b59e5[_0x0d8b('0x2f')]=_0x4b59e5[_0x0d8b('0x2f')][_0x0d8b('0x30')]?_0x4b59e5[_0x0d8b('0x2f')]:_0x97050a[_0x0d8b('0x29')];if(_0x59aa83[_0x0d8b('0x2b')]['includeAll']){_0x4b59e5[_0x0d8b('0x31')]=[{'all':!![]}];}_0x4b59e5=_[_0x0d8b('0x32')]({},_0x4b59e5,_0x59aa83['options']);return db[_0x0d8b('0x2a')][_0x0d8b('0x33')](_0x4b59e5)[_0x0d8b('0x24')](handleEntityNotFound(_0x1b2b59,null))['then'](respondWithResult(_0x1b2b59,null))[_0x0d8b('0x34')](handleError(_0x1b2b59,null));};exports[_0x0d8b('0x23')]=function(_0x206157,_0x31ceba){if(_0x206157[_0x0d8b('0x35')]['id']){delete _0x206157['body']['id'];}return db[_0x0d8b('0x2a')][_0x0d8b('0x33')]({'where':{'id':_0x206157['params']['id']}})[_0x0d8b('0x24')](handleEntityNotFound(_0x31ceba,null))[_0x0d8b('0x24')](saveUpdates(_0x206157[_0x0d8b('0x35')],null))[_0x0d8b('0x24')](respondWithResult(_0x31ceba,null))[_0x0d8b('0x34')](handleError(_0x31ceba,null));};exports['destroy']=function(_0x497a71,_0x41b4f9){return db['MailApplication']['find']({'where':{'id':_0x497a71[_0x0d8b('0x36')]['id']}})[_0x0d8b('0x24')](handleEntityNotFound(_0x41b4f9,null))[_0x0d8b('0x24')](removeEntity(_0x41b4f9,null))[_0x0d8b('0x34')](handleError(_0x41b4f9,null));}; \ No newline at end of file +var _0xf4eb=['limit','count','Content-Range','json','apply','reject','save','then','destroy','error','name','send','params','keys','MailApplication','rawAttributes','query','filters','intersection','model','fields','attributes','includeAll','include','options','find','catch','body','eml-format','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined'];(function(_0x14218b,_0x3a5b35){var _0x55829f=function(_0x4dc598){while(--_0x4dc598){_0x14218b['push'](_0x14218b['shift']());}};_0x55829f(++_0x3a5b35);}(_0xf4eb,0xec));var _0xbf4e=function(_0x5163f7,_0x711247){_0x5163f7=_0x5163f7-0x0;var _0x6ff047=_0xf4eb[_0x5163f7];return _0x6ff047;};'use strict';var emlformat=require(_0xbf4e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbf4e('0x1'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xbf4e('0x2'));var path=require(_0xbf4e('0x3'));var sox=require(_0xbf4e('0x4'));var csv=require(_0xbf4e('0x5'));var ejs=require(_0xbf4e('0x6'));var fs=require('fs');var fs_extra=require(_0xbf4e('0x7'));var _=require(_0xbf4e('0x8'));var squel=require('squel');var crypto=require(_0xbf4e('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xbf4e('0x5'));var querystring=require(_0xbf4e('0xa'));var Papa=require(_0xbf4e('0xb'));var Redis=require(_0xbf4e('0xc'));var authService=require(_0xbf4e('0xd'));var qs=require(_0xbf4e('0xe'));var as=require(_0xbf4e('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xbf4e('0x10'));var utils=require('../../config/utils');var config=require(_0xbf4e('0x11'));var licenseUtil=require(_0xbf4e('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x17fd01,_0x5a3035){_0x5a3035=_0x5a3035||0xcc;return function(_0x56d185){if(_0x56d185){return _0x17fd01[_0xbf4e('0x13')](_0x5a3035);}return _0x17fd01[_0xbf4e('0x14')](_0x5a3035)[_0xbf4e('0x15')]();};}function respondWithResult(_0x302841,_0x3b74bd){_0x3b74bd=_0x3b74bd||0xc8;return function(_0x61bd54){if(_0x61bd54){return _0x302841['status'](_0x3b74bd)['json'](_0x61bd54);}};}function respondWithFilteredResult(_0x180432,_0x1735ae){return function(_0x28fc6b){if(_0x28fc6b){var _0x542909=typeof _0x1735ae[_0xbf4e('0x16')]===_0xbf4e('0x17')&&typeof _0x1735ae[_0xbf4e('0x18')]===_0xbf4e('0x17');var _0x5a631e=_0x28fc6b[_0xbf4e('0x19')];var _0x577c27=_0x542909?0x0:_0x1735ae['offset'];var _0x566ec3=_0x542909?_0x28fc6b['count']:_0x1735ae[_0xbf4e('0x16')]+_0x1735ae[_0xbf4e('0x18')];var _0x1fc800;if(_0x566ec3>=_0x5a631e){_0x566ec3=_0x5a631e;_0x1fc800=0xc8;}else{_0x1fc800=0xce;}_0x180432['status'](_0x1fc800);return _0x180432['set'](_0xbf4e('0x1a'),_0x577c27+'-'+_0x566ec3+'/'+_0x5a631e)[_0xbf4e('0x1b')](_0x28fc6b);}return null;};}function patchUpdates(_0x3be138){return function(_0x3a875b){try{jsonpatch[_0xbf4e('0x1c')](_0x3a875b,_0x3be138,!![]);}catch(_0x1e2a68){return BPromise[_0xbf4e('0x1d')](_0x1e2a68);}return _0x3a875b[_0xbf4e('0x1e')]();};}function saveUpdates(_0xd09e12,_0x376832){return function(_0x30539b){if(_0x30539b){return _0x30539b['update'](_0xd09e12)[_0xbf4e('0x1f')](function(_0x2e7673){return _0x2e7673;});}return null;};}function removeEntity(_0x51648c,_0x31e3f5){return function(_0x30994d){if(_0x30994d){return _0x30994d[_0xbf4e('0x20')]()[_0xbf4e('0x1f')](function(){_0x51648c[_0xbf4e('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x90635e,_0x36688a){return function(_0x3d6863){if(!_0x3d6863){_0x90635e['sendStatus'](0x194);}return _0x3d6863;};}function handleError(_0x2fb490,_0x5e08b1){_0x5e08b1=_0x5e08b1||0x1f4;return function(_0x5bcf71){logger[_0xbf4e('0x21')](_0x5bcf71['stack']);if(_0x5bcf71[_0xbf4e('0x22')]){delete _0x5bcf71[_0xbf4e('0x22')];}_0x2fb490[_0xbf4e('0x14')](_0x5e08b1)[_0xbf4e('0x23')](_0x5bcf71);};}exports['show']=function(_0x2d4686,_0x8e0ab5){var _0x43879d={'raw':!![],'where':{'id':_0x2d4686[_0xbf4e('0x24')]['id']}},_0x4cd4a1={};_0x4cd4a1['model']=_[_0xbf4e('0x25')](db[_0xbf4e('0x26')][_0xbf4e('0x27')]);_0x4cd4a1['query']=_[_0xbf4e('0x25')](_0x2d4686[_0xbf4e('0x28')]);_0x4cd4a1[_0xbf4e('0x29')]=_[_0xbf4e('0x2a')](_0x4cd4a1[_0xbf4e('0x2b')],_0x4cd4a1[_0xbf4e('0x28')]);_0x43879d['attributes']=_[_0xbf4e('0x2a')](_0x4cd4a1[_0xbf4e('0x2b')],qs['fields'](_0x2d4686[_0xbf4e('0x28')][_0xbf4e('0x2c')]));_0x43879d['attributes']=_0x43879d[_0xbf4e('0x2d')]['length']?_0x43879d[_0xbf4e('0x2d')]:_0x4cd4a1['model'];if(_0x2d4686[_0xbf4e('0x28')][_0xbf4e('0x2e')]){_0x43879d[_0xbf4e('0x2f')]=[{'all':!![]}];}_0x43879d=_['merge']({},_0x43879d,_0x2d4686[_0xbf4e('0x30')]);return db[_0xbf4e('0x26')][_0xbf4e('0x31')](_0x43879d)[_0xbf4e('0x1f')](handleEntityNotFound(_0x8e0ab5,null))[_0xbf4e('0x1f')](respondWithResult(_0x8e0ab5,null))[_0xbf4e('0x32')](handleError(_0x8e0ab5,null));};exports['update']=function(_0x99b320,_0x3dbb2b){if(_0x99b320[_0xbf4e('0x33')]['id']){delete _0x99b320[_0xbf4e('0x33')]['id'];}return db[_0xbf4e('0x26')]['find']({'where':{'id':_0x99b320['params']['id']}})['then'](handleEntityNotFound(_0x3dbb2b,null))['then'](saveUpdates(_0x99b320[_0xbf4e('0x33')],null))[_0xbf4e('0x1f')](respondWithResult(_0x3dbb2b,null))[_0xbf4e('0x32')](handleError(_0x3dbb2b,null));};exports[_0xbf4e('0x20')]=function(_0x22ddde,_0x257b74){return db[_0xbf4e('0x26')][_0xbf4e('0x31')]({'where':{'id':_0x22ddde[_0xbf4e('0x24')]['id']}})['then'](handleEntityNotFound(_0x257b74,null))['then'](removeEntity(_0x257b74,null))[_0xbf4e('0x32')](handleError(_0x257b74,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 2b459c6..00a436e 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 _0x0c51=['../../config/environment','./mailApplication.attributes','exports','MailApplication','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','request-promise','path'];(function(_0x3f68ba,_0x542e3c){var _0x5be80e=function(_0x26ad63){while(--_0x26ad63){_0x3f68ba['push'](_0x3f68ba['shift']());}};_0x5be80e(++_0x542e3c);}(_0x0c51,0xde));var _0x10c5=function(_0x496075,_0x2cd8f4){_0x496075=_0x496075-0x0;var _0x39b6f0=_0x0c51[_0x496075];return _0x39b6f0;};'use strict';var _=require(_0x10c5('0x0'));var util=require('util');var logger=require(_0x10c5('0x1'))(_0x10c5('0x2'));var moment=require('moment');var BPromise=require(_0x10c5('0x3'));var rp=require(_0x10c5('0x4'));var fs=require('fs');var path=require(_0x10c5('0x5'));var rimraf=require('rimraf');var config=require(_0x10c5('0x6'));var attributes=require(_0x10c5('0x7'));module[_0x10c5('0x8')]=function(_0x4db86e,_0x83edb8){return _0x4db86e['define'](_0x10c5('0x9'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x10c5('0xa'),'collate':_0x10c5('0xb')});}; \ No newline at end of file +var _0x8cdb=['mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailApplication.attributes','exports','define','MailApplication'];(function(_0xb83ec2,_0x18e73b){var _0x4d2fbf=function(_0x16538a){while(--_0x16538a){_0xb83ec2['push'](_0xb83ec2['shift']());}};_0x4d2fbf(++_0x18e73b);}(_0x8cdb,0x103));var _0xb8cd=function(_0x1ece27,_0x8ad4c9){_0x1ece27=_0x1ece27-0x0;var _0x36a851=_0x8cdb[_0x1ece27];return _0x36a851;};'use strict';var _=require(_0xb8cd('0x0'));var util=require(_0xb8cd('0x1'));var logger=require(_0xb8cd('0x2'))('api');var moment=require(_0xb8cd('0x3'));var BPromise=require(_0xb8cd('0x4'));var rp=require(_0xb8cd('0x5'));var fs=require('fs');var path=require(_0xb8cd('0x6'));var rimraf=require(_0xb8cd('0x7'));var config=require(_0xb8cd('0x8'));var attributes=require(_0xb8cd('0x9'));module[_0xb8cd('0xa')]=function(_0xff069a,_0xf8c4c7){return _0xff069a[_0xb8cd('0xb')](_0xb8cd('0xc'),attributes,{'tableName':_0xb8cd('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb8cd('0xe'),'collate':_0xb8cd('0xf')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 02a7ba3..6d97910 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 _0x22bb=['request','then','info','MailApplication,\x20%s,\x20%s','debug','MailApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','update','body','options','attributes','UpdateMailApplication','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x40bffc,_0x3a45d7){var _0x3007e9=function(_0x4c8fda){while(--_0x4c8fda){_0x40bffc['push'](_0x40bffc['shift']());}};_0x3007e9(++_0x3a45d7);}(_0x22bb,0x11f));var _0xb22b=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x22bb[_0xb0f7c3];return _0x28ea68;};'use strict';var _=require(_0xb22b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb22b('0x1'));var rs=require(_0xb22b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb22b('0x3'))['db'];var utils=require(_0xb22b('0x4'));var logger=require(_0xb22b('0x5'))(_0xb22b('0x6'));var config=require('../../config/environment');var jayson=require(_0xb22b('0x7'));var client=jayson[_0xb22b('0x8')][_0xb22b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x10275f,_0x2c3b62,_0x2bb4b6){return new BPromise(function(_0x439a87,_0x3626a7){return client[_0xb22b('0xa')](_0x10275f,_0x2bb4b6)[_0xb22b('0xb')](function(_0x5d231c){logger[_0xb22b('0xc')](_0xb22b('0xd'),_0x2c3b62,'request\x20sent');logger[_0xb22b('0xe')](_0xb22b('0xf'),_0x2c3b62,_0xb22b('0x10'),JSON[_0xb22b('0x11')](_0x5d231c));if(_0x5d231c[_0xb22b('0x12')]){if(_0x5d231c[_0xb22b('0x12')]['code']===0x1f4){logger[_0xb22b('0x12')](_0xb22b('0xd'),_0x2c3b62,_0x5d231c[_0xb22b('0x12')][_0xb22b('0x13')]);return _0x3626a7(_0x5d231c[_0xb22b('0x12')][_0xb22b('0x13')]);}logger[_0xb22b('0x12')](_0xb22b('0xd'),_0x2c3b62,_0x5d231c[_0xb22b('0x12')]['message']);return _0x439a87(_0x5d231c['error'][_0xb22b('0x13')]);}else{logger[_0xb22b('0xc')](_0xb22b('0xd'),_0x2c3b62,_0xb22b('0x10'));_0x439a87(_0x5d231c[_0xb22b('0x14')][_0xb22b('0x13')]);}})[_0xb22b('0x15')](function(_0x5e6a17){logger[_0xb22b('0x12')]('MailApplication,\x20%s,\x20%s',_0x2c3b62,_0x5e6a17);_0x3626a7(_0x5e6a17);});});}exports['UpdateMailApplication']=function(_0x52e69d){var _0x58dda2=this;return new Promise(function(_0x500f03,_0x3c31ec){return db['MailApplication'][_0xb22b('0x16')](_0x52e69d[_0xb22b('0x17')],{'raw':_0x52e69d[_0xb22b('0x18')]?_0x52e69d[_0xb22b('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x52e69d[_0xb22b('0x18')]?_0x52e69d[_0xb22b('0x18')]['where']||null:null,'attributes':_0x52e69d[_0xb22b('0x18')]?_0x52e69d['options'][_0xb22b('0x19')]||null:null,'limit':_0x52e69d[_0xb22b('0x18')]?_0x52e69d[_0xb22b('0x18')]['limit']||null:null})[_0xb22b('0xb')](function(_0x38695b){logger['info'](_0xb22b('0x1a'),_0x52e69d);logger['debug'](_0xb22b('0x1a'),_0x52e69d,JSON[_0xb22b('0x11')](_0x38695b));_0x500f03(_0x38695b);})[_0xb22b('0x15')](function(_0xcea0ba){logger[_0xb22b('0x12')](_0xb22b('0x1a'),_0xcea0ba[_0xb22b('0x13')],_0x52e69d);_0x3c31ec(_0x58dda2[_0xb22b('0x12')](0x1f4,_0xcea0ba[_0xb22b('0x13')]));});});}; \ No newline at end of file +var _0x8590=['update','options','then','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','request','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','UpdateMailApplication'];(function(_0x11b75e,_0x653071){var _0x2213e8=function(_0x19141e){while(--_0x19141e){_0x11b75e['push'](_0x11b75e['shift']());}};_0x2213e8(++_0x653071);}(_0x8590,0x10c));var _0x0859=function(_0x36daf7,_0x20e75d){_0x36daf7=_0x36daf7-0x0;var _0x2af7cb=_0x8590[_0x36daf7];return _0x2af7cb;};'use strict';var _=require('lodash');var util=require(_0x0859('0x0'));var moment=require(_0x0859('0x1'));var BPromise=require(_0x0859('0x2'));var rs=require(_0x0859('0x3'));var fs=require('fs');var Redis=require(_0x0859('0x4'));var db=require(_0x0859('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0859('0x6'))(_0x0859('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0859('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a04c4,_0x4653ce,_0x166124){return new BPromise(function(_0x1edd17,_0x39c547){return client[_0x0859('0x9')](_0x3a04c4,_0x166124)['then'](function(_0x4de2b1){logger['info'](_0x0859('0xa'),_0x4653ce,_0x0859('0xb'));logger[_0x0859('0xc')](_0x0859('0xd'),_0x4653ce,_0x0859('0xb'),JSON['stringify'](_0x4de2b1));if(_0x4de2b1['error']){if(_0x4de2b1[_0x0859('0xe')]['code']===0x1f4){logger[_0x0859('0xe')]('MailApplication,\x20%s,\x20%s',_0x4653ce,_0x4de2b1[_0x0859('0xe')]['message']);return _0x39c547(_0x4de2b1[_0x0859('0xe')][_0x0859('0xf')]);}logger['error'](_0x0859('0xa'),_0x4653ce,_0x4de2b1[_0x0859('0xe')][_0x0859('0xf')]);return _0x1edd17(_0x4de2b1[_0x0859('0xe')]['message']);}else{logger[_0x0859('0x10')](_0x0859('0xa'),_0x4653ce,'request\x20sent');_0x1edd17(_0x4de2b1[_0x0859('0x11')][_0x0859('0xf')]);}})[_0x0859('0x12')](function(_0x1ed532){logger[_0x0859('0xe')](_0x0859('0xa'),_0x4653ce,_0x1ed532);_0x39c547(_0x1ed532);});});}exports[_0x0859('0x13')]=function(_0x2036f9){var _0x1dcfde=this;return new Promise(function(_0x375e48,_0x2fce3f){return db['MailApplication'][_0x0859('0x14')](_0x2036f9['body'],{'raw':_0x2036f9[_0x0859('0x15')]?_0x2036f9[_0x0859('0x15')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2036f9['options']?_0x2036f9[_0x0859('0x15')]['where']||null:null,'attributes':_0x2036f9[_0x0859('0x15')]?_0x2036f9[_0x0859('0x15')]['attributes']||null:null,'limit':_0x2036f9[_0x0859('0x15')]?_0x2036f9[_0x0859('0x15')]['limit']||null:null})[_0x0859('0x16')](function(_0x1c69a1){logger[_0x0859('0x10')](_0x0859('0x13'),_0x2036f9);logger[_0x0859('0xc')](_0x0859('0x13'),_0x2036f9,JSON[_0x0859('0x17')](_0x1c69a1));_0x375e48(_0x1c69a1);})[_0x0859('0x12')](function(_0x1e824a){logger[_0x0859('0xe')]('UpdateMailApplication',_0x1e824a[_0x0859('0xf')],_0x2036f9);_0x2fce3f(_0x1dcfde[_0x0859('0xe')](0x1f4,_0x1e824a[_0x0859('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 4f40aed..b7d9cbd 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 _0x6def=['download','post','create','addMessage','/:id/tags','mail','mailinteraction:addtags','addTags','put','tracked','mailinteraction:update','update','delete','destroy','removeTags','exports','express','Router','../../components/interaction/service','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','/:id/download'];(function(_0x20bb79,_0x377d86){var _0x3c65a9=function(_0x36c3d2){while(--_0x36c3d2){_0x20bb79['push'](_0x20bb79['shift']());}};_0x3c65a9(++_0x377d86);}(_0x6def,0x1c3));var _0xf6de=function(_0x502d7f,_0x2dda6b){_0x502d7f=_0x502d7f-0x0;var _0x3bc0fd=_0x6def[_0x502d7f];return _0x3bc0fd;};'use strict';var express=require(_0xf6de('0x0'));var router=express[_0xf6de('0x1')]();var auth=require('../../components/auth/service');var interaction=require(_0xf6de('0x2'));var controller=require('./mailInteraction.controller');router[_0xf6de('0x3')]('/',auth['isAuthenticated'](),controller[_0xf6de('0x4')]);router[_0xf6de('0x3')](_0xf6de('0x5'),auth[_0xf6de('0x6')](),controller[_0xf6de('0x7')]);router[_0xf6de('0x3')](_0xf6de('0x8'),auth[_0xf6de('0x6')](),controller[_0xf6de('0x9')]);router[_0xf6de('0x3')](_0xf6de('0xa'),auth['isAuthenticated'](),controller[_0xf6de('0xb')]);router[_0xf6de('0x3')](_0xf6de('0xc'),auth[_0xf6de('0x6')](),controller[_0xf6de('0xd')]);router[_0xf6de('0xe')]('/',auth[_0xf6de('0x6')](),controller[_0xf6de('0xf')]);router[_0xf6de('0xe')](_0xf6de('0xa'),auth[_0xf6de('0x6')](),controller[_0xf6de('0x10')]);router[_0xf6de('0xe')](_0xf6de('0x11'),auth[_0xf6de('0x6')](),interaction['tracked'](_0xf6de('0x12'),_0xf6de('0x13')),controller[_0xf6de('0x14')]);router[_0xf6de('0x15')](_0xf6de('0x8'),auth[_0xf6de('0x6')](),interaction[_0xf6de('0x16')](_0xf6de('0x12'),_0xf6de('0x17')),controller[_0xf6de('0x18')]);router[_0xf6de('0x19')]('/:id',auth[_0xf6de('0x6')](),interaction[_0xf6de('0x16')](_0xf6de('0x12'),'mailinteraction:destroy'),controller[_0xf6de('0x1a')]);router[_0xf6de('0x19')](_0xf6de('0x11'),auth[_0xf6de('0x6')](),controller[_0xf6de('0x1b')]);module[_0xf6de('0x1c')]=router; \ No newline at end of file +var _0x782e=['create','post','/:id/messages','addMessage','/:id/tags','mail','mailinteraction:addtags','addTags','put','mailinteraction:update','delete','mailinteraction:destroy','removeTags','exports','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','index','/describe','isAuthenticated','describe','/:id','getMessages','download'];(function(_0x3ff4a3,_0xa5bfa6){var _0x38676f=function(_0x3ab2b1){while(--_0x3ab2b1){_0x3ff4a3['push'](_0x3ff4a3['shift']());}};_0x38676f(++_0xa5bfa6);}(_0x782e,0x1ae));var _0xe782=function(_0x382ec4,_0x5756a4){_0x382ec4=_0x382ec4-0x0;var _0x57644a=_0x782e[_0x382ec4];return _0x57644a;};'use strict';var express=require('express');var router=express[_0xe782('0x0')]();var auth=require(_0xe782('0x1'));var interaction=require(_0xe782('0x2'));var controller=require(_0xe782('0x3'));router[_0xe782('0x4')]('/',auth['isAuthenticated'](),controller[_0xe782('0x5')]);router[_0xe782('0x4')](_0xe782('0x6'),auth[_0xe782('0x7')](),controller[_0xe782('0x8')]);router[_0xe782('0x4')](_0xe782('0x9'),auth[_0xe782('0x7')](),controller['show']);router['get']('/:id/messages',auth[_0xe782('0x7')](),controller[_0xe782('0xa')]);router[_0xe782('0x4')]('/:id/download',auth[_0xe782('0x7')](),controller[_0xe782('0xb')]);router['post']('/',auth[_0xe782('0x7')](),controller[_0xe782('0xc')]);router[_0xe782('0xd')](_0xe782('0xe'),auth[_0xe782('0x7')](),controller[_0xe782('0xf')]);router[_0xe782('0xd')](_0xe782('0x10'),auth[_0xe782('0x7')](),interaction['tracked'](_0xe782('0x11'),_0xe782('0x12')),controller[_0xe782('0x13')]);router[_0xe782('0x14')](_0xe782('0x9'),auth['isAuthenticated'](),interaction['tracked'](_0xe782('0x11'),_0xe782('0x15')),controller['update']);router[_0xe782('0x16')](_0xe782('0x9'),auth[_0xe782('0x7')](),interaction['tracked'](_0xe782('0x11'),_0xe782('0x17')),controller['destroy']);router['delete'](_0xe782('0x10'),auth[_0xe782('0x7')](),controller[_0xe782('0x18')]);module[_0xe782('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 c17bebc..bd4ac18 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 _0x0cf7=['long','TEXT','out','ENUM','iconv','exports','BOOLEAN','DATE','STRING'];(function(_0x2b5c60,_0xddad37){var _0x40ef50=function(_0x103b03){while(--_0x103b03){_0x2b5c60['push'](_0x2b5c60['shift']());}};_0x40ef50(++_0xddad37);}(_0x0cf7,0xe5));var _0x70cf=function(_0x2da4d9,_0x33e541){_0x2da4d9=_0x2da4d9-0x0;var _0x450b65=_0x0cf7[_0x2da4d9];return _0x450b65;};'use strict';var Sequelize=require('sequelize');var iconv=require(_0x70cf('0x0'));module[_0x70cf('0x1')]={'closed':{'type':Sequelize[_0x70cf('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x70cf('0x3')]},'disposition':{'type':Sequelize[_0x70cf('0x4')]},'secondDisposition':{'type':Sequelize[_0x70cf('0x4')]},'thirdDisposition':{'type':Sequelize[_0x70cf('0x4')]},'note':{'type':Sequelize[_0x70cf('0x4')]},'inReplyTo':{'type':Sequelize[_0x70cf('0x4')](0x1fe)},'to':{'type':Sequelize[_0x70cf('0x4')]},'cc':{'type':Sequelize['TEXT'](_0x70cf('0x5'))},'subject':{'type':Sequelize[_0x70cf('0x6')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x70cf('0x3')]},'substatus':{'type':Sequelize[_0x70cf('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0x70cf('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x70cf('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x70cf('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x70cf('0x8')]('in',_0x70cf('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x84e5=['iconv','BOOLEAN','DATE','STRING','long','ENUM','out','sequelize'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x84e5,0x1b7));var _0x584e=function(_0x2962d5,_0x38deda){_0x2962d5=_0x2962d5-0x0;var _0x273406=_0x84e5[_0x2962d5];return _0x273406;};'use strict';var Sequelize=require(_0x584e('0x0'));var iconv=require(_0x584e('0x1'));module['exports']={'closed':{'type':Sequelize[_0x584e('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x584e('0x3')]},'disposition':{'type':Sequelize[_0x584e('0x4')]},'secondDisposition':{'type':Sequelize[_0x584e('0x4')]},'thirdDisposition':{'type':Sequelize[_0x584e('0x4')]},'note':{'type':Sequelize[_0x584e('0x4')]},'inReplyTo':{'type':Sequelize[_0x584e('0x4')](0x1fe)},'to':{'type':Sequelize[_0x584e('0x4')]},'cc':{'type':Sequelize['TEXT'](_0x584e('0x5'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0x584e('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x584e('0x3')]},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x584e('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x584e('0x6')]('in',_0x584e('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index cbbcdb8..b748572 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 _0xbbfe=['ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','push','build','writeFileSync','message%d.eml','rimraf','moment','bluebird','util','lodash','juice','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','sendStatus','status','end','json','offset','count','Content-Range','update','then','destroy','error','stack','name','send','index','map','MailInteraction','rawAttributes','type','key','getOptions','findAll','mail','query','show','params','keys','filters','model','intersection','fields','attributes','length','includeAll','include','merge','options','find','catch','create','body','describe','addMessage','omit','ids','getMessages','nolimit','limit','order','sort','where','MailInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','inlineCss','true','setTags','spread','Tag','color','emit','removeTags','download','unix','join','root','server','attachments','Attachment','Attachments','Messages','from','bcc','subject','createdAt','get','each','missing.recipient@your.company.com','decode'];(function(_0x84415b,_0x3d02e4){var _0x38377d=function(_0x22765f){while(--_0x22765f){_0x84415b['push'](_0x84415b['shift']());}};_0x38377d(++_0x3d02e4);}(_0xbbfe,0x76));var _0xebbf=function(_0x5a38b9,_0x110590){_0x5a38b9=_0x5a38b9-0x0;var _0x24cb45=_0xbbfe[_0x5a38b9];return _0x24cb45;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xebbf('0x0'));var zipdir=require('zip-dir');var moment=require(_0xebbf('0x1'));var BPromise=require(_0xebbf('0x2'));var util=require(_0xebbf('0x3'));var path=require('path');var fs=require('fs');var _=require(_0xebbf('0x4'));var juice=require(_0xebbf('0x5'));var Redis=require(_0xebbf('0x6'));var interaction=require(_0xebbf('0x7'));var qs=require(_0xebbf('0x8'));var logger=require(_0xebbf('0x9'))('api');var config=require(_0xebbf('0xa'));var db=require(_0xebbf('0xb'))['db'];var htmlEntities=require('html-entities');config[_0xebbf('0xc')]=_['defaults'](config[_0xebbf('0xc')],{'host':_0xebbf('0xd'),'port':0x18eb});var socket=require(_0xebbf('0xe'))(new Redis(config[_0xebbf('0xc')]));require(_0xebbf('0xf'))[_0xebbf('0x10')](socket);function respondWithStatusCode(_0x1fd383,_0x31c84b){_0x31c84b=_0x31c84b||0xcc;return function(_0x5a2f55){if(_0x5a2f55){return _0x1fd383[_0xebbf('0x11')](_0x31c84b);}return _0x1fd383[_0xebbf('0x12')](_0x31c84b)[_0xebbf('0x13')]();};}function respondWithResult(_0x4e4189,_0x537c56){_0x537c56=_0x537c56||0xc8;return function(_0x468fdf){if(_0x468fdf){return _0x4e4189[_0xebbf('0x12')](_0x537c56)[_0xebbf('0x14')](_0x468fdf);}};}function respondWithFilteredResult(_0x1390ce,_0x4014f6){return function(_0x4e543d){if(_0x4e543d){var _0x503f33=typeof _0x4014f6[_0xebbf('0x15')]==='undefined'&&typeof _0x4014f6['limit']==='undefined';var _0x378f89=_0x4e543d[_0xebbf('0x16')];var _0x2ff164=_0x503f33?0x0:_0x4014f6[_0xebbf('0x15')];var _0x49b388=_0x503f33?_0x4e543d['count']:_0x4014f6[_0xebbf('0x15')]+_0x4014f6['limit'];var _0xb3df05;if(_0x49b388>=_0x378f89){_0x49b388=_0x378f89;_0xb3df05=0xc8;}else{_0xb3df05=0xce;}_0x1390ce[_0xebbf('0x12')](_0xb3df05);return _0x1390ce['set'](_0xebbf('0x17'),_0x2ff164+'-'+_0x49b388+'/'+_0x378f89)[_0xebbf('0x14')](_0x4e543d);}return null;};}function saveUpdates(_0x1cf0fa){return function(_0x37604e){if(_0x37604e){return _0x37604e[_0xebbf('0x18')](_0x1cf0fa)[_0xebbf('0x19')](function(_0xe2a3ad){return _0xe2a3ad;});}return null;};}function removeEntity(_0x3625fd){return function(_0x39802c){if(_0x39802c){return _0x39802c[_0xebbf('0x1a')]()[_0xebbf('0x19')](function(){_0x3625fd['status'](0xcc)[_0xebbf('0x13')]();});}};}function handleEntityNotFound(_0x4224e8){return function(_0x13c065){if(!_0x13c065){_0x4224e8[_0xebbf('0x11')](0x194);}return _0x13c065;};}function handleError(_0x537577,_0xc947e4){_0xc947e4=_0xc947e4||0x1f4;return function(_0x13754b){logger[_0xebbf('0x1b')](_0x13754b[_0xebbf('0x1c')]);if(_0x13754b[_0xebbf('0x1d')]){delete _0x13754b[_0xebbf('0x1d')];}_0x537577[_0xebbf('0x12')](_0xc947e4)[_0xebbf('0x1e')](_0x13754b);};}exports[_0xebbf('0x1f')]=function(_0x3f5f2f,_0x118880){var _0x4eb4ee={};var _0x326752=_[_0xebbf('0x20')](db[_0xebbf('0x21')][_0xebbf('0x22')],function(_0x37de10){return{'name':_0x37de10['fieldName'],'type':_0x37de10[_0xebbf('0x23')][_0xebbf('0x24')]};});_0x4eb4ee=qs[_0xebbf('0x25')](_0x326752,_0x3f5f2f);return interaction[_0xebbf('0x26')](_0xebbf('0x27'),_0x3f5f2f[_0xebbf('0x28')],_0x3f5f2f['user'],_0x4eb4ee,_0x326752)[_0xebbf('0x19')](respondWithFilteredResult(_0x118880,_0x4eb4ee))['catch'](handleError(_0x118880,null));};exports[_0xebbf('0x29')]=function(_0x294245,_0x15eb39){var _0x5db882={'raw':![],'where':{'id':_0x294245[_0xebbf('0x2a')]['id']}},_0x10446b={};_0x10446b['model']=_['keys'](db[_0xebbf('0x21')]['rawAttributes']);_0x10446b[_0xebbf('0x28')]=_[_0xebbf('0x2b')](_0x294245[_0xebbf('0x28')]);_0x10446b[_0xebbf('0x2c')]=_['intersection'](_0x10446b[_0xebbf('0x2d')],_0x10446b[_0xebbf('0x28')]);_0x5db882['attributes']=_[_0xebbf('0x2e')](_0x10446b[_0xebbf('0x2d')],qs[_0xebbf('0x2f')](_0x294245['query']['fields']));_0x5db882['attributes']=_0x5db882[_0xebbf('0x30')][_0xebbf('0x31')]?_0x5db882[_0xebbf('0x30')]:_0x10446b[_0xebbf('0x2d')];if(_0x294245[_0xebbf('0x28')][_0xebbf('0x32')]){_0x5db882[_0xebbf('0x33')]=[{'all':!![]}];}_0x5db882=_[_0xebbf('0x34')]({},_0x5db882,_0x294245[_0xebbf('0x35')]);return db['MailInteraction'][_0xebbf('0x36')](_0x5db882)[_0xebbf('0x19')](handleEntityNotFound(_0x15eb39,null))['then'](respondWithResult(_0x15eb39,null))[_0xebbf('0x37')](handleError(_0x15eb39,null));};exports['create']=function(_0x378499,_0x3eb9ff){return db[_0xebbf('0x21')][_0xebbf('0x38')](_0x378499[_0xebbf('0x39')],{})[_0xebbf('0x19')](respondWithResult(_0x3eb9ff,0xc9))[_0xebbf('0x37')](handleError(_0x3eb9ff,null));};exports[_0xebbf('0x18')]=function(_0x1763d2,_0xe79982){if(_0x1763d2[_0xebbf('0x39')]['id']){delete _0x1763d2[_0xebbf('0x39')]['id'];}return db['MailInteraction'][_0xebbf('0x36')]({'where':{'id':_0x1763d2[_0xebbf('0x2a')]['id']}})[_0xebbf('0x19')](handleEntityNotFound(_0xe79982,null))['then'](saveUpdates(_0x1763d2[_0xebbf('0x39')],null))['then'](respondWithResult(_0xe79982,null))[_0xebbf('0x37')](handleError(_0xe79982,null));};exports[_0xebbf('0x1a')]=function(_0x2af23f,_0x498b32){return db[_0xebbf('0x21')][_0xebbf('0x36')]({'where':{'id':_0x2af23f[_0xebbf('0x2a')]['id']}})[_0xebbf('0x19')](handleEntityNotFound(_0x498b32,null))[_0xebbf('0x19')](removeEntity(_0x498b32,null))[_0xebbf('0x37')](handleError(_0x498b32,null));};exports['describe']=function(_0x52afa4,_0xa6e69f){return db[_0xebbf('0x21')][_0xebbf('0x3a')]()['then'](respondWithResult(_0xa6e69f,null))[_0xebbf('0x37')](handleError(_0xa6e69f,null));};exports[_0xebbf('0x3b')]=function(_0x2873b4,_0x580699){return db['MailMessage'][_0xebbf('0x36')]({'where':{'id':_0x2873b4[_0xebbf('0x2a')]['id']}})[_0xebbf('0x19')](handleEntityNotFound(_0x580699,null))['then'](function(_0x264c05){if(_0x264c05){return _0x264c05['addMessage'](_0x2873b4[_0xebbf('0x39')]['ids'],_[_0xebbf('0x3c')](_0x2873b4[_0xebbf('0x39')],[_0xebbf('0x3d'),'id'])||{});}})['then'](respondWithResult(_0x580699,null))[_0xebbf('0x37')](handleError(_0x580699,null));};exports[_0xebbf('0x3e')]=function(_0xf6d617,_0x380c89){var _0x39d2e9={'raw':![],'where':{}};var _0xec495={};var _0x4fffd9={'count':0x0,'rows':[]};return db[_0xebbf('0x21')]['findOne']({'where':{'id':_0xf6d617[_0xebbf('0x2a')]['id']}})[_0xebbf('0x19')](handleEntityNotFound(_0x380c89,null))['then'](function(_0x2e568d){if(_0x2e568d){_0xec495[_0xebbf('0x2d')]=_[_0xebbf('0x2b')](db['MailMessage'][_0xebbf('0x22')]);_0xec495[_0xebbf('0x28')]=_[_0xebbf('0x2b')](_0xf6d617['query']);_0xec495[_0xebbf('0x2c')]=_[_0xebbf('0x2e')](_0xec495['model'],_0xec495[_0xebbf('0x28')]);_0x39d2e9[_0xebbf('0x30')]=_[_0xebbf('0x2e')](_0xec495['model'],qs[_0xebbf('0x2f')](_0xf6d617[_0xebbf('0x28')][_0xebbf('0x2f')]));_0x39d2e9[_0xebbf('0x30')]=_0x39d2e9[_0xebbf('0x30')][_0xebbf('0x31')]?_0x39d2e9[_0xebbf('0x30')]:_0xec495[_0xebbf('0x2d')];if(!_0xf6d617[_0xebbf('0x28')]['hasOwnProperty'](_0xebbf('0x3f'))){_0x39d2e9[_0xebbf('0x40')]=qs[_0xebbf('0x40')](_0xf6d617['query'][_0xebbf('0x40')]);_0x39d2e9[_0xebbf('0x15')]=qs['offset'](_0xf6d617[_0xebbf('0x28')][_0xebbf('0x15')]);}_0x39d2e9[_0xebbf('0x41')]=qs[_0xebbf('0x42')](_0xf6d617[_0xebbf('0x28')][_0xebbf('0x42')]);_0x39d2e9[_0xebbf('0x43')]=qs[_0xebbf('0x2c')](_['pick'](_0xf6d617[_0xebbf('0x28')],_0xec495[_0xebbf('0x2c')]));_0x39d2e9[_0xebbf('0x43')][_0xebbf('0x44')]=_0x2e568d['id'];if(_0xf6d617['query']['filter']){_0x39d2e9[_0xebbf('0x43')]=_[_0xebbf('0x34')](_0x39d2e9[_0xebbf('0x43')],{'$or':_[_0xebbf('0x20')](_0x39d2e9[_0xebbf('0x30')],function(_0x13d896){var _0x1b0cd1={};_0x1b0cd1[_0x13d896]={'$like':'%'+_0xf6d617[_0xebbf('0x28')][_0xebbf('0x45')]+'%'};return _0x1b0cd1;})});}if(_0xf6d617[_0xebbf('0x28')][_0xebbf('0x46')]){var _0x3042d0=_0xf6d617[_0xebbf('0x28')][_0xebbf('0x46')][_0xebbf('0x47')](',');var _0x3e03b0={};_0x3e03b0[_0x3042d0[0x0]]={'$gte':moment(_0x3042d0[0x1])[_0xebbf('0x48')](_0xebbf('0x49'))};_0x39d2e9['where']=_[_0xebbf('0x34')](_0x39d2e9['where'],_0x3e03b0);}_0x39d2e9=_[_0xebbf('0x34')]({},_0x39d2e9,_0xf6d617['options']);return db[_0xebbf('0x4a')][_0xebbf('0x16')]({'where':_0x39d2e9[_0xebbf('0x43')]})[_0xebbf('0x19')](function(_0x4f771e){_0x4fffd9[_0xebbf('0x16')]=_0x4f771e;if(_0xf6d617[_0xebbf('0x28')][_0xebbf('0x32')]){_0x39d2e9['include']=[{'all':!![]}];}return db['MailMessage'][_0xebbf('0x26')](_0x39d2e9);})[_0xebbf('0x19')](function(_0x132673){if(_0xf6d617['query'][_0xebbf('0x4b')]===_0xebbf('0x4c')){for(var _0x2ac189=0x0;_0x2ac189<_0x132673[_0xebbf('0x31')];_0x2ac189++){_0x132673[_0x2ac189][_0xebbf('0x39')]=juice(_0x132673[_0x2ac189][_0xebbf('0x39')]);}}_0x4fffd9['rows']=_0x132673;return _0x4fffd9;});}})[_0xebbf('0x19')](respondWithFilteredResult(_0x380c89,_0x39d2e9))[_0xebbf('0x37')](handleError(_0x380c89,null));};exports['addTags']=function(_0x128360,_0x58d5eb){return db['MailInteraction'][_0xebbf('0x36')]({'where':{'id':_0x128360[_0xebbf('0x2a')]['id']}})['then'](handleEntityNotFound(_0x58d5eb,null))['then'](function(_0x2c2a8c){if(_0x2c2a8c){return _0x2c2a8c[_0xebbf('0x4d')](_0x128360['body'][_0xebbf('0x3d')],_['omit'](_0x128360[_0xebbf('0x39')],[_0xebbf('0x3d'),'id'])||{})[_0xebbf('0x4e')](function(){return db[_0xebbf('0x4f')]['findAll']({'attributes':['id',_0xebbf('0x1d'),_0xebbf('0x50')],'where':{'id':_0x128360[_0xebbf('0x39')][_0xebbf('0x3d')]}});})[_0xebbf('0x19')](function(_0x5d7ca0){socket[_0xebbf('0x51')]('mailInteractionTags:save',{'id':Number(_0x128360[_0xebbf('0x2a')]['id']),'tags':_0x5d7ca0||[]});return{'id':Number(_0x128360['params']['id']),'tags':_0x5d7ca0||[]};});}})['then'](respondWithResult(_0x58d5eb,null))[_0xebbf('0x37')](handleError(_0x58d5eb,null));};exports[_0xebbf('0x52')]=function(_0x536049,_0x30ea51){return db['MailInteraction'][_0xebbf('0x36')]({'where':{'id':_0x536049[_0xebbf('0x2a')]['id']}})['then'](handleEntityNotFound(_0x30ea51,null))['then'](function(_0x32916b){if(_0x32916b){return _0x32916b[_0xebbf('0x52')](_0x536049[_0xebbf('0x28')][_0xebbf('0x3d')]);}})[_0xebbf('0x19')](respondWithStatusCode(_0x30ea51,null))[_0xebbf('0x37')](handleError(_0x30ea51,null));};exports[_0xebbf('0x53')]=function(_0x2c7f76,_0x419c06){var _0x18e655=moment()[_0xebbf('0x54')]()['toString']();var _0x22634c=path[_0xebbf('0x55')](config[_0xebbf('0x56')],_0xebbf('0x57'),'files','tmp');var _0x22f9b5=path['join'](config[_0xebbf('0x56')],_0xebbf('0x57'),'files',_0xebbf('0x58'));var _0x899d01=path['join'](_0x22634c,_0x18e655);var _0x250ce4=util[_0xebbf('0x48')]('transcript-%d-%s.zip',_0x2c7f76[_0xebbf('0x2a')]['id'],_0x18e655);var _0x1448ba=path[_0xebbf('0x55')](_0x22634c,_0x250ce4);var _0x813227=[];if(_0x2c7f76['query'][_0xebbf('0x58')]){_0x813227['push']({'model':db[_0xebbf('0x59')],'as':_0xebbf('0x5a'),'raw':!![]});}var _0x3425fa=[{'model':db['MailMessage'],'as':_0xebbf('0x5b'),'attributes':['id',_0xebbf('0x39'),_0xebbf('0x5c'),'to','cc',_0xebbf('0x5d'),_0xebbf('0x5e'),_0xebbf('0x5f')],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x813227}];return db[_0xebbf('0x21')][_0xebbf('0x36')]({'where':{'id':_0x2c7f76[_0xebbf('0x2a')]['id']},'include':_0x3425fa})['then'](handleEntityNotFound(_0x419c06,null))[_0xebbf('0x19')](function(_0x232e3d){if(_0x232e3d&&_0x232e3d[_0xebbf('0x5b')]){var _0x56009d=_0x232e3d[_0xebbf('0x60')]({'plain':!![]});fs['mkdirSync'](_0x899d01);return BPromise[_0xebbf('0x61')](_0x56009d['Messages'],function(_0x500774,_0x263b5e){var _0x42dcff={'from':_0x500774[_0xebbf('0x5c')],'to':_0x500774['to']||_0xebbf('0x62'),'subject':_0x500774['subject'],'html':htmlEntities[_0xebbf('0x63')](_0x500774['body']),'headers':{'Date':moment(_0x500774[_0xebbf('0x5f')])[_0xebbf('0x48')](_0xebbf('0x64'))},'attachments':[]};if(_0x500774['cc']){_0x42dcff[_0xebbf('0x65')]['Cc']=_0x500774['cc'];}if(_0x500774[_0xebbf('0x5d')]){_0x42dcff[_0xebbf('0x65')][_0xebbf('0x66')]=_0x500774['bcc'];}return new BPromise(function(_0x448850,_0x515533){if(_0x500774[_0xebbf('0x5a')]){for(var _0x13c032=0x0;_0x13c032<_0x500774[_0xebbf('0x5a')][_0xebbf('0x31')];_0x13c032++){var _0x77ea74=_0x500774[_0xebbf('0x5a')][_0x13c032];var _0x6a0790=path[_0xebbf('0x55')](_0x22f9b5,_0x77ea74[_0xebbf('0x67')]);if(fs[_0xebbf('0x68')](_0x6a0790)){_0x42dcff[_0xebbf('0x58')][_0xebbf('0x69')]({'name':_0x77ea74[_0xebbf('0x1d')],'contentType':_0x77ea74['type'],'data':fs['readFileSync'](_0x6a0790)});}}}emlformat[_0xebbf('0x6a')](_0x42dcff,function(_0x1adc4e,_0x402ae4){if(_0x1adc4e)return _0x515533(_0x1adc4e);fs[_0xebbf('0x6b')](path[_0xebbf('0x55')](_0x899d01,util[_0xebbf('0x48')](_0xebbf('0x6c'),_0x263b5e)),_0x402ae4);return _0x448850(_0x402ae4);});});})[_0xebbf('0x19')](function(){return new BPromise(function(_0x2f286a,_0x1c7771){zipdir(_0x899d01,{'saveTo':_0x1448ba},function(_0x2f18b3,_0x4ee771){if(_0x2f18b3)return _0x1c7771(_0x2f18b3);return _0x2f286a(_0x4ee771);});})[_0xebbf('0x19')](function(){return new BPromise(function(_0x265bc6,_0x502101){rimraf(_0x899d01,function(_0x36b28a){if(_0x36b28a)_0x502101(_0x36b28a);return _0x265bc6();});});})[_0xebbf('0x19')](function(){return _0x419c06[_0xebbf('0x53')](_0x1448ba,_0x250ce4,function(_0x1714c8){if(!_0x1714c8)fs['unlinkSync'](_0x1448ba);});});});}else{return _0x419c06[_0xebbf('0x11')](0xc8);}})[_0xebbf('0x37')](handleError(_0x419c06,null));}; \ No newline at end of file +var _0x7d7a=['pick','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','MailMessage','inlineCss','true','rows','setTags','spread','Tag','mailInteractionTags:save','removeTags','download','unix','toString','join','server','files','tmp','format','attachments','Attachment','Attachments','Messages','from','bcc','createdAt','get','mkdirSync','missing.recipient@your.company.com','subject','decode','headers','Bcc','basename','existsSync','push','type','readFileSync','build','writeFileSync','unlinkSync','zip-dir','util','path','juice','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','html-entities','redis','defaults','localhost','register','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','then','destroy','end','stack','name','send','index','map','MailInteraction','rawAttributes','fieldName','key','getOptions','findAll','query','user','catch','show','params','model','keys','intersection','attributes','fields','length','includeAll','include','merge','options','find','create','body','describe','addMessage','omit','ids','findOne','hasOwnProperty','nolimit','order','sort','where','filters'];(function(_0x382821,_0x3f3a77){var _0x2a2892=function(_0x29d1be){while(--_0x29d1be){_0x382821['push'](_0x382821['shift']());}};_0x2a2892(++_0x3f3a77);}(_0x7d7a,0x10c));var _0xa7d7=function(_0x1fcb89,_0x49a249){_0x1fcb89=_0x1fcb89-0x0;var _0x3a9c41=_0x7d7a[_0x1fcb89];return _0x3a9c41;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa7d7('0x0'));var moment=require('moment');var BPromise=require('bluebird');var util=require(_0xa7d7('0x1'));var path=require(_0xa7d7('0x2'));var fs=require('fs');var _=require('lodash');var juice=require(_0xa7d7('0x3'));var Redis=require(_0xa7d7('0x4'));var interaction=require(_0xa7d7('0x5'));var qs=require(_0xa7d7('0x6'));var logger=require(_0xa7d7('0x7'))(_0xa7d7('0x8'));var config=require(_0xa7d7('0x9'));var db=require(_0xa7d7('0xa'))['db'];var htmlEntities=require(_0xa7d7('0xb'));config[_0xa7d7('0xc')]=_[_0xa7d7('0xd')](config[_0xa7d7('0xc')],{'host':_0xa7d7('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa7d7('0xc')]));require('./mailInteraction.socket')[_0xa7d7('0xf')](socket);function respondWithStatusCode(_0x38a3c8,_0xcbc0b4){_0xcbc0b4=_0xcbc0b4||0xcc;return function(_0x2b076e){if(_0x2b076e){return _0x38a3c8[_0xa7d7('0x10')](_0xcbc0b4);}return _0x38a3c8[_0xa7d7('0x11')](_0xcbc0b4)['end']();};}function respondWithResult(_0x20c693,_0x350561){_0x350561=_0x350561||0xc8;return function(_0x5d3e77){if(_0x5d3e77){return _0x20c693[_0xa7d7('0x11')](_0x350561)[_0xa7d7('0x12')](_0x5d3e77);}};}function respondWithFilteredResult(_0x44712a,_0x509e79){return function(_0x15be88){if(_0x15be88){var _0x544d63=typeof _0x509e79[_0xa7d7('0x13')]==='undefined'&&typeof _0x509e79[_0xa7d7('0x14')]===_0xa7d7('0x15');var _0x4a1bb9=_0x15be88['count'];var _0x324286=_0x544d63?0x0:_0x509e79[_0xa7d7('0x13')];var _0x27159a=_0x544d63?_0x15be88[_0xa7d7('0x16')]:_0x509e79['offset']+_0x509e79['limit'];var _0x1f13e1;if(_0x27159a>=_0x4a1bb9){_0x27159a=_0x4a1bb9;_0x1f13e1=0xc8;}else{_0x1f13e1=0xce;}_0x44712a[_0xa7d7('0x11')](_0x1f13e1);return _0x44712a[_0xa7d7('0x17')](_0xa7d7('0x18'),_0x324286+'-'+_0x27159a+'/'+_0x4a1bb9)['json'](_0x15be88);}return null;};}function saveUpdates(_0x312af1){return function(_0x61e0bf){if(_0x61e0bf){return _0x61e0bf['update'](_0x312af1)[_0xa7d7('0x19')](function(_0x31a8cb){return _0x31a8cb;});}return null;};}function removeEntity(_0x4b6e90){return function(_0x5bc310){if(_0x5bc310){return _0x5bc310[_0xa7d7('0x1a')]()[_0xa7d7('0x19')](function(){_0x4b6e90[_0xa7d7('0x11')](0xcc)[_0xa7d7('0x1b')]();});}};}function handleEntityNotFound(_0x1973ae){return function(_0x4b03fd){if(!_0x4b03fd){_0x1973ae['sendStatus'](0x194);}return _0x4b03fd;};}function handleError(_0x37c83a,_0x32630a){_0x32630a=_0x32630a||0x1f4;return function(_0x341d5b){logger['error'](_0x341d5b[_0xa7d7('0x1c')]);if(_0x341d5b[_0xa7d7('0x1d')]){delete _0x341d5b[_0xa7d7('0x1d')];}_0x37c83a['status'](_0x32630a)[_0xa7d7('0x1e')](_0x341d5b);};}exports[_0xa7d7('0x1f')]=function(_0x4e1dab,_0x2d19f4){var _0x3f6652={};var _0x43de7d=_[_0xa7d7('0x20')](db[_0xa7d7('0x21')][_0xa7d7('0x22')],function(_0x1f9fb2){return{'name':_0x1f9fb2[_0xa7d7('0x23')],'type':_0x1f9fb2['type'][_0xa7d7('0x24')]};});_0x3f6652=qs[_0xa7d7('0x25')](_0x43de7d,_0x4e1dab);return interaction[_0xa7d7('0x26')]('mail',_0x4e1dab[_0xa7d7('0x27')],_0x4e1dab[_0xa7d7('0x28')],_0x3f6652,_0x43de7d)[_0xa7d7('0x19')](respondWithFilteredResult(_0x2d19f4,_0x3f6652))[_0xa7d7('0x29')](handleError(_0x2d19f4,null));};exports[_0xa7d7('0x2a')]=function(_0x2e8337,_0x93b6d){var _0x2e6594={'raw':![],'where':{'id':_0x2e8337[_0xa7d7('0x2b')]['id']}},_0x38d260={};_0x38d260[_0xa7d7('0x2c')]=_[_0xa7d7('0x2d')](db[_0xa7d7('0x21')][_0xa7d7('0x22')]);_0x38d260[_0xa7d7('0x27')]=_[_0xa7d7('0x2d')](_0x2e8337['query']);_0x38d260['filters']=_[_0xa7d7('0x2e')](_0x38d260['model'],_0x38d260[_0xa7d7('0x27')]);_0x2e6594[_0xa7d7('0x2f')]=_['intersection'](_0x38d260[_0xa7d7('0x2c')],qs[_0xa7d7('0x30')](_0x2e8337[_0xa7d7('0x27')][_0xa7d7('0x30')]));_0x2e6594[_0xa7d7('0x2f')]=_0x2e6594[_0xa7d7('0x2f')][_0xa7d7('0x31')]?_0x2e6594['attributes']:_0x38d260['model'];if(_0x2e8337[_0xa7d7('0x27')][_0xa7d7('0x32')]){_0x2e6594[_0xa7d7('0x33')]=[{'all':!![]}];}_0x2e6594=_[_0xa7d7('0x34')]({},_0x2e6594,_0x2e8337[_0xa7d7('0x35')]);return db[_0xa7d7('0x21')][_0xa7d7('0x36')](_0x2e6594)['then'](handleEntityNotFound(_0x93b6d,null))[_0xa7d7('0x19')](respondWithResult(_0x93b6d,null))[_0xa7d7('0x29')](handleError(_0x93b6d,null));};exports[_0xa7d7('0x37')]=function(_0x3bd075,_0x339a72){return db[_0xa7d7('0x21')][_0xa7d7('0x37')](_0x3bd075[_0xa7d7('0x38')],{})[_0xa7d7('0x19')](respondWithResult(_0x339a72,0xc9))['catch'](handleError(_0x339a72,null));};exports['update']=function(_0x1911b1,_0x44aa50){if(_0x1911b1['body']['id']){delete _0x1911b1['body']['id'];}return db[_0xa7d7('0x21')][_0xa7d7('0x36')]({'where':{'id':_0x1911b1[_0xa7d7('0x2b')]['id']}})[_0xa7d7('0x19')](handleEntityNotFound(_0x44aa50,null))['then'](saveUpdates(_0x1911b1[_0xa7d7('0x38')],null))[_0xa7d7('0x19')](respondWithResult(_0x44aa50,null))[_0xa7d7('0x29')](handleError(_0x44aa50,null));};exports['destroy']=function(_0x433e1b,_0x10f688){return db['MailInteraction'][_0xa7d7('0x36')]({'where':{'id':_0x433e1b['params']['id']}})[_0xa7d7('0x19')](handleEntityNotFound(_0x10f688,null))[_0xa7d7('0x19')](removeEntity(_0x10f688,null))[_0xa7d7('0x29')](handleError(_0x10f688,null));};exports[_0xa7d7('0x39')]=function(_0x2ac7b9,_0x56a390){return db[_0xa7d7('0x21')]['describe']()[_0xa7d7('0x19')](respondWithResult(_0x56a390,null))[_0xa7d7('0x29')](handleError(_0x56a390,null));};exports[_0xa7d7('0x3a')]=function(_0x1c5bf7,_0x770436){return db['MailMessage']['find']({'where':{'id':_0x1c5bf7['params']['id']}})[_0xa7d7('0x19')](handleEntityNotFound(_0x770436,null))[_0xa7d7('0x19')](function(_0x29dee4){if(_0x29dee4){return _0x29dee4[_0xa7d7('0x3a')](_0x1c5bf7[_0xa7d7('0x38')]['ids'],_[_0xa7d7('0x3b')](_0x1c5bf7[_0xa7d7('0x38')],[_0xa7d7('0x3c'),'id'])||{});}})[_0xa7d7('0x19')](respondWithResult(_0x770436,null))['catch'](handleError(_0x770436,null));};exports['getMessages']=function(_0x1bda4f,_0xd6c935){var _0x4ab125={'raw':![],'where':{}};var _0x1bd4a6={};var _0x58ae37={'count':0x0,'rows':[]};return db[_0xa7d7('0x21')][_0xa7d7('0x3d')]({'where':{'id':_0x1bda4f[_0xa7d7('0x2b')]['id']}})['then'](handleEntityNotFound(_0xd6c935,null))[_0xa7d7('0x19')](function(_0x4c4ee0){if(_0x4c4ee0){_0x1bd4a6['model']=_[_0xa7d7('0x2d')](db['MailMessage'][_0xa7d7('0x22')]);_0x1bd4a6['query']=_[_0xa7d7('0x2d')](_0x1bda4f[_0xa7d7('0x27')]);_0x1bd4a6['filters']=_[_0xa7d7('0x2e')](_0x1bd4a6[_0xa7d7('0x2c')],_0x1bd4a6[_0xa7d7('0x27')]);_0x4ab125[_0xa7d7('0x2f')]=_['intersection'](_0x1bd4a6['model'],qs[_0xa7d7('0x30')](_0x1bda4f[_0xa7d7('0x27')][_0xa7d7('0x30')]));_0x4ab125['attributes']=_0x4ab125[_0xa7d7('0x2f')][_0xa7d7('0x31')]?_0x4ab125[_0xa7d7('0x2f')]:_0x1bd4a6[_0xa7d7('0x2c')];if(!_0x1bda4f['query'][_0xa7d7('0x3e')](_0xa7d7('0x3f'))){_0x4ab125[_0xa7d7('0x14')]=qs[_0xa7d7('0x14')](_0x1bda4f[_0xa7d7('0x27')][_0xa7d7('0x14')]);_0x4ab125['offset']=qs['offset'](_0x1bda4f[_0xa7d7('0x27')][_0xa7d7('0x13')]);}_0x4ab125[_0xa7d7('0x40')]=qs[_0xa7d7('0x41')](_0x1bda4f[_0xa7d7('0x27')][_0xa7d7('0x41')]);_0x4ab125[_0xa7d7('0x42')]=qs[_0xa7d7('0x43')](_[_0xa7d7('0x44')](_0x1bda4f[_0xa7d7('0x27')],_0x1bd4a6['filters']));_0x4ab125[_0xa7d7('0x42')]['MailInteractionId']=_0x4c4ee0['id'];if(_0x1bda4f[_0xa7d7('0x27')][_0xa7d7('0x45')]){_0x4ab125['where']=_[_0xa7d7('0x34')](_0x4ab125['where'],{'$or':_[_0xa7d7('0x20')](_0x4ab125[_0xa7d7('0x2f')],function(_0x11cb6d){var _0xbc7074={};_0xbc7074[_0x11cb6d]={'$like':'%'+_0x1bda4f[_0xa7d7('0x27')][_0xa7d7('0x45')]+'%'};return _0xbc7074;})});}if(_0x1bda4f[_0xa7d7('0x27')][_0xa7d7('0x46')]){var _0x54160e=_0x1bda4f['query'][_0xa7d7('0x46')][_0xa7d7('0x47')](',');var _0x2fbc23={};_0x2fbc23[_0x54160e[0x0]]={'$gte':moment(_0x54160e[0x1])['format'](_0xa7d7('0x48'))};_0x4ab125[_0xa7d7('0x42')]=_[_0xa7d7('0x34')](_0x4ab125[_0xa7d7('0x42')],_0x2fbc23);}_0x4ab125=_['merge']({},_0x4ab125,_0x1bda4f['options']);return db['MailMessage'][_0xa7d7('0x16')]({'where':_0x4ab125[_0xa7d7('0x42')]})[_0xa7d7('0x19')](function(_0x525bcf){_0x58ae37[_0xa7d7('0x16')]=_0x525bcf;if(_0x1bda4f[_0xa7d7('0x27')][_0xa7d7('0x32')]){_0x4ab125[_0xa7d7('0x33')]=[{'all':!![]}];}return db[_0xa7d7('0x49')][_0xa7d7('0x26')](_0x4ab125);})['then'](function(_0x409599){if(_0x1bda4f[_0xa7d7('0x27')][_0xa7d7('0x4a')]===_0xa7d7('0x4b')){for(var _0x557102=0x0;_0x557102<_0x409599[_0xa7d7('0x31')];_0x557102++){_0x409599[_0x557102][_0xa7d7('0x38')]=juice(_0x409599[_0x557102][_0xa7d7('0x38')]);}}_0x58ae37[_0xa7d7('0x4c')]=_0x409599;return _0x58ae37;});}})[_0xa7d7('0x19')](respondWithFilteredResult(_0xd6c935,_0x4ab125))[_0xa7d7('0x29')](handleError(_0xd6c935,null));};exports['addTags']=function(_0x53a683,_0x2bded8){return db['MailInteraction'][_0xa7d7('0x36')]({'where':{'id':_0x53a683[_0xa7d7('0x2b')]['id']}})[_0xa7d7('0x19')](handleEntityNotFound(_0x2bded8,null))[_0xa7d7('0x19')](function(_0x933796){if(_0x933796){return _0x933796[_0xa7d7('0x4d')](_0x53a683['body']['ids'],_[_0xa7d7('0x3b')](_0x53a683['body'],['ids','id'])||{})[_0xa7d7('0x4e')](function(){return db[_0xa7d7('0x4f')]['findAll']({'attributes':['id',_0xa7d7('0x1d'),'color'],'where':{'id':_0x53a683[_0xa7d7('0x38')]['ids']}});})[_0xa7d7('0x19')](function(_0x4ebb9a){socket['emit'](_0xa7d7('0x50'),{'id':Number(_0x53a683[_0xa7d7('0x2b')]['id']),'tags':_0x4ebb9a||[]});return{'id':Number(_0x53a683[_0xa7d7('0x2b')]['id']),'tags':_0x4ebb9a||[]};});}})[_0xa7d7('0x19')](respondWithResult(_0x2bded8,null))['catch'](handleError(_0x2bded8,null));};exports[_0xa7d7('0x51')]=function(_0x55bc9f,_0x22d6f2){return db[_0xa7d7('0x21')][_0xa7d7('0x36')]({'where':{'id':_0x55bc9f[_0xa7d7('0x2b')]['id']}})[_0xa7d7('0x19')](handleEntityNotFound(_0x22d6f2,null))[_0xa7d7('0x19')](function(_0x3bd9ba){if(_0x3bd9ba){return _0x3bd9ba['removeTags'](_0x55bc9f[_0xa7d7('0x27')][_0xa7d7('0x3c')]);}})[_0xa7d7('0x19')](respondWithStatusCode(_0x22d6f2,null))['catch'](handleError(_0x22d6f2,null));};exports[_0xa7d7('0x52')]=function(_0x772ff7,_0x2c87c7){var _0x236547=moment()[_0xa7d7('0x53')]()[_0xa7d7('0x54')]();var _0x5129c6=path[_0xa7d7('0x55')](config['root'],_0xa7d7('0x56'),_0xa7d7('0x57'),_0xa7d7('0x58'));var _0x3c2e19=path[_0xa7d7('0x55')](config['root'],_0xa7d7('0x56'),'files','attachments');var _0x5d141a=path[_0xa7d7('0x55')](_0x5129c6,_0x236547);var _0x284543=util[_0xa7d7('0x59')]('transcript-%d-%s.zip',_0x772ff7[_0xa7d7('0x2b')]['id'],_0x236547);var _0x38c418=path[_0xa7d7('0x55')](_0x5129c6,_0x284543);var _0x46f11d=[];if(_0x772ff7[_0xa7d7('0x27')][_0xa7d7('0x5a')]){_0x46f11d['push']({'model':db[_0xa7d7('0x5b')],'as':_0xa7d7('0x5c'),'raw':!![]});}var _0x1f7116=[{'model':db['MailMessage'],'as':_0xa7d7('0x5d'),'attributes':['id',_0xa7d7('0x38'),_0xa7d7('0x5e'),'to','cc',_0xa7d7('0x5f'),'subject',_0xa7d7('0x60')],'where':{'secret':![]},'order':qs[_0xa7d7('0x41')]('id'),'include':_0x46f11d}];return db[_0xa7d7('0x21')][_0xa7d7('0x36')]({'where':{'id':_0x772ff7[_0xa7d7('0x2b')]['id']},'include':_0x1f7116})['then'](handleEntityNotFound(_0x2c87c7,null))[_0xa7d7('0x19')](function(_0x456779){if(_0x456779&&_0x456779[_0xa7d7('0x5d')]){var _0x626df3=_0x456779[_0xa7d7('0x61')]({'plain':!![]});fs[_0xa7d7('0x62')](_0x5d141a);return BPromise['each'](_0x626df3[_0xa7d7('0x5d')],function(_0x1bbdf8,_0x34c983){var _0x122e4f={'from':_0x1bbdf8['from'],'to':_0x1bbdf8['to']||_0xa7d7('0x63'),'subject':_0x1bbdf8[_0xa7d7('0x64')],'html':htmlEntities[_0xa7d7('0x65')](_0x1bbdf8['body']),'headers':{'Date':moment(_0x1bbdf8['createdAt'])[_0xa7d7('0x59')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x1bbdf8['cc']){_0x122e4f[_0xa7d7('0x66')]['Cc']=_0x1bbdf8['cc'];}if(_0x1bbdf8[_0xa7d7('0x5f')]){_0x122e4f[_0xa7d7('0x66')][_0xa7d7('0x67')]=_0x1bbdf8['bcc'];}return new BPromise(function(_0x2ccc91,_0x5a054a){if(_0x1bbdf8[_0xa7d7('0x5c')]){for(var _0x476e9f=0x0;_0x476e9f<_0x1bbdf8['Attachments']['length'];_0x476e9f++){var _0x41bb43=_0x1bbdf8[_0xa7d7('0x5c')][_0x476e9f];var _0x44d09f=path[_0xa7d7('0x55')](_0x3c2e19,_0x41bb43[_0xa7d7('0x68')]);if(fs[_0xa7d7('0x69')](_0x44d09f)){_0x122e4f[_0xa7d7('0x5a')][_0xa7d7('0x6a')]({'name':_0x41bb43[_0xa7d7('0x1d')],'contentType':_0x41bb43[_0xa7d7('0x6b')],'data':fs[_0xa7d7('0x6c')](_0x44d09f)});}}}emlformat[_0xa7d7('0x6d')](_0x122e4f,function(_0xc27228,_0x2ddbe7){if(_0xc27228)return _0x5a054a(_0xc27228);fs[_0xa7d7('0x6e')](path[_0xa7d7('0x55')](_0x5d141a,util[_0xa7d7('0x59')]('message%d.eml',_0x34c983)),_0x2ddbe7);return _0x2ccc91(_0x2ddbe7);});});})[_0xa7d7('0x19')](function(){return new BPromise(function(_0x4ae438,_0x42c977){zipdir(_0x5d141a,{'saveTo':_0x38c418},function(_0xaa54e2,_0x36d75d){if(_0xaa54e2)return _0x42c977(_0xaa54e2);return _0x4ae438(_0x36d75d);});})['then'](function(){return new BPromise(function(_0xd16c7e,_0xf27b34){rimraf(_0x5d141a,function(_0x323965){if(_0x323965)_0xf27b34(_0x323965);return _0xd16c7e();});});})[_0xa7d7('0x19')](function(){return _0x2c87c7[_0xa7d7('0x52')](_0x38c418,_0x284543,function(_0x4e48c2){if(!_0x4e48c2)fs[_0xa7d7('0x6f')](_0x38c418);});});});}else{return _0x2c87c7['sendStatus'](0xc8);}})[_0xa7d7('0x29')](handleError(_0x2c87c7,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 4fd4c7c..ab35648 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 _0xdcdb=['emit','hasOwnProperty','hook','exports','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','save','getUsers','then','setDataValue','Users','map','unreadMessages'];(function(_0x4775b3,_0x4bf2a5){var _0x3bb837=function(_0x407954){while(--_0x407954){_0x4775b3['push'](_0x4775b3['shift']());}};_0x3bb837(++_0x4bf2a5);}(_0xdcdb,0x13f));var _0xbdcd=function(_0x4a2658,_0x56eb14){_0x4a2658=_0x4a2658-0x0;var _0x363e43=_0xdcdb[_0x4a2658];return _0x363e43;};'use strict';var EventEmitter=require('events');var MailInteraction=require(_0xbdcd('0x0'))['db'][_0xbdcd('0x1')];var MailMessage=require('../../mysqldb')['db'][_0xbdcd('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xbdcd('0x3')](0x0);var events={'afterCreate':_0xbdcd('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x7da54e){return function(_0x153cd6,_0x30f489,_0x5994b9){_0x153cd6[_0xbdcd('0x5')]({'attributes':['id'],'raw':!![]})[_0xbdcd('0x6')](function(_0x46e472){_0x153cd6[_0xbdcd('0x7')](_0xbdcd('0x8'),_0x46e472[_0xbdcd('0x9')](function(_0xf7d11a){return{'id':_0xf7d11a['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x153cd6['id'],'direction':'in','read':![]},'raw':!![]});})[_0xbdcd('0x6')](function(_0x3b54c3){_0x153cd6[_0xbdcd('0x7')](_0xbdcd('0xa'),_0x3b54c3['length']);MailInteractionEvents[_0xbdcd('0xb')](_0x7da54e+':'+_0x153cd6['id'],_0x153cd6);MailInteractionEvents[_0xbdcd('0xb')](_0x7da54e,_0x153cd6);_0x5994b9(null);})['catch'](_0x5994b9(null));};}for(var e in events){if(events[_0xbdcd('0xc')](e)){var event=events[e];MailInteraction[_0xbdcd('0xd')](e,emitEvent(event));}}module[_0xbdcd('0xe')]=MailInteractionEvents; \ No newline at end of file +var _0x5a81=['save','update','remove','getUsers','then','setDataValue','Users','findAll','unreadMessages','emit','catch','hook','exports','events','../../mysqldb','MailInteraction','MailMessage','setMaxListeners'];(function(_0x8dddb9,_0x507de6){var _0x4ef746=function(_0x250ea8){while(--_0x250ea8){_0x8dddb9['push'](_0x8dddb9['shift']());}};_0x4ef746(++_0x507de6);}(_0x5a81,0x151));var _0x15a8=function(_0x150ab9,_0xd14cce){_0x150ab9=_0x150ab9-0x0;var _0xc15f4b=_0x5a81[_0x150ab9];return _0xc15f4b;};'use strict';var EventEmitter=require(_0x15a8('0x0'));var MailInteraction=require(_0x15a8('0x1'))['db'][_0x15a8('0x2')];var MailMessage=require('../../mysqldb')['db'][_0x15a8('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x15a8('0x4')](0x0);var events={'afterCreate':_0x15a8('0x5'),'afterUpdate':_0x15a8('0x6'),'afterDestroy':_0x15a8('0x7')};function emitEvent(_0xc6ee0e){return function(_0x461be4,_0x42503d,_0x1be623){_0x461be4[_0x15a8('0x8')]({'attributes':['id'],'raw':!![]})[_0x15a8('0x9')](function(_0xb76f51){_0x461be4[_0x15a8('0xa')](_0x15a8('0xb'),_0xb76f51['map'](function(_0x3cfb78){return{'id':_0x3cfb78['id']};}));return MailMessage[_0x15a8('0xc')]({'where':{'MailInteractionId':_0x461be4['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x1fe77b){_0x461be4[_0x15a8('0xa')](_0x15a8('0xd'),_0x1fe77b['length']);MailInteractionEvents['emit'](_0xc6ee0e+':'+_0x461be4['id'],_0x461be4);MailInteractionEvents[_0x15a8('0xe')](_0xc6ee0e,_0x461be4);_0x1be623(null);})[_0x15a8('0xf')](_0x1be623(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0x15a8('0x10')](e,emitEvent(event));}}module[_0x15a8('0x11')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index a6ad012..a55f025 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 _0x6939=['FULLTEXT','substatus','substatusAt','YYYY-MM-DD\x20HH:mm:ss','closed','format','changed','models','MailMessage','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions','fti_mail_interactions','subject'];(function(_0x59565f,_0x46f503){var _0x496c66=function(_0x32a8fe){while(--_0x32a8fe){_0x59565f['push'](_0x59565f['shift']());}};_0x496c66(++_0x46f503);}(_0x6939,0xaf));var _0x9693=function(_0xd7f3aa,_0x865aa1){_0xd7f3aa=_0xd7f3aa-0x0;var _0x307495=_0x6939[_0xd7f3aa];return _0x307495;};'use strict';var _=require(_0x9693('0x0'));var util=require('util');var logger=require(_0x9693('0x1'))(_0x9693('0x2'));var moment=require('moment');var BPromise=require(_0x9693('0x3'));var rp=require(_0x9693('0x4'));var fs=require('fs');var path=require(_0x9693('0x5'));var rimraf=require(_0x9693('0x6'));var config=require('../../config/environment');var attributes=require(_0x9693('0x7'));module[_0x9693('0x8')]=function(_0x400ba5,_0x5b079c){return _0x400ba5[_0x9693('0x9')](_0x9693('0xa'),attributes,{'tableName':_0x9693('0xb'),'paranoid':![],'indexes':[{'name':_0x9693('0xc'),'fields':[_0x9693('0xd'),'to'],'type':_0x9693('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4101a8,_0x349bc1,_0x2e9d3c){if(_0x4101a8[_0x9693('0xf')]){_0x4101a8[_0x9693('0x10')]=moment()['format'](_0x9693('0x11'));}if(_0x4101a8[_0x9693('0x12')]){_0x4101a8['closedAt']=moment()[_0x9693('0x13')](_0x9693('0x11'));}_0x2e9d3c(null,_0x349bc1);},'beforeUpdate':function(_0x24e278,_0x36d635,_0x4bab8e){if(_0x24e278['changed']('substatus')){_0x24e278[_0x9693('0x10')]=_0x24e278[_0x9693('0xf')]?moment()[_0x9693('0x13')](_0x9693('0x11')):null;}if(_0x24e278[_0x9693('0x14')](_0x9693('0x12'))){_0x24e278['closedAt']=moment()[_0x9693('0x13')](_0x9693('0x11'));_0x24e278[_0x9693('0xf')]=null;_0x24e278[_0x9693('0x10')]=null;}_0x4bab8e(null,_0x24e278);},'afterUpdate':function(_0x297d2d,_0x3f5512,_0x540eba){var _0x268188=_0x400ba5[_0x9693('0x15')];var _0x155f7e=_0x297d2d['get']({'plain':!![]});if(_0x155f7e[_0x9693('0x12')]){return _0x268188[_0x9693('0x16')]['update']({'read':!![]},{'where':{'MailInteractionId':_0x155f7e['id']}})[_0x9693('0x17')](function(){_0x540eba();})[_0x9693('0x18')](function(_0x37e31f){_0x540eba(_0x37e31f);});}else{_0x540eba();}}},'charset':_0x9693('0x19'),'collate':_0x9693('0x1a')});}; \ No newline at end of file +var _0x2c51=['mail_interactions','subject','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closedAt','changed','substatus','closed','models','get','MailMessage','update','then','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./mailInteraction.attributes','exports'];(function(_0x5ecde7,_0x411905){var _0x4c037e=function(_0x2f0cfc){while(--_0x2f0cfc){_0x5ecde7['push'](_0x5ecde7['shift']());}};_0x4c037e(++_0x411905);}(_0x2c51,0xac));var _0x12c5=function(_0x59efd4,_0x57a386){_0x59efd4=_0x59efd4-0x0;var _0x1388af=_0x2c51[_0x59efd4];return _0x1388af;};'use strict';var _=require(_0x12c5('0x0'));var util=require(_0x12c5('0x1'));var logger=require(_0x12c5('0x2'))(_0x12c5('0x3'));var moment=require(_0x12c5('0x4'));var BPromise=require(_0x12c5('0x5'));var rp=require(_0x12c5('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x12c5('0x7'));var config=require('../../config/environment');var attributes=require(_0x12c5('0x8'));module[_0x12c5('0x9')]=function(_0x7b529a,_0x1d08dd){return _0x7b529a['define']('MailInteraction',attributes,{'tableName':_0x12c5('0xa'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0x12c5('0xb'),'to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x503ac4,_0x200183,_0x3e3f42){if(_0x503ac4['substatus']){_0x503ac4[_0x12c5('0xc')]=moment()[_0x12c5('0xd')](_0x12c5('0xe'));}if(_0x503ac4['closed']){_0x503ac4[_0x12c5('0xf')]=moment()[_0x12c5('0xd')](_0x12c5('0xe'));}_0x3e3f42(null,_0x200183);},'beforeUpdate':function(_0xe9cf95,_0x1b8ea9,_0x28d107){if(_0xe9cf95[_0x12c5('0x10')]('substatus')){_0xe9cf95[_0x12c5('0xc')]=_0xe9cf95[_0x12c5('0x11')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0xe9cf95[_0x12c5('0x10')](_0x12c5('0x12'))){_0xe9cf95[_0x12c5('0xf')]=moment()[_0x12c5('0xd')](_0x12c5('0xe'));_0xe9cf95['substatus']=null;_0xe9cf95[_0x12c5('0xc')]=null;}_0x28d107(null,_0xe9cf95);},'afterUpdate':function(_0x4c8988,_0xe82868,_0x44d33d){var _0x5c995a=_0x7b529a[_0x12c5('0x13')];var _0x29290c=_0x4c8988[_0x12c5('0x14')]({'plain':!![]});if(_0x29290c[_0x12c5('0x12')]){return _0x5c995a[_0x12c5('0x15')][_0x12c5('0x16')]({'read':!![]},{'where':{'MailInteractionId':_0x29290c['id']}})[_0x12c5('0x17')](function(){_0x44d33d();})['catch'](function(_0x2b0fdf){_0x44d33d(_0x2b0fdf);});}else{_0x44d33d();}}},'charset':_0x12c5('0x18'),'collate':_0x12c5('0x19')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index e2d37dd..72b913d 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 _0xfbff=['then','info','MailInteraction,\x20%s,\x20%s','debug','MailInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateMailInteraction','MailInteraction','options','raw','where','attributes','limit','AddTagsToMailInteraction','find','addTags','body','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./mailInteraction.socket','register','request'];(function(_0x1c6ab6,_0x51ce86){var _0x2c2f41=function(_0x31b431){while(--_0x31b431){_0x1c6ab6['push'](_0x1c6ab6['shift']());}};_0x2c2f41(++_0x51ce86);}(_0xfbff,0x156));var _0xffbf=function(_0x1895b7,_0x21fbc7){_0x1895b7=_0x1895b7-0x0;var _0x1aecdc=_0xfbff[_0x1895b7];return _0x1aecdc;};'use strict';var _=require(_0xffbf('0x0'));var util=require(_0xffbf('0x1'));var moment=require(_0xffbf('0x2'));var BPromise=require(_0xffbf('0x3'));var rs=require(_0xffbf('0x4'));var fs=require('fs');var Redis=require(_0xffbf('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xffbf('0x6'))(_0xffbf('0x7'));var config=require(_0xffbf('0x8'));var jayson=require(_0xffbf('0x9'));var client=jayson[_0xffbf('0xa')][_0xffbf('0xb')]({'port':0x232a});config[_0xffbf('0xc')]=_[_0xffbf('0xd')](config[_0xffbf('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xffbf('0xe'))(new Redis(config['redis']));require(_0xffbf('0xf'))[_0xffbf('0x10')](socket);function respondWithRpcPromise(_0x279fd1,_0x12d402,_0x287e5f){return new BPromise(function(_0x49d1b5,_0x1a0170){return client[_0xffbf('0x11')](_0x279fd1,_0x287e5f)[_0xffbf('0x12')](function(_0x1fa14c){logger[_0xffbf('0x13')](_0xffbf('0x14'),_0x12d402,'request\x20sent');logger[_0xffbf('0x15')](_0xffbf('0x16'),_0x12d402,_0xffbf('0x17'),JSON[_0xffbf('0x18')](_0x1fa14c));if(_0x1fa14c['error']){if(_0x1fa14c[_0xffbf('0x19')][_0xffbf('0x1a')]===0x1f4){logger['error'](_0xffbf('0x14'),_0x12d402,_0x1fa14c[_0xffbf('0x19')][_0xffbf('0x1b')]);return _0x1a0170(_0x1fa14c[_0xffbf('0x19')][_0xffbf('0x1b')]);}logger[_0xffbf('0x19')](_0xffbf('0x14'),_0x12d402,_0x1fa14c[_0xffbf('0x19')][_0xffbf('0x1b')]);return _0x49d1b5(_0x1fa14c[_0xffbf('0x19')][_0xffbf('0x1b')]);}else{logger[_0xffbf('0x13')](_0xffbf('0x14'),_0x12d402,_0xffbf('0x17'));_0x49d1b5(_0x1fa14c[_0xffbf('0x1c')][_0xffbf('0x1b')]);}})[_0xffbf('0x1d')](function(_0x362097){logger[_0xffbf('0x19')](_0xffbf('0x14'),_0x12d402,_0x362097);_0x1a0170(_0x362097);});});}exports[_0xffbf('0x1e')]=function(_0x1052d2){var _0x2f034d=this;return new Promise(function(_0x9987d1,_0x1124c4){return db[_0xffbf('0x1f')]['update'](_0x1052d2['body'],{'raw':_0x1052d2[_0xffbf('0x20')]?_0x1052d2[_0xffbf('0x20')][_0xffbf('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1052d2[_0xffbf('0x20')]?_0x1052d2['options'][_0xffbf('0x22')]||null:null,'attributes':_0x1052d2[_0xffbf('0x20')]?_0x1052d2[_0xffbf('0x20')][_0xffbf('0x23')]||null:null,'limit':_0x1052d2[_0xffbf('0x20')]?_0x1052d2[_0xffbf('0x20')][_0xffbf('0x24')]||null:null})['then'](function(_0x4f0082){logger[_0xffbf('0x13')](_0xffbf('0x1e'),_0x1052d2);logger['debug'](_0xffbf('0x1e'),_0x1052d2,JSON[_0xffbf('0x18')](_0x4f0082));_0x9987d1(_0x4f0082);})[_0xffbf('0x1d')](function(_0x1bab6b){logger[_0xffbf('0x19')](_0xffbf('0x1e'),_0x1bab6b[_0xffbf('0x1b')],_0x1052d2);_0x1124c4(_0x2f034d[_0xffbf('0x19')](0x1f4,_0x1bab6b[_0xffbf('0x1b')]));});});};exports[_0xffbf('0x25')]=function(_0x546cfd){return new Promise(function(_0x432745,_0x581dd6){return db['MailInteraction'][_0xffbf('0x26')]({'where':_0x546cfd[_0xffbf('0x20')]?_0x546cfd[_0xffbf('0x20')]['where']||null:null})['then'](function(_0x2d8aa4){if(_0x2d8aa4){return _0x2d8aa4[_0xffbf('0x27')](_0x546cfd[_0xffbf('0x28')][_0xffbf('0x29')],_[_0xffbf('0x2a')](_0x546cfd['body'],[_0xffbf('0x29'),'id'])||{});}})[_0xffbf('0x2b')](function(_0x1b9d42){logger['info'](_0xffbf('0x2c'),_0x546cfd);logger[_0xffbf('0x15')](_0xffbf('0x2c'),_0x546cfd,JSON['stringify'](_0x1b9d42));_0x432745(_0x1b9d42);})['catch'](function(_0x857be9){logger[_0xffbf('0x19')](_0xffbf('0x2c'),_0x857be9[_0xffbf('0x1b')],_0x546cfd);_0x581dd6(_this['error'](0x1f4,_0x857be9[_0xffbf('0x1b')]));});});}; \ No newline at end of file +var _0x88c3=['options','attributes','limit','UpdateMailInteraction','catch','find','where','addTags','ids','omit','spread','AddTags','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','redis','defaults','socket.io-emitter','register','request','then','info','MailInteraction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','MailInteraction','body'];(function(_0x279f6d,_0x122316){var _0x5874a5=function(_0x4823ae){while(--_0x4823ae){_0x279f6d['push'](_0x279f6d['shift']());}};_0x5874a5(++_0x122316);}(_0x88c3,0x7b));var _0x388c=function(_0x22003c,_0x18ea9d){_0x22003c=_0x22003c-0x0;var _0x26fcc1=_0x88c3[_0x22003c];return _0x26fcc1;};'use strict';var _=require('lodash');var util=require(_0x388c('0x0'));var moment=require(_0x388c('0x1'));var BPromise=require('bluebird');var rs=require(_0x388c('0x2'));var fs=require('fs');var Redis=require(_0x388c('0x3'));var db=require(_0x388c('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x388c('0x5'));var config=require(_0x388c('0x6'));var jayson=require(_0x388c('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0x388c('0x8')]=_[_0x388c('0x9')](config[_0x388c('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x388c('0xa'))(new Redis(config[_0x388c('0x8')]));require('./mailInteraction.socket')[_0x388c('0xb')](socket);function respondWithRpcPromise(_0xf73431,_0x27ab5d,_0x11f997){return new BPromise(function(_0xb77e22,_0x2559f7){return client[_0x388c('0xc')](_0xf73431,_0x11f997)[_0x388c('0xd')](function(_0x10dd17){logger[_0x388c('0xe')](_0x388c('0xf'),_0x27ab5d,'request\x20sent');logger[_0x388c('0x10')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0x27ab5d,_0x388c('0x11'),JSON[_0x388c('0x12')](_0x10dd17));if(_0x10dd17[_0x388c('0x13')]){if(_0x10dd17[_0x388c('0x13')][_0x388c('0x14')]===0x1f4){logger[_0x388c('0x13')](_0x388c('0xf'),_0x27ab5d,_0x10dd17[_0x388c('0x13')][_0x388c('0x15')]);return _0x2559f7(_0x10dd17[_0x388c('0x13')][_0x388c('0x15')]);}logger[_0x388c('0x13')]('MailInteraction,\x20%s,\x20%s',_0x27ab5d,_0x10dd17[_0x388c('0x13')][_0x388c('0x15')]);return _0xb77e22(_0x10dd17['error'][_0x388c('0x15')]);}else{logger['info']('MailInteraction,\x20%s,\x20%s',_0x27ab5d,_0x388c('0x11'));_0xb77e22(_0x10dd17[_0x388c('0x16')]['message']);}})['catch'](function(_0x30520b){logger['error'](_0x388c('0xf'),_0x27ab5d,_0x30520b);_0x2559f7(_0x30520b);});});}exports['UpdateMailInteraction']=function(_0x1e8ad4){var _0x5dac86=this;return new Promise(function(_0x192980,_0x11b003){return db[_0x388c('0x17')]['update'](_0x1e8ad4[_0x388c('0x18')],{'raw':_0x1e8ad4[_0x388c('0x19')]?_0x1e8ad4[_0x388c('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1e8ad4[_0x388c('0x19')]?_0x1e8ad4[_0x388c('0x19')]['where']||null:null,'attributes':_0x1e8ad4[_0x388c('0x19')]?_0x1e8ad4[_0x388c('0x19')][_0x388c('0x1a')]||null:null,'limit':_0x1e8ad4['options']?_0x1e8ad4[_0x388c('0x19')][_0x388c('0x1b')]||null:null})[_0x388c('0xd')](function(_0x4e7dba){logger[_0x388c('0xe')](_0x388c('0x1c'),_0x1e8ad4);logger[_0x388c('0x10')](_0x388c('0x1c'),_0x1e8ad4,JSON[_0x388c('0x12')](_0x4e7dba));_0x192980(_0x4e7dba);})[_0x388c('0x1d')](function(_0x484140){logger['error'](_0x388c('0x1c'),_0x484140[_0x388c('0x15')],_0x1e8ad4);_0x11b003(_0x5dac86[_0x388c('0x13')](0x1f4,_0x484140[_0x388c('0x15')]));});});};exports['AddTagsToMailInteraction']=function(_0x57cf21){return new Promise(function(_0x108d12,_0x270a45){return db[_0x388c('0x17')][_0x388c('0x1e')]({'where':_0x57cf21[_0x388c('0x19')]?_0x57cf21['options'][_0x388c('0x1f')]||null:null})[_0x388c('0xd')](function(_0xe4aed2){if(_0xe4aed2){return _0xe4aed2[_0x388c('0x20')](_0x57cf21[_0x388c('0x18')][_0x388c('0x21')],_[_0x388c('0x22')](_0x57cf21[_0x388c('0x18')],['ids','id'])||{});}})[_0x388c('0x23')](function(_0x42aa21){logger[_0x388c('0xe')](_0x388c('0x24'),_0x57cf21);logger[_0x388c('0x10')](_0x388c('0x24'),_0x57cf21,JSON[_0x388c('0x12')](_0x42aa21));_0x108d12(_0x42aa21);})[_0x388c('0x1d')](function(_0x4e4fe3){logger[_0x388c('0x13')](_0x388c('0x24'),_0x4e4fe3[_0x388c('0x15')],_0x57cf21);_0x270a45(_this['error'](0x1f4,_0x4e4fe3[_0x388c('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 73fec64..aa9873a 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 _0x6958=['update','emit','removeListener','register','length','mailInteraction:','remove'];(function(_0x5af917,_0x15c1e6){var _0x14ff6d=function(_0x3cd7ab){while(--_0x3cd7ab){_0x5af917['push'](_0x5af917['shift']());}};_0x14ff6d(++_0x15c1e6);}(_0x6958,0x1e2));var _0x8695=function(_0x29a258,_0x5723fa){_0x29a258=_0x29a258-0x0;var _0x57ae1a=_0x6958[_0x29a258];return _0x57ae1a;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=['save',_0x8695('0x0'),_0x8695('0x1')];function createListener(_0x31c134,_0x179142){return function(_0x3edd4b){_0x179142[_0x8695('0x2')](_0x31c134,_0x3edd4b);};}function removeListener(_0x48fa22,_0x5ec8b4){return function(){MailInteractionEvents[_0x8695('0x3')](_0x48fa22,_0x5ec8b4);};}exports[_0x8695('0x4')]=function(_0x58fbf9){for(var _0xdcd285=0x0,_0x3afef6=events[_0x8695('0x5')];_0xdcd285<_0x3afef6;_0xdcd285++){var _0x40d45e=events[_0xdcd285];var _0x303e89=createListener(_0x8695('0x6')+_0x40d45e,_0x58fbf9);MailInteractionEvents['on'](_0x40d45e,_0x303e89);}}; \ No newline at end of file +var _0xa5a5=['mailInteraction:','./mailInteraction.events','save','update','removeListener'];(function(_0x27cc36,_0x5e80db){var _0x3a8fbb=function(_0x1994ec){while(--_0x1994ec){_0x27cc36['push'](_0x27cc36['shift']());}};_0x3a8fbb(++_0x5e80db);}(_0xa5a5,0x178));var _0x5a5a=function(_0x31b5a5,_0x44376a){_0x31b5a5=_0x31b5a5-0x0;var _0x364cc9=_0xa5a5[_0x31b5a5];return _0x364cc9;};'use strict';var MailInteractionEvents=require(_0x5a5a('0x0'));var events=[_0x5a5a('0x1'),'remove',_0x5a5a('0x2')];function createListener(_0x4be0ea,_0x4662bb){return function(_0xe15641){_0x4662bb['emit'](_0x4be0ea,_0xe15641);};}function removeListener(_0x2e6518,_0x1f8a07){return function(){MailInteractionEvents[_0x5a5a('0x3')](_0x2e6518,_0x1f8a07);};}exports['register']=function(_0x48d5fb){for(var _0x24dc05=0x0,_0x5df3e3=events['length'];_0x24dc05<_0x5df3e3;_0x24dc05++){var _0x54324a=events[_0x24dc05];var _0x14a282=createListener(_0x5a5a('0x4')+_0x54324a,_0x48d5fb);MailInteractionEvents['on'](_0x54324a,_0x14a282);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 407e393..d6bf7e9 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 _0x969d=['accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./mailMessage.controller','get','isAuthenticated','index','/describe','/:id','/:id/download','download','tracked','mail','create','put','update','/:id/accept'];(function(_0x2cf2e9,_0xd58ea1){var _0xd3670d=function(_0x272868){while(--_0x272868){_0x2cf2e9['push'](_0x2cf2e9['shift']());}};_0xd3670d(++_0xd58ea1);}(_0x969d,0x76));var _0xd969=function(_0x5442eb,_0x588f2e){_0x5442eb=_0x5442eb-0x0;var _0x3c876=_0x969d[_0x5442eb];return _0x3c876;};'use strict';var multer=require(_0xd969('0x0'));var util=require(_0xd969('0x1'));var path=require(_0xd969('0x2'));var timeout=require(_0xd969('0x3'));var express=require(_0xd969('0x4'));var router=express[_0xd969('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xd969('0x6'));var interaction=require(_0xd969('0x7'));var config=require('../../config/environment');var controller=require(_0xd969('0x8'));router[_0xd969('0x9')]('/',auth[_0xd969('0xa')](),controller[_0xd969('0xb')]);router[_0xd969('0x9')](_0xd969('0xc'),auth[_0xd969('0xa')](),controller['describe']);router['get'](_0xd969('0xd'),auth[_0xd969('0xa')](),controller['show']);router[_0xd969('0x9')](_0xd969('0xe'),auth[_0xd969('0xa')](),controller[_0xd969('0xf')]);router['post']('/',auth['isAuthenticated'](),interaction[_0xd969('0x10')](_0xd969('0x11'),'mailmessage:create'),controller[_0xd969('0x12')]);router[_0xd969('0x13')](_0xd969('0xd'),auth['isAuthenticated'](),controller[_0xd969('0x14')]);router[_0xd969('0x13')](_0xd969('0x15'),auth[_0xd969('0xa')](),controller[_0xd969('0x16')]);router[_0xd969('0x13')](_0xd969('0x17'),auth[_0xd969('0xa')](),controller[_0xd969('0x18')]);router[_0xd969('0x19')](_0xd969('0xd'),auth[_0xd969('0xa')](),controller[_0xd969('0x1a')]);module[_0xd969('0x1b')]=router; \ No newline at end of file +var _0x75c5=['util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','/:id/download','download','post','tracked','mailmessage:create','create','update','put','/:id/accept','accept','reject','delete','destroy','exports','multer'];(function(_0x4c1985,_0x5d6bb9){var _0x15f2fd=function(_0x49031b){while(--_0x49031b){_0x4c1985['push'](_0x4c1985['shift']());}};_0x15f2fd(++_0x5d6bb9);}(_0x75c5,0xfb));var _0x575c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x75c5[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x575c('0x0'));var util=require(_0x575c('0x1'));var path=require(_0x575c('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x575c('0x3')]();var fs_extra=require(_0x575c('0x4'));var auth=require(_0x575c('0x5'));var interaction=require(_0x575c('0x6'));var config=require(_0x575c('0x7'));var controller=require('./mailMessage.controller');router[_0x575c('0x8')]('/',auth[_0x575c('0x9')](),controller[_0x575c('0xa')]);router[_0x575c('0x8')](_0x575c('0xb'),auth[_0x575c('0x9')](),controller[_0x575c('0xc')]);router[_0x575c('0x8')](_0x575c('0xd'),auth[_0x575c('0x9')](),controller['show']);router[_0x575c('0x8')](_0x575c('0xe'),auth['isAuthenticated'](),controller[_0x575c('0xf')]);router[_0x575c('0x10')]('/',auth['isAuthenticated'](),interaction[_0x575c('0x11')]('mail',_0x575c('0x12')),controller[_0x575c('0x13')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x575c('0x14')]);router[_0x575c('0x15')](_0x575c('0x16'),auth[_0x575c('0x9')](),controller[_0x575c('0x17')]);router[_0x575c('0x15')]('/:id/reject',auth[_0x575c('0x9')](),controller[_0x575c('0x18')]);router[_0x575c('0x19')](_0x575c('0xd'),auth[_0x575c('0x9')](),controller[_0x575c('0x1a')]);module[_0x575c('0x1b')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 59e1d57..a11e150 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 _0x88c3=['TEXT','long','medium','BOOLEAN','out','STRING','DATE','ENUM','Email','Chat','lodash'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x88c3,0x1c2));var _0x388c=function(_0xd6335a,_0x5edc40){_0xd6335a=_0xd6335a-0x0;var _0x3c8f07=_0x88c3[_0xd6335a];return _0x3c8f07;};'use strict';var Sequelize=require('sequelize');var _=require(_0x388c('0x0'));module['exports']={'body':{'type':Sequelize[_0x388c('0x1')](_0x388c('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x388c('0x3'))},'read':{'type':Sequelize[_0x388c('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x388c('0x5')),'defaultValue':_0x388c('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x388c('0x6')](0x1fe)},'from':{'type':Sequelize[_0x388c('0x6')]},'to':{'type':Sequelize[_0x388c('0x1')](_0x388c('0x2'))},'cc':{'type':Sequelize[_0x388c('0x1')](_0x388c('0x2'))},'bcc':{'type':Sequelize['TEXT'](_0x388c('0x2'))},'subject':{'type':Sequelize[_0x388c('0x1')]},'sentAt':{'type':Sequelize[_0x388c('0x7')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0x388c('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0x388c('0x1')]('long')},'originCc':{'type':Sequelize[_0x388c('0x1')]('long')},'originChannel':{'type':Sequelize[_0x388c('0x8')](_0x388c('0x9'),_0x388c('0xa')),'defaultValue':'Email','allowNull':![]}}; \ No newline at end of file +var _0x3914=['Chat','lodash','exports','long','TEXT','medium','ENUM','out','STRING','DATE','INTEGER','BOOLEAN','Email'];(function(_0x173eff,_0x55a7d0){var _0x119fbd=function(_0x31a223){while(--_0x31a223){_0x173eff['push'](_0x173eff['shift']());}};_0x119fbd(++_0x55a7d0);}(_0x3914,0x90));var _0x4391=function(_0x4bd06e,_0x593701){_0x4bd06e=_0x4bd06e-0x0;var _0x85ebb=_0x3914[_0x4bd06e];return _0x85ebb;};'use strict';var Sequelize=require('sequelize');var _=require(_0x4391('0x0'));module[_0x4391('0x1')]={'body':{'type':Sequelize['TEXT'](_0x4391('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x4391('0x3')](_0x4391('0x4'))},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x4391('0x5')]('in',_0x4391('0x6')),'defaultValue':_0x4391('0x6'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0x4391('0x7')]},'to':{'type':Sequelize[_0x4391('0x3')](_0x4391('0x2'))},'cc':{'type':Sequelize[_0x4391('0x3')]('long')},'bcc':{'type':Sequelize[_0x4391('0x3')](_0x4391('0x2'))},'subject':{'type':Sequelize[_0x4391('0x3')]},'sentAt':{'type':Sequelize[_0x4391('0x8')]},'attach':{'type':Sequelize[_0x4391('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x4391('0xa')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize['TEXT'](_0x4391('0x2'))},'originCc':{'type':Sequelize[_0x4391('0x3')]('long')},'originChannel':{'type':Sequelize['ENUM'](_0x4391('0xb'),_0x4391('0xc')),'defaultValue':_0x4391('0xb'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index f841117..5e794f0 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 _0x78b3=['request\x20sent','error','code','message','catch','status','json','undefined','offset','count','limit','update','destroy','end','sendStatus','stack','name','send','map','MailMessage','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','body','describe','create','out','secret','split','findOne','MailAccountId','CmList','Contacts','updatedAt','DESC','Smtp','CloudProvider','getSmtpOptions','attachments','root','server/files/attachments','basename','List','CmContact','ListId','SendMail','sendMail','format','YYYY-MM-DD\x20HH:mm:ss','stringify','accept','read','readAt','UserId','user','agent','get','MailInteractionId','isNil','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','User','manual','interface','SIP/%s','channel','motionChannel','event','fromString','EventManager','acceptmessage','reject','MailInteraction','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT','contact','email','internal','rejectmessage','download','unix','toString','join','server','files','tmp','message-%s.eml','from','subject','createdAt','Attachment','Attachments','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','bcc','existsSync','push','readFileSync','build','writeFileSync','unlinkSync','eml-format','moment','bluebird','util','path','lodash','ioredis','html-to-text','api','mail-interactions','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','jayson/promise','client','http','then','info','MailMessage,\x20%s,\x20%s','MailMessage,\x20%s,\x20%s,\x20%s'];(function(_0x3ac9f6,_0x200645){var _0x4647fe=function(_0x26ecb0){while(--_0x26ecb0){_0x3ac9f6['push'](_0x3ac9f6['shift']());}};_0x4647fe(++_0x200645);}(_0x78b3,0x89));var _0x378b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x78b3[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x378b('0x0'));var moment=require(_0x378b('0x1'));var BPromise=require(_0x378b('0x2'));var util=require(_0x378b('0x3'));var path=require(_0x378b('0x4'));var fs=require('fs');var _=require(_0x378b('0x5'));var Redis=require(_0x378b('0x6'));var htmlToText=require(_0x378b('0x7'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x378b('0x8'));var interaction_log=require('../../config/logger')(_0x378b('0x9'));var config=require('../../config/environment');var db=require(_0x378b('0xa'))['db'];config[_0x378b('0xb')]=_[_0x378b('0xc')](config[_0x378b('0xb')],{'host':_0x378b('0xd'),'port':0x18eb});var socket=require(_0x378b('0xe'))(new Redis(config[_0x378b('0xb')]));var htmlEntities=require('html-entities');require(_0x378b('0xf'))[_0x378b('0x10')](socket);var jayson=require(_0x378b('0x11'));var client=jayson[_0x378b('0x12')]['http']({'port':0x232c});var client9003=jayson[_0x378b('0x12')][_0x378b('0x13')]({'port':0x232b});var client9002=jayson['client'][_0x378b('0x13')]({'port':0x232a});function respondWithRpcPromise(_0x326858,_0x11080a,_0xfe9edb,_0x1d7af3){return new BPromise(function(_0x241b66,_0x57e39d){var _0x2ec289=_0x1d7af3||client;return _0x2ec289['request'](_0x326858,_0xfe9edb)[_0x378b('0x14')](function(_0x41b0fe){logger[_0x378b('0x15')](_0x378b('0x16'),_0x11080a,'request\x20sent');logger['debug'](_0x378b('0x17'),_0x11080a,_0x378b('0x18'),JSON['stringify'](_0x41b0fe));if(_0x41b0fe[_0x378b('0x19')]){if(_0x41b0fe[_0x378b('0x19')][_0x378b('0x1a')]===0x1f4){logger[_0x378b('0x19')](_0x378b('0x16'),_0x11080a,_0x41b0fe[_0x378b('0x19')][_0x378b('0x1b')]);return _0x57e39d(_0x41b0fe[_0x378b('0x19')][_0x378b('0x1b')]);}logger[_0x378b('0x19')](_0x378b('0x16'),_0x11080a,_0x41b0fe[_0x378b('0x19')][_0x378b('0x1b')]);return _0x241b66(_0x41b0fe[_0x378b('0x19')][_0x378b('0x1b')]);}else{logger['info'](_0x378b('0x16'),_0x11080a,_0x378b('0x18'));_0x241b66(_0x41b0fe['result'][_0x378b('0x1b')]);}})[_0x378b('0x1c')](function(_0x285814){logger[_0x378b('0x19')]('MailMessage,\x20%s,\x20%s',_0x11080a,_0x285814);_0x57e39d(_0x285814);});});}function respondWithResult(_0x12f879,_0x532613){_0x532613=_0x532613||0xc8;return function(_0x3cc74d){if(_0x3cc74d){return _0x12f879[_0x378b('0x1d')](_0x532613)[_0x378b('0x1e')](_0x3cc74d);}};}function respondWithFilteredResult(_0x3b402c,_0x3f354f){return function(_0x247643){if(_0x247643){var _0x2f50b8=typeof _0x3f354f['offset']===_0x378b('0x1f')&&typeof _0x3f354f['limit']==='undefined';var _0xb7b518=_0x247643['count'];var _0x225f04=_0x2f50b8?0x0:_0x3f354f[_0x378b('0x20')];var _0x16b2f3=_0x2f50b8?_0x247643[_0x378b('0x21')]:_0x3f354f[_0x378b('0x20')]+_0x3f354f[_0x378b('0x22')];var _0x43bdac;if(_0x16b2f3>=_0xb7b518){_0x16b2f3=_0xb7b518;_0x43bdac=0xc8;}else{_0x43bdac=0xce;}_0x3b402c[_0x378b('0x1d')](_0x43bdac);return _0x3b402c['set']('Content-Range',_0x225f04+'-'+_0x16b2f3+'/'+_0xb7b518)[_0x378b('0x1e')](_0x247643);}return null;};}function saveUpdates(_0x11fbf0){return function(_0x28b5ad){if(_0x28b5ad){return _0x28b5ad[_0x378b('0x23')](_0x11fbf0)[_0x378b('0x14')](function(_0x173609){return _0x173609;});}return null;};}function removeEntity(_0x5d2b52){return function(_0x2b8292){if(_0x2b8292){return _0x2b8292[_0x378b('0x24')]()[_0x378b('0x14')](function(){_0x5d2b52[_0x378b('0x1d')](0xcc)[_0x378b('0x25')]();});}};}function handleEntityNotFound(_0x213b18){return function(_0x1dc663){if(!_0x1dc663){_0x213b18[_0x378b('0x26')](0x194);}return _0x1dc663;};}function handleError(_0x2ab68d,_0x5b20a1){_0x5b20a1=_0x5b20a1||0x1f4;return function(_0x5ee666){logger['error'](_0x5ee666[_0x378b('0x27')]);if(_0x5ee666['name']){delete _0x5ee666[_0x378b('0x28')];}_0x2ab68d[_0x378b('0x1d')](_0x5b20a1)[_0x378b('0x29')](_0x5ee666);};}exports['index']=function(_0x2aaa6d,_0x5cd3ac){var _0x10071e={},_0x534c37={},_0x32bf17={'count':0x0,'rows':[]};var _0x194d82=_[_0x378b('0x2a')](db[_0x378b('0x2b')]['rawAttributes'],function(_0x23c6ef){return{'name':_0x23c6ef[_0x378b('0x2c')],'type':_0x23c6ef[_0x378b('0x2d')][_0x378b('0x2e')]};});_0x534c37[_0x378b('0x2f')]=_[_0x378b('0x2a')](_0x194d82,_0x378b('0x28'));_0x534c37['query']=_[_0x378b('0x30')](_0x2aaa6d[_0x378b('0x31')]);_0x534c37[_0x378b('0x32')]=_[_0x378b('0x33')](_0x534c37[_0x378b('0x2f')],_0x534c37[_0x378b('0x31')]);_0x10071e['attributes']=_[_0x378b('0x33')](_0x534c37[_0x378b('0x2f')],qs['fields'](_0x2aaa6d[_0x378b('0x31')][_0x378b('0x34')]));_0x10071e[_0x378b('0x35')]=_0x10071e['attributes'][_0x378b('0x36')]?_0x10071e[_0x378b('0x35')]:_0x534c37[_0x378b('0x2f')];if(!_0x2aaa6d[_0x378b('0x31')][_0x378b('0x37')](_0x378b('0x38'))){_0x10071e[_0x378b('0x22')]=qs[_0x378b('0x22')](_0x2aaa6d[_0x378b('0x31')]['limit']);_0x10071e[_0x378b('0x20')]=qs[_0x378b('0x20')](_0x2aaa6d[_0x378b('0x31')][_0x378b('0x20')]);}_0x10071e[_0x378b('0x39')]=qs['sort'](_0x2aaa6d[_0x378b('0x31')][_0x378b('0x3a')]);_0x10071e['where']=qs['filters'](_[_0x378b('0x3b')](_0x2aaa6d[_0x378b('0x31')],_0x534c37[_0x378b('0x32')]),_0x194d82);if(_0x2aaa6d[_0x378b('0x31')][_0x378b('0x3c')]){_0x10071e[_0x378b('0x3d')]=_[_0x378b('0x3e')](_0x10071e[_0x378b('0x3d')],{'$or':_[_0x378b('0x2a')](_0x194d82,function(_0x45ce35){if(_0x45ce35[_0x378b('0x2d')]!==_0x378b('0x3f')){var _0x263dc1={};_0x263dc1[_0x45ce35['name']]={'$like':'%'+_0x2aaa6d['query']['filter']+'%'};return _0x263dc1;}})});}_0x10071e=_[_0x378b('0x3e')]({},_0x10071e,_0x2aaa6d[_0x378b('0x40')]);var _0x4aaff2={'where':_0x10071e['where']};return db[_0x378b('0x2b')]['count'](_0x4aaff2)[_0x378b('0x14')](function(_0x47638d){_0x32bf17[_0x378b('0x21')]=_0x47638d;if(_0x2aaa6d[_0x378b('0x31')][_0x378b('0x41')]){_0x10071e[_0x378b('0x42')]=[{'all':!![]}];}return db['MailMessage'][_0x378b('0x43')](_0x10071e);})['then'](function(_0x5f4cb7){_0x32bf17[_0x378b('0x44')]=_0x5f4cb7;return _0x32bf17;})[_0x378b('0x14')](respondWithFilteredResult(_0x5cd3ac,_0x10071e))[_0x378b('0x1c')](handleError(_0x5cd3ac,null));};exports[_0x378b('0x45')]=function(_0x4d7e9c,_0x17b6f2){var _0x28faa4={'raw':!![],'where':{'id':_0x4d7e9c[_0x378b('0x46')]['id']}},_0x46cb1b={};_0x46cb1b[_0x378b('0x2f')]=_[_0x378b('0x30')](db['MailMessage']['rawAttributes']);_0x46cb1b[_0x378b('0x31')]=_['keys'](_0x4d7e9c['query']);_0x46cb1b[_0x378b('0x32')]=_[_0x378b('0x33')](_0x46cb1b[_0x378b('0x2f')],_0x46cb1b[_0x378b('0x31')]);_0x28faa4['attributes']=_[_0x378b('0x33')](_0x46cb1b[_0x378b('0x2f')],qs['fields'](_0x4d7e9c[_0x378b('0x31')]['fields']));_0x28faa4[_0x378b('0x35')]=_0x28faa4[_0x378b('0x35')]['length']?_0x28faa4[_0x378b('0x35')]:_0x46cb1b[_0x378b('0x2f')];if(_0x4d7e9c['query'][_0x378b('0x41')]){_0x28faa4[_0x378b('0x42')]=[{'all':!![]}];}_0x28faa4=_[_0x378b('0x3e')]({},_0x28faa4,_0x4d7e9c['options']);return db['MailMessage'][_0x378b('0x47')](_0x28faa4)['then'](handleEntityNotFound(_0x17b6f2,null))[_0x378b('0x14')](respondWithResult(_0x17b6f2,null))[_0x378b('0x1c')](handleError(_0x17b6f2,null));};exports[_0x378b('0x23')]=function(_0x46e4e9,_0x41dfef){if(_0x46e4e9[_0x378b('0x48')]['id']){delete _0x46e4e9[_0x378b('0x48')]['id'];}return db[_0x378b('0x2b')]['find']({'where':{'id':_0x46e4e9[_0x378b('0x46')]['id']}})[_0x378b('0x14')](handleEntityNotFound(_0x41dfef,null))[_0x378b('0x14')](saveUpdates(_0x46e4e9[_0x378b('0x48')],null))[_0x378b('0x14')](respondWithResult(_0x41dfef,null))[_0x378b('0x1c')](handleError(_0x41dfef,null));};exports[_0x378b('0x24')]=function(_0x1e2a20,_0x2ae079){return db[_0x378b('0x2b')][_0x378b('0x47')]({'where':{'id':_0x1e2a20[_0x378b('0x46')]['id']}})[_0x378b('0x14')](handleEntityNotFound(_0x2ae079,null))['then'](removeEntity(_0x2ae079,null))[_0x378b('0x1c')](handleError(_0x2ae079,null));};exports[_0x378b('0x49')]=function(_0x1c9d69,_0x30c4ce){return db[_0x378b('0x2b')][_0x378b('0x49')]()[_0x378b('0x14')](respondWithResult(_0x30c4ce,null))[_0x378b('0x1c')](handleError(_0x30c4ce,null));};exports[_0x378b('0x4a')]=function(_0x16efa1,_0x1c6b01){return db['MailMessage'][_0x378b('0x4a')](_0x16efa1[_0x378b('0x48')])[_0x378b('0x14')](function(_0x544c20){if(_0x544c20){if(_0x544c20['direction']===_0x378b('0x4b')&&!_0x544c20[_0x378b('0x4c')]){var _0xdf002c,_0x252f41,_0x5d7a03;if(_0x16efa1[_0x378b('0x48')]['to']){_0x252f41=_0x16efa1[_0x378b('0x48')]['to'][_0x378b('0x4d')](',')[0x0];}return db['MailAccount'][_0x378b('0x4e')]({'where':{'id':_0x544c20[_0x378b('0x4f')]},'include':[{'model':db[_0x378b('0x50')],'as':'List','include':[{'model':db['CmContact'],'as':_0x378b('0x51'),'where':{'email':_0x252f41},'limit':0x1,'order':[[_0x378b('0x52'),_0x378b('0x53')]]}]},{'model':db['MailServerOut'],'as':_0x378b('0x54'),'raw':!![],'include':[{'model':db[_0x378b('0x55')],'as':_0x378b('0x55'),'raw':!![]}]}]})['then'](function(_0x5643cc){_0xdf002c=_0x5643cc;if(!_0xdf002c||!_0xdf002c[_0x378b('0x54')])return;var _0x3cdc74=_0xdf002c[_0x378b('0x56')]();if(_0x16efa1[_0x378b('0x48')][_0x378b('0x57')]&&_0x16efa1[_0x378b('0x48')][_0x378b('0x57')][_0x378b('0x36')]){for(var _0xc0a59d=0x0;_0xc0a59d<_0x16efa1[_0x378b('0x48')][_0x378b('0x57')]['length'];_0xc0a59d+=0x1){_0x16efa1['body']['attachments'][_0xc0a59d]={'filename':_0x16efa1[_0x378b('0x48')]['attachments'][_0xc0a59d][_0x378b('0x28')],'path':path['join'](config[_0x378b('0x58')],_0x378b('0x59'),_0x16efa1['body'][_0x378b('0x57')][_0xc0a59d][_0x378b('0x5a')])};}}_0x5d7a03={'account':_0x3cdc74,'message':_0x16efa1['body']};return;})[_0x378b('0x14')](function(){if(_0xdf002c[_0x378b('0x5b')]){if(_0xdf002c[_0x378b('0x5b')][_0x378b('0x51')][_0x378b('0x36')]){return _0xdf002c[_0x378b('0x5b')][_0x378b('0x51')][0x0];}else{return db[_0x378b('0x5c')][_0x378b('0x4a')](_[_0x378b('0xc')](_0x16efa1[_0x378b('0x48')],{'firstName':_0x16efa1[_0x378b('0x48')]['to'],'email':_0x16efa1[_0x378b('0x48')]['to'],'phone':_0x16efa1[_0x378b('0x48')]['to'],'ListId':_0xdf002c[_0x378b('0x5d')]}));}}else{throw new Error('List\x20not\x20found');}})[_0x378b('0x14')](function(){if(_0x5d7a03){return respondWithRpcPromise(_0x378b('0x5e'),_0x378b('0x5f'),_0x5d7a03,client9003)[_0x378b('0x14')](function(_0x4f8497){return _0x544c20['update']({'read':!![],'messageId':_0x4f8497['messageId'],'sentAt':moment()[_0x378b('0x60')](_0x378b('0x61'))});})['catch'](function(_0x4c00b3){logger['error']('%s',JSON[_0x378b('0x62')](_0x4c00b3));return _0x544c20;});}return _0x544c20;});}return _0x544c20;}})[_0x378b('0x14')](respondWithResult(_0x1c6b01,0xc9))[_0x378b('0x1c')](handleError(_0x1c6b01,null));};exports[_0x378b('0x63')]=function(_0x1e2ba2,_0x51f9c1){var _0x4ac620={'agent':{},'channel':'mail'};if(_0x1e2ba2[_0x378b('0x48')]['id']){delete _0x1e2ba2[_0x378b('0x48')]['id'];}_0x1e2ba2[_0x378b('0x48')][_0x378b('0x64')]=!![];_0x1e2ba2[_0x378b('0x48')][_0x378b('0x65')]=moment()[_0x378b('0x60')](_0x378b('0x61'));_0x1e2ba2['body'][_0x378b('0x66')]=_0x1e2ba2['body'][_0x378b('0x66')]||_0x1e2ba2[_0x378b('0x67')]['id'];_0x4ac620[_0x378b('0x68')]['id']=_0x1e2ba2['body'][_0x378b('0x66')];return db[_0x378b('0x2b')][_0x378b('0x47')]({'where':{'id':_0x1e2ba2[_0x378b('0x46')]['id'],'UserId':null}})[_0x378b('0x14')](handleEntityNotFound(_0x51f9c1,null))[_0x378b('0x14')](saveUpdates(_0x1e2ba2[_0x378b('0x48')],null))[_0x378b('0x14')](function(_0x1ffc9a){if(_0x1ffc9a){_0x4ac620['message']=_0x1ffc9a[_0x378b('0x69')]({'plain':!![]});return db['MailInteraction'][_0x378b('0x47')]({'where':{'id':_0x1ffc9a[_0x378b('0x6a')]}});}return null;})[_0x378b('0x14')](handleEntityNotFound(_0x51f9c1,null))[_0x378b('0x14')](function(_0xe7b7ba){if(_0xe7b7ba){return _0xe7b7ba[_0x378b('0x23')]({'UserId':_0x1e2ba2[_0x378b('0x48')][_0x378b('0x66')],'read1stAt':_[_0x378b('0x6b')](_0xe7b7ba[_0x378b('0x6c')])?moment()[_0x378b('0x60')](_0x378b('0x61')):undefined});}return null;})['then'](function(_0x10e898){if(_0x10e898){_0x4ac620[_0x378b('0x6d')]=_0x10e898[_0x378b('0x69')]({'plain':!![]});interaction_log['info'](_0x378b('0x6e'),_0x1e2ba2[_0x378b('0x67')]['id'],_0x1e2ba2[_0x378b('0x67')][_0x378b('0x28')],_0x1e2ba2['user']['role'],_0x4ac620[_0x378b('0x6d')]['id'],_0x1e2ba2[_0x378b('0x48')]?JSON[_0x378b('0x62')](_0x1e2ba2['body']):_0x378b('0x6f'));return respondWithRpcPromise('AcceptMessage',_0x378b('0x70'),_0x4ac620);}return null;})['then'](function(_0x134840){var _0x15578f=_0x378b('0x71')+_0x134840['message'][_0x378b('0x72')];return db[_0x378b('0x73')][_0x378b('0x31')](_0x15578f,{'type':db[_0x378b('0x74')][_0x378b('0x75')]['SELECT'],'raw':!![]})[_0x378b('0x14')](function(_0x266e61){return _0x266e61;});})[_0x378b('0x14')](function(_0x38c78f){if(_0x38c78f){_0x4ac620[_0x378b('0x1b')]['contact']=_0x38c78f[0x0];if(!_0x1e2ba2['body'][_0x378b('0x66')])return;return db[_0x378b('0x76')][_0x378b('0x47')]({'where':{'id':_0x1e2ba2[_0x378b('0x48')][_0x378b('0x66')],'role':_0x378b('0x68')},'attributes':['id',_0x378b('0x28'),'fullname','email','internal'],'raw':!![]});}return null;})[_0x378b('0x14')](function(_0x2952cf){if(!_0x2952cf)return null;_0x4ac620[_0x378b('0x1b')]['agent']=_0x2952cf;return _0x4ac620;})[_0x378b('0x14')](function(_0x547a45){if(_0x547a45){if(_0x1e2ba2['body'][_0x378b('0x77')]){_0x4ac620[_0x378b('0x1b')][_0x378b('0x78')]=util[_0x378b('0x60')](_0x378b('0x79'),_0x1e2ba2[_0x378b('0x67')][_0x378b('0x28')]);_0x4ac620['message'][_0x378b('0x7a')]=_0x4ac620[_0x378b('0x7a')];_0x4ac620[_0x378b('0x1b')][_0x378b('0x7b')]=_0x4ac620[_0x378b('0x7a')];_0x4ac620[_0x378b('0x1b')][_0x378b('0x7c')]=_0x378b('0x63');_0x4ac620['message'][_0x378b('0x48')]=htmlToText[_0x378b('0x7d')](_0x4ac620[_0x378b('0x1b')][_0x378b('0x48')]);return respondWithRpcPromise(_0x378b('0x7e'),_0x378b('0x7e'),{'event':_0x378b('0x7f'),'message':_0x4ac620['message']},client9002)[_0x378b('0x14')](function(){return _0x4ac620;});}return _0x4ac620;}return null;})[_0x378b('0x14')](respondWithResult(_0x51f9c1,null))[_0x378b('0x1c')](handleError(_0x51f9c1,null));};exports[_0x378b('0x80')]=function(_0x3602ff,_0x5116d5){var _0x4eabe6={'agent':{},'channel':'mail'};if(_0x3602ff['body']['id']){delete _0x3602ff[_0x378b('0x48')]['id'];}_0x3602ff[_0x378b('0x48')]['UserId']=_0x3602ff[_0x378b('0x48')][_0x378b('0x66')]||_0x3602ff[_0x378b('0x67')]['id'];_0x4eabe6[_0x378b('0x68')]['id']=_0x3602ff[_0x378b('0x48')][_0x378b('0x66')];return db[_0x378b('0x2b')][_0x378b('0x47')]({'where':{'id':_0x3602ff[_0x378b('0x46')]['id'],'UserId':null}})[_0x378b('0x14')](handleEntityNotFound(_0x5116d5,null))[_0x378b('0x14')](function(_0x85b4b2){if(_0x85b4b2){_0x4eabe6[_0x378b('0x1b')]=_0x85b4b2[_0x378b('0x69')]({'plain':!![]});return db[_0x378b('0x81')][_0x378b('0x47')]({'where':{'id':_0x85b4b2[_0x378b('0x6a')]}});}return null;})[_0x378b('0x14')](handleEntityNotFound(_0x5116d5,null))[_0x378b('0x14')](function(_0x452ed6){if(_0x452ed6){_0x4eabe6[_0x378b('0x6d')]=_0x452ed6[_0x378b('0x69')]({'plain':!![]});interaction_log[_0x378b('0x15')](_0x378b('0x82'),_0x3602ff['user']['id'],_0x3602ff[_0x378b('0x67')][_0x378b('0x28')],_0x3602ff['user']['role'],_0x4eabe6[_0x378b('0x6d')]['id'],_0x3602ff[_0x378b('0x48')]?JSON[_0x378b('0x62')](_0x3602ff[_0x378b('0x48')]):'null');return respondWithRpcPromise(_0x378b('0x83'),_0x378b('0x84'),_0x4eabe6);}return null;})[_0x378b('0x14')](function(_0x38813b){var _0x458a39=_0x378b('0x71')+_0x38813b[_0x378b('0x1b')][_0x378b('0x72')];return db[_0x378b('0x73')]['query'](_0x458a39,{'type':db[_0x378b('0x74')][_0x378b('0x75')][_0x378b('0x85')],'raw':!![]})['then'](function(_0xf793e9){return _0xf793e9;});})[_0x378b('0x14')](function(_0x125454){if(_0x125454){_0x4eabe6[_0x378b('0x1b')][_0x378b('0x86')]=_0x125454[0x0];if(!_0x3602ff[_0x378b('0x48')][_0x378b('0x66')])return;return db[_0x378b('0x76')]['find']({'where':{'id':_0x3602ff[_0x378b('0x48')][_0x378b('0x66')],'role':_0x378b('0x68')},'attributes':['id',_0x378b('0x28'),'fullname',_0x378b('0x87'),_0x378b('0x88')],'raw':!![]});}return null;})[_0x378b('0x14')](function(_0x3f9052){if(!_0x3f9052)return null;_0x4eabe6[_0x378b('0x1b')]['agent']=_0x3f9052;return _0x4eabe6;})[_0x378b('0x14')](function(_0x2f54c6){if(_0x2f54c6){_0x2f54c6[_0x378b('0x1b')]['interface']=util[_0x378b('0x60')](_0x378b('0x79'),_0x3602ff[_0x378b('0x67')][_0x378b('0x28')]);_0x2f54c6[_0x378b('0x1b')][_0x378b('0x7a')]=_0x4eabe6[_0x378b('0x7a')];_0x2f54c6[_0x378b('0x1b')][_0x378b('0x7b')]=_0x4eabe6[_0x378b('0x7a')];_0x2f54c6[_0x378b('0x1b')]['event']=_0x378b('0x80');_0x2f54c6[_0x378b('0x1b')][_0x378b('0x48')]=htmlToText[_0x378b('0x7d')](_0x4eabe6[_0x378b('0x1b')][_0x378b('0x48')]);respondWithRpcPromise('EventManager',_0x378b('0x7e'),{'event':_0x378b('0x89'),'message':_0x2f54c6['message']},client9002);return _0x4eabe6;}return null;})['then'](respondWithResult(_0x5116d5,null))[_0x378b('0x1c')](handleError(_0x5116d5,null));};exports[_0x378b('0x8a')]=function(_0x45f5cd,_0x114f5a){var _0x165150=moment()[_0x378b('0x8b')]()[_0x378b('0x8c')]();var _0x4bef38=path[_0x378b('0x8d')](config[_0x378b('0x58')],_0x378b('0x8e'),_0x378b('0x8f'),_0x378b('0x90'));var _0x565dff=path[_0x378b('0x8d')](config[_0x378b('0x58')],_0x378b('0x8e'),_0x378b('0x8f'),_0x378b('0x57'));var _0x5da700=util[_0x378b('0x60')](_0x378b('0x91'),_0x165150);return db[_0x378b('0x2b')][_0x378b('0x47')]({'where':{'id':_0x45f5cd[_0x378b('0x46')]['id']},'attributes':['id','body',_0x378b('0x92'),'to','cc','bcc',_0x378b('0x93'),_0x378b('0x94')],'include':_0x45f5cd[_0x378b('0x31')][_0x378b('0x57')]?[{'model':db[_0x378b('0x95')],'as':_0x378b('0x96')}]:undefined})[_0x378b('0x14')](handleEntityNotFound(_0x114f5a,null))[_0x378b('0x14')](function(_0x3940c9){if(_0x3940c9){var _0xbc7f37=_0x3940c9;var _0x1d96ea={'from':_0xbc7f37[_0x378b('0x92')],'to':_0xbc7f37['to'],'subject':_0xbc7f37['subject'],'html':htmlEntities['decode'](_0xbc7f37[_0x378b('0x48')]),'headers':{'Date':moment(_0xbc7f37['createdAt'])[_0x378b('0x60')](_0x378b('0x97'))},'attachments':[]};if(_0x3940c9['cc']){_0x1d96ea[_0x378b('0x98')]['Cc']=_0x3940c9['cc'];}if(_0x3940c9['bcc']){_0x1d96ea[_0x378b('0x98')][_0x378b('0x99')]=_0x3940c9[_0x378b('0x9a')];}return new BPromise(function(_0x4778a2,_0x417e0c){if(_0x3940c9[_0x378b('0x96')]){for(var _0x52de8f=0x0;_0x52de8f<_0x3940c9[_0x378b('0x96')]['length'];_0x52de8f++){var _0x120c3b=_0x3940c9[_0x378b('0x96')][_0x52de8f];var _0x4bc721=path[_0x378b('0x8d')](_0x565dff,_0x120c3b[_0x378b('0x5a')]);if(fs[_0x378b('0x9b')](_0x4bc721)){_0x1d96ea[_0x378b('0x57')][_0x378b('0x9c')]({'name':_0x120c3b[_0x378b('0x28')],'contentType':_0x120c3b[_0x378b('0x2d')],'data':fs[_0x378b('0x9d')](_0x4bc721)});}}}emlformat[_0x378b('0x9e')](_0x1d96ea,function(_0x5e45a0,_0xb6d4bf){if(_0x5e45a0)return _0x417e0c(_0x5e45a0);fs[_0x378b('0x9f')](path[_0x378b('0x8d')](_0x4bef38,_0x5da700),_0xb6d4bf);return _0x4778a2(_0xb6d4bf);});});}})[_0x378b('0x14')](function(_0x2fd2a3){if(_0x2fd2a3){return _0x114f5a['download'](path['join'](_0x4bef38,_0x5da700),_0x5da700,function(_0x582673){if(!_0x582673)fs[_0x378b('0xa0')](path[_0x378b('0x8d')](_0x4bef38,_0x5da700));});}})[_0x378b('0x1c')](handleError(_0x114f5a,null));}; \ No newline at end of file +var _0x89e0=['Contacts','defaults','sendMail','format','YYYY-MM-DD\x20HH:mm:ss','read','readAt','UserId','agent','MailInteraction','isNil','read1stAt','interaction','get','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','fullname','email','manual','interface','SIP/%s','channel','motionChannel','event','accept','fromString','EventManager','mail','MailInteractionId','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','rejectMessage','User','internal','reject','rejectmessage','download','toString','server','files','tmp','from','createdAt','Attachment','Attachments','subject','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','bcc','headers','basename','push','readFileSync','build','writeFileSync','eml-format','moment','bluebird','util','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','localhost','socket.io-emitter','redis','./mailMessage.socket','jayson/promise','client','http','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','json','offset','undefined','limit','count','set','update','destroy','sendStatus','stack','name','send','MailMessage','key','model','map','query','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','type','VIRTUAL','filter','include','findAll','rows','show','rawAttributes','fields','options','body','find','params','describe','create','direction','out','split','MailAccount','findOne','CmList','List','CmContact','updatedAt','DESC','MailServerOut','Smtp','CloudProvider','getSmtpOptions','attachments','join','root'];(function(_0x4e04ba,_0x4d3ec7){var _0xbdd55a=function(_0x2ed8ef){while(--_0x2ed8ef){_0x4e04ba['push'](_0x4e04ba['shift']());}};_0xbdd55a(++_0x4d3ec7);}(_0x89e0,0xd8));var _0x089e=function(_0x340945,_0x20874f){_0x340945=_0x340945-0x0;var _0x2ad37e=_0x89e0[_0x340945];return _0x2ad37e;};'use strict';var emlformat=require(_0x089e('0x0'));var moment=require(_0x089e('0x1'));var BPromise=require(_0x089e('0x2'));var util=require(_0x089e('0x3'));var path=require('path');var fs=require('fs');var _=require(_0x089e('0x4'));var Redis=require(_0x089e('0x5'));var htmlToText=require('html-to-text');var qs=require(_0x089e('0x6'));var logger=require(_0x089e('0x7'))(_0x089e('0x8'));var interaction_log=require(_0x089e('0x7'))('mail-interactions');var config=require(_0x089e('0x9'));var db=require(_0x089e('0xa'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x089e('0xb'),'port':0x18eb});var socket=require(_0x089e('0xc'))(new Redis(config[_0x089e('0xd')]));var htmlEntities=require('html-entities');require(_0x089e('0xe'))['register'](socket);var jayson=require(_0x089e('0xf'));var client=jayson[_0x089e('0x10')][_0x089e('0x11')]({'port':0x232c});var client9003=jayson[_0x089e('0x10')][_0x089e('0x11')]({'port':0x232b});var client9002=jayson['client'][_0x089e('0x11')]({'port':0x232a});function respondWithRpcPromise(_0x462b73,_0x5c01b9,_0x941abb,_0x251ca3){return new BPromise(function(_0x1fa48e,_0x3808e8){var _0x91d17c=_0x251ca3||client;return _0x91d17c[_0x089e('0x12')](_0x462b73,_0x941abb)[_0x089e('0x13')](function(_0x278cfc){logger[_0x089e('0x14')](_0x089e('0x15'),_0x5c01b9,_0x089e('0x16'));logger[_0x089e('0x17')](_0x089e('0x18'),_0x5c01b9,_0x089e('0x16'),JSON[_0x089e('0x19')](_0x278cfc));if(_0x278cfc[_0x089e('0x1a')]){if(_0x278cfc[_0x089e('0x1a')][_0x089e('0x1b')]===0x1f4){logger[_0x089e('0x1a')]('MailMessage,\x20%s,\x20%s',_0x5c01b9,_0x278cfc[_0x089e('0x1a')][_0x089e('0x1c')]);return _0x3808e8(_0x278cfc[_0x089e('0x1a')][_0x089e('0x1c')]);}logger[_0x089e('0x1a')](_0x089e('0x15'),_0x5c01b9,_0x278cfc['error'][_0x089e('0x1c')]);return _0x1fa48e(_0x278cfc[_0x089e('0x1a')][_0x089e('0x1c')]);}else{logger[_0x089e('0x14')]('MailMessage,\x20%s,\x20%s',_0x5c01b9,'request\x20sent');_0x1fa48e(_0x278cfc['result'][_0x089e('0x1c')]);}})[_0x089e('0x1d')](function(_0xbfc0fd){logger['error'](_0x089e('0x15'),_0x5c01b9,_0xbfc0fd);_0x3808e8(_0xbfc0fd);});});}function respondWithResult(_0x12e174,_0x42cbe0){_0x42cbe0=_0x42cbe0||0xc8;return function(_0x1c028c){if(_0x1c028c){return _0x12e174[_0x089e('0x1e')](_0x42cbe0)[_0x089e('0x1f')](_0x1c028c);}};}function respondWithFilteredResult(_0x3fa01b,_0x17fd26){return function(_0x52076b){if(_0x52076b){var _0x59d66a=typeof _0x17fd26[_0x089e('0x20')]===_0x089e('0x21')&&typeof _0x17fd26[_0x089e('0x22')]===_0x089e('0x21');var _0x55a8e1=_0x52076b['count'];var _0x37b9b7=_0x59d66a?0x0:_0x17fd26[_0x089e('0x20')];var _0x1a8205=_0x59d66a?_0x52076b[_0x089e('0x23')]:_0x17fd26[_0x089e('0x20')]+_0x17fd26[_0x089e('0x22')];var _0x3ddd6f;if(_0x1a8205>=_0x55a8e1){_0x1a8205=_0x55a8e1;_0x3ddd6f=0xc8;}else{_0x3ddd6f=0xce;}_0x3fa01b[_0x089e('0x1e')](_0x3ddd6f);return _0x3fa01b[_0x089e('0x24')]('Content-Range',_0x37b9b7+'-'+_0x1a8205+'/'+_0x55a8e1)[_0x089e('0x1f')](_0x52076b);}return null;};}function saveUpdates(_0x9cd294){return function(_0x370b33){if(_0x370b33){return _0x370b33[_0x089e('0x25')](_0x9cd294)[_0x089e('0x13')](function(_0x3bdee2){return _0x3bdee2;});}return null;};}function removeEntity(_0x44bd88){return function(_0x37c2bb){if(_0x37c2bb){return _0x37c2bb[_0x089e('0x26')]()[_0x089e('0x13')](function(){_0x44bd88['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x57f11a){return function(_0x4b1a64){if(!_0x4b1a64){_0x57f11a[_0x089e('0x27')](0x194);}return _0x4b1a64;};}function handleError(_0x321555,_0x44894e){_0x44894e=_0x44894e||0x1f4;return function(_0x705ff7){logger[_0x089e('0x1a')](_0x705ff7[_0x089e('0x28')]);if(_0x705ff7['name']){delete _0x705ff7[_0x089e('0x29')];}_0x321555[_0x089e('0x1e')](_0x44894e)[_0x089e('0x2a')](_0x705ff7);};}exports['index']=function(_0x45555a,_0x3cbdf1){var _0xebbf61={},_0x2af9fa={},_0x1aaf66={'count':0x0,'rows':[]};var _0x51c6c8=_['map'](db[_0x089e('0x2b')]['rawAttributes'],function(_0x219658){return{'name':_0x219658['fieldName'],'type':_0x219658['type'][_0x089e('0x2c')]};});_0x2af9fa[_0x089e('0x2d')]=_[_0x089e('0x2e')](_0x51c6c8,_0x089e('0x29'));_0x2af9fa[_0x089e('0x2f')]=_['keys'](_0x45555a[_0x089e('0x2f')]);_0x2af9fa['filters']=_[_0x089e('0x30')](_0x2af9fa['model'],_0x2af9fa[_0x089e('0x2f')]);_0xebbf61[_0x089e('0x31')]=_[_0x089e('0x30')](_0x2af9fa[_0x089e('0x2d')],qs['fields'](_0x45555a['query']['fields']));_0xebbf61[_0x089e('0x31')]=_0xebbf61[_0x089e('0x31')][_0x089e('0x32')]?_0xebbf61[_0x089e('0x31')]:_0x2af9fa[_0x089e('0x2d')];if(!_0x45555a[_0x089e('0x2f')][_0x089e('0x33')](_0x089e('0x34'))){_0xebbf61[_0x089e('0x22')]=qs[_0x089e('0x22')](_0x45555a[_0x089e('0x2f')][_0x089e('0x22')]);_0xebbf61[_0x089e('0x20')]=qs[_0x089e('0x20')](_0x45555a[_0x089e('0x2f')][_0x089e('0x20')]);}_0xebbf61[_0x089e('0x35')]=qs[_0x089e('0x36')](_0x45555a[_0x089e('0x2f')]['sort']);_0xebbf61[_0x089e('0x37')]=qs[_0x089e('0x38')](_[_0x089e('0x39')](_0x45555a['query'],_0x2af9fa[_0x089e('0x38')]),_0x51c6c8);if(_0x45555a[_0x089e('0x2f')]['filter']){_0xebbf61[_0x089e('0x37')]=_['merge'](_0xebbf61['where'],{'$or':_['map'](_0x51c6c8,function(_0x24de56){if(_0x24de56[_0x089e('0x3a')]!==_0x089e('0x3b')){var _0x27330d={};_0x27330d[_0x24de56[_0x089e('0x29')]]={'$like':'%'+_0x45555a[_0x089e('0x2f')][_0x089e('0x3c')]+'%'};return _0x27330d;}})});}_0xebbf61=_['merge']({},_0xebbf61,_0x45555a['options']);var _0x58a29f={'where':_0xebbf61[_0x089e('0x37')]};return db[_0x089e('0x2b')][_0x089e('0x23')](_0x58a29f)[_0x089e('0x13')](function(_0x444052){_0x1aaf66[_0x089e('0x23')]=_0x444052;if(_0x45555a[_0x089e('0x2f')]['includeAll']){_0xebbf61[_0x089e('0x3d')]=[{'all':!![]}];}return db[_0x089e('0x2b')][_0x089e('0x3e')](_0xebbf61);})['then'](function(_0x4e665b){_0x1aaf66[_0x089e('0x3f')]=_0x4e665b;return _0x1aaf66;})[_0x089e('0x13')](respondWithFilteredResult(_0x3cbdf1,_0xebbf61))[_0x089e('0x1d')](handleError(_0x3cbdf1,null));};exports[_0x089e('0x40')]=function(_0x11269d,_0x25f766){var _0x248e1d={'raw':!![],'where':{'id':_0x11269d['params']['id']}},_0x512e96={};_0x512e96[_0x089e('0x2d')]=_['keys'](db['MailMessage'][_0x089e('0x41')]);_0x512e96[_0x089e('0x2f')]=_['keys'](_0x11269d['query']);_0x512e96['filters']=_[_0x089e('0x30')](_0x512e96[_0x089e('0x2d')],_0x512e96[_0x089e('0x2f')]);_0x248e1d[_0x089e('0x31')]=_[_0x089e('0x30')](_0x512e96['model'],qs['fields'](_0x11269d['query'][_0x089e('0x42')]));_0x248e1d[_0x089e('0x31')]=_0x248e1d[_0x089e('0x31')][_0x089e('0x32')]?_0x248e1d[_0x089e('0x31')]:_0x512e96['model'];if(_0x11269d['query']['includeAll']){_0x248e1d[_0x089e('0x3d')]=[{'all':!![]}];}_0x248e1d=_['merge']({},_0x248e1d,_0x11269d[_0x089e('0x43')]);return db[_0x089e('0x2b')]['find'](_0x248e1d)[_0x089e('0x13')](handleEntityNotFound(_0x25f766,null))[_0x089e('0x13')](respondWithResult(_0x25f766,null))[_0x089e('0x1d')](handleError(_0x25f766,null));};exports[_0x089e('0x25')]=function(_0x14b4b1,_0x4e9528){if(_0x14b4b1[_0x089e('0x44')]['id']){delete _0x14b4b1[_0x089e('0x44')]['id'];}return db[_0x089e('0x2b')][_0x089e('0x45')]({'where':{'id':_0x14b4b1[_0x089e('0x46')]['id']}})['then'](handleEntityNotFound(_0x4e9528,null))[_0x089e('0x13')](saveUpdates(_0x14b4b1[_0x089e('0x44')],null))[_0x089e('0x13')](respondWithResult(_0x4e9528,null))[_0x089e('0x1d')](handleError(_0x4e9528,null));};exports[_0x089e('0x26')]=function(_0x58408c,_0x52559){return db[_0x089e('0x2b')]['find']({'where':{'id':_0x58408c[_0x089e('0x46')]['id']}})[_0x089e('0x13')](handleEntityNotFound(_0x52559,null))['then'](removeEntity(_0x52559,null))['catch'](handleError(_0x52559,null));};exports[_0x089e('0x47')]=function(_0x453829,_0x2cf7c5){return db[_0x089e('0x2b')][_0x089e('0x47')]()[_0x089e('0x13')](respondWithResult(_0x2cf7c5,null))[_0x089e('0x1d')](handleError(_0x2cf7c5,null));};exports[_0x089e('0x48')]=function(_0xd3800,_0xeb8339){return db[_0x089e('0x2b')][_0x089e('0x48')](_0xd3800[_0x089e('0x44')])[_0x089e('0x13')](function(_0x56b148){if(_0x56b148){if(_0x56b148[_0x089e('0x49')]===_0x089e('0x4a')&&!_0x56b148['secret']){var _0x1495de,_0x48cd11,_0xeb2f38;if(_0xd3800[_0x089e('0x44')]['to']){_0x48cd11=_0xd3800['body']['to'][_0x089e('0x4b')](',')[0x0];}return db[_0x089e('0x4c')][_0x089e('0x4d')]({'where':{'id':_0x56b148['MailAccountId']},'include':[{'model':db[_0x089e('0x4e')],'as':_0x089e('0x4f'),'include':[{'model':db[_0x089e('0x50')],'as':'Contacts','where':{'email':_0x48cd11},'limit':0x1,'order':[[_0x089e('0x51'),_0x089e('0x52')]]}]},{'model':db[_0x089e('0x53')],'as':_0x089e('0x54'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x089e('0x55'),'raw':!![]}]}]})[_0x089e('0x13')](function(_0x116a03){_0x1495de=_0x116a03;if(!_0x1495de||!_0x1495de[_0x089e('0x54')])return;var _0x4cbf17=_0x1495de[_0x089e('0x56')]();if(_0xd3800[_0x089e('0x44')][_0x089e('0x57')]&&_0xd3800[_0x089e('0x44')][_0x089e('0x57')][_0x089e('0x32')]){for(var _0x473e74=0x0;_0x473e74<_0xd3800['body']['attachments'][_0x089e('0x32')];_0x473e74+=0x1){_0xd3800[_0x089e('0x44')][_0x089e('0x57')][_0x473e74]={'filename':_0xd3800[_0x089e('0x44')][_0x089e('0x57')][_0x473e74][_0x089e('0x29')],'path':path[_0x089e('0x58')](config[_0x089e('0x59')],'server/files/attachments',_0xd3800[_0x089e('0x44')][_0x089e('0x57')][_0x473e74]['basename'])};}}_0xeb2f38={'account':_0x4cbf17,'message':_0xd3800[_0x089e('0x44')]};return;})['then'](function(){if(_0x1495de[_0x089e('0x4f')]){if(_0x1495de[_0x089e('0x4f')][_0x089e('0x5a')][_0x089e('0x32')]){return _0x1495de[_0x089e('0x4f')]['Contacts'][0x0];}else{return db['CmContact'][_0x089e('0x48')](_[_0x089e('0x5b')](_0xd3800[_0x089e('0x44')],{'firstName':_0xd3800['body']['to'],'email':_0xd3800[_0x089e('0x44')]['to'],'phone':_0xd3800[_0x089e('0x44')]['to'],'ListId':_0x1495de['ListId']}));}}else{throw new Error('List\x20not\x20found');}})[_0x089e('0x13')](function(){if(_0xeb2f38){return respondWithRpcPromise('SendMail',_0x089e('0x5c'),_0xeb2f38,client9003)[_0x089e('0x13')](function(_0x4d43dd){return _0x56b148[_0x089e('0x25')]({'read':!![],'messageId':_0x4d43dd['messageId'],'sentAt':moment()[_0x089e('0x5d')](_0x089e('0x5e'))});})[_0x089e('0x1d')](function(_0x10f67a){logger[_0x089e('0x1a')]('%s',JSON[_0x089e('0x19')](_0x10f67a));return _0x56b148;});}return _0x56b148;});}return _0x56b148;}})[_0x089e('0x13')](respondWithResult(_0xeb8339,0xc9))[_0x089e('0x1d')](handleError(_0xeb8339,null));};exports['accept']=function(_0x4bdabc,_0x5b6bc5){var _0x5d4b9b={'agent':{},'channel':'mail'};if(_0x4bdabc[_0x089e('0x44')]['id']){delete _0x4bdabc[_0x089e('0x44')]['id'];}_0x4bdabc[_0x089e('0x44')][_0x089e('0x5f')]=!![];_0x4bdabc['body'][_0x089e('0x60')]=moment()['format'](_0x089e('0x5e'));_0x4bdabc[_0x089e('0x44')]['UserId']=_0x4bdabc['body'][_0x089e('0x61')]||_0x4bdabc['user']['id'];_0x5d4b9b[_0x089e('0x62')]['id']=_0x4bdabc[_0x089e('0x44')][_0x089e('0x61')];return db[_0x089e('0x2b')][_0x089e('0x45')]({'where':{'id':_0x4bdabc[_0x089e('0x46')]['id'],'UserId':null}})[_0x089e('0x13')](handleEntityNotFound(_0x5b6bc5,null))['then'](saveUpdates(_0x4bdabc[_0x089e('0x44')],null))[_0x089e('0x13')](function(_0x11684d){if(_0x11684d){_0x5d4b9b[_0x089e('0x1c')]=_0x11684d['get']({'plain':!![]});return db[_0x089e('0x63')][_0x089e('0x45')]({'where':{'id':_0x11684d['MailInteractionId']}});}return null;})[_0x089e('0x13')](handleEntityNotFound(_0x5b6bc5,null))[_0x089e('0x13')](function(_0x24b659){if(_0x24b659){return _0x24b659[_0x089e('0x25')]({'UserId':_0x4bdabc[_0x089e('0x44')][_0x089e('0x61')],'read1stAt':_[_0x089e('0x64')](_0x24b659[_0x089e('0x65')])?moment()[_0x089e('0x5d')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x089e('0x13')](function(_0x397e8b){if(_0x397e8b){_0x5d4b9b[_0x089e('0x66')]=_0x397e8b[_0x089e('0x67')]({'plain':!![]});interaction_log[_0x089e('0x14')](_0x089e('0x68'),_0x4bdabc[_0x089e('0x69')]['id'],_0x4bdabc['user'][_0x089e('0x29')],_0x4bdabc[_0x089e('0x69')][_0x089e('0x6a')],_0x5d4b9b['interaction']['id'],_0x4bdabc[_0x089e('0x44')]?JSON[_0x089e('0x19')](_0x4bdabc[_0x089e('0x44')]):'null');return respondWithRpcPromise(_0x089e('0x6b'),'acceptMessage',_0x5d4b9b);}return null;})['then'](function(_0x4aa957){var _0x1298bc=_0x089e('0x6c')+_0x4aa957[_0x089e('0x1c')][_0x089e('0x6d')];return db[_0x089e('0x6e')][_0x089e('0x2f')](_0x1298bc,{'type':db[_0x089e('0x6f')][_0x089e('0x70')][_0x089e('0x71')],'raw':!![]})[_0x089e('0x13')](function(_0x4d9c83){return _0x4d9c83;});})['then'](function(_0x112faa){if(_0x112faa){_0x5d4b9b[_0x089e('0x1c')]['contact']=_0x112faa[0x0];if(!_0x4bdabc[_0x089e('0x44')][_0x089e('0x61')])return;return db['User'][_0x089e('0x45')]({'where':{'id':_0x4bdabc[_0x089e('0x44')][_0x089e('0x61')],'role':_0x089e('0x62')},'attributes':['id',_0x089e('0x29'),_0x089e('0x72'),_0x089e('0x73'),'internal'],'raw':!![]});}return null;})[_0x089e('0x13')](function(_0x19055f){if(!_0x19055f)return null;_0x5d4b9b[_0x089e('0x1c')][_0x089e('0x62')]=_0x19055f;return _0x5d4b9b;})[_0x089e('0x13')](function(_0x3d3f01){if(_0x3d3f01){if(_0x4bdabc[_0x089e('0x44')][_0x089e('0x74')]){_0x5d4b9b[_0x089e('0x1c')][_0x089e('0x75')]=util[_0x089e('0x5d')](_0x089e('0x76'),_0x4bdabc[_0x089e('0x69')][_0x089e('0x29')]);_0x5d4b9b[_0x089e('0x1c')][_0x089e('0x77')]=_0x5d4b9b[_0x089e('0x77')];_0x5d4b9b[_0x089e('0x1c')][_0x089e('0x78')]=_0x5d4b9b[_0x089e('0x77')];_0x5d4b9b[_0x089e('0x1c')][_0x089e('0x79')]=_0x089e('0x7a');_0x5d4b9b[_0x089e('0x1c')][_0x089e('0x44')]=htmlToText[_0x089e('0x7b')](_0x5d4b9b[_0x089e('0x1c')][_0x089e('0x44')]);return respondWithRpcPromise('EventManager',_0x089e('0x7c'),{'event':'acceptmessage','message':_0x5d4b9b['message']},client9002)[_0x089e('0x13')](function(){return _0x5d4b9b;});}return _0x5d4b9b;}return null;})[_0x089e('0x13')](respondWithResult(_0x5b6bc5,null))['catch'](handleError(_0x5b6bc5,null));};exports['reject']=function(_0x1f689f,_0x34e5b1){var _0x37cd22={'agent':{},'channel':_0x089e('0x7d')};if(_0x1f689f[_0x089e('0x44')]['id']){delete _0x1f689f[_0x089e('0x44')]['id'];}_0x1f689f[_0x089e('0x44')]['UserId']=_0x1f689f[_0x089e('0x44')]['UserId']||_0x1f689f[_0x089e('0x69')]['id'];_0x37cd22['agent']['id']=_0x1f689f[_0x089e('0x44')][_0x089e('0x61')];return db[_0x089e('0x2b')][_0x089e('0x45')]({'where':{'id':_0x1f689f[_0x089e('0x46')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x34e5b1,null))['then'](function(_0x2aca70){if(_0x2aca70){_0x37cd22['message']=_0x2aca70['get']({'plain':!![]});return db[_0x089e('0x63')][_0x089e('0x45')]({'where':{'id':_0x2aca70[_0x089e('0x7e')]}});}return null;})['then'](handleEntityNotFound(_0x34e5b1,null))[_0x089e('0x13')](function(_0x38b1f6){if(_0x38b1f6){_0x37cd22[_0x089e('0x66')]=_0x38b1f6[_0x089e('0x67')]({'plain':!![]});interaction_log[_0x089e('0x14')](_0x089e('0x7f'),_0x1f689f[_0x089e('0x69')]['id'],_0x1f689f['user']['name'],_0x1f689f[_0x089e('0x69')][_0x089e('0x6a')],_0x37cd22[_0x089e('0x66')]['id'],_0x1f689f[_0x089e('0x44')]?JSON[_0x089e('0x19')](_0x1f689f['body']):_0x089e('0x80'));return respondWithRpcPromise('RejectMessage',_0x089e('0x81'),_0x37cd22);}return null;})[_0x089e('0x13')](function(_0x388c21){var _0x273e97=_0x089e('0x6c')+_0x388c21[_0x089e('0x1c')]['ContactId'];return db['sequelize'][_0x089e('0x2f')](_0x273e97,{'type':db[_0x089e('0x6f')][_0x089e('0x70')][_0x089e('0x71')],'raw':!![]})[_0x089e('0x13')](function(_0x49ae1d){return _0x49ae1d;});})[_0x089e('0x13')](function(_0x3fdcf9){if(_0x3fdcf9){_0x37cd22[_0x089e('0x1c')]['contact']=_0x3fdcf9[0x0];if(!_0x1f689f[_0x089e('0x44')]['UserId'])return;return db[_0x089e('0x82')]['find']({'where':{'id':_0x1f689f['body']['UserId'],'role':'agent'},'attributes':['id',_0x089e('0x29'),_0x089e('0x72'),'email',_0x089e('0x83')],'raw':!![]});}return null;})[_0x089e('0x13')](function(_0x109be5){if(!_0x109be5)return null;_0x37cd22[_0x089e('0x1c')][_0x089e('0x62')]=_0x109be5;return _0x37cd22;})[_0x089e('0x13')](function(_0x197887){if(_0x197887){_0x197887['message'][_0x089e('0x75')]=util[_0x089e('0x5d')](_0x089e('0x76'),_0x1f689f[_0x089e('0x69')]['name']);_0x197887[_0x089e('0x1c')][_0x089e('0x77')]=_0x37cd22[_0x089e('0x77')];_0x197887[_0x089e('0x1c')][_0x089e('0x78')]=_0x37cd22['channel'];_0x197887[_0x089e('0x1c')]['event']=_0x089e('0x84');_0x197887[_0x089e('0x1c')][_0x089e('0x44')]=htmlToText[_0x089e('0x7b')](_0x37cd22[_0x089e('0x1c')][_0x089e('0x44')]);respondWithRpcPromise(_0x089e('0x7c'),_0x089e('0x7c'),{'event':_0x089e('0x85'),'message':_0x197887['message']},client9002);return _0x37cd22;}return null;})[_0x089e('0x13')](respondWithResult(_0x34e5b1,null))[_0x089e('0x1d')](handleError(_0x34e5b1,null));};exports[_0x089e('0x86')]=function(_0x12c46b,_0x1d8354){var _0x561227=moment()['unix']()[_0x089e('0x87')]();var _0x392e9b=path[_0x089e('0x58')](config['root'],_0x089e('0x88'),_0x089e('0x89'),_0x089e('0x8a'));var _0x370642=path['join'](config[_0x089e('0x59')],_0x089e('0x88'),_0x089e('0x89'),_0x089e('0x57'));var _0x23464d=util['format']('message-%s.eml',_0x561227);return db[_0x089e('0x2b')]['find']({'where':{'id':_0x12c46b['params']['id']},'attributes':['id',_0x089e('0x44'),_0x089e('0x8b'),'to','cc','bcc','subject',_0x089e('0x8c')],'include':_0x12c46b[_0x089e('0x2f')][_0x089e('0x57')]?[{'model':db[_0x089e('0x8d')],'as':_0x089e('0x8e')}]:undefined})[_0x089e('0x13')](handleEntityNotFound(_0x1d8354,null))[_0x089e('0x13')](function(_0x4aa4dd){if(_0x4aa4dd){var _0x21eaf5=_0x4aa4dd;var _0x555b8a={'from':_0x21eaf5[_0x089e('0x8b')],'to':_0x21eaf5['to'],'subject':_0x21eaf5[_0x089e('0x8f')],'html':htmlEntities[_0x089e('0x90')](_0x21eaf5[_0x089e('0x44')]),'headers':{'Date':moment(_0x21eaf5[_0x089e('0x8c')])[_0x089e('0x5d')](_0x089e('0x91'))},'attachments':[]};if(_0x4aa4dd['cc']){_0x555b8a['headers']['Cc']=_0x4aa4dd['cc'];}if(_0x4aa4dd[_0x089e('0x92')]){_0x555b8a[_0x089e('0x93')]['Bcc']=_0x4aa4dd['bcc'];}return new BPromise(function(_0x1a18ac,_0x11c2ae){if(_0x4aa4dd['Attachments']){for(var _0x48419f=0x0;_0x48419f<_0x4aa4dd[_0x089e('0x8e')][_0x089e('0x32')];_0x48419f++){var _0x471c33=_0x4aa4dd['Attachments'][_0x48419f];var _0x1f3433=path[_0x089e('0x58')](_0x370642,_0x471c33[_0x089e('0x94')]);if(fs['existsSync'](_0x1f3433)){_0x555b8a['attachments'][_0x089e('0x95')]({'name':_0x471c33[_0x089e('0x29')],'contentType':_0x471c33[_0x089e('0x3a')],'data':fs[_0x089e('0x96')](_0x1f3433)});}}}emlformat[_0x089e('0x97')](_0x555b8a,function(_0x1c1f0b,_0x2b9753){if(_0x1c1f0b)return _0x11c2ae(_0x1c1f0b);fs[_0x089e('0x98')](path[_0x089e('0x58')](_0x392e9b,_0x23464d),_0x2b9753);return _0x1a18ac(_0x2b9753);});});}})[_0x089e('0x13')](function(_0x532fb5){if(_0x532fb5){return _0x1d8354['download'](path[_0x089e('0x58')](_0x392e9b,_0x23464d),_0x23464d,function(_0x167e3e){if(!_0x167e3e)fs['unlinkSync'](path['join'](_0x392e9b,_0x23464d));});}})[_0x089e('0x1d')](handleError(_0x1d8354,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 6f3cc9c..234fac9 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 _0x599a=['remove','emit','hasOwnProperty','events','../../mysqldb','setMaxListeners','update'];(function(_0x74745d,_0x177606){var _0x174ab3=function(_0x1c94e9){while(--_0x1c94e9){_0x74745d['push'](_0x74745d['shift']());}};_0x174ab3(++_0x177606);}(_0x599a,0x10d));var _0xa599=function(_0x381589,_0x27a707){_0x381589=_0x381589-0x0;var _0x2a075d=_0x599a[_0x381589];return _0x2a075d;};'use strict';var EventEmitter=require(_0xa599('0x0'));var MailMessage=require(_0xa599('0x1'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xa599('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa599('0x3'),'afterDestroy':_0xa599('0x4')};function emitEvent(_0x252a97){return function(_0x4ece5b,_0x53dbdb,_0x2eb19a){MailMessageEvents[_0xa599('0x5')](_0x252a97+':'+_0x4ece5b['id'],_0x4ece5b);MailMessageEvents[_0xa599('0x5')](_0x252a97,_0x4ece5b);_0x2eb19a(null);};}for(var e in events){if(events[_0xa599('0x6')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module['exports']=MailMessageEvents; \ No newline at end of file +var _0x13b3=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','MailMessage'];(function(_0x4dab92,_0x159133){var _0x2e6852=function(_0x159316){while(--_0x159316){_0x4dab92['push'](_0x4dab92['shift']());}};_0x2e6852(++_0x159133);}(_0x13b3,0x152));var _0x313b=function(_0x243bba,_0x1ea69f){_0x243bba=_0x243bba-0x0;var _0x12e696=_0x13b3[_0x243bba];return _0x12e696;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0x313b('0x0'))['db'][_0x313b('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x313b('0x2')](0x0);var events={'afterCreate':_0x313b('0x3'),'afterUpdate':_0x313b('0x4'),'afterDestroy':_0x313b('0x5')};function emitEvent(_0x462689){return function(_0x3a5b96,_0x1f48f0,_0x220581){MailMessageEvents[_0x313b('0x6')](_0x462689+':'+_0x3a5b96['id'],_0x3a5b96);MailMessageEvents[_0x313b('0x6')](_0x462689,_0x3a5b96);_0x220581(null);};}for(var e in events){if(events[_0x313b('0x7')](e)){var event=events[e];MailMessage[_0x313b('0x8')](e,emitEvent(event));}}module[_0x313b('0x9')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index a7c7991..8342368 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 _0xa634=['createdAt','catch','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','html-to-text','path','rimraf','../../config/environment','exports','define','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','models','get','direction','toLowerCase','out','secret','UserId','MailInteraction','findOne','MailInteractionId','then'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa634,0x83));var _0x4a63=function(_0x41822c,_0xf2e633){_0x41822c=_0x41822c-0x0;var _0x3f187f=_0xa634[_0x41822c];return _0x3f187f;};'use strict';var _=require(_0x4a63('0x0'));var util=require(_0x4a63('0x1'));var logger=require(_0x4a63('0x2'))(_0x4a63('0x3'));var moment=require('moment');var BPromise=require(_0x4a63('0x4'));var rp=require(_0x4a63('0x5'));var htmlToText=require(_0x4a63('0x6'));var fs=require('fs');var path=require(_0x4a63('0x7'));var rimraf=require(_0x4a63('0x8'));var config=require(_0x4a63('0x9'));var attributes=require('./mailMessage.attributes');module[_0x4a63('0xa')]=function(_0x17651f,_0xa59b83){return _0x17651f[_0x4a63('0xb')]('MailMessage',attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0x4a63('0xc'),'fields':[_0x4a63('0xc')]},{'name':_0x4a63('0xd'),'fields':[_0x4a63('0xe'),_0x4a63('0xf')],'type':_0x4a63('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x20fa5d,_0x211fee,_0x4ff3e7){if(_0x20fa5d[_0x4a63('0x11')]){_0x20fa5d[_0x4a63('0xe')]=htmlToText['fromString'](_0x20fa5d[_0x4a63('0x11')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x4ff3e7(null,_0x211fee);},'afterCreate':function(_0x579161,_0x4d6eb1,_0x78d567){var _0x25207c=_0x17651f[_0x4a63('0x12')];var _0x1cb437=_0x579161[_0x4a63('0x13')]({'plain':!![]});if(_0x1cb437[_0x4a63('0x14')][_0x4a63('0x15')]()==='in'||_0x1cb437['direction'][_0x4a63('0x15')]()===_0x4a63('0x16')&&!_0x1cb437[_0x4a63('0x17')]&&!_['isNil'](_0x1cb437[_0x4a63('0x18')])){_0x25207c[_0x4a63('0x19')][_0x4a63('0x1a')]({'where':{'id':_0x1cb437[_0x4a63('0x1b')]}})[_0x4a63('0x1c')](function(_0x52667a){if(_0x52667a){_0x52667a['update']({'lastMsgAt':_0x1cb437[_0x4a63('0x1d')],'lastMsgDirection':_0x1cb437['direction']['toLowerCase']()});}})[_0x4a63('0x1e')](function(_0x267555){console['error'](_0x267555);});}_0x78d567();}},'charset':'utf8mb4','collate':_0x4a63('0x1f')});}; \ No newline at end of file +var _0x6c32=['FULLTEXT','body','fromString','models','get','direction','toLowerCase','out','secret','UserId','MailInteraction','findOne','MailInteractionId','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','rimraf','./mailMessage.attributes','define','MailMessage','messageId','fti_mail_messages','plainBody','subject'];(function(_0x3e4760,_0x3e93ef){var _0x14a59a=function(_0x4eae80){while(--_0x4eae80){_0x3e4760['push'](_0x3e4760['shift']());}};_0x14a59a(++_0x3e93ef);}(_0x6c32,0xb3));var _0x26c3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6c32[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x26c3('0x0'));var util=require(_0x26c3('0x1'));var logger=require(_0x26c3('0x2'))(_0x26c3('0x3'));var moment=require('moment');var BPromise=require(_0x26c3('0x4'));var rp=require('request-promise');var htmlToText=require('html-to-text');var fs=require('fs');var path=require('path');var rimraf=require(_0x26c3('0x5'));var config=require('../../config/environment');var attributes=require(_0x26c3('0x6'));module['exports']=function(_0x11ced6,_0x288b16){return _0x11ced6[_0x26c3('0x7')](_0x26c3('0x8'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0x26c3('0x9'),'fields':[_0x26c3('0x9')]},{'name':_0x26c3('0xa'),'fields':[_0x26c3('0xb'),_0x26c3('0xc')],'type':_0x26c3('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x25d8d2,_0x9a154f,_0xe27d72){if(_0x25d8d2[_0x26c3('0xe')]){_0x25d8d2[_0x26c3('0xb')]=htmlToText[_0x26c3('0xf')](_0x25d8d2['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0xe27d72(null,_0x9a154f);},'afterCreate':function(_0x297c89,_0x1fce6d,_0xb5e387){var _0x599a52=_0x11ced6[_0x26c3('0x10')];var _0x4377b3=_0x297c89[_0x26c3('0x11')]({'plain':!![]});if(_0x4377b3[_0x26c3('0x12')][_0x26c3('0x13')]()==='in'||_0x4377b3[_0x26c3('0x12')]['toLowerCase']()===_0x26c3('0x14')&&!_0x4377b3[_0x26c3('0x15')]&&!_['isNil'](_0x4377b3[_0x26c3('0x16')])){_0x599a52[_0x26c3('0x17')][_0x26c3('0x18')]({'where':{'id':_0x4377b3[_0x26c3('0x19')]}})[_0x26c3('0x1a')](function(_0x12d11e){if(_0x12d11e){_0x12d11e[_0x26c3('0x1b')]({'lastMsgAt':_0x4377b3[_0x26c3('0x1c')],'lastMsgDirection':_0x4377b3[_0x26c3('0x12')][_0x26c3('0x13')]()});}})[_0x26c3('0x1d')](function(_0x2b28b7){console['error'](_0x2b28b7);});}_0xb5e387();}},'charset':_0x26c3('0x1e'),'collate':_0x26c3('0x1f')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 9c79450..4e41f77 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 _0x5c3c=['../../config/environment','jayson/promise','client','http','localhost','socket.io-emitter','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','CreateMailMessage','MailMessage','create','options','raw','stringify','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x4bbcc7,_0x28341a){var _0x3d032b=function(_0x53228b){while(--_0x53228b){_0x4bbcc7['push'](_0x4bbcc7['shift']());}};_0x3d032b(++_0x28341a);}(_0x5c3c,0x132));var _0xc5c3=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x5c3c[_0x126558];return _0x1f6d14;};'use strict';var _=require(_0xc5c3('0x0'));var util=require(_0xc5c3('0x1'));var moment=require(_0xc5c3('0x2'));var BPromise=require(_0xc5c3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc5c3('0x4'));var db=require(_0xc5c3('0x5'))['db'];var utils=require(_0xc5c3('0x6'));var logger=require(_0xc5c3('0x7'))(_0xc5c3('0x8'));var config=require(_0xc5c3('0x9'));var jayson=require(_0xc5c3('0xa'));var client=jayson[_0xc5c3('0xb')][_0xc5c3('0xc')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xc5c3('0xd'),'port':0x18eb});var socket=require(_0xc5c3('0xe'))(new Redis(config['redis']));require(_0xc5c3('0xf'))[_0xc5c3('0x10')](socket);function respondWithRpcPromise(_0x52f3eb,_0x14140f,_0x2a1d19){return new BPromise(function(_0x4e329f,_0x1f2e34){return client[_0xc5c3('0x11')](_0x52f3eb,_0x2a1d19)[_0xc5c3('0x12')](function(_0x59fb60){logger[_0xc5c3('0x13')](_0xc5c3('0x14'),_0x14140f,'request\x20sent');logger[_0xc5c3('0x15')](_0xc5c3('0x16'),_0x14140f,_0xc5c3('0x17'),JSON['stringify'](_0x59fb60));if(_0x59fb60[_0xc5c3('0x18')]){if(_0x59fb60[_0xc5c3('0x18')][_0xc5c3('0x19')]===0x1f4){logger[_0xc5c3('0x18')](_0xc5c3('0x14'),_0x14140f,_0x59fb60['error']['message']);return _0x1f2e34(_0x59fb60[_0xc5c3('0x18')][_0xc5c3('0x1a')]);}logger[_0xc5c3('0x18')](_0xc5c3('0x14'),_0x14140f,_0x59fb60['error']['message']);return _0x4e329f(_0x59fb60[_0xc5c3('0x18')]['message']);}else{logger[_0xc5c3('0x13')](_0xc5c3('0x14'),_0x14140f,_0xc5c3('0x17'));_0x4e329f(_0x59fb60[_0xc5c3('0x1b')][_0xc5c3('0x1a')]);}})['catch'](function(_0x364f42){logger[_0xc5c3('0x18')](_0xc5c3('0x14'),_0x14140f,_0x364f42);_0x1f2e34(_0x364f42);});});}exports[_0xc5c3('0x1c')]=function(_0x4e570f){var _0x25ef16=this;return new Promise(function(_0x41578a,_0x3cc612){return db[_0xc5c3('0x1d')][_0xc5c3('0x1e')](_0x4e570f['body'],{'raw':_0x4e570f[_0xc5c3('0x1f')]?_0x4e570f[_0xc5c3('0x1f')][_0xc5c3('0x20')]===undefined?!![]:![]:!![]})[_0xc5c3('0x12')](function(_0x1c5793){logger[_0xc5c3('0x13')](_0xc5c3('0x1c'),_0x4e570f);logger['debug']('CreateMailMessage',_0x4e570f,JSON[_0xc5c3('0x21')](_0x1c5793));_0x41578a(_0x1c5793);})[_0xc5c3('0x22')](function(_0x53ab72){logger['error'](_0xc5c3('0x1c'),_0x53ab72[_0xc5c3('0x1a')],_0x4e570f);_0x3cc612(_0x25ef16[_0xc5c3('0x18')](0x1f4,_0x53ab72['message']));});});}; \ No newline at end of file +var _0xb62e=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','request','then','info','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateMailMessage','MailMessage','options','raw','lodash','util'];(function(_0x56547a,_0x582fb1){var _0x4eaf72=function(_0x23a774){while(--_0x23a774){_0x56547a['push'](_0x56547a['shift']());}};_0x4eaf72(++_0x582fb1);}(_0xb62e,0x1de));var _0xeb62=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xb62e[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0xeb62('0x0'));var util=require(_0xeb62('0x1'));var moment=require(_0xeb62('0x2'));var BPromise=require(_0xeb62('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xeb62('0x4'));var db=require(_0xeb62('0x5'))['db'];var utils=require(_0xeb62('0x6'));var logger=require(_0xeb62('0x7'))(_0xeb62('0x8'));var config=require(_0xeb62('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xeb62('0xa')][_0xeb62('0xb')]({'port':0x232a});config[_0xeb62('0xc')]=_['defaults'](config[_0xeb62('0xc')],{'host':_0xeb62('0xd'),'port':0x18eb});var socket=require(_0xeb62('0xe'))(new Redis(config[_0xeb62('0xc')]));require('./mailMessage.socket')['register'](socket);function respondWithRpcPromise(_0x4693c9,_0x40584b,_0x6d5e94){return new BPromise(function(_0xf93c21,_0x2fe923){return client[_0xeb62('0xf')](_0x4693c9,_0x6d5e94)[_0xeb62('0x10')](function(_0x3a826a){logger[_0xeb62('0x11')](_0xeb62('0x12'),_0x40584b,'request\x20sent');logger[_0xeb62('0x13')](_0xeb62('0x14'),_0x40584b,_0xeb62('0x15'),JSON[_0xeb62('0x16')](_0x3a826a));if(_0x3a826a['error']){if(_0x3a826a[_0xeb62('0x17')][_0xeb62('0x18')]===0x1f4){logger[_0xeb62('0x17')]('MailMessage,\x20%s,\x20%s',_0x40584b,_0x3a826a[_0xeb62('0x17')][_0xeb62('0x19')]);return _0x2fe923(_0x3a826a[_0xeb62('0x17')]['message']);}logger[_0xeb62('0x17')](_0xeb62('0x12'),_0x40584b,_0x3a826a[_0xeb62('0x17')][_0xeb62('0x19')]);return _0xf93c21(_0x3a826a[_0xeb62('0x17')][_0xeb62('0x19')]);}else{logger[_0xeb62('0x11')](_0xeb62('0x12'),_0x40584b,_0xeb62('0x15'));_0xf93c21(_0x3a826a[_0xeb62('0x1a')][_0xeb62('0x19')]);}})[_0xeb62('0x1b')](function(_0x3cdf76){logger['error'](_0xeb62('0x12'),_0x40584b,_0x3cdf76);_0x2fe923(_0x3cdf76);});});}exports[_0xeb62('0x1c')]=function(_0x332396){var _0xb44905=this;return new Promise(function(_0x425817,_0x24cbf3){return db[_0xeb62('0x1d')]['create'](_0x332396['body'],{'raw':_0x332396[_0xeb62('0x1e')]?_0x332396[_0xeb62('0x1e')][_0xeb62('0x1f')]===undefined?!![]:![]:!![]})[_0xeb62('0x10')](function(_0x122b15){logger['info']('CreateMailMessage',_0x332396);logger[_0xeb62('0x13')](_0xeb62('0x1c'),_0x332396,JSON[_0xeb62('0x16')](_0x122b15));_0x425817(_0x122b15);})[_0xeb62('0x1b')](function(_0x55a169){logger['error'](_0xeb62('0x1c'),_0x55a169['message'],_0x332396);_0x24cbf3(_0xb44905[_0xeb62('0x17')](0x1f4,_0x55a169['message']));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index b0b1ef0..3083ba7 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 _0xeaab=['remove','update','emit','length','mailMessage:','save'];(function(_0x39d38e,_0x3da1f7){var _0x18e737=function(_0x373eef){while(--_0x373eef){_0x39d38e['push'](_0x39d38e['shift']());}};_0x18e737(++_0x3da1f7);}(_0xeaab,0x83));var _0xbeaa=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xeaab[_0x19e35c];return _0x3e1fe8;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=[_0xbeaa('0x0'),_0xbeaa('0x1'),_0xbeaa('0x2')];function createListener(_0x2662ab,_0x188277){return function(_0x5da08a){_0x188277[_0xbeaa('0x3')](_0x2662ab,_0x5da08a);};}function removeListener(_0x266fae,_0x47e5d1){return function(){MailMessageEvents['removeListener'](_0x266fae,_0x47e5d1);};}exports['register']=function(_0x5ac8d6){for(var _0x3ea3d=0x0,_0x243790=events[_0xbeaa('0x4')];_0x3ea3d<_0x243790;_0x3ea3d++){var _0x567d31=events[_0x3ea3d];var _0x352dd9=createListener(_0xbeaa('0x5')+_0x567d31,_0x5ac8d6);MailMessageEvents['on'](_0x567d31,_0x352dd9);}}; \ No newline at end of file +var _0xa67b=['length','mailMessage:','./mailMessage.events','save','remove','update','emit','removeListener'];(function(_0x1c6a65,_0x270fc0){var _0x24baea=function(_0x54f4b4){while(--_0x54f4b4){_0x1c6a65['push'](_0x1c6a65['shift']());}};_0x24baea(++_0x270fc0);}(_0xa67b,0x14a));var _0xba67=function(_0x5ad511,_0x2d4ac8){_0x5ad511=_0x5ad511-0x0;var _0x5ebba9=_0xa67b[_0x5ad511];return _0x5ebba9;};'use strict';var MailMessageEvents=require(_0xba67('0x0'));var events=[_0xba67('0x1'),_0xba67('0x2'),_0xba67('0x3')];function createListener(_0x308f25,_0x1305aa){return function(_0x5c8d14){_0x1305aa[_0xba67('0x4')](_0x308f25,_0x5c8d14);};}function removeListener(_0xf3a588,_0x5be871){return function(){MailMessageEvents[_0xba67('0x5')](_0xf3a588,_0x5be871);};}exports['register']=function(_0x39baa2){for(var _0x351b19=0x0,_0x256949=events[_0xba67('0x6')];_0x351b19<_0x256949;_0x351b19++){var _0xd4a20d=events[_0x351b19];var _0x26e7f2=createListener(_0xba67('0x7')+_0xd4a20d,_0x39baa2);MailMessageEvents['on'](_0xd4a20d,_0x26e7f2);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 379f1ef..97dab96 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 _0x436e=['/:id/teams','/:id/users','post','create','addTeams','put','update','delete','destroy','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers'];(function(_0x428ef4,_0x58e9fd){var _0x550e79=function(_0x36560b){while(--_0x36560b){_0x428ef4['push'](_0x428ef4['shift']());}};_0x550e79(++_0x58e9fd);}(_0x436e,0x1e7));var _0xe436=function(_0x55a53b,_0x1bf03a){_0x55a53b=_0x55a53b-0x0;var _0x120ec6=_0x436e[_0x55a53b];return _0x120ec6;};'use strict';var multer=require(_0xe436('0x0'));var util=require(_0xe436('0x1'));var path=require(_0xe436('0x2'));var timeout=require(_0xe436('0x3'));var express=require('express');var router=express[_0xe436('0x4')]();var fs_extra=require(_0xe436('0x5'));var auth=require(_0xe436('0x6'));var interaction=require(_0xe436('0x7'));var config=require('../../config/environment');var controller=require(_0xe436('0x8'));router[_0xe436('0x9')]('/',auth[_0xe436('0xa')](),controller[_0xe436('0xb')]);router['get'](_0xe436('0xc'),auth['isAuthenticated'](),controller[_0xe436('0xd')]);router[_0xe436('0x9')](_0xe436('0xe'),auth[_0xe436('0xa')](),controller[_0xe436('0xf')]);router[_0xe436('0x9')]('/:id/members',auth[_0xe436('0xa')](),controller[_0xe436('0x10')]);router[_0xe436('0x9')](_0xe436('0x11'),auth['isAuthenticated'](),controller['getTeams']);router[_0xe436('0x9')](_0xe436('0x12'),auth['isAuthenticated'](),controller['getAgents']);router[_0xe436('0x13')]('/',auth['isAuthenticated'](),controller[_0xe436('0x14')]);router[_0xe436('0x13')]('/:id/teams',auth['isAuthenticated'](),controller[_0xe436('0x15')]);router[_0xe436('0x13')]('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0xe436('0x16')](_0xe436('0xe'),auth[_0xe436('0xa')](),controller[_0xe436('0x17')]);router[_0xe436('0x18')](_0xe436('0xe'),auth[_0xe436('0xa')](),controller[_0xe436('0x19')]);router[_0xe436('0x18')]('/:id/teams',auth[_0xe436('0xa')](),controller['removeTeams']);router[_0xe436('0x18')](_0xe436('0x12'),auth[_0xe436('0xa')](),controller[_0xe436('0x1a')]);module[_0xe436('0x1b')]=router; \ No newline at end of file +var _0xa2ec=['../../config/environment','./mailQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','create','post','addTeams','addAgents','put','update','delete','destroy','removeTeams','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x6d1ce8,_0x519a8f){var _0x5e26b7=function(_0x45beb3){while(--_0x45beb3){_0x6d1ce8['push'](_0x6d1ce8['shift']());}};_0x5e26b7(++_0x519a8f);}(_0xa2ec,0xff));var _0xca2e=function(_0x5257bf,_0xf39844){_0x5257bf=_0x5257bf-0x0;var _0x30f32b=_0xa2ec[_0x5257bf];return _0x30f32b;};'use strict';var multer=require(_0xca2e('0x0'));var util=require(_0xca2e('0x1'));var path=require(_0xca2e('0x2'));var timeout=require(_0xca2e('0x3'));var express=require(_0xca2e('0x4'));var router=express[_0xca2e('0x5')]();var fs_extra=require(_0xca2e('0x6'));var auth=require(_0xca2e('0x7'));var interaction=require(_0xca2e('0x8'));var config=require(_0xca2e('0x9'));var controller=require(_0xca2e('0xa'));router[_0xca2e('0xb')]('/',auth[_0xca2e('0xc')](),controller[_0xca2e('0xd')]);router[_0xca2e('0xb')](_0xca2e('0xe'),auth['isAuthenticated'](),controller[_0xca2e('0xf')]);router[_0xca2e('0xb')](_0xca2e('0x10'),auth[_0xca2e('0xc')](),controller[_0xca2e('0x11')]);router[_0xca2e('0xb')](_0xca2e('0x12'),auth[_0xca2e('0xc')](),controller[_0xca2e('0x13')]);router['get'](_0xca2e('0x14'),auth[_0xca2e('0xc')](),controller[_0xca2e('0x15')]);router[_0xca2e('0xb')](_0xca2e('0x16'),auth[_0xca2e('0xc')](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0xca2e('0x17')]);router[_0xca2e('0x18')]('/:id/teams',auth[_0xca2e('0xc')](),controller[_0xca2e('0x19')]);router['post'](_0xca2e('0x16'),auth[_0xca2e('0xc')](),controller[_0xca2e('0x1a')]);router[_0xca2e('0x1b')]('/:id',auth['isAuthenticated'](),controller[_0xca2e('0x1c')]);router[_0xca2e('0x1d')](_0xca2e('0x10'),auth[_0xca2e('0xc')](),controller[_0xca2e('0x1e')]);router[_0xca2e('0x1d')](_0xca2e('0x14'),auth['isAuthenticated'](),controller[_0xca2e('0x1f')]);router['delete']('/:id/users',auth[_0xca2e('0xc')](),controller['removeAgents']);module[_0xca2e('0x20')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 434e02b..c0feef3 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 _0x4047=['rrmemory','beepall','roundrobin','sequelize','STRING','name','INTEGER'];(function(_0x13b2f5,_0x169e59){var _0x57aba9=function(_0x547f84){while(--_0x547f84){_0x13b2f5['push'](_0x13b2f5['shift']());}};_0x57aba9(++_0x169e59);}(_0x4047,0xf1));var _0x7404=function(_0x3a738b,_0x1b92b3){_0x3a738b=_0x3a738b-0x0;var _0x4f052b=_0x4047[_0x3a738b];return _0x4f052b;};'use strict';var Sequelize=require(_0x7404('0x0'));module['exports']={'name':{'type':Sequelize[_0x7404('0x1')],'unique':_0x7404('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x7404('0x1')]},'timeout':{'type':Sequelize[_0x7404('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x7404('0x4'),_0x7404('0x5'),_0x7404('0x6'))}}; \ No newline at end of file +var _0x2a4c=['roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory','beepall'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x2a4c,0x157));var _0xc2a4=function(_0x492eaf,_0x1608b1){_0x492eaf=_0x492eaf-0x0;var _0x105100=_0x2a4c[_0x492eaf];return _0x105100;};'use strict';var Sequelize=require(_0xc2a4('0x0'));module[_0xc2a4('0x1')]={'name':{'type':Sequelize[_0xc2a4('0x2')],'unique':_0xc2a4('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc2a4('0x2')]},'timeout':{'type':Sequelize[_0xc2a4('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc2a4('0x5')](_0xc2a4('0x6'),_0xc2a4('0x7'),_0xc2a4('0x8'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 8ffd041..cd15161 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 _0x94cd=['updatedAt','getTeams','findOne','Team','addTeams','Agents','online','voicePause','flatMap','sequelize','transaction','each','findOrCreate','emit','userMailQueue:save','ids','field','tq.TeamId','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','all','union','value','removeAgents','forEach','userMailQueue:remove','addAgents','spread','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','./mailQueue.socket','register','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','get','UserProfileResource','sendStatus','error','name','MailQueue','rawAttributes','type','key','keys','query','intersection','attributes','fields','length','model','nolimit','order','sort','filters','pick','filter','where','merge','map','VIRTUAL','options','includeAll','findAll','rows','catch','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','MailQueues','UserProfileSection','userProfileId','autoAssociation','params','describe','getMembers','UserMailQueue','hasOwnProperty','MailQueueId','User','findAndCountAll','UserId','agent','createdAt','format','SIP','mailPause'];(function(_0x5ac4b6,_0x4d9360){var _0x29ced8=function(_0x4fdcb6){while(--_0x4fdcb6){_0x5ac4b6['push'](_0x5ac4b6['shift']());}};_0x29ced8(++_0x4d9360);}(_0x94cd,0xb0));var _0xd94c=function(_0x25df5c,_0x5603cd){_0x25df5c=_0x25df5c-0x0;var _0x482fde=_0x94cd[_0x25df5c];return _0x482fde;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd94c('0x0'));var zipdir=require(_0xd94c('0x1'));var jsonpatch=require(_0xd94c('0x2'));var rp=require(_0xd94c('0x3'));var moment=require(_0xd94c('0x4'));var BPromise=require(_0xd94c('0x5'));var Mustache=require(_0xd94c('0x6'));var util=require(_0xd94c('0x7'));var path=require(_0xd94c('0x8'));var sox=require(_0xd94c('0x9'));var csv=require(_0xd94c('0xa'));var ejs=require(_0xd94c('0xb'));var fs=require('fs');var fs_extra=require(_0xd94c('0xc'));var _=require(_0xd94c('0xd'));var squel=require(_0xd94c('0xe'));var crypto=require(_0xd94c('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xd94c('0x10'));var toCsv=require(_0xd94c('0xa'));var querystring=require(_0xd94c('0x11'));var Papa=require(_0xd94c('0x12'));var Redis=require(_0xd94c('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xd94c('0x14'));var as=require(_0xd94c('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd94c('0x16'))(_0xd94c('0x17'));var utils=require(_0xd94c('0x18'));var config=require(_0xd94c('0x19'));var licenseUtil=require(_0xd94c('0x1a'));var db=require(_0xd94c('0x1b'))['db'];config['redis']=_[_0xd94c('0x1c')](config[_0xd94c('0x1d')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xd94c('0x1e'))[_0xd94c('0x1f')](socket);function respondWithStatusCode(_0x4ed064,_0x3d15ab){_0x3d15ab=_0x3d15ab||0xcc;return function(_0x5bd271){if(_0x5bd271){return _0x4ed064['sendStatus'](_0x3d15ab);}return _0x4ed064[_0xd94c('0x20')](_0x3d15ab)[_0xd94c('0x21')]();};}function respondWithResult(_0x174656,_0xb49742){_0xb49742=_0xb49742||0xc8;return function(_0x172e34){if(_0x172e34){return _0x174656[_0xd94c('0x20')](_0xb49742)[_0xd94c('0x22')](_0x172e34);}};}function respondWithFilteredResult(_0x5c1f51,_0x338bb4){return function(_0x34280e){if(_0x34280e){var _0x4c02bd=typeof _0x338bb4[_0xd94c('0x23')]===_0xd94c('0x24')&&typeof _0x338bb4[_0xd94c('0x25')]===_0xd94c('0x24');var _0x3b5dcb=_0x34280e[_0xd94c('0x26')];var _0x3e9e56=_0x4c02bd?0x0:_0x338bb4[_0xd94c('0x23')];var _0x3985f5=_0x4c02bd?_0x34280e['count']:_0x338bb4[_0xd94c('0x23')]+_0x338bb4[_0xd94c('0x25')];var _0x10fd7b;if(_0x3985f5>=_0x3b5dcb){_0x3985f5=_0x3b5dcb;_0x10fd7b=0xc8;}else{_0x10fd7b=0xce;}_0x5c1f51[_0xd94c('0x20')](_0x10fd7b);return _0x5c1f51[_0xd94c('0x27')]('Content-Range',_0x3e9e56+'-'+_0x3985f5+'/'+_0x3b5dcb)[_0xd94c('0x22')](_0x34280e);}return null;};}function patchUpdates(_0x462d49){return function(_0x5a17ff){try{jsonpatch[_0xd94c('0x28')](_0x5a17ff,_0x462d49,!![]);}catch(_0x1ee36e){return BPromise['reject'](_0x1ee36e);}return _0x5a17ff[_0xd94c('0x29')]();};}function saveUpdates(_0x530f5a,_0x276cc9){return function(_0x28acae){if(_0x28acae){return _0x28acae[_0xd94c('0x2a')](_0x530f5a)[_0xd94c('0x2b')](function(_0x589713){return _0x589713;});}return null;};}function removeEntity(_0x406cf6,_0x1eb581){return function(_0x3e075e){if(_0x3e075e){return _0x3e075e[_0xd94c('0x2c')]()[_0xd94c('0x2b')](function(){var _0x46d769=_0x3e075e[_0xd94c('0x2d')]({'plain':!![]});var _0x57bba9='MailQueues';return db[_0xd94c('0x2e')][_0xd94c('0x2c')]({'where':{'type':_0x57bba9,'resourceId':_0x46d769['id']}})['then'](function(){return _0x3e075e;});})[_0xd94c('0x2b')](function(){_0x406cf6[_0xd94c('0x20')](0xcc)[_0xd94c('0x21')]();});}};}function handleEntityNotFound(_0x292b80,_0x54244c){return function(_0x2b4fbb){if(!_0x2b4fbb){_0x292b80[_0xd94c('0x2f')](0x194);}return _0x2b4fbb;};}function handleError(_0xc97252,_0x5ab935){_0x5ab935=_0x5ab935||0x1f4;return function(_0x5a6bf3){logger[_0xd94c('0x30')](_0x5a6bf3['stack']);if(_0x5a6bf3[_0xd94c('0x31')]){delete _0x5a6bf3['name'];}_0xc97252[_0xd94c('0x20')](_0x5ab935)['send'](_0x5a6bf3);};}exports['index']=function(_0x305e96,_0x3a5664){var _0x4b1988={},_0x5ee7a9={},_0x5a5b1a={'count':0x0,'rows':[]};var _0x17d7c9=_['map'](db[_0xd94c('0x32')][_0xd94c('0x33')],function(_0x28464a){return{'name':_0x28464a['fieldName'],'type':_0x28464a[_0xd94c('0x34')][_0xd94c('0x35')]};});_0x5ee7a9['model']=_['map'](_0x17d7c9,_0xd94c('0x31'));_0x5ee7a9['query']=_[_0xd94c('0x36')](_0x305e96[_0xd94c('0x37')]);_0x5ee7a9['filters']=_[_0xd94c('0x38')](_0x5ee7a9['model'],_0x5ee7a9['query']);_0x4b1988[_0xd94c('0x39')]=_[_0xd94c('0x38')](_0x5ee7a9['model'],qs[_0xd94c('0x3a')](_0x305e96[_0xd94c('0x37')][_0xd94c('0x3a')]));_0x4b1988[_0xd94c('0x39')]=_0x4b1988[_0xd94c('0x39')][_0xd94c('0x3b')]?_0x4b1988[_0xd94c('0x39')]:_0x5ee7a9[_0xd94c('0x3c')];if(!_0x305e96[_0xd94c('0x37')]['hasOwnProperty'](_0xd94c('0x3d'))){_0x4b1988[_0xd94c('0x25')]=qs[_0xd94c('0x25')](_0x305e96[_0xd94c('0x37')][_0xd94c('0x25')]);_0x4b1988[_0xd94c('0x23')]=qs['offset'](_0x305e96['query'][_0xd94c('0x23')]);}_0x4b1988[_0xd94c('0x3e')]=qs['sort'](_0x305e96[_0xd94c('0x37')][_0xd94c('0x3f')]);_0x4b1988['where']=qs[_0xd94c('0x40')](_[_0xd94c('0x41')](_0x305e96[_0xd94c('0x37')],_0x5ee7a9[_0xd94c('0x40')]),_0x17d7c9);if(_0x305e96[_0xd94c('0x37')][_0xd94c('0x42')]){_0x4b1988[_0xd94c('0x43')]=_[_0xd94c('0x44')](_0x4b1988['where'],{'$or':_[_0xd94c('0x45')](_0x17d7c9,function(_0x1b9cc4){if(_0x1b9cc4[_0xd94c('0x34')]!==_0xd94c('0x46')){var _0x1d9052={};_0x1d9052[_0x1b9cc4[_0xd94c('0x31')]]={'$like':'%'+_0x305e96[_0xd94c('0x37')]['filter']+'%'};return _0x1d9052;}})});}_0x4b1988=_[_0xd94c('0x44')]({},_0x4b1988,_0x305e96[_0xd94c('0x47')]);var _0x6241b3={'where':_0x4b1988[_0xd94c('0x43')]};return db[_0xd94c('0x32')][_0xd94c('0x26')](_0x6241b3)[_0xd94c('0x2b')](function(_0x3f2a1c){_0x5a5b1a[_0xd94c('0x26')]=_0x3f2a1c;if(_0x305e96[_0xd94c('0x37')][_0xd94c('0x48')]){_0x4b1988['include']=[{'all':!![]}];}return db['MailQueue'][_0xd94c('0x49')](_0x4b1988);})[_0xd94c('0x2b')](function(_0x32d6c0){_0x5a5b1a[_0xd94c('0x4a')]=_0x32d6c0;return _0x5a5b1a;})[_0xd94c('0x2b')](respondWithFilteredResult(_0x3a5664,_0x4b1988))[_0xd94c('0x4b')](handleError(_0x3a5664,null));};exports['show']=function(_0xbabe78,_0x36c214){var _0x4e793b={'raw':!![],'where':{'id':_0xbabe78['params']['id']}},_0x2f463d={};_0x2f463d[_0xd94c('0x3c')]=_[_0xd94c('0x36')](db[_0xd94c('0x32')][_0xd94c('0x33')]);_0x2f463d[_0xd94c('0x37')]=_[_0xd94c('0x36')](_0xbabe78['query']);_0x2f463d['filters']=_['intersection'](_0x2f463d['model'],_0x2f463d['query']);_0x4e793b['attributes']=_['intersection'](_0x2f463d[_0xd94c('0x3c')],qs['fields'](_0xbabe78['query'][_0xd94c('0x3a')]));_0x4e793b[_0xd94c('0x39')]=_0x4e793b[_0xd94c('0x39')]['length']?_0x4e793b[_0xd94c('0x39')]:_0x2f463d['model'];if(_0xbabe78[_0xd94c('0x37')]['includeAll']){_0x4e793b['include']=[{'all':!![]}];}_0x4e793b=_[_0xd94c('0x44')]({},_0x4e793b,_0xbabe78[_0xd94c('0x47')]);return db['MailQueue'][_0xd94c('0x4c')](_0x4e793b)['then'](handleEntityNotFound(_0x36c214,null))[_0xd94c('0x2b')](respondWithResult(_0x36c214,null))[_0xd94c('0x4b')](handleError(_0x36c214,null));};exports[_0xd94c('0x4d')]=function(_0x54ccde,_0x96b6fc){return db[_0xd94c('0x32')][_0xd94c('0x4d')](_0x54ccde[_0xd94c('0x4e')],{})[_0xd94c('0x2b')](function(_0x135a3b){var _0x265b74=_0x54ccde[_0xd94c('0x4f')][_0xd94c('0x2d')]({'plain':!![]});if(!_0x265b74)throw new Error(_0xd94c('0x50'));if(_0x265b74[_0xd94c('0x51')]==='user'){var _0x35d655=_0x135a3b[_0xd94c('0x2d')]({'plain':!![]});var _0x1752d7=_0xd94c('0x52');return db[_0xd94c('0x53')][_0xd94c('0x4c')]({'where':{'name':_0x1752d7,'userProfileId':_0x265b74[_0xd94c('0x54')]},'raw':!![]})['then'](function(_0x1006c4){if(_0x1006c4&&_0x1006c4[_0xd94c('0x55')]===0x0){return db[_0xd94c('0x2e')][_0xd94c('0x4d')]({'name':_0x35d655[_0xd94c('0x31')],'resourceId':_0x35d655['id'],'type':_0x1006c4[_0xd94c('0x31')],'sectionId':_0x1006c4['id']},{})['then'](function(){return _0x135a3b;});}else{return _0x135a3b;}})[_0xd94c('0x4b')](function(_0x42476c){logger[_0xd94c('0x30')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x42476c);throw _0x42476c;});}return _0x135a3b;})['then'](respondWithResult(_0x96b6fc,0xc9))['catch'](handleError(_0x96b6fc,null));};exports[_0xd94c('0x2a')]=function(_0x1343b,_0x518b64){if(_0x1343b[_0xd94c('0x4e')]['id']){delete _0x1343b[_0xd94c('0x4e')]['id'];}return db[_0xd94c('0x32')][_0xd94c('0x4c')]({'where':{'id':_0x1343b[_0xd94c('0x56')]['id']}})[_0xd94c('0x2b')](handleEntityNotFound(_0x518b64,null))['then'](saveUpdates(_0x1343b[_0xd94c('0x4e')],null))[_0xd94c('0x2b')](respondWithResult(_0x518b64,null))[_0xd94c('0x4b')](handleError(_0x518b64,null));};exports[_0xd94c('0x2c')]=function(_0x1fdf87,_0xe00abd){return db[_0xd94c('0x32')]['find']({'where':{'id':_0x1fdf87[_0xd94c('0x56')]['id']}})[_0xd94c('0x2b')](handleEntityNotFound(_0xe00abd,null))[_0xd94c('0x2b')](removeEntity(_0xe00abd,null))[_0xd94c('0x4b')](handleError(_0xe00abd,null));};exports[_0xd94c('0x57')]=function(_0x59cea5,_0x17119f){return db['MailQueue'][_0xd94c('0x57')]()[_0xd94c('0x2b')](respondWithResult(_0x17119f,null))[_0xd94c('0x4b')](handleError(_0x17119f,null));};exports[_0xd94c('0x58')]=function(_0x3138f9,_0x229f40,_0x2a95a9){var _0x5e3509={'raw':!![],'where':{}},_0x52d632={},_0x4e72a5;return db[_0xd94c('0x32')]['findOne']({'where':{'id':_0x3138f9[_0xd94c('0x56')]['id']}})['then'](handleEntityNotFound(_0x229f40,null))['then'](function(_0x2a4357){if(_0x2a4357){_0x4e72a5=_0x2a4357[_0xd94c('0x2d')]({'plain':!![]});_0x52d632['model']=_[_0xd94c('0x36')](db[_0xd94c('0x59')][_0xd94c('0x33')]);_0x52d632[_0xd94c('0x37')]=_[_0xd94c('0x36')](_0x3138f9[_0xd94c('0x37')]);_0x52d632[_0xd94c('0x40')]=_[_0xd94c('0x38')](_0x52d632[_0xd94c('0x3c')],_0x52d632[_0xd94c('0x37')]);_0x5e3509[_0xd94c('0x39')]=_[_0xd94c('0x38')](_0x52d632['model'],qs[_0xd94c('0x3a')](_0x3138f9[_0xd94c('0x37')]['fields']));_0x5e3509[_0xd94c('0x39')]=_0x5e3509[_0xd94c('0x39')]['length']?_0x5e3509['attributes']:_0x52d632[_0xd94c('0x3c')];if(!_0x3138f9[_0xd94c('0x37')][_0xd94c('0x5a')](_0xd94c('0x3d'))){_0x5e3509[_0xd94c('0x25')]=qs[_0xd94c('0x25')](_0x3138f9[_0xd94c('0x37')][_0xd94c('0x25')]);_0x5e3509[_0xd94c('0x23')]=qs[_0xd94c('0x23')](_0x3138f9[_0xd94c('0x37')]['offset']);}_0x5e3509[_0xd94c('0x3e')]=qs[_0xd94c('0x3f')](_0x3138f9[_0xd94c('0x37')]['sort']);_0x5e3509[_0xd94c('0x43')]=qs[_0xd94c('0x40')](_['pick'](_0x3138f9[_0xd94c('0x37')],_0x52d632[_0xd94c('0x40')]));_0x5e3509['where'][_0xd94c('0x5b')]=_0x2a4357['id'];if(_0x3138f9[_0xd94c('0x37')][_0xd94c('0x42')]){_0x5e3509[_0xd94c('0x43')]=_[_0xd94c('0x44')](_0x5e3509[_0xd94c('0x43')],{'$or':_[_0xd94c('0x45')](_0x5e3509['attributes'],function(_0x26575d){var _0x4e8e1b={};_0x4e8e1b[_0x26575d]={'$like':'%'+_0x3138f9[_0xd94c('0x37')][_0xd94c('0x42')]+'%'};return _0x4e8e1b;})});}_0x5e3509=_[_0xd94c('0x44')]({},_0x5e3509,_0x3138f9[_0xd94c('0x47')]);return db[_0xd94c('0x59')]['findAll'](_0x5e3509);}})[_0xd94c('0x2b')](function(_0x36b9c5){if(_0x36b9c5){return db[_0xd94c('0x5c')][_0xd94c('0x5d')]({'where':{'id':_[_0xd94c('0x45')](_0x36b9c5,_0xd94c('0x5e')),'role':_0xd94c('0x5f')},'attributes':['id','name','mailPause','updatedAt',_0xd94c('0x60')]});}})[_0xd94c('0x2b')](function(_0x431b86){if(_0x431b86){return{'count':_0x431b86[_0xd94c('0x26')],'rows':_['map'](_0x431b86['rows'],function(_0x105ffc){return{'membername':_0x105ffc[_0xd94c('0x31')],'UserId':_0x105ffc['id'],'queue_name':_0x4e72a5['name'],'MailQueueId':_0x4e72a5['id'],'interface':util[_0xd94c('0x61')]('%s/%s',_0xd94c('0x62'),_0x105ffc[_0xd94c('0x31')]),'penalty':0x0,'paused':_0x105ffc[_0xd94c('0x63')],'createdAt':_0x105ffc[_0xd94c('0x60')],'updatedAt':_0x105ffc[_0xd94c('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x229f40,_0x5e3509))[_0xd94c('0x4b')](handleError(_0x229f40,null));};exports[_0xd94c('0x65')]=function(_0x4bb75c,_0x1e938c,_0xc9db8c){var _0x1adce0={};var _0x5577f5={};var _0x1e8d87;var _0x1c4eb5;return db[_0xd94c('0x32')][_0xd94c('0x66')]({'where':{'id':_0x4bb75c[_0xd94c('0x56')]['id']}})[_0xd94c('0x2b')](handleEntityNotFound(_0x1e938c,null))[_0xd94c('0x2b')](function(_0x44db8f){if(_0x44db8f){_0x1e8d87=_0x44db8f;_0x5577f5[_0xd94c('0x3c')]=_[_0xd94c('0x36')](db[_0xd94c('0x67')][_0xd94c('0x33')]);_0x5577f5[_0xd94c('0x37')]=_[_0xd94c('0x36')](_0x4bb75c[_0xd94c('0x37')]);_0x5577f5[_0xd94c('0x40')]=_['intersection'](_0x5577f5['model'],_0x5577f5['query']);_0x1adce0[_0xd94c('0x39')]=_['intersection'](_0x5577f5[_0xd94c('0x3c')],qs['fields'](_0x4bb75c[_0xd94c('0x37')][_0xd94c('0x3a')]));_0x1adce0[_0xd94c('0x39')]=_0x1adce0[_0xd94c('0x39')][_0xd94c('0x3b')]?_0x1adce0['attributes']:_0x5577f5['model'];_0x1adce0[_0xd94c('0x3e')]=qs[_0xd94c('0x3f')](_0x4bb75c[_0xd94c('0x37')]['sort']);_0x1adce0[_0xd94c('0x43')]=qs[_0xd94c('0x40')](_[_0xd94c('0x41')](_0x4bb75c[_0xd94c('0x37')],_0x5577f5[_0xd94c('0x40')]));if(_0x4bb75c[_0xd94c('0x37')]['filter']){_0x1adce0[_0xd94c('0x43')]=_[_0xd94c('0x44')](_0x1adce0[_0xd94c('0x43')],{'$or':_[_0xd94c('0x45')](_0x1adce0[_0xd94c('0x39')],function(_0x25a9ed){var _0x461948={};_0x461948[_0x25a9ed]={'$like':'%'+_0x4bb75c[_0xd94c('0x37')]['filter']+'%'};return _0x461948;})});}_0x1adce0=_[_0xd94c('0x44')]({},_0x1adce0,_0x4bb75c['options']);return _0x1e8d87[_0xd94c('0x65')](_0x1adce0);}})[_0xd94c('0x2b')](function(_0x1afdb4){if(_0x1afdb4){_0x1c4eb5=_0x1afdb4[_0xd94c('0x3b')];if(!_0x4bb75c['query']['hasOwnProperty'](_0xd94c('0x3d'))){_0x1adce0['limit']=qs[_0xd94c('0x25')](_0x4bb75c[_0xd94c('0x37')][_0xd94c('0x25')]);_0x1adce0[_0xd94c('0x23')]=qs['offset'](_0x4bb75c[_0xd94c('0x37')][_0xd94c('0x23')]);}return _0x1e8d87['getTeams'](_0x1adce0);}})[_0xd94c('0x2b')](function(_0x23fbc6){if(_0x23fbc6){return _0x23fbc6?{'count':_0x1c4eb5,'rows':_0x23fbc6}:null;}})[_0xd94c('0x2b')](respondWithResult(_0x1e938c,null))[_0xd94c('0x4b')](handleError(_0x1e938c,null));};exports[_0xd94c('0x68')]=function(_0x42a1e8,_0xd5dc73,_0xfba3){var _0xea0b78=_0x42a1e8[_0xd94c('0x4e')]['ids'];return db['Team']['findAll']({'where':{'id':_0xea0b78},'attributes':['id'],'include':[{'model':db[_0xd94c('0x5c')],'as':_0xd94c('0x69'),'attributes':['id','name',_0xd94c('0x6a'),_0xd94c('0x6b'),'interface'],'raw':!![]}]})[_0xd94c('0x2b')](function(_0x115e3d){if(_0x115e3d){var _0x5ebd02=_[_0xd94c('0x6c')](_0x115e3d,function(_0x354b35){var _0x3f09a1=_0x354b35[_0xd94c('0x2d')]({'plain':!![]});return _0x3f09a1[_0xd94c('0x69')];});return db[_0xd94c('0x32')][_0xd94c('0x4c')]({'where':{'id':_0x42a1e8[_0xd94c('0x56')]['id']}})[_0xd94c('0x2b')](function(_0x18c29c){return db[_0xd94c('0x6d')][_0xd94c('0x6e')](function(_0x8b42f4){return _0x18c29c[_0xd94c('0x68')](_0xea0b78,{'transaction':_0x8b42f4})['then'](function(){return BPromise[_0xd94c('0x6f')](_0x5ebd02,function(_0x1f077c){return db['UserMailQueue'][_0xd94c('0x70')]({'where':{'UserId':_0x1f077c['id'],'MailQueueId':_0x42a1e8[_0xd94c('0x56')]['id']},'transaction':_0x8b42f4});});})['then'](function(){_0x5ebd02['forEach'](function(_0x538632){socket[_0xd94c('0x71')](_0xd94c('0x72'),{'UserId':_0x538632['id'],'MailQueueId':_0x18c29c['id']});});});});});}})[_0xd94c('0x2b')](respondWithStatusCode(_0xd5dc73,null))[_0xd94c('0x4b')](handleError(_0xd5dc73,null));};exports['removeTeams']=function(_0x7f0068,_0x1c5cad,_0x405d98){return db['Team'][_0xd94c('0x49')]({'where':{'id':_0x7f0068['query'][_0xd94c('0x73')]},'attributes':['id'],'include':[{'model':db[_0xd94c('0x5c')],'as':_0xd94c('0x69'),'attributes':['id'],'raw':!![]}]})[_0xd94c('0x2b')](handleEntityNotFound(_0x1c5cad,null))[_0xd94c('0x2b')](function(_0x22b50c){var _0x1a08c4=_[_0xd94c('0x45')](_0x22b50c,'id');var _0x261fff=[];var _0x18cbc8=[];var _0xdfd6f=squel['select']();_0xdfd6f[_0xd94c('0x74')](_0xd94c('0x75'))['from'](_0xd94c('0x76'),'tq')[_0xd94c('0x77')](_0xd94c('0x78'),'ut',_0xd94c('0x79'))[_0xd94c('0x43')](_0xd94c('0x7a'),_0x7f0068[_0xd94c('0x56')]['id']);for(var _0x15af1d=0x0;_0x15af1d<_0x22b50c['length'];_0x15af1d+=0x1){let _0x51cb76=_0x22b50c[_0x15af1d];for(var _0x2ad8f5=0x0;_0x2ad8f5<_0x51cb76[_0xd94c('0x69')]['length'];_0x2ad8f5+=0x1){let _0x59a5eb=_0x51cb76[_0xd94c('0x69')][_0x2ad8f5];var _0x1febe8=_0xdfd6f[_0xd94c('0x7b')]();_0x1febe8['where'](_0xd94c('0x7c'),_0x59a5eb['id']);_0x18cbc8[_0xd94c('0x7d')](db[_0xd94c('0x6d')][_0xd94c('0x37')](_0x1febe8[_0xd94c('0x7e')](),{'type':db[_0xd94c('0x6d')][_0xd94c('0x7f')]['SELECT']})['then'](function(_0x2e7c51){if(_0x2e7c51[_0xd94c('0x3b')]===0x1){return _0x59a5eb['id'];}else{var _0x41f3cf=_[_0xd94c('0x80')](_['map'](_0x2e7c51,'TeamId'),function(_0xb19c38){return _['includes'](_0x1a08c4,_0xb19c38);});if(_0x41f3cf){return _0x59a5eb['id'];}}}));}}return BPromise[_0xd94c('0x81')](_0x18cbc8)['then'](function(_0x324fbe){_0x261fff=_(_0x261fff)[_0xd94c('0x82')](_0x324fbe)['compact']()[_0xd94c('0x83')]();return db['MailQueue']['find']({'where':{'id':_0x7f0068[_0xd94c('0x56')]['id']}})[_0xd94c('0x2b')](function(_0x2a6306){return db[_0xd94c('0x6d')]['transaction'](function(_0x350eab){return _0x2a6306['removeTeams'](_0x7f0068[_0xd94c('0x37')]['ids'],{'transaction':_0x350eab})[_0xd94c('0x2b')](function(){if(!_['isEmpty'](_0x261fff)){return _0x2a6306[_0xd94c('0x84')](_0x261fff,{'transaction':_0x350eab});}})[_0xd94c('0x2b')](function(){_0x261fff[_0xd94c('0x85')](function(_0x1169a3){socket['emit'](_0xd94c('0x86'),{'UserId':_0x1169a3,'MailQueueId':_0x2a6306['id']});});});});});});})[_0xd94c('0x2b')](respondWithStatusCode(_0x1c5cad,null))[_0xd94c('0x4b')](handleError(_0x1c5cad,null));};exports[_0xd94c('0x87')]=function(_0x313bb6,_0x504518,_0x10b466){return db['MailQueue'][_0xd94c('0x4c')]({'where':{'id':_0x313bb6[_0xd94c('0x56')]['id']}})[_0xd94c('0x2b')](handleEntityNotFound(_0x504518,null))[_0xd94c('0x2b')](function(_0x310d2f){if(_0x310d2f){return _0x310d2f[_0xd94c('0x87')](_0x313bb6[_0xd94c('0x4e')][_0xd94c('0x73')],_['omit'](_0x313bb6[_0xd94c('0x4e')],[_0xd94c('0x73'),'id'])||{})[_0xd94c('0x88')](function(_0x37a10b){for(var _0x49b4b6=0x0;_0x49b4b6<_0x313bb6['body'][_0xd94c('0x73')]['length'];_0x49b4b6+=0x1){socket[_0xd94c('0x71')]('userMailQueue:save',{'UserId':Number(_0x313bb6[_0xd94c('0x4e')][_0xd94c('0x73')][_0x49b4b6]),'MailQueueId':Number(_0x313bb6[_0xd94c('0x56')]['id'])});}return _0x37a10b;});}})['then'](respondWithResult(_0x504518,null))['catch'](handleError(_0x504518,null));};exports[_0xd94c('0x84')]=function(_0x576c59,_0x85b47d,_0x2131a1){return db[_0xd94c('0x32')]['find']({'where':{'id':_0x576c59[_0xd94c('0x56')]['id']}})[_0xd94c('0x2b')](handleEntityNotFound(_0x85b47d,null))[_0xd94c('0x2b')](function(_0x3dc755){if(_0x3dc755){return _0x3dc755[_0xd94c('0x84')](_0x576c59[_0xd94c('0x37')]['ids'])[_0xd94c('0x2b')](function(){if(_['isArray'](_0x576c59[_0xd94c('0x37')][_0xd94c('0x73')])){for(var _0x47e463=0x0;_0x47e463<_0x576c59[_0xd94c('0x37')]['ids'][_0xd94c('0x3b')];_0x47e463+=0x1){socket[_0xd94c('0x71')](_0xd94c('0x86'),{'UserId':Number(_0x576c59[_0xd94c('0x37')][_0xd94c('0x73')][_0x47e463]),'MailQueueId':Number(_0x576c59[_0xd94c('0x56')]['id'])});}}else{socket[_0xd94c('0x71')](_0xd94c('0x86'),{'UserId':Number(_0x576c59[_0xd94c('0x37')][_0xd94c('0x73')]),'MailQueueId':Number(_0x576c59['params']['id'])});}});}})[_0xd94c('0x2b')](respondWithStatusCode(_0x85b47d,null))[_0xd94c('0x4b')](handleError(_0x85b47d,null));};exports['getAgents']=function(_0x3796ca,_0x360b8a,_0x212c06){var _0x558de0={};var _0x5978fd={};var _0x3e5566;var _0x310af0;return db[_0xd94c('0x32')][_0xd94c('0x66')]({'where':{'id':_0x3796ca[_0xd94c('0x56')]['id']}})[_0xd94c('0x2b')](handleEntityNotFound(_0x360b8a,null))[_0xd94c('0x2b')](function(_0x4b5a87){if(_0x4b5a87){_0x3e5566=_0x4b5a87;_0x5978fd[_0xd94c('0x3c')]=_[_0xd94c('0x36')](db[_0xd94c('0x5c')][_0xd94c('0x33')]);_0x5978fd[_0xd94c('0x37')]=_[_0xd94c('0x36')](_0x3796ca[_0xd94c('0x37')]);_0x5978fd[_0xd94c('0x40')]=_[_0xd94c('0x38')](_0x5978fd[_0xd94c('0x3c')],_0x5978fd[_0xd94c('0x37')]);_0x558de0[_0xd94c('0x39')]=_[_0xd94c('0x38')](_0x5978fd[_0xd94c('0x3c')],qs[_0xd94c('0x3a')](_0x3796ca[_0xd94c('0x37')][_0xd94c('0x3a')]));_0x558de0['attributes']=_0x558de0[_0xd94c('0x39')][_0xd94c('0x3b')]?_0x558de0[_0xd94c('0x39')]:_0x5978fd['model'];_0x558de0[_0xd94c('0x3e')]=qs[_0xd94c('0x3f')](_0x3796ca[_0xd94c('0x37')][_0xd94c('0x3f')]);_0x558de0[_0xd94c('0x43')]=qs[_0xd94c('0x40')](_[_0xd94c('0x41')](_0x3796ca['query'],_0x5978fd['filters']));if(_0x3796ca['query'][_0xd94c('0x42')]){_0x558de0[_0xd94c('0x43')]=_[_0xd94c('0x44')](_0x558de0['where'],{'$or':_[_0xd94c('0x45')](_0x558de0[_0xd94c('0x39')],function(_0x5aef14){var _0x2a844a={};_0x2a844a[_0x5aef14]={'$like':'%'+_0x3796ca['query'][_0xd94c('0x42')]+'%'};return _0x2a844a;})});}_0x558de0=_[_0xd94c('0x44')]({},_0x558de0,_0x3796ca[_0xd94c('0x47')]);return _0x3e5566['getAgents'](_0x558de0);}})['then'](function(_0x576239){if(_0x576239){_0x310af0=_0x576239[_0xd94c('0x3b')];if(!_0x3796ca[_0xd94c('0x37')][_0xd94c('0x5a')]('nolimit')){_0x558de0[_0xd94c('0x25')]=qs[_0xd94c('0x25')](_0x3796ca[_0xd94c('0x37')][_0xd94c('0x25')]);_0x558de0[_0xd94c('0x23')]=qs[_0xd94c('0x23')](_0x3796ca[_0xd94c('0x37')][_0xd94c('0x23')]);}return _0x3e5566[_0xd94c('0x89')](_0x558de0);}})['then'](function(_0x2defa2){if(_0x2defa2){return _0x2defa2?{'count':_0x310af0,'rows':_0x2defa2}:null;}})[_0xd94c('0x2b')](respondWithResult(_0x360b8a,null))[_0xd94c('0x4b')](handleError(_0x360b8a,null));}; \ No newline at end of file +var _0xdef6=['path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','register','sendStatus','end','status','json','undefined','limit','count','offset','Content-Range','update','then','destroy','UserProfileResource','name','send','index','map','MailQueue','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','rows','params','keys','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','MailQueues','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','UserMailQueue','MailQueueId','filter','findAll','User','findAndCountAll','UserId','agent','createdAt','format','mailPause','getTeams','findOne','nolimit','addTeams','Team','Agents','online','voicePause','sequelize','transaction','forEach','emit','removeTeams','ids','select','from','team_has_mail_queues','user_has_teams','clone','ut.UserId\x20=\x20?','push','SELECT','every','TeamId','all','compact','value','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','userMailQueue:save','getAgents','rimraf','fast-json-patch','request-promise','moment','mustache'];(function(_0x288f5e,_0x205edd){var _0x476cc9=function(_0x796f53){while(--_0x796f53){_0x288f5e['push'](_0x288f5e['shift']());}};_0x476cc9(++_0x205edd);}(_0xdef6,0x172));var _0x6def=function(_0x44be9a,_0x5ce1a6){_0x44be9a=_0x44be9a-0x0;var _0x3dbb78=_0xdef6[_0x44be9a];return _0x3dbb78;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6def('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6def('0x1'));var rp=require(_0x6def('0x2'));var moment=require(_0x6def('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6def('0x4'));var util=require('util');var path=require(_0x6def('0x5'));var sox=require(_0x6def('0x6'));var csv=require(_0x6def('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6def('0x8'));var _=require(_0x6def('0x9'));var squel=require('squel');var crypto=require(_0x6def('0xa'));var jsforce=require(_0x6def('0xb'));var deskjs=require(_0x6def('0xc'));var toCsv=require(_0x6def('0x7'));var querystring=require(_0x6def('0xd'));var Papa=require(_0x6def('0xe'));var Redis=require(_0x6def('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x6def('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6def('0x11'));var logger=require('../../config/logger')(_0x6def('0x12'));var utils=require(_0x6def('0x13'));var config=require(_0x6def('0x14'));var licenseUtil=require(_0x6def('0x15'));var db=require(_0x6def('0x16'))['db'];config[_0x6def('0x17')]=_[_0x6def('0x18')](config[_0x6def('0x17')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6def('0x17')]));require('./mailQueue.socket')[_0x6def('0x19')](socket);function respondWithStatusCode(_0x475889,_0x13765d){_0x13765d=_0x13765d||0xcc;return function(_0x55220b){if(_0x55220b){return _0x475889[_0x6def('0x1a')](_0x13765d);}return _0x475889['status'](_0x13765d)[_0x6def('0x1b')]();};}function respondWithResult(_0x17c6c2,_0xa666ae){_0xa666ae=_0xa666ae||0xc8;return function(_0x430634){if(_0x430634){return _0x17c6c2[_0x6def('0x1c')](_0xa666ae)[_0x6def('0x1d')](_0x430634);}};}function respondWithFilteredResult(_0x26e251,_0x460c06){return function(_0x4fcc73){if(_0x4fcc73){var _0x31f133=typeof _0x460c06['offset']===_0x6def('0x1e')&&typeof _0x460c06[_0x6def('0x1f')]===_0x6def('0x1e');var _0x54c541=_0x4fcc73[_0x6def('0x20')];var _0x2970df=_0x31f133?0x0:_0x460c06[_0x6def('0x21')];var _0x4dfc34=_0x31f133?_0x4fcc73[_0x6def('0x20')]:_0x460c06[_0x6def('0x21')]+_0x460c06['limit'];var _0x49ac1b;if(_0x4dfc34>=_0x54c541){_0x4dfc34=_0x54c541;_0x49ac1b=0xc8;}else{_0x49ac1b=0xce;}_0x26e251[_0x6def('0x1c')](_0x49ac1b);return _0x26e251['set'](_0x6def('0x22'),_0x2970df+'-'+_0x4dfc34+'/'+_0x54c541)[_0x6def('0x1d')](_0x4fcc73);}return null;};}function patchUpdates(_0x82462d){return function(_0x432794){try{jsonpatch['apply'](_0x432794,_0x82462d,!![]);}catch(_0x5bae8a){return BPromise['reject'](_0x5bae8a);}return _0x432794['save']();};}function saveUpdates(_0x23b204,_0x1ac0c3){return function(_0x2296f9){if(_0x2296f9){return _0x2296f9[_0x6def('0x23')](_0x23b204)[_0x6def('0x24')](function(_0x50f16c){return _0x50f16c;});}return null;};}function removeEntity(_0x1ed119,_0x358a97){return function(_0x509ea7){if(_0x509ea7){return _0x509ea7[_0x6def('0x25')]()[_0x6def('0x24')](function(){var _0x384afc=_0x509ea7['get']({'plain':!![]});var _0x4863a4='MailQueues';return db[_0x6def('0x26')]['destroy']({'where':{'type':_0x4863a4,'resourceId':_0x384afc['id']}})['then'](function(){return _0x509ea7;});})[_0x6def('0x24')](function(){_0x1ed119[_0x6def('0x1c')](0xcc)[_0x6def('0x1b')]();});}};}function handleEntityNotFound(_0xcf9c9e,_0x3a956b){return function(_0x501dd6){if(!_0x501dd6){_0xcf9c9e['sendStatus'](0x194);}return _0x501dd6;};}function handleError(_0x258222,_0x9a721d){_0x9a721d=_0x9a721d||0x1f4;return function(_0x55c2b5){logger['error'](_0x55c2b5['stack']);if(_0x55c2b5['name']){delete _0x55c2b5[_0x6def('0x27')];}_0x258222[_0x6def('0x1c')](_0x9a721d)[_0x6def('0x28')](_0x55c2b5);};}exports[_0x6def('0x29')]=function(_0x66ca71,_0x263340){var _0xfcff0e={},_0x35135a={},_0x3fc5e1={'count':0x0,'rows':[]};var _0x3992d0=_[_0x6def('0x2a')](db[_0x6def('0x2b')][_0x6def('0x2c')],function(_0x29de9a){return{'name':_0x29de9a[_0x6def('0x2d')],'type':_0x29de9a[_0x6def('0x2e')]['key']};});_0x35135a[_0x6def('0x2f')]=_[_0x6def('0x2a')](_0x3992d0,_0x6def('0x27'));_0x35135a[_0x6def('0x30')]=_['keys'](_0x66ca71[_0x6def('0x30')]);_0x35135a[_0x6def('0x31')]=_[_0x6def('0x32')](_0x35135a[_0x6def('0x2f')],_0x35135a[_0x6def('0x30')]);_0xfcff0e['attributes']=_[_0x6def('0x32')](_0x35135a[_0x6def('0x2f')],qs[_0x6def('0x33')](_0x66ca71[_0x6def('0x30')][_0x6def('0x33')]));_0xfcff0e[_0x6def('0x34')]=_0xfcff0e[_0x6def('0x34')][_0x6def('0x35')]?_0xfcff0e['attributes']:_0x35135a['model'];if(!_0x66ca71[_0x6def('0x30')][_0x6def('0x36')]('nolimit')){_0xfcff0e[_0x6def('0x1f')]=qs[_0x6def('0x1f')](_0x66ca71[_0x6def('0x30')][_0x6def('0x1f')]);_0xfcff0e[_0x6def('0x21')]=qs['offset'](_0x66ca71[_0x6def('0x30')][_0x6def('0x21')]);}_0xfcff0e[_0x6def('0x37')]=qs[_0x6def('0x38')](_0x66ca71['query'][_0x6def('0x38')]);_0xfcff0e[_0x6def('0x39')]=qs[_0x6def('0x31')](_[_0x6def('0x3a')](_0x66ca71[_0x6def('0x30')],_0x35135a[_0x6def('0x31')]),_0x3992d0);if(_0x66ca71[_0x6def('0x30')]['filter']){_0xfcff0e[_0x6def('0x39')]=_[_0x6def('0x3b')](_0xfcff0e['where'],{'$or':_[_0x6def('0x2a')](_0x3992d0,function(_0xcff006){if(_0xcff006[_0x6def('0x2e')]!==_0x6def('0x3c')){var _0x5d00c9={};_0x5d00c9[_0xcff006[_0x6def('0x27')]]={'$like':'%'+_0x66ca71['query']['filter']+'%'};return _0x5d00c9;}})});}_0xfcff0e=_[_0x6def('0x3b')]({},_0xfcff0e,_0x66ca71[_0x6def('0x3d')]);var _0xdf2b15={'where':_0xfcff0e[_0x6def('0x39')]};return db['MailQueue'][_0x6def('0x20')](_0xdf2b15)[_0x6def('0x24')](function(_0x394fad){_0x3fc5e1[_0x6def('0x20')]=_0x394fad;if(_0x66ca71[_0x6def('0x30')][_0x6def('0x3e')]){_0xfcff0e[_0x6def('0x3f')]=[{'all':!![]}];}return db['MailQueue']['findAll'](_0xfcff0e);})[_0x6def('0x24')](function(_0x60fadb){_0x3fc5e1[_0x6def('0x40')]=_0x60fadb;return _0x3fc5e1;})[_0x6def('0x24')](respondWithFilteredResult(_0x263340,_0xfcff0e))['catch'](handleError(_0x263340,null));};exports['show']=function(_0xfe136f,_0x7b028d){var _0x3b5ad6={'raw':!![],'where':{'id':_0xfe136f[_0x6def('0x41')]['id']}},_0x68033c={};_0x68033c[_0x6def('0x2f')]=_[_0x6def('0x42')](db['MailQueue'][_0x6def('0x2c')]);_0x68033c[_0x6def('0x30')]=_[_0x6def('0x42')](_0xfe136f[_0x6def('0x30')]);_0x68033c[_0x6def('0x31')]=_[_0x6def('0x32')](_0x68033c['model'],_0x68033c[_0x6def('0x30')]);_0x3b5ad6[_0x6def('0x34')]=_[_0x6def('0x32')](_0x68033c[_0x6def('0x2f')],qs[_0x6def('0x33')](_0xfe136f[_0x6def('0x30')]['fields']));_0x3b5ad6[_0x6def('0x34')]=_0x3b5ad6['attributes']['length']?_0x3b5ad6[_0x6def('0x34')]:_0x68033c['model'];if(_0xfe136f[_0x6def('0x30')]['includeAll']){_0x3b5ad6[_0x6def('0x3f')]=[{'all':!![]}];}_0x3b5ad6=_['merge']({},_0x3b5ad6,_0xfe136f[_0x6def('0x3d')]);return db[_0x6def('0x2b')][_0x6def('0x43')](_0x3b5ad6)['then'](handleEntityNotFound(_0x7b028d,null))[_0x6def('0x24')](respondWithResult(_0x7b028d,null))[_0x6def('0x44')](handleError(_0x7b028d,null));};exports[_0x6def('0x45')]=function(_0x4ef16f,_0x5ea50a){return db[_0x6def('0x2b')][_0x6def('0x45')](_0x4ef16f['body'],{})[_0x6def('0x24')](function(_0x21f956){var _0x2cec9b=_0x4ef16f[_0x6def('0x46')][_0x6def('0x47')]({'plain':!![]});if(!_0x2cec9b)throw new Error(_0x6def('0x48'));if(_0x2cec9b['role']==='user'){var _0x54c0cc=_0x21f956[_0x6def('0x47')]({'plain':!![]});var _0x4c9186=_0x6def('0x49');return db[_0x6def('0x4a')][_0x6def('0x43')]({'where':{'name':_0x4c9186,'userProfileId':_0x2cec9b['userProfileId']},'raw':!![]})[_0x6def('0x24')](function(_0x321bdc){if(_0x321bdc&&_0x321bdc['autoAssociation']===0x0){return db[_0x6def('0x26')][_0x6def('0x45')]({'name':_0x54c0cc[_0x6def('0x27')],'resourceId':_0x54c0cc['id'],'type':_0x321bdc[_0x6def('0x27')],'sectionId':_0x321bdc['id']},{})[_0x6def('0x24')](function(){return _0x21f956;});}else{return _0x21f956;}})[_0x6def('0x44')](function(_0x5320fe){logger[_0x6def('0x4b')](_0x6def('0x4c'),_0x5320fe);throw _0x5320fe;});}return _0x21f956;})[_0x6def('0x24')](respondWithResult(_0x5ea50a,0xc9))[_0x6def('0x44')](handleError(_0x5ea50a,null));};exports['update']=function(_0x345e50,_0x273600){if(_0x345e50[_0x6def('0x4d')]['id']){delete _0x345e50[_0x6def('0x4d')]['id'];}return db[_0x6def('0x2b')][_0x6def('0x43')]({'where':{'id':_0x345e50[_0x6def('0x41')]['id']}})['then'](handleEntityNotFound(_0x273600,null))['then'](saveUpdates(_0x345e50[_0x6def('0x4d')],null))[_0x6def('0x24')](respondWithResult(_0x273600,null))[_0x6def('0x44')](handleError(_0x273600,null));};exports[_0x6def('0x25')]=function(_0x5bd794,_0x26b280){return db['MailQueue']['find']({'where':{'id':_0x5bd794[_0x6def('0x41')]['id']}})['then'](handleEntityNotFound(_0x26b280,null))[_0x6def('0x24')](removeEntity(_0x26b280,null))['catch'](handleError(_0x26b280,null));};exports[_0x6def('0x4e')]=function(_0x27c091,_0x4a2fa1){return db[_0x6def('0x2b')][_0x6def('0x4e')]()[_0x6def('0x24')](respondWithResult(_0x4a2fa1,null))['catch'](handleError(_0x4a2fa1,null));};exports[_0x6def('0x4f')]=function(_0x418a1f,_0x2014e8,_0x28be64){var _0x4ba0ef={'raw':!![],'where':{}},_0x288ae8={},_0x641ff3;return db['MailQueue']['findOne']({'where':{'id':_0x418a1f[_0x6def('0x41')]['id']}})['then'](handleEntityNotFound(_0x2014e8,null))['then'](function(_0x46e33f){if(_0x46e33f){_0x641ff3=_0x46e33f[_0x6def('0x47')]({'plain':!![]});_0x288ae8['model']=_[_0x6def('0x42')](db[_0x6def('0x50')][_0x6def('0x2c')]);_0x288ae8[_0x6def('0x30')]=_[_0x6def('0x42')](_0x418a1f[_0x6def('0x30')]);_0x288ae8['filters']=_[_0x6def('0x32')](_0x288ae8['model'],_0x288ae8[_0x6def('0x30')]);_0x4ba0ef[_0x6def('0x34')]=_[_0x6def('0x32')](_0x288ae8[_0x6def('0x2f')],qs[_0x6def('0x33')](_0x418a1f[_0x6def('0x30')][_0x6def('0x33')]));_0x4ba0ef[_0x6def('0x34')]=_0x4ba0ef[_0x6def('0x34')][_0x6def('0x35')]?_0x4ba0ef[_0x6def('0x34')]:_0x288ae8[_0x6def('0x2f')];if(!_0x418a1f['query'][_0x6def('0x36')]('nolimit')){_0x4ba0ef['limit']=qs[_0x6def('0x1f')](_0x418a1f[_0x6def('0x30')][_0x6def('0x1f')]);_0x4ba0ef[_0x6def('0x21')]=qs[_0x6def('0x21')](_0x418a1f[_0x6def('0x30')]['offset']);}_0x4ba0ef[_0x6def('0x37')]=qs[_0x6def('0x38')](_0x418a1f[_0x6def('0x30')][_0x6def('0x38')]);_0x4ba0ef[_0x6def('0x39')]=qs['filters'](_['pick'](_0x418a1f[_0x6def('0x30')],_0x288ae8[_0x6def('0x31')]));_0x4ba0ef[_0x6def('0x39')][_0x6def('0x51')]=_0x46e33f['id'];if(_0x418a1f[_0x6def('0x30')][_0x6def('0x52')]){_0x4ba0ef[_0x6def('0x39')]=_['merge'](_0x4ba0ef[_0x6def('0x39')],{'$or':_[_0x6def('0x2a')](_0x4ba0ef['attributes'],function(_0xe908){var _0x5f4b64={};_0x5f4b64[_0xe908]={'$like':'%'+_0x418a1f[_0x6def('0x30')]['filter']+'%'};return _0x5f4b64;})});}_0x4ba0ef=_[_0x6def('0x3b')]({},_0x4ba0ef,_0x418a1f[_0x6def('0x3d')]);return db[_0x6def('0x50')][_0x6def('0x53')](_0x4ba0ef);}})[_0x6def('0x24')](function(_0x397224){if(_0x397224){return db[_0x6def('0x54')][_0x6def('0x55')]({'where':{'id':_[_0x6def('0x2a')](_0x397224,_0x6def('0x56')),'role':_0x6def('0x57')},'attributes':['id',_0x6def('0x27'),'mailPause','updatedAt',_0x6def('0x58')]});}})[_0x6def('0x24')](function(_0xaafb86){if(_0xaafb86){return{'count':_0xaafb86[_0x6def('0x20')],'rows':_['map'](_0xaafb86[_0x6def('0x40')],function(_0x57b0ff){return{'membername':_0x57b0ff[_0x6def('0x27')],'UserId':_0x57b0ff['id'],'queue_name':_0x641ff3[_0x6def('0x27')],'MailQueueId':_0x641ff3['id'],'interface':util[_0x6def('0x59')]('%s/%s','SIP',_0x57b0ff[_0x6def('0x27')]),'penalty':0x0,'paused':_0x57b0ff[_0x6def('0x5a')],'createdAt':_0x57b0ff[_0x6def('0x58')],'updatedAt':_0x57b0ff['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x6def('0x24')](respondWithFilteredResult(_0x2014e8,_0x4ba0ef))['catch'](handleError(_0x2014e8,null));};exports[_0x6def('0x5b')]=function(_0x270935,_0x90ec7a,_0x5031fc){var _0x4c2ec9={};var _0xbcd80a={};var _0x53a96e;var _0x4902ba;return db['MailQueue'][_0x6def('0x5c')]({'where':{'id':_0x270935[_0x6def('0x41')]['id']}})[_0x6def('0x24')](handleEntityNotFound(_0x90ec7a,null))['then'](function(_0x143945){if(_0x143945){_0x53a96e=_0x143945;_0xbcd80a[_0x6def('0x2f')]=_[_0x6def('0x42')](db['Team'][_0x6def('0x2c')]);_0xbcd80a[_0x6def('0x30')]=_[_0x6def('0x42')](_0x270935[_0x6def('0x30')]);_0xbcd80a[_0x6def('0x31')]=_[_0x6def('0x32')](_0xbcd80a['model'],_0xbcd80a[_0x6def('0x30')]);_0x4c2ec9['attributes']=_[_0x6def('0x32')](_0xbcd80a[_0x6def('0x2f')],qs[_0x6def('0x33')](_0x270935[_0x6def('0x30')]['fields']));_0x4c2ec9[_0x6def('0x34')]=_0x4c2ec9[_0x6def('0x34')][_0x6def('0x35')]?_0x4c2ec9[_0x6def('0x34')]:_0xbcd80a[_0x6def('0x2f')];_0x4c2ec9[_0x6def('0x37')]=qs[_0x6def('0x38')](_0x270935[_0x6def('0x30')][_0x6def('0x38')]);_0x4c2ec9['where']=qs['filters'](_[_0x6def('0x3a')](_0x270935[_0x6def('0x30')],_0xbcd80a[_0x6def('0x31')]));if(_0x270935['query']['filter']){_0x4c2ec9[_0x6def('0x39')]=_['merge'](_0x4c2ec9[_0x6def('0x39')],{'$or':_[_0x6def('0x2a')](_0x4c2ec9[_0x6def('0x34')],function(_0x184ac1){var _0x5c2862={};_0x5c2862[_0x184ac1]={'$like':'%'+_0x270935[_0x6def('0x30')][_0x6def('0x52')]+'%'};return _0x5c2862;})});}_0x4c2ec9=_[_0x6def('0x3b')]({},_0x4c2ec9,_0x270935['options']);return _0x53a96e['getTeams'](_0x4c2ec9);}})[_0x6def('0x24')](function(_0x1bb34c){if(_0x1bb34c){_0x4902ba=_0x1bb34c['length'];if(!_0x270935[_0x6def('0x30')][_0x6def('0x36')](_0x6def('0x5d'))){_0x4c2ec9['limit']=qs[_0x6def('0x1f')](_0x270935[_0x6def('0x30')][_0x6def('0x1f')]);_0x4c2ec9['offset']=qs[_0x6def('0x21')](_0x270935[_0x6def('0x30')][_0x6def('0x21')]);}return _0x53a96e[_0x6def('0x5b')](_0x4c2ec9);}})[_0x6def('0x24')](function(_0x268a41){if(_0x268a41){return _0x268a41?{'count':_0x4902ba,'rows':_0x268a41}:null;}})['then'](respondWithResult(_0x90ec7a,null))['catch'](handleError(_0x90ec7a,null));};exports[_0x6def('0x5e')]=function(_0x235ff5,_0x52669a,_0x1e911b){var _0x449680=_0x235ff5[_0x6def('0x4d')]['ids'];return db[_0x6def('0x5f')][_0x6def('0x53')]({'where':{'id':_0x449680},'attributes':['id'],'include':[{'model':db[_0x6def('0x54')],'as':_0x6def('0x60'),'attributes':['id',_0x6def('0x27'),_0x6def('0x61'),_0x6def('0x62'),'interface'],'raw':!![]}]})[_0x6def('0x24')](function(_0x559ac8){if(_0x559ac8){var _0x41810a=_['flatMap'](_0x559ac8,function(_0x2ea3f4){var _0x5ddfbf=_0x2ea3f4[_0x6def('0x47')]({'plain':!![]});return _0x5ddfbf[_0x6def('0x60')];});return db[_0x6def('0x2b')][_0x6def('0x43')]({'where':{'id':_0x235ff5['params']['id']}})[_0x6def('0x24')](function(_0x4a5b34){return db[_0x6def('0x63')][_0x6def('0x64')](function(_0x1bbd1c){return _0x4a5b34['addTeams'](_0x449680,{'transaction':_0x1bbd1c})[_0x6def('0x24')](function(){return BPromise['each'](_0x41810a,function(_0x4db60d){return db[_0x6def('0x50')]['findOrCreate']({'where':{'UserId':_0x4db60d['id'],'MailQueueId':_0x235ff5[_0x6def('0x41')]['id']},'transaction':_0x1bbd1c});});})[_0x6def('0x24')](function(){_0x41810a[_0x6def('0x65')](function(_0x17b45b){socket[_0x6def('0x66')]('userMailQueue:save',{'UserId':_0x17b45b['id'],'MailQueueId':_0x4a5b34['id']});});});});});}})[_0x6def('0x24')](respondWithStatusCode(_0x52669a,null))['catch'](handleError(_0x52669a,null));};exports[_0x6def('0x67')]=function(_0x58d350,_0x78d3f7,_0x5f41aa){return db[_0x6def('0x5f')][_0x6def('0x53')]({'where':{'id':_0x58d350['query'][_0x6def('0x68')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x6def('0x60'),'attributes':['id'],'raw':!![]}]})[_0x6def('0x24')](handleEntityNotFound(_0x78d3f7,null))[_0x6def('0x24')](function(_0x1bf1bf){var _0x59cc59=_[_0x6def('0x2a')](_0x1bf1bf,'id');var _0x21178d=[];var _0x781a5=[];var _0x4faa6f=squel[_0x6def('0x69')]();_0x4faa6f['field']('tq.TeamId')[_0x6def('0x6a')](_0x6def('0x6b'),'tq')['join'](_0x6def('0x6c'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x6def('0x39')]('MailQueueId\x20=\x20?',_0x58d350[_0x6def('0x41')]['id']);for(var _0x2dca6f=0x0;_0x2dca6f<_0x1bf1bf[_0x6def('0x35')];_0x2dca6f+=0x1){let _0x10f3b5=_0x1bf1bf[_0x2dca6f];for(var _0x4a8e2c=0x0;_0x4a8e2c<_0x10f3b5[_0x6def('0x60')][_0x6def('0x35')];_0x4a8e2c+=0x1){let _0x2ca6b4=_0x10f3b5['Agents'][_0x4a8e2c];var _0xd07141=_0x4faa6f[_0x6def('0x6d')]();_0xd07141[_0x6def('0x39')](_0x6def('0x6e'),_0x2ca6b4['id']);_0x781a5[_0x6def('0x6f')](db[_0x6def('0x63')][_0x6def('0x30')](_0xd07141['toString'](),{'type':db[_0x6def('0x63')]['QueryTypes'][_0x6def('0x70')]})[_0x6def('0x24')](function(_0x5bde06){if(_0x5bde06[_0x6def('0x35')]===0x1){return _0x2ca6b4['id'];}else{var _0xb5237d=_[_0x6def('0x71')](_[_0x6def('0x2a')](_0x5bde06,_0x6def('0x72')),function(_0x3a4f92){return _['includes'](_0x59cc59,_0x3a4f92);});if(_0xb5237d){return _0x2ca6b4['id'];}}}));}}return BPromise[_0x6def('0x73')](_0x781a5)[_0x6def('0x24')](function(_0x27c30d){_0x21178d=_(_0x21178d)['union'](_0x27c30d)[_0x6def('0x74')]()[_0x6def('0x75')]();return db['MailQueue'][_0x6def('0x43')]({'where':{'id':_0x58d350[_0x6def('0x41')]['id']}})[_0x6def('0x24')](function(_0x2b26d3){return db[_0x6def('0x63')][_0x6def('0x64')](function(_0x5f6d51){return _0x2b26d3[_0x6def('0x67')](_0x58d350[_0x6def('0x30')][_0x6def('0x68')],{'transaction':_0x5f6d51})['then'](function(){if(!_[_0x6def('0x76')](_0x21178d)){return _0x2b26d3[_0x6def('0x77')](_0x21178d,{'transaction':_0x5f6d51});}})[_0x6def('0x24')](function(){_0x21178d[_0x6def('0x65')](function(_0x11f8af){socket[_0x6def('0x66')](_0x6def('0x78'),{'UserId':_0x11f8af,'MailQueueId':_0x2b26d3['id']});});});});});});})['then'](respondWithStatusCode(_0x78d3f7,null))[_0x6def('0x44')](handleError(_0x78d3f7,null));};exports['addAgents']=function(_0x2758f3,_0x190954,_0x2d76a){return db[_0x6def('0x2b')][_0x6def('0x43')]({'where':{'id':_0x2758f3[_0x6def('0x41')]['id']}})['then'](handleEntityNotFound(_0x190954,null))['then'](function(_0x1bc5a1){if(_0x1bc5a1){return _0x1bc5a1[_0x6def('0x79')](_0x2758f3[_0x6def('0x4d')]['ids'],_[_0x6def('0x7a')](_0x2758f3[_0x6def('0x4d')],[_0x6def('0x68'),'id'])||{})['spread'](function(_0x312eb6){for(var _0x22fc15=0x0;_0x22fc15<_0x2758f3[_0x6def('0x4d')][_0x6def('0x68')]['length'];_0x22fc15+=0x1){socket[_0x6def('0x66')](_0x6def('0x7b'),{'UserId':Number(_0x2758f3[_0x6def('0x4d')][_0x6def('0x68')][_0x22fc15]),'MailQueueId':Number(_0x2758f3[_0x6def('0x41')]['id'])});}return _0x312eb6;});}})[_0x6def('0x24')](respondWithResult(_0x190954,null))[_0x6def('0x44')](handleError(_0x190954,null));};exports['removeAgents']=function(_0x1c166e,_0x1021af,_0x32dc9c){return db[_0x6def('0x2b')][_0x6def('0x43')]({'where':{'id':_0x1c166e[_0x6def('0x41')]['id']}})['then'](handleEntityNotFound(_0x1021af,null))['then'](function(_0x44740a){if(_0x44740a){return _0x44740a[_0x6def('0x77')](_0x1c166e[_0x6def('0x30')][_0x6def('0x68')])[_0x6def('0x24')](function(){if(_['isArray'](_0x1c166e['query'][_0x6def('0x68')])){for(var _0x2b8374=0x0;_0x2b8374<_0x1c166e['query'][_0x6def('0x68')][_0x6def('0x35')];_0x2b8374+=0x1){socket[_0x6def('0x66')](_0x6def('0x78'),{'UserId':Number(_0x1c166e['query']['ids'][_0x2b8374]),'MailQueueId':Number(_0x1c166e['params']['id'])});}}else{socket[_0x6def('0x66')]('userMailQueue:remove',{'UserId':Number(_0x1c166e[_0x6def('0x30')][_0x6def('0x68')]),'MailQueueId':Number(_0x1c166e[_0x6def('0x41')]['id'])});}});}})[_0x6def('0x24')](respondWithStatusCode(_0x1021af,null))[_0x6def('0x44')](handleError(_0x1021af,null));};exports[_0x6def('0x7c')]=function(_0x2fa2aa,_0x35b40f,_0x518713){var _0x25e61d={};var _0x18be56={};var _0xf83cea;var _0x8c6598;return db['MailQueue'][_0x6def('0x5c')]({'where':{'id':_0x2fa2aa[_0x6def('0x41')]['id']}})['then'](handleEntityNotFound(_0x35b40f,null))['then'](function(_0x55ef50){if(_0x55ef50){_0xf83cea=_0x55ef50;_0x18be56[_0x6def('0x2f')]=_[_0x6def('0x42')](db[_0x6def('0x54')][_0x6def('0x2c')]);_0x18be56[_0x6def('0x30')]=_[_0x6def('0x42')](_0x2fa2aa['query']);_0x18be56[_0x6def('0x31')]=_[_0x6def('0x32')](_0x18be56[_0x6def('0x2f')],_0x18be56[_0x6def('0x30')]);_0x25e61d[_0x6def('0x34')]=_[_0x6def('0x32')](_0x18be56[_0x6def('0x2f')],qs[_0x6def('0x33')](_0x2fa2aa['query']['fields']));_0x25e61d[_0x6def('0x34')]=_0x25e61d[_0x6def('0x34')][_0x6def('0x35')]?_0x25e61d[_0x6def('0x34')]:_0x18be56[_0x6def('0x2f')];_0x25e61d[_0x6def('0x37')]=qs[_0x6def('0x38')](_0x2fa2aa[_0x6def('0x30')]['sort']);_0x25e61d[_0x6def('0x39')]=qs[_0x6def('0x31')](_[_0x6def('0x3a')](_0x2fa2aa['query'],_0x18be56[_0x6def('0x31')]));if(_0x2fa2aa[_0x6def('0x30')][_0x6def('0x52')]){_0x25e61d[_0x6def('0x39')]=_[_0x6def('0x3b')](_0x25e61d['where'],{'$or':_['map'](_0x25e61d['attributes'],function(_0x1055a3){var _0x2d0330={};_0x2d0330[_0x1055a3]={'$like':'%'+_0x2fa2aa[_0x6def('0x30')][_0x6def('0x52')]+'%'};return _0x2d0330;})});}_0x25e61d=_[_0x6def('0x3b')]({},_0x25e61d,_0x2fa2aa[_0x6def('0x3d')]);return _0xf83cea['getAgents'](_0x25e61d);}})[_0x6def('0x24')](function(_0x318ae3){if(_0x318ae3){_0x8c6598=_0x318ae3[_0x6def('0x35')];if(!_0x2fa2aa[_0x6def('0x30')][_0x6def('0x36')](_0x6def('0x5d'))){_0x25e61d[_0x6def('0x1f')]=qs['limit'](_0x2fa2aa[_0x6def('0x30')]['limit']);_0x25e61d[_0x6def('0x21')]=qs[_0x6def('0x21')](_0x2fa2aa[_0x6def('0x30')][_0x6def('0x21')]);}return _0xf83cea[_0x6def('0x7c')](_0x25e61d);}})[_0x6def('0x24')](function(_0x365a18){if(_0x365a18){return _0x365a18?{'count':_0x8c6598,'rows':_0x365a18}:null;}})['then'](respondWithResult(_0x35b40f,null))['catch'](handleError(_0x35b40f,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 5ec2196..6db0236 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 _0x3265=['../../mysqldb','setMaxListeners','save','update','remove','emit','hook','exports'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x3265,0x1c0));var _0x5326=function(_0x3ff62a,_0x5eb2ff){_0x3ff62a=_0x3ff62a-0x0;var _0x149344=_0x3265[_0x3ff62a];return _0x149344;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0x5326('0x0'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x5326('0x1')](0x0);var events={'afterCreate':_0x5326('0x2'),'afterUpdate':_0x5326('0x3'),'afterDestroy':_0x5326('0x4')};function emitEvent(_0x267459){return function(_0x2f3015,_0x4385cd,_0x379046){MailQueueEvents[_0x5326('0x5')](_0x267459+':'+_0x2f3015['id'],_0x2f3015);MailQueueEvents[_0x5326('0x5')](_0x267459,_0x2f3015);_0x379046(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0x5326('0x6')](e,emitEvent(event));}}module[_0x5326('0x7')]=MailQueueEvents; \ No newline at end of file +var _0xa276=['MailQueue','setMaxListeners','remove','hook','exports','events','../../mysqldb'];(function(_0xf4dda,_0x508d82){var _0x46debd=function(_0x4e32f5){while(--_0x4e32f5){_0xf4dda['push'](_0xf4dda['shift']());}};_0x46debd(++_0x508d82);}(_0xa276,0x194));var _0x6a27=function(_0x4d1cdb,_0x43fd06){_0x4d1cdb=_0x4d1cdb-0x0;var _0x32446c=_0xa276[_0x4d1cdb];return _0x32446c;};'use strict';var EventEmitter=require(_0x6a27('0x0'));var MailQueue=require(_0x6a27('0x1'))['db'][_0x6a27('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x6a27('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x6a27('0x4')};function emitEvent(_0x460368){return function(_0x1d1040,_0x2ed9c6,_0x12db3c){MailQueueEvents['emit'](_0x460368+':'+_0x1d1040['id'],_0x1d1040);MailQueueEvents['emit'](_0x460368,_0x1d1040);_0x12db3c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0x6a27('0x5')](e,emitEvent(event));}}module[_0x6a27('0x6')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 099ab01..66d2100 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 _0xeaf5=['MailQueue','mail_queues','lodash','api','bluebird','path','../../config/environment','./mailQueue.attributes','define'];(function(_0x20a687,_0x2c20f6){var _0x38c272=function(_0x56778d){while(--_0x56778d){_0x20a687['push'](_0x20a687['shift']());}};_0x38c272(++_0x2c20f6);}(_0xeaf5,0x1df));var _0x5eaf=function(_0x4186fa,_0x26a01c){_0x4186fa=_0x4186fa-0x0;var _0x136990=_0xeaf5[_0x4186fa];return _0x136990;};'use strict';var _=require(_0x5eaf('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5eaf('0x1'));var moment=require('moment');var BPromise=require(_0x5eaf('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5eaf('0x3'));var rimraf=require('rimraf');var config=require(_0x5eaf('0x4'));var attributes=require(_0x5eaf('0x5'));module['exports']=function(_0x8e7d02,_0x12e213){return _0x8e7d02[_0x5eaf('0x6')](_0x5eaf('0x7'),attributes,{'tableName':_0x5eaf('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc270=['moment','bluebird','../../config/environment','define','mail_queues','lodash','util'];(function(_0x10d765,_0x15d0d7){var _0x1b96fd=function(_0x37c911){while(--_0x37c911){_0x10d765['push'](_0x10d765['shift']());}};_0x1b96fd(++_0x15d0d7);}(_0xc270,0x18d));var _0x0c27=function(_0x220720,_0x10d6b4){_0x220720=_0x220720-0x0;var _0x20f9a7=_0xc270[_0x220720];return _0x20f9a7;};'use strict';var _=require(_0x0c27('0x0'));var util=require(_0x0c27('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0c27('0x2'));var BPromise=require(_0x0c27('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0c27('0x4'));var attributes=require('./mailQueue.attributes');module['exports']=function(_0x5627a,_0x11e62b){return _0x5627a[_0x0c27('0x5')]('MailQueue',attributes,{'tableName':_0x0c27('0x6'),'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 c5bacad..b213fb0 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 _0xb3ea=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','GetMailQueue','MailQueue','findAll','options','raw','where','include','model','attributes','map','then','stringify','ShowMailQueue','find','lodash','util','moment'];(function(_0x9d3da1,_0x5a6e1b){var _0x5c2f2c=function(_0x42153a){while(--_0x42153a){_0x9d3da1['push'](_0x9d3da1['shift']());}};_0x5c2f2c(++_0x5a6e1b);}(_0xb3ea,0xc5));var _0xab3e=function(_0x7a4605,_0x19e000){_0x7a4605=_0x7a4605-0x0;var _0x5a6fe0=_0xb3ea[_0x7a4605];return _0x5a6fe0;};'use strict';var _=require(_0xab3e('0x0'));var util=require(_0xab3e('0x1'));var moment=require(_0xab3e('0x2'));var BPromise=require(_0xab3e('0x3'));var rs=require(_0xab3e('0x4'));var fs=require('fs');var Redis=require(_0xab3e('0x5'));var db=require(_0xab3e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xab3e('0x7'))(_0xab3e('0x8'));var config=require('../../config/environment');var jayson=require(_0xab3e('0x9'));var client=jayson[_0xab3e('0xa')][_0xab3e('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0xab3e('0xc')],{'host':_0xab3e('0xd'),'port':0x18eb});var socket=require(_0xab3e('0xe'))(new Redis(config['redis']));require('./mailQueue.socket')[_0xab3e('0xf')](socket);function respondWithRpcPromise(_0x16899b,_0x5802bc,_0x359157){return new BPromise(function(_0x2db518,_0x62b604){return client[_0xab3e('0x10')](_0x16899b,_0x359157)['then'](function(_0x5b5750){logger['info'](_0xab3e('0x11'),_0x5802bc,_0xab3e('0x12'));logger[_0xab3e('0x13')](_0xab3e('0x14'),_0x5802bc,'request\x20sent',JSON['stringify'](_0x5b5750));if(_0x5b5750['error']){if(_0x5b5750[_0xab3e('0x15')]['code']===0x1f4){logger[_0xab3e('0x15')](_0xab3e('0x11'),_0x5802bc,_0x5b5750['error'][_0xab3e('0x16')]);return _0x62b604(_0x5b5750[_0xab3e('0x15')][_0xab3e('0x16')]);}logger[_0xab3e('0x15')]('MailQueue,\x20%s,\x20%s',_0x5802bc,_0x5b5750[_0xab3e('0x15')]['message']);return _0x2db518(_0x5b5750['error'][_0xab3e('0x16')]);}else{logger[_0xab3e('0x17')]('MailQueue,\x20%s,\x20%s',_0x5802bc,_0xab3e('0x12'));_0x2db518(_0x5b5750[_0xab3e('0x18')]['message']);}})[_0xab3e('0x19')](function(_0x1d1aef){logger[_0xab3e('0x15')](_0xab3e('0x11'),_0x5802bc,_0x1d1aef);_0x62b604(_0x1d1aef);});});}exports[_0xab3e('0x1a')]=function(_0x277569){var _0x658e1d=this;return new Promise(function(_0x15a8b3,_0x55827e){return db[_0xab3e('0x1b')][_0xab3e('0x1c')]({'raw':_0x277569[_0xab3e('0x1d')]?_0x277569['options'][_0xab3e('0x1e')]===undefined?!![]:![]:!![],'where':_0x277569[_0xab3e('0x1d')]?_0x277569[_0xab3e('0x1d')][_0xab3e('0x1f')]||null:null,'attributes':_0x277569[_0xab3e('0x1d')]?_0x277569[_0xab3e('0x1d')]['attributes']||null:null,'limit':_0x277569[_0xab3e('0x1d')]?_0x277569[_0xab3e('0x1d')]['limit']||null:null,'include':_0x277569['options']?_0x277569['options'][_0xab3e('0x20')]?_['map'](_0x277569[_0xab3e('0x1d')][_0xab3e('0x20')],function(_0xc8d742){return{'model':db[_0xc8d742[_0xab3e('0x21')]],'as':_0xc8d742['as'],'attributes':_0xc8d742[_0xab3e('0x22')],'include':_0xc8d742[_0xab3e('0x20')]?_[_0xab3e('0x23')](_0xc8d742[_0xab3e('0x20')],function(_0x5182ad){return{'model':db[_0x5182ad[_0xab3e('0x21')]],'as':_0x5182ad['as'],'attributes':_0x5182ad[_0xab3e('0x22')],'include':_0x5182ad[_0xab3e('0x20')]?_[_0xab3e('0x23')](_0x5182ad[_0xab3e('0x20')],function(_0x3ac28d){return{'model':db[_0x3ac28d[_0xab3e('0x21')]],'as':_0x3ac28d['as'],'attributes':_0x3ac28d[_0xab3e('0x22')]};}):[]};}):[]};}):[]:[]})[_0xab3e('0x24')](function(_0x2527de){logger[_0xab3e('0x17')]('GetMailQueue',_0x277569);logger[_0xab3e('0x13')](_0xab3e('0x1a'),_0x277569,JSON[_0xab3e('0x25')](_0x2527de));_0x15a8b3(_0x2527de);})[_0xab3e('0x19')](function(_0x140c33){logger[_0xab3e('0x15')](_0xab3e('0x1a'),_0x140c33[_0xab3e('0x16')],_0x277569);_0x55827e(_0x658e1d[_0xab3e('0x15')](0x1f4,_0x140c33['message']));});});};exports[_0xab3e('0x26')]=function(_0x593055){var _0x1cd88f=this;return new Promise(function(_0x362f7f,_0x3cea62){return db[_0xab3e('0x1b')][_0xab3e('0x27')]({'raw':_0x593055[_0xab3e('0x1d')]?_0x593055[_0xab3e('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x593055[_0xab3e('0x1d')]?_0x593055[_0xab3e('0x1d')][_0xab3e('0x1f')]||null:null,'attributes':_0x593055['options']?_0x593055[_0xab3e('0x1d')][_0xab3e('0x22')]||null:null,'include':_0x593055[_0xab3e('0x1d')]?_0x593055[_0xab3e('0x1d')]['include']?_['map'](_0x593055['options'][_0xab3e('0x20')],function(_0x7f48f4){return{'model':db[_0x7f48f4[_0xab3e('0x21')]],'as':_0x7f48f4['as'],'attributes':_0x7f48f4[_0xab3e('0x22')],'include':_0x7f48f4[_0xab3e('0x20')]?_['map'](_0x7f48f4[_0xab3e('0x20')],function(_0x2ab647){return{'model':db[_0x2ab647['model']],'as':_0x2ab647['as'],'attributes':_0x2ab647[_0xab3e('0x22')],'include':_0x2ab647[_0xab3e('0x20')]?_[_0xab3e('0x23')](_0x2ab647[_0xab3e('0x20')],function(_0x1f13b3){return{'model':db[_0x1f13b3[_0xab3e('0x21')]],'as':_0x1f13b3['as'],'attributes':_0x1f13b3[_0xab3e('0x22')]};}):[]};}):[]};}):[]:[]})[_0xab3e('0x24')](function(_0x16eeb7){logger[_0xab3e('0x17')](_0xab3e('0x26'),_0x593055);logger[_0xab3e('0x13')](_0xab3e('0x26'),_0x593055,JSON[_0xab3e('0x25')](_0x16eeb7));_0x362f7f(_0x16eeb7);})[_0xab3e('0x19')](function(_0x15a440){logger[_0xab3e('0x15')](_0xab3e('0x26'),_0x15a440[_0xab3e('0x16')],_0x593055);_0x3cea62(_0x1cd88f[_0xab3e('0x15')](0x1f4,_0x15a440[_0xab3e('0x16')]));});});}; \ No newline at end of file +var _0x0255=['socket.io-emitter','register','request','then','MailQueue,\x20%s,\x20%s','request\x20sent','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','GetMailQueue','findAll','raw','where','options','attributes','limit','map','include','model','debug','find','ShowMailQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x2b90dc,_0x10b832){var _0x4794a6=function(_0x3720ca){while(--_0x3720ca){_0x2b90dc['push'](_0x2b90dc['shift']());}};_0x4794a6(++_0x10b832);}(_0x0255,0x110));var _0x5025=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0255[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5025('0x0'));var util=require(_0x5025('0x1'));var moment=require(_0x5025('0x2'));var BPromise=require(_0x5025('0x3'));var rs=require(_0x5025('0x4'));var fs=require('fs');var Redis=require(_0x5025('0x5'));var db=require(_0x5025('0x6'))['db'];var utils=require(_0x5025('0x7'));var logger=require(_0x5025('0x8'))('rpc');var config=require(_0x5025('0x9'));var jayson=require(_0x5025('0xa'));var client=jayson[_0x5025('0xb')][_0x5025('0xc')]({'port':0x232a});config[_0x5025('0xd')]=_[_0x5025('0xe')](config[_0x5025('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x5025('0xf'))(new Redis(config[_0x5025('0xd')]));require('./mailQueue.socket')[_0x5025('0x10')](socket);function respondWithRpcPromise(_0x53cba9,_0x35d3a4,_0x2ed669){return new BPromise(function(_0x3c1fd9,_0x1be1d8){return client[_0x5025('0x11')](_0x53cba9,_0x2ed669)[_0x5025('0x12')](function(_0x46989e){logger['info'](_0x5025('0x13'),_0x35d3a4,_0x5025('0x14'));logger['debug'](_0x5025('0x15'),_0x35d3a4,_0x5025('0x14'),JSON[_0x5025('0x16')](_0x46989e));if(_0x46989e[_0x5025('0x17')]){if(_0x46989e[_0x5025('0x17')][_0x5025('0x18')]===0x1f4){logger[_0x5025('0x17')]('MailQueue,\x20%s,\x20%s',_0x35d3a4,_0x46989e[_0x5025('0x17')][_0x5025('0x19')]);return _0x1be1d8(_0x46989e[_0x5025('0x17')][_0x5025('0x19')]);}logger[_0x5025('0x17')](_0x5025('0x13'),_0x35d3a4,_0x46989e['error'][_0x5025('0x19')]);return _0x3c1fd9(_0x46989e[_0x5025('0x17')][_0x5025('0x19')]);}else{logger[_0x5025('0x1a')](_0x5025('0x13'),_0x35d3a4,_0x5025('0x14'));_0x3c1fd9(_0x46989e['result']['message']);}})[_0x5025('0x1b')](function(_0xe35d87){logger[_0x5025('0x17')](_0x5025('0x13'),_0x35d3a4,_0xe35d87);_0x1be1d8(_0xe35d87);});});}exports[_0x5025('0x1c')]=function(_0x386f61){var _0x113150=this;return new Promise(function(_0x48ff53,_0x4d6d4a){return db['MailQueue'][_0x5025('0x1d')]({'raw':_0x386f61['options']?_0x386f61['options'][_0x5025('0x1e')]===undefined?!![]:![]:!![],'where':_0x386f61['options']?_0x386f61['options'][_0x5025('0x1f')]||null:null,'attributes':_0x386f61['options']?_0x386f61[_0x5025('0x20')][_0x5025('0x21')]||null:null,'limit':_0x386f61[_0x5025('0x20')]?_0x386f61['options'][_0x5025('0x22')]||null:null,'include':_0x386f61[_0x5025('0x20')]?_0x386f61[_0x5025('0x20')]['include']?_[_0x5025('0x23')](_0x386f61[_0x5025('0x20')][_0x5025('0x24')],function(_0x460b3d){return{'model':db[_0x460b3d[_0x5025('0x25')]],'as':_0x460b3d['as'],'attributes':_0x460b3d[_0x5025('0x21')],'include':_0x460b3d[_0x5025('0x24')]?_[_0x5025('0x23')](_0x460b3d['include'],function(_0xea9c54){return{'model':db[_0xea9c54[_0x5025('0x25')]],'as':_0xea9c54['as'],'attributes':_0xea9c54[_0x5025('0x21')],'include':_0xea9c54[_0x5025('0x24')]?_[_0x5025('0x23')](_0xea9c54[_0x5025('0x24')],function(_0x8ce312){return{'model':db[_0x8ce312[_0x5025('0x25')]],'as':_0x8ce312['as'],'attributes':_0x8ce312['attributes']};}):[]};}):[]};}):[]:[]})[_0x5025('0x12')](function(_0xff0605){logger[_0x5025('0x1a')]('GetMailQueue',_0x386f61);logger[_0x5025('0x26')](_0x5025('0x1c'),_0x386f61,JSON[_0x5025('0x16')](_0xff0605));_0x48ff53(_0xff0605);})['catch'](function(_0x555e87){logger[_0x5025('0x17')]('GetMailQueue',_0x555e87[_0x5025('0x19')],_0x386f61);_0x4d6d4a(_0x113150[_0x5025('0x17')](0x1f4,_0x555e87[_0x5025('0x19')]));});});};exports['ShowMailQueue']=function(_0x5717c8){var _0x19619b=this;return new Promise(function(_0x14600a,_0x3d5525){return db['MailQueue'][_0x5025('0x27')]({'raw':_0x5717c8['options']?_0x5717c8['options'][_0x5025('0x1e')]===undefined?!![]:![]:!![],'where':_0x5717c8[_0x5025('0x20')]?_0x5717c8[_0x5025('0x20')][_0x5025('0x1f')]||null:null,'attributes':_0x5717c8['options']?_0x5717c8[_0x5025('0x20')][_0x5025('0x21')]||null:null,'include':_0x5717c8[_0x5025('0x20')]?_0x5717c8[_0x5025('0x20')][_0x5025('0x24')]?_[_0x5025('0x23')](_0x5717c8[_0x5025('0x20')]['include'],function(_0x1c50ff){return{'model':db[_0x1c50ff[_0x5025('0x25')]],'as':_0x1c50ff['as'],'attributes':_0x1c50ff[_0x5025('0x21')],'include':_0x1c50ff[_0x5025('0x24')]?_['map'](_0x1c50ff[_0x5025('0x24')],function(_0x1b4c92){return{'model':db[_0x1b4c92[_0x5025('0x25')]],'as':_0x1b4c92['as'],'attributes':_0x1b4c92[_0x5025('0x21')],'include':_0x1b4c92[_0x5025('0x24')]?_[_0x5025('0x23')](_0x1b4c92['include'],function(_0x3cfc57){return{'model':db[_0x3cfc57[_0x5025('0x25')]],'as':_0x3cfc57['as'],'attributes':_0x3cfc57[_0x5025('0x21')]};}):[]};}):[]};}):[]:[]})[_0x5025('0x12')](function(_0x5c8cfe){logger[_0x5025('0x1a')](_0x5025('0x28'),_0x5717c8);logger[_0x5025('0x26')]('ShowMailQueue',_0x5717c8,JSON[_0x5025('0x16')](_0x5c8cfe));_0x14600a(_0x5c8cfe);})['catch'](function(_0x516091){logger[_0x5025('0x17')](_0x5025('0x28'),_0x516091['message'],_0x5717c8);_0x3d5525(_0x19619b[_0x5025('0x17')](0x1f4,_0x516091[_0x5025('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 4db8ff5..36dff2c 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 _0x6c3c=['register','mailQueue:','./mailQueue.events','save','update','removeListener'];(function(_0x39142d,_0x43a9cf){var _0x548686=function(_0x805172){while(--_0x805172){_0x39142d['push'](_0x39142d['shift']());}};_0x548686(++_0x43a9cf);}(_0x6c3c,0x110));var _0xc6c3=function(_0x397525,_0xe2afce){_0x397525=_0x397525-0x0;var _0x270cbe=_0x6c3c[_0x397525];return _0x270cbe;};'use strict';var MailQueueEvents=require(_0xc6c3('0x0'));var events=[_0xc6c3('0x1'),'remove',_0xc6c3('0x2')];function createListener(_0x28b4e5,_0x584e39){return function(_0x3f2672){_0x584e39['emit'](_0x28b4e5,_0x3f2672);};}function removeListener(_0x1e2f27,_0x4b2a78){return function(){MailQueueEvents[_0xc6c3('0x3')](_0x1e2f27,_0x4b2a78);};}exports[_0xc6c3('0x4')]=function(_0x21e72f){for(var _0x686f1=0x0,_0x16dd2f=events['length'];_0x686f1<_0x16dd2f;_0x686f1++){var _0x196f38=events[_0x686f1];var _0x38e62a=createListener(_0xc6c3('0x5')+_0x196f38,_0x21e72f);MailQueueEvents['on'](_0x196f38,_0x38e62a);}}; \ No newline at end of file +var _0x1bc6=['removeListener','register','length','mailQueue:','./mailQueue.events','save','remove','update'];(function(_0x40889c,_0x73e154){var _0x1e69a3=function(_0x365601){while(--_0x365601){_0x40889c['push'](_0x40889c['shift']());}};_0x1e69a3(++_0x73e154);}(_0x1bc6,0x94));var _0x61bc=function(_0x11f2ef,_0xa9afd4){_0x11f2ef=_0x11f2ef-0x0;var _0x4c571c=_0x1bc6[_0x11f2ef];return _0x4c571c;};'use strict';var MailQueueEvents=require(_0x61bc('0x0'));var events=[_0x61bc('0x1'),_0x61bc('0x2'),_0x61bc('0x3')];function createListener(_0x24a893,_0xc948a3){return function(_0x3b6377){_0xc948a3['emit'](_0x24a893,_0x3b6377);};}function removeListener(_0x2f54e3,_0x364993){return function(){MailQueueEvents[_0x61bc('0x4')](_0x2f54e3,_0x364993);};}exports[_0x61bc('0x5')]=function(_0x362ebb){for(var _0x1af9bc=0x0,_0x410656=events[_0x61bc('0x6')];_0x1af9bc<_0x410656;_0x1af9bc++){var _0x151ef4=events[_0x1af9bc];var _0x5ebb87=createListener(_0x61bc('0x7')+_0x151ef4,_0x362ebb);MailQueueEvents['on'](_0x151ef4,_0x5ebb87);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 04c8794..96dcfd1 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 _0x972b=['show','post','create','put','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id'];(function(_0x25143d,_0x5dbd18){var _0x58693a=function(_0x4b0748){while(--_0x4b0748){_0x25143d['push'](_0x25143d['shift']());}};_0x58693a(++_0x5dbd18);}(_0x972b,0x76));var _0xb972=function(_0x39d2de,_0x25dcb6){_0x39d2de=_0x39d2de-0x0;var _0x211d52=_0x972b[_0x39d2de];return _0x211d52;};'use strict';var multer=require(_0xb972('0x0'));var util=require(_0xb972('0x1'));var path=require(_0xb972('0x2'));var timeout=require(_0xb972('0x3'));var express=require(_0xb972('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb972('0x5'));var interaction=require(_0xb972('0x6'));var config=require(_0xb972('0x7'));var controller=require(_0xb972('0x8'));router['get']('/',auth[_0xb972('0x9')](),controller[_0xb972('0xa')]);router[_0xb972('0xb')](_0xb972('0xc'),auth[_0xb972('0x9')](),controller[_0xb972('0xd')]);router['get'](_0xb972('0xe'),auth['isAuthenticated'](),controller[_0xb972('0xf')]);router[_0xb972('0x10')]('/',auth[_0xb972('0x9')](),controller[_0xb972('0x11')]);router[_0xb972('0x12')](_0xb972('0xe'),auth[_0xb972('0x9')](),controller['update']);router['delete'](_0xb972('0xe'),auth[_0xb972('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x04f5=['multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailQueueReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','delete','destroy','exports'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x04f5,0xdc));var _0x504f=function(_0x10dbf6,_0x3ff964){_0x10dbf6=_0x10dbf6-0x0;var _0x452147=_0x04f5[_0x10dbf6];return _0x452147;};'use strict';var multer=require(_0x504f('0x0'));var util=require(_0x504f('0x1'));var path=require(_0x504f('0x2'));var timeout=require('connect-timeout');var express=require(_0x504f('0x3'));var router=express[_0x504f('0x4')]();var fs_extra=require(_0x504f('0x5'));var auth=require(_0x504f('0x6'));var interaction=require(_0x504f('0x7'));var config=require('../../config/environment');var controller=require(_0x504f('0x8'));router[_0x504f('0x9')]('/',auth['isAuthenticated'](),controller[_0x504f('0xa')]);router['get'](_0x504f('0xb'),auth[_0x504f('0xc')](),controller[_0x504f('0xd')]);router[_0x504f('0x9')](_0x504f('0xe'),auth[_0x504f('0xc')](),controller[_0x504f('0xf')]);router[_0x504f('0x10')]('/',auth['isAuthenticated'](),controller[_0x504f('0x11')]);router[_0x504f('0x12')](_0x504f('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x504f('0x13')](_0x504f('0xe'),auth[_0x504f('0xc')](),controller[_0x504f('0x14')]);module[_0x504f('0x15')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index d19f88f..67f27fd 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 _0x4edd=['STRING','DATE','moment'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x4edd,0x146));var _0xd4ed=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4edd[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0xd4ed('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xd4ed('0x1')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xd4ed('0x2')]},'leaveAt':{'type':Sequelize[_0xd4ed('0x2')]},'acceptAt':{'type':Sequelize[_0xd4ed('0x2')]},'exitAt':{'type':Sequelize[_0xd4ed('0x2')]},'reason':{'type':Sequelize[_0xd4ed('0x1')]}}; \ No newline at end of file +var _0xb9b3=['STRING','DATE','moment','sequelize'];(function(_0x4ed32d,_0x327695){var _0xf624df=function(_0x29518c){while(--_0x29518c){_0x4ed32d['push'](_0x4ed32d['shift']());}};_0xf624df(++_0x327695);}(_0xb9b3,0x1a6));var _0x3b9b=function(_0x2cf3e2,_0x5c6979){_0x2cf3e2=_0x2cf3e2-0x0;var _0x4afdbc=_0xb9b3[_0x2cf3e2];return _0x4afdbc;};'use strict';var moment=require(_0x3b9b('0x0'));var Sequelize=require(_0x3b9b('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x3b9b('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x3b9b('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x3b9b('0x3')]},'exitAt':{'type':Sequelize[_0x3b9b('0x3')]},'reason':{'type':Sequelize[_0x3b9b('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 3db584a..6deca6f 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 _0x1967=['crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','set','apply','save','update','then','status','error','name','send','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','MailQueueReport','includeAll','include','findAll','rows','show','params','fields','options','find','catch','create','body','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel'];(function(_0x3ba924,_0x3b99f0){var _0x4cc1df=function(_0x15bf28){while(--_0x15bf28){_0x3ba924['push'](_0x3ba924['shift']());}};_0x4cc1df(++_0x3b99f0);}(_0x1967,0x173));var _0x7196=function(_0x528a7a,_0x45f222){_0x528a7a=_0x528a7a-0x0;var _0x4375a7=_0x1967[_0x528a7a];return _0x4375a7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7196('0x0'));var zipdir=require(_0x7196('0x1'));var jsonpatch=require(_0x7196('0x2'));var rp=require(_0x7196('0x3'));var moment=require(_0x7196('0x4'));var BPromise=require(_0x7196('0x5'));var Mustache=require(_0x7196('0x6'));var util=require(_0x7196('0x7'));var path=require(_0x7196('0x8'));var sox=require(_0x7196('0x9'));var csv=require('to-csv');var ejs=require(_0x7196('0xa'));var fs=require('fs');var fs_extra=require(_0x7196('0xb'));var _=require(_0x7196('0xc'));var squel=require(_0x7196('0xd'));var crypto=require(_0x7196('0xe'));var jsforce=require(_0x7196('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7196('0x10'));var querystring=require(_0x7196('0x11'));var Papa=require(_0x7196('0x12'));var Redis=require(_0x7196('0x13'));var authService=require(_0x7196('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7196('0x15'));var logger=require(_0x7196('0x16'))(_0x7196('0x17'));var utils=require(_0x7196('0x18'));var config=require(_0x7196('0x19'));var licenseUtil=require(_0x7196('0x1a'));var db=require(_0x7196('0x1b'))['db'];function respondWithStatusCode(_0x325641,_0x24f1c3){_0x24f1c3=_0x24f1c3||0xcc;return function(_0xba707b){if(_0xba707b){return _0x325641[_0x7196('0x1c')](_0x24f1c3);}return _0x325641['status'](_0x24f1c3)[_0x7196('0x1d')]();};}function respondWithResult(_0x3feccd,_0x3545aa){_0x3545aa=_0x3545aa||0xc8;return function(_0xf098c1){if(_0xf098c1){return _0x3feccd['status'](_0x3545aa)[_0x7196('0x1e')](_0xf098c1);}};}function respondWithFilteredResult(_0x539414,_0xe32933){return function(_0x2590a6){if(_0x2590a6){var _0xf7e97=typeof _0xe32933[_0x7196('0x1f')]===_0x7196('0x20')&&typeof _0xe32933[_0x7196('0x21')]===_0x7196('0x20');var _0x1ed296=_0x2590a6[_0x7196('0x22')];var _0x32fe2b=_0xf7e97?0x0:_0xe32933[_0x7196('0x1f')];var _0x5b716a=_0xf7e97?_0x2590a6['count']:_0xe32933[_0x7196('0x1f')]+_0xe32933[_0x7196('0x21')];var _0x40418d;if(_0x5b716a>=_0x1ed296){_0x5b716a=_0x1ed296;_0x40418d=0xc8;}else{_0x40418d=0xce;}_0x539414['status'](_0x40418d);return _0x539414[_0x7196('0x23')]('Content-Range',_0x32fe2b+'-'+_0x5b716a+'/'+_0x1ed296)['json'](_0x2590a6);}return null;};}function patchUpdates(_0x296e07){return function(_0x627223){try{jsonpatch[_0x7196('0x24')](_0x627223,_0x296e07,!![]);}catch(_0x4ddf78){return BPromise['reject'](_0x4ddf78);}return _0x627223[_0x7196('0x25')]();};}function saveUpdates(_0x3cd8ff,_0x598a26){return function(_0x18649b){if(_0x18649b){return _0x18649b[_0x7196('0x26')](_0x3cd8ff)[_0x7196('0x27')](function(_0x18d389){return _0x18d389;});}return null;};}function removeEntity(_0x38b3d6,_0x549f34){return function(_0x3f8178){if(_0x3f8178){return _0x3f8178['destroy']()[_0x7196('0x27')](function(){_0x38b3d6[_0x7196('0x28')](0xcc)[_0x7196('0x1d')]();});}};}function handleEntityNotFound(_0xa69810,_0x70aa65){return function(_0x43f6a2){if(!_0x43f6a2){_0xa69810['sendStatus'](0x194);}return _0x43f6a2;};}function handleError(_0x57c404,_0x1482e5){_0x1482e5=_0x1482e5||0x1f4;return function(_0x2d284f){logger[_0x7196('0x29')](_0x2d284f['stack']);if(_0x2d284f['name']){delete _0x2d284f[_0x7196('0x2a')];}_0x57c404[_0x7196('0x28')](_0x1482e5)[_0x7196('0x2b')](_0x2d284f);};}exports['index']=function(_0x35eef9,_0x4ecea1){var _0x4fd339={},_0x59d79d={},_0x30151f={'count':0x0,'rows':[]};var _0x985727=_[_0x7196('0x2c')](db['MailQueueReport'][_0x7196('0x2d')],function(_0x45d567){return{'name':_0x45d567[_0x7196('0x2e')],'type':_0x45d567[_0x7196('0x2f')]['key']};});_0x59d79d[_0x7196('0x30')]=_[_0x7196('0x2c')](_0x985727,_0x7196('0x2a'));_0x59d79d[_0x7196('0x31')]=_[_0x7196('0x32')](_0x35eef9[_0x7196('0x31')]);_0x59d79d[_0x7196('0x33')]=_[_0x7196('0x34')](_0x59d79d[_0x7196('0x30')],_0x59d79d[_0x7196('0x31')]);_0x4fd339[_0x7196('0x35')]=_['intersection'](_0x59d79d[_0x7196('0x30')],qs['fields'](_0x35eef9[_0x7196('0x31')]['fields']));_0x4fd339[_0x7196('0x35')]=_0x4fd339[_0x7196('0x35')]['length']?_0x4fd339[_0x7196('0x35')]:_0x59d79d[_0x7196('0x30')];if(!_0x35eef9[_0x7196('0x31')][_0x7196('0x36')](_0x7196('0x37'))){_0x4fd339['limit']=qs[_0x7196('0x21')](_0x35eef9[_0x7196('0x31')][_0x7196('0x21')]);_0x4fd339[_0x7196('0x1f')]=qs[_0x7196('0x1f')](_0x35eef9[_0x7196('0x31')]['offset']);}_0x4fd339[_0x7196('0x38')]=qs[_0x7196('0x39')](_0x35eef9[_0x7196('0x31')]['sort']);_0x4fd339[_0x7196('0x3a')]=qs[_0x7196('0x33')](_[_0x7196('0x3b')](_0x35eef9[_0x7196('0x31')],_0x59d79d[_0x7196('0x33')]),_0x985727);if(_0x35eef9[_0x7196('0x31')][_0x7196('0x3c')]){_0x4fd339[_0x7196('0x3a')]=_[_0x7196('0x3d')](_0x4fd339[_0x7196('0x3a')],{'$or':_['map'](_0x985727,function(_0x257754){if(_0x257754[_0x7196('0x2f')]!=='VIRTUAL'){var _0x186efe={};_0x186efe[_0x257754['name']]={'$like':'%'+_0x35eef9['query'][_0x7196('0x3c')]+'%'};return _0x186efe;}})});}_0x4fd339=_[_0x7196('0x3d')]({},_0x4fd339,_0x35eef9['options']);var _0x587f6f={'where':_0x4fd339[_0x7196('0x3a')]};return db[_0x7196('0x3e')][_0x7196('0x22')](_0x587f6f)['then'](function(_0x36a990){_0x30151f[_0x7196('0x22')]=_0x36a990;if(_0x35eef9[_0x7196('0x31')][_0x7196('0x3f')]){_0x4fd339[_0x7196('0x40')]=[{'all':!![]}];}return db[_0x7196('0x3e')][_0x7196('0x41')](_0x4fd339);})[_0x7196('0x27')](function(_0x5cd903){_0x30151f[_0x7196('0x42')]=_0x5cd903;return _0x30151f;})[_0x7196('0x27')](respondWithFilteredResult(_0x4ecea1,_0x4fd339))['catch'](handleError(_0x4ecea1,null));};exports[_0x7196('0x43')]=function(_0x43d4c0,_0x48178f){var _0x471915={'raw':!![],'where':{'id':_0x43d4c0[_0x7196('0x44')]['id']}},_0x471bb2={};_0x471bb2['model']=_[_0x7196('0x32')](db[_0x7196('0x3e')]['rawAttributes']);_0x471bb2[_0x7196('0x31')]=_[_0x7196('0x32')](_0x43d4c0['query']);_0x471bb2[_0x7196('0x33')]=_['intersection'](_0x471bb2['model'],_0x471bb2['query']);_0x471915['attributes']=_['intersection'](_0x471bb2[_0x7196('0x30')],qs['fields'](_0x43d4c0[_0x7196('0x31')][_0x7196('0x45')]));_0x471915[_0x7196('0x35')]=_0x471915[_0x7196('0x35')]['length']?_0x471915[_0x7196('0x35')]:_0x471bb2['model'];if(_0x43d4c0[_0x7196('0x31')][_0x7196('0x3f')]){_0x471915[_0x7196('0x40')]=[{'all':!![]}];}_0x471915=_['merge']({},_0x471915,_0x43d4c0[_0x7196('0x46')]);return db[_0x7196('0x3e')][_0x7196('0x47')](_0x471915)['then'](handleEntityNotFound(_0x48178f,null))['then'](respondWithResult(_0x48178f,null))[_0x7196('0x48')](handleError(_0x48178f,null));};exports['create']=function(_0x29c7e8,_0x582884){return db['MailQueueReport'][_0x7196('0x49')](_0x29c7e8['body'],{})['then'](respondWithResult(_0x582884,0xc9))['catch'](handleError(_0x582884,null));};exports[_0x7196('0x26')]=function(_0x5052ee,_0x48e3b5){if(_0x5052ee[_0x7196('0x4a')]['id']){delete _0x5052ee[_0x7196('0x4a')]['id'];}return db[_0x7196('0x3e')][_0x7196('0x47')]({'where':{'id':_0x5052ee['params']['id']}})[_0x7196('0x27')](handleEntityNotFound(_0x48e3b5,null))['then'](saveUpdates(_0x5052ee[_0x7196('0x4a')],null))[_0x7196('0x27')](respondWithResult(_0x48e3b5,null))['catch'](handleError(_0x48e3b5,null));};exports[_0x7196('0x4b')]=function(_0x2fd056,_0x3fe092){return db['MailQueueReport'][_0x7196('0x47')]({'where':{'id':_0x2fd056['params']['id']}})[_0x7196('0x27')](handleEntityNotFound(_0x3fe092,null))[_0x7196('0x27')](removeEntity(_0x3fe092,null))[_0x7196('0x48')](handleError(_0x3fe092,null));};exports[_0x7196('0x4c')]=function(_0x41a9aa,_0x19733a){return db[_0x7196('0x3e')][_0x7196('0x4c')]()['then'](respondWithResult(_0x19733a,null))['catch'](handleError(_0x19733a,null));}; \ No newline at end of file +var _0x9536=['rawAttributes','intersection','length','options','find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','error','stack','name','index','map','MailQueueReport','fieldName','model','query','keys','filters','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','then','includeAll','include','findAll','rows','catch','params'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x9536,0x179));var _0x6953=function(_0x2c0dc0,_0x19900d){_0x2c0dc0=_0x2c0dc0-0x0;var _0x4c0990=_0x9536[_0x2c0dc0];return _0x4c0990;};'use strict';var emlformat=require(_0x6953('0x0'));var rimraf=require(_0x6953('0x1'));var zipdir=require(_0x6953('0x2'));var jsonpatch=require(_0x6953('0x3'));var rp=require('request-promise');var moment=require(_0x6953('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6953('0x5'));var util=require(_0x6953('0x6'));var path=require(_0x6953('0x7'));var sox=require(_0x6953('0x8'));var csv=require(_0x6953('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6953('0xa'));var _=require(_0x6953('0xb'));var squel=require(_0x6953('0xc'));var crypto=require(_0x6953('0xd'));var jsforce=require(_0x6953('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x6953('0x9'));var querystring=require(_0x6953('0xf'));var Papa=require(_0x6953('0x10'));var Redis=require('ioredis');var authService=require(_0x6953('0x11'));var qs=require(_0x6953('0x12'));var as=require(_0x6953('0x13'));var hardwareService=require(_0x6953('0x14'));var logger=require(_0x6953('0x15'))(_0x6953('0x16'));var utils=require(_0x6953('0x17'));var config=require(_0x6953('0x18'));var licenseUtil=require(_0x6953('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x358388,_0x513dd0){_0x513dd0=_0x513dd0||0xcc;return function(_0x8de91e){if(_0x8de91e){return _0x358388[_0x6953('0x1a')](_0x513dd0);}return _0x358388[_0x6953('0x1b')](_0x513dd0)[_0x6953('0x1c')]();};}function respondWithResult(_0x1b5221,_0x244713){_0x244713=_0x244713||0xc8;return function(_0x175fa9){if(_0x175fa9){return _0x1b5221[_0x6953('0x1b')](_0x244713)[_0x6953('0x1d')](_0x175fa9);}};}function respondWithFilteredResult(_0x31d182,_0xae5515){return function(_0x548473){if(_0x548473){var _0x5f49db=typeof _0xae5515[_0x6953('0x1e')]===_0x6953('0x1f')&&typeof _0xae5515[_0x6953('0x20')]===_0x6953('0x1f');var _0x510d46=_0x548473[_0x6953('0x21')];var _0x2da771=_0x5f49db?0x0:_0xae5515['offset'];var _0x10858a=_0x5f49db?_0x548473[_0x6953('0x21')]:_0xae5515[_0x6953('0x1e')]+_0xae5515[_0x6953('0x20')];var _0xc714d3;if(_0x10858a>=_0x510d46){_0x10858a=_0x510d46;_0xc714d3=0xc8;}else{_0xc714d3=0xce;}_0x31d182['status'](_0xc714d3);return _0x31d182[_0x6953('0x22')](_0x6953('0x23'),_0x2da771+'-'+_0x10858a+'/'+_0x510d46)[_0x6953('0x1d')](_0x548473);}return null;};}function patchUpdates(_0x2ba433){return function(_0x41f021){try{jsonpatch['apply'](_0x41f021,_0x2ba433,!![]);}catch(_0xf96d07){return BPromise[_0x6953('0x24')](_0xf96d07);}return _0x41f021['save']();};}function saveUpdates(_0x317979,_0x40c9d1){return function(_0xb92529){if(_0xb92529){return _0xb92529[_0x6953('0x25')](_0x317979)['then'](function(_0x37f339){return _0x37f339;});}return null;};}function removeEntity(_0x231cb2,_0x2a7f6a){return function(_0x508ea7){if(_0x508ea7){return _0x508ea7['destroy']()['then'](function(){_0x231cb2[_0x6953('0x1b')](0xcc)[_0x6953('0x1c')]();});}};}function handleEntityNotFound(_0x550be4,_0x1a32f4){return function(_0x587df0){if(!_0x587df0){_0x550be4[_0x6953('0x1a')](0x194);}return _0x587df0;};}function handleError(_0x2bf39b,_0xcdbce8){_0xcdbce8=_0xcdbce8||0x1f4;return function(_0x2cc01e){logger[_0x6953('0x26')](_0x2cc01e[_0x6953('0x27')]);if(_0x2cc01e['name']){delete _0x2cc01e[_0x6953('0x28')];}_0x2bf39b[_0x6953('0x1b')](_0xcdbce8)['send'](_0x2cc01e);};}exports[_0x6953('0x29')]=function(_0x4af39d,_0x173b3c){var _0x3b1175={},_0x426c7c={},_0x4b0325={'count':0x0,'rows':[]};var _0x131992=_[_0x6953('0x2a')](db[_0x6953('0x2b')]['rawAttributes'],function(_0x4c49fc){return{'name':_0x4c49fc[_0x6953('0x2c')],'type':_0x4c49fc['type']['key']};});_0x426c7c[_0x6953('0x2d')]=_[_0x6953('0x2a')](_0x131992,_0x6953('0x28'));_0x426c7c[_0x6953('0x2e')]=_[_0x6953('0x2f')](_0x4af39d['query']);_0x426c7c[_0x6953('0x30')]=_['intersection'](_0x426c7c[_0x6953('0x2d')],_0x426c7c[_0x6953('0x2e')]);_0x3b1175['attributes']=_['intersection'](_0x426c7c[_0x6953('0x2d')],qs[_0x6953('0x31')](_0x4af39d[_0x6953('0x2e')]['fields']));_0x3b1175[_0x6953('0x32')]=_0x3b1175['attributes']['length']?_0x3b1175['attributes']:_0x426c7c['model'];if(!_0x4af39d[_0x6953('0x2e')][_0x6953('0x33')](_0x6953('0x34'))){_0x3b1175[_0x6953('0x20')]=qs[_0x6953('0x20')](_0x4af39d[_0x6953('0x2e')]['limit']);_0x3b1175[_0x6953('0x1e')]=qs['offset'](_0x4af39d[_0x6953('0x2e')]['offset']);}_0x3b1175[_0x6953('0x35')]=qs[_0x6953('0x36')](_0x4af39d[_0x6953('0x2e')][_0x6953('0x36')]);_0x3b1175['where']=qs[_0x6953('0x30')](_[_0x6953('0x37')](_0x4af39d[_0x6953('0x2e')],_0x426c7c[_0x6953('0x30')]),_0x131992);if(_0x4af39d[_0x6953('0x2e')][_0x6953('0x38')]){_0x3b1175[_0x6953('0x39')]=_[_0x6953('0x3a')](_0x3b1175[_0x6953('0x39')],{'$or':_[_0x6953('0x2a')](_0x131992,function(_0x2d9d81){if(_0x2d9d81['type']!==_0x6953('0x3b')){var _0x3c03ab={};_0x3c03ab[_0x2d9d81[_0x6953('0x28')]]={'$like':'%'+_0x4af39d['query']['filter']+'%'};return _0x3c03ab;}})});}_0x3b1175=_[_0x6953('0x3a')]({},_0x3b1175,_0x4af39d['options']);var _0x5abaf2={'where':_0x3b1175[_0x6953('0x39')]};return db[_0x6953('0x2b')]['count'](_0x5abaf2)[_0x6953('0x3c')](function(_0x263728){_0x4b0325[_0x6953('0x21')]=_0x263728;if(_0x4af39d[_0x6953('0x2e')][_0x6953('0x3d')]){_0x3b1175[_0x6953('0x3e')]=[{'all':!![]}];}return db['MailQueueReport'][_0x6953('0x3f')](_0x3b1175);})[_0x6953('0x3c')](function(_0x30a27a){_0x4b0325[_0x6953('0x40')]=_0x30a27a;return _0x4b0325;})[_0x6953('0x3c')](respondWithFilteredResult(_0x173b3c,_0x3b1175))[_0x6953('0x41')](handleError(_0x173b3c,null));};exports['show']=function(_0x5a40de,_0xeef91a){var _0x54d7c2={'raw':!![],'where':{'id':_0x5a40de[_0x6953('0x42')]['id']}},_0x588ff8={};_0x588ff8[_0x6953('0x2d')]=_[_0x6953('0x2f')](db[_0x6953('0x2b')][_0x6953('0x43')]);_0x588ff8['query']=_['keys'](_0x5a40de[_0x6953('0x2e')]);_0x588ff8[_0x6953('0x30')]=_['intersection'](_0x588ff8[_0x6953('0x2d')],_0x588ff8['query']);_0x54d7c2[_0x6953('0x32')]=_[_0x6953('0x44')](_0x588ff8[_0x6953('0x2d')],qs[_0x6953('0x31')](_0x5a40de['query'][_0x6953('0x31')]));_0x54d7c2[_0x6953('0x32')]=_0x54d7c2['attributes'][_0x6953('0x45')]?_0x54d7c2[_0x6953('0x32')]:_0x588ff8[_0x6953('0x2d')];if(_0x5a40de[_0x6953('0x2e')][_0x6953('0x3d')]){_0x54d7c2[_0x6953('0x3e')]=[{'all':!![]}];}_0x54d7c2=_[_0x6953('0x3a')]({},_0x54d7c2,_0x5a40de[_0x6953('0x46')]);return db[_0x6953('0x2b')][_0x6953('0x47')](_0x54d7c2)[_0x6953('0x3c')](handleEntityNotFound(_0xeef91a,null))['then'](respondWithResult(_0xeef91a,null))[_0x6953('0x41')](handleError(_0xeef91a,null));};exports['create']=function(_0x15c142,_0x1d5979){return db[_0x6953('0x2b')]['create'](_0x15c142[_0x6953('0x48')],{})[_0x6953('0x3c')](respondWithResult(_0x1d5979,0xc9))['catch'](handleError(_0x1d5979,null));};exports['update']=function(_0xbf5b61,_0x265b44){if(_0xbf5b61[_0x6953('0x48')]['id']){delete _0xbf5b61[_0x6953('0x48')]['id'];}return db[_0x6953('0x2b')][_0x6953('0x47')]({'where':{'id':_0xbf5b61[_0x6953('0x42')]['id']}})[_0x6953('0x3c')](handleEntityNotFound(_0x265b44,null))[_0x6953('0x3c')](saveUpdates(_0xbf5b61[_0x6953('0x48')],null))[_0x6953('0x3c')](respondWithResult(_0x265b44,null))['catch'](handleError(_0x265b44,null));};exports['destroy']=function(_0x14a7bf,_0x38e3e8){return db[_0x6953('0x2b')][_0x6953('0x47')]({'where':{'id':_0x14a7bf[_0x6953('0x42')]['id']}})[_0x6953('0x3c')](handleEntityNotFound(_0x38e3e8,null))[_0x6953('0x3c')](removeEntity(_0x38e3e8,null))[_0x6953('0x41')](handleError(_0x38e3e8,null));};exports[_0x6953('0x49')]=function(_0x50b962,_0x5f15b0){return db['MailQueueReport']['describe']()[_0x6953('0x3c')](respondWithResult(_0x5f15b0,null))[_0x6953('0x41')](handleError(_0x5f15b0,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index abf1934..e28739d 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 _0x255b=['define','MailQueueReport','report_mail_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueueReport.attributes','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x255b,0xc4));var _0xb255=function(_0x5d8ae3,_0x144e41){_0x5d8ae3=_0x5d8ae3-0x0;var _0x179d6d=_0x255b[_0x5d8ae3];return _0x179d6d;};'use strict';var _=require(_0xb255('0x0'));var util=require(_0xb255('0x1'));var logger=require(_0xb255('0x2'))(_0xb255('0x3'));var moment=require(_0xb255('0x4'));var BPromise=require(_0xb255('0x5'));var rp=require(_0xb255('0x6'));var fs=require('fs');var path=require(_0xb255('0x7'));var rimraf=require(_0xb255('0x8'));var config=require(_0xb255('0x9'));var attributes=require(_0xb255('0xa'));module[_0xb255('0xb')]=function(_0x6a3cb2,_0xd82b87){return _0x6a3cb2[_0xb255('0xc')](_0xb255('0xd'),attributes,{'tableName':_0xb255('0xe'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xb255('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x82e7=['MailQueueReport','report_mail_queue','uniqueid','lodash','../../config/logger','api','../../config/environment','./mailQueueReport.attributes','exports','define'];(function(_0xeb67cb,_0x3facda){var _0xc8fe96=function(_0x4074a2){while(--_0x4074a2){_0xeb67cb['push'](_0xeb67cb['shift']());}};_0xc8fe96(++_0x3facda);}(_0x82e7,0x1e3));var _0x782e=function(_0x13f5fe,_0x460a12){_0x13f5fe=_0x13f5fe-0x0;var _0x481c05=_0x82e7[_0x13f5fe];return _0x481c05;};'use strict';var _=require(_0x782e('0x0'));var util=require('util');var logger=require(_0x782e('0x1'))(_0x782e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x782e('0x3'));var attributes=require(_0x782e('0x4'));module[_0x782e('0x5')]=function(_0x152e32,_0x368b23){return _0x152e32[_0x782e('0x6')](_0x782e('0x7'),attributes,{'tableName':_0x782e('0x8'),'paranoid':![],'indexes':[{'name':_0x782e('0x9'),'fields':[_0x782e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 3175b74..89aa59a 100644 --- a/server/api/mailQueueReport/mailQueueReport.rpc.js +++ b/server/api/mailQueueReport/mailQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x326f=['error','code','message','result','catch','CreateMailQueueReport','MailQueueReport','options','raw','stringify','UpdateMailQueueReport','body','attributes','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x19e92b,_0x24a8b6){var _0x4a1812=function(_0x1732f2){while(--_0x1732f2){_0x19e92b['push'](_0x19e92b['shift']());}};_0x4a1812(++_0x24a8b6);}(_0x326f,0xd1));var _0xf326=function(_0x40c5da,_0x92f06a){_0x40c5da=_0x40c5da-0x0;var _0x3b4cb7=_0x326f[_0x40c5da];return _0x3b4cb7;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('MailQueueReport,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});}exports[_0xf326('0x14')]=function(_0x453100){var _0x18bee3=this;return new Promise(function(_0x31ffb9,_0xcef2b5){return db[_0xf326('0x15')]['create'](_0x453100['body'],{'raw':_0x453100['options']?_0x453100[_0xf326('0x16')][_0xf326('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x4cabce){logger[_0xf326('0xb')]('CreateMailQueueReport',_0x453100);logger['debug'](_0xf326('0x14'),_0x453100,JSON[_0xf326('0x18')](_0x4cabce));_0x31ffb9(_0x4cabce);})['catch'](function(_0x5aa184){logger[_0xf326('0xf')](_0xf326('0x14'),_0x5aa184['message'],_0x453100);_0xcef2b5(_0x18bee3[_0xf326('0xf')](0x1f4,_0x5aa184[_0xf326('0x11')]));});});};exports[_0xf326('0x19')]=function(_0x295752){var _0x17c157=this;return new Promise(function(_0x2049ec,_0x5ce532){return db['MailQueueReport']['update'](_0x295752[_0xf326('0x1a')],{'raw':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')][_0xf326('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')]['where']||null:null,'attributes':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')][_0xf326('0x1b')]||null:null,'limit':_0x295752['options']?_0x295752[_0xf326('0x16')]['limit']||null:null})['then'](function(_0x6a8e89){logger[_0xf326('0xb')](_0xf326('0x19'),_0x295752);logger['debug'](_0xf326('0x19'),_0x295752,JSON[_0xf326('0x18')](_0x6a8e89));_0x2049ec(_0x6a8e89);})['catch'](function(_0x225776){logger[_0xf326('0xf')](_0xf326('0x19'),_0x225776[_0xf326('0x11')],_0x295752);_0x5ce532(_0x17c157[_0xf326('0xf')](0x1f4,_0x225776[_0xf326('0x11')]));});});}; \ No newline at end of file +var _0xadb5=['MailQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateMailQueueReport','create','options','raw','debug','MailQueueReport','body','attributes','limit','UpdateMailQueueReport','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0xb3423d,_0x20593d){var _0x41398c=function(_0x28f360){while(--_0x28f360){_0xb3423d['push'](_0xb3423d['shift']());}};_0x41398c(++_0x20593d);}(_0xadb5,0xad));var _0x5adb=function(_0x218769,_0x34c8fd){_0x218769=_0x218769-0x0;var _0x59e854=_0xadb5[_0x218769];return _0x59e854;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('MailQueueReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}exports[_0x5adb('0x15')]=function(_0x529b65){var _0x3fff62=this;return new Promise(function(_0x5de028,_0x1d9e86){return db['MailQueueReport'][_0x5adb('0x16')](_0x529b65['body'],{'raw':_0x529b65['options']?_0x529b65[_0x5adb('0x17')][_0x5adb('0x18')]===undefined?!![]:![]:!![]})[_0x5adb('0xb')](function(_0x1fd4a7){logger[_0x5adb('0xc')]('CreateMailQueueReport',_0x529b65);logger[_0x5adb('0x19')]('CreateMailQueueReport',_0x529b65,JSON['stringify'](_0x1fd4a7));_0x5de028(_0x1fd4a7);})[_0x5adb('0x14')](function(_0x379b33){logger[_0x5adb('0x10')](_0x5adb('0x15'),_0x379b33[_0x5adb('0x12')],_0x529b65);_0x1d9e86(_0x3fff62[_0x5adb('0x10')](0x1f4,_0x379b33[_0x5adb('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x4b1957){var _0x373cc3=this;return new Promise(function(_0x3220cd,_0x3839fb){return db[_0x5adb('0x1a')]['update'](_0x4b1957[_0x5adb('0x1b')],{'raw':_0x4b1957[_0x5adb('0x17')]?_0x4b1957['options'][_0x5adb('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')]['where']||null:null,'attributes':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')][_0x5adb('0x1c')]||null:null,'limit':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')][_0x5adb('0x1d')]||null:null})['then'](function(_0x49992e){logger['info'](_0x5adb('0x1e'),_0x4b1957);logger[_0x5adb('0x19')](_0x5adb('0x1e'),_0x4b1957,JSON[_0x5adb('0xf')](_0x49992e));_0x3220cd(_0x49992e);})[_0x5adb('0x14')](function(_0x4de310){logger[_0x5adb('0x10')](_0x5adb('0x1e'),_0x4de310[_0x5adb('0x12')],_0x4b1957);_0x3839fb(_0x373cc3[_0x5adb('0x10')](0x1f4,_0x4de310[_0x5adb('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 4ebba5b..8215f26 100644 --- a/server/api/mailServerIn/index.js +++ b/server/api/mailServerIn/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x406e73,_0x3a3f65){var _0x5ca6f2=function(_0x34b2b3){while(--_0x34b2b3){_0x406e73['push'](_0x406e73['shift']());}};_0x5ca6f2(++_0x3a3f65);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x742f2a,_0x4f6656){var _0x58fd50=function(_0x2fd716){while(--_0x2fd716){_0x742f2a['push'](_0x742f2a['shift']());}};_0x58fd50(++_0x4f6656);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index a71131e..c5bdbf1 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 _0x325f=['INTEGER','INBOX','sequelize','exports','STRING','BOOLEAN'];(function(_0x2a9ade,_0x39e010){var _0x18c484=function(_0x5314e7){while(--_0x5314e7){_0x2a9ade['push'](_0x2a9ade['shift']());}};_0x18c484(++_0x39e010);}(_0x325f,0x17c));var _0xf325=function(_0x1d38f2,_0x21ed54){_0x1d38f2=_0x1d38f2-0x0;var _0xddf45f=_0x325f[_0x1d38f2];return _0xddf45f;};'use strict';var Sequelize=require(_0xf325('0x0'));module[_0xf325('0x1')]={'description':{'type':Sequelize[_0xf325('0x2')]},'host':{'type':Sequelize[_0xf325('0x2')]},'authentication':{'type':Sequelize[_0xf325('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0xf325('0x2')]},'password':{'type':Sequelize[_0xf325('0x2')]},'port':{'type':Sequelize[_0xf325('0x4')]},'tls':{'type':Sequelize[_0xf325('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xf325('0x2')],'defaultValue':_0xf325('0x5')},'connTimeout':{'type':Sequelize[_0xf325('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xf325('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0xf325('0x2')]},'modernAuthentication':{'type':Sequelize[_0xf325('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xdf87=['INTEGER','INBOX','sequelize','STRING','BOOLEAN'];(function(_0x1328be,_0x351d77){var _0x3efd71=function(_0x28156f){while(--_0x28156f){_0x1328be['push'](_0x1328be['shift']());}};_0x3efd71(++_0x351d77);}(_0xdf87,0x19c));var _0x7df8=function(_0x3b9f6b,_0x19ea0d){_0x3b9f6b=_0x3b9f6b-0x0;var _0x24db12=_0xdf87[_0x3b9f6b];return _0x24db12;};'use strict';var Sequelize=require(_0x7df8('0x0'));module['exports']={'description':{'type':Sequelize[_0x7df8('0x1')]},'host':{'type':Sequelize[_0x7df8('0x1')]},'authentication':{'type':Sequelize[_0x7df8('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0x7df8('0x1')]},'password':{'type':Sequelize[_0x7df8('0x1')]},'port':{'type':Sequelize[_0x7df8('0x3')]},'tls':{'type':Sequelize[_0x7df8('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x7df8('0x1')],'defaultValue':_0x7df8('0x4')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x7df8('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0x7df8('0x1')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 2a50f47..68a956b 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 _0x0d84=['rimraf','../../config/environment','./mailServerIn.attributes','exports','define','mail_servers_in','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0xe94bd5,_0x44a5b8){var _0x1a4390=function(_0xf44d9a){while(--_0xf44d9a){_0xe94bd5['push'](_0xe94bd5['shift']());}};_0x1a4390(++_0x44a5b8);}(_0x0d84,0x158));var _0x40d8=function(_0x31891b,_0x19f5bb){_0x31891b=_0x31891b-0x0;var _0x1b4508=_0x0d84[_0x31891b];return _0x1b4508;};'use strict';var _=require(_0x40d8('0x0'));var util=require(_0x40d8('0x1'));var logger=require(_0x40d8('0x2'))(_0x40d8('0x3'));var moment=require('moment');var BPromise=require(_0x40d8('0x4'));var rp=require(_0x40d8('0x5'));var fs=require('fs');var path=require(_0x40d8('0x6'));var rimraf=require(_0x40d8('0x7'));var config=require(_0x40d8('0x8'));var attributes=require(_0x40d8('0x9'));module[_0x40d8('0xa')]=function(_0x3c6bc2,_0x3a3f3c){return _0x3c6bc2[_0x40d8('0xb')]('MailServerIn',attributes,{'tableName':_0x40d8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x41af=['exports','define','MailServerIn','mail_servers_in','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./mailServerIn.attributes'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x41af,0x1e5));var _0xf41a=function(_0x3d7fe9,_0x2f6fad){_0x3d7fe9=_0x3d7fe9-0x0;var _0x356b13=_0x41af[_0x3d7fe9];return _0x356b13;};'use strict';var _=require(_0xf41a('0x0'));var util=require(_0xf41a('0x1'));var logger=require(_0xf41a('0x2'))('api');var moment=require(_0xf41a('0x3'));var BPromise=require(_0xf41a('0x4'));var rp=require(_0xf41a('0x5'));var fs=require('fs');var path=require(_0xf41a('0x6'));var rimraf=require('rimraf');var config=require(_0xf41a('0x7'));var attributes=require(_0xf41a('0x8'));module[_0xf41a('0x9')]=function(_0x175567,_0x26a9ce){return _0x175567[_0xf41a('0xa')](_0xf41a('0xb'),attributes,{'tableName':_0xf41a('0xc'),'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 43c3477..d7fa546 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 _0xfd65=['request\x20sent','stringify','error','code','message','result','catch','GetMailServerIn','MailServerIn','findAll','options','where','attributes','limit','include','map','model','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','MailServerIn,\x20%s,\x20%s','debug'];(function(_0x247523,_0x7bcf9c){var _0x452855=function(_0x35653f){while(--_0x35653f){_0x247523['push'](_0x247523['shift']());}};_0x452855(++_0x7bcf9c);}(_0xfd65,0x13d));var _0x5fd6=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0xfd65[_0x2e4aa2];return _0x5e6092;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x5fd6('0x0'));var rs=require(_0x5fd6('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5fd6('0x2'))['db'];var utils=require(_0x5fd6('0x3'));var logger=require(_0x5fd6('0x4'))(_0x5fd6('0x5'));var config=require(_0x5fd6('0x6'));var jayson=require(_0x5fd6('0x7'));var client=jayson[_0x5fd6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x57018f,_0x13b98a,_0x23542d){return new BPromise(function(_0xd8153e,_0x3c2e99){return client['request'](_0x57018f,_0x23542d)[_0x5fd6('0x9')](function(_0x4f8667){logger[_0x5fd6('0xa')](_0x5fd6('0xb'),_0x13b98a,'request\x20sent');logger[_0x5fd6('0xc')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x13b98a,_0x5fd6('0xd'),JSON[_0x5fd6('0xe')](_0x4f8667));if(_0x4f8667[_0x5fd6('0xf')]){if(_0x4f8667['error'][_0x5fd6('0x10')]===0x1f4){logger[_0x5fd6('0xf')](_0x5fd6('0xb'),_0x13b98a,_0x4f8667[_0x5fd6('0xf')][_0x5fd6('0x11')]);return _0x3c2e99(_0x4f8667[_0x5fd6('0xf')][_0x5fd6('0x11')]);}logger['error']('MailServerIn,\x20%s,\x20%s',_0x13b98a,_0x4f8667[_0x5fd6('0xf')][_0x5fd6('0x11')]);return _0xd8153e(_0x4f8667[_0x5fd6('0xf')][_0x5fd6('0x11')]);}else{logger['info'](_0x5fd6('0xb'),_0x13b98a,'request\x20sent');_0xd8153e(_0x4f8667[_0x5fd6('0x12')][_0x5fd6('0x11')]);}})[_0x5fd6('0x13')](function(_0x258b05){logger[_0x5fd6('0xf')](_0x5fd6('0xb'),_0x13b98a,_0x258b05);_0x3c2e99(_0x258b05);});});}exports[_0x5fd6('0x14')]=function(_0x304ee5){var _0xab4248=this;return new Promise(function(_0xeef438,_0x1c46e9){return db[_0x5fd6('0x15')][_0x5fd6('0x16')]({'raw':_0x304ee5['options']?_0x304ee5['options']['raw']===undefined?!![]:![]:!![],'where':_0x304ee5[_0x5fd6('0x17')]?_0x304ee5[_0x5fd6('0x17')][_0x5fd6('0x18')]||null:null,'attributes':_0x304ee5[_0x5fd6('0x17')]?_0x304ee5[_0x5fd6('0x17')][_0x5fd6('0x19')]||null:null,'limit':_0x304ee5['options']?_0x304ee5[_0x5fd6('0x17')][_0x5fd6('0x1a')]||null:null,'include':_0x304ee5[_0x5fd6('0x17')]?_0x304ee5[_0x5fd6('0x17')][_0x5fd6('0x1b')]?_[_0x5fd6('0x1c')](_0x304ee5['options'][_0x5fd6('0x1b')],function(_0x44f7c7){return{'model':db[_0x44f7c7[_0x5fd6('0x1d')]],'as':_0x44f7c7['as'],'attributes':_0x44f7c7[_0x5fd6('0x19')],'include':_0x44f7c7[_0x5fd6('0x1b')]?_[_0x5fd6('0x1c')](_0x44f7c7[_0x5fd6('0x1b')],function(_0x4d0ad4){return{'model':db[_0x4d0ad4['model']],'as':_0x4d0ad4['as'],'attributes':_0x4d0ad4[_0x5fd6('0x19')],'include':_0x4d0ad4[_0x5fd6('0x1b')]?_[_0x5fd6('0x1c')](_0x4d0ad4[_0x5fd6('0x1b')],function(_0x2e06e6){return{'model':db[_0x2e06e6[_0x5fd6('0x1d')]],'as':_0x2e06e6['as'],'attributes':_0x2e06e6[_0x5fd6('0x19')]};}):[]};}):[]};}):[]:[]})[_0x5fd6('0x9')](function(_0xec0acc){logger[_0x5fd6('0xa')](_0x5fd6('0x14'),_0x304ee5);logger[_0x5fd6('0xc')](_0x5fd6('0x14'),_0x304ee5,JSON[_0x5fd6('0xe')](_0xec0acc));_0xeef438(_0xec0acc);})['catch'](function(_0x7cbc77){logger[_0x5fd6('0xf')](_0x5fd6('0x14'),_0x7cbc77[_0x5fd6('0x11')],_0x304ee5);_0x1c46e9(_0xab4248['error'](0x1f4,_0x7cbc77['message']));});});}; \ No newline at end of file +var _0x87d1=['code','message','result','catch','GetMailServerIn','MailServerIn','findAll','options','where','attributes','map','include','model','then','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x251fa4,_0x3d5860){var _0x453047=function(_0x337a6f){while(--_0x337a6f){_0x251fa4['push'](_0x251fa4['shift']());}};_0x453047(++_0x3d5860);}(_0x87d1,0x1a1));var _0x187d=function(_0x1645c8,_0x57b732){_0x1645c8=_0x1645c8-0x0;var _0x3ef7f6=_0x87d1[_0x1645c8];return _0x3ef7f6;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x187d('0x0'));var rs=require(_0x187d('0x1'));var fs=require('fs');var Redis=require(_0x187d('0x2'));var db=require(_0x187d('0x3'))['db'];var utils=require(_0x187d('0x4'));var logger=require(_0x187d('0x5'))(_0x187d('0x6'));var config=require(_0x187d('0x7'));var jayson=require(_0x187d('0x8'));var client=jayson['client'][_0x187d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x368169,_0x371756,_0x22de40){return new BPromise(function(_0x4d0256,_0x3b9810){return client[_0x187d('0xa')](_0x368169,_0x22de40)['then'](function(_0xb7d916){logger[_0x187d('0xb')](_0x187d('0xc'),_0x371756,_0x187d('0xd'));logger[_0x187d('0xe')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x371756,_0x187d('0xd'),JSON[_0x187d('0xf')](_0xb7d916));if(_0xb7d916['error']){if(_0xb7d916[_0x187d('0x10')][_0x187d('0x11')]===0x1f4){logger[_0x187d('0x10')](_0x187d('0xc'),_0x371756,_0xb7d916[_0x187d('0x10')][_0x187d('0x12')]);return _0x3b9810(_0xb7d916[_0x187d('0x10')][_0x187d('0x12')]);}logger[_0x187d('0x10')](_0x187d('0xc'),_0x371756,_0xb7d916[_0x187d('0x10')]['message']);return _0x4d0256(_0xb7d916[_0x187d('0x10')][_0x187d('0x12')]);}else{logger[_0x187d('0xb')](_0x187d('0xc'),_0x371756,_0x187d('0xd'));_0x4d0256(_0xb7d916[_0x187d('0x13')][_0x187d('0x12')]);}})[_0x187d('0x14')](function(_0x121518){logger['error']('MailServerIn,\x20%s,\x20%s',_0x371756,_0x121518);_0x3b9810(_0x121518);});});}exports[_0x187d('0x15')]=function(_0x511c6f){var _0x152d28=this;return new Promise(function(_0x44ae7b,_0x41e731){return db[_0x187d('0x16')][_0x187d('0x17')]({'raw':_0x511c6f['options']?_0x511c6f[_0x187d('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x511c6f['options']?_0x511c6f[_0x187d('0x18')][_0x187d('0x19')]||null:null,'attributes':_0x511c6f[_0x187d('0x18')]?_0x511c6f[_0x187d('0x18')][_0x187d('0x1a')]||null:null,'limit':_0x511c6f[_0x187d('0x18')]?_0x511c6f[_0x187d('0x18')]['limit']||null:null,'include':_0x511c6f['options']?_0x511c6f[_0x187d('0x18')]['include']?_[_0x187d('0x1b')](_0x511c6f['options'][_0x187d('0x1c')],function(_0x2ae80e){return{'model':db[_0x2ae80e[_0x187d('0x1d')]],'as':_0x2ae80e['as'],'attributes':_0x2ae80e['attributes'],'include':_0x2ae80e['include']?_[_0x187d('0x1b')](_0x2ae80e[_0x187d('0x1c')],function(_0x335c64){return{'model':db[_0x335c64['model']],'as':_0x335c64['as'],'attributes':_0x335c64[_0x187d('0x1a')],'include':_0x335c64['include']?_['map'](_0x335c64[_0x187d('0x1c')],function(_0x2c34e8){return{'model':db[_0x2c34e8[_0x187d('0x1d')]],'as':_0x2c34e8['as'],'attributes':_0x2c34e8[_0x187d('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x187d('0x1e')](function(_0x45388e){logger[_0x187d('0xb')]('GetMailServerIn',_0x511c6f);logger[_0x187d('0xe')](_0x187d('0x15'),_0x511c6f,JSON[_0x187d('0xf')](_0x45388e));_0x44ae7b(_0x45388e);})[_0x187d('0x14')](function(_0x169264){logger[_0x187d('0x10')](_0x187d('0x15'),_0x169264['message'],_0x511c6f);_0x41e731(_0x152d28[_0x187d('0x10')](0x1f4,_0x169264[_0x187d('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index e54706b..7162571 100644 --- a/server/api/mailServerOut/index.js +++ b/server/api/mailServerOut/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x7a54,0x106));var _0x47a5=function(_0x53b4d6,_0x42f854){_0x53b4d6=_0x53b4d6-0x0;var _0x304a55=_0x7a54[_0x53b4d6];return _0x304a55;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file +var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x7a54,0x106));var _0x47a5=function(_0xdfe5ad,_0x556e2a){_0xdfe5ad=_0xdfe5ad-0x0;var _0xe7f4e6=_0x7a54[_0xdfe5ad];return _0xe7f4e6;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index 1c3d641..930348c 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 _0xbc9d=['sequelize','exports','STRING','BOOLEAN'];(function(_0x184f55,_0x22c673){var _0x2733c0=function(_0x751e6c){while(--_0x751e6c){_0x184f55['push'](_0x184f55['shift']());}};_0x2733c0(++_0x22c673);}(_0xbc9d,0xb4));var _0xdbc9=function(_0x5c0f69,_0x2d4746){_0x5c0f69=_0x5c0f69-0x0;var _0x1a18ff=_0xbc9d[_0x5c0f69];return _0x1a18ff;};'use strict';var Sequelize=require(_0xdbc9('0x0'));module[_0xdbc9('0x1')]={'description':{'type':Sequelize[_0xdbc9('0x2')]},'host':{'type':Sequelize[_0xdbc9('0x2')]},'user':{'type':Sequelize[_0xdbc9('0x2')]},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0xdbc9('0x2')]},'authentication':{'type':Sequelize[_0xdbc9('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0xdbc9('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x4213=['exports','STRING','INTEGER','BOOLEAN','sequelize'];(function(_0x3207aa,_0xe86a72){var _0x51758f=function(_0x9ff790){while(--_0x9ff790){_0x3207aa['push'](_0x3207aa['shift']());}};_0x51758f(++_0xe86a72);}(_0x4213,0x77));var _0x3421=function(_0x4079cb,_0x51c013){_0x4079cb=_0x4079cb-0x0;var _0x3e51cb=_0x4213[_0x4079cb];return _0x3e51cb;};'use strict';var Sequelize=require(_0x3421('0x0'));module[_0x3421('0x1')]={'description':{'type':Sequelize[_0x3421('0x2')]},'host':{'type':Sequelize[_0x3421('0x2')]},'user':{'type':Sequelize[_0x3421('0x2')]},'pass':{'type':Sequelize[_0x3421('0x2')]},'port':{'type':Sequelize[_0x3421('0x3')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0x3421('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x3421('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 9bcc8ce..6d55620 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 _0xf388=['find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','destroy','then','error','name','send','index','map','MailServerOut','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','merge','filter','includeAll','include','findAll','rows','show','params','options'];(function(_0x17ee8f,_0x3a7078){var _0x52dde5=function(_0x3e8cb2){while(--_0x3e8cb2){_0x17ee8f['push'](_0x17ee8f['shift']());}};_0x52dde5(++_0x3a7078);}(_0xf388,0x13c));var _0x8f38=function(_0x409cbf,_0x5f1b4f){_0x409cbf=_0x409cbf-0x0;var _0x484680=_0xf388[_0x409cbf];return _0x484680;};'use strict';var emlformat=require(_0x8f38('0x0'));var rimraf=require(_0x8f38('0x1'));var zipdir=require(_0x8f38('0x2'));var jsonpatch=require(_0x8f38('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8f38('0x4'));var Mustache=require(_0x8f38('0x5'));var util=require(_0x8f38('0x6'));var path=require(_0x8f38('0x7'));var sox=require(_0x8f38('0x8'));var csv=require(_0x8f38('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8f38('0xa'));var _=require(_0x8f38('0xb'));var squel=require(_0x8f38('0xc'));var crypto=require(_0x8f38('0xd'));var jsforce=require(_0x8f38('0xe'));var deskjs=require(_0x8f38('0xf'));var toCsv=require(_0x8f38('0x9'));var querystring=require(_0x8f38('0x10'));var Papa=require(_0x8f38('0x11'));var Redis=require(_0x8f38('0x12'));var authService=require(_0x8f38('0x13'));var qs=require(_0x8f38('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8f38('0x15'));var logger=require(_0x8f38('0x16'))(_0x8f38('0x17'));var utils=require(_0x8f38('0x18'));var config=require(_0x8f38('0x19'));var licenseUtil=require(_0x8f38('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x12f4aa,_0x125cb4){_0x125cb4=_0x125cb4||0xcc;return function(_0xcacfdb){if(_0xcacfdb){return _0x12f4aa[_0x8f38('0x1b')](_0x125cb4);}return _0x12f4aa[_0x8f38('0x1c')](_0x125cb4)[_0x8f38('0x1d')]();};}function respondWithResult(_0x5135dc,_0x162ccb){_0x162ccb=_0x162ccb||0xc8;return function(_0x295163){if(_0x295163){return _0x5135dc[_0x8f38('0x1c')](_0x162ccb)['json'](_0x295163);}};}function respondWithFilteredResult(_0x4451fa,_0x47e8d1){return function(_0x2699fc){if(_0x2699fc){var _0x53a37e=typeof _0x47e8d1[_0x8f38('0x1e')]===_0x8f38('0x1f')&&typeof _0x47e8d1[_0x8f38('0x20')]===_0x8f38('0x1f');var _0x2a0dab=_0x2699fc[_0x8f38('0x21')];var _0x190e9d=_0x53a37e?0x0:_0x47e8d1[_0x8f38('0x1e')];var _0x5b3539=_0x53a37e?_0x2699fc['count']:_0x47e8d1[_0x8f38('0x1e')]+_0x47e8d1[_0x8f38('0x20')];var _0x32b390;if(_0x5b3539>=_0x2a0dab){_0x5b3539=_0x2a0dab;_0x32b390=0xc8;}else{_0x32b390=0xce;}_0x4451fa[_0x8f38('0x1c')](_0x32b390);return _0x4451fa[_0x8f38('0x22')](_0x8f38('0x23'),_0x190e9d+'-'+_0x5b3539+'/'+_0x2a0dab)[_0x8f38('0x24')](_0x2699fc);}return null;};}function patchUpdates(_0x325e9f){return function(_0x146a99){try{jsonpatch[_0x8f38('0x25')](_0x146a99,_0x325e9f,!![]);}catch(_0x4239c1){return BPromise[_0x8f38('0x26')](_0x4239c1);}return _0x146a99['save']();};}function saveUpdates(_0x1169cf,_0x521e91){return function(_0x588662){if(_0x588662){return _0x588662[_0x8f38('0x27')](_0x1169cf)['then'](function(_0xc53cca){return _0xc53cca;});}return null;};}function removeEntity(_0x301594,_0x129542){return function(_0x530638){if(_0x530638){return _0x530638[_0x8f38('0x28')]()[_0x8f38('0x29')](function(){_0x301594[_0x8f38('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x52ed17,_0x301803){return function(_0x21ded1){if(!_0x21ded1){_0x52ed17[_0x8f38('0x1b')](0x194);}return _0x21ded1;};}function handleError(_0x2abe0c,_0x161cd5){_0x161cd5=_0x161cd5||0x1f4;return function(_0x3ddd04){logger[_0x8f38('0x2a')](_0x3ddd04['stack']);if(_0x3ddd04[_0x8f38('0x2b')]){delete _0x3ddd04['name'];}_0x2abe0c[_0x8f38('0x1c')](_0x161cd5)[_0x8f38('0x2c')](_0x3ddd04);};}exports[_0x8f38('0x2d')]=function(_0x45bed9,_0x1db54d){var _0x2385a8={},_0x4247c9={},_0x296fdf={'count':0x0,'rows':[]};var _0x5dfa1e=_[_0x8f38('0x2e')](db[_0x8f38('0x2f')][_0x8f38('0x30')],function(_0x58f513){return{'name':_0x58f513[_0x8f38('0x31')],'type':_0x58f513[_0x8f38('0x32')][_0x8f38('0x33')]};});_0x4247c9[_0x8f38('0x34')]=_[_0x8f38('0x2e')](_0x5dfa1e,_0x8f38('0x2b'));_0x4247c9[_0x8f38('0x35')]=_[_0x8f38('0x36')](_0x45bed9['query']);_0x4247c9[_0x8f38('0x37')]=_['intersection'](_0x4247c9[_0x8f38('0x34')],_0x4247c9['query']);_0x2385a8[_0x8f38('0x38')]=_[_0x8f38('0x39')](_0x4247c9[_0x8f38('0x34')],qs[_0x8f38('0x3a')](_0x45bed9[_0x8f38('0x35')][_0x8f38('0x3a')]));_0x2385a8[_0x8f38('0x38')]=_0x2385a8[_0x8f38('0x38')][_0x8f38('0x3b')]?_0x2385a8[_0x8f38('0x38')]:_0x4247c9[_0x8f38('0x34')];if(!_0x45bed9['query']['hasOwnProperty'](_0x8f38('0x3c'))){_0x2385a8[_0x8f38('0x20')]=qs[_0x8f38('0x20')](_0x45bed9[_0x8f38('0x35')][_0x8f38('0x20')]);_0x2385a8[_0x8f38('0x1e')]=qs[_0x8f38('0x1e')](_0x45bed9[_0x8f38('0x35')][_0x8f38('0x1e')]);}_0x2385a8[_0x8f38('0x3d')]=qs['sort'](_0x45bed9[_0x8f38('0x35')][_0x8f38('0x3e')]);_0x2385a8[_0x8f38('0x3f')]=qs[_0x8f38('0x37')](_[_0x8f38('0x40')](_0x45bed9[_0x8f38('0x35')],_0x4247c9['filters']),_0x5dfa1e);if(_0x45bed9[_0x8f38('0x35')]['filter']){_0x2385a8[_0x8f38('0x3f')]=_[_0x8f38('0x41')](_0x2385a8[_0x8f38('0x3f')],{'$or':_[_0x8f38('0x2e')](_0x5dfa1e,function(_0x50c8ee){if(_0x50c8ee[_0x8f38('0x32')]!=='VIRTUAL'){var _0x5bacda={};_0x5bacda[_0x50c8ee[_0x8f38('0x2b')]]={'$like':'%'+_0x45bed9['query'][_0x8f38('0x42')]+'%'};return _0x5bacda;}})});}_0x2385a8=_[_0x8f38('0x41')]({},_0x2385a8,_0x45bed9['options']);var _0x5ef29c={'where':_0x2385a8['where']};return db[_0x8f38('0x2f')]['count'](_0x5ef29c)['then'](function(_0x581143){_0x296fdf[_0x8f38('0x21')]=_0x581143;if(_0x45bed9['query'][_0x8f38('0x43')]){_0x2385a8[_0x8f38('0x44')]=[{'all':!![]}];}return db[_0x8f38('0x2f')][_0x8f38('0x45')](_0x2385a8);})[_0x8f38('0x29')](function(_0x1b467a){_0x296fdf[_0x8f38('0x46')]=_0x1b467a;return _0x296fdf;})[_0x8f38('0x29')](respondWithFilteredResult(_0x1db54d,_0x2385a8))['catch'](handleError(_0x1db54d,null));};exports[_0x8f38('0x47')]=function(_0x470995,_0x1c374f){var _0x17f71a={'raw':!![],'where':{'id':_0x470995[_0x8f38('0x48')]['id']}},_0x385736={};_0x385736[_0x8f38('0x34')]=_[_0x8f38('0x36')](db[_0x8f38('0x2f')]['rawAttributes']);_0x385736['query']=_['keys'](_0x470995['query']);_0x385736['filters']=_[_0x8f38('0x39')](_0x385736[_0x8f38('0x34')],_0x385736[_0x8f38('0x35')]);_0x17f71a['attributes']=_[_0x8f38('0x39')](_0x385736['model'],qs[_0x8f38('0x3a')](_0x470995['query'][_0x8f38('0x3a')]));_0x17f71a[_0x8f38('0x38')]=_0x17f71a[_0x8f38('0x38')][_0x8f38('0x3b')]?_0x17f71a[_0x8f38('0x38')]:_0x385736[_0x8f38('0x34')];if(_0x470995['query']['includeAll']){_0x17f71a[_0x8f38('0x44')]=[{'all':!![]}];}_0x17f71a=_['merge']({},_0x17f71a,_0x470995[_0x8f38('0x49')]);return db['MailServerOut'][_0x8f38('0x4a')](_0x17f71a)[_0x8f38('0x29')](handleEntityNotFound(_0x1c374f,null))['then'](respondWithResult(_0x1c374f,null))[_0x8f38('0x4b')](handleError(_0x1c374f,null));};exports[_0x8f38('0x4c')]=function(_0x4ba804,_0x23e8b0){return db[_0x8f38('0x2f')]['create'](_0x4ba804['body'],{})[_0x8f38('0x29')](respondWithResult(_0x23e8b0,0xc9))[_0x8f38('0x4b')](handleError(_0x23e8b0,null));};exports[_0x8f38('0x27')]=function(_0x806592,_0x535cee){if(_0x806592[_0x8f38('0x4d')]['id']){delete _0x806592[_0x8f38('0x4d')]['id'];}return db[_0x8f38('0x2f')][_0x8f38('0x4a')]({'where':{'id':_0x806592['params']['id']}})[_0x8f38('0x29')](handleEntityNotFound(_0x535cee,null))[_0x8f38('0x29')](saveUpdates(_0x806592[_0x8f38('0x4d')],null))['then'](respondWithResult(_0x535cee,null))[_0x8f38('0x4b')](handleError(_0x535cee,null));};exports[_0x8f38('0x28')]=function(_0x4831aa,_0x58c3ac){return db['MailServerOut'][_0x8f38('0x4a')]({'where':{'id':_0x4831aa[_0x8f38('0x48')]['id']}})['then'](handleEntityNotFound(_0x58c3ac,null))[_0x8f38('0x29')](removeEntity(_0x58c3ac,null))[_0x8f38('0x4b')](handleError(_0x58c3ac,null));}; \ No newline at end of file +var _0x4168=['key','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','filter','merge','where','VIRTUAL','includeAll','include','catch','show','length','options','find','create','update','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','send','index','MailServerOut','rawAttributes','fieldName','type'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4168,0xf6));var _0x8416=function(_0x10eb0d,_0x5f164d){_0x10eb0d=_0x10eb0d-0x0;var _0x367937=_0x4168[_0x10eb0d];return _0x367937;};'use strict';var emlformat=require(_0x8416('0x0'));var rimraf=require(_0x8416('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8416('0x2'));var rp=require(_0x8416('0x3'));var moment=require(_0x8416('0x4'));var BPromise=require(_0x8416('0x5'));var Mustache=require(_0x8416('0x6'));var util=require('util');var path=require('path');var sox=require(_0x8416('0x7'));var csv=require(_0x8416('0x8'));var ejs=require(_0x8416('0x9'));var fs=require('fs');var fs_extra=require(_0x8416('0xa'));var _=require('lodash');var squel=require(_0x8416('0xb'));var crypto=require(_0x8416('0xc'));var jsforce=require(_0x8416('0xd'));var deskjs=require(_0x8416('0xe'));var toCsv=require(_0x8416('0x8'));var querystring=require(_0x8416('0xf'));var Papa=require('papaparse');var Redis=require(_0x8416('0x10'));var authService=require(_0x8416('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x8416('0x12'));var hardwareService=require(_0x8416('0x13'));var logger=require('../../config/logger')(_0x8416('0x14'));var utils=require('../../config/utils');var config=require(_0x8416('0x15'));var licenseUtil=require(_0x8416('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4da18d,_0x508d52){_0x508d52=_0x508d52||0xcc;return function(_0x58913c){if(_0x58913c){return _0x4da18d['sendStatus'](_0x508d52);}return _0x4da18d['status'](_0x508d52)[_0x8416('0x17')]();};}function respondWithResult(_0x10912b,_0x1b002b){_0x1b002b=_0x1b002b||0xc8;return function(_0x537de0){if(_0x537de0){return _0x10912b[_0x8416('0x18')](_0x1b002b)[_0x8416('0x19')](_0x537de0);}};}function respondWithFilteredResult(_0x40f68e,_0x50f46e){return function(_0x4cc231){if(_0x4cc231){var _0x4d397f=typeof _0x50f46e['offset']===_0x8416('0x1a')&&typeof _0x50f46e[_0x8416('0x1b')]==='undefined';var _0x815bf8=_0x4cc231[_0x8416('0x1c')];var _0x3399a2=_0x4d397f?0x0:_0x50f46e['offset'];var _0x4c3b59=_0x4d397f?_0x4cc231[_0x8416('0x1c')]:_0x50f46e[_0x8416('0x1d')]+_0x50f46e[_0x8416('0x1b')];var _0x48efdf;if(_0x4c3b59>=_0x815bf8){_0x4c3b59=_0x815bf8;_0x48efdf=0xc8;}else{_0x48efdf=0xce;}_0x40f68e[_0x8416('0x18')](_0x48efdf);return _0x40f68e[_0x8416('0x1e')](_0x8416('0x1f'),_0x3399a2+'-'+_0x4c3b59+'/'+_0x815bf8)[_0x8416('0x19')](_0x4cc231);}return null;};}function patchUpdates(_0x442222){return function(_0x4a813e){try{jsonpatch[_0x8416('0x20')](_0x4a813e,_0x442222,!![]);}catch(_0xc14075){return BPromise['reject'](_0xc14075);}return _0x4a813e[_0x8416('0x21')]();};}function saveUpdates(_0x1e1930,_0x33e99f){return function(_0x45bc9a){if(_0x45bc9a){return _0x45bc9a['update'](_0x1e1930)[_0x8416('0x22')](function(_0x3c371a){return _0x3c371a;});}return null;};}function removeEntity(_0x3f49a9,_0x7247af){return function(_0xde5ac6){if(_0xde5ac6){return _0xde5ac6[_0x8416('0x23')]()['then'](function(){_0x3f49a9['status'](0xcc)[_0x8416('0x17')]();});}};}function handleEntityNotFound(_0x3694e7,_0x4f003b){return function(_0x7cb6d2){if(!_0x7cb6d2){_0x3694e7[_0x8416('0x24')](0x194);}return _0x7cb6d2;};}function handleError(_0x540c94,_0x450bc1){_0x450bc1=_0x450bc1||0x1f4;return function(_0xe07949){logger[_0x8416('0x25')](_0xe07949[_0x8416('0x26')]);if(_0xe07949[_0x8416('0x27')]){delete _0xe07949[_0x8416('0x27')];}_0x540c94['status'](_0x450bc1)[_0x8416('0x28')](_0xe07949);};}exports[_0x8416('0x29')]=function(_0x1e47ba,_0xaecaea){var _0x152a10={},_0x2b3067={},_0x4f1e49={'count':0x0,'rows':[]};var _0x2ff4d9=_['map'](db[_0x8416('0x2a')][_0x8416('0x2b')],function(_0x11f387){return{'name':_0x11f387[_0x8416('0x2c')],'type':_0x11f387[_0x8416('0x2d')][_0x8416('0x2e')]};});_0x2b3067[_0x8416('0x2f')]=_[_0x8416('0x30')](_0x2ff4d9,'name');_0x2b3067['query']=_[_0x8416('0x31')](_0x1e47ba[_0x8416('0x32')]);_0x2b3067[_0x8416('0x33')]=_[_0x8416('0x34')](_0x2b3067[_0x8416('0x2f')],_0x2b3067[_0x8416('0x32')]);_0x152a10[_0x8416('0x35')]=_['intersection'](_0x2b3067['model'],qs[_0x8416('0x36')](_0x1e47ba['query'][_0x8416('0x36')]));_0x152a10[_0x8416('0x35')]=_0x152a10[_0x8416('0x35')]['length']?_0x152a10[_0x8416('0x35')]:_0x2b3067['model'];if(!_0x1e47ba[_0x8416('0x32')][_0x8416('0x37')](_0x8416('0x38'))){_0x152a10[_0x8416('0x1b')]=qs['limit'](_0x1e47ba['query'][_0x8416('0x1b')]);_0x152a10[_0x8416('0x1d')]=qs[_0x8416('0x1d')](_0x1e47ba[_0x8416('0x32')][_0x8416('0x1d')]);}_0x152a10['order']=qs[_0x8416('0x39')](_0x1e47ba['query']['sort']);_0x152a10['where']=qs[_0x8416('0x33')](_['pick'](_0x1e47ba['query'],_0x2b3067[_0x8416('0x33')]),_0x2ff4d9);if(_0x1e47ba[_0x8416('0x32')][_0x8416('0x3a')]){_0x152a10['where']=_[_0x8416('0x3b')](_0x152a10[_0x8416('0x3c')],{'$or':_[_0x8416('0x30')](_0x2ff4d9,function(_0x522fdb){if(_0x522fdb[_0x8416('0x2d')]!==_0x8416('0x3d')){var _0x2306f1={};_0x2306f1[_0x522fdb[_0x8416('0x27')]]={'$like':'%'+_0x1e47ba['query']['filter']+'%'};return _0x2306f1;}})});}_0x152a10=_[_0x8416('0x3b')]({},_0x152a10,_0x1e47ba['options']);var _0x5dc5ed={'where':_0x152a10[_0x8416('0x3c')]};return db['MailServerOut'][_0x8416('0x1c')](_0x5dc5ed)[_0x8416('0x22')](function(_0x613dca){_0x4f1e49[_0x8416('0x1c')]=_0x613dca;if(_0x1e47ba[_0x8416('0x32')][_0x8416('0x3e')]){_0x152a10[_0x8416('0x3f')]=[{'all':!![]}];}return db[_0x8416('0x2a')]['findAll'](_0x152a10);})['then'](function(_0x2789b7){_0x4f1e49['rows']=_0x2789b7;return _0x4f1e49;})['then'](respondWithFilteredResult(_0xaecaea,_0x152a10))[_0x8416('0x40')](handleError(_0xaecaea,null));};exports[_0x8416('0x41')]=function(_0x2e993d,_0x199eaf){var _0x16bdfe={'raw':!![],'where':{'id':_0x2e993d['params']['id']}},_0x52de5f={};_0x52de5f[_0x8416('0x2f')]=_[_0x8416('0x31')](db[_0x8416('0x2a')][_0x8416('0x2b')]);_0x52de5f[_0x8416('0x32')]=_['keys'](_0x2e993d['query']);_0x52de5f[_0x8416('0x33')]=_[_0x8416('0x34')](_0x52de5f[_0x8416('0x2f')],_0x52de5f[_0x8416('0x32')]);_0x16bdfe[_0x8416('0x35')]=_['intersection'](_0x52de5f[_0x8416('0x2f')],qs[_0x8416('0x36')](_0x2e993d[_0x8416('0x32')][_0x8416('0x36')]));_0x16bdfe[_0x8416('0x35')]=_0x16bdfe[_0x8416('0x35')][_0x8416('0x42')]?_0x16bdfe[_0x8416('0x35')]:_0x52de5f['model'];if(_0x2e993d['query'][_0x8416('0x3e')]){_0x16bdfe[_0x8416('0x3f')]=[{'all':!![]}];}_0x16bdfe=_['merge']({},_0x16bdfe,_0x2e993d[_0x8416('0x43')]);return db[_0x8416('0x2a')][_0x8416('0x44')](_0x16bdfe)[_0x8416('0x22')](handleEntityNotFound(_0x199eaf,null))[_0x8416('0x22')](respondWithResult(_0x199eaf,null))['catch'](handleError(_0x199eaf,null));};exports[_0x8416('0x45')]=function(_0x1f2910,_0x4cdb9d){return db[_0x8416('0x2a')]['create'](_0x1f2910['body'],{})[_0x8416('0x22')](respondWithResult(_0x4cdb9d,0xc9))[_0x8416('0x40')](handleError(_0x4cdb9d,null));};exports[_0x8416('0x46')]=function(_0x566a84,_0x34ad88){if(_0x566a84[_0x8416('0x47')]['id']){delete _0x566a84['body']['id'];}return db['MailServerOut'][_0x8416('0x44')]({'where':{'id':_0x566a84[_0x8416('0x48')]['id']}})[_0x8416('0x22')](handleEntityNotFound(_0x34ad88,null))[_0x8416('0x22')](saveUpdates(_0x566a84['body'],null))[_0x8416('0x22')](respondWithResult(_0x34ad88,null))[_0x8416('0x40')](handleError(_0x34ad88,null));};exports[_0x8416('0x23')]=function(_0x5deee8,_0x170adf){return db[_0x8416('0x2a')][_0x8416('0x44')]({'where':{'id':_0x5deee8[_0x8416('0x48')]['id']}})[_0x8416('0x22')](handleEntityNotFound(_0x170adf,null))[_0x8416('0x22')](removeEntity(_0x170adf,null))[_0x8416('0x40')](handleError(_0x170adf,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index a4ea35e..c5dc2c0 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 _0x850d=['MailServerOut','mail_servers_out','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes','exports','define'];(function(_0x343b56,_0x27ebbf){var _0x4bdc57=function(_0x46cccd){while(--_0x46cccd){_0x343b56['push'](_0x343b56['shift']());}};_0x4bdc57(++_0x27ebbf);}(_0x850d,0x9c));var _0xd850=function(_0x46440c,_0x4da44f){_0x46440c=_0x46440c-0x0;var _0x1cb968=_0x850d[_0x46440c];return _0x1cb968;};'use strict';var _=require(_0xd850('0x0'));var util=require(_0xd850('0x1'));var logger=require(_0xd850('0x2'))('api');var moment=require(_0xd850('0x3'));var BPromise=require(_0xd850('0x4'));var rp=require(_0xd850('0x5'));var fs=require('fs');var path=require(_0xd850('0x6'));var rimraf=require(_0xd850('0x7'));var config=require(_0xd850('0x8'));var attributes=require(_0xd850('0x9'));module[_0xd850('0xa')]=function(_0x39e486,_0x13020a){return _0x39e486[_0xd850('0xb')](_0xd850('0xc'),attributes,{'tableName':_0xd850('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1013=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','MailServerOut','mail_servers_out'];(function(_0x197a89,_0x4990fa){var _0x1cc718=function(_0xa5a298){while(--_0xa5a298){_0x197a89['push'](_0x197a89['shift']());}};_0x1cc718(++_0x4990fa);}(_0x1013,0x8f));var _0x3101=function(_0x38bbf8,_0x319a9d){_0x38bbf8=_0x38bbf8-0x0;var _0x539d0f=_0x1013[_0x38bbf8];return _0x539d0f;};'use strict';var _=require(_0x3101('0x0'));var util=require(_0x3101('0x1'));var logger=require(_0x3101('0x2'))(_0x3101('0x3'));var moment=require(_0x3101('0x4'));var BPromise=require(_0x3101('0x5'));var rp=require(_0x3101('0x6'));var fs=require('fs');var path=require(_0x3101('0x7'));var rimraf=require(_0x3101('0x8'));var config=require(_0x3101('0x9'));var attributes=require('./mailServerOut.attributes');module['exports']=function(_0x412efc,_0x14a3cf){return _0x412efc[_0x3101('0xa')](_0x3101('0xb'),attributes,{'tableName':_0x3101('0xc'),'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 1c0fde9..1d1c6f9 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 _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x539b88,_0x64a8bc){var _0x4a8b78=function(_0x4a7a3c){while(--_0x4a7a3c){_0x539b88['push'](_0x539b88['shift']());}};_0x4a8b78(++_0x64a8bc);}(_0xdb28,0x106));var _0x8db2=function(_0x31390c,_0x243d16){_0x31390c=_0x31390c-0x0;var _0x14248b=_0xdb28[_0x31390c];return _0x14248b;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});} \ No newline at end of file +var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x102f03,_0x112643){var _0xf4add6=function(_0x2c45e7){while(--_0x2c45e7){_0x102f03['push'](_0x102f03['shift']());}};_0xf4add6(++_0x112643);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0xc4aa[_0x1caf6a];return _0x1bf493;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index e2d5bf0..11c344f 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 _0x1217=['./mailSubstatus.controller','get','index','describe','/:id','isAuthenticated','show','post','create','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x36b898,_0x473edc){var _0x22a372=function(_0x5cf3d7){while(--_0x5cf3d7){_0x36b898['push'](_0x36b898['shift']());}};_0x22a372(++_0x473edc);}(_0x1217,0x172));var _0x7121=function(_0x19d6a4,_0x5180b5){_0x19d6a4=_0x19d6a4-0x0;var _0x59d10d=_0x1217[_0x19d6a4];return _0x59d10d;};'use strict';var multer=require(_0x7121('0x0'));var util=require(_0x7121('0x1'));var path=require('path');var timeout=require(_0x7121('0x2'));var express=require(_0x7121('0x3'));var router=express[_0x7121('0x4')]();var fs_extra=require(_0x7121('0x5'));var auth=require(_0x7121('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7121('0x7'));var controller=require(_0x7121('0x8'));router[_0x7121('0x9')]('/',auth['isAuthenticated'](),controller[_0x7121('0xa')]);router[_0x7121('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x7121('0xb')]);router[_0x7121('0x9')](_0x7121('0xc'),auth[_0x7121('0xd')](),controller[_0x7121('0xe')]);router[_0x7121('0xf')]('/',auth[_0x7121('0xd')](),controller[_0x7121('0x10')]);router[_0x7121('0x11')](_0x7121('0xc'),auth[_0x7121('0xd')](),controller['update']);router[_0x7121('0x12')](_0x7121('0xc'),auth[_0x7121('0xd')](),controller[_0x7121('0x13')]);module[_0x7121('0x14')]=router; \ No newline at end of file +var _0x0284=['get','/:id','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe','describe'];(function(_0xf13ca6,_0x5735ea){var _0x4a4387=function(_0x103f67){while(--_0x103f67){_0xf13ca6['push'](_0xf13ca6['shift']());}};_0x4a4387(++_0x5735ea);}(_0x0284,0xf0));var _0x4028=function(_0x2e04ef,_0x31a596){_0x2e04ef=_0x2e04ef-0x0;var _0x5722b0=_0x0284[_0x2e04ef];return _0x5722b0;};'use strict';var multer=require(_0x4028('0x0'));var util=require(_0x4028('0x1'));var path=require(_0x4028('0x2'));var timeout=require(_0x4028('0x3'));var express=require('express');var router=express[_0x4028('0x4')]();var fs_extra=require(_0x4028('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4028('0x6'));var config=require(_0x4028('0x7'));var controller=require('./mailSubstatus.controller');router['get']('/',auth[_0x4028('0x8')](),controller[_0x4028('0x9')]);router['get'](_0x4028('0xa'),auth[_0x4028('0x8')](),controller[_0x4028('0xb')]);router[_0x4028('0xc')](_0x4028('0xd'),auth[_0x4028('0x8')](),controller[_0x4028('0xe')]);router[_0x4028('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4028('0x10')](_0x4028('0xd'),auth[_0x4028('0x8')](),controller[_0x4028('0x11')]);router[_0x4028('0x12')](_0x4028('0xd'),auth[_0x4028('0x8')](),controller[_0x4028('0x13')]);module[_0x4028('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 fa8fa8e..882414d 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. * // * * // ************************************************************************* -'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xbff5=['sequelize','exports','STRING','name'];(function(_0x4512e9,_0x31bc06){var _0xd1fb=function(_0x32296e){while(--_0x32296e){_0x4512e9['push'](_0x4512e9['shift']());}};_0xd1fb(++_0x31bc06);}(_0xbff5,0x1bc));var _0x5bff=function(_0x20266c,_0x172b23){_0x20266c=_0x20266c-0x0;var _0x54449d=_0xbff5[_0x20266c];return _0x54449d;};'use strict';var Sequelize=require(_0x5bff('0x0'));module[_0x5bff('0x1')]={'name':{'type':Sequelize[_0x5bff('0x2')],'unique':_0x5bff('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x5bff('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index d1b9284..d6eab3e 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 _0xc621=['limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','MailSubstatus','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','options','includeAll','include','catch','params','merge','create','body','find','describe','eml-format','zip-dir','moment','bluebird','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x37f58b,_0x1d08a3){var _0x3349ff=function(_0x301ecf){while(--_0x301ecf){_0x37f58b['push'](_0x37f58b['shift']());}};_0x3349ff(++_0x1d08a3);}(_0xc621,0x14d));var _0x1c62=function(_0x3d72d3,_0x3d7243){_0x3d72d3=_0x3d72d3-0x0;var _0x4aade1=_0xc621[_0x3d72d3];return _0x4aade1;};'use strict';var emlformat=require(_0x1c62('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1c62('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1c62('0x2'));var BPromise=require(_0x1c62('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1c62('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1c62('0x5'));var fs=require('fs');var fs_extra=require(_0x1c62('0x6'));var _=require(_0x1c62('0x7'));var squel=require(_0x1c62('0x8'));var crypto=require(_0x1c62('0x9'));var jsforce=require(_0x1c62('0xa'));var deskjs=require(_0x1c62('0xb'));var toCsv=require(_0x1c62('0xc'));var querystring=require(_0x1c62('0xd'));var Papa=require(_0x1c62('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1c62('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1c62('0x10'))(_0x1c62('0x11'));var utils=require(_0x1c62('0x12'));var config=require(_0x1c62('0x13'));var licenseUtil=require(_0x1c62('0x14'));var db=require(_0x1c62('0x15'))['db'];function respondWithStatusCode(_0x208694,_0x40a2c0){_0x40a2c0=_0x40a2c0||0xcc;return function(_0x4dff19){if(_0x4dff19){return _0x208694[_0x1c62('0x16')](_0x40a2c0);}return _0x208694[_0x1c62('0x17')](_0x40a2c0)[_0x1c62('0x18')]();};}function respondWithResult(_0x44be1f,_0x372035){_0x372035=_0x372035||0xc8;return function(_0x53232b){if(_0x53232b){return _0x44be1f[_0x1c62('0x17')](_0x372035)[_0x1c62('0x19')](_0x53232b);}};}function respondWithFilteredResult(_0x2f547b,_0x389ec8){return function(_0x4fbe24){if(_0x4fbe24){var _0x4b35fe=typeof _0x389ec8[_0x1c62('0x1a')]==='undefined'&&typeof _0x389ec8[_0x1c62('0x1b')]===_0x1c62('0x1c');var _0x2fe281=_0x4fbe24[_0x1c62('0x1d')];var _0xea5f68=_0x4b35fe?0x0:_0x389ec8[_0x1c62('0x1a')];var _0x7328a8=_0x4b35fe?_0x4fbe24['count']:_0x389ec8['offset']+_0x389ec8[_0x1c62('0x1b')];var _0x161859;if(_0x7328a8>=_0x2fe281){_0x7328a8=_0x2fe281;_0x161859=0xc8;}else{_0x161859=0xce;}_0x2f547b['status'](_0x161859);return _0x2f547b['set'](_0x1c62('0x1e'),_0xea5f68+'-'+_0x7328a8+'/'+_0x2fe281)[_0x1c62('0x19')](_0x4fbe24);}return null;};}function patchUpdates(_0x2735f5){return function(_0x34f98b){try{jsonpatch[_0x1c62('0x1f')](_0x34f98b,_0x2735f5,!![]);}catch(_0x1688f7){return BPromise[_0x1c62('0x20')](_0x1688f7);}return _0x34f98b[_0x1c62('0x21')]();};}function saveUpdates(_0x1d7a97,_0x5be6dc){return function(_0x21dea6){if(_0x21dea6){return _0x21dea6[_0x1c62('0x22')](_0x1d7a97)[_0x1c62('0x23')](function(_0x4bcc1f){return _0x4bcc1f;});}return null;};}function removeEntity(_0xac7611,_0x1f0246){return function(_0x4f8a88){if(_0x4f8a88){return _0x4f8a88[_0x1c62('0x24')]()[_0x1c62('0x23')](function(){_0xac7611[_0x1c62('0x17')](0xcc)[_0x1c62('0x18')]();});}};}function handleEntityNotFound(_0x355c56,_0x57bf99){return function(_0x25d27b){if(!_0x25d27b){_0x355c56[_0x1c62('0x16')](0x194);}return _0x25d27b;};}function handleError(_0x69eeb6,_0x5011ff){_0x5011ff=_0x5011ff||0x1f4;return function(_0x13e858){logger[_0x1c62('0x25')](_0x13e858['stack']);if(_0x13e858[_0x1c62('0x26')]){delete _0x13e858[_0x1c62('0x26')];}_0x69eeb6[_0x1c62('0x17')](_0x5011ff)[_0x1c62('0x27')](_0x13e858);};}exports[_0x1c62('0x28')]=function(_0x2595d1,_0x358a6e){var _0x46b3ba={},_0x1a6a6f={},_0x322940={'count':0x0,'rows':[]};var _0x29907b=_[_0x1c62('0x29')](db[_0x1c62('0x2a')][_0x1c62('0x2b')],function(_0x518f1e){return{'name':_0x518f1e[_0x1c62('0x2c')],'type':_0x518f1e['type'][_0x1c62('0x2d')]};});_0x1a6a6f['model']=_[_0x1c62('0x29')](_0x29907b,'name');_0x1a6a6f[_0x1c62('0x2e')]=_[_0x1c62('0x2f')](_0x2595d1[_0x1c62('0x2e')]);_0x1a6a6f[_0x1c62('0x30')]=_[_0x1c62('0x31')](_0x1a6a6f[_0x1c62('0x32')],_0x1a6a6f[_0x1c62('0x2e')]);_0x46b3ba[_0x1c62('0x33')]=_[_0x1c62('0x31')](_0x1a6a6f[_0x1c62('0x32')],qs[_0x1c62('0x34')](_0x2595d1[_0x1c62('0x2e')][_0x1c62('0x34')]));_0x46b3ba[_0x1c62('0x33')]=_0x46b3ba[_0x1c62('0x33')][_0x1c62('0x35')]?_0x46b3ba['attributes']:_0x1a6a6f['model'];if(!_0x2595d1[_0x1c62('0x2e')][_0x1c62('0x36')](_0x1c62('0x37'))){_0x46b3ba[_0x1c62('0x1b')]=qs[_0x1c62('0x1b')](_0x2595d1[_0x1c62('0x2e')]['limit']);_0x46b3ba[_0x1c62('0x1a')]=qs[_0x1c62('0x1a')](_0x2595d1[_0x1c62('0x2e')][_0x1c62('0x1a')]);}_0x46b3ba[_0x1c62('0x38')]=qs[_0x1c62('0x39')](_0x2595d1[_0x1c62('0x2e')][_0x1c62('0x39')]);_0x46b3ba[_0x1c62('0x3a')]=qs[_0x1c62('0x30')](_[_0x1c62('0x3b')](_0x2595d1[_0x1c62('0x2e')],_0x1a6a6f[_0x1c62('0x30')]),_0x29907b);if(_0x2595d1[_0x1c62('0x2e')][_0x1c62('0x3c')]){_0x46b3ba['where']=_['merge'](_0x46b3ba[_0x1c62('0x3a')],{'$or':_[_0x1c62('0x29')](_0x29907b,function(_0x207298){if(_0x207298[_0x1c62('0x3d')]!=='VIRTUAL'){var _0x4429b0={};_0x4429b0[_0x207298[_0x1c62('0x26')]]={'$like':'%'+_0x2595d1[_0x1c62('0x2e')][_0x1c62('0x3c')]+'%'};return _0x4429b0;}})});}_0x46b3ba=_['merge']({},_0x46b3ba,_0x2595d1[_0x1c62('0x3e')]);var _0x21ea80={'where':_0x46b3ba[_0x1c62('0x3a')]};return db[_0x1c62('0x2a')][_0x1c62('0x1d')](_0x21ea80)[_0x1c62('0x23')](function(_0x4a3c07){_0x322940[_0x1c62('0x1d')]=_0x4a3c07;if(_0x2595d1[_0x1c62('0x2e')][_0x1c62('0x3f')]){_0x46b3ba[_0x1c62('0x40')]=[{'all':!![]}];}return db[_0x1c62('0x2a')]['findAll'](_0x46b3ba);})[_0x1c62('0x23')](function(_0x1d84b4){_0x322940['rows']=_0x1d84b4;return _0x322940;})['then'](respondWithFilteredResult(_0x358a6e,_0x46b3ba))[_0x1c62('0x41')](handleError(_0x358a6e,null));};exports['show']=function(_0x637072,_0x316c92){var _0x4b4f90={'raw':!![],'where':{'id':_0x637072[_0x1c62('0x42')]['id']}},_0x20a760={};_0x20a760['model']=_['keys'](db[_0x1c62('0x2a')]['rawAttributes']);_0x20a760[_0x1c62('0x2e')]=_[_0x1c62('0x2f')](_0x637072[_0x1c62('0x2e')]);_0x20a760[_0x1c62('0x30')]=_[_0x1c62('0x31')](_0x20a760[_0x1c62('0x32')],_0x20a760[_0x1c62('0x2e')]);_0x4b4f90['attributes']=_[_0x1c62('0x31')](_0x20a760['model'],qs[_0x1c62('0x34')](_0x637072['query'][_0x1c62('0x34')]));_0x4b4f90[_0x1c62('0x33')]=_0x4b4f90['attributes']['length']?_0x4b4f90[_0x1c62('0x33')]:_0x20a760['model'];if(_0x637072[_0x1c62('0x2e')][_0x1c62('0x3f')]){_0x4b4f90[_0x1c62('0x40')]=[{'all':!![]}];}_0x4b4f90=_[_0x1c62('0x43')]({},_0x4b4f90,_0x637072[_0x1c62('0x3e')]);return db[_0x1c62('0x2a')]['find'](_0x4b4f90)['then'](handleEntityNotFound(_0x316c92,null))[_0x1c62('0x23')](respondWithResult(_0x316c92,null))[_0x1c62('0x41')](handleError(_0x316c92,null));};exports[_0x1c62('0x44')]=function(_0x3f78cf,_0x43da8a){return db[_0x1c62('0x2a')][_0x1c62('0x44')](_0x3f78cf['body'],{})['then'](respondWithResult(_0x43da8a,0xc9))[_0x1c62('0x41')](handleError(_0x43da8a,null));};exports['update']=function(_0x13c618,_0x3c8cd5){if(_0x13c618['body']['id']){delete _0x13c618['body']['id'];}return db[_0x1c62('0x2a')]['find']({'where':{'id':_0x13c618[_0x1c62('0x42')]['id']}})[_0x1c62('0x23')](handleEntityNotFound(_0x3c8cd5,null))[_0x1c62('0x23')](saveUpdates(_0x13c618[_0x1c62('0x45')],null))[_0x1c62('0x23')](respondWithResult(_0x3c8cd5,null))['catch'](handleError(_0x3c8cd5,null));};exports[_0x1c62('0x24')]=function(_0x5d79bb,_0x302c5a){return db[_0x1c62('0x2a')][_0x1c62('0x46')]({'where':{'id':_0x5d79bb[_0x1c62('0x42')]['id']}})['then'](handleEntityNotFound(_0x302c5a,null))[_0x1c62('0x23')](removeEntity(_0x302c5a,null))[_0x1c62('0x41')](handleError(_0x302c5a,null));};exports[_0x1c62('0x47')]=function(_0x238c9b,_0x2fe829){return db[_0x1c62('0x2a')][_0x1c62('0x47')]()[_0x1c62('0x23')](respondWithResult(_0x2fe829,null))[_0x1c62('0x41')](handleError(_0x2fe829,null));}; \ No newline at end of file +var _0x0055=['pick','filter','merge','options','includeAll','include','findAll','catch','find','create','body','params','describe','eml-format','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','name','send','index','map','MailSubstatus','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where'];(function(_0x46451c,_0x88ddd){var _0x12dce4=function(_0x2e4087){while(--_0x2e4087){_0x46451c['push'](_0x46451c['shift']());}};_0x12dce4(++_0x88ddd);}(_0x0055,0x131));var _0x5005=function(_0x263c9d,_0x432714){_0x263c9d=_0x263c9d-0x0;var _0x3eba60=_0x0055[_0x263c9d];return _0x3eba60;};'use strict';var emlformat=require(_0x5005('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5005('0x1'));var moment=require('moment');var BPromise=require(_0x5005('0x2'));var Mustache=require(_0x5005('0x3'));var util=require(_0x5005('0x4'));var path=require(_0x5005('0x5'));var sox=require(_0x5005('0x6'));var csv=require(_0x5005('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5005('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5005('0x9'));var deskjs=require(_0x5005('0xa'));var toCsv=require(_0x5005('0x7'));var querystring=require(_0x5005('0xb'));var Papa=require(_0x5005('0xc'));var Redis=require(_0x5005('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x5005('0xe'));var as=require(_0x5005('0xf'));var hardwareService=require(_0x5005('0x10'));var logger=require(_0x5005('0x11'))(_0x5005('0x12'));var utils=require(_0x5005('0x13'));var config=require(_0x5005('0x14'));var licenseUtil=require(_0x5005('0x15'));var db=require(_0x5005('0x16'))['db'];function respondWithStatusCode(_0x418d1b,_0x257ce4){_0x257ce4=_0x257ce4||0xcc;return function(_0x46f2d5){if(_0x46f2d5){return _0x418d1b[_0x5005('0x17')](_0x257ce4);}return _0x418d1b['status'](_0x257ce4)[_0x5005('0x18')]();};}function respondWithResult(_0x4bcb92,_0x2483af){_0x2483af=_0x2483af||0xc8;return function(_0x22a955){if(_0x22a955){return _0x4bcb92[_0x5005('0x19')](_0x2483af)[_0x5005('0x1a')](_0x22a955);}};}function respondWithFilteredResult(_0x3d9330,_0x1184e2){return function(_0x321c9b){if(_0x321c9b){var _0x245017=typeof _0x1184e2[_0x5005('0x1b')]==='undefined'&&typeof _0x1184e2['limit']===_0x5005('0x1c');var _0xedbc58=_0x321c9b[_0x5005('0x1d')];var _0x395d3a=_0x245017?0x0:_0x1184e2['offset'];var _0x4b5b20=_0x245017?_0x321c9b[_0x5005('0x1d')]:_0x1184e2[_0x5005('0x1b')]+_0x1184e2[_0x5005('0x1e')];var _0x372093;if(_0x4b5b20>=_0xedbc58){_0x4b5b20=_0xedbc58;_0x372093=0xc8;}else{_0x372093=0xce;}_0x3d9330[_0x5005('0x19')](_0x372093);return _0x3d9330[_0x5005('0x1f')](_0x5005('0x20'),_0x395d3a+'-'+_0x4b5b20+'/'+_0xedbc58)[_0x5005('0x1a')](_0x321c9b);}return null;};}function patchUpdates(_0x22093e){return function(_0x5a6699){try{jsonpatch[_0x5005('0x21')](_0x5a6699,_0x22093e,!![]);}catch(_0x402cf1){return BPromise[_0x5005('0x22')](_0x402cf1);}return _0x5a6699[_0x5005('0x23')]();};}function saveUpdates(_0x38a442,_0x3778cf){return function(_0x4374e0){if(_0x4374e0){return _0x4374e0[_0x5005('0x24')](_0x38a442)['then'](function(_0x2662a6){return _0x2662a6;});}return null;};}function removeEntity(_0x1185b6,_0x3d397e){return function(_0xf6a33b){if(_0xf6a33b){return _0xf6a33b[_0x5005('0x25')]()[_0x5005('0x26')](function(){_0x1185b6[_0x5005('0x19')](0xcc)[_0x5005('0x18')]();});}};}function handleEntityNotFound(_0x210db7,_0x518704){return function(_0x4c4159){if(!_0x4c4159){_0x210db7['sendStatus'](0x194);}return _0x4c4159;};}function handleError(_0x30bd4f,_0x4f07f8){_0x4f07f8=_0x4f07f8||0x1f4;return function(_0x1599e9){logger[_0x5005('0x27')](_0x1599e9['stack']);if(_0x1599e9[_0x5005('0x28')]){delete _0x1599e9[_0x5005('0x28')];}_0x30bd4f[_0x5005('0x19')](_0x4f07f8)[_0x5005('0x29')](_0x1599e9);};}exports[_0x5005('0x2a')]=function(_0x1e7505,_0x36da7b){var _0x38362d={},_0x1b9970={},_0x21c6f4={'count':0x0,'rows':[]};var _0x2a201c=_[_0x5005('0x2b')](db[_0x5005('0x2c')][_0x5005('0x2d')],function(_0x22d677){return{'name':_0x22d677['fieldName'],'type':_0x22d677[_0x5005('0x2e')][_0x5005('0x2f')]};});_0x1b9970[_0x5005('0x30')]=_[_0x5005('0x2b')](_0x2a201c,_0x5005('0x28'));_0x1b9970[_0x5005('0x31')]=_[_0x5005('0x32')](_0x1e7505[_0x5005('0x31')]);_0x1b9970[_0x5005('0x33')]=_['intersection'](_0x1b9970[_0x5005('0x30')],_0x1b9970[_0x5005('0x31')]);_0x38362d[_0x5005('0x34')]=_[_0x5005('0x35')](_0x1b9970[_0x5005('0x30')],qs[_0x5005('0x36')](_0x1e7505[_0x5005('0x31')]['fields']));_0x38362d['attributes']=_0x38362d[_0x5005('0x34')][_0x5005('0x37')]?_0x38362d[_0x5005('0x34')]:_0x1b9970[_0x5005('0x30')];if(!_0x1e7505['query'][_0x5005('0x38')]('nolimit')){_0x38362d[_0x5005('0x1e')]=qs[_0x5005('0x1e')](_0x1e7505[_0x5005('0x31')][_0x5005('0x1e')]);_0x38362d['offset']=qs['offset'](_0x1e7505['query'][_0x5005('0x1b')]);}_0x38362d[_0x5005('0x39')]=qs[_0x5005('0x3a')](_0x1e7505['query'][_0x5005('0x3a')]);_0x38362d[_0x5005('0x3b')]=qs[_0x5005('0x33')](_[_0x5005('0x3c')](_0x1e7505[_0x5005('0x31')],_0x1b9970[_0x5005('0x33')]),_0x2a201c);if(_0x1e7505[_0x5005('0x31')][_0x5005('0x3d')]){_0x38362d[_0x5005('0x3b')]=_[_0x5005('0x3e')](_0x38362d[_0x5005('0x3b')],{'$or':_[_0x5005('0x2b')](_0x2a201c,function(_0x223332){if(_0x223332[_0x5005('0x2e')]!=='VIRTUAL'){var _0x4baf91={};_0x4baf91[_0x223332[_0x5005('0x28')]]={'$like':'%'+_0x1e7505[_0x5005('0x31')][_0x5005('0x3d')]+'%'};return _0x4baf91;}})});}_0x38362d=_[_0x5005('0x3e')]({},_0x38362d,_0x1e7505[_0x5005('0x3f')]);var _0x1127a9={'where':_0x38362d[_0x5005('0x3b')]};return db[_0x5005('0x2c')][_0x5005('0x1d')](_0x1127a9)[_0x5005('0x26')](function(_0x3044a0){_0x21c6f4[_0x5005('0x1d')]=_0x3044a0;if(_0x1e7505['query'][_0x5005('0x40')]){_0x38362d[_0x5005('0x41')]=[{'all':!![]}];}return db[_0x5005('0x2c')][_0x5005('0x42')](_0x38362d);})[_0x5005('0x26')](function(_0x11ef86){_0x21c6f4['rows']=_0x11ef86;return _0x21c6f4;})[_0x5005('0x26')](respondWithFilteredResult(_0x36da7b,_0x38362d))[_0x5005('0x43')](handleError(_0x36da7b,null));};exports['show']=function(_0x31466c,_0x581651){var _0x2af368={'raw':!![],'where':{'id':_0x31466c['params']['id']}},_0xc132e8={};_0xc132e8[_0x5005('0x30')]=_[_0x5005('0x32')](db[_0x5005('0x2c')][_0x5005('0x2d')]);_0xc132e8[_0x5005('0x31')]=_[_0x5005('0x32')](_0x31466c[_0x5005('0x31')]);_0xc132e8[_0x5005('0x33')]=_['intersection'](_0xc132e8[_0x5005('0x30')],_0xc132e8[_0x5005('0x31')]);_0x2af368['attributes']=_[_0x5005('0x35')](_0xc132e8[_0x5005('0x30')],qs['fields'](_0x31466c[_0x5005('0x31')][_0x5005('0x36')]));_0x2af368[_0x5005('0x34')]=_0x2af368[_0x5005('0x34')][_0x5005('0x37')]?_0x2af368[_0x5005('0x34')]:_0xc132e8[_0x5005('0x30')];if(_0x31466c[_0x5005('0x31')][_0x5005('0x40')]){_0x2af368[_0x5005('0x41')]=[{'all':!![]}];}_0x2af368=_['merge']({},_0x2af368,_0x31466c[_0x5005('0x3f')]);return db[_0x5005('0x2c')][_0x5005('0x44')](_0x2af368)[_0x5005('0x26')](handleEntityNotFound(_0x581651,null))[_0x5005('0x26')](respondWithResult(_0x581651,null))[_0x5005('0x43')](handleError(_0x581651,null));};exports[_0x5005('0x45')]=function(_0x4f38b6,_0x59123d){return db[_0x5005('0x2c')][_0x5005('0x45')](_0x4f38b6['body'],{})[_0x5005('0x26')](respondWithResult(_0x59123d,0xc9))[_0x5005('0x43')](handleError(_0x59123d,null));};exports[_0x5005('0x24')]=function(_0x37c366,_0x4390c0){if(_0x37c366[_0x5005('0x46')]['id']){delete _0x37c366[_0x5005('0x46')]['id'];}return db['MailSubstatus'][_0x5005('0x44')]({'where':{'id':_0x37c366[_0x5005('0x47')]['id']}})[_0x5005('0x26')](handleEntityNotFound(_0x4390c0,null))[_0x5005('0x26')](saveUpdates(_0x37c366[_0x5005('0x46')],null))[_0x5005('0x26')](respondWithResult(_0x4390c0,null))[_0x5005('0x43')](handleError(_0x4390c0,null));};exports[_0x5005('0x25')]=function(_0x4d6802,_0x17d59b){return db[_0x5005('0x2c')][_0x5005('0x44')]({'where':{'id':_0x4d6802[_0x5005('0x47')]['id']}})['then'](handleEntityNotFound(_0x17d59b,null))[_0x5005('0x26')](removeEntity(_0x17d59b,null))[_0x5005('0x43')](handleError(_0x17d59b,null));};exports[_0x5005('0x48')]=function(_0x11b28c,_0x1e5be7){return db[_0x5005('0x2c')]['describe']()[_0x5005('0x26')](respondWithResult(_0x1e5be7,null))[_0x5005('0x43')](handleError(_0x1e5be7,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index a56280d..cf36ee9 100644 --- a/server/api/mailSubstatus/mailSubstatus.events.js +++ b/server/api/mailSubstatus/mailSubstatus.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x66a0=['../../mysqldb','MailSubstatus','setMaxListeners','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x9aada2,_0xd2d349){var _0x196dff=function(_0x5ad061){while(--_0x5ad061){_0x9aada2['push'](_0x9aada2['shift']());}};_0x196dff(++_0xd2d349);}(_0x66a0,0x15e));var _0x066a=function(_0xf74372,_0x51fe82){_0xf74372=_0xf74372-0x0;var _0x36bb65=_0x66a0[_0xf74372];return _0x36bb65;};'use strict';var EventEmitter=require(_0x066a('0x0'));var MailSubstatus=require(_0x066a('0x1'))['db'][_0x066a('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x066a('0x3')](0x0);var events={'afterUpdate':_0x066a('0x4')};function emitEvent(_0x1ed52c){return function(_0x580634,_0x2c4599,_0x4654f2){MailSubstatusEvents[_0x066a('0x5')](_0x1ed52c+':'+_0x580634['id'],_0x580634);MailSubstatusEvents[_0x066a('0x5')](_0x1ed52c,_0x580634);_0x4654f2(null);};}for(var e in events){if(events[_0x066a('0x6')](e)){var event=events[e];MailSubstatus[_0x066a('0x7')](e,emitEvent(event));}}module[_0x066a('0x8')]=MailSubstatusEvents; \ No newline at end of file +var _0x47be=['emit','hasOwnProperty','exports','../../mysqldb','MailSubstatus','setMaxListeners','update'];(function(_0x548d7d,_0x2d41fc){var _0xb1c878=function(_0x570f09){while(--_0x570f09){_0x548d7d['push'](_0x548d7d['shift']());}};_0xb1c878(++_0x2d41fc);}(_0x47be,0xb2));var _0xe47b=function(_0x424ebf,_0x4c64d3){_0x424ebf=_0x424ebf-0x0;var _0x4c6aef=_0x47be[_0x424ebf];return _0x4c6aef;};'use strict';var EventEmitter=require('events');var MailSubstatus=require(_0xe47b('0x0'))['db'][_0xe47b('0x1')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0xe47b('0x2')](0x0);var events={'afterUpdate':_0xe47b('0x3')};function emitEvent(_0x1372cb){return function(_0x379d68,_0x107c5b,_0x391cfc){MailSubstatusEvents[_0xe47b('0x4')](_0x1372cb+':'+_0x379d68['id'],_0x379d68);MailSubstatusEvents[_0xe47b('0x4')](_0x1372cb,_0x379d68);_0x391cfc(null);};}for(var e in events){if(events[_0xe47b('0x5')](e)){var event=events[e];MailSubstatus['hook'](e,emitEvent(event));}}module[_0xe47b('0x6')]=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 2030ffb..dcf2cf4 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 _0x0860=['./mailSubstatus.attributes','models','define','MailSubstatus','mail_substatuses','name','then','catch'];(function(_0xed6f46,_0x1c9006){var _0x5b267c=function(_0x59f0d2){while(--_0x59f0d2){_0xed6f46['push'](_0xed6f46['shift']());}};_0x5b267c(++_0x1c9006);}(_0x0860,0x178));var _0x0086=function(_0x4ec6da,_0xd5cdac){_0x4ec6da=_0x4ec6da-0x0;var _0x2b6a9c=_0x0860[_0x4ec6da];return _0x2b6a9c;};'use strict';var attributes=require(_0x0086('0x0'));module['exports']=function(_0x932ec8){var _0x2f2f50=_0x932ec8[_0x0086('0x1')];return _0x932ec8[_0x0086('0x2')](_0x0086('0x3'),attributes,{'tableName':_0x0086('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x15c2c2,_0x2005e7,_0x5727ea){return _0x2f2f50['Condition']['update']({'value':_0x15c2c2[_0x0086('0x5')]},{'where':{'field':'mailSubstatus','value':_0x15c2c2['_previousDataValues']['name']}})[_0x0086('0x6')](function(){_0x5727ea();})[_0x0086('0x7')](function(_0x43531b){_0x5727ea(_0x43531b);});}}});}; \ No newline at end of file +var _0x62e9=['exports','define','Condition','name','mailSubstatus','_previousDataValues','then','catch','./mailSubstatus.attributes'];(function(_0x208b68,_0x290c34){var _0x55dc6a=function(_0x18d3f8){while(--_0x18d3f8){_0x208b68['push'](_0x208b68['shift']());}};_0x55dc6a(++_0x290c34);}(_0x62e9,0x10d));var _0x962e=function(_0x48aaa9,_0x353658){_0x48aaa9=_0x48aaa9-0x0;var _0x49a3a2=_0x62e9[_0x48aaa9];return _0x49a3a2;};'use strict';var attributes=require(_0x962e('0x0'));module[_0x962e('0x1')]=function(_0x1d404c){var _0x4a071f=_0x1d404c['models'];return _0x1d404c[_0x962e('0x2')]('MailSubstatus',attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x46a463,_0x4fe758,_0x43b366){return _0x4a071f[_0x962e('0x3')]['update']({'value':_0x46a463[_0x962e('0x4')]},{'where':{'field':_0x962e('0x5'),'value':_0x46a463[_0x962e('0x6')]['name']}})[_0x962e('0x7')](function(){_0x43b366();})[_0x962e('0x8')](function(_0x1dd334){_0x43b366(_0x1dd334);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 6a86b5b..3a6b5a6 100644 --- a/server/api/mailSubstatus/mailSubstatus.rpc.js +++ b/server/api/mailSubstatus/mailSubstatus.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0c9d=['jayson/promise','http','request','then','request\x20sent','debug','error','code','MailSubstatus,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3d5df9,_0x5b3623){var _0x50ba39=function(_0x3c0de0){while(--_0x3c0de0){_0x3d5df9['push'](_0x3d5df9['shift']());}};_0x50ba39(++_0x5b3623);}(_0x0c9d,0x12b));var _0xd0c9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c9d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd0c9('0x0'));var util=require(_0xd0c9('0x1'));var moment=require(_0xd0c9('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd0c9('0x3'));var db=require(_0xd0c9('0x4'))['db'];var utils=require(_0xd0c9('0x5'));var logger=require(_0xd0c9('0x6'))(_0xd0c9('0x7'));var config=require(_0xd0c9('0x8'));var jayson=require(_0xd0c9('0x9'));var client=jayson['client'][_0xd0c9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xd431b5,_0x26d19d,_0x1d990b){return new BPromise(function(_0x53a608,_0x5218cd){return client[_0xd0c9('0xb')](_0xd431b5,_0x1d990b)[_0xd0c9('0xc')](function(_0x33b485){logger['info']('MailSubstatus,\x20%s,\x20%s',_0x26d19d,_0xd0c9('0xd'));logger[_0xd0c9('0xe')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x26d19d,'request\x20sent',JSON['stringify'](_0x33b485));if(_0x33b485['error']){if(_0x33b485[_0xd0c9('0xf')][_0xd0c9('0x10')]===0x1f4){logger[_0xd0c9('0xf')](_0xd0c9('0x11'),_0x26d19d,_0x33b485[_0xd0c9('0xf')][_0xd0c9('0x12')]);return _0x5218cd(_0x33b485['error'][_0xd0c9('0x12')]);}logger[_0xd0c9('0xf')](_0xd0c9('0x11'),_0x26d19d,_0x33b485[_0xd0c9('0xf')][_0xd0c9('0x12')]);return _0x53a608(_0x33b485['error']['message']);}else{logger[_0xd0c9('0x13')](_0xd0c9('0x11'),_0x26d19d,'request\x20sent');_0x53a608(_0x33b485[_0xd0c9('0x14')][_0xd0c9('0x12')]);}})[_0xd0c9('0x15')](function(_0x3f5daa){logger[_0xd0c9('0xf')](_0xd0c9('0x11'),_0x26d19d,_0x3f5daa);_0x5218cd(_0x3f5daa);});});} \ No newline at end of file +var _0x08b3=['lodash','util','moment','bluebird','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','MailSubstatus,\x20%s,\x20%s','debug','request\x20sent','error','message','result','catch'];(function(_0x16f2df,_0x23470a){var _0x5975f1=function(_0x741aff){while(--_0x741aff){_0x16f2df['push'](_0x16f2df['shift']());}};_0x5975f1(++_0x23470a);}(_0x08b3,0x130));var _0x308b=function(_0x498922,_0x4f094d){_0x498922=_0x498922-0x0;var _0x378d82=_0x08b3[_0x498922];return _0x378d82;};'use strict';var _=require(_0x308b('0x0'));var util=require(_0x308b('0x1'));var moment=require(_0x308b('0x2'));var BPromise=require(_0x308b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x308b('0x4'))('rpc');var config=require(_0x308b('0x5'));var jayson=require(_0x308b('0x6'));var client=jayson[_0x308b('0x7')][_0x308b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3adcb3,_0x8e124d,_0x26c7b2){return new BPromise(function(_0x2a2640,_0x4a3542){return client[_0x308b('0x9')](_0x3adcb3,_0x26c7b2)[_0x308b('0xa')](function(_0x58e4e0){logger[_0x308b('0xb')](_0x308b('0xc'),_0x8e124d,'request\x20sent');logger[_0x308b('0xd')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x8e124d,_0x308b('0xe'),JSON['stringify'](_0x58e4e0));if(_0x58e4e0['error']){if(_0x58e4e0[_0x308b('0xf')]['code']===0x1f4){logger[_0x308b('0xf')]('MailSubstatus,\x20%s,\x20%s',_0x8e124d,_0x58e4e0[_0x308b('0xf')][_0x308b('0x10')]);return _0x4a3542(_0x58e4e0[_0x308b('0xf')][_0x308b('0x10')]);}logger[_0x308b('0xf')]('MailSubstatus,\x20%s,\x20%s',_0x8e124d,_0x58e4e0[_0x308b('0xf')]['message']);return _0x2a2640(_0x58e4e0[_0x308b('0xf')]['message']);}else{logger['info'](_0x308b('0xc'),_0x8e124d,_0x308b('0xe'));_0x2a2640(_0x58e4e0[_0x308b('0x11')][_0x308b('0x10')]);}})[_0x308b('0x12')](function(_0x3cc866){logger[_0x308b('0xf')](_0x308b('0xc'),_0x8e124d,_0x3cc866);_0x4a3542(_0x3cc866);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index d80000d..ad81dc3 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 _0x45bd=['index','/describe','describe','post','create','put','/:id','update','delete','destroy','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated'];(function(_0x424501,_0x42096d){var _0xb719af=function(_0x37adcf){while(--_0x37adcf){_0x424501['push'](_0x424501['shift']());}};_0xb719af(++_0x42096d);}(_0x45bd,0x82));var _0xd45b=function(_0x441483,_0x3ab4f4){_0x441483=_0x441483-0x0;var _0x52fa32=_0x45bd[_0x441483];return _0x52fa32;};'use strict';var multer=require(_0xd45b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd45b('0x1'));var express=require('express');var router=express[_0xd45b('0x2')]();var fs_extra=require(_0xd45b('0x3'));var auth=require(_0xd45b('0x4'));var interaction=require(_0xd45b('0x5'));var config=require(_0xd45b('0x6'));var controller=require(_0xd45b('0x7'));router[_0xd45b('0x8')]('/',auth[_0xd45b('0x9')](),controller[_0xd45b('0xa')]);router[_0xd45b('0x8')](_0xd45b('0xb'),auth['isAuthenticated'](),controller[_0xd45b('0xc')]);router['get']('/:id',auth[_0xd45b('0x9')](),controller['show']);router[_0xd45b('0xd')]('/',auth[_0xd45b('0x9')](),controller[_0xd45b('0xe')]);router[_0xd45b('0xf')](_0xd45b('0x10'),auth['isAuthenticated'](),controller[_0xd45b('0x11')]);router[_0xd45b('0x12')](_0xd45b('0x10'),auth['isAuthenticated'](),controller[_0xd45b('0x13')]);module['exports']=router; \ No newline at end of file +var _0xc8b3=['exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','delete','destroy'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xc8b3,0x1ba));var _0x3c8b=function(_0x140e0a,_0x93233){_0x140e0a=_0x140e0a-0x0;var _0x373878=_0xc8b3[_0x140e0a];return _0x373878;};'use strict';var multer=require(_0x3c8b('0x0'));var util=require('util');var path=require(_0x3c8b('0x1'));var timeout=require('connect-timeout');var express=require(_0x3c8b('0x2'));var router=express[_0x3c8b('0x3')]();var fs_extra=require(_0x3c8b('0x4'));var auth=require(_0x3c8b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3c8b('0x6'));var controller=require(_0x3c8b('0x7'));router[_0x3c8b('0x8')]('/',auth[_0x3c8b('0x9')](),controller[_0x3c8b('0xa')]);router[_0x3c8b('0x8')](_0x3c8b('0xb'),auth[_0x3c8b('0x9')](),controller['describe']);router[_0x3c8b('0x8')](_0x3c8b('0xc'),auth[_0x3c8b('0x9')](),controller[_0x3c8b('0xd')]);router[_0x3c8b('0xe')]('/',auth[_0x3c8b('0x9')](),controller[_0x3c8b('0xf')]);router[_0x3c8b('0x10')](_0x3c8b('0xc'),auth[_0x3c8b('0x9')](),controller[_0x3c8b('0x11')]);router[_0x3c8b('0x12')](_0x3c8b('0xc'),auth[_0x3c8b('0x9')](),controller[_0x3c8b('0x13')]);module[_0x3c8b('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index b331707..133a42c 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 _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x22bf47,_0x5b3cfd){var _0x63e280=function(_0x1bb6d6){while(--_0x1bb6d6){_0x22bf47['push'](_0x22bf47['shift']());}};_0x63e280(++_0x5b3cfd);}(_0x54ef,0x112));var _0xf54e=function(_0x1fb0d2,_0x3e7633){_0x1fb0d2=_0x1fb0d2-0x0;var _0x2b8302=_0x54ef[_0x1fb0d2];return _0x2b8302;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}}; \ No newline at end of file +var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x1733cd,_0xf83f1c){var _0x233e8f=function(_0x33b0b2){while(--_0x33b0b2){_0x1733cd['push'](_0x1733cd['shift']());}};_0x233e8f(++_0xf83f1c);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x45096e,_0x17e82d){_0x45096e=_0x45096e-0x0;var _0xba1fa3=_0xf3cd[_0x45096e];return _0xba1fa3;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index e31bd2a..9698c1f 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 _0x794c=['../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','MailTransferReport','fieldName','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','type','filter','merge','options','include','findAll','rows','catch','show','params','keys','rawAttributes','includeAll','find','create','body','describe','rimraf','zip-dir','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment'];(function(_0x286d04,_0x59785b){var _0x2c5ae9=function(_0x32dc25){while(--_0x32dc25){_0x286d04['push'](_0x286d04['shift']());}};_0x2c5ae9(++_0x59785b);}(_0x794c,0x156));var _0xc794=function(_0x3f6bcf,_0x531e79){_0x3f6bcf=_0x3f6bcf-0x0;var _0x1c5350=_0x794c[_0x3f6bcf];return _0x1c5350;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc794('0x0'));var zipdir=require(_0xc794('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc794('0x2'));var Mustache=require(_0xc794('0x3'));var util=require('util');var path=require('path');var sox=require(_0xc794('0x4'));var csv=require(_0xc794('0x5'));var ejs=require(_0xc794('0x6'));var fs=require('fs');var fs_extra=require(_0xc794('0x7'));var _=require(_0xc794('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc794('0x5'));var querystring=require('querystring');var Papa=require(_0xc794('0x9'));var Redis=require(_0xc794('0xa'));var authService=require(_0xc794('0xb'));var qs=require(_0xc794('0xc'));var as=require(_0xc794('0xd'));var hardwareService=require(_0xc794('0xe'));var logger=require(_0xc794('0xf'))(_0xc794('0x10'));var utils=require('../../config/utils');var config=require(_0xc794('0x11'));var licenseUtil=require(_0xc794('0x12'));var db=require(_0xc794('0x13'))['db'];function respondWithStatusCode(_0x101ae7,_0x12507e){_0x12507e=_0x12507e||0xcc;return function(_0x244b53){if(_0x244b53){return _0x101ae7[_0xc794('0x14')](_0x12507e);}return _0x101ae7[_0xc794('0x15')](_0x12507e)['end']();};}function respondWithResult(_0x40fd61,_0x517fa2){_0x517fa2=_0x517fa2||0xc8;return function(_0x3e6389){if(_0x3e6389){return _0x40fd61[_0xc794('0x15')](_0x517fa2)['json'](_0x3e6389);}};}function respondWithFilteredResult(_0x168f82,_0x22fac0){return function(_0x58d2fd){if(_0x58d2fd){var _0x10a728=typeof _0x22fac0[_0xc794('0x16')]==='undefined'&&typeof _0x22fac0[_0xc794('0x17')]==='undefined';var _0x32fa9=_0x58d2fd['count'];var _0x12e798=_0x10a728?0x0:_0x22fac0['offset'];var _0x3c743d=_0x10a728?_0x58d2fd[_0xc794('0x18')]:_0x22fac0[_0xc794('0x16')]+_0x22fac0[_0xc794('0x17')];var _0x1de45b;if(_0x3c743d>=_0x32fa9){_0x3c743d=_0x32fa9;_0x1de45b=0xc8;}else{_0x1de45b=0xce;}_0x168f82['status'](_0x1de45b);return _0x168f82[_0xc794('0x19')](_0xc794('0x1a'),_0x12e798+'-'+_0x3c743d+'/'+_0x32fa9)['json'](_0x58d2fd);}return null;};}function patchUpdates(_0x483b48){return function(_0x4b9177){try{jsonpatch[_0xc794('0x1b')](_0x4b9177,_0x483b48,!![]);}catch(_0x2f9bc8){return BPromise[_0xc794('0x1c')](_0x2f9bc8);}return _0x4b9177[_0xc794('0x1d')]();};}function saveUpdates(_0x2eafb8,_0x26ca32){return function(_0xa7772b){if(_0xa7772b){return _0xa7772b[_0xc794('0x1e')](_0x2eafb8)[_0xc794('0x1f')](function(_0x59edd8){return _0x59edd8;});}return null;};}function removeEntity(_0x1ea9d7,_0xd4cfde){return function(_0x314335){if(_0x314335){return _0x314335[_0xc794('0x20')]()[_0xc794('0x1f')](function(){_0x1ea9d7[_0xc794('0x15')](0xcc)[_0xc794('0x21')]();});}};}function handleEntityNotFound(_0x2489b2,_0x29fff0){return function(_0x3bb66e){if(!_0x3bb66e){_0x2489b2[_0xc794('0x14')](0x194);}return _0x3bb66e;};}function handleError(_0x1fa453,_0x53481e){_0x53481e=_0x53481e||0x1f4;return function(_0x5b41e0){logger[_0xc794('0x22')](_0x5b41e0[_0xc794('0x23')]);if(_0x5b41e0[_0xc794('0x24')]){delete _0x5b41e0[_0xc794('0x24')];}_0x1fa453['status'](_0x53481e)[_0xc794('0x25')](_0x5b41e0);};}exports[_0xc794('0x26')]=function(_0x11dbff,_0x1e1e5d){var _0x40c049={},_0x296505={},_0x75f2bc={'count':0x0,'rows':[]};var _0x369866=_[_0xc794('0x27')](db[_0xc794('0x28')]['rawAttributes'],function(_0x50afe6){return{'name':_0x50afe6[_0xc794('0x29')],'type':_0x50afe6['type']['key']};});_0x296505[_0xc794('0x2a')]=_['map'](_0x369866,_0xc794('0x24'));_0x296505[_0xc794('0x2b')]=_['keys'](_0x11dbff[_0xc794('0x2b')]);_0x296505[_0xc794('0x2c')]=_[_0xc794('0x2d')](_0x296505[_0xc794('0x2a')],_0x296505['query']);_0x40c049[_0xc794('0x2e')]=_[_0xc794('0x2d')](_0x296505[_0xc794('0x2a')],qs['fields'](_0x11dbff[_0xc794('0x2b')][_0xc794('0x2f')]));_0x40c049[_0xc794('0x2e')]=_0x40c049[_0xc794('0x2e')][_0xc794('0x30')]?_0x40c049[_0xc794('0x2e')]:_0x296505[_0xc794('0x2a')];if(!_0x11dbff[_0xc794('0x2b')][_0xc794('0x31')](_0xc794('0x32'))){_0x40c049[_0xc794('0x17')]=qs[_0xc794('0x17')](_0x11dbff[_0xc794('0x2b')][_0xc794('0x17')]);_0x40c049[_0xc794('0x16')]=qs['offset'](_0x11dbff[_0xc794('0x2b')][_0xc794('0x16')]);}_0x40c049[_0xc794('0x33')]=qs[_0xc794('0x34')](_0x11dbff['query'][_0xc794('0x34')]);_0x40c049[_0xc794('0x35')]=qs[_0xc794('0x2c')](_[_0xc794('0x36')](_0x11dbff[_0xc794('0x2b')],_0x296505[_0xc794('0x2c')]),_0x369866);if(_0x11dbff['query']['filter']){_0x40c049['where']=_['merge'](_0x40c049[_0xc794('0x35')],{'$or':_[_0xc794('0x27')](_0x369866,function(_0x49c683){if(_0x49c683[_0xc794('0x37')]!=='VIRTUAL'){var _0x3f15c2={};_0x3f15c2[_0x49c683[_0xc794('0x24')]]={'$like':'%'+_0x11dbff[_0xc794('0x2b')][_0xc794('0x38')]+'%'};return _0x3f15c2;}})});}_0x40c049=_[_0xc794('0x39')]({},_0x40c049,_0x11dbff[_0xc794('0x3a')]);var _0x3089a5={'where':_0x40c049[_0xc794('0x35')]};return db[_0xc794('0x28')][_0xc794('0x18')](_0x3089a5)[_0xc794('0x1f')](function(_0x4a0e11){_0x75f2bc[_0xc794('0x18')]=_0x4a0e11;if(_0x11dbff[_0xc794('0x2b')]['includeAll']){_0x40c049[_0xc794('0x3b')]=[{'all':!![]}];}return db[_0xc794('0x28')][_0xc794('0x3c')](_0x40c049);})[_0xc794('0x1f')](function(_0xd5b016){_0x75f2bc[_0xc794('0x3d')]=_0xd5b016;return _0x75f2bc;})[_0xc794('0x1f')](respondWithFilteredResult(_0x1e1e5d,_0x40c049))[_0xc794('0x3e')](handleError(_0x1e1e5d,null));};exports[_0xc794('0x3f')]=function(_0x50cf71,_0x3255da){var _0x1736a0={'raw':!![],'where':{'id':_0x50cf71[_0xc794('0x40')]['id']}},_0x1ac344={};_0x1ac344[_0xc794('0x2a')]=_[_0xc794('0x41')](db['MailTransferReport'][_0xc794('0x42')]);_0x1ac344[_0xc794('0x2b')]=_['keys'](_0x50cf71[_0xc794('0x2b')]);_0x1ac344[_0xc794('0x2c')]=_[_0xc794('0x2d')](_0x1ac344[_0xc794('0x2a')],_0x1ac344['query']);_0x1736a0['attributes']=_[_0xc794('0x2d')](_0x1ac344[_0xc794('0x2a')],qs[_0xc794('0x2f')](_0x50cf71[_0xc794('0x2b')]['fields']));_0x1736a0[_0xc794('0x2e')]=_0x1736a0[_0xc794('0x2e')]['length']?_0x1736a0[_0xc794('0x2e')]:_0x1ac344[_0xc794('0x2a')];if(_0x50cf71[_0xc794('0x2b')][_0xc794('0x43')]){_0x1736a0[_0xc794('0x3b')]=[{'all':!![]}];}_0x1736a0=_[_0xc794('0x39')]({},_0x1736a0,_0x50cf71[_0xc794('0x3a')]);return db[_0xc794('0x28')][_0xc794('0x44')](_0x1736a0)[_0xc794('0x1f')](handleEntityNotFound(_0x3255da,null))[_0xc794('0x1f')](respondWithResult(_0x3255da,null))['catch'](handleError(_0x3255da,null));};exports[_0xc794('0x45')]=function(_0x2c8ba5,_0x527078){return db[_0xc794('0x28')][_0xc794('0x45')](_0x2c8ba5[_0xc794('0x46')],{})[_0xc794('0x1f')](respondWithResult(_0x527078,0xc9))[_0xc794('0x3e')](handleError(_0x527078,null));};exports[_0xc794('0x1e')]=function(_0x172007,_0x32df3f){if(_0x172007[_0xc794('0x46')]['id']){delete _0x172007[_0xc794('0x46')]['id'];}return db['MailTransferReport'][_0xc794('0x44')]({'where':{'id':_0x172007[_0xc794('0x40')]['id']}})[_0xc794('0x1f')](handleEntityNotFound(_0x32df3f,null))[_0xc794('0x1f')](saveUpdates(_0x172007[_0xc794('0x46')],null))[_0xc794('0x1f')](respondWithResult(_0x32df3f,null))[_0xc794('0x3e')](handleError(_0x32df3f,null));};exports['destroy']=function(_0x31641f,_0x1cba71){return db[_0xc794('0x28')][_0xc794('0x44')]({'where':{'id':_0x31641f[_0xc794('0x40')]['id']}})[_0xc794('0x1f')](handleEntityNotFound(_0x1cba71,null))[_0xc794('0x1f')](removeEntity(_0x1cba71,null))['catch'](handleError(_0x1cba71,null));};exports[_0xc794('0x47')]=function(_0x16f1bf,_0xaa85ae){return db['MailTransferReport'][_0xc794('0x47')]()['then'](respondWithResult(_0xaa85ae,null))[_0xc794('0x3e')](handleError(_0xaa85ae,null));}; \ No newline at end of file +var _0xfaeb=['to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','save','then','destroy','error','stack','name','map','MailTransferReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','length','nolimit','order','pick','where','VIRTUAL','merge','options','includeAll','rows','catch','show','params','keys','attributes','include','find','create','body','update','describe','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox'];(function(_0x45b29d,_0x44ce43){var _0x32d74=function(_0x559eff){while(--_0x559eff){_0x45b29d['push'](_0x45b29d['shift']());}};_0x32d74(++_0x44ce43);}(_0xfaeb,0x118));var _0xbfae=function(_0x4dab14,_0x164ea0){_0x4dab14=_0x4dab14-0x0;var _0xf41aa=_0xfaeb[_0x4dab14];return _0xf41aa;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xbfae('0x0'));var jsonpatch=require(_0xbfae('0x1'));var rp=require('request-promise');var moment=require(_0xbfae('0x2'));var BPromise=require(_0xbfae('0x3'));var Mustache=require(_0xbfae('0x4'));var util=require(_0xbfae('0x5'));var path=require(_0xbfae('0x6'));var sox=require(_0xbfae('0x7'));var csv=require(_0xbfae('0x8'));var ejs=require(_0xbfae('0x9'));var fs=require('fs');var fs_extra=require(_0xbfae('0xa'));var _=require('lodash');var squel=require(_0xbfae('0xb'));var crypto=require('crypto');var jsforce=require(_0xbfae('0xc'));var deskjs=require(_0xbfae('0xd'));var toCsv=require(_0xbfae('0x8'));var querystring=require(_0xbfae('0xe'));var Papa=require(_0xbfae('0xf'));var Redis=require(_0xbfae('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xbfae('0x11'));var as=require(_0xbfae('0x12'));var hardwareService=require(_0xbfae('0x13'));var logger=require(_0xbfae('0x14'))(_0xbfae('0x15'));var utils=require(_0xbfae('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xbfae('0x17'))['db'];function respondWithStatusCode(_0x312daf,_0x315434){_0x315434=_0x315434||0xcc;return function(_0x2d0262){if(_0x2d0262){return _0x312daf[_0xbfae('0x18')](_0x315434);}return _0x312daf[_0xbfae('0x19')](_0x315434)[_0xbfae('0x1a')]();};}function respondWithResult(_0x30606d,_0x2abbe6){_0x2abbe6=_0x2abbe6||0xc8;return function(_0x5e4b55){if(_0x5e4b55){return _0x30606d[_0xbfae('0x19')](_0x2abbe6)[_0xbfae('0x1b')](_0x5e4b55);}};}function respondWithFilteredResult(_0x238d37,_0x4caab4){return function(_0x509a3f){if(_0x509a3f){var _0xa61384=typeof _0x4caab4['offset']===_0xbfae('0x1c')&&typeof _0x4caab4[_0xbfae('0x1d')]==='undefined';var _0x27474b=_0x509a3f[_0xbfae('0x1e')];var _0x513065=_0xa61384?0x0:_0x4caab4[_0xbfae('0x1f')];var _0x35f9a0=_0xa61384?_0x509a3f[_0xbfae('0x1e')]:_0x4caab4[_0xbfae('0x1f')]+_0x4caab4['limit'];var _0x3055e9;if(_0x35f9a0>=_0x27474b){_0x35f9a0=_0x27474b;_0x3055e9=0xc8;}else{_0x3055e9=0xce;}_0x238d37[_0xbfae('0x19')](_0x3055e9);return _0x238d37[_0xbfae('0x20')]('Content-Range',_0x513065+'-'+_0x35f9a0+'/'+_0x27474b)[_0xbfae('0x1b')](_0x509a3f);}return null;};}function patchUpdates(_0x120288){return function(_0x35fb92){try{jsonpatch[_0xbfae('0x21')](_0x35fb92,_0x120288,!![]);}catch(_0x4e1043){return BPromise['reject'](_0x4e1043);}return _0x35fb92[_0xbfae('0x22')]();};}function saveUpdates(_0x4d31e9,_0x30b415){return function(_0x5c3b29){if(_0x5c3b29){return _0x5c3b29['update'](_0x4d31e9)[_0xbfae('0x23')](function(_0x275116){return _0x275116;});}return null;};}function removeEntity(_0x37630b,_0x24c327){return function(_0x6484a){if(_0x6484a){return _0x6484a[_0xbfae('0x24')]()[_0xbfae('0x23')](function(){_0x37630b[_0xbfae('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e1bee,_0x1bb1bb){return function(_0xe064fa){if(!_0xe064fa){_0x4e1bee[_0xbfae('0x18')](0x194);}return _0xe064fa;};}function handleError(_0x571c25,_0x5b40d3){_0x5b40d3=_0x5b40d3||0x1f4;return function(_0xeed340){logger[_0xbfae('0x25')](_0xeed340[_0xbfae('0x26')]);if(_0xeed340[_0xbfae('0x27')]){delete _0xeed340['name'];}_0x571c25[_0xbfae('0x19')](_0x5b40d3)['send'](_0xeed340);};}exports['index']=function(_0x212bec,_0x173d12){var _0x2e5cdd={},_0x539c46={},_0xe27e79={'count':0x0,'rows':[]};var _0x9c762f=_[_0xbfae('0x28')](db[_0xbfae('0x29')][_0xbfae('0x2a')],function(_0x14a560){return{'name':_0x14a560[_0xbfae('0x2b')],'type':_0x14a560[_0xbfae('0x2c')][_0xbfae('0x2d')]};});_0x539c46[_0xbfae('0x2e')]=_[_0xbfae('0x28')](_0x9c762f,_0xbfae('0x27'));_0x539c46['query']=_['keys'](_0x212bec[_0xbfae('0x2f')]);_0x539c46[_0xbfae('0x30')]=_[_0xbfae('0x31')](_0x539c46[_0xbfae('0x2e')],_0x539c46[_0xbfae('0x2f')]);_0x2e5cdd['attributes']=_[_0xbfae('0x31')](_0x539c46[_0xbfae('0x2e')],qs[_0xbfae('0x32')](_0x212bec['query'][_0xbfae('0x32')]));_0x2e5cdd['attributes']=_0x2e5cdd['attributes'][_0xbfae('0x33')]?_0x2e5cdd['attributes']:_0x539c46['model'];if(!_0x212bec[_0xbfae('0x2f')]['hasOwnProperty'](_0xbfae('0x34'))){_0x2e5cdd[_0xbfae('0x1d')]=qs['limit'](_0x212bec['query'][_0xbfae('0x1d')]);_0x2e5cdd[_0xbfae('0x1f')]=qs['offset'](_0x212bec[_0xbfae('0x2f')][_0xbfae('0x1f')]);}_0x2e5cdd[_0xbfae('0x35')]=qs['sort'](_0x212bec[_0xbfae('0x2f')]['sort']);_0x2e5cdd['where']=qs['filters'](_[_0xbfae('0x36')](_0x212bec[_0xbfae('0x2f')],_0x539c46[_0xbfae('0x30')]),_0x9c762f);if(_0x212bec[_0xbfae('0x2f')]['filter']){_0x2e5cdd[_0xbfae('0x37')]=_['merge'](_0x2e5cdd[_0xbfae('0x37')],{'$or':_[_0xbfae('0x28')](_0x9c762f,function(_0x3a952c){if(_0x3a952c[_0xbfae('0x2c')]!==_0xbfae('0x38')){var _0x5e026e={};_0x5e026e[_0x3a952c['name']]={'$like':'%'+_0x212bec[_0xbfae('0x2f')]['filter']+'%'};return _0x5e026e;}})});}_0x2e5cdd=_[_0xbfae('0x39')]({},_0x2e5cdd,_0x212bec[_0xbfae('0x3a')]);var _0x3771d1={'where':_0x2e5cdd['where']};return db[_0xbfae('0x29')][_0xbfae('0x1e')](_0x3771d1)[_0xbfae('0x23')](function(_0x158509){_0xe27e79['count']=_0x158509;if(_0x212bec[_0xbfae('0x2f')][_0xbfae('0x3b')]){_0x2e5cdd['include']=[{'all':!![]}];}return db[_0xbfae('0x29')]['findAll'](_0x2e5cdd);})[_0xbfae('0x23')](function(_0x7311a6){_0xe27e79[_0xbfae('0x3c')]=_0x7311a6;return _0xe27e79;})[_0xbfae('0x23')](respondWithFilteredResult(_0x173d12,_0x2e5cdd))[_0xbfae('0x3d')](handleError(_0x173d12,null));};exports[_0xbfae('0x3e')]=function(_0x51c6a8,_0x555d00){var _0x1529ca={'raw':!![],'where':{'id':_0x51c6a8[_0xbfae('0x3f')]['id']}},_0x544a40={};_0x544a40['model']=_[_0xbfae('0x40')](db[_0xbfae('0x29')][_0xbfae('0x2a')]);_0x544a40['query']=_[_0xbfae('0x40')](_0x51c6a8[_0xbfae('0x2f')]);_0x544a40['filters']=_['intersection'](_0x544a40[_0xbfae('0x2e')],_0x544a40[_0xbfae('0x2f')]);_0x1529ca['attributes']=_[_0xbfae('0x31')](_0x544a40[_0xbfae('0x2e')],qs[_0xbfae('0x32')](_0x51c6a8[_0xbfae('0x2f')][_0xbfae('0x32')]));_0x1529ca[_0xbfae('0x41')]=_0x1529ca['attributes'][_0xbfae('0x33')]?_0x1529ca['attributes']:_0x544a40[_0xbfae('0x2e')];if(_0x51c6a8[_0xbfae('0x2f')][_0xbfae('0x3b')]){_0x1529ca[_0xbfae('0x42')]=[{'all':!![]}];}_0x1529ca=_[_0xbfae('0x39')]({},_0x1529ca,_0x51c6a8[_0xbfae('0x3a')]);return db[_0xbfae('0x29')][_0xbfae('0x43')](_0x1529ca)[_0xbfae('0x23')](handleEntityNotFound(_0x555d00,null))[_0xbfae('0x23')](respondWithResult(_0x555d00,null))['catch'](handleError(_0x555d00,null));};exports[_0xbfae('0x44')]=function(_0x41d7e0,_0x3af6ed){return db[_0xbfae('0x29')][_0xbfae('0x44')](_0x41d7e0[_0xbfae('0x45')],{})['then'](respondWithResult(_0x3af6ed,0xc9))[_0xbfae('0x3d')](handleError(_0x3af6ed,null));};exports[_0xbfae('0x46')]=function(_0x47bbbf,_0x302a0a){if(_0x47bbbf[_0xbfae('0x45')]['id']){delete _0x47bbbf['body']['id'];}return db[_0xbfae('0x29')][_0xbfae('0x43')]({'where':{'id':_0x47bbbf[_0xbfae('0x3f')]['id']}})['then'](handleEntityNotFound(_0x302a0a,null))['then'](saveUpdates(_0x47bbbf[_0xbfae('0x45')],null))[_0xbfae('0x23')](respondWithResult(_0x302a0a,null))['catch'](handleError(_0x302a0a,null));};exports[_0xbfae('0x24')]=function(_0x5086f5,_0x59a609){return db[_0xbfae('0x29')][_0xbfae('0x43')]({'where':{'id':_0x5086f5[_0xbfae('0x3f')]['id']}})[_0xbfae('0x23')](handleEntityNotFound(_0x59a609,null))[_0xbfae('0x23')](removeEntity(_0x59a609,null))[_0xbfae('0x3d')](handleError(_0x59a609,null));};exports['describe']=function(_0x3d30a6,_0x32e3c6){return db['MailTransferReport'][_0xbfae('0x47')]()['then'](respondWithResult(_0x32e3c6,null))['catch'](handleError(_0x32e3c6,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index e15b869..76d808f 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 _0xd13e=['path','../../config/environment','./mailTransferReport.attributes','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','../../config/logger','api','bluebird'];(function(_0x11d95f,_0x34f442){var _0x2b1a14=function(_0x3a4fa5){while(--_0x3a4fa5){_0x11d95f['push'](_0x11d95f['shift']());}};_0x2b1a14(++_0x34f442);}(_0xd13e,0x193));var _0xed13=function(_0x391bef,_0x201aa8){_0x391bef=_0x391bef-0x0;var _0x4194be=_0xd13e[_0x391bef];return _0x4194be;};'use strict';var _=require(_0xed13('0x0'));var util=require(_0xed13('0x1'));var logger=require(_0xed13('0x2'))(_0xed13('0x3'));var moment=require('moment');var BPromise=require(_0xed13('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xed13('0x5'));var rimraf=require('rimraf');var config=require(_0xed13('0x6'));var attributes=require(_0xed13('0x7'));module['exports']=function(_0x50de44,_0x5142bd){return _0x50de44[_0xed13('0x8')](_0xed13('0x9'),attributes,{'tableName':_0xed13('0xa'),'paranoid':![],'indexes':[{'name':_0xed13('0xb'),'fields':[_0xed13('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x31af=['MailTransferReport','uniqueid','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./mailTransferReport.attributes','define'];(function(_0xa69686,_0x34f3d3){var _0x34c19a=function(_0x351138){while(--_0x351138){_0xa69686['push'](_0xa69686['shift']());}};_0x34c19a(++_0x34f3d3);}(_0x31af,0xde));var _0xf31a=function(_0x207f0b,_0x2575cb){_0x207f0b=_0x207f0b-0x0;var _0x14c83d=_0x31af[_0x207f0b];return _0x14c83d;};'use strict';var _=require(_0xf31a('0x0'));var util=require(_0xf31a('0x1'));var logger=require(_0xf31a('0x2'))('api');var moment=require('moment');var BPromise=require(_0xf31a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf31a('0x4'));var rimraf=require(_0xf31a('0x5'));var config=require(_0xf31a('0x6'));var attributes=require(_0xf31a('0x7'));module['exports']=function(_0x8d7853,_0x209fcc){return _0x8d7853[_0xf31a('0x8')](_0xf31a('0x9'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':_0xf31a('0xa'),'fields':[_0xf31a('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index c4c75d9..3295d22 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 _0x43b7=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x12758c,_0x337ac0){var _0x40d30e=function(_0x3e25eb){while(--_0x3e25eb){_0x12758c['push'](_0x12758c['shift']());}};_0x40d30e(++_0x337ac0);}(_0x43b7,0x1df));var _0x743b=function(_0x307a89,_0x1a1934){_0x307a89=_0x307a89-0x0;var _0x328256=_0x43b7[_0x307a89];return _0x328256;};'use strict';var _=require(_0x743b('0x0'));var util=require(_0x743b('0x1'));var moment=require(_0x743b('0x2'));var BPromise=require(_0x743b('0x3'));var rs=require(_0x743b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x743b('0x5'))['db'];var utils=require(_0x743b('0x6'));var logger=require(_0x743b('0x7'))(_0x743b('0x8'));var config=require('../../config/environment');var jayson=require(_0x743b('0x9'));var client=jayson['client'][_0x743b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdaf4,_0x546405,_0x538605){return new BPromise(function(_0x107ef9,_0x422eca){return client['request'](_0x3cdaf4,_0x538605)[_0x743b('0xb')](function(_0x15f29b){logger[_0x743b('0xc')](_0x743b('0xd'),_0x546405,_0x743b('0xe'));logger[_0x743b('0xf')](_0x743b('0x10'),_0x546405,_0x743b('0xe'),JSON['stringify'](_0x15f29b));if(_0x15f29b[_0x743b('0x11')]){if(_0x15f29b[_0x743b('0x11')][_0x743b('0x12')]===0x1f4){logger[_0x743b('0x11')]('MailTransferReport,\x20%s,\x20%s',_0x546405,_0x15f29b[_0x743b('0x11')][_0x743b('0x13')]);return _0x422eca(_0x15f29b[_0x743b('0x11')][_0x743b('0x13')]);}logger['error'](_0x743b('0xd'),_0x546405,_0x15f29b[_0x743b('0x11')]['message']);return _0x107ef9(_0x15f29b[_0x743b('0x11')][_0x743b('0x13')]);}else{logger[_0x743b('0xc')](_0x743b('0xd'),_0x546405,_0x743b('0xe'));_0x107ef9(_0x15f29b[_0x743b('0x14')][_0x743b('0x13')]);}})[_0x743b('0x15')](function(_0x4aed6b){logger[_0x743b('0x11')](_0x743b('0xd'),_0x546405,_0x4aed6b);_0x422eca(_0x4aed6b);});});} \ No newline at end of file +var _0x7056=['jayson/promise','then','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0xf0bcac,_0x531755){var _0x4e4c65=function(_0x35a77a){while(--_0x35a77a){_0xf0bcac['push'](_0xf0bcac['shift']());}};_0x4e4c65(++_0x531755);}(_0x7056,0x174));var _0x6705=function(_0x228aae,_0x2af54a){_0x228aae=_0x228aae-0x0;var _0x2afe44=_0x7056[_0x228aae];return _0x2afe44;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6705('0x0'));var BPromise=require(_0x6705('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6705('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x6705('0x3'));var logger=require(_0x6705('0x4'))(_0x6705('0x5'));var config=require('../../config/environment');var jayson=require(_0x6705('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x595b89,_0x1fae8c,_0x5debb){return new BPromise(function(_0x1dc2ec,_0x2863a3){return client['request'](_0x595b89,_0x5debb)[_0x6705('0x7')](function(_0x5dae35){logger['info'](_0x6705('0x8'),_0x1fae8c,_0x6705('0x9'));logger[_0x6705('0xa')](_0x6705('0xb'),_0x1fae8c,_0x6705('0x9'),JSON[_0x6705('0xc')](_0x5dae35));if(_0x5dae35[_0x6705('0xd')]){if(_0x5dae35[_0x6705('0xd')]['code']===0x1f4){logger[_0x6705('0xd')](_0x6705('0x8'),_0x1fae8c,_0x5dae35[_0x6705('0xd')][_0x6705('0xe')]);return _0x2863a3(_0x5dae35[_0x6705('0xd')][_0x6705('0xe')]);}logger[_0x6705('0xd')](_0x6705('0x8'),_0x1fae8c,_0x5dae35[_0x6705('0xd')][_0x6705('0xe')]);return _0x1dc2ec(_0x5dae35[_0x6705('0xd')][_0x6705('0xe')]);}else{logger[_0x6705('0xf')]('MailTransferReport,\x20%s,\x20%s',_0x1fae8c,_0x6705('0x9'));_0x1dc2ec(_0x5dae35[_0x6705('0x10')][_0x6705('0xe')]);}})[_0x6705('0x11')](function(_0xf27e79){logger['error']('MailTransferReport,\x20%s,\x20%s',_0x1fae8c,_0xf27e79);_0x2863a3(_0xf27e79);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index d8d5120..afb7d86 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 _0x407f=['get','index','isAuthenticated','describe','/:id','create','update','delete','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./memberReport.controller'];(function(_0xd07d9c,_0x4c100c){var _0x2480a5=function(_0x3ee1ae){while(--_0x3ee1ae){_0xd07d9c['push'](_0xd07d9c['shift']());}};_0x2480a5(++_0x4c100c);}(_0x407f,0x1d9));var _0xf407=function(_0x3ad70a,_0x4cfc07){_0x3ad70a=_0x3ad70a-0x0;var _0x17a24f=_0x407f[_0x3ad70a];return _0x17a24f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf407('0x0'));var timeout=require(_0xf407('0x1'));var express=require(_0xf407('0x2'));var router=express[_0xf407('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xf407('0x4'));var interaction=require(_0xf407('0x5'));var config=require('../../config/environment');var controller=require(_0xf407('0x6'));router[_0xf407('0x7')]('/',auth['isAuthenticated'](),controller[_0xf407('0x8')]);router[_0xf407('0x7')]('/describe',auth[_0xf407('0x9')](),controller[_0xf407('0xa')]);router['get'](_0xf407('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xf407('0x9')](),controller[_0xf407('0xc')]);router['put'](_0xf407('0xb'),auth['isAuthenticated'](),controller[_0xf407('0xd')]);router[_0xf407('0xe')]('/:id',auth[_0xf407('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x61ef=['index','/:id','isAuthenticated','create','update','delete','destroy','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./memberReport.controller','get'];(function(_0x2eb828,_0x5b4396){var _0xdb47b7=function(_0x5797cb){while(--_0x5797cb){_0x2eb828['push'](_0x2eb828['shift']());}};_0xdb47b7(++_0x5b4396);}(_0x61ef,0x77));var _0xf61e=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x61ef[_0x2070da];return _0x4f9fe1;};'use strict';var multer=require(_0xf61e('0x0'));var util=require(_0xf61e('0x1'));var path=require(_0xf61e('0x2'));var timeout=require('connect-timeout');var express=require(_0xf61e('0x3'));var router=express[_0xf61e('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf61e('0x5'));var config=require(_0xf61e('0x6'));var controller=require(_0xf61e('0x7'));router[_0xf61e('0x8')]('/',auth['isAuthenticated'](),controller[_0xf61e('0x9')]);router[_0xf61e('0x8')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xf61e('0x8')](_0xf61e('0xa'),auth[_0xf61e('0xb')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xf61e('0xc')]);router['put']('/:id',auth[_0xf61e('0xb')](),controller[_0xf61e('0xd')]);router[_0xf61e('0xe')](_0xf61e('0xa'),auth[_0xf61e('0xb')](),controller[_0xf61e('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index c7a113e..27d138e 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 _0x1baf=['talk:[destination]','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','enterAt','diff','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]'];(function(_0x5ced00,_0x16eb05){var _0xd840fb=function(_0x5412ca){while(--_0x5412ca){_0x5ced00['push'](_0x5ced00['shift']());}};_0xd840fb(++_0x16eb05);}(_0x1baf,0x1c1));var _0xf1ba=function(_0x4fc1e2,_0x558fcd){_0x4fc1e2=_0x4fc1e2-0x0;var _0x849a4f=_0x1baf[_0x4fc1e2];return _0x849a4f;};'use strict';var Sequelize=require(_0xf1ba('0x0'));var moment=require(_0xf1ba('0x1'));module[_0xf1ba('0x2')]={'channel':{'type':Sequelize[_0xf1ba('0x3')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xf1ba('0x3')]},'type':{'type':Sequelize[_0xf1ba('0x3')],'defaultValue':_0xf1ba('0x4'),'comment':_0xf1ba('0x5')},'duration':{'type':Sequelize[_0xf1ba('0x6')]},'enterAt':{'type':Sequelize[_0xf1ba('0x7')]},'exitAt':{'type':Sequelize[_0xf1ba('0x7')],'set':function(_0x514135){var _0x23ef8c=moment(_0x514135);var _0x4dbfbd=moment(this['getDataValue'](_0xf1ba('0x8')));var _0x10095b=_0x23ef8c[_0xf1ba('0x9')](_0x4dbfbd,_0xf1ba('0xa'));this[_0xf1ba('0xb')](_0xf1ba('0xc'),_0x514135);this[_0xf1ba('0xb')](_0xf1ba('0xd'),_0x10095b>=0x0?_0x10095b:null);}},'data1':{'type':Sequelize[_0xf1ba('0x3')],'comment':_0xf1ba('0xe')},'data2':{'type':Sequelize[_0xf1ba('0x3')],'comment':'talk:[start]'},'data3':{'type':Sequelize['STRING'],'comment':_0xf1ba('0xf')},'data4':{'type':Sequelize[_0xf1ba('0x3')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0xf1ba('0x3')],'comment':'talk:[queue]'},'role':{'type':Sequelize[_0xf1ba('0x3')]},'internal':{'type':Sequelize[_0xf1ba('0x6')]},'uniqueid':{'type':Sequelize[_0xf1ba('0x3')]}}; \ No newline at end of file +var _0x4e28=['enterAt','diff','seconds','setDataValue','exitAt','duration','talk:[start]','talk:[destination]','INTEGER','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','DATE','getDataValue'];(function(_0x1a101e,_0x1446c1){var _0x3e8f65=function(_0x16c384){while(--_0x16c384){_0x1a101e['push'](_0x1a101e['shift']());}};_0x3e8f65(++_0x1446c1);}(_0x4e28,0x119));var _0x84e2=function(_0x1070bc,_0x31a174){_0x1070bc=_0x1070bc-0x0;var _0x1cc0e5=_0x4e28[_0x1070bc];return _0x1cc0e5;};'use strict';var Sequelize=require(_0x84e2('0x0'));var moment=require(_0x84e2('0x1'));module[_0x84e2('0x2')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x84e2('0x3')]},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING'],'defaultValue':_0x84e2('0x4'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0x84e2('0x5')]},'exitAt':{'type':Sequelize[_0x84e2('0x5')],'set':function(_0x52338a){var _0x22cb84=moment(_0x52338a);var _0x412a33=moment(this[_0x84e2('0x6')](_0x84e2('0x7')));var _0x171220=_0x22cb84[_0x84e2('0x8')](_0x412a33,_0x84e2('0x9'));this[_0x84e2('0xa')](_0x84e2('0xb'),_0x52338a);this[_0x84e2('0xa')](_0x84e2('0xc'),_0x171220>=0x0?_0x171220:null);}},'data1':{'type':Sequelize[_0x84e2('0x3')],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize['STRING'],'comment':_0x84e2('0xd')},'data3':{'type':Sequelize[_0x84e2('0x3')],'comment':_0x84e2('0xe')},'data4':{'type':Sequelize[_0x84e2('0x3')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0x84e2('0x3')],'comment':'talk:[queue]'},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0x84e2('0xf')]},'uniqueid':{'type':Sequelize[_0x84e2('0x3')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 77915e0..f779cb9 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 _0x9c44=['catch','params','find','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','MemberReport','rawAttributes','fieldName','type','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','then','includeAll','include','findAll','rows'];(function(_0x124781,_0x30847d){var _0xff00d8=function(_0x162134){while(--_0x162134){_0x124781['push'](_0x124781['shift']());}};_0xff00d8(++_0x30847d);}(_0x9c44,0x178));var _0x49c4=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x9c44[_0x4b055c];return _0x4b62bb;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x49c4('0x0'));var jsonpatch=require(_0x49c4('0x1'));var rp=require(_0x49c4('0x2'));var moment=require(_0x49c4('0x3'));var BPromise=require(_0x49c4('0x4'));var Mustache=require(_0x49c4('0x5'));var util=require('util');var path=require('path');var sox=require(_0x49c4('0x6'));var csv=require('to-csv');var ejs=require(_0x49c4('0x7'));var fs=require('fs');var fs_extra=require(_0x49c4('0x8'));var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0xd'));var querystring=require(_0x49c4('0xe'));var Papa=require(_0x49c4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0x10'));var as=require(_0x49c4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49c4('0x12'))(_0x49c4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x49c4('0x14'));var db=require(_0x49c4('0x15'))['db'];function respondWithStatusCode(_0x5487cd,_0x7df3a9){_0x7df3a9=_0x7df3a9||0xcc;return function(_0x403bfb){if(_0x403bfb){return _0x5487cd['sendStatus'](_0x7df3a9);}return _0x5487cd[_0x49c4('0x16')](_0x7df3a9)[_0x49c4('0x17')]();};}function respondWithResult(_0x21f15a,_0x2decee){_0x2decee=_0x2decee||0xc8;return function(_0x12777c){if(_0x12777c){return _0x21f15a[_0x49c4('0x16')](_0x2decee)[_0x49c4('0x18')](_0x12777c);}};}function respondWithFilteredResult(_0x3de397,_0x58d177){return function(_0x3acd06){if(_0x3acd06){var _0x141003=typeof _0x58d177[_0x49c4('0x19')]===_0x49c4('0x1a')&&typeof _0x58d177[_0x49c4('0x1b')]==='undefined';var _0x44e607=_0x3acd06[_0x49c4('0x1c')];var _0x4c3253=_0x141003?0x0:_0x58d177['offset'];var _0x3c782d=_0x141003?_0x3acd06[_0x49c4('0x1c')]:_0x58d177[_0x49c4('0x19')]+_0x58d177['limit'];var _0x24856d;if(_0x3c782d>=_0x44e607){_0x3c782d=_0x44e607;_0x24856d=0xc8;}else{_0x24856d=0xce;}_0x3de397['status'](_0x24856d);return _0x3de397[_0x49c4('0x1d')](_0x49c4('0x1e'),_0x4c3253+'-'+_0x3c782d+'/'+_0x44e607)[_0x49c4('0x18')](_0x3acd06);}return null;};}function patchUpdates(_0x291526){return function(_0x382040){try{jsonpatch[_0x49c4('0x1f')](_0x382040,_0x291526,!![]);}catch(_0x280893){return BPromise[_0x49c4('0x20')](_0x280893);}return _0x382040[_0x49c4('0x21')]();};}function saveUpdates(_0x578447,_0x527126){return function(_0x57f502){if(_0x57f502){return _0x57f502[_0x49c4('0x22')](_0x578447)['then'](function(_0x592bb8){return _0x592bb8;});}return null;};}function removeEntity(_0x2263ae,_0x15581b){return function(_0x26c640){if(_0x26c640){return _0x26c640[_0x49c4('0x23')]()['then'](function(){_0x2263ae['status'](0xcc)[_0x49c4('0x17')]();});}};}function handleEntityNotFound(_0x9cb797,_0x565423){return function(_0x207358){if(!_0x207358){_0x9cb797[_0x49c4('0x24')](0x194);}return _0x207358;};}function handleError(_0x210159,_0xa7a826){_0xa7a826=_0xa7a826||0x1f4;return function(_0x531d92){logger['error'](_0x531d92[_0x49c4('0x25')]);if(_0x531d92['name']){delete _0x531d92[_0x49c4('0x26')];}_0x210159[_0x49c4('0x16')](_0xa7a826)[_0x49c4('0x27')](_0x531d92);};}exports[_0x49c4('0x28')]=function(_0x5987ae,_0x889909){var _0x2b2793={},_0x46e04d={},_0x4f28a2={'count':0x0,'rows':[]};var _0x6329b3=_[_0x49c4('0x29')](db[_0x49c4('0x2a')][_0x49c4('0x2b')],function(_0x17b50f){return{'name':_0x17b50f[_0x49c4('0x2c')],'type':_0x17b50f[_0x49c4('0x2d')]['key']};});_0x46e04d['model']=_['map'](_0x6329b3,_0x49c4('0x26'));_0x46e04d[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x5987ae[_0x49c4('0x2e')]);_0x46e04d[_0x49c4('0x30')]=_['intersection'](_0x46e04d[_0x49c4('0x31')],_0x46e04d[_0x49c4('0x2e')]);_0x2b2793[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x46e04d['model'],qs['fields'](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x2b2793[_0x49c4('0x32')]=_0x2b2793[_0x49c4('0x32')][_0x49c4('0x35')]?_0x2b2793['attributes']:_0x46e04d[_0x49c4('0x31')];if(!_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x36')]('nolimit')){_0x2b2793['limit']=qs[_0x49c4('0x1b')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x1b')]);_0x2b2793[_0x49c4('0x19')]=qs[_0x49c4('0x19')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x19')]);}_0x2b2793[_0x49c4('0x37')]=qs[_0x49c4('0x38')](_0x5987ae['query'][_0x49c4('0x38')]);_0x2b2793['where']=qs[_0x49c4('0x30')](_[_0x49c4('0x39')](_0x5987ae[_0x49c4('0x2e')],_0x46e04d[_0x49c4('0x30')]),_0x6329b3);if(_0x5987ae['query'][_0x49c4('0x3a')]){_0x2b2793[_0x49c4('0x3b')]=_[_0x49c4('0x3c')](_0x2b2793['where'],{'$or':_[_0x49c4('0x29')](_0x6329b3,function(_0x21d8c7){if(_0x21d8c7[_0x49c4('0x2d')]!==_0x49c4('0x3d')){var _0x1ba7a0={};_0x1ba7a0[_0x21d8c7[_0x49c4('0x26')]]={'$like':'%'+_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x3a')]+'%'};return _0x1ba7a0;}})});}_0x2b2793=_[_0x49c4('0x3c')]({},_0x2b2793,_0x5987ae[_0x49c4('0x3e')]);var _0x1e506a={'where':_0x2b2793['where']};return db[_0x49c4('0x2a')][_0x49c4('0x1c')](_0x1e506a)[_0x49c4('0x3f')](function(_0x23aa32){_0x4f28a2[_0x49c4('0x1c')]=_0x23aa32;if(_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x2b2793[_0x49c4('0x41')]=[{'all':!![]}];}return db[_0x49c4('0x2a')][_0x49c4('0x42')](_0x2b2793);})[_0x49c4('0x3f')](function(_0xa3d59e){_0x4f28a2[_0x49c4('0x43')]=_0xa3d59e;return _0x4f28a2;})['then'](respondWithFilteredResult(_0x889909,_0x2b2793))[_0x49c4('0x44')](handleError(_0x889909,null));};exports['show']=function(_0x104efb,_0x4915bc){var _0x28d4fb={'raw':!![],'where':{'id':_0x104efb[_0x49c4('0x45')]['id']}},_0x1480da={};_0x1480da[_0x49c4('0x31')]=_['keys'](db['MemberReport'][_0x49c4('0x2b')]);_0x1480da[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x104efb[_0x49c4('0x2e')]);_0x1480da['filters']=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],_0x1480da[_0x49c4('0x2e')]);_0x28d4fb[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],qs[_0x49c4('0x34')](_0x104efb[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x28d4fb['attributes']=_0x28d4fb[_0x49c4('0x32')]['length']?_0x28d4fb[_0x49c4('0x32')]:_0x1480da[_0x49c4('0x31')];if(_0x104efb[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x28d4fb[_0x49c4('0x41')]=[{'all':!![]}];}_0x28d4fb=_['merge']({},_0x28d4fb,_0x104efb[_0x49c4('0x3e')]);return db[_0x49c4('0x2a')][_0x49c4('0x46')](_0x28d4fb)[_0x49c4('0x3f')](handleEntityNotFound(_0x4915bc,null))[_0x49c4('0x3f')](respondWithResult(_0x4915bc,null))[_0x49c4('0x44')](handleError(_0x4915bc,null));};exports[_0x49c4('0x47')]=function(_0x4d89e0,_0x3bac1b){return db['MemberReport'][_0x49c4('0x47')](_0x4d89e0[_0x49c4('0x48')],{})[_0x49c4('0x3f')](respondWithResult(_0x3bac1b,0xc9))[_0x49c4('0x44')](handleError(_0x3bac1b,null));};exports[_0x49c4('0x22')]=function(_0x30bea5,_0x2c6be1){if(_0x30bea5['body']['id']){delete _0x30bea5[_0x49c4('0x48')]['id'];}return db[_0x49c4('0x2a')]['find']({'where':{'id':_0x30bea5[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x2c6be1,null))[_0x49c4('0x3f')](saveUpdates(_0x30bea5[_0x49c4('0x48')],null))['then'](respondWithResult(_0x2c6be1,null))['catch'](handleError(_0x2c6be1,null));};exports[_0x49c4('0x23')]=function(_0x4e8221,_0x4597c3){return db[_0x49c4('0x2a')][_0x49c4('0x46')]({'where':{'id':_0x4e8221[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x4597c3,null))[_0x49c4('0x3f')](removeEntity(_0x4597c3,null))[_0x49c4('0x44')](handleError(_0x4597c3,null));};exports['describe']=function(_0x1f26c2,_0x1550ce){return db[_0x49c4('0x2a')][_0x49c4('0x49')]()[_0x49c4('0x3f')](respondWithResult(_0x1550ce,null))[_0x49c4('0x44')](handleError(_0x1550ce,null));}; \ No newline at end of file +var _0x7217=['query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','filter','includeAll','include','rows','catch','show','params','rawAttributes','length','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','send','index','map','MemberReport','fieldName','type','model','name','keys'];(function(_0x36d201,_0x21e460){var _0x3d2ee0=function(_0x3a48d8){while(--_0x3a48d8){_0x36d201['push'](_0x36d201['shift']());}};_0x3d2ee0(++_0x21e460);}(_0x7217,0x19e));var _0x7721=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0x7217[_0x4fc9e6];return _0x551d28;};'use strict';var emlformat=require(_0x7721('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7721('0x1'));var jsonpatch=require(_0x7721('0x2'));var rp=require(_0x7721('0x3'));var moment=require(_0x7721('0x4'));var BPromise=require(_0x7721('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7721('0x6'));var sox=require(_0x7721('0x7'));var csv=require(_0x7721('0x8'));var ejs=require(_0x7721('0x9'));var fs=require('fs');var fs_extra=require(_0x7721('0xa'));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('0x8'));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 licenseUtil=require(_0x7721('0x1a'));var db=require(_0x7721('0x1b'))['db'];function respondWithStatusCode(_0x55b4ca,_0x2911ec){_0x2911ec=_0x2911ec||0xcc;return function(_0x199930){if(_0x199930){return _0x55b4ca['sendStatus'](_0x2911ec);}return _0x55b4ca[_0x7721('0x1c')](_0x2911ec)[_0x7721('0x1d')]();};}function respondWithResult(_0x3f01c5,_0x2e9752){_0x2e9752=_0x2e9752||0xc8;return function(_0x5069da){if(_0x5069da){return _0x3f01c5[_0x7721('0x1c')](_0x2e9752)[_0x7721('0x1e')](_0x5069da);}};}function respondWithFilteredResult(_0x534f1b,_0x4e199a){return function(_0x4b183e){if(_0x4b183e){var _0x5ed54=typeof _0x4e199a[_0x7721('0x1f')]===_0x7721('0x20')&&typeof _0x4e199a[_0x7721('0x21')]==='undefined';var _0x20f669=_0x4b183e['count'];var _0x3fc09e=_0x5ed54?0x0:_0x4e199a['offset'];var _0xfec626=_0x5ed54?_0x4b183e[_0x7721('0x22')]:_0x4e199a[_0x7721('0x1f')]+_0x4e199a[_0x7721('0x21')];var _0x2286e5;if(_0xfec626>=_0x20f669){_0xfec626=_0x20f669;_0x2286e5=0xc8;}else{_0x2286e5=0xce;}_0x534f1b[_0x7721('0x1c')](_0x2286e5);return _0x534f1b[_0x7721('0x23')](_0x7721('0x24'),_0x3fc09e+'-'+_0xfec626+'/'+_0x20f669)[_0x7721('0x1e')](_0x4b183e);}return null;};}function patchUpdates(_0xaeccc4){return function(_0x4ce1db){try{jsonpatch[_0x7721('0x25')](_0x4ce1db,_0xaeccc4,!![]);}catch(_0x2c1583){return BPromise[_0x7721('0x26')](_0x2c1583);}return _0x4ce1db[_0x7721('0x27')]();};}function saveUpdates(_0x57140c,_0x28f5a6){return function(_0x512f31){if(_0x512f31){return _0x512f31[_0x7721('0x28')](_0x57140c)[_0x7721('0x29')](function(_0x3e8a4e){return _0x3e8a4e;});}return null;};}function removeEntity(_0x1caad8,_0x121cc4){return function(_0x395b15){if(_0x395b15){return _0x395b15[_0x7721('0x2a')]()['then'](function(){_0x1caad8[_0x7721('0x1c')](0xcc)[_0x7721('0x1d')]();});}};}function handleEntityNotFound(_0x125564,_0x1f67c7){return function(_0x40d550){if(!_0x40d550){_0x125564[_0x7721('0x2b')](0x194);}return _0x40d550;};}function handleError(_0x424e05,_0xf753f1){_0xf753f1=_0xf753f1||0x1f4;return function(_0x40f367){logger['error'](_0x40f367[_0x7721('0x2c')]);if(_0x40f367['name']){delete _0x40f367['name'];}_0x424e05[_0x7721('0x1c')](_0xf753f1)[_0x7721('0x2d')](_0x40f367);};}exports[_0x7721('0x2e')]=function(_0x158d98,_0x1ea4d){var _0x37b9f0={},_0xd7d703={},_0x1da2d8={'count':0x0,'rows':[]};var _0x5c54f0=_[_0x7721('0x2f')](db[_0x7721('0x30')]['rawAttributes'],function(_0x4a25c9){return{'name':_0x4a25c9[_0x7721('0x31')],'type':_0x4a25c9[_0x7721('0x32')]['key']};});_0xd7d703[_0x7721('0x33')]=_[_0x7721('0x2f')](_0x5c54f0,_0x7721('0x34'));_0xd7d703['query']=_[_0x7721('0x35')](_0x158d98[_0x7721('0x36')]);_0xd7d703[_0x7721('0x37')]=_[_0x7721('0x38')](_0xd7d703[_0x7721('0x33')],_0xd7d703['query']);_0x37b9f0[_0x7721('0x39')]=_[_0x7721('0x38')](_0xd7d703[_0x7721('0x33')],qs['fields'](_0x158d98[_0x7721('0x36')][_0x7721('0x3a')]));_0x37b9f0['attributes']=_0x37b9f0[_0x7721('0x39')]['length']?_0x37b9f0[_0x7721('0x39')]:_0xd7d703[_0x7721('0x33')];if(!_0x158d98[_0x7721('0x36')][_0x7721('0x3b')](_0x7721('0x3c'))){_0x37b9f0[_0x7721('0x21')]=qs[_0x7721('0x21')](_0x158d98[_0x7721('0x36')][_0x7721('0x21')]);_0x37b9f0[_0x7721('0x1f')]=qs[_0x7721('0x1f')](_0x158d98['query'][_0x7721('0x1f')]);}_0x37b9f0['order']=qs[_0x7721('0x3d')](_0x158d98[_0x7721('0x36')][_0x7721('0x3d')]);_0x37b9f0[_0x7721('0x3e')]=qs[_0x7721('0x37')](_[_0x7721('0x3f')](_0x158d98['query'],_0xd7d703['filters']),_0x5c54f0);if(_0x158d98['query']['filter']){_0x37b9f0[_0x7721('0x3e')]=_[_0x7721('0x40')](_0x37b9f0[_0x7721('0x3e')],{'$or':_[_0x7721('0x2f')](_0x5c54f0,function(_0x4a90ce){if(_0x4a90ce[_0x7721('0x32')]!=='VIRTUAL'){var _0xfab37b={};_0xfab37b[_0x4a90ce[_0x7721('0x34')]]={'$like':'%'+_0x158d98['query'][_0x7721('0x41')]+'%'};return _0xfab37b;}})});}_0x37b9f0=_[_0x7721('0x40')]({},_0x37b9f0,_0x158d98['options']);var _0x4d0111={'where':_0x37b9f0[_0x7721('0x3e')]};return db[_0x7721('0x30')][_0x7721('0x22')](_0x4d0111)[_0x7721('0x29')](function(_0x577af9){_0x1da2d8[_0x7721('0x22')]=_0x577af9;if(_0x158d98[_0x7721('0x36')][_0x7721('0x42')]){_0x37b9f0[_0x7721('0x43')]=[{'all':!![]}];}return db[_0x7721('0x30')]['findAll'](_0x37b9f0);})[_0x7721('0x29')](function(_0x4a2c28){_0x1da2d8[_0x7721('0x44')]=_0x4a2c28;return _0x1da2d8;})['then'](respondWithFilteredResult(_0x1ea4d,_0x37b9f0))[_0x7721('0x45')](handleError(_0x1ea4d,null));};exports[_0x7721('0x46')]=function(_0x231dad,_0x49e0c5){var _0x1453d4={'raw':!![],'where':{'id':_0x231dad[_0x7721('0x47')]['id']}},_0x11d853={};_0x11d853['model']=_[_0x7721('0x35')](db[_0x7721('0x30')][_0x7721('0x48')]);_0x11d853[_0x7721('0x36')]=_[_0x7721('0x35')](_0x231dad[_0x7721('0x36')]);_0x11d853[_0x7721('0x37')]=_['intersection'](_0x11d853['model'],_0x11d853[_0x7721('0x36')]);_0x1453d4[_0x7721('0x39')]=_[_0x7721('0x38')](_0x11d853[_0x7721('0x33')],qs[_0x7721('0x3a')](_0x231dad[_0x7721('0x36')][_0x7721('0x3a')]));_0x1453d4[_0x7721('0x39')]=_0x1453d4[_0x7721('0x39')][_0x7721('0x49')]?_0x1453d4['attributes']:_0x11d853['model'];if(_0x231dad[_0x7721('0x36')][_0x7721('0x42')]){_0x1453d4[_0x7721('0x43')]=[{'all':!![]}];}_0x1453d4=_[_0x7721('0x40')]({},_0x1453d4,_0x231dad['options']);return db[_0x7721('0x30')][_0x7721('0x4a')](_0x1453d4)['then'](handleEntityNotFound(_0x49e0c5,null))[_0x7721('0x29')](respondWithResult(_0x49e0c5,null))['catch'](handleError(_0x49e0c5,null));};exports[_0x7721('0x4b')]=function(_0x5c6922,_0x334f23){return db[_0x7721('0x30')][_0x7721('0x4b')](_0x5c6922['body'],{})[_0x7721('0x29')](respondWithResult(_0x334f23,0xc9))[_0x7721('0x45')](handleError(_0x334f23,null));};exports['update']=function(_0x223d93,_0x1196c2){if(_0x223d93[_0x7721('0x4c')]['id']){delete _0x223d93['body']['id'];}return db[_0x7721('0x30')]['find']({'where':{'id':_0x223d93[_0x7721('0x47')]['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x1196c2,null))[_0x7721('0x29')](saveUpdates(_0x223d93[_0x7721('0x4c')],null))[_0x7721('0x29')](respondWithResult(_0x1196c2,null))[_0x7721('0x45')](handleError(_0x1196c2,null));};exports[_0x7721('0x2a')]=function(_0x7fbb73,_0x694d2f){return db[_0x7721('0x30')][_0x7721('0x4a')]({'where':{'id':_0x7fbb73[_0x7721('0x47')]['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x694d2f,null))[_0x7721('0x29')](removeEntity(_0x694d2f,null))[_0x7721('0x45')](handleError(_0x694d2f,null));};exports['describe']=function(_0x474f32,_0x2f6f30){return db[_0x7721('0x30')][_0x7721('0x4d')]()[_0x7721('0x29')](respondWithResult(_0x2f6f30,null))[_0x7721('0x45')](handleError(_0x2f6f30,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 986b346..098349b 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 _0xb1cf=['exports','define','MemberReport','membername','interface','util','../../config/logger','api','bluebird','path','rimraf','./memberReport.attributes'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0xb1cf,0x1cd));var _0xfb1c=function(_0x210a5e,_0x1add9f){_0x210a5e=_0x210a5e-0x0;var _0x4790e0=_0xb1cf[_0x210a5e];return _0x4790e0;};'use strict';var _=require('lodash');var util=require(_0xfb1c('0x0'));var logger=require(_0xfb1c('0x1'))(_0xfb1c('0x2'));var moment=require('moment');var BPromise=require(_0xfb1c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfb1c('0x4'));var rimraf=require(_0xfb1c('0x5'));var config=require('../../config/environment');var attributes=require(_0xfb1c('0x6'));module[_0xfb1c('0x7')]=function(_0x53ba21,_0x2a2270){return _0x53ba21[_0xfb1c('0x8')](_0xfb1c('0x9'),attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0xfb1c('0xa'),_0xfb1c('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x06a7=['../../config/environment','./memberReport.attributes','exports','define','MemberReport','report_member','membername_interface','membername','interface','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x61b93d,_0x29b9de){var _0x4230bf=function(_0x37726d){while(--_0x37726d){_0x61b93d['push'](_0x61b93d['shift']());}};_0x4230bf(++_0x29b9de);}(_0x06a7,0x18f));var _0x706a=function(_0x2695ab,_0x3f4b39){_0x2695ab=_0x2695ab-0x0;var _0x3eaf50=_0x06a7[_0x2695ab];return _0x3eaf50;};'use strict';var _=require(_0x706a('0x0'));var util=require(_0x706a('0x1'));var logger=require(_0x706a('0x2'))('api');var moment=require(_0x706a('0x3'));var BPromise=require(_0x706a('0x4'));var rp=require(_0x706a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x706a('0x6'));var attributes=require(_0x706a('0x7'));module[_0x706a('0x8')]=function(_0x5d94bc,_0x76decf){return _0x5d94bc[_0x706a('0x9')](_0x706a('0xa'),attributes,{'tableName':_0x706a('0xb'),'paranoid':![],'indexes':[{'name':_0x706a('0xc'),'fields':[_0x706a('0xd'),_0x706a('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 0bc7b60..f35f4c1 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 _0xfd6e=['then','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetMemberReport','MemberReport','findAll','options','raw','where','include','model','map','attributes','info','CreateMemberReport','body','catch','UpdateMemberReport','update','lodash','moment','randomstring','ioredis','rpc','client','http','request'];(function(_0x3b789b,_0x1e5b2c){var _0x465c78=function(_0xd9710e){while(--_0xd9710e){_0x3b789b['push'](_0x3b789b['shift']());}};_0x465c78(++_0x1e5b2c);}(_0xfd6e,0x16e));var _0xefd6=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xfd6e[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0xefd6('0x0'));var util=require('util');var moment=require(_0xefd6('0x1'));var BPromise=require('bluebird');var rs=require(_0xefd6('0x2'));var fs=require('fs');var Redis=require(_0xefd6('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xefd6('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xefd6('0x5')][_0xefd6('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x26e108,_0xe477f9,_0x340765){return new BPromise(function(_0x5da399,_0x59c636){return client[_0xefd6('0x7')](_0x26e108,_0x340765)[_0xefd6('0x8')](function(_0x3c941a){logger['info'](_0xefd6('0x9'),_0xe477f9,_0xefd6('0xa'));logger[_0xefd6('0xb')](_0xefd6('0xc'),_0xe477f9,'request\x20sent',JSON[_0xefd6('0xd')](_0x3c941a));if(_0x3c941a[_0xefd6('0xe')]){if(_0x3c941a[_0xefd6('0xe')][_0xefd6('0xf')]===0x1f4){logger[_0xefd6('0xe')](_0xefd6('0x9'),_0xe477f9,_0x3c941a[_0xefd6('0xe')][_0xefd6('0x10')]);return _0x59c636(_0x3c941a['error'][_0xefd6('0x10')]);}logger[_0xefd6('0xe')](_0xefd6('0x9'),_0xe477f9,_0x3c941a[_0xefd6('0xe')][_0xefd6('0x10')]);return _0x5da399(_0x3c941a['error'][_0xefd6('0x10')]);}else{logger['info'](_0xefd6('0x9'),_0xe477f9,'request\x20sent');_0x5da399(_0x3c941a[_0xefd6('0x11')][_0xefd6('0x10')]);}})['catch'](function(_0x17bf20){logger[_0xefd6('0xe')](_0xefd6('0x9'),_0xe477f9,_0x17bf20);_0x59c636(_0x17bf20);});});}exports[_0xefd6('0x12')]=function(_0xd59458){var _0x306ad1=this;return new Promise(function(_0x469c17,_0x137e6d){return db[_0xefd6('0x13')][_0xefd6('0x14')]({'raw':_0xd59458[_0xefd6('0x15')]?_0xd59458['options'][_0xefd6('0x16')]===undefined?!![]:![]:!![],'where':_0xd59458[_0xefd6('0x15')]?_0xd59458[_0xefd6('0x15')][_0xefd6('0x17')]||null:null,'attributes':_0xd59458[_0xefd6('0x15')]?_0xd59458[_0xefd6('0x15')]['attributes']||null:null,'limit':_0xd59458[_0xefd6('0x15')]?_0xd59458[_0xefd6('0x15')]['limit']||null:null,'include':_0xd59458[_0xefd6('0x15')]?_0xd59458[_0xefd6('0x15')][_0xefd6('0x18')]?_['map'](_0xd59458['options'][_0xefd6('0x18')],function(_0x1b1d41){return{'model':db[_0x1b1d41[_0xefd6('0x19')]],'as':_0x1b1d41['as'],'attributes':_0x1b1d41['attributes'],'include':_0x1b1d41[_0xefd6('0x18')]?_[_0xefd6('0x1a')](_0x1b1d41[_0xefd6('0x18')],function(_0x5347fd){return{'model':db[_0x5347fd[_0xefd6('0x19')]],'as':_0x5347fd['as'],'attributes':_0x5347fd[_0xefd6('0x1b')],'include':_0x5347fd['include']?_[_0xefd6('0x1a')](_0x5347fd[_0xefd6('0x18')],function(_0x43ffbc){return{'model':db[_0x43ffbc['model']],'as':_0x43ffbc['as'],'attributes':_0x43ffbc[_0xefd6('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xefd6('0x8')](function(_0x174fbf){logger[_0xefd6('0x1c')](_0xefd6('0x12'),_0xd59458);logger[_0xefd6('0xb')](_0xefd6('0x12'),_0xd59458,JSON[_0xefd6('0xd')](_0x174fbf));_0x469c17(_0x174fbf);})['catch'](function(_0xca6bad){logger[_0xefd6('0xe')](_0xefd6('0x12'),_0xca6bad[_0xefd6('0x10')],_0xd59458);_0x137e6d(_0x306ad1[_0xefd6('0xe')](0x1f4,_0xca6bad['message']));});});};exports[_0xefd6('0x1d')]=function(_0x2feac2){var _0x171fe7=this;return new Promise(function(_0x15c67e,_0x3225e7){return db[_0xefd6('0x13')]['create'](_0x2feac2[_0xefd6('0x1e')],{'raw':_0x2feac2[_0xefd6('0x15')]?_0x2feac2[_0xefd6('0x15')][_0xefd6('0x16')]===undefined?!![]:![]:!![]})[_0xefd6('0x8')](function(_0x2c9fb3){logger[_0xefd6('0x1c')]('CreateMemberReport',_0x2feac2);logger[_0xefd6('0xb')](_0xefd6('0x1d'),_0x2feac2,JSON[_0xefd6('0xd')](_0x2c9fb3));_0x15c67e(_0x2c9fb3);})[_0xefd6('0x1f')](function(_0x4aa07e){logger[_0xefd6('0xe')](_0xefd6('0x1d'),_0x4aa07e['message'],_0x2feac2);_0x3225e7(_0x171fe7[_0xefd6('0xe')](0x1f4,_0x4aa07e[_0xefd6('0x10')]));});});};exports[_0xefd6('0x20')]=function(_0x474e1c){var _0x806e0e=this;return new Promise(function(_0x3cce59,_0x351ca5){return db[_0xefd6('0x13')][_0xefd6('0x21')](_0x474e1c['body'],{'raw':_0x474e1c[_0xefd6('0x15')]?_0x474e1c[_0xefd6('0x15')][_0xefd6('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x474e1c[_0xefd6('0x15')]?_0x474e1c[_0xefd6('0x15')][_0xefd6('0x17')]||null:null,'attributes':_0x474e1c['options']?_0x474e1c[_0xefd6('0x15')][_0xefd6('0x1b')]||null:null,'limit':_0x474e1c[_0xefd6('0x15')]?_0x474e1c[_0xefd6('0x15')]['limit']||null:null})[_0xefd6('0x8')](function(_0x1c34b3){logger['info'](_0xefd6('0x20'),_0x474e1c);logger[_0xefd6('0xb')]('UpdateMemberReport',_0x474e1c,JSON[_0xefd6('0xd')](_0x1c34b3));_0x3cce59(_0x1c34b3);})[_0xefd6('0x1f')](function(_0x33ccc5){logger[_0xefd6('0xe')](_0xefd6('0x20'),_0x33ccc5[_0xefd6('0x10')],_0x474e1c);_0x351ca5(_0x806e0e['error'](0x1f4,_0x33ccc5[_0xefd6('0x10')]));});});}; \ No newline at end of file +var _0xd991=['jayson/promise','http','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','MemberReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetMemberReport','MemberReport','findAll','options','where','attributes','limit','include','map','model','debug','stringify','create','body','raw','CreateMemberReport','UpdateMemberReport','update','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x494bab,_0x1f0c5f){var _0x3bde9c=function(_0x4ea7d0){while(--_0x4ea7d0){_0x494bab['push'](_0x494bab['shift']());}};_0x3bde9c(++_0x1f0c5f);}(_0xd991,0x115));var _0x1d99=function(_0x298c4c,_0x876a63){_0x298c4c=_0x298c4c-0x0;var _0x3f04af=_0xd991[_0x298c4c];return _0x3f04af;};'use strict';var _=require(_0x1d99('0x0'));var util=require(_0x1d99('0x1'));var moment=require(_0x1d99('0x2'));var BPromise=require(_0x1d99('0x3'));var rs=require(_0x1d99('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1d99('0x5'))['db'];var utils=require(_0x1d99('0x6'));var logger=require(_0x1d99('0x7'))(_0x1d99('0x8'));var config=require(_0x1d99('0x9'));var jayson=require(_0x1d99('0xa'));var client=jayson['client'][_0x1d99('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x440bb4,_0x5100fc,_0x21d746){return new BPromise(function(_0x2f4502,_0x6de8e8){return client[_0x1d99('0xc')](_0x440bb4,_0x21d746)[_0x1d99('0xd')](function(_0x3d55b1){logger[_0x1d99('0xe')](_0x1d99('0xf'),_0x5100fc,_0x1d99('0x10'));logger['debug'](_0x1d99('0x11'),_0x5100fc,_0x1d99('0x10'),JSON['stringify'](_0x3d55b1));if(_0x3d55b1[_0x1d99('0x12')]){if(_0x3d55b1[_0x1d99('0x12')][_0x1d99('0x13')]===0x1f4){logger['error'](_0x1d99('0xf'),_0x5100fc,_0x3d55b1[_0x1d99('0x12')][_0x1d99('0x14')]);return _0x6de8e8(_0x3d55b1[_0x1d99('0x12')][_0x1d99('0x14')]);}logger[_0x1d99('0x12')]('MemberReport,\x20%s,\x20%s',_0x5100fc,_0x3d55b1[_0x1d99('0x12')]['message']);return _0x2f4502(_0x3d55b1[_0x1d99('0x12')]['message']);}else{logger[_0x1d99('0xe')](_0x1d99('0xf'),_0x5100fc,_0x1d99('0x10'));_0x2f4502(_0x3d55b1[_0x1d99('0x15')][_0x1d99('0x14')]);}})[_0x1d99('0x16')](function(_0x8cf8b8){logger[_0x1d99('0x12')]('MemberReport,\x20%s,\x20%s',_0x5100fc,_0x8cf8b8);_0x6de8e8(_0x8cf8b8);});});}exports[_0x1d99('0x17')]=function(_0x4da463){var _0x3669d1=this;return new Promise(function(_0x1a51a4,_0xb6555a){return db[_0x1d99('0x18')][_0x1d99('0x19')]({'raw':_0x4da463['options']?_0x4da463['options']['raw']===undefined?!![]:![]:!![],'where':_0x4da463['options']?_0x4da463[_0x1d99('0x1a')][_0x1d99('0x1b')]||null:null,'attributes':_0x4da463[_0x1d99('0x1a')]?_0x4da463[_0x1d99('0x1a')][_0x1d99('0x1c')]||null:null,'limit':_0x4da463['options']?_0x4da463[_0x1d99('0x1a')][_0x1d99('0x1d')]||null:null,'include':_0x4da463[_0x1d99('0x1a')]?_0x4da463[_0x1d99('0x1a')][_0x1d99('0x1e')]?_[_0x1d99('0x1f')](_0x4da463[_0x1d99('0x1a')][_0x1d99('0x1e')],function(_0x8273bb){return{'model':db[_0x8273bb[_0x1d99('0x20')]],'as':_0x8273bb['as'],'attributes':_0x8273bb[_0x1d99('0x1c')],'include':_0x8273bb[_0x1d99('0x1e')]?_['map'](_0x8273bb[_0x1d99('0x1e')],function(_0x31e70e){return{'model':db[_0x31e70e[_0x1d99('0x20')]],'as':_0x31e70e['as'],'attributes':_0x31e70e[_0x1d99('0x1c')],'include':_0x31e70e['include']?_[_0x1d99('0x1f')](_0x31e70e['include'],function(_0x150569){return{'model':db[_0x150569[_0x1d99('0x20')]],'as':_0x150569['as'],'attributes':_0x150569[_0x1d99('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x1d99('0xd')](function(_0x53e108){logger[_0x1d99('0xe')](_0x1d99('0x17'),_0x4da463);logger[_0x1d99('0x21')](_0x1d99('0x17'),_0x4da463,JSON[_0x1d99('0x22')](_0x53e108));_0x1a51a4(_0x53e108);})[_0x1d99('0x16')](function(_0x5c0c0a){logger[_0x1d99('0x12')](_0x1d99('0x17'),_0x5c0c0a[_0x1d99('0x14')],_0x4da463);_0xb6555a(_0x3669d1[_0x1d99('0x12')](0x1f4,_0x5c0c0a[_0x1d99('0x14')]));});});};exports['CreateMemberReport']=function(_0x25ad6f){var _0x395e6d=this;return new Promise(function(_0x14f437,_0xfb22f4){return db[_0x1d99('0x18')][_0x1d99('0x23')](_0x25ad6f[_0x1d99('0x24')],{'raw':_0x25ad6f[_0x1d99('0x1a')]?_0x25ad6f[_0x1d99('0x1a')][_0x1d99('0x25')]===undefined?!![]:![]:!![]})['then'](function(_0x24cccb){logger[_0x1d99('0xe')](_0x1d99('0x26'),_0x25ad6f);logger['debug'](_0x1d99('0x26'),_0x25ad6f,JSON[_0x1d99('0x22')](_0x24cccb));_0x14f437(_0x24cccb);})['catch'](function(_0x2f8dc1){logger[_0x1d99('0x12')](_0x1d99('0x26'),_0x2f8dc1[_0x1d99('0x14')],_0x25ad6f);_0xfb22f4(_0x395e6d[_0x1d99('0x12')](0x1f4,_0x2f8dc1['message']));});});};exports[_0x1d99('0x27')]=function(_0x363266){var _0x33e4da=this;return new Promise(function(_0x37f9d5,_0x3aa132){return db[_0x1d99('0x18')][_0x1d99('0x28')](_0x363266['body'],{'raw':_0x363266['options']?_0x363266[_0x1d99('0x1a')][_0x1d99('0x25')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x363266[_0x1d99('0x1a')]?_0x363266[_0x1d99('0x1a')][_0x1d99('0x1b')]||null:null,'attributes':_0x363266['options']?_0x363266[_0x1d99('0x1a')][_0x1d99('0x1c')]||null:null,'limit':_0x363266[_0x1d99('0x1a')]?_0x363266[_0x1d99('0x1a')][_0x1d99('0x1d')]||null:null})[_0x1d99('0xd')](function(_0x40cc83){logger[_0x1d99('0xe')]('UpdateMemberReport',_0x363266);logger[_0x1d99('0x21')](_0x1d99('0x27'),_0x363266,JSON[_0x1d99('0x22')](_0x40cc83));_0x37f9d5(_0x40cc83);})['catch'](function(_0x32b5c0){logger[_0x1d99('0x12')]('UpdateMemberReport',_0x32b5c0[_0x1d99('0x14')],_0x363266);_0x3aa132(_0x33e4da[_0x1d99('0x12')](0x1f4,_0x32b5c0[_0x1d99('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 6cebfa1..b0196c0 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 _0x17f5=['../../config/environment','./migration.controller','get','index','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3c7d94,_0x146ec4){var _0x411598=function(_0x1f2dc3){while(--_0x1f2dc3){_0x3c7d94['push'](_0x3c7d94['shift']());}};_0x411598(++_0x146ec4);}(_0x17f5,0xa1));var _0x517f=function(_0x49ad97,_0x262c88){_0x49ad97=_0x49ad97-0x0;var _0x4455c5=_0x17f5[_0x49ad97];return _0x4455c5;};'use strict';var multer=require(_0x517f('0x0'));var util=require(_0x517f('0x1'));var path=require(_0x517f('0x2'));var timeout=require('connect-timeout');var express=require(_0x517f('0x3'));var router=express['Router']();var fs_extra=require(_0x517f('0x4'));var auth=require(_0x517f('0x5'));var interaction=require(_0x517f('0x6'));var config=require(_0x517f('0x7'));var controller=require(_0x517f('0x8'));router[_0x517f('0x9')]('/',controller[_0x517f('0xa')]);module[_0x517f('0xb')]=router; \ No newline at end of file +var _0x2aa7=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','get','index','exports','util','path'];(function(_0x186376,_0x5d988a){var _0x2dbdd9=function(_0x96908e){while(--_0x96908e){_0x186376['push'](_0x186376['shift']());}};_0x2dbdd9(++_0x5d988a);}(_0x2aa7,0xa8));var _0x72aa=function(_0x3ac750,_0x33765f){_0x3ac750=_0x3ac750-0x0;var _0x451962=_0x2aa7[_0x3ac750];return _0x451962;};'use strict';var multer=require('multer');var util=require(_0x72aa('0x0'));var path=require(_0x72aa('0x1'));var timeout=require('connect-timeout');var express=require(_0x72aa('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x72aa('0x3'));var interaction=require(_0x72aa('0x4'));var config=require(_0x72aa('0x5'));var controller=require(_0x72aa('0x6'));router[_0x72aa('0x7')]('/',controller[_0x72aa('0x8')]);module[_0x72aa('0x9')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 09b0726..b0de876 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 _0x60eb=['version','sequelize'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x60eb,0xfd));var _0xb60e=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x60eb[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0xb60e('0x0'));module['exports']={'version':{'type':Sequelize['STRING'],'unique':_0xb60e('0x1')}}; \ No newline at end of file +var _0xe94d=['STRING'];(function(_0x56c70f,_0x4e4493){var _0x3812ed=function(_0x25460f){while(--_0x25460f){_0x56c70f['push'](_0x56c70f['shift']());}};_0x3812ed(++_0x4e4493);}(_0xe94d,0xcc));var _0xde94=function(_0x44b543,_0x3db061){_0x44b543=_0x44b543-0x0;var _0x34cb26=_0xe94d[_0x44b543];return _0x34cb26;};'use strict';var Sequelize=require('sequelize');module['exports']={'version':{'type':Sequelize[_0xde94('0x0')],'unique':'version'}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 9408304..1eb2c35 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 _0x0737=['catch','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','error','stack','name','send','index','map','Migration','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','include','findAll','rows'];(function(_0x8ba369,_0x16ba21){var _0x3cb213=function(_0x17be52){while(--_0x17be52){_0x8ba369['push'](_0x8ba369['shift']());}};_0x3cb213(++_0x16ba21);}(_0x0737,0x18d));var _0x7073=function(_0xe1ca32,_0x515c05){_0xe1ca32=_0xe1ca32-0x0;var _0x5d123e=_0x0737[_0xe1ca32];return _0x5d123e;};'use strict';var emlformat=require(_0x7073('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7073('0x1'));var jsonpatch=require(_0x7073('0x2'));var rp=require(_0x7073('0x3'));var moment=require('moment');var BPromise=require(_0x7073('0x4'));var Mustache=require(_0x7073('0x5'));var util=require(_0x7073('0x6'));var path=require(_0x7073('0x7'));var sox=require('sox');var csv=require(_0x7073('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7073('0x9'));var _=require(_0x7073('0xa'));var squel=require(_0x7073('0xb'));var crypto=require(_0x7073('0xc'));var jsforce=require(_0x7073('0xd'));var deskjs=require(_0x7073('0xe'));var toCsv=require(_0x7073('0x8'));var querystring=require('querystring');var Papa=require(_0x7073('0xf'));var Redis=require(_0x7073('0x10'));var authService=require(_0x7073('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x7073('0x12'));var hardwareService=require(_0x7073('0x13'));var logger=require(_0x7073('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7073('0x15'));var db=require(_0x7073('0x16'))['db'];function respondWithStatusCode(_0x3b1679,_0x459ecf){_0x459ecf=_0x459ecf||0xcc;return function(_0xe1d359){if(_0xe1d359){return _0x3b1679[_0x7073('0x17')](_0x459ecf);}return _0x3b1679[_0x7073('0x18')](_0x459ecf)[_0x7073('0x19')]();};}function respondWithResult(_0x45dc9b,_0x4274f9){_0x4274f9=_0x4274f9||0xc8;return function(_0x5ee115){if(_0x5ee115){return _0x45dc9b[_0x7073('0x18')](_0x4274f9)[_0x7073('0x1a')](_0x5ee115);}};}function respondWithFilteredResult(_0x4d069c,_0x81162){return function(_0x55103){if(_0x55103){var _0x30a35d=typeof _0x81162[_0x7073('0x1b')]===_0x7073('0x1c')&&typeof _0x81162[_0x7073('0x1d')]===_0x7073('0x1c');var _0x3e5206=_0x55103[_0x7073('0x1e')];var _0x29f04d=_0x30a35d?0x0:_0x81162[_0x7073('0x1b')];var _0x3bdbab=_0x30a35d?_0x55103[_0x7073('0x1e')]:_0x81162['offset']+_0x81162[_0x7073('0x1d')];var _0x4ab65b;if(_0x3bdbab>=_0x3e5206){_0x3bdbab=_0x3e5206;_0x4ab65b=0xc8;}else{_0x4ab65b=0xce;}_0x4d069c[_0x7073('0x18')](_0x4ab65b);return _0x4d069c[_0x7073('0x1f')](_0x7073('0x20'),_0x29f04d+'-'+_0x3bdbab+'/'+_0x3e5206)['json'](_0x55103);}return null;};}function patchUpdates(_0x1eb167){return function(_0x67dbe1){try{jsonpatch['apply'](_0x67dbe1,_0x1eb167,!![]);}catch(_0x1f54db){return BPromise[_0x7073('0x21')](_0x1f54db);}return _0x67dbe1[_0x7073('0x22')]();};}function saveUpdates(_0x3f2bf3,_0x575672){return function(_0x3e47c0){if(_0x3e47c0){return _0x3e47c0['update'](_0x3f2bf3)[_0x7073('0x23')](function(_0x556a72){return _0x556a72;});}return null;};}function removeEntity(_0x2bf528,_0x714f51){return function(_0xf666c4){if(_0xf666c4){return _0xf666c4[_0x7073('0x24')]()[_0x7073('0x23')](function(){_0x2bf528[_0x7073('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1988bf,_0x164fe2){return function(_0x54bf99){if(!_0x54bf99){_0x1988bf['sendStatus'](0x194);}return _0x54bf99;};}function handleError(_0x157612,_0x3a5ddb){_0x3a5ddb=_0x3a5ddb||0x1f4;return function(_0x127016){logger[_0x7073('0x25')](_0x127016[_0x7073('0x26')]);if(_0x127016[_0x7073('0x27')]){delete _0x127016[_0x7073('0x27')];}_0x157612[_0x7073('0x18')](_0x3a5ddb)[_0x7073('0x28')](_0x127016);};}exports[_0x7073('0x29')]=function(_0x1d7cc2,_0x2ae488){var _0x341863={},_0x5ec416={},_0x2621b9={'count':0x0,'rows':[]};var _0x1c040f=_[_0x7073('0x2a')](db[_0x7073('0x2b')][_0x7073('0x2c')],function(_0x3853bd){return{'name':_0x3853bd['fieldName'],'type':_0x3853bd[_0x7073('0x2d')][_0x7073('0x2e')]};});_0x5ec416['model']=_[_0x7073('0x2a')](_0x1c040f,_0x7073('0x27'));_0x5ec416[_0x7073('0x2f')]=_[_0x7073('0x30')](_0x1d7cc2['query']);_0x5ec416[_0x7073('0x31')]=_[_0x7073('0x32')](_0x5ec416[_0x7073('0x33')],_0x5ec416[_0x7073('0x2f')]);_0x341863[_0x7073('0x34')]=_[_0x7073('0x32')](_0x5ec416[_0x7073('0x33')],qs[_0x7073('0x35')](_0x1d7cc2[_0x7073('0x2f')][_0x7073('0x35')]));_0x341863[_0x7073('0x34')]=_0x341863[_0x7073('0x34')]['length']?_0x341863['attributes']:_0x5ec416['model'];if(!_0x1d7cc2[_0x7073('0x2f')][_0x7073('0x36')](_0x7073('0x37'))){_0x341863[_0x7073('0x1d')]=qs[_0x7073('0x1d')](_0x1d7cc2[_0x7073('0x2f')][_0x7073('0x1d')]);_0x341863[_0x7073('0x1b')]=qs['offset'](_0x1d7cc2[_0x7073('0x2f')][_0x7073('0x1b')]);}_0x341863['order']=qs[_0x7073('0x38')](_0x1d7cc2[_0x7073('0x2f')][_0x7073('0x38')]);_0x341863[_0x7073('0x39')]=qs[_0x7073('0x31')](_[_0x7073('0x3a')](_0x1d7cc2[_0x7073('0x2f')],_0x5ec416[_0x7073('0x31')]),_0x1c040f);if(_0x1d7cc2[_0x7073('0x2f')][_0x7073('0x3b')]){_0x341863[_0x7073('0x39')]=_[_0x7073('0x3c')](_0x341863[_0x7073('0x39')],{'$or':_['map'](_0x1c040f,function(_0xf1e81f){if(_0xf1e81f[_0x7073('0x2d')]!=='VIRTUAL'){var _0xc0ae4={};_0xc0ae4[_0xf1e81f[_0x7073('0x27')]]={'$like':'%'+_0x1d7cc2['query'][_0x7073('0x3b')]+'%'};return _0xc0ae4;}})});}_0x341863=_[_0x7073('0x3c')]({},_0x341863,_0x1d7cc2[_0x7073('0x3d')]);var _0x477982={'where':_0x341863[_0x7073('0x39')]};return db[_0x7073('0x2b')][_0x7073('0x1e')](_0x477982)['then'](function(_0x345a56){_0x2621b9[_0x7073('0x1e')]=_0x345a56;if(_0x1d7cc2[_0x7073('0x2f')]['includeAll']){_0x341863[_0x7073('0x3e')]=[{'all':!![]}];}return db['Migration'][_0x7073('0x3f')](_0x341863);})['then'](function(_0x45bf67){_0x2621b9[_0x7073('0x40')]=_0x45bf67;return _0x2621b9;})[_0x7073('0x23')](respondWithFilteredResult(_0x2ae488,_0x341863))[_0x7073('0x41')](handleError(_0x2ae488,null));}; \ No newline at end of file +var _0xeb34=['fieldName','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','eml-format','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','limit','offset','count','set','json','apply','save','update','then','destroy','stack','name','send','index','Migration','rawAttributes'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0xeb34,0x1f4));var _0x4eb3=function(_0x3b5ad9,_0x223867){_0x3b5ad9=_0x3b5ad9-0x0;var _0x611ae9=_0xeb34[_0x3b5ad9];return _0x611ae9;};'use strict';var emlformat=require(_0x4eb3('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4eb3('0x1'));var moment=require('moment');var BPromise=require(_0x4eb3('0x2'));var Mustache=require(_0x4eb3('0x3'));var util=require(_0x4eb3('0x4'));var path=require('path');var sox=require(_0x4eb3('0x5'));var csv=require('to-csv');var ejs=require(_0x4eb3('0x6'));var fs=require('fs');var fs_extra=require(_0x4eb3('0x7'));var _=require(_0x4eb3('0x8'));var squel=require(_0x4eb3('0x9'));var crypto=require(_0x4eb3('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x4eb3('0xb'));var toCsv=require(_0x4eb3('0xc'));var querystring=require(_0x4eb3('0xd'));var Papa=require(_0x4eb3('0xe'));var Redis=require(_0x4eb3('0xf'));var authService=require(_0x4eb3('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x4eb3('0x11'));var hardwareService=require(_0x4eb3('0x12'));var logger=require(_0x4eb3('0x13'))(_0x4eb3('0x14'));var utils=require(_0x4eb3('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x4eb3('0x16'));var db=require(_0x4eb3('0x17'))['db'];function respondWithStatusCode(_0x4d7b2e,_0xd6bfe8){_0xd6bfe8=_0xd6bfe8||0xcc;return function(_0x705bd6){if(_0x705bd6){return _0x4d7b2e[_0x4eb3('0x18')](_0xd6bfe8);}return _0x4d7b2e['status'](_0xd6bfe8)[_0x4eb3('0x19')]();};}function respondWithResult(_0x1e0ef7,_0x423cf2){_0x423cf2=_0x423cf2||0xc8;return function(_0x6d676e){if(_0x6d676e){return _0x1e0ef7[_0x4eb3('0x1a')](_0x423cf2)['json'](_0x6d676e);}};}function respondWithFilteredResult(_0x58c61f,_0xe48387){return function(_0x27572e){if(_0x27572e){var _0x5bd701=typeof _0xe48387['offset']===_0x4eb3('0x1b')&&typeof _0xe48387[_0x4eb3('0x1c')]===_0x4eb3('0x1b');var _0x3a2c69=_0x27572e['count'];var _0x213d36=_0x5bd701?0x0:_0xe48387[_0x4eb3('0x1d')];var _0x4a5f78=_0x5bd701?_0x27572e[_0x4eb3('0x1e')]:_0xe48387[_0x4eb3('0x1d')]+_0xe48387[_0x4eb3('0x1c')];var _0x577204;if(_0x4a5f78>=_0x3a2c69){_0x4a5f78=_0x3a2c69;_0x577204=0xc8;}else{_0x577204=0xce;}_0x58c61f['status'](_0x577204);return _0x58c61f[_0x4eb3('0x1f')]('Content-Range',_0x213d36+'-'+_0x4a5f78+'/'+_0x3a2c69)[_0x4eb3('0x20')](_0x27572e);}return null;};}function patchUpdates(_0x3fad85){return function(_0xeaaf9c){try{jsonpatch[_0x4eb3('0x21')](_0xeaaf9c,_0x3fad85,!![]);}catch(_0x1b0a87){return BPromise['reject'](_0x1b0a87);}return _0xeaaf9c[_0x4eb3('0x22')]();};}function saveUpdates(_0x1137d8,_0x563183){return function(_0x5a587d){if(_0x5a587d){return _0x5a587d[_0x4eb3('0x23')](_0x1137d8)[_0x4eb3('0x24')](function(_0x27b7a6){return _0x27b7a6;});}return null;};}function removeEntity(_0x3599f3,_0xd49b2e){return function(_0x354ecc){if(_0x354ecc){return _0x354ecc[_0x4eb3('0x25')]()['then'](function(){_0x3599f3[_0x4eb3('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3327e1,_0x2fc85e){return function(_0x4870e3){if(!_0x4870e3){_0x3327e1[_0x4eb3('0x18')](0x194);}return _0x4870e3;};}function handleError(_0x5c0851,_0x58dfee){_0x58dfee=_0x58dfee||0x1f4;return function(_0x44e966){logger['error'](_0x44e966[_0x4eb3('0x26')]);if(_0x44e966[_0x4eb3('0x27')]){delete _0x44e966[_0x4eb3('0x27')];}_0x5c0851[_0x4eb3('0x1a')](_0x58dfee)[_0x4eb3('0x28')](_0x44e966);};}exports[_0x4eb3('0x29')]=function(_0x48ec53,_0xb89f8b){var _0xd4dd64={},_0x42aa0c={},_0x4cf769={'count':0x0,'rows':[]};var _0xf25fc4=_['map'](db[_0x4eb3('0x2a')][_0x4eb3('0x2b')],function(_0x38e6b3){return{'name':_0x38e6b3[_0x4eb3('0x2c')],'type':_0x38e6b3[_0x4eb3('0x2d')][_0x4eb3('0x2e')]};});_0x42aa0c[_0x4eb3('0x2f')]=_[_0x4eb3('0x30')](_0xf25fc4,'name');_0x42aa0c['query']=_['keys'](_0x48ec53[_0x4eb3('0x31')]);_0x42aa0c[_0x4eb3('0x32')]=_[_0x4eb3('0x33')](_0x42aa0c[_0x4eb3('0x2f')],_0x42aa0c[_0x4eb3('0x31')]);_0xd4dd64[_0x4eb3('0x34')]=_[_0x4eb3('0x33')](_0x42aa0c['model'],qs[_0x4eb3('0x35')](_0x48ec53['query'][_0x4eb3('0x35')]));_0xd4dd64['attributes']=_0xd4dd64[_0x4eb3('0x34')]['length']?_0xd4dd64[_0x4eb3('0x34')]:_0x42aa0c[_0x4eb3('0x2f')];if(!_0x48ec53['query'][_0x4eb3('0x36')](_0x4eb3('0x37'))){_0xd4dd64['limit']=qs[_0x4eb3('0x1c')](_0x48ec53[_0x4eb3('0x31')][_0x4eb3('0x1c')]);_0xd4dd64[_0x4eb3('0x1d')]=qs[_0x4eb3('0x1d')](_0x48ec53[_0x4eb3('0x31')][_0x4eb3('0x1d')]);}_0xd4dd64['order']=qs[_0x4eb3('0x38')](_0x48ec53[_0x4eb3('0x31')]['sort']);_0xd4dd64['where']=qs[_0x4eb3('0x32')](_[_0x4eb3('0x39')](_0x48ec53[_0x4eb3('0x31')],_0x42aa0c['filters']),_0xf25fc4);if(_0x48ec53[_0x4eb3('0x31')][_0x4eb3('0x3a')]){_0xd4dd64[_0x4eb3('0x3b')]=_[_0x4eb3('0x3c')](_0xd4dd64[_0x4eb3('0x3b')],{'$or':_['map'](_0xf25fc4,function(_0x227c38){if(_0x227c38[_0x4eb3('0x2d')]!==_0x4eb3('0x3d')){var _0x414331={};_0x414331[_0x227c38[_0x4eb3('0x27')]]={'$like':'%'+_0x48ec53['query'][_0x4eb3('0x3a')]+'%'};return _0x414331;}})});}_0xd4dd64=_['merge']({},_0xd4dd64,_0x48ec53[_0x4eb3('0x3e')]);var _0x1e5826={'where':_0xd4dd64[_0x4eb3('0x3b')]};return db[_0x4eb3('0x2a')][_0x4eb3('0x1e')](_0x1e5826)['then'](function(_0x51eb24){_0x4cf769[_0x4eb3('0x1e')]=_0x51eb24;if(_0x48ec53[_0x4eb3('0x31')][_0x4eb3('0x3f')]){_0xd4dd64[_0x4eb3('0x40')]=[{'all':!![]}];}return db[_0x4eb3('0x2a')][_0x4eb3('0x41')](_0xd4dd64);})[_0x4eb3('0x24')](function(_0x178c05){_0x4cf769[_0x4eb3('0x42')]=_0x178c05;return _0x4cf769;})['then'](respondWithFilteredResult(_0xb89f8b,_0xd4dd64))[_0x4eb3('0x43')](handleError(_0xb89f8b,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 16a334d..e176ef1 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 _0xcace=['define','Migration','migrations','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./migration.attributes'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0xcace,0xed));var _0xecac=function(_0x312634,_0x165c8e){_0x312634=_0x312634-0x0;var _0x34a887=_0xcace[_0x312634];return _0x34a887;};'use strict';var _=require(_0xecac('0x0'));var util=require(_0xecac('0x1'));var logger=require('../../config/logger')(_0xecac('0x2'));var moment=require(_0xecac('0x3'));var BPromise=require(_0xecac('0x4'));var rp=require(_0xecac('0x5'));var fs=require('fs');var path=require(_0xecac('0x6'));var rimraf=require(_0xecac('0x7'));var config=require(_0xecac('0x8'));var attributes=require(_0xecac('0x9'));module['exports']=function(_0xcacad8,_0x6ed9b8){return _0xcacad8[_0xecac('0xa')](_0xecac('0xb'),attributes,{'tableName':_0xecac('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x595b=['Migration','migrations','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define'];(function(_0x4c73ec,_0x131df7){var _0x36f7c5=function(_0x2f2a20){while(--_0x2f2a20){_0x4c73ec['push'](_0x4c73ec['shift']());}};_0x36f7c5(++_0x131df7);}(_0x595b,0x1b2));var _0xb595=function(_0x130b2b,_0x3fba35){_0x130b2b=_0x130b2b-0x0;var _0x591798=_0x595b[_0x130b2b];return _0x591798;};'use strict';var _=require(_0xb595('0x0'));var util=require(_0xb595('0x1'));var logger=require(_0xb595('0x2'))('api');var moment=require(_0xb595('0x3'));var BPromise=require(_0xb595('0x4'));var rp=require(_0xb595('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb595('0x6'));var config=require(_0xb595('0x7'));var attributes=require('./migration.attributes');module[_0xb595('0x8')]=function(_0x1c1317,_0x1dd0e4){return _0x1c1317[_0xb595('0x9')](_0xb595('0xa'),attributes,{'tableName':_0xb595('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js index c2c28b8..644ea49 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 _0xac4a=['Migration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','then','info','debug','Migration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xac4a,0x13f));var _0xaac4=function(_0x3cf16a,_0x1a3f6c){_0x3cf16a=_0x3cf16a-0x0;var _0x5bb000=_0xac4a[_0x3cf16a];return _0x5bb000;};'use strict';var _=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var moment=require(_0xaac4('0x2'));var BPromise=require(_0xaac4('0x3'));var rs=require(_0xaac4('0x4'));var fs=require('fs');var Redis=require(_0xaac4('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaac4('0x6'))(_0xaac4('0x7'));var config=require(_0xaac4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xaac4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cdfc5,_0x5870e8,_0x1e4283){return new BPromise(function(_0x27354c,_0x567295){return client['request'](_0x1cdfc5,_0x1e4283)[_0xaac4('0xa')](function(_0x50d114){logger[_0xaac4('0xb')]('Migration,\x20%s,\x20%s',_0x5870e8,'request\x20sent');logger[_0xaac4('0xc')](_0xaac4('0xd'),_0x5870e8,_0xaac4('0xe'),JSON[_0xaac4('0xf')](_0x50d114));if(_0x50d114[_0xaac4('0x10')]){if(_0x50d114['error']['code']===0x1f4){logger[_0xaac4('0x10')](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')]['message']);return _0x567295(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}logger['error'](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);return _0x27354c(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}else{logger[_0xaac4('0xb')](_0xaac4('0x11'),_0x5870e8,_0xaac4('0xe'));_0x27354c(_0x50d114[_0xaac4('0x13')][_0xaac4('0x12')]);}})[_0xaac4('0x14')](function(_0x1766c2){logger[_0xaac4('0x10')]('Migration,\x20%s,\x20%s',_0x5870e8,_0x1766c2);_0x567295(_0x1766c2);});});} \ No newline at end of file +var _0x18a9=['then','info','Migration,\x20%s,\x20%s','request\x20sent','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x1c70e3,_0xd5348c){var _0x22ddb5=function(_0x2f303b){while(--_0x2f303b){_0x1c70e3['push'](_0x1c70e3['shift']());}};_0x22ddb5(++_0xd5348c);}(_0x18a9,0x15b));var _0x918a=function(_0x1afc73,_0x1e3ecb){_0x1afc73=_0x1afc73-0x0;var _0x23f0d2=_0x18a9[_0x1afc73];return _0x23f0d2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x918a('0x0'));var BPromise=require(_0x918a('0x1'));var rs=require(_0x918a('0x2'));var fs=require('fs');var Redis=require(_0x918a('0x3'));var db=require(_0x918a('0x4'))['db'];var utils=require(_0x918a('0x5'));var logger=require(_0x918a('0x6'))(_0x918a('0x7'));var config=require(_0x918a('0x8'));var jayson=require(_0x918a('0x9'));var client=jayson[_0x918a('0xa')][_0x918a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x492c39,_0xdb8dd8,_0x266256){return new BPromise(function(_0x51caca,_0x40518f){return client[_0x918a('0xc')](_0x492c39,_0x266256)[_0x918a('0xd')](function(_0x224a87){logger[_0x918a('0xe')](_0x918a('0xf'),_0xdb8dd8,_0x918a('0x10'));logger['debug'](_0x918a('0x11'),_0xdb8dd8,_0x918a('0x10'),JSON[_0x918a('0x12')](_0x224a87));if(_0x224a87[_0x918a('0x13')]){if(_0x224a87['error'][_0x918a('0x14')]===0x1f4){logger[_0x918a('0x13')]('Migration,\x20%s,\x20%s',_0xdb8dd8,_0x224a87[_0x918a('0x13')][_0x918a('0x15')]);return _0x40518f(_0x224a87[_0x918a('0x13')][_0x918a('0x15')]);}logger['error'](_0x918a('0xf'),_0xdb8dd8,_0x224a87['error'][_0x918a('0x15')]);return _0x51caca(_0x224a87['error']['message']);}else{logger[_0x918a('0xe')](_0x918a('0xf'),_0xdb8dd8,'request\x20sent');_0x51caca(_0x224a87[_0x918a('0x16')]['message']);}})[_0x918a('0x17')](function(_0x17f988){logger[_0x918a('0x13')]('Migration,\x20%s,\x20%s',_0xdb8dd8,_0x17f988);_0x40518f(_0x17f988);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index e9e72b3..7e35db0 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 _0x225b=['express','fs-extra','../../components/interaction/service','./network.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x5416db,_0x55683a){var _0x243e35=function(_0x1eb623){while(--_0x1eb623){_0x5416db['push'](_0x5416db['shift']());}};_0x243e35(++_0x55683a);}(_0x225b,0xb1));var _0xb225=function(_0x998259,_0x455dc2){_0x998259=_0x998259-0x0;var _0x1913d7=_0x225b[_0x998259];return _0x1913d7;};'use strict';var multer=require(_0xb225('0x0'));var util=require(_0xb225('0x1'));var path=require('path');var timeout=require(_0xb225('0x2'));var express=require(_0xb225('0x3'));var router=express['Router']();var fs_extra=require(_0xb225('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb225('0x5'));var config=require('../../config/environment');var controller=require(_0xb225('0x6'));router[_0xb225('0x7')]('/',auth[_0xb225('0x8')](),controller[_0xb225('0x9')]);router[_0xb225('0x7')](_0xb225('0xa'),auth[_0xb225('0x8')](),controller['show']);router[_0xb225('0xb')]('/',auth[_0xb225('0x8')](),controller[_0xb225('0xc')]);router[_0xb225('0xd')]('/:id',auth[_0xb225('0x8')](),controller[_0xb225('0xe')]);router[_0xb225('0xf')]('/:id',auth[_0xb225('0x8')](),controller[_0xb225('0x10')]);module[_0xb225('0x11')]=router; \ No newline at end of file +var _0xaa37=['put','/:id','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get','index','isAuthenticated','show','post','create'];(function(_0x3e3255,_0x485196){var _0x57368e=function(_0x182722){while(--_0x182722){_0x3e3255['push'](_0x3e3255['shift']());}};_0x57368e(++_0x485196);}(_0xaa37,0x1d3));var _0x7aa3=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0xaa37[_0x565c49];return _0x20ca34;};'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 fs_extra=require(_0x7aa3('0x5'));var auth=require(_0x7aa3('0x6'));var interaction=require(_0x7aa3('0x7'));var config=require(_0x7aa3('0x8'));var controller=require(_0x7aa3('0x9'));router[_0x7aa3('0xa')]('/',auth['isAuthenticated'](),controller[_0x7aa3('0xb')]);router[_0x7aa3('0xa')]('/:id',auth[_0x7aa3('0xc')](),controller[_0x7aa3('0xd')]);router[_0x7aa3('0xe')]('/',auth['isAuthenticated'](),controller[_0x7aa3('0xf')]);router[_0x7aa3('0x10')](_0x7aa3('0x11'),auth[_0x7aa3('0xc')](),controller[_0x7aa3('0x12')]);router[_0x7aa3('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x7aa3('0x14')]);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 ebdbc98..b1238bb 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 _0x2e02=['stun','turn','STRING','sequelize','exports','ENUM','localnet'];(function(_0x52243a,_0x546ec8){var _0x165122=function(_0x75c078){while(--_0x75c078){_0x52243a['push'](_0x52243a['shift']());}};_0x165122(++_0x546ec8);}(_0x2e02,0x16f));var _0x22e0=function(_0x462226,_0x533892){_0x462226=_0x462226-0x0;var _0x4f2dfd=_0x2e02[_0x462226];return _0x4f2dfd;};'use strict';var Sequelize=require(_0x22e0('0x0'));module[_0x22e0('0x1')]={'type':{'type':Sequelize[_0x22e0('0x2')](_0x22e0('0x3'),'externip',_0x22e0('0x4'),_0x22e0('0x5'))},'value':{'type':Sequelize[_0x22e0('0x6')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4088=['sequelize','exports','localnet','externip','turn','STRING'];(function(_0x17de40,_0x564903){var _0x233e21=function(_0x370c9f){while(--_0x370c9f){_0x17de40['push'](_0x17de40['shift']());}};_0x233e21(++_0x564903);}(_0x4088,0x15c));var _0x8408=function(_0x59fbe4,_0x3904b4){_0x59fbe4=_0x59fbe4-0x0;var _0x31a4aa=_0x4088[_0x59fbe4];return _0x31a4aa;};'use strict';var Sequelize=require(_0x8408('0x0'));module[_0x8408('0x1')]={'type':{'type':Sequelize['ENUM'](_0x8408('0x2'),_0x8408('0x3'),'stun',_0x8408('0x4'))},'value':{'type':Sequelize[_0x8408('0x5')]},'username':{'type':Sequelize[_0x8408('0x5')]},'password':{'type':Sequelize[_0x8408('0x5')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index d80dbc3..789589d 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 _0x8452=['result','status','json','offset','undefined','limit','count','update','end','sendStatus','name','Network','fieldName','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','type','filter','merge','options','includeAll','include','findAll','rows','show','params','catch','create','body','STUN','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','toUpperCase','join','root','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','Reload','res_stun_monitor.so','readFileSync','server/files/templates/network.ejs','/etc/asterisk/sip_xcally_%s.conf','chan_sip.so','find','/etc/asterisk/stun_xcally.conf','TURN','format','toLowerCase','destroy','util','path','ejs','../../config/logger','api','../../mysqldb','jayson/promise','http','then','info','Network,\x20%s,\x20%s','request\x20sent','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3f0b30,_0x159bc8){var _0x2748a5=function(_0x3b42cc){while(--_0x3b42cc){_0x3f0b30['push'](_0x3f0b30['shift']());}};_0x2748a5(++_0x159bc8);}(_0x8452,0x175));var _0x2845=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x8452[_0xb0f7c3];return _0x28ea68;};'use strict';var util=require(_0x2845('0x0'));var path=require(_0x2845('0x1'));var ejs=require(_0x2845('0x2'));var fs=require('fs');var _=require('lodash');var qs=require('../../components/parsers/qs');var logger=require(_0x2845('0x3'))(_0x2845('0x4'));var config=require('../../config/environment');var db=require(_0x2845('0x5'))['db'];var jayson=require(_0x2845('0x6'));var client=jayson['client'][_0x2845('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2578a8,_0x3bc80c,_0x194538,_0x520847){return new Promise(function(_0x28cd97,_0xa6ea94){var _0x1dcd16=_0x520847||client;return _0x1dcd16['request'](_0x2578a8,_0x194538)[_0x2845('0x8')](function(_0x2461d4){logger[_0x2845('0x9')](_0x2845('0xa'),_0x3bc80c,_0x2845('0xb'));logger['debug'](_0x2845('0xc'),_0x3bc80c,_0x2845('0xb'),JSON[_0x2845('0xd')](_0x2461d4));if(_0x2461d4[_0x2845('0xe')]){if(_0x2461d4['error'][_0x2845('0xf')]===0x1f4){logger[_0x2845('0xe')](_0x2845('0xa'),_0x3bc80c,_0x2461d4[_0x2845('0xe')][_0x2845('0x10')]);return _0xa6ea94(_0x2461d4[_0x2845('0xe')][_0x2845('0x10')]);}logger[_0x2845('0xe')](_0x2845('0xa'),_0x3bc80c,_0x2461d4[_0x2845('0xe')][_0x2845('0x10')]);return _0x28cd97(_0x2461d4[_0x2845('0xe')][_0x2845('0x10')]);}else{logger[_0x2845('0x9')]('Network,\x20%s,\x20%s',_0x3bc80c,_0x2845('0xb'));_0x28cd97(_0x2461d4[_0x2845('0x11')][_0x2845('0x10')]);}})['catch'](function(_0x2f4813){logger[_0x2845('0xe')](_0x2845('0xa'),_0x3bc80c,_0x2f4813);_0xa6ea94(_0x2f4813);});});}function respondWithResult(_0x52cd27,_0x54b534){_0x54b534=_0x54b534||0xc8;return function(_0x4dcef7){if(_0x4dcef7){return _0x52cd27[_0x2845('0x12')](_0x54b534)[_0x2845('0x13')](_0x4dcef7);}};}function respondWithFilteredResult(_0x33c78e,_0x47a940){return function(_0x5a9f73){if(_0x5a9f73){var _0x56f226=typeof _0x47a940[_0x2845('0x14')]===_0x2845('0x15')&&typeof _0x47a940[_0x2845('0x16')]===_0x2845('0x15');var _0x52cc86=_0x5a9f73[_0x2845('0x17')];var _0x41b196=_0x56f226?0x0:_0x47a940[_0x2845('0x14')];var _0x47dee5=_0x56f226?_0x5a9f73[_0x2845('0x17')]:_0x47a940[_0x2845('0x14')]+_0x47a940[_0x2845('0x16')];var _0x49fa57;if(_0x47dee5>=_0x52cc86){_0x47dee5=_0x52cc86;_0x49fa57=0xc8;}else{_0x49fa57=0xce;}_0x33c78e[_0x2845('0x12')](_0x49fa57);return _0x33c78e['set']('Content-Range',_0x41b196+'-'+_0x47dee5+'/'+_0x52cc86)[_0x2845('0x13')](_0x5a9f73);}return null;};}function saveUpdates(_0x52ca6e){return function(_0x3eb92b){if(_0x3eb92b){return _0x3eb92b[_0x2845('0x18')](_0x52ca6e)[_0x2845('0x8')](function(_0xbc8c9f){return _0xbc8c9f;});}return null;};}function removeEntity(_0x3818c2){return function(_0x543bf6){if(_0x543bf6){return _0x543bf6['destroy']()[_0x2845('0x8')](function(){_0x3818c2[_0x2845('0x12')](0xcc)[_0x2845('0x19')]();});}};}function handleEntityNotFound(_0x10357a){return function(_0x29f2dd){if(!_0x29f2dd){_0x10357a[_0x2845('0x1a')](0x194);}return _0x29f2dd;};}function handleError(_0x3affde,_0x2dbdf3){_0x2dbdf3=_0x2dbdf3||0x1f4;return function(_0x176c12){logger[_0x2845('0xe')](_0x176c12['stack']);if(_0x176c12['name']){delete _0x176c12[_0x2845('0x1b')];}_0x3affde[_0x2845('0x12')](_0x2dbdf3)['send'](_0x176c12);};}exports['index']=function(_0x1cd2bd,_0x55a3d6){var _0x37aa40={},_0x58c7be={},_0xbe864b={'count':0x0,'rows':[]};var _0x5307e5=_['map'](db[_0x2845('0x1c')]['rawAttributes'],function(_0x34b6d2){return{'name':_0x34b6d2[_0x2845('0x1d')],'type':_0x34b6d2['type']['key']};});_0x58c7be[_0x2845('0x1e')]=_[_0x2845('0x1f')](_0x5307e5,_0x2845('0x1b'));_0x58c7be[_0x2845('0x20')]=_[_0x2845('0x21')](_0x1cd2bd[_0x2845('0x20')]);_0x58c7be[_0x2845('0x22')]=_[_0x2845('0x23')](_0x58c7be[_0x2845('0x1e')],_0x58c7be['query']);_0x37aa40[_0x2845('0x24')]=_['intersection'](_0x58c7be['model'],qs[_0x2845('0x25')](_0x1cd2bd[_0x2845('0x20')]['fields']));_0x37aa40[_0x2845('0x24')]=_0x37aa40['attributes'][_0x2845('0x26')]?_0x37aa40['attributes']:_0x58c7be['model'];if(!_0x1cd2bd[_0x2845('0x20')][_0x2845('0x27')](_0x2845('0x28'))){_0x37aa40[_0x2845('0x16')]=qs['limit'](_0x1cd2bd[_0x2845('0x20')]['limit']);_0x37aa40[_0x2845('0x14')]=qs[_0x2845('0x14')](_0x1cd2bd['query'][_0x2845('0x14')]);}_0x37aa40['order']=qs[_0x2845('0x29')](_0x1cd2bd['query'][_0x2845('0x29')]);_0x37aa40[_0x2845('0x2a')]=qs[_0x2845('0x22')](_['pick'](_0x1cd2bd[_0x2845('0x20')],_0x58c7be[_0x2845('0x22')]),_0x5307e5);if(_0x1cd2bd[_0x2845('0x20')]['filter']){_0x37aa40['where']=_['merge'](_0x37aa40[_0x2845('0x2a')],{'$or':_[_0x2845('0x1f')](_0x5307e5,function(_0x40b5c6){if(_0x40b5c6[_0x2845('0x2b')]!=='VIRTUAL'){var _0x145be8={};_0x145be8[_0x40b5c6[_0x2845('0x1b')]]={'$like':'%'+_0x1cd2bd[_0x2845('0x20')][_0x2845('0x2c')]+'%'};return _0x145be8;}})});}_0x37aa40=_[_0x2845('0x2d')]({},_0x37aa40,_0x1cd2bd[_0x2845('0x2e')]);var _0x15caf1={'where':_0x37aa40[_0x2845('0x2a')]};return db['Network'][_0x2845('0x17')](_0x15caf1)['then'](function(_0x1415bd){_0xbe864b[_0x2845('0x17')]=_0x1415bd;if(_0x1cd2bd['query'][_0x2845('0x2f')]){_0x37aa40[_0x2845('0x30')]=[{'all':!![]}];}return db[_0x2845('0x1c')][_0x2845('0x31')](_0x37aa40);})['then'](function(_0x19d6ae){_0xbe864b[_0x2845('0x32')]=_0x19d6ae;return _0xbe864b;})[_0x2845('0x8')](respondWithFilteredResult(_0x55a3d6,_0x37aa40))['catch'](handleError(_0x55a3d6,null));};exports[_0x2845('0x33')]=function(_0x41cabf,_0x140fe5){var _0x1e0897={'raw':!![],'where':{'id':_0x41cabf[_0x2845('0x34')]['id']}},_0x4c1e57={};_0x4c1e57['model']=_[_0x2845('0x21')](db['Network']['rawAttributes']);_0x4c1e57[_0x2845('0x20')]=_[_0x2845('0x21')](_0x41cabf[_0x2845('0x20')]);_0x4c1e57['filters']=_[_0x2845('0x23')](_0x4c1e57[_0x2845('0x1e')],_0x4c1e57['query']);_0x1e0897[_0x2845('0x24')]=_[_0x2845('0x23')](_0x4c1e57[_0x2845('0x1e')],qs[_0x2845('0x25')](_0x41cabf[_0x2845('0x20')][_0x2845('0x25')]));_0x1e0897[_0x2845('0x24')]=_0x1e0897[_0x2845('0x24')]['length']?_0x1e0897[_0x2845('0x24')]:_0x4c1e57['model'];if(_0x41cabf[_0x2845('0x20')][_0x2845('0x2f')]){_0x1e0897['include']=[{'all':!![]}];}_0x1e0897=_[_0x2845('0x2d')]({},_0x1e0897,_0x41cabf[_0x2845('0x2e')]);return db[_0x2845('0x1c')]['find'](_0x1e0897)['then'](handleEntityNotFound(_0x140fe5,null))['then'](respondWithResult(_0x140fe5,null))[_0x2845('0x35')](handleError(_0x140fe5,null));};exports[_0x2845('0x36')]=function(_0x46afec,_0x32e007){var _0x53b575;return db[_0x2845('0x1c')][_0x2845('0x36')](_0x46afec[_0x2845('0x37')],{'raw':!![]})['then'](function(_0x35fc2e){_0x53b575=_0x35fc2e;return db[_0x2845('0x1c')]['findAll']({'where':{'type':_0x46afec[_0x2845('0x37')][_0x2845('0x2b')]},'raw':!![]});})['then'](function(_0x22d1c5){if(_0x53b575[_0x2845('0x2b')]['toUpperCase']()==_0x2845('0x38')){var _0x1d1c2a=fs['readFileSync'](path['join'](config['root'],_0x2845('0x39')),_0x2845('0x3a'));var _0x3e6df5=ejs[_0x2845('0x3b')](_0x1d1c2a,{'networks':_0x22d1c5||[]});fs[_0x2845('0x3c')]('/etc/asterisk/stun_xcally.conf',_0x3e6df5);return respondWithRpcPromise('Reload',_0x2845('0x36'),{'module':'res_stun_monitor.so'});}else if(_0x53b575['type'][_0x2845('0x3d')]()=='TURN'){var _0x19f1d0=fs['readFileSync'](path[_0x2845('0x3e')](config[_0x2845('0x3f')],_0x2845('0x40')),_0x2845('0x3a'));var _0xfb8b94=ejs[_0x2845('0x3b')](_0x19f1d0,{'networks':_0x22d1c5||[]});fs[_0x2845('0x3c')](_0x2845('0x41'),_0xfb8b94);return respondWithRpcPromise(_0x2845('0x42'),_0x2845('0x36'),{'module':_0x2845('0x43')});}else{var _0x423182=fs[_0x2845('0x44')](path[_0x2845('0x3e')](config[_0x2845('0x3f')],_0x2845('0x45')),_0x2845('0x3a'));var _0x10d9a9=ejs[_0x2845('0x3b')](_0x423182,{'networks':_0x22d1c5||[]});fs[_0x2845('0x3c')](util['format'](_0x2845('0x46'),_0x46afec[_0x2845('0x37')][_0x2845('0x2b')]['toLowerCase']()),_0x10d9a9);return respondWithRpcPromise(_0x2845('0x42'),'create',{'module':_0x2845('0x47')});}})[_0x2845('0x8')](function(){return _0x53b575;})[_0x2845('0x8')](respondWithResult(_0x32e007,0xc9))[_0x2845('0x35')](handleError(_0x32e007,null));};exports[_0x2845('0x18')]=function(_0x584bfa,_0x5564d3){var _0x175328;return db[_0x2845('0x1c')][_0x2845('0x48')]({'where':{'id':_0x584bfa[_0x2845('0x34')]['id']}})['then'](handleEntityNotFound(_0x5564d3,null))[_0x2845('0x8')](saveUpdates(_0x584bfa[_0x2845('0x37')],null))[_0x2845('0x8')](function(_0x3b1b1c){if(_0x3b1b1c){_0x175328=_0x3b1b1c;return db['Network'][_0x2845('0x31')]({'where':{'type':_0x175328[_0x2845('0x2b')]},'raw':!![]});}return null;})[_0x2845('0x8')](function(_0x583852){if(_0x175328[_0x2845('0x2b')][_0x2845('0x3d')]()==_0x2845('0x38')){var _0x13042c=fs[_0x2845('0x44')](path[_0x2845('0x3e')](config[_0x2845('0x3f')],_0x2845('0x39')),_0x2845('0x3a'));var _0xc332f0=ejs[_0x2845('0x3b')](_0x13042c,{'networks':_0x583852||[]});fs[_0x2845('0x3c')](_0x2845('0x49'),_0xc332f0);return respondWithRpcPromise(_0x2845('0x42'),_0x2845('0x18'),{'module':_0x2845('0x43')});}else if(_0x175328[_0x2845('0x2b')][_0x2845('0x3d')]()==_0x2845('0x4a')){var _0xaf92eb=fs[_0x2845('0x44')](path[_0x2845('0x3e')](config['root'],_0x2845('0x40')),'utf8');var _0x4409ec=ejs[_0x2845('0x3b')](_0xaf92eb,{'networks':_0x583852||[]});fs['writeFileSync'](_0x2845('0x41'),_0x4409ec);return respondWithRpcPromise('Reload',_0x2845('0x18'),{'module':'res_stun_monitor.so'});}else{var _0x2eaa4d=fs[_0x2845('0x44')](path[_0x2845('0x3e')](config['root'],_0x2845('0x45')),_0x2845('0x3a'));var _0x1d02d5=ejs['render'](_0x2eaa4d,{'networks':_0x583852||[]});fs['writeFileSync'](util[_0x2845('0x4b')]('/etc/asterisk/sip_xcally_%s.conf',_0x584bfa[_0x2845('0x37')][_0x2845('0x2b')][_0x2845('0x4c')]()),_0x1d02d5);return respondWithRpcPromise('Reload',_0x2845('0x18'),{'module':_0x2845('0x47')});}})['then'](function(_0x4a4831){if(_0x4a4831){return _0x175328;}return null;})[_0x2845('0x8')](respondWithResult(_0x5564d3,null))['catch'](handleError(_0x5564d3,null));};exports[_0x2845('0x4d')]=function(_0x13aec4,_0x3b42b3){var _0x3b9a76;return db[_0x2845('0x1c')][_0x2845('0x48')]({'where':{'id':_0x13aec4[_0x2845('0x34')]['id']}})['then'](function(_0x42fd6c){_0x3b9a76=_0x42fd6c;return _0x42fd6c;})[_0x2845('0x8')](handleEntityNotFound(_0x3b42b3,null))['then'](removeEntity(_0x3b42b3,null))[_0x2845('0x8')](function(){if(_0x3b9a76){return db[_0x2845('0x1c')]['findAll']({'where':{'type':_0x3b9a76[_0x2845('0x2b')]},'raw':!![]});}})[_0x2845('0x8')](function(_0x51e89e){if(_0x3b9a76['type']['toUpperCase']()==_0x2845('0x38')){var _0xb93607=fs['readFileSync'](path['join'](config['root'],_0x2845('0x39')),_0x2845('0x3a'));var _0x41f218=ejs[_0x2845('0x3b')](_0xb93607,{'networks':_0x51e89e||[]});fs[_0x2845('0x3c')](_0x2845('0x49'),_0x41f218);return respondWithRpcPromise('Reload',_0x2845('0x4d'),{'module':_0x2845('0x43')});}else if(_0x3b9a76[_0x2845('0x2b')]['toUpperCase']()==_0x2845('0x4a')){var _0x5d97ea=fs['readFileSync'](path[_0x2845('0x3e')](config[_0x2845('0x3f')],_0x2845('0x40')),_0x2845('0x3a'));var _0x1865e6=ejs[_0x2845('0x3b')](_0x5d97ea,{'networks':_0x51e89e||[]});fs['writeFileSync']('/etc/asterisk/turn_xcally.conf',_0x1865e6);return respondWithRpcPromise('Reload','destroy',{'module':_0x2845('0x43')});}else{var _0x5ca950=fs['readFileSync'](path['join'](config[_0x2845('0x3f')],_0x2845('0x45')),_0x2845('0x3a'));var _0x3807fc=ejs[_0x2845('0x3b')](_0x5ca950,{'networks':_0x51e89e||[]});fs[_0x2845('0x3c')](util[_0x2845('0x4b')](_0x2845('0x46'),_0x3b9a76[_0x2845('0x2b')]['toLowerCase']()),_0x3807fc);return respondWithRpcPromise(_0x2845('0x42'),_0x2845('0x4d'),{'module':_0x2845('0x47')});}})[_0x2845('0x35')](handleError(_0x3b42b3,null));}; \ No newline at end of file +var _0xeefa=['status','offset','undefined','limit','count','set','Content-Range','update','destroy','end','sendStatus','stack','name','send','index','map','Network','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','merge','VIRTUAL','options','then','includeAll','include','findAll','show','params','find','create','body','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','render','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','server/files/templates/turn_multiple.ejs','writeFileSync','/etc/asterisk/turn_xcally.conf','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','toUpperCase','server/files/templates/network.ejs','chan_sip.so','STUN','util','path','ejs','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','client','http','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x2d6ffd,_0x505fac){var _0x19ca19=function(_0x3658ed){while(--_0x3658ed){_0x2d6ffd['push'](_0x2d6ffd['shift']());}};_0x19ca19(++_0x505fac);}(_0xeefa,0x96));var _0xaeef=function(_0x342a34,_0x2b2b5d){_0x342a34=_0x342a34-0x0;var _0xbd3bda=_0xeefa[_0x342a34];return _0xbd3bda;};'use strict';var util=require(_0xaeef('0x0'));var path=require(_0xaeef('0x1'));var ejs=require(_0xaeef('0x2'));var fs=require('fs');var _=require(_0xaeef('0x3'));var qs=require(_0xaeef('0x4'));var logger=require(_0xaeef('0x5'))(_0xaeef('0x6'));var config=require('../../config/environment');var db=require(_0xaeef('0x7'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xaeef('0x8')][_0xaeef('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xbf9fb4,_0x22aa4e,_0x3bc744,_0x1319f6){return new Promise(function(_0x15a7c2,_0x5050a4){var _0x263eeb=_0x1319f6||client;return _0x263eeb['request'](_0xbf9fb4,_0x3bc744)['then'](function(_0x3e5484){logger[_0xaeef('0xa')](_0xaeef('0xb'),_0x22aa4e,_0xaeef('0xc'));logger[_0xaeef('0xd')](_0xaeef('0xe'),_0x22aa4e,'request\x20sent',JSON[_0xaeef('0xf')](_0x3e5484));if(_0x3e5484[_0xaeef('0x10')]){if(_0x3e5484[_0xaeef('0x10')]['code']===0x1f4){logger['error'](_0xaeef('0xb'),_0x22aa4e,_0x3e5484[_0xaeef('0x10')][_0xaeef('0x11')]);return _0x5050a4(_0x3e5484[_0xaeef('0x10')][_0xaeef('0x11')]);}logger[_0xaeef('0x10')](_0xaeef('0xb'),_0x22aa4e,_0x3e5484[_0xaeef('0x10')][_0xaeef('0x11')]);return _0x15a7c2(_0x3e5484['error'][_0xaeef('0x11')]);}else{logger['info'](_0xaeef('0xb'),_0x22aa4e,_0xaeef('0xc'));_0x15a7c2(_0x3e5484[_0xaeef('0x12')]['message']);}})[_0xaeef('0x13')](function(_0x3faf73){logger[_0xaeef('0x10')](_0xaeef('0xb'),_0x22aa4e,_0x3faf73);_0x5050a4(_0x3faf73);});});}function respondWithResult(_0x3e296a,_0x3a0d74){_0x3a0d74=_0x3a0d74||0xc8;return function(_0xb1001b){if(_0xb1001b){return _0x3e296a[_0xaeef('0x14')](_0x3a0d74)['json'](_0xb1001b);}};}function respondWithFilteredResult(_0x2d29c5,_0x36e67f){return function(_0x2c5f46){if(_0x2c5f46){var _0x4c3ee9=typeof _0x36e67f[_0xaeef('0x15')]===_0xaeef('0x16')&&typeof _0x36e67f[_0xaeef('0x17')]===_0xaeef('0x16');var _0x92c5e1=_0x2c5f46[_0xaeef('0x18')];var _0x1d061f=_0x4c3ee9?0x0:_0x36e67f[_0xaeef('0x15')];var _0xd6c054=_0x4c3ee9?_0x2c5f46[_0xaeef('0x18')]:_0x36e67f[_0xaeef('0x15')]+_0x36e67f[_0xaeef('0x17')];var _0x5a51bc;if(_0xd6c054>=_0x92c5e1){_0xd6c054=_0x92c5e1;_0x5a51bc=0xc8;}else{_0x5a51bc=0xce;}_0x2d29c5[_0xaeef('0x14')](_0x5a51bc);return _0x2d29c5[_0xaeef('0x19')](_0xaeef('0x1a'),_0x1d061f+'-'+_0xd6c054+'/'+_0x92c5e1)['json'](_0x2c5f46);}return null;};}function saveUpdates(_0x14fcb2){return function(_0x1addc4){if(_0x1addc4){return _0x1addc4[_0xaeef('0x1b')](_0x14fcb2)['then'](function(_0x1c2615){return _0x1c2615;});}return null;};}function removeEntity(_0x4af5d5){return function(_0x96f72e){if(_0x96f72e){return _0x96f72e[_0xaeef('0x1c')]()['then'](function(){_0x4af5d5[_0xaeef('0x14')](0xcc)[_0xaeef('0x1d')]();});}};}function handleEntityNotFound(_0x57736c){return function(_0x11a7cb){if(!_0x11a7cb){_0x57736c[_0xaeef('0x1e')](0x194);}return _0x11a7cb;};}function handleError(_0x21643a,_0x1ab22c){_0x1ab22c=_0x1ab22c||0x1f4;return function(_0x5649f0){logger[_0xaeef('0x10')](_0x5649f0[_0xaeef('0x1f')]);if(_0x5649f0[_0xaeef('0x20')]){delete _0x5649f0['name'];}_0x21643a[_0xaeef('0x14')](_0x1ab22c)[_0xaeef('0x21')](_0x5649f0);};}exports[_0xaeef('0x22')]=function(_0x3a3457,_0x3cf124){var _0x33649c={},_0x5ed23f={},_0x31e0d6={'count':0x0,'rows':[]};var _0x330478=_[_0xaeef('0x23')](db[_0xaeef('0x24')][_0xaeef('0x25')],function(_0x5f4500){return{'name':_0x5f4500[_0xaeef('0x26')],'type':_0x5f4500[_0xaeef('0x27')][_0xaeef('0x28')]};});_0x5ed23f[_0xaeef('0x29')]=_['map'](_0x330478,'name');_0x5ed23f['query']=_[_0xaeef('0x2a')](_0x3a3457[_0xaeef('0x2b')]);_0x5ed23f[_0xaeef('0x2c')]=_[_0xaeef('0x2d')](_0x5ed23f[_0xaeef('0x29')],_0x5ed23f[_0xaeef('0x2b')]);_0x33649c[_0xaeef('0x2e')]=_[_0xaeef('0x2d')](_0x5ed23f['model'],qs[_0xaeef('0x2f')](_0x3a3457[_0xaeef('0x2b')][_0xaeef('0x2f')]));_0x33649c[_0xaeef('0x2e')]=_0x33649c[_0xaeef('0x2e')]['length']?_0x33649c[_0xaeef('0x2e')]:_0x5ed23f[_0xaeef('0x29')];if(!_0x3a3457[_0xaeef('0x2b')]['hasOwnProperty'](_0xaeef('0x30'))){_0x33649c[_0xaeef('0x17')]=qs[_0xaeef('0x17')](_0x3a3457[_0xaeef('0x2b')][_0xaeef('0x17')]);_0x33649c['offset']=qs[_0xaeef('0x15')](_0x3a3457[_0xaeef('0x2b')][_0xaeef('0x15')]);}_0x33649c[_0xaeef('0x31')]=qs[_0xaeef('0x32')](_0x3a3457[_0xaeef('0x2b')]['sort']);_0x33649c[_0xaeef('0x33')]=qs[_0xaeef('0x2c')](_[_0xaeef('0x34')](_0x3a3457['query'],_0x5ed23f[_0xaeef('0x2c')]),_0x330478);if(_0x3a3457[_0xaeef('0x2b')]['filter']){_0x33649c[_0xaeef('0x33')]=_[_0xaeef('0x35')](_0x33649c[_0xaeef('0x33')],{'$or':_[_0xaeef('0x23')](_0x330478,function(_0x42ba64){if(_0x42ba64[_0xaeef('0x27')]!==_0xaeef('0x36')){var _0x454fd7={};_0x454fd7[_0x42ba64[_0xaeef('0x20')]]={'$like':'%'+_0x3a3457[_0xaeef('0x2b')]['filter']+'%'};return _0x454fd7;}})});}_0x33649c=_[_0xaeef('0x35')]({},_0x33649c,_0x3a3457[_0xaeef('0x37')]);var _0x450a45={'where':_0x33649c[_0xaeef('0x33')]};return db[_0xaeef('0x24')][_0xaeef('0x18')](_0x450a45)[_0xaeef('0x38')](function(_0x2c63c7){_0x31e0d6[_0xaeef('0x18')]=_0x2c63c7;if(_0x3a3457[_0xaeef('0x2b')][_0xaeef('0x39')]){_0x33649c[_0xaeef('0x3a')]=[{'all':!![]}];}return db[_0xaeef('0x24')][_0xaeef('0x3b')](_0x33649c);})[_0xaeef('0x38')](function(_0xaf27a7){_0x31e0d6['rows']=_0xaf27a7;return _0x31e0d6;})['then'](respondWithFilteredResult(_0x3cf124,_0x33649c))['catch'](handleError(_0x3cf124,null));};exports[_0xaeef('0x3c')]=function(_0x22419d,_0x3e4c4d){var _0x4b663c={'raw':!![],'where':{'id':_0x22419d[_0xaeef('0x3d')]['id']}},_0xde8487={};_0xde8487[_0xaeef('0x29')]=_[_0xaeef('0x2a')](db[_0xaeef('0x24')][_0xaeef('0x25')]);_0xde8487[_0xaeef('0x2b')]=_[_0xaeef('0x2a')](_0x22419d[_0xaeef('0x2b')]);_0xde8487['filters']=_['intersection'](_0xde8487[_0xaeef('0x29')],_0xde8487['query']);_0x4b663c[_0xaeef('0x2e')]=_[_0xaeef('0x2d')](_0xde8487[_0xaeef('0x29')],qs[_0xaeef('0x2f')](_0x22419d[_0xaeef('0x2b')][_0xaeef('0x2f')]));_0x4b663c[_0xaeef('0x2e')]=_0x4b663c[_0xaeef('0x2e')]['length']?_0x4b663c['attributes']:_0xde8487['model'];if(_0x22419d[_0xaeef('0x2b')][_0xaeef('0x39')]){_0x4b663c[_0xaeef('0x3a')]=[{'all':!![]}];}_0x4b663c=_[_0xaeef('0x35')]({},_0x4b663c,_0x22419d[_0xaeef('0x37')]);return db[_0xaeef('0x24')][_0xaeef('0x3e')](_0x4b663c)[_0xaeef('0x38')](handleEntityNotFound(_0x3e4c4d,null))[_0xaeef('0x38')](respondWithResult(_0x3e4c4d,null))['catch'](handleError(_0x3e4c4d,null));};exports[_0xaeef('0x3f')]=function(_0x2ec929,_0x2da446){var _0x5c3b33;return db['Network'][_0xaeef('0x3f')](_0x2ec929[_0xaeef('0x40')],{'raw':!![]})[_0xaeef('0x38')](function(_0x55f23a){_0x5c3b33=_0x55f23a;return db['Network'][_0xaeef('0x3b')]({'where':{'type':_0x2ec929[_0xaeef('0x40')]['type']},'raw':!![]});})['then'](function(_0x311764){if(_0x5c3b33[_0xaeef('0x27')]['toUpperCase']()=='STUN'){var _0x3cfe0f=fs[_0xaeef('0x41')](path[_0xaeef('0x42')](config[_0xaeef('0x43')],_0xaeef('0x44')),_0xaeef('0x45'));var _0x5c8ac3=ejs[_0xaeef('0x46')](_0x3cfe0f,{'networks':_0x311764||[]});fs['writeFileSync'](_0xaeef('0x47'),_0x5c8ac3);return respondWithRpcPromise(_0xaeef('0x48'),_0xaeef('0x3f'),{'module':_0xaeef('0x49')});}else if(_0x5c3b33[_0xaeef('0x27')]['toUpperCase']()==_0xaeef('0x4a')){var _0x2265be=fs['readFileSync'](path[_0xaeef('0x42')](config['root'],_0xaeef('0x4b')),'utf8');var _0x593a50=ejs[_0xaeef('0x46')](_0x2265be,{'networks':_0x311764||[]});fs[_0xaeef('0x4c')](_0xaeef('0x4d'),_0x593a50);return respondWithRpcPromise(_0xaeef('0x48'),_0xaeef('0x3f'),{'module':_0xaeef('0x49')});}else{var _0x54b5e8=fs[_0xaeef('0x41')](path[_0xaeef('0x42')](config[_0xaeef('0x43')],'server/files/templates/network.ejs'),_0xaeef('0x45'));var _0x4d59ca=ejs[_0xaeef('0x46')](_0x54b5e8,{'networks':_0x311764||[]});fs[_0xaeef('0x4c')](util[_0xaeef('0x4e')](_0xaeef('0x4f'),_0x2ec929['body'][_0xaeef('0x27')][_0xaeef('0x50')]()),_0x4d59ca);return respondWithRpcPromise(_0xaeef('0x48'),_0xaeef('0x3f'),{'module':'chan_sip.so'});}})[_0xaeef('0x38')](function(){return _0x5c3b33;})[_0xaeef('0x38')](respondWithResult(_0x2da446,0xc9))[_0xaeef('0x13')](handleError(_0x2da446,null));};exports['update']=function(_0x90f3c0,_0x227395){var _0x401282;return db['Network'][_0xaeef('0x3e')]({'where':{'id':_0x90f3c0[_0xaeef('0x3d')]['id']}})[_0xaeef('0x38')](handleEntityNotFound(_0x227395,null))[_0xaeef('0x38')](saveUpdates(_0x90f3c0[_0xaeef('0x40')],null))['then'](function(_0xf06fdd){if(_0xf06fdd){_0x401282=_0xf06fdd;return db['Network'][_0xaeef('0x3b')]({'where':{'type':_0x401282['type']},'raw':!![]});}return null;})['then'](function(_0x5d1fcb){if(_0x401282[_0xaeef('0x27')][_0xaeef('0x51')]()=='STUN'){var _0x416ff7=fs['readFileSync'](path[_0xaeef('0x42')](config[_0xaeef('0x43')],_0xaeef('0x44')),_0xaeef('0x45'));var _0x494583=ejs[_0xaeef('0x46')](_0x416ff7,{'networks':_0x5d1fcb||[]});fs[_0xaeef('0x4c')](_0xaeef('0x47'),_0x494583);return respondWithRpcPromise(_0xaeef('0x48'),_0xaeef('0x1b'),{'module':_0xaeef('0x49')});}else if(_0x401282[_0xaeef('0x27')][_0xaeef('0x51')]()=='TURN'){var _0x8f2a19=fs['readFileSync'](path[_0xaeef('0x42')](config[_0xaeef('0x43')],_0xaeef('0x4b')),_0xaeef('0x45'));var _0x1a37d9=ejs[_0xaeef('0x46')](_0x8f2a19,{'networks':_0x5d1fcb||[]});fs['writeFileSync'](_0xaeef('0x4d'),_0x1a37d9);return respondWithRpcPromise(_0xaeef('0x48'),_0xaeef('0x1b'),{'module':_0xaeef('0x49')});}else{var _0x33cd46=fs['readFileSync'](path['join'](config[_0xaeef('0x43')],_0xaeef('0x52')),_0xaeef('0x45'));var _0x341051=ejs[_0xaeef('0x46')](_0x33cd46,{'networks':_0x5d1fcb||[]});fs[_0xaeef('0x4c')](util[_0xaeef('0x4e')](_0xaeef('0x4f'),_0x90f3c0[_0xaeef('0x40')][_0xaeef('0x27')][_0xaeef('0x50')]()),_0x341051);return respondWithRpcPromise(_0xaeef('0x48'),_0xaeef('0x1b'),{'module':_0xaeef('0x53')});}})[_0xaeef('0x38')](function(_0x15511e){if(_0x15511e){return _0x401282;}return null;})[_0xaeef('0x38')](respondWithResult(_0x227395,null))['catch'](handleError(_0x227395,null));};exports['destroy']=function(_0x1edeb6,_0xd95387){var _0x17bf5b;return db['Network'][_0xaeef('0x3e')]({'where':{'id':_0x1edeb6[_0xaeef('0x3d')]['id']}})[_0xaeef('0x38')](function(_0x1e0b48){_0x17bf5b=_0x1e0b48;return _0x1e0b48;})[_0xaeef('0x38')](handleEntityNotFound(_0xd95387,null))[_0xaeef('0x38')](removeEntity(_0xd95387,null))['then'](function(){if(_0x17bf5b){return db['Network'][_0xaeef('0x3b')]({'where':{'type':_0x17bf5b[_0xaeef('0x27')]},'raw':!![]});}})[_0xaeef('0x38')](function(_0x3f3243){if(_0x17bf5b[_0xaeef('0x27')][_0xaeef('0x51')]()==_0xaeef('0x54')){var _0x1cb1f1=fs['readFileSync'](path[_0xaeef('0x42')](config[_0xaeef('0x43')],_0xaeef('0x44')),_0xaeef('0x45'));var _0x1f2ff9=ejs[_0xaeef('0x46')](_0x1cb1f1,{'networks':_0x3f3243||[]});fs[_0xaeef('0x4c')](_0xaeef('0x47'),_0x1f2ff9);return respondWithRpcPromise(_0xaeef('0x48'),'destroy',{'module':_0xaeef('0x49')});}else if(_0x17bf5b['type'][_0xaeef('0x51')]()==_0xaeef('0x4a')){var _0x3e7110=fs['readFileSync'](path['join'](config['root'],_0xaeef('0x4b')),'utf8');var _0x119f30=ejs['render'](_0x3e7110,{'networks':_0x3f3243||[]});fs['writeFileSync']('/etc/asterisk/turn_xcally.conf',_0x119f30);return respondWithRpcPromise(_0xaeef('0x48'),_0xaeef('0x1c'),{'module':_0xaeef('0x49')});}else{var _0x54d3f4=fs[_0xaeef('0x41')](path[_0xaeef('0x42')](config[_0xaeef('0x43')],_0xaeef('0x52')),'utf8');var _0x2bad2a=ejs[_0xaeef('0x46')](_0x54d3f4,{'networks':_0x3f3243||[]});fs['writeFileSync'](util[_0xaeef('0x4e')](_0xaeef('0x4f'),_0x17bf5b[_0xaeef('0x27')][_0xaeef('0x50')]()),_0x2bad2a);return respondWithRpcPromise(_0xaeef('0x48'),_0xaeef('0x1c'),{'module':_0xaeef('0x53')});}})[_0xaeef('0x13')](handleError(_0xd95387,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 2ae1b6f..3363e87 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 _0xe812=['bluebird','request-promise','rimraf','../../config/environment','exports','define','Network','network','util','../../config/logger'];(function(_0x48c4ef,_0x319d44){var _0x435715=function(_0x925d50){while(--_0x925d50){_0x48c4ef['push'](_0x48c4ef['shift']());}};_0x435715(++_0x319d44);}(_0xe812,0x1f2));var _0x2e81=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xe812[_0x4b369d];return _0x571a98;};'use strict';var _=require('lodash');var util=require(_0x2e81('0x0'));var logger=require(_0x2e81('0x1'))('api');var moment=require('moment');var BPromise=require(_0x2e81('0x2'));var rp=require(_0x2e81('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2e81('0x4'));var config=require(_0x2e81('0x5'));var attributes=require('./network.attributes');module[_0x2e81('0x6')]=function(_0x251244,_0x4f6864){return _0x251244[_0x2e81('0x7')](_0x2e81('0x8'),attributes,{'tableName':_0x2e81('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x668b=['network','lodash','util','api','moment','request-promise','rimraf','../../config/environment','./network.attributes','define','Network'];(function(_0x1fcddb,_0x304947){var _0x5a6b79=function(_0x4e152e){while(--_0x4e152e){_0x1fcddb['push'](_0x1fcddb['shift']());}};_0x5a6b79(++_0x304947);}(_0x668b,0x140));var _0xb668=function(_0x1b4c04,_0x8d961d){_0x1b4c04=_0x1b4c04-0x0;var _0x374f5d=_0x668b[_0x1b4c04];return _0x374f5d;};'use strict';var _=require(_0xb668('0x0'));var util=require(_0xb668('0x1'));var logger=require('../../config/logger')(_0xb668('0x2'));var moment=require(_0xb668('0x3'));var BPromise=require('bluebird');var rp=require(_0xb668('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb668('0x5'));var config=require(_0xb668('0x6'));var attributes=require(_0xb668('0x7'));module['exports']=function(_0x9b99a8,_0x296fa9){return _0x9b99a8[_0xb668('0x8')](_0xb668('0x9'),attributes,{'tableName':_0xb668('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 6e6ee38..fd55e61 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x7a54,0x106));var _0x47a5=function(_0x4512f4,_0x1d17c9){_0x4512f4=_0x4512f4-0x0;var _0x218d8b=_0x7a54[_0x4512f4];return _0x218d8b;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7a54,0x106));var _0x47a5=function(_0x3f59c2,_0xed947f){_0x3f59c2=_0x3f59c2-0x0;var _0xc55bf4=_0x7a54[_0x3f59c2];return _0xc55bf4;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index e4b5bba..677dbc7 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 _0x51b6=['post','addDisposition','addAnswer','/:id/notify','notify','addApplications','/:id/users','addAgents','send','delete','destroy','removeAnswers','removeAgents','multer','util','path','../../components/interaction/service','isAuthenticated','index','get','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','getAgents','create'];(function(_0x3c67f2,_0x11915d){var _0x1c8236=function(_0x57a0a2){while(--_0x57a0a2){_0x3c67f2['push'](_0x3c67f2['shift']());}};_0x1c8236(++_0x11915d);}(_0x51b6,0x1bf));var _0x651b=function(_0x2df9b7,_0x1010f0){_0x2df9b7=_0x2df9b7-0x0;var _0x26cd82=_0x51b6[_0x2df9b7];return _0x26cd82;};'use strict';var multer=require(_0x651b('0x0'));var util=require(_0x651b('0x1'));var path=require(_0x651b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x651b('0x3'));var config=require('../../config/environment');var controller=require('./openchannelAccount.controller');router['get']('/',auth[_0x651b('0x4')](),controller[_0x651b('0x5')]);router[_0x651b('0x6')]('/describe',auth[_0x651b('0x4')](),controller[_0x651b('0x7')]);router[_0x651b('0x6')](_0x651b('0x8'),auth[_0x651b('0x4')](),controller[_0x651b('0x9')]);router[_0x651b('0x6')](_0x651b('0xa'),auth[_0x651b('0x4')](),controller[_0x651b('0xb')]);router[_0x651b('0x6')](_0x651b('0xc'),auth[_0x651b('0x4')](),controller[_0x651b('0xd')]);router['get'](_0x651b('0xe'),auth['isAuthenticated'](),controller[_0x651b('0xf')]);router[_0x651b('0x6')]('/:id/interactions',auth[_0x651b('0x4')](),controller['getInteractions']);router[_0x651b('0x6')]('/:id/users',auth['isAuthenticated'](),controller[_0x651b('0x10')]);router['post']('/',auth[_0x651b('0x4')](),controller[_0x651b('0x11')]);router[_0x651b('0x12')](_0x651b('0xa'),auth[_0x651b('0x4')](),controller[_0x651b('0x13')]);router['post'](_0x651b('0xc'),auth[_0x651b('0x4')](),controller[_0x651b('0x14')]);router[_0x651b('0x12')](_0x651b('0x15'),controller[_0x651b('0x16')]);router[_0x651b('0x12')](_0x651b('0xe'),auth['isAuthenticated'](),controller[_0x651b('0x17')]);router[_0x651b('0x12')](_0x651b('0x18'),auth[_0x651b('0x4')](),controller[_0x651b('0x19')]);router[_0x651b('0x12')]('/:id/send',auth['isAuthenticated'](),controller[_0x651b('0x1a')]);router['put'](_0x651b('0x8'),auth[_0x651b('0x4')](),controller['update']);router[_0x651b('0x1b')]('/:id',auth[_0x651b('0x4')](),controller[_0x651b('0x1c')]);router[_0x651b('0x1b')]('/:id/dispositions',auth[_0x651b('0x4')](),controller['removeDispositions']);router[_0x651b('0x1b')](_0x651b('0xc'),auth['isAuthenticated'](),controller[_0x651b('0x1d')]);router[_0x651b('0x1b')](_0x651b('0x18'),auth[_0x651b('0x4')](),controller[_0x651b('0x1e')]);module['exports']=router; \ No newline at end of file +var _0x992a=['send','put','update','destroy','delete','/:id/dispositions','removeDispositions','removeAnswers','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/canned_answers','/:id/applications','/:id/interactions','/:id/users','getAgents','post','create','addAnswer','/:id/notify','notify','addApplications','addAgents','/:id/send'];(function(_0x4363f1,_0x4f899f){var _0x520277=function(_0x4dbadd){while(--_0x4dbadd){_0x4363f1['push'](_0x4363f1['shift']());}};_0x520277(++_0x4f899f);}(_0x992a,0xbc));var _0xa992=function(_0x4849f6,_0x104836){_0x4849f6=_0x4849f6-0x0;var _0x1a3dcd=_0x992a[_0x4849f6];return _0x1a3dcd;};'use strict';var multer=require(_0xa992('0x0'));var util=require(_0xa992('0x1'));var path=require(_0xa992('0x2'));var timeout=require(_0xa992('0x3'));var express=require('express');var router=express[_0xa992('0x4')]();var fs_extra=require(_0xa992('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa992('0x6'));var config=require(_0xa992('0x7'));var controller=require('./openchannelAccount.controller');router[_0xa992('0x8')]('/',auth[_0xa992('0x9')](),controller[_0xa992('0xa')]);router[_0xa992('0x8')](_0xa992('0xb'),auth[_0xa992('0x9')](),controller[_0xa992('0xc')]);router[_0xa992('0x8')](_0xa992('0xd'),auth[_0xa992('0x9')](),controller[_0xa992('0xe')]);router[_0xa992('0x8')]('/:id/dispositions',auth[_0xa992('0x9')](),controller['getDispositions']);router['get'](_0xa992('0xf'),auth[_0xa992('0x9')](),controller['getAnswers']);router['get'](_0xa992('0x10'),auth[_0xa992('0x9')](),controller['getApplications']);router[_0xa992('0x8')](_0xa992('0x11'),auth[_0xa992('0x9')](),controller['getInteractions']);router['get'](_0xa992('0x12'),auth[_0xa992('0x9')](),controller[_0xa992('0x13')]);router[_0xa992('0x14')]('/',auth['isAuthenticated'](),controller[_0xa992('0x15')]);router[_0xa992('0x14')]('/:id/dispositions',auth['isAuthenticated'](),controller['addDisposition']);router[_0xa992('0x14')]('/:id/canned_answers',auth[_0xa992('0x9')](),controller[_0xa992('0x16')]);router['post'](_0xa992('0x17'),controller[_0xa992('0x18')]);router['post'](_0xa992('0x10'),auth[_0xa992('0x9')](),controller[_0xa992('0x19')]);router['post'](_0xa992('0x12'),auth[_0xa992('0x9')](),controller[_0xa992('0x1a')]);router[_0xa992('0x14')](_0xa992('0x1b'),auth['isAuthenticated'](),controller[_0xa992('0x1c')]);router[_0xa992('0x1d')]('/:id',auth[_0xa992('0x9')](),controller[_0xa992('0x1e')]);router['delete']('/:id',auth[_0xa992('0x9')](),controller[_0xa992('0x1f')]);router[_0xa992('0x20')](_0xa992('0x21'),auth[_0xa992('0x9')](),controller[_0xa992('0x22')]);router[_0xa992('0x20')]('/:id/canned_answers',auth[_0xa992('0x9')](),controller[_0xa992('0x23')]);router['delete']('/:id/users',auth[_0xa992('0x9')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index d805b20..cfc060d 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 _0xb0d3=['name','STRING','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','setDataValue','sequelize','randomstring','exports'];(function(_0x4449a8,_0x79adf3){var _0x4783b6=function(_0xd2036d){while(--_0xd2036d){_0x4449a8['push'](_0x4449a8['shift']());}};_0x4783b6(++_0x79adf3);}(_0xb0d3,0x1d1));var _0x3b0d=function(_0x4f217f,_0x313163){_0x4f217f=_0x4f217f-0x0;var _0x3b583a=_0xb0d3[_0x4f217f];return _0x3b583a;};'use strict';var Sequelize=require(_0x3b0d('0x0'));var rs=require(_0x3b0d('0x1'));module[_0x3b0d('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x3b0d('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x3b0d('0x4')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x3b0d('0x5')]();}},'replyUri':{'type':Sequelize[_0x3b0d('0x4')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x3b0d('0x4')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x3b0d('0x6')],'defaultValue':function(){return _0x3b0d('0x7');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x3b0d('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x3b0d('0x4')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x3b0d('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x3b0d('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3b0d('0x9')],'allowNull':!![],'defaultValue':null,'comment':_0x3b0d('0xa')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1c41cd){if(!_0x1c41cd)this['setDataValue'](_0x3b0d('0xb'),null);this[_0x3b0d('0xc')]('mandatoryDisposition',_0x1c41cd);}}}; \ No newline at end of file +var _0x45e9=['name','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING'];(function(_0x728cb6,_0x57bcba){var _0x390eb7=function(_0x117d7d){while(--_0x117d7d){_0x728cb6['push'](_0x728cb6['shift']());}};_0x390eb7(++_0x57bcba);}(_0x45e9,0x80));var _0x945e=function(_0x3e6879,_0x35bdb9){_0x3e6879=_0x3e6879-0x0;var _0x450b99=_0x45e9[_0x3e6879];return _0x450b99;};'use strict';var Sequelize=require(_0x945e('0x0'));var rs=require(_0x945e('0x1'));module[_0x945e('0x2')]={'name':{'type':Sequelize[_0x945e('0x3')],'unique':_0x945e('0x4'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x945e('0x3')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0x945e('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x945e('0x5')],'defaultValue':function(){return _0x945e('0x6');}},'notificationSound':{'type':Sequelize[_0x945e('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x945e('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x945e('0x3')]},'queueTransfer':{'type':Sequelize[_0x945e('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x945e('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x945e('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x945e('0x8')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x945e('0x7')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x102ee3){if(!_0x102ee3)this[_0x945e('0x9')](_0x945e('0xa'),null);this[_0x945e('0x9')](_0x945e('0xb'),_0x102ee3);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 0473e40..d74f33a 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 _0x87df=['OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','OpenchannelAccounts','UserProfileResource','destroy','stack','name','send','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','merge','filter','options','includeAll','include','findAll','rows','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addDisposition','getDispositions','findOne','order','OpenchannelAccountId','Disposition','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','pick','removeAnswers','notify','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','DESC','OpenchannelApplication','Applications','account','applications','list','orderBy','priority','Contacts','defaults','firstName','threadId','OpenchannelInteraction','externalUrl','spread','contact','messageId','interaction','created','push','close','unmanaged','*,*,*,*','OpenchannelMessage','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','bulkCreate','findAndCountAll','finally','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','body\x20is\x20mandatory\x20and\x20not\x20empty','out','dataValues','Messages','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','http','client','request','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0x87df,0x167));var _0xf87d=function(_0x17b287,_0x4bed1c){_0x17b287=_0x17b287-0x0;var _0x177054=_0x87df[_0x17b287];return _0x177054;};'use strict';var emlformat=require(_0xf87d('0x0'));var rimraf=require(_0xf87d('0x1'));var zipdir=require(_0xf87d('0x2'));var jsonpatch=require(_0xf87d('0x3'));var rp=require(_0xf87d('0x4'));var moment=require(_0xf87d('0x5'));var BPromise=require(_0xf87d('0x6'));var Mustache=require(_0xf87d('0x7'));var util=require(_0xf87d('0x8'));var path=require(_0xf87d('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf87d('0xa'));var fs=require('fs');var fs_extra=require(_0xf87d('0xb'));var _=require('lodash');var squel=require(_0xf87d('0xc'));var crypto=require(_0xf87d('0xd'));var jsforce=require(_0xf87d('0xe'));var deskjs=require(_0xf87d('0xf'));var toCsv=require(_0xf87d('0x10'));var querystring=require(_0xf87d('0x11'));var Papa=require(_0xf87d('0x12'));var Redis=require(_0xf87d('0x13'));var authService=require(_0xf87d('0x14'));var qs=require(_0xf87d('0x15'));var as=require(_0xf87d('0x16'));var hardwareService=require(_0xf87d('0x17'));var logger=require(_0xf87d('0x18'))(_0xf87d('0x19'));var utils=require(_0xf87d('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0xf87d('0x1b'));var db=require(_0xf87d('0x1c'))['db'];config[_0xf87d('0x1d')]=_['defaults'](config[_0xf87d('0x1d')],{'host':_0xf87d('0x1e'),'port':0x18eb});var socket=require(_0xf87d('0x1f'))(new Redis(config[_0xf87d('0x1d')]));require('./openchannelAccount.socket')[_0xf87d('0x20')](socket);var jayson=require(_0xf87d('0x21'));var client=jayson['client'][_0xf87d('0x22')]({'port':0x232c});var client9002=jayson[_0xf87d('0x23')][_0xf87d('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x368872,_0x2b72fc,_0x20a4c9,_0x3f45f9){return new BPromise(function(_0x5cc044,_0xd01335){var _0x19889a=_0x3f45f9||client;return _0x19889a[_0xf87d('0x24')](_0x368872,_0x20a4c9)['then'](function(_0x9c080){logger[_0xf87d('0x25')](_0xf87d('0x26'),_0x2b72fc,_0xf87d('0x27'));logger[_0xf87d('0x28')](_0xf87d('0x29'),_0x2b72fc,'request\x20sent',JSON[_0xf87d('0x2a')](_0x9c080));if(_0x9c080[_0xf87d('0x2b')]){if(_0x9c080['error'][_0xf87d('0x2c')]===0x1f4){logger[_0xf87d('0x2b')](_0xf87d('0x26'),_0x2b72fc,_0x9c080[_0xf87d('0x2b')][_0xf87d('0x2d')]);return _0xd01335(_0x9c080[_0xf87d('0x2b')][_0xf87d('0x2d')]);}logger['error'](_0xf87d('0x26'),_0x2b72fc,_0x9c080[_0xf87d('0x2b')][_0xf87d('0x2d')]);return _0x5cc044(_0x9c080[_0xf87d('0x2b')][_0xf87d('0x2d')]);}else{logger[_0xf87d('0x25')]('OpenchannelAccount,\x20%s,\x20%s',_0x2b72fc,'request\x20sent');_0x5cc044(_0x9c080[_0xf87d('0x2e')][_0xf87d('0x2d')]);}})[_0xf87d('0x2f')](function(_0x2ef1c3){logger['error'](_0xf87d('0x26'),_0x2b72fc,_0x2ef1c3);_0xd01335(_0x2ef1c3);});});}function respondWithStatusCode(_0x15eabd,_0x1e3883){_0x1e3883=_0x1e3883||0xcc;return function(_0x470810){if(_0x470810){return _0x15eabd[_0xf87d('0x30')](_0x1e3883);}return _0x15eabd['status'](_0x1e3883)[_0xf87d('0x31')]();};}function respondWithResult(_0x12b933,_0x1daaf8){_0x1daaf8=_0x1daaf8||0xc8;return function(_0x38be83){if(_0x38be83){return _0x12b933[_0xf87d('0x32')](_0x1daaf8)[_0xf87d('0x33')](_0x38be83);}};}function respondWithFilteredResult(_0x1155c9,_0x43cfed){return function(_0x36203c){if(_0x36203c){var _0x1ad861=typeof _0x43cfed[_0xf87d('0x34')]==='undefined'&&typeof _0x43cfed[_0xf87d('0x35')]===_0xf87d('0x36');var _0x5663b4=_0x36203c[_0xf87d('0x37')];var _0x3d00d1=_0x1ad861?0x0:_0x43cfed['offset'];var _0xd06243=_0x1ad861?_0x36203c[_0xf87d('0x37')]:_0x43cfed['offset']+_0x43cfed[_0xf87d('0x35')];var _0x14ef65;if(_0xd06243>=_0x5663b4){_0xd06243=_0x5663b4;_0x14ef65=0xc8;}else{_0x14ef65=0xce;}_0x1155c9[_0xf87d('0x32')](_0x14ef65);return _0x1155c9[_0xf87d('0x38')](_0xf87d('0x39'),_0x3d00d1+'-'+_0xd06243+'/'+_0x5663b4)[_0xf87d('0x33')](_0x36203c);}return null;};}function patchUpdates(_0x2a9293){return function(_0x583ced){try{jsonpatch[_0xf87d('0x3a')](_0x583ced,_0x2a9293,!![]);}catch(_0x3b16d9){return BPromise[_0xf87d('0x3b')](_0x3b16d9);}return _0x583ced['save']();};}function saveUpdates(_0x1e5469,_0x2e872){return function(_0x273e0){if(_0x273e0){return _0x273e0[_0xf87d('0x3c')](_0x1e5469)[_0xf87d('0x3d')](function(_0x39e3a4){return _0x39e3a4;});}return null;};}function removeEntity(_0x286fca,_0xa02ac6){return function(_0x549b2b){if(_0x549b2b){return _0x549b2b['destroy']()['then'](function(){var _0x1b54e1=_0x549b2b['get']({'plain':!![]});var _0x13bb9f=_0xf87d('0x3e');return db[_0xf87d('0x3f')][_0xf87d('0x40')]({'where':{'type':_0x13bb9f,'resourceId':_0x1b54e1['id']}})[_0xf87d('0x3d')](function(){return _0x549b2b;});})[_0xf87d('0x3d')](function(){_0x286fca[_0xf87d('0x32')](0xcc)[_0xf87d('0x31')]();});}};}function handleEntityNotFound(_0x59c1b8,_0x1fd286){return function(_0x58a0d1){if(!_0x58a0d1){_0x59c1b8[_0xf87d('0x30')](0x194);}return _0x58a0d1;};}function handleError(_0x103d93,_0xec0592){_0xec0592=_0xec0592||0x1f4;return function(_0x578c9f){logger[_0xf87d('0x2b')](_0x578c9f[_0xf87d('0x41')]);if(_0x578c9f[_0xf87d('0x42')]){delete _0x578c9f[_0xf87d('0x42')];}_0x103d93[_0xf87d('0x32')](_0xec0592)[_0xf87d('0x43')](_0x578c9f);};}exports['index']=function(_0x25aa07,_0x5ee135){var _0x5c0cf6={'include':[{'model':db[_0xf87d('0x44')],'as':_0xf87d('0x45')}]},_0x3afc96={},_0x1c09cd={'count':0x0,'rows':[]};var _0x317343=_[_0xf87d('0x46')](db[_0xf87d('0x47')][_0xf87d('0x48')],function(_0x4394d1){return{'name':_0x4394d1[_0xf87d('0x49')],'type':_0x4394d1[_0xf87d('0x4a')]['key']};});_0x3afc96[_0xf87d('0x4b')]=_[_0xf87d('0x46')](_0x317343,_0xf87d('0x42'));_0x3afc96[_0xf87d('0x4c')]=_['keys'](_0x25aa07[_0xf87d('0x4c')]);_0x3afc96[_0xf87d('0x4d')]=_['intersection'](_0x3afc96[_0xf87d('0x4b')],_0x3afc96['query']);_0x5c0cf6[_0xf87d('0x4e')]=_[_0xf87d('0x4f')](_0x3afc96[_0xf87d('0x4b')],qs['fields'](_0x25aa07['query'][_0xf87d('0x50')]));_0x5c0cf6[_0xf87d('0x4e')]=_0x5c0cf6[_0xf87d('0x4e')][_0xf87d('0x51')]?_0x5c0cf6['attributes']:_0x3afc96[_0xf87d('0x4b')];if(!_0x25aa07[_0xf87d('0x4c')][_0xf87d('0x52')](_0xf87d('0x53'))){_0x5c0cf6[_0xf87d('0x35')]=qs[_0xf87d('0x35')](_0x25aa07['query'][_0xf87d('0x35')]);_0x5c0cf6[_0xf87d('0x34')]=qs[_0xf87d('0x34')](_0x25aa07[_0xf87d('0x4c')]['offset']);}_0x5c0cf6['order']=qs[_0xf87d('0x54')](_0x25aa07[_0xf87d('0x4c')]['sort']);_0x5c0cf6[_0xf87d('0x55')]=qs[_0xf87d('0x4d')](_['pick'](_0x25aa07[_0xf87d('0x4c')],_0x3afc96[_0xf87d('0x4d')]),_0x317343);if(_0x25aa07[_0xf87d('0x4c')]['filter']){_0x5c0cf6[_0xf87d('0x55')]=_[_0xf87d('0x56')](_0x5c0cf6[_0xf87d('0x55')],{'$or':_[_0xf87d('0x46')](_0x317343,function(_0x1513f2){if(_0x1513f2[_0xf87d('0x4a')]!=='VIRTUAL'){var _0x1ed883={};_0x1ed883[_0x1513f2[_0xf87d('0x42')]]={'$like':'%'+_0x25aa07[_0xf87d('0x4c')][_0xf87d('0x57')]+'%'};return _0x1ed883;}})});}_0x5c0cf6=_['merge']({},_0x5c0cf6,_0x25aa07[_0xf87d('0x58')]);var _0x251f7c={'where':_0x5c0cf6['where']};return db[_0xf87d('0x47')][_0xf87d('0x37')](_0x251f7c)[_0xf87d('0x3d')](function(_0x2bf9a7){_0x1c09cd[_0xf87d('0x37')]=_0x2bf9a7;if(_0x25aa07[_0xf87d('0x4c')][_0xf87d('0x59')]){_0x5c0cf6[_0xf87d('0x5a')]=[{'all':!![]}];}return db[_0xf87d('0x47')][_0xf87d('0x5b')](_0x5c0cf6);})['then'](function(_0x4d4028){_0x1c09cd[_0xf87d('0x5c')]=_0x4d4028;return _0x1c09cd;})[_0xf87d('0x3d')](respondWithFilteredResult(_0x5ee135,_0x5c0cf6))['catch'](handleError(_0x5ee135,null));};exports[_0xf87d('0x5d')]=function(_0x5e71e6,_0x305fa5){var _0x3339f7={'raw':![],'where':{'id':_0x5e71e6[_0xf87d('0x5e')]['id']},'include':[{'model':db['Pause'],'as':_0xf87d('0x45')}]},_0x4f0859={};_0x4f0859[_0xf87d('0x4b')]=_['keys'](db[_0xf87d('0x47')][_0xf87d('0x48')]);_0x4f0859['query']=_[_0xf87d('0x5f')](_0x5e71e6['query']);_0x4f0859[_0xf87d('0x4d')]=_[_0xf87d('0x4f')](_0x4f0859['model'],_0x4f0859[_0xf87d('0x4c')]);_0x3339f7[_0xf87d('0x4e')]=_[_0xf87d('0x4f')](_0x4f0859[_0xf87d('0x4b')],qs[_0xf87d('0x50')](_0x5e71e6[_0xf87d('0x4c')][_0xf87d('0x50')]));_0x3339f7[_0xf87d('0x4e')]=_0x3339f7[_0xf87d('0x4e')][_0xf87d('0x51')]?_0x3339f7[_0xf87d('0x4e')]:_0x4f0859[_0xf87d('0x4b')];if(_0x5e71e6[_0xf87d('0x4c')][_0xf87d('0x59')]){_0x3339f7[_0xf87d('0x5a')]=[{'all':!![]}];}_0x3339f7=_[_0xf87d('0x56')]({},_0x3339f7,_0x5e71e6[_0xf87d('0x58')]);return db[_0xf87d('0x47')][_0xf87d('0x60')](_0x3339f7)[_0xf87d('0x3d')](handleEntityNotFound(_0x305fa5,null))[_0xf87d('0x3d')](respondWithResult(_0x305fa5,null))[_0xf87d('0x2f')](handleError(_0x305fa5,null));};exports['create']=function(_0x5456ad,_0x4126cc){return db['OpenchannelAccount'][_0xf87d('0x61')](_0x5456ad[_0xf87d('0x62')],{})[_0xf87d('0x3d')](function(_0x284a99){var _0x490b22=_0x5456ad[_0xf87d('0x63')]['get']({'plain':!![]});if(!_0x490b22)throw new Error(_0xf87d('0x64'));if(_0x490b22['role']===_0xf87d('0x63')){var _0x34c026=_0x284a99[_0xf87d('0x65')]({'plain':!![]});var _0x1fe00f=_0xf87d('0x3e');return db['UserProfileSection'][_0xf87d('0x60')]({'where':{'name':_0x1fe00f,'userProfileId':_0x490b22[_0xf87d('0x66')]},'raw':!![]})['then'](function(_0x36e490){if(_0x36e490&&_0x36e490['autoAssociation']===0x0){return db[_0xf87d('0x3f')][_0xf87d('0x61')]({'name':_0x34c026[_0xf87d('0x42')],'resourceId':_0x34c026['id'],'type':_0x36e490[_0xf87d('0x42')],'sectionId':_0x36e490['id']},{})[_0xf87d('0x3d')](function(){return _0x284a99;});}else{return _0x284a99;}})[_0xf87d('0x2f')](function(_0x5141d8){logger[_0xf87d('0x2b')](_0xf87d('0x67'),_0x5141d8);throw _0x5141d8;});}return _0x284a99;})['then'](respondWithResult(_0x4126cc,0xc9))[_0xf87d('0x2f')](handleError(_0x4126cc,null));};exports[_0xf87d('0x3c')]=function(_0x15a096,_0x2fcbae){if(_0x15a096[_0xf87d('0x62')]['id']){delete _0x15a096[_0xf87d('0x62')]['id'];}return db['OpenchannelAccount'][_0xf87d('0x60')]({'where':{'id':_0x15a096[_0xf87d('0x5e')]['id']},'include':[{'model':db['Pause'],'as':_0xf87d('0x45')}]})[_0xf87d('0x3d')](handleEntityNotFound(_0x2fcbae,null))['then'](saveUpdates(_0x15a096[_0xf87d('0x62')],null))['then'](respondWithResult(_0x2fcbae,null))[_0xf87d('0x2f')](handleError(_0x2fcbae,null));};exports[_0xf87d('0x40')]=function(_0x53dfb1,_0x53d291){return db[_0xf87d('0x47')][_0xf87d('0x60')]({'where':{'id':_0x53dfb1[_0xf87d('0x5e')]['id']}})[_0xf87d('0x3d')](handleEntityNotFound(_0x53d291,null))[_0xf87d('0x3d')](removeEntity(_0x53d291,null))[_0xf87d('0x2f')](handleError(_0x53d291,null));};exports['describe']=function(_0x3c85e5,_0x56de21){return db[_0xf87d('0x47')]['describe']()[_0xf87d('0x3d')](respondWithResult(_0x56de21,null))[_0xf87d('0x2f')](handleError(_0x56de21,null));};exports[_0xf87d('0x68')]=function(_0x43bd99,_0x530844,_0x26c041){if(_0x43bd99['body']['id']){delete _0x43bd99['body']['id'];}return db[_0xf87d('0x47')][_0xf87d('0x60')]({'where':{'id':_0x43bd99[_0xf87d('0x5e')]['id']}})[_0xf87d('0x3d')](handleEntityNotFound(_0x530844,null))['then'](function(_0x1b81ab){if(_0x1b81ab){_0x43bd99[_0xf87d('0x62')]['OpenchannelAccountId']=_0x1b81ab['id'];return db['Disposition'][_0xf87d('0x61')](_0x43bd99[_0xf87d('0x62')]);}})[_0xf87d('0x3d')](respondWithResult(_0x530844,null))[_0xf87d('0x2f')](handleError(_0x530844,null));};exports[_0xf87d('0x69')]=function(_0xe8ecb0,_0x22996f,_0x37d0d2){var _0x563859={'raw':![],'where':{}};var _0x32dda7={};var _0x207cc9={'count':0x0,'rows':[]};return db[_0xf87d('0x47')][_0xf87d('0x6a')]({'where':{'id':_0xe8ecb0[_0xf87d('0x5e')]['id']}})[_0xf87d('0x3d')](handleEntityNotFound(_0x22996f,null))[_0xf87d('0x3d')](function(_0x5f542f){if(_0x5f542f){_0x32dda7['model']=_['keys'](db['Disposition'][_0xf87d('0x48')]);_0x32dda7[_0xf87d('0x4c')]=_[_0xf87d('0x5f')](_0xe8ecb0[_0xf87d('0x4c')]);_0x32dda7[_0xf87d('0x4d')]=_[_0xf87d('0x4f')](_0x32dda7[_0xf87d('0x4b')],_0x32dda7['query']);_0x563859[_0xf87d('0x4e')]=_['intersection'](_0x32dda7[_0xf87d('0x4b')],qs[_0xf87d('0x50')](_0xe8ecb0['query'][_0xf87d('0x50')]));_0x563859['attributes']=_0x563859[_0xf87d('0x4e')][_0xf87d('0x51')]?_0x563859['attributes']:_0x32dda7[_0xf87d('0x4b')];if(!_0xe8ecb0[_0xf87d('0x4c')][_0xf87d('0x52')]('nolimit')){_0x563859[_0xf87d('0x35')]=qs[_0xf87d('0x35')](_0xe8ecb0['query']['limit']);_0x563859[_0xf87d('0x34')]=qs[_0xf87d('0x34')](_0xe8ecb0['query'][_0xf87d('0x34')]);}_0x563859[_0xf87d('0x6b')]=qs['sort'](_0xe8ecb0['query']['sort']);_0x563859[_0xf87d('0x55')]=qs[_0xf87d('0x4d')](_['pick'](_0xe8ecb0['query'],_0x32dda7[_0xf87d('0x4d')]));_0x563859[_0xf87d('0x55')][_0xf87d('0x6c')]=_0x5f542f['id'];if(_0xe8ecb0['query'][_0xf87d('0x57')]){_0x563859[_0xf87d('0x55')]=_['merge'](_0x563859[_0xf87d('0x55')],{'$or':_[_0xf87d('0x46')](_0x563859['attributes'],function(_0x36dbe9){var _0x30929b={};_0x30929b[_0x36dbe9]={'$like':'%'+_0xe8ecb0[_0xf87d('0x4c')][_0xf87d('0x57')]+'%'};return _0x30929b;})});}_0x563859=_[_0xf87d('0x56')]({},_0x563859,_0xe8ecb0[_0xf87d('0x58')]);return db[_0xf87d('0x6d')][_0xf87d('0x37')]({'where':_0x563859[_0xf87d('0x55')]})[_0xf87d('0x3d')](function(_0x175683){_0x207cc9[_0xf87d('0x37')]=_0x175683;if(_0xe8ecb0[_0xf87d('0x4c')]['includeAll']){_0x563859[_0xf87d('0x5a')]=[{'all':!![]}];}return db[_0xf87d('0x6d')]['findAll'](_0x563859);})['then'](function(_0x54ff09){_0x207cc9['rows']=_0x54ff09;return _0x207cc9;});}})['then'](respondWithFilteredResult(_0x22996f,_0x563859))[_0xf87d('0x2f')](handleError(_0x22996f,null));};exports[_0xf87d('0x6e')]=function(_0x4b342f,_0x39e70d,_0x58b74f){return db[_0xf87d('0x47')][_0xf87d('0x60')]({'where':{'id':_0x4b342f[_0xf87d('0x5e')]['id']}})[_0xf87d('0x3d')](handleEntityNotFound(_0x39e70d,null))[_0xf87d('0x3d')](function(_0x3fa3fd){if(_0x3fa3fd){return _0x3fa3fd[_0xf87d('0x6e')](_0x4b342f['query'][_0xf87d('0x6f')]);}})[_0xf87d('0x3d')](respondWithStatusCode(_0x39e70d,null))[_0xf87d('0x2f')](handleError(_0x39e70d,null));};exports[_0xf87d('0x70')]=function(_0x43af6b,_0x15e694,_0xed9516){if(_0x43af6b[_0xf87d('0x62')]['id']){delete _0x43af6b[_0xf87d('0x62')]['id'];}return db['OpenchannelAccount'][_0xf87d('0x60')]({'where':{'id':_0x43af6b[_0xf87d('0x5e')]['id']}})[_0xf87d('0x3d')](handleEntityNotFound(_0x15e694,null))[_0xf87d('0x3d')](function(_0x316df2){if(_0x316df2){_0x43af6b['body'][_0xf87d('0x6c')]=_0x316df2['id'];return db[_0xf87d('0x71')][_0xf87d('0x61')](_0x43af6b['body']);}})[_0xf87d('0x3d')](respondWithResult(_0x15e694,null))[_0xf87d('0x2f')](handleError(_0x15e694,null));};exports[_0xf87d('0x72')]=function(_0x11b132,_0x4d7f91,_0x18bb45){var _0xfef9d1={'raw':![],'where':{}};var _0x1618cd={};var _0x149064={'count':0x0,'rows':[]};return db[_0xf87d('0x47')][_0xf87d('0x6a')]({'where':{'id':_0x11b132[_0xf87d('0x5e')]['id']}})[_0xf87d('0x3d')](handleEntityNotFound(_0x4d7f91,null))[_0xf87d('0x3d')](function(_0x8fd1f9){if(_0x8fd1f9){_0x1618cd[_0xf87d('0x4b')]=_[_0xf87d('0x5f')](db[_0xf87d('0x71')]['rawAttributes']);_0x1618cd[_0xf87d('0x4c')]=_[_0xf87d('0x5f')](_0x11b132['query']);_0x1618cd['filters']=_[_0xf87d('0x4f')](_0x1618cd['model'],_0x1618cd[_0xf87d('0x4c')]);_0xfef9d1['attributes']=_[_0xf87d('0x4f')](_0x1618cd[_0xf87d('0x4b')],qs['fields'](_0x11b132['query'][_0xf87d('0x50')]));_0xfef9d1[_0xf87d('0x4e')]=_0xfef9d1['attributes'][_0xf87d('0x51')]?_0xfef9d1[_0xf87d('0x4e')]:_0x1618cd[_0xf87d('0x4b')];if(!_0x11b132[_0xf87d('0x4c')]['hasOwnProperty'](_0xf87d('0x53'))){_0xfef9d1[_0xf87d('0x35')]=qs[_0xf87d('0x35')](_0x11b132[_0xf87d('0x4c')]['limit']);_0xfef9d1['offset']=qs[_0xf87d('0x34')](_0x11b132['query'][_0xf87d('0x34')]);}_0xfef9d1[_0xf87d('0x6b')]=qs[_0xf87d('0x54')](_0x11b132[_0xf87d('0x4c')]['sort']);_0xfef9d1[_0xf87d('0x55')]=qs[_0xf87d('0x4d')](_[_0xf87d('0x73')](_0x11b132[_0xf87d('0x4c')],_0x1618cd[_0xf87d('0x4d')]));_0xfef9d1[_0xf87d('0x55')][_0xf87d('0x6c')]=_0x8fd1f9['id'];if(_0x11b132[_0xf87d('0x4c')][_0xf87d('0x57')]){_0xfef9d1['where']=_[_0xf87d('0x56')](_0xfef9d1['where'],{'$or':_[_0xf87d('0x46')](_0xfef9d1[_0xf87d('0x4e')],function(_0x58f72b){var _0xa53bb2={};_0xa53bb2[_0x58f72b]={'$like':'%'+_0x11b132[_0xf87d('0x4c')][_0xf87d('0x57')]+'%'};return _0xa53bb2;})});}_0xfef9d1=_[_0xf87d('0x56')]({},_0xfef9d1,_0x11b132['options']);return db[_0xf87d('0x71')][_0xf87d('0x37')]({'where':_0xfef9d1[_0xf87d('0x55')]})[_0xf87d('0x3d')](function(_0x35e38f){_0x149064[_0xf87d('0x37')]=_0x35e38f;if(_0x11b132['query'][_0xf87d('0x59')]){_0xfef9d1[_0xf87d('0x5a')]=[{'all':!![]}];}return db[_0xf87d('0x71')][_0xf87d('0x5b')](_0xfef9d1);})['then'](function(_0x4df85c){_0x149064[_0xf87d('0x5c')]=_0x4df85c;return _0x149064;});}})[_0xf87d('0x3d')](respondWithFilteredResult(_0x4d7f91,_0xfef9d1))[_0xf87d('0x2f')](handleError(_0x4d7f91,null));};exports[_0xf87d('0x74')]=function(_0xe25484,_0x10877a,_0x440827){return db['OpenchannelAccount'][_0xf87d('0x60')]({'where':{'id':_0xe25484['params']['id']}})[_0xf87d('0x3d')](handleEntityNotFound(_0x10877a,null))[_0xf87d('0x3d')](function(_0x40436f){if(_0x40436f){return _0x40436f[_0xf87d('0x74')](_0xe25484['query'][_0xf87d('0x6f')]);}})[_0xf87d('0x3d')](respondWithStatusCode(_0x10877a,null))[_0xf87d('0x2f')](handleError(_0x10877a,null));};exports[_0xf87d('0x75')]=function(_0x5233df,_0x1c47c5,_0x55c98a){var _0x206d16={'body':_0x5233df[_0xf87d('0x62')],'channel':'openchannel'};var _0x5b87b0=[];var _0x321f5f=[];var _0xa02783={};var _0x42dbed=![];return db[_0xf87d('0x76')][_0xf87d('0x77')]()[_0xf87d('0x3d')](function(_0x328552){if(!_0x328552){throw new db[(_0xf87d('0x78'))][(_0xf87d('0x79'))](_0xf87d('0x7a'));}_0x5b87b0=_[_0xf87d('0x7b')](_[_0xf87d('0x5f')](_0x328552),[_0xf87d('0x7c'),_0xf87d('0x7d')]);_0x321f5f=_[_0xf87d('0x7b')](_[_0xf87d('0x5f')](_0x328552),['createdAt',_0xf87d('0x7d'),_0xf87d('0x7e'),_0xf87d('0x7f')]);if(_0x5233df[_0xf87d('0x62')]['id']){delete _0x5233df['body']['id'];}if(_[_0xf87d('0x80')](_0x5233df[_0xf87d('0x62')]['from'])){throw new db[(_0xf87d('0x78'))][(_0xf87d('0x79'))](_0xf87d('0x81'));}if(_[_0xf87d('0x80')](_0x5233df[_0xf87d('0x62')][_0xf87d('0x62')])||_0x5233df[_0xf87d('0x62')][_0xf87d('0x62')]===''){throw new db[(_0xf87d('0x78'))][(_0xf87d('0x79'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xf87d('0x80')](_0x5233df['body'][_0xf87d('0x82')])){throw new db[(_0xf87d('0x78'))][(_0xf87d('0x79'))](_0xf87d('0x83')+_0x321f5f);}if(!_[_0xf87d('0x84')](_0x321f5f,_0x5233df[_0xf87d('0x62')][_0xf87d('0x82')])){throw new db[(_0xf87d('0x78'))]['ValidationError'](_0xf87d('0x85')+_0x321f5f);}_0xa02783[_0x5233df[_0xf87d('0x62')][_0xf87d('0x82')]]=_0x5233df[_0xf87d('0x62')][_0xf87d('0x86')];})['then'](function(){return db['OpenchannelAccount'][_0xf87d('0x60')]({'where':{'id':_0x5233df[_0xf87d('0x5e')]['id']},'include':[{'model':db[_0xf87d('0x87')],'as':_0xf87d('0x88'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0xa02783,'limit':0x1,'order':[['updatedAt',_0xf87d('0x89')]]}]},{'model':db[_0xf87d('0x8a')],'as':_0xf87d('0x8b')}]});})[_0xf87d('0x3d')](handleEntityNotFound(_0x1c47c5,null))[_0xf87d('0x3d')](function(_0x3986fc){if(_0x3986fc&&_0x3986fc[_0xf87d('0x88')]){_0x206d16[_0xf87d('0x8c')]=_0x3986fc;_0x206d16[_0xf87d('0x8d')]=_0x3986fc[_0xf87d('0x8b')];_0x206d16[_0xf87d('0x8e')]=_0x3986fc[_0xf87d('0x88')];_0x206d16[_0xf87d('0x8d')]=_[_0xf87d('0x8f')](_0x206d16[_0xf87d('0x8d')],[_0xf87d('0x90')],['asc']);if(_0x206d16[_0xf87d('0x8c')][_0xf87d('0x8b')]){delete _0x206d16[_0xf87d('0x8c')][_0xf87d('0x8b')];}if(_0x206d16['account'][_0xf87d('0x88')]&&_0x206d16[_0xf87d('0x8c')]['List'][_0xf87d('0x91')][_0xf87d('0x51')]){return _0x206d16[_0xf87d('0x8c')][_0xf87d('0x88')][_0xf87d('0x91')][0x0];}var _0x35a1ab=_[_0xf87d('0x92')](_0x5233df[_0xf87d('0x62')],{'firstName':_0x5233df['body'][_0xf87d('0x86')],'ListId':_0x3986fc[_0xf87d('0x7f')]});_0x35a1ab[_0x5233df[_0xf87d('0x62')][_0xf87d('0x82')]]=_0x5233df[_0xf87d('0x62')][_0xf87d('0x86')];return db['CmContact'][_0xf87d('0x61')](_0x35a1ab,{'fields':_0x5b87b0,'raw':!![]});}})['then'](handleEntityNotFound(_0x1c47c5,null))[_0xf87d('0x3d')](function(_0x31ac28){_0x206d16['contact']=_0x31ac28;if(_0x31ac28){var _0x4f92de={'ContactId':_0x31ac28['id'],'OpenchannelAccountId':_0x5233df[_0xf87d('0x5e')]['id'],'from':(_0x31ac28[_0xf87d('0x93')]||'')+'\x20'+(_0x31ac28['lastName']||'')};var _0x30400e={'OpenchannelAccountId':_0x5233df[_0xf87d('0x5e')]['id'],'closed':![]};if(_0x5233df[_0xf87d('0x62')][_0xf87d('0x94')]){_0x30400e['threadId']=_0x5233df[_0xf87d('0x62')][_0xf87d('0x94')];return db[_0xf87d('0x95')][_0xf87d('0x60')]({'where':_0x30400e})['then'](function(_0x204d61){if(_0x204d61){return[_0x204d61,![]];}_0x4f92de[_0xf87d('0x94')]=_0x5233df[_0xf87d('0x62')]['threadId'];_0x4f92de[_0xf87d('0x96')]=_0x5233df['body']['externalUrl'];return db[_0xf87d('0x95')][_0xf87d('0x61')](_0x4f92de)[_0xf87d('0x3d')](function(_0x14a5c7){return[_0x14a5c7,!![]];});});}else{_0x30400e[_0xf87d('0x94')]=null;}_0x30400e['ContactId']=_0x31ac28['id'];return db[_0xf87d('0x95')]['find']({'where':_0x30400e})[_0xf87d('0x3d')](function(_0x5e5e25){if(_0x5e5e25){return[_0x5e5e25,![]];}return db[_0xf87d('0x95')][_0xf87d('0x61')](_0x4f92de)[_0xf87d('0x3d')](function(_0x4e6f04){return[_0x4e6f04,!![]];});});}})[_0xf87d('0x97')](function(_0x415740,_0x55ba71){if(_0x415740){_0x42dbed=_0x55ba71;if(!_0x55ba71){var _0x15b482={'from':(_0x206d16[_0xf87d('0x98')]['firstName']||'')+'\x20'+(_0x206d16['contact']['lastName']||'')};if(_0x5233df[_0xf87d('0x62')][_0xf87d('0x94')]&&_0x5233df[_0xf87d('0x62')][_0xf87d('0x99')]&&_0x5233df[_0xf87d('0x62')][_0xf87d('0x94')]!=_0x5233df['body'][_0xf87d('0x99')]){_0x15b482[_0xf87d('0x94')]=_0x5233df[_0xf87d('0x62')][_0xf87d('0x99')];}return _0x415740[_0xf87d('0x3c')](_0x15b482);}else{return _0x415740;}}})['then'](function(_0x376ce2){_0x206d16[_0xf87d('0x9a')]=_0x376ce2[_0xf87d('0x65')]({'plain':!![]});_0x206d16[_0xf87d('0x9a')][_0xf87d('0x9b')]=_0x42dbed;if(_0x206d16[_0xf87d('0x9a')][_0xf87d('0x9b')]){if(_0x206d16['account']['autoclose']){_0x206d16[_0xf87d('0x8d')][_0xf87d('0x9c')]({'id':0x0,'priority':_0x206d16['applications'][_0xf87d('0x51')]+0x1,'app':_0xf87d('0x9d'),'appdata':_0xf87d('0x9e'),'interval':_0xf87d('0x9f')});}}return db[_0xf87d('0xa0')][_0xf87d('0x61')]({'body':_0x5233df['body']['body'],'OpenchannelAccountId':_0x5233df[_0xf87d('0x5e')]['id'],'OpenchannelInteractionId':_0x376ce2['id'],'direction':'in','ContactId':_0x206d16['contact']['id'],'AttachmentId':_0x5233df['body']['AttachmentId']});})['then'](function(_0x3dec57){_0x206d16[_0xf87d('0x2d')]=_0x3dec57;if(_0x206d16[_0xf87d('0x9a')][_0xf87d('0xa1')]){return db[_0xf87d('0xa2')][_0xf87d('0x60')]({'attributes':['id',_0xf87d('0x42')],'where':{'id':_0x206d16[_0xf87d('0x9a')][_0xf87d('0xa1')]}})[_0xf87d('0x3d')](function(_0x1f3074){if(_0x1f3074){_0x206d16[_0xf87d('0x8d')][_0xf87d('0xa3')]({'id':0x0,'priority':0x0,'app':_0xf87d('0xa4'),'appdata':_0x1f3074[_0xf87d('0x42')]+','+(_0x206d16[_0xf87d('0x8c')][_0xf87d('0xa5')]||0xa),'interval':_0xf87d('0x9f')});_0x206d16[_0xf87d('0xa6')]=![];}return respondWithRpcPromise(_0xf87d('0xa7'),_0xf87d('0xa8'),_0x206d16);});}return respondWithRpcPromise(_0xf87d('0xa7'),_0xf87d('0xa8'),_0x206d16);})[_0xf87d('0x3d')](function(_0x487a5a){respondWithRpcPromise('EventManager',_0xf87d('0xa9'),{'event':'notify','message':_0x487a5a},client9002);return _0x487a5a;})[_0xf87d('0x3d')](respondWithResult(_0x1c47c5,null))[_0xf87d('0x2f')](handleError(_0x1c47c5,null));};exports[_0xf87d('0xaa')]=function(_0x539273,_0x4e3623){var _0x230bc4=_0x539273[_0xf87d('0x5e')]['id'];var _0x54cda2=_0x539273['body'];var _0x13629d=0xc8;var _0x50e24f=null;return db[_0xf87d('0xab')][_0xf87d('0xac')]({'isolationLevel':db['sequelize'][_0xf87d('0xad')]['ISOLATION_LEVELS'][_0xf87d('0xae')]},function(_0x475f6a){return db[_0xf87d('0x47')][_0xf87d('0x6a')]({'where':{'id':_0x230bc4},'transaction':_0x475f6a})[_0xf87d('0x3d')](function(_0x2c6d5e){if(_0x2c6d5e){return db[_0xf87d('0x8a')][_0xf87d('0x40')]({'where':{'OpenchannelAccountId':_0x230bc4},'transaction':_0x475f6a})['then'](function(){var _0x2d4375=_[_0xf87d('0x46')](_0x54cda2,function(_0x29e839){_0x29e839[_0xf87d('0x6c')]=_0x230bc4;return _0x29e839;});return db[_0xf87d('0x8a')][_0xf87d('0xaf')](_0x2d4375,{'transaction':_0x475f6a});});}else{_0x13629d=0x194;_0x50e24f=[];}});})[_0xf87d('0x3d')](function(){if(_0x13629d!==0x194){return db[_0xf87d('0x8a')][_0xf87d('0xb0')]({'where':{'OpenchannelAccountId':_0x230bc4},'order':'priority'})[_0xf87d('0x3d')](function(_0x30e896){_0x50e24f=_0x30e896;});}})[_0xf87d('0x2f')](function(_0x32ed0d){_0x13629d=0x1f4;logger['error'](_0x32ed0d[_0xf87d('0x41')]);if(_0x32ed0d['name']){delete _0x32ed0d[_0xf87d('0x42')];}_0x50e24f=_0x32ed0d;})[_0xf87d('0xb1')](function(){if(_0x50e24f===null){_0x4e3623[_0xf87d('0x30')](_0x13629d);}else{if(_0x13629d===0x1f4){_0x4e3623[_0xf87d('0x32')](_0x13629d)['send'](_0x50e24f);}else{_0x4e3623[_0xf87d('0x32')](_0x13629d)[_0xf87d('0x33')](_0x50e24f);}}});};exports['getApplications']=function(_0x2e533a,_0x8b2320,_0x2bb14a){var _0x57a9cd={};var _0x5c888a={};var _0x2691e3;var _0x2fc541;return db[_0xf87d('0x47')][_0xf87d('0x6a')]({'where':{'id':_0x2e533a[_0xf87d('0x5e')]['id']}})[_0xf87d('0x3d')](handleEntityNotFound(_0x8b2320,null))['then'](function(_0x4e424c){if(_0x4e424c){_0x2691e3=_0x4e424c;_0x5c888a['model']=_[_0xf87d('0x5f')](db[_0xf87d('0x8a')][_0xf87d('0x48')]);_0x5c888a[_0xf87d('0x4c')]=_['keys'](_0x2e533a[_0xf87d('0x4c')]);_0x5c888a['filters']=_['intersection'](_0x5c888a['model'],_0x5c888a['query']);_0x57a9cd['attributes']=_[_0xf87d('0x4f')](_0x5c888a[_0xf87d('0x4b')],qs[_0xf87d('0x50')](_0x2e533a[_0xf87d('0x4c')]['fields']));_0x57a9cd['attributes']=_0x57a9cd[_0xf87d('0x4e')][_0xf87d('0x51')]?_0x57a9cd[_0xf87d('0x4e')]:_0x5c888a[_0xf87d('0x4b')];_0x57a9cd['order']=qs[_0xf87d('0x54')](_0x2e533a[_0xf87d('0x4c')][_0xf87d('0x54')]);_0x57a9cd['where']=qs[_0xf87d('0x4d')](_[_0xf87d('0x73')](_0x2e533a[_0xf87d('0x4c')],_0x5c888a[_0xf87d('0x4d')]));if(_0x2e533a['query'][_0xf87d('0x57')]){_0x57a9cd['where']=_[_0xf87d('0x56')](_0x57a9cd[_0xf87d('0x55')],{'$or':_['map'](_0x57a9cd['attributes'],function(_0x419292){var _0x318289={};_0x318289[_0x419292]={'$like':'%'+_0x2e533a[_0xf87d('0x4c')][_0xf87d('0x57')]+'%'};return _0x318289;})});}_0x57a9cd=_[_0xf87d('0x56')]({},_0x57a9cd,_0x2e533a[_0xf87d('0x58')]);return _0x2691e3[_0xf87d('0xb2')](_0x57a9cd);}})[_0xf87d('0x3d')](function(_0x9cf11b){if(_0x9cf11b){_0x2fc541=_0x9cf11b[_0xf87d('0x51')];if(!_0x2e533a[_0xf87d('0x4c')][_0xf87d('0x52')](_0xf87d('0x53'))){_0x57a9cd[_0xf87d('0x35')]=qs[_0xf87d('0x35')](_0x2e533a['query'][_0xf87d('0x35')]);_0x57a9cd[_0xf87d('0x34')]=qs[_0xf87d('0x34')](_0x2e533a[_0xf87d('0x4c')][_0xf87d('0x34')]);}return _0x2691e3['getApplications'](_0x57a9cd);}})[_0xf87d('0x3d')](function(_0x3b95ad){if(_0x3b95ad){return _0x3b95ad?{'count':_0x2fc541,'rows':_0x3b95ad}:null;}})[_0xf87d('0x3d')](respondWithResult(_0x8b2320,null))[_0xf87d('0x2f')](handleError(_0x8b2320,null));};exports[_0xf87d('0xb3')]=function(_0x1231b9,_0x404988,_0x3d3356){var _0x42763e={'raw':![],'where':{}};var _0x1f734b={};var _0x3ff8a1={'count':0x0,'rows':[]};return db[_0xf87d('0x47')][_0xf87d('0x6a')]({'where':{'id':_0x1231b9[_0xf87d('0x5e')]['id']}})[_0xf87d('0x3d')](handleEntityNotFound(_0x404988,null))[_0xf87d('0x3d')](function(_0x5aad61){if(_0x5aad61){_0x1f734b['model']=_[_0xf87d('0x5f')](db[_0xf87d('0x95')]['rawAttributes']);_0x1f734b[_0xf87d('0x4c')]=_[_0xf87d('0x5f')](_0x1231b9['query']);_0x1f734b['filters']=_[_0xf87d('0x4f')](_0x1f734b[_0xf87d('0x4b')],_0x1f734b[_0xf87d('0x4c')]);_0x42763e[_0xf87d('0x4e')]=_[_0xf87d('0x4f')](_0x1f734b[_0xf87d('0x4b')],qs[_0xf87d('0x50')](_0x1231b9[_0xf87d('0x4c')][_0xf87d('0x50')]));_0x42763e[_0xf87d('0x4e')]=_0x42763e[_0xf87d('0x4e')][_0xf87d('0x51')]?_0x42763e[_0xf87d('0x4e')]:_0x1f734b[_0xf87d('0x4b')];if(!_0x1231b9[_0xf87d('0x4c')]['hasOwnProperty'](_0xf87d('0x53'))){_0x42763e[_0xf87d('0x35')]=qs[_0xf87d('0x35')](_0x1231b9[_0xf87d('0x4c')]['limit']);_0x42763e[_0xf87d('0x34')]=qs[_0xf87d('0x34')](_0x1231b9[_0xf87d('0x4c')][_0xf87d('0x34')]);}_0x42763e[_0xf87d('0x6b')]=qs['sort'](_0x1231b9[_0xf87d('0x4c')][_0xf87d('0x54')]);_0x42763e['where']=qs[_0xf87d('0x4d')](_[_0xf87d('0x73')](_0x1231b9[_0xf87d('0x4c')],_0x1f734b[_0xf87d('0x4d')]));_0x42763e[_0xf87d('0x55')][_0xf87d('0x6c')]=_0x5aad61['id'];if(_0x1231b9[_0xf87d('0x4c')]['filter']){_0x42763e[_0xf87d('0x55')]=_[_0xf87d('0x56')](_0x42763e[_0xf87d('0x55')],{'$or':_['map'](_0x42763e[_0xf87d('0x4e')],function(_0x191e87){var _0x4ae3d6={};_0x4ae3d6[_0x191e87]={'$like':'%'+_0x1231b9[_0xf87d('0x4c')][_0xf87d('0x57')]+'%'};return _0x4ae3d6;})});}_0x42763e=_[_0xf87d('0x56')]({},_0x42763e,_0x1231b9[_0xf87d('0x58')]);return db[_0xf87d('0x95')][_0xf87d('0x37')]({'where':_0x42763e[_0xf87d('0x55')]})['then'](function(_0x5f1f9a){_0x3ff8a1[_0xf87d('0x37')]=_0x5f1f9a;if(_0x1231b9[_0xf87d('0x4c')]['includeAll']){_0x42763e[_0xf87d('0x5a')]=[{'model':db[_0xf87d('0x76')],'as':_0xf87d('0xb4'),'required':![]},{'model':db[_0xf87d('0xa2')],'as':_0xf87d('0xb5'),'attributes':[_0xf87d('0x42'),_0xf87d('0xb6'),_0xf87d('0xb7')],'required':![]},{'model':db[_0xf87d('0xb8')],'as':_0xf87d('0xb9'),'attributes':['id','name',_0xf87d('0xba')],'where':_0x1231b9['query'][_0xf87d('0xbb')]?{'id':_0x1231b9[_0xf87d('0x4c')]['tag']}:undefined,'required':_0x1231b9[_0xf87d('0x4c')][_0xf87d('0xbb')]?!![]:![]}];}return db['OpenchannelInteraction'][_0xf87d('0x5b')](_0x42763e);})[_0xf87d('0x3d')](function(_0x1b949d){_0x3ff8a1[_0xf87d('0x5c')]=_0x1b949d;return _0x3ff8a1;});}})['then'](respondWithFilteredResult(_0x404988,_0x42763e))['catch'](handleError(_0x404988,null));};exports[_0xf87d('0xbc')]=function(_0x1c2d12,_0x4c11f0,_0x58c003){return db['OpenchannelAccount']['find']({'where':{'id':_0x1c2d12['params']['id']}})[_0xf87d('0x3d')](handleEntityNotFound(_0x4c11f0,null))[_0xf87d('0x3d')](function(_0x450824){if(_0x450824){return _0x450824['addAgents'](_0x1c2d12[_0xf87d('0x62')]['ids'],_[_0xf87d('0xbd')](_0x1c2d12['body'],[_0xf87d('0x6f'),'id'])||{})[_0xf87d('0x97')](function(_0x19a94e){for(var _0x489662=0x0;_0x489662<_0x1c2d12['body'][_0xf87d('0x6f')][_0xf87d('0x51')];_0x489662+=0x1){socket[_0xf87d('0xbe')](_0xf87d('0xbf'),{'UserId':Number(_0x1c2d12[_0xf87d('0x62')][_0xf87d('0x6f')][_0x489662]),'OpenchannelAccountId':Number(_0x1c2d12[_0xf87d('0x5e')]['id'])});}return _0x19a94e;});}})['then'](respondWithResult(_0x4c11f0,null))['catch'](handleError(_0x4c11f0,null));};exports[_0xf87d('0xc0')]=function(_0x3cd394,_0x41c401,_0x20a803){return db[_0xf87d('0x47')]['find']({'where':{'id':_0x3cd394[_0xf87d('0x5e')]['id']}})[_0xf87d('0x3d')](handleEntityNotFound(_0x41c401,null))[_0xf87d('0x3d')](function(_0x2ead7a){if(_0x2ead7a){return _0x2ead7a[_0xf87d('0xc0')](_0x3cd394[_0xf87d('0x4c')][_0xf87d('0x6f')])['then'](function(){if(_[_0xf87d('0xc1')](_0x3cd394[_0xf87d('0x4c')][_0xf87d('0x6f')])){for(var _0x10e055=0x0;_0x10e055<_0x3cd394[_0xf87d('0x4c')][_0xf87d('0x6f')][_0xf87d('0x51')];_0x10e055+=0x1){socket[_0xf87d('0xbe')](_0xf87d('0xc2'),{'UserId':Number(_0x3cd394[_0xf87d('0x4c')][_0xf87d('0x6f')][_0x10e055]),'OpenchannelAccountId':Number(_0x3cd394[_0xf87d('0x5e')]['id'])});}}else{socket[_0xf87d('0xbe')](_0xf87d('0xc2'),{'UserId':Number(_0x3cd394['query'][_0xf87d('0x6f')]),'OpenchannelAccountId':Number(_0x3cd394[_0xf87d('0x5e')]['id'])});}});}})['then'](respondWithStatusCode(_0x41c401,null))['catch'](handleError(_0x41c401,null));};exports['getAgents']=function(_0x2fce40,_0x5ef64c,_0x22ec92){var _0x2ecd78={};var _0xa2f3c0={};var _0x4f9ad7;var _0x5a6422;return db['OpenchannelAccount'][_0xf87d('0x6a')]({'where':{'id':_0x2fce40[_0xf87d('0x5e')]['id']}})[_0xf87d('0x3d')](handleEntityNotFound(_0x5ef64c,null))[_0xf87d('0x3d')](function(_0x402299){if(_0x402299){_0x4f9ad7=_0x402299;_0xa2f3c0['model']=_[_0xf87d('0x5f')](db[_0xf87d('0xa2')]['rawAttributes']);_0xa2f3c0['query']=_[_0xf87d('0x5f')](_0x2fce40[_0xf87d('0x4c')]);_0xa2f3c0[_0xf87d('0x4d')]=_['intersection'](_0xa2f3c0[_0xf87d('0x4b')],_0xa2f3c0[_0xf87d('0x4c')]);_0x2ecd78[_0xf87d('0x4e')]=_['intersection'](_0xa2f3c0[_0xf87d('0x4b')],qs['fields'](_0x2fce40[_0xf87d('0x4c')][_0xf87d('0x50')]));_0x2ecd78[_0xf87d('0x4e')]=_0x2ecd78['attributes'][_0xf87d('0x51')]?_0x2ecd78[_0xf87d('0x4e')]:_0xa2f3c0[_0xf87d('0x4b')];_0x2ecd78['order']=qs[_0xf87d('0x54')](_0x2fce40[_0xf87d('0x4c')][_0xf87d('0x54')]);_0x2ecd78[_0xf87d('0x55')]=qs[_0xf87d('0x4d')](_[_0xf87d('0x73')](_0x2fce40['query'],_0xa2f3c0[_0xf87d('0x4d')]));if(_0x2fce40[_0xf87d('0x4c')][_0xf87d('0x57')]){_0x2ecd78['where']=_[_0xf87d('0x56')](_0x2ecd78[_0xf87d('0x55')],{'$or':_[_0xf87d('0x46')](_0x2ecd78[_0xf87d('0x4e')],function(_0x65bbf7){var _0x5e23e9={};_0x5e23e9[_0x65bbf7]={'$like':'%'+_0x2fce40[_0xf87d('0x4c')][_0xf87d('0x57')]+'%'};return _0x5e23e9;})});}_0x2ecd78=_[_0xf87d('0x56')]({},_0x2ecd78,_0x2fce40['options']);return _0x4f9ad7['getAgents'](_0x2ecd78);}})[_0xf87d('0x3d')](function(_0x5133c0){if(_0x5133c0){_0x5a6422=_0x5133c0['length'];if(!_0x2fce40[_0xf87d('0x4c')][_0xf87d('0x52')](_0xf87d('0x53'))){_0x2ecd78[_0xf87d('0x35')]=qs[_0xf87d('0x35')](_0x2fce40[_0xf87d('0x4c')][_0xf87d('0x35')]);_0x2ecd78[_0xf87d('0x34')]=qs['offset'](_0x2fce40[_0xf87d('0x4c')][_0xf87d('0x34')]);}return _0x4f9ad7[_0xf87d('0xc3')](_0x2ecd78);}})[_0xf87d('0x3d')](function(_0x241088){if(_0x241088){return _0x241088?{'count':_0x5a6422,'rows':_0x241088}:null;}})[_0xf87d('0x3d')](respondWithResult(_0x5ef64c,null))['catch'](handleError(_0x5ef64c,null));};exports[_0xf87d('0x43')]=function(_0x1b5014,_0x3f8342,_0x3c8614){var _0x1efe2e,_0xd38a24,_0x459848;if(_['isNil'](_0x1b5014['body'][_0xf87d('0x62')])||_0x1b5014['body'][_0xf87d('0x62')]===''){throw new db[(_0xf87d('0x78'))][(_0xf87d('0x79'))](_0xf87d('0xc4'));}if(_[_0xf87d('0x80')](_0x1b5014['body']['to'])){}_0x1efe2e=_0x1b5014[_0xf87d('0x62')]['to'];return db[_0xf87d('0x47')][_0xf87d('0x6a')]({'where':{'id':_0x1b5014[_0xf87d('0x5e')]['id']}})[_0xf87d('0x3d')](handleEntityNotFound(_0x3f8342,null))[_0xf87d('0x3d')](function(_0x979701){if(_0x979701){return db['OpenchannelAccount'][_0xf87d('0x60')]({'where':{'id':_0x979701['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0xf87d('0x76')],'as':'Contacts','where':{[_0x979701[_0xf87d('0x82')]]:_0x1efe2e},'limit':0x1,'order':[[_0xf87d('0x7d'),_0xf87d('0x89')]]}]}]})[_0xf87d('0x3d')](handleEntityNotFound(_0x3f8342,null))[_0xf87d('0x3d')](function(_0x5a5d24){if(_0x5a5d24&&_0x5a5d24[_0xf87d('0x88')]){_0xd38a24=_0x5a5d24[_0xf87d('0x65')]({'plain':!![]});if(_0xd38a24[_0xf87d('0x88')]&&_0xd38a24['List']['Contacts']['length']){return _0xd38a24['List'][_0xf87d('0x91')][0x0];}return db['CmContact'][_0xf87d('0x61')](_[_0xf87d('0x92')](_0x1b5014['body'],{'firstName':_0x1efe2e,[_0x5a5d24[_0xf87d('0x82')]]:_0x1efe2e,'phone':_0x1efe2e,'ListId':_0xd38a24['ListId']}));}})['then'](handleEntityNotFound(_0x3f8342,null))['then'](function(_0x19fe19){if(_0x19fe19){_0x459848=_0x19fe19;return db[_0xf87d('0x95')][_0xf87d('0x60')]({'where':{'ContactId':_0x459848['id'],'closed':![],'OpenchannelAccountId':_0xd38a24['id']}})[_0xf87d('0x3d')](function(_0x54d738){if(_0x54d738){return[_0x54d738,![]];}return db['OpenchannelInteraction'][_0xf87d('0x61')]({'UserId':_0x1b5014['user']['id'],'ContactId':_0x459848['id'],'OpenchannelAccountId':_0xd38a24['id'],'lastMsgDirection':_0xf87d('0xc5'),'firstMsgDirection':_0xf87d('0xc5'),'Messages':[_['merge'](_0x1b5014['body'],{'read':![],'body':_0x1b5014[_0xf87d('0x62')]['body'],'OpenchannelAccountId':_0xd38a24['id'],'UserId':_0x1b5014['user']['id'],'ContactId':_0x459848['id']})]},{'include':[{'model':db[_0xf87d('0xa0')],'as':'Messages'}]})[_0xf87d('0x3d')](function(_0x4679a0){return[_0x4679a0,!![]];});});}})['spread'](function(_0x2c23df,_0x4ee32c){if(_0x4ee32c){return _0x2c23df;}return db['OpenchannelMessage'][_0xf87d('0x61')](_[_0xf87d('0x56')](_0x1b5014[_0xf87d('0x62')],{'read':![],'body':_0x1b5014[_0xf87d('0x62')]['body'],'OpenchannelAccountId':_0xd38a24['id'],'OpenchannelInteractionId':_0x2c23df['id'],'UserId':_0x1b5014[_0xf87d('0x63')]['id'],'ContactId':_0x459848['id']}))[_0xf87d('0x3d')](function(_0x102e56){_0x2c23df[_0xf87d('0xc6')]['Messages']=[];_0x2c23df[_0xf87d('0xc6')][_0xf87d('0xc7')][_0xf87d('0x9c')](_0x102e56[_0xf87d('0xc6')]);return _0x2c23df;});});}})[_0xf87d('0x3d')](respondWithResult(_0x3f8342,null))[_0xf87d('0x2f')](handleError(_0x3f8342,null));}; \ No newline at end of file +var _0x0f69=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','defaults','localhost','socket.io-emitter','redis','./openchannelAccount.socket','jayson/promise','client','then','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','end','status','json','undefined','limit','count','offset','Content-Range','reject','save','update','destroy','get','OpenchannelAccounts','UserProfileResource','stack','name','send','index','mandatoryDispositionPause','map','rawAttributes','type','key','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','filter','merge','options','OpenchannelAccount','includeAll','include','findAll','rows','show','params','Pause','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','notify','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from','ValidationError','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','DESC','OpenchannelApplication','Applications','List','account','list','orderBy','applications','asc','contact','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','firstName','messageId','interaction','created','autoclose','push','close','unmanaged','AttachmentId','User','UserId','unshift','agent','*,*,*,*','Start','startRouting','EventManager','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','priority','finally','getApplications','getInteractions','Owner','internal','Tag','Tags','color','tag','addAgents','removeAgents','isArray','emit','userOpenchannelAccount:remove','getAgents','body\x20is\x20mandatory\x20and\x20not\x20empty','Contacts','out','OpenchannelMessage','Messages','dataValues','zip-dir','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis'];(function(_0x10a904,_0x2bf292){var _0x53815a=function(_0x2e6ce4){while(--_0x2e6ce4){_0x10a904['push'](_0x10a904['shift']());}};_0x53815a(++_0x2bf292);}(_0x0f69,0x173));var _0x90f6=function(_0x2283dc,_0x2fcfc5){_0x2283dc=_0x2283dc-0x0;var _0x16db90=_0x0f69[_0x2283dc];return _0x16db90;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x90f6('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x90f6('0x1'));var moment=require(_0x90f6('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x90f6('0x3'));var util=require(_0x90f6('0x4'));var path=require('path');var sox=require(_0x90f6('0x5'));var csv=require('to-csv');var ejs=require(_0x90f6('0x6'));var fs=require('fs');var fs_extra=require(_0x90f6('0x7'));var _=require(_0x90f6('0x8'));var squel=require(_0x90f6('0x9'));var crypto=require(_0x90f6('0xa'));var jsforce=require(_0x90f6('0xb'));var deskjs=require(_0x90f6('0xc'));var toCsv=require(_0x90f6('0xd'));var querystring=require(_0x90f6('0xe'));var Papa=require(_0x90f6('0xf'));var Redis=require(_0x90f6('0x10'));var authService=require(_0x90f6('0x11'));var qs=require(_0x90f6('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x90f6('0x13'));var logger=require(_0x90f6('0x14'))('api');var utils=require(_0x90f6('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x90f6('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x90f6('0x17')](config['redis'],{'host':_0x90f6('0x18'),'port':0x18eb});var socket=require(_0x90f6('0x19'))(new Redis(config[_0x90f6('0x1a')]));require(_0x90f6('0x1b'))['register'](socket);var jayson=require(_0x90f6('0x1c'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x90f6('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x85ba42,_0x16d692,_0x18ae4b,_0x2844bd){return new BPromise(function(_0x3b4d5d,_0x2ec3b0){var _0x2cb207=_0x2844bd||client;return _0x2cb207['request'](_0x85ba42,_0x18ae4b)[_0x90f6('0x1e')](function(_0x2898a8){logger['info'](_0x90f6('0x1f'),_0x16d692,_0x90f6('0x20'));logger[_0x90f6('0x21')](_0x90f6('0x22'),_0x16d692,_0x90f6('0x20'),JSON[_0x90f6('0x23')](_0x2898a8));if(_0x2898a8[_0x90f6('0x24')]){if(_0x2898a8['error'][_0x90f6('0x25')]===0x1f4){logger[_0x90f6('0x24')]('OpenchannelAccount,\x20%s,\x20%s',_0x16d692,_0x2898a8['error'][_0x90f6('0x26')]);return _0x2ec3b0(_0x2898a8['error']['message']);}logger[_0x90f6('0x24')]('OpenchannelAccount,\x20%s,\x20%s',_0x16d692,_0x2898a8[_0x90f6('0x24')][_0x90f6('0x26')]);return _0x3b4d5d(_0x2898a8[_0x90f6('0x24')][_0x90f6('0x26')]);}else{logger[_0x90f6('0x27')](_0x90f6('0x1f'),_0x16d692,'request\x20sent');_0x3b4d5d(_0x2898a8[_0x90f6('0x28')]['message']);}})[_0x90f6('0x29')](function(_0x1b22d5){logger[_0x90f6('0x24')](_0x90f6('0x1f'),_0x16d692,_0x1b22d5);_0x2ec3b0(_0x1b22d5);});});}function respondWithStatusCode(_0x2c52bb,_0x304441){_0x304441=_0x304441||0xcc;return function(_0x291b62){if(_0x291b62){return _0x2c52bb[_0x90f6('0x2a')](_0x304441);}return _0x2c52bb['status'](_0x304441)[_0x90f6('0x2b')]();};}function respondWithResult(_0x4b3f50,_0x4f7e54){_0x4f7e54=_0x4f7e54||0xc8;return function(_0x5b52fe){if(_0x5b52fe){return _0x4b3f50[_0x90f6('0x2c')](_0x4f7e54)[_0x90f6('0x2d')](_0x5b52fe);}};}function respondWithFilteredResult(_0x55b92f,_0x31f9cb){return function(_0x16a770){if(_0x16a770){var _0x1bff1e=typeof _0x31f9cb['offset']===_0x90f6('0x2e')&&typeof _0x31f9cb[_0x90f6('0x2f')]===_0x90f6('0x2e');var _0x1b2316=_0x16a770[_0x90f6('0x30')];var _0x290a0c=_0x1bff1e?0x0:_0x31f9cb[_0x90f6('0x31')];var _0x2c904c=_0x1bff1e?_0x16a770['count']:_0x31f9cb['offset']+_0x31f9cb['limit'];var _0x540390;if(_0x2c904c>=_0x1b2316){_0x2c904c=_0x1b2316;_0x540390=0xc8;}else{_0x540390=0xce;}_0x55b92f[_0x90f6('0x2c')](_0x540390);return _0x55b92f['set'](_0x90f6('0x32'),_0x290a0c+'-'+_0x2c904c+'/'+_0x1b2316)[_0x90f6('0x2d')](_0x16a770);}return null;};}function patchUpdates(_0x58e8b3){return function(_0x549f6d){try{jsonpatch['apply'](_0x549f6d,_0x58e8b3,!![]);}catch(_0xc264b6){return BPromise[_0x90f6('0x33')](_0xc264b6);}return _0x549f6d[_0x90f6('0x34')]();};}function saveUpdates(_0x250820,_0x1781c5){return function(_0xa21606){if(_0xa21606){return _0xa21606[_0x90f6('0x35')](_0x250820)['then'](function(_0x1ca495){return _0x1ca495;});}return null;};}function removeEntity(_0x208fc9,_0x13ea3c){return function(_0x402859){if(_0x402859){return _0x402859[_0x90f6('0x36')]()['then'](function(){var _0x2e5e22=_0x402859[_0x90f6('0x37')]({'plain':!![]});var _0xfb0c7e=_0x90f6('0x38');return db[_0x90f6('0x39')][_0x90f6('0x36')]({'where':{'type':_0xfb0c7e,'resourceId':_0x2e5e22['id']}})[_0x90f6('0x1e')](function(){return _0x402859;});})['then'](function(){_0x208fc9[_0x90f6('0x2c')](0xcc)[_0x90f6('0x2b')]();});}};}function handleEntityNotFound(_0x477346,_0x25624b){return function(_0x28d26e){if(!_0x28d26e){_0x477346[_0x90f6('0x2a')](0x194);}return _0x28d26e;};}function handleError(_0x14140d,_0x23588f){_0x23588f=_0x23588f||0x1f4;return function(_0x36cac5){logger[_0x90f6('0x24')](_0x36cac5[_0x90f6('0x3a')]);if(_0x36cac5[_0x90f6('0x3b')]){delete _0x36cac5[_0x90f6('0x3b')];}_0x14140d['status'](_0x23588f)[_0x90f6('0x3c')](_0x36cac5);};}exports[_0x90f6('0x3d')]=function(_0x2decc5,_0x3bcb39){var _0x2ab8e0={'include':[{'model':db['Pause'],'as':_0x90f6('0x3e')}]},_0x15beb9={},_0x5065f0={'count':0x0,'rows':[]};var _0x1b68b0=_[_0x90f6('0x3f')](db['OpenchannelAccount'][_0x90f6('0x40')],function(_0x27c2d3){return{'name':_0x27c2d3['fieldName'],'type':_0x27c2d3[_0x90f6('0x41')][_0x90f6('0x42')]};});_0x15beb9['model']=_['map'](_0x1b68b0,'name');_0x15beb9[_0x90f6('0x43')]=_['keys'](_0x2decc5['query']);_0x15beb9[_0x90f6('0x44')]=_[_0x90f6('0x45')](_0x15beb9['model'],_0x15beb9['query']);_0x2ab8e0[_0x90f6('0x46')]=_[_0x90f6('0x45')](_0x15beb9[_0x90f6('0x47')],qs[_0x90f6('0x48')](_0x2decc5[_0x90f6('0x43')][_0x90f6('0x48')]));_0x2ab8e0[_0x90f6('0x46')]=_0x2ab8e0[_0x90f6('0x46')][_0x90f6('0x49')]?_0x2ab8e0[_0x90f6('0x46')]:_0x15beb9[_0x90f6('0x47')];if(!_0x2decc5[_0x90f6('0x43')][_0x90f6('0x4a')](_0x90f6('0x4b'))){_0x2ab8e0[_0x90f6('0x2f')]=qs[_0x90f6('0x2f')](_0x2decc5[_0x90f6('0x43')]['limit']);_0x2ab8e0[_0x90f6('0x31')]=qs['offset'](_0x2decc5['query']['offset']);}_0x2ab8e0[_0x90f6('0x4c')]=qs[_0x90f6('0x4d')](_0x2decc5[_0x90f6('0x43')]['sort']);_0x2ab8e0['where']=qs[_0x90f6('0x44')](_[_0x90f6('0x4e')](_0x2decc5[_0x90f6('0x43')],_0x15beb9[_0x90f6('0x44')]),_0x1b68b0);if(_0x2decc5['query']['filter']){_0x2ab8e0[_0x90f6('0x4f')]=_['merge'](_0x2ab8e0['where'],{'$or':_[_0x90f6('0x3f')](_0x1b68b0,function(_0x68e135){if(_0x68e135['type']!==_0x90f6('0x50')){var _0x45e455={};_0x45e455[_0x68e135['name']]={'$like':'%'+_0x2decc5[_0x90f6('0x43')][_0x90f6('0x51')]+'%'};return _0x45e455;}})});}_0x2ab8e0=_[_0x90f6('0x52')]({},_0x2ab8e0,_0x2decc5[_0x90f6('0x53')]);var _0x34bae0={'where':_0x2ab8e0[_0x90f6('0x4f')]};return db[_0x90f6('0x54')][_0x90f6('0x30')](_0x34bae0)[_0x90f6('0x1e')](function(_0x258761){_0x5065f0[_0x90f6('0x30')]=_0x258761;if(_0x2decc5[_0x90f6('0x43')][_0x90f6('0x55')]){_0x2ab8e0[_0x90f6('0x56')]=[{'all':!![]}];}return db['OpenchannelAccount'][_0x90f6('0x57')](_0x2ab8e0);})[_0x90f6('0x1e')](function(_0x56c366){_0x5065f0[_0x90f6('0x58')]=_0x56c366;return _0x5065f0;})[_0x90f6('0x1e')](respondWithFilteredResult(_0x3bcb39,_0x2ab8e0))[_0x90f6('0x29')](handleError(_0x3bcb39,null));};exports[_0x90f6('0x59')]=function(_0x482b67,_0x57d5cf){var _0xa0e8bf={'raw':![],'where':{'id':_0x482b67[_0x90f6('0x5a')]['id']},'include':[{'model':db[_0x90f6('0x5b')],'as':_0x90f6('0x3e')}]},_0x210c26={};_0x210c26[_0x90f6('0x47')]=_[_0x90f6('0x5c')](db[_0x90f6('0x54')][_0x90f6('0x40')]);_0x210c26[_0x90f6('0x43')]=_['keys'](_0x482b67[_0x90f6('0x43')]);_0x210c26[_0x90f6('0x44')]=_['intersection'](_0x210c26[_0x90f6('0x47')],_0x210c26['query']);_0xa0e8bf[_0x90f6('0x46')]=_['intersection'](_0x210c26['model'],qs[_0x90f6('0x48')](_0x482b67['query']['fields']));_0xa0e8bf['attributes']=_0xa0e8bf[_0x90f6('0x46')][_0x90f6('0x49')]?_0xa0e8bf[_0x90f6('0x46')]:_0x210c26[_0x90f6('0x47')];if(_0x482b67[_0x90f6('0x43')][_0x90f6('0x55')]){_0xa0e8bf[_0x90f6('0x56')]=[{'all':!![]}];}_0xa0e8bf=_[_0x90f6('0x52')]({},_0xa0e8bf,_0x482b67[_0x90f6('0x53')]);return db[_0x90f6('0x54')][_0x90f6('0x5d')](_0xa0e8bf)[_0x90f6('0x1e')](handleEntityNotFound(_0x57d5cf,null))[_0x90f6('0x1e')](respondWithResult(_0x57d5cf,null))[_0x90f6('0x29')](handleError(_0x57d5cf,null));};exports[_0x90f6('0x5e')]=function(_0x356152,_0x58aa6b){return db['OpenchannelAccount'][_0x90f6('0x5e')](_0x356152[_0x90f6('0x5f')],{})[_0x90f6('0x1e')](function(_0x126de7){var _0x26bb97=_0x356152[_0x90f6('0x60')]['get']({'plain':!![]});if(!_0x26bb97)throw new Error(_0x90f6('0x61'));if(_0x26bb97['role']===_0x90f6('0x60')){var _0x578026=_0x126de7['get']({'plain':!![]});var _0x10d7d3=_0x90f6('0x38');return db[_0x90f6('0x62')][_0x90f6('0x5d')]({'where':{'name':_0x10d7d3,'userProfileId':_0x26bb97[_0x90f6('0x63')]},'raw':!![]})[_0x90f6('0x1e')](function(_0x336061){if(_0x336061&&_0x336061[_0x90f6('0x64')]===0x0){return db['UserProfileResource']['create']({'name':_0x578026['name'],'resourceId':_0x578026['id'],'type':_0x336061['name'],'sectionId':_0x336061['id']},{})['then'](function(){return _0x126de7;});}else{return _0x126de7;}})[_0x90f6('0x29')](function(_0x4a1d55){logger['error'](_0x90f6('0x65'),_0x4a1d55);throw _0x4a1d55;});}return _0x126de7;})[_0x90f6('0x1e')](respondWithResult(_0x58aa6b,0xc9))['catch'](handleError(_0x58aa6b,null));};exports['update']=function(_0x2de2f9,_0x178a8f){if(_0x2de2f9[_0x90f6('0x5f')]['id']){delete _0x2de2f9['body']['id'];}return db[_0x90f6('0x54')][_0x90f6('0x5d')]({'where':{'id':_0x2de2f9[_0x90f6('0x5a')]['id']},'include':[{'model':db[_0x90f6('0x5b')],'as':'mandatoryDispositionPause'}]})[_0x90f6('0x1e')](handleEntityNotFound(_0x178a8f,null))[_0x90f6('0x1e')](saveUpdates(_0x2de2f9[_0x90f6('0x5f')],null))['then'](respondWithResult(_0x178a8f,null))[_0x90f6('0x29')](handleError(_0x178a8f,null));};exports['destroy']=function(_0x33aff8,_0x3c3592){return db[_0x90f6('0x54')][_0x90f6('0x5d')]({'where':{'id':_0x33aff8[_0x90f6('0x5a')]['id']}})[_0x90f6('0x1e')](handleEntityNotFound(_0x3c3592,null))[_0x90f6('0x1e')](removeEntity(_0x3c3592,null))[_0x90f6('0x29')](handleError(_0x3c3592,null));};exports[_0x90f6('0x66')]=function(_0x264092,_0x3dc102){return db[_0x90f6('0x54')][_0x90f6('0x66')]()[_0x90f6('0x1e')](respondWithResult(_0x3dc102,null))[_0x90f6('0x29')](handleError(_0x3dc102,null));};exports[_0x90f6('0x67')]=function(_0x160599,_0x570304,_0x2a1c0c){if(_0x160599[_0x90f6('0x5f')]['id']){delete _0x160599[_0x90f6('0x5f')]['id'];}return db[_0x90f6('0x54')][_0x90f6('0x5d')]({'where':{'id':_0x160599[_0x90f6('0x5a')]['id']}})['then'](handleEntityNotFound(_0x570304,null))[_0x90f6('0x1e')](function(_0x5ff456){if(_0x5ff456){_0x160599[_0x90f6('0x5f')][_0x90f6('0x68')]=_0x5ff456['id'];return db[_0x90f6('0x69')]['create'](_0x160599['body']);}})[_0x90f6('0x1e')](respondWithResult(_0x570304,null))['catch'](handleError(_0x570304,null));};exports[_0x90f6('0x6a')]=function(_0x5733f2,_0x4dd7df,_0x5e78fa){var _0x2dc192={'raw':![],'where':{}};var _0x2fce32={};var _0x1476d3={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x90f6('0x6b')]({'where':{'id':_0x5733f2['params']['id']}})['then'](handleEntityNotFound(_0x4dd7df,null))[_0x90f6('0x1e')](function(_0x4273a3){if(_0x4273a3){_0x2fce32['model']=_[_0x90f6('0x5c')](db['Disposition'][_0x90f6('0x40')]);_0x2fce32['query']=_[_0x90f6('0x5c')](_0x5733f2[_0x90f6('0x43')]);_0x2fce32['filters']=_[_0x90f6('0x45')](_0x2fce32['model'],_0x2fce32[_0x90f6('0x43')]);_0x2dc192['attributes']=_[_0x90f6('0x45')](_0x2fce32[_0x90f6('0x47')],qs['fields'](_0x5733f2[_0x90f6('0x43')]['fields']));_0x2dc192['attributes']=_0x2dc192[_0x90f6('0x46')][_0x90f6('0x49')]?_0x2dc192[_0x90f6('0x46')]:_0x2fce32['model'];if(!_0x5733f2[_0x90f6('0x43')]['hasOwnProperty'](_0x90f6('0x4b'))){_0x2dc192['limit']=qs[_0x90f6('0x2f')](_0x5733f2[_0x90f6('0x43')][_0x90f6('0x2f')]);_0x2dc192[_0x90f6('0x31')]=qs['offset'](_0x5733f2[_0x90f6('0x43')][_0x90f6('0x31')]);}_0x2dc192['order']=qs['sort'](_0x5733f2[_0x90f6('0x43')][_0x90f6('0x4d')]);_0x2dc192[_0x90f6('0x4f')]=qs[_0x90f6('0x44')](_['pick'](_0x5733f2[_0x90f6('0x43')],_0x2fce32[_0x90f6('0x44')]));_0x2dc192[_0x90f6('0x4f')][_0x90f6('0x68')]=_0x4273a3['id'];if(_0x5733f2['query'][_0x90f6('0x51')]){_0x2dc192[_0x90f6('0x4f')]=_['merge'](_0x2dc192[_0x90f6('0x4f')],{'$or':_[_0x90f6('0x3f')](_0x2dc192[_0x90f6('0x46')],function(_0x1ad46d){var _0x43cddf={};_0x43cddf[_0x1ad46d]={'$like':'%'+_0x5733f2[_0x90f6('0x43')][_0x90f6('0x51')]+'%'};return _0x43cddf;})});}_0x2dc192=_[_0x90f6('0x52')]({},_0x2dc192,_0x5733f2[_0x90f6('0x53')]);return db['Disposition'][_0x90f6('0x30')]({'where':_0x2dc192[_0x90f6('0x4f')]})[_0x90f6('0x1e')](function(_0x220d85){_0x1476d3['count']=_0x220d85;if(_0x5733f2[_0x90f6('0x43')][_0x90f6('0x55')]){_0x2dc192['include']=[{'all':!![]}];}return db[_0x90f6('0x69')][_0x90f6('0x57')](_0x2dc192);})[_0x90f6('0x1e')](function(_0x578b35){_0x1476d3['rows']=_0x578b35;return _0x1476d3;});}})[_0x90f6('0x1e')](respondWithFilteredResult(_0x4dd7df,_0x2dc192))['catch'](handleError(_0x4dd7df,null));};exports[_0x90f6('0x6c')]=function(_0x1a5096,_0xa4aea9,_0x46e5aa){return db[_0x90f6('0x54')]['find']({'where':{'id':_0x1a5096[_0x90f6('0x5a')]['id']}})[_0x90f6('0x1e')](handleEntityNotFound(_0xa4aea9,null))['then'](function(_0x53f0b3){if(_0x53f0b3){return _0x53f0b3[_0x90f6('0x6c')](_0x1a5096[_0x90f6('0x43')][_0x90f6('0x6d')]);}})[_0x90f6('0x1e')](respondWithStatusCode(_0xa4aea9,null))[_0x90f6('0x29')](handleError(_0xa4aea9,null));};exports[_0x90f6('0x6e')]=function(_0x332da9,_0x31ea6f,_0x5ad1af){if(_0x332da9[_0x90f6('0x5f')]['id']){delete _0x332da9[_0x90f6('0x5f')]['id'];}return db[_0x90f6('0x54')]['find']({'where':{'id':_0x332da9[_0x90f6('0x5a')]['id']}})[_0x90f6('0x1e')](handleEntityNotFound(_0x31ea6f,null))['then'](function(_0x40140){if(_0x40140){_0x332da9[_0x90f6('0x5f')]['OpenchannelAccountId']=_0x40140['id'];return db['CannedAnswer'][_0x90f6('0x5e')](_0x332da9['body']);}})[_0x90f6('0x1e')](respondWithResult(_0x31ea6f,null))['catch'](handleError(_0x31ea6f,null));};exports[_0x90f6('0x6f')]=function(_0x47042a,_0x523e78,_0x33701f){var _0x50fe8d={'raw':![],'where':{}};var _0x32e24e={};var _0xa7e84f={'count':0x0,'rows':[]};return db[_0x90f6('0x54')][_0x90f6('0x6b')]({'where':{'id':_0x47042a[_0x90f6('0x5a')]['id']}})[_0x90f6('0x1e')](handleEntityNotFound(_0x523e78,null))['then'](function(_0x67b87b){if(_0x67b87b){_0x32e24e[_0x90f6('0x47')]=_[_0x90f6('0x5c')](db[_0x90f6('0x70')][_0x90f6('0x40')]);_0x32e24e[_0x90f6('0x43')]=_[_0x90f6('0x5c')](_0x47042a[_0x90f6('0x43')]);_0x32e24e[_0x90f6('0x44')]=_['intersection'](_0x32e24e['model'],_0x32e24e[_0x90f6('0x43')]);_0x50fe8d[_0x90f6('0x46')]=_[_0x90f6('0x45')](_0x32e24e['model'],qs[_0x90f6('0x48')](_0x47042a[_0x90f6('0x43')][_0x90f6('0x48')]));_0x50fe8d[_0x90f6('0x46')]=_0x50fe8d[_0x90f6('0x46')][_0x90f6('0x49')]?_0x50fe8d[_0x90f6('0x46')]:_0x32e24e[_0x90f6('0x47')];if(!_0x47042a['query'][_0x90f6('0x4a')](_0x90f6('0x4b'))){_0x50fe8d[_0x90f6('0x2f')]=qs[_0x90f6('0x2f')](_0x47042a[_0x90f6('0x43')][_0x90f6('0x2f')]);_0x50fe8d[_0x90f6('0x31')]=qs[_0x90f6('0x31')](_0x47042a['query'][_0x90f6('0x31')]);}_0x50fe8d['order']=qs['sort'](_0x47042a[_0x90f6('0x43')]['sort']);_0x50fe8d['where']=qs[_0x90f6('0x44')](_[_0x90f6('0x4e')](_0x47042a[_0x90f6('0x43')],_0x32e24e[_0x90f6('0x44')]));_0x50fe8d[_0x90f6('0x4f')]['OpenchannelAccountId']=_0x67b87b['id'];if(_0x47042a[_0x90f6('0x43')][_0x90f6('0x51')]){_0x50fe8d[_0x90f6('0x4f')]=_['merge'](_0x50fe8d['where'],{'$or':_[_0x90f6('0x3f')](_0x50fe8d[_0x90f6('0x46')],function(_0x426c44){var _0x233b67={};_0x233b67[_0x426c44]={'$like':'%'+_0x47042a[_0x90f6('0x43')]['filter']+'%'};return _0x233b67;})});}_0x50fe8d=_['merge']({},_0x50fe8d,_0x47042a['options']);return db[_0x90f6('0x70')]['count']({'where':_0x50fe8d[_0x90f6('0x4f')]})[_0x90f6('0x1e')](function(_0x571bed){_0xa7e84f[_0x90f6('0x30')]=_0x571bed;if(_0x47042a['query'][_0x90f6('0x55')]){_0x50fe8d[_0x90f6('0x56')]=[{'all':!![]}];}return db[_0x90f6('0x70')][_0x90f6('0x57')](_0x50fe8d);})[_0x90f6('0x1e')](function(_0x23a5a9){_0xa7e84f[_0x90f6('0x58')]=_0x23a5a9;return _0xa7e84f;});}})[_0x90f6('0x1e')](respondWithFilteredResult(_0x523e78,_0x50fe8d))['catch'](handleError(_0x523e78,null));};exports[_0x90f6('0x71')]=function(_0x2e0b5f,_0x11bfe0,_0x56fc8f){return db[_0x90f6('0x54')]['find']({'where':{'id':_0x2e0b5f['params']['id']}})[_0x90f6('0x1e')](handleEntityNotFound(_0x11bfe0,null))[_0x90f6('0x1e')](function(_0xe8094b){if(_0xe8094b){return _0xe8094b[_0x90f6('0x71')](_0x2e0b5f[_0x90f6('0x43')][_0x90f6('0x6d')]);}})[_0x90f6('0x1e')](respondWithStatusCode(_0x11bfe0,null))[_0x90f6('0x29')](handleError(_0x11bfe0,null));};exports[_0x90f6('0x72')]=function(_0x4e54be,_0x50ea21,_0x297692){var _0x2cfcac={'body':_0x4e54be['body'],'channel':'openchannel'};var _0x4350a2=[];var _0x21f703=[];var _0x163d7a={};var _0x5cff1b=![];return db[_0x90f6('0x73')][_0x90f6('0x66')]()[_0x90f6('0x1e')](function(_0x240710){if(!_0x240710){throw new db[(_0x90f6('0x74'))]['ValidationError'](_0x90f6('0x75'));}_0x4350a2=_[_0x90f6('0x76')](_['keys'](_0x240710),[_0x90f6('0x77'),_0x90f6('0x78')]);_0x21f703=_[_0x90f6('0x76')](_['keys'](_0x240710),['createdAt',_0x90f6('0x78'),_0x90f6('0x79'),_0x90f6('0x7a')]);if(_0x4e54be[_0x90f6('0x5f')]['id']){delete _0x4e54be[_0x90f6('0x5f')]['id'];}if(_[_0x90f6('0x7b')](_0x4e54be['body'][_0x90f6('0x7c')])){throw new db['Sequelize'][(_0x90f6('0x7d'))]('from\x20is\x20mandatory');}if(_[_0x90f6('0x7b')](_0x4e54be[_0x90f6('0x5f')][_0x90f6('0x5f')])||_0x4e54be['body'][_0x90f6('0x5f')]===''){throw new db[(_0x90f6('0x74'))][(_0x90f6('0x7d'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x90f6('0x7b')](_0x4e54be[_0x90f6('0x5f')][_0x90f6('0x7e')])){throw new db[(_0x90f6('0x74'))][(_0x90f6('0x7d'))](_0x90f6('0x7f')+_0x21f703);}if(!_[_0x90f6('0x80')](_0x21f703,_0x4e54be[_0x90f6('0x5f')][_0x90f6('0x7e')])){throw new db[(_0x90f6('0x74'))][(_0x90f6('0x7d'))](_0x90f6('0x81')+_0x21f703);}_0x163d7a[_0x4e54be['body'][_0x90f6('0x7e')]]=_0x4e54be[_0x90f6('0x5f')]['from'];})['then'](function(){return db[_0x90f6('0x54')][_0x90f6('0x5d')]({'where':{'id':_0x4e54be[_0x90f6('0x5a')]['id']},'include':[{'model':db[_0x90f6('0x82')],'as':'List','include':[{'model':db['CmContact'],'as':'Contacts','where':_0x163d7a,'limit':0x1,'order':[[_0x90f6('0x78'),_0x90f6('0x83')]]}]},{'model':db[_0x90f6('0x84')],'as':_0x90f6('0x85')}]});})[_0x90f6('0x1e')](handleEntityNotFound(_0x50ea21,null))[_0x90f6('0x1e')](function(_0x114dad){if(_0x114dad&&_0x114dad[_0x90f6('0x86')]){_0x2cfcac[_0x90f6('0x87')]=_0x114dad;_0x2cfcac['applications']=_0x114dad[_0x90f6('0x85')];_0x2cfcac[_0x90f6('0x88')]=_0x114dad[_0x90f6('0x86')];_0x2cfcac['applications']=_[_0x90f6('0x89')](_0x2cfcac[_0x90f6('0x8a')],['priority'],[_0x90f6('0x8b')]);if(_0x2cfcac[_0x90f6('0x87')][_0x90f6('0x85')]){delete _0x2cfcac[_0x90f6('0x87')]['Applications'];}if(_0x2cfcac[_0x90f6('0x87')][_0x90f6('0x86')]&&_0x2cfcac[_0x90f6('0x87')][_0x90f6('0x86')]['Contacts'][_0x90f6('0x49')]){return _0x2cfcac[_0x90f6('0x87')][_0x90f6('0x86')]['Contacts'][0x0];}var _0xabd8a7=_[_0x90f6('0x17')](_0x4e54be[_0x90f6('0x5f')],{'firstName':_0x4e54be[_0x90f6('0x5f')][_0x90f6('0x7c')],'ListId':_0x114dad[_0x90f6('0x7a')]});_0xabd8a7[_0x4e54be['body'][_0x90f6('0x7e')]]=_0x4e54be[_0x90f6('0x5f')][_0x90f6('0x7c')];return db[_0x90f6('0x73')]['create'](_0xabd8a7,{'fields':_0x4350a2,'raw':!![]});}})['then'](handleEntityNotFound(_0x50ea21,null))['then'](function(_0x30329e){_0x2cfcac[_0x90f6('0x8c')]=_0x30329e;if(_0x30329e){var _0x412d80={'ContactId':_0x30329e['id'],'OpenchannelAccountId':_0x4e54be[_0x90f6('0x5a')]['id'],'from':(_0x30329e['firstName']||'')+'\x20'+(_0x30329e[_0x90f6('0x8d')]||'')};var _0x1558cf={'OpenchannelAccountId':_0x4e54be['params']['id'],'closed':![]};if(_0x4e54be[_0x90f6('0x5f')]['threadId']){_0x1558cf[_0x90f6('0x8e')]=_0x4e54be['body'][_0x90f6('0x8e')];return db[_0x90f6('0x8f')][_0x90f6('0x5d')]({'where':_0x1558cf})['then'](function(_0x5acf59){if(_0x5acf59){return[_0x5acf59,![]];}_0x412d80[_0x90f6('0x8e')]=_0x4e54be['body']['threadId'];_0x412d80['externalUrl']=_0x4e54be[_0x90f6('0x5f')][_0x90f6('0x90')];return db[_0x90f6('0x8f')]['create'](_0x412d80)[_0x90f6('0x1e')](function(_0x323bd8){return[_0x323bd8,!![]];});});}else{_0x1558cf['threadId']=null;}_0x1558cf[_0x90f6('0x91')]=_0x30329e['id'];return db[_0x90f6('0x8f')]['find']({'where':_0x1558cf})[_0x90f6('0x1e')](function(_0x485ba4){if(_0x485ba4){return[_0x485ba4,![]];}return db['OpenchannelInteraction'][_0x90f6('0x5e')](_0x412d80)[_0x90f6('0x1e')](function(_0x55c220){return[_0x55c220,!![]];});});}})[_0x90f6('0x92')](function(_0x213c69,_0x388c1a){if(_0x213c69){_0x5cff1b=_0x388c1a;if(!_0x388c1a){var _0x334bbd={'from':(_0x2cfcac[_0x90f6('0x8c')][_0x90f6('0x93')]||'')+'\x20'+(_0x2cfcac[_0x90f6('0x8c')][_0x90f6('0x8d')]||'')};if(_0x4e54be[_0x90f6('0x5f')][_0x90f6('0x8e')]&&_0x4e54be['body'][_0x90f6('0x94')]&&_0x4e54be['body']['threadId']!=_0x4e54be[_0x90f6('0x5f')][_0x90f6('0x94')]){_0x334bbd[_0x90f6('0x8e')]=_0x4e54be[_0x90f6('0x5f')][_0x90f6('0x94')];}return _0x213c69[_0x90f6('0x35')](_0x334bbd);}else{return _0x213c69;}}})[_0x90f6('0x1e')](function(_0x5ee54f){_0x2cfcac[_0x90f6('0x95')]=_0x5ee54f['get']({'plain':!![]});_0x2cfcac[_0x90f6('0x95')][_0x90f6('0x96')]=_0x5cff1b;if(_0x2cfcac[_0x90f6('0x95')][_0x90f6('0x96')]){if(_0x2cfcac['account'][_0x90f6('0x97')]){_0x2cfcac['applications'][_0x90f6('0x98')]({'id':0x0,'priority':_0x2cfcac[_0x90f6('0x8a')][_0x90f6('0x49')]+0x1,'app':_0x90f6('0x99'),'appdata':_0x90f6('0x9a'),'interval':'*,*,*,*'});}}return db['OpenchannelMessage']['create']({'body':_0x4e54be[_0x90f6('0x5f')][_0x90f6('0x5f')],'OpenchannelAccountId':_0x4e54be[_0x90f6('0x5a')]['id'],'OpenchannelInteractionId':_0x5ee54f['id'],'direction':'in','ContactId':_0x2cfcac[_0x90f6('0x8c')]['id'],'AttachmentId':_0x4e54be[_0x90f6('0x5f')][_0x90f6('0x9b')]});})[_0x90f6('0x1e')](function(_0x5f356e){_0x2cfcac['message']=_0x5f356e;if(_0x2cfcac['interaction']['UserId']){return db[_0x90f6('0x9c')][_0x90f6('0x5d')]({'attributes':['id',_0x90f6('0x3b')],'where':{'id':_0x2cfcac[_0x90f6('0x95')][_0x90f6('0x9d')]}})[_0x90f6('0x1e')](function(_0x30c01d){if(_0x30c01d){_0x2cfcac['applications'][_0x90f6('0x9e')]({'id':0x0,'priority':0x0,'app':_0x90f6('0x9f'),'appdata':_0x30c01d[_0x90f6('0x3b')]+','+(_0x2cfcac[_0x90f6('0x87')]['waitForTheAssignedAgent']||0xa),'interval':_0x90f6('0xa0')});_0x2cfcac['forcedOwnership']=![];}return respondWithRpcPromise('Start','startRouting',_0x2cfcac);});}return respondWithRpcPromise(_0x90f6('0xa1'),_0x90f6('0xa2'),_0x2cfcac);})['then'](function(_0x1dcb67){respondWithRpcPromise(_0x90f6('0xa3'),'EventManager',{'event':_0x90f6('0x72'),'message':_0x1dcb67},client9002);return _0x1dcb67;})[_0x90f6('0x1e')](respondWithResult(_0x50ea21,null))['catch'](handleError(_0x50ea21,null));};exports[_0x90f6('0xa4')]=function(_0x2622ab,_0x1c76eb){var _0x2831cb=_0x2622ab[_0x90f6('0x5a')]['id'];var _0x692591=_0x2622ab['body'];var _0x1c96f6=0xc8;var _0x54980d=null;return db[_0x90f6('0xa5')][_0x90f6('0xa6')]({'isolationLevel':db[_0x90f6('0xa5')][_0x90f6('0xa7')][_0x90f6('0xa8')][_0x90f6('0xa9')]},function(_0x5ade8d){return db[_0x90f6('0x54')][_0x90f6('0x6b')]({'where':{'id':_0x2831cb},'transaction':_0x5ade8d})['then'](function(_0x148ff3){if(_0x148ff3){return db['OpenchannelApplication']['destroy']({'where':{'OpenchannelAccountId':_0x2831cb},'transaction':_0x5ade8d})['then'](function(){var _0x552fd6=_[_0x90f6('0x3f')](_0x692591,function(_0x361993){_0x361993[_0x90f6('0x68')]=_0x2831cb;return _0x361993;});return db[_0x90f6('0x84')][_0x90f6('0xaa')](_0x552fd6,{'transaction':_0x5ade8d});});}else{_0x1c96f6=0x194;_0x54980d=[];}});})[_0x90f6('0x1e')](function(){if(_0x1c96f6!==0x194){return db[_0x90f6('0x84')][_0x90f6('0xab')]({'where':{'OpenchannelAccountId':_0x2831cb},'order':_0x90f6('0xac')})[_0x90f6('0x1e')](function(_0x12aed7){_0x54980d=_0x12aed7;});}})[_0x90f6('0x29')](function(_0x5f56e3){_0x1c96f6=0x1f4;logger[_0x90f6('0x24')](_0x5f56e3[_0x90f6('0x3a')]);if(_0x5f56e3[_0x90f6('0x3b')]){delete _0x5f56e3[_0x90f6('0x3b')];}_0x54980d=_0x5f56e3;})[_0x90f6('0xad')](function(){if(_0x54980d===null){_0x1c76eb[_0x90f6('0x2a')](_0x1c96f6);}else{if(_0x1c96f6===0x1f4){_0x1c76eb[_0x90f6('0x2c')](_0x1c96f6)[_0x90f6('0x3c')](_0x54980d);}else{_0x1c76eb[_0x90f6('0x2c')](_0x1c96f6)['json'](_0x54980d);}}});};exports[_0x90f6('0xae')]=function(_0x24073e,_0x4ca199,_0x108e2d){var _0x1cf3b1={};var _0x8cac1c={};var _0x593f09;var _0x3c00e0;return db['OpenchannelAccount'][_0x90f6('0x6b')]({'where':{'id':_0x24073e['params']['id']}})[_0x90f6('0x1e')](handleEntityNotFound(_0x4ca199,null))[_0x90f6('0x1e')](function(_0x5390c8){if(_0x5390c8){_0x593f09=_0x5390c8;_0x8cac1c[_0x90f6('0x47')]=_[_0x90f6('0x5c')](db[_0x90f6('0x84')][_0x90f6('0x40')]);_0x8cac1c[_0x90f6('0x43')]=_[_0x90f6('0x5c')](_0x24073e['query']);_0x8cac1c[_0x90f6('0x44')]=_[_0x90f6('0x45')](_0x8cac1c[_0x90f6('0x47')],_0x8cac1c[_0x90f6('0x43')]);_0x1cf3b1[_0x90f6('0x46')]=_[_0x90f6('0x45')](_0x8cac1c[_0x90f6('0x47')],qs[_0x90f6('0x48')](_0x24073e['query'][_0x90f6('0x48')]));_0x1cf3b1[_0x90f6('0x46')]=_0x1cf3b1[_0x90f6('0x46')][_0x90f6('0x49')]?_0x1cf3b1[_0x90f6('0x46')]:_0x8cac1c['model'];_0x1cf3b1[_0x90f6('0x4c')]=qs[_0x90f6('0x4d')](_0x24073e['query'][_0x90f6('0x4d')]);_0x1cf3b1[_0x90f6('0x4f')]=qs[_0x90f6('0x44')](_[_0x90f6('0x4e')](_0x24073e[_0x90f6('0x43')],_0x8cac1c[_0x90f6('0x44')]));if(_0x24073e[_0x90f6('0x43')][_0x90f6('0x51')]){_0x1cf3b1['where']=_[_0x90f6('0x52')](_0x1cf3b1[_0x90f6('0x4f')],{'$or':_[_0x90f6('0x3f')](_0x1cf3b1[_0x90f6('0x46')],function(_0x1fc7ce){var _0x5cf4d0={};_0x5cf4d0[_0x1fc7ce]={'$like':'%'+_0x24073e[_0x90f6('0x43')]['filter']+'%'};return _0x5cf4d0;})});}_0x1cf3b1=_[_0x90f6('0x52')]({},_0x1cf3b1,_0x24073e[_0x90f6('0x53')]);return _0x593f09['getApplications'](_0x1cf3b1);}})[_0x90f6('0x1e')](function(_0x6c4f46){if(_0x6c4f46){_0x3c00e0=_0x6c4f46[_0x90f6('0x49')];if(!_0x24073e[_0x90f6('0x43')]['hasOwnProperty']('nolimit')){_0x1cf3b1['limit']=qs[_0x90f6('0x2f')](_0x24073e[_0x90f6('0x43')][_0x90f6('0x2f')]);_0x1cf3b1[_0x90f6('0x31')]=qs[_0x90f6('0x31')](_0x24073e['query'][_0x90f6('0x31')]);}return _0x593f09[_0x90f6('0xae')](_0x1cf3b1);}})[_0x90f6('0x1e')](function(_0x308be6){if(_0x308be6){return _0x308be6?{'count':_0x3c00e0,'rows':_0x308be6}:null;}})['then'](respondWithResult(_0x4ca199,null))[_0x90f6('0x29')](handleError(_0x4ca199,null));};exports[_0x90f6('0xaf')]=function(_0xc58038,_0x4ec3bd,_0x44091f){var _0x3f3dd9={'raw':![],'where':{}};var _0x2f8b5a={};var _0x3b015f={'count':0x0,'rows':[]};return db[_0x90f6('0x54')]['findOne']({'where':{'id':_0xc58038[_0x90f6('0x5a')]['id']}})[_0x90f6('0x1e')](handleEntityNotFound(_0x4ec3bd,null))[_0x90f6('0x1e')](function(_0xef34ed){if(_0xef34ed){_0x2f8b5a['model']=_[_0x90f6('0x5c')](db[_0x90f6('0x8f')][_0x90f6('0x40')]);_0x2f8b5a[_0x90f6('0x43')]=_[_0x90f6('0x5c')](_0xc58038[_0x90f6('0x43')]);_0x2f8b5a['filters']=_[_0x90f6('0x45')](_0x2f8b5a[_0x90f6('0x47')],_0x2f8b5a[_0x90f6('0x43')]);_0x3f3dd9[_0x90f6('0x46')]=_[_0x90f6('0x45')](_0x2f8b5a['model'],qs[_0x90f6('0x48')](_0xc58038['query'][_0x90f6('0x48')]));_0x3f3dd9[_0x90f6('0x46')]=_0x3f3dd9['attributes'][_0x90f6('0x49')]?_0x3f3dd9[_0x90f6('0x46')]:_0x2f8b5a[_0x90f6('0x47')];if(!_0xc58038[_0x90f6('0x43')][_0x90f6('0x4a')]('nolimit')){_0x3f3dd9['limit']=qs[_0x90f6('0x2f')](_0xc58038[_0x90f6('0x43')][_0x90f6('0x2f')]);_0x3f3dd9[_0x90f6('0x31')]=qs[_0x90f6('0x31')](_0xc58038['query'][_0x90f6('0x31')]);}_0x3f3dd9['order']=qs[_0x90f6('0x4d')](_0xc58038[_0x90f6('0x43')][_0x90f6('0x4d')]);_0x3f3dd9[_0x90f6('0x4f')]=qs[_0x90f6('0x44')](_[_0x90f6('0x4e')](_0xc58038[_0x90f6('0x43')],_0x2f8b5a[_0x90f6('0x44')]));_0x3f3dd9[_0x90f6('0x4f')][_0x90f6('0x68')]=_0xef34ed['id'];if(_0xc58038[_0x90f6('0x43')]['filter']){_0x3f3dd9[_0x90f6('0x4f')]=_[_0x90f6('0x52')](_0x3f3dd9[_0x90f6('0x4f')],{'$or':_[_0x90f6('0x3f')](_0x3f3dd9['attributes'],function(_0xeca114){var _0x127065={};_0x127065[_0xeca114]={'$like':'%'+_0xc58038[_0x90f6('0x43')][_0x90f6('0x51')]+'%'};return _0x127065;})});}_0x3f3dd9=_[_0x90f6('0x52')]({},_0x3f3dd9,_0xc58038[_0x90f6('0x53')]);return db['OpenchannelInteraction']['count']({'where':_0x3f3dd9[_0x90f6('0x4f')]})[_0x90f6('0x1e')](function(_0x32785b){_0x3b015f[_0x90f6('0x30')]=_0x32785b;if(_0xc58038[_0x90f6('0x43')][_0x90f6('0x55')]){_0x3f3dd9['include']=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x90f6('0x9c')],'as':_0x90f6('0xb0'),'attributes':[_0x90f6('0x3b'),'fullname',_0x90f6('0xb1')],'required':![]},{'model':db[_0x90f6('0xb2')],'as':_0x90f6('0xb3'),'attributes':['id',_0x90f6('0x3b'),_0x90f6('0xb4')],'where':_0xc58038[_0x90f6('0x43')][_0x90f6('0xb5')]?{'id':_0xc58038['query'][_0x90f6('0xb5')]}:undefined,'required':_0xc58038[_0x90f6('0x43')][_0x90f6('0xb5')]?!![]:![]}];}return db[_0x90f6('0x8f')][_0x90f6('0x57')](_0x3f3dd9);})['then'](function(_0x4e261c){_0x3b015f[_0x90f6('0x58')]=_0x4e261c;return _0x3b015f;});}})['then'](respondWithFilteredResult(_0x4ec3bd,_0x3f3dd9))[_0x90f6('0x29')](handleError(_0x4ec3bd,null));};exports[_0x90f6('0xb6')]=function(_0x2a6c48,_0x534350,_0x3aff7d){return db[_0x90f6('0x54')][_0x90f6('0x5d')]({'where':{'id':_0x2a6c48[_0x90f6('0x5a')]['id']}})['then'](handleEntityNotFound(_0x534350,null))[_0x90f6('0x1e')](function(_0x1dbd47){if(_0x1dbd47){return _0x1dbd47[_0x90f6('0xb6')](_0x2a6c48[_0x90f6('0x5f')][_0x90f6('0x6d')],_['omit'](_0x2a6c48[_0x90f6('0x5f')],[_0x90f6('0x6d'),'id'])||{})[_0x90f6('0x92')](function(_0x23f481){for(var _0x456826=0x0;_0x456826<_0x2a6c48[_0x90f6('0x5f')][_0x90f6('0x6d')][_0x90f6('0x49')];_0x456826+=0x1){socket['emit']('userOpenchannelAccount:save',{'UserId':Number(_0x2a6c48[_0x90f6('0x5f')]['ids'][_0x456826]),'OpenchannelAccountId':Number(_0x2a6c48[_0x90f6('0x5a')]['id'])});}return _0x23f481;});}})['then'](respondWithResult(_0x534350,null))[_0x90f6('0x29')](handleError(_0x534350,null));};exports['removeAgents']=function(_0x64c550,_0x2402f9,_0x8243c5){return db[_0x90f6('0x54')][_0x90f6('0x5d')]({'where':{'id':_0x64c550[_0x90f6('0x5a')]['id']}})['then'](handleEntityNotFound(_0x2402f9,null))[_0x90f6('0x1e')](function(_0x87032b){if(_0x87032b){return _0x87032b[_0x90f6('0xb7')](_0x64c550[_0x90f6('0x43')][_0x90f6('0x6d')])[_0x90f6('0x1e')](function(){if(_[_0x90f6('0xb8')](_0x64c550[_0x90f6('0x43')][_0x90f6('0x6d')])){for(var _0x3a49be=0x0;_0x3a49be<_0x64c550[_0x90f6('0x43')]['ids'][_0x90f6('0x49')];_0x3a49be+=0x1){socket[_0x90f6('0xb9')](_0x90f6('0xba'),{'UserId':Number(_0x64c550[_0x90f6('0x43')][_0x90f6('0x6d')][_0x3a49be]),'OpenchannelAccountId':Number(_0x64c550[_0x90f6('0x5a')]['id'])});}}else{socket[_0x90f6('0xb9')](_0x90f6('0xba'),{'UserId':Number(_0x64c550[_0x90f6('0x43')]['ids']),'OpenchannelAccountId':Number(_0x64c550[_0x90f6('0x5a')]['id'])});}});}})['then'](respondWithStatusCode(_0x2402f9,null))[_0x90f6('0x29')](handleError(_0x2402f9,null));};exports[_0x90f6('0xbb')]=function(_0x4f4e5b,_0x1962ca,_0x28a761){var _0x390a68={};var _0x4d8d2c={};var _0x2dbadc;var _0x14f7f3;return db[_0x90f6('0x54')]['findOne']({'where':{'id':_0x4f4e5b[_0x90f6('0x5a')]['id']}})['then'](handleEntityNotFound(_0x1962ca,null))[_0x90f6('0x1e')](function(_0x3d9617){if(_0x3d9617){_0x2dbadc=_0x3d9617;_0x4d8d2c[_0x90f6('0x47')]=_[_0x90f6('0x5c')](db[_0x90f6('0x9c')][_0x90f6('0x40')]);_0x4d8d2c[_0x90f6('0x43')]=_[_0x90f6('0x5c')](_0x4f4e5b[_0x90f6('0x43')]);_0x4d8d2c['filters']=_[_0x90f6('0x45')](_0x4d8d2c[_0x90f6('0x47')],_0x4d8d2c[_0x90f6('0x43')]);_0x390a68[_0x90f6('0x46')]=_[_0x90f6('0x45')](_0x4d8d2c['model'],qs['fields'](_0x4f4e5b[_0x90f6('0x43')][_0x90f6('0x48')]));_0x390a68['attributes']=_0x390a68['attributes'][_0x90f6('0x49')]?_0x390a68['attributes']:_0x4d8d2c[_0x90f6('0x47')];_0x390a68['order']=qs['sort'](_0x4f4e5b[_0x90f6('0x43')][_0x90f6('0x4d')]);_0x390a68[_0x90f6('0x4f')]=qs[_0x90f6('0x44')](_[_0x90f6('0x4e')](_0x4f4e5b[_0x90f6('0x43')],_0x4d8d2c[_0x90f6('0x44')]));if(_0x4f4e5b[_0x90f6('0x43')][_0x90f6('0x51')]){_0x390a68[_0x90f6('0x4f')]=_[_0x90f6('0x52')](_0x390a68[_0x90f6('0x4f')],{'$or':_['map'](_0x390a68['attributes'],function(_0x4d91af){var _0x2ab7c6={};_0x2ab7c6[_0x4d91af]={'$like':'%'+_0x4f4e5b[_0x90f6('0x43')][_0x90f6('0x51')]+'%'};return _0x2ab7c6;})});}_0x390a68=_['merge']({},_0x390a68,_0x4f4e5b[_0x90f6('0x53')]);return _0x2dbadc[_0x90f6('0xbb')](_0x390a68);}})[_0x90f6('0x1e')](function(_0x5153e9){if(_0x5153e9){_0x14f7f3=_0x5153e9['length'];if(!_0x4f4e5b['query'][_0x90f6('0x4a')](_0x90f6('0x4b'))){_0x390a68[_0x90f6('0x2f')]=qs['limit'](_0x4f4e5b[_0x90f6('0x43')]['limit']);_0x390a68[_0x90f6('0x31')]=qs['offset'](_0x4f4e5b[_0x90f6('0x43')][_0x90f6('0x31')]);}return _0x2dbadc[_0x90f6('0xbb')](_0x390a68);}})[_0x90f6('0x1e')](function(_0x1760f2){if(_0x1760f2){return _0x1760f2?{'count':_0x14f7f3,'rows':_0x1760f2}:null;}})['then'](respondWithResult(_0x1962ca,null))['catch'](handleError(_0x1962ca,null));};exports[_0x90f6('0x3c')]=function(_0x264915,_0x5d15a5,_0x3871f1){var _0x3fba55,_0x510b97,_0x10b0fe;if(_[_0x90f6('0x7b')](_0x264915[_0x90f6('0x5f')][_0x90f6('0x5f')])||_0x264915[_0x90f6('0x5f')][_0x90f6('0x5f')]===''){throw new db[(_0x90f6('0x74'))][(_0x90f6('0x7d'))](_0x90f6('0xbc'));}if(_['isNil'](_0x264915[_0x90f6('0x5f')]['to'])){}_0x3fba55=_0x264915[_0x90f6('0x5f')]['to'];return db[_0x90f6('0x54')][_0x90f6('0x6b')]({'where':{'id':_0x264915[_0x90f6('0x5a')]['id']}})[_0x90f6('0x1e')](handleEntityNotFound(_0x5d15a5,null))['then'](function(_0xf3349e){if(_0xf3349e){return db[_0x90f6('0x54')][_0x90f6('0x5d')]({'where':{'id':_0xf3349e['id']},'include':[{'model':db[_0x90f6('0x82')],'as':_0x90f6('0x86'),'include':[{'model':db[_0x90f6('0x73')],'as':_0x90f6('0xbd'),'where':{[_0xf3349e[_0x90f6('0x7e')]]:_0x3fba55},'limit':0x1,'order':[[_0x90f6('0x78'),_0x90f6('0x83')]]}]}]})[_0x90f6('0x1e')](handleEntityNotFound(_0x5d15a5,null))[_0x90f6('0x1e')](function(_0x4a696e){if(_0x4a696e&&_0x4a696e[_0x90f6('0x86')]){_0x510b97=_0x4a696e[_0x90f6('0x37')]({'plain':!![]});if(_0x510b97[_0x90f6('0x86')]&&_0x510b97[_0x90f6('0x86')]['Contacts'][_0x90f6('0x49')]){return _0x510b97[_0x90f6('0x86')]['Contacts'][0x0];}return db[_0x90f6('0x73')]['create'](_['defaults'](_0x264915[_0x90f6('0x5f')],{'firstName':_0x3fba55,[_0x4a696e[_0x90f6('0x7e')]]:_0x3fba55,'phone':_0x3fba55,'ListId':_0x510b97[_0x90f6('0x7a')]}));}})[_0x90f6('0x1e')](handleEntityNotFound(_0x5d15a5,null))[_0x90f6('0x1e')](function(_0x3746b8){if(_0x3746b8){_0x10b0fe=_0x3746b8;return db[_0x90f6('0x8f')][_0x90f6('0x5d')]({'where':{'ContactId':_0x10b0fe['id'],'closed':![],'OpenchannelAccountId':_0x510b97['id']}})[_0x90f6('0x1e')](function(_0x1b526b){if(_0x1b526b){return[_0x1b526b,![]];}return db[_0x90f6('0x8f')]['create']({'UserId':_0x264915['user']['id'],'ContactId':_0x10b0fe['id'],'OpenchannelAccountId':_0x510b97['id'],'lastMsgDirection':_0x90f6('0xbe'),'firstMsgDirection':_0x90f6('0xbe'),'Messages':[_['merge'](_0x264915[_0x90f6('0x5f')],{'read':![],'body':_0x264915[_0x90f6('0x5f')][_0x90f6('0x5f')],'OpenchannelAccountId':_0x510b97['id'],'UserId':_0x264915[_0x90f6('0x60')]['id'],'ContactId':_0x10b0fe['id']})]},{'include':[{'model':db[_0x90f6('0xbf')],'as':_0x90f6('0xc0')}]})[_0x90f6('0x1e')](function(_0x1d830f){return[_0x1d830f,!![]];});});}})[_0x90f6('0x92')](function(_0x4a13fb,_0x12a3b6){if(_0x12a3b6){return _0x4a13fb;}return db[_0x90f6('0xbf')][_0x90f6('0x5e')](_['merge'](_0x264915[_0x90f6('0x5f')],{'read':![],'body':_0x264915[_0x90f6('0x5f')][_0x90f6('0x5f')],'OpenchannelAccountId':_0x510b97['id'],'OpenchannelInteractionId':_0x4a13fb['id'],'UserId':_0x264915[_0x90f6('0x60')]['id'],'ContactId':_0x10b0fe['id']}))[_0x90f6('0x1e')](function(_0x4c17f4){_0x4a13fb[_0x90f6('0xc1')][_0x90f6('0xc0')]=[];_0x4a13fb[_0x90f6('0xc1')][_0x90f6('0xc0')][_0x90f6('0x98')](_0x4c17f4[_0x90f6('0xc1')]);return _0x4a13fb;});});}})[_0x90f6('0x1e')](respondWithResult(_0x5d15a5,null))['catch'](handleError(_0x5d15a5,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 1ebbd50..1c5d234 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 _0xa74f=['remove','hasOwnProperty','hook','exports','OpenchannelAccount','update'];(function(_0x168c31,_0x38bb35){var _0x8887a=function(_0x1c9e99){while(--_0x1c9e99){_0x168c31['push'](_0x168c31['shift']());}};_0x8887a(++_0x38bb35);}(_0xa74f,0x9a));var _0xfa74=function(_0x1c5950,_0x49e128){_0x1c5950=_0x1c5950-0x0;var _0x2b720a=_0xa74f[_0x1c5950];return _0x2b720a;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require('../../mysqldb')['db'][_0xfa74('0x0')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xfa74('0x1'),'afterDestroy':_0xfa74('0x2')};function emitEvent(_0x394a1e){return function(_0x25a9b7,_0x5b367b,_0x141625){OpenchannelAccountEvents['emit'](_0x394a1e+':'+_0x25a9b7['id'],_0x25a9b7);OpenchannelAccountEvents['emit'](_0x394a1e,_0x25a9b7);_0x141625(null);};}for(var e in events){if(events[_0xfa74('0x3')](e)){var event=events[e];OpenchannelAccount[_0xfa74('0x4')](e,emitEvent(event));}}module[_0xfa74('0x5')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x6f7a=['events','../../mysqldb','OpenchannelAccount','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x23b7f3,_0x535d65){_0x23b7f3=_0x23b7f3-0x0;var _0x13b19c=_0x6f7a[_0x23b7f3];return _0x13b19c;};'use strict';var EventEmitter=require(_0xa6f7('0x0'));var OpenchannelAccount=require(_0xa6f7('0x1'))['db'][_0xa6f7('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xa6f7('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa6f7('0x4'),'afterDestroy':_0xa6f7('0x5')};function emitEvent(_0x12ecb8){return function(_0x1da6dc,_0x22e529,_0x1f5922){OpenchannelAccountEvents[_0xa6f7('0x6')](_0x12ecb8+':'+_0x1da6dc['id'],_0x1da6dc);OpenchannelAccountEvents[_0xa6f7('0x6')](_0x12ecb8,_0x1da6dc);_0x1f5922(null);};}for(var e in events){if(events[_0xa6f7('0x7')](e)){var event=events[e];OpenchannelAccount[_0xa6f7('0x8')](e,emitEvent(event));}}module[_0xa6f7('0x9')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 1aeebfe..58fc662 100644 --- a/server/api/openchannelAccount/openchannelAccount.model.js +++ b/server/api/openchannelAccount/openchannelAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../config/environment','./openchannelAccount.attributes','exports','define','OpenchannelAccount','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0xaa0077,_0x42f649){var _0x3c0e1b=function(_0x5edd3f){while(--_0x5edd3f){_0xaa0077['push'](_0xaa0077['shift']());}};_0x3c0e1b(++_0x42f649);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./openchannelAccount.attributes','exports','define','OpenchannelAccount','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x3cb107,_0x44a053){var _0x3b99ee=function(_0x2caafb){while(--_0x2caafb){_0x3cb107['push'](_0x3cb107['shift']());}};_0x3b99ee(++_0x44a053);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.rpc.js b/server/api/openchannelAccount/openchannelAccount.rpc.js index 0e20658..edd414f 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 _0x13f6=['code','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','socket.io-emitter','redis','./openchannelAccount.socket','register','request','then','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x22948c,_0x38e2f9){var _0xb7a4e8=function(_0x300eb2){while(--_0x300eb2){_0x22948c['push'](_0x22948c['shift']());}};_0xb7a4e8(++_0x38e2f9);}(_0x13f6,0x124));var _0x613f=function(_0x38c21f,_0x5d27a5){_0x38c21f=_0x38c21f-0x0;var _0x2e1b03=_0x13f6[_0x38c21f];return _0x2e1b03;};'use strict';var _=require(_0x613f('0x0'));var util=require(_0x613f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x613f('0x2'));var fs=require('fs');var Redis=require(_0x613f('0x3'));var db=require(_0x613f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x613f('0x5'))(_0x613f('0x6'));var config=require(_0x613f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x613f('0x8')][_0x613f('0x9')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x613f('0xa'))(new Redis(config[_0x613f('0xb')]));require(_0x613f('0xc'))[_0x613f('0xd')](socket);function respondWithRpcPromise(_0x4e98ce,_0x1a8dd0,_0x40d7f5){return new BPromise(function(_0xcd514c,_0x5210a0){return client[_0x613f('0xe')](_0x4e98ce,_0x40d7f5)[_0x613f('0xf')](function(_0x31875a){logger['info'](_0x613f('0x10'),_0x1a8dd0,_0x613f('0x11'));logger['debug']('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x1a8dd0,'request\x20sent',JSON[_0x613f('0x12')](_0x31875a));if(_0x31875a[_0x613f('0x13')]){if(_0x31875a[_0x613f('0x13')][_0x613f('0x14')]===0x1f4){logger[_0x613f('0x13')](_0x613f('0x10'),_0x1a8dd0,_0x31875a[_0x613f('0x13')][_0x613f('0x15')]);return _0x5210a0(_0x31875a[_0x613f('0x13')][_0x613f('0x15')]);}logger['error'](_0x613f('0x10'),_0x1a8dd0,_0x31875a['error']['message']);return _0xcd514c(_0x31875a[_0x613f('0x13')][_0x613f('0x15')]);}else{logger['info'](_0x613f('0x10'),_0x1a8dd0,'request\x20sent');_0xcd514c(_0x31875a[_0x613f('0x16')][_0x613f('0x15')]);}})[_0x613f('0x17')](function(_0x2a47f4){logger[_0x613f('0x13')](_0x613f('0x10'),_0x1a8dd0,_0x2a47f4);_0x5210a0(_0x2a47f4);});});} \ No newline at end of file +var _0xfc03=['jayson/promise','client','http','redis','socket.io-emitter','./openchannelAccount.socket','register','request','info','OpenchannelAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x9e3505,_0x143d39){var _0x2c3c11=function(_0x50f104){while(--_0x50f104){_0x9e3505['push'](_0x9e3505['shift']());}};_0x2c3c11(++_0x143d39);}(_0xfc03,0x16f));var _0x3fc0=function(_0x556927,_0x34b53f){_0x556927=_0x556927-0x0;var _0x5f1235=_0xfc03[_0x556927];return _0x5f1235;};'use strict';var _=require(_0x3fc0('0x0'));var util=require('util');var moment=require(_0x3fc0('0x1'));var BPromise=require(_0x3fc0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3fc0('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3fc0('0x4'));var logger=require(_0x3fc0('0x5'))(_0x3fc0('0x6'));var config=require(_0x3fc0('0x7'));var jayson=require(_0x3fc0('0x8'));var client=jayson[_0x3fc0('0x9')][_0x3fc0('0xa')]({'port':0x232a});config[_0x3fc0('0xb')]=_['defaults'](config[_0x3fc0('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x3fc0('0xc'))(new Redis(config[_0x3fc0('0xb')]));require(_0x3fc0('0xd'))[_0x3fc0('0xe')](socket);function respondWithRpcPromise(_0x5ef417,_0x1ee428,_0x929f8f){return new BPromise(function(_0xe9d431,_0x43faa8){return client[_0x3fc0('0xf')](_0x5ef417,_0x929f8f)['then'](function(_0x1f476c){logger[_0x3fc0('0x10')](_0x3fc0('0x11'),_0x1ee428,'request\x20sent');logger[_0x3fc0('0x12')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x1ee428,_0x3fc0('0x13'),JSON[_0x3fc0('0x14')](_0x1f476c));if(_0x1f476c['error']){if(_0x1f476c[_0x3fc0('0x15')][_0x3fc0('0x16')]===0x1f4){logger[_0x3fc0('0x15')]('OpenchannelAccount,\x20%s,\x20%s',_0x1ee428,_0x1f476c[_0x3fc0('0x15')][_0x3fc0('0x17')]);return _0x43faa8(_0x1f476c[_0x3fc0('0x15')][_0x3fc0('0x17')]);}logger['error'](_0x3fc0('0x11'),_0x1ee428,_0x1f476c[_0x3fc0('0x15')][_0x3fc0('0x17')]);return _0xe9d431(_0x1f476c['error'][_0x3fc0('0x17')]);}else{logger['info'](_0x3fc0('0x11'),_0x1ee428,_0x3fc0('0x13'));_0xe9d431(_0x1f476c['result'][_0x3fc0('0x17')]);}})[_0x3fc0('0x18')](function(_0x1c33c8){logger[_0x3fc0('0x15')](_0x3fc0('0x11'),_0x1ee428,_0x1c33c8);_0x43faa8(_0x1c33c8);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 914cad9..d2acfb0 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 _0x2bdb=['openchannelAccount:','./openchannelAccount.events','remove','removeListener','register'];(function(_0x1a87b3,_0x45ba68){var _0x37e84d=function(_0x39f49e){while(--_0x39f49e){_0x1a87b3['push'](_0x1a87b3['shift']());}};_0x37e84d(++_0x45ba68);}(_0x2bdb,0x105));var _0xb2bd=function(_0x158918,_0x4c6082){_0x158918=_0x158918-0x0;var _0x171089=_0x2bdb[_0x158918];return _0x171089;};'use strict';var OpenchannelAccountEvents=require(_0xb2bd('0x0'));var events=['save',_0xb2bd('0x1'),'update'];function createListener(_0x3b40de,_0x1d3ddb){return function(_0xab9a35){_0x1d3ddb['emit'](_0x3b40de,_0xab9a35);};}function removeListener(_0x438ced,_0x2be356){return function(){OpenchannelAccountEvents[_0xb2bd('0x2')](_0x438ced,_0x2be356);};}exports[_0xb2bd('0x3')]=function(_0x461137){for(var _0x2ef40b=0x0,_0x3bff5b=events['length'];_0x2ef40b<_0x3bff5b;_0x2ef40b++){var _0x21462b=events[_0x2ef40b];var _0x4d9d3f=createListener(_0xb2bd('0x4')+_0x21462b,_0x461137);OpenchannelAccountEvents['on'](_0x21462b,_0x4d9d3f);}}; \ No newline at end of file +var _0x4a47=['length','./openchannelAccount.events','save','remove','update','register'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0x4a47,0xb5));var _0x74a4=function(_0x514846,_0x34ac8d){_0x514846=_0x514846-0x0;var _0x2627a8=_0x4a47[_0x514846];return _0x2627a8;};'use strict';var OpenchannelAccountEvents=require(_0x74a4('0x0'));var events=[_0x74a4('0x1'),_0x74a4('0x2'),_0x74a4('0x3')];function createListener(_0x43adbe,_0x54d63a){return function(_0x24cff9){_0x54d63a['emit'](_0x43adbe,_0x24cff9);};}function removeListener(_0x2aa3d1,_0x450c10){return function(){OpenchannelAccountEvents['removeListener'](_0x2aa3d1,_0x450c10);};}exports[_0x74a4('0x4')]=function(_0x3c6344){for(var _0x206899=0x0,_0x4ebaa6=events[_0x74a4('0x5')];_0x206899<_0x4ebaa6;_0x206899++){var _0x55e8a1=events[_0x206899];var _0x3122ba=createListener('openchannelAccount:'+_0x55e8a1,_0x3c6344);OpenchannelAccountEvents['on'](_0x55e8a1,_0x3122ba);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index ae7c6b3..06e3aa0 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 _0x398a=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','isAuthenticated','index','/:id','post','create','put','update','destroy','exports','multer','util'];(function(_0x58c20f,_0x4cdb1b){var _0x3b0318=function(_0x36fa84){while(--_0x36fa84){_0x58c20f['push'](_0x58c20f['shift']());}};_0x3b0318(++_0x4cdb1b);}(_0x398a,0xf5));var _0xa398=function(_0x25d823,_0x18be2f){_0x25d823=_0x25d823-0x0;var _0x499cd0=_0x398a[_0x25d823];return _0x499cd0;};'use strict';var multer=require(_0xa398('0x0'));var util=require(_0xa398('0x1'));var path=require(_0xa398('0x2'));var timeout=require(_0xa398('0x3'));var express=require(_0xa398('0x4'));var router=express[_0xa398('0x5')]();var fs_extra=require(_0xa398('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xa398('0x7'));var config=require(_0xa398('0x8'));var controller=require(_0xa398('0x9'));router['get']('/',auth[_0xa398('0xa')](),controller[_0xa398('0xb')]);router['get'](_0xa398('0xc'),auth[_0xa398('0xa')](),controller['show']);router[_0xa398('0xd')]('/',auth[_0xa398('0xa')](),controller[_0xa398('0xe')]);router[_0xa398('0xf')](_0xa398('0xc'),auth[_0xa398('0xa')](),controller[_0xa398('0x10')]);router['delete'](_0xa398('0xc'),auth[_0xa398('0xa')](),controller[_0xa398('0x11')]);module[_0xa398('0x12')]=router; \ No newline at end of file +var _0xf64f=['fs-extra','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x424501,_0x42096d){var _0xb719af=function(_0x37adcf){while(--_0x37adcf){_0x424501['push'](_0x424501['shift']());}};_0xb719af(++_0x42096d);}(_0xf64f,0x18a));var _0xff64=function(_0x1f3423,_0x449526){_0x1f3423=_0x1f3423-0x0;var _0x1246d4=_0xf64f[_0x1f3423];return _0x1246d4;};'use strict';var multer=require(_0xff64('0x0'));var util=require('util');var path=require(_0xff64('0x1'));var timeout=require(_0xff64('0x2'));var express=require(_0xff64('0x3'));var router=express[_0xff64('0x4')]();var fs_extra=require(_0xff64('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xff64('0x6'));var controller=require(_0xff64('0x7'));router[_0xff64('0x8')]('/',auth[_0xff64('0x9')](),controller[_0xff64('0xa')]);router[_0xff64('0x8')](_0xff64('0xb'),auth['isAuthenticated'](),controller[_0xff64('0xc')]);router['post']('/',auth[_0xff64('0x9')](),controller[_0xff64('0xd')]);router[_0xff64('0xe')](_0xff64('0xb'),auth[_0xff64('0x9')](),controller[_0xff64('0xf')]);router[_0xff64('0x10')](_0xff64('0xb'),auth[_0xff64('0x9')](),controller[_0xff64('0x11')]);module[_0xff64('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 8675163..013c8c9 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 _0xbbe4=['INTEGER','STRING','*,*,*,*','exports'];(function(_0x358170,_0x4ca1c3){var _0x4a328c=function(_0x199cb8){while(--_0x199cb8){_0x358170['push'](_0x358170['shift']());}};_0x4a328c(++_0x4ca1c3);}(_0xbbe4,0x19b));var _0x4bbe=function(_0x3076ed,_0x23db8a){_0x3076ed=_0x3076ed-0x0;var _0x25a6a9=_0xbbe4[_0x3076ed];return _0x25a6a9;};'use strict';var Sequelize=require('sequelize');module[_0x4bbe('0x0')]={'priority':{'type':Sequelize[_0x4bbe('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x4bbe('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x4bbe('0x2')]},'interval':{'type':Sequelize[_0x4bbe('0x2')],'defaultValue':_0x4bbe('0x3')}}; \ No newline at end of file +var _0x0953=['INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize','exports'];(function(_0x1201a2,_0x5c2bd2){var _0xb5e24c=function(_0x5809a5){while(--_0x5809a5){_0x1201a2['push'](_0x1201a2['shift']());}};_0xb5e24c(++_0x5c2bd2);}(_0x0953,0x8a));var _0x3095=function(_0x5a7e3c,_0xdc9219){_0x5a7e3c=_0x5a7e3c-0x0;var _0x59252b=_0x0953[_0x5a7e3c];return _0x59252b;};'use strict';var Sequelize=require(_0x3095('0x0'));module[_0x3095('0x1')]={'priority':{'type':Sequelize[_0x3095('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x3095('0x3')],'allowNull':![],'defaultValue':_0x3095('0x4')},'appdata':{'type':Sequelize[_0x3095('0x5')]()},'description':{'type':Sequelize[_0x3095('0x3')]},'interval':{'type':Sequelize[_0x3095('0x3')],'defaultValue':_0x3095('0x6')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 4f7eec0..b916f41 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 _0x104b=['offset','count','set','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','send','map','OpenchannelApplication','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','keys','options','find','create','body','eml-format','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit'];(function(_0x41f650,_0x5b1e85){var _0x3d1fc0=function(_0x23da8e){while(--_0x23da8e){_0x41f650['push'](_0x41f650['shift']());}};_0x3d1fc0(++_0x5b1e85);}(_0x104b,0x10f));var _0xb104=function(_0x2ce8e3,_0x223eb4){_0x2ce8e3=_0x2ce8e3-0x0;var _0x7ade4f=_0x104b[_0x2ce8e3];return _0x7ade4f;};'use strict';var emlformat=require(_0xb104('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb104('0x1'));var rp=require(_0xb104('0x2'));var moment=require(_0xb104('0x3'));var BPromise=require(_0xb104('0x4'));var Mustache=require('mustache');var util=require(_0xb104('0x5'));var path=require('path');var sox=require(_0xb104('0x6'));var csv=require(_0xb104('0x7'));var ejs=require(_0xb104('0x8'));var fs=require('fs');var fs_extra=require(_0xb104('0x9'));var _=require(_0xb104('0xa'));var squel=require(_0xb104('0xb'));var crypto=require(_0xb104('0xc'));var jsforce=require(_0xb104('0xd'));var deskjs=require(_0xb104('0xe'));var toCsv=require(_0xb104('0x7'));var querystring=require('querystring');var Papa=require(_0xb104('0xf'));var Redis=require('ioredis');var authService=require(_0xb104('0x10'));var qs=require(_0xb104('0x11'));var as=require(_0xb104('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb104('0x13'))(_0xb104('0x14'));var utils=require(_0xb104('0x15'));var config=require(_0xb104('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xb104('0x17'))['db'];function respondWithStatusCode(_0x642d83,_0xd0dfea){_0xd0dfea=_0xd0dfea||0xcc;return function(_0x3137b5){if(_0x3137b5){return _0x642d83[_0xb104('0x18')](_0xd0dfea);}return _0x642d83[_0xb104('0x19')](_0xd0dfea)['end']();};}function respondWithResult(_0xf097e3,_0x4fcb46){_0x4fcb46=_0x4fcb46||0xc8;return function(_0x2e4852){if(_0x2e4852){return _0xf097e3[_0xb104('0x19')](_0x4fcb46)[_0xb104('0x1a')](_0x2e4852);}};}function respondWithFilteredResult(_0x45ad92,_0x5d6e06){return function(_0xd64242){if(_0xd64242){var _0x577ced=typeof _0x5d6e06['offset']===_0xb104('0x1b')&&typeof _0x5d6e06[_0xb104('0x1c')]===_0xb104('0x1b');var _0xe7b4f2=_0xd64242['count'];var _0xbf2863=_0x577ced?0x0:_0x5d6e06[_0xb104('0x1d')];var _0x16f770=_0x577ced?_0xd64242[_0xb104('0x1e')]:_0x5d6e06[_0xb104('0x1d')]+_0x5d6e06[_0xb104('0x1c')];var _0x1a9fc4;if(_0x16f770>=_0xe7b4f2){_0x16f770=_0xe7b4f2;_0x1a9fc4=0xc8;}else{_0x1a9fc4=0xce;}_0x45ad92['status'](_0x1a9fc4);return _0x45ad92[_0xb104('0x1f')](_0xb104('0x20'),_0xbf2863+'-'+_0x16f770+'/'+_0xe7b4f2)['json'](_0xd64242);}return null;};}function patchUpdates(_0x2d95c6){return function(_0x150f45){try{jsonpatch[_0xb104('0x21')](_0x150f45,_0x2d95c6,!![]);}catch(_0xc533a1){return BPromise[_0xb104('0x22')](_0xc533a1);}return _0x150f45[_0xb104('0x23')]();};}function saveUpdates(_0x446dbe,_0xf8a456){return function(_0x28a53a){if(_0x28a53a){return _0x28a53a[_0xb104('0x24')](_0x446dbe)['then'](function(_0x4d65a1){return _0x4d65a1;});}return null;};}function removeEntity(_0x29b21f,_0x3d3d9d){return function(_0xeb6be0){if(_0xeb6be0){return _0xeb6be0[_0xb104('0x25')]()[_0xb104('0x26')](function(){_0x29b21f[_0xb104('0x19')](0xcc)[_0xb104('0x27')]();});}};}function handleEntityNotFound(_0x54ee7b,_0xcca682){return function(_0x561b00){if(!_0x561b00){_0x54ee7b[_0xb104('0x18')](0x194);}return _0x561b00;};}function handleError(_0x6a8a81,_0x21998f){_0x21998f=_0x21998f||0x1f4;return function(_0x1ab6a9){logger[_0xb104('0x28')](_0x1ab6a9[_0xb104('0x29')]);if(_0x1ab6a9[_0xb104('0x2a')]){delete _0x1ab6a9[_0xb104('0x2a')];}_0x6a8a81['status'](_0x21998f)[_0xb104('0x2b')](_0x1ab6a9);};}exports['index']=function(_0x108eec,_0x54b6cc){var _0x3c98d9={},_0x5e712f={},_0x27844a={'count':0x0,'rows':[]};var _0x5d1baa=_[_0xb104('0x2c')](db[_0xb104('0x2d')][_0xb104('0x2e')],function(_0x4a2542){return{'name':_0x4a2542[_0xb104('0x2f')],'type':_0x4a2542[_0xb104('0x30')][_0xb104('0x31')]};});_0x5e712f[_0xb104('0x32')]=_['map'](_0x5d1baa,'name');_0x5e712f[_0xb104('0x33')]=_['keys'](_0x108eec[_0xb104('0x33')]);_0x5e712f['filters']=_[_0xb104('0x34')](_0x5e712f['model'],_0x5e712f['query']);_0x3c98d9[_0xb104('0x35')]=_[_0xb104('0x34')](_0x5e712f['model'],qs[_0xb104('0x36')](_0x108eec['query']['fields']));_0x3c98d9['attributes']=_0x3c98d9[_0xb104('0x35')]['length']?_0x3c98d9['attributes']:_0x5e712f[_0xb104('0x32')];if(!_0x108eec[_0xb104('0x33')][_0xb104('0x37')](_0xb104('0x38'))){_0x3c98d9[_0xb104('0x1c')]=qs[_0xb104('0x1c')](_0x108eec[_0xb104('0x33')]['limit']);_0x3c98d9[_0xb104('0x1d')]=qs[_0xb104('0x1d')](_0x108eec['query'][_0xb104('0x1d')]);}_0x3c98d9['order']=qs[_0xb104('0x39')](_0x108eec[_0xb104('0x33')][_0xb104('0x39')]);_0x3c98d9[_0xb104('0x3a')]=qs['filters'](_[_0xb104('0x3b')](_0x108eec[_0xb104('0x33')],_0x5e712f[_0xb104('0x3c')]),_0x5d1baa);if(_0x108eec[_0xb104('0x33')][_0xb104('0x3d')]){_0x3c98d9[_0xb104('0x3a')]=_[_0xb104('0x3e')](_0x3c98d9[_0xb104('0x3a')],{'$or':_[_0xb104('0x2c')](_0x5d1baa,function(_0x4507f7){if(_0x4507f7['type']!==_0xb104('0x3f')){var _0x206010={};_0x206010[_0x4507f7[_0xb104('0x2a')]]={'$like':'%'+_0x108eec[_0xb104('0x33')]['filter']+'%'};return _0x206010;}})});}_0x3c98d9=_[_0xb104('0x3e')]({},_0x3c98d9,_0x108eec['options']);var _0x4dda0c={'where':_0x3c98d9[_0xb104('0x3a')]};return db[_0xb104('0x2d')]['count'](_0x4dda0c)['then'](function(_0x42db0c){_0x27844a[_0xb104('0x1e')]=_0x42db0c;if(_0x108eec[_0xb104('0x33')][_0xb104('0x40')]){_0x3c98d9['include']=[{'all':!![]}];}return db[_0xb104('0x2d')][_0xb104('0x41')](_0x3c98d9);})[_0xb104('0x26')](function(_0xf38582){_0x27844a[_0xb104('0x42')]=_0xf38582;return _0x27844a;})[_0xb104('0x26')](respondWithFilteredResult(_0x54b6cc,_0x3c98d9))[_0xb104('0x43')](handleError(_0x54b6cc,null));};exports[_0xb104('0x44')]=function(_0x35c93b,_0x40f831){var _0x4c0a0a={'raw':!![],'where':{'id':_0x35c93b[_0xb104('0x45')]['id']}},_0x495aac={};_0x495aac[_0xb104('0x32')]=_[_0xb104('0x46')](db[_0xb104('0x2d')]['rawAttributes']);_0x495aac['query']=_[_0xb104('0x46')](_0x35c93b['query']);_0x495aac[_0xb104('0x3c')]=_['intersection'](_0x495aac[_0xb104('0x32')],_0x495aac['query']);_0x4c0a0a[_0xb104('0x35')]=_['intersection'](_0x495aac[_0xb104('0x32')],qs[_0xb104('0x36')](_0x35c93b[_0xb104('0x33')][_0xb104('0x36')]));_0x4c0a0a['attributes']=_0x4c0a0a['attributes']['length']?_0x4c0a0a['attributes']:_0x495aac[_0xb104('0x32')];if(_0x35c93b['query'][_0xb104('0x40')]){_0x4c0a0a['include']=[{'all':!![]}];}_0x4c0a0a=_[_0xb104('0x3e')]({},_0x4c0a0a,_0x35c93b[_0xb104('0x47')]);return db['OpenchannelApplication'][_0xb104('0x48')](_0x4c0a0a)[_0xb104('0x26')](handleEntityNotFound(_0x40f831,null))[_0xb104('0x26')](respondWithResult(_0x40f831,null))[_0xb104('0x43')](handleError(_0x40f831,null));};exports[_0xb104('0x49')]=function(_0x4c14e0,_0x1eab30){return db[_0xb104('0x2d')][_0xb104('0x49')](_0x4c14e0[_0xb104('0x4a')],{})[_0xb104('0x26')](respondWithResult(_0x1eab30,0xc9))[_0xb104('0x43')](handleError(_0x1eab30,null));};exports[_0xb104('0x24')]=function(_0x1e4727,_0x2e3467){if(_0x1e4727[_0xb104('0x4a')]['id']){delete _0x1e4727['body']['id'];}return db['OpenchannelApplication'][_0xb104('0x48')]({'where':{'id':_0x1e4727[_0xb104('0x45')]['id']}})['then'](handleEntityNotFound(_0x2e3467,null))[_0xb104('0x26')](saveUpdates(_0x1e4727[_0xb104('0x4a')],null))[_0xb104('0x26')](respondWithResult(_0x2e3467,null))[_0xb104('0x43')](handleError(_0x2e3467,null));};exports['destroy']=function(_0x196ec6,_0x3ff6cf){return db[_0xb104('0x2d')]['find']({'where':{'id':_0x196ec6[_0xb104('0x45')]['id']}})[_0xb104('0x26')](handleEntityNotFound(_0x3ff6cf,null))[_0xb104('0x26')](removeEntity(_0x3ff6cf,null))[_0xb104('0x43')](handleError(_0x3ff6cf,null));}; \ No newline at end of file +var _0x70f2=['send','index','map','OpenchannelApplication','rawAttributes','fieldName','type','model','filters','intersection','attributes','fields','length','query','hasOwnProperty','sort','where','pick','merge','filter','includeAll','include','rows','show','keys','find','create','catch','body','params','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x70f2,0x68));var _0x270f=function(_0x56d596,_0x151ee3){_0x56d596=_0x56d596-0x0;var _0x3428cb=_0x70f2[_0x56d596];return _0x3428cb;};'use strict';var emlformat=require(_0x270f('0x0'));var rimraf=require(_0x270f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x270f('0x2'));var rp=require('request-promise');var moment=require(_0x270f('0x3'));var BPromise=require(_0x270f('0x4'));var Mustache=require(_0x270f('0x5'));var util=require(_0x270f('0x6'));var path=require(_0x270f('0x7'));var sox=require(_0x270f('0x8'));var csv=require(_0x270f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x270f('0xa'));var _=require(_0x270f('0xb'));var squel=require('squel');var crypto=require(_0x270f('0xc'));var jsforce=require(_0x270f('0xd'));var deskjs=require(_0x270f('0xe'));var toCsv=require('to-csv');var querystring=require(_0x270f('0xf'));var Papa=require('papaparse');var Redis=require(_0x270f('0x10'));var authService=require(_0x270f('0x11'));var qs=require(_0x270f('0x12'));var as=require(_0x270f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x270f('0x14'))(_0x270f('0x15'));var utils=require(_0x270f('0x16'));var config=require(_0x270f('0x17'));var licenseUtil=require(_0x270f('0x18'));var db=require(_0x270f('0x19'))['db'];function respondWithStatusCode(_0x4f1ac2,_0x46abee){_0x46abee=_0x46abee||0xcc;return function(_0x10d328){if(_0x10d328){return _0x4f1ac2[_0x270f('0x1a')](_0x46abee);}return _0x4f1ac2[_0x270f('0x1b')](_0x46abee)['end']();};}function respondWithResult(_0x1c746f,_0x290703){_0x290703=_0x290703||0xc8;return function(_0x1e9d36){if(_0x1e9d36){return _0x1c746f['status'](_0x290703)[_0x270f('0x1c')](_0x1e9d36);}};}function respondWithFilteredResult(_0x568770,_0x1ce126){return function(_0x540ace){if(_0x540ace){var _0x1255b5=typeof _0x1ce126['offset']===_0x270f('0x1d')&&typeof _0x1ce126[_0x270f('0x1e')]===_0x270f('0x1d');var _0x25277c=_0x540ace[_0x270f('0x1f')];var _0x39f8f1=_0x1255b5?0x0:_0x1ce126[_0x270f('0x20')];var _0x3e9f19=_0x1255b5?_0x540ace[_0x270f('0x1f')]:_0x1ce126[_0x270f('0x20')]+_0x1ce126[_0x270f('0x1e')];var _0x264ca7;if(_0x3e9f19>=_0x25277c){_0x3e9f19=_0x25277c;_0x264ca7=0xc8;}else{_0x264ca7=0xce;}_0x568770['status'](_0x264ca7);return _0x568770[_0x270f('0x21')](_0x270f('0x22'),_0x39f8f1+'-'+_0x3e9f19+'/'+_0x25277c)['json'](_0x540ace);}return null;};}function patchUpdates(_0xfad311){return function(_0x1aa95e){try{jsonpatch[_0x270f('0x23')](_0x1aa95e,_0xfad311,!![]);}catch(_0x55fd32){return BPromise[_0x270f('0x24')](_0x55fd32);}return _0x1aa95e[_0x270f('0x25')]();};}function saveUpdates(_0x34ea3c,_0x5139bc){return function(_0x3b2540){if(_0x3b2540){return _0x3b2540['update'](_0x34ea3c)[_0x270f('0x26')](function(_0x4e05d9){return _0x4e05d9;});}return null;};}function removeEntity(_0x12a96c,_0x417c60){return function(_0x2efd2b){if(_0x2efd2b){return _0x2efd2b[_0x270f('0x27')]()[_0x270f('0x26')](function(){_0x12a96c[_0x270f('0x1b')](0xcc)[_0x270f('0x28')]();});}};}function handleEntityNotFound(_0x3f98e3,_0x4d8dc3){return function(_0x336171){if(!_0x336171){_0x3f98e3[_0x270f('0x1a')](0x194);}return _0x336171;};}function handleError(_0x796cbc,_0x2a57a3){_0x2a57a3=_0x2a57a3||0x1f4;return function(_0x55a809){logger[_0x270f('0x29')](_0x55a809[_0x270f('0x2a')]);if(_0x55a809[_0x270f('0x2b')]){delete _0x55a809[_0x270f('0x2b')];}_0x796cbc[_0x270f('0x1b')](_0x2a57a3)[_0x270f('0x2c')](_0x55a809);};}exports[_0x270f('0x2d')]=function(_0x3a0c80,_0x5ab208){var _0x42d63b={},_0xe8d046={},_0x3bd108={'count':0x0,'rows':[]};var _0x307e4e=_[_0x270f('0x2e')](db[_0x270f('0x2f')][_0x270f('0x30')],function(_0x4990c9){return{'name':_0x4990c9[_0x270f('0x31')],'type':_0x4990c9[_0x270f('0x32')]['key']};});_0xe8d046[_0x270f('0x33')]=_[_0x270f('0x2e')](_0x307e4e,_0x270f('0x2b'));_0xe8d046['query']=_['keys'](_0x3a0c80['query']);_0xe8d046[_0x270f('0x34')]=_[_0x270f('0x35')](_0xe8d046['model'],_0xe8d046['query']);_0x42d63b[_0x270f('0x36')]=_[_0x270f('0x35')](_0xe8d046[_0x270f('0x33')],qs[_0x270f('0x37')](_0x3a0c80['query'][_0x270f('0x37')]));_0x42d63b[_0x270f('0x36')]=_0x42d63b['attributes'][_0x270f('0x38')]?_0x42d63b[_0x270f('0x36')]:_0xe8d046[_0x270f('0x33')];if(!_0x3a0c80[_0x270f('0x39')][_0x270f('0x3a')]('nolimit')){_0x42d63b[_0x270f('0x1e')]=qs['limit'](_0x3a0c80['query'][_0x270f('0x1e')]);_0x42d63b['offset']=qs[_0x270f('0x20')](_0x3a0c80[_0x270f('0x39')]['offset']);}_0x42d63b['order']=qs['sort'](_0x3a0c80['query'][_0x270f('0x3b')]);_0x42d63b[_0x270f('0x3c')]=qs[_0x270f('0x34')](_[_0x270f('0x3d')](_0x3a0c80[_0x270f('0x39')],_0xe8d046['filters']),_0x307e4e);if(_0x3a0c80[_0x270f('0x39')]['filter']){_0x42d63b['where']=_[_0x270f('0x3e')](_0x42d63b[_0x270f('0x3c')],{'$or':_[_0x270f('0x2e')](_0x307e4e,function(_0x3817fe){if(_0x3817fe[_0x270f('0x32')]!=='VIRTUAL'){var _0x3ca1ea={};_0x3ca1ea[_0x3817fe['name']]={'$like':'%'+_0x3a0c80[_0x270f('0x39')][_0x270f('0x3f')]+'%'};return _0x3ca1ea;}})});}_0x42d63b=_[_0x270f('0x3e')]({},_0x42d63b,_0x3a0c80['options']);var _0x3baa69={'where':_0x42d63b['where']};return db['OpenchannelApplication'][_0x270f('0x1f')](_0x3baa69)[_0x270f('0x26')](function(_0x11f9f8){_0x3bd108['count']=_0x11f9f8;if(_0x3a0c80[_0x270f('0x39')][_0x270f('0x40')]){_0x42d63b[_0x270f('0x41')]=[{'all':!![]}];}return db[_0x270f('0x2f')]['findAll'](_0x42d63b);})['then'](function(_0x2a2c8b){_0x3bd108[_0x270f('0x42')]=_0x2a2c8b;return _0x3bd108;})[_0x270f('0x26')](respondWithFilteredResult(_0x5ab208,_0x42d63b))['catch'](handleError(_0x5ab208,null));};exports[_0x270f('0x43')]=function(_0x13aca0,_0x5f3396){var _0x571b9e={'raw':!![],'where':{'id':_0x13aca0['params']['id']}},_0xb4129e={};_0xb4129e[_0x270f('0x33')]=_[_0x270f('0x44')](db[_0x270f('0x2f')][_0x270f('0x30')]);_0xb4129e['query']=_[_0x270f('0x44')](_0x13aca0[_0x270f('0x39')]);_0xb4129e[_0x270f('0x34')]=_[_0x270f('0x35')](_0xb4129e[_0x270f('0x33')],_0xb4129e[_0x270f('0x39')]);_0x571b9e[_0x270f('0x36')]=_['intersection'](_0xb4129e['model'],qs[_0x270f('0x37')](_0x13aca0[_0x270f('0x39')]['fields']));_0x571b9e[_0x270f('0x36')]=_0x571b9e[_0x270f('0x36')]['length']?_0x571b9e['attributes']:_0xb4129e['model'];if(_0x13aca0[_0x270f('0x39')][_0x270f('0x40')]){_0x571b9e[_0x270f('0x41')]=[{'all':!![]}];}_0x571b9e=_[_0x270f('0x3e')]({},_0x571b9e,_0x13aca0['options']);return db[_0x270f('0x2f')][_0x270f('0x45')](_0x571b9e)[_0x270f('0x26')](handleEntityNotFound(_0x5f3396,null))[_0x270f('0x26')](respondWithResult(_0x5f3396,null))['catch'](handleError(_0x5f3396,null));};exports[_0x270f('0x46')]=function(_0x2ce09a,_0x876670){return db[_0x270f('0x2f')][_0x270f('0x46')](_0x2ce09a['body'],{})[_0x270f('0x26')](respondWithResult(_0x876670,0xc9))[_0x270f('0x47')](handleError(_0x876670,null));};exports['update']=function(_0x571234,_0x2a9c81){if(_0x571234[_0x270f('0x48')]['id']){delete _0x571234[_0x270f('0x48')]['id'];}return db[_0x270f('0x2f')]['find']({'where':{'id':_0x571234['params']['id']}})['then'](handleEntityNotFound(_0x2a9c81,null))[_0x270f('0x26')](saveUpdates(_0x571234['body'],null))[_0x270f('0x26')](respondWithResult(_0x2a9c81,null))[_0x270f('0x47')](handleError(_0x2a9c81,null));};exports['destroy']=function(_0xe276e0,_0x4a3a58){return db[_0x270f('0x2f')][_0x270f('0x45')]({'where':{'id':_0xe276e0[_0x270f('0x49')]['id']}})[_0x270f('0x26')](handleEntityNotFound(_0x4a3a58,null))[_0x270f('0x26')](removeEntity(_0x4a3a58,null))[_0x270f('0x47')](handleError(_0x4a3a58,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index b56f333..1e0208e 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 _0xa5d8=['../../config/environment','./openchannelApplication.attributes','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x149035,_0xdaacca){var _0x9859af=function(_0x318442){while(--_0x318442){_0x149035['push'](_0x149035['shift']());}};_0x9859af(++_0xdaacca);}(_0xa5d8,0xca));var _0x8a5d=function(_0x393d2e,_0x35d4d2){_0x393d2e=_0x393d2e-0x0;var _0x20eaed=_0xa5d8[_0x393d2e];return _0x20eaed;};'use strict';var _=require(_0x8a5d('0x0'));var util=require(_0x8a5d('0x1'));var logger=require(_0x8a5d('0x2'))(_0x8a5d('0x3'));var moment=require(_0x8a5d('0x4'));var BPromise=require('bluebird');var rp=require(_0x8a5d('0x5'));var fs=require('fs');var path=require(_0x8a5d('0x6'));var rimraf=require('rimraf');var config=require(_0x8a5d('0x7'));var attributes=require(_0x8a5d('0x8'));module['exports']=function(_0xdf0fe2,_0x706d74){return _0xdf0fe2['define']('OpenchannelApplication',attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8a5d('0x9'),'collate':_0x8a5d('0xa')});}; \ No newline at end of file +var _0x19df=['path','rimraf','../../config/environment','./openchannelApplication.attributes','exports','define','OpenchannelApplication','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise'];(function(_0x173f07,_0x209e84){var _0x3f809b=function(_0x38e066){while(--_0x38e066){_0x173f07['push'](_0x173f07['shift']());}};_0x3f809b(++_0x209e84);}(_0x19df,0x1bc));var _0xf19d=function(_0x59b48b,_0x584733){_0x59b48b=_0x59b48b-0x0;var _0x4c3f79=_0x19df[_0x59b48b];return _0x4c3f79;};'use strict';var _=require(_0xf19d('0x0'));var util=require(_0xf19d('0x1'));var logger=require('../../config/logger')(_0xf19d('0x2'));var moment=require(_0xf19d('0x3'));var BPromise=require(_0xf19d('0x4'));var rp=require(_0xf19d('0x5'));var fs=require('fs');var path=require(_0xf19d('0x6'));var rimraf=require(_0xf19d('0x7'));var config=require(_0xf19d('0x8'));var attributes=require(_0xf19d('0x9'));module[_0xf19d('0xa')]=function(_0xf72eec,_0x1a7836){return _0xf72eec[_0xf19d('0xb')](_0xf19d('0xc'),attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf19d('0xd'),'collate':_0xf19d('0xe')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 114995b..2641733 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 _0x6248=['attributes','limit','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','OpenchannelApplication,\x20%s,\x20%s','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','options','raw','where'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0x6248,0xbd));var _0x8624=function(_0xce5197,_0x2b5082){_0xce5197=_0xce5197-0x0;var _0x17aca5=_0x6248[_0xce5197];return _0x17aca5;};'use strict';var _=require(_0x8624('0x0'));var util=require(_0x8624('0x1'));var moment=require(_0x8624('0x2'));var BPromise=require(_0x8624('0x3'));var rs=require(_0x8624('0x4'));var fs=require('fs');var Redis=require(_0x8624('0x5'));var db=require(_0x8624('0x6'))['db'];var utils=require(_0x8624('0x7'));var logger=require(_0x8624('0x8'))(_0x8624('0x9'));var config=require('../../config/environment');var jayson=require(_0x8624('0xa'));var client=jayson[_0x8624('0xb')][_0x8624('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2f44c9,_0xc834b,_0x121b13){return new BPromise(function(_0x5c2bef,_0x1b461f){return client['request'](_0x2f44c9,_0x121b13)[_0x8624('0xd')](function(_0x14cb03){logger[_0x8624('0xe')](_0x8624('0xf'),_0xc834b,'request\x20sent');logger['debug'](_0x8624('0x10'),_0xc834b,_0x8624('0x11'),JSON['stringify'](_0x14cb03));if(_0x14cb03['error']){if(_0x14cb03[_0x8624('0x12')]['code']===0x1f4){logger[_0x8624('0x12')]('OpenchannelApplication,\x20%s,\x20%s',_0xc834b,_0x14cb03[_0x8624('0x12')][_0x8624('0x13')]);return _0x1b461f(_0x14cb03['error']['message']);}logger[_0x8624('0x12')](_0x8624('0xf'),_0xc834b,_0x14cb03[_0x8624('0x12')][_0x8624('0x13')]);return _0x5c2bef(_0x14cb03[_0x8624('0x12')]['message']);}else{logger[_0x8624('0xe')](_0x8624('0xf'),_0xc834b,_0x8624('0x11'));_0x5c2bef(_0x14cb03[_0x8624('0x14')]['message']);}})[_0x8624('0x15')](function(_0x38fe5c){logger[_0x8624('0x12')](_0x8624('0xf'),_0xc834b,_0x38fe5c);_0x1b461f(_0x38fe5c);});});}exports[_0x8624('0x16')]=function(_0x1718ef){var _0x55d710=this;return new Promise(function(_0x5eb82c,_0x531629){return db[_0x8624('0x17')][_0x8624('0x18')](_0x1718ef['body'],{'raw':_0x1718ef[_0x8624('0x19')]?_0x1718ef['options'][_0x8624('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1718ef['options']?_0x1718ef[_0x8624('0x19')][_0x8624('0x1b')]||null:null,'attributes':_0x1718ef[_0x8624('0x19')]?_0x1718ef[_0x8624('0x19')][_0x8624('0x1c')]||null:null,'limit':_0x1718ef[_0x8624('0x19')]?_0x1718ef[_0x8624('0x19')][_0x8624('0x1d')]||null:null})[_0x8624('0xd')](function(_0x2e4c47){logger['info'](_0x8624('0x16'),_0x1718ef);logger[_0x8624('0x1e')]('UpdateOpenchannelApplication',_0x1718ef,JSON['stringify'](_0x2e4c47));_0x5eb82c(_0x2e4c47);})[_0x8624('0x15')](function(_0x581182){logger['error'](_0x8624('0x16'),_0x581182[_0x8624('0x13')],_0x1718ef);_0x531629(_0x55d710['error'](0x1f4,_0x581182['message']));});});}; \ No newline at end of file +var _0xd99f=['OpenchannelApplication,\x20%s,\x20%s','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','update','options','raw','where','limit','UpdateOpenchannelApplication','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x16e24d,_0x35e42c){var _0x55e74d=function(_0x430912){while(--_0x430912){_0x16e24d['push'](_0x16e24d['shift']());}};_0x55e74d(++_0x35e42c);}(_0xd99f,0x16a));var _0xfd99=function(_0x45fe53,_0x160e76){_0x45fe53=_0x45fe53-0x0;var _0xef1ed=_0xd99f[_0x45fe53];return _0xef1ed;};'use strict';var _=require(_0xfd99('0x0'));var util=require(_0xfd99('0x1'));var moment=require(_0xfd99('0x2'));var BPromise=require(_0xfd99('0x3'));var rs=require(_0xfd99('0x4'));var fs=require('fs');var Redis=require(_0xfd99('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xfd99('0x6'))(_0xfd99('0x7'));var config=require(_0xfd99('0x8'));var jayson=require(_0xfd99('0x9'));var client=jayson[_0xfd99('0xa')][_0xfd99('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5df84c,_0x331863,_0x52c9e1){return new BPromise(function(_0x147274,_0x6678d5){return client[_0xfd99('0xc')](_0x5df84c,_0x52c9e1)[_0xfd99('0xd')](function(_0x258936){logger[_0xfd99('0xe')](_0xfd99('0xf'),_0x331863,'request\x20sent');logger[_0xfd99('0x10')](_0xfd99('0x11'),_0x331863,_0xfd99('0x12'),JSON[_0xfd99('0x13')](_0x258936));if(_0x258936[_0xfd99('0x14')]){if(_0x258936[_0xfd99('0x14')]['code']===0x1f4){logger[_0xfd99('0x14')]('OpenchannelApplication,\x20%s,\x20%s',_0x331863,_0x258936[_0xfd99('0x14')]['message']);return _0x6678d5(_0x258936[_0xfd99('0x14')][_0xfd99('0x15')]);}logger[_0xfd99('0x14')](_0xfd99('0xf'),_0x331863,_0x258936[_0xfd99('0x14')][_0xfd99('0x15')]);return _0x147274(_0x258936[_0xfd99('0x14')][_0xfd99('0x15')]);}else{logger[_0xfd99('0xe')]('OpenchannelApplication,\x20%s,\x20%s',_0x331863,_0xfd99('0x12'));_0x147274(_0x258936['result']['message']);}})[_0xfd99('0x16')](function(_0x2713ae){logger[_0xfd99('0x14')](_0xfd99('0xf'),_0x331863,_0x2713ae);_0x6678d5(_0x2713ae);});});}exports['UpdateOpenchannelApplication']=function(_0x560f50){var _0x19fa53=this;return new Promise(function(_0x3fec9b,_0x45c20b){return db['OpenchannelApplication'][_0xfd99('0x17')](_0x560f50['body'],{'raw':_0x560f50['options']?_0x560f50[_0xfd99('0x18')][_0xfd99('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x560f50[_0xfd99('0x18')]?_0x560f50[_0xfd99('0x18')][_0xfd99('0x1a')]||null:null,'attributes':_0x560f50['options']?_0x560f50[_0xfd99('0x18')]['attributes']||null:null,'limit':_0x560f50[_0xfd99('0x18')]?_0x560f50[_0xfd99('0x18')][_0xfd99('0x1b')]||null:null})[_0xfd99('0xd')](function(_0x324bde){logger[_0xfd99('0xe')](_0xfd99('0x1c'),_0x560f50);logger[_0xfd99('0x10')](_0xfd99('0x1c'),_0x560f50,JSON[_0xfd99('0x13')](_0x324bde));_0x3fec9b(_0x324bde);})[_0xfd99('0x16')](function(_0x2b1e39){logger['error'](_0xfd99('0x1c'),_0x2b1e39[_0xfd99('0x15')],_0x560f50);_0x45c20b(_0x19fa53[_0xfd99('0x14')](0x1f4,_0x2b1e39[_0xfd99('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 9e72f86..424bd4b 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 _0xd137=['create','addMessage','/:id/tags','tracked','openchannel','addTags','put','openchannelinteraction:update','openchannelinteraction:destroy','destroy','delete','removeTags','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post'];(function(_0x263a2f,_0x1e81e3){var _0x8020e8=function(_0x39f91a){while(--_0x39f91a){_0x263a2f['push'](_0x263a2f['shift']());}};_0x8020e8(++_0x1e81e3);}(_0xd137,0x91));var _0x7d13=function(_0x301f95,_0x2285e5){_0x301f95=_0x301f95-0x0;var _0x59de75=_0xd137[_0x301f95];return _0x59de75;};'use strict';var multer=require(_0x7d13('0x0'));var util=require('util');var path=require(_0x7d13('0x1'));var timeout=require(_0x7d13('0x2'));var express=require('express');var router=express[_0x7d13('0x3')]();var fs_extra=require(_0x7d13('0x4'));var auth=require(_0x7d13('0x5'));var interaction=require(_0x7d13('0x6'));var config=require(_0x7d13('0x7'));var controller=require(_0x7d13('0x8'));router[_0x7d13('0x9')]('/',auth[_0x7d13('0xa')](),controller[_0x7d13('0xb')]);router[_0x7d13('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x7d13('0xc')]);router['get'](_0x7d13('0xd'),auth[_0x7d13('0xa')](),controller[_0x7d13('0xe')]);router[_0x7d13('0x9')](_0x7d13('0xf'),auth[_0x7d13('0xa')](),controller[_0x7d13('0x10')]);router['get'](_0x7d13('0x11'),auth[_0x7d13('0xa')](),controller[_0x7d13('0x12')]);router[_0x7d13('0x13')]('/',auth[_0x7d13('0xa')](),controller[_0x7d13('0x14')]);router['post'](_0x7d13('0xf'),auth[_0x7d13('0xa')](),controller[_0x7d13('0x15')]);router[_0x7d13('0x13')](_0x7d13('0x16'),auth[_0x7d13('0xa')](),interaction[_0x7d13('0x17')](_0x7d13('0x18'),'openchannelinteraction:addtags'),controller[_0x7d13('0x19')]);router[_0x7d13('0x1a')](_0x7d13('0xd'),auth[_0x7d13('0xa')](),interaction[_0x7d13('0x17')]('openchannel',_0x7d13('0x1b')),controller['update']);router['delete']('/:id',auth[_0x7d13('0xa')](),interaction[_0x7d13('0x17')](_0x7d13('0x18'),_0x7d13('0x1c')),controller[_0x7d13('0x1d')]);router[_0x7d13('0x1e')]('/:id/tags',auth[_0x7d13('0xa')](),controller[_0x7d13('0x1f')]);module[_0x7d13('0x20')]=router; \ No newline at end of file +var _0xc566=['download','create','addMessage','post','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','put','openchannelinteraction:update','update','delete','destroy','removeTags','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages'];(function(_0x1bdb94,_0x267912){var _0x42ba77=function(_0x1340d3){while(--_0x1340d3){_0x1bdb94['push'](_0x1bdb94['shift']());}};_0x42ba77(++_0x267912);}(_0xc566,0x191));var _0x6c56=function(_0x678a7c,_0x12743c){_0x678a7c=_0x678a7c-0x0;var _0x923e3f=_0xc566[_0x678a7c];return _0x923e3f;};'use strict';var multer=require(_0x6c56('0x0'));var util=require(_0x6c56('0x1'));var path=require(_0x6c56('0x2'));var timeout=require(_0x6c56('0x3'));var express=require('express');var router=express[_0x6c56('0x4')]();var fs_extra=require(_0x6c56('0x5'));var auth=require(_0x6c56('0x6'));var interaction=require(_0x6c56('0x7'));var config=require(_0x6c56('0x8'));var controller=require(_0x6c56('0x9'));router[_0x6c56('0xa')]('/',auth[_0x6c56('0xb')](),controller[_0x6c56('0xc')]);router[_0x6c56('0xa')](_0x6c56('0xd'),auth[_0x6c56('0xb')](),controller[_0x6c56('0xe')]);router[_0x6c56('0xa')](_0x6c56('0xf'),auth[_0x6c56('0xb')](),controller[_0x6c56('0x10')]);router[_0x6c56('0xa')](_0x6c56('0x11'),auth[_0x6c56('0xb')](),controller[_0x6c56('0x12')]);router[_0x6c56('0xa')]('/:id/download',auth[_0x6c56('0xb')](),controller[_0x6c56('0x13')]);router['post']('/',auth[_0x6c56('0xb')](),controller[_0x6c56('0x14')]);router['post'](_0x6c56('0x11'),auth[_0x6c56('0xb')](),controller[_0x6c56('0x15')]);router[_0x6c56('0x16')](_0x6c56('0x17'),auth[_0x6c56('0xb')](),interaction[_0x6c56('0x18')](_0x6c56('0x19'),_0x6c56('0x1a')),controller[_0x6c56('0x1b')]);router[_0x6c56('0x1c')](_0x6c56('0xf'),auth[_0x6c56('0xb')](),interaction[_0x6c56('0x18')](_0x6c56('0x19'),_0x6c56('0x1d')),controller[_0x6c56('0x1e')]);router[_0x6c56('0x1f')](_0x6c56('0xf'),auth[_0x6c56('0xb')](),interaction[_0x6c56('0x18')](_0x6c56('0x19'),'openchannelinteraction:destroy'),controller[_0x6c56('0x20')]);router[_0x6c56('0x1f')](_0x6c56('0x17'),auth[_0x6c56('0xb')](),controller[_0x6c56('0x21')]);module[_0x6c56('0x22')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 98c76c5..d35b0b5 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 _0x28aa=['out','ENUM','exports','BOOLEAN','DATE','STRING'];(function(_0x229d27,_0x250f34){var _0x5b02a=function(_0x304b5c){while(--_0x304b5c){_0x229d27['push'](_0x229d27['shift']());}};_0x5b02a(++_0x250f34);}(_0x28aa,0xf8));var _0xa28a=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0x28aa[_0x4b7b62];return _0x2280df;};'use strict';var Sequelize=require('sequelize');module[_0xa28a('0x0')]={'closed':{'type':Sequelize[_0xa28a('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xa28a('0x2')]},'disposition':{'type':Sequelize[_0xa28a('0x3')]},'secondDisposition':{'type':Sequelize[_0xa28a('0x3')]},'thirdDisposition':{'type':Sequelize[_0xa28a('0x3')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xa28a('0x2')]},'threadId':{'type':Sequelize[_0xa28a('0x3')]},'externalUrl':{'type':Sequelize[_0xa28a('0x3')]},'lastMsgAt':{'type':Sequelize[_0xa28a('0x2')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xa28a('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0xa28a('0x5')]('in',_0xa28a('0x4')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xa28a('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0xa28a('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0x1c4f=['DATE','ENUM','out','sequelize','exports','BOOLEAN','STRING'];(function(_0xdbc6c6,_0x55bd8c){var _0x2b9fe9=function(_0x553cef){while(--_0x553cef){_0xdbc6c6['push'](_0xdbc6c6['shift']());}};_0x2b9fe9(++_0x55bd8c);}(_0x1c4f,0x1f4));var _0xf1c4=function(_0x50744b,_0x45eb98){_0x50744b=_0x50744b-0x0;var _0x8ece2e=_0x1c4f[_0x50744b];return _0x8ece2e;};'use strict';var Sequelize=require(_0xf1c4('0x0'));module[_0xf1c4('0x1')]={'closed':{'type':Sequelize[_0xf1c4('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xf1c4('0x3')]},'secondDisposition':{'type':Sequelize[_0xf1c4('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xf1c4('0x3')]},'read1stAt':{'type':Sequelize[_0xf1c4('0x4')]},'threadId':{'type':Sequelize[_0xf1c4('0x3')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize[_0xf1c4('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xf1c4('0x5')]('in',_0xf1c4('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0xf1c4('0x5')]('in',_0xf1c4('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xf1c4('0x3')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index afb14b9..fe6bb57 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 _0x64d2=['mkdirSync','Openchannel','Owner','toString','closed','closedAt','threadId','Public','filter','existsSync','createReadStream','pipe','createWriteStream','direction','out','basename','value','renderFile','server','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','rimraf','zip-dir','moment','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','json','offset','count','limit','set','Content-Range','update','then','destroy','stack','name','status','send','index','map','OpenchannelInteraction','fieldName','type','key','getOptions','findAll','query','catch','show','from','params','model','keys','rawAttributes','filters','intersection','fields','length','merge','options','find','create','body','describe','addMessage','ids','getMessages','findOne','OpenchannelMessage','attributes','hasOwnProperty','nolimit','sort','pick','where','OpenchannelInteractionId','$gte','split','YYYY-MM-DD\x20HH:mm:ss','includeAll','include','rows','addTags','setTags','omit','spread','openchannelInteractionTags:save','removeTags','download','unix','join','root','files','tmp','attachments','format','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','firstName','lastName','Attachment','Messages','createdAt','secret','read','Account','get'];(function(_0x1552d6,_0x2d0f4f){var _0x32bee0=function(_0x49e417){while(--_0x49e417){_0x1552d6['push'](_0x1552d6['shift']());}};_0x32bee0(++_0x2d0f4f);}(_0x64d2,0xa0));var _0x264d=function(_0x3bbbd2,_0x506692){_0x3bbbd2=_0x3bbbd2-0x0;var _0x18ad2e=_0x64d2[_0x3bbbd2];return _0x18ad2e;};'use strict';var rimraf=require(_0x264d('0x0'));var zipdir=require(_0x264d('0x1'));var moment=require(_0x264d('0x2'));var util=require(_0x264d('0x3'));var path=require(_0x264d('0x4'));var ejs=require(_0x264d('0x5'));var fs=require('fs');var _=require(_0x264d('0x6'));var Redis=require(_0x264d('0x7'));var interaction=require(_0x264d('0x8'));var qs=require(_0x264d('0x9'));var pdf=require(_0x264d('0xa'));var logger=require(_0x264d('0xb'))(_0x264d('0xc'));var config=require(_0x264d('0xd'));var db=require(_0x264d('0xe'))['db'];config[_0x264d('0xf')]=_[_0x264d('0x10')](config[_0x264d('0xf')],{'host':_0x264d('0x11'),'port':0x18eb});var socket=require(_0x264d('0x12'))(new Redis(config[_0x264d('0xf')]));require('./openchannelInteraction.socket')[_0x264d('0x13')](socket);function respondWithStatusCode(_0x4299fc,_0x11877a){_0x11877a=_0x11877a||0xcc;return function(_0x37a335){if(_0x37a335){return _0x4299fc[_0x264d('0x14')](_0x11877a);}return _0x4299fc['status'](_0x11877a)[_0x264d('0x15')]();};}function respondWithResult(_0x6216e9,_0x49a8e2){_0x49a8e2=_0x49a8e2||0xc8;return function(_0x2039c5){if(_0x2039c5){return _0x6216e9['status'](_0x49a8e2)[_0x264d('0x16')](_0x2039c5);}};}function respondWithFilteredResult(_0x547b60,_0x3410d1){return function(_0x2fa349){if(_0x2fa349){var _0x59910d=typeof _0x3410d1[_0x264d('0x17')]==='undefined'&&typeof _0x3410d1['limit']==='undefined';var _0x393658=_0x2fa349[_0x264d('0x18')];var _0x11a671=_0x59910d?0x0:_0x3410d1[_0x264d('0x17')];var _0x5a84f8=_0x59910d?_0x2fa349[_0x264d('0x18')]:_0x3410d1[_0x264d('0x17')]+_0x3410d1[_0x264d('0x19')];var _0x101701;if(_0x5a84f8>=_0x393658){_0x5a84f8=_0x393658;_0x101701=0xc8;}else{_0x101701=0xce;}_0x547b60['status'](_0x101701);return _0x547b60[_0x264d('0x1a')](_0x264d('0x1b'),_0x11a671+'-'+_0x5a84f8+'/'+_0x393658)[_0x264d('0x16')](_0x2fa349);}return null;};}function saveUpdates(_0x4078cd){return function(_0x3f4694){if(_0x3f4694){return _0x3f4694[_0x264d('0x1c')](_0x4078cd)[_0x264d('0x1d')](function(_0x2c7487){return _0x2c7487;});}return null;};}function removeEntity(_0x1b62b0){return function(_0x35ca2c){if(_0x35ca2c){return _0x35ca2c[_0x264d('0x1e')]()[_0x264d('0x1d')](function(){_0x1b62b0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x37fc17){return function(_0x12d40e){if(!_0x12d40e){_0x37fc17[_0x264d('0x14')](0x194);}return _0x12d40e;};}function handleError(_0x28bb65,_0x2d5b2f){_0x2d5b2f=_0x2d5b2f||0x1f4;return function(_0x5dc86a){logger['error'](_0x5dc86a[_0x264d('0x1f')]);if(_0x5dc86a[_0x264d('0x20')]){delete _0x5dc86a['name'];}_0x28bb65[_0x264d('0x21')](_0x2d5b2f)[_0x264d('0x22')](_0x5dc86a);};}exports[_0x264d('0x23')]=function(_0x176818,_0x5e4d3f){var _0x152f7b={};var _0x5de6c7=_[_0x264d('0x24')](db[_0x264d('0x25')]['rawAttributes'],function(_0x494c65){return{'name':_0x494c65[_0x264d('0x26')],'type':_0x494c65[_0x264d('0x27')][_0x264d('0x28')]};});_0x152f7b=qs[_0x264d('0x29')](_0x5de6c7,_0x176818);return interaction[_0x264d('0x2a')]('openchannel',_0x176818[_0x264d('0x2b')],_0x176818['user'],_0x152f7b,_0x5de6c7)[_0x264d('0x1d')](respondWithFilteredResult(_0x5e4d3f,_0x152f7b))[_0x264d('0x2c')](handleError(_0x5e4d3f,null));};exports[_0x264d('0x2d')]=function(_0x77143d,_0x45add2){var _0x5d2ae6={};if(_0x77143d[_0x264d('0x2b')][_0x264d('0x27')]&&_0x77143d[_0x264d('0x2b')]['type']===_0x264d('0x2e')){_0x5d2ae6[_0x264d('0x2e')]=_0x77143d['params']['id'];}else{_0x5d2ae6['id']=_0x77143d[_0x264d('0x2f')]['id'];}var _0x441393={'raw':![],'where':_0x5d2ae6},_0x3c1c77={};_0x3c1c77[_0x264d('0x30')]=_[_0x264d('0x31')](db[_0x264d('0x25')][_0x264d('0x32')]);_0x3c1c77[_0x264d('0x2b')]=_[_0x264d('0x31')](_0x77143d[_0x264d('0x2b')]);_0x3c1c77[_0x264d('0x33')]=_['intersection'](_0x3c1c77[_0x264d('0x30')],_0x3c1c77[_0x264d('0x2b')]);_0x441393['attributes']=_[_0x264d('0x34')](_0x3c1c77[_0x264d('0x30')],qs[_0x264d('0x35')](_0x77143d[_0x264d('0x2b')]['fields']));_0x441393['attributes']=_0x441393['attributes'][_0x264d('0x36')]?_0x441393['attributes']:_0x3c1c77['model'];if(_0x77143d[_0x264d('0x2b')]['includeAll']){_0x441393['include']=[{'all':!![]}];}_0x441393=_[_0x264d('0x37')]({},_0x441393,_0x77143d[_0x264d('0x38')]);return db[_0x264d('0x25')][_0x264d('0x39')](_0x441393)['then'](handleEntityNotFound(_0x45add2,null))['then'](respondWithResult(_0x45add2,null))[_0x264d('0x2c')](handleError(_0x45add2,null));};exports[_0x264d('0x3a')]=function(_0x41c195,_0x2efc7c){return db[_0x264d('0x25')][_0x264d('0x3a')](_0x41c195[_0x264d('0x3b')],{})['then'](respondWithResult(_0x2efc7c,0xc9))[_0x264d('0x2c')](handleError(_0x2efc7c,null));};exports[_0x264d('0x1c')]=function(_0x409c31,_0x4a2462){if(_0x409c31[_0x264d('0x3b')]['id']){delete _0x409c31[_0x264d('0x3b')]['id'];}return db['OpenchannelInteraction']['find']({'where':{'id':_0x409c31[_0x264d('0x2f')]['id']}})['then'](handleEntityNotFound(_0x4a2462,null))[_0x264d('0x1d')](saveUpdates(_0x409c31['body'],null))['then'](respondWithResult(_0x4a2462,null))[_0x264d('0x2c')](handleError(_0x4a2462,null));};exports[_0x264d('0x1e')]=function(_0x2df754,_0x4b03df){return db['OpenchannelInteraction']['find']({'where':{'id':_0x2df754[_0x264d('0x2f')]['id']}})[_0x264d('0x1d')](handleEntityNotFound(_0x4b03df,null))[_0x264d('0x1d')](removeEntity(_0x4b03df,null))['catch'](handleError(_0x4b03df,null));};exports[_0x264d('0x3c')]=function(_0x1c4536,_0x4fc821){return db[_0x264d('0x25')][_0x264d('0x3c')]()[_0x264d('0x1d')](respondWithResult(_0x4fc821,null))[_0x264d('0x2c')](handleError(_0x4fc821,null));};exports['addMessage']=function(_0x513b28,_0x1f0a16){return db['OpenchannelMessage'][_0x264d('0x39')]({'where':{'id':_0x513b28['params']['id']}})['then'](handleEntityNotFound(_0x1f0a16,null))[_0x264d('0x1d')](function(_0x228ec4){if(_0x228ec4){return _0x228ec4[_0x264d('0x3d')](_0x513b28[_0x264d('0x3b')][_0x264d('0x3e')],_['omit'](_0x513b28['body'],[_0x264d('0x3e'),'id'])||{});}})['then'](respondWithResult(_0x1f0a16,null))[_0x264d('0x2c')](handleError(_0x1f0a16,null));};exports[_0x264d('0x3f')]=function(_0x572c3e,_0x5b2c47){var _0x50de20={'raw':![],'where':{}};var _0x943ad6={};var _0x2da2e1={'count':0x0,'rows':[]};return db[_0x264d('0x25')][_0x264d('0x40')]({'where':{'id':_0x572c3e[_0x264d('0x2f')]['id']}})[_0x264d('0x1d')](handleEntityNotFound(_0x5b2c47,null))['then'](function(_0x2c1a65){if(_0x2c1a65){_0x943ad6[_0x264d('0x30')]=_['keys'](db[_0x264d('0x41')][_0x264d('0x32')]);_0x943ad6[_0x264d('0x2b')]=_[_0x264d('0x31')](_0x572c3e['query']);_0x943ad6[_0x264d('0x33')]=_['intersection'](_0x943ad6[_0x264d('0x30')],_0x943ad6['query']);_0x50de20[_0x264d('0x42')]=_[_0x264d('0x34')](_0x943ad6[_0x264d('0x30')],qs[_0x264d('0x35')](_0x572c3e[_0x264d('0x2b')][_0x264d('0x35')]));_0x50de20[_0x264d('0x42')]=_0x50de20[_0x264d('0x42')][_0x264d('0x36')]?_0x50de20[_0x264d('0x42')]:_0x943ad6[_0x264d('0x30')];if(!_0x572c3e[_0x264d('0x2b')][_0x264d('0x43')](_0x264d('0x44'))){_0x50de20[_0x264d('0x19')]=qs[_0x264d('0x19')](_0x572c3e[_0x264d('0x2b')][_0x264d('0x19')]);_0x50de20[_0x264d('0x17')]=qs[_0x264d('0x17')](_0x572c3e['query'][_0x264d('0x17')]);}_0x50de20['order']=qs[_0x264d('0x45')](_0x572c3e[_0x264d('0x2b')][_0x264d('0x45')]);_0x50de20['where']=qs['filters'](_[_0x264d('0x46')](_0x572c3e['query'],_0x943ad6[_0x264d('0x33')]));_0x50de20[_0x264d('0x47')][_0x264d('0x48')]=_0x2c1a65['id'];if(_0x572c3e[_0x264d('0x2b')]['filter']){_0x50de20[_0x264d('0x47')]=_['merge'](_0x50de20['where'],{'$or':_[_0x264d('0x24')](_0x50de20[_0x264d('0x42')],function(_0x339c0e){var _0x301bee={};_0x301bee[_0x339c0e]={'$like':'%'+_0x572c3e[_0x264d('0x2b')]['filter']+'%'};return _0x301bee;})});}if(_0x572c3e[_0x264d('0x2b')][_0x264d('0x49')]){var _0x3eb6a6=_0x572c3e[_0x264d('0x2b')][_0x264d('0x49')][_0x264d('0x4a')](',');var _0x3dcf68={};_0x3dcf68[_0x3eb6a6[0x0]]={'$gte':moment(_0x3eb6a6[0x1])['format'](_0x264d('0x4b'))};_0x50de20['where']=_['merge'](_0x50de20[_0x264d('0x47')],_0x3dcf68);}_0x50de20=_[_0x264d('0x37')]({},_0x50de20,_0x572c3e['options']);return db[_0x264d('0x41')][_0x264d('0x18')]({'where':_0x50de20['where']})['then'](function(_0x3aa071){_0x2da2e1[_0x264d('0x18')]=_0x3aa071;if(_0x572c3e['query'][_0x264d('0x4c')]){_0x50de20[_0x264d('0x4d')]=[{'all':!![]}];}return db[_0x264d('0x41')][_0x264d('0x2a')](_0x50de20);})[_0x264d('0x1d')](function(_0x19b613){_0x2da2e1[_0x264d('0x4e')]=_0x19b613;return _0x2da2e1;});}})[_0x264d('0x1d')](respondWithFilteredResult(_0x5b2c47,_0x50de20))[_0x264d('0x2c')](handleError(_0x5b2c47,null));};exports[_0x264d('0x4f')]=function(_0x44fe79,_0x517b9b){return db[_0x264d('0x25')][_0x264d('0x39')]({'where':{'id':_0x44fe79[_0x264d('0x2f')]['id']}})['then'](handleEntityNotFound(_0x517b9b,null))[_0x264d('0x1d')](function(_0x403fba){if(_0x403fba){return _0x403fba[_0x264d('0x50')](_0x44fe79[_0x264d('0x3b')][_0x264d('0x3e')],_[_0x264d('0x51')](_0x44fe79[_0x264d('0x3b')],[_0x264d('0x3e'),'id'])||{})[_0x264d('0x52')](function(){return db['Tag'][_0x264d('0x2a')]({'attributes':['id',_0x264d('0x20'),'color'],'where':{'id':_0x44fe79['body'][_0x264d('0x3e')]}});})[_0x264d('0x1d')](function(_0x3ee119){socket['emit'](_0x264d('0x53'),{'id':Number(_0x44fe79['params']['id']),'tags':_0x3ee119||[]});return{'id':Number(_0x44fe79[_0x264d('0x2f')]['id']),'tags':_0x3ee119||[]};});}})[_0x264d('0x1d')](respondWithResult(_0x517b9b,null))[_0x264d('0x2c')](handleError(_0x517b9b,null));};exports[_0x264d('0x54')]=function(_0x154016,_0x330d43){return db[_0x264d('0x25')][_0x264d('0x39')]({'where':{'id':_0x154016[_0x264d('0x2f')]['id']}})['then'](handleEntityNotFound(_0x330d43,null))['then'](function(_0x16008b){if(_0x16008b){return _0x16008b[_0x264d('0x54')](_0x154016[_0x264d('0x2b')][_0x264d('0x3e')]);}})['then'](respondWithStatusCode(_0x330d43,null))[_0x264d('0x2c')](handleError(_0x330d43,null));};exports[_0x264d('0x55')]=function(_0x1cb1bf,_0x56a988){var _0x1d2a8b=moment()[_0x264d('0x56')]()['toString']();var _0x2063f0=path[_0x264d('0x57')](config[_0x264d('0x58')],'server',_0x264d('0x59'),_0x264d('0x5a'));var _0x21688d=path[_0x264d('0x57')](config[_0x264d('0x58')],'server',_0x264d('0x59'),_0x264d('0x5b'));var _0x134a70=path[_0x264d('0x57')](_0x2063f0,_0x1d2a8b);var _0x41e530=util[_0x264d('0x5c')](_0x264d('0x5d'),_0x1cb1bf[_0x264d('0x2f')]['id'],_0x1d2a8b);var _0x2c739e=path[_0x264d('0x57')](_0x2063f0,_0x41e530);var _0x368a60=[];_0x368a60[_0x264d('0x5e')]({'model':db[_0x264d('0x5f')],'as':_0x264d('0x5f'),'attributes':['id',_0x264d('0x60')],'raw':!![]});_0x368a60['push']({'model':db[_0x264d('0x61')],'as':_0x264d('0x62'),'attributes':['id',_0x264d('0x63'),_0x264d('0x64')],'raw':!![]});if(_0x1cb1bf[_0x264d('0x2b')][_0x264d('0x5b')]){_0x368a60[_0x264d('0x5e')]({'model':db[_0x264d('0x65')],'as':'Attachment','raw':!![]});}var _0x211fbd=[{'model':db[_0x264d('0x41')],'as':_0x264d('0x66'),'attributes':['id',_0x264d('0x3b'),_0x264d('0x67'),'direction',_0x264d('0x68'),_0x264d('0x69')],'include':_0x368a60}];_0x211fbd['push']({'model':db['OpenchannelAccount'],'as':_0x264d('0x6a'),'attributes':['id',_0x264d('0x20')]});_0x211fbd[_0x264d('0x5e')]({'model':db['User'],'as':'Owner','attributes':['id',_0x264d('0x60')]});return db[_0x264d('0x25')]['find']({'where':{'id':_0x1cb1bf[_0x264d('0x2f')]['id']},'include':_0x211fbd})['then'](handleEntityNotFound(_0x56a988,null))[_0x264d('0x1d')](function(_0x420875){if(_0x420875){var _0x5d8202=_0x420875[_0x264d('0x6b')]({'plain':!![]});fs[_0x264d('0x6c')](_0x134a70);var _0x399cbb={'channel':_0x264d('0x6d'),'account':_0x5d8202[_0x264d('0x6a')][_0x264d('0x20')],'agent':_0x5d8202[_0x264d('0x6e')]?_0x5d8202[_0x264d('0x6e')][_0x264d('0x60')]:'N.A.','createdAt':moment(_0x5d8202[_0x264d('0x67')])[_0x264d('0x5c')](_0x264d('0x4b'))[_0x264d('0x6f')](),'closedAt':_0x5d8202[_0x264d('0x70')]?moment(_0x5d8202[_0x264d('0x71')])['format'](_0x264d('0x4b'))[_0x264d('0x6f')]():'','disposition':_0x5d8202['disposition'],'visibility':_0x5d8202[_0x264d('0x72')]?_0x264d('0x73'):'Private','messages':_(_0x5d8202[_0x264d('0x66')])[_0x264d('0x74')]({'secret':![]})[_0x264d('0x24')](function(_0x7e238){if(_0x7e238[_0x264d('0x65')]){var _0x42bb74=path[_0x264d('0x57')](_0x21688d,_0x7e238[_0x264d('0x65')]['basename']);if(fs[_0x264d('0x75')](_0x42bb74)){fs[_0x264d('0x76')](_0x42bb74)[_0x264d('0x77')](fs[_0x264d('0x78')](path[_0x264d('0x57')](_0x134a70,_0x7e238['Attachment']['basename'])));}}return{'date':moment(_0x7e238[_0x264d('0x67')])[_0x264d('0x5c')]('YYYY-MM-DD\x20HH:mm:ss')[_0x264d('0x6f')](),'sender':_0x7e238[_0x264d('0x79')]===_0x264d('0x7a')?_0x7e238['User']?_0x7e238['User'][_0x264d('0x60')]:'System':_0x7e238[_0x264d('0x62')]['firstName']+(_0x7e238[_0x264d('0x62')][_0x264d('0x64')]?'\x20'+_0x7e238['Contact'][_0x264d('0x64')]:''),'body':_0x7e238['Attachment']?_0x7e238[_0x264d('0x65')][_0x264d('0x7b')]:_0x7e238[_0x264d('0x3b')],'direction':_0x7e238[_0x264d('0x79')]==='out'?'A':'C','secret':_0x7e238[_0x264d('0x68')],'read':_0x7e238[_0x264d('0x69')],'attachment':_0x7e238['Attachment']};})[_0x264d('0x7c')]()};return ejs[_0x264d('0x7d')](path[_0x264d('0x57')](config[_0x264d('0x58')],_0x264d('0x7e'),_0x264d('0x7f'),_0x264d('0x80')),{'interaction':_0x399cbb})[_0x264d('0x1d')](function(_0x87700b){var _0xc94a49=path[_0x264d('0x57')](_0x134a70,_0x264d('0x81')+_0x5d8202['id']+'-'+_0x1d2a8b+_0x264d('0x82'));var _0x280622={'path':_0xc94a49,'channel':'Openchannel','interactionId':_0x5d8202['id']};return pdf[_0x264d('0x83')](_0x87700b,_0x280622);})[_0x264d('0x1d')](function(){return new Promise(function(_0x223f3e,_0x7dc568){zipdir(_0x134a70,{'saveTo':_0x2c739e},function(_0x1aceb2,_0x51528a){if(_0x1aceb2)return _0x7dc568(_0x1aceb2);return _0x223f3e(_0x51528a);});})[_0x264d('0x1d')](function(){return new Promise(function(_0x2f61ff,_0x3042d0){rimraf(_0x134a70,function(_0x1ae994){if(_0x1ae994)_0x3042d0(_0x1ae994);return _0x2f61ff();});});})[_0x264d('0x1d')](function(){return _0x56a988[_0x264d('0x55')](_0x2c739e,_0x41e530,function(_0x2020c2){if(_0x2020c2){logger['error'](_0x264d('0x84'),_0x2020c2);}else{fs[_0x264d('0x85')](_0x2c739e);}});});});}else{return _0x56a988[_0x264d('0x14')](0xc8);}})[_0x264d('0x2c')](handleError(_0x56a988,null));}; \ No newline at end of file +var _0xb2e9=['find','create','body','describe','addMessage','ids','getMessages','OpenchannelMessage','rawAttributes','hasOwnProperty','sort','where','OpenchannelInteractionId','filter','merge','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','options','findAll','setTags','omit','spread','Tag','color','emit','openchannelInteractionTags:save','removeTags','unix','toString','join','root','files','tmp','attachments','transcript-%d-%s.zip','push','User','fullname','Contact','firstName','Attachment','Messages','createdAt','direction','secret','read','Owner','get','Openchannel','Account','closed','closedAt','threadId','Public','Private','pipe','createWriteStream','basename','out','System','lastName','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','download','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','rimraf','zip-dir','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','offset','undefined','count','limit','json','update','then','destroy','end','error','stack','name','send','index','map','OpenchannelInteraction','fieldName','type','getOptions','openchannel','query','catch','show','from','params','model','keys','filters','intersection','fields','attributes','length','includeAll'];(function(_0x4bddc8,_0x415d48){var _0xd0e456=function(_0xb39d63){while(--_0xb39d63){_0x4bddc8['push'](_0x4bddc8['shift']());}};_0xd0e456(++_0x415d48);}(_0xb2e9,0x145));var _0x9b2e=function(_0xb6734b,_0x54af37){_0xb6734b=_0xb6734b-0x0;var _0x33f225=_0xb2e9[_0xb6734b];return _0x33f225;};'use strict';var rimraf=require(_0x9b2e('0x0'));var zipdir=require(_0x9b2e('0x1'));var moment=require('moment');var util=require(_0x9b2e('0x2'));var path=require(_0x9b2e('0x3'));var ejs=require(_0x9b2e('0x4'));var fs=require('fs');var _=require(_0x9b2e('0x5'));var Redis=require(_0x9b2e('0x6'));var interaction=require(_0x9b2e('0x7'));var qs=require(_0x9b2e('0x8'));var pdf=require(_0x9b2e('0x9'));var logger=require('../../config/logger')(_0x9b2e('0xa'));var config=require('../../config/environment');var db=require(_0x9b2e('0xb'))['db'];config[_0x9b2e('0xc')]=_[_0x9b2e('0xd')](config[_0x9b2e('0xc')],{'host':_0x9b2e('0xe'),'port':0x18eb});var socket=require(_0x9b2e('0xf'))(new Redis(config[_0x9b2e('0xc')]));require(_0x9b2e('0x10'))[_0x9b2e('0x11')](socket);function respondWithStatusCode(_0x2a2f6f,_0x4efec1){_0x4efec1=_0x4efec1||0xcc;return function(_0x344d7e){if(_0x344d7e){return _0x2a2f6f[_0x9b2e('0x12')](_0x4efec1);}return _0x2a2f6f['status'](_0x4efec1)['end']();};}function respondWithResult(_0x2ca250,_0xbfd825){_0xbfd825=_0xbfd825||0xc8;return function(_0x377f98){if(_0x377f98){return _0x2ca250[_0x9b2e('0x13')](_0xbfd825)['json'](_0x377f98);}};}function respondWithFilteredResult(_0x2387ba,_0x1e31e2){return function(_0x2e83d9){if(_0x2e83d9){var _0x184698=typeof _0x1e31e2[_0x9b2e('0x14')]===_0x9b2e('0x15')&&typeof _0x1e31e2['limit']===_0x9b2e('0x15');var _0x5b0741=_0x2e83d9[_0x9b2e('0x16')];var _0x2e35eb=_0x184698?0x0:_0x1e31e2[_0x9b2e('0x14')];var _0x313be2=_0x184698?_0x2e83d9[_0x9b2e('0x16')]:_0x1e31e2[_0x9b2e('0x14')]+_0x1e31e2[_0x9b2e('0x17')];var _0x1769af;if(_0x313be2>=_0x5b0741){_0x313be2=_0x5b0741;_0x1769af=0xc8;}else{_0x1769af=0xce;}_0x2387ba[_0x9b2e('0x13')](_0x1769af);return _0x2387ba['set']('Content-Range',_0x2e35eb+'-'+_0x313be2+'/'+_0x5b0741)[_0x9b2e('0x18')](_0x2e83d9);}return null;};}function saveUpdates(_0x4a2dd7){return function(_0x1e81e9){if(_0x1e81e9){return _0x1e81e9[_0x9b2e('0x19')](_0x4a2dd7)[_0x9b2e('0x1a')](function(_0x347e5c){return _0x347e5c;});}return null;};}function removeEntity(_0x39c7dd){return function(_0x410c28){if(_0x410c28){return _0x410c28[_0x9b2e('0x1b')]()[_0x9b2e('0x1a')](function(){_0x39c7dd[_0x9b2e('0x13')](0xcc)[_0x9b2e('0x1c')]();});}};}function handleEntityNotFound(_0x35ccd8){return function(_0x39cddb){if(!_0x39cddb){_0x35ccd8[_0x9b2e('0x12')](0x194);}return _0x39cddb;};}function handleError(_0x2bad72,_0x203678){_0x203678=_0x203678||0x1f4;return function(_0x310876){logger[_0x9b2e('0x1d')](_0x310876[_0x9b2e('0x1e')]);if(_0x310876[_0x9b2e('0x1f')]){delete _0x310876[_0x9b2e('0x1f')];}_0x2bad72['status'](_0x203678)[_0x9b2e('0x20')](_0x310876);};}exports[_0x9b2e('0x21')]=function(_0x45c5d1,_0x50aaef){var _0xe0d45={};var _0xcb2f50=_[_0x9b2e('0x22')](db[_0x9b2e('0x23')]['rawAttributes'],function(_0x2356a3){return{'name':_0x2356a3[_0x9b2e('0x24')],'type':_0x2356a3[_0x9b2e('0x25')]['key']};});_0xe0d45=qs[_0x9b2e('0x26')](_0xcb2f50,_0x45c5d1);return interaction['findAll'](_0x9b2e('0x27'),_0x45c5d1[_0x9b2e('0x28')],_0x45c5d1['user'],_0xe0d45,_0xcb2f50)[_0x9b2e('0x1a')](respondWithFilteredResult(_0x50aaef,_0xe0d45))[_0x9b2e('0x29')](handleError(_0x50aaef,null));};exports[_0x9b2e('0x2a')]=function(_0x58b672,_0x21bd78){var _0x3431c3={};if(_0x58b672[_0x9b2e('0x28')][_0x9b2e('0x25')]&&_0x58b672[_0x9b2e('0x28')]['type']==='from'){_0x3431c3[_0x9b2e('0x2b')]=_0x58b672[_0x9b2e('0x2c')]['id'];}else{_0x3431c3['id']=_0x58b672['params']['id'];}var _0x29a212={'raw':![],'where':_0x3431c3},_0x3b8980={};_0x3b8980[_0x9b2e('0x2d')]=_[_0x9b2e('0x2e')](db[_0x9b2e('0x23')]['rawAttributes']);_0x3b8980[_0x9b2e('0x28')]=_[_0x9b2e('0x2e')](_0x58b672['query']);_0x3b8980[_0x9b2e('0x2f')]=_[_0x9b2e('0x30')](_0x3b8980[_0x9b2e('0x2d')],_0x3b8980[_0x9b2e('0x28')]);_0x29a212['attributes']=_[_0x9b2e('0x30')](_0x3b8980[_0x9b2e('0x2d')],qs[_0x9b2e('0x31')](_0x58b672['query'][_0x9b2e('0x31')]));_0x29a212['attributes']=_0x29a212[_0x9b2e('0x32')][_0x9b2e('0x33')]?_0x29a212['attributes']:_0x3b8980['model'];if(_0x58b672[_0x9b2e('0x28')][_0x9b2e('0x34')]){_0x29a212['include']=[{'all':!![]}];}_0x29a212=_['merge']({},_0x29a212,_0x58b672['options']);return db[_0x9b2e('0x23')][_0x9b2e('0x35')](_0x29a212)[_0x9b2e('0x1a')](handleEntityNotFound(_0x21bd78,null))[_0x9b2e('0x1a')](respondWithResult(_0x21bd78,null))[_0x9b2e('0x29')](handleError(_0x21bd78,null));};exports[_0x9b2e('0x36')]=function(_0x2414eb,_0x46bd51){return db[_0x9b2e('0x23')][_0x9b2e('0x36')](_0x2414eb[_0x9b2e('0x37')],{})['then'](respondWithResult(_0x46bd51,0xc9))['catch'](handleError(_0x46bd51,null));};exports[_0x9b2e('0x19')]=function(_0xac3110,_0x51bff7){if(_0xac3110[_0x9b2e('0x37')]['id']){delete _0xac3110[_0x9b2e('0x37')]['id'];}return db[_0x9b2e('0x23')][_0x9b2e('0x35')]({'where':{'id':_0xac3110[_0x9b2e('0x2c')]['id']}})[_0x9b2e('0x1a')](handleEntityNotFound(_0x51bff7,null))[_0x9b2e('0x1a')](saveUpdates(_0xac3110['body'],null))[_0x9b2e('0x1a')](respondWithResult(_0x51bff7,null))[_0x9b2e('0x29')](handleError(_0x51bff7,null));};exports[_0x9b2e('0x1b')]=function(_0x14d81b,_0x45cae){return db[_0x9b2e('0x23')][_0x9b2e('0x35')]({'where':{'id':_0x14d81b[_0x9b2e('0x2c')]['id']}})[_0x9b2e('0x1a')](handleEntityNotFound(_0x45cae,null))[_0x9b2e('0x1a')](removeEntity(_0x45cae,null))['catch'](handleError(_0x45cae,null));};exports[_0x9b2e('0x38')]=function(_0x47d95c,_0x5e5ed5){return db['OpenchannelInteraction']['describe']()[_0x9b2e('0x1a')](respondWithResult(_0x5e5ed5,null))[_0x9b2e('0x29')](handleError(_0x5e5ed5,null));};exports[_0x9b2e('0x39')]=function(_0x5e9120,_0x563a5e){return db['OpenchannelMessage'][_0x9b2e('0x35')]({'where':{'id':_0x5e9120['params']['id']}})[_0x9b2e('0x1a')](handleEntityNotFound(_0x563a5e,null))[_0x9b2e('0x1a')](function(_0x5bb462){if(_0x5bb462){return _0x5bb462[_0x9b2e('0x39')](_0x5e9120['body']['ids'],_['omit'](_0x5e9120[_0x9b2e('0x37')],[_0x9b2e('0x3a'),'id'])||{});}})[_0x9b2e('0x1a')](respondWithResult(_0x563a5e,null))[_0x9b2e('0x29')](handleError(_0x563a5e,null));};exports[_0x9b2e('0x3b')]=function(_0x584a59,_0x5ee1f6){var _0x1d8eae={'raw':![],'where':{}};var _0x48b797={};var _0x7889f0={'count':0x0,'rows':[]};return db['OpenchannelInteraction']['findOne']({'where':{'id':_0x584a59[_0x9b2e('0x2c')]['id']}})[_0x9b2e('0x1a')](handleEntityNotFound(_0x5ee1f6,null))[_0x9b2e('0x1a')](function(_0x150e18){if(_0x150e18){_0x48b797['model']=_[_0x9b2e('0x2e')](db[_0x9b2e('0x3c')][_0x9b2e('0x3d')]);_0x48b797[_0x9b2e('0x28')]=_[_0x9b2e('0x2e')](_0x584a59[_0x9b2e('0x28')]);_0x48b797[_0x9b2e('0x2f')]=_[_0x9b2e('0x30')](_0x48b797[_0x9b2e('0x2d')],_0x48b797[_0x9b2e('0x28')]);_0x1d8eae[_0x9b2e('0x32')]=_[_0x9b2e('0x30')](_0x48b797[_0x9b2e('0x2d')],qs[_0x9b2e('0x31')](_0x584a59[_0x9b2e('0x28')][_0x9b2e('0x31')]));_0x1d8eae[_0x9b2e('0x32')]=_0x1d8eae[_0x9b2e('0x32')][_0x9b2e('0x33')]?_0x1d8eae[_0x9b2e('0x32')]:_0x48b797[_0x9b2e('0x2d')];if(!_0x584a59[_0x9b2e('0x28')][_0x9b2e('0x3e')]('nolimit')){_0x1d8eae[_0x9b2e('0x17')]=qs[_0x9b2e('0x17')](_0x584a59['query']['limit']);_0x1d8eae[_0x9b2e('0x14')]=qs[_0x9b2e('0x14')](_0x584a59[_0x9b2e('0x28')][_0x9b2e('0x14')]);}_0x1d8eae['order']=qs[_0x9b2e('0x3f')](_0x584a59['query'][_0x9b2e('0x3f')]);_0x1d8eae[_0x9b2e('0x40')]=qs[_0x9b2e('0x2f')](_['pick'](_0x584a59[_0x9b2e('0x28')],_0x48b797[_0x9b2e('0x2f')]));_0x1d8eae['where'][_0x9b2e('0x41')]=_0x150e18['id'];if(_0x584a59[_0x9b2e('0x28')][_0x9b2e('0x42')]){_0x1d8eae[_0x9b2e('0x40')]=_[_0x9b2e('0x43')](_0x1d8eae[_0x9b2e('0x40')],{'$or':_[_0x9b2e('0x22')](_0x1d8eae[_0x9b2e('0x32')],function(_0x297d5f){var _0xccae69={};_0xccae69[_0x297d5f]={'$like':'%'+_0x584a59['query'][_0x9b2e('0x42')]+'%'};return _0xccae69;})});}if(_0x584a59[_0x9b2e('0x28')][_0x9b2e('0x44')]){var _0x39a0cc=_0x584a59['query'][_0x9b2e('0x44')][_0x9b2e('0x45')](',');var _0x177c81={};_0x177c81[_0x39a0cc[0x0]]={'$gte':moment(_0x39a0cc[0x1])[_0x9b2e('0x46')](_0x9b2e('0x47'))};_0x1d8eae[_0x9b2e('0x40')]=_['merge'](_0x1d8eae[_0x9b2e('0x40')],_0x177c81);}_0x1d8eae=_[_0x9b2e('0x43')]({},_0x1d8eae,_0x584a59[_0x9b2e('0x48')]);return db[_0x9b2e('0x3c')]['count']({'where':_0x1d8eae[_0x9b2e('0x40')]})['then'](function(_0x347924){_0x7889f0['count']=_0x347924;if(_0x584a59[_0x9b2e('0x28')][_0x9b2e('0x34')]){_0x1d8eae['include']=[{'all':!![]}];}return db[_0x9b2e('0x3c')][_0x9b2e('0x49')](_0x1d8eae);})[_0x9b2e('0x1a')](function(_0x20f2d1){_0x7889f0['rows']=_0x20f2d1;return _0x7889f0;});}})['then'](respondWithFilteredResult(_0x5ee1f6,_0x1d8eae))[_0x9b2e('0x29')](handleError(_0x5ee1f6,null));};exports['addTags']=function(_0x528449,_0x231452){return db[_0x9b2e('0x23')][_0x9b2e('0x35')]({'where':{'id':_0x528449[_0x9b2e('0x2c')]['id']}})[_0x9b2e('0x1a')](handleEntityNotFound(_0x231452,null))[_0x9b2e('0x1a')](function(_0x11eb93){if(_0x11eb93){return _0x11eb93[_0x9b2e('0x4a')](_0x528449[_0x9b2e('0x37')][_0x9b2e('0x3a')],_[_0x9b2e('0x4b')](_0x528449[_0x9b2e('0x37')],[_0x9b2e('0x3a'),'id'])||{})[_0x9b2e('0x4c')](function(){return db[_0x9b2e('0x4d')][_0x9b2e('0x49')]({'attributes':['id',_0x9b2e('0x1f'),_0x9b2e('0x4e')],'where':{'id':_0x528449[_0x9b2e('0x37')][_0x9b2e('0x3a')]}});})[_0x9b2e('0x1a')](function(_0x17b5be){socket[_0x9b2e('0x4f')](_0x9b2e('0x50'),{'id':Number(_0x528449[_0x9b2e('0x2c')]['id']),'tags':_0x17b5be||[]});return{'id':Number(_0x528449[_0x9b2e('0x2c')]['id']),'tags':_0x17b5be||[]};});}})[_0x9b2e('0x1a')](respondWithResult(_0x231452,null))[_0x9b2e('0x29')](handleError(_0x231452,null));};exports[_0x9b2e('0x51')]=function(_0x30f6d9,_0x53e344){return db[_0x9b2e('0x23')]['find']({'where':{'id':_0x30f6d9[_0x9b2e('0x2c')]['id']}})['then'](handleEntityNotFound(_0x53e344,null))[_0x9b2e('0x1a')](function(_0xe37b42){if(_0xe37b42){return _0xe37b42[_0x9b2e('0x51')](_0x30f6d9[_0x9b2e('0x28')][_0x9b2e('0x3a')]);}})[_0x9b2e('0x1a')](respondWithStatusCode(_0x53e344,null))[_0x9b2e('0x29')](handleError(_0x53e344,null));};exports['download']=function(_0x437178,_0x3f6f5d){var _0x28e28a=moment()[_0x9b2e('0x52')]()[_0x9b2e('0x53')]();var _0x123348=path[_0x9b2e('0x54')](config[_0x9b2e('0x55')],'server',_0x9b2e('0x56'),_0x9b2e('0x57'));var _0x4f0f04=path[_0x9b2e('0x54')](config[_0x9b2e('0x55')],'server',_0x9b2e('0x56'),_0x9b2e('0x58'));var _0x3e47bd=path['join'](_0x123348,_0x28e28a);var _0x38a2c9=util[_0x9b2e('0x46')](_0x9b2e('0x59'),_0x437178[_0x9b2e('0x2c')]['id'],_0x28e28a);var _0xee9dbd=path[_0x9b2e('0x54')](_0x123348,_0x38a2c9);var _0x21cd70=[];_0x21cd70[_0x9b2e('0x5a')]({'model':db[_0x9b2e('0x5b')],'as':_0x9b2e('0x5b'),'attributes':['id',_0x9b2e('0x5c')],'raw':!![]});_0x21cd70[_0x9b2e('0x5a')]({'model':db['CmContact'],'as':_0x9b2e('0x5d'),'attributes':['id',_0x9b2e('0x5e'),'lastName'],'raw':!![]});if(_0x437178[_0x9b2e('0x28')][_0x9b2e('0x58')]){_0x21cd70[_0x9b2e('0x5a')]({'model':db[_0x9b2e('0x5f')],'as':_0x9b2e('0x5f'),'raw':!![]});}var _0x3cd8fd=[{'model':db[_0x9b2e('0x3c')],'as':_0x9b2e('0x60'),'attributes':['id',_0x9b2e('0x37'),_0x9b2e('0x61'),_0x9b2e('0x62'),_0x9b2e('0x63'),_0x9b2e('0x64')],'include':_0x21cd70}];_0x3cd8fd[_0x9b2e('0x5a')]({'model':db['OpenchannelAccount'],'as':'Account','attributes':['id','name']});_0x3cd8fd[_0x9b2e('0x5a')]({'model':db[_0x9b2e('0x5b')],'as':_0x9b2e('0x65'),'attributes':['id','fullname']});return db[_0x9b2e('0x23')][_0x9b2e('0x35')]({'where':{'id':_0x437178['params']['id']},'include':_0x3cd8fd})['then'](handleEntityNotFound(_0x3f6f5d,null))['then'](function(_0x57a0b2){if(_0x57a0b2){var _0x46bf5b=_0x57a0b2[_0x9b2e('0x66')]({'plain':!![]});fs['mkdirSync'](_0x3e47bd);var _0x9ff23b={'channel':_0x9b2e('0x67'),'account':_0x46bf5b[_0x9b2e('0x68')][_0x9b2e('0x1f')],'agent':_0x46bf5b['Owner']?_0x46bf5b[_0x9b2e('0x65')][_0x9b2e('0x5c')]:'N.A.','createdAt':moment(_0x46bf5b[_0x9b2e('0x61')])[_0x9b2e('0x46')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x46bf5b[_0x9b2e('0x69')]?moment(_0x46bf5b[_0x9b2e('0x6a')])[_0x9b2e('0x46')]('YYYY-MM-DD\x20HH:mm:ss')[_0x9b2e('0x53')]():'','disposition':_0x46bf5b['disposition'],'visibility':_0x46bf5b[_0x9b2e('0x6b')]?_0x9b2e('0x6c'):_0x9b2e('0x6d'),'messages':_(_0x46bf5b[_0x9b2e('0x60')])[_0x9b2e('0x42')]({'secret':![]})[_0x9b2e('0x22')](function(_0x309d8e){if(_0x309d8e[_0x9b2e('0x5f')]){var _0x2c041f=path['join'](_0x4f0f04,_0x309d8e['Attachment']['basename']);if(fs['existsSync'](_0x2c041f)){fs['createReadStream'](_0x2c041f)[_0x9b2e('0x6e')](fs[_0x9b2e('0x6f')](path[_0x9b2e('0x54')](_0x3e47bd,_0x309d8e[_0x9b2e('0x5f')][_0x9b2e('0x70')])));}}return{'date':moment(_0x309d8e[_0x9b2e('0x61')])[_0x9b2e('0x46')](_0x9b2e('0x47'))['toString'](),'sender':_0x309d8e[_0x9b2e('0x62')]===_0x9b2e('0x71')?_0x309d8e[_0x9b2e('0x5b')]?_0x309d8e[_0x9b2e('0x5b')][_0x9b2e('0x5c')]:_0x9b2e('0x72'):_0x309d8e['Contact']['firstName']+(_0x309d8e['Contact'][_0x9b2e('0x73')]?'\x20'+_0x309d8e[_0x9b2e('0x5d')][_0x9b2e('0x73')]:''),'body':_0x309d8e[_0x9b2e('0x5f')]?_0x309d8e[_0x9b2e('0x5f')][_0x9b2e('0x70')]:_0x309d8e[_0x9b2e('0x37')],'direction':_0x309d8e[_0x9b2e('0x62')]==='out'?'A':'C','secret':_0x309d8e[_0x9b2e('0x63')],'read':_0x309d8e[_0x9b2e('0x64')],'attachment':_0x309d8e[_0x9b2e('0x5f')]};})[_0x9b2e('0x74')]()};return ejs[_0x9b2e('0x75')](path[_0x9b2e('0x54')](config[_0x9b2e('0x55')],'server',_0x9b2e('0x76'),_0x9b2e('0x77')),{'interaction':_0x9ff23b})[_0x9b2e('0x1a')](function(_0x19d4f7){var _0x234cff=path[_0x9b2e('0x54')](_0x3e47bd,_0x9b2e('0x78')+_0x46bf5b['id']+'-'+_0x28e28a+_0x9b2e('0x79'));var _0x13b6ad={'path':_0x234cff,'channel':_0x9b2e('0x67'),'interactionId':_0x46bf5b['id']};return pdf[_0x9b2e('0x7a')](_0x19d4f7,_0x13b6ad);})[_0x9b2e('0x1a')](function(){return new Promise(function(_0x49bd79,_0x10a32f){zipdir(_0x3e47bd,{'saveTo':_0xee9dbd},function(_0x14669e,_0x570c94){if(_0x14669e)return _0x10a32f(_0x14669e);return _0x49bd79(_0x570c94);});})[_0x9b2e('0x1a')](function(){return new Promise(function(_0x42a966,_0x214a8a){rimraf(_0x3e47bd,function(_0x4325a4){if(_0x4325a4)_0x214a8a(_0x4325a4);return _0x42a966();});});})[_0x9b2e('0x1a')](function(){return _0x3f6f5d[_0x9b2e('0x7b')](_0xee9dbd,_0x38a2c9,function(_0x53bffd){if(_0x53bffd){logger[_0x9b2e('0x1d')](_0x9b2e('0x7c'),_0x53bffd);}else{fs[_0x9b2e('0x7d')](_0xee9dbd);}});});});}else{return _0x3f6f5d[_0x9b2e('0x12')](0xc8);}})['catch'](handleError(_0x3f6f5d,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 801c145..ef4c143 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 _0x8ae9=['save','update','remove','getUsers','then','setDataValue','Users','map','unreadMessages','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage'];(function(_0x3b632f,_0x453380){var _0x10e788=function(_0x2228a4){while(--_0x2228a4){_0x3b632f['push'](_0x3b632f['shift']());}};_0x10e788(++_0x453380);}(_0x8ae9,0x9e));var _0x98ae=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8ae9[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0x98ae('0x0'));var OpenchannelInteraction=require(_0x98ae('0x1'))['db'][_0x98ae('0x2')];var OpenchannelMessage=require(_0x98ae('0x1'))['db'][_0x98ae('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x98ae('0x4'),'afterUpdate':_0x98ae('0x5'),'afterDestroy':_0x98ae('0x6')};function emitEvent(_0x26704e){return function(_0x346a0e,_0x3b6921,_0x138753){_0x346a0e[_0x98ae('0x7')]({'attributes':['id'],'raw':!![]})[_0x98ae('0x8')](function(_0x45e754){_0x346a0e[_0x98ae('0x9')](_0x98ae('0xa'),_0x45e754[_0x98ae('0xb')](function(_0x3ab4b8){return{'id':_0x3ab4b8['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x346a0e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x98ae('0x8')](function(_0x580cd8){_0x346a0e[_0x98ae('0x9')](_0x98ae('0xc'),_0x580cd8[_0x98ae('0xd')]);OpenchannelInteractionEvents[_0x98ae('0xe')](_0x26704e+':'+_0x346a0e['id'],_0x346a0e);OpenchannelInteractionEvents[_0x98ae('0xe')](_0x26704e,_0x346a0e);_0x138753(null);})[_0x98ae('0xf')](_0x138753(null));};}for(var e in events){if(events[_0x98ae('0x10')](e)){var event=events[e];OpenchannelInteraction[_0x98ae('0x11')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file +var _0x8502=['events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','update','getUsers','then','setDataValue','Users','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports'];(function(_0x4f600d,_0x1c6d10){var _0x1adc34=function(_0x304acd){while(--_0x304acd){_0x4f600d['push'](_0x4f600d['shift']());}};_0x1adc34(++_0x1c6d10);}(_0x8502,0xd1));var _0x2850=function(_0x71cd05,_0x36ac11){_0x71cd05=_0x71cd05-0x0;var _0x59c9e7=_0x8502[_0x71cd05];return _0x59c9e7;};'use strict';var EventEmitter=require(_0x2850('0x0'));var OpenchannelInteraction=require(_0x2850('0x1'))['db'][_0x2850('0x2')];var OpenchannelMessage=require(_0x2850('0x1'))['db'][_0x2850('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x2850('0x4')](0x0);var events={'afterCreate':_0x2850('0x5'),'afterUpdate':_0x2850('0x6'),'afterDestroy':'remove'};function emitEvent(_0x68cb2d){return function(_0x5e3b31,_0x1b5bbe,_0x5a9a14){_0x5e3b31[_0x2850('0x7')]({'attributes':['id'],'raw':!![]})[_0x2850('0x8')](function(_0x4a15c2){_0x5e3b31[_0x2850('0x9')](_0x2850('0xa'),_0x4a15c2['map'](function(_0x1ba72a){return{'id':_0x1ba72a['id']};}));return OpenchannelMessage[_0x2850('0xb')]({'where':{'OpenchannelInteractionId':_0x5e3b31['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2850('0x8')](function(_0xbc97ea){_0x5e3b31[_0x2850('0x9')](_0x2850('0xc'),_0xbc97ea[_0x2850('0xd')]);OpenchannelInteractionEvents['emit'](_0x68cb2d+':'+_0x5e3b31['id'],_0x5e3b31);OpenchannelInteractionEvents[_0x2850('0xe')](_0x68cb2d,_0x5e3b31);_0x5a9a14(null);})[_0x2850('0xf')](_0x5a9a14(null));};}for(var e in events){if(events[_0x2850('0x10')](e)){var event=events[e];OpenchannelInteraction[_0x2850('0x11')](e,emitEvent(event));}}module[_0x2850('0x12')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index ff33769..7dcc24e 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 _0x8714=['../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','rimraf'];(function(_0x1d37c6,_0x5ec404){var _0xd95b3a=function(_0x3cfaff){while(--_0x3cfaff){_0x1d37c6['push'](_0x1d37c6['shift']());}};_0xd95b3a(++_0x5ec404);}(_0x8714,0x103));var _0x4871=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x8714[_0xa1e3e3];return _0xc980e9;};'use strict';var _=require(_0x4871('0x0'));var util=require(_0x4871('0x1'));var logger=require(_0x4871('0x2'))(_0x4871('0x3'));var moment=require(_0x4871('0x4'));var BPromise=require(_0x4871('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4871('0x6'));var config=require(_0x4871('0x7'));var attributes=require(_0x4871('0x8'));module[_0x4871('0x9')]=function(_0x3910e6,_0x428843){return _0x3910e6[_0x4871('0xa')](_0x4871('0xb'),attributes,{'tableName':_0x4871('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4871('0xd'),'collate':_0x4871('0xe'),'hooks':{'beforeUpdate':function(_0x3da7e1,_0x5536fe,_0x46de3c){if(_0x3da7e1[_0x4871('0xf')](_0x4871('0x10'))){_0x3da7e1[_0x4871('0x11')]=moment()['format'](_0x4871('0x12'));}_0x46de3c(null,_0x3da7e1);}}});}; \ No newline at end of file +var _0x98c6=['openchannel_interactions','utf8mb4','changed','closed','closedAt','format','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','exports','define','OpenchannelInteraction'];(function(_0x35f0d1,_0x5696b9){var _0x5a24ec=function(_0x4fe8e3){while(--_0x4fe8e3){_0x35f0d1['push'](_0x35f0d1['shift']());}};_0x5a24ec(++_0x5696b9);}(_0x98c6,0x15a));var _0x698c=function(_0x364e08,_0x589609){_0x364e08=_0x364e08-0x0;var _0x5a4d1f=_0x98c6[_0x364e08];return _0x5a4d1f;};'use strict';var _=require(_0x698c('0x0'));var util=require(_0x698c('0x1'));var logger=require(_0x698c('0x2'))(_0x698c('0x3'));var moment=require(_0x698c('0x4'));var BPromise=require('bluebird');var rp=require(_0x698c('0x5'));var fs=require('fs');var path=require(_0x698c('0x6'));var rimraf=require('rimraf');var config=require(_0x698c('0x7'));var attributes=require('./openchannelInteraction.attributes');module[_0x698c('0x8')]=function(_0x4deb3c,_0x1f6162){return _0x4deb3c[_0x698c('0x9')](_0x698c('0xa'),attributes,{'tableName':_0x698c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x698c('0xc'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x4373ee,_0x70707c,_0x274fb9){if(_0x4373ee[_0x698c('0xd')](_0x698c('0xe'))){_0x4373ee[_0x698c('0xf')]=moment()[_0x698c('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}_0x274fb9(null,_0x4373ee);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 2fda394..35ada4e 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 _0xdad6=['client','http','defaults','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','info','OpenchannelInteraction,\x20%s,\x20%s','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','where','then','debug','AddTagsToOpenchannelInteraction','find','addTags','ids','omit','spread','AddTags','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x18b0d2,_0x1569e6){var _0x1ee45d=function(_0x504296){while(--_0x504296){_0x18b0d2['push'](_0x18b0d2['shift']());}};_0x1ee45d(++_0x1569e6);}(_0xdad6,0xc0));var _0x6dad=function(_0x7a0051,_0x3c28b2){_0x7a0051=_0x7a0051-0x0;var _0xa447be=_0xdad6[_0x7a0051];return _0xa447be;};'use strict';var _=require(_0x6dad('0x0'));var util=require('util');var moment=require(_0x6dad('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6dad('0x2'));var db=require(_0x6dad('0x3'))['db'];var utils=require(_0x6dad('0x4'));var logger=require(_0x6dad('0x5'))('rpc');var config=require(_0x6dad('0x6'));var jayson=require(_0x6dad('0x7'));var client=jayson[_0x6dad('0x8')][_0x6dad('0x9')]({'port':0x232a});config['redis']=_[_0x6dad('0xa')](config[_0x6dad('0xb')],{'host':_0x6dad('0xc'),'port':0x18eb});var socket=require(_0x6dad('0xd'))(new Redis(config[_0x6dad('0xb')]));require(_0x6dad('0xe'))[_0x6dad('0xf')](socket);function respondWithRpcPromise(_0x194712,_0x149cdb,_0x3782da){return new BPromise(function(_0x55a2b1,_0x3e6602){return client[_0x6dad('0x10')](_0x194712,_0x3782da)['then'](function(_0x4b7dc0){logger[_0x6dad('0x11')](_0x6dad('0x12'),_0x149cdb,'request\x20sent');logger['debug'](_0x6dad('0x13'),_0x149cdb,'request\x20sent',JSON[_0x6dad('0x14')](_0x4b7dc0));if(_0x4b7dc0[_0x6dad('0x15')]){if(_0x4b7dc0[_0x6dad('0x15')][_0x6dad('0x16')]===0x1f4){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x149cdb,_0x4b7dc0[_0x6dad('0x15')]['message']);return _0x3e6602(_0x4b7dc0[_0x6dad('0x15')][_0x6dad('0x17')]);}logger[_0x6dad('0x15')]('OpenchannelInteraction,\x20%s,\x20%s',_0x149cdb,_0x4b7dc0['error'][_0x6dad('0x17')]);return _0x55a2b1(_0x4b7dc0[_0x6dad('0x15')][_0x6dad('0x17')]);}else{logger[_0x6dad('0x11')](_0x6dad('0x12'),_0x149cdb,'request\x20sent');_0x55a2b1(_0x4b7dc0['result'][_0x6dad('0x17')]);}})[_0x6dad('0x18')](function(_0x1aaf9b){logger[_0x6dad('0x15')]('OpenchannelInteraction,\x20%s,\x20%s',_0x149cdb,_0x1aaf9b);_0x3e6602(_0x1aaf9b);});});}exports[_0x6dad('0x19')]=function(_0x28cad2){var _0x18eee2=this;return new Promise(function(_0x12a056,_0x17f133){return db[_0x6dad('0x1a')][_0x6dad('0x1b')](_0x28cad2[_0x6dad('0x1c')],{'raw':_0x28cad2[_0x6dad('0x1d')]?_0x28cad2['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x28cad2[_0x6dad('0x1d')]?_0x28cad2[_0x6dad('0x1d')][_0x6dad('0x1e')]||null:null,'attributes':_0x28cad2[_0x6dad('0x1d')]?_0x28cad2[_0x6dad('0x1d')]['attributes']||null:null,'limit':_0x28cad2[_0x6dad('0x1d')]?_0x28cad2['options']['limit']||null:null})[_0x6dad('0x1f')](function(_0x27e181){logger[_0x6dad('0x11')](_0x6dad('0x19'),_0x28cad2);logger[_0x6dad('0x20')]('UpdateOpenchannelInteraction',_0x28cad2,JSON[_0x6dad('0x14')](_0x27e181));_0x12a056(_0x27e181);})['catch'](function(_0x9610e1){logger[_0x6dad('0x15')](_0x6dad('0x19'),_0x9610e1[_0x6dad('0x17')],_0x28cad2);_0x17f133(_0x18eee2[_0x6dad('0x15')](0x1f4,_0x9610e1[_0x6dad('0x17')]));});});};exports[_0x6dad('0x21')]=function(_0x49b0ea){return new Promise(function(_0x235562,_0x48eaa3){return db['OpenchannelInteraction'][_0x6dad('0x22')]({'where':_0x49b0ea['options']?_0x49b0ea['options'][_0x6dad('0x1e')]||null:null})['then'](function(_0x50e700){if(_0x50e700){return _0x50e700[_0x6dad('0x23')](_0x49b0ea[_0x6dad('0x1c')][_0x6dad('0x24')],_[_0x6dad('0x25')](_0x49b0ea[_0x6dad('0x1c')],[_0x6dad('0x24'),'id'])||{});}})[_0x6dad('0x26')](function(_0x3a18b9){logger['info'](_0x6dad('0x27'),_0x49b0ea);logger[_0x6dad('0x20')](_0x6dad('0x27'),_0x49b0ea,JSON['stringify'](_0x3a18b9));_0x235562(_0x3a18b9);})[_0x6dad('0x18')](function(_0x2f725d){logger[_0x6dad('0x15')]('AddTags',_0x2f725d[_0x6dad('0x17')],_0x49b0ea);_0x48eaa3(_this[_0x6dad('0x15')](0x1f4,_0x2f725d['message']));});});}; \ No newline at end of file +var _0x76e1=['request\x20sent','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','attributes','AddTagsToOpenchannelInteraction','where','addTags','ids','omit','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x239048,_0x5b19af){var _0x348afc=function(_0xdd1e8d){while(--_0xdd1e8d){_0x239048['push'](_0x239048['shift']());}};_0x348afc(++_0x5b19af);}(_0x76e1,0x14b));var _0x176e=function(_0x421a26,_0x2a7daf){_0x421a26=_0x421a26-0x0;var _0x17cb59=_0x76e1[_0x421a26];return _0x17cb59;};'use strict';var _=require(_0x176e('0x0'));var util=require(_0x176e('0x1'));var moment=require(_0x176e('0x2'));var BPromise=require(_0x176e('0x3'));var rs=require(_0x176e('0x4'));var fs=require('fs');var Redis=require(_0x176e('0x5'));var db=require(_0x176e('0x6'))['db'];var utils=require(_0x176e('0x7'));var logger=require(_0x176e('0x8'))(_0x176e('0x9'));var config=require(_0x176e('0xa'));var jayson=require(_0x176e('0xb'));var client=jayson[_0x176e('0xc')]['http']({'port':0x232a});config[_0x176e('0xd')]=_[_0x176e('0xe')](config['redis'],{'host':_0x176e('0xf'),'port':0x18eb});var socket=require(_0x176e('0x10'))(new Redis(config[_0x176e('0xd')]));require(_0x176e('0x11'))[_0x176e('0x12')](socket);function respondWithRpcPromise(_0x441e33,_0x25a532,_0x1b4b80){return new BPromise(function(_0x5b4aac,_0x35baae){return client[_0x176e('0x13')](_0x441e33,_0x1b4b80)[_0x176e('0x14')](function(_0x67741d){logger[_0x176e('0x15')](_0x176e('0x16'),_0x25a532,'request\x20sent');logger[_0x176e('0x17')](_0x176e('0x18'),_0x25a532,'request\x20sent',JSON[_0x176e('0x19')](_0x67741d));if(_0x67741d['error']){if(_0x67741d[_0x176e('0x1a')][_0x176e('0x1b')]===0x1f4){logger[_0x176e('0x1a')]('OpenchannelInteraction,\x20%s,\x20%s',_0x25a532,_0x67741d[_0x176e('0x1a')][_0x176e('0x1c')]);return _0x35baae(_0x67741d[_0x176e('0x1a')][_0x176e('0x1c')]);}logger[_0x176e('0x1a')]('OpenchannelInteraction,\x20%s,\x20%s',_0x25a532,_0x67741d['error']['message']);return _0x5b4aac(_0x67741d['error']['message']);}else{logger[_0x176e('0x15')](_0x176e('0x16'),_0x25a532,_0x176e('0x1d'));_0x5b4aac(_0x67741d[_0x176e('0x1e')][_0x176e('0x1c')]);}})[_0x176e('0x1f')](function(_0x2269f4){logger[_0x176e('0x1a')](_0x176e('0x16'),_0x25a532,_0x2269f4);_0x35baae(_0x2269f4);});});}exports[_0x176e('0x20')]=function(_0x32581d){var _0xca7567=this;return new Promise(function(_0x583d00,_0x46a66e){return db[_0x176e('0x21')][_0x176e('0x22')](_0x32581d[_0x176e('0x23')],{'raw':_0x32581d[_0x176e('0x24')]?_0x32581d[_0x176e('0x24')][_0x176e('0x25')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x32581d[_0x176e('0x24')]?_0x32581d[_0x176e('0x24')]['where']||null:null,'attributes':_0x32581d[_0x176e('0x24')]?_0x32581d['options'][_0x176e('0x26')]||null:null,'limit':_0x32581d[_0x176e('0x24')]?_0x32581d[_0x176e('0x24')]['limit']||null:null})[_0x176e('0x14')](function(_0x3dd707){logger[_0x176e('0x15')](_0x176e('0x20'),_0x32581d);logger[_0x176e('0x17')](_0x176e('0x20'),_0x32581d,JSON['stringify'](_0x3dd707));_0x583d00(_0x3dd707);})[_0x176e('0x1f')](function(_0x2c31d0){logger[_0x176e('0x1a')](_0x176e('0x20'),_0x2c31d0[_0x176e('0x1c')],_0x32581d);_0x46a66e(_0xca7567[_0x176e('0x1a')](0x1f4,_0x2c31d0[_0x176e('0x1c')]));});});};exports[_0x176e('0x27')]=function(_0xd504f5){return new Promise(function(_0x13affa,_0xb98fa9){return db[_0x176e('0x21')]['find']({'where':_0xd504f5[_0x176e('0x24')]?_0xd504f5[_0x176e('0x24')][_0x176e('0x28')]||null:null})[_0x176e('0x14')](function(_0x1b7575){if(_0x1b7575){return _0x1b7575[_0x176e('0x29')](_0xd504f5['body'][_0x176e('0x2a')],_[_0x176e('0x2b')](_0xd504f5[_0x176e('0x23')],[_0x176e('0x2a'),'id'])||{});}})['spread'](function(_0x13a6df){logger['info']('AddTags',_0xd504f5);logger[_0x176e('0x17')](_0x176e('0x2c'),_0xd504f5,JSON[_0x176e('0x19')](_0x13a6df));_0x13affa(_0x13a6df);})['catch'](function(_0x3c4deb){logger[_0x176e('0x1a')](_0x176e('0x2c'),_0x3c4deb[_0x176e('0x1c')],_0xd504f5);_0xb98fa9(_this[_0x176e('0x1a')](0x1f4,_0x3c4deb[_0x176e('0x1c')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 51478ef..b4b2570 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 _0x7406=['emit','removeListener','openchannelInteraction:','remove','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7406,0x116));var _0x6740=function(_0x1d4923,_0x4e222f){_0x1d4923=_0x1d4923-0x0;var _0x14ea9a=_0x7406[_0x1d4923];return _0x14ea9a;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=['save',_0x6740('0x0'),_0x6740('0x1')];function createListener(_0x5ad199,_0x3b50f3){return function(_0xa2442c){_0x3b50f3[_0x6740('0x2')](_0x5ad199,_0xa2442c);};}function removeListener(_0x2b5489,_0xc9d1ee){return function(){OpenchannelInteractionEvents[_0x6740('0x3')](_0x2b5489,_0xc9d1ee);};}exports['register']=function(_0x928ee5){for(var _0x579781=0x0,_0xed808e=events['length'];_0x579781<_0xed808e;_0x579781++){var _0x46cc00=events[_0x579781];var _0x56e7aa=createListener(_0x6740('0x4')+_0x46cc00,_0x928ee5);OpenchannelInteractionEvents['on'](_0x46cc00,_0x56e7aa);}}; \ No newline at end of file +var _0x7419=['./openchannelInteraction.events','save','remove','update','emit','removeListener','length','openchannelInteraction:'];(function(_0x5aa6a9,_0x3ae14c){var _0x119ce5=function(_0x4a97ef){while(--_0x4a97ef){_0x5aa6a9['push'](_0x5aa6a9['shift']());}};_0x119ce5(++_0x3ae14c);}(_0x7419,0xb8));var _0x9741=function(_0x5d28d7,_0x472778){_0x5d28d7=_0x5d28d7-0x0;var _0x595950=_0x7419[_0x5d28d7];return _0x595950;};'use strict';var OpenchannelInteractionEvents=require(_0x9741('0x0'));var events=[_0x9741('0x1'),_0x9741('0x2'),_0x9741('0x3')];function createListener(_0x4b21b4,_0x45b97c){return function(_0x1d15b8){_0x45b97c[_0x9741('0x4')](_0x4b21b4,_0x1d15b8);};}function removeListener(_0x49ca0c,_0x37d5a9){return function(){OpenchannelInteractionEvents[_0x9741('0x5')](_0x49ca0c,_0x37d5a9);};}exports['register']=function(_0x4bd559){for(var _0x3f8eff=0x0,_0x54e488=events[_0x9741('0x6')];_0x3f8eff<_0x54e488;_0x3f8eff++){var _0x1b5164=events[_0x3f8eff];var _0x5b0b33=createListener(_0x9741('0x7')+_0x1b5164,_0x4bd559);OpenchannelInteractionEvents['on'](_0x1b5164,_0x5b0b33);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 8e38e94..3cb617c 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 _0xa9e0=['index','/describe','show','post','isAuthenticated','tracked','openchannel','openchannelmessage:create','update','put','/:id/accept','accept','reject','delete','/:id','destroy','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get'];(function(_0x26eba2,_0x1cad46){var _0x3d1e14=function(_0x297083){while(--_0x297083){_0x26eba2['push'](_0x26eba2['shift']());}};_0x3d1e14(++_0x1cad46);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),interaction[_0x0a9e('0xe')](_0x0a9e('0xf'),_0x0a9e('0x10')),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0x11')]);router[_0x0a9e('0x12')](_0x0a9e('0x13'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);router[_0x0a9e('0x12')]('/:id/reject',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x15')]);router[_0x0a9e('0x16')](_0x0a9e('0x17'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x18')]);module['exports']=router; \ No newline at end of file +var _0x70e0=['put','update','/:id/accept','accept','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','isAuthenticated','describe','get','/:id','show','post','openchannel','openchannelmessage:create','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x70e0,0x17b));var _0x070e=function(_0x641da4,_0x301197){_0x641da4=_0x641da4-0x0;var _0x1d1736=_0x70e0[_0x641da4];return _0x1d1736;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');var controller=require(_0x070e('0x7'));router['get']('/',auth[_0x070e('0x8')](),controller['index']);router['get']('/describe',auth[_0x070e('0x8')](),controller[_0x070e('0x9')]);router[_0x070e('0xa')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0xc')]);router[_0x070e('0xd')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x070e('0xe'),_0x070e('0xf')),controller[_0x070e('0x10')]);router[_0x070e('0x11')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0x12')]);router[_0x070e('0x11')](_0x070e('0x13'),auth[_0x070e('0x8')](),controller[_0x070e('0x14')]);router['put']('/:id/reject',auth[_0x070e('0x8')](),controller['reject']);router['delete']('/:id',auth[_0x070e('0x8')](),controller[_0x070e('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 1195150..4432b21 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 _0x0901=['BOOLEAN','out','DATE','STRING','sequelize','exports','TEXT','medium'];(function(_0x4715d2,_0x3371b2){var _0x141811=function(_0x520bc6){while(--_0x520bc6){_0x4715d2['push'](_0x4715d2['shift']());}};_0x141811(++_0x3371b2);}(_0x0901,0x134));var _0x1090=function(_0x4343d0,_0x50fc6d){_0x4343d0=_0x4343d0-0x0;var _0x39da84=_0x0901[_0x4343d0];return _0x39da84;};'use strict';var Sequelize=require(_0x1090('0x0'));module[_0x1090('0x1')]={'body':{'type':Sequelize[_0x1090('0x2')](_0x1090('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x1090('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x1090('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x1090('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x1090('0x6')]},'providerName':{'type':Sequelize[_0x1090('0x7')]},'providerResponse':{'type':Sequelize[_0x1090('0x2')]}}; \ No newline at end of file +var _0x7497=['TEXT','ENUM','out','DATE','STRING','sequelize','exports'];(function(_0x1ee6f4,_0x3e85b8){var _0x3e0cfd=function(_0x51609a){while(--_0x51609a){_0x1ee6f4['push'](_0x1ee6f4['shift']());}};_0x3e0cfd(++_0x3e85b8);}(_0x7497,0xd0));var _0x7749=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7497[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x7749('0x0'));module[_0x7749('0x1')]={'body':{'type':Sequelize[_0x7749('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x7749('0x3')]('in',_0x7749('0x4')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x7749('0x5')]},'providerName':{'type':Sequelize[_0x7749('0x6')]},'providerResponse':{'type':Sequelize[_0x7749('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 123fafd..c123e7b 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 _0x6f12=['update','destroy','sendStatus','stack','map','OpenchannelMessage','rawAttributes','type','name','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','catch','show','params','find','create','body','openchannel-interactions','accept','openchannel','read','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteractionId','isNil','read1stAt','format','interaction','role','null','AcceptMessage','acceptMessage','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','manual','SIP/%s','channel','event','EventManager','acceptmessage','OpenchannelInteraction','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','internal','interface','motionChannel','rejectmessage','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','http','client','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','status','end','json','limit','count','offset','apply','reject'];(function(_0x2e9c0b,_0x17d089){var _0x4c6196=function(_0x250679){while(--_0x250679){_0x2e9c0b['push'](_0x2e9c0b['shift']());}};_0x4c6196(++_0x17d089);}(_0x6f12,0x1c5));var _0x26f1=function(_0x50982e,_0x523fba){_0x50982e=_0x50982e-0x0;var _0x2c75ff=_0x6f12[_0x50982e];return _0x2c75ff;};'use strict';var emlformat=require(_0x26f1('0x0'));var rimraf=require(_0x26f1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x26f1('0x2'));var rp=require('request-promise');var moment=require(_0x26f1('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x26f1('0x4'));var util=require(_0x26f1('0x5'));var path=require(_0x26f1('0x6'));var sox=require(_0x26f1('0x7'));var csv=require(_0x26f1('0x8'));var ejs=require(_0x26f1('0x9'));var fs=require('fs');var fs_extra=require(_0x26f1('0xa'));var _=require('lodash');var squel=require(_0x26f1('0xb'));var crypto=require('crypto');var jsforce=require(_0x26f1('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x26f1('0xd'));var Papa=require('papaparse');var Redis=require(_0x26f1('0xe'));var authService=require(_0x26f1('0xf'));var qs=require(_0x26f1('0x10'));var as=require(_0x26f1('0x11'));var hardwareService=require(_0x26f1('0x12'));var logger=require(_0x26f1('0x13'))(_0x26f1('0x14'));var utils=require(_0x26f1('0x15'));var config=require(_0x26f1('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x26f1('0x17'))['db'];config[_0x26f1('0x18')]=_[_0x26f1('0x19')](config[_0x26f1('0x18')],{'host':_0x26f1('0x1a'),'port':0x18eb});var socket=require(_0x26f1('0x1b'))(new Redis(config[_0x26f1('0x18')]));require(_0x26f1('0x1c'))[_0x26f1('0x1d')](socket);var jayson=require(_0x26f1('0x1e'));var client=jayson['client'][_0x26f1('0x1f')]({'port':0x232c});var client9002=jayson[_0x26f1('0x20')][_0x26f1('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0xd254b2,_0x1de82f,_0x2d0bd2,_0x4ce7c6){return new BPromise(function(_0x3ca0c4,_0x399b94){var _0x17c1d3=_0x4ce7c6||client;return _0x17c1d3[_0x26f1('0x21')](_0xd254b2,_0x2d0bd2)[_0x26f1('0x22')](function(_0x4fdfb2){logger[_0x26f1('0x23')](_0x26f1('0x24'),_0x1de82f,_0x26f1('0x25'));logger['debug']('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x1de82f,_0x26f1('0x25'),JSON[_0x26f1('0x26')](_0x4fdfb2));if(_0x4fdfb2[_0x26f1('0x27')]){if(_0x4fdfb2[_0x26f1('0x27')][_0x26f1('0x28')]===0x1f4){logger[_0x26f1('0x27')]('OpenchannelMessage,\x20%s,\x20%s',_0x1de82f,_0x4fdfb2[_0x26f1('0x27')][_0x26f1('0x29')]);return _0x399b94(_0x4fdfb2[_0x26f1('0x27')][_0x26f1('0x29')]);}logger[_0x26f1('0x27')](_0x26f1('0x24'),_0x1de82f,_0x4fdfb2['error'][_0x26f1('0x29')]);return _0x3ca0c4(_0x4fdfb2[_0x26f1('0x27')][_0x26f1('0x29')]);}else{logger[_0x26f1('0x23')](_0x26f1('0x24'),_0x1de82f,_0x26f1('0x25'));_0x3ca0c4(_0x4fdfb2[_0x26f1('0x2a')][_0x26f1('0x29')]);}})['catch'](function(_0x492658){logger[_0x26f1('0x27')](_0x26f1('0x24'),_0x1de82f,_0x492658);_0x399b94(_0x492658);});});}function respondWithStatusCode(_0xd30269,_0x385b52){_0x385b52=_0x385b52||0xcc;return function(_0x2c34d8){if(_0x2c34d8){return _0xd30269['sendStatus'](_0x385b52);}return _0xd30269[_0x26f1('0x2b')](_0x385b52)[_0x26f1('0x2c')]();};}function respondWithResult(_0x2fdd6e,_0x8de5f3){_0x8de5f3=_0x8de5f3||0xc8;return function(_0x2f19eb){if(_0x2f19eb){return _0x2fdd6e['status'](_0x8de5f3)[_0x26f1('0x2d')](_0x2f19eb);}};}function respondWithFilteredResult(_0x40d4b9,_0x49c410){return function(_0x55a78a){if(_0x55a78a){var _0x11f993=typeof _0x49c410['offset']==='undefined'&&typeof _0x49c410[_0x26f1('0x2e')]==='undefined';var _0x11b3de=_0x55a78a[_0x26f1('0x2f')];var _0x3cbcf7=_0x11f993?0x0:_0x49c410[_0x26f1('0x30')];var _0x9f8802=_0x11f993?_0x55a78a[_0x26f1('0x2f')]:_0x49c410[_0x26f1('0x30')]+_0x49c410[_0x26f1('0x2e')];var _0x44f11f;if(_0x9f8802>=_0x11b3de){_0x9f8802=_0x11b3de;_0x44f11f=0xc8;}else{_0x44f11f=0xce;}_0x40d4b9[_0x26f1('0x2b')](_0x44f11f);return _0x40d4b9['set']('Content-Range',_0x3cbcf7+'-'+_0x9f8802+'/'+_0x11b3de)[_0x26f1('0x2d')](_0x55a78a);}return null;};}function patchUpdates(_0x2df825){return function(_0x5b61dc){try{jsonpatch[_0x26f1('0x31')](_0x5b61dc,_0x2df825,!![]);}catch(_0x1634d0){return BPromise[_0x26f1('0x32')](_0x1634d0);}return _0x5b61dc['save']();};}function saveUpdates(_0x3dd3b0,_0x4cb8f1){return function(_0x3df97b){if(_0x3df97b){return _0x3df97b[_0x26f1('0x33')](_0x3dd3b0)[_0x26f1('0x22')](function(_0x55efda){return _0x55efda;});}return null;};}function removeEntity(_0x105bdd,_0x2af032){return function(_0x45a682){if(_0x45a682){return _0x45a682[_0x26f1('0x34')]()['then'](function(){_0x105bdd[_0x26f1('0x2b')](0xcc)[_0x26f1('0x2c')]();});}};}function handleEntityNotFound(_0x117e3f,_0x1a95c8){return function(_0x161c02){if(!_0x161c02){_0x117e3f[_0x26f1('0x35')](0x194);}return _0x161c02;};}function handleError(_0x21f785,_0x2036db){_0x2036db=_0x2036db||0x1f4;return function(_0x4e0104){logger[_0x26f1('0x27')](_0x4e0104[_0x26f1('0x36')]);if(_0x4e0104['name']){delete _0x4e0104['name'];}_0x21f785[_0x26f1('0x2b')](_0x2036db)['send'](_0x4e0104);};}exports['index']=function(_0x3fd04d,_0x51b13b){var _0x21b418={},_0x5e2617={},_0x29c11b={'count':0x0,'rows':[]};var _0x3c34a1=_[_0x26f1('0x37')](db[_0x26f1('0x38')][_0x26f1('0x39')],function(_0x354649){return{'name':_0x354649['fieldName'],'type':_0x354649[_0x26f1('0x3a')]['key']};});_0x5e2617['model']=_[_0x26f1('0x37')](_0x3c34a1,_0x26f1('0x3b'));_0x5e2617[_0x26f1('0x3c')]=_[_0x26f1('0x3d')](_0x3fd04d[_0x26f1('0x3c')]);_0x5e2617[_0x26f1('0x3e')]=_[_0x26f1('0x3f')](_0x5e2617[_0x26f1('0x40')],_0x5e2617[_0x26f1('0x3c')]);_0x21b418['attributes']=_[_0x26f1('0x3f')](_0x5e2617[_0x26f1('0x40')],qs['fields'](_0x3fd04d['query'][_0x26f1('0x41')]));_0x21b418[_0x26f1('0x42')]=_0x21b418[_0x26f1('0x42')][_0x26f1('0x43')]?_0x21b418[_0x26f1('0x42')]:_0x5e2617['model'];if(!_0x3fd04d[_0x26f1('0x3c')][_0x26f1('0x44')]('nolimit')){_0x21b418['limit']=qs[_0x26f1('0x2e')](_0x3fd04d[_0x26f1('0x3c')]['limit']);_0x21b418[_0x26f1('0x30')]=qs[_0x26f1('0x30')](_0x3fd04d[_0x26f1('0x3c')][_0x26f1('0x30')]);}_0x21b418[_0x26f1('0x45')]=qs[_0x26f1('0x46')](_0x3fd04d[_0x26f1('0x3c')][_0x26f1('0x46')]);_0x21b418[_0x26f1('0x47')]=qs[_0x26f1('0x3e')](_[_0x26f1('0x48')](_0x3fd04d[_0x26f1('0x3c')],_0x5e2617[_0x26f1('0x3e')]),_0x3c34a1);if(_0x3fd04d['query'][_0x26f1('0x49')]){_0x21b418[_0x26f1('0x47')]=_[_0x26f1('0x4a')](_0x21b418['where'],{'$or':_[_0x26f1('0x37')](_0x3c34a1,function(_0x56726a){if(_0x56726a[_0x26f1('0x3a')]!==_0x26f1('0x4b')){var _0x5c3698={};_0x5c3698[_0x56726a['name']]={'$like':'%'+_0x3fd04d[_0x26f1('0x3c')]['filter']+'%'};return _0x5c3698;}})});}_0x21b418=_[_0x26f1('0x4a')]({},_0x21b418,_0x3fd04d[_0x26f1('0x4c')]);var _0x34f9ed={'where':_0x21b418[_0x26f1('0x47')]};return db['OpenchannelMessage']['count'](_0x34f9ed)[_0x26f1('0x22')](function(_0x5b909d){_0x29c11b[_0x26f1('0x2f')]=_0x5b909d;if(_0x3fd04d['query'][_0x26f1('0x4d')]){_0x21b418['include']=[{'all':!![]}];}return db[_0x26f1('0x38')]['findAll'](_0x21b418);})[_0x26f1('0x22')](function(_0x199c58){_0x29c11b['rows']=_0x199c58;return _0x29c11b;})[_0x26f1('0x22')](respondWithFilteredResult(_0x51b13b,_0x21b418))[_0x26f1('0x4e')](handleError(_0x51b13b,null));};exports[_0x26f1('0x4f')]=function(_0x79741b,_0x317255){var _0x57039d={'raw':!![],'where':{'id':_0x79741b[_0x26f1('0x50')]['id']}},_0x3b9b4c={};_0x3b9b4c[_0x26f1('0x40')]=_['keys'](db[_0x26f1('0x38')][_0x26f1('0x39')]);_0x3b9b4c[_0x26f1('0x3c')]=_[_0x26f1('0x3d')](_0x79741b[_0x26f1('0x3c')]);_0x3b9b4c[_0x26f1('0x3e')]=_['intersection'](_0x3b9b4c[_0x26f1('0x40')],_0x3b9b4c[_0x26f1('0x3c')]);_0x57039d[_0x26f1('0x42')]=_[_0x26f1('0x3f')](_0x3b9b4c['model'],qs[_0x26f1('0x41')](_0x79741b['query'][_0x26f1('0x41')]));_0x57039d[_0x26f1('0x42')]=_0x57039d[_0x26f1('0x42')][_0x26f1('0x43')]?_0x57039d[_0x26f1('0x42')]:_0x3b9b4c[_0x26f1('0x40')];if(_0x79741b[_0x26f1('0x3c')]['includeAll']){_0x57039d['include']=[{'all':!![]}];}_0x57039d=_['merge']({},_0x57039d,_0x79741b[_0x26f1('0x4c')]);return db['OpenchannelMessage'][_0x26f1('0x51')](_0x57039d)[_0x26f1('0x22')](handleEntityNotFound(_0x317255,null))['then'](respondWithResult(_0x317255,null))[_0x26f1('0x4e')](handleError(_0x317255,null));};exports[_0x26f1('0x52')]=function(_0x46e6d3,_0x191a33){return db[_0x26f1('0x38')]['create'](_0x46e6d3[_0x26f1('0x53')],{})['then'](respondWithResult(_0x191a33,0xc9))[_0x26f1('0x4e')](handleError(_0x191a33,null));};exports['update']=function(_0x8d19ea,_0x59da9a){if(_0x8d19ea[_0x26f1('0x53')]['id']){delete _0x8d19ea[_0x26f1('0x53')]['id'];}return db[_0x26f1('0x38')]['find']({'where':{'id':_0x8d19ea[_0x26f1('0x50')]['id']}})[_0x26f1('0x22')](handleEntityNotFound(_0x59da9a,null))['then'](saveUpdates(_0x8d19ea[_0x26f1('0x53')],null))[_0x26f1('0x22')](respondWithResult(_0x59da9a,null))[_0x26f1('0x4e')](handleError(_0x59da9a,null));};exports['destroy']=function(_0x2b636e,_0x56a7ca){return db[_0x26f1('0x38')][_0x26f1('0x51')]({'where':{'id':_0x2b636e[_0x26f1('0x50')]['id']}})[_0x26f1('0x22')](handleEntityNotFound(_0x56a7ca,null))[_0x26f1('0x22')](removeEntity(_0x56a7ca,null))[_0x26f1('0x4e')](handleError(_0x56a7ca,null));};exports['describe']=function(_0x193fd3,_0x583ff3){return db[_0x26f1('0x38')]['describe']()[_0x26f1('0x22')](respondWithResult(_0x583ff3,null))[_0x26f1('0x4e')](handleError(_0x583ff3,null));};var interaction_log=require(_0x26f1('0x13'))(_0x26f1('0x54'));exports[_0x26f1('0x55')]=function(_0x1b31ec,_0x3c211b,_0x183cee){var _0x5b9f4c={'agent':{},'channel':_0x26f1('0x56')};if(_0x1b31ec['body']['id']){delete _0x1b31ec[_0x26f1('0x53')]['id'];}_0x1b31ec['body'][_0x26f1('0x57')]=!![];_0x1b31ec['body']['readAt']=moment()['format'](_0x26f1('0x58'));_0x1b31ec[_0x26f1('0x53')][_0x26f1('0x59')]=_0x1b31ec['body'][_0x26f1('0x59')]||_0x1b31ec[_0x26f1('0x5a')]['id'];_0x5b9f4c[_0x26f1('0x5b')]['id']=_0x1b31ec['body'][_0x26f1('0x59')];return db[_0x26f1('0x38')][_0x26f1('0x51')]({'where':{'id':_0x1b31ec[_0x26f1('0x50')]['id'],'UserId':null}})[_0x26f1('0x22')](handleEntityNotFound(_0x3c211b,null))[_0x26f1('0x22')](saveUpdates(_0x1b31ec[_0x26f1('0x53')],null))['then'](function(_0x3c534c){if(_0x3c534c){_0x5b9f4c[_0x26f1('0x29')]=_0x3c534c[_0x26f1('0x5c')]({'plain':!![]});return db['OpenchannelInteraction']['find']({'where':{'id':_0x3c534c[_0x26f1('0x5d')]}});}return null;})[_0x26f1('0x22')](handleEntityNotFound(_0x3c211b,null))[_0x26f1('0x22')](function(_0xfec0f1){if(_0xfec0f1){return _0xfec0f1[_0x26f1('0x33')]({'UserId':_0x1b31ec[_0x26f1('0x53')][_0x26f1('0x59')],'read1stAt':_[_0x26f1('0x5e')](_0xfec0f1[_0x26f1('0x5f')])?moment()[_0x26f1('0x60')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x489190){if(_0x489190){_0x5b9f4c[_0x26f1('0x61')]=_0x489190['get']({'plain':!![]});interaction_log[_0x26f1('0x23')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1b31ec['user']['id'],_0x1b31ec[_0x26f1('0x5a')]['name'],_0x1b31ec['user'][_0x26f1('0x62')],_0x5b9f4c[_0x26f1('0x61')]['id'],_0x1b31ec[_0x26f1('0x53')]?JSON['stringify'](_0x1b31ec['body']):_0x26f1('0x63'));return respondWithRpcPromise(_0x26f1('0x64'),_0x26f1('0x65'),_0x5b9f4c);}return null;})[_0x26f1('0x22')](function(_0x20d208){var _0x5260e0='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x20d208[_0x26f1('0x29')]['ContactId'];return db[_0x26f1('0x66')]['query'](_0x5260e0,{'type':db[_0x26f1('0x67')][_0x26f1('0x68')][_0x26f1('0x69')],'raw':!![]})[_0x26f1('0x22')](function(_0x204f31){return _0x204f31;});})['then'](function(_0x4389ec){if(_0x4389ec){_0x5b9f4c['message'][_0x26f1('0x6a')]=_0x4389ec[0x0];if(!_0x1b31ec[_0x26f1('0x53')][_0x26f1('0x59')])return;return db[_0x26f1('0x6b')][_0x26f1('0x51')]({'where':{'id':_0x1b31ec[_0x26f1('0x53')][_0x26f1('0x59')],'role':'agent'},'attributes':['id',_0x26f1('0x3b'),_0x26f1('0x6c'),_0x26f1('0x6d'),'internal'],'raw':!![]});}return null;})['then'](function(_0x57b5b2){if(!_0x57b5b2)return null;_0x5b9f4c['message'][_0x26f1('0x5b')]=_0x57b5b2;return _0x5b9f4c;})['then'](function(_0x29754a){if(_0x29754a){if(_0x1b31ec[_0x26f1('0x53')][_0x26f1('0x6e')]){_0x5b9f4c[_0x26f1('0x29')]['interface']=util[_0x26f1('0x60')](_0x26f1('0x6f'),_0x1b31ec[_0x26f1('0x5a')][_0x26f1('0x3b')]);_0x5b9f4c[_0x26f1('0x29')][_0x26f1('0x70')]=_0x5b9f4c[_0x26f1('0x70')];_0x5b9f4c[_0x26f1('0x29')]['motionChannel']=_0x5b9f4c[_0x26f1('0x70')];_0x5b9f4c[_0x26f1('0x29')][_0x26f1('0x71')]='accept';return respondWithRpcPromise(_0x26f1('0x72'),'EventManager',{'event':_0x26f1('0x73'),'message':_0x5b9f4c[_0x26f1('0x29')]},client9002)[_0x26f1('0x22')](function(){return _0x5b9f4c;});}return _0x5b9f4c;}return null;})[_0x26f1('0x22')](respondWithResult(_0x3c211b,null))[_0x26f1('0x4e')](handleError(_0x3c211b,null));};var interaction_log=require(_0x26f1('0x13'))('openchannel-interactions');exports[_0x26f1('0x32')]=function(_0x213533,_0x48100e,_0x404d09){var _0x1de4a0={'agent':{},'channel':_0x26f1('0x56')};if(_0x213533[_0x26f1('0x53')]['id']){delete _0x213533[_0x26f1('0x53')]['id'];}_0x213533[_0x26f1('0x53')]['UserId']=_0x213533['body']['UserId']||_0x213533['user']['id'];_0x1de4a0[_0x26f1('0x5b')]['id']=_0x213533[_0x26f1('0x53')]['UserId'];return db[_0x26f1('0x38')][_0x26f1('0x51')]({'where':{'id':_0x213533[_0x26f1('0x50')]['id'],'UserId':null}})[_0x26f1('0x22')](handleEntityNotFound(_0x48100e,null))[_0x26f1('0x22')](function(_0x90d1d4){if(_0x90d1d4){_0x1de4a0[_0x26f1('0x29')]=_0x90d1d4[_0x26f1('0x5c')]({'plain':!![]});return db[_0x26f1('0x74')][_0x26f1('0x51')]({'where':{'id':_0x90d1d4[_0x26f1('0x5d')]}});}return null;})[_0x26f1('0x22')](handleEntityNotFound(_0x48100e,null))['then'](function(_0x4565fc){if(_0x4565fc){_0x1de4a0['interaction']=_0x4565fc['get']({'plain':!![]});interaction_log[_0x26f1('0x23')](_0x26f1('0x75'),_0x213533['user']['id'],_0x213533[_0x26f1('0x5a')][_0x26f1('0x3b')],_0x213533[_0x26f1('0x5a')]['role'],_0x1de4a0['interaction']['id'],_0x213533[_0x26f1('0x53')]?JSON[_0x26f1('0x26')](_0x213533[_0x26f1('0x53')]):_0x26f1('0x63'));return respondWithRpcPromise(_0x26f1('0x76'),_0x26f1('0x77'),_0x1de4a0);}return null;})['then'](function(_0x2f7036){var _0xdc08e6=_0x26f1('0x78')+_0x2f7036['message'][_0x26f1('0x79')];return db[_0x26f1('0x66')][_0x26f1('0x3c')](_0xdc08e6,{'type':db[_0x26f1('0x67')][_0x26f1('0x68')][_0x26f1('0x69')],'raw':!![]})['then'](function(_0x4ea793){return _0x4ea793;});})[_0x26f1('0x22')](function(_0x14c279){if(_0x14c279){_0x1de4a0[_0x26f1('0x29')][_0x26f1('0x6a')]=_0x14c279[0x0];if(!_0x213533[_0x26f1('0x53')]['UserId'])return;return db[_0x26f1('0x6b')][_0x26f1('0x51')]({'where':{'id':_0x213533[_0x26f1('0x53')][_0x26f1('0x59')],'role':_0x26f1('0x5b')},'attributes':['id',_0x26f1('0x3b'),_0x26f1('0x6c'),_0x26f1('0x6d'),_0x26f1('0x7a')],'raw':!![]});}return null;})[_0x26f1('0x22')](function(_0x253246){if(!_0x253246)return null;_0x1de4a0[_0x26f1('0x29')][_0x26f1('0x5b')]=_0x253246;return _0x1de4a0;})[_0x26f1('0x22')](function(_0x3f14dc){if(_0x3f14dc){_0x3f14dc[_0x26f1('0x29')][_0x26f1('0x7b')]=util[_0x26f1('0x60')](_0x26f1('0x6f'),_0x213533[_0x26f1('0x5a')][_0x26f1('0x3b')]);_0x3f14dc[_0x26f1('0x29')][_0x26f1('0x70')]=_0x1de4a0['channel'];_0x3f14dc[_0x26f1('0x29')][_0x26f1('0x7c')]=_0x1de4a0[_0x26f1('0x70')];_0x3f14dc['message'][_0x26f1('0x71')]=_0x26f1('0x32');respondWithRpcPromise('EventManager','EventManager',{'event':_0x26f1('0x7d'),'message':_0x3f14dc[_0x26f1('0x29')]},client9002);return _0x1de4a0;}return null;})[_0x26f1('0x22')](respondWithResult(_0x48100e,null))[_0x26f1('0x4e')](handleError(_0x48100e,null));}; \ No newline at end of file +var _0x2739=['SELECT','contact','User','email','interface','rejectmessage','eml-format','zip-dir','fast-json-patch','bluebird','util','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','client','http','request','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','destroy','end','sendStatus','stack','name','send','index','map','fieldName','query','attributes','fields','length','model','hasOwnProperty','nolimit','sort','filters','pick','where','type','VIRTUAL','filter','merge','options','OpenchannelMessage','includeAll','include','findAll','rows','show','params','keys','rawAttributes','intersection','find','create','body','update','describe','../../config/logger','openchannel-interactions','openchannel','readAt','format','UserId','user','agent','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','fullname','internal','manual','SIP/%s','channel','motionChannel','event','accept','EventManager','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','sequelize'];(function(_0xbfe829,_0x4405a7){var _0x965f03=function(_0x3a388f){while(--_0x3a388f){_0xbfe829['push'](_0xbfe829['shift']());}};_0x965f03(++_0x4405a7);}(_0x2739,0x10e));var _0x9273=function(_0x470352,_0x1749a7){_0x470352=_0x470352-0x0;var _0x566537=_0x2739[_0x470352];return _0x566537;};'use strict';var emlformat=require(_0x9273('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9273('0x1'));var jsonpatch=require(_0x9273('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9273('0x3'));var Mustache=require('mustache');var util=require(_0x9273('0x4'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9273('0x5'));var fs=require('fs');var fs_extra=require(_0x9273('0x6'));var _=require(_0x9273('0x7'));var squel=require(_0x9273('0x8'));var crypto=require('crypto');var jsforce=require(_0x9273('0x9'));var deskjs=require(_0x9273('0xa'));var toCsv=require(_0x9273('0xb'));var querystring=require(_0x9273('0xc'));var Papa=require(_0x9273('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9273('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9273('0xf'));var logger=require('../../config/logger')(_0x9273('0x10'));var utils=require(_0x9273('0x11'));var config=require(_0x9273('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x9273('0x13'))['db'];config[_0x9273('0x14')]=_[_0x9273('0x15')](config[_0x9273('0x14')],{'host':_0x9273('0x16'),'port':0x18eb});var socket=require(_0x9273('0x17'))(new Redis(config[_0x9273('0x14')]));require(_0x9273('0x18'))[_0x9273('0x19')](socket);var jayson=require('jayson/promise');var client=jayson[_0x9273('0x1a')][_0x9273('0x1b')]({'port':0x232c});var client9002=jayson[_0x9273('0x1a')][_0x9273('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x3e4e74,_0xba9ee8,_0x44059b,_0x41f58c){return new BPromise(function(_0x98847b,_0x4fc5e2){var _0x4a9401=_0x41f58c||client;return _0x4a9401[_0x9273('0x1c')](_0x3e4e74,_0x44059b)[_0x9273('0x1d')](function(_0x63e10d){logger['info'](_0x9273('0x1e'),_0xba9ee8,_0x9273('0x1f'));logger[_0x9273('0x20')](_0x9273('0x21'),_0xba9ee8,_0x9273('0x1f'),JSON[_0x9273('0x22')](_0x63e10d));if(_0x63e10d[_0x9273('0x23')]){if(_0x63e10d[_0x9273('0x23')]['code']===0x1f4){logger[_0x9273('0x23')]('OpenchannelMessage,\x20%s,\x20%s',_0xba9ee8,_0x63e10d[_0x9273('0x23')][_0x9273('0x24')]);return _0x4fc5e2(_0x63e10d[_0x9273('0x23')][_0x9273('0x24')]);}logger[_0x9273('0x23')](_0x9273('0x1e'),_0xba9ee8,_0x63e10d[_0x9273('0x23')][_0x9273('0x24')]);return _0x98847b(_0x63e10d['error'][_0x9273('0x24')]);}else{logger[_0x9273('0x25')](_0x9273('0x1e'),_0xba9ee8,_0x9273('0x1f'));_0x98847b(_0x63e10d[_0x9273('0x26')]['message']);}})[_0x9273('0x27')](function(_0x2fb3e4){logger['error'](_0x9273('0x1e'),_0xba9ee8,_0x2fb3e4);_0x4fc5e2(_0x2fb3e4);});});}function respondWithStatusCode(_0x231783,_0x28ae05){_0x28ae05=_0x28ae05||0xcc;return function(_0xcfdde4){if(_0xcfdde4){return _0x231783['sendStatus'](_0x28ae05);}return _0x231783[_0x9273('0x28')](_0x28ae05)['end']();};}function respondWithResult(_0xc70363,_0x1f74f3){_0x1f74f3=_0x1f74f3||0xc8;return function(_0x97a6bd){if(_0x97a6bd){return _0xc70363[_0x9273('0x28')](_0x1f74f3)['json'](_0x97a6bd);}};}function respondWithFilteredResult(_0x2c3d09,_0xabd9e2){return function(_0xe84186){if(_0xe84186){var _0x1d89d6=typeof _0xabd9e2[_0x9273('0x29')]===_0x9273('0x2a')&&typeof _0xabd9e2[_0x9273('0x2b')]===_0x9273('0x2a');var _0x591191=_0xe84186[_0x9273('0x2c')];var _0x508be0=_0x1d89d6?0x0:_0xabd9e2[_0x9273('0x29')];var _0x4d2c75=_0x1d89d6?_0xe84186['count']:_0xabd9e2[_0x9273('0x29')]+_0xabd9e2[_0x9273('0x2b')];var _0x57393b;if(_0x4d2c75>=_0x591191){_0x4d2c75=_0x591191;_0x57393b=0xc8;}else{_0x57393b=0xce;}_0x2c3d09[_0x9273('0x28')](_0x57393b);return _0x2c3d09['set'](_0x9273('0x2d'),_0x508be0+'-'+_0x4d2c75+'/'+_0x591191)[_0x9273('0x2e')](_0xe84186);}return null;};}function patchUpdates(_0x38236e){return function(_0x2fde79){try{jsonpatch[_0x9273('0x2f')](_0x2fde79,_0x38236e,!![]);}catch(_0x3cbfd2){return BPromise[_0x9273('0x30')](_0x3cbfd2);}return _0x2fde79[_0x9273('0x31')]();};}function saveUpdates(_0xbb78cc,_0x4d9e8a){return function(_0x3eeb6b){if(_0x3eeb6b){return _0x3eeb6b['update'](_0xbb78cc)['then'](function(_0x532e96){return _0x532e96;});}return null;};}function removeEntity(_0x4c2f44,_0x161b98){return function(_0x83427b){if(_0x83427b){return _0x83427b[_0x9273('0x32')]()[_0x9273('0x1d')](function(){_0x4c2f44[_0x9273('0x28')](0xcc)[_0x9273('0x33')]();});}};}function handleEntityNotFound(_0x39d1fe,_0x3fc31a){return function(_0x2e9eeb){if(!_0x2e9eeb){_0x39d1fe[_0x9273('0x34')](0x194);}return _0x2e9eeb;};}function handleError(_0x5c7f57,_0x162a3e){_0x162a3e=_0x162a3e||0x1f4;return function(_0x1fd520){logger[_0x9273('0x23')](_0x1fd520[_0x9273('0x35')]);if(_0x1fd520[_0x9273('0x36')]){delete _0x1fd520[_0x9273('0x36')];}_0x5c7f57[_0x9273('0x28')](_0x162a3e)[_0x9273('0x37')](_0x1fd520);};}exports[_0x9273('0x38')]=function(_0xa30f5e,_0x47cfb2){var _0x10b97e={},_0x3bfd67={},_0x8cfb7d={'count':0x0,'rows':[]};var _0x4a570a=_[_0x9273('0x39')](db['OpenchannelMessage']['rawAttributes'],function(_0x27b053){return{'name':_0x27b053[_0x9273('0x3a')],'type':_0x27b053['type']['key']};});_0x3bfd67['model']=_[_0x9273('0x39')](_0x4a570a,_0x9273('0x36'));_0x3bfd67[_0x9273('0x3b')]=_['keys'](_0xa30f5e[_0x9273('0x3b')]);_0x3bfd67['filters']=_['intersection'](_0x3bfd67['model'],_0x3bfd67[_0x9273('0x3b')]);_0x10b97e[_0x9273('0x3c')]=_['intersection'](_0x3bfd67['model'],qs[_0x9273('0x3d')](_0xa30f5e['query'][_0x9273('0x3d')]));_0x10b97e[_0x9273('0x3c')]=_0x10b97e[_0x9273('0x3c')][_0x9273('0x3e')]?_0x10b97e[_0x9273('0x3c')]:_0x3bfd67[_0x9273('0x3f')];if(!_0xa30f5e[_0x9273('0x3b')][_0x9273('0x40')](_0x9273('0x41'))){_0x10b97e['limit']=qs[_0x9273('0x2b')](_0xa30f5e[_0x9273('0x3b')][_0x9273('0x2b')]);_0x10b97e[_0x9273('0x29')]=qs[_0x9273('0x29')](_0xa30f5e[_0x9273('0x3b')][_0x9273('0x29')]);}_0x10b97e['order']=qs['sort'](_0xa30f5e[_0x9273('0x3b')][_0x9273('0x42')]);_0x10b97e['where']=qs[_0x9273('0x43')](_[_0x9273('0x44')](_0xa30f5e[_0x9273('0x3b')],_0x3bfd67[_0x9273('0x43')]),_0x4a570a);if(_0xa30f5e[_0x9273('0x3b')]['filter']){_0x10b97e[_0x9273('0x45')]=_['merge'](_0x10b97e[_0x9273('0x45')],{'$or':_['map'](_0x4a570a,function(_0x36a337){if(_0x36a337[_0x9273('0x46')]!==_0x9273('0x47')){var _0x173f43={};_0x173f43[_0x36a337[_0x9273('0x36')]]={'$like':'%'+_0xa30f5e[_0x9273('0x3b')][_0x9273('0x48')]+'%'};return _0x173f43;}})});}_0x10b97e=_[_0x9273('0x49')]({},_0x10b97e,_0xa30f5e[_0x9273('0x4a')]);var _0x37ccfa={'where':_0x10b97e[_0x9273('0x45')]};return db[_0x9273('0x4b')][_0x9273('0x2c')](_0x37ccfa)[_0x9273('0x1d')](function(_0x13d3c9){_0x8cfb7d[_0x9273('0x2c')]=_0x13d3c9;if(_0xa30f5e[_0x9273('0x3b')][_0x9273('0x4c')]){_0x10b97e[_0x9273('0x4d')]=[{'all':!![]}];}return db[_0x9273('0x4b')][_0x9273('0x4e')](_0x10b97e);})[_0x9273('0x1d')](function(_0x77c9c0){_0x8cfb7d[_0x9273('0x4f')]=_0x77c9c0;return _0x8cfb7d;})[_0x9273('0x1d')](respondWithFilteredResult(_0x47cfb2,_0x10b97e))['catch'](handleError(_0x47cfb2,null));};exports[_0x9273('0x50')]=function(_0xe15109,_0x4f08a6){var _0x29ef59={'raw':!![],'where':{'id':_0xe15109[_0x9273('0x51')]['id']}},_0x398c94={};_0x398c94[_0x9273('0x3f')]=_[_0x9273('0x52')](db[_0x9273('0x4b')][_0x9273('0x53')]);_0x398c94[_0x9273('0x3b')]=_[_0x9273('0x52')](_0xe15109[_0x9273('0x3b')]);_0x398c94[_0x9273('0x43')]=_['intersection'](_0x398c94['model'],_0x398c94['query']);_0x29ef59[_0x9273('0x3c')]=_[_0x9273('0x54')](_0x398c94[_0x9273('0x3f')],qs['fields'](_0xe15109[_0x9273('0x3b')][_0x9273('0x3d')]));_0x29ef59['attributes']=_0x29ef59[_0x9273('0x3c')][_0x9273('0x3e')]?_0x29ef59[_0x9273('0x3c')]:_0x398c94[_0x9273('0x3f')];if(_0xe15109[_0x9273('0x3b')][_0x9273('0x4c')]){_0x29ef59[_0x9273('0x4d')]=[{'all':!![]}];}_0x29ef59=_[_0x9273('0x49')]({},_0x29ef59,_0xe15109[_0x9273('0x4a')]);return db[_0x9273('0x4b')][_0x9273('0x55')](_0x29ef59)[_0x9273('0x1d')](handleEntityNotFound(_0x4f08a6,null))[_0x9273('0x1d')](respondWithResult(_0x4f08a6,null))[_0x9273('0x27')](handleError(_0x4f08a6,null));};exports['create']=function(_0x37174c,_0x523e14){return db[_0x9273('0x4b')][_0x9273('0x56')](_0x37174c[_0x9273('0x57')],{})[_0x9273('0x1d')](respondWithResult(_0x523e14,0xc9))['catch'](handleError(_0x523e14,null));};exports[_0x9273('0x58')]=function(_0x4b1ab3,_0x13c505){if(_0x4b1ab3[_0x9273('0x57')]['id']){delete _0x4b1ab3[_0x9273('0x57')]['id'];}return db['OpenchannelMessage'][_0x9273('0x55')]({'where':{'id':_0x4b1ab3[_0x9273('0x51')]['id']}})['then'](handleEntityNotFound(_0x13c505,null))['then'](saveUpdates(_0x4b1ab3[_0x9273('0x57')],null))[_0x9273('0x1d')](respondWithResult(_0x13c505,null))['catch'](handleError(_0x13c505,null));};exports[_0x9273('0x32')]=function(_0x48f048,_0x38e474){return db[_0x9273('0x4b')][_0x9273('0x55')]({'where':{'id':_0x48f048[_0x9273('0x51')]['id']}})['then'](handleEntityNotFound(_0x38e474,null))[_0x9273('0x1d')](removeEntity(_0x38e474,null))[_0x9273('0x27')](handleError(_0x38e474,null));};exports[_0x9273('0x59')]=function(_0x364559,_0x588bdd){return db[_0x9273('0x4b')][_0x9273('0x59')]()[_0x9273('0x1d')](respondWithResult(_0x588bdd,null))[_0x9273('0x27')](handleError(_0x588bdd,null));};var interaction_log=require(_0x9273('0x5a'))(_0x9273('0x5b'));exports['accept']=function(_0x53562d,_0x488439,_0x5bc406){var _0x2308a8={'agent':{},'channel':_0x9273('0x5c')};if(_0x53562d[_0x9273('0x57')]['id']){delete _0x53562d[_0x9273('0x57')]['id'];}_0x53562d[_0x9273('0x57')]['read']=!![];_0x53562d['body'][_0x9273('0x5d')]=moment()[_0x9273('0x5e')]('YYYY-MM-DD\x20HH:mm:ss');_0x53562d[_0x9273('0x57')][_0x9273('0x5f')]=_0x53562d[_0x9273('0x57')]['UserId']||_0x53562d[_0x9273('0x60')]['id'];_0x2308a8[_0x9273('0x61')]['id']=_0x53562d[_0x9273('0x57')][_0x9273('0x5f')];return db[_0x9273('0x4b')][_0x9273('0x55')]({'where':{'id':_0x53562d[_0x9273('0x51')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x488439,null))['then'](saveUpdates(_0x53562d[_0x9273('0x57')],null))[_0x9273('0x1d')](function(_0x3d6f3d){if(_0x3d6f3d){_0x2308a8[_0x9273('0x24')]=_0x3d6f3d[_0x9273('0x62')]({'plain':!![]});return db[_0x9273('0x63')][_0x9273('0x55')]({'where':{'id':_0x3d6f3d[_0x9273('0x64')]}});}return null;})[_0x9273('0x1d')](handleEntityNotFound(_0x488439,null))[_0x9273('0x1d')](function(_0x27039b){if(_0x27039b){return _0x27039b[_0x9273('0x58')]({'UserId':_0x53562d['body'][_0x9273('0x5f')],'read1stAt':_[_0x9273('0x65')](_0x27039b[_0x9273('0x66')])?moment()[_0x9273('0x5e')](_0x9273('0x67')):undefined});}return null;})[_0x9273('0x1d')](function(_0x3c3b34){if(_0x3c3b34){_0x2308a8['interaction']=_0x3c3b34[_0x9273('0x62')]({'plain':!![]});interaction_log[_0x9273('0x25')](_0x9273('0x68'),_0x53562d[_0x9273('0x60')]['id'],_0x53562d[_0x9273('0x60')]['name'],_0x53562d[_0x9273('0x60')][_0x9273('0x69')],_0x2308a8[_0x9273('0x6a')]['id'],_0x53562d['body']?JSON[_0x9273('0x22')](_0x53562d['body']):'null');return respondWithRpcPromise('AcceptMessage',_0x9273('0x6b'),_0x2308a8);}return null;})[_0x9273('0x1d')](function(_0x316399){var _0x304244=_0x9273('0x6c')+_0x316399[_0x9273('0x24')][_0x9273('0x6d')];return db['sequelize'][_0x9273('0x3b')](_0x304244,{'type':db[_0x9273('0x6e')][_0x9273('0x6f')]['SELECT'],'raw':!![]})[_0x9273('0x1d')](function(_0x2640e3){return _0x2640e3;});})[_0x9273('0x1d')](function(_0x3344fa){if(_0x3344fa){_0x2308a8[_0x9273('0x24')]['contact']=_0x3344fa[0x0];if(!_0x53562d[_0x9273('0x57')][_0x9273('0x5f')])return;return db['User'][_0x9273('0x55')]({'where':{'id':_0x53562d[_0x9273('0x57')][_0x9273('0x5f')],'role':_0x9273('0x61')},'attributes':['id','name',_0x9273('0x70'),'email',_0x9273('0x71')],'raw':!![]});}return null;})['then'](function(_0x49f237){if(!_0x49f237)return null;_0x2308a8['message'][_0x9273('0x61')]=_0x49f237;return _0x2308a8;})['then'](function(_0x134ac3){if(_0x134ac3){if(_0x53562d['body'][_0x9273('0x72')]){_0x2308a8['message']['interface']=util['format'](_0x9273('0x73'),_0x53562d[_0x9273('0x60')][_0x9273('0x36')]);_0x2308a8[_0x9273('0x24')][_0x9273('0x74')]=_0x2308a8[_0x9273('0x74')];_0x2308a8[_0x9273('0x24')][_0x9273('0x75')]=_0x2308a8[_0x9273('0x74')];_0x2308a8['message'][_0x9273('0x76')]=_0x9273('0x77');return respondWithRpcPromise(_0x9273('0x78'),'EventManager',{'event':'acceptmessage','message':_0x2308a8[_0x9273('0x24')]},client9002)[_0x9273('0x1d')](function(){return _0x2308a8;});}return _0x2308a8;}return null;})['then'](respondWithResult(_0x488439,null))[_0x9273('0x27')](handleError(_0x488439,null));};var interaction_log=require(_0x9273('0x5a'))(_0x9273('0x5b'));exports[_0x9273('0x30')]=function(_0x5f2186,_0x2c4a71,_0x49cb27){var _0x16c2ec={'agent':{},'channel':_0x9273('0x5c')};if(_0x5f2186[_0x9273('0x57')]['id']){delete _0x5f2186[_0x9273('0x57')]['id'];}_0x5f2186[_0x9273('0x57')][_0x9273('0x5f')]=_0x5f2186['body'][_0x9273('0x5f')]||_0x5f2186['user']['id'];_0x16c2ec[_0x9273('0x61')]['id']=_0x5f2186[_0x9273('0x57')][_0x9273('0x5f')];return db[_0x9273('0x4b')][_0x9273('0x55')]({'where':{'id':_0x5f2186[_0x9273('0x51')]['id'],'UserId':null}})[_0x9273('0x1d')](handleEntityNotFound(_0x2c4a71,null))[_0x9273('0x1d')](function(_0xcb78d2){if(_0xcb78d2){_0x16c2ec['message']=_0xcb78d2[_0x9273('0x62')]({'plain':!![]});return db[_0x9273('0x63')][_0x9273('0x55')]({'where':{'id':_0xcb78d2[_0x9273('0x64')]}});}return null;})[_0x9273('0x1d')](handleEntityNotFound(_0x2c4a71,null))['then'](function(_0x180e05){if(_0x180e05){_0x16c2ec[_0x9273('0x6a')]=_0x180e05[_0x9273('0x62')]({'plain':!![]});interaction_log['info'](_0x9273('0x79'),_0x5f2186[_0x9273('0x60')]['id'],_0x5f2186['user'][_0x9273('0x36')],_0x5f2186[_0x9273('0x60')][_0x9273('0x69')],_0x16c2ec[_0x9273('0x6a')]['id'],_0x5f2186[_0x9273('0x57')]?JSON['stringify'](_0x5f2186[_0x9273('0x57')]):_0x9273('0x7a'));return respondWithRpcPromise(_0x9273('0x7b'),_0x9273('0x7c'),_0x16c2ec);}return null;})[_0x9273('0x1d')](function(_0x588125){var _0x36a7d2=_0x9273('0x6c')+_0x588125['message'][_0x9273('0x6d')];return db[_0x9273('0x7d')]['query'](_0x36a7d2,{'type':db[_0x9273('0x6e')]['QueryTypes'][_0x9273('0x7e')],'raw':!![]})[_0x9273('0x1d')](function(_0x2f7b49){return _0x2f7b49;});})[_0x9273('0x1d')](function(_0x5ca000){if(_0x5ca000){_0x16c2ec[_0x9273('0x24')][_0x9273('0x7f')]=_0x5ca000[0x0];if(!_0x5f2186[_0x9273('0x57')]['UserId'])return;return db[_0x9273('0x80')][_0x9273('0x55')]({'where':{'id':_0x5f2186[_0x9273('0x57')]['UserId'],'role':_0x9273('0x61')},'attributes':['id',_0x9273('0x36'),_0x9273('0x70'),_0x9273('0x81'),'internal'],'raw':!![]});}return null;})[_0x9273('0x1d')](function(_0x127725){if(!_0x127725)return null;_0x16c2ec[_0x9273('0x24')][_0x9273('0x61')]=_0x127725;return _0x16c2ec;})['then'](function(_0x139b2a){if(_0x139b2a){_0x139b2a[_0x9273('0x24')][_0x9273('0x82')]=util[_0x9273('0x5e')]('SIP/%s',_0x5f2186['user'][_0x9273('0x36')]);_0x139b2a[_0x9273('0x24')][_0x9273('0x74')]=_0x16c2ec['channel'];_0x139b2a['message']['motionChannel']=_0x16c2ec['channel'];_0x139b2a[_0x9273('0x24')]['event']=_0x9273('0x30');respondWithRpcPromise(_0x9273('0x78'),_0x9273('0x78'),{'event':_0x9273('0x83'),'message':_0x139b2a[_0x9273('0x24')]},client9002);return _0x16c2ec;}return null;})[_0x9273('0x1d')](respondWithResult(_0x2c4a71,null))['catch'](handleError(_0x2c4a71,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index cfd082e..359203c 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 _0x7974=['save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','OpenchannelMessage'];(function(_0xc35ea3,_0x38b7d5){var _0xa4d6a1=function(_0x3f5981){while(--_0x3f5981){_0xc35ea3['push'](_0xc35ea3['shift']());}};_0xa4d6a1(++_0x38b7d5);}(_0x7974,0x15d));var _0x4797=function(_0x4ae625,_0xf396d0){_0x4ae625=_0x4ae625-0x0;var _0x31accf=_0x7974[_0x4ae625];return _0x31accf;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0x4797('0x0'))['db'][_0x4797('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4797('0x2'),'afterUpdate':_0x4797('0x3'),'afterDestroy':_0x4797('0x4')};function emitEvent(_0x1171c9){return function(_0x3e5a62,_0x53b9b0,_0x5d685a){OpenchannelMessageEvents[_0x4797('0x5')](_0x1171c9+':'+_0x3e5a62['id'],_0x3e5a62);OpenchannelMessageEvents[_0x4797('0x5')](_0x1171c9,_0x3e5a62);_0x5d685a(null);};}for(var e in events){if(events[_0x4797('0x6')](e)){var event=events[e];OpenchannelMessage[_0x4797('0x7')](e,emitEvent(event));}}module[_0x4797('0x8')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x5cf6=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners'];(function(_0x5b584a,_0x3b5158){var _0xdf9cdd=function(_0x3a8e3d){while(--_0x3a8e3d){_0x5b584a['push'](_0x5b584a['shift']());}};_0xdf9cdd(++_0x3b5158);}(_0x5cf6,0x8b));var _0x65cf=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x5cf6[_0x27af45];return _0x18df21;};'use strict';var EventEmitter=require(_0x65cf('0x0'));var OpenchannelMessage=require(_0x65cf('0x1'))['db'][_0x65cf('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x65cf('0x3')](0x0);var events={'afterCreate':_0x65cf('0x4'),'afterUpdate':_0x65cf('0x5'),'afterDestroy':_0x65cf('0x6')};function emitEvent(_0x275feb){return function(_0x157c1f,_0xc9f480,_0x700bd5){OpenchannelMessageEvents[_0x65cf('0x7')](_0x275feb+':'+_0x157c1f['id'],_0x157c1f);OpenchannelMessageEvents[_0x65cf('0x7')](_0x275feb,_0x157c1f);_0x700bd5(null);};}for(var e in events){if(events[_0x65cf('0x8')](e)){var event=events[e];OpenchannelMessage[_0x65cf('0x9')](e,emitEvent(event));}}module[_0x65cf('0xa')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 9bd956a..0284540 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 _0x34d3=['createdAt','catch','error','CmContact','describe','find','OpenchannelAccountId','OpenchannelInteraction','Interactions','Contact','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','replyUri','length','Interaction','omit','POST','GET','info','OpenchannelMessage,\x20%s,\x20%s','Message\x20%d\x20forwarded\x20to\x20%s','threadId','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','define','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','then','update'];(function(_0x14380b,_0x2313bf){var _0x51c025=function(_0x8b5796){while(--_0x8b5796){_0x14380b['push'](_0x14380b['shift']());}};_0x51c025(++_0x2313bf);}(_0x34d3,0xe6));var _0x334d=function(_0x7044ee,_0x402f0c){_0x7044ee=_0x7044ee-0x0;var _0x1a927f=_0x34d3[_0x7044ee];return _0x1a927f;};'use strict';var _=require(_0x334d('0x0'));var util=require(_0x334d('0x1'));var logger=require(_0x334d('0x2'))(_0x334d('0x3'));var moment=require(_0x334d('0x4'));var BPromise=require('bluebird');var rp=require(_0x334d('0x5'));var fs=require('fs');var path=require(_0x334d('0x6'));var rimraf=require(_0x334d('0x7'));var config=require(_0x334d('0x8'));var attributes=require('./openchannelMessage.attributes');module['exports']=function(_0x76891c,_0x5e0534){return _0x76891c[_0x334d('0x9')]('OpenchannelMessage',attributes,{'tableName':_0x334d('0xa'),'paranoid':![],'indexes':[{'name':_0x334d('0xb'),'fields':[_0x334d('0xc')],'type':_0x334d('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4dc242,_0x42a94a,_0x2477ca){var _0x3834e3=_0x76891c[_0x334d('0xe')];var _0x39547c=_0x4dc242[_0x334d('0xf')]({'plain':!![]});if(_0x39547c[_0x334d('0x10')]['toLowerCase']()==='in'||_0x39547c[_0x334d('0x10')][_0x334d('0x11')]()===_0x334d('0x12')&&!_0x39547c[_0x334d('0x13')]&&!_[_0x334d('0x14')](_0x39547c[_0x334d('0x15')])){_0x3834e3['OpenchannelInteraction'][_0x334d('0x16')]({'where':{'id':_0x39547c['OpenchannelInteractionId']}})[_0x334d('0x17')](function(_0x56402c){if(_0x56402c){_0x56402c[_0x334d('0x18')]({'lastMsgAt':_0x39547c[_0x334d('0x19')],'lastMsgDirection':_0x39547c[_0x334d('0x10')][_0x334d('0x11')]()});}})[_0x334d('0x1a')](function(_0xbc9a6c){console[_0x334d('0x1b')](_0xbc9a6c);});}if(_0x39547c[_0x334d('0x10')]===_0x334d('0x12')&&!_0x39547c['secret']){var _0x568f37;_0x3834e3[_0x334d('0x1c')][_0x334d('0x1d')]()[_0x334d('0x17')](function(_0x5ef5a1){return _0x3834e3['OpenchannelAccount'][_0x334d('0x1e')]({'where':{'id':_0x39547c[_0x334d('0x1f')]},'include':[{'model':_0x3834e3[_0x334d('0x20')],'as':_0x334d('0x21'),'where':{'id':_0x39547c['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x3834e3['CmContact'],'as':_0x334d('0x22'),'attributes':_['keys'](_0x5ef5a1)}]}]});})['then'](function(_0x54378f){_0x568f37=_0x54378f['get']({'plain':!![]});if(_0x568f37&&_0x568f37['replyUri']){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x334d('0x23'),util[_0x334d('0x24')](_0x334d('0x25'),_0x39547c['id'],_0x568f37[_0x334d('0x26')]));if(_0x568f37[_0x334d('0x21')]&&_0x568f37['Interactions'][_0x334d('0x27')]){_0x39547c[_0x334d('0x28')]=_[_0x334d('0x29')](_0x568f37[_0x334d('0x21')][0x0],_0x334d('0x22'));_0x39547c[_0x334d('0x22')]=_0x568f37[_0x334d('0x21')][0x0]['Contact'];}var _0x42a94a={'method':_0x334d('0x2a'),'uri':encodeURI(_0x568f37[_0x334d('0x26')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x42a94a['method']){case _0x334d('0x2b'):_0x42a94a['qs']=_0x39547c;break;case _0x334d('0x2a'):_0x42a94a[_0x334d('0xc')]=_0x39547c;break;}return rp(_0x42a94a)[_0x334d('0x17')](function(_0x478911){logger[_0x334d('0x2c')](_0x334d('0x2d'),'afterCreate',util['format'](_0x334d('0x2e'),_0x39547c['id'],_0x568f37[_0x334d('0x26')]));if(_0x478911[_0x334d('0xc')][_0x334d('0x2f')]&&_0x478911[_0x334d('0xc')][_0x334d('0x2f')]!=_0x39547c[_0x334d('0x28')][_0x334d('0x2f')]){return _0x3834e3[_0x334d('0x20')][_0x334d('0x18')]({'threadId':_0x478911[_0x334d('0xc')]['threadId']},{'where':{'id':_0x39547c[_0x334d('0x28')]['id']}});}else{return;}})['then'](function(){return _0x4dc242[_0x334d('0x18')]({'read':!![]});})[_0x334d('0x1a')](function(_0x3e8df4){logger[_0x334d('0x1b')]('OpenchannelMessage,\x20%s,\x20%s',_0x334d('0x23'),util['inspect'](_0x3e8df4,{'showHidden':![],'depth':null}));_0x2477ca();});}else{_0x2477ca();}})[_0x334d('0x30')](function(){_0x2477ca();});}else{_0x2477ca();}}},'charset':_0x334d('0x31'),'collate':_0x334d('0x32')});}; \ No newline at end of file +var _0xd731=['OpenchannelAccountId','Interactions','OpenchannelInteractionId','Contact','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','length','Interaction','omit','POST','method','GET','Message\x20%d\x20forwarded\x20to\x20%s','threadId','inspect','utf8mb4_unicode_ci','util','../../config/logger','moment','request-promise','../../config/environment','./openchannelMessage.attributes','exports','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','OpenchannelInteraction','then','update','createdAt','catch','out','CmContact','describe','OpenchannelAccount','find'];(function(_0x1bc445,_0x2d6fe0){var _0x589e6b=function(_0xcdd664){while(--_0xcdd664){_0x1bc445['push'](_0x1bc445['shift']());}};_0x589e6b(++_0x2d6fe0);}(_0xd731,0x1df));var _0x1d73=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd731[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x1d73('0x0'));var logger=require(_0x1d73('0x1'))('api');var moment=require(_0x1d73('0x2'));var BPromise=require('bluebird');var rp=require(_0x1d73('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1d73('0x4'));var attributes=require(_0x1d73('0x5'));module[_0x1d73('0x6')]=function(_0x1e42ff,_0x17df58){return _0x1e42ff['define']('OpenchannelMessage',attributes,{'tableName':_0x1d73('0x7'),'paranoid':![],'indexes':[{'name':_0x1d73('0x8'),'fields':[_0x1d73('0x9')],'type':_0x1d73('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x6f92bc,_0x53f5f0,_0x5bc436){var _0x111aed=_0x1e42ff[_0x1d73('0xb')];var _0x302f4c=_0x6f92bc[_0x1d73('0xc')]({'plain':!![]});if(_0x302f4c['direction']['toLowerCase']()==='in'||_0x302f4c[_0x1d73('0xd')][_0x1d73('0xe')]()==='out'&&!_0x302f4c[_0x1d73('0xf')]&&!_[_0x1d73('0x10')](_0x302f4c['UserId'])){_0x111aed[_0x1d73('0x11')]['findOne']({'where':{'id':_0x302f4c['OpenchannelInteractionId']}})[_0x1d73('0x12')](function(_0x4d989d){if(_0x4d989d){_0x4d989d[_0x1d73('0x13')]({'lastMsgAt':_0x302f4c[_0x1d73('0x14')],'lastMsgDirection':_0x302f4c[_0x1d73('0xd')][_0x1d73('0xe')]()});}})[_0x1d73('0x15')](function(_0x39f934){console['error'](_0x39f934);});}if(_0x302f4c[_0x1d73('0xd')]===_0x1d73('0x16')&&!_0x302f4c[_0x1d73('0xf')]){var _0x2635d7;_0x111aed[_0x1d73('0x17')][_0x1d73('0x18')]()[_0x1d73('0x12')](function(_0x275f84){return _0x111aed[_0x1d73('0x19')][_0x1d73('0x1a')]({'where':{'id':_0x302f4c[_0x1d73('0x1b')]},'include':[{'model':_0x111aed[_0x1d73('0x11')],'as':_0x1d73('0x1c'),'where':{'id':_0x302f4c[_0x1d73('0x1d')]},'limit':0x1,'include':[{'model':_0x111aed[_0x1d73('0x17')],'as':_0x1d73('0x1e'),'attributes':_[_0x1d73('0x1f')](_0x275f84)}]}]});})[_0x1d73('0x12')](function(_0x1d00d3){_0x2635d7=_0x1d00d3[_0x1d73('0xc')]({'plain':!![]});if(_0x2635d7&&_0x2635d7[_0x1d73('0x20')]){logger[_0x1d73('0x21')](_0x1d73('0x22'),_0x1d73('0x23'),util['format']('Forwarding\x20message\x20%d\x20to\x20%s',_0x302f4c['id'],_0x2635d7[_0x1d73('0x20')]));if(_0x2635d7[_0x1d73('0x1c')]&&_0x2635d7[_0x1d73('0x1c')][_0x1d73('0x24')]){_0x302f4c[_0x1d73('0x25')]=_[_0x1d73('0x26')](_0x2635d7['Interactions'][0x0],_0x1d73('0x1e'));_0x302f4c[_0x1d73('0x1e')]=_0x2635d7[_0x1d73('0x1c')][0x0]['Contact'];}var _0x53f5f0={'method':_0x1d73('0x27'),'uri':encodeURI(_0x2635d7[_0x1d73('0x20')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x53f5f0[_0x1d73('0x28')]){case _0x1d73('0x29'):_0x53f5f0['qs']=_0x302f4c;break;case'POST':_0x53f5f0[_0x1d73('0x9')]=_0x302f4c;break;}return rp(_0x53f5f0)[_0x1d73('0x12')](function(_0x3526cb){logger[_0x1d73('0x21')](_0x1d73('0x22'),_0x1d73('0x23'),util['format'](_0x1d73('0x2a'),_0x302f4c['id'],_0x2635d7[_0x1d73('0x20')]));if(_0x3526cb['body'][_0x1d73('0x2b')]&&_0x3526cb[_0x1d73('0x9')][_0x1d73('0x2b')]!=_0x302f4c[_0x1d73('0x25')][_0x1d73('0x2b')]){return _0x111aed[_0x1d73('0x11')][_0x1d73('0x13')]({'threadId':_0x3526cb[_0x1d73('0x9')][_0x1d73('0x2b')]},{'where':{'id':_0x302f4c[_0x1d73('0x25')]['id']}});}else{return;}})['then'](function(){return _0x6f92bc['update']({'read':!![]});})['catch'](function(_0x13cad9){logger['error'](_0x1d73('0x22'),_0x1d73('0x23'),util[_0x1d73('0x2c')](_0x13cad9,{'showHidden':![],'depth':null}));_0x5bc436();});}else{_0x5bc436();}})['finally'](function(){_0x5bc436();});}else{_0x5bc436();}}},'charset':'utf8mb4','collate':_0x1d73('0x2d')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 59ea1f8..e97e897 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 _0xdb28=['then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateOpenchannelMessage','OpenchannelMessage','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','./openchannelMessage.socket','register','request'];(function(_0x163977,_0x4ef72e){var _0x28bf3a=function(_0x16f38a){while(--_0x16f38a){_0x163977['push'](_0x163977['shift']());}};_0x28bf3a(++_0x4ef72e);}(_0xdb28,0x106));var _0x8db2=function(_0x4e0186,_0x2042e0){_0x4e0186=_0x4e0186-0x0;var _0x556f2b=_0xdb28[_0x4e0186];return _0x556f2b;};'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')]('OpenchannelMessage,\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')]('CreateOpenchannelMessage',_0x1b64e4,JSON[_0x8db2('0x22')](_0x125be2));_0x431d60(_0x125be2);})['catch'](function(_0x5725f0){logger['error']('CreateOpenchannelMessage',_0x5725f0[_0x8db2('0x1a')],_0x1b64e4);_0x36a9ff(_0x58562e[_0x8db2('0x18')](0x1f4,_0x5725f0[_0x8db2('0x1a')]));});});}; \ No newline at end of file +var _0x5f2f=['OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','OpenchannelMessage','create','options','raw','CreateOpenchannelMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x34155a,_0xb66344){var _0x3a3d4f=function(_0xf36987){while(--_0xf36987){_0x34155a['push'](_0x34155a['shift']());}};_0x3a3d4f(++_0xb66344);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5be962,_0x4d5331){_0x5be962=_0x5be962-0x0;var _0x4641b8=_0x5f2f[_0x5be962];return _0x4641b8;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});config[_0xf5f2('0xc')]=_[_0xf5f2('0xd')](config['redis'],{'host':_0xf5f2('0xe'),'port':0x18eb});var socket=require(_0xf5f2('0xf'))(new Redis(config[_0xf5f2('0xc')]));require('./openchannelMessage.socket')[_0xf5f2('0x10')](socket);function respondWithRpcPromise(_0x15dd7c,_0x218ae3,_0x4e0e6b){return new BPromise(function(_0x977a59,_0x4ebbbe){return client['request'](_0x15dd7c,_0x4e0e6b)[_0xf5f2('0x11')](function(_0x151aba){logger['info'](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));logger[_0xf5f2('0x14')](_0xf5f2('0x15'),_0x218ae3,_0xf5f2('0x13'),JSON[_0xf5f2('0x16')](_0x151aba));if(_0x151aba['error']){if(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x18')]===0x1f4){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')]['message']);return _0x4ebbbe(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);return _0x977a59(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}else{logger[_0xf5f2('0x1a')](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));_0x977a59(_0x151aba[_0xf5f2('0x1b')][_0xf5f2('0x19')]);}})[_0xf5f2('0x1c')](function(_0x3cf5ea){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x3cf5ea);_0x4ebbbe(_0x3cf5ea);});});}exports['CreateOpenchannelMessage']=function(_0x34706d){var _0x47101e=this;return new Promise(function(_0x49dac2,_0x47acfc){return db[_0xf5f2('0x1d')][_0xf5f2('0x1e')](_0x34706d['body'],{'raw':_0x34706d[_0xf5f2('0x1f')]?_0x34706d[_0xf5f2('0x1f')][_0xf5f2('0x20')]===undefined?!![]:![]:!![]})[_0xf5f2('0x11')](function(_0x36f1cb){logger['info'](_0xf5f2('0x21'),_0x34706d);logger[_0xf5f2('0x14')](_0xf5f2('0x21'),_0x34706d,JSON[_0xf5f2('0x16')](_0x36f1cb));_0x49dac2(_0x36f1cb);})[_0xf5f2('0x1c')](function(_0x5bdf4a){logger['error'](_0xf5f2('0x21'),_0x5bdf4a[_0xf5f2('0x19')],_0x34706d);_0x47acfc(_0x47101e[_0xf5f2('0x17')](0x1f4,_0x5bdf4a[_0xf5f2('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index e48d1f4..b60d130 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 _0xc029=['save','remove','update','emit','removeListener','register','length','./openchannelMessage.events'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0xc029,0x1df));var _0x9c02=function(_0x2b45b5,_0x474458){_0x2b45b5=_0x2b45b5-0x0;var _0x1d9c06=_0xc029[_0x2b45b5];return _0x1d9c06;};'use strict';var OpenchannelMessageEvents=require(_0x9c02('0x0'));var events=[_0x9c02('0x1'),_0x9c02('0x2'),_0x9c02('0x3')];function createListener(_0x19e3b2,_0x1865b1){return function(_0x2de578){_0x1865b1[_0x9c02('0x4')](_0x19e3b2,_0x2de578);};}function removeListener(_0x39c897,_0x2a96cd){return function(){OpenchannelMessageEvents[_0x9c02('0x5')](_0x39c897,_0x2a96cd);};}exports[_0x9c02('0x6')]=function(_0x18792d){for(var _0x14c7f8=0x0,_0x2c3200=events[_0x9c02('0x7')];_0x14c7f8<_0x2c3200;_0x14c7f8++){var _0x222555=events[_0x14c7f8];var _0x43b16c=createListener('openchannelMessage:'+_0x222555,_0x18792d);OpenchannelMessageEvents['on'](_0x222555,_0x43b16c);}}; \ No newline at end of file +var _0xcf76=['update','removeListener','register','length','openchannelMessage:','remove'];(function(_0x57668b,_0x4efd40){var _0x474551=function(_0x23552c){while(--_0x23552c){_0x57668b['push'](_0x57668b['shift']());}};_0x474551(++_0x4efd40);}(_0xcf76,0x1df));var _0x6cf7=function(_0x475fd3,_0x3b0e39){_0x475fd3=_0x475fd3-0x0;var _0x27259d=_0xcf76[_0x475fd3];return _0x27259d;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=['save',_0x6cf7('0x0'),_0x6cf7('0x1')];function createListener(_0x50faad,_0x150aaa){return function(_0x2e69d3){_0x150aaa['emit'](_0x50faad,_0x2e69d3);};}function removeListener(_0x2ba42f,_0x3379c8){return function(){OpenchannelMessageEvents[_0x6cf7('0x2')](_0x2ba42f,_0x3379c8);};}exports[_0x6cf7('0x3')]=function(_0x3bacb3){for(var _0x5080e0=0x0,_0xa11300=events[_0x6cf7('0x4')];_0x5080e0<_0xa11300;_0x5080e0++){var _0x1d77a9=events[_0x5080e0];var _0x5ce841=createListener(_0x6cf7('0x5')+_0x1d77a9,_0x3bacb3);OpenchannelMessageEvents['on'](_0x1d77a9,_0x5ce841);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 12ea3f6..ca8ddd0 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 _0x974b=['getTeams','/:id/users','getAgents','post','create','/:id/teams','addAgents','put','/:id','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./openchannelQueue.controller','get','isAuthenticated','index','show','/:id/members'];(function(_0x15d382,_0x477abe){var _0x523c61=function(_0x4d2bbe){while(--_0x4d2bbe){_0x15d382['push'](_0x15d382['shift']());}};_0x523c61(++_0x477abe);}(_0x974b,0x113));var _0xb974=function(_0x13ce62,_0x189733){_0x13ce62=_0x13ce62-0x0;var _0x659d2=_0x974b[_0x13ce62];return _0x659d2;};'use strict';var multer=require(_0xb974('0x0'));var util=require('util');var path=require(_0xb974('0x1'));var timeout=require(_0xb974('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb974('0x3'));var interaction=require(_0xb974('0x4'));var config=require('../../config/environment');var controller=require(_0xb974('0x5'));router[_0xb974('0x6')]('/',auth[_0xb974('0x7')](),controller[_0xb974('0x8')]);router['get']('/describe',auth[_0xb974('0x7')](),controller['describe']);router[_0xb974('0x6')]('/:id',auth[_0xb974('0x7')](),controller[_0xb974('0x9')]);router['get'](_0xb974('0xa'),auth['isAuthenticated'](),controller['getMembers']);router[_0xb974('0x6')]('/:id/teams',auth[_0xb974('0x7')](),controller[_0xb974('0xb')]);router['get'](_0xb974('0xc'),auth[_0xb974('0x7')](),controller[_0xb974('0xd')]);router[_0xb974('0xe')]('/',auth[_0xb974('0x7')](),controller[_0xb974('0xf')]);router[_0xb974('0xe')](_0xb974('0x10'),auth[_0xb974('0x7')](),controller['addTeams']);router['post'](_0xb974('0xc'),auth[_0xb974('0x7')](),controller[_0xb974('0x11')]);router[_0xb974('0x12')](_0xb974('0x13'),auth['isAuthenticated'](),controller[_0xb974('0x14')]);router[_0xb974('0x15')](_0xb974('0x13'),auth[_0xb974('0x7')](),controller[_0xb974('0x16')]);router[_0xb974('0x15')](_0xb974('0x10'),auth[_0xb974('0x7')](),controller[_0xb974('0x17')]);router[_0xb974('0x15')](_0xb974('0xc'),auth[_0xb974('0x7')](),controller[_0xb974('0x18')]);module[_0xb974('0x19')]=router; \ No newline at end of file +var _0xaab9=['isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','/:id/users','post','create','addTeams','addAgents','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get'];(function(_0x285824,_0x3da647){var _0x311d7e=function(_0x2f3de0){while(--_0x2f3de0){_0x285824['push'](_0x285824['shift']());}};_0x311d7e(++_0x3da647);}(_0xaab9,0x120));var _0x9aab=function(_0x4ccee6,_0x51bbe2){_0x4ccee6=_0x4ccee6-0x0;var _0x1feada=_0xaab9[_0x4ccee6];return _0x1feada;};'use strict';var multer=require(_0x9aab('0x0'));var util=require(_0x9aab('0x1'));var path=require(_0x9aab('0x2'));var timeout=require(_0x9aab('0x3'));var express=require(_0x9aab('0x4'));var router=express[_0x9aab('0x5')]();var fs_extra=require(_0x9aab('0x6'));var auth=require(_0x9aab('0x7'));var interaction=require(_0x9aab('0x8'));var config=require(_0x9aab('0x9'));var controller=require(_0x9aab('0xa'));router[_0x9aab('0xb')]('/',auth[_0x9aab('0xc')](),controller[_0x9aab('0xd')]);router['get'](_0x9aab('0xe'),auth[_0x9aab('0xc')](),controller[_0x9aab('0xf')]);router[_0x9aab('0xb')](_0x9aab('0x10'),auth['isAuthenticated'](),controller[_0x9aab('0x11')]);router[_0x9aab('0xb')]('/:id/members',auth[_0x9aab('0xc')](),controller[_0x9aab('0x12')]);router[_0x9aab('0xb')](_0x9aab('0x13'),auth['isAuthenticated'](),controller[_0x9aab('0x14')]);router[_0x9aab('0xb')](_0x9aab('0x15'),auth[_0x9aab('0xc')](),controller['getAgents']);router[_0x9aab('0x16')]('/',auth[_0x9aab('0xc')](),controller[_0x9aab('0x17')]);router['post'](_0x9aab('0x13'),auth[_0x9aab('0xc')](),controller[_0x9aab('0x18')]);router['post'](_0x9aab('0x15'),auth[_0x9aab('0xc')](),controller[_0x9aab('0x19')]);router[_0x9aab('0x1a')](_0x9aab('0x10'),auth[_0x9aab('0xc')](),controller['update']);router[_0x9aab('0x1b')](_0x9aab('0x10'),auth[_0x9aab('0xc')](),controller[_0x9aab('0x1c')]);router[_0x9aab('0x1b')](_0x9aab('0x13'),auth[_0x9aab('0xc')](),controller['removeTeams']);router['delete'](_0x9aab('0x15'),auth[_0x9aab('0xc')](),controller['removeAgents']);module[_0x9aab('0x1d')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 2123f1f..1b812e7 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 _0x9bb5=['ENUM','beepall','sequelize','STRING','name','INTEGER'];(function(_0x537d9a,_0x454eb1){var _0x5e17cd=function(_0x322c25){while(--_0x322c25){_0x537d9a['push'](_0x537d9a['shift']());}};_0x5e17cd(++_0x454eb1);}(_0x9bb5,0x11c));var _0x59bb=function(_0x495378,_0xd34709){_0x495378=_0x495378-0x0;var _0x460fbc=_0x9bb5[_0x495378];return _0x460fbc;};'use strict';var Sequelize=require(_0x59bb('0x0'));module['exports']={'name':{'type':Sequelize[_0x59bb('0x1')],'unique':_0x59bb('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x59bb('0x1')]},'timeout':{'type':Sequelize[_0x59bb('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x59bb('0x4')]('rrmemory',_0x59bb('0x5'),'roundrobin')}}; \ No newline at end of file +var _0x8d79=['INTEGER','ENUM','rrmemory','roundrobin','sequelize','exports','STRING'];(function(_0xf679a9,_0x2d6a13){var _0x9910cd=function(_0x11bd98){while(--_0x11bd98){_0xf679a9['push'](_0xf679a9['shift']());}};_0x9910cd(++_0x2d6a13);}(_0x8d79,0x7b));var _0x98d7=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x8d79[_0x2064e5];return _0x21a233;};'use strict';var Sequelize=require(_0x98d7('0x0'));module[_0x98d7('0x1')]={'name':{'type':Sequelize[_0x98d7('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x98d7('0x2')]},'timeout':{'type':Sequelize[_0x98d7('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x98d7('0x4')](_0x98d7('0x5'),'beepall',_0x98d7('0x6'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 80aa5c5..36ae94f 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 _0xf548=['ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','QueryTypes','every','includes','all','union','compact','value','isEmpty','removeAgents','addAgents','omit','spread','isArray','userOpenchannelQueue:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','destroy','get','OpenchannelQueues','UserProfileResource','error','stack','name','send','index','map','OpenchannelQueue','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserOpenchannelQueue','User','findAndCountAll','UserId','agent','updatedAt','createdAt','format','%s/%s','SIP','getTeams','addTeams','ids','online','voicePause','flatMap','Agents','sequelize','transaction','each','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','Team','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams'];(function(_0x2b43c8,_0x372952){var _0x4fd78f=function(_0x3eee5d){while(--_0x3eee5d){_0x2b43c8['push'](_0x2b43c8['shift']());}};_0x4fd78f(++_0x372952);}(_0xf548,0x137));var _0x8f54=function(_0x3203a1,_0x46c498){_0x3203a1=_0x3203a1-0x0;var _0x24215e=_0xf548[_0x3203a1];return _0x24215e;};'use strict';var emlformat=require(_0x8f54('0x0'));var rimraf=require(_0x8f54('0x1'));var zipdir=require(_0x8f54('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8f54('0x3'));var moment=require(_0x8f54('0x4'));var BPromise=require(_0x8f54('0x5'));var Mustache=require('mustache');var util=require(_0x8f54('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x8f54('0x7'));var ejs=require(_0x8f54('0x8'));var fs=require('fs');var fs_extra=require(_0x8f54('0x9'));var _=require(_0x8f54('0xa'));var squel=require(_0x8f54('0xb'));var crypto=require(_0x8f54('0xc'));var jsforce=require(_0x8f54('0xd'));var deskjs=require(_0x8f54('0xe'));var toCsv=require(_0x8f54('0x7'));var querystring=require(_0x8f54('0xf'));var Papa=require('papaparse');var Redis=require(_0x8f54('0x10'));var authService=require(_0x8f54('0x11'));var qs=require(_0x8f54('0x12'));var as=require(_0x8f54('0x13'));var hardwareService=require(_0x8f54('0x14'));var logger=require(_0x8f54('0x15'))(_0x8f54('0x16'));var utils=require(_0x8f54('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x8f54('0x18'));var db=require(_0x8f54('0x19'))['db'];config[_0x8f54('0x1a')]=_['defaults'](config['redis'],{'host':_0x8f54('0x1b'),'port':0x18eb});var socket=require(_0x8f54('0x1c'))(new Redis(config['redis']));require(_0x8f54('0x1d'))[_0x8f54('0x1e')](socket);function respondWithStatusCode(_0x3d10dc,_0x3189a7){_0x3189a7=_0x3189a7||0xcc;return function(_0x223b0e){if(_0x223b0e){return _0x3d10dc[_0x8f54('0x1f')](_0x3189a7);}return _0x3d10dc[_0x8f54('0x20')](_0x3189a7)[_0x8f54('0x21')]();};}function respondWithResult(_0x32a30a,_0x590119){_0x590119=_0x590119||0xc8;return function(_0x375e02){if(_0x375e02){return _0x32a30a[_0x8f54('0x20')](_0x590119)['json'](_0x375e02);}};}function respondWithFilteredResult(_0x1e689d,_0xf356c1){return function(_0x2f911a){if(_0x2f911a){var _0x15b0ca=typeof _0xf356c1[_0x8f54('0x22')]===_0x8f54('0x23')&&typeof _0xf356c1[_0x8f54('0x24')]===_0x8f54('0x23');var _0x4779b2=_0x2f911a[_0x8f54('0x25')];var _0x428949=_0x15b0ca?0x0:_0xf356c1['offset'];var _0x64068e=_0x15b0ca?_0x2f911a[_0x8f54('0x25')]:_0xf356c1[_0x8f54('0x22')]+_0xf356c1[_0x8f54('0x24')];var _0x919e95;if(_0x64068e>=_0x4779b2){_0x64068e=_0x4779b2;_0x919e95=0xc8;}else{_0x919e95=0xce;}_0x1e689d['status'](_0x919e95);return _0x1e689d[_0x8f54('0x26')](_0x8f54('0x27'),_0x428949+'-'+_0x64068e+'/'+_0x4779b2)[_0x8f54('0x28')](_0x2f911a);}return null;};}function patchUpdates(_0x3591fa){return function(_0x577cdc){try{jsonpatch['apply'](_0x577cdc,_0x3591fa,!![]);}catch(_0x4a84ed){return BPromise[_0x8f54('0x29')](_0x4a84ed);}return _0x577cdc[_0x8f54('0x2a')]();};}function saveUpdates(_0x1069ba,_0x19924c){return function(_0x3f85af){if(_0x3f85af){return _0x3f85af[_0x8f54('0x2b')](_0x1069ba)[_0x8f54('0x2c')](function(_0x223cd4){return _0x223cd4;});}return null;};}function removeEntity(_0x3245ef,_0x32023f){return function(_0x583be0){if(_0x583be0){return _0x583be0[_0x8f54('0x2d')]()[_0x8f54('0x2c')](function(){var _0x304736=_0x583be0[_0x8f54('0x2e')]({'plain':!![]});var _0x36536b=_0x8f54('0x2f');return db[_0x8f54('0x30')][_0x8f54('0x2d')]({'where':{'type':_0x36536b,'resourceId':_0x304736['id']}})[_0x8f54('0x2c')](function(){return _0x583be0;});})[_0x8f54('0x2c')](function(){_0x3245ef['status'](0xcc)[_0x8f54('0x21')]();});}};}function handleEntityNotFound(_0x204714,_0x5141e9){return function(_0x2f94f2){if(!_0x2f94f2){_0x204714[_0x8f54('0x1f')](0x194);}return _0x2f94f2;};}function handleError(_0x89c503,_0x41d308){_0x41d308=_0x41d308||0x1f4;return function(_0x2f3801){logger[_0x8f54('0x31')](_0x2f3801[_0x8f54('0x32')]);if(_0x2f3801[_0x8f54('0x33')]){delete _0x2f3801[_0x8f54('0x33')];}_0x89c503[_0x8f54('0x20')](_0x41d308)[_0x8f54('0x34')](_0x2f3801);};}exports[_0x8f54('0x35')]=function(_0x4fa303,_0x1c30ca){var _0x29aa93={},_0x57b037={},_0x195601={'count':0x0,'rows':[]};var _0x2e7c69=_[_0x8f54('0x36')](db[_0x8f54('0x37')]['rawAttributes'],function(_0x2cec3c){return{'name':_0x2cec3c[_0x8f54('0x38')],'type':_0x2cec3c[_0x8f54('0x39')][_0x8f54('0x3a')]};});_0x57b037[_0x8f54('0x3b')]=_[_0x8f54('0x36')](_0x2e7c69,_0x8f54('0x33'));_0x57b037[_0x8f54('0x3c')]=_[_0x8f54('0x3d')](_0x4fa303['query']);_0x57b037['filters']=_[_0x8f54('0x3e')](_0x57b037['model'],_0x57b037[_0x8f54('0x3c')]);_0x29aa93['attributes']=_[_0x8f54('0x3e')](_0x57b037[_0x8f54('0x3b')],qs[_0x8f54('0x3f')](_0x4fa303[_0x8f54('0x3c')]['fields']));_0x29aa93[_0x8f54('0x40')]=_0x29aa93['attributes'][_0x8f54('0x41')]?_0x29aa93[_0x8f54('0x40')]:_0x57b037[_0x8f54('0x3b')];if(!_0x4fa303['query'][_0x8f54('0x42')](_0x8f54('0x43'))){_0x29aa93[_0x8f54('0x24')]=qs[_0x8f54('0x24')](_0x4fa303[_0x8f54('0x3c')][_0x8f54('0x24')]);_0x29aa93[_0x8f54('0x22')]=qs[_0x8f54('0x22')](_0x4fa303[_0x8f54('0x3c')][_0x8f54('0x22')]);}_0x29aa93[_0x8f54('0x44')]=qs[_0x8f54('0x45')](_0x4fa303['query']['sort']);_0x29aa93[_0x8f54('0x46')]=qs[_0x8f54('0x47')](_[_0x8f54('0x48')](_0x4fa303['query'],_0x57b037['filters']),_0x2e7c69);if(_0x4fa303[_0x8f54('0x3c')][_0x8f54('0x49')]){_0x29aa93[_0x8f54('0x46')]=_['merge'](_0x29aa93[_0x8f54('0x46')],{'$or':_['map'](_0x2e7c69,function(_0x2565bd){if(_0x2565bd[_0x8f54('0x39')]!==_0x8f54('0x4a')){var _0xe5964c={};_0xe5964c[_0x2565bd[_0x8f54('0x33')]]={'$like':'%'+_0x4fa303['query'][_0x8f54('0x49')]+'%'};return _0xe5964c;}})});}_0x29aa93=_[_0x8f54('0x4b')]({},_0x29aa93,_0x4fa303[_0x8f54('0x4c')]);var _0x4a18ae={'where':_0x29aa93[_0x8f54('0x46')]};return db[_0x8f54('0x37')][_0x8f54('0x25')](_0x4a18ae)[_0x8f54('0x2c')](function(_0x53cd79){_0x195601[_0x8f54('0x25')]=_0x53cd79;if(_0x4fa303[_0x8f54('0x3c')][_0x8f54('0x4d')]){_0x29aa93[_0x8f54('0x4e')]=[{'all':!![]}];}return db['OpenchannelQueue'][_0x8f54('0x4f')](_0x29aa93);})[_0x8f54('0x2c')](function(_0xf882c2){_0x195601[_0x8f54('0x50')]=_0xf882c2;return _0x195601;})[_0x8f54('0x2c')](respondWithFilteredResult(_0x1c30ca,_0x29aa93))[_0x8f54('0x51')](handleError(_0x1c30ca,null));};exports[_0x8f54('0x52')]=function(_0x410589,_0x349ec6){var _0x3b0230={'raw':!![],'where':{'id':_0x410589[_0x8f54('0x53')]['id']}},_0x1b230e={};_0x1b230e[_0x8f54('0x3b')]=_['keys'](db['OpenchannelQueue'][_0x8f54('0x54')]);_0x1b230e[_0x8f54('0x3c')]=_[_0x8f54('0x3d')](_0x410589[_0x8f54('0x3c')]);_0x1b230e[_0x8f54('0x47')]=_[_0x8f54('0x3e')](_0x1b230e['model'],_0x1b230e['query']);_0x3b0230['attributes']=_['intersection'](_0x1b230e[_0x8f54('0x3b')],qs[_0x8f54('0x3f')](_0x410589['query'][_0x8f54('0x3f')]));_0x3b0230['attributes']=_0x3b0230[_0x8f54('0x40')][_0x8f54('0x41')]?_0x3b0230[_0x8f54('0x40')]:_0x1b230e[_0x8f54('0x3b')];if(_0x410589['query']['includeAll']){_0x3b0230[_0x8f54('0x4e')]=[{'all':!![]}];}_0x3b0230=_['merge']({},_0x3b0230,_0x410589[_0x8f54('0x4c')]);return db[_0x8f54('0x37')]['find'](_0x3b0230)[_0x8f54('0x2c')](handleEntityNotFound(_0x349ec6,null))[_0x8f54('0x2c')](respondWithResult(_0x349ec6,null))[_0x8f54('0x51')](handleError(_0x349ec6,null));};exports[_0x8f54('0x55')]=function(_0x58eec8,_0x252556){return db[_0x8f54('0x37')][_0x8f54('0x55')](_0x58eec8[_0x8f54('0x56')],{})['then'](function(_0x2efc3b){var _0x1cf449=_0x58eec8[_0x8f54('0x57')][_0x8f54('0x2e')]({'plain':!![]});if(!_0x1cf449)throw new Error(_0x8f54('0x58'));if(_0x1cf449['role']===_0x8f54('0x57')){var _0x7dec9a=_0x2efc3b[_0x8f54('0x2e')]({'plain':!![]});var _0x2b600d=_0x8f54('0x2f');return db[_0x8f54('0x59')][_0x8f54('0x5a')]({'where':{'name':_0x2b600d,'userProfileId':_0x1cf449[_0x8f54('0x5b')]},'raw':!![]})[_0x8f54('0x2c')](function(_0x535f79){if(_0x535f79&&_0x535f79[_0x8f54('0x5c')]===0x0){return db[_0x8f54('0x30')]['create']({'name':_0x7dec9a[_0x8f54('0x33')],'resourceId':_0x7dec9a['id'],'type':_0x535f79[_0x8f54('0x33')],'sectionId':_0x535f79['id']},{})[_0x8f54('0x2c')](function(){return _0x2efc3b;});}else{return _0x2efc3b;}})[_0x8f54('0x51')](function(_0x3a4fde){logger['error'](_0x8f54('0x5d'),_0x3a4fde);throw _0x3a4fde;});}return _0x2efc3b;})['then'](respondWithResult(_0x252556,0xc9))[_0x8f54('0x51')](handleError(_0x252556,null));};exports[_0x8f54('0x2b')]=function(_0x368bae,_0x393eed){if(_0x368bae[_0x8f54('0x56')]['id']){delete _0x368bae[_0x8f54('0x56')]['id'];}return db[_0x8f54('0x37')][_0x8f54('0x5a')]({'where':{'id':_0x368bae[_0x8f54('0x53')]['id']}})[_0x8f54('0x2c')](handleEntityNotFound(_0x393eed,null))[_0x8f54('0x2c')](saveUpdates(_0x368bae[_0x8f54('0x56')],null))[_0x8f54('0x2c')](respondWithResult(_0x393eed,null))[_0x8f54('0x51')](handleError(_0x393eed,null));};exports[_0x8f54('0x2d')]=function(_0xe8fd91,_0x2ba929){return db[_0x8f54('0x37')][_0x8f54('0x5a')]({'where':{'id':_0xe8fd91[_0x8f54('0x53')]['id']}})['then'](handleEntityNotFound(_0x2ba929,null))[_0x8f54('0x2c')](removeEntity(_0x2ba929,null))['catch'](handleError(_0x2ba929,null));};exports[_0x8f54('0x5e')]=function(_0x53bb66,_0x2bc374){return db[_0x8f54('0x37')][_0x8f54('0x5e')]()[_0x8f54('0x2c')](respondWithResult(_0x2bc374,null))[_0x8f54('0x51')](handleError(_0x2bc374,null));};exports['getMembers']=function(_0x4795df,_0x55b19c,_0x3c7c24){var _0x463b99={'raw':!![],'where':{}},_0x336098={},_0x448350;return db['OpenchannelQueue'][_0x8f54('0x5f')]({'where':{'id':_0x4795df[_0x8f54('0x53')]['id']}})['then'](handleEntityNotFound(_0x55b19c,null))[_0x8f54('0x2c')](function(_0xa078a3){if(_0xa078a3){_0x448350=_0xa078a3[_0x8f54('0x2e')]({'plain':!![]});_0x336098['model']=_[_0x8f54('0x3d')](db[_0x8f54('0x60')]['rawAttributes']);_0x336098['query']=_[_0x8f54('0x3d')](_0x4795df[_0x8f54('0x3c')]);_0x336098[_0x8f54('0x47')]=_['intersection'](_0x336098['model'],_0x336098[_0x8f54('0x3c')]);_0x463b99[_0x8f54('0x40')]=_[_0x8f54('0x3e')](_0x336098['model'],qs['fields'](_0x4795df['query'][_0x8f54('0x3f')]));_0x463b99[_0x8f54('0x40')]=_0x463b99[_0x8f54('0x40')][_0x8f54('0x41')]?_0x463b99['attributes']:_0x336098[_0x8f54('0x3b')];if(!_0x4795df[_0x8f54('0x3c')][_0x8f54('0x42')]('nolimit')){_0x463b99['limit']=qs['limit'](_0x4795df['query'][_0x8f54('0x24')]);_0x463b99[_0x8f54('0x22')]=qs[_0x8f54('0x22')](_0x4795df[_0x8f54('0x3c')][_0x8f54('0x22')]);}_0x463b99[_0x8f54('0x44')]=qs['sort'](_0x4795df[_0x8f54('0x3c')][_0x8f54('0x45')]);_0x463b99[_0x8f54('0x46')]=qs['filters'](_[_0x8f54('0x48')](_0x4795df[_0x8f54('0x3c')],_0x336098[_0x8f54('0x47')]));_0x463b99[_0x8f54('0x46')]['OpenchannelQueueId']=_0xa078a3['id'];if(_0x4795df[_0x8f54('0x3c')][_0x8f54('0x49')]){_0x463b99[_0x8f54('0x46')]=_[_0x8f54('0x4b')](_0x463b99[_0x8f54('0x46')],{'$or':_[_0x8f54('0x36')](_0x463b99[_0x8f54('0x40')],function(_0xf6ac46){var _0x577dee={};_0x577dee[_0xf6ac46]={'$like':'%'+_0x4795df[_0x8f54('0x3c')][_0x8f54('0x49')]+'%'};return _0x577dee;})});}_0x463b99=_[_0x8f54('0x4b')]({},_0x463b99,_0x4795df[_0x8f54('0x4c')]);return db[_0x8f54('0x60')][_0x8f54('0x4f')](_0x463b99);}})['then'](function(_0x4e0831){if(_0x4e0831){return db[_0x8f54('0x61')][_0x8f54('0x62')]({'where':{'id':_[_0x8f54('0x36')](_0x4e0831,_0x8f54('0x63')),'role':_0x8f54('0x64')},'attributes':['id',_0x8f54('0x33'),'openchannelPause',_0x8f54('0x65'),_0x8f54('0x66')]});}})[_0x8f54('0x2c')](function(_0x106bc4){if(_0x106bc4){return{'count':_0x106bc4['count'],'rows':_[_0x8f54('0x36')](_0x106bc4[_0x8f54('0x50')],function(_0x2d3ae1){return{'membername':_0x2d3ae1[_0x8f54('0x33')],'UserId':_0x2d3ae1['id'],'queue_name':_0x448350['name'],'OpenchannelQueueId':_0x448350['id'],'interface':util[_0x8f54('0x67')](_0x8f54('0x68'),_0x8f54('0x69'),_0x2d3ae1[_0x8f54('0x33')]),'penalty':0x0,'paused':_0x2d3ae1['openchannelPause'],'createdAt':_0x2d3ae1['createdAt'],'updatedAt':_0x2d3ae1[_0x8f54('0x65')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x55b19c,_0x463b99))['catch'](handleError(_0x55b19c,null));};exports[_0x8f54('0x6a')]=function(_0xcde7b5,_0x30e068,_0x521d9a){var _0x11f0a5={};var _0x23102a={};var _0x3e608e;var _0x5c77fb;return db[_0x8f54('0x37')]['findOne']({'where':{'id':_0xcde7b5[_0x8f54('0x53')]['id']}})[_0x8f54('0x2c')](handleEntityNotFound(_0x30e068,null))['then'](function(_0x3368c8){if(_0x3368c8){_0x3e608e=_0x3368c8;_0x23102a['model']=_[_0x8f54('0x3d')](db['Team'][_0x8f54('0x54')]);_0x23102a[_0x8f54('0x3c')]=_[_0x8f54('0x3d')](_0xcde7b5['query']);_0x23102a['filters']=_[_0x8f54('0x3e')](_0x23102a['model'],_0x23102a[_0x8f54('0x3c')]);_0x11f0a5['attributes']=_[_0x8f54('0x3e')](_0x23102a['model'],qs[_0x8f54('0x3f')](_0xcde7b5[_0x8f54('0x3c')][_0x8f54('0x3f')]));_0x11f0a5[_0x8f54('0x40')]=_0x11f0a5[_0x8f54('0x40')][_0x8f54('0x41')]?_0x11f0a5[_0x8f54('0x40')]:_0x23102a[_0x8f54('0x3b')];_0x11f0a5['order']=qs[_0x8f54('0x45')](_0xcde7b5[_0x8f54('0x3c')][_0x8f54('0x45')]);_0x11f0a5['where']=qs[_0x8f54('0x47')](_[_0x8f54('0x48')](_0xcde7b5[_0x8f54('0x3c')],_0x23102a['filters']));if(_0xcde7b5['query'][_0x8f54('0x49')]){_0x11f0a5[_0x8f54('0x46')]=_[_0x8f54('0x4b')](_0x11f0a5['where'],{'$or':_[_0x8f54('0x36')](_0x11f0a5[_0x8f54('0x40')],function(_0x2ac171){var _0x2c1641={};_0x2c1641[_0x2ac171]={'$like':'%'+_0xcde7b5[_0x8f54('0x3c')][_0x8f54('0x49')]+'%'};return _0x2c1641;})});}_0x11f0a5=_[_0x8f54('0x4b')]({},_0x11f0a5,_0xcde7b5[_0x8f54('0x4c')]);return _0x3e608e[_0x8f54('0x6a')](_0x11f0a5);}})[_0x8f54('0x2c')](function(_0xd83eec){if(_0xd83eec){_0x5c77fb=_0xd83eec[_0x8f54('0x41')];if(!_0xcde7b5['query'][_0x8f54('0x42')](_0x8f54('0x43'))){_0x11f0a5[_0x8f54('0x24')]=qs[_0x8f54('0x24')](_0xcde7b5[_0x8f54('0x3c')][_0x8f54('0x24')]);_0x11f0a5['offset']=qs[_0x8f54('0x22')](_0xcde7b5[_0x8f54('0x3c')][_0x8f54('0x22')]);}return _0x3e608e[_0x8f54('0x6a')](_0x11f0a5);}})[_0x8f54('0x2c')](function(_0x21bed8){if(_0x21bed8){return _0x21bed8?{'count':_0x5c77fb,'rows':_0x21bed8}:null;}})['then'](respondWithResult(_0x30e068,null))[_0x8f54('0x51')](handleError(_0x30e068,null));};exports[_0x8f54('0x6b')]=function(_0x5112dd,_0x14a1c5,_0x12a37c){var _0x131322=_0x5112dd[_0x8f54('0x56')][_0x8f54('0x6c')];return db['Team'][_0x8f54('0x4f')]({'where':{'id':_0x131322},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id','name',_0x8f54('0x6d'),_0x8f54('0x6e'),'interface'],'raw':!![]}]})[_0x8f54('0x2c')](function(_0x50e551){if(_0x50e551){var _0x91a1e1=_[_0x8f54('0x6f')](_0x50e551,function(_0x54652f){var _0x418b25=_0x54652f[_0x8f54('0x2e')]({'plain':!![]});return _0x418b25[_0x8f54('0x70')];});return db['OpenchannelQueue'][_0x8f54('0x5a')]({'where':{'id':_0x5112dd['params']['id']}})[_0x8f54('0x2c')](function(_0x316972){return db[_0x8f54('0x71')][_0x8f54('0x72')](function(_0x4e339c){return _0x316972[_0x8f54('0x6b')](_0x131322,{'transaction':_0x4e339c})[_0x8f54('0x2c')](function(){return BPromise[_0x8f54('0x73')](_0x91a1e1,function(_0x1dcbec){return db[_0x8f54('0x60')][_0x8f54('0x74')]({'where':{'UserId':_0x1dcbec['id'],'OpenchannelQueueId':_0x5112dd[_0x8f54('0x53')]['id']},'transaction':_0x4e339c});});})['then'](function(){_0x91a1e1[_0x8f54('0x75')](function(_0x28b086){socket[_0x8f54('0x76')](_0x8f54('0x77'),{'UserId':_0x28b086['id'],'OpenchannelQueueId':_0x316972['id']});});});});});}})[_0x8f54('0x2c')](respondWithStatusCode(_0x14a1c5,null))[_0x8f54('0x51')](handleError(_0x14a1c5,null));};exports[_0x8f54('0x78')]=function(_0xb511c3,_0x51b1b3,_0x2d2975){return db[_0x8f54('0x79')]['findAll']({'where':{'id':_0xb511c3[_0x8f54('0x3c')][_0x8f54('0x6c')]},'attributes':['id'],'include':[{'model':db[_0x8f54('0x61')],'as':_0x8f54('0x70'),'attributes':['id'],'raw':!![]}]})[_0x8f54('0x2c')](handleEntityNotFound(_0x51b1b3,null))['then'](function(_0x48b905){var _0x288f5b=_[_0x8f54('0x36')](_0x48b905,'id');var _0x399e18=[];var _0xcef708=[];var _0x3871a0=squel['select']();_0x3871a0['field'](_0x8f54('0x7a'))[_0x8f54('0x7b')](_0x8f54('0x7c'),'tq')[_0x8f54('0x7d')](_0x8f54('0x7e'),'ut',_0x8f54('0x7f'))['where'](_0x8f54('0x80'),_0xb511c3[_0x8f54('0x53')]['id']);for(var _0x58700d=0x0;_0x58700d<_0x48b905['length'];_0x58700d+=0x1){let _0x4ebcd5=_0x48b905[_0x58700d];for(var _0x1bf991=0x0;_0x1bf991<_0x4ebcd5[_0x8f54('0x70')][_0x8f54('0x41')];_0x1bf991+=0x1){let _0x5b5c2a=_0x4ebcd5[_0x8f54('0x70')][_0x1bf991];var _0x11a3ae=_0x3871a0[_0x8f54('0x81')]();_0x11a3ae['where'](_0x8f54('0x82'),_0x5b5c2a['id']);_0xcef708['push'](db[_0x8f54('0x71')][_0x8f54('0x3c')](_0x11a3ae['toString'](),{'type':db['sequelize'][_0x8f54('0x83')]['SELECT']})['then'](function(_0x1635a5){if(_0x1635a5['length']===0x1){return _0x5b5c2a['id'];}else{var _0x412c8a=_[_0x8f54('0x84')](_[_0x8f54('0x36')](_0x1635a5,'TeamId'),function(_0x27f5d8){return _[_0x8f54('0x85')](_0x288f5b,_0x27f5d8);});if(_0x412c8a){return _0x5b5c2a['id'];}}}));}}return BPromise[_0x8f54('0x86')](_0xcef708)[_0x8f54('0x2c')](function(_0x558721){_0x399e18=_(_0x399e18)[_0x8f54('0x87')](_0x558721)[_0x8f54('0x88')]()[_0x8f54('0x89')]();return db[_0x8f54('0x37')][_0x8f54('0x5a')]({'where':{'id':_0xb511c3[_0x8f54('0x53')]['id']}})['then'](function(_0x5accfe){return db['sequelize'][_0x8f54('0x72')](function(_0xbc9a4b){return _0x5accfe[_0x8f54('0x78')](_0xb511c3[_0x8f54('0x3c')]['ids'],{'transaction':_0xbc9a4b})[_0x8f54('0x2c')](function(){if(!_[_0x8f54('0x8a')](_0x399e18)){return _0x5accfe[_0x8f54('0x8b')](_0x399e18,{'transaction':_0xbc9a4b});}})['then'](function(){_0x399e18[_0x8f54('0x75')](function(_0x404c83){socket['emit']('userOpenchannelQueue:remove',{'UserId':_0x404c83,'OpenchannelQueueId':_0x5accfe['id']});});});});});});})[_0x8f54('0x2c')](respondWithStatusCode(_0x51b1b3,null))[_0x8f54('0x51')](handleError(_0x51b1b3,null));};exports[_0x8f54('0x8c')]=function(_0x4f6d85,_0x3ff629,_0x4b0ba7){return db['OpenchannelQueue'][_0x8f54('0x5a')]({'where':{'id':_0x4f6d85[_0x8f54('0x53')]['id']}})['then'](handleEntityNotFound(_0x3ff629,null))[_0x8f54('0x2c')](function(_0x4b6397){if(_0x4b6397){return _0x4b6397[_0x8f54('0x8c')](_0x4f6d85[_0x8f54('0x56')][_0x8f54('0x6c')],_[_0x8f54('0x8d')](_0x4f6d85['body'],[_0x8f54('0x6c'),'id'])||{})[_0x8f54('0x8e')](function(_0x53ca5e){for(var _0x4b2f21=0x0;_0x4b2f21<_0x4f6d85[_0x8f54('0x56')][_0x8f54('0x6c')][_0x8f54('0x41')];_0x4b2f21+=0x1){socket['emit'](_0x8f54('0x77'),{'UserId':Number(_0x4f6d85[_0x8f54('0x56')][_0x8f54('0x6c')][_0x4b2f21]),'OpenchannelQueueId':Number(_0x4f6d85['params']['id'])});}return _0x53ca5e;});}})[_0x8f54('0x2c')](respondWithResult(_0x3ff629,null))[_0x8f54('0x51')](handleError(_0x3ff629,null));};exports['removeAgents']=function(_0x2ed228,_0x479ae5,_0x5d85ce){return db[_0x8f54('0x37')][_0x8f54('0x5a')]({'where':{'id':_0x2ed228[_0x8f54('0x53')]['id']}})[_0x8f54('0x2c')](handleEntityNotFound(_0x479ae5,null))['then'](function(_0x324d06){if(_0x324d06){return _0x324d06[_0x8f54('0x8b')](_0x2ed228[_0x8f54('0x3c')][_0x8f54('0x6c')])['then'](function(){if(_[_0x8f54('0x8f')](_0x2ed228[_0x8f54('0x3c')][_0x8f54('0x6c')])){for(var _0x40bdb7=0x0;_0x40bdb7<_0x2ed228[_0x8f54('0x3c')][_0x8f54('0x6c')][_0x8f54('0x41')];_0x40bdb7+=0x1){socket[_0x8f54('0x76')]('userOpenchannelQueue:remove',{'UserId':Number(_0x2ed228[_0x8f54('0x3c')][_0x8f54('0x6c')][_0x40bdb7]),'OpenchannelQueueId':Number(_0x2ed228[_0x8f54('0x53')]['id'])});}}else{socket['emit'](_0x8f54('0x90'),{'UserId':Number(_0x2ed228[_0x8f54('0x3c')][_0x8f54('0x6c')]),'OpenchannelQueueId':Number(_0x2ed228[_0x8f54('0x53')]['id'])});}});}})[_0x8f54('0x2c')](respondWithStatusCode(_0x479ae5,null))[_0x8f54('0x51')](handleError(_0x479ae5,null));};exports[_0x8f54('0x91')]=function(_0x36ae86,_0x1f13b1,_0x187609){var _0x155391={};var _0x5ee188={};var _0x27ba93;var _0x9c280a;return db['OpenchannelQueue'][_0x8f54('0x5f')]({'where':{'id':_0x36ae86['params']['id']}})[_0x8f54('0x2c')](handleEntityNotFound(_0x1f13b1,null))[_0x8f54('0x2c')](function(_0xdad86c){if(_0xdad86c){_0x27ba93=_0xdad86c;_0x5ee188[_0x8f54('0x3b')]=_[_0x8f54('0x3d')](db[_0x8f54('0x61')][_0x8f54('0x54')]);_0x5ee188['query']=_['keys'](_0x36ae86[_0x8f54('0x3c')]);_0x5ee188[_0x8f54('0x47')]=_[_0x8f54('0x3e')](_0x5ee188[_0x8f54('0x3b')],_0x5ee188['query']);_0x155391[_0x8f54('0x40')]=_[_0x8f54('0x3e')](_0x5ee188[_0x8f54('0x3b')],qs[_0x8f54('0x3f')](_0x36ae86[_0x8f54('0x3c')]['fields']));_0x155391[_0x8f54('0x40')]=_0x155391['attributes'][_0x8f54('0x41')]?_0x155391[_0x8f54('0x40')]:_0x5ee188[_0x8f54('0x3b')];_0x155391[_0x8f54('0x44')]=qs[_0x8f54('0x45')](_0x36ae86[_0x8f54('0x3c')]['sort']);_0x155391[_0x8f54('0x46')]=qs[_0x8f54('0x47')](_['pick'](_0x36ae86[_0x8f54('0x3c')],_0x5ee188['filters']));if(_0x36ae86[_0x8f54('0x3c')][_0x8f54('0x49')]){_0x155391[_0x8f54('0x46')]=_[_0x8f54('0x4b')](_0x155391[_0x8f54('0x46')],{'$or':_['map'](_0x155391[_0x8f54('0x40')],function(_0x3e1da0){var _0x5ded2b={};_0x5ded2b[_0x3e1da0]={'$like':'%'+_0x36ae86[_0x8f54('0x3c')][_0x8f54('0x49')]+'%'};return _0x5ded2b;})});}_0x155391=_['merge']({},_0x155391,_0x36ae86['options']);return _0x27ba93[_0x8f54('0x91')](_0x155391);}})[_0x8f54('0x2c')](function(_0x21551d){if(_0x21551d){_0x9c280a=_0x21551d[_0x8f54('0x41')];if(!_0x36ae86[_0x8f54('0x3c')][_0x8f54('0x42')](_0x8f54('0x43'))){_0x155391[_0x8f54('0x24')]=qs[_0x8f54('0x24')](_0x36ae86[_0x8f54('0x3c')][_0x8f54('0x24')]);_0x155391[_0x8f54('0x22')]=qs['offset'](_0x36ae86['query'][_0x8f54('0x22')]);}return _0x27ba93[_0x8f54('0x91')](_0x155391);}})['then'](function(_0x42c3dc){if(_0x42c3dc){return _0x42c3dc?{'count':_0x9c280a,'rows':_0x42c3dc}:null;}})['then'](respondWithResult(_0x1f13b1,null))[_0x8f54('0x51')](handleError(_0x1f13b1,null));}; \ No newline at end of file +var _0x84d0=['tq.TeamId','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','push','toString','QueryTypes','SELECT','every','includes','all','value','isEmpty','removeAgents','addAgents','spread','emit','userOpenchannelQueue:remove','getAgents','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','get','OpenchannelQueues','UserProfileResource','destroy','error','stack','send','map','OpenchannelQueue','rawAttributes','type','model','name','query','keys','intersection','fields','attributes','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserOpenchannelQueue','length','hasOwnProperty','nolimit','OpenchannelQueueId','User','UserId','agent','openchannelPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','addTeams','ids','Team','Agents','online','interface','flatMap','sequelize','transaction','each','forEach','userOpenchannelQueue:save','removeTeams','field'];(function(_0x2eaa5f,_0x5a61b3){var _0x3a8d62=function(_0x1e4c5c){while(--_0x1e4c5c){_0x2eaa5f['push'](_0x2eaa5f['shift']());}};_0x3a8d62(++_0x5a61b3);}(_0x84d0,0x127));var _0x084d=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x84d0[_0x4fde08];return _0x12e725;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x084d('0x0'));var zipdir=require(_0x084d('0x1'));var jsonpatch=require(_0x084d('0x2'));var rp=require('request-promise');var moment=require(_0x084d('0x3'));var BPromise=require(_0x084d('0x4'));var Mustache=require(_0x084d('0x5'));var util=require(_0x084d('0x6'));var path=require(_0x084d('0x7'));var sox=require(_0x084d('0x8'));var csv=require(_0x084d('0x9'));var ejs=require(_0x084d('0xa'));var fs=require('fs');var fs_extra=require(_0x084d('0xb'));var _=require(_0x084d('0xc'));var squel=require(_0x084d('0xd'));var crypto=require('crypto');var jsforce=require(_0x084d('0xe'));var deskjs=require(_0x084d('0xf'));var toCsv=require(_0x084d('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x084d('0x10'));var qs=require(_0x084d('0x11'));var as=require(_0x084d('0x12'));var hardwareService=require(_0x084d('0x13'));var logger=require(_0x084d('0x14'))(_0x084d('0x15'));var utils=require(_0x084d('0x16'));var config=require(_0x084d('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x084d('0x18'))['db'];config[_0x084d('0x19')]=_[_0x084d('0x1a')](config['redis'],{'host':_0x084d('0x1b'),'port':0x18eb});var socket=require(_0x084d('0x1c'))(new Redis(config['redis']));require('./openchannelQueue.socket')['register'](socket);function respondWithStatusCode(_0xfee04c,_0x5d1fd2){_0x5d1fd2=_0x5d1fd2||0xcc;return function(_0x771cc9){if(_0x771cc9){return _0xfee04c[_0x084d('0x1d')](_0x5d1fd2);}return _0xfee04c[_0x084d('0x1e')](_0x5d1fd2)[_0x084d('0x1f')]();};}function respondWithResult(_0x1c1fd5,_0x548c5b){_0x548c5b=_0x548c5b||0xc8;return function(_0x452b1e){if(_0x452b1e){return _0x1c1fd5['status'](_0x548c5b)['json'](_0x452b1e);}};}function respondWithFilteredResult(_0x270679,_0x3bbb31){return function(_0x54ab5b){if(_0x54ab5b){var _0x430a22=typeof _0x3bbb31[_0x084d('0x20')]==='undefined'&&typeof _0x3bbb31['limit']===_0x084d('0x21');var _0x3efbce=_0x54ab5b[_0x084d('0x22')];var _0x4b7c18=_0x430a22?0x0:_0x3bbb31[_0x084d('0x20')];var _0x1615d6=_0x430a22?_0x54ab5b[_0x084d('0x22')]:_0x3bbb31[_0x084d('0x20')]+_0x3bbb31[_0x084d('0x23')];var _0x284d91;if(_0x1615d6>=_0x3efbce){_0x1615d6=_0x3efbce;_0x284d91=0xc8;}else{_0x284d91=0xce;}_0x270679['status'](_0x284d91);return _0x270679[_0x084d('0x24')](_0x084d('0x25'),_0x4b7c18+'-'+_0x1615d6+'/'+_0x3efbce)[_0x084d('0x26')](_0x54ab5b);}return null;};}function patchUpdates(_0x175f8a){return function(_0x280653){try{jsonpatch[_0x084d('0x27')](_0x280653,_0x175f8a,!![]);}catch(_0x2c2de0){return BPromise[_0x084d('0x28')](_0x2c2de0);}return _0x280653[_0x084d('0x29')]();};}function saveUpdates(_0x4e389c,_0x4c3c14){return function(_0x46708d){if(_0x46708d){return _0x46708d[_0x084d('0x2a')](_0x4e389c)[_0x084d('0x2b')](function(_0x371d63){return _0x371d63;});}return null;};}function removeEntity(_0xd942e8,_0x4fc185){return function(_0x4f2159){if(_0x4f2159){return _0x4f2159['destroy']()['then'](function(){var _0x53196c=_0x4f2159[_0x084d('0x2c')]({'plain':!![]});var _0x1d61d1=_0x084d('0x2d');return db[_0x084d('0x2e')][_0x084d('0x2f')]({'where':{'type':_0x1d61d1,'resourceId':_0x53196c['id']}})[_0x084d('0x2b')](function(){return _0x4f2159;});})[_0x084d('0x2b')](function(){_0xd942e8[_0x084d('0x1e')](0xcc)[_0x084d('0x1f')]();});}};}function handleEntityNotFound(_0x194b11,_0x1736c3){return function(_0x3d6d16){if(!_0x3d6d16){_0x194b11[_0x084d('0x1d')](0x194);}return _0x3d6d16;};}function handleError(_0x56b3b9,_0x4a0dd7){_0x4a0dd7=_0x4a0dd7||0x1f4;return function(_0x139147){logger[_0x084d('0x30')](_0x139147[_0x084d('0x31')]);if(_0x139147['name']){delete _0x139147['name'];}_0x56b3b9[_0x084d('0x1e')](_0x4a0dd7)[_0x084d('0x32')](_0x139147);};}exports['index']=function(_0xe8d45a,_0x3e1c52){var _0x198d41={},_0x3e9e35={},_0x4c50bc={'count':0x0,'rows':[]};var _0x48d55d=_[_0x084d('0x33')](db[_0x084d('0x34')][_0x084d('0x35')],function(_0x47ef6a){return{'name':_0x47ef6a['fieldName'],'type':_0x47ef6a[_0x084d('0x36')]['key']};});_0x3e9e35[_0x084d('0x37')]=_[_0x084d('0x33')](_0x48d55d,_0x084d('0x38'));_0x3e9e35[_0x084d('0x39')]=_[_0x084d('0x3a')](_0xe8d45a[_0x084d('0x39')]);_0x3e9e35['filters']=_[_0x084d('0x3b')](_0x3e9e35[_0x084d('0x37')],_0x3e9e35[_0x084d('0x39')]);_0x198d41['attributes']=_[_0x084d('0x3b')](_0x3e9e35['model'],qs[_0x084d('0x3c')](_0xe8d45a['query'][_0x084d('0x3c')]));_0x198d41[_0x084d('0x3d')]=_0x198d41['attributes']['length']?_0x198d41['attributes']:_0x3e9e35[_0x084d('0x37')];if(!_0xe8d45a[_0x084d('0x39')]['hasOwnProperty']('nolimit')){_0x198d41['limit']=qs[_0x084d('0x23')](_0xe8d45a['query'][_0x084d('0x23')]);_0x198d41[_0x084d('0x20')]=qs[_0x084d('0x20')](_0xe8d45a['query'][_0x084d('0x20')]);}_0x198d41[_0x084d('0x3e')]=qs[_0x084d('0x3f')](_0xe8d45a[_0x084d('0x39')][_0x084d('0x3f')]);_0x198d41[_0x084d('0x40')]=qs[_0x084d('0x41')](_[_0x084d('0x42')](_0xe8d45a[_0x084d('0x39')],_0x3e9e35['filters']),_0x48d55d);if(_0xe8d45a[_0x084d('0x39')]['filter']){_0x198d41[_0x084d('0x40')]=_[_0x084d('0x43')](_0x198d41[_0x084d('0x40')],{'$or':_[_0x084d('0x33')](_0x48d55d,function(_0x2fbf52){if(_0x2fbf52[_0x084d('0x36')]!==_0x084d('0x44')){var _0x1c897f={};_0x1c897f[_0x2fbf52[_0x084d('0x38')]]={'$like':'%'+_0xe8d45a[_0x084d('0x39')][_0x084d('0x45')]+'%'};return _0x1c897f;}})});}_0x198d41=_[_0x084d('0x43')]({},_0x198d41,_0xe8d45a[_0x084d('0x46')]);var _0x17c5b6={'where':_0x198d41['where']};return db[_0x084d('0x34')][_0x084d('0x22')](_0x17c5b6)[_0x084d('0x2b')](function(_0x4f3e89){_0x4c50bc[_0x084d('0x22')]=_0x4f3e89;if(_0xe8d45a[_0x084d('0x39')]['includeAll']){_0x198d41[_0x084d('0x47')]=[{'all':!![]}];}return db[_0x084d('0x34')][_0x084d('0x48')](_0x198d41);})['then'](function(_0x6edb0e){_0x4c50bc[_0x084d('0x49')]=_0x6edb0e;return _0x4c50bc;})[_0x084d('0x2b')](respondWithFilteredResult(_0x3e1c52,_0x198d41))[_0x084d('0x4a')](handleError(_0x3e1c52,null));};exports[_0x084d('0x4b')]=function(_0x397a5a,_0x479610){var _0x99e05e={'raw':!![],'where':{'id':_0x397a5a[_0x084d('0x4c')]['id']}},_0x415808={};_0x415808['model']=_['keys'](db['OpenchannelQueue']['rawAttributes']);_0x415808[_0x084d('0x39')]=_[_0x084d('0x3a')](_0x397a5a[_0x084d('0x39')]);_0x415808[_0x084d('0x41')]=_[_0x084d('0x3b')](_0x415808['model'],_0x415808[_0x084d('0x39')]);_0x99e05e[_0x084d('0x3d')]=_[_0x084d('0x3b')](_0x415808[_0x084d('0x37')],qs['fields'](_0x397a5a['query'][_0x084d('0x3c')]));_0x99e05e[_0x084d('0x3d')]=_0x99e05e[_0x084d('0x3d')]['length']?_0x99e05e['attributes']:_0x415808[_0x084d('0x37')];if(_0x397a5a[_0x084d('0x39')][_0x084d('0x4d')]){_0x99e05e[_0x084d('0x47')]=[{'all':!![]}];}_0x99e05e=_['merge']({},_0x99e05e,_0x397a5a['options']);return db[_0x084d('0x34')][_0x084d('0x4e')](_0x99e05e)[_0x084d('0x2b')](handleEntityNotFound(_0x479610,null))[_0x084d('0x2b')](respondWithResult(_0x479610,null))['catch'](handleError(_0x479610,null));};exports['create']=function(_0x248b27,_0x5e3fd1){return db[_0x084d('0x34')][_0x084d('0x4f')](_0x248b27[_0x084d('0x50')],{})['then'](function(_0x92ba8){var _0x48fdaf=_0x248b27[_0x084d('0x51')]['get']({'plain':!![]});if(!_0x48fdaf)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x48fdaf[_0x084d('0x52')]===_0x084d('0x51')){var _0x5b8aa8=_0x92ba8[_0x084d('0x2c')]({'plain':!![]});var _0x1b1d53=_0x084d('0x2d');return db['UserProfileSection'][_0x084d('0x4e')]({'where':{'name':_0x1b1d53,'userProfileId':_0x48fdaf['userProfileId']},'raw':!![]})['then'](function(_0x301f2a){if(_0x301f2a&&_0x301f2a['autoAssociation']===0x0){return db[_0x084d('0x2e')]['create']({'name':_0x5b8aa8[_0x084d('0x38')],'resourceId':_0x5b8aa8['id'],'type':_0x301f2a[_0x084d('0x38')],'sectionId':_0x301f2a['id']},{})[_0x084d('0x2b')](function(){return _0x92ba8;});}else{return _0x92ba8;}})[_0x084d('0x4a')](function(_0x4ca5e3){logger[_0x084d('0x30')](_0x084d('0x53'),_0x4ca5e3);throw _0x4ca5e3;});}return _0x92ba8;})['then'](respondWithResult(_0x5e3fd1,0xc9))[_0x084d('0x4a')](handleError(_0x5e3fd1,null));};exports[_0x084d('0x2a')]=function(_0x1ba346,_0x2ad439){if(_0x1ba346[_0x084d('0x50')]['id']){delete _0x1ba346[_0x084d('0x50')]['id'];}return db[_0x084d('0x34')][_0x084d('0x4e')]({'where':{'id':_0x1ba346[_0x084d('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2ad439,null))['then'](saveUpdates(_0x1ba346['body'],null))[_0x084d('0x2b')](respondWithResult(_0x2ad439,null))[_0x084d('0x4a')](handleError(_0x2ad439,null));};exports[_0x084d('0x2f')]=function(_0x1a042f,_0x2a77a0){return db['OpenchannelQueue'][_0x084d('0x4e')]({'where':{'id':_0x1a042f[_0x084d('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2a77a0,null))['then'](removeEntity(_0x2a77a0,null))[_0x084d('0x4a')](handleError(_0x2a77a0,null));};exports[_0x084d('0x54')]=function(_0x53184e,_0x21af2c){return db['OpenchannelQueue'][_0x084d('0x54')]()['then'](respondWithResult(_0x21af2c,null))[_0x084d('0x4a')](handleError(_0x21af2c,null));};exports[_0x084d('0x55')]=function(_0x4261e0,_0x5b75eb,_0x4a0e54){var _0x3d9bb1={'raw':!![],'where':{}},_0xd69a9a={},_0x59a83f;return db['OpenchannelQueue'][_0x084d('0x56')]({'where':{'id':_0x4261e0[_0x084d('0x4c')]['id']}})[_0x084d('0x2b')](handleEntityNotFound(_0x5b75eb,null))[_0x084d('0x2b')](function(_0x310110){if(_0x310110){_0x59a83f=_0x310110[_0x084d('0x2c')]({'plain':!![]});_0xd69a9a[_0x084d('0x37')]=_[_0x084d('0x3a')](db[_0x084d('0x57')][_0x084d('0x35')]);_0xd69a9a['query']=_[_0x084d('0x3a')](_0x4261e0[_0x084d('0x39')]);_0xd69a9a[_0x084d('0x41')]=_[_0x084d('0x3b')](_0xd69a9a[_0x084d('0x37')],_0xd69a9a[_0x084d('0x39')]);_0x3d9bb1['attributes']=_[_0x084d('0x3b')](_0xd69a9a['model'],qs[_0x084d('0x3c')](_0x4261e0['query'][_0x084d('0x3c')]));_0x3d9bb1[_0x084d('0x3d')]=_0x3d9bb1[_0x084d('0x3d')][_0x084d('0x58')]?_0x3d9bb1[_0x084d('0x3d')]:_0xd69a9a[_0x084d('0x37')];if(!_0x4261e0[_0x084d('0x39')][_0x084d('0x59')](_0x084d('0x5a'))){_0x3d9bb1[_0x084d('0x23')]=qs[_0x084d('0x23')](_0x4261e0[_0x084d('0x39')][_0x084d('0x23')]);_0x3d9bb1['offset']=qs[_0x084d('0x20')](_0x4261e0[_0x084d('0x39')]['offset']);}_0x3d9bb1['order']=qs[_0x084d('0x3f')](_0x4261e0[_0x084d('0x39')]['sort']);_0x3d9bb1[_0x084d('0x40')]=qs[_0x084d('0x41')](_[_0x084d('0x42')](_0x4261e0[_0x084d('0x39')],_0xd69a9a[_0x084d('0x41')]));_0x3d9bb1[_0x084d('0x40')][_0x084d('0x5b')]=_0x310110['id'];if(_0x4261e0[_0x084d('0x39')][_0x084d('0x45')]){_0x3d9bb1[_0x084d('0x40')]=_[_0x084d('0x43')](_0x3d9bb1[_0x084d('0x40')],{'$or':_[_0x084d('0x33')](_0x3d9bb1['attributes'],function(_0x44395a){var _0x231270={};_0x231270[_0x44395a]={'$like':'%'+_0x4261e0['query']['filter']+'%'};return _0x231270;})});}_0x3d9bb1=_[_0x084d('0x43')]({},_0x3d9bb1,_0x4261e0[_0x084d('0x46')]);return db[_0x084d('0x57')][_0x084d('0x48')](_0x3d9bb1);}})[_0x084d('0x2b')](function(_0x25006b){if(_0x25006b){return db[_0x084d('0x5c')]['findAndCountAll']({'where':{'id':_[_0x084d('0x33')](_0x25006b,_0x084d('0x5d')),'role':_0x084d('0x5e')},'attributes':['id','name',_0x084d('0x5f'),_0x084d('0x60'),_0x084d('0x61')]});}})[_0x084d('0x2b')](function(_0x3f719a){if(_0x3f719a){return{'count':_0x3f719a[_0x084d('0x22')],'rows':_[_0x084d('0x33')](_0x3f719a['rows'],function(_0x57b43c){return{'membername':_0x57b43c[_0x084d('0x38')],'UserId':_0x57b43c['id'],'queue_name':_0x59a83f[_0x084d('0x38')],'OpenchannelQueueId':_0x59a83f['id'],'interface':util[_0x084d('0x62')](_0x084d('0x63'),_0x084d('0x64'),_0x57b43c[_0x084d('0x38')]),'penalty':0x0,'paused':_0x57b43c[_0x084d('0x5f')],'createdAt':_0x57b43c[_0x084d('0x61')],'updatedAt':_0x57b43c[_0x084d('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x084d('0x2b')](respondWithFilteredResult(_0x5b75eb,_0x3d9bb1))['catch'](handleError(_0x5b75eb,null));};exports[_0x084d('0x65')]=function(_0x1c253b,_0x452ffe,_0x49a852){var _0x20058b={};var _0x3200ff={};var _0x1c0dc2;var _0x38022b;return db[_0x084d('0x34')][_0x084d('0x56')]({'where':{'id':_0x1c253b[_0x084d('0x4c')]['id']}})[_0x084d('0x2b')](handleEntityNotFound(_0x452ffe,null))['then'](function(_0x2eb0e0){if(_0x2eb0e0){_0x1c0dc2=_0x2eb0e0;_0x3200ff[_0x084d('0x37')]=_['keys'](db['Team']['rawAttributes']);_0x3200ff['query']=_['keys'](_0x1c253b[_0x084d('0x39')]);_0x3200ff[_0x084d('0x41')]=_['intersection'](_0x3200ff['model'],_0x3200ff[_0x084d('0x39')]);_0x20058b[_0x084d('0x3d')]=_[_0x084d('0x3b')](_0x3200ff['model'],qs[_0x084d('0x3c')](_0x1c253b['query']['fields']));_0x20058b[_0x084d('0x3d')]=_0x20058b['attributes'][_0x084d('0x58')]?_0x20058b[_0x084d('0x3d')]:_0x3200ff['model'];_0x20058b[_0x084d('0x3e')]=qs[_0x084d('0x3f')](_0x1c253b[_0x084d('0x39')]['sort']);_0x20058b['where']=qs[_0x084d('0x41')](_[_0x084d('0x42')](_0x1c253b[_0x084d('0x39')],_0x3200ff['filters']));if(_0x1c253b[_0x084d('0x39')][_0x084d('0x45')]){_0x20058b[_0x084d('0x40')]=_['merge'](_0x20058b[_0x084d('0x40')],{'$or':_[_0x084d('0x33')](_0x20058b[_0x084d('0x3d')],function(_0x14a746){var _0x1a2e46={};_0x1a2e46[_0x14a746]={'$like':'%'+_0x1c253b[_0x084d('0x39')][_0x084d('0x45')]+'%'};return _0x1a2e46;})});}_0x20058b=_[_0x084d('0x43')]({},_0x20058b,_0x1c253b['options']);return _0x1c0dc2[_0x084d('0x65')](_0x20058b);}})[_0x084d('0x2b')](function(_0x12674b){if(_0x12674b){_0x38022b=_0x12674b[_0x084d('0x58')];if(!_0x1c253b['query'][_0x084d('0x59')](_0x084d('0x5a'))){_0x20058b['limit']=qs[_0x084d('0x23')](_0x1c253b[_0x084d('0x39')]['limit']);_0x20058b['offset']=qs['offset'](_0x1c253b[_0x084d('0x39')][_0x084d('0x20')]);}return _0x1c0dc2[_0x084d('0x65')](_0x20058b);}})[_0x084d('0x2b')](function(_0x41a635){if(_0x41a635){return _0x41a635?{'count':_0x38022b,'rows':_0x41a635}:null;}})[_0x084d('0x2b')](respondWithResult(_0x452ffe,null))[_0x084d('0x4a')](handleError(_0x452ffe,null));};exports[_0x084d('0x66')]=function(_0x3547e9,_0xd82f2a,_0x598cbe){var _0x18c619=_0x3547e9['body'][_0x084d('0x67')];return db[_0x084d('0x68')][_0x084d('0x48')]({'where':{'id':_0x18c619},'attributes':['id'],'include':[{'model':db['User'],'as':_0x084d('0x69'),'attributes':['id',_0x084d('0x38'),_0x084d('0x6a'),'voicePause',_0x084d('0x6b')],'raw':!![]}]})[_0x084d('0x2b')](function(_0x7385b8){if(_0x7385b8){var _0x23b4e9=_[_0x084d('0x6c')](_0x7385b8,function(_0x577bcb){var _0x3586ed=_0x577bcb[_0x084d('0x2c')]({'plain':!![]});return _0x3586ed[_0x084d('0x69')];});return db[_0x084d('0x34')]['find']({'where':{'id':_0x3547e9[_0x084d('0x4c')]['id']}})[_0x084d('0x2b')](function(_0x5f2f3d){return db[_0x084d('0x6d')][_0x084d('0x6e')](function(_0x29c094){return _0x5f2f3d[_0x084d('0x66')](_0x18c619,{'transaction':_0x29c094})[_0x084d('0x2b')](function(){return BPromise[_0x084d('0x6f')](_0x23b4e9,function(_0x341c96){return db[_0x084d('0x57')]['findOrCreate']({'where':{'UserId':_0x341c96['id'],'OpenchannelQueueId':_0x3547e9[_0x084d('0x4c')]['id']},'transaction':_0x29c094});});})[_0x084d('0x2b')](function(){_0x23b4e9[_0x084d('0x70')](function(_0x4e2761){socket['emit'](_0x084d('0x71'),{'UserId':_0x4e2761['id'],'OpenchannelQueueId':_0x5f2f3d['id']});});});});});}})[_0x084d('0x2b')](respondWithStatusCode(_0xd82f2a,null))[_0x084d('0x4a')](handleError(_0xd82f2a,null));};exports[_0x084d('0x72')]=function(_0xd29004,_0x25f1cf,_0x1c149f){return db[_0x084d('0x68')][_0x084d('0x48')]({'where':{'id':_0xd29004['query'][_0x084d('0x67')]},'attributes':['id'],'include':[{'model':db[_0x084d('0x5c')],'as':_0x084d('0x69'),'attributes':['id'],'raw':!![]}]})[_0x084d('0x2b')](handleEntityNotFound(_0x25f1cf,null))[_0x084d('0x2b')](function(_0x4adf62){var _0x37d675=_['map'](_0x4adf62,'id');var _0x5ac039=[];var _0x47bb96=[];var _0x196759=squel['select']();_0x196759[_0x084d('0x73')](_0x084d('0x74'))['from']('team_has_openchannel_queues','tq')[_0x084d('0x75')](_0x084d('0x76'),'ut',_0x084d('0x77'))['where'](_0x084d('0x78'),_0xd29004[_0x084d('0x4c')]['id']);for(var _0x1e92a1=0x0;_0x1e92a1<_0x4adf62[_0x084d('0x58')];_0x1e92a1+=0x1){let _0x22b302=_0x4adf62[_0x1e92a1];for(var _0x23e05e=0x0;_0x23e05e<_0x22b302['Agents'][_0x084d('0x58')];_0x23e05e+=0x1){let _0x276e36=_0x22b302[_0x084d('0x69')][_0x23e05e];var _0x3543b5=_0x196759[_0x084d('0x79')]();_0x3543b5[_0x084d('0x40')]('ut.UserId\x20=\x20?',_0x276e36['id']);_0x47bb96[_0x084d('0x7a')](db[_0x084d('0x6d')][_0x084d('0x39')](_0x3543b5[_0x084d('0x7b')](),{'type':db['sequelize'][_0x084d('0x7c')][_0x084d('0x7d')]})[_0x084d('0x2b')](function(_0x3cb261){if(_0x3cb261[_0x084d('0x58')]===0x1){return _0x276e36['id'];}else{var _0x5b3254=_[_0x084d('0x7e')](_['map'](_0x3cb261,'TeamId'),function(_0x3f86f9){return _[_0x084d('0x7f')](_0x37d675,_0x3f86f9);});if(_0x5b3254){return _0x276e36['id'];}}}));}}return BPromise[_0x084d('0x80')](_0x47bb96)[_0x084d('0x2b')](function(_0x19feed){_0x5ac039=_(_0x5ac039)['union'](_0x19feed)['compact']()[_0x084d('0x81')]();return db[_0x084d('0x34')]['find']({'where':{'id':_0xd29004['params']['id']}})['then'](function(_0x2b4a09){return db[_0x084d('0x6d')]['transaction'](function(_0x7cb98f){return _0x2b4a09[_0x084d('0x72')](_0xd29004[_0x084d('0x39')]['ids'],{'transaction':_0x7cb98f})[_0x084d('0x2b')](function(){if(!_[_0x084d('0x82')](_0x5ac039)){return _0x2b4a09[_0x084d('0x83')](_0x5ac039,{'transaction':_0x7cb98f});}})[_0x084d('0x2b')](function(){_0x5ac039[_0x084d('0x70')](function(_0x1b9476){socket['emit']('userOpenchannelQueue:remove',{'UserId':_0x1b9476,'OpenchannelQueueId':_0x2b4a09['id']});});});});});});})[_0x084d('0x2b')](respondWithStatusCode(_0x25f1cf,null))['catch'](handleError(_0x25f1cf,null));};exports[_0x084d('0x84')]=function(_0x188ad5,_0x11332d,_0x30fb4d){return db[_0x084d('0x34')]['find']({'where':{'id':_0x188ad5['params']['id']}})[_0x084d('0x2b')](handleEntityNotFound(_0x11332d,null))[_0x084d('0x2b')](function(_0x2d2f23){if(_0x2d2f23){return _0x2d2f23[_0x084d('0x84')](_0x188ad5['body'][_0x084d('0x67')],_['omit'](_0x188ad5[_0x084d('0x50')],[_0x084d('0x67'),'id'])||{})[_0x084d('0x85')](function(_0x388101){for(var _0xd0e974=0x0;_0xd0e974<_0x188ad5['body'][_0x084d('0x67')][_0x084d('0x58')];_0xd0e974+=0x1){socket['emit'](_0x084d('0x71'),{'UserId':Number(_0x188ad5[_0x084d('0x50')]['ids'][_0xd0e974]),'OpenchannelQueueId':Number(_0x188ad5[_0x084d('0x4c')]['id'])});}return _0x388101;});}})[_0x084d('0x2b')](respondWithResult(_0x11332d,null))['catch'](handleError(_0x11332d,null));};exports[_0x084d('0x83')]=function(_0x488447,_0x20707f,_0x22c81f){return db[_0x084d('0x34')][_0x084d('0x4e')]({'where':{'id':_0x488447[_0x084d('0x4c')]['id']}})[_0x084d('0x2b')](handleEntityNotFound(_0x20707f,null))[_0x084d('0x2b')](function(_0x99982b){if(_0x99982b){return _0x99982b[_0x084d('0x83')](_0x488447[_0x084d('0x39')][_0x084d('0x67')])['then'](function(){if(_['isArray'](_0x488447[_0x084d('0x39')]['ids'])){for(var _0x25c441=0x0;_0x25c441<_0x488447[_0x084d('0x39')]['ids'][_0x084d('0x58')];_0x25c441+=0x1){socket[_0x084d('0x86')](_0x084d('0x87'),{'UserId':Number(_0x488447[_0x084d('0x39')][_0x084d('0x67')][_0x25c441]),'OpenchannelQueueId':Number(_0x488447[_0x084d('0x4c')]['id'])});}}else{socket[_0x084d('0x86')](_0x084d('0x87'),{'UserId':Number(_0x488447[_0x084d('0x39')]['ids']),'OpenchannelQueueId':Number(_0x488447[_0x084d('0x4c')]['id'])});}});}})[_0x084d('0x2b')](respondWithStatusCode(_0x20707f,null))['catch'](handleError(_0x20707f,null));};exports['getAgents']=function(_0x4d8134,_0x575e6b,_0xd8864){var _0x53f6e7={};var _0x1fdb07={};var _0x509bc9;var _0x1c2990;return db['OpenchannelQueue']['findOne']({'where':{'id':_0x4d8134['params']['id']}})[_0x084d('0x2b')](handleEntityNotFound(_0x575e6b,null))['then'](function(_0x2b024e){if(_0x2b024e){_0x509bc9=_0x2b024e;_0x1fdb07[_0x084d('0x37')]=_[_0x084d('0x3a')](db[_0x084d('0x5c')]['rawAttributes']);_0x1fdb07['query']=_['keys'](_0x4d8134[_0x084d('0x39')]);_0x1fdb07[_0x084d('0x41')]=_['intersection'](_0x1fdb07[_0x084d('0x37')],_0x1fdb07['query']);_0x53f6e7['attributes']=_[_0x084d('0x3b')](_0x1fdb07['model'],qs[_0x084d('0x3c')](_0x4d8134[_0x084d('0x39')][_0x084d('0x3c')]));_0x53f6e7[_0x084d('0x3d')]=_0x53f6e7[_0x084d('0x3d')]['length']?_0x53f6e7[_0x084d('0x3d')]:_0x1fdb07[_0x084d('0x37')];_0x53f6e7[_0x084d('0x3e')]=qs[_0x084d('0x3f')](_0x4d8134['query']['sort']);_0x53f6e7[_0x084d('0x40')]=qs[_0x084d('0x41')](_[_0x084d('0x42')](_0x4d8134['query'],_0x1fdb07[_0x084d('0x41')]));if(_0x4d8134[_0x084d('0x39')]['filter']){_0x53f6e7[_0x084d('0x40')]=_[_0x084d('0x43')](_0x53f6e7[_0x084d('0x40')],{'$or':_[_0x084d('0x33')](_0x53f6e7[_0x084d('0x3d')],function(_0x3b728a){var _0x4300ea={};_0x4300ea[_0x3b728a]={'$like':'%'+_0x4d8134[_0x084d('0x39')][_0x084d('0x45')]+'%'};return _0x4300ea;})});}_0x53f6e7=_[_0x084d('0x43')]({},_0x53f6e7,_0x4d8134[_0x084d('0x46')]);return _0x509bc9['getAgents'](_0x53f6e7);}})[_0x084d('0x2b')](function(_0x8937c5){if(_0x8937c5){_0x1c2990=_0x8937c5[_0x084d('0x58')];if(!_0x4d8134[_0x084d('0x39')][_0x084d('0x59')](_0x084d('0x5a'))){_0x53f6e7[_0x084d('0x23')]=qs[_0x084d('0x23')](_0x4d8134[_0x084d('0x39')][_0x084d('0x23')]);_0x53f6e7[_0x084d('0x20')]=qs['offset'](_0x4d8134[_0x084d('0x39')]['offset']);}return _0x509bc9[_0x084d('0x88')](_0x53f6e7);}})[_0x084d('0x2b')](function(_0x543475){if(_0x543475){return _0x543475?{'count':_0x1c2990,'rows':_0x543475}:null;}})[_0x084d('0x2b')](respondWithResult(_0x575e6b,null))[_0x084d('0x4a')](handleError(_0x575e6b,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index c3e831a..8cda6c0 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 _0xdb44=['hasOwnProperty','hook','events','../../mysqldb','OpenchannelQueue','setMaxListeners','save','update','emit'];(function(_0x4e4f0e,_0x1c3892){var _0x1a7219=function(_0x3821ad){while(--_0x3821ad){_0x4e4f0e['push'](_0x4e4f0e['shift']());}};_0x1a7219(++_0x1c3892);}(_0xdb44,0x17c));var _0x4db4=function(_0x38ced4,_0x24263f){_0x38ced4=_0x38ced4-0x0;var _0x547c07=_0xdb44[_0x38ced4];return _0x547c07;};'use strict';var EventEmitter=require(_0x4db4('0x0'));var OpenchannelQueue=require(_0x4db4('0x1'))['db'][_0x4db4('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x4db4('0x3')](0x0);var events={'afterCreate':_0x4db4('0x4'),'afterUpdate':_0x4db4('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4c3f80){return function(_0x27a79e,_0x4ff04f,_0x3e782f){OpenchannelQueueEvents[_0x4db4('0x6')](_0x4c3f80+':'+_0x27a79e['id'],_0x27a79e);OpenchannelQueueEvents[_0x4db4('0x6')](_0x4c3f80,_0x27a79e);_0x3e782f(null);};}for(var e in events){if(events[_0x4db4('0x7')](e)){var event=events[e];OpenchannelQueue[_0x4db4('0x8')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file +var _0xa887=['emit','hasOwnProperty','hook','exports','../../mysqldb','OpenchannelQueue','setMaxListeners','save','remove'];(function(_0xe8fd11,_0x2622ee){var _0x759e88=function(_0x43eff1){while(--_0x43eff1){_0xe8fd11['push'](_0xe8fd11['shift']());}};_0x759e88(++_0x2622ee);}(_0xa887,0x109));var _0x7a88=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa887[_0x2576d7];return _0x16a08c;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0x7a88('0x0'))['db'][_0x7a88('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x7a88('0x2')](0x0);var events={'afterCreate':_0x7a88('0x3'),'afterUpdate':'update','afterDestroy':_0x7a88('0x4')};function emitEvent(_0x1724f2){return function(_0x33ad92,_0x354ec4,_0x37e686){OpenchannelQueueEvents[_0x7a88('0x5')](_0x1724f2+':'+_0x33ad92['id'],_0x33ad92);OpenchannelQueueEvents[_0x7a88('0x5')](_0x1724f2,_0x33ad92);_0x37e686(null);};}for(var e in events){if(events[_0x7a88('0x6')](e)){var event=events[e];OpenchannelQueue[_0x7a88('0x7')](e,emitEvent(event));}}module[_0x7a88('0x8')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 35a4a2a..fbc78bb 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 _0x27ca=['moment','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','define','openchannel_queues','lodash','util','api'];(function(_0x2c74e9,_0xbd0275){var _0x2d7c29=function(_0x1f18c1){while(--_0x1f18c1){_0x2c74e9['push'](_0x2c74e9['shift']());}};_0x2d7c29(++_0xbd0275);}(_0x27ca,0x194));var _0xa27c=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0x27ca[_0x4b7b62];return _0x2280df;};'use strict';var _=require(_0xa27c('0x0'));var util=require(_0xa27c('0x1'));var logger=require('../../config/logger')(_0xa27c('0x2'));var moment=require(_0xa27c('0x3'));var BPromise=require('bluebird');var rp=require(_0xa27c('0x4'));var fs=require('fs');var path=require(_0xa27c('0x5'));var rimraf=require(_0xa27c('0x6'));var config=require(_0xa27c('0x7'));var attributes=require(_0xa27c('0x8'));module['exports']=function(_0x3c1962,_0x59cbb9){return _0x3c1962[_0xa27c('0x9')]('OpenchannelQueue',attributes,{'tableName':_0xa27c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaca1=['../../config/environment','exports','define','OpenchannelQueue','openchannel_queues','lodash','util','../../config/logger','moment','bluebird','path','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaca1,0xdd));var _0x1aca=function(_0x4c482b,_0x41fb31){_0x4c482b=_0x4c482b-0x0;var _0x332456=_0xaca1[_0x4c482b];return _0x332456;};'use strict';var _=require(_0x1aca('0x0'));var util=require(_0x1aca('0x1'));var logger=require(_0x1aca('0x2'))('api');var moment=require(_0x1aca('0x3'));var BPromise=require(_0x1aca('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1aca('0x5'));var rimraf=require(_0x1aca('0x6'));var config=require(_0x1aca('0x7'));var attributes=require('./openchannelQueue.attributes');module[_0x1aca('0x8')]=function(_0x4c9c3e,_0x158675){return _0x4c9c3e[_0x1aca('0x9')](_0x1aca('0xa'),attributes,{'tableName':_0x1aca('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.rpc.js b/server/api/openchannelQueue/openchannelQueue.rpc.js index be60e9a..1b4817a 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 _0xcf48=['moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','localhost','socket.io-emitter','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetOpenchannelQueue','options','raw','where','limit','include','attributes','model','map','ShowOpenchannelQueue','OpenchannelQueue','find','util'];(function(_0x4047b7,_0x5dc1d8){var _0x1f34c7=function(_0x45515e){while(--_0x45515e){_0x4047b7['push'](_0x4047b7['shift']());}};_0x1f34c7(++_0x5dc1d8);}(_0xcf48,0x196));var _0x8cf4=function(_0x4ad39a,_0x2b662f){_0x4ad39a=_0x4ad39a-0x0;var _0x2832d8=_0xcf48[_0x4ad39a];return _0x2832d8;};'use strict';var _=require('lodash');var util=require(_0x8cf4('0x0'));var moment=require(_0x8cf4('0x1'));var BPromise=require(_0x8cf4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8cf4('0x3'))['db'];var utils=require(_0x8cf4('0x4'));var logger=require(_0x8cf4('0x5'))(_0x8cf4('0x6'));var config=require('../../config/environment');var jayson=require(_0x8cf4('0x7'));var client=jayson['client'][_0x8cf4('0x8')]({'port':0x232a});config[_0x8cf4('0x9')]=_['defaults'](config[_0x8cf4('0x9')],{'host':_0x8cf4('0xa'),'port':0x18eb});var socket=require(_0x8cf4('0xb'))(new Redis(config[_0x8cf4('0x9')]));require('./openchannelQueue.socket')[_0x8cf4('0xc')](socket);function respondWithRpcPromise(_0x5c35f3,_0x18f89b,_0x37c237){return new BPromise(function(_0x5f0905,_0x551141){return client[_0x8cf4('0xd')](_0x5c35f3,_0x37c237)[_0x8cf4('0xe')](function(_0xa278e5){logger[_0x8cf4('0xf')](_0x8cf4('0x10'),_0x18f89b,_0x8cf4('0x11'));logger[_0x8cf4('0x12')](_0x8cf4('0x13'),_0x18f89b,_0x8cf4('0x11'),JSON[_0x8cf4('0x14')](_0xa278e5));if(_0xa278e5[_0x8cf4('0x15')]){if(_0xa278e5[_0x8cf4('0x15')]['code']===0x1f4){logger[_0x8cf4('0x15')](_0x8cf4('0x10'),_0x18f89b,_0xa278e5[_0x8cf4('0x15')][_0x8cf4('0x16')]);return _0x551141(_0xa278e5[_0x8cf4('0x15')][_0x8cf4('0x16')]);}logger[_0x8cf4('0x15')](_0x8cf4('0x10'),_0x18f89b,_0xa278e5[_0x8cf4('0x15')][_0x8cf4('0x16')]);return _0x5f0905(_0xa278e5[_0x8cf4('0x15')][_0x8cf4('0x16')]);}else{logger[_0x8cf4('0xf')](_0x8cf4('0x10'),_0x18f89b,_0x8cf4('0x11'));_0x5f0905(_0xa278e5[_0x8cf4('0x17')][_0x8cf4('0x16')]);}})[_0x8cf4('0x18')](function(_0x5442b8){logger['error'](_0x8cf4('0x10'),_0x18f89b,_0x5442b8);_0x551141(_0x5442b8);});});}exports[_0x8cf4('0x19')]=function(_0x2d4b14){var _0xce1766=this;return new Promise(function(_0x4a8548,_0x381803){return db['OpenchannelQueue']['findAll']({'raw':_0x2d4b14['options']?_0x2d4b14[_0x8cf4('0x1a')][_0x8cf4('0x1b')]===undefined?!![]:![]:!![],'where':_0x2d4b14[_0x8cf4('0x1a')]?_0x2d4b14['options'][_0x8cf4('0x1c')]||null:null,'attributes':_0x2d4b14[_0x8cf4('0x1a')]?_0x2d4b14[_0x8cf4('0x1a')]['attributes']||null:null,'limit':_0x2d4b14[_0x8cf4('0x1a')]?_0x2d4b14['options'][_0x8cf4('0x1d')]||null:null,'include':_0x2d4b14[_0x8cf4('0x1a')]?_0x2d4b14['options']['include']?_['map'](_0x2d4b14[_0x8cf4('0x1a')][_0x8cf4('0x1e')],function(_0x2bc141){return{'model':db[_0x2bc141['model']],'as':_0x2bc141['as'],'attributes':_0x2bc141[_0x8cf4('0x1f')],'include':_0x2bc141[_0x8cf4('0x1e')]?_['map'](_0x2bc141['include'],function(_0x2960ab){return{'model':db[_0x2960ab[_0x8cf4('0x20')]],'as':_0x2960ab['as'],'attributes':_0x2960ab[_0x8cf4('0x1f')],'include':_0x2960ab['include']?_[_0x8cf4('0x21')](_0x2960ab[_0x8cf4('0x1e')],function(_0x25cfed){return{'model':db[_0x25cfed['model']],'as':_0x25cfed['as'],'attributes':_0x25cfed[_0x8cf4('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3ab5c4){logger['info'](_0x8cf4('0x19'),_0x2d4b14);logger[_0x8cf4('0x12')](_0x8cf4('0x19'),_0x2d4b14,JSON['stringify'](_0x3ab5c4));_0x4a8548(_0x3ab5c4);})['catch'](function(_0x8180b5){logger[_0x8cf4('0x15')](_0x8cf4('0x19'),_0x8180b5['message'],_0x2d4b14);_0x381803(_0xce1766[_0x8cf4('0x15')](0x1f4,_0x8180b5[_0x8cf4('0x16')]));});});};exports[_0x8cf4('0x22')]=function(_0x3a4155){var _0x2fc654=this;return new Promise(function(_0x5a0bf1,_0x1926f9){return db[_0x8cf4('0x23')][_0x8cf4('0x24')]({'raw':_0x3a4155['options']?_0x3a4155[_0x8cf4('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x3a4155[_0x8cf4('0x1a')]?_0x3a4155[_0x8cf4('0x1a')][_0x8cf4('0x1c')]||null:null,'attributes':_0x3a4155[_0x8cf4('0x1a')]?_0x3a4155[_0x8cf4('0x1a')][_0x8cf4('0x1f')]||null:null,'include':_0x3a4155[_0x8cf4('0x1a')]?_0x3a4155[_0x8cf4('0x1a')][_0x8cf4('0x1e')]?_[_0x8cf4('0x21')](_0x3a4155['options'][_0x8cf4('0x1e')],function(_0x3aa89d){return{'model':db[_0x3aa89d[_0x8cf4('0x20')]],'as':_0x3aa89d['as'],'attributes':_0x3aa89d[_0x8cf4('0x1f')],'include':_0x3aa89d[_0x8cf4('0x1e')]?_[_0x8cf4('0x21')](_0x3aa89d[_0x8cf4('0x1e')],function(_0x2bdf62){return{'model':db[_0x2bdf62['model']],'as':_0x2bdf62['as'],'attributes':_0x2bdf62[_0x8cf4('0x1f')],'include':_0x2bdf62[_0x8cf4('0x1e')]?_[_0x8cf4('0x21')](_0x2bdf62[_0x8cf4('0x1e')],function(_0x2bdd09){return{'model':db[_0x2bdd09[_0x8cf4('0x20')]],'as':_0x2bdd09['as'],'attributes':_0x2bdd09[_0x8cf4('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x8cf4('0xe')](function(_0x1402ae){logger['info'](_0x8cf4('0x22'),_0x3a4155);logger['debug'](_0x8cf4('0x22'),_0x3a4155,JSON[_0x8cf4('0x14')](_0x1402ae));_0x5a0bf1(_0x1402ae);})[_0x8cf4('0x18')](function(_0x59afb4){logger['error'](_0x8cf4('0x22'),_0x59afb4['message'],_0x3a4155);_0x1926f9(_0x2fc654['error'](0x1f4,_0x59afb4['message']));});});}; \ No newline at end of file +var _0xed36=['model','OpenchannelQueue','find','ShowOpenchannelQueue','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','then','info','OpenchannelQueue,\x20%s,\x20%s','debug','stringify','error','message','request\x20sent','result','catch','GetOpenchannelQueue','findAll','options','raw','where','attributes','limit','map','include'];(function(_0x2d179e,_0x4f7059){var _0x47025f=function(_0x5e572f){while(--_0x5e572f){_0x2d179e['push'](_0x2d179e['shift']());}};_0x47025f(++_0x4f7059);}(_0xed36,0x176));var _0x6ed3=function(_0x582654,_0x1407da){_0x582654=_0x582654-0x0;var _0x2a78b1=_0xed36[_0x582654];return _0x2a78b1;};'use strict';var _=require(_0x6ed3('0x0'));var util=require(_0x6ed3('0x1'));var moment=require(_0x6ed3('0x2'));var BPromise=require('bluebird');var rs=require(_0x6ed3('0x3'));var fs=require('fs');var Redis=require(_0x6ed3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6ed3('0x5'));var logger=require(_0x6ed3('0x6'))(_0x6ed3('0x7'));var config=require(_0x6ed3('0x8'));var jayson=require(_0x6ed3('0x9'));var client=jayson[_0x6ed3('0xa')]['http']({'port':0x232a});config[_0x6ed3('0xb')]=_[_0x6ed3('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x6ed3('0xd'))(new Redis(config['redis']));require('./openchannelQueue.socket')['register'](socket);function respondWithRpcPromise(_0x2448f0,_0x1bb92d,_0x649d57){return new BPromise(function(_0x6ea25d,_0x333bdd){return client['request'](_0x2448f0,_0x649d57)[_0x6ed3('0xe')](function(_0x29cf71){logger[_0x6ed3('0xf')](_0x6ed3('0x10'),_0x1bb92d,'request\x20sent');logger[_0x6ed3('0x11')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x1bb92d,'request\x20sent',JSON[_0x6ed3('0x12')](_0x29cf71));if(_0x29cf71['error']){if(_0x29cf71[_0x6ed3('0x13')]['code']===0x1f4){logger[_0x6ed3('0x13')](_0x6ed3('0x10'),_0x1bb92d,_0x29cf71[_0x6ed3('0x13')]['message']);return _0x333bdd(_0x29cf71[_0x6ed3('0x13')][_0x6ed3('0x14')]);}logger['error'](_0x6ed3('0x10'),_0x1bb92d,_0x29cf71[_0x6ed3('0x13')]['message']);return _0x6ea25d(_0x29cf71[_0x6ed3('0x13')]['message']);}else{logger[_0x6ed3('0xf')](_0x6ed3('0x10'),_0x1bb92d,_0x6ed3('0x15'));_0x6ea25d(_0x29cf71[_0x6ed3('0x16')]['message']);}})[_0x6ed3('0x17')](function(_0x10f95c){logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x1bb92d,_0x10f95c);_0x333bdd(_0x10f95c);});});}exports[_0x6ed3('0x18')]=function(_0x40737a){var _0x4f1bb2=this;return new Promise(function(_0x41d80c,_0x12b38f){return db['OpenchannelQueue'][_0x6ed3('0x19')]({'raw':_0x40737a[_0x6ed3('0x1a')]?_0x40737a[_0x6ed3('0x1a')][_0x6ed3('0x1b')]===undefined?!![]:![]:!![],'where':_0x40737a[_0x6ed3('0x1a')]?_0x40737a['options'][_0x6ed3('0x1c')]||null:null,'attributes':_0x40737a[_0x6ed3('0x1a')]?_0x40737a['options'][_0x6ed3('0x1d')]||null:null,'limit':_0x40737a[_0x6ed3('0x1a')]?_0x40737a[_0x6ed3('0x1a')][_0x6ed3('0x1e')]||null:null,'include':_0x40737a[_0x6ed3('0x1a')]?_0x40737a['options']['include']?_[_0x6ed3('0x1f')](_0x40737a['options'][_0x6ed3('0x20')],function(_0x559c49){return{'model':db[_0x559c49[_0x6ed3('0x21')]],'as':_0x559c49['as'],'attributes':_0x559c49[_0x6ed3('0x1d')],'include':_0x559c49[_0x6ed3('0x20')]?_[_0x6ed3('0x1f')](_0x559c49['include'],function(_0x2a361a){return{'model':db[_0x2a361a[_0x6ed3('0x21')]],'as':_0x2a361a['as'],'attributes':_0x2a361a[_0x6ed3('0x1d')],'include':_0x2a361a['include']?_[_0x6ed3('0x1f')](_0x2a361a[_0x6ed3('0x20')],function(_0x3f54bd){return{'model':db[_0x3f54bd[_0x6ed3('0x21')]],'as':_0x3f54bd['as'],'attributes':_0x3f54bd[_0x6ed3('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x6ed3('0xe')](function(_0x1ef9b5){logger[_0x6ed3('0xf')](_0x6ed3('0x18'),_0x40737a);logger[_0x6ed3('0x11')](_0x6ed3('0x18'),_0x40737a,JSON['stringify'](_0x1ef9b5));_0x41d80c(_0x1ef9b5);})[_0x6ed3('0x17')](function(_0x2390b8){logger[_0x6ed3('0x13')](_0x6ed3('0x18'),_0x2390b8[_0x6ed3('0x14')],_0x40737a);_0x12b38f(_0x4f1bb2[_0x6ed3('0x13')](0x1f4,_0x2390b8[_0x6ed3('0x14')]));});});};exports['ShowOpenchannelQueue']=function(_0x64060d){var _0x5ed4e4=this;return new Promise(function(_0x2084fe,_0x474077){return db[_0x6ed3('0x22')][_0x6ed3('0x23')]({'raw':_0x64060d['options']?_0x64060d[_0x6ed3('0x1a')][_0x6ed3('0x1b')]===undefined?!![]:![]:!![],'where':_0x64060d[_0x6ed3('0x1a')]?_0x64060d['options'][_0x6ed3('0x1c')]||null:null,'attributes':_0x64060d['options']?_0x64060d[_0x6ed3('0x1a')][_0x6ed3('0x1d')]||null:null,'include':_0x64060d[_0x6ed3('0x1a')]?_0x64060d['options'][_0x6ed3('0x20')]?_[_0x6ed3('0x1f')](_0x64060d['options'][_0x6ed3('0x20')],function(_0x1bd96a){return{'model':db[_0x1bd96a[_0x6ed3('0x21')]],'as':_0x1bd96a['as'],'attributes':_0x1bd96a[_0x6ed3('0x1d')],'include':_0x1bd96a[_0x6ed3('0x20')]?_[_0x6ed3('0x1f')](_0x1bd96a[_0x6ed3('0x20')],function(_0xdb99eb){return{'model':db[_0xdb99eb['model']],'as':_0xdb99eb['as'],'attributes':_0xdb99eb[_0x6ed3('0x1d')],'include':_0xdb99eb[_0x6ed3('0x20')]?_['map'](_0xdb99eb[_0x6ed3('0x20')],function(_0x394d47){return{'model':db[_0x394d47[_0x6ed3('0x21')]],'as':_0x394d47['as'],'attributes':_0x394d47[_0x6ed3('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x6ed3('0xe')](function(_0x5d4cca){logger[_0x6ed3('0xf')]('ShowOpenchannelQueue',_0x64060d);logger['debug'](_0x6ed3('0x24'),_0x64060d,JSON[_0x6ed3('0x12')](_0x5d4cca));_0x2084fe(_0x5d4cca);})[_0x6ed3('0x17')](function(_0x8dcc17){logger[_0x6ed3('0x13')](_0x6ed3('0x24'),_0x8dcc17['message'],_0x64060d);_0x474077(_0x5ed4e4[_0x6ed3('0x13')](0x1f4,_0x8dcc17['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 3e19d26..a2c4776 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 _0xda70=['./openchannelQueue.events','save','remove','update','emit','removeListener'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xda70,0x90));var _0x0da7=function(_0x522ae8,_0x3b637e){_0x522ae8=_0x522ae8-0x0;var _0x3189b9=_0xda70[_0x522ae8];return _0x3189b9;};'use strict';var OpenchannelQueueEvents=require(_0x0da7('0x0'));var events=[_0x0da7('0x1'),_0x0da7('0x2'),_0x0da7('0x3')];function createListener(_0x453635,_0x60f569){return function(_0x52603d){_0x60f569[_0x0da7('0x4')](_0x453635,_0x52603d);};}function removeListener(_0x566004,_0x28e1a2){return function(){OpenchannelQueueEvents[_0x0da7('0x5')](_0x566004,_0x28e1a2);};}exports['register']=function(_0xfa7a55){for(var _0x25890b=0x0,_0x227a21=events['length'];_0x25890b<_0x227a21;_0x25890b++){var _0x303307=events[_0x25890b];var _0x4a941a=createListener('openchannelQueue:'+_0x303307,_0xfa7a55);OpenchannelQueueEvents['on'](_0x303307,_0x4a941a);}}; \ No newline at end of file +var _0xd5d2=['emit','./openchannelQueue.events','save','remove','update'];(function(_0x522a8d,_0x17e74f){var _0x59b4d9=function(_0x3af487){while(--_0x3af487){_0x522a8d['push'](_0x522a8d['shift']());}};_0x59b4d9(++_0x17e74f);}(_0xd5d2,0x19b));var _0x2d5d=function(_0x7e757,_0x4e9101){_0x7e757=_0x7e757-0x0;var _0x1719f0=_0xd5d2[_0x7e757];return _0x1719f0;};'use strict';var OpenchannelQueueEvents=require(_0x2d5d('0x0'));var events=[_0x2d5d('0x1'),_0x2d5d('0x2'),_0x2d5d('0x3')];function createListener(_0x48b44b,_0x5996cd){return function(_0x2557f7){_0x5996cd[_0x2d5d('0x4')](_0x48b44b,_0x2557f7);};}function removeListener(_0x3998e4,_0x23726d){return function(){OpenchannelQueueEvents['removeListener'](_0x3998e4,_0x23726d);};}exports['register']=function(_0x4e8f8d){for(var _0x29c380=0x0,_0x3b8b81=events['length'];_0x29c380<_0x3b8b81;_0x29c380++){var _0x4714b9=events[_0x29c380];var _0x5299c3=createListener('openchannelQueue:'+_0x4714b9,_0x4e8f8d);OpenchannelQueueEvents['on'](_0x4714b9,_0x5299c3);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index d9d05aa..6a0ccef 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 _0xc3b0=['update','delete','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc3b0,0xd4));var _0x0c3b=function(_0xb73f8,_0x2ca254){_0xb73f8=_0xb73f8-0x0;var _0x3b1a12=_0xc3b0[_0xb73f8];return _0x3b1a12;};'use strict';var multer=require(_0x0c3b('0x0'));var util=require(_0x0c3b('0x1'));var path=require(_0x0c3b('0x2'));var timeout=require(_0x0c3b('0x3'));var express=require(_0x0c3b('0x4'));var router=express['Router']();var fs_extra=require(_0x0c3b('0x5'));var auth=require(_0x0c3b('0x6'));var interaction=require(_0x0c3b('0x7'));var config=require(_0x0c3b('0x8'));var controller=require(_0x0c3b('0x9'));router[_0x0c3b('0xa')]('/',auth['isAuthenticated'](),controller[_0x0c3b('0xb')]);router[_0x0c3b('0xa')](_0x0c3b('0xc'),auth[_0x0c3b('0xd')](),controller[_0x0c3b('0xe')]);router[_0x0c3b('0xa')](_0x0c3b('0xf'),auth['isAuthenticated'](),controller[_0x0c3b('0x10')]);router[_0x0c3b('0x11')]('/',auth[_0x0c3b('0xd')](),controller[_0x0c3b('0x12')]);router['put']('/:id',auth[_0x0c3b('0xd')](),controller[_0x0c3b('0x13')]);router[_0x0c3b('0x14')](_0x0c3b('0xf'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x458d=['get','isAuthenticated','index','/describe','/:id','post','create','put','update','delete','destroy','multer','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller'];(function(_0x3eeda4,_0x513167){var _0x2fb6a7=function(_0x3f3be1){while(--_0x3f3be1){_0x3eeda4['push'](_0x3eeda4['shift']());}};_0x2fb6a7(++_0x513167);}(_0x458d,0x14f));var _0xd458=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x458d[_0x1cc8fe];return _0x230054;};'use strict';var multer=require(_0xd458('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd458('0x1'));var express=require(_0xd458('0x2'));var router=express['Router']();var fs_extra=require(_0xd458('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xd458('0x4'));var config=require(_0xd458('0x5'));var controller=require(_0xd458('0x6'));router[_0xd458('0x7')]('/',auth[_0xd458('0x8')](),controller[_0xd458('0x9')]);router[_0xd458('0x7')](_0xd458('0xa'),auth[_0xd458('0x8')](),controller['describe']);router[_0xd458('0x7')](_0xd458('0xb'),auth[_0xd458('0x8')](),controller['show']);router[_0xd458('0xc')]('/',auth[_0xd458('0x8')](),controller[_0xd458('0xd')]);router[_0xd458('0xe')](_0xd458('0xb'),auth['isAuthenticated'](),controller[_0xd458('0xf')]);router[_0xd458('0x10')](_0xd458('0xb'),auth[_0xd458('0x8')](),controller[_0xd458('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index e74eeed..e505f42 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 _0xec68=['moment','exports','STRING','DATE'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xec68,0x174));var _0x8ec6=function(_0x4d46cc,_0x268553){_0x4d46cc=_0x4d46cc-0x0;var _0x4788fc=_0xec68[_0x4d46cc];return _0x4788fc;};'use strict';var moment=require(_0x8ec6('0x0'));var Sequelize=require('sequelize');module[_0x8ec6('0x1')]={'uniqueid':{'type':Sequelize[_0x8ec6('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x8ec6('0x3')]},'acceptAt':{'type':Sequelize[_0x8ec6('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x8ec6('0x2')]}}; \ No newline at end of file +var _0x0f9a=['exports','STRING','DATE','sequelize'];(function(_0x5851a1,_0x5d8b71){var _0x5044e8=function(_0x4c2ce4){while(--_0x4c2ce4){_0x5851a1['push'](_0x5851a1['shift']());}};_0x5044e8(++_0x5d8b71);}(_0x0f9a,0xbf));var _0xa0f9=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x0f9a[_0x167cc1];return _0x10bc4b;};'use strict';var moment=require('moment');var Sequelize=require(_0xa0f9('0x0'));module[_0xa0f9('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xa0f9('0x2')]},'joinAt':{'type':Sequelize[_0xa0f9('0x3')]},'leaveAt':{'type':Sequelize[_0xa0f9('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xa0f9('0x3')]},'reason':{'type':Sequelize[_0xa0f9('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index d04c8bf..a2b3644 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 _0xcac1=['json','offset','limit','undefined','count','set','reject','save','update','then','destroy','error','stack','name','send','index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','lodash','squel','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end'];(function(_0x153fab,_0x3e1351){var _0x57252a=function(_0x32963a){while(--_0x32963a){_0x153fab['push'](_0x153fab['shift']());}};_0x57252a(++_0x3e1351);}(_0xcac1,0x14d));var _0x1cac=function(_0x1f736e,_0x23a84d){_0x1f736e=_0x1f736e-0x0;var _0x5760f1=_0xcac1[_0x1f736e];return _0x5760f1;};'use strict';var emlformat=require(_0x1cac('0x0'));var rimraf=require(_0x1cac('0x1'));var zipdir=require(_0x1cac('0x2'));var jsonpatch=require(_0x1cac('0x3'));var rp=require(_0x1cac('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1cac('0x5'));var util=require(_0x1cac('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1cac('0x7'));var squel=require(_0x1cac('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x1cac('0x9'));var Papa=require(_0x1cac('0xa'));var Redis=require('ioredis');var authService=require(_0x1cac('0xb'));var qs=require(_0x1cac('0xc'));var as=require(_0x1cac('0xd'));var hardwareService=require(_0x1cac('0xe'));var logger=require(_0x1cac('0xf'))(_0x1cac('0x10'));var utils=require(_0x1cac('0x11'));var config=require(_0x1cac('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4e4d95,_0xbdbb1e){_0xbdbb1e=_0xbdbb1e||0xcc;return function(_0x541b3d){if(_0x541b3d){return _0x4e4d95[_0x1cac('0x13')](_0xbdbb1e);}return _0x4e4d95[_0x1cac('0x14')](_0xbdbb1e)[_0x1cac('0x15')]();};}function respondWithResult(_0x5d7426,_0x5a6c43){_0x5a6c43=_0x5a6c43||0xc8;return function(_0x24f902){if(_0x24f902){return _0x5d7426[_0x1cac('0x14')](_0x5a6c43)[_0x1cac('0x16')](_0x24f902);}};}function respondWithFilteredResult(_0x3c1e1f,_0x2ec06c){return function(_0x3fbd14){if(_0x3fbd14){var _0x1a1629=typeof _0x2ec06c[_0x1cac('0x17')]==='undefined'&&typeof _0x2ec06c[_0x1cac('0x18')]===_0x1cac('0x19');var _0x5b0439=_0x3fbd14[_0x1cac('0x1a')];var _0x3e6109=_0x1a1629?0x0:_0x2ec06c['offset'];var _0x3fc35f=_0x1a1629?_0x3fbd14[_0x1cac('0x1a')]:_0x2ec06c[_0x1cac('0x17')]+_0x2ec06c[_0x1cac('0x18')];var _0x160083;if(_0x3fc35f>=_0x5b0439){_0x3fc35f=_0x5b0439;_0x160083=0xc8;}else{_0x160083=0xce;}_0x3c1e1f[_0x1cac('0x14')](_0x160083);return _0x3c1e1f[_0x1cac('0x1b')]('Content-Range',_0x3e6109+'-'+_0x3fc35f+'/'+_0x5b0439)[_0x1cac('0x16')](_0x3fbd14);}return null;};}function patchUpdates(_0x474ec1){return function(_0x56483a){try{jsonpatch['apply'](_0x56483a,_0x474ec1,!![]);}catch(_0x433fff){return BPromise[_0x1cac('0x1c')](_0x433fff);}return _0x56483a[_0x1cac('0x1d')]();};}function saveUpdates(_0x4e2359,_0x1be002){return function(_0x2a0203){if(_0x2a0203){return _0x2a0203[_0x1cac('0x1e')](_0x4e2359)[_0x1cac('0x1f')](function(_0x5e1722){return _0x5e1722;});}return null;};}function removeEntity(_0x4b7f97,_0x2d45cb){return function(_0x4eb53a){if(_0x4eb53a){return _0x4eb53a[_0x1cac('0x20')]()[_0x1cac('0x1f')](function(){_0x4b7f97[_0x1cac('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b84a6,_0x19ab14){return function(_0x25870b){if(!_0x25870b){_0x3b84a6[_0x1cac('0x13')](0x194);}return _0x25870b;};}function handleError(_0xe8acd,_0x3e631f){_0x3e631f=_0x3e631f||0x1f4;return function(_0x17f80f){logger[_0x1cac('0x21')](_0x17f80f[_0x1cac('0x22')]);if(_0x17f80f[_0x1cac('0x23')]){delete _0x17f80f[_0x1cac('0x23')];}_0xe8acd[_0x1cac('0x14')](_0x3e631f)[_0x1cac('0x24')](_0x17f80f);};}exports[_0x1cac('0x25')]=function(_0x3c2684,_0x5365f7){var _0x1b6809={},_0x54ada3={},_0x1942d2={'count':0x0,'rows':[]};var _0x959de8=_[_0x1cac('0x26')](db[_0x1cac('0x27')][_0x1cac('0x28')],function(_0xf00d83){return{'name':_0xf00d83[_0x1cac('0x29')],'type':_0xf00d83[_0x1cac('0x2a')][_0x1cac('0x2b')]};});_0x54ada3[_0x1cac('0x2c')]=_[_0x1cac('0x26')](_0x959de8,'name');_0x54ada3[_0x1cac('0x2d')]=_[_0x1cac('0x2e')](_0x3c2684['query']);_0x54ada3[_0x1cac('0x2f')]=_[_0x1cac('0x30')](_0x54ada3[_0x1cac('0x2c')],_0x54ada3[_0x1cac('0x2d')]);_0x1b6809[_0x1cac('0x31')]=_[_0x1cac('0x30')](_0x54ada3[_0x1cac('0x2c')],qs[_0x1cac('0x32')](_0x3c2684[_0x1cac('0x2d')][_0x1cac('0x32')]));_0x1b6809['attributes']=_0x1b6809['attributes'][_0x1cac('0x33')]?_0x1b6809['attributes']:_0x54ada3[_0x1cac('0x2c')];if(!_0x3c2684[_0x1cac('0x2d')][_0x1cac('0x34')](_0x1cac('0x35'))){_0x1b6809[_0x1cac('0x18')]=qs[_0x1cac('0x18')](_0x3c2684[_0x1cac('0x2d')][_0x1cac('0x18')]);_0x1b6809[_0x1cac('0x17')]=qs[_0x1cac('0x17')](_0x3c2684[_0x1cac('0x2d')][_0x1cac('0x17')]);}_0x1b6809[_0x1cac('0x36')]=qs[_0x1cac('0x37')](_0x3c2684[_0x1cac('0x2d')][_0x1cac('0x37')]);_0x1b6809[_0x1cac('0x38')]=qs[_0x1cac('0x2f')](_['pick'](_0x3c2684[_0x1cac('0x2d')],_0x54ada3[_0x1cac('0x2f')]),_0x959de8);if(_0x3c2684[_0x1cac('0x2d')][_0x1cac('0x39')]){_0x1b6809[_0x1cac('0x38')]=_[_0x1cac('0x3a')](_0x1b6809['where'],{'$or':_[_0x1cac('0x26')](_0x959de8,function(_0x2f4abf){if(_0x2f4abf['type']!==_0x1cac('0x3b')){var _0x1ab7c3={};_0x1ab7c3[_0x2f4abf[_0x1cac('0x23')]]={'$like':'%'+_0x3c2684[_0x1cac('0x2d')][_0x1cac('0x39')]+'%'};return _0x1ab7c3;}})});}_0x1b6809=_[_0x1cac('0x3a')]({},_0x1b6809,_0x3c2684[_0x1cac('0x3c')]);var _0x5e5d23={'where':_0x1b6809[_0x1cac('0x38')]};return db[_0x1cac('0x27')][_0x1cac('0x1a')](_0x5e5d23)[_0x1cac('0x1f')](function(_0x4a6aea){_0x1942d2[_0x1cac('0x1a')]=_0x4a6aea;if(_0x3c2684[_0x1cac('0x2d')][_0x1cac('0x3d')]){_0x1b6809[_0x1cac('0x3e')]=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0x1cac('0x3f')](_0x1b6809);})[_0x1cac('0x1f')](function(_0x4c5568){_0x1942d2['rows']=_0x4c5568;return _0x1942d2;})[_0x1cac('0x1f')](respondWithFilteredResult(_0x5365f7,_0x1b6809))[_0x1cac('0x40')](handleError(_0x5365f7,null));};exports[_0x1cac('0x41')]=function(_0x1ba02e,_0x1482fa){var _0x4b153c={'raw':!![],'where':{'id':_0x1ba02e[_0x1cac('0x42')]['id']}},_0x14de5e={};_0x14de5e[_0x1cac('0x2c')]=_[_0x1cac('0x2e')](db['OpenchannelQueueReport'][_0x1cac('0x28')]);_0x14de5e[_0x1cac('0x2d')]=_[_0x1cac('0x2e')](_0x1ba02e[_0x1cac('0x2d')]);_0x14de5e[_0x1cac('0x2f')]=_['intersection'](_0x14de5e[_0x1cac('0x2c')],_0x14de5e['query']);_0x4b153c['attributes']=_['intersection'](_0x14de5e['model'],qs[_0x1cac('0x32')](_0x1ba02e['query'][_0x1cac('0x32')]));_0x4b153c[_0x1cac('0x31')]=_0x4b153c[_0x1cac('0x31')][_0x1cac('0x33')]?_0x4b153c['attributes']:_0x14de5e[_0x1cac('0x2c')];if(_0x1ba02e[_0x1cac('0x2d')][_0x1cac('0x3d')]){_0x4b153c['include']=[{'all':!![]}];}_0x4b153c=_[_0x1cac('0x3a')]({},_0x4b153c,_0x1ba02e[_0x1cac('0x3c')]);return db[_0x1cac('0x27')][_0x1cac('0x43')](_0x4b153c)[_0x1cac('0x1f')](handleEntityNotFound(_0x1482fa,null))[_0x1cac('0x1f')](respondWithResult(_0x1482fa,null))[_0x1cac('0x40')](handleError(_0x1482fa,null));};exports[_0x1cac('0x44')]=function(_0x58df31,_0x9970a6){return db[_0x1cac('0x27')]['create'](_0x58df31[_0x1cac('0x45')],{})[_0x1cac('0x1f')](respondWithResult(_0x9970a6,0xc9))[_0x1cac('0x40')](handleError(_0x9970a6,null));};exports['update']=function(_0x434636,_0x16e8fc){if(_0x434636['body']['id']){delete _0x434636['body']['id'];}return db[_0x1cac('0x27')][_0x1cac('0x43')]({'where':{'id':_0x434636[_0x1cac('0x42')]['id']}})[_0x1cac('0x1f')](handleEntityNotFound(_0x16e8fc,null))[_0x1cac('0x1f')](saveUpdates(_0x434636[_0x1cac('0x45')],null))[_0x1cac('0x1f')](respondWithResult(_0x16e8fc,null))['catch'](handleError(_0x16e8fc,null));};exports[_0x1cac('0x20')]=function(_0x1600f2,_0x183e85){return db[_0x1cac('0x27')][_0x1cac('0x43')]({'where':{'id':_0x1600f2['params']['id']}})[_0x1cac('0x1f')](handleEntityNotFound(_0x183e85,null))['then'](removeEntity(_0x183e85,null))['catch'](handleError(_0x183e85,null));};exports[_0x1cac('0x46')]=function(_0x58bc59,_0x5c5c2d){return db[_0x1cac('0x27')][_0x1cac('0x46')]()[_0x1cac('0x1f')](respondWithResult(_0x5c5c2d,null))['catch'](handleError(_0x5c5c2d,null));}; \ No newline at end of file +var _0x31fd=['json','offset','limit','undefined','count','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','sort','filters','pick','where','merge','VIRTUAL','filter','options','OpenchannelQueueReport','includeAll','findAll','rows','catch','show','length','find','create','update','body','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end'];(function(_0x2fc012,_0x503e5b){var _0x2891f9=function(_0x295f5e){while(--_0x295f5e){_0x2fc012['push'](_0x2fc012['shift']());}};_0x2891f9(++_0x503e5b);}(_0x31fd,0xbe));var _0xd31f=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x31fd[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd31f('0x0'));var zipdir=require(_0xd31f('0x1'));var jsonpatch=require(_0xd31f('0x2'));var rp=require(_0xd31f('0x3'));var moment=require(_0xd31f('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd31f('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd31f('0x6'));var fs=require('fs');var fs_extra=require(_0xd31f('0x7'));var _=require(_0xd31f('0x8'));var squel=require(_0xd31f('0x9'));var crypto=require(_0xd31f('0xa'));var jsforce=require(_0xd31f('0xb'));var deskjs=require(_0xd31f('0xc'));var toCsv=require(_0xd31f('0xd'));var querystring=require('querystring');var Papa=require(_0xd31f('0xe'));var Redis=require(_0xd31f('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd31f('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0xd31f('0x11'));var config=require(_0xd31f('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xd31f('0x13'))['db'];function respondWithStatusCode(_0xa26c9d,_0x8269a4){_0x8269a4=_0x8269a4||0xcc;return function(_0x2ec87d){if(_0x2ec87d){return _0xa26c9d[_0xd31f('0x14')](_0x8269a4);}return _0xa26c9d[_0xd31f('0x15')](_0x8269a4)[_0xd31f('0x16')]();};}function respondWithResult(_0x4fe3f8,_0xa8d936){_0xa8d936=_0xa8d936||0xc8;return function(_0x106a64){if(_0x106a64){return _0x4fe3f8['status'](_0xa8d936)[_0xd31f('0x17')](_0x106a64);}};}function respondWithFilteredResult(_0x92ee7d,_0x45ef05){return function(_0x159e8b){if(_0x159e8b){var _0x390ca9=typeof _0x45ef05[_0xd31f('0x18')]==='undefined'&&typeof _0x45ef05[_0xd31f('0x19')]===_0xd31f('0x1a');var _0x3a908c=_0x159e8b[_0xd31f('0x1b')];var _0x518901=_0x390ca9?0x0:_0x45ef05[_0xd31f('0x18')];var _0x197b0c=_0x390ca9?_0x159e8b[_0xd31f('0x1b')]:_0x45ef05[_0xd31f('0x18')]+_0x45ef05['limit'];var _0x26b3c7;if(_0x197b0c>=_0x3a908c){_0x197b0c=_0x3a908c;_0x26b3c7=0xc8;}else{_0x26b3c7=0xce;}_0x92ee7d[_0xd31f('0x15')](_0x26b3c7);return _0x92ee7d['set'](_0xd31f('0x1c'),_0x518901+'-'+_0x197b0c+'/'+_0x3a908c)[_0xd31f('0x17')](_0x159e8b);}return null;};}function patchUpdates(_0x40ce36){return function(_0xb9bf3f){try{jsonpatch[_0xd31f('0x1d')](_0xb9bf3f,_0x40ce36,!![]);}catch(_0x1cef72){return BPromise[_0xd31f('0x1e')](_0x1cef72);}return _0xb9bf3f[_0xd31f('0x1f')]();};}function saveUpdates(_0x30d4aa,_0x12e82d){return function(_0x3e6ab1){if(_0x3e6ab1){return _0x3e6ab1['update'](_0x30d4aa)[_0xd31f('0x20')](function(_0x9f45fa){return _0x9f45fa;});}return null;};}function removeEntity(_0x531190,_0x13c027){return function(_0x3a154f){if(_0x3a154f){return _0x3a154f[_0xd31f('0x21')]()[_0xd31f('0x20')](function(){_0x531190[_0xd31f('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x178dce,_0x534b59){return function(_0x2e5157){if(!_0x2e5157){_0x178dce[_0xd31f('0x14')](0x194);}return _0x2e5157;};}function handleError(_0x2f6e80,_0x5b4fa4){_0x5b4fa4=_0x5b4fa4||0x1f4;return function(_0x29f537){logger[_0xd31f('0x22')](_0x29f537[_0xd31f('0x23')]);if(_0x29f537['name']){delete _0x29f537[_0xd31f('0x24')];}_0x2f6e80['status'](_0x5b4fa4)[_0xd31f('0x25')](_0x29f537);};}exports['index']=function(_0xe7c8c9,_0x375e8f){var _0xf8bb3c={},_0x464a5e={},_0x5f3ba9={'count':0x0,'rows':[]};var _0x4031c9=_['map'](db['OpenchannelQueueReport'][_0xd31f('0x26')],function(_0x1cfe8a){return{'name':_0x1cfe8a[_0xd31f('0x27')],'type':_0x1cfe8a[_0xd31f('0x28')][_0xd31f('0x29')]};});_0x464a5e[_0xd31f('0x2a')]=_[_0xd31f('0x2b')](_0x4031c9,'name');_0x464a5e[_0xd31f('0x2c')]=_[_0xd31f('0x2d')](_0xe7c8c9['query']);_0x464a5e['filters']=_[_0xd31f('0x2e')](_0x464a5e['model'],_0x464a5e[_0xd31f('0x2c')]);_0xf8bb3c[_0xd31f('0x2f')]=_['intersection'](_0x464a5e[_0xd31f('0x2a')],qs[_0xd31f('0x30')](_0xe7c8c9[_0xd31f('0x2c')]['fields']));_0xf8bb3c[_0xd31f('0x2f')]=_0xf8bb3c[_0xd31f('0x2f')]['length']?_0xf8bb3c['attributes']:_0x464a5e[_0xd31f('0x2a')];if(!_0xe7c8c9[_0xd31f('0x2c')][_0xd31f('0x31')]('nolimit')){_0xf8bb3c['limit']=qs[_0xd31f('0x19')](_0xe7c8c9[_0xd31f('0x2c')]['limit']);_0xf8bb3c[_0xd31f('0x18')]=qs[_0xd31f('0x18')](_0xe7c8c9['query'][_0xd31f('0x18')]);}_0xf8bb3c['order']=qs[_0xd31f('0x32')](_0xe7c8c9['query'][_0xd31f('0x32')]);_0xf8bb3c['where']=qs[_0xd31f('0x33')](_[_0xd31f('0x34')](_0xe7c8c9[_0xd31f('0x2c')],_0x464a5e[_0xd31f('0x33')]),_0x4031c9);if(_0xe7c8c9[_0xd31f('0x2c')]['filter']){_0xf8bb3c[_0xd31f('0x35')]=_[_0xd31f('0x36')](_0xf8bb3c['where'],{'$or':_[_0xd31f('0x2b')](_0x4031c9,function(_0x3889a4){if(_0x3889a4['type']!==_0xd31f('0x37')){var _0x1a85dd={};_0x1a85dd[_0x3889a4[_0xd31f('0x24')]]={'$like':'%'+_0xe7c8c9[_0xd31f('0x2c')][_0xd31f('0x38')]+'%'};return _0x1a85dd;}})});}_0xf8bb3c=_[_0xd31f('0x36')]({},_0xf8bb3c,_0xe7c8c9[_0xd31f('0x39')]);var _0x8db9a4={'where':_0xf8bb3c[_0xd31f('0x35')]};return db[_0xd31f('0x3a')][_0xd31f('0x1b')](_0x8db9a4)[_0xd31f('0x20')](function(_0x13ece1){_0x5f3ba9[_0xd31f('0x1b')]=_0x13ece1;if(_0xe7c8c9[_0xd31f('0x2c')][_0xd31f('0x3b')]){_0xf8bb3c['include']=[{'all':!![]}];}return db[_0xd31f('0x3a')][_0xd31f('0x3c')](_0xf8bb3c);})[_0xd31f('0x20')](function(_0x20e8e0){_0x5f3ba9[_0xd31f('0x3d')]=_0x20e8e0;return _0x5f3ba9;})[_0xd31f('0x20')](respondWithFilteredResult(_0x375e8f,_0xf8bb3c))[_0xd31f('0x3e')](handleError(_0x375e8f,null));};exports[_0xd31f('0x3f')]=function(_0x5e3fa8,_0x27d0e6){var _0x55385e={'raw':!![],'where':{'id':_0x5e3fa8['params']['id']}},_0x2edbd8={};_0x2edbd8[_0xd31f('0x2a')]=_[_0xd31f('0x2d')](db[_0xd31f('0x3a')][_0xd31f('0x26')]);_0x2edbd8[_0xd31f('0x2c')]=_[_0xd31f('0x2d')](_0x5e3fa8[_0xd31f('0x2c')]);_0x2edbd8[_0xd31f('0x33')]=_[_0xd31f('0x2e')](_0x2edbd8['model'],_0x2edbd8[_0xd31f('0x2c')]);_0x55385e[_0xd31f('0x2f')]=_['intersection'](_0x2edbd8['model'],qs[_0xd31f('0x30')](_0x5e3fa8[_0xd31f('0x2c')][_0xd31f('0x30')]));_0x55385e[_0xd31f('0x2f')]=_0x55385e[_0xd31f('0x2f')][_0xd31f('0x40')]?_0x55385e[_0xd31f('0x2f')]:_0x2edbd8[_0xd31f('0x2a')];if(_0x5e3fa8[_0xd31f('0x2c')][_0xd31f('0x3b')]){_0x55385e['include']=[{'all':!![]}];}_0x55385e=_[_0xd31f('0x36')]({},_0x55385e,_0x5e3fa8[_0xd31f('0x39')]);return db['OpenchannelQueueReport'][_0xd31f('0x41')](_0x55385e)[_0xd31f('0x20')](handleEntityNotFound(_0x27d0e6,null))[_0xd31f('0x20')](respondWithResult(_0x27d0e6,null))[_0xd31f('0x3e')](handleError(_0x27d0e6,null));};exports['create']=function(_0x77ac16,_0x42876b){return db['OpenchannelQueueReport'][_0xd31f('0x42')](_0x77ac16['body'],{})[_0xd31f('0x20')](respondWithResult(_0x42876b,0xc9))[_0xd31f('0x3e')](handleError(_0x42876b,null));};exports[_0xd31f('0x43')]=function(_0x508810,_0x437778){if(_0x508810['body']['id']){delete _0x508810[_0xd31f('0x44')]['id'];}return db[_0xd31f('0x3a')]['find']({'where':{'id':_0x508810[_0xd31f('0x45')]['id']}})[_0xd31f('0x20')](handleEntityNotFound(_0x437778,null))[_0xd31f('0x20')](saveUpdates(_0x508810[_0xd31f('0x44')],null))[_0xd31f('0x20')](respondWithResult(_0x437778,null))['catch'](handleError(_0x437778,null));};exports[_0xd31f('0x21')]=function(_0x1ae1e5,_0x1078ea){return db['OpenchannelQueueReport'][_0xd31f('0x41')]({'where':{'id':_0x1ae1e5[_0xd31f('0x45')]['id']}})[_0xd31f('0x20')](handleEntityNotFound(_0x1078ea,null))[_0xd31f('0x20')](removeEntity(_0x1078ea,null))[_0xd31f('0x3e')](handleError(_0x1078ea,null));};exports[_0xd31f('0x46')]=function(_0x1c0530,_0x3e2cce){return db['OpenchannelQueueReport'][_0xd31f('0x46')]()['then'](respondWithResult(_0x3e2cce,null))[_0xd31f('0x3e')](handleError(_0x3e2cce,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 4feae3a..a8e6337 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.model.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x326f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash'];(function(_0x3e973e,_0x1047fd){var _0x3e980d=function(_0x5e8513){while(--_0x5e8513){_0x3e973e['push'](_0x3e973e['shift']());}};_0x3e980d(++_0x1047fd);}(_0x326f,0xd1));var _0xf326=function(_0x2feb54,_0x7b9a84){_0x2feb54=_0x2feb54-0x0;var _0x2c6840=_0x326f[_0x2feb54];return _0x2c6840;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[{'name':_0xf326('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['report_openchannel_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','OpenchannelQueueReport'];(function(_0x292814,_0x54d894){var _0x1fb903=function(_0x5bafe2){while(--_0x5bafe2){_0x292814['push'](_0x292814['shift']());}};_0x1fb903(++_0x54d894);}(_0x7a54,0x106));var _0x47a5=function(_0x437f33,_0x121af8){_0x437f33=_0x437f33-0x0;var _0x5d444e=_0x7a54[_0x437f33];return _0x5d444e;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x47a5('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 6ef189e..1d683cc 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 _0xde9f=['client','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','OpenchannelQueueReport','options','raw','CreateOpenchannelQueueReport','catch','UpdateOpenchannelQueueReport','update','body','where','attributes','limit','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0xde9f,0x118));var _0xfde9=function(_0x2eb5bc,_0x4634c6){_0x2eb5bc=_0x2eb5bc-0x0;var _0x51c7b1=_0xde9f[_0x2eb5bc];return _0x51c7b1;};'use strict';var _=require(_0xfde9('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xfde9('0x1'));var rs=require(_0xfde9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfde9('0x3'))['db'];var utils=require(_0xfde9('0x4'));var logger=require('../../config/logger')(_0xfde9('0x5'));var config=require(_0xfde9('0x6'));var jayson=require(_0xfde9('0x7'));var client=jayson[_0xfde9('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c3e01,_0x179ee0,_0x18a202){return new BPromise(function(_0x5569c2,_0x19a337){return client[_0xfde9('0x9')](_0x4c3e01,_0x18a202)[_0xfde9('0xa')](function(_0x3b775d){logger[_0xfde9('0xb')](_0xfde9('0xc'),_0x179ee0,_0xfde9('0xd'));logger[_0xfde9('0xe')](_0xfde9('0xf'),_0x179ee0,_0xfde9('0xd'),JSON[_0xfde9('0x10')](_0x3b775d));if(_0x3b775d[_0xfde9('0x11')]){if(_0x3b775d[_0xfde9('0x11')][_0xfde9('0x12')]===0x1f4){logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0x179ee0,_0x3b775d[_0xfde9('0x11')][_0xfde9('0x13')]);return _0x19a337(_0x3b775d[_0xfde9('0x11')][_0xfde9('0x13')]);}logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0x179ee0,_0x3b775d[_0xfde9('0x11')][_0xfde9('0x13')]);return _0x5569c2(_0x3b775d[_0xfde9('0x11')][_0xfde9('0x13')]);}else{logger[_0xfde9('0xb')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x179ee0,_0xfde9('0xd'));_0x5569c2(_0x3b775d[_0xfde9('0x14')][_0xfde9('0x13')]);}})['catch'](function(_0x31b1c7){logger[_0xfde9('0x11')](_0xfde9('0xc'),_0x179ee0,_0x31b1c7);_0x19a337(_0x31b1c7);});});}exports['CreateOpenchannelQueueReport']=function(_0x4c9f24){var _0x5eb89e=this;return new Promise(function(_0x544f19,_0x166f1c){return db[_0xfde9('0x15')]['create'](_0x4c9f24['body'],{'raw':_0x4c9f24[_0xfde9('0x16')]?_0x4c9f24[_0xfde9('0x16')][_0xfde9('0x17')]===undefined?!![]:![]:!![]})[_0xfde9('0xa')](function(_0x162b07){logger[_0xfde9('0xb')](_0xfde9('0x18'),_0x4c9f24);logger[_0xfde9('0xe')](_0xfde9('0x18'),_0x4c9f24,JSON[_0xfde9('0x10')](_0x162b07));_0x544f19(_0x162b07);})[_0xfde9('0x19')](function(_0x28d189){logger['error'](_0xfde9('0x18'),_0x28d189['message'],_0x4c9f24);_0x166f1c(_0x5eb89e[_0xfde9('0x11')](0x1f4,_0x28d189[_0xfde9('0x13')]));});});};exports[_0xfde9('0x1a')]=function(_0x5d0a74){var _0x12e3e7=this;return new Promise(function(_0x10e809,_0x53733b){return db[_0xfde9('0x15')][_0xfde9('0x1b')](_0x5d0a74[_0xfde9('0x1c')],{'raw':_0x5d0a74[_0xfde9('0x16')]?_0x5d0a74[_0xfde9('0x16')][_0xfde9('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d0a74[_0xfde9('0x16')]?_0x5d0a74[_0xfde9('0x16')][_0xfde9('0x1d')]||null:null,'attributes':_0x5d0a74[_0xfde9('0x16')]?_0x5d0a74[_0xfde9('0x16')][_0xfde9('0x1e')]||null:null,'limit':_0x5d0a74[_0xfde9('0x16')]?_0x5d0a74[_0xfde9('0x16')][_0xfde9('0x1f')]||null:null})[_0xfde9('0xa')](function(_0x4b7956){logger['info'](_0xfde9('0x1a'),_0x5d0a74);logger[_0xfde9('0xe')]('UpdateOpenchannelQueueReport',_0x5d0a74,JSON[_0xfde9('0x10')](_0x4b7956));_0x10e809(_0x4b7956);})[_0xfde9('0x19')](function(_0x1651e0){logger[_0xfde9('0x11')](_0xfde9('0x1a'),_0x1651e0['message'],_0x5d0a74);_0x53733b(_0x12e3e7[_0xfde9('0x11')](0x1f4,_0x1651e0[_0xfde9('0x13')]));});});}; \ No newline at end of file +var _0xcae2=['where','attributes','UpdateOpenchannelQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','options','raw','then','stringify','update','body'];(function(_0x353fd0,_0x3528f4){var _0x480fc4=function(_0x27e337){while(--_0x27e337){_0x353fd0['push'](_0x353fd0['shift']());}};_0x480fc4(++_0x3528f4);}(_0xcae2,0x143));var _0x2cae=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xcae2[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x2cae('0x0'));var util=require(_0x2cae('0x1'));var moment=require(_0x2cae('0x2'));var BPromise=require(_0x2cae('0x3'));var rs=require(_0x2cae('0x4'));var fs=require('fs');var Redis=require(_0x2cae('0x5'));var db=require(_0x2cae('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x2cae('0x7'))(_0x2cae('0x8'));var config=require(_0x2cae('0x9'));var jayson=require(_0x2cae('0xa'));var client=jayson['client'][_0x2cae('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1feff6,_0x1e1a3d,_0x25b6a2){return new BPromise(function(_0x2e7498,_0x49e1d1){return client['request'](_0x1feff6,_0x25b6a2)['then'](function(_0x49f0d3){logger[_0x2cae('0xc')](_0x2cae('0xd'),_0x1e1a3d,_0x2cae('0xe'));logger[_0x2cae('0xf')](_0x2cae('0x10'),_0x1e1a3d,_0x2cae('0xe'),JSON['stringify'](_0x49f0d3));if(_0x49f0d3[_0x2cae('0x11')]){if(_0x49f0d3['error'][_0x2cae('0x12')]===0x1f4){logger[_0x2cae('0x11')](_0x2cae('0xd'),_0x1e1a3d,_0x49f0d3[_0x2cae('0x11')][_0x2cae('0x13')]);return _0x49e1d1(_0x49f0d3[_0x2cae('0x11')]['message']);}logger[_0x2cae('0x11')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x1e1a3d,_0x49f0d3[_0x2cae('0x11')][_0x2cae('0x13')]);return _0x2e7498(_0x49f0d3['error'][_0x2cae('0x13')]);}else{logger[_0x2cae('0xc')](_0x2cae('0xd'),_0x1e1a3d,_0x2cae('0xe'));_0x2e7498(_0x49f0d3['result'][_0x2cae('0x13')]);}})[_0x2cae('0x14')](function(_0x4a89e1){logger[_0x2cae('0x11')](_0x2cae('0xd'),_0x1e1a3d,_0x4a89e1);_0x49e1d1(_0x4a89e1);});});}exports[_0x2cae('0x15')]=function(_0xe6314f){var _0x2813b1=this;return new Promise(function(_0x164aee,_0x398290){return db[_0x2cae('0x16')]['create'](_0xe6314f['body'],{'raw':_0xe6314f[_0x2cae('0x17')]?_0xe6314f[_0x2cae('0x17')][_0x2cae('0x18')]===undefined?!![]:![]:!![]})[_0x2cae('0x19')](function(_0x2f4f5c){logger[_0x2cae('0xc')](_0x2cae('0x15'),_0xe6314f);logger['debug']('CreateOpenchannelQueueReport',_0xe6314f,JSON[_0x2cae('0x1a')](_0x2f4f5c));_0x164aee(_0x2f4f5c);})[_0x2cae('0x14')](function(_0x5d800e){logger['error']('CreateOpenchannelQueueReport',_0x5d800e[_0x2cae('0x13')],_0xe6314f);_0x398290(_0x2813b1[_0x2cae('0x11')](0x1f4,_0x5d800e['message']));});});};exports['UpdateOpenchannelQueueReport']=function(_0x309ae3){var _0x1c8063=this;return new Promise(function(_0x407324,_0x2fdc92){return db[_0x2cae('0x16')][_0x2cae('0x1b')](_0x309ae3[_0x2cae('0x1c')],{'raw':_0x309ae3[_0x2cae('0x17')]?_0x309ae3[_0x2cae('0x17')][_0x2cae('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x309ae3[_0x2cae('0x17')]?_0x309ae3[_0x2cae('0x17')][_0x2cae('0x1d')]||null:null,'attributes':_0x309ae3[_0x2cae('0x17')]?_0x309ae3[_0x2cae('0x17')][_0x2cae('0x1e')]||null:null,'limit':_0x309ae3['options']?_0x309ae3['options']['limit']||null:null})['then'](function(_0x7d5421){logger[_0x2cae('0xc')](_0x2cae('0x1f'),_0x309ae3);logger[_0x2cae('0xf')]('UpdateOpenchannelQueueReport',_0x309ae3,JSON[_0x2cae('0x1a')](_0x7d5421));_0x407324(_0x7d5421);})[_0x2cae('0x14')](function(_0xd53da6){logger['error'](_0x2cae('0x1f'),_0xd53da6['message'],_0x309ae3);_0x2fdc92(_0x1c8063[_0x2cae('0x11')](0x1f4,_0xd53da6['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 79a8556..9f265c3 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 _0xbc8a=['index','/describe','describe','/:id','show','post','create','update','destroy','multer','path','connect-timeout','express','Router','../../components/interaction/service','get','isAuthenticated'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xbc8a,0x16e));var _0xabc8=function(_0x3328ac,_0x28f068){_0x3328ac=_0x3328ac-0x0;var _0x5c729e=_0xbc8a[_0x3328ac];return _0x5c729e;};'use strict';var multer=require(_0xabc8('0x0'));var util=require('util');var path=require(_0xabc8('0x1'));var timeout=require(_0xabc8('0x2'));var express=require(_0xabc8('0x3'));var router=express[_0xabc8('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xabc8('0x5'));var config=require('../../config/environment');var controller=require('./openchannelTransferReport.controller');router[_0xabc8('0x6')]('/',auth[_0xabc8('0x7')](),controller[_0xabc8('0x8')]);router[_0xabc8('0x6')](_0xabc8('0x9'),auth[_0xabc8('0x7')](),controller[_0xabc8('0xa')]);router[_0xabc8('0x6')](_0xabc8('0xb'),auth[_0xabc8('0x7')](),controller[_0xabc8('0xc')]);router[_0xabc8('0xd')]('/',auth[_0xabc8('0x7')](),controller[_0xabc8('0xe')]);router['put'](_0xabc8('0xb'),auth[_0xabc8('0x7')](),controller[_0xabc8('0xf')]);router['delete']('/:id',auth[_0xabc8('0x7')](),controller[_0xabc8('0x10')]);module['exports']=router; \ No newline at end of file +var _0x3856=['multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','delete','destroy','exports'];(function(_0x43a37b,_0xfb0579){var _0x31364a=function(_0x441501){while(--_0x441501){_0x43a37b['push'](_0x43a37b['shift']());}};_0x31364a(++_0xfb0579);}(_0x3856,0x7e));var _0x6385=function(_0x20589d,_0x55d5bf){_0x20589d=_0x20589d-0x0;var _0x422de9=_0x3856[_0x20589d];return _0x422de9;};'use strict';var multer=require(_0x6385('0x0'));var util=require(_0x6385('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6385('0x2'));var router=express[_0x6385('0x3')]();var fs_extra=require(_0x6385('0x4'));var auth=require(_0x6385('0x5'));var interaction=require(_0x6385('0x6'));var config=require(_0x6385('0x7'));var controller=require(_0x6385('0x8'));router[_0x6385('0x9')]('/',auth[_0x6385('0xa')](),controller['index']);router[_0x6385('0x9')](_0x6385('0xb'),auth[_0x6385('0xa')](),controller[_0x6385('0xc')]);router[_0x6385('0x9')](_0x6385('0xd'),auth[_0x6385('0xa')](),controller[_0x6385('0xe')]);router[_0x6385('0xf')]('/',auth['isAuthenticated'](),controller[_0x6385('0x10')]);router[_0x6385('0x11')](_0x6385('0xd'),auth[_0x6385('0xa')](),controller['update']);router[_0x6385('0x12')]('/:id',auth[_0x6385('0xa')](),controller[_0x6385('0x13')]);module[_0x6385('0x14')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 9abe162..037a347 100644 --- a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js +++ b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x393160,_0x2986e9){var _0x2e24e6=function(_0x27b49a){while(--_0x27b49a){_0x393160['push'](_0x393160['shift']());}};_0x2e24e6(++_0x2986e9);}(_0x00bb,0x1d8));var _0xb00b=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x00bb[_0x1ac595];return _0x455fff;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}}; \ No newline at end of file +var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x3b8fe8,_0x24880e){var _0x4353d1=function(_0x5a8f82){while(--_0x5a8f82){_0x3b8fe8['push'](_0x3b8fe8['shift']());}};_0x4353d1(++_0x24880e);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4226d6,_0x3864ca){_0x4226d6=_0x4226d6-0x0;var _0x19655b=_0xcb91[_0x4226d6];return _0x19655b;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 2d459bc..e525747 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 _0x81b4=['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','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','error','stack','index','OpenchannelTransferReport','rawAttributes','type','key','model','map','name','query','filters','intersection','fields','attributes','sort','where','pick','filter','options','then','include','catch','show','params','keys','length','includeAll','merge','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','fs-extra','squel'];(function(_0x2fec3d,_0x3b15c2){var _0x3aa072=function(_0x13e37f){while(--_0x13e37f){_0x2fec3d['push'](_0x2fec3d['shift']());}};_0x3aa072(++_0x3b15c2);}(_0x81b4,0x1ab));var _0x481b=function(_0x54adeb,_0x3127f5){_0x54adeb=_0x54adeb-0x0;var _0x5265da=_0x81b4[_0x54adeb];return _0x5265da;};'use strict';var emlformat=require(_0x481b('0x0'));var rimraf=require(_0x481b('0x1'));var zipdir=require(_0x481b('0x2'));var jsonpatch=require(_0x481b('0x3'));var rp=require(_0x481b('0x4'));var moment=require('moment');var BPromise=require(_0x481b('0x5'));var Mustache=require('mustache');var util=require(_0x481b('0x6'));var path=require(_0x481b('0x7'));var sox=require(_0x481b('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x481b('0x9'));var _=require('lodash');var squel=require(_0x481b('0xa'));var crypto=require(_0x481b('0xb'));var jsforce=require(_0x481b('0xc'));var deskjs=require(_0x481b('0xd'));var toCsv=require(_0x481b('0xe'));var querystring=require(_0x481b('0xf'));var Papa=require(_0x481b('0x10'));var Redis=require(_0x481b('0x11'));var authService=require(_0x481b('0x12'));var qs=require(_0x481b('0x13'));var as=require(_0x481b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x481b('0x15'))(_0x481b('0x16'));var utils=require(_0x481b('0x17'));var config=require(_0x481b('0x18'));var licenseUtil=require(_0x481b('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3067b5,_0x416d0d){_0x416d0d=_0x416d0d||0xcc;return function(_0x3fe6b4){if(_0x3fe6b4){return _0x3067b5[_0x481b('0x1a')](_0x416d0d);}return _0x3067b5[_0x481b('0x1b')](_0x416d0d)[_0x481b('0x1c')]();};}function respondWithResult(_0x5b3655,_0x2c0596){_0x2c0596=_0x2c0596||0xc8;return function(_0x290a8a){if(_0x290a8a){return _0x5b3655['status'](_0x2c0596)[_0x481b('0x1d')](_0x290a8a);}};}function respondWithFilteredResult(_0x43afba,_0x2be72e){return function(_0x4f25f6){if(_0x4f25f6){var _0x4ad6ec=typeof _0x2be72e[_0x481b('0x1e')]===_0x481b('0x1f')&&typeof _0x2be72e[_0x481b('0x20')]===_0x481b('0x1f');var _0xb847dd=_0x4f25f6[_0x481b('0x21')];var _0x5e10b5=_0x4ad6ec?0x0:_0x2be72e[_0x481b('0x1e')];var _0x2d66a9=_0x4ad6ec?_0x4f25f6['count']:_0x2be72e[_0x481b('0x1e')]+_0x2be72e[_0x481b('0x20')];var _0x12cb7f;if(_0x2d66a9>=_0xb847dd){_0x2d66a9=_0xb847dd;_0x12cb7f=0xc8;}else{_0x12cb7f=0xce;}_0x43afba[_0x481b('0x1b')](_0x12cb7f);return _0x43afba['set'](_0x481b('0x22'),_0x5e10b5+'-'+_0x2d66a9+'/'+_0xb847dd)[_0x481b('0x1d')](_0x4f25f6);}return null;};}function patchUpdates(_0xbd8e13){return function(_0x4a1aa1){try{jsonpatch[_0x481b('0x23')](_0x4a1aa1,_0xbd8e13,!![]);}catch(_0x11a4ce){return BPromise[_0x481b('0x24')](_0x11a4ce);}return _0x4a1aa1[_0x481b('0x25')]();};}function saveUpdates(_0x10714e,_0x49463e){return function(_0x16cc60){if(_0x16cc60){return _0x16cc60[_0x481b('0x26')](_0x10714e)['then'](function(_0x471024){return _0x471024;});}return null;};}function removeEntity(_0x3808bb,_0xf38284){return function(_0x28d51a){if(_0x28d51a){return _0x28d51a[_0x481b('0x27')]()['then'](function(){_0x3808bb['status'](0xcc)[_0x481b('0x1c')]();});}};}function handleEntityNotFound(_0x42f6d3,_0x402e28){return function(_0x2c8c98){if(!_0x2c8c98){_0x42f6d3[_0x481b('0x1a')](0x194);}return _0x2c8c98;};}function handleError(_0x1d0d9c,_0x1d39fe){_0x1d39fe=_0x1d39fe||0x1f4;return function(_0x463dad){logger[_0x481b('0x28')](_0x463dad[_0x481b('0x29')]);if(_0x463dad['name']){delete _0x463dad['name'];}_0x1d0d9c[_0x481b('0x1b')](_0x1d39fe)['send'](_0x463dad);};}exports[_0x481b('0x2a')]=function(_0x5bd8bd,_0x4d660a){var _0xf630b0={},_0x3f617e={},_0x51f89a={'count':0x0,'rows':[]};var _0x4b16ef=_['map'](db[_0x481b('0x2b')][_0x481b('0x2c')],function(_0x10af77){return{'name':_0x10af77['fieldName'],'type':_0x10af77[_0x481b('0x2d')][_0x481b('0x2e')]};});_0x3f617e[_0x481b('0x2f')]=_[_0x481b('0x30')](_0x4b16ef,_0x481b('0x31'));_0x3f617e['query']=_['keys'](_0x5bd8bd[_0x481b('0x32')]);_0x3f617e[_0x481b('0x33')]=_['intersection'](_0x3f617e[_0x481b('0x2f')],_0x3f617e['query']);_0xf630b0['attributes']=_[_0x481b('0x34')](_0x3f617e[_0x481b('0x2f')],qs['fields'](_0x5bd8bd['query'][_0x481b('0x35')]));_0xf630b0[_0x481b('0x36')]=_0xf630b0['attributes']['length']?_0xf630b0[_0x481b('0x36')]:_0x3f617e[_0x481b('0x2f')];if(!_0x5bd8bd[_0x481b('0x32')]['hasOwnProperty']('nolimit')){_0xf630b0['limit']=qs[_0x481b('0x20')](_0x5bd8bd[_0x481b('0x32')]['limit']);_0xf630b0[_0x481b('0x1e')]=qs[_0x481b('0x1e')](_0x5bd8bd['query'][_0x481b('0x1e')]);}_0xf630b0['order']=qs[_0x481b('0x37')](_0x5bd8bd['query']['sort']);_0xf630b0[_0x481b('0x38')]=qs[_0x481b('0x33')](_[_0x481b('0x39')](_0x5bd8bd['query'],_0x3f617e[_0x481b('0x33')]),_0x4b16ef);if(_0x5bd8bd['query']['filter']){_0xf630b0[_0x481b('0x38')]=_['merge'](_0xf630b0['where'],{'$or':_[_0x481b('0x30')](_0x4b16ef,function(_0x45bf2b){if(_0x45bf2b[_0x481b('0x2d')]!=='VIRTUAL'){var _0x408f8a={};_0x408f8a[_0x45bf2b[_0x481b('0x31')]]={'$like':'%'+_0x5bd8bd[_0x481b('0x32')][_0x481b('0x3a')]+'%'};return _0x408f8a;}})});}_0xf630b0=_['merge']({},_0xf630b0,_0x5bd8bd[_0x481b('0x3b')]);var _0x1e4ce4={'where':_0xf630b0[_0x481b('0x38')]};return db['OpenchannelTransferReport']['count'](_0x1e4ce4)[_0x481b('0x3c')](function(_0x196f02){_0x51f89a[_0x481b('0x21')]=_0x196f02;if(_0x5bd8bd[_0x481b('0x32')]['includeAll']){_0xf630b0[_0x481b('0x3d')]=[{'all':!![]}];}return db[_0x481b('0x2b')]['findAll'](_0xf630b0);})[_0x481b('0x3c')](function(_0x11e2d6){_0x51f89a['rows']=_0x11e2d6;return _0x51f89a;})[_0x481b('0x3c')](respondWithFilteredResult(_0x4d660a,_0xf630b0))[_0x481b('0x3e')](handleError(_0x4d660a,null));};exports[_0x481b('0x3f')]=function(_0x37f248,_0xb1376b){var _0x1610d9={'raw':!![],'where':{'id':_0x37f248[_0x481b('0x40')]['id']}},_0x5502ea={};_0x5502ea[_0x481b('0x2f')]=_[_0x481b('0x41')](db[_0x481b('0x2b')][_0x481b('0x2c')]);_0x5502ea[_0x481b('0x32')]=_[_0x481b('0x41')](_0x37f248[_0x481b('0x32')]);_0x5502ea[_0x481b('0x33')]=_['intersection'](_0x5502ea[_0x481b('0x2f')],_0x5502ea['query']);_0x1610d9[_0x481b('0x36')]=_[_0x481b('0x34')](_0x5502ea[_0x481b('0x2f')],qs[_0x481b('0x35')](_0x37f248[_0x481b('0x32')][_0x481b('0x35')]));_0x1610d9[_0x481b('0x36')]=_0x1610d9[_0x481b('0x36')][_0x481b('0x42')]?_0x1610d9['attributes']:_0x5502ea[_0x481b('0x2f')];if(_0x37f248[_0x481b('0x32')][_0x481b('0x43')]){_0x1610d9[_0x481b('0x3d')]=[{'all':!![]}];}_0x1610d9=_[_0x481b('0x44')]({},_0x1610d9,_0x37f248[_0x481b('0x3b')]);return db['OpenchannelTransferReport'][_0x481b('0x45')](_0x1610d9)[_0x481b('0x3c')](handleEntityNotFound(_0xb1376b,null))[_0x481b('0x3c')](respondWithResult(_0xb1376b,null))[_0x481b('0x3e')](handleError(_0xb1376b,null));};exports[_0x481b('0x46')]=function(_0x283287,_0x157fbb){return db['OpenchannelTransferReport'][_0x481b('0x46')](_0x283287['body'],{})['then'](respondWithResult(_0x157fbb,0xc9))[_0x481b('0x3e')](handleError(_0x157fbb,null));};exports[_0x481b('0x26')]=function(_0x239f8a,_0x376486){if(_0x239f8a['body']['id']){delete _0x239f8a[_0x481b('0x47')]['id'];}return db[_0x481b('0x2b')][_0x481b('0x45')]({'where':{'id':_0x239f8a[_0x481b('0x40')]['id']}})[_0x481b('0x3c')](handleEntityNotFound(_0x376486,null))[_0x481b('0x3c')](saveUpdates(_0x239f8a[_0x481b('0x47')],null))[_0x481b('0x3c')](respondWithResult(_0x376486,null))[_0x481b('0x3e')](handleError(_0x376486,null));};exports['destroy']=function(_0x5ee7b3,_0x4ca861){return db[_0x481b('0x2b')][_0x481b('0x45')]({'where':{'id':_0x5ee7b3['params']['id']}})['then'](handleEntityNotFound(_0x4ca861,null))['then'](removeEntity(_0x4ca861,null))[_0x481b('0x3e')](handleError(_0x4ca861,null));};exports[_0x481b('0x48')]=function(_0x2047f6,_0x195359){return db[_0x481b('0x2b')][_0x481b('0x48')]()[_0x481b('0x3c')](respondWithResult(_0x195359,null))['catch'](handleError(_0x195359,null));}; \ No newline at end of file +var _0x644e=['model','keys','query','filters','intersection','fields','attributes','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','length','find','create','body','update','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','stack','name','send','index','map','OpenchannelTransferReport','fieldName','type','key'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x644e,0x103));var _0xe644=function(_0x36e3a5,_0x26320d){_0x36e3a5=_0x36e3a5-0x0;var _0x391c1d=_0x644e[_0x36e3a5];return _0x391c1d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe644('0x0'));var zipdir=require(_0xe644('0x1'));var jsonpatch=require(_0xe644('0x2'));var rp=require(_0xe644('0x3'));var moment=require(_0xe644('0x4'));var BPromise=require(_0xe644('0x5'));var Mustache=require(_0xe644('0x6'));var util=require(_0xe644('0x7'));var path=require(_0xe644('0x8'));var sox=require(_0xe644('0x9'));var csv=require('to-csv');var ejs=require(_0xe644('0xa'));var fs=require('fs');var fs_extra=require(_0xe644('0xb'));var _=require(_0xe644('0xc'));var squel=require(_0xe644('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe644('0xe'));var toCsv=require(_0xe644('0xf'));var querystring=require(_0xe644('0x10'));var Papa=require(_0xe644('0x11'));var Redis=require(_0xe644('0x12'));var authService=require(_0xe644('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xe644('0x14'));var hardwareService=require(_0xe644('0x15'));var logger=require(_0xe644('0x16'))(_0xe644('0x17'));var utils=require(_0xe644('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xe644('0x19'));var db=require(_0xe644('0x1a'))['db'];function respondWithStatusCode(_0x5af19e,_0xd7b941){_0xd7b941=_0xd7b941||0xcc;return function(_0x37bf1a){if(_0x37bf1a){return _0x5af19e[_0xe644('0x1b')](_0xd7b941);}return _0x5af19e[_0xe644('0x1c')](_0xd7b941)[_0xe644('0x1d')]();};}function respondWithResult(_0x4b58ce,_0x15810b){_0x15810b=_0x15810b||0xc8;return function(_0x4b33e7){if(_0x4b33e7){return _0x4b58ce[_0xe644('0x1c')](_0x15810b)['json'](_0x4b33e7);}};}function respondWithFilteredResult(_0xee0b9a,_0x8a4b4d){return function(_0x42bc92){if(_0x42bc92){var _0x196557=typeof _0x8a4b4d[_0xe644('0x1e')]===_0xe644('0x1f')&&typeof _0x8a4b4d[_0xe644('0x20')]===_0xe644('0x1f');var _0x35edac=_0x42bc92[_0xe644('0x21')];var _0x574185=_0x196557?0x0:_0x8a4b4d[_0xe644('0x1e')];var _0x384b20=_0x196557?_0x42bc92[_0xe644('0x21')]:_0x8a4b4d['offset']+_0x8a4b4d[_0xe644('0x20')];var _0x1b3ad2;if(_0x384b20>=_0x35edac){_0x384b20=_0x35edac;_0x1b3ad2=0xc8;}else{_0x1b3ad2=0xce;}_0xee0b9a[_0xe644('0x1c')](_0x1b3ad2);return _0xee0b9a[_0xe644('0x22')](_0xe644('0x23'),_0x574185+'-'+_0x384b20+'/'+_0x35edac)['json'](_0x42bc92);}return null;};}function patchUpdates(_0x5c453c){return function(_0x420403){try{jsonpatch[_0xe644('0x24')](_0x420403,_0x5c453c,!![]);}catch(_0x1dde15){return BPromise[_0xe644('0x25')](_0x1dde15);}return _0x420403['save']();};}function saveUpdates(_0x305869,_0x1b8fe9){return function(_0x5154f4){if(_0x5154f4){return _0x5154f4['update'](_0x305869)[_0xe644('0x26')](function(_0x21d0d5){return _0x21d0d5;});}return null;};}function removeEntity(_0x19eeca,_0x4efd61){return function(_0x47123c){if(_0x47123c){return _0x47123c[_0xe644('0x27')]()[_0xe644('0x26')](function(){_0x19eeca[_0xe644('0x1c')](0xcc)[_0xe644('0x1d')]();});}};}function handleEntityNotFound(_0x3829e9,_0x42260a){return function(_0x3ff598){if(!_0x3ff598){_0x3829e9['sendStatus'](0x194);}return _0x3ff598;};}function handleError(_0x42bb83,_0x400bfd){_0x400bfd=_0x400bfd||0x1f4;return function(_0x51cd2b){logger['error'](_0x51cd2b[_0xe644('0x28')]);if(_0x51cd2b[_0xe644('0x29')]){delete _0x51cd2b[_0xe644('0x29')];}_0x42bb83[_0xe644('0x1c')](_0x400bfd)[_0xe644('0x2a')](_0x51cd2b);};}exports[_0xe644('0x2b')]=function(_0x4ee743,_0x4951ed){var _0xb90cdc={},_0x272c2a={},_0x4c9a1c={'count':0x0,'rows':[]};var _0x13823a=_[_0xe644('0x2c')](db[_0xe644('0x2d')]['rawAttributes'],function(_0x5b23d0){return{'name':_0x5b23d0[_0xe644('0x2e')],'type':_0x5b23d0[_0xe644('0x2f')][_0xe644('0x30')]};});_0x272c2a[_0xe644('0x31')]=_[_0xe644('0x2c')](_0x13823a,_0xe644('0x29'));_0x272c2a['query']=_[_0xe644('0x32')](_0x4ee743[_0xe644('0x33')]);_0x272c2a[_0xe644('0x34')]=_[_0xe644('0x35')](_0x272c2a[_0xe644('0x31')],_0x272c2a['query']);_0xb90cdc['attributes']=_['intersection'](_0x272c2a[_0xe644('0x31')],qs[_0xe644('0x36')](_0x4ee743[_0xe644('0x33')]['fields']));_0xb90cdc[_0xe644('0x37')]=_0xb90cdc[_0xe644('0x37')]['length']?_0xb90cdc[_0xe644('0x37')]:_0x272c2a['model'];if(!_0x4ee743[_0xe644('0x33')]['hasOwnProperty'](_0xe644('0x38'))){_0xb90cdc[_0xe644('0x20')]=qs[_0xe644('0x20')](_0x4ee743['query'][_0xe644('0x20')]);_0xb90cdc['offset']=qs['offset'](_0x4ee743[_0xe644('0x33')][_0xe644('0x1e')]);}_0xb90cdc[_0xe644('0x39')]=qs[_0xe644('0x3a')](_0x4ee743['query'][_0xe644('0x3a')]);_0xb90cdc[_0xe644('0x3b')]=qs[_0xe644('0x34')](_['pick'](_0x4ee743['query'],_0x272c2a[_0xe644('0x34')]),_0x13823a);if(_0x4ee743['query'][_0xe644('0x3c')]){_0xb90cdc['where']=_['merge'](_0xb90cdc[_0xe644('0x3b')],{'$or':_[_0xe644('0x2c')](_0x13823a,function(_0x3756cb){if(_0x3756cb[_0xe644('0x2f')]!==_0xe644('0x3d')){var _0x2bf2be={};_0x2bf2be[_0x3756cb[_0xe644('0x29')]]={'$like':'%'+_0x4ee743[_0xe644('0x33')][_0xe644('0x3c')]+'%'};return _0x2bf2be;}})});}_0xb90cdc=_[_0xe644('0x3e')]({},_0xb90cdc,_0x4ee743[_0xe644('0x3f')]);var _0x5331df={'where':_0xb90cdc[_0xe644('0x3b')]};return db[_0xe644('0x2d')][_0xe644('0x21')](_0x5331df)[_0xe644('0x26')](function(_0x471106){_0x4c9a1c[_0xe644('0x21')]=_0x471106;if(_0x4ee743['query'][_0xe644('0x40')]){_0xb90cdc[_0xe644('0x41')]=[{'all':!![]}];}return db[_0xe644('0x2d')][_0xe644('0x42')](_0xb90cdc);})[_0xe644('0x26')](function(_0x3eaa03){_0x4c9a1c[_0xe644('0x43')]=_0x3eaa03;return _0x4c9a1c;})[_0xe644('0x26')](respondWithFilteredResult(_0x4951ed,_0xb90cdc))[_0xe644('0x44')](handleError(_0x4951ed,null));};exports[_0xe644('0x45')]=function(_0x360490,_0x230178){var _0x26ebf1={'raw':!![],'where':{'id':_0x360490['params']['id']}},_0x553c82={};_0x553c82[_0xe644('0x31')]=_['keys'](db[_0xe644('0x2d')]['rawAttributes']);_0x553c82[_0xe644('0x33')]=_['keys'](_0x360490[_0xe644('0x33')]);_0x553c82[_0xe644('0x34')]=_[_0xe644('0x35')](_0x553c82[_0xe644('0x31')],_0x553c82[_0xe644('0x33')]);_0x26ebf1[_0xe644('0x37')]=_[_0xe644('0x35')](_0x553c82[_0xe644('0x31')],qs[_0xe644('0x36')](_0x360490[_0xe644('0x33')]['fields']));_0x26ebf1['attributes']=_0x26ebf1[_0xe644('0x37')][_0xe644('0x46')]?_0x26ebf1[_0xe644('0x37')]:_0x553c82[_0xe644('0x31')];if(_0x360490[_0xe644('0x33')][_0xe644('0x40')]){_0x26ebf1['include']=[{'all':!![]}];}_0x26ebf1=_[_0xe644('0x3e')]({},_0x26ebf1,_0x360490['options']);return db[_0xe644('0x2d')][_0xe644('0x47')](_0x26ebf1)[_0xe644('0x26')](handleEntityNotFound(_0x230178,null))[_0xe644('0x26')](respondWithResult(_0x230178,null))[_0xe644('0x44')](handleError(_0x230178,null));};exports[_0xe644('0x48')]=function(_0x2a160f,_0x26ad9a){return db['OpenchannelTransferReport'][_0xe644('0x48')](_0x2a160f[_0xe644('0x49')],{})[_0xe644('0x26')](respondWithResult(_0x26ad9a,0xc9))[_0xe644('0x44')](handleError(_0x26ad9a,null));};exports[_0xe644('0x4a')]=function(_0x4af963,_0x4d9ce){if(_0x4af963['body']['id']){delete _0x4af963['body']['id'];}return db[_0xe644('0x2d')]['find']({'where':{'id':_0x4af963[_0xe644('0x4b')]['id']}})[_0xe644('0x26')](handleEntityNotFound(_0x4d9ce,null))['then'](saveUpdates(_0x4af963['body'],null))[_0xe644('0x26')](respondWithResult(_0x4d9ce,null))[_0xe644('0x44')](handleError(_0x4d9ce,null));};exports[_0xe644('0x27')]=function(_0x1d8701,_0x382d81){return db[_0xe644('0x2d')][_0xe644('0x47')]({'where':{'id':_0x1d8701[_0xe644('0x4b')]['id']}})[_0xe644('0x26')](handleEntityNotFound(_0x382d81,null))['then'](removeEntity(_0x382d81,null))[_0xe644('0x44')](handleError(_0x382d81,null));};exports[_0xe644('0x4c')]=function(_0x1e9612,_0x280539){return db[_0xe644('0x2d')][_0xe644('0x4c')]()[_0xe644('0x26')](respondWithResult(_0x280539,null))['catch'](handleError(_0x280539,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 22c98c3..43ffefe 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 _0x6c67=['util','api','moment','bluebird','request-promise','path','rimraf','exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid'];(function(_0x304e0e,_0x33b054){var _0x568db1=function(_0x3db7dc){while(--_0x3db7dc){_0x304e0e['push'](_0x304e0e['shift']());}};_0x568db1(++_0x33b054);}(_0x6c67,0x114));var _0x76c6=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0x6c67[_0x4a53d];return _0x27410e;};'use strict';var _=require('lodash');var util=require(_0x76c6('0x0'));var logger=require('../../config/logger')(_0x76c6('0x1'));var moment=require(_0x76c6('0x2'));var BPromise=require(_0x76c6('0x3'));var rp=require(_0x76c6('0x4'));var fs=require('fs');var path=require(_0x76c6('0x5'));var rimraf=require(_0x76c6('0x6'));var config=require('../../config/environment');var attributes=require('./openchannelTransferReport.attributes');module[_0x76c6('0x7')]=function(_0x4c2db3,_0x114a8a){return _0x4c2db3[_0x76c6('0x8')](_0x76c6('0x9'),attributes,{'tableName':_0x76c6('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x76c6('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x08fe=['rimraf','../../config/environment','exports','report_openchannel_transfer','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x52784e,_0x318010){var _0xbd631f=function(_0x1fe707){while(--_0x1fe707){_0x52784e['push'](_0x52784e['shift']());}};_0xbd631f(++_0x318010);}(_0x08fe,0x1bc));var _0xe08f=function(_0x41ba41,_0x145412){_0x41ba41=_0x41ba41-0x0;var _0x22d385=_0x08fe[_0x41ba41];return _0x22d385;};'use strict';var _=require(_0xe08f('0x0'));var util=require(_0xe08f('0x1'));var logger=require(_0xe08f('0x2'))('api');var moment=require(_0xe08f('0x3'));var BPromise=require(_0xe08f('0x4'));var rp=require(_0xe08f('0x5'));var fs=require('fs');var path=require(_0xe08f('0x6'));var rimraf=require(_0xe08f('0x7'));var config=require(_0xe08f('0x8'));var attributes=require('./openchannelTransferReport.attributes');module[_0xe08f('0x9')]=function(_0x253e5d,_0x57e59a){return _0x253e5d['define']('OpenchannelTransferReport',attributes,{'tableName':_0xe08f('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 79fe6f5..597bded 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 _0xd8a7=['../../config/environment','client','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x494d1f,_0x3f72ff){var _0x457b6e=function(_0x38cb16){while(--_0x38cb16){_0x494d1f['push'](_0x494d1f['shift']());}};_0x457b6e(++_0x3f72ff);}(_0xd8a7,0xdf));var _0x7d8a=function(_0x38429b,_0x1f9d0e){_0x38429b=_0x38429b-0x0;var _0x157019=_0xd8a7[_0x38429b];return _0x157019;};'use strict';var _=require(_0x7d8a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7d8a('0x1'));var fs=require('fs');var Redis=require(_0x7d8a('0x2'));var db=require(_0x7d8a('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7d8a('0x4'))('rpc');var config=require(_0x7d8a('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x7d8a('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cf673,_0x28ea08,_0x240123){return new BPromise(function(_0x58ead1,_0x3207cc){return client[_0x7d8a('0x7')](_0x1cf673,_0x240123)[_0x7d8a('0x8')](function(_0x328503){logger[_0x7d8a('0x9')](_0x7d8a('0xa'),_0x28ea08,_0x7d8a('0xb'));logger[_0x7d8a('0xc')](_0x7d8a('0xd'),_0x28ea08,_0x7d8a('0xb'),JSON[_0x7d8a('0xe')](_0x328503));if(_0x328503[_0x7d8a('0xf')]){if(_0x328503[_0x7d8a('0xf')]['code']===0x1f4){logger[_0x7d8a('0xf')](_0x7d8a('0xa'),_0x28ea08,_0x328503[_0x7d8a('0xf')][_0x7d8a('0x10')]);return _0x3207cc(_0x328503[_0x7d8a('0xf')]['message']);}logger[_0x7d8a('0xf')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x28ea08,_0x328503[_0x7d8a('0xf')]['message']);return _0x58ead1(_0x328503[_0x7d8a('0xf')]['message']);}else{logger[_0x7d8a('0x9')](_0x7d8a('0xa'),_0x28ea08,'request\x20sent');_0x58ead1(_0x328503[_0x7d8a('0x11')][_0x7d8a('0x10')]);}})[_0x7d8a('0x12')](function(_0xe9563c){logger['error'](_0x7d8a('0xa'),_0x28ea08,_0xe9563c);_0x3207cc(_0xe9563c);});});} \ No newline at end of file +var _0xf041=['OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','client','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x49e0a4,_0x34337b){var _0xa2e5d6=function(_0x1a218a){while(--_0x1a218a){_0x49e0a4['push'](_0x49e0a4['shift']());}};_0xa2e5d6(++_0x34337b);}(_0xf041,0x15b));var _0x1f04=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf041[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1f04('0x0'));var BPromise=require(_0x1f04('0x1'));var rs=require(_0x1f04('0x2'));var fs=require('fs');var Redis=require(_0x1f04('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1f04('0x4'));var logger=require('../../config/logger')(_0x1f04('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1f04('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2c3f90,_0x165bb1,_0x12897f){return new BPromise(function(_0x1c7a8a,_0x5c48e4){return client[_0x1f04('0x7')](_0x2c3f90,_0x12897f)[_0x1f04('0x8')](function(_0x3bcdde){logger[_0x1f04('0x9')](_0x1f04('0xa'),_0x165bb1,_0x1f04('0xb'));logger[_0x1f04('0xc')](_0x1f04('0xd'),_0x165bb1,'request\x20sent',JSON['stringify'](_0x3bcdde));if(_0x3bcdde[_0x1f04('0xe')]){if(_0x3bcdde[_0x1f04('0xe')][_0x1f04('0xf')]===0x1f4){logger[_0x1f04('0xe')](_0x1f04('0xa'),_0x165bb1,_0x3bcdde[_0x1f04('0xe')][_0x1f04('0x10')]);return _0x5c48e4(_0x3bcdde[_0x1f04('0xe')][_0x1f04('0x10')]);}logger[_0x1f04('0xe')](_0x1f04('0xa'),_0x165bb1,_0x3bcdde['error']['message']);return _0x1c7a8a(_0x3bcdde[_0x1f04('0xe')][_0x1f04('0x10')]);}else{logger[_0x1f04('0x9')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x165bb1,_0x1f04('0xb'));_0x1c7a8a(_0x3bcdde['result'][_0x1f04('0x10')]);}})[_0x1f04('0x11')](function(_0x28c094){logger[_0x1f04('0xe')](_0x1f04('0xa'),_0x165bb1,_0x28c094);_0x5c48e4(_0x28c094);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 1b2a7ac..ca7983a 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 _0xf40f=['multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','exports'];(function(_0x51e76c,_0x5db376){var _0x17a87e=function(_0x2df755){while(--_0x2df755){_0x51e76c['push'](_0x51e76c['shift']());}};_0x17a87e(++_0x5db376);}(_0xf40f,0x11d));var _0xff40=function(_0x1a4059,_0x2ee393){_0x1a4059=_0x1a4059-0x0;var _0x2afb0a=_0xf40f[_0x1a4059];return _0x2afb0a;};'use strict';var multer=require(_0xff40('0x0'));var util=require(_0xff40('0x1'));var path=require(_0xff40('0x2'));var timeout=require(_0xff40('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xff40('0x4'));var auth=require(_0xff40('0x5'));var interaction=require(_0xff40('0x6'));var config=require(_0xff40('0x7'));var controller=require(_0xff40('0x8'));router[_0xff40('0x9')]('/',auth[_0xff40('0xa')](),controller[_0xff40('0xb')]);router[_0xff40('0x9')](_0xff40('0xc'),auth[_0xff40('0xa')](),controller['show']);router[_0xff40('0xd')]('/',auth[_0xff40('0xa')](),controller[_0xff40('0xe')]);router[_0xff40('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xff40('0x10')]);router[_0xff40('0x11')](_0xff40('0xc'),auth[_0xff40('0xa')](),controller['destroy']);module[_0xff40('0x12')]=router; \ No newline at end of file +var _0xb1d9=['put','/:id','update','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','isAuthenticated','show','post','create'];(function(_0x594de8,_0x46d0d2){var _0x5fcbf=function(_0x48c215){while(--_0x48c215){_0x594de8['push'](_0x594de8['shift']());}};_0x5fcbf(++_0x46d0d2);}(_0xb1d9,0x147));var _0x9b1d=function(_0x26b25d,_0x30969a){_0x26b25d=_0x26b25d-0x0;var _0x5b9b5e=_0xb1d9[_0x26b25d];return _0x5b9b5e;};'use strict';var multer=require(_0x9b1d('0x0'));var util=require(_0x9b1d('0x1'));var path=require(_0x9b1d('0x2'));var timeout=require(_0x9b1d('0x3'));var express=require(_0x9b1d('0x4'));var router=express[_0x9b1d('0x5')]();var fs_extra=require(_0x9b1d('0x6'));var auth=require(_0x9b1d('0x7'));var interaction=require(_0x9b1d('0x8'));var config=require('../../config/environment');var controller=require('./pause.controller');router[_0x9b1d('0x9')]('/',auth['isAuthenticated'](),controller[_0x9b1d('0xa')]);router[_0x9b1d('0x9')]('/:id',auth[_0x9b1d('0xb')](),controller[_0x9b1d('0xc')]);router[_0x9b1d('0xd')]('/',auth['isAuthenticated'](),controller[_0x9b1d('0xe')]);router[_0x9b1d('0xf')](_0x9b1d('0x10'),auth[_0x9b1d('0xb')](),controller[_0x9b1d('0x11')]);router['delete'](_0x9b1d('0x10'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 1b88516..c181143 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 _0x437c=['sequelize','exports','STRING'];(function(_0x43c1f3,_0x5ca62b){var _0x8d7a39=function(_0x5b5d42){while(--_0x5b5d42){_0x43c1f3['push'](_0x43c1f3['shift']());}};_0x8d7a39(++_0x5ca62b);}(_0x437c,0x135));var _0xc437=function(_0x1d0b67,_0x3c6299){_0x1d0b67=_0x1d0b67-0x0;var _0xd1594a=_0x437c[_0x1d0b67];return _0xd1594a;};'use strict';var Sequelize=require(_0xc437('0x0'));module[_0xc437('0x1')]={'name':{'type':Sequelize[_0xc437('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x62c6=['STRING','name','exports'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x62c6,0x107));var _0x662c=function(_0x4030c8,_0x1e5596){_0x4030c8=_0x4030c8-0x0;var _0xda2ffd=_0x62c6[_0x4030c8];return _0xda2ffd;};'use strict';var Sequelize=require('sequelize');module[_0x662c('0x0')]={'name':{'type':Sequelize[_0x662c('0x1')],'unique':_0x662c('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x662c('0x1')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 1f14d7b..66e3563 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 _0xe259=['UserProfileResource','name','send','index','map','Pause','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','fields','model','hasOwnProperty','nolimit','order','sort','filter','where','options','include','findAll','rows','show','params','includeAll','merge','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','reject','save','update','then','destroy','get','Pauses'];(function(_0x461b52,_0x20b9ed){var _0x2c3811=function(_0xba555c){while(--_0xba555c){_0x461b52['push'](_0x461b52['shift']());}};_0x2c3811(++_0x20b9ed);}(_0xe259,0x1c9));var _0x9e25=function(_0xdd79f9,_0x165620){_0xdd79f9=_0xdd79f9-0x0;var _0x462b21=_0xe259[_0xdd79f9];return _0x462b21;};'use strict';var emlformat=require(_0x9e25('0x0'));var rimraf=require(_0x9e25('0x1'));var zipdir=require(_0x9e25('0x2'));var jsonpatch=require(_0x9e25('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9e25('0x4'));var Mustache=require(_0x9e25('0x5'));var util=require('util');var path=require(_0x9e25('0x6'));var sox=require(_0x9e25('0x7'));var csv=require('to-csv');var ejs=require(_0x9e25('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9e25('0x9'));var squel=require(_0x9e25('0xa'));var crypto=require('crypto');var jsforce=require(_0x9e25('0xb'));var deskjs=require(_0x9e25('0xc'));var toCsv=require(_0x9e25('0xd'));var querystring=require(_0x9e25('0xe'));var Papa=require(_0x9e25('0xf'));var Redis=require(_0x9e25('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9e25('0x11'));var as=require(_0x9e25('0x12'));var hardwareService=require(_0x9e25('0x13'));var logger=require(_0x9e25('0x14'))(_0x9e25('0x15'));var utils=require(_0x9e25('0x16'));var config=require(_0x9e25('0x17'));var licenseUtil=require(_0x9e25('0x18'));var db=require(_0x9e25('0x19'))['db'];function respondWithStatusCode(_0x37a35e,_0x18e595){_0x18e595=_0x18e595||0xcc;return function(_0x24485c){if(_0x24485c){return _0x37a35e[_0x9e25('0x1a')](_0x18e595);}return _0x37a35e[_0x9e25('0x1b')](_0x18e595)[_0x9e25('0x1c')]();};}function respondWithResult(_0xdefbb8,_0xc12f2e){_0xc12f2e=_0xc12f2e||0xc8;return function(_0x581e79){if(_0x581e79){return _0xdefbb8[_0x9e25('0x1b')](_0xc12f2e)[_0x9e25('0x1d')](_0x581e79);}};}function respondWithFilteredResult(_0x3a5d0d,_0x56dda1){return function(_0x2fdb93){if(_0x2fdb93){var _0x1a61bf=typeof _0x56dda1[_0x9e25('0x1e')]==='undefined'&&typeof _0x56dda1[_0x9e25('0x1f')]==='undefined';var _0x44b04c=_0x2fdb93['count'];var _0x4445be=_0x1a61bf?0x0:_0x56dda1[_0x9e25('0x1e')];var _0x341a61=_0x1a61bf?_0x2fdb93[_0x9e25('0x20')]:_0x56dda1[_0x9e25('0x1e')]+_0x56dda1['limit'];var _0x35838e;if(_0x341a61>=_0x44b04c){_0x341a61=_0x44b04c;_0x35838e=0xc8;}else{_0x35838e=0xce;}_0x3a5d0d[_0x9e25('0x1b')](_0x35838e);return _0x3a5d0d[_0x9e25('0x21')]('Content-Range',_0x4445be+'-'+_0x341a61+'/'+_0x44b04c)[_0x9e25('0x1d')](_0x2fdb93);}return null;};}function patchUpdates(_0x55cc85){return function(_0x33d744){try{jsonpatch['apply'](_0x33d744,_0x55cc85,!![]);}catch(_0x170252){return BPromise[_0x9e25('0x22')](_0x170252);}return _0x33d744[_0x9e25('0x23')]();};}function saveUpdates(_0x3b55a6,_0x1b4888){return function(_0x296490){if(_0x296490){return _0x296490[_0x9e25('0x24')](_0x3b55a6)[_0x9e25('0x25')](function(_0x264c01){return _0x264c01;});}return null;};}function removeEntity(_0x43fb46,_0x2c1da8){return function(_0x2d2d67){if(_0x2d2d67){return _0x2d2d67[_0x9e25('0x26')]()[_0x9e25('0x25')](function(){var _0x5a8a11=_0x2d2d67[_0x9e25('0x27')]({'plain':!![]});var _0x67b144=_0x9e25('0x28');return db[_0x9e25('0x29')][_0x9e25('0x26')]({'where':{'type':_0x67b144,'resourceId':_0x5a8a11['id']}})[_0x9e25('0x25')](function(){return _0x2d2d67;});})[_0x9e25('0x25')](function(){_0x43fb46[_0x9e25('0x1b')](0xcc)[_0x9e25('0x1c')]();});}};}function handleEntityNotFound(_0x43b17f,_0x1ac8bd){return function(_0x4be839){if(!_0x4be839){_0x43b17f['sendStatus'](0x194);}return _0x4be839;};}function handleError(_0x4da326,_0xd350a2){_0xd350a2=_0xd350a2||0x1f4;return function(_0x4bb834){logger['error'](_0x4bb834['stack']);if(_0x4bb834[_0x9e25('0x2a')]){delete _0x4bb834[_0x9e25('0x2a')];}_0x4da326[_0x9e25('0x1b')](_0xd350a2)[_0x9e25('0x2b')](_0x4bb834);};}exports[_0x9e25('0x2c')]=function(_0x48aaa0,_0x1cb6cb){var _0x47fc48={},_0x3698b0={},_0x2b2828={'count':0x0,'rows':[]};var _0x5a113a=_[_0x9e25('0x2d')](db[_0x9e25('0x2e')][_0x9e25('0x2f')],function(_0x10f90b){return{'name':_0x10f90b[_0x9e25('0x30')],'type':_0x10f90b[_0x9e25('0x31')][_0x9e25('0x32')]};});_0x3698b0['model']=_[_0x9e25('0x2d')](_0x5a113a,_0x9e25('0x2a'));_0x3698b0[_0x9e25('0x33')]=_[_0x9e25('0x34')](_0x48aaa0[_0x9e25('0x33')]);_0x3698b0[_0x9e25('0x35')]=_[_0x9e25('0x36')](_0x3698b0['model'],_0x3698b0['query']);_0x47fc48[_0x9e25('0x37')]=_[_0x9e25('0x36')](_0x3698b0['model'],qs['fields'](_0x48aaa0[_0x9e25('0x33')][_0x9e25('0x38')]));_0x47fc48['attributes']=_0x47fc48['attributes']['length']?_0x47fc48['attributes']:_0x3698b0[_0x9e25('0x39')];if(!_0x48aaa0[_0x9e25('0x33')][_0x9e25('0x3a')](_0x9e25('0x3b'))){_0x47fc48['limit']=qs[_0x9e25('0x1f')](_0x48aaa0['query'][_0x9e25('0x1f')]);_0x47fc48[_0x9e25('0x1e')]=qs[_0x9e25('0x1e')](_0x48aaa0[_0x9e25('0x33')]['offset']);}_0x47fc48[_0x9e25('0x3c')]=qs['sort'](_0x48aaa0['query'][_0x9e25('0x3d')]);_0x47fc48['where']=qs[_0x9e25('0x35')](_['pick'](_0x48aaa0['query'],_0x3698b0[_0x9e25('0x35')]),_0x5a113a);if(_0x48aaa0['query'][_0x9e25('0x3e')]){_0x47fc48[_0x9e25('0x3f')]=_['merge'](_0x47fc48[_0x9e25('0x3f')],{'$or':_[_0x9e25('0x2d')](_0x5a113a,function(_0x212652){if(_0x212652[_0x9e25('0x31')]!=='VIRTUAL'){var _0x544826={};_0x544826[_0x212652[_0x9e25('0x2a')]]={'$like':'%'+_0x48aaa0[_0x9e25('0x33')]['filter']+'%'};return _0x544826;}})});}_0x47fc48=_['merge']({},_0x47fc48,_0x48aaa0[_0x9e25('0x40')]);var _0x379870={'where':_0x47fc48[_0x9e25('0x3f')]};return db[_0x9e25('0x2e')]['count'](_0x379870)[_0x9e25('0x25')](function(_0x55b086){_0x2b2828[_0x9e25('0x20')]=_0x55b086;if(_0x48aaa0[_0x9e25('0x33')]['includeAll']){_0x47fc48[_0x9e25('0x41')]=[{'all':!![]}];}return db[_0x9e25('0x2e')][_0x9e25('0x42')](_0x47fc48);})[_0x9e25('0x25')](function(_0x2db448){_0x2b2828[_0x9e25('0x43')]=_0x2db448;return _0x2b2828;})[_0x9e25('0x25')](respondWithFilteredResult(_0x1cb6cb,_0x47fc48))['catch'](handleError(_0x1cb6cb,null));};exports[_0x9e25('0x44')]=function(_0x43d5aa,_0x582ea7){var _0x24fe62={'raw':!![],'where':{'id':_0x43d5aa[_0x9e25('0x45')]['id']}},_0x5b937e={};_0x5b937e['model']=_['keys'](db['Pause']['rawAttributes']);_0x5b937e['query']=_[_0x9e25('0x34')](_0x43d5aa['query']);_0x5b937e[_0x9e25('0x35')]=_[_0x9e25('0x36')](_0x5b937e[_0x9e25('0x39')],_0x5b937e[_0x9e25('0x33')]);_0x24fe62[_0x9e25('0x37')]=_[_0x9e25('0x36')](_0x5b937e['model'],qs[_0x9e25('0x38')](_0x43d5aa['query'][_0x9e25('0x38')]));_0x24fe62[_0x9e25('0x37')]=_0x24fe62['attributes']['length']?_0x24fe62['attributes']:_0x5b937e[_0x9e25('0x39')];if(_0x43d5aa[_0x9e25('0x33')][_0x9e25('0x46')]){_0x24fe62[_0x9e25('0x41')]=[{'all':!![]}];}_0x24fe62=_[_0x9e25('0x47')]({},_0x24fe62,_0x43d5aa[_0x9e25('0x40')]);return db['Pause'][_0x9e25('0x48')](_0x24fe62)[_0x9e25('0x25')](handleEntityNotFound(_0x582ea7,null))[_0x9e25('0x25')](respondWithResult(_0x582ea7,null))[_0x9e25('0x49')](handleError(_0x582ea7,null));};exports[_0x9e25('0x4a')]=function(_0x12a5ee,_0x169d87){return db['Pause']['create'](_0x12a5ee[_0x9e25('0x4b')],{})[_0x9e25('0x25')](function(_0x5d3c47){var _0x5005dc=_0x12a5ee[_0x9e25('0x4c')][_0x9e25('0x27')]({'plain':!![]});if(!_0x5005dc)throw new Error(_0x9e25('0x4d'));if(_0x5005dc[_0x9e25('0x4e')]==='user'){var _0x12452b=_0x5d3c47['get']({'plain':!![]});var _0x3f9b14='Pauses';return db[_0x9e25('0x4f')]['find']({'where':{'name':_0x3f9b14,'userProfileId':_0x5005dc[_0x9e25('0x50')]},'raw':!![]})[_0x9e25('0x25')](function(_0x2d68ba){if(_0x2d68ba&&_0x2d68ba[_0x9e25('0x51')]===0x0){return db['UserProfileResource']['create']({'name':_0x12452b[_0x9e25('0x2a')],'resourceId':_0x12452b['id'],'type':_0x2d68ba['name'],'sectionId':_0x2d68ba['id']},{})[_0x9e25('0x25')](function(){return _0x5d3c47;});}else{return _0x5d3c47;}})[_0x9e25('0x49')](function(_0x3219e5){logger['error'](_0x9e25('0x52'),_0x3219e5);throw _0x3219e5;});}return _0x5d3c47;})['then'](respondWithResult(_0x169d87,0xc9))['catch'](handleError(_0x169d87,null));};exports[_0x9e25('0x24')]=function(_0x70b930,_0x3bcc2d){if(_0x70b930[_0x9e25('0x4b')]['id']){delete _0x70b930[_0x9e25('0x4b')]['id'];}return db[_0x9e25('0x2e')]['find']({'where':{'id':_0x70b930[_0x9e25('0x45')]['id']}})[_0x9e25('0x25')](handleEntityNotFound(_0x3bcc2d,null))[_0x9e25('0x25')](saveUpdates(_0x70b930[_0x9e25('0x4b')],null))['then'](respondWithResult(_0x3bcc2d,null))[_0x9e25('0x49')](handleError(_0x3bcc2d,null));};exports[_0x9e25('0x26')]=function(_0x2ae5d5,_0x2a8c9c){return db[_0x9e25('0x2e')]['find']({'where':{'id':_0x2ae5d5[_0x9e25('0x45')]['id']}})['then'](handleEntityNotFound(_0x2a8c9c,null))[_0x9e25('0x25')](removeEntity(_0x2a8c9c,null))['catch'](handleError(_0x2a8c9c,null));}; \ No newline at end of file +var _0x8818=['attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','includeAll','include','findAll','catch','show','params','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','body','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','Content-Range','json','apply','reject','save','then','destroy','get','Pauses','error','stack','name','send','index','map','Pause','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields'];(function(_0x1ab8e8,_0xe28dab){var _0x267bae=function(_0x4a0a15){while(--_0x4a0a15){_0x1ab8e8['push'](_0x1ab8e8['shift']());}};_0x267bae(++_0xe28dab);}(_0x8818,0xc1));var _0x8881=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x8818[_0x5c351c];return _0x26f3b3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8881('0x0'));var zipdir=require(_0x8881('0x1'));var jsonpatch=require(_0x8881('0x2'));var rp=require(_0x8881('0x3'));var moment=require('moment');var BPromise=require(_0x8881('0x4'));var Mustache=require('mustache');var util=require(_0x8881('0x5'));var path=require(_0x8881('0x6'));var sox=require(_0x8881('0x7'));var csv=require(_0x8881('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8881('0x9'));var _=require(_0x8881('0xa'));var squel=require(_0x8881('0xb'));var crypto=require('crypto');var jsforce=require(_0x8881('0xc'));var deskjs=require(_0x8881('0xd'));var toCsv=require(_0x8881('0x8'));var querystring=require(_0x8881('0xe'));var Papa=require('papaparse');var Redis=require(_0x8881('0xf'));var authService=require(_0x8881('0x10'));var qs=require(_0x8881('0x11'));var as=require(_0x8881('0x12'));var hardwareService=require(_0x8881('0x13'));var logger=require(_0x8881('0x14'))(_0x8881('0x15'));var utils=require(_0x8881('0x16'));var config=require(_0x8881('0x17'));var licenseUtil=require(_0x8881('0x18'));var db=require(_0x8881('0x19'))['db'];function respondWithStatusCode(_0x50b679,_0x4fbb7){_0x4fbb7=_0x4fbb7||0xcc;return function(_0x169b05){if(_0x169b05){return _0x50b679[_0x8881('0x1a')](_0x4fbb7);}return _0x50b679[_0x8881('0x1b')](_0x4fbb7)[_0x8881('0x1c')]();};}function respondWithResult(_0x5303a5,_0x955b15){_0x955b15=_0x955b15||0xc8;return function(_0x3dafca){if(_0x3dafca){return _0x5303a5[_0x8881('0x1b')](_0x955b15)['json'](_0x3dafca);}};}function respondWithFilteredResult(_0x2773c5,_0x18193b){return function(_0x155020){if(_0x155020){var _0x2ac8d2=typeof _0x18193b[_0x8881('0x1d')]===_0x8881('0x1e')&&typeof _0x18193b['limit']===_0x8881('0x1e');var _0x360fe1=_0x155020[_0x8881('0x1f')];var _0x51cd1e=_0x2ac8d2?0x0:_0x18193b[_0x8881('0x1d')];var _0x74a3f7=_0x2ac8d2?_0x155020[_0x8881('0x1f')]:_0x18193b[_0x8881('0x1d')]+_0x18193b[_0x8881('0x20')];var _0x2cae29;if(_0x74a3f7>=_0x360fe1){_0x74a3f7=_0x360fe1;_0x2cae29=0xc8;}else{_0x2cae29=0xce;}_0x2773c5[_0x8881('0x1b')](_0x2cae29);return _0x2773c5['set'](_0x8881('0x21'),_0x51cd1e+'-'+_0x74a3f7+'/'+_0x360fe1)[_0x8881('0x22')](_0x155020);}return null;};}function patchUpdates(_0x1c5616){return function(_0x28bcf0){try{jsonpatch[_0x8881('0x23')](_0x28bcf0,_0x1c5616,!![]);}catch(_0x2f0bca){return BPromise[_0x8881('0x24')](_0x2f0bca);}return _0x28bcf0[_0x8881('0x25')]();};}function saveUpdates(_0x3a3156,_0x4b3909){return function(_0x4c3c41){if(_0x4c3c41){return _0x4c3c41['update'](_0x3a3156)[_0x8881('0x26')](function(_0x1f8633){return _0x1f8633;});}return null;};}function removeEntity(_0x27ffa7,_0x3f4310){return function(_0x48d65c){if(_0x48d65c){return _0x48d65c[_0x8881('0x27')]()[_0x8881('0x26')](function(){var _0x4025fa=_0x48d65c[_0x8881('0x28')]({'plain':!![]});var _0x52a035=_0x8881('0x29');return db['UserProfileResource'][_0x8881('0x27')]({'where':{'type':_0x52a035,'resourceId':_0x4025fa['id']}})[_0x8881('0x26')](function(){return _0x48d65c;});})['then'](function(){_0x27ffa7['status'](0xcc)[_0x8881('0x1c')]();});}};}function handleEntityNotFound(_0xa345f7,_0x83268){return function(_0x56e22e){if(!_0x56e22e){_0xa345f7[_0x8881('0x1a')](0x194);}return _0x56e22e;};}function handleError(_0x55cac6,_0x292f41){_0x292f41=_0x292f41||0x1f4;return function(_0x4320b7){logger[_0x8881('0x2a')](_0x4320b7[_0x8881('0x2b')]);if(_0x4320b7[_0x8881('0x2c')]){delete _0x4320b7[_0x8881('0x2c')];}_0x55cac6[_0x8881('0x1b')](_0x292f41)[_0x8881('0x2d')](_0x4320b7);};}exports[_0x8881('0x2e')]=function(_0x13a1c1,_0x1eee54){var _0x363124={},_0x48240c={},_0x5e457f={'count':0x0,'rows':[]};var _0x1e257e=_[_0x8881('0x2f')](db[_0x8881('0x30')][_0x8881('0x31')],function(_0x334d43){return{'name':_0x334d43[_0x8881('0x32')],'type':_0x334d43[_0x8881('0x33')][_0x8881('0x34')]};});_0x48240c[_0x8881('0x35')]=_[_0x8881('0x2f')](_0x1e257e,_0x8881('0x2c'));_0x48240c[_0x8881('0x36')]=_[_0x8881('0x37')](_0x13a1c1[_0x8881('0x36')]);_0x48240c[_0x8881('0x38')]=_[_0x8881('0x39')](_0x48240c['model'],_0x48240c[_0x8881('0x36')]);_0x363124['attributes']=_[_0x8881('0x39')](_0x48240c['model'],qs[_0x8881('0x3a')](_0x13a1c1[_0x8881('0x36')][_0x8881('0x3a')]));_0x363124[_0x8881('0x3b')]=_0x363124[_0x8881('0x3b')][_0x8881('0x3c')]?_0x363124['attributes']:_0x48240c[_0x8881('0x35')];if(!_0x13a1c1[_0x8881('0x36')][_0x8881('0x3d')](_0x8881('0x3e'))){_0x363124['limit']=qs[_0x8881('0x20')](_0x13a1c1[_0x8881('0x36')][_0x8881('0x20')]);_0x363124[_0x8881('0x1d')]=qs[_0x8881('0x1d')](_0x13a1c1[_0x8881('0x36')][_0x8881('0x1d')]);}_0x363124[_0x8881('0x3f')]=qs[_0x8881('0x40')](_0x13a1c1[_0x8881('0x36')]['sort']);_0x363124[_0x8881('0x41')]=qs['filters'](_[_0x8881('0x42')](_0x13a1c1['query'],_0x48240c[_0x8881('0x38')]),_0x1e257e);if(_0x13a1c1['query']['filter']){_0x363124[_0x8881('0x41')]=_[_0x8881('0x43')](_0x363124['where'],{'$or':_['map'](_0x1e257e,function(_0x2a24c9){if(_0x2a24c9[_0x8881('0x33')]!=='VIRTUAL'){var _0x4bce61={};_0x4bce61[_0x2a24c9[_0x8881('0x2c')]]={'$like':'%'+_0x13a1c1['query'][_0x8881('0x44')]+'%'};return _0x4bce61;}})});}_0x363124=_['merge']({},_0x363124,_0x13a1c1['options']);var _0x2d3206={'where':_0x363124[_0x8881('0x41')]};return db['Pause'][_0x8881('0x1f')](_0x2d3206)[_0x8881('0x26')](function(_0x4ffae2){_0x5e457f[_0x8881('0x1f')]=_0x4ffae2;if(_0x13a1c1['query'][_0x8881('0x45')]){_0x363124[_0x8881('0x46')]=[{'all':!![]}];}return db[_0x8881('0x30')][_0x8881('0x47')](_0x363124);})['then'](function(_0x3e28d9){_0x5e457f['rows']=_0x3e28d9;return _0x5e457f;})[_0x8881('0x26')](respondWithFilteredResult(_0x1eee54,_0x363124))[_0x8881('0x48')](handleError(_0x1eee54,null));};exports[_0x8881('0x49')]=function(_0x3e3abe,_0x3dc976){var _0xd7b73={'raw':!![],'where':{'id':_0x3e3abe[_0x8881('0x4a')]['id']}},_0x176514={};_0x176514[_0x8881('0x35')]=_[_0x8881('0x37')](db[_0x8881('0x30')][_0x8881('0x31')]);_0x176514['query']=_[_0x8881('0x37')](_0x3e3abe[_0x8881('0x36')]);_0x176514[_0x8881('0x38')]=_[_0x8881('0x39')](_0x176514[_0x8881('0x35')],_0x176514['query']);_0xd7b73[_0x8881('0x3b')]=_[_0x8881('0x39')](_0x176514['model'],qs[_0x8881('0x3a')](_0x3e3abe[_0x8881('0x36')][_0x8881('0x3a')]));_0xd7b73[_0x8881('0x3b')]=_0xd7b73[_0x8881('0x3b')]['length']?_0xd7b73[_0x8881('0x3b')]:_0x176514['model'];if(_0x3e3abe['query'][_0x8881('0x45')]){_0xd7b73[_0x8881('0x46')]=[{'all':!![]}];}_0xd7b73=_[_0x8881('0x43')]({},_0xd7b73,_0x3e3abe[_0x8881('0x4b')]);return db[_0x8881('0x30')][_0x8881('0x4c')](_0xd7b73)['then'](handleEntityNotFound(_0x3dc976,null))[_0x8881('0x26')](respondWithResult(_0x3dc976,null))[_0x8881('0x48')](handleError(_0x3dc976,null));};exports['create']=function(_0x5eb9c3,_0x3729f9){return db[_0x8881('0x30')][_0x8881('0x4d')](_0x5eb9c3['body'],{})[_0x8881('0x26')](function(_0x4fccc7){var _0x399614=_0x5eb9c3[_0x8881('0x4e')][_0x8881('0x28')]({'plain':!![]});if(!_0x399614)throw new Error(_0x8881('0x4f'));if(_0x399614[_0x8881('0x50')]===_0x8881('0x4e')){var _0x24b4df=_0x4fccc7['get']({'plain':!![]});var _0x515656=_0x8881('0x29');return db['UserProfileSection'][_0x8881('0x4c')]({'where':{'name':_0x515656,'userProfileId':_0x399614[_0x8881('0x51')]},'raw':!![]})[_0x8881('0x26')](function(_0x231d67){if(_0x231d67&&_0x231d67[_0x8881('0x52')]===0x0){return db['UserProfileResource'][_0x8881('0x4d')]({'name':_0x24b4df[_0x8881('0x2c')],'resourceId':_0x24b4df['id'],'type':_0x231d67[_0x8881('0x2c')],'sectionId':_0x231d67['id']},{})[_0x8881('0x26')](function(){return _0x4fccc7;});}else{return _0x4fccc7;}})[_0x8881('0x48')](function(_0x45d89d){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x45d89d);throw _0x45d89d;});}return _0x4fccc7;})[_0x8881('0x26')](respondWithResult(_0x3729f9,0xc9))['catch'](handleError(_0x3729f9,null));};exports['update']=function(_0x1d017b,_0x2a84d6){if(_0x1d017b[_0x8881('0x53')]['id']){delete _0x1d017b['body']['id'];}return db['Pause'][_0x8881('0x4c')]({'where':{'id':_0x1d017b[_0x8881('0x4a')]['id']}})[_0x8881('0x26')](handleEntityNotFound(_0x2a84d6,null))[_0x8881('0x26')](saveUpdates(_0x1d017b[_0x8881('0x53')],null))[_0x8881('0x26')](respondWithResult(_0x2a84d6,null))[_0x8881('0x48')](handleError(_0x2a84d6,null));};exports[_0x8881('0x27')]=function(_0x167a4a,_0x45bc4f){return db['Pause'][_0x8881('0x4c')]({'where':{'id':_0x167a4a[_0x8881('0x4a')]['id']}})[_0x8881('0x26')](handleEntityNotFound(_0x45bc4f,null))[_0x8881('0x26')](removeEntity(_0x45bc4f,null))[_0x8881('0x48')](handleError(_0x45bc4f,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 2d3e4e7..509161b 100644 --- a/server/api/pause/pause.model.js +++ b/server/api/pause/pause.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fab=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','Pause','tools_pauses','lodash','util'];(function(_0x540bad,_0x59d204){var _0x396783=function(_0x384a60){while(--_0x384a60){_0x540bad['push'](_0x540bad['shift']());}};_0x396783(++_0x59d204);}(_0x5fab,0x177));var _0xb5fa=function(_0x55dbdc,_0x2a203a){_0x55dbdc=_0x55dbdc-0x0;var _0x5d7a04=_0x5fab[_0x55dbdc];return _0x5d7a04;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var logger=require('../../config/logger')(_0xb5fa('0x2'));var moment=require(_0xb5fa('0x3'));var BPromise=require(_0xb5fa('0x4'));var rp=require(_0xb5fa('0x5'));var fs=require('fs');var path=require(_0xb5fa('0x6'));var rimraf=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var attributes=require(_0xb5fa('0x9'));module[_0xb5fa('0xa')]=function(_0x44df89,_0x4a0249){return _0x44df89['define'](_0xb5fa('0xb'),attributes,{'tableName':_0xb5fa('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Pause','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./pause.attributes'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index 60097fa..c618dd3 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x4fbc83,_0x4af5c0){var _0xe2a04a=function(_0x9f0a8b){while(--_0x9f0a8b){_0x4fbc83['push'](_0x4fbc83['shift']());}};_0xe2a04a(++_0x4af5c0);}(_0x7a54,0x106));var _0x47a5=function(_0xf31ff4,_0x149beb){_0xf31ff4=_0xf31ff4-0x0;var _0x223ec5=_0x7a54[_0xf31ff4];return _0x223ec5;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x2a1f84,_0x3d8a3d){var _0x12dbda=function(_0xbd7b4e){while(--_0xbd7b4e){_0x2a1f84['push'](_0x2a1f84['shift']());}};_0x12dbda(++_0x3d8a3d);}(_0xb10b,0x12a));var _0xbb10=function(_0x547add,_0x387042){_0x547add=_0x547add-0x0;var _0x2ed1f3=_0xb10b[_0x547add];return _0x2ed1f3;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index 6fe44b6..47efa5e 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 _0xa41a=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','isAuthenticated','index','webhookGet','get','show','/:id/download','download','diskStorage','join','root','originalname','replace','format','%s-%s%s','extname','now','post','file','upload','/webhook','webhookPost','put','/:id','update','delete','exports','multer'];(function(_0x148c09,_0x4fd39f){var _0x18e613=function(_0xfaa810){while(--_0xfaa810){_0x148c09['push'](_0x148c09['shift']());}};_0x18e613(++_0x4fd39f);}(_0xa41a,0x6b));var _0xaa41=function(_0x398a0b,_0x416762){_0x398a0b=_0x398a0b-0x0;var _0x50467e=_0xa41a[_0x398a0b];return _0x50467e;};'use strict';var multer=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var path=require('path');var timeout=require(_0xaa41('0x2'));var express=require(_0xaa41('0x3'));var router=express[_0xaa41('0x4')]();var fs_extra=require(_0xaa41('0x5'));var auth=require(_0xaa41('0x6'));var interaction=require(_0xaa41('0x7'));var config=require(_0xaa41('0x8'));var controller=require(_0xaa41('0x9'));router['get']('/',auth[_0xaa41('0xa')](),controller[_0xaa41('0xb')]);router['get']('/webhook',controller[_0xaa41('0xc')]);router[_0xaa41('0xd')]('/:id',auth[_0xaa41('0xa')](),controller[_0xaa41('0xe')]);router[_0xaa41('0xd')](_0xaa41('0xf'),auth[_0xaa41('0xa')](),controller[_0xaa41('0x10')]);var upload=multer({'storage':multer[_0xaa41('0x11')]({'destination':function(_0x423a19,_0x1c291e,_0x5c9fc7){_0x5c9fc7(null,path[_0xaa41('0x12')](config[_0xaa41('0x13')],'server/files/plugins'));},'filename':function(_0x54827c,_0x1d0a54,_0x518b5b){_0x1d0a54[_0xaa41('0x14')]=_0x1d0a54[_0xaa41('0x14')][_0xaa41('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x518b5b(null,util[_0xaa41('0x16')](_0xaa41('0x17'),path['basename'](_0x1d0a54[_0xaa41('0x14')],path[_0xaa41('0x18')](_0x1d0a54[_0xaa41('0x14')])),Date[_0xaa41('0x19')](),path[_0xaa41('0x18')](_0x1d0a54[_0xaa41('0x14')])));}})});router[_0xaa41('0x1a')]('/',upload['single'](_0xaa41('0x1b')),controller[_0xaa41('0x1c')]);router[_0xaa41('0x1a')](_0xaa41('0x1d'),controller[_0xaa41('0x1e')]);router[_0xaa41('0x1f')](_0xaa41('0x20'),auth[_0xaa41('0xa')](),controller[_0xaa41('0x21')]);router['delete']('/:id',auth[_0xaa41('0xa')](),controller[_0xaa41('0x22')]);module[_0xaa41('0x23')]=router; \ No newline at end of file +var _0x50a6=['../../components/auth/service','../../components/interaction/service','./plugin.controller','index','get','/webhook','webhookGet','/:id','show','isAuthenticated','download','root','originalname','format','%s-%s%s','basename','extname','post','single','file','put','update','delete','exports','multer','util','express','fs-extra'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x50a6,0xa4));var _0x650a=function(_0xe38e0c,_0x5884ea){_0xe38e0c=_0xe38e0c-0x0;var _0x2c6987=_0x50a6[_0xe38e0c];return _0x2c6987;};'use strict';var multer=require(_0x650a('0x0'));var util=require(_0x650a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x650a('0x2'));var router=express['Router']();var fs_extra=require(_0x650a('0x3'));var auth=require(_0x650a('0x4'));var interaction=require(_0x650a('0x5'));var config=require('../../config/environment');var controller=require(_0x650a('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x650a('0x7')]);router[_0x650a('0x8')](_0x650a('0x9'),controller[_0x650a('0xa')]);router['get'](_0x650a('0xb'),auth['isAuthenticated'](),controller[_0x650a('0xc')]);router[_0x650a('0x8')]('/:id/download',auth[_0x650a('0xd')](),controller[_0x650a('0xe')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3e2406,_0x526881,_0x142cdb){_0x142cdb(null,path['join'](config[_0x650a('0xf')],'server/files/plugins'));},'filename':function(_0x2f8bf8,_0x48077a,_0x33e73d){_0x48077a[_0x650a('0x10')]=_0x48077a[_0x650a('0x10')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x33e73d(null,util[_0x650a('0x11')](_0x650a('0x12'),path[_0x650a('0x13')](_0x48077a[_0x650a('0x10')],path[_0x650a('0x14')](_0x48077a[_0x650a('0x10')])),Date['now'](),path[_0x650a('0x14')](_0x48077a['originalname'])));}})});router[_0x650a('0x15')]('/',upload[_0x650a('0x16')](_0x650a('0x17')),controller['upload']);router['post']('/webhook',controller['webhookPost']);router[_0x650a('0x18')](_0x650a('0xb'),auth[_0x650a('0xd')](),controller[_0x650a('0x19')]);router[_0x650a('0x1a')]('/:id',auth['isAuthenticated'](),controller[_0x650a('0x1a')]);module[_0x650a('0x1b')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 3357a85..9450738 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 _0xa17d=['agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','ENUM','script','TEXT','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly'];(function(_0x96f74c,_0xfc30a4){var _0x379222=function(_0x1bbde9){while(--_0x1bbde9){_0x96f74c['push'](_0x96f74c['shift']());}};_0x379222(++_0xfc30a4);}(_0xa17d,0x10c));var _0xda17=function(_0x152aa1,_0x307718){_0x152aa1=_0x152aa1-0x0;var _0x1bc01a=_0xa17d[_0x152aa1];return _0x1bc01a;};'use strict';var Sequelize=require(_0xda17('0x0'));module[_0xda17('0x1')]={'name':{'type':Sequelize[_0xda17('0x2')]},'type':{'type':Sequelize[_0xda17('0x3')]('html',_0xda17('0x4'))},'description':{'type':Sequelize[_0xda17('0x5')]},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize[_0xda17('0x2')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xda17('0x6')},'sidebar':{'type':Sequelize[_0xda17('0x3')](_0xda17('0x7'),_0xda17('0x8'),_0xda17('0x9'),_0xda17('0xa')),'defaultValue':_0xda17('0x9'),'comment':_0xda17('0xb')},'icon':{'type':Sequelize[_0xda17('0x2')]},'adminUrl':{'type':Sequelize[_0xda17('0x2')]},'agentUrl':{'type':Sequelize[_0xda17('0x2')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0xda17('0x2')]}}; \ No newline at end of file +var _0x469f=['exports','html','script','STRING','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','ENUM','adminOnly','agentOnly','never','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize'];(function(_0x5756c6,_0x58290a){var _0x4b5806=function(_0x193246){while(--_0x193246){_0x5756c6['push'](_0x5756c6['shift']());}};_0x4b5806(++_0x58290a);}(_0x469f,0x144));var _0xf469=function(_0x42ea08,_0x45acbf){_0x42ea08=_0x42ea08-0x0;var _0x26a1f1=_0x469f[_0x42ea08];return _0x26a1f1;};'use strict';var Sequelize=require(_0xf469('0x0'));module[_0xf469('0x1')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0xf469('0x2'),_0xf469('0x3'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize[_0xf469('0x4')],'comment':_0xf469('0x5')},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xf469('0x6')},'sidebar':{'type':Sequelize[_0xf469('0x7')](_0xf469('0x8'),_0xf469('0x9'),'always',_0xf469('0xa')),'defaultValue':_0xf469('0xb'),'comment':_0xf469('0xc')},'icon':{'type':Sequelize[_0xf469('0x4')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0xf469('0x4')]},'scriptName':{'type':Sequelize[_0xf469('0x4')]},'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 7f3cd45..cc1b8b8 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 _0x1343=['includeAll','rows','catch','show','rawAttributes','download','join','root','server/files/plugins','format','zip','warning','code','ENOENT','error','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','dirname','basename','node_modules/**/*','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','0777','Invalid\x20plugin\x20structure','isFile','isDirectory','readdirSync','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','description','sidebar','always','icon','icon-apps','version','plugins','test','create','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','params','destroy','webhookGet','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','encoding','method','%s%s','headers','content-length','content-type','endsWith','webhookPost','resolve','http://localhost:','statusCode','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','extract-zip','rimraf','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','get','Plugins','then','stack','name','send','map','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','Plugin'];(function(_0x1bf348,_0x152623){var _0x5eaa79=function(_0x1a8491){while(--_0x1a8491){_0x1bf348['push'](_0x1bf348['shift']());}};_0x5eaa79(++_0x152623);}(_0x1343,0x65));var _0x3134=function(_0x64b210,_0x301877){_0x64b210=_0x64b210-0x0;var _0x232a2b=_0x1343[_0x64b210];return _0x232a2b;};'use strict';var emlformat=require(_0x3134('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3134('0x1'));var moment=require(_0x3134('0x2'));var BPromise=require(_0x3134('0x3'));var Mustache=require(_0x3134('0x4'));var util=require(_0x3134('0x5'));var path=require(_0x3134('0x6'));var sox=require(_0x3134('0x7'));var csv=require(_0x3134('0x8'));var ejs=require(_0x3134('0x9'));var fs=require('fs');var fs_extra=require(_0x3134('0xa'));var _=require(_0x3134('0xb'));var squel=require(_0x3134('0xc'));var crypto=require(_0x3134('0xd'));var jsforce=require(_0x3134('0xe'));var deskjs=require(_0x3134('0xf'));var toCsv=require(_0x3134('0x8'));var querystring=require(_0x3134('0x10'));var Papa=require('papaparse');var extract=require(_0x3134('0x11'));var rimraf=require(_0x3134('0x12'));var archiver=require(_0x3134('0x13'));var Redis=require(_0x3134('0x14'));var authService=require(_0x3134('0x15'));var qs=require(_0x3134('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3134('0x17'));var utils=require(_0x3134('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3134('0x19'))['db'];config[_0x3134('0x1a')]=_[_0x3134('0x1b')](config[_0x3134('0x1a')],{'host':_0x3134('0x1c'),'port':0x18eb});var socket=require(_0x3134('0x1d'))(new Redis(config[_0x3134('0x1a')]));require(_0x3134('0x1e'))[_0x3134('0x1f')](socket);function respondWithStatusCode(_0xc32ad0,_0x54d305){_0x54d305=_0x54d305||0xcc;return function(_0x571ccf){if(_0x571ccf){return _0xc32ad0[_0x3134('0x20')](_0x54d305);}return _0xc32ad0[_0x3134('0x21')](_0x54d305)[_0x3134('0x22')]();};}function respondWithResult(_0x4f5746,_0x27df7b){_0x27df7b=_0x27df7b||0xc8;return function(_0x4c902b){if(_0x4c902b){return _0x4f5746[_0x3134('0x21')](_0x27df7b)['json'](_0x4c902b);}};}function respondWithFilteredResult(_0x1edcec,_0x1fc72c){return function(_0xe8e1e3){if(_0xe8e1e3){var _0x2fd09a=typeof _0x1fc72c[_0x3134('0x23')]===_0x3134('0x24')&&typeof _0x1fc72c[_0x3134('0x25')]===_0x3134('0x24');var _0x4ecf94=_0xe8e1e3['count'];var _0x31a07b=_0x2fd09a?0x0:_0x1fc72c[_0x3134('0x23')];var _0x22840e=_0x2fd09a?_0xe8e1e3[_0x3134('0x26')]:_0x1fc72c[_0x3134('0x23')]+_0x1fc72c[_0x3134('0x25')];var _0x3f5e91;if(_0x22840e>=_0x4ecf94){_0x22840e=_0x4ecf94;_0x3f5e91=0xc8;}else{_0x3f5e91=0xce;}_0x1edcec['status'](_0x3f5e91);return _0x1edcec[_0x3134('0x27')](_0x3134('0x28'),_0x31a07b+'-'+_0x22840e+'/'+_0x4ecf94)[_0x3134('0x29')](_0xe8e1e3);}return null;};}function patchUpdates(_0x356dc7){return function(_0x14e871){try{jsonpatch[_0x3134('0x2a')](_0x14e871,_0x356dc7,!![]);}catch(_0x5b8228){return BPromise[_0x3134('0x2b')](_0x5b8228);}return _0x14e871[_0x3134('0x2c')]();};}function saveUpdates(_0x3f63bb,_0x2a8452){return function(_0x212a2a){if(_0x212a2a){return _0x212a2a[_0x3134('0x2d')](_0x3f63bb)['then'](function(_0x1e3e57){return _0x1e3e57;});}return null;};}function removeEntity(_0x26a1f1,_0x52c205){return function(_0x5f413b){if(_0x5f413b){return _0x5f413b['destroy']()['then'](function(){var _0xdba666=_0x5f413b[_0x3134('0x2e')]({'plain':!![]});var _0x520979=_0x3134('0x2f');return db['UserProfileResource']['destroy']({'where':{'type':_0x520979,'resourceId':_0xdba666['id']}})[_0x3134('0x30')](function(){return _0x5f413b;});})[_0x3134('0x30')](function(){_0x26a1f1[_0x3134('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x203cd9,_0x14461e){return function(_0x223ed4){if(!_0x223ed4){_0x203cd9[_0x3134('0x20')](0x194);}return _0x223ed4;};}function handleError(_0xb7787e,_0x198746){_0x198746=_0x198746||0x1f4;return function(_0x5e777c){logger['error'](_0x5e777c[_0x3134('0x31')]);if(_0x5e777c[_0x3134('0x32')]){delete _0x5e777c[_0x3134('0x32')];}_0xb7787e[_0x3134('0x21')](_0x198746)[_0x3134('0x33')](_0x5e777c);};}exports['index']=function(_0x43caef,_0x38fc3c){var _0x59f5ea={},_0x4f9953={},_0x450671={'count':0x0,'rows':[]};var _0x7c6134=_[_0x3134('0x34')](db['Plugin']['rawAttributes'],function(_0x3156ad){return{'name':_0x3156ad['fieldName'],'type':_0x3156ad[_0x3134('0x35')][_0x3134('0x36')]};});_0x4f9953['model']=_['map'](_0x7c6134,_0x3134('0x32'));_0x4f9953[_0x3134('0x37')]=_[_0x3134('0x38')](_0x43caef[_0x3134('0x37')]);_0x4f9953[_0x3134('0x39')]=_[_0x3134('0x3a')](_0x4f9953[_0x3134('0x3b')],_0x4f9953[_0x3134('0x37')]);_0x59f5ea[_0x3134('0x3c')]=_[_0x3134('0x3a')](_0x4f9953['model'],qs[_0x3134('0x3d')](_0x43caef[_0x3134('0x37')][_0x3134('0x3d')]));_0x59f5ea['attributes']=_0x59f5ea['attributes'][_0x3134('0x3e')]?_0x59f5ea['attributes']:_0x4f9953[_0x3134('0x3b')];if(!_0x43caef['query'][_0x3134('0x3f')]('nolimit')){_0x59f5ea[_0x3134('0x25')]=qs['limit'](_0x43caef['query'][_0x3134('0x25')]);_0x59f5ea[_0x3134('0x23')]=qs[_0x3134('0x23')](_0x43caef['query'][_0x3134('0x23')]);}_0x59f5ea['order']=qs[_0x3134('0x40')](_0x43caef[_0x3134('0x37')][_0x3134('0x40')]);_0x59f5ea[_0x3134('0x41')]=qs['filters'](_[_0x3134('0x42')](_0x43caef[_0x3134('0x37')],_0x4f9953[_0x3134('0x39')]),_0x7c6134);if(_0x43caef[_0x3134('0x37')][_0x3134('0x43')]){_0x59f5ea[_0x3134('0x41')]=_[_0x3134('0x44')](_0x59f5ea[_0x3134('0x41')],{'$or':_[_0x3134('0x34')](_0x7c6134,function(_0x41fecc){if(_0x41fecc[_0x3134('0x35')]!==_0x3134('0x45')){var _0x3bf783={};_0x3bf783[_0x41fecc[_0x3134('0x32')]]={'$like':'%'+_0x43caef[_0x3134('0x37')][_0x3134('0x43')]+'%'};return _0x3bf783;}})});}_0x59f5ea=_[_0x3134('0x44')]({},_0x59f5ea,_0x43caef[_0x3134('0x46')]);var _0x157c9d={'where':_0x59f5ea[_0x3134('0x41')]};return db[_0x3134('0x47')][_0x3134('0x26')](_0x157c9d)[_0x3134('0x30')](function(_0x299a17){_0x450671['count']=_0x299a17;if(_0x43caef[_0x3134('0x37')][_0x3134('0x48')]){_0x59f5ea['include']=[{'all':!![]}];}return db[_0x3134('0x47')]['findAll'](_0x59f5ea);})['then'](function(_0x43cbb6){_0x450671[_0x3134('0x49')]=_0x43cbb6;return _0x450671;})['then'](respondWithFilteredResult(_0x38fc3c,_0x59f5ea))[_0x3134('0x4a')](handleError(_0x38fc3c,null));};exports[_0x3134('0x4b')]=function(_0xfe3e12,_0x171428){var _0x3a8e03={'raw':!![],'where':{'id':_0xfe3e12['params']['id']}},_0x2eb0b7={};_0x2eb0b7[_0x3134('0x3b')]=_[_0x3134('0x38')](db[_0x3134('0x47')][_0x3134('0x4c')]);_0x2eb0b7[_0x3134('0x37')]=_[_0x3134('0x38')](_0xfe3e12[_0x3134('0x37')]);_0x2eb0b7[_0x3134('0x39')]=_[_0x3134('0x3a')](_0x2eb0b7[_0x3134('0x3b')],_0x2eb0b7[_0x3134('0x37')]);_0x3a8e03[_0x3134('0x3c')]=_[_0x3134('0x3a')](_0x2eb0b7['model'],qs[_0x3134('0x3d')](_0xfe3e12[_0x3134('0x37')][_0x3134('0x3d')]));_0x3a8e03[_0x3134('0x3c')]=_0x3a8e03[_0x3134('0x3c')][_0x3134('0x3e')]?_0x3a8e03[_0x3134('0x3c')]:_0x2eb0b7[_0x3134('0x3b')];if(_0xfe3e12['query'][_0x3134('0x48')]){_0x3a8e03['include']=[{'all':!![]}];}_0x3a8e03=_['merge']({},_0x3a8e03,_0xfe3e12['options']);return db[_0x3134('0x47')]['find'](_0x3a8e03)[_0x3134('0x30')](handleEntityNotFound(_0x171428,null))[_0x3134('0x30')](respondWithResult(_0x171428,null))[_0x3134('0x4a')](handleError(_0x171428,null));};exports[_0x3134('0x4d')]=function(_0x334325,_0x321f4f,_0x3731ba){return db[_0x3134('0x47')]['find']({'where':{'id':_0x334325['params']['id']},'attributes':[_0x3134('0x32'),_0x3134('0x6')],'raw':!![]})['then'](handleEntityNotFound(_0x321f4f,null))['then'](function(_0x24284e){if(_0x24284e){var _0x376547=path[_0x3134('0x4e')](config[_0x3134('0x4f')],_0x3134('0x50'),util[_0x3134('0x51')]('%s.zip',path['basename'](_0x24284e[_0x3134('0x6')])));var _0x3a67da=fs['createWriteStream'](_0x376547);var _0x1942d6=archiver(_0x3134('0x52'),{'zlib':{'level':0x9}});_0x1942d6['on'](_0x3134('0x53'),function(_0x4e0b94){if(_0x4e0b94[_0x3134('0x54')]===_0x3134('0x55')){logger[_0x3134('0x56')](_0x4e0b94);}else{throw new db[(_0x3134('0x57'))][(_0x3134('0x58'))](_0x3134('0x59'));}});_0x1942d6['on'](_0x3134('0x56'),function(_0x45f28b){throw new db['Sequelize'][(_0x3134('0x58'))](_0x3134('0x59'));});_0x1942d6[_0x3134('0x5a')](_0x3a67da);_0x1942d6[_0x3134('0x5b')](_0x3134('0x5c'),{'cwd':path[_0x3134('0x4e')](config[_0x3134('0x4f')],_0x3134('0x50'),path[_0x3134('0x5d')](_0x24284e[_0x3134('0x6')])),'ignore':[path['join'](path[_0x3134('0x5e')](_0x24284e['path']),_0x3134('0x5f')),path[_0x3134('0x4e')](path[_0x3134('0x5e')](_0x24284e[_0x3134('0x6')]),_0x3134('0x60'))],'nodir':!![]})[_0x3134('0x61')]();_0x3a67da['on'](_0x3134('0x62'),function(){if(!fs[_0x3134('0x63')](_0x376547)){throw new db[(_0x3134('0x57'))][(_0x3134('0x58'))](_0x3134('0x64'));}return _0x321f4f['download'](_0x376547,util['format']('%s.zip',path[_0x3134('0x5e')](_0x24284e['path'])),function(_0x407e24){if(_0x407e24){throw new db[(_0x3134('0x57'))][(_0x3134('0x58'))](_0x3134('0x65'));}fs[_0x3134('0x66')](_0x376547);logger[_0x3134('0x67')](_0x3134('0x68'));logger[_0x3134('0x67')](_0x3134('0x69'));});});}return null;})[_0x3134('0x4a')](handleError(_0x321f4f,null));};exports['upload']=function(_0xfcf10e,_0x171311,_0x1ae961){var _0x276834=path[_0x3134('0x5e')](_0xfcf10e[_0x3134('0x6a')][_0x3134('0x6b')],path[_0x3134('0x6c')](_0xfcf10e[_0x3134('0x6a')][_0x3134('0x6b')]));var _0x50f865=path[_0x3134('0x4e')](config['root'],_0x3134('0x50'),_0xfcf10e[_0x3134('0x6a')]['filename']);var _0x7088b6=path[_0x3134('0x4e')](config['root'],_0x3134('0x50'),_0x276834);logger[_0x3134('0x67')](_0x3134('0x6d'),_0x50f865);logger[_0x3134('0x67')](_0x3134('0x6e'),_0x7088b6);try{fs['chmodSync'](_0x50f865,parseInt(_0x3134('0x6f'),0x8));extract(_0x50f865,{'dir':_0x7088b6},function(_0x5660a7){if(_0x5660a7){logger[_0x3134('0x56')](_0x5660a7);handleError(_0x5660a7,!![]);};var _0x15f0ee=fs['readdirSync'](_0x7088b6);if(_0x15f0ee[_0x3134('0x3e')]>0x1){removeReferences(_0x50f865,_0x7088b6);logger[_0x3134('0x56')](_0x3134('0x70'));return _0x1ae961(new Error(_0x3134('0x70')));}var _0x2c5ec5=fs['lstatSync'](path[_0x3134('0x4e')](_0x7088b6,_0x15f0ee[0x0]));if(_0x2c5ec5[_0x3134('0x71')]()){removeReferences(_0x50f865,_0x7088b6);logger[_0x3134('0x56')](_0x3134('0x70'));return _0x1ae961(new Error(_0x3134('0x70')));}if(_0x2c5ec5[_0x3134('0x72')]()){var _0x2906d8=fs[_0x3134('0x73')](path[_0x3134('0x4e')](_0x7088b6,_0x15f0ee[0x0]));if(_0x2906d8[_0x3134('0x3e')]===0x0){removeReferences(_0x50f865,_0x7088b6);logger[_0x3134('0x56')](_0x3134('0x70'));return _0x1ae961(new Error(_0x3134('0x70')));}var _0x24e245=_0x2906d8['some'](function(_0x374625){return _0x374625===_0x3134('0x74');});if(!_0x24e245){return _0x1ae961(new Error(_0x3134('0x75')));}var _0x1acf7e=fs[_0x3134('0x76')](path['join'](_0x7088b6,_0x15f0ee[0x0],_0x3134('0x74')));var _0x3ca8ff=JSON[_0x3134('0x77')](_0x1acf7e);if(_0x3134('0x24')==typeof _0x3ca8ff[_0x3134('0x32')]){return _0x1ae961(new Error(_0x3134('0x78')));}if('undefined'==typeof _0x3ca8ff[_0x3134('0x35')]){return _0x1ae961(new Error(_0x3134('0x79')));}if(_0x3134('0x24')==typeof _0x3ca8ff['version']){return _0x1ae961(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0x3134('0x24')==typeof _0x3ca8ff[_0x3134('0x7a')]){return _0x1ae961(new Error(_0x3134('0x7b')));}if(_0x3ca8ff['type']===_0x3134('0x7c')){if(_0x3134('0x24')==typeof _0x3ca8ff[_0x3134('0x7a')][_0x3134('0x7d')]){return _0x1ae961(new Error(_0x3134('0x7e')));}if(_0x3134('0x24')==typeof _0x3ca8ff[_0x3134('0x7a')][_0x3134('0x7d')][_0x3134('0x7f')]&&_0x3134('0x24')==typeof _0x3ca8ff[_0x3134('0x7a')][_0x3134('0x7d')][_0x3134('0x80')]){return _0x1ae961(new Error(_0x3134('0x81')));}}else if(_0x3ca8ff[_0x3134('0x35')]===_0x3134('0x82')){if(_0x3134('0x24')==typeof _0x3ca8ff[_0x3134('0x7a')][_0x3134('0x83')]){return _0x1ae961(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if('undefined'==typeof _0x3ca8ff['parameters'][_0x3134('0x84')]){return _0x1ae961(new Error(_0x3134('0x85')));}}else{return _0x1ae961(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x406ff9=_0x3ca8ff[_0x3134('0x32')];var _0x41c760=_0x3ca8ff[_0x3134('0x86')];var _0x4cdeb8=_0x3ca8ff[_0x3134('0x35')];var _0x23f947=_0x3ca8ff[_0x3134('0x87')]?_0x3ca8ff['sidebar']:_0x3134('0x88');var _0x2e26ad=_0x3ca8ff['icon']?_0x3ca8ff[_0x3134('0x89')]:_0x3134('0x8a');var _0x428519='';var _0x1ab7ec='';var _0x5556ab='';var _0x103725='';var _0x414952=_0x3ca8ff[_0x3134('0x8b')];if(_0x4cdeb8===_0x3134('0x7c')){if('undefined'!=typeof _0x3ca8ff[_0x3134('0x7a')][_0x3134('0x7d')][_0x3134('0x7f')]){var _0x240083=_0x3ca8ff[_0x3134('0x7a')][_0x3134('0x7d')][_0x3134('0x7f')];if(!/^(f|ht)tps?:\/\//i['test'](_0x240083)){_0x428519=path[_0x3134('0x4e')](_0x3134('0x8c'),_0x276834,_0x15f0ee[0x0],_0x240083);}else{_0x428519=_0x240083;}}else{logger['info']('Warning:\x20admin\x20view\x20not\x20specified');}if(_0x3134('0x24')!=typeof _0x3ca8ff[_0x3134('0x7a')][_0x3134('0x7d')][_0x3134('0x80')]){var _0x293f74=_0x3ca8ff[_0x3134('0x7a')]['views'][_0x3134('0x80')];if(!/^(f|ht)tps?:\/\//i[_0x3134('0x8d')](_0x293f74)){_0x1ab7ec=path[_0x3134('0x4e')](_0x3134('0x8c'),_0x276834,_0x15f0ee[0x0],_0x293f74);}else{_0x1ab7ec=_0x293f74;}}else{logger[_0x3134('0x67')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x4cdeb8===_0x3134('0x82')){_0x5556ab=_0x3ca8ff[_0x3134('0x7a')]['scriptName'];_0x103725=_0x3ca8ff[_0x3134('0x7a')][_0x3134('0x84')];if('undefined'!=typeof _0x3ca8ff[_0x3134('0x7a')][_0x3134('0x7d')]){if('undefined'!=typeof _0x3ca8ff[_0x3134('0x7a')][_0x3134('0x7d')][_0x3134('0x7f')]){var _0x240083=_0x3ca8ff[_0x3134('0x7a')][_0x3134('0x7d')][_0x3134('0x7f')];if(!/^(f|ht)tps?:\/\//i[_0x3134('0x8d')](_0x240083)){_0x428519=path[_0x3134('0x4e')](_0x3134('0x8c'),_0x276834,_0x15f0ee[0x0],_0x240083);}else{_0x428519=_0x240083;}}if(_0x3134('0x24')!=typeof _0x3ca8ff['parameters'][_0x3134('0x7d')][_0x3134('0x80')]){var _0x293f74=_0x3ca8ff[_0x3134('0x7a')]['views'][_0x3134('0x80')];if(!/^(f|ht)tps?:\/\//i[_0x3134('0x8d')](_0x293f74)){_0x1ab7ec=path['join'](_0x3134('0x8c'),_0x276834,_0x15f0ee[0x0],_0x293f74);}else{_0x1ab7ec=_0x293f74;}}}}var _0x2a7bc4={'name':_0x406ff9,'description':_0x41c760,'path':path[_0x3134('0x4e')](_0x276834,_0x15f0ee[0x0]),'type':_0x4cdeb8,'sidebar':_0x23f947,'icon':_0x2e26ad,'adminUrl':_0x428519,'agentUrl':_0x1ab7ec,'scriptName':_0x5556ab,'scriptPath':_0x103725,'version':_0x414952};removeReferences(_0x50f865,null);return db[_0x3134('0x47')][_0x3134('0x8e')](_0x2a7bc4)[_0x3134('0x30')](function(_0x24bdff){var _0x332d83={'role':_0xfcf10e[_0x3134('0x8f')][_0x3134('0x90')],'userProfileId':_0xfcf10e['body']['userProfileId']};if(!_0x332d83)throw new Error(_0x3134('0x91'));if(_0x332d83['role']===_0x3134('0x92')){var _0x12caa2=_0x24bdff['get']({'plain':!![]});return db[_0x3134('0x93')][_0x3134('0x94')]({'where':{'name':'Plugins','userProfileId':_0x332d83[_0x3134('0x95')]},'raw':!![]})[_0x3134('0x30')](function(_0x3286bb){if(_0x3286bb&&_0x3286bb[_0x3134('0x96')]===0x0){return db[_0x3134('0x97')][_0x3134('0x8e')]({'name':_0x12caa2[_0x3134('0x32')],'resourceId':_0x12caa2['id'],'type':_0x3286bb['name'],'sectionId':_0x3286bb['id']},{})[_0x3134('0x30')](function(){return _0x24bdff;});}else{return _0x24bdff;}})['catch'](function(_0x1b7ccd){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1b7ccd);throw _0x1b7ccd;});}return _0x24bdff;})[_0x3134('0x30')](respondWithResult(_0x171311,null))['catch'](handleError(_0x171311,null));}});}catch(_0xd1e9f6){_0x171311['status'](0x1f4)[_0x3134('0x33')](_0xd1e9f6);}};function removeReferences(_0xfc8043,_0x2c0b00){try{if(_0xfc8043){fs['unlinkSync'](_0xfc8043);logger[_0x3134('0x67')](_0x3134('0x98'));}if(_0x2c0b00){rimraf(_0x2c0b00,function(){});logger[_0x3134('0x67')](_0x3134('0x99'));}}catch(_0x11979c){logger[_0x3134('0x56')](_0x11979c);}}exports[_0x3134('0x2d')]=function(_0x4d9dc2,_0x450950,_0x23bc20){return db['Plugin'][_0x3134('0x94')]({'where':{'id':_0x4d9dc2['params']['id']}})[_0x3134('0x30')](handleEntityNotFound(_0x450950,null))[_0x3134('0x30')](saveUpdates(_0x4d9dc2[_0x3134('0x8f')],null))[_0x3134('0x30')](respondWithResult(_0x450950,null))[_0x3134('0x4a')](handleError(_0x450950,null));};exports[_0x3134('0x9a')]=function(_0x41920d,_0x586ac7,_0x54108e){return db[_0x3134('0x47')][_0x3134('0x94')]({'where':{'id':_0x41920d[_0x3134('0x9b')]['id']}})[_0x3134('0x30')](function(_0x8f9e9b){if(_0x8f9e9b){return _0x8f9e9b[_0x3134('0x9c')]();}})[_0x3134('0x30')](function(_0x3a7150){rimraf(path[_0x3134('0x4e')](config[_0x3134('0x4f')],_0x3134('0x50'),path['dirname'](_0x3a7150['path'])),function(){});return _0x3a7150;})[_0x3134('0x30')](handleEntityNotFound(_0x586ac7,null))[_0x3134('0x30')](respondWithStatusCode(_0x586ac7,null))[_0x3134('0x4a')](handleError(_0x586ac7,null));};exports[_0x3134('0x9d')]=function(_0x15649c,_0x241de9,_0x4da64f){return BPromise['resolve']()[_0x3134('0x30')](function(){if(!_0x15649c['query'][_0x3134('0x6')]){throw new Error(_0x3134('0x9e'));}if(!_0x15649c[_0x3134('0x37')][_0x3134('0x9f')]){throw new Error(_0x3134('0xa0'));}var _0x131403=_0x15649c['query'][_0x3134('0xa1')]?_0x15649c[_0x3134('0x37')]['hostname']+':'+_0x15649c[_0x3134('0x37')][_0x3134('0x9f')]:'http://localhost:'+_0x15649c[_0x3134('0x37')][_0x3134('0x9f')];var _0x30d835=_0x15649c[_0x3134('0x37')][_0x3134('0x29')]?_0x15649c[_0x3134('0x37')][_0x3134('0x29')]:!![];var _0x2214b1=_0x15649c[_0x3134('0x37')][_0x3134('0xa2')]?_0x15649c[_0x3134('0x37')][_0x3134('0xa2')]:null;var _0x3c77c0={'method':_0x15649c[_0x3134('0xa3')],'uri':util[_0x3134('0x51')](_0x3134('0xa4'),_0x131403,_0x15649c['query']['path']),'json':_0x30d835,'resolveWithFullResponse':!![],'encoding':_0x2214b1,'qs':_0x15649c[_0x3134('0x37')]};if(_0x15649c[_0x3134('0xa5')]){_0x3c77c0[_0x3134('0xa5')]=_0x15649c['headers'];if(_0x3c77c0[_0x3134('0xa5')][_0x3134('0xa6')]){delete _0x3c77c0[_0x3134('0xa5')]['content-length'];}}if(_0x3c77c0[_0x3134('0xa5')][_0x3134('0xa7')]){delete _0x3c77c0[_0x3134('0xa5')][_0x3134('0xa7')];}return rp(_0x3c77c0);})['then'](function(_0x1e0bf1){if(_0x1e0bf1){_0x241de9[_0x3134('0x27')](_0x1e0bf1[_0x3134('0xa5')]);logger[_0x3134('0x67')](_0x1e0bf1[_0x3134('0x8f')]);if(_[_0x3134('0xa8')](_0x15649c[_0x3134('0x37')][_0x3134('0x6')],_0x3134('0x4d'))&&_0x1e0bf1['statusCode']==0x1f4){return _0x241de9[_0x3134('0x20')](_0x1e0bf1['statusCode']);}else{return _0x241de9[_0x3134('0x21')](_0x1e0bf1['statusCode'])[_0x3134('0x33')](_0x1e0bf1['body']);}}else{return _0x241de9['sendStatus'](0xc8);}})[_0x3134('0x4a')](handleError(_0x241de9,null));};exports[_0x3134('0xa9')]=function(_0xf85089,_0x3a00da,_0x52ccbe){return BPromise[_0x3134('0xaa')]()[_0x3134('0x30')](function(){if(!_0xf85089[_0x3134('0x37')]['path']){throw new Error(_0x3134('0x9e'));}if(!_0xf85089['query'][_0x3134('0x9f')]){throw new Error(_0x3134('0xa0'));}var _0x2102c6=_0xf85089[_0x3134('0x37')][_0x3134('0xa1')]?_0xf85089[_0x3134('0x37')][_0x3134('0xa1')]+':'+_0xf85089['query'][_0x3134('0x9f')]:_0x3134('0xab')+_0xf85089['query'][_0x3134('0x9f')];var _0xaa7e58=_0xf85089[_0x3134('0x37')]['json']?_0xf85089[_0x3134('0x37')]['json']:!![];var _0x13414b=_0xf85089[_0x3134('0x37')][_0x3134('0xa2')]?_0xf85089[_0x3134('0x37')][_0x3134('0xa2')]:null;var _0x528137={'method':_0xf85089[_0x3134('0xa3')],'uri':util[_0x3134('0x51')]('%s%s',_0x2102c6,_0xf85089['query'][_0x3134('0x6')]),'json':_0xaa7e58,'resolveWithFullResponse':!![],'encoding':_0x13414b,'body':_0xf85089['body']};if(_0xf85089['headers']){_0x528137[_0x3134('0xa5')]=_0xf85089['headers'];if(_0x528137[_0x3134('0xa5')][_0x3134('0xa6')]){delete _0x528137[_0x3134('0xa5')][_0x3134('0xa6')];}}if(_0x528137[_0x3134('0xa5')][_0x3134('0xa7')]){delete _0x528137[_0x3134('0xa5')][_0x3134('0xa7')];}return rp(_0x528137);})['then'](function(_0x452a3e){if(_0x452a3e){_0x3a00da[_0x3134('0x27')](_0x452a3e[_0x3134('0xa5')]);logger['info'](_0x452a3e[_0x3134('0x8f')]);return _0x3a00da[_0x3134('0x21')](_0x452a3e[_0x3134('0xac')])[_0x3134('0x33')](_0x452a3e[_0x3134('0x8f')]);}else{return _0x3a00da['sendStatus'](0xc8);}})[_0x3134('0x4a')](handleError(_0x3a00da,null));}; \ No newline at end of file +var _0x1e5c=['Invalid\x20manifest:\x20script\x20name\x20missing','Invalid\x20manifest:\x20invalid\x20type','sidebar','always','icon','icon-apps','test','plugins','Warning:\x20agent\x20view\x20not\x20specified','scriptName','scriptPath','role','body','userProfileId','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Extracted\x20folder\x20removed','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','port','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','statusCode','webhookPost','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','extract-zip','rimraf','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','socket.io-emitter','./plugin.socket','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','update','then','destroy','get','Plugins','UserProfileResource','error','stack','send','map','Plugin','rawAttributes','fieldName','name','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','filter','options','count','include','findAll','catch','params','find','join','root','format','%s.zip','basename','createWriteStream','zip','warning','ENOENT','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','Error','pipe','glob','server/files/plugins','node_modules/**/*','finalize','existsSync','Plugin\x20not\x20found','download','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','isFile','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','views','Invalid\x20manifest:\x20views\x20missing','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script'];(function(_0x3d2101,_0x1e805a){var _0x239e23=function(_0x584c21){while(--_0x584c21){_0x3d2101['push'](_0x3d2101['shift']());}};_0x239e23(++_0x1e805a);}(_0x1e5c,0xc6));var _0xc1e5=function(_0x2316ff,_0x5d7e7c){_0x2316ff=_0x2316ff-0x0;var _0x3a31d1=_0x1e5c[_0x2316ff];return _0x3a31d1;};'use strict';var emlformat=require(_0xc1e5('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc1e5('0x1'));var rp=require(_0xc1e5('0x2'));var moment=require(_0xc1e5('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc1e5('0x4'));var util=require(_0xc1e5('0x5'));var path=require(_0xc1e5('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc1e5('0x7'));var fs=require('fs');var fs_extra=require(_0xc1e5('0x8'));var _=require(_0xc1e5('0x9'));var squel=require(_0xc1e5('0xa'));var crypto=require(_0xc1e5('0xb'));var jsforce=require(_0xc1e5('0xc'));var deskjs=require(_0xc1e5('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc1e5('0xe'));var Papa=require('papaparse');var extract=require(_0xc1e5('0xf'));var rimraf=require(_0xc1e5('0x10'));var archiver=require(_0xc1e5('0x11'));var Redis=require(_0xc1e5('0x12'));var authService=require(_0xc1e5('0x13'));var qs=require(_0xc1e5('0x14'));var as=require(_0xc1e5('0x15'));var hardwareService=require(_0xc1e5('0x16'));var logger=require(_0xc1e5('0x17'))('api');var utils=require(_0xc1e5('0x18'));var config=require(_0xc1e5('0x19'));var licenseUtil=require(_0xc1e5('0x1a'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0xc1e5('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0xc1e5('0x1c'))(new Redis(config[_0xc1e5('0x1b')]));require(_0xc1e5('0x1d'))['register'](socket);function respondWithStatusCode(_0x1b6c20,_0x376d18){_0x376d18=_0x376d18||0xcc;return function(_0x3c0f52){if(_0x3c0f52){return _0x1b6c20[_0xc1e5('0x1e')](_0x376d18);}return _0x1b6c20[_0xc1e5('0x1f')](_0x376d18)[_0xc1e5('0x20')]();};}function respondWithResult(_0x1e342a,_0x5f0f2c){_0x5f0f2c=_0x5f0f2c||0xc8;return function(_0x4478f9){if(_0x4478f9){return _0x1e342a[_0xc1e5('0x1f')](_0x5f0f2c)[_0xc1e5('0x21')](_0x4478f9);}};}function respondWithFilteredResult(_0x54469d,_0x8d9279){return function(_0x4a1f92){if(_0x4a1f92){var _0x3662e0=typeof _0x8d9279[_0xc1e5('0x22')]===_0xc1e5('0x23')&&typeof _0x8d9279[_0xc1e5('0x24')]===_0xc1e5('0x23');var _0x39c8ef=_0x4a1f92['count'];var _0x5c2cb1=_0x3662e0?0x0:_0x8d9279['offset'];var _0xe3a8bd=_0x3662e0?_0x4a1f92['count']:_0x8d9279[_0xc1e5('0x22')]+_0x8d9279[_0xc1e5('0x24')];var _0x1b431b;if(_0xe3a8bd>=_0x39c8ef){_0xe3a8bd=_0x39c8ef;_0x1b431b=0xc8;}else{_0x1b431b=0xce;}_0x54469d['status'](_0x1b431b);return _0x54469d[_0xc1e5('0x25')](_0xc1e5('0x26'),_0x5c2cb1+'-'+_0xe3a8bd+'/'+_0x39c8ef)['json'](_0x4a1f92);}return null;};}function patchUpdates(_0x3c4ed3){return function(_0x7972a3){try{jsonpatch[_0xc1e5('0x27')](_0x7972a3,_0x3c4ed3,!![]);}catch(_0x3c9cc7){return BPromise[_0xc1e5('0x28')](_0x3c9cc7);}return _0x7972a3['save']();};}function saveUpdates(_0x3ec16b,_0x5900d3){return function(_0x1a7c44){if(_0x1a7c44){return _0x1a7c44[_0xc1e5('0x29')](_0x3ec16b)[_0xc1e5('0x2a')](function(_0x35b8c8){return _0x35b8c8;});}return null;};}function removeEntity(_0x28b829,_0x3c5660){return function(_0x6e1bc){if(_0x6e1bc){return _0x6e1bc[_0xc1e5('0x2b')]()[_0xc1e5('0x2a')](function(){var _0x20cc27=_0x6e1bc[_0xc1e5('0x2c')]({'plain':!![]});var _0x1516ce=_0xc1e5('0x2d');return db[_0xc1e5('0x2e')][_0xc1e5('0x2b')]({'where':{'type':_0x1516ce,'resourceId':_0x20cc27['id']}})['then'](function(){return _0x6e1bc;});})[_0xc1e5('0x2a')](function(){_0x28b829[_0xc1e5('0x1f')](0xcc)[_0xc1e5('0x20')]();});}};}function handleEntityNotFound(_0x46a7b7,_0x1857e3){return function(_0x1d180c){if(!_0x1d180c){_0x46a7b7['sendStatus'](0x194);}return _0x1d180c;};}function handleError(_0x309327,_0x11c192){_0x11c192=_0x11c192||0x1f4;return function(_0x12206d){logger[_0xc1e5('0x2f')](_0x12206d[_0xc1e5('0x30')]);if(_0x12206d['name']){delete _0x12206d['name'];}_0x309327[_0xc1e5('0x1f')](_0x11c192)[_0xc1e5('0x31')](_0x12206d);};}exports['index']=function(_0x5c0122,_0x3dbdef){var _0x529f08={},_0x24f5a3={},_0x3e838c={'count':0x0,'rows':[]};var _0x20f42a=_[_0xc1e5('0x32')](db[_0xc1e5('0x33')][_0xc1e5('0x34')],function(_0x396ef8){return{'name':_0x396ef8[_0xc1e5('0x35')],'type':_0x396ef8['type']['key']};});_0x24f5a3['model']=_[_0xc1e5('0x32')](_0x20f42a,_0xc1e5('0x36'));_0x24f5a3[_0xc1e5('0x37')]=_[_0xc1e5('0x38')](_0x5c0122[_0xc1e5('0x37')]);_0x24f5a3[_0xc1e5('0x39')]=_[_0xc1e5('0x3a')](_0x24f5a3[_0xc1e5('0x3b')],_0x24f5a3['query']);_0x529f08[_0xc1e5('0x3c')]=_['intersection'](_0x24f5a3[_0xc1e5('0x3b')],qs['fields'](_0x5c0122[_0xc1e5('0x37')][_0xc1e5('0x3d')]));_0x529f08[_0xc1e5('0x3c')]=_0x529f08[_0xc1e5('0x3c')][_0xc1e5('0x3e')]?_0x529f08[_0xc1e5('0x3c')]:_0x24f5a3[_0xc1e5('0x3b')];if(!_0x5c0122[_0xc1e5('0x37')][_0xc1e5('0x3f')](_0xc1e5('0x40'))){_0x529f08[_0xc1e5('0x24')]=qs[_0xc1e5('0x24')](_0x5c0122[_0xc1e5('0x37')][_0xc1e5('0x24')]);_0x529f08[_0xc1e5('0x22')]=qs[_0xc1e5('0x22')](_0x5c0122[_0xc1e5('0x37')][_0xc1e5('0x22')]);}_0x529f08[_0xc1e5('0x41')]=qs[_0xc1e5('0x42')](_0x5c0122[_0xc1e5('0x37')][_0xc1e5('0x42')]);_0x529f08[_0xc1e5('0x43')]=qs['filters'](_['pick'](_0x5c0122[_0xc1e5('0x37')],_0x24f5a3['filters']),_0x20f42a);if(_0x5c0122['query']['filter']){_0x529f08[_0xc1e5('0x43')]=_[_0xc1e5('0x44')](_0x529f08[_0xc1e5('0x43')],{'$or':_[_0xc1e5('0x32')](_0x20f42a,function(_0x177ba9){if(_0x177ba9[_0xc1e5('0x45')]!==_0xc1e5('0x46')){var _0x17c153={};_0x17c153[_0x177ba9['name']]={'$like':'%'+_0x5c0122[_0xc1e5('0x37')][_0xc1e5('0x47')]+'%'};return _0x17c153;}})});}_0x529f08=_[_0xc1e5('0x44')]({},_0x529f08,_0x5c0122[_0xc1e5('0x48')]);var _0x86381={'where':_0x529f08[_0xc1e5('0x43')]};return db[_0xc1e5('0x33')][_0xc1e5('0x49')](_0x86381)['then'](function(_0x15ab21){_0x3e838c[_0xc1e5('0x49')]=_0x15ab21;if(_0x5c0122[_0xc1e5('0x37')]['includeAll']){_0x529f08[_0xc1e5('0x4a')]=[{'all':!![]}];}return db[_0xc1e5('0x33')][_0xc1e5('0x4b')](_0x529f08);})[_0xc1e5('0x2a')](function(_0x324dfa){_0x3e838c['rows']=_0x324dfa;return _0x3e838c;})[_0xc1e5('0x2a')](respondWithFilteredResult(_0x3dbdef,_0x529f08))[_0xc1e5('0x4c')](handleError(_0x3dbdef,null));};exports['show']=function(_0x563d8c,_0x193c05){var _0x25de7d={'raw':!![],'where':{'id':_0x563d8c[_0xc1e5('0x4d')]['id']}},_0x2dc298={};_0x2dc298['model']=_[_0xc1e5('0x38')](db[_0xc1e5('0x33')]['rawAttributes']);_0x2dc298[_0xc1e5('0x37')]=_[_0xc1e5('0x38')](_0x563d8c[_0xc1e5('0x37')]);_0x2dc298[_0xc1e5('0x39')]=_[_0xc1e5('0x3a')](_0x2dc298[_0xc1e5('0x3b')],_0x2dc298[_0xc1e5('0x37')]);_0x25de7d[_0xc1e5('0x3c')]=_['intersection'](_0x2dc298[_0xc1e5('0x3b')],qs[_0xc1e5('0x3d')](_0x563d8c[_0xc1e5('0x37')][_0xc1e5('0x3d')]));_0x25de7d['attributes']=_0x25de7d['attributes'][_0xc1e5('0x3e')]?_0x25de7d[_0xc1e5('0x3c')]:_0x2dc298[_0xc1e5('0x3b')];if(_0x563d8c[_0xc1e5('0x37')]['includeAll']){_0x25de7d['include']=[{'all':!![]}];}_0x25de7d=_[_0xc1e5('0x44')]({},_0x25de7d,_0x563d8c['options']);return db[_0xc1e5('0x33')][_0xc1e5('0x4e')](_0x25de7d)[_0xc1e5('0x2a')](handleEntityNotFound(_0x193c05,null))['then'](respondWithResult(_0x193c05,null))[_0xc1e5('0x4c')](handleError(_0x193c05,null));};exports['download']=function(_0x386e00,_0x4ec349,_0x2cda53){return db['Plugin'][_0xc1e5('0x4e')]({'where':{'id':_0x386e00['params']['id']},'attributes':['name',_0xc1e5('0x6')],'raw':!![]})[_0xc1e5('0x2a')](handleEntityNotFound(_0x4ec349,null))['then'](function(_0x4eb19a){if(_0x4eb19a){var _0x30724f=path[_0xc1e5('0x4f')](config[_0xc1e5('0x50')],'server/files/plugins',util[_0xc1e5('0x51')](_0xc1e5('0x52'),path[_0xc1e5('0x53')](_0x4eb19a[_0xc1e5('0x6')])));var _0x24e919=fs[_0xc1e5('0x54')](_0x30724f);var _0x528904=archiver(_0xc1e5('0x55'),{'zlib':{'level':0x9}});_0x528904['on'](_0xc1e5('0x56'),function(_0x24205f){if(_0x24205f['code']===_0xc1e5('0x57')){logger['error'](_0x24205f);}else{throw new db[(_0xc1e5('0x58'))]['Error'](_0xc1e5('0x59'));}});_0x528904['on'](_0xc1e5('0x2f'),function(_0x5d670f){throw new db['Sequelize'][(_0xc1e5('0x5a'))](_0xc1e5('0x59'));});_0x528904[_0xc1e5('0x5b')](_0x24e919);_0x528904[_0xc1e5('0x5c')]('**/*',{'cwd':path['join'](config['root'],_0xc1e5('0x5d'),path['dirname'](_0x4eb19a[_0xc1e5('0x6')])),'ignore':[path[_0xc1e5('0x4f')](path[_0xc1e5('0x53')](_0x4eb19a[_0xc1e5('0x6')]),_0xc1e5('0x5e')),path[_0xc1e5('0x4f')](path[_0xc1e5('0x53')](_0x4eb19a['path']),'attachments/**/*')],'nodir':!![]})[_0xc1e5('0x5f')]();_0x24e919['on']('close',function(){if(!fs[_0xc1e5('0x60')](_0x30724f)){throw new db[(_0xc1e5('0x58'))]['Error'](_0xc1e5('0x61'));}return _0x4ec349[_0xc1e5('0x62')](_0x30724f,util[_0xc1e5('0x51')](_0xc1e5('0x52'),path[_0xc1e5('0x53')](_0x4eb19a['path'])),function(_0x20430a){if(_0x20430a){throw new db['Sequelize'][(_0xc1e5('0x5a'))](_0xc1e5('0x63'));}fs[_0xc1e5('0x64')](_0x30724f);logger[_0xc1e5('0x65')](_0xc1e5('0x66'));logger[_0xc1e5('0x65')](_0xc1e5('0x67'));});});}return null;})[_0xc1e5('0x4c')](handleError(_0x4ec349,null));};exports[_0xc1e5('0x68')]=function(_0x264b35,_0x26ea7e,_0x3021c8){var _0x144c74=path['basename'](_0x264b35[_0xc1e5('0x69')][_0xc1e5('0x6a')],path[_0xc1e5('0x6b')](_0x264b35[_0xc1e5('0x69')][_0xc1e5('0x6a')]));var _0x264d4d=path['join'](config[_0xc1e5('0x50')],_0xc1e5('0x5d'),_0x264b35[_0xc1e5('0x69')][_0xc1e5('0x6a')]);var _0x156606=path[_0xc1e5('0x4f')](config[_0xc1e5('0x50')],'server/files/plugins',_0x144c74);logger['info']('Plugin\x20upload\x20filepath:\x20%s',_0x264d4d);logger[_0xc1e5('0x65')](_0xc1e5('0x6c'),_0x156606);try{fs[_0xc1e5('0x6d')](_0x264d4d,parseInt(_0xc1e5('0x6e'),0x8));extract(_0x264d4d,{'dir':_0x156606},function(_0x4369fb){if(_0x4369fb){logger['error'](_0x4369fb);handleError(_0x4369fb,!![]);};var _0x1141da=fs[_0xc1e5('0x6f')](_0x156606);if(_0x1141da[_0xc1e5('0x3e')]>0x1){removeReferences(_0x264d4d,_0x156606);logger[_0xc1e5('0x2f')](_0xc1e5('0x70'));return _0x3021c8(new Error(_0xc1e5('0x70')));}var _0x2f1db4=fs['lstatSync'](path[_0xc1e5('0x4f')](_0x156606,_0x1141da[0x0]));if(_0x2f1db4[_0xc1e5('0x71')]()){removeReferences(_0x264d4d,_0x156606);logger[_0xc1e5('0x2f')]('Invalid\x20plugin\x20structure');return _0x3021c8(new Error('Invalid\x20plugin\x20structure'));}if(_0x2f1db4[_0xc1e5('0x72')]()){var _0x42f596=fs[_0xc1e5('0x6f')](path[_0xc1e5('0x4f')](_0x156606,_0x1141da[0x0]));if(_0x42f596[_0xc1e5('0x3e')]===0x0){removeReferences(_0x264d4d,_0x156606);logger[_0xc1e5('0x2f')](_0xc1e5('0x70'));return _0x3021c8(new Error(_0xc1e5('0x70')));}var _0x2ccf91=_0x42f596[_0xc1e5('0x73')](function(_0x221de4){return _0x221de4===_0xc1e5('0x74');});if(!_0x2ccf91){return _0x3021c8(new Error(_0xc1e5('0x75')));}var _0x319126=fs[_0xc1e5('0x76')](path['join'](_0x156606,_0x1141da[0x0],_0xc1e5('0x74')));var _0x201d5d=JSON[_0xc1e5('0x77')](_0x319126);if('undefined'==typeof _0x201d5d[_0xc1e5('0x36')]){return _0x3021c8(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0xc1e5('0x23')==typeof _0x201d5d[_0xc1e5('0x45')]){return _0x3021c8(new Error(_0xc1e5('0x78')));}if(_0xc1e5('0x23')==typeof _0x201d5d[_0xc1e5('0x79')]){return _0x3021c8(new Error(_0xc1e5('0x7a')));}if('undefined'==typeof _0x201d5d[_0xc1e5('0x7b')]){return _0x3021c8(new Error(_0xc1e5('0x7c')));}if(_0x201d5d[_0xc1e5('0x45')]==='html'){if('undefined'==typeof _0x201d5d[_0xc1e5('0x7b')][_0xc1e5('0x7d')]){return _0x3021c8(new Error(_0xc1e5('0x7e')));}if('undefined'==typeof _0x201d5d['parameters'][_0xc1e5('0x7d')]['admin']&&_0xc1e5('0x23')==typeof _0x201d5d[_0xc1e5('0x7b')]['views'][_0xc1e5('0x7f')]){return _0x3021c8(new Error(_0xc1e5('0x80')));}}else if(_0x201d5d[_0xc1e5('0x45')]===_0xc1e5('0x81')){if(_0xc1e5('0x23')==typeof _0x201d5d[_0xc1e5('0x7b')]['scriptName']){return _0x3021c8(new Error(_0xc1e5('0x82')));}if(_0xc1e5('0x23')==typeof _0x201d5d[_0xc1e5('0x7b')]['scriptPath']){return _0x3021c8(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x3021c8(new Error(_0xc1e5('0x83')));}var _0x4032bf=_0x201d5d[_0xc1e5('0x36')];var _0x155fda=_0x201d5d['description'];var _0x29dad5=_0x201d5d['type'];var _0x3442e2=_0x201d5d[_0xc1e5('0x84')]?_0x201d5d[_0xc1e5('0x84')]:_0xc1e5('0x85');var _0x5188d1=_0x201d5d[_0xc1e5('0x86')]?_0x201d5d[_0xc1e5('0x86')]:_0xc1e5('0x87');var _0x16fd38='';var _0x2a8934='';var _0x341f45='';var _0x24bda9='';var _0x49702b=_0x201d5d['version'];if(_0x29dad5==='html'){if(_0xc1e5('0x23')!=typeof _0x201d5d[_0xc1e5('0x7b')]['views']['admin']){var _0x12f9d4=_0x201d5d[_0xc1e5('0x7b')][_0xc1e5('0x7d')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0xc1e5('0x88')](_0x12f9d4)){_0x16fd38=path['join'](_0xc1e5('0x89'),_0x144c74,_0x1141da[0x0],_0x12f9d4);}else{_0x16fd38=_0x12f9d4;}}else{logger['info']('Warning:\x20admin\x20view\x20not\x20specified');}if(_0xc1e5('0x23')!=typeof _0x201d5d[_0xc1e5('0x7b')][_0xc1e5('0x7d')][_0xc1e5('0x7f')]){var _0x2b2ac6=_0x201d5d['parameters'][_0xc1e5('0x7d')][_0xc1e5('0x7f')];if(!/^(f|ht)tps?:\/\//i[_0xc1e5('0x88')](_0x2b2ac6)){_0x2a8934=path[_0xc1e5('0x4f')](_0xc1e5('0x89'),_0x144c74,_0x1141da[0x0],_0x2b2ac6);}else{_0x2a8934=_0x2b2ac6;}}else{logger[_0xc1e5('0x65')](_0xc1e5('0x8a'));}}else if(_0x29dad5===_0xc1e5('0x81')){_0x341f45=_0x201d5d[_0xc1e5('0x7b')][_0xc1e5('0x8b')];_0x24bda9=_0x201d5d['parameters'][_0xc1e5('0x8c')];if(_0xc1e5('0x23')!=typeof _0x201d5d[_0xc1e5('0x7b')][_0xc1e5('0x7d')]){if(_0xc1e5('0x23')!=typeof _0x201d5d['parameters']['views']['admin']){var _0x12f9d4=_0x201d5d[_0xc1e5('0x7b')][_0xc1e5('0x7d')]['admin'];if(!/^(f|ht)tps?:\/\//i['test'](_0x12f9d4)){_0x16fd38=path['join']('plugins',_0x144c74,_0x1141da[0x0],_0x12f9d4);}else{_0x16fd38=_0x12f9d4;}}if(_0xc1e5('0x23')!=typeof _0x201d5d[_0xc1e5('0x7b')][_0xc1e5('0x7d')]['agent']){var _0x2b2ac6=_0x201d5d['parameters']['views'][_0xc1e5('0x7f')];if(!/^(f|ht)tps?:\/\//i[_0xc1e5('0x88')](_0x2b2ac6)){_0x2a8934=path['join'](_0xc1e5('0x89'),_0x144c74,_0x1141da[0x0],_0x2b2ac6);}else{_0x2a8934=_0x2b2ac6;}}}}var _0x56cd82={'name':_0x4032bf,'description':_0x155fda,'path':path['join'](_0x144c74,_0x1141da[0x0]),'type':_0x29dad5,'sidebar':_0x3442e2,'icon':_0x5188d1,'adminUrl':_0x16fd38,'agentUrl':_0x2a8934,'scriptName':_0x341f45,'scriptPath':_0x24bda9,'version':_0x49702b};removeReferences(_0x264d4d,null);return db['Plugin']['create'](_0x56cd82)['then'](function(_0x352ab2){var _0x21bac8={'role':_0x264b35['body'][_0xc1e5('0x8d')],'userProfileId':_0x264b35[_0xc1e5('0x8e')][_0xc1e5('0x8f')]};if(!_0x21bac8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x21bac8[_0xc1e5('0x8d')]===_0xc1e5('0x90')){var _0x593c0a=_0x352ab2[_0xc1e5('0x2c')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0xc1e5('0x2d'),'userProfileId':_0x21bac8[_0xc1e5('0x8f')]},'raw':!![]})[_0xc1e5('0x2a')](function(_0x323ce6){if(_0x323ce6&&_0x323ce6[_0xc1e5('0x91')]===0x0){return db[_0xc1e5('0x2e')]['create']({'name':_0x593c0a[_0xc1e5('0x36')],'resourceId':_0x593c0a['id'],'type':_0x323ce6[_0xc1e5('0x36')],'sectionId':_0x323ce6['id']},{})['then'](function(){return _0x352ab2;});}else{return _0x352ab2;}})['catch'](function(_0x512fc5){logger['error'](_0xc1e5('0x92'),_0x512fc5);throw _0x512fc5;});}return _0x352ab2;})[_0xc1e5('0x2a')](respondWithResult(_0x26ea7e,null))[_0xc1e5('0x4c')](handleError(_0x26ea7e,null));}});}catch(_0x2ea2b6){_0x26ea7e['status'](0x1f4)[_0xc1e5('0x31')](_0x2ea2b6);}};function removeReferences(_0x2b0b81,_0x3fbd77){try{if(_0x2b0b81){fs[_0xc1e5('0x64')](_0x2b0b81);logger['info']('Zip\x20archive\x20removed');}if(_0x3fbd77){rimraf(_0x3fbd77,function(){});logger[_0xc1e5('0x65')](_0xc1e5('0x93'));}}catch(_0x153fdc){logger['error'](_0x153fdc);}}exports[_0xc1e5('0x29')]=function(_0x161f43,_0x494008,_0x592ccc){return db[_0xc1e5('0x33')]['find']({'where':{'id':_0x161f43[_0xc1e5('0x4d')]['id']}})[_0xc1e5('0x2a')](handleEntityNotFound(_0x494008,null))[_0xc1e5('0x2a')](saveUpdates(_0x161f43[_0xc1e5('0x8e')],null))[_0xc1e5('0x2a')](respondWithResult(_0x494008,null))[_0xc1e5('0x4c')](handleError(_0x494008,null));};exports[_0xc1e5('0x94')]=function(_0x3e07f3,_0x8e1344,_0x2c1247){return db[_0xc1e5('0x33')][_0xc1e5('0x4e')]({'where':{'id':_0x3e07f3[_0xc1e5('0x4d')]['id']}})[_0xc1e5('0x2a')](function(_0xd35c43){if(_0xd35c43){return _0xd35c43[_0xc1e5('0x2b')]();}})[_0xc1e5('0x2a')](function(_0x3080e1){rimraf(path[_0xc1e5('0x4f')](config['root'],_0xc1e5('0x5d'),path['dirname'](_0x3080e1[_0xc1e5('0x6')])),function(){});return _0x3080e1;})[_0xc1e5('0x2a')](handleEntityNotFound(_0x8e1344,null))[_0xc1e5('0x2a')](respondWithStatusCode(_0x8e1344,null))['catch'](handleError(_0x8e1344,null));};exports[_0xc1e5('0x95')]=function(_0x14a7aa,_0x100401,_0xbeadb6){return BPromise[_0xc1e5('0x96')]()['then'](function(){if(!_0x14a7aa['query'][_0xc1e5('0x6')]){throw new Error(_0xc1e5('0x97'));}if(!_0x14a7aa[_0xc1e5('0x37')]['port']){throw new Error(_0xc1e5('0x98'));}var _0x1bc5b3=_0x14a7aa[_0xc1e5('0x37')][_0xc1e5('0x99')]?_0x14a7aa['query'][_0xc1e5('0x99')]+':'+_0x14a7aa[_0xc1e5('0x37')][_0xc1e5('0x9a')]:_0xc1e5('0x9b')+_0x14a7aa[_0xc1e5('0x37')][_0xc1e5('0x9a')];var _0x2e454d=_0x14a7aa['query'][_0xc1e5('0x21')]?_0x14a7aa[_0xc1e5('0x37')][_0xc1e5('0x21')]:!![];var _0x3c5a30=_0x14a7aa[_0xc1e5('0x37')][_0xc1e5('0x9c')]?_0x14a7aa['query'][_0xc1e5('0x9c')]:null;var _0x51a728={'method':_0x14a7aa[_0xc1e5('0x9d')],'uri':util[_0xc1e5('0x51')](_0xc1e5('0x9e'),_0x1bc5b3,_0x14a7aa[_0xc1e5('0x37')][_0xc1e5('0x6')]),'json':_0x2e454d,'resolveWithFullResponse':!![],'encoding':_0x3c5a30,'qs':_0x14a7aa[_0xc1e5('0x37')]};if(_0x14a7aa[_0xc1e5('0x9f')]){_0x51a728[_0xc1e5('0x9f')]=_0x14a7aa[_0xc1e5('0x9f')];if(_0x51a728[_0xc1e5('0x9f')]['content-length']){delete _0x51a728['headers'][_0xc1e5('0xa0')];}}if(_0x51a728['headers'][_0xc1e5('0xa1')]){delete _0x51a728[_0xc1e5('0x9f')][_0xc1e5('0xa1')];}return rp(_0x51a728);})[_0xc1e5('0x2a')](function(_0x1da7de){if(_0x1da7de){_0x100401[_0xc1e5('0x25')](_0x1da7de[_0xc1e5('0x9f')]);logger[_0xc1e5('0x65')](_0x1da7de[_0xc1e5('0x8e')]);if(_['endsWith'](_0x14a7aa[_0xc1e5('0x37')][_0xc1e5('0x6')],_0xc1e5('0x62'))&&_0x1da7de[_0xc1e5('0xa2')]==0x1f4){return _0x100401['sendStatus'](_0x1da7de[_0xc1e5('0xa2')]);}else{return _0x100401[_0xc1e5('0x1f')](_0x1da7de[_0xc1e5('0xa2')])[_0xc1e5('0x31')](_0x1da7de[_0xc1e5('0x8e')]);}}else{return _0x100401['sendStatus'](0xc8);}})[_0xc1e5('0x4c')](handleError(_0x100401,null));};exports[_0xc1e5('0xa3')]=function(_0x46e8a6,_0x238adf,_0x5e83ba){return BPromise['resolve']()[_0xc1e5('0x2a')](function(){if(!_0x46e8a6[_0xc1e5('0x37')][_0xc1e5('0x6')]){throw new Error(_0xc1e5('0x97'));}if(!_0x46e8a6[_0xc1e5('0x37')][_0xc1e5('0x9a')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x515c9a=_0x46e8a6[_0xc1e5('0x37')][_0xc1e5('0x99')]?_0x46e8a6[_0xc1e5('0x37')][_0xc1e5('0x99')]+':'+_0x46e8a6[_0xc1e5('0x37')][_0xc1e5('0x9a')]:_0xc1e5('0x9b')+_0x46e8a6[_0xc1e5('0x37')]['port'];var _0x1042b9=_0x46e8a6['query'][_0xc1e5('0x21')]?_0x46e8a6[_0xc1e5('0x37')][_0xc1e5('0x21')]:!![];var _0x37822e=_0x46e8a6[_0xc1e5('0x37')]['encoding']?_0x46e8a6[_0xc1e5('0x37')][_0xc1e5('0x9c')]:null;var _0x2ed6d4={'method':_0x46e8a6[_0xc1e5('0x9d')],'uri':util['format'](_0xc1e5('0x9e'),_0x515c9a,_0x46e8a6[_0xc1e5('0x37')][_0xc1e5('0x6')]),'json':_0x1042b9,'resolveWithFullResponse':!![],'encoding':_0x37822e,'body':_0x46e8a6['body']};if(_0x46e8a6[_0xc1e5('0x9f')]){_0x2ed6d4[_0xc1e5('0x9f')]=_0x46e8a6[_0xc1e5('0x9f')];if(_0x2ed6d4[_0xc1e5('0x9f')][_0xc1e5('0xa0')]){delete _0x2ed6d4[_0xc1e5('0x9f')][_0xc1e5('0xa0')];}}if(_0x2ed6d4[_0xc1e5('0x9f')][_0xc1e5('0xa1')]){delete _0x2ed6d4[_0xc1e5('0x9f')][_0xc1e5('0xa1')];}return rp(_0x2ed6d4);})[_0xc1e5('0x2a')](function(_0x30e063){if(_0x30e063){_0x238adf[_0xc1e5('0x25')](_0x30e063['headers']);logger[_0xc1e5('0x65')](_0x30e063[_0xc1e5('0x8e')]);return _0x238adf['status'](_0x30e063[_0xc1e5('0xa2')])[_0xc1e5('0x31')](_0x30e063[_0xc1e5('0x8e')]);}else{return _0x238adf[_0xc1e5('0x1e')](0xc8);}})[_0xc1e5('0x4c')](handleError(_0x238adf,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 2af6ebd..163b719 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 _0x5a2a=['hook','events','../../mysqldb','Plugin','setMaxListeners','emit'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5a2a,0x1c3));var _0xa5a2=function(_0x255729,_0x22e541){_0x255729=_0x255729-0x0;var _0x40afd0=_0x5a2a[_0x255729];return _0x40afd0;};'use strict';var EventEmitter=require(_0xa5a2('0x0'));var Plugin=require(_0xa5a2('0x1'))['db'][_0xa5a2('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0xa5a2('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4e464d){return function(_0x2cf196,_0x479d0a,_0x14bf26){PluginEvents[_0xa5a2('0x4')](_0x4e464d+':'+_0x2cf196['id'],_0x2cf196);PluginEvents[_0xa5a2('0x4')](_0x4e464d,_0x2cf196);_0x14bf26(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin[_0xa5a2('0x5')](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file +var _0xe7de=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','Plugin'];(function(_0x99b9dd,_0x655c95){var _0x523bf3=function(_0x5d0ab4){while(--_0x5d0ab4){_0x99b9dd['push'](_0x99b9dd['shift']());}};_0x523bf3(++_0x655c95);}(_0xe7de,0x165));var _0xee7d=function(_0x4670ba,_0x47ff78){_0x4670ba=_0x4670ba-0x0;var _0x133d70=_0xe7de[_0x4670ba];return _0x133d70;};'use strict';var EventEmitter=require(_0xee7d('0x0'));var Plugin=require(_0xee7d('0x1'))['db'][_0xee7d('0x2')];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xee7d('0x3'),'afterDestroy':_0xee7d('0x4')};function emitEvent(_0x2e646b){return function(_0x3f1c6d,_0x3afa35,_0x3ce970){PluginEvents[_0xee7d('0x5')](_0x2e646b+':'+_0x3f1c6d['id'],_0x3f1c6d);PluginEvents[_0xee7d('0x5')](_0x2e646b,_0x3f1c6d);_0x3ce970(null);};}for(var e in events){if(events[_0xee7d('0x6')](e)){var event=events[e];Plugin[_0xee7d('0x7')](e,emitEvent(event));}}module[_0xee7d('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 9dab2a2..9571785 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 _0x5b9b=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Plugin','lodash','util'];(function(_0x3a0633,_0x120c59){var _0x58341e=function(_0x1ecb29){while(--_0x1ecb29){_0x3a0633['push'](_0x3a0633['shift']());}};_0x58341e(++_0x120c59);}(_0x5b9b,0x1d2));var _0xb5b9=function(_0x47efd3,_0xc9b325){_0x47efd3=_0x47efd3-0x0;var _0x5f57a7=_0x5b9b[_0x47efd3];return _0x5f57a7;};'use strict';var _=require(_0xb5b9('0x0'));var util=require(_0xb5b9('0x1'));var logger=require('../../config/logger')(_0xb5b9('0x2'));var moment=require(_0xb5b9('0x3'));var BPromise=require(_0xb5b9('0x4'));var rp=require(_0xb5b9('0x5'));var fs=require('fs');var path=require(_0xb5b9('0x6'));var rimraf=require(_0xb5b9('0x7'));var config=require(_0xb5b9('0x8'));var attributes=require('./plugin.attributes');module[_0xb5b9('0x9')]=function(_0x5973ce,_0x35ddf1){return _0x5973ce[_0xb5b9('0xa')](_0xb5b9('0xb'),attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xabf4=['Plugin','plugins','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./plugin.attributes','exports','define'];(function(_0x4b4b0e,_0x6c674){var _0x4c2d91=function(_0x4d440d){while(--_0x4d440d){_0x4b4b0e['push'](_0x4b4b0e['shift']());}};_0x4c2d91(++_0x6c674);}(_0xabf4,0x10a));var _0x4abf=function(_0x1544b3,_0x229a94){_0x1544b3=_0x1544b3-0x0;var _0x335640=_0xabf4[_0x1544b3];return _0x335640;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4abf('0x0'))(_0x4abf('0x1'));var moment=require(_0x4abf('0x2'));var BPromise=require('bluebird');var rp=require(_0x4abf('0x3'));var fs=require('fs');var path=require(_0x4abf('0x4'));var rimraf=require(_0x4abf('0x5'));var config=require(_0x4abf('0x6'));var attributes=require(_0x4abf('0x7'));module[_0x4abf('0x8')]=function(_0x54951e,_0x533f49){return _0x54951e[_0x4abf('0x9')](_0x4abf('0xa'),attributes,{'tableName':_0x4abf('0xb'),'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 7ab9ba5..999ad19 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 _0xe98c=['register','then','info','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','Plugin,\x20%s,\x20%s','message','result','CreatePlugin','Plugin','create','options','raw','util','bluebird','../../config/utils','rpc','../../config/environment','redis','localhost','socket.io-emitter','./plugin.socket'];(function(_0x5d30b4,_0x199248){var _0x1acfb8=function(_0x3544b2){while(--_0x3544b2){_0x5d30b4['push'](_0x5d30b4['shift']());}};_0x1acfb8(++_0x199248);}(_0xe98c,0x10a));var _0xce98=function(_0x3d7e29,_0x45278b){_0x3d7e29=_0x3d7e29-0x0;var _0x341000=_0xe98c[_0x3d7e29];return _0x341000;};'use strict';var _=require('lodash');var util=require(_0xce98('0x0'));var moment=require('moment');var BPromise=require(_0xce98('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xce98('0x2'));var logger=require('../../config/logger')(_0xce98('0x3'));var config=require(_0xce98('0x4'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0xce98('0x5')]=_['defaults'](config[_0xce98('0x5')],{'host':_0xce98('0x6'),'port':0x18eb});var socket=require(_0xce98('0x7'))(new Redis(config[_0xce98('0x5')]));require(_0xce98('0x8'))[_0xce98('0x9')](socket);function respondWithRpcPromise(_0x5e9f9a,_0x1349db,_0x3ac4fc){return new BPromise(function(_0x4b4ea1,_0x6913e8){return client['request'](_0x5e9f9a,_0x3ac4fc)[_0xce98('0xa')](function(_0x196a5b){logger[_0xce98('0xb')]('Plugin,\x20%s,\x20%s',_0x1349db,_0xce98('0xc'));logger[_0xce98('0xd')](_0xce98('0xe'),_0x1349db,'request\x20sent',JSON[_0xce98('0xf')](_0x196a5b));if(_0x196a5b[_0xce98('0x10')]){if(_0x196a5b[_0xce98('0x10')]['code']===0x1f4){logger[_0xce98('0x10')](_0xce98('0x11'),_0x1349db,_0x196a5b['error'][_0xce98('0x12')]);return _0x6913e8(_0x196a5b[_0xce98('0x10')][_0xce98('0x12')]);}logger[_0xce98('0x10')](_0xce98('0x11'),_0x1349db,_0x196a5b['error'][_0xce98('0x12')]);return _0x4b4ea1(_0x196a5b[_0xce98('0x10')][_0xce98('0x12')]);}else{logger['info'](_0xce98('0x11'),_0x1349db,_0xce98('0xc'));_0x4b4ea1(_0x196a5b[_0xce98('0x13')][_0xce98('0x12')]);}})['catch'](function(_0x5df9dc){logger[_0xce98('0x10')]('Plugin,\x20%s,\x20%s',_0x1349db,_0x5df9dc);_0x6913e8(_0x5df9dc);});});}exports[_0xce98('0x14')]=function(_0x5ea587){var _0x36537d=this;return new Promise(function(_0x4b99bb,_0x50503d){return db[_0xce98('0x15')][_0xce98('0x16')](_0x5ea587['body'],{'raw':_0x5ea587['options']?_0x5ea587[_0xce98('0x17')][_0xce98('0x18')]===undefined?!![]:![]:!![]})[_0xce98('0xa')](function(_0x47e718){logger['info'](_0xce98('0x14'),_0x5ea587);logger[_0xce98('0xd')]('CreatePlugin',_0x5ea587,JSON[_0xce98('0xf')](_0x47e718));_0x4b99bb(_0x47e718);})['catch'](function(_0x152965){logger[_0xce98('0x10')](_0xce98('0x14'),_0x152965[_0xce98('0x12')],_0x5ea587);_0x50503d(_0x36537d[_0xce98('0x10')](0x1f4,_0x152965[_0xce98('0x12')]));});});}; \ No newline at end of file +var _0x77f1=['raw','util','moment','bluebird','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','CreatePlugin','Plugin','create','body','options'];(function(_0x252ccb,_0x3326b6){var _0x24b6a7=function(_0x56a2f0){while(--_0x56a2f0){_0x252ccb['push'](_0x252ccb['shift']());}};_0x24b6a7(++_0x3326b6);}(_0x77f1,0x1dd));var _0x177f=function(_0x46d72a,_0x27fea9){_0x46d72a=_0x46d72a-0x0;var _0x33c9a9=_0x77f1[_0x46d72a];return _0x33c9a9;};'use strict';var _=require('lodash');var util=require(_0x177f('0x0'));var moment=require(_0x177f('0x1'));var BPromise=require(_0x177f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x177f('0x3'));var logger=require(_0x177f('0x4'))('rpc');var config=require(_0x177f('0x5'));var jayson=require(_0x177f('0x6'));var client=jayson[_0x177f('0x7')][_0x177f('0x8')]({'port':0x232a});config[_0x177f('0x9')]=_['defaults'](config[_0x177f('0x9')],{'host':_0x177f('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x177f('0x9')]));require('./plugin.socket')[_0x177f('0xb')](socket);function respondWithRpcPromise(_0x4e1bab,_0x2050c2,_0x38989d){return new BPromise(function(_0x47ccab,_0x42d6d2){return client[_0x177f('0xc')](_0x4e1bab,_0x38989d)[_0x177f('0xd')](function(_0xf5086c){logger[_0x177f('0xe')](_0x177f('0xf'),_0x2050c2,_0x177f('0x10'));logger[_0x177f('0x11')]('Plugin,\x20%s,\x20%s,\x20%s',_0x2050c2,_0x177f('0x10'),JSON[_0x177f('0x12')](_0xf5086c));if(_0xf5086c[_0x177f('0x13')]){if(_0xf5086c[_0x177f('0x13')]['code']===0x1f4){logger[_0x177f('0x13')](_0x177f('0xf'),_0x2050c2,_0xf5086c[_0x177f('0x13')]['message']);return _0x42d6d2(_0xf5086c['error'][_0x177f('0x14')]);}logger[_0x177f('0x13')](_0x177f('0xf'),_0x2050c2,_0xf5086c[_0x177f('0x13')][_0x177f('0x14')]);return _0x47ccab(_0xf5086c[_0x177f('0x13')][_0x177f('0x14')]);}else{logger[_0x177f('0xe')](_0x177f('0xf'),_0x2050c2,_0x177f('0x10'));_0x47ccab(_0xf5086c['result'][_0x177f('0x14')]);}})[_0x177f('0x15')](function(_0x4d1c1e){logger[_0x177f('0x13')](_0x177f('0xf'),_0x2050c2,_0x4d1c1e);_0x42d6d2(_0x4d1c1e);});});}exports[_0x177f('0x16')]=function(_0x3cccbf){var _0x3ff483=this;return new Promise(function(_0x4649f0,_0x40f6ed){return db[_0x177f('0x17')][_0x177f('0x18')](_0x3cccbf[_0x177f('0x19')],{'raw':_0x3cccbf['options']?_0x3cccbf[_0x177f('0x1a')][_0x177f('0x1b')]===undefined?!![]:![]:!![]})[_0x177f('0xd')](function(_0x34eeb9){logger[_0x177f('0xe')](_0x177f('0x16'),_0x3cccbf);logger[_0x177f('0x11')]('CreatePlugin',_0x3cccbf,JSON['stringify'](_0x34eeb9));_0x4649f0(_0x34eeb9);})[_0x177f('0x15')](function(_0x148c17){logger[_0x177f('0x13')](_0x177f('0x16'),_0x148c17[_0x177f('0x14')],_0x3cccbf);_0x40f6ed(_0x3ff483[_0x177f('0x13')](0x1f4,_0x148c17['message']));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 59f8b12..0f39f8e 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 _0xcd62=['register','length','plugin:','save','update','emit'];(function(_0x715113,_0x16836e){var _0x5c8acb=function(_0x15a89c){while(--_0x15a89c){_0x715113['push'](_0x715113['shift']());}};_0x5c8acb(++_0x16836e);}(_0xcd62,0xff));var _0x2cd6=function(_0x4e4d88,_0x1c5c58){_0x4e4d88=_0x4e4d88-0x0;var _0x3ec700=_0xcd62[_0x4e4d88];return _0x3ec700;};'use strict';var PluginEvents=require('./plugin.events');var events=[_0x2cd6('0x0'),'remove',_0x2cd6('0x1')];function createListener(_0x57bbe2,_0x2ffc7b){return function(_0x1349bc){_0x2ffc7b[_0x2cd6('0x2')](_0x57bbe2,_0x1349bc);};}function removeListener(_0x5b1c93,_0x2809b3){return function(){PluginEvents['removeListener'](_0x5b1c93,_0x2809b3);};}exports[_0x2cd6('0x3')]=function(_0x173271){for(var _0x49cd2e=0x0,_0x36f210=events[_0x2cd6('0x4')];_0x49cd2e<_0x36f210;_0x49cd2e++){var _0x1fe274=events[_0x49cd2e];var _0x4e1935=createListener(_0x2cd6('0x5')+_0x1fe274,_0x173271);PluginEvents['on'](_0x1fe274,_0x4e1935);}}; \ No newline at end of file +var _0x8811=['update','emit','length','plugin:','./plugin.events','save','remove'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x8811,0x100));var _0x1881=function(_0x490c48,_0x2e2cb4){_0x490c48=_0x490c48-0x0;var _0x1e002c=_0x8811[_0x490c48];return _0x1e002c;};'use strict';var PluginEvents=require(_0x1881('0x0'));var events=[_0x1881('0x1'),_0x1881('0x2'),_0x1881('0x3')];function createListener(_0x1c107a,_0x3ad00b){return function(_0x170320){_0x3ad00b[_0x1881('0x4')](_0x1c107a,_0x170320);};}function removeListener(_0x10da5a,_0x10f07f){return function(){PluginEvents['removeListener'](_0x10da5a,_0x10f07f);};}exports['register']=function(_0x5ef6fd){for(var _0x562db6=0x0,_0x42954f=events[_0x1881('0x5')];_0x562db6<_0x42954f;_0x562db6++){var _0x5f23b9=events[_0x562db6];var _0x398cb2=createListener(_0x1881('0x6')+_0x5f23b9,_0x5ef6fd);PluginEvents['on'](_0x5f23b9,_0x398cb2);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 66ef48f..f5dd8fb 100644 --- a/server/api/pm2/index.js +++ b/server/api/pm2/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['create','put','delete','destroy','exports','express','Router','../../components/auth/service','isAuthenticated','get','/:id','show','post'];(function(_0x36d001,_0xdeefa5){var _0x345e7e=function(_0x4fa0e1){while(--_0x4fa0e1){_0x36d001['push'](_0x36d001['shift']());}};_0x345e7e(++_0xdeefa5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./pm2.controller');router['get']('/',auth[_0x0a9e('0x3')](),controller['index']);router[_0x0a9e('0x4')](_0x0a9e('0x5'),auth[_0x0a9e('0x3')](),controller[_0x0a9e('0x6')]);router[_0x0a9e('0x7')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x8')]);router[_0x0a9e('0x9')](_0x0a9e('0x5'),auth['isAuthenticated'](),controller['update']);router[_0x0a9e('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);module[_0x0a9e('0xc')]=router; \ No newline at end of file +var _0xa9e0=['create','put','delete','destroy','exports','express','Router','../../components/auth/service','isAuthenticated','get','/:id','show','post'];(function(_0x2b9977,_0x5c7da3){var _0x27cd8b=function(_0x535692){while(--_0x535692){_0x2b9977['push'](_0x2b9977['shift']());}};_0x27cd8b(++_0x5c7da3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./pm2.controller');router['get']('/',auth[_0x0a9e('0x3')](),controller['index']);router[_0x0a9e('0x4')](_0x0a9e('0x5'),auth[_0x0a9e('0x3')](),controller[_0x0a9e('0x6')]);router[_0x0a9e('0x7')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x8')]);router[_0x0a9e('0x9')](_0x0a9e('0x5'),auth['isAuthenticated'](),controller['update']);router[_0x0a9e('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);module[_0x0a9e('0xc')]=router; \ No newline at end of file diff --git a/server/api/pm2/pm2.controller.js b/server/api/pm2/pm2.controller.js index 05f5deb..edb968e 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 _0xda55=['Unknown\x20id','lodash','../../config/pm2','path','child_process','exec','bluebird','status','json','error','stack','name','send','npm\x20install','info','index','list','then','express','motion2','length','show','describe','params','catch','create','body','script','../../files/plugins','cwd','chdir','start','dump','Missing\x20name\x20and/or\x20path','restart','hasOwnProperty'];(function(_0x38f811,_0x484eed){var _0x178e99=function(_0x3a9f3e){while(--_0x3a9f3e){_0x38f811['push'](_0x38f811['shift']());}};_0x178e99(++_0x484eed);}(_0xda55,0x6d));var _0x5da5=function(_0x563e99,_0x181622){_0x563e99=_0x563e99-0x0;var _0x196311=_0xda55[_0x563e99];return _0x196311;};'use strict';var _=require(_0x5da5('0x0'));var pm2=require(_0x5da5('0x1'));var logger=require('../../config/logger')('api');var path=require(_0x5da5('0x2'));var exec=require(_0x5da5('0x3'))[_0x5da5('0x4')];var BPromise=require(_0x5da5('0x5'));function handleEntityNotFound(_0x1c3afd,_0x5da254){return function(_0x3400e9){if(!_0x3400e9){_0x1c3afd['sendStatus'](0x194);;}return _0x3400e9;};}function respondWithResult(_0x356a37,_0x58e7b3){_0x58e7b3=_0x58e7b3||0xc8;return function(_0x2fd877){if(_0x2fd877){return _0x356a37[_0x5da5('0x6')](_0x58e7b3)[_0x5da5('0x7')](_0x2fd877);}return null;};}function handleError(_0x46290d,_0x3debdf){_0x3debdf=_0x3debdf||0x1f4;return function(_0x25c873){logger[_0x5da5('0x8')](_0x25c873[_0x5da5('0x9')]);if(_0x25c873['name']){delete _0x25c873[_0x5da5('0xa')];}_0x46290d[_0x5da5('0x6')](_0x3debdf)[_0x5da5('0xb')](_0x25c873);};}function execChildProcess(){return new BPromise(function(_0x26fbe3,_0x1a047e){exec(_0x5da5('0xc'),function(_0x33313e,_0x589c14,_0x2f4e4b){logger[_0x5da5('0xd')](_0x589c14);logger['info'](_0x2f4e4b);if(_0x33313e){logger[_0x5da5('0x8')](_0x33313e);return _0x1a047e(_0x33313e);}return _0x26fbe3(_0x589c14);});});}exports[_0x5da5('0xe')]=function(_0x3ced00,_0x43d526){return pm2[_0x5da5('0xf')]()[_0x5da5('0x10')](function(_0x481562){if(_0x481562){var _0x489b60=_['reject'](_0x481562,function(_0x4267cd){return _0x4267cd[_0x5da5('0xa')]===_0x5da5('0x11')||_0x4267cd[_0x5da5('0xa')]===_0x5da5('0x12');});return{'rows':_0x489b60,'count':_0x489b60[_0x5da5('0x13')]};}return null;})[_0x5da5('0x10')](respondWithResult(_0x43d526,null))['catch'](handleError(_0x43d526,null));};exports[_0x5da5('0x14')]=function(_0x290136,_0x1a4849){return pm2[_0x5da5('0x15')](_0x290136[_0x5da5('0x16')]['id'])[_0x5da5('0x10')](respondWithResult(_0x1a4849,null))['then'](handleEntityNotFound(_0x1a4849,null))[_0x5da5('0x17')](handleError(_0x1a4849,null));};exports[_0x5da5('0x18')]=function(_0x3d3d26,_0x30cde5){if(_0x3d3d26[_0x5da5('0x19')]['name']&&_0x3d3d26[_0x5da5('0x19')][_0x5da5('0x1a')]){var _0x42a3cb=path['join'](__dirname,_0x5da5('0x1b'),_0x3d3d26[_0x5da5('0x19')][_0x5da5('0x1a')]);var _0x2e68d5=process[_0x5da5('0x1c')]();process[_0x5da5('0x1d')](path['dirname'](_0x42a3cb));return execChildProcess()[_0x5da5('0x10')](function(_0x568ddf){process[_0x5da5('0x1d')](_0x2e68d5);return pm2[_0x5da5('0x1e')]({'name':_0x3d3d26[_0x5da5('0x19')]['name'],'script':_0x42a3cb});})[_0x5da5('0x10')](function(_0x236bf3){pm2[_0x5da5('0x1f')]();return _0x236bf3[0x0];})[_0x5da5('0x10')](respondWithResult(_0x30cde5,0xc9))['catch'](handleError(_0x30cde5,null));}else{return _0x30cde5['status'](0x1f4)['send']({'message':_0x5da5('0x20')});}};exports['update']=function(_0x4e8890,_0x1f75f3){if(_0x4e8890[_0x5da5('0x19')]['id']){delete _0x4e8890['body']['id'];}var _0x1798ae={'online':_0x5da5('0x21'),'stopped':'stop'};if(_0x1798ae[_0x5da5('0x22')](_0x4e8890[_0x5da5('0x19')][_0x5da5('0x6')])){return pm2[_0x1798ae[_0x4e8890[_0x5da5('0x19')][_0x5da5('0x6')]]](_0x4e8890['params']['id'])[_0x5da5('0x10')](respondWithResult(_0x1f75f3,0xc8))[_0x5da5('0x17')](handleError(_0x1f75f3,null));}else{return _0x1f75f3[_0x5da5('0x6')](0x1f4)[_0x5da5('0xb')]({'message':'Unknown\x20status'});}};exports['destroy']=function(_0x4cb022,_0x245273){if(_0x4cb022[_0x5da5('0x19')]['id']){delete _0x4cb022[_0x5da5('0x19')]['id'];}if(_0x4cb022[_0x5da5('0x16')]['id']){return pm2['delete'](_0x4cb022['params']['id'])[_0x5da5('0x10')](function(_0x4afb58){pm2['dump']();return _0x4afb58[0x0];})[_0x5da5('0x10')](respondWithResult(_0x245273,null))['catch'](handleError(_0x245273,null));}else{return _0x245273[_0x5da5('0x6')](0x1f4)[_0x5da5('0xb')]({'message':_0x5da5('0x23')});}}; \ No newline at end of file +var _0x2dae=['stack','name','send','npm\x20install','info','index','list','then','reject','express','motion2','catch','show','describe','params','body','script','join','../../files/plugins','cwd','chdir','dirname','start','dump','update','restart','stop','Unknown\x20status','destroy','delete','Unknown\x20id','lodash','../../config/logger','api','path','child_process','exec','sendStatus','status','json','error'];(function(_0x3a8db5,_0x31cff7){var _0x2c03cd=function(_0x47dba0){while(--_0x47dba0){_0x3a8db5['push'](_0x3a8db5['shift']());}};_0x2c03cd(++_0x31cff7);}(_0x2dae,0xc3));var _0xe2da=function(_0x13e300,_0x1bcb41){_0x13e300=_0x13e300-0x0;var _0x5a3eea=_0x2dae[_0x13e300];return _0x5a3eea;};'use strict';var _=require(_0xe2da('0x0'));var pm2=require('../../config/pm2');var logger=require(_0xe2da('0x1'))(_0xe2da('0x2'));var path=require(_0xe2da('0x3'));var exec=require(_0xe2da('0x4'))[_0xe2da('0x5')];var BPromise=require('bluebird');function handleEntityNotFound(_0x25b9f2,_0x439b5d){return function(_0x77e45e){if(!_0x77e45e){_0x25b9f2[_0xe2da('0x6')](0x194);;}return _0x77e45e;};}function respondWithResult(_0x523c60,_0x3e3e25){_0x3e3e25=_0x3e3e25||0xc8;return function(_0x89c70b){if(_0x89c70b){return _0x523c60[_0xe2da('0x7')](_0x3e3e25)[_0xe2da('0x8')](_0x89c70b);}return null;};}function handleError(_0x238da3,_0x1c71ea){_0x1c71ea=_0x1c71ea||0x1f4;return function(_0x29960a){logger[_0xe2da('0x9')](_0x29960a[_0xe2da('0xa')]);if(_0x29960a['name']){delete _0x29960a[_0xe2da('0xb')];}_0x238da3[_0xe2da('0x7')](_0x1c71ea)[_0xe2da('0xc')](_0x29960a);};}function execChildProcess(){return new BPromise(function(_0x17086c,_0x3c1309){exec(_0xe2da('0xd'),function(_0x1a29b9,_0x173244,_0x5aab71){logger[_0xe2da('0xe')](_0x173244);logger['info'](_0x5aab71);if(_0x1a29b9){logger[_0xe2da('0x9')](_0x1a29b9);return _0x3c1309(_0x1a29b9);}return _0x17086c(_0x173244);});});}exports[_0xe2da('0xf')]=function(_0x37064e,_0x411b9f){return pm2[_0xe2da('0x10')]()[_0xe2da('0x11')](function(_0x295a86){if(_0x295a86){var _0x48584b=_[_0xe2da('0x12')](_0x295a86,function(_0x5e1702){return _0x5e1702['name']===_0xe2da('0x13')||_0x5e1702[_0xe2da('0xb')]===_0xe2da('0x14');});return{'rows':_0x48584b,'count':_0x48584b['length']};}return null;})[_0xe2da('0x11')](respondWithResult(_0x411b9f,null))[_0xe2da('0x15')](handleError(_0x411b9f,null));};exports[_0xe2da('0x16')]=function(_0x33568f,_0x4e1623){return pm2[_0xe2da('0x17')](_0x33568f[_0xe2da('0x18')]['id'])[_0xe2da('0x11')](respondWithResult(_0x4e1623,null))[_0xe2da('0x11')](handleEntityNotFound(_0x4e1623,null))[_0xe2da('0x15')](handleError(_0x4e1623,null));};exports['create']=function(_0x56eeb1,_0x2e16b2){if(_0x56eeb1['body'][_0xe2da('0xb')]&&_0x56eeb1[_0xe2da('0x19')][_0xe2da('0x1a')]){var _0x203d36=path[_0xe2da('0x1b')](__dirname,_0xe2da('0x1c'),_0x56eeb1['body'][_0xe2da('0x1a')]);var _0x53cc4e=process[_0xe2da('0x1d')]();process[_0xe2da('0x1e')](path[_0xe2da('0x1f')](_0x203d36));return execChildProcess()[_0xe2da('0x11')](function(_0x30dea4){process[_0xe2da('0x1e')](_0x53cc4e);return pm2[_0xe2da('0x20')]({'name':_0x56eeb1[_0xe2da('0x19')]['name'],'script':_0x203d36});})[_0xe2da('0x11')](function(_0x357bff){pm2[_0xe2da('0x21')]();return _0x357bff[0x0];})[_0xe2da('0x11')](respondWithResult(_0x2e16b2,0xc9))[_0xe2da('0x15')](handleError(_0x2e16b2,null));}else{return _0x2e16b2[_0xe2da('0x7')](0x1f4)[_0xe2da('0xc')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0xe2da('0x22')]=function(_0x3e23d7,_0x1dc228){if(_0x3e23d7[_0xe2da('0x19')]['id']){delete _0x3e23d7[_0xe2da('0x19')]['id'];}var _0x2b6c9e={'online':_0xe2da('0x23'),'stopped':_0xe2da('0x24')};if(_0x2b6c9e['hasOwnProperty'](_0x3e23d7['body']['status'])){return pm2[_0x2b6c9e[_0x3e23d7[_0xe2da('0x19')][_0xe2da('0x7')]]](_0x3e23d7[_0xe2da('0x18')]['id'])[_0xe2da('0x11')](respondWithResult(_0x1dc228,0xc8))['catch'](handleError(_0x1dc228,null));}else{return _0x1dc228['status'](0x1f4)[_0xe2da('0xc')]({'message':_0xe2da('0x25')});}};exports[_0xe2da('0x26')]=function(_0x39f983,_0x7ab5ee){if(_0x39f983[_0xe2da('0x19')]['id']){delete _0x39f983[_0xe2da('0x19')]['id'];}if(_0x39f983[_0xe2da('0x18')]['id']){return pm2[_0xe2da('0x27')](_0x39f983['params']['id'])['then'](function(_0x672767){pm2[_0xe2da('0x21')]();return _0x672767[0x0];})[_0xe2da('0x11')](respondWithResult(_0x7ab5ee,null))[_0xe2da('0x15')](handleError(_0x7ab5ee,null));}else{return _0x7ab5ee[_0xe2da('0x7')](0x1f4)[_0xe2da('0xc')]({'message':_0xe2da('0x28')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index d5c5908..7d84eec 100644 --- a/server/api/realtime/index.js +++ b/server/api/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2289=['getQueues','get','isAuthenticated'];(function(_0x366a11,_0x40f927){var _0x5431ac=function(_0x4c3b87){while(--_0x4c3b87){_0x366a11['push'](_0x366a11['shift']());}};_0x5431ac(++_0x40f927);}(_0x2289,0x1f3));var _0x9228=function(_0x43ffba,_0x8b7ceb){_0x43ffba=_0x43ffba-0x0;var _0x33acd7=_0x2289[_0x43ffba];return _0x33acd7;};'use strict';var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var controller=require('./realtime.controller');router[_0x9228('0x0')]('/agents',auth[_0x9228('0x1')](),controller['getAgents']);router[_0x9228('0x0')]('/queues',auth[_0x9228('0x1')](),controller[_0x9228('0x2')]);module['exports']=router; \ No newline at end of file +var _0x0cc6=['exports','express','Router','../../components/auth/service','./realtime.controller','get','/agents','/queues','isAuthenticated','getQueues'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x0cc6,0xb5));var _0x60cc=function(_0x1a8207,_0x576621){_0x1a8207=_0x1a8207-0x0;var _0x4bc774=_0x0cc6[_0x1a8207];return _0x4bc774;};'use strict';var express=require(_0x60cc('0x0'));var router=express[_0x60cc('0x1')]();var auth=require(_0x60cc('0x2'));var controller=require(_0x60cc('0x3'));router[_0x60cc('0x4')](_0x60cc('0x5'),auth['isAuthenticated'](),controller['getAgents']);router[_0x60cc('0x4')](_0x60cc('0x6'),auth[_0x60cc('0x7')](),controller[_0x60cc('0x8')]);module[_0x60cc('0x9')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index 8bdee1a..774ae02 100644 --- a/server/api/realtime/realtime.controller.js +++ b/server/api/realtime/realtime.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5a25=['split','catch','getQueues','resolve','startCase','Queue','fieldName','name','voice','outbound','dialActive','QueueCampaigns','Queues','filter','findAndCountAll','getRealtimeQueues','lodash','util','../../components/realtime/agents','../../components/realtime/queues','../../components/parsers/qs','../../mysqldb','../../errors/api','APIBadRequestError','handleError','offset','limit','count','status','Content-Range','json','getAgents','globalQueueFilter','query','globalStatusFilter','pauseTypeFilter','pause','then','isValidChannel','channel','format','Channel\x20parameter\x20%s\x20is\x20invalid','toLowerCase','sort','globalStatus','getUpdatedSortOptions','fields','join','getAgentIdsByQueues','rows','getSortedAgentsIdsByStatus','length','map','User','rawAttributes','type','key','role','agent','online','getOptions','raw','push','literal','FIELD(id,','forEach','*pause','Pause','merge','user','userProfileId','Agents','extraQueryConditions','assign','UserProfile','getResources','find','filterAgentAttributes','getAgentStatus','includes','voiceStatus','sortAgentsByStatus'];(function(_0x4512f2,_0x44be54){var _0x4b9a13=function(_0x4a74ee){while(--_0x4a74ee){_0x4512f2['push'](_0x4512f2['shift']());}};_0x4b9a13(++_0x44be54);}(_0x5a25,0x1aa));var _0x55a2=function(_0x1c3b41,_0x50f776){_0x1c3b41=_0x1c3b41-0x0;var _0x41e3fe=_0x5a25[_0x1c3b41];return _0x41e3fe;};'use strict';var _=require(_0x55a2('0x0'));var util=require(_0x55a2('0x1'));var rta=require(_0x55a2('0x2'));var rtq=require(_0x55a2('0x3'));var qs=require(_0x55a2('0x4'));var utils=require('../../config/utils');var db=require(_0x55a2('0x5'))['db'];var APIBadRequestError=require(_0x55a2('0x6'))[_0x55a2('0x7')];var APIHandleError=require(_0x55a2('0x6'))[_0x55a2('0x8')];function respondWithFilteredResult(_0x569659,_0x5253cb){return function(_0x5cafdd){if(_0x5cafdd){var _0x2cd090=typeof _0x5253cb[_0x55a2('0x9')]==='undefined'&&typeof _0x5253cb[_0x55a2('0xa')]==='undefined';var _0x1acdd7=_0x5cafdd['count'];var _0x4b3112=_0x2cd090?0x0:_0x5253cb[_0x55a2('0x9')];var _0x27567b=_0x2cd090?_0x5cafdd[_0x55a2('0xb')]:_0x5253cb[_0x55a2('0x9')]+_0x5253cb[_0x55a2('0xa')];var _0x433762;if(_0x27567b>=_0x1acdd7){_0x27567b=_0x1acdd7;_0x433762=0xc8;}else{_0x433762=0xce;}_0x569659[_0x55a2('0xc')](_0x433762);return _0x569659['set'](_0x55a2('0xd'),_0x4b3112+'-'+_0x27567b+'/'+_0x1acdd7)[_0x55a2('0xe')](_0x5cafdd);}return null;};}exports[_0x55a2('0xf')]=function(_0x159be3,_0x1b9abc){var _0x2b644c={'count':0x0,'rows':[]};var _0x58a976={};var _0x2e2337;var _0x22b532=utils['getChannels']();var _0x35d8ef;var _0x5c0865;var _0xa91844=_0x159be3['query'][_0x55a2('0x10')];var _0x1f7423=_0x159be3[_0x55a2('0x11')][_0x55a2('0x12')];var _0x5d8799=_0x159be3[_0x55a2('0x11')][_0x55a2('0x13')];var _0x46c51f=_0x1f7423===_0x55a2('0x14')||_0x1f7423==='*pause'?!![]:![];var _0x2a5eef=[];var _0x25cc8f;var _0x459217;Promise['resolve']()[_0x55a2('0x15')](function(){if(_0x159be3[_0x55a2('0x11')]['channel']){if(!utils[_0x55a2('0x16')](_0x159be3['query'][_0x55a2('0x17')])){throw new APIBadRequestError(util[_0x55a2('0x18')](_0x55a2('0x19'),_0x159be3[_0x55a2('0x11')][_0x55a2('0x17')]));}_0x2e2337=_0x159be3[_0x55a2('0x11')][_0x55a2('0x17')][_0x55a2('0x1a')]();}if(!_0x159be3[_0x55a2('0x11')]['sort']||!_0x159be3['query'][_0x55a2('0x1b')]['includes'](_0x55a2('0x1c'))){_0x159be3[_0x55a2('0x11')][_0x55a2('0x1b')]=rta['validateSortParameter'](_0x159be3[_0x55a2('0x11')][_0x55a2('0x1b')]);return;}var _0x5ec66a=rta[_0x55a2('0x1d')](_0x159be3['query']['sort']);_0x159be3[_0x55a2('0x11')][_0x55a2('0x1b')]=_0x5ec66a[_0x55a2('0x1e')][_0x55a2('0x1f')](',');_0x25cc8f=_0x5ec66a['order'];})['then'](function(){if(!_0xa91844){return[];}return rta[_0x55a2('0x20')](_0xa91844,_0x2e2337);})[_0x55a2('0x15')](function(_0x34a376){_0x2a5eef=_0x34a376;return rta['getRealtimeAgents']();})[_0x55a2('0x15')](function(_0xcd62ea){_0x5c0865=_0xcd62ea[_0x55a2('0x21')];if((!_0x1f7423||_0x46c51f)&&!_0x25cc8f){return _0x2a5eef;}if(_0x25cc8f&&!_0x1f7423){return rta[_0x55a2('0x22')](_0x5c0865,_0x2a5eef,_0x25cc8f);}else{return rta['getAgentIdsByStatus'](_0x5c0865,_0x2a5eef,_0x1f7423);}})['then'](function(_0x42e18b){_0x2a5eef=_0x42e18b;var _0x11cb3d=![];if(_0x2a5eef[_0x55a2('0x23')]===0x0){if(_0xa91844||_0x1f7423){_0x11cb3d=!![];}if(_0x46c51f){_0x11cb3d=![];}}if(_0x11cb3d){return _0x2b644c;}var _0x53c991=_[_0x55a2('0x24')](db[_0x55a2('0x25')][_0x55a2('0x26')],function(_0x1d3397){return{'name':_0x1d3397['fieldName'],'type':_0x1d3397[_0x55a2('0x27')][_0x55a2('0x28')]};});_0x159be3[_0x55a2('0x11')][_0x55a2('0x29')]=_0x55a2('0x2a');_0x159be3[_0x55a2('0x11')][_0x55a2('0x2b')]=!![];_0x58a976=qs[_0x55a2('0x2c')](_0x53c991,_0x159be3);_0x58a976[_0x55a2('0x2d')]=!![];var _0x42f6cf=[];if(_0x2a5eef['length']>0x0){_0x42f6cf[_0x55a2('0x2e')]({'id':{'$in':_0x2a5eef}});if(_0x25cc8f&&!_0x1f7423){_0x459217=[db['sequelize'][_0x55a2('0x2f')](_0x55a2('0x30')+_0x2a5eef+')')];_0x58a976['order']=_0x459217;}}if(_0x46c51f){_0x22b532[_0x55a2('0x31')](function(_0xfd0a0a){var _0x495c7b=!![];if(_0x1f7423===_0x55a2('0x32')&&_0x2e2337!==_0xfd0a0a){_0x495c7b=![];}_0x42f6cf[_0x55a2('0x2e')]({[_0xfd0a0a+_0x55a2('0x33')]:_0x495c7b});});if(_0x5d8799){_0x42f6cf[_0x55a2('0x2e')]({'pauseType':_0x5d8799});}}else if(_0x1f7423){_0x22b532[_0x55a2('0x31')](function(_0x5169fa){_0x42f6cf[_0x55a2('0x2e')]({[_0x5169fa+_0x55a2('0x33')]:![]});});}_0x58a976['where']=_[_0x55a2('0x34')](_0x58a976['where'],{'$and':_0x42f6cf});if(_0x159be3[_0x55a2('0x35')][_0x55a2('0x29')]===_0x55a2('0x35')){var _0x24b2ff={'params':{'id':_0x159be3[_0x55a2('0x35')][_0x55a2('0x36')]},'query':{'section':_0x55a2('0x37'),'role':'agent','online':!![],'raw':!![],'ids':_0x2a5eef,'customSorting':_0x459217}};if(_0x46c51f){_0x24b2ff['query'][_0x55a2('0x38')]=_0x42f6cf;}_0x24b2ff[_0x55a2('0x11')]=Object[_0x55a2('0x39')](_0x24b2ff['query'],_0x159be3[_0x55a2('0x11')]);delete _0x24b2ff['query']['id'];return db[_0x55a2('0x3a')][_0x55a2('0x3b')](_0x24b2ff);}return db[_0x55a2('0x25')]['findAndCountAll'](_0x58a976);})[_0x55a2('0x15')](function(_0xec0123){_0x2b644c['count']=_0xec0123[_0x55a2('0xb')];_0x35d8ef=_0xec0123[_0x55a2('0x21')];return _0x35d8ef[_0x55a2('0x24')](function(_0x490558){var _0x84051a=_[_0x55a2('0x3c')](_0x5c0865,['id',_0x490558['id']]);if(_0x84051a){var _0x4c38da=rta[_0x55a2('0x3d')](_0x84051a);_['merge'](_0x490558,_0x4c38da);}_0x490558['globalStatus']=rta[_0x55a2('0x3e')](_0x490558);if(_0x490558[_0x55a2('0x1c')][_0x55a2('0x3f')]('pause')){_0x22b532[_0x55a2('0x31')](function(_0x447042){if(_0x490558[_0x447042+_0x55a2('0x33')]){if(_0x447042==='voice'){if(_0x490558[_0x55a2('0x40')]!=='talking'){_0x490558[_0x55a2('0x40')]='pause';}}else{_0x490558[_0x447042+'Status']=_0x55a2('0x14');}}});}return _0x490558;});})[_0x55a2('0x15')](function(_0x2117b4){if(!_0x25cc8f||_0x459217){return _0x2117b4;}return rta[_0x55a2('0x41')](_0x2117b4,_0x25cc8f);})[_0x55a2('0x15')](function(_0x212e41){var _0xf86bd0=null;if(_0x159be3[_0x55a2('0x11')][_0x55a2('0x1e')]){var _0x1c0f04=_0x159be3[_0x55a2('0x11')][_0x55a2('0x1e')][_0x55a2('0x42')](',');_0xf86bd0=_0x212e41['map'](function(_0x515727){return _['pick'](_0x515727,_0x1c0f04);});}_0x2b644c[_0x55a2('0x21')]=_0xf86bd0||_0x212e41;return _0x2b644c;})[_0x55a2('0x15')](respondWithFilteredResult(_0x1b9abc,_0x58a976))[_0x55a2('0x43')](APIHandleError(_0x1b9abc));};exports[_0x55a2('0x44')]=function(_0xaf1c18,_0x401f47){var _0x1a3b58={'count':0x0,'rows':[]};var _0x105de4={};var _0x1644aa;var _0x14d600;var _0x2af861;Promise[_0x55a2('0x45')]()['then'](function(){if(_0xaf1c18[_0x55a2('0x11')][_0x55a2('0x17')]){if(!utils['isValidChannel'](_0xaf1c18[_0x55a2('0x11')][_0x55a2('0x17')])){throw new APIBadRequestError(util[_0x55a2('0x18')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0xaf1c18['query'][_0x55a2('0x17')]));}_0x1644aa=_0xaf1c18['query'][_0x55a2('0x17')][_0x55a2('0x1a')]();}var _0x41181d=_[_0x55a2('0x46')](_0x1644aa)+_0x55a2('0x47');var _0x561725=_[_0x55a2('0x24')](db[_0x41181d][_0x55a2('0x26')],function(_0x18b1f0){return{'name':_0x18b1f0[_0x55a2('0x48')],'type':_0x18b1f0[_0x55a2('0x27')][_0x55a2('0x28')]};});if(!_0xaf1c18['query'][_0x55a2('0x1e')]){var _0x40dd67=['id',_0x55a2('0x49')];if(_0x1644aa===_0x55a2('0x4a')){_0x40dd67['push'](_0x55a2('0x27'));if(_0xaf1c18[_0x55a2('0x11')][_0x55a2('0x27')]===_0x55a2('0x4b')){_0x40dd67[_0x55a2('0x2e')]([_0x55a2('0x4c'),'dialMethod']);}}_0xaf1c18[_0x55a2('0x11')][_0x55a2('0x1e')]=_0x40dd67['join'](',');}_0x105de4=qs[_0x55a2('0x2c')](_0x561725,_0xaf1c18);if(_0xaf1c18[_0x55a2('0x35')][_0x55a2('0x29')]===_0x55a2('0x35')){var _0x4ed520={'params':{'id':_0xaf1c18['user'][_0x55a2('0x36')]},'query':{'section':_0x1644aa===_0x55a2('0x4a')&&_0xaf1c18['query'][_0x55a2('0x27')]==='outbound'?_0x55a2('0x4d'):_[_0x55a2('0x46')](_0x1644aa)+_0x55a2('0x4e'),'type':_0xaf1c18[_0x55a2('0x11')][_0x55a2('0x27')],'nolimit':!![],'sort':_0x55a2('0x49'),'filter':_0xaf1c18[_0x55a2('0x11')][_0x55a2('0x4f')]}};_0x4ed520[_0x55a2('0x11')]=Object[_0x55a2('0x39')](_0x4ed520[_0x55a2('0x11')],_0xaf1c18[_0x55a2('0x11')]);delete _0x4ed520[_0x55a2('0x11')]['id'];return db[_0x55a2('0x3a')]['getResources'](_0x4ed520);}return db[_0x41181d][_0x55a2('0x50')](_0x105de4);})['then'](function(_0x1d416b){_0x1a3b58['count']=_0x1d416b[_0x55a2('0xb')];_0x14d600=_0x1d416b[_0x55a2('0x21')];return rtq[_0x55a2('0x51')](_0xaf1c18,_0x1644aa);})['then'](function(_0x58d121){_0x2af861=_0x58d121[_0x55a2('0x21')];return rtq['initializeQueues'](_0x14d600,_0x2af861,_0x1644aa,_0xaf1c18[_0x55a2('0x11')][_0x55a2('0x27')]);})[_0x55a2('0x15')](function(_0x33cb61){_0x1a3b58[_0x55a2('0x21')]=_0x33cb61;return _0x1a3b58;})[_0x55a2('0x15')](respondWithFilteredResult(_0x401f47,_0x105de4))[_0x55a2('0x43')](APIHandleError(_0x401f47));}; \ No newline at end of file +var _0x434b=['length','map','User','rawAttributes','fieldName','key','role','agent','online','getOptions','raw','push','sequelize','FIELD(id,','order','Pause','forEach','where','merge','user','userProfileId','Agents','extraQueryConditions','assign','UserProfile','getResources','findAndCountAll','find','filterAgentAttributes','globalStatus','voice','talking','voiceStatus','Status','sortAgentsByStatus','split','pick','catch','getQueues','resolve','Channel\x20parameter\x20%s\x20is\x20invalid','Queue','type','outbound','dialActive','dialMethod','QueueCampaigns','Queues','filter','getRealtimeQueues','lodash','util','../../components/realtime/queues','../../components/parsers/qs','../../errors/api','APIBadRequestError','handleError','offset','limit','undefined','count','set','Content-Range','json','getAgents','globalStatusFilter','pauseTypeFilter','pause','*pause','then','query','isValidChannel','format','channel','sort','getUpdatedSortOptions','fields','join','rows','getSortedAgentsIdsByStatus','getAgentIdsByStatus'];(function(_0x1c58d6,_0x41f27d){var _0x55461b=function(_0x203262){while(--_0x203262){_0x1c58d6['push'](_0x1c58d6['shift']());}};_0x55461b(++_0x41f27d);}(_0x434b,0xd4));var _0xb434=function(_0x2f48cd,_0x46a75a){_0x2f48cd=_0x2f48cd-0x0;var _0x193ae2=_0x434b[_0x2f48cd];return _0x193ae2;};'use strict';var _=require(_0xb434('0x0'));var util=require(_0xb434('0x1'));var rta=require('../../components/realtime/agents');var rtq=require(_0xb434('0x2'));var qs=require(_0xb434('0x3'));var utils=require('../../config/utils');var db=require('../../mysqldb')['db'];var APIBadRequestError=require(_0xb434('0x4'))[_0xb434('0x5')];var APIHandleError=require(_0xb434('0x4'))[_0xb434('0x6')];function respondWithFilteredResult(_0x4472d4,_0x214d7c){return function(_0x2103ee){if(_0x2103ee){var _0x4a5211=typeof _0x214d7c[_0xb434('0x7')]==='undefined'&&typeof _0x214d7c[_0xb434('0x8')]===_0xb434('0x9');var _0x196ae1=_0x2103ee[_0xb434('0xa')];var _0xa6fc52=_0x4a5211?0x0:_0x214d7c[_0xb434('0x7')];var _0x50adbc=_0x4a5211?_0x2103ee[_0xb434('0xa')]:_0x214d7c[_0xb434('0x7')]+_0x214d7c[_0xb434('0x8')];var _0x5f5948;if(_0x50adbc>=_0x196ae1){_0x50adbc=_0x196ae1;_0x5f5948=0xc8;}else{_0x5f5948=0xce;}_0x4472d4['status'](_0x5f5948);return _0x4472d4[_0xb434('0xb')](_0xb434('0xc'),_0xa6fc52+'-'+_0x50adbc+'/'+_0x196ae1)[_0xb434('0xd')](_0x2103ee);}return null;};}exports[_0xb434('0xe')]=function(_0x18add8,_0x19888e){var _0x5a1930={'count':0x0,'rows':[]};var _0x3cbe31={};var _0x1aece9;var _0x1d1954=utils['getChannels']();var _0x230f9a;var _0x3062bd;var _0x328ea0=_0x18add8['query']['globalQueueFilter'];var _0x35827e=_0x18add8['query'][_0xb434('0xf')];var _0x532dc0=_0x18add8['query'][_0xb434('0x10')];var _0xf6b834=_0x35827e===_0xb434('0x11')||_0x35827e===_0xb434('0x12')?!![]:![];var _0x2fc4c1=[];var _0x192d38;var _0x4627ef;Promise['resolve']()[_0xb434('0x13')](function(){if(_0x18add8[_0xb434('0x14')]['channel']){if(!utils[_0xb434('0x15')](_0x18add8[_0xb434('0x14')]['channel'])){throw new APIBadRequestError(util[_0xb434('0x16')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0x18add8['query'][_0xb434('0x17')]));}_0x1aece9=_0x18add8[_0xb434('0x14')][_0xb434('0x17')]['toLowerCase']();}if(!_0x18add8[_0xb434('0x14')][_0xb434('0x18')]||!_0x18add8[_0xb434('0x14')][_0xb434('0x18')]['includes']('globalStatus')){_0x18add8[_0xb434('0x14')][_0xb434('0x18')]=rta['validateSortParameter'](_0x18add8[_0xb434('0x14')][_0xb434('0x18')]);return;}var _0x1112fe=rta[_0xb434('0x19')](_0x18add8['query'][_0xb434('0x18')]);_0x18add8[_0xb434('0x14')][_0xb434('0x18')]=_0x1112fe[_0xb434('0x1a')][_0xb434('0x1b')](',');_0x192d38=_0x1112fe['order'];})[_0xb434('0x13')](function(){if(!_0x328ea0){return[];}return rta['getAgentIdsByQueues'](_0x328ea0,_0x1aece9);})[_0xb434('0x13')](function(_0x30712b){_0x2fc4c1=_0x30712b;return rta['getRealtimeAgents']();})[_0xb434('0x13')](function(_0x434f0d){_0x3062bd=_0x434f0d[_0xb434('0x1c')];if((!_0x35827e||_0xf6b834)&&!_0x192d38){return _0x2fc4c1;}if(_0x192d38&&!_0x35827e){return rta[_0xb434('0x1d')](_0x3062bd,_0x2fc4c1,_0x192d38);}else{return rta[_0xb434('0x1e')](_0x3062bd,_0x2fc4c1,_0x35827e);}})['then'](function(_0x5046e8){_0x2fc4c1=_0x5046e8;var _0x3cb218=![];if(_0x2fc4c1[_0xb434('0x1f')]===0x0){if(_0x328ea0||_0x35827e){_0x3cb218=!![];}if(_0xf6b834){_0x3cb218=![];}}if(_0x3cb218){return _0x5a1930;}var _0x4fde4b=_[_0xb434('0x20')](db[_0xb434('0x21')][_0xb434('0x22')],function(_0xd8b7c6){return{'name':_0xd8b7c6[_0xb434('0x23')],'type':_0xd8b7c6['type'][_0xb434('0x24')]};});_0x18add8['query'][_0xb434('0x25')]=_0xb434('0x26');_0x18add8[_0xb434('0x14')][_0xb434('0x27')]=!![];_0x3cbe31=qs[_0xb434('0x28')](_0x4fde4b,_0x18add8);_0x3cbe31[_0xb434('0x29')]=!![];var _0x23b7d0=[];if(_0x2fc4c1[_0xb434('0x1f')]>0x0){_0x23b7d0[_0xb434('0x2a')]({'id':{'$in':_0x2fc4c1}});if(_0x192d38&&!_0x35827e){_0x4627ef=[db[_0xb434('0x2b')]['literal'](_0xb434('0x2c')+_0x2fc4c1+')')];_0x3cbe31[_0xb434('0x2d')]=_0x4627ef;}}if(_0xf6b834){_0x1d1954['forEach'](function(_0x533976){var _0x516de3=!![];if(_0x35827e===_0xb434('0x12')&&_0x1aece9!==_0x533976){_0x516de3=![];}_0x23b7d0[_0xb434('0x2a')]({[_0x533976+_0xb434('0x2e')]:_0x516de3});});if(_0x532dc0){_0x23b7d0[_0xb434('0x2a')]({'pauseType':_0x532dc0});}}else if(_0x35827e){_0x1d1954[_0xb434('0x2f')](function(_0x26886c){_0x23b7d0['push']({[_0x26886c+_0xb434('0x2e')]:![]});});}_0x3cbe31[_0xb434('0x30')]=_[_0xb434('0x31')](_0x3cbe31['where'],{'$and':_0x23b7d0});if(_0x18add8[_0xb434('0x32')]['role']==='user'){var _0x3c8efb={'params':{'id':_0x18add8['user'][_0xb434('0x33')]},'query':{'section':_0xb434('0x34'),'role':_0xb434('0x26'),'online':!![],'raw':!![],'ids':_0x2fc4c1,'customSorting':_0x4627ef}};if(_0xf6b834){_0x3c8efb['query'][_0xb434('0x35')]=_0x23b7d0;}_0x3c8efb[_0xb434('0x14')]=Object[_0xb434('0x36')](_0x3c8efb[_0xb434('0x14')],_0x18add8[_0xb434('0x14')]);delete _0x3c8efb[_0xb434('0x14')]['id'];return db[_0xb434('0x37')][_0xb434('0x38')](_0x3c8efb);}return db[_0xb434('0x21')][_0xb434('0x39')](_0x3cbe31);})[_0xb434('0x13')](function(_0x2cbb6a){_0x5a1930[_0xb434('0xa')]=_0x2cbb6a[_0xb434('0xa')];_0x230f9a=_0x2cbb6a[_0xb434('0x1c')];return _0x230f9a[_0xb434('0x20')](function(_0x3c02f5){var _0xa753dd=_[_0xb434('0x3a')](_0x3062bd,['id',_0x3c02f5['id']]);if(_0xa753dd){var _0x28ed6a=rta[_0xb434('0x3b')](_0xa753dd);_[_0xb434('0x31')](_0x3c02f5,_0x28ed6a);}_0x3c02f5[_0xb434('0x3c')]=rta['getAgentStatus'](_0x3c02f5);if(_0x3c02f5[_0xb434('0x3c')]['includes']('pause')){_0x1d1954[_0xb434('0x2f')](function(_0x43c901){if(_0x3c02f5[_0x43c901+_0xb434('0x2e')]){if(_0x43c901===_0xb434('0x3d')){if(_0x3c02f5['voiceStatus']!==_0xb434('0x3e')){_0x3c02f5[_0xb434('0x3f')]='pause';}}else{_0x3c02f5[_0x43c901+_0xb434('0x40')]=_0xb434('0x11');}}});}return _0x3c02f5;});})[_0xb434('0x13')](function(_0x34262e){if(!_0x192d38||_0x4627ef){return _0x34262e;}return rta[_0xb434('0x41')](_0x34262e,_0x192d38);})[_0xb434('0x13')](function(_0x4eb169){var _0x48f840=null;if(_0x18add8['query'][_0xb434('0x1a')]){var _0x3edd8f=_0x18add8[_0xb434('0x14')]['fields'][_0xb434('0x42')](',');_0x48f840=_0x4eb169[_0xb434('0x20')](function(_0x4fbd63){return _[_0xb434('0x43')](_0x4fbd63,_0x3edd8f);});}_0x5a1930[_0xb434('0x1c')]=_0x48f840||_0x4eb169;return _0x5a1930;})[_0xb434('0x13')](respondWithFilteredResult(_0x19888e,_0x3cbe31))[_0xb434('0x44')](APIHandleError(_0x19888e));};exports[_0xb434('0x45')]=function(_0x201943,_0x493ddd){var _0x3324fd={'count':0x0,'rows':[]};var _0xb83fa5={};var _0x26c15c;var _0xc44a51;var _0x5074fd;Promise[_0xb434('0x46')]()[_0xb434('0x13')](function(){if(_0x201943[_0xb434('0x14')][_0xb434('0x17')]){if(!utils[_0xb434('0x15')](_0x201943[_0xb434('0x14')]['channel'])){throw new APIBadRequestError(util[_0xb434('0x16')](_0xb434('0x47'),_0x201943[_0xb434('0x14')][_0xb434('0x17')]));}_0x26c15c=_0x201943[_0xb434('0x14')][_0xb434('0x17')]['toLowerCase']();}var _0x56b8bf=_['startCase'](_0x26c15c)+_0xb434('0x48');var _0x390f0c=_['map'](db[_0x56b8bf][_0xb434('0x22')],function(_0x42e100){return{'name':_0x42e100[_0xb434('0x23')],'type':_0x42e100[_0xb434('0x49')][_0xb434('0x24')]};});if(!_0x201943[_0xb434('0x14')][_0xb434('0x1a')]){var _0xb0129c=['id','name'];if(_0x26c15c===_0xb434('0x3d')){_0xb0129c[_0xb434('0x2a')](_0xb434('0x49'));if(_0x201943[_0xb434('0x14')][_0xb434('0x49')]===_0xb434('0x4a')){_0xb0129c['push']([_0xb434('0x4b'),_0xb434('0x4c')]);}}_0x201943[_0xb434('0x14')][_0xb434('0x1a')]=_0xb0129c[_0xb434('0x1b')](',');}_0xb83fa5=qs['getOptions'](_0x390f0c,_0x201943);if(_0x201943[_0xb434('0x32')][_0xb434('0x25')]===_0xb434('0x32')){var _0x3f75b8={'params':{'id':_0x201943[_0xb434('0x32')]['userProfileId']},'query':{'section':_0x26c15c===_0xb434('0x3d')&&_0x201943[_0xb434('0x14')][_0xb434('0x49')]===_0xb434('0x4a')?_0xb434('0x4d'):_['startCase'](_0x26c15c)+_0xb434('0x4e'),'type':_0x201943[_0xb434('0x14')]['type'],'nolimit':!![],'sort':'name','filter':_0x201943[_0xb434('0x14')][_0xb434('0x4f')]}};_0x3f75b8[_0xb434('0x14')]=Object['assign'](_0x3f75b8[_0xb434('0x14')],_0x201943[_0xb434('0x14')]);delete _0x3f75b8['query']['id'];return db['UserProfile'][_0xb434('0x38')](_0x3f75b8);}return db[_0x56b8bf][_0xb434('0x39')](_0xb83fa5);})[_0xb434('0x13')](function(_0x834bb0){_0x3324fd['count']=_0x834bb0['count'];_0xc44a51=_0x834bb0['rows'];return rtq[_0xb434('0x50')](_0x201943,_0x26c15c);})['then'](function(_0x373ae2){_0x5074fd=_0x373ae2['rows'];return rtq['initializeQueues'](_0xc44a51,_0x5074fd,_0x26c15c,_0x201943[_0xb434('0x14')][_0xb434('0x49')]);})['then'](function(_0x5c8711){_0x3324fd['rows']=_0x5c8711;return _0x3324fd;})[_0xb434('0x13')](respondWithFilteredResult(_0x493ddd,_0xb83fa5))['catch'](APIHandleError(_0x493ddd));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index f308707..9e676d0 100644 --- a/server/api/reportAgentPreview/index.js +++ b/server/api/reportAgentPreview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x330414,_0x4f3207){var _0x99dbff=function(_0x166f85){while(--_0x166f85){_0x330414['push'](_0x330414['shift']());}};_0x99dbff(++_0x4f3207);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x4f4693,_0x149780){var _0x2ca019=function(_0x2ee95a){while(--_0x2ee95a){_0x4f4693['push'](_0x4f4693['shift']());}};_0x2ca019(++_0x149780);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index c1cbd76..34f0971 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 _0x6657=['INTEGER','STRING','DATE','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6657,0x17f));var _0x7665=function(_0x46517c,_0x4ec174){_0x46517c=_0x46517c-0x0;var _0x2dc6ee=_0x6657[_0x46517c];return _0x2dc6ee;};'use strict';var Sequelize=require(_0x7665('0x0'));module['exports']={'state':{'type':Sequelize[_0x7665('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x7665('0x2')]},'scheduledat':{'type':Sequelize[_0x7665('0x3')]},'uniqueid':{'type':Sequelize[_0x7665('0x2')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x7665('0x3')]},'ringtime':{'type':Sequelize[_0x7665('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x7665('0x2')]},'campaigntype':{'type':Sequelize[_0x7665('0x2')]},'membername':{'type':Sequelize[_0x7665('0x2')]}}; \ No newline at end of file +var _0x9ade=['STRING','DATE','sequelize','exports','INTEGER'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x9ade,0x8e));var _0xe9ad=function(_0x2aa0e7,_0x4e5145){_0x2aa0e7=_0x2aa0e7-0x0;var _0x1472c0=_0x9ade[_0x2aa0e7];return _0x1472c0;};'use strict';var Sequelize=require(_0xe9ad('0x0'));module[_0xe9ad('0x1')]={'state':{'type':Sequelize[_0xe9ad('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xe9ad('0x3')]},'scheduledat':{'type':Sequelize[_0xe9ad('0x4')]},'uniqueid':{'type':Sequelize[_0xe9ad('0x3')]},'starttime':{'type':Sequelize[_0xe9ad('0x4')]},'responsetime':{'type':Sequelize[_0xe9ad('0x4')]},'ringtime':{'type':Sequelize[_0xe9ad('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xe9ad('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xe9ad('0x3')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 41199b7..4d65c91 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 _0x1968=['bluebird','request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','lodash','util','../../config/logger','api','moment'];(function(_0x432fca,_0xb0b1b5){var _0x3adba4=function(_0x5e3ae4){while(--_0x5e3ae4){_0x432fca['push'](_0x432fca['shift']());}};_0x3adba4(++_0xb0b1b5);}(_0x1968,0x1f3));var _0x8196=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x1968[_0x13b02f];return _0x12e9a6;};'use strict';var _=require(_0x8196('0x0'));var util=require(_0x8196('0x1'));var logger=require(_0x8196('0x2'))(_0x8196('0x3'));var moment=require(_0x8196('0x4'));var BPromise=require(_0x8196('0x5'));var rp=require(_0x8196('0x6'));var fs=require('fs');var path=require(_0x8196('0x7'));var rimraf=require(_0x8196('0x8'));var config=require(_0x8196('0x9'));var attributes=require(_0x8196('0xa'));module[_0x8196('0xb')]=function(_0x54149a,_0x29e3cb){return _0x54149a[_0x8196('0xc')](_0x8196('0xd'),attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd56a=['bluebird','request-promise','../../config/environment','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger'];(function(_0xbc1061,_0x4df02e){var _0x2e5a0b=function(_0x43725f){while(--_0x43725f){_0xbc1061['push'](_0xbc1061['shift']());}};_0x2e5a0b(++_0x4df02e);}(_0xd56a,0x126));var _0xad56=function(_0x99b8f0,_0x48be9e){_0x99b8f0=_0x99b8f0-0x0;var _0x2293ef=_0xd56a[_0x99b8f0];return _0x2293ef;};'use strict';var _=require(_0xad56('0x0'));var util=require(_0xad56('0x1'));var logger=require(_0xad56('0x2'))('api');var moment=require('moment');var BPromise=require(_0xad56('0x3'));var rp=require(_0xad56('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xad56('0x5'));var attributes=require(_0xad56('0x6'));module[_0xad56('0x7')]=function(_0x259c64,_0x21d2ce){return _0x259c64[_0xad56('0x8')](_0xad56('0x9'),attributes,{'tableName':_0xad56('0xa'),'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 a1904fe..f54379d 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 _0xdc49=['create','options','raw','info','CreateReportAgentPreview','stringify','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ReportAgentPreview'];(function(_0x3e5467,_0x1027a5){var _0x5a37c=function(_0x179467){while(--_0x179467){_0x3e5467['push'](_0x3e5467['shift']());}};_0x5a37c(++_0x1027a5);}(_0xdc49,0x1e2));var _0x9dc4=function(_0x47ee93,_0xce92d3){_0x47ee93=_0x47ee93-0x0;var _0x2d8020=_0xdc49[_0x47ee93];return _0x2d8020;};'use strict';var _=require(_0x9dc4('0x0'));var util=require(_0x9dc4('0x1'));var moment=require('moment');var BPromise=require(_0x9dc4('0x2'));var rs=require(_0x9dc4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9dc4('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9dc4('0x5'))(_0x9dc4('0x6'));var config=require(_0x9dc4('0x7'));var jayson=require(_0x9dc4('0x8'));var client=jayson['client'][_0x9dc4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x54f2a0,_0x32a2d3,_0x4d1e46){return new BPromise(function(_0x2bcf43,_0x4f7d75){return client[_0x9dc4('0xa')](_0x54f2a0,_0x4d1e46)[_0x9dc4('0xb')](function(_0x257dcf){logger['info'](_0x9dc4('0xc'),_0x32a2d3,_0x9dc4('0xd'));logger[_0x9dc4('0xe')](_0x9dc4('0xf'),_0x32a2d3,_0x9dc4('0xd'),JSON['stringify'](_0x257dcf));if(_0x257dcf[_0x9dc4('0x10')]){if(_0x257dcf[_0x9dc4('0x10')][_0x9dc4('0x11')]===0x1f4){logger[_0x9dc4('0x10')](_0x9dc4('0xc'),_0x32a2d3,_0x257dcf[_0x9dc4('0x10')]['message']);return _0x4f7d75(_0x257dcf[_0x9dc4('0x10')][_0x9dc4('0x12')]);}logger[_0x9dc4('0x10')]('ReportAgentPreview,\x20%s,\x20%s',_0x32a2d3,_0x257dcf[_0x9dc4('0x10')][_0x9dc4('0x12')]);return _0x2bcf43(_0x257dcf[_0x9dc4('0x10')]['message']);}else{logger['info'](_0x9dc4('0xc'),_0x32a2d3,'request\x20sent');_0x2bcf43(_0x257dcf[_0x9dc4('0x13')]['message']);}})[_0x9dc4('0x14')](function(_0x546758){logger[_0x9dc4('0x10')](_0x9dc4('0xc'),_0x32a2d3,_0x546758);_0x4f7d75(_0x546758);});});}exports['CreateReportAgentPreview']=function(_0x39171f){var _0x58c23b=this;return new Promise(function(_0x5a987e,_0xdc240b){return db[_0x9dc4('0x15')][_0x9dc4('0x16')](_0x39171f['body'],{'raw':_0x39171f['options']?_0x39171f[_0x9dc4('0x17')][_0x9dc4('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x1091cf){logger[_0x9dc4('0x19')](_0x9dc4('0x1a'),_0x39171f);logger[_0x9dc4('0xe')](_0x9dc4('0x1a'),_0x39171f,JSON[_0x9dc4('0x1b')](_0x1091cf));_0x5a987e(_0x1091cf);})['catch'](function(_0x2bc885){logger[_0x9dc4('0x10')](_0x9dc4('0x1a'),_0x2bc885[_0x9dc4('0x12')],_0x39171f);_0xdc240b(_0x58c23b['error'](0x1f4,_0x2bc885[_0x9dc4('0x12')]));});});}; \ No newline at end of file +var _0x1239=['jayson/promise','http','request','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateReportAgentPreview','ReportAgentPreview','body','options','raw','then','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x532a60,_0x4b0416){var _0x15087d=function(_0xf1fa55){while(--_0xf1fa55){_0x532a60['push'](_0x532a60['shift']());}};_0x15087d(++_0x4b0416);}(_0x1239,0x19c));var _0x9123=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x1239[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x9123('0x0'));var util=require(_0x9123('0x1'));var moment=require(_0x9123('0x2'));var BPromise=require(_0x9123('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9123('0x4'))['db'];var utils=require(_0x9123('0x5'));var logger=require(_0x9123('0x6'))(_0x9123('0x7'));var config=require('../../config/environment');var jayson=require(_0x9123('0x8'));var client=jayson['client'][_0x9123('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2d4baf,_0x1710a5,_0x36fac7){return new BPromise(function(_0x534f03,_0x217292){return client[_0x9123('0xa')](_0x2d4baf,_0x36fac7)['then'](function(_0x5a9763){logger[_0x9123('0xb')](_0x9123('0xc'),_0x1710a5,_0x9123('0xd'));logger[_0x9123('0xe')](_0x9123('0xf'),_0x1710a5,_0x9123('0xd'),JSON[_0x9123('0x10')](_0x5a9763));if(_0x5a9763[_0x9123('0x11')]){if(_0x5a9763[_0x9123('0x11')][_0x9123('0x12')]===0x1f4){logger['error'](_0x9123('0xc'),_0x1710a5,_0x5a9763[_0x9123('0x11')][_0x9123('0x13')]);return _0x217292(_0x5a9763[_0x9123('0x11')][_0x9123('0x13')]);}logger['error'](_0x9123('0xc'),_0x1710a5,_0x5a9763[_0x9123('0x11')][_0x9123('0x13')]);return _0x534f03(_0x5a9763[_0x9123('0x11')]['message']);}else{logger[_0x9123('0xb')](_0x9123('0xc'),_0x1710a5,'request\x20sent');_0x534f03(_0x5a9763[_0x9123('0x14')][_0x9123('0x13')]);}})['catch'](function(_0x1e0ad1){logger[_0x9123('0x11')](_0x9123('0xc'),_0x1710a5,_0x1e0ad1);_0x217292(_0x1e0ad1);});});}exports[_0x9123('0x15')]=function(_0x2ffe00){var _0x5a3161=this;return new Promise(function(_0x276ec4,_0x144947){return db[_0x9123('0x16')]['create'](_0x2ffe00[_0x9123('0x17')],{'raw':_0x2ffe00[_0x9123('0x18')]?_0x2ffe00['options'][_0x9123('0x19')]===undefined?!![]:![]:!![]})[_0x9123('0x1a')](function(_0x25d693){logger[_0x9123('0xb')](_0x9123('0x15'),_0x2ffe00);logger[_0x9123('0xe')](_0x9123('0x15'),_0x2ffe00,JSON[_0x9123('0x10')](_0x25d693));_0x276ec4(_0x25d693);})[_0x9123('0x1b')](function(_0x3bb919){logger[_0x9123('0x11')](_0x9123('0x15'),_0x3bb919[_0x9123('0x13')],_0x2ffe00);_0x144947(_0x5a3161[_0x9123('0x11')](0x1f4,_0x3bb919['message']));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 9747ab6..af7a800 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 _0x0824=['/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','outbound','/outbound/channels','outboundChannels','/agents','/agents/:id/capacity','agentCapacity','/telephones','/trunks','trunks','/campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','faxQueuesWaitingInteractions','/mail/queues/:id/notify','queueNotify','mail','showMailQueues','post','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','showSmsQueues','/agents/:id/notify','agentNotify','multer','util','express','../../components/auth/service','./rpc.controller','get','/voice/channels/:uniqueid/mixmonitor','isAuthenticated','/voice/channels/:uniqueid/stopmixmonitor','/voice/queues','voiceQueues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x0824,0x1bb));var _0x4082=function(_0x5e7f55,_0x4f6abf){_0x5e7f55=_0x5e7f55-0x0;var _0x318ab0=_0x0824[_0x5e7f55];return _0x318ab0;};'use strict';var multer=require(_0x4082('0x0'));var util=require(_0x4082('0x1'));var path=require('path');var express=require(_0x4082('0x2'));var router=express['Router']();var auth=require(_0x4082('0x3'));var controller=require(_0x4082('0x4'));router[_0x4082('0x5')]('/voice/channels',auth['isAuthenticated'](),controller['voiceChannels']);router[_0x4082('0x5')](_0x4082('0x6'),auth[_0x4082('0x7')](),controller['voiceChannelMixMonitor']);router[_0x4082('0x5')](_0x4082('0x8'),auth['isAuthenticated'](),controller['voiceChannelStopMixMonitor']);router[_0x4082('0x5')](_0x4082('0x9'),auth[_0x4082('0x7')](),controller[_0x4082('0xa')]);router[_0x4082('0x5')]('/chat/queues',auth[_0x4082('0x7')](),controller[_0x4082('0xb')]);router[_0x4082('0x5')](_0x4082('0xc'),auth['isAuthenticated'](),controller[_0x4082('0xd')]);router[_0x4082('0x5')](_0x4082('0xe'),auth[_0x4082('0x7')](),controller[_0x4082('0xf')]);router[_0x4082('0x5')](_0x4082('0x10'),auth[_0x4082('0x7')](),controller[_0x4082('0x11')]);router[_0x4082('0x5')](_0x4082('0x12'),auth[_0x4082('0x7')](),controller[_0x4082('0x13')]);router['get'](_0x4082('0x14'),auth[_0x4082('0x7')](),controller[_0x4082('0x15')]);router['get'](_0x4082('0x16'),auth[_0x4082('0x7')](),controller[_0x4082('0x17')]);router[_0x4082('0x5')](_0x4082('0x18'),auth['isAuthenticated'](),controller['voiceQueuesPreview']);router[_0x4082('0x5')](_0x4082('0x19'),auth['isAuthenticated'](),controller[_0x4082('0x1a')]);router[_0x4082('0x5')](_0x4082('0x1b'),auth[_0x4082('0x7')](),controller['voiceQueuesChannel']);router[_0x4082('0x5')](_0x4082('0x1c'),auth[_0x4082('0x7')](),controller[_0x4082('0x1d')]);router['get'](_0x4082('0x1e'),auth[_0x4082('0x7')](),controller['voiceQueuesChannelRedirect']);router[_0x4082('0x5')](_0x4082('0x1f'),auth[_0x4082('0x7')](),controller[_0x4082('0x20')]);router[_0x4082('0x21')](_0x4082('0x1f'),auth['isAuthenticated'](),controller[_0x4082('0x22')]);router[_0x4082('0x5')](_0x4082('0x23'),auth[_0x4082('0x7')](),controller[_0x4082('0x24')]);router['get'](_0x4082('0x25'),auth[_0x4082('0x7')](),controller[_0x4082('0x26')]);router['get'](_0x4082('0x27'),auth['isAuthenticated'](),controller['agents']);router[_0x4082('0x21')](_0x4082('0x28'),auth['isAuthenticated'](),controller[_0x4082('0x29')]);router[_0x4082('0x5')](_0x4082('0x2a'),auth[_0x4082('0x7')](),controller['telephones']);router[_0x4082('0x5')](_0x4082('0x2b'),auth[_0x4082('0x7')](),controller[_0x4082('0x2c')]);router['get'](_0x4082('0x2d'),auth[_0x4082('0x7')](),controller['campaigns']);router[_0x4082('0x5')](_0x4082('0x2e'),auth[_0x4082('0x7')](),controller[_0x4082('0x2f')]);router['get'](_0x4082('0x30'),auth[_0x4082('0x7')](),controller[_0x4082('0x31')]);router[_0x4082('0x5')](_0x4082('0x32'),auth[_0x4082('0x7')](),controller[_0x4082('0x33')]);router[_0x4082('0x5')]('/openchannel/queues/waitinginteractions',auth[_0x4082('0x7')](),controller[_0x4082('0x34')]);router['get'](_0x4082('0x35'),auth[_0x4082('0x7')](),controller[_0x4082('0x36')]);router['get'](_0x4082('0x37'),auth['isAuthenticated'](),controller['smsQueuesWaitingInteractions']);router[_0x4082('0x5')]('/whatsapp/queues/waitinginteractions',auth[_0x4082('0x7')](),controller['whatsappQueuesWaitingInteractions']);router[_0x4082('0x5')]('/fax/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0x4082('0x38')]);router['post'](_0x4082('0x39'),auth[_0x4082('0x7')](),controller[_0x4082('0x3a')](_0x4082('0x3b')));router[_0x4082('0x5')]('/mail/queues/:id',auth['isAuthenticated'](),controller[_0x4082('0x3c')]);router[_0x4082('0x3d')](_0x4082('0x3e'),auth[_0x4082('0x7')](),controller[_0x4082('0x3a')](_0x4082('0x3f')));router[_0x4082('0x5')](_0x4082('0x40'),auth['isAuthenticated'](),controller[_0x4082('0x41')]);router[_0x4082('0x3d')](_0x4082('0x42'),auth['isAuthenticated'](),controller[_0x4082('0x3a')](_0x4082('0x43')));router['get'](_0x4082('0x44'),auth[_0x4082('0x7')](),controller[_0x4082('0x45')]);router[_0x4082('0x3d')](_0x4082('0x46'),auth[_0x4082('0x7')](),controller['queueNotify'](_0x4082('0x47')));router['get']('/openchannel/queues/:id',auth[_0x4082('0x7')](),controller[_0x4082('0x48')]);router[_0x4082('0x3d')](_0x4082('0x49'),auth[_0x4082('0x7')](),controller[_0x4082('0x3a')](_0x4082('0x4a')));router[_0x4082('0x3d')](_0x4082('0x4b'),auth['isAuthenticated'](),controller[_0x4082('0x3a')]('whatsapp'));router['get']('/sms/queues/:id',auth[_0x4082('0x7')](),controller[_0x4082('0x4c')]);router['get']('/whatsapp/queues/:id',auth['isAuthenticated'](),controller['showWhatsappQueues']);router[_0x4082('0x3d')](_0x4082('0x4d'),auth[_0x4082('0x7')](),controller[_0x4082('0x4e')]);module['exports']=router; \ No newline at end of file +var _0x006d=['chat','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','exports','multer','util','express','Router','../../components/auth/service','./rpc.controller','/voice/channels','voiceChannels','get','/voice/channels/:uniqueid/mixmonitor','isAuthenticated','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','/fax/queues','faxQueues','/voice/queues/preview/:id','/voice/queues/channels/:uniqueid','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','put','updateVoiceQueue','/outbound','outbound','/outbound/channels','agents','agentCapacity','/telephones','telephones','/trunks','trunks','/campaigns','/fax/accounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify'];(function(_0x540f49,_0x384537){var _0x2d6880=function(_0x2eec3e){while(--_0x2eec3e){_0x540f49['push'](_0x540f49['shift']());}};_0x2d6880(++_0x384537);}(_0x006d,0xfd));var _0xd006=function(_0x5a774b,_0x4242c4){_0x5a774b=_0x5a774b-0x0;var _0xc329b4=_0x006d[_0x5a774b];return _0xc329b4;};'use strict';var multer=require(_0xd006('0x0'));var util=require(_0xd006('0x1'));var path=require('path');var express=require(_0xd006('0x2'));var router=express[_0xd006('0x3')]();var auth=require(_0xd006('0x4'));var controller=require(_0xd006('0x5'));router['get'](_0xd006('0x6'),auth['isAuthenticated'](),controller[_0xd006('0x7')]);router[_0xd006('0x8')](_0xd006('0x9'),auth['isAuthenticated'](),controller['voiceChannelMixMonitor']);router[_0xd006('0x8')]('/voice/channels/:uniqueid/stopmixmonitor',auth[_0xd006('0xa')](),controller[_0xd006('0xb')]);router[_0xd006('0x8')](_0xd006('0xc'),auth[_0xd006('0xa')](),controller[_0xd006('0xd')]);router[_0xd006('0x8')](_0xd006('0xe'),auth[_0xd006('0xa')](),controller[_0xd006('0xf')]);router[_0xd006('0x8')](_0xd006('0x10'),auth[_0xd006('0xa')](),controller[_0xd006('0x11')]);router[_0xd006('0x8')](_0xd006('0x12'),auth[_0xd006('0xa')](),controller[_0xd006('0x13')]);router[_0xd006('0x8')](_0xd006('0x14'),auth[_0xd006('0xa')](),controller[_0xd006('0x15')]);router[_0xd006('0x8')](_0xd006('0x16'),auth[_0xd006('0xa')](),controller[_0xd006('0x17')]);router[_0xd006('0x8')](_0xd006('0x18'),auth[_0xd006('0xa')](),controller['whatsappQueues']);router['get'](_0xd006('0x19'),auth[_0xd006('0xa')](),controller[_0xd006('0x1a')]);router['get'](_0xd006('0x1b'),auth[_0xd006('0xa')](),controller['voiceQueuesPreview']);router[_0xd006('0x8')]('/voice/queues/channels',auth[_0xd006('0xa')](),controller['voiceQueuesChannels']);router['get'](_0xd006('0x1c'),auth[_0xd006('0xa')](),controller['voiceQueuesChannel']);router['get'](_0xd006('0x1d'),auth[_0xd006('0xa')](),controller[_0xd006('0x1e')]);router[_0xd006('0x8')](_0xd006('0x1f'),auth[_0xd006('0xa')](),controller[_0xd006('0x20')]);router[_0xd006('0x8')](_0xd006('0x21'),auth['isAuthenticated'](),controller['showVoiceQueues']);router[_0xd006('0x22')](_0xd006('0x21'),auth['isAuthenticated'](),controller[_0xd006('0x23')]);router[_0xd006('0x8')](_0xd006('0x24'),auth['isAuthenticated'](),controller[_0xd006('0x25')]);router[_0xd006('0x8')](_0xd006('0x26'),auth['isAuthenticated'](),controller['outboundChannels']);router[_0xd006('0x8')]('/agents',auth[_0xd006('0xa')](),controller[_0xd006('0x27')]);router[_0xd006('0x22')]('/agents/:id/capacity',auth[_0xd006('0xa')](),controller[_0xd006('0x28')]);router[_0xd006('0x8')](_0xd006('0x29'),auth[_0xd006('0xa')](),controller[_0xd006('0x2a')]);router[_0xd006('0x8')](_0xd006('0x2b'),auth[_0xd006('0xa')](),controller[_0xd006('0x2c')]);router[_0xd006('0x8')](_0xd006('0x2d'),auth['isAuthenticated'](),controller['campaigns']);router[_0xd006('0x8')](_0xd006('0x2e'),auth[_0xd006('0xa')](),controller['faxAccounts']);router[_0xd006('0x8')](_0xd006('0x2f'),auth[_0xd006('0xa')](),controller[_0xd006('0x30')]);router[_0xd006('0x8')]('/mail/queues/waitinginteractions',auth[_0xd006('0xa')](),controller[_0xd006('0x31')]);router[_0xd006('0x8')](_0xd006('0x32'),auth[_0xd006('0xa')](),controller[_0xd006('0x33')]);router['get']('/openchannel/queues/:id/waitinginteractions',auth['isAuthenticated'](),controller[_0xd006('0x34')]);router['get']('/sms/queues/waitinginteractions',auth[_0xd006('0xa')](),controller[_0xd006('0x35')]);router[_0xd006('0x8')](_0xd006('0x36'),auth['isAuthenticated'](),controller[_0xd006('0x37')]);router[_0xd006('0x8')]('/fax/queues/waitinginteractions',auth[_0xd006('0xa')](),controller['faxQueuesWaitingInteractions']);router[_0xd006('0x38')](_0xd006('0x39'),auth[_0xd006('0xa')](),controller[_0xd006('0x3a')](_0xd006('0x3b')));router['get'](_0xd006('0x3c'),auth[_0xd006('0xa')](),controller[_0xd006('0x3d')]);router[_0xd006('0x38')](_0xd006('0x3e'),auth[_0xd006('0xa')](),controller[_0xd006('0x3a')](_0xd006('0x3f')));router[_0xd006('0x8')]('/chat/queues/:id',auth[_0xd006('0xa')](),controller['showChatQueues']);router['post']('/fax/queues/:id/notify',auth[_0xd006('0xa')](),controller[_0xd006('0x3a')](_0xd006('0x40')));router[_0xd006('0x8')](_0xd006('0x41'),auth[_0xd006('0xa')](),controller[_0xd006('0x42')]);router['post'](_0xd006('0x43'),auth[_0xd006('0xa')](),controller['queueNotify'](_0xd006('0x44')));router['get']('/openchannel/queues/:id',auth[_0xd006('0xa')](),controller[_0xd006('0x45')]);router[_0xd006('0x38')](_0xd006('0x46'),auth[_0xd006('0xa')](),controller[_0xd006('0x3a')](_0xd006('0x47')));router[_0xd006('0x38')](_0xd006('0x48'),auth[_0xd006('0xa')](),controller[_0xd006('0x3a')](_0xd006('0x49')));router[_0xd006('0x8')]('/sms/queues/:id',auth[_0xd006('0xa')](),controller[_0xd006('0x4a')]);router[_0xd006('0x8')](_0xd006('0x4b'),auth[_0xd006('0xa')](),controller[_0xd006('0x4c')]);router[_0xd006('0x38')](_0xd006('0x4d'),auth[_0xd006('0xa')](),controller['agentNotify']);module[_0xd006('0x4e')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 8bc16ed..b486cc0 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 _0x20a7=['catch','status','json','sendStatus','stack','name','send','isNil','rows','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','merge','voiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','Agents','interaction','user','MemberReport','findAll','INTERACTION','format','updateAttributes','length','findOrCreate','SIP/%s','agent','internal','capacity','telephones','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','queue_id','uniq','value','indexOf','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Account','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','update','InteractionId','From','create','Start','queue','queueTransferTimeout','agentNotify','channel','Channel\x20field\x20is\x20mandatory','Website','Agent\x20not\x20found','\x20Message\x20not\x20found','MessageId','TransferReport','*,*,*,*','bluebird','moment','lodash','util','../../config/logger','api','jayson/promise','http','client','request','then','error','code','message','result'];(function(_0x32f9ca,_0x2fa8bc){var _0x52e083=function(_0x4fd86a){while(--_0x4fd86a){_0x32f9ca['push'](_0x32f9ca['shift']());}};_0x52e083(++_0x2fa8bc);}(_0x20a7,0x77));var _0x720a=function(_0x3899af,_0x174e9c){_0x3899af=_0x3899af-0x0;var _0x3827e4=_0x20a7[_0x3899af];return _0x3827e4;};'use strict';var BPromise=require(_0x720a('0x0'));var moment=require(_0x720a('0x1'));var _=require(_0x720a('0x2'));var util=require(_0x720a('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0x720a('0x4'))(_0x720a('0x5'));var jayson=require(_0x720a('0x6'));var amiClient=jayson['client'][_0x720a('0x7')]({'port':0x232a});var mailClient=jayson[_0x720a('0x8')][_0x720a('0x7')]({'port':0x232b});var routingClient=jayson['client'][_0x720a('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x1ffc0b,_0x5e10df,_0x395eb2){return new BPromise(function(_0x12661e,_0x3b5804){var _0x173cc6=_0x395eb2?_0x395eb2:amiClient;return _0x173cc6[_0x720a('0x9')](_0x1ffc0b,_0x5e10df)[_0x720a('0xa')](function(_0x279ae5){if(_0x279ae5['error']){if(_0x279ae5[_0x720a('0xb')][_0x720a('0xc')]===0x1f4){return _0x3b5804(_0x279ae5[_0x720a('0xb')][_0x720a('0xd')]);}return _0x12661e(_0x279ae5[_0x720a('0xb')]['message']);}else{_0x12661e(_0x279ae5[_0x720a('0xe')]);}})[_0x720a('0xf')](function(_0x439058){_0x3b5804(_0x439058);});});}function respondWithResult(_0x23884c,_0x9623c4){_0x9623c4=_0x9623c4||0xc8;return function(_0x252009){if(_0x252009){return _0x23884c[_0x720a('0x10')](_0x9623c4)[_0x720a('0x11')](_0x252009);}return _0x23884c[_0x720a('0x12')](0x194);};}function handleError(_0x428927,_0x1ba7cf){_0x1ba7cf=_0x1ba7cf||0x1f4;return function(_0xefb6e7){logger[_0x720a('0xb')](_0xefb6e7[_0x720a('0x13')]);if(_0xefb6e7[_0x720a('0x14')]){delete _0xefb6e7[_0x720a('0x14')];}_0x428927['status'](_0x1ba7cf)[_0x720a('0x15')](_0xefb6e7);};}function findById(_0x553249){return function(_0x79a274){if(!_[_0x720a('0x16')](_0x553249)&&!_[_0x720a('0x16')](_0x79a274)&&!_[_0x720a('0x16')](_0x79a274['rows'])){return _['find'](_0x79a274[_0x720a('0x17')],function(_0x51bb29){return _0x51bb29['id']==_0x553249;});}return null;};}exports[_0x720a('0x18')]=function(_0x1ea465,_0x46d680){return respondWithRpcPromise(_0x720a('0x19'),_0x1ea465[_0x720a('0x1a')])[_0x720a('0xa')](respondWithResult(_0x46d680,null))[_0x720a('0xf')](handleError(_0x46d680,null));};exports[_0x720a('0x1b')]=function(_0xb3e70e,_0xe3d6f){return respondWithRpcPromise(_0x720a('0x1c'),_['merge'](_0xb3e70e[_0x720a('0x1a')],_0xb3e70e[_0x720a('0x1d')]))['then'](respondWithResult(_0xe3d6f,null))[_0x720a('0xf')](handleError(_0xe3d6f,null));};exports[_0x720a('0x1e')]=function(_0x220191,_0x2b14ee){return respondWithRpcPromise(_0x720a('0x1f'),_['merge'](_0x220191[_0x720a('0x1a')],_0x220191['params']))[_0x720a('0xa')](respondWithResult(_0x2b14ee,null))[_0x720a('0xf')](handleError(_0x2b14ee,null));};exports[_0x720a('0x20')]=function(_0x3603e9,_0xca837d){return respondWithRpcPromise(_0x720a('0x21'),_0x3603e9['query'])[_0x720a('0xa')](respondWithResult(_0xca837d,null))[_0x720a('0xf')](handleError(_0xca837d,null));};exports['showVoiceQueues']=function(_0x4fb6cd,_0x5af5e9){return respondWithRpcPromise('VoiceQueues',_0x4fb6cd[_0x720a('0x1a')])['then'](findById(_0x4fb6cd[_0x720a('0x1d')]['id']))[_0x720a('0xa')](respondWithResult(_0x5af5e9,null))['catch'](handleError(_0x5af5e9,null));};exports[_0x720a('0x22')]=function(_0x1d2cc4,_0x1fe054){return respondWithRpcPromise(_0x720a('0x23'),_['merge'](_0x1d2cc4[_0x720a('0x24')],_0x1d2cc4['params']))['then'](respondWithResult(_0x1fe054,null))['catch'](handleError(_0x1fe054,null));};exports[_0x720a('0x25')]=function(_0x589a31,_0x3f7929){return respondWithRpcPromise('VoiceQueuesPreview',_[_0x720a('0x26')](_0x589a31[_0x720a('0x1a')],_0x589a31[_0x720a('0x1d')]))[_0x720a('0xa')](respondWithResult(_0x3f7929,null))['catch'](handleError(_0x3f7929,null));};exports[_0x720a('0x27')]=function(_0x1304e,_0x4872b4){return respondWithRpcPromise('VoiceQueuesChannels',_0x1304e[_0x720a('0x1a')])[_0x720a('0xa')](respondWithResult(_0x4872b4,null))[_0x720a('0xf')](handleError(_0x4872b4,null));};exports[_0x720a('0x28')]=function(_0x178040,_0x44b209){return respondWithRpcPromise(_0x720a('0x29'),_['merge'](_0x178040[_0x720a('0x1a')],_0x178040[_0x720a('0x1d')]))[_0x720a('0xa')](respondWithResult(_0x44b209,null))['catch'](handleError(_0x44b209,null));};exports[_0x720a('0x2a')]=function(_0x4e0ec4,_0x2b4046){return respondWithRpcPromise(_0x720a('0x2b'),_['merge'](_0x4e0ec4[_0x720a('0x1a')],_0x4e0ec4['params']))[_0x720a('0xa')](respondWithResult(_0x2b4046,null))[_0x720a('0xf')](handleError(_0x2b4046,null));};exports[_0x720a('0x2c')]=function(_0x3567e9,_0x4a4ec9){return respondWithRpcPromise(_0x720a('0x2d'),_[_0x720a('0x26')](_0x3567e9['query'],_0x3567e9[_0x720a('0x1d')]))[_0x720a('0xa')](respondWithResult(_0x4a4ec9,null))[_0x720a('0xf')](handleError(_0x4a4ec9,null));};exports[_0x720a('0x2e')]=function(_0x34f8a2,_0x9c2493){return respondWithRpcPromise(_0x720a('0x2f'),_0x34f8a2[_0x720a('0x1a')])['then'](respondWithResult(_0x9c2493,null))[_0x720a('0xf')](handleError(_0x9c2493,null));};exports[_0x720a('0x30')]=function(_0x1fe971,_0x19bf96){return respondWithRpcPromise(_0x720a('0x31'),_0x1fe971[_0x720a('0x1a')])['then'](respondWithResult(_0x19bf96,null))[_0x720a('0xf')](handleError(_0x19bf96,null));};exports['agents']=function(_0x1eb715,_0x33b84e){var _0x106ece;return respondWithRpcPromise(_0x720a('0x32'),_0x1eb715[_0x720a('0x1a')])[_0x720a('0xa')](function(_0x27de55){_0x106ece=_0x27de55;return respondWithRpcPromise(_0x720a('0x32'),_0x1eb715['query'],routingClient);})[_0x720a('0xa')](function(_0x3b2b1a){return _[_0x720a('0x26')]({},_0x3b2b1a,_0x106ece);})[_0x720a('0xa')](respondWithResult(_0x33b84e,null))[_0x720a('0xf')](handleError(_0x33b84e,null));};exports['agentCapacity']=function(_0x1b2fc5,_0x5333c8){if(_0x1b2fc5[_0x720a('0x24')]&&_0x1b2fc5['body'][_0x720a('0x33')]&&_0x1b2fc5[_0x720a('0x34')]&&_0x1b2fc5['user']['name']){for(var _0x1b7026 in _0x1b2fc5[_0x720a('0x24')][_0x720a('0x33')]){if(_0x1b2fc5[_0x720a('0x24')][_0x720a('0x33')]['hasOwnProperty'](_0x1b7026)){db[_0x720a('0x35')][_0x720a('0x36')]({'where':{'channel':_0x1b7026,'membername':_0x1b2fc5[_0x720a('0x34')][_0x720a('0x14')],'type':_0x720a('0x37'),'exitAt':null,'uniqueid':_0x1b2fc5[_0x720a('0x24')][_0x720a('0x33')][_0x1b7026]&&_0x1b2fc5['body'][_0x720a('0x33')][_0x1b7026]['length']?{'$notIn':_0x1b2fc5[_0x720a('0x24')][_0x720a('0x33')][_0x1b7026]}:{'$ne':null}}})[_0x720a('0xa')](function(_0x257f71){var _0x1316dc=moment()[_0x720a('0x38')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x264a77=0x0,_0x325351=_0x257f71['length'];_0x264a77<_0x325351;_0x264a77+=0x1){_0x257f71[_0x264a77][_0x720a('0x39')]({'exitAt':_0x1316dc});}});for(var _0x73ac22=0x0;_0x73ac22<_0x1b2fc5[_0x720a('0x24')]['interaction'][_0x1b7026][_0x720a('0x3a')];_0x73ac22+=0x1){db[_0x720a('0x35')][_0x720a('0x3b')]({'where':{'channel':_0x1b7026,'membername':_0x1b2fc5[_0x720a('0x34')][_0x720a('0x14')],'type':_0x720a('0x37'),'uniqueid':_0x1b2fc5['body'][_0x720a('0x33')][_0x1b7026][_0x73ac22],'exitAt':null},'defaults':{'channel':_0x1b7026,'membername':_0x1b2fc5['user']['name'],'interface':_[_0x720a('0x16')](_0x1b2fc5[_0x720a('0x34')]['interface'])?util[_0x720a('0x38')](_0x720a('0x3c'),_0x1b2fc5['user'][_0x720a('0x14')]):_0x1b2fc5[_0x720a('0x34')]['interface'],'type':_0x720a('0x37'),'enterAt':moment()[_0x720a('0x38')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x720a('0x3d'),'internal':_0x1b2fc5[_0x720a('0x34')][_0x720a('0x3e')],'uniqueid':_0x1b2fc5[_0x720a('0x24')][_0x720a('0x33')][_0x1b7026][_0x73ac22]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x1b2fc5[_0x720a('0x1d')]['id'],'capacity':_0x1b2fc5[_0x720a('0x24')][_0x720a('0x3f')]},routingClient)[_0x720a('0xa')](respondWithResult(_0x5333c8,null))['catch'](handleError(_0x5333c8,null));};exports[_0x720a('0x40')]=function(_0x189f0a,_0x309db1){return respondWithRpcPromise(_0x720a('0x41'),_0x189f0a[_0x720a('0x1a')])[_0x720a('0xa')](respondWithResult(_0x309db1,null))[_0x720a('0xf')](handleError(_0x309db1,null));};exports[_0x720a('0x42')]=function(_0x583880,_0x194212){return respondWithRpcPromise(_0x720a('0x43'),_0x583880[_0x720a('0x1a')])[_0x720a('0xa')](respondWithResult(_0x194212,null))[_0x720a('0xf')](handleError(_0x194212,null));};exports[_0x720a('0x44')]=function(_0x428b74,_0xbf45a4){return respondWithRpcPromise(_0x720a('0x45'),_0x428b74['query'])['then'](respondWithResult(_0xbf45a4,null))['catch'](handleError(_0xbf45a4,null));};exports[_0x720a('0x46')]=function(_0x55714a,_0x3b40a4){return respondWithRpcPromise(_0x720a('0x47'),_0x55714a[_0x720a('0x1a')],routingClient)[_0x720a('0xa')](respondWithResult(_0x3b40a4,null))[_0x720a('0xf')](handleError(_0x3b40a4,null));};exports[_0x720a('0x48')]=function(_0x31f5b2,_0x545c38){return respondWithRpcPromise('ChatQueues',_0x31f5b2['query'],routingClient)[_0x720a('0xa')](findById(_0x31f5b2[_0x720a('0x1d')]['id']))[_0x720a('0xa')](respondWithResult(_0x545c38,null))[_0x720a('0xf')](handleError(_0x545c38,null));};exports[_0x720a('0x49')]=function(_0x363ae2,_0x5c02e0){return respondWithRpcPromise(_0x720a('0x4a'),_0x363ae2[_0x720a('0x1a')],routingClient)[_0x720a('0xa')](respondWithResult(_0x5c02e0,null))[_0x720a('0xf')](handleError(_0x5c02e0,null));};exports[_0x720a('0x4b')]=function(_0xb4c801,_0x2f0804){return respondWithRpcPromise(_0x720a('0x4a'),_0xb4c801[_0x720a('0x1a')],routingClient)['then'](findById(_0xb4c801[_0x720a('0x1d')]['id']))[_0x720a('0xa')](respondWithResult(_0x2f0804,null))[_0x720a('0xf')](handleError(_0x2f0804,null));};exports['mailAccounts']=function(_0x5dee53,_0x241b8d){return respondWithRpcPromise(_0x720a('0x4c'),_0x5dee53[_0x720a('0x1a')],mailClient)[_0x720a('0xa')](respondWithResult(_0x241b8d,null))['catch'](handleError(_0x241b8d,null));};exports[_0x720a('0x4d')]=function(_0x11385c,_0x57bee4){return respondWithRpcPromise(_0x720a('0x4e'),_0x11385c[_0x720a('0x1a')],routingClient)[_0x720a('0xa')](respondWithResult(_0x57bee4,null))['catch'](handleError(_0x57bee4,null));};exports[_0x720a('0x4f')]=function(_0x439639,_0x462da1){return respondWithRpcPromise(_0x720a('0x4e'),_0x439639[_0x720a('0x1a')],routingClient)[_0x720a('0xa')](findById(_0x439639['params']['id']))[_0x720a('0xa')](respondWithResult(_0x462da1,null))['catch'](handleError(_0x462da1,null));};exports[_0x720a('0x50')]=function(_0x172d62,_0x5b7e3b){return respondWithRpcPromise(_0x720a('0x51'),_0x172d62[_0x720a('0x1a')],routingClient)[_0x720a('0xa')](respondWithResult(_0x5b7e3b,null))[_0x720a('0xf')](handleError(_0x5b7e3b,null));};exports[_0x720a('0x52')]=function(_0x5c9e95,_0x5877d6){return respondWithRpcPromise(_0x720a('0x51'),_0x5c9e95[_0x720a('0x1a')],routingClient)['then'](findById(_0x5c9e95[_0x720a('0x1d')]['id']))[_0x720a('0xa')](respondWithResult(_0x5877d6,null))[_0x720a('0xf')](handleError(_0x5877d6,null));};exports[_0x720a('0x53')]=function(_0x981bef,_0x256b56){return respondWithRpcPromise(_0x720a('0x54'),_0x981bef['query'],routingClient)[_0x720a('0xa')](respondWithResult(_0x256b56,null))[_0x720a('0xf')](handleError(_0x256b56,null));};exports[_0x720a('0x55')]=function(_0xba5c69,_0xb13c98){return respondWithRpcPromise(_0x720a('0x54'),_0xba5c69[_0x720a('0x1a')],routingClient)[_0x720a('0xa')](findById(_0xba5c69[_0x720a('0x1d')]['id']))[_0x720a('0xa')](respondWithResult(_0xb13c98,null))[_0x720a('0xf')](handleError(_0xb13c98,null));};exports['faxQueues']=function(_0x43a07e,_0x3ff256){return respondWithRpcPromise(_0x720a('0x56'),_0x43a07e[_0x720a('0x1a')],routingClient)[_0x720a('0xa')](respondWithResult(_0x3ff256,null))[_0x720a('0xf')](handleError(_0x3ff256,null));};exports[_0x720a('0x57')]=function(_0x475815,_0x2239e6){return respondWithRpcPromise('FaxQueues',_0x475815[_0x720a('0x1a')],routingClient)[_0x720a('0xa')](findById(_0x475815[_0x720a('0x1d')]['id']))[_0x720a('0xa')](respondWithResult(_0x2239e6,null))[_0x720a('0xf')](handleError(_0x2239e6,null));};exports[_0x720a('0x58')]=function(_0x35a905,_0x542034){return respondWithRpcPromise(_0x720a('0x59'),_0x35a905['query'])[_0x720a('0xa')](respondWithResult(_0x542034,null))['catch'](handleError(_0x542034,null));};exports[_0x720a('0x5a')]=function(_0x48955d,_0x280f10){return respondWithRpcPromise(_0x720a('0x5b'),_0x48955d[_0x720a('0x1a')],routingClient)[_0x720a('0xa')](respondWithResult(_0x280f10,null))[_0x720a('0xf')](handleError(_0x280f10,null));};exports[_0x720a('0x5c')]=function(_0x10834c,_0x3dbf58){return respondWithRpcPromise(_0x720a('0x5d'),_0x10834c['query'],routingClient)['then'](respondWithResult(_0x3dbf58,null))[_0x720a('0xf')](handleError(_0x3dbf58,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x32cb06,_0x53a208){return respondWithRpcPromise(_0x720a('0x5e'),_0x32cb06['query'],routingClient)['then'](respondWithResult(_0x53a208,null))[_0x720a('0xf')](handleError(_0x53a208,null));};exports[_0x720a('0x5f')]=function(_0x592d1b,_0x501b1b){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x592d1b['query'],routingClient)['then'](function(_0x2bcc5f){if(_0x592d1b[_0x720a('0x1a')][_0x720a('0x60')]!==undefined){var _0x38b695=_(_0x2bcc5f[_0x720a('0x17')])[_0x720a('0x61')]([_0x592d1b[_0x720a('0x1a')][_0x720a('0x60')],_0x592d1b[_0x720a('0x1d')]['id']])['map'](_0x720a('0x62'))[_0x720a('0x63')]()[_0x720a('0x64')]();return _0x2bcc5f[_0x720a('0x17')]['filter'](function(_0x2360fd){return _0x38b695[_0x720a('0x65')](_0x2360fd['queue_id'])>-0x1;});}else{return _0x2bcc5f[_0x720a('0x17')][_0x720a('0x61')](function(_0x1e69e9){return _0x1e69e9[_0x720a('0x62')]===parseInt(_0x592d1b[_0x720a('0x1d')]['id']);});}})[_0x720a('0xa')](respondWithResult(_0x501b1b,null))[_0x720a('0xf')](handleError(_0x501b1b,null));};exports[_0x720a('0x66')]=function(_0x2289fe,_0x3ef5cc){return respondWithRpcPromise(_0x720a('0x67'),_0x2289fe[_0x720a('0x1a')],routingClient)[_0x720a('0xa')](respondWithResult(_0x3ef5cc,null))['catch'](handleError(_0x3ef5cc,null));};exports[_0x720a('0x68')]=function(_0x33b175,_0x9fe660){return respondWithRpcPromise(_0x720a('0x69'),_0x33b175[_0x720a('0x1a')],routingClient)[_0x720a('0xa')](respondWithResult(_0x9fe660,null))[_0x720a('0xf')](handleError(_0x9fe660,null));};exports[_0x720a('0x6a')]=function(_0x550c7f,_0x456524){return respondWithRpcPromise(_0x720a('0x6b'),_0x550c7f[_0x720a('0x1a')],routingClient)['then'](respondWithResult(_0x456524,null))[_0x720a('0xf')](handleError(_0x456524,null));};exports[_0x720a('0x6c')]=function(_0x3b5f75){return function(_0x412328,_0x20dd63){var _0x325e7a,_0x355082;var _0x68a979=_[_0x720a('0x6d')](_0x3b5f75);var _0x4ecd22=_0x3b5f75===_0x720a('0x6e')?'Website':_0x720a('0x6f');return db[_0x68a979+_0x720a('0x70')][_0x720a('0x71')]({'raw':!![],'where':{'id':_0x412328[_0x720a('0x1d')]['id']}})[_0x720a('0xa')](function(_0x1a9874){if(_['isNil'](_0x1a9874)){throw new Error(_0x68a979+_0x720a('0x72'));}_0x325e7a=_0x1a9874;return db[_0x68a979+_0x720a('0x73')][_0x720a('0x71')]({'where':{'id':_0x412328[_0x720a('0x24')][_0x720a('0x74')]},'include':[{'model':db[_0x68a979+_0x720a('0x75')],'as':_0x720a('0x75')},{'model':db[_0x68a979+_0x4ecd22],'as':'Account'}]});})[_0x720a('0xa')](function(_0x4e9c0c){if(_[_0x720a('0x16')](_0x4e9c0c)){throw new Error(_0x68a979+'\x20Message\x20not\x20found');}_0x355082=_0x4e9c0c;return _0x4e9c0c[_0x720a('0x76')]({'read':0x0,'readAt':null,'UserId':null});})[_0x720a('0xa')](function(){var _0x31888b={'uniqueid':_0x3b5f75+'.'+_0x355082['id']+'.'+_0x355082[_0x720a('0x75')]['id'],'FromUserId':_0x412328[_0x720a('0x34')]['id'],'type':'queue'};_0x31888b[_0x68a979+'MessageId']=_0x355082['id'];_0x31888b[_0x68a979+_0x720a('0x77')]=_0x355082[_0x720a('0x75')]['id'];_0x31888b[_0x720a('0x78')+_0x68a979+_0x4ecd22+'Id']=_0x355082['Account']['id'];_0x31888b['To'+_0x68a979+'QueueId']=_0x325e7a['id'];return db[_0x68a979+'TransferReport'][_0x720a('0x79')](_0x31888b);})[_0x720a('0xa')](function(){return respondWithRpcPromise(_0x720a('0x7a'),{'channel':_0x3b5f75,'interaction':_0x355082[_0x720a('0x75')],'message':_0x355082,'account':_0x355082[_0x720a('0x6f')],'applications':[{'id':0x0,'priority':0x1,'app':_0x720a('0x7b'),'appdata':_0x325e7a[_0x720a('0x14')]+','+(_0x355082[_0x720a('0x6f')][_0x720a('0x7c')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x720a('0xa')](respondWithResult(_0x20dd63,null))[_0x720a('0xf')](handleError(_0x20dd63,null));};};exports[_0x720a('0x7d')]=function(_0x2744f1,_0xdf2713){var _0x4fcc9f,_0x2b5d56;if(_[_0x720a('0x16')](_0x2744f1[_0x720a('0x24')][_0x720a('0x7e')])){throw new Error(_0x720a('0x7f'));}var _0x4c0b1c=_0x2744f1[_0x720a('0x24')][_0x720a('0x7e')];var _0x57837a=_[_0x720a('0x6d')](_0x4c0b1c);var _0x1aa116=_0x4c0b1c==='chat'?_0x720a('0x80'):_0x720a('0x6f');return db['User'][_0x720a('0x71')]({'raw':!![],'where':{'id':_0x2744f1['params']['id'],'role':'agent'}})[_0x720a('0xa')](function(_0x3a1a3b){if(_[_0x720a('0x16')](_0x3a1a3b)){throw new Error(_0x720a('0x81'));}_0x4fcc9f=_0x3a1a3b;return db[_0x57837a+_0x720a('0x73')][_0x720a('0x71')]({'where':{'id':_0x2744f1[_0x720a('0x24')][_0x720a('0x74')]},'include':[{'model':db[_0x57837a+_0x720a('0x75')],'as':'Interaction'},{'model':db[_0x57837a+_0x1aa116],'as':_0x720a('0x6f')}]});})[_0x720a('0xa')](function(_0x139429){if(_[_0x720a('0x16')](_0x139429)){throw new Error(_0x57837a+_0x720a('0x82'));}_0x2b5d56=_0x139429;return _0x139429['update']({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x283341={'uniqueid':_0x4c0b1c+'.'+_0x2b5d56['id']+'.'+_0x2b5d56[_0x720a('0x75')]['id'],'FromUserId':_0x2744f1[_0x720a('0x34')]['id'],'type':'agent','ToUserId':_0x4fcc9f['id']};_0x283341[_0x57837a+_0x720a('0x83')]=_0x2b5d56['id'];_0x283341[_0x57837a+'InteractionId']=_0x2b5d56[_0x720a('0x75')]['id'];_0x283341[_0x720a('0x78')+_0x57837a+_0x1aa116+'Id']=_0x2b5d56[_0x720a('0x6f')]['id'];return db[_0x57837a+_0x720a('0x84')][_0x720a('0x79')](_0x283341);})[_0x720a('0xa')](function(){return respondWithRpcPromise(_0x720a('0x7a'),{'channel':_0x4c0b1c,'interaction':_0x2b5d56[_0x720a('0x75')],'message':_0x2b5d56,'account':_0x2b5d56['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0x720a('0x3d'),'appdata':_0x4fcc9f[_0x720a('0x14')]+','+(_0x2b5d56[_0x720a('0x6f')]['agentTransferTimeout']||0x12c),'interval':_0x720a('0x85')}]},routingClient);})[_0x720a('0xa')](respondWithResult(_0xdf2713,null))[_0x720a('0xf')](handleError(_0xdf2713,null));}; \ No newline at end of file +var _0x0c38=['voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','interaction','user','hasOwnProperty','INTERACTION','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','length','MemberReport','name','interface','SIP/%s','internal','AgentCapacity','capacity','telephones','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','showSmsQueues','whatsappQueues','WhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','map','queue_id','uniq','value','indexOf','SmsQueuesWaitingInteractions','faxQueuesWaitingInteractions','capitalize','chat','Website','findOne','\x20Queue\x20not\x20found','Message','Interaction','Account','\x20Message\x20not\x20found','update','queue','From','QueueId','TransferReport','create','queueTransferTimeout','*,*,*,*','agentNotify','Channel\x20field\x20is\x20mandatory','channel','User','agent','Agent\x20not\x20found','messageId','InteractionId','Start','bluebird','moment','lodash','../../mysqldb','../../config/logger','api','client','http','request','then','error','code','message','catch','status','json','sendStatus','send','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','showVoiceQueues','VoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup'];(function(_0x98db33,_0x397f20){var _0x5ae63a=function(_0x411f1c){while(--_0x411f1c){_0x98db33['push'](_0x98db33['shift']());}};_0x5ae63a(++_0x397f20);}(_0x0c38,0xdf));var _0x80c3=function(_0x33402c,_0x1f7a7a){_0x33402c=_0x33402c-0x0;var _0x50ebd2=_0x0c38[_0x33402c];return _0x50ebd2;};'use strict';var BPromise=require(_0x80c3('0x0'));var moment=require(_0x80c3('0x1'));var _=require(_0x80c3('0x2'));var util=require('util');var db=require(_0x80c3('0x3'))['db'];var logger=require(_0x80c3('0x4'))(_0x80c3('0x5'));var jayson=require('jayson/promise');var amiClient=jayson[_0x80c3('0x6')][_0x80c3('0x7')]({'port':0x232a});var mailClient=jayson[_0x80c3('0x6')]['http']({'port':0x232b});var routingClient=jayson[_0x80c3('0x6')]['http']({'port':0x232c});function respondWithRpcPromise(_0xa55fc0,_0x316657,_0x14e98c){return new BPromise(function(_0x313297,_0x11ed3b){var _0x22e842=_0x14e98c?_0x14e98c:amiClient;return _0x22e842[_0x80c3('0x8')](_0xa55fc0,_0x316657)[_0x80c3('0x9')](function(_0x7bb0b7){if(_0x7bb0b7['error']){if(_0x7bb0b7[_0x80c3('0xa')][_0x80c3('0xb')]===0x1f4){return _0x11ed3b(_0x7bb0b7['error'][_0x80c3('0xc')]);}return _0x313297(_0x7bb0b7[_0x80c3('0xa')][_0x80c3('0xc')]);}else{_0x313297(_0x7bb0b7['result']);}})[_0x80c3('0xd')](function(_0x473c21){_0x11ed3b(_0x473c21);});});}function respondWithResult(_0x5712ad,_0x14769f){_0x14769f=_0x14769f||0xc8;return function(_0x45c4b6){if(_0x45c4b6){return _0x5712ad[_0x80c3('0xe')](_0x14769f)[_0x80c3('0xf')](_0x45c4b6);}return _0x5712ad[_0x80c3('0x10')](0x194);};}function handleError(_0x140292,_0x5be66b){_0x5be66b=_0x5be66b||0x1f4;return function(_0x413cf5){logger[_0x80c3('0xa')](_0x413cf5['stack']);if(_0x413cf5['name']){delete _0x413cf5['name'];}_0x140292[_0x80c3('0xe')](_0x5be66b)[_0x80c3('0x11')](_0x413cf5);};}function findById(_0x43af20){return function(_0x40c9b3){if(!_['isNil'](_0x43af20)&&!_[_0x80c3('0x12')](_0x40c9b3)&&!_['isNil'](_0x40c9b3[_0x80c3('0x13')])){return _[_0x80c3('0x14')](_0x40c9b3[_0x80c3('0x13')],function(_0x181ef3){return _0x181ef3['id']==_0x43af20;});}return null;};}exports[_0x80c3('0x15')]=function(_0x5d69cf,_0x41d9b6){return respondWithRpcPromise(_0x80c3('0x16'),_0x5d69cf[_0x80c3('0x17')])[_0x80c3('0x9')](respondWithResult(_0x41d9b6,null))[_0x80c3('0xd')](handleError(_0x41d9b6,null));};exports[_0x80c3('0x18')]=function(_0x1287a8,_0x4ce076){return respondWithRpcPromise(_0x80c3('0x19'),_[_0x80c3('0x1a')](_0x1287a8['query'],_0x1287a8[_0x80c3('0x1b')]))[_0x80c3('0x9')](respondWithResult(_0x4ce076,null))[_0x80c3('0xd')](handleError(_0x4ce076,null));};exports[_0x80c3('0x1c')]=function(_0x4591f4,_0x36350a){return respondWithRpcPromise(_0x80c3('0x1d'),_[_0x80c3('0x1a')](_0x4591f4['query'],_0x4591f4[_0x80c3('0x1b')]))[_0x80c3('0x9')](respondWithResult(_0x36350a,null))[_0x80c3('0xd')](handleError(_0x36350a,null));};exports[_0x80c3('0x1e')]=function(_0xbf6638,_0x21f46f){return respondWithRpcPromise('VoiceQueues',_0xbf6638[_0x80c3('0x17')])['then'](respondWithResult(_0x21f46f,null))[_0x80c3('0xd')](handleError(_0x21f46f,null));};exports[_0x80c3('0x1f')]=function(_0x357fab,_0x3684db){return respondWithRpcPromise(_0x80c3('0x20'),_0x357fab[_0x80c3('0x17')])[_0x80c3('0x9')](findById(_0x357fab[_0x80c3('0x1b')]['id']))[_0x80c3('0x9')](respondWithResult(_0x3684db,null))['catch'](handleError(_0x3684db,null));};exports[_0x80c3('0x21')]=function(_0x13edae,_0x38bbd4){return respondWithRpcPromise(_0x80c3('0x22'),_[_0x80c3('0x1a')](_0x13edae[_0x80c3('0x23')],_0x13edae[_0x80c3('0x1b')]))[_0x80c3('0x9')](respondWithResult(_0x38bbd4,null))[_0x80c3('0xd')](handleError(_0x38bbd4,null));};exports[_0x80c3('0x24')]=function(_0x4a065d,_0x4a842b){return respondWithRpcPromise('VoiceQueuesPreview',_['merge'](_0x4a065d[_0x80c3('0x17')],_0x4a065d['params']))[_0x80c3('0x9')](respondWithResult(_0x4a842b,null))['catch'](handleError(_0x4a842b,null));};exports[_0x80c3('0x25')]=function(_0x929330,_0x54962f){return respondWithRpcPromise(_0x80c3('0x26'),_0x929330[_0x80c3('0x17')])[_0x80c3('0x9')](respondWithResult(_0x54962f,null))[_0x80c3('0xd')](handleError(_0x54962f,null));};exports[_0x80c3('0x27')]=function(_0xef1d42,_0x3d7c3e){return respondWithRpcPromise(_0x80c3('0x28'),_[_0x80c3('0x1a')](_0xef1d42[_0x80c3('0x17')],_0xef1d42[_0x80c3('0x1b')]))[_0x80c3('0x9')](respondWithResult(_0x3d7c3e,null))[_0x80c3('0xd')](handleError(_0x3d7c3e,null));};exports[_0x80c3('0x29')]=function(_0x1c85bc,_0x24be6c){return respondWithRpcPromise(_0x80c3('0x2a'),_[_0x80c3('0x1a')](_0x1c85bc[_0x80c3('0x17')],_0x1c85bc[_0x80c3('0x1b')]))[_0x80c3('0x9')](respondWithResult(_0x24be6c,null))[_0x80c3('0xd')](handleError(_0x24be6c,null));};exports[_0x80c3('0x2b')]=function(_0x5748a9,_0x4fa7ba){return respondWithRpcPromise(_0x80c3('0x2c'),_[_0x80c3('0x1a')](_0x5748a9['query'],_0x5748a9[_0x80c3('0x1b')]))[_0x80c3('0x9')](respondWithResult(_0x4fa7ba,null))['catch'](handleError(_0x4fa7ba,null));};exports[_0x80c3('0x2d')]=function(_0x470baa,_0x587392){return respondWithRpcPromise(_0x80c3('0x2e'),_0x470baa['query'])[_0x80c3('0x9')](respondWithResult(_0x587392,null))[_0x80c3('0xd')](handleError(_0x587392,null));};exports[_0x80c3('0x2f')]=function(_0x384c59,_0x143f54){return respondWithRpcPromise(_0x80c3('0x30'),_0x384c59[_0x80c3('0x17')])[_0x80c3('0x9')](respondWithResult(_0x143f54,null))['catch'](handleError(_0x143f54,null));};exports[_0x80c3('0x31')]=function(_0x110afe,_0xa2f245){var _0x14d1e5;return respondWithRpcPromise(_0x80c3('0x32'),_0x110afe[_0x80c3('0x17')])[_0x80c3('0x9')](function(_0x55178a){_0x14d1e5=_0x55178a;return respondWithRpcPromise(_0x80c3('0x32'),_0x110afe['query'],routingClient);})[_0x80c3('0x9')](function(_0xa5e30b){return _['merge']({},_0xa5e30b,_0x14d1e5);})[_0x80c3('0x9')](respondWithResult(_0xa2f245,null))[_0x80c3('0xd')](handleError(_0xa2f245,null));};exports[_0x80c3('0x33')]=function(_0x2739b2,_0x439413){if(_0x2739b2[_0x80c3('0x23')]&&_0x2739b2[_0x80c3('0x23')][_0x80c3('0x34')]&&_0x2739b2['user']&&_0x2739b2[_0x80c3('0x35')]['name']){for(var _0x203d33 in _0x2739b2['body'][_0x80c3('0x34')]){if(_0x2739b2[_0x80c3('0x23')]['interaction'][_0x80c3('0x36')](_0x203d33)){db['MemberReport']['findAll']({'where':{'channel':_0x203d33,'membername':_0x2739b2[_0x80c3('0x35')]['name'],'type':_0x80c3('0x37'),'exitAt':null,'uniqueid':_0x2739b2[_0x80c3('0x23')][_0x80c3('0x34')][_0x203d33]&&_0x2739b2[_0x80c3('0x23')][_0x80c3('0x34')][_0x203d33]['length']?{'$notIn':_0x2739b2[_0x80c3('0x23')][_0x80c3('0x34')][_0x203d33]}:{'$ne':null}}})[_0x80c3('0x9')](function(_0x395acb){var _0x5d6c0f=moment()[_0x80c3('0x38')](_0x80c3('0x39'));for(var _0x8622c0=0x0,_0x40d678=_0x395acb['length'];_0x8622c0<_0x40d678;_0x8622c0+=0x1){_0x395acb[_0x8622c0][_0x80c3('0x3a')]({'exitAt':_0x5d6c0f});}});for(var _0x1f6312=0x0;_0x1f6312<_0x2739b2[_0x80c3('0x23')]['interaction'][_0x203d33][_0x80c3('0x3b')];_0x1f6312+=0x1){db[_0x80c3('0x3c')]['findOrCreate']({'where':{'channel':_0x203d33,'membername':_0x2739b2[_0x80c3('0x35')][_0x80c3('0x3d')],'type':'INTERACTION','uniqueid':_0x2739b2['body'][_0x80c3('0x34')][_0x203d33][_0x1f6312],'exitAt':null},'defaults':{'channel':_0x203d33,'membername':_0x2739b2[_0x80c3('0x35')][_0x80c3('0x3d')],'interface':_[_0x80c3('0x12')](_0x2739b2[_0x80c3('0x35')][_0x80c3('0x3e')])?util['format'](_0x80c3('0x3f'),_0x2739b2[_0x80c3('0x35')]['name']):_0x2739b2[_0x80c3('0x35')][_0x80c3('0x3e')],'type':_0x80c3('0x37'),'enterAt':moment()['format'](_0x80c3('0x39')),'role':'agent','internal':_0x2739b2[_0x80c3('0x35')][_0x80c3('0x40')],'uniqueid':_0x2739b2[_0x80c3('0x23')][_0x80c3('0x34')][_0x203d33][_0x1f6312]}});}}}}return respondWithRpcPromise(_0x80c3('0x41'),{'id':_0x2739b2['params']['id'],'capacity':_0x2739b2[_0x80c3('0x23')][_0x80c3('0x42')]},routingClient)['then'](respondWithResult(_0x439413,null))['catch'](handleError(_0x439413,null));};exports[_0x80c3('0x43')]=function(_0x395060,_0x5ae886){return respondWithRpcPromise(_0x80c3('0x44'),_0x395060[_0x80c3('0x17')])[_0x80c3('0x9')](respondWithResult(_0x5ae886,null))[_0x80c3('0xd')](handleError(_0x5ae886,null));};exports[_0x80c3('0x45')]=function(_0x4ed453,_0x16c1ab){return respondWithRpcPromise(_0x80c3('0x46'),_0x4ed453['query'])[_0x80c3('0x9')](respondWithResult(_0x16c1ab,null))['catch'](handleError(_0x16c1ab,null));};exports[_0x80c3('0x47')]=function(_0x5adfda,_0x5819a9){return respondWithRpcPromise(_0x80c3('0x48'),_0x5adfda[_0x80c3('0x17')])['then'](respondWithResult(_0x5819a9,null))[_0x80c3('0xd')](handleError(_0x5819a9,null));};exports[_0x80c3('0x49')]=function(_0x184d05,_0x5c1808){return respondWithRpcPromise(_0x80c3('0x4a'),_0x184d05[_0x80c3('0x17')],routingClient)['then'](respondWithResult(_0x5c1808,null))['catch'](handleError(_0x5c1808,null));};exports[_0x80c3('0x4b')]=function(_0x35bfb8,_0x52b1e1){return respondWithRpcPromise(_0x80c3('0x4a'),_0x35bfb8[_0x80c3('0x17')],routingClient)['then'](findById(_0x35bfb8[_0x80c3('0x1b')]['id']))[_0x80c3('0x9')](respondWithResult(_0x52b1e1,null))[_0x80c3('0xd')](handleError(_0x52b1e1,null));};exports[_0x80c3('0x4c')]=function(_0x47f820,_0x1a6569){return respondWithRpcPromise(_0x80c3('0x4d'),_0x47f820[_0x80c3('0x17')],routingClient)[_0x80c3('0x9')](respondWithResult(_0x1a6569,null))[_0x80c3('0xd')](handleError(_0x1a6569,null));};exports[_0x80c3('0x4e')]=function(_0x2016fc,_0x5d09c7){return respondWithRpcPromise(_0x80c3('0x4d'),_0x2016fc[_0x80c3('0x17')],routingClient)[_0x80c3('0x9')](findById(_0x2016fc[_0x80c3('0x1b')]['id']))[_0x80c3('0x9')](respondWithResult(_0x5d09c7,null))[_0x80c3('0xd')](handleError(_0x5d09c7,null));};exports['mailAccounts']=function(_0x102565,_0x12bab7){return respondWithRpcPromise(_0x80c3('0x4f'),_0x102565[_0x80c3('0x17')],mailClient)[_0x80c3('0x9')](respondWithResult(_0x12bab7,null))[_0x80c3('0xd')](handleError(_0x12bab7,null));};exports[_0x80c3('0x50')]=function(_0x2b60f4,_0xb7fe4a){return respondWithRpcPromise(_0x80c3('0x51'),_0x2b60f4[_0x80c3('0x17')],routingClient)['then'](respondWithResult(_0xb7fe4a,null))[_0x80c3('0xd')](handleError(_0xb7fe4a,null));};exports[_0x80c3('0x52')]=function(_0x3bdb70,_0x52453c){return respondWithRpcPromise(_0x80c3('0x51'),_0x3bdb70[_0x80c3('0x17')],routingClient)[_0x80c3('0x9')](findById(_0x3bdb70[_0x80c3('0x1b')]['id']))[_0x80c3('0x9')](respondWithResult(_0x52453c,null))['catch'](handleError(_0x52453c,null));};exports['smsQueues']=function(_0x52f4fd,_0x575566){return respondWithRpcPromise('SmsQueues',_0x52f4fd['query'],routingClient)[_0x80c3('0x9')](respondWithResult(_0x575566,null))['catch'](handleError(_0x575566,null));};exports[_0x80c3('0x53')]=function(_0x43f372,_0xf085b6){return respondWithRpcPromise('SmsQueues',_0x43f372['query'],routingClient)[_0x80c3('0x9')](findById(_0x43f372['params']['id']))[_0x80c3('0x9')](respondWithResult(_0xf085b6,null))[_0x80c3('0xd')](handleError(_0xf085b6,null));};exports[_0x80c3('0x54')]=function(_0x2e1390,_0x44f6a9){return respondWithRpcPromise(_0x80c3('0x55'),_0x2e1390[_0x80c3('0x17')],routingClient)[_0x80c3('0x9')](respondWithResult(_0x44f6a9,null))[_0x80c3('0xd')](handleError(_0x44f6a9,null));};exports['showWhatsappQueues']=function(_0x2761cf,_0x439c9f){return respondWithRpcPromise(_0x80c3('0x55'),_0x2761cf[_0x80c3('0x17')],routingClient)[_0x80c3('0x9')](findById(_0x2761cf[_0x80c3('0x1b')]['id']))[_0x80c3('0x9')](respondWithResult(_0x439c9f,null))['catch'](handleError(_0x439c9f,null));};exports[_0x80c3('0x56')]=function(_0xdf0b7,_0x3aa3f0){return respondWithRpcPromise(_0x80c3('0x57'),_0xdf0b7[_0x80c3('0x17')],routingClient)['then'](respondWithResult(_0x3aa3f0,null))[_0x80c3('0xd')](handleError(_0x3aa3f0,null));};exports[_0x80c3('0x58')]=function(_0x1f383e,_0x17e521){return respondWithRpcPromise(_0x80c3('0x57'),_0x1f383e['query'],routingClient)['then'](findById(_0x1f383e[_0x80c3('0x1b')]['id']))[_0x80c3('0x9')](respondWithResult(_0x17e521,null))[_0x80c3('0xd')](handleError(_0x17e521,null));};exports[_0x80c3('0x59')]=function(_0x502182,_0x129c19){return respondWithRpcPromise(_0x80c3('0x5a'),_0x502182['query'])['then'](respondWithResult(_0x129c19,null))[_0x80c3('0xd')](handleError(_0x129c19,null));};exports[_0x80c3('0x5b')]=function(_0x431be3,_0x386e29){return respondWithRpcPromise(_0x80c3('0x5c'),_0x431be3[_0x80c3('0x17')],routingClient)[_0x80c3('0x9')](respondWithResult(_0x386e29,null))[_0x80c3('0xd')](handleError(_0x386e29,null));};exports[_0x80c3('0x5d')]=function(_0x2a7149,_0x8ad5c0){return respondWithRpcPromise(_0x80c3('0x5e'),_0x2a7149['query'],routingClient)[_0x80c3('0x9')](respondWithResult(_0x8ad5c0,null))[_0x80c3('0xd')](handleError(_0x8ad5c0,null));};exports[_0x80c3('0x5f')]=function(_0x71da8a,_0x4fbff8){return respondWithRpcPromise(_0x80c3('0x60'),_0x71da8a[_0x80c3('0x17')],routingClient)[_0x80c3('0x9')](respondWithResult(_0x4fbff8,null))[_0x80c3('0xd')](handleError(_0x4fbff8,null));};exports[_0x80c3('0x61')]=function(_0x3c9455,_0x251ad9){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x3c9455['query'],routingClient)[_0x80c3('0x9')](function(_0x5251e0){if(_0x3c9455['query'][_0x80c3('0x62')]!==undefined){var _0x58a474=_(_0x5251e0[_0x80c3('0x13')])[_0x80c3('0x63')]([_0x3c9455[_0x80c3('0x17')][_0x80c3('0x62')],_0x3c9455[_0x80c3('0x1b')]['id']])[_0x80c3('0x64')](_0x80c3('0x65'))[_0x80c3('0x66')]()[_0x80c3('0x67')]();return _0x5251e0[_0x80c3('0x13')][_0x80c3('0x63')](function(_0x5da03a){return _0x58a474[_0x80c3('0x68')](_0x5da03a['queue_id'])>-0x1;});}else{return _0x5251e0[_0x80c3('0x13')][_0x80c3('0x63')](function(_0x35f1ad){return _0x35f1ad['queue_id']===parseInt(_0x3c9455['params']['id']);});}})[_0x80c3('0x9')](respondWithResult(_0x251ad9,null))[_0x80c3('0xd')](handleError(_0x251ad9,null));};exports['smsQueuesWaitingInteractions']=function(_0x4a98b0,_0x5398c0){return respondWithRpcPromise(_0x80c3('0x69'),_0x4a98b0[_0x80c3('0x17')],routingClient)[_0x80c3('0x9')](respondWithResult(_0x5398c0,null))[_0x80c3('0xd')](handleError(_0x5398c0,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x4ee9af,_0x5bd4b8){return respondWithRpcPromise('WhatsappQueuesWaitingInteractions',_0x4ee9af['query'],routingClient)[_0x80c3('0x9')](respondWithResult(_0x5bd4b8,null))[_0x80c3('0xd')](handleError(_0x5bd4b8,null));};exports[_0x80c3('0x6a')]=function(_0x3a7ab0,_0x15ca2c){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x3a7ab0[_0x80c3('0x17')],routingClient)['then'](respondWithResult(_0x15ca2c,null))[_0x80c3('0xd')](handleError(_0x15ca2c,null));};exports['queueNotify']=function(_0x337256){return function(_0x369882,_0x13f371){var _0x3e0516,_0x2c495c;var _0x579de1=_[_0x80c3('0x6b')](_0x337256);var _0x32cab6=_0x337256===_0x80c3('0x6c')?_0x80c3('0x6d'):'Account';return db[_0x579de1+'Queue'][_0x80c3('0x6e')]({'raw':!![],'where':{'id':_0x369882[_0x80c3('0x1b')]['id']}})[_0x80c3('0x9')](function(_0x13d435){if(_[_0x80c3('0x12')](_0x13d435)){throw new Error(_0x579de1+_0x80c3('0x6f'));}_0x3e0516=_0x13d435;return db[_0x579de1+_0x80c3('0x70')][_0x80c3('0x6e')]({'where':{'id':_0x369882['body']['messageId']},'include':[{'model':db[_0x579de1+'Interaction'],'as':_0x80c3('0x71')},{'model':db[_0x579de1+_0x32cab6],'as':_0x80c3('0x72')}]});})[_0x80c3('0x9')](function(_0x737486){if(_[_0x80c3('0x12')](_0x737486)){throw new Error(_0x579de1+_0x80c3('0x73'));}_0x2c495c=_0x737486;return _0x737486[_0x80c3('0x74')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x333b24={'uniqueid':_0x337256+'.'+_0x2c495c['id']+'.'+_0x2c495c[_0x80c3('0x71')]['id'],'FromUserId':_0x369882[_0x80c3('0x35')]['id'],'type':_0x80c3('0x75')};_0x333b24[_0x579de1+'MessageId']=_0x2c495c['id'];_0x333b24[_0x579de1+'InteractionId']=_0x2c495c[_0x80c3('0x71')]['id'];_0x333b24[_0x80c3('0x76')+_0x579de1+_0x32cab6+'Id']=_0x2c495c['Account']['id'];_0x333b24['To'+_0x579de1+_0x80c3('0x77')]=_0x3e0516['id'];return db[_0x579de1+_0x80c3('0x78')][_0x80c3('0x79')](_0x333b24);})[_0x80c3('0x9')](function(){return respondWithRpcPromise('Start',{'channel':_0x337256,'interaction':_0x2c495c[_0x80c3('0x71')],'message':_0x2c495c,'account':_0x2c495c['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0x80c3('0x75'),'appdata':_0x3e0516[_0x80c3('0x3d')]+','+(_0x2c495c[_0x80c3('0x72')][_0x80c3('0x7a')]||0x12c),'interval':_0x80c3('0x7b')}]},routingClient);})[_0x80c3('0x9')](respondWithResult(_0x13f371,null))[_0x80c3('0xd')](handleError(_0x13f371,null));};};exports[_0x80c3('0x7c')]=function(_0x171a07,_0x5391d5){var _0x4f371c,_0x126232;if(_[_0x80c3('0x12')](_0x171a07['body']['channel'])){throw new Error(_0x80c3('0x7d'));}var _0x57128b=_0x171a07['body'][_0x80c3('0x7e')];var _0xe74c5=_[_0x80c3('0x6b')](_0x57128b);var _0x341477=_0x57128b===_0x80c3('0x6c')?'Website':_0x80c3('0x72');return db[_0x80c3('0x7f')][_0x80c3('0x6e')]({'raw':!![],'where':{'id':_0x171a07[_0x80c3('0x1b')]['id'],'role':_0x80c3('0x80')}})[_0x80c3('0x9')](function(_0x11f07d){if(_[_0x80c3('0x12')](_0x11f07d)){throw new Error(_0x80c3('0x81'));}_0x4f371c=_0x11f07d;return db[_0xe74c5+'Message'][_0x80c3('0x6e')]({'where':{'id':_0x171a07[_0x80c3('0x23')][_0x80c3('0x82')]},'include':[{'model':db[_0xe74c5+_0x80c3('0x71')],'as':'Interaction'},{'model':db[_0xe74c5+_0x341477],'as':_0x80c3('0x72')}]});})[_0x80c3('0x9')](function(_0x42f009){if(_[_0x80c3('0x12')](_0x42f009)){throw new Error(_0xe74c5+_0x80c3('0x73'));}_0x126232=_0x42f009;return _0x42f009[_0x80c3('0x74')]({'read':0x0,'readAt':null,'UserId':null});})[_0x80c3('0x9')](function(){var _0x3ffa79={'uniqueid':_0x57128b+'.'+_0x126232['id']+'.'+_0x126232[_0x80c3('0x71')]['id'],'FromUserId':_0x171a07[_0x80c3('0x35')]['id'],'type':'agent','ToUserId':_0x4f371c['id']};_0x3ffa79[_0xe74c5+'MessageId']=_0x126232['id'];_0x3ffa79[_0xe74c5+_0x80c3('0x83')]=_0x126232['Interaction']['id'];_0x3ffa79[_0x80c3('0x76')+_0xe74c5+_0x341477+'Id']=_0x126232[_0x80c3('0x72')]['id'];return db[_0xe74c5+_0x80c3('0x78')]['create'](_0x3ffa79);})[_0x80c3('0x9')](function(){return respondWithRpcPromise(_0x80c3('0x84'),{'channel':_0x57128b,'interaction':_0x126232[_0x80c3('0x71')],'message':_0x126232,'account':_0x126232[_0x80c3('0x72')],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x4f371c[_0x80c3('0x3d')]+','+(_0x126232['Account']['agentTransferTimeout']||0x12c),'interval':_0x80c3('0x7b')}]},routingClient);})[_0x80c3('0x9')](respondWithResult(_0x5391d5,null))['catch'](handleError(_0x5391d5,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 06507cb..028d6b9 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 _0x94f4=['delete','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','isAuthenticated','index','get','/:id','/:id/run','run','post','create','update'];(function(_0x5107a3,_0x402944){var _0x1ebb36=function(_0x4b0cb9){while(--_0x4b0cb9){_0x5107a3['push'](_0x5107a3['shift']());}};_0x1ebb36(++_0x402944);}(_0x94f4,0x132));var _0x494f=function(_0x24ab91,_0x371c42){_0x24ab91=_0x24ab91-0x0;var _0x2b414e=_0x94f4[_0x24ab91];return _0x2b414e;};'use strict';var multer=require(_0x494f('0x0'));var util=require(_0x494f('0x1'));var path=require('path');var timeout=require(_0x494f('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x494f('0x3'));var auth=require(_0x494f('0x4'));var interaction=require(_0x494f('0x5'));var config=require(_0x494f('0x6'));var controller=require(_0x494f('0x7'));router['get']('/',auth[_0x494f('0x8')](),controller[_0x494f('0x9')]);router[_0x494f('0xa')](_0x494f('0xb'),auth['isAuthenticated'](),controller['show']);router['get'](_0x494f('0xc'),auth[_0x494f('0x8')](),controller[_0x494f('0xd')]);router[_0x494f('0xe')]('/',auth[_0x494f('0x8')](),controller[_0x494f('0xf')]);router['put'](_0x494f('0xb'),auth[_0x494f('0x8')](),controller[_0x494f('0x10')]);router[_0x494f('0x11')](_0x494f('0xb'),auth[_0x494f('0x8')](),controller['destroy']);module[_0x494f('0x12')]=router; \ No newline at end of file +var _0x8558=['isAuthenticated','run','post','put','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','show','/:id/run'];(function(_0x3518b6,_0x1d6005){var _0x55a221=function(_0x25ebfa){while(--_0x25ebfa){_0x3518b6['push'](_0x3518b6['shift']());}};_0x55a221(++_0x1d6005);}(_0x8558,0x12e));var _0x8855=function(_0x2aaa3e,_0x4d3b4f){_0x2aaa3e=_0x2aaa3e-0x0;var _0x120065=_0x8558[_0x2aaa3e];return _0x120065;};'use strict';var multer=require('multer');var util=require(_0x8855('0x0'));var path=require('path');var timeout=require(_0x8855('0x1'));var express=require(_0x8855('0x2'));var router=express[_0x8855('0x3')]();var fs_extra=require(_0x8855('0x4'));var auth=require(_0x8855('0x5'));var interaction=require(_0x8855('0x6'));var config=require(_0x8855('0x7'));var controller=require('./schedule.controller');router[_0x8855('0x8')]('/',auth['isAuthenticated'](),controller[_0x8855('0x9')]);router[_0x8855('0x8')](_0x8855('0xa'),auth['isAuthenticated'](),controller[_0x8855('0xb')]);router['get'](_0x8855('0xc'),auth[_0x8855('0xd')](),controller[_0x8855('0xe')]);router[_0x8855('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x8855('0x10')](_0x8855('0xa'),auth[_0x8855('0xd')](),controller[_0x8855('0x11')]);router[_0x8855('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x8855('0x13')]);module[_0x8855('0x14')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 59d3fa8..dda5488 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 _0x1f25=['pdf','csv','custom','default','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','quarters','months','days'];(function(_0x56c079,_0x4818f7){var _0x4da710=function(_0x3605e0){while(--_0x3605e0){_0x56c079['push'](_0x56c079['shift']());}};_0x4da710(++_0x4818f7);}(_0x1f25,0x185));var _0x51f2=function(_0xa3d981,_0x580a4b){_0xa3d981=_0xa3d981-0x0;var _0x22af78=_0x1f25[_0xa3d981];return _0x22af78;};'use strict';var Sequelize=require(_0x51f2('0x0'));module[_0x51f2('0x1')]={'name':{'type':Sequelize[_0x51f2('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x51f2('0x2')]},'active':{'type':Sequelize[_0x51f2('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x51f2('0x2')],'allowNull':![],'defaultValue':_0x51f2('0x4')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0x51f2('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x51f2('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x51f2('0x7')]('years',_0x51f2('0x8'),_0x51f2('0x9'),'weeks',_0x51f2('0xa'),'hours','minutes'),'allowNull':![],'defaultValue':_0x51f2('0xa')},'output':{'type':Sequelize[_0x51f2('0x7')]('csv',_0x51f2('0xb'),'xlsx'),'allowNull':![],'defaultValue':_0x51f2('0xc')},'type':{'type':Sequelize[_0x51f2('0x7')](_0x51f2('0xd'),_0x51f2('0xe')),'allowNull':![],'defaultValue':_0x51f2('0xd')},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x51f2('0x2')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0x51f2('0xf')]},'sendIfEmpty':{'type':Sequelize[_0x51f2('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x04c2=['minutes','csv','xlsx','custom','default','TEXT','STRING','BOOLEAN','DATE','INTEGER','ENUM','quarters','days','hours'];(function(_0x48d69b,_0x796252){var _0x4485e1=function(_0x1e924a){while(--_0x1e924a){_0x48d69b['push'](_0x48d69b['shift']());}};_0x4485e1(++_0x796252);}(_0x04c2,0xca));var _0x204c=function(_0x595505,_0x56cc58){_0x595505=_0x595505-0x0;var _0x4d62d7=_0x04c2[_0x595505];return _0x4d62d7;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x204c('0x0')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x204c('0x1')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x204c('0x0')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize[_0x204c('0x2')],'allowNull':![]},'endAt':{'type':Sequelize[_0x204c('0x2')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x204c('0x3')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x204c('0x4')]('years',_0x204c('0x5'),'months','weeks',_0x204c('0x6'),_0x204c('0x7'),_0x204c('0x8')),'allowNull':![],'defaultValue':_0x204c('0x6')},'output':{'type':Sequelize[_0x204c('0x4')](_0x204c('0x9'),'pdf',_0x204c('0xa')),'allowNull':![],'defaultValue':_0x204c('0x9')},'type':{'type':Sequelize[_0x204c('0x4')](_0x204c('0xb'),_0x204c('0xc')),'allowNull':![],'defaultValue':_0x204c('0xb')},'sendMail':{'type':Sequelize[_0x204c('0x1')],'defaultValue':![]},'email':{'type':Sequelize[_0x204c('0x0')]},'cc':{'type':Sequelize[_0x204c('0xd')]},'bcc':{'type':Sequelize[_0x204c('0xd')]},'sendIfEmpty':{'type':Sequelize[_0x204c('0x1')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 56b2918..6220917 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 _0x3109=['request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','destroy','get','Scheduler','UserProfileResource','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','Schedule','include','findAll','rows','show','includeAll','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','params','run','../../config/schedule','zip-dir','fast-json-patch'];(function(_0x5ec565,_0x17a2ca){var _0x3a719a=function(_0x19524e){while(--_0x19524e){_0x5ec565['push'](_0x5ec565['shift']());}};_0x3a719a(++_0x17a2ca);}(_0x3109,0xf4));var _0x9310=function(_0x6ab731,_0xd35268){_0x6ab731=_0x6ab731-0x0;var _0x306e51=_0x3109[_0x6ab731];return _0x306e51;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9310('0x0'));var jsonpatch=require(_0x9310('0x1'));var rp=require(_0x9310('0x2'));var moment=require(_0x9310('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x9310('0x4'));var util=require(_0x9310('0x5'));var path=require(_0x9310('0x6'));var sox=require(_0x9310('0x7'));var csv=require(_0x9310('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9310('0x9'));var _=require('lodash');var squel=require(_0x9310('0xa'));var crypto=require(_0x9310('0xb'));var jsforce=require(_0x9310('0xc'));var deskjs=require(_0x9310('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9310('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9310('0xf'));var qs=require(_0x9310('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9310('0x11'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x9310('0x12'));var db=require(_0x9310('0x13'))['db'];function respondWithStatusCode(_0x40c5a8,_0x4e6f6f){_0x4e6f6f=_0x4e6f6f||0xcc;return function(_0x343862){if(_0x343862){return _0x40c5a8[_0x9310('0x14')](_0x4e6f6f);}return _0x40c5a8[_0x9310('0x15')](_0x4e6f6f)[_0x9310('0x16')]();};}function respondWithResult(_0x3ee568,_0x16899b){_0x16899b=_0x16899b||0xc8;return function(_0x4982a9){if(_0x4982a9){return _0x3ee568[_0x9310('0x15')](_0x16899b)[_0x9310('0x17')](_0x4982a9);}};}function respondWithFilteredResult(_0x56be00,_0x1ca9fa){return function(_0x39b678){if(_0x39b678){var _0x384d25=typeof _0x1ca9fa[_0x9310('0x18')]===_0x9310('0x19')&&typeof _0x1ca9fa['limit']===_0x9310('0x19');var _0x38cb6d=_0x39b678[_0x9310('0x1a')];var _0x4cde4d=_0x384d25?0x0:_0x1ca9fa[_0x9310('0x18')];var _0x5f9c7e=_0x384d25?_0x39b678['count']:_0x1ca9fa['offset']+_0x1ca9fa[_0x9310('0x1b')];var _0x34eb19;if(_0x5f9c7e>=_0x38cb6d){_0x5f9c7e=_0x38cb6d;_0x34eb19=0xc8;}else{_0x34eb19=0xce;}_0x56be00['status'](_0x34eb19);return _0x56be00[_0x9310('0x1c')]('Content-Range',_0x4cde4d+'-'+_0x5f9c7e+'/'+_0x38cb6d)[_0x9310('0x17')](_0x39b678);}return null;};}function patchUpdates(_0x5eb071){return function(_0x18e159){try{jsonpatch[_0x9310('0x1d')](_0x18e159,_0x5eb071,!![]);}catch(_0x2fad34){return BPromise['reject'](_0x2fad34);}return _0x18e159[_0x9310('0x1e')]();};}function saveUpdates(_0x2259b3,_0x668f2a){return function(_0x3a0dad){if(_0x3a0dad){return _0x3a0dad[_0x9310('0x1f')](_0x2259b3)[_0x9310('0x20')](function(_0x54c308){return _0x54c308;});}return null;};}function removeEntity(_0x1e9b0,_0x406dd1){return function(_0x219a51){if(_0x219a51){return _0x219a51[_0x9310('0x21')]()['then'](function(){var _0xb9a157=_0x219a51[_0x9310('0x22')]({'plain':!![]});var _0x21e04d=_0x9310('0x23');return db[_0x9310('0x24')][_0x9310('0x21')]({'where':{'type':_0x21e04d,'resourceId':_0xb9a157['id']}})['then'](function(){return _0x219a51;});})[_0x9310('0x20')](function(){_0x1e9b0['status'](0xcc)[_0x9310('0x16')]();});}};}function handleEntityNotFound(_0x3995b1,_0x1e365c){return function(_0x5d26f6){if(!_0x5d26f6){_0x3995b1[_0x9310('0x14')](0x194);}return _0x5d26f6;};}function handleError(_0x275694,_0x2c58a4){_0x2c58a4=_0x2c58a4||0x1f4;return function(_0x336636){logger[_0x9310('0x25')](_0x336636[_0x9310('0x26')]);if(_0x336636[_0x9310('0x27')]){delete _0x336636[_0x9310('0x27')];}_0x275694[_0x9310('0x15')](_0x2c58a4)['send'](_0x336636);};}exports[_0x9310('0x28')]=function(_0x2d86ee,_0x39a487){var _0x2cc51d={},_0x23d246={},_0x454a6f={'count':0x0,'rows':[]};var _0x42fedd=_[_0x9310('0x29')](db['Schedule'][_0x9310('0x2a')],function(_0xa72945){return{'name':_0xa72945[_0x9310('0x2b')],'type':_0xa72945[_0x9310('0x2c')][_0x9310('0x2d')]};});_0x23d246[_0x9310('0x2e')]=_[_0x9310('0x29')](_0x42fedd,_0x9310('0x27'));_0x23d246['query']=_[_0x9310('0x2f')](_0x2d86ee['query']);_0x23d246[_0x9310('0x30')]=_[_0x9310('0x31')](_0x23d246[_0x9310('0x2e')],_0x23d246[_0x9310('0x32')]);_0x2cc51d['attributes']=_['intersection'](_0x23d246[_0x9310('0x2e')],qs[_0x9310('0x33')](_0x2d86ee[_0x9310('0x32')][_0x9310('0x33')]));_0x2cc51d['attributes']=_0x2cc51d[_0x9310('0x34')]['length']?_0x2cc51d['attributes']:_0x23d246[_0x9310('0x2e')];if(!_0x2d86ee[_0x9310('0x32')][_0x9310('0x35')](_0x9310('0x36'))){_0x2cc51d[_0x9310('0x1b')]=qs[_0x9310('0x1b')](_0x2d86ee[_0x9310('0x32')][_0x9310('0x1b')]);_0x2cc51d['offset']=qs[_0x9310('0x18')](_0x2d86ee['query']['offset']);}_0x2cc51d[_0x9310('0x37')]=qs['sort'](_0x2d86ee[_0x9310('0x32')][_0x9310('0x38')]);_0x2cc51d[_0x9310('0x39')]=qs[_0x9310('0x30')](_[_0x9310('0x3a')](_0x2d86ee[_0x9310('0x32')],_0x23d246[_0x9310('0x30')]),_0x42fedd);if(_0x2d86ee[_0x9310('0x32')]['filter']){_0x2cc51d[_0x9310('0x39')]=_['merge'](_0x2cc51d[_0x9310('0x39')],{'$or':_[_0x9310('0x29')](_0x42fedd,function(_0x2e5b3c){if(_0x2e5b3c[_0x9310('0x2c')]!==_0x9310('0x3b')){var _0x535651={};_0x535651[_0x2e5b3c[_0x9310('0x27')]]={'$like':'%'+_0x2d86ee[_0x9310('0x32')][_0x9310('0x3c')]+'%'};return _0x535651;}})});}_0x2cc51d=_[_0x9310('0x3d')]({},_0x2cc51d,_0x2d86ee[_0x9310('0x3e')]);var _0x52284d={'where':_0x2cc51d[_0x9310('0x39')]};return db[_0x9310('0x3f')][_0x9310('0x1a')](_0x52284d)[_0x9310('0x20')](function(_0x4af4c9){_0x454a6f['count']=_0x4af4c9;if(_0x2d86ee[_0x9310('0x32')]['includeAll']){_0x2cc51d[_0x9310('0x40')]=[{'all':!![]}];}return db[_0x9310('0x3f')][_0x9310('0x41')](_0x2cc51d);})['then'](function(_0x479e31){_0x454a6f[_0x9310('0x42')]=_0x479e31;return _0x454a6f;})[_0x9310('0x20')](respondWithFilteredResult(_0x39a487,_0x2cc51d))['catch'](handleError(_0x39a487,null));};exports[_0x9310('0x43')]=function(_0x2b48e8,_0x2a1a6a){var _0x204624={'raw':![],'where':{'id':_0x2b48e8['params']['id']}},_0x3ecc57={};_0x3ecc57[_0x9310('0x2e')]=_[_0x9310('0x2f')](db[_0x9310('0x3f')]['rawAttributes']);_0x3ecc57['query']=_[_0x9310('0x2f')](_0x2b48e8[_0x9310('0x32')]);_0x3ecc57[_0x9310('0x30')]=_[_0x9310('0x31')](_0x3ecc57[_0x9310('0x2e')],_0x3ecc57[_0x9310('0x32')]);_0x204624['attributes']=_[_0x9310('0x31')](_0x3ecc57[_0x9310('0x2e')],qs[_0x9310('0x33')](_0x2b48e8[_0x9310('0x32')]['fields']));_0x204624['attributes']=_0x204624[_0x9310('0x34')]['length']?_0x204624['attributes']:_0x3ecc57['model'];if(_0x2b48e8[_0x9310('0x32')][_0x9310('0x44')]){_0x204624[_0x9310('0x40')]=[{'all':!![]}];}_0x204624=_[_0x9310('0x3d')]({},_0x204624,_0x2b48e8[_0x9310('0x3e')]);return db[_0x9310('0x3f')]['find'](_0x204624)[_0x9310('0x20')](handleEntityNotFound(_0x2a1a6a,null))[_0x9310('0x20')](respondWithResult(_0x2a1a6a,null))[_0x9310('0x45')](handleError(_0x2a1a6a,null));};exports[_0x9310('0x46')]=function(_0x1cdf01,_0x121e8c){return db[_0x9310('0x3f')][_0x9310('0x46')](_0x1cdf01[_0x9310('0x47')],{})[_0x9310('0x20')](function(_0x4c5319){var _0x255317=_0x1cdf01[_0x9310('0x48')][_0x9310('0x22')]({'plain':!![]});if(!_0x255317)throw new Error(_0x9310('0x49'));if(_0x255317[_0x9310('0x4a')]==='user'){var _0x259c30=_0x4c5319[_0x9310('0x22')]({'plain':!![]});var _0x5dc679='Scheduler';return db[_0x9310('0x4b')][_0x9310('0x4c')]({'where':{'name':_0x5dc679,'userProfileId':_0x255317[_0x9310('0x4d')]},'raw':!![]})[_0x9310('0x20')](function(_0x5c2f8){if(_0x5c2f8&&_0x5c2f8[_0x9310('0x4e')]===0x0){return db['UserProfileResource']['create']({'name':_0x259c30[_0x9310('0x27')],'resourceId':_0x259c30['id'],'type':_0x5c2f8['name'],'sectionId':_0x5c2f8['id']},{})[_0x9310('0x20')](function(){return _0x4c5319;});}else{return _0x4c5319;}})['catch'](function(_0x356025){logger[_0x9310('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x356025);throw _0x356025;});}return _0x4c5319;})[_0x9310('0x20')](respondWithResult(_0x121e8c,0xc9))[_0x9310('0x45')](handleError(_0x121e8c,null));};exports['update']=function(_0x26c573,_0x729585){if(_0x26c573[_0x9310('0x47')]['id']){delete _0x26c573[_0x9310('0x47')]['id'];}return db[_0x9310('0x3f')]['find']({'where':{'id':_0x26c573[_0x9310('0x4f')]['id']}})[_0x9310('0x20')](handleEntityNotFound(_0x729585,null))[_0x9310('0x20')](saveUpdates(_0x26c573[_0x9310('0x47')],null))[_0x9310('0x20')](respondWithResult(_0x729585,null))[_0x9310('0x45')](handleError(_0x729585,null));};exports[_0x9310('0x21')]=function(_0x547911,_0x397a75){return db[_0x9310('0x3f')][_0x9310('0x4c')]({'where':{'id':_0x547911[_0x9310('0x4f')]['id']}})[_0x9310('0x20')](handleEntityNotFound(_0x397a75,null))[_0x9310('0x20')](removeEntity(_0x397a75,null))[_0x9310('0x45')](handleError(_0x397a75,null));};exports[_0x9310('0x50')]=function(_0x77ed7a,_0x501489,_0x42f8fb){var _0xb0ef6b=require(_0x9310('0x51'));return db['Schedule'][_0x9310('0x4c')]({'where':{'id':_0x77ed7a['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x501489,null))['then'](function(){_0xb0ef6b['run'](_0x77ed7a[_0x9310('0x4f')]['id']);})[_0x9310('0x20')](respondWithStatusCode(_0x501489,null))[_0x9310('0x45')](handleError(_0x501489,null));}; \ No newline at end of file +var _0xcfe1=['run','../../config/schedule','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','then','destroy','get','Scheduler','UserProfileResource','error','stack','name','Schedule','fieldName','key','model','map','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body'];(function(_0x34d387,_0xdfae87){var _0xdff3b0=function(_0x295861){while(--_0x295861){_0x34d387['push'](_0x34d387['shift']());}};_0xdff3b0(++_0xdfae87);}(_0xcfe1,0x107));var _0x1cfe=function(_0x312a7f,_0x509e83){_0x312a7f=_0x312a7f-0x0;var _0x2fb5ba=_0xcfe1[_0x312a7f];return _0x2fb5ba;};'use strict';var emlformat=require(_0x1cfe('0x0'));var rimraf=require(_0x1cfe('0x1'));var zipdir=require(_0x1cfe('0x2'));var jsonpatch=require(_0x1cfe('0x3'));var rp=require('request-promise');var moment=require(_0x1cfe('0x4'));var BPromise=require(_0x1cfe('0x5'));var Mustache=require(_0x1cfe('0x6'));var util=require(_0x1cfe('0x7'));var path=require(_0x1cfe('0x8'));var sox=require(_0x1cfe('0x9'));var csv=require(_0x1cfe('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1cfe('0xb'));var _=require(_0x1cfe('0xc'));var squel=require(_0x1cfe('0xd'));var crypto=require('crypto');var jsforce=require(_0x1cfe('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x1cfe('0xa'));var querystring=require(_0x1cfe('0xf'));var Papa=require(_0x1cfe('0x10'));var Redis=require(_0x1cfe('0x11'));var authService=require(_0x1cfe('0x12'));var qs=require(_0x1cfe('0x13'));var as=require(_0x1cfe('0x14'));var hardwareService=require(_0x1cfe('0x15'));var logger=require(_0x1cfe('0x16'))(_0x1cfe('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1cfe('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1dd537,_0x168e7f){_0x168e7f=_0x168e7f||0xcc;return function(_0x428b96){if(_0x428b96){return _0x1dd537[_0x1cfe('0x19')](_0x168e7f);}return _0x1dd537[_0x1cfe('0x1a')](_0x168e7f)[_0x1cfe('0x1b')]();};}function respondWithResult(_0x107e68,_0x1b9d96){_0x1b9d96=_0x1b9d96||0xc8;return function(_0x2ba162){if(_0x2ba162){return _0x107e68['status'](_0x1b9d96)[_0x1cfe('0x1c')](_0x2ba162);}};}function respondWithFilteredResult(_0x153cd7,_0x5a2ca8){return function(_0x2f1915){if(_0x2f1915){var _0x5aac3f=typeof _0x5a2ca8[_0x1cfe('0x1d')]===_0x1cfe('0x1e')&&typeof _0x5a2ca8['limit']===_0x1cfe('0x1e');var _0x3cfa82=_0x2f1915[_0x1cfe('0x1f')];var _0x32f7c7=_0x5aac3f?0x0:_0x5a2ca8[_0x1cfe('0x1d')];var _0x15257f=_0x5aac3f?_0x2f1915[_0x1cfe('0x1f')]:_0x5a2ca8[_0x1cfe('0x1d')]+_0x5a2ca8[_0x1cfe('0x20')];var _0x18aaa9;if(_0x15257f>=_0x3cfa82){_0x15257f=_0x3cfa82;_0x18aaa9=0xc8;}else{_0x18aaa9=0xce;}_0x153cd7['status'](_0x18aaa9);return _0x153cd7[_0x1cfe('0x21')](_0x1cfe('0x22'),_0x32f7c7+'-'+_0x15257f+'/'+_0x3cfa82)[_0x1cfe('0x1c')](_0x2f1915);}return null;};}function patchUpdates(_0x332b30){return function(_0x3d5d98){try{jsonpatch['apply'](_0x3d5d98,_0x332b30,!![]);}catch(_0x50aa53){return BPromise[_0x1cfe('0x23')](_0x50aa53);}return _0x3d5d98[_0x1cfe('0x24')]();};}function saveUpdates(_0x2bd2f7,_0x1a5c54){return function(_0x3195dc){if(_0x3195dc){return _0x3195dc['update'](_0x2bd2f7)[_0x1cfe('0x25')](function(_0x4e1c39){return _0x4e1c39;});}return null;};}function removeEntity(_0x158d70,_0xc51611){return function(_0x553890){if(_0x553890){return _0x553890[_0x1cfe('0x26')]()['then'](function(){var _0x4bab7e=_0x553890[_0x1cfe('0x27')]({'plain':!![]});var _0x5c0666=_0x1cfe('0x28');return db[_0x1cfe('0x29')][_0x1cfe('0x26')]({'where':{'type':_0x5c0666,'resourceId':_0x4bab7e['id']}})['then'](function(){return _0x553890;});})['then'](function(){_0x158d70[_0x1cfe('0x1a')](0xcc)[_0x1cfe('0x1b')]();});}};}function handleEntityNotFound(_0x23f94a,_0x207c4d){return function(_0x58132c){if(!_0x58132c){_0x23f94a[_0x1cfe('0x19')](0x194);}return _0x58132c;};}function handleError(_0x3386cb,_0x53460e){_0x53460e=_0x53460e||0x1f4;return function(_0x5ee2f2){logger[_0x1cfe('0x2a')](_0x5ee2f2[_0x1cfe('0x2b')]);if(_0x5ee2f2[_0x1cfe('0x2c')]){delete _0x5ee2f2['name'];}_0x3386cb[_0x1cfe('0x1a')](_0x53460e)['send'](_0x5ee2f2);};}exports['index']=function(_0x22d7cf,_0xf32775){var _0x5c01a2={},_0x44336c={},_0x458e77={'count':0x0,'rows':[]};var _0x260584=_['map'](db[_0x1cfe('0x2d')]['rawAttributes'],function(_0x52551d){return{'name':_0x52551d[_0x1cfe('0x2e')],'type':_0x52551d['type'][_0x1cfe('0x2f')]};});_0x44336c[_0x1cfe('0x30')]=_[_0x1cfe('0x31')](_0x260584,'name');_0x44336c['query']=_[_0x1cfe('0x32')](_0x22d7cf['query']);_0x44336c[_0x1cfe('0x33')]=_[_0x1cfe('0x34')](_0x44336c[_0x1cfe('0x30')],_0x44336c[_0x1cfe('0x35')]);_0x5c01a2['attributes']=_['intersection'](_0x44336c[_0x1cfe('0x30')],qs[_0x1cfe('0x36')](_0x22d7cf[_0x1cfe('0x35')][_0x1cfe('0x36')]));_0x5c01a2[_0x1cfe('0x37')]=_0x5c01a2[_0x1cfe('0x37')][_0x1cfe('0x38')]?_0x5c01a2[_0x1cfe('0x37')]:_0x44336c[_0x1cfe('0x30')];if(!_0x22d7cf[_0x1cfe('0x35')][_0x1cfe('0x39')](_0x1cfe('0x3a'))){_0x5c01a2[_0x1cfe('0x20')]=qs[_0x1cfe('0x20')](_0x22d7cf['query']['limit']);_0x5c01a2[_0x1cfe('0x1d')]=qs[_0x1cfe('0x1d')](_0x22d7cf[_0x1cfe('0x35')]['offset']);}_0x5c01a2[_0x1cfe('0x3b')]=qs[_0x1cfe('0x3c')](_0x22d7cf['query']['sort']);_0x5c01a2[_0x1cfe('0x3d')]=qs[_0x1cfe('0x33')](_['pick'](_0x22d7cf[_0x1cfe('0x35')],_0x44336c[_0x1cfe('0x33')]),_0x260584);if(_0x22d7cf['query']['filter']){_0x5c01a2[_0x1cfe('0x3d')]=_[_0x1cfe('0x3e')](_0x5c01a2[_0x1cfe('0x3d')],{'$or':_['map'](_0x260584,function(_0x3e7573){if(_0x3e7573[_0x1cfe('0x3f')]!==_0x1cfe('0x40')){var _0x14b21f={};_0x14b21f[_0x3e7573[_0x1cfe('0x2c')]]={'$like':'%'+_0x22d7cf[_0x1cfe('0x35')][_0x1cfe('0x41')]+'%'};return _0x14b21f;}})});}_0x5c01a2=_[_0x1cfe('0x3e')]({},_0x5c01a2,_0x22d7cf[_0x1cfe('0x42')]);var _0x18ec23={'where':_0x5c01a2[_0x1cfe('0x3d')]};return db[_0x1cfe('0x2d')][_0x1cfe('0x1f')](_0x18ec23)[_0x1cfe('0x25')](function(_0xbaf53f){_0x458e77[_0x1cfe('0x1f')]=_0xbaf53f;if(_0x22d7cf['query'][_0x1cfe('0x43')]){_0x5c01a2[_0x1cfe('0x44')]=[{'all':!![]}];}return db[_0x1cfe('0x2d')][_0x1cfe('0x45')](_0x5c01a2);})[_0x1cfe('0x25')](function(_0x13827f){_0x458e77[_0x1cfe('0x46')]=_0x13827f;return _0x458e77;})['then'](respondWithFilteredResult(_0xf32775,_0x5c01a2))[_0x1cfe('0x47')](handleError(_0xf32775,null));};exports[_0x1cfe('0x48')]=function(_0x4aa865,_0x634ea){var _0xda331f={'raw':![],'where':{'id':_0x4aa865[_0x1cfe('0x49')]['id']}},_0x454590={};_0x454590[_0x1cfe('0x30')]=_['keys'](db[_0x1cfe('0x2d')]['rawAttributes']);_0x454590['query']=_[_0x1cfe('0x32')](_0x4aa865[_0x1cfe('0x35')]);_0x454590['filters']=_[_0x1cfe('0x34')](_0x454590['model'],_0x454590['query']);_0xda331f[_0x1cfe('0x37')]=_[_0x1cfe('0x34')](_0x454590[_0x1cfe('0x30')],qs['fields'](_0x4aa865['query'][_0x1cfe('0x36')]));_0xda331f[_0x1cfe('0x37')]=_0xda331f[_0x1cfe('0x37')][_0x1cfe('0x38')]?_0xda331f['attributes']:_0x454590['model'];if(_0x4aa865['query'][_0x1cfe('0x43')]){_0xda331f[_0x1cfe('0x44')]=[{'all':!![]}];}_0xda331f=_['merge']({},_0xda331f,_0x4aa865[_0x1cfe('0x42')]);return db['Schedule'][_0x1cfe('0x4a')](_0xda331f)['then'](handleEntityNotFound(_0x634ea,null))[_0x1cfe('0x25')](respondWithResult(_0x634ea,null))[_0x1cfe('0x47')](handleError(_0x634ea,null));};exports[_0x1cfe('0x4b')]=function(_0x1305cb,_0x1c5efa){return db[_0x1cfe('0x2d')][_0x1cfe('0x4b')](_0x1305cb['body'],{})[_0x1cfe('0x25')](function(_0x3ad56f){var _0x105bf4=_0x1305cb[_0x1cfe('0x4c')][_0x1cfe('0x27')]({'plain':!![]});if(!_0x105bf4)throw new Error(_0x1cfe('0x4d'));if(_0x105bf4[_0x1cfe('0x4e')]===_0x1cfe('0x4c')){var _0x564249=_0x3ad56f[_0x1cfe('0x27')]({'plain':!![]});var _0xfe3450='Scheduler';return db[_0x1cfe('0x4f')][_0x1cfe('0x4a')]({'where':{'name':_0xfe3450,'userProfileId':_0x105bf4[_0x1cfe('0x50')]},'raw':!![]})[_0x1cfe('0x25')](function(_0x173704){if(_0x173704&&_0x173704[_0x1cfe('0x51')]===0x0){return db[_0x1cfe('0x29')][_0x1cfe('0x4b')]({'name':_0x564249[_0x1cfe('0x2c')],'resourceId':_0x564249['id'],'type':_0x173704['name'],'sectionId':_0x173704['id']},{})[_0x1cfe('0x25')](function(){return _0x3ad56f;});}else{return _0x3ad56f;}})['catch'](function(_0x401015){logger[_0x1cfe('0x2a')](_0x1cfe('0x52'),_0x401015);throw _0x401015;});}return _0x3ad56f;})[_0x1cfe('0x25')](respondWithResult(_0x1c5efa,0xc9))[_0x1cfe('0x47')](handleError(_0x1c5efa,null));};exports[_0x1cfe('0x53')]=function(_0x1897ee,_0x4fbfc5){if(_0x1897ee[_0x1cfe('0x54')]['id']){delete _0x1897ee[_0x1cfe('0x54')]['id'];}return db['Schedule'][_0x1cfe('0x4a')]({'where':{'id':_0x1897ee[_0x1cfe('0x49')]['id']}})[_0x1cfe('0x25')](handleEntityNotFound(_0x4fbfc5,null))[_0x1cfe('0x25')](saveUpdates(_0x1897ee[_0x1cfe('0x54')],null))['then'](respondWithResult(_0x4fbfc5,null))[_0x1cfe('0x47')](handleError(_0x4fbfc5,null));};exports[_0x1cfe('0x26')]=function(_0x19e7b4,_0x2c7745){return db[_0x1cfe('0x2d')]['find']({'where':{'id':_0x19e7b4[_0x1cfe('0x49')]['id']}})[_0x1cfe('0x25')](handleEntityNotFound(_0x2c7745,null))[_0x1cfe('0x25')](removeEntity(_0x2c7745,null))[_0x1cfe('0x47')](handleError(_0x2c7745,null));};exports[_0x1cfe('0x55')]=function(_0x579807,_0x523056,_0x330fac){var _0x18534f=require(_0x1cfe('0x56'));return db[_0x1cfe('0x2d')][_0x1cfe('0x4a')]({'where':{'id':_0x579807['params']['id']},'raw':!![]})[_0x1cfe('0x25')](handleEntityNotFound(_0x523056,null))[_0x1cfe('0x25')](function(){_0x18534f[_0x1cfe('0x55')](_0x579807['params']['id']);})[_0x1cfe('0x25')](respondWithStatusCode(_0x523056,null))[_0x1cfe('0x47')](handleError(_0x523056,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 08c653d..bdbfecc 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 _0x7fad=['exports','Schedule','tools_schedules','util','../../config/logger','moment','rimraf','../../config/environment'];(function(_0x6ffa12,_0x45a92a){var _0x17b047=function(_0x1bf1f6){while(--_0x1bf1f6){_0x6ffa12['push'](_0x6ffa12['shift']());}};_0x17b047(++_0x45a92a);}(_0x7fad,0x163));var _0xd7fa=function(_0x3e6729,_0x16d4af){_0x3e6729=_0x3e6729-0x0;var _0x535bcd=_0x7fad[_0x3e6729];return _0x535bcd;};'use strict';var _=require('lodash');var util=require(_0xd7fa('0x0'));var logger=require(_0xd7fa('0x1'))('api');var moment=require(_0xd7fa('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd7fa('0x3'));var config=require(_0xd7fa('0x4'));var attributes=require('./schedule.attributes');module[_0xd7fa('0x5')]=function(_0x36ca9b,_0x4a908a){return _0x36ca9b['define'](_0xd7fa('0x6'),attributes,{'tableName':_0xd7fa('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9e0f=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./schedule.attributes','exports','define','Schedule','tools_schedules','lodash'];(function(_0x3c3021,_0x189015){var _0x347432=function(_0x324dfc){while(--_0x324dfc){_0x3c3021['push'](_0x3c3021['shift']());}};_0x347432(++_0x189015);}(_0x9e0f,0x10d));var _0xf9e0=function(_0x55fb60,_0x4a926c){_0x55fb60=_0x55fb60-0x0;var _0x294b88=_0x9e0f[_0x55fb60];return _0x294b88;};'use strict';var _=require(_0xf9e0('0x0'));var util=require(_0xf9e0('0x1'));var logger=require(_0xf9e0('0x2'))(_0xf9e0('0x3'));var moment=require(_0xf9e0('0x4'));var BPromise=require(_0xf9e0('0x5'));var rp=require(_0xf9e0('0x6'));var fs=require('fs');var path=require(_0xf9e0('0x7'));var rimraf=require(_0xf9e0('0x8'));var config=require(_0xf9e0('0x9'));var attributes=require(_0xf9e0('0xa'));module[_0xf9e0('0xb')]=function(_0x1edfdf,_0x505a6a){return _0x1edfdf[_0xf9e0('0xc')](_0xf9e0('0xd'),attributes,{'tableName':_0xf9e0('0xe'),'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 498f395..6a04408 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 _0x281b=['then','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','lodash','util','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request'];(function(_0x5efbf6,_0x4ec3c2){var _0x3088b2=function(_0x3727c8){while(--_0x3727c8){_0x5efbf6['push'](_0x5efbf6['shift']());}};_0x3088b2(++_0x4ec3c2);}(_0x281b,0x1d5));var _0xb281=function(_0x40f27f,_0x2e1140){_0x40f27f=_0x40f27f-0x0;var _0x3bede3=_0x281b[_0x40f27f];return _0x3bede3;};'use strict';var _=require(_0xb281('0x0'));var util=require(_0xb281('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb281('0x2'));var logger=require(_0xb281('0x3'))('rpc');var config=require(_0xb281('0x4'));var jayson=require(_0xb281('0x5'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2557fd,_0x4981f3,_0x6d65d8){return new BPromise(function(_0x352cc1,_0x2d975f){return client[_0xb281('0x6')](_0x2557fd,_0x6d65d8)[_0xb281('0x7')](function(_0x3dd27){logger['info'](_0xb281('0x8'),_0x4981f3,_0xb281('0x9'));logger[_0xb281('0xa')](_0xb281('0xb'),_0x4981f3,_0xb281('0x9'),JSON[_0xb281('0xc')](_0x3dd27));if(_0x3dd27[_0xb281('0xd')]){if(_0x3dd27[_0xb281('0xd')][_0xb281('0xe')]===0x1f4){logger[_0xb281('0xd')](_0xb281('0x8'),_0x4981f3,_0x3dd27['error'][_0xb281('0xf')]);return _0x2d975f(_0x3dd27[_0xb281('0xd')][_0xb281('0xf')]);}logger[_0xb281('0xd')](_0xb281('0x8'),_0x4981f3,_0x3dd27[_0xb281('0xd')][_0xb281('0xf')]);return _0x352cc1(_0x3dd27[_0xb281('0xd')][_0xb281('0xf')]);}else{logger[_0xb281('0x10')](_0xb281('0x8'),_0x4981f3,_0xb281('0x9'));_0x352cc1(_0x3dd27['result'][_0xb281('0xf')]);}})['catch'](function(_0x2a7b7a){logger[_0xb281('0xd')](_0xb281('0x8'),_0x4981f3,_0x2a7b7a);_0x2d975f(_0x2a7b7a);});});} \ No newline at end of file +var _0x7d9a=['http','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','../../mysqldb','../../config/logger','rpc','jayson/promise','client'];(function(_0x2a5b3b,_0x4ebe31){var _0xae665a=function(_0x59e86a){while(--_0x59e86a){_0x2a5b3b['push'](_0x2a5b3b['shift']());}};_0xae665a(++_0x4ebe31);}(_0x7d9a,0xb5));var _0xa7d9=function(_0x31ba54,_0x2aaef7){_0x31ba54=_0x31ba54-0x0;var _0x1063e2=_0x7d9a[_0x31ba54];return _0x1063e2;};'use strict';var _=require(_0xa7d9('0x0'));var util=require(_0xa7d9('0x1'));var moment=require(_0xa7d9('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa7d9('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa7d9('0x4'))(_0xa7d9('0x5'));var config=require('../../config/environment');var jayson=require(_0xa7d9('0x6'));var client=jayson[_0xa7d9('0x7')][_0xa7d9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4c6035,_0x33a381,_0x504c82){return new BPromise(function(_0x33b753,_0x365f02){return client[_0xa7d9('0x9')](_0x4c6035,_0x504c82)[_0xa7d9('0xa')](function(_0x536bc8){logger[_0xa7d9('0xb')](_0xa7d9('0xc'),_0x33a381,_0xa7d9('0xd'));logger[_0xa7d9('0xe')](_0xa7d9('0xf'),_0x33a381,_0xa7d9('0xd'),JSON[_0xa7d9('0x10')](_0x536bc8));if(_0x536bc8[_0xa7d9('0x11')]){if(_0x536bc8[_0xa7d9('0x11')][_0xa7d9('0x12')]===0x1f4){logger[_0xa7d9('0x11')](_0xa7d9('0xc'),_0x33a381,_0x536bc8[_0xa7d9('0x11')]['message']);return _0x365f02(_0x536bc8[_0xa7d9('0x11')]['message']);}logger['error'](_0xa7d9('0xc'),_0x33a381,_0x536bc8[_0xa7d9('0x11')][_0xa7d9('0x13')]);return _0x33b753(_0x536bc8[_0xa7d9('0x11')]['message']);}else{logger[_0xa7d9('0xb')](_0xa7d9('0xc'),_0x33a381,_0xa7d9('0xd'));_0x33b753(_0x536bc8['result']['message']);}})[_0xa7d9('0x14')](function(_0x370680){logger[_0xa7d9('0x11')](_0xa7d9('0xc'),_0x33a381,_0x370680);_0x365f02(_0x370680);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 43a7af5..f919df9 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 _0xb0f2=['/:id','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','show','/:id/download','put'];(function(_0x3b68e2,_0x81beb9){var _0x71e889=function(_0x3afc7){while(--_0x3afc7){_0x3b68e2['push'](_0x3b68e2['shift']());}};_0x71e889(++_0x81beb9);}(_0xb0f2,0x180));var _0x2b0f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb0f2[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x2b0f('0x0'));var util=require(_0x2b0f('0x1'));var path=require(_0x2b0f('0x2'));var timeout=require('connect-timeout');var express=require(_0x2b0f('0x3'));var router=express[_0x2b0f('0x4')]();var fs_extra=require(_0x2b0f('0x5'));var auth=require(_0x2b0f('0x6'));var interaction=require(_0x2b0f('0x7'));var config=require(_0x2b0f('0x8'));var controller=require('./screenRecording.controller');router[_0x2b0f('0x9')]('/',auth[_0x2b0f('0xa')](),controller['index']);router[_0x2b0f('0x9')](_0x2b0f('0xb'),auth[_0x2b0f('0xa')](),controller[_0x2b0f('0xc')]);router[_0x2b0f('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x2b0f('0xd')]);router['get'](_0x2b0f('0xe'),auth[_0x2b0f('0xa')](),controller['download']);router['post']('/',auth[_0x2b0f('0xa')](),controller['create']);router[_0x2b0f('0xf')](_0x2b0f('0x10'),auth['isAuthenticated'](),controller[_0x2b0f('0x11')]);router['delete'](_0x2b0f('0x10'),auth['isAuthenticated'](),controller[_0x2b0f('0x12')]);module[_0x2b0f('0x13')]=router; \ No newline at end of file +var _0xd58b=['put','delete','/:id','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./screenRecording.controller','get','index','isAuthenticated','describe','show','/:id/download','download','post','create'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xd58b,0x14f));var _0xbd58=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0xd58b[_0x565ed7];return _0x183ad7;};'use strict';var multer=require(_0xbd58('0x0'));var util=require('util');var path=require(_0xbd58('0x1'));var timeout=require('connect-timeout');var express=require(_0xbd58('0x2'));var router=express[_0xbd58('0x3')]();var fs_extra=require(_0xbd58('0x4'));var auth=require(_0xbd58('0x5'));var interaction=require(_0xbd58('0x6'));var config=require('../../config/environment');var controller=require(_0xbd58('0x7'));router[_0xbd58('0x8')]('/',auth['isAuthenticated'](),controller[_0xbd58('0x9')]);router[_0xbd58('0x8')]('/describe',auth[_0xbd58('0xa')](),controller[_0xbd58('0xb')]);router[_0xbd58('0x8')]('/:id',auth[_0xbd58('0xa')](),controller[_0xbd58('0xc')]);router[_0xbd58('0x8')](_0xbd58('0xd'),auth[_0xbd58('0xa')](),controller[_0xbd58('0xe')]);router[_0xbd58('0xf')]('/',auth[_0xbd58('0xa')](),controller[_0xbd58('0x10')]);router[_0xbd58('0x11')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xbd58('0x12')](_0xbd58('0x13'),auth['isAuthenticated'](),controller[_0xbd58('0x14')]);module[_0xbd58('0x15')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 0c7ec7c..a792f6a 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 _0x7382=['DATE','createdAt','updatedAt','moment','value','extname','getDataValue','STRING','setDataValue','INTEGER','startedAt','closedAt','format','MM-DD-YYYY\x20HH:mm','toString'];(function(_0x4a16aa,_0x46f661){var _0x4e9af4=function(_0x1e7660){while(--_0x1e7660){_0x4a16aa['push'](_0x4a16aa['shift']());}};_0x4e9af4(++_0x46f661);}(_0x7382,0x111));var _0x2738=function(_0x545e6b,_0x385e7e){_0x545e6b=_0x545e6b-0x0;var _0x475bde=_0x7382[_0x545e6b];return _0x475bde;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x2738('0x0'));var path=require('path');var config=require('../../config/environment');module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue'](_0x2738('0x1'))?path[_0x2738('0x2')](this[_0x2738('0x3')](_0x2738('0x1'))):undefined;}},'interactionid':{'type':Sequelize[_0x2738('0x4')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0x2738('0x4')],'set':function(_0x2bc38a){var _0xd74b07=_0x2bc38a['replace'](/\\/g,'/');this[_0x2738('0x5')](_0x2738('0x1'),_0xd74b07);}},'rating':{'type':Sequelize[_0x2738('0x6')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x476864){this[_0x2738('0x5')](_0x2738('0x7'),moment()['subtract'](_0x476864,'ms'));this[_0x2738('0x5')](_0x2738('0x8'),moment());this[_0x2738('0x5')]('duration',_0x476864);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x2738('0x3')](_0x2738('0x7')))[_0x2738('0x9')](_0x2738('0xa'))[_0x2738('0xb')]();}},'closedAt':{'type':Sequelize[_0x2738('0xc')],'get':function(){return moment(this[_0x2738('0x3')](_0x2738('0x8')))[_0x2738('0x9')](_0x2738('0xa'))[_0x2738('0xb')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x2738('0x3')](_0x2738('0xd')))['format'](_0x2738('0xa'))['toString']();}},'updatedAt':{'type':Sequelize[_0x2738('0xc')],'get':function(){return moment(this['getDataValue'](_0x2738('0xe')))['format'](_0x2738('0xa'))[_0x2738('0xb')]();}}}; \ No newline at end of file +var _0xba38=['moment','path','../../config/environment','VIRTUAL','value','extname','getDataValue','STRING','replace','setDataValue','INTEGER','startedAt','closedAt','duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt'];(function(_0x1b5aea,_0x1afe6f){var _0x51cae9=function(_0x1494a6){while(--_0x1494a6){_0x1b5aea['push'](_0x1b5aea['shift']());}};_0x51cae9(++_0x1afe6f);}(_0xba38,0x190));var _0x8ba3=function(_0x4240af,_0x220ecf){_0x4240af=_0x4240af-0x0;var _0x39b59b=_0xba38[_0x4240af];return _0x39b59b;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x8ba3('0x0'));var path=require(_0x8ba3('0x1'));var config=require(_0x8ba3('0x2'));module['exports']={'format':{'type':Sequelize[_0x8ba3('0x3')],'get':function(){return this['getDataValue'](_0x8ba3('0x4'))?path[_0x8ba3('0x5')](this[_0x8ba3('0x6')](_0x8ba3('0x4'))):undefined;}},'interactionid':{'type':Sequelize[_0x8ba3('0x7')]},'channel':{'type':Sequelize[_0x8ba3('0x7')]},'value':{'type':Sequelize[_0x8ba3('0x7')],'set':function(_0x17276c){var _0x193e7e=_0x17276c[_0x8ba3('0x8')](/\\/g,'/');this[_0x8ba3('0x9')](_0x8ba3('0x4'),_0x193e7e);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x8ba3('0xa')],'set':function(_0x3041b5){this['setDataValue'](_0x8ba3('0xb'),moment()['subtract'](_0x3041b5,'ms'));this[_0x8ba3('0x9')](_0x8ba3('0xc'),moment());this[_0x8ba3('0x9')](_0x8ba3('0xd'),_0x3041b5);}},'startedAt':{'type':Sequelize[_0x8ba3('0xe')],'get':function(){return moment(this[_0x8ba3('0x6')](_0x8ba3('0xb')))[_0x8ba3('0xf')](_0x8ba3('0x10'))['toString']();}},'closedAt':{'type':Sequelize[_0x8ba3('0xe')],'get':function(){return moment(this[_0x8ba3('0x6')]('closedAt'))[_0x8ba3('0xf')]('MM-DD-YYYY\x20HH:mm')[_0x8ba3('0x11')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x8ba3('0x6')](_0x8ba3('0x12')))['format'](_0x8ba3('0x10'))[_0x8ba3('0x11')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x8ba3('0x6')](_0x8ba3('0x13')))['format']('MM-DD-YYYY\x20HH:mm')[_0x8ba3('0x11')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 433af7c..673c1e9 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 _0xa630=['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','../../mysqldb','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','ScreenRecording','type','key','model','differenceBy','format','query','keys','intersection','fields','attributes','length','order','filters','pick','filter','where','merge','VIRTUAL','include','findAll','rows','catch','show','params','rawAttributes','includeAll','options','find','create','body','createdAt','value','describe','../../components/encryptor','root','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','recording','join','ScreenRecording\x20not\x20found','filename','extname','download','message','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0xa630,0xbe));var _0x0a63=function(_0x1ab309,_0x3af0b1){_0x1ab309=_0x1ab309-0x0;var _0x28dafb=_0xa630[_0x1ab309];return _0x28dafb;};'use strict';var emlformat=require(_0x0a63('0x0'));var rimraf=require(_0x0a63('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a63('0x2'));var moment=require('moment');var BPromise=require(_0x0a63('0x3'));var Mustache=require('mustache');var util=require(_0x0a63('0x4'));var path=require(_0x0a63('0x5'));var sox=require(_0x0a63('0x6'));var csv=require(_0x0a63('0x7'));var ejs=require(_0x0a63('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0a63('0x9'));var squel=require(_0x0a63('0xa'));var crypto=require(_0x0a63('0xb'));var jsforce=require(_0x0a63('0xc'));var deskjs=require(_0x0a63('0xd'));var toCsv=require(_0x0a63('0x7'));var querystring=require('querystring');var Papa=require(_0x0a63('0xe'));var Redis=require(_0x0a63('0xf'));var authService=require(_0x0a63('0x10'));var qs=require(_0x0a63('0x11'));var as=require(_0x0a63('0x12'));var hardwareService=require(_0x0a63('0x13'));var logger=require(_0x0a63('0x14'))(_0x0a63('0x15'));var utils=require(_0x0a63('0x16'));var config=require(_0x0a63('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0a63('0x18'))['db'];function respondWithStatusCode(_0x420043,_0x2fce86){_0x2fce86=_0x2fce86||0xcc;return function(_0x3d6323){if(_0x3d6323){return _0x420043['sendStatus'](_0x2fce86);}return _0x420043[_0x0a63('0x19')](_0x2fce86)['end']();};}function respondWithResult(_0x331e99,_0x19e922){_0x19e922=_0x19e922||0xc8;return function(_0x26b2bc){if(_0x26b2bc){return _0x331e99[_0x0a63('0x19')](_0x19e922)[_0x0a63('0x1a')](_0x26b2bc);}};}function respondWithFilteredResult(_0x23b49d,_0x552b1f){return function(_0x1e3251){if(_0x1e3251){var _0x524a98=typeof _0x552b1f[_0x0a63('0x1b')]==='undefined'&&typeof _0x552b1f[_0x0a63('0x1c')]===_0x0a63('0x1d');var _0x36a9e8=_0x1e3251[_0x0a63('0x1e')];var _0x1f7481=_0x524a98?0x0:_0x552b1f[_0x0a63('0x1b')];var _0x30f292=_0x524a98?_0x1e3251[_0x0a63('0x1e')]:_0x552b1f[_0x0a63('0x1b')]+_0x552b1f[_0x0a63('0x1c')];var _0x2ad167;if(_0x30f292>=_0x36a9e8){_0x30f292=_0x36a9e8;_0x2ad167=0xc8;}else{_0x2ad167=0xce;}_0x23b49d['status'](_0x2ad167);return _0x23b49d['set'](_0x0a63('0x1f'),_0x1f7481+'-'+_0x30f292+'/'+_0x36a9e8)['json'](_0x1e3251);}return null;};}function patchUpdates(_0x2fc87c){return function(_0x5937df){try{jsonpatch[_0x0a63('0x20')](_0x5937df,_0x2fc87c,!![]);}catch(_0x41d6b8){return BPromise[_0x0a63('0x21')](_0x41d6b8);}return _0x5937df[_0x0a63('0x22')]();};}function saveUpdates(_0x5da46b,_0x398a16){return function(_0x4c225a){if(_0x4c225a){return _0x4c225a[_0x0a63('0x23')](_0x5da46b)[_0x0a63('0x24')](function(_0x1bf64a){return _0x1bf64a;});}return null;};}function removeEntity(_0x20c114,_0x343273){return function(_0x1f929f){if(_0x1f929f){return _0x1f929f[_0x0a63('0x25')]()[_0x0a63('0x24')](function(){_0x20c114['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x55fb70,_0x4c8637){return function(_0xeacfc9){if(!_0xeacfc9){_0x55fb70['sendStatus'](0x194);}return _0xeacfc9;};}function handleError(_0x496c93,_0x2133cf){_0x2133cf=_0x2133cf||0x1f4;return function(_0x1d5448){logger[_0x0a63('0x26')](_0x1d5448[_0x0a63('0x27')]);if(_0x1d5448['name']){delete _0x1d5448[_0x0a63('0x28')];}_0x496c93[_0x0a63('0x19')](_0x2133cf)[_0x0a63('0x29')](_0x1d5448);};}exports['index']=function(_0x34239b,_0xcf409){var _0x1b7bdb={},_0x145090={},_0x32a52b={'count':0x0,'rows':[]};var _0x4577b6=_[_0x0a63('0x2a')](db[_0x0a63('0x2b')]['rawAttributes'],function(_0x58cc71){return{'name':_0x58cc71['fieldName'],'type':_0x58cc71[_0x0a63('0x2c')][_0x0a63('0x2d')]};});_0x145090[_0x0a63('0x2e')]=_[_0x0a63('0x2f')](_[_0x0a63('0x2a')](_0x4577b6,'name'),[_0x0a63('0x30')]);_0x145090[_0x0a63('0x31')]=_[_0x0a63('0x32')](_0x34239b[_0x0a63('0x31')]);_0x145090['filters']=_[_0x0a63('0x33')](_0x145090[_0x0a63('0x2e')],_0x145090['query']);_0x1b7bdb['attributes']=_[_0x0a63('0x33')](_0x145090['model'],qs['fields'](_0x34239b[_0x0a63('0x31')][_0x0a63('0x34')]));_0x1b7bdb['attributes']=_0x1b7bdb[_0x0a63('0x35')][_0x0a63('0x36')]?_0x1b7bdb[_0x0a63('0x35')]:_0x145090[_0x0a63('0x2e')];if(!_0x34239b[_0x0a63('0x31')]['hasOwnProperty']('nolimit')){_0x1b7bdb[_0x0a63('0x1c')]=qs[_0x0a63('0x1c')](_0x34239b[_0x0a63('0x31')][_0x0a63('0x1c')]);_0x1b7bdb[_0x0a63('0x1b')]=qs[_0x0a63('0x1b')](_0x34239b['query'][_0x0a63('0x1b')]);}_0x1b7bdb[_0x0a63('0x37')]=qs['sort'](_0x34239b[_0x0a63('0x31')]['sort']);_0x1b7bdb['where']=qs[_0x0a63('0x38')](_[_0x0a63('0x39')](_0x34239b[_0x0a63('0x31')],_0x145090['filters']),_0x4577b6);if(_0x34239b[_0x0a63('0x31')][_0x0a63('0x3a')]){_0x1b7bdb[_0x0a63('0x3b')]=_[_0x0a63('0x3c')](_0x1b7bdb[_0x0a63('0x3b')],{'$or':_[_0x0a63('0x2a')](_0x4577b6,function(_0x604a45){if(_0x604a45['type']!==_0x0a63('0x3d')){var _0x1c7e67={};_0x1c7e67[_0x604a45[_0x0a63('0x28')]]={'$like':'%'+_0x34239b['query']['filter']+'%'};return _0x1c7e67;}})});}_0x1b7bdb=_[_0x0a63('0x3c')]({},_0x1b7bdb,_0x34239b['options']);var _0x1a01f4={'where':_0x1b7bdb[_0x0a63('0x3b')]};return db[_0x0a63('0x2b')]['count'](_0x1a01f4)[_0x0a63('0x24')](function(_0x14c737){_0x32a52b[_0x0a63('0x1e')]=_0x14c737;if(_0x34239b[_0x0a63('0x31')]['includeAll']){_0x1b7bdb[_0x0a63('0x3e')]=[{'all':!![]}];}return db[_0x0a63('0x2b')][_0x0a63('0x3f')](_0x1b7bdb);})[_0x0a63('0x24')](function(_0xf18ace){_0x32a52b[_0x0a63('0x40')]=_0xf18ace;return _0x32a52b;})['then'](respondWithFilteredResult(_0xcf409,_0x1b7bdb))[_0x0a63('0x41')](handleError(_0xcf409,null));};exports[_0x0a63('0x42')]=function(_0x347a0b,_0x793502){var _0x20fa0d={'raw':![],'where':{'id':_0x347a0b[_0x0a63('0x43')]['id']}},_0x2482ca={};_0x2482ca[_0x0a63('0x2e')]=_[_0x0a63('0x32')](db[_0x0a63('0x2b')][_0x0a63('0x44')]);_0x2482ca[_0x0a63('0x31')]=_[_0x0a63('0x32')](_0x347a0b[_0x0a63('0x31')]);_0x2482ca[_0x0a63('0x38')]=_[_0x0a63('0x33')](_0x2482ca[_0x0a63('0x2e')],_0x2482ca[_0x0a63('0x31')]);_0x20fa0d['attributes']=_[_0x0a63('0x33')](_0x2482ca['model'],qs['fields'](_0x347a0b[_0x0a63('0x31')][_0x0a63('0x34')]));_0x20fa0d[_0x0a63('0x35')]=_0x20fa0d[_0x0a63('0x35')][_0x0a63('0x36')]?_0x20fa0d[_0x0a63('0x35')]:_0x2482ca[_0x0a63('0x2e')];if(_0x347a0b[_0x0a63('0x31')][_0x0a63('0x45')]){_0x20fa0d[_0x0a63('0x3e')]=[{'all':!![]}];}_0x20fa0d=_[_0x0a63('0x3c')]({},_0x20fa0d,_0x347a0b[_0x0a63('0x46')]);return db[_0x0a63('0x2b')][_0x0a63('0x47')](_0x20fa0d)[_0x0a63('0x24')](handleEntityNotFound(_0x793502,null))[_0x0a63('0x24')](respondWithResult(_0x793502,null))[_0x0a63('0x41')](handleError(_0x793502,null));};exports[_0x0a63('0x48')]=function(_0x366887,_0x148e0a){return db['ScreenRecording'][_0x0a63('0x48')](_0x366887[_0x0a63('0x49')],{})['then'](respondWithResult(_0x148e0a,0xc9))['catch'](handleError(_0x148e0a,null));};exports['update']=function(_0x485f20,_0x36d066){if(_0x485f20[_0x0a63('0x49')]['id']){delete _0x485f20['body']['id'];}delete _0x485f20[_0x0a63('0x49')]['duration'];delete _0x485f20[_0x0a63('0x49')][_0x0a63('0x4a')];delete _0x485f20['body']['closedAt'];delete _0x485f20['body'][_0x0a63('0x4b')];return db[_0x0a63('0x2b')][_0x0a63('0x47')]({'where':{'id':_0x485f20[_0x0a63('0x43')]['id']}})[_0x0a63('0x24')](handleEntityNotFound(_0x36d066,null))['then'](saveUpdates(_0x485f20[_0x0a63('0x49')],null))[_0x0a63('0x24')](respondWithResult(_0x36d066,null))[_0x0a63('0x41')](handleError(_0x36d066,null));};exports[_0x0a63('0x4c')]=function(_0x3575ae,_0x4a5b6e){return db[_0x0a63('0x2b')][_0x0a63('0x4c')]()[_0x0a63('0x24')](respondWithResult(_0x4a5b6e,null))[_0x0a63('0x41')](handleError(_0x4a5b6e,null));};exports['download']=function(_0x35b688,_0x3bd10c,_0x337bef){var _0x330550=require(_0x0a63('0x4d'));var _0x258ed3=![];var _0x4d4e20={};if(_0x35b688[_0x0a63('0x31')][_0x0a63('0x2c')]&&_0x35b688[_0x0a63('0x31')][_0x0a63('0x2c')]==='uniqueid'){_0x4d4e20['uniqueid']=_0x35b688[_0x0a63('0x43')]['id'];}else{_0x4d4e20['id']=_0x35b688[_0x0a63('0x43')]['id'];}return db[_0x0a63('0x2b')][_0x0a63('0x47')]({'where':_0x4d4e20,'attributes':['id',_0x0a63('0x4b')],'raw':!![]})['then'](handleEntityNotFound(_0x3bd10c,null))['then'](function(_0x58b3a8){if(_0x58b3a8){var _0x42c1bb=path['join'](config[_0x0a63('0x4e')],_0x0a63('0x4f'),_0x58b3a8[_0x0a63('0x4b')]);var _0x5d77e3=util['format'](_0x0a63('0x50'),_0x42c1bb);if(fs[_0x0a63('0x51')](_0x5d77e3)){_0x258ed3=!![];return _0x330550[_0x0a63('0x52')](_0x5d77e3,_0x42c1bb,config[_0x0a63('0x53')][_0x0a63('0x54')])[_0x0a63('0x24')](function(){return _0x58b3a8;});}return _0x58b3a8;}})[_0x0a63('0x24')](function(_0xc3415c){if(_0xc3415c){var _0xe454ef=path[_0x0a63('0x55')](config[_0x0a63('0x4e')],_0x0a63('0x4f'),_0xc3415c[_0x0a63('0x4b')]);if(!fs[_0x0a63('0x51')](_0xe454ef)){throw new db['Sequelize']['ValidationError'](_0x0a63('0x56'));}if(_0xc3415c[_0x0a63('0x57')]){return _0x3bd10c['download'](_0xe454ef,_0xc3415c[_0x0a63('0x57')]+path[_0x0a63('0x58')](_0xe454ef),function(){if(_0x258ed3){fs['unlink'](_0xe454ef);}});}else{return _0x3bd10c[_0x0a63('0x59')](_0xe454ef,function(_0x3053e4){if(_0x258ed3){fs['unlink'](_0xe454ef);}});}}})['catch'](function(_0x3b395a){if(_0x3b395a[_0x0a63('0x5a')]===_0x0a63('0x56')){_0x3bd10c['status'](0x194)[_0x0a63('0x29')](_0x0a63('0x5b'));}else{return handleError(_0x3bd10c,null);}});};exports[_0x0a63('0x25')]=function(_0x284dca,_0x15fc2e){return db['ScreenRecording'][_0x0a63('0x47')]({'where':{'id':_0x284dca[_0x0a63('0x43')]['id']}})[_0x0a63('0x24')](function(_0x1fa9cd){if(_[_0x0a63('0x5c')](_0x1fa9cd)){throw new ReferenceError(_0x0a63('0x5d'));}return _0x1fa9cd;})[_0x0a63('0x24')](function(_0x57313b){var _0x4571e7=path[_0x0a63('0x55')](config[_0x0a63('0x4e')],_0x0a63('0x4f'),_0x57313b[_0x0a63('0x4b')]);logger[_0x0a63('0x5e')](_0x0a63('0x5f'),_0x4571e7);if(!_[_0x0a63('0x5c')](_0x57313b['value'])&&fs['existsSync'](_0x4571e7)){logger[_0x0a63('0x5e')](_0x0a63('0x60')+_0x4571e7+_0x0a63('0x61'));fs[_0x0a63('0x62')](_0x4571e7);}_0x4571e7=_0x4571e7+_0x0a63('0x63');if(!_['isNil'](_0x57313b[_0x0a63('0x4b')])&&fs[_0x0a63('0x51')](_0x4571e7)){logger[_0x0a63('0x5e')](_0x0a63('0x60')+_0x4571e7+_0x0a63('0x61'));fs[_0x0a63('0x62')](_0x4571e7);}return _0x57313b;})[_0x0a63('0x24')](function(_0xe52dfd){if(!_0xe52dfd)throw new InternalError();return _0xe52dfd[_0x0a63('0x25')]();})[_0x0a63('0x24')](function(){_0x15fc2e[_0x0a63('0x19')](0xcc)['end']();})[_0x0a63('0x41')](handleError(_0x15fc2e,null));}; \ No newline at end of file +var _0x2eb2=['zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','update','then','destroy','end','stack','name','send','map','ScreenRecording','rawAttributes','fieldName','type','key','differenceBy','format','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','include','find','create','body','duration','createdAt','closedAt','value','describe','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','download','extname','unlink','message','Not\x20found','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','rimraf'];(function(_0x2b4b83,_0x3378a4){var _0x5ab8de=function(_0x3b55cf){while(--_0x3b55cf){_0x2b4b83['push'](_0x2b4b83['shift']());}};_0x5ab8de(++_0x3378a4);}(_0x2eb2,0x19f));var _0x22eb=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0x2eb2[_0xbe200f];return _0x192597;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x22eb('0x0'));var zipdir=require(_0x22eb('0x1'));var jsonpatch=require(_0x22eb('0x2'));var rp=require(_0x22eb('0x3'));var moment=require(_0x22eb('0x4'));var BPromise=require(_0x22eb('0x5'));var Mustache=require('mustache');var util=require(_0x22eb('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x22eb('0x7'));var ejs=require(_0x22eb('0x8'));var fs=require('fs');var fs_extra=require(_0x22eb('0x9'));var _=require(_0x22eb('0xa'));var squel=require(_0x22eb('0xb'));var crypto=require(_0x22eb('0xc'));var jsforce=require(_0x22eb('0xd'));var deskjs=require(_0x22eb('0xe'));var toCsv=require(_0x22eb('0x7'));var querystring=require(_0x22eb('0xf'));var Papa=require(_0x22eb('0x10'));var Redis=require(_0x22eb('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x22eb('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x22eb('0x13'))('api');var utils=require(_0x22eb('0x14'));var config=require(_0x22eb('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1f286c,_0x189f05){_0x189f05=_0x189f05||0xcc;return function(_0x128d43){if(_0x128d43){return _0x1f286c[_0x22eb('0x16')](_0x189f05);}return _0x1f286c[_0x22eb('0x17')](_0x189f05)['end']();};}function respondWithResult(_0x350ade,_0x53f14e){_0x53f14e=_0x53f14e||0xc8;return function(_0x1f5089){if(_0x1f5089){return _0x350ade['status'](_0x53f14e)[_0x22eb('0x18')](_0x1f5089);}};}function respondWithFilteredResult(_0x84c668,_0x53abbf){return function(_0x48b63c){if(_0x48b63c){var _0x4bc29a=typeof _0x53abbf[_0x22eb('0x19')]==='undefined'&&typeof _0x53abbf['limit']===_0x22eb('0x1a');var _0x4d9a71=_0x48b63c['count'];var _0xb7a73a=_0x4bc29a?0x0:_0x53abbf[_0x22eb('0x19')];var _0x385bcb=_0x4bc29a?_0x48b63c[_0x22eb('0x1b')]:_0x53abbf[_0x22eb('0x19')]+_0x53abbf['limit'];var _0x4182a8;if(_0x385bcb>=_0x4d9a71){_0x385bcb=_0x4d9a71;_0x4182a8=0xc8;}else{_0x4182a8=0xce;}_0x84c668[_0x22eb('0x17')](_0x4182a8);return _0x84c668[_0x22eb('0x1c')](_0x22eb('0x1d'),_0xb7a73a+'-'+_0x385bcb+'/'+_0x4d9a71)[_0x22eb('0x18')](_0x48b63c);}return null;};}function patchUpdates(_0x517313){return function(_0x2eb115){try{jsonpatch[_0x22eb('0x1e')](_0x2eb115,_0x517313,!![]);}catch(_0x2fc36e){return BPromise['reject'](_0x2fc36e);}return _0x2eb115['save']();};}function saveUpdates(_0x4335b7,_0x267d97){return function(_0x434ecb){if(_0x434ecb){return _0x434ecb[_0x22eb('0x1f')](_0x4335b7)[_0x22eb('0x20')](function(_0x3e8c1c){return _0x3e8c1c;});}return null;};}function removeEntity(_0x43dacb,_0x4e7e69){return function(_0x2e8f7c){if(_0x2e8f7c){return _0x2e8f7c[_0x22eb('0x21')]()[_0x22eb('0x20')](function(){_0x43dacb[_0x22eb('0x17')](0xcc)[_0x22eb('0x22')]();});}};}function handleEntityNotFound(_0x4da252,_0x12c133){return function(_0x6f8ff3){if(!_0x6f8ff3){_0x4da252[_0x22eb('0x16')](0x194);}return _0x6f8ff3;};}function handleError(_0x5a001e,_0xe0783c){_0xe0783c=_0xe0783c||0x1f4;return function(_0x259847){logger['error'](_0x259847[_0x22eb('0x23')]);if(_0x259847[_0x22eb('0x24')]){delete _0x259847[_0x22eb('0x24')];}_0x5a001e[_0x22eb('0x17')](_0xe0783c)[_0x22eb('0x25')](_0x259847);};}exports['index']=function(_0x49dd59,_0x2a950e){var _0x25e5bc={},_0x44cf91={},_0x7c0119={'count':0x0,'rows':[]};var _0x1599c7=_[_0x22eb('0x26')](db[_0x22eb('0x27')][_0x22eb('0x28')],function(_0x382784){return{'name':_0x382784[_0x22eb('0x29')],'type':_0x382784[_0x22eb('0x2a')][_0x22eb('0x2b')]};});_0x44cf91['model']=_[_0x22eb('0x2c')](_['map'](_0x1599c7,_0x22eb('0x24')),[_0x22eb('0x2d')]);_0x44cf91[_0x22eb('0x2e')]=_[_0x22eb('0x2f')](_0x49dd59[_0x22eb('0x2e')]);_0x44cf91[_0x22eb('0x30')]=_[_0x22eb('0x31')](_0x44cf91[_0x22eb('0x32')],_0x44cf91[_0x22eb('0x2e')]);_0x25e5bc[_0x22eb('0x33')]=_['intersection'](_0x44cf91['model'],qs[_0x22eb('0x34')](_0x49dd59['query']['fields']));_0x25e5bc[_0x22eb('0x33')]=_0x25e5bc[_0x22eb('0x33')][_0x22eb('0x35')]?_0x25e5bc[_0x22eb('0x33')]:_0x44cf91[_0x22eb('0x32')];if(!_0x49dd59[_0x22eb('0x2e')][_0x22eb('0x36')](_0x22eb('0x37'))){_0x25e5bc[_0x22eb('0x38')]=qs[_0x22eb('0x38')](_0x49dd59['query'][_0x22eb('0x38')]);_0x25e5bc['offset']=qs['offset'](_0x49dd59[_0x22eb('0x2e')][_0x22eb('0x19')]);}_0x25e5bc['order']=qs[_0x22eb('0x39')](_0x49dd59[_0x22eb('0x2e')][_0x22eb('0x39')]);_0x25e5bc[_0x22eb('0x3a')]=qs[_0x22eb('0x30')](_['pick'](_0x49dd59[_0x22eb('0x2e')],_0x44cf91[_0x22eb('0x30')]),_0x1599c7);if(_0x49dd59['query'][_0x22eb('0x3b')]){_0x25e5bc[_0x22eb('0x3a')]=_[_0x22eb('0x3c')](_0x25e5bc[_0x22eb('0x3a')],{'$or':_[_0x22eb('0x26')](_0x1599c7,function(_0x5382eb){if(_0x5382eb['type']!==_0x22eb('0x3d')){var _0x6cd651={};_0x6cd651[_0x5382eb['name']]={'$like':'%'+_0x49dd59[_0x22eb('0x2e')][_0x22eb('0x3b')]+'%'};return _0x6cd651;}})});}_0x25e5bc=_[_0x22eb('0x3c')]({},_0x25e5bc,_0x49dd59['options']);var _0x1d977c={'where':_0x25e5bc[_0x22eb('0x3a')]};return db[_0x22eb('0x27')][_0x22eb('0x1b')](_0x1d977c)[_0x22eb('0x20')](function(_0x39778e){_0x7c0119['count']=_0x39778e;if(_0x49dd59[_0x22eb('0x2e')][_0x22eb('0x3e')]){_0x25e5bc['include']=[{'all':!![]}];}return db[_0x22eb('0x27')][_0x22eb('0x3f')](_0x25e5bc);})[_0x22eb('0x20')](function(_0x30cb10){_0x7c0119[_0x22eb('0x40')]=_0x30cb10;return _0x7c0119;})[_0x22eb('0x20')](respondWithFilteredResult(_0x2a950e,_0x25e5bc))[_0x22eb('0x41')](handleError(_0x2a950e,null));};exports[_0x22eb('0x42')]=function(_0x1bafa3,_0x82ace8){var _0x3e1826={'raw':![],'where':{'id':_0x1bafa3[_0x22eb('0x43')]['id']}},_0x1cf1e0={};_0x1cf1e0[_0x22eb('0x32')]=_[_0x22eb('0x2f')](db[_0x22eb('0x27')][_0x22eb('0x28')]);_0x1cf1e0[_0x22eb('0x2e')]=_['keys'](_0x1bafa3[_0x22eb('0x2e')]);_0x1cf1e0[_0x22eb('0x30')]=_['intersection'](_0x1cf1e0[_0x22eb('0x32')],_0x1cf1e0[_0x22eb('0x2e')]);_0x3e1826['attributes']=_['intersection'](_0x1cf1e0['model'],qs[_0x22eb('0x34')](_0x1bafa3[_0x22eb('0x2e')]['fields']));_0x3e1826['attributes']=_0x3e1826[_0x22eb('0x33')][_0x22eb('0x35')]?_0x3e1826[_0x22eb('0x33')]:_0x1cf1e0[_0x22eb('0x32')];if(_0x1bafa3[_0x22eb('0x2e')][_0x22eb('0x3e')]){_0x3e1826[_0x22eb('0x44')]=[{'all':!![]}];}_0x3e1826=_[_0x22eb('0x3c')]({},_0x3e1826,_0x1bafa3['options']);return db['ScreenRecording'][_0x22eb('0x45')](_0x3e1826)['then'](handleEntityNotFound(_0x82ace8,null))[_0x22eb('0x20')](respondWithResult(_0x82ace8,null))['catch'](handleError(_0x82ace8,null));};exports[_0x22eb('0x46')]=function(_0x5c41c0,_0x4b2f86){return db['ScreenRecording']['create'](_0x5c41c0[_0x22eb('0x47')],{})['then'](respondWithResult(_0x4b2f86,0xc9))[_0x22eb('0x41')](handleError(_0x4b2f86,null));};exports[_0x22eb('0x1f')]=function(_0x490bef,_0x24e6ba){if(_0x490bef['body']['id']){delete _0x490bef[_0x22eb('0x47')]['id'];}delete _0x490bef[_0x22eb('0x47')][_0x22eb('0x48')];delete _0x490bef[_0x22eb('0x47')][_0x22eb('0x49')];delete _0x490bef[_0x22eb('0x47')][_0x22eb('0x4a')];delete _0x490bef[_0x22eb('0x47')][_0x22eb('0x4b')];return db['ScreenRecording'][_0x22eb('0x45')]({'where':{'id':_0x490bef[_0x22eb('0x43')]['id']}})['then'](handleEntityNotFound(_0x24e6ba,null))[_0x22eb('0x20')](saveUpdates(_0x490bef[_0x22eb('0x47')],null))[_0x22eb('0x20')](respondWithResult(_0x24e6ba,null))[_0x22eb('0x41')](handleError(_0x24e6ba,null));};exports['describe']=function(_0x6c0600,_0x169ae1){return db[_0x22eb('0x27')][_0x22eb('0x4c')]()[_0x22eb('0x20')](respondWithResult(_0x169ae1,null))[_0x22eb('0x41')](handleError(_0x169ae1,null));};exports['download']=function(_0x29d7ca,_0x4e5b9f,_0x3ff406){var _0x5eecef=require(_0x22eb('0x4d'));var _0x254b53=![];var _0x4028ef={};if(_0x29d7ca[_0x22eb('0x2e')][_0x22eb('0x2a')]&&_0x29d7ca['query']['type']===_0x22eb('0x4e')){_0x4028ef[_0x22eb('0x4e')]=_0x29d7ca['params']['id'];}else{_0x4028ef['id']=_0x29d7ca[_0x22eb('0x43')]['id'];}return db[_0x22eb('0x27')][_0x22eb('0x45')]({'where':_0x4028ef,'attributes':['id',_0x22eb('0x4b')],'raw':!![]})[_0x22eb('0x20')](handleEntityNotFound(_0x4e5b9f,null))[_0x22eb('0x20')](function(_0x3a8588){if(_0x3a8588){var _0x35c997=path[_0x22eb('0x4f')](config[_0x22eb('0x50')],_0x22eb('0x51'),_0x3a8588['value']);var _0x19cadf=util[_0x22eb('0x2d')](_0x22eb('0x52'),_0x35c997);if(fs[_0x22eb('0x53')](_0x19cadf)){_0x254b53=!![];return _0x5eecef[_0x22eb('0x54')](_0x19cadf,_0x35c997,config[_0x22eb('0x55')][_0x22eb('0x56')])[_0x22eb('0x20')](function(){return _0x3a8588;});}return _0x3a8588;}})[_0x22eb('0x20')](function(_0x9f8465){if(_0x9f8465){var _0x3e9ab5=path[_0x22eb('0x4f')](config[_0x22eb('0x50')],_0x22eb('0x51'),_0x9f8465['value']);if(!fs['existsSync'](_0x3e9ab5)){throw new db[(_0x22eb('0x57'))][(_0x22eb('0x58'))](_0x22eb('0x59'));}if(_0x9f8465[_0x22eb('0x5a')]){return _0x4e5b9f[_0x22eb('0x5b')](_0x3e9ab5,_0x9f8465['filename']+path[_0x22eb('0x5c')](_0x3e9ab5),function(){if(_0x254b53){fs[_0x22eb('0x5d')](_0x3e9ab5);}});}else{return _0x4e5b9f['download'](_0x3e9ab5,function(_0x485408){if(_0x254b53){fs[_0x22eb('0x5d')](_0x3e9ab5);}});}}})[_0x22eb('0x41')](function(_0xb5c8ae){if(_0xb5c8ae[_0x22eb('0x5e')]===_0x22eb('0x59')){_0x4e5b9f[_0x22eb('0x17')](0x194)[_0x22eb('0x25')](_0x22eb('0x5f'));}else{return handleError(_0x4e5b9f,null);}});};exports[_0x22eb('0x21')]=function(_0x19b579,_0x164645){return db[_0x22eb('0x27')][_0x22eb('0x45')]({'where':{'id':_0x19b579[_0x22eb('0x43')]['id']}})['then'](function(_0x29dd8b){if(_[_0x22eb('0x60')](_0x29dd8b)){throw new ReferenceError(_0x22eb('0x61'));}return _0x29dd8b;})['then'](function(_0x1787ec){var _0x5ac4c5=path[_0x22eb('0x4f')](config['root'],_0x22eb('0x51'),_0x1787ec[_0x22eb('0x4b')]);logger['info'](_0x22eb('0x62'),_0x5ac4c5);if(!_[_0x22eb('0x60')](_0x1787ec['value'])&&fs['existsSync'](_0x5ac4c5)){logger[_0x22eb('0x63')](_0x22eb('0x64')+_0x5ac4c5+_0x22eb('0x65'));fs[_0x22eb('0x66')](_0x5ac4c5);}_0x5ac4c5=_0x5ac4c5+_0x22eb('0x67');if(!_[_0x22eb('0x60')](_0x1787ec['value'])&&fs[_0x22eb('0x53')](_0x5ac4c5)){logger['info']('File:\x20\x22'+_0x5ac4c5+_0x22eb('0x65'));fs[_0x22eb('0x66')](_0x5ac4c5);}return _0x1787ec;})[_0x22eb('0x20')](function(_0x22b5c6){if(!_0x22b5c6)throw new InternalError();return _0x22b5c6[_0x22eb('0x21')]();})[_0x22eb('0x20')](function(){_0x164645[_0x22eb('0x17')](0xcc)[_0x22eb('0x22')]();})['catch'](handleError(_0x164645,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 01b0402..6482061 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 _0x44fd=['./screenRecording.attributes','exports','define','screen_recordings','interactionid','lodash','../../config/logger','bluebird','rimraf','../../config/environment'];(function(_0x3b39c1,_0x163d52){var _0x20363b=function(_0x36c375){while(--_0x36c375){_0x3b39c1['push'](_0x3b39c1['shift']());}};_0x20363b(++_0x163d52);}(_0x44fd,0x11d));var _0xd44f=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0x44fd[_0x9cd4c3];return _0x4c9025;};'use strict';var _=require(_0xd44f('0x0'));var util=require('util');var logger=require(_0xd44f('0x1'))('api');var moment=require('moment');var BPromise=require(_0xd44f('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd44f('0x3'));var config=require(_0xd44f('0x4'));var attributes=require(_0xd44f('0x5'));module[_0xd44f('0x6')]=function(_0x4d007b,_0x2ef4e5){return _0x4d007b[_0xd44f('0x7')]('ScreenRecording',attributes,{'tableName':_0xd44f('0x8'),'paranoid':![],'indexes':[{'name':_0xd44f('0x9'),'fields':[_0xd44f('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb114=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','exports','define','ScreenRecording','screen_recordings','interactionid'];(function(_0x1cdf63,_0x25995b){var _0x24b3a4=function(_0x1b529b){while(--_0x1b529b){_0x1cdf63['push'](_0x1cdf63['shift']());}};_0x24b3a4(++_0x25995b);}(_0xb114,0x9c));var _0x4b11=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0xb114[_0x5f1391];return _0x50ebe3;};'use strict';var _=require('lodash');var util=require(_0x4b11('0x0'));var logger=require(_0x4b11('0x1'))(_0x4b11('0x2'));var moment=require(_0x4b11('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4b11('0x4'));var rimraf=require(_0x4b11('0x5'));var config=require(_0x4b11('0x6'));var attributes=require('./screenRecording.attributes');module[_0x4b11('0x7')]=function(_0x1f1022,_0x472c8e){return _0x1f1022[_0x4b11('0x8')](_0x4b11('0x9'),attributes,{'tableName':_0x4b11('0xa'),'paranoid':![],'indexes':[{'name':_0x4b11('0xb'),'fields':['interactionid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 767b466..fcdf0c7 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 _0xe063=['jayson/promise','http','request','then','info','request\x20sent','debug','stringify','error','message','ScreenRecording,\x20%s,\x20%s','result','catch','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x53a7af,_0x1408a5){var _0x3cc7f6=function(_0x4bf101){while(--_0x4bf101){_0x53a7af['push'](_0x53a7af['shift']());}};_0x3cc7f6(++_0x1408a5);}(_0xe063,0xb8));var _0x3e06=function(_0x5bc9f1,_0x42f971){_0x5bc9f1=_0x5bc9f1-0x0;var _0x427066=_0xe063[_0x5bc9f1];return _0x427066;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3e06('0x0'));var fs=require('fs');var Redis=require(_0x3e06('0x1'));var db=require(_0x3e06('0x2'))['db'];var utils=require(_0x3e06('0x3'));var logger=require(_0x3e06('0x4'))('rpc');var config=require(_0x3e06('0x5'));var jayson=require(_0x3e06('0x6'));var client=jayson['client'][_0x3e06('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x19ec4d,_0x25d23a,_0x4c761b){return new BPromise(function(_0xe1a212,_0x1933a3){return client[_0x3e06('0x8')](_0x19ec4d,_0x4c761b)[_0x3e06('0x9')](function(_0x547ccb){logger[_0x3e06('0xa')]('ScreenRecording,\x20%s,\x20%s',_0x25d23a,_0x3e06('0xb'));logger[_0x3e06('0xc')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x25d23a,_0x3e06('0xb'),JSON[_0x3e06('0xd')](_0x547ccb));if(_0x547ccb[_0x3e06('0xe')]){if(_0x547ccb['error']['code']===0x1f4){logger['error']('ScreenRecording,\x20%s,\x20%s',_0x25d23a,_0x547ccb[_0x3e06('0xe')][_0x3e06('0xf')]);return _0x1933a3(_0x547ccb[_0x3e06('0xe')][_0x3e06('0xf')]);}logger[_0x3e06('0xe')](_0x3e06('0x10'),_0x25d23a,_0x547ccb[_0x3e06('0xe')]['message']);return _0xe1a212(_0x547ccb[_0x3e06('0xe')][_0x3e06('0xf')]);}else{logger[_0x3e06('0xa')]('ScreenRecording,\x20%s,\x20%s',_0x25d23a,'request\x20sent');_0xe1a212(_0x547ccb[_0x3e06('0x11')][_0x3e06('0xf')]);}})[_0x3e06('0x12')](function(_0x229077){logger[_0x3e06('0xe')]('ScreenRecording,\x20%s,\x20%s',_0x25d23a,_0x229077);_0x1933a3(_0x229077);});});} \ No newline at end of file +var _0xf649=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0xf649,0x89));var _0x9f64=function(_0x5f265e,_0x2fe1c2){_0x5f265e=_0x5f265e-0x0;var _0x27c61a=_0xf649[_0x5f265e];return _0x27c61a;};'use strict';var _=require(_0x9f64('0x0'));var util=require(_0x9f64('0x1'));var moment=require(_0x9f64('0x2'));var BPromise=require(_0x9f64('0x3'));var rs=require(_0x9f64('0x4'));var fs=require('fs');var Redis=require(_0x9f64('0x5'));var db=require(_0x9f64('0x6'))['db'];var utils=require(_0x9f64('0x7'));var logger=require(_0x9f64('0x8'))('rpc');var config=require(_0x9f64('0x9'));var jayson=require(_0x9f64('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x34f2bb,_0x18cf01,_0x3e00e3){return new BPromise(function(_0x47b8,_0xa5f5a7){return client[_0x9f64('0xb')](_0x34f2bb,_0x3e00e3)[_0x9f64('0xc')](function(_0x29acee){logger[_0x9f64('0xd')](_0x9f64('0xe'),_0x18cf01,_0x9f64('0xf'));logger[_0x9f64('0x10')](_0x9f64('0x11'),_0x18cf01,_0x9f64('0xf'),JSON[_0x9f64('0x12')](_0x29acee));if(_0x29acee[_0x9f64('0x13')]){if(_0x29acee['error'][_0x9f64('0x14')]===0x1f4){logger['error'](_0x9f64('0xe'),_0x18cf01,_0x29acee[_0x9f64('0x13')]['message']);return _0xa5f5a7(_0x29acee[_0x9f64('0x13')][_0x9f64('0x15')]);}logger[_0x9f64('0x13')](_0x9f64('0xe'),_0x18cf01,_0x29acee['error'][_0x9f64('0x15')]);return _0x47b8(_0x29acee['error'][_0x9f64('0x15')]);}else{logger[_0x9f64('0xd')](_0x9f64('0xe'),_0x18cf01,'request\x20sent');_0x47b8(_0x29acee[_0x9f64('0x16')][_0x9f64('0x15')]);}})[_0x9f64('0x17')](function(_0x229724){logger[_0x9f64('0x13')](_0x9f64('0xe'),_0x18cf01,_0x229724);_0xa5f5a7(_0x229724);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 74b389e..5e8cd73 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 _0x57f6=['root','server/files/images/logos/','logo','extname','originalname','single','file','format','%s%s','addLogoLogin','preferred','post','/:id/preferred','addPreferred','favicon','addFavicon','put','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./setting.controller','get','isAuthenticated','getDate','/:id','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','gdpr','getPreferred','/:id/favicon','getFavicon','diskStorage','join'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0x57f6,0x8d));var _0x657f=function(_0x40d078,_0x210a77){_0x40d078=_0x40d078-0x0;var _0x46fc81=_0x57f6[_0x40d078];return _0x46fc81;};'use strict';var multer=require(_0x657f('0x0'));var util=require('util');var path=require(_0x657f('0x1'));var timeout=require(_0x657f('0x2'));var express=require(_0x657f('0x3'));var router=express[_0x657f('0x4')]();var fs_extra=require(_0x657f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x657f('0x6'));var config=require('../../config/environment');var controller=require(_0x657f('0x7'));router[_0x657f('0x8')]('/',auth[_0x657f('0x9')](),controller['index']);router[_0x657f('0x8')]('/now',controller[_0x657f('0xa')]);router[_0x657f('0x8')](_0x657f('0xb'),controller[_0x657f('0xc')]);router['get'](_0x657f('0xd'),controller[_0x657f('0xe')]);router['get'](_0x657f('0xf'),controller[_0x657f('0x10')]);router[_0x657f('0x8')]('/:id/gdpr',controller[_0x657f('0x11')]);router[_0x657f('0x8')]('/:id/preferred',controller[_0x657f('0x12')]);router[_0x657f('0x8')](_0x657f('0x13'),controller[_0x657f('0x14')]);var upload=multer({'storage':multer[_0x657f('0x15')]({'destination':function(_0x127b11,_0x172b22,_0x3f946c){_0x3f946c(null,path[_0x657f('0x16')](config[_0x657f('0x17')],_0x657f('0x18')));},'filename':function(_0x97e746,_0x50b85d,_0x293f95){_0x293f95(null,util['format']('%s%s',_0x657f('0x19'),path[_0x657f('0x1a')](_0x50b85d[_0x657f('0x1b')])));}})});router['post'](_0x657f('0xd'),upload[_0x657f('0x1c')](_0x657f('0x1d')),controller['addLogo']);var upload=multer({'storage':multer[_0x657f('0x15')]({'destination':function(_0x480b8c,_0x35b8c1,_0x3dce59){_0x3dce59(null,path['join'](config[_0x657f('0x17')],'server/files/images/logos/'));},'filename':function(_0x467e33,_0x337572,_0x2b7215){_0x2b7215(null,util[_0x657f('0x1e')](_0x657f('0x1f'),'logologin',path[_0x657f('0x1a')](_0x337572[_0x657f('0x1b')])));}})});router['post'](_0x657f('0xf'),upload['single']('file'),controller[_0x657f('0x20')]);var upload=multer({'storage':multer[_0x657f('0x15')]({'destination':function(_0x1f03d3,_0x204907,_0x1df833){_0x1df833(null,path['join'](config[_0x657f('0x17')],_0x657f('0x18')));},'filename':function(_0x47d69d,_0x1e9434,_0x1bad1a){_0x1bad1a(null,util['format'](_0x657f('0x1f'),_0x657f('0x21'),path[_0x657f('0x1a')](_0x1e9434[_0x657f('0x1b')])));}})});router[_0x657f('0x22')](_0x657f('0x23'),upload[_0x657f('0x1c')](_0x657f('0x1d')),controller[_0x657f('0x24')]);var upload=multer({'storage':multer[_0x657f('0x15')]({'destination':function(_0x4651d4,_0x309e87,_0x8c7319){_0x8c7319(null,path[_0x657f('0x16')](config[_0x657f('0x17')],_0x657f('0x18')));},'filename':function(_0x4b77fa,_0x4b68bd,_0x283482){_0x283482(null,util['format'](_0x657f('0x1f'),_0x657f('0x25'),path[_0x657f('0x1a')](_0x4b68bd[_0x657f('0x1b')])));}})});router[_0x657f('0x22')]('/:id/favicon',upload[_0x657f('0x1c')](_0x657f('0x1d')),controller[_0x657f('0x26')]);router[_0x657f('0x27')]('/:id',auth[_0x657f('0x9')](),controller['update']);module[_0x657f('0x28')]=router; \ No newline at end of file +var _0x99a5=['getLogoLogin','/:id/gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','join','root','server/files/images/logos/','format','%s%s','logo','post','single','file','addLogo','diskStorage','logologin','extname','originalname','addLogoLogin','preferred','addPreferred','favicon','put','update','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','index','/now','getDate','/:id','show','/:id/logo','getLogo','/:id/logo_login'];(function(_0x1d1d09,_0x504d77){var _0x8827e=function(_0x4f3128){while(--_0x4f3128){_0x1d1d09['push'](_0x1d1d09['shift']());}};_0x8827e(++_0x504d77);}(_0x99a5,0xa1));var _0x599a=function(_0x510724,_0x34b50f){_0x510724=_0x510724-0x0;var _0x24f88b=_0x99a5[_0x510724];return _0x24f88b;};'use strict';var multer=require(_0x599a('0x0'));var util=require(_0x599a('0x1'));var path=require('path');var timeout=require(_0x599a('0x2'));var express=require(_0x599a('0x3'));var router=express[_0x599a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x599a('0x5'));var interaction=require(_0x599a('0x6'));var config=require(_0x599a('0x7'));var controller=require(_0x599a('0x8'));router[_0x599a('0x9')]('/',auth[_0x599a('0xa')](),controller[_0x599a('0xb')]);router[_0x599a('0x9')](_0x599a('0xc'),controller[_0x599a('0xd')]);router[_0x599a('0x9')](_0x599a('0xe'),controller[_0x599a('0xf')]);router[_0x599a('0x9')](_0x599a('0x10'),controller[_0x599a('0x11')]);router[_0x599a('0x9')](_0x599a('0x12'),controller[_0x599a('0x13')]);router['get'](_0x599a('0x14'),controller['gdpr']);router['get'](_0x599a('0x15'),controller[_0x599a('0x16')]);router[_0x599a('0x9')](_0x599a('0x17'),controller[_0x599a('0x18')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x488470,_0x2162c0,_0x11b68f){_0x11b68f(null,path[_0x599a('0x19')](config[_0x599a('0x1a')],_0x599a('0x1b')));},'filename':function(_0x40f9f6,_0x3222c1,_0x3d89c1){_0x3d89c1(null,util[_0x599a('0x1c')](_0x599a('0x1d'),_0x599a('0x1e'),path['extname'](_0x3222c1['originalname'])));}})});router[_0x599a('0x1f')](_0x599a('0x10'),upload[_0x599a('0x20')](_0x599a('0x21')),controller[_0x599a('0x22')]);var upload=multer({'storage':multer[_0x599a('0x23')]({'destination':function(_0x248029,_0x1b9311,_0x2e3d22){_0x2e3d22(null,path[_0x599a('0x19')](config[_0x599a('0x1a')],'server/files/images/logos/'));},'filename':function(_0x369518,_0x29fef0,_0x6f4da5){_0x6f4da5(null,util[_0x599a('0x1c')]('%s%s',_0x599a('0x24'),path[_0x599a('0x25')](_0x29fef0[_0x599a('0x26')])));}})});router[_0x599a('0x1f')](_0x599a('0x12'),upload[_0x599a('0x20')](_0x599a('0x21')),controller[_0x599a('0x27')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x204223,_0x4cc3c7,_0x2da73){_0x2da73(null,path['join'](config[_0x599a('0x1a')],'server/files/images/logos/'));},'filename':function(_0x4e77b2,_0x376fb,_0x16cd17){_0x16cd17(null,util[_0x599a('0x1c')](_0x599a('0x1d'),_0x599a('0x28'),path[_0x599a('0x25')](_0x376fb[_0x599a('0x26')])));}})});router[_0x599a('0x1f')](_0x599a('0x15'),upload['single'](_0x599a('0x21')),controller[_0x599a('0x29')]);var upload=multer({'storage':multer[_0x599a('0x23')]({'destination':function(_0x359b56,_0x397e96,_0x3c1fb9){_0x3c1fb9(null,path[_0x599a('0x19')](config['root'],_0x599a('0x1b')));},'filename':function(_0xe72099,_0x224471,_0x307d61){_0x307d61(null,util[_0x599a('0x1c')](_0x599a('0x1d'),_0x599a('0x2a'),path[_0x599a('0x25')](_0x224471[_0x599a('0x26')])));}})});router[_0x599a('0x1f')]('/:id/favicon',upload['single'](_0x599a('0x21')),controller['addFavicon']);router[_0x599a('0x2b')](_0x599a('0xe'),auth['isAuthenticated'](),controller[_0x599a('0x2c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 8fcad53..13cffd5 100644 --- a/server/api/setting/setting.attributes.js +++ b/server/api/setting/setting.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x14c7a3,_0x37b708){var _0x75c7e5=function(_0x2ba595){while(--_0x2ba595){_0x14c7a3['push'](_0x14c7a3['shift']());}};_0x75c7e5(++_0x37b708);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x14}}; \ No newline at end of file +var _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x164449,_0x191168){var _0x1d6ebb=function(_0x333aa7){while(--_0x333aa7){_0x164449['push'](_0x164449['shift']());}};_0x1d6ebb(++_0x191168);}(_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')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x14}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index a123f31..c94f7e4 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 _0x5f10=['message','info','result','catch','sendStatus','status','offset','undefined','limit','count','set','apply','reject','save','update','destroy','stack','name','index','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','where','VIRTUAL','merge','options','includeAll','Setting','findAll','rows','params','rawAttributes','include','body','find','addLogo','file','logo','filename','addLogoLogin','loginLogo','../../config/license/util','server/files/images/logos','getLicense','preferred','favicon','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','default','upperFirst','default_logo.svg','Sequelize','\x20not\x20found','download','default_loginLogo.svg','custom','gdpr','securePassword','getPreferred','defaultLogo','default_preferred.png','ValidationError','addFavicon','getFavicon','default_favicon.ico','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','send','eml-format','rimraf','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x5f10,0xd5));var _0x05f1=function(_0x3dd567,_0x276ca9){_0x3dd567=_0x3dd567-0x0;var _0x415024=_0x5f10[_0x3dd567];return _0x415024;};'use strict';var emlformat=require(_0x05f1('0x0'));var rimraf=require(_0x05f1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x05f1('0x2'));var BPromise=require(_0x05f1('0x3'));var Mustache=require(_0x05f1('0x4'));var util=require(_0x05f1('0x5'));var path=require(_0x05f1('0x6'));var sox=require(_0x05f1('0x7'));var csv=require('to-csv');var ejs=require(_0x05f1('0x8'));var fs=require('fs');var fs_extra=require(_0x05f1('0x9'));var _=require(_0x05f1('0xa'));var squel=require('squel');var crypto=require(_0x05f1('0xb'));var jsforce=require(_0x05f1('0xc'));var deskjs=require(_0x05f1('0xd'));var toCsv=require(_0x05f1('0xe'));var querystring=require(_0x05f1('0xf'));var Papa=require(_0x05f1('0x10'));var Redis=require('ioredis');var authService=require(_0x05f1('0x11'));var qs=require(_0x05f1('0x12'));var as=require(_0x05f1('0x13'));var hardwareService=require(_0x05f1('0x14'));var logger=require(_0x05f1('0x15'))(_0x05f1('0x16'));var utils=require('../../config/utils');var config=require(_0x05f1('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x05f1('0x18'))['db'];var jayson=require(_0x05f1('0x19'));var client=jayson[_0x05f1('0x1a')][_0x05f1('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x7b194a,_0x3497ae,_0x1367de,_0x1fae83){return new BPromise(function(_0x407c6d,_0x5b47c7){var _0x2231d0=_0x1fae83||client;return _0x2231d0[_0x05f1('0x1c')](_0x7b194a,_0x1367de)[_0x05f1('0x1d')](function(_0x238e75){logger['info'](_0x05f1('0x1e'),_0x3497ae,_0x05f1('0x1f'));logger[_0x05f1('0x20')](_0x05f1('0x21'),_0x3497ae,_0x05f1('0x1f'),JSON[_0x05f1('0x22')](_0x238e75));if(_0x238e75[_0x05f1('0x23')]){if(_0x238e75[_0x05f1('0x23')][_0x05f1('0x24')]===0x1f4){logger[_0x05f1('0x23')](_0x05f1('0x1e'),_0x3497ae,_0x238e75[_0x05f1('0x23')][_0x05f1('0x25')]);return _0x5b47c7(_0x238e75[_0x05f1('0x23')]['message']);}logger[_0x05f1('0x23')](_0x05f1('0x1e'),_0x3497ae,_0x238e75[_0x05f1('0x23')][_0x05f1('0x25')]);return _0x407c6d(_0x238e75[_0x05f1('0x23')]['message']);}else{logger[_0x05f1('0x26')](_0x05f1('0x1e'),_0x3497ae,'request\x20sent');_0x407c6d(_0x238e75[_0x05f1('0x27')][_0x05f1('0x25')]);}})[_0x05f1('0x28')](function(_0x71d902){logger['error']('Setting,\x20%s,\x20%s',_0x3497ae,_0x71d902);_0x5b47c7(_0x71d902);});});}function respondWithStatusCode(_0x2ea7ba,_0x46eb59){_0x46eb59=_0x46eb59||0xcc;return function(_0x11e4e5){if(_0x11e4e5){return _0x2ea7ba[_0x05f1('0x29')](_0x46eb59);}return _0x2ea7ba[_0x05f1('0x2a')](_0x46eb59)['end']();};}function respondWithResult(_0x2722c9,_0x61148c){_0x61148c=_0x61148c||0xc8;return function(_0x5b7602){if(_0x5b7602){return _0x2722c9[_0x05f1('0x2a')](_0x61148c)['json'](_0x5b7602);}};}function respondWithFilteredResult(_0x54e497,_0x2ba26d){return function(_0x3bce89){if(_0x3bce89){var _0x472d00=typeof _0x2ba26d[_0x05f1('0x2b')]===_0x05f1('0x2c')&&typeof _0x2ba26d[_0x05f1('0x2d')]==='undefined';var _0x20d91f=_0x3bce89[_0x05f1('0x2e')];var _0x95336e=_0x472d00?0x0:_0x2ba26d['offset'];var _0x4e02e8=_0x472d00?_0x3bce89['count']:_0x2ba26d[_0x05f1('0x2b')]+_0x2ba26d[_0x05f1('0x2d')];var _0x337b2b;if(_0x4e02e8>=_0x20d91f){_0x4e02e8=_0x20d91f;_0x337b2b=0xc8;}else{_0x337b2b=0xce;}_0x54e497[_0x05f1('0x2a')](_0x337b2b);return _0x54e497[_0x05f1('0x2f')]('Content-Range',_0x95336e+'-'+_0x4e02e8+'/'+_0x20d91f)['json'](_0x3bce89);}return null;};}function patchUpdates(_0x5abc88){return function(_0x40ca01){try{jsonpatch[_0x05f1('0x30')](_0x40ca01,_0x5abc88,!![]);}catch(_0xb18f59){return BPromise[_0x05f1('0x31')](_0xb18f59);}return _0x40ca01[_0x05f1('0x32')]();};}function saveUpdates(_0xd88f8a,_0x58c710){return function(_0x33a533){if(_0x33a533){return _0x33a533[_0x05f1('0x33')](_0xd88f8a)['then'](function(_0x1bd03a){return _0x1bd03a;});}return null;};}function removeEntity(_0x3057a5,_0x5f55bf){return function(_0x1099b2){if(_0x1099b2){return _0x1099b2[_0x05f1('0x34')]()['then'](function(){_0x3057a5[_0x05f1('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x53584d,_0x3734d0){return function(_0x34f52e){if(!_0x34f52e){_0x53584d[_0x05f1('0x29')](0x194);}return _0x34f52e;};}function handleError(_0xe37340,_0x376dc7){_0x376dc7=_0x376dc7||0x1f4;return function(_0xf5dee1){logger[_0x05f1('0x23')](_0xf5dee1[_0x05f1('0x35')]);if(_0xf5dee1[_0x05f1('0x36')]){delete _0xf5dee1[_0x05f1('0x36')];}_0xe37340[_0x05f1('0x2a')](_0x376dc7)['send'](_0xf5dee1);};}exports[_0x05f1('0x37')]=function(_0xbc7226,_0x3a0c05){var _0x11f0df={},_0x3fe72e={},_0x3e7b39={'count':0x0,'rows':[]};var _0x280555=_['map'](db['Setting']['rawAttributes'],function(_0x2f897d){return{'name':_0x2f897d[_0x05f1('0x38')],'type':_0x2f897d[_0x05f1('0x39')][_0x05f1('0x3a')]};});_0x3fe72e[_0x05f1('0x3b')]=_[_0x05f1('0x3c')](_0x280555,_0x05f1('0x36'));_0x3fe72e['query']=_[_0x05f1('0x3d')](_0xbc7226[_0x05f1('0x3e')]);_0x3fe72e[_0x05f1('0x3f')]=_[_0x05f1('0x40')](_0x3fe72e['model'],_0x3fe72e[_0x05f1('0x3e')]);_0x11f0df[_0x05f1('0x41')]=_[_0x05f1('0x40')](_0x3fe72e[_0x05f1('0x3b')],qs[_0x05f1('0x42')](_0xbc7226[_0x05f1('0x3e')][_0x05f1('0x42')]));_0x11f0df[_0x05f1('0x41')]=_0x11f0df[_0x05f1('0x41')][_0x05f1('0x43')]?_0x11f0df['attributes']:_0x3fe72e['model'];if(!_0xbc7226['query'][_0x05f1('0x44')]('nolimit')){_0x11f0df[_0x05f1('0x2d')]=qs[_0x05f1('0x2d')](_0xbc7226[_0x05f1('0x3e')][_0x05f1('0x2d')]);_0x11f0df[_0x05f1('0x2b')]=qs[_0x05f1('0x2b')](_0xbc7226[_0x05f1('0x3e')][_0x05f1('0x2b')]);}_0x11f0df[_0x05f1('0x45')]=qs[_0x05f1('0x46')](_0xbc7226[_0x05f1('0x3e')][_0x05f1('0x46')]);_0x11f0df['where']=qs[_0x05f1('0x3f')](_[_0x05f1('0x47')](_0xbc7226[_0x05f1('0x3e')],_0x3fe72e[_0x05f1('0x3f')]),_0x280555);if(_0xbc7226['query']['filter']){_0x11f0df[_0x05f1('0x48')]=_['merge'](_0x11f0df['where'],{'$or':_[_0x05f1('0x3c')](_0x280555,function(_0x236720){if(_0x236720['type']!==_0x05f1('0x49')){var _0x79d813={};_0x79d813[_0x236720[_0x05f1('0x36')]]={'$like':'%'+_0xbc7226['query']['filter']+'%'};return _0x79d813;}})});}_0x11f0df=_[_0x05f1('0x4a')]({},_0x11f0df,_0xbc7226[_0x05f1('0x4b')]);var _0xfe0788={'where':_0x11f0df['where']};return db['Setting']['count'](_0xfe0788)[_0x05f1('0x1d')](function(_0x3c2d01){_0x3e7b39[_0x05f1('0x2e')]=_0x3c2d01;if(_0xbc7226['query'][_0x05f1('0x4c')]){_0x11f0df['include']=[{'all':!![]}];}return db[_0x05f1('0x4d')][_0x05f1('0x4e')](_0x11f0df);})['then'](function(_0x586f5a){_0x3e7b39[_0x05f1('0x4f')]=_0x586f5a;return _0x3e7b39;})[_0x05f1('0x1d')](respondWithFilteredResult(_0x3a0c05,_0x11f0df))[_0x05f1('0x28')](handleError(_0x3a0c05,null));};exports['show']=function(_0x3140b6,_0x1dad9b){var _0x42c428={'raw':![],'where':{'id':_0x3140b6[_0x05f1('0x50')]['id']}},_0x23a951={};_0x23a951[_0x05f1('0x3b')]=_['keys'](db['Setting'][_0x05f1('0x51')]);_0x23a951[_0x05f1('0x3e')]=_['keys'](_0x3140b6[_0x05f1('0x3e')]);_0x23a951['filters']=_[_0x05f1('0x40')](_0x23a951[_0x05f1('0x3b')],_0x23a951['query']);_0x42c428[_0x05f1('0x41')]=_['intersection'](_0x23a951['model'],qs['fields'](_0x3140b6[_0x05f1('0x3e')][_0x05f1('0x42')]));_0x42c428['attributes']=_0x42c428[_0x05f1('0x41')][_0x05f1('0x43')]?_0x42c428[_0x05f1('0x41')]:_0x23a951[_0x05f1('0x3b')];if(_0x3140b6[_0x05f1('0x3e')][_0x05f1('0x4c')]){_0x42c428[_0x05f1('0x52')]=[{'all':!![]}];}_0x42c428=_[_0x05f1('0x4a')]({},_0x42c428,_0x3140b6[_0x05f1('0x4b')]);return db[_0x05f1('0x4d')]['find'](_0x42c428)[_0x05f1('0x1d')](handleEntityNotFound(_0x1dad9b,null))['then'](respondWithResult(_0x1dad9b,null))['catch'](handleError(_0x1dad9b,null));};exports[_0x05f1('0x33')]=function(_0x241aed,_0x2fb560){if(_0x241aed[_0x05f1('0x53')]['id']){delete _0x241aed['body']['id'];}return db['Setting'][_0x05f1('0x54')]({'where':{'id':_0x241aed[_0x05f1('0x50')]['id']}})[_0x05f1('0x1d')](handleEntityNotFound(_0x2fb560,null))[_0x05f1('0x1d')](saveUpdates(_0x241aed[_0x05f1('0x53')],null))[_0x05f1('0x1d')](respondWithResult(_0x2fb560,null))['catch'](handleError(_0x2fb560,null));};exports[_0x05f1('0x55')]=function(_0x2a1dc9,_0x1b4fe7,_0x5e72f0){if(_0x2a1dc9[_0x05f1('0x56')]&&_0x2a1dc9[_0x05f1('0x56')]['filename']){_0x2a1dc9[_0x05f1('0x53')][_0x05f1('0x57')]=_0x2a1dc9[_0x05f1('0x56')][_0x05f1('0x58')];}return db[_0x05f1('0x4d')]['find']({'where':{'id':_0x2a1dc9[_0x05f1('0x50')]['id']}})[_0x05f1('0x1d')](handleEntityNotFound(_0x1b4fe7,null))['then'](saveUpdates(_0x2a1dc9[_0x05f1('0x53')],null))['then'](respondWithResult(_0x1b4fe7,null))[_0x05f1('0x28')](handleError(_0x1b4fe7,null));};exports[_0x05f1('0x59')]=function(_0x13a9aa,_0x4f9cea,_0x273aa6){if(_0x13a9aa[_0x05f1('0x56')]&&_0x13a9aa['file'][_0x05f1('0x58')]){_0x13a9aa[_0x05f1('0x53')][_0x05f1('0x5a')]=_0x13a9aa[_0x05f1('0x56')][_0x05f1('0x58')];}return db['Setting'][_0x05f1('0x54')]({'where':{'id':_0x13a9aa[_0x05f1('0x50')]['id']}})[_0x05f1('0x1d')](handleEntityNotFound(_0x4f9cea,null))[_0x05f1('0x1d')](saveUpdates(_0x13a9aa[_0x05f1('0x53')],null))['then'](respondWithResult(_0x4f9cea,null))[_0x05f1('0x28')](handleError(_0x4f9cea,null));};var utilLicense=require(_0x05f1('0x5b'));exports['getLogo']=function(_0x3418ab,_0x2bea77,_0x48bd80){var _0x5468ca=_0x05f1('0x5c');var _0x29d017={'custom':![]};return utilLicense[_0x05f1('0x5d')]()[_0x05f1('0x1d')](function(_0x78dcdf){if(_0x78dcdf){_0x29d017=_0x78dcdf;}return db[_0x05f1('0x4d')][_0x05f1('0x54')]({'where':{'id':_0x3418ab[_0x05f1('0x50')]['id']},'attributes':[_0x05f1('0x57'),_0x05f1('0x5a'),_0x05f1('0x5e'),_0x05f1('0x5f'),'defaultLogo',_0x05f1('0x60'),_0x05f1('0x61'),_0x05f1('0x62')],'raw':!![]});})[_0x05f1('0x1d')](handleEntityNotFound(_0x2bea77,null))['then'](function(_0x19c5de){if(_0x19c5de){var _0x3e2824=_0x19c5de[_0x05f1('0x57')]&&fs[_0x05f1('0x63')](path[_0x05f1('0x64')](config[_0x05f1('0x65')],_0x5468ca,_[_0x05f1('0x66')](_0x19c5de['logo'])))?path['join'](config[_0x05f1('0x65')],_0x5468ca,_['toLower'](_0x19c5de[_0x05f1('0x57')])):path['join'](config['root'],_0x5468ca,_['toLower']('default_logo.svg'));var _0x533aff=_0x05f1('0x67')+_[_0x05f1('0x68')](_0x05f1('0x57'));if(_0x19c5de[_0x533aff]||!_0x29d017['custom']){_0x3e2824=path[_0x05f1('0x64')](config[_0x05f1('0x65')],_0x5468ca,_[_0x05f1('0x66')](_0x05f1('0x69')));}if(!fs[_0x05f1('0x63')](_0x3e2824)){throw new db[(_0x05f1('0x6a'))]['ValidationError'](_[_0x05f1('0x68')](_0x05f1('0x57'))+_0x05f1('0x6b'));}return _0x2bea77[_0x05f1('0x6c')](_0x3e2824);}})[_0x05f1('0x28')](handleError(_0x2bea77,null));};var utilLicense=require(_0x05f1('0x5b'));exports['getLogoLogin']=function(_0x591a5d,_0x107fac,_0x2f91cb){var _0x3fb393='server/files/images/logos';var _0x459803={'custom':![]};return utilLicense[_0x05f1('0x5d')]()[_0x05f1('0x1d')](function(_0x4cbef2){if(_0x4cbef2){_0x459803=_0x4cbef2;}return db[_0x05f1('0x4d')][_0x05f1('0x54')]({'where':{'id':_0x591a5d[_0x05f1('0x50')]['id']},'attributes':[_0x05f1('0x57'),_0x05f1('0x5a'),_0x05f1('0x5e'),_0x05f1('0x5f'),'defaultLogo',_0x05f1('0x60'),_0x05f1('0x61'),_0x05f1('0x62')],'raw':!![]});})[_0x05f1('0x1d')](handleEntityNotFound(_0x107fac,null))['then'](function(_0x168247){if(_0x168247){var _0x46ff2f=_0x168247[_0x05f1('0x5a')]&&fs[_0x05f1('0x63')](path[_0x05f1('0x64')](config[_0x05f1('0x65')],_0x3fb393,_[_0x05f1('0x66')](_0x168247[_0x05f1('0x5a')])))?path[_0x05f1('0x64')](config[_0x05f1('0x65')],_0x3fb393,_['toLower'](_0x168247['loginLogo'])):path[_0x05f1('0x64')](config[_0x05f1('0x65')],_0x3fb393,_[_0x05f1('0x66')](_0x05f1('0x6d')));var _0x311179=_0x05f1('0x67')+_[_0x05f1('0x68')](_0x05f1('0x5a'));if(_0x168247[_0x311179]||!_0x459803[_0x05f1('0x6e')]){_0x46ff2f=path[_0x05f1('0x64')](config[_0x05f1('0x65')],_0x3fb393,_[_0x05f1('0x66')](_0x05f1('0x6d')));}if(!fs['existsSync'](_0x46ff2f)){throw new db[(_0x05f1('0x6a'))]['ValidationError'](_[_0x05f1('0x68')](_0x05f1('0x5a'))+_0x05f1('0x6b'));}return _0x107fac[_0x05f1('0x6c')](_0x46ff2f);}})[_0x05f1('0x28')](handleError(_0x107fac,null));};exports[_0x05f1('0x6f')]=function(_0x5ed3f2,_0x3d0858){return db[_0x05f1('0x4d')][_0x05f1('0x54')]({'where':{'id':_0x5ed3f2[_0x05f1('0x50')]['id']},'attributes':[_0x05f1('0x70')]})['then'](respondWithResult(_0x3d0858,null))[_0x05f1('0x28')](handleError(_0x3d0858,null));};exports['addPreferred']=function(_0x1525a9,_0x422d75,_0x3477b3){if(_0x1525a9[_0x05f1('0x56')]&&_0x1525a9[_0x05f1('0x56')][_0x05f1('0x58')]){_0x1525a9['body'][_0x05f1('0x5e')]=_0x1525a9[_0x05f1('0x56')][_0x05f1('0x58')];}return db['Setting'][_0x05f1('0x54')]({'where':{'id':_0x1525a9[_0x05f1('0x50')]['id']}})[_0x05f1('0x1d')](handleEntityNotFound(_0x422d75,null))[_0x05f1('0x1d')](saveUpdates(_0x1525a9[_0x05f1('0x53')],null))[_0x05f1('0x1d')](respondWithResult(_0x422d75,null))[_0x05f1('0x28')](handleError(_0x422d75,null));};var utilLicense=require('../../config/license/util');exports[_0x05f1('0x71')]=function(_0x44a495,_0x2e00d1,_0xb7a72){var _0x1fd9ac='server/files/images/logos';var _0x2814a9={'custom':![]};return utilLicense[_0x05f1('0x5d')]()[_0x05f1('0x1d')](function(_0x5391e8){if(_0x5391e8){_0x2814a9=_0x5391e8;}return db[_0x05f1('0x4d')][_0x05f1('0x54')]({'where':{'id':_0x44a495['params']['id']},'attributes':[_0x05f1('0x57'),_0x05f1('0x5a'),_0x05f1('0x5e'),_0x05f1('0x5f'),_0x05f1('0x72'),_0x05f1('0x60'),_0x05f1('0x61'),_0x05f1('0x62')],'raw':!![]});})[_0x05f1('0x1d')](handleEntityNotFound(_0x2e00d1,null))[_0x05f1('0x1d')](function(_0x147a7c){if(_0x147a7c){var _0x1cd123=_0x147a7c['preferred']&&fs['existsSync'](path[_0x05f1('0x64')](config[_0x05f1('0x65')],_0x1fd9ac,_[_0x05f1('0x66')](_0x147a7c[_0x05f1('0x5e')])))?path['join'](config[_0x05f1('0x65')],_0x1fd9ac,_[_0x05f1('0x66')](_0x147a7c['preferred'])):path['join'](config['root'],_0x1fd9ac,_['toLower'](_0x05f1('0x73')));var _0x5e19b5='default'+_[_0x05f1('0x68')](_0x05f1('0x5e'));if(_0x147a7c[_0x5e19b5]||!_0x2814a9['custom']||!_0x2814a9[_0x05f1('0x5e')]){_0x1cd123=path[_0x05f1('0x64')](config[_0x05f1('0x65')],_0x1fd9ac,_[_0x05f1('0x66')](_0x05f1('0x73')));}if(!fs[_0x05f1('0x63')](_0x1cd123)){throw new db[(_0x05f1('0x6a'))][(_0x05f1('0x74'))](_[_0x05f1('0x68')](_0x05f1('0x5e'))+'\x20not\x20found');}return _0x2e00d1[_0x05f1('0x6c')](_0x1cd123);}})[_0x05f1('0x28')](handleError(_0x2e00d1,null));};exports[_0x05f1('0x75')]=function(_0x52b53f,_0x310c4b,_0x1bfa14){if(_0x52b53f[_0x05f1('0x56')]&&_0x52b53f[_0x05f1('0x56')]['filename']){_0x52b53f[_0x05f1('0x53')][_0x05f1('0x5f')]=_0x52b53f[_0x05f1('0x56')][_0x05f1('0x58')];}return db[_0x05f1('0x4d')]['find']({'where':{'id':_0x52b53f[_0x05f1('0x50')]['id']}})[_0x05f1('0x1d')](handleEntityNotFound(_0x310c4b,null))[_0x05f1('0x1d')](saveUpdates(_0x52b53f[_0x05f1('0x53')],null))[_0x05f1('0x1d')](respondWithResult(_0x310c4b,null))[_0x05f1('0x28')](handleError(_0x310c4b,null));};var utilLicense=require('../../config/license/util');exports[_0x05f1('0x76')]=function(_0x589d57,_0x394313,_0x18436b){var _0x21adbf='server/files/images/logos';var _0x369dbb={'custom':![]};return utilLicense['getLicense']()[_0x05f1('0x1d')](function(_0x14811b){if(_0x14811b){_0x369dbb=_0x14811b;}return db[_0x05f1('0x4d')][_0x05f1('0x54')]({'where':{'id':_0x589d57[_0x05f1('0x50')]['id']},'attributes':[_0x05f1('0x57'),_0x05f1('0x5a'),_0x05f1('0x5e'),'favicon',_0x05f1('0x72'),'defaultLoginLogo','defaultPreferred',_0x05f1('0x62')],'raw':!![]});})[_0x05f1('0x1d')](handleEntityNotFound(_0x394313,null))[_0x05f1('0x1d')](function(_0x451d37){if(_0x451d37){var _0x14b201=_0x451d37[_0x05f1('0x5f')]&&fs[_0x05f1('0x63')](path[_0x05f1('0x64')](config['root'],_0x21adbf,_[_0x05f1('0x66')](_0x451d37['favicon'])))?path[_0x05f1('0x64')](config[_0x05f1('0x65')],_0x21adbf,_['toLower'](_0x451d37[_0x05f1('0x5f')])):path[_0x05f1('0x64')](config[_0x05f1('0x65')],_0x21adbf,_[_0x05f1('0x66')](_0x05f1('0x77')));var _0x37ae78=_0x05f1('0x67')+_[_0x05f1('0x68')]('favicon');if(_0x451d37[_0x37ae78]||!_0x369dbb[_0x05f1('0x6e')]){_0x14b201=path[_0x05f1('0x64')](config[_0x05f1('0x65')],_0x21adbf,_[_0x05f1('0x66')]('default_favicon.ico'));}if(!fs[_0x05f1('0x63')](_0x14b201)){throw new db['Sequelize']['ValidationError'](_['upperFirst']('favicon')+_0x05f1('0x6b'));}return _0x394313[_0x05f1('0x6c')](_0x14b201);}})['catch'](handleError(_0x394313,null));};exports['getDate']=function(_0x120463,_0x5be391){var _0x269e8f={'offset':moment()[_0x05f1('0x78')]()};_0x269e8f[_0x05f1('0x79')]=moment()[_0x05f1('0x78')](_0x269e8f[_0x05f1('0x2b')])[_0x05f1('0x7a')](_0x05f1('0x7b'));return _0x5be391[_0x05f1('0x2a')](0xc8)[_0x05f1('0x7c')](_0x269e8f);}; \ No newline at end of file +var _0x26ed=['squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','end','sendStatus','stack','name','index','map','Setting','fieldName','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','where','pick','filter','type','VIRTUAL','merge','options','include','rows','show','rawAttributes','includeAll','find','body','params','filename','logo','file','loginLogo','../../config/license/util','getLogo','getLicense','favicon','defaultLogo','existsSync','join','toLower','root','default_logo.svg','default','upperFirst','custom','ValidationError','\x20not\x20found','download','getLogoLogin','server/files/images/logos','defaultLoginLogo','defaultFavicon','default_loginLogo.svg','Sequelize','gdpr','securePassword','addPreferred','preferred','getPreferred','defaultPreferred','default_preferred.png','getFavicon','default_favicon.ico','getDate','now','utcOffset','YYYY-MM-DD\x20HH:mm:ss:SSS','send','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash'];(function(_0x5d963e,_0x5edbfe){var _0x523c8e=function(_0x58d7ae){while(--_0x58d7ae){_0x5d963e['push'](_0x5d963e['shift']());}};_0x523c8e(++_0x5edbfe);}(_0x26ed,0x1f0));var _0xd26e=function(_0x37c07d,_0xdbdb5f){_0x37c07d=_0x37c07d-0x0;var _0x10dadc=_0x26ed[_0x37c07d];return _0x10dadc;};'use strict';var emlformat=require(_0xd26e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd26e('0x1'));var jsonpatch=require(_0xd26e('0x2'));var rp=require('request-promise');var moment=require(_0xd26e('0x3'));var BPromise=require(_0xd26e('0x4'));var Mustache=require(_0xd26e('0x5'));var util=require(_0xd26e('0x6'));var path=require(_0xd26e('0x7'));var sox=require(_0xd26e('0x8'));var csv=require(_0xd26e('0x9'));var ejs=require(_0xd26e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd26e('0xb'));var squel=require(_0xd26e('0xc'));var crypto=require(_0xd26e('0xd'));var jsforce=require(_0xd26e('0xe'));var deskjs=require(_0xd26e('0xf'));var toCsv=require('to-csv');var querystring=require(_0xd26e('0x10'));var Papa=require(_0xd26e('0x11'));var Redis=require(_0xd26e('0x12'));var authService=require(_0xd26e('0x13'));var qs=require(_0xd26e('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd26e('0x15'));var logger=require('../../config/logger')(_0xd26e('0x16'));var utils=require(_0xd26e('0x17'));var config=require(_0xd26e('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xd26e('0x19'))['db'];var jayson=require(_0xd26e('0x1a'));var client=jayson[_0xd26e('0x1b')][_0xd26e('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x352c4d,_0xecf61d,_0x2196a1,_0x1ca4a5){return new BPromise(function(_0x25d2a0,_0x19831f){var _0x3f7df9=_0x1ca4a5||client;return _0x3f7df9[_0xd26e('0x1d')](_0x352c4d,_0x2196a1)[_0xd26e('0x1e')](function(_0x197f4b){logger['info'](_0xd26e('0x1f'),_0xecf61d,_0xd26e('0x20'));logger[_0xd26e('0x21')](_0xd26e('0x22'),_0xecf61d,_0xd26e('0x20'),JSON[_0xd26e('0x23')](_0x197f4b));if(_0x197f4b[_0xd26e('0x24')]){if(_0x197f4b[_0xd26e('0x24')][_0xd26e('0x25')]===0x1f4){logger[_0xd26e('0x24')](_0xd26e('0x1f'),_0xecf61d,_0x197f4b[_0xd26e('0x24')][_0xd26e('0x26')]);return _0x19831f(_0x197f4b[_0xd26e('0x24')][_0xd26e('0x26')]);}logger[_0xd26e('0x24')](_0xd26e('0x1f'),_0xecf61d,_0x197f4b[_0xd26e('0x24')][_0xd26e('0x26')]);return _0x25d2a0(_0x197f4b[_0xd26e('0x24')][_0xd26e('0x26')]);}else{logger[_0xd26e('0x27')](_0xd26e('0x1f'),_0xecf61d,_0xd26e('0x20'));_0x25d2a0(_0x197f4b[_0xd26e('0x28')][_0xd26e('0x26')]);}})[_0xd26e('0x29')](function(_0x237337){logger[_0xd26e('0x24')]('Setting,\x20%s,\x20%s',_0xecf61d,_0x237337);_0x19831f(_0x237337);});});}function respondWithStatusCode(_0x3f658b,_0x17e197){_0x17e197=_0x17e197||0xcc;return function(_0x482d62){if(_0x482d62){return _0x3f658b['sendStatus'](_0x17e197);}return _0x3f658b[_0xd26e('0x2a')](_0x17e197)['end']();};}function respondWithResult(_0x34e276,_0x53e751){_0x53e751=_0x53e751||0xc8;return function(_0x140677){if(_0x140677){return _0x34e276[_0xd26e('0x2a')](_0x53e751)[_0xd26e('0x2b')](_0x140677);}};}function respondWithFilteredResult(_0x3ca26c,_0x125347){return function(_0x38f208){if(_0x38f208){var _0x26baf5=typeof _0x125347[_0xd26e('0x2c')]===_0xd26e('0x2d')&&typeof _0x125347['limit']===_0xd26e('0x2d');var _0x3fd445=_0x38f208['count'];var _0xb5505d=_0x26baf5?0x0:_0x125347[_0xd26e('0x2c')];var _0x5f2d68=_0x26baf5?_0x38f208[_0xd26e('0x2e')]:_0x125347['offset']+_0x125347[_0xd26e('0x2f')];var _0x542a82;if(_0x5f2d68>=_0x3fd445){_0x5f2d68=_0x3fd445;_0x542a82=0xc8;}else{_0x542a82=0xce;}_0x3ca26c[_0xd26e('0x2a')](_0x542a82);return _0x3ca26c[_0xd26e('0x30')](_0xd26e('0x31'),_0xb5505d+'-'+_0x5f2d68+'/'+_0x3fd445)['json'](_0x38f208);}return null;};}function patchUpdates(_0x13d8db){return function(_0x387a2d){try{jsonpatch[_0xd26e('0x32')](_0x387a2d,_0x13d8db,!![]);}catch(_0x5daa39){return BPromise[_0xd26e('0x33')](_0x5daa39);}return _0x387a2d[_0xd26e('0x34')]();};}function saveUpdates(_0x5dd7af,_0x2bb8d4){return function(_0x511a93){if(_0x511a93){return _0x511a93[_0xd26e('0x35')](_0x5dd7af)[_0xd26e('0x1e')](function(_0x44067f){return _0x44067f;});}return null;};}function removeEntity(_0x27d17f,_0x23d1b7){return function(_0x1fa541){if(_0x1fa541){return _0x1fa541[_0xd26e('0x36')]()[_0xd26e('0x1e')](function(){_0x27d17f['status'](0xcc)[_0xd26e('0x37')]();});}};}function handleEntityNotFound(_0x230fed,_0x31c687){return function(_0x362ef9){if(!_0x362ef9){_0x230fed[_0xd26e('0x38')](0x194);}return _0x362ef9;};}function handleError(_0xb30bb5,_0x5a8799){_0x5a8799=_0x5a8799||0x1f4;return function(_0x5d07b6){logger['error'](_0x5d07b6[_0xd26e('0x39')]);if(_0x5d07b6[_0xd26e('0x3a')]){delete _0x5d07b6[_0xd26e('0x3a')];}_0xb30bb5[_0xd26e('0x2a')](_0x5a8799)['send'](_0x5d07b6);};}exports[_0xd26e('0x3b')]=function(_0x15f343,_0x52d850){var _0x543e05={},_0x152748={},_0x21966f={'count':0x0,'rows':[]};var _0x395370=_[_0xd26e('0x3c')](db[_0xd26e('0x3d')]['rawAttributes'],function(_0x67d816){return{'name':_0x67d816[_0xd26e('0x3e')],'type':_0x67d816['type']['key']};});_0x152748['model']=_[_0xd26e('0x3c')](_0x395370,'name');_0x152748['query']=_[_0xd26e('0x3f')](_0x15f343[_0xd26e('0x40')]);_0x152748[_0xd26e('0x41')]=_['intersection'](_0x152748[_0xd26e('0x42')],_0x152748['query']);_0x543e05[_0xd26e('0x43')]=_[_0xd26e('0x44')](_0x152748[_0xd26e('0x42')],qs[_0xd26e('0x45')](_0x15f343[_0xd26e('0x40')][_0xd26e('0x45')]));_0x543e05[_0xd26e('0x43')]=_0x543e05[_0xd26e('0x43')][_0xd26e('0x46')]?_0x543e05[_0xd26e('0x43')]:_0x152748[_0xd26e('0x42')];if(!_0x15f343[_0xd26e('0x40')][_0xd26e('0x47')]('nolimit')){_0x543e05[_0xd26e('0x2f')]=qs[_0xd26e('0x2f')](_0x15f343[_0xd26e('0x40')][_0xd26e('0x2f')]);_0x543e05[_0xd26e('0x2c')]=qs[_0xd26e('0x2c')](_0x15f343['query'][_0xd26e('0x2c')]);}_0x543e05['order']=qs['sort'](_0x15f343['query']['sort']);_0x543e05[_0xd26e('0x48')]=qs[_0xd26e('0x41')](_[_0xd26e('0x49')](_0x15f343[_0xd26e('0x40')],_0x152748[_0xd26e('0x41')]),_0x395370);if(_0x15f343[_0xd26e('0x40')][_0xd26e('0x4a')]){_0x543e05[_0xd26e('0x48')]=_['merge'](_0x543e05['where'],{'$or':_[_0xd26e('0x3c')](_0x395370,function(_0xefe6f8){if(_0xefe6f8[_0xd26e('0x4b')]!==_0xd26e('0x4c')){var _0x2e45a7={};_0x2e45a7[_0xefe6f8['name']]={'$like':'%'+_0x15f343[_0xd26e('0x40')]['filter']+'%'};return _0x2e45a7;}})});}_0x543e05=_[_0xd26e('0x4d')]({},_0x543e05,_0x15f343[_0xd26e('0x4e')]);var _0x1bef6b={'where':_0x543e05['where']};return db[_0xd26e('0x3d')][_0xd26e('0x2e')](_0x1bef6b)[_0xd26e('0x1e')](function(_0xab48b2){_0x21966f['count']=_0xab48b2;if(_0x15f343[_0xd26e('0x40')]['includeAll']){_0x543e05[_0xd26e('0x4f')]=[{'all':!![]}];}return db[_0xd26e('0x3d')]['findAll'](_0x543e05);})[_0xd26e('0x1e')](function(_0xa1c464){_0x21966f[_0xd26e('0x50')]=_0xa1c464;return _0x21966f;})[_0xd26e('0x1e')](respondWithFilteredResult(_0x52d850,_0x543e05))[_0xd26e('0x29')](handleError(_0x52d850,null));};exports[_0xd26e('0x51')]=function(_0x4bfca5,_0xf03b30){var _0x4d6be7={'raw':![],'where':{'id':_0x4bfca5['params']['id']}},_0x44259c={};_0x44259c[_0xd26e('0x42')]=_[_0xd26e('0x3f')](db[_0xd26e('0x3d')][_0xd26e('0x52')]);_0x44259c[_0xd26e('0x40')]=_[_0xd26e('0x3f')](_0x4bfca5[_0xd26e('0x40')]);_0x44259c[_0xd26e('0x41')]=_['intersection'](_0x44259c[_0xd26e('0x42')],_0x44259c[_0xd26e('0x40')]);_0x4d6be7[_0xd26e('0x43')]=_[_0xd26e('0x44')](_0x44259c['model'],qs[_0xd26e('0x45')](_0x4bfca5[_0xd26e('0x40')]['fields']));_0x4d6be7[_0xd26e('0x43')]=_0x4d6be7['attributes'][_0xd26e('0x46')]?_0x4d6be7[_0xd26e('0x43')]:_0x44259c[_0xd26e('0x42')];if(_0x4bfca5[_0xd26e('0x40')][_0xd26e('0x53')]){_0x4d6be7['include']=[{'all':!![]}];}_0x4d6be7=_[_0xd26e('0x4d')]({},_0x4d6be7,_0x4bfca5[_0xd26e('0x4e')]);return db[_0xd26e('0x3d')][_0xd26e('0x54')](_0x4d6be7)['then'](handleEntityNotFound(_0xf03b30,null))['then'](respondWithResult(_0xf03b30,null))[_0xd26e('0x29')](handleError(_0xf03b30,null));};exports[_0xd26e('0x35')]=function(_0x458031,_0x52d184){if(_0x458031[_0xd26e('0x55')]['id']){delete _0x458031[_0xd26e('0x55')]['id'];}return db[_0xd26e('0x3d')]['find']({'where':{'id':_0x458031[_0xd26e('0x56')]['id']}})[_0xd26e('0x1e')](handleEntityNotFound(_0x52d184,null))['then'](saveUpdates(_0x458031[_0xd26e('0x55')],null))[_0xd26e('0x1e')](respondWithResult(_0x52d184,null))[_0xd26e('0x29')](handleError(_0x52d184,null));};exports['addLogo']=function(_0x183e13,_0x5c8b2e,_0x268bda){if(_0x183e13['file']&&_0x183e13['file'][_0xd26e('0x57')]){_0x183e13[_0xd26e('0x55')][_0xd26e('0x58')]=_0x183e13[_0xd26e('0x59')]['filename'];}return db[_0xd26e('0x3d')][_0xd26e('0x54')]({'where':{'id':_0x183e13[_0xd26e('0x56')]['id']}})[_0xd26e('0x1e')](handleEntityNotFound(_0x5c8b2e,null))[_0xd26e('0x1e')](saveUpdates(_0x183e13['body'],null))[_0xd26e('0x1e')](respondWithResult(_0x5c8b2e,null))[_0xd26e('0x29')](handleError(_0x5c8b2e,null));};exports['addLogoLogin']=function(_0x69010d,_0x134172,_0x2d44cf){if(_0x69010d[_0xd26e('0x59')]&&_0x69010d['file'][_0xd26e('0x57')]){_0x69010d[_0xd26e('0x55')][_0xd26e('0x5a')]=_0x69010d[_0xd26e('0x59')]['filename'];}return db[_0xd26e('0x3d')]['find']({'where':{'id':_0x69010d['params']['id']}})[_0xd26e('0x1e')](handleEntityNotFound(_0x134172,null))[_0xd26e('0x1e')](saveUpdates(_0x69010d[_0xd26e('0x55')],null))[_0xd26e('0x1e')](respondWithResult(_0x134172,null))[_0xd26e('0x29')](handleError(_0x134172,null));};var utilLicense=require(_0xd26e('0x5b'));exports[_0xd26e('0x5c')]=function(_0x5403e9,_0x5bc2bb,_0x59d0ef){var _0x3407f6='server/files/images/logos';var _0x4150ec={'custom':![]};return utilLicense[_0xd26e('0x5d')]()['then'](function(_0x456d88){if(_0x456d88){_0x4150ec=_0x456d88;}return db['Setting'][_0xd26e('0x54')]({'where':{'id':_0x5403e9[_0xd26e('0x56')]['id']},'attributes':['logo',_0xd26e('0x5a'),'preferred',_0xd26e('0x5e'),_0xd26e('0x5f'),'defaultLoginLogo','defaultPreferred','defaultFavicon'],'raw':!![]});})[_0xd26e('0x1e')](handleEntityNotFound(_0x5bc2bb,null))[_0xd26e('0x1e')](function(_0x3f82d8){if(_0x3f82d8){var _0x4c58ef=_0x3f82d8['logo']&&fs[_0xd26e('0x60')](path[_0xd26e('0x61')](config['root'],_0x3407f6,_[_0xd26e('0x62')](_0x3f82d8[_0xd26e('0x58')])))?path[_0xd26e('0x61')](config[_0xd26e('0x63')],_0x3407f6,_[_0xd26e('0x62')](_0x3f82d8[_0xd26e('0x58')])):path['join'](config[_0xd26e('0x63')],_0x3407f6,_[_0xd26e('0x62')](_0xd26e('0x64')));var _0x449a41=_0xd26e('0x65')+_[_0xd26e('0x66')](_0xd26e('0x58'));if(_0x3f82d8[_0x449a41]||!_0x4150ec[_0xd26e('0x67')]){_0x4c58ef=path[_0xd26e('0x61')](config[_0xd26e('0x63')],_0x3407f6,_[_0xd26e('0x62')]('default_logo.svg'));}if(!fs[_0xd26e('0x60')](_0x4c58ef)){throw new db['Sequelize'][(_0xd26e('0x68'))](_[_0xd26e('0x66')]('logo')+_0xd26e('0x69'));}return _0x5bc2bb[_0xd26e('0x6a')](_0x4c58ef);}})[_0xd26e('0x29')](handleError(_0x5bc2bb,null));};var utilLicense=require(_0xd26e('0x5b'));exports[_0xd26e('0x6b')]=function(_0x474a95,_0x4a7c83,_0x314dd4){var _0x54e712=_0xd26e('0x6c');var _0x2ca215={'custom':![]};return utilLicense['getLicense']()[_0xd26e('0x1e')](function(_0x5f0691){if(_0x5f0691){_0x2ca215=_0x5f0691;}return db['Setting'][_0xd26e('0x54')]({'where':{'id':_0x474a95['params']['id']},'attributes':[_0xd26e('0x58'),_0xd26e('0x5a'),'preferred',_0xd26e('0x5e'),'defaultLogo',_0xd26e('0x6d'),'defaultPreferred',_0xd26e('0x6e')],'raw':!![]});})['then'](handleEntityNotFound(_0x4a7c83,null))[_0xd26e('0x1e')](function(_0x124e0f){if(_0x124e0f){var _0x56b972=_0x124e0f[_0xd26e('0x5a')]&&fs[_0xd26e('0x60')](path[_0xd26e('0x61')](config[_0xd26e('0x63')],_0x54e712,_[_0xd26e('0x62')](_0x124e0f[_0xd26e('0x5a')])))?path[_0xd26e('0x61')](config[_0xd26e('0x63')],_0x54e712,_[_0xd26e('0x62')](_0x124e0f['loginLogo'])):path['join'](config[_0xd26e('0x63')],_0x54e712,_[_0xd26e('0x62')](_0xd26e('0x6f')));var _0x102fdf=_0xd26e('0x65')+_[_0xd26e('0x66')](_0xd26e('0x5a'));if(_0x124e0f[_0x102fdf]||!_0x2ca215['custom']){_0x56b972=path[_0xd26e('0x61')](config[_0xd26e('0x63')],_0x54e712,_['toLower'](_0xd26e('0x6f')));}if(!fs[_0xd26e('0x60')](_0x56b972)){throw new db[(_0xd26e('0x70'))][(_0xd26e('0x68'))](_[_0xd26e('0x66')](_0xd26e('0x5a'))+_0xd26e('0x69'));}return _0x4a7c83['download'](_0x56b972);}})[_0xd26e('0x29')](handleError(_0x4a7c83,null));};exports[_0xd26e('0x71')]=function(_0x2f84d9,_0x2aeb73){return db[_0xd26e('0x3d')][_0xd26e('0x54')]({'where':{'id':_0x2f84d9[_0xd26e('0x56')]['id']},'attributes':[_0xd26e('0x72')]})[_0xd26e('0x1e')](respondWithResult(_0x2aeb73,null))['catch'](handleError(_0x2aeb73,null));};exports[_0xd26e('0x73')]=function(_0x1e705c,_0x256cfd,_0x10fc3d){if(_0x1e705c['file']&&_0x1e705c[_0xd26e('0x59')]['filename']){_0x1e705c[_0xd26e('0x55')][_0xd26e('0x74')]=_0x1e705c['file'][_0xd26e('0x57')];}return db['Setting'][_0xd26e('0x54')]({'where':{'id':_0x1e705c['params']['id']}})[_0xd26e('0x1e')](handleEntityNotFound(_0x256cfd,null))[_0xd26e('0x1e')](saveUpdates(_0x1e705c[_0xd26e('0x55')],null))[_0xd26e('0x1e')](respondWithResult(_0x256cfd,null))[_0xd26e('0x29')](handleError(_0x256cfd,null));};var utilLicense=require(_0xd26e('0x5b'));exports[_0xd26e('0x75')]=function(_0x5cb898,_0x11e629,_0x1e94b1){var _0x4ccad1='server/files/images/logos';var _0x280327={'custom':![]};return utilLicense[_0xd26e('0x5d')]()[_0xd26e('0x1e')](function(_0x266961){if(_0x266961){_0x280327=_0x266961;}return db[_0xd26e('0x3d')][_0xd26e('0x54')]({'where':{'id':_0x5cb898[_0xd26e('0x56')]['id']},'attributes':[_0xd26e('0x58'),_0xd26e('0x5a'),_0xd26e('0x74'),_0xd26e('0x5e'),_0xd26e('0x5f'),_0xd26e('0x6d'),_0xd26e('0x76'),_0xd26e('0x6e')],'raw':!![]});})[_0xd26e('0x1e')](handleEntityNotFound(_0x11e629,null))[_0xd26e('0x1e')](function(_0x26bf9e){if(_0x26bf9e){var _0x45ed42=_0x26bf9e[_0xd26e('0x74')]&&fs[_0xd26e('0x60')](path['join'](config[_0xd26e('0x63')],_0x4ccad1,_[_0xd26e('0x62')](_0x26bf9e[_0xd26e('0x74')])))?path[_0xd26e('0x61')](config[_0xd26e('0x63')],_0x4ccad1,_['toLower'](_0x26bf9e[_0xd26e('0x74')])):path[_0xd26e('0x61')](config['root'],_0x4ccad1,_[_0xd26e('0x62')](_0xd26e('0x77')));var _0x43b3b8=_0xd26e('0x65')+_[_0xd26e('0x66')]('preferred');if(_0x26bf9e[_0x43b3b8]||!_0x280327['custom']||!_0x280327['preferred']){_0x45ed42=path[_0xd26e('0x61')](config['root'],_0x4ccad1,_[_0xd26e('0x62')]('default_preferred.png'));}if(!fs['existsSync'](_0x45ed42)){throw new db['Sequelize'][(_0xd26e('0x68'))](_[_0xd26e('0x66')]('preferred')+_0xd26e('0x69'));}return _0x11e629[_0xd26e('0x6a')](_0x45ed42);}})['catch'](handleError(_0x11e629,null));};exports['addFavicon']=function(_0x58caea,_0x35eb53,_0x4bc995){if(_0x58caea[_0xd26e('0x59')]&&_0x58caea['file']['filename']){_0x58caea[_0xd26e('0x55')]['favicon']=_0x58caea['file'][_0xd26e('0x57')];}return db[_0xd26e('0x3d')][_0xd26e('0x54')]({'where':{'id':_0x58caea[_0xd26e('0x56')]['id']}})[_0xd26e('0x1e')](handleEntityNotFound(_0x35eb53,null))[_0xd26e('0x1e')](saveUpdates(_0x58caea['body'],null))[_0xd26e('0x1e')](respondWithResult(_0x35eb53,null))[_0xd26e('0x29')](handleError(_0x35eb53,null));};var utilLicense=require(_0xd26e('0x5b'));exports[_0xd26e('0x78')]=function(_0x159195,_0x1de520,_0x2e20af){var _0x5a8833=_0xd26e('0x6c');var _0xaddd7b={'custom':![]};return utilLicense[_0xd26e('0x5d')]()['then'](function(_0x46d368){if(_0x46d368){_0xaddd7b=_0x46d368;}return db[_0xd26e('0x3d')]['find']({'where':{'id':_0x159195['params']['id']},'attributes':[_0xd26e('0x58'),_0xd26e('0x5a'),_0xd26e('0x74'),_0xd26e('0x5e'),_0xd26e('0x5f'),_0xd26e('0x6d'),_0xd26e('0x76'),_0xd26e('0x6e')],'raw':!![]});})['then'](handleEntityNotFound(_0x1de520,null))[_0xd26e('0x1e')](function(_0x4012c5){if(_0x4012c5){var _0x128362=_0x4012c5[_0xd26e('0x5e')]&&fs[_0xd26e('0x60')](path[_0xd26e('0x61')](config['root'],_0x5a8833,_[_0xd26e('0x62')](_0x4012c5[_0xd26e('0x5e')])))?path[_0xd26e('0x61')](config[_0xd26e('0x63')],_0x5a8833,_[_0xd26e('0x62')](_0x4012c5['favicon'])):path[_0xd26e('0x61')](config[_0xd26e('0x63')],_0x5a8833,_[_0xd26e('0x62')](_0xd26e('0x79')));var _0x1325bf='default'+_[_0xd26e('0x66')](_0xd26e('0x5e'));if(_0x4012c5[_0x1325bf]||!_0xaddd7b[_0xd26e('0x67')]){_0x128362=path[_0xd26e('0x61')](config[_0xd26e('0x63')],_0x5a8833,_[_0xd26e('0x62')](_0xd26e('0x79')));}if(!fs['existsSync'](_0x128362)){throw new db[(_0xd26e('0x70'))][(_0xd26e('0x68'))](_[_0xd26e('0x66')](_0xd26e('0x5e'))+_0xd26e('0x69'));}return _0x1de520[_0xd26e('0x6a')](_0x128362);}})['catch'](handleError(_0x1de520,null));};exports[_0xd26e('0x7a')]=function(_0xe39f67,_0x3644ac){var _0x3f5eff={'offset':moment()['utcOffset']()};_0x3f5eff[_0xd26e('0x7b')]=moment()[_0xd26e('0x7c')](_0x3f5eff[_0xd26e('0x2c')])['format'](_0xd26e('0x7d'));return _0x3644ac[_0xd26e('0x2a')](0xc8)[_0xd26e('0x7e')](_0x3f5eff);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 9cfcd86..26b4cb2 100644 --- a/server/api/setting/setting.model.js +++ b/server/api/setting/setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['define','settings','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports'];(function(_0x20ae3b,_0x23a21c){var _0x391475=function(_0x590776){while(--_0x590776){_0x20ae3b['push'](_0x20ae3b['shift']());}};_0x391475(++_0x23a21c);}(_0x008c,0x188));var _0xc008=function(_0x2ef608,_0x53a7b1){_0x2ef608=_0x2ef608-0x0;var _0x56aa07=_0x008c[_0x2ef608];return _0x56aa07;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('Setting',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x34e8=['settings','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports','Setting'];(function(_0x2a8c1b,_0x1572ce){var _0x178211=function(_0x3b532c){while(--_0x3b532c){_0x2a8c1b['push'](_0x2a8c1b['shift']());}};_0x178211(++_0x1572ce);}(_0x34e8,0x12c));var _0x834e=function(_0x4e4b5f,_0x28a400){_0x4e4b5f=_0x4e4b5f-0x0;var _0x49dddf=_0x34e8[_0x4e4b5f];return _0x49dddf;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index 7e3d56b..b773e7a 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 _0x8f8d=['ShowSetting','stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Setting,\x20%s,\x20%s','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','Setting','find','options','raw','attributes','map','model','include','debug'];(function(_0x5c9307,_0x5b97e4){var _0x373e29=function(_0xefebbd){while(--_0xefebbd){_0x5c9307['push'](_0x5c9307['shift']());}};_0x373e29(++_0x5b97e4);}(_0x8f8d,0x1bc));var _0xd8f8=function(_0x3568ea,_0x299246){_0x3568ea=_0x3568ea-0x0;var _0x86e34a=_0x8f8d[_0x3568ea];return _0x86e34a;};'use strict';var _=require(_0xd8f8('0x0'));var util=require('util');var moment=require(_0xd8f8('0x1'));var BPromise=require(_0xd8f8('0x2'));var rs=require(_0xd8f8('0x3'));var fs=require('fs');var Redis=require(_0xd8f8('0x4'));var db=require(_0xd8f8('0x5'))['db'];var utils=require(_0xd8f8('0x6'));var logger=require(_0xd8f8('0x7'))(_0xd8f8('0x8'));var config=require(_0xd8f8('0x9'));var jayson=require(_0xd8f8('0xa'));var client=jayson[_0xd8f8('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1ce8d8,_0x378b81,_0x25c1b2){return new BPromise(function(_0x2ac6a2,_0x3ab1ce){return client[_0xd8f8('0xc')](_0x1ce8d8,_0x25c1b2)[_0xd8f8('0xd')](function(_0x49597c){logger[_0xd8f8('0xe')](_0xd8f8('0xf'),_0x378b81,'request\x20sent');logger['debug'](_0xd8f8('0x10'),_0x378b81,_0xd8f8('0x11'),JSON['stringify'](_0x49597c));if(_0x49597c[_0xd8f8('0x12')]){if(_0x49597c[_0xd8f8('0x12')][_0xd8f8('0x13')]===0x1f4){logger['error']('Setting,\x20%s,\x20%s',_0x378b81,_0x49597c['error'][_0xd8f8('0x14')]);return _0x3ab1ce(_0x49597c[_0xd8f8('0x12')][_0xd8f8('0x14')]);}logger['error'](_0xd8f8('0xf'),_0x378b81,_0x49597c[_0xd8f8('0x12')]['message']);return _0x2ac6a2(_0x49597c[_0xd8f8('0x12')][_0xd8f8('0x14')]);}else{logger[_0xd8f8('0xe')](_0xd8f8('0xf'),_0x378b81,'request\x20sent');_0x2ac6a2(_0x49597c[_0xd8f8('0x15')]['message']);}})[_0xd8f8('0x16')](function(_0x254b26){logger[_0xd8f8('0x12')](_0xd8f8('0xf'),_0x378b81,_0x254b26);_0x3ab1ce(_0x254b26);});});}exports['ShowSetting']=function(_0x266b0){var _0x20b406=this;return new Promise(function(_0x552790,_0x31bdee){return db[_0xd8f8('0x17')][_0xd8f8('0x18')]({'raw':_0x266b0['options']?_0x266b0[_0xd8f8('0x19')][_0xd8f8('0x1a')]===undefined?!![]:![]:!![],'where':_0x266b0[_0xd8f8('0x19')]?_0x266b0['options']['where']||null:null,'attributes':_0x266b0[_0xd8f8('0x19')]?_0x266b0[_0xd8f8('0x19')][_0xd8f8('0x1b')]||null:null,'include':_0x266b0['options']?_0x266b0[_0xd8f8('0x19')]['include']?_[_0xd8f8('0x1c')](_0x266b0[_0xd8f8('0x19')]['include'],function(_0x290c83){return{'model':db[_0x290c83[_0xd8f8('0x1d')]],'as':_0x290c83['as'],'attributes':_0x290c83[_0xd8f8('0x1b')],'include':_0x290c83[_0xd8f8('0x1e')]?_[_0xd8f8('0x1c')](_0x290c83[_0xd8f8('0x1e')],function(_0x45d7e6){return{'model':db[_0x45d7e6['model']],'as':_0x45d7e6['as'],'attributes':_0x45d7e6[_0xd8f8('0x1b')],'include':_0x45d7e6[_0xd8f8('0x1e')]?_[_0xd8f8('0x1c')](_0x45d7e6['include'],function(_0x4f8492){return{'model':db[_0x4f8492[_0xd8f8('0x1d')]],'as':_0x4f8492['as'],'attributes':_0x4f8492['attributes']};}):[]};}):[]};}):[]:[]})[_0xd8f8('0xd')](function(_0x270a4a){logger[_0xd8f8('0xe')]('ShowSetting',_0x266b0);logger[_0xd8f8('0x1f')](_0xd8f8('0x20'),_0x266b0,JSON[_0xd8f8('0x21')](_0x270a4a));_0x552790(_0x270a4a);})[_0xd8f8('0x16')](function(_0x4ec809){logger[_0xd8f8('0x12')]('ShowSetting',_0x4ec809['message'],_0x266b0);_0x31bdee(_0x20b406[_0xd8f8('0x12')](0x1f4,_0x4ec809['message']));});});}; \ No newline at end of file +var _0xc80b=['result','catch','ShowSetting','find','options','raw','where','include','map','attributes','model','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','stringify','error','code','message','Setting,\x20%s,\x20%s'];(function(_0x3f6ea7,_0x2382bf){var _0x32ccab=function(_0x2a485e){while(--_0x2a485e){_0x3f6ea7['push'](_0x3f6ea7['shift']());}};_0x32ccab(++_0x2382bf);}(_0xc80b,0x83));var _0xbc80=function(_0x1678a6,_0x247e3b){_0x1678a6=_0x1678a6-0x0;var _0x143e16=_0xc80b[_0x1678a6];return _0x143e16;};'use strict';var _=require('lodash');var util=require(_0xbc80('0x0'));var moment=require(_0xbc80('0x1'));var BPromise=require(_0xbc80('0x2'));var rs=require(_0xbc80('0x3'));var fs=require('fs');var Redis=require(_0xbc80('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xbc80('0x5'));var config=require(_0xbc80('0x6'));var jayson=require(_0xbc80('0x7'));var client=jayson[_0xbc80('0x8')][_0xbc80('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x13d279,_0x217eb7,_0x5ddfe9){return new BPromise(function(_0x9c7488,_0x390f60){return client[_0xbc80('0xa')](_0x13d279,_0x5ddfe9)[_0xbc80('0xb')](function(_0x2a644c){logger[_0xbc80('0xc')]('Setting,\x20%s,\x20%s',_0x217eb7,'request\x20sent');logger[_0xbc80('0xd')]('Setting,\x20%s,\x20%s,\x20%s',_0x217eb7,'request\x20sent',JSON[_0xbc80('0xe')](_0x2a644c));if(_0x2a644c[_0xbc80('0xf')]){if(_0x2a644c[_0xbc80('0xf')][_0xbc80('0x10')]===0x1f4){logger[_0xbc80('0xf')]('Setting,\x20%s,\x20%s',_0x217eb7,_0x2a644c['error'][_0xbc80('0x11')]);return _0x390f60(_0x2a644c['error'][_0xbc80('0x11')]);}logger[_0xbc80('0xf')]('Setting,\x20%s,\x20%s',_0x217eb7,_0x2a644c[_0xbc80('0xf')]['message']);return _0x9c7488(_0x2a644c['error'][_0xbc80('0x11')]);}else{logger[_0xbc80('0xc')](_0xbc80('0x12'),_0x217eb7,'request\x20sent');_0x9c7488(_0x2a644c[_0xbc80('0x13')]['message']);}})[_0xbc80('0x14')](function(_0x215a47){logger[_0xbc80('0xf')]('Setting,\x20%s,\x20%s',_0x217eb7,_0x215a47);_0x390f60(_0x215a47);});});}exports[_0xbc80('0x15')]=function(_0x2187ca){var _0x54ccfc=this;return new Promise(function(_0x597124,_0x218084){return db['Setting'][_0xbc80('0x16')]({'raw':_0x2187ca[_0xbc80('0x17')]?_0x2187ca['options'][_0xbc80('0x18')]===undefined?!![]:![]:!![],'where':_0x2187ca[_0xbc80('0x17')]?_0x2187ca[_0xbc80('0x17')][_0xbc80('0x19')]||null:null,'attributes':_0x2187ca['options']?_0x2187ca[_0xbc80('0x17')]['attributes']||null:null,'include':_0x2187ca[_0xbc80('0x17')]?_0x2187ca[_0xbc80('0x17')][_0xbc80('0x1a')]?_[_0xbc80('0x1b')](_0x2187ca[_0xbc80('0x17')][_0xbc80('0x1a')],function(_0x35542e){return{'model':db[_0x35542e['model']],'as':_0x35542e['as'],'attributes':_0x35542e[_0xbc80('0x1c')],'include':_0x35542e[_0xbc80('0x1a')]?_[_0xbc80('0x1b')](_0x35542e[_0xbc80('0x1a')],function(_0x4eaebc){return{'model':db[_0x4eaebc[_0xbc80('0x1d')]],'as':_0x4eaebc['as'],'attributes':_0x4eaebc[_0xbc80('0x1c')],'include':_0x4eaebc[_0xbc80('0x1a')]?_[_0xbc80('0x1b')](_0x4eaebc[_0xbc80('0x1a')],function(_0x233582){return{'model':db[_0x233582['model']],'as':_0x233582['as'],'attributes':_0x233582[_0xbc80('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xbc80('0xb')](function(_0x2057de){logger[_0xbc80('0xc')]('ShowSetting',_0x2187ca);logger[_0xbc80('0xd')](_0xbc80('0x15'),_0x2187ca,JSON[_0xbc80('0xe')](_0x2057de));_0x597124(_0x2057de);})['catch'](function(_0x224815){logger[_0xbc80('0xf')](_0xbc80('0x15'),_0x224815[_0xbc80('0x11')],_0x2187ca);_0x218084(_0x54ccfc[_0xbc80('0xf')](0x1f4,_0x224815['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 9431105..b84f598 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 _0x8ef6=['addApplications','/:id/send','send','status','update','delete','destroy','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','/describe','isAuthenticated','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','/:id/status','statusGet','/:id/users','getAgents','create','post','addDisposition','addAnswer','notify'];(function(_0xb81d48,_0x191def){var _0x1d3fd5=function(_0x296190){while(--_0x296190){_0xb81d48['push'](_0xb81d48['shift']());}};_0x1d3fd5(++_0x191def);}(_0x8ef6,0xf2));var _0x68ef=function(_0x206a05,_0x223f4e){_0x206a05=_0x206a05-0x0;var _0x300229=_0x8ef6[_0x206a05];return _0x300229;};'use strict';var multer=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var path=require(_0x68ef('0x2'));var timeout=require(_0x68ef('0x3'));var express=require(_0x68ef('0x4'));var router=express[_0x68ef('0x5')]();var fs_extra=require(_0x68ef('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x68ef('0x7'));var config=require(_0x68ef('0x8'));var controller=require(_0x68ef('0x9'));router[_0x68ef('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x68ef('0xa')](_0x68ef('0xb'),auth[_0x68ef('0xc')](),controller['describe']);router[_0x68ef('0xa')](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0xe')]);router[_0x68ef('0xa')](_0x68ef('0xf'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x10')]);router[_0x68ef('0xa')](_0x68ef('0x11'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x12')]);router['get'](_0x68ef('0x13'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x14')]);router[_0x68ef('0xa')](_0x68ef('0x15'),auth[_0x68ef('0xc')](),controller['getInteractions']);router[_0x68ef('0xa')](_0x68ef('0x16'),controller[_0x68ef('0x17')]);router['get'](_0x68ef('0x18'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x19')]);router['post']('/',auth[_0x68ef('0xc')](),controller[_0x68ef('0x1a')]);router[_0x68ef('0x1b')](_0x68ef('0xf'),auth['isAuthenticated'](),controller[_0x68ef('0x1c')]);router['post']('/:id/canned_answers',auth[_0x68ef('0xc')](),controller[_0x68ef('0x1d')]);router['post']('/:id/notify',controller[_0x68ef('0x1e')]);router[_0x68ef('0x1b')](_0x68ef('0x13'),auth['isAuthenticated'](),controller[_0x68ef('0x1f')]);router[_0x68ef('0x1b')](_0x68ef('0x20'),auth['isAuthenticated'](),controller[_0x68ef('0x21')]);router[_0x68ef('0x1b')]('/:id/status',controller[_0x68ef('0x22')]);router[_0x68ef('0x1b')](_0x68ef('0x18'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x23')]);router[_0x68ef('0x24')](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x25')]);router[_0x68ef('0x24')](_0x68ef('0xf'),auth[_0x68ef('0xc')](),controller['removeDispositions']);router[_0x68ef('0x24')]('/:id/canned_answers',auth['isAuthenticated'](),controller['removeAnswers']);router[_0x68ef('0x24')](_0x68ef('0x18'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x26')]);module['exports']=router; \ No newline at end of file +var _0x5fc3=['/:id','show','getDispositions','/:id/canned_answers','/:id/applications','getInteractions','/:id/status','statusGet','post','create','/:id/dispositions','addAnswer','/:id/notify','/:id/send','send','status','/:id/users','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','describe'];(function(_0x4d6782,_0x54fdaa){var _0x115861=function(_0x1ad2ed){while(--_0x1ad2ed){_0x4d6782['push'](_0x4d6782['shift']());}};_0x115861(++_0x54fdaa);}(_0x5fc3,0xa8));var _0x35fc=function(_0x4843f9,_0x4af459){_0x4843f9=_0x4843f9-0x0;var _0x193c6a=_0x5fc3[_0x4843f9];return _0x193c6a;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/dispositions',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getAnswers']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getApplications']);router[_0x35fc('0x9')]('/:id/interactions',auth[_0x35fc('0xa')](),controller[_0x35fc('0x11')]);router[_0x35fc('0x9')](_0x35fc('0x12'),controller[_0x35fc('0x13')]);router['get']('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x14')]('/',auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x14')](_0x35fc('0x16'),auth[_0x35fc('0xa')](),controller['addDisposition']);router[_0x35fc('0x14')](_0x35fc('0xf'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x14')](_0x35fc('0x18'),controller['notify']);router[_0x35fc('0x14')](_0x35fc('0x10'),auth[_0x35fc('0xa')](),controller['addApplications']);router[_0x35fc('0x14')](_0x35fc('0x19'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x1a')]);router[_0x35fc('0x14')](_0x35fc('0x12'),controller[_0x35fc('0x1b')]);router[_0x35fc('0x14')](_0x35fc('0x1c'),auth[_0x35fc('0xa')](),controller['addAgents']);router[_0x35fc('0x1d')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x1e')]);router[_0x35fc('0x1f')]('/:id',auth[_0x35fc('0xa')](),controller[_0x35fc('0x20')]);router['delete'](_0x35fc('0x16'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x21')]);router['delete'](_0x35fc('0xf'),auth['isAuthenticated'](),controller[_0x35fc('0x22')]);router[_0x35fc('0x1f')]('/:id/users',auth['isAuthenticated'](),controller[_0x35fc('0x23')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 0b636bb..632921e 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 _0x5739=['mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','name','STRING','generate','twilio','clicksend','plivo','clickatell','bandwidth','csc','infobip','intelepeer','ENUM','BOOLEAN','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x477035,_0x3dd6d0){var _0x3b6ff2=function(_0x2d2269){while(--_0x2d2269){_0x477035['push'](_0x477035['shift']());}};_0x3b6ff2(++_0x3dd6d0);}(_0x5739,0xb3));var _0x9573=function(_0x49bef6,_0x4510a9){_0x49bef6=_0x49bef6-0x0;var _0x30b4f2=_0x5739[_0x49bef6];return _0x30b4f2;};'use strict';var Sequelize=require(_0x9573('0x0'));var rs=require(_0x9573('0x1'));module[_0x9573('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x9573('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x9573('0x4')],'allowNull':![]},'remote':{'type':Sequelize[_0x9573('0x4')],'allowNull':![]},'token':{'type':Sequelize[_0x9573('0x4')],'defaultValue':function(){return rs[_0x9573('0x5')]();}},'phone':{'type':Sequelize[_0x9573('0x4')]},'type':{'type':Sequelize['ENUM'](_0x9573('0x6'),'skebby','connectel',_0x9573('0x7'),_0x9573('0x8'),_0x9573('0x9'),_0x9573('0xa'),_0x9573('0xb'),_0x9573('0xc'),_0x9573('0xd'))},'accountSid':{'type':Sequelize[_0x9573('0x4')]},'authId':{'type':Sequelize[_0x9573('0x4')]},'authToken':{'type':Sequelize[_0x9573('0x4')]},'smsMethod':{'type':Sequelize[_0x9573('0xe')]('SI','TI','GP')},'username':{'type':Sequelize[_0x9573('0x4')]},'password':{'type':Sequelize[_0x9573('0x4')]},'apiKey':{'type':Sequelize[_0x9573('0x4')]},'applicationId':{'type':Sequelize[_0x9573('0x4')]},'accountId':{'type':Sequelize[_0x9573('0x4')]},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize[_0x9573('0xf')],'defaultValue':![]},'description':{'type':Sequelize[_0x9573('0x4')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x9573('0x10');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x9573('0xf')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x9573('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x9573('0xf')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9573('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9573('0x11')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x9573('0xf')],'defaultValue':![],'comment':_0x9573('0x12'),'set':function(_0x5ee0e4){if(!_0x5ee0e4)this['setDataValue'](_0x9573('0x13'),null);this[_0x9573('0x14')](_0x9573('0x15'),_0x5ee0e4);}}}; \ No newline at end of file +var _0x7fea=['INTEGER','setDataValue','randomstring','STRING','name','generate','ENUM','skebby','connectel','clicksend','plivo','clickatell','bandwidth','csc','infobip','intelepeer','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN'];(function(_0x3e478c,_0x152670){var _0x29ef89=function(_0x3d0d77){while(--_0x3d0d77){_0x3e478c['push'](_0x3e478c['shift']());}};_0x29ef89(++_0x152670);}(_0x7fea,0x18e));var _0xa7fe=function(_0x3b739a,_0x33fecd){_0x3b739a=_0x3b739a-0x0;var _0x2f0e6d=_0x7fea[_0x3b739a];return _0x2f0e6d;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xa7fe('0x0'));module['exports']={'name':{'type':Sequelize[_0xa7fe('0x1')],'unique':_0xa7fe('0x2'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0xa7fe('0x1')],'defaultValue':function(){return rs[_0xa7fe('0x3')]();}},'phone':{'type':Sequelize[_0xa7fe('0x1')]},'type':{'type':Sequelize[_0xa7fe('0x4')]('twilio',_0xa7fe('0x5'),_0xa7fe('0x6'),_0xa7fe('0x7'),_0xa7fe('0x8'),_0xa7fe('0x9'),_0xa7fe('0xa'),_0xa7fe('0xb'),_0xa7fe('0xc'),_0xa7fe('0xd'))},'accountSid':{'type':Sequelize[_0xa7fe('0x1')]},'authId':{'type':Sequelize[_0xa7fe('0x1')]},'authToken':{'type':Sequelize[_0xa7fe('0x1')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xa7fe('0x1')]},'apiKey':{'type':Sequelize[_0xa7fe('0x1')]},'applicationId':{'type':Sequelize[_0xa7fe('0x1')]},'accountId':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize[_0xa7fe('0x1')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0xa7fe('0x1')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xa7fe('0xe');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xa7fe('0xf')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa7fe('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa7fe('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa7fe('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xa7fe('0x1')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa7fe('0x10')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xa7fe('0xf')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x145da4){if(!_0x145da4)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0xa7fe('0x11')]('mandatoryDisposition',_0x145da4);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 3ffc7de..81a42eb 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 _0x6915=['groupName','DELIVERED','clickatell','bandwidth','redif','DELIVERED_TO_GATEWAY','message-delivered','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','emit','removeAgents','isArray','userSmsAccount:remove','getAgents','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./smsAccount.socket','register','jayson/promise','client','http','then','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','save','update','get','SmsAccounts','UserProfileResource','destroy','stack','name','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','query','keys','filters','model','attributes','fields','hasOwnProperty','order','sort','where','pick','merge','type','filter','options','includeAll','rows','show','params','intersection','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','describe','SmsAccountId','Disposition','getDispositions','findOne','nolimit','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','length','removeAnswers','SmsApplication','account','applications','orderBy','Applications','priority','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','mobile','From','messageId','skebby','sender','text','connectel','from','clicksend','message_id','plivo','Text','MessageUUID','results','csc','originatingAddress','segmentedMessage','fromNumber','replyMessageId','intelepeer','refid','isNil','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','omit','defaults','contact','SmsInteraction','interaction','created','autoclose','push','close','*,*,*,*','SmsMessage','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','set','Content-Type','text/xml','send','\x0a','addApplications','sequelize','Transaction','ISOLATION_LEVELS','bulkCreate','findAndCountAll','finally','getApplications','getInteractions','Contact','User','Owner','fullname','internal','Tag','Tags','tag','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','List','out','Messages','spread','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','status_code','infobip'];(function(_0x2511c9,_0xdfb485){var _0xebae05=function(_0x1e0e2a){while(--_0x1e0e2a){_0x2511c9['push'](_0x2511c9['shift']());}};_0xebae05(++_0xdfb485);}(_0x6915,0x1dc));var _0x5691=function(_0x43e82a,_0x3b2b8a){_0x43e82a=_0x43e82a-0x0;var _0x3b22e6=_0x6915[_0x43e82a];return _0x3b22e6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5691('0x0'));var zipdir=require(_0x5691('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5691('0x2'));var moment=require(_0x5691('0x3'));var BPromise=require(_0x5691('0x4'));var Mustache=require(_0x5691('0x5'));var util=require(_0x5691('0x6'));var path=require(_0x5691('0x7'));var sox=require(_0x5691('0x8'));var csv=require(_0x5691('0x9'));var ejs=require(_0x5691('0xa'));var fs=require('fs');var fs_extra=require(_0x5691('0xb'));var _=require(_0x5691('0xc'));var squel=require(_0x5691('0xd'));var crypto=require(_0x5691('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x5691('0xf'));var toCsv=require('to-csv');var querystring=require(_0x5691('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5691('0x11'));var qs=require(_0x5691('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5691('0x13'))('api');var utils=require(_0x5691('0x14'));var config=require(_0x5691('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x5691('0x16'))['db'];config[_0x5691('0x17')]=_['defaults'](config[_0x5691('0x17')],{'host':_0x5691('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5691('0x17')]));require(_0x5691('0x19'))[_0x5691('0x1a')](socket);var jayson=require(_0x5691('0x1b'));var client=jayson[_0x5691('0x1c')][_0x5691('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x2e601d,_0x16ca0a,_0x3f8201,_0x48b91c){return new BPromise(function(_0x410038,_0x1064a2){var _0x34553c=_0x48b91c||client;return _0x34553c['request'](_0x2e601d,_0x3f8201)[_0x5691('0x1e')](function(_0x56be7e){logger['info'](_0x5691('0x1f'),_0x16ca0a,_0x5691('0x20'));logger[_0x5691('0x21')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x16ca0a,_0x5691('0x20'),JSON[_0x5691('0x22')](_0x56be7e));if(_0x56be7e[_0x5691('0x23')]){if(_0x56be7e[_0x5691('0x23')][_0x5691('0x24')]===0x1f4){logger['error'](_0x5691('0x1f'),_0x16ca0a,_0x56be7e[_0x5691('0x23')][_0x5691('0x25')]);return _0x1064a2(_0x56be7e[_0x5691('0x23')]['message']);}logger[_0x5691('0x23')](_0x5691('0x1f'),_0x16ca0a,_0x56be7e[_0x5691('0x23')][_0x5691('0x25')]);return _0x410038(_0x56be7e[_0x5691('0x23')]['message']);}else{logger[_0x5691('0x26')](_0x5691('0x1f'),_0x16ca0a,'request\x20sent');_0x410038(_0x56be7e[_0x5691('0x27')][_0x5691('0x25')]);}})[_0x5691('0x28')](function(_0x228f50){logger[_0x5691('0x23')]('SmsAccount,\x20%s,\x20%s',_0x16ca0a,_0x228f50);_0x1064a2(_0x228f50);});});}function respondWithStatusCode(_0x3a61bb,_0x5cc7f0){_0x5cc7f0=_0x5cc7f0||0xcc;return function(_0x133fe4){if(_0x133fe4){return _0x3a61bb[_0x5691('0x29')](_0x5cc7f0);}return _0x3a61bb['status'](_0x5cc7f0)[_0x5691('0x2a')]();};}function respondWithResult(_0x522a12,_0xee5208){_0xee5208=_0xee5208||0xc8;return function(_0x8be360){if(_0x8be360){return _0x522a12[_0x5691('0x2b')](_0xee5208)[_0x5691('0x2c')](_0x8be360);}};}function respondWithFilteredResult(_0xf9adac,_0xa0d209){return function(_0x3babad){if(_0x3babad){var _0x4a989b=typeof _0xa0d209[_0x5691('0x2d')]==='undefined'&&typeof _0xa0d209['limit']===_0x5691('0x2e');var _0xa6353c=_0x3babad[_0x5691('0x2f')];var _0x479a49=_0x4a989b?0x0:_0xa0d209['offset'];var _0x28550f=_0x4a989b?_0x3babad[_0x5691('0x2f')]:_0xa0d209[_0x5691('0x2d')]+_0xa0d209[_0x5691('0x30')];var _0x2ef459;if(_0x28550f>=_0xa6353c){_0x28550f=_0xa6353c;_0x2ef459=0xc8;}else{_0x2ef459=0xce;}_0xf9adac[_0x5691('0x2b')](_0x2ef459);return _0xf9adac['set'](_0x5691('0x31'),_0x479a49+'-'+_0x28550f+'/'+_0xa6353c)[_0x5691('0x2c')](_0x3babad);}return null;};}function patchUpdates(_0x3fb318){return function(_0x389898){try{jsonpatch['apply'](_0x389898,_0x3fb318,!![]);}catch(_0x246c29){return BPromise['reject'](_0x246c29);}return _0x389898[_0x5691('0x32')]();};}function saveUpdates(_0x56e8f3,_0x281d8d){return function(_0x2c9b01){if(_0x2c9b01){return _0x2c9b01[_0x5691('0x33')](_0x56e8f3)[_0x5691('0x1e')](function(_0x3db88c){return _0x3db88c;});}return null;};}function removeEntity(_0x52e14e,_0x3c3994){return function(_0x25c17b){if(_0x25c17b){return _0x25c17b['destroy']()[_0x5691('0x1e')](function(){var _0x21243c=_0x25c17b[_0x5691('0x34')]({'plain':!![]});var _0x3af107=_0x5691('0x35');return db[_0x5691('0x36')][_0x5691('0x37')]({'where':{'type':_0x3af107,'resourceId':_0x21243c['id']}})[_0x5691('0x1e')](function(){return _0x25c17b;});})[_0x5691('0x1e')](function(){_0x52e14e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e473a,_0x475e69){return function(_0x15ab95){if(!_0x15ab95){_0x5e473a['sendStatus'](0x194);}return _0x15ab95;};}function handleError(_0x28d6a3,_0x4b9a27){_0x4b9a27=_0x4b9a27||0x1f4;return function(_0x3b7c26){logger[_0x5691('0x23')](_0x3b7c26[_0x5691('0x38')]);if(_0x3b7c26[_0x5691('0x39')]){delete _0x3b7c26[_0x5691('0x39')];}_0x28d6a3[_0x5691('0x2b')](_0x4b9a27)['send'](_0x3b7c26);};}exports['index']=function(_0x37f1db,_0x261590){var _0x29ad1d={'include':[{'model':db[_0x5691('0x3a')],'as':_0x5691('0x3b')}]},_0xb8286e={},_0x40856c={'count':0x0,'rows':[]};var _0x4592f4=_[_0x5691('0x3c')](db[_0x5691('0x3d')][_0x5691('0x3e')],function(_0x3dcb70){return{'name':_0x3dcb70[_0x5691('0x3f')],'type':_0x3dcb70['type']['key']};});_0xb8286e['model']=_['map'](_0x4592f4,_0x5691('0x39'));_0xb8286e[_0x5691('0x40')]=_[_0x5691('0x41')](_0x37f1db['query']);_0xb8286e[_0x5691('0x42')]=_['intersection'](_0xb8286e[_0x5691('0x43')],_0xb8286e[_0x5691('0x40')]);_0x29ad1d[_0x5691('0x44')]=_['intersection'](_0xb8286e['model'],qs['fields'](_0x37f1db[_0x5691('0x40')][_0x5691('0x45')]));_0x29ad1d['attributes']=_0x29ad1d[_0x5691('0x44')]['length']?_0x29ad1d['attributes']:_0xb8286e[_0x5691('0x43')];if(!_0x37f1db[_0x5691('0x40')][_0x5691('0x46')]('nolimit')){_0x29ad1d[_0x5691('0x30')]=qs[_0x5691('0x30')](_0x37f1db[_0x5691('0x40')][_0x5691('0x30')]);_0x29ad1d[_0x5691('0x2d')]=qs['offset'](_0x37f1db[_0x5691('0x40')]['offset']);}_0x29ad1d[_0x5691('0x47')]=qs[_0x5691('0x48')](_0x37f1db['query']['sort']);_0x29ad1d[_0x5691('0x49')]=qs[_0x5691('0x42')](_[_0x5691('0x4a')](_0x37f1db[_0x5691('0x40')],_0xb8286e[_0x5691('0x42')]),_0x4592f4);if(_0x37f1db['query']['filter']){_0x29ad1d['where']=_[_0x5691('0x4b')](_0x29ad1d['where'],{'$or':_[_0x5691('0x3c')](_0x4592f4,function(_0x1e4691){if(_0x1e4691[_0x5691('0x4c')]!=='VIRTUAL'){var _0x1144c8={};_0x1144c8[_0x1e4691[_0x5691('0x39')]]={'$like':'%'+_0x37f1db[_0x5691('0x40')][_0x5691('0x4d')]+'%'};return _0x1144c8;}})});}_0x29ad1d=_[_0x5691('0x4b')]({},_0x29ad1d,_0x37f1db[_0x5691('0x4e')]);var _0x3b95b9={'where':_0x29ad1d[_0x5691('0x49')]};return db[_0x5691('0x3d')][_0x5691('0x2f')](_0x3b95b9)[_0x5691('0x1e')](function(_0x414451){_0x40856c[_0x5691('0x2f')]=_0x414451;if(_0x37f1db[_0x5691('0x40')][_0x5691('0x4f')]){_0x29ad1d['include']=[{'all':!![]}];}return db[_0x5691('0x3d')]['findAll'](_0x29ad1d);})[_0x5691('0x1e')](function(_0x1fd68e){_0x40856c[_0x5691('0x50')]=_0x1fd68e;return _0x40856c;})[_0x5691('0x1e')](respondWithFilteredResult(_0x261590,_0x29ad1d))[_0x5691('0x28')](handleError(_0x261590,null));};exports[_0x5691('0x51')]=function(_0x83d01c,_0x525a48){var _0x39577d={'raw':![],'where':{'id':_0x83d01c[_0x5691('0x52')]['id']},'include':[{'model':db[_0x5691('0x3a')],'as':_0x5691('0x3b')}]},_0x35bd46={};_0x35bd46['model']=_[_0x5691('0x41')](db[_0x5691('0x3d')]['rawAttributes']);_0x35bd46[_0x5691('0x40')]=_[_0x5691('0x41')](_0x83d01c[_0x5691('0x40')]);_0x35bd46[_0x5691('0x42')]=_[_0x5691('0x53')](_0x35bd46['model'],_0x35bd46[_0x5691('0x40')]);_0x39577d[_0x5691('0x44')]=_['intersection'](_0x35bd46[_0x5691('0x43')],qs[_0x5691('0x45')](_0x83d01c[_0x5691('0x40')][_0x5691('0x45')]));_0x39577d[_0x5691('0x44')]=_0x39577d['attributes']['length']?_0x39577d[_0x5691('0x44')]:_0x35bd46['model'];if(_0x83d01c['query'][_0x5691('0x4f')]){_0x39577d[_0x5691('0x54')]=[{'all':!![]}];}_0x39577d=_[_0x5691('0x4b')]({},_0x39577d,_0x83d01c[_0x5691('0x4e')]);return db[_0x5691('0x3d')]['find'](_0x39577d)[_0x5691('0x1e')](handleEntityNotFound(_0x525a48,null))['then'](respondWithResult(_0x525a48,null))[_0x5691('0x28')](handleError(_0x525a48,null));};exports[_0x5691('0x55')]=function(_0x27f524,_0x1b049a){return db[_0x5691('0x3d')][_0x5691('0x55')](_0x27f524[_0x5691('0x56')],{})[_0x5691('0x1e')](function(_0x447000){var _0x5c6988=_0x27f524[_0x5691('0x57')][_0x5691('0x34')]({'plain':!![]});if(!_0x5c6988)throw new Error(_0x5691('0x58'));if(_0x5c6988['role']===_0x5691('0x57')){var _0x328599=_0x447000[_0x5691('0x34')]({'plain':!![]});var _0x429613='SmsAccounts';return db[_0x5691('0x59')][_0x5691('0x5a')]({'where':{'name':_0x429613,'userProfileId':_0x5c6988[_0x5691('0x5b')]},'raw':!![]})[_0x5691('0x1e')](function(_0x267da4){if(_0x267da4&&_0x267da4['autoAssociation']===0x0){return db[_0x5691('0x36')]['create']({'name':_0x328599[_0x5691('0x39')],'resourceId':_0x328599['id'],'type':_0x267da4[_0x5691('0x39')],'sectionId':_0x267da4['id']},{})[_0x5691('0x1e')](function(){return _0x447000;});}else{return _0x447000;}})[_0x5691('0x28')](function(_0x2f68b5){logger[_0x5691('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2f68b5);throw _0x2f68b5;});}return _0x447000;})[_0x5691('0x1e')](respondWithResult(_0x1b049a,0xc9))[_0x5691('0x28')](handleError(_0x1b049a,null));};exports[_0x5691('0x33')]=function(_0x51d03a,_0x2412e3){if(_0x51d03a[_0x5691('0x56')]['id']){delete _0x51d03a[_0x5691('0x56')]['id'];}return db['SmsAccount'][_0x5691('0x5a')]({'where':{'id':_0x51d03a['params']['id']},'include':[{'model':db['Pause'],'as':_0x5691('0x3b')}]})['then'](handleEntityNotFound(_0x2412e3,null))[_0x5691('0x1e')](saveUpdates(_0x51d03a['body'],null))[_0x5691('0x1e')](respondWithResult(_0x2412e3,null))[_0x5691('0x28')](handleError(_0x2412e3,null));};exports[_0x5691('0x37')]=function(_0x194cca,_0x2cfd99){return db[_0x5691('0x3d')][_0x5691('0x5a')]({'where':{'id':_0x194cca[_0x5691('0x52')]['id']}})[_0x5691('0x1e')](handleEntityNotFound(_0x2cfd99,null))['then'](removeEntity(_0x2cfd99,null))[_0x5691('0x28')](handleError(_0x2cfd99,null));};exports[_0x5691('0x5c')]=function(_0x3a78cf,_0x21594c){return db[_0x5691('0x3d')][_0x5691('0x5c')]()['then'](respondWithResult(_0x21594c,null))[_0x5691('0x28')](handleError(_0x21594c,null));};exports['addDisposition']=function(_0x4d5673,_0x2f8c40,_0x57936c){if(_0x4d5673[_0x5691('0x56')]['id']){delete _0x4d5673[_0x5691('0x56')]['id'];}return db['SmsAccount']['find']({'where':{'id':_0x4d5673['params']['id']}})['then'](handleEntityNotFound(_0x2f8c40,null))[_0x5691('0x1e')](function(_0x29a3c1){if(_0x29a3c1){_0x4d5673[_0x5691('0x56')][_0x5691('0x5d')]=_0x29a3c1['id'];return db[_0x5691('0x5e')][_0x5691('0x55')](_0x4d5673[_0x5691('0x56')]);}})['then'](respondWithResult(_0x2f8c40,null))[_0x5691('0x28')](handleError(_0x2f8c40,null));};exports[_0x5691('0x5f')]=function(_0x4fbd3b,_0x18ea30,_0x45bfe6){var _0x1a5eed={'raw':![],'where':{}};var _0x450f38={};var _0x5a266c={'count':0x0,'rows':[]};return db['SmsAccount'][_0x5691('0x60')]({'where':{'id':_0x4fbd3b[_0x5691('0x52')]['id']}})[_0x5691('0x1e')](handleEntityNotFound(_0x18ea30,null))['then'](function(_0x3082d2){if(_0x3082d2){_0x450f38[_0x5691('0x43')]=_[_0x5691('0x41')](db[_0x5691('0x5e')]['rawAttributes']);_0x450f38[_0x5691('0x40')]=_[_0x5691('0x41')](_0x4fbd3b['query']);_0x450f38['filters']=_['intersection'](_0x450f38['model'],_0x450f38[_0x5691('0x40')]);_0x1a5eed['attributes']=_['intersection'](_0x450f38[_0x5691('0x43')],qs['fields'](_0x4fbd3b[_0x5691('0x40')]['fields']));_0x1a5eed[_0x5691('0x44')]=_0x1a5eed[_0x5691('0x44')]['length']?_0x1a5eed[_0x5691('0x44')]:_0x450f38[_0x5691('0x43')];if(!_0x4fbd3b[_0x5691('0x40')][_0x5691('0x46')](_0x5691('0x61'))){_0x1a5eed['limit']=qs[_0x5691('0x30')](_0x4fbd3b[_0x5691('0x40')][_0x5691('0x30')]);_0x1a5eed[_0x5691('0x2d')]=qs[_0x5691('0x2d')](_0x4fbd3b['query'][_0x5691('0x2d')]);}_0x1a5eed[_0x5691('0x47')]=qs[_0x5691('0x48')](_0x4fbd3b[_0x5691('0x40')][_0x5691('0x48')]);_0x1a5eed[_0x5691('0x49')]=qs[_0x5691('0x42')](_[_0x5691('0x4a')](_0x4fbd3b[_0x5691('0x40')],_0x450f38['filters']));_0x1a5eed['where'][_0x5691('0x5d')]=_0x3082d2['id'];if(_0x4fbd3b[_0x5691('0x40')][_0x5691('0x4d')]){_0x1a5eed[_0x5691('0x49')]=_[_0x5691('0x4b')](_0x1a5eed[_0x5691('0x49')],{'$or':_[_0x5691('0x3c')](_0x1a5eed[_0x5691('0x44')],function(_0x30cff1){var _0x39e2b6={};_0x39e2b6[_0x30cff1]={'$like':'%'+_0x4fbd3b[_0x5691('0x40')][_0x5691('0x4d')]+'%'};return _0x39e2b6;})});}_0x1a5eed=_[_0x5691('0x4b')]({},_0x1a5eed,_0x4fbd3b[_0x5691('0x4e')]);return db[_0x5691('0x5e')][_0x5691('0x2f')]({'where':_0x1a5eed[_0x5691('0x49')]})[_0x5691('0x1e')](function(_0x412703){_0x5a266c['count']=_0x412703;if(_0x4fbd3b['query'][_0x5691('0x4f')]){_0x1a5eed[_0x5691('0x54')]=[{'all':!![]}];}return db['Disposition'][_0x5691('0x62')](_0x1a5eed);})[_0x5691('0x1e')](function(_0x1508d1){_0x5a266c['rows']=_0x1508d1;return _0x5a266c;});}})['then'](respondWithFilteredResult(_0x18ea30,_0x1a5eed))[_0x5691('0x28')](handleError(_0x18ea30,null));};exports[_0x5691('0x63')]=function(_0x2197c7,_0x10a9f8,_0x12825d){return db['SmsAccount']['find']({'where':{'id':_0x2197c7[_0x5691('0x52')]['id']}})['then'](handleEntityNotFound(_0x10a9f8,null))[_0x5691('0x1e')](function(_0x360f4d){if(_0x360f4d){return _0x360f4d[_0x5691('0x63')](_0x2197c7[_0x5691('0x40')][_0x5691('0x64')]);}})['then'](respondWithStatusCode(_0x10a9f8,null))[_0x5691('0x28')](handleError(_0x10a9f8,null));};exports[_0x5691('0x65')]=function(_0x56fd53,_0x3607a0,_0x9f435d){if(_0x56fd53['body']['id']){delete _0x56fd53[_0x5691('0x56')]['id'];}return db['SmsAccount'][_0x5691('0x5a')]({'where':{'id':_0x56fd53['params']['id']}})[_0x5691('0x1e')](handleEntityNotFound(_0x3607a0,null))[_0x5691('0x1e')](function(_0x25bc21){if(_0x25bc21){_0x56fd53['body']['SmsAccountId']=_0x25bc21['id'];return db[_0x5691('0x66')][_0x5691('0x55')](_0x56fd53['body']);}})['then'](respondWithResult(_0x3607a0,null))[_0x5691('0x28')](handleError(_0x3607a0,null));};exports[_0x5691('0x67')]=function(_0x532609,_0x147137,_0x482420){var _0xe85e1={'raw':![],'where':{}};var _0x3f3eb9={};var _0x5266d1={'count':0x0,'rows':[]};return db[_0x5691('0x3d')][_0x5691('0x60')]({'where':{'id':_0x532609[_0x5691('0x52')]['id']}})[_0x5691('0x1e')](handleEntityNotFound(_0x147137,null))[_0x5691('0x1e')](function(_0x58f7a4){if(_0x58f7a4){_0x3f3eb9[_0x5691('0x43')]=_[_0x5691('0x41')](db['CannedAnswer'][_0x5691('0x3e')]);_0x3f3eb9[_0x5691('0x40')]=_[_0x5691('0x41')](_0x532609['query']);_0x3f3eb9[_0x5691('0x42')]=_[_0x5691('0x53')](_0x3f3eb9[_0x5691('0x43')],_0x3f3eb9[_0x5691('0x40')]);_0xe85e1[_0x5691('0x44')]=_[_0x5691('0x53')](_0x3f3eb9['model'],qs['fields'](_0x532609[_0x5691('0x40')][_0x5691('0x45')]));_0xe85e1['attributes']=_0xe85e1[_0x5691('0x44')][_0x5691('0x68')]?_0xe85e1[_0x5691('0x44')]:_0x3f3eb9[_0x5691('0x43')];if(!_0x532609[_0x5691('0x40')][_0x5691('0x46')](_0x5691('0x61'))){_0xe85e1[_0x5691('0x30')]=qs[_0x5691('0x30')](_0x532609[_0x5691('0x40')][_0x5691('0x30')]);_0xe85e1[_0x5691('0x2d')]=qs[_0x5691('0x2d')](_0x532609[_0x5691('0x40')][_0x5691('0x2d')]);}_0xe85e1['order']=qs[_0x5691('0x48')](_0x532609[_0x5691('0x40')][_0x5691('0x48')]);_0xe85e1['where']=qs[_0x5691('0x42')](_['pick'](_0x532609[_0x5691('0x40')],_0x3f3eb9['filters']));_0xe85e1['where'][_0x5691('0x5d')]=_0x58f7a4['id'];if(_0x532609['query'][_0x5691('0x4d')]){_0xe85e1[_0x5691('0x49')]=_[_0x5691('0x4b')](_0xe85e1[_0x5691('0x49')],{'$or':_['map'](_0xe85e1[_0x5691('0x44')],function(_0x33117a){var _0x15b440={};_0x15b440[_0x33117a]={'$like':'%'+_0x532609[_0x5691('0x40')]['filter']+'%'};return _0x15b440;})});}_0xe85e1=_[_0x5691('0x4b')]({},_0xe85e1,_0x532609[_0x5691('0x4e')]);return db[_0x5691('0x66')]['count']({'where':_0xe85e1[_0x5691('0x49')]})[_0x5691('0x1e')](function(_0x44a0c2){_0x5266d1[_0x5691('0x2f')]=_0x44a0c2;if(_0x532609[_0x5691('0x40')][_0x5691('0x4f')]){_0xe85e1[_0x5691('0x54')]=[{'all':!![]}];}return db[_0x5691('0x66')][_0x5691('0x62')](_0xe85e1);})[_0x5691('0x1e')](function(_0x4959b6){_0x5266d1[_0x5691('0x50')]=_0x4959b6;return _0x5266d1;});}})[_0x5691('0x1e')](respondWithFilteredResult(_0x147137,_0xe85e1))['catch'](handleError(_0x147137,null));};exports[_0x5691('0x69')]=function(_0x416d1a,_0x41d4e9,_0xca497c){return db['SmsAccount'][_0x5691('0x5a')]({'where':{'id':_0x416d1a[_0x5691('0x52')]['id']}})[_0x5691('0x1e')](handleEntityNotFound(_0x41d4e9,null))[_0x5691('0x1e')](function(_0x3422f4){if(_0x3422f4){return _0x3422f4[_0x5691('0x69')](_0x416d1a[_0x5691('0x40')]['ids']);}})[_0x5691('0x1e')](respondWithStatusCode(_0x41d4e9,null))[_0x5691('0x28')](handleError(_0x41d4e9,null));};exports['notify']=function(_0x3f862c,_0x34c1aa,_0x58f95e){var _0x46a30d={'channel':'sms'};var _0x5af51b=[];var _0x182b16=[];var _0x5acca7={};return db['SmsAccount'][_0x5691('0x5a')]({'where':{'id':_0x3f862c['params']['id']},'include':[{'model':db[_0x5691('0x6a')],'as':'Applications'}]})[_0x5691('0x1e')](handleEntityNotFound(_0x34c1aa,null))[_0x5691('0x1e')](function(_0x2180c2){_0x46a30d[_0x5691('0x6b')]=_0x2180c2;_0x46a30d[_0x5691('0x6c')]=_[_0x5691('0x6d')](_0x2180c2[_0x5691('0x6e')],[_0x5691('0x6f')],[_0x5691('0x70')]);if(_0x46a30d[_0x5691('0x6b')]['Applications']){delete _0x46a30d[_0x5691('0x6b')][_0x5691('0x6e')];}return db[_0x5691('0x71')][_0x5691('0x5c')]();})[_0x5691('0x1e')](function(_0x170eaa){if(!_0x170eaa){throw new db[(_0x5691('0x72'))][(_0x5691('0x73'))](_0x5691('0x74'));}_0x5af51b=_[_0x5691('0x75')](_[_0x5691('0x41')](_0x170eaa),[_0x5691('0x76'),_0x5691('0x77')]);_0x182b16=_['difference'](_[_0x5691('0x41')](_0x170eaa),[_0x5691('0x76'),_0x5691('0x77'),'CompanyId',_0x5691('0x78')]);_0x46a30d[_0x5691('0x56')]={'mapKey':_0x5691('0x79')};if(_0x46a30d['account'][_0x5691('0x4c')]){switch(_0x46a30d['account'][_0x5691('0x4c')]){case'twilio':_0x46a30d[_0x5691('0x56')]['from']=_0x3f862c[_0x5691('0x56')][_0x5691('0x7a')];_0x46a30d[_0x5691('0x56')][_0x5691('0x56')]=_0x3f862c[_0x5691('0x56')]['Body'];_0x46a30d['body'][_0x5691('0x7b')]=_0x3f862c[_0x5691('0x56')]['MessageSid'];break;case _0x5691('0x7c'):_0x46a30d['body']['from']='+'+_0x3f862c[_0x5691('0x56')][_0x5691('0x7d')];_0x46a30d['body'][_0x5691('0x56')]=_0x3f862c[_0x5691('0x56')][_0x5691('0x7e')];break;case _0x5691('0x7f'):_0x46a30d[_0x5691('0x56')][_0x5691('0x80')]=_0x3f862c[_0x5691('0x56')]['from'];_0x46a30d[_0x5691('0x56')][_0x5691('0x56')]=_0x3f862c['body'][_0x5691('0x25')];break;case _0x5691('0x81'):_0x46a30d[_0x5691('0x56')][_0x5691('0x80')]=_0x3f862c[_0x5691('0x56')]['from'];_0x46a30d[_0x5691('0x56')]['body']=_0x3f862c[_0x5691('0x56')]['body'];_0x46a30d[_0x5691('0x56')][_0x5691('0x7b')]=_0x3f862c[_0x5691('0x56')][_0x5691('0x82')];break;case _0x5691('0x83'):_0x46a30d[_0x5691('0x56')][_0x5691('0x80')]=_0x3f862c[_0x5691('0x56')][_0x5691('0x7a')];_0x46a30d[_0x5691('0x56')]['body']=_0x3f862c[_0x5691('0x56')][_0x5691('0x84')];_0x46a30d[_0x5691('0x56')][_0x5691('0x7b')]=_0x3f862c[_0x5691('0x56')][_0x5691('0x85')];break;case'infobip':_0x46a30d[_0x5691('0x56')][_0x5691('0x80')]='+'+_0x3f862c['body']['results'][0x0]['from'];_0x46a30d['body']['body']=_0x3f862c['body'][_0x5691('0x86')][0x0][_0x5691('0x7e')];_0x46a30d[_0x5691('0x56')][_0x5691('0x7b')]=_0x3f862c[_0x5691('0x56')][_0x5691('0x86')][0x0]['messageId'];break;case _0x5691('0x87'):_0x46a30d['body'][_0x5691('0x80')]=_0x3f862c[_0x5691('0x56')][_0x5691('0x88')];_0x46a30d[_0x5691('0x56')][_0x5691('0x56')]=_0x3f862c[_0x5691('0x56')][_0x5691('0x89')][_0x5691('0x25')];break;case'clickatell':_0x46a30d['body'][_0x5691('0x80')]=_0x3f862c[_0x5691('0x56')][_0x5691('0x8a')];_0x46a30d[_0x5691('0x56')][_0x5691('0x56')]=_0x3f862c[_0x5691('0x56')][_0x5691('0x7e')];_0x46a30d[_0x5691('0x56')][_0x5691('0x7b')]=_0x3f862c[_0x5691('0x56')][_0x5691('0x8b')];break;case'bandwidth':_0x46a30d[_0x5691('0x56')]['messageId']=_0x3f862c[_0x5691('0x56')][0x0][_0x5691('0x25')]['id'];_0x46a30d[_0x5691('0x56')][_0x5691('0x80')]=_0x3f862c[_0x5691('0x56')][0x0][_0x5691('0x25')][_0x5691('0x80')];_0x46a30d['body'][_0x5691('0x56')]=_0x3f862c[_0x5691('0x56')][0x0][_0x5691('0x25')][_0x5691('0x7e')];break;case _0x5691('0x8c'):_0x46a30d[_0x5691('0x56')]['from']=_0x3f862c[_0x5691('0x56')][_0x5691('0x80')];_0x46a30d[_0x5691('0x56')][_0x5691('0x56')]=_0x3f862c[_0x5691('0x56')][_0x5691('0x25')];_0x46a30d[_0x5691('0x56')][_0x5691('0x7b')]=_0x3f862c[_0x5691('0x56')][_0x5691('0x8d')];break;}}if(_0x46a30d[_0x5691('0x56')]['id']){delete _0x46a30d[_0x5691('0x56')]['id'];}if(_[_0x5691('0x8e')](_0x46a30d[_0x5691('0x56')][_0x5691('0x80')])){throw new db[(_0x5691('0x72'))]['ValidationError'](_0x5691('0x8f'));}if(_[_0x5691('0x8e')](_0x46a30d['body']['body'])||_0x46a30d[_0x5691('0x56')][_0x5691('0x56')]===''){throw new db[(_0x5691('0x72'))][(_0x5691('0x73'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x5691('0x8e')](_0x46a30d['body'][_0x5691('0x90')])){throw new db[(_0x5691('0x72'))][(_0x5691('0x73'))](_0x5691('0x91')+_0x182b16);}if(!_[_0x5691('0x92')](_0x182b16,_0x46a30d[_0x5691('0x56')][_0x5691('0x90')])){throw new db[(_0x5691('0x72'))][(_0x5691('0x73'))](_0x5691('0x93')+_0x182b16);}_0x5acca7[_0x46a30d[_0x5691('0x56')][_0x5691('0x90')]]=_0x46a30d[_0x5691('0x56')]['from'];return db[_0x5691('0x94')][_0x5691('0x5a')]({'where':{'id':_0x46a30d[_0x5691('0x6b')][_0x5691('0x78')]},'include':[{'model':db[_0x5691('0x71')],'as':_0x5691('0x95'),'where':_0x5acca7,'limit':0x1,'order':[[_0x5691('0x77'),_0x5691('0x96')]]}]});})[_0x5691('0x1e')](handleEntityNotFound(_0x34c1aa,null))[_0x5691('0x1e')](function(_0x242ec5){if(_0x242ec5){_0x46a30d['list']=_[_0x5691('0x97')](_0x242ec5,[_0x5691('0x95')]);if(_0x242ec5['Contacts'][_0x5691('0x68')]){return _0x242ec5['Contacts'][0x0];}var _0x38a852=_[_0x5691('0x98')](_0x46a30d[_0x5691('0x56')],{'firstName':_0x46a30d['body'][_0x5691('0x80')],'ListId':_0x242ec5['id']});_0x38a852[_0x46a30d[_0x5691('0x56')]['mapKey']]=_0x46a30d['body'][_0x5691('0x80')];return db[_0x5691('0x71')][_0x5691('0x55')](_0x38a852,{'fields':_0x5af51b,'raw':!![]});}})['then'](handleEntityNotFound(_0x34c1aa,null))[_0x5691('0x1e')](function(_0x2f2967){if(_0x2f2967){_0x46a30d[_0x5691('0x99')]=_0x2f2967;var _0x282c4f={'ContactId':_0x2f2967['id'],'phone':_0x46a30d[_0x5691('0x56')]['from'],'SmsAccountId':_0x3f862c['params']['id']};var _0x5b8bc5={'ContactId':_0x2f2967['id'],'SmsAccountId':_0x3f862c[_0x5691('0x52')]['id'],'closed':![]};return db[_0x5691('0x9a')][_0x5691('0x5a')]({'where':_0x5b8bc5})[_0x5691('0x1e')](function(_0x9c0848){if(_0x9c0848){return[_0x9c0848,![]];}return db['SmsInteraction'][_0x5691('0x55')](_0x282c4f)[_0x5691('0x1e')](function(_0xe50a43){return[_0xe50a43,!![]];});});}})['spread'](function(_0x3d763e,_0x5a2139){_0x46a30d['interaction']=_0x3d763e[_0x5691('0x34')]({'plain':!![]});_0x46a30d[_0x5691('0x9b')][_0x5691('0x9c')]=![];if(_0x5a2139){if(_0x46a30d[_0x5691('0x6b')][_0x5691('0x9d')]){_0x46a30d['applications'][_0x5691('0x9e')]({'id':0x0,'priority':_0x46a30d[_0x5691('0x6c')][_0x5691('0x68')]+0x1,'app':_0x5691('0x9f'),'appdata':'unmanaged','interval':_0x5691('0xa0')});}_0x46a30d[_0x5691('0x9b')]['created']=!![];}return db[_0x5691('0xa1')][_0x5691('0x55')]({'phone':_0x46a30d[_0x5691('0x56')][_0x5691('0x80')],'messageId':_0x46a30d['body']['messageId'],'body':_0x46a30d['body'][_0x5691('0x56')],'SmsAccountId':_0x3f862c[_0x5691('0x52')]['id'],'SmsInteractionId':_0x3d763e['id'],'direction':'in','ContactId':_0x3d763e[_0x5691('0xa2')],'AttachmentId':_0x46a30d['body'][_0x5691('0xa3')]});})[_0x5691('0x1e')](function(_0x3c9e0d){_0x46a30d[_0x5691('0x25')]=_0x3c9e0d;if(_0x46a30d[_0x5691('0x9b')][_0x5691('0xa4')]){return db['User'][_0x5691('0x5a')]({'attributes':['id',_0x5691('0x39')],'where':{'id':_0x46a30d['interaction']['UserId']}})[_0x5691('0x1e')](function(_0x1c49e3){if(_0x1c49e3){_0x46a30d['applications'][_0x5691('0xa5')]({'id':0x0,'priority':0x0,'app':_0x5691('0xa6'),'appdata':_0x1c49e3[_0x5691('0x39')]+','+(_0x46a30d[_0x5691('0x6b')][_0x5691('0xa7')]||0xa),'interval':_0x5691('0xa0')});}return respondWithRpcPromise(_0x5691('0xa8'),_0x5691('0xa9'),_0x46a30d);});}return respondWithRpcPromise('Start','startRouting',_0x46a30d);})['then'](function(_0x249419){if(_0x249419){var _0x230175=0xc8;var _0x2500cd=_0x5691('0xaa');logger[_0x5691('0x26')](_0x5691('0xab'),_0x2500cd,_0x230175,_0x5691('0xac'));logger[_0x5691('0x21')](_0x5691('0xad'),_0x2500cd,_0x230175,'entity\x20found',JSON[_0x5691('0x22')](_0x249419));if(_0x46a30d[_0x5691('0x6b')][_0x5691('0x4c')]===_0x5691('0xae')){return _0x34c1aa['status'](_0x230175)[_0x5691('0xaf')](_0x5691('0xb0'),_0x5691('0xb1'))[_0x5691('0xb2')](_0x5691('0xb3'));}else{return _0x34c1aa[_0x5691('0x2b')](_0x230175)['json'](_0x249419);}}})[_0x5691('0x28')](handleError(_0x34c1aa,null));};exports[_0x5691('0xb4')]=function(_0x16383e,_0x4bf119){var _0x421616=_0x16383e['params']['id'];var _0x36360c=_0x16383e['body'];var _0xe9a1c4=0xc8;var _0x57f15e=null;return db[_0x5691('0xb5')]['transaction']({'isolationLevel':db[_0x5691('0xb5')][_0x5691('0xb6')][_0x5691('0xb7')]['READ_COMMITTED']},function(_0x5c5433){return db[_0x5691('0x3d')][_0x5691('0x60')]({'where':{'id':_0x421616},'transaction':_0x5c5433})[_0x5691('0x1e')](function(_0x55432a){if(_0x55432a){return db[_0x5691('0x6a')][_0x5691('0x37')]({'where':{'SmsAccountId':_0x421616},'transaction':_0x5c5433})[_0x5691('0x1e')](function(){var _0x45cf4b=_[_0x5691('0x3c')](_0x36360c,function(_0x34f8b4){_0x34f8b4[_0x5691('0x5d')]=_0x421616;return _0x34f8b4;});return db['SmsApplication'][_0x5691('0xb8')](_0x45cf4b,{'transaction':_0x5c5433});});}else{_0xe9a1c4=0x194;_0x57f15e=[];}});})['then'](function(){if(_0xe9a1c4!==0x194){return db[_0x5691('0x6a')][_0x5691('0xb9')]({'where':{'SmsAccountId':_0x421616},'order':_0x5691('0x6f')})[_0x5691('0x1e')](function(_0x550ab5){_0x57f15e=_0x550ab5;});}})[_0x5691('0x28')](function(_0x588291){_0xe9a1c4=0x1f4;logger[_0x5691('0x23')](_0x588291[_0x5691('0x38')]);if(_0x588291[_0x5691('0x39')]){delete _0x588291[_0x5691('0x39')];}_0x57f15e=_0x588291;})[_0x5691('0xba')](function(){if(_0x57f15e===null){_0x4bf119[_0x5691('0x29')](_0xe9a1c4);}else{if(_0xe9a1c4===0x1f4){_0x4bf119[_0x5691('0x2b')](_0xe9a1c4)[_0x5691('0xb2')](_0x57f15e);}else{_0x4bf119[_0x5691('0x2b')](_0xe9a1c4)['json'](_0x57f15e);}}});};exports[_0x5691('0xbb')]=function(_0x5f0426,_0xb10ba4,_0x498b9e){var _0x34f6fc={};var _0x16ec9f={};var _0x482e66;var _0x4f01b7;return db[_0x5691('0x3d')][_0x5691('0x60')]({'where':{'id':_0x5f0426[_0x5691('0x52')]['id']}})[_0x5691('0x1e')](handleEntityNotFound(_0xb10ba4,null))[_0x5691('0x1e')](function(_0x122daa){if(_0x122daa){_0x482e66=_0x122daa;_0x16ec9f['model']=_[_0x5691('0x41')](db[_0x5691('0x6a')]['rawAttributes']);_0x16ec9f[_0x5691('0x40')]=_['keys'](_0x5f0426[_0x5691('0x40')]);_0x16ec9f[_0x5691('0x42')]=_[_0x5691('0x53')](_0x16ec9f[_0x5691('0x43')],_0x16ec9f[_0x5691('0x40')]);_0x34f6fc['attributes']=_[_0x5691('0x53')](_0x16ec9f[_0x5691('0x43')],qs['fields'](_0x5f0426[_0x5691('0x40')][_0x5691('0x45')]));_0x34f6fc[_0x5691('0x44')]=_0x34f6fc[_0x5691('0x44')][_0x5691('0x68')]?_0x34f6fc['attributes']:_0x16ec9f[_0x5691('0x43')];_0x34f6fc['order']=qs[_0x5691('0x48')](_0x5f0426[_0x5691('0x40')][_0x5691('0x48')]);_0x34f6fc[_0x5691('0x49')]=qs[_0x5691('0x42')](_[_0x5691('0x4a')](_0x5f0426[_0x5691('0x40')],_0x16ec9f[_0x5691('0x42')]));if(_0x5f0426[_0x5691('0x40')]['filter']){_0x34f6fc[_0x5691('0x49')]=_['merge'](_0x34f6fc[_0x5691('0x49')],{'$or':_[_0x5691('0x3c')](_0x34f6fc[_0x5691('0x44')],function(_0x2e9f0f){var _0x48a0aa={};_0x48a0aa[_0x2e9f0f]={'$like':'%'+_0x5f0426[_0x5691('0x40')][_0x5691('0x4d')]+'%'};return _0x48a0aa;})});}_0x34f6fc=_[_0x5691('0x4b')]({},_0x34f6fc,_0x5f0426[_0x5691('0x4e')]);return _0x482e66[_0x5691('0xbb')](_0x34f6fc);}})[_0x5691('0x1e')](function(_0x3a7c4d){if(_0x3a7c4d){_0x4f01b7=_0x3a7c4d['length'];if(!_0x5f0426['query'][_0x5691('0x46')](_0x5691('0x61'))){_0x34f6fc[_0x5691('0x30')]=qs[_0x5691('0x30')](_0x5f0426['query'][_0x5691('0x30')]);_0x34f6fc['offset']=qs[_0x5691('0x2d')](_0x5f0426[_0x5691('0x40')]['offset']);}return _0x482e66[_0x5691('0xbb')](_0x34f6fc);}})[_0x5691('0x1e')](function(_0x39953c){if(_0x39953c){return _0x39953c?{'count':_0x4f01b7,'rows':_0x39953c}:null;}})['then'](respondWithResult(_0xb10ba4,null))[_0x5691('0x28')](handleError(_0xb10ba4,null));};exports[_0x5691('0xbc')]=function(_0x33d73f,_0x1fc1aa,_0x259d4e){var _0x4d190b={'raw':![],'where':{}};var _0x40aefe={};var _0xfd2772={'count':0x0,'rows':[]};return db[_0x5691('0x3d')][_0x5691('0x60')]({'where':{'id':_0x33d73f['params']['id']}})[_0x5691('0x1e')](handleEntityNotFound(_0x1fc1aa,null))['then'](function(_0x14698a){if(_0x14698a){_0x40aefe['model']=_['keys'](db[_0x5691('0x9a')][_0x5691('0x3e')]);_0x40aefe[_0x5691('0x40')]=_[_0x5691('0x41')](_0x33d73f['query']);_0x40aefe[_0x5691('0x42')]=_[_0x5691('0x53')](_0x40aefe[_0x5691('0x43')],_0x40aefe['query']);_0x4d190b[_0x5691('0x44')]=_[_0x5691('0x53')](_0x40aefe[_0x5691('0x43')],qs['fields'](_0x33d73f[_0x5691('0x40')][_0x5691('0x45')]));_0x4d190b[_0x5691('0x44')]=_0x4d190b[_0x5691('0x44')][_0x5691('0x68')]?_0x4d190b[_0x5691('0x44')]:_0x40aefe['model'];if(!_0x33d73f[_0x5691('0x40')][_0x5691('0x46')](_0x5691('0x61'))){_0x4d190b['limit']=qs['limit'](_0x33d73f[_0x5691('0x40')]['limit']);_0x4d190b[_0x5691('0x2d')]=qs['offset'](_0x33d73f[_0x5691('0x40')][_0x5691('0x2d')]);}_0x4d190b[_0x5691('0x47')]=qs['sort'](_0x33d73f[_0x5691('0x40')][_0x5691('0x48')]);_0x4d190b['where']=qs[_0x5691('0x42')](_['pick'](_0x33d73f['query'],_0x40aefe[_0x5691('0x42')]));_0x4d190b[_0x5691('0x49')][_0x5691('0x5d')]=_0x14698a['id'];if(_0x33d73f[_0x5691('0x40')][_0x5691('0x4d')]){_0x4d190b['where']=_[_0x5691('0x4b')](_0x4d190b['where'],{'$or':_[_0x5691('0x3c')](_0x4d190b[_0x5691('0x44')],function(_0x474187){var _0x2898bc={};_0x2898bc[_0x474187]={'$like':'%'+_0x33d73f[_0x5691('0x40')][_0x5691('0x4d')]+'%'};return _0x2898bc;})});}_0x4d190b=_['merge']({},_0x4d190b,_0x33d73f[_0x5691('0x4e')]);return db[_0x5691('0x9a')][_0x5691('0x2f')]({'where':_0x4d190b[_0x5691('0x49')]})[_0x5691('0x1e')](function(_0x2d813f){_0xfd2772['count']=_0x2d813f;if(_0x33d73f[_0x5691('0x40')][_0x5691('0x4f')]){_0x4d190b[_0x5691('0x54')]=[{'model':db[_0x5691('0x71')],'as':_0x5691('0xbd'),'required':![]},{'model':db[_0x5691('0xbe')],'as':_0x5691('0xbf'),'attributes':['name',_0x5691('0xc0'),_0x5691('0xc1')],'required':![]},{'model':db[_0x5691('0xc2')],'as':_0x5691('0xc3'),'attributes':['id',_0x5691('0x39'),'color'],'where':_0x33d73f['query']['tag']?{'id':_0x33d73f[_0x5691('0x40')][_0x5691('0xc4')]}:undefined,'required':_0x33d73f[_0x5691('0x40')]['tag']?!![]:![]}];}return db[_0x5691('0x9a')]['findAll'](_0x4d190b);})[_0x5691('0x1e')](function(_0x250f9f){_0xfd2772[_0x5691('0x50')]=_0x250f9f;return _0xfd2772;});}})[_0x5691('0x1e')](respondWithFilteredResult(_0x1fc1aa,_0x4d190b))['catch'](handleError(_0x1fc1aa,null));};exports[_0x5691('0xb2')]=function(_0xd146d,_0x35afbb,_0x41e8e6){var _0x513b50,_0x37f8a1,_0x433633;if(_['isNil'](_0xd146d[_0x5691('0x56')]['body'])||_0xd146d[_0x5691('0x56')][_0x5691('0x56')]===''){throw new db[(_0x5691('0x72'))][(_0x5691('0x73'))](_0x5691('0xc5'));}if(_[_0x5691('0x8e')](_0xd146d[_0x5691('0x56')]['to'])){throw new db['Sequelize']['ValidationError'](_0x5691('0xc6'));}_0x513b50=_0xd146d['body']['to'];return db[_0x5691('0x3d')][_0x5691('0x5a')]({'where':{'id':_0xd146d['params']['id']},'include':[{'model':db[_0x5691('0x94')],'as':_0x5691('0xc7'),'include':[{'model':db[_0x5691('0x71')],'as':_0x5691('0x95'),'where':{'mobile':_0x513b50},'limit':0x1,'order':[[_0x5691('0x77'),_0x5691('0x96')]]}]}]})[_0x5691('0x1e')](handleEntityNotFound(_0x35afbb,null))[_0x5691('0x1e')](function(_0x1d2c16){if(_0x1d2c16&&_0x1d2c16[_0x5691('0xc7')]){_0x37f8a1=_0x1d2c16[_0x5691('0x34')]({'plain':!![]});if(_0x37f8a1['List']&&_0x37f8a1['List']['Contacts'][_0x5691('0x68')]){return _0x37f8a1[_0x5691('0xc7')][_0x5691('0x95')][0x0];}return db[_0x5691('0x71')]['create'](_['defaults'](_0xd146d['body'],{'firstName':_0x513b50,'mobile':_0x513b50,'phone':_0x513b50,'ListId':_0x37f8a1[_0x5691('0x78')]}));}})[_0x5691('0x1e')](handleEntityNotFound(_0x35afbb,null))[_0x5691('0x1e')](function(_0x2ec179){if(_0x2ec179){_0x433633=_0x2ec179;return db['SmsInteraction'][_0x5691('0x5a')]({'where':{'ContactId':_0x433633['id'],'closed':![],'SmsAccountId':_0x37f8a1['id']}})[_0x5691('0x1e')](function(_0x4d4ac1){if(_0x4d4ac1){return[_0x4d4ac1,![]];}return db[_0x5691('0x9a')]['create']({'UserId':_0xd146d['user']['id'],'ContactId':_0x433633['id'],'SmsAccountId':_0x37f8a1['id'],'phone':_0x513b50,'firstMsgDirection':_0x5691('0xc8'),'Messages':[_[_0x5691('0x4b')](_0xd146d['body'],{'read':![],'body':_0xd146d['body'][_0x5691('0x56')],'phone':_0x513b50,'SmsAccountId':_0x37f8a1['id'],'UserId':_0xd146d[_0x5691('0x57')]['id'],'ContactId':_0x433633['id']})]},{'include':[{'model':db[_0x5691('0xa1')],'as':_0x5691('0xc9')}]})[_0x5691('0x1e')](function(_0x2f5c2a){return[_0x2f5c2a,!![]];});});}})[_0x5691('0xca')](function(_0x18dc61,_0x3943e0){if(_0x3943e0){return _0x18dc61;}return db[_0x5691('0xa1')]['create'](_[_0x5691('0x4b')](_0xd146d[_0x5691('0x56')],{'read':![],'body':_0xd146d['body'][_0x5691('0x56')],'phone':_0x513b50,'SmsAccountId':_0x37f8a1['id'],'SmsInteractionId':_0x18dc61['id'],'UserId':_0xd146d['user']['id'],'ContactId':_0x433633['id']}))[_0x5691('0x1e')](function(_0x19eaf9){_0x18dc61[_0x5691('0xcb')][_0x5691('0xc9')]=[];_0x18dc61['dataValues'][_0x5691('0xc9')][_0x5691('0x9e')](_0x19eaf9[_0x5691('0xcb')]);return _0x18dc61;});})[_0x5691('0x1e')](respondWithResult(_0x35afbb,null))['catch'](handleError(_0x35afbb,null));};exports[_0x5691('0x2b')]=function(_0x3e71ba,_0x56c212,_0x35dfe6){if(_0x3e71ba['body']['id']){delete _0x3e71ba[_0x5691('0x56')]['id'];}var _0x9faddb,_0x5d33c5,_0x5e68e6;return db[_0x5691('0x3d')][_0x5691('0x5a')]({'where':{'id':_0x3e71ba[_0x5691('0x52')]['id']}})[_0x5691('0x1e')](handleEntityNotFound(_0x56c212,null))['then'](function(_0x512184){if(_0x512184){_0x5e68e6=_0x512184;logger[_0x5691('0x21')](_0x5691('0xab'),'status',_0x5691('0xcc'),_0x512184['type'],util[_0x5691('0xcd')](_0x3e71ba[_0x5691('0x56')],{'showHidden':![],'depth':null}));switch(_0x512184[_0x5691('0x4c')]){case _0x5691('0x7c'):if(_0x3e71ba['body'][_0x5691('0xce')]&&_0x3e71ba[_0x5691('0x56')][_0x5691('0x2b')]){_0x5d33c5=_0x3e71ba[_0x5691('0x56')][_0x5691('0x2b')];return db[_0x5691('0xa1')][_0x5691('0x5a')]({'where':{'messageId':_0x3e71ba[_0x5691('0x56')][_0x5691('0xce')]}});}break;case'connectel':if(_0x3e71ba['body'][_0x5691('0xcf')]&&_0x3e71ba[_0x5691('0x56')][_0x5691('0xd0')]){_0x5d33c5=_0x3e71ba['body'][_0x5691('0xd0')];return db[_0x5691('0xa1')][_0x5691('0x5a')]({'where':{'messageId':_0x3e71ba[_0x5691('0x56')]['requestid']}});}break;case _0x5691('0x81'):if(_0x3e71ba[_0x5691('0x56')][_0x5691('0x82')]&&_0x3e71ba[_0x5691('0x56')]['status_code']){_0x5d33c5=_0x3e71ba[_0x5691('0x56')][_0x5691('0xd1')];return db['SmsMessage'][_0x5691('0x5a')]({'where':{'messageId':_0x3e71ba[_0x5691('0x56')][_0x5691('0x82')]}});}break;case _0x5691('0xd2'):var _0x3382c1=_0x3e71ba[_0x5691('0x56')]['results'][0x0];if(_0x3382c1[_0x5691('0x7b')]&&_0x3382c1[_0x5691('0x2b')][_0x5691('0xd3')]===_0x5691('0xd4')){_0x5d33c5=_0x3382c1[_0x5691('0x2b')][_0x5691('0xd3')];return db[_0x5691('0xa1')][_0x5691('0x5a')]({'where':{'messageId':_0x3382c1[_0x5691('0x7b')]}});}break;case _0x5691('0xd5'):if(_0x3e71ba[_0x5691('0x56')][_0x5691('0x7b')]&&_0x3e71ba[_0x5691('0x56')][_0x5691('0x2b')]){_0x5d33c5=_0x3e71ba[_0x5691('0x56')][_0x5691('0x2b')];return db[_0x5691('0xa1')]['find']({'where':{'messageId':_0x3e71ba[_0x5691('0x56')][_0x5691('0x7b')]}});}break;case _0x5691('0xd6'):if(_0x3e71ba[_0x5691('0x56')][0x0][_0x5691('0x25')]['id']){_0x5d33c5=_0x3e71ba[_0x5691('0x56')][0x0][_0x5691('0x4c')];return db[_0x5691('0xa1')][_0x5691('0x5a')]({'where':{'messageId':_0x3e71ba[_0x5691('0x56')][0x0]['message']['id']}});}break;case'intelepeer':if(_0x3e71ba[_0x5691('0x56')][_0x5691('0xd7')]&&_0x3e71ba[_0x5691('0x56')][_0x5691('0x2b')]){_0x5d33c5=_0x3e71ba['body'][_0x5691('0x2b')];return db[_0x5691('0xa1')]['find']({'where':{'messageId':_0x3e71ba[_0x5691('0x56')][_0x5691('0xd7')]}});}break;}}})[_0x5691('0x1e')](handleEntityNotFound(_0x56c212,null))[_0x5691('0x1e')](function(_0x58af21){if(_0x58af21){_0x9faddb=_0x58af21;switch(_0x5e68e6[_0x5691('0x4c')]){case _0x5691('0x7c'):if(_0x5d33c5===_0x5691('0xd4')){return _0x9faddb['update']({'read':!![]});}else{logger[_0x5691('0x23')](_0x5691('0xab'),'status','skebby',util[_0x5691('0xcd')](_0x3e71ba['body'],{'showHidden':![],'depth':null}));}break;case _0x5691('0x7f'):if(_0x5d33c5==='1'){return _0x9faddb[_0x5691('0x33')]({'read':!![]});}else{logger[_0x5691('0x23')](_0x5691('0xab'),_0x5691('0x2b'),_0x5691('0x7c'),util[_0x5691('0xcd')](_0x3e71ba['body'],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x3e71ba[_0x5691('0x56')]['error_code']&&_0x5d33c5>=0xc8&&_0x5d33c5<=0xce){return _0x9faddb[_0x5691('0x33')]({'read':!![]});}else{logger[_0x5691('0x23')](_0x5691('0xab'),_0x5691('0x2b'),_0x5691('0x81'),util[_0x5691('0xcd')](_0x3e71ba[_0x5691('0x56')],{'showHidden':![],'depth':null}));}break;case _0x5691('0xd2'):var _0x395e53=_0x3e71ba[_0x5691('0x56')][_0x5691('0x86')][0x0];if(_0x395e53[_0x5691('0x2b')][_0x5691('0xd3')]===_0x5691('0xd4')){return _0x9faddb[_0x5691('0x33')]({'read':!![]});}else{logger[_0x5691('0x23')](_0x5691('0xab'),'status',_0x5691('0xd2'),util['inspect'](_0x3e71ba[_0x5691('0x56')],{'showHidden':![],'depth':null}));}break;case _0x5691('0xd5'):if(_0x5d33c5==_0x5691('0xd8')||_0x5d33c5=='RECEIVED_BY_RECIPIENT'){return _0x9faddb[_0x5691('0x33')]({'read':!![]});}else{logger[_0x5691('0x23')](_0x5691('0xab'),'status',_0x5691('0xd5'),util[_0x5691('0xcd')](_0x3e71ba[_0x5691('0x56')],{'showHidden':![],'depth':null}));}break;case _0x5691('0xd6'):if(_0x5d33c5==_0x5691('0xd9')){return _0x9faddb[_0x5691('0x33')]({'read':!![]});}else{logger[_0x5691('0x23')](_0x5691('0xab'),_0x5691('0x2b'),'bandwidth',util[_0x5691('0xcd')](_0x3e71ba['body'],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x5d33c5===_0x5691('0xda')||_0x5d33c5===_0x5691('0xdb')){return _0x9faddb['update']({'read':!![]});}else{logger[_0x5691('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x5691('0x2b'),'intelepeer',util['inspect'](_0x3e71ba[_0x5691('0x56')],{'showHidden':![],'depth':null}));}break;}return _0x9faddb;}})[_0x5691('0x1e')](respondWithResult(_0x56c212,null))[_0x5691('0x28')](handleError(_0x56c212,null));};exports[_0x5691('0xdc')]=function(_0x40b77d,_0x39bad0,_0x59814d){var _0x4b154b,_0x3109db,_0x49375e;return db[_0x5691('0x3d')][_0x5691('0x5a')]({'where':{'id':_0x40b77d[_0x5691('0x52')]['id']}})['then'](handleEntityNotFound(_0x39bad0,null))[_0x5691('0x1e')](function(_0x4ac3bd){if(_0x4ac3bd){_0x49375e=_0x4ac3bd;logger[_0x5691('0x21')](_0x5691('0xab'),_0x5691('0x2b'),'received\x20delivery\x20report\x20from',_0x4ac3bd['type'],util['inspect'](_0x40b77d['query'],{'showHidden':![],'depth':null}));switch(_0x4ac3bd[_0x5691('0x4c')]){case _0x5691('0x87'):if(_0x40b77d['query'][_0x5691('0xdd')]&&_0x40b77d[_0x5691('0x40')]['state']){_0x3109db=_0x40b77d[_0x5691('0x40')][_0x5691('0xde')];return db[_0x5691('0xa1')][_0x5691('0x5a')]({'where':{'messageId':_0x40b77d['query'][_0x5691('0xdd')]}});}break;}}})[_0x5691('0x1e')](handleEntityNotFound(_0x39bad0,null))[_0x5691('0x1e')](function(_0x4fa9fc){if(_0x4fa9fc){_0x4b154b=_0x4fa9fc;switch(_0x49375e['type']){case _0x5691('0x87'):if(_0x3109db==='2'||_0x3109db==='6'){return _0x4b154b[_0x5691('0x33')]({'read':!![]});}else{logger['error'](_0x5691('0xab'),'status','csc',util[_0x5691('0xcd')](_0x40b77d[_0x5691('0x40')],{'showHidden':![],'depth':null}));};break;}return _0x4b154b;}})[_0x5691('0x1e')](respondWithResult(_0x39bad0,null))[_0x5691('0x28')](handleError(_0x39bad0,null));};exports[_0x5691('0xdf')]=function(_0x852949,_0x45dfc6,_0x4d78c4){return db[_0x5691('0x3d')][_0x5691('0x5a')]({'where':{'id':_0x852949[_0x5691('0x52')]['id']}})['then'](handleEntityNotFound(_0x45dfc6,null))[_0x5691('0x1e')](function(_0x4c2e04){if(_0x4c2e04){return _0x4c2e04['addAgents'](_0x852949[_0x5691('0x56')]['ids'],_[_0x5691('0x97')](_0x852949[_0x5691('0x56')],[_0x5691('0x64'),'id'])||{})[_0x5691('0xca')](function(_0xf581c8){for(var _0x4e5ecc=0x0;_0x4e5ecc<_0x852949[_0x5691('0x56')]['ids']['length'];_0x4e5ecc+=0x1){socket[_0x5691('0xe0')]('userSmsAccount:save',{'UserId':Number(_0x852949[_0x5691('0x56')][_0x5691('0x64')][_0x4e5ecc]),'SmsAccountId':Number(_0x852949['params']['id'])});}return _0xf581c8;});}})[_0x5691('0x1e')](respondWithResult(_0x45dfc6,null))[_0x5691('0x28')](handleError(_0x45dfc6,null));};exports[_0x5691('0xe1')]=function(_0x780c79,_0x22b283,_0x5ed82d){return db[_0x5691('0x3d')]['find']({'where':{'id':_0x780c79[_0x5691('0x52')]['id']}})[_0x5691('0x1e')](handleEntityNotFound(_0x22b283,null))[_0x5691('0x1e')](function(_0x12d2a0){if(_0x12d2a0){return _0x12d2a0[_0x5691('0xe1')](_0x780c79[_0x5691('0x40')][_0x5691('0x64')])['then'](function(){if(_[_0x5691('0xe2')](_0x780c79[_0x5691('0x40')][_0x5691('0x64')])){for(var _0x1452b3=0x0;_0x1452b3<_0x780c79[_0x5691('0x40')][_0x5691('0x64')][_0x5691('0x68')];_0x1452b3+=0x1){socket[_0x5691('0xe0')]('userSmsAccount:remove',{'UserId':Number(_0x780c79[_0x5691('0x40')][_0x5691('0x64')][_0x1452b3]),'SmsAccountId':Number(_0x780c79[_0x5691('0x52')]['id'])});}}else{socket[_0x5691('0xe0')](_0x5691('0xe3'),{'UserId':Number(_0x780c79[_0x5691('0x40')][_0x5691('0x64')]),'SmsAccountId':Number(_0x780c79[_0x5691('0x52')]['id'])});}});}})[_0x5691('0x1e')](respondWithStatusCode(_0x22b283,null))[_0x5691('0x28')](handleError(_0x22b283,null));};exports[_0x5691('0xe4')]=function(_0xee710,_0x13333c,_0x332e16){var _0x2ae400={};var _0x4cfd32={};var _0x4306b8;var _0x2fea16;return db[_0x5691('0x3d')][_0x5691('0x60')]({'where':{'id':_0xee710[_0x5691('0x52')]['id']}})['then'](handleEntityNotFound(_0x13333c,null))[_0x5691('0x1e')](function(_0x2ac49e){if(_0x2ac49e){_0x4306b8=_0x2ac49e;_0x4cfd32[_0x5691('0x43')]=_[_0x5691('0x41')](db[_0x5691('0xbe')][_0x5691('0x3e')]);_0x4cfd32['query']=_['keys'](_0xee710['query']);_0x4cfd32[_0x5691('0x42')]=_[_0x5691('0x53')](_0x4cfd32[_0x5691('0x43')],_0x4cfd32['query']);_0x2ae400['attributes']=_[_0x5691('0x53')](_0x4cfd32[_0x5691('0x43')],qs[_0x5691('0x45')](_0xee710[_0x5691('0x40')]['fields']));_0x2ae400[_0x5691('0x44')]=_0x2ae400['attributes'][_0x5691('0x68')]?_0x2ae400[_0x5691('0x44')]:_0x4cfd32[_0x5691('0x43')];_0x2ae400[_0x5691('0x47')]=qs[_0x5691('0x48')](_0xee710[_0x5691('0x40')][_0x5691('0x48')]);_0x2ae400[_0x5691('0x49')]=qs[_0x5691('0x42')](_['pick'](_0xee710[_0x5691('0x40')],_0x4cfd32[_0x5691('0x42')]));if(_0xee710[_0x5691('0x40')]['filter']){_0x2ae400[_0x5691('0x49')]=_[_0x5691('0x4b')](_0x2ae400[_0x5691('0x49')],{'$or':_[_0x5691('0x3c')](_0x2ae400[_0x5691('0x44')],function(_0x319a80){var _0x51e2d3={};_0x51e2d3[_0x319a80]={'$like':'%'+_0xee710[_0x5691('0x40')][_0x5691('0x4d')]+'%'};return _0x51e2d3;})});}_0x2ae400=_[_0x5691('0x4b')]({},_0x2ae400,_0xee710[_0x5691('0x4e')]);return _0x4306b8[_0x5691('0xe4')](_0x2ae400);}})[_0x5691('0x1e')](function(_0x3d29ca){if(_0x3d29ca){_0x2fea16=_0x3d29ca['length'];if(!_0xee710['query']['hasOwnProperty']('nolimit')){_0x2ae400[_0x5691('0x30')]=qs['limit'](_0xee710[_0x5691('0x40')][_0x5691('0x30')]);_0x2ae400[_0x5691('0x2d')]=qs[_0x5691('0x2d')](_0xee710[_0x5691('0x40')][_0x5691('0x2d')]);}return _0x4306b8[_0x5691('0xe4')](_0x2ae400);}})[_0x5691('0x1e')](function(_0x3d8256){if(_0x3d8256){return _0x3d8256?{'count':_0x2fea16,'rows':_0x3d8256}:null;}})[_0x5691('0x1e')](respondWithResult(_0x13333c,null))[_0x5691('0x28')](handleError(_0x13333c,null));}; \ No newline at end of file +var _0x5b4b=['isNil','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','CmList','ListId','DESC','list','omit','Contacts','contact','SmsInteraction','spread','interaction','autoclose','push','close','unmanaged','created','SmsMessage','ContactId','AttachmentId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','twilio','Content-Type','\x0a','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','priority','finally','rawAttributes','getApplications','Contact','internal','Tags','tag','body\x20is\x20mandatory\x20and\x20not\x20empty','List','out','Messages','dataValues','received\x20delivery\x20report\x20from','skebby_dispatch_id','requestid','statusInt','message_id','groupName','DELIVERED','redif','inspect','clickatell','RECEIVED_BY_RECIPIENT','message-delivered','ACCEPTD','state','message-id','addAgents','userSmsAccount:save','removeAgents','isArray','emit','userSmsAccount:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./smsAccount.socket','register','client','http','request','then','info','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','destroy','get','SmsAccounts','stack','name','send','index','Pause','mandatoryDispositionPause','map','SmsAccount','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','type','includeAll','include','findAll','rows','catch','show','keys','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','update','params','describe','addDisposition','find','Disposition','getDispositions','findOne','nolimit','order','SmsAccountId','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','sms','SmsApplication','Applications','account','applications','orderBy','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','mobile','from','From','Body','MessageSid','skebby','sender','text','connectel','clicksend','messageId','plivo','MessageUUID','infobip','results','csc','segmentedMessage','fromNumber','replyMessageId','bandwidth','intelepeer','refid'];(function(_0x2bb6dd,_0x252667){var _0x2a07dc=function(_0x1b6693){while(--_0x1b6693){_0x2bb6dd['push'](_0x2bb6dd['shift']());}};_0x2a07dc(++_0x252667);}(_0x5b4b,0x127));var _0xb5b4=function(_0x1edc53,_0x4c096c){_0x1edc53=_0x1edc53-0x0;var _0x4cfe99=_0x5b4b[_0x1edc53];return _0x4cfe99;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb5b4('0x0'));var zipdir=require(_0xb5b4('0x1'));var jsonpatch=require(_0xb5b4('0x2'));var rp=require(_0xb5b4('0x3'));var moment=require(_0xb5b4('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xb5b4('0x5'));var sox=require(_0xb5b4('0x6'));var csv=require(_0xb5b4('0x7'));var ejs=require(_0xb5b4('0x8'));var fs=require('fs');var fs_extra=require(_0xb5b4('0x9'));var _=require(_0xb5b4('0xa'));var squel=require(_0xb5b4('0xb'));var crypto=require(_0xb5b4('0xc'));var jsforce=require(_0xb5b4('0xd'));var deskjs=require(_0xb5b4('0xe'));var toCsv=require(_0xb5b4('0x7'));var querystring=require(_0xb5b4('0xf'));var Papa=require('papaparse');var Redis=require(_0xb5b4('0x10'));var authService=require(_0xb5b4('0x11'));var qs=require(_0xb5b4('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb5b4('0x13'));var logger=require(_0xb5b4('0x14'))(_0xb5b4('0x15'));var utils=require(_0xb5b4('0x16'));var config=require(_0xb5b4('0x17'));var licenseUtil=require(_0xb5b4('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xb5b4('0x19')](config[_0xb5b4('0x1a')],{'host':_0xb5b4('0x1b'),'port':0x18eb});var socket=require(_0xb5b4('0x1c'))(new Redis(config[_0xb5b4('0x1a')]));require(_0xb5b4('0x1d'))[_0xb5b4('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0xb5b4('0x1f')][_0xb5b4('0x20')]({'port':0x232c});function respondWithRpcPromise(_0xd807dc,_0x15a8f4,_0x3b90f0,_0x58420d){return new BPromise(function(_0x490a32,_0x22d7fb){var _0x5729a9=_0x58420d||client;return _0x5729a9[_0xb5b4('0x21')](_0xd807dc,_0x3b90f0)[_0xb5b4('0x22')](function(_0xe1ee7b){logger[_0xb5b4('0x23')](_0xb5b4('0x24'),_0x15a8f4,'request\x20sent');logger[_0xb5b4('0x25')](_0xb5b4('0x26'),_0x15a8f4,_0xb5b4('0x27'),JSON['stringify'](_0xe1ee7b));if(_0xe1ee7b[_0xb5b4('0x28')]){if(_0xe1ee7b[_0xb5b4('0x28')][_0xb5b4('0x29')]===0x1f4){logger[_0xb5b4('0x28')](_0xb5b4('0x24'),_0x15a8f4,_0xe1ee7b[_0xb5b4('0x28')]['message']);return _0x22d7fb(_0xe1ee7b[_0xb5b4('0x28')]['message']);}logger[_0xb5b4('0x28')](_0xb5b4('0x24'),_0x15a8f4,_0xe1ee7b[_0xb5b4('0x28')][_0xb5b4('0x2a')]);return _0x490a32(_0xe1ee7b[_0xb5b4('0x28')]['message']);}else{logger[_0xb5b4('0x23')](_0xb5b4('0x24'),_0x15a8f4,_0xb5b4('0x27'));_0x490a32(_0xe1ee7b[_0xb5b4('0x2b')][_0xb5b4('0x2a')]);}})['catch'](function(_0x4b812e){logger[_0xb5b4('0x28')]('SmsAccount,\x20%s,\x20%s',_0x15a8f4,_0x4b812e);_0x22d7fb(_0x4b812e);});});}function respondWithStatusCode(_0x40d8cc,_0x1aa9e2){_0x1aa9e2=_0x1aa9e2||0xcc;return function(_0x159b04){if(_0x159b04){return _0x40d8cc[_0xb5b4('0x2c')](_0x1aa9e2);}return _0x40d8cc[_0xb5b4('0x2d')](_0x1aa9e2)[_0xb5b4('0x2e')]();};}function respondWithResult(_0x275a31,_0x2a061a){_0x2a061a=_0x2a061a||0xc8;return function(_0xa4f95e){if(_0xa4f95e){return _0x275a31[_0xb5b4('0x2d')](_0x2a061a)[_0xb5b4('0x2f')](_0xa4f95e);}};}function respondWithFilteredResult(_0x4dba0f,_0x16c3df){return function(_0x103556){if(_0x103556){var _0x11daa0=typeof _0x16c3df[_0xb5b4('0x30')]===_0xb5b4('0x31')&&typeof _0x16c3df[_0xb5b4('0x32')]===_0xb5b4('0x31');var _0x279b3d=_0x103556[_0xb5b4('0x33')];var _0xe90443=_0x11daa0?0x0:_0x16c3df['offset'];var _0x270385=_0x11daa0?_0x103556[_0xb5b4('0x33')]:_0x16c3df['offset']+_0x16c3df[_0xb5b4('0x32')];var _0x4e6edf;if(_0x270385>=_0x279b3d){_0x270385=_0x279b3d;_0x4e6edf=0xc8;}else{_0x4e6edf=0xce;}_0x4dba0f[_0xb5b4('0x2d')](_0x4e6edf);return _0x4dba0f[_0xb5b4('0x34')](_0xb5b4('0x35'),_0xe90443+'-'+_0x270385+'/'+_0x279b3d)['json'](_0x103556);}return null;};}function patchUpdates(_0x34fffc){return function(_0x471214){try{jsonpatch[_0xb5b4('0x36')](_0x471214,_0x34fffc,!![]);}catch(_0x21fd65){return BPromise[_0xb5b4('0x37')](_0x21fd65);}return _0x471214['save']();};}function saveUpdates(_0x2241c5,_0x688a6c){return function(_0xa8069b){if(_0xa8069b){return _0xa8069b['update'](_0x2241c5)['then'](function(_0x1fb213){return _0x1fb213;});}return null;};}function removeEntity(_0x5ab769,_0xfd431){return function(_0x1675cc){if(_0x1675cc){return _0x1675cc[_0xb5b4('0x38')]()['then'](function(){var _0x1d9cad=_0x1675cc[_0xb5b4('0x39')]({'plain':!![]});var _0x33388f=_0xb5b4('0x3a');return db['UserProfileResource'][_0xb5b4('0x38')]({'where':{'type':_0x33388f,'resourceId':_0x1d9cad['id']}})['then'](function(){return _0x1675cc;});})[_0xb5b4('0x22')](function(){_0x5ab769[_0xb5b4('0x2d')](0xcc)[_0xb5b4('0x2e')]();});}};}function handleEntityNotFound(_0xbbac2c,_0x1b6c06){return function(_0x4e98bc){if(!_0x4e98bc){_0xbbac2c['sendStatus'](0x194);}return _0x4e98bc;};}function handleError(_0x3a86ff,_0x4bfe1f){_0x4bfe1f=_0x4bfe1f||0x1f4;return function(_0xc5369){logger[_0xb5b4('0x28')](_0xc5369[_0xb5b4('0x3b')]);if(_0xc5369['name']){delete _0xc5369[_0xb5b4('0x3c')];}_0x3a86ff[_0xb5b4('0x2d')](_0x4bfe1f)[_0xb5b4('0x3d')](_0xc5369);};}exports[_0xb5b4('0x3e')]=function(_0x5ee495,_0x307a0e){var _0x527983={'include':[{'model':db[_0xb5b4('0x3f')],'as':_0xb5b4('0x40')}]},_0x2def96={},_0x178e7d={'count':0x0,'rows':[]};var _0x3cbdef=_[_0xb5b4('0x41')](db[_0xb5b4('0x42')]['rawAttributes'],function(_0x2b9c33){return{'name':_0x2b9c33[_0xb5b4('0x43')],'type':_0x2b9c33['type'][_0xb5b4('0x44')]};});_0x2def96[_0xb5b4('0x45')]=_[_0xb5b4('0x41')](_0x3cbdef,_0xb5b4('0x3c'));_0x2def96['query']=_['keys'](_0x5ee495[_0xb5b4('0x46')]);_0x2def96[_0xb5b4('0x47')]=_[_0xb5b4('0x48')](_0x2def96['model'],_0x2def96[_0xb5b4('0x46')]);_0x527983[_0xb5b4('0x49')]=_[_0xb5b4('0x48')](_0x2def96['model'],qs[_0xb5b4('0x4a')](_0x5ee495['query'][_0xb5b4('0x4a')]));_0x527983[_0xb5b4('0x49')]=_0x527983['attributes'][_0xb5b4('0x4b')]?_0x527983[_0xb5b4('0x49')]:_0x2def96[_0xb5b4('0x45')];if(!_0x5ee495[_0xb5b4('0x46')][_0xb5b4('0x4c')]('nolimit')){_0x527983[_0xb5b4('0x32')]=qs[_0xb5b4('0x32')](_0x5ee495['query']['limit']);_0x527983[_0xb5b4('0x30')]=qs[_0xb5b4('0x30')](_0x5ee495[_0xb5b4('0x46')][_0xb5b4('0x30')]);}_0x527983['order']=qs[_0xb5b4('0x4d')](_0x5ee495[_0xb5b4('0x46')]['sort']);_0x527983[_0xb5b4('0x4e')]=qs[_0xb5b4('0x47')](_[_0xb5b4('0x4f')](_0x5ee495['query'],_0x2def96[_0xb5b4('0x47')]),_0x3cbdef);if(_0x5ee495[_0xb5b4('0x46')][_0xb5b4('0x50')]){_0x527983[_0xb5b4('0x4e')]=_[_0xb5b4('0x51')](_0x527983[_0xb5b4('0x4e')],{'$or':_[_0xb5b4('0x41')](_0x3cbdef,function(_0x4c1817){if(_0x4c1817[_0xb5b4('0x52')]!=='VIRTUAL'){var _0x3f3f18={};_0x3f3f18[_0x4c1817[_0xb5b4('0x3c')]]={'$like':'%'+_0x5ee495[_0xb5b4('0x46')][_0xb5b4('0x50')]+'%'};return _0x3f3f18;}})});}_0x527983=_['merge']({},_0x527983,_0x5ee495['options']);var _0x2ec7a2={'where':_0x527983[_0xb5b4('0x4e')]};return db[_0xb5b4('0x42')][_0xb5b4('0x33')](_0x2ec7a2)[_0xb5b4('0x22')](function(_0x2d031b){_0x178e7d[_0xb5b4('0x33')]=_0x2d031b;if(_0x5ee495[_0xb5b4('0x46')][_0xb5b4('0x53')]){_0x527983[_0xb5b4('0x54')]=[{'all':!![]}];}return db[_0xb5b4('0x42')][_0xb5b4('0x55')](_0x527983);})[_0xb5b4('0x22')](function(_0x409328){_0x178e7d[_0xb5b4('0x56')]=_0x409328;return _0x178e7d;})[_0xb5b4('0x22')](respondWithFilteredResult(_0x307a0e,_0x527983))[_0xb5b4('0x57')](handleError(_0x307a0e,null));};exports[_0xb5b4('0x58')]=function(_0xc03748,_0x3816d1){var _0x369207={'raw':![],'where':{'id':_0xc03748['params']['id']},'include':[{'model':db[_0xb5b4('0x3f')],'as':_0xb5b4('0x40')}]},_0x4b5c1a={};_0x4b5c1a[_0xb5b4('0x45')]=_[_0xb5b4('0x59')](db[_0xb5b4('0x42')]['rawAttributes']);_0x4b5c1a[_0xb5b4('0x46')]=_[_0xb5b4('0x59')](_0xc03748['query']);_0x4b5c1a[_0xb5b4('0x47')]=_['intersection'](_0x4b5c1a[_0xb5b4('0x45')],_0x4b5c1a[_0xb5b4('0x46')]);_0x369207['attributes']=_['intersection'](_0x4b5c1a[_0xb5b4('0x45')],qs[_0xb5b4('0x4a')](_0xc03748[_0xb5b4('0x46')][_0xb5b4('0x4a')]));_0x369207[_0xb5b4('0x49')]=_0x369207['attributes']['length']?_0x369207[_0xb5b4('0x49')]:_0x4b5c1a[_0xb5b4('0x45')];if(_0xc03748['query'][_0xb5b4('0x53')]){_0x369207[_0xb5b4('0x54')]=[{'all':!![]}];}_0x369207=_[_0xb5b4('0x51')]({},_0x369207,_0xc03748[_0xb5b4('0x5a')]);return db['SmsAccount']['find'](_0x369207)['then'](handleEntityNotFound(_0x3816d1,null))['then'](respondWithResult(_0x3816d1,null))[_0xb5b4('0x57')](handleError(_0x3816d1,null));};exports['create']=function(_0x4b53a2,_0x1d7c6d){return db[_0xb5b4('0x42')][_0xb5b4('0x5b')](_0x4b53a2[_0xb5b4('0x5c')],{})[_0xb5b4('0x22')](function(_0x124d10){var _0x388bd7=_0x4b53a2[_0xb5b4('0x5d')][_0xb5b4('0x39')]({'plain':!![]});if(!_0x388bd7)throw new Error(_0xb5b4('0x5e'));if(_0x388bd7[_0xb5b4('0x5f')]===_0xb5b4('0x5d')){var _0x5660ae=_0x124d10[_0xb5b4('0x39')]({'plain':!![]});var _0x1c2c4e=_0xb5b4('0x3a');return db[_0xb5b4('0x60')]['find']({'where':{'name':_0x1c2c4e,'userProfileId':_0x388bd7[_0xb5b4('0x61')]},'raw':!![]})[_0xb5b4('0x22')](function(_0x3f2536){if(_0x3f2536&&_0x3f2536['autoAssociation']===0x0){return db[_0xb5b4('0x62')][_0xb5b4('0x5b')]({'name':_0x5660ae[_0xb5b4('0x3c')],'resourceId':_0x5660ae['id'],'type':_0x3f2536[_0xb5b4('0x3c')],'sectionId':_0x3f2536['id']},{})[_0xb5b4('0x22')](function(){return _0x124d10;});}else{return _0x124d10;}})[_0xb5b4('0x57')](function(_0x15b938){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x15b938);throw _0x15b938;});}return _0x124d10;})[_0xb5b4('0x22')](respondWithResult(_0x1d7c6d,0xc9))['catch'](handleError(_0x1d7c6d,null));};exports[_0xb5b4('0x63')]=function(_0x1b7443,_0x15653b){if(_0x1b7443[_0xb5b4('0x5c')]['id']){delete _0x1b7443[_0xb5b4('0x5c')]['id'];}return db[_0xb5b4('0x42')]['find']({'where':{'id':_0x1b7443[_0xb5b4('0x64')]['id']},'include':[{'model':db['Pause'],'as':_0xb5b4('0x40')}]})[_0xb5b4('0x22')](handleEntityNotFound(_0x15653b,null))['then'](saveUpdates(_0x1b7443[_0xb5b4('0x5c')],null))[_0xb5b4('0x22')](respondWithResult(_0x15653b,null))[_0xb5b4('0x57')](handleError(_0x15653b,null));};exports[_0xb5b4('0x38')]=function(_0x50ccf7,_0x2807b4){return db['SmsAccount']['find']({'where':{'id':_0x50ccf7[_0xb5b4('0x64')]['id']}})[_0xb5b4('0x22')](handleEntityNotFound(_0x2807b4,null))[_0xb5b4('0x22')](removeEntity(_0x2807b4,null))[_0xb5b4('0x57')](handleError(_0x2807b4,null));};exports['describe']=function(_0x1c7a8f,_0x3f5767){return db['SmsAccount'][_0xb5b4('0x65')]()['then'](respondWithResult(_0x3f5767,null))[_0xb5b4('0x57')](handleError(_0x3f5767,null));};exports[_0xb5b4('0x66')]=function(_0x4eb1f2,_0x373f78,_0x181f0f){if(_0x4eb1f2[_0xb5b4('0x5c')]['id']){delete _0x4eb1f2[_0xb5b4('0x5c')]['id'];}return db[_0xb5b4('0x42')][_0xb5b4('0x67')]({'where':{'id':_0x4eb1f2['params']['id']}})[_0xb5b4('0x22')](handleEntityNotFound(_0x373f78,null))[_0xb5b4('0x22')](function(_0x2626d0){if(_0x2626d0){_0x4eb1f2[_0xb5b4('0x5c')]['SmsAccountId']=_0x2626d0['id'];return db[_0xb5b4('0x68')]['create'](_0x4eb1f2['body']);}})[_0xb5b4('0x22')](respondWithResult(_0x373f78,null))[_0xb5b4('0x57')](handleError(_0x373f78,null));};exports[_0xb5b4('0x69')]=function(_0x21ed18,_0x70c8a6,_0x3f7bd8){var _0x13411e={'raw':![],'where':{}};var _0x5c034d={};var _0x49c7f2={'count':0x0,'rows':[]};return db[_0xb5b4('0x42')][_0xb5b4('0x6a')]({'where':{'id':_0x21ed18[_0xb5b4('0x64')]['id']}})['then'](handleEntityNotFound(_0x70c8a6,null))[_0xb5b4('0x22')](function(_0x459d01){if(_0x459d01){_0x5c034d['model']=_[_0xb5b4('0x59')](db[_0xb5b4('0x68')]['rawAttributes']);_0x5c034d[_0xb5b4('0x46')]=_['keys'](_0x21ed18[_0xb5b4('0x46')]);_0x5c034d[_0xb5b4('0x47')]=_[_0xb5b4('0x48')](_0x5c034d[_0xb5b4('0x45')],_0x5c034d['query']);_0x13411e[_0xb5b4('0x49')]=_[_0xb5b4('0x48')](_0x5c034d[_0xb5b4('0x45')],qs[_0xb5b4('0x4a')](_0x21ed18[_0xb5b4('0x46')][_0xb5b4('0x4a')]));_0x13411e[_0xb5b4('0x49')]=_0x13411e[_0xb5b4('0x49')][_0xb5b4('0x4b')]?_0x13411e[_0xb5b4('0x49')]:_0x5c034d[_0xb5b4('0x45')];if(!_0x21ed18['query']['hasOwnProperty'](_0xb5b4('0x6b'))){_0x13411e[_0xb5b4('0x32')]=qs[_0xb5b4('0x32')](_0x21ed18[_0xb5b4('0x46')][_0xb5b4('0x32')]);_0x13411e[_0xb5b4('0x30')]=qs[_0xb5b4('0x30')](_0x21ed18[_0xb5b4('0x46')]['offset']);}_0x13411e[_0xb5b4('0x6c')]=qs[_0xb5b4('0x4d')](_0x21ed18['query'][_0xb5b4('0x4d')]);_0x13411e[_0xb5b4('0x4e')]=qs[_0xb5b4('0x47')](_['pick'](_0x21ed18[_0xb5b4('0x46')],_0x5c034d[_0xb5b4('0x47')]));_0x13411e['where'][_0xb5b4('0x6d')]=_0x459d01['id'];if(_0x21ed18[_0xb5b4('0x46')][_0xb5b4('0x50')]){_0x13411e[_0xb5b4('0x4e')]=_[_0xb5b4('0x51')](_0x13411e[_0xb5b4('0x4e')],{'$or':_[_0xb5b4('0x41')](_0x13411e[_0xb5b4('0x49')],function(_0x56fb72){var _0x556455={};_0x556455[_0x56fb72]={'$like':'%'+_0x21ed18[_0xb5b4('0x46')][_0xb5b4('0x50')]+'%'};return _0x556455;})});}_0x13411e=_[_0xb5b4('0x51')]({},_0x13411e,_0x21ed18[_0xb5b4('0x5a')]);return db[_0xb5b4('0x68')][_0xb5b4('0x33')]({'where':_0x13411e[_0xb5b4('0x4e')]})[_0xb5b4('0x22')](function(_0xdb5be1){_0x49c7f2[_0xb5b4('0x33')]=_0xdb5be1;if(_0x21ed18[_0xb5b4('0x46')][_0xb5b4('0x53')]){_0x13411e[_0xb5b4('0x54')]=[{'all':!![]}];}return db[_0xb5b4('0x68')][_0xb5b4('0x55')](_0x13411e);})[_0xb5b4('0x22')](function(_0x379925){_0x49c7f2['rows']=_0x379925;return _0x49c7f2;});}})['then'](respondWithFilteredResult(_0x70c8a6,_0x13411e))[_0xb5b4('0x57')](handleError(_0x70c8a6,null));};exports[_0xb5b4('0x6e')]=function(_0x32760b,_0x4c56fa,_0x13cb9a){return db[_0xb5b4('0x42')][_0xb5b4('0x67')]({'where':{'id':_0x32760b['params']['id']}})[_0xb5b4('0x22')](handleEntityNotFound(_0x4c56fa,null))['then'](function(_0x4cd81e){if(_0x4cd81e){return _0x4cd81e[_0xb5b4('0x6e')](_0x32760b[_0xb5b4('0x46')][_0xb5b4('0x6f')]);}})['then'](respondWithStatusCode(_0x4c56fa,null))[_0xb5b4('0x57')](handleError(_0x4c56fa,null));};exports[_0xb5b4('0x70')]=function(_0x237d8e,_0x16f726,_0x161e44){if(_0x237d8e['body']['id']){delete _0x237d8e['body']['id'];}return db[_0xb5b4('0x42')][_0xb5b4('0x67')]({'where':{'id':_0x237d8e[_0xb5b4('0x64')]['id']}})[_0xb5b4('0x22')](handleEntityNotFound(_0x16f726,null))[_0xb5b4('0x22')](function(_0x135bd5){if(_0x135bd5){_0x237d8e[_0xb5b4('0x5c')][_0xb5b4('0x6d')]=_0x135bd5['id'];return db[_0xb5b4('0x71')][_0xb5b4('0x5b')](_0x237d8e[_0xb5b4('0x5c')]);}})['then'](respondWithResult(_0x16f726,null))[_0xb5b4('0x57')](handleError(_0x16f726,null));};exports[_0xb5b4('0x72')]=function(_0x2714dd,_0x2bbc92,_0x1b82d6){var _0x11536c={'raw':![],'where':{}};var _0x503bb0={};var _0x343fe5={'count':0x0,'rows':[]};return db[_0xb5b4('0x42')][_0xb5b4('0x6a')]({'where':{'id':_0x2714dd[_0xb5b4('0x64')]['id']}})[_0xb5b4('0x22')](handleEntityNotFound(_0x2bbc92,null))[_0xb5b4('0x22')](function(_0x50eac1){if(_0x50eac1){_0x503bb0[_0xb5b4('0x45')]=_['keys'](db[_0xb5b4('0x71')]['rawAttributes']);_0x503bb0[_0xb5b4('0x46')]=_['keys'](_0x2714dd[_0xb5b4('0x46')]);_0x503bb0[_0xb5b4('0x47')]=_['intersection'](_0x503bb0['model'],_0x503bb0[_0xb5b4('0x46')]);_0x11536c[_0xb5b4('0x49')]=_[_0xb5b4('0x48')](_0x503bb0[_0xb5b4('0x45')],qs['fields'](_0x2714dd['query'][_0xb5b4('0x4a')]));_0x11536c['attributes']=_0x11536c[_0xb5b4('0x49')][_0xb5b4('0x4b')]?_0x11536c[_0xb5b4('0x49')]:_0x503bb0['model'];if(!_0x2714dd[_0xb5b4('0x46')]['hasOwnProperty'](_0xb5b4('0x6b'))){_0x11536c[_0xb5b4('0x32')]=qs[_0xb5b4('0x32')](_0x2714dd['query'][_0xb5b4('0x32')]);_0x11536c[_0xb5b4('0x30')]=qs[_0xb5b4('0x30')](_0x2714dd[_0xb5b4('0x46')][_0xb5b4('0x30')]);}_0x11536c[_0xb5b4('0x6c')]=qs['sort'](_0x2714dd[_0xb5b4('0x46')][_0xb5b4('0x4d')]);_0x11536c['where']=qs[_0xb5b4('0x47')](_['pick'](_0x2714dd[_0xb5b4('0x46')],_0x503bb0[_0xb5b4('0x47')]));_0x11536c[_0xb5b4('0x4e')][_0xb5b4('0x6d')]=_0x50eac1['id'];if(_0x2714dd[_0xb5b4('0x46')]['filter']){_0x11536c[_0xb5b4('0x4e')]=_[_0xb5b4('0x51')](_0x11536c['where'],{'$or':_[_0xb5b4('0x41')](_0x11536c[_0xb5b4('0x49')],function(_0x2ff521){var _0x4230af={};_0x4230af[_0x2ff521]={'$like':'%'+_0x2714dd['query'][_0xb5b4('0x50')]+'%'};return _0x4230af;})});}_0x11536c=_[_0xb5b4('0x51')]({},_0x11536c,_0x2714dd[_0xb5b4('0x5a')]);return db[_0xb5b4('0x71')][_0xb5b4('0x33')]({'where':_0x11536c[_0xb5b4('0x4e')]})['then'](function(_0x3d8e02){_0x343fe5[_0xb5b4('0x33')]=_0x3d8e02;if(_0x2714dd[_0xb5b4('0x46')][_0xb5b4('0x53')]){_0x11536c[_0xb5b4('0x54')]=[{'all':!![]}];}return db[_0xb5b4('0x71')][_0xb5b4('0x55')](_0x11536c);})[_0xb5b4('0x22')](function(_0x2043f3){_0x343fe5[_0xb5b4('0x56')]=_0x2043f3;return _0x343fe5;});}})[_0xb5b4('0x22')](respondWithFilteredResult(_0x2bbc92,_0x11536c))[_0xb5b4('0x57')](handleError(_0x2bbc92,null));};exports[_0xb5b4('0x73')]=function(_0x4ccb2f,_0x13249f,_0x2f0fd8){return db[_0xb5b4('0x42')]['find']({'where':{'id':_0x4ccb2f[_0xb5b4('0x64')]['id']}})['then'](handleEntityNotFound(_0x13249f,null))['then'](function(_0x5db734){if(_0x5db734){return _0x5db734['removeAnswers'](_0x4ccb2f[_0xb5b4('0x46')]['ids']);}})[_0xb5b4('0x22')](respondWithStatusCode(_0x13249f,null))['catch'](handleError(_0x13249f,null));};exports['notify']=function(_0x543e1a,_0x45d962,_0xb8ebbd){var _0x4a657f={'channel':_0xb5b4('0x74')};var _0x2f92ac=[];var _0x1c1a42=[];var _0x4dfd0d={};return db[_0xb5b4('0x42')][_0xb5b4('0x67')]({'where':{'id':_0x543e1a['params']['id']},'include':[{'model':db[_0xb5b4('0x75')],'as':_0xb5b4('0x76')}]})[_0xb5b4('0x22')](handleEntityNotFound(_0x45d962,null))[_0xb5b4('0x22')](function(_0x3bc4cd){_0x4a657f[_0xb5b4('0x77')]=_0x3bc4cd;_0x4a657f[_0xb5b4('0x78')]=_[_0xb5b4('0x79')](_0x3bc4cd[_0xb5b4('0x76')],['priority'],['asc']);if(_0x4a657f['account']['Applications']){delete _0x4a657f[_0xb5b4('0x77')][_0xb5b4('0x76')];}return db[_0xb5b4('0x7a')][_0xb5b4('0x65')]();})['then'](function(_0x1b310a){if(!_0x1b310a){throw new db[(_0xb5b4('0x7b'))][(_0xb5b4('0x7c'))](_0xb5b4('0x7d'));}_0x2f92ac=_[_0xb5b4('0x7e')](_[_0xb5b4('0x59')](_0x1b310a),[_0xb5b4('0x7f'),_0xb5b4('0x80')]);_0x1c1a42=_[_0xb5b4('0x7e')](_[_0xb5b4('0x59')](_0x1b310a),[_0xb5b4('0x7f'),_0xb5b4('0x80'),'CompanyId','ListId']);_0x4a657f['body']={'mapKey':_0xb5b4('0x81')};if(_0x4a657f['account'][_0xb5b4('0x52')]){switch(_0x4a657f[_0xb5b4('0x77')]['type']){case'twilio':_0x4a657f[_0xb5b4('0x5c')][_0xb5b4('0x82')]=_0x543e1a['body'][_0xb5b4('0x83')];_0x4a657f['body'][_0xb5b4('0x5c')]=_0x543e1a[_0xb5b4('0x5c')][_0xb5b4('0x84')];_0x4a657f[_0xb5b4('0x5c')]['messageId']=_0x543e1a[_0xb5b4('0x5c')][_0xb5b4('0x85')];break;case _0xb5b4('0x86'):_0x4a657f[_0xb5b4('0x5c')][_0xb5b4('0x82')]='+'+_0x543e1a[_0xb5b4('0x5c')][_0xb5b4('0x87')];_0x4a657f[_0xb5b4('0x5c')][_0xb5b4('0x5c')]=_0x543e1a['body'][_0xb5b4('0x88')];break;case _0xb5b4('0x89'):_0x4a657f['body']['from']=_0x543e1a['body'][_0xb5b4('0x82')];_0x4a657f[_0xb5b4('0x5c')]['body']=_0x543e1a[_0xb5b4('0x5c')]['message'];break;case _0xb5b4('0x8a'):_0x4a657f[_0xb5b4('0x5c')][_0xb5b4('0x82')]=_0x543e1a[_0xb5b4('0x5c')][_0xb5b4('0x82')];_0x4a657f[_0xb5b4('0x5c')]['body']=_0x543e1a[_0xb5b4('0x5c')][_0xb5b4('0x5c')];_0x4a657f[_0xb5b4('0x5c')][_0xb5b4('0x8b')]=_0x543e1a[_0xb5b4('0x5c')]['message_id'];break;case _0xb5b4('0x8c'):_0x4a657f[_0xb5b4('0x5c')][_0xb5b4('0x82')]=_0x543e1a[_0xb5b4('0x5c')][_0xb5b4('0x83')];_0x4a657f[_0xb5b4('0x5c')][_0xb5b4('0x5c')]=_0x543e1a[_0xb5b4('0x5c')]['Text'];_0x4a657f[_0xb5b4('0x5c')][_0xb5b4('0x8b')]=_0x543e1a[_0xb5b4('0x5c')][_0xb5b4('0x8d')];break;case _0xb5b4('0x8e'):_0x4a657f[_0xb5b4('0x5c')][_0xb5b4('0x82')]='+'+_0x543e1a[_0xb5b4('0x5c')][_0xb5b4('0x8f')][0x0][_0xb5b4('0x82')];_0x4a657f[_0xb5b4('0x5c')][_0xb5b4('0x5c')]=_0x543e1a[_0xb5b4('0x5c')][_0xb5b4('0x8f')][0x0][_0xb5b4('0x88')];_0x4a657f[_0xb5b4('0x5c')][_0xb5b4('0x8b')]=_0x543e1a[_0xb5b4('0x5c')][_0xb5b4('0x8f')][0x0][_0xb5b4('0x8b')];break;case _0xb5b4('0x90'):_0x4a657f[_0xb5b4('0x5c')][_0xb5b4('0x82')]=_0x543e1a[_0xb5b4('0x5c')]['originatingAddress'];_0x4a657f[_0xb5b4('0x5c')]['body']=_0x543e1a[_0xb5b4('0x5c')][_0xb5b4('0x91')][_0xb5b4('0x2a')];break;case'clickatell':_0x4a657f[_0xb5b4('0x5c')][_0xb5b4('0x82')]=_0x543e1a[_0xb5b4('0x5c')][_0xb5b4('0x92')];_0x4a657f[_0xb5b4('0x5c')][_0xb5b4('0x5c')]=_0x543e1a[_0xb5b4('0x5c')][_0xb5b4('0x88')];_0x4a657f[_0xb5b4('0x5c')][_0xb5b4('0x8b')]=_0x543e1a[_0xb5b4('0x5c')][_0xb5b4('0x93')];break;case _0xb5b4('0x94'):_0x4a657f[_0xb5b4('0x5c')][_0xb5b4('0x8b')]=_0x543e1a[_0xb5b4('0x5c')][0x0][_0xb5b4('0x2a')]['id'];_0x4a657f['body'][_0xb5b4('0x82')]=_0x543e1a[_0xb5b4('0x5c')][0x0][_0xb5b4('0x2a')][_0xb5b4('0x82')];_0x4a657f[_0xb5b4('0x5c')][_0xb5b4('0x5c')]=_0x543e1a[_0xb5b4('0x5c')][0x0][_0xb5b4('0x2a')][_0xb5b4('0x88')];break;case _0xb5b4('0x95'):_0x4a657f[_0xb5b4('0x5c')][_0xb5b4('0x82')]=_0x543e1a['body']['from'];_0x4a657f[_0xb5b4('0x5c')][_0xb5b4('0x5c')]=_0x543e1a['body']['message'];_0x4a657f['body'][_0xb5b4('0x8b')]=_0x543e1a[_0xb5b4('0x5c')][_0xb5b4('0x96')];break;}}if(_0x4a657f[_0xb5b4('0x5c')]['id']){delete _0x4a657f[_0xb5b4('0x5c')]['id'];}if(_[_0xb5b4('0x97')](_0x4a657f['body']['from'])){throw new db[(_0xb5b4('0x7b'))][(_0xb5b4('0x7c'))]('from\x20is\x20mandatory');}if(_[_0xb5b4('0x97')](_0x4a657f[_0xb5b4('0x5c')]['body'])||_0x4a657f[_0xb5b4('0x5c')][_0xb5b4('0x5c')]===''){throw new db[(_0xb5b4('0x7b'))][(_0xb5b4('0x7c'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xb5b4('0x97')](_0x4a657f['body']['mapKey'])){throw new db[(_0xb5b4('0x7b'))]['ValidationError'](_0xb5b4('0x98')+_0x1c1a42);}if(!_['includes'](_0x1c1a42,_0x4a657f[_0xb5b4('0x5c')][_0xb5b4('0x99')])){throw new db['Sequelize']['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1c1a42);}_0x4dfd0d[_0x4a657f['body'][_0xb5b4('0x99')]]=_0x4a657f['body']['from'];return db[_0xb5b4('0x9a')][_0xb5b4('0x67')]({'where':{'id':_0x4a657f['account'][_0xb5b4('0x9b')]},'include':[{'model':db[_0xb5b4('0x7a')],'as':'Contacts','where':_0x4dfd0d,'limit':0x1,'order':[[_0xb5b4('0x80'),_0xb5b4('0x9c')]]}]});})[_0xb5b4('0x22')](handleEntityNotFound(_0x45d962,null))[_0xb5b4('0x22')](function(_0x223c8d){if(_0x223c8d){_0x4a657f[_0xb5b4('0x9d')]=_[_0xb5b4('0x9e')](_0x223c8d,[_0xb5b4('0x9f')]);if(_0x223c8d[_0xb5b4('0x9f')][_0xb5b4('0x4b')]){return _0x223c8d['Contacts'][0x0];}var _0x2a9126=_['defaults'](_0x4a657f[_0xb5b4('0x5c')],{'firstName':_0x4a657f[_0xb5b4('0x5c')]['from'],'ListId':_0x223c8d['id']});_0x2a9126[_0x4a657f['body'][_0xb5b4('0x99')]]=_0x4a657f[_0xb5b4('0x5c')][_0xb5b4('0x82')];return db[_0xb5b4('0x7a')]['create'](_0x2a9126,{'fields':_0x2f92ac,'raw':!![]});}})[_0xb5b4('0x22')](handleEntityNotFound(_0x45d962,null))[_0xb5b4('0x22')](function(_0xfc8e92){if(_0xfc8e92){_0x4a657f[_0xb5b4('0xa0')]=_0xfc8e92;var _0x2cf4ac={'ContactId':_0xfc8e92['id'],'phone':_0x4a657f[_0xb5b4('0x5c')][_0xb5b4('0x82')],'SmsAccountId':_0x543e1a['params']['id']};var _0x5cc77f={'ContactId':_0xfc8e92['id'],'SmsAccountId':_0x543e1a[_0xb5b4('0x64')]['id'],'closed':![]};return db[_0xb5b4('0xa1')][_0xb5b4('0x67')]({'where':_0x5cc77f})['then'](function(_0x50cd3a){if(_0x50cd3a){return[_0x50cd3a,![]];}return db[_0xb5b4('0xa1')][_0xb5b4('0x5b')](_0x2cf4ac)[_0xb5b4('0x22')](function(_0x117cad){return[_0x117cad,!![]];});});}})[_0xb5b4('0xa2')](function(_0x3bd4a5,_0x41062a){_0x4a657f[_0xb5b4('0xa3')]=_0x3bd4a5[_0xb5b4('0x39')]({'plain':!![]});_0x4a657f[_0xb5b4('0xa3')]['created']=![];if(_0x41062a){if(_0x4a657f[_0xb5b4('0x77')][_0xb5b4('0xa4')]){_0x4a657f[_0xb5b4('0x78')][_0xb5b4('0xa5')]({'id':0x0,'priority':_0x4a657f[_0xb5b4('0x78')]['length']+0x1,'app':_0xb5b4('0xa6'),'appdata':_0xb5b4('0xa7'),'interval':'*,*,*,*'});}_0x4a657f['interaction'][_0xb5b4('0xa8')]=!![];}return db[_0xb5b4('0xa9')][_0xb5b4('0x5b')]({'phone':_0x4a657f[_0xb5b4('0x5c')]['from'],'messageId':_0x4a657f[_0xb5b4('0x5c')]['messageId'],'body':_0x4a657f['body'][_0xb5b4('0x5c')],'SmsAccountId':_0x543e1a[_0xb5b4('0x64')]['id'],'SmsInteractionId':_0x3bd4a5['id'],'direction':'in','ContactId':_0x3bd4a5[_0xb5b4('0xaa')],'AttachmentId':_0x4a657f[_0xb5b4('0x5c')][_0xb5b4('0xab')]});})['then'](function(_0x6f303b){_0x4a657f[_0xb5b4('0x2a')]=_0x6f303b;if(_0x4a657f['interaction']['UserId']){return db[_0xb5b4('0xac')][_0xb5b4('0x67')]({'attributes':['id','name'],'where':{'id':_0x4a657f[_0xb5b4('0xa3')]['UserId']}})['then'](function(_0x4ae364){if(_0x4ae364){_0x4a657f[_0xb5b4('0x78')][_0xb5b4('0xad')]({'id':0x0,'priority':0x0,'app':_0xb5b4('0xae'),'appdata':_0x4ae364[_0xb5b4('0x3c')]+','+(_0x4a657f[_0xb5b4('0x77')][_0xb5b4('0xaf')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xb5b4('0xb0'),'startRouting',_0x4a657f);});}return respondWithRpcPromise(_0xb5b4('0xb0'),_0xb5b4('0xb1'),_0x4a657f);})[_0xb5b4('0x22')](function(_0x3baa78){if(_0x3baa78){var _0x14f7d2=0xc8;var _0x5922f2=_0xb5b4('0xb2');logger[_0xb5b4('0x23')](_0xb5b4('0x26'),_0x5922f2,_0x14f7d2,'entity\x20found');logger[_0xb5b4('0x25')](_0xb5b4('0xb3'),_0x5922f2,_0x14f7d2,_0xb5b4('0xb4'),JSON['stringify'](_0x3baa78));if(_0x4a657f[_0xb5b4('0x77')][_0xb5b4('0x52')]===_0xb5b4('0xb5')){return _0x45d962['status'](_0x14f7d2)[_0xb5b4('0x34')](_0xb5b4('0xb6'),'text/xml')[_0xb5b4('0x3d')](_0xb5b4('0xb7'));}else{return _0x45d962[_0xb5b4('0x2d')](_0x14f7d2)[_0xb5b4('0x2f')](_0x3baa78);}}})[_0xb5b4('0x57')](handleError(_0x45d962,null));};exports['addApplications']=function(_0x51e962,_0x48082b){var _0x52e4d6=_0x51e962[_0xb5b4('0x64')]['id'];var _0x9143ec=_0x51e962['body'];var _0x37f1c9=0xc8;var _0x435a4a=null;return db[_0xb5b4('0xb8')][_0xb5b4('0xb9')]({'isolationLevel':db[_0xb5b4('0xb8')]['Transaction'][_0xb5b4('0xba')][_0xb5b4('0xbb')]},function(_0x1b4ed4){return db['SmsAccount'][_0xb5b4('0x6a')]({'where':{'id':_0x52e4d6},'transaction':_0x1b4ed4})[_0xb5b4('0x22')](function(_0x4d164d){if(_0x4d164d){return db[_0xb5b4('0x75')][_0xb5b4('0x38')]({'where':{'SmsAccountId':_0x52e4d6},'transaction':_0x1b4ed4})[_0xb5b4('0x22')](function(){var _0x414a94=_[_0xb5b4('0x41')](_0x9143ec,function(_0x17f217){_0x17f217['SmsAccountId']=_0x52e4d6;return _0x17f217;});return db['SmsApplication']['bulkCreate'](_0x414a94,{'transaction':_0x1b4ed4});});}else{_0x37f1c9=0x194;_0x435a4a=[];}});})['then'](function(){if(_0x37f1c9!==0x194){return db[_0xb5b4('0x75')]['findAndCountAll']({'where':{'SmsAccountId':_0x52e4d6},'order':_0xb5b4('0xbc')})['then'](function(_0x145c40){_0x435a4a=_0x145c40;});}})[_0xb5b4('0x57')](function(_0x32574d){_0x37f1c9=0x1f4;logger[_0xb5b4('0x28')](_0x32574d[_0xb5b4('0x3b')]);if(_0x32574d['name']){delete _0x32574d[_0xb5b4('0x3c')];}_0x435a4a=_0x32574d;})[_0xb5b4('0xbd')](function(){if(_0x435a4a===null){_0x48082b[_0xb5b4('0x2c')](_0x37f1c9);}else{if(_0x37f1c9===0x1f4){_0x48082b[_0xb5b4('0x2d')](_0x37f1c9)['send'](_0x435a4a);}else{_0x48082b['status'](_0x37f1c9)[_0xb5b4('0x2f')](_0x435a4a);}}});};exports['getApplications']=function(_0x41ded0,_0x5d1d4d,_0x58e209){var _0x33ee70={};var _0x3b31da={};var _0xd032d6;var _0x382238;return db[_0xb5b4('0x42')]['findOne']({'where':{'id':_0x41ded0[_0xb5b4('0x64')]['id']}})['then'](handleEntityNotFound(_0x5d1d4d,null))[_0xb5b4('0x22')](function(_0x463b7c){if(_0x463b7c){_0xd032d6=_0x463b7c;_0x3b31da['model']=_[_0xb5b4('0x59')](db[_0xb5b4('0x75')][_0xb5b4('0xbe')]);_0x3b31da[_0xb5b4('0x46')]=_[_0xb5b4('0x59')](_0x41ded0[_0xb5b4('0x46')]);_0x3b31da[_0xb5b4('0x47')]=_[_0xb5b4('0x48')](_0x3b31da[_0xb5b4('0x45')],_0x3b31da['query']);_0x33ee70[_0xb5b4('0x49')]=_['intersection'](_0x3b31da[_0xb5b4('0x45')],qs[_0xb5b4('0x4a')](_0x41ded0[_0xb5b4('0x46')][_0xb5b4('0x4a')]));_0x33ee70[_0xb5b4('0x49')]=_0x33ee70['attributes'][_0xb5b4('0x4b')]?_0x33ee70[_0xb5b4('0x49')]:_0x3b31da['model'];_0x33ee70[_0xb5b4('0x6c')]=qs[_0xb5b4('0x4d')](_0x41ded0[_0xb5b4('0x46')][_0xb5b4('0x4d')]);_0x33ee70[_0xb5b4('0x4e')]=qs[_0xb5b4('0x47')](_[_0xb5b4('0x4f')](_0x41ded0[_0xb5b4('0x46')],_0x3b31da[_0xb5b4('0x47')]));if(_0x41ded0[_0xb5b4('0x46')][_0xb5b4('0x50')]){_0x33ee70['where']=_[_0xb5b4('0x51')](_0x33ee70[_0xb5b4('0x4e')],{'$or':_[_0xb5b4('0x41')](_0x33ee70[_0xb5b4('0x49')],function(_0x2597b6){var _0x27f38c={};_0x27f38c[_0x2597b6]={'$like':'%'+_0x41ded0[_0xb5b4('0x46')][_0xb5b4('0x50')]+'%'};return _0x27f38c;})});}_0x33ee70=_[_0xb5b4('0x51')]({},_0x33ee70,_0x41ded0[_0xb5b4('0x5a')]);return _0xd032d6[_0xb5b4('0xbf')](_0x33ee70);}})[_0xb5b4('0x22')](function(_0x168c6e){if(_0x168c6e){_0x382238=_0x168c6e[_0xb5b4('0x4b')];if(!_0x41ded0[_0xb5b4('0x46')][_0xb5b4('0x4c')](_0xb5b4('0x6b'))){_0x33ee70[_0xb5b4('0x32')]=qs[_0xb5b4('0x32')](_0x41ded0[_0xb5b4('0x46')][_0xb5b4('0x32')]);_0x33ee70[_0xb5b4('0x30')]=qs[_0xb5b4('0x30')](_0x41ded0[_0xb5b4('0x46')][_0xb5b4('0x30')]);}return _0xd032d6[_0xb5b4('0xbf')](_0x33ee70);}})[_0xb5b4('0x22')](function(_0x5a6736){if(_0x5a6736){return _0x5a6736?{'count':_0x382238,'rows':_0x5a6736}:null;}})['then'](respondWithResult(_0x5d1d4d,null))['catch'](handleError(_0x5d1d4d,null));};exports['getInteractions']=function(_0x3978f3,_0x4f48c7,_0x49d09d){var _0x15527c={'raw':![],'where':{}};var _0xe0a405={};var _0x364d30={'count':0x0,'rows':[]};return db[_0xb5b4('0x42')][_0xb5b4('0x6a')]({'where':{'id':_0x3978f3[_0xb5b4('0x64')]['id']}})[_0xb5b4('0x22')](handleEntityNotFound(_0x4f48c7,null))['then'](function(_0x41c24a){if(_0x41c24a){_0xe0a405['model']=_[_0xb5b4('0x59')](db[_0xb5b4('0xa1')][_0xb5b4('0xbe')]);_0xe0a405['query']=_[_0xb5b4('0x59')](_0x3978f3[_0xb5b4('0x46')]);_0xe0a405['filters']=_['intersection'](_0xe0a405[_0xb5b4('0x45')],_0xe0a405[_0xb5b4('0x46')]);_0x15527c['attributes']=_[_0xb5b4('0x48')](_0xe0a405[_0xb5b4('0x45')],qs[_0xb5b4('0x4a')](_0x3978f3['query'][_0xb5b4('0x4a')]));_0x15527c['attributes']=_0x15527c['attributes'][_0xb5b4('0x4b')]?_0x15527c['attributes']:_0xe0a405[_0xb5b4('0x45')];if(!_0x3978f3[_0xb5b4('0x46')][_0xb5b4('0x4c')]('nolimit')){_0x15527c[_0xb5b4('0x32')]=qs[_0xb5b4('0x32')](_0x3978f3[_0xb5b4('0x46')][_0xb5b4('0x32')]);_0x15527c[_0xb5b4('0x30')]=qs['offset'](_0x3978f3[_0xb5b4('0x46')][_0xb5b4('0x30')]);}_0x15527c[_0xb5b4('0x6c')]=qs['sort'](_0x3978f3['query'][_0xb5b4('0x4d')]);_0x15527c[_0xb5b4('0x4e')]=qs[_0xb5b4('0x47')](_['pick'](_0x3978f3['query'],_0xe0a405[_0xb5b4('0x47')]));_0x15527c[_0xb5b4('0x4e')][_0xb5b4('0x6d')]=_0x41c24a['id'];if(_0x3978f3[_0xb5b4('0x46')][_0xb5b4('0x50')]){_0x15527c[_0xb5b4('0x4e')]=_[_0xb5b4('0x51')](_0x15527c[_0xb5b4('0x4e')],{'$or':_[_0xb5b4('0x41')](_0x15527c[_0xb5b4('0x49')],function(_0x1fc757){var _0x2b514b={};_0x2b514b[_0x1fc757]={'$like':'%'+_0x3978f3['query'][_0xb5b4('0x50')]+'%'};return _0x2b514b;})});}_0x15527c=_[_0xb5b4('0x51')]({},_0x15527c,_0x3978f3['options']);return db[_0xb5b4('0xa1')][_0xb5b4('0x33')]({'where':_0x15527c[_0xb5b4('0x4e')]})[_0xb5b4('0x22')](function(_0x3c6990){_0x364d30['count']=_0x3c6990;if(_0x3978f3[_0xb5b4('0x46')][_0xb5b4('0x53')]){_0x15527c[_0xb5b4('0x54')]=[{'model':db[_0xb5b4('0x7a')],'as':_0xb5b4('0xc0'),'required':![]},{'model':db[_0xb5b4('0xac')],'as':'Owner','attributes':['name','fullname',_0xb5b4('0xc1')],'required':![]},{'model':db['Tag'],'as':_0xb5b4('0xc2'),'attributes':['id',_0xb5b4('0x3c'),'color'],'where':_0x3978f3[_0xb5b4('0x46')][_0xb5b4('0xc3')]?{'id':_0x3978f3[_0xb5b4('0x46')][_0xb5b4('0xc3')]}:undefined,'required':_0x3978f3[_0xb5b4('0x46')][_0xb5b4('0xc3')]?!![]:![]}];}return db['SmsInteraction']['findAll'](_0x15527c);})['then'](function(_0x228a6f){_0x364d30['rows']=_0x228a6f;return _0x364d30;});}})['then'](respondWithFilteredResult(_0x4f48c7,_0x15527c))[_0xb5b4('0x57')](handleError(_0x4f48c7,null));};exports[_0xb5b4('0x3d')]=function(_0xb0f78b,_0x3e5ef7,_0x516ed9){var _0x1a7407,_0x3548de,_0x1348ff;if(_[_0xb5b4('0x97')](_0xb0f78b[_0xb5b4('0x5c')][_0xb5b4('0x5c')])||_0xb0f78b[_0xb5b4('0x5c')][_0xb5b4('0x5c')]===''){throw new db[(_0xb5b4('0x7b'))][(_0xb5b4('0x7c'))](_0xb5b4('0xc4'));}if(_['isNil'](_0xb0f78b[_0xb5b4('0x5c')]['to'])){throw new db[(_0xb5b4('0x7b'))][(_0xb5b4('0x7c'))]('to\x20is\x20mandatory');}_0x1a7407=_0xb0f78b['body']['to'];return db[_0xb5b4('0x42')][_0xb5b4('0x67')]({'where':{'id':_0xb0f78b[_0xb5b4('0x64')]['id']},'include':[{'model':db[_0xb5b4('0x9a')],'as':_0xb5b4('0xc5'),'include':[{'model':db[_0xb5b4('0x7a')],'as':_0xb5b4('0x9f'),'where':{'mobile':_0x1a7407},'limit':0x1,'order':[['updatedAt',_0xb5b4('0x9c')]]}]}]})['then'](handleEntityNotFound(_0x3e5ef7,null))[_0xb5b4('0x22')](function(_0x363ebe){if(_0x363ebe&&_0x363ebe[_0xb5b4('0xc5')]){_0x3548de=_0x363ebe['get']({'plain':!![]});if(_0x3548de[_0xb5b4('0xc5')]&&_0x3548de['List']['Contacts']['length']){return _0x3548de[_0xb5b4('0xc5')][_0xb5b4('0x9f')][0x0];}return db[_0xb5b4('0x7a')][_0xb5b4('0x5b')](_[_0xb5b4('0x19')](_0xb0f78b[_0xb5b4('0x5c')],{'firstName':_0x1a7407,'mobile':_0x1a7407,'phone':_0x1a7407,'ListId':_0x3548de[_0xb5b4('0x9b')]}));}})['then'](handleEntityNotFound(_0x3e5ef7,null))['then'](function(_0x23f90f){if(_0x23f90f){_0x1348ff=_0x23f90f;return db[_0xb5b4('0xa1')][_0xb5b4('0x67')]({'where':{'ContactId':_0x1348ff['id'],'closed':![],'SmsAccountId':_0x3548de['id']}})[_0xb5b4('0x22')](function(_0x4c24bf){if(_0x4c24bf){return[_0x4c24bf,![]];}return db[_0xb5b4('0xa1')][_0xb5b4('0x5b')]({'UserId':_0xb0f78b[_0xb5b4('0x5d')]['id'],'ContactId':_0x1348ff['id'],'SmsAccountId':_0x3548de['id'],'phone':_0x1a7407,'firstMsgDirection':_0xb5b4('0xc6'),'Messages':[_[_0xb5b4('0x51')](_0xb0f78b[_0xb5b4('0x5c')],{'read':![],'body':_0xb0f78b['body'][_0xb5b4('0x5c')],'phone':_0x1a7407,'SmsAccountId':_0x3548de['id'],'UserId':_0xb0f78b[_0xb5b4('0x5d')]['id'],'ContactId':_0x1348ff['id']})]},{'include':[{'model':db[_0xb5b4('0xa9')],'as':_0xb5b4('0xc7')}]})[_0xb5b4('0x22')](function(_0x21ec7c){return[_0x21ec7c,!![]];});});}})[_0xb5b4('0xa2')](function(_0x657c23,_0x2bc429){if(_0x2bc429){return _0x657c23;}return db[_0xb5b4('0xa9')]['create'](_['merge'](_0xb0f78b[_0xb5b4('0x5c')],{'read':![],'body':_0xb0f78b['body'][_0xb5b4('0x5c')],'phone':_0x1a7407,'SmsAccountId':_0x3548de['id'],'SmsInteractionId':_0x657c23['id'],'UserId':_0xb0f78b[_0xb5b4('0x5d')]['id'],'ContactId':_0x1348ff['id']}))[_0xb5b4('0x22')](function(_0x2537a5){_0x657c23[_0xb5b4('0xc8')][_0xb5b4('0xc7')]=[];_0x657c23['dataValues'][_0xb5b4('0xc7')]['push'](_0x2537a5[_0xb5b4('0xc8')]);return _0x657c23;});})[_0xb5b4('0x22')](respondWithResult(_0x3e5ef7,null))[_0xb5b4('0x57')](handleError(_0x3e5ef7,null));};exports[_0xb5b4('0x2d')]=function(_0x429044,_0x55043b,_0x5d59f6){if(_0x429044[_0xb5b4('0x5c')]['id']){delete _0x429044[_0xb5b4('0x5c')]['id'];}var _0x5a9bf1,_0xb226ed,_0xd9234f;return db[_0xb5b4('0x42')][_0xb5b4('0x67')]({'where':{'id':_0x429044[_0xb5b4('0x64')]['id']}})[_0xb5b4('0x22')](handleEntityNotFound(_0x55043b,null))['then'](function(_0x440182){if(_0x440182){_0xd9234f=_0x440182;logger[_0xb5b4('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xb5b4('0x2d'),_0xb5b4('0xc9'),_0x440182[_0xb5b4('0x52')],util['inspect'](_0x429044[_0xb5b4('0x5c')],{'showHidden':![],'depth':null}));switch(_0x440182[_0xb5b4('0x52')]){case _0xb5b4('0x86'):if(_0x429044[_0xb5b4('0x5c')][_0xb5b4('0xca')]&&_0x429044[_0xb5b4('0x5c')][_0xb5b4('0x2d')]){_0xb226ed=_0x429044[_0xb5b4('0x5c')][_0xb5b4('0x2d')];return db[_0xb5b4('0xa9')][_0xb5b4('0x67')]({'where':{'messageId':_0x429044[_0xb5b4('0x5c')][_0xb5b4('0xca')]}});}break;case'connectel':if(_0x429044[_0xb5b4('0x5c')][_0xb5b4('0xcb')]&&_0x429044[_0xb5b4('0x5c')][_0xb5b4('0xcc')]){_0xb226ed=_0x429044[_0xb5b4('0x5c')][_0xb5b4('0xcc')];return db['SmsMessage'][_0xb5b4('0x67')]({'where':{'messageId':_0x429044[_0xb5b4('0x5c')][_0xb5b4('0xcb')]}});}break;case'clicksend':if(_0x429044[_0xb5b4('0x5c')][_0xb5b4('0xcd')]&&_0x429044[_0xb5b4('0x5c')]['status_code']){_0xb226ed=_0x429044[_0xb5b4('0x5c')]['status_code'];return db[_0xb5b4('0xa9')][_0xb5b4('0x67')]({'where':{'messageId':_0x429044[_0xb5b4('0x5c')][_0xb5b4('0xcd')]}});}break;case _0xb5b4('0x8e'):var _0xf29984=_0x429044[_0xb5b4('0x5c')][_0xb5b4('0x8f')][0x0];if(_0xf29984[_0xb5b4('0x8b')]&&_0xf29984[_0xb5b4('0x2d')][_0xb5b4('0xce')]===_0xb5b4('0xcf')){_0xb226ed=_0xf29984[_0xb5b4('0x2d')][_0xb5b4('0xce')];return db[_0xb5b4('0xa9')][_0xb5b4('0x67')]({'where':{'messageId':_0xf29984[_0xb5b4('0x8b')]}});}break;case'clickatell':if(_0x429044[_0xb5b4('0x5c')]['messageId']&&_0x429044['body'][_0xb5b4('0x2d')]){_0xb226ed=_0x429044[_0xb5b4('0x5c')][_0xb5b4('0x2d')];return db[_0xb5b4('0xa9')][_0xb5b4('0x67')]({'where':{'messageId':_0x429044['body']['messageId']}});}break;case _0xb5b4('0x94'):if(_0x429044[_0xb5b4('0x5c')][0x0][_0xb5b4('0x2a')]['id']){_0xb226ed=_0x429044[_0xb5b4('0x5c')][0x0][_0xb5b4('0x52')];return db['SmsMessage']['find']({'where':{'messageId':_0x429044[_0xb5b4('0x5c')][0x0][_0xb5b4('0x2a')]['id']}});}break;case _0xb5b4('0x95'):if(_0x429044[_0xb5b4('0x5c')]['redif']&&_0x429044[_0xb5b4('0x5c')]['status']){_0xb226ed=_0x429044[_0xb5b4('0x5c')][_0xb5b4('0x2d')];return db[_0xb5b4('0xa9')]['find']({'where':{'messageId':_0x429044[_0xb5b4('0x5c')][_0xb5b4('0xd0')]}});}break;}}})[_0xb5b4('0x22')](handleEntityNotFound(_0x55043b,null))[_0xb5b4('0x22')](function(_0x256c02){if(_0x256c02){_0x5a9bf1=_0x256c02;switch(_0xd9234f[_0xb5b4('0x52')]){case _0xb5b4('0x86'):if(_0xb226ed==='DELIVERED'){return _0x5a9bf1[_0xb5b4('0x63')]({'read':!![]});}else{logger['error'](_0xb5b4('0x26'),_0xb5b4('0x2d'),_0xb5b4('0x86'),util[_0xb5b4('0xd1')](_0x429044['body'],{'showHidden':![],'depth':null}));}break;case _0xb5b4('0x89'):if(_0xb226ed==='1'){return _0x5a9bf1[_0xb5b4('0x63')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xb5b4('0x2d'),_0xb5b4('0x86'),util['inspect'](_0x429044[_0xb5b4('0x5c')],{'showHidden':![],'depth':null}));}break;case _0xb5b4('0x8a'):if(!_0x429044[_0xb5b4('0x5c')]['error_code']&&_0xb226ed>=0xc8&&_0xb226ed<=0xce){return _0x5a9bf1[_0xb5b4('0x63')]({'read':!![]});}else{logger['error'](_0xb5b4('0x26'),_0xb5b4('0x2d'),_0xb5b4('0x8a'),util[_0xb5b4('0xd1')](_0x429044['body'],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x4876eb=_0x429044[_0xb5b4('0x5c')][_0xb5b4('0x8f')][0x0];if(_0x4876eb[_0xb5b4('0x2d')]['groupName']===_0xb5b4('0xcf')){return _0x5a9bf1[_0xb5b4('0x63')]({'read':!![]});}else{logger[_0xb5b4('0x28')](_0xb5b4('0x26'),_0xb5b4('0x2d'),_0xb5b4('0x8e'),util[_0xb5b4('0xd1')](_0x429044[_0xb5b4('0x5c')],{'showHidden':![],'depth':null}));}break;case _0xb5b4('0xd2'):if(_0xb226ed=='DELIVERED_TO_GATEWAY'||_0xb226ed==_0xb5b4('0xd3')){return _0x5a9bf1[_0xb5b4('0x63')]({'read':!![]});}else{logger['error'](_0xb5b4('0x26'),_0xb5b4('0x2d'),_0xb5b4('0xd2'),util[_0xb5b4('0xd1')](_0x429044[_0xb5b4('0x5c')],{'showHidden':![],'depth':null}));}break;case _0xb5b4('0x94'):if(_0xb226ed==_0xb5b4('0xd4')){return _0x5a9bf1['update']({'read':!![]});}else{logger[_0xb5b4('0x28')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xb5b4('0x2d'),_0xb5b4('0x94'),util[_0xb5b4('0xd1')](_0x429044['body'],{'showHidden':![],'depth':null}));}break;case _0xb5b4('0x95'):if(_0xb226ed==='DELIVRD'||_0xb226ed===_0xb5b4('0xd5')){return _0x5a9bf1['update']({'read':!![]});}else{logger['error'](_0xb5b4('0x26'),'status',_0xb5b4('0x95'),util[_0xb5b4('0xd1')](_0x429044[_0xb5b4('0x5c')],{'showHidden':![],'depth':null}));}break;}return _0x5a9bf1;}})['then'](respondWithResult(_0x55043b,null))['catch'](handleError(_0x55043b,null));};exports['statusGet']=function(_0x404d31,_0x3f77ef,_0x36798e){var _0x31acc5,_0x38ca36,_0x25e84c;return db['SmsAccount'][_0xb5b4('0x67')]({'where':{'id':_0x404d31[_0xb5b4('0x64')]['id']}})[_0xb5b4('0x22')](handleEntityNotFound(_0x3f77ef,null))['then'](function(_0x20699f){if(_0x20699f){_0x25e84c=_0x20699f;logger[_0xb5b4('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xb5b4('0x2d'),_0xb5b4('0xc9'),_0x20699f[_0xb5b4('0x52')],util['inspect'](_0x404d31[_0xb5b4('0x46')],{'showHidden':![],'depth':null}));switch(_0x20699f[_0xb5b4('0x52')]){case _0xb5b4('0x90'):if(_0x404d31[_0xb5b4('0x46')]['message-id']&&_0x404d31[_0xb5b4('0x46')]['state']){_0x38ca36=_0x404d31['query'][_0xb5b4('0xd6')];return db[_0xb5b4('0xa9')][_0xb5b4('0x67')]({'where':{'messageId':_0x404d31[_0xb5b4('0x46')][_0xb5b4('0xd7')]}});}break;}}})[_0xb5b4('0x22')](handleEntityNotFound(_0x3f77ef,null))['then'](function(_0x4f1905){if(_0x4f1905){_0x31acc5=_0x4f1905;switch(_0x25e84c[_0xb5b4('0x52')]){case'csc':if(_0x38ca36==='2'||_0x38ca36==='6'){return _0x31acc5['update']({'read':!![]});}else{logger['error'](_0xb5b4('0x26'),_0xb5b4('0x2d'),_0xb5b4('0x90'),util['inspect'](_0x404d31[_0xb5b4('0x46')],{'showHidden':![],'depth':null}));};break;}return _0x31acc5;}})['then'](respondWithResult(_0x3f77ef,null))[_0xb5b4('0x57')](handleError(_0x3f77ef,null));};exports['addAgents']=function(_0xfc403f,_0x1dec29,_0x9979b9){return db['SmsAccount'][_0xb5b4('0x67')]({'where':{'id':_0xfc403f['params']['id']}})[_0xb5b4('0x22')](handleEntityNotFound(_0x1dec29,null))['then'](function(_0x8d7127){if(_0x8d7127){return _0x8d7127[_0xb5b4('0xd8')](_0xfc403f[_0xb5b4('0x5c')][_0xb5b4('0x6f')],_['omit'](_0xfc403f['body'],[_0xb5b4('0x6f'),'id'])||{})[_0xb5b4('0xa2')](function(_0x49f1b1){for(var _0x4b7576=0x0;_0x4b7576<_0xfc403f['body'][_0xb5b4('0x6f')][_0xb5b4('0x4b')];_0x4b7576+=0x1){socket['emit'](_0xb5b4('0xd9'),{'UserId':Number(_0xfc403f[_0xb5b4('0x5c')][_0xb5b4('0x6f')][_0x4b7576]),'SmsAccountId':Number(_0xfc403f[_0xb5b4('0x64')]['id'])});}return _0x49f1b1;});}})[_0xb5b4('0x22')](respondWithResult(_0x1dec29,null))[_0xb5b4('0x57')](handleError(_0x1dec29,null));};exports[_0xb5b4('0xda')]=function(_0x31bb5a,_0x23d188,_0x5d417a){return db[_0xb5b4('0x42')][_0xb5b4('0x67')]({'where':{'id':_0x31bb5a['params']['id']}})['then'](handleEntityNotFound(_0x23d188,null))[_0xb5b4('0x22')](function(_0x47d82d){if(_0x47d82d){return _0x47d82d[_0xb5b4('0xda')](_0x31bb5a['query'][_0xb5b4('0x6f')])['then'](function(){if(_[_0xb5b4('0xdb')](_0x31bb5a[_0xb5b4('0x46')][_0xb5b4('0x6f')])){for(var _0x5021cf=0x0;_0x5021cf<_0x31bb5a['query']['ids'][_0xb5b4('0x4b')];_0x5021cf+=0x1){socket[_0xb5b4('0xdc')](_0xb5b4('0xdd'),{'UserId':Number(_0x31bb5a['query']['ids'][_0x5021cf]),'SmsAccountId':Number(_0x31bb5a['params']['id'])});}}else{socket[_0xb5b4('0xdc')](_0xb5b4('0xdd'),{'UserId':Number(_0x31bb5a[_0xb5b4('0x46')][_0xb5b4('0x6f')]),'SmsAccountId':Number(_0x31bb5a[_0xb5b4('0x64')]['id'])});}});}})[_0xb5b4('0x22')](respondWithStatusCode(_0x23d188,null))[_0xb5b4('0x57')](handleError(_0x23d188,null));};exports[_0xb5b4('0xde')]=function(_0x24eb80,_0x1e697d,_0x5024b4){var _0x2e000c={};var _0x3bf2f8={};var _0xf50583;var _0x420001;return db[_0xb5b4('0x42')]['findOne']({'where':{'id':_0x24eb80[_0xb5b4('0x64')]['id']}})[_0xb5b4('0x22')](handleEntityNotFound(_0x1e697d,null))[_0xb5b4('0x22')](function(_0x10f746){if(_0x10f746){_0xf50583=_0x10f746;_0x3bf2f8[_0xb5b4('0x45')]=_[_0xb5b4('0x59')](db[_0xb5b4('0xac')]['rawAttributes']);_0x3bf2f8[_0xb5b4('0x46')]=_[_0xb5b4('0x59')](_0x24eb80[_0xb5b4('0x46')]);_0x3bf2f8[_0xb5b4('0x47')]=_[_0xb5b4('0x48')](_0x3bf2f8[_0xb5b4('0x45')],_0x3bf2f8[_0xb5b4('0x46')]);_0x2e000c['attributes']=_[_0xb5b4('0x48')](_0x3bf2f8[_0xb5b4('0x45')],qs['fields'](_0x24eb80[_0xb5b4('0x46')]['fields']));_0x2e000c[_0xb5b4('0x49')]=_0x2e000c['attributes']['length']?_0x2e000c[_0xb5b4('0x49')]:_0x3bf2f8['model'];_0x2e000c['order']=qs['sort'](_0x24eb80[_0xb5b4('0x46')][_0xb5b4('0x4d')]);_0x2e000c['where']=qs['filters'](_[_0xb5b4('0x4f')](_0x24eb80[_0xb5b4('0x46')],_0x3bf2f8[_0xb5b4('0x47')]));if(_0x24eb80[_0xb5b4('0x46')][_0xb5b4('0x50')]){_0x2e000c[_0xb5b4('0x4e')]=_[_0xb5b4('0x51')](_0x2e000c[_0xb5b4('0x4e')],{'$or':_[_0xb5b4('0x41')](_0x2e000c[_0xb5b4('0x49')],function(_0x3dd899){var _0x235842={};_0x235842[_0x3dd899]={'$like':'%'+_0x24eb80['query'][_0xb5b4('0x50')]+'%'};return _0x235842;})});}_0x2e000c=_[_0xb5b4('0x51')]({},_0x2e000c,_0x24eb80[_0xb5b4('0x5a')]);return _0xf50583[_0xb5b4('0xde')](_0x2e000c);}})[_0xb5b4('0x22')](function(_0x2b3d22){if(_0x2b3d22){_0x420001=_0x2b3d22['length'];if(!_0x24eb80[_0xb5b4('0x46')][_0xb5b4('0x4c')](_0xb5b4('0x6b'))){_0x2e000c[_0xb5b4('0x32')]=qs[_0xb5b4('0x32')](_0x24eb80['query'][_0xb5b4('0x32')]);_0x2e000c['offset']=qs[_0xb5b4('0x30')](_0x24eb80[_0xb5b4('0x46')][_0xb5b4('0x30')]);}return _0xf50583['getAgents'](_0x2e000c);}})[_0xb5b4('0x22')](function(_0x2172a9){if(_0x2172a9){return _0x2172a9?{'count':_0x420001,'rows':_0x2172a9}:null;}})[_0xb5b4('0x22')](respondWithResult(_0x1e697d,null))['catch'](handleError(_0x1e697d,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 81fc239..b721c36 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 _0xc473=['remove','emit','hasOwnProperty','events','../../mysqldb','SmsAccount','setMaxListeners','save'];(function(_0x13a5e2,_0x4e2d46){var _0x42c586=function(_0x935b12){while(--_0x935b12){_0x13a5e2['push'](_0x13a5e2['shift']());}};_0x42c586(++_0x4e2d46);}(_0xc473,0x15b));var _0x3c47=function(_0x33ac28,_0x2baf47){_0x33ac28=_0x33ac28-0x0;var _0x5e9480=_0xc473[_0x33ac28];return _0x5e9480;};'use strict';var EventEmitter=require(_0x3c47('0x0'));var SmsAccount=require(_0x3c47('0x1'))['db'][_0x3c47('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x3c47('0x3')](0x0);var events={'afterCreate':_0x3c47('0x4'),'afterUpdate':'update','afterDestroy':_0x3c47('0x5')};function emitEvent(_0xc9681f){return function(_0x33a1fb,_0x12fc7b,_0x5bbaf2){SmsAccountEvents[_0x3c47('0x6')](_0xc9681f+':'+_0x33a1fb['id'],_0x33a1fb);SmsAccountEvents[_0x3c47('0x6')](_0xc9681f,_0x33a1fb);_0x5bbaf2(null);};}for(var e in events){if(events[_0x3c47('0x7')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file +var _0x6a4b=['update','remove','emit','hasOwnProperty','exports','events','SmsAccount','setMaxListeners'];(function(_0x19c6a6,_0x36701d){var _0x29014=function(_0x4a61b3){while(--_0x4a61b3){_0x19c6a6['push'](_0x19c6a6['shift']());}};_0x29014(++_0x36701d);}(_0x6a4b,0x1c5));var _0xb6a4=function(_0x4dc7b9,_0x319d5a){_0x4dc7b9=_0x4dc7b9-0x0;var _0x3ab114=_0x6a4b[_0x4dc7b9];return _0x3ab114;};'use strict';var EventEmitter=require(_0xb6a4('0x0'));var SmsAccount=require('../../mysqldb')['db'][_0xb6a4('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xb6a4('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb6a4('0x3'),'afterDestroy':_0xb6a4('0x4')};function emitEvent(_0x50dece){return function(_0x20a29b,_0x5f11bd,_0x4b0679){SmsAccountEvents[_0xb6a4('0x5')](_0x50dece+':'+_0x20a29b['id'],_0x20a29b);SmsAccountEvents[_0xb6a4('0x5')](_0x50dece,_0x20a29b);_0x4b0679(null);};}for(var e in events){if(events[_0xb6a4('0x6')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0xb6a4('0x7')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index c8d54f0..41a75fc 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 _0x67a4=['path','../../config/environment','define','SmsAccount','util','moment','request-promise'];(function(_0x534543,_0x7c3fe8){var _0x1a3d5b=function(_0x4f4e6c){while(--_0x4f4e6c){_0x534543['push'](_0x534543['shift']());}};_0x1a3d5b(++_0x7c3fe8);}(_0x67a4,0x12a));var _0x467a=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0x67a4[_0x9cd4c3];return _0x4c9025;};'use strict';var _=require('lodash');var util=require(_0x467a('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x467a('0x1'));var BPromise=require('bluebird');var rp=require(_0x467a('0x2'));var fs=require('fs');var path=require(_0x467a('0x3'));var rimraf=require('rimraf');var config=require(_0x467a('0x4'));var attributes=require('./smsAccount.attributes');module['exports']=function(_0x384a91,_0x5f019d){return _0x384a91[_0x467a('0x5')](_0x467a('0x6'),attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x40f5=['api','moment','bluebird','path','rimraf','./smsAccount.attributes','exports','define','SmsAccount','sms_accounts','util'];(function(_0xfba0e3,_0x823514){var _0x434e30=function(_0x4cbe81){while(--_0x4cbe81){_0xfba0e3['push'](_0xfba0e3['shift']());}};_0x434e30(++_0x823514);}(_0x40f5,0x149));var _0x540f=function(_0x43e1e6,_0x399da){_0x43e1e6=_0x43e1e6-0x0;var _0x58753d=_0x40f5[_0x43e1e6];return _0x58753d;};'use strict';var _=require('lodash');var util=require(_0x540f('0x0'));var logger=require('../../config/logger')(_0x540f('0x1'));var moment=require(_0x540f('0x2'));var BPromise=require(_0x540f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x540f('0x4'));var rimraf=require(_0x540f('0x5'));var config=require('../../config/environment');var attributes=require(_0x540f('0x6'));module[_0x540f('0x7')]=function(_0x17f1c9,_0x3aa369){return _0x17f1c9[_0x540f('0x8')](_0x540f('0x9'),attributes,{'tableName':_0x540f('0xa'),'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 7fc26e6..3a0ea7c 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 _0x347a=['SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SmsAccount,\x20%s,\x20%s','message','result','options','raw','where','attributes','include','model','map','ShowSmsAccount','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./smsAccount.socket','register','then','info','debug'];(function(_0x54d245,_0x16c55a){var _0xe0b238=function(_0x477871){while(--_0x477871){_0x54d245['push'](_0x54d245['shift']());}};_0xe0b238(++_0x16c55a);}(_0x347a,0xca));var _0xa347=function(_0x2390cc,_0x52baaa){_0x2390cc=_0x2390cc-0x0;var _0x227be9=_0x347a[_0x2390cc];return _0x227be9;};'use strict';var _=require(_0xa347('0x0'));var util=require(_0xa347('0x1'));var moment=require(_0xa347('0x2'));var BPromise=require(_0xa347('0x3'));var rs=require(_0xa347('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa347('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa347('0x6'))(_0xa347('0x7'));var config=require(_0xa347('0x8'));var jayson=require(_0xa347('0x9'));var client=jayson[_0xa347('0xa')][_0xa347('0xb')]({'port':0x232a});config[_0xa347('0xc')]=_[_0xa347('0xd')](config[_0xa347('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xa347('0xe'))(new Redis(config[_0xa347('0xc')]));require(_0xa347('0xf'))[_0xa347('0x10')](socket);function respondWithRpcPromise(_0x293ed5,_0x350245,_0x265e15){return new BPromise(function(_0x48f233,_0x4e71a1){return client['request'](_0x293ed5,_0x265e15)[_0xa347('0x11')](function(_0x3bb338){logger[_0xa347('0x12')]('SmsAccount,\x20%s,\x20%s',_0x350245,'request\x20sent');logger[_0xa347('0x13')](_0xa347('0x14'),_0x350245,_0xa347('0x15'),JSON[_0xa347('0x16')](_0x3bb338));if(_0x3bb338[_0xa347('0x17')]){if(_0x3bb338[_0xa347('0x17')][_0xa347('0x18')]===0x1f4){logger['error'](_0xa347('0x19'),_0x350245,_0x3bb338[_0xa347('0x17')][_0xa347('0x1a')]);return _0x4e71a1(_0x3bb338['error'][_0xa347('0x1a')]);}logger['error'](_0xa347('0x19'),_0x350245,_0x3bb338[_0xa347('0x17')]['message']);return _0x48f233(_0x3bb338['error'][_0xa347('0x1a')]);}else{logger['info'](_0xa347('0x19'),_0x350245,_0xa347('0x15'));_0x48f233(_0x3bb338[_0xa347('0x1b')][_0xa347('0x1a')]);}})['catch'](function(_0x5d8ffb){logger[_0xa347('0x17')](_0xa347('0x19'),_0x350245,_0x5d8ffb);_0x4e71a1(_0x5d8ffb);});});}exports['ShowSmsAccount']=function(_0x48d782){var _0x4e4c9a=this;return new Promise(function(_0x307f43,_0x1d5287){return db['SmsAccount']['find']({'raw':_0x48d782['options']?_0x48d782[_0xa347('0x1c')][_0xa347('0x1d')]===undefined?!![]:![]:!![],'where':_0x48d782[_0xa347('0x1c')]?_0x48d782[_0xa347('0x1c')][_0xa347('0x1e')]||null:null,'attributes':_0x48d782[_0xa347('0x1c')]?_0x48d782[_0xa347('0x1c')][_0xa347('0x1f')]||null:null,'include':_0x48d782[_0xa347('0x1c')]?_0x48d782['options'][_0xa347('0x20')]?_['map'](_0x48d782[_0xa347('0x1c')][_0xa347('0x20')],function(_0x8b6b4c){return{'model':db[_0x8b6b4c[_0xa347('0x21')]],'as':_0x8b6b4c['as'],'attributes':_0x8b6b4c[_0xa347('0x1f')],'include':_0x8b6b4c[_0xa347('0x20')]?_[_0xa347('0x22')](_0x8b6b4c['include'],function(_0x1ef26d){return{'model':db[_0x1ef26d[_0xa347('0x21')]],'as':_0x1ef26d['as'],'attributes':_0x1ef26d[_0xa347('0x1f')],'include':_0x1ef26d[_0xa347('0x20')]?_['map'](_0x1ef26d['include'],function(_0x2ea525){return{'model':db[_0x2ea525['model']],'as':_0x2ea525['as'],'attributes':_0x2ea525[_0xa347('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xa347('0x11')](function(_0x4a33dd){logger[_0xa347('0x12')](_0xa347('0x23'),_0x48d782);logger['debug'](_0xa347('0x23'),_0x48d782,JSON['stringify'](_0x4a33dd));_0x307f43(_0x4a33dd);})[_0xa347('0x24')](function(_0x3cfec4){logger[_0xa347('0x17')](_0xa347('0x23'),_0x3cfec4[_0xa347('0x1a')],_0x48d782);_0x1d5287(_0x4e4c9a[_0xa347('0x17')](0x1f4,_0x3cfec4[_0xa347('0x1a')]));});});}; \ No newline at end of file +var _0xd176=['localhost','./smsAccount.socket','register','request','then','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','options','raw','where','attributes','include','map','model','ShowSmsAccount','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis'];(function(_0x1ceb35,_0x4314f4){var _0x538f63=function(_0x175538){while(--_0x175538){_0x1ceb35['push'](_0x1ceb35['shift']());}};_0x538f63(++_0x4314f4);}(_0xd176,0x164));var _0x6d17=function(_0x7b5cdd,_0x8c88d8){_0x7b5cdd=_0x7b5cdd-0x0;var _0x3a29ae=_0xd176[_0x7b5cdd];return _0x3a29ae;};'use strict';var _=require('lodash');var util=require(_0x6d17('0x0'));var moment=require(_0x6d17('0x1'));var BPromise=require(_0x6d17('0x2'));var rs=require(_0x6d17('0x3'));var fs=require('fs');var Redis=require(_0x6d17('0x4'));var db=require(_0x6d17('0x5'))['db'];var utils=require(_0x6d17('0x6'));var logger=require(_0x6d17('0x7'))('rpc');var config=require(_0x6d17('0x8'));var jayson=require(_0x6d17('0x9'));var client=jayson[_0x6d17('0xa')][_0x6d17('0xb')]({'port':0x232a});config['redis']=_[_0x6d17('0xc')](config[_0x6d17('0xd')],{'host':_0x6d17('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6d17('0xd')]));require(_0x6d17('0xf'))[_0x6d17('0x10')](socket);function respondWithRpcPromise(_0x6b954c,_0x378fdd,_0x13a71e){return new BPromise(function(_0x45fd2c,_0x4e34aa){return client[_0x6d17('0x11')](_0x6b954c,_0x13a71e)[_0x6d17('0x12')](function(_0x2001b8){logger['info'](_0x6d17('0x13'),_0x378fdd,_0x6d17('0x14'));logger['debug'](_0x6d17('0x15'),_0x378fdd,_0x6d17('0x14'),JSON[_0x6d17('0x16')](_0x2001b8));if(_0x2001b8[_0x6d17('0x17')]){if(_0x2001b8[_0x6d17('0x17')][_0x6d17('0x18')]===0x1f4){logger[_0x6d17('0x17')](_0x6d17('0x13'),_0x378fdd,_0x2001b8[_0x6d17('0x17')][_0x6d17('0x19')]);return _0x4e34aa(_0x2001b8[_0x6d17('0x17')][_0x6d17('0x19')]);}logger[_0x6d17('0x17')]('SmsAccount,\x20%s,\x20%s',_0x378fdd,_0x2001b8['error'][_0x6d17('0x19')]);return _0x45fd2c(_0x2001b8['error'][_0x6d17('0x19')]);}else{logger[_0x6d17('0x1a')](_0x6d17('0x13'),_0x378fdd,_0x6d17('0x14'));_0x45fd2c(_0x2001b8[_0x6d17('0x1b')]['message']);}})['catch'](function(_0x4e9876){logger[_0x6d17('0x17')]('SmsAccount,\x20%s,\x20%s',_0x378fdd,_0x4e9876);_0x4e34aa(_0x4e9876);});});}exports['ShowSmsAccount']=function(_0x7a1bc9){var _0x609cb5=this;return new Promise(function(_0x163d12,_0x4b36d2){return db['SmsAccount']['find']({'raw':_0x7a1bc9[_0x6d17('0x1c')]?_0x7a1bc9[_0x6d17('0x1c')][_0x6d17('0x1d')]===undefined?!![]:![]:!![],'where':_0x7a1bc9[_0x6d17('0x1c')]?_0x7a1bc9[_0x6d17('0x1c')][_0x6d17('0x1e')]||null:null,'attributes':_0x7a1bc9[_0x6d17('0x1c')]?_0x7a1bc9['options'][_0x6d17('0x1f')]||null:null,'include':_0x7a1bc9['options']?_0x7a1bc9['options'][_0x6d17('0x20')]?_[_0x6d17('0x21')](_0x7a1bc9['options'][_0x6d17('0x20')],function(_0x2e9166){return{'model':db[_0x2e9166[_0x6d17('0x22')]],'as':_0x2e9166['as'],'attributes':_0x2e9166[_0x6d17('0x1f')],'include':_0x2e9166['include']?_[_0x6d17('0x21')](_0x2e9166[_0x6d17('0x20')],function(_0x1329d3){return{'model':db[_0x1329d3[_0x6d17('0x22')]],'as':_0x1329d3['as'],'attributes':_0x1329d3[_0x6d17('0x1f')],'include':_0x1329d3['include']?_[_0x6d17('0x21')](_0x1329d3[_0x6d17('0x20')],function(_0x3da30b){return{'model':db[_0x3da30b['model']],'as':_0x3da30b['as'],'attributes':_0x3da30b[_0x6d17('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x6d17('0x12')](function(_0x5d671d){logger['info']('ShowSmsAccount',_0x7a1bc9);logger['debug'](_0x6d17('0x23'),_0x7a1bc9,JSON[_0x6d17('0x16')](_0x5d671d));_0x163d12(_0x5d671d);})[_0x6d17('0x24')](function(_0x431444){logger['error'](_0x6d17('0x23'),_0x431444[_0x6d17('0x19')],_0x7a1bc9);_0x4b36d2(_0x609cb5[_0x6d17('0x17')](0x1f4,_0x431444[_0x6d17('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index c7c17f8..407f1d6 100644 --- a/server/api/smsAccount/smsAccount.socket.js +++ b/server/api/smsAccount/smsAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file diff --git a/server/api/smsApplication/index.js b/server/api/smsApplication/index.js index 983c9a2..6c380e9 100644 --- a/server/api/smsApplication/index.js +++ b/server/api/smsApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['post','create','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show'];(function(_0x1091eb,_0x285a9e){var _0x2d2d99=function(_0x6d76d6){while(--_0x6d76d6){_0x1091eb['push'](_0x1091eb['shift']());}};_0x2d2d99(++_0x285a9e);}(_0xedd9,0xfc));var _0x9edd=function(_0x38447a,_0x3f973c){_0x38447a=_0x38447a-0x0;var _0x5cc56c=_0xedd9[_0x38447a];return _0x5cc56c;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0xe')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['put'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x10')]);router[_0x9edd('0x11')]('/:id',auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);module['exports']=router; \ No newline at end of file +var _0x34e8=['../../config/environment','./smsApplication.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2b67ab,_0x2d9aff){var _0x5e05cb=function(_0x6ae974){while(--_0x6ae974){_0x2b67ab['push'](_0x2b67ab['shift']());}};_0x5e05cb(++_0x2d9aff);}(_0x34e8,0x12c));var _0x834e=function(_0x4aaa29,_0x3c8142){_0x4aaa29=_0x4aaa29-0x0;var _0x222ed6=_0x34e8[_0x4aaa29];return _0x222ed6;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var fs_extra=require(_0x834e('0x5'));var auth=require(_0x834e('0x6'));var interaction=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var controller=require(_0x834e('0x9'));router[_0x834e('0xa')]('/',auth['isAuthenticated'](),controller[_0x834e('0xb')]);router['get'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0xe')]);router[_0x834e('0xf')]('/',auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0x11')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0x13')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);module[_0x834e('0x15')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index e3fddc0..5b0fff2 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 _0xce79=['INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x2ae94c,_0x1e460d){var _0x2d2742=function(_0x565b2a){while(--_0x565b2a){_0x2ae94c['push'](_0x2ae94c['shift']());}};_0x2d2742(++_0x1e460d);}(_0xce79,0x1cc));var _0x9ce7=function(_0x47f7ec,_0x369f9d){_0x47f7ec=_0x47f7ec-0x0;var _0x415101=_0xce79[_0x47f7ec];return _0x415101;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x9ce7('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0x9ce7('0x1')],'allowNull':![],'defaultValue':_0x9ce7('0x2')},'appdata':{'type':Sequelize[_0x9ce7('0x3')]()},'description':{'type':Sequelize[_0x9ce7('0x1')]},'interval':{'type':Sequelize[_0x9ce7('0x1')],'defaultValue':_0x9ce7('0x4')}}; \ No newline at end of file +var _0xf187=['sequelize','exports','STRING','TEXT','*,*,*,*'];(function(_0x158f01,_0x12af3e){var _0x5ef74e=function(_0x5e7adc){while(--_0x5e7adc){_0x158f01['push'](_0x158f01['shift']());}};_0x5ef74e(++_0x12af3e);}(_0xf187,0x78));var _0x7f18=function(_0x46d4dd,_0x3bd996){_0x46d4dd=_0x46d4dd-0x0;var _0x30a249=_0xf187[_0x46d4dd];return _0x30a249;};'use strict';var Sequelize=require(_0x7f18('0x0'));module[_0x7f18('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x7f18('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x7f18('0x3')]()},'description':{'type':Sequelize[_0x7f18('0x2')]},'interval':{'type':Sequelize[_0x7f18('0x2')],'defaultValue':_0x7f18('0x4')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index c57c6a9..1ce4ee9 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 _0xa17c=['ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','apply','reject','save','destroy','stack','name','map','fieldName','key','query','keys','filters','model','intersection','fields','attributes','length','nolimit','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','SmsApplication','then','rows','catch','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv'];(function(_0x323c92,_0x4020c9){var _0x319289=function(_0x215d97){while(--_0x215d97){_0x323c92['push'](_0x323c92['shift']());}};_0x319289(++_0x4020c9);}(_0xa17c,0x158));var _0xca17=function(_0x54d506,_0xabf5c2){_0x54d506=_0x54d506-0x0;var _0x5d3040=_0xa17c[_0x54d506];return _0x5d3040;};'use strict';var emlformat=require(_0xca17('0x0'));var rimraf=require(_0xca17('0x1'));var zipdir=require(_0xca17('0x2'));var jsonpatch=require(_0xca17('0x3'));var rp=require(_0xca17('0x4'));var moment=require(_0xca17('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xca17('0x6'));var util=require(_0xca17('0x7'));var path=require(_0xca17('0x8'));var sox=require(_0xca17('0x9'));var csv=require(_0xca17('0xa'));var ejs=require(_0xca17('0xb'));var fs=require('fs');var fs_extra=require(_0xca17('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xca17('0xd'));var jsforce=require(_0xca17('0xe'));var deskjs=require(_0xca17('0xf'));var toCsv=require(_0xca17('0xa'));var querystring=require(_0xca17('0x10'));var Papa=require(_0xca17('0x11'));var Redis=require('ioredis');var authService=require(_0xca17('0x12'));var qs=require(_0xca17('0x13'));var as=require(_0xca17('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xca17('0x15'))(_0xca17('0x16'));var utils=require(_0xca17('0x17'));var config=require(_0xca17('0x18'));var licenseUtil=require(_0xca17('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x39f0c6,_0x449af6){_0x449af6=_0x449af6||0xcc;return function(_0x1f9bb0){if(_0x1f9bb0){return _0x39f0c6[_0xca17('0x1a')](_0x449af6);}return _0x39f0c6[_0xca17('0x1b')](_0x449af6)[_0xca17('0x1c')]();};}function respondWithResult(_0x3b7ce4,_0x405263){_0x405263=_0x405263||0xc8;return function(_0x139255){if(_0x139255){return _0x3b7ce4[_0xca17('0x1b')](_0x405263)['json'](_0x139255);}};}function respondWithFilteredResult(_0x419644,_0x500e4e){return function(_0x4f45b1){if(_0x4f45b1){var _0x2bdf49=typeof _0x500e4e[_0xca17('0x1d')]==='undefined'&&typeof _0x500e4e[_0xca17('0x1e')]===_0xca17('0x1f');var _0x12e05c=_0x4f45b1[_0xca17('0x20')];var _0x74f6fe=_0x2bdf49?0x0:_0x500e4e[_0xca17('0x1d')];var _0xb51d=_0x2bdf49?_0x4f45b1[_0xca17('0x20')]:_0x500e4e[_0xca17('0x1d')]+_0x500e4e[_0xca17('0x1e')];var _0x1b7c07;if(_0xb51d>=_0x12e05c){_0xb51d=_0x12e05c;_0x1b7c07=0xc8;}else{_0x1b7c07=0xce;}_0x419644[_0xca17('0x1b')](_0x1b7c07);return _0x419644[_0xca17('0x21')](_0xca17('0x22'),_0x74f6fe+'-'+_0xb51d+'/'+_0x12e05c)['json'](_0x4f45b1);}return null;};}function patchUpdates(_0x13a2fb){return function(_0x171e05){try{jsonpatch[_0xca17('0x23')](_0x171e05,_0x13a2fb,!![]);}catch(_0x32001f){return BPromise[_0xca17('0x24')](_0x32001f);}return _0x171e05[_0xca17('0x25')]();};}function saveUpdates(_0xb6fe5f,_0x30e7fc){return function(_0x2dcdda){if(_0x2dcdda){return _0x2dcdda['update'](_0xb6fe5f)['then'](function(_0x8e0932){return _0x8e0932;});}return null;};}function removeEntity(_0x1e45a8,_0x8dda3d){return function(_0x52a12b){if(_0x52a12b){return _0x52a12b[_0xca17('0x26')]()['then'](function(){_0x1e45a8[_0xca17('0x1b')](0xcc)[_0xca17('0x1c')]();});}};}function handleEntityNotFound(_0x12ae0e,_0x20fa1c){return function(_0x25cc19){if(!_0x25cc19){_0x12ae0e['sendStatus'](0x194);}return _0x25cc19;};}function handleError(_0x2ff9b3,_0x5c01e0){_0x5c01e0=_0x5c01e0||0x1f4;return function(_0x54450e){logger['error'](_0x54450e[_0xca17('0x27')]);if(_0x54450e['name']){delete _0x54450e[_0xca17('0x28')];}_0x2ff9b3[_0xca17('0x1b')](_0x5c01e0)['send'](_0x54450e);};}exports['index']=function(_0x33acba,_0x10e481){var _0x29684f={},_0xe6051f={},_0x2bc203={'count':0x0,'rows':[]};var _0x549483=_[_0xca17('0x29')](db['SmsApplication']['rawAttributes'],function(_0x2563c7){return{'name':_0x2563c7[_0xca17('0x2a')],'type':_0x2563c7['type'][_0xca17('0x2b')]};});_0xe6051f['model']=_['map'](_0x549483,_0xca17('0x28'));_0xe6051f[_0xca17('0x2c')]=_[_0xca17('0x2d')](_0x33acba['query']);_0xe6051f[_0xca17('0x2e')]=_['intersection'](_0xe6051f[_0xca17('0x2f')],_0xe6051f['query']);_0x29684f['attributes']=_[_0xca17('0x30')](_0xe6051f[_0xca17('0x2f')],qs[_0xca17('0x31')](_0x33acba[_0xca17('0x2c')][_0xca17('0x31')]));_0x29684f[_0xca17('0x32')]=_0x29684f[_0xca17('0x32')][_0xca17('0x33')]?_0x29684f[_0xca17('0x32')]:_0xe6051f['model'];if(!_0x33acba[_0xca17('0x2c')]['hasOwnProperty'](_0xca17('0x34'))){_0x29684f['limit']=qs['limit'](_0x33acba['query'][_0xca17('0x1e')]);_0x29684f[_0xca17('0x1d')]=qs[_0xca17('0x1d')](_0x33acba[_0xca17('0x2c')]['offset']);}_0x29684f['order']=qs[_0xca17('0x35')](_0x33acba[_0xca17('0x2c')][_0xca17('0x35')]);_0x29684f[_0xca17('0x36')]=qs['filters'](_[_0xca17('0x37')](_0x33acba[_0xca17('0x2c')],_0xe6051f[_0xca17('0x2e')]),_0x549483);if(_0x33acba[_0xca17('0x2c')][_0xca17('0x38')]){_0x29684f[_0xca17('0x36')]=_['merge'](_0x29684f[_0xca17('0x36')],{'$or':_['map'](_0x549483,function(_0x210a4c){if(_0x210a4c[_0xca17('0x39')]!==_0xca17('0x3a')){var _0x13c47b={};_0x13c47b[_0x210a4c[_0xca17('0x28')]]={'$like':'%'+_0x33acba['query']['filter']+'%'};return _0x13c47b;}})});}_0x29684f=_[_0xca17('0x3b')]({},_0x29684f,_0x33acba[_0xca17('0x3c')]);var _0x41f310={'where':_0x29684f['where']};return db['SmsApplication'][_0xca17('0x20')](_0x41f310)['then'](function(_0x2f064b){_0x2bc203[_0xca17('0x20')]=_0x2f064b;if(_0x33acba['query'][_0xca17('0x3d')]){_0x29684f[_0xca17('0x3e')]=[{'all':!![]}];}return db[_0xca17('0x3f')]['findAll'](_0x29684f);})[_0xca17('0x40')](function(_0x44c3c0){_0x2bc203[_0xca17('0x41')]=_0x44c3c0;return _0x2bc203;})[_0xca17('0x40')](respondWithFilteredResult(_0x10e481,_0x29684f))[_0xca17('0x42')](handleError(_0x10e481,null));};exports['show']=function(_0x3cfbf3,_0x3382f5){var _0x4f72a9={'raw':!![],'where':{'id':_0x3cfbf3[_0xca17('0x43')]['id']}},_0x1f97d4={};_0x1f97d4[_0xca17('0x2f')]=_['keys'](db[_0xca17('0x3f')]['rawAttributes']);_0x1f97d4[_0xca17('0x2c')]=_[_0xca17('0x2d')](_0x3cfbf3[_0xca17('0x2c')]);_0x1f97d4[_0xca17('0x2e')]=_[_0xca17('0x30')](_0x1f97d4[_0xca17('0x2f')],_0x1f97d4[_0xca17('0x2c')]);_0x4f72a9['attributes']=_[_0xca17('0x30')](_0x1f97d4['model'],qs[_0xca17('0x31')](_0x3cfbf3[_0xca17('0x2c')][_0xca17('0x31')]));_0x4f72a9[_0xca17('0x32')]=_0x4f72a9[_0xca17('0x32')]['length']?_0x4f72a9['attributes']:_0x1f97d4['model'];if(_0x3cfbf3[_0xca17('0x2c')][_0xca17('0x3d')]){_0x4f72a9[_0xca17('0x3e')]=[{'all':!![]}];}_0x4f72a9=_['merge']({},_0x4f72a9,_0x3cfbf3[_0xca17('0x3c')]);return db[_0xca17('0x3f')][_0xca17('0x44')](_0x4f72a9)[_0xca17('0x40')](handleEntityNotFound(_0x3382f5,null))[_0xca17('0x40')](respondWithResult(_0x3382f5,null))[_0xca17('0x42')](handleError(_0x3382f5,null));};exports[_0xca17('0x45')]=function(_0x3a5720,_0x13639d){return db[_0xca17('0x3f')][_0xca17('0x45')](_0x3a5720['body'],{})[_0xca17('0x40')](respondWithResult(_0x13639d,0xc9))[_0xca17('0x42')](handleError(_0x13639d,null));};exports['update']=function(_0x13a642,_0x3f1dd4){if(_0x13a642[_0xca17('0x46')]['id']){delete _0x13a642['body']['id'];}return db[_0xca17('0x3f')][_0xca17('0x44')]({'where':{'id':_0x13a642['params']['id']}})[_0xca17('0x40')](handleEntityNotFound(_0x3f1dd4,null))['then'](saveUpdates(_0x13a642[_0xca17('0x46')],null))[_0xca17('0x40')](respondWithResult(_0x3f1dd4,null))[_0xca17('0x42')](handleError(_0x3f1dd4,null));};exports[_0xca17('0x26')]=function(_0x4d0cd1,_0x28af46){return db[_0xca17('0x3f')][_0xca17('0x44')]({'where':{'id':_0x4d0cd1[_0xca17('0x43')]['id']}})[_0xca17('0x40')](handleEntityNotFound(_0x28af46,null))[_0xca17('0x40')](removeEntity(_0x28af46,null))[_0xca17('0x42')](handleError(_0x28af46,null));}; \ No newline at end of file +var _0x556a=['where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','find','catch','create','body','update','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','then','destroy','stack','name','map','SmsApplication','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','sort'];(function(_0x47e549,_0x2e53d6){var _0x251374=function(_0x400458){while(--_0x400458){_0x47e549['push'](_0x47e549['shift']());}};_0x251374(++_0x2e53d6);}(_0x556a,0x1eb));var _0xa556=function(_0x3f62cb,_0x42f227){_0x3f62cb=_0x3f62cb-0x0;var _0x1f4c14=_0x556a[_0x3f62cb];return _0x1f4c14;};'use strict';var emlformat=require(_0xa556('0x0'));var rimraf=require(_0xa556('0x1'));var zipdir=require(_0xa556('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa556('0x3'));var moment=require(_0xa556('0x4'));var BPromise=require(_0xa556('0x5'));var Mustache=require('mustache');var util=require(_0xa556('0x6'));var path=require(_0xa556('0x7'));var sox=require(_0xa556('0x8'));var csv=require(_0xa556('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa556('0xa'));var squel=require('squel');var crypto=require(_0xa556('0xb'));var jsforce=require(_0xa556('0xc'));var deskjs=require(_0xa556('0xd'));var toCsv=require(_0xa556('0x9'));var querystring=require(_0xa556('0xe'));var Papa=require('papaparse');var Redis=require(_0xa556('0xf'));var authService=require(_0xa556('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xa556('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa556('0x12'))(_0xa556('0x13'));var utils=require(_0xa556('0x14'));var config=require(_0xa556('0x15'));var licenseUtil=require(_0xa556('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2ba10e,_0x1e31b7){_0x1e31b7=_0x1e31b7||0xcc;return function(_0x531443){if(_0x531443){return _0x2ba10e[_0xa556('0x17')](_0x1e31b7);}return _0x2ba10e[_0xa556('0x18')](_0x1e31b7)[_0xa556('0x19')]();};}function respondWithResult(_0x231fd4,_0x3b7e89){_0x3b7e89=_0x3b7e89||0xc8;return function(_0x240d63){if(_0x240d63){return _0x231fd4['status'](_0x3b7e89)[_0xa556('0x1a')](_0x240d63);}};}function respondWithFilteredResult(_0x4a765f,_0x412b01){return function(_0x2c9650){if(_0x2c9650){var _0x52e417=typeof _0x412b01[_0xa556('0x1b')]===_0xa556('0x1c')&&typeof _0x412b01[_0xa556('0x1d')]==='undefined';var _0x486ade=_0x2c9650[_0xa556('0x1e')];var _0x573614=_0x52e417?0x0:_0x412b01[_0xa556('0x1b')];var _0xe9ce6c=_0x52e417?_0x2c9650[_0xa556('0x1e')]:_0x412b01['offset']+_0x412b01[_0xa556('0x1d')];var _0xff5118;if(_0xe9ce6c>=_0x486ade){_0xe9ce6c=_0x486ade;_0xff5118=0xc8;}else{_0xff5118=0xce;}_0x4a765f['status'](_0xff5118);return _0x4a765f['set'](_0xa556('0x1f'),_0x573614+'-'+_0xe9ce6c+'/'+_0x486ade)['json'](_0x2c9650);}return null;};}function patchUpdates(_0x3a44c5){return function(_0x246f53){try{jsonpatch[_0xa556('0x20')](_0x246f53,_0x3a44c5,!![]);}catch(_0x477d76){return BPromise[_0xa556('0x21')](_0x477d76);}return _0x246f53['save']();};}function saveUpdates(_0x1a6783,_0x52bf0c){return function(_0x3f449d){if(_0x3f449d){return _0x3f449d['update'](_0x1a6783)[_0xa556('0x22')](function(_0x2c1637){return _0x2c1637;});}return null;};}function removeEntity(_0x495a77,_0x5c85aa){return function(_0x17e873){if(_0x17e873){return _0x17e873[_0xa556('0x23')]()[_0xa556('0x22')](function(){_0x495a77[_0xa556('0x18')](0xcc)[_0xa556('0x19')]();});}};}function handleEntityNotFound(_0x462314,_0x3bcbb2){return function(_0x3a1bf3){if(!_0x3a1bf3){_0x462314[_0xa556('0x17')](0x194);}return _0x3a1bf3;};}function handleError(_0x395a8b,_0x204b58){_0x204b58=_0x204b58||0x1f4;return function(_0x8cdd39){logger['error'](_0x8cdd39[_0xa556('0x24')]);if(_0x8cdd39[_0xa556('0x25')]){delete _0x8cdd39[_0xa556('0x25')];}_0x395a8b['status'](_0x204b58)['send'](_0x8cdd39);};}exports['index']=function(_0x45455d,_0x399813){var _0x497880={},_0x5da056={},_0x3707b7={'count':0x0,'rows':[]};var _0x2e759e=_[_0xa556('0x26')](db[_0xa556('0x27')][_0xa556('0x28')],function(_0x52fc89){return{'name':_0x52fc89[_0xa556('0x29')],'type':_0x52fc89[_0xa556('0x2a')][_0xa556('0x2b')]};});_0x5da056[_0xa556('0x2c')]=_['map'](_0x2e759e,_0xa556('0x25'));_0x5da056['query']=_[_0xa556('0x2d')](_0x45455d['query']);_0x5da056[_0xa556('0x2e')]=_[_0xa556('0x2f')](_0x5da056[_0xa556('0x2c')],_0x5da056[_0xa556('0x30')]);_0x497880[_0xa556('0x31')]=_[_0xa556('0x2f')](_0x5da056[_0xa556('0x2c')],qs[_0xa556('0x32')](_0x45455d[_0xa556('0x30')][_0xa556('0x32')]));_0x497880[_0xa556('0x31')]=_0x497880[_0xa556('0x31')][_0xa556('0x33')]?_0x497880[_0xa556('0x31')]:_0x5da056[_0xa556('0x2c')];if(!_0x45455d['query']['hasOwnProperty']('nolimit')){_0x497880['limit']=qs[_0xa556('0x1d')](_0x45455d['query'][_0xa556('0x1d')]);_0x497880[_0xa556('0x1b')]=qs[_0xa556('0x1b')](_0x45455d[_0xa556('0x30')]['offset']);}_0x497880['order']=qs['sort'](_0x45455d[_0xa556('0x30')][_0xa556('0x34')]);_0x497880[_0xa556('0x35')]=qs[_0xa556('0x2e')](_[_0xa556('0x36')](_0x45455d[_0xa556('0x30')],_0x5da056[_0xa556('0x2e')]),_0x2e759e);if(_0x45455d[_0xa556('0x30')][_0xa556('0x37')]){_0x497880[_0xa556('0x35')]=_[_0xa556('0x38')](_0x497880['where'],{'$or':_[_0xa556('0x26')](_0x2e759e,function(_0x12c78b){if(_0x12c78b[_0xa556('0x2a')]!==_0xa556('0x39')){var _0x50498e={};_0x50498e[_0x12c78b['name']]={'$like':'%'+_0x45455d[_0xa556('0x30')][_0xa556('0x37')]+'%'};return _0x50498e;}})});}_0x497880=_[_0xa556('0x38')]({},_0x497880,_0x45455d[_0xa556('0x3a')]);var _0x12fa54={'where':_0x497880[_0xa556('0x35')]};return db[_0xa556('0x27')][_0xa556('0x1e')](_0x12fa54)[_0xa556('0x22')](function(_0x1f8831){_0x3707b7[_0xa556('0x1e')]=_0x1f8831;if(_0x45455d['query'][_0xa556('0x3b')]){_0x497880[_0xa556('0x3c')]=[{'all':!![]}];}return db['SmsApplication'][_0xa556('0x3d')](_0x497880);})[_0xa556('0x22')](function(_0xde2cdb){_0x3707b7['rows']=_0xde2cdb;return _0x3707b7;})[_0xa556('0x22')](respondWithFilteredResult(_0x399813,_0x497880))['catch'](handleError(_0x399813,null));};exports['show']=function(_0x566b20,_0x201a25){var _0x503195={'raw':!![],'where':{'id':_0x566b20['params']['id']}},_0x1b3ea3={};_0x1b3ea3['model']=_[_0xa556('0x2d')](db['SmsApplication'][_0xa556('0x28')]);_0x1b3ea3[_0xa556('0x30')]=_[_0xa556('0x2d')](_0x566b20[_0xa556('0x30')]);_0x1b3ea3[_0xa556('0x2e')]=_['intersection'](_0x1b3ea3['model'],_0x1b3ea3[_0xa556('0x30')]);_0x503195[_0xa556('0x31')]=_[_0xa556('0x2f')](_0x1b3ea3['model'],qs[_0xa556('0x32')](_0x566b20['query'][_0xa556('0x32')]));_0x503195[_0xa556('0x31')]=_0x503195[_0xa556('0x31')][_0xa556('0x33')]?_0x503195['attributes']:_0x1b3ea3[_0xa556('0x2c')];if(_0x566b20[_0xa556('0x30')][_0xa556('0x3b')]){_0x503195['include']=[{'all':!![]}];}_0x503195=_['merge']({},_0x503195,_0x566b20[_0xa556('0x3a')]);return db[_0xa556('0x27')][_0xa556('0x3e')](_0x503195)[_0xa556('0x22')](handleEntityNotFound(_0x201a25,null))[_0xa556('0x22')](respondWithResult(_0x201a25,null))[_0xa556('0x3f')](handleError(_0x201a25,null));};exports[_0xa556('0x40')]=function(_0x21b21f,_0x17a1b8){return db[_0xa556('0x27')][_0xa556('0x40')](_0x21b21f[_0xa556('0x41')],{})[_0xa556('0x22')](respondWithResult(_0x17a1b8,0xc9))[_0xa556('0x3f')](handleError(_0x17a1b8,null));};exports[_0xa556('0x42')]=function(_0x2b7c91,_0x41efe5){if(_0x2b7c91['body']['id']){delete _0x2b7c91[_0xa556('0x41')]['id'];}return db[_0xa556('0x27')][_0xa556('0x3e')]({'where':{'id':_0x2b7c91[_0xa556('0x43')]['id']}})['then'](handleEntityNotFound(_0x41efe5,null))[_0xa556('0x22')](saveUpdates(_0x2b7c91[_0xa556('0x41')],null))[_0xa556('0x22')](respondWithResult(_0x41efe5,null))[_0xa556('0x3f')](handleError(_0x41efe5,null));};exports[_0xa556('0x23')]=function(_0x4245d7,_0x51f581){return db[_0xa556('0x27')][_0xa556('0x3e')]({'where':{'id':_0x4245d7[_0xa556('0x43')]['id']}})['then'](handleEntityNotFound(_0x51f581,null))[_0xa556('0x22')](removeEntity(_0x51f581,null))[_0xa556('0x3f')](handleError(_0x51f581,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 9bb1a70..1fabfa5 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 _0xfe78=['SmsApplication','utf8mb4','util','../../config/logger','api','bluebird','rimraf','../../config/environment','./smsApplication.attributes','exports'];(function(_0x2d5bae,_0x3b72c9){var _0x1952dc=function(_0x44cfb7){while(--_0x44cfb7){_0x2d5bae['push'](_0x2d5bae['shift']());}};_0x1952dc(++_0x3b72c9);}(_0xfe78,0x70));var _0x8fe7=function(_0xb6f525,_0x374b6b){_0xb6f525=_0xb6f525-0x0;var _0x435861=_0xfe78[_0xb6f525];return _0x435861;};'use strict';var _=require('lodash');var util=require(_0x8fe7('0x0'));var logger=require(_0x8fe7('0x1'))(_0x8fe7('0x2'));var moment=require('moment');var BPromise=require(_0x8fe7('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8fe7('0x4'));var config=require(_0x8fe7('0x5'));var attributes=require(_0x8fe7('0x6'));module[_0x8fe7('0x7')]=function(_0x34141f,_0x528efc){return _0x34141f['define'](_0x8fe7('0x8'),attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8fe7('0x9'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x15a0=['api','moment','request-promise','path','../../config/environment','./smsApplication.attributes','exports','define','sms_applications','lodash','../../config/logger'];(function(_0x5553b3,_0x337912){var _0x52d9a3=function(_0x4d4b56){while(--_0x4d4b56){_0x5553b3['push'](_0x5553b3['shift']());}};_0x52d9a3(++_0x337912);}(_0x15a0,0x8d));var _0x015a=function(_0x301c34,_0x15701e){_0x301c34=_0x301c34-0x0;var _0x1a8c5a=_0x15a0[_0x301c34];return _0x1a8c5a;};'use strict';var _=require(_0x015a('0x0'));var util=require('util');var logger=require(_0x015a('0x1'))(_0x015a('0x2'));var moment=require(_0x015a('0x3'));var BPromise=require('bluebird');var rp=require(_0x015a('0x4'));var fs=require('fs');var path=require(_0x015a('0x5'));var rimraf=require('rimraf');var config=require(_0x015a('0x6'));var attributes=require(_0x015a('0x7'));module[_0x015a('0x8')]=function(_0x1c6045,_0x55b9fa){return _0x1c6045[_0x015a('0x9')]('SmsApplication',attributes,{'tableName':_0x015a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 1966cff..977167d 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 _0xd9eb=['then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x955865,_0x58ce65){var _0x4b6f75=function(_0x34141e){while(--_0x34141e){_0x955865['push'](_0x955865['shift']());}};_0x4b6f75(++_0x58ce65);}(_0xd9eb,0xca));var _0xbd9e=function(_0x261b1f,_0x594b1f){_0x261b1f=_0x261b1f-0x0;var _0x56529a=_0xd9eb[_0x261b1f];return _0x56529a;};'use strict';var _=require(_0xbd9e('0x0'));var util=require(_0xbd9e('0x1'));var moment=require(_0xbd9e('0x2'));var BPromise=require(_0xbd9e('0x3'));var rs=require(_0xbd9e('0x4'));var fs=require('fs');var Redis=require(_0xbd9e('0x5'));var db=require(_0xbd9e('0x6'))['db'];var utils=require(_0xbd9e('0x7'));var logger=require(_0xbd9e('0x8'))(_0xbd9e('0x9'));var config=require(_0xbd9e('0xa'));var jayson=require(_0xbd9e('0xb'));var client=jayson[_0xbd9e('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x26408d,_0x37d9a1,_0x293a79){return new BPromise(function(_0x2dbf84,_0x20cddf){return client[_0xbd9e('0xd')](_0x26408d,_0x293a79)[_0xbd9e('0xe')](function(_0x82e476){logger[_0xbd9e('0xf')](_0xbd9e('0x10'),_0x37d9a1,_0xbd9e('0x11'));logger[_0xbd9e('0x12')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0x37d9a1,_0xbd9e('0x11'),JSON[_0xbd9e('0x13')](_0x82e476));if(_0x82e476['error']){if(_0x82e476[_0xbd9e('0x14')]['code']===0x1f4){logger[_0xbd9e('0x14')](_0xbd9e('0x10'),_0x37d9a1,_0x82e476[_0xbd9e('0x14')][_0xbd9e('0x15')]);return _0x20cddf(_0x82e476[_0xbd9e('0x14')][_0xbd9e('0x15')]);}logger[_0xbd9e('0x14')](_0xbd9e('0x10'),_0x37d9a1,_0x82e476['error'][_0xbd9e('0x15')]);return _0x2dbf84(_0x82e476[_0xbd9e('0x14')][_0xbd9e('0x15')]);}else{logger[_0xbd9e('0xf')](_0xbd9e('0x10'),_0x37d9a1,_0xbd9e('0x11'));_0x2dbf84(_0x82e476[_0xbd9e('0x16')][_0xbd9e('0x15')]);}})[_0xbd9e('0x17')](function(_0x42e634){logger[_0xbd9e('0x14')]('SmsApplication,\x20%s,\x20%s',_0x37d9a1,_0x42e634);_0x20cddf(_0x42e634);});});} \ No newline at end of file +var _0xc373=['../../config/environment','jayson/promise','request','then','info','debug','SmsApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SmsApplication,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x5ccb58,_0x15a9be){var _0x25b4d8=function(_0xdba081){while(--_0xdba081){_0x5ccb58['push'](_0x5ccb58['shift']());}};_0x25b4d8(++_0x15a9be);}(_0xc373,0x1c7));var _0x3c37=function(_0x580647,_0x43d2c3){_0x580647=_0x580647-0x0;var _0x5f0792=_0xc373[_0x580647];return _0x5f0792;};'use strict';var _=require('lodash');var util=require(_0x3c37('0x0'));var moment=require(_0x3c37('0x1'));var BPromise=require(_0x3c37('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3c37('0x3'))['db'];var utils=require(_0x3c37('0x4'));var logger=require(_0x3c37('0x5'))(_0x3c37('0x6'));var config=require(_0x3c37('0x7'));var jayson=require(_0x3c37('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2e1941,_0x1244e6,_0x14b09d){return new BPromise(function(_0x10617,_0x465de6){return client[_0x3c37('0x9')](_0x2e1941,_0x14b09d)[_0x3c37('0xa')](function(_0x59d4f9){logger[_0x3c37('0xb')]('SmsApplication,\x20%s,\x20%s',_0x1244e6,'request\x20sent');logger[_0x3c37('0xc')](_0x3c37('0xd'),_0x1244e6,_0x3c37('0xe'),JSON[_0x3c37('0xf')](_0x59d4f9));if(_0x59d4f9[_0x3c37('0x10')]){if(_0x59d4f9[_0x3c37('0x10')][_0x3c37('0x11')]===0x1f4){logger['error'](_0x3c37('0x12'),_0x1244e6,_0x59d4f9[_0x3c37('0x10')][_0x3c37('0x13')]);return _0x465de6(_0x59d4f9['error']['message']);}logger[_0x3c37('0x10')]('SmsApplication,\x20%s,\x20%s',_0x1244e6,_0x59d4f9['error'][_0x3c37('0x13')]);return _0x10617(_0x59d4f9[_0x3c37('0x10')][_0x3c37('0x13')]);}else{logger[_0x3c37('0xb')](_0x3c37('0x12'),_0x1244e6,_0x3c37('0xe'));_0x10617(_0x59d4f9[_0x3c37('0x14')][_0x3c37('0x13')]);}})[_0x3c37('0x15')](function(_0x4e1560){logger[_0x3c37('0x10')](_0x3c37('0x12'),_0x1244e6,_0x4e1560);_0x465de6(_0x4e1560);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index ea8205f..95faf6e 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 _0xd4a2=['isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','download','create','post','addMessage','/:id/tags','sms','addTags','put','update','tracked','removeTags','exports','multer','connect-timeout','Router','../../components/auth/service','../../config/environment','./smsInteraction.controller','get'];(function(_0xbd6b38,_0x4ad164){var _0x88f5b7=function(_0x186031){while(--_0x186031){_0xbd6b38['push'](_0xbd6b38['shift']());}};_0x88f5b7(++_0x4ad164);}(_0xd4a2,0x173));var _0x2d4a=function(_0x35c3dd,_0x1f62c4){_0x35c3dd=_0x35c3dd-0x0;var _0x276a1f=_0xd4a2[_0x35c3dd];return _0x276a1f;};'use strict';var multer=require(_0x2d4a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2d4a('0x1'));var express=require('express');var router=express[_0x2d4a('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x2d4a('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x2d4a('0x4'));var controller=require(_0x2d4a('0x5'));router[_0x2d4a('0x6')]('/',auth[_0x2d4a('0x7')](),controller[_0x2d4a('0x8')]);router['get'](_0x2d4a('0x9'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0xa')]);router[_0x2d4a('0x6')](_0x2d4a('0xb'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0xc')]);router[_0x2d4a('0x6')](_0x2d4a('0xd'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0xe')]);router[_0x2d4a('0x6')]('/:id/download',auth['isAuthenticated'](),controller[_0x2d4a('0xf')]);router['post']('/',auth[_0x2d4a('0x7')](),controller[_0x2d4a('0x10')]);router[_0x2d4a('0x11')](_0x2d4a('0xd'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0x12')]);router[_0x2d4a('0x11')](_0x2d4a('0x13'),auth['isAuthenticated'](),interaction['tracked'](_0x2d4a('0x14'),'smsinteraction:addtags'),controller[_0x2d4a('0x15')]);router[_0x2d4a('0x16')](_0x2d4a('0xb'),auth[_0x2d4a('0x7')](),interaction['tracked'](_0x2d4a('0x14'),'smsinteraction:update'),controller[_0x2d4a('0x17')]);router['delete'](_0x2d4a('0xb'),auth[_0x2d4a('0x7')](),interaction[_0x2d4a('0x18')](_0x2d4a('0x14'),'smsinteraction:destroy'),controller['destroy']);router['delete'](_0x2d4a('0x13'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0x19')]);module[_0x2d4a('0x1a')]=router; \ No newline at end of file +var _0xb62e=['removeTags','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','isAuthenticated','index','get','describe','/:id','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','smsinteraction:addtags','addTags','put','sms','smsinteraction:update','update','delete','smsinteraction:destroy','destroy'];(function(_0x4c4f7b,_0x58ce91){var _0x1b299d=function(_0x2b7703){while(--_0x2b7703){_0x4c4f7b['push'](_0x4c4f7b['shift']());}};_0x1b299d(++_0x58ce91);}(_0xb62e,0x1de));var _0xeb62=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb62e[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xeb62('0x0'));var util=require(_0xeb62('0x1'));var path=require(_0xeb62('0x2'));var timeout=require(_0xeb62('0x3'));var express=require('express');var router=express[_0xeb62('0x4')]();var fs_extra=require(_0xeb62('0x5'));var auth=require(_0xeb62('0x6'));var interaction=require(_0xeb62('0x7'));var config=require(_0xeb62('0x8'));var controller=require(_0xeb62('0x9'));router['get']('/',auth[_0xeb62('0xa')](),controller[_0xeb62('0xb')]);router[_0xeb62('0xc')]('/describe',auth[_0xeb62('0xa')](),controller[_0xeb62('0xd')]);router[_0xeb62('0xc')](_0xeb62('0xe'),auth['isAuthenticated'](),controller['show']);router[_0xeb62('0xc')](_0xeb62('0xf'),auth[_0xeb62('0xa')](),controller[_0xeb62('0x10')]);router[_0xeb62('0xc')](_0xeb62('0x11'),auth[_0xeb62('0xa')](),controller[_0xeb62('0x12')]);router[_0xeb62('0x13')]('/',auth[_0xeb62('0xa')](),controller['create']);router[_0xeb62('0x13')](_0xeb62('0xf'),auth[_0xeb62('0xa')](),controller[_0xeb62('0x14')]);router['post'](_0xeb62('0x15'),auth[_0xeb62('0xa')](),interaction[_0xeb62('0x16')]('sms',_0xeb62('0x17')),controller[_0xeb62('0x18')]);router[_0xeb62('0x19')]('/:id',auth[_0xeb62('0xa')](),interaction[_0xeb62('0x16')](_0xeb62('0x1a'),_0xeb62('0x1b')),controller[_0xeb62('0x1c')]);router[_0xeb62('0x1d')](_0xeb62('0xe'),auth[_0xeb62('0xa')](),interaction[_0xeb62('0x16')](_0xeb62('0x1a'),_0xeb62('0x1e')),controller[_0xeb62('0x1f')]);router[_0xeb62('0x1d')]('/:id/tags',auth[_0xeb62('0xa')](),controller[_0xeb62('0x20')]);module[_0xeb62('0x21')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 86ff5ab..cd89e9e 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 _0xcbd3=['STRING','ENUM','out','sequelize','moment','exports','BOOLEAN','DATE'];(function(_0x1f1901,_0x1c3f5d){var _0x4951a5=function(_0x13a2a7){while(--_0x13a2a7){_0x1f1901['push'](_0x1f1901['shift']());}};_0x4951a5(++_0x1c3f5d);}(_0xcbd3,0x1eb));var _0x3cbd=function(_0x585498,_0x1e2597){_0x585498=_0x585498-0x0;var _0x79f93a=_0xcbd3[_0x585498];return _0x79f93a;};'use strict';var Sequelize=require(_0x3cbd('0x0'));var moment=require(_0x3cbd('0x1'));module[_0x3cbd('0x2')]={'closed':{'type':Sequelize[_0x3cbd('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x3cbd('0x4')]},'disposition':{'type':Sequelize[_0x3cbd('0x5')]},'secondDisposition':{'type':Sequelize[_0x3cbd('0x5')]},'thirdDisposition':{'type':Sequelize[_0x3cbd('0x5')]},'note':{'type':Sequelize[_0x3cbd('0x5')]},'phone':{'type':Sequelize[_0x3cbd('0x5')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x3cbd('0x6')]('in',_0x3cbd('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x3cbd('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x3cbd('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x741c=['exports','BOOLEAN','DATE','STRING','ENUM','out','sequelize','moment'];(function(_0xf3facd,_0x3d26b9){var _0x49bc8b=function(_0x11fc1c){while(--_0x11fc1c){_0xf3facd['push'](_0xf3facd['shift']());}};_0x49bc8b(++_0x3d26b9);}(_0x741c,0x196));var _0xc741=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x741c[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require(_0xc741('0x0'));var moment=require(_0xc741('0x1'));module[_0xc741('0x2')]={'closed':{'type':Sequelize[_0xc741('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xc741('0x4')]},'disposition':{'type':Sequelize[_0xc741('0x5')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xc741('0x5')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xc741('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xc741('0x6')]('in',_0xc741('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xc741('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xc741('0x6')]('in',_0xc741('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xc741('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index feefb37..ae110e5 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 _0x1da9=['include','options','find','catch','create','body','describe','addMessage','SmsMessage','ids','getMessages','findOne','hasOwnProperty','sort','pick','where','SmsInteractionId','filter','merge','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','addTags','setTags','omit','spread','Tag','color','removeTags','download','toString','join','files','tmp','transcript-%d-%s.zip','push','Contact','firstName','Messages','createdAt','direction','secret','read','SmsAccount','Account','User','Owner','fullname','get','Sms','N.A.','closed','closedAt','disposition','System','lastName','out','value','server','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','moment','bluebird','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','defaults','redis','localhost','./smsInteraction.socket','register','sendStatus','end','status','json','undefined','offset','count','limit','set','Content-Range','update','then','destroy','error','name','send','index','map','SmsInteraction','rawAttributes','fieldName','type','key','getOptions','sms','user','show','params','model','keys','query','filters','intersection','attributes','fields','length','includeAll'];(function(_0x3089ae,_0x2fa684){var _0x13be94=function(_0x587055){while(--_0x587055){_0x3089ae['push'](_0x3089ae['shift']());}};_0x13be94(++_0x2fa684);}(_0x1da9,0x141));var _0x91da=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x1da9[_0x5ddb1c];return _0x354adc;};'use strict';var rimraf=require(_0x91da('0x0'));var zipdir=require(_0x91da('0x1'));var moment=require(_0x91da('0x2'));var BPromise=require(_0x91da('0x3'));var util=require(_0x91da('0x4'));var path=require(_0x91da('0x5'));var ejs=require(_0x91da('0x6'));var fs=require('fs');var _=require(_0x91da('0x7'));var Redis=require(_0x91da('0x8'));var interaction=require(_0x91da('0x9'));var qs=require(_0x91da('0xa'));var pdf=require(_0x91da('0xb'));var logger=require(_0x91da('0xc'))(_0x91da('0xd'));var config=require(_0x91da('0xe'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x91da('0xf')](config[_0x91da('0x10')],{'host':_0x91da('0x11'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x91da('0x10')]));require(_0x91da('0x12'))[_0x91da('0x13')](socket);function respondWithStatusCode(_0x150fed,_0x4e32b7){_0x4e32b7=_0x4e32b7||0xcc;return function(_0x53b15e){if(_0x53b15e){return _0x150fed[_0x91da('0x14')](_0x4e32b7);}return _0x150fed['status'](_0x4e32b7)[_0x91da('0x15')]();};}function respondWithResult(_0x27d848,_0x4065cf){_0x4065cf=_0x4065cf||0xc8;return function(_0x317de7){if(_0x317de7){return _0x27d848[_0x91da('0x16')](_0x4065cf)[_0x91da('0x17')](_0x317de7);}};}function respondWithFilteredResult(_0x165488,_0x3c50e0){return function(_0x30c4a7){if(_0x30c4a7){var _0x1550b7=typeof _0x3c50e0['offset']===_0x91da('0x18')&&typeof _0x3c50e0['limit']===_0x91da('0x18');var _0x31ab44=_0x30c4a7['count'];var _0xaf2467=_0x1550b7?0x0:_0x3c50e0[_0x91da('0x19')];var _0x36c0c9=_0x1550b7?_0x30c4a7[_0x91da('0x1a')]:_0x3c50e0[_0x91da('0x19')]+_0x3c50e0[_0x91da('0x1b')];var _0x3c2593;if(_0x36c0c9>=_0x31ab44){_0x36c0c9=_0x31ab44;_0x3c2593=0xc8;}else{_0x3c2593=0xce;}_0x165488[_0x91da('0x16')](_0x3c2593);return _0x165488[_0x91da('0x1c')](_0x91da('0x1d'),_0xaf2467+'-'+_0x36c0c9+'/'+_0x31ab44)[_0x91da('0x17')](_0x30c4a7);}return null;};}function saveUpdates(_0x245a1a){return function(_0x1a43e5){if(_0x1a43e5){return _0x1a43e5[_0x91da('0x1e')](_0x245a1a)[_0x91da('0x1f')](function(_0xb96a2c){return _0xb96a2c;});}return null;};}function removeEntity(_0x5cdcc5){return function(_0x3feb6d){if(_0x3feb6d){return _0x3feb6d[_0x91da('0x20')]()['then'](function(){_0x5cdcc5[_0x91da('0x16')](0xcc)[_0x91da('0x15')]();});}};}function handleEntityNotFound(_0xdc38c8){return function(_0x57479e){if(!_0x57479e){_0xdc38c8[_0x91da('0x14')](0x194);}return _0x57479e;};}function handleError(_0x1936b6,_0x1f7d13){_0x1f7d13=_0x1f7d13||0x1f4;return function(_0x385325){logger[_0x91da('0x21')](_0x385325['stack']);if(_0x385325[_0x91da('0x22')]){delete _0x385325[_0x91da('0x22')];}_0x1936b6[_0x91da('0x16')](_0x1f7d13)[_0x91da('0x23')](_0x385325);};}exports[_0x91da('0x24')]=function(_0x95896c,_0xce169f){var _0xb34bf0={};var _0xc36654=_[_0x91da('0x25')](db[_0x91da('0x26')][_0x91da('0x27')],function(_0x3deb73){return{'name':_0x3deb73[_0x91da('0x28')],'type':_0x3deb73[_0x91da('0x29')][_0x91da('0x2a')]};});_0xb34bf0=qs[_0x91da('0x2b')](_0xc36654,_0x95896c);return interaction['findAll'](_0x91da('0x2c'),_0x95896c['query'],_0x95896c[_0x91da('0x2d')],_0xb34bf0,_0xc36654)['then'](respondWithFilteredResult(_0xce169f,_0xb34bf0))['catch'](handleError(_0xce169f,null));};exports[_0x91da('0x2e')]=function(_0x274c82,_0x74a4cf){var _0x5ebd61={'raw':![],'where':{'id':_0x274c82[_0x91da('0x2f')]['id']}},_0x18974a={};_0x18974a[_0x91da('0x30')]=_[_0x91da('0x31')](db[_0x91da('0x26')]['rawAttributes']);_0x18974a['query']=_[_0x91da('0x31')](_0x274c82[_0x91da('0x32')]);_0x18974a[_0x91da('0x33')]=_[_0x91da('0x34')](_0x18974a[_0x91da('0x30')],_0x18974a['query']);_0x5ebd61[_0x91da('0x35')]=_[_0x91da('0x34')](_0x18974a[_0x91da('0x30')],qs['fields'](_0x274c82[_0x91da('0x32')][_0x91da('0x36')]));_0x5ebd61['attributes']=_0x5ebd61['attributes'][_0x91da('0x37')]?_0x5ebd61[_0x91da('0x35')]:_0x18974a[_0x91da('0x30')];if(_0x274c82[_0x91da('0x32')][_0x91da('0x38')]){_0x5ebd61[_0x91da('0x39')]=[{'all':!![]}];}_0x5ebd61=_['merge']({},_0x5ebd61,_0x274c82[_0x91da('0x3a')]);return db[_0x91da('0x26')][_0x91da('0x3b')](_0x5ebd61)[_0x91da('0x1f')](handleEntityNotFound(_0x74a4cf,null))[_0x91da('0x1f')](respondWithResult(_0x74a4cf,null))[_0x91da('0x3c')](handleError(_0x74a4cf,null));};exports[_0x91da('0x3d')]=function(_0x44b892,_0x77a081){return db[_0x91da('0x26')]['create'](_0x44b892[_0x91da('0x3e')],{})[_0x91da('0x1f')](respondWithResult(_0x77a081,0xc9))[_0x91da('0x3c')](handleError(_0x77a081,null));};exports[_0x91da('0x1e')]=function(_0x80d95b,_0x375ef0){if(_0x80d95b['body']['id']){delete _0x80d95b['body']['id'];}return db[_0x91da('0x26')][_0x91da('0x3b')]({'where':{'id':_0x80d95b[_0x91da('0x2f')]['id']}})[_0x91da('0x1f')](handleEntityNotFound(_0x375ef0,null))[_0x91da('0x1f')](saveUpdates(_0x80d95b['body'],null))[_0x91da('0x1f')](respondWithResult(_0x375ef0,null))[_0x91da('0x3c')](handleError(_0x375ef0,null));};exports[_0x91da('0x20')]=function(_0x3b55a2,_0x454592){return db[_0x91da('0x26')][_0x91da('0x3b')]({'where':{'id':_0x3b55a2[_0x91da('0x2f')]['id']}})[_0x91da('0x1f')](handleEntityNotFound(_0x454592,null))[_0x91da('0x1f')](removeEntity(_0x454592,null))['catch'](handleError(_0x454592,null));};exports['describe']=function(_0x163870,_0x37d06d){return db[_0x91da('0x26')][_0x91da('0x3f')]()[_0x91da('0x1f')](respondWithResult(_0x37d06d,null))[_0x91da('0x3c')](handleError(_0x37d06d,null));};exports[_0x91da('0x40')]=function(_0x56f5c1,_0xd64965){return db[_0x91da('0x41')][_0x91da('0x3b')]({'where':{'id':_0x56f5c1['params']['id']}})[_0x91da('0x1f')](handleEntityNotFound(_0xd64965,null))[_0x91da('0x1f')](function(_0xc46b7d){if(_0xc46b7d){return _0xc46b7d[_0x91da('0x40')](_0x56f5c1[_0x91da('0x3e')][_0x91da('0x42')],_['omit'](_0x56f5c1[_0x91da('0x3e')],[_0x91da('0x42'),'id'])||{});}})[_0x91da('0x1f')](respondWithResult(_0xd64965,null))[_0x91da('0x3c')](handleError(_0xd64965,null));};exports[_0x91da('0x43')]=function(_0x347e9a,_0x5b6d21){var _0x201052={'raw':![],'where':{}};var _0x3de842={};var _0x28f643={'count':0x0,'rows':[]};return db[_0x91da('0x26')][_0x91da('0x44')]({'where':{'id':_0x347e9a['params']['id']}})['then'](handleEntityNotFound(_0x5b6d21,null))['then'](function(_0x20b908){if(_0x20b908){_0x3de842[_0x91da('0x30')]=_[_0x91da('0x31')](db[_0x91da('0x41')][_0x91da('0x27')]);_0x3de842[_0x91da('0x32')]=_[_0x91da('0x31')](_0x347e9a[_0x91da('0x32')]);_0x3de842[_0x91da('0x33')]=_['intersection'](_0x3de842[_0x91da('0x30')],_0x3de842[_0x91da('0x32')]);_0x201052[_0x91da('0x35')]=_['intersection'](_0x3de842['model'],qs[_0x91da('0x36')](_0x347e9a[_0x91da('0x32')][_0x91da('0x36')]));_0x201052[_0x91da('0x35')]=_0x201052[_0x91da('0x35')]['length']?_0x201052[_0x91da('0x35')]:_0x3de842[_0x91da('0x30')];if(!_0x347e9a['query'][_0x91da('0x45')]('nolimit')){_0x201052[_0x91da('0x1b')]=qs[_0x91da('0x1b')](_0x347e9a[_0x91da('0x32')]['limit']);_0x201052[_0x91da('0x19')]=qs[_0x91da('0x19')](_0x347e9a[_0x91da('0x32')][_0x91da('0x19')]);}_0x201052['order']=qs[_0x91da('0x46')](_0x347e9a[_0x91da('0x32')]['sort']);_0x201052['where']=qs[_0x91da('0x33')](_[_0x91da('0x47')](_0x347e9a[_0x91da('0x32')],_0x3de842[_0x91da('0x33')]));_0x201052[_0x91da('0x48')][_0x91da('0x49')]=_0x20b908['id'];if(_0x347e9a['query'][_0x91da('0x4a')]){_0x201052[_0x91da('0x48')]=_[_0x91da('0x4b')](_0x201052['where'],{'$or':_[_0x91da('0x25')](_0x201052[_0x91da('0x35')],function(_0x4b1785){var _0x38d28f={};_0x38d28f[_0x4b1785]={'$like':'%'+_0x347e9a[_0x91da('0x32')][_0x91da('0x4a')]+'%'};return _0x38d28f;})});}if(_0x347e9a[_0x91da('0x32')][_0x91da('0x4c')]){var _0x3e89fa=_0x347e9a[_0x91da('0x32')]['$gte'][_0x91da('0x4d')](',');var _0x53a521={};_0x53a521[_0x3e89fa[0x0]]={'$gte':moment(_0x3e89fa[0x1])[_0x91da('0x4e')](_0x91da('0x4f'))};_0x201052[_0x91da('0x48')]=_[_0x91da('0x4b')](_0x201052[_0x91da('0x48')],_0x53a521);}_0x201052=_[_0x91da('0x4b')]({},_0x201052,_0x347e9a['options']);return db['SmsMessage'][_0x91da('0x1a')]({'where':_0x201052[_0x91da('0x48')]})[_0x91da('0x1f')](function(_0x790335){_0x28f643[_0x91da('0x1a')]=_0x790335;if(_0x347e9a['query'][_0x91da('0x38')]){_0x201052[_0x91da('0x39')]=[{'all':!![]}];}return db[_0x91da('0x41')][_0x91da('0x50')](_0x201052);})[_0x91da('0x1f')](function(_0x560333){_0x28f643[_0x91da('0x51')]=_0x560333;return _0x28f643;});}})['then'](respondWithFilteredResult(_0x5b6d21,_0x201052))[_0x91da('0x3c')](handleError(_0x5b6d21,null));};exports[_0x91da('0x52')]=function(_0x5981f6,_0x4c5111){return db[_0x91da('0x26')][_0x91da('0x3b')]({'where':{'id':_0x5981f6[_0x91da('0x2f')]['id']}})[_0x91da('0x1f')](handleEntityNotFound(_0x4c5111,null))[_0x91da('0x1f')](function(_0x45b17d){if(_0x45b17d){return _0x45b17d[_0x91da('0x53')](_0x5981f6[_0x91da('0x3e')][_0x91da('0x42')],_[_0x91da('0x54')](_0x5981f6[_0x91da('0x3e')],[_0x91da('0x42'),'id'])||{})[_0x91da('0x55')](function(){return db[_0x91da('0x56')][_0x91da('0x50')]({'attributes':['id','name',_0x91da('0x57')],'where':{'id':_0x5981f6[_0x91da('0x3e')][_0x91da('0x42')]}});})[_0x91da('0x1f')](function(_0x5efde5){socket['emit']('smsInteractionTags:save',{'id':Number(_0x5981f6[_0x91da('0x2f')]['id']),'tags':_0x5efde5||[]});return{'id':Number(_0x5981f6['params']['id']),'tags':_0x5efde5||[]};});}})['then'](respondWithResult(_0x4c5111,null))['catch'](handleError(_0x4c5111,null));};exports[_0x91da('0x58')]=function(_0x6354fd,_0x2c2052){return db[_0x91da('0x26')]['find']({'where':{'id':_0x6354fd[_0x91da('0x2f')]['id']}})[_0x91da('0x1f')](handleEntityNotFound(_0x2c2052,null))[_0x91da('0x1f')](function(_0xa9a7a9){if(_0xa9a7a9){return _0xa9a7a9[_0x91da('0x58')](_0x6354fd[_0x91da('0x32')][_0x91da('0x42')]);}})[_0x91da('0x1f')](respondWithStatusCode(_0x2c2052,null))[_0x91da('0x3c')](handleError(_0x2c2052,null));};exports[_0x91da('0x59')]=function(_0x18158c,_0x144dbf){var _0x1e30f6=moment()['unix']()[_0x91da('0x5a')]();var _0x3efbb5=path[_0x91da('0x5b')](config['root'],'server',_0x91da('0x5c'),_0x91da('0x5d'));var _0xef8661=path['join'](_0x3efbb5,_0x1e30f6);var _0x30baad=util[_0x91da('0x4e')](_0x91da('0x5e'),_0x18158c['params']['id'],_0x1e30f6);var _0x2de14d=path[_0x91da('0x5b')](_0x3efbb5,_0x30baad);var _0x4e5610=[];_0x4e5610[_0x91da('0x5f')]({'model':db['User'],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x4e5610[_0x91da('0x5f')]({'model':db['CmContact'],'as':_0x91da('0x60'),'attributes':['id',_0x91da('0x61'),'lastName'],'raw':!![]});var _0xb35925=[{'model':db['SmsMessage'],'as':_0x91da('0x62'),'attributes':['id',_0x91da('0x3e'),_0x91da('0x63'),_0x91da('0x64'),_0x91da('0x65'),_0x91da('0x66')],'include':_0x4e5610}];_0xb35925[_0x91da('0x5f')]({'model':db[_0x91da('0x67')],'as':_0x91da('0x68'),'attributes':['id',_0x91da('0x22')]});_0xb35925['push']({'model':db[_0x91da('0x69')],'as':_0x91da('0x6a'),'attributes':['id',_0x91da('0x6b')]});return db[_0x91da('0x26')]['find']({'where':{'id':_0x18158c[_0x91da('0x2f')]['id']},'include':_0xb35925})[_0x91da('0x1f')](handleEntityNotFound(_0x144dbf,null))[_0x91da('0x1f')](function(_0x3b8789){if(_0x3b8789){var _0x15a3e3=_0x3b8789[_0x91da('0x6c')]({'plain':!![]});fs['mkdirSync'](_0xef8661);var _0x37635f={'channel':_0x91da('0x6d'),'account':_0x15a3e3[_0x91da('0x68')][_0x91da('0x22')],'agent':_0x15a3e3[_0x91da('0x6a')]?_0x15a3e3[_0x91da('0x6a')][_0x91da('0x6b')]:_0x91da('0x6e'),'createdAt':moment(_0x15a3e3[_0x91da('0x63')])[_0x91da('0x4e')](_0x91da('0x4f'))[_0x91da('0x5a')](),'closedAt':_0x15a3e3[_0x91da('0x6f')]?moment(_0x15a3e3[_0x91da('0x70')])[_0x91da('0x4e')](_0x91da('0x4f'))[_0x91da('0x5a')]():'','disposition':_0x15a3e3[_0x91da('0x71')],'messages':_(_0x15a3e3['Messages'])['filter']({'secret':![]})[_0x91da('0x25')](function(_0x3a9361){return{'date':moment(_0x3a9361[_0x91da('0x63')])[_0x91da('0x4e')](_0x91da('0x4f'))[_0x91da('0x5a')](),'sender':_0x3a9361[_0x91da('0x64')]==='out'?_0x3a9361['User']?_0x3a9361[_0x91da('0x69')]['fullname']:_0x91da('0x72'):_0x3a9361[_0x91da('0x60')][_0x91da('0x61')]+(_0x3a9361[_0x91da('0x60')][_0x91da('0x73')]?'\x20'+_0x3a9361[_0x91da('0x60')]['lastName']:''),'body':_0x3a9361[_0x91da('0x3e')],'direction':_0x3a9361[_0x91da('0x64')]===_0x91da('0x74')?'A':'C','secret':_0x3a9361[_0x91da('0x65')],'read':_0x3a9361[_0x91da('0x66')]};})[_0x91da('0x75')]()};return ejs['renderFile'](path['join'](config['root'],_0x91da('0x76'),_0x91da('0x77'),_0x91da('0x78')),{'interaction':_0x37635f})['then'](function(_0x559064){var _0x176823=path[_0x91da('0x5b')](_0xef8661,'transcript-'+_0x15a3e3['id']+'-'+_0x1e30f6+_0x91da('0x79'));var _0x437ff8={'path':_0x176823,'channel':_0x91da('0x6d'),'interactionId':_0x15a3e3['id']};return pdf[_0x91da('0x7a')](_0x559064,_0x437ff8);})['then'](function(){return new BPromise(function(_0x5e1866,_0x5050a4){zipdir(_0xef8661,{'saveTo':_0x2de14d},function(_0x71f74b,_0x1d28b5){if(_0x71f74b)return _0x5050a4(_0x71f74b);return _0x5e1866(_0x1d28b5);});})['then'](function(){return new BPromise(function(_0x3a4405,_0x2ea50d){rimraf(_0xef8661,function(_0x2ef24f){if(_0x2ef24f)_0x2ea50d(_0x2ef24f);return _0x3a4405();});});})['then'](function(){return _0x144dbf[_0x91da('0x59')](_0x2de14d,_0x30baad,function(_0x171b84){if(_0x171b84){console[_0x91da('0x7b')](_0x91da('0x7c'),_0x171b84);}else{fs[_0x91da('0x7d')](_0x2de14d);}});});});}else{return _0x144dbf[_0x91da('0x14')](0xc8);}})['catch'](handleError(_0x144dbf,null));}; \ No newline at end of file +var _0xa2d7=['include','merge','options','create','body','find','describe','addMessage','SmsMessage','ids','omit','findOne','hasOwnProperty','order','sort','where','map','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','spread','Tag','color','emit','removeTags','download','toString','join','root','server','tmp','transcript-%d-%s.zip','push','User','fullname','CmContact','firstName','Messages','createdAt','direction','secret','read','SmsAccount','Account','Owner','get','Sms','closed','closedAt','disposition','System','Contact','lastName','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','log','unlinkSync','sendStatus','rimraf','zip-dir','moment','bluebird','path','ejs','lodash','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','end','status','json','undefined','limit','count','offset','set','update','destroy','then','stack','name','send','index','SmsInteraction','rawAttributes','fieldName','type','key','findAll','sms','query','user','catch','show','params','model','keys','filters','intersection','attributes','fields','length','includeAll'];(function(_0x2bec7d,_0x52d669){var _0x82ab7e=function(_0x340057){while(--_0x340057){_0x2bec7d['push'](_0x2bec7d['shift']());}};_0x82ab7e(++_0x52d669);}(_0xa2d7,0xbb));var _0x7a2d=function(_0x5c5258,_0x3c93df){_0x5c5258=_0x5c5258-0x0;var _0x1c10be=_0xa2d7[_0x5c5258];return _0x1c10be;};'use strict';var rimraf=require(_0x7a2d('0x0'));var zipdir=require(_0x7a2d('0x1'));var moment=require(_0x7a2d('0x2'));var BPromise=require(_0x7a2d('0x3'));var util=require('util');var path=require(_0x7a2d('0x4'));var ejs=require(_0x7a2d('0x5'));var fs=require('fs');var _=require(_0x7a2d('0x6'));var Redis=require(_0x7a2d('0x7'));var interaction=require('../../components/interaction/service');var qs=require(_0x7a2d('0x8'));var pdf=require(_0x7a2d('0x9'));var logger=require(_0x7a2d('0xa'))('api');var config=require(_0x7a2d('0xb'));var db=require(_0x7a2d('0xc'))['db'];config[_0x7a2d('0xd')]=_[_0x7a2d('0xe')](config['redis'],{'host':_0x7a2d('0xf'),'port':0x18eb});var socket=require(_0x7a2d('0x10'))(new Redis(config[_0x7a2d('0xd')]));require('./smsInteraction.socket')[_0x7a2d('0x11')](socket);function respondWithStatusCode(_0x37b20a,_0x4ce16d){_0x4ce16d=_0x4ce16d||0xcc;return function(_0x4d36d1){if(_0x4d36d1){return _0x37b20a['sendStatus'](_0x4ce16d);}return _0x37b20a['status'](_0x4ce16d)[_0x7a2d('0x12')]();};}function respondWithResult(_0x5cb01f,_0x3e985b){_0x3e985b=_0x3e985b||0xc8;return function(_0x47afc3){if(_0x47afc3){return _0x5cb01f[_0x7a2d('0x13')](_0x3e985b)[_0x7a2d('0x14')](_0x47afc3);}};}function respondWithFilteredResult(_0x17cdb3,_0xde395f){return function(_0x23bb2b){if(_0x23bb2b){var _0x148286=typeof _0xde395f['offset']===_0x7a2d('0x15')&&typeof _0xde395f[_0x7a2d('0x16')]===_0x7a2d('0x15');var _0x28decd=_0x23bb2b[_0x7a2d('0x17')];var _0x523d09=_0x148286?0x0:_0xde395f[_0x7a2d('0x18')];var _0x312216=_0x148286?_0x23bb2b[_0x7a2d('0x17')]:_0xde395f[_0x7a2d('0x18')]+_0xde395f[_0x7a2d('0x16')];var _0xba0e71;if(_0x312216>=_0x28decd){_0x312216=_0x28decd;_0xba0e71=0xc8;}else{_0xba0e71=0xce;}_0x17cdb3['status'](_0xba0e71);return _0x17cdb3[_0x7a2d('0x19')]('Content-Range',_0x523d09+'-'+_0x312216+'/'+_0x28decd)[_0x7a2d('0x14')](_0x23bb2b);}return null;};}function saveUpdates(_0x2e4a90){return function(_0x2f6eb8){if(_0x2f6eb8){return _0x2f6eb8[_0x7a2d('0x1a')](_0x2e4a90)['then'](function(_0x22b495){return _0x22b495;});}return null;};}function removeEntity(_0x3d15a6){return function(_0x185056){if(_0x185056){return _0x185056[_0x7a2d('0x1b')]()[_0x7a2d('0x1c')](function(){_0x3d15a6[_0x7a2d('0x13')](0xcc)[_0x7a2d('0x12')]();});}};}function handleEntityNotFound(_0x4b4388){return function(_0x3537dc){if(!_0x3537dc){_0x4b4388['sendStatus'](0x194);}return _0x3537dc;};}function handleError(_0x4fee17,_0x24bc61){_0x24bc61=_0x24bc61||0x1f4;return function(_0x5030d0){logger['error'](_0x5030d0[_0x7a2d('0x1d')]);if(_0x5030d0[_0x7a2d('0x1e')]){delete _0x5030d0[_0x7a2d('0x1e')];}_0x4fee17[_0x7a2d('0x13')](_0x24bc61)[_0x7a2d('0x1f')](_0x5030d0);};}exports[_0x7a2d('0x20')]=function(_0x39da55,_0x1ab6f7){var _0x529b6b={};var _0x387038=_['map'](db[_0x7a2d('0x21')][_0x7a2d('0x22')],function(_0x25dc7a){return{'name':_0x25dc7a[_0x7a2d('0x23')],'type':_0x25dc7a[_0x7a2d('0x24')][_0x7a2d('0x25')]};});_0x529b6b=qs['getOptions'](_0x387038,_0x39da55);return interaction[_0x7a2d('0x26')](_0x7a2d('0x27'),_0x39da55[_0x7a2d('0x28')],_0x39da55[_0x7a2d('0x29')],_0x529b6b,_0x387038)[_0x7a2d('0x1c')](respondWithFilteredResult(_0x1ab6f7,_0x529b6b))[_0x7a2d('0x2a')](handleError(_0x1ab6f7,null));};exports[_0x7a2d('0x2b')]=function(_0x4ded81,_0x41ecaa){var _0xd9222d={'raw':![],'where':{'id':_0x4ded81[_0x7a2d('0x2c')]['id']}},_0x5d449e={};_0x5d449e[_0x7a2d('0x2d')]=_['keys'](db[_0x7a2d('0x21')]['rawAttributes']);_0x5d449e[_0x7a2d('0x28')]=_[_0x7a2d('0x2e')](_0x4ded81['query']);_0x5d449e[_0x7a2d('0x2f')]=_[_0x7a2d('0x30')](_0x5d449e['model'],_0x5d449e['query']);_0xd9222d[_0x7a2d('0x31')]=_[_0x7a2d('0x30')](_0x5d449e['model'],qs[_0x7a2d('0x32')](_0x4ded81[_0x7a2d('0x28')][_0x7a2d('0x32')]));_0xd9222d[_0x7a2d('0x31')]=_0xd9222d[_0x7a2d('0x31')][_0x7a2d('0x33')]?_0xd9222d[_0x7a2d('0x31')]:_0x5d449e[_0x7a2d('0x2d')];if(_0x4ded81[_0x7a2d('0x28')][_0x7a2d('0x34')]){_0xd9222d[_0x7a2d('0x35')]=[{'all':!![]}];}_0xd9222d=_[_0x7a2d('0x36')]({},_0xd9222d,_0x4ded81[_0x7a2d('0x37')]);return db['SmsInteraction']['find'](_0xd9222d)[_0x7a2d('0x1c')](handleEntityNotFound(_0x41ecaa,null))[_0x7a2d('0x1c')](respondWithResult(_0x41ecaa,null))['catch'](handleError(_0x41ecaa,null));};exports[_0x7a2d('0x38')]=function(_0x23313c,_0x2812e2){return db['SmsInteraction'][_0x7a2d('0x38')](_0x23313c['body'],{})[_0x7a2d('0x1c')](respondWithResult(_0x2812e2,0xc9))[_0x7a2d('0x2a')](handleError(_0x2812e2,null));};exports[_0x7a2d('0x1a')]=function(_0x4380cb,_0x17d174){if(_0x4380cb[_0x7a2d('0x39')]['id']){delete _0x4380cb[_0x7a2d('0x39')]['id'];}return db[_0x7a2d('0x21')]['find']({'where':{'id':_0x4380cb[_0x7a2d('0x2c')]['id']}})['then'](handleEntityNotFound(_0x17d174,null))[_0x7a2d('0x1c')](saveUpdates(_0x4380cb[_0x7a2d('0x39')],null))[_0x7a2d('0x1c')](respondWithResult(_0x17d174,null))['catch'](handleError(_0x17d174,null));};exports[_0x7a2d('0x1b')]=function(_0x3e022a,_0x1c4f46){return db[_0x7a2d('0x21')][_0x7a2d('0x3a')]({'where':{'id':_0x3e022a[_0x7a2d('0x2c')]['id']}})[_0x7a2d('0x1c')](handleEntityNotFound(_0x1c4f46,null))[_0x7a2d('0x1c')](removeEntity(_0x1c4f46,null))['catch'](handleError(_0x1c4f46,null));};exports[_0x7a2d('0x3b')]=function(_0x17f987,_0x4d7352){return db['SmsInteraction'][_0x7a2d('0x3b')]()['then'](respondWithResult(_0x4d7352,null))[_0x7a2d('0x2a')](handleError(_0x4d7352,null));};exports[_0x7a2d('0x3c')]=function(_0x2b1d3c,_0x5bf3ba){return db[_0x7a2d('0x3d')][_0x7a2d('0x3a')]({'where':{'id':_0x2b1d3c[_0x7a2d('0x2c')]['id']}})['then'](handleEntityNotFound(_0x5bf3ba,null))[_0x7a2d('0x1c')](function(_0x422b71){if(_0x422b71){return _0x422b71[_0x7a2d('0x3c')](_0x2b1d3c[_0x7a2d('0x39')][_0x7a2d('0x3e')],_[_0x7a2d('0x3f')](_0x2b1d3c[_0x7a2d('0x39')],[_0x7a2d('0x3e'),'id'])||{});}})[_0x7a2d('0x1c')](respondWithResult(_0x5bf3ba,null))[_0x7a2d('0x2a')](handleError(_0x5bf3ba,null));};exports['getMessages']=function(_0x11f50b,_0x44c705){var _0x42eef3={'raw':![],'where':{}};var _0x39c36b={};var _0xc4bdbe={'count':0x0,'rows':[]};return db['SmsInteraction'][_0x7a2d('0x40')]({'where':{'id':_0x11f50b[_0x7a2d('0x2c')]['id']}})[_0x7a2d('0x1c')](handleEntityNotFound(_0x44c705,null))[_0x7a2d('0x1c')](function(_0xa038eb){if(_0xa038eb){_0x39c36b[_0x7a2d('0x2d')]=_[_0x7a2d('0x2e')](db[_0x7a2d('0x3d')][_0x7a2d('0x22')]);_0x39c36b[_0x7a2d('0x28')]=_[_0x7a2d('0x2e')](_0x11f50b[_0x7a2d('0x28')]);_0x39c36b[_0x7a2d('0x2f')]=_[_0x7a2d('0x30')](_0x39c36b[_0x7a2d('0x2d')],_0x39c36b[_0x7a2d('0x28')]);_0x42eef3[_0x7a2d('0x31')]=_[_0x7a2d('0x30')](_0x39c36b[_0x7a2d('0x2d')],qs['fields'](_0x11f50b['query'][_0x7a2d('0x32')]));_0x42eef3[_0x7a2d('0x31')]=_0x42eef3[_0x7a2d('0x31')][_0x7a2d('0x33')]?_0x42eef3[_0x7a2d('0x31')]:_0x39c36b[_0x7a2d('0x2d')];if(!_0x11f50b['query'][_0x7a2d('0x41')]('nolimit')){_0x42eef3[_0x7a2d('0x16')]=qs[_0x7a2d('0x16')](_0x11f50b['query']['limit']);_0x42eef3['offset']=qs['offset'](_0x11f50b[_0x7a2d('0x28')][_0x7a2d('0x18')]);}_0x42eef3[_0x7a2d('0x42')]=qs[_0x7a2d('0x43')](_0x11f50b['query'][_0x7a2d('0x43')]);_0x42eef3[_0x7a2d('0x44')]=qs[_0x7a2d('0x2f')](_['pick'](_0x11f50b[_0x7a2d('0x28')],_0x39c36b[_0x7a2d('0x2f')]));_0x42eef3[_0x7a2d('0x44')]['SmsInteractionId']=_0xa038eb['id'];if(_0x11f50b[_0x7a2d('0x28')]['filter']){_0x42eef3['where']=_[_0x7a2d('0x36')](_0x42eef3[_0x7a2d('0x44')],{'$or':_[_0x7a2d('0x45')](_0x42eef3[_0x7a2d('0x31')],function(_0x5dac45){var _0x10ef3d={};_0x10ef3d[_0x5dac45]={'$like':'%'+_0x11f50b[_0x7a2d('0x28')][_0x7a2d('0x46')]+'%'};return _0x10ef3d;})});}if(_0x11f50b[_0x7a2d('0x28')][_0x7a2d('0x47')]){var _0x33c4ba=_0x11f50b[_0x7a2d('0x28')][_0x7a2d('0x47')][_0x7a2d('0x48')](',');var _0x4151f3={};_0x4151f3[_0x33c4ba[0x0]]={'$gte':moment(_0x33c4ba[0x1])[_0x7a2d('0x49')](_0x7a2d('0x4a'))};_0x42eef3[_0x7a2d('0x44')]=_[_0x7a2d('0x36')](_0x42eef3[_0x7a2d('0x44')],_0x4151f3);}_0x42eef3=_['merge']({},_0x42eef3,_0x11f50b[_0x7a2d('0x37')]);return db['SmsMessage'][_0x7a2d('0x17')]({'where':_0x42eef3[_0x7a2d('0x44')]})['then'](function(_0x4f8d54){_0xc4bdbe['count']=_0x4f8d54;if(_0x11f50b[_0x7a2d('0x28')][_0x7a2d('0x34')]){_0x42eef3[_0x7a2d('0x35')]=[{'all':!![]}];}return db[_0x7a2d('0x3d')]['findAll'](_0x42eef3);})[_0x7a2d('0x1c')](function(_0x23fa8f){_0xc4bdbe[_0x7a2d('0x4b')]=_0x23fa8f;return _0xc4bdbe;});}})[_0x7a2d('0x1c')](respondWithFilteredResult(_0x44c705,_0x42eef3))[_0x7a2d('0x2a')](handleError(_0x44c705,null));};exports[_0x7a2d('0x4c')]=function(_0x45ce06,_0x29af16){return db[_0x7a2d('0x21')][_0x7a2d('0x3a')]({'where':{'id':_0x45ce06[_0x7a2d('0x2c')]['id']}})[_0x7a2d('0x1c')](handleEntityNotFound(_0x29af16,null))[_0x7a2d('0x1c')](function(_0x51a030){if(_0x51a030){return _0x51a030[_0x7a2d('0x4d')](_0x45ce06[_0x7a2d('0x39')][_0x7a2d('0x3e')],_[_0x7a2d('0x3f')](_0x45ce06[_0x7a2d('0x39')],[_0x7a2d('0x3e'),'id'])||{})[_0x7a2d('0x4e')](function(){return db[_0x7a2d('0x4f')][_0x7a2d('0x26')]({'attributes':['id','name',_0x7a2d('0x50')],'where':{'id':_0x45ce06['body'][_0x7a2d('0x3e')]}});})[_0x7a2d('0x1c')](function(_0x3e5349){socket[_0x7a2d('0x51')]('smsInteractionTags:save',{'id':Number(_0x45ce06[_0x7a2d('0x2c')]['id']),'tags':_0x3e5349||[]});return{'id':Number(_0x45ce06[_0x7a2d('0x2c')]['id']),'tags':_0x3e5349||[]};});}})[_0x7a2d('0x1c')](respondWithResult(_0x29af16,null))[_0x7a2d('0x2a')](handleError(_0x29af16,null));};exports[_0x7a2d('0x52')]=function(_0x33bef1,_0x31ea49){return db['SmsInteraction'][_0x7a2d('0x3a')]({'where':{'id':_0x33bef1[_0x7a2d('0x2c')]['id']}})[_0x7a2d('0x1c')](handleEntityNotFound(_0x31ea49,null))[_0x7a2d('0x1c')](function(_0x9a5188){if(_0x9a5188){return _0x9a5188[_0x7a2d('0x52')](_0x33bef1[_0x7a2d('0x28')]['ids']);}})['then'](respondWithStatusCode(_0x31ea49,null))['catch'](handleError(_0x31ea49,null));};exports[_0x7a2d('0x53')]=function(_0x54decb,_0x34c452){var _0x47bf8d=moment()['unix']()[_0x7a2d('0x54')]();var _0x3e9568=path[_0x7a2d('0x55')](config[_0x7a2d('0x56')],_0x7a2d('0x57'),'files',_0x7a2d('0x58'));var _0x463cab=path[_0x7a2d('0x55')](_0x3e9568,_0x47bf8d);var _0x4329ed=util[_0x7a2d('0x49')](_0x7a2d('0x59'),_0x54decb['params']['id'],_0x47bf8d);var _0x30872c=path[_0x7a2d('0x55')](_0x3e9568,_0x4329ed);var _0x4d4237=[];_0x4d4237[_0x7a2d('0x5a')]({'model':db[_0x7a2d('0x5b')],'as':'User','attributes':['id',_0x7a2d('0x5c')],'raw':!![]});_0x4d4237[_0x7a2d('0x5a')]({'model':db[_0x7a2d('0x5d')],'as':'Contact','attributes':['id',_0x7a2d('0x5e'),'lastName'],'raw':!![]});var _0x4caef6=[{'model':db[_0x7a2d('0x3d')],'as':_0x7a2d('0x5f'),'attributes':['id',_0x7a2d('0x39'),_0x7a2d('0x60'),_0x7a2d('0x61'),_0x7a2d('0x62'),_0x7a2d('0x63')],'include':_0x4d4237}];_0x4caef6[_0x7a2d('0x5a')]({'model':db[_0x7a2d('0x64')],'as':_0x7a2d('0x65'),'attributes':['id',_0x7a2d('0x1e')]});_0x4caef6['push']({'model':db['User'],'as':_0x7a2d('0x66'),'attributes':['id','fullname']});return db[_0x7a2d('0x21')][_0x7a2d('0x3a')]({'where':{'id':_0x54decb[_0x7a2d('0x2c')]['id']},'include':_0x4caef6})[_0x7a2d('0x1c')](handleEntityNotFound(_0x34c452,null))[_0x7a2d('0x1c')](function(_0x33164f){if(_0x33164f){var _0x441e0c=_0x33164f[_0x7a2d('0x67')]({'plain':!![]});fs['mkdirSync'](_0x463cab);var _0x362b71={'channel':_0x7a2d('0x68'),'account':_0x441e0c[_0x7a2d('0x65')][_0x7a2d('0x1e')],'agent':_0x441e0c[_0x7a2d('0x66')]?_0x441e0c[_0x7a2d('0x66')][_0x7a2d('0x5c')]:'N.A.','createdAt':moment(_0x441e0c['createdAt'])[_0x7a2d('0x49')](_0x7a2d('0x4a'))['toString'](),'closedAt':_0x441e0c[_0x7a2d('0x69')]?moment(_0x441e0c[_0x7a2d('0x6a')])[_0x7a2d('0x49')](_0x7a2d('0x4a'))['toString']():'','disposition':_0x441e0c[_0x7a2d('0x6b')],'messages':_(_0x441e0c['Messages'])['filter']({'secret':![]})[_0x7a2d('0x45')](function(_0x1d8b54){return{'date':moment(_0x1d8b54['createdAt'])[_0x7a2d('0x49')](_0x7a2d('0x4a'))[_0x7a2d('0x54')](),'sender':_0x1d8b54[_0x7a2d('0x61')]==='out'?_0x1d8b54[_0x7a2d('0x5b')]?_0x1d8b54[_0x7a2d('0x5b')][_0x7a2d('0x5c')]:_0x7a2d('0x6c'):_0x1d8b54['Contact'][_0x7a2d('0x5e')]+(_0x1d8b54[_0x7a2d('0x6d')][_0x7a2d('0x6e')]?'\x20'+_0x1d8b54[_0x7a2d('0x6d')][_0x7a2d('0x6e')]:''),'body':_0x1d8b54[_0x7a2d('0x39')],'direction':_0x1d8b54[_0x7a2d('0x61')]==='out'?'A':'C','secret':_0x1d8b54[_0x7a2d('0x62')],'read':_0x1d8b54[_0x7a2d('0x63')]};})[_0x7a2d('0x6f')]()};return ejs[_0x7a2d('0x70')](path['join'](config[_0x7a2d('0x56')],_0x7a2d('0x57'),_0x7a2d('0x71'),_0x7a2d('0x72')),{'interaction':_0x362b71})[_0x7a2d('0x1c')](function(_0x12d719){var _0x4cb555=path['join'](_0x463cab,_0x7a2d('0x73')+_0x441e0c['id']+'-'+_0x47bf8d+_0x7a2d('0x74'));var _0xf174e={'path':_0x4cb555,'channel':_0x7a2d('0x68'),'interactionId':_0x441e0c['id']};return pdf['createPdfFromHTML'](_0x12d719,_0xf174e);})[_0x7a2d('0x1c')](function(){return new BPromise(function(_0x52f929,_0x3bf8c9){zipdir(_0x463cab,{'saveTo':_0x30872c},function(_0x1b7187,_0x1c8ee2){if(_0x1b7187)return _0x3bf8c9(_0x1b7187);return _0x52f929(_0x1c8ee2);});})[_0x7a2d('0x1c')](function(){return new BPromise(function(_0x43e954,_0x565422){rimraf(_0x463cab,function(_0x38a31f){if(_0x38a31f)_0x565422(_0x38a31f);return _0x43e954();});});})[_0x7a2d('0x1c')](function(){return _0x34c452[_0x7a2d('0x53')](_0x30872c,_0x4329ed,function(_0x1ed624){if(_0x1ed624){console[_0x7a2d('0x75')]('err',_0x1ed624);}else{fs[_0x7a2d('0x76')](_0x30872c);}});});});}else{return _0x34c452[_0x7a2d('0x77')](0xc8);}})[_0x7a2d('0x2a')](handleError(_0x34c452,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index cafe289..a8af92b 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 _0xfb11=['setMaxListeners','update','getUsers','setDataValue','Users','map','findAll','then','unreadMessages','emit','catch','hook','exports','events','SmsInteraction','../../mysqldb'];(function(_0x1bf809,_0x536f55){var _0x1caa4e=function(_0x9f9636){while(--_0x9f9636){_0x1bf809['push'](_0x1bf809['shift']());}};_0x1caa4e(++_0x536f55);}(_0xfb11,0x1ad));var _0x1fb1=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xfb11[_0x3b5250];return _0xc844a1;};'use strict';var EventEmitter=require(_0x1fb1('0x0'));var SmsInteraction=require('../../mysqldb')['db'][_0x1fb1('0x1')];var SmsMessage=require(_0x1fb1('0x2'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x1fb1('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1fb1('0x4'),'afterDestroy':'remove'};function emitEvent(_0x190f74){return function(_0x2ae20f,_0x5af469,_0x25d44f){_0x2ae20f[_0x1fb1('0x5')]({'attributes':['id'],'raw':!![]})['then'](function(_0x1859da){_0x2ae20f[_0x1fb1('0x6')](_0x1fb1('0x7'),_0x1859da[_0x1fb1('0x8')](function(_0x161e1b){return{'id':_0x161e1b['id']};}));return SmsMessage[_0x1fb1('0x9')]({'where':{'SmsInteractionId':_0x2ae20f['id'],'direction':'in','read':![]},'raw':!![]});})[_0x1fb1('0xa')](function(_0x416625){_0x2ae20f[_0x1fb1('0x6')](_0x1fb1('0xb'),_0x416625['length']);SmsInteractionEvents[_0x1fb1('0xc')](_0x190f74+':'+_0x2ae20f['id'],_0x2ae20f);SmsInteractionEvents['emit'](_0x190f74,_0x2ae20f);_0x25d44f(null);})[_0x1fb1('0xd')](_0x25d44f(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0x1fb1('0xe')](e,emitEvent(event));}}module[_0x1fb1('0xf')]=SmsInteractionEvents; \ No newline at end of file +var _0x2032=['Users','map','unreadMessages','length','emit','hasOwnProperty','exports','../../mysqldb','SmsInteraction','setMaxListeners','save','remove','getUsers','then','setDataValue'];(function(_0x17928f,_0x4ad33f){var _0x500b63=function(_0x127644){while(--_0x127644){_0x17928f['push'](_0x17928f['shift']());}};_0x500b63(++_0x4ad33f);}(_0x2032,0xd9));var _0x2203=function(_0x1e23eb,_0x3e2e45){_0x1e23eb=_0x1e23eb-0x0;var _0x33a30d=_0x2032[_0x1e23eb];return _0x33a30d;};'use strict';var EventEmitter=require('events');var SmsInteraction=require(_0x2203('0x0'))['db'][_0x2203('0x1')];var SmsMessage=require(_0x2203('0x0'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x2203('0x2')](0x0);var events={'afterCreate':_0x2203('0x3'),'afterUpdate':'update','afterDestroy':_0x2203('0x4')};function emitEvent(_0x880dcd){return function(_0x44ccfd,_0x201796,_0x3f7ba1){_0x44ccfd[_0x2203('0x5')]({'attributes':['id'],'raw':!![]})[_0x2203('0x6')](function(_0x2676aa){_0x44ccfd[_0x2203('0x7')](_0x2203('0x8'),_0x2676aa[_0x2203('0x9')](function(_0x5ecf9e){return{'id':_0x5ecf9e['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x44ccfd['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2203('0x6')](function(_0x549908){_0x44ccfd[_0x2203('0x7')](_0x2203('0xa'),_0x549908[_0x2203('0xb')]);SmsInteractionEvents['emit'](_0x880dcd+':'+_0x44ccfd['id'],_0x44ccfd);SmsInteractionEvents[_0x2203('0xc')](_0x880dcd,_0x44ccfd);_0x3f7ba1(null);})['catch'](_0x3f7ba1(null));};}for(var e in events){if(events[_0x2203('0xd')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0x2203('0xe')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 1171045..01d8bba 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 _0x39a1=['../../config/environment','./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment','bluebird','rimraf'];(function(_0x4f1838,_0x2cb1b9){var _0x280567=function(_0x396727){while(--_0x396727){_0x4f1838['push'](_0x4f1838['shift']());}};_0x280567(++_0x2cb1b9);}(_0x39a1,0x71));var _0x139a=function(_0x5f36ed,_0x325972){_0x5f36ed=_0x5f36ed-0x0;var _0x1a2653=_0x39a1[_0x5f36ed];return _0x1a2653;};'use strict';var _=require(_0x139a('0x0'));var util=require(_0x139a('0x1'));var logger=require('../../config/logger')(_0x139a('0x2'));var moment=require(_0x139a('0x3'));var BPromise=require(_0x139a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x139a('0x5'));var config=require(_0x139a('0x6'));var attributes=require(_0x139a('0x7'));module[_0x139a('0x8')]=function(_0x1bbc4c,_0x390712){return _0x1bbc4c[_0x139a('0x9')](_0x139a('0xa'),attributes,{'tableName':_0x139a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1faa2b,_0x359c06,_0xbb5c5e){if(_0x1faa2b[_0x139a('0xc')](_0x139a('0xd'))){_0x1faa2b[_0x139a('0xe')]=moment()[_0x139a('0xf')](_0x139a('0x10'));}_0xbb5c5e(null,_0x1faa2b);}}});}; \ No newline at end of file +var _0xc043=['define','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','api','bluebird','path','rimraf','../../config/environment','./smsInteraction.attributes','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc043,0xae));var _0x3c04=function(_0x3d8583,_0x4c2fef){_0x3d8583=_0x3d8583-0x0;var _0x38450f=_0xc043[_0x3d8583];return _0x38450f;};'use strict';var _=require('lodash');var util=require(_0x3c04('0x0'));var logger=require('../../config/logger')(_0x3c04('0x1'));var moment=require('moment');var BPromise=require(_0x3c04('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3c04('0x3'));var rimraf=require(_0x3c04('0x4'));var config=require(_0x3c04('0x5'));var attributes=require(_0x3c04('0x6'));module[_0x3c04('0x7')]=function(_0x3278cc,_0x42f7c1){return _0x3278cc[_0x3c04('0x8')]('SmsInteraction',attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4b613b,_0x21f7b3,_0x5127db){if(_0x4b613b[_0x3c04('0x9')](_0x3c04('0xa'))){_0x4b613b[_0x3c04('0xb')]=moment()[_0x3c04('0xc')](_0x3c04('0xd'));}_0x5127db(null,_0x4b613b);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index ef99c0b..7c3a51a 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 _0xc23f=['body','options','raw','where','attributes','UpdateSmsInteraction','AddTagsToSmsInteraction','SmsInteraction','find','ids','omit','spread','AddTags','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','localhost','./smsInteraction.socket','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','update'];(function(_0x9e4ea,_0x9cc1fb){var _0x2fe21e=function(_0x357bb1){while(--_0x357bb1){_0x9e4ea['push'](_0x9e4ea['shift']());}};_0x2fe21e(++_0x9cc1fb);}(_0xc23f,0x14e));var _0xfc23=function(_0x1e7345,_0x18bcce){_0x1e7345=_0x1e7345-0x0;var _0x33017c=_0xc23f[_0x1e7345];return _0x33017c;};'use strict';var _=require(_0xfc23('0x0'));var util=require(_0xfc23('0x1'));var moment=require(_0xfc23('0x2'));var BPromise=require('bluebird');var rs=require(_0xfc23('0x3'));var fs=require('fs');var Redis=require(_0xfc23('0x4'));var db=require(_0xfc23('0x5'))['db'];var utils=require(_0xfc23('0x6'));var logger=require(_0xfc23('0x7'))('rpc');var config=require(_0xfc23('0x8'));var jayson=require(_0xfc23('0x9'));var client=jayson[_0xfc23('0xa')][_0xfc23('0xb')]({'port':0x232a});config['redis']=_[_0xfc23('0xc')](config['redis'],{'host':_0xfc23('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xfc23('0xe'))['register'](socket);function respondWithRpcPromise(_0x2c8940,_0x819e5e,_0x4268c4){return new BPromise(function(_0x44791b,_0x4bae11){return client[_0xfc23('0xf')](_0x2c8940,_0x4268c4)[_0xfc23('0x10')](function(_0x33be1f){logger[_0xfc23('0x11')](_0xfc23('0x12'),_0x819e5e,_0xfc23('0x13'));logger['debug'](_0xfc23('0x14'),_0x819e5e,_0xfc23('0x13'),JSON[_0xfc23('0x15')](_0x33be1f));if(_0x33be1f['error']){if(_0x33be1f[_0xfc23('0x16')]['code']===0x1f4){logger['error'](_0xfc23('0x12'),_0x819e5e,_0x33be1f['error']['message']);return _0x4bae11(_0x33be1f[_0xfc23('0x16')][_0xfc23('0x17')]);}logger[_0xfc23('0x16')](_0xfc23('0x12'),_0x819e5e,_0x33be1f[_0xfc23('0x16')][_0xfc23('0x17')]);return _0x44791b(_0x33be1f['error'][_0xfc23('0x17')]);}else{logger[_0xfc23('0x11')](_0xfc23('0x12'),_0x819e5e,_0xfc23('0x13'));_0x44791b(_0x33be1f['result']['message']);}})[_0xfc23('0x18')](function(_0x5bf23c){logger[_0xfc23('0x16')](_0xfc23('0x12'),_0x819e5e,_0x5bf23c);_0x4bae11(_0x5bf23c);});});}exports['UpdateSmsInteraction']=function(_0x29c6ae){var _0x12c798=this;return new Promise(function(_0x309677,_0x420ad6){return db['SmsInteraction'][_0xfc23('0x19')](_0x29c6ae[_0xfc23('0x1a')],{'raw':_0x29c6ae[_0xfc23('0x1b')]?_0x29c6ae[_0xfc23('0x1b')][_0xfc23('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x29c6ae[_0xfc23('0x1b')]?_0x29c6ae[_0xfc23('0x1b')][_0xfc23('0x1d')]||null:null,'attributes':_0x29c6ae[_0xfc23('0x1b')]?_0x29c6ae['options'][_0xfc23('0x1e')]||null:null,'limit':_0x29c6ae[_0xfc23('0x1b')]?_0x29c6ae[_0xfc23('0x1b')]['limit']||null:null})[_0xfc23('0x10')](function(_0x4cf3e5){logger['info'](_0xfc23('0x1f'),_0x29c6ae);logger['debug'](_0xfc23('0x1f'),_0x29c6ae,JSON[_0xfc23('0x15')](_0x4cf3e5));_0x309677(_0x4cf3e5);})[_0xfc23('0x18')](function(_0x4ea85e){logger[_0xfc23('0x16')]('UpdateSmsInteraction',_0x4ea85e[_0xfc23('0x17')],_0x29c6ae);_0x420ad6(_0x12c798[_0xfc23('0x16')](0x1f4,_0x4ea85e['message']));});});};exports[_0xfc23('0x20')]=function(_0x3f68ed){return new Promise(function(_0x3f639a,_0x4f22c6){return db[_0xfc23('0x21')][_0xfc23('0x22')]({'where':_0x3f68ed['options']?_0x3f68ed[_0xfc23('0x1b')][_0xfc23('0x1d')]||null:null})['then'](function(_0x5e7594){if(_0x5e7594){return _0x5e7594['addTags'](_0x3f68ed['body'][_0xfc23('0x23')],_[_0xfc23('0x24')](_0x3f68ed['body'],[_0xfc23('0x23'),'id'])||{});}})[_0xfc23('0x25')](function(_0x5343ea){logger[_0xfc23('0x11')](_0xfc23('0x26'),_0x3f68ed);logger[_0xfc23('0x27')](_0xfc23('0x26'),_0x3f68ed,JSON[_0xfc23('0x15')](_0x5343ea));_0x3f639a(_0x5343ea);})['catch'](function(_0x55a8d5){logger[_0xfc23('0x16')](_0xfc23('0x26'),_0x55a8d5[_0xfc23('0x17')],_0x3f68ed);_0x4f22c6(_this[_0xfc23('0x16')](0x1f4,_0x55a8d5[_0xfc23('0x17')]));});});}; \ No newline at end of file +var _0x167b=['register','request','then','info','request\x20sent','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsInteraction,\x20%s,\x20%s','message','catch','UpdateSmsInteraction','options','where','attributes','limit','debug','AddTagsToSmsInteraction','find','addTags','body','ids','omit','spread','AddTags','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket'];(function(_0x25fc41,_0x250864){var _0x1371d1=function(_0x8ab2e3){while(--_0x8ab2e3){_0x25fc41['push'](_0x25fc41['shift']());}};_0x1371d1(++_0x250864);}(_0x167b,0xe2));var _0xb167=function(_0x1f6100,_0x5900d3){_0x1f6100=_0x1f6100-0x0;var _0xf6d34c=_0x167b[_0x1f6100];return _0xf6d34c;};'use strict';var _=require(_0xb167('0x0'));var util=require(_0xb167('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb167('0x2'));var fs=require('fs');var Redis=require(_0xb167('0x3'));var db=require(_0xb167('0x4'))['db'];var utils=require(_0xb167('0x5'));var logger=require(_0xb167('0x6'))(_0xb167('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb167('0x8')]['http']({'port':0x232a});config[_0xb167('0x9')]=_[_0xb167('0xa')](config[_0xb167('0x9')],{'host':_0xb167('0xb'),'port':0x18eb});var socket=require(_0xb167('0xc'))(new Redis(config[_0xb167('0x9')]));require(_0xb167('0xd'))[_0xb167('0xe')](socket);function respondWithRpcPromise(_0x3a691b,_0x2893e0,_0x575baf){return new BPromise(function(_0x2aa783,_0x1d0c94){return client[_0xb167('0xf')](_0x3a691b,_0x575baf)[_0xb167('0x10')](function(_0xe16fc6){logger[_0xb167('0x11')]('SmsInteraction,\x20%s,\x20%s',_0x2893e0,_0xb167('0x12'));logger['debug'](_0xb167('0x13'),_0x2893e0,_0xb167('0x12'),JSON[_0xb167('0x14')](_0xe16fc6));if(_0xe16fc6[_0xb167('0x15')]){if(_0xe16fc6[_0xb167('0x15')][_0xb167('0x16')]===0x1f4){logger[_0xb167('0x15')](_0xb167('0x17'),_0x2893e0,_0xe16fc6['error'][_0xb167('0x18')]);return _0x1d0c94(_0xe16fc6['error'][_0xb167('0x18')]);}logger['error'](_0xb167('0x17'),_0x2893e0,_0xe16fc6[_0xb167('0x15')][_0xb167('0x18')]);return _0x2aa783(_0xe16fc6[_0xb167('0x15')][_0xb167('0x18')]);}else{logger[_0xb167('0x11')]('SmsInteraction,\x20%s,\x20%s',_0x2893e0,_0xb167('0x12'));_0x2aa783(_0xe16fc6['result'][_0xb167('0x18')]);}})[_0xb167('0x19')](function(_0x2ac66b){logger['error']('SmsInteraction,\x20%s,\x20%s',_0x2893e0,_0x2ac66b);_0x1d0c94(_0x2ac66b);});});}exports[_0xb167('0x1a')]=function(_0x44f90a){var _0x2686e8=this;return new Promise(function(_0x3463f0,_0x53d01b){return db['SmsInteraction']['update'](_0x44f90a['body'],{'raw':_0x44f90a[_0xb167('0x1b')]?_0x44f90a[_0xb167('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x44f90a[_0xb167('0x1b')]?_0x44f90a[_0xb167('0x1b')][_0xb167('0x1c')]||null:null,'attributes':_0x44f90a[_0xb167('0x1b')]?_0x44f90a[_0xb167('0x1b')][_0xb167('0x1d')]||null:null,'limit':_0x44f90a[_0xb167('0x1b')]?_0x44f90a[_0xb167('0x1b')][_0xb167('0x1e')]||null:null})['then'](function(_0x1bf54b){logger['info'](_0xb167('0x1a'),_0x44f90a);logger[_0xb167('0x1f')](_0xb167('0x1a'),_0x44f90a,JSON[_0xb167('0x14')](_0x1bf54b));_0x3463f0(_0x1bf54b);})[_0xb167('0x19')](function(_0x57e90e){logger['error'](_0xb167('0x1a'),_0x57e90e[_0xb167('0x18')],_0x44f90a);_0x53d01b(_0x2686e8[_0xb167('0x15')](0x1f4,_0x57e90e['message']));});});};exports[_0xb167('0x20')]=function(_0x185072){return new Promise(function(_0x287a1c,_0x3cc100){return db['SmsInteraction'][_0xb167('0x21')]({'where':_0x185072[_0xb167('0x1b')]?_0x185072[_0xb167('0x1b')][_0xb167('0x1c')]||null:null})[_0xb167('0x10')](function(_0x5020f4){if(_0x5020f4){return _0x5020f4[_0xb167('0x22')](_0x185072[_0xb167('0x23')][_0xb167('0x24')],_[_0xb167('0x25')](_0x185072[_0xb167('0x23')],[_0xb167('0x24'),'id'])||{});}})[_0xb167('0x26')](function(_0x40a958){logger[_0xb167('0x11')](_0xb167('0x27'),_0x185072);logger['debug'](_0xb167('0x27'),_0x185072,JSON['stringify'](_0x40a958));_0x287a1c(_0x40a958);})[_0xb167('0x19')](function(_0x4dc4ac){logger[_0xb167('0x15')]('AddTags',_0x4dc4ac[_0xb167('0x18')],_0x185072);_0x3cc100(_this[_0xb167('0x15')](0x1f4,_0x4dc4ac['message']));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index d25236b..6fa7476 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 _0x3560=['./smsInteraction.events','save','remove','update','emit','removeListener','register','length'];(function(_0x5f3ee0,_0x48e6ae){var _0x48a98b=function(_0x12042f){while(--_0x12042f){_0x5f3ee0['push'](_0x5f3ee0['shift']());}};_0x48a98b(++_0x48e6ae);}(_0x3560,0x140));var _0x0356=function(_0x4bc65f,_0x39ec43){_0x4bc65f=_0x4bc65f-0x0;var _0x44f85f=_0x3560[_0x4bc65f];return _0x44f85f;};'use strict';var SmsInteractionEvents=require(_0x0356('0x0'));var events=[_0x0356('0x1'),_0x0356('0x2'),_0x0356('0x3')];function createListener(_0x39fd73,_0x407c27){return function(_0x4bd7d7){_0x407c27[_0x0356('0x4')](_0x39fd73,_0x4bd7d7);};}function removeListener(_0x3bf893,_0x1a43ef){return function(){SmsInteractionEvents[_0x0356('0x5')](_0x3bf893,_0x1a43ef);};}exports[_0x0356('0x6')]=function(_0x56390f){for(var _0x34ff31=0x0,_0x414125=events[_0x0356('0x7')];_0x34ff31<_0x414125;_0x34ff31++){var _0x5a5242=events[_0x34ff31];var _0x39515d=createListener('smsInteraction:'+_0x5a5242,_0x56390f);SmsInteractionEvents['on'](_0x5a5242,_0x39515d);}}; \ No newline at end of file +var _0x6913=['register','length','smsInteraction:','./smsInteraction.events','save','remove','update'];(function(_0x5a3cf0,_0x160a68){var _0x5a64ee=function(_0x34cd1d){while(--_0x34cd1d){_0x5a3cf0['push'](_0x5a3cf0['shift']());}};_0x5a64ee(++_0x160a68);}(_0x6913,0x73));var _0x3691=function(_0x377c05,_0xe6d95c){_0x377c05=_0x377c05-0x0;var _0x452021=_0x6913[_0x377c05];return _0x452021;};'use strict';var SmsInteractionEvents=require(_0x3691('0x0'));var events=[_0x3691('0x1'),_0x3691('0x2'),_0x3691('0x3')];function createListener(_0x555480,_0x149f8e){return function(_0x20f2a3){_0x149f8e['emit'](_0x555480,_0x20f2a3);};}function removeListener(_0x4b5e0e,_0x1b08be){return function(){SmsInteractionEvents['removeListener'](_0x4b5e0e,_0x1b08be);};}exports[_0x3691('0x4')]=function(_0x585bb0){for(var _0x5368ff=0x0,_0xce9783=events[_0x3691('0x5')];_0x5368ff<_0xce9783;_0x5368ff++){var _0x125a26=events[_0x5368ff];var _0x374de9=createListener(_0x3691('0x6')+_0x125a26,_0x585bb0);SmsInteractionEvents['on'](_0x125a26,_0x374de9);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 3855877..2542822 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 _0x04d0=['/:id','tracked','sms','smsmessage:create','create','post','/:id/status','status','put','update','accept','destroy','exports','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsMessage.controller','get','isAuthenticated','/describe','describe'];(function(_0x1ca4df,_0xd2a69d){var _0x48737=function(_0x4c34cb){while(--_0x4c34cb){_0x1ca4df['push'](_0x1ca4df['shift']());}};_0x48737(++_0xd2a69d);}(_0x04d0,0x1ab));var _0x004d=function(_0x501e3e,_0x3ebdc4){_0x501e3e=_0x501e3e-0x0;var _0x59e482=_0x04d0[_0x501e3e];return _0x59e482;};'use strict';var multer=require('multer');var util=require(_0x004d('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x004d('0x1')]();var fs_extra=require(_0x004d('0x2'));var auth=require(_0x004d('0x3'));var interaction=require(_0x004d('0x4'));var config=require('../../config/environment');var controller=require(_0x004d('0x5'));router[_0x004d('0x6')]('/',auth[_0x004d('0x7')](),controller['index']);router[_0x004d('0x6')](_0x004d('0x8'),auth[_0x004d('0x7')](),controller[_0x004d('0x9')]);router[_0x004d('0x6')](_0x004d('0xa'),auth[_0x004d('0x7')](),controller['show']);router['post']('/',auth[_0x004d('0x7')](),interaction[_0x004d('0xb')](_0x004d('0xc'),_0x004d('0xd')),controller[_0x004d('0xe')]);router[_0x004d('0xf')](_0x004d('0x10'),controller[_0x004d('0x11')]);router[_0x004d('0x12')](_0x004d('0xa'),auth[_0x004d('0x7')](),controller[_0x004d('0x13')]);router['put']('/:id/accept',auth[_0x004d('0x7')](),controller[_0x004d('0x14')]);router['put']('/:id/reject',auth[_0x004d('0x7')](),controller['reject']);router['delete'](_0x004d('0xa'),auth['isAuthenticated'](),controller[_0x004d('0x15')]);module[_0x004d('0x16')]=router; \ No newline at end of file +var _0x93ed=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','tracked','smsmessage:create','create','post','/:id/status','status','update','put','/:id/accept','reject','delete','exports','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x287cc5,_0x2f5c71){var _0xe7212a=function(_0x96666){while(--_0x96666){_0x287cc5['push'](_0x287cc5['shift']());}};_0xe7212a(++_0x2f5c71);}(_0x93ed,0xfe));var _0xd93e=function(_0x42fa42,_0x5eb51d){_0x42fa42=_0x42fa42-0x0;var _0x3fd390=_0x93ed[_0x42fa42];return _0x3fd390;};'use strict';var multer=require(_0xd93e('0x0'));var util=require(_0xd93e('0x1'));var path=require(_0xd93e('0x2'));var timeout=require(_0xd93e('0x3'));var express=require(_0xd93e('0x4'));var router=express['Router']();var fs_extra=require(_0xd93e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd93e('0x6'));var config=require(_0xd93e('0x7'));var controller=require('./smsMessage.controller');router[_0xd93e('0x8')]('/',auth[_0xd93e('0x9')](),controller[_0xd93e('0xa')]);router[_0xd93e('0x8')](_0xd93e('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xd93e('0x8')](_0xd93e('0xc'),auth[_0xd93e('0x9')](),controller[_0xd93e('0xd')]);router['post']('/',auth['isAuthenticated'](),interaction[_0xd93e('0xe')]('sms',_0xd93e('0xf')),controller[_0xd93e('0x10')]);router[_0xd93e('0x11')](_0xd93e('0x12'),controller[_0xd93e('0x13')]);router['put'](_0xd93e('0xc'),auth[_0xd93e('0x9')](),controller[_0xd93e('0x14')]);router[_0xd93e('0x15')](_0xd93e('0x16'),auth['isAuthenticated'](),controller['accept']);router['put']('/:id/reject',auth[_0xd93e('0x9')](),controller[_0xd93e('0x17')]);router[_0xd93e('0x18')]('/:id',auth[_0xd93e('0x9')](),controller['destroy']);module[_0xd93e('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 60548b2..023bf20 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 _0xaa65=['medium','ENUM','out','STRING','sequelize','exports','TEXT'];(function(_0x78d146,_0x42a8fe){var _0x29f284=function(_0x50f4c9){while(--_0x50f4c9){_0x78d146['push'](_0x78d146['shift']());}};_0x29f284(++_0x42a8fe);}(_0xaa65,0x90));var _0x5aa6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaa65[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x5aa6('0x0'));module[_0x5aa6('0x1')]={'body':{'type':Sequelize[_0x5aa6('0x2')](_0x5aa6('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x5aa6('0x4')]('in',_0x5aa6('0x5')),'defaultValue':_0x5aa6('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x5aa6('0x6')](0xbe)},'phone':{'type':Sequelize[_0x5aa6('0x6')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0x5aa6('0x6')]},'providerResponse':{'type':Sequelize[_0x5aa6('0x2')]}}; \ No newline at end of file +var _0x4f67=['out','STRING','DATE','TEXT','medium','BOOLEAN','ENUM'];(function(_0x2c4b25,_0x182c78){var _0x9e6047=function(_0x3c8bd5){while(--_0x3c8bd5){_0x2c4b25['push'](_0x2c4b25['shift']());}};_0x9e6047(++_0x182c78);}(_0x4f67,0x82));var _0x74f6=function(_0x5d4ca7,_0x19113b){_0x5d4ca7=_0x5d4ca7-0x0;var _0x3efc03=_0x4f67[_0x5d4ca7];return _0x3efc03;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize['TEXT'](_0x74f6('0x0')),'allowNull':![]},'read':{'type':Sequelize[_0x74f6('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0x74f6('0x2')]('in',_0x74f6('0x3')),'defaultValue':_0x74f6('0x3'),'allowNull':![]},'messageId':{'type':Sequelize[_0x74f6('0x4')](0xbe)},'phone':{'type':Sequelize[_0x74f6('0x4')]},'readAt':{'type':Sequelize[_0x74f6('0x5')]},'secret':{'type':Sequelize[_0x74f6('0x1')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x74f6('0x6')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 34f4767..34e13c8 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 _0x01a6=['user','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','rejectmessage','SmsAccount','SmsAccountId','SmsMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','sent','Status','plivio','results','groupName','DELIVERED','infobip','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','sendStatus','status','json','offset','undefined','limit','Content-Range','apply','reject','save','update','destroy','end','stack','name','index','map','fieldName','type','key','model','keys','filters','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','count','includeAll','include','SmsMessage','findAll','rows','show','params','rawAttributes','create','body','find','describe','sms-interactions','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','SmsInteraction','SmsInteractionId','isNil','read1stAt','interaction'];(function(_0x229607,_0x5653a6){var _0x5ed9a6=function(_0x4c60b7){while(--_0x4c60b7){_0x229607['push'](_0x229607['shift']());}};_0x5ed9a6(++_0x5653a6);}(_0x01a6,0x162));var _0x601a=function(_0x193126,_0x442559){_0x193126=_0x193126-0x0;var _0x1a9536=_0x01a6[_0x193126];return _0x1a9536;};'use strict';var emlformat=require(_0x601a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x601a('0x1'));var jsonpatch=require(_0x601a('0x2'));var rp=require(_0x601a('0x3'));var moment=require(_0x601a('0x4'));var BPromise=require(_0x601a('0x5'));var Mustache=require('mustache');var util=require(_0x601a('0x6'));var path=require('path');var sox=require(_0x601a('0x7'));var csv=require(_0x601a('0x8'));var ejs=require(_0x601a('0x9'));var fs=require('fs');var fs_extra=require(_0x601a('0xa'));var _=require(_0x601a('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x601a('0xc'));var deskjs=require(_0x601a('0xd'));var toCsv=require(_0x601a('0x8'));var querystring=require('querystring');var Papa=require(_0x601a('0xe'));var Redis=require(_0x601a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x601a('0x10'));var as=require(_0x601a('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x601a('0x12'))(_0x601a('0x13'));var utils=require(_0x601a('0x14'));var config=require(_0x601a('0x15'));var licenseUtil=require(_0x601a('0x16'));var db=require(_0x601a('0x17'))['db'];config[_0x601a('0x18')]=_[_0x601a('0x19')](config[_0x601a('0x18')],{'host':_0x601a('0x1a'),'port':0x18eb});var socket=require(_0x601a('0x1b'))(new Redis(config['redis']));require(_0x601a('0x1c'))[_0x601a('0x1d')](socket);var jayson=require(_0x601a('0x1e'));var client=jayson[_0x601a('0x1f')][_0x601a('0x20')]({'port':0x232c});var client9002=jayson[_0x601a('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f7a46,_0x2ff56c,_0x164a5c,_0x31eefd){return new BPromise(function(_0x4e1ebf,_0x2e51dc){var _0x47cdc4=_0x31eefd||client;return _0x47cdc4[_0x601a('0x21')](_0x2f7a46,_0x164a5c)[_0x601a('0x22')](function(_0x359554){logger[_0x601a('0x23')](_0x601a('0x24'),_0x2ff56c,_0x601a('0x25'));logger[_0x601a('0x26')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2ff56c,_0x601a('0x25'),JSON[_0x601a('0x27')](_0x359554));if(_0x359554[_0x601a('0x28')]){if(_0x359554[_0x601a('0x28')][_0x601a('0x29')]===0x1f4){logger[_0x601a('0x28')](_0x601a('0x24'),_0x2ff56c,_0x359554['error'][_0x601a('0x2a')]);return _0x2e51dc(_0x359554['error']['message']);}logger[_0x601a('0x28')](_0x601a('0x24'),_0x2ff56c,_0x359554[_0x601a('0x28')][_0x601a('0x2a')]);return _0x4e1ebf(_0x359554['error'][_0x601a('0x2a')]);}else{logger['info']('SmsMessage,\x20%s,\x20%s',_0x2ff56c,'request\x20sent');_0x4e1ebf(_0x359554['result']['message']);}})[_0x601a('0x2b')](function(_0x599d71){logger[_0x601a('0x28')](_0x601a('0x24'),_0x2ff56c,_0x599d71);_0x2e51dc(_0x599d71);});});}function respondWithStatusCode(_0x29ec51,_0x233f5d){_0x233f5d=_0x233f5d||0xcc;return function(_0x540462){if(_0x540462){return _0x29ec51[_0x601a('0x2c')](_0x233f5d);}return _0x29ec51[_0x601a('0x2d')](_0x233f5d)['end']();};}function respondWithResult(_0x30ca00,_0x335581){_0x335581=_0x335581||0xc8;return function(_0x36c19f){if(_0x36c19f){return _0x30ca00[_0x601a('0x2d')](_0x335581)[_0x601a('0x2e')](_0x36c19f);}};}function respondWithFilteredResult(_0x564b9d,_0xe4ca6e){return function(_0x2126b2){if(_0x2126b2){var _0x9e08f4=typeof _0xe4ca6e[_0x601a('0x2f')]===_0x601a('0x30')&&typeof _0xe4ca6e['limit']===_0x601a('0x30');var _0x43f7a7=_0x2126b2['count'];var _0x44d27f=_0x9e08f4?0x0:_0xe4ca6e[_0x601a('0x2f')];var _0x2c764a=_0x9e08f4?_0x2126b2['count']:_0xe4ca6e['offset']+_0xe4ca6e[_0x601a('0x31')];var _0x27e660;if(_0x2c764a>=_0x43f7a7){_0x2c764a=_0x43f7a7;_0x27e660=0xc8;}else{_0x27e660=0xce;}_0x564b9d[_0x601a('0x2d')](_0x27e660);return _0x564b9d['set'](_0x601a('0x32'),_0x44d27f+'-'+_0x2c764a+'/'+_0x43f7a7)['json'](_0x2126b2);}return null;};}function patchUpdates(_0x2d790d){return function(_0x4ec041){try{jsonpatch[_0x601a('0x33')](_0x4ec041,_0x2d790d,!![]);}catch(_0x3afaea){return BPromise[_0x601a('0x34')](_0x3afaea);}return _0x4ec041[_0x601a('0x35')]();};}function saveUpdates(_0x468010,_0x3be4f1){return function(_0x5b9be0){if(_0x5b9be0){return _0x5b9be0[_0x601a('0x36')](_0x468010)[_0x601a('0x22')](function(_0x1a82d0){return _0x1a82d0;});}return null;};}function removeEntity(_0x32d5d1,_0x27154a){return function(_0x544ecc){if(_0x544ecc){return _0x544ecc[_0x601a('0x37')]()['then'](function(){_0x32d5d1[_0x601a('0x2d')](0xcc)[_0x601a('0x38')]();});}};}function handleEntityNotFound(_0x27633f,_0x33125f){return function(_0x16ea11){if(!_0x16ea11){_0x27633f[_0x601a('0x2c')](0x194);}return _0x16ea11;};}function handleError(_0x325620,_0x4f491b){_0x4f491b=_0x4f491b||0x1f4;return function(_0x3de417){logger[_0x601a('0x28')](_0x3de417[_0x601a('0x39')]);if(_0x3de417[_0x601a('0x3a')]){delete _0x3de417[_0x601a('0x3a')];}_0x325620[_0x601a('0x2d')](_0x4f491b)['send'](_0x3de417);};}exports[_0x601a('0x3b')]=function(_0x1aaaa0,_0x8af62e){var _0x1d0830={},_0xe9b1db={},_0x366690={'count':0x0,'rows':[]};var _0x2baf74=_[_0x601a('0x3c')](db['SmsMessage']['rawAttributes'],function(_0x583db4){return{'name':_0x583db4[_0x601a('0x3d')],'type':_0x583db4[_0x601a('0x3e')][_0x601a('0x3f')]};});_0xe9b1db[_0x601a('0x40')]=_[_0x601a('0x3c')](_0x2baf74,_0x601a('0x3a'));_0xe9b1db['query']=_[_0x601a('0x41')](_0x1aaaa0['query']);_0xe9b1db[_0x601a('0x42')]=_[_0x601a('0x43')](_0xe9b1db['model'],_0xe9b1db['query']);_0x1d0830[_0x601a('0x44')]=_[_0x601a('0x43')](_0xe9b1db[_0x601a('0x40')],qs[_0x601a('0x45')](_0x1aaaa0[_0x601a('0x46')]['fields']));_0x1d0830[_0x601a('0x44')]=_0x1d0830[_0x601a('0x44')][_0x601a('0x47')]?_0x1d0830[_0x601a('0x44')]:_0xe9b1db[_0x601a('0x40')];if(!_0x1aaaa0[_0x601a('0x46')][_0x601a('0x48')](_0x601a('0x49'))){_0x1d0830[_0x601a('0x31')]=qs['limit'](_0x1aaaa0[_0x601a('0x46')]['limit']);_0x1d0830[_0x601a('0x2f')]=qs[_0x601a('0x2f')](_0x1aaaa0[_0x601a('0x46')]['offset']);}_0x1d0830[_0x601a('0x4a')]=qs[_0x601a('0x4b')](_0x1aaaa0[_0x601a('0x46')]['sort']);_0x1d0830[_0x601a('0x4c')]=qs[_0x601a('0x42')](_['pick'](_0x1aaaa0[_0x601a('0x46')],_0xe9b1db[_0x601a('0x42')]),_0x2baf74);if(_0x1aaaa0[_0x601a('0x46')][_0x601a('0x4d')]){_0x1d0830['where']=_[_0x601a('0x4e')](_0x1d0830[_0x601a('0x4c')],{'$or':_['map'](_0x2baf74,function(_0x5b470f){if(_0x5b470f['type']!=='VIRTUAL'){var _0x45994a={};_0x45994a[_0x5b470f[_0x601a('0x3a')]]={'$like':'%'+_0x1aaaa0[_0x601a('0x46')][_0x601a('0x4d')]+'%'};return _0x45994a;}})});}_0x1d0830=_[_0x601a('0x4e')]({},_0x1d0830,_0x1aaaa0[_0x601a('0x4f')]);var _0x1ef934={'where':_0x1d0830[_0x601a('0x4c')]};return db['SmsMessage']['count'](_0x1ef934)[_0x601a('0x22')](function(_0x2fb89e){_0x366690[_0x601a('0x50')]=_0x2fb89e;if(_0x1aaaa0['query'][_0x601a('0x51')]){_0x1d0830[_0x601a('0x52')]=[{'all':!![]}];}return db[_0x601a('0x53')][_0x601a('0x54')](_0x1d0830);})['then'](function(_0x244b56){_0x366690[_0x601a('0x55')]=_0x244b56;return _0x366690;})[_0x601a('0x22')](respondWithFilteredResult(_0x8af62e,_0x1d0830))[_0x601a('0x2b')](handleError(_0x8af62e,null));};exports[_0x601a('0x56')]=function(_0x19c461,_0x16c69c){var _0x48b427={'raw':!![],'where':{'id':_0x19c461[_0x601a('0x57')]['id']}},_0xda8991={};_0xda8991[_0x601a('0x40')]=_[_0x601a('0x41')](db[_0x601a('0x53')][_0x601a('0x58')]);_0xda8991[_0x601a('0x46')]=_[_0x601a('0x41')](_0x19c461['query']);_0xda8991[_0x601a('0x42')]=_['intersection'](_0xda8991['model'],_0xda8991['query']);_0x48b427[_0x601a('0x44')]=_[_0x601a('0x43')](_0xda8991[_0x601a('0x40')],qs[_0x601a('0x45')](_0x19c461[_0x601a('0x46')][_0x601a('0x45')]));_0x48b427[_0x601a('0x44')]=_0x48b427[_0x601a('0x44')]['length']?_0x48b427[_0x601a('0x44')]:_0xda8991['model'];if(_0x19c461[_0x601a('0x46')]['includeAll']){_0x48b427[_0x601a('0x52')]=[{'all':!![]}];}_0x48b427=_['merge']({},_0x48b427,_0x19c461[_0x601a('0x4f')]);return db[_0x601a('0x53')]['find'](_0x48b427)[_0x601a('0x22')](handleEntityNotFound(_0x16c69c,null))[_0x601a('0x22')](respondWithResult(_0x16c69c,null))[_0x601a('0x2b')](handleError(_0x16c69c,null));};exports[_0x601a('0x59')]=function(_0x2562f5,_0x418984){return db[_0x601a('0x53')][_0x601a('0x59')](_0x2562f5[_0x601a('0x5a')],{})[_0x601a('0x22')](respondWithResult(_0x418984,0xc9))['catch'](handleError(_0x418984,null));};exports[_0x601a('0x36')]=function(_0x44fb33,_0xff10ee){if(_0x44fb33[_0x601a('0x5a')]['id']){delete _0x44fb33['body']['id'];}return db[_0x601a('0x53')][_0x601a('0x5b')]({'where':{'id':_0x44fb33['params']['id']}})['then'](handleEntityNotFound(_0xff10ee,null))[_0x601a('0x22')](saveUpdates(_0x44fb33['body'],null))[_0x601a('0x22')](respondWithResult(_0xff10ee,null))['catch'](handleError(_0xff10ee,null));};exports[_0x601a('0x37')]=function(_0x2e972f,_0x5aa2e5){return db[_0x601a('0x53')][_0x601a('0x5b')]({'where':{'id':_0x2e972f[_0x601a('0x57')]['id']}})['then'](handleEntityNotFound(_0x5aa2e5,null))[_0x601a('0x22')](removeEntity(_0x5aa2e5,null))[_0x601a('0x2b')](handleError(_0x5aa2e5,null));};exports['describe']=function(_0x5a7046,_0x47da42){return db[_0x601a('0x53')][_0x601a('0x5c')]()[_0x601a('0x22')](respondWithResult(_0x47da42,null))[_0x601a('0x2b')](handleError(_0x47da42,null));};var interaction_log=require('../../config/logger')(_0x601a('0x5d'));exports[_0x601a('0x5e')]=function(_0x7466ce,_0xb48a57,_0x20bacc){var _0x4c95e1={'agent':{},'channel':_0x601a('0x5f')};if(_0x7466ce[_0x601a('0x5a')]['id']){delete _0x7466ce['body']['id'];}_0x7466ce[_0x601a('0x5a')][_0x601a('0x60')]=!![];_0x7466ce[_0x601a('0x5a')][_0x601a('0x61')]=moment()[_0x601a('0x62')](_0x601a('0x63'));_0x7466ce[_0x601a('0x5a')][_0x601a('0x64')]=_0x7466ce[_0x601a('0x5a')][_0x601a('0x64')]||_0x7466ce['user']['id'];_0x4c95e1[_0x601a('0x65')]['id']=_0x7466ce[_0x601a('0x5a')][_0x601a('0x64')];return db[_0x601a('0x53')][_0x601a('0x5b')]({'where':{'id':_0x7466ce[_0x601a('0x57')]['id'],'UserId':null}})[_0x601a('0x22')](handleEntityNotFound(_0xb48a57,null))[_0x601a('0x22')](saveUpdates(_0x7466ce[_0x601a('0x5a')],null))['then'](function(_0x3006c1){if(_0x3006c1){_0x4c95e1['message']=_0x3006c1[_0x601a('0x66')]({'plain':!![]});return db[_0x601a('0x67')][_0x601a('0x5b')]({'where':{'id':_0x3006c1[_0x601a('0x68')]}});}return null;})[_0x601a('0x22')](handleEntityNotFound(_0xb48a57,null))[_0x601a('0x22')](function(_0x57e431){if(_0x57e431){return _0x57e431[_0x601a('0x36')]({'UserId':_0x7466ce['body'][_0x601a('0x64')],'read1stAt':_[_0x601a('0x69')](_0x57e431[_0x601a('0x6a')])?moment()[_0x601a('0x62')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x601a('0x22')](function(_0x522f43){if(_0x522f43){_0x4c95e1[_0x601a('0x6b')]=_0x522f43[_0x601a('0x66')]({'plain':!![]});interaction_log['info']('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x7466ce[_0x601a('0x6c')]['id'],_0x7466ce[_0x601a('0x6c')][_0x601a('0x3a')],_0x7466ce['user'][_0x601a('0x6d')],_0x4c95e1[_0x601a('0x6b')]['id'],_0x7466ce['body']?JSON['stringify'](_0x7466ce[_0x601a('0x5a')]):_0x601a('0x6e'));return respondWithRpcPromise(_0x601a('0x6f'),_0x601a('0x70'),_0x4c95e1);}return null;})['then'](function(_0x4e9765){var _0x40ee80=_0x601a('0x71')+_0x4e9765[_0x601a('0x2a')][_0x601a('0x72')];return db[_0x601a('0x73')]['query'](_0x40ee80,{'type':db[_0x601a('0x74')][_0x601a('0x75')][_0x601a('0x76')],'raw':!![]})[_0x601a('0x22')](function(_0x1dd286){return _0x1dd286;});})['then'](function(_0x160fda){if(_0x160fda){_0x4c95e1[_0x601a('0x2a')][_0x601a('0x77')]=_0x160fda[0x0];if(!_0x7466ce[_0x601a('0x5a')][_0x601a('0x64')])return;return db[_0x601a('0x78')][_0x601a('0x5b')]({'where':{'id':_0x7466ce[_0x601a('0x5a')][_0x601a('0x64')],'role':'agent'},'attributes':['id',_0x601a('0x3a'),_0x601a('0x79'),_0x601a('0x7a'),_0x601a('0x7b')],'raw':!![]});}return null;})[_0x601a('0x22')](function(_0x343bf6){if(!_0x343bf6)return null;_0x4c95e1[_0x601a('0x2a')][_0x601a('0x65')]=_0x343bf6;return _0x4c95e1;})[_0x601a('0x22')](function(_0x54d5c8){if(_0x54d5c8){if(_0x7466ce['body'][_0x601a('0x7c')]){_0x4c95e1[_0x601a('0x2a')][_0x601a('0x7d')]=util[_0x601a('0x62')](_0x601a('0x7e'),_0x7466ce[_0x601a('0x6c')][_0x601a('0x3a')]);_0x4c95e1[_0x601a('0x2a')][_0x601a('0x7f')]=_0x4c95e1[_0x601a('0x7f')];_0x4c95e1[_0x601a('0x2a')][_0x601a('0x80')]=_0x4c95e1['channel'];_0x4c95e1[_0x601a('0x2a')][_0x601a('0x81')]=_0x601a('0x5e');return respondWithRpcPromise(_0x601a('0x82'),_0x601a('0x82'),{'event':_0x601a('0x83'),'message':_0x4c95e1[_0x601a('0x2a')]},client9002)[_0x601a('0x22')](function(){return _0x4c95e1;});}return _0x4c95e1;}return null;})[_0x601a('0x22')](respondWithResult(_0xb48a57,null))['catch'](handleError(_0xb48a57,null));};var interaction_log=require(_0x601a('0x12'))('sms-interactions');exports[_0x601a('0x34')]=function(_0x45857d,_0x35e074,_0x20d39f){var _0x175237={'agent':{},'channel':'sms'};if(_0x45857d['body']['id']){delete _0x45857d['body']['id'];}_0x45857d[_0x601a('0x5a')]['UserId']=_0x45857d[_0x601a('0x5a')][_0x601a('0x64')]||_0x45857d[_0x601a('0x6c')]['id'];_0x175237['agent']['id']=_0x45857d[_0x601a('0x5a')][_0x601a('0x64')];return db[_0x601a('0x53')]['find']({'where':{'id':_0x45857d[_0x601a('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x35e074,null))[_0x601a('0x22')](function(_0x5aeb4a){if(_0x5aeb4a){_0x175237[_0x601a('0x2a')]=_0x5aeb4a[_0x601a('0x66')]({'plain':!![]});return db[_0x601a('0x67')]['find']({'where':{'id':_0x5aeb4a[_0x601a('0x68')]}});}return null;})[_0x601a('0x22')](handleEntityNotFound(_0x35e074,null))[_0x601a('0x22')](function(_0x71a7b4){if(_0x71a7b4){_0x175237[_0x601a('0x6b')]=_0x71a7b4['get']({'plain':!![]});interaction_log[_0x601a('0x23')](_0x601a('0x84'),_0x45857d[_0x601a('0x6c')]['id'],_0x45857d['user'][_0x601a('0x3a')],_0x45857d[_0x601a('0x6c')]['role'],_0x175237[_0x601a('0x6b')]['id'],_0x45857d['body']?JSON[_0x601a('0x27')](_0x45857d['body']):_0x601a('0x6e'));return respondWithRpcPromise('RejectMessage',_0x601a('0x85'),_0x175237);}return null;})[_0x601a('0x22')](function(_0x5e6edf){var _0x43a354='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5e6edf['message']['ContactId'];return db['sequelize']['query'](_0x43a354,{'type':db['Sequelize'][_0x601a('0x75')][_0x601a('0x76')],'raw':!![]})['then'](function(_0xac6e06){return _0xac6e06;});})[_0x601a('0x22')](function(_0x4a6dfd){if(_0x4a6dfd){_0x175237[_0x601a('0x2a')]['contact']=_0x4a6dfd[0x0];if(!_0x45857d[_0x601a('0x5a')][_0x601a('0x64')])return;return db[_0x601a('0x78')]['find']({'where':{'id':_0x45857d[_0x601a('0x5a')][_0x601a('0x64')],'role':_0x601a('0x65')},'attributes':['id',_0x601a('0x3a'),_0x601a('0x79'),_0x601a('0x7a'),_0x601a('0x7b')],'raw':!![]});}return null;})[_0x601a('0x22')](function(_0x5e9fcc){if(!_0x5e9fcc)return null;_0x175237[_0x601a('0x2a')][_0x601a('0x65')]=_0x5e9fcc;return _0x175237;})[_0x601a('0x22')](function(_0x17f640){if(_0x17f640){_0x17f640[_0x601a('0x2a')]['interface']=util[_0x601a('0x62')](_0x601a('0x7e'),_0x45857d['user'][_0x601a('0x3a')]);_0x17f640[_0x601a('0x2a')][_0x601a('0x7f')]=_0x175237[_0x601a('0x7f')];_0x17f640[_0x601a('0x2a')][_0x601a('0x80')]=_0x175237[_0x601a('0x7f')];_0x17f640[_0x601a('0x2a')][_0x601a('0x81')]=_0x601a('0x34');respondWithRpcPromise('EventManager','EventManager',{'event':_0x601a('0x86'),'message':_0x17f640[_0x601a('0x2a')]},client9002);return _0x175237;}return null;})['then'](respondWithResult(_0x35e074,null))[_0x601a('0x2b')](handleError(_0x35e074,null));};exports[_0x601a('0x2d')]=function(_0x352577,_0x1c9a4b,_0x4e10a1){if(_0x352577[_0x601a('0x5a')]['id']){delete _0x352577[_0x601a('0x5a')]['id'];}var _0xf0373d;return db[_0x601a('0x53')][_0x601a('0x5b')]({'where':{'id':_0x352577[_0x601a('0x57')]['id']}})[_0x601a('0x22')](handleEntityNotFound(_0x1c9a4b,null))[_0x601a('0x22')](function(_0x209e90){if(_0x209e90){_0xf0373d=_0x209e90;return db[_0x601a('0x87')][_0x601a('0x5b')]({'where':{'id':_0x209e90[_0x601a('0x88')]}});}})['then'](handleEntityNotFound(_0x1c9a4b,null))[_0x601a('0x22')](function(_0x53b66a){if(_0x53b66a){logger[_0x601a('0x26')](_0x601a('0x89'),_0x601a('0x2d'),_0x601a('0x8a'),_0x53b66a[_0x601a('0x3e')],util[_0x601a('0x8b')](_0x352577[_0x601a('0x5a')],{'showHidden':![],'depth':null}));switch(_0x53b66a[_0x601a('0x3e')]){case _0x601a('0x8c'):if(_0x352577['body'][_0x601a('0x8d')]&&_0x352577['body'][_0x601a('0x8d')]===_0xf0373d[_0x601a('0x8e')]){return _0xf0373d[_0x601a('0x36')]({'read':!![]});}else{logger[_0x601a('0x28')](_0x601a('0x8f'),'status',_0x601a('0x8c'),util['inspect'](_0x352577[_0x601a('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x601a('0x90'):if(_0x352577[_0x601a('0x5a')][_0x601a('0x91')]&&_0x352577['body'][_0x601a('0x91')]===_0xf0373d['messageId']&&_[_0x601a('0x92')]([_0x601a('0x93'),'delivered'],_0x352577[_0x601a('0x5a')][_0x601a('0x94')])>=0x0){return _0xf0373d['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x601a('0x95'),util['inspect'](_0x352577[_0x601a('0x5a')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x46e6c1=_0x352577[_0x601a('0x5a')][_0x601a('0x96')][0x0];if(_0x46e6c1[_0x601a('0x2d')][_0x601a('0x97')]===_0x601a('0x98')){return _0xf0373d[_0x601a('0x36')]({'read':!![]});}else{logger[_0x601a('0x28')](_0x601a('0x8f'),_0x601a('0x2d'),_0x601a('0x99'),util[_0x601a('0x8b')](_0x352577[_0x601a('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0xf0373d;}})[_0x601a('0x22')](respondWithResult(_0x1c9a4b,null))[_0x601a('0x2b')](handleError(_0x1c9a4b,null));}; \ No newline at end of file +var _0x8ed7=['mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','reject','update','destroy','stack','name','send','index','SmsMessage','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','find','create','body','describe','sms-interactions','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','params','get','SmsInteraction','isNil','read1stAt','format','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','User','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','sms','RejectMessage','rejectMessage','fullname','rejectmessage','debug','inspect','twilio','MessageSid','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','messageId','indexOf','sent','delivered','Status','plivio','infobip','results','DELIVERED','rimraf','zip-dir','fast-json-patch','bluebird'];(function(_0x230101,_0x4e9e49){var _0x5ab952=function(_0x228b87){while(--_0x228b87){_0x230101['push'](_0x230101['shift']());}};_0x5ab952(++_0x4e9e49);}(_0x8ed7,0x8b));var _0x78ed=function(_0x2c680d,_0x546cd8){_0x2c680d=_0x2c680d-0x0;var _0x13e5d1=_0x8ed7[_0x2c680d];return _0x13e5d1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x78ed('0x0'));var zipdir=require(_0x78ed('0x1'));var jsonpatch=require(_0x78ed('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x78ed('0x3'));var Mustache=require(_0x78ed('0x4'));var util=require(_0x78ed('0x5'));var path=require(_0x78ed('0x6'));var sox=require(_0x78ed('0x7'));var csv=require(_0x78ed('0x8'));var ejs=require(_0x78ed('0x9'));var fs=require('fs');var fs_extra=require(_0x78ed('0xa'));var _=require(_0x78ed('0xb'));var squel=require('squel');var crypto=require(_0x78ed('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x78ed('0xd'));var toCsv=require('to-csv');var querystring=require(_0x78ed('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x78ed('0xf'));var qs=require(_0x78ed('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x78ed('0x11'));var logger=require(_0x78ed('0x12'))('api');var utils=require(_0x78ed('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x78ed('0x14'));var db=require(_0x78ed('0x15'))['db'];config[_0x78ed('0x16')]=_[_0x78ed('0x17')](config[_0x78ed('0x16')],{'host':_0x78ed('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x78ed('0x16')]));require('./smsMessage.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x78ed('0x19')][_0x78ed('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x2e9007,_0x195b7e,_0x250d59,_0x454a65){return new BPromise(function(_0x336ae1,_0x29048d){var _0x17d0d6=_0x454a65||client;return _0x17d0d6[_0x78ed('0x1b')](_0x2e9007,_0x250d59)[_0x78ed('0x1c')](function(_0x4b9797){logger[_0x78ed('0x1d')](_0x78ed('0x1e'),_0x195b7e,'request\x20sent');logger['debug'](_0x78ed('0x1f'),_0x195b7e,_0x78ed('0x20'),JSON[_0x78ed('0x21')](_0x4b9797));if(_0x4b9797[_0x78ed('0x22')]){if(_0x4b9797[_0x78ed('0x22')][_0x78ed('0x23')]===0x1f4){logger[_0x78ed('0x22')](_0x78ed('0x1e'),_0x195b7e,_0x4b9797[_0x78ed('0x22')][_0x78ed('0x24')]);return _0x29048d(_0x4b9797[_0x78ed('0x22')]['message']);}logger['error'](_0x78ed('0x1e'),_0x195b7e,_0x4b9797['error'][_0x78ed('0x24')]);return _0x336ae1(_0x4b9797['error'][_0x78ed('0x24')]);}else{logger['info'](_0x78ed('0x1e'),_0x195b7e,_0x78ed('0x20'));_0x336ae1(_0x4b9797[_0x78ed('0x25')]['message']);}})[_0x78ed('0x26')](function(_0x5a8b87){logger[_0x78ed('0x22')](_0x78ed('0x1e'),_0x195b7e,_0x5a8b87);_0x29048d(_0x5a8b87);});});}function respondWithStatusCode(_0x34fb0e,_0x59349a){_0x59349a=_0x59349a||0xcc;return function(_0x5abe1b){if(_0x5abe1b){return _0x34fb0e[_0x78ed('0x27')](_0x59349a);}return _0x34fb0e['status'](_0x59349a)[_0x78ed('0x28')]();};}function respondWithResult(_0x55c5ed,_0x12d5e1){_0x12d5e1=_0x12d5e1||0xc8;return function(_0x1433e1){if(_0x1433e1){return _0x55c5ed[_0x78ed('0x29')](_0x12d5e1)[_0x78ed('0x2a')](_0x1433e1);}};}function respondWithFilteredResult(_0xafc1cf,_0x624bb1){return function(_0x3cd100){if(_0x3cd100){var _0x312801=typeof _0x624bb1[_0x78ed('0x2b')]==='undefined'&&typeof _0x624bb1[_0x78ed('0x2c')]===_0x78ed('0x2d');var _0x2a66ce=_0x3cd100[_0x78ed('0x2e')];var _0x4af685=_0x312801?0x0:_0x624bb1['offset'];var _0x5da4d0=_0x312801?_0x3cd100['count']:_0x624bb1[_0x78ed('0x2b')]+_0x624bb1[_0x78ed('0x2c')];var _0x17883d;if(_0x5da4d0>=_0x2a66ce){_0x5da4d0=_0x2a66ce;_0x17883d=0xc8;}else{_0x17883d=0xce;}_0xafc1cf[_0x78ed('0x29')](_0x17883d);return _0xafc1cf[_0x78ed('0x2f')](_0x78ed('0x30'),_0x4af685+'-'+_0x5da4d0+'/'+_0x2a66ce)[_0x78ed('0x2a')](_0x3cd100);}return null;};}function patchUpdates(_0x550956){return function(_0x24c908){try{jsonpatch['apply'](_0x24c908,_0x550956,!![]);}catch(_0x210e9d){return BPromise[_0x78ed('0x31')](_0x210e9d);}return _0x24c908['save']();};}function saveUpdates(_0x13a9db,_0x179d1d){return function(_0x13c39c){if(_0x13c39c){return _0x13c39c[_0x78ed('0x32')](_0x13a9db)[_0x78ed('0x1c')](function(_0x19bd3b){return _0x19bd3b;});}return null;};}function removeEntity(_0x135a8f,_0x45831d){return function(_0x4da527){if(_0x4da527){return _0x4da527[_0x78ed('0x33')]()['then'](function(){_0x135a8f[_0x78ed('0x29')](0xcc)[_0x78ed('0x28')]();});}};}function handleEntityNotFound(_0x3b8e9c,_0x963ece){return function(_0x437852){if(!_0x437852){_0x3b8e9c[_0x78ed('0x27')](0x194);}return _0x437852;};}function handleError(_0x2031eb,_0x47f969){_0x47f969=_0x47f969||0x1f4;return function(_0x2ac50){logger[_0x78ed('0x22')](_0x2ac50[_0x78ed('0x34')]);if(_0x2ac50[_0x78ed('0x35')]){delete _0x2ac50[_0x78ed('0x35')];}_0x2031eb[_0x78ed('0x29')](_0x47f969)[_0x78ed('0x36')](_0x2ac50);};}exports[_0x78ed('0x37')]=function(_0x3ba9e8,_0x1b30f6){var _0x1e3ead={},_0x59d30a={},_0x4b1bef={'count':0x0,'rows':[]};var _0x23e51b=_['map'](db[_0x78ed('0x38')][_0x78ed('0x39')],function(_0x4edc9c){return{'name':_0x4edc9c[_0x78ed('0x3a')],'type':_0x4edc9c[_0x78ed('0x3b')][_0x78ed('0x3c')]};});_0x59d30a[_0x78ed('0x3d')]=_[_0x78ed('0x3e')](_0x23e51b,_0x78ed('0x35'));_0x59d30a['query']=_[_0x78ed('0x3f')](_0x3ba9e8[_0x78ed('0x40')]);_0x59d30a[_0x78ed('0x41')]=_[_0x78ed('0x42')](_0x59d30a['model'],_0x59d30a['query']);_0x1e3ead[_0x78ed('0x43')]=_[_0x78ed('0x42')](_0x59d30a['model'],qs[_0x78ed('0x44')](_0x3ba9e8[_0x78ed('0x40')]['fields']));_0x1e3ead['attributes']=_0x1e3ead[_0x78ed('0x43')][_0x78ed('0x45')]?_0x1e3ead[_0x78ed('0x43')]:_0x59d30a[_0x78ed('0x3d')];if(!_0x3ba9e8['query']['hasOwnProperty'](_0x78ed('0x46'))){_0x1e3ead[_0x78ed('0x2c')]=qs['limit'](_0x3ba9e8[_0x78ed('0x40')]['limit']);_0x1e3ead[_0x78ed('0x2b')]=qs[_0x78ed('0x2b')](_0x3ba9e8[_0x78ed('0x40')][_0x78ed('0x2b')]);}_0x1e3ead[_0x78ed('0x47')]=qs['sort'](_0x3ba9e8[_0x78ed('0x40')][_0x78ed('0x48')]);_0x1e3ead[_0x78ed('0x49')]=qs[_0x78ed('0x41')](_[_0x78ed('0x4a')](_0x3ba9e8['query'],_0x59d30a['filters']),_0x23e51b);if(_0x3ba9e8[_0x78ed('0x40')][_0x78ed('0x4b')]){_0x1e3ead[_0x78ed('0x49')]=_[_0x78ed('0x4c')](_0x1e3ead['where'],{'$or':_[_0x78ed('0x3e')](_0x23e51b,function(_0x16223d){if(_0x16223d[_0x78ed('0x3b')]!==_0x78ed('0x4d')){var _0x103eb1={};_0x103eb1[_0x16223d[_0x78ed('0x35')]]={'$like':'%'+_0x3ba9e8['query'][_0x78ed('0x4b')]+'%'};return _0x103eb1;}})});}_0x1e3ead=_['merge']({},_0x1e3ead,_0x3ba9e8[_0x78ed('0x4e')]);var _0x59b8f4={'where':_0x1e3ead[_0x78ed('0x49')]};return db[_0x78ed('0x38')][_0x78ed('0x2e')](_0x59b8f4)[_0x78ed('0x1c')](function(_0x329e1d){_0x4b1bef['count']=_0x329e1d;if(_0x3ba9e8['query'][_0x78ed('0x4f')]){_0x1e3ead[_0x78ed('0x50')]=[{'all':!![]}];}return db[_0x78ed('0x38')]['findAll'](_0x1e3ead);})[_0x78ed('0x1c')](function(_0x439883){_0x4b1bef[_0x78ed('0x51')]=_0x439883;return _0x4b1bef;})['then'](respondWithFilteredResult(_0x1b30f6,_0x1e3ead))['catch'](handleError(_0x1b30f6,null));};exports[_0x78ed('0x52')]=function(_0x4ae8f5,_0x1a79df){var _0xc7a4e1={'raw':!![],'where':{'id':_0x4ae8f5['params']['id']}},_0x4b0b36={};_0x4b0b36[_0x78ed('0x3d')]=_[_0x78ed('0x3f')](db[_0x78ed('0x38')][_0x78ed('0x39')]);_0x4b0b36[_0x78ed('0x40')]=_[_0x78ed('0x3f')](_0x4ae8f5[_0x78ed('0x40')]);_0x4b0b36[_0x78ed('0x41')]=_[_0x78ed('0x42')](_0x4b0b36[_0x78ed('0x3d')],_0x4b0b36[_0x78ed('0x40')]);_0xc7a4e1[_0x78ed('0x43')]=_[_0x78ed('0x42')](_0x4b0b36[_0x78ed('0x3d')],qs['fields'](_0x4ae8f5[_0x78ed('0x40')][_0x78ed('0x44')]));_0xc7a4e1['attributes']=_0xc7a4e1[_0x78ed('0x43')][_0x78ed('0x45')]?_0xc7a4e1[_0x78ed('0x43')]:_0x4b0b36[_0x78ed('0x3d')];if(_0x4ae8f5[_0x78ed('0x40')]['includeAll']){_0xc7a4e1[_0x78ed('0x50')]=[{'all':!![]}];}_0xc7a4e1=_['merge']({},_0xc7a4e1,_0x4ae8f5[_0x78ed('0x4e')]);return db[_0x78ed('0x38')][_0x78ed('0x53')](_0xc7a4e1)[_0x78ed('0x1c')](handleEntityNotFound(_0x1a79df,null))[_0x78ed('0x1c')](respondWithResult(_0x1a79df,null))[_0x78ed('0x26')](handleError(_0x1a79df,null));};exports['create']=function(_0x537938,_0x226598){return db['SmsMessage'][_0x78ed('0x54')](_0x537938[_0x78ed('0x55')],{})[_0x78ed('0x1c')](respondWithResult(_0x226598,0xc9))[_0x78ed('0x26')](handleError(_0x226598,null));};exports['update']=function(_0x2d8326,_0x8ce62a){if(_0x2d8326[_0x78ed('0x55')]['id']){delete _0x2d8326[_0x78ed('0x55')]['id'];}return db[_0x78ed('0x38')][_0x78ed('0x53')]({'where':{'id':_0x2d8326['params']['id']}})[_0x78ed('0x1c')](handleEntityNotFound(_0x8ce62a,null))[_0x78ed('0x1c')](saveUpdates(_0x2d8326['body'],null))[_0x78ed('0x1c')](respondWithResult(_0x8ce62a,null))[_0x78ed('0x26')](handleError(_0x8ce62a,null));};exports[_0x78ed('0x33')]=function(_0x567523,_0x10a410){return db['SmsMessage'][_0x78ed('0x53')]({'where':{'id':_0x567523['params']['id']}})['then'](handleEntityNotFound(_0x10a410,null))[_0x78ed('0x1c')](removeEntity(_0x10a410,null))[_0x78ed('0x26')](handleError(_0x10a410,null));};exports[_0x78ed('0x56')]=function(_0x32ec7b,_0x3e36d5){return db[_0x78ed('0x38')][_0x78ed('0x56')]()[_0x78ed('0x1c')](respondWithResult(_0x3e36d5,null))[_0x78ed('0x26')](handleError(_0x3e36d5,null));};var interaction_log=require(_0x78ed('0x12'))(_0x78ed('0x57'));exports[_0x78ed('0x58')]=function(_0x4ab8eb,_0x3f62b0,_0x2b44de){var _0x1095c7={'agent':{},'channel':'sms'};if(_0x4ab8eb['body']['id']){delete _0x4ab8eb[_0x78ed('0x55')]['id'];}_0x4ab8eb[_0x78ed('0x55')][_0x78ed('0x59')]=!![];_0x4ab8eb[_0x78ed('0x55')][_0x78ed('0x5a')]=moment()['format'](_0x78ed('0x5b'));_0x4ab8eb[_0x78ed('0x55')][_0x78ed('0x5c')]=_0x4ab8eb['body'][_0x78ed('0x5c')]||_0x4ab8eb[_0x78ed('0x5d')]['id'];_0x1095c7[_0x78ed('0x5e')]['id']=_0x4ab8eb[_0x78ed('0x55')][_0x78ed('0x5c')];return db[_0x78ed('0x38')][_0x78ed('0x53')]({'where':{'id':_0x4ab8eb[_0x78ed('0x5f')]['id'],'UserId':null}})[_0x78ed('0x1c')](handleEntityNotFound(_0x3f62b0,null))['then'](saveUpdates(_0x4ab8eb[_0x78ed('0x55')],null))[_0x78ed('0x1c')](function(_0x3fa09e){if(_0x3fa09e){_0x1095c7[_0x78ed('0x24')]=_0x3fa09e[_0x78ed('0x60')]({'plain':!![]});return db[_0x78ed('0x61')][_0x78ed('0x53')]({'where':{'id':_0x3fa09e['SmsInteractionId']}});}return null;})[_0x78ed('0x1c')](handleEntityNotFound(_0x3f62b0,null))[_0x78ed('0x1c')](function(_0x125ecd){if(_0x125ecd){return _0x125ecd['update']({'UserId':_0x4ab8eb[_0x78ed('0x55')][_0x78ed('0x5c')],'read1stAt':_[_0x78ed('0x62')](_0x125ecd[_0x78ed('0x63')])?moment()[_0x78ed('0x64')](_0x78ed('0x5b')):undefined});}return null;})[_0x78ed('0x1c')](function(_0x47d00c){if(_0x47d00c){_0x1095c7['interaction']=_0x47d00c[_0x78ed('0x60')]({'plain':!![]});interaction_log[_0x78ed('0x1d')](_0x78ed('0x65'),_0x4ab8eb['user']['id'],_0x4ab8eb[_0x78ed('0x5d')]['name'],_0x4ab8eb['user'][_0x78ed('0x66')],_0x1095c7[_0x78ed('0x67')]['id'],_0x4ab8eb['body']?JSON[_0x78ed('0x21')](_0x4ab8eb['body']):_0x78ed('0x68'));return respondWithRpcPromise('AcceptMessage',_0x78ed('0x69'),_0x1095c7);}return null;})[_0x78ed('0x1c')](function(_0x26729f){var _0x5bd44a=_0x78ed('0x6a')+_0x26729f[_0x78ed('0x24')]['ContactId'];return db[_0x78ed('0x6b')][_0x78ed('0x40')](_0x5bd44a,{'type':db[_0x78ed('0x6c')][_0x78ed('0x6d')][_0x78ed('0x6e')],'raw':!![]})[_0x78ed('0x1c')](function(_0x46e8cb){return _0x46e8cb;});})['then'](function(_0x238cd2){if(_0x238cd2){_0x1095c7[_0x78ed('0x24')][_0x78ed('0x6f')]=_0x238cd2[0x0];if(!_0x4ab8eb['body'][_0x78ed('0x5c')])return;return db[_0x78ed('0x70')][_0x78ed('0x53')]({'where':{'id':_0x4ab8eb['body'][_0x78ed('0x5c')],'role':_0x78ed('0x5e')},'attributes':['id',_0x78ed('0x35'),'fullname',_0x78ed('0x71'),_0x78ed('0x72')],'raw':!![]});}return null;})['then'](function(_0x307d2c){if(!_0x307d2c)return null;_0x1095c7[_0x78ed('0x24')][_0x78ed('0x5e')]=_0x307d2c;return _0x1095c7;})[_0x78ed('0x1c')](function(_0x5d1794){if(_0x5d1794){if(_0x4ab8eb['body'][_0x78ed('0x73')]){_0x1095c7[_0x78ed('0x24')][_0x78ed('0x74')]=util[_0x78ed('0x64')](_0x78ed('0x75'),_0x4ab8eb[_0x78ed('0x5d')][_0x78ed('0x35')]);_0x1095c7[_0x78ed('0x24')][_0x78ed('0x76')]=_0x1095c7['channel'];_0x1095c7['message'][_0x78ed('0x77')]=_0x1095c7[_0x78ed('0x76')];_0x1095c7[_0x78ed('0x24')][_0x78ed('0x78')]=_0x78ed('0x58');return respondWithRpcPromise(_0x78ed('0x79'),_0x78ed('0x79'),{'event':'acceptmessage','message':_0x1095c7[_0x78ed('0x24')]},client9002)[_0x78ed('0x1c')](function(){return _0x1095c7;});}return _0x1095c7;}return null;})[_0x78ed('0x1c')](respondWithResult(_0x3f62b0,null))[_0x78ed('0x26')](handleError(_0x3f62b0,null));};var interaction_log=require(_0x78ed('0x12'))('sms-interactions');exports['reject']=function(_0x19ee8d,_0x118d2b,_0x413d2c){var _0x4b8f41={'agent':{},'channel':_0x78ed('0x7a')};if(_0x19ee8d[_0x78ed('0x55')]['id']){delete _0x19ee8d[_0x78ed('0x55')]['id'];}_0x19ee8d[_0x78ed('0x55')][_0x78ed('0x5c')]=_0x19ee8d[_0x78ed('0x55')]['UserId']||_0x19ee8d[_0x78ed('0x5d')]['id'];_0x4b8f41[_0x78ed('0x5e')]['id']=_0x19ee8d[_0x78ed('0x55')]['UserId'];return db[_0x78ed('0x38')]['find']({'where':{'id':_0x19ee8d[_0x78ed('0x5f')]['id'],'UserId':null}})[_0x78ed('0x1c')](handleEntityNotFound(_0x118d2b,null))[_0x78ed('0x1c')](function(_0x28a197){if(_0x28a197){_0x4b8f41['message']=_0x28a197[_0x78ed('0x60')]({'plain':!![]});return db[_0x78ed('0x61')][_0x78ed('0x53')]({'where':{'id':_0x28a197['SmsInteractionId']}});}return null;})[_0x78ed('0x1c')](handleEntityNotFound(_0x118d2b,null))[_0x78ed('0x1c')](function(_0x398b51){if(_0x398b51){_0x4b8f41[_0x78ed('0x67')]=_0x398b51[_0x78ed('0x60')]({'plain':!![]});interaction_log['info']('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x19ee8d[_0x78ed('0x5d')]['id'],_0x19ee8d[_0x78ed('0x5d')][_0x78ed('0x35')],_0x19ee8d[_0x78ed('0x5d')][_0x78ed('0x66')],_0x4b8f41[_0x78ed('0x67')]['id'],_0x19ee8d[_0x78ed('0x55')]?JSON[_0x78ed('0x21')](_0x19ee8d[_0x78ed('0x55')]):_0x78ed('0x68'));return respondWithRpcPromise(_0x78ed('0x7b'),_0x78ed('0x7c'),_0x4b8f41);}return null;})[_0x78ed('0x1c')](function(_0x520663){var _0x4819f3=_0x78ed('0x6a')+_0x520663[_0x78ed('0x24')]['ContactId'];return db[_0x78ed('0x6b')][_0x78ed('0x40')](_0x4819f3,{'type':db[_0x78ed('0x6c')][_0x78ed('0x6d')]['SELECT'],'raw':!![]})[_0x78ed('0x1c')](function(_0x294974){return _0x294974;});})[_0x78ed('0x1c')](function(_0x5a096f){if(_0x5a096f){_0x4b8f41['message'][_0x78ed('0x6f')]=_0x5a096f[0x0];if(!_0x19ee8d[_0x78ed('0x55')][_0x78ed('0x5c')])return;return db['User'][_0x78ed('0x53')]({'where':{'id':_0x19ee8d[_0x78ed('0x55')]['UserId'],'role':_0x78ed('0x5e')},'attributes':['id',_0x78ed('0x35'),_0x78ed('0x7d'),_0x78ed('0x71'),_0x78ed('0x72')],'raw':!![]});}return null;})[_0x78ed('0x1c')](function(_0x4e7c85){if(!_0x4e7c85)return null;_0x4b8f41[_0x78ed('0x24')][_0x78ed('0x5e')]=_0x4e7c85;return _0x4b8f41;})[_0x78ed('0x1c')](function(_0x2e9c9a){if(_0x2e9c9a){_0x2e9c9a['message']['interface']=util['format'](_0x78ed('0x75'),_0x19ee8d['user'][_0x78ed('0x35')]);_0x2e9c9a[_0x78ed('0x24')][_0x78ed('0x76')]=_0x4b8f41['channel'];_0x2e9c9a[_0x78ed('0x24')][_0x78ed('0x77')]=_0x4b8f41['channel'];_0x2e9c9a[_0x78ed('0x24')][_0x78ed('0x78')]=_0x78ed('0x31');respondWithRpcPromise('EventManager','EventManager',{'event':_0x78ed('0x7e'),'message':_0x2e9c9a[_0x78ed('0x24')]},client9002);return _0x4b8f41;}return null;})[_0x78ed('0x1c')](respondWithResult(_0x118d2b,null))[_0x78ed('0x26')](handleError(_0x118d2b,null));};exports['status']=function(_0xd32472,_0x4859a1,_0x5da3e1){if(_0xd32472[_0x78ed('0x55')]['id']){delete _0xd32472[_0x78ed('0x55')]['id'];}var _0x305e8b;return db[_0x78ed('0x38')]['find']({'where':{'id':_0xd32472[_0x78ed('0x5f')]['id']}})[_0x78ed('0x1c')](handleEntityNotFound(_0x4859a1,null))['then'](function(_0x4fba55){if(_0x4fba55){_0x305e8b=_0x4fba55;return db['SmsAccount'][_0x78ed('0x53')]({'where':{'id':_0x4fba55['SmsAccountId']}});}})[_0x78ed('0x1c')](handleEntityNotFound(_0x4859a1,null))[_0x78ed('0x1c')](function(_0x199174){if(_0x199174){logger[_0x78ed('0x7f')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x78ed('0x29'),'received\x20delivery\x20report\x20from',_0x199174[_0x78ed('0x3b')],util[_0x78ed('0x80')](_0xd32472[_0x78ed('0x55')],{'showHidden':![],'depth':null}));switch(_0x199174[_0x78ed('0x3b')]){case _0x78ed('0x81'):if(_0xd32472['body'][_0x78ed('0x82')]&&_0xd32472[_0x78ed('0x55')][_0x78ed('0x82')]===_0x305e8b['messageId']){return _0x305e8b['update']({'read':!![]});}else{logger['error'](_0x78ed('0x83'),_0x78ed('0x29'),_0x78ed('0x81'),util[_0x78ed('0x80')](_0xd32472[_0x78ed('0x55')],{'showHidden':![],'depth':null}));}break;case _0x78ed('0x84'):if(_0xd32472['body'][_0x78ed('0x85')]&&_0xd32472['body'][_0x78ed('0x85')]===_0x305e8b[_0x78ed('0x86')]&&_[_0x78ed('0x87')]([_0x78ed('0x88'),_0x78ed('0x89')],_0xd32472[_0x78ed('0x55')][_0x78ed('0x8a')])>=0x0){return _0x305e8b[_0x78ed('0x32')]({'read':!![]});}else{logger[_0x78ed('0x22')](_0x78ed('0x83'),_0x78ed('0x29'),_0x78ed('0x8b'),util[_0x78ed('0x80')](_0xd32472[_0x78ed('0x55')],{'showHidden':![],'depth':null}));}break;case _0x78ed('0x8c'):var _0x5c1b67=_0xd32472['body'][_0x78ed('0x8d')][0x0];if(_0x5c1b67[_0x78ed('0x29')]['groupName']===_0x78ed('0x8e')){return _0x305e8b[_0x78ed('0x32')]({'read':!![]});}else{logger[_0x78ed('0x22')](_0x78ed('0x83'),'status',_0x78ed('0x8c'),util['inspect'](_0xd32472[_0x78ed('0x55')],{'showHidden':![],'depth':null}));}break;}return _0x305e8b;}})[_0x78ed('0x1c')](respondWithResult(_0x4859a1,null))[_0x78ed('0x26')](handleError(_0x4859a1,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 581af28..d50bcb3 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 _0xb64b=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','SmsMessage','save'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xb64b,0x15b));var _0xbb64=function(_0x243cca,_0x514c2d){_0x243cca=_0x243cca-0x0;var _0xf94771=_0xb64b[_0x243cca];return _0xf94771;};'use strict';var EventEmitter=require(_0xbb64('0x0'));var SmsMessage=require(_0xbb64('0x1'))['db'][_0xbb64('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbb64('0x3'),'afterUpdate':_0xbb64('0x4'),'afterDestroy':_0xbb64('0x5')};function emitEvent(_0x27165f){return function(_0x4024c5,_0x5d44a1,_0x13fd7b){SmsMessageEvents[_0xbb64('0x6')](_0x27165f+':'+_0x4024c5['id'],_0x4024c5);SmsMessageEvents[_0xbb64('0x6')](_0x27165f,_0x4024c5);_0x13fd7b(null);};}for(var e in events){if(events[_0xbb64('0x7')](e)){var event=events[e];SmsMessage[_0xbb64('0x8')](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file +var _0xf980=['hasOwnProperty','hook','SmsMessage','setMaxListeners','save','emit'];(function(_0x5acd96,_0x5672e2){var _0x34687b=function(_0x479a02){while(--_0x479a02){_0x5acd96['push'](_0x5acd96['shift']());}};_0x34687b(++_0x5672e2);}(_0xf980,0xf8));var _0x0f98=function(_0x526818,_0x30c916){_0x526818=_0x526818-0x0;var _0x44c7e3=_0xf980[_0x526818];return _0x44c7e3;};'use strict';var EventEmitter=require('events');var SmsMessage=require('../../mysqldb')['db'][_0x0f98('0x0')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x0f98('0x1')](0x0);var events={'afterCreate':_0x0f98('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x46d2aa){return function(_0x34906f,_0x5d9318,_0x253c56){SmsMessageEvents[_0x0f98('0x3')](_0x46d2aa+':'+_0x34906f['id'],_0x34906f);SmsMessageEvents['emit'](_0x46d2aa,_0x34906f);_0x253c56(null);};}for(var e in events){if(events[_0x0f98('0x4')](e)){var event=events[e];SmsMessage[_0x0f98('0x5')](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index b1e14b6..75f6aa7 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 _0x6c85=['bandwidth','accountId','/messages','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','status','refid','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','SmsInteractionId','SmsInteraction','findOne','update','createdAt','error','SmsAccount','find','then','type','accountSid','phone','create','body','remote','/api/sms/messages/','/status?token=','token','catch','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','&password=','GET','split','sms','POST','user_key','session_key','total_sent','internal_order_id','read','Missing\x20parameters:\x20username,\x20password','connectel','authToken','https://smsapi.connectel.se/api/v2/send/','requestid','Missing\x20parameters:\x20authToken','clicksend','%s:%s','https://rest.clicksend.com/v3/sms/send','format','Basic\x20%s','toString','base64','http_code','queued_count','head','data','messages','message_id','deliveryReport','clickSend','plivo','authId','senderString','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','csc','apiKey','login','text','timestamp','sort','length','createHash','digest','hex','signature=','/external/get/send.php?','keys','id_sms','Missing\x20parameters:\x20apiKey','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','clickatell'];(function(_0x40e973,_0x54e9f5){var _0x532ae7=function(_0xad5cd8){while(--_0xad5cd8){_0x40e973['push'](_0x40e973['shift']());}};_0x532ae7(++_0x54e9f5);}(_0x6c85,0x19b));var _0x56c8=function(_0x15689f,_0x288ea5){_0x15689f=_0x15689f-0x0;var _0x2cbe71=_0x6c85[_0x15689f];return _0x2cbe71;};'use strict';var _=require(_0x56c8('0x0'));var util=require('util');var logger=require(_0x56c8('0x1'))(_0x56c8('0x2'));var moment=require(_0x56c8('0x3'));var BPromise=require(_0x56c8('0x4'));var rp=require(_0x56c8('0x5'));var fs=require('fs');var path=require(_0x56c8('0x6'));var rimraf=require('rimraf');var config=require(_0x56c8('0x7'));var attributes=require(_0x56c8('0x8'));module[_0x56c8('0x9')]=function(_0xca48ba,_0xa9c678){return _0xca48ba[_0x56c8('0xa')](_0x56c8('0xb'),attributes,{'tableName':_0x56c8('0xc'),'paranoid':![],'indexes':[{'name':_0x56c8('0xd'),'fields':[_0x56c8('0xd')]},{'name':_0x56c8('0xe'),'fields':['body'],'type':_0x56c8('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x31cde2,_0x1f87a9,_0x276fe8){var _0xe45437=_0xca48ba[_0x56c8('0x10')];var _0x5c7d4a=_0x31cde2[_0x56c8('0x11')]({'plain':!![]});if(_0x5c7d4a[_0x56c8('0x12')][_0x56c8('0x13')]()==='in'||_0x5c7d4a[_0x56c8('0x12')][_0x56c8('0x13')]()===_0x56c8('0x14')&&!_0x5c7d4a[_0x56c8('0x15')]&&!_[_0x56c8('0x16')](_0x5c7d4a[_0x56c8('0x17')])&&!_[_0x56c8('0x16')](_0x5c7d4a[_0x56c8('0x18')])){_0xe45437[_0x56c8('0x19')][_0x56c8('0x1a')]({'where':{'id':_0x5c7d4a['SmsInteractionId']}})['then'](function(_0x1766d5){if(_0x1766d5){_0x1766d5[_0x56c8('0x1b')]({'lastMsgAt':_0x5c7d4a[_0x56c8('0x1c')],'lastMsgDirection':_0x5c7d4a[_0x56c8('0x12')][_0x56c8('0x13')]()});}})['catch'](function(_0x406925){console[_0x56c8('0x1d')](_0x406925);});}if(_0x5c7d4a[_0x56c8('0x12')]==='out'&&!_0x5c7d4a[_0x56c8('0x15')]){var _0x129947;_0xe45437[_0x56c8('0x1e')][_0x56c8('0x1f')]({'where':{'id':_0x5c7d4a['SmsAccountId']},'raw':!![]})[_0x56c8('0x20')](function(_0x455826){_0x129947=_0x455826;if(_0x129947&&_0x129947['type']){switch(_0x129947[_0x56c8('0x21')]){case'twilio':var _0x5dea39=require('twilio');if(_0x129947[_0x56c8('0x22')]&&_0x129947['authToken']&&_0x129947[_0x56c8('0x23')]){var _0x2d749b=new _0x5dea39(_0x129947[_0x56c8('0x22')],_0x129947['authToken']);_0x2d749b['messages'][_0x56c8('0x24')]({'body':_0x5c7d4a[_0x56c8('0x25')],'to':_0x5c7d4a[_0x56c8('0x23')],'from':_0x129947[_0x56c8('0x23')],'statusCallback':_0x129947[_0x56c8('0x26')]+_0x56c8('0x27')+_0x5c7d4a['id']+_0x56c8('0x28')+_0x129947[_0x56c8('0x29')]})['then'](function(_0x43c382){if(_0x43c382['sid']){return _0x31cde2[_0x56c8('0x1b')]({'messageId':_0x43c382['sid']});}})[_0x56c8('0x2a')](function(_0x1aefb9){logger[_0x56c8('0x1d')](_0x56c8('0x2b'),_0x56c8('0x2c'),'twilio',util[_0x56c8('0x2d')](_0x1aefb9,{'showHidden':![],'depth':null}));});}else{logger[_0x56c8('0x1d')](_0x56c8('0x2b'),'afterCreate',_0x56c8('0x2e'),_0x56c8('0x2f'));}break;case _0x56c8('0x30'):var _0x45415c=_0x56c8('0x31');if(_0x129947[_0x56c8('0x32')]&&_0x129947[_0x56c8('0x33')]){var _0x31833a={'recipient':[_0x5c7d4a['phone']],'message':_0x5c7d4a[_0x56c8('0x25')],'message_type':_0x129947[_0x56c8('0x34')]};if(_0x129947[_0x56c8('0x34')]&&_0x129947[_0x56c8('0x34')]!=='SI'){_0x31833a[_0x56c8('0x35')]=_0x129947[_0x56c8('0x23')];}var _0x172acc={'url':_0x45415c+'login?username='+_0x129947[_0x56c8('0x32')]+_0x56c8('0x36')+_0x129947['password'],'method':_0x56c8('0x37')};rp(_0x172acc)[_0x56c8('0x20')](function(_0x7d07a5){var _0x5e6414=_0x7d07a5[_0x56c8('0x38')](';');var _0x58c91c={'user_key':_0x5e6414[0x0],'session_key':_0x5e6414[0x1]};_0x172acc={'url':_0x45415c+_0x56c8('0x39'),'method':_0x56c8('0x3a'),'headers':{'user_key':_0x58c91c[_0x56c8('0x3b')],'Session_key':_0x58c91c[_0x56c8('0x3c')]},'json':!![],'body':_0x31833a};return rp(_0x172acc);})[_0x56c8('0x20')](function(_0xbd1f63){if(_0xbd1f63[_0x56c8('0x3d')]>=0x1){var _0x3237d4={'messageId':_0xbd1f63[_0x56c8('0x3e')]};if(_0x129947[_0x56c8('0x34')]!=='GP'||!_0x129947['deliveryReport']){_0x3237d4[_0x56c8('0x3f')]=!![];}return _0x31cde2[_0x56c8('0x1b')](_0x3237d4);}else{return logger[_0x56c8('0x1d')](_0x56c8('0x2b'),'afterCreate',_0x56c8('0x30'),util[_0x56c8('0x2d')](_0xbd1f63,{'showHidden':![],'depth':null}));}})['catch'](function(_0x58bb33){return logger[_0x56c8('0x1d')](_0x56c8('0x2b'),_0x56c8('0x2c'),_0x56c8('0x30'),util['inspect'](_0x58bb33,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x56c8('0x2b'),_0x56c8('0x2c'),_0x56c8('0x30'),_0x56c8('0x40'));}break;case _0x56c8('0x41'):if(_0x129947[_0x56c8('0x42')]){var _0x590369={'recipient':_0x5c7d4a['phone'],'message':_0x5c7d4a[_0x56c8('0x25')],'sender':_0x129947['senderString']||_0x129947[_0x56c8('0x23')],'authorization':_0x129947['authToken']};var _0x1f87a9={'method':_0x56c8('0x3a'),'uri':_0x56c8('0x43'),'body':_0x590369,'json':!![]};rp(_0x1f87a9)[_0x56c8('0x20')](function(_0x4279b0){var _0x19f8dc={'messageId':_0x4279b0[_0x56c8('0x44')]};if(!_0x129947['deliveryReport']){_0x19f8dc['read']=!![];}return _0x31cde2[_0x56c8('0x1b')](_0x19f8dc);})['catch'](function(_0x566818){logger[_0x56c8('0x1d')](_0x56c8('0x2b'),_0x56c8('0x2c'),_0x56c8('0x41'),util[_0x56c8('0x2d')](_0x566818,{'showHidden':![],'depth':null}));});}else{logger[_0x56c8('0x1d')](_0x56c8('0x2b'),_0x56c8('0x2c'),_0x56c8('0x41'),_0x56c8('0x45'));}break;case _0x56c8('0x46'):if(_0x129947[_0x56c8('0x32')]&&_0x129947['password']){var _0x590369={'messages':[{'source':'xCALLY\x20Motion','to':_0x5c7d4a[_0x56c8('0x23')],'body':_0x5c7d4a[_0x56c8('0x25')],'from':_0x129947['senderString']||_0x129947['phone']}]};var _0x41b276=util['format'](_0x56c8('0x47'),_0x129947[_0x56c8('0x32')],_0x129947[_0x56c8('0x33')]);var _0x1f87a9={'method':'POST','uri':_0x56c8('0x48'),'body':_0x590369,'headers':{'Authorization':util[_0x56c8('0x49')](_0x56c8('0x4a'),new Buffer(_0x41b276)[_0x56c8('0x4b')](_0x56c8('0x4c')))},'json':!![]};rp(_0x1f87a9)[_0x56c8('0x20')](function(_0x40d3b5){if(_0x40d3b5[_0x56c8('0x4d')]>=0xc8&&_0x40d3b5[_0x56c8('0x4d')]<=0xce){if(_0x40d3b5['data']&&_0x40d3b5['data'][_0x56c8('0x4e')]>0x0){var _0x507f09=_[_0x56c8('0x4f')](_0x40d3b5[_0x56c8('0x50')][_0x56c8('0x51')]);var _0x324bbe={'messageId':_0x507f09[_0x56c8('0x52')]};if(!_0x129947[_0x56c8('0x53')]){_0x324bbe[_0x56c8('0x3f')]=!![];}return _0x31cde2[_0x56c8('0x1b')](_0x324bbe);}else{logger['error'](_0x56c8('0x2b'),_0x56c8('0x2c'),_0x56c8('0x54'),util[_0x56c8('0x2d')](_0x40d3b5,{'showHidden':![],'depth':null}));}}else{logger['error'](_0x56c8('0x2b'),'afterCreate','clickSend',util[_0x56c8('0x2d')](_0x40d3b5,{'showHidden':![],'depth':null}));}})['catch'](function(_0x5f139c){logger[_0x56c8('0x1d')](_0x56c8('0x2b'),'afterCreate',_0x56c8('0x54'),util['inspect'](_0x5f139c,{'showHidden':![],'depth':null}));});}else{logger[_0x56c8('0x1d')](_0x56c8('0x2b'),'afterCreate',_0x56c8('0x54'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x56c8('0x55'):if(_0x129947[_0x56c8('0x56')]&&_0x129947[_0x56c8('0x42')]){var _0x590369={'dst':_0x5c7d4a[_0x56c8('0x23')],'text':_0x5c7d4a['body'],'src':_0x129947[_0x56c8('0x57')]||_0x129947[_0x56c8('0x23')],'url':_0x129947[_0x56c8('0x26')]+_0x56c8('0x27')+_0x5c7d4a['id']+_0x56c8('0x28')+_0x129947[_0x56c8('0x29')]};var _0x41b276=util['format']('%s:%s',_0x129947['authId'],_0x129947[_0x56c8('0x42')]);var _0x1f87a9={'method':_0x56c8('0x3a'),'uri':util['format'](_0x56c8('0x58'),_0x129947['authId']),'body':_0x590369,'headers':{'Authorization':util[_0x56c8('0x49')](_0x56c8('0x4a'),new Buffer(_0x41b276)[_0x56c8('0x4b')](_0x56c8('0x4c')))},'json':!![]};rp(_0x1f87a9)[_0x56c8('0x20')](function(_0x53d958){var _0x1172aa={'messageId':_0x53d958[_0x56c8('0x59')][0x0]};return _0x31cde2[_0x56c8('0x1b')](_0x1172aa);})[_0x56c8('0x2a')](function(_0x29dda3){logger[_0x56c8('0x1d')](_0x56c8('0x2b'),_0x56c8('0x2c'),_0x56c8('0x55'),util[_0x56c8('0x2d')](_0x29dda3,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x56c8('0x2b'),_0x56c8('0x2c'),_0x56c8('0x55'),_0x56c8('0x5a'));}break;case _0x56c8('0x5b'):if(_0x129947['username']&&_0x129947['password']){if(_0x129947[_0x56c8('0x5c')]){var _0x6dbb6b={'method':_0x56c8('0x3a'),'uri':_0x129947[_0x56c8('0x5c')]+_0x56c8('0x5d'),'body':{'username':_0x129947[_0x56c8('0x32')],'password':_0x129947[_0x56c8('0x33')]},'json':!![]};return rp(_0x6dbb6b)['then'](function(_0x3d7ac7){var _0x40a8dd={'method':_0x56c8('0x3a'),'uri':_0x129947[_0x56c8('0x5c')]+_0x56c8('0x5e'),'body':{'messages':[{'from':_0x129947[_0x56c8('0x23')],'destinations':[{'to':_0x5c7d4a[_0x56c8('0x23')]}],'text':_0x5c7d4a[_0x56c8('0x25')],'notifyUrl':_0x129947[_0x56c8('0x26')]+_0x56c8('0x27')+_0x5c7d4a['id']+_0x56c8('0x28')+_0x129947['token'],'notifyContentType':_0x56c8('0x5f'),'callbackData':_0x129947['phone']+';'+_0x5c7d4a[_0x56c8('0x25')]}]},'headers':{'Authorization':_0x56c8('0x60')+_0x3d7ac7['token']},'json':!![]};return rp(_0x40a8dd)['then'](function(_0x406c3c){if(_0x406c3c[_0x56c8('0x51')]){var _0x5ab83e={'messageId':_0x406c3c['messages'][0x0][_0x56c8('0xd')]};if(!_0x129947[_0x56c8('0x53')]){_0x5ab83e[_0x56c8('0x3f')]=!![];}return _0x31cde2[_0x56c8('0x1b')](_0x5ab83e);}else{return logger['error'](_0x56c8('0x2b'),'afterCreate',_0x56c8('0x5b'),util['inspect'](_0x406c3c,{'showHidden':![],'depth':null}));}});})[_0x56c8('0x2a')](function(_0x3169f4){return logger['error'](_0x56c8('0x2b'),_0x56c8('0x2c'),_0x56c8('0x5b'),util['inspect'](_0x3169f4,{'showHidden':![],'depth':null}));});}else{logger[_0x56c8('0x1d')](_0x56c8('0x2b'),_0x56c8('0x2c'),_0x56c8('0x5b'),'Missing\x20parameters:\x20base_url');}}else{logger[_0x56c8('0x1d')](_0x56c8('0x2b'),_0x56c8('0x2c'),_0x56c8('0x5b'),_0x56c8('0x40'));}break;case _0x56c8('0x61'):var _0x38166e=require('crypto');if(_0x129947[_0x56c8('0x62')]){var _0x2413cc={};_0x2413cc[_0x56c8('0x63')]=_0x129947[_0x56c8('0x32')];_0x2413cc['phone']=_0x5c7d4a[_0x56c8('0x23')];_0x2413cc[_0x56c8('0x35')]=_0x129947[_0x56c8('0x23')];_0x2413cc[_0x56c8('0x64')]=_0x5c7d4a['body'];_0x2413cc[_0x56c8('0x65')]=+new Date();var _0x15ff6f='';var _0x1082d5='';var _0x182eb6=Object['keys'](_0x2413cc);_0x182eb6[_0x56c8('0x66')]();for(var _0xbb4d17=0x0;_0xbb4d17<_0x182eb6[_0x56c8('0x67')];_0xbb4d17++){if(_0x15ff6f!=''){_0x15ff6f+='&';}_0x15ff6f+=_0x182eb6[_0xbb4d17]+'='+encodeURIComponent(_0x2413cc[_0x182eb6[_0xbb4d17]]);_0x1082d5+=_0x2413cc[_0x182eb6[_0xbb4d17]];}_0x1082d5+=_0x129947[_0x56c8('0x62')];_0x1082d5=_0x38166e[_0x56c8('0x68')]('md5')['update'](_0x1082d5)[_0x56c8('0x69')](_0x56c8('0x6a'));if(_0x15ff6f!==''){_0x15ff6f+='&';}_0x15ff6f+=_0x56c8('0x6b')+_0x1082d5;var _0x172acc={'method':_0x56c8('0x37'),'uri':_0x129947[_0x56c8('0x5c')]+_0x56c8('0x6c')+_0x15ff6f,'json':!![]};return rp(_0x172acc)['then'](function(_0x1bb457){var _0x21d644=Object[_0x56c8('0x6d')](_0x1bb457);if(_0x1bb457[_0x21d644[0x0]][_0x56c8('0x1d')]&&parseInt(_0x1bb457[_0x21d644[0x0]]['error'])===0x0){var _0x2a94b4={'messageId':_0x1bb457[_0x21d644[0x0]][_0x56c8('0x6e')]};if(!_0x129947[_0x56c8('0x53')]){_0x2a94b4[_0x56c8('0x3f')]=!![];}return _0x31cde2[_0x56c8('0x1b')](_0x2a94b4);}else{return logger[_0x56c8('0x1d')](_0x56c8('0x2b'),_0x56c8('0x2c'),_0x56c8('0x61'),util[_0x56c8('0x2d')](_0x1bb457[_0x56c8('0x1d')],{'showHidden':![],'depth':null}));}})[_0x56c8('0x2a')](function(_0x37df2b){return logger[_0x56c8('0x1d')](_0x56c8('0x2b'),_0x56c8('0x2c'),'csc',util[_0x56c8('0x2d')](_0x37df2b,{'showHidden':![],'depth':null}));});}else{logger[_0x56c8('0x1d')](_0x56c8('0x2b'),_0x56c8('0x2c'),_0x56c8('0x61'),_0x56c8('0x6f'));}break;case'clickatell':if(_0x129947[_0x56c8('0x62')]){var _0x479ab9={'method':_0x56c8('0x3a'),'uri':_0x56c8('0x70'),'headers':{'Authorization':_0x129947[_0x56c8('0x62')]},'body':{'content':_0x5c7d4a['body'],'to':[_0x5c7d4a['phone']],'from':_0x129947[_0x56c8('0x23')],'binary':![],'clientMessageId':_0x56c8('0x71'),'charset':_0x56c8('0x72')},'json':!![]};rp(_0x479ab9)[_0x56c8('0x20')](function(_0x16dc32){if(!_0x16dc32[_0x56c8('0x1d')]){var _0x5d5b74={'messageId':_0x16dc32[_0x56c8('0x51')][0x0][_0x56c8('0x73')]};if(!_0x129947[_0x56c8('0x53')]){_0x5d5b74[_0x56c8('0x3f')]=!![];}return _0x31cde2[_0x56c8('0x1b')](_0x5d5b74);}else{return logger[_0x56c8('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x56c8('0x2c'),_0x56c8('0x74'),util[_0x56c8('0x2d')](_0x16dc32[_0x56c8('0x1d')],{'showHidden':![],'depth':null}));}})[_0x56c8('0x2a')](function(_0x275f26){return logger[_0x56c8('0x1d')](_0x56c8('0x2b'),'afterCreate',_0x56c8('0x74'),util['inspect'](_0x275f26,{'showHidden':![],'depth':null}));});}else{logger[_0x56c8('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x56c8('0x74'),_0x56c8('0x6f'));}break;case _0x56c8('0x75'):if(_0x129947[_0x56c8('0x32')]&&_0x129947['password']){var _0x41b276=util['format'](_0x56c8('0x47'),_0x129947[_0x56c8('0x32')],_0x129947[_0x56c8('0x33')]);var _0x1f87a9={'method':_0x56c8('0x3a'),'uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x129947[_0x56c8('0x76')]+_0x56c8('0x77'),'body':{'to':[_0x5c7d4a[_0x56c8('0x23')]],'text':_0x5c7d4a['body'],'from':_0x129947['phone'],'applicationId':_0x129947[_0x56c8('0x78')]},'headers':{'Authorization':util[_0x56c8('0x49')](_0x56c8('0x4a'),new Buffer(_0x41b276)['toString'](_0x56c8('0x4c')))},'json':!![]};rp(_0x1f87a9)[_0x56c8('0x20')](function(_0x96bfcc){if(_0x96bfcc['id']){var _0x2b269c={'messageId':_0x96bfcc['id']};return _0x31cde2[_0x56c8('0x1b')](_0x2b269c);}else{logger['error'](_0x56c8('0x2b'),'afterCreate',_0x56c8('0x75'),util[_0x56c8('0x2d')](_0x96bfcc,{'showHidden':![],'depth':null}));}})[_0x56c8('0x2a')](function(_0x46000c){logger['error'](_0x56c8('0x2b'),_0x56c8('0x2c'),_0x56c8('0x75'),util[_0x56c8('0x2d')](_0x46000c,{'showHidden':![],'depth':null}));});}else{logger[_0x56c8('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x56c8('0x2c'),_0x56c8('0x75'),_0x56c8('0x40'));}break;case _0x56c8('0x79'):if(_0x129947[_0x56c8('0x62')]){var _0x221a31={};var _0x172acc={'method':_0x56c8('0x3a'),'uri':_0x56c8('0x7a'),'headers':{'Authorization':_0x56c8('0x7b')+_0x129947['apiKey'],'Content-Type':_0x56c8('0x5f')},'body':{'from':_0x129947[_0x56c8('0x23')],'to':_0x5c7d4a[_0x56c8('0x23')],'text':_0x5c7d4a[_0x56c8('0x25')]},'json':!![]};return rp(_0x172acc)[_0x56c8('0x20')](function(_0xc521f6){if(_0xc521f6[_0x56c8('0x7c')]==0xca){_0x221a31[_0x56c8('0x7d')]=_0xc521f6;var _0x418210={'method':_0x56c8('0x3a'),'uri':_0x56c8('0x7e'),'headers':{'Authorization':_0x56c8('0x7b')+_0x129947['apiKey'],'Content-Type':_0x56c8('0x5f')},'body':{'refid':_0x221a31[_0x56c8('0x7d')]['refid']},'json':!![]};return rp(_0x418210)[_0x56c8('0x20')](function(_0x2c5211){_0x221a31[_0x56c8('0x7f')]=_0x2c5211;var _0x425e2f={'messageId':_0x221a31[_0x56c8('0x7d')][_0x56c8('0x80')],'read':!![]};return _0x31cde2[_0x56c8('0x1b')](_0x425e2f);});}else{return logger[_0x56c8('0x1d')](_0x56c8('0x2b'),_0x56c8('0x2c'),_0x56c8('0x79'),util[_0x56c8('0x2d')](_0xc521f6,{'showHidden':![],'depth':null}));}})[_0x56c8('0x2a')](function(_0x5d7fa5){return logger[_0x56c8('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x56c8('0x2c'),_0x56c8('0x79'),util[_0x56c8('0x2d')](_0x5d7fa5,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0x56c8('0x2b'),_0x56c8('0x2c'),_0x56c8('0x79'),'Token\x20not\x20received');}break;}}})[_0x56c8('0x81')](function(){_0x276fe8();});}else{_0x276fe8();}}},'charset':_0x56c8('0x82'),'collate':_0x56c8('0x83')});}; \ No newline at end of file +var _0x5fcb=['path','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','body','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','SmsInteraction','findOne','SmsInteractionId','then','update','createdAt','catch','out','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','phone','messages','remote','/api/sms/messages/','/status?token=','token','sid','error','afterCreate','inspect','SmsMessage,\x20%s,\x20%s,\x20%s','skebby','username','password','smsMethod','login?username=','&password=','GET','split','sms','POST','user_key','internal_order_id','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','clicksend','format','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','queued_count','message_id','clickSend','plivo','authId','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','/auth/1/session','baseUrl','/sms/2/text/advanced','infobip','csc','crypto','apiKey','login','sender','text','timestamp','keys','createHash','md5','digest','hex','signature=','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','bandwidth','%s:%s','accountId','/messages','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','application/json','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','intelepeer','Token\x20not\x20received','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x14632e,_0x19bf1b){var _0x56c307=function(_0x70fdd2){while(--_0x70fdd2){_0x14632e['push'](_0x14632e['shift']());}};_0x56c307(++_0x19bf1b);}(_0x5fcb,0x1e5));var _0xb5fc=function(_0x411416,_0x35923a){_0x411416=_0x411416-0x0;var _0x395e39=_0x5fcb[_0x411416];return _0x395e39;};'use strict';var _=require(_0xb5fc('0x0'));var util=require(_0xb5fc('0x1'));var logger=require(_0xb5fc('0x2'))(_0xb5fc('0x3'));var moment=require(_0xb5fc('0x4'));var BPromise=require(_0xb5fc('0x5'));var rp=require(_0xb5fc('0x6'));var fs=require('fs');var path=require(_0xb5fc('0x7'));var rimraf=require('rimraf');var config=require(_0xb5fc('0x8'));var attributes=require(_0xb5fc('0x9'));module[_0xb5fc('0xa')]=function(_0x2f3b0b,_0x51befb){return _0x2f3b0b[_0xb5fc('0xb')](_0xb5fc('0xc'),attributes,{'tableName':_0xb5fc('0xd'),'paranoid':![],'indexes':[{'name':_0xb5fc('0xe'),'fields':['messageId']},{'name':'fti_sms_messages','fields':[_0xb5fc('0xf')],'type':_0xb5fc('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x547c0e,_0x18000a,_0x1a7f24){var _0x1b398b=_0x2f3b0b[_0xb5fc('0x11')];var _0x305289=_0x547c0e[_0xb5fc('0x12')]({'plain':!![]});if(_0x305289[_0xb5fc('0x13')]['toLowerCase']()==='in'||_0x305289['direction'][_0xb5fc('0x14')]()==='out'&&!_0x305289[_0xb5fc('0x15')]&&!_[_0xb5fc('0x16')](_0x305289['UserId'])&&!_[_0xb5fc('0x16')](_0x305289['SmsInteractionId'])){_0x1b398b[_0xb5fc('0x17')][_0xb5fc('0x18')]({'where':{'id':_0x305289[_0xb5fc('0x19')]}})[_0xb5fc('0x1a')](function(_0x5d261f){if(_0x5d261f){_0x5d261f[_0xb5fc('0x1b')]({'lastMsgAt':_0x305289[_0xb5fc('0x1c')],'lastMsgDirection':_0x305289[_0xb5fc('0x13')][_0xb5fc('0x14')]()});}})[_0xb5fc('0x1d')](function(_0x554760){console['error'](_0x554760);});}if(_0x305289[_0xb5fc('0x13')]===_0xb5fc('0x1e')&&!_0x305289[_0xb5fc('0x15')]){var _0x5d6e5b;_0x1b398b[_0xb5fc('0x1f')][_0xb5fc('0x20')]({'where':{'id':_0x305289[_0xb5fc('0x21')]},'raw':!![]})[_0xb5fc('0x1a')](function(_0x3d36f2){_0x5d6e5b=_0x3d36f2;if(_0x5d6e5b&&_0x5d6e5b[_0xb5fc('0x22')]){switch(_0x5d6e5b[_0xb5fc('0x22')]){case _0xb5fc('0x23'):var _0xe2dd18=require(_0xb5fc('0x23'));if(_0x5d6e5b[_0xb5fc('0x24')]&&_0x5d6e5b[_0xb5fc('0x25')]&&_0x5d6e5b[_0xb5fc('0x26')]){var _0x3fa34d=new _0xe2dd18(_0x5d6e5b['accountSid'],_0x5d6e5b['authToken']);_0x3fa34d[_0xb5fc('0x27')]['create']({'body':_0x305289[_0xb5fc('0xf')],'to':_0x305289[_0xb5fc('0x26')],'from':_0x5d6e5b[_0xb5fc('0x26')],'statusCallback':_0x5d6e5b[_0xb5fc('0x28')]+_0xb5fc('0x29')+_0x305289['id']+_0xb5fc('0x2a')+_0x5d6e5b[_0xb5fc('0x2b')]})[_0xb5fc('0x1a')](function(_0x239b01){if(_0x239b01[_0xb5fc('0x2c')]){return _0x547c0e['update']({'messageId':_0x239b01[_0xb5fc('0x2c')]});}})[_0xb5fc('0x1d')](function(_0xbaf084){logger[_0xb5fc('0x2d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb5fc('0x2e'),'twilio',util[_0xb5fc('0x2f')](_0xbaf084,{'showHidden':![],'depth':null}));});}else{logger[_0xb5fc('0x2d')](_0xb5fc('0x30'),_0xb5fc('0x2e'),_0xb5fc('0x23'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0xb5fc('0x31'):var _0x3100b1='https://api.skebby.it/API/v1.0/REST/';if(_0x5d6e5b[_0xb5fc('0x32')]&&_0x5d6e5b[_0xb5fc('0x33')]){var _0x3b04b2={'recipient':[_0x305289[_0xb5fc('0x26')]],'message':_0x305289['body'],'message_type':_0x5d6e5b['smsMethod']};if(_0x5d6e5b[_0xb5fc('0x34')]&&_0x5d6e5b[_0xb5fc('0x34')]!=='SI'){_0x3b04b2['sender']=_0x5d6e5b[_0xb5fc('0x26')];}var _0x22f9fa={'url':_0x3100b1+_0xb5fc('0x35')+_0x5d6e5b[_0xb5fc('0x32')]+_0xb5fc('0x36')+_0x5d6e5b['password'],'method':_0xb5fc('0x37')};rp(_0x22f9fa)[_0xb5fc('0x1a')](function(_0x245dec){var _0x1f6eb0=_0x245dec[_0xb5fc('0x38')](';');var _0x316844={'user_key':_0x1f6eb0[0x0],'session_key':_0x1f6eb0[0x1]};_0x22f9fa={'url':_0x3100b1+_0xb5fc('0x39'),'method':_0xb5fc('0x3a'),'headers':{'user_key':_0x316844[_0xb5fc('0x3b')],'Session_key':_0x316844['session_key']},'json':!![],'body':_0x3b04b2};return rp(_0x22f9fa);})[_0xb5fc('0x1a')](function(_0xddba4){if(_0xddba4['total_sent']>=0x1){var _0xc922ac={'messageId':_0xddba4[_0xb5fc('0x3c')]};if(_0x5d6e5b[_0xb5fc('0x34')]!=='GP'||!_0x5d6e5b[_0xb5fc('0x3d')]){_0xc922ac[_0xb5fc('0x3e')]=!![];}return _0x547c0e[_0xb5fc('0x1b')](_0xc922ac);}else{return logger[_0xb5fc('0x2d')](_0xb5fc('0x30'),_0xb5fc('0x2e'),_0xb5fc('0x31'),util['inspect'](_0xddba4,{'showHidden':![],'depth':null}));}})[_0xb5fc('0x1d')](function(_0x331e7f){return logger['error'](_0xb5fc('0x30'),'afterCreate','skebby',util[_0xb5fc('0x2f')](_0x331e7f,{'showHidden':![],'depth':null}));});}else{logger[_0xb5fc('0x2d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb5fc('0x2e'),_0xb5fc('0x31'),_0xb5fc('0x3f'));}break;case _0xb5fc('0x40'):if(_0x5d6e5b['authToken']){var _0x58e817={'recipient':_0x305289[_0xb5fc('0x26')],'message':_0x305289['body'],'sender':_0x5d6e5b[_0xb5fc('0x41')]||_0x5d6e5b[_0xb5fc('0x26')],'authorization':_0x5d6e5b[_0xb5fc('0x25')]};var _0x18000a={'method':_0xb5fc('0x3a'),'uri':_0xb5fc('0x42'),'body':_0x58e817,'json':!![]};rp(_0x18000a)['then'](function(_0x350917){var _0x234398={'messageId':_0x350917[_0xb5fc('0x43')]};if(!_0x5d6e5b[_0xb5fc('0x3d')]){_0x234398[_0xb5fc('0x3e')]=!![];}return _0x547c0e[_0xb5fc('0x1b')](_0x234398);})[_0xb5fc('0x1d')](function(_0x5e5d55){logger[_0xb5fc('0x2d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb5fc('0x2e'),_0xb5fc('0x40'),util[_0xb5fc('0x2f')](_0x5e5d55,{'showHidden':![],'depth':null}));});}else{logger[_0xb5fc('0x2d')](_0xb5fc('0x30'),_0xb5fc('0x2e'),_0xb5fc('0x40'),'Missing\x20parameters:\x20authToken');}break;case _0xb5fc('0x44'):if(_0x5d6e5b['username']&&_0x5d6e5b[_0xb5fc('0x33')]){var _0x58e817={'messages':[{'source':'xCALLY\x20Motion','to':_0x305289[_0xb5fc('0x26')],'body':_0x305289[_0xb5fc('0xf')],'from':_0x5d6e5b[_0xb5fc('0x41')]||_0x5d6e5b[_0xb5fc('0x26')]}]};var _0x3c55e1=util[_0xb5fc('0x45')]('%s:%s',_0x5d6e5b['username'],_0x5d6e5b[_0xb5fc('0x33')]);var _0x18000a={'method':_0xb5fc('0x3a'),'uri':_0xb5fc('0x46'),'body':_0x58e817,'headers':{'Authorization':util['format'](_0xb5fc('0x47'),new Buffer(_0x3c55e1)[_0xb5fc('0x48')](_0xb5fc('0x49')))},'json':!![]};rp(_0x18000a)[_0xb5fc('0x1a')](function(_0xc770ab){if(_0xc770ab[_0xb5fc('0x4a')]>=0xc8&&_0xc770ab[_0xb5fc('0x4a')]<=0xce){if(_0xc770ab[_0xb5fc('0x4b')]&&_0xc770ab[_0xb5fc('0x4b')][_0xb5fc('0x4c')]>0x0){var _0x5deb7a=_['head'](_0xc770ab[_0xb5fc('0x4b')][_0xb5fc('0x27')]);var _0x364aa8={'messageId':_0x5deb7a[_0xb5fc('0x4d')]};if(!_0x5d6e5b[_0xb5fc('0x3d')]){_0x364aa8[_0xb5fc('0x3e')]=!![];}return _0x547c0e[_0xb5fc('0x1b')](_0x364aa8);}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb5fc('0x2e'),_0xb5fc('0x4e'),util[_0xb5fc('0x2f')](_0xc770ab,{'showHidden':![],'depth':null}));}}else{logger[_0xb5fc('0x2d')](_0xb5fc('0x30'),'afterCreate',_0xb5fc('0x4e'),util[_0xb5fc('0x2f')](_0xc770ab,{'showHidden':![],'depth':null}));}})[_0xb5fc('0x1d')](function(_0x25668d){logger[_0xb5fc('0x2d')](_0xb5fc('0x30'),_0xb5fc('0x2e'),_0xb5fc('0x4e'),util['inspect'](_0x25668d,{'showHidden':![],'depth':null}));});}else{logger[_0xb5fc('0x2d')](_0xb5fc('0x30'),'afterCreate',_0xb5fc('0x4e'),_0xb5fc('0x3f'));}break;case _0xb5fc('0x4f'):if(_0x5d6e5b[_0xb5fc('0x50')]&&_0x5d6e5b['authToken']){var _0x58e817={'dst':_0x305289[_0xb5fc('0x26')],'text':_0x305289[_0xb5fc('0xf')],'src':_0x5d6e5b['senderString']||_0x5d6e5b[_0xb5fc('0x26')],'url':_0x5d6e5b['remote']+_0xb5fc('0x29')+_0x305289['id']+_0xb5fc('0x2a')+_0x5d6e5b[_0xb5fc('0x2b')]};var _0x3c55e1=util[_0xb5fc('0x45')]('%s:%s',_0x5d6e5b[_0xb5fc('0x50')],_0x5d6e5b[_0xb5fc('0x25')]);var _0x18000a={'method':_0xb5fc('0x3a'),'uri':util['format'](_0xb5fc('0x51'),_0x5d6e5b[_0xb5fc('0x50')]),'body':_0x58e817,'headers':{'Authorization':util[_0xb5fc('0x45')](_0xb5fc('0x47'),new Buffer(_0x3c55e1)[_0xb5fc('0x48')](_0xb5fc('0x49')))},'json':!![]};rp(_0x18000a)[_0xb5fc('0x1a')](function(_0x308f23){var _0x5d3b34={'messageId':_0x308f23[_0xb5fc('0x52')][0x0]};return _0x547c0e[_0xb5fc('0x1b')](_0x5d3b34);})[_0xb5fc('0x1d')](function(_0x27d792){logger[_0xb5fc('0x2d')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','plivo',util['inspect'](_0x27d792,{'showHidden':![],'depth':null}));});}else{logger[_0xb5fc('0x2d')](_0xb5fc('0x30'),_0xb5fc('0x2e'),'plivo','Missing\x20parameters:\x20authId,\x20authToken');}break;case'infobip':if(_0x5d6e5b['username']&&_0x5d6e5b[_0xb5fc('0x33')]){if(_0x5d6e5b['baseUrl']){var _0x447b6a={'method':_0xb5fc('0x3a'),'uri':_0x5d6e5b['baseUrl']+_0xb5fc('0x53'),'body':{'username':_0x5d6e5b['username'],'password':_0x5d6e5b[_0xb5fc('0x33')]},'json':!![]};return rp(_0x447b6a)[_0xb5fc('0x1a')](function(_0x23ffd5){var _0x44e3f8={'method':_0xb5fc('0x3a'),'uri':_0x5d6e5b[_0xb5fc('0x54')]+_0xb5fc('0x55'),'body':{'messages':[{'from':_0x5d6e5b[_0xb5fc('0x26')],'destinations':[{'to':_0x305289['phone']}],'text':_0x305289[_0xb5fc('0xf')],'notifyUrl':_0x5d6e5b['remote']+_0xb5fc('0x29')+_0x305289['id']+'/status?token='+_0x5d6e5b['token'],'notifyContentType':'application/json','callbackData':_0x5d6e5b['phone']+';'+_0x305289['body']}]},'headers':{'Authorization':'IBSSO\x20'+_0x23ffd5[_0xb5fc('0x2b')]},'json':!![]};return rp(_0x44e3f8)[_0xb5fc('0x1a')](function(_0x3cbe71){if(_0x3cbe71[_0xb5fc('0x27')]){var _0x446ad0={'messageId':_0x3cbe71[_0xb5fc('0x27')][0x0][_0xb5fc('0xe')]};if(!_0x5d6e5b[_0xb5fc('0x3d')]){_0x446ad0[_0xb5fc('0x3e')]=!![];}return _0x547c0e['update'](_0x446ad0);}else{return logger['error'](_0xb5fc('0x30'),_0xb5fc('0x2e'),_0xb5fc('0x56'),util[_0xb5fc('0x2f')](_0x3cbe71,{'showHidden':![],'depth':null}));}});})[_0xb5fc('0x1d')](function(_0xeb69bd){return logger[_0xb5fc('0x2d')](_0xb5fc('0x30'),_0xb5fc('0x2e'),_0xb5fc('0x56'),util[_0xb5fc('0x2f')](_0xeb69bd,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xb5fc('0x30'),_0xb5fc('0x2e'),_0xb5fc('0x56'),'Missing\x20parameters:\x20base_url');}}else{logger[_0xb5fc('0x2d')](_0xb5fc('0x30'),'afterCreate',_0xb5fc('0x56'),_0xb5fc('0x3f'));}break;case _0xb5fc('0x57'):var _0x2a1120=require(_0xb5fc('0x58'));if(_0x5d6e5b[_0xb5fc('0x59')]){var _0x4b0e7e={};_0x4b0e7e[_0xb5fc('0x5a')]=_0x5d6e5b[_0xb5fc('0x32')];_0x4b0e7e['phone']=_0x305289[_0xb5fc('0x26')];_0x4b0e7e[_0xb5fc('0x5b')]=_0x5d6e5b['phone'];_0x4b0e7e[_0xb5fc('0x5c')]=_0x305289['body'];_0x4b0e7e[_0xb5fc('0x5d')]=+new Date();var _0x25095d='';var _0x2eefc9='';var _0x386ceb=Object[_0xb5fc('0x5e')](_0x4b0e7e);_0x386ceb['sort']();for(var _0x1ab7b0=0x0;_0x1ab7b0<_0x386ceb['length'];_0x1ab7b0++){if(_0x25095d!=''){_0x25095d+='&';}_0x25095d+=_0x386ceb[_0x1ab7b0]+'='+encodeURIComponent(_0x4b0e7e[_0x386ceb[_0x1ab7b0]]);_0x2eefc9+=_0x4b0e7e[_0x386ceb[_0x1ab7b0]];}_0x2eefc9+=_0x5d6e5b[_0xb5fc('0x59')];_0x2eefc9=_0x2a1120[_0xb5fc('0x5f')](_0xb5fc('0x60'))[_0xb5fc('0x1b')](_0x2eefc9)[_0xb5fc('0x61')](_0xb5fc('0x62'));if(_0x25095d!==''){_0x25095d+='&';}_0x25095d+=_0xb5fc('0x63')+_0x2eefc9;var _0x22f9fa={'method':'GET','uri':_0x5d6e5b[_0xb5fc('0x54')]+_0xb5fc('0x64')+_0x25095d,'json':!![]};return rp(_0x22f9fa)[_0xb5fc('0x1a')](function(_0x18dbe2){var _0x200db9=Object[_0xb5fc('0x5e')](_0x18dbe2);if(_0x18dbe2[_0x200db9[0x0]]['error']&&parseInt(_0x18dbe2[_0x200db9[0x0]]['error'])===0x0){var _0xb88c8b={'messageId':_0x18dbe2[_0x200db9[0x0]][_0xb5fc('0x65')]};if(!_0x5d6e5b['deliveryReport']){_0xb88c8b[_0xb5fc('0x3e')]=!![];}return _0x547c0e[_0xb5fc('0x1b')](_0xb88c8b);}else{return logger[_0xb5fc('0x2d')](_0xb5fc('0x30'),_0xb5fc('0x2e'),'csc',util['inspect'](_0x18dbe2['error'],{'showHidden':![],'depth':null}));}})[_0xb5fc('0x1d')](function(_0x5afad9){return logger[_0xb5fc('0x2d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb5fc('0x2e'),_0xb5fc('0x57'),util['inspect'](_0x5afad9,{'showHidden':![],'depth':null}));});}else{logger[_0xb5fc('0x2d')](_0xb5fc('0x30'),_0xb5fc('0x2e'),_0xb5fc('0x57'),_0xb5fc('0x66'));}break;case _0xb5fc('0x67'):if(_0x5d6e5b[_0xb5fc('0x59')]){var _0x1cd83c={'method':_0xb5fc('0x3a'),'uri':_0xb5fc('0x68'),'headers':{'Authorization':_0x5d6e5b['apiKey']},'body':{'content':_0x305289['body'],'to':[_0x305289[_0xb5fc('0x26')]],'from':_0x5d6e5b['phone'],'binary':![],'clientMessageId':_0xb5fc('0x69'),'charset':_0xb5fc('0x6a')},'json':!![]};rp(_0x1cd83c)['then'](function(_0x7a3261){if(!_0x7a3261[_0xb5fc('0x2d')]){var _0x2b4ecf={'messageId':_0x7a3261[_0xb5fc('0x27')][0x0][_0xb5fc('0x6b')]};if(!_0x5d6e5b['deliveryReport']){_0x2b4ecf[_0xb5fc('0x3e')]=!![];}return _0x547c0e['update'](_0x2b4ecf);}else{return logger[_0xb5fc('0x2d')](_0xb5fc('0x30'),_0xb5fc('0x2e'),_0xb5fc('0x67'),util['inspect'](_0x7a3261[_0xb5fc('0x2d')],{'showHidden':![],'depth':null}));}})[_0xb5fc('0x1d')](function(_0x38e1ef){return logger[_0xb5fc('0x2d')](_0xb5fc('0x30'),_0xb5fc('0x2e'),_0xb5fc('0x67'),util[_0xb5fc('0x2f')](_0x38e1ef,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xb5fc('0x30'),_0xb5fc('0x2e'),_0xb5fc('0x67'),_0xb5fc('0x66'));}break;case _0xb5fc('0x6c'):if(_0x5d6e5b[_0xb5fc('0x32')]&&_0x5d6e5b[_0xb5fc('0x33')]){var _0x3c55e1=util[_0xb5fc('0x45')](_0xb5fc('0x6d'),_0x5d6e5b[_0xb5fc('0x32')],_0x5d6e5b['password']);var _0x18000a={'method':_0xb5fc('0x3a'),'uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x5d6e5b[_0xb5fc('0x6e')]+_0xb5fc('0x6f'),'body':{'to':[_0x305289[_0xb5fc('0x26')]],'text':_0x305289[_0xb5fc('0xf')],'from':_0x5d6e5b[_0xb5fc('0x26')],'applicationId':_0x5d6e5b['applicationId']},'headers':{'Authorization':util[_0xb5fc('0x45')](_0xb5fc('0x47'),new Buffer(_0x3c55e1)[_0xb5fc('0x48')](_0xb5fc('0x49')))},'json':!![]};rp(_0x18000a)[_0xb5fc('0x1a')](function(_0x4f36d9){if(_0x4f36d9['id']){var _0x4ce76d={'messageId':_0x4f36d9['id']};return _0x547c0e['update'](_0x4ce76d);}else{logger[_0xb5fc('0x2d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb5fc('0x2e'),_0xb5fc('0x6c'),util[_0xb5fc('0x2f')](_0x4f36d9,{'showHidden':![],'depth':null}));}})[_0xb5fc('0x1d')](function(_0x55f99a){logger[_0xb5fc('0x2d')](_0xb5fc('0x30'),_0xb5fc('0x2e'),'bandwidth',util[_0xb5fc('0x2f')](_0x55f99a,{'showHidden':![],'depth':null}));});}else{logger[_0xb5fc('0x2d')](_0xb5fc('0x30'),_0xb5fc('0x2e'),_0xb5fc('0x6c'),_0xb5fc('0x3f'));}break;case'intelepeer':if(_0x5d6e5b[_0xb5fc('0x59')]){var _0x3a81fa={};var _0x22f9fa={'method':'POST','uri':_0xb5fc('0x70'),'headers':{'Authorization':_0xb5fc('0x71')+_0x5d6e5b[_0xb5fc('0x59')],'Content-Type':_0xb5fc('0x72')},'body':{'from':_0x5d6e5b['phone'],'to':_0x305289[_0xb5fc('0x26')],'text':_0x305289['body']},'json':!![]};return rp(_0x22f9fa)[_0xb5fc('0x1a')](function(_0x10b64c){if(_0x10b64c[_0xb5fc('0x73')]==0xca){_0x3a81fa[_0xb5fc('0x74')]=_0x10b64c;var _0x2d2ffc={'method':_0xb5fc('0x3a'),'uri':_0xb5fc('0x75'),'headers':{'Authorization':_0xb5fc('0x71')+_0x5d6e5b[_0xb5fc('0x59')],'Content-Type':_0xb5fc('0x72')},'body':{'refid':_0x3a81fa[_0xb5fc('0x74')][_0xb5fc('0x76')]},'json':!![]};return rp(_0x2d2ffc)[_0xb5fc('0x1a')](function(_0x2143a4){_0x3a81fa[_0xb5fc('0x77')]=_0x2143a4;var _0xd468f9={'messageId':_0x3a81fa[_0xb5fc('0x74')][_0xb5fc('0x76')],'read':!![]};return _0x547c0e['update'](_0xd468f9);});}else{return logger[_0xb5fc('0x2d')](_0xb5fc('0x30'),_0xb5fc('0x2e'),_0xb5fc('0x78'),util['inspect'](_0x10b64c,{'showHidden':![],'depth':null}));}})[_0xb5fc('0x1d')](function(_0x498ed5){return logger[_0xb5fc('0x2d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb5fc('0x2e'),_0xb5fc('0x78'),util[_0xb5fc('0x2f')](_0x498ed5,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0xb5fc('0x30'),'afterCreate',_0xb5fc('0x78'),_0xb5fc('0x79'));}break;}}})['finally'](function(){_0x1a7f24();});}else{_0x1a7f24();}}},'charset':'utf8mb4','collate':_0xb5fc('0x7a')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 6065007..d554b75 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 _0xffd7=['jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateSmsMessage','SmsMessage','create','body','options','raw','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x53beed,_0x425446){var _0x13a363=function(_0x11143f){while(--_0x11143f){_0x53beed['push'](_0x53beed['shift']());}};_0x13a363(++_0x425446);}(_0xffd7,0xd9));var _0x7ffd=function(_0x188b04,_0x5ed504){_0x188b04=_0x188b04-0x0;var _0xe58958=_0xffd7[_0x188b04];return _0xe58958;};'use strict';var _=require('lodash');var util=require(_0x7ffd('0x0'));var moment=require(_0x7ffd('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7ffd('0x2'));var db=require(_0x7ffd('0x3'))['db'];var utils=require(_0x7ffd('0x4'));var logger=require(_0x7ffd('0x5'))(_0x7ffd('0x6'));var config=require('../../config/environment');var jayson=require(_0x7ffd('0x7'));var client=jayson[_0x7ffd('0x8')][_0x7ffd('0x9')]({'port':0x232a});config[_0x7ffd('0xa')]=_[_0x7ffd('0xb')](config[_0x7ffd('0xa')],{'host':_0x7ffd('0xc'),'port':0x18eb});var socket=require(_0x7ffd('0xd'))(new Redis(config[_0x7ffd('0xa')]));require(_0x7ffd('0xe'))['register'](socket);function respondWithRpcPromise(_0x44d78b,_0x3cbc1d,_0x226c47){return new BPromise(function(_0x139d22,_0x45b1a2){return client['request'](_0x44d78b,_0x226c47)[_0x7ffd('0xf')](function(_0x2f64ba){logger[_0x7ffd('0x10')](_0x7ffd('0x11'),_0x3cbc1d,_0x7ffd('0x12'));logger[_0x7ffd('0x13')](_0x7ffd('0x14'),_0x3cbc1d,_0x7ffd('0x12'),JSON['stringify'](_0x2f64ba));if(_0x2f64ba[_0x7ffd('0x15')]){if(_0x2f64ba['error'][_0x7ffd('0x16')]===0x1f4){logger['error'](_0x7ffd('0x11'),_0x3cbc1d,_0x2f64ba['error'][_0x7ffd('0x17')]);return _0x45b1a2(_0x2f64ba['error'][_0x7ffd('0x17')]);}logger[_0x7ffd('0x15')]('SmsMessage,\x20%s,\x20%s',_0x3cbc1d,_0x2f64ba[_0x7ffd('0x15')]['message']);return _0x139d22(_0x2f64ba[_0x7ffd('0x15')][_0x7ffd('0x17')]);}else{logger['info']('SmsMessage,\x20%s,\x20%s',_0x3cbc1d,_0x7ffd('0x12'));_0x139d22(_0x2f64ba[_0x7ffd('0x18')][_0x7ffd('0x17')]);}})[_0x7ffd('0x19')](function(_0x2e90ef){logger['error'](_0x7ffd('0x11'),_0x3cbc1d,_0x2e90ef);_0x45b1a2(_0x2e90ef);});});}exports[_0x7ffd('0x1a')]=function(_0x4c5a9f){var _0x3b2240=this;return new Promise(function(_0x37342c,_0x4d3de8){return db[_0x7ffd('0x1b')][_0x7ffd('0x1c')](_0x4c5a9f[_0x7ffd('0x1d')],{'raw':_0x4c5a9f['options']?_0x4c5a9f[_0x7ffd('0x1e')][_0x7ffd('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x3483fb){logger[_0x7ffd('0x10')]('CreateSmsMessage',_0x4c5a9f);logger[_0x7ffd('0x13')](_0x7ffd('0x1a'),_0x4c5a9f,JSON['stringify'](_0x3483fb));_0x37342c(_0x3483fb);})[_0x7ffd('0x19')](function(_0x4d9317){logger['error'](_0x7ffd('0x1a'),_0x4d9317[_0x7ffd('0x17')],_0x4c5a9f);_0x4d3de8(_0x3b2240['error'](0x1f4,_0x4d9317[_0x7ffd('0x17')]));});});}; \ No newline at end of file +var _0x62a7=['randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','redis','defaults','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','SmsMessage','create','body','options','raw','CreateSmsMessage','lodash','util','moment'];(function(_0x128a78,_0x3073f1){var _0x328440=function(_0x208e66){while(--_0x208e66){_0x128a78['push'](_0x128a78['shift']());}};_0x328440(++_0x3073f1);}(_0x62a7,0x1cd));var _0x762a=function(_0x2136a6,_0x35af63){_0x2136a6=_0x2136a6-0x0;var _0x55b948=_0x62a7[_0x2136a6];return _0x55b948;};'use strict';var _=require(_0x762a('0x0'));var util=require(_0x762a('0x1'));var moment=require(_0x762a('0x2'));var BPromise=require('bluebird');var rs=require(_0x762a('0x3'));var fs=require('fs');var Redis=require(_0x762a('0x4'));var db=require(_0x762a('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x762a('0x6'));var config=require(_0x762a('0x7'));var jayson=require(_0x762a('0x8'));var client=jayson['client'][_0x762a('0x9')]({'port':0x232a});config[_0x762a('0xa')]=_[_0x762a('0xb')](config[_0x762a('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x762a('0xa')]));require('./smsMessage.socket')['register'](socket);function respondWithRpcPromise(_0x383a40,_0x2cc22c,_0xa442f7){return new BPromise(function(_0x25359f,_0xdedea1){return client['request'](_0x383a40,_0xa442f7)[_0x762a('0xc')](function(_0x2054dd){logger[_0x762a('0xd')](_0x762a('0xe'),_0x2cc22c,_0x762a('0xf'));logger[_0x762a('0x10')](_0x762a('0x11'),_0x2cc22c,_0x762a('0xf'),JSON[_0x762a('0x12')](_0x2054dd));if(_0x2054dd[_0x762a('0x13')]){if(_0x2054dd[_0x762a('0x13')]['code']===0x1f4){logger[_0x762a('0x13')]('SmsMessage,\x20%s,\x20%s',_0x2cc22c,_0x2054dd[_0x762a('0x13')][_0x762a('0x14')]);return _0xdedea1(_0x2054dd['error'][_0x762a('0x14')]);}logger['error'](_0x762a('0xe'),_0x2cc22c,_0x2054dd[_0x762a('0x13')][_0x762a('0x14')]);return _0x25359f(_0x2054dd[_0x762a('0x13')]['message']);}else{logger[_0x762a('0xd')]('SmsMessage,\x20%s,\x20%s',_0x2cc22c,_0x762a('0xf'));_0x25359f(_0x2054dd[_0x762a('0x15')]['message']);}})[_0x762a('0x16')](function(_0x1fbbd9){logger['error'](_0x762a('0xe'),_0x2cc22c,_0x1fbbd9);_0xdedea1(_0x1fbbd9);});});}exports['CreateSmsMessage']=function(_0x2bdd0b){var _0x4f289d=this;return new Promise(function(_0x599d36,_0x2682ef){return db[_0x762a('0x17')][_0x762a('0x18')](_0x2bdd0b[_0x762a('0x19')],{'raw':_0x2bdd0b[_0x762a('0x1a')]?_0x2bdd0b['options'][_0x762a('0x1b')]===undefined?!![]:![]:!![]})[_0x762a('0xc')](function(_0xe69f18){logger[_0x762a('0xd')]('CreateSmsMessage',_0x2bdd0b);logger[_0x762a('0x10')](_0x762a('0x1c'),_0x2bdd0b,JSON[_0x762a('0x12')](_0xe69f18));_0x599d36(_0xe69f18);})[_0x762a('0x16')](function(_0x3186ac){logger[_0x762a('0x13')](_0x762a('0x1c'),_0x3186ac[_0x762a('0x14')],_0x2bdd0b);_0x2682ef(_0x4f289d[_0x762a('0x13')](0x1f4,_0x3186ac['message']));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index e2002b5..2e423de 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 _0x5378=['emit','removeListener','register','smsMessage:','./smsMessage.events','save','remove','update'];(function(_0x5e8eae,_0x4f81e0){var _0xdd09cd=function(_0x28c85c){while(--_0x28c85c){_0x5e8eae['push'](_0x5e8eae['shift']());}};_0xdd09cd(++_0x4f81e0);}(_0x5378,0x194));var _0x8537=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x5378[_0xa464c9];return _0x3d73c4;};'use strict';var SmsMessageEvents=require(_0x8537('0x0'));var events=[_0x8537('0x1'),_0x8537('0x2'),_0x8537('0x3')];function createListener(_0x705f94,_0x3c0f7b){return function(_0x442ae0){_0x3c0f7b[_0x8537('0x4')](_0x705f94,_0x442ae0);};}function removeListener(_0x2fd506,_0x9de221){return function(){SmsMessageEvents[_0x8537('0x5')](_0x2fd506,_0x9de221);};}exports[_0x8537('0x6')]=function(_0x101f1f){for(var _0x14f30c=0x0,_0x46cbf3=events['length'];_0x14f30c<_0x46cbf3;_0x14f30c++){var _0x4e79ee=events[_0x14f30c];var _0x2a0e02=createListener(_0x8537('0x7')+_0x4e79ee,_0x101f1f);SmsMessageEvents['on'](_0x4e79ee,_0x2a0e02);}}; \ No newline at end of file +var _0x46d7=['./smsMessage.events','remove','removeListener','register','length','smsMessage:'];(function(_0x69c0c2,_0x2af0bf){var _0x3422f6=function(_0x283e41){while(--_0x283e41){_0x69c0c2['push'](_0x69c0c2['shift']());}};_0x3422f6(++_0x2af0bf);}(_0x46d7,0x9c));var _0x746d=function(_0x38aebc,_0x3660af){_0x38aebc=_0x38aebc-0x0;var _0x28e52b=_0x46d7[_0x38aebc];return _0x28e52b;};'use strict';var SmsMessageEvents=require(_0x746d('0x0'));var events=['save',_0x746d('0x1'),'update'];function createListener(_0xd6ddec,_0x37edde){return function(_0x34dfaa){_0x37edde['emit'](_0xd6ddec,_0x34dfaa);};}function removeListener(_0xa00372,_0x26a7a5){return function(){SmsMessageEvents[_0x746d('0x2')](_0xa00372,_0x26a7a5);};}exports[_0x746d('0x3')]=function(_0x1243ea){for(var _0x2f42de=0x0,_0x1de326=events[_0x746d('0x4')];_0x2f42de<_0x1de326;_0x2f42de++){var _0x412535=events[_0x2f42de];var _0x5e426f=createListener(_0x746d('0x5')+_0x412535,_0x1243ea);SmsMessageEvents['on'](_0x412535,_0x5e426f);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 373de6f..404915d 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 _0x3533=['/:id/members','getMembers','getTeams','/:id/users','post','addTeams','addAgents','put','update','delete','/:id/teams','removeAgents','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','/describe','/:id','show'];(function(_0x22dbd1,_0x47e0bb){var _0x50a4fd=function(_0x5cadf4){while(--_0x5cadf4){_0x22dbd1['push'](_0x22dbd1['shift']());}};_0x50a4fd(++_0x47e0bb);}(_0x3533,0x6c));var _0x3353=function(_0x109ba7,_0x319264){_0x109ba7=_0x109ba7-0x0;var _0x509da3=_0x3533[_0x109ba7];return _0x509da3;};'use strict';var multer=require('multer');var util=require(_0x3353('0x0'));var path=require(_0x3353('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x3353('0x2'));var auth=require(_0x3353('0x3'));var interaction=require(_0x3353('0x4'));var config=require(_0x3353('0x5'));var controller=require(_0x3353('0x6'));router[_0x3353('0x7')]('/',auth[_0x3353('0x8')](),controller['index']);router[_0x3353('0x7')](_0x3353('0x9'),auth[_0x3353('0x8')](),controller['describe']);router[_0x3353('0x7')](_0x3353('0xa'),auth[_0x3353('0x8')](),controller[_0x3353('0xb')]);router[_0x3353('0x7')](_0x3353('0xc'),auth['isAuthenticated'](),controller[_0x3353('0xd')]);router[_0x3353('0x7')]('/:id/teams',auth[_0x3353('0x8')](),controller[_0x3353('0xe')]);router[_0x3353('0x7')](_0x3353('0xf'),auth[_0x3353('0x8')](),controller['getAgents']);router[_0x3353('0x10')]('/',auth[_0x3353('0x8')](),controller['create']);router[_0x3353('0x10')]('/:id/teams',auth[_0x3353('0x8')](),controller[_0x3353('0x11')]);router['post'](_0x3353('0xf'),auth['isAuthenticated'](),controller[_0x3353('0x12')]);router[_0x3353('0x13')](_0x3353('0xa'),auth[_0x3353('0x8')](),controller[_0x3353('0x14')]);router['delete'](_0x3353('0xa'),auth['isAuthenticated'](),controller['destroy']);router[_0x3353('0x15')](_0x3353('0x16'),auth[_0x3353('0x8')](),controller['removeTeams']);router[_0x3353('0x15')](_0x3353('0xf'),auth[_0x3353('0x8')](),controller[_0x3353('0x17')]);module['exports']=router; \ No newline at end of file +var _0xbe95=['multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','/:id/teams','/:id/users','getAgents','create','post','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents'];(function(_0x3ce4a5,_0x50bc4b){var _0x3f5809=function(_0x2f5b78){while(--_0x2f5b78){_0x3ce4a5['push'](_0x3ce4a5['shift']());}};_0x3f5809(++_0x50bc4b);}(_0xbe95,0x14a));var _0x5be9=function(_0x14b834,_0x3b013f){_0x14b834=_0x14b834-0x0;var _0x3b02e2=_0xbe95[_0x14b834];return _0x3b02e2;};'use strict';var multer=require(_0x5be9('0x0'));var util=require(_0x5be9('0x1'));var path=require(_0x5be9('0x2'));var timeout=require(_0x5be9('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x5be9('0x4'));var auth=require(_0x5be9('0x5'));var interaction=require(_0x5be9('0x6'));var config=require(_0x5be9('0x7'));var controller=require(_0x5be9('0x8'));router[_0x5be9('0x9')]('/',auth[_0x5be9('0xa')](),controller[_0x5be9('0xb')]);router[_0x5be9('0x9')](_0x5be9('0xc'),auth[_0x5be9('0xa')](),controller[_0x5be9('0xd')]);router['get'](_0x5be9('0xe'),auth[_0x5be9('0xa')](),controller[_0x5be9('0xf')]);router['get'](_0x5be9('0x10'),auth[_0x5be9('0xa')](),controller['getMembers']);router[_0x5be9('0x9')](_0x5be9('0x11'),auth[_0x5be9('0xa')](),controller['getTeams']);router[_0x5be9('0x9')](_0x5be9('0x12'),auth[_0x5be9('0xa')](),controller[_0x5be9('0x13')]);router['post']('/',auth[_0x5be9('0xa')](),controller[_0x5be9('0x14')]);router[_0x5be9('0x15')](_0x5be9('0x11'),auth[_0x5be9('0xa')](),controller[_0x5be9('0x16')]);router[_0x5be9('0x15')]('/:id/users',auth[_0x5be9('0xa')](),controller[_0x5be9('0x17')]);router[_0x5be9('0x18')](_0x5be9('0xe'),auth['isAuthenticated'](),controller[_0x5be9('0x19')]);router[_0x5be9('0x1a')](_0x5be9('0xe'),auth[_0x5be9('0xa')](),controller[_0x5be9('0x1b')]);router[_0x5be9('0x1a')](_0x5be9('0x11'),auth[_0x5be9('0xa')](),controller[_0x5be9('0x1c')]);router[_0x5be9('0x1a')](_0x5be9('0x12'),auth[_0x5be9('0xa')](),controller[_0x5be9('0x1d')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index b783ef3..919b609 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 _0x8f79=['INTEGER','ENUM','beepall','roundrobin','sequelize','exports','STRING','name'];(function(_0x4578e7,_0x1c72a2){var _0x3db768=function(_0x58a4ed){while(--_0x58a4ed){_0x4578e7['push'](_0x4578e7['shift']());}};_0x3db768(++_0x1c72a2);}(_0x8f79,0x124));var _0x98f7=function(_0x10575d,_0x39a61d){_0x10575d=_0x10575d-0x0;var _0x6ee091=_0x8f79[_0x10575d];return _0x6ee091;};'use strict';var Sequelize=require(_0x98f7('0x0'));module[_0x98f7('0x1')]={'name':{'type':Sequelize[_0x98f7('0x2')],'unique':_0x98f7('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x98f7('0x2')]},'timeout':{'type':Sequelize[_0x98f7('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x98f7('0x5')]('rrmemory',_0x98f7('0x6'),_0x98f7('0x7'))}}; \ No newline at end of file +var _0x3e7b=['rrmemory','beepall','roundrobin','sequelize','exports','name','STRING','ENUM'];(function(_0x1eafe1,_0x29b4d1){var _0xcd2143=function(_0x43dcf9){while(--_0x43dcf9){_0x1eafe1['push'](_0x1eafe1['shift']());}};_0xcd2143(++_0x29b4d1);}(_0x3e7b,0x183));var _0xb3e7=function(_0x185a05,_0x44a9c8){_0x185a05=_0x185a05-0x0;var _0xc86278=_0x3e7b[_0x185a05];return _0xc86278;};'use strict';var Sequelize=require(_0xb3e7('0x0'));module[_0xb3e7('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xb3e7('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb3e7('0x3')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb3e7('0x4')](_0xb3e7('0x5'),_0xb3e7('0x6'),_0xb3e7('0x7'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 9042261..6dd2005 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 _0xfb21=['destroy','then','get','SmsQueues','UserProfileResource','error','stack','name','index','map','SmsQueue','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','nolimit','order','sort','where','filters','pick','merge','filter','options','include','rows','rawAttributes','includeAll','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','UserSmsQueue','hasOwnProperty','findAll','User','findAndCountAll','UserId','smsPause','createdAt','format','%s/%s','updatedAt','getTeams','findOne','Team','addTeams','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','removeTeams','ids','select','field','join','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','userSmsQueue:remove','addAgents','spread','userSmsQueue:save','isArray','getAgents','eml-format','rimraf','request-promise','moment','mustache','util','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','end','json','undefined','limit','count','offset','status','Content-Range','reject','save','update'];(function(_0x35af23,_0x9190f6){var _0x340506=function(_0xd4c26b){while(--_0xd4c26b){_0x35af23['push'](_0x35af23['shift']());}};_0x340506(++_0x9190f6);}(_0xfb21,0xeb));var _0x1fb2=function(_0x5e75cb,_0x2647b1){_0x5e75cb=_0x5e75cb-0x0;var _0x3415d0=_0xfb21[_0x5e75cb];return _0x3415d0;};'use strict';var emlformat=require(_0x1fb2('0x0'));var rimraf=require(_0x1fb2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1fb2('0x2'));var moment=require(_0x1fb2('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1fb2('0x4'));var util=require(_0x1fb2('0x5'));var path=require(_0x1fb2('0x6'));var sox=require('sox');var csv=require(_0x1fb2('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1fb2('0x8'));var _=require(_0x1fb2('0x9'));var squel=require('squel');var crypto=require(_0x1fb2('0xa'));var jsforce=require(_0x1fb2('0xb'));var deskjs=require(_0x1fb2('0xc'));var toCsv=require(_0x1fb2('0x7'));var querystring=require('querystring');var Papa=require(_0x1fb2('0xd'));var Redis=require(_0x1fb2('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x1fb2('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1fb2('0x10'));var utils=require(_0x1fb2('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x1fb2('0x12'));var db=require('../../mysqldb')['db'];config[_0x1fb2('0x13')]=_[_0x1fb2('0x14')](config['redis'],{'host':_0x1fb2('0x15'),'port':0x18eb});var socket=require(_0x1fb2('0x16'))(new Redis(config[_0x1fb2('0x13')]));require(_0x1fb2('0x17'))[_0x1fb2('0x18')](socket);function respondWithStatusCode(_0x5da8d3,_0x41d3eb){_0x41d3eb=_0x41d3eb||0xcc;return function(_0x2d9754){if(_0x2d9754){return _0x5da8d3[_0x1fb2('0x19')](_0x41d3eb);}return _0x5da8d3['status'](_0x41d3eb)[_0x1fb2('0x1a')]();};}function respondWithResult(_0x23576a,_0x16455a){_0x16455a=_0x16455a||0xc8;return function(_0x5f650a){if(_0x5f650a){return _0x23576a['status'](_0x16455a)[_0x1fb2('0x1b')](_0x5f650a);}};}function respondWithFilteredResult(_0x12b7bb,_0x16b683){return function(_0x6a1152){if(_0x6a1152){var _0xafdb8d=typeof _0x16b683['offset']===_0x1fb2('0x1c')&&typeof _0x16b683[_0x1fb2('0x1d')]===_0x1fb2('0x1c');var _0xbd7c14=_0x6a1152[_0x1fb2('0x1e')];var _0x49e277=_0xafdb8d?0x0:_0x16b683[_0x1fb2('0x1f')];var _0xaa6cbf=_0xafdb8d?_0x6a1152[_0x1fb2('0x1e')]:_0x16b683[_0x1fb2('0x1f')]+_0x16b683['limit'];var _0x15461f;if(_0xaa6cbf>=_0xbd7c14){_0xaa6cbf=_0xbd7c14;_0x15461f=0xc8;}else{_0x15461f=0xce;}_0x12b7bb[_0x1fb2('0x20')](_0x15461f);return _0x12b7bb['set'](_0x1fb2('0x21'),_0x49e277+'-'+_0xaa6cbf+'/'+_0xbd7c14)['json'](_0x6a1152);}return null;};}function patchUpdates(_0x32ea4b){return function(_0x33606f){try{jsonpatch['apply'](_0x33606f,_0x32ea4b,!![]);}catch(_0x1fae22){return BPromise[_0x1fb2('0x22')](_0x1fae22);}return _0x33606f[_0x1fb2('0x23')]();};}function saveUpdates(_0x318d1b,_0x43868a){return function(_0x4b101e){if(_0x4b101e){return _0x4b101e[_0x1fb2('0x24')](_0x318d1b)['then'](function(_0x19e04d){return _0x19e04d;});}return null;};}function removeEntity(_0x3e659a,_0x3b145f){return function(_0x6cc35c){if(_0x6cc35c){return _0x6cc35c[_0x1fb2('0x25')]()[_0x1fb2('0x26')](function(){var _0x5af436=_0x6cc35c[_0x1fb2('0x27')]({'plain':!![]});var _0x351dd6=_0x1fb2('0x28');return db[_0x1fb2('0x29')]['destroy']({'where':{'type':_0x351dd6,'resourceId':_0x5af436['id']}})[_0x1fb2('0x26')](function(){return _0x6cc35c;});})[_0x1fb2('0x26')](function(){_0x3e659a[_0x1fb2('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x33ebdd,_0x56d139){return function(_0xe4b267){if(!_0xe4b267){_0x33ebdd[_0x1fb2('0x19')](0x194);}return _0xe4b267;};}function handleError(_0x34cc13,_0x32f4a2){_0x32f4a2=_0x32f4a2||0x1f4;return function(_0x1c730b){logger[_0x1fb2('0x2a')](_0x1c730b[_0x1fb2('0x2b')]);if(_0x1c730b[_0x1fb2('0x2c')]){delete _0x1c730b[_0x1fb2('0x2c')];}_0x34cc13[_0x1fb2('0x20')](_0x32f4a2)['send'](_0x1c730b);};}exports[_0x1fb2('0x2d')]=function(_0x1c7058,_0x141f28){var _0x5a9c5d={},_0x16b739={},_0x8a6c11={'count':0x0,'rows':[]};var _0x5251d5=_[_0x1fb2('0x2e')](db[_0x1fb2('0x2f')]['rawAttributes'],function(_0x19bc3f){return{'name':_0x19bc3f[_0x1fb2('0x30')],'type':_0x19bc3f[_0x1fb2('0x31')][_0x1fb2('0x32')]};});_0x16b739['model']=_[_0x1fb2('0x2e')](_0x5251d5,'name');_0x16b739[_0x1fb2('0x33')]=_[_0x1fb2('0x34')](_0x1c7058[_0x1fb2('0x33')]);_0x16b739['filters']=_[_0x1fb2('0x35')](_0x16b739['model'],_0x16b739[_0x1fb2('0x33')]);_0x5a9c5d['attributes']=_[_0x1fb2('0x35')](_0x16b739[_0x1fb2('0x36')],qs['fields'](_0x1c7058[_0x1fb2('0x33')][_0x1fb2('0x37')]));_0x5a9c5d[_0x1fb2('0x38')]=_0x5a9c5d['attributes'][_0x1fb2('0x39')]?_0x5a9c5d[_0x1fb2('0x38')]:_0x16b739[_0x1fb2('0x36')];if(!_0x1c7058[_0x1fb2('0x33')]['hasOwnProperty'](_0x1fb2('0x3a'))){_0x5a9c5d[_0x1fb2('0x1d')]=qs['limit'](_0x1c7058[_0x1fb2('0x33')][_0x1fb2('0x1d')]);_0x5a9c5d[_0x1fb2('0x1f')]=qs[_0x1fb2('0x1f')](_0x1c7058[_0x1fb2('0x33')][_0x1fb2('0x1f')]);}_0x5a9c5d[_0x1fb2('0x3b')]=qs[_0x1fb2('0x3c')](_0x1c7058[_0x1fb2('0x33')]['sort']);_0x5a9c5d[_0x1fb2('0x3d')]=qs[_0x1fb2('0x3e')](_[_0x1fb2('0x3f')](_0x1c7058[_0x1fb2('0x33')],_0x16b739[_0x1fb2('0x3e')]),_0x5251d5);if(_0x1c7058[_0x1fb2('0x33')]['filter']){_0x5a9c5d[_0x1fb2('0x3d')]=_[_0x1fb2('0x40')](_0x5a9c5d[_0x1fb2('0x3d')],{'$or':_[_0x1fb2('0x2e')](_0x5251d5,function(_0x19c6f1){if(_0x19c6f1['type']!=='VIRTUAL'){var _0x41483e={};_0x41483e[_0x19c6f1[_0x1fb2('0x2c')]]={'$like':'%'+_0x1c7058['query'][_0x1fb2('0x41')]+'%'};return _0x41483e;}})});}_0x5a9c5d=_[_0x1fb2('0x40')]({},_0x5a9c5d,_0x1c7058[_0x1fb2('0x42')]);var _0x599097={'where':_0x5a9c5d[_0x1fb2('0x3d')]};return db[_0x1fb2('0x2f')][_0x1fb2('0x1e')](_0x599097)[_0x1fb2('0x26')](function(_0x4625cb){_0x8a6c11[_0x1fb2('0x1e')]=_0x4625cb;if(_0x1c7058['query']['includeAll']){_0x5a9c5d[_0x1fb2('0x43')]=[{'all':!![]}];}return db['SmsQueue']['findAll'](_0x5a9c5d);})[_0x1fb2('0x26')](function(_0x67d89e){_0x8a6c11[_0x1fb2('0x44')]=_0x67d89e;return _0x8a6c11;})[_0x1fb2('0x26')](respondWithFilteredResult(_0x141f28,_0x5a9c5d))['catch'](handleError(_0x141f28,null));};exports['show']=function(_0x1e85e9,_0x432fd8){var _0x3e00d5={'raw':!![],'where':{'id':_0x1e85e9['params']['id']}},_0x5b96e0={};_0x5b96e0['model']=_[_0x1fb2('0x34')](db[_0x1fb2('0x2f')][_0x1fb2('0x45')]);_0x5b96e0[_0x1fb2('0x33')]=_[_0x1fb2('0x34')](_0x1e85e9[_0x1fb2('0x33')]);_0x5b96e0[_0x1fb2('0x3e')]=_['intersection'](_0x5b96e0[_0x1fb2('0x36')],_0x5b96e0[_0x1fb2('0x33')]);_0x3e00d5[_0x1fb2('0x38')]=_[_0x1fb2('0x35')](_0x5b96e0[_0x1fb2('0x36')],qs[_0x1fb2('0x37')](_0x1e85e9['query']['fields']));_0x3e00d5['attributes']=_0x3e00d5[_0x1fb2('0x38')][_0x1fb2('0x39')]?_0x3e00d5['attributes']:_0x5b96e0['model'];if(_0x1e85e9['query'][_0x1fb2('0x46')]){_0x3e00d5['include']=[{'all':!![]}];}_0x3e00d5=_[_0x1fb2('0x40')]({},_0x3e00d5,_0x1e85e9['options']);return db[_0x1fb2('0x2f')][_0x1fb2('0x47')](_0x3e00d5)['then'](handleEntityNotFound(_0x432fd8,null))[_0x1fb2('0x26')](respondWithResult(_0x432fd8,null))[_0x1fb2('0x48')](handleError(_0x432fd8,null));};exports[_0x1fb2('0x49')]=function(_0x325c8c,_0x573725){return db[_0x1fb2('0x2f')][_0x1fb2('0x49')](_0x325c8c[_0x1fb2('0x4a')],{})['then'](function(_0x150548){var _0x3f54c0=_0x325c8c[_0x1fb2('0x4b')][_0x1fb2('0x27')]({'plain':!![]});if(!_0x3f54c0)throw new Error(_0x1fb2('0x4c'));if(_0x3f54c0[_0x1fb2('0x4d')]===_0x1fb2('0x4b')){var _0x363c70=_0x150548[_0x1fb2('0x27')]({'plain':!![]});var _0x26cb28='SmsQueues';return db[_0x1fb2('0x4e')]['find']({'where':{'name':_0x26cb28,'userProfileId':_0x3f54c0['userProfileId']},'raw':!![]})[_0x1fb2('0x26')](function(_0x55c6ba){if(_0x55c6ba&&_0x55c6ba[_0x1fb2('0x4f')]===0x0){return db[_0x1fb2('0x29')][_0x1fb2('0x49')]({'name':_0x363c70[_0x1fb2('0x2c')],'resourceId':_0x363c70['id'],'type':_0x55c6ba[_0x1fb2('0x2c')],'sectionId':_0x55c6ba['id']},{})['then'](function(){return _0x150548;});}else{return _0x150548;}})[_0x1fb2('0x48')](function(_0x38ad9d){logger[_0x1fb2('0x2a')](_0x1fb2('0x50'),_0x38ad9d);throw _0x38ad9d;});}return _0x150548;})['then'](respondWithResult(_0x573725,0xc9))[_0x1fb2('0x48')](handleError(_0x573725,null));};exports[_0x1fb2('0x24')]=function(_0x1f0e81,_0x25b608){if(_0x1f0e81['body']['id']){delete _0x1f0e81[_0x1fb2('0x4a')]['id'];}return db['SmsQueue'][_0x1fb2('0x47')]({'where':{'id':_0x1f0e81[_0x1fb2('0x51')]['id']}})[_0x1fb2('0x26')](handleEntityNotFound(_0x25b608,null))[_0x1fb2('0x26')](saveUpdates(_0x1f0e81[_0x1fb2('0x4a')],null))[_0x1fb2('0x26')](respondWithResult(_0x25b608,null))[_0x1fb2('0x48')](handleError(_0x25b608,null));};exports[_0x1fb2('0x25')]=function(_0x50d3bf,_0x26cfea){return db[_0x1fb2('0x2f')][_0x1fb2('0x47')]({'where':{'id':_0x50d3bf[_0x1fb2('0x51')]['id']}})['then'](handleEntityNotFound(_0x26cfea,null))[_0x1fb2('0x26')](removeEntity(_0x26cfea,null))['catch'](handleError(_0x26cfea,null));};exports[_0x1fb2('0x52')]=function(_0x14b109,_0x17c14a){return db['SmsQueue']['describe']()[_0x1fb2('0x26')](respondWithResult(_0x17c14a,null))['catch'](handleError(_0x17c14a,null));};exports[_0x1fb2('0x53')]=function(_0x5af7c6,_0x98e26b,_0x31785f){var _0x368587={'raw':!![],'where':{}},_0x22b6b6={},_0x30a70d;return db[_0x1fb2('0x2f')]['findOne']({'where':{'id':_0x5af7c6['params']['id']}})[_0x1fb2('0x26')](handleEntityNotFound(_0x98e26b,null))[_0x1fb2('0x26')](function(_0x27a5ff){if(_0x27a5ff){_0x30a70d=_0x27a5ff[_0x1fb2('0x27')]({'plain':!![]});_0x22b6b6[_0x1fb2('0x36')]=_['keys'](db[_0x1fb2('0x54')][_0x1fb2('0x45')]);_0x22b6b6[_0x1fb2('0x33')]=_[_0x1fb2('0x34')](_0x5af7c6[_0x1fb2('0x33')]);_0x22b6b6[_0x1fb2('0x3e')]=_[_0x1fb2('0x35')](_0x22b6b6[_0x1fb2('0x36')],_0x22b6b6[_0x1fb2('0x33')]);_0x368587[_0x1fb2('0x38')]=_[_0x1fb2('0x35')](_0x22b6b6[_0x1fb2('0x36')],qs[_0x1fb2('0x37')](_0x5af7c6['query']['fields']));_0x368587['attributes']=_0x368587[_0x1fb2('0x38')][_0x1fb2('0x39')]?_0x368587[_0x1fb2('0x38')]:_0x22b6b6[_0x1fb2('0x36')];if(!_0x5af7c6['query'][_0x1fb2('0x55')](_0x1fb2('0x3a'))){_0x368587[_0x1fb2('0x1d')]=qs[_0x1fb2('0x1d')](_0x5af7c6[_0x1fb2('0x33')][_0x1fb2('0x1d')]);_0x368587['offset']=qs[_0x1fb2('0x1f')](_0x5af7c6['query']['offset']);}_0x368587[_0x1fb2('0x3b')]=qs[_0x1fb2('0x3c')](_0x5af7c6[_0x1fb2('0x33')][_0x1fb2('0x3c')]);_0x368587['where']=qs[_0x1fb2('0x3e')](_['pick'](_0x5af7c6[_0x1fb2('0x33')],_0x22b6b6[_0x1fb2('0x3e')]));_0x368587['where']['SmsQueueId']=_0x27a5ff['id'];if(_0x5af7c6['query']['filter']){_0x368587['where']=_['merge'](_0x368587[_0x1fb2('0x3d')],{'$or':_[_0x1fb2('0x2e')](_0x368587[_0x1fb2('0x38')],function(_0x4d4100){var _0x3b9a5b={};_0x3b9a5b[_0x4d4100]={'$like':'%'+_0x5af7c6[_0x1fb2('0x33')][_0x1fb2('0x41')]+'%'};return _0x3b9a5b;})});}_0x368587=_['merge']({},_0x368587,_0x5af7c6[_0x1fb2('0x42')]);return db['UserSmsQueue'][_0x1fb2('0x56')](_0x368587);}})['then'](function(_0x13822d){if(_0x13822d){return db[_0x1fb2('0x57')][_0x1fb2('0x58')]({'where':{'id':_[_0x1fb2('0x2e')](_0x13822d,_0x1fb2('0x59')),'role':'agent'},'attributes':['id',_0x1fb2('0x2c'),_0x1fb2('0x5a'),'updatedAt',_0x1fb2('0x5b')]});}})['then'](function(_0x5e892b){if(_0x5e892b){return{'count':_0x5e892b[_0x1fb2('0x1e')],'rows':_[_0x1fb2('0x2e')](_0x5e892b[_0x1fb2('0x44')],function(_0x270f09){return{'membername':_0x270f09[_0x1fb2('0x2c')],'UserId':_0x270f09['id'],'queue_name':_0x30a70d['name'],'SmsQueueId':_0x30a70d['id'],'interface':util[_0x1fb2('0x5c')](_0x1fb2('0x5d'),'SIP',_0x270f09[_0x1fb2('0x2c')]),'penalty':0x0,'paused':_0x270f09['smsPause'],'createdAt':_0x270f09[_0x1fb2('0x5b')],'updatedAt':_0x270f09[_0x1fb2('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x1fb2('0x26')](respondWithFilteredResult(_0x98e26b,_0x368587))[_0x1fb2('0x48')](handleError(_0x98e26b,null));};exports[_0x1fb2('0x5f')]=function(_0x2b350a,_0x18965a,_0x176aaf){var _0x4d5760={};var _0x38442d={};var _0x612d14;var _0x7ccfcb;return db[_0x1fb2('0x2f')][_0x1fb2('0x60')]({'where':{'id':_0x2b350a[_0x1fb2('0x51')]['id']}})[_0x1fb2('0x26')](handleEntityNotFound(_0x18965a,null))[_0x1fb2('0x26')](function(_0xc6cba5){if(_0xc6cba5){_0x612d14=_0xc6cba5;_0x38442d[_0x1fb2('0x36')]=_[_0x1fb2('0x34')](db[_0x1fb2('0x61')][_0x1fb2('0x45')]);_0x38442d['query']=_[_0x1fb2('0x34')](_0x2b350a[_0x1fb2('0x33')]);_0x38442d['filters']=_[_0x1fb2('0x35')](_0x38442d['model'],_0x38442d[_0x1fb2('0x33')]);_0x4d5760[_0x1fb2('0x38')]=_[_0x1fb2('0x35')](_0x38442d[_0x1fb2('0x36')],qs[_0x1fb2('0x37')](_0x2b350a[_0x1fb2('0x33')][_0x1fb2('0x37')]));_0x4d5760[_0x1fb2('0x38')]=_0x4d5760['attributes']['length']?_0x4d5760['attributes']:_0x38442d[_0x1fb2('0x36')];_0x4d5760[_0x1fb2('0x3b')]=qs[_0x1fb2('0x3c')](_0x2b350a[_0x1fb2('0x33')][_0x1fb2('0x3c')]);_0x4d5760[_0x1fb2('0x3d')]=qs[_0x1fb2('0x3e')](_['pick'](_0x2b350a[_0x1fb2('0x33')],_0x38442d[_0x1fb2('0x3e')]));if(_0x2b350a[_0x1fb2('0x33')]['filter']){_0x4d5760[_0x1fb2('0x3d')]=_['merge'](_0x4d5760[_0x1fb2('0x3d')],{'$or':_[_0x1fb2('0x2e')](_0x4d5760[_0x1fb2('0x38')],function(_0x5caf48){var _0x3c4699={};_0x3c4699[_0x5caf48]={'$like':'%'+_0x2b350a[_0x1fb2('0x33')]['filter']+'%'};return _0x3c4699;})});}_0x4d5760=_[_0x1fb2('0x40')]({},_0x4d5760,_0x2b350a[_0x1fb2('0x42')]);return _0x612d14['getTeams'](_0x4d5760);}})[_0x1fb2('0x26')](function(_0x4e06f0){if(_0x4e06f0){_0x7ccfcb=_0x4e06f0[_0x1fb2('0x39')];if(!_0x2b350a[_0x1fb2('0x33')][_0x1fb2('0x55')](_0x1fb2('0x3a'))){_0x4d5760[_0x1fb2('0x1d')]=qs[_0x1fb2('0x1d')](_0x2b350a[_0x1fb2('0x33')][_0x1fb2('0x1d')]);_0x4d5760[_0x1fb2('0x1f')]=qs[_0x1fb2('0x1f')](_0x2b350a['query'][_0x1fb2('0x1f')]);}return _0x612d14['getTeams'](_0x4d5760);}})[_0x1fb2('0x26')](function(_0x16b726){if(_0x16b726){return _0x16b726?{'count':_0x7ccfcb,'rows':_0x16b726}:null;}})['then'](respondWithResult(_0x18965a,null))[_0x1fb2('0x48')](handleError(_0x18965a,null));};exports[_0x1fb2('0x62')]=function(_0x1ccbeb,_0x8b481f,_0x15c1a6){var _0x64fd0d=_0x1ccbeb['body']['ids'];return db[_0x1fb2('0x61')]['findAll']({'where':{'id':_0x64fd0d},'attributes':['id'],'include':[{'model':db[_0x1fb2('0x57')],'as':_0x1fb2('0x63'),'attributes':['id','name',_0x1fb2('0x64'),_0x1fb2('0x65'),_0x1fb2('0x66')],'raw':!![]}]})[_0x1fb2('0x26')](function(_0x50148b){if(_0x50148b){var _0x1baecb=_[_0x1fb2('0x67')](_0x50148b,function(_0x5abdc1){var _0x3662e4=_0x5abdc1[_0x1fb2('0x27')]({'plain':!![]});return _0x3662e4[_0x1fb2('0x63')];});return db['SmsQueue'][_0x1fb2('0x47')]({'where':{'id':_0x1ccbeb['params']['id']}})['then'](function(_0x1c1ebe){return db[_0x1fb2('0x68')][_0x1fb2('0x69')](function(_0x3b7793){return _0x1c1ebe[_0x1fb2('0x62')](_0x64fd0d,{'transaction':_0x3b7793})[_0x1fb2('0x26')](function(){return BPromise[_0x1fb2('0x6a')](_0x1baecb,function(_0x4fdfac){return db['UserSmsQueue'][_0x1fb2('0x6b')]({'where':{'UserId':_0x4fdfac['id'],'SmsQueueId':_0x1ccbeb['params']['id']},'transaction':_0x3b7793});});})['then'](function(){_0x1baecb[_0x1fb2('0x6c')](function(_0x352062){socket[_0x1fb2('0x6d')]('userSmsQueue:save',{'UserId':_0x352062['id'],'SmsQueueId':_0x1c1ebe['id']});});});});});}})[_0x1fb2('0x26')](respondWithStatusCode(_0x8b481f,null))[_0x1fb2('0x48')](handleError(_0x8b481f,null));};exports[_0x1fb2('0x6e')]=function(_0x57468c,_0x35997f,_0x5e751b){return db[_0x1fb2('0x61')][_0x1fb2('0x56')]({'where':{'id':_0x57468c[_0x1fb2('0x33')][_0x1fb2('0x6f')]},'attributes':['id'],'include':[{'model':db[_0x1fb2('0x57')],'as':_0x1fb2('0x63'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x35997f,null))[_0x1fb2('0x26')](function(_0x472ee7){var _0x5593a4=_['map'](_0x472ee7,'id');var _0x9dd34=[];var _0x271f43=[];var _0x11acf9=squel[_0x1fb2('0x70')]();_0x11acf9[_0x1fb2('0x71')]('tq.TeamId')['from']('team_has_sms_queues','tq')[_0x1fb2('0x72')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x1fb2('0x3d')](_0x1fb2('0x73'),_0x57468c[_0x1fb2('0x51')]['id']);for(var _0x184796=0x0;_0x184796<_0x472ee7['length'];_0x184796+=0x1){let _0x4a3369=_0x472ee7[_0x184796];for(var _0x11e124=0x0;_0x11e124<_0x4a3369['Agents']['length'];_0x11e124+=0x1){let _0x2d526f=_0x4a3369[_0x1fb2('0x63')][_0x11e124];var _0x5700c6=_0x11acf9[_0x1fb2('0x74')]();_0x5700c6[_0x1fb2('0x3d')](_0x1fb2('0x75'),_0x2d526f['id']);_0x271f43[_0x1fb2('0x76')](db['sequelize'][_0x1fb2('0x33')](_0x5700c6['toString'](),{'type':db[_0x1fb2('0x68')][_0x1fb2('0x77')][_0x1fb2('0x78')]})[_0x1fb2('0x26')](function(_0x56f349){if(_0x56f349[_0x1fb2('0x39')]===0x1){return _0x2d526f['id'];}else{var _0xdabf23=_[_0x1fb2('0x79')](_[_0x1fb2('0x2e')](_0x56f349,_0x1fb2('0x7a')),function(_0x5a6df5){return _[_0x1fb2('0x7b')](_0x5593a4,_0x5a6df5);});if(_0xdabf23){return _0x2d526f['id'];}}}));}}return BPromise[_0x1fb2('0x7c')](_0x271f43)[_0x1fb2('0x26')](function(_0x316c30){_0x9dd34=_(_0x9dd34)[_0x1fb2('0x7d')](_0x316c30)[_0x1fb2('0x7e')]()[_0x1fb2('0x7f')]();return db[_0x1fb2('0x2f')][_0x1fb2('0x47')]({'where':{'id':_0x57468c['params']['id']}})[_0x1fb2('0x26')](function(_0x51eb7d){return db['sequelize'][_0x1fb2('0x69')](function(_0x502163){return _0x51eb7d[_0x1fb2('0x6e')](_0x57468c[_0x1fb2('0x33')]['ids'],{'transaction':_0x502163})['then'](function(){if(!_[_0x1fb2('0x80')](_0x9dd34)){return _0x51eb7d[_0x1fb2('0x81')](_0x9dd34,{'transaction':_0x502163});}})['then'](function(){_0x9dd34[_0x1fb2('0x6c')](function(_0x14df93){socket[_0x1fb2('0x6d')](_0x1fb2('0x82'),{'UserId':_0x14df93,'SmsQueueId':_0x51eb7d['id']});});});});});});})[_0x1fb2('0x26')](respondWithStatusCode(_0x35997f,null))[_0x1fb2('0x48')](handleError(_0x35997f,null));};exports['addAgents']=function(_0x3235a7,_0x481d1b,_0x2f1a5e){return db[_0x1fb2('0x2f')][_0x1fb2('0x47')]({'where':{'id':_0x3235a7[_0x1fb2('0x51')]['id']}})['then'](handleEntityNotFound(_0x481d1b,null))['then'](function(_0x459167){if(_0x459167){return _0x459167[_0x1fb2('0x83')](_0x3235a7[_0x1fb2('0x4a')][_0x1fb2('0x6f')],_['omit'](_0x3235a7[_0x1fb2('0x4a')],[_0x1fb2('0x6f'),'id'])||{})[_0x1fb2('0x84')](function(_0x1d227f){for(var _0xaaf33a=0x0;_0xaaf33a<_0x3235a7[_0x1fb2('0x4a')][_0x1fb2('0x6f')][_0x1fb2('0x39')];_0xaaf33a+=0x1){socket[_0x1fb2('0x6d')](_0x1fb2('0x85'),{'UserId':Number(_0x3235a7[_0x1fb2('0x4a')][_0x1fb2('0x6f')][_0xaaf33a]),'SmsQueueId':Number(_0x3235a7[_0x1fb2('0x51')]['id'])});}return _0x1d227f;});}})[_0x1fb2('0x26')](respondWithResult(_0x481d1b,null))[_0x1fb2('0x48')](handleError(_0x481d1b,null));};exports['removeAgents']=function(_0x52fb36,_0x4313d3,_0x2da8c4){return db[_0x1fb2('0x2f')][_0x1fb2('0x47')]({'where':{'id':_0x52fb36[_0x1fb2('0x51')]['id']}})[_0x1fb2('0x26')](handleEntityNotFound(_0x4313d3,null))[_0x1fb2('0x26')](function(_0x509561){if(_0x509561){return _0x509561[_0x1fb2('0x81')](_0x52fb36[_0x1fb2('0x33')][_0x1fb2('0x6f')])[_0x1fb2('0x26')](function(){if(_[_0x1fb2('0x86')](_0x52fb36[_0x1fb2('0x33')]['ids'])){for(var _0x1c36eb=0x0;_0x1c36eb<_0x52fb36['query']['ids'][_0x1fb2('0x39')];_0x1c36eb+=0x1){socket['emit'](_0x1fb2('0x82'),{'UserId':Number(_0x52fb36[_0x1fb2('0x33')][_0x1fb2('0x6f')][_0x1c36eb]),'SmsQueueId':Number(_0x52fb36[_0x1fb2('0x51')]['id'])});}}else{socket['emit'](_0x1fb2('0x82'),{'UserId':Number(_0x52fb36[_0x1fb2('0x33')][_0x1fb2('0x6f')]),'SmsQueueId':Number(_0x52fb36['params']['id'])});}});}})[_0x1fb2('0x26')](respondWithStatusCode(_0x4313d3,null))[_0x1fb2('0x48')](handleError(_0x4313d3,null));};exports[_0x1fb2('0x87')]=function(_0x109dcd,_0x1218f0,_0x4d9db1){var _0x262fd3={};var _0x30722f={};var _0x5c96ee;var _0x44f4e3;return db[_0x1fb2('0x2f')]['findOne']({'where':{'id':_0x109dcd[_0x1fb2('0x51')]['id']}})[_0x1fb2('0x26')](handleEntityNotFound(_0x1218f0,null))['then'](function(_0x262421){if(_0x262421){_0x5c96ee=_0x262421;_0x30722f[_0x1fb2('0x36')]=_[_0x1fb2('0x34')](db['User'][_0x1fb2('0x45')]);_0x30722f[_0x1fb2('0x33')]=_[_0x1fb2('0x34')](_0x109dcd[_0x1fb2('0x33')]);_0x30722f[_0x1fb2('0x3e')]=_[_0x1fb2('0x35')](_0x30722f[_0x1fb2('0x36')],_0x30722f[_0x1fb2('0x33')]);_0x262fd3[_0x1fb2('0x38')]=_[_0x1fb2('0x35')](_0x30722f[_0x1fb2('0x36')],qs[_0x1fb2('0x37')](_0x109dcd[_0x1fb2('0x33')][_0x1fb2('0x37')]));_0x262fd3[_0x1fb2('0x38')]=_0x262fd3[_0x1fb2('0x38')][_0x1fb2('0x39')]?_0x262fd3[_0x1fb2('0x38')]:_0x30722f[_0x1fb2('0x36')];_0x262fd3['order']=qs['sort'](_0x109dcd[_0x1fb2('0x33')][_0x1fb2('0x3c')]);_0x262fd3[_0x1fb2('0x3d')]=qs[_0x1fb2('0x3e')](_[_0x1fb2('0x3f')](_0x109dcd[_0x1fb2('0x33')],_0x30722f[_0x1fb2('0x3e')]));if(_0x109dcd[_0x1fb2('0x33')][_0x1fb2('0x41')]){_0x262fd3[_0x1fb2('0x3d')]=_[_0x1fb2('0x40')](_0x262fd3[_0x1fb2('0x3d')],{'$or':_[_0x1fb2('0x2e')](_0x262fd3[_0x1fb2('0x38')],function(_0x5c1434){var _0x57b591={};_0x57b591[_0x5c1434]={'$like':'%'+_0x109dcd[_0x1fb2('0x33')][_0x1fb2('0x41')]+'%'};return _0x57b591;})});}_0x262fd3=_[_0x1fb2('0x40')]({},_0x262fd3,_0x109dcd[_0x1fb2('0x42')]);return _0x5c96ee[_0x1fb2('0x87')](_0x262fd3);}})[_0x1fb2('0x26')](function(_0x18de60){if(_0x18de60){_0x44f4e3=_0x18de60[_0x1fb2('0x39')];if(!_0x109dcd[_0x1fb2('0x33')][_0x1fb2('0x55')](_0x1fb2('0x3a'))){_0x262fd3[_0x1fb2('0x1d')]=qs[_0x1fb2('0x1d')](_0x109dcd['query'][_0x1fb2('0x1d')]);_0x262fd3[_0x1fb2('0x1f')]=qs[_0x1fb2('0x1f')](_0x109dcd[_0x1fb2('0x33')][_0x1fb2('0x1f')]);}return _0x5c96ee['getAgents'](_0x262fd3);}})[_0x1fb2('0x26')](function(_0x707105){if(_0x707105){return _0x707105?{'count':_0x44f4e3,'rows':_0x707105}:null;}})[_0x1fb2('0x26')](respondWithResult(_0x1218f0,null))['catch'](handleError(_0x1218f0,null));}; \ No newline at end of file +var _0x4a51=['merge','options','include','SmsQueue','findAll','rows','catch','show','params','includeAll','find','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserSmsQueue','SmsQueueId','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','%s/%s','getTeams','Team','addTeams','ids','Agents','online','interface','flatMap','sequelize','findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','every','TeamId','includes','all','transaction','isEmpty','userSmsQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','User','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','to-csv','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','reject','save','update','then','destroy','get','SmsQueues','UserProfileResource','error','stack','name','send','map','rawAttributes','type','keys','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter'];(function(_0x5e0f48,_0x588ca6){var _0x38ac9d=function(_0x1497fe){while(--_0x1497fe){_0x5e0f48['push'](_0x5e0f48['shift']());}};_0x38ac9d(++_0x588ca6);}(_0x4a51,0x14e));var _0x14a5=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x4a51[_0x565c49];return _0x20ca34;};'use strict';var emlformat=require(_0x14a5('0x0'));var rimraf=require(_0x14a5('0x1'));var zipdir=require(_0x14a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x14a5('0x3'));var moment=require(_0x14a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x14a5('0x5'));var util=require(_0x14a5('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x14a5('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x14a5('0x8'));var deskjs=require(_0x14a5('0x9'));var toCsv=require(_0x14a5('0x7'));var querystring=require(_0x14a5('0xa'));var Papa=require(_0x14a5('0xb'));var Redis=require('ioredis');var authService=require(_0x14a5('0xc'));var qs=require(_0x14a5('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x14a5('0xe'));var logger=require(_0x14a5('0xf'))(_0x14a5('0x10'));var utils=require('../../config/utils');var config=require(_0x14a5('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0x14a5('0x12'))['db'];config[_0x14a5('0x13')]=_[_0x14a5('0x14')](config[_0x14a5('0x13')],{'host':_0x14a5('0x15'),'port':0x18eb});var socket=require(_0x14a5('0x16'))(new Redis(config[_0x14a5('0x13')]));require(_0x14a5('0x17'))[_0x14a5('0x18')](socket);function respondWithStatusCode(_0x261b84,_0x40cf3d){_0x40cf3d=_0x40cf3d||0xcc;return function(_0x487725){if(_0x487725){return _0x261b84[_0x14a5('0x19')](_0x40cf3d);}return _0x261b84[_0x14a5('0x1a')](_0x40cf3d)[_0x14a5('0x1b')]();};}function respondWithResult(_0x24170b,_0x23362c){_0x23362c=_0x23362c||0xc8;return function(_0x48dd75){if(_0x48dd75){return _0x24170b[_0x14a5('0x1a')](_0x23362c)['json'](_0x48dd75);}};}function respondWithFilteredResult(_0x2f560c,_0x4da94a){return function(_0x58ffe3){if(_0x58ffe3){var _0x555ec4=typeof _0x4da94a['offset']===_0x14a5('0x1c')&&typeof _0x4da94a[_0x14a5('0x1d')]===_0x14a5('0x1c');var _0x1021c4=_0x58ffe3[_0x14a5('0x1e')];var _0x1ca29f=_0x555ec4?0x0:_0x4da94a[_0x14a5('0x1f')];var _0x5876db=_0x555ec4?_0x58ffe3[_0x14a5('0x1e')]:_0x4da94a['offset']+_0x4da94a['limit'];var _0x3d3893;if(_0x5876db>=_0x1021c4){_0x5876db=_0x1021c4;_0x3d3893=0xc8;}else{_0x3d3893=0xce;}_0x2f560c[_0x14a5('0x1a')](_0x3d3893);return _0x2f560c[_0x14a5('0x20')](_0x14a5('0x21'),_0x1ca29f+'-'+_0x5876db+'/'+_0x1021c4)[_0x14a5('0x22')](_0x58ffe3);}return null;};}function patchUpdates(_0x16f802){return function(_0x27ca24){try{jsonpatch['apply'](_0x27ca24,_0x16f802,!![]);}catch(_0x87efc3){return BPromise[_0x14a5('0x23')](_0x87efc3);}return _0x27ca24[_0x14a5('0x24')]();};}function saveUpdates(_0x2de3c1,_0x18991c){return function(_0x5edcb1){if(_0x5edcb1){return _0x5edcb1[_0x14a5('0x25')](_0x2de3c1)[_0x14a5('0x26')](function(_0x1c93a9){return _0x1c93a9;});}return null;};}function removeEntity(_0xd0eb89,_0x513a44){return function(_0xf1e129){if(_0xf1e129){return _0xf1e129[_0x14a5('0x27')]()[_0x14a5('0x26')](function(){var _0x46bf80=_0xf1e129[_0x14a5('0x28')]({'plain':!![]});var _0x4b9d54=_0x14a5('0x29');return db[_0x14a5('0x2a')][_0x14a5('0x27')]({'where':{'type':_0x4b9d54,'resourceId':_0x46bf80['id']}})[_0x14a5('0x26')](function(){return _0xf1e129;});})[_0x14a5('0x26')](function(){_0xd0eb89[_0x14a5('0x1a')](0xcc)[_0x14a5('0x1b')]();});}};}function handleEntityNotFound(_0x54227f,_0x59cc2d){return function(_0x2aba7d){if(!_0x2aba7d){_0x54227f['sendStatus'](0x194);}return _0x2aba7d;};}function handleError(_0x3d8817,_0x51e60d){_0x51e60d=_0x51e60d||0x1f4;return function(_0x19cc0f){logger[_0x14a5('0x2b')](_0x19cc0f[_0x14a5('0x2c')]);if(_0x19cc0f[_0x14a5('0x2d')]){delete _0x19cc0f[_0x14a5('0x2d')];}_0x3d8817['status'](_0x51e60d)[_0x14a5('0x2e')](_0x19cc0f);};}exports['index']=function(_0xcdb579,_0xe29f39){var _0x1bc8bb={},_0x58deda={},_0x58af25={'count':0x0,'rows':[]};var _0x206753=_[_0x14a5('0x2f')](db['SmsQueue'][_0x14a5('0x30')],function(_0x469ecb){return{'name':_0x469ecb['fieldName'],'type':_0x469ecb[_0x14a5('0x31')]['key']};});_0x58deda['model']=_[_0x14a5('0x2f')](_0x206753,_0x14a5('0x2d'));_0x58deda['query']=_[_0x14a5('0x32')](_0xcdb579['query']);_0x58deda[_0x14a5('0x33')]=_[_0x14a5('0x34')](_0x58deda[_0x14a5('0x35')],_0x58deda[_0x14a5('0x36')]);_0x1bc8bb[_0x14a5('0x37')]=_[_0x14a5('0x34')](_0x58deda[_0x14a5('0x35')],qs[_0x14a5('0x38')](_0xcdb579['query'][_0x14a5('0x38')]));_0x1bc8bb[_0x14a5('0x37')]=_0x1bc8bb[_0x14a5('0x37')][_0x14a5('0x39')]?_0x1bc8bb['attributes']:_0x58deda[_0x14a5('0x35')];if(!_0xcdb579[_0x14a5('0x36')][_0x14a5('0x3a')](_0x14a5('0x3b'))){_0x1bc8bb[_0x14a5('0x1d')]=qs[_0x14a5('0x1d')](_0xcdb579[_0x14a5('0x36')][_0x14a5('0x1d')]);_0x1bc8bb[_0x14a5('0x1f')]=qs[_0x14a5('0x1f')](_0xcdb579[_0x14a5('0x36')]['offset']);}_0x1bc8bb[_0x14a5('0x3c')]=qs['sort'](_0xcdb579['query'][_0x14a5('0x3d')]);_0x1bc8bb[_0x14a5('0x3e')]=qs['filters'](_[_0x14a5('0x3f')](_0xcdb579[_0x14a5('0x36')],_0x58deda[_0x14a5('0x33')]),_0x206753);if(_0xcdb579['query'][_0x14a5('0x40')]){_0x1bc8bb[_0x14a5('0x3e')]=_[_0x14a5('0x41')](_0x1bc8bb[_0x14a5('0x3e')],{'$or':_[_0x14a5('0x2f')](_0x206753,function(_0x2c8bd0){if(_0x2c8bd0[_0x14a5('0x31')]!=='VIRTUAL'){var _0x56fe3b={};_0x56fe3b[_0x2c8bd0['name']]={'$like':'%'+_0xcdb579[_0x14a5('0x36')]['filter']+'%'};return _0x56fe3b;}})});}_0x1bc8bb=_[_0x14a5('0x41')]({},_0x1bc8bb,_0xcdb579[_0x14a5('0x42')]);var _0x41e70e={'where':_0x1bc8bb['where']};return db['SmsQueue'][_0x14a5('0x1e')](_0x41e70e)[_0x14a5('0x26')](function(_0x50e974){_0x58af25[_0x14a5('0x1e')]=_0x50e974;if(_0xcdb579['query']['includeAll']){_0x1bc8bb[_0x14a5('0x43')]=[{'all':!![]}];}return db[_0x14a5('0x44')][_0x14a5('0x45')](_0x1bc8bb);})[_0x14a5('0x26')](function(_0x3fb681){_0x58af25[_0x14a5('0x46')]=_0x3fb681;return _0x58af25;})[_0x14a5('0x26')](respondWithFilteredResult(_0xe29f39,_0x1bc8bb))[_0x14a5('0x47')](handleError(_0xe29f39,null));};exports[_0x14a5('0x48')]=function(_0x5a84e5,_0x114716){var _0xd0128e={'raw':!![],'where':{'id':_0x5a84e5[_0x14a5('0x49')]['id']}},_0x29cdda={};_0x29cdda[_0x14a5('0x35')]=_['keys'](db[_0x14a5('0x44')][_0x14a5('0x30')]);_0x29cdda[_0x14a5('0x36')]=_[_0x14a5('0x32')](_0x5a84e5[_0x14a5('0x36')]);_0x29cdda['filters']=_[_0x14a5('0x34')](_0x29cdda[_0x14a5('0x35')],_0x29cdda[_0x14a5('0x36')]);_0xd0128e[_0x14a5('0x37')]=_[_0x14a5('0x34')](_0x29cdda[_0x14a5('0x35')],qs['fields'](_0x5a84e5['query'][_0x14a5('0x38')]));_0xd0128e[_0x14a5('0x37')]=_0xd0128e[_0x14a5('0x37')]['length']?_0xd0128e['attributes']:_0x29cdda[_0x14a5('0x35')];if(_0x5a84e5[_0x14a5('0x36')][_0x14a5('0x4a')]){_0xd0128e[_0x14a5('0x43')]=[{'all':!![]}];}_0xd0128e=_[_0x14a5('0x41')]({},_0xd0128e,_0x5a84e5['options']);return db['SmsQueue'][_0x14a5('0x4b')](_0xd0128e)[_0x14a5('0x26')](handleEntityNotFound(_0x114716,null))[_0x14a5('0x26')](respondWithResult(_0x114716,null))[_0x14a5('0x47')](handleError(_0x114716,null));};exports['create']=function(_0x417b36,_0x497fce){return db[_0x14a5('0x44')]['create'](_0x417b36[_0x14a5('0x4c')],{})[_0x14a5('0x26')](function(_0x111779){var _0x16b3d2=_0x417b36['user'][_0x14a5('0x28')]({'plain':!![]});if(!_0x16b3d2)throw new Error(_0x14a5('0x4d'));if(_0x16b3d2[_0x14a5('0x4e')]==='user'){var _0x175044=_0x111779[_0x14a5('0x28')]({'plain':!![]});var _0x442985=_0x14a5('0x29');return db[_0x14a5('0x4f')][_0x14a5('0x4b')]({'where':{'name':_0x442985,'userProfileId':_0x16b3d2[_0x14a5('0x50')]},'raw':!![]})[_0x14a5('0x26')](function(_0x1fdc4d){if(_0x1fdc4d&&_0x1fdc4d['autoAssociation']===0x0){return db[_0x14a5('0x2a')][_0x14a5('0x51')]({'name':_0x175044[_0x14a5('0x2d')],'resourceId':_0x175044['id'],'type':_0x1fdc4d['name'],'sectionId':_0x1fdc4d['id']},{})[_0x14a5('0x26')](function(){return _0x111779;});}else{return _0x111779;}})[_0x14a5('0x47')](function(_0x2de876){logger[_0x14a5('0x2b')](_0x14a5('0x52'),_0x2de876);throw _0x2de876;});}return _0x111779;})['then'](respondWithResult(_0x497fce,0xc9))['catch'](handleError(_0x497fce,null));};exports[_0x14a5('0x25')]=function(_0x18e243,_0x36df4f){if(_0x18e243[_0x14a5('0x4c')]['id']){delete _0x18e243['body']['id'];}return db[_0x14a5('0x44')][_0x14a5('0x4b')]({'where':{'id':_0x18e243[_0x14a5('0x49')]['id']}})[_0x14a5('0x26')](handleEntityNotFound(_0x36df4f,null))[_0x14a5('0x26')](saveUpdates(_0x18e243[_0x14a5('0x4c')],null))[_0x14a5('0x26')](respondWithResult(_0x36df4f,null))[_0x14a5('0x47')](handleError(_0x36df4f,null));};exports[_0x14a5('0x27')]=function(_0x48b524,_0x57bd49){return db[_0x14a5('0x44')]['find']({'where':{'id':_0x48b524['params']['id']}})[_0x14a5('0x26')](handleEntityNotFound(_0x57bd49,null))[_0x14a5('0x26')](removeEntity(_0x57bd49,null))['catch'](handleError(_0x57bd49,null));};exports['describe']=function(_0x14ad6c,_0x299dd3){return db['SmsQueue'][_0x14a5('0x53')]()[_0x14a5('0x26')](respondWithResult(_0x299dd3,null))['catch'](handleError(_0x299dd3,null));};exports[_0x14a5('0x54')]=function(_0x5ad273,_0x34c8c1,_0x393b4d){var _0x4694a1={'raw':!![],'where':{}},_0x22f66f={},_0x49772a;return db[_0x14a5('0x44')][_0x14a5('0x55')]({'where':{'id':_0x5ad273[_0x14a5('0x49')]['id']}})['then'](handleEntityNotFound(_0x34c8c1,null))[_0x14a5('0x26')](function(_0x205426){if(_0x205426){_0x49772a=_0x205426[_0x14a5('0x28')]({'plain':!![]});_0x22f66f[_0x14a5('0x35')]=_[_0x14a5('0x32')](db[_0x14a5('0x56')]['rawAttributes']);_0x22f66f['query']=_[_0x14a5('0x32')](_0x5ad273[_0x14a5('0x36')]);_0x22f66f[_0x14a5('0x33')]=_[_0x14a5('0x34')](_0x22f66f[_0x14a5('0x35')],_0x22f66f[_0x14a5('0x36')]);_0x4694a1['attributes']=_[_0x14a5('0x34')](_0x22f66f[_0x14a5('0x35')],qs[_0x14a5('0x38')](_0x5ad273['query'][_0x14a5('0x38')]));_0x4694a1[_0x14a5('0x37')]=_0x4694a1['attributes'][_0x14a5('0x39')]?_0x4694a1[_0x14a5('0x37')]:_0x22f66f[_0x14a5('0x35')];if(!_0x5ad273['query'][_0x14a5('0x3a')]('nolimit')){_0x4694a1[_0x14a5('0x1d')]=qs[_0x14a5('0x1d')](_0x5ad273['query'][_0x14a5('0x1d')]);_0x4694a1[_0x14a5('0x1f')]=qs[_0x14a5('0x1f')](_0x5ad273[_0x14a5('0x36')]['offset']);}_0x4694a1[_0x14a5('0x3c')]=qs[_0x14a5('0x3d')](_0x5ad273[_0x14a5('0x36')][_0x14a5('0x3d')]);_0x4694a1[_0x14a5('0x3e')]=qs[_0x14a5('0x33')](_[_0x14a5('0x3f')](_0x5ad273[_0x14a5('0x36')],_0x22f66f[_0x14a5('0x33')]));_0x4694a1[_0x14a5('0x3e')][_0x14a5('0x57')]=_0x205426['id'];if(_0x5ad273[_0x14a5('0x36')][_0x14a5('0x40')]){_0x4694a1[_0x14a5('0x3e')]=_[_0x14a5('0x41')](_0x4694a1[_0x14a5('0x3e')],{'$or':_[_0x14a5('0x2f')](_0x4694a1[_0x14a5('0x37')],function(_0x103690){var _0x257719={};_0x257719[_0x103690]={'$like':'%'+_0x5ad273[_0x14a5('0x36')]['filter']+'%'};return _0x257719;})});}_0x4694a1=_[_0x14a5('0x41')]({},_0x4694a1,_0x5ad273[_0x14a5('0x42')]);return db[_0x14a5('0x56')][_0x14a5('0x45')](_0x4694a1);}})[_0x14a5('0x26')](function(_0x5b75b0){if(_0x5b75b0){return db['User'][_0x14a5('0x58')]({'where':{'id':_[_0x14a5('0x2f')](_0x5b75b0,_0x14a5('0x59')),'role':_0x14a5('0x5a')},'attributes':['id',_0x14a5('0x2d'),_0x14a5('0x5b'),_0x14a5('0x5c'),_0x14a5('0x5d')]});}})['then'](function(_0x25bf23){if(_0x25bf23){return{'count':_0x25bf23['count'],'rows':_[_0x14a5('0x2f')](_0x25bf23['rows'],function(_0x4451ca){return{'membername':_0x4451ca[_0x14a5('0x2d')],'UserId':_0x4451ca['id'],'queue_name':_0x49772a[_0x14a5('0x2d')],'SmsQueueId':_0x49772a['id'],'interface':util['format'](_0x14a5('0x5e'),'SIP',_0x4451ca[_0x14a5('0x2d')]),'penalty':0x0,'paused':_0x4451ca['smsPause'],'createdAt':_0x4451ca[_0x14a5('0x5d')],'updatedAt':_0x4451ca['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x34c8c1,_0x4694a1))[_0x14a5('0x47')](handleError(_0x34c8c1,null));};exports[_0x14a5('0x5f')]=function(_0x5e86ce,_0x313c0f,_0x46187a){var _0x220bfb={};var _0x238c8e={};var _0x220d65;var _0x4d5b97;return db['SmsQueue']['findOne']({'where':{'id':_0x5e86ce[_0x14a5('0x49')]['id']}})[_0x14a5('0x26')](handleEntityNotFound(_0x313c0f,null))[_0x14a5('0x26')](function(_0x41c161){if(_0x41c161){_0x220d65=_0x41c161;_0x238c8e[_0x14a5('0x35')]=_[_0x14a5('0x32')](db[_0x14a5('0x60')][_0x14a5('0x30')]);_0x238c8e[_0x14a5('0x36')]=_['keys'](_0x5e86ce[_0x14a5('0x36')]);_0x238c8e['filters']=_[_0x14a5('0x34')](_0x238c8e[_0x14a5('0x35')],_0x238c8e[_0x14a5('0x36')]);_0x220bfb[_0x14a5('0x37')]=_['intersection'](_0x238c8e[_0x14a5('0x35')],qs[_0x14a5('0x38')](_0x5e86ce[_0x14a5('0x36')][_0x14a5('0x38')]));_0x220bfb[_0x14a5('0x37')]=_0x220bfb[_0x14a5('0x37')][_0x14a5('0x39')]?_0x220bfb[_0x14a5('0x37')]:_0x238c8e['model'];_0x220bfb[_0x14a5('0x3c')]=qs['sort'](_0x5e86ce['query'][_0x14a5('0x3d')]);_0x220bfb['where']=qs[_0x14a5('0x33')](_[_0x14a5('0x3f')](_0x5e86ce[_0x14a5('0x36')],_0x238c8e[_0x14a5('0x33')]));if(_0x5e86ce[_0x14a5('0x36')][_0x14a5('0x40')]){_0x220bfb['where']=_[_0x14a5('0x41')](_0x220bfb[_0x14a5('0x3e')],{'$or':_[_0x14a5('0x2f')](_0x220bfb['attributes'],function(_0x2292c7){var _0x11e980={};_0x11e980[_0x2292c7]={'$like':'%'+_0x5e86ce['query']['filter']+'%'};return _0x11e980;})});}_0x220bfb=_[_0x14a5('0x41')]({},_0x220bfb,_0x5e86ce[_0x14a5('0x42')]);return _0x220d65[_0x14a5('0x5f')](_0x220bfb);}})[_0x14a5('0x26')](function(_0x6a9f03){if(_0x6a9f03){_0x4d5b97=_0x6a9f03['length'];if(!_0x5e86ce[_0x14a5('0x36')][_0x14a5('0x3a')]('nolimit')){_0x220bfb[_0x14a5('0x1d')]=qs[_0x14a5('0x1d')](_0x5e86ce[_0x14a5('0x36')][_0x14a5('0x1d')]);_0x220bfb['offset']=qs[_0x14a5('0x1f')](_0x5e86ce[_0x14a5('0x36')]['offset']);}return _0x220d65[_0x14a5('0x5f')](_0x220bfb);}})[_0x14a5('0x26')](function(_0x33d63e){if(_0x33d63e){return _0x33d63e?{'count':_0x4d5b97,'rows':_0x33d63e}:null;}})[_0x14a5('0x26')](respondWithResult(_0x313c0f,null))[_0x14a5('0x47')](handleError(_0x313c0f,null));};exports[_0x14a5('0x61')]=function(_0x5bb13e,_0x1d8d96,_0x4efb3a){var _0x2c0089=_0x5bb13e[_0x14a5('0x4c')][_0x14a5('0x62')];return db[_0x14a5('0x60')]['findAll']({'where':{'id':_0x2c0089},'attributes':['id'],'include':[{'model':db['User'],'as':_0x14a5('0x63'),'attributes':['id',_0x14a5('0x2d'),_0x14a5('0x64'),'voicePause',_0x14a5('0x65')],'raw':!![]}]})[_0x14a5('0x26')](function(_0x5d05bf){if(_0x5d05bf){var _0x460cb4=_[_0x14a5('0x66')](_0x5d05bf,function(_0x5bf3cc){var _0x300df0=_0x5bf3cc['get']({'plain':!![]});return _0x300df0[_0x14a5('0x63')];});return db[_0x14a5('0x44')]['find']({'where':{'id':_0x5bb13e['params']['id']}})[_0x14a5('0x26')](function(_0x1f9dcc){return db[_0x14a5('0x67')]['transaction'](function(_0x553d09){return _0x1f9dcc[_0x14a5('0x61')](_0x2c0089,{'transaction':_0x553d09})['then'](function(){return BPromise['each'](_0x460cb4,function(_0x29cce4){return db[_0x14a5('0x56')][_0x14a5('0x68')]({'where':{'UserId':_0x29cce4['id'],'SmsQueueId':_0x5bb13e[_0x14a5('0x49')]['id']},'transaction':_0x553d09});});})[_0x14a5('0x26')](function(){_0x460cb4[_0x14a5('0x69')](function(_0x276591){socket[_0x14a5('0x6a')](_0x14a5('0x6b'),{'UserId':_0x276591['id'],'SmsQueueId':_0x1f9dcc['id']});});});});});}})[_0x14a5('0x26')](respondWithStatusCode(_0x1d8d96,null))[_0x14a5('0x47')](handleError(_0x1d8d96,null));};exports[_0x14a5('0x6c')]=function(_0x8093d2,_0x13c301,_0x17a537){return db[_0x14a5('0x60')][_0x14a5('0x45')]({'where':{'id':_0x8093d2[_0x14a5('0x36')][_0x14a5('0x62')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x14a5('0x63'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x13c301,null))[_0x14a5('0x26')](function(_0x264798){var _0x4136fd=_['map'](_0x264798,'id');var _0x296e7b=[];var _0x1990da=[];var _0x1899fd=squel['select']();_0x1899fd['field'](_0x14a5('0x6d'))[_0x14a5('0x6e')](_0x14a5('0x6f'),'tq')[_0x14a5('0x70')](_0x14a5('0x71'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x14a5('0x3e')](_0x14a5('0x72'),_0x8093d2[_0x14a5('0x49')]['id']);for(var _0x40dbbc=0x0;_0x40dbbc<_0x264798[_0x14a5('0x39')];_0x40dbbc+=0x1){let _0xb1d105=_0x264798[_0x40dbbc];for(var _0x58e061=0x0;_0x58e061<_0xb1d105[_0x14a5('0x63')][_0x14a5('0x39')];_0x58e061+=0x1){let _0x264399=_0xb1d105[_0x14a5('0x63')][_0x58e061];var _0x6f81af=_0x1899fd[_0x14a5('0x73')]();_0x6f81af['where'](_0x14a5('0x74'),_0x264399['id']);_0x1990da[_0x14a5('0x75')](db[_0x14a5('0x67')]['query'](_0x6f81af['toString'](),{'type':db['sequelize'][_0x14a5('0x76')]['SELECT']})[_0x14a5('0x26')](function(_0x4f75b2){if(_0x4f75b2[_0x14a5('0x39')]===0x1){return _0x264399['id'];}else{var _0x15d83b=_[_0x14a5('0x77')](_['map'](_0x4f75b2,_0x14a5('0x78')),function(_0x555f09){return _[_0x14a5('0x79')](_0x4136fd,_0x555f09);});if(_0x15d83b){return _0x264399['id'];}}}));}}return BPromise[_0x14a5('0x7a')](_0x1990da)[_0x14a5('0x26')](function(_0x29f728){_0x296e7b=_(_0x296e7b)['union'](_0x29f728)['compact']()['value']();return db['SmsQueue']['find']({'where':{'id':_0x8093d2[_0x14a5('0x49')]['id']}})['then'](function(_0x20ee6d){return db[_0x14a5('0x67')][_0x14a5('0x7b')](function(_0x215c31){return _0x20ee6d[_0x14a5('0x6c')](_0x8093d2[_0x14a5('0x36')][_0x14a5('0x62')],{'transaction':_0x215c31})['then'](function(){if(!_[_0x14a5('0x7c')](_0x296e7b)){return _0x20ee6d['removeAgents'](_0x296e7b,{'transaction':_0x215c31});}})[_0x14a5('0x26')](function(){_0x296e7b[_0x14a5('0x69')](function(_0x560c8c){socket['emit'](_0x14a5('0x7d'),{'UserId':_0x560c8c,'SmsQueueId':_0x20ee6d['id']});});});});});});})[_0x14a5('0x26')](respondWithStatusCode(_0x13c301,null))[_0x14a5('0x47')](handleError(_0x13c301,null));};exports[_0x14a5('0x7e')]=function(_0x4d9cb2,_0x4cb00e,_0x4de4f3){return db[_0x14a5('0x44')][_0x14a5('0x4b')]({'where':{'id':_0x4d9cb2[_0x14a5('0x49')]['id']}})[_0x14a5('0x26')](handleEntityNotFound(_0x4cb00e,null))[_0x14a5('0x26')](function(_0x1f6cdf){if(_0x1f6cdf){return _0x1f6cdf['addAgents'](_0x4d9cb2[_0x14a5('0x4c')][_0x14a5('0x62')],_[_0x14a5('0x7f')](_0x4d9cb2['body'],['ids','id'])||{})[_0x14a5('0x80')](function(_0x31c233){for(var _0x49fe56=0x0;_0x49fe56<_0x4d9cb2[_0x14a5('0x4c')]['ids'][_0x14a5('0x39')];_0x49fe56+=0x1){socket['emit']('userSmsQueue:save',{'UserId':Number(_0x4d9cb2['body'][_0x14a5('0x62')][_0x49fe56]),'SmsQueueId':Number(_0x4d9cb2['params']['id'])});}return _0x31c233;});}})[_0x14a5('0x26')](respondWithResult(_0x4cb00e,null))[_0x14a5('0x47')](handleError(_0x4cb00e,null));};exports[_0x14a5('0x81')]=function(_0x43d22d,_0x2e6974,_0xe5a647){return db[_0x14a5('0x44')][_0x14a5('0x4b')]({'where':{'id':_0x43d22d[_0x14a5('0x49')]['id']}})['then'](handleEntityNotFound(_0x2e6974,null))[_0x14a5('0x26')](function(_0x5a04ae){if(_0x5a04ae){return _0x5a04ae['removeAgents'](_0x43d22d[_0x14a5('0x36')][_0x14a5('0x62')])['then'](function(){if(_[_0x14a5('0x82')](_0x43d22d[_0x14a5('0x36')][_0x14a5('0x62')])){for(var _0x4f5297=0x0;_0x4f5297<_0x43d22d[_0x14a5('0x36')][_0x14a5('0x62')][_0x14a5('0x39')];_0x4f5297+=0x1){socket[_0x14a5('0x6a')](_0x14a5('0x7d'),{'UserId':Number(_0x43d22d[_0x14a5('0x36')][_0x14a5('0x62')][_0x4f5297]),'SmsQueueId':Number(_0x43d22d[_0x14a5('0x49')]['id'])});}}else{socket[_0x14a5('0x6a')](_0x14a5('0x7d'),{'UserId':Number(_0x43d22d[_0x14a5('0x36')]['ids']),'SmsQueueId':Number(_0x43d22d[_0x14a5('0x49')]['id'])});}});}})[_0x14a5('0x26')](respondWithStatusCode(_0x2e6974,null))['catch'](handleError(_0x2e6974,null));};exports[_0x14a5('0x83')]=function(_0xf25992,_0x160371,_0x4bfe1f){var _0x2edd37={};var _0x41482c={};var _0x3dc401;var _0x106c5f;return db[_0x14a5('0x44')][_0x14a5('0x55')]({'where':{'id':_0xf25992[_0x14a5('0x49')]['id']}})['then'](handleEntityNotFound(_0x160371,null))['then'](function(_0x31d927){if(_0x31d927){_0x3dc401=_0x31d927;_0x41482c[_0x14a5('0x35')]=_[_0x14a5('0x32')](db[_0x14a5('0x84')][_0x14a5('0x30')]);_0x41482c['query']=_[_0x14a5('0x32')](_0xf25992[_0x14a5('0x36')]);_0x41482c[_0x14a5('0x33')]=_[_0x14a5('0x34')](_0x41482c['model'],_0x41482c['query']);_0x2edd37[_0x14a5('0x37')]=_[_0x14a5('0x34')](_0x41482c[_0x14a5('0x35')],qs['fields'](_0xf25992[_0x14a5('0x36')][_0x14a5('0x38')]));_0x2edd37[_0x14a5('0x37')]=_0x2edd37[_0x14a5('0x37')][_0x14a5('0x39')]?_0x2edd37['attributes']:_0x41482c['model'];_0x2edd37[_0x14a5('0x3c')]=qs[_0x14a5('0x3d')](_0xf25992[_0x14a5('0x36')][_0x14a5('0x3d')]);_0x2edd37[_0x14a5('0x3e')]=qs['filters'](_[_0x14a5('0x3f')](_0xf25992[_0x14a5('0x36')],_0x41482c[_0x14a5('0x33')]));if(_0xf25992[_0x14a5('0x36')][_0x14a5('0x40')]){_0x2edd37[_0x14a5('0x3e')]=_[_0x14a5('0x41')](_0x2edd37['where'],{'$or':_[_0x14a5('0x2f')](_0x2edd37[_0x14a5('0x37')],function(_0x58d607){var _0x5507b7={};_0x5507b7[_0x58d607]={'$like':'%'+_0xf25992['query'][_0x14a5('0x40')]+'%'};return _0x5507b7;})});}_0x2edd37=_[_0x14a5('0x41')]({},_0x2edd37,_0xf25992[_0x14a5('0x42')]);return _0x3dc401[_0x14a5('0x83')](_0x2edd37);}})[_0x14a5('0x26')](function(_0x14945c){if(_0x14945c){_0x106c5f=_0x14945c[_0x14a5('0x39')];if(!_0xf25992[_0x14a5('0x36')][_0x14a5('0x3a')]('nolimit')){_0x2edd37[_0x14a5('0x1d')]=qs['limit'](_0xf25992['query'][_0x14a5('0x1d')]);_0x2edd37[_0x14a5('0x1f')]=qs[_0x14a5('0x1f')](_0xf25992['query'][_0x14a5('0x1f')]);}return _0x3dc401[_0x14a5('0x83')](_0x2edd37);}})[_0x14a5('0x26')](function(_0x315c57){if(_0x315c57){return _0x315c57?{'count':_0x106c5f,'rows':_0x315c57}:null;}})[_0x14a5('0x26')](respondWithResult(_0x160371,null))[_0x14a5('0x47')](handleError(_0x160371,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 1d859fc..fa54903 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 _0x93f0=['setMaxListeners','save','update','remove','emit','events','../../mysqldb'];(function(_0x7ae402,_0x1a9e8a){var _0x3c8f2a=function(_0x2aa4ec){while(--_0x2aa4ec){_0x7ae402['push'](_0x7ae402['shift']());}};_0x3c8f2a(++_0x1a9e8a);}(_0x93f0,0x1a9));var _0x093f=function(_0x30ffc5,_0x1bce32){_0x30ffc5=_0x30ffc5-0x0;var _0x2602f3=_0x93f0[_0x30ffc5];return _0x2602f3;};'use strict';var EventEmitter=require(_0x093f('0x0'));var SmsQueue=require(_0x093f('0x1'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x093f('0x2')](0x0);var events={'afterCreate':_0x093f('0x3'),'afterUpdate':_0x093f('0x4'),'afterDestroy':_0x093f('0x5')};function emitEvent(_0x3879f9){return function(_0xb25d2e,_0x556bfe,_0x508f48){SmsQueueEvents[_0x093f('0x6')](_0x3879f9+':'+_0xb25d2e['id'],_0xb25d2e);SmsQueueEvents[_0x093f('0x6')](_0x3879f9,_0xb25d2e);_0x508f48(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file +var _0x6b5f=['hook','events','../../mysqldb','setMaxListeners','save','emit','hasOwnProperty'];(function(_0x4404ff,_0x13d7a9){var _0x5e7b19=function(_0x13847a){while(--_0x13847a){_0x4404ff['push'](_0x4404ff['shift']());}};_0x5e7b19(++_0x13d7a9);}(_0x6b5f,0x119));var _0xf6b5=function(_0xf5e774,_0xaa7ffa){_0xf5e774=_0xf5e774-0x0;var _0x25977c=_0x6b5f[_0xf5e774];return _0x25977c;};'use strict';var EventEmitter=require(_0xf6b5('0x0'));var SmsQueue=require(_0xf6b5('0x1'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xf6b5('0x2')](0x0);var events={'afterCreate':_0xf6b5('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xba9e3){return function(_0x25d29e,_0x353fd3,_0x3d5ee8){SmsQueueEvents['emit'](_0xba9e3+':'+_0x25d29e['id'],_0x25d29e);SmsQueueEvents[_0xf6b5('0x4')](_0xba9e3,_0x25d29e);_0x3d5ee8(null);};}for(var e in events){if(events[_0xf6b5('0x5')](e)){var event=events[e];SmsQueue[_0xf6b5('0x6')](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 49b7e87..34e3065 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 _0x7670=['lodash','../../config/logger','api','request-promise','path','rimraf','../../config/environment','define','SmsQueue','sms_queues'];(function(_0x2dec5b,_0x50fb60){var _0x15a2be=function(_0x1d7c3c){while(--_0x1d7c3c){_0x2dec5b['push'](_0x2dec5b['shift']());}};_0x15a2be(++_0x50fb60);}(_0x7670,0x15e));var _0x0767=function(_0x22f72b,_0x3082dd){_0x22f72b=_0x22f72b-0x0;var _0x3cbf1c=_0x7670[_0x22f72b];return _0x3cbf1c;};'use strict';var _=require(_0x0767('0x0'));var util=require('util');var logger=require(_0x0767('0x1'))(_0x0767('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0767('0x3'));var fs=require('fs');var path=require(_0x0767('0x4'));var rimraf=require(_0x0767('0x5'));var config=require(_0x0767('0x6'));var attributes=require('./smsQueue.attributes');module['exports']=function(_0x374580,_0x165bb2){return _0x374580[_0x0767('0x7')](_0x0767('0x8'),attributes,{'tableName':_0x0767('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7758=['request-promise','path','rimraf','../../config/environment','./smsQueue.attributes','exports','define','SmsQueue','util','../../config/logger','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7758,0x1e8));var _0x8775=function(_0x21b9f8,_0x5ab04e){_0x21b9f8=_0x21b9f8-0x0;var _0x3e5348=_0x7758[_0x21b9f8];return _0x3e5348;};'use strict';var _=require('lodash');var util=require(_0x8775('0x0'));var logger=require(_0x8775('0x1'))('api');var moment=require(_0x8775('0x2'));var BPromise=require(_0x8775('0x3'));var rp=require(_0x8775('0x4'));var fs=require('fs');var path=require(_0x8775('0x5'));var rimraf=require(_0x8775('0x6'));var config=require(_0x8775('0x7'));var attributes=require(_0x8775('0x8'));module[_0x8775('0x9')]=function(_0x4dd171,_0x2d12af){return _0x4dd171[_0x8775('0xa')](_0x8775('0xb'),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 6568761..731b5f8 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 _0xd9bd=['./smsQueue.socket','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetSmsQueue','SmsQueue','options','where','attributes','include','map','model','catch','ShowSmsQueue','raw','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x161f4e,_0x47f6b5){var _0x2d7fab=function(_0x16fc00){while(--_0x16fc00){_0x161f4e['push'](_0x161f4e['shift']());}};_0x2d7fab(++_0x47f6b5);}(_0xd9bd,0x16a));var _0xdd9b=function(_0x4ce020,_0x31c10c){_0x4ce020=_0x4ce020-0x0;var _0xbbd107=_0xd9bd[_0x4ce020];return _0xbbd107;};'use strict';var _=require(_0xdd9b('0x0'));var util=require('util');var moment=require(_0xdd9b('0x1'));var BPromise=require(_0xdd9b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdd9b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xdd9b('0x4'));var logger=require(_0xdd9b('0x5'))(_0xdd9b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xdd9b('0x7')]({'port':0x232a});config[_0xdd9b('0x8')]=_[_0xdd9b('0x9')](config[_0xdd9b('0x8')],{'host':_0xdd9b('0xa'),'port':0x18eb});var socket=require(_0xdd9b('0xb'))(new Redis(config[_0xdd9b('0x8')]));require(_0xdd9b('0xc'))['register'](socket);function respondWithRpcPromise(_0xa0ae63,_0x297f65,_0x48694b){return new BPromise(function(_0x6a6574,_0xe6db4c){return client[_0xdd9b('0xd')](_0xa0ae63,_0x48694b)[_0xdd9b('0xe')](function(_0x2c847b){logger[_0xdd9b('0xf')](_0xdd9b('0x10'),_0x297f65,_0xdd9b('0x11'));logger['debug'](_0xdd9b('0x12'),_0x297f65,_0xdd9b('0x11'),JSON[_0xdd9b('0x13')](_0x2c847b));if(_0x2c847b[_0xdd9b('0x14')]){if(_0x2c847b[_0xdd9b('0x14')]['code']===0x1f4){logger[_0xdd9b('0x14')](_0xdd9b('0x10'),_0x297f65,_0x2c847b[_0xdd9b('0x14')]['message']);return _0xe6db4c(_0x2c847b[_0xdd9b('0x14')]['message']);}logger['error'](_0xdd9b('0x10'),_0x297f65,_0x2c847b[_0xdd9b('0x14')][_0xdd9b('0x15')]);return _0x6a6574(_0x2c847b['error']['message']);}else{logger[_0xdd9b('0xf')](_0xdd9b('0x10'),_0x297f65,_0xdd9b('0x11'));_0x6a6574(_0x2c847b[_0xdd9b('0x16')][_0xdd9b('0x15')]);}})['catch'](function(_0x104b4e){logger[_0xdd9b('0x14')]('SmsQueue,\x20%s,\x20%s',_0x297f65,_0x104b4e);_0xe6db4c(_0x104b4e);});});}exports[_0xdd9b('0x17')]=function(_0x270879){var _0x273e7e=this;return new Promise(function(_0xa802e7,_0x10da64){return db[_0xdd9b('0x18')]['findAll']({'raw':_0x270879[_0xdd9b('0x19')]?_0x270879[_0xdd9b('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x270879[_0xdd9b('0x19')]?_0x270879['options'][_0xdd9b('0x1a')]||null:null,'attributes':_0x270879['options']?_0x270879[_0xdd9b('0x19')][_0xdd9b('0x1b')]||null:null,'limit':_0x270879[_0xdd9b('0x19')]?_0x270879[_0xdd9b('0x19')]['limit']||null:null,'include':_0x270879[_0xdd9b('0x19')]?_0x270879[_0xdd9b('0x19')][_0xdd9b('0x1c')]?_[_0xdd9b('0x1d')](_0x270879[_0xdd9b('0x19')]['include'],function(_0x3cea54){return{'model':db[_0x3cea54[_0xdd9b('0x1e')]],'as':_0x3cea54['as'],'attributes':_0x3cea54[_0xdd9b('0x1b')],'include':_0x3cea54[_0xdd9b('0x1c')]?_[_0xdd9b('0x1d')](_0x3cea54[_0xdd9b('0x1c')],function(_0x427e3f){return{'model':db[_0x427e3f[_0xdd9b('0x1e')]],'as':_0x427e3f['as'],'attributes':_0x427e3f[_0xdd9b('0x1b')],'include':_0x427e3f[_0xdd9b('0x1c')]?_[_0xdd9b('0x1d')](_0x427e3f[_0xdd9b('0x1c')],function(_0x58090c){return{'model':db[_0x58090c[_0xdd9b('0x1e')]],'as':_0x58090c['as'],'attributes':_0x58090c[_0xdd9b('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xdd9b('0xe')](function(_0x172dd7){logger[_0xdd9b('0xf')]('GetSmsQueue',_0x270879);logger['debug'](_0xdd9b('0x17'),_0x270879,JSON['stringify'](_0x172dd7));_0xa802e7(_0x172dd7);})[_0xdd9b('0x1f')](function(_0x329eb3){logger[_0xdd9b('0x14')]('GetSmsQueue',_0x329eb3['message'],_0x270879);_0x10da64(_0x273e7e[_0xdd9b('0x14')](0x1f4,_0x329eb3[_0xdd9b('0x15')]));});});};exports[_0xdd9b('0x20')]=function(_0x22cfd4){var _0x58fd7d=this;return new Promise(function(_0x483422,_0x5a3a4c){return db['SmsQueue']['find']({'raw':_0x22cfd4[_0xdd9b('0x19')]?_0x22cfd4[_0xdd9b('0x19')][_0xdd9b('0x21')]===undefined?!![]:![]:!![],'where':_0x22cfd4['options']?_0x22cfd4['options'][_0xdd9b('0x1a')]||null:null,'attributes':_0x22cfd4[_0xdd9b('0x19')]?_0x22cfd4['options']['attributes']||null:null,'include':_0x22cfd4['options']?_0x22cfd4[_0xdd9b('0x19')]['include']?_[_0xdd9b('0x1d')](_0x22cfd4[_0xdd9b('0x19')]['include'],function(_0x1b6f5f){return{'model':db[_0x1b6f5f['model']],'as':_0x1b6f5f['as'],'attributes':_0x1b6f5f['attributes'],'include':_0x1b6f5f[_0xdd9b('0x1c')]?_[_0xdd9b('0x1d')](_0x1b6f5f[_0xdd9b('0x1c')],function(_0x3ec737){return{'model':db[_0x3ec737[_0xdd9b('0x1e')]],'as':_0x3ec737['as'],'attributes':_0x3ec737[_0xdd9b('0x1b')],'include':_0x3ec737[_0xdd9b('0x1c')]?_[_0xdd9b('0x1d')](_0x3ec737[_0xdd9b('0x1c')],function(_0x36d939){return{'model':db[_0x36d939['model']],'as':_0x36d939['as'],'attributes':_0x36d939['attributes']};}):[]};}):[]};}):[]:[]})[_0xdd9b('0xe')](function(_0x11e26c){logger[_0xdd9b('0xf')](_0xdd9b('0x20'),_0x22cfd4);logger['debug'](_0xdd9b('0x20'),_0x22cfd4,JSON[_0xdd9b('0x13')](_0x11e26c));_0x483422(_0x11e26c);})['catch'](function(_0xfacb7c){logger[_0xdd9b('0x14')](_0xdd9b('0x20'),_0xfacb7c['message'],_0x22cfd4);_0x5a3a4c(_0x58fd7d[_0xdd9b('0x14')](0x1f4,_0xfacb7c[_0xdd9b('0x15')]));});});}; \ No newline at end of file +var _0x0ee7=['catch','SmsQueue','findAll','options','raw','where','attributes','include','model','map','GetSmsQueue','ShowSmsQueue','find','lodash','moment','bluebird','ioredis','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then','request\x20sent','debug','stringify','error','SmsQueue,\x20%s,\x20%s','message','info','result'];(function(_0x7f1687,_0x564ac3){var _0xd2ed5b=function(_0x52c499){while(--_0x52c499){_0x7f1687['push'](_0x7f1687['shift']());}};_0xd2ed5b(++_0x564ac3);}(_0x0ee7,0xdf));var _0x70ee=function(_0x20fc31,_0x24d52b){_0x20fc31=_0x20fc31-0x0;var _0x11e2e3=_0x0ee7[_0x20fc31];return _0x11e2e3;};'use strict';var _=require(_0x70ee('0x0'));var util=require('util');var moment=require(_0x70ee('0x1'));var BPromise=require(_0x70ee('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x70ee('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x70ee('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x70ee('0x5'));var client=jayson[_0x70ee('0x6')][_0x70ee('0x7')]({'port':0x232a});config[_0x70ee('0x8')]=_[_0x70ee('0x9')](config['redis'],{'host':_0x70ee('0xa'),'port':0x18eb});var socket=require(_0x70ee('0xb'))(new Redis(config[_0x70ee('0x8')]));require('./smsQueue.socket')['register'](socket);function respondWithRpcPromise(_0x20d5b3,_0x5cdbb3,_0x15d305){return new BPromise(function(_0x5bd7e3,_0x1369e8){return client[_0x70ee('0xc')](_0x20d5b3,_0x15d305)[_0x70ee('0xd')](function(_0x2e91b2){logger['info']('SmsQueue,\x20%s,\x20%s',_0x5cdbb3,_0x70ee('0xe'));logger[_0x70ee('0xf')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x5cdbb3,_0x70ee('0xe'),JSON[_0x70ee('0x10')](_0x2e91b2));if(_0x2e91b2[_0x70ee('0x11')]){if(_0x2e91b2['error']['code']===0x1f4){logger['error'](_0x70ee('0x12'),_0x5cdbb3,_0x2e91b2[_0x70ee('0x11')]['message']);return _0x1369e8(_0x2e91b2['error']['message']);}logger[_0x70ee('0x11')](_0x70ee('0x12'),_0x5cdbb3,_0x2e91b2[_0x70ee('0x11')][_0x70ee('0x13')]);return _0x5bd7e3(_0x2e91b2['error'][_0x70ee('0x13')]);}else{logger[_0x70ee('0x14')](_0x70ee('0x12'),_0x5cdbb3,_0x70ee('0xe'));_0x5bd7e3(_0x2e91b2[_0x70ee('0x15')][_0x70ee('0x13')]);}})[_0x70ee('0x16')](function(_0x4a4565){logger['error'](_0x70ee('0x12'),_0x5cdbb3,_0x4a4565);_0x1369e8(_0x4a4565);});});}exports['GetSmsQueue']=function(_0x5e06c1){var _0xa4c4b7=this;return new Promise(function(_0x1a6f70,_0x54806b){return db[_0x70ee('0x17')][_0x70ee('0x18')]({'raw':_0x5e06c1[_0x70ee('0x19')]?_0x5e06c1[_0x70ee('0x19')][_0x70ee('0x1a')]===undefined?!![]:![]:!![],'where':_0x5e06c1[_0x70ee('0x19')]?_0x5e06c1[_0x70ee('0x19')][_0x70ee('0x1b')]||null:null,'attributes':_0x5e06c1[_0x70ee('0x19')]?_0x5e06c1[_0x70ee('0x19')][_0x70ee('0x1c')]||null:null,'limit':_0x5e06c1['options']?_0x5e06c1['options']['limit']||null:null,'include':_0x5e06c1[_0x70ee('0x19')]?_0x5e06c1[_0x70ee('0x19')][_0x70ee('0x1d')]?_['map'](_0x5e06c1[_0x70ee('0x19')][_0x70ee('0x1d')],function(_0x364eb4){return{'model':db[_0x364eb4[_0x70ee('0x1e')]],'as':_0x364eb4['as'],'attributes':_0x364eb4[_0x70ee('0x1c')],'include':_0x364eb4[_0x70ee('0x1d')]?_[_0x70ee('0x1f')](_0x364eb4[_0x70ee('0x1d')],function(_0x195306){return{'model':db[_0x195306[_0x70ee('0x1e')]],'as':_0x195306['as'],'attributes':_0x195306[_0x70ee('0x1c')],'include':_0x195306[_0x70ee('0x1d')]?_['map'](_0x195306[_0x70ee('0x1d')],function(_0x47deb3){return{'model':db[_0x47deb3[_0x70ee('0x1e')]],'as':_0x47deb3['as'],'attributes':_0x47deb3[_0x70ee('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x70ee('0xd')](function(_0x3910bc){logger['info'](_0x70ee('0x20'),_0x5e06c1);logger[_0x70ee('0xf')](_0x70ee('0x20'),_0x5e06c1,JSON['stringify'](_0x3910bc));_0x1a6f70(_0x3910bc);})[_0x70ee('0x16')](function(_0x221121){logger['error'](_0x70ee('0x20'),_0x221121[_0x70ee('0x13')],_0x5e06c1);_0x54806b(_0xa4c4b7[_0x70ee('0x11')](0x1f4,_0x221121['message']));});});};exports[_0x70ee('0x21')]=function(_0x53ba73){var _0x57c9b8=this;return new Promise(function(_0x4aa7e1,_0x447b56){return db['SmsQueue'][_0x70ee('0x22')]({'raw':_0x53ba73[_0x70ee('0x19')]?_0x53ba73[_0x70ee('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x53ba73[_0x70ee('0x19')]?_0x53ba73[_0x70ee('0x19')]['where']||null:null,'attributes':_0x53ba73[_0x70ee('0x19')]?_0x53ba73['options']['attributes']||null:null,'include':_0x53ba73[_0x70ee('0x19')]?_0x53ba73['options'][_0x70ee('0x1d')]?_[_0x70ee('0x1f')](_0x53ba73[_0x70ee('0x19')][_0x70ee('0x1d')],function(_0x2c34d1){return{'model':db[_0x2c34d1['model']],'as':_0x2c34d1['as'],'attributes':_0x2c34d1[_0x70ee('0x1c')],'include':_0x2c34d1[_0x70ee('0x1d')]?_['map'](_0x2c34d1[_0x70ee('0x1d')],function(_0x3b07d4){return{'model':db[_0x3b07d4['model']],'as':_0x3b07d4['as'],'attributes':_0x3b07d4[_0x70ee('0x1c')],'include':_0x3b07d4['include']?_[_0x70ee('0x1f')](_0x3b07d4[_0x70ee('0x1d')],function(_0x564c86){return{'model':db[_0x564c86[_0x70ee('0x1e')]],'as':_0x564c86['as'],'attributes':_0x564c86[_0x70ee('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x70ee('0xd')](function(_0x3e07a1){logger['info'](_0x70ee('0x21'),_0x53ba73);logger['debug']('ShowSmsQueue',_0x53ba73,JSON['stringify'](_0x3e07a1));_0x4aa7e1(_0x3e07a1);})['catch'](function(_0x37a98b){logger['error']('ShowSmsQueue',_0x37a98b[_0x70ee('0x13')],_0x53ba73);_0x447b56(_0x57c9b8['error'](0x1f4,_0x37a98b[_0x70ee('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 929cfb0..e3c37fb 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 _0xb6f1=['save','remove','removeListener','register','length','smsQueue:','./smsQueue.events'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0xb6f1,0x110));var _0x1b6f=function(_0x130705,_0x2d266b){_0x130705=_0x130705-0x0;var _0x1fa991=_0xb6f1[_0x130705];return _0x1fa991;};'use strict';var SmsQueueEvents=require(_0x1b6f('0x0'));var events=[_0x1b6f('0x1'),_0x1b6f('0x2'),'update'];function createListener(_0x22f557,_0x10670b){return function(_0x37bde4){_0x10670b['emit'](_0x22f557,_0x37bde4);};}function removeListener(_0x4d3081,_0x5c7976){return function(){SmsQueueEvents[_0x1b6f('0x3')](_0x4d3081,_0x5c7976);};}exports[_0x1b6f('0x4')]=function(_0x3c50c5){for(var _0x55f22e=0x0,_0x47051b=events[_0x1b6f('0x5')];_0x55f22e<_0x47051b;_0x55f22e++){var _0x889d89=events[_0x55f22e];var _0x2dba4b=createListener(_0x1b6f('0x6')+_0x889d89,_0x3c50c5);SmsQueueEvents['on'](_0x889d89,_0x2dba4b);}}; \ No newline at end of file +var _0x5939=['length','smsQueue:','save','emit','removeListener','register'];(function(_0x1779e7,_0x58208e){var _0x3f6fcc=function(_0x470f10){while(--_0x470f10){_0x1779e7['push'](_0x1779e7['shift']());}};_0x3f6fcc(++_0x58208e);}(_0x5939,0x14c));var _0x9593=function(_0x58fd82,_0x55d291){_0x58fd82=_0x58fd82-0x0;var _0x1d0778=_0x5939[_0x58fd82];return _0x1d0778;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0x9593('0x0'),'remove','update'];function createListener(_0x3a91c6,_0xbbb136){return function(_0x4c1d56){_0xbbb136[_0x9593('0x1')](_0x3a91c6,_0x4c1d56);};}function removeListener(_0x52a9d5,_0x2bfa6b){return function(){SmsQueueEvents[_0x9593('0x2')](_0x52a9d5,_0x2bfa6b);};}exports[_0x9593('0x3')]=function(_0x1fe206){for(var _0x183182=0x0,_0x396a07=events[_0x9593('0x4')];_0x183182<_0x396a07;_0x183182++){var _0x54220d=events[_0x183182];var _0xc0abee=createListener(_0x9593('0x5')+_0x54220d,_0x1fe206);SmsQueueEvents['on'](_0x54220d,_0xc0abee);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index c0af67a..67ce699 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 _0x5855=['exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','put','/:id','update','delete','destroy'];(function(_0x389abb,_0x241f9f){var _0x36d5b0=function(_0x64e396){while(--_0x64e396){_0x389abb['push'](_0x389abb['shift']());}};_0x36d5b0(++_0x241f9f);}(_0x5855,0xc9));var _0x5585=function(_0x2b70f8,_0x361789){_0x2b70f8=_0x2b70f8-0x0;var _0x2f741e=_0x5855[_0x2b70f8];return _0x2f741e;};'use strict';var multer=require(_0x5585('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5585('0x1'));var express=require(_0x5585('0x2'));var router=express[_0x5585('0x3')]();var fs_extra=require(_0x5585('0x4'));var auth=require(_0x5585('0x5'));var interaction=require(_0x5585('0x6'));var config=require(_0x5585('0x7'));var controller=require('./smsQueueReport.controller');router[_0x5585('0x8')]('/',auth[_0x5585('0x9')](),controller[_0x5585('0xa')]);router[_0x5585('0x8')](_0x5585('0xb'),auth[_0x5585('0x9')](),controller[_0x5585('0xc')]);router[_0x5585('0x8')]('/:id',auth[_0x5585('0x9')](),controller[_0x5585('0xd')]);router['post']('/',auth[_0x5585('0x9')](),controller['create']);router[_0x5585('0xe')](_0x5585('0xf'),auth['isAuthenticated'](),controller[_0x5585('0x10')]);router[_0x5585('0x11')]('/:id',auth[_0x5585('0x9')](),controller[_0x5585('0x12')]);module[_0x5585('0x13')]=router; \ No newline at end of file +var _0x3079=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','./smsQueueReport.controller','get','isAuthenticated','index','describe','/:id','post','create','update','delete','destroy'];(function(_0x4d5b4a,_0x381aaf){var _0x56e1f0=function(_0x34b870){while(--_0x34b870){_0x4d5b4a['push'](_0x4d5b4a['shift']());}};_0x56e1f0(++_0x381aaf);}(_0x3079,0x110));var _0x9307=function(_0xd3bcf8,_0x994fdb){_0xd3bcf8=_0xd3bcf8-0x0;var _0x296170=_0x3079[_0xd3bcf8];return _0x296170;};'use strict';var multer=require('multer');var util=require(_0x9307('0x0'));var path=require(_0x9307('0x1'));var timeout=require(_0x9307('0x2'));var express=require(_0x9307('0x3'));var router=express['Router']();var fs_extra=require(_0x9307('0x4'));var auth=require(_0x9307('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9307('0x6'));router[_0x9307('0x7')]('/',auth[_0x9307('0x8')](),controller[_0x9307('0x9')]);router[_0x9307('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x9307('0xa')]);router['get'](_0x9307('0xb'),auth[_0x9307('0x8')](),controller['show']);router[_0x9307('0xc')]('/',auth[_0x9307('0x8')](),controller[_0x9307('0xd')]);router['put']('/:id',auth[_0x9307('0x8')](),controller[_0x9307('0xe')]);router[_0x9307('0xf')](_0x9307('0xb'),auth[_0x9307('0x8')](),controller[_0x9307('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 060116a..4bbe42b 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 _0x48ce=['sequelize','STRING','DATE','moment'];(function(_0x34550c,_0x50ae5a){var _0x3d8fb8=function(_0x2fa06d){while(--_0x2fa06d){_0x34550c['push'](_0x34550c['shift']());}};_0x3d8fb8(++_0x50ae5a);}(_0x48ce,0x83));var _0xe48c=function(_0xd1dce6,_0x2de4c2){_0xd1dce6=_0xd1dce6-0x0;var _0x300871=_0x48ce[_0xd1dce6];return _0x300871;};'use strict';var moment=require(_0xe48c('0x0'));var Sequelize=require(_0xe48c('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xe48c('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xe48c('0x3')]},'leaveAt':{'type':Sequelize[_0xe48c('0x3')]},'acceptAt':{'type':Sequelize[_0xe48c('0x3')]},'exitAt':{'type':Sequelize[_0xe48c('0x3')]},'reason':{'type':Sequelize[_0xe48c('0x2')]}}; \ No newline at end of file +var _0x7479=['DATE','sequelize','exports','STRING'];(function(_0x24579a,_0x59612d){var _0x59dff7=function(_0x47c50f){while(--_0x47c50f){_0x24579a['push'](_0x24579a['shift']());}};_0x59dff7(++_0x59612d);}(_0x7479,0x18d));var _0x9747=function(_0x4dc853,_0x20a073){_0x4dc853=_0x4dc853-0x0;var _0x6c2842=_0x7479[_0x4dc853];return _0x6c2842;};'use strict';var moment=require('moment');var Sequelize=require(_0x9747('0x0'));module[_0x9747('0x1')]={'uniqueid':{'type':Sequelize[_0x9747('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x9747('0x3')]},'leaveAt':{'type':Sequelize[_0x9747('0x3')]},'acceptAt':{'type':Sequelize[_0x9747('0x3')]},'exitAt':{'type':Sequelize[_0x9747('0x3')]},'reason':{'type':Sequelize[_0x9747('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 7547001..3e4d513 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 _0x9b3a=['desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','SmsQueueReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','sort','where','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','keys','includeAll','find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','util','path','ejs','squel','crypto','jsforce'];(function(_0x89a220,_0x2fd418){var _0x9995b8=function(_0x1c467b){while(--_0x1c467b){_0x89a220['push'](_0x89a220['shift']());}};_0x9995b8(++_0x2fd418);}(_0x9b3a,0x163));var _0xa9b3=function(_0xbd05d4,_0x51e0da){_0xbd05d4=_0xbd05d4-0x0;var _0xba68bf=_0x9b3a[_0xbd05d4];return _0xba68bf;};'use strict';var emlformat=require(_0xa9b3('0x0'));var rimraf=require(_0xa9b3('0x1'));var zipdir=require(_0xa9b3('0x2'));var jsonpatch=require(_0xa9b3('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa9b3('0x4'));var path=require(_0xa9b3('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa9b3('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa9b3('0x7'));var crypto=require(_0xa9b3('0x8'));var jsforce=require(_0xa9b3('0x9'));var deskjs=require(_0xa9b3('0xa'));var toCsv=require(_0xa9b3('0xb'));var querystring=require(_0xa9b3('0xc'));var Papa=require(_0xa9b3('0xd'));var Redis=require(_0xa9b3('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xa9b3('0xf'));var as=require(_0xa9b3('0x10'));var hardwareService=require(_0xa9b3('0x11'));var logger=require(_0xa9b3('0x12'))(_0xa9b3('0x13'));var utils=require(_0xa9b3('0x14'));var config=require(_0xa9b3('0x15'));var licenseUtil=require(_0xa9b3('0x16'));var db=require(_0xa9b3('0x17'))['db'];function respondWithStatusCode(_0xd5cb8a,_0x92b1d2){_0x92b1d2=_0x92b1d2||0xcc;return function(_0x2dddfe){if(_0x2dddfe){return _0xd5cb8a[_0xa9b3('0x18')](_0x92b1d2);}return _0xd5cb8a[_0xa9b3('0x19')](_0x92b1d2)[_0xa9b3('0x1a')]();};}function respondWithResult(_0x998867,_0x32c64b){_0x32c64b=_0x32c64b||0xc8;return function(_0x5bb8e9){if(_0x5bb8e9){return _0x998867['status'](_0x32c64b)['json'](_0x5bb8e9);}};}function respondWithFilteredResult(_0x570d71,_0x9fe780){return function(_0x17289d){if(_0x17289d){var _0x38366e=typeof _0x9fe780['offset']===_0xa9b3('0x1b')&&typeof _0x9fe780[_0xa9b3('0x1c')]==='undefined';var _0x4dd622=_0x17289d['count'];var _0x20c79c=_0x38366e?0x0:_0x9fe780[_0xa9b3('0x1d')];var _0xbcb036=_0x38366e?_0x17289d[_0xa9b3('0x1e')]:_0x9fe780[_0xa9b3('0x1d')]+_0x9fe780['limit'];var _0x359b11;if(_0xbcb036>=_0x4dd622){_0xbcb036=_0x4dd622;_0x359b11=0xc8;}else{_0x359b11=0xce;}_0x570d71[_0xa9b3('0x19')](_0x359b11);return _0x570d71[_0xa9b3('0x1f')](_0xa9b3('0x20'),_0x20c79c+'-'+_0xbcb036+'/'+_0x4dd622)['json'](_0x17289d);}return null;};}function patchUpdates(_0x26f7e6){return function(_0x378415){try{jsonpatch[_0xa9b3('0x21')](_0x378415,_0x26f7e6,!![]);}catch(_0x50bc06){return BPromise[_0xa9b3('0x22')](_0x50bc06);}return _0x378415[_0xa9b3('0x23')]();};}function saveUpdates(_0x3b1748,_0x29eab3){return function(_0x3d467f){if(_0x3d467f){return _0x3d467f[_0xa9b3('0x24')](_0x3b1748)[_0xa9b3('0x25')](function(_0x572a09){return _0x572a09;});}return null;};}function removeEntity(_0x60760c,_0x59d827){return function(_0x33e3ba){if(_0x33e3ba){return _0x33e3ba[_0xa9b3('0x26')]()[_0xa9b3('0x25')](function(){_0x60760c[_0xa9b3('0x19')](0xcc)[_0xa9b3('0x1a')]();});}};}function handleEntityNotFound(_0x230fa1,_0x588c14){return function(_0x14bd4b){if(!_0x14bd4b){_0x230fa1[_0xa9b3('0x18')](0x194);}return _0x14bd4b;};}function handleError(_0x43518b,_0x343fd0){_0x343fd0=_0x343fd0||0x1f4;return function(_0x251964){logger['error'](_0x251964[_0xa9b3('0x27')]);if(_0x251964['name']){delete _0x251964[_0xa9b3('0x28')];}_0x43518b['status'](_0x343fd0)[_0xa9b3('0x29')](_0x251964);};}exports[_0xa9b3('0x2a')]=function(_0x19f32e,_0x18d725){var _0x548ac6={},_0x40bcb2={},_0x4f5790={'count':0x0,'rows':[]};var _0x2d0bff=_[_0xa9b3('0x2b')](db[_0xa9b3('0x2c')][_0xa9b3('0x2d')],function(_0x435fd1){return{'name':_0x435fd1[_0xa9b3('0x2e')],'type':_0x435fd1[_0xa9b3('0x2f')][_0xa9b3('0x30')]};});_0x40bcb2[_0xa9b3('0x31')]=_[_0xa9b3('0x2b')](_0x2d0bff,_0xa9b3('0x28'));_0x40bcb2[_0xa9b3('0x32')]=_['keys'](_0x19f32e[_0xa9b3('0x32')]);_0x40bcb2[_0xa9b3('0x33')]=_['intersection'](_0x40bcb2[_0xa9b3('0x31')],_0x40bcb2[_0xa9b3('0x32')]);_0x548ac6['attributes']=_[_0xa9b3('0x34')](_0x40bcb2[_0xa9b3('0x31')],qs[_0xa9b3('0x35')](_0x19f32e[_0xa9b3('0x32')][_0xa9b3('0x35')]));_0x548ac6[_0xa9b3('0x36')]=_0x548ac6[_0xa9b3('0x36')]['length']?_0x548ac6[_0xa9b3('0x36')]:_0x40bcb2['model'];if(!_0x19f32e[_0xa9b3('0x32')][_0xa9b3('0x37')]('nolimit')){_0x548ac6[_0xa9b3('0x1c')]=qs[_0xa9b3('0x1c')](_0x19f32e[_0xa9b3('0x32')][_0xa9b3('0x1c')]);_0x548ac6[_0xa9b3('0x1d')]=qs[_0xa9b3('0x1d')](_0x19f32e[_0xa9b3('0x32')][_0xa9b3('0x1d')]);}_0x548ac6['order']=qs[_0xa9b3('0x38')](_0x19f32e[_0xa9b3('0x32')][_0xa9b3('0x38')]);_0x548ac6['where']=qs['filters'](_['pick'](_0x19f32e[_0xa9b3('0x32')],_0x40bcb2[_0xa9b3('0x33')]),_0x2d0bff);if(_0x19f32e[_0xa9b3('0x32')]['filter']){_0x548ac6[_0xa9b3('0x39')]=_[_0xa9b3('0x3a')](_0x548ac6['where'],{'$or':_['map'](_0x2d0bff,function(_0x29775d){if(_0x29775d[_0xa9b3('0x2f')]!==_0xa9b3('0x3b')){var _0x4c1829={};_0x4c1829[_0x29775d[_0xa9b3('0x28')]]={'$like':'%'+_0x19f32e[_0xa9b3('0x32')][_0xa9b3('0x3c')]+'%'};return _0x4c1829;}})});}_0x548ac6=_[_0xa9b3('0x3a')]({},_0x548ac6,_0x19f32e[_0xa9b3('0x3d')]);var _0x519078={'where':_0x548ac6['where']};return db[_0xa9b3('0x2c')][_0xa9b3('0x1e')](_0x519078)[_0xa9b3('0x25')](function(_0x4e7819){_0x4f5790['count']=_0x4e7819;if(_0x19f32e['query']['includeAll']){_0x548ac6[_0xa9b3('0x3e')]=[{'all':!![]}];}return db[_0xa9b3('0x2c')][_0xa9b3('0x3f')](_0x548ac6);})[_0xa9b3('0x25')](function(_0x18d2b3){_0x4f5790[_0xa9b3('0x40')]=_0x18d2b3;return _0x4f5790;})['then'](respondWithFilteredResult(_0x18d725,_0x548ac6))[_0xa9b3('0x41')](handleError(_0x18d725,null));};exports[_0xa9b3('0x42')]=function(_0x99a8ca,_0x4c05af){var _0x5c1589={'raw':!![],'where':{'id':_0x99a8ca[_0xa9b3('0x43')]['id']}},_0x157dbd={};_0x157dbd[_0xa9b3('0x31')]=_[_0xa9b3('0x44')](db[_0xa9b3('0x2c')][_0xa9b3('0x2d')]);_0x157dbd[_0xa9b3('0x32')]=_[_0xa9b3('0x44')](_0x99a8ca[_0xa9b3('0x32')]);_0x157dbd['filters']=_[_0xa9b3('0x34')](_0x157dbd[_0xa9b3('0x31')],_0x157dbd['query']);_0x5c1589[_0xa9b3('0x36')]=_[_0xa9b3('0x34')](_0x157dbd[_0xa9b3('0x31')],qs[_0xa9b3('0x35')](_0x99a8ca[_0xa9b3('0x32')][_0xa9b3('0x35')]));_0x5c1589[_0xa9b3('0x36')]=_0x5c1589[_0xa9b3('0x36')]['length']?_0x5c1589[_0xa9b3('0x36')]:_0x157dbd[_0xa9b3('0x31')];if(_0x99a8ca[_0xa9b3('0x32')][_0xa9b3('0x45')]){_0x5c1589[_0xa9b3('0x3e')]=[{'all':!![]}];}_0x5c1589=_['merge']({},_0x5c1589,_0x99a8ca['options']);return db[_0xa9b3('0x2c')][_0xa9b3('0x46')](_0x5c1589)[_0xa9b3('0x25')](handleEntityNotFound(_0x4c05af,null))[_0xa9b3('0x25')](respondWithResult(_0x4c05af,null))['catch'](handleError(_0x4c05af,null));};exports['create']=function(_0x580f72,_0x273e20){return db['SmsQueueReport']['create'](_0x580f72[_0xa9b3('0x47')],{})[_0xa9b3('0x25')](respondWithResult(_0x273e20,0xc9))[_0xa9b3('0x41')](handleError(_0x273e20,null));};exports[_0xa9b3('0x24')]=function(_0xd62372,_0x59ca66){if(_0xd62372['body']['id']){delete _0xd62372[_0xa9b3('0x47')]['id'];}return db[_0xa9b3('0x2c')][_0xa9b3('0x46')]({'where':{'id':_0xd62372[_0xa9b3('0x43')]['id']}})[_0xa9b3('0x25')](handleEntityNotFound(_0x59ca66,null))['then'](saveUpdates(_0xd62372[_0xa9b3('0x47')],null))['then'](respondWithResult(_0x59ca66,null))[_0xa9b3('0x41')](handleError(_0x59ca66,null));};exports[_0xa9b3('0x26')]=function(_0x363279,_0x2ba7b1){return db['SmsQueueReport'][_0xa9b3('0x46')]({'where':{'id':_0x363279[_0xa9b3('0x43')]['id']}})[_0xa9b3('0x25')](handleEntityNotFound(_0x2ba7b1,null))[_0xa9b3('0x25')](removeEntity(_0x2ba7b1,null))['catch'](handleError(_0x2ba7b1,null));};exports[_0xa9b3('0x48')]=function(_0x51013e,_0x2ca880){return db['SmsQueueReport'][_0xa9b3('0x48')]()['then'](respondWithResult(_0x2ca880,null))[_0xa9b3('0x41')](handleError(_0x2ca880,null));}; \ No newline at end of file +var _0xba4d=['to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','update','then','destroy','sendStatus','error','stack','name','send','index','SmsQueueReport','rawAttributes','fieldName','type','key','map','query','keys','filters','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','intersection','find','catch','create','body','params','describe','eml-format','zip-dir','request-promise','moment','bluebird','util','path'];(function(_0x17784a,_0x42fe44){var _0x41aded=function(_0x2e7319){while(--_0x2e7319){_0x17784a['push'](_0x17784a['shift']());}};_0x41aded(++_0x42fe44);}(_0xba4d,0xdd));var _0xdba4=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xba4d[_0x2a6809];return _0x11c371;};'use strict';var emlformat=require(_0xdba4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdba4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdba4('0x2'));var moment=require(_0xdba4('0x3'));var BPromise=require(_0xdba4('0x4'));var Mustache=require('mustache');var util=require(_0xdba4('0x5'));var path=require(_0xdba4('0x6'));var sox=require('sox');var csv=require(_0xdba4('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdba4('0x8'));var _=require(_0xdba4('0x9'));var squel=require('squel');var crypto=require(_0xdba4('0xa'));var jsforce=require(_0xdba4('0xb'));var deskjs=require(_0xdba4('0xc'));var toCsv=require(_0xdba4('0x7'));var querystring=require(_0xdba4('0xd'));var Papa=require('papaparse');var Redis=require(_0xdba4('0xe'));var authService=require(_0xdba4('0xf'));var qs=require(_0xdba4('0x10'));var as=require(_0xdba4('0x11'));var hardwareService=require(_0xdba4('0x12'));var logger=require(_0xdba4('0x13'))(_0xdba4('0x14'));var utils=require(_0xdba4('0x15'));var config=require(_0xdba4('0x16'));var licenseUtil=require(_0xdba4('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3383d8,_0x34bd52){_0x34bd52=_0x34bd52||0xcc;return function(_0x406a4f){if(_0x406a4f){return _0x3383d8['sendStatus'](_0x34bd52);}return _0x3383d8[_0xdba4('0x18')](_0x34bd52)[_0xdba4('0x19')]();};}function respondWithResult(_0x589f61,_0x24cdf1){_0x24cdf1=_0x24cdf1||0xc8;return function(_0xfa3966){if(_0xfa3966){return _0x589f61[_0xdba4('0x18')](_0x24cdf1)[_0xdba4('0x1a')](_0xfa3966);}};}function respondWithFilteredResult(_0x2f9fbe,_0x360766){return function(_0x118c7d){if(_0x118c7d){var _0x462888=typeof _0x360766['offset']===_0xdba4('0x1b')&&typeof _0x360766[_0xdba4('0x1c')]===_0xdba4('0x1b');var _0x3fe1bd=_0x118c7d[_0xdba4('0x1d')];var _0x3906fa=_0x462888?0x0:_0x360766['offset'];var _0x4f4e0d=_0x462888?_0x118c7d[_0xdba4('0x1d')]:_0x360766[_0xdba4('0x1e')]+_0x360766[_0xdba4('0x1c')];var _0x1ea59a;if(_0x4f4e0d>=_0x3fe1bd){_0x4f4e0d=_0x3fe1bd;_0x1ea59a=0xc8;}else{_0x1ea59a=0xce;}_0x2f9fbe[_0xdba4('0x18')](_0x1ea59a);return _0x2f9fbe[_0xdba4('0x1f')](_0xdba4('0x20'),_0x3906fa+'-'+_0x4f4e0d+'/'+_0x3fe1bd)[_0xdba4('0x1a')](_0x118c7d);}return null;};}function patchUpdates(_0x200d85){return function(_0x30e0c0){try{jsonpatch['apply'](_0x30e0c0,_0x200d85,!![]);}catch(_0x5af0f7){return BPromise[_0xdba4('0x21')](_0x5af0f7);}return _0x30e0c0['save']();};}function saveUpdates(_0x3a0633,_0x13dad9){return function(_0x2508fe){if(_0x2508fe){return _0x2508fe[_0xdba4('0x22')](_0x3a0633)[_0xdba4('0x23')](function(_0x4cf44e){return _0x4cf44e;});}return null;};}function removeEntity(_0x5d1781,_0x2d21fe){return function(_0x23121a){if(_0x23121a){return _0x23121a[_0xdba4('0x24')]()[_0xdba4('0x23')](function(){_0x5d1781[_0xdba4('0x18')](0xcc)[_0xdba4('0x19')]();});}};}function handleEntityNotFound(_0x10e8fe,_0x1c2d12){return function(_0x556ae5){if(!_0x556ae5){_0x10e8fe[_0xdba4('0x25')](0x194);}return _0x556ae5;};}function handleError(_0x1eb656,_0x27b883){_0x27b883=_0x27b883||0x1f4;return function(_0x51d2e9){logger[_0xdba4('0x26')](_0x51d2e9[_0xdba4('0x27')]);if(_0x51d2e9['name']){delete _0x51d2e9[_0xdba4('0x28')];}_0x1eb656[_0xdba4('0x18')](_0x27b883)[_0xdba4('0x29')](_0x51d2e9);};}exports[_0xdba4('0x2a')]=function(_0x34aeee,_0x33472c){var _0x4ff883={},_0x2602f2={},_0x143d67={'count':0x0,'rows':[]};var _0xf420ba=_['map'](db[_0xdba4('0x2b')][_0xdba4('0x2c')],function(_0x35a84a){return{'name':_0x35a84a[_0xdba4('0x2d')],'type':_0x35a84a[_0xdba4('0x2e')][_0xdba4('0x2f')]};});_0x2602f2['model']=_[_0xdba4('0x30')](_0xf420ba,_0xdba4('0x28'));_0x2602f2[_0xdba4('0x31')]=_[_0xdba4('0x32')](_0x34aeee['query']);_0x2602f2[_0xdba4('0x33')]=_['intersection'](_0x2602f2[_0xdba4('0x34')],_0x2602f2[_0xdba4('0x31')]);_0x4ff883[_0xdba4('0x35')]=_['intersection'](_0x2602f2[_0xdba4('0x34')],qs[_0xdba4('0x36')](_0x34aeee[_0xdba4('0x31')][_0xdba4('0x36')]));_0x4ff883[_0xdba4('0x35')]=_0x4ff883[_0xdba4('0x35')][_0xdba4('0x37')]?_0x4ff883[_0xdba4('0x35')]:_0x2602f2['model'];if(!_0x34aeee[_0xdba4('0x31')][_0xdba4('0x38')]('nolimit')){_0x4ff883[_0xdba4('0x1c')]=qs[_0xdba4('0x1c')](_0x34aeee[_0xdba4('0x31')][_0xdba4('0x1c')]);_0x4ff883['offset']=qs[_0xdba4('0x1e')](_0x34aeee['query']['offset']);}_0x4ff883[_0xdba4('0x39')]=qs[_0xdba4('0x3a')](_0x34aeee[_0xdba4('0x31')][_0xdba4('0x3a')]);_0x4ff883[_0xdba4('0x3b')]=qs[_0xdba4('0x33')](_[_0xdba4('0x3c')](_0x34aeee[_0xdba4('0x31')],_0x2602f2['filters']),_0xf420ba);if(_0x34aeee[_0xdba4('0x31')][_0xdba4('0x3d')]){_0x4ff883[_0xdba4('0x3b')]=_['merge'](_0x4ff883['where'],{'$or':_['map'](_0xf420ba,function(_0x2f070b){if(_0x2f070b['type']!==_0xdba4('0x3e')){var _0x525963={};_0x525963[_0x2f070b['name']]={'$like':'%'+_0x34aeee[_0xdba4('0x31')][_0xdba4('0x3d')]+'%'};return _0x525963;}})});}_0x4ff883=_[_0xdba4('0x3f')]({},_0x4ff883,_0x34aeee[_0xdba4('0x40')]);var _0x46eb14={'where':_0x4ff883[_0xdba4('0x3b')]};return db[_0xdba4('0x2b')]['count'](_0x46eb14)[_0xdba4('0x23')](function(_0x30c904){_0x143d67[_0xdba4('0x1d')]=_0x30c904;if(_0x34aeee[_0xdba4('0x31')][_0xdba4('0x41')]){_0x4ff883[_0xdba4('0x42')]=[{'all':!![]}];}return db[_0xdba4('0x2b')][_0xdba4('0x43')](_0x4ff883);})[_0xdba4('0x23')](function(_0x478cbd){_0x143d67[_0xdba4('0x44')]=_0x478cbd;return _0x143d67;})['then'](respondWithFilteredResult(_0x33472c,_0x4ff883))['catch'](handleError(_0x33472c,null));};exports['show']=function(_0x52743e,_0x29960e){var _0x56aba1={'raw':!![],'where':{'id':_0x52743e['params']['id']}},_0x1b8305={};_0x1b8305[_0xdba4('0x34')]=_[_0xdba4('0x32')](db['SmsQueueReport'][_0xdba4('0x2c')]);_0x1b8305['query']=_[_0xdba4('0x32')](_0x52743e[_0xdba4('0x31')]);_0x1b8305[_0xdba4('0x33')]=_['intersection'](_0x1b8305[_0xdba4('0x34')],_0x1b8305['query']);_0x56aba1[_0xdba4('0x35')]=_[_0xdba4('0x45')](_0x1b8305['model'],qs[_0xdba4('0x36')](_0x52743e[_0xdba4('0x31')][_0xdba4('0x36')]));_0x56aba1['attributes']=_0x56aba1[_0xdba4('0x35')]['length']?_0x56aba1[_0xdba4('0x35')]:_0x1b8305[_0xdba4('0x34')];if(_0x52743e['query']['includeAll']){_0x56aba1['include']=[{'all':!![]}];}_0x56aba1=_[_0xdba4('0x3f')]({},_0x56aba1,_0x52743e[_0xdba4('0x40')]);return db[_0xdba4('0x2b')][_0xdba4('0x46')](_0x56aba1)[_0xdba4('0x23')](handleEntityNotFound(_0x29960e,null))[_0xdba4('0x23')](respondWithResult(_0x29960e,null))[_0xdba4('0x47')](handleError(_0x29960e,null));};exports[_0xdba4('0x48')]=function(_0x49ef75,_0x58b267){return db['SmsQueueReport'][_0xdba4('0x48')](_0x49ef75[_0xdba4('0x49')],{})[_0xdba4('0x23')](respondWithResult(_0x58b267,0xc9))[_0xdba4('0x47')](handleError(_0x58b267,null));};exports[_0xdba4('0x22')]=function(_0xd97752,_0x141666){if(_0xd97752['body']['id']){delete _0xd97752[_0xdba4('0x49')]['id'];}return db[_0xdba4('0x2b')]['find']({'where':{'id':_0xd97752[_0xdba4('0x4a')]['id']}})[_0xdba4('0x23')](handleEntityNotFound(_0x141666,null))['then'](saveUpdates(_0xd97752['body'],null))[_0xdba4('0x23')](respondWithResult(_0x141666,null))[_0xdba4('0x47')](handleError(_0x141666,null));};exports['destroy']=function(_0x5b956e,_0x145d00){return db[_0xdba4('0x2b')][_0xdba4('0x46')]({'where':{'id':_0x5b956e['params']['id']}})[_0xdba4('0x23')](handleEntityNotFound(_0x145d00,null))[_0xdba4('0x23')](removeEntity(_0x145d00,null))[_0xdba4('0x47')](handleError(_0x145d00,null));};exports[_0xdba4('0x4b')]=function(_0x1e6eb2,_0x12dc38){return db[_0xdba4('0x2b')][_0xdba4('0x4b')]()[_0xdba4('0x23')](respondWithResult(_0x12dc38,null))[_0xdba4('0x47')](handleError(_0x12dc38,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 4846734..641d074 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 _0xbaf0=['define','SmsQueueReport','report_sms_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x99bbd,_0x2c4f71){var _0x5897ac=function(_0xf7b82e){while(--_0xf7b82e){_0x99bbd['push'](_0x99bbd['shift']());}};_0x5897ac(++_0x2c4f71);}(_0xbaf0,0x12a));var _0x0baf=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbaf0[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcb91=['path','rimraf','./smsQueueReport.attributes','exports','define','report_sms_queue','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x227605,_0x37fe49){var _0xa370e1=function(_0x586a60){while(--_0x586a60){_0x227605['push'](_0x227605['shift']());}};_0xa370e1(++_0x37fe49);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0xcb91[_0x82129b];return _0x2ae5dc;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('SmsQueueReport',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[{'name':_0x1cb9('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index c23b10d..d5cbbee 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 _0xf65b=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateSmsQueueReport','SmsQueueReport','body','options','raw','UpdateSmsQueueReport','update','where','attributes','limit','moment'];(function(_0x5a59a6,_0x35930f){var _0x3ad655=function(_0x7685b){while(--_0x7685b){_0x5a59a6['push'](_0x5a59a6['shift']());}};_0x3ad655(++_0x35930f);}(_0xf65b,0x16a));var _0xbf65=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf65b[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xbf65('0x0'));var BPromise=require('bluebird');var rs=require(_0xbf65('0x1'));var fs=require('fs');var Redis=require(_0xbf65('0x2'));var db=require(_0xbf65('0x3'))['db'];var utils=require(_0xbf65('0x4'));var logger=require(_0xbf65('0x5'))(_0xbf65('0x6'));var config=require(_0xbf65('0x7'));var jayson=require(_0xbf65('0x8'));var client=jayson[_0xbf65('0x9')][_0xbf65('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x46aaee,_0x42d8f4,_0xe95404){return new BPromise(function(_0x93c313,_0x35753d){return client[_0xbf65('0xb')](_0x46aaee,_0xe95404)[_0xbf65('0xc')](function(_0x441019){logger[_0xbf65('0xd')](_0xbf65('0xe'),_0x42d8f4,_0xbf65('0xf'));logger[_0xbf65('0x10')](_0xbf65('0x11'),_0x42d8f4,_0xbf65('0xf'),JSON[_0xbf65('0x12')](_0x441019));if(_0x441019[_0xbf65('0x13')]){if(_0x441019[_0xbf65('0x13')]['code']===0x1f4){logger[_0xbf65('0x13')]('SmsQueueReport,\x20%s,\x20%s',_0x42d8f4,_0x441019[_0xbf65('0x13')][_0xbf65('0x14')]);return _0x35753d(_0x441019[_0xbf65('0x13')][_0xbf65('0x14')]);}logger[_0xbf65('0x13')](_0xbf65('0xe'),_0x42d8f4,_0x441019['error'][_0xbf65('0x14')]);return _0x93c313(_0x441019[_0xbf65('0x13')][_0xbf65('0x14')]);}else{logger[_0xbf65('0xd')](_0xbf65('0xe'),_0x42d8f4,_0xbf65('0xf'));_0x93c313(_0x441019[_0xbf65('0x15')][_0xbf65('0x14')]);}})[_0xbf65('0x16')](function(_0x1af370){logger[_0xbf65('0x13')](_0xbf65('0xe'),_0x42d8f4,_0x1af370);_0x35753d(_0x1af370);});});}exports[_0xbf65('0x17')]=function(_0x6603fe){var _0x55404a=this;return new Promise(function(_0x3f4d38,_0x5d579b){return db[_0xbf65('0x18')]['create'](_0x6603fe[_0xbf65('0x19')],{'raw':_0x6603fe['options']?_0x6603fe[_0xbf65('0x1a')][_0xbf65('0x1b')]===undefined?!![]:![]:!![]})[_0xbf65('0xc')](function(_0xa55dba){logger[_0xbf65('0xd')](_0xbf65('0x17'),_0x6603fe);logger[_0xbf65('0x10')](_0xbf65('0x17'),_0x6603fe,JSON[_0xbf65('0x12')](_0xa55dba));_0x3f4d38(_0xa55dba);})[_0xbf65('0x16')](function(_0x3cdec8){logger[_0xbf65('0x13')](_0xbf65('0x17'),_0x3cdec8[_0xbf65('0x14')],_0x6603fe);_0x5d579b(_0x55404a[_0xbf65('0x13')](0x1f4,_0x3cdec8['message']));});});};exports[_0xbf65('0x1c')]=function(_0x330638){var _0xa4416e=this;return new Promise(function(_0x2d577a,_0x3e929c){return db[_0xbf65('0x18')][_0xbf65('0x1d')](_0x330638[_0xbf65('0x19')],{'raw':_0x330638[_0xbf65('0x1a')]?_0x330638[_0xbf65('0x1a')][_0xbf65('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x330638[_0xbf65('0x1a')]?_0x330638['options'][_0xbf65('0x1e')]||null:null,'attributes':_0x330638['options']?_0x330638['options'][_0xbf65('0x1f')]||null:null,'limit':_0x330638[_0xbf65('0x1a')]?_0x330638[_0xbf65('0x1a')][_0xbf65('0x20')]||null:null})[_0xbf65('0xc')](function(_0x3f407){logger[_0xbf65('0xd')](_0xbf65('0x1c'),_0x330638);logger[_0xbf65('0x10')](_0xbf65('0x1c'),_0x330638,JSON['stringify'](_0x3f407));_0x2d577a(_0x3f407);})[_0xbf65('0x16')](function(_0x1a26b4){logger[_0xbf65('0x13')](_0xbf65('0x1c'),_0x1a26b4[_0xbf65('0x14')],_0x330638);_0x3e929c(_0xa4416e['error'](0x1f4,_0x1a26b4[_0xbf65('0x14')]));});});}; \ No newline at end of file +var _0xc2b6=['message','catch','SmsQueueReport','create','body','options','debug','CreateSmsQueueReport','UpdateSmsQueueReport','update','raw','where','attributes','then','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','stringify','error','code','SmsQueueReport,\x20%s,\x20%s'];(function(_0x30349f,_0x1500c0){var _0x5a04f9=function(_0x3c1f1c){while(--_0x3c1f1c){_0x30349f['push'](_0x30349f['shift']());}};_0x5a04f9(++_0x1500c0);}(_0xc2b6,0x158));var _0x6c2b=function(_0x2077c2,_0x275ab5){_0x2077c2=_0x2077c2-0x0;var _0x312f9f=_0xc2b6[_0x2077c2];return _0x312f9f;};'use strict';var _=require(_0x6c2b('0x0'));var util=require(_0x6c2b('0x1'));var moment=require(_0x6c2b('0x2'));var BPromise=require(_0x6c2b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6c2b('0x4'));var db=require(_0x6c2b('0x5'))['db'];var utils=require(_0x6c2b('0x6'));var logger=require(_0x6c2b('0x7'))(_0x6c2b('0x8'));var config=require(_0x6c2b('0x9'));var jayson=require(_0x6c2b('0xa'));var client=jayson['client'][_0x6c2b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x155d9b,_0x308f06,_0x540141){return new BPromise(function(_0xa9f04c,_0x2efa67){return client[_0x6c2b('0xc')](_0x155d9b,_0x540141)['then'](function(_0x1ff749){logger[_0x6c2b('0xd')]('SmsQueueReport,\x20%s,\x20%s',_0x308f06,_0x6c2b('0xe'));logger['debug']('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x308f06,_0x6c2b('0xe'),JSON[_0x6c2b('0xf')](_0x1ff749));if(_0x1ff749[_0x6c2b('0x10')]){if(_0x1ff749[_0x6c2b('0x10')][_0x6c2b('0x11')]===0x1f4){logger['error'](_0x6c2b('0x12'),_0x308f06,_0x1ff749[_0x6c2b('0x10')]['message']);return _0x2efa67(_0x1ff749['error'][_0x6c2b('0x13')]);}logger[_0x6c2b('0x10')]('SmsQueueReport,\x20%s,\x20%s',_0x308f06,_0x1ff749['error']['message']);return _0xa9f04c(_0x1ff749[_0x6c2b('0x10')]['message']);}else{logger['info']('SmsQueueReport,\x20%s,\x20%s',_0x308f06,'request\x20sent');_0xa9f04c(_0x1ff749['result'][_0x6c2b('0x13')]);}})[_0x6c2b('0x14')](function(_0x480c18){logger['error'](_0x6c2b('0x12'),_0x308f06,_0x480c18);_0x2efa67(_0x480c18);});});}exports['CreateSmsQueueReport']=function(_0x27afe6){var _0x3bb874=this;return new Promise(function(_0x280107,_0x3d8ad1){return db[_0x6c2b('0x15')][_0x6c2b('0x16')](_0x27afe6[_0x6c2b('0x17')],{'raw':_0x27afe6[_0x6c2b('0x18')]?_0x27afe6[_0x6c2b('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x3896e9){logger[_0x6c2b('0xd')]('CreateSmsQueueReport',_0x27afe6);logger[_0x6c2b('0x19')](_0x6c2b('0x1a'),_0x27afe6,JSON['stringify'](_0x3896e9));_0x280107(_0x3896e9);})[_0x6c2b('0x14')](function(_0x3e28f3){logger[_0x6c2b('0x10')](_0x6c2b('0x1a'),_0x3e28f3['message'],_0x27afe6);_0x3d8ad1(_0x3bb874[_0x6c2b('0x10')](0x1f4,_0x3e28f3['message']));});});};exports[_0x6c2b('0x1b')]=function(_0x237a15){var _0x527d8b=this;return new Promise(function(_0x24ae05,_0xe6301a){return db[_0x6c2b('0x15')][_0x6c2b('0x1c')](_0x237a15[_0x6c2b('0x17')],{'raw':_0x237a15['options']?_0x237a15[_0x6c2b('0x18')][_0x6c2b('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x237a15[_0x6c2b('0x18')]?_0x237a15[_0x6c2b('0x18')][_0x6c2b('0x1e')]||null:null,'attributes':_0x237a15[_0x6c2b('0x18')]?_0x237a15[_0x6c2b('0x18')][_0x6c2b('0x1f')]||null:null,'limit':_0x237a15[_0x6c2b('0x18')]?_0x237a15['options']['limit']||null:null})[_0x6c2b('0x20')](function(_0x358e34){logger[_0x6c2b('0xd')](_0x6c2b('0x1b'),_0x237a15);logger[_0x6c2b('0x19')]('UpdateSmsQueueReport',_0x237a15,JSON[_0x6c2b('0xf')](_0x358e34));_0x24ae05(_0x358e34);})[_0x6c2b('0x14')](function(_0x1e7016){logger[_0x6c2b('0x10')](_0x6c2b('0x1b'),_0x1e7016[_0x6c2b('0x13')],_0x237a15);_0xe6301a(_0x527d8b[_0x6c2b('0x10')](0x1f4,_0x1e7016[_0x6c2b('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 529d8fe..6c5bd8e 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 _0x008c=['../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','show','post','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x5627e1,_0x1b2dbf){var _0x2f013f=function(_0x142015){while(--_0x142015){_0x5627e1['push'](_0x5627e1['shift']());}};_0x2f013f(++_0x1b2dbf);}(_0x008c,0x188));var _0xc008=function(_0xed8833,_0x2a801e){_0xed8833=_0xed8833-0x0;var _0x42a79d=_0x008c[_0xed8833];return _0x42a79d;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/describe',auth[_0xc008('0xb')](),controller['describe']);router[_0xc008('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xc008('0xf'),auth[_0xc008('0xb')](),controller['update']);router[_0xc008('0x10')](_0xc008('0xf'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);module[_0xc008('0x12')]=router; \ No newline at end of file +var _0x207c=['/:id','show','post','isAuthenticated','create','put','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','index','get','/describe','describe'];(function(_0x1460f6,_0x59051a){var _0x46ce94=function(_0x1c3ddf){while(--_0x1c3ddf){_0x1460f6['push'](_0x1460f6['shift']());}};_0x46ce94(++_0x59051a);}(_0x207c,0x1e8));var _0xc207=function(_0x34edec,_0x228935){_0x34edec=_0x34edec-0x0;var _0x2d276d=_0x207c[_0x34edec];return _0x2d276d;};'use strict';var multer=require('multer');var util=require(_0xc207('0x0'));var path=require(_0xc207('0x1'));var timeout=require(_0xc207('0x2'));var express=require(_0xc207('0x3'));var router=express[_0xc207('0x4')]();var fs_extra=require(_0xc207('0x5'));var auth=require(_0xc207('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc207('0x7'));var controller=require('./smsTransferReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xc207('0x8')]);router[_0xc207('0x9')](_0xc207('0xa'),auth['isAuthenticated'](),controller[_0xc207('0xb')]);router[_0xc207('0x9')](_0xc207('0xc'),auth['isAuthenticated'](),controller[_0xc207('0xd')]);router[_0xc207('0xe')]('/',auth[_0xc207('0xf')](),controller[_0xc207('0x10')]);router[_0xc207('0x11')](_0xc207('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xc207('0xc'),auth['isAuthenticated'](),controller[_0xc207('0x12')]);module[_0xc207('0x13')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index c9db75a..8c82e2e 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 _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x56eaa4,_0xe8ca71){var _0xa7e4a3=function(_0x28cdb0){while(--_0x28cdb0){_0x56eaa4['push'](_0x56eaa4['shift']());}};_0xa7e4a3(++_0xe8ca71);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file +var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x29c69a,_0x40cba9){var _0x9469d4=function(_0x3de4b8){while(--_0x3de4b8){_0x29c69a['push'](_0x29c69a['shift']());}};_0x9469d4(++_0x40cba9);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1399d6,_0x2c1661){_0x1399d6=_0x1399d6-0x0;var _0x4a9db4=_0xcb91[_0x1399d6];return _0x4a9db4;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 2afbd8e..6bce44a 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 _0x20a0=['error','name','send','index','SmsTransferReport','rawAttributes','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy'];(function(_0x9c2427,_0x17c865){var _0x51984f=function(_0x177af6){while(--_0x177af6){_0x9c2427['push'](_0x9c2427['shift']());}};_0x51984f(++_0x17c865);}(_0x20a0,0x15d));var _0x020a=function(_0xd5b3ec,_0x51131d){_0xd5b3ec=_0xd5b3ec-0x0;var _0x525847=_0x20a0[_0xd5b3ec];return _0x525847;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x020a('0x0'));var jsonpatch=require(_0x020a('0x1'));var rp=require(_0x020a('0x2'));var moment=require(_0x020a('0x3'));var BPromise=require(_0x020a('0x4'));var Mustache=require(_0x020a('0x5'));var util=require(_0x020a('0x6'));var path=require(_0x020a('0x7'));var sox=require(_0x020a('0x8'));var csv=require(_0x020a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x020a('0xa'));var _=require('lodash');var squel=require(_0x020a('0xb'));var crypto=require(_0x020a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x020a('0xd'));var toCsv=require(_0x020a('0x9'));var querystring=require(_0x020a('0xe'));var Papa=require(_0x020a('0xf'));var Redis=require(_0x020a('0x10'));var authService=require(_0x020a('0x11'));var qs=require(_0x020a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x020a('0x13'));var logger=require(_0x020a('0x14'))(_0x020a('0x15'));var utils=require(_0x020a('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x020a('0x17'));var db=require(_0x020a('0x18'))['db'];function respondWithStatusCode(_0x108e64,_0xe1fc2b){_0xe1fc2b=_0xe1fc2b||0xcc;return function(_0x5c7c4b){if(_0x5c7c4b){return _0x108e64[_0x020a('0x19')](_0xe1fc2b);}return _0x108e64[_0x020a('0x1a')](_0xe1fc2b)[_0x020a('0x1b')]();};}function respondWithResult(_0x461aa9,_0x48e26c){_0x48e26c=_0x48e26c||0xc8;return function(_0x3e79c8){if(_0x3e79c8){return _0x461aa9[_0x020a('0x1a')](_0x48e26c)[_0x020a('0x1c')](_0x3e79c8);}};}function respondWithFilteredResult(_0x5315cd,_0x3c5bc4){return function(_0x459052){if(_0x459052){var _0x19f6bc=typeof _0x3c5bc4[_0x020a('0x1d')]===_0x020a('0x1e')&&typeof _0x3c5bc4[_0x020a('0x1f')]===_0x020a('0x1e');var _0x30a10b=_0x459052[_0x020a('0x20')];var _0xc83c31=_0x19f6bc?0x0:_0x3c5bc4['offset'];var _0x168a5a=_0x19f6bc?_0x459052[_0x020a('0x20')]:_0x3c5bc4[_0x020a('0x1d')]+_0x3c5bc4[_0x020a('0x1f')];var _0x5d9311;if(_0x168a5a>=_0x30a10b){_0x168a5a=_0x30a10b;_0x5d9311=0xc8;}else{_0x5d9311=0xce;}_0x5315cd[_0x020a('0x1a')](_0x5d9311);return _0x5315cd[_0x020a('0x21')](_0x020a('0x22'),_0xc83c31+'-'+_0x168a5a+'/'+_0x30a10b)[_0x020a('0x1c')](_0x459052);}return null;};}function patchUpdates(_0x60f38e){return function(_0x41b056){try{jsonpatch[_0x020a('0x23')](_0x41b056,_0x60f38e,!![]);}catch(_0x5f3342){return BPromise[_0x020a('0x24')](_0x5f3342);}return _0x41b056[_0x020a('0x25')]();};}function saveUpdates(_0xad7ced,_0x352657){return function(_0x283ff1){if(_0x283ff1){return _0x283ff1[_0x020a('0x26')](_0xad7ced)[_0x020a('0x27')](function(_0x3d4259){return _0x3d4259;});}return null;};}function removeEntity(_0xd998a1,_0x4712c1){return function(_0x448058){if(_0x448058){return _0x448058[_0x020a('0x28')]()[_0x020a('0x27')](function(){_0xd998a1[_0x020a('0x1a')](0xcc)[_0x020a('0x1b')]();});}};}function handleEntityNotFound(_0x335444,_0x57d3d6){return function(_0x877c51){if(!_0x877c51){_0x335444[_0x020a('0x19')](0x194);}return _0x877c51;};}function handleError(_0x28cbdf,_0x415e41){_0x415e41=_0x415e41||0x1f4;return function(_0x36febe){logger[_0x020a('0x29')](_0x36febe['stack']);if(_0x36febe[_0x020a('0x2a')]){delete _0x36febe[_0x020a('0x2a')];}_0x28cbdf[_0x020a('0x1a')](_0x415e41)[_0x020a('0x2b')](_0x36febe);};}exports[_0x020a('0x2c')]=function(_0x3bfdd4,_0x6fc185){var _0x416e11={},_0x40762f={},_0x5e980b={'count':0x0,'rows':[]};var _0x4c0794=_['map'](db[_0x020a('0x2d')][_0x020a('0x2e')],function(_0x3c9e59){return{'name':_0x3c9e59['fieldName'],'type':_0x3c9e59[_0x020a('0x2f')][_0x020a('0x30')]};});_0x40762f[_0x020a('0x31')]=_[_0x020a('0x32')](_0x4c0794,'name');_0x40762f['query']=_[_0x020a('0x33')](_0x3bfdd4[_0x020a('0x34')]);_0x40762f[_0x020a('0x35')]=_[_0x020a('0x36')](_0x40762f[_0x020a('0x31')],_0x40762f[_0x020a('0x34')]);_0x416e11[_0x020a('0x37')]=_[_0x020a('0x36')](_0x40762f[_0x020a('0x31')],qs['fields'](_0x3bfdd4['query'][_0x020a('0x38')]));_0x416e11[_0x020a('0x37')]=_0x416e11[_0x020a('0x37')][_0x020a('0x39')]?_0x416e11[_0x020a('0x37')]:_0x40762f['model'];if(!_0x3bfdd4[_0x020a('0x34')][_0x020a('0x3a')]('nolimit')){_0x416e11['limit']=qs['limit'](_0x3bfdd4[_0x020a('0x34')]['limit']);_0x416e11['offset']=qs[_0x020a('0x1d')](_0x3bfdd4[_0x020a('0x34')][_0x020a('0x1d')]);}_0x416e11[_0x020a('0x3b')]=qs['sort'](_0x3bfdd4['query'][_0x020a('0x3c')]);_0x416e11[_0x020a('0x3d')]=qs[_0x020a('0x35')](_[_0x020a('0x3e')](_0x3bfdd4[_0x020a('0x34')],_0x40762f['filters']),_0x4c0794);if(_0x3bfdd4[_0x020a('0x34')][_0x020a('0x3f')]){_0x416e11['where']=_['merge'](_0x416e11['where'],{'$or':_['map'](_0x4c0794,function(_0x5e0756){if(_0x5e0756[_0x020a('0x2f')]!==_0x020a('0x40')){var _0x1040c7={};_0x1040c7[_0x5e0756[_0x020a('0x2a')]]={'$like':'%'+_0x3bfdd4['query']['filter']+'%'};return _0x1040c7;}})});}_0x416e11=_[_0x020a('0x41')]({},_0x416e11,_0x3bfdd4[_0x020a('0x42')]);var _0x67888d={'where':_0x416e11['where']};return db[_0x020a('0x2d')][_0x020a('0x20')](_0x67888d)[_0x020a('0x27')](function(_0x363cce){_0x5e980b['count']=_0x363cce;if(_0x3bfdd4[_0x020a('0x34')][_0x020a('0x43')]){_0x416e11[_0x020a('0x44')]=[{'all':!![]}];}return db[_0x020a('0x2d')][_0x020a('0x45')](_0x416e11);})[_0x020a('0x27')](function(_0x4b7635){_0x5e980b[_0x020a('0x46')]=_0x4b7635;return _0x5e980b;})[_0x020a('0x27')](respondWithFilteredResult(_0x6fc185,_0x416e11))[_0x020a('0x47')](handleError(_0x6fc185,null));};exports[_0x020a('0x48')]=function(_0x1012d9,_0x5aecb1){var _0x28e7d1={'raw':!![],'where':{'id':_0x1012d9[_0x020a('0x49')]['id']}},_0x23f4ca={};_0x23f4ca[_0x020a('0x31')]=_[_0x020a('0x33')](db[_0x020a('0x2d')][_0x020a('0x2e')]);_0x23f4ca['query']=_[_0x020a('0x33')](_0x1012d9[_0x020a('0x34')]);_0x23f4ca[_0x020a('0x35')]=_[_0x020a('0x36')](_0x23f4ca[_0x020a('0x31')],_0x23f4ca[_0x020a('0x34')]);_0x28e7d1[_0x020a('0x37')]=_[_0x020a('0x36')](_0x23f4ca[_0x020a('0x31')],qs[_0x020a('0x38')](_0x1012d9[_0x020a('0x34')][_0x020a('0x38')]));_0x28e7d1[_0x020a('0x37')]=_0x28e7d1['attributes'][_0x020a('0x39')]?_0x28e7d1[_0x020a('0x37')]:_0x23f4ca[_0x020a('0x31')];if(_0x1012d9[_0x020a('0x34')][_0x020a('0x43')]){_0x28e7d1[_0x020a('0x44')]=[{'all':!![]}];}_0x28e7d1=_[_0x020a('0x41')]({},_0x28e7d1,_0x1012d9[_0x020a('0x42')]);return db[_0x020a('0x2d')][_0x020a('0x4a')](_0x28e7d1)[_0x020a('0x27')](handleEntityNotFound(_0x5aecb1,null))[_0x020a('0x27')](respondWithResult(_0x5aecb1,null))['catch'](handleError(_0x5aecb1,null));};exports['create']=function(_0xf80729,_0x285935){return db[_0x020a('0x2d')][_0x020a('0x4b')](_0xf80729['body'],{})[_0x020a('0x27')](respondWithResult(_0x285935,0xc9))['catch'](handleError(_0x285935,null));};exports['update']=function(_0x426fc8,_0x390be4){if(_0x426fc8[_0x020a('0x4c')]['id']){delete _0x426fc8['body']['id'];}return db[_0x020a('0x2d')][_0x020a('0x4a')]({'where':{'id':_0x426fc8[_0x020a('0x49')]['id']}})['then'](handleEntityNotFound(_0x390be4,null))['then'](saveUpdates(_0x426fc8[_0x020a('0x4c')],null))[_0x020a('0x27')](respondWithResult(_0x390be4,null))[_0x020a('0x47')](handleError(_0x390be4,null));};exports[_0x020a('0x28')]=function(_0x21ef28,_0x472336){return db[_0x020a('0x2d')][_0x020a('0x4a')]({'where':{'id':_0x21ef28['params']['id']}})['then'](handleEntityNotFound(_0x472336,null))[_0x020a('0x27')](removeEntity(_0x472336,null))['catch'](handleError(_0x472336,null));};exports[_0x020a('0x4d')]=function(_0x32639b,_0x319f26){return db['SmsTransferReport'][_0x020a('0x4d')]()[_0x020a('0x27')](respondWithResult(_0x319f26,null))[_0x020a('0x47')](handleError(_0x319f26,null));}; \ No newline at end of file +var _0xf4f9=['type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','keys','find','create','body','params','describe','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','destroy','then','stack','name','index','map','SmsTransferReport','rawAttributes','fieldName'];(function(_0x54f837,_0x310ceb){var _0x2aec91=function(_0x39c796){while(--_0x39c796){_0x54f837['push'](_0x54f837['shift']());}};_0x2aec91(++_0x310ceb);}(_0xf4f9,0x18f));var _0x9f4f=function(_0x62f38a,_0x3e5cad){_0x62f38a=_0x62f38a-0x0;var _0x1e3669=_0xf4f9[_0x62f38a];return _0x1e3669;};'use strict';var emlformat=require(_0x9f4f('0x0'));var rimraf=require(_0x9f4f('0x1'));var zipdir=require(_0x9f4f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9f4f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9f4f('0x4'));var util=require(_0x9f4f('0x5'));var path=require(_0x9f4f('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9f4f('0x7'));var fs=require('fs');var fs_extra=require(_0x9f4f('0x8'));var _=require(_0x9f4f('0x9'));var squel=require(_0x9f4f('0xa'));var crypto=require(_0x9f4f('0xb'));var jsforce=require(_0x9f4f('0xc'));var deskjs=require(_0x9f4f('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9f4f('0xe'));var Papa=require(_0x9f4f('0xf'));var Redis=require(_0x9f4f('0x10'));var authService=require(_0x9f4f('0x11'));var qs=require(_0x9f4f('0x12'));var as=require(_0x9f4f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9f4f('0x14'));var utils=require(_0x9f4f('0x15'));var config=require(_0x9f4f('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x9f4f('0x17'))['db'];function respondWithStatusCode(_0x4e9153,_0x238a0f){_0x238a0f=_0x238a0f||0xcc;return function(_0x51fd75){if(_0x51fd75){return _0x4e9153[_0x9f4f('0x18')](_0x238a0f);}return _0x4e9153[_0x9f4f('0x19')](_0x238a0f)[_0x9f4f('0x1a')]();};}function respondWithResult(_0x178e95,_0x164f9d){_0x164f9d=_0x164f9d||0xc8;return function(_0x523421){if(_0x523421){return _0x178e95[_0x9f4f('0x19')](_0x164f9d)[_0x9f4f('0x1b')](_0x523421);}};}function respondWithFilteredResult(_0x25ebff,_0x483a31){return function(_0x443315){if(_0x443315){var _0x49af12=typeof _0x483a31[_0x9f4f('0x1c')]===_0x9f4f('0x1d')&&typeof _0x483a31[_0x9f4f('0x1e')]===_0x9f4f('0x1d');var _0x52a4b7=_0x443315[_0x9f4f('0x1f')];var _0x42b33c=_0x49af12?0x0:_0x483a31[_0x9f4f('0x1c')];var _0x371e14=_0x49af12?_0x443315[_0x9f4f('0x1f')]:_0x483a31[_0x9f4f('0x1c')]+_0x483a31[_0x9f4f('0x1e')];var _0x4f7fc6;if(_0x371e14>=_0x52a4b7){_0x371e14=_0x52a4b7;_0x4f7fc6=0xc8;}else{_0x4f7fc6=0xce;}_0x25ebff['status'](_0x4f7fc6);return _0x25ebff['set']('Content-Range',_0x42b33c+'-'+_0x371e14+'/'+_0x52a4b7)['json'](_0x443315);}return null;};}function patchUpdates(_0x51a795){return function(_0x319773){try{jsonpatch[_0x9f4f('0x20')](_0x319773,_0x51a795,!![]);}catch(_0x4da1c0){return BPromise[_0x9f4f('0x21')](_0x4da1c0);}return _0x319773[_0x9f4f('0x22')]();};}function saveUpdates(_0x531b7c,_0xb96b98){return function(_0x3a614d){if(_0x3a614d){return _0x3a614d[_0x9f4f('0x23')](_0x531b7c)['then'](function(_0x380017){return _0x380017;});}return null;};}function removeEntity(_0x372ce1,_0x2aade0){return function(_0x3c0bab){if(_0x3c0bab){return _0x3c0bab[_0x9f4f('0x24')]()[_0x9f4f('0x25')](function(){_0x372ce1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c8891,_0x212f04){return function(_0x5e2524){if(!_0x5e2524){_0x2c8891[_0x9f4f('0x18')](0x194);}return _0x5e2524;};}function handleError(_0x5f35b1,_0x5a0138){_0x5a0138=_0x5a0138||0x1f4;return function(_0x427f9b){logger['error'](_0x427f9b[_0x9f4f('0x26')]);if(_0x427f9b[_0x9f4f('0x27')]){delete _0x427f9b[_0x9f4f('0x27')];}_0x5f35b1[_0x9f4f('0x19')](_0x5a0138)['send'](_0x427f9b);};}exports[_0x9f4f('0x28')]=function(_0x2e0f84,_0x1c1bab){var _0x42b357={},_0x1d40a0={},_0x13d088={'count':0x0,'rows':[]};var _0x527835=_[_0x9f4f('0x29')](db[_0x9f4f('0x2a')][_0x9f4f('0x2b')],function(_0x35c030){return{'name':_0x35c030[_0x9f4f('0x2c')],'type':_0x35c030[_0x9f4f('0x2d')][_0x9f4f('0x2e')]};});_0x1d40a0[_0x9f4f('0x2f')]=_[_0x9f4f('0x29')](_0x527835,'name');_0x1d40a0[_0x9f4f('0x30')]=_['keys'](_0x2e0f84['query']);_0x1d40a0[_0x9f4f('0x31')]=_['intersection'](_0x1d40a0[_0x9f4f('0x2f')],_0x1d40a0[_0x9f4f('0x30')]);_0x42b357[_0x9f4f('0x32')]=_[_0x9f4f('0x33')](_0x1d40a0['model'],qs['fields'](_0x2e0f84[_0x9f4f('0x30')][_0x9f4f('0x34')]));_0x42b357[_0x9f4f('0x32')]=_0x42b357[_0x9f4f('0x32')][_0x9f4f('0x35')]?_0x42b357[_0x9f4f('0x32')]:_0x1d40a0[_0x9f4f('0x2f')];if(!_0x2e0f84[_0x9f4f('0x30')][_0x9f4f('0x36')](_0x9f4f('0x37'))){_0x42b357[_0x9f4f('0x1e')]=qs['limit'](_0x2e0f84[_0x9f4f('0x30')][_0x9f4f('0x1e')]);_0x42b357[_0x9f4f('0x1c')]=qs['offset'](_0x2e0f84[_0x9f4f('0x30')]['offset']);}_0x42b357[_0x9f4f('0x38')]=qs[_0x9f4f('0x39')](_0x2e0f84[_0x9f4f('0x30')]['sort']);_0x42b357[_0x9f4f('0x3a')]=qs[_0x9f4f('0x31')](_[_0x9f4f('0x3b')](_0x2e0f84[_0x9f4f('0x30')],_0x1d40a0['filters']),_0x527835);if(_0x2e0f84[_0x9f4f('0x30')][_0x9f4f('0x3c')]){_0x42b357[_0x9f4f('0x3a')]=_['merge'](_0x42b357[_0x9f4f('0x3a')],{'$or':_['map'](_0x527835,function(_0x185403){if(_0x185403[_0x9f4f('0x2d')]!==_0x9f4f('0x3d')){var _0x480405={};_0x480405[_0x185403[_0x9f4f('0x27')]]={'$like':'%'+_0x2e0f84['query']['filter']+'%'};return _0x480405;}})});}_0x42b357=_[_0x9f4f('0x3e')]({},_0x42b357,_0x2e0f84[_0x9f4f('0x3f')]);var _0x453a3e={'where':_0x42b357[_0x9f4f('0x3a')]};return db[_0x9f4f('0x2a')][_0x9f4f('0x1f')](_0x453a3e)[_0x9f4f('0x25')](function(_0x3f148c){_0x13d088['count']=_0x3f148c;if(_0x2e0f84[_0x9f4f('0x30')][_0x9f4f('0x40')]){_0x42b357[_0x9f4f('0x41')]=[{'all':!![]}];}return db[_0x9f4f('0x2a')][_0x9f4f('0x42')](_0x42b357);})[_0x9f4f('0x25')](function(_0x233a63){_0x13d088['rows']=_0x233a63;return _0x13d088;})['then'](respondWithFilteredResult(_0x1c1bab,_0x42b357))[_0x9f4f('0x43')](handleError(_0x1c1bab,null));};exports['show']=function(_0x9c551c,_0x413d7c){var _0x178c3e={'raw':!![],'where':{'id':_0x9c551c['params']['id']}},_0x3c94df={};_0x3c94df[_0x9f4f('0x2f')]=_[_0x9f4f('0x44')](db[_0x9f4f('0x2a')][_0x9f4f('0x2b')]);_0x3c94df[_0x9f4f('0x30')]=_[_0x9f4f('0x44')](_0x9c551c[_0x9f4f('0x30')]);_0x3c94df[_0x9f4f('0x31')]=_['intersection'](_0x3c94df[_0x9f4f('0x2f')],_0x3c94df[_0x9f4f('0x30')]);_0x178c3e['attributes']=_[_0x9f4f('0x33')](_0x3c94df['model'],qs[_0x9f4f('0x34')](_0x9c551c['query'][_0x9f4f('0x34')]));_0x178c3e[_0x9f4f('0x32')]=_0x178c3e[_0x9f4f('0x32')][_0x9f4f('0x35')]?_0x178c3e[_0x9f4f('0x32')]:_0x3c94df['model'];if(_0x9c551c['query'][_0x9f4f('0x40')]){_0x178c3e[_0x9f4f('0x41')]=[{'all':!![]}];}_0x178c3e=_[_0x9f4f('0x3e')]({},_0x178c3e,_0x9c551c[_0x9f4f('0x3f')]);return db[_0x9f4f('0x2a')][_0x9f4f('0x45')](_0x178c3e)[_0x9f4f('0x25')](handleEntityNotFound(_0x413d7c,null))[_0x9f4f('0x25')](respondWithResult(_0x413d7c,null))[_0x9f4f('0x43')](handleError(_0x413d7c,null));};exports[_0x9f4f('0x46')]=function(_0x2efeb4,_0x2ce44e){return db[_0x9f4f('0x2a')][_0x9f4f('0x46')](_0x2efeb4['body'],{})[_0x9f4f('0x25')](respondWithResult(_0x2ce44e,0xc9))[_0x9f4f('0x43')](handleError(_0x2ce44e,null));};exports[_0x9f4f('0x23')]=function(_0x2e7318,_0xdbbb89){if(_0x2e7318[_0x9f4f('0x47')]['id']){delete _0x2e7318[_0x9f4f('0x47')]['id'];}return db[_0x9f4f('0x2a')][_0x9f4f('0x45')]({'where':{'id':_0x2e7318['params']['id']}})[_0x9f4f('0x25')](handleEntityNotFound(_0xdbbb89,null))[_0x9f4f('0x25')](saveUpdates(_0x2e7318[_0x9f4f('0x47')],null))[_0x9f4f('0x25')](respondWithResult(_0xdbbb89,null))[_0x9f4f('0x43')](handleError(_0xdbbb89,null));};exports[_0x9f4f('0x24')]=function(_0x274ae6,_0x1e785d){return db['SmsTransferReport'][_0x9f4f('0x45')]({'where':{'id':_0x274ae6[_0x9f4f('0x48')]['id']}})[_0x9f4f('0x25')](handleEntityNotFound(_0x1e785d,null))[_0x9f4f('0x25')](removeEntity(_0x1e785d,null))['catch'](handleError(_0x1e785d,null));};exports['describe']=function(_0x198c63,_0x5ae440){return db['SmsTransferReport'][_0x9f4f('0x49')]()[_0x9f4f('0x25')](respondWithResult(_0x5ae440,null))[_0x9f4f('0x43')](handleError(_0x5ae440,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 7bc56e4..8fce8ba 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 _0x3a5e=['moment','bluebird','path','rimraf','../../config/environment','./smsTransferReport.attributes','exports','define','report_sms_transfer','uniqueid','lodash','util','../../config/logger','api'];(function(_0x182250,_0x351120){var _0x4962fc=function(_0xca9ab8){while(--_0xca9ab8){_0x182250['push'](_0x182250['shift']());}};_0x4962fc(++_0x351120);}(_0x3a5e,0x14c));var _0xe3a5=function(_0x83a785,_0x2c40c0){_0x83a785=_0x83a785-0x0;var _0x149ec8=_0x3a5e[_0x83a785];return _0x149ec8;};'use strict';var _=require(_0xe3a5('0x0'));var util=require(_0xe3a5('0x1'));var logger=require(_0xe3a5('0x2'))(_0xe3a5('0x3'));var moment=require(_0xe3a5('0x4'));var BPromise=require(_0xe3a5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe3a5('0x6'));var rimraf=require(_0xe3a5('0x7'));var config=require(_0xe3a5('0x8'));var attributes=require(_0xe3a5('0x9'));module[_0xe3a5('0xa')]=function(_0x499f61,_0x5e1507){return _0x499f61[_0xe3a5('0xb')]('SmsTransferReport',attributes,{'tableName':_0xe3a5('0xc'),'paranoid':![],'indexes':[{'name':_0xe3a5('0xd'),'fields':[_0xe3a5('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5f4b=['exports','SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./smsTransferReport.attributes'];(function(_0x134475,_0x3e147b){var _0xf1e6f0=function(_0x3b8646){while(--_0x3b8646){_0x134475['push'](_0x134475['shift']());}};_0xf1e6f0(++_0x3e147b);}(_0x5f4b,0x19a));var _0xb5f4=function(_0x158af0,_0x1da37c){_0x158af0=_0x158af0-0x0;var _0x2c25d5=_0x5f4b[_0x158af0];return _0x2c25d5;};'use strict';var _=require(_0xb5f4('0x0'));var util=require(_0xb5f4('0x1'));var logger=require(_0xb5f4('0x2'))(_0xb5f4('0x3'));var moment=require(_0xb5f4('0x4'));var BPromise=require(_0xb5f4('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb5f4('0x6'));var rimraf=require(_0xb5f4('0x7'));var config=require(_0xb5f4('0x8'));var attributes=require(_0xb5f4('0x9'));module[_0xb5f4('0xa')]=function(_0x21eec6,_0x12c107){return _0x21eec6['define'](_0xb5f4('0xb'),attributes,{'tableName':_0xb5f4('0xc'),'paranoid':![],'indexes':[{'name':_0xb5f4('0xd'),'fields':[_0xb5f4('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 646eb8c..dd52eda 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 _0x1ac2=['client','http','request','then','info','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','SmsTransferReport,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x40df31,_0xec10a0){var _0x518061=function(_0x160eda){while(--_0x160eda){_0x40df31['push'](_0x40df31['shift']());}};_0x518061(++_0xec10a0);}(_0x1ac2,0xfd));var _0x21ac=function(_0xaae5cc,_0x46d786){_0xaae5cc=_0xaae5cc-0x0;var _0x236171=_0x1ac2[_0xaae5cc];return _0x236171;};'use strict';var _=require(_0x21ac('0x0'));var util=require(_0x21ac('0x1'));var moment=require(_0x21ac('0x2'));var BPromise=require(_0x21ac('0x3'));var rs=require(_0x21ac('0x4'));var fs=require('fs');var Redis=require(_0x21ac('0x5'));var db=require(_0x21ac('0x6'))['db'];var utils=require(_0x21ac('0x7'));var logger=require(_0x21ac('0x8'))(_0x21ac('0x9'));var config=require(_0x21ac('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x21ac('0xb')][_0x21ac('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2d7e9c,_0x4bd382,_0x361eb0){return new BPromise(function(_0x353cdb,_0x443ec5){return client[_0x21ac('0xd')](_0x2d7e9c,_0x361eb0)[_0x21ac('0xe')](function(_0x3b8156){logger[_0x21ac('0xf')]('SmsTransferReport,\x20%s,\x20%s',_0x4bd382,_0x21ac('0x10'));logger[_0x21ac('0x11')](_0x21ac('0x12'),_0x4bd382,_0x21ac('0x10'),JSON[_0x21ac('0x13')](_0x3b8156));if(_0x3b8156[_0x21ac('0x14')]){if(_0x3b8156[_0x21ac('0x14')]['code']===0x1f4){logger[_0x21ac('0x14')](_0x21ac('0x15'),_0x4bd382,_0x3b8156[_0x21ac('0x14')][_0x21ac('0x16')]);return _0x443ec5(_0x3b8156[_0x21ac('0x14')][_0x21ac('0x16')]);}logger[_0x21ac('0x14')](_0x21ac('0x15'),_0x4bd382,_0x3b8156[_0x21ac('0x14')]['message']);return _0x353cdb(_0x3b8156[_0x21ac('0x14')][_0x21ac('0x16')]);}else{logger[_0x21ac('0xf')](_0x21ac('0x15'),_0x4bd382,'request\x20sent');_0x353cdb(_0x3b8156[_0x21ac('0x17')][_0x21ac('0x16')]);}})['catch'](function(_0x401899){logger[_0x21ac('0x14')]('SmsTransferReport,\x20%s,\x20%s',_0x4bd382,_0x401899);_0x443ec5(_0x401899);});});} \ No newline at end of file +var _0x26d1=['SmsTransferReport,\x20%s,\x20%s','message','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x26d1,0x8e));var _0x126d=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x26d1[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x126d('0x0'));var util=require('util');var moment=require(_0x126d('0x1'));var BPromise=require(_0x126d('0x2'));var rs=require(_0x126d('0x3'));var fs=require('fs');var Redis=require(_0x126d('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x126d('0x5'))('rpc');var config=require(_0x126d('0x6'));var jayson=require(_0x126d('0x7'));var client=jayson[_0x126d('0x8')][_0x126d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2b4dfc,_0x4e5e87,_0x2e668c){return new BPromise(function(_0x25ccc2,_0x7d6e4c){return client[_0x126d('0xa')](_0x2b4dfc,_0x2e668c)[_0x126d('0xb')](function(_0x1cf6fb){logger[_0x126d('0xc')]('SmsTransferReport,\x20%s,\x20%s',_0x4e5e87,_0x126d('0xd'));logger[_0x126d('0xe')](_0x126d('0xf'),_0x4e5e87,_0x126d('0xd'),JSON[_0x126d('0x10')](_0x1cf6fb));if(_0x1cf6fb['error']){if(_0x1cf6fb[_0x126d('0x11')]['code']===0x1f4){logger[_0x126d('0x11')](_0x126d('0x12'),_0x4e5e87,_0x1cf6fb[_0x126d('0x11')]['message']);return _0x7d6e4c(_0x1cf6fb[_0x126d('0x11')][_0x126d('0x13')]);}logger[_0x126d('0x11')]('SmsTransferReport,\x20%s,\x20%s',_0x4e5e87,_0x1cf6fb['error'][_0x126d('0x13')]);return _0x25ccc2(_0x1cf6fb[_0x126d('0x11')][_0x126d('0x13')]);}else{logger[_0x126d('0xc')](_0x126d('0x12'),_0x4e5e87,_0x126d('0xd'));_0x25ccc2(_0x1cf6fb['result'][_0x126d('0x13')]);}})['catch'](function(_0x352d72){logger['error'](_0x126d('0x12'),_0x4e5e87,_0x352d72);_0x7d6e4c(_0x352d72);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index cb5d2c6..99f813f 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 _0x2346=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','get','/:id','show','download','join','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','basename','extname','post','single','file','create','put','update','delete','exports','multer','util','path'];(function(_0x522302,_0x6cf3d1){var _0x1248b7=function(_0xa5e55){while(--_0xa5e55){_0x522302['push'](_0x522302['shift']());}};_0x1248b7(++_0x6cf3d1);}(_0x2346,0x171));var _0x6234=function(_0x962fc5,_0x58f074){_0x962fc5=_0x962fc5-0x0;var _0x43667c=_0x2346[_0x962fc5];return _0x43667c;};'use strict';var multer=require(_0x6234('0x0'));var util=require(_0x6234('0x1'));var path=require(_0x6234('0x2'));var timeout=require(_0x6234('0x3'));var express=require(_0x6234('0x4'));var router=express[_0x6234('0x5')]();var fs_extra=require(_0x6234('0x6'));var auth=require(_0x6234('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x6234('0x8'));var controller=require('./sound.controller');router['get']('/',auth[_0x6234('0x9')](),controller['index']);router[_0x6234('0xa')](_0x6234('0xb'),auth[_0x6234('0x9')](),controller[_0x6234('0xc')]);router[_0x6234('0xa')]('/:id/download',auth[_0x6234('0x9')](),controller[_0x6234('0xd')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5be9a9,_0x5f196a,_0x41a431){_0x41a431(null,path[_0x6234('0xe')](config[_0x6234('0xf')],_0x6234('0x10')));},'filename':function(_0xadf7d1,_0x44bd45,_0x1bcce3){_0x44bd45[_0x6234('0x11')]=_0x44bd45[_0x6234('0x11')][_0x6234('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1bcce3(null,util[_0x6234('0x13')](_0x6234('0x14'),path[_0x6234('0x15')](_0x44bd45['originalname'],path[_0x6234('0x16')](_0x44bd45[_0x6234('0x11')])),Date['now'](),path[_0x6234('0x16')](_0x44bd45[_0x6234('0x11')])));}})});router[_0x6234('0x17')]('/',upload[_0x6234('0x18')](_0x6234('0x19')),controller[_0x6234('0x1a')]);router[_0x6234('0x1b')](_0x6234('0xb'),auth['isAuthenticated'](),controller[_0x6234('0x1c')]);router[_0x6234('0x1d')](_0x6234('0xb'),auth[_0x6234('0x9')](),controller[_0x6234('0x1d')]);module[_0x6234('0x1e')]=router; \ No newline at end of file +var _0x26d7=['join','root','server/files/sounds/original/','originalname','format','%s-%s%s','basename','extname','post','file','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','index','/:id','show','/:id/download','diskStorage'];(function(_0x390f42,_0xddf05){var _0x127f64=function(_0x20e457){while(--_0x20e457){_0x390f42['push'](_0x390f42['shift']());}};_0x127f64(++_0xddf05);}(_0x26d7,0x1dd));var _0x726d=function(_0x1b0926,_0x191416){_0x1b0926=_0x1b0926-0x0;var _0xd3471=_0x26d7[_0x1b0926];return _0xd3471;};'use strict';var multer=require(_0x726d('0x0'));var util=require(_0x726d('0x1'));var path=require(_0x726d('0x2'));var timeout=require(_0x726d('0x3'));var express=require(_0x726d('0x4'));var router=express[_0x726d('0x5')]();var fs_extra=require(_0x726d('0x6'));var auth=require(_0x726d('0x7'));var interaction=require(_0x726d('0x8'));var config=require(_0x726d('0x9'));var controller=require(_0x726d('0xa'));router[_0x726d('0xb')]('/',auth[_0x726d('0xc')](),controller[_0x726d('0xd')]);router['get'](_0x726d('0xe'),auth[_0x726d('0xc')](),controller[_0x726d('0xf')]);router['get'](_0x726d('0x10'),auth[_0x726d('0xc')](),controller['download']);var upload=multer({'storage':multer[_0x726d('0x11')]({'destination':function(_0x33128f,_0x16e40d,_0x5db6d6){_0x5db6d6(null,path[_0x726d('0x12')](config[_0x726d('0x13')],_0x726d('0x14')));},'filename':function(_0x3d224f,_0x29beb7,_0xa4e0f2){_0x29beb7['originalname']=_0x29beb7[_0x726d('0x15')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xa4e0f2(null,util[_0x726d('0x16')](_0x726d('0x17'),path[_0x726d('0x18')](_0x29beb7[_0x726d('0x15')],path[_0x726d('0x19')](_0x29beb7[_0x726d('0x15')])),Date['now'](),path[_0x726d('0x19')](_0x29beb7[_0x726d('0x15')])));}})});router[_0x726d('0x1a')]('/',upload['single'](_0x726d('0x1b')),controller[_0x726d('0x1c')]);router[_0x726d('0x1d')]('/:id',auth[_0x726d('0xc')](),controller[_0x726d('0x1e')]);router['delete'](_0x726d('0xe'),auth[_0x726d('0xc')](),controller[_0x726d('0x1f')]);module[_0x726d('0x20')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 9d9d8fb..1dd0fca 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 _0x1cbc=['sequelize','STRING','name','FLOAT','BIGINT','INTEGER'];(function(_0x45053f,_0x1156e4){var _0x51938f=function(_0x21fe73){while(--_0x21fe73){_0x45053f['push'](_0x45053f['shift']());}};_0x51938f(++_0x1156e4);}(_0x1cbc,0x186));var _0xc1cb=function(_0x5a0247,_0x4043d0){_0x5a0247=_0x5a0247-0x0;var _0x2197c6=_0x1cbc[_0x5a0247];return _0x2197c6;};'use strict';var Sequelize=require(_0xc1cb('0x0'));module['exports']={'name':{'type':Sequelize[_0xc1cb('0x1')],'unique':_0xc1cb('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0xc1cb('0x1')]},'display_name':{'type':Sequelize[_0xc1cb('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0xc1cb('0x1')]},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize[_0xc1cb('0x3')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize[_0xc1cb('0x1')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0xc1cb('0x4')]},'converted_channelCount':{'type':Sequelize[_0xc1cb('0x5')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x8359=['name','FLOAT','BIGINT','INTEGER','sequelize','exports','STRING'];(function(_0x2f3848,_0x48564d){var _0x102668=function(_0x5e32ab){while(--_0x5e32ab){_0x2f3848['push'](_0x2f3848['shift']());}};_0x102668(++_0x48564d);}(_0x8359,0x154));var _0x9835=function(_0x586c70,_0x4a8cb3){_0x586c70=_0x586c70-0x0;var _0x26db79=_0x8359[_0x586c70];return _0x26db79;};'use strict';var Sequelize=require(_0x9835('0x0'));module[_0x9835('0x1')]={'name':{'type':Sequelize[_0x9835('0x2')],'unique':_0x9835('0x3'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0x9835('0x2')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0x9835('0x2')]},'original_duration':{'type':Sequelize[_0x9835('0x4')]},'original_sampleCount':{'type':Sequelize[_0x9835('0x5')]},'original_channelCount':{'type':Sequelize[_0x9835('0x6')]},'original_bitRate':{'type':Sequelize[_0x9835('0x5')]},'original_sampleRate':{'type':Sequelize[_0x9835('0x6')]},'converted_format':{'type':Sequelize[_0x9835('0x2')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize[_0x9835('0x6')]},'converted_bitRate':{'type':Sequelize[_0x9835('0x5')]},'converted_sampleRate':{'type':Sequelize[_0x9835('0x6')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 0c48d5c..a6d6659 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 _0xdd16=['original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','0777','create','role','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','delete','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','get','Sounds','UserProfileResource','error','stack','name','send','index','map','Sound','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','VIRTUAL','options','include','rows','catch','show','find','download','params','save_name','converted_format','existsSync','root','server/files/sounds/converted','ValidationError','Sound\x20not\x20found','format','%s.%s','basename','originalname','extname','file','filename','substring','wav','join','Sound\x20upload\x20filepath:\x20%s','info','Sound\x20upload\x20destination:\x20%s','chmodSync','transcode','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount'];(function(_0x33bbcf,_0xe92b01){var _0x5e0e34=function(_0x49665c){while(--_0x49665c){_0x33bbcf['push'](_0x33bbcf['shift']());}};_0x5e0e34(++_0xe92b01);}(_0xdd16,0x18c));var _0x6dd1=function(_0x1fabd9,_0x1b6039){_0x1fabd9=_0x1fabd9-0x0;var _0x3baeb0=_0xdd16[_0x1fabd9];return _0x3baeb0;};'use strict';var emlformat=require(_0x6dd1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6dd1('0x1'));var jsonpatch=require(_0x6dd1('0x2'));var rp=require(_0x6dd1('0x3'));var moment=require(_0x6dd1('0x4'));var BPromise=require(_0x6dd1('0x5'));var Mustache=require(_0x6dd1('0x6'));var util=require('util');var path=require('path');var sox=require(_0x6dd1('0x7'));var csv=require(_0x6dd1('0x8'));var ejs=require(_0x6dd1('0x9'));var fs=require('fs');var fs_extra=require(_0x6dd1('0xa'));var _=require(_0x6dd1('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6dd1('0xc'));var deskjs=require(_0x6dd1('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6dd1('0xe'));var Papa=require(_0x6dd1('0xf'));var Redis=require(_0x6dd1('0x10'));var authService=require(_0x6dd1('0x11'));var qs=require(_0x6dd1('0x12'));var as=require(_0x6dd1('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6dd1('0x14'));var utils=require('../../config/utils');var config=require(_0x6dd1('0x15'));var licenseUtil=require(_0x6dd1('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4b4b6a,_0x1d4064){_0x1d4064=_0x1d4064||0xcc;return function(_0x4e90e4){if(_0x4e90e4){return _0x4b4b6a[_0x6dd1('0x17')](_0x1d4064);}return _0x4b4b6a['status'](_0x1d4064)[_0x6dd1('0x18')]();};}function respondWithResult(_0x13adc0,_0x5a0fd0){_0x5a0fd0=_0x5a0fd0||0xc8;return function(_0xd2dcde){if(_0xd2dcde){return _0x13adc0[_0x6dd1('0x19')](_0x5a0fd0)[_0x6dd1('0x1a')](_0xd2dcde);}};}function respondWithFilteredResult(_0x3d67e4,_0x417278){return function(_0x487be9){if(_0x487be9){var _0x502aa5=typeof _0x417278[_0x6dd1('0x1b')]===_0x6dd1('0x1c')&&typeof _0x417278[_0x6dd1('0x1d')]===_0x6dd1('0x1c');var _0x48bd31=_0x487be9[_0x6dd1('0x1e')];var _0x15d0de=_0x502aa5?0x0:_0x417278[_0x6dd1('0x1b')];var _0x23c443=_0x502aa5?_0x487be9[_0x6dd1('0x1e')]:_0x417278['offset']+_0x417278['limit'];var _0x17186c;if(_0x23c443>=_0x48bd31){_0x23c443=_0x48bd31;_0x17186c=0xc8;}else{_0x17186c=0xce;}_0x3d67e4[_0x6dd1('0x19')](_0x17186c);return _0x3d67e4['set'](_0x6dd1('0x1f'),_0x15d0de+'-'+_0x23c443+'/'+_0x48bd31)[_0x6dd1('0x1a')](_0x487be9);}return null;};}function patchUpdates(_0x901e4e){return function(_0x2c0d92){try{jsonpatch[_0x6dd1('0x20')](_0x2c0d92,_0x901e4e,!![]);}catch(_0x428cdf){return BPromise[_0x6dd1('0x21')](_0x428cdf);}return _0x2c0d92['save']();};}function saveUpdates(_0xd62198,_0x714366){return function(_0x250d8a){if(_0x250d8a){return _0x250d8a[_0x6dd1('0x22')](_0xd62198)[_0x6dd1('0x23')](function(_0x522bbb){return _0x522bbb;});}return null;};}function removeEntity(_0x2c8037,_0xe0f723){return function(_0x5e3ec3){if(_0x5e3ec3){return _0x5e3ec3['destroy']()['then'](function(){var _0x385798=_0x5e3ec3[_0x6dd1('0x24')]({'plain':!![]});var _0x3e63ba=_0x6dd1('0x25');return db[_0x6dd1('0x26')]['destroy']({'where':{'type':_0x3e63ba,'resourceId':_0x385798['id']}})[_0x6dd1('0x23')](function(){return _0x5e3ec3;});})[_0x6dd1('0x23')](function(){_0x2c8037[_0x6dd1('0x19')](0xcc)[_0x6dd1('0x18')]();});}};}function handleEntityNotFound(_0x646159,_0x45be08){return function(_0x38d106){if(!_0x38d106){_0x646159['sendStatus'](0x194);}return _0x38d106;};}function handleError(_0x46b60d,_0x48dd37){_0x48dd37=_0x48dd37||0x1f4;return function(_0x3c5fa8){logger[_0x6dd1('0x27')](_0x3c5fa8[_0x6dd1('0x28')]);if(_0x3c5fa8['name']){delete _0x3c5fa8[_0x6dd1('0x29')];}_0x46b60d[_0x6dd1('0x19')](_0x48dd37)[_0x6dd1('0x2a')](_0x3c5fa8);};}exports[_0x6dd1('0x2b')]=function(_0xf0a4cb,_0x2ea80e){var _0x2b148b={},_0x5adc8c={},_0x3a0c85={'count':0x0,'rows':[]};var _0x7ad040=_[_0x6dd1('0x2c')](db[_0x6dd1('0x2d')][_0x6dd1('0x2e')],function(_0x42d648){return{'name':_0x42d648[_0x6dd1('0x2f')],'type':_0x42d648[_0x6dd1('0x30')][_0x6dd1('0x31')]};});_0x5adc8c[_0x6dd1('0x32')]=_[_0x6dd1('0x2c')](_0x7ad040,_0x6dd1('0x29'));_0x5adc8c['query']=_[_0x6dd1('0x33')](_0xf0a4cb[_0x6dd1('0x34')]);_0x5adc8c[_0x6dd1('0x35')]=_[_0x6dd1('0x36')](_0x5adc8c[_0x6dd1('0x32')],_0x5adc8c[_0x6dd1('0x34')]);_0x2b148b[_0x6dd1('0x37')]=_['intersection'](_0x5adc8c['model'],qs['fields'](_0xf0a4cb[_0x6dd1('0x34')][_0x6dd1('0x38')]));_0x2b148b[_0x6dd1('0x37')]=_0x2b148b[_0x6dd1('0x37')][_0x6dd1('0x39')]?_0x2b148b[_0x6dd1('0x37')]:_0x5adc8c[_0x6dd1('0x32')];if(!_0xf0a4cb[_0x6dd1('0x34')][_0x6dd1('0x3a')]('nolimit')){_0x2b148b[_0x6dd1('0x1d')]=qs[_0x6dd1('0x1d')](_0xf0a4cb[_0x6dd1('0x34')][_0x6dd1('0x1d')]);_0x2b148b[_0x6dd1('0x1b')]=qs['offset'](_0xf0a4cb[_0x6dd1('0x34')][_0x6dd1('0x1b')]);}_0x2b148b['order']=qs[_0x6dd1('0x3b')](_0xf0a4cb[_0x6dd1('0x34')][_0x6dd1('0x3b')]);_0x2b148b['where']=qs[_0x6dd1('0x35')](_[_0x6dd1('0x3c')](_0xf0a4cb[_0x6dd1('0x34')],_0x5adc8c['filters']),_0x7ad040);if(_0xf0a4cb[_0x6dd1('0x34')][_0x6dd1('0x3d')]){_0x2b148b[_0x6dd1('0x3e')]=_['merge'](_0x2b148b[_0x6dd1('0x3e')],{'$or':_[_0x6dd1('0x2c')](_0x7ad040,function(_0x172b7d){if(_0x172b7d[_0x6dd1('0x30')]!==_0x6dd1('0x3f')){var _0x52c587={};_0x52c587[_0x172b7d['name']]={'$like':'%'+_0xf0a4cb[_0x6dd1('0x34')][_0x6dd1('0x3d')]+'%'};return _0x52c587;}})});}_0x2b148b=_['merge']({},_0x2b148b,_0xf0a4cb[_0x6dd1('0x40')]);var _0x54fee6={'where':_0x2b148b[_0x6dd1('0x3e')]};return db['Sound']['count'](_0x54fee6)['then'](function(_0x28c232){_0x3a0c85[_0x6dd1('0x1e')]=_0x28c232;if(_0xf0a4cb['query']['includeAll']){_0x2b148b[_0x6dd1('0x41')]=[{'all':!![]}];}return db[_0x6dd1('0x2d')]['findAll'](_0x2b148b);})[_0x6dd1('0x23')](function(_0x5d06ed){_0x3a0c85[_0x6dd1('0x42')]=_0x5d06ed;return _0x3a0c85;})[_0x6dd1('0x23')](respondWithFilteredResult(_0x2ea80e,_0x2b148b))[_0x6dd1('0x43')](handleError(_0x2ea80e,null));};exports[_0x6dd1('0x44')]=function(_0x24177a,_0x370832){var _0x26abe9={'raw':!![],'where':{'id':_0x24177a['params']['id']}},_0x386ea1={};_0x386ea1[_0x6dd1('0x32')]=_[_0x6dd1('0x33')](db['Sound'][_0x6dd1('0x2e')]);_0x386ea1[_0x6dd1('0x34')]=_[_0x6dd1('0x33')](_0x24177a[_0x6dd1('0x34')]);_0x386ea1['filters']=_[_0x6dd1('0x36')](_0x386ea1[_0x6dd1('0x32')],_0x386ea1[_0x6dd1('0x34')]);_0x26abe9[_0x6dd1('0x37')]=_[_0x6dd1('0x36')](_0x386ea1[_0x6dd1('0x32')],qs[_0x6dd1('0x38')](_0x24177a['query'][_0x6dd1('0x38')]));_0x26abe9['attributes']=_0x26abe9[_0x6dd1('0x37')][_0x6dd1('0x39')]?_0x26abe9[_0x6dd1('0x37')]:_0x386ea1[_0x6dd1('0x32')];if(_0x24177a[_0x6dd1('0x34')]['includeAll']){_0x26abe9[_0x6dd1('0x41')]=[{'all':!![]}];}_0x26abe9=_['merge']({},_0x26abe9,_0x24177a[_0x6dd1('0x40')]);return db[_0x6dd1('0x2d')][_0x6dd1('0x45')](_0x26abe9)['then'](handleEntityNotFound(_0x370832,null))[_0x6dd1('0x23')](respondWithResult(_0x370832,null))[_0x6dd1('0x43')](handleError(_0x370832,null));};exports[_0x6dd1('0x46')]=function(_0x49cbf5,_0x459978,_0x471bb2){return db[_0x6dd1('0x2d')][_0x6dd1('0x45')]({'where':{'id':_0x49cbf5[_0x6dd1('0x47')]['id']},'attributes':['name',_0x6dd1('0x48'),_0x6dd1('0x49')],'raw':!![]})[_0x6dd1('0x23')](handleEntityNotFound(_0x459978,null))['then'](function(_0x54d918){if(_0x54d918){if(!fs[_0x6dd1('0x4a')](path['join'](config[_0x6dd1('0x4b')],_0x6dd1('0x4c'),_0x54d918[_0x6dd1('0x48')]+'.'+_0x54d918[_0x6dd1('0x49')]))){throw new db['Sequelize'][(_0x6dd1('0x4d'))](_0x6dd1('0x4e'));}return _0x459978[_0x6dd1('0x46')](path['join'](config[_0x6dd1('0x4b')],_0x6dd1('0x4c'),util[_0x6dd1('0x4f')](_0x6dd1('0x50'),_0x54d918[_0x6dd1('0x48')],_0x54d918[_0x6dd1('0x49')])),util['format'](_0x6dd1('0x50'),_0x54d918[_0x6dd1('0x29')],_0x54d918['converted_format']));}return null;})[_0x6dd1('0x43')](handleError(_0x459978,null));};exports['create']=function(_0x21822c,_0x1f49a8,_0xb0dd6f){var _0xa21054={'name':path[_0x6dd1('0x51')](_0x21822c['file'][_0x6dd1('0x52')],path[_0x6dd1('0x53')](_0x21822c['file'][_0x6dd1('0x52')])),'save_name':path[_0x6dd1('0x51')](_0x21822c[_0x6dd1('0x54')]['filename'],path[_0x6dd1('0x53')](_0x21822c[_0x6dd1('0x54')][_0x6dd1('0x55')])),'original_format':path['extname'](_0x21822c[_0x6dd1('0x54')][_0x6dd1('0x52')])[_0x6dd1('0x56')](0x1),'converted_format':_0x6dd1('0x57')};var _0x20027f=path[_0x6dd1('0x58')](config['root'],'server/files/sounds/original',_0x21822c[_0x6dd1('0x54')]['filename']);var _0x53570b=path[_0x6dd1('0x58')](config[_0x6dd1('0x4b')],_0x6dd1('0x4c'),util[_0x6dd1('0x4f')](_0x6dd1('0x50'),path[_0x6dd1('0x51')](_0x21822c[_0x6dd1('0x54')][_0x6dd1('0x55')],path[_0x6dd1('0x53')](_0x21822c[_0x6dd1('0x54')][_0x6dd1('0x55')])),_0xa21054[_0x6dd1('0x49')]));logger['info'](_0x6dd1('0x59'),_0x20027f);logger[_0x6dd1('0x5a')](_0x6dd1('0x5b'),_0x53570b);try{fs[_0x6dd1('0x5c')](_0x20027f,parseInt('0777',0x8));var _0x44a12d=sox[_0x6dd1('0x5d')](_0x20027f,_0x53570b,{'sampleRate':0x1f40,'format':_0x6dd1('0x57'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x44a12d['on']('error',function(_0x1555e3){fs[_0x6dd1('0x5e')](_0x20027f);_0x1f49a8['status'](0x1f4)[_0x6dd1('0x2a')](_0x1555e3);});_0x44a12d['on'](_0x6dd1('0x5f'),function(_0x562ac5){_0xa21054[_0x6dd1('0x60')]=isNaN(_0x562ac5['duration'])?null:_0x562ac5[_0x6dd1('0x61')]*0x3e8;_0xa21054[_0x6dd1('0x62')]=isNaN(_0x562ac5[_0x6dd1('0x63')])?null:_0x562ac5[_0x6dd1('0x63')];_0xa21054[_0x6dd1('0x64')]=isNaN(_0x562ac5['channelCount'])?null:_0x562ac5[_0x6dd1('0x65')];_0xa21054[_0x6dd1('0x66')]=isNaN(_0x562ac5[_0x6dd1('0x67')])?null:_0x562ac5[_0x6dd1('0x67')];_0xa21054[_0x6dd1('0x68')]=isNaN(_0x562ac5[_0x6dd1('0x69')])?null:_0x562ac5[_0x6dd1('0x69')];});_0x44a12d['on']('dest',function(_0x5e216f){_0xa21054[_0x6dd1('0x6a')]=isNaN(_0x5e216f[_0x6dd1('0x61')])?null:_0x5e216f[_0x6dd1('0x61')]*0x3e8;_0xa21054[_0x6dd1('0x6b')]=isNaN(_0x5e216f[_0x6dd1('0x63')])?null:_0x5e216f[_0x6dd1('0x63')];_0xa21054[_0x6dd1('0x6c')]=isNaN(_0x5e216f[_0x6dd1('0x65')])?null:_0x5e216f[_0x6dd1('0x65')];_0xa21054[_0x6dd1('0x6d')]=isNaN(_0x5e216f[_0x6dd1('0x67')])?null:_0x5e216f[_0x6dd1('0x67')];_0xa21054[_0x6dd1('0x6e')]=isNaN(_0x5e216f[_0x6dd1('0x69')])?null:_0x5e216f['sampleRate'];});_0x44a12d['on']('end',function(){fs[_0x6dd1('0x5c')](_0x53570b,parseInt(_0x6dd1('0x6f'),0x8));return db['Sound'][_0x6dd1('0x70')](_0xa21054)[_0x6dd1('0x23')](function(_0x23f5fd){var _0x52cad9={'role':_0x21822c['body'][_0x6dd1('0x71')],'userProfileId':_0x21822c[_0x6dd1('0x72')]['userProfileId']};if(!_0x52cad9)throw new Error(_0x6dd1('0x73'));if(_0x52cad9[_0x6dd1('0x71')]==='user'){var _0x241313=_0x23f5fd['get']({'plain':!![]});return db[_0x6dd1('0x74')][_0x6dd1('0x45')]({'where':{'name':'Sounds','userProfileId':_0x52cad9[_0x6dd1('0x75')]},'raw':!![]})['then'](function(_0x532d97){if(_0x532d97&&_0x532d97[_0x6dd1('0x76')]===0x0){return db['UserProfileResource']['create']({'name':_0x241313[_0x6dd1('0x29')],'resourceId':_0x241313['id'],'type':_0x532d97[_0x6dd1('0x29')],'sectionId':_0x532d97['id']},{})['then'](function(){return _0x23f5fd;});}else{return _0x23f5fd;}})[_0x6dd1('0x43')](function(_0x3019fe){logger['error'](_0x6dd1('0x77'),_0x3019fe);throw _0x3019fe;});}return _0x23f5fd;})[_0x6dd1('0x23')](respondWithResult(_0x1f49a8,null))[_0x6dd1('0x43')](handleError(_0x1f49a8,null));});_0x44a12d[_0x6dd1('0x78')]();}catch(_0x2d407c){_0x1f49a8[_0x6dd1('0x19')](0x1f4)[_0x6dd1('0x2a')](_0x2d407c);}};exports['update']=function(_0x3334a8,_0x146ddc,_0x4098d2){return db[_0x6dd1('0x2d')]['find']({'where':{'id':_0x3334a8['params']['id']}})[_0x6dd1('0x23')](handleEntityNotFound(_0x146ddc,null))[_0x6dd1('0x23')](saveUpdates(_['pick'](_0x3334a8['body'],[_0x6dd1('0x29'),_0x6dd1('0x79')]),null))['then'](respondWithResult(_0x146ddc,null))[_0x6dd1('0x43')](handleError(_0x146ddc,null));};exports[_0x6dd1('0x7a')]=function(_0x1bbc89,_0x335cf0,_0x3d280b){return db[_0x6dd1('0x2d')][_0x6dd1('0x45')]({'where':{'id':_0x1bbc89['params']['id']}})[_0x6dd1('0x23')](function(_0x35668b){if(_0x35668b){return _0x35668b[_0x6dd1('0x7b')]();}})[_0x6dd1('0x23')](function(_0x47df8){var _0x341647=path['join'](config[_0x6dd1('0x4b')],'server/files/sounds/original',util[_0x6dd1('0x4f')](_0x6dd1('0x50'),_0x47df8[_0x6dd1('0x48')],_0x47df8['original_format']));var _0x48f4e8=path['join'](config[_0x6dd1('0x4b')],_0x6dd1('0x4c'),util[_0x6dd1('0x4f')](_0x6dd1('0x50'),_0x47df8[_0x6dd1('0x48')],_0x47df8[_0x6dd1('0x49')]));fs['unlinkSync'](_0x341647);fs[_0x6dd1('0x5e')](_0x48f4e8);return _0x47df8;})['then'](function(_0x59a5b5){if(_0x59a5b5){return _0x335cf0[_0x6dd1('0x19')](0xcc)['end']();}})['then'](handleEntityNotFound(_0x335cf0,null))[_0x6dd1('0x43')](handleError(_0x335cf0,null));}; \ No newline at end of file +var _0xd903=['save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','nolimit','order','sort','pick','filter','merge','VIRTUAL','where','Sound','includeAll','findAll','rows','params','include','find','download','save_name','converted_format','existsSync','join','root','Sequelize','ValidationError','Sound\x20not\x20found','server/files/sounds/converted','format','%s.%s','create','basename','file','originalname','extname','filename','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','0777','transcode','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','sampleRate','dest','converted_channelCount','converted_bitRate','converted_sampleRate','chmodSync','role','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Sounds','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','original_format','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject'];(function(_0x3d2485,_0x1dfbdc){var _0x2dd00a=function(_0x2cd868){while(--_0x2cd868){_0x3d2485['push'](_0x3d2485['shift']());}};_0x2dd00a(++_0x1dfbdc);}(_0xd903,0x1d1));var _0x3d90=function(_0x1c5be4,_0x1125ec){_0x1c5be4=_0x1c5be4-0x0;var _0x459592=_0xd903[_0x1c5be4];return _0x459592;};'use strict';var emlformat=require(_0x3d90('0x0'));var rimraf=require(_0x3d90('0x1'));var zipdir=require(_0x3d90('0x2'));var jsonpatch=require(_0x3d90('0x3'));var rp=require('request-promise');var moment=require(_0x3d90('0x4'));var BPromise=require(_0x3d90('0x5'));var Mustache=require(_0x3d90('0x6'));var util=require(_0x3d90('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x3d90('0x8'));var ejs=require(_0x3d90('0x9'));var fs=require('fs');var fs_extra=require(_0x3d90('0xa'));var _=require('lodash');var squel=require(_0x3d90('0xb'));var crypto=require(_0x3d90('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3d90('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3d90('0xe'));var Redis=require('ioredis');var authService=require(_0x3d90('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x3d90('0x10'));var hardwareService=require(_0x3d90('0x11'));var logger=require(_0x3d90('0x12'))(_0x3d90('0x13'));var utils=require(_0x3d90('0x14'));var config=require(_0x3d90('0x15'));var licenseUtil=require(_0x3d90('0x16'));var db=require(_0x3d90('0x17'))['db'];function respondWithStatusCode(_0xddec2f,_0x5ba587){_0x5ba587=_0x5ba587||0xcc;return function(_0x2462eb){if(_0x2462eb){return _0xddec2f[_0x3d90('0x18')](_0x5ba587);}return _0xddec2f[_0x3d90('0x19')](_0x5ba587)[_0x3d90('0x1a')]();};}function respondWithResult(_0x17f7fa,_0x3d8135){_0x3d8135=_0x3d8135||0xc8;return function(_0x4621ce){if(_0x4621ce){return _0x17f7fa[_0x3d90('0x19')](_0x3d8135)['json'](_0x4621ce);}};}function respondWithFilteredResult(_0x5e543c,_0x3668f7){return function(_0x5bf81c){if(_0x5bf81c){var _0x5f1502=typeof _0x3668f7[_0x3d90('0x1b')]===_0x3d90('0x1c')&&typeof _0x3668f7[_0x3d90('0x1d')]===_0x3d90('0x1c');var _0x41e006=_0x5bf81c['count'];var _0x359362=_0x5f1502?0x0:_0x3668f7[_0x3d90('0x1b')];var _0x2d82e6=_0x5f1502?_0x5bf81c[_0x3d90('0x1e')]:_0x3668f7[_0x3d90('0x1b')]+_0x3668f7['limit'];var _0x25b79f;if(_0x2d82e6>=_0x41e006){_0x2d82e6=_0x41e006;_0x25b79f=0xc8;}else{_0x25b79f=0xce;}_0x5e543c['status'](_0x25b79f);return _0x5e543c[_0x3d90('0x1f')](_0x3d90('0x20'),_0x359362+'-'+_0x2d82e6+'/'+_0x41e006)[_0x3d90('0x21')](_0x5bf81c);}return null;};}function patchUpdates(_0x1273dd){return function(_0x2be970){try{jsonpatch['apply'](_0x2be970,_0x1273dd,!![]);}catch(_0x3dcf48){return BPromise[_0x3d90('0x22')](_0x3dcf48);}return _0x2be970[_0x3d90('0x23')]();};}function saveUpdates(_0x2cc9a4,_0x3b51cd){return function(_0x5bfb04){if(_0x5bfb04){return _0x5bfb04[_0x3d90('0x24')](_0x2cc9a4)[_0x3d90('0x25')](function(_0x4eb19b){return _0x4eb19b;});}return null;};}function removeEntity(_0x338103,_0x16a716){return function(_0x37a645){if(_0x37a645){return _0x37a645[_0x3d90('0x26')]()[_0x3d90('0x25')](function(){var _0x129131=_0x37a645[_0x3d90('0x27')]({'plain':!![]});var _0x4970de='Sounds';return db[_0x3d90('0x28')][_0x3d90('0x26')]({'where':{'type':_0x4970de,'resourceId':_0x129131['id']}})['then'](function(){return _0x37a645;});})[_0x3d90('0x25')](function(){_0x338103['status'](0xcc)[_0x3d90('0x1a')]();});}};}function handleEntityNotFound(_0x3f10fd,_0x5b01f3){return function(_0x461666){if(!_0x461666){_0x3f10fd[_0x3d90('0x18')](0x194);}return _0x461666;};}function handleError(_0x3dadcb,_0x30707c){_0x30707c=_0x30707c||0x1f4;return function(_0x38749a){logger[_0x3d90('0x29')](_0x38749a[_0x3d90('0x2a')]);if(_0x38749a[_0x3d90('0x2b')]){delete _0x38749a[_0x3d90('0x2b')];}_0x3dadcb[_0x3d90('0x19')](_0x30707c)[_0x3d90('0x2c')](_0x38749a);};}exports[_0x3d90('0x2d')]=function(_0x588418,_0x2981b3){var _0x17ae0e={},_0xd5907e={},_0x22f687={'count':0x0,'rows':[]};var _0x7e80b5=_[_0x3d90('0x2e')](db['Sound'][_0x3d90('0x2f')],function(_0x8725b0){return{'name':_0x8725b0[_0x3d90('0x30')],'type':_0x8725b0[_0x3d90('0x31')][_0x3d90('0x32')]};});_0xd5907e[_0x3d90('0x33')]=_[_0x3d90('0x2e')](_0x7e80b5,'name');_0xd5907e[_0x3d90('0x34')]=_['keys'](_0x588418[_0x3d90('0x34')]);_0xd5907e[_0x3d90('0x35')]=_['intersection'](_0xd5907e['model'],_0xd5907e['query']);_0x17ae0e[_0x3d90('0x36')]=_[_0x3d90('0x37')](_0xd5907e['model'],qs[_0x3d90('0x38')](_0x588418['query'][_0x3d90('0x38')]));_0x17ae0e['attributes']=_0x17ae0e[_0x3d90('0x36')][_0x3d90('0x39')]?_0x17ae0e[_0x3d90('0x36')]:_0xd5907e[_0x3d90('0x33')];if(!_0x588418['query']['hasOwnProperty'](_0x3d90('0x3a'))){_0x17ae0e[_0x3d90('0x1d')]=qs[_0x3d90('0x1d')](_0x588418[_0x3d90('0x34')]['limit']);_0x17ae0e[_0x3d90('0x1b')]=qs[_0x3d90('0x1b')](_0x588418[_0x3d90('0x34')]['offset']);}_0x17ae0e[_0x3d90('0x3b')]=qs[_0x3d90('0x3c')](_0x588418['query'][_0x3d90('0x3c')]);_0x17ae0e['where']=qs[_0x3d90('0x35')](_[_0x3d90('0x3d')](_0x588418['query'],_0xd5907e[_0x3d90('0x35')]),_0x7e80b5);if(_0x588418[_0x3d90('0x34')][_0x3d90('0x3e')]){_0x17ae0e['where']=_[_0x3d90('0x3f')](_0x17ae0e['where'],{'$or':_[_0x3d90('0x2e')](_0x7e80b5,function(_0x39aef4){if(_0x39aef4[_0x3d90('0x31')]!==_0x3d90('0x40')){var _0x41779b={};_0x41779b[_0x39aef4[_0x3d90('0x2b')]]={'$like':'%'+_0x588418[_0x3d90('0x34')][_0x3d90('0x3e')]+'%'};return _0x41779b;}})});}_0x17ae0e=_[_0x3d90('0x3f')]({},_0x17ae0e,_0x588418['options']);var _0xbd3887={'where':_0x17ae0e[_0x3d90('0x41')]};return db[_0x3d90('0x42')]['count'](_0xbd3887)['then'](function(_0x29c154){_0x22f687[_0x3d90('0x1e')]=_0x29c154;if(_0x588418['query'][_0x3d90('0x43')]){_0x17ae0e['include']=[{'all':!![]}];}return db[_0x3d90('0x42')][_0x3d90('0x44')](_0x17ae0e);})[_0x3d90('0x25')](function(_0x3b4397){_0x22f687[_0x3d90('0x45')]=_0x3b4397;return _0x22f687;})[_0x3d90('0x25')](respondWithFilteredResult(_0x2981b3,_0x17ae0e))['catch'](handleError(_0x2981b3,null));};exports['show']=function(_0x31dacb,_0x1439bc){var _0x575cd8={'raw':!![],'where':{'id':_0x31dacb[_0x3d90('0x46')]['id']}},_0x2650a9={};_0x2650a9[_0x3d90('0x33')]=_['keys'](db[_0x3d90('0x42')][_0x3d90('0x2f')]);_0x2650a9[_0x3d90('0x34')]=_['keys'](_0x31dacb[_0x3d90('0x34')]);_0x2650a9['filters']=_[_0x3d90('0x37')](_0x2650a9['model'],_0x2650a9['query']);_0x575cd8[_0x3d90('0x36')]=_[_0x3d90('0x37')](_0x2650a9[_0x3d90('0x33')],qs['fields'](_0x31dacb['query']['fields']));_0x575cd8[_0x3d90('0x36')]=_0x575cd8[_0x3d90('0x36')][_0x3d90('0x39')]?_0x575cd8[_0x3d90('0x36')]:_0x2650a9['model'];if(_0x31dacb[_0x3d90('0x34')][_0x3d90('0x43')]){_0x575cd8[_0x3d90('0x47')]=[{'all':!![]}];}_0x575cd8=_['merge']({},_0x575cd8,_0x31dacb['options']);return db['Sound'][_0x3d90('0x48')](_0x575cd8)[_0x3d90('0x25')](handleEntityNotFound(_0x1439bc,null))['then'](respondWithResult(_0x1439bc,null))['catch'](handleError(_0x1439bc,null));};exports[_0x3d90('0x49')]=function(_0x240d8a,_0x466ba1,_0x3354d2){return db['Sound'][_0x3d90('0x48')]({'where':{'id':_0x240d8a[_0x3d90('0x46')]['id']},'attributes':[_0x3d90('0x2b'),_0x3d90('0x4a'),_0x3d90('0x4b')],'raw':!![]})[_0x3d90('0x25')](handleEntityNotFound(_0x466ba1,null))[_0x3d90('0x25')](function(_0x3c0920){if(_0x3c0920){if(!fs[_0x3d90('0x4c')](path[_0x3d90('0x4d')](config[_0x3d90('0x4e')],'server/files/sounds/converted',_0x3c0920[_0x3d90('0x4a')]+'.'+_0x3c0920[_0x3d90('0x4b')]))){throw new db[(_0x3d90('0x4f'))][(_0x3d90('0x50'))](_0x3d90('0x51'));}return _0x466ba1['download'](path[_0x3d90('0x4d')](config[_0x3d90('0x4e')],_0x3d90('0x52'),util[_0x3d90('0x53')](_0x3d90('0x54'),_0x3c0920[_0x3d90('0x4a')],_0x3c0920[_0x3d90('0x4b')])),util[_0x3d90('0x53')](_0x3d90('0x54'),_0x3c0920[_0x3d90('0x2b')],_0x3c0920['converted_format']));}return null;})['catch'](handleError(_0x466ba1,null));};exports[_0x3d90('0x55')]=function(_0x484837,_0x4ef6f5,_0x1b8e10){var _0x3994c4={'name':path[_0x3d90('0x56')](_0x484837[_0x3d90('0x57')][_0x3d90('0x58')],path[_0x3d90('0x59')](_0x484837[_0x3d90('0x57')][_0x3d90('0x58')])),'save_name':path['basename'](_0x484837['file'][_0x3d90('0x5a')],path[_0x3d90('0x59')](_0x484837[_0x3d90('0x57')][_0x3d90('0x5a')])),'original_format':path['extname'](_0x484837[_0x3d90('0x57')][_0x3d90('0x58')])[_0x3d90('0x5b')](0x1),'converted_format':_0x3d90('0x5c')};var _0x4afc36=path[_0x3d90('0x4d')](config[_0x3d90('0x4e')],_0x3d90('0x5d'),_0x484837[_0x3d90('0x57')]['filename']);var _0x1a5dc9=path[_0x3d90('0x4d')](config['root'],'server/files/sounds/converted',util[_0x3d90('0x53')](_0x3d90('0x54'),path[_0x3d90('0x56')](_0x484837[_0x3d90('0x57')]['filename'],path['extname'](_0x484837['file']['filename'])),_0x3994c4[_0x3d90('0x4b')]));logger[_0x3d90('0x5e')](_0x3d90('0x5f'),_0x4afc36);logger[_0x3d90('0x5e')]('Sound\x20upload\x20destination:\x20%s',_0x1a5dc9);try{fs['chmodSync'](_0x4afc36,parseInt(_0x3d90('0x60'),0x8));var _0x172223=sox[_0x3d90('0x61')](_0x4afc36,_0x1a5dc9,{'sampleRate':0x1f40,'format':_0x3d90('0x5c'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x172223['on'](_0x3d90('0x29'),function(_0x3b7f62){fs[_0x3d90('0x62')](_0x4afc36);_0x4ef6f5['status'](0x1f4)[_0x3d90('0x2c')](_0x3b7f62);});_0x172223['on'](_0x3d90('0x63'),function(_0x3da1dc){_0x3994c4[_0x3d90('0x64')]=isNaN(_0x3da1dc[_0x3d90('0x65')])?null:_0x3da1dc[_0x3d90('0x65')]*0x3e8;_0x3994c4[_0x3d90('0x66')]=isNaN(_0x3da1dc[_0x3d90('0x67')])?null:_0x3da1dc[_0x3d90('0x67')];_0x3994c4[_0x3d90('0x68')]=isNaN(_0x3da1dc['channelCount'])?null:_0x3da1dc[_0x3d90('0x69')];_0x3994c4[_0x3d90('0x6a')]=isNaN(_0x3da1dc[_0x3d90('0x6b')])?null:_0x3da1dc[_0x3d90('0x6b')];_0x3994c4['original_sampleRate']=isNaN(_0x3da1dc[_0x3d90('0x6c')])?null:_0x3da1dc[_0x3d90('0x6c')];});_0x172223['on'](_0x3d90('0x6d'),function(_0x1dd43e){_0x3994c4['converted_duration']=isNaN(_0x1dd43e['duration'])?null:_0x1dd43e[_0x3d90('0x65')]*0x3e8;_0x3994c4['converted_sampleCount']=isNaN(_0x1dd43e['sampleCount'])?null:_0x1dd43e[_0x3d90('0x67')];_0x3994c4[_0x3d90('0x6e')]=isNaN(_0x1dd43e['channelCount'])?null:_0x1dd43e['channelCount'];_0x3994c4[_0x3d90('0x6f')]=isNaN(_0x1dd43e['bitRate'])?null:_0x1dd43e[_0x3d90('0x6b')];_0x3994c4[_0x3d90('0x70')]=isNaN(_0x1dd43e[_0x3d90('0x6c')])?null:_0x1dd43e[_0x3d90('0x6c')];});_0x172223['on'](_0x3d90('0x1a'),function(){fs[_0x3d90('0x71')](_0x1a5dc9,parseInt(_0x3d90('0x60'),0x8));return db[_0x3d90('0x42')][_0x3d90('0x55')](_0x3994c4)[_0x3d90('0x25')](function(_0x3b6c30){var _0xc1b08b={'role':_0x484837['body'][_0x3d90('0x72')],'userProfileId':_0x484837[_0x3d90('0x73')]['userProfileId']};if(!_0xc1b08b)throw new Error(_0x3d90('0x74'));if(_0xc1b08b[_0x3d90('0x72')]==='user'){var _0x46dbc2=_0x3b6c30['get']({'plain':!![]});return db[_0x3d90('0x75')]['find']({'where':{'name':_0x3d90('0x76'),'userProfileId':_0xc1b08b[_0x3d90('0x77')]},'raw':!![]})[_0x3d90('0x25')](function(_0x1b8d78){if(_0x1b8d78&&_0x1b8d78[_0x3d90('0x78')]===0x0){return db[_0x3d90('0x28')][_0x3d90('0x55')]({'name':_0x46dbc2[_0x3d90('0x2b')],'resourceId':_0x46dbc2['id'],'type':_0x1b8d78[_0x3d90('0x2b')],'sectionId':_0x1b8d78['id']},{})['then'](function(){return _0x3b6c30;});}else{return _0x3b6c30;}})[_0x3d90('0x79')](function(_0x54426f){logger[_0x3d90('0x29')](_0x3d90('0x7a'),_0x54426f);throw _0x54426f;});}return _0x3b6c30;})[_0x3d90('0x25')](respondWithResult(_0x4ef6f5,null))[_0x3d90('0x79')](handleError(_0x4ef6f5,null));});_0x172223[_0x3d90('0x7b')]();}catch(_0x3b006e){_0x4ef6f5[_0x3d90('0x19')](0x1f4)[_0x3d90('0x2c')](_0x3b006e);}};exports[_0x3d90('0x24')]=function(_0x3bcca7,_0x19579c,_0x508b63){return db['Sound'][_0x3d90('0x48')]({'where':{'id':_0x3bcca7[_0x3d90('0x46')]['id']}})[_0x3d90('0x25')](handleEntityNotFound(_0x19579c,null))[_0x3d90('0x25')](saveUpdates(_[_0x3d90('0x3d')](_0x3bcca7[_0x3d90('0x73')],[_0x3d90('0x2b'),'description']),null))[_0x3d90('0x25')](respondWithResult(_0x19579c,null))[_0x3d90('0x79')](handleError(_0x19579c,null));};exports['delete']=function(_0x1b0cfc,_0x1af188,_0x200714){return db['Sound'][_0x3d90('0x48')]({'where':{'id':_0x1b0cfc[_0x3d90('0x46')]['id']}})['then'](function(_0x35d6eb){if(_0x35d6eb){return _0x35d6eb[_0x3d90('0x26')]();}})[_0x3d90('0x25')](function(_0x186e5f){var _0x5523d9=path[_0x3d90('0x4d')](config[_0x3d90('0x4e')],_0x3d90('0x5d'),util[_0x3d90('0x53')]('%s.%s',_0x186e5f['save_name'],_0x186e5f[_0x3d90('0x7c')]));var _0x40aa7d=path[_0x3d90('0x4d')](config[_0x3d90('0x4e')],_0x3d90('0x52'),util['format'](_0x3d90('0x54'),_0x186e5f[_0x3d90('0x4a')],_0x186e5f[_0x3d90('0x4b')]));fs['unlinkSync'](_0x5523d9);fs[_0x3d90('0x62')](_0x40aa7d);return _0x186e5f;})[_0x3d90('0x25')](function(_0x3f2b6e){if(_0x3f2b6e){return _0x1af188[_0x3d90('0x19')](0xcc)[_0x3d90('0x1a')]();}})[_0x3d90('0x25')](handleEntityNotFound(_0x1af188,null))[_0x3d90('0x79')](handleError(_0x1af188,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 34e8d3a..666857b 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 _0x26c9=['path','rimraf','../../config/environment','exports','define','Sound','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x571ee4,_0x561fe5){var _0x37c265=function(_0x3aeaff){while(--_0x3aeaff){_0x571ee4['push'](_0x571ee4['shift']());}};_0x37c265(++_0x561fe5);}(_0x26c9,0x66));var _0x926c=function(_0x3898dc,_0x68048){_0x3898dc=_0x3898dc-0x0;var _0x3ff3ca=_0x26c9[_0x3898dc];return _0x3ff3ca;};'use strict';var _=require('lodash');var util=require(_0x926c('0x0'));var logger=require(_0x926c('0x1'))(_0x926c('0x2'));var moment=require(_0x926c('0x3'));var BPromise=require(_0x926c('0x4'));var rp=require(_0x926c('0x5'));var fs=require('fs');var path=require(_0x926c('0x6'));var rimraf=require(_0x926c('0x7'));var config=require(_0x926c('0x8'));var attributes=require('./sound.attributes');module[_0x926c('0x9')]=function(_0x22817e,_0x181c77){return _0x22817e[_0x926c('0xa')](_0x926c('0xb'),attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x95cd=['rimraf','../../config/environment','exports','define','Sound','tools_sounds','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x95cd,0xf0));var _0xd95c=function(_0x2ab82a,_0x5b347b){_0x2ab82a=_0x2ab82a-0x0;var _0x3393cc=_0x95cd[_0x2ab82a];return _0x3393cc;};'use strict';var _=require(_0xd95c('0x0'));var util=require(_0xd95c('0x1'));var logger=require(_0xd95c('0x2'))('api');var moment=require(_0xd95c('0x3'));var BPromise=require(_0xd95c('0x4'));var rp=require(_0xd95c('0x5'));var fs=require('fs');var path=require(_0xd95c('0x6'));var rimraf=require(_0xd95c('0x7'));var config=require(_0xd95c('0x8'));var attributes=require('./sound.attributes');module[_0xd95c('0x9')]=function(_0xdba7,_0x55117b){return _0xdba7[_0xd95c('0xa')](_0xd95c('0xb'),attributes,{'tableName':_0xd95c('0xc'),'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 c5fdb5c..17384cb 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 _0x8494=['map','include','model','debug','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ShowSound','Sound','find','options','where','attributes'];(function(_0x2d2a0f,_0x20074f){var _0x4c0805=function(_0x144039){while(--_0x144039){_0x2d2a0f['push'](_0x2d2a0f['shift']());}};_0x4c0805(++_0x20074f);}(_0x8494,0x1a9));var _0x4849=function(_0x39e421,_0x46f74a){_0x39e421=_0x39e421-0x0;var _0x237c38=_0x8494[_0x39e421];return _0x237c38;};'use strict';var _=require('lodash');var util=require(_0x4849('0x0'));var moment=require(_0x4849('0x1'));var BPromise=require(_0x4849('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4849('0x3'))['db'];var utils=require(_0x4849('0x4'));var logger=require(_0x4849('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4849('0x6'));var client=jayson[_0x4849('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x16b49e,_0x36f698,_0x58f1e8){return new BPromise(function(_0x585437,_0x4945d0){return client[_0x4849('0x8')](_0x16b49e,_0x58f1e8)[_0x4849('0x9')](function(_0x371f14){logger[_0x4849('0xa')](_0x4849('0xb'),_0x36f698,_0x4849('0xc'));logger['debug'](_0x4849('0xd'),_0x36f698,_0x4849('0xc'),JSON[_0x4849('0xe')](_0x371f14));if(_0x371f14['error']){if(_0x371f14[_0x4849('0xf')][_0x4849('0x10')]===0x1f4){logger[_0x4849('0xf')](_0x4849('0xb'),_0x36f698,_0x371f14['error'][_0x4849('0x11')]);return _0x4945d0(_0x371f14[_0x4849('0xf')][_0x4849('0x11')]);}logger[_0x4849('0xf')](_0x4849('0xb'),_0x36f698,_0x371f14['error'][_0x4849('0x11')]);return _0x585437(_0x371f14[_0x4849('0xf')][_0x4849('0x11')]);}else{logger[_0x4849('0xa')](_0x4849('0xb'),_0x36f698,_0x4849('0xc'));_0x585437(_0x371f14[_0x4849('0x12')][_0x4849('0x11')]);}})['catch'](function(_0x1c8d18){logger[_0x4849('0xf')](_0x4849('0xb'),_0x36f698,_0x1c8d18);_0x4945d0(_0x1c8d18);});});}exports[_0x4849('0x13')]=function(_0x213723){var _0xbfba2b=this;return new Promise(function(_0x104b21,_0x51b380){return db[_0x4849('0x14')][_0x4849('0x15')]({'raw':_0x213723[_0x4849('0x16')]?_0x213723['options']['raw']===undefined?!![]:![]:!![],'where':_0x213723[_0x4849('0x16')]?_0x213723[_0x4849('0x16')][_0x4849('0x17')]||null:null,'attributes':_0x213723[_0x4849('0x16')]?_0x213723['options'][_0x4849('0x18')]||null:null,'include':_0x213723['options']?_0x213723[_0x4849('0x16')]['include']?_[_0x4849('0x19')](_0x213723['options'][_0x4849('0x1a')],function(_0x3e4672){return{'model':db[_0x3e4672['model']],'as':_0x3e4672['as'],'attributes':_0x3e4672['attributes'],'include':_0x3e4672['include']?_[_0x4849('0x19')](_0x3e4672['include'],function(_0x5122d2){return{'model':db[_0x5122d2['model']],'as':_0x5122d2['as'],'attributes':_0x5122d2[_0x4849('0x18')],'include':_0x5122d2['include']?_['map'](_0x5122d2['include'],function(_0x52cf47){return{'model':db[_0x52cf47[_0x4849('0x1b')]],'as':_0x52cf47['as'],'attributes':_0x52cf47[_0x4849('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x51d7b6){logger[_0x4849('0xa')](_0x4849('0x13'),_0x213723);logger[_0x4849('0x1c')](_0x4849('0x13'),_0x213723,JSON['stringify'](_0x51d7b6));_0x104b21(_0x51d7b6);})[_0x4849('0x1d')](function(_0xf38299){logger[_0x4849('0xf')]('ShowSound',_0xf38299[_0x4849('0x11')],_0x213723);_0x51b380(_0xbfba2b[_0x4849('0xf')](0x1f4,_0xf38299['message']));});});}; \ No newline at end of file +var _0xfe8d=['stringify','error','code','message','catch','ShowSound','Sound','find','options','attributes','include','model','map','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s'];(function(_0x46b8f8,_0x3f9908){var _0x28eafe=function(_0x4f60c1){while(--_0x4f60c1){_0x46b8f8['push'](_0x46b8f8['shift']());}};_0x28eafe(++_0x3f9908);}(_0xfe8d,0xfd));var _0xdfe8=function(_0x47d812,_0x9837c2){_0x47d812=_0x47d812-0x0;var _0x519a35=_0xfe8d[_0x47d812];return _0x519a35;};'use strict';var _=require(_0xdfe8('0x0'));var util=require(_0xdfe8('0x1'));var moment=require('moment');var BPromise=require(_0xdfe8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdfe8('0x3'))['db'];var utils=require(_0xdfe8('0x4'));var logger=require(_0xdfe8('0x5'))(_0xdfe8('0x6'));var config=require(_0xdfe8('0x7'));var jayson=require(_0xdfe8('0x8'));var client=jayson['client'][_0xdfe8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5db50a,_0x444f4a,_0x284913){return new BPromise(function(_0x11e5e0,_0x930579){return client[_0xdfe8('0xa')](_0x5db50a,_0x284913)[_0xdfe8('0xb')](function(_0x539b82){logger[_0xdfe8('0xc')](_0xdfe8('0xd'),_0x444f4a,_0xdfe8('0xe'));logger[_0xdfe8('0xf')](_0xdfe8('0x10'),_0x444f4a,_0xdfe8('0xe'),JSON[_0xdfe8('0x11')](_0x539b82));if(_0x539b82[_0xdfe8('0x12')]){if(_0x539b82['error'][_0xdfe8('0x13')]===0x1f4){logger[_0xdfe8('0x12')]('Sound,\x20%s,\x20%s',_0x444f4a,_0x539b82[_0xdfe8('0x12')]['message']);return _0x930579(_0x539b82[_0xdfe8('0x12')][_0xdfe8('0x14')]);}logger['error']('Sound,\x20%s,\x20%s',_0x444f4a,_0x539b82[_0xdfe8('0x12')][_0xdfe8('0x14')]);return _0x11e5e0(_0x539b82[_0xdfe8('0x12')]['message']);}else{logger[_0xdfe8('0xc')](_0xdfe8('0xd'),_0x444f4a,_0xdfe8('0xe'));_0x11e5e0(_0x539b82['result']['message']);}})[_0xdfe8('0x15')](function(_0x790b9e){logger[_0xdfe8('0x12')](_0xdfe8('0xd'),_0x444f4a,_0x790b9e);_0x930579(_0x790b9e);});});}exports[_0xdfe8('0x16')]=function(_0x3efec6){var _0x275efa=this;return new Promise(function(_0x43a3e4,_0x100442){return db[_0xdfe8('0x17')][_0xdfe8('0x18')]({'raw':_0x3efec6['options']?_0x3efec6[_0xdfe8('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x3efec6[_0xdfe8('0x19')]?_0x3efec6[_0xdfe8('0x19')]['where']||null:null,'attributes':_0x3efec6['options']?_0x3efec6[_0xdfe8('0x19')][_0xdfe8('0x1a')]||null:null,'include':_0x3efec6[_0xdfe8('0x19')]?_0x3efec6['options'][_0xdfe8('0x1b')]?_['map'](_0x3efec6[_0xdfe8('0x19')][_0xdfe8('0x1b')],function(_0x1bf6fb){return{'model':db[_0x1bf6fb[_0xdfe8('0x1c')]],'as':_0x1bf6fb['as'],'attributes':_0x1bf6fb[_0xdfe8('0x1a')],'include':_0x1bf6fb[_0xdfe8('0x1b')]?_[_0xdfe8('0x1d')](_0x1bf6fb[_0xdfe8('0x1b')],function(_0x270716){return{'model':db[_0x270716[_0xdfe8('0x1c')]],'as':_0x270716['as'],'attributes':_0x270716[_0xdfe8('0x1a')],'include':_0x270716[_0xdfe8('0x1b')]?_[_0xdfe8('0x1d')](_0x270716[_0xdfe8('0x1b')],function(_0x5cfe5b){return{'model':db[_0x5cfe5b[_0xdfe8('0x1c')]],'as':_0x5cfe5b['as'],'attributes':_0x5cfe5b[_0xdfe8('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x418a51){logger[_0xdfe8('0xc')](_0xdfe8('0x16'),_0x3efec6);logger[_0xdfe8('0xf')](_0xdfe8('0x16'),_0x3efec6,JSON[_0xdfe8('0x11')](_0x418a51));_0x43a3e4(_0x418a51);})[_0xdfe8('0x15')](function(_0xb41127){logger[_0xdfe8('0x12')](_0xdfe8('0x16'),_0xb41127['message'],_0x3efec6);_0x100442(_0x275efa[_0xdfe8('0x12')](0x1f4,_0xb41127[_0xdfe8('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index de81692..5f342e7 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 _0x0b0e=['./squareMessage.controller','get','isAuthenticated','index','show','post','create','/:id','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1db153,_0x1ab5d){var _0x530cbe=function(_0x4115f7){while(--_0x4115f7){_0x1db153['push'](_0x1db153['shift']());}};_0x530cbe(++_0x1ab5d);}(_0x0b0e,0x187));var _0xe0b0=function(_0xe7d07d,_0x52e4e3){_0xe7d07d=_0xe7d07d-0x0;var _0x229e46=_0x0b0e[_0xe7d07d];return _0x229e46;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0xd')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xe')]);router['put'](_0xe0b0('0xf'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x10')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x11')]);module[_0xe0b0('0x12')]=router; \ No newline at end of file +var _0xda2d=['isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../config/environment','./squareMessage.controller','get'];(function(_0x4c91da,_0x4bbebb){var _0x172d2a=function(_0x3465b2){while(--_0x3465b2){_0x4c91da['push'](_0x4c91da['shift']());}};_0x172d2a(++_0x4bbebb);}(_0xda2d,0x102));var _0xdda2=function(_0x5869f2,_0x30b6a0){_0x5869f2=_0x5869f2-0x0;var _0x584cc4=_0xda2d[_0x5869f2];return _0x584cc4;};'use strict';var multer=require('multer');var util=require(_0xdda2('0x0'));var path=require(_0xdda2('0x1'));var timeout=require(_0xdda2('0x2'));var express=require(_0xdda2('0x3'));var router=express[_0xdda2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdda2('0x5'));var controller=require(_0xdda2('0x6'));router[_0xdda2('0x7')]('/',auth[_0xdda2('0x8')](),controller[_0xdda2('0x9')]);router[_0xdda2('0x7')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0xb')]);router[_0xdda2('0xc')]('/',auth['isAuthenticated'](),controller[_0xdda2('0xd')]);router[_0xdda2('0xe')]('/:id',auth[_0xdda2('0x8')](),controller[_0xdda2('0xf')]);router[_0xdda2('0x10')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x11')]);module[_0xdda2('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 4b1deb1..c310875 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 _0x3245=['out','STRING','TEXT','medium'];(function(_0x45be46,_0x2b2cf2){var _0x311169=function(_0x32b251){while(--_0x32b251){_0x45be46['push'](_0x45be46['shift']());}};_0x311169(++_0x2b2cf2);}(_0x3245,0x12d));var _0x5324=function(_0x4cf354,_0x11fe21){_0x4cf354=_0x4cf354-0x0;var _0x3930bd=_0x3245[_0x4cf354];return _0x3930bd;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x5324('0x0')]},'body':{'type':Sequelize[_0x5324('0x1')](_0x5324('0x2')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x5324('0x3'),'allowNull':![]},'providerName':{'type':Sequelize[_0x5324('0x0')]},'providerResponse':{'type':Sequelize[_0x5324('0x1')]}}; \ No newline at end of file +var _0xff7d=['medium','ENUM','out','sequelize','STRING','TEXT'];(function(_0x217d45,_0x14f197){var _0x170657=function(_0x3a64de){while(--_0x3a64de){_0x217d45['push'](_0x217d45['shift']());}};_0x170657(++_0x14f197);}(_0xff7d,0xf9));var _0xdff7=function(_0x1515ae,_0x123abe){_0x1515ae=_0x1515ae-0x0;var _0x3e857a=_0xff7d[_0x1515ae];return _0x3e857a;};'use strict';var Sequelize=require(_0xdff7('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xdff7('0x1')]},'body':{'type':Sequelize[_0xdff7('0x2')](_0xdff7('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0xdff7('0x4')]('in',_0xdff7('0x5')),'defaultValue':_0xdff7('0x5'),'allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xdff7('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 7f44715..bd19b2d 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 _0x7fb3=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','save','update','then','end','error','name','index','map','SquareMessage','rawAttributes','fieldName','type','key','model','query','keys','filters'];(function(_0x568c77,_0x459cac){var _0x3b930c=function(_0x1a525b){while(--_0x1a525b){_0x568c77['push'](_0x568c77['shift']());}};_0x3b930c(++_0x459cac);}(_0x7fb3,0xf9));var _0x37fb=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0x7fb3[_0x411add];return _0x238242;};'use strict';var emlformat=require(_0x37fb('0x0'));var rimraf=require(_0x37fb('0x1'));var zipdir=require(_0x37fb('0x2'));var jsonpatch=require(_0x37fb('0x3'));var rp=require('request-promise');var moment=require(_0x37fb('0x4'));var BPromise=require(_0x37fb('0x5'));var Mustache=require(_0x37fb('0x6'));var util=require(_0x37fb('0x7'));var path=require('path');var sox=require(_0x37fb('0x8'));var csv=require(_0x37fb('0x9'));var ejs=require(_0x37fb('0xa'));var fs=require('fs');var fs_extra=require(_0x37fb('0xb'));var _=require(_0x37fb('0xc'));var squel=require(_0x37fb('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x37fb('0x9'));var querystring=require(_0x37fb('0xe'));var Papa=require(_0x37fb('0xf'));var Redis=require(_0x37fb('0x10'));var authService=require(_0x37fb('0x11'));var qs=require(_0x37fb('0x12'));var as=require(_0x37fb('0x13'));var hardwareService=require(_0x37fb('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x37fb('0x15'));var config=require(_0x37fb('0x16'));var licenseUtil=require(_0x37fb('0x17'));var db=require(_0x37fb('0x18'))['db'];function respondWithStatusCode(_0x935608,_0x2403e8){_0x2403e8=_0x2403e8||0xcc;return function(_0x12364d){if(_0x12364d){return _0x935608[_0x37fb('0x19')](_0x2403e8);}return _0x935608['status'](_0x2403e8)['end']();};}function respondWithResult(_0x359238,_0x26c469){_0x26c469=_0x26c469||0xc8;return function(_0x6fa8ee){if(_0x6fa8ee){return _0x359238[_0x37fb('0x1a')](_0x26c469)['json'](_0x6fa8ee);}};}function respondWithFilteredResult(_0x1d27d6,_0x4e9456){return function(_0x2efec0){if(_0x2efec0){var _0x3d507f=typeof _0x4e9456[_0x37fb('0x1b')]===_0x37fb('0x1c')&&typeof _0x4e9456[_0x37fb('0x1d')]===_0x37fb('0x1c');var _0x3ac8ce=_0x2efec0[_0x37fb('0x1e')];var _0x100977=_0x3d507f?0x0:_0x4e9456[_0x37fb('0x1b')];var _0xd2ebb6=_0x3d507f?_0x2efec0[_0x37fb('0x1e')]:_0x4e9456[_0x37fb('0x1b')]+_0x4e9456[_0x37fb('0x1d')];var _0x383326;if(_0xd2ebb6>=_0x3ac8ce){_0xd2ebb6=_0x3ac8ce;_0x383326=0xc8;}else{_0x383326=0xce;}_0x1d27d6[_0x37fb('0x1a')](_0x383326);return _0x1d27d6[_0x37fb('0x1f')](_0x37fb('0x20'),_0x100977+'-'+_0xd2ebb6+'/'+_0x3ac8ce)[_0x37fb('0x21')](_0x2efec0);}return null;};}function patchUpdates(_0x47443b){return function(_0x14f640){try{jsonpatch['apply'](_0x14f640,_0x47443b,!![]);}catch(_0x3b8ec6){return BPromise['reject'](_0x3b8ec6);}return _0x14f640[_0x37fb('0x22')]();};}function saveUpdates(_0x19014b,_0x1d68b5){return function(_0x215cd0){if(_0x215cd0){return _0x215cd0[_0x37fb('0x23')](_0x19014b)[_0x37fb('0x24')](function(_0x205dc2){return _0x205dc2;});}return null;};}function removeEntity(_0x4deaa5,_0x2b483e){return function(_0x4f7705){if(_0x4f7705){return _0x4f7705['destroy']()[_0x37fb('0x24')](function(){_0x4deaa5['status'](0xcc)[_0x37fb('0x25')]();});}};}function handleEntityNotFound(_0x44eb0a,_0x3db7e9){return function(_0x267051){if(!_0x267051){_0x44eb0a[_0x37fb('0x19')](0x194);}return _0x267051;};}function handleError(_0x1bc6e1,_0x4000ed){_0x4000ed=_0x4000ed||0x1f4;return function(_0x2840ac){logger[_0x37fb('0x26')](_0x2840ac['stack']);if(_0x2840ac[_0x37fb('0x27')]){delete _0x2840ac[_0x37fb('0x27')];}_0x1bc6e1['status'](_0x4000ed)['send'](_0x2840ac);};}exports[_0x37fb('0x28')]=function(_0x17c587,_0xfe4421){var _0x566450={},_0x38988f={},_0x17fd56={'count':0x0,'rows':[]};var _0x531e03=_[_0x37fb('0x29')](db[_0x37fb('0x2a')][_0x37fb('0x2b')],function(_0x59c964){return{'name':_0x59c964[_0x37fb('0x2c')],'type':_0x59c964[_0x37fb('0x2d')][_0x37fb('0x2e')]};});_0x38988f[_0x37fb('0x2f')]=_[_0x37fb('0x29')](_0x531e03,_0x37fb('0x27'));_0x38988f[_0x37fb('0x30')]=_[_0x37fb('0x31')](_0x17c587[_0x37fb('0x30')]);_0x38988f[_0x37fb('0x32')]=_[_0x37fb('0x33')](_0x38988f['model'],_0x38988f[_0x37fb('0x30')]);_0x566450[_0x37fb('0x34')]=_[_0x37fb('0x33')](_0x38988f['model'],qs[_0x37fb('0x35')](_0x17c587[_0x37fb('0x30')]['fields']));_0x566450[_0x37fb('0x34')]=_0x566450[_0x37fb('0x34')][_0x37fb('0x36')]?_0x566450[_0x37fb('0x34')]:_0x38988f[_0x37fb('0x2f')];if(!_0x17c587['query'][_0x37fb('0x37')](_0x37fb('0x38'))){_0x566450[_0x37fb('0x1d')]=qs['limit'](_0x17c587[_0x37fb('0x30')]['limit']);_0x566450[_0x37fb('0x1b')]=qs['offset'](_0x17c587[_0x37fb('0x30')]['offset']);}_0x566450[_0x37fb('0x39')]=qs[_0x37fb('0x3a')](_0x17c587['query']['sort']);_0x566450[_0x37fb('0x3b')]=qs['filters'](_[_0x37fb('0x3c')](_0x17c587[_0x37fb('0x30')],_0x38988f[_0x37fb('0x32')]),_0x531e03);if(_0x17c587[_0x37fb('0x30')][_0x37fb('0x3d')]){_0x566450[_0x37fb('0x3b')]=_[_0x37fb('0x3e')](_0x566450['where'],{'$or':_[_0x37fb('0x29')](_0x531e03,function(_0x1463be){if(_0x1463be[_0x37fb('0x2d')]!=='VIRTUAL'){var _0x417d58={};_0x417d58[_0x1463be['name']]={'$like':'%'+_0x17c587[_0x37fb('0x30')][_0x37fb('0x3d')]+'%'};return _0x417d58;}})});}_0x566450=_[_0x37fb('0x3e')]({},_0x566450,_0x17c587[_0x37fb('0x3f')]);var _0x4f0051={'where':_0x566450['where']};return db['SquareMessage'][_0x37fb('0x1e')](_0x4f0051)[_0x37fb('0x24')](function(_0x353787){_0x17fd56[_0x37fb('0x1e')]=_0x353787;if(_0x17c587[_0x37fb('0x30')][_0x37fb('0x40')]){_0x566450[_0x37fb('0x41')]=[{'all':!![]}];}return db[_0x37fb('0x2a')][_0x37fb('0x42')](_0x566450);})['then'](function(_0x5e14ff){_0x17fd56[_0x37fb('0x43')]=_0x5e14ff;return _0x17fd56;})['then'](respondWithFilteredResult(_0xfe4421,_0x566450))[_0x37fb('0x44')](handleError(_0xfe4421,null));};exports[_0x37fb('0x45')]=function(_0x245dd8,_0xffe966){var _0x4eaaea={'raw':!![],'where':{'id':_0x245dd8['params']['id']}},_0x333ab0={};_0x333ab0[_0x37fb('0x2f')]=_[_0x37fb('0x31')](db[_0x37fb('0x2a')][_0x37fb('0x2b')]);_0x333ab0[_0x37fb('0x30')]=_['keys'](_0x245dd8[_0x37fb('0x30')]);_0x333ab0[_0x37fb('0x32')]=_['intersection'](_0x333ab0[_0x37fb('0x2f')],_0x333ab0[_0x37fb('0x30')]);_0x4eaaea[_0x37fb('0x34')]=_[_0x37fb('0x33')](_0x333ab0[_0x37fb('0x2f')],qs[_0x37fb('0x35')](_0x245dd8[_0x37fb('0x30')]['fields']));_0x4eaaea[_0x37fb('0x34')]=_0x4eaaea[_0x37fb('0x34')]['length']?_0x4eaaea[_0x37fb('0x34')]:_0x333ab0[_0x37fb('0x2f')];if(_0x245dd8[_0x37fb('0x30')][_0x37fb('0x40')]){_0x4eaaea['include']=[{'all':!![]}];}_0x4eaaea=_[_0x37fb('0x3e')]({},_0x4eaaea,_0x245dd8[_0x37fb('0x3f')]);return db['SquareMessage'][_0x37fb('0x46')](_0x4eaaea)[_0x37fb('0x24')](handleEntityNotFound(_0xffe966,null))[_0x37fb('0x24')](respondWithResult(_0xffe966,null))[_0x37fb('0x44')](handleError(_0xffe966,null));};exports[_0x37fb('0x47')]=function(_0x4c63e5,_0x52fa44){return db[_0x37fb('0x2a')][_0x37fb('0x47')](_0x4c63e5[_0x37fb('0x48')],{})['then'](respondWithResult(_0x52fa44,0xc9))[_0x37fb('0x44')](handleError(_0x52fa44,null));};exports['update']=function(_0x297785,_0x2c1760){if(_0x297785[_0x37fb('0x48')]['id']){delete _0x297785[_0x37fb('0x48')]['id'];}return db['SquareMessage'][_0x37fb('0x46')]({'where':{'id':_0x297785[_0x37fb('0x49')]['id']}})[_0x37fb('0x24')](handleEntityNotFound(_0x2c1760,null))[_0x37fb('0x24')](saveUpdates(_0x297785[_0x37fb('0x48')],null))[_0x37fb('0x24')](respondWithResult(_0x2c1760,null))[_0x37fb('0x44')](handleError(_0x2c1760,null));};exports[_0x37fb('0x4a')]=function(_0x1be494,_0x14fdac){return db['SquareMessage'][_0x37fb('0x46')]({'where':{'id':_0x1be494['params']['id']}})[_0x37fb('0x24')](handleEntityNotFound(_0x14fdac,null))[_0x37fb('0x24')](removeEntity(_0x14fdac,null))[_0x37fb('0x44')](handleError(_0x14fdac,null));}; \ No newline at end of file +var _0x2baf=['undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','fieldName','type','key','model','keys','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','filters','filter','where','VIRTUAL','merge','options','SquareMessage','includeAll','include','findAll','catch','show','rawAttributes','find','create','body','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json'];(function(_0x59615f,_0x1d63ca){var _0x460ddd=function(_0x30c406){while(--_0x30c406){_0x59615f['push'](_0x59615f['shift']());}};_0x460ddd(++_0x1d63ca);}(_0x2baf,0xc8));var _0xf2ba=function(_0x189305,_0x46c43f){_0x189305=_0x189305-0x0;var _0xea3406=_0x2baf[_0x189305];return _0xea3406;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf2ba('0x0'));var zipdir=require(_0xf2ba('0x1'));var jsonpatch=require(_0xf2ba('0x2'));var rp=require(_0xf2ba('0x3'));var moment=require(_0xf2ba('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf2ba('0x5'));var util=require('util');var path=require('path');var sox=require(_0xf2ba('0x6'));var csv=require(_0xf2ba('0x7'));var ejs=require(_0xf2ba('0x8'));var fs=require('fs');var fs_extra=require(_0xf2ba('0x9'));var _=require(_0xf2ba('0xa'));var squel=require('squel');var crypto=require(_0xf2ba('0xb'));var jsforce=require(_0xf2ba('0xc'));var deskjs=require(_0xf2ba('0xd'));var toCsv=require(_0xf2ba('0x7'));var querystring=require(_0xf2ba('0xe'));var Papa=require(_0xf2ba('0xf'));var Redis=require(_0xf2ba('0x10'));var authService=require(_0xf2ba('0x11'));var qs=require(_0xf2ba('0x12'));var as=require(_0xf2ba('0x13'));var hardwareService=require(_0xf2ba('0x14'));var logger=require(_0xf2ba('0x15'))(_0xf2ba('0x16'));var utils=require(_0xf2ba('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf2ba('0x18'))['db'];function respondWithStatusCode(_0x101e81,_0x5c6307){_0x5c6307=_0x5c6307||0xcc;return function(_0x34006e){if(_0x34006e){return _0x101e81[_0xf2ba('0x19')](_0x5c6307);}return _0x101e81[_0xf2ba('0x1a')](_0x5c6307)['end']();};}function respondWithResult(_0x3ee056,_0x214430){_0x214430=_0x214430||0xc8;return function(_0x12e446){if(_0x12e446){return _0x3ee056[_0xf2ba('0x1a')](_0x214430)[_0xf2ba('0x1b')](_0x12e446);}};}function respondWithFilteredResult(_0x3499c2,_0x379e42){return function(_0x197ae6){if(_0x197ae6){var _0x16b094=typeof _0x379e42['offset']==='undefined'&&typeof _0x379e42['limit']===_0xf2ba('0x1c');var _0x465e2f=_0x197ae6[_0xf2ba('0x1d')];var _0x2c0bc4=_0x16b094?0x0:_0x379e42[_0xf2ba('0x1e')];var _0x52f53f=_0x16b094?_0x197ae6[_0xf2ba('0x1d')]:_0x379e42[_0xf2ba('0x1e')]+_0x379e42['limit'];var _0x226276;if(_0x52f53f>=_0x465e2f){_0x52f53f=_0x465e2f;_0x226276=0xc8;}else{_0x226276=0xce;}_0x3499c2[_0xf2ba('0x1a')](_0x226276);return _0x3499c2['set'](_0xf2ba('0x1f'),_0x2c0bc4+'-'+_0x52f53f+'/'+_0x465e2f)[_0xf2ba('0x1b')](_0x197ae6);}return null;};}function patchUpdates(_0x5b2724){return function(_0x21ca7e){try{jsonpatch[_0xf2ba('0x20')](_0x21ca7e,_0x5b2724,!![]);}catch(_0x432e80){return BPromise[_0xf2ba('0x21')](_0x432e80);}return _0x21ca7e[_0xf2ba('0x22')]();};}function saveUpdates(_0x505211,_0x3d082){return function(_0x5b8ae6){if(_0x5b8ae6){return _0x5b8ae6[_0xf2ba('0x23')](_0x505211)[_0xf2ba('0x24')](function(_0x599072){return _0x599072;});}return null;};}function removeEntity(_0x5ada32,_0x3de21b){return function(_0x368ffa){if(_0x368ffa){return _0x368ffa[_0xf2ba('0x25')]()[_0xf2ba('0x24')](function(){_0x5ada32[_0xf2ba('0x1a')](0xcc)[_0xf2ba('0x26')]();});}};}function handleEntityNotFound(_0x52f6b1,_0xab07bb){return function(_0x14e2d1){if(!_0x14e2d1){_0x52f6b1[_0xf2ba('0x19')](0x194);}return _0x14e2d1;};}function handleError(_0x50bc4a,_0x486064){_0x486064=_0x486064||0x1f4;return function(_0x151c24){logger[_0xf2ba('0x27')](_0x151c24['stack']);if(_0x151c24[_0xf2ba('0x28')]){delete _0x151c24[_0xf2ba('0x28')];}_0x50bc4a[_0xf2ba('0x1a')](_0x486064)[_0xf2ba('0x29')](_0x151c24);};}exports[_0xf2ba('0x2a')]=function(_0x15d237,_0x24c161){var _0x33adb5={},_0x30164b={},_0x1cd5bd={'count':0x0,'rows':[]};var _0x2b3cc0=_[_0xf2ba('0x2b')](db['SquareMessage']['rawAttributes'],function(_0x5bfa95){return{'name':_0x5bfa95[_0xf2ba('0x2c')],'type':_0x5bfa95[_0xf2ba('0x2d')][_0xf2ba('0x2e')]};});_0x30164b[_0xf2ba('0x2f')]=_[_0xf2ba('0x2b')](_0x2b3cc0,'name');_0x30164b['query']=_[_0xf2ba('0x30')](_0x15d237['query']);_0x30164b['filters']=_[_0xf2ba('0x31')](_0x30164b[_0xf2ba('0x2f')],_0x30164b[_0xf2ba('0x32')]);_0x33adb5['attributes']=_[_0xf2ba('0x31')](_0x30164b[_0xf2ba('0x2f')],qs[_0xf2ba('0x33')](_0x15d237[_0xf2ba('0x32')]['fields']));_0x33adb5[_0xf2ba('0x34')]=_0x33adb5['attributes'][_0xf2ba('0x35')]?_0x33adb5[_0xf2ba('0x34')]:_0x30164b[_0xf2ba('0x2f')];if(!_0x15d237[_0xf2ba('0x32')][_0xf2ba('0x36')](_0xf2ba('0x37'))){_0x33adb5[_0xf2ba('0x38')]=qs[_0xf2ba('0x38')](_0x15d237[_0xf2ba('0x32')][_0xf2ba('0x38')]);_0x33adb5[_0xf2ba('0x1e')]=qs[_0xf2ba('0x1e')](_0x15d237[_0xf2ba('0x32')][_0xf2ba('0x1e')]);}_0x33adb5[_0xf2ba('0x39')]=qs[_0xf2ba('0x3a')](_0x15d237[_0xf2ba('0x32')][_0xf2ba('0x3a')]);_0x33adb5['where']=qs[_0xf2ba('0x3b')](_['pick'](_0x15d237[_0xf2ba('0x32')],_0x30164b[_0xf2ba('0x3b')]),_0x2b3cc0);if(_0x15d237['query'][_0xf2ba('0x3c')]){_0x33adb5[_0xf2ba('0x3d')]=_['merge'](_0x33adb5['where'],{'$or':_[_0xf2ba('0x2b')](_0x2b3cc0,function(_0x308210){if(_0x308210['type']!==_0xf2ba('0x3e')){var _0x23d214={};_0x23d214[_0x308210[_0xf2ba('0x28')]]={'$like':'%'+_0x15d237[_0xf2ba('0x32')][_0xf2ba('0x3c')]+'%'};return _0x23d214;}})});}_0x33adb5=_[_0xf2ba('0x3f')]({},_0x33adb5,_0x15d237[_0xf2ba('0x40')]);var _0xe84c42={'where':_0x33adb5[_0xf2ba('0x3d')]};return db[_0xf2ba('0x41')][_0xf2ba('0x1d')](_0xe84c42)[_0xf2ba('0x24')](function(_0x548a81){_0x1cd5bd[_0xf2ba('0x1d')]=_0x548a81;if(_0x15d237[_0xf2ba('0x32')][_0xf2ba('0x42')]){_0x33adb5[_0xf2ba('0x43')]=[{'all':!![]}];}return db[_0xf2ba('0x41')][_0xf2ba('0x44')](_0x33adb5);})[_0xf2ba('0x24')](function(_0x3da6d4){_0x1cd5bd['rows']=_0x3da6d4;return _0x1cd5bd;})[_0xf2ba('0x24')](respondWithFilteredResult(_0x24c161,_0x33adb5))[_0xf2ba('0x45')](handleError(_0x24c161,null));};exports[_0xf2ba('0x46')]=function(_0x461348,_0x4889d3){var _0x1b9999={'raw':!![],'where':{'id':_0x461348['params']['id']}},_0x3252c5={};_0x3252c5[_0xf2ba('0x2f')]=_[_0xf2ba('0x30')](db[_0xf2ba('0x41')][_0xf2ba('0x47')]);_0x3252c5[_0xf2ba('0x32')]=_[_0xf2ba('0x30')](_0x461348['query']);_0x3252c5[_0xf2ba('0x3b')]=_[_0xf2ba('0x31')](_0x3252c5[_0xf2ba('0x2f')],_0x3252c5[_0xf2ba('0x32')]);_0x1b9999[_0xf2ba('0x34')]=_[_0xf2ba('0x31')](_0x3252c5[_0xf2ba('0x2f')],qs[_0xf2ba('0x33')](_0x461348[_0xf2ba('0x32')][_0xf2ba('0x33')]));_0x1b9999[_0xf2ba('0x34')]=_0x1b9999['attributes'][_0xf2ba('0x35')]?_0x1b9999[_0xf2ba('0x34')]:_0x3252c5[_0xf2ba('0x2f')];if(_0x461348['query'][_0xf2ba('0x42')]){_0x1b9999[_0xf2ba('0x43')]=[{'all':!![]}];}_0x1b9999=_['merge']({},_0x1b9999,_0x461348['options']);return db['SquareMessage'][_0xf2ba('0x48')](_0x1b9999)[_0xf2ba('0x24')](handleEntityNotFound(_0x4889d3,null))[_0xf2ba('0x24')](respondWithResult(_0x4889d3,null))[_0xf2ba('0x45')](handleError(_0x4889d3,null));};exports['create']=function(_0x55a9d7,_0x2d5ea7){return db['SquareMessage'][_0xf2ba('0x49')](_0x55a9d7['body'],{})['then'](respondWithResult(_0x2d5ea7,0xc9))['catch'](handleError(_0x2d5ea7,null));};exports[_0xf2ba('0x23')]=function(_0x493d54,_0x5a3180){if(_0x493d54['body']['id']){delete _0x493d54[_0xf2ba('0x4a')]['id'];}return db[_0xf2ba('0x41')][_0xf2ba('0x48')]({'where':{'id':_0x493d54[_0xf2ba('0x4b')]['id']}})[_0xf2ba('0x24')](handleEntityNotFound(_0x5a3180,null))[_0xf2ba('0x24')](saveUpdates(_0x493d54[_0xf2ba('0x4a')],null))[_0xf2ba('0x24')](respondWithResult(_0x5a3180,null))['catch'](handleError(_0x5a3180,null));};exports[_0xf2ba('0x25')]=function(_0x1f4e4e,_0x139ffd){return db[_0xf2ba('0x41')][_0xf2ba('0x48')]({'where':{'id':_0x1f4e4e[_0xf2ba('0x4b')]['id']}})['then'](handleEntityNotFound(_0x139ffd,null))[_0xf2ba('0x24')](removeEntity(_0x139ffd,null))[_0xf2ba('0x45')](handleError(_0x139ffd,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 5c2ca46..7b0f88c 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 _0x9dd5=['../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./squareMessage.attributes','exports','SquareMessage','square_messages','lodash','util'];(function(_0x210bb9,_0xc0d44c){var _0x2434ce=function(_0x50ea91){while(--_0x50ea91){_0x210bb9['push'](_0x210bb9['shift']());}};_0x2434ce(++_0xc0d44c);}(_0x9dd5,0x1d2));var _0x59dd=function(_0x57b414,_0x2cf6d2){_0x57b414=_0x57b414-0x0;var _0x4ce217=_0x9dd5[_0x57b414];return _0x4ce217;};'use strict';var _=require(_0x59dd('0x0'));var util=require(_0x59dd('0x1'));var logger=require(_0x59dd('0x2'))(_0x59dd('0x3'));var moment=require(_0x59dd('0x4'));var BPromise=require(_0x59dd('0x5'));var rp=require(_0x59dd('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x59dd('0x7'));var attributes=require(_0x59dd('0x8'));module[_0x59dd('0x9')]=function(_0x5b2b0,_0x5932d1){return _0x5b2b0['define'](_0x59dd('0xa'),attributes,{'tableName':_0x59dd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8e6a=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SquareMessage','square_messages'];(function(_0x4c5a4e,_0xeceb7a){var _0x574b17=function(_0x3e9282){while(--_0x3e9282){_0x4c5a4e['push'](_0x4c5a4e['shift']());}};_0x574b17(++_0xeceb7a);}(_0x8e6a,0x1b2));var _0xa8e6=function(_0x469cf0,_0x182fa6){_0x469cf0=_0x469cf0-0x0;var _0x504a0b=_0x8e6a[_0x469cf0];return _0x504a0b;};'use strict';var _=require(_0xa8e6('0x0'));var util=require(_0xa8e6('0x1'));var logger=require(_0xa8e6('0x2'))(_0xa8e6('0x3'));var moment=require(_0xa8e6('0x4'));var BPromise=require(_0xa8e6('0x5'));var rp=require(_0xa8e6('0x6'));var fs=require('fs');var path=require(_0xa8e6('0x7'));var rimraf=require(_0xa8e6('0x8'));var config=require(_0xa8e6('0x9'));var attributes=require('./squareMessage.attributes');module[_0xa8e6('0xa')]=function(_0xeeb177,_0x2a249d){return _0xeeb177[_0xa8e6('0xb')](_0xa8e6('0xc'),attributes,{'tableName':_0xa8e6('0xd'),'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 5519d02..74af1eb 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 _0xc5a3=['error','code','message','result','CreateSquareMessage','SquareMessage','create','body','options','raw','then','stringify','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4f6dbe,_0x506be5){var _0x33fe75=function(_0x3277de){while(--_0x3277de){_0x4f6dbe['push'](_0x4f6dbe['shift']());}};_0x33fe75(++_0x506be5);}(_0xc5a3,0x11b));var _0x3c5a=function(_0x5eeb07,_0x574809){_0x5eeb07=_0x5eeb07-0x0;var _0x474b96=_0xc5a3[_0x5eeb07];return _0x474b96;};'use strict';var _=require('lodash');var util=require(_0x3c5a('0x0'));var moment=require(_0x3c5a('0x1'));var BPromise=require('bluebird');var rs=require(_0x3c5a('0x2'));var fs=require('fs');var Redis=require(_0x3c5a('0x3'));var db=require(_0x3c5a('0x4'))['db'];var utils=require(_0x3c5a('0x5'));var logger=require(_0x3c5a('0x6'))(_0x3c5a('0x7'));var config=require(_0x3c5a('0x8'));var jayson=require(_0x3c5a('0x9'));var client=jayson[_0x3c5a('0xa')][_0x3c5a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x550c45,_0x4d05ea,_0x39a133){return new BPromise(function(_0x15c3ed,_0x688e22){return client[_0x3c5a('0xc')](_0x550c45,_0x39a133)['then'](function(_0x5b9c6f){logger[_0x3c5a('0xd')](_0x3c5a('0xe'),_0x4d05ea,_0x3c5a('0xf'));logger[_0x3c5a('0x10')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x4d05ea,_0x3c5a('0xf'),JSON['stringify'](_0x5b9c6f));if(_0x5b9c6f['error']){if(_0x5b9c6f[_0x3c5a('0x11')][_0x3c5a('0x12')]===0x1f4){logger[_0x3c5a('0x11')](_0x3c5a('0xe'),_0x4d05ea,_0x5b9c6f['error'][_0x3c5a('0x13')]);return _0x688e22(_0x5b9c6f[_0x3c5a('0x11')][_0x3c5a('0x13')]);}logger['error']('SquareMessage,\x20%s,\x20%s',_0x4d05ea,_0x5b9c6f[_0x3c5a('0x11')]['message']);return _0x15c3ed(_0x5b9c6f[_0x3c5a('0x11')][_0x3c5a('0x13')]);}else{logger[_0x3c5a('0xd')](_0x3c5a('0xe'),_0x4d05ea,'request\x20sent');_0x15c3ed(_0x5b9c6f[_0x3c5a('0x14')][_0x3c5a('0x13')]);}})['catch'](function(_0x23595b){logger[_0x3c5a('0x11')](_0x3c5a('0xe'),_0x4d05ea,_0x23595b);_0x688e22(_0x23595b);});});}exports[_0x3c5a('0x15')]=function(_0x23a06c){var _0x9bf0f3=this;return new Promise(function(_0x2550cf,_0x34719a){return db[_0x3c5a('0x16')][_0x3c5a('0x17')](_0x23a06c[_0x3c5a('0x18')],{'raw':_0x23a06c['options']?_0x23a06c[_0x3c5a('0x19')][_0x3c5a('0x1a')]===undefined?!![]:![]:!![]})[_0x3c5a('0x1b')](function(_0x528ea9){logger['info'](_0x3c5a('0x15'),_0x23a06c);logger[_0x3c5a('0x10')](_0x3c5a('0x15'),_0x23a06c,JSON[_0x3c5a('0x1c')](_0x528ea9));_0x2550cf(_0x528ea9);})[_0x3c5a('0x1d')](function(_0x438a40){logger[_0x3c5a('0x11')](_0x3c5a('0x15'),_0x438a40['message'],_0x23a06c);_0x34719a(_0x9bf0f3['error'](0x1f4,_0x438a40[_0x3c5a('0x13')]));});});}; \ No newline at end of file +var _0x6d0c=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareMessage,\x20%s,\x20%s','debug','SquareMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','SquareMessage','create','body','options','raw','CreateSquareMessage','util','bluebird','ioredis','../../config/utils','../../config/logger'];(function(_0x3b3a82,_0x53b5e0){var _0x267063=function(_0x5aaf3d){while(--_0x5aaf3d){_0x3b3a82['push'](_0x3b3a82['shift']());}};_0x267063(++_0x53b5e0);}(_0x6d0c,0x11d));var _0xc6d0=function(_0x53bd4c,_0x21d795){_0x53bd4c=_0x53bd4c-0x0;var _0x4a2e84=_0x6d0c[_0x53bd4c];return _0x4a2e84;};'use strict';var _=require('lodash');var util=require(_0xc6d0('0x0'));var moment=require('moment');var BPromise=require(_0xc6d0('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc6d0('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xc6d0('0x3'));var logger=require(_0xc6d0('0x4'))(_0xc6d0('0x5'));var config=require(_0xc6d0('0x6'));var jayson=require(_0xc6d0('0x7'));var client=jayson[_0xc6d0('0x8')][_0xc6d0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1c6734,_0x32f4d6,_0x46a11a){return new BPromise(function(_0x23ed23,_0x27257a){return client[_0xc6d0('0xa')](_0x1c6734,_0x46a11a)[_0xc6d0('0xb')](function(_0x563f79){logger[_0xc6d0('0xc')](_0xc6d0('0xd'),_0x32f4d6,'request\x20sent');logger[_0xc6d0('0xe')](_0xc6d0('0xf'),_0x32f4d6,_0xc6d0('0x10'),JSON[_0xc6d0('0x11')](_0x563f79));if(_0x563f79[_0xc6d0('0x12')]){if(_0x563f79[_0xc6d0('0x12')][_0xc6d0('0x13')]===0x1f4){logger['error'](_0xc6d0('0xd'),_0x32f4d6,_0x563f79[_0xc6d0('0x12')][_0xc6d0('0x14')]);return _0x27257a(_0x563f79[_0xc6d0('0x12')][_0xc6d0('0x14')]);}logger['error'](_0xc6d0('0xd'),_0x32f4d6,_0x563f79[_0xc6d0('0x12')][_0xc6d0('0x14')]);return _0x23ed23(_0x563f79['error']['message']);}else{logger['info']('SquareMessage,\x20%s,\x20%s',_0x32f4d6,_0xc6d0('0x10'));_0x23ed23(_0x563f79[_0xc6d0('0x15')][_0xc6d0('0x14')]);}})[_0xc6d0('0x16')](function(_0x24f262){logger[_0xc6d0('0x12')](_0xc6d0('0xd'),_0x32f4d6,_0x24f262);_0x27257a(_0x24f262);});});}exports['CreateSquareMessage']=function(_0x17fd71){var _0xc89561=this;return new Promise(function(_0x43f31d,_0x2b685a){return db[_0xc6d0('0x17')][_0xc6d0('0x18')](_0x17fd71[_0xc6d0('0x19')],{'raw':_0x17fd71[_0xc6d0('0x1a')]?_0x17fd71[_0xc6d0('0x1a')][_0xc6d0('0x1b')]===undefined?!![]:![]:!![]})[_0xc6d0('0xb')](function(_0x316cfd){logger[_0xc6d0('0xc')]('CreateSquareMessage',_0x17fd71);logger[_0xc6d0('0xe')]('CreateSquareMessage',_0x17fd71,JSON[_0xc6d0('0x11')](_0x316cfd));_0x43f31d(_0x316cfd);})[_0xc6d0('0x16')](function(_0x362b39){logger[_0xc6d0('0x12')](_0xc6d0('0x1c'),_0x362b39[_0xc6d0('0x14')],_0x17fd71);_0x2b685a(_0xc89561[_0xc6d0('0x12')](0x1f4,_0x362b39[_0xc6d0('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 8301815..ef051ed 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 _0xb3c0=['isAuthenticated','show','15s','post','create','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./squareOdbc.controller','get','index'];(function(_0x42d903,_0xbc931d){var _0x7406c=function(_0x44052b){while(--_0x44052b){_0x42d903['push'](_0x42d903['shift']());}};_0x7406c(++_0xbc931d);}(_0xb3c0,0x16b));var _0x0b3c=function(_0x14bd24,_0x12dd61){_0x14bd24=_0x14bd24-0x0;var _0x112747=_0xb3c0[_0x14bd24];return _0x112747;};'use strict';var multer=require(_0x0b3c('0x0'));var util=require(_0x0b3c('0x1'));var path=require(_0x0b3c('0x2'));var timeout=require(_0x0b3c('0x3'));var express=require('express');var router=express[_0x0b3c('0x4')]();var fs_extra=require(_0x0b3c('0x5'));var auth=require(_0x0b3c('0x6'));var interaction=require(_0x0b3c('0x7'));var config=require('../../config/environment');var controller=require(_0x0b3c('0x8'));router[_0x0b3c('0x9')]('/',auth['isAuthenticated'](),controller[_0x0b3c('0xa')]);router[_0x0b3c('0x9')]('/:id',auth[_0x0b3c('0xb')](),controller[_0x0b3c('0xc')]);router[_0x0b3c('0x9')]('/:id/test',auth['isAuthenticated'](),timeout(_0x0b3c('0xd')),controller['test']);router[_0x0b3c('0xe')]('/',auth[_0x0b3c('0xb')](),controller[_0x0b3c('0xf')]);router[_0x0b3c('0x10')]('/:id',auth[_0x0b3c('0xb')](),controller[_0x0b3c('0x11')]);router[_0x0b3c('0x12')](_0x0b3c('0x13'),auth['isAuthenticated'](),controller[_0x0b3c('0x14')]);module[_0x0b3c('0x15')]=router; \ No newline at end of file +var _0x817a=['put','update','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','index','/:id','isAuthenticated','/:id/test','test'];(function(_0xf89dab,_0x3aed37){var _0x548c35=function(_0x498859){while(--_0x498859){_0xf89dab['push'](_0xf89dab['shift']());}};_0x548c35(++_0x3aed37);}(_0x817a,0xe1));var _0xa817=function(_0x2310e9,_0x9a78cc){_0x2310e9=_0x2310e9-0x0;var _0x514e3b=_0x817a[_0x2310e9];return _0x514e3b;};'use strict';var multer=require(_0xa817('0x0'));var util=require(_0xa817('0x1'));var path=require('path');var timeout=require(_0xa817('0x2'));var express=require(_0xa817('0x3'));var router=express[_0xa817('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa817('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa817('0x6'));var controller=require('./squareOdbc.controller');router[_0xa817('0x7')]('/',auth['isAuthenticated'](),controller[_0xa817('0x8')]);router[_0xa817('0x7')](_0xa817('0x9'),auth[_0xa817('0xa')](),controller['show']);router[_0xa817('0x7')](_0xa817('0xb'),auth[_0xa817('0xa')](),timeout('15s'),controller[_0xa817('0xc')]);router['post']('/',auth[_0xa817('0xa')](),controller['create']);router[_0xa817('0xd')]('/:id',auth[_0xa817('0xa')](),controller[_0xa817('0xe')]);router[_0xa817('0xf')]('/:id',auth[_0xa817('0xa')](),controller['destroy']);module[_0xa817('0x10')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 312fe03..41ab934 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 _0x7e1f=['sequelize','exports','STRING','name'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x7e1f,0xa4));var _0xf7e1=function(_0x143cda,_0x320a3c){_0x143cda=_0x143cda-0x0;var _0x2bdc5c=_0x7e1f[_0x143cda];return _0x2bdc5c;};'use strict';var Sequelize=require(_0xf7e1('0x0'));module[_0xf7e1('0x1')]={'name':{'type':Sequelize[_0xf7e1('0x2')],'unique':_0xf7e1('0x3'),'allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xf7e1('0x2')]}}; \ No newline at end of file +var _0xa1e9=['STRING','name','sequelize','exports'];(function(_0x40a4a1,_0x4d3316){var _0x2be62d=function(_0x1c58d6){while(--_0x1c58d6){_0x40a4a1['push'](_0x40a4a1['shift']());}};_0x2be62d(++_0x4d3316);}(_0xa1e9,0xe2));var _0x9a1e=function(_0x434cc8,_0x3491fa){_0x434cc8=_0x434cc8-0x0;var _0x168291=_0xa1e9[_0x434cc8];return _0x168291;};'use strict';var Sequelize=require(_0x9a1e('0x0'));module[_0x9a1e('0x1')]={'name':{'type':Sequelize[_0x9a1e('0x2')],'unique':_0x9a1e('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0x9a1e('0x2')]},'description':{'type':Sequelize[_0x9a1e('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 6e6ff5c..e478777 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 _0xd24f=['openSync','closeSync','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','fs-extra','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','offset','undefined','limit','count','Content-Range','json','apply','update','then','destroy','get','error','stack','name','send','index','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','options','SquareOdbc','includeAll','include','rows','catch','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','ODBC','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','params','test','dsn','odbc'];(function(_0x4e2320,_0x108036){var _0x32581e=function(_0x250453){while(--_0x250453){_0x4e2320['push'](_0x4e2320['shift']());}};_0x32581e(++_0x108036);}(_0xd24f,0xa6));var _0xfd24=function(_0x3a07d4,_0xa80b88){_0x3a07d4=_0x3a07d4-0x0;var _0x2c352=_0xd24f[_0x3a07d4];return _0x2c352;};'use strict';var emlformat=require(_0xfd24('0x0'));var rimraf=require(_0xfd24('0x1'));var zipdir=require(_0xfd24('0x2'));var jsonpatch=require(_0xfd24('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xfd24('0x4'));var Mustache=require(_0xfd24('0x5'));var util=require(_0xfd24('0x6'));var path=require(_0xfd24('0x7'));var sox=require(_0xfd24('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfd24('0x9'));var _=require(_0xfd24('0xa'));var squel=require(_0xfd24('0xb'));var crypto=require('crypto');var jsforce=require(_0xfd24('0xc'));var deskjs=require(_0xfd24('0xd'));var toCsv=require('to-csv');var querystring=require(_0xfd24('0xe'));var Papa=require(_0xfd24('0xf'));var Redis=require(_0xfd24('0x10'));var authService=require(_0xfd24('0x11'));var qs=require(_0xfd24('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfd24('0x13'));var logger=require(_0xfd24('0x14'))('api');var utils=require(_0xfd24('0x15'));var config=require(_0xfd24('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xfd24('0x17'))['db'];function respondWithStatusCode(_0xb9df0f,_0x276291){_0x276291=_0x276291||0xcc;return function(_0x94a9ce){if(_0x94a9ce){return _0xb9df0f[_0xfd24('0x18')](_0x276291);}return _0xb9df0f[_0xfd24('0x19')](_0x276291)[_0xfd24('0x1a')]();};}function respondWithResult(_0x3b6db0,_0x1d91bf){_0x1d91bf=_0x1d91bf||0xc8;return function(_0x59e202){if(_0x59e202){return _0x3b6db0[_0xfd24('0x19')](_0x1d91bf)['json'](_0x59e202);}};}function respondWithFilteredResult(_0x1478b9,_0x597fa9){return function(_0x126d0a){if(_0x126d0a){var _0x57b127=typeof _0x597fa9[_0xfd24('0x1b')]===_0xfd24('0x1c')&&typeof _0x597fa9[_0xfd24('0x1d')]===_0xfd24('0x1c');var _0x27c7a6=_0x126d0a[_0xfd24('0x1e')];var _0x37727b=_0x57b127?0x0:_0x597fa9[_0xfd24('0x1b')];var _0xe58918=_0x57b127?_0x126d0a[_0xfd24('0x1e')]:_0x597fa9[_0xfd24('0x1b')]+_0x597fa9[_0xfd24('0x1d')];var _0x1576ad;if(_0xe58918>=_0x27c7a6){_0xe58918=_0x27c7a6;_0x1576ad=0xc8;}else{_0x1576ad=0xce;}_0x1478b9[_0xfd24('0x19')](_0x1576ad);return _0x1478b9['set'](_0xfd24('0x1f'),_0x37727b+'-'+_0xe58918+'/'+_0x27c7a6)[_0xfd24('0x20')](_0x126d0a);}return null;};}function patchUpdates(_0x8b0635){return function(_0x3a70b7){try{jsonpatch[_0xfd24('0x21')](_0x3a70b7,_0x8b0635,!![]);}catch(_0x3de8f9){return BPromise['reject'](_0x3de8f9);}return _0x3a70b7['save']();};}function saveUpdates(_0x540968,_0x4fb9cc){return function(_0x388a51){if(_0x388a51){return _0x388a51[_0xfd24('0x22')](_0x540968)[_0xfd24('0x23')](function(_0x10ff2d){return _0x10ff2d;});}return null;};}function removeEntity(_0x22449d,_0x22326d){return function(_0xdf74dc){if(_0xdf74dc){return _0xdf74dc[_0xfd24('0x24')]()['then'](function(){var _0x529a6f=_0xdf74dc[_0xfd24('0x25')]({'plain':!![]});var _0x2d37e6='ODBC';return db['UserProfileResource'][_0xfd24('0x24')]({'where':{'type':_0x2d37e6,'resourceId':_0x529a6f['id']}})[_0xfd24('0x23')](function(){return _0xdf74dc;});})[_0xfd24('0x23')](function(){_0x22449d[_0xfd24('0x19')](0xcc)[_0xfd24('0x1a')]();});}};}function handleEntityNotFound(_0xca6fc5,_0x52b44b){return function(_0x1da661){if(!_0x1da661){_0xca6fc5[_0xfd24('0x18')](0x194);}return _0x1da661;};}function handleError(_0x31b42e,_0x1d25ec){_0x1d25ec=_0x1d25ec||0x1f4;return function(_0x3349f2){logger[_0xfd24('0x26')](_0x3349f2[_0xfd24('0x27')]);if(_0x3349f2[_0xfd24('0x28')]){delete _0x3349f2[_0xfd24('0x28')];}_0x31b42e[_0xfd24('0x19')](_0x1d25ec)[_0xfd24('0x29')](_0x3349f2);};}exports[_0xfd24('0x2a')]=function(_0xc8bccc,_0x3cd023){var _0x2e6203={},_0x42b8be={},_0x384083={'count':0x0,'rows':[]};var _0x16b7d9=_['map'](db['SquareOdbc'][_0xfd24('0x2b')],function(_0x4ce4fa){return{'name':_0x4ce4fa[_0xfd24('0x2c')],'type':_0x4ce4fa[_0xfd24('0x2d')]['key']};});_0x42b8be[_0xfd24('0x2e')]=_[_0xfd24('0x2f')](_0x16b7d9,_0xfd24('0x28'));_0x42b8be[_0xfd24('0x30')]=_[_0xfd24('0x31')](_0xc8bccc['query']);_0x42b8be[_0xfd24('0x32')]=_[_0xfd24('0x33')](_0x42b8be[_0xfd24('0x2e')],_0x42b8be[_0xfd24('0x30')]);_0x2e6203['attributes']=_[_0xfd24('0x33')](_0x42b8be[_0xfd24('0x2e')],qs[_0xfd24('0x34')](_0xc8bccc[_0xfd24('0x30')][_0xfd24('0x34')]));_0x2e6203[_0xfd24('0x35')]=_0x2e6203[_0xfd24('0x35')]['length']?_0x2e6203[_0xfd24('0x35')]:_0x42b8be[_0xfd24('0x2e')];if(!_0xc8bccc['query']['hasOwnProperty'](_0xfd24('0x36'))){_0x2e6203['limit']=qs[_0xfd24('0x1d')](_0xc8bccc[_0xfd24('0x30')][_0xfd24('0x1d')]);_0x2e6203[_0xfd24('0x1b')]=qs['offset'](_0xc8bccc[_0xfd24('0x30')][_0xfd24('0x1b')]);}_0x2e6203[_0xfd24('0x37')]=qs[_0xfd24('0x38')](_0xc8bccc[_0xfd24('0x30')][_0xfd24('0x38')]);_0x2e6203[_0xfd24('0x39')]=qs[_0xfd24('0x32')](_[_0xfd24('0x3a')](_0xc8bccc[_0xfd24('0x30')],_0x42b8be[_0xfd24('0x32')]),_0x16b7d9);if(_0xc8bccc[_0xfd24('0x30')][_0xfd24('0x3b')]){_0x2e6203[_0xfd24('0x39')]=_['merge'](_0x2e6203[_0xfd24('0x39')],{'$or':_[_0xfd24('0x2f')](_0x16b7d9,function(_0x5cc7b0){if(_0x5cc7b0[_0xfd24('0x2d')]!=='VIRTUAL'){var _0x33ab97={};_0x33ab97[_0x5cc7b0[_0xfd24('0x28')]]={'$like':'%'+_0xc8bccc['query'][_0xfd24('0x3b')]+'%'};return _0x33ab97;}})});}_0x2e6203=_['merge']({},_0x2e6203,_0xc8bccc[_0xfd24('0x3c')]);var _0x176139={'where':_0x2e6203['where']};return db[_0xfd24('0x3d')]['count'](_0x176139)[_0xfd24('0x23')](function(_0x1e607c){_0x384083[_0xfd24('0x1e')]=_0x1e607c;if(_0xc8bccc[_0xfd24('0x30')][_0xfd24('0x3e')]){_0x2e6203[_0xfd24('0x3f')]=[{'all':!![]}];}return db[_0xfd24('0x3d')]['findAll'](_0x2e6203);})['then'](function(_0x3d7bc4){_0x384083[_0xfd24('0x40')]=_0x3d7bc4;return _0x384083;})['then'](respondWithFilteredResult(_0x3cd023,_0x2e6203))[_0xfd24('0x41')](handleError(_0x3cd023,null));};exports['show']=function(_0x211f73,_0x2a4c43){var _0x339f38={'raw':!![],'where':{'id':_0x211f73['params']['id']}},_0x3b322c={};_0x3b322c[_0xfd24('0x2e')]=_[_0xfd24('0x31')](db[_0xfd24('0x3d')][_0xfd24('0x2b')]);_0x3b322c[_0xfd24('0x30')]=_[_0xfd24('0x31')](_0x211f73[_0xfd24('0x30')]);_0x3b322c[_0xfd24('0x32')]=_['intersection'](_0x3b322c[_0xfd24('0x2e')],_0x3b322c[_0xfd24('0x30')]);_0x339f38[_0xfd24('0x35')]=_[_0xfd24('0x33')](_0x3b322c[_0xfd24('0x2e')],qs[_0xfd24('0x34')](_0x211f73[_0xfd24('0x30')][_0xfd24('0x34')]));_0x339f38[_0xfd24('0x35')]=_0x339f38[_0xfd24('0x35')]['length']?_0x339f38[_0xfd24('0x35')]:_0x3b322c['model'];if(_0x211f73[_0xfd24('0x30')][_0xfd24('0x3e')]){_0x339f38[_0xfd24('0x3f')]=[{'all':!![]}];}_0x339f38=_['merge']({},_0x339f38,_0x211f73[_0xfd24('0x3c')]);return db[_0xfd24('0x3d')][_0xfd24('0x42')](_0x339f38)[_0xfd24('0x23')](handleEntityNotFound(_0x2a4c43,null))[_0xfd24('0x23')](respondWithResult(_0x2a4c43,null))[_0xfd24('0x41')](handleError(_0x2a4c43,null));};exports[_0xfd24('0x43')]=function(_0x38887d,_0x26b63a){return db['SquareOdbc'][_0xfd24('0x43')](_0x38887d[_0xfd24('0x44')],{})[_0xfd24('0x23')](function(_0x4d8ee8){var _0x4d98a4=_0x38887d[_0xfd24('0x45')][_0xfd24('0x25')]({'plain':!![]});if(!_0x4d98a4)throw new Error(_0xfd24('0x46'));if(_0x4d98a4['role']===_0xfd24('0x45')){var _0x244f8b=_0x4d8ee8[_0xfd24('0x25')]({'plain':!![]});var _0x42eeb5=_0xfd24('0x47');return db[_0xfd24('0x48')]['find']({'where':{'name':_0x42eeb5,'userProfileId':_0x4d98a4[_0xfd24('0x49')]},'raw':!![]})[_0xfd24('0x23')](function(_0x30c11d){if(_0x30c11d&&_0x30c11d[_0xfd24('0x4a')]===0x0){return db[_0xfd24('0x4b')][_0xfd24('0x43')]({'name':_0x244f8b['name'],'resourceId':_0x244f8b['id'],'type':_0x30c11d[_0xfd24('0x28')],'sectionId':_0x30c11d['id']},{})[_0xfd24('0x23')](function(){return _0x4d8ee8;});}else{return _0x4d8ee8;}})['catch'](function(_0x3e1e7f){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3e1e7f);throw _0x3e1e7f;});}return _0x4d8ee8;})[_0xfd24('0x23')](respondWithResult(_0x26b63a,0xc9))[_0xfd24('0x41')](handleError(_0x26b63a,null));};exports['update']=function(_0x4138d5,_0xcfb586){if(_0x4138d5[_0xfd24('0x44')]['id']){delete _0x4138d5[_0xfd24('0x44')]['id'];}return db[_0xfd24('0x3d')][_0xfd24('0x42')]({'where':{'id':_0x4138d5['params']['id']}})[_0xfd24('0x23')](handleEntityNotFound(_0xcfb586,null))[_0xfd24('0x23')](saveUpdates(_0x4138d5[_0xfd24('0x44')],null))[_0xfd24('0x23')](respondWithResult(_0xcfb586,null))['catch'](handleError(_0xcfb586,null));};exports['destroy']=function(_0x553dbb,_0x2821fa){return db[_0xfd24('0x3d')][_0xfd24('0x42')]({'where':{'id':_0x553dbb[_0xfd24('0x4c')]['id']}})[_0xfd24('0x23')](handleEntityNotFound(_0x2821fa,null))[_0xfd24('0x23')](removeEntity(_0x2821fa,null))[_0xfd24('0x41')](handleError(_0x2821fa,null));};exports[_0xfd24('0x4d')]=function(_0x2f9565,_0x4d4fd5,_0x292dd5){var _0x200c25;return db['SquareOdbc']['find']({'where':{'id':_0x2f9565[_0xfd24('0x4c')]['id']},'attributes':['id',_0xfd24('0x4e')]})['then'](handleEntityNotFound(_0x4d4fd5,null))[_0xfd24('0x23')](function(_0x3ac763){if(_0x3ac763){var _0xf6643c=require(_0xfd24('0x4f'))();_0xf6643c[_0xfd24('0x50')](_0x3ac763[_0xfd24('0x4e')]);_0xf6643c[_0xfd24('0x51')]();return _0x3ac763;}})[_0xfd24('0x23')](respondWithResult(_0x4d4fd5,null))[_0xfd24('0x41')](handleError(_0x4d4fd5,null));}; \ No newline at end of file +var _0x02a2=['user','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','test','dsn','odbc','openSync','closeSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','get','ODBC','UserProfileResource','destroy','end','stack','name','map','SquareOdbc','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','options','include','findAll','rows','catch','show','create','body','role'];(function(_0x1a051d,_0x3a017a){var _0x275ccb=function(_0x1290ba){while(--_0x1290ba){_0x1a051d['push'](_0x1a051d['shift']());}};_0x275ccb(++_0x3a017a);}(_0x02a2,0xc0));var _0x202a=function(_0x2249db,_0x42ccd8){_0x2249db=_0x2249db-0x0;var _0x56adba=_0x02a2[_0x2249db];return _0x56adba;};'use strict';var emlformat=require(_0x202a('0x0'));var rimraf=require(_0x202a('0x1'));var zipdir=require(_0x202a('0x2'));var jsonpatch=require(_0x202a('0x3'));var rp=require(_0x202a('0x4'));var moment=require(_0x202a('0x5'));var BPromise=require(_0x202a('0x6'));var Mustache=require(_0x202a('0x7'));var util=require('util');var path=require(_0x202a('0x8'));var sox=require(_0x202a('0x9'));var csv=require(_0x202a('0xa'));var ejs=require(_0x202a('0xb'));var fs=require('fs');var fs_extra=require(_0x202a('0xc'));var _=require('lodash');var squel=require(_0x202a('0xd'));var crypto=require(_0x202a('0xe'));var jsforce=require(_0x202a('0xf'));var deskjs=require(_0x202a('0x10'));var toCsv=require('to-csv');var querystring=require(_0x202a('0x11'));var Papa=require(_0x202a('0x12'));var Redis=require(_0x202a('0x13'));var authService=require(_0x202a('0x14'));var qs=require(_0x202a('0x15'));var as=require(_0x202a('0x16'));var hardwareService=require(_0x202a('0x17'));var logger=require(_0x202a('0x18'))('api');var utils=require(_0x202a('0x19'));var config=require(_0x202a('0x1a'));var licenseUtil=require(_0x202a('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x537314,_0x180e18){_0x180e18=_0x180e18||0xcc;return function(_0x6476ec){if(_0x6476ec){return _0x537314[_0x202a('0x1c')](_0x180e18);}return _0x537314[_0x202a('0x1d')](_0x180e18)['end']();};}function respondWithResult(_0x32da79,_0x528083){_0x528083=_0x528083||0xc8;return function(_0x29ba79){if(_0x29ba79){return _0x32da79[_0x202a('0x1d')](_0x528083)['json'](_0x29ba79);}};}function respondWithFilteredResult(_0x150a4b,_0x516826){return function(_0x3e6f6c){if(_0x3e6f6c){var _0xb6de3f=typeof _0x516826[_0x202a('0x1e')]===_0x202a('0x1f')&&typeof _0x516826[_0x202a('0x20')]===_0x202a('0x1f');var _0x4a9045=_0x3e6f6c[_0x202a('0x21')];var _0x44cb5f=_0xb6de3f?0x0:_0x516826[_0x202a('0x1e')];var _0x4b9d35=_0xb6de3f?_0x3e6f6c[_0x202a('0x21')]:_0x516826['offset']+_0x516826[_0x202a('0x20')];var _0x5453a0;if(_0x4b9d35>=_0x4a9045){_0x4b9d35=_0x4a9045;_0x5453a0=0xc8;}else{_0x5453a0=0xce;}_0x150a4b[_0x202a('0x1d')](_0x5453a0);return _0x150a4b[_0x202a('0x22')](_0x202a('0x23'),_0x44cb5f+'-'+_0x4b9d35+'/'+_0x4a9045)[_0x202a('0x24')](_0x3e6f6c);}return null;};}function patchUpdates(_0x29fed0){return function(_0x25bb13){try{jsonpatch[_0x202a('0x25')](_0x25bb13,_0x29fed0,!![]);}catch(_0x31d38a){return BPromise[_0x202a('0x26')](_0x31d38a);}return _0x25bb13[_0x202a('0x27')]();};}function saveUpdates(_0x4f18ec,_0xbe1f7c){return function(_0x123b80){if(_0x123b80){return _0x123b80['update'](_0x4f18ec)[_0x202a('0x28')](function(_0x18f794){return _0x18f794;});}return null;};}function removeEntity(_0x360612,_0x10f9b7){return function(_0x4e3580){if(_0x4e3580){return _0x4e3580['destroy']()[_0x202a('0x28')](function(){var _0x356f17=_0x4e3580[_0x202a('0x29')]({'plain':!![]});var _0x1e2299=_0x202a('0x2a');return db[_0x202a('0x2b')][_0x202a('0x2c')]({'where':{'type':_0x1e2299,'resourceId':_0x356f17['id']}})['then'](function(){return _0x4e3580;});})[_0x202a('0x28')](function(){_0x360612[_0x202a('0x1d')](0xcc)[_0x202a('0x2d')]();});}};}function handleEntityNotFound(_0x21ed75,_0x4360ad){return function(_0x1ed1a4){if(!_0x1ed1a4){_0x21ed75[_0x202a('0x1c')](0x194);}return _0x1ed1a4;};}function handleError(_0x19016e,_0x41101f){_0x41101f=_0x41101f||0x1f4;return function(_0x47ceac){logger['error'](_0x47ceac[_0x202a('0x2e')]);if(_0x47ceac[_0x202a('0x2f')]){delete _0x47ceac[_0x202a('0x2f')];}_0x19016e[_0x202a('0x1d')](_0x41101f)['send'](_0x47ceac);};}exports['index']=function(_0x36626e,_0x433337){var _0x293bab={},_0xe0d1ba={},_0x594914={'count':0x0,'rows':[]};var _0x6eb07f=_[_0x202a('0x30')](db[_0x202a('0x31')][_0x202a('0x32')],function(_0x1a3b48){return{'name':_0x1a3b48[_0x202a('0x33')],'type':_0x1a3b48['type'][_0x202a('0x34')]};});_0xe0d1ba[_0x202a('0x35')]=_[_0x202a('0x30')](_0x6eb07f,_0x202a('0x2f'));_0xe0d1ba['query']=_[_0x202a('0x36')](_0x36626e[_0x202a('0x37')]);_0xe0d1ba[_0x202a('0x38')]=_[_0x202a('0x39')](_0xe0d1ba[_0x202a('0x35')],_0xe0d1ba[_0x202a('0x37')]);_0x293bab[_0x202a('0x3a')]=_['intersection'](_0xe0d1ba[_0x202a('0x35')],qs[_0x202a('0x3b')](_0x36626e[_0x202a('0x37')][_0x202a('0x3b')]));_0x293bab[_0x202a('0x3a')]=_0x293bab[_0x202a('0x3a')][_0x202a('0x3c')]?_0x293bab[_0x202a('0x3a')]:_0xe0d1ba['model'];if(!_0x36626e[_0x202a('0x37')][_0x202a('0x3d')]('nolimit')){_0x293bab['limit']=qs[_0x202a('0x20')](_0x36626e[_0x202a('0x37')][_0x202a('0x20')]);_0x293bab[_0x202a('0x1e')]=qs[_0x202a('0x1e')](_0x36626e[_0x202a('0x37')][_0x202a('0x1e')]);}_0x293bab[_0x202a('0x3e')]=qs[_0x202a('0x3f')](_0x36626e['query'][_0x202a('0x3f')]);_0x293bab[_0x202a('0x40')]=qs[_0x202a('0x38')](_[_0x202a('0x41')](_0x36626e[_0x202a('0x37')],_0xe0d1ba[_0x202a('0x38')]),_0x6eb07f);if(_0x36626e[_0x202a('0x37')][_0x202a('0x42')]){_0x293bab[_0x202a('0x40')]=_[_0x202a('0x43')](_0x293bab[_0x202a('0x40')],{'$or':_['map'](_0x6eb07f,function(_0x28befe){if(_0x28befe[_0x202a('0x44')]!=='VIRTUAL'){var _0x29c959={};_0x29c959[_0x28befe[_0x202a('0x2f')]]={'$like':'%'+_0x36626e[_0x202a('0x37')][_0x202a('0x42')]+'%'};return _0x29c959;}})});}_0x293bab=_[_0x202a('0x43')]({},_0x293bab,_0x36626e[_0x202a('0x45')]);var _0x17247c={'where':_0x293bab[_0x202a('0x40')]};return db[_0x202a('0x31')][_0x202a('0x21')](_0x17247c)[_0x202a('0x28')](function(_0x36938b){_0x594914['count']=_0x36938b;if(_0x36626e['query']['includeAll']){_0x293bab[_0x202a('0x46')]=[{'all':!![]}];}return db[_0x202a('0x31')][_0x202a('0x47')](_0x293bab);})[_0x202a('0x28')](function(_0x3ce4e9){_0x594914[_0x202a('0x48')]=_0x3ce4e9;return _0x594914;})[_0x202a('0x28')](respondWithFilteredResult(_0x433337,_0x293bab))[_0x202a('0x49')](handleError(_0x433337,null));};exports[_0x202a('0x4a')]=function(_0x3f7f0a,_0x404032){var _0x4ac53f={'raw':!![],'where':{'id':_0x3f7f0a['params']['id']}},_0x280f24={};_0x280f24[_0x202a('0x35')]=_[_0x202a('0x36')](db[_0x202a('0x31')][_0x202a('0x32')]);_0x280f24['query']=_[_0x202a('0x36')](_0x3f7f0a[_0x202a('0x37')]);_0x280f24[_0x202a('0x38')]=_[_0x202a('0x39')](_0x280f24[_0x202a('0x35')],_0x280f24[_0x202a('0x37')]);_0x4ac53f[_0x202a('0x3a')]=_[_0x202a('0x39')](_0x280f24[_0x202a('0x35')],qs['fields'](_0x3f7f0a[_0x202a('0x37')][_0x202a('0x3b')]));_0x4ac53f[_0x202a('0x3a')]=_0x4ac53f[_0x202a('0x3a')]['length']?_0x4ac53f[_0x202a('0x3a')]:_0x280f24[_0x202a('0x35')];if(_0x3f7f0a['query']['includeAll']){_0x4ac53f[_0x202a('0x46')]=[{'all':!![]}];}_0x4ac53f=_[_0x202a('0x43')]({},_0x4ac53f,_0x3f7f0a[_0x202a('0x45')]);return db[_0x202a('0x31')]['find'](_0x4ac53f)[_0x202a('0x28')](handleEntityNotFound(_0x404032,null))[_0x202a('0x28')](respondWithResult(_0x404032,null))['catch'](handleError(_0x404032,null));};exports[_0x202a('0x4b')]=function(_0x185f0a,_0x93dadf){return db['SquareOdbc'][_0x202a('0x4b')](_0x185f0a[_0x202a('0x4c')],{})[_0x202a('0x28')](function(_0x36b667){var _0x58ec12=_0x185f0a['user'][_0x202a('0x29')]({'plain':!![]});if(!_0x58ec12)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x58ec12[_0x202a('0x4d')]===_0x202a('0x4e')){var _0x283e6d=_0x36b667['get']({'plain':!![]});var _0x53ad38=_0x202a('0x2a');return db[_0x202a('0x4f')][_0x202a('0x50')]({'where':{'name':_0x53ad38,'userProfileId':_0x58ec12['userProfileId']},'raw':!![]})[_0x202a('0x28')](function(_0x59b1b2){if(_0x59b1b2&&_0x59b1b2[_0x202a('0x51')]===0x0){return db[_0x202a('0x2b')][_0x202a('0x4b')]({'name':_0x283e6d[_0x202a('0x2f')],'resourceId':_0x283e6d['id'],'type':_0x59b1b2[_0x202a('0x2f')],'sectionId':_0x59b1b2['id']},{})[_0x202a('0x28')](function(){return _0x36b667;});}else{return _0x36b667;}})['catch'](function(_0x545a03){logger['error'](_0x202a('0x52'),_0x545a03);throw _0x545a03;});}return _0x36b667;})[_0x202a('0x28')](respondWithResult(_0x93dadf,0xc9))['catch'](handleError(_0x93dadf,null));};exports[_0x202a('0x53')]=function(_0x36c367,_0x2ebae4){if(_0x36c367[_0x202a('0x4c')]['id']){delete _0x36c367[_0x202a('0x4c')]['id'];}return db[_0x202a('0x31')][_0x202a('0x50')]({'where':{'id':_0x36c367[_0x202a('0x54')]['id']}})[_0x202a('0x28')](handleEntityNotFound(_0x2ebae4,null))[_0x202a('0x28')](saveUpdates(_0x36c367[_0x202a('0x4c')],null))[_0x202a('0x28')](respondWithResult(_0x2ebae4,null))[_0x202a('0x49')](handleError(_0x2ebae4,null));};exports[_0x202a('0x2c')]=function(_0x245b8f,_0x13d697){return db[_0x202a('0x31')][_0x202a('0x50')]({'where':{'id':_0x245b8f['params']['id']}})[_0x202a('0x28')](handleEntityNotFound(_0x13d697,null))[_0x202a('0x28')](removeEntity(_0x13d697,null))[_0x202a('0x49')](handleError(_0x13d697,null));};exports[_0x202a('0x55')]=function(_0x1610fd,_0x14a9fd,_0x207743){var _0x2c291a;return db[_0x202a('0x31')][_0x202a('0x50')]({'where':{'id':_0x1610fd[_0x202a('0x54')]['id']},'attributes':['id',_0x202a('0x56')]})['then'](handleEntityNotFound(_0x14a9fd,null))['then'](function(_0x1c1c46){if(_0x1c1c46){var _0x20f204=require(_0x202a('0x57'))();_0x20f204[_0x202a('0x58')](_0x1c1c46[_0x202a('0x56')]);_0x20f204[_0x202a('0x59')]();return _0x1c1c46;}})[_0x202a('0x28')](respondWithResult(_0x14a9fd,null))['catch'](handleError(_0x14a9fd,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index d1ae44e..9fa938c 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 _0x5bfb=['SquareOdbc','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5bfb,0xd2));var _0xb5bf=function(_0x159736,_0x15d071){_0x159736=_0x159736-0x0;var _0xf9be5e=_0x5bfb[_0x159736];return _0xf9be5e;};'use strict';var _=require('lodash');var util=require(_0xb5bf('0x0'));var logger=require(_0xb5bf('0x1'))(_0xb5bf('0x2'));var moment=require('moment');var BPromise=require(_0xb5bf('0x3'));var rp=require(_0xb5bf('0x4'));var fs=require('fs');var path=require(_0xb5bf('0x5'));var rimraf=require(_0xb5bf('0x6'));var config=require(_0xb5bf('0x7'));var attributes=require('./squareOdbc.attributes');module[_0xb5bf('0x8')]=function(_0x5d69be,_0x55e8fb){return _0x5d69be[_0xb5bf('0x9')](_0xb5bf('0xa'),attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf605=['define','SquareOdbc','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','exports'];(function(_0x25662e,_0x4cec68){var _0x59b7bc=function(_0xafb159){while(--_0xafb159){_0x25662e['push'](_0x25662e['shift']());}};_0x59b7bc(++_0x4cec68);}(_0xf605,0xe9));var _0x5f60=function(_0x5811f0,_0x13ba47){_0x5811f0=_0x5811f0-0x0;var _0x3f7013=_0xf605[_0x5811f0];return _0x3f7013;};'use strict';var _=require(_0x5f60('0x0'));var util=require(_0x5f60('0x1'));var logger=require(_0x5f60('0x2'))(_0x5f60('0x3'));var moment=require(_0x5f60('0x4'));var BPromise=require(_0x5f60('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5f60('0x6'));var config=require(_0x5f60('0x7'));var attributes=require('./squareOdbc.attributes');module[_0x5f60('0x8')]=function(_0x2d58ca,_0x38a75a){return _0x2d58ca[_0x5f60('0x9')](_0x5f60('0xa'),attributes,{'tableName':'square_odbc','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 8631453..f9326c4 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 _0x70c2=['moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareOdbc,\x20%s,\x20%s','message','result','find','options','raw','where','attributes','include','map','model','ShowSquareOdbc','debug','catch','lodash','util'];(function(_0x2b8077,_0x453634){var _0x308091=function(_0x426df7){while(--_0x426df7){_0x2b8077['push'](_0x2b8077['shift']());}};_0x308091(++_0x453634);}(_0x70c2,0x86));var _0x270c=function(_0x192eb8,_0x2fa109){_0x192eb8=_0x192eb8-0x0;var _0x398bc4=_0x70c2[_0x192eb8];return _0x398bc4;};'use strict';var _=require(_0x270c('0x0'));var util=require(_0x270c('0x1'));var moment=require(_0x270c('0x2'));var BPromise=require('bluebird');var rs=require(_0x270c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x270c('0x4'))['db'];var utils=require(_0x270c('0x5'));var logger=require(_0x270c('0x6'))(_0x270c('0x7'));var config=require(_0x270c('0x8'));var jayson=require(_0x270c('0x9'));var client=jayson[_0x270c('0xa')][_0x270c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4e9bc9,_0x16fbfe,_0xebcb40){return new BPromise(function(_0x3e8fad,_0x150445){return client[_0x270c('0xc')](_0x4e9bc9,_0xebcb40)[_0x270c('0xd')](function(_0x3e2b14){logger[_0x270c('0xe')]('SquareOdbc,\x20%s,\x20%s',_0x16fbfe,_0x270c('0xf'));logger['debug'](_0x270c('0x10'),_0x16fbfe,_0x270c('0xf'),JSON[_0x270c('0x11')](_0x3e2b14));if(_0x3e2b14[_0x270c('0x12')]){if(_0x3e2b14[_0x270c('0x12')][_0x270c('0x13')]===0x1f4){logger['error'](_0x270c('0x14'),_0x16fbfe,_0x3e2b14[_0x270c('0x12')][_0x270c('0x15')]);return _0x150445(_0x3e2b14[_0x270c('0x12')][_0x270c('0x15')]);}logger[_0x270c('0x12')](_0x270c('0x14'),_0x16fbfe,_0x3e2b14[_0x270c('0x12')][_0x270c('0x15')]);return _0x3e8fad(_0x3e2b14[_0x270c('0x12')][_0x270c('0x15')]);}else{logger[_0x270c('0xe')](_0x270c('0x14'),_0x16fbfe,_0x270c('0xf'));_0x3e8fad(_0x3e2b14[_0x270c('0x16')]['message']);}})['catch'](function(_0x1db8b8){logger[_0x270c('0x12')]('SquareOdbc,\x20%s,\x20%s',_0x16fbfe,_0x1db8b8);_0x150445(_0x1db8b8);});});}exports['ShowSquareOdbc']=function(_0x364d95){var _0x2f8ce0=this;return new Promise(function(_0xa6d0ed,_0x29ea0e){return db['SquareOdbc'][_0x270c('0x17')]({'raw':_0x364d95[_0x270c('0x18')]?_0x364d95[_0x270c('0x18')][_0x270c('0x19')]===undefined?!![]:![]:!![],'where':_0x364d95['options']?_0x364d95['options'][_0x270c('0x1a')]||null:null,'attributes':_0x364d95['options']?_0x364d95[_0x270c('0x18')][_0x270c('0x1b')]||null:null,'include':_0x364d95['options']?_0x364d95[_0x270c('0x18')][_0x270c('0x1c')]?_[_0x270c('0x1d')](_0x364d95['options']['include'],function(_0x374a86){return{'model':db[_0x374a86[_0x270c('0x1e')]],'as':_0x374a86['as'],'attributes':_0x374a86[_0x270c('0x1b')],'include':_0x374a86['include']?_['map'](_0x374a86[_0x270c('0x1c')],function(_0x3b651d){return{'model':db[_0x3b651d[_0x270c('0x1e')]],'as':_0x3b651d['as'],'attributes':_0x3b651d['attributes'],'include':_0x3b651d[_0x270c('0x1c')]?_['map'](_0x3b651d[_0x270c('0x1c')],function(_0x368eed){return{'model':db[_0x368eed[_0x270c('0x1e')]],'as':_0x368eed['as'],'attributes':_0x368eed[_0x270c('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x270c('0xd')](function(_0x426e12){logger[_0x270c('0xe')](_0x270c('0x1f'),_0x364d95);logger[_0x270c('0x20')]('ShowSquareOdbc',_0x364d95,JSON[_0x270c('0x11')](_0x426e12));_0xa6d0ed(_0x426e12);})[_0x270c('0x21')](function(_0x1a2039){logger[_0x270c('0x12')](_0x270c('0x1f'),_0x1a2039[_0x270c('0x15')],_0x364d95);_0x29ea0e(_0x2f8ce0[_0x270c('0x12')](0x1f4,_0x1a2039['message']));});});}; \ No newline at end of file +var _0x3661=['info','SquareOdbc,\x20%s,\x20%s','request\x20sent','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','find','options','where','map','include','attributes','model','debug','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x28336d,_0x1687f8){var _0x45e093=function(_0x4ef8fd){while(--_0x4ef8fd){_0x28336d['push'](_0x28336d['shift']());}};_0x45e093(++_0x1687f8);}(_0x3661,0x15c));var _0x1366=function(_0x5506d2,_0x14f5d6){_0x5506d2=_0x5506d2-0x0;var _0x3ba725=_0x3661[_0x5506d2];return _0x3ba725;};'use strict';var _=require(_0x1366('0x0'));var util=require(_0x1366('0x1'));var moment=require('moment');var BPromise=require(_0x1366('0x2'));var rs=require(_0x1366('0x3'));var fs=require('fs');var Redis=require(_0x1366('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1366('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x1366('0x6'));var jayson=require(_0x1366('0x7'));var client=jayson[_0x1366('0x8')][_0x1366('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x244018,_0x3bddb2,_0x137bec){return new BPromise(function(_0x34b7fd,_0x5a86df){return client[_0x1366('0xa')](_0x244018,_0x137bec)[_0x1366('0xb')](function(_0x5d21bd){logger[_0x1366('0xc')](_0x1366('0xd'),_0x3bddb2,_0x1366('0xe'));logger['debug'](_0x1366('0xf'),_0x3bddb2,_0x1366('0xe'),JSON[_0x1366('0x10')](_0x5d21bd));if(_0x5d21bd['error']){if(_0x5d21bd[_0x1366('0x11')][_0x1366('0x12')]===0x1f4){logger[_0x1366('0x11')](_0x1366('0xd'),_0x3bddb2,_0x5d21bd[_0x1366('0x11')][_0x1366('0x13')]);return _0x5a86df(_0x5d21bd['error'][_0x1366('0x13')]);}logger[_0x1366('0x11')](_0x1366('0xd'),_0x3bddb2,_0x5d21bd[_0x1366('0x11')][_0x1366('0x13')]);return _0x34b7fd(_0x5d21bd[_0x1366('0x11')][_0x1366('0x13')]);}else{logger[_0x1366('0xc')](_0x1366('0xd'),_0x3bddb2,_0x1366('0xe'));_0x34b7fd(_0x5d21bd[_0x1366('0x14')][_0x1366('0x13')]);}})[_0x1366('0x15')](function(_0x181ddb){logger[_0x1366('0x11')]('SquareOdbc,\x20%s,\x20%s',_0x3bddb2,_0x181ddb);_0x5a86df(_0x181ddb);});});}exports['ShowSquareOdbc']=function(_0x45bedf){var _0x499fcd=this;return new Promise(function(_0x1fb880,_0x57ed0c){return db['SquareOdbc'][_0x1366('0x16')]({'raw':_0x45bedf['options']?_0x45bedf[_0x1366('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x45bedf[_0x1366('0x17')]?_0x45bedf['options'][_0x1366('0x18')]||null:null,'attributes':_0x45bedf[_0x1366('0x17')]?_0x45bedf[_0x1366('0x17')]['attributes']||null:null,'include':_0x45bedf[_0x1366('0x17')]?_0x45bedf[_0x1366('0x17')]['include']?_[_0x1366('0x19')](_0x45bedf[_0x1366('0x17')][_0x1366('0x1a')],function(_0x4053fe){return{'model':db[_0x4053fe['model']],'as':_0x4053fe['as'],'attributes':_0x4053fe[_0x1366('0x1b')],'include':_0x4053fe[_0x1366('0x1a')]?_['map'](_0x4053fe[_0x1366('0x1a')],function(_0x5411c6){return{'model':db[_0x5411c6[_0x1366('0x1c')]],'as':_0x5411c6['as'],'attributes':_0x5411c6['attributes'],'include':_0x5411c6[_0x1366('0x1a')]?_[_0x1366('0x19')](_0x5411c6['include'],function(_0x272171){return{'model':db[_0x272171[_0x1366('0x1c')]],'as':_0x272171['as'],'attributes':_0x272171['attributes']};}):[]};}):[]};}):[]:[]})[_0x1366('0xb')](function(_0x22956a){logger[_0x1366('0xc')]('ShowSquareOdbc',_0x45bedf);logger[_0x1366('0x1d')]('ShowSquareOdbc',_0x45bedf,JSON[_0x1366('0x10')](_0x22956a));_0x1fb880(_0x22956a);})[_0x1366('0x15')](function(_0x19b7e2){logger[_0x1366('0x11')]('ShowSquareOdbc',_0x19b7e2[_0x1366('0x13')],_0x45bedf);_0x57ed0c(_0x499fcd[_0x1366('0x11')](0x1f4,_0x19b7e2[_0x1366('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index e587d8f..6e1acbd 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 _0xed22=['../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0xed22,0x7e));var _0x2ed2=function(_0x41e7a0,_0x526a78){_0x41e7a0=_0x41e7a0-0x0;var _0x3ddb6a=_0xed22[_0x41e7a0];return _0x3ddb6a;};'use strict';var multer=require(_0x2ed2('0x0'));var util=require(_0x2ed2('0x1'));var path=require(_0x2ed2('0x2'));var timeout=require(_0x2ed2('0x3'));var express=require(_0x2ed2('0x4'));var router=express[_0x2ed2('0x5')]();var fs_extra=require(_0x2ed2('0x6'));var auth=require(_0x2ed2('0x7'));var interaction=require(_0x2ed2('0x8'));var config=require('../../config/environment');var controller=require('./squareProject.controller');router[_0x2ed2('0x9')]('/',auth[_0x2ed2('0xa')](),controller[_0x2ed2('0xb')]);router[_0x2ed2('0x9')](_0x2ed2('0xc'),auth[_0x2ed2('0xa')](),controller[_0x2ed2('0xd')]);router[_0x2ed2('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x2ed2('0xc'),auth[_0x2ed2('0xa')](),controller[_0x2ed2('0xf')]);router[_0x2ed2('0x10')](_0x2ed2('0xc'),auth[_0x2ed2('0xa')](),controller[_0x2ed2('0x11')]);module[_0x2ed2('0x12')]=router; \ No newline at end of file +var _0xa5f8=['get','isAuthenticated','post','create','/:id','update','destroy','exports','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','index'];(function(_0x2fa367,_0x50c193){var _0x469cea=function(_0x2eb09f){while(--_0x2eb09f){_0x2fa367['push'](_0x2fa367['shift']());}};_0x469cea(++_0x50c193);}(_0xa5f8,0x1d8));var _0x8a5f=function(_0x55c15f,_0x52cac0){_0x55c15f=_0x55c15f-0x0;var _0x11bcc4=_0xa5f8[_0x55c15f];return _0x11bcc4;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x8a5f('0x0'));var express=require('express');var router=express[_0x8a5f('0x1')]();var fs_extra=require(_0x8a5f('0x2'));var auth=require(_0x8a5f('0x3'));var interaction=require(_0x8a5f('0x4'));var config=require(_0x8a5f('0x5'));var controller=require(_0x8a5f('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x8a5f('0x7')]);router[_0x8a5f('0x8')]('/:id',auth[_0x8a5f('0x9')](),controller['show']);router[_0x8a5f('0xa')]('/',auth[_0x8a5f('0x9')](),controller[_0x8a5f('0xb')]);router['put'](_0x8a5f('0xc'),auth[_0x8a5f('0x9')](),controller[_0x8a5f('0xd')]);router['delete'](_0x8a5f('0xc'),auth[_0x8a5f('0x9')](),controller[_0x8a5f('0xe')]);module[_0x8a5f('0xf')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 2e79917..f74956f 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 _0x4879=['TEXT','BLOB','long','getDataValue','preproduction','toString','utf8','production','sequelize','exports','STRING','name'];(function(_0x536137,_0x3014c3){var _0x8a2009=function(_0x2bb4e2){while(--_0x2bb4e2){_0x536137['push'](_0x536137['shift']());}};_0x8a2009(++_0x3014c3);}(_0x4879,0x104));var _0x9487=function(_0x316837,_0x7cf798){_0x316837=_0x316837-0x0;var _0x553760=_0x4879[_0x316837];return _0x553760;};'use strict';var Sequelize=require(_0x9487('0x0'));module[_0x9487('0x1')]={'name':{'type':Sequelize[_0x9487('0x2')],'unique':_0x9487('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x9487('0x2')]},'notes':{'type':Sequelize[_0x9487('0x4')]},'preproduction':{'type':Sequelize[_0x9487('0x5')](_0x9487('0x6')),'get':function(){if(this[_0x9487('0x7')](_0x9487('0x8'))){return this[_0x9487('0x7')](_0x9487('0x8'))[_0x9487('0x9')](_0x9487('0xa'));}}},'production':{'type':Sequelize['BLOB'](_0x9487('0x6')),'get':function(){if(this[_0x9487('0x7')]('production')){return this['getDataValue'](_0x9487('0xb'))['toString'](_0x9487('0xa'));}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0xea21=['name','TEXT','long','getDataValue','preproduction','toString','utf8','BLOB','production','DATE','sequelize','exports','STRING'];(function(_0x1070e0,_0x2672a9){var _0x2a5d4b=function(_0x6bef7d){while(--_0x6bef7d){_0x1070e0['push'](_0x1070e0['shift']());}};_0x2a5d4b(++_0x2672a9);}(_0xea21,0xf4));var _0x1ea2=function(_0x39741a,_0x5ce5af){_0x39741a=_0x39741a-0x0;var _0x1f50a7=_0xea21[_0x39741a];return _0x1f50a7;};'use strict';var Sequelize=require(_0x1ea2('0x0'));module[_0x1ea2('0x1')]={'name':{'type':Sequelize[_0x1ea2('0x2')],'unique':_0x1ea2('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x1ea2('0x2')]},'notes':{'type':Sequelize[_0x1ea2('0x4')]},'preproduction':{'type':Sequelize['BLOB'](_0x1ea2('0x5')),'get':function(){if(this['getDataValue']('preproduction')){return this[_0x1ea2('0x6')](_0x1ea2('0x7'))[_0x1ea2('0x8')](_0x1ea2('0x9'));}}},'production':{'type':Sequelize[_0x1ea2('0xa')]('long'),'get':function(){if(this['getDataValue'](_0x1ea2('0xb'))){return this[_0x1ea2('0x6')]('production')['toString'](_0x1ea2('0x9'));}}},'savedAt':{'type':Sequelize[_0x1ea2('0xc')]},'publishedAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 20a104d..8e488d5 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 _0x562b=['stack','name','index','map','rawAttributes','fieldName','type','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','SquareProject','includeAll','include','findAll','catch','show','keys','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','body','../../config/logger','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','register','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','SquareProjects','UserProfileResource','publish','agi','stringify','end'];(function(_0xa5fc25,_0xb95312){var _0x44c33c=function(_0x3404f0){while(--_0x3404f0){_0xa5fc25['push'](_0xa5fc25['shift']());}};_0x44c33c(++_0xb95312);}(_0x562b,0x128));var _0xb562=function(_0x1eda20,_0x1149f4){_0x1eda20=_0x1eda20-0x0;var _0x31b953=_0x562b[_0x1eda20];return _0x31b953;};'use strict';var _=require('lodash');var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0xb562('0x0'))(_0xb562('0x1'));var config=require(_0xb562('0x2'));var db=require(_0xb562('0x3'))['db'];config[_0xb562('0x4')]=_['defaults'](config[_0xb562('0x4')],{'host':'localhost','port':0x18eb});var socket=require(_0xb562('0x5'))(new Redis(config['redis']));require('./squareProject.socket')[_0xb562('0x6')](socket);function respondWithResult(_0x39ce9e,_0x1e86bc){_0x1e86bc=_0x1e86bc||0xc8;return function(_0x345315){if(_0x345315){return _0x39ce9e[_0xb562('0x7')](_0x1e86bc)[_0xb562('0x8')](_0x345315);}};}function respondWithFilteredResult(_0x1c7a86,_0x1a17c6){return function(_0x3a2f8f){if(_0x3a2f8f){var _0x2f11b9=typeof _0x1a17c6[_0xb562('0x9')]===_0xb562('0xa')&&typeof _0x1a17c6[_0xb562('0xb')]===_0xb562('0xa');var _0x54c74b=_0x3a2f8f[_0xb562('0xc')];var _0x2cbf04=_0x2f11b9?0x0:_0x1a17c6[_0xb562('0x9')];var _0x1ea6c7=_0x2f11b9?_0x3a2f8f[_0xb562('0xc')]:_0x1a17c6[_0xb562('0x9')]+_0x1a17c6[_0xb562('0xb')];var _0x458655;if(_0x1ea6c7>=_0x54c74b){_0x1ea6c7=_0x54c74b;_0x458655=0xc8;}else{_0x458655=0xce;}_0x1c7a86['status'](_0x458655);return _0x1c7a86[_0xb562('0xd')](_0xb562('0xe'),_0x2cbf04+'-'+_0x1ea6c7+'/'+_0x54c74b)[_0xb562('0x8')](_0x3a2f8f);}return null;};}function saveUpdates(_0x565963){return function(_0xae2c97){if(_0xae2c97){return _0xae2c97[_0xb562('0xf')](_0x565963)[_0xb562('0x10')](function(_0x52e861){return _0x52e861;});}return null;};}function removeEntity(_0x3e58b6){return function(_0x182272){if(_0x182272){return _0x182272[_0xb562('0x11')]()[_0xb562('0x10')](function(){var _0x4145a6=_0x182272['get']({'plain':!![]});var _0x22bc70=_0xb562('0x12');return db[_0xb562('0x13')]['destroy']({'where':{'type':_0x22bc70,'resourceId':_0x4145a6['id']}})[_0xb562('0x10')](function(){return _0x182272;});})['then'](function(){var _0xae2400=new Redis(config['redis']);_0xae2400[_0xb562('0x14')](_0xb562('0x15'),JSON[_0xb562('0x16')]({'id':_0x182272['id'],'deleted':!![]}));})[_0xb562('0x10')](function(){_0x3e58b6[_0xb562('0x7')](0xcc)[_0xb562('0x17')]();});}};}function handleEntityNotFound(_0x235f08){return function(_0x3250d8){if(!_0x3250d8){_0x235f08['sendStatus'](0x194);}return _0x3250d8;};}function handleError(_0x1a3afd,_0x37bebd){_0x37bebd=_0x37bebd||0x1f4;return function(_0x1c23ce){logger['error'](_0x1c23ce[_0xb562('0x18')]);if(_0x1c23ce[_0xb562('0x19')]){delete _0x1c23ce[_0xb562('0x19')];}_0x1a3afd[_0xb562('0x7')](_0x37bebd)['send'](_0x1c23ce);};}exports[_0xb562('0x1a')]=function(_0x58a0e2,_0x1dc7b8){var _0x414075={},_0x43bd5e={},_0x3947a9={'count':0x0,'rows':[]};var _0x2997df=_[_0xb562('0x1b')](db['SquareProject'][_0xb562('0x1c')],function(_0x65b4d9){return{'name':_0x65b4d9[_0xb562('0x1d')],'type':_0x65b4d9[_0xb562('0x1e')]['key']};});_0x43bd5e[_0xb562('0x1f')]=_['map'](_0x2997df,_0xb562('0x19'));_0x43bd5e[_0xb562('0x20')]=_['keys'](_0x58a0e2['query']);_0x43bd5e['filters']=_[_0xb562('0x21')](_0x43bd5e[_0xb562('0x1f')],_0x43bd5e[_0xb562('0x20')]);_0x414075['attributes']=_[_0xb562('0x21')](_0x43bd5e[_0xb562('0x1f')],qs[_0xb562('0x22')](_0x58a0e2[_0xb562('0x20')][_0xb562('0x22')]));_0x414075[_0xb562('0x23')]=_0x414075[_0xb562('0x23')][_0xb562('0x24')]?_0x414075[_0xb562('0x23')]:_0x43bd5e[_0xb562('0x1f')];if(!_0x58a0e2['query'][_0xb562('0x25')](_0xb562('0x26'))){_0x414075['limit']=qs['limit'](_0x58a0e2[_0xb562('0x20')]['limit']);_0x414075[_0xb562('0x9')]=qs['offset'](_0x58a0e2['query'][_0xb562('0x9')]);}_0x414075[_0xb562('0x27')]=qs[_0xb562('0x28')](_0x58a0e2[_0xb562('0x20')][_0xb562('0x28')]);_0x414075[_0xb562('0x29')]=qs[_0xb562('0x2a')](_[_0xb562('0x2b')](_0x58a0e2[_0xb562('0x20')],_0x43bd5e[_0xb562('0x2a')]),_0x2997df);if(_0x58a0e2[_0xb562('0x20')][_0xb562('0x2c')]){_0x414075['where']=_[_0xb562('0x2d')](_0x414075['where'],{'$or':_['map'](_0x2997df,function(_0x45297c){if(_0x45297c[_0xb562('0x1e')]!=='VIRTUAL'){var _0x3c5e44={};_0x3c5e44[_0x45297c[_0xb562('0x19')]]={'$like':'%'+_0x58a0e2[_0xb562('0x20')][_0xb562('0x2c')]+'%'};return _0x3c5e44;}})});}_0x414075=_[_0xb562('0x2d')]({},_0x414075,_0x58a0e2[_0xb562('0x2e')]);var _0x16bda5={'where':_0x414075[_0xb562('0x29')]};return db[_0xb562('0x2f')][_0xb562('0xc')](_0x16bda5)[_0xb562('0x10')](function(_0x2d6caa){_0x3947a9[_0xb562('0xc')]=_0x2d6caa;if(_0x58a0e2[_0xb562('0x20')][_0xb562('0x30')]){_0x414075[_0xb562('0x31')]=[{'all':!![]}];}return db['SquareProject'][_0xb562('0x32')](_0x414075);})[_0xb562('0x10')](function(_0x35e5e2){_0x3947a9['rows']=_0x35e5e2;return _0x3947a9;})[_0xb562('0x10')](respondWithFilteredResult(_0x1dc7b8,_0x414075))[_0xb562('0x33')](handleError(_0x1dc7b8,null));};exports[_0xb562('0x34')]=function(_0x468548,_0x510213){var _0x314f5f={'raw':![],'where':{'id':_0x468548['params']['id']}},_0x33d706={};_0x33d706[_0xb562('0x1f')]=_[_0xb562('0x35')](db[_0xb562('0x2f')][_0xb562('0x1c')]);_0x33d706[_0xb562('0x20')]=_[_0xb562('0x35')](_0x468548[_0xb562('0x20')]);_0x33d706[_0xb562('0x2a')]=_[_0xb562('0x21')](_0x33d706[_0xb562('0x1f')],_0x33d706[_0xb562('0x20')]);_0x314f5f[_0xb562('0x23')]=_['intersection'](_0x33d706[_0xb562('0x1f')],qs[_0xb562('0x22')](_0x468548['query']['fields']));_0x314f5f[_0xb562('0x23')]=_0x314f5f[_0xb562('0x23')][_0xb562('0x24')]?_0x314f5f[_0xb562('0x23')]:_0x33d706[_0xb562('0x1f')];if(_0x468548[_0xb562('0x20')][_0xb562('0x30')]){_0x314f5f[_0xb562('0x31')]=[{'all':!![]}];}_0x314f5f=_[_0xb562('0x2d')]({},_0x314f5f,_0x468548[_0xb562('0x2e')]);return db[_0xb562('0x2f')][_0xb562('0x36')](_0x314f5f)[_0xb562('0x10')](handleEntityNotFound(_0x510213,null))[_0xb562('0x10')](respondWithResult(_0x510213,null))['catch'](handleError(_0x510213,null));};exports[_0xb562('0x37')]=function(_0x3f30be,_0x36c2ae){return db[_0xb562('0x2f')]['create'](_0x3f30be['body'],{})[_0xb562('0x10')](function(_0x211aa2){var _0x5dafec=_0x3f30be['user']['get']({'plain':!![]});if(!_0x5dafec)throw new Error(_0xb562('0x38'));if(_0x5dafec[_0xb562('0x39')]==='user'){var _0x292709=_0x211aa2[_0xb562('0x3a')]({'plain':!![]});var _0x4c6d62=_0xb562('0x12');return db['UserProfileSection'][_0xb562('0x36')]({'where':{'name':_0x4c6d62,'userProfileId':_0x5dafec[_0xb562('0x3b')]},'raw':!![]})['then'](function(_0x33cd11){if(_0x33cd11&&_0x33cd11[_0xb562('0x3c')]===0x0){return db[_0xb562('0x13')][_0xb562('0x37')]({'name':_0x292709[_0xb562('0x19')],'resourceId':_0x292709['id'],'type':_0x33cd11['name'],'sectionId':_0x33cd11['id']},{})['then'](function(){return _0x211aa2;});}else{return _0x211aa2;}})[_0xb562('0x33')](function(_0x18671a){logger['error'](_0xb562('0x3d'),_0x18671a);throw _0x18671a;});}return _0x211aa2;})[_0xb562('0x10')](respondWithResult(_0x36c2ae,0xc9))[_0xb562('0x33')](handleError(_0x36c2ae,null));};exports[_0xb562('0xf')]=function(_0x349895,_0x124721){if(_0x349895['body']['id']){delete _0x349895['body']['id'];}return db[_0xb562('0x2f')][_0xb562('0x36')]({'where':{'id':_0x349895[_0xb562('0x3e')]['id']}})['then'](handleEntityNotFound(_0x124721,null))[_0xb562('0x10')](saveUpdates(_0x349895[_0xb562('0x3f')],null))[_0xb562('0x10')](function(_0x3cf860){if(!_0x3cf860)return;var _0x5481a3=_0x3cf860[_0xb562('0x3a')]({'plain':!![]});return _0x5481a3;})['then'](function(_0x278248){var _0x565187=new Redis(config['redis']);_0x565187[_0xb562('0x14')](_0xb562('0x15'),JSON['stringify'](_[_0xb562('0x2b')](_0x278248,['id',_0xb562('0x19'),'production'])));return _0x278248;})[_0xb562('0x10')](respondWithResult(_0x124721,null))[_0xb562('0x33')](handleError(_0x124721,null));};exports[_0xb562('0x11')]=function(_0x336223,_0x451af9){return db[_0xb562('0x2f')]['find']({'where':{'id':_0x336223[_0xb562('0x3e')]['id']}})[_0xb562('0x10')](handleEntityNotFound(_0x451af9,null))[_0xb562('0x10')](removeEntity(_0x451af9,null))[_0xb562('0x33')](handleError(_0x451af9,null));}; \ No newline at end of file +var _0x6755=['merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','publish','lodash','ioredis','../../components/parsers/qs','../../config/logger','../../mysqldb','redis','defaults','socket.io-emitter','./squareProject.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','then','SquareProjects','UserProfileResource','agi','stringify','end','sendStatus','name','send','map','SquareProject','rawAttributes','fieldName','key','model','keys','query','attributes','intersection','fields','length','nolimit','order','sort','where','filters','filter'];(function(_0x55ef6a,_0x327e7f){var _0x2a7585=function(_0x352bc6){while(--_0x352bc6){_0x55ef6a['push'](_0x55ef6a['shift']());}};_0x2a7585(++_0x327e7f);}(_0x6755,0xa0));var _0x5675=function(_0x45a33a,_0x5c94a4){_0x45a33a=_0x45a33a-0x0;var _0x9605db=_0x6755[_0x45a33a];return _0x9605db;};'use strict';var _=require(_0x5675('0x0'));var Redis=require(_0x5675('0x1'));var qs=require(_0x5675('0x2'));var logger=require(_0x5675('0x3'))('api');var config=require('../../config/environment');var db=require(_0x5675('0x4'))['db'];config[_0x5675('0x5')]=_[_0x5675('0x6')](config[_0x5675('0x5')],{'host':'localhost','port':0x18eb});var socket=require(_0x5675('0x7'))(new Redis(config[_0x5675('0x5')]));require(_0x5675('0x8'))[_0x5675('0x9')](socket);function respondWithResult(_0xa79816,_0x7e3a24){_0x7e3a24=_0x7e3a24||0xc8;return function(_0x521ab1){if(_0x521ab1){return _0xa79816[_0x5675('0xa')](_0x7e3a24)[_0x5675('0xb')](_0x521ab1);}};}function respondWithFilteredResult(_0x210b87,_0x3ba34f){return function(_0x4c0ad){if(_0x4c0ad){var _0x2db306=typeof _0x3ba34f[_0x5675('0xc')]===_0x5675('0xd')&&typeof _0x3ba34f[_0x5675('0xe')]===_0x5675('0xd');var _0x454ad7=_0x4c0ad[_0x5675('0xf')];var _0x47291b=_0x2db306?0x0:_0x3ba34f[_0x5675('0xc')];var _0x5372c6=_0x2db306?_0x4c0ad['count']:_0x3ba34f[_0x5675('0xc')]+_0x3ba34f[_0x5675('0xe')];var _0x37c134;if(_0x5372c6>=_0x454ad7){_0x5372c6=_0x454ad7;_0x37c134=0xc8;}else{_0x37c134=0xce;}_0x210b87[_0x5675('0xa')](_0x37c134);return _0x210b87[_0x5675('0x10')](_0x5675('0x11'),_0x47291b+'-'+_0x5372c6+'/'+_0x454ad7)[_0x5675('0xb')](_0x4c0ad);}return null;};}function saveUpdates(_0x44a739){return function(_0x5c4144){if(_0x5c4144){return _0x5c4144[_0x5675('0x12')](_0x44a739)['then'](function(_0x4b6d8b){return _0x4b6d8b;});}return null;};}function removeEntity(_0xe7e158){return function(_0xf4fc7c){if(_0xf4fc7c){return _0xf4fc7c[_0x5675('0x13')]()[_0x5675('0x14')](function(){var _0x4a2f1b=_0xf4fc7c['get']({'plain':!![]});var _0x2b153e=_0x5675('0x15');return db[_0x5675('0x16')]['destroy']({'where':{'type':_0x2b153e,'resourceId':_0x4a2f1b['id']}})[_0x5675('0x14')](function(){return _0xf4fc7c;});})[_0x5675('0x14')](function(){var _0x1d7316=new Redis(config[_0x5675('0x5')]);_0x1d7316['publish'](_0x5675('0x17'),JSON[_0x5675('0x18')]({'id':_0xf4fc7c['id'],'deleted':!![]}));})[_0x5675('0x14')](function(){_0xe7e158[_0x5675('0xa')](0xcc)[_0x5675('0x19')]();});}};}function handleEntityNotFound(_0x58500a){return function(_0x1731c1){if(!_0x1731c1){_0x58500a[_0x5675('0x1a')](0x194);}return _0x1731c1;};}function handleError(_0x20b564,_0x58e848){_0x58e848=_0x58e848||0x1f4;return function(_0x20479c){logger['error'](_0x20479c['stack']);if(_0x20479c[_0x5675('0x1b')]){delete _0x20479c['name'];}_0x20b564[_0x5675('0xa')](_0x58e848)[_0x5675('0x1c')](_0x20479c);};}exports['index']=function(_0x10cbb8,_0x59f4d4){var _0xcdd202={},_0x551ca3={},_0x2b5bcb={'count':0x0,'rows':[]};var _0x4cc156=_[_0x5675('0x1d')](db[_0x5675('0x1e')][_0x5675('0x1f')],function(_0x15b7e1){return{'name':_0x15b7e1[_0x5675('0x20')],'type':_0x15b7e1['type'][_0x5675('0x21')]};});_0x551ca3[_0x5675('0x22')]=_['map'](_0x4cc156,_0x5675('0x1b'));_0x551ca3['query']=_[_0x5675('0x23')](_0x10cbb8['query']);_0x551ca3['filters']=_['intersection'](_0x551ca3[_0x5675('0x22')],_0x551ca3[_0x5675('0x24')]);_0xcdd202[_0x5675('0x25')]=_[_0x5675('0x26')](_0x551ca3['model'],qs[_0x5675('0x27')](_0x10cbb8[_0x5675('0x24')][_0x5675('0x27')]));_0xcdd202[_0x5675('0x25')]=_0xcdd202['attributes'][_0x5675('0x28')]?_0xcdd202[_0x5675('0x25')]:_0x551ca3['model'];if(!_0x10cbb8['query']['hasOwnProperty'](_0x5675('0x29'))){_0xcdd202[_0x5675('0xe')]=qs[_0x5675('0xe')](_0x10cbb8[_0x5675('0x24')][_0x5675('0xe')]);_0xcdd202[_0x5675('0xc')]=qs[_0x5675('0xc')](_0x10cbb8['query']['offset']);}_0xcdd202[_0x5675('0x2a')]=qs[_0x5675('0x2b')](_0x10cbb8[_0x5675('0x24')]['sort']);_0xcdd202[_0x5675('0x2c')]=qs[_0x5675('0x2d')](_['pick'](_0x10cbb8[_0x5675('0x24')],_0x551ca3[_0x5675('0x2d')]),_0x4cc156);if(_0x10cbb8[_0x5675('0x24')][_0x5675('0x2e')]){_0xcdd202[_0x5675('0x2c')]=_[_0x5675('0x2f')](_0xcdd202[_0x5675('0x2c')],{'$or':_[_0x5675('0x1d')](_0x4cc156,function(_0x38de2d){if(_0x38de2d[_0x5675('0x30')]!==_0x5675('0x31')){var _0x34988c={};_0x34988c[_0x38de2d['name']]={'$like':'%'+_0x10cbb8['query']['filter']+'%'};return _0x34988c;}})});}_0xcdd202=_[_0x5675('0x2f')]({},_0xcdd202,_0x10cbb8[_0x5675('0x32')]);var _0xd48b1e={'where':_0xcdd202['where']};return db[_0x5675('0x1e')][_0x5675('0xf')](_0xd48b1e)['then'](function(_0x1617be){_0x2b5bcb[_0x5675('0xf')]=_0x1617be;if(_0x10cbb8[_0x5675('0x24')][_0x5675('0x33')]){_0xcdd202[_0x5675('0x34')]=[{'all':!![]}];}return db['SquareProject'][_0x5675('0x35')](_0xcdd202);})[_0x5675('0x14')](function(_0x11cee9){_0x2b5bcb[_0x5675('0x36')]=_0x11cee9;return _0x2b5bcb;})['then'](respondWithFilteredResult(_0x59f4d4,_0xcdd202))[_0x5675('0x37')](handleError(_0x59f4d4,null));};exports[_0x5675('0x38')]=function(_0x17bc49,_0x76639e){var _0x1aaaf2={'raw':![],'where':{'id':_0x17bc49[_0x5675('0x39')]['id']}},_0x5053d1={};_0x5053d1[_0x5675('0x22')]=_[_0x5675('0x23')](db[_0x5675('0x1e')][_0x5675('0x1f')]);_0x5053d1['query']=_['keys'](_0x17bc49[_0x5675('0x24')]);_0x5053d1[_0x5675('0x2d')]=_[_0x5675('0x26')](_0x5053d1[_0x5675('0x22')],_0x5053d1['query']);_0x1aaaf2[_0x5675('0x25')]=_[_0x5675('0x26')](_0x5053d1[_0x5675('0x22')],qs[_0x5675('0x27')](_0x17bc49[_0x5675('0x24')]['fields']));_0x1aaaf2[_0x5675('0x25')]=_0x1aaaf2[_0x5675('0x25')][_0x5675('0x28')]?_0x1aaaf2[_0x5675('0x25')]:_0x5053d1['model'];if(_0x17bc49[_0x5675('0x24')]['includeAll']){_0x1aaaf2['include']=[{'all':!![]}];}_0x1aaaf2=_[_0x5675('0x2f')]({},_0x1aaaf2,_0x17bc49['options']);return db['SquareProject'][_0x5675('0x3a')](_0x1aaaf2)[_0x5675('0x14')](handleEntityNotFound(_0x76639e,null))[_0x5675('0x14')](respondWithResult(_0x76639e,null))[_0x5675('0x37')](handleError(_0x76639e,null));};exports[_0x5675('0x3b')]=function(_0x10d1ca,_0x5edf38){return db[_0x5675('0x1e')]['create'](_0x10d1ca[_0x5675('0x3c')],{})[_0x5675('0x14')](function(_0x2a3a65){var _0x31567e=_0x10d1ca[_0x5675('0x3d')][_0x5675('0x3e')]({'plain':!![]});if(!_0x31567e)throw new Error(_0x5675('0x3f'));if(_0x31567e[_0x5675('0x40')]===_0x5675('0x3d')){var _0x41420e=_0x2a3a65[_0x5675('0x3e')]({'plain':!![]});var _0x317880=_0x5675('0x15');return db['UserProfileSection'][_0x5675('0x3a')]({'where':{'name':_0x317880,'userProfileId':_0x31567e['userProfileId']},'raw':!![]})['then'](function(_0x576448){if(_0x576448&&_0x576448[_0x5675('0x41')]===0x0){return db[_0x5675('0x16')][_0x5675('0x3b')]({'name':_0x41420e['name'],'resourceId':_0x41420e['id'],'type':_0x576448[_0x5675('0x1b')],'sectionId':_0x576448['id']},{})[_0x5675('0x14')](function(){return _0x2a3a65;});}else{return _0x2a3a65;}})[_0x5675('0x37')](function(_0x2d4d95){logger[_0x5675('0x42')](_0x5675('0x43'),_0x2d4d95);throw _0x2d4d95;});}return _0x2a3a65;})[_0x5675('0x14')](respondWithResult(_0x5edf38,0xc9))['catch'](handleError(_0x5edf38,null));};exports['update']=function(_0x456e1c,_0x37f4ef){if(_0x456e1c['body']['id']){delete _0x456e1c[_0x5675('0x3c')]['id'];}return db[_0x5675('0x1e')]['find']({'where':{'id':_0x456e1c[_0x5675('0x39')]['id']}})['then'](handleEntityNotFound(_0x37f4ef,null))[_0x5675('0x14')](saveUpdates(_0x456e1c[_0x5675('0x3c')],null))[_0x5675('0x14')](function(_0x44b4cd){if(!_0x44b4cd)return;var _0x2b74e5=_0x44b4cd['get']({'plain':!![]});return _0x2b74e5;})['then'](function(_0x13320a){var _0x538013=new Redis(config[_0x5675('0x5')]);_0x538013[_0x5675('0x44')](_0x5675('0x17'),JSON[_0x5675('0x18')](_['pick'](_0x13320a,['id',_0x5675('0x1b'),'production'])));return _0x13320a;})['then'](respondWithResult(_0x37f4ef,null))['catch'](handleError(_0x37f4ef,null));};exports[_0x5675('0x13')]=function(_0x3d0ccb,_0x212753){return db[_0x5675('0x1e')]['find']({'where':{'id':_0x3d0ccb[_0x5675('0x39')]['id']}})[_0x5675('0x14')](handleEntityNotFound(_0x212753,null))[_0x5675('0x14')](removeEntity(_0x212753,null))['catch'](handleError(_0x212753,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index bc28232..3b70a66 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 _0xe124=['save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','SquareProject'];(function(_0x2d3254,_0x41b4e5){var _0x1250f1=function(_0x386dd3){while(--_0x386dd3){_0x2d3254['push'](_0x2d3254['shift']());}};_0x1250f1(++_0x41b4e5);}(_0xe124,0x1b6));var _0x4e12=function(_0xaed76b,_0x26da4b){_0xaed76b=_0xaed76b-0x0;var _0x25239b=_0xe124[_0xaed76b];return _0x25239b;};'use strict';var EventEmitter=require(_0x4e12('0x0'));var SquareProject=require(_0x4e12('0x1'))['db'][_0x4e12('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4e12('0x3'),'afterUpdate':_0x4e12('0x4'),'afterDestroy':_0x4e12('0x5')};function emitEvent(_0x289aa9){return function(_0x39a9de,_0x5d7db4,_0x3fa220){SquareProjectEvents[_0x4e12('0x6')](_0x289aa9+':'+_0x39a9de['id'],_0x39a9de);SquareProjectEvents[_0x4e12('0x6')](_0x289aa9,_0x39a9de);_0x3fa220(null);};}for(var e in events){if(events[_0x4e12('0x7')](e)){var event=events[e];SquareProject[_0x4e12('0x8')](e,emitEvent(event));}}module['exports']=SquareProjectEvents; \ No newline at end of file +var _0x0a0d=['emit','hasOwnProperty','hook','SquareProject','setMaxListeners','update'];(function(_0x4355cc,_0x41680d){var _0x313d76=function(_0x53a6e4){while(--_0x53a6e4){_0x4355cc['push'](_0x4355cc['shift']());}};_0x313d76(++_0x41680d);}(_0x0a0d,0x105));var _0xd0a0=function(_0x3f1b36,_0x205b14){_0x3f1b36=_0x3f1b36-0x0;var _0x56a704=_0x0a0d[_0x3f1b36];return _0x56a704;};'use strict';var EventEmitter=require('events');var SquareProject=require('../../mysqldb')['db'][_0xd0a0('0x0')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xd0a0('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd0a0('0x2'),'afterDestroy':'remove'};function emitEvent(_0x4d8469){return function(_0x201790,_0x5de373,_0x290b84){SquareProjectEvents[_0xd0a0('0x3')](_0x4d8469+':'+_0x201790['id'],_0x201790);SquareProjectEvents[_0xd0a0('0x3')](_0x4d8469,_0x201790);_0x290b84(null);};}for(var e in events){if(events[_0xd0a0('0x4')](e)){var event=events[e];SquareProject[_0xd0a0('0x5')](e,emitEvent(event));}}module['exports']=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 4eea53b..2bfc9c3 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 _0xe1ff=['./squareProject.attributes','exports','SquareProject','square_projects','preproduction','savedAt','changed','production','publishedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe1ff,0x65));var _0xfe1f=function(_0x20c04f,_0x267bae){_0x20c04f=_0x20c04f-0x0;var _0x190034=_0xe1ff[_0x20c04f];return _0x190034;};'use strict';var _=require('lodash');var util=require(_0xfe1f('0x0'));var logger=require(_0xfe1f('0x1'))(_0xfe1f('0x2'));var moment=require(_0xfe1f('0x3'));var BPromise=require(_0xfe1f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfe1f('0x5'));var rimraf=require(_0xfe1f('0x6'));var config=require('../../config/environment');var attributes=require(_0xfe1f('0x7'));module[_0xfe1f('0x8')]=function(_0x453ef5,_0x24ae61){return _0x453ef5['define'](_0xfe1f('0x9'),attributes,{'tableName':_0xfe1f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x55bbbd,_0x402efa,_0x2ab83a){if(_0x55bbbd['changed'](_0xfe1f('0xb'))){_0x55bbbd[_0xfe1f('0xc')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}if(_0x55bbbd[_0xfe1f('0xd')](_0xfe1f('0xe'))){_0x55bbbd[_0xfe1f('0xf')]=moment()[_0xfe1f('0x10')](_0xfe1f('0x11'));}_0x2ab83a(null,_0x55bbbd);}}});}; \ No newline at end of file +var _0x394f=['bluebird','request-promise','path','rimraf','../../config/environment','./squareProject.attributes','SquareProject','changed','preproduction','format','YYYY-MM-DD\x20HH:mm:ss','publishedAt','lodash','util','../../config/logger','api','moment'];(function(_0x20241e,_0x189bc0){var _0x17e8a8=function(_0x58814f){while(--_0x58814f){_0x20241e['push'](_0x20241e['shift']());}};_0x17e8a8(++_0x189bc0);}(_0x394f,0x14f));var _0xf394=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x394f[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xf394('0x0'));var util=require(_0xf394('0x1'));var logger=require(_0xf394('0x2'))(_0xf394('0x3'));var moment=require(_0xf394('0x4'));var BPromise=require(_0xf394('0x5'));var rp=require(_0xf394('0x6'));var fs=require('fs');var path=require(_0xf394('0x7'));var rimraf=require(_0xf394('0x8'));var config=require(_0xf394('0x9'));var attributes=require(_0xf394('0xa'));module['exports']=function(_0x517e14,_0x270e0f){return _0x517e14['define'](_0xf394('0xb'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5e6ce1,_0x455ec9,_0x52f209){if(_0x5e6ce1[_0xf394('0xc')](_0xf394('0xd'))){_0x5e6ce1['savedAt']=moment()[_0xf394('0xe')](_0xf394('0xf'));}if(_0x5e6ce1[_0xf394('0xc')]('production')){_0x5e6ce1[_0xf394('0x10')]=moment()[_0xf394('0xe')](_0xf394('0xf'));}_0x52f209(null,_0x5e6ce1);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index a519245..fe96cfb 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 _0x9b5c=['redis','localhost','./squareProject.socket','register','GetSquareProjects','SquareProject','findAll','options','raw','where','attributes','limit','include','model','map','info','debug','stringify','catch','message','error','ShowSquareProject','find','lodash','ioredis','../../mysqldb','rpc','../../config/environment','defaults'];(function(_0x20527e,_0x540a34){var _0x5b63cd=function(_0x3f19f8){while(--_0x3f19f8){_0x20527e['push'](_0x20527e['shift']());}};_0x5b63cd(++_0x540a34);}(_0x9b5c,0x1ad));var _0xc9b5=function(_0x576f0f,_0x4cdb5b){_0x576f0f=_0x576f0f-0x0;var _0x335388=_0x9b5c[_0x576f0f];return _0x335388;};'use strict';var _=require(_0xc9b5('0x0'));var Redis=require(_0xc9b5('0x1'));var db=require(_0xc9b5('0x2'))['db'];var logger=require('../../config/logger')(_0xc9b5('0x3'));var config=require(_0xc9b5('0x4'));config['redis']=_[_0xc9b5('0x5')](config[_0xc9b5('0x6')],{'host':_0xc9b5('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc9b5('0x8'))[_0xc9b5('0x9')](socket);exports[_0xc9b5('0xa')]=function(_0x84a5f3){var _0x2c801e=this;return new Promise(function(_0x3ac147,_0x457a04){return db[_0xc9b5('0xb')][_0xc9b5('0xc')]({'raw':_0x84a5f3[_0xc9b5('0xd')]?_0x84a5f3['options'][_0xc9b5('0xe')]===undefined?!![]:![]:!![],'where':_0x84a5f3[_0xc9b5('0xd')]?_0x84a5f3['options'][_0xc9b5('0xf')]||null:null,'attributes':_0x84a5f3[_0xc9b5('0xd')]?_0x84a5f3[_0xc9b5('0xd')][_0xc9b5('0x10')]||null:null,'limit':_0x84a5f3[_0xc9b5('0xd')]?_0x84a5f3[_0xc9b5('0xd')][_0xc9b5('0x11')]||null:null,'include':_0x84a5f3[_0xc9b5('0xd')]?_0x84a5f3[_0xc9b5('0xd')]['include']?_['map'](_0x84a5f3[_0xc9b5('0xd')][_0xc9b5('0x12')],function(_0x2fcf5a){return{'model':db[_0x2fcf5a[_0xc9b5('0x13')]],'as':_0x2fcf5a['as'],'attributes':_0x2fcf5a[_0xc9b5('0x10')],'include':_0x2fcf5a[_0xc9b5('0x12')]?_[_0xc9b5('0x14')](_0x2fcf5a[_0xc9b5('0x12')],function(_0x1f8bdd){return{'model':db[_0x1f8bdd['model']],'as':_0x1f8bdd['as'],'attributes':_0x1f8bdd[_0xc9b5('0x10')],'include':_0x1f8bdd['include']?_['map'](_0x1f8bdd[_0xc9b5('0x12')],function(_0x23906d){return{'model':db[_0x23906d['model']],'as':_0x23906d['as'],'attributes':_0x23906d[_0xc9b5('0x10')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5252c6){logger[_0xc9b5('0x15')](_0xc9b5('0xa'),_0x84a5f3);logger[_0xc9b5('0x16')](_0xc9b5('0xa'),_0x84a5f3,JSON[_0xc9b5('0x17')](_0x5252c6));_0x3ac147(_0x5252c6);})[_0xc9b5('0x18')](function(_0x41fea3){logger['error'](_0xc9b5('0xa'),_0x41fea3[_0xc9b5('0x19')],_0x84a5f3);_0x457a04(_0x2c801e[_0xc9b5('0x1a')](0x1f4,_0x41fea3[_0xc9b5('0x19')]));});});};exports[_0xc9b5('0x1b')]=function(_0x41baa0){var _0x3e4203=this;return new Promise(function(_0x7f5627,_0x2fa688){return db[_0xc9b5('0xb')][_0xc9b5('0x1c')]({'raw':_0x41baa0[_0xc9b5('0xd')]?_0x41baa0[_0xc9b5('0xd')][_0xc9b5('0xe')]===undefined?!![]:![]:!![],'where':_0x41baa0[_0xc9b5('0xd')]?_0x41baa0[_0xc9b5('0xd')]['where']||null:null,'attributes':_0x41baa0['options']?_0x41baa0[_0xc9b5('0xd')][_0xc9b5('0x10')]||null:null,'include':_0x41baa0[_0xc9b5('0xd')]?_0x41baa0[_0xc9b5('0xd')][_0xc9b5('0x12')]?_[_0xc9b5('0x14')](_0x41baa0[_0xc9b5('0xd')][_0xc9b5('0x12')],function(_0x3e3ada){return{'model':db[_0x3e3ada[_0xc9b5('0x13')]],'as':_0x3e3ada['as'],'attributes':_0x3e3ada['attributes'],'include':_0x3e3ada['include']?_[_0xc9b5('0x14')](_0x3e3ada[_0xc9b5('0x12')],function(_0x4f37a3){return{'model':db[_0x4f37a3[_0xc9b5('0x13')]],'as':_0x4f37a3['as'],'attributes':_0x4f37a3[_0xc9b5('0x10')],'include':_0x4f37a3[_0xc9b5('0x12')]?_[_0xc9b5('0x14')](_0x4f37a3['include'],function(_0x1c2db0){return{'model':db[_0x1c2db0['model']],'as':_0x1c2db0['as'],'attributes':_0x1c2db0[_0xc9b5('0x10')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4c3ef5){logger[_0xc9b5('0x15')](_0xc9b5('0x1b'),_0x41baa0);logger[_0xc9b5('0x16')]('ShowSquareProject',_0x41baa0,JSON[_0xc9b5('0x17')](_0x4c3ef5));_0x7f5627(_0x4c3ef5);})[_0xc9b5('0x18')](function(_0x5ce0e5){logger[_0xc9b5('0x1a')](_0xc9b5('0x1b'),_0x5ce0e5[_0xc9b5('0x19')],_0x41baa0);_0x2fa688(_0x3e4203[_0xc9b5('0x1a')](0x1f4,_0x5ce0e5['message']));});});}; \ No newline at end of file +var _0x5456=['ShowSquareProject','where','debug','lodash','../../mysqldb','../../config/logger','../../config/environment','redis','socket.io-emitter','./squareProject.socket','register','GetSquareProjects','SquareProject','findAll','options','raw','attributes','limit','map','include','model','info','stringify','catch','error'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x5456,0x17a));var _0x6545=function(_0x594fec,_0x1bfbd1){_0x594fec=_0x594fec-0x0;var _0x58db0d=_0x5456[_0x594fec];return _0x58db0d;};'use strict';var _=require(_0x6545('0x0'));var Redis=require('ioredis');var db=require(_0x6545('0x1'))['db'];var logger=require(_0x6545('0x2'))('rpc');var config=require(_0x6545('0x3'));config[_0x6545('0x4')]=_['defaults'](config[_0x6545('0x4')],{'host':'localhost','port':0x18eb});var socket=require(_0x6545('0x5'))(new Redis(config[_0x6545('0x4')]));require(_0x6545('0x6'))[_0x6545('0x7')](socket);exports[_0x6545('0x8')]=function(_0x221cbc){var _0x4255cf=this;return new Promise(function(_0x5a9384,_0x3505db){return db[_0x6545('0x9')][_0x6545('0xa')]({'raw':_0x221cbc['options']?_0x221cbc[_0x6545('0xb')][_0x6545('0xc')]===undefined?!![]:![]:!![],'where':_0x221cbc[_0x6545('0xb')]?_0x221cbc[_0x6545('0xb')]['where']||null:null,'attributes':_0x221cbc[_0x6545('0xb')]?_0x221cbc['options'][_0x6545('0xd')]||null:null,'limit':_0x221cbc[_0x6545('0xb')]?_0x221cbc['options'][_0x6545('0xe')]||null:null,'include':_0x221cbc[_0x6545('0xb')]?_0x221cbc['options']['include']?_[_0x6545('0xf')](_0x221cbc[_0x6545('0xb')][_0x6545('0x10')],function(_0x1be25c){return{'model':db[_0x1be25c[_0x6545('0x11')]],'as':_0x1be25c['as'],'attributes':_0x1be25c[_0x6545('0xd')],'include':_0x1be25c[_0x6545('0x10')]?_['map'](_0x1be25c[_0x6545('0x10')],function(_0x5c4f04){return{'model':db[_0x5c4f04['model']],'as':_0x5c4f04['as'],'attributes':_0x5c4f04[_0x6545('0xd')],'include':_0x5c4f04[_0x6545('0x10')]?_[_0x6545('0xf')](_0x5c4f04['include'],function(_0x14353d){return{'model':db[_0x14353d[_0x6545('0x11')]],'as':_0x14353d['as'],'attributes':_0x14353d[_0x6545('0xd')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2a952e){logger[_0x6545('0x12')](_0x6545('0x8'),_0x221cbc);logger['debug'](_0x6545('0x8'),_0x221cbc,JSON[_0x6545('0x13')](_0x2a952e));_0x5a9384(_0x2a952e);})[_0x6545('0x14')](function(_0x575055){logger['error'](_0x6545('0x8'),_0x575055['message'],_0x221cbc);_0x3505db(_0x4255cf[_0x6545('0x15')](0x1f4,_0x575055['message']));});});};exports[_0x6545('0x16')]=function(_0xa4fc0d){var _0x2b8322=this;return new Promise(function(_0x37d89c,_0x4dea8c){return db['SquareProject']['find']({'raw':_0xa4fc0d[_0x6545('0xb')]?_0xa4fc0d[_0x6545('0xb')][_0x6545('0xc')]===undefined?!![]:![]:!![],'where':_0xa4fc0d[_0x6545('0xb')]?_0xa4fc0d[_0x6545('0xb')][_0x6545('0x17')]||null:null,'attributes':_0xa4fc0d[_0x6545('0xb')]?_0xa4fc0d[_0x6545('0xb')][_0x6545('0xd')]||null:null,'include':_0xa4fc0d[_0x6545('0xb')]?_0xa4fc0d[_0x6545('0xb')][_0x6545('0x10')]?_[_0x6545('0xf')](_0xa4fc0d[_0x6545('0xb')]['include'],function(_0x49e8b2){return{'model':db[_0x49e8b2['model']],'as':_0x49e8b2['as'],'attributes':_0x49e8b2[_0x6545('0xd')],'include':_0x49e8b2['include']?_[_0x6545('0xf')](_0x49e8b2[_0x6545('0x10')],function(_0x4b58c8){return{'model':db[_0x4b58c8['model']],'as':_0x4b58c8['as'],'attributes':_0x4b58c8['attributes'],'include':_0x4b58c8[_0x6545('0x10')]?_[_0x6545('0xf')](_0x4b58c8[_0x6545('0x10')],function(_0x7a6a4f){return{'model':db[_0x7a6a4f[_0x6545('0x11')]],'as':_0x7a6a4f['as'],'attributes':_0x7a6a4f[_0x6545('0xd')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xb6f202){logger[_0x6545('0x12')](_0x6545('0x16'),_0xa4fc0d);logger[_0x6545('0x18')](_0x6545('0x16'),_0xa4fc0d,JSON[_0x6545('0x13')](_0xb6f202));_0x37d89c(_0xb6f202);})[_0x6545('0x14')](function(_0x515499){logger['error'](_0x6545('0x16'),_0x515499['message'],_0xa4fc0d);_0x4dea8c(_0x2b8322[_0x6545('0x15')](0x1f4,_0x515499['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index d08b795..720caee 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 _0x0af2=['save','remove','update','emit','removeListener','register','length','./squareProject.events'];(function(_0x3af84a,_0x1d87d6){var _0x4a7616=function(_0x1f7833){while(--_0x1f7833){_0x3af84a['push'](_0x3af84a['shift']());}};_0x4a7616(++_0x1d87d6);}(_0x0af2,0xef));var _0x20af=function(_0x31c5da,_0x4d029f){_0x31c5da=_0x31c5da-0x0;var _0x478545=_0x0af2[_0x31c5da];return _0x478545;};'use strict';var SquareProjectEvents=require(_0x20af('0x0'));var events=[_0x20af('0x1'),_0x20af('0x2'),_0x20af('0x3')];function createListener(_0x2c1ce9,_0x2e4afd){return function(_0x309471){_0x2e4afd[_0x20af('0x4')](_0x2c1ce9,_0x309471);};}function removeListener(_0x394edd,_0x344617){return function(){SquareProjectEvents[_0x20af('0x5')](_0x394edd,_0x344617);};}exports[_0x20af('0x6')]=function(_0x209ff9){for(var _0x162ebb=0x0,_0x129e3a=events[_0x20af('0x7')];_0x162ebb<_0x129e3a;_0x162ebb++){var _0x159c72=events[_0x162ebb];var _0x56fe58=createListener('squareProject:'+_0x159c72,_0x209ff9);SquareProjectEvents['on'](_0x159c72,_0x56fe58);}}; \ No newline at end of file +var _0x09f6=['removeListener','register','squareProject:','./squareProject.events','save','remove','update','emit'];(function(_0x32a554,_0x37ad7b){var _0x5ce71c=function(_0x1f670d){while(--_0x1f670d){_0x32a554['push'](_0x32a554['shift']());}};_0x5ce71c(++_0x37ad7b);}(_0x09f6,0x1cb));var _0x609f=function(_0x20b13b,_0x5f0e97){_0x20b13b=_0x20b13b-0x0;var _0x104731=_0x09f6[_0x20b13b];return _0x104731;};'use strict';var SquareProjectEvents=require(_0x609f('0x0'));var events=[_0x609f('0x1'),_0x609f('0x2'),_0x609f('0x3')];function createListener(_0x28884e,_0x4fce0d){return function(_0x2693fa){_0x4fce0d[_0x609f('0x4')](_0x28884e,_0x2693fa);};}function removeListener(_0x2e6946,_0xe22507){return function(){SquareProjectEvents[_0x609f('0x5')](_0x2e6946,_0xe22507);};}exports[_0x609f('0x6')]=function(_0x430c00){for(var _0x349894=0x0,_0x51b835=events['length'];_0x349894<_0x51b835;_0x349894++){var _0x3637dc=events[_0x349894];var _0x4aedea=createListener(_0x609f('0x7')+_0x3637dc,_0x430c00);SquareProjectEvents['on'](_0x3637dc,_0x4aedea);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index b0943ff..126fd8e 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 _0x7a54=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','index','/:id','isAuthenticated','post','put','update','delete','destroy','exports','multer','util','path','express'];(function(_0x37f242,_0x12224d){var _0x80d02c=function(_0x315efd){while(--_0x315efd){_0x37f242['push'](_0x37f242['shift']());}};_0x80d02c(++_0x12224d);}(_0x7a54,0x106));var _0x47a5=function(_0x5886e4,_0x18364c){_0x5886e4=_0x5886e4-0x0;var _0x42105f=_0x7a54[_0x5886e4];return _0x42105f;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0x9')]('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0x47a5('0xd')]('/',auth[_0x47a5('0xc')](),controller['create']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);module[_0x47a5('0x12')]=router; \ No newline at end of file +var _0xc4aa=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./squareRecording.controller','get','isAuthenticated','index','/:id','/:id/download','download','create','put','delete'];(function(_0x3195de,_0xa0bd25){var _0x5e2ba6=function(_0x14284b){while(--_0x14284b){_0x3195de['push'](_0x3195de['shift']());}};_0x5e2ba6(++_0xa0bd25);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0xc4aa[_0x342baa];return _0x1208f3;};'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 fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xac4a('0x6'));var controller=require(_0xac4a('0x7'));router[_0xac4a('0x8')]('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xa')]);router[_0xac4a('0x8')](_0xac4a('0xb'),auth[_0xac4a('0x9')](),controller['show']);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xd')]);router['post']('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xe')]);router[_0xac4a('0xf')]('/:id',auth[_0xac4a('0x9')](),controller['update']);router[_0xac4a('0x10')]('/:id',auth[_0xac4a('0x9')](),controller[_0xac4a('0x11')]);module[_0xac4a('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 3f40dd1..e062de8 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 _0xeec6=['sequelize','exports','STRING','getDataValue','savePath','lastIndexOf'];(function(_0x37148d,_0xf49b72){var _0x534790=function(_0x435e41){while(--_0x435e41){_0x37148d['push'](_0x37148d['shift']());}};_0x534790(++_0xf49b72);}(_0xeec6,0x1c2));var _0x6eec=function(_0x59a40c,_0x35999f){_0x59a40c=_0x59a40c-0x0;var _0x3cf340=_0xeec6[_0x59a40c];return _0x3cf340;};'use strict';var Sequelize=require(_0x6eec('0x0'));module[_0x6eec('0x1')]={'uniqueid':{'type':Sequelize[_0x6eec('0x2')]},'callerid':{'type':Sequelize[_0x6eec('0x2')]},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x6eec('0x2')]},'extension':{'type':Sequelize[_0x6eec('0x2')]},'priority':{'type':Sequelize[_0x6eec('0x2')]},'accountcode':{'type':Sequelize[_0x6eec('0x2')]},'dnid':{'type':Sequelize[_0x6eec('0x2')]},'projectName':{'type':Sequelize[_0x6eec('0x2')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0x6eec('0x2')]},'savePath':{'type':Sequelize[_0x6eec('0x2')]},'format':{'type':Sequelize['VIRTUAL'],'get':function(){var _0x5a5e47='';var _0x1c810e=this[_0x6eec('0x3')](_0x6eec('0x4'));if(_0x1c810e){_0x5a5e47=_0x1c810e['substring'](_0x1c810e[_0x6eec('0x5')]('.'));}return _0x5a5e47;}}}; \ No newline at end of file +var _0x81bd=['STRING','VIRTUAL','getDataValue','substring','lastIndexOf','sequelize','exports'];(function(_0x1c1256,_0x47c002){var _0x5d6280=function(_0x5dac5c){while(--_0x5dac5c){_0x1c1256['push'](_0x1c1256['shift']());}};_0x5d6280(++_0x47c002);}(_0x81bd,0x7c));var _0xd81b=function(_0x15d9c9,_0x33ea68){_0x15d9c9=_0x15d9c9-0x0;var _0xd8ef55=_0x81bd[_0x15d9c9];return _0xd8ef55;};'use strict';var Sequelize=require(_0xd81b('0x0'));module[_0xd81b('0x1')]={'uniqueid':{'type':Sequelize[_0xd81b('0x2')]},'callerid':{'type':Sequelize[_0xd81b('0x2')]},'calleridname':{'type':Sequelize[_0xd81b('0x2')]},'context':{'type':Sequelize[_0xd81b('0x2')]},'extension':{'type':Sequelize[_0xd81b('0x2')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xd81b('0x2')]},'dnid':{'type':Sequelize[_0xd81b('0x2')]},'projectName':{'type':Sequelize[_0xd81b('0x2')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0xd81b('0x2')]},'savePath':{'type':Sequelize[_0xd81b('0x2')]},'format':{'type':Sequelize[_0xd81b('0x3')],'get':function(){var _0x562084='';var _0x5e14e8=this[_0xd81b('0x4')]('savePath');if(_0x5e14e8){_0x562084=_0x5e14e8[_0xd81b('0x5')](_0x5e14e8[_0xd81b('0x6')]('.'));}return _0x562084;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 48c98d1..ed1b80c 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 _0xee92=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','map','SquareRecording','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','params','include','find','body','../../components/encryptor','uniqueid','filename','savePath','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','unlink','download','message','Not\x20found','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','isNil','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service'];(function(_0x5cb7ea,_0x2146a6){var _0x35db2c=function(_0x531f55){while(--_0x531f55){_0x5cb7ea['push'](_0x5cb7ea['shift']());}};_0x35db2c(++_0x2146a6);}(_0xee92,0x110));var _0x2ee9=function(_0x4e51d8,_0x368c26){_0x4e51d8=_0x4e51d8-0x0;var _0x26aadd=_0xee92[_0x4e51d8];return _0x26aadd;};'use strict';var emlformat=require(_0x2ee9('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2ee9('0x1'));var rp=require(_0x2ee9('0x2'));var moment=require(_0x2ee9('0x3'));var BPromise=require(_0x2ee9('0x4'));var Mustache=require(_0x2ee9('0x5'));var util=require(_0x2ee9('0x6'));var path=require(_0x2ee9('0x7'));var sox=require(_0x2ee9('0x8'));var csv=require('to-csv');var ejs=require(_0x2ee9('0x9'));var fs=require('fs');var fs_extra=require(_0x2ee9('0xa'));var _=require(_0x2ee9('0xb'));var squel=require(_0x2ee9('0xc'));var crypto=require(_0x2ee9('0xd'));var jsforce=require(_0x2ee9('0xe'));var deskjs=require(_0x2ee9('0xf'));var toCsv=require(_0x2ee9('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2ee9('0x11'));var authService=require(_0x2ee9('0x12'));var qs=require(_0x2ee9('0x13'));var as=require(_0x2ee9('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x2ee9('0x15'));var licenseUtil=require(_0x2ee9('0x16'));var db=require(_0x2ee9('0x17'))['db'];function respondWithStatusCode(_0x3449df,_0x43232d){_0x43232d=_0x43232d||0xcc;return function(_0x451f80){if(_0x451f80){return _0x3449df[_0x2ee9('0x18')](_0x43232d);}return _0x3449df[_0x2ee9('0x19')](_0x43232d)['end']();};}function respondWithResult(_0x48c7c6,_0x46d74b){_0x46d74b=_0x46d74b||0xc8;return function(_0x11e4d8){if(_0x11e4d8){return _0x48c7c6['status'](_0x46d74b)[_0x2ee9('0x1a')](_0x11e4d8);}};}function respondWithFilteredResult(_0x5d329e,_0x267274){return function(_0x4073e8){if(_0x4073e8){var _0x33e96b=typeof _0x267274[_0x2ee9('0x1b')]==='undefined'&&typeof _0x267274[_0x2ee9('0x1c')]===_0x2ee9('0x1d');var _0xee600a=_0x4073e8['count'];var _0x45cf60=_0x33e96b?0x0:_0x267274['offset'];var _0x5e4e8c=_0x33e96b?_0x4073e8[_0x2ee9('0x1e')]:_0x267274[_0x2ee9('0x1b')]+_0x267274[_0x2ee9('0x1c')];var _0x9640b0;if(_0x5e4e8c>=_0xee600a){_0x5e4e8c=_0xee600a;_0x9640b0=0xc8;}else{_0x9640b0=0xce;}_0x5d329e['status'](_0x9640b0);return _0x5d329e[_0x2ee9('0x1f')](_0x2ee9('0x20'),_0x45cf60+'-'+_0x5e4e8c+'/'+_0xee600a)[_0x2ee9('0x1a')](_0x4073e8);}return null;};}function patchUpdates(_0x20f0a3){return function(_0x163fc6){try{jsonpatch[_0x2ee9('0x21')](_0x163fc6,_0x20f0a3,!![]);}catch(_0x1718f5){return BPromise[_0x2ee9('0x22')](_0x1718f5);}return _0x163fc6[_0x2ee9('0x23')]();};}function saveUpdates(_0x204ed8,_0x1f1bc4){return function(_0x55813c){if(_0x55813c){return _0x55813c[_0x2ee9('0x24')](_0x204ed8)[_0x2ee9('0x25')](function(_0x267596){return _0x267596;});}return null;};}function removeEntity(_0x59b99f,_0x3bd554){return function(_0x221235){if(_0x221235){return _0x221235[_0x2ee9('0x26')]()[_0x2ee9('0x25')](function(){_0x59b99f[_0x2ee9('0x19')](0xcc)[_0x2ee9('0x27')]();});}};}function handleEntityNotFound(_0x255d99,_0x4bc9cf){return function(_0x3791e3){if(!_0x3791e3){_0x255d99[_0x2ee9('0x18')](0x194);}return _0x3791e3;};}function handleError(_0xecfbf6,_0x1a389c){_0x1a389c=_0x1a389c||0x1f4;return function(_0x5064e9){logger[_0x2ee9('0x28')](_0x5064e9[_0x2ee9('0x29')]);if(_0x5064e9[_0x2ee9('0x2a')]){delete _0x5064e9['name'];}_0xecfbf6[_0x2ee9('0x19')](_0x1a389c)['send'](_0x5064e9);};}exports['index']=function(_0xdc7fac,_0x2ace4f){var _0x59137e={},_0x18d8b8={},_0x151045={'count':0x0,'rows':[]};var _0x38d339=_[_0x2ee9('0x2b')](db[_0x2ee9('0x2c')][_0x2ee9('0x2d')],function(_0x4cf4a5){return{'name':_0x4cf4a5[_0x2ee9('0x2e')],'type':_0x4cf4a5[_0x2ee9('0x2f')][_0x2ee9('0x30')]};});_0x18d8b8[_0x2ee9('0x31')]=_[_0x2ee9('0x2b')](_0x38d339,_0x2ee9('0x2a'));_0x18d8b8['query']=_[_0x2ee9('0x32')](_0xdc7fac[_0x2ee9('0x33')]);_0x18d8b8[_0x2ee9('0x34')]=_[_0x2ee9('0x35')](_0x18d8b8[_0x2ee9('0x31')],_0x18d8b8[_0x2ee9('0x33')]);_0x59137e[_0x2ee9('0x36')]=_['intersection'](_0x18d8b8['model'],qs[_0x2ee9('0x37')](_0xdc7fac[_0x2ee9('0x33')][_0x2ee9('0x37')]));_0x59137e[_0x2ee9('0x36')]=_0x59137e[_0x2ee9('0x36')]['length']?_0x59137e[_0x2ee9('0x36')]:_0x18d8b8[_0x2ee9('0x31')];if(!_0xdc7fac[_0x2ee9('0x33')][_0x2ee9('0x38')](_0x2ee9('0x39'))){_0x59137e[_0x2ee9('0x1c')]=qs[_0x2ee9('0x1c')](_0xdc7fac[_0x2ee9('0x33')]['limit']);_0x59137e['offset']=qs[_0x2ee9('0x1b')](_0xdc7fac[_0x2ee9('0x33')]['offset']);}_0x59137e[_0x2ee9('0x3a')]=qs[_0x2ee9('0x3b')](_0xdc7fac[_0x2ee9('0x33')][_0x2ee9('0x3b')]);_0x59137e[_0x2ee9('0x3c')]=qs['filters'](_[_0x2ee9('0x3d')](_0xdc7fac[_0x2ee9('0x33')],_0x18d8b8[_0x2ee9('0x34')]),_0x38d339);if(_0xdc7fac['query'][_0x2ee9('0x3e')]){_0x59137e[_0x2ee9('0x3c')]=_['merge'](_0x59137e[_0x2ee9('0x3c')],{'$or':_[_0x2ee9('0x2b')](_0x38d339,function(_0x1faecf){if(_0x1faecf[_0x2ee9('0x2f')]!==_0x2ee9('0x3f')){var _0x1b63a2={};_0x1b63a2[_0x1faecf[_0x2ee9('0x2a')]]={'$like':'%'+_0xdc7fac[_0x2ee9('0x33')][_0x2ee9('0x3e')]+'%'};return _0x1b63a2;}})});}_0x59137e=_[_0x2ee9('0x40')]({},_0x59137e,_0xdc7fac[_0x2ee9('0x41')]);var _0x4da609={'where':_0x59137e['where']};return db['SquareRecording'][_0x2ee9('0x1e')](_0x4da609)[_0x2ee9('0x25')](function(_0x422280){_0x151045[_0x2ee9('0x1e')]=_0x422280;if(_0xdc7fac['query'][_0x2ee9('0x42')]){_0x59137e['include']=[{'all':!![]}];}return db['SquareRecording'][_0x2ee9('0x43')](_0x59137e);})[_0x2ee9('0x25')](function(_0x489134){_0x151045[_0x2ee9('0x44')]=_0x489134;return _0x151045;})[_0x2ee9('0x25')](respondWithFilteredResult(_0x2ace4f,_0x59137e))[_0x2ee9('0x45')](handleError(_0x2ace4f,null));};exports['show']=function(_0x17c762,_0x510b9d){var _0x2ff587={'raw':!![],'where':{'id':_0x17c762[_0x2ee9('0x46')]['id']}},_0x118a1b={};_0x118a1b['model']=_['keys'](db[_0x2ee9('0x2c')][_0x2ee9('0x2d')]);_0x118a1b[_0x2ee9('0x33')]=_[_0x2ee9('0x32')](_0x17c762[_0x2ee9('0x33')]);_0x118a1b[_0x2ee9('0x34')]=_[_0x2ee9('0x35')](_0x118a1b['model'],_0x118a1b[_0x2ee9('0x33')]);_0x2ff587['attributes']=_[_0x2ee9('0x35')](_0x118a1b[_0x2ee9('0x31')],qs[_0x2ee9('0x37')](_0x17c762[_0x2ee9('0x33')]['fields']));_0x2ff587['attributes']=_0x2ff587['attributes']['length']?_0x2ff587[_0x2ee9('0x36')]:_0x118a1b[_0x2ee9('0x31')];if(_0x17c762[_0x2ee9('0x33')][_0x2ee9('0x42')]){_0x2ff587[_0x2ee9('0x47')]=[{'all':!![]}];}_0x2ff587=_[_0x2ee9('0x40')]({},_0x2ff587,_0x17c762['options']);return db['SquareRecording'][_0x2ee9('0x48')](_0x2ff587)[_0x2ee9('0x25')](handleEntityNotFound(_0x510b9d,null))['then'](respondWithResult(_0x510b9d,null))[_0x2ee9('0x45')](handleError(_0x510b9d,null));};exports['create']=function(_0x1d9536,_0x23c2fb){return db['SquareRecording']['create'](_0x1d9536[_0x2ee9('0x49')],{})[_0x2ee9('0x25')](respondWithResult(_0x23c2fb,0xc9))[_0x2ee9('0x45')](handleError(_0x23c2fb,null));};exports['update']=function(_0x4e6046,_0x5eb278){if(_0x4e6046[_0x2ee9('0x49')]['id']){delete _0x4e6046[_0x2ee9('0x49')]['id'];}return db['SquareRecording'][_0x2ee9('0x48')]({'where':{'id':_0x4e6046['params']['id']}})[_0x2ee9('0x25')](handleEntityNotFound(_0x5eb278,null))[_0x2ee9('0x25')](saveUpdates(_0x4e6046[_0x2ee9('0x49')],null))['then'](respondWithResult(_0x5eb278,null))[_0x2ee9('0x45')](handleError(_0x5eb278,null));};exports['download']=function(_0xa6e922,_0x4b652a,_0x43a293){var _0x525577=require(_0x2ee9('0x4a'));var _0x57e9b5=![];var _0x488059={};if(_0xa6e922[_0x2ee9('0x33')][_0x2ee9('0x2f')]&&_0xa6e922[_0x2ee9('0x33')]['type']===_0x2ee9('0x4b')){_0x488059[_0x2ee9('0x4b')]=_0xa6e922[_0x2ee9('0x46')]['id'];}else{_0x488059['id']=_0xa6e922[_0x2ee9('0x46')]['id'];}return db[_0x2ee9('0x2c')][_0x2ee9('0x48')]({'where':_0x488059,'attributes':['id','savePath',_0x2ee9('0x4c')],'raw':!![]})[_0x2ee9('0x25')](handleEntityNotFound(_0x4b652a,null))[_0x2ee9('0x25')](function(_0x3ff492){if(_0x3ff492){var _0x41f0db=_0x3ff492[_0x2ee9('0x4d')];var _0x5b1505=util['format'](_0x2ee9('0x4e'),_0x41f0db);if(fs[_0x2ee9('0x4f')](_0x5b1505)){_0x57e9b5=!![];return _0x525577[_0x2ee9('0x50')](_0x5b1505,_0x41f0db,config[_0x2ee9('0x51')][_0x2ee9('0x52')])[_0x2ee9('0x25')](function(){return _0x3ff492;});}return _0x3ff492;}})['then'](function(_0x2e2b67){if(_0x2e2b67){var _0x3b6fae=_0x2e2b67[_0x2ee9('0x4d')];if(!fs['existsSync'](_0x3b6fae)){throw new db[(_0x2ee9('0x53'))][(_0x2ee9('0x54'))](_0x2ee9('0x55'));}if(_0x2e2b67[_0x2ee9('0x4c')]){return _0x4b652a['download'](_0x3b6fae,_0x2e2b67[_0x2ee9('0x4c')]+path['extname'](_0x3b6fae),function(){if(_0x57e9b5){fs[_0x2ee9('0x56')](_0x3b6fae);}});}else{return _0x4b652a[_0x2ee9('0x57')](_0x3b6fae,function(_0x207550){if(_0x57e9b5){fs[_0x2ee9('0x56')](_0x3b6fae);}});}}})[_0x2ee9('0x45')](function(_0x15722f){if(_0x15722f[_0x2ee9('0x58')]===_0x2ee9('0x55')){_0x4b652a[_0x2ee9('0x19')](0x194)['send'](_0x2ee9('0x59'));}else{return handleError(_0x4b652a,null);}});};exports[_0x2ee9('0x26')]=function(_0x6b6b65,_0x27e9d5){return db[_0x2ee9('0x2c')][_0x2ee9('0x48')]({'where':{'id':_0x6b6b65['params']['id']}})[_0x2ee9('0x25')](function(_0x2db2e8){if(_['isNil'](_0x2db2e8)){throw new ReferenceError(_0x2ee9('0x5a'));}return _0x2db2e8;})[_0x2ee9('0x25')](function(_0x81aa0c){var _0x354458=_0x81aa0c[_0x2ee9('0x4d')];logger['info'](_0x2ee9('0x5b'),_0x354458);if(!_['isNil'](_0x81aa0c[_0x2ee9('0x4d')])&&fs[_0x2ee9('0x4f')](_0x354458)){logger[_0x2ee9('0x5c')](_0x2ee9('0x5d')+_0x354458+_0x2ee9('0x5e'));fs['unlinkSync'](_0x354458);}_0x354458=_0x354458+_0x2ee9('0x5f');if(!_[_0x2ee9('0x60')](_0x81aa0c[_0x2ee9('0x4d')])&&fs[_0x2ee9('0x4f')](_0x354458)){logger[_0x2ee9('0x5c')](_0x2ee9('0x5d')+_0x354458+_0x2ee9('0x5e'));fs['unlinkSync'](_0x354458);}return _0x81aa0c;})[_0x2ee9('0x25')](function(_0x5b2bd8){if(!_0x5b2bd8)throw new InternalError();return _0x5b2bd8[_0x2ee9('0x26')]();})[_0x2ee9('0x25')](function(){_0x27e9d5['status'](0xcc)[_0x2ee9('0x27')]();})[_0x2ee9('0x45')](handleError(_0x27e9d5,null));}; \ No newline at end of file +var _0xcbb6=['fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','SquareRecording','rawAttributes','type','key','model','map','keys','query','filters','intersection','attributes','fields','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','find','create','body','download','../../components/encryptor','uniqueid','savePath','format','%s.cypher','existsSync','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','filename','unlink','message','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs'];(function(_0x5155b1,_0x447c2e){var _0x2b50b1=function(_0x492ee5){while(--_0x492ee5){_0x5155b1['push'](_0x5155b1['shift']());}};_0x2b50b1(++_0x447c2e);}(_0xcbb6,0x1e5));var _0x6cbb=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xcbb6[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require(_0x6cbb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6cbb('0x1'));var jsonpatch=require(_0x6cbb('0x2'));var rp=require(_0x6cbb('0x3'));var moment=require(_0x6cbb('0x4'));var BPromise=require(_0x6cbb('0x5'));var Mustache=require('mustache');var util=require(_0x6cbb('0x6'));var path=require(_0x6cbb('0x7'));var sox=require(_0x6cbb('0x8'));var csv=require('to-csv');var ejs=require(_0x6cbb('0x9'));var fs=require('fs');var fs_extra=require(_0x6cbb('0xa'));var _=require('lodash');var squel=require(_0x6cbb('0xb'));var crypto=require(_0x6cbb('0xc'));var jsforce=require(_0x6cbb('0xd'));var deskjs=require(_0x6cbb('0xe'));var toCsv=require(_0x6cbb('0xf'));var querystring=require(_0x6cbb('0x10'));var Papa=require(_0x6cbb('0x11'));var Redis=require('ioredis');var authService=require(_0x6cbb('0x12'));var qs=require(_0x6cbb('0x13'));var as=require(_0x6cbb('0x14'));var hardwareService=require(_0x6cbb('0x15'));var logger=require('../../config/logger')(_0x6cbb('0x16'));var utils=require(_0x6cbb('0x17'));var config=require(_0x6cbb('0x18'));var licenseUtil=require(_0x6cbb('0x19'));var db=require(_0x6cbb('0x1a'))['db'];function respondWithStatusCode(_0x27edb0,_0x31f488){_0x31f488=_0x31f488||0xcc;return function(_0x29f771){if(_0x29f771){return _0x27edb0[_0x6cbb('0x1b')](_0x31f488);}return _0x27edb0[_0x6cbb('0x1c')](_0x31f488)[_0x6cbb('0x1d')]();};}function respondWithResult(_0x388261,_0x3ebb1b){_0x3ebb1b=_0x3ebb1b||0xc8;return function(_0x32f53a){if(_0x32f53a){return _0x388261['status'](_0x3ebb1b)['json'](_0x32f53a);}};}function respondWithFilteredResult(_0x50a3a4,_0x36d553){return function(_0x58736d){if(_0x58736d){var _0x9ee016=typeof _0x36d553[_0x6cbb('0x1e')]===_0x6cbb('0x1f')&&typeof _0x36d553[_0x6cbb('0x20')]===_0x6cbb('0x1f');var _0xfdd67d=_0x58736d[_0x6cbb('0x21')];var _0xb369a4=_0x9ee016?0x0:_0x36d553[_0x6cbb('0x1e')];var _0x22a9fc=_0x9ee016?_0x58736d[_0x6cbb('0x21')]:_0x36d553['offset']+_0x36d553[_0x6cbb('0x20')];var _0x32c508;if(_0x22a9fc>=_0xfdd67d){_0x22a9fc=_0xfdd67d;_0x32c508=0xc8;}else{_0x32c508=0xce;}_0x50a3a4[_0x6cbb('0x1c')](_0x32c508);return _0x50a3a4[_0x6cbb('0x22')](_0x6cbb('0x23'),_0xb369a4+'-'+_0x22a9fc+'/'+_0xfdd67d)[_0x6cbb('0x24')](_0x58736d);}return null;};}function patchUpdates(_0x313e30){return function(_0x1062d7){try{jsonpatch[_0x6cbb('0x25')](_0x1062d7,_0x313e30,!![]);}catch(_0x109dc8){return BPromise[_0x6cbb('0x26')](_0x109dc8);}return _0x1062d7[_0x6cbb('0x27')]();};}function saveUpdates(_0x4a19bd,_0x49ffb0){return function(_0x5ef801){if(_0x5ef801){return _0x5ef801[_0x6cbb('0x28')](_0x4a19bd)[_0x6cbb('0x29')](function(_0x1d60d2){return _0x1d60d2;});}return null;};}function removeEntity(_0x217497,_0x1b45ff){return function(_0x33da9b){if(_0x33da9b){return _0x33da9b[_0x6cbb('0x2a')]()['then'](function(){_0x217497[_0x6cbb('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e93fc,_0x503d85){return function(_0xb3b528){if(!_0xb3b528){_0x5e93fc['sendStatus'](0x194);}return _0xb3b528;};}function handleError(_0xea2b7,_0x3ad07f){_0x3ad07f=_0x3ad07f||0x1f4;return function(_0x562360){logger['error'](_0x562360[_0x6cbb('0x2b')]);if(_0x562360[_0x6cbb('0x2c')]){delete _0x562360[_0x6cbb('0x2c')];}_0xea2b7[_0x6cbb('0x1c')](_0x3ad07f)[_0x6cbb('0x2d')](_0x562360);};}exports['index']=function(_0x41b498,_0x56e08e){var _0x233367={},_0x251cec={},_0x95be85={'count':0x0,'rows':[]};var _0x7bbef4=_['map'](db[_0x6cbb('0x2e')][_0x6cbb('0x2f')],function(_0x5a2b2e){return{'name':_0x5a2b2e['fieldName'],'type':_0x5a2b2e[_0x6cbb('0x30')][_0x6cbb('0x31')]};});_0x251cec[_0x6cbb('0x32')]=_[_0x6cbb('0x33')](_0x7bbef4,'name');_0x251cec['query']=_[_0x6cbb('0x34')](_0x41b498[_0x6cbb('0x35')]);_0x251cec[_0x6cbb('0x36')]=_[_0x6cbb('0x37')](_0x251cec[_0x6cbb('0x32')],_0x251cec[_0x6cbb('0x35')]);_0x233367[_0x6cbb('0x38')]=_[_0x6cbb('0x37')](_0x251cec[_0x6cbb('0x32')],qs[_0x6cbb('0x39')](_0x41b498['query']['fields']));_0x233367[_0x6cbb('0x38')]=_0x233367[_0x6cbb('0x38')]['length']?_0x233367[_0x6cbb('0x38')]:_0x251cec[_0x6cbb('0x32')];if(!_0x41b498[_0x6cbb('0x35')]['hasOwnProperty']('nolimit')){_0x233367[_0x6cbb('0x20')]=qs[_0x6cbb('0x20')](_0x41b498[_0x6cbb('0x35')][_0x6cbb('0x20')]);_0x233367[_0x6cbb('0x1e')]=qs[_0x6cbb('0x1e')](_0x41b498[_0x6cbb('0x35')][_0x6cbb('0x1e')]);}_0x233367[_0x6cbb('0x3a')]=qs[_0x6cbb('0x3b')](_0x41b498[_0x6cbb('0x35')][_0x6cbb('0x3b')]);_0x233367[_0x6cbb('0x3c')]=qs[_0x6cbb('0x36')](_[_0x6cbb('0x3d')](_0x41b498[_0x6cbb('0x35')],_0x251cec['filters']),_0x7bbef4);if(_0x41b498['query']['filter']){_0x233367[_0x6cbb('0x3c')]=_[_0x6cbb('0x3e')](_0x233367[_0x6cbb('0x3c')],{'$or':_['map'](_0x7bbef4,function(_0x15292d){if(_0x15292d['type']!==_0x6cbb('0x3f')){var _0x24c5f4={};_0x24c5f4[_0x15292d[_0x6cbb('0x2c')]]={'$like':'%'+_0x41b498[_0x6cbb('0x35')][_0x6cbb('0x40')]+'%'};return _0x24c5f4;}})});}_0x233367=_['merge']({},_0x233367,_0x41b498[_0x6cbb('0x41')]);var _0x803d1={'where':_0x233367[_0x6cbb('0x3c')]};return db[_0x6cbb('0x2e')][_0x6cbb('0x21')](_0x803d1)['then'](function(_0x2e7f2b){_0x95be85['count']=_0x2e7f2b;if(_0x41b498['query'][_0x6cbb('0x42')]){_0x233367[_0x6cbb('0x43')]=[{'all':!![]}];}return db[_0x6cbb('0x2e')]['findAll'](_0x233367);})[_0x6cbb('0x29')](function(_0x5cc480){_0x95be85[_0x6cbb('0x44')]=_0x5cc480;return _0x95be85;})['then'](respondWithFilteredResult(_0x56e08e,_0x233367))[_0x6cbb('0x45')](handleError(_0x56e08e,null));};exports[_0x6cbb('0x46')]=function(_0x503e5e,_0x48a4ea){var _0xebffad={'raw':!![],'where':{'id':_0x503e5e[_0x6cbb('0x47')]['id']}},_0x311457={};_0x311457[_0x6cbb('0x32')]=_[_0x6cbb('0x34')](db[_0x6cbb('0x2e')]['rawAttributes']);_0x311457[_0x6cbb('0x35')]=_[_0x6cbb('0x34')](_0x503e5e['query']);_0x311457['filters']=_['intersection'](_0x311457[_0x6cbb('0x32')],_0x311457[_0x6cbb('0x35')]);_0xebffad['attributes']=_[_0x6cbb('0x37')](_0x311457[_0x6cbb('0x32')],qs[_0x6cbb('0x39')](_0x503e5e[_0x6cbb('0x35')][_0x6cbb('0x39')]));_0xebffad['attributes']=_0xebffad[_0x6cbb('0x38')]['length']?_0xebffad[_0x6cbb('0x38')]:_0x311457[_0x6cbb('0x32')];if(_0x503e5e[_0x6cbb('0x35')][_0x6cbb('0x42')]){_0xebffad['include']=[{'all':!![]}];}_0xebffad=_[_0x6cbb('0x3e')]({},_0xebffad,_0x503e5e[_0x6cbb('0x41')]);return db[_0x6cbb('0x2e')][_0x6cbb('0x48')](_0xebffad)[_0x6cbb('0x29')](handleEntityNotFound(_0x48a4ea,null))[_0x6cbb('0x29')](respondWithResult(_0x48a4ea,null))[_0x6cbb('0x45')](handleError(_0x48a4ea,null));};exports[_0x6cbb('0x49')]=function(_0x43745b,_0x104cfb){return db[_0x6cbb('0x2e')][_0x6cbb('0x49')](_0x43745b[_0x6cbb('0x4a')],{})[_0x6cbb('0x29')](respondWithResult(_0x104cfb,0xc9))[_0x6cbb('0x45')](handleError(_0x104cfb,null));};exports[_0x6cbb('0x28')]=function(_0x23fdcf,_0x10df68){if(_0x23fdcf[_0x6cbb('0x4a')]['id']){delete _0x23fdcf[_0x6cbb('0x4a')]['id'];}return db[_0x6cbb('0x2e')][_0x6cbb('0x48')]({'where':{'id':_0x23fdcf[_0x6cbb('0x47')]['id']}})[_0x6cbb('0x29')](handleEntityNotFound(_0x10df68,null))[_0x6cbb('0x29')](saveUpdates(_0x23fdcf[_0x6cbb('0x4a')],null))[_0x6cbb('0x29')](respondWithResult(_0x10df68,null))[_0x6cbb('0x45')](handleError(_0x10df68,null));};exports[_0x6cbb('0x4b')]=function(_0x53ac52,_0x3610a9,_0x3de16d){var _0x3a3c43=require(_0x6cbb('0x4c'));var _0x220a76=![];var _0x2932d2={};if(_0x53ac52[_0x6cbb('0x35')][_0x6cbb('0x30')]&&_0x53ac52['query'][_0x6cbb('0x30')]===_0x6cbb('0x4d')){_0x2932d2['uniqueid']=_0x53ac52[_0x6cbb('0x47')]['id'];}else{_0x2932d2['id']=_0x53ac52[_0x6cbb('0x47')]['id'];}return db['SquareRecording']['find']({'where':_0x2932d2,'attributes':['id',_0x6cbb('0x4e'),'filename'],'raw':!![]})[_0x6cbb('0x29')](handleEntityNotFound(_0x3610a9,null))[_0x6cbb('0x29')](function(_0x1d3369){if(_0x1d3369){var _0x2343e6=_0x1d3369['savePath'];var _0x55200f=util[_0x6cbb('0x4f')](_0x6cbb('0x50'),_0x2343e6);if(fs[_0x6cbb('0x51')](_0x55200f)){_0x220a76=!![];return _0x3a3c43['decryptFile'](_0x55200f,_0x2343e6,config[_0x6cbb('0x52')][_0x6cbb('0x53')])['then'](function(){return _0x1d3369;});}return _0x1d3369;}})[_0x6cbb('0x29')](function(_0x5ab172){if(_0x5ab172){var _0x28b439=_0x5ab172['savePath'];if(!fs[_0x6cbb('0x51')](_0x28b439)){throw new db[(_0x6cbb('0x54'))][(_0x6cbb('0x55'))](_0x6cbb('0x56'));}if(_0x5ab172[_0x6cbb('0x57')]){return _0x3610a9['download'](_0x28b439,_0x5ab172[_0x6cbb('0x57')]+path['extname'](_0x28b439),function(){if(_0x220a76){fs[_0x6cbb('0x58')](_0x28b439);}});}else{return _0x3610a9[_0x6cbb('0x4b')](_0x28b439,function(_0x3a2572){if(_0x220a76){fs[_0x6cbb('0x58')](_0x28b439);}});}}})[_0x6cbb('0x45')](function(_0x5ba85f){if(_0x5ba85f[_0x6cbb('0x59')]===_0x6cbb('0x56')){_0x3610a9[_0x6cbb('0x1c')](0x194)[_0x6cbb('0x2d')](_0x6cbb('0x5a'));}else{return handleError(_0x3610a9,null);}});};exports[_0x6cbb('0x2a')]=function(_0x21644f,_0x5aa641){return db[_0x6cbb('0x2e')]['find']({'where':{'id':_0x21644f[_0x6cbb('0x47')]['id']}})[_0x6cbb('0x29')](function(_0x1c658a){if(_[_0x6cbb('0x5b')](_0x1c658a)){throw new ReferenceError(_0x6cbb('0x5c'));}return _0x1c658a;})[_0x6cbb('0x29')](function(_0x2e213d){var _0x5f58ca=_0x2e213d[_0x6cbb('0x4e')];logger[_0x6cbb('0x5d')](_0x6cbb('0x5e'),_0x5f58ca);if(!_[_0x6cbb('0x5b')](_0x2e213d[_0x6cbb('0x4e')])&&fs[_0x6cbb('0x51')](_0x5f58ca)){logger[_0x6cbb('0x5d')](_0x6cbb('0x5f')+_0x5f58ca+_0x6cbb('0x60'));fs[_0x6cbb('0x61')](_0x5f58ca);}_0x5f58ca=_0x5f58ca+_0x6cbb('0x62');if(!_['isNil'](_0x2e213d['savePath'])&&fs[_0x6cbb('0x51')](_0x5f58ca)){logger[_0x6cbb('0x5d')](_0x6cbb('0x5f')+_0x5f58ca+_0x6cbb('0x60'));fs[_0x6cbb('0x61')](_0x5f58ca);}return _0x2e213d;})['then'](function(_0x4efe87){if(!_0x4efe87)throw new InternalError();return _0x4efe87[_0x6cbb('0x2a')]();})[_0x6cbb('0x29')](function(){_0x5aa641['status'](0xcc)[_0x6cbb('0x1d')]();})[_0x6cbb('0x45')](handleError(_0x5aa641,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index eee62de..e1cdd54 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 _0xacc6=['moment','request-promise','path','rimraf','./squareRecording.attributes','SquareRecording','lodash','util','../../config/logger','api'];(function(_0x2282aa,_0x2f6b8b){var _0x562d94=function(_0x133b0c){while(--_0x133b0c){_0x2282aa['push'](_0x2282aa['shift']());}};_0x562d94(++_0x2f6b8b);}(_0xacc6,0x150));var _0x6acc=function(_0x13b392,_0x3481f2){_0x13b392=_0x13b392-0x0;var _0x39db24=_0xacc6[_0x13b392];return _0x39db24;};'use strict';var _=require(_0x6acc('0x0'));var util=require(_0x6acc('0x1'));var logger=require(_0x6acc('0x2'))(_0x6acc('0x3'));var moment=require(_0x6acc('0x4'));var BPromise=require('bluebird');var rp=require(_0x6acc('0x5'));var fs=require('fs');var path=require(_0x6acc('0x6'));var rimraf=require(_0x6acc('0x7'));var config=require('../../config/environment');var attributes=require(_0x6acc('0x8'));module['exports']=function(_0xae1fa2,_0x1b97f1){return _0xae1fa2['define'](_0x6acc('0x9'),attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x58c9=['request-promise','path','rimraf','../../config/environment','./squareRecording.attributes','exports','define','SquareRecording','square_recordings','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x8cbd1c,_0xbf434a){var _0x579f5b=function(_0x58e420){while(--_0x58e420){_0x8cbd1c['push'](_0x8cbd1c['shift']());}};_0x579f5b(++_0xbf434a);}(_0x58c9,0x1bc));var _0x958c=function(_0x30d861,_0x376f99){_0x30d861=_0x30d861-0x0;var _0x572043=_0x58c9[_0x30d861];return _0x572043;};'use strict';var _=require(_0x958c('0x0'));var util=require(_0x958c('0x1'));var logger=require(_0x958c('0x2'))(_0x958c('0x3'));var moment=require(_0x958c('0x4'));var BPromise=require(_0x958c('0x5'));var rp=require(_0x958c('0x6'));var fs=require('fs');var path=require(_0x958c('0x7'));var rimraf=require(_0x958c('0x8'));var config=require(_0x958c('0x9'));var attributes=require(_0x958c('0xa'));module[_0x958c('0xb')]=function(_0x3e5ce2,_0x4ddd59){return _0x3e5ce2[_0x958c('0xc')](_0x958c('0xd'),attributes,{'tableName':_0x958c('0xe'),'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 869238c..d55a435 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 _0x9970=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','SquareRecording','create','options','raw','CreateSquareRecording','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x4e29b3,_0x24f9ff){var _0xe21365=function(_0x20644c){while(--_0x20644c){_0x4e29b3['push'](_0x4e29b3['shift']());}};_0xe21365(++_0x24f9ff);}(_0x9970,0x19e));var _0x0997=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9970[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var util=require(_0x0997('0x0'));var moment=require('moment');var BPromise=require(_0x0997('0x1'));var rs=require(_0x0997('0x2'));var fs=require('fs');var Redis=require(_0x0997('0x3'));var db=require(_0x0997('0x4'))['db'];var utils=require(_0x0997('0x5'));var logger=require(_0x0997('0x6'))(_0x0997('0x7'));var config=require(_0x0997('0x8'));var jayson=require(_0x0997('0x9'));var client=jayson[_0x0997('0xa')][_0x0997('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1b4300,_0x46aa3a,_0x200353){return new BPromise(function(_0xbfcead,_0x5b4259){return client[_0x0997('0xc')](_0x1b4300,_0x200353)[_0x0997('0xd')](function(_0x3ba87d){logger['info'](_0x0997('0xe'),_0x46aa3a,_0x0997('0xf'));logger[_0x0997('0x10')](_0x0997('0x11'),_0x46aa3a,_0x0997('0xf'),JSON[_0x0997('0x12')](_0x3ba87d));if(_0x3ba87d[_0x0997('0x13')]){if(_0x3ba87d['error'][_0x0997('0x14')]===0x1f4){logger[_0x0997('0x13')](_0x0997('0xe'),_0x46aa3a,_0x3ba87d[_0x0997('0x13')][_0x0997('0x15')]);return _0x5b4259(_0x3ba87d[_0x0997('0x13')]['message']);}logger[_0x0997('0x13')]('SquareRecording,\x20%s,\x20%s',_0x46aa3a,_0x3ba87d[_0x0997('0x13')][_0x0997('0x15')]);return _0xbfcead(_0x3ba87d['error']['message']);}else{logger[_0x0997('0x16')]('SquareRecording,\x20%s,\x20%s',_0x46aa3a,_0x0997('0xf'));_0xbfcead(_0x3ba87d[_0x0997('0x17')][_0x0997('0x15')]);}})[_0x0997('0x18')](function(_0x72cfba){logger[_0x0997('0x13')]('SquareRecording,\x20%s,\x20%s',_0x46aa3a,_0x72cfba);_0x5b4259(_0x72cfba);});});}exports['CreateSquareRecording']=function(_0x1d71a1){var _0xd39d4a=this;return new Promise(function(_0x17ff89,_0x147aec){return db[_0x0997('0x19')][_0x0997('0x1a')](_0x1d71a1['body'],{'raw':_0x1d71a1[_0x0997('0x1b')]?_0x1d71a1[_0x0997('0x1b')][_0x0997('0x1c')]===undefined?!![]:![]:!![]})[_0x0997('0xd')](function(_0x493b01){logger[_0x0997('0x16')]('CreateSquareRecording',_0x1d71a1);logger[_0x0997('0x10')](_0x0997('0x1d'),_0x1d71a1,JSON[_0x0997('0x12')](_0x493b01));_0x17ff89(_0x493b01);})[_0x0997('0x18')](function(_0xa5a4d4){logger[_0x0997('0x13')]('CreateSquareRecording',_0xa5a4d4[_0x0997('0x15')],_0x1d71a1);_0x147aec(_0xd39d4a[_0x0997('0x13')](0x1f4,_0xa5a4d4[_0x0997('0x15')]));});});}; \ No newline at end of file +var _0x6596=['SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SquareRecording','create','options','raw','then','CreateSquareRecording','catch','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','request','info'];(function(_0x5cef48,_0x4f4b95){var _0x2486c6=function(_0x4acbe3){while(--_0x4acbe3){_0x5cef48['push'](_0x5cef48['shift']());}};_0x2486c6(++_0x4f4b95);}(_0x6596,0x73));var _0x6659=function(_0x4faea9,_0x36b257){_0x4faea9=_0x4faea9-0x0;var _0x1311fb=_0x6596[_0x4faea9];return _0x1311fb;};'use strict';var _=require(_0x6659('0x0'));var util=require('util');var moment=require(_0x6659('0x1'));var BPromise=require(_0x6659('0x2'));var rs=require(_0x6659('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6659('0x4'));var logger=require(_0x6659('0x5'))(_0x6659('0x6'));var config=require(_0x6659('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x540b3b,_0x12b9e8,_0xc4d25f){return new BPromise(function(_0x34d063,_0x35d57c){return client[_0x6659('0x8')](_0x540b3b,_0xc4d25f)['then'](function(_0x1dcc93){logger[_0x6659('0x9')](_0x6659('0xa'),_0x12b9e8,_0x6659('0xb'));logger[_0x6659('0xc')](_0x6659('0xd'),_0x12b9e8,_0x6659('0xb'),JSON[_0x6659('0xe')](_0x1dcc93));if(_0x1dcc93[_0x6659('0xf')]){if(_0x1dcc93['error'][_0x6659('0x10')]===0x1f4){logger[_0x6659('0xf')](_0x6659('0xa'),_0x12b9e8,_0x1dcc93['error'][_0x6659('0x11')]);return _0x35d57c(_0x1dcc93[_0x6659('0xf')][_0x6659('0x11')]);}logger[_0x6659('0xf')](_0x6659('0xa'),_0x12b9e8,_0x1dcc93[_0x6659('0xf')][_0x6659('0x11')]);return _0x34d063(_0x1dcc93['error'][_0x6659('0x11')]);}else{logger[_0x6659('0x9')](_0x6659('0xa'),_0x12b9e8,_0x6659('0xb'));_0x34d063(_0x1dcc93['result'][_0x6659('0x11')]);}})['catch'](function(_0x20e730){logger['error']('SquareRecording,\x20%s,\x20%s',_0x12b9e8,_0x20e730);_0x35d57c(_0x20e730);});});}exports['CreateSquareRecording']=function(_0x344107){var _0x36fcad=this;return new Promise(function(_0x2cca5b,_0x386047){return db[_0x6659('0x12')][_0x6659('0x13')](_0x344107['body'],{'raw':_0x344107[_0x6659('0x14')]?_0x344107['options'][_0x6659('0x15')]===undefined?!![]:![]:!![]})[_0x6659('0x16')](function(_0x51cd0c){logger[_0x6659('0x9')](_0x6659('0x17'),_0x344107);logger[_0x6659('0xc')]('CreateSquareRecording',_0x344107,JSON[_0x6659('0xe')](_0x51cd0c));_0x2cca5b(_0x51cd0c);})[_0x6659('0x18')](function(_0x333dfa){logger[_0x6659('0xf')](_0x6659('0x17'),_0x333dfa[_0x6659('0x11')],_0x344107);_0x386047(_0x36fcad[_0x6659('0xf')](0x1f4,_0x333dfa[_0x6659('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index dc97f29..b0ec146 100644 --- a/server/api/squareReport/index.js +++ b/server/api/squareReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x2d747c,_0x851c49){var _0x2ac042=function(_0x2ffeb7){while(--_0x2ffeb7){_0x2d747c['push'](_0x2d747c['shift']());}};_0x2ac042(++_0x851c49);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./squareReport.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +var _0xe706=['/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index'];(function(_0x308f6f,_0x3ed414){var _0x535e4e=function(_0x1e3f6d){while(--_0x1e3f6d){_0x308f6f['push'](_0x308f6f['shift']());}};_0x535e4e(++_0x3ed414);}(_0xe706,0xa3));var _0x6e70=function(_0xdd598a,_0x2f4169){_0xdd598a=_0xdd598a-0x0;var _0x18c8d7=_0xe706[_0xdd598a];return _0x18c8d7;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller['update']);router['delete'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);module[_0x6e70('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index e56aef0..66b726a 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 _0x508f=['STRING','DATE','BOOLEAN','sequelize'];(function(_0x28c8c9,_0x5bb436){var _0x1a37b3=function(_0x507c48){while(--_0x507c48){_0x28c8c9['push'](_0x28c8c9['shift']());}};_0x1a37b3(++_0x5bb436);}(_0x508f,0x18f));var _0xf508=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x508f[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xf508('0x0'));module['exports']={'network':{'type':Sequelize[_0xf508('0x1')]},'network_script':{'type':Sequelize[_0xf508('0x1')]},'request':{'type':Sequelize[_0xf508('0x1')]},'channel':{'type':Sequelize[_0xf508('0x1')]},'language':{'type':Sequelize[_0xf508('0x1')]},'type':{'type':Sequelize[_0xf508('0x1')]},'uniqueid':{'type':Sequelize[_0xf508('0x1')]},'version':{'type':Sequelize[_0xf508('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xf508('0x1')]},'callingpres':{'type':Sequelize[_0xf508('0x1')]},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0xf508('0x1')]},'callingtns':{'type':Sequelize[_0xf508('0x1')]},'dnid':{'type':Sequelize[_0xf508('0x1')]},'rdnis':{'type':Sequelize[_0xf508('0x1')]},'context':{'type':Sequelize[_0xf508('0x1')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xf508('0x1')]},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xf508('0x1')]},'threadid':{'type':Sequelize[_0xf508('0x1')]},'project_name':{'type':Sequelize[_0xf508('0x1')]},'joinAt':{'type':Sequelize[_0xf508('0x2')]},'leaveAt':{'type':Sequelize[_0xf508('0x2')]},'bot':{'type':Sequelize[_0xf508('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xfc3d=['exports','STRING','DATE','sequelize'];(function(_0xc99e12,_0x1cc683){var _0x3fa45b=function(_0xcac6a){while(--_0xcac6a){_0xc99e12['push'](_0xc99e12['shift']());}};_0x3fa45b(++_0x1cc683);}(_0xfc3d,0x123));var _0xdfc3=function(_0xff023d,_0x59062a){_0xff023d=_0xff023d-0x0;var _0x1bdba3=_0xfc3d[_0xff023d];return _0x1bdba3;};'use strict';var Sequelize=require(_0xdfc3('0x0'));module[_0xdfc3('0x1')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0xdfc3('0x2')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xdfc3('0x2')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xdfc3('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize[_0xdfc3('0x2')]},'callerid':{'type':Sequelize[_0xdfc3('0x2')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0xdfc3('0x2')]},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xdfc3('0x2')]},'extension':{'type':Sequelize[_0xdfc3('0x2')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0xdfc3('0x2')]},'accountcode':{'type':Sequelize[_0xdfc3('0x2')]},'threadid':{'type':Sequelize[_0xdfc3('0x2')]},'project_name':{'type':Sequelize[_0xdfc3('0x2')]},'joinAt':{'type':Sequelize[_0xdfc3('0x3')]},'leaveAt':{'type':Sequelize[_0xdfc3('0x3')]},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index d133722..b0aa23e 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 _0x16a5=['body','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','stack','name','send','map','SquareReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create'];(function(_0x5d544b,_0x135845){var _0x291d35=function(_0x521603){while(--_0x521603){_0x5d544b['push'](_0x5d544b['shift']());}};_0x291d35(++_0x135845);}(_0x16a5,0x133));var _0x516a=function(_0x312ff8,_0x5d7167){_0x312ff8=_0x312ff8-0x0;var _0x4e144b=_0x16a5[_0x312ff8];return _0x4e144b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x516a('0x0'));var zipdir=require(_0x516a('0x1'));var jsonpatch=require(_0x516a('0x2'));var rp=require(_0x516a('0x3'));var moment=require(_0x516a('0x4'));var BPromise=require(_0x516a('0x5'));var Mustache=require('mustache');var util=require(_0x516a('0x6'));var path=require(_0x516a('0x7'));var sox=require(_0x516a('0x8'));var csv=require(_0x516a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x516a('0xa'));var _=require(_0x516a('0xb'));var squel=require(_0x516a('0xc'));var crypto=require(_0x516a('0xd'));var jsforce=require(_0x516a('0xe'));var deskjs=require(_0x516a('0xf'));var toCsv=require(_0x516a('0x9'));var querystring=require(_0x516a('0x10'));var Papa=require(_0x516a('0x11'));var Redis=require(_0x516a('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x516a('0x13'));var hardwareService=require(_0x516a('0x14'));var logger=require('../../config/logger')(_0x516a('0x15'));var utils=require('../../config/utils');var config=require(_0x516a('0x16'));var licenseUtil=require(_0x516a('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2e837a,_0x3ac888){_0x3ac888=_0x3ac888||0xcc;return function(_0x40cefe){if(_0x40cefe){return _0x2e837a[_0x516a('0x18')](_0x3ac888);}return _0x2e837a[_0x516a('0x19')](_0x3ac888)[_0x516a('0x1a')]();};}function respondWithResult(_0x30451b,_0x79a0fe){_0x79a0fe=_0x79a0fe||0xc8;return function(_0x3f64a0){if(_0x3f64a0){return _0x30451b[_0x516a('0x19')](_0x79a0fe)['json'](_0x3f64a0);}};}function respondWithFilteredResult(_0x309fdd,_0x430198){return function(_0x42d305){if(_0x42d305){var _0x3353a9=typeof _0x430198[_0x516a('0x1b')]===_0x516a('0x1c')&&typeof _0x430198[_0x516a('0x1d')]===_0x516a('0x1c');var _0xdbc15a=_0x42d305['count'];var _0x9af7ac=_0x3353a9?0x0:_0x430198['offset'];var _0xd81450=_0x3353a9?_0x42d305[_0x516a('0x1e')]:_0x430198['offset']+_0x430198['limit'];var _0x8cfa0b;if(_0xd81450>=_0xdbc15a){_0xd81450=_0xdbc15a;_0x8cfa0b=0xc8;}else{_0x8cfa0b=0xce;}_0x309fdd[_0x516a('0x19')](_0x8cfa0b);return _0x309fdd['set'](_0x516a('0x1f'),_0x9af7ac+'-'+_0xd81450+'/'+_0xdbc15a)[_0x516a('0x20')](_0x42d305);}return null;};}function patchUpdates(_0x538c58){return function(_0xf06054){try{jsonpatch[_0x516a('0x21')](_0xf06054,_0x538c58,!![]);}catch(_0x331814){return BPromise[_0x516a('0x22')](_0x331814);}return _0xf06054[_0x516a('0x23')]();};}function saveUpdates(_0x25663a,_0x5dae30){return function(_0x32adf0){if(_0x32adf0){return _0x32adf0[_0x516a('0x24')](_0x25663a)[_0x516a('0x25')](function(_0x12f19e){return _0x12f19e;});}return null;};}function removeEntity(_0x959e50,_0x244a0f){return function(_0x310fbe){if(_0x310fbe){return _0x310fbe['destroy']()[_0x516a('0x25')](function(){_0x959e50[_0x516a('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x8f8c46,_0x284f11){return function(_0x24acaa){if(!_0x24acaa){_0x8f8c46[_0x516a('0x18')](0x194);}return _0x24acaa;};}function handleError(_0x3dfacb,_0x4e7cd4){_0x4e7cd4=_0x4e7cd4||0x1f4;return function(_0x650f82){logger['error'](_0x650f82[_0x516a('0x26')]);if(_0x650f82[_0x516a('0x27')]){delete _0x650f82[_0x516a('0x27')];}_0x3dfacb[_0x516a('0x19')](_0x4e7cd4)[_0x516a('0x28')](_0x650f82);};}exports['index']=function(_0x1c4efd,_0x33a1c6){var _0x3922be={},_0x3d5cbe={},_0x29a3c1={'count':0x0,'rows':[]};var _0x485a15=_[_0x516a('0x29')](db[_0x516a('0x2a')][_0x516a('0x2b')],function(_0x415e33){return{'name':_0x415e33[_0x516a('0x2c')],'type':_0x415e33[_0x516a('0x2d')][_0x516a('0x2e')]};});_0x3d5cbe[_0x516a('0x2f')]=_[_0x516a('0x29')](_0x485a15,_0x516a('0x27'));_0x3d5cbe[_0x516a('0x30')]=_['keys'](_0x1c4efd['query']);_0x3d5cbe[_0x516a('0x31')]=_['intersection'](_0x3d5cbe[_0x516a('0x2f')],_0x3d5cbe['query']);_0x3922be['attributes']=_[_0x516a('0x32')](_0x3d5cbe[_0x516a('0x2f')],qs['fields'](_0x1c4efd['query'][_0x516a('0x33')]));_0x3922be[_0x516a('0x34')]=_0x3922be[_0x516a('0x34')][_0x516a('0x35')]?_0x3922be[_0x516a('0x34')]:_0x3d5cbe[_0x516a('0x2f')];if(!_0x1c4efd[_0x516a('0x30')][_0x516a('0x36')]('nolimit')){_0x3922be[_0x516a('0x1d')]=qs[_0x516a('0x1d')](_0x1c4efd[_0x516a('0x30')]['limit']);_0x3922be[_0x516a('0x1b')]=qs[_0x516a('0x1b')](_0x1c4efd[_0x516a('0x30')][_0x516a('0x1b')]);}_0x3922be[_0x516a('0x37')]=qs[_0x516a('0x38')](_0x1c4efd['query'][_0x516a('0x38')]);_0x3922be[_0x516a('0x39')]=qs['filters'](_[_0x516a('0x3a')](_0x1c4efd[_0x516a('0x30')],_0x3d5cbe[_0x516a('0x31')]),_0x485a15);if(_0x1c4efd[_0x516a('0x30')][_0x516a('0x3b')]){_0x3922be[_0x516a('0x39')]=_[_0x516a('0x3c')](_0x3922be['where'],{'$or':_[_0x516a('0x29')](_0x485a15,function(_0x3dc3c3){if(_0x3dc3c3[_0x516a('0x2d')]!==_0x516a('0x3d')){var _0x4e3db5={};_0x4e3db5[_0x3dc3c3[_0x516a('0x27')]]={'$like':'%'+_0x1c4efd['query'][_0x516a('0x3b')]+'%'};return _0x4e3db5;}})});}_0x3922be=_['merge']({},_0x3922be,_0x1c4efd['options']);var _0x43f73e={'where':_0x3922be[_0x516a('0x39')]};return db['SquareReport'][_0x516a('0x1e')](_0x43f73e)[_0x516a('0x25')](function(_0x14750b){_0x29a3c1[_0x516a('0x1e')]=_0x14750b;if(_0x1c4efd[_0x516a('0x30')][_0x516a('0x3e')]){_0x3922be[_0x516a('0x3f')]=[{'all':!![]}];}return db[_0x516a('0x2a')][_0x516a('0x40')](_0x3922be);})['then'](function(_0x24e4d8){_0x29a3c1[_0x516a('0x41')]=_0x24e4d8;return _0x29a3c1;})['then'](respondWithFilteredResult(_0x33a1c6,_0x3922be))[_0x516a('0x42')](handleError(_0x33a1c6,null));};exports[_0x516a('0x43')]=function(_0x514070,_0x32ac60){var _0x25a635={'raw':!![],'where':{'id':_0x514070[_0x516a('0x44')]['id']}},_0x5d86d4={};_0x5d86d4[_0x516a('0x2f')]=_[_0x516a('0x45')](db[_0x516a('0x2a')][_0x516a('0x2b')]);_0x5d86d4[_0x516a('0x30')]=_[_0x516a('0x45')](_0x514070[_0x516a('0x30')]);_0x5d86d4['filters']=_[_0x516a('0x32')](_0x5d86d4[_0x516a('0x2f')],_0x5d86d4['query']);_0x25a635[_0x516a('0x34')]=_[_0x516a('0x32')](_0x5d86d4[_0x516a('0x2f')],qs[_0x516a('0x33')](_0x514070[_0x516a('0x30')][_0x516a('0x33')]));_0x25a635['attributes']=_0x25a635[_0x516a('0x34')][_0x516a('0x35')]?_0x25a635[_0x516a('0x34')]:_0x5d86d4[_0x516a('0x2f')];if(_0x514070[_0x516a('0x30')][_0x516a('0x3e')]){_0x25a635[_0x516a('0x3f')]=[{'all':!![]}];}_0x25a635=_[_0x516a('0x3c')]({},_0x25a635,_0x514070[_0x516a('0x46')]);return db['SquareReport'][_0x516a('0x47')](_0x25a635)[_0x516a('0x25')](handleEntityNotFound(_0x32ac60,null))['then'](respondWithResult(_0x32ac60,null))[_0x516a('0x42')](handleError(_0x32ac60,null));};exports[_0x516a('0x48')]=function(_0x89053a,_0x2f0d6f){return db['SquareReport'][_0x516a('0x48')](_0x89053a[_0x516a('0x49')],{})['then'](respondWithResult(_0x2f0d6f,0xc9))[_0x516a('0x42')](handleError(_0x2f0d6f,null));};exports[_0x516a('0x24')]=function(_0x1ab925,_0x14fc08){if(_0x1ab925[_0x516a('0x49')]['id']){delete _0x1ab925[_0x516a('0x49')]['id'];}return db[_0x516a('0x2a')]['find']({'where':{'id':_0x1ab925['params']['id']}})['then'](handleEntityNotFound(_0x14fc08,null))[_0x516a('0x25')](saveUpdates(_0x1ab925['body'],null))[_0x516a('0x25')](respondWithResult(_0x14fc08,null))[_0x516a('0x42')](handleError(_0x14fc08,null));};exports[_0x516a('0x4a')]=function(_0x69d8e5,_0x5435f1){return db['SquareReport']['find']({'where':{'id':_0x69d8e5['params']['id']}})[_0x516a('0x25')](handleEntityNotFound(_0x5435f1,null))[_0x516a('0x25')](removeEntity(_0x5435f1,null))['catch'](handleError(_0x5435f1,null));};exports[_0x516a('0x4b')]=function(_0x4a89fb,_0x1956f5){return db['SquareReport'][_0x516a('0x4b')]()[_0x516a('0x25')](respondWithResult(_0x1956f5,null))['catch'](handleError(_0x1956f5,null));}; \ No newline at end of file +var _0xedff=['../../config/logger','api','../../config/utils','../../config/environment','status','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','SquareReport','fieldName','type','key','map','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','offset','order','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','rawAttributes','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x1fcb89,_0x97e587){var _0x2a1e82=function(_0x3ecd7d){while(--_0x3ecd7d){_0x1fcb89['push'](_0x1fcb89['shift']());}};_0x2a1e82(++_0x97e587);}(_0xedff,0xd4));var _0xfedf=function(_0x190030,_0x160f66){_0x190030=_0x190030-0x0;var _0x3ad6aa=_0xedff[_0x190030];return _0x3ad6aa;};'use strict';var emlformat=require(_0xfedf('0x0'));var rimraf=require(_0xfedf('0x1'));var zipdir=require(_0xfedf('0x2'));var jsonpatch=require(_0xfedf('0x3'));var rp=require(_0xfedf('0x4'));var moment=require(_0xfedf('0x5'));var BPromise=require(_0xfedf('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xfedf('0x7'));var sox=require(_0xfedf('0x8'));var csv=require(_0xfedf('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfedf('0xa'));var _=require(_0xfedf('0xb'));var squel=require(_0xfedf('0xc'));var crypto=require(_0xfedf('0xd'));var jsforce=require(_0xfedf('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xfedf('0x9'));var querystring=require(_0xfedf('0xf'));var Papa=require(_0xfedf('0x10'));var Redis=require(_0xfedf('0x11'));var authService=require(_0xfedf('0x12'));var qs=require(_0xfedf('0x13'));var as=require(_0xfedf('0x14'));var hardwareService=require(_0xfedf('0x15'));var logger=require(_0xfedf('0x16'))(_0xfedf('0x17'));var utils=require(_0xfedf('0x18'));var config=require(_0xfedf('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x569247,_0x363499){_0x363499=_0x363499||0xcc;return function(_0x255a21){if(_0x255a21){return _0x569247['sendStatus'](_0x363499);}return _0x569247[_0xfedf('0x1a')](_0x363499)['end']();};}function respondWithResult(_0x315a47,_0xd6afae){_0xd6afae=_0xd6afae||0xc8;return function(_0x1e7bda){if(_0x1e7bda){return _0x315a47[_0xfedf('0x1a')](_0xd6afae)[_0xfedf('0x1b')](_0x1e7bda);}};}function respondWithFilteredResult(_0x2d505e,_0x6a54f4){return function(_0x30eea6){if(_0x30eea6){var _0x367c7c=typeof _0x6a54f4['offset']===_0xfedf('0x1c')&&typeof _0x6a54f4[_0xfedf('0x1d')]===_0xfedf('0x1c');var _0x574088=_0x30eea6[_0xfedf('0x1e')];var _0xd3cb47=_0x367c7c?0x0:_0x6a54f4['offset'];var _0x54820f=_0x367c7c?_0x30eea6[_0xfedf('0x1e')]:_0x6a54f4['offset']+_0x6a54f4[_0xfedf('0x1d')];var _0x1f7ae8;if(_0x54820f>=_0x574088){_0x54820f=_0x574088;_0x1f7ae8=0xc8;}else{_0x1f7ae8=0xce;}_0x2d505e[_0xfedf('0x1a')](_0x1f7ae8);return _0x2d505e[_0xfedf('0x1f')](_0xfedf('0x20'),_0xd3cb47+'-'+_0x54820f+'/'+_0x574088)[_0xfedf('0x1b')](_0x30eea6);}return null;};}function patchUpdates(_0x7f2353){return function(_0x47e7f7){try{jsonpatch[_0xfedf('0x21')](_0x47e7f7,_0x7f2353,!![]);}catch(_0x2f703c){return BPromise[_0xfedf('0x22')](_0x2f703c);}return _0x47e7f7[_0xfedf('0x23')]();};}function saveUpdates(_0xd731ea,_0x3fe760){return function(_0x493254){if(_0x493254){return _0x493254[_0xfedf('0x24')](_0xd731ea)[_0xfedf('0x25')](function(_0x5245cd){return _0x5245cd;});}return null;};}function removeEntity(_0x236e21,_0x42887a){return function(_0x493dd6){if(_0x493dd6){return _0x493dd6[_0xfedf('0x26')]()['then'](function(){_0x236e21[_0xfedf('0x1a')](0xcc)[_0xfedf('0x27')]();});}};}function handleEntityNotFound(_0x187259,_0x596ace){return function(_0x2319ff){if(!_0x2319ff){_0x187259[_0xfedf('0x28')](0x194);}return _0x2319ff;};}function handleError(_0x30a4eb,_0x2a62f0){_0x2a62f0=_0x2a62f0||0x1f4;return function(_0x40c468){logger[_0xfedf('0x29')](_0x40c468[_0xfedf('0x2a')]);if(_0x40c468[_0xfedf('0x2b')]){delete _0x40c468[_0xfedf('0x2b')];}_0x30a4eb['status'](_0x2a62f0)[_0xfedf('0x2c')](_0x40c468);};}exports[_0xfedf('0x2d')]=function(_0x1ca5f0,_0x2e56e4){var _0x1843c0={},_0x5f3792={},_0x128420={'count':0x0,'rows':[]};var _0x759769=_['map'](db[_0xfedf('0x2e')]['rawAttributes'],function(_0xe916dc){return{'name':_0xe916dc[_0xfedf('0x2f')],'type':_0xe916dc[_0xfedf('0x30')][_0xfedf('0x31')]};});_0x5f3792['model']=_[_0xfedf('0x32')](_0x759769,'name');_0x5f3792['query']=_[_0xfedf('0x33')](_0x1ca5f0[_0xfedf('0x34')]);_0x5f3792[_0xfedf('0x35')]=_[_0xfedf('0x36')](_0x5f3792[_0xfedf('0x37')],_0x5f3792[_0xfedf('0x34')]);_0x1843c0['attributes']=_['intersection'](_0x5f3792[_0xfedf('0x37')],qs['fields'](_0x1ca5f0[_0xfedf('0x34')][_0xfedf('0x38')]));_0x1843c0[_0xfedf('0x39')]=_0x1843c0[_0xfedf('0x39')][_0xfedf('0x3a')]?_0x1843c0[_0xfedf('0x39')]:_0x5f3792['model'];if(!_0x1ca5f0[_0xfedf('0x34')][_0xfedf('0x3b')](_0xfedf('0x3c'))){_0x1843c0[_0xfedf('0x1d')]=qs['limit'](_0x1ca5f0[_0xfedf('0x34')][_0xfedf('0x1d')]);_0x1843c0[_0xfedf('0x3d')]=qs[_0xfedf('0x3d')](_0x1ca5f0['query'][_0xfedf('0x3d')]);}_0x1843c0[_0xfedf('0x3e')]=qs['sort'](_0x1ca5f0[_0xfedf('0x34')]['sort']);_0x1843c0[_0xfedf('0x3f')]=qs[_0xfedf('0x35')](_['pick'](_0x1ca5f0[_0xfedf('0x34')],_0x5f3792[_0xfedf('0x35')]),_0x759769);if(_0x1ca5f0['query']['filter']){_0x1843c0[_0xfedf('0x3f')]=_[_0xfedf('0x40')](_0x1843c0[_0xfedf('0x3f')],{'$or':_[_0xfedf('0x32')](_0x759769,function(_0xccf346){if(_0xccf346['type']!==_0xfedf('0x41')){var _0x421500={};_0x421500[_0xccf346['name']]={'$like':'%'+_0x1ca5f0[_0xfedf('0x34')]['filter']+'%'};return _0x421500;}})});}_0x1843c0=_[_0xfedf('0x40')]({},_0x1843c0,_0x1ca5f0[_0xfedf('0x42')]);var _0x2cedd2={'where':_0x1843c0[_0xfedf('0x3f')]};return db[_0xfedf('0x2e')]['count'](_0x2cedd2)[_0xfedf('0x25')](function(_0x26880c){_0x128420[_0xfedf('0x1e')]=_0x26880c;if(_0x1ca5f0[_0xfedf('0x34')][_0xfedf('0x43')]){_0x1843c0[_0xfedf('0x44')]=[{'all':!![]}];}return db['SquareReport']['findAll'](_0x1843c0);})[_0xfedf('0x25')](function(_0x35ac5c){_0x128420[_0xfedf('0x45')]=_0x35ac5c;return _0x128420;})['then'](respondWithFilteredResult(_0x2e56e4,_0x1843c0))[_0xfedf('0x46')](handleError(_0x2e56e4,null));};exports[_0xfedf('0x47')]=function(_0x2e43e,_0x5b24c5){var _0x4689e4={'raw':!![],'where':{'id':_0x2e43e['params']['id']}},_0x355190={};_0x355190['model']=_[_0xfedf('0x33')](db[_0xfedf('0x2e')][_0xfedf('0x48')]);_0x355190[_0xfedf('0x34')]=_[_0xfedf('0x33')](_0x2e43e[_0xfedf('0x34')]);_0x355190[_0xfedf('0x35')]=_[_0xfedf('0x36')](_0x355190[_0xfedf('0x37')],_0x355190[_0xfedf('0x34')]);_0x4689e4[_0xfedf('0x39')]=_['intersection'](_0x355190[_0xfedf('0x37')],qs[_0xfedf('0x38')](_0x2e43e[_0xfedf('0x34')][_0xfedf('0x38')]));_0x4689e4[_0xfedf('0x39')]=_0x4689e4[_0xfedf('0x39')]['length']?_0x4689e4['attributes']:_0x355190['model'];if(_0x2e43e[_0xfedf('0x34')][_0xfedf('0x43')]){_0x4689e4[_0xfedf('0x44')]=[{'all':!![]}];}_0x4689e4=_[_0xfedf('0x40')]({},_0x4689e4,_0x2e43e['options']);return db[_0xfedf('0x2e')][_0xfedf('0x49')](_0x4689e4)[_0xfedf('0x25')](handleEntityNotFound(_0x5b24c5,null))[_0xfedf('0x25')](respondWithResult(_0x5b24c5,null))['catch'](handleError(_0x5b24c5,null));};exports['create']=function(_0x3ccbbc,_0x347b34){return db[_0xfedf('0x2e')][_0xfedf('0x4a')](_0x3ccbbc['body'],{})[_0xfedf('0x25')](respondWithResult(_0x347b34,0xc9))['catch'](handleError(_0x347b34,null));};exports[_0xfedf('0x24')]=function(_0x1c1fb4,_0x3b4a03){if(_0x1c1fb4[_0xfedf('0x4b')]['id']){delete _0x1c1fb4[_0xfedf('0x4b')]['id'];}return db[_0xfedf('0x2e')][_0xfedf('0x49')]({'where':{'id':_0x1c1fb4[_0xfedf('0x4c')]['id']}})[_0xfedf('0x25')](handleEntityNotFound(_0x3b4a03,null))['then'](saveUpdates(_0x1c1fb4['body'],null))['then'](respondWithResult(_0x3b4a03,null))['catch'](handleError(_0x3b4a03,null));};exports[_0xfedf('0x26')]=function(_0xa23278,_0x5f16b0){return db[_0xfedf('0x2e')]['find']({'where':{'id':_0xa23278[_0xfedf('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5f16b0,null))['then'](removeEntity(_0x5f16b0,null))['catch'](handleError(_0x5f16b0,null));};exports[_0xfedf('0x4d')]=function(_0x44cd40,_0x4cb767){return db[_0xfedf('0x2e')]['describe']()['then'](respondWithResult(_0x4cb767,null))[_0xfedf('0x46')](handleError(_0x4cb767,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index a01fe87..50f790f 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 _0xcc34=['moment','bluebird','request-promise','rimraf','./squareReport.attributes','exports','define','SquareReport','uniqueid','project_name','leaveAt','util','../../config/logger','api'];(function(_0x202207,_0xfbb0c4){var _0x12d35f=function(_0x4946f9){while(--_0x4946f9){_0x202207['push'](_0x202207['shift']());}};_0x12d35f(++_0xfbb0c4);}(_0xcc34,0x14d));var _0x4cc3=function(_0x38c593,_0x45c4d6){_0x38c593=_0x38c593-0x0;var _0x218c57=_0xcc34[_0x38c593];return _0x218c57;};'use strict';var _=require('lodash');var util=require(_0x4cc3('0x0'));var logger=require(_0x4cc3('0x1'))(_0x4cc3('0x2'));var moment=require(_0x4cc3('0x3'));var BPromise=require(_0x4cc3('0x4'));var rp=require(_0x4cc3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4cc3('0x6'));var config=require('../../config/environment');var attributes=require(_0x4cc3('0x7'));module[_0x4cc3('0x8')]=function(_0x28dea4,_0x1ab556){return _0x28dea4[_0x4cc3('0x9')](_0x4cc3('0xa'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0x4cc3('0xb'),_0x4cc3('0xc')]},{'name':_0x4cc3('0xd'),'fields':[_0x4cc3('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0071=['SquareReport','report_square','uid_pname','leaveAt','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./squareReport.attributes','define'];(function(_0x5d8d04,_0x39cc52){var _0x37882f=function(_0x1bab66){while(--_0x1bab66){_0x5d8d04['push'](_0x5d8d04['shift']());}};_0x37882f(++_0x39cc52);}(_0x0071,0x170));var _0x1007=function(_0x3f12ed,_0x320cd7){_0x3f12ed=_0x3f12ed-0x0;var _0x3a1437=_0x0071[_0x3f12ed];return _0x3a1437;};'use strict';var _=require(_0x1007('0x0'));var util=require(_0x1007('0x1'));var logger=require(_0x1007('0x2'))(_0x1007('0x3'));var moment=require(_0x1007('0x4'));var BPromise=require(_0x1007('0x5'));var rp=require(_0x1007('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1007('0x7'));var config=require('../../config/environment');var attributes=require(_0x1007('0x8'));module['exports']=function(_0x42eb8c,_0x248df5){return _0x42eb8c[_0x1007('0x9')](_0x1007('0xa'),attributes,{'tableName':_0x1007('0xb'),'paranoid':![],'indexes':[{'name':_0x1007('0xc'),'fields':['uniqueid','project_name']},{'name':_0x1007('0xd'),'fields':[_0x1007('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 40e2cd0..8c294cf 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 _0x05d6=['lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateSquareReport','SquareReport','create','options','raw','update','body','where','attributes','limit','UpdateSquareReport','catch'];(function(_0x33d01f,_0x188ebc){var _0x5864a5=function(_0x3e311e){while(--_0x3e311e){_0x33d01f['push'](_0x33d01f['shift']());}};_0x5864a5(++_0x188ebc);}(_0x05d6,0x1e0));var _0x605d=function(_0x3ae345,_0x31da5b){_0x3ae345=_0x3ae345-0x0;var _0x57fd8b=_0x05d6[_0x3ae345];return _0x57fd8b;};'use strict';var _=require(_0x605d('0x0'));var util=require('util');var moment=require(_0x605d('0x1'));var BPromise=require(_0x605d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x605d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x605d('0x4'));var logger=require(_0x605d('0x5'))(_0x605d('0x6'));var config=require(_0x605d('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x605d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2092dc,_0x36d9b6,_0x5dec85){return new BPromise(function(_0x4f1e40,_0x2381e4){return client['request'](_0x2092dc,_0x5dec85)[_0x605d('0x9')](function(_0x4815bd){logger[_0x605d('0xa')](_0x605d('0xb'),_0x36d9b6,_0x605d('0xc'));logger[_0x605d('0xd')](_0x605d('0xe'),_0x36d9b6,_0x605d('0xc'),JSON[_0x605d('0xf')](_0x4815bd));if(_0x4815bd[_0x605d('0x10')]){if(_0x4815bd[_0x605d('0x10')][_0x605d('0x11')]===0x1f4){logger[_0x605d('0x10')](_0x605d('0xb'),_0x36d9b6,_0x4815bd[_0x605d('0x10')][_0x605d('0x12')]);return _0x2381e4(_0x4815bd[_0x605d('0x10')][_0x605d('0x12')]);}logger[_0x605d('0x10')](_0x605d('0xb'),_0x36d9b6,_0x4815bd[_0x605d('0x10')]['message']);return _0x4f1e40(_0x4815bd[_0x605d('0x10')][_0x605d('0x12')]);}else{logger[_0x605d('0xa')](_0x605d('0xb'),_0x36d9b6,_0x605d('0xc'));_0x4f1e40(_0x4815bd[_0x605d('0x13')]['message']);}})['catch'](function(_0x3872a3){logger[_0x605d('0x10')](_0x605d('0xb'),_0x36d9b6,_0x3872a3);_0x2381e4(_0x3872a3);});});}exports[_0x605d('0x14')]=function(_0x4622ea){var _0x418c97=this;return new Promise(function(_0x123883,_0xbc0970){return db[_0x605d('0x15')][_0x605d('0x16')](_0x4622ea['body'],{'raw':_0x4622ea[_0x605d('0x17')]?_0x4622ea[_0x605d('0x17')][_0x605d('0x18')]===undefined?!![]:![]:!![]})[_0x605d('0x9')](function(_0x304a5b){logger[_0x605d('0xa')](_0x605d('0x14'),_0x4622ea);logger[_0x605d('0xd')]('CreateSquareReport',_0x4622ea,JSON[_0x605d('0xf')](_0x304a5b));_0x123883(_0x304a5b);})['catch'](function(_0x481dcd){logger[_0x605d('0x10')]('CreateSquareReport',_0x481dcd['message'],_0x4622ea);_0xbc0970(_0x418c97[_0x605d('0x10')](0x1f4,_0x481dcd[_0x605d('0x12')]));});});};exports['UpdateSquareReport']=function(_0x33d751){var _0x488a5d=this;return new Promise(function(_0x4c462b,_0x404e8c){return db['SquareReport'][_0x605d('0x19')](_0x33d751[_0x605d('0x1a')],{'raw':_0x33d751[_0x605d('0x17')]?_0x33d751[_0x605d('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x33d751[_0x605d('0x17')]?_0x33d751[_0x605d('0x17')][_0x605d('0x1b')]||null:null,'attributes':_0x33d751[_0x605d('0x17')]?_0x33d751[_0x605d('0x17')][_0x605d('0x1c')]||null:null,'limit':_0x33d751[_0x605d('0x17')]?_0x33d751[_0x605d('0x17')][_0x605d('0x1d')]||null:null})[_0x605d('0x9')](function(_0x3b3769){logger[_0x605d('0xa')](_0x605d('0x1e'),_0x33d751);logger[_0x605d('0xd')](_0x605d('0x1e'),_0x33d751,JSON[_0x605d('0xf')](_0x3b3769));_0x4c462b(_0x3b3769);})[_0x605d('0x1f')](function(_0x23203d){logger[_0x605d('0x10')](_0x605d('0x1e'),_0x23203d[_0x605d('0x12')],_0x33d751);_0x404e8c(_0x488a5d[_0x605d('0x10')](0x1f4,_0x23203d[_0x605d('0x12')]));});});}; \ No newline at end of file +var _0x5e5c=['request','info','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','SquareReport,\x20%s,\x20%s','message','catch','CreateSquareReport','SquareReport','body','options','raw','then','UpdateSquareReport','update','where','attributes','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http'];(function(_0x28407a,_0x2a7269){var _0x8bd6ef=function(_0x3c886f){while(--_0x3c886f){_0x28407a['push'](_0x28407a['shift']());}};_0x8bd6ef(++_0x2a7269);}(_0x5e5c,0x140));var _0xc5e5=function(_0x4665a7,_0x23747d){_0x4665a7=_0x4665a7-0x0;var _0x37431b=_0x5e5c[_0x4665a7];return _0x37431b;};'use strict';var _=require(_0xc5e5('0x0'));var util=require('util');var moment=require(_0xc5e5('0x1'));var BPromise=require(_0xc5e5('0x2'));var rs=require(_0xc5e5('0x3'));var fs=require('fs');var Redis=require(_0xc5e5('0x4'));var db=require(_0xc5e5('0x5'))['db'];var utils=require(_0xc5e5('0x6'));var logger=require(_0xc5e5('0x7'))('rpc');var config=require(_0xc5e5('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xc5e5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3e5589,_0x5a52e4,_0x160069){return new BPromise(function(_0x1647f9,_0x12c9de){return client[_0xc5e5('0xa')](_0x3e5589,_0x160069)['then'](function(_0x85e967){logger[_0xc5e5('0xb')]('SquareReport,\x20%s,\x20%s',_0x5a52e4,_0xc5e5('0xc'));logger[_0xc5e5('0xd')](_0xc5e5('0xe'),_0x5a52e4,'request\x20sent',JSON[_0xc5e5('0xf')](_0x85e967));if(_0x85e967[_0xc5e5('0x10')]){if(_0x85e967[_0xc5e5('0x10')]['code']===0x1f4){logger[_0xc5e5('0x10')](_0xc5e5('0x11'),_0x5a52e4,_0x85e967[_0xc5e5('0x10')][_0xc5e5('0x12')]);return _0x12c9de(_0x85e967[_0xc5e5('0x10')][_0xc5e5('0x12')]);}logger[_0xc5e5('0x10')](_0xc5e5('0x11'),_0x5a52e4,_0x85e967['error'][_0xc5e5('0x12')]);return _0x1647f9(_0x85e967[_0xc5e5('0x10')][_0xc5e5('0x12')]);}else{logger['info']('SquareReport,\x20%s,\x20%s',_0x5a52e4,_0xc5e5('0xc'));_0x1647f9(_0x85e967['result'][_0xc5e5('0x12')]);}})[_0xc5e5('0x13')](function(_0x193ea1){logger[_0xc5e5('0x10')](_0xc5e5('0x11'),_0x5a52e4,_0x193ea1);_0x12c9de(_0x193ea1);});});}exports[_0xc5e5('0x14')]=function(_0x6b3563){var _0x551995=this;return new Promise(function(_0x5190ba,_0x523f6d){return db[_0xc5e5('0x15')]['create'](_0x6b3563[_0xc5e5('0x16')],{'raw':_0x6b3563[_0xc5e5('0x17')]?_0x6b3563[_0xc5e5('0x17')][_0xc5e5('0x18')]===undefined?!![]:![]:!![]})[_0xc5e5('0x19')](function(_0x4e4574){logger[_0xc5e5('0xb')](_0xc5e5('0x14'),_0x6b3563);logger[_0xc5e5('0xd')]('CreateSquareReport',_0x6b3563,JSON[_0xc5e5('0xf')](_0x4e4574));_0x5190ba(_0x4e4574);})['catch'](function(_0x5281c0){logger[_0xc5e5('0x10')](_0xc5e5('0x14'),_0x5281c0[_0xc5e5('0x12')],_0x6b3563);_0x523f6d(_0x551995['error'](0x1f4,_0x5281c0[_0xc5e5('0x12')]));});});};exports[_0xc5e5('0x1a')]=function(_0x3342bb){var _0x1e3965=this;return new Promise(function(_0x7b9de7,_0x159447){return db[_0xc5e5('0x15')][_0xc5e5('0x1b')](_0x3342bb[_0xc5e5('0x16')],{'raw':_0x3342bb['options']?_0x3342bb['options'][_0xc5e5('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3342bb[_0xc5e5('0x17')]?_0x3342bb[_0xc5e5('0x17')][_0xc5e5('0x1c')]||null:null,'attributes':_0x3342bb['options']?_0x3342bb[_0xc5e5('0x17')][_0xc5e5('0x1d')]||null:null,'limit':_0x3342bb[_0xc5e5('0x17')]?_0x3342bb[_0xc5e5('0x17')]['limit']||null:null})['then'](function(_0x5de09a){logger[_0xc5e5('0xb')](_0xc5e5('0x1a'),_0x3342bb);logger['debug'](_0xc5e5('0x1a'),_0x3342bb,JSON['stringify'](_0x5de09a));_0x7b9de7(_0x5de09a);})[_0xc5e5('0x13')](function(_0x4a977a){logger[_0xc5e5('0x10')](_0xc5e5('0x1a'),_0x4a977a[_0xc5e5('0x12')],_0x3342bb);_0x159447(_0x1e3965['error'](0x1f4,_0x4a977a['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index ae4632c..9757531 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 _0xaec9=['post','create','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','isAuthenticated','index','/describe','describe','get','/:id'];(function(_0x1ce96e,_0x35b357){var _0x2965ab=function(_0x244c6f){while(--_0x244c6f){_0x1ce96e['push'](_0x1ce96e['shift']());}};_0x2965ab(++_0x35b357);}(_0xaec9,0x90));var _0x9aec=function(_0x5f4cd7,_0x459c44){_0x5f4cd7=_0x5f4cd7-0x0;var _0x47c93f=_0xaec9[_0x5f4cd7];return _0x47c93f;};'use strict';var multer=require('multer');var util=require(_0x9aec('0x0'));var path=require(_0x9aec('0x1'));var timeout=require(_0x9aec('0x2'));var express=require(_0x9aec('0x3'));var router=express[_0x9aec('0x4')]();var fs_extra=require(_0x9aec('0x5'));var auth=require(_0x9aec('0x6'));var interaction=require(_0x9aec('0x7'));var config=require(_0x9aec('0x8'));var controller=require(_0x9aec('0x9'));router['get']('/',auth[_0x9aec('0xa')](),controller[_0x9aec('0xb')]);router['get'](_0x9aec('0xc'),auth['isAuthenticated'](),controller[_0x9aec('0xd')]);router[_0x9aec('0xe')](_0x9aec('0xf'),auth[_0x9aec('0xa')](),controller['show']);router[_0x9aec('0x10')]('/',auth[_0x9aec('0xa')](),controller[_0x9aec('0x11')]);router['put'](_0x9aec('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x9aec('0x12')](_0x9aec('0xf'),auth[_0x9aec('0xa')](),controller['destroy']);module[_0x9aec('0x13')]=router; \ No newline at end of file +var _0x0caa=['delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','isAuthenticated','/describe','describe','/:id','show','create','update'];(function(_0x44349f,_0x2b921a){var _0x187aaf=function(_0x1916b3){while(--_0x1916b3){_0x44349f['push'](_0x44349f['shift']());}};_0x187aaf(++_0x2b921a);}(_0x0caa,0xc0));var _0xa0ca=function(_0xa8a57e,_0x27295c){_0xa8a57e=_0xa8a57e-0x0;var _0x53244c=_0x0caa[_0xa8a57e];return _0x53244c;};'use strict';var multer=require(_0xa0ca('0x0'));var util=require(_0xa0ca('0x1'));var path=require('path');var timeout=require(_0xa0ca('0x2'));var express=require(_0xa0ca('0x3'));var router=express[_0xa0ca('0x4')]();var fs_extra=require(_0xa0ca('0x5'));var auth=require(_0xa0ca('0x6'));var interaction=require(_0xa0ca('0x7'));var config=require(_0xa0ca('0x8'));var controller=require(_0xa0ca('0x9'));router['get']('/',auth[_0xa0ca('0xa')](),controller['index']);router['get'](_0xa0ca('0xb'),auth[_0xa0ca('0xa')](),controller[_0xa0ca('0xc')]);router['get'](_0xa0ca('0xd'),auth['isAuthenticated'](),controller[_0xa0ca('0xe')]);router['post']('/',auth[_0xa0ca('0xa')](),controller[_0xa0ca('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xa0ca('0x10')]);router[_0xa0ca('0x11')](_0xa0ca('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xa0ca('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 8b59750..1a4e542 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 _0xaaec=['STRING','TEXT','sequelize'];(function(_0x3f458e,_0x5da270){var _0x54e438=function(_0x51f7e0){while(--_0x51f7e0){_0x3f458e['push'](_0x3f458e['shift']());}};_0x54e438(++_0x5da270);}(_0xaaec,0x6b));var _0xcaae=function(_0x53816b,_0x2f9ba3){_0x53816b=_0x53816b-0x0;var _0x7f2259=_0xaaec[_0x53816b];return _0x7f2259;};'use strict';var Sequelize=require(_0xcaae('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xcaae('0x1')]},'node':{'type':Sequelize[_0xcaae('0x1')]},'application':{'type':Sequelize[_0xcaae('0x1')]},'data':{'type':Sequelize[_0xcaae('0x2')]},'project_name':{'type':Sequelize[_0xcaae('0x1')]},'callerid':{'type':Sequelize[_0xcaae('0x1')]}}; \ No newline at end of file +var _0xf42e=['exports','STRING'];(function(_0x5bc293,_0x120044){var _0x13a373=function(_0x584402){while(--_0x584402){_0x5bc293['push'](_0x5bc293['shift']());}};_0x13a373(++_0x120044);}(_0xf42e,0x132));var _0xef42=function(_0x4432c6,_0x267cf6){_0x4432c6=_0x4432c6-0x0;var _0x4c729b=_0xf42e[_0x4432c6];return _0x4c729b;};'use strict';var Sequelize=require('sequelize');module[_0xef42('0x0')]={'uniqueid':{'type':Sequelize[_0xef42('0x1')]},'node':{'type':Sequelize[_0xef42('0x1')]},'application':{'type':Sequelize[_0xef42('0x1')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0xef42('0x1')]},'callerid':{'type':Sequelize[_0xef42('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index ccd9abc..e869227 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 _0xafd1=['nolimit','order','sort','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','create','body','update','find','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','apply','then','stack','name','send','map','SquareDetailsReport','rawAttributes','fieldName','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty'];(function(_0x62c958,_0x2bfdbc){var _0x57ec61=function(_0x5c0094){while(--_0x5c0094){_0x62c958['push'](_0x62c958['shift']());}};_0x57ec61(++_0x2bfdbc);}(_0xafd1,0xa7));var _0x1afd=function(_0x3eb4a9,_0x359d73){_0x3eb4a9=_0x3eb4a9-0x0;var _0x48dbad=_0xafd1[_0x3eb4a9];return _0x48dbad;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1afd('0x0'));var jsonpatch=require(_0x1afd('0x1'));var rp=require(_0x1afd('0x2'));var moment=require(_0x1afd('0x3'));var BPromise=require(_0x1afd('0x4'));var Mustache=require(_0x1afd('0x5'));var util=require(_0x1afd('0x6'));var path=require(_0x1afd('0x7'));var sox=require(_0x1afd('0x8'));var csv=require(_0x1afd('0x9'));var ejs=require(_0x1afd('0xa'));var fs=require('fs');var fs_extra=require(_0x1afd('0xb'));var _=require(_0x1afd('0xc'));var squel=require(_0x1afd('0xd'));var crypto=require(_0x1afd('0xe'));var jsforce=require(_0x1afd('0xf'));var deskjs=require(_0x1afd('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1afd('0x11'));var Redis=require(_0x1afd('0x12'));var authService=require(_0x1afd('0x13'));var qs=require(_0x1afd('0x14'));var as=require(_0x1afd('0x15'));var hardwareService=require(_0x1afd('0x16'));var logger=require(_0x1afd('0x17'))('api');var utils=require(_0x1afd('0x18'));var config=require(_0x1afd('0x19'));var licenseUtil=require(_0x1afd('0x1a'));var db=require(_0x1afd('0x1b'))['db'];function respondWithStatusCode(_0x2817ce,_0x1b252a){_0x1b252a=_0x1b252a||0xcc;return function(_0xd024ed){if(_0xd024ed){return _0x2817ce[_0x1afd('0x1c')](_0x1b252a);}return _0x2817ce['status'](_0x1b252a)[_0x1afd('0x1d')]();};}function respondWithResult(_0x36286b,_0x589728){_0x589728=_0x589728||0xc8;return function(_0x3cd0e0){if(_0x3cd0e0){return _0x36286b['status'](_0x589728)[_0x1afd('0x1e')](_0x3cd0e0);}};}function respondWithFilteredResult(_0x1de830,_0x419ece){return function(_0x222468){if(_0x222468){var _0x1788b8=typeof _0x419ece[_0x1afd('0x1f')]===_0x1afd('0x20')&&typeof _0x419ece[_0x1afd('0x21')]===_0x1afd('0x20');var _0x46edfc=_0x222468['count'];var _0x51d87b=_0x1788b8?0x0:_0x419ece[_0x1afd('0x1f')];var _0x3f838b=_0x1788b8?_0x222468[_0x1afd('0x22')]:_0x419ece['offset']+_0x419ece[_0x1afd('0x21')];var _0x1381ac;if(_0x3f838b>=_0x46edfc){_0x3f838b=_0x46edfc;_0x1381ac=0xc8;}else{_0x1381ac=0xce;}_0x1de830[_0x1afd('0x23')](_0x1381ac);return _0x1de830['set']('Content-Range',_0x51d87b+'-'+_0x3f838b+'/'+_0x46edfc)['json'](_0x222468);}return null;};}function patchUpdates(_0x5994c6){return function(_0x2cad8f){try{jsonpatch[_0x1afd('0x24')](_0x2cad8f,_0x5994c6,!![]);}catch(_0x4419b0){return BPromise['reject'](_0x4419b0);}return _0x2cad8f['save']();};}function saveUpdates(_0x223d4d,_0x54d2e8){return function(_0x4b7092){if(_0x4b7092){return _0x4b7092['update'](_0x223d4d)[_0x1afd('0x25')](function(_0x3ae96c){return _0x3ae96c;});}return null;};}function removeEntity(_0x290ce9,_0x37d645){return function(_0x5d7c96){if(_0x5d7c96){return _0x5d7c96['destroy']()[_0x1afd('0x25')](function(){_0x290ce9[_0x1afd('0x23')](0xcc)[_0x1afd('0x1d')]();});}};}function handleEntityNotFound(_0x284730,_0x4db66e){return function(_0x7e7be0){if(!_0x7e7be0){_0x284730[_0x1afd('0x1c')](0x194);}return _0x7e7be0;};}function handleError(_0x2ace7d,_0x31d9c6){_0x31d9c6=_0x31d9c6||0x1f4;return function(_0x54ea70){logger['error'](_0x54ea70[_0x1afd('0x26')]);if(_0x54ea70['name']){delete _0x54ea70[_0x1afd('0x27')];}_0x2ace7d['status'](_0x31d9c6)[_0x1afd('0x28')](_0x54ea70);};}exports['index']=function(_0x35c16e,_0x5eda10){var _0x4a92f2={},_0x18c754={},_0x43c51c={'count':0x0,'rows':[]};var _0x3aba01=_[_0x1afd('0x29')](db[_0x1afd('0x2a')][_0x1afd('0x2b')],function(_0x5d43a4){return{'name':_0x5d43a4[_0x1afd('0x2c')],'type':_0x5d43a4['type'][_0x1afd('0x2d')]};});_0x18c754['model']=_['map'](_0x3aba01,_0x1afd('0x27'));_0x18c754['query']=_[_0x1afd('0x2e')](_0x35c16e[_0x1afd('0x2f')]);_0x18c754[_0x1afd('0x30')]=_[_0x1afd('0x31')](_0x18c754[_0x1afd('0x32')],_0x18c754[_0x1afd('0x2f')]);_0x4a92f2[_0x1afd('0x33')]=_[_0x1afd('0x31')](_0x18c754['model'],qs[_0x1afd('0x34')](_0x35c16e[_0x1afd('0x2f')][_0x1afd('0x34')]));_0x4a92f2[_0x1afd('0x33')]=_0x4a92f2[_0x1afd('0x33')][_0x1afd('0x35')]?_0x4a92f2[_0x1afd('0x33')]:_0x18c754[_0x1afd('0x32')];if(!_0x35c16e[_0x1afd('0x2f')][_0x1afd('0x36')](_0x1afd('0x37'))){_0x4a92f2[_0x1afd('0x21')]=qs[_0x1afd('0x21')](_0x35c16e[_0x1afd('0x2f')][_0x1afd('0x21')]);_0x4a92f2['offset']=qs['offset'](_0x35c16e[_0x1afd('0x2f')]['offset']);}_0x4a92f2[_0x1afd('0x38')]=qs[_0x1afd('0x39')](_0x35c16e[_0x1afd('0x2f')][_0x1afd('0x39')]);_0x4a92f2['where']=qs['filters'](_[_0x1afd('0x3a')](_0x35c16e['query'],_0x18c754[_0x1afd('0x30')]),_0x3aba01);if(_0x35c16e[_0x1afd('0x2f')][_0x1afd('0x3b')]){_0x4a92f2['where']=_['merge'](_0x4a92f2['where'],{'$or':_[_0x1afd('0x29')](_0x3aba01,function(_0x3b6fa5){if(_0x3b6fa5['type']!==_0x1afd('0x3c')){var _0x385c88={};_0x385c88[_0x3b6fa5[_0x1afd('0x27')]]={'$like':'%'+_0x35c16e['query'][_0x1afd('0x3b')]+'%'};return _0x385c88;}})});}_0x4a92f2=_[_0x1afd('0x3d')]({},_0x4a92f2,_0x35c16e[_0x1afd('0x3e')]);var _0x1eec72={'where':_0x4a92f2['where']};return db[_0x1afd('0x2a')]['count'](_0x1eec72)['then'](function(_0x49ac2d){_0x43c51c[_0x1afd('0x22')]=_0x49ac2d;if(_0x35c16e[_0x1afd('0x2f')][_0x1afd('0x3f')]){_0x4a92f2[_0x1afd('0x40')]=[{'all':!![]}];}return db['SquareDetailsReport'][_0x1afd('0x41')](_0x4a92f2);})[_0x1afd('0x25')](function(_0x34d653){_0x43c51c[_0x1afd('0x42')]=_0x34d653;return _0x43c51c;})['then'](respondWithFilteredResult(_0x5eda10,_0x4a92f2))[_0x1afd('0x43')](handleError(_0x5eda10,null));};exports['show']=function(_0x533c6e,_0x27e00f){var _0x568eb7={'raw':!![],'where':{'id':_0x533c6e[_0x1afd('0x44')]['id']}},_0x1293c6={};_0x1293c6['model']=_['keys'](db[_0x1afd('0x2a')][_0x1afd('0x2b')]);_0x1293c6[_0x1afd('0x2f')]=_['keys'](_0x533c6e[_0x1afd('0x2f')]);_0x1293c6[_0x1afd('0x30')]=_[_0x1afd('0x31')](_0x1293c6[_0x1afd('0x32')],_0x1293c6['query']);_0x568eb7[_0x1afd('0x33')]=_['intersection'](_0x1293c6[_0x1afd('0x32')],qs[_0x1afd('0x34')](_0x533c6e[_0x1afd('0x2f')][_0x1afd('0x34')]));_0x568eb7['attributes']=_0x568eb7[_0x1afd('0x33')][_0x1afd('0x35')]?_0x568eb7['attributes']:_0x1293c6['model'];if(_0x533c6e['query'][_0x1afd('0x3f')]){_0x568eb7[_0x1afd('0x40')]=[{'all':!![]}];}_0x568eb7=_[_0x1afd('0x3d')]({},_0x568eb7,_0x533c6e[_0x1afd('0x3e')]);return db[_0x1afd('0x2a')]['find'](_0x568eb7)[_0x1afd('0x25')](handleEntityNotFound(_0x27e00f,null))[_0x1afd('0x25')](respondWithResult(_0x27e00f,null))['catch'](handleError(_0x27e00f,null));};exports['create']=function(_0x56f607,_0x7616f4){return db[_0x1afd('0x2a')][_0x1afd('0x45')](_0x56f607[_0x1afd('0x46')],{})[_0x1afd('0x25')](respondWithResult(_0x7616f4,0xc9))[_0x1afd('0x43')](handleError(_0x7616f4,null));};exports[_0x1afd('0x47')]=function(_0x2ee235,_0x2acde1){if(_0x2ee235['body']['id']){delete _0x2ee235[_0x1afd('0x46')]['id'];}return db['SquareDetailsReport'][_0x1afd('0x48')]({'where':{'id':_0x2ee235[_0x1afd('0x44')]['id']}})['then'](handleEntityNotFound(_0x2acde1,null))[_0x1afd('0x25')](saveUpdates(_0x2ee235[_0x1afd('0x46')],null))[_0x1afd('0x25')](respondWithResult(_0x2acde1,null))[_0x1afd('0x43')](handleError(_0x2acde1,null));};exports['destroy']=function(_0x37fea1,_0x4165e6){return db[_0x1afd('0x2a')][_0x1afd('0x48')]({'where':{'id':_0x37fea1[_0x1afd('0x44')]['id']}})[_0x1afd('0x25')](handleEntityNotFound(_0x4165e6,null))[_0x1afd('0x25')](removeEntity(_0x4165e6,null))[_0x1afd('0x43')](handleError(_0x4165e6,null));};exports[_0x1afd('0x49')]=function(_0x1283da,_0x5b02cb){return db['SquareDetailsReport'][_0x1afd('0x49')]()['then'](respondWithResult(_0x5b02cb,null))[_0x1afd('0x43')](handleError(_0x5b02cb,null));}; \ No newline at end of file +var _0x8c87=['end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','send','index','map','SquareDetailsReport','rawAttributes','type','key','model','name','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','filters','filter','where','merge','options','includeAll','catch','show','params','include','find','create','body','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','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','../../config/license/util','../../mysqldb','status'];(function(_0x569caa,_0x5174ce){var _0x44cb5a=function(_0x456df4){while(--_0x456df4){_0x569caa['push'](_0x569caa['shift']());}};_0x44cb5a(++_0x5174ce);}(_0x8c87,0x10a));var _0x78c8=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0x8c87[_0xd1d19a];return _0x52a79d;};'use strict';var emlformat=require(_0x78c8('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x78c8('0x1'));var rp=require(_0x78c8('0x2'));var moment=require(_0x78c8('0x3'));var BPromise=require(_0x78c8('0x4'));var Mustache=require(_0x78c8('0x5'));var util=require(_0x78c8('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x78c8('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x78c8('0x8'));var crypto=require(_0x78c8('0x9'));var jsforce=require(_0x78c8('0xa'));var deskjs=require(_0x78c8('0xb'));var toCsv=require('to-csv');var querystring=require(_0x78c8('0xc'));var Papa=require(_0x78c8('0xd'));var Redis=require(_0x78c8('0xe'));var authService=require(_0x78c8('0xf'));var qs=require(_0x78c8('0x10'));var as=require(_0x78c8('0x11'));var hardwareService=require(_0x78c8('0x12'));var logger=require(_0x78c8('0x13'))(_0x78c8('0x14'));var utils=require(_0x78c8('0x15'));var config=require(_0x78c8('0x16'));var licenseUtil=require(_0x78c8('0x17'));var db=require(_0x78c8('0x18'))['db'];function respondWithStatusCode(_0x40901e,_0x117992){_0x117992=_0x117992||0xcc;return function(_0x100c74){if(_0x100c74){return _0x40901e['sendStatus'](_0x117992);}return _0x40901e[_0x78c8('0x19')](_0x117992)[_0x78c8('0x1a')]();};}function respondWithResult(_0x5aca52,_0x307cbe){_0x307cbe=_0x307cbe||0xc8;return function(_0x3f9b75){if(_0x3f9b75){return _0x5aca52[_0x78c8('0x19')](_0x307cbe)[_0x78c8('0x1b')](_0x3f9b75);}};}function respondWithFilteredResult(_0x372c2c,_0x3aaceb){return function(_0x585cd1){if(_0x585cd1){var _0x4a75e0=typeof _0x3aaceb[_0x78c8('0x1c')]===_0x78c8('0x1d')&&typeof _0x3aaceb[_0x78c8('0x1e')]===_0x78c8('0x1d');var _0x2bc146=_0x585cd1[_0x78c8('0x1f')];var _0x2dba28=_0x4a75e0?0x0:_0x3aaceb[_0x78c8('0x1c')];var _0x17e963=_0x4a75e0?_0x585cd1['count']:_0x3aaceb[_0x78c8('0x1c')]+_0x3aaceb[_0x78c8('0x1e')];var _0x4a8c69;if(_0x17e963>=_0x2bc146){_0x17e963=_0x2bc146;_0x4a8c69=0xc8;}else{_0x4a8c69=0xce;}_0x372c2c['status'](_0x4a8c69);return _0x372c2c[_0x78c8('0x20')](_0x78c8('0x21'),_0x2dba28+'-'+_0x17e963+'/'+_0x2bc146)['json'](_0x585cd1);}return null;};}function patchUpdates(_0xf4ae30){return function(_0x25c6d5){try{jsonpatch[_0x78c8('0x22')](_0x25c6d5,_0xf4ae30,!![]);}catch(_0x595fe6){return BPromise['reject'](_0x595fe6);}return _0x25c6d5[_0x78c8('0x23')]();};}function saveUpdates(_0xd9a480,_0x3a5f7a){return function(_0x156b45){if(_0x156b45){return _0x156b45[_0x78c8('0x24')](_0xd9a480)[_0x78c8('0x25')](function(_0x31861d){return _0x31861d;});}return null;};}function removeEntity(_0x1f28c8,_0x188c7d){return function(_0x1d82f6){if(_0x1d82f6){return _0x1d82f6[_0x78c8('0x26')]()[_0x78c8('0x25')](function(){_0x1f28c8[_0x78c8('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x55f1f1,_0x134206){return function(_0x34f255){if(!_0x34f255){_0x55f1f1[_0x78c8('0x27')](0x194);}return _0x34f255;};}function handleError(_0x24cbe8,_0xcd02c1){_0xcd02c1=_0xcd02c1||0x1f4;return function(_0x2ddbcd){logger[_0x78c8('0x28')](_0x2ddbcd[_0x78c8('0x29')]);if(_0x2ddbcd['name']){delete _0x2ddbcd['name'];}_0x24cbe8['status'](_0xcd02c1)[_0x78c8('0x2a')](_0x2ddbcd);};}exports[_0x78c8('0x2b')]=function(_0x3eb765,_0x35837f){var _0x3cbc01={},_0x5b0d7e={},_0x5c00a0={'count':0x0,'rows':[]};var _0x52008e=_[_0x78c8('0x2c')](db[_0x78c8('0x2d')][_0x78c8('0x2e')],function(_0x343bd4){return{'name':_0x343bd4['fieldName'],'type':_0x343bd4[_0x78c8('0x2f')][_0x78c8('0x30')]};});_0x5b0d7e[_0x78c8('0x31')]=_[_0x78c8('0x2c')](_0x52008e,_0x78c8('0x32'));_0x5b0d7e[_0x78c8('0x33')]=_[_0x78c8('0x34')](_0x3eb765[_0x78c8('0x33')]);_0x5b0d7e['filters']=_[_0x78c8('0x35')](_0x5b0d7e[_0x78c8('0x31')],_0x5b0d7e[_0x78c8('0x33')]);_0x3cbc01[_0x78c8('0x36')]=_[_0x78c8('0x35')](_0x5b0d7e['model'],qs[_0x78c8('0x37')](_0x3eb765[_0x78c8('0x33')][_0x78c8('0x37')]));_0x3cbc01['attributes']=_0x3cbc01[_0x78c8('0x36')]['length']?_0x3cbc01[_0x78c8('0x36')]:_0x5b0d7e[_0x78c8('0x31')];if(!_0x3eb765['query'][_0x78c8('0x38')](_0x78c8('0x39'))){_0x3cbc01['limit']=qs[_0x78c8('0x1e')](_0x3eb765['query'][_0x78c8('0x1e')]);_0x3cbc01[_0x78c8('0x1c')]=qs['offset'](_0x3eb765['query'][_0x78c8('0x1c')]);}_0x3cbc01['order']=qs['sort'](_0x3eb765['query'][_0x78c8('0x3a')]);_0x3cbc01['where']=qs[_0x78c8('0x3b')](_['pick'](_0x3eb765[_0x78c8('0x33')],_0x5b0d7e[_0x78c8('0x3b')]),_0x52008e);if(_0x3eb765['query'][_0x78c8('0x3c')]){_0x3cbc01[_0x78c8('0x3d')]=_[_0x78c8('0x3e')](_0x3cbc01['where'],{'$or':_[_0x78c8('0x2c')](_0x52008e,function(_0x8eb47b){if(_0x8eb47b[_0x78c8('0x2f')]!=='VIRTUAL'){var _0x255830={};_0x255830[_0x8eb47b[_0x78c8('0x32')]]={'$like':'%'+_0x3eb765[_0x78c8('0x33')][_0x78c8('0x3c')]+'%'};return _0x255830;}})});}_0x3cbc01=_[_0x78c8('0x3e')]({},_0x3cbc01,_0x3eb765[_0x78c8('0x3f')]);var _0x59ce3f={'where':_0x3cbc01[_0x78c8('0x3d')]};return db[_0x78c8('0x2d')][_0x78c8('0x1f')](_0x59ce3f)[_0x78c8('0x25')](function(_0x4f1c98){_0x5c00a0[_0x78c8('0x1f')]=_0x4f1c98;if(_0x3eb765[_0x78c8('0x33')][_0x78c8('0x40')]){_0x3cbc01['include']=[{'all':!![]}];}return db[_0x78c8('0x2d')]['findAll'](_0x3cbc01);})[_0x78c8('0x25')](function(_0x55686c){_0x5c00a0['rows']=_0x55686c;return _0x5c00a0;})[_0x78c8('0x25')](respondWithFilteredResult(_0x35837f,_0x3cbc01))[_0x78c8('0x41')](handleError(_0x35837f,null));};exports[_0x78c8('0x42')]=function(_0x363b3a,_0x12a798){var _0x64e127={'raw':!![],'where':{'id':_0x363b3a[_0x78c8('0x43')]['id']}},_0x1c11f6={};_0x1c11f6[_0x78c8('0x31')]=_[_0x78c8('0x34')](db[_0x78c8('0x2d')][_0x78c8('0x2e')]);_0x1c11f6['query']=_['keys'](_0x363b3a[_0x78c8('0x33')]);_0x1c11f6[_0x78c8('0x3b')]=_[_0x78c8('0x35')](_0x1c11f6[_0x78c8('0x31')],_0x1c11f6[_0x78c8('0x33')]);_0x64e127[_0x78c8('0x36')]=_[_0x78c8('0x35')](_0x1c11f6['model'],qs[_0x78c8('0x37')](_0x363b3a[_0x78c8('0x33')][_0x78c8('0x37')]));_0x64e127['attributes']=_0x64e127[_0x78c8('0x36')]['length']?_0x64e127[_0x78c8('0x36')]:_0x1c11f6[_0x78c8('0x31')];if(_0x363b3a[_0x78c8('0x33')]['includeAll']){_0x64e127[_0x78c8('0x44')]=[{'all':!![]}];}_0x64e127=_['merge']({},_0x64e127,_0x363b3a[_0x78c8('0x3f')]);return db[_0x78c8('0x2d')][_0x78c8('0x45')](_0x64e127)[_0x78c8('0x25')](handleEntityNotFound(_0x12a798,null))[_0x78c8('0x25')](respondWithResult(_0x12a798,null))[_0x78c8('0x41')](handleError(_0x12a798,null));};exports[_0x78c8('0x46')]=function(_0x379b50,_0xa4824){return db[_0x78c8('0x2d')][_0x78c8('0x46')](_0x379b50['body'],{})['then'](respondWithResult(_0xa4824,0xc9))['catch'](handleError(_0xa4824,null));};exports[_0x78c8('0x24')]=function(_0x6ab06e,_0x453fa3){if(_0x6ab06e[_0x78c8('0x47')]['id']){delete _0x6ab06e[_0x78c8('0x47')]['id'];}return db[_0x78c8('0x2d')][_0x78c8('0x45')]({'where':{'id':_0x6ab06e[_0x78c8('0x43')]['id']}})['then'](handleEntityNotFound(_0x453fa3,null))[_0x78c8('0x25')](saveUpdates(_0x6ab06e[_0x78c8('0x47')],null))[_0x78c8('0x25')](respondWithResult(_0x453fa3,null))[_0x78c8('0x41')](handleError(_0x453fa3,null));};exports['destroy']=function(_0x5e6bc9,_0x111449){return db['SquareDetailsReport']['find']({'where':{'id':_0x5e6bc9[_0x78c8('0x43')]['id']}})[_0x78c8('0x25')](handleEntityNotFound(_0x111449,null))[_0x78c8('0x25')](removeEntity(_0x111449,null))['catch'](handleError(_0x111449,null));};exports[_0x78c8('0x48')]=function(_0xd802ee,_0x11decf){return db[_0x78c8('0x2d')][_0x78c8('0x48')]()['then'](respondWithResult(_0x11decf,null))[_0x78c8('0x41')](handleError(_0x11decf,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 3aed4e9..d1b44a3 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 _0x326f=['SquareDetailsReport','report_square_details','lodash','util','../../config/logger','api','moment','path','rimraf','exports','define'];(function(_0x55e659,_0x233aa4){var _0xca08c7=function(_0xe1c5b0){while(--_0xe1c5b0){_0x55e659['push'](_0x55e659['shift']());}};_0xca08c7(++_0x233aa4);}(_0x326f,0x141));var _0xf326=function(_0x473c02,_0x2349ba){_0x473c02=_0x473c02-0x0;var _0x176edc=_0x326f[_0x473c02];return _0x176edc;};'use strict';var _=require(_0xf326('0x0'));var util=require(_0xf326('0x1'));var logger=require(_0xf326('0x2'))(_0xf326('0x3'));var moment=require(_0xf326('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require('../../config/environment');var attributes=require('./squareReportDetail.attributes');module[_0xf326('0x7')]=function(_0x1c68cc,_0x160bea){return _0x1c68cc[_0xf326('0x8')](_0xf326('0x9'),attributes,{'tableName':_0xf326('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbc36=['moment','bluebird','request-promise','path','rimraf','../../config/environment','define','SquareDetailsReport','util','../../config/logger','api'];(function(_0x292086,_0x25f41c){var _0x37a6e8=function(_0x1f9d71){while(--_0x1f9d71){_0x292086['push'](_0x292086['shift']());}};_0x37a6e8(++_0x25f41c);}(_0xbc36,0x11b));var _0x6bc3=function(_0x4bab82,_0xf6ff48){_0x4bab82=_0x4bab82-0x0;var _0x140a53=_0xbc36[_0x4bab82];return _0x140a53;};'use strict';var _=require('lodash');var util=require(_0x6bc3('0x0'));var logger=require(_0x6bc3('0x1'))(_0x6bc3('0x2'));var moment=require(_0x6bc3('0x3'));var BPromise=require(_0x6bc3('0x4'));var rp=require(_0x6bc3('0x5'));var fs=require('fs');var path=require(_0x6bc3('0x6'));var rimraf=require(_0x6bc3('0x7'));var config=require(_0x6bc3('0x8'));var attributes=require('./squareReportDetail.attributes');module['exports']=function(_0x36ea69,_0x13a7d8){return _0x36ea69[_0x6bc3('0x9')](_0x6bc3('0xa'),attributes,{'tableName':'report_square_details','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 f08eb9f..88dd8cc 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 _0x7e27=['create','body','options','raw','debug','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','info','SquareDetailsReport,\x20%s,\x20%s','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0x7e27,0xdd));var _0x77e2=function(_0x2ceebb,_0x7d6fa2){_0x2ceebb=_0x2ceebb-0x0;var _0x395f4e=_0x7e27[_0x2ceebb];return _0x395f4e;};'use strict';var _=require(_0x77e2('0x0'));var util=require(_0x77e2('0x1'));var moment=require('moment');var BPromise=require(_0x77e2('0x2'));var rs=require(_0x77e2('0x3'));var fs=require('fs');var Redis=require(_0x77e2('0x4'));var db=require(_0x77e2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x77e2('0x6'))(_0x77e2('0x7'));var config=require(_0x77e2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x77e2('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x101e56,_0x137a61,_0x502153){return new BPromise(function(_0x3c2b3f,_0x2cdfa3){return client[_0x77e2('0xa')](_0x101e56,_0x502153)[_0x77e2('0xb')](function(_0x3802ce){logger[_0x77e2('0xc')](_0x77e2('0xd'),_0x137a61,'request\x20sent');logger['debug'](_0x77e2('0xe'),_0x137a61,'request\x20sent',JSON[_0x77e2('0xf')](_0x3802ce));if(_0x3802ce[_0x77e2('0x10')]){if(_0x3802ce['error']['code']===0x1f4){logger[_0x77e2('0x10')](_0x77e2('0xd'),_0x137a61,_0x3802ce['error'][_0x77e2('0x11')]);return _0x2cdfa3(_0x3802ce['error']['message']);}logger[_0x77e2('0x10')](_0x77e2('0xd'),_0x137a61,_0x3802ce[_0x77e2('0x10')][_0x77e2('0x11')]);return _0x3c2b3f(_0x3802ce[_0x77e2('0x10')]['message']);}else{logger[_0x77e2('0xc')](_0x77e2('0xd'),_0x137a61,'request\x20sent');_0x3c2b3f(_0x3802ce[_0x77e2('0x12')][_0x77e2('0x11')]);}})[_0x77e2('0x13')](function(_0x1352c1){logger[_0x77e2('0x10')](_0x77e2('0xd'),_0x137a61,_0x1352c1);_0x2cdfa3(_0x1352c1);});});}exports[_0x77e2('0x14')]=function(_0x36b995){var _0x42459a=this;return new Promise(function(_0x1bcf8d,_0x47ae9a){return db[_0x77e2('0x15')][_0x77e2('0x16')](_0x36b995[_0x77e2('0x17')],{'raw':_0x36b995[_0x77e2('0x18')]?_0x36b995[_0x77e2('0x18')][_0x77e2('0x19')]===undefined?!![]:![]:!![]})[_0x77e2('0xb')](function(_0x1e5273){logger[_0x77e2('0xc')](_0x77e2('0x14'),_0x36b995);logger[_0x77e2('0x1a')]('CreateSquareDetailsReport',_0x36b995,JSON[_0x77e2('0xf')](_0x1e5273));_0x1bcf8d(_0x1e5273);})[_0x77e2('0x13')](function(_0x4c0d0a){logger[_0x77e2('0x10')]('CreateSquareDetailsReport',_0x4c0d0a['message'],_0x36b995);_0x47ae9a(_0x42459a[_0x77e2('0x10')](0x1f4,_0x4c0d0a['message']));});});}; \ No newline at end of file +var _0x7462=['request\x20sent','debug','stringify','error','code','message','catch','CreateSquareDetailsReport','create','options','raw','info','lodash','util','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','SquareDetailsReport,\x20%s,\x20%s'];(function(_0x190dde,_0x5bb90f){var _0x2a3638=function(_0x242516){while(--_0x242516){_0x190dde['push'](_0x190dde['shift']());}};_0x2a3638(++_0x5bb90f);}(_0x7462,0x165));var _0x2746=function(_0x2feb53,_0x264ef7){_0x2feb53=_0x2feb53-0x0;var _0x5700ee=_0x7462[_0x2feb53];return _0x5700ee;};'use strict';var _=require(_0x2746('0x0'));var util=require(_0x2746('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2746('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2746('0x3'));var logger=require(_0x2746('0x4'))('rpc');var config=require(_0x2746('0x5'));var jayson=require(_0x2746('0x6'));var client=jayson[_0x2746('0x7')][_0x2746('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2a2f42,_0x2940d8,_0x1447bc){return new BPromise(function(_0x40ad2b,_0x283327){return client['request'](_0x2a2f42,_0x1447bc)[_0x2746('0x9')](function(_0x2e4713){logger['info'](_0x2746('0xa'),_0x2940d8,_0x2746('0xb'));logger[_0x2746('0xc')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x2940d8,_0x2746('0xb'),JSON[_0x2746('0xd')](_0x2e4713));if(_0x2e4713[_0x2746('0xe')]){if(_0x2e4713[_0x2746('0xe')][_0x2746('0xf')]===0x1f4){logger[_0x2746('0xe')](_0x2746('0xa'),_0x2940d8,_0x2e4713[_0x2746('0xe')][_0x2746('0x10')]);return _0x283327(_0x2e4713[_0x2746('0xe')][_0x2746('0x10')]);}logger['error']('SquareDetailsReport,\x20%s,\x20%s',_0x2940d8,_0x2e4713[_0x2746('0xe')][_0x2746('0x10')]);return _0x40ad2b(_0x2e4713[_0x2746('0xe')][_0x2746('0x10')]);}else{logger['info'](_0x2746('0xa'),_0x2940d8,_0x2746('0xb'));_0x40ad2b(_0x2e4713['result']['message']);}})[_0x2746('0x11')](function(_0x43f06c){logger[_0x2746('0xe')](_0x2746('0xa'),_0x2940d8,_0x43f06c);_0x283327(_0x43f06c);});});}exports[_0x2746('0x12')]=function(_0x232108){var _0x3556b5=this;return new Promise(function(_0x6102f3,_0x25c122){return db['SquareDetailsReport'][_0x2746('0x13')](_0x232108['body'],{'raw':_0x232108[_0x2746('0x14')]?_0x232108[_0x2746('0x14')][_0x2746('0x15')]===undefined?!![]:![]:!![]})[_0x2746('0x9')](function(_0xa64e76){logger[_0x2746('0x16')](_0x2746('0x12'),_0x232108);logger[_0x2746('0xc')](_0x2746('0x12'),_0x232108,JSON['stringify'](_0xa64e76));_0x6102f3(_0xa64e76);})['catch'](function(_0x7390b3){logger[_0x2746('0xe')](_0x2746('0x12'),_0x7390b3['message'],_0x232108);_0x25c122(_0x3556b5[_0x2746('0xe')](0x1f4,_0x7390b3[_0x2746('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index de50ab4..352ef0e 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 _0x1877=['exports','express','Router','./system.controller','get','index','/process/:pid/kill','isAuthenticated','killProcess'];(function(_0x41ed13,_0x1044be){var _0x1bb4d5=function(_0x15d224){while(--_0x15d224){_0x41ed13['push'](_0x41ed13['shift']());}};_0x1bb4d5(++_0x1044be);}(_0x1877,0x14e));var _0x7187=function(_0x42e887,_0xd64733){_0x42e887=_0x42e887-0x0;var _0x226761=_0x1877[_0x42e887];return _0x226761;};'use strict';var express=require(_0x7187('0x0'));var router=express[_0x7187('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x7187('0x2'));router[_0x7187('0x3')]('/',auth['isAuthenticated'](),controller[_0x7187('0x4')]);router[_0x7187('0x3')](_0x7187('0x5'),auth[_0x7187('0x6')](),controller[_0x7187('0x7')]);module[_0x7187('0x8')]=router; \ No newline at end of file +var _0x9cf3=['express','../../components/auth/service','./system.controller','get','index','/process/:pid/kill','killProcess','exports'];(function(_0x4dfb68,_0x4ccb8e){var _0x13fe59=function(_0x822119){while(--_0x822119){_0x4dfb68['push'](_0x4dfb68['shift']());}};_0x13fe59(++_0x4ccb8e);}(_0x9cf3,0xb8));var _0x39cf=function(_0x3bc3c3,_0x313208){_0x3bc3c3=_0x3bc3c3-0x0;var _0x45f716=_0x9cf3[_0x3bc3c3];return _0x45f716;};'use strict';var express=require(_0x39cf('0x0'));var router=express['Router']();var auth=require(_0x39cf('0x1'));var controller=require(_0x39cf('0x2'));router[_0x39cf('0x3')]('/',auth['isAuthenticated'](),controller[_0x39cf('0x4')]);router[_0x39cf('0x3')](_0x39cf('0x5'),auth['isAuthenticated'](),controller[_0x39cf('0x6')]);module[_0x39cf('0x7')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 394b6a9..d55bf4a 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 _0xa9db=['pid','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','params','Process\x20with\x20pid\x20%s\x20killed\x20correctly','killProcess','child_process','exec','../../config/logger','api','util','bluebird','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','then','status','json','catch','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args'];(function(_0x3334ca,_0x24d2bd){var _0x71944c=function(_0xdabaad){while(--_0xdabaad){_0x3334ca['push'](_0x3334ca['shift']());}};_0x71944c(++_0x24d2bd);}(_0xa9db,0x75));var _0xba9d=function(_0x715425,_0x14d5c3){_0x715425=_0x715425-0x0;var _0xbb9671=_0xa9db[_0x715425];return _0xbb9671;};'use strict';var info=require('systeminformation');var exec=require(_0xba9d('0x0'))[_0xba9d('0x1')];var logger=require(_0xba9d('0x2'))(_0xba9d('0x3'));var util=require(_0xba9d('0x4'));var BPromise=require(_0xba9d('0x5'));var _=require('lodash');function handleError(_0x5f3289,_0x5cfdcd,_0x19a7ee){_0x5cfdcd=_0x5cfdcd||0x1f4;return function(_0x416417){logger[_0xba9d('0x6')](_0xba9d('0x7'),_0x19a7ee,_0x5cfdcd,util[_0xba9d('0x8')](_0x416417,{'showHidden':![],'depth':null}));delete _0x416417['name'];_0x5f3289['status'](_0x5cfdcd)['send'](_0x416417);};}exports['index']=function(_0x1fe11b,_0x4ce71c){return info['getAllData']()[_0xba9d('0x9')](function(_0x3adc11){return _0x4ce71c[_0xba9d('0xa')](0xc8)[_0xba9d('0xb')](_0x3adc11);})[_0xba9d('0xc')](function(_0x5320c3){return _0x4ce71c[_0xba9d('0xa')](0x1f4)[_0xba9d('0xb')](_0x5320c3);});};exports['killProcess']=function(_0x24ff8d,_0x567c1e){var _0x2bbf95=['components/import/cm'];return new BPromise(function(_0x2f4224,_0x2d76a8){return exec(util[_0xba9d('0xd')](_0xba9d('0xe'),_0x24ff8d['params'][_0xba9d('0xf')]),function(_0x2f47ee,_0x4e317e,_0x23b883){if(_0x2f47ee){return _0x2d76a8(_0x2f47ee);}return _0x2f4224(_0x4e317e);});})[_0xba9d('0x9')](function(_0x529b97){var _0xbe04d5=![];var _0x4b4f8f=_0x529b97['split'](/\n/);for(var _0x5c8a7e=0x0,_0x45530b=_0x2bbf95[_0xba9d('0x10')];_0x5c8a7e<_0x45530b,_0xbe04d5===![];_0x5c8a7e+=0x1){if(_0x529b97[_0xba9d('0x11')](_0x2bbf95[_0x5c8a7e])>=0x0){_0xbe04d5=!![];}}if(!_0xbe04d5){throw new Error(util[_0xba9d('0xd')](_0xba9d('0x12'),_0x24ff8d[_0xba9d('0x13')][_0xba9d('0xf')]));}process['kill'](_0x24ff8d[_0xba9d('0x13')][_0xba9d('0xf')],'SIGINT');return _0x567c1e['status'](0xc8)[_0xba9d('0xb')]({'message':util[_0xba9d('0xd')](_0xba9d('0x14'),_0x24ff8d[_0xba9d('0x13')][_0xba9d('0xf')])});})[_0xba9d('0xc')](handleError(_0x567c1e,null,_0xba9d('0x15')));}; \ No newline at end of file +var _0x9bba=['name','status','send','then','json','catch','killProcess','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','SIGINT','systeminformation','child_process','exec','../../config/logger','api','util','lodash','inspect'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9bba,0xb0));var _0xa9bb=function(_0x31636e,_0x5e36c7){_0x31636e=_0x31636e-0x0;var _0x446485=_0x9bba[_0x31636e];return _0x446485;};'use strict';var info=require(_0xa9bb('0x0'));var exec=require(_0xa9bb('0x1'))[_0xa9bb('0x2')];var logger=require(_0xa9bb('0x3'))(_0xa9bb('0x4'));var util=require(_0xa9bb('0x5'));var BPromise=require('bluebird');var _=require(_0xa9bb('0x6'));function handleError(_0x2f70da,_0x9adf7b,_0x163dcf){_0x9adf7b=_0x9adf7b||0x1f4;return function(_0x2c3400){logger['error']('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x163dcf,_0x9adf7b,util[_0xa9bb('0x7')](_0x2c3400,{'showHidden':![],'depth':null}));delete _0x2c3400[_0xa9bb('0x8')];_0x2f70da[_0xa9bb('0x9')](_0x9adf7b)[_0xa9bb('0xa')](_0x2c3400);};}exports['index']=function(_0x3e74d3,_0x1678f8){return info['getAllData']()[_0xa9bb('0xb')](function(_0x4ad106){return _0x1678f8[_0xa9bb('0x9')](0xc8)[_0xa9bb('0xc')](_0x4ad106);})[_0xa9bb('0xd')](function(_0x5db820){return _0x1678f8[_0xa9bb('0x9')](0x1f4)[_0xa9bb('0xc')](_0x5db820);});};exports[_0xa9bb('0xe')]=function(_0x446ad7,_0x575971){var _0x5eb67d=['components/import/cm'];return new BPromise(function(_0x2978e7,_0x1640ae){return exec(util[_0xa9bb('0xf')](_0xa9bb('0x10'),_0x446ad7[_0xa9bb('0x11')][_0xa9bb('0x12')]),function(_0x247969,_0x28341e,_0x425732){if(_0x247969){return _0x1640ae(_0x247969);}return _0x2978e7(_0x28341e);});})['then'](function(_0x55c702){var _0x569ce1=![];var _0x14bc97=_0x55c702[_0xa9bb('0x13')](/\n/);for(var _0x4bdec4=0x0,_0x7a3b1a=_0x5eb67d['length'];_0x4bdec4<_0x7a3b1a,_0x569ce1===![];_0x4bdec4+=0x1){if(_0x55c702[_0xa9bb('0x14')](_0x5eb67d[_0x4bdec4])>=0x0){_0x569ce1=!![];}}if(!_0x569ce1){throw new Error(util[_0xa9bb('0xf')](_0xa9bb('0x15'),_0x446ad7['params'][_0xa9bb('0x12')]));}process['kill'](_0x446ad7['params']['pid'],_0xa9bb('0x16'));return _0x575971[_0xa9bb('0x9')](0xc8)[_0xa9bb('0xc')]({'message':util[_0xa9bb('0xf')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x446ad7['params']['pid'])});})[_0xa9bb('0xd')](handleError(_0x575971,null,'killProcess'));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 4d9b4cf..c1f5920 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 _0x3077=['put','update','destroy','exports','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','/:id','isAuthenticated','show','post','create'];(function(_0x5e9cec,_0x2ecb91){var _0xec3b45=function(_0x587df0){while(--_0x587df0){_0x5e9cec['push'](_0x5e9cec['shift']());}};_0xec3b45(++_0x2ecb91);}(_0x3077,0x144));var _0x7307=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0x3077[_0x21aec3];return _0x288bbc;};'use strict';var multer=require(_0x7307('0x0'));var util=require('util');var path=require(_0x7307('0x1'));var timeout=require('connect-timeout');var express=require(_0x7307('0x2'));var router=express['Router']();var fs_extra=require(_0x7307('0x3'));var auth=require(_0x7307('0x4'));var interaction=require(_0x7307('0x5'));var config=require('../../config/environment');var controller=require('./tag.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x7307('0x6')](_0x7307('0x7'),auth[_0x7307('0x8')](),controller[_0x7307('0x9')]);router[_0x7307('0xa')]('/',auth[_0x7307('0x8')](),controller[_0x7307('0xb')]);router[_0x7307('0xc')](_0x7307('0x7'),auth[_0x7307('0x8')](),controller[_0x7307('0xd')]);router['delete']('/:id',auth[_0x7307('0x8')](),controller[_0x7307('0xe')]);module[_0x7307('0xf')]=router; \ No newline at end of file +var _0xd914=['update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./tag.controller','isAuthenticated','index','get','/:id','show','post','put'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0xd914,0x17f));var _0x4d91=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xd914[_0x4c7fb5];return _0x2e10ac;};'use strict';var multer=require(_0x4d91('0x0'));var util=require(_0x4d91('0x1'));var path=require('path');var timeout=require(_0x4d91('0x2'));var express=require(_0x4d91('0x3'));var router=express[_0x4d91('0x4')]();var fs_extra=require(_0x4d91('0x5'));var auth=require(_0x4d91('0x6'));var interaction=require(_0x4d91('0x7'));var config=require('../../config/environment');var controller=require(_0x4d91('0x8'));router['get']('/',auth[_0x4d91('0x9')](),controller[_0x4d91('0xa')]);router[_0x4d91('0xb')](_0x4d91('0xc'),auth[_0x4d91('0x9')](),controller[_0x4d91('0xd')]);router[_0x4d91('0xe')]('/',auth[_0x4d91('0x9')](),controller['create']);router[_0x4d91('0xf')](_0x4d91('0xc'),auth[_0x4d91('0x9')](),controller[_0x4d91('0x10')]);router[_0x4d91('0x11')](_0x4d91('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x4d91('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 49775b9..6e941c0 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 _0xc4e6=['name','STRING','#0091EA','sequelize','exports'];(function(_0x12877b,_0x8650cf){var _0x3549ff=function(_0x4f96b7){while(--_0x4f96b7){_0x12877b['push'](_0x12877b['shift']());}};_0x3549ff(++_0x8650cf);}(_0xc4e6,0x1d9));var _0x6c4e=function(_0x16eb11,_0x1a2251){_0x16eb11=_0x16eb11-0x0;var _0x3ae7ef=_0xc4e6[_0x16eb11];return _0x3ae7ef;};'use strict';var Sequelize=require(_0x6c4e('0x0'));module[_0x6c4e('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x6c4e('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x6c4e('0x3')],'defaultValue':_0x6c4e('0x4')},'description':{'type':Sequelize[_0x6c4e('0x3')]}}; \ No newline at end of file +var _0x1678=['exports','STRING','name','sequelize'];(function(_0x44556f,_0x2d1fd8){var _0x4e96a5=function(_0x3f09b8){while(--_0x3f09b8){_0x44556f['push'](_0x44556f['shift']());}};_0x4e96a5(++_0x2d1fd8);}(_0x1678,0x17b));var _0x8167=function(_0x5e5b18,_0x30fdb5){_0x5e5b18=_0x5e5b18-0x0;var _0x46c823=_0x1678[_0x5e5b18];return _0x46c823;};'use strict';var Sequelize=require(_0x8167('0x0'));module[_0x8167('0x1')]={'name':{'type':Sequelize[_0x8167('0x2')],'unique':_0x8167('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x8167('0x2')],'defaultValue':'#0091EA'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 9805d7a..f3afb91 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 _0xfd28=['include','findAll','catch','show','rawAttributes','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','apply','save','then','destroy','get','Tags','UserProfileResource','error','stack','name','send','map','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','Tag','includeAll'];(function(_0x33d244,_0x46f998){var _0x5420ec=function(_0x1e9974){while(--_0x1e9974){_0x33d244['push'](_0x33d244['shift']());}};_0x5420ec(++_0x46f998);}(_0xfd28,0x148));var _0x8fd2=function(_0x3b7a0c,_0xf1a4c2){_0x3b7a0c=_0x3b7a0c-0x0;var _0x3bb70f=_0xfd28[_0x3b7a0c];return _0x3bb70f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8fd2('0x0'));var zipdir=require(_0x8fd2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8fd2('0x2'));var moment=require('moment');var BPromise=require(_0x8fd2('0x3'));var Mustache=require(_0x8fd2('0x4'));var util=require(_0x8fd2('0x5'));var path=require('path');var sox=require(_0x8fd2('0x6'));var csv=require(_0x8fd2('0x7'));var ejs=require(_0x8fd2('0x8'));var fs=require('fs');var fs_extra=require(_0x8fd2('0x9'));var _=require(_0x8fd2('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8fd2('0xb'));var deskjs=require(_0x8fd2('0xc'));var toCsv=require(_0x8fd2('0x7'));var querystring=require('querystring');var Papa=require(_0x8fd2('0xd'));var Redis=require('ioredis');var authService=require(_0x8fd2('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x8fd2('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8fd2('0x10'))('api');var utils=require(_0x8fd2('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x8fd2('0x12'));var db=require(_0x8fd2('0x13'))['db'];function respondWithStatusCode(_0xfd78d,_0xa6d7ca){_0xa6d7ca=_0xa6d7ca||0xcc;return function(_0x17ad4c){if(_0x17ad4c){return _0xfd78d[_0x8fd2('0x14')](_0xa6d7ca);}return _0xfd78d[_0x8fd2('0x15')](_0xa6d7ca)[_0x8fd2('0x16')]();};}function respondWithResult(_0x2b152c,_0x2b4611){_0x2b4611=_0x2b4611||0xc8;return function(_0x118329){if(_0x118329){return _0x2b152c[_0x8fd2('0x15')](_0x2b4611)[_0x8fd2('0x17')](_0x118329);}};}function respondWithFilteredResult(_0x40712c,_0xa65b4){return function(_0x596639){if(_0x596639){var _0x20daca=typeof _0xa65b4['offset']==='undefined'&&typeof _0xa65b4['limit']===_0x8fd2('0x18');var _0x530866=_0x596639[_0x8fd2('0x19')];var _0x12e8a3=_0x20daca?0x0:_0xa65b4['offset'];var _0xabbeb4=_0x20daca?_0x596639[_0x8fd2('0x19')]:_0xa65b4[_0x8fd2('0x1a')]+_0xa65b4[_0x8fd2('0x1b')];var _0x14641a;if(_0xabbeb4>=_0x530866){_0xabbeb4=_0x530866;_0x14641a=0xc8;}else{_0x14641a=0xce;}_0x40712c['status'](_0x14641a);return _0x40712c['set'](_0x8fd2('0x1c'),_0x12e8a3+'-'+_0xabbeb4+'/'+_0x530866)['json'](_0x596639);}return null;};}function patchUpdates(_0x3c03de){return function(_0x490b39){try{jsonpatch[_0x8fd2('0x1d')](_0x490b39,_0x3c03de,!![]);}catch(_0x50f410){return BPromise['reject'](_0x50f410);}return _0x490b39[_0x8fd2('0x1e')]();};}function saveUpdates(_0x4c2be8,_0xd3981f){return function(_0x44ee7a){if(_0x44ee7a){return _0x44ee7a['update'](_0x4c2be8)[_0x8fd2('0x1f')](function(_0x2a9c3c){return _0x2a9c3c;});}return null;};}function removeEntity(_0x120285,_0x490ea5){return function(_0x299c1c){if(_0x299c1c){return _0x299c1c[_0x8fd2('0x20')]()[_0x8fd2('0x1f')](function(){var _0x4742cf=_0x299c1c[_0x8fd2('0x21')]({'plain':!![]});var _0x25db4e=_0x8fd2('0x22');return db[_0x8fd2('0x23')][_0x8fd2('0x20')]({'where':{'type':_0x25db4e,'resourceId':_0x4742cf['id']}})[_0x8fd2('0x1f')](function(){return _0x299c1c;});})[_0x8fd2('0x1f')](function(){_0x120285[_0x8fd2('0x15')](0xcc)[_0x8fd2('0x16')]();});}};}function handleEntityNotFound(_0x512e5a,_0x4c6af7){return function(_0x345bc3){if(!_0x345bc3){_0x512e5a[_0x8fd2('0x14')](0x194);}return _0x345bc3;};}function handleError(_0x288bcd,_0x56f294){_0x56f294=_0x56f294||0x1f4;return function(_0x2f26ae){logger[_0x8fd2('0x24')](_0x2f26ae[_0x8fd2('0x25')]);if(_0x2f26ae[_0x8fd2('0x26')]){delete _0x2f26ae[_0x8fd2('0x26')];}_0x288bcd[_0x8fd2('0x15')](_0x56f294)[_0x8fd2('0x27')](_0x2f26ae);};}exports['index']=function(_0xe76676,_0x13c9b9){var _0x818f61={},_0x446c7a={},_0x313902={'count':0x0,'rows':[]};var _0x3ea575=_[_0x8fd2('0x28')](db['Tag']['rawAttributes'],function(_0x5144ba){return{'name':_0x5144ba[_0x8fd2('0x29')],'type':_0x5144ba[_0x8fd2('0x2a')][_0x8fd2('0x2b')]};});_0x446c7a[_0x8fd2('0x2c')]=_['map'](_0x3ea575,'name');_0x446c7a[_0x8fd2('0x2d')]=_[_0x8fd2('0x2e')](_0xe76676[_0x8fd2('0x2d')]);_0x446c7a[_0x8fd2('0x2f')]=_[_0x8fd2('0x30')](_0x446c7a['model'],_0x446c7a[_0x8fd2('0x2d')]);_0x818f61['attributes']=_[_0x8fd2('0x30')](_0x446c7a['model'],qs[_0x8fd2('0x31')](_0xe76676['query'][_0x8fd2('0x31')]));_0x818f61[_0x8fd2('0x32')]=_0x818f61[_0x8fd2('0x32')]['length']?_0x818f61[_0x8fd2('0x32')]:_0x446c7a['model'];if(!_0xe76676[_0x8fd2('0x2d')][_0x8fd2('0x33')](_0x8fd2('0x34'))){_0x818f61['limit']=qs[_0x8fd2('0x1b')](_0xe76676[_0x8fd2('0x2d')][_0x8fd2('0x1b')]);_0x818f61['offset']=qs[_0x8fd2('0x1a')](_0xe76676[_0x8fd2('0x2d')][_0x8fd2('0x1a')]);}_0x818f61['order']=qs[_0x8fd2('0x35')](_0xe76676[_0x8fd2('0x2d')]['sort']);_0x818f61[_0x8fd2('0x36')]=qs[_0x8fd2('0x2f')](_[_0x8fd2('0x37')](_0xe76676[_0x8fd2('0x2d')],_0x446c7a[_0x8fd2('0x2f')]),_0x3ea575);if(_0xe76676[_0x8fd2('0x2d')][_0x8fd2('0x38')]){_0x818f61['where']=_[_0x8fd2('0x39')](_0x818f61['where'],{'$or':_['map'](_0x3ea575,function(_0x38fff9){if(_0x38fff9[_0x8fd2('0x2a')]!==_0x8fd2('0x3a')){var _0x2edcfd={};_0x2edcfd[_0x38fff9[_0x8fd2('0x26')]]={'$like':'%'+_0xe76676[_0x8fd2('0x2d')]['filter']+'%'};return _0x2edcfd;}})});}_0x818f61=_['merge']({},_0x818f61,_0xe76676[_0x8fd2('0x3b')]);var _0x4aff57={'where':_0x818f61['where']};return db[_0x8fd2('0x3c')][_0x8fd2('0x19')](_0x4aff57)[_0x8fd2('0x1f')](function(_0x28f927){_0x313902['count']=_0x28f927;if(_0xe76676[_0x8fd2('0x2d')][_0x8fd2('0x3d')]){_0x818f61[_0x8fd2('0x3e')]=[{'all':!![]}];}return db[_0x8fd2('0x3c')][_0x8fd2('0x3f')](_0x818f61);})[_0x8fd2('0x1f')](function(_0xb1938a){_0x313902['rows']=_0xb1938a;return _0x313902;})[_0x8fd2('0x1f')](respondWithFilteredResult(_0x13c9b9,_0x818f61))[_0x8fd2('0x40')](handleError(_0x13c9b9,null));};exports[_0x8fd2('0x41')]=function(_0x70404e,_0xde7e1){var _0x12b014={'raw':!![],'where':{'id':_0x70404e['params']['id']}},_0x40a572={};_0x40a572[_0x8fd2('0x2c')]=_[_0x8fd2('0x2e')](db[_0x8fd2('0x3c')][_0x8fd2('0x42')]);_0x40a572[_0x8fd2('0x2d')]=_[_0x8fd2('0x2e')](_0x70404e[_0x8fd2('0x2d')]);_0x40a572['filters']=_[_0x8fd2('0x30')](_0x40a572['model'],_0x40a572[_0x8fd2('0x2d')]);_0x12b014['attributes']=_[_0x8fd2('0x30')](_0x40a572[_0x8fd2('0x2c')],qs[_0x8fd2('0x31')](_0x70404e['query'][_0x8fd2('0x31')]));_0x12b014[_0x8fd2('0x32')]=_0x12b014[_0x8fd2('0x32')]['length']?_0x12b014[_0x8fd2('0x32')]:_0x40a572['model'];if(_0x70404e[_0x8fd2('0x2d')][_0x8fd2('0x3d')]){_0x12b014[_0x8fd2('0x3e')]=[{'all':!![]}];}_0x12b014=_[_0x8fd2('0x39')]({},_0x12b014,_0x70404e[_0x8fd2('0x3b')]);return db[_0x8fd2('0x3c')][_0x8fd2('0x43')](_0x12b014)[_0x8fd2('0x1f')](handleEntityNotFound(_0xde7e1,null))[_0x8fd2('0x1f')](respondWithResult(_0xde7e1,null))[_0x8fd2('0x40')](handleError(_0xde7e1,null));};exports[_0x8fd2('0x44')]=function(_0x34f3a2,_0xd3d8cb){return db[_0x8fd2('0x3c')][_0x8fd2('0x44')](_0x34f3a2[_0x8fd2('0x45')],{})[_0x8fd2('0x1f')](function(_0x2a2c69){var _0x2fdbe5=_0x34f3a2['user']['get']({'plain':!![]});if(!_0x2fdbe5)throw new Error(_0x8fd2('0x46'));if(_0x2fdbe5[_0x8fd2('0x47')]===_0x8fd2('0x48')){var _0x5d79c3=_0x2a2c69['get']({'plain':!![]});var _0x177f04='Tags';return db[_0x8fd2('0x49')][_0x8fd2('0x43')]({'where':{'name':_0x177f04,'userProfileId':_0x2fdbe5[_0x8fd2('0x4a')]},'raw':!![]})['then'](function(_0x2251d9){if(_0x2251d9&&_0x2251d9[_0x8fd2('0x4b')]===0x0){return db['UserProfileResource'][_0x8fd2('0x44')]({'name':_0x5d79c3[_0x8fd2('0x26')],'resourceId':_0x5d79c3['id'],'type':_0x2251d9[_0x8fd2('0x26')],'sectionId':_0x2251d9['id']},{})['then'](function(){return _0x2a2c69;});}else{return _0x2a2c69;}})[_0x8fd2('0x40')](function(_0x14cdc2){logger[_0x8fd2('0x24')](_0x8fd2('0x4c'),_0x14cdc2);throw _0x14cdc2;});}return _0x2a2c69;})[_0x8fd2('0x1f')](respondWithResult(_0xd3d8cb,0xc9))[_0x8fd2('0x40')](handleError(_0xd3d8cb,null));};exports['update']=function(_0x4d5340,_0x46a1a1){if(_0x4d5340[_0x8fd2('0x45')]['id']){delete _0x4d5340['body']['id'];}return db[_0x8fd2('0x3c')]['find']({'where':{'id':_0x4d5340['params']['id']}})[_0x8fd2('0x1f')](handleEntityNotFound(_0x46a1a1,null))[_0x8fd2('0x1f')](saveUpdates(_0x4d5340[_0x8fd2('0x45')],null))[_0x8fd2('0x1f')](respondWithResult(_0x46a1a1,null))[_0x8fd2('0x40')](handleError(_0x46a1a1,null));};exports[_0x8fd2('0x20')]=function(_0x52c912,_0x2f4759){return db[_0x8fd2('0x3c')][_0x8fd2('0x43')]({'where':{'id':_0x52c912[_0x8fd2('0x4d')]['id']}})[_0x8fd2('0x1f')](handleEntityNotFound(_0x2f4759,null))['then'](removeEntity(_0x2f4759,null))['catch'](handleError(_0x2f4759,null));}; \ No newline at end of file +var _0x34e5=['offset','set','apply','reject','save','update','then','destroy','get','Tags','UserProfileResource','error','stack','name','map','Tag','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','nolimit','sort','where','pick','merge','VIRTUAL','include','findAll','catch','show','keys','length','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count'];(function(_0x17928f,_0x4ad33f){var _0x500b63=function(_0x127644){while(--_0x127644){_0x17928f['push'](_0x17928f['shift']());}};_0x500b63(++_0x4ad33f);}(_0x34e5,0x172));var _0x534e=function(_0x14182e,_0x41e5d9){_0x14182e=_0x14182e-0x0;var _0x4c8e7f=_0x34e5[_0x14182e];return _0x4c8e7f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x534e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x534e('0x1'));var rp=require(_0x534e('0x2'));var moment=require(_0x534e('0x3'));var BPromise=require(_0x534e('0x4'));var Mustache=require(_0x534e('0x5'));var util=require('util');var path=require(_0x534e('0x6'));var sox=require(_0x534e('0x7'));var csv=require(_0x534e('0x8'));var ejs=require(_0x534e('0x9'));var fs=require('fs');var fs_extra=require(_0x534e('0xa'));var _=require(_0x534e('0xb'));var squel=require(_0x534e('0xc'));var crypto=require('crypto');var jsforce=require(_0x534e('0xd'));var deskjs=require(_0x534e('0xe'));var toCsv=require(_0x534e('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x534e('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x534e('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x534e('0x11'));var logger=require(_0x534e('0x12'))(_0x534e('0x13'));var utils=require('../../config/utils');var config=require(_0x534e('0x14'));var licenseUtil=require(_0x534e('0x15'));var db=require(_0x534e('0x16'))['db'];function respondWithStatusCode(_0x28b8ff,_0x2c4539){_0x2c4539=_0x2c4539||0xcc;return function(_0x5ef1b1){if(_0x5ef1b1){return _0x28b8ff[_0x534e('0x17')](_0x2c4539);}return _0x28b8ff[_0x534e('0x18')](_0x2c4539)[_0x534e('0x19')]();};}function respondWithResult(_0x3ff42d,_0x359565){_0x359565=_0x359565||0xc8;return function(_0x478027){if(_0x478027){return _0x3ff42d[_0x534e('0x18')](_0x359565)[_0x534e('0x1a')](_0x478027);}};}function respondWithFilteredResult(_0x536c9e,_0x5282cb){return function(_0x4171d6){if(_0x4171d6){var _0x3940c3=typeof _0x5282cb['offset']==='undefined'&&typeof _0x5282cb[_0x534e('0x1b')]===_0x534e('0x1c');var _0x9297b6=_0x4171d6[_0x534e('0x1d')];var _0x22bc92=_0x3940c3?0x0:_0x5282cb[_0x534e('0x1e')];var _0x100751=_0x3940c3?_0x4171d6['count']:_0x5282cb[_0x534e('0x1e')]+_0x5282cb[_0x534e('0x1b')];var _0x466d74;if(_0x100751>=_0x9297b6){_0x100751=_0x9297b6;_0x466d74=0xc8;}else{_0x466d74=0xce;}_0x536c9e[_0x534e('0x18')](_0x466d74);return _0x536c9e[_0x534e('0x1f')]('Content-Range',_0x22bc92+'-'+_0x100751+'/'+_0x9297b6)[_0x534e('0x1a')](_0x4171d6);}return null;};}function patchUpdates(_0x1b87d1){return function(_0x5f9ae9){try{jsonpatch[_0x534e('0x20')](_0x5f9ae9,_0x1b87d1,!![]);}catch(_0x4724f9){return BPromise[_0x534e('0x21')](_0x4724f9);}return _0x5f9ae9[_0x534e('0x22')]();};}function saveUpdates(_0x85188b,_0x21f2e1){return function(_0x5e086a){if(_0x5e086a){return _0x5e086a[_0x534e('0x23')](_0x85188b)[_0x534e('0x24')](function(_0x39466c){return _0x39466c;});}return null;};}function removeEntity(_0x4a09ed,_0x324205){return function(_0x44bbc1){if(_0x44bbc1){return _0x44bbc1[_0x534e('0x25')]()[_0x534e('0x24')](function(){var _0x53a6ef=_0x44bbc1[_0x534e('0x26')]({'plain':!![]});var _0x588c08=_0x534e('0x27');return db[_0x534e('0x28')][_0x534e('0x25')]({'where':{'type':_0x588c08,'resourceId':_0x53a6ef['id']}})[_0x534e('0x24')](function(){return _0x44bbc1;});})[_0x534e('0x24')](function(){_0x4a09ed['status'](0xcc)[_0x534e('0x19')]();});}};}function handleEntityNotFound(_0x443f85,_0x4f3d30){return function(_0x4bd073){if(!_0x4bd073){_0x443f85[_0x534e('0x17')](0x194);}return _0x4bd073;};}function handleError(_0x534783,_0x42fe90){_0x42fe90=_0x42fe90||0x1f4;return function(_0x3c5c11){logger[_0x534e('0x29')](_0x3c5c11[_0x534e('0x2a')]);if(_0x3c5c11[_0x534e('0x2b')]){delete _0x3c5c11[_0x534e('0x2b')];}_0x534783[_0x534e('0x18')](_0x42fe90)['send'](_0x3c5c11);};}exports['index']=function(_0x32ae10,_0x15bdc1){var _0x466dfc={},_0x2f1c49={},_0x423502={'count':0x0,'rows':[]};var _0x1efb5b=_[_0x534e('0x2c')](db[_0x534e('0x2d')][_0x534e('0x2e')],function(_0x312744){return{'name':_0x312744[_0x534e('0x2f')],'type':_0x312744[_0x534e('0x30')]['key']};});_0x2f1c49[_0x534e('0x31')]=_[_0x534e('0x2c')](_0x1efb5b,'name');_0x2f1c49[_0x534e('0x32')]=_['keys'](_0x32ae10[_0x534e('0x32')]);_0x2f1c49[_0x534e('0x33')]=_[_0x534e('0x34')](_0x2f1c49[_0x534e('0x31')],_0x2f1c49['query']);_0x466dfc[_0x534e('0x35')]=_[_0x534e('0x34')](_0x2f1c49['model'],qs['fields'](_0x32ae10[_0x534e('0x32')][_0x534e('0x36')]));_0x466dfc[_0x534e('0x35')]=_0x466dfc[_0x534e('0x35')]['length']?_0x466dfc[_0x534e('0x35')]:_0x2f1c49['model'];if(!_0x32ae10[_0x534e('0x32')]['hasOwnProperty'](_0x534e('0x37'))){_0x466dfc[_0x534e('0x1b')]=qs['limit'](_0x32ae10[_0x534e('0x32')]['limit']);_0x466dfc['offset']=qs['offset'](_0x32ae10['query'][_0x534e('0x1e')]);}_0x466dfc['order']=qs['sort'](_0x32ae10[_0x534e('0x32')][_0x534e('0x38')]);_0x466dfc[_0x534e('0x39')]=qs['filters'](_[_0x534e('0x3a')](_0x32ae10[_0x534e('0x32')],_0x2f1c49['filters']),_0x1efb5b);if(_0x32ae10[_0x534e('0x32')]['filter']){_0x466dfc[_0x534e('0x39')]=_[_0x534e('0x3b')](_0x466dfc['where'],{'$or':_[_0x534e('0x2c')](_0x1efb5b,function(_0x5206c7){if(_0x5206c7[_0x534e('0x30')]!==_0x534e('0x3c')){var _0x1f483c={};_0x1f483c[_0x5206c7[_0x534e('0x2b')]]={'$like':'%'+_0x32ae10['query']['filter']+'%'};return _0x1f483c;}})});}_0x466dfc=_[_0x534e('0x3b')]({},_0x466dfc,_0x32ae10['options']);var _0x1670f8={'where':_0x466dfc[_0x534e('0x39')]};return db[_0x534e('0x2d')][_0x534e('0x1d')](_0x1670f8)['then'](function(_0x1dcfe5){_0x423502[_0x534e('0x1d')]=_0x1dcfe5;if(_0x32ae10[_0x534e('0x32')]['includeAll']){_0x466dfc[_0x534e('0x3d')]=[{'all':!![]}];}return db['Tag'][_0x534e('0x3e')](_0x466dfc);})[_0x534e('0x24')](function(_0x32f2aa){_0x423502['rows']=_0x32f2aa;return _0x423502;})[_0x534e('0x24')](respondWithFilteredResult(_0x15bdc1,_0x466dfc))[_0x534e('0x3f')](handleError(_0x15bdc1,null));};exports[_0x534e('0x40')]=function(_0x436b0f,_0x121752){var _0x383d9d={'raw':!![],'where':{'id':_0x436b0f['params']['id']}},_0x197ce2={};_0x197ce2[_0x534e('0x31')]=_['keys'](db['Tag'][_0x534e('0x2e')]);_0x197ce2[_0x534e('0x32')]=_[_0x534e('0x41')](_0x436b0f[_0x534e('0x32')]);_0x197ce2[_0x534e('0x33')]=_[_0x534e('0x34')](_0x197ce2['model'],_0x197ce2[_0x534e('0x32')]);_0x383d9d[_0x534e('0x35')]=_[_0x534e('0x34')](_0x197ce2['model'],qs[_0x534e('0x36')](_0x436b0f['query'][_0x534e('0x36')]));_0x383d9d[_0x534e('0x35')]=_0x383d9d[_0x534e('0x35')][_0x534e('0x42')]?_0x383d9d[_0x534e('0x35')]:_0x197ce2[_0x534e('0x31')];if(_0x436b0f['query'][_0x534e('0x43')]){_0x383d9d['include']=[{'all':!![]}];}_0x383d9d=_['merge']({},_0x383d9d,_0x436b0f[_0x534e('0x44')]);return db[_0x534e('0x2d')][_0x534e('0x45')](_0x383d9d)[_0x534e('0x24')](handleEntityNotFound(_0x121752,null))[_0x534e('0x24')](respondWithResult(_0x121752,null))[_0x534e('0x3f')](handleError(_0x121752,null));};exports[_0x534e('0x46')]=function(_0x376c83,_0x42c35d){return db['Tag'][_0x534e('0x46')](_0x376c83[_0x534e('0x47')],{})[_0x534e('0x24')](function(_0x317deb){var _0x49118f=_0x376c83[_0x534e('0x48')][_0x534e('0x26')]({'plain':!![]});if(!_0x49118f)throw new Error(_0x534e('0x49'));if(_0x49118f[_0x534e('0x4a')]===_0x534e('0x48')){var _0x176147=_0x317deb[_0x534e('0x26')]({'plain':!![]});var _0x3f5046=_0x534e('0x27');return db[_0x534e('0x4b')][_0x534e('0x45')]({'where':{'name':_0x3f5046,'userProfileId':_0x49118f[_0x534e('0x4c')]},'raw':!![]})['then'](function(_0x45f9e5){if(_0x45f9e5&&_0x45f9e5[_0x534e('0x4d')]===0x0){return db['UserProfileResource'][_0x534e('0x46')]({'name':_0x176147[_0x534e('0x2b')],'resourceId':_0x176147['id'],'type':_0x45f9e5[_0x534e('0x2b')],'sectionId':_0x45f9e5['id']},{})['then'](function(){return _0x317deb;});}else{return _0x317deb;}})['catch'](function(_0x2d66b6){logger[_0x534e('0x29')](_0x534e('0x4e'),_0x2d66b6);throw _0x2d66b6;});}return _0x317deb;})[_0x534e('0x24')](respondWithResult(_0x42c35d,0xc9))[_0x534e('0x3f')](handleError(_0x42c35d,null));};exports[_0x534e('0x23')]=function(_0x20bb8e,_0x45ad28){if(_0x20bb8e[_0x534e('0x47')]['id']){delete _0x20bb8e['body']['id'];}return db['Tag'][_0x534e('0x45')]({'where':{'id':_0x20bb8e['params']['id']}})[_0x534e('0x24')](handleEntityNotFound(_0x45ad28,null))[_0x534e('0x24')](saveUpdates(_0x20bb8e[_0x534e('0x47')],null))[_0x534e('0x24')](respondWithResult(_0x45ad28,null))[_0x534e('0x3f')](handleError(_0x45ad28,null));};exports['destroy']=function(_0x2c42f2,_0x2de255){return db['Tag']['find']({'where':{'id':_0x2c42f2[_0x534e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x2de255,null))['then'](removeEntity(_0x2de255,null))[_0x534e('0x3f')](handleError(_0x2de255,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 464c218..7e1f0c6 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 _0x22d5=['util','api','bluebird','request-promise','path','../../config/environment','exports','define','Tag','tools_tags','lodash'];(function(_0x4acdef,_0x3cc14f){var _0x3822f3=function(_0x107838){while(--_0x107838){_0x4acdef['push'](_0x4acdef['shift']());}};_0x3822f3(++_0x3cc14f);}(_0x22d5,0xc5));var _0x522d=function(_0x28ee9c,_0x1ae563){_0x28ee9c=_0x28ee9c-0x0;var _0x36f796=_0x22d5[_0x28ee9c];return _0x36f796;};'use strict';var _=require(_0x522d('0x0'));var util=require(_0x522d('0x1'));var logger=require('../../config/logger')(_0x522d('0x2'));var moment=require('moment');var BPromise=require(_0x522d('0x3'));var rp=require(_0x522d('0x4'));var fs=require('fs');var path=require(_0x522d('0x5'));var rimraf=require('rimraf');var config=require(_0x522d('0x6'));var attributes=require('./tag.attributes');module[_0x522d('0x7')]=function(_0x9cc76c,_0x427d43){return _0x9cc76c[_0x522d('0x8')](_0x522d('0x9'),attributes,{'tableName':_0x522d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4483=['./tag.attributes','exports','define','Tag','lodash','util','../../config/logger','api','path','../../config/environment'];(function(_0xec9c4e,_0x1f3b34){var _0x49cf7b=function(_0x34c86d){while(--_0x34c86d){_0xec9c4e['push'](_0xec9c4e['shift']());}};_0x49cf7b(++_0x1f3b34);}(_0x4483,0x16c));var _0x3448=function(_0x2f90e8,_0x43c166){_0x2f90e8=_0x2f90e8-0x0;var _0x5a4aa6=_0x4483[_0x2f90e8];return _0x5a4aa6;};'use strict';var _=require(_0x3448('0x0'));var util=require(_0x3448('0x1'));var logger=require(_0x3448('0x2'))(_0x3448('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3448('0x4'));var rimraf=require('rimraf');var config=require(_0x3448('0x5'));var attributes=require(_0x3448('0x6'));module[_0x3448('0x7')]=function(_0x565e36,_0x35fa07){return _0x565e36[_0x3448('0x8')](_0x3448('0x9'),attributes,{'tableName':'tools_tags','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 1fa0ddc..89d6d7e 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 _0x6334=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','stringify','error','Tag,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x17ea1a,_0x7a2599){var _0x571380=function(_0x315fe5){while(--_0x315fe5){_0x17ea1a['push'](_0x17ea1a['shift']());}};_0x571380(++_0x7a2599);}(_0x6334,0x119));var _0x4633=function(_0x1597e2,_0x388d3e){_0x1597e2=_0x1597e2-0x0;var _0x4c8c0a=_0x6334[_0x1597e2];return _0x4c8c0a;};'use strict';var _=require(_0x4633('0x0'));var util=require(_0x4633('0x1'));var moment=require(_0x4633('0x2'));var BPromise=require(_0x4633('0x3'));var rs=require(_0x4633('0x4'));var fs=require('fs');var Redis=require(_0x4633('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4633('0x6'));var logger=require(_0x4633('0x7'))(_0x4633('0x8'));var config=require(_0x4633('0x9'));var jayson=require(_0x4633('0xa'));var client=jayson[_0x4633('0xb')][_0x4633('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4a8997,_0x5647f1,_0x56891d){return new BPromise(function(_0x21af74,_0x148e72){return client['request'](_0x4a8997,_0x56891d)[_0x4633('0xd')](function(_0x31e794){logger[_0x4633('0xe')]('Tag,\x20%s,\x20%s',_0x5647f1,_0x4633('0xf'));logger[_0x4633('0x10')]('Tag,\x20%s,\x20%s,\x20%s',_0x5647f1,_0x4633('0xf'),JSON[_0x4633('0x11')](_0x31e794));if(_0x31e794[_0x4633('0x12')]){if(_0x31e794[_0x4633('0x12')]['code']===0x1f4){logger[_0x4633('0x12')](_0x4633('0x13'),_0x5647f1,_0x31e794[_0x4633('0x12')]['message']);return _0x148e72(_0x31e794['error']['message']);}logger[_0x4633('0x12')](_0x4633('0x13'),_0x5647f1,_0x31e794['error']['message']);return _0x21af74(_0x31e794[_0x4633('0x12')]['message']);}else{logger[_0x4633('0xe')](_0x4633('0x13'),_0x5647f1,_0x4633('0xf'));_0x21af74(_0x31e794[_0x4633('0x14')]['message']);}})[_0x4633('0x15')](function(_0x15bd98){logger[_0x4633('0x12')]('Tag,\x20%s,\x20%s',_0x5647f1,_0x15bd98);_0x148e72(_0x15bd98);});});} \ No newline at end of file +var _0x9f62=['util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Tag,\x20%s,\x20%s','Tag,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch'];(function(_0x2a4b34,_0x2ec5c4){var _0x40c480=function(_0x23fb0e){while(--_0x23fb0e){_0x2a4b34['push'](_0x2a4b34['shift']());}};_0x40c480(++_0x2ec5c4);}(_0x9f62,0x154));var _0x29f6=function(_0xdf8c66,_0x467cba){_0xdf8c66=_0xdf8c66-0x0;var _0x56a9c0=_0x9f62[_0xdf8c66];return _0x56a9c0;};'use strict';var _=require('lodash');var util=require(_0x29f6('0x0'));var moment=require('moment');var BPromise=require(_0x29f6('0x1'));var rs=require(_0x29f6('0x2'));var fs=require('fs');var Redis=require(_0x29f6('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x29f6('0x4'))(_0x29f6('0x5'));var config=require(_0x29f6('0x6'));var jayson=require(_0x29f6('0x7'));var client=jayson['client'][_0x29f6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x272876,_0x9a43fe,_0x2ba602){return new BPromise(function(_0x416c6c,_0x5e9945){return client['request'](_0x272876,_0x2ba602)['then'](function(_0x549f64){logger[_0x29f6('0x9')](_0x29f6('0xa'),_0x9a43fe,'request\x20sent');logger['debug'](_0x29f6('0xb'),_0x9a43fe,_0x29f6('0xc'),JSON['stringify'](_0x549f64));if(_0x549f64[_0x29f6('0xd')]){if(_0x549f64[_0x29f6('0xd')]['code']===0x1f4){logger['error']('Tag,\x20%s,\x20%s',_0x9a43fe,_0x549f64['error'][_0x29f6('0xe')]);return _0x5e9945(_0x549f64[_0x29f6('0xd')][_0x29f6('0xe')]);}logger[_0x29f6('0xd')](_0x29f6('0xa'),_0x9a43fe,_0x549f64[_0x29f6('0xd')][_0x29f6('0xe')]);return _0x416c6c(_0x549f64[_0x29f6('0xd')][_0x29f6('0xe')]);}else{logger[_0x29f6('0x9')](_0x29f6('0xa'),_0x9a43fe,_0x29f6('0xc'));_0x416c6c(_0x549f64[_0x29f6('0xf')][_0x29f6('0xe')]);}})[_0x29f6('0x10')](function(_0x14dd56){logger[_0x29f6('0xd')]('Tag,\x20%s,\x20%s',_0x9a43fe,_0x14dd56);_0x5e9945(_0x14dd56);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index f52d41d..bbd1ab0 100644 --- a/server/api/team/index.js +++ b/server/api/team/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/team/team.attributes.js b/server/api/team/team.attributes.js index c024f73..5d6c4e5 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 _0xbaf0=['name','exports','STRING'];(function(_0x5d30b4,_0x199248){var _0x1acfb8=function(_0x3544b2){while(--_0x3544b2){_0x5d30b4['push'](_0x5d30b4['shift']());}};_0x1acfb8(++_0x199248);}(_0xbaf0,0x12a));var _0x0baf=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xbaf0[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'unique':_0x0baf('0x2')},'description':{'type':Sequelize[_0x0baf('0x1')]}}; \ No newline at end of file +var _0xbaf0=['name','exports','STRING'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0xbaf0,0x12a));var _0x0baf=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xbaf0[_0x432682];return _0x463d05;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'unique':_0x0baf('0x2')},'description':{'type':Sequelize[_0x0baf('0x1')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index c4aecfe..32bb402 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 _0xeaaa=['order','sort','where','merge','type','options','include','findAll','catch','params','intersection','fields','includeAll','find','create','body','user','get','role','Teams','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','VoiceQueueId','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','FaxQueueId','UserFaxQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','UserProfileResource','getQueues','channel','isValidChannel','ValidationError','capitalize','toLowerCase','Queue','pick','Queues','addQueues','findOne','Unknown\x20channel','add','ids','removeQueues','remove','isArray','Voice','Mail','Fax','Openchannel','through','defaults','TeamVoiceQueue','penalty','findOrCreate','emit','Queue:save','User','online','voicePause','interface','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','all','addAgents','spread','removeAgents','Chat','Sms','Whatsapp','Queue:remove','getAgents','filter','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','redis','socket.io-emitter','./team.socket','register','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','reject','save','update','then','error','name','send','index','Team','rawAttributes','fieldName','key','model','map','query','keys','filters','attributes','length','hasOwnProperty','nolimit'];(function(_0x29c2bb,_0x1bde54){var _0x5446f1=function(_0x106117){while(--_0x106117){_0x29c2bb['push'](_0x29c2bb['shift']());}};_0x5446f1(++_0x1bde54);}(_0xeaaa,0xfc));var _0xaeaa=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xeaaa[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xaeaa('0x0'));var rimraf=require(_0xaeaa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaeaa('0x2'));var rp=require(_0xaeaa('0x3'));var moment=require(_0xaeaa('0x4'));var BPromise=require(_0xaeaa('0x5'));var Mustache=require(_0xaeaa('0x6'));var util=require('util');var path=require(_0xaeaa('0x7'));var sox=require(_0xaeaa('0x8'));var csv=require(_0xaeaa('0x9'));var ejs=require(_0xaeaa('0xa'));var fs=require('fs');var fs_extra=require(_0xaeaa('0xb'));var _=require(_0xaeaa('0xc'));var squel=require(_0xaeaa('0xd'));var crypto=require(_0xaeaa('0xe'));var jsforce=require(_0xaeaa('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xaeaa('0x9'));var querystring=require('querystring');var Papa=require(_0xaeaa('0x10'));var Redis=require(_0xaeaa('0x11'));var authService=require(_0xaeaa('0x12'));var qs=require(_0xaeaa('0x13'));var as=require(_0xaeaa('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xaeaa('0x15'))(_0xaeaa('0x16'));var utils=require(_0xaeaa('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xaeaa('0x18'))['db'];config[_0xaeaa('0x19')]=_['defaults'](config[_0xaeaa('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xaeaa('0x1a'))(new Redis(config[_0xaeaa('0x19')]));require(_0xaeaa('0x1b'))[_0xaeaa('0x1c')](socket);function respondWithStatusCode(_0x5d945f,_0x1edc1a){_0x1edc1a=_0x1edc1a||0xcc;return function(_0x92da74){if(_0x92da74){return _0x5d945f[_0xaeaa('0x1d')](_0x1edc1a);}return _0x5d945f[_0xaeaa('0x1e')](_0x1edc1a)[_0xaeaa('0x1f')]();};}function respondWithResult(_0x35c7b1,_0x1855e0){_0x1855e0=_0x1855e0||0xc8;return function(_0x403b1d){if(_0x403b1d){return _0x35c7b1[_0xaeaa('0x1e')](_0x1855e0)['json'](_0x403b1d);}};}function respondWithFilteredResult(_0x1d3822,_0x5c4fa6){return function(_0x194422){if(_0x194422){var _0x3cde49=typeof _0x5c4fa6['offset']===_0xaeaa('0x20')&&typeof _0x5c4fa6[_0xaeaa('0x21')]===_0xaeaa('0x20');var _0x54e5d4=_0x194422[_0xaeaa('0x22')];var _0x470456=_0x3cde49?0x0:_0x5c4fa6[_0xaeaa('0x23')];var _0x521231=_0x3cde49?_0x194422[_0xaeaa('0x22')]:_0x5c4fa6[_0xaeaa('0x23')]+_0x5c4fa6[_0xaeaa('0x21')];var _0x397b16;if(_0x521231>=_0x54e5d4){_0x521231=_0x54e5d4;_0x397b16=0xc8;}else{_0x397b16=0xce;}_0x1d3822[_0xaeaa('0x1e')](_0x397b16);return _0x1d3822[_0xaeaa('0x24')](_0xaeaa('0x25'),_0x470456+'-'+_0x521231+'/'+_0x54e5d4)[_0xaeaa('0x26')](_0x194422);}return null;};}function patchUpdates(_0x3486f1){return function(_0x21defb){try{jsonpatch['apply'](_0x21defb,_0x3486f1,!![]);}catch(_0xd3d3c3){return BPromise[_0xaeaa('0x27')](_0xd3d3c3);}return _0x21defb[_0xaeaa('0x28')]();};}function saveUpdates(_0x4452c9,_0x471ad3){return function(_0x3eeb9d){if(_0x3eeb9d){return _0x3eeb9d[_0xaeaa('0x29')](_0x4452c9)[_0xaeaa('0x2a')](function(_0x2d2091){return _0x2d2091;});}return null;};}function handleEntityNotFound(_0x357b45,_0x3fde27){return function(_0xf790fd){if(!_0xf790fd){_0x357b45[_0xaeaa('0x1d')](0x194);}return _0xf790fd;};}function handleError(_0x509540,_0x28d894){_0x28d894=_0x28d894||0x1f4;return function(_0x10f0af){logger[_0xaeaa('0x2b')](_0x10f0af['stack']);if(_0x10f0af[_0xaeaa('0x2c')]){delete _0x10f0af[_0xaeaa('0x2c')];}_0x509540[_0xaeaa('0x1e')](_0x28d894)[_0xaeaa('0x2d')](_0x10f0af);};}exports[_0xaeaa('0x2e')]=function(_0x1ebc8f,_0x4e6c75){var _0x1daa4d={},_0x2fda9d={},_0x15b8ed={'count':0x0,'rows':[]};var _0x5adb95=_['map'](db[_0xaeaa('0x2f')][_0xaeaa('0x30')],function(_0x173831){return{'name':_0x173831[_0xaeaa('0x31')],'type':_0x173831['type'][_0xaeaa('0x32')]};});_0x2fda9d[_0xaeaa('0x33')]=_[_0xaeaa('0x34')](_0x5adb95,_0xaeaa('0x2c'));_0x2fda9d[_0xaeaa('0x35')]=_[_0xaeaa('0x36')](_0x1ebc8f[_0xaeaa('0x35')]);_0x2fda9d[_0xaeaa('0x37')]=_['intersection'](_0x2fda9d['model'],_0x2fda9d[_0xaeaa('0x35')]);_0x1daa4d[_0xaeaa('0x38')]=_['intersection'](_0x2fda9d['model'],qs['fields'](_0x1ebc8f[_0xaeaa('0x35')]['fields']));_0x1daa4d[_0xaeaa('0x38')]=_0x1daa4d[_0xaeaa('0x38')][_0xaeaa('0x39')]?_0x1daa4d[_0xaeaa('0x38')]:_0x2fda9d[_0xaeaa('0x33')];if(!_0x1ebc8f['query'][_0xaeaa('0x3a')](_0xaeaa('0x3b'))){_0x1daa4d['limit']=qs['limit'](_0x1ebc8f['query'][_0xaeaa('0x21')]);_0x1daa4d[_0xaeaa('0x23')]=qs['offset'](_0x1ebc8f[_0xaeaa('0x35')][_0xaeaa('0x23')]);}_0x1daa4d[_0xaeaa('0x3c')]=qs[_0xaeaa('0x3d')](_0x1ebc8f['query'][_0xaeaa('0x3d')]);_0x1daa4d[_0xaeaa('0x3e')]=qs[_0xaeaa('0x37')](_['pick'](_0x1ebc8f[_0xaeaa('0x35')],_0x2fda9d[_0xaeaa('0x37')]),_0x5adb95);if(_0x1ebc8f[_0xaeaa('0x35')]['filter']){_0x1daa4d[_0xaeaa('0x3e')]=_[_0xaeaa('0x3f')](_0x1daa4d[_0xaeaa('0x3e')],{'$or':_['map'](_0x5adb95,function(_0x5c708a){if(_0x5c708a[_0xaeaa('0x40')]!=='VIRTUAL'){var _0x10339c={};_0x10339c[_0x5c708a['name']]={'$like':'%'+_0x1ebc8f[_0xaeaa('0x35')]['filter']+'%'};return _0x10339c;}})});}_0x1daa4d=_[_0xaeaa('0x3f')]({},_0x1daa4d,_0x1ebc8f[_0xaeaa('0x41')]);var _0x26bd0f={'where':_0x1daa4d[_0xaeaa('0x3e')]};return db[_0xaeaa('0x2f')]['count'](_0x26bd0f)[_0xaeaa('0x2a')](function(_0x42cfcc){_0x15b8ed[_0xaeaa('0x22')]=_0x42cfcc;if(_0x1ebc8f[_0xaeaa('0x35')]['includeAll']){_0x1daa4d[_0xaeaa('0x42')]=[{'all':!![]}];}return db['Team'][_0xaeaa('0x43')](_0x1daa4d);})[_0xaeaa('0x2a')](function(_0x2179e9){_0x15b8ed['rows']=_0x2179e9;return _0x15b8ed;})[_0xaeaa('0x2a')](respondWithFilteredResult(_0x4e6c75,_0x1daa4d))[_0xaeaa('0x44')](handleError(_0x4e6c75,null));};exports['show']=function(_0x4d29bd,_0x341916){var _0xbf12f8={'raw':![],'where':{'id':_0x4d29bd[_0xaeaa('0x45')]['id']}},_0x4c6b99={};_0x4c6b99['model']=_['keys'](db['Team'][_0xaeaa('0x30')]);_0x4c6b99[_0xaeaa('0x35')]=_[_0xaeaa('0x36')](_0x4d29bd[_0xaeaa('0x35')]);_0x4c6b99[_0xaeaa('0x37')]=_[_0xaeaa('0x46')](_0x4c6b99[_0xaeaa('0x33')],_0x4c6b99['query']);_0xbf12f8[_0xaeaa('0x38')]=_[_0xaeaa('0x46')](_0x4c6b99['model'],qs[_0xaeaa('0x47')](_0x4d29bd[_0xaeaa('0x35')][_0xaeaa('0x47')]));_0xbf12f8['attributes']=_0xbf12f8['attributes'][_0xaeaa('0x39')]?_0xbf12f8[_0xaeaa('0x38')]:_0x4c6b99[_0xaeaa('0x33')];if(_0x4d29bd[_0xaeaa('0x35')][_0xaeaa('0x48')]){_0xbf12f8['include']=[{'all':!![]}];}_0xbf12f8=_[_0xaeaa('0x3f')]({},_0xbf12f8,_0x4d29bd[_0xaeaa('0x41')]);return db['Team'][_0xaeaa('0x49')](_0xbf12f8)[_0xaeaa('0x2a')](handleEntityNotFound(_0x341916,null))['then'](respondWithResult(_0x341916,null))[_0xaeaa('0x44')](handleError(_0x341916,null));};exports['create']=function(_0xb92327,_0xb648f2){return db['Team'][_0xaeaa('0x4a')](_0xb92327[_0xaeaa('0x4b')],{})['then'](function(_0x5a63e3){var _0x3dccde=_0xb92327[_0xaeaa('0x4c')][_0xaeaa('0x4d')]({'plain':!![]});if(!_0x3dccde)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3dccde[_0xaeaa('0x4e')]===_0xaeaa('0x4c')){var _0x5515cd=_0x5a63e3[_0xaeaa('0x4d')]({'plain':!![]});var _0xaf3701=_0xaeaa('0x4f');return db[_0xaeaa('0x50')]['find']({'where':{'name':_0xaf3701,'userProfileId':_0x3dccde['userProfileId']},'raw':!![]})[_0xaeaa('0x2a')](function(_0x4c0ff1){if(_0x4c0ff1&&_0x4c0ff1[_0xaeaa('0x51')]===0x0){return db['UserProfileResource'][_0xaeaa('0x4a')]({'name':_0x5515cd[_0xaeaa('0x2c')],'resourceId':_0x5515cd['id'],'type':_0x4c0ff1[_0xaeaa('0x2c')],'sectionId':_0x4c0ff1['id']},{})['then'](function(){return _0x5a63e3;});}else{return _0x5a63e3;}})['catch'](function(_0x2af39e){logger[_0xaeaa('0x2b')](_0xaeaa('0x52'),_0x2af39e);throw _0x2af39e;});}return _0x5a63e3;})[_0xaeaa('0x2a')](respondWithResult(_0xb648f2,0xc9))[_0xaeaa('0x44')](handleError(_0xb648f2,null));};exports[_0xaeaa('0x29')]=function(_0x404f71,_0x410309){if(_0x404f71[_0xaeaa('0x4b')]['id']){delete _0x404f71[_0xaeaa('0x4b')]['id'];}return db['Team'][_0xaeaa('0x49')]({'where':{'id':_0x404f71[_0xaeaa('0x45')]['id']}})[_0xaeaa('0x2a')](handleEntityNotFound(_0x410309,null))['then'](saveUpdates(_0x404f71[_0xaeaa('0x4b')],null))[_0xaeaa('0x2a')](respondWithResult(_0x410309,null))[_0xaeaa('0x44')](handleError(_0x410309,null));};exports[_0xaeaa('0x53')]=function(_0x1bc464,_0x2e7936){var _0x3c8d86=_0x1bc464[_0xaeaa('0x45')]['id'];var _0x467b96=[];return db[_0xaeaa('0x54')][_0xaeaa('0x55')](function(_0x41c93a){var _0x28afe1=_0xaeaa('0x56')+_0x3c8d86;return db[_0xaeaa('0x54')][_0xaeaa('0x35')](_0x28afe1,{'type':db[_0xaeaa('0x57')][_0xaeaa('0x58')][_0xaeaa('0x59')],'raw':!![],'transaction':_0x41c93a})[_0xaeaa('0x2a')](function(_0xb891ca){_0x467b96=_[_0xaeaa('0x34')](_0xb891ca,function(_0x1fb9aa){return Number(_0x1fb9aa[_0xaeaa('0x5a')]);});})['then'](function(){var _0x4bfd92=_0xaeaa('0x5b')+_0x3c8d86;return db[_0xaeaa('0x54')]['query'](_0x4bfd92,{'type':db[_0xaeaa('0x57')][_0xaeaa('0x58')][_0xaeaa('0x59')],'raw':!![],'transaction':_0x41c93a});})[_0xaeaa('0x2a')](function(_0x599263){var _0x299243=_[_0xaeaa('0x34')](_0x599263,function(_0x27a341){return Number(_0x27a341[_0xaeaa('0x5c')]);});return db[_0xaeaa('0x5d')][_0xaeaa('0x53')]({'where':{'UserId':{'$in':_0x467b96},'VoiceQueueId':{'$in':_0x299243}},'transaction':_0x41c93a});})[_0xaeaa('0x2a')](function(){var _0x405bd6=_0xaeaa('0x5e')+_0x3c8d86;return db[_0xaeaa('0x54')][_0xaeaa('0x35')](_0x405bd6,{'type':db['Sequelize'][_0xaeaa('0x58')][_0xaeaa('0x59')],'raw':!![],'transaction':_0x41c93a});})[_0xaeaa('0x2a')](function(_0x507978){var _0x63b94e=_[_0xaeaa('0x34')](_0x507978,function(_0x3c79d4){return Number(_0x3c79d4[_0xaeaa('0x5f')]);});return db[_0xaeaa('0x60')][_0xaeaa('0x53')]({'where':{'UserId':{'$in':_0x467b96},'MailQueueId':{'$in':_0x63b94e}},'transaction':_0x41c93a});})[_0xaeaa('0x2a')](function(){var _0x574b97=_0xaeaa('0x61')+_0x3c8d86;return db[_0xaeaa('0x54')]['query'](_0x574b97,{'type':db['Sequelize'][_0xaeaa('0x58')][_0xaeaa('0x59')],'raw':!![],'transaction':_0x41c93a});})[_0xaeaa('0x2a')](function(_0x1bd526){var _0x2217fe=_[_0xaeaa('0x34')](_0x1bd526,function(_0x4b7fa6){return Number(_0x4b7fa6[_0xaeaa('0x62')]);});return db['UserSmsQueue'][_0xaeaa('0x53')]({'where':{'UserId':{'$in':_0x467b96},'SmsQueueId':{'$in':_0x2217fe}},'transaction':_0x41c93a});})[_0xaeaa('0x2a')](function(){var _0x14b3eb=_0xaeaa('0x63')+_0x3c8d86;return db[_0xaeaa('0x54')]['query'](_0x14b3eb,{'type':db['Sequelize']['QueryTypes'][_0xaeaa('0x59')],'raw':!![],'transaction':_0x41c93a});})[_0xaeaa('0x2a')](function(_0x5a0ef6){var _0x23886b=_[_0xaeaa('0x34')](_0x5a0ef6,function(_0x11f924){return Number(_0x11f924[_0xaeaa('0x64')]);});return db['UserChatQueue']['destroy']({'where':{'UserId':{'$in':_0x467b96},'ChatQueueId':{'$in':_0x23886b}},'transaction':_0x41c93a});})[_0xaeaa('0x2a')](function(){var _0x21b6dd='SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20'+_0x3c8d86;return db[_0xaeaa('0x54')]['query'](_0x21b6dd,{'type':db[_0xaeaa('0x57')][_0xaeaa('0x58')][_0xaeaa('0x59')],'raw':!![],'transaction':_0x41c93a});})['then'](function(_0x452f16){var _0x3d0af0=_['map'](_0x452f16,function(_0x459275){return Number(_0x459275[_0xaeaa('0x65')]);});return db[_0xaeaa('0x66')]['destroy']({'where':{'UserId':{'$in':_0x467b96},'FaxQueueId':{'$in':_0x3d0af0}},'transaction':_0x41c93a});})['then'](function(){var _0x168908='SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20'+_0x3c8d86;return db['sequelize'][_0xaeaa('0x35')](_0x168908,{'type':db[_0xaeaa('0x57')]['QueryTypes'][_0xaeaa('0x59')],'raw':!![],'transaction':_0x41c93a});})[_0xaeaa('0x2a')](function(_0xd2c135){var _0x49af16=_[_0xaeaa('0x34')](_0xd2c135,function(_0x1cff6a){return Number(_0x1cff6a['OpenchannelQueueId']);});return db['UserOpenchannelQueue'][_0xaeaa('0x53')]({'where':{'UserId':{'$in':_0x467b96},'OpenchannelQueueId':{'$in':_0x49af16}},'transaction':_0x41c93a});})[_0xaeaa('0x2a')](function(){var _0x1cb1b3=_0xaeaa('0x67')+_0x3c8d86;return db['sequelize'][_0xaeaa('0x35')](_0x1cb1b3,{'type':db['Sequelize'][_0xaeaa('0x58')][_0xaeaa('0x59')],'raw':!![],'transaction':_0x41c93a});})['then'](function(_0x55a16f){var _0xcec61c=_[_0xaeaa('0x34')](_0x55a16f,function(_0x16a51d){return Number(_0x16a51d[_0xaeaa('0x68')]);});return db['UserWhatsappQueue']['destroy']({'where':{'UserId':{'$in':_0x467b96},'WhatsappQueueId':{'$in':_0xcec61c}},'transaction':_0x41c93a});})['then'](function(){return db[_0xaeaa('0x69')][_0xaeaa('0x49')]({'where':{'TeamId':_0x3c8d86}});})[_0xaeaa('0x2a')](function(_0x403435){if(_0x403435===null){return;}return db[_0xaeaa('0x6a')][_0xaeaa('0x53')]({'where':{'UserId':{'$in':_0x467b96},'VoicePrefixId':_0x403435[_0xaeaa('0x6b')]},'transaction':_0x41c93a});})[_0xaeaa('0x2a')](function(){return db[_0xaeaa('0x2f')][_0xaeaa('0x53')]({'where':{'id':_0x3c8d86},'cascade':!![],'transaction':_0x41c93a});})[_0xaeaa('0x2a')](function(_0x4714ec){if(_0x4714ec===0x0){_0x2e7936[_0xaeaa('0x1d')](0x194);}else{return db[_0xaeaa('0x6c')][_0xaeaa('0x53')]({'where':{'type':_0xaeaa('0x4f'),'resourceId':_0x3c8d86},'cascade':!![],'transaction':_0x41c93a})[_0xaeaa('0x2a')](function(){_0x2e7936['status'](0xcc)['end']();});}})[_0xaeaa('0x44')](function(_0x271225){_0x2e7936[_0xaeaa('0x1e')](0x1f4)[_0xaeaa('0x2d')](_0x271225);});});};exports[_0xaeaa('0x6d')]=function(_0x25d4b1,_0x848f3e,_0x277a9c){return db['Team']['findOne']({'where':{'id':_0x25d4b1[_0xaeaa('0x45')]['id']}})[_0xaeaa('0x2a')](handleEntityNotFound(_0x848f3e,null))[_0xaeaa('0x2a')](function(_0x28715e){if(!_0x25d4b1[_0xaeaa('0x35')][_0xaeaa('0x6e')]||!utils[_0xaeaa('0x6f')](_0x25d4b1[_0xaeaa('0x35')]['channel'])){throw new db['Sequelize'][(_0xaeaa('0x70'))]('Unknown\x20channel');}var _0x16f1a6={};var _0x5eff20={};_0x5eff20[_0xaeaa('0x33')]=_[_0xaeaa('0x36')](db[_[_0xaeaa('0x71')](_0x25d4b1[_0xaeaa('0x35')][_0xaeaa('0x6e')][_0xaeaa('0x72')]())+_0xaeaa('0x73')]['rawAttributes']);_0x5eff20[_0xaeaa('0x35')]=_[_0xaeaa('0x36')](_0x25d4b1[_0xaeaa('0x35')]);_0x5eff20[_0xaeaa('0x37')]=_[_0xaeaa('0x46')](_0x5eff20[_0xaeaa('0x33')],_0x5eff20[_0xaeaa('0x35')]);_0x16f1a6[_0xaeaa('0x38')]=_['intersection'](_0x5eff20['model'],qs['fields'](_0x25d4b1['query'][_0xaeaa('0x47')]));_0x16f1a6[_0xaeaa('0x38')]=_0x16f1a6[_0xaeaa('0x38')]['length']?_0x16f1a6['attributes']:_0x5eff20[_0xaeaa('0x33')];_0x16f1a6[_0xaeaa('0x21')]=qs['limit'](_0x25d4b1['query']['limit']);_0x16f1a6[_0xaeaa('0x23')]=qs['offset'](_0x25d4b1[_0xaeaa('0x35')][_0xaeaa('0x23')]);_0x16f1a6['order']=qs[_0xaeaa('0x3d')](_0x25d4b1['query']['sort']);_0x16f1a6[_0xaeaa('0x3e')]=qs['filters'](_[_0xaeaa('0x74')](_0x25d4b1[_0xaeaa('0x35')],_0x5eff20[_0xaeaa('0x37')]));_0x16f1a6=_[_0xaeaa('0x3f')]({},_0x16f1a6,_0x25d4b1[_0xaeaa('0x41')]);return _0x28715e[_0xaeaa('0x4d')+_[_0xaeaa('0x71')](_0x25d4b1[_0xaeaa('0x35')][_0xaeaa('0x6e')][_0xaeaa('0x72')]())+_0xaeaa('0x75')](_0x16f1a6);})[_0xaeaa('0x2a')](respondWithResult(_0x848f3e,null))[_0xaeaa('0x44')](handleError(_0x848f3e,null));};exports[_0xaeaa('0x76')]=function(_0x534c4e,_0x26a1c0,_0x3905d3){return db[_0xaeaa('0x2f')][_0xaeaa('0x77')]({'where':{'id':_0x534c4e[_0xaeaa('0x45')]['id']}})[_0xaeaa('0x2a')](function(_0x2e7432){if(_0x2e7432){if(!_0x534c4e[_0xaeaa('0x4b')]['channel']||!utils[_0xaeaa('0x6f')](_0x534c4e[_0xaeaa('0x4b')]['channel'])){throw new db['Sequelize']['ValidationError'](_0xaeaa('0x78'));}return _0x2e7432[_0xaeaa('0x79')+_['capitalize'](_0x534c4e[_0xaeaa('0x4b')][_0xaeaa('0x6e')]['toLowerCase']())+_0xaeaa('0x75')](_0x534c4e[_0xaeaa('0x4b')][_0xaeaa('0x7a')]);}return null;})['then'](handleEntityNotFound(_0x26a1c0,null))['then'](respondWithStatusCode(_0x26a1c0,null))[_0xaeaa('0x44')](handleError(_0x26a1c0,null));};exports[_0xaeaa('0x7b')]=function(_0xcf2b4b,_0x1b4add,_0x5ccf83){return db[_0xaeaa('0x2f')][_0xaeaa('0x77')]({'where':{'id':_0xcf2b4b['params']['id']}})[_0xaeaa('0x2a')](function(_0x567016){if(_0x567016){if(!_0xcf2b4b[_0xaeaa('0x35')][_0xaeaa('0x6e')]||!utils[_0xaeaa('0x6f')](_0xcf2b4b[_0xaeaa('0x35')][_0xaeaa('0x6e')])){throw new db[(_0xaeaa('0x57'))][(_0xaeaa('0x70'))](_0xaeaa('0x78'));}return _0x567016[_0xaeaa('0x7c')+_[_0xaeaa('0x71')](_0xcf2b4b[_0xaeaa('0x35')][_0xaeaa('0x6e')][_0xaeaa('0x72')]())+'Queues'](_0xcf2b4b[_0xaeaa('0x35')][_0xaeaa('0x7a')]);}return null;})['then'](handleEntityNotFound(_0x1b4add,null))['then'](respondWithStatusCode(_0x1b4add,null))[_0xaeaa('0x44')](handleError(_0x1b4add,null));};exports['addAgents']=function(_0x362017,_0x372857){var _0x5610aa=_[_0xaeaa('0x7d')](_0x362017[_0xaeaa('0x4b')][_0xaeaa('0x7a')])?_0x362017['body'][_0xaeaa('0x7a')]:[_0x362017[_0xaeaa('0x4b')][_0xaeaa('0x7a')]];var _0x115d21=_0x362017['params']['id'];return db[_0xaeaa('0x2f')][_0xaeaa('0x49')]({'where':{'id':_0x115d21}})[_0xaeaa('0x2a')](handleEntityNotFound(_0x372857,null))[_0xaeaa('0x2a')](function(_0x3fbce2){if(_0x3fbce2){var _0x54a049=[_0xaeaa('0x7e'),'Chat',_0xaeaa('0x7f'),'Sms',_0xaeaa('0x80'),_0xaeaa('0x81'),'Whatsapp'];return db['sequelize']['transaction'](function(_0x390023){var _0x5562e4=_[_0xaeaa('0x34')](_0x54a049,function(_0xe61be9){var _0x94f472={'attributes':['id',_0xaeaa('0x2c')]};if(_0xe61be9===_0xaeaa('0x7e')){_0x94f472[_0xaeaa('0x82')]={'attributes':['penalty']};}return _0x3fbce2[_0xaeaa('0x4d')+_0xe61be9+_0xaeaa('0x75')](_0x94f472)[_0xaeaa('0x2a')](function(_0x5bae45){var _0xe15c9d=_[_0xaeaa('0x34')](_0x5bae45,function(_0x8f636f){var _0xb1c19e=_[_0xaeaa('0x34')](_0x5610aa,function(_0x45fbd2){var _0x289cd8={'where':{'UserId':_0x45fbd2,[_0xe61be9+'QueueId']:_0x8f636f['id']},'transaction':_0x390023};if(_0xe61be9===_0xaeaa('0x7e')){_0x289cd8[_0xaeaa('0x83')]={'penalty':_0x8f636f[_0xaeaa('0x84')][_0xaeaa('0x85')]};}return db['User'+_0xe61be9+_0xaeaa('0x73')][_0xaeaa('0x86')](_0x289cd8)['then'](function(){socket[_0xaeaa('0x87')]('user'+_0xe61be9+_0xaeaa('0x88'),{'UserId':_0x45fbd2,[_0xe61be9+'QueueId']:_0x8f636f['id']});if(_0xe61be9!=='Voice'){return;}return db[_0xaeaa('0x89')]['findAll']({'where':{'id':_0x5610aa,'online':0x1},'attributes':['id',_0xaeaa('0x2c'),_0xaeaa('0x8a'),_0xaeaa('0x8b'),_0xaeaa('0x8c')],'raw':!![]})[_0xaeaa('0x2a')](function(_0x42fe0f){var _0x5d8279=_[_0xaeaa('0x34')](_0x42fe0f,function(_0x5b1bcb){return db[_0xaeaa('0x8d')][_0xaeaa('0x8e')]({'membername':_0x5b1bcb[_0xaeaa('0x2c')],'UserId':_0x5b1bcb['id'],'queue_name':_0x8f636f[_0xaeaa('0x2c')],'VoiceQueueId':_0x8f636f['id'],'interface':_[_0xaeaa('0x8f')](_0x5b1bcb[_0xaeaa('0x8c')])?util[_0xaeaa('0x90')](_0xaeaa('0x91'),_0x5b1bcb[_0xaeaa('0x2c')]):_0x5b1bcb['interface'],'paused':_0x5b1bcb[_0xaeaa('0x8b')]||![],'penalty':_0x8f636f[_0xaeaa('0x84')][_0xaeaa('0x85')]},{'transaction':_0x390023});});return Promise[_0xaeaa('0x92')](_0x5d8279);});});});return Promise[_0xaeaa('0x92')](_0xb1c19e);});return Promise[_0xaeaa('0x92')](_0xe15c9d);})[_0xaeaa('0x2a')](function(){return db[_0xaeaa('0x69')][_0xaeaa('0x77')]({'where':{'teamId':_0x115d21}})[_0xaeaa('0x2a')](function(_0xe0713c){if(_0xe0713c){var _0x4d4748=_[_0xaeaa('0x34')](_0x5610aa,function(_0x12dd86){db[_0xaeaa('0x6a')][_0xaeaa('0x8e')]({'UserId':_0x12dd86,'VoicePrefixId':_0xe0713c['VoicePrefixId']});});return Promise[_0xaeaa('0x92')](_0x4d4748);}});});});return Promise[_0xaeaa('0x92')](_0x5562e4)[_0xaeaa('0x2a')](function(){return _0x3fbce2[_0xaeaa('0x93')](_0x5610aa,{'transaction':_0x390023})[_0xaeaa('0x94')](function(_0x1922de){return _0x1922de;});});});}})[_0xaeaa('0x2a')](respondWithResult(_0x372857,null))[_0xaeaa('0x44')](handleError(_0x372857,null));};exports[_0xaeaa('0x95')]=function(_0x3ba3af,_0x2b9259){var _0x399d0c=_[_0xaeaa('0x7d')](_0x3ba3af[_0xaeaa('0x35')]['ids'])?_0x3ba3af['query'][_0xaeaa('0x7a')]:[_0x3ba3af[_0xaeaa('0x35')]['ids']];var _0x2b1db0=_0x3ba3af[_0xaeaa('0x45')]['id'];return db['Team'][_0xaeaa('0x49')]({'where':{'id':_0x2b1db0}})[_0xaeaa('0x2a')](handleEntityNotFound(_0x2b9259,null))['then'](function(_0x57d994){if(_0x57d994){var _0x27bc9f=[_0xaeaa('0x7e'),_0xaeaa('0x96'),'Mail',_0xaeaa('0x97'),'Fax',_0xaeaa('0x81'),_0xaeaa('0x98')];return db['sequelize']['transaction'](function(_0x40c684){var _0x2fb9a4=_[_0xaeaa('0x34')](_0x27bc9f,function(_0x127f89){var _0x5f0f3c={'attributes':['id',_0xaeaa('0x2c')]};return _0x57d994['get'+_0x127f89+_0xaeaa('0x75')](_0x5f0f3c)[_0xaeaa('0x2a')](function(_0x4d40b8){var _0x2b6c20=_[_0xaeaa('0x34')](_0x4d40b8,function(_0x247cac){return _0x247cac[_0xaeaa('0x95')](_0x399d0c,{'transaction':_0x40c684})['then'](function(){var _0x54a33f=_[_0xaeaa('0x34')](_0x399d0c,function(_0x58cdeb){socket[_0xaeaa('0x87')](_0xaeaa('0x4c')+_0x127f89+_0xaeaa('0x99'),{'UserId':Number(_0x58cdeb),[_0x127f89+'QueueId']:_0x247cac['id']});if(_0x127f89!==_0xaeaa('0x7e')){return;}return db['UserVoiceQueueRt'][_0xaeaa('0x53')]({'where':{'VoiceQueueId':_0x247cac['id'],'UserId':_0x58cdeb},'transaction':_0x40c684});});return Promise['all'](_0x54a33f);});});return Promise['all'](_0x2b6c20);});});return Promise[_0xaeaa('0x92')](_0x2fb9a4)[_0xaeaa('0x2a')](function(){return _0x57d994[_0xaeaa('0x95')](_0x399d0c,{'transaction':_0x40c684});})[_0xaeaa('0x2a')](function(){return db['TeamVoicePrefix']['findOne']({'where':{'teamId':_0x2b1db0}})[_0xaeaa('0x2a')](function(_0xe8405b){if(_0xe8405b){var _0x4099bd=_[_0xaeaa('0x34')](_0x399d0c,function(_0xd6cf4e){db[_0xaeaa('0x6a')][_0xaeaa('0x53')]({'where':{'UserId':_0xd6cf4e,'VoicePrefixId':_0xe8405b[_0xaeaa('0x6b')]}});});return Promise[_0xaeaa('0x92')](_0x4099bd);}});});});}})[_0xaeaa('0x2a')](respondWithStatusCode(_0x2b9259,null))[_0xaeaa('0x44')](handleError(_0x2b9259,null));};exports[_0xaeaa('0x9a')]=function(_0x2ed6a9,_0x47d18e,_0x3d0cc6){var _0x1b839a={};var _0x1c9cfc={};var _0x25b5cd;var _0x9f360;return db[_0xaeaa('0x2f')][_0xaeaa('0x77')]({'where':{'id':_0x2ed6a9[_0xaeaa('0x45')]['id']}})[_0xaeaa('0x2a')](handleEntityNotFound(_0x47d18e,null))[_0xaeaa('0x2a')](function(_0x4f041f){if(_0x4f041f){_0x25b5cd=_0x4f041f;_0x1c9cfc[_0xaeaa('0x33')]=_['keys'](db[_0xaeaa('0x89')][_0xaeaa('0x30')]);_0x1c9cfc[_0xaeaa('0x35')]=_[_0xaeaa('0x36')](_0x2ed6a9[_0xaeaa('0x35')]);_0x1c9cfc[_0xaeaa('0x37')]=_[_0xaeaa('0x46')](_0x1c9cfc[_0xaeaa('0x33')],_0x1c9cfc['query']);_0x1b839a[_0xaeaa('0x38')]=_['intersection'](_0x1c9cfc[_0xaeaa('0x33')],qs[_0xaeaa('0x47')](_0x2ed6a9[_0xaeaa('0x35')][_0xaeaa('0x47')]));_0x1b839a[_0xaeaa('0x38')]=_0x1b839a['attributes'][_0xaeaa('0x39')]?_0x1b839a[_0xaeaa('0x38')]:_0x1c9cfc['model'];_0x1b839a[_0xaeaa('0x3c')]=qs[_0xaeaa('0x3d')](_0x2ed6a9[_0xaeaa('0x35')][_0xaeaa('0x3d')]);_0x1b839a['where']=qs['filters'](_[_0xaeaa('0x74')](_0x2ed6a9['query'],_0x1c9cfc['filters']));if(_0x2ed6a9[_0xaeaa('0x35')][_0xaeaa('0x9b')]){_0x1b839a[_0xaeaa('0x3e')]=_[_0xaeaa('0x3f')](_0x1b839a['where'],{'$or':_[_0xaeaa('0x34')](_0x1b839a['attributes'],function(_0x49d247){var _0x5b2f19={};_0x5b2f19[_0x49d247]={'$like':'%'+_0x2ed6a9[_0xaeaa('0x35')]['filter']+'%'};return _0x5b2f19;})});}_0x1b839a=_[_0xaeaa('0x3f')]({},_0x1b839a,_0x2ed6a9[_0xaeaa('0x41')]);return _0x25b5cd[_0xaeaa('0x9a')](_0x1b839a);}})[_0xaeaa('0x2a')](function(_0x34f0a1){if(_0x34f0a1){_0x9f360=_0x34f0a1['length'];if(!_0x2ed6a9[_0xaeaa('0x35')][_0xaeaa('0x3a')](_0xaeaa('0x3b'))){_0x1b839a[_0xaeaa('0x21')]=qs[_0xaeaa('0x21')](_0x2ed6a9['query'][_0xaeaa('0x21')]);_0x1b839a[_0xaeaa('0x23')]=qs[_0xaeaa('0x23')](_0x2ed6a9[_0xaeaa('0x35')][_0xaeaa('0x23')]);}return _0x25b5cd[_0xaeaa('0x9a')](_0x1b839a);}})[_0xaeaa('0x2a')](function(_0x45700f){if(_0x45700f){return _0x45700f?{'count':_0x9f360,'rows':_0x45700f}:null;}})[_0xaeaa('0x2a')](respondWithResult(_0x47d18e,null))[_0xaeaa('0x44')](handleError(_0x47d18e,null));}; \ No newline at end of file +var _0x6428=['filter','VIRTUAL','includeAll','findAll','params','length','include','merge','find','catch','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','UserProfileSection','userProfileId','UserProfileResource','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','destroy','sequelize','transaction','Sequelize','QueryTypes','SELECT','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','VoicePrefixId','end','getQueues','channel','isValidChannel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queues','addQueues','findOne','add','ids','addAgents','isArray','Voice','Chat','Mail','Sms','Openchannel','Whatsapp','QueueId','penalty','Queue','findOrCreate','emit','Queue:save','User','online','voicePause','interface','UserVoiceQueueRt','upsert','isNil','TeamVoiceQueue','all','UserVoicePrefix','removeAgents','Fax','Queue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./team.socket','register','sendStatus','status','json','offset','limit','undefined','count','Content-Range','apply','save','then','stack','name','send','index','Team','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x5cb060,_0x21c48d){var _0x137d35=function(_0x4dafb4){while(--_0x4dafb4){_0x5cb060['push'](_0x5cb060['shift']());}};_0x137d35(++_0x21c48d);}(_0x6428,0x183));var _0x8642=function(_0x4394b6,_0x12357f){_0x4394b6=_0x4394b6-0x0;var _0x360244=_0x6428[_0x4394b6];return _0x360244;};'use strict';var emlformat=require(_0x8642('0x0'));var rimraf=require(_0x8642('0x1'));var zipdir=require(_0x8642('0x2'));var jsonpatch=require(_0x8642('0x3'));var rp=require(_0x8642('0x4'));var moment=require('moment');var BPromise=require(_0x8642('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x8642('0x6'));var ejs=require(_0x8642('0x7'));var fs=require('fs');var fs_extra=require(_0x8642('0x8'));var _=require(_0x8642('0x9'));var squel=require('squel');var crypto=require(_0x8642('0xa'));var jsforce=require(_0x8642('0xb'));var deskjs=require(_0x8642('0xc'));var toCsv=require(_0x8642('0x6'));var querystring=require(_0x8642('0xd'));var Papa=require(_0x8642('0xe'));var Redis=require(_0x8642('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x8642('0x10'));var as=require(_0x8642('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8642('0x12'))(_0x8642('0x13'));var utils=require(_0x8642('0x14'));var config=require(_0x8642('0x15'));var licenseUtil=require(_0x8642('0x16'));var db=require('../../mysqldb')['db'];config[_0x8642('0x17')]=_[_0x8642('0x18')](config[_0x8642('0x17')],{'host':_0x8642('0x19'),'port':0x18eb});var socket=require(_0x8642('0x1a'))(new Redis(config[_0x8642('0x17')]));require(_0x8642('0x1b'))[_0x8642('0x1c')](socket);function respondWithStatusCode(_0x5522e0,_0x51c8f9){_0x51c8f9=_0x51c8f9||0xcc;return function(_0x5f3ef9){if(_0x5f3ef9){return _0x5522e0[_0x8642('0x1d')](_0x51c8f9);}return _0x5522e0[_0x8642('0x1e')](_0x51c8f9)['end']();};}function respondWithResult(_0x1c8cad,_0x467c0c){_0x467c0c=_0x467c0c||0xc8;return function(_0x130cd8){if(_0x130cd8){return _0x1c8cad[_0x8642('0x1e')](_0x467c0c)[_0x8642('0x1f')](_0x130cd8);}};}function respondWithFilteredResult(_0x52f8c5,_0xbbb219){return function(_0x14e2f9){if(_0x14e2f9){var _0x5a3c11=typeof _0xbbb219[_0x8642('0x20')]==='undefined'&&typeof _0xbbb219[_0x8642('0x21')]===_0x8642('0x22');var _0x1c2c24=_0x14e2f9[_0x8642('0x23')];var _0x2dc886=_0x5a3c11?0x0:_0xbbb219[_0x8642('0x20')];var _0x513330=_0x5a3c11?_0x14e2f9[_0x8642('0x23')]:_0xbbb219[_0x8642('0x20')]+_0xbbb219['limit'];var _0x46ee54;if(_0x513330>=_0x1c2c24){_0x513330=_0x1c2c24;_0x46ee54=0xc8;}else{_0x46ee54=0xce;}_0x52f8c5[_0x8642('0x1e')](_0x46ee54);return _0x52f8c5['set'](_0x8642('0x24'),_0x2dc886+'-'+_0x513330+'/'+_0x1c2c24)[_0x8642('0x1f')](_0x14e2f9);}return null;};}function patchUpdates(_0x5ea1f5){return function(_0x4dc071){try{jsonpatch[_0x8642('0x25')](_0x4dc071,_0x5ea1f5,!![]);}catch(_0x136863){return BPromise['reject'](_0x136863);}return _0x4dc071[_0x8642('0x26')]();};}function saveUpdates(_0x10b8fc,_0x25c8c6){return function(_0x4c23f9){if(_0x4c23f9){return _0x4c23f9['update'](_0x10b8fc)[_0x8642('0x27')](function(_0x17c918){return _0x17c918;});}return null;};}function handleEntityNotFound(_0x4080d4,_0x287fb6){return function(_0x314709){if(!_0x314709){_0x4080d4[_0x8642('0x1d')](0x194);}return _0x314709;};}function handleError(_0x5afd1b,_0x4b626a){_0x4b626a=_0x4b626a||0x1f4;return function(_0x431be5){logger['error'](_0x431be5[_0x8642('0x28')]);if(_0x431be5[_0x8642('0x29')]){delete _0x431be5[_0x8642('0x29')];}_0x5afd1b[_0x8642('0x1e')](_0x4b626a)[_0x8642('0x2a')](_0x431be5);};}exports[_0x8642('0x2b')]=function(_0x49a770,_0x204d38){var _0xdd99c3={},_0xf28984={},_0x3b7bc={'count':0x0,'rows':[]};var _0x124612=_['map'](db[_0x8642('0x2c')][_0x8642('0x2d')],function(_0x3b73c1){return{'name':_0x3b73c1[_0x8642('0x2e')],'type':_0x3b73c1[_0x8642('0x2f')][_0x8642('0x30')]};});_0xf28984[_0x8642('0x31')]=_[_0x8642('0x32')](_0x124612,_0x8642('0x29'));_0xf28984[_0x8642('0x33')]=_[_0x8642('0x34')](_0x49a770['query']);_0xf28984[_0x8642('0x35')]=_['intersection'](_0xf28984[_0x8642('0x31')],_0xf28984[_0x8642('0x33')]);_0xdd99c3[_0x8642('0x36')]=_[_0x8642('0x37')](_0xf28984[_0x8642('0x31')],qs[_0x8642('0x38')](_0x49a770[_0x8642('0x33')][_0x8642('0x38')]));_0xdd99c3[_0x8642('0x36')]=_0xdd99c3[_0x8642('0x36')]['length']?_0xdd99c3[_0x8642('0x36')]:_0xf28984[_0x8642('0x31')];if(!_0x49a770[_0x8642('0x33')][_0x8642('0x39')](_0x8642('0x3a'))){_0xdd99c3[_0x8642('0x21')]=qs[_0x8642('0x21')](_0x49a770['query'][_0x8642('0x21')]);_0xdd99c3['offset']=qs[_0x8642('0x20')](_0x49a770[_0x8642('0x33')][_0x8642('0x20')]);}_0xdd99c3[_0x8642('0x3b')]=qs[_0x8642('0x3c')](_0x49a770[_0x8642('0x33')][_0x8642('0x3c')]);_0xdd99c3[_0x8642('0x3d')]=qs['filters'](_[_0x8642('0x3e')](_0x49a770['query'],_0xf28984[_0x8642('0x35')]),_0x124612);if(_0x49a770[_0x8642('0x33')][_0x8642('0x3f')]){_0xdd99c3['where']=_['merge'](_0xdd99c3[_0x8642('0x3d')],{'$or':_['map'](_0x124612,function(_0x2e404f){if(_0x2e404f[_0x8642('0x2f')]!==_0x8642('0x40')){var _0x824e99={};_0x824e99[_0x2e404f['name']]={'$like':'%'+_0x49a770[_0x8642('0x33')][_0x8642('0x3f')]+'%'};return _0x824e99;}})});}_0xdd99c3=_['merge']({},_0xdd99c3,_0x49a770['options']);var _0x3ce2ab={'where':_0xdd99c3[_0x8642('0x3d')]};return db['Team'][_0x8642('0x23')](_0x3ce2ab)[_0x8642('0x27')](function(_0x51e621){_0x3b7bc['count']=_0x51e621;if(_0x49a770[_0x8642('0x33')][_0x8642('0x41')]){_0xdd99c3['include']=[{'all':!![]}];}return db[_0x8642('0x2c')][_0x8642('0x42')](_0xdd99c3);})['then'](function(_0x30295a){_0x3b7bc['rows']=_0x30295a;return _0x3b7bc;})[_0x8642('0x27')](respondWithFilteredResult(_0x204d38,_0xdd99c3))['catch'](handleError(_0x204d38,null));};exports['show']=function(_0x1d86fd,_0x4867db){var _0x123a7b={'raw':![],'where':{'id':_0x1d86fd[_0x8642('0x43')]['id']}},_0x4a5c9e={};_0x4a5c9e['model']=_['keys'](db[_0x8642('0x2c')]['rawAttributes']);_0x4a5c9e['query']=_[_0x8642('0x34')](_0x1d86fd[_0x8642('0x33')]);_0x4a5c9e[_0x8642('0x35')]=_[_0x8642('0x37')](_0x4a5c9e['model'],_0x4a5c9e[_0x8642('0x33')]);_0x123a7b[_0x8642('0x36')]=_['intersection'](_0x4a5c9e[_0x8642('0x31')],qs[_0x8642('0x38')](_0x1d86fd[_0x8642('0x33')]['fields']));_0x123a7b[_0x8642('0x36')]=_0x123a7b[_0x8642('0x36')][_0x8642('0x44')]?_0x123a7b['attributes']:_0x4a5c9e[_0x8642('0x31')];if(_0x1d86fd[_0x8642('0x33')][_0x8642('0x41')]){_0x123a7b[_0x8642('0x45')]=[{'all':!![]}];}_0x123a7b=_[_0x8642('0x46')]({},_0x123a7b,_0x1d86fd['options']);return db[_0x8642('0x2c')][_0x8642('0x47')](_0x123a7b)['then'](handleEntityNotFound(_0x4867db,null))[_0x8642('0x27')](respondWithResult(_0x4867db,null))[_0x8642('0x48')](handleError(_0x4867db,null));};exports['create']=function(_0x5a99f2,_0x2d1939){return db[_0x8642('0x2c')]['create'](_0x5a99f2[_0x8642('0x49')],{})[_0x8642('0x27')](function(_0x5d0688){var _0x19946a=_0x5a99f2[_0x8642('0x4a')][_0x8642('0x4b')]({'plain':!![]});if(!_0x19946a)throw new Error(_0x8642('0x4c'));if(_0x19946a[_0x8642('0x4d')]===_0x8642('0x4a')){var _0x2847e3=_0x5d0688[_0x8642('0x4b')]({'plain':!![]});var _0x5a8e29=_0x8642('0x4e');return db[_0x8642('0x4f')][_0x8642('0x47')]({'where':{'name':_0x5a8e29,'userProfileId':_0x19946a[_0x8642('0x50')]},'raw':!![]})['then'](function(_0xff0c50){if(_0xff0c50&&_0xff0c50['autoAssociation']===0x0){return db[_0x8642('0x51')][_0x8642('0x52')]({'name':_0x2847e3['name'],'resourceId':_0x2847e3['id'],'type':_0xff0c50[_0x8642('0x29')],'sectionId':_0xff0c50['id']},{})['then'](function(){return _0x5d0688;});}else{return _0x5d0688;}})[_0x8642('0x48')](function(_0x2c79d4){logger[_0x8642('0x53')](_0x8642('0x54'),_0x2c79d4);throw _0x2c79d4;});}return _0x5d0688;})['then'](respondWithResult(_0x2d1939,0xc9))[_0x8642('0x48')](handleError(_0x2d1939,null));};exports[_0x8642('0x55')]=function(_0x466792,_0x37df7f){if(_0x466792[_0x8642('0x49')]['id']){delete _0x466792['body']['id'];}return db['Team'][_0x8642('0x47')]({'where':{'id':_0x466792[_0x8642('0x43')]['id']}})[_0x8642('0x27')](handleEntityNotFound(_0x37df7f,null))[_0x8642('0x27')](saveUpdates(_0x466792[_0x8642('0x49')],null))[_0x8642('0x27')](respondWithResult(_0x37df7f,null))[_0x8642('0x48')](handleError(_0x37df7f,null));};exports[_0x8642('0x56')]=function(_0x5dcf7c,_0x20aead){var _0x2f8004=_0x5dcf7c['params']['id'];var _0x124297=[];return db[_0x8642('0x57')][_0x8642('0x58')](function(_0x19d455){var _0x12e73c='SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'+_0x2f8004;return db[_0x8642('0x57')]['query'](_0x12e73c,{'type':db[_0x8642('0x59')][_0x8642('0x5a')][_0x8642('0x5b')],'raw':!![],'transaction':_0x19d455})['then'](function(_0xb203b7){_0x124297=_[_0x8642('0x32')](_0xb203b7,function(_0x537dee){return Number(_0x537dee['UserId']);});})[_0x8642('0x27')](function(){var _0x4d0739='SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20'+_0x2f8004;return db[_0x8642('0x57')][_0x8642('0x33')](_0x4d0739,{'type':db['Sequelize'][_0x8642('0x5a')][_0x8642('0x5b')],'raw':!![],'transaction':_0x19d455});})[_0x8642('0x27')](function(_0x2014f4){var _0x335aa2=_[_0x8642('0x32')](_0x2014f4,function(_0x8af99){return Number(_0x8af99['VoiceQueueId']);});return db[_0x8642('0x5c')][_0x8642('0x56')]({'where':{'UserId':{'$in':_0x124297},'VoiceQueueId':{'$in':_0x335aa2}},'transaction':_0x19d455});})['then'](function(){var _0x2d2d72=_0x8642('0x5d')+_0x2f8004;return db[_0x8642('0x57')][_0x8642('0x33')](_0x2d2d72,{'type':db['Sequelize']['QueryTypes'][_0x8642('0x5b')],'raw':!![],'transaction':_0x19d455});})['then'](function(_0x55f9d2){var _0x19539b=_['map'](_0x55f9d2,function(_0x23712d){return Number(_0x23712d[_0x8642('0x5e')]);});return db[_0x8642('0x5f')]['destroy']({'where':{'UserId':{'$in':_0x124297},'MailQueueId':{'$in':_0x19539b}},'transaction':_0x19d455});})[_0x8642('0x27')](function(){var _0xc49b3b=_0x8642('0x60')+_0x2f8004;return db['sequelize'][_0x8642('0x33')](_0xc49b3b,{'type':db[_0x8642('0x59')][_0x8642('0x5a')][_0x8642('0x5b')],'raw':!![],'transaction':_0x19d455});})['then'](function(_0x2d06b0){var _0x14c75f=_[_0x8642('0x32')](_0x2d06b0,function(_0x213c2a){return Number(_0x213c2a[_0x8642('0x61')]);});return db['UserSmsQueue'][_0x8642('0x56')]({'where':{'UserId':{'$in':_0x124297},'SmsQueueId':{'$in':_0x14c75f}},'transaction':_0x19d455});})[_0x8642('0x27')](function(){var _0x470aee='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0x2f8004;return db[_0x8642('0x57')][_0x8642('0x33')](_0x470aee,{'type':db[_0x8642('0x59')][_0x8642('0x5a')][_0x8642('0x5b')],'raw':!![],'transaction':_0x19d455});})[_0x8642('0x27')](function(_0x335b0a){var _0x3122ba=_['map'](_0x335b0a,function(_0x128c18){return Number(_0x128c18['ChatQueueId']);});return db[_0x8642('0x62')]['destroy']({'where':{'UserId':{'$in':_0x124297},'ChatQueueId':{'$in':_0x3122ba}},'transaction':_0x19d455});})['then'](function(){var _0x2a7917=_0x8642('0x63')+_0x2f8004;return db[_0x8642('0x57')][_0x8642('0x33')](_0x2a7917,{'type':db[_0x8642('0x59')]['QueryTypes'][_0x8642('0x5b')],'raw':!![],'transaction':_0x19d455});})[_0x8642('0x27')](function(_0x1964d5){var _0x24db50=_[_0x8642('0x32')](_0x1964d5,function(_0x30c21a){return Number(_0x30c21a['FaxQueueId']);});return db[_0x8642('0x64')][_0x8642('0x56')]({'where':{'UserId':{'$in':_0x124297},'FaxQueueId':{'$in':_0x24db50}},'transaction':_0x19d455});})[_0x8642('0x27')](function(){var _0x3ee763=_0x8642('0x65')+_0x2f8004;return db[_0x8642('0x57')][_0x8642('0x33')](_0x3ee763,{'type':db[_0x8642('0x59')][_0x8642('0x5a')][_0x8642('0x5b')],'raw':!![],'transaction':_0x19d455});})[_0x8642('0x27')](function(_0x3ce792){var _0x4e398b=_[_0x8642('0x32')](_0x3ce792,function(_0x2cfc28){return Number(_0x2cfc28[_0x8642('0x66')]);});return db[_0x8642('0x67')][_0x8642('0x56')]({'where':{'UserId':{'$in':_0x124297},'OpenchannelQueueId':{'$in':_0x4e398b}},'transaction':_0x19d455});})[_0x8642('0x27')](function(){var _0x5745a3=_0x8642('0x68')+_0x2f8004;return db[_0x8642('0x57')][_0x8642('0x33')](_0x5745a3,{'type':db[_0x8642('0x59')][_0x8642('0x5a')][_0x8642('0x5b')],'raw':!![],'transaction':_0x19d455});})['then'](function(_0x5961e9){var _0x297628=_[_0x8642('0x32')](_0x5961e9,function(_0x3ea2cd){return Number(_0x3ea2cd[_0x8642('0x69')]);});return db[_0x8642('0x6a')][_0x8642('0x56')]({'where':{'UserId':{'$in':_0x124297},'WhatsappQueueId':{'$in':_0x297628}},'transaction':_0x19d455});})[_0x8642('0x27')](function(){return db[_0x8642('0x6b')][_0x8642('0x47')]({'where':{'TeamId':_0x2f8004}});})[_0x8642('0x27')](function(_0x583913){if(_0x583913===null){return;}return db['UserVoicePrefix'][_0x8642('0x56')]({'where':{'UserId':{'$in':_0x124297},'VoicePrefixId':_0x583913[_0x8642('0x6c')]},'transaction':_0x19d455});})[_0x8642('0x27')](function(){return db[_0x8642('0x2c')][_0x8642('0x56')]({'where':{'id':_0x2f8004},'cascade':!![],'transaction':_0x19d455});})[_0x8642('0x27')](function(_0x11f7c5){if(_0x11f7c5===0x0){_0x20aead['sendStatus'](0x194);}else{return db[_0x8642('0x51')][_0x8642('0x56')]({'where':{'type':_0x8642('0x4e'),'resourceId':_0x2f8004},'cascade':!![],'transaction':_0x19d455})['then'](function(){_0x20aead[_0x8642('0x1e')](0xcc)[_0x8642('0x6d')]();});}})[_0x8642('0x48')](function(_0x2d4d05){_0x20aead[_0x8642('0x1e')](0x1f4)[_0x8642('0x2a')](_0x2d4d05);});});};exports[_0x8642('0x6e')]=function(_0x436809,_0x31b7ae,_0x452324){return db['Team']['findOne']({'where':{'id':_0x436809[_0x8642('0x43')]['id']}})[_0x8642('0x27')](handleEntityNotFound(_0x31b7ae,null))['then'](function(_0x344c8a){if(!_0x436809[_0x8642('0x33')][_0x8642('0x6f')]||!utils[_0x8642('0x70')](_0x436809['query'][_0x8642('0x6f')])){throw new db[(_0x8642('0x59'))][(_0x8642('0x71'))](_0x8642('0x72'));}var _0x29ef3f={};var _0x17f7e6={};_0x17f7e6[_0x8642('0x31')]=_['keys'](db[_[_0x8642('0x73')](_0x436809['query'][_0x8642('0x6f')][_0x8642('0x74')]())+'Queue'][_0x8642('0x2d')]);_0x17f7e6[_0x8642('0x33')]=_['keys'](_0x436809[_0x8642('0x33')]);_0x17f7e6[_0x8642('0x35')]=_[_0x8642('0x37')](_0x17f7e6[_0x8642('0x31')],_0x17f7e6[_0x8642('0x33')]);_0x29ef3f[_0x8642('0x36')]=_[_0x8642('0x37')](_0x17f7e6['model'],qs['fields'](_0x436809['query'][_0x8642('0x38')]));_0x29ef3f[_0x8642('0x36')]=_0x29ef3f[_0x8642('0x36')]['length']?_0x29ef3f['attributes']:_0x17f7e6[_0x8642('0x31')];_0x29ef3f[_0x8642('0x21')]=qs['limit'](_0x436809['query'][_0x8642('0x21')]);_0x29ef3f[_0x8642('0x20')]=qs[_0x8642('0x20')](_0x436809[_0x8642('0x33')][_0x8642('0x20')]);_0x29ef3f[_0x8642('0x3b')]=qs[_0x8642('0x3c')](_0x436809['query']['sort']);_0x29ef3f['where']=qs[_0x8642('0x35')](_[_0x8642('0x3e')](_0x436809[_0x8642('0x33')],_0x17f7e6[_0x8642('0x35')]));_0x29ef3f=_[_0x8642('0x46')]({},_0x29ef3f,_0x436809['options']);return _0x344c8a[_0x8642('0x4b')+_[_0x8642('0x73')](_0x436809[_0x8642('0x33')]['channel'][_0x8642('0x74')]())+_0x8642('0x75')](_0x29ef3f);})['then'](respondWithResult(_0x31b7ae,null))[_0x8642('0x48')](handleError(_0x31b7ae,null));};exports[_0x8642('0x76')]=function(_0x4b77b5,_0x5f3804,_0x1a11f3){return db[_0x8642('0x2c')][_0x8642('0x77')]({'where':{'id':_0x4b77b5[_0x8642('0x43')]['id']}})[_0x8642('0x27')](function(_0x19b503){if(_0x19b503){if(!_0x4b77b5[_0x8642('0x49')][_0x8642('0x6f')]||!utils[_0x8642('0x70')](_0x4b77b5[_0x8642('0x49')][_0x8642('0x6f')])){throw new db['Sequelize'][(_0x8642('0x71'))](_0x8642('0x72'));}return _0x19b503[_0x8642('0x78')+_[_0x8642('0x73')](_0x4b77b5[_0x8642('0x49')][_0x8642('0x6f')][_0x8642('0x74')]())+'Queues'](_0x4b77b5[_0x8642('0x49')][_0x8642('0x79')]);}return null;})[_0x8642('0x27')](handleEntityNotFound(_0x5f3804,null))['then'](respondWithStatusCode(_0x5f3804,null))['catch'](handleError(_0x5f3804,null));};exports['removeQueues']=function(_0x1221f1,_0x14bd2d,_0x1c31b6){return db[_0x8642('0x2c')]['findOne']({'where':{'id':_0x1221f1[_0x8642('0x43')]['id']}})[_0x8642('0x27')](function(_0x31c0cf){if(_0x31c0cf){if(!_0x1221f1['query'][_0x8642('0x6f')]||!utils['isValidChannel'](_0x1221f1[_0x8642('0x33')][_0x8642('0x6f')])){throw new db['Sequelize']['ValidationError'](_0x8642('0x72'));}return _0x31c0cf['remove'+_['capitalize'](_0x1221f1[_0x8642('0x33')][_0x8642('0x6f')][_0x8642('0x74')]())+_0x8642('0x75')](_0x1221f1['query'][_0x8642('0x79')]);}return null;})[_0x8642('0x27')](handleEntityNotFound(_0x14bd2d,null))[_0x8642('0x27')](respondWithStatusCode(_0x14bd2d,null))[_0x8642('0x48')](handleError(_0x14bd2d,null));};exports[_0x8642('0x7a')]=function(_0x4f777d,_0x4bcaf4){var _0x101944=_[_0x8642('0x7b')](_0x4f777d['body'][_0x8642('0x79')])?_0x4f777d['body'][_0x8642('0x79')]:[_0x4f777d[_0x8642('0x49')][_0x8642('0x79')]];var _0x1e41e9=_0x4f777d[_0x8642('0x43')]['id'];return db[_0x8642('0x2c')][_0x8642('0x47')]({'where':{'id':_0x1e41e9}})[_0x8642('0x27')](handleEntityNotFound(_0x4bcaf4,null))[_0x8642('0x27')](function(_0x107bd8){if(_0x107bd8){var _0x501516=[_0x8642('0x7c'),_0x8642('0x7d'),_0x8642('0x7e'),_0x8642('0x7f'),'Fax',_0x8642('0x80'),_0x8642('0x81')];return db['sequelize'][_0x8642('0x58')](function(_0x26fd28){var _0x47dfa9=_[_0x8642('0x32')](_0x501516,function(_0x3806e1){var _0x4d8029={'attributes':['id',_0x8642('0x29')]};if(_0x3806e1===_0x8642('0x7c')){_0x4d8029['through']={'attributes':['penalty']};}return _0x107bd8[_0x8642('0x4b')+_0x3806e1+'Queues'](_0x4d8029)[_0x8642('0x27')](function(_0x1f036b){var _0x14e03a=_[_0x8642('0x32')](_0x1f036b,function(_0x12bd6a){var _0x39694b=_['map'](_0x101944,function(_0x4fb40f){var _0xb65982={'where':{'UserId':_0x4fb40f,[_0x3806e1+_0x8642('0x82')]:_0x12bd6a['id']},'transaction':_0x26fd28};if(_0x3806e1===_0x8642('0x7c')){_0xb65982[_0x8642('0x18')]={'penalty':_0x12bd6a['TeamVoiceQueue'][_0x8642('0x83')]};}return db['User'+_0x3806e1+_0x8642('0x84')][_0x8642('0x85')](_0xb65982)[_0x8642('0x27')](function(){socket[_0x8642('0x86')](_0x8642('0x4a')+_0x3806e1+_0x8642('0x87'),{'UserId':_0x4fb40f,[_0x3806e1+_0x8642('0x82')]:_0x12bd6a['id']});if(_0x3806e1!==_0x8642('0x7c')){return;}return db[_0x8642('0x88')][_0x8642('0x42')]({'where':{'id':_0x101944,'online':0x1},'attributes':['id','name',_0x8642('0x89'),_0x8642('0x8a'),_0x8642('0x8b')],'raw':!![]})['then'](function(_0x3a06fc){var _0x19ac33=_[_0x8642('0x32')](_0x3a06fc,function(_0x5377e8){return db[_0x8642('0x8c')][_0x8642('0x8d')]({'membername':_0x5377e8['name'],'UserId':_0x5377e8['id'],'queue_name':_0x12bd6a[_0x8642('0x29')],'VoiceQueueId':_0x12bd6a['id'],'interface':_[_0x8642('0x8e')](_0x5377e8[_0x8642('0x8b')])?util['format']('SIP/%s',_0x5377e8['name']):_0x5377e8[_0x8642('0x8b')],'paused':_0x5377e8['voicePause']||![],'penalty':_0x12bd6a[_0x8642('0x8f')][_0x8642('0x83')]},{'transaction':_0x26fd28});});return Promise[_0x8642('0x90')](_0x19ac33);});});});return Promise[_0x8642('0x90')](_0x39694b);});return Promise[_0x8642('0x90')](_0x14e03a);})[_0x8642('0x27')](function(){return db[_0x8642('0x6b')][_0x8642('0x77')]({'where':{'teamId':_0x1e41e9}})['then'](function(_0x310485){if(_0x310485){var _0x2fcced=_[_0x8642('0x32')](_0x101944,function(_0x481777){db[_0x8642('0x91')][_0x8642('0x8d')]({'UserId':_0x481777,'VoicePrefixId':_0x310485['VoicePrefixId']});});return Promise[_0x8642('0x90')](_0x2fcced);}});});});return Promise['all'](_0x47dfa9)[_0x8642('0x27')](function(){return _0x107bd8[_0x8642('0x7a')](_0x101944,{'transaction':_0x26fd28})['spread'](function(_0x11253d){return _0x11253d;});});});}})['then'](respondWithResult(_0x4bcaf4,null))[_0x8642('0x48')](handleError(_0x4bcaf4,null));};exports[_0x8642('0x92')]=function(_0x313af1,_0x111274){var _0x170ab4=_[_0x8642('0x7b')](_0x313af1['query'][_0x8642('0x79')])?_0x313af1[_0x8642('0x33')][_0x8642('0x79')]:[_0x313af1[_0x8642('0x33')][_0x8642('0x79')]];var _0x215292=_0x313af1[_0x8642('0x43')]['id'];return db[_0x8642('0x2c')]['find']({'where':{'id':_0x215292}})['then'](handleEntityNotFound(_0x111274,null))[_0x8642('0x27')](function(_0x401a34){if(_0x401a34){var _0x1c6c3a=['Voice',_0x8642('0x7d'),_0x8642('0x7e'),_0x8642('0x7f'),_0x8642('0x93'),_0x8642('0x80'),_0x8642('0x81')];return db[_0x8642('0x57')]['transaction'](function(_0x5c9ddd){var _0x1bc100=_[_0x8642('0x32')](_0x1c6c3a,function(_0x26ecde){var _0x5a3c4e={'attributes':['id',_0x8642('0x29')]};return _0x401a34[_0x8642('0x4b')+_0x26ecde+_0x8642('0x75')](_0x5a3c4e)[_0x8642('0x27')](function(_0x47d369){var _0x264e9b=_[_0x8642('0x32')](_0x47d369,function(_0x4d301f){return _0x4d301f[_0x8642('0x92')](_0x170ab4,{'transaction':_0x5c9ddd})[_0x8642('0x27')](function(){var _0x10a305=_['map'](_0x170ab4,function(_0x4df0cc){socket[_0x8642('0x86')](_0x8642('0x4a')+_0x26ecde+_0x8642('0x94'),{'UserId':Number(_0x4df0cc),[_0x26ecde+_0x8642('0x82')]:_0x4d301f['id']});if(_0x26ecde!==_0x8642('0x7c')){return;}return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x4d301f['id'],'UserId':_0x4df0cc},'transaction':_0x5c9ddd});});return Promise['all'](_0x10a305);});});return Promise[_0x8642('0x90')](_0x264e9b);});});return Promise['all'](_0x1bc100)[_0x8642('0x27')](function(){return _0x401a34[_0x8642('0x92')](_0x170ab4,{'transaction':_0x5c9ddd});})[_0x8642('0x27')](function(){return db[_0x8642('0x6b')][_0x8642('0x77')]({'where':{'teamId':_0x215292}})[_0x8642('0x27')](function(_0x5302d3){if(_0x5302d3){var _0x55f0e4=_[_0x8642('0x32')](_0x170ab4,function(_0x7da2e9){db[_0x8642('0x91')][_0x8642('0x56')]({'where':{'UserId':_0x7da2e9,'VoicePrefixId':_0x5302d3['VoicePrefixId']}});});return Promise[_0x8642('0x90')](_0x55f0e4);}});});});}})['then'](respondWithStatusCode(_0x111274,null))[_0x8642('0x48')](handleError(_0x111274,null));};exports[_0x8642('0x95')]=function(_0x1fb2c2,_0x236574,_0x4be0db){var _0x263b26={};var _0x5a231a={};var _0x5d5b26;var _0x3926bd;return db[_0x8642('0x2c')][_0x8642('0x77')]({'where':{'id':_0x1fb2c2[_0x8642('0x43')]['id']}})[_0x8642('0x27')](handleEntityNotFound(_0x236574,null))[_0x8642('0x27')](function(_0x55d8ce){if(_0x55d8ce){_0x5d5b26=_0x55d8ce;_0x5a231a[_0x8642('0x31')]=_[_0x8642('0x34')](db[_0x8642('0x88')][_0x8642('0x2d')]);_0x5a231a[_0x8642('0x33')]=_[_0x8642('0x34')](_0x1fb2c2[_0x8642('0x33')]);_0x5a231a[_0x8642('0x35')]=_[_0x8642('0x37')](_0x5a231a[_0x8642('0x31')],_0x5a231a[_0x8642('0x33')]);_0x263b26[_0x8642('0x36')]=_[_0x8642('0x37')](_0x5a231a[_0x8642('0x31')],qs[_0x8642('0x38')](_0x1fb2c2[_0x8642('0x33')][_0x8642('0x38')]));_0x263b26['attributes']=_0x263b26['attributes'][_0x8642('0x44')]?_0x263b26[_0x8642('0x36')]:_0x5a231a[_0x8642('0x31')];_0x263b26[_0x8642('0x3b')]=qs[_0x8642('0x3c')](_0x1fb2c2[_0x8642('0x33')][_0x8642('0x3c')]);_0x263b26[_0x8642('0x3d')]=qs['filters'](_[_0x8642('0x3e')](_0x1fb2c2[_0x8642('0x33')],_0x5a231a[_0x8642('0x35')]));if(_0x1fb2c2[_0x8642('0x33')][_0x8642('0x3f')]){_0x263b26[_0x8642('0x3d')]=_[_0x8642('0x46')](_0x263b26[_0x8642('0x3d')],{'$or':_['map'](_0x263b26['attributes'],function(_0x28dc5b){var _0x4baf22={};_0x4baf22[_0x28dc5b]={'$like':'%'+_0x1fb2c2[_0x8642('0x33')][_0x8642('0x3f')]+'%'};return _0x4baf22;})});}_0x263b26=_[_0x8642('0x46')]({},_0x263b26,_0x1fb2c2['options']);return _0x5d5b26[_0x8642('0x95')](_0x263b26);}})['then'](function(_0x5bc636){if(_0x5bc636){_0x3926bd=_0x5bc636[_0x8642('0x44')];if(!_0x1fb2c2[_0x8642('0x33')][_0x8642('0x39')](_0x8642('0x3a'))){_0x263b26[_0x8642('0x21')]=qs[_0x8642('0x21')](_0x1fb2c2[_0x8642('0x33')][_0x8642('0x21')]);_0x263b26['offset']=qs[_0x8642('0x20')](_0x1fb2c2['query'][_0x8642('0x20')]);}return _0x5d5b26[_0x8642('0x95')](_0x263b26);}})[_0x8642('0x27')](function(_0x2cb98e){if(_0x2cb98e){return _0x2cb98e?{'count':_0x3926bd,'rows':_0x2cb98e}:null;}})[_0x8642('0x27')](respondWithResult(_0x236574,null))[_0x8642('0x48')](handleError(_0x236574,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 9f94b28..196bcfb 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 _0x9296=['../../mysqldb','setMaxListeners','save','remove','emit','exports'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x9296,0xe4));var _0x6929=function(_0x14da86,_0x3e738b){_0x14da86=_0x14da86-0x0;var _0xc171a8=_0x9296[_0x14da86];return _0xc171a8;};'use strict';var EventEmitter=require('events');var Team=require(_0x6929('0x0'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents[_0x6929('0x1')](0x0);var events={'afterCreate':_0x6929('0x2'),'afterUpdate':'update','afterDestroy':_0x6929('0x3')};function emitEvent(_0x1e340d){return function(_0x25e0dc,_0x5ed0d6,_0x195e16){TeamEvents[_0x6929('0x4')](_0x1e340d+':'+_0x25e0dc['id'],_0x25e0dc);TeamEvents[_0x6929('0x4')](_0x1e340d,_0x25e0dc);_0x195e16(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0x6929('0x5')]=TeamEvents; \ No newline at end of file +var _0xd117=['exports','../../mysqldb','Team','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd117,0x196));var _0x7d11=function(_0x36f641,_0x1a3063){_0x36f641=_0x36f641-0x0;var _0x39b299=_0xd117[_0x36f641];return _0x39b299;};'use strict';var EventEmitter=require('events');var Team=require(_0x7d11('0x0'))['db'][_0x7d11('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0x7d11('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7d11('0x3'),'afterDestroy':_0x7d11('0x4')};function emitEvent(_0x3a0a42){return function(_0x311ad5,_0x196a4b,_0x4fe5a6){TeamEvents[_0x7d11('0x5')](_0x3a0a42+':'+_0x311ad5['id'],_0x311ad5);TeamEvents[_0x7d11('0x5')](_0x3a0a42,_0x311ad5);_0x4fe5a6(null);};}for(var e in events){if(events[_0x7d11('0x6')](e)){var event=events[e];Team[_0x7d11('0x7')](e,emitEvent(event));}}module[_0x7d11('0x8')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 721b668..136d5ce 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 _0xeb31=['Fax','Openchannel','Sms','Voice','Whatsapp','all','lodash','./team.attributes','get','Queues','then','map','channel','catch','exports','define','teams','Chat'];(function(_0x3b5951,_0x40024d){var _0x5bfc9a=function(_0xe67cf7){while(--_0xe67cf7){_0x3b5951['push'](_0x3b5951['shift']());}};_0x5bfc9a(++_0x40024d);}(_0xeb31,0x1a4));var _0x1eb3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xeb31[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1eb3('0x0'));var attributes=require(_0x1eb3('0x1'));function getQueuesByChannel(_0x201263,_0x46907a){var _0x2c934a=_0x1eb3('0x2')+_0x46907a+_0x1eb3('0x3');return _0x201263[_0x2c934a]()[_0x1eb3('0x4')](function(_0x3ce5e1){return _[_0x1eb3('0x5')](_0x3ce5e1,function(_0x6025bd){_0x6025bd['setDataValue'](_0x1eb3('0x6'),_0x46907a);return _0x6025bd;});})[_0x1eb3('0x7')](function(_0x225f45){throw _0x225f45;});}module[_0x1eb3('0x8')]=function(_0x1906e7){return _0x1906e7[_0x1eb3('0x9')]('Team',attributes,{'tableName':_0x1eb3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x54922f=this;var _0x14b9b4=[_0x1eb3('0xb'),_0x1eb3('0xc'),'Mail',_0x1eb3('0xd'),_0x1eb3('0xe'),_0x1eb3('0xf'),_0x1eb3('0x10')];return Promise['resolve']()[_0x1eb3('0x4')](function(){var _0x15fc8e=_[_0x1eb3('0x5')](_0x14b9b4,function(_0x2249dc){return getQueuesByChannel(_0x54922f,_0x2249dc);});return Promise[_0x1eb3('0x11')](_0x15fc8e);})[_0x1eb3('0x7')](function(_0x21e9ab){throw _0x21e9ab;});}}});}; \ No newline at end of file +var _0xc5f8=['Sms','Whatsapp','map','all','lodash','./team.attributes','get','Queues','then','setDataValue','channel','catch','exports','define','teams','Mail','Openchannel'];(function(_0x2dd843,_0x2cb2be){var _0x3148b7=function(_0x2454a4){while(--_0x2454a4){_0x2dd843['push'](_0x2dd843['shift']());}};_0x3148b7(++_0x2cb2be);}(_0xc5f8,0x147));var _0x8c5f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc5f8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8c5f('0x0'));var attributes=require(_0x8c5f('0x1'));function getQueuesByChannel(_0x485901,_0x179869){var _0x5cae86=_0x8c5f('0x2')+_0x179869+_0x8c5f('0x3');return _0x485901[_0x5cae86]()[_0x8c5f('0x4')](function(_0x1b6e4e){return _['map'](_0x1b6e4e,function(_0xfc8ece){_0xfc8ece[_0x8c5f('0x5')](_0x8c5f('0x6'),_0x179869);return _0xfc8ece;});})[_0x8c5f('0x7')](function(_0x9e2591){throw _0x9e2591;});}module[_0x8c5f('0x8')]=function(_0x28c008){return _0x28c008[_0x8c5f('0x9')]('Team',attributes,{'tableName':_0x8c5f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x2d05d2=this;var _0x3f134b=['Chat','Fax',_0x8c5f('0xb'),_0x8c5f('0xc'),_0x8c5f('0xd'),'Voice',_0x8c5f('0xe')];return Promise['resolve']()['then'](function(){var _0x1e2f3d=_[_0x8c5f('0xf')](_0x3f134b,function(_0x1caa21){return getQueuesByChannel(_0x2d05d2,_0x1caa21);});return Promise[_0x8c5f('0x10')](_0x1e2f3d);})['catch'](function(_0x5af15f){throw _0x5af15f;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 13efee3..18ff847 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 _0x27a8=['message','result','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','redis','defaults','localhost','socket.io-emitter','./team.socket','register','request','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','error'];(function(_0x2685e7,_0x4f3417){var _0x405b91=function(_0x2a0aaf){while(--_0x2a0aaf){_0x2685e7['push'](_0x2685e7['shift']());}};_0x405b91(++_0x4f3417);}(_0x27a8,0x12d));var _0x827a=function(_0x5be485,_0x4486f2){_0x5be485=_0x5be485-0x0;var _0x3edcbe=_0x27a8[_0x5be485];return _0x3edcbe;};'use strict';var _=require('lodash');var util=require(_0x827a('0x0'));var moment=require(_0x827a('0x1'));var BPromise=require('bluebird');var rs=require(_0x827a('0x2'));var fs=require('fs');var Redis=require(_0x827a('0x3'));var db=require(_0x827a('0x4'))['db'];var utils=require(_0x827a('0x5'));var logger=require(_0x827a('0x6'))(_0x827a('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x827a('0x8')]=_[_0x827a('0x9')](config[_0x827a('0x8')],{'host':_0x827a('0xa'),'port':0x18eb});var socket=require(_0x827a('0xb'))(new Redis(config[_0x827a('0x8')]));require(_0x827a('0xc'))[_0x827a('0xd')](socket);function respondWithRpcPromise(_0xeed854,_0xfa2d39,_0x5d46b0){return new BPromise(function(_0x1e7dc1,_0x30d19c){return client[_0x827a('0xe')](_0xeed854,_0x5d46b0)[_0x827a('0xf')](function(_0x51db54){logger[_0x827a('0x10')](_0x827a('0x11'),_0xfa2d39,_0x827a('0x12'));logger[_0x827a('0x13')]('Team,\x20%s,\x20%s,\x20%s',_0xfa2d39,_0x827a('0x12'),JSON['stringify'](_0x51db54));if(_0x51db54['error']){if(_0x51db54[_0x827a('0x14')]['code']===0x1f4){logger[_0x827a('0x14')](_0x827a('0x11'),_0xfa2d39,_0x51db54['error']['message']);return _0x30d19c(_0x51db54[_0x827a('0x14')][_0x827a('0x15')]);}logger[_0x827a('0x14')](_0x827a('0x11'),_0xfa2d39,_0x51db54['error'][_0x827a('0x15')]);return _0x1e7dc1(_0x51db54[_0x827a('0x14')]['message']);}else{logger[_0x827a('0x10')](_0x827a('0x11'),_0xfa2d39,'request\x20sent');_0x1e7dc1(_0x51db54[_0x827a('0x16')][_0x827a('0x15')]);}})['catch'](function(_0x58a3ba){logger['error'](_0x827a('0x11'),_0xfa2d39,_0x58a3ba);_0x30d19c(_0x58a3ba);});});} \ No newline at end of file +var _0x049e=['debug','request\x20sent','code','error','message','result','catch','lodash','util','randomstring','../../mysqldb','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./team.socket','request','then','info','Team,\x20%s,\x20%s'];(function(_0x423dcd,_0x4a719c){var _0x4c2454=function(_0x3d44af){while(--_0x3d44af){_0x423dcd['push'](_0x423dcd['shift']());}};_0x4c2454(++_0x4a719c);}(_0x049e,0xd6));var _0xe049=function(_0x57dc85,_0x3a6d51){_0x57dc85=_0x57dc85-0x0;var _0x563a2e=_0x049e[_0x57dc85];return _0x563a2e;};'use strict';var _=require(_0xe049('0x0'));var util=require(_0xe049('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe049('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe049('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xe049('0x4'));var jayson=require(_0xe049('0x5'));var client=jayson[_0xe049('0x6')][_0xe049('0x7')]({'port':0x232a});config['redis']=_[_0xe049('0x8')](config[_0xe049('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xe049('0xa'))(new Redis(config[_0xe049('0x9')]));require(_0xe049('0xb'))['register'](socket);function respondWithRpcPromise(_0x133ea2,_0x33dd06,_0x2af216){return new BPromise(function(_0x23df3e,_0xeef1c1){return client[_0xe049('0xc')](_0x133ea2,_0x2af216)[_0xe049('0xd')](function(_0x21e3d3){logger[_0xe049('0xe')](_0xe049('0xf'),_0x33dd06,'request\x20sent');logger[_0xe049('0x10')]('Team,\x20%s,\x20%s,\x20%s',_0x33dd06,_0xe049('0x11'),JSON['stringify'](_0x21e3d3));if(_0x21e3d3['error']){if(_0x21e3d3['error'][_0xe049('0x12')]===0x1f4){logger['error'](_0xe049('0xf'),_0x33dd06,_0x21e3d3[_0xe049('0x13')]['message']);return _0xeef1c1(_0x21e3d3[_0xe049('0x13')][_0xe049('0x14')]);}logger[_0xe049('0x13')](_0xe049('0xf'),_0x33dd06,_0x21e3d3[_0xe049('0x13')]['message']);return _0x23df3e(_0x21e3d3[_0xe049('0x13')][_0xe049('0x14')]);}else{logger[_0xe049('0xe')](_0xe049('0xf'),_0x33dd06,_0xe049('0x11'));_0x23df3e(_0x21e3d3[_0xe049('0x15')][_0xe049('0x14')]);}})[_0xe049('0x16')](function(_0x22e064){logger[_0xe049('0x13')]('Team,\x20%s,\x20%s',_0x33dd06,_0x22e064);_0xeef1c1(_0x22e064);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index c0c130b..64877e0 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 _0x4965=['length','./team.events','save','remove','removeListener'];(function(_0x470309,_0x47309a){var _0x3439eb=function(_0x594b7b){while(--_0x594b7b){_0x470309['push'](_0x470309['shift']());}};_0x3439eb(++_0x47309a);}(_0x4965,0x16e));var _0x5496=function(_0x461c2c,_0x13f720){_0x461c2c=_0x461c2c-0x0;var _0x34ce82=_0x4965[_0x461c2c];return _0x34ce82;};'use strict';var TeamEvents=require(_0x5496('0x0'));var events=[_0x5496('0x1'),_0x5496('0x2'),'update'];function createListener(_0x4bc82e,_0x5ce012){return function(_0x3111da){_0x5ce012['emit'](_0x4bc82e,_0x3111da);};}function removeListener(_0x2b3ea1,_0x1f2e5a){return function(){TeamEvents[_0x5496('0x3')](_0x2b3ea1,_0x1f2e5a);};}exports['register']=function(_0x199041){for(var _0x1d8fca=0x0,_0x378c05=events[_0x5496('0x4')];_0x1d8fca<_0x378c05;_0x1d8fca++){var _0x5c9ff5=events[_0x1d8fca];var _0x3086c8=createListener('team:'+_0x5c9ff5,_0x199041);TeamEvents['on'](_0x5c9ff5,_0x3086c8);}}; \ No newline at end of file +var _0x9d26=['register','length','team:','./team.events','remove','update','removeListener'];(function(_0x4ef949,_0x539af6){var _0x5570fd=function(_0x4330af){while(--_0x4330af){_0x4ef949['push'](_0x4ef949['shift']());}};_0x5570fd(++_0x539af6);}(_0x9d26,0x17d));var _0x69d2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9d26[_0x3dd15e];return _0x231fd0;};'use strict';var TeamEvents=require(_0x69d2('0x0'));var events=['save',_0x69d2('0x1'),_0x69d2('0x2')];function createListener(_0x321d34,_0x3c1c6d){return function(_0x44586f){_0x3c1c6d['emit'](_0x321d34,_0x44586f);};}function removeListener(_0x25fe7f,_0x53c9af){return function(){TeamEvents[_0x69d2('0x3')](_0x25fe7f,_0x53c9af);};}exports[_0x69d2('0x4')]=function(_0x433136){for(var _0x4f55b0=0x0,_0xc9b811=events[_0x69d2('0x5')];_0x4f55b0<_0xc9b811;_0x4f55b0++){var _0x24ce32=events[_0x4f55b0];var _0x3c597f=createListener(_0x69d2('0x6')+_0x24ce32,_0x433136);TeamEvents['on'](_0x24ce32,_0x3c597f);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 7b2f225..c7fb38a 100644 --- a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js +++ b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0506=['sequelize','exports','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0506,0x1d1));var _0x6050=function(_0xb458fc,_0x42f250){_0xb458fc=_0xb458fc-0x0;var _0xd8fa4f=_0x0506[_0xb458fc];return _0xd8fa4f;};'use strict';var Sequelize=require(_0x6050('0x0'));module[_0x6050('0x1')]={'TeamId':{'type':Sequelize[_0x6050('0x2')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x4ded=['sequelize','exports','INTEGER'];(function(_0x46313b,_0x1cf970){var _0x4b6453=function(_0x3d94a9){while(--_0x3d94a9){_0x46313b['push'](_0x46313b['shift']());}};_0x4b6453(++_0x1cf970);}(_0x4ded,0xf3));var _0xd4de=function(_0x5a2326,_0x3f4f23){_0x5a2326=_0x5a2326-0x0;var _0x477683=_0x4ded[_0x5a2326];return _0x477683;};'use strict';var Sequelize=require(_0xd4de('0x0'));module[_0xd4de('0x1')]={'TeamId':{'type':Sequelize[_0xd4de('0x2')]},'VoicePrefixId':{'type':Sequelize[_0xd4de('0x2')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index a5ff19b..e2e9f4f 100644 --- a/server/api/teamVoicePrefix/teamVoicePrefix.model.js +++ b/server/api/teamVoicePrefix/teamVoicePrefix.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x02a7=['TeamVoicePrefix','team_has_voice_prefixes','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./teamVoicePrefix.attributes'];(function(_0x314a4b,_0x4e6279){var _0x50cf5f=function(_0x16201e){while(--_0x16201e){_0x314a4b['push'](_0x314a4b['shift']());}};_0x50cf5f(++_0x4e6279);}(_0x02a7,0x1a6));var _0x702a=function(_0x4497c1,_0x57dabd){_0x4497c1=_0x4497c1-0x0;var _0x515417=_0x02a7[_0x4497c1];return _0x515417;};'use strict';var _=require('lodash');var util=require(_0x702a('0x0'));var logger=require(_0x702a('0x1'))(_0x702a('0x2'));var moment=require(_0x702a('0x3'));var BPromise=require(_0x702a('0x4'));var rp=require(_0x702a('0x5'));var fs=require('fs');var path=require(_0x702a('0x6'));var rimraf=require(_0x702a('0x7'));var config=require(_0x702a('0x8'));var attributes=require(_0x702a('0x9'));module['exports']=function(_0x4d3e8a,_0x804234){return _0x4d3e8a['define'](_0x702a('0xa'),attributes,{'tableName':_0x702a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x594d=['define','TeamVoicePrefix','team_has_voice_prefixes','lodash','api','moment','bluebird','path','rimraf','../../config/environment','./teamVoicePrefix.attributes'];(function(_0x2e140d,_0x2dc13a){var _0x8b8ee7=function(_0x25fe97){while(--_0x25fe97){_0x2e140d['push'](_0x2e140d['shift']());}};_0x8b8ee7(++_0x2dc13a);}(_0x594d,0x92));var _0xd594=function(_0x96e93b,_0x359e6e){_0x96e93b=_0x96e93b-0x0;var _0xe18878=_0x594d[_0x96e93b];return _0xe18878;};'use strict';var _=require(_0xd594('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd594('0x1'));var moment=require(_0xd594('0x2'));var BPromise=require(_0xd594('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd594('0x4'));var rimraf=require(_0xd594('0x5'));var config=require(_0xd594('0x6'));var attributes=require(_0xd594('0x7'));module['exports']=function(_0x3347cd,_0x498ef4){return _0x3347cd[_0xd594('0x8')](_0xd594('0x9'),attributes,{'tableName':_0xd594('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index 650d054..e710675 100644 --- a/server/api/teamVoiceQueue/index.js +++ b/server/api/teamVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x1d79c3,_0x3992a9){var _0x5ed06c=function(_0x148fec){while(--_0x148fec){_0x1d79c3['push'](_0x1d79c3['shift']());}};_0x5ed06c(++_0x3992a9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xa9e0[_0x1b828b];return _0x98da1a;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x3de2f6,_0x38351f){var _0x2b330e=function(_0x1a1995){while(--_0x1a1995){_0x3de2f6['push'](_0x3de2f6['shift']());}};_0x2b330e(++_0x38351f);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index fd41862..2d494e3 100644 --- a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js +++ b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2907=['exports','sequelize'];(function(_0x594fee,_0x494894){var _0x21c598=function(_0x28dcad){while(--_0x28dcad){_0x594fee['push'](_0x594fee['shift']());}};_0x21c598(++_0x494894);}(_0x2907,0xdb));var _0x7290=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x2907[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0x7290('0x0'));module[_0x7290('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x6084=['sequelize','exports','INTEGER'];(function(_0xb2deeb,_0xd5956a){var _0x4e84ec=function(_0x21f56f){while(--_0x21f56f){_0xb2deeb['push'](_0xb2deeb['shift']());}};_0x4e84ec(++_0xd5956a);}(_0x6084,0x1bf));var _0x4608=function(_0x33e37c,_0x303795){_0x33e37c=_0x33e37c-0x0;var _0x304490=_0x6084[_0x33e37c];return _0x304490;};'use strict';var Sequelize=require(_0x4608('0x0'));module[_0x4608('0x1')]={'penalty':{'type':Sequelize[_0x4608('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index 8d0d841..5b8a887 100644 --- a/server/api/teamVoiceQueue/teamVoiceQueue.model.js +++ b/server/api/teamVoiceQueue/teamVoiceQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x01d3=['api','moment','request-promise','path','rimraf','../../config/environment','./teamVoiceQueue.attributes','define','TeamVoiceQueue','team_has_voice_queues','../../config/logger'];(function(_0x4937b2,_0x2599cf){var _0x8da2fb=function(_0x1c875f){while(--_0x1c875f){_0x4937b2['push'](_0x4937b2['shift']());}};_0x8da2fb(++_0x2599cf);}(_0x01d3,0xdb));var _0x301d=function(_0x5bc28b,_0x5bf1a0){_0x5bc28b=_0x5bc28b-0x0;var _0x27a1d9=_0x01d3[_0x5bc28b];return _0x27a1d9;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x301d('0x0'))(_0x301d('0x1'));var moment=require(_0x301d('0x2'));var BPromise=require('bluebird');var rp=require(_0x301d('0x3'));var fs=require('fs');var path=require(_0x301d('0x4'));var rimraf=require(_0x301d('0x5'));var config=require(_0x301d('0x6'));var attributes=require(_0x301d('0x7'));module['exports']=function(_0x44f428,_0x3b1992){return _0x44f428[_0x301d('0x8')](_0x301d('0x9'),attributes,{'tableName':_0x301d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3645=['TeamVoiceQueue','team_has_voice_queues','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./teamVoiceQueue.attributes','exports','define'];(function(_0x322b83,_0x2983a5){var _0x4def44=function(_0x1821af){while(--_0x1821af){_0x322b83['push'](_0x322b83['shift']());}};_0x4def44(++_0x2983a5);}(_0x3645,0x154));var _0x5364=function(_0x3ef2d5,_0x423d46){_0x3ef2d5=_0x3ef2d5-0x0;var _0x2fefb2=_0x3645[_0x3ef2d5];return _0x2fefb2;};'use strict';var _=require('lodash');var util=require(_0x5364('0x0'));var logger=require(_0x5364('0x1'))(_0x5364('0x2'));var moment=require(_0x5364('0x3'));var BPromise=require(_0x5364('0x4'));var rp=require(_0x5364('0x5'));var fs=require('fs');var path=require(_0x5364('0x6'));var rimraf=require('rimraf');var config=require(_0x5364('0x7'));var attributes=require(_0x5364('0x8'));module[_0x5364('0x9')]=function(_0x1f9c6b,_0x417c44){return _0x1f9c6b[_0x5364('0xa')](_0x5364('0xb'),attributes,{'tableName':_0x5364('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js index 1e8e02b..8478831 100644 --- a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js +++ b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8bc8=['error','code','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../config/environment','client','then','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1e2a21,_0x2618ec){var _0x4f1dd2=function(_0x18bdea){while(--_0x18bdea){_0x1e2a21['push'](_0x1e2a21['shift']());}};_0x4f1dd2(++_0x2618ec);}(_0x8bc8,0xc4));var _0x88bc=function(_0x421e3a,_0xd69d11){_0x421e3a=_0x421e3a-0x0;var _0x3f9abd=_0x8bc8[_0x421e3a];return _0x3f9abd;};'use strict';var _=require(_0x88bc('0x0'));var util=require(_0x88bc('0x1'));var moment=require(_0x88bc('0x2'));var BPromise=require(_0x88bc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x88bc('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x88bc('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x88bc('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x461948,_0x337252,_0x30e9d7){return new BPromise(function(_0x206a6c,_0x35e7f5){return client['request'](_0x461948,_0x30e9d7)[_0x88bc('0x7')](function(_0x223dba){logger['info'](_0x88bc('0x8'),_0x337252,_0x88bc('0x9'));logger[_0x88bc('0xa')](_0x88bc('0xb'),_0x337252,_0x88bc('0x9'),JSON[_0x88bc('0xc')](_0x223dba));if(_0x223dba[_0x88bc('0xd')]){if(_0x223dba[_0x88bc('0xd')][_0x88bc('0xe')]===0x1f4){logger['error'](_0x88bc('0x8'),_0x337252,_0x223dba[_0x88bc('0xd')][_0x88bc('0xf')]);return _0x35e7f5(_0x223dba[_0x88bc('0xd')]['message']);}logger['error']('TeamVoiceQueue,\x20%s,\x20%s',_0x337252,_0x223dba[_0x88bc('0xd')][_0x88bc('0xf')]);return _0x206a6c(_0x223dba['error']['message']);}else{logger[_0x88bc('0x10')]('TeamVoiceQueue,\x20%s,\x20%s',_0x337252,_0x88bc('0x9'));_0x206a6c(_0x223dba[_0x88bc('0x11')][_0x88bc('0xf')]);}})[_0x88bc('0x12')](function(_0x2dcfa0){logger[_0x88bc('0xd')](_0x88bc('0x8'),_0x337252,_0x2dcfa0);_0x35e7f5(_0x2dcfa0);});});} \ No newline at end of file +var _0xac3d=['rpc','../../config/environment','client','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x152121,_0x120c53){var _0x592a85=function(_0x241cab){while(--_0x241cab){_0x152121['push'](_0x152121['shift']());}};_0x592a85(++_0x120c53);}(_0xac3d,0x92));var _0xdac3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xac3d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xdac3('0x0'));var util=require(_0xdac3('0x1'));var moment=require('moment');var BPromise=require(_0xdac3('0x2'));var rs=require(_0xdac3('0x3'));var fs=require('fs');var Redis=require(_0xdac3('0x4'));var db=require(_0xdac3('0x5'))['db'];var utils=require(_0xdac3('0x6'));var logger=require(_0xdac3('0x7'))(_0xdac3('0x8'));var config=require(_0xdac3('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xdac3('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1731f3,_0x4dbb07,_0x1218be){return new BPromise(function(_0xafc0f8,_0x114eba){return client['request'](_0x1731f3,_0x1218be)[_0xdac3('0xb')](function(_0x40a7ba){logger[_0xdac3('0xc')](_0xdac3('0xd'),_0x4dbb07,_0xdac3('0xe'));logger[_0xdac3('0xf')](_0xdac3('0x10'),_0x4dbb07,_0xdac3('0xe'),JSON[_0xdac3('0x11')](_0x40a7ba));if(_0x40a7ba[_0xdac3('0x12')]){if(_0x40a7ba['error'][_0xdac3('0x13')]===0x1f4){logger[_0xdac3('0x12')]('TeamVoiceQueue,\x20%s,\x20%s',_0x4dbb07,_0x40a7ba[_0xdac3('0x12')]['message']);return _0x114eba(_0x40a7ba[_0xdac3('0x12')]['message']);}logger['error'](_0xdac3('0xd'),_0x4dbb07,_0x40a7ba[_0xdac3('0x12')][_0xdac3('0x14')]);return _0xafc0f8(_0x40a7ba[_0xdac3('0x12')][_0xdac3('0x14')]);}else{logger['info'](_0xdac3('0xd'),_0x4dbb07,_0xdac3('0xe'));_0xafc0f8(_0x40a7ba[_0xdac3('0x15')][_0xdac3('0x14')]);}})['catch'](function(_0x221014){logger[_0xdac3('0x12')](_0xdac3('0xd'),_0x4dbb07,_0x221014);_0x114eba(_0x221014);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 74d4cd1..71f2449 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 _0xf417=['util','path','connect-timeout','Router','../../components/interaction/service','index','/:id','isAuthenticated','post','create','exports'];(function(_0x171ee3,_0x464088){var _0x48c7c3=function(_0x89cb4){while(--_0x89cb4){_0x171ee3['push'](_0x171ee3['shift']());}};_0x48c7c3(++_0x464088);}(_0xf417,0x8f));var _0x7f41=function(_0x3f6381,_0x518409){_0x3f6381=_0x3f6381-0x0;var _0x398bde=_0xf417[_0x3f6381];return _0x398bde;};'use strict';var multer=require('multer');var util=require(_0x7f41('0x0'));var path=require(_0x7f41('0x1'));var timeout=require(_0x7f41('0x2'));var express=require('express');var router=express[_0x7f41('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x7f41('0x4'));var config=require('../../config/environment');var controller=require('./template.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x7f41('0x5')]);router['get'](_0x7f41('0x6'),auth[_0x7f41('0x7')](),controller['show']);router[_0x7f41('0x8')]('/',auth['isAuthenticated'](),controller[_0x7f41('0x9')]);router['put'](_0x7f41('0x6'),auth[_0x7f41('0x7')](),controller['update']);router['delete'](_0x7f41('0x6'),auth['isAuthenticated'](),controller['destroy']);module[_0x7f41('0xa')]=router; \ No newline at end of file +var _0x47d6=['get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller'];(function(_0x1822e8,_0x1f2d61){var _0x298334=function(_0x53d646){while(--_0x53d646){_0x1822e8['push'](_0x1822e8['shift']());}};_0x298334(++_0x1f2d61);}(_0x47d6,0x13f));var _0x647d=function(_0x2bc56b,_0xdcc369){_0x2bc56b=_0x2bc56b-0x0;var _0x184e5b=_0x47d6[_0x2bc56b];return _0x184e5b;};'use strict';var multer=require(_0x647d('0x0'));var util=require(_0x647d('0x1'));var path=require(_0x647d('0x2'));var timeout=require(_0x647d('0x3'));var express=require(_0x647d('0x4'));var router=express[_0x647d('0x5')]();var fs_extra=require(_0x647d('0x6'));var auth=require(_0x647d('0x7'));var interaction=require(_0x647d('0x8'));var config=require(_0x647d('0x9'));var controller=require(_0x647d('0xa'));router[_0x647d('0xb')]('/',auth[_0x647d('0xc')](),controller[_0x647d('0xd')]);router[_0x647d('0xb')](_0x647d('0xe'),auth['isAuthenticated'](),controller[_0x647d('0xf')]);router[_0x647d('0x10')]('/',auth[_0x647d('0xc')](),controller[_0x647d('0x11')]);router[_0x647d('0x12')](_0x647d('0xe'),auth[_0x647d('0xc')](),controller[_0x647d('0x13')]);router[_0x647d('0x14')](_0x647d('0xe'),auth[_0x647d('0xc')](),controller[_0x647d('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 638ed3f..f86dac5 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 _0xe040=['exports','STRING','TEXT','sequelize'];(function(_0x4cced0,_0x3e15ff){var _0x31e4f4=function(_0x17581d){while(--_0x17581d){_0x4cced0['push'](_0x4cced0['shift']());}};_0x31e4f4(++_0x3e15ff);}(_0xe040,0x67));var _0x0e04=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe040[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x0e04('0x0'));module[_0x0e04('0x1')]={'name':{'type':Sequelize[_0x0e04('0x2')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0x0e04('0x3')]}}; \ No newline at end of file +var _0xe8ce=['sequelize','STRING'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xe8ce,0x104));var _0xee8c=function(_0x2ee3ae,_0x3a3fff){_0x2ee3ae=_0x2ee3ae-0x0;var _0x4ddb10=_0xe8ce[_0x2ee3ae];return _0x4ddb10;};'use strict';var Sequelize=require(_0xee8c('0x0'));module['exports']={'name':{'type':Sequelize[_0xee8c('0x1')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 0dbee19..2b17d6d 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 _0x5b09=['limit','count','set','Content-Range','apply','reject','save','then','destroy','get','Templates','UserProfileResource','error','stack','name','send','index','map','Template','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x44268d,_0xad8443){var _0x4be92d=function(_0x8a57ff){while(--_0x8a57ff){_0x44268d['push'](_0x44268d['shift']());}};_0x4be92d(++_0xad8443);}(_0x5b09,0x1ea));var _0x95b0=function(_0x27d7cd,_0x536fa4){_0x27d7cd=_0x27d7cd-0x0;var _0x58bf5e=_0x5b09[_0x27d7cd];return _0x58bf5e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x95b0('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x95b0('0x1'));var rp=require(_0x95b0('0x2'));var moment=require(_0x95b0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x95b0('0x4'));var util=require(_0x95b0('0x5'));var path=require('path');var sox=require(_0x95b0('0x6'));var csv=require('to-csv');var ejs=require(_0x95b0('0x7'));var fs=require('fs');var fs_extra=require(_0x95b0('0x8'));var _=require(_0x95b0('0x9'));var squel=require(_0x95b0('0xa'));var crypto=require(_0x95b0('0xb'));var jsforce=require(_0x95b0('0xc'));var deskjs=require(_0x95b0('0xd'));var toCsv=require(_0x95b0('0xe'));var querystring=require(_0x95b0('0xf'));var Papa=require(_0x95b0('0x10'));var Redis=require(_0x95b0('0x11'));var authService=require(_0x95b0('0x12'));var qs=require(_0x95b0('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x95b0('0x14'));var logger=require(_0x95b0('0x15'))(_0x95b0('0x16'));var utils=require(_0x95b0('0x17'));var config=require(_0x95b0('0x18'));var licenseUtil=require(_0x95b0('0x19'));var db=require(_0x95b0('0x1a'))['db'];function respondWithStatusCode(_0x4d0f42,_0x2f54be){_0x2f54be=_0x2f54be||0xcc;return function(_0x4d9114){if(_0x4d9114){return _0x4d0f42[_0x95b0('0x1b')](_0x2f54be);}return _0x4d0f42[_0x95b0('0x1c')](_0x2f54be)[_0x95b0('0x1d')]();};}function respondWithResult(_0x1a5616,_0x39b975){_0x39b975=_0x39b975||0xc8;return function(_0x50c64d){if(_0x50c64d){return _0x1a5616[_0x95b0('0x1c')](_0x39b975)[_0x95b0('0x1e')](_0x50c64d);}};}function respondWithFilteredResult(_0x2a60be,_0x1622b6){return function(_0x45d190){if(_0x45d190){var _0x35e1db=typeof _0x1622b6[_0x95b0('0x1f')]==='undefined'&&typeof _0x1622b6[_0x95b0('0x20')]==='undefined';var _0x2a9b3f=_0x45d190['count'];var _0x5114fe=_0x35e1db?0x0:_0x1622b6[_0x95b0('0x1f')];var _0x26cb58=_0x35e1db?_0x45d190[_0x95b0('0x21')]:_0x1622b6[_0x95b0('0x1f')]+_0x1622b6['limit'];var _0x150b2d;if(_0x26cb58>=_0x2a9b3f){_0x26cb58=_0x2a9b3f;_0x150b2d=0xc8;}else{_0x150b2d=0xce;}_0x2a60be['status'](_0x150b2d);return _0x2a60be[_0x95b0('0x22')](_0x95b0('0x23'),_0x5114fe+'-'+_0x26cb58+'/'+_0x2a9b3f)[_0x95b0('0x1e')](_0x45d190);}return null;};}function patchUpdates(_0x4bbd3c){return function(_0x4913fa){try{jsonpatch[_0x95b0('0x24')](_0x4913fa,_0x4bbd3c,!![]);}catch(_0x24bf63){return BPromise[_0x95b0('0x25')](_0x24bf63);}return _0x4913fa[_0x95b0('0x26')]();};}function saveUpdates(_0x4e48bc,_0x4489d9){return function(_0x5e6cb9){if(_0x5e6cb9){return _0x5e6cb9['update'](_0x4e48bc)[_0x95b0('0x27')](function(_0xfada23){return _0xfada23;});}return null;};}function removeEntity(_0x20c446,_0x5d8492){return function(_0x3abe19){if(_0x3abe19){return _0x3abe19[_0x95b0('0x28')]()[_0x95b0('0x27')](function(){var _0x57ff02=_0x3abe19[_0x95b0('0x29')]({'plain':!![]});var _0xc15b21=_0x95b0('0x2a');return db[_0x95b0('0x2b')]['destroy']({'where':{'type':_0xc15b21,'resourceId':_0x57ff02['id']}})[_0x95b0('0x27')](function(){return _0x3abe19;});})['then'](function(){_0x20c446[_0x95b0('0x1c')](0xcc)[_0x95b0('0x1d')]();});}};}function handleEntityNotFound(_0x31eeb9,_0x2c6d09){return function(_0x229f59){if(!_0x229f59){_0x31eeb9['sendStatus'](0x194);}return _0x229f59;};}function handleError(_0xa378aa,_0x5cc8f1){_0x5cc8f1=_0x5cc8f1||0x1f4;return function(_0x4635b8){logger[_0x95b0('0x2c')](_0x4635b8[_0x95b0('0x2d')]);if(_0x4635b8[_0x95b0('0x2e')]){delete _0x4635b8[_0x95b0('0x2e')];}_0xa378aa[_0x95b0('0x1c')](_0x5cc8f1)[_0x95b0('0x2f')](_0x4635b8);};}exports[_0x95b0('0x30')]=function(_0x3d6c48,_0x4a6d70){var _0x429ab6={},_0x1e2405={},_0x51b04d={'count':0x0,'rows':[]};var _0x2bcaff=_[_0x95b0('0x31')](db[_0x95b0('0x32')][_0x95b0('0x33')],function(_0x53a31f){return{'name':_0x53a31f[_0x95b0('0x34')],'type':_0x53a31f[_0x95b0('0x35')][_0x95b0('0x36')]};});_0x1e2405[_0x95b0('0x37')]=_['map'](_0x2bcaff,_0x95b0('0x2e'));_0x1e2405[_0x95b0('0x38')]=_[_0x95b0('0x39')](_0x3d6c48[_0x95b0('0x38')]);_0x1e2405[_0x95b0('0x3a')]=_[_0x95b0('0x3b')](_0x1e2405['model'],_0x1e2405[_0x95b0('0x38')]);_0x429ab6[_0x95b0('0x3c')]=_['intersection'](_0x1e2405[_0x95b0('0x37')],qs[_0x95b0('0x3d')](_0x3d6c48[_0x95b0('0x38')]['fields']));_0x429ab6[_0x95b0('0x3c')]=_0x429ab6[_0x95b0('0x3c')]['length']?_0x429ab6[_0x95b0('0x3c')]:_0x1e2405['model'];if(!_0x3d6c48['query'][_0x95b0('0x3e')]('nolimit')){_0x429ab6[_0x95b0('0x20')]=qs[_0x95b0('0x20')](_0x3d6c48[_0x95b0('0x38')][_0x95b0('0x20')]);_0x429ab6[_0x95b0('0x1f')]=qs['offset'](_0x3d6c48[_0x95b0('0x38')][_0x95b0('0x1f')]);}_0x429ab6[_0x95b0('0x3f')]=qs[_0x95b0('0x40')](_0x3d6c48[_0x95b0('0x38')]['sort']);_0x429ab6[_0x95b0('0x41')]=qs[_0x95b0('0x3a')](_[_0x95b0('0x42')](_0x3d6c48[_0x95b0('0x38')],_0x1e2405[_0x95b0('0x3a')]),_0x2bcaff);if(_0x3d6c48[_0x95b0('0x38')]['filter']){_0x429ab6[_0x95b0('0x41')]=_['merge'](_0x429ab6[_0x95b0('0x41')],{'$or':_[_0x95b0('0x31')](_0x2bcaff,function(_0xf0d006){if(_0xf0d006[_0x95b0('0x35')]!==_0x95b0('0x43')){var _0x2bd330={};_0x2bd330[_0xf0d006['name']]={'$like':'%'+_0x3d6c48['query'][_0x95b0('0x44')]+'%'};return _0x2bd330;}})});}_0x429ab6=_[_0x95b0('0x45')]({},_0x429ab6,_0x3d6c48[_0x95b0('0x46')]);var _0x5be070={'where':_0x429ab6['where']};return db[_0x95b0('0x32')][_0x95b0('0x21')](_0x5be070)[_0x95b0('0x27')](function(_0x482576){_0x51b04d[_0x95b0('0x21')]=_0x482576;if(_0x3d6c48[_0x95b0('0x38')][_0x95b0('0x47')]){_0x429ab6[_0x95b0('0x48')]=[{'all':!![]}];}return db[_0x95b0('0x32')][_0x95b0('0x49')](_0x429ab6);})[_0x95b0('0x27')](function(_0xb1821){_0x51b04d[_0x95b0('0x4a')]=_0xb1821;return _0x51b04d;})['then'](respondWithFilteredResult(_0x4a6d70,_0x429ab6))[_0x95b0('0x4b')](handleError(_0x4a6d70,null));};exports[_0x95b0('0x4c')]=function(_0x454ae5,_0x3ead4f){var _0x1f25a8={'raw':!![],'where':{'id':_0x454ae5[_0x95b0('0x4d')]['id']}},_0x259a28={};_0x259a28[_0x95b0('0x37')]=_[_0x95b0('0x39')](db['Template'][_0x95b0('0x33')]);_0x259a28['query']=_[_0x95b0('0x39')](_0x454ae5[_0x95b0('0x38')]);_0x259a28['filters']=_[_0x95b0('0x3b')](_0x259a28[_0x95b0('0x37')],_0x259a28[_0x95b0('0x38')]);_0x1f25a8[_0x95b0('0x3c')]=_['intersection'](_0x259a28[_0x95b0('0x37')],qs[_0x95b0('0x3d')](_0x454ae5[_0x95b0('0x38')][_0x95b0('0x3d')]));_0x1f25a8[_0x95b0('0x3c')]=_0x1f25a8[_0x95b0('0x3c')][_0x95b0('0x4e')]?_0x1f25a8['attributes']:_0x259a28[_0x95b0('0x37')];if(_0x454ae5[_0x95b0('0x38')][_0x95b0('0x47')]){_0x1f25a8[_0x95b0('0x48')]=[{'all':!![]}];}_0x1f25a8=_[_0x95b0('0x45')]({},_0x1f25a8,_0x454ae5[_0x95b0('0x46')]);return db[_0x95b0('0x32')][_0x95b0('0x4f')](_0x1f25a8)[_0x95b0('0x27')](handleEntityNotFound(_0x3ead4f,null))['then'](respondWithResult(_0x3ead4f,null))[_0x95b0('0x4b')](handleError(_0x3ead4f,null));};exports[_0x95b0('0x50')]=function(_0x1833e5,_0x450a6f){return db['Template']['create'](_0x1833e5[_0x95b0('0x51')],{})[_0x95b0('0x27')](function(_0x4469ed){var _0x195c90=_0x1833e5[_0x95b0('0x52')][_0x95b0('0x29')]({'plain':!![]});if(!_0x195c90)throw new Error(_0x95b0('0x53'));if(_0x195c90[_0x95b0('0x54')]===_0x95b0('0x52')){var _0x17d149=_0x4469ed[_0x95b0('0x29')]({'plain':!![]});var _0x517516=_0x95b0('0x2a');return db['UserProfileSection'][_0x95b0('0x4f')]({'where':{'name':_0x517516,'userProfileId':_0x195c90['userProfileId']},'raw':!![]})['then'](function(_0x5072b4){if(_0x5072b4&&_0x5072b4['autoAssociation']===0x0){return db[_0x95b0('0x2b')][_0x95b0('0x50')]({'name':_0x17d149[_0x95b0('0x2e')],'resourceId':_0x17d149['id'],'type':_0x5072b4['name'],'sectionId':_0x5072b4['id']},{})[_0x95b0('0x27')](function(){return _0x4469ed;});}else{return _0x4469ed;}})[_0x95b0('0x4b')](function(_0x33c692){logger['error'](_0x95b0('0x55'),_0x33c692);throw _0x33c692;});}return _0x4469ed;})[_0x95b0('0x27')](respondWithResult(_0x450a6f,0xc9))['catch'](handleError(_0x450a6f,null));};exports[_0x95b0('0x56')]=function(_0x1ab632,_0x43c503){if(_0x1ab632[_0x95b0('0x51')]['id']){delete _0x1ab632[_0x95b0('0x51')]['id'];}return db[_0x95b0('0x32')][_0x95b0('0x4f')]({'where':{'id':_0x1ab632[_0x95b0('0x4d')]['id']}})['then'](handleEntityNotFound(_0x43c503,null))[_0x95b0('0x27')](saveUpdates(_0x1ab632[_0x95b0('0x51')],null))[_0x95b0('0x27')](respondWithResult(_0x43c503,null))[_0x95b0('0x4b')](handleError(_0x43c503,null));};exports[_0x95b0('0x28')]=function(_0x3b187b,_0x17134c){return db[_0x95b0('0x32')][_0x95b0('0x4f')]({'where':{'id':_0x3b187b[_0x95b0('0x4d')]['id']}})[_0x95b0('0x27')](handleEntityNotFound(_0x17134c,null))['then'](removeEntity(_0x17134c,null))[_0x95b0('0x4b')](handleError(_0x17134c,null));}; \ No newline at end of file +var _0xef66=['path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','status','json','undefined','limit','offset','count','Content-Range','apply','save','update','then','destroy','get','Templates','UserProfileResource','sendStatus','stack','name','send','index','map','Template','rawAttributes','fieldName','type','key','model','filters','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','includeAll','include','rows','catch','show','params','keys','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x41c16c,_0x9b868a){var _0x3c5ab2=function(_0x536084){while(--_0x536084){_0x41c16c['push'](_0x41c16c['shift']());}};_0x3c5ab2(++_0x9b868a);}(_0xef66,0x148));var _0x6ef6=function(_0x4aadf6,_0x343742){_0x4aadf6=_0x4aadf6-0x0;var _0x50cbef=_0xef66[_0x4aadf6];return _0x50cbef;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6ef6('0x0'));var zipdir=require(_0x6ef6('0x1'));var jsonpatch=require(_0x6ef6('0x2'));var rp=require(_0x6ef6('0x3'));var moment=require(_0x6ef6('0x4'));var BPromise=require(_0x6ef6('0x5'));var Mustache=require(_0x6ef6('0x6'));var util=require(_0x6ef6('0x7'));var path=require(_0x6ef6('0x8'));var sox=require('sox');var csv=require(_0x6ef6('0x9'));var ejs=require(_0x6ef6('0xa'));var fs=require('fs');var fs_extra=require(_0x6ef6('0xb'));var _=require(_0x6ef6('0xc'));var squel=require(_0x6ef6('0xd'));var crypto=require(_0x6ef6('0xe'));var jsforce=require(_0x6ef6('0xf'));var deskjs=require(_0x6ef6('0x10'));var toCsv=require('to-csv');var querystring=require(_0x6ef6('0x11'));var Papa=require('papaparse');var Redis=require(_0x6ef6('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x6ef6('0x13'));var as=require(_0x6ef6('0x14'));var hardwareService=require(_0x6ef6('0x15'));var logger=require('../../config/logger')(_0x6ef6('0x16'));var utils=require('../../config/utils');var config=require(_0x6ef6('0x17'));var licenseUtil=require(_0x6ef6('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x455718,_0x2d89fd){_0x2d89fd=_0x2d89fd||0xcc;return function(_0x447608){if(_0x447608){return _0x455718['sendStatus'](_0x2d89fd);}return _0x455718[_0x6ef6('0x19')](_0x2d89fd)['end']();};}function respondWithResult(_0x4f4963,_0x4cb62b){_0x4cb62b=_0x4cb62b||0xc8;return function(_0x436d64){if(_0x436d64){return _0x4f4963[_0x6ef6('0x19')](_0x4cb62b)[_0x6ef6('0x1a')](_0x436d64);}};}function respondWithFilteredResult(_0x1f57c4,_0x84c83){return function(_0x5aa945){if(_0x5aa945){var _0x22b8f3=typeof _0x84c83['offset']===_0x6ef6('0x1b')&&typeof _0x84c83[_0x6ef6('0x1c')]===_0x6ef6('0x1b');var _0x4d94f2=_0x5aa945['count'];var _0x359839=_0x22b8f3?0x0:_0x84c83[_0x6ef6('0x1d')];var _0x57f954=_0x22b8f3?_0x5aa945[_0x6ef6('0x1e')]:_0x84c83[_0x6ef6('0x1d')]+_0x84c83[_0x6ef6('0x1c')];var _0x11f176;if(_0x57f954>=_0x4d94f2){_0x57f954=_0x4d94f2;_0x11f176=0xc8;}else{_0x11f176=0xce;}_0x1f57c4[_0x6ef6('0x19')](_0x11f176);return _0x1f57c4['set'](_0x6ef6('0x1f'),_0x359839+'-'+_0x57f954+'/'+_0x4d94f2)[_0x6ef6('0x1a')](_0x5aa945);}return null;};}function patchUpdates(_0x166395){return function(_0x182909){try{jsonpatch[_0x6ef6('0x20')](_0x182909,_0x166395,!![]);}catch(_0x14e7a7){return BPromise['reject'](_0x14e7a7);}return _0x182909[_0x6ef6('0x21')]();};}function saveUpdates(_0x45fcbc,_0x3c1f69){return function(_0x47bbcb){if(_0x47bbcb){return _0x47bbcb[_0x6ef6('0x22')](_0x45fcbc)[_0x6ef6('0x23')](function(_0x22a917){return _0x22a917;});}return null;};}function removeEntity(_0x503654,_0x4d27d7){return function(_0x1c3803){if(_0x1c3803){return _0x1c3803[_0x6ef6('0x24')]()[_0x6ef6('0x23')](function(){var _0x5c57c1=_0x1c3803[_0x6ef6('0x25')]({'plain':!![]});var _0x291da6=_0x6ef6('0x26');return db[_0x6ef6('0x27')][_0x6ef6('0x24')]({'where':{'type':_0x291da6,'resourceId':_0x5c57c1['id']}})[_0x6ef6('0x23')](function(){return _0x1c3803;});})[_0x6ef6('0x23')](function(){_0x503654[_0x6ef6('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f3c5e,_0x12a888){return function(_0xfda354){if(!_0xfda354){_0x3f3c5e[_0x6ef6('0x28')](0x194);}return _0xfda354;};}function handleError(_0x1ed6df,_0x346550){_0x346550=_0x346550||0x1f4;return function(_0x27a3d3){logger['error'](_0x27a3d3[_0x6ef6('0x29')]);if(_0x27a3d3[_0x6ef6('0x2a')]){delete _0x27a3d3[_0x6ef6('0x2a')];}_0x1ed6df[_0x6ef6('0x19')](_0x346550)[_0x6ef6('0x2b')](_0x27a3d3);};}exports[_0x6ef6('0x2c')]=function(_0x9de61c,_0x245ddd){var _0x56a164={},_0x8572d1={},_0x2bcc79={'count':0x0,'rows':[]};var _0x36c5a0=_[_0x6ef6('0x2d')](db[_0x6ef6('0x2e')][_0x6ef6('0x2f')],function(_0x2b3df2){return{'name':_0x2b3df2[_0x6ef6('0x30')],'type':_0x2b3df2[_0x6ef6('0x31')][_0x6ef6('0x32')]};});_0x8572d1[_0x6ef6('0x33')]=_[_0x6ef6('0x2d')](_0x36c5a0,_0x6ef6('0x2a'));_0x8572d1['query']=_['keys'](_0x9de61c['query']);_0x8572d1[_0x6ef6('0x34')]=_[_0x6ef6('0x35')](_0x8572d1[_0x6ef6('0x33')],_0x8572d1['query']);_0x56a164[_0x6ef6('0x36')]=_[_0x6ef6('0x35')](_0x8572d1['model'],qs[_0x6ef6('0x37')](_0x9de61c[_0x6ef6('0x38')][_0x6ef6('0x37')]));_0x56a164[_0x6ef6('0x36')]=_0x56a164[_0x6ef6('0x36')][_0x6ef6('0x39')]?_0x56a164[_0x6ef6('0x36')]:_0x8572d1[_0x6ef6('0x33')];if(!_0x9de61c[_0x6ef6('0x38')][_0x6ef6('0x3a')](_0x6ef6('0x3b'))){_0x56a164[_0x6ef6('0x1c')]=qs[_0x6ef6('0x1c')](_0x9de61c[_0x6ef6('0x38')][_0x6ef6('0x1c')]);_0x56a164[_0x6ef6('0x1d')]=qs[_0x6ef6('0x1d')](_0x9de61c['query'][_0x6ef6('0x1d')]);}_0x56a164[_0x6ef6('0x3c')]=qs[_0x6ef6('0x3d')](_0x9de61c[_0x6ef6('0x38')][_0x6ef6('0x3d')]);_0x56a164['where']=qs[_0x6ef6('0x34')](_[_0x6ef6('0x3e')](_0x9de61c[_0x6ef6('0x38')],_0x8572d1[_0x6ef6('0x34')]),_0x36c5a0);if(_0x9de61c['query']['filter']){_0x56a164[_0x6ef6('0x3f')]=_[_0x6ef6('0x40')](_0x56a164['where'],{'$or':_[_0x6ef6('0x2d')](_0x36c5a0,function(_0x2f4bad){if(_0x2f4bad[_0x6ef6('0x31')]!==_0x6ef6('0x41')){var _0x235a29={};_0x235a29[_0x2f4bad[_0x6ef6('0x2a')]]={'$like':'%'+_0x9de61c[_0x6ef6('0x38')][_0x6ef6('0x42')]+'%'};return _0x235a29;}})});}_0x56a164=_[_0x6ef6('0x40')]({},_0x56a164,_0x9de61c['options']);var _0x5f6cb2={'where':_0x56a164['where']};return db['Template'][_0x6ef6('0x1e')](_0x5f6cb2)[_0x6ef6('0x23')](function(_0x58222b){_0x2bcc79[_0x6ef6('0x1e')]=_0x58222b;if(_0x9de61c[_0x6ef6('0x38')][_0x6ef6('0x43')]){_0x56a164[_0x6ef6('0x44')]=[{'all':!![]}];}return db[_0x6ef6('0x2e')]['findAll'](_0x56a164);})[_0x6ef6('0x23')](function(_0x273970){_0x2bcc79[_0x6ef6('0x45')]=_0x273970;return _0x2bcc79;})[_0x6ef6('0x23')](respondWithFilteredResult(_0x245ddd,_0x56a164))[_0x6ef6('0x46')](handleError(_0x245ddd,null));};exports[_0x6ef6('0x47')]=function(_0x18e831,_0xc52d24){var _0x44476c={'raw':!![],'where':{'id':_0x18e831[_0x6ef6('0x48')]['id']}},_0x38f973={};_0x38f973[_0x6ef6('0x33')]=_['keys'](db[_0x6ef6('0x2e')]['rawAttributes']);_0x38f973['query']=_[_0x6ef6('0x49')](_0x18e831[_0x6ef6('0x38')]);_0x38f973['filters']=_[_0x6ef6('0x35')](_0x38f973[_0x6ef6('0x33')],_0x38f973[_0x6ef6('0x38')]);_0x44476c[_0x6ef6('0x36')]=_[_0x6ef6('0x35')](_0x38f973[_0x6ef6('0x33')],qs[_0x6ef6('0x37')](_0x18e831[_0x6ef6('0x38')][_0x6ef6('0x37')]));_0x44476c[_0x6ef6('0x36')]=_0x44476c[_0x6ef6('0x36')][_0x6ef6('0x39')]?_0x44476c[_0x6ef6('0x36')]:_0x38f973['model'];if(_0x18e831[_0x6ef6('0x38')][_0x6ef6('0x43')]){_0x44476c[_0x6ef6('0x44')]=[{'all':!![]}];}_0x44476c=_['merge']({},_0x44476c,_0x18e831[_0x6ef6('0x4a')]);return db[_0x6ef6('0x2e')][_0x6ef6('0x4b')](_0x44476c)[_0x6ef6('0x23')](handleEntityNotFound(_0xc52d24,null))[_0x6ef6('0x23')](respondWithResult(_0xc52d24,null))[_0x6ef6('0x46')](handleError(_0xc52d24,null));};exports['create']=function(_0x1a88b2,_0x38aa8b){return db[_0x6ef6('0x2e')][_0x6ef6('0x4c')](_0x1a88b2[_0x6ef6('0x4d')],{})[_0x6ef6('0x23')](function(_0x27c23f){var _0x3936e7=_0x1a88b2[_0x6ef6('0x4e')][_0x6ef6('0x25')]({'plain':!![]});if(!_0x3936e7)throw new Error(_0x6ef6('0x4f'));if(_0x3936e7[_0x6ef6('0x50')]===_0x6ef6('0x4e')){var _0xb39698=_0x27c23f[_0x6ef6('0x25')]({'plain':!![]});var _0x4389bc=_0x6ef6('0x26');return db[_0x6ef6('0x51')][_0x6ef6('0x4b')]({'where':{'name':_0x4389bc,'userProfileId':_0x3936e7['userProfileId']},'raw':!![]})['then'](function(_0x33b560){if(_0x33b560&&_0x33b560['autoAssociation']===0x0){return db[_0x6ef6('0x27')][_0x6ef6('0x4c')]({'name':_0xb39698[_0x6ef6('0x2a')],'resourceId':_0xb39698['id'],'type':_0x33b560[_0x6ef6('0x2a')],'sectionId':_0x33b560['id']},{})[_0x6ef6('0x23')](function(){return _0x27c23f;});}else{return _0x27c23f;}})[_0x6ef6('0x46')](function(_0x167e2d){logger[_0x6ef6('0x52')](_0x6ef6('0x53'),_0x167e2d);throw _0x167e2d;});}return _0x27c23f;})[_0x6ef6('0x23')](respondWithResult(_0x38aa8b,0xc9))['catch'](handleError(_0x38aa8b,null));};exports['update']=function(_0x1ca0e5,_0xaa9da7){if(_0x1ca0e5[_0x6ef6('0x4d')]['id']){delete _0x1ca0e5['body']['id'];}return db['Template'][_0x6ef6('0x4b')]({'where':{'id':_0x1ca0e5[_0x6ef6('0x48')]['id']}})['then'](handleEntityNotFound(_0xaa9da7,null))['then'](saveUpdates(_0x1ca0e5[_0x6ef6('0x4d')],null))[_0x6ef6('0x23')](respondWithResult(_0xaa9da7,null))[_0x6ef6('0x46')](handleError(_0xaa9da7,null));};exports['destroy']=function(_0xe6fe2,_0x259236){return db['Template'][_0x6ef6('0x4b')]({'where':{'id':_0xe6fe2[_0x6ef6('0x48')]['id']}})[_0x6ef6('0x23')](handleEntityNotFound(_0x259236,null))[_0x6ef6('0x23')](removeEntity(_0x259236,null))[_0x6ef6('0x46')](handleError(_0x259236,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 6c76196..fdcbe4a 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 _0xbde6=['bluebird','request-promise','path','../../config/environment','exports','Template','tools_templates','lodash','../../config/logger','api','moment'];(function(_0x23b7fa,_0x210f5d){var _0xf6f9d7=function(_0x497f44){while(--_0x497f44){_0x23b7fa['push'](_0x23b7fa['shift']());}};_0xf6f9d7(++_0x210f5d);}(_0xbde6,0xb7));var _0x6bde=function(_0xfda8c5,_0x306faa){_0xfda8c5=_0xfda8c5-0x0;var _0x33f693=_0xbde6[_0xfda8c5];return _0x33f693;};'use strict';var _=require(_0x6bde('0x0'));var util=require('util');var logger=require(_0x6bde('0x1'))(_0x6bde('0x2'));var moment=require(_0x6bde('0x3'));var BPromise=require(_0x6bde('0x4'));var rp=require(_0x6bde('0x5'));var fs=require('fs');var path=require(_0x6bde('0x6'));var rimraf=require('rimraf');var config=require(_0x6bde('0x7'));var attributes=require('./template.attributes');module[_0x6bde('0x8')]=function(_0x24257b,_0x284ff3){return _0x24257b['define'](_0x6bde('0x9'),attributes,{'tableName':_0x6bde('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x80ac=['Template','tools_templates','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./template.attributes','exports'];(function(_0x29db36,_0x410ae9){var _0x234e87=function(_0x48697b){while(--_0x48697b){_0x29db36['push'](_0x29db36['shift']());}};_0x234e87(++_0x410ae9);}(_0x80ac,0x146));var _0xc80a=function(_0x137a08,_0x3ad0be){_0x137a08=_0x137a08-0x0;var _0x42b21d=_0x80ac[_0x137a08];return _0x42b21d;};'use strict';var _=require(_0xc80a('0x0'));var util=require('util');var logger=require(_0xc80a('0x1'))('api');var moment=require(_0xc80a('0x2'));var BPromise=require(_0xc80a('0x3'));var rp=require(_0xc80a('0x4'));var fs=require('fs');var path=require(_0xc80a('0x5'));var rimraf=require(_0xc80a('0x6'));var config=require(_0xc80a('0x7'));var attributes=require(_0xc80a('0x8'));module[_0xc80a('0x9')]=function(_0x372617,_0x164b8d){return _0x372617['define'](_0xc80a('0xa'),attributes,{'tableName':_0xc80a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index 05c0398..eb9bb87 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 _0xf105=['debug','Template,\x20%s,\x20%s,\x20%s','stringify','code','Template,\x20%s,\x20%s','error','message','result','catch','GetTemplate','Template','findAll','options','raw','where','attributes','limit','include','map','model','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x1c4c1e,_0x37ae2c){var _0x308b62=function(_0x485166){while(--_0x485166){_0x1c4c1e['push'](_0x1c4c1e['shift']());}};_0x308b62(++_0x37ae2c);}(_0xf105,0x134));var _0x5f10=function(_0x463f5a,_0x5e3c8e){_0x463f5a=_0x463f5a-0x0;var _0x27f109=_0xf105[_0x463f5a];return _0x27f109;};'use strict';var _=require(_0x5f10('0x0'));var util=require('util');var moment=require(_0x5f10('0x1'));var BPromise=require(_0x5f10('0x2'));var rs=require(_0x5f10('0x3'));var fs=require('fs');var Redis=require(_0x5f10('0x4'));var db=require(_0x5f10('0x5'))['db'];var utils=require(_0x5f10('0x6'));var logger=require(_0x5f10('0x7'))('rpc');var config=require(_0x5f10('0x8'));var jayson=require(_0x5f10('0x9'));var client=jayson[_0x5f10('0xa')][_0x5f10('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2951c5,_0x183ad1,_0x3b64b1){return new BPromise(function(_0x289b58,_0x574c3a){return client[_0x5f10('0xc')](_0x2951c5,_0x3b64b1)[_0x5f10('0xd')](function(_0x1c3eba){logger[_0x5f10('0xe')]('Template,\x20%s,\x20%s',_0x183ad1,_0x5f10('0xf'));logger[_0x5f10('0x10')](_0x5f10('0x11'),_0x183ad1,_0x5f10('0xf'),JSON[_0x5f10('0x12')](_0x1c3eba));if(_0x1c3eba['error']){if(_0x1c3eba['error'][_0x5f10('0x13')]===0x1f4){logger['error'](_0x5f10('0x14'),_0x183ad1,_0x1c3eba[_0x5f10('0x15')][_0x5f10('0x16')]);return _0x574c3a(_0x1c3eba['error'][_0x5f10('0x16')]);}logger[_0x5f10('0x15')](_0x5f10('0x14'),_0x183ad1,_0x1c3eba[_0x5f10('0x15')]['message']);return _0x289b58(_0x1c3eba[_0x5f10('0x15')][_0x5f10('0x16')]);}else{logger[_0x5f10('0xe')](_0x5f10('0x14'),_0x183ad1,'request\x20sent');_0x289b58(_0x1c3eba[_0x5f10('0x17')][_0x5f10('0x16')]);}})[_0x5f10('0x18')](function(_0x40f387){logger[_0x5f10('0x15')](_0x5f10('0x14'),_0x183ad1,_0x40f387);_0x574c3a(_0x40f387);});});}exports[_0x5f10('0x19')]=function(_0x46826d){var _0x1d7295=this;return new Promise(function(_0x447c06,_0x3ede47){return db[_0x5f10('0x1a')][_0x5f10('0x1b')]({'raw':_0x46826d[_0x5f10('0x1c')]?_0x46826d[_0x5f10('0x1c')][_0x5f10('0x1d')]===undefined?!![]:![]:!![],'where':_0x46826d[_0x5f10('0x1c')]?_0x46826d[_0x5f10('0x1c')][_0x5f10('0x1e')]||null:null,'attributes':_0x46826d['options']?_0x46826d[_0x5f10('0x1c')][_0x5f10('0x1f')]||null:null,'limit':_0x46826d[_0x5f10('0x1c')]?_0x46826d[_0x5f10('0x1c')][_0x5f10('0x20')]||null:null,'include':_0x46826d[_0x5f10('0x1c')]?_0x46826d[_0x5f10('0x1c')][_0x5f10('0x21')]?_[_0x5f10('0x22')](_0x46826d[_0x5f10('0x1c')][_0x5f10('0x21')],function(_0x416ae8){return{'model':db[_0x416ae8['model']],'as':_0x416ae8['as'],'attributes':_0x416ae8[_0x5f10('0x1f')],'include':_0x416ae8[_0x5f10('0x21')]?_[_0x5f10('0x22')](_0x416ae8[_0x5f10('0x21')],function(_0x5a47c5){return{'model':db[_0x5a47c5['model']],'as':_0x5a47c5['as'],'attributes':_0x5a47c5['attributes'],'include':_0x5a47c5[_0x5f10('0x21')]?_[_0x5f10('0x22')](_0x5a47c5[_0x5f10('0x21')],function(_0x1c77f4){return{'model':db[_0x1c77f4[_0x5f10('0x23')]],'as':_0x1c77f4['as'],'attributes':_0x1c77f4['attributes']};}):[]};}):[]};}):[]:[]})[_0x5f10('0xd')](function(_0x293076){logger[_0x5f10('0xe')](_0x5f10('0x19'),_0x46826d);logger[_0x5f10('0x10')](_0x5f10('0x19'),_0x46826d,JSON[_0x5f10('0x12')](_0x293076));_0x447c06(_0x293076);})[_0x5f10('0x18')](function(_0x2aa97c){logger[_0x5f10('0x15')](_0x5f10('0x19'),_0x2aa97c[_0x5f10('0x16')],_0x46826d);_0x3ede47(_0x1d7295['error'](0x1f4,_0x2aa97c[_0x5f10('0x16')]));});});}; \ No newline at end of file +var _0xb36f=['Template,\x20%s,\x20%s','request\x20sent','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTemplate','Template','findAll','options','raw','where','attributes','limit','include','map','model','then','debug','lodash','util','moment','ioredis','../../mysqldb','rpc','../../config/environment','client','http','info'];(function(_0x1d82c4,_0x2790bb){var _0x187e54=function(_0x2498d9){while(--_0x2498d9){_0x1d82c4['push'](_0x1d82c4['shift']());}};_0x187e54(++_0x2790bb);}(_0xb36f,0x1d6));var _0xfb36=function(_0x413f39,_0x45f098){_0x413f39=_0x413f39-0x0;var _0x530f9a=_0xb36f[_0x413f39];return _0x530f9a;};'use strict';var _=require(_0xfb36('0x0'));var util=require(_0xfb36('0x1'));var moment=require(_0xfb36('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfb36('0x3'));var db=require(_0xfb36('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xfb36('0x5'));var config=require(_0xfb36('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xfb36('0x7')][_0xfb36('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x43b64b,_0x3dce9d,_0x4c1fc3){return new BPromise(function(_0x39ec36,_0x3696e2){return client['request'](_0x43b64b,_0x4c1fc3)['then'](function(_0x59da12){logger[_0xfb36('0x9')](_0xfb36('0xa'),_0x3dce9d,_0xfb36('0xb'));logger['debug'](_0xfb36('0xc'),_0x3dce9d,'request\x20sent',JSON[_0xfb36('0xd')](_0x59da12));if(_0x59da12[_0xfb36('0xe')]){if(_0x59da12[_0xfb36('0xe')][_0xfb36('0xf')]===0x1f4){logger[_0xfb36('0xe')](_0xfb36('0xa'),_0x3dce9d,_0x59da12['error'][_0xfb36('0x10')]);return _0x3696e2(_0x59da12[_0xfb36('0xe')][_0xfb36('0x10')]);}logger[_0xfb36('0xe')](_0xfb36('0xa'),_0x3dce9d,_0x59da12['error'][_0xfb36('0x10')]);return _0x39ec36(_0x59da12[_0xfb36('0xe')][_0xfb36('0x10')]);}else{logger['info'](_0xfb36('0xa'),_0x3dce9d,'request\x20sent');_0x39ec36(_0x59da12[_0xfb36('0x11')]['message']);}})[_0xfb36('0x12')](function(_0x1a1cb5){logger[_0xfb36('0xe')]('Template,\x20%s,\x20%s',_0x3dce9d,_0x1a1cb5);_0x3696e2(_0x1a1cb5);});});}exports[_0xfb36('0x13')]=function(_0x58ca4f){var _0x468d0a=this;return new Promise(function(_0x4b7d65,_0x5b0929){return db[_0xfb36('0x14')][_0xfb36('0x15')]({'raw':_0x58ca4f[_0xfb36('0x16')]?_0x58ca4f['options'][_0xfb36('0x17')]===undefined?!![]:![]:!![],'where':_0x58ca4f[_0xfb36('0x16')]?_0x58ca4f[_0xfb36('0x16')][_0xfb36('0x18')]||null:null,'attributes':_0x58ca4f[_0xfb36('0x16')]?_0x58ca4f['options'][_0xfb36('0x19')]||null:null,'limit':_0x58ca4f['options']?_0x58ca4f['options'][_0xfb36('0x1a')]||null:null,'include':_0x58ca4f[_0xfb36('0x16')]?_0x58ca4f[_0xfb36('0x16')][_0xfb36('0x1b')]?_[_0xfb36('0x1c')](_0x58ca4f[_0xfb36('0x16')][_0xfb36('0x1b')],function(_0x1a28ef){return{'model':db[_0x1a28ef[_0xfb36('0x1d')]],'as':_0x1a28ef['as'],'attributes':_0x1a28ef[_0xfb36('0x19')],'include':_0x1a28ef[_0xfb36('0x1b')]?_[_0xfb36('0x1c')](_0x1a28ef[_0xfb36('0x1b')],function(_0x47c315){return{'model':db[_0x47c315['model']],'as':_0x47c315['as'],'attributes':_0x47c315[_0xfb36('0x19')],'include':_0x47c315['include']?_['map'](_0x47c315[_0xfb36('0x1b')],function(_0x5645ab){return{'model':db[_0x5645ab[_0xfb36('0x1d')]],'as':_0x5645ab['as'],'attributes':_0x5645ab[_0xfb36('0x19')]};}):[]};}):[]};}):[]:[]})[_0xfb36('0x1e')](function(_0x168008){logger[_0xfb36('0x9')]('GetTemplate',_0x58ca4f);logger[_0xfb36('0x1f')]('GetTemplate',_0x58ca4f,JSON[_0xfb36('0xd')](_0x168008));_0x4b7d65(_0x168008);})[_0xfb36('0x12')](function(_0x2649d4){logger[_0xfb36('0xe')]('GetTemplate',_0x2649d4[_0xfb36('0x10')],_0x58ca4f);_0x5b0929(_0x468d0a[_0xfb36('0xe')](0x1f4,_0x2649d4[_0xfb36('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index a54edfb..e12cddc 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 _0xee04=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','./trigger.controller','isAuthenticated','/:id','/:id/all_conditions','getAllConditions','/:id/any_conditions','getActions','post','create','addAllCondition','addAnyCondition','/:id/actions','addAction'];(function(_0x5170ff,_0xe226b4){var _0x3ef006=function(_0x23ce0b){while(--_0x23ce0b){_0x5170ff['push'](_0x5170ff['shift']());}};_0x3ef006(++_0xe226b4);}(_0xee04,0x124));var _0x4ee0=function(_0x248f82,_0x4bc452){_0x248f82=_0x248f82-0x0;var _0x3099e6=_0xee04[_0x248f82];return _0x3099e6;};'use strict';var multer=require(_0x4ee0('0x0'));var util=require(_0x4ee0('0x1'));var path=require(_0x4ee0('0x2'));var timeout=require(_0x4ee0('0x3'));var express=require(_0x4ee0('0x4'));var router=express[_0x4ee0('0x5')]();var fs_extra=require(_0x4ee0('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4ee0('0x7'));router['get']('/',auth[_0x4ee0('0x8')](),controller['index']);router['get'](_0x4ee0('0x9'),auth[_0x4ee0('0x8')](),controller['show']);router['get'](_0x4ee0('0xa'),auth[_0x4ee0('0x8')](),controller[_0x4ee0('0xb')]);router['get'](_0x4ee0('0xc'),auth['isAuthenticated'](),controller['getAnyConditions']);router['get']('/:id/actions',auth['isAuthenticated'](),controller[_0x4ee0('0xd')]);router[_0x4ee0('0xe')]('/',auth[_0x4ee0('0x8')](),controller[_0x4ee0('0xf')]);router[_0x4ee0('0xe')](_0x4ee0('0xa'),auth['isAuthenticated'](),controller[_0x4ee0('0x10')]);router[_0x4ee0('0xe')]('/:id/any_conditions',auth[_0x4ee0('0x8')](),controller[_0x4ee0('0x11')]);router[_0x4ee0('0xe')](_0x4ee0('0x12'),auth['isAuthenticated'](),controller[_0x4ee0('0x13')]);router['put'](_0x4ee0('0x9'),auth[_0x4ee0('0x8')](),controller[_0x4ee0('0x14')]);router[_0x4ee0('0x15')](_0x4ee0('0x9'),auth[_0x4ee0('0x8')](),controller[_0x4ee0('0x16')]);module[_0x4ee0('0x17')]=router; \ No newline at end of file +var _0x8a5c=['/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','getActions','create','post','addAnyCondition','/:id/actions','addAction','put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./trigger.controller','get','index','/:id','isAuthenticated'];(function(_0x16a14c,_0x2dbe5c){var _0x12d727=function(_0x15af80){while(--_0x15af80){_0x16a14c['push'](_0x16a14c['shift']());}};_0x12d727(++_0x2dbe5c);}(_0x8a5c,0x136));var _0xc8a5=function(_0x573a76,_0xf193ac){_0x573a76=_0x573a76-0x0;var _0x1628e8=_0x8a5c[_0x573a76];return _0x1628e8;};'use strict';var multer=require(_0xc8a5('0x0'));var util=require(_0xc8a5('0x1'));var path=require(_0xc8a5('0x2'));var timeout=require(_0xc8a5('0x3'));var express=require(_0xc8a5('0x4'));var router=express[_0xc8a5('0x5')]();var fs_extra=require(_0xc8a5('0x6'));var auth=require(_0xc8a5('0x7'));var interaction=require(_0xc8a5('0x8'));var config=require('../../config/environment');var controller=require(_0xc8a5('0x9'));router[_0xc8a5('0xa')]('/',auth['isAuthenticated'](),controller[_0xc8a5('0xb')]);router[_0xc8a5('0xa')](_0xc8a5('0xc'),auth[_0xc8a5('0xd')](),controller['show']);router[_0xc8a5('0xa')](_0xc8a5('0xe'),auth[_0xc8a5('0xd')](),controller[_0xc8a5('0xf')]);router[_0xc8a5('0xa')](_0xc8a5('0x10'),auth[_0xc8a5('0xd')](),controller[_0xc8a5('0x11')]);router[_0xc8a5('0xa')]('/:id/actions',auth['isAuthenticated'](),controller[_0xc8a5('0x12')]);router['post']('/',auth[_0xc8a5('0xd')](),controller[_0xc8a5('0x13')]);router[_0xc8a5('0x14')](_0xc8a5('0xe'),auth[_0xc8a5('0xd')](),controller['addAllCondition']);router[_0xc8a5('0x14')](_0xc8a5('0x10'),auth['isAuthenticated'](),controller[_0xc8a5('0x15')]);router[_0xc8a5('0x14')](_0xc8a5('0x16'),auth[_0xc8a5('0xd')](),controller[_0xc8a5('0x17')]);router[_0xc8a5('0x18')]('/:id',auth[_0xc8a5('0xd')](),controller[_0xc8a5('0x19')]);router['delete'](_0xc8a5('0xc'),auth[_0xc8a5('0xd')](),controller['destroy']);module[_0xc8a5('0x1a')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 104ec1a..a07273f 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 _0xbca6=['sequelize','exports','STRING','BOOLEAN'];(function(_0x361ea2,_0x5cf21e){var _0x168713=function(_0x88ec2f){while(--_0x88ec2f){_0x361ea2['push'](_0x361ea2['shift']());}};_0x168713(++_0x5cf21e);}(_0xbca6,0x134));var _0x6bca=function(_0x4e0154,_0x4b7a){_0x4e0154=_0x4e0154-0x0;var _0x6dee0f=_0xbca6[_0x4e0154];return _0x6dee0f;};'use strict';var Sequelize=require(_0x6bca('0x0'));module[_0x6bca('0x1')]={'name':{'type':Sequelize[_0x6bca('0x2')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x6bca('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x95f4=['BOOLEAN','sequelize','exports','STRING'];(function(_0x519756,_0x288785){var _0x37047e=function(_0x3d64a7){while(--_0x3d64a7){_0x519756['push'](_0x519756['shift']());}};_0x37047e(++_0x288785);}(_0x95f4,0xf1));var _0x495f=function(_0x243d52,_0x347443){_0x243d52=_0x243d52-0x0;var _0x475fc6=_0x95f4[_0x243d52];return _0x475fc6;};'use strict';var Sequelize=require(_0x495f('0x0'));module[_0x495f('0x1')]={'name':{'type':Sequelize[_0x495f('0x2')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x495f('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 40c991b..0ae4a44 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 _0xb521=['fields','length','nolimit','order','where','pick','filters','filter','merge','type','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','sort','hasOwnProperty','getAnyConditions','addAction','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','then','destroy','Triggers','UserProfileResource','sendStatus','error','stack','name','send','index','Trigger','key','map','keys','query','intersection','model','attributes'];(function(_0x396276,_0x38db66){var _0x27d4de=function(_0x2eefd7){while(--_0x2eefd7){_0x396276['push'](_0x396276['shift']());}};_0x27d4de(++_0x38db66);}(_0xb521,0x19e));var _0x1b52=function(_0x12d7c5,_0x523d7f){_0x12d7c5=_0x12d7c5-0x0;var _0x123317=_0xb521[_0x12d7c5];return _0x123317;};'use strict';var emlformat=require(_0x1b52('0x0'));var rimraf=require(_0x1b52('0x1'));var zipdir=require(_0x1b52('0x2'));var jsonpatch=require(_0x1b52('0x3'));var rp=require(_0x1b52('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1b52('0x5'));var path=require(_0x1b52('0x6'));var sox=require(_0x1b52('0x7'));var csv=require(_0x1b52('0x8'));var ejs=require(_0x1b52('0x9'));var fs=require('fs');var fs_extra=require(_0x1b52('0xa'));var _=require(_0x1b52('0xb'));var squel=require(_0x1b52('0xc'));var crypto=require(_0x1b52('0xd'));var jsforce=require(_0x1b52('0xe'));var deskjs=require(_0x1b52('0xf'));var toCsv=require(_0x1b52('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1b52('0x10'));var qs=require(_0x1b52('0x11'));var as=require(_0x1b52('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1b52('0x13'))(_0x1b52('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1b52('0x15'));var db=require(_0x1b52('0x16'))['db'];function respondWithStatusCode(_0x219c6f,_0x5d05c9){_0x5d05c9=_0x5d05c9||0xcc;return function(_0x4a6714){if(_0x4a6714){return _0x219c6f['sendStatus'](_0x5d05c9);}return _0x219c6f[_0x1b52('0x17')](_0x5d05c9)[_0x1b52('0x18')]();};}function respondWithResult(_0x21e539,_0x2900c8){_0x2900c8=_0x2900c8||0xc8;return function(_0x407004){if(_0x407004){return _0x21e539[_0x1b52('0x17')](_0x2900c8)[_0x1b52('0x19')](_0x407004);}};}function respondWithFilteredResult(_0x203072,_0x3ce850){return function(_0x36ca91){if(_0x36ca91){var _0x54df35=typeof _0x3ce850[_0x1b52('0x1a')]===_0x1b52('0x1b')&&typeof _0x3ce850[_0x1b52('0x1c')]===_0x1b52('0x1b');var _0x172311=_0x36ca91['count'];var _0x2406ff=_0x54df35?0x0:_0x3ce850[_0x1b52('0x1a')];var _0x2b7dce=_0x54df35?_0x36ca91[_0x1b52('0x1d')]:_0x3ce850[_0x1b52('0x1a')]+_0x3ce850['limit'];var _0x341d1e;if(_0x2b7dce>=_0x172311){_0x2b7dce=_0x172311;_0x341d1e=0xc8;}else{_0x341d1e=0xce;}_0x203072[_0x1b52('0x17')](_0x341d1e);return _0x203072[_0x1b52('0x1e')](_0x1b52('0x1f'),_0x2406ff+'-'+_0x2b7dce+'/'+_0x172311)[_0x1b52('0x19')](_0x36ca91);}return null;};}function patchUpdates(_0x4312dd){return function(_0x2d57b6){try{jsonpatch['apply'](_0x2d57b6,_0x4312dd,!![]);}catch(_0x5e66db){return BPromise[_0x1b52('0x20')](_0x5e66db);}return _0x2d57b6['save']();};}function saveUpdates(_0x59e84f,_0x5bbedd){return function(_0x4e88b6){if(_0x4e88b6){return _0x4e88b6['update'](_0x59e84f)[_0x1b52('0x21')](function(_0x174f3f){return _0x174f3f;});}return null;};}function removeEntity(_0x19eac3,_0x323a30){return function(_0x16a007){if(_0x16a007){return _0x16a007[_0x1b52('0x22')]()[_0x1b52('0x21')](function(){var _0x19d20b=_0x16a007['get']({'plain':!![]});var _0x4ab692=_0x1b52('0x23');return db[_0x1b52('0x24')][_0x1b52('0x22')]({'where':{'type':_0x4ab692,'resourceId':_0x19d20b['id']}})[_0x1b52('0x21')](function(){return _0x16a007;});})['then'](function(){_0x19eac3[_0x1b52('0x17')](0xcc)[_0x1b52('0x18')]();});}};}function handleEntityNotFound(_0x6a1bed,_0x1ce466){return function(_0x18e375){if(!_0x18e375){_0x6a1bed[_0x1b52('0x25')](0x194);}return _0x18e375;};}function handleError(_0x5e1a43,_0x5628a9){_0x5628a9=_0x5628a9||0x1f4;return function(_0xdcc506){logger[_0x1b52('0x26')](_0xdcc506[_0x1b52('0x27')]);if(_0xdcc506[_0x1b52('0x28')]){delete _0xdcc506[_0x1b52('0x28')];}_0x5e1a43[_0x1b52('0x17')](_0x5628a9)[_0x1b52('0x29')](_0xdcc506);};}exports[_0x1b52('0x2a')]=function(_0x5bff50,_0x3b27b4){var _0x2c0df7={},_0x1d81f5={},_0x3a0b57={'count':0x0,'rows':[]};var _0x1b424a=_['map'](db[_0x1b52('0x2b')]['rawAttributes'],function(_0x397ac5){return{'name':_0x397ac5['fieldName'],'type':_0x397ac5['type'][_0x1b52('0x2c')]};});_0x1d81f5['model']=_[_0x1b52('0x2d')](_0x1b424a,_0x1b52('0x28'));_0x1d81f5['query']=_[_0x1b52('0x2e')](_0x5bff50[_0x1b52('0x2f')]);_0x1d81f5['filters']=_[_0x1b52('0x30')](_0x1d81f5[_0x1b52('0x31')],_0x1d81f5[_0x1b52('0x2f')]);_0x2c0df7[_0x1b52('0x32')]=_[_0x1b52('0x30')](_0x1d81f5[_0x1b52('0x31')],qs[_0x1b52('0x33')](_0x5bff50['query'][_0x1b52('0x33')]));_0x2c0df7[_0x1b52('0x32')]=_0x2c0df7['attributes'][_0x1b52('0x34')]?_0x2c0df7[_0x1b52('0x32')]:_0x1d81f5[_0x1b52('0x31')];if(!_0x5bff50[_0x1b52('0x2f')]['hasOwnProperty'](_0x1b52('0x35'))){_0x2c0df7[_0x1b52('0x1c')]=qs[_0x1b52('0x1c')](_0x5bff50[_0x1b52('0x2f')][_0x1b52('0x1c')]);_0x2c0df7[_0x1b52('0x1a')]=qs['offset'](_0x5bff50[_0x1b52('0x2f')]['offset']);}_0x2c0df7[_0x1b52('0x36')]=qs['sort'](_0x5bff50[_0x1b52('0x2f')]['sort']);_0x2c0df7[_0x1b52('0x37')]=qs['filters'](_[_0x1b52('0x38')](_0x5bff50[_0x1b52('0x2f')],_0x1d81f5[_0x1b52('0x39')]),_0x1b424a);if(_0x5bff50[_0x1b52('0x2f')][_0x1b52('0x3a')]){_0x2c0df7[_0x1b52('0x37')]=_[_0x1b52('0x3b')](_0x2c0df7[_0x1b52('0x37')],{'$or':_[_0x1b52('0x2d')](_0x1b424a,function(_0x316413){if(_0x316413[_0x1b52('0x3c')]!=='VIRTUAL'){var _0x1f0e16={};_0x1f0e16[_0x316413[_0x1b52('0x28')]]={'$like':'%'+_0x5bff50[_0x1b52('0x2f')]['filter']+'%'};return _0x1f0e16;}})});}_0x2c0df7=_[_0x1b52('0x3b')]({},_0x2c0df7,_0x5bff50[_0x1b52('0x3d')]);var _0x9d3cf4={'where':_0x2c0df7[_0x1b52('0x37')]};return db['Trigger']['count'](_0x9d3cf4)[_0x1b52('0x21')](function(_0x8825ab){_0x3a0b57['count']=_0x8825ab;if(_0x5bff50[_0x1b52('0x2f')]['includeAll']){_0x2c0df7[_0x1b52('0x3e')]=[{'all':!![]}];}return db[_0x1b52('0x2b')][_0x1b52('0x3f')](_0x2c0df7);})['then'](function(_0x236f34){_0x3a0b57[_0x1b52('0x40')]=_0x236f34;return _0x3a0b57;})[_0x1b52('0x21')](respondWithFilteredResult(_0x3b27b4,_0x2c0df7))[_0x1b52('0x41')](handleError(_0x3b27b4,null));};exports[_0x1b52('0x42')]=function(_0x3e9ef2,_0x157cd1){var _0x3f4c7e={'raw':![],'where':{'id':_0x3e9ef2[_0x1b52('0x43')]['id']}},_0xe41ce5={};_0xe41ce5[_0x1b52('0x31')]=_[_0x1b52('0x2e')](db['Trigger'][_0x1b52('0x44')]);_0xe41ce5['query']=_['keys'](_0x3e9ef2['query']);_0xe41ce5['filters']=_[_0x1b52('0x30')](_0xe41ce5[_0x1b52('0x31')],_0xe41ce5[_0x1b52('0x2f')]);_0x3f4c7e[_0x1b52('0x32')]=_[_0x1b52('0x30')](_0xe41ce5[_0x1b52('0x31')],qs['fields'](_0x3e9ef2[_0x1b52('0x2f')]['fields']));_0x3f4c7e[_0x1b52('0x32')]=_0x3f4c7e[_0x1b52('0x32')][_0x1b52('0x34')]?_0x3f4c7e['attributes']:_0xe41ce5[_0x1b52('0x31')];if(_0x3e9ef2[_0x1b52('0x2f')][_0x1b52('0x45')]){_0x3f4c7e['include']=[{'all':!![]}];}_0x3f4c7e=_[_0x1b52('0x3b')]({},_0x3f4c7e,_0x3e9ef2[_0x1b52('0x3d')]);return db[_0x1b52('0x2b')][_0x1b52('0x46')](_0x3f4c7e)[_0x1b52('0x21')](handleEntityNotFound(_0x157cd1,null))[_0x1b52('0x21')](respondWithResult(_0x157cd1,null))['catch'](handleError(_0x157cd1,null));};exports['create']=function(_0x1f3fe2,_0x39c829){return db[_0x1b52('0x2b')][_0x1b52('0x47')](_0x1f3fe2['body'],{})['then'](function(_0x2077c2){var _0x28c20b=_0x1f3fe2[_0x1b52('0x48')][_0x1b52('0x49')]({'plain':!![]});if(!_0x28c20b)throw new Error(_0x1b52('0x4a'));if(_0x28c20b[_0x1b52('0x4b')]==='user'){var _0xac798b=_0x2077c2['get']({'plain':!![]});var _0x3d7618=_0x1b52('0x23');return db[_0x1b52('0x4c')][_0x1b52('0x46')]({'where':{'name':_0x3d7618,'userProfileId':_0x28c20b['userProfileId']},'raw':!![]})[_0x1b52('0x21')](function(_0x84f175){if(_0x84f175&&_0x84f175['autoAssociation']===0x0){return db[_0x1b52('0x24')][_0x1b52('0x47')]({'name':_0xac798b[_0x1b52('0x28')],'resourceId':_0xac798b['id'],'type':_0x84f175['name'],'sectionId':_0x84f175['id']},{})[_0x1b52('0x21')](function(){return _0x2077c2;});}else{return _0x2077c2;}})[_0x1b52('0x41')](function(_0x8b2d8e){logger[_0x1b52('0x26')](_0x1b52('0x4d'),_0x8b2d8e);throw _0x8b2d8e;});}return _0x2077c2;})[_0x1b52('0x21')](respondWithResult(_0x39c829,0xc9))[_0x1b52('0x41')](handleError(_0x39c829,null));};exports['update']=function(_0x2bf2b3,_0x3d8214){if(_0x2bf2b3[_0x1b52('0x4e')]['id']){delete _0x2bf2b3[_0x1b52('0x4e')]['id'];}return db['Trigger']['find']({'where':{'id':_0x2bf2b3[_0x1b52('0x43')]['id']}})[_0x1b52('0x21')](handleEntityNotFound(_0x3d8214,null))[_0x1b52('0x21')](saveUpdates(_0x2bf2b3['body'],null))[_0x1b52('0x21')](respondWithResult(_0x3d8214,null))[_0x1b52('0x41')](handleError(_0x3d8214,null));};exports['destroy']=function(_0x2a853c,_0x261b92){return db['Trigger']['find']({'where':{'id':_0x2a853c['params']['id']}})[_0x1b52('0x21')](handleEntityNotFound(_0x261b92,null))[_0x1b52('0x21')](removeEntity(_0x261b92,null))[_0x1b52('0x41')](handleError(_0x261b92,null));};exports[_0x1b52('0x4f')]=function(_0x2b2f5c,_0x3db6f9,_0x16c900){if(_0x2b2f5c[_0x1b52('0x4e')]['id']){delete _0x2b2f5c[_0x1b52('0x4e')]['id'];}return db['Trigger'][_0x1b52('0x46')]({'where':{'id':_0x2b2f5c[_0x1b52('0x43')]['id']}})['then'](handleEntityNotFound(_0x3db6f9,null))[_0x1b52('0x21')](function(_0x321cc3){if(_0x321cc3){_0x2b2f5c['body'][_0x1b52('0x50')]=_0x321cc3['id'];return db[_0x1b52('0x51')][_0x1b52('0x47')](_0x2b2f5c[_0x1b52('0x4e')]);}})[_0x1b52('0x21')](respondWithResult(_0x3db6f9,null))[_0x1b52('0x41')](handleError(_0x3db6f9,null));};exports[_0x1b52('0x52')]=function(_0x56be5f,_0xff7157,_0x1be309){if(_0x56be5f[_0x1b52('0x4e')]['id']){delete _0x56be5f[_0x1b52('0x4e')]['id'];}return db[_0x1b52('0x2b')][_0x1b52('0x46')]({'where':{'id':_0x56be5f['params']['id']}})[_0x1b52('0x21')](handleEntityNotFound(_0xff7157,null))['then'](function(_0x5143a8){if(_0x5143a8){_0x56be5f[_0x1b52('0x4e')][_0x1b52('0x53')]=_0x5143a8['id'];return db['Condition'][_0x1b52('0x47')](_0x56be5f[_0x1b52('0x4e')]);}})[_0x1b52('0x21')](respondWithResult(_0xff7157,null))[_0x1b52('0x41')](handleError(_0xff7157,null));};exports[_0x1b52('0x54')]=function(_0x38bbd8,_0x1674c2,_0x3d0bee){var _0x23e22f={};var _0x4afc44={};var _0x1663df;var _0x3a5a07;return db['Trigger'][_0x1b52('0x55')]({'where':{'id':_0x38bbd8[_0x1b52('0x43')]['id']}})[_0x1b52('0x21')](handleEntityNotFound(_0x1674c2,null))['then'](function(_0x2ca434){if(_0x2ca434){_0x1663df=_0x2ca434;_0x4afc44[_0x1b52('0x31')]=_['keys'](db['Condition']['rawAttributes']);_0x4afc44[_0x1b52('0x2f')]=_[_0x1b52('0x2e')](_0x38bbd8['query']);_0x4afc44[_0x1b52('0x39')]=_['intersection'](_0x4afc44[_0x1b52('0x31')],_0x4afc44[_0x1b52('0x2f')]);_0x23e22f[_0x1b52('0x32')]=_[_0x1b52('0x30')](_0x4afc44[_0x1b52('0x31')],qs[_0x1b52('0x33')](_0x38bbd8[_0x1b52('0x2f')]['fields']));_0x23e22f[_0x1b52('0x32')]=_0x23e22f[_0x1b52('0x32')][_0x1b52('0x34')]?_0x23e22f[_0x1b52('0x32')]:_0x4afc44[_0x1b52('0x31')];_0x23e22f[_0x1b52('0x36')]=qs[_0x1b52('0x56')](_0x38bbd8[_0x1b52('0x2f')][_0x1b52('0x56')]);_0x23e22f['where']=qs[_0x1b52('0x39')](_['pick'](_0x38bbd8[_0x1b52('0x2f')],_0x4afc44[_0x1b52('0x39')]));if(_0x38bbd8[_0x1b52('0x2f')]['filter']){_0x23e22f[_0x1b52('0x37')]=_[_0x1b52('0x3b')](_0x23e22f[_0x1b52('0x37')],{'$or':_[_0x1b52('0x2d')](_0x23e22f['attributes'],function(_0x338596){var _0x3a24fd={};_0x3a24fd[_0x338596]={'$like':'%'+_0x38bbd8[_0x1b52('0x2f')][_0x1b52('0x3a')]+'%'};return _0x3a24fd;})});}_0x23e22f=_[_0x1b52('0x3b')]({},_0x23e22f,_0x38bbd8['options']);return _0x1663df[_0x1b52('0x54')](_0x23e22f);}})[_0x1b52('0x21')](function(_0x1612f7){if(_0x1612f7){_0x3a5a07=_0x1612f7[_0x1b52('0x34')];if(!_0x38bbd8[_0x1b52('0x2f')][_0x1b52('0x57')]('nolimit')){_0x23e22f[_0x1b52('0x1c')]=qs[_0x1b52('0x1c')](_0x38bbd8[_0x1b52('0x2f')][_0x1b52('0x1c')]);_0x23e22f[_0x1b52('0x1a')]=qs[_0x1b52('0x1a')](_0x38bbd8[_0x1b52('0x2f')]['offset']);}return _0x1663df[_0x1b52('0x54')](_0x23e22f);}})['then'](function(_0x1237c9){if(_0x1237c9){return _0x1237c9?{'count':_0x3a5a07,'rows':_0x1237c9}:null;}})['then'](respondWithResult(_0x1674c2,null))['catch'](handleError(_0x1674c2,null));};exports[_0x1b52('0x58')]=function(_0x184b67,_0x35f5a0,_0x4515c8){var _0x5c6dca={};var _0x17216a={};var _0x286395;var _0xc33594;return db['Trigger'][_0x1b52('0x55')]({'where':{'id':_0x184b67[_0x1b52('0x43')]['id']}})[_0x1b52('0x21')](handleEntityNotFound(_0x35f5a0,null))[_0x1b52('0x21')](function(_0x3e7560){if(_0x3e7560){_0x286395=_0x3e7560;_0x17216a[_0x1b52('0x31')]=_[_0x1b52('0x2e')](db[_0x1b52('0x51')][_0x1b52('0x44')]);_0x17216a[_0x1b52('0x2f')]=_['keys'](_0x184b67['query']);_0x17216a[_0x1b52('0x39')]=_['intersection'](_0x17216a[_0x1b52('0x31')],_0x17216a[_0x1b52('0x2f')]);_0x5c6dca[_0x1b52('0x32')]=_[_0x1b52('0x30')](_0x17216a[_0x1b52('0x31')],qs['fields'](_0x184b67[_0x1b52('0x2f')][_0x1b52('0x33')]));_0x5c6dca[_0x1b52('0x32')]=_0x5c6dca['attributes'][_0x1b52('0x34')]?_0x5c6dca[_0x1b52('0x32')]:_0x17216a[_0x1b52('0x31')];_0x5c6dca['order']=qs[_0x1b52('0x56')](_0x184b67[_0x1b52('0x2f')][_0x1b52('0x56')]);_0x5c6dca[_0x1b52('0x37')]=qs[_0x1b52('0x39')](_[_0x1b52('0x38')](_0x184b67[_0x1b52('0x2f')],_0x17216a['filters']));if(_0x184b67[_0x1b52('0x2f')][_0x1b52('0x3a')]){_0x5c6dca['where']=_['merge'](_0x5c6dca[_0x1b52('0x37')],{'$or':_[_0x1b52('0x2d')](_0x5c6dca[_0x1b52('0x32')],function(_0x39326c){var _0x30755b={};_0x30755b[_0x39326c]={'$like':'%'+_0x184b67[_0x1b52('0x2f')][_0x1b52('0x3a')]+'%'};return _0x30755b;})});}_0x5c6dca=_['merge']({},_0x5c6dca,_0x184b67[_0x1b52('0x3d')]);return _0x286395['getAnyConditions'](_0x5c6dca);}})['then'](function(_0x455528){if(_0x455528){_0xc33594=_0x455528['length'];if(!_0x184b67[_0x1b52('0x2f')][_0x1b52('0x57')]('nolimit')){_0x5c6dca[_0x1b52('0x1c')]=qs[_0x1b52('0x1c')](_0x184b67[_0x1b52('0x2f')][_0x1b52('0x1c')]);_0x5c6dca[_0x1b52('0x1a')]=qs[_0x1b52('0x1a')](_0x184b67['query'][_0x1b52('0x1a')]);}return _0x286395[_0x1b52('0x58')](_0x5c6dca);}})['then'](function(_0x59240f){if(_0x59240f){return _0x59240f?{'count':_0xc33594,'rows':_0x59240f}:null;}})[_0x1b52('0x21')](respondWithResult(_0x35f5a0,null))[_0x1b52('0x41')](handleError(_0x35f5a0,null));};exports[_0x1b52('0x59')]=function(_0x218d6f,_0x1c163f,_0x313f74){if(_0x218d6f[_0x1b52('0x4e')]['id']){delete _0x218d6f['body']['id'];}return db[_0x1b52('0x2b')][_0x1b52('0x46')]({'where':{'id':_0x218d6f['params']['id']}})['then'](handleEntityNotFound(_0x1c163f,null))[_0x1b52('0x21')](function(_0x345e8f){if(_0x345e8f){_0x218d6f[_0x1b52('0x4e')][_0x1b52('0x5a')]=_0x345e8f['id'];return db[_0x1b52('0x5b')][_0x1b52('0x47')](_0x218d6f[_0x1b52('0x4e')]);}})['then'](respondWithResult(_0x1c163f,null))[_0x1b52('0x41')](handleError(_0x1c163f,null));};exports[_0x1b52('0x5c')]=function(_0x15b0a1,_0x210fc3,_0x478f7f){var _0xc57925={};var _0x2ae95f={};var _0xa5fd12;var _0x552879;return db['Trigger'][_0x1b52('0x55')]({'where':{'id':_0x15b0a1[_0x1b52('0x43')]['id']}})[_0x1b52('0x21')](handleEntityNotFound(_0x210fc3,null))['then'](function(_0x1292f5){if(_0x1292f5){_0xa5fd12=_0x1292f5;_0x2ae95f[_0x1b52('0x31')]=_[_0x1b52('0x2e')](db[_0x1b52('0x5b')][_0x1b52('0x44')]);_0x2ae95f['query']=_[_0x1b52('0x2e')](_0x15b0a1[_0x1b52('0x2f')]);_0x2ae95f[_0x1b52('0x39')]=_[_0x1b52('0x30')](_0x2ae95f[_0x1b52('0x31')],_0x2ae95f['query']);_0xc57925['attributes']=_[_0x1b52('0x30')](_0x2ae95f[_0x1b52('0x31')],qs[_0x1b52('0x33')](_0x15b0a1[_0x1b52('0x2f')][_0x1b52('0x33')]));_0xc57925[_0x1b52('0x32')]=_0xc57925[_0x1b52('0x32')][_0x1b52('0x34')]?_0xc57925['attributes']:_0x2ae95f[_0x1b52('0x31')];_0xc57925[_0x1b52('0x36')]=qs['sort'](_0x15b0a1[_0x1b52('0x2f')]['sort']);_0xc57925[_0x1b52('0x37')]=qs[_0x1b52('0x39')](_[_0x1b52('0x38')](_0x15b0a1[_0x1b52('0x2f')],_0x2ae95f[_0x1b52('0x39')]));if(_0x15b0a1[_0x1b52('0x2f')][_0x1b52('0x3a')]){_0xc57925[_0x1b52('0x37')]=_[_0x1b52('0x3b')](_0xc57925[_0x1b52('0x37')],{'$or':_['map'](_0xc57925[_0x1b52('0x32')],function(_0xdd8af5){var _0x569ec7={};_0x569ec7[_0xdd8af5]={'$like':'%'+_0x15b0a1['query'][_0x1b52('0x3a')]+'%'};return _0x569ec7;})});}_0xc57925=_[_0x1b52('0x3b')]({},_0xc57925,_0x15b0a1[_0x1b52('0x3d')]);return _0xa5fd12[_0x1b52('0x5c')](_0xc57925);}})[_0x1b52('0x21')](function(_0x41f49a){if(_0x41f49a){_0x552879=_0x41f49a[_0x1b52('0x34')];if(!_0x15b0a1['query'][_0x1b52('0x57')](_0x1b52('0x35'))){_0xc57925[_0x1b52('0x1c')]=qs['limit'](_0x15b0a1[_0x1b52('0x2f')][_0x1b52('0x1c')]);_0xc57925[_0x1b52('0x1a')]=qs[_0x1b52('0x1a')](_0x15b0a1[_0x1b52('0x2f')][_0x1b52('0x1a')]);}return _0xa5fd12[_0x1b52('0x5c')](_0xc57925);}})['then'](function(_0x2929bd){if(_0x2929bd){return _0x2929bd?{'count':_0x552879,'rows':_0x2929bd}:null;}})[_0x1b52('0x21')](respondWithResult(_0x210fc3,null))[_0x1b52('0x41')](handleError(_0x210fc3,null));}; \ No newline at end of file +var _0x3930=['name','index','Trigger','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Triggers','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','addAllCondition','TriggerAllId','Condition','addAnyCondition','findOne','getAllConditions','getAnyConditions','addAction','TriggerId','getActions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','reject','save','destroy','then','get','UserProfileResource','end','stack'];(function(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0x3930,0xf0));var _0x0393=function(_0x2212d1,_0x483fc8){_0x2212d1=_0x2212d1-0x0;var _0x15eec5=_0x3930[_0x2212d1];return _0x15eec5;};'use strict';var emlformat=require(_0x0393('0x0'));var rimraf=require(_0x0393('0x1'));var zipdir=require(_0x0393('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0393('0x3'));var moment=require(_0x0393('0x4'));var BPromise=require(_0x0393('0x5'));var Mustache=require(_0x0393('0x6'));var util=require(_0x0393('0x7'));var path=require('path');var sox=require(_0x0393('0x8'));var csv=require(_0x0393('0x9'));var ejs=require(_0x0393('0xa'));var fs=require('fs');var fs_extra=require(_0x0393('0xb'));var _=require(_0x0393('0xc'));var squel=require(_0x0393('0xd'));var crypto=require('crypto');var jsforce=require(_0x0393('0xe'));var deskjs=require(_0x0393('0xf'));var toCsv=require(_0x0393('0x9'));var querystring=require('querystring');var Papa=require(_0x0393('0x10'));var Redis=require('ioredis');var authService=require(_0x0393('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0393('0x12'));var utils=require(_0x0393('0x13'));var config=require(_0x0393('0x14'));var licenseUtil=require(_0x0393('0x15'));var db=require(_0x0393('0x16'))['db'];function respondWithStatusCode(_0x12dfdf,_0x58ba24){_0x58ba24=_0x58ba24||0xcc;return function(_0x237914){if(_0x237914){return _0x12dfdf[_0x0393('0x17')](_0x58ba24);}return _0x12dfdf[_0x0393('0x18')](_0x58ba24)['end']();};}function respondWithResult(_0x592686,_0x4c439b){_0x4c439b=_0x4c439b||0xc8;return function(_0x4476ce){if(_0x4476ce){return _0x592686[_0x0393('0x18')](_0x4c439b)['json'](_0x4476ce);}};}function respondWithFilteredResult(_0x409f8a,_0x18181d){return function(_0x47d63f){if(_0x47d63f){var _0x47ef35=typeof _0x18181d[_0x0393('0x19')]===_0x0393('0x1a')&&typeof _0x18181d['limit']==='undefined';var _0x1f6105=_0x47d63f['count'];var _0x11d39a=_0x47ef35?0x0:_0x18181d[_0x0393('0x19')];var _0x1a9f76=_0x47ef35?_0x47d63f[_0x0393('0x1b')]:_0x18181d[_0x0393('0x19')]+_0x18181d[_0x0393('0x1c')];var _0x37e0c8;if(_0x1a9f76>=_0x1f6105){_0x1a9f76=_0x1f6105;_0x37e0c8=0xc8;}else{_0x37e0c8=0xce;}_0x409f8a[_0x0393('0x18')](_0x37e0c8);return _0x409f8a[_0x0393('0x1d')](_0x0393('0x1e'),_0x11d39a+'-'+_0x1a9f76+'/'+_0x1f6105)['json'](_0x47d63f);}return null;};}function patchUpdates(_0x207213){return function(_0xff907e){try{jsonpatch['apply'](_0xff907e,_0x207213,!![]);}catch(_0x104a04){return BPromise[_0x0393('0x1f')](_0x104a04);}return _0xff907e[_0x0393('0x20')]();};}function saveUpdates(_0x1f7797,_0x187449){return function(_0xf3442d){if(_0xf3442d){return _0xf3442d['update'](_0x1f7797)['then'](function(_0x153dc8){return _0x153dc8;});}return null;};}function removeEntity(_0x5cca81,_0xbaa95f){return function(_0x28c8ad){if(_0x28c8ad){return _0x28c8ad[_0x0393('0x21')]()[_0x0393('0x22')](function(){var _0x362888=_0x28c8ad[_0x0393('0x23')]({'plain':!![]});var _0x432f07='Triggers';return db[_0x0393('0x24')]['destroy']({'where':{'type':_0x432f07,'resourceId':_0x362888['id']}})[_0x0393('0x22')](function(){return _0x28c8ad;});})['then'](function(){_0x5cca81['status'](0xcc)[_0x0393('0x25')]();});}};}function handleEntityNotFound(_0x49df97,_0x36816c){return function(_0x1f458c){if(!_0x1f458c){_0x49df97['sendStatus'](0x194);}return _0x1f458c;};}function handleError(_0x57cbf0,_0x2a4e8b){_0x2a4e8b=_0x2a4e8b||0x1f4;return function(_0x3ebbc2){logger['error'](_0x3ebbc2[_0x0393('0x26')]);if(_0x3ebbc2[_0x0393('0x27')]){delete _0x3ebbc2[_0x0393('0x27')];}_0x57cbf0[_0x0393('0x18')](_0x2a4e8b)['send'](_0x3ebbc2);};}exports[_0x0393('0x28')]=function(_0x91c31d,_0x55705c){var _0x4df88c={},_0x5a5066={},_0x5a5f78={'count':0x0,'rows':[]};var _0x117a04=_['map'](db[_0x0393('0x29')]['rawAttributes'],function(_0x234a60){return{'name':_0x234a60[_0x0393('0x2a')],'type':_0x234a60[_0x0393('0x2b')][_0x0393('0x2c')]};});_0x5a5066[_0x0393('0x2d')]=_[_0x0393('0x2e')](_0x117a04,_0x0393('0x27'));_0x5a5066[_0x0393('0x2f')]=_[_0x0393('0x30')](_0x91c31d[_0x0393('0x2f')]);_0x5a5066[_0x0393('0x31')]=_[_0x0393('0x32')](_0x5a5066[_0x0393('0x2d')],_0x5a5066[_0x0393('0x2f')]);_0x4df88c[_0x0393('0x33')]=_[_0x0393('0x32')](_0x5a5066[_0x0393('0x2d')],qs[_0x0393('0x34')](_0x91c31d[_0x0393('0x2f')][_0x0393('0x34')]));_0x4df88c[_0x0393('0x33')]=_0x4df88c[_0x0393('0x33')][_0x0393('0x35')]?_0x4df88c['attributes']:_0x5a5066[_0x0393('0x2d')];if(!_0x91c31d[_0x0393('0x2f')][_0x0393('0x36')](_0x0393('0x37'))){_0x4df88c[_0x0393('0x1c')]=qs[_0x0393('0x1c')](_0x91c31d[_0x0393('0x2f')][_0x0393('0x1c')]);_0x4df88c[_0x0393('0x19')]=qs[_0x0393('0x19')](_0x91c31d[_0x0393('0x2f')][_0x0393('0x19')]);}_0x4df88c[_0x0393('0x38')]=qs[_0x0393('0x39')](_0x91c31d[_0x0393('0x2f')][_0x0393('0x39')]);_0x4df88c[_0x0393('0x3a')]=qs[_0x0393('0x31')](_[_0x0393('0x3b')](_0x91c31d[_0x0393('0x2f')],_0x5a5066['filters']),_0x117a04);if(_0x91c31d[_0x0393('0x2f')][_0x0393('0x3c')]){_0x4df88c[_0x0393('0x3a')]=_[_0x0393('0x3d')](_0x4df88c[_0x0393('0x3a')],{'$or':_['map'](_0x117a04,function(_0x3c6870){if(_0x3c6870[_0x0393('0x2b')]!==_0x0393('0x3e')){var _0x420fa8={};_0x420fa8[_0x3c6870['name']]={'$like':'%'+_0x91c31d['query']['filter']+'%'};return _0x420fa8;}})});}_0x4df88c=_['merge']({},_0x4df88c,_0x91c31d[_0x0393('0x3f')]);var _0x4cab64={'where':_0x4df88c[_0x0393('0x3a')]};return db[_0x0393('0x29')][_0x0393('0x1b')](_0x4cab64)[_0x0393('0x22')](function(_0x553dc6){_0x5a5f78[_0x0393('0x1b')]=_0x553dc6;if(_0x91c31d[_0x0393('0x2f')][_0x0393('0x40')]){_0x4df88c[_0x0393('0x41')]=[{'all':!![]}];}return db[_0x0393('0x29')][_0x0393('0x42')](_0x4df88c);})['then'](function(_0x9e343c){_0x5a5f78[_0x0393('0x43')]=_0x9e343c;return _0x5a5f78;})['then'](respondWithFilteredResult(_0x55705c,_0x4df88c))[_0x0393('0x44')](handleError(_0x55705c,null));};exports[_0x0393('0x45')]=function(_0x555cc9,_0x4fa4dc){var _0x2d9be9={'raw':![],'where':{'id':_0x555cc9['params']['id']}},_0xec205d={};_0xec205d[_0x0393('0x2d')]=_[_0x0393('0x30')](db[_0x0393('0x29')][_0x0393('0x46')]);_0xec205d[_0x0393('0x2f')]=_[_0x0393('0x30')](_0x555cc9[_0x0393('0x2f')]);_0xec205d['filters']=_[_0x0393('0x32')](_0xec205d[_0x0393('0x2d')],_0xec205d[_0x0393('0x2f')]);_0x2d9be9[_0x0393('0x33')]=_[_0x0393('0x32')](_0xec205d[_0x0393('0x2d')],qs[_0x0393('0x34')](_0x555cc9[_0x0393('0x2f')][_0x0393('0x34')]));_0x2d9be9[_0x0393('0x33')]=_0x2d9be9['attributes']['length']?_0x2d9be9['attributes']:_0xec205d[_0x0393('0x2d')];if(_0x555cc9[_0x0393('0x2f')][_0x0393('0x40')]){_0x2d9be9[_0x0393('0x41')]=[{'all':!![]}];}_0x2d9be9=_[_0x0393('0x3d')]({},_0x2d9be9,_0x555cc9['options']);return db[_0x0393('0x29')]['find'](_0x2d9be9)['then'](handleEntityNotFound(_0x4fa4dc,null))[_0x0393('0x22')](respondWithResult(_0x4fa4dc,null))['catch'](handleError(_0x4fa4dc,null));};exports[_0x0393('0x47')]=function(_0x3235ac,_0x4f795b){return db[_0x0393('0x29')][_0x0393('0x47')](_0x3235ac[_0x0393('0x48')],{})['then'](function(_0xad409){var _0x38187a=_0x3235ac['user']['get']({'plain':!![]});if(!_0x38187a)throw new Error(_0x0393('0x49'));if(_0x38187a['role']===_0x0393('0x4a')){var _0x196db3=_0xad409['get']({'plain':!![]});var _0x4100b0=_0x0393('0x4b');return db['UserProfileSection'][_0x0393('0x4c')]({'where':{'name':_0x4100b0,'userProfileId':_0x38187a[_0x0393('0x4d')]},'raw':!![]})[_0x0393('0x22')](function(_0x7be2db){if(_0x7be2db&&_0x7be2db[_0x0393('0x4e')]===0x0){return db[_0x0393('0x24')][_0x0393('0x47')]({'name':_0x196db3['name'],'resourceId':_0x196db3['id'],'type':_0x7be2db[_0x0393('0x27')],'sectionId':_0x7be2db['id']},{})[_0x0393('0x22')](function(){return _0xad409;});}else{return _0xad409;}})[_0x0393('0x44')](function(_0xb73005){logger[_0x0393('0x4f')](_0x0393('0x50'),_0xb73005);throw _0xb73005;});}return _0xad409;})[_0x0393('0x22')](respondWithResult(_0x4f795b,0xc9))[_0x0393('0x44')](handleError(_0x4f795b,null));};exports[_0x0393('0x51')]=function(_0x3157fb,_0x3e9d58){if(_0x3157fb['body']['id']){delete _0x3157fb[_0x0393('0x48')]['id'];}return db[_0x0393('0x29')]['find']({'where':{'id':_0x3157fb[_0x0393('0x52')]['id']}})[_0x0393('0x22')](handleEntityNotFound(_0x3e9d58,null))[_0x0393('0x22')](saveUpdates(_0x3157fb[_0x0393('0x48')],null))[_0x0393('0x22')](respondWithResult(_0x3e9d58,null))['catch'](handleError(_0x3e9d58,null));};exports[_0x0393('0x21')]=function(_0x4eeda1,_0x3cbf99){return db['Trigger'][_0x0393('0x4c')]({'where':{'id':_0x4eeda1[_0x0393('0x52')]['id']}})['then'](handleEntityNotFound(_0x3cbf99,null))['then'](removeEntity(_0x3cbf99,null))['catch'](handleError(_0x3cbf99,null));};exports[_0x0393('0x53')]=function(_0x1c54b5,_0x3eaa11,_0xb58f92){if(_0x1c54b5[_0x0393('0x48')]['id']){delete _0x1c54b5[_0x0393('0x48')]['id'];}return db[_0x0393('0x29')][_0x0393('0x4c')]({'where':{'id':_0x1c54b5[_0x0393('0x52')]['id']}})[_0x0393('0x22')](handleEntityNotFound(_0x3eaa11,null))[_0x0393('0x22')](function(_0xa286b5){if(_0xa286b5){_0x1c54b5['body'][_0x0393('0x54')]=_0xa286b5['id'];return db[_0x0393('0x55')][_0x0393('0x47')](_0x1c54b5[_0x0393('0x48')]);}})['then'](respondWithResult(_0x3eaa11,null))[_0x0393('0x44')](handleError(_0x3eaa11,null));};exports[_0x0393('0x56')]=function(_0x116854,_0x5b3bb1,_0x496a3c){if(_0x116854[_0x0393('0x48')]['id']){delete _0x116854['body']['id'];}return db[_0x0393('0x29')][_0x0393('0x4c')]({'where':{'id':_0x116854[_0x0393('0x52')]['id']}})['then'](handleEntityNotFound(_0x5b3bb1,null))[_0x0393('0x22')](function(_0x308463){if(_0x308463){_0x116854['body']['TriggerAnyId']=_0x308463['id'];return db['Condition'][_0x0393('0x47')](_0x116854[_0x0393('0x48')]);}})['then'](respondWithResult(_0x5b3bb1,null))['catch'](handleError(_0x5b3bb1,null));};exports['getAllConditions']=function(_0xa23eff,_0x416f3f,_0x13cf5d){var _0x27401b={};var _0x393fa2={};var _0x242231;var _0x5c4c94;return db[_0x0393('0x29')][_0x0393('0x57')]({'where':{'id':_0xa23eff[_0x0393('0x52')]['id']}})[_0x0393('0x22')](handleEntityNotFound(_0x416f3f,null))[_0x0393('0x22')](function(_0x42696e){if(_0x42696e){_0x242231=_0x42696e;_0x393fa2[_0x0393('0x2d')]=_[_0x0393('0x30')](db['Condition'][_0x0393('0x46')]);_0x393fa2[_0x0393('0x2f')]=_[_0x0393('0x30')](_0xa23eff['query']);_0x393fa2[_0x0393('0x31')]=_['intersection'](_0x393fa2[_0x0393('0x2d')],_0x393fa2['query']);_0x27401b['attributes']=_[_0x0393('0x32')](_0x393fa2['model'],qs[_0x0393('0x34')](_0xa23eff[_0x0393('0x2f')][_0x0393('0x34')]));_0x27401b[_0x0393('0x33')]=_0x27401b['attributes'][_0x0393('0x35')]?_0x27401b[_0x0393('0x33')]:_0x393fa2[_0x0393('0x2d')];_0x27401b['order']=qs[_0x0393('0x39')](_0xa23eff[_0x0393('0x2f')]['sort']);_0x27401b[_0x0393('0x3a')]=qs[_0x0393('0x31')](_[_0x0393('0x3b')](_0xa23eff[_0x0393('0x2f')],_0x393fa2[_0x0393('0x31')]));if(_0xa23eff['query'][_0x0393('0x3c')]){_0x27401b[_0x0393('0x3a')]=_[_0x0393('0x3d')](_0x27401b[_0x0393('0x3a')],{'$or':_[_0x0393('0x2e')](_0x27401b['attributes'],function(_0x56914d){var _0x2fa6a5={};_0x2fa6a5[_0x56914d]={'$like':'%'+_0xa23eff[_0x0393('0x2f')][_0x0393('0x3c')]+'%'};return _0x2fa6a5;})});}_0x27401b=_[_0x0393('0x3d')]({},_0x27401b,_0xa23eff[_0x0393('0x3f')]);return _0x242231[_0x0393('0x58')](_0x27401b);}})[_0x0393('0x22')](function(_0x5a0a6b){if(_0x5a0a6b){_0x5c4c94=_0x5a0a6b[_0x0393('0x35')];if(!_0xa23eff[_0x0393('0x2f')][_0x0393('0x36')]('nolimit')){_0x27401b['limit']=qs[_0x0393('0x1c')](_0xa23eff[_0x0393('0x2f')][_0x0393('0x1c')]);_0x27401b['offset']=qs[_0x0393('0x19')](_0xa23eff[_0x0393('0x2f')][_0x0393('0x19')]);}return _0x242231[_0x0393('0x58')](_0x27401b);}})[_0x0393('0x22')](function(_0x5ec594){if(_0x5ec594){return _0x5ec594?{'count':_0x5c4c94,'rows':_0x5ec594}:null;}})[_0x0393('0x22')](respondWithResult(_0x416f3f,null))[_0x0393('0x44')](handleError(_0x416f3f,null));};exports[_0x0393('0x59')]=function(_0x4d1763,_0x5ea563,_0x254ff7){var _0x24ca6b={};var _0x20557e={};var _0x22c723;var _0x33eaa2;return db['Trigger']['findOne']({'where':{'id':_0x4d1763[_0x0393('0x52')]['id']}})[_0x0393('0x22')](handleEntityNotFound(_0x5ea563,null))['then'](function(_0x4591e6){if(_0x4591e6){_0x22c723=_0x4591e6;_0x20557e['model']=_[_0x0393('0x30')](db[_0x0393('0x55')][_0x0393('0x46')]);_0x20557e[_0x0393('0x2f')]=_[_0x0393('0x30')](_0x4d1763[_0x0393('0x2f')]);_0x20557e[_0x0393('0x31')]=_[_0x0393('0x32')](_0x20557e[_0x0393('0x2d')],_0x20557e[_0x0393('0x2f')]);_0x24ca6b[_0x0393('0x33')]=_[_0x0393('0x32')](_0x20557e[_0x0393('0x2d')],qs['fields'](_0x4d1763[_0x0393('0x2f')][_0x0393('0x34')]));_0x24ca6b[_0x0393('0x33')]=_0x24ca6b[_0x0393('0x33')][_0x0393('0x35')]?_0x24ca6b[_0x0393('0x33')]:_0x20557e[_0x0393('0x2d')];_0x24ca6b['order']=qs[_0x0393('0x39')](_0x4d1763['query'][_0x0393('0x39')]);_0x24ca6b['where']=qs['filters'](_['pick'](_0x4d1763['query'],_0x20557e[_0x0393('0x31')]));if(_0x4d1763[_0x0393('0x2f')]['filter']){_0x24ca6b[_0x0393('0x3a')]=_[_0x0393('0x3d')](_0x24ca6b[_0x0393('0x3a')],{'$or':_[_0x0393('0x2e')](_0x24ca6b[_0x0393('0x33')],function(_0x3959aa){var _0x4a5b1b={};_0x4a5b1b[_0x3959aa]={'$like':'%'+_0x4d1763[_0x0393('0x2f')][_0x0393('0x3c')]+'%'};return _0x4a5b1b;})});}_0x24ca6b=_[_0x0393('0x3d')]({},_0x24ca6b,_0x4d1763[_0x0393('0x3f')]);return _0x22c723[_0x0393('0x59')](_0x24ca6b);}})[_0x0393('0x22')](function(_0xff5142){if(_0xff5142){_0x33eaa2=_0xff5142[_0x0393('0x35')];if(!_0x4d1763[_0x0393('0x2f')][_0x0393('0x36')](_0x0393('0x37'))){_0x24ca6b[_0x0393('0x1c')]=qs[_0x0393('0x1c')](_0x4d1763[_0x0393('0x2f')][_0x0393('0x1c')]);_0x24ca6b[_0x0393('0x19')]=qs[_0x0393('0x19')](_0x4d1763[_0x0393('0x2f')][_0x0393('0x19')]);}return _0x22c723[_0x0393('0x59')](_0x24ca6b);}})[_0x0393('0x22')](function(_0x5c6e18){if(_0x5c6e18){return _0x5c6e18?{'count':_0x33eaa2,'rows':_0x5c6e18}:null;}})[_0x0393('0x22')](respondWithResult(_0x5ea563,null))[_0x0393('0x44')](handleError(_0x5ea563,null));};exports[_0x0393('0x5a')]=function(_0x2ad6b5,_0x559676,_0x5e1881){if(_0x2ad6b5[_0x0393('0x48')]['id']){delete _0x2ad6b5[_0x0393('0x48')]['id'];}return db['Trigger'][_0x0393('0x4c')]({'where':{'id':_0x2ad6b5[_0x0393('0x52')]['id']}})[_0x0393('0x22')](handleEntityNotFound(_0x559676,null))['then'](function(_0x33e483){if(_0x33e483){_0x2ad6b5['body'][_0x0393('0x5b')]=_0x33e483['id'];return db['Action'][_0x0393('0x47')](_0x2ad6b5[_0x0393('0x48')]);}})[_0x0393('0x22')](respondWithResult(_0x559676,null))[_0x0393('0x44')](handleError(_0x559676,null));};exports['getActions']=function(_0x3303db,_0x2bd461,_0x4dc700){var _0x3047e8={};var _0x2abb1c={};var _0x304385;var _0x1f0ade;return db[_0x0393('0x29')]['findOne']({'where':{'id':_0x3303db[_0x0393('0x52')]['id']}})[_0x0393('0x22')](handleEntityNotFound(_0x2bd461,null))['then'](function(_0x2e889d){if(_0x2e889d){_0x304385=_0x2e889d;_0x2abb1c['model']=_[_0x0393('0x30')](db['Action'][_0x0393('0x46')]);_0x2abb1c['query']=_[_0x0393('0x30')](_0x3303db[_0x0393('0x2f')]);_0x2abb1c[_0x0393('0x31')]=_['intersection'](_0x2abb1c[_0x0393('0x2d')],_0x2abb1c['query']);_0x3047e8[_0x0393('0x33')]=_[_0x0393('0x32')](_0x2abb1c[_0x0393('0x2d')],qs[_0x0393('0x34')](_0x3303db[_0x0393('0x2f')][_0x0393('0x34')]));_0x3047e8['attributes']=_0x3047e8[_0x0393('0x33')][_0x0393('0x35')]?_0x3047e8[_0x0393('0x33')]:_0x2abb1c[_0x0393('0x2d')];_0x3047e8[_0x0393('0x38')]=qs[_0x0393('0x39')](_0x3303db[_0x0393('0x2f')][_0x0393('0x39')]);_0x3047e8[_0x0393('0x3a')]=qs[_0x0393('0x31')](_[_0x0393('0x3b')](_0x3303db[_0x0393('0x2f')],_0x2abb1c['filters']));if(_0x3303db['query']['filter']){_0x3047e8[_0x0393('0x3a')]=_['merge'](_0x3047e8['where'],{'$or':_[_0x0393('0x2e')](_0x3047e8[_0x0393('0x33')],function(_0x1857de){var _0x21a763={};_0x21a763[_0x1857de]={'$like':'%'+_0x3303db['query'][_0x0393('0x3c')]+'%'};return _0x21a763;})});}_0x3047e8=_[_0x0393('0x3d')]({},_0x3047e8,_0x3303db[_0x0393('0x3f')]);return _0x304385[_0x0393('0x5c')](_0x3047e8);}})[_0x0393('0x22')](function(_0x46d6b9){if(_0x46d6b9){_0x1f0ade=_0x46d6b9[_0x0393('0x35')];if(!_0x3303db[_0x0393('0x2f')][_0x0393('0x36')]('nolimit')){_0x3047e8[_0x0393('0x1c')]=qs[_0x0393('0x1c')](_0x3303db[_0x0393('0x2f')]['limit']);_0x3047e8[_0x0393('0x19')]=qs['offset'](_0x3303db[_0x0393('0x2f')][_0x0393('0x19')]);}return _0x304385[_0x0393('0x5c')](_0x3047e8);}})[_0x0393('0x22')](function(_0x23b09b){if(_0x23b09b){return _0x23b09b?{'count':_0x1f0ade,'rows':_0x23b09b}:null;}})[_0x0393('0x22')](respondWithResult(_0x2bd461,null))[_0x0393('0x44')](handleError(_0x2bd461,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 0e435dd..d7074eb 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 _0x0b40=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','tools_triggers','util'];(function(_0x1c90cf,_0x1b1693){var _0x4551b6=function(_0x2e0877){while(--_0x2e0877){_0x1c90cf['push'](_0x1c90cf['shift']());}};_0x4551b6(++_0x1b1693);}(_0x0b40,0xba));var _0x00b4=function(_0x5b7788,_0x309ae5){_0x5b7788=_0x5b7788-0x0;var _0x573871=_0x0b40[_0x5b7788];return _0x573871;};'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('./trigger.attributes');module[_0x00b4('0x8')]=function(_0xbcf545,_0x2c44d1){return _0xbcf545[_0x00b4('0x9')]('Trigger',attributes,{'tableName':_0x00b4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5292=['bluebird','request-promise','path','rimraf','./trigger.attributes','define','Trigger','lodash','util','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5292,0xf7));var _0x2529=function(_0x28ca99,_0x4e900b){_0x28ca99=_0x28ca99-0x0;var _0x57b650=_0x5292[_0x28ca99];return _0x57b650;};'use strict';var _=require(_0x2529('0x0'));var util=require(_0x2529('0x1'));var logger=require('../../config/logger')(_0x2529('0x2'));var moment=require('moment');var BPromise=require(_0x2529('0x3'));var rp=require(_0x2529('0x4'));var fs=require('fs');var path=require(_0x2529('0x5'));var rimraf=require(_0x2529('0x6'));var config=require('../../config/environment');var attributes=require(_0x2529('0x7'));module['exports']=function(_0x4c9b4c,_0x4e7a9e){return _0x4c9b4c[_0x2529('0x8')](_0x2529('0x9'),attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trigger/trigger.rpc.js b/server/api/trigger/trigger.rpc.js index 46bac4d..28d9c3d 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 _0xc98f=['include','model','attributes','then','ShowTrigger','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','Trigger,\x20%s,\x20%s','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','GetTrigger','Trigger','findAll','options','where','limit','map'];(function(_0x40230d,_0x17f672){var _0x1f1d98=function(_0x9369b3){while(--_0x9369b3){_0x40230d['push'](_0x40230d['shift']());}};_0x1f1d98(++_0x17f672);}(_0xc98f,0x191));var _0xfc98=function(_0xa5f623,_0x423b68){_0xa5f623=_0xa5f623-0x0;var _0x3aea53=_0xc98f[_0xa5f623];return _0x3aea53;};'use strict';var _=require(_0xfc98('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xfc98('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfc98('0x2'));var db=require(_0xfc98('0x3'))['db'];var utils=require(_0xfc98('0x4'));var logger=require(_0xfc98('0x5'))(_0xfc98('0x6'));var config=require(_0xfc98('0x7'));var jayson=require(_0xfc98('0x8'));var client=jayson[_0xfc98('0x9')][_0xfc98('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x39e9bb,_0x590413,_0x4d1616){return new BPromise(function(_0x8fb2e4,_0x5b950c){return client[_0xfc98('0xb')](_0x39e9bb,_0x4d1616)['then'](function(_0x4281b2){logger['info'](_0xfc98('0xc'),_0x590413,'request\x20sent');logger[_0xfc98('0xd')](_0xfc98('0xe'),_0x590413,'request\x20sent',JSON[_0xfc98('0xf')](_0x4281b2));if(_0x4281b2[_0xfc98('0x10')]){if(_0x4281b2['error']['code']===0x1f4){logger[_0xfc98('0x10')](_0xfc98('0xc'),_0x590413,_0x4281b2[_0xfc98('0x10')][_0xfc98('0x11')]);return _0x5b950c(_0x4281b2['error'][_0xfc98('0x11')]);}logger[_0xfc98('0x10')](_0xfc98('0xc'),_0x590413,_0x4281b2[_0xfc98('0x10')][_0xfc98('0x11')]);return _0x8fb2e4(_0x4281b2[_0xfc98('0x10')][_0xfc98('0x11')]);}else{logger[_0xfc98('0x12')](_0xfc98('0xc'),_0x590413,'request\x20sent');_0x8fb2e4(_0x4281b2[_0xfc98('0x13')][_0xfc98('0x11')]);}})[_0xfc98('0x14')](function(_0x38269c){logger['error'](_0xfc98('0xc'),_0x590413,_0x38269c);_0x5b950c(_0x38269c);});});}exports[_0xfc98('0x15')]=function(_0x9d2a84){var _0x13508d=this;return new Promise(function(_0x4919be,_0x199dbe){return db[_0xfc98('0x16')][_0xfc98('0x17')]({'raw':_0x9d2a84[_0xfc98('0x18')]?_0x9d2a84[_0xfc98('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x9d2a84[_0xfc98('0x18')]?_0x9d2a84[_0xfc98('0x18')][_0xfc98('0x19')]||null:null,'attributes':_0x9d2a84['options']?_0x9d2a84[_0xfc98('0x18')]['attributes']||null:null,'limit':_0x9d2a84[_0xfc98('0x18')]?_0x9d2a84['options'][_0xfc98('0x1a')]||null:null,'include':_0x9d2a84[_0xfc98('0x18')]?_0x9d2a84[_0xfc98('0x18')]['include']?_[_0xfc98('0x1b')](_0x9d2a84[_0xfc98('0x18')][_0xfc98('0x1c')],function(_0x2157cc){return{'model':db[_0x2157cc[_0xfc98('0x1d')]],'as':_0x2157cc['as'],'attributes':_0x2157cc[_0xfc98('0x1e')],'include':_0x2157cc[_0xfc98('0x1c')]?_['map'](_0x2157cc[_0xfc98('0x1c')],function(_0x380a01){return{'model':db[_0x380a01[_0xfc98('0x1d')]],'as':_0x380a01['as'],'attributes':_0x380a01[_0xfc98('0x1e')],'include':_0x380a01[_0xfc98('0x1c')]?_[_0xfc98('0x1b')](_0x380a01[_0xfc98('0x1c')],function(_0x45954e){return{'model':db[_0x45954e[_0xfc98('0x1d')]],'as':_0x45954e['as'],'attributes':_0x45954e['attributes']};}):[]};}):[]};}):[]:[]})[_0xfc98('0x1f')](function(_0x27a137){logger[_0xfc98('0x12')](_0xfc98('0x15'),_0x9d2a84);logger[_0xfc98('0xd')]('GetTrigger',_0x9d2a84,JSON['stringify'](_0x27a137));_0x4919be(_0x27a137);})[_0xfc98('0x14')](function(_0x2e24ef){logger['error'](_0xfc98('0x15'),_0x2e24ef[_0xfc98('0x11')],_0x9d2a84);_0x199dbe(_0x13508d[_0xfc98('0x10')](0x1f4,_0x2e24ef['message']));});});};exports['ShowTrigger']=function(_0x374ed3){var _0x21783e=this;return new Promise(function(_0x16419a,_0x180963){return db['Trigger']['find']({'raw':_0x374ed3['options']?_0x374ed3[_0xfc98('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x374ed3[_0xfc98('0x18')]?_0x374ed3[_0xfc98('0x18')][_0xfc98('0x19')]||null:null,'attributes':_0x374ed3[_0xfc98('0x18')]?_0x374ed3[_0xfc98('0x18')]['attributes']||null:null,'include':_0x374ed3[_0xfc98('0x18')]?_0x374ed3[_0xfc98('0x18')]['include']?_[_0xfc98('0x1b')](_0x374ed3[_0xfc98('0x18')][_0xfc98('0x1c')],function(_0x6b18e1){return{'model':db[_0x6b18e1['model']],'as':_0x6b18e1['as'],'attributes':_0x6b18e1[_0xfc98('0x1e')],'include':_0x6b18e1['include']?_['map'](_0x6b18e1[_0xfc98('0x1c')],function(_0x706fd9){return{'model':db[_0x706fd9['model']],'as':_0x706fd9['as'],'attributes':_0x706fd9[_0xfc98('0x1e')],'include':_0x706fd9[_0xfc98('0x1c')]?_['map'](_0x706fd9[_0xfc98('0x1c')],function(_0x3b3660){return{'model':db[_0x3b3660[_0xfc98('0x1d')]],'as':_0x3b3660['as'],'attributes':_0x3b3660[_0xfc98('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xfc98('0x1f')](function(_0x515fdb){logger[_0xfc98('0x12')](_0xfc98('0x20'),_0x374ed3);logger[_0xfc98('0xd')](_0xfc98('0x20'),_0x374ed3,JSON[_0xfc98('0xf')](_0x515fdb));_0x16419a(_0x515fdb);})[_0xfc98('0x14')](function(_0xe69999){logger['error'](_0xfc98('0x20'),_0xe69999[_0xfc98('0x11')],_0x374ed3);_0x180963(_0x21783e['error'](0x1f4,_0xe69999[_0xfc98('0x11')]));});});}; \ No newline at end of file +var _0xe5ae=['debug','request\x20sent','stringify','error','message','catch','GetTrigger','Trigger','options','where','attributes','limit','include','model','map','ShowTrigger','find','raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','http','request','then','info','Trigger,\x20%s,\x20%s'];(function(_0x3fb5f7,_0x3b234b){var _0x344db7=function(_0x4a6485){while(--_0x4a6485){_0x3fb5f7['push'](_0x3fb5f7['shift']());}};_0x344db7(++_0x3b234b);}(_0xe5ae,0x186));var _0xee5a=function(_0xcfd89f,_0x106e8f){_0xcfd89f=_0xcfd89f-0x0;var _0x59acd4=_0xe5ae[_0xcfd89f];return _0x59acd4;};'use strict';var _=require(_0xee5a('0x0'));var util=require('util');var moment=require(_0xee5a('0x1'));var BPromise=require(_0xee5a('0x2'));var rs=require(_0xee5a('0x3'));var fs=require('fs');var Redis=require(_0xee5a('0x4'));var db=require(_0xee5a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xee5a('0x6'))(_0xee5a('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xee5a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1f7959,_0x400f1d,_0x421049){return new BPromise(function(_0x47d3f4,_0x4fc949){return client[_0xee5a('0x9')](_0x1f7959,_0x421049)[_0xee5a('0xa')](function(_0x50b88c){logger[_0xee5a('0xb')](_0xee5a('0xc'),_0x400f1d,'request\x20sent');logger[_0xee5a('0xd')]('Trigger,\x20%s,\x20%s,\x20%s',_0x400f1d,_0xee5a('0xe'),JSON[_0xee5a('0xf')](_0x50b88c));if(_0x50b88c[_0xee5a('0x10')]){if(_0x50b88c[_0xee5a('0x10')]['code']===0x1f4){logger[_0xee5a('0x10')](_0xee5a('0xc'),_0x400f1d,_0x50b88c['error'][_0xee5a('0x11')]);return _0x4fc949(_0x50b88c[_0xee5a('0x10')]['message']);}logger[_0xee5a('0x10')](_0xee5a('0xc'),_0x400f1d,_0x50b88c[_0xee5a('0x10')][_0xee5a('0x11')]);return _0x47d3f4(_0x50b88c['error']['message']);}else{logger['info']('Trigger,\x20%s,\x20%s',_0x400f1d,_0xee5a('0xe'));_0x47d3f4(_0x50b88c['result'][_0xee5a('0x11')]);}})[_0xee5a('0x12')](function(_0x5448c7){logger[_0xee5a('0x10')](_0xee5a('0xc'),_0x400f1d,_0x5448c7);_0x4fc949(_0x5448c7);});});}exports[_0xee5a('0x13')]=function(_0x1fb0c1){var _0x18e11a=this;return new Promise(function(_0x1af20c,_0x2bbb7a){return db[_0xee5a('0x14')]['findAll']({'raw':_0x1fb0c1[_0xee5a('0x15')]?_0x1fb0c1[_0xee5a('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x1fb0c1['options']?_0x1fb0c1[_0xee5a('0x15')][_0xee5a('0x16')]||null:null,'attributes':_0x1fb0c1[_0xee5a('0x15')]?_0x1fb0c1['options'][_0xee5a('0x17')]||null:null,'limit':_0x1fb0c1[_0xee5a('0x15')]?_0x1fb0c1[_0xee5a('0x15')][_0xee5a('0x18')]||null:null,'include':_0x1fb0c1[_0xee5a('0x15')]?_0x1fb0c1[_0xee5a('0x15')][_0xee5a('0x19')]?_['map'](_0x1fb0c1[_0xee5a('0x15')][_0xee5a('0x19')],function(_0x217655){return{'model':db[_0x217655[_0xee5a('0x1a')]],'as':_0x217655['as'],'attributes':_0x217655[_0xee5a('0x17')],'include':_0x217655[_0xee5a('0x19')]?_['map'](_0x217655[_0xee5a('0x19')],function(_0x3cf068){return{'model':db[_0x3cf068['model']],'as':_0x3cf068['as'],'attributes':_0x3cf068[_0xee5a('0x17')],'include':_0x3cf068[_0xee5a('0x19')]?_[_0xee5a('0x1b')](_0x3cf068['include'],function(_0x14650b){return{'model':db[_0x14650b[_0xee5a('0x1a')]],'as':_0x14650b['as'],'attributes':_0x14650b[_0xee5a('0x17')]};}):[]};}):[]};}):[]:[]})[_0xee5a('0xa')](function(_0x58cc50){logger[_0xee5a('0xb')](_0xee5a('0x13'),_0x1fb0c1);logger['debug']('GetTrigger',_0x1fb0c1,JSON[_0xee5a('0xf')](_0x58cc50));_0x1af20c(_0x58cc50);})[_0xee5a('0x12')](function(_0x5cb51f){logger[_0xee5a('0x10')](_0xee5a('0x13'),_0x5cb51f[_0xee5a('0x11')],_0x1fb0c1);_0x2bbb7a(_0x18e11a[_0xee5a('0x10')](0x1f4,_0x5cb51f[_0xee5a('0x11')]));});});};exports[_0xee5a('0x1c')]=function(_0x1c24a6){var _0x399c6d=this;return new Promise(function(_0x25b208,_0x503564){return db[_0xee5a('0x14')][_0xee5a('0x1d')]({'raw':_0x1c24a6[_0xee5a('0x15')]?_0x1c24a6[_0xee5a('0x15')][_0xee5a('0x1e')]===undefined?!![]:![]:!![],'where':_0x1c24a6['options']?_0x1c24a6['options'][_0xee5a('0x16')]||null:null,'attributes':_0x1c24a6[_0xee5a('0x15')]?_0x1c24a6['options'][_0xee5a('0x17')]||null:null,'include':_0x1c24a6[_0xee5a('0x15')]?_0x1c24a6[_0xee5a('0x15')]['include']?_[_0xee5a('0x1b')](_0x1c24a6['options'][_0xee5a('0x19')],function(_0x505610){return{'model':db[_0x505610['model']],'as':_0x505610['as'],'attributes':_0x505610[_0xee5a('0x17')],'include':_0x505610[_0xee5a('0x19')]?_['map'](_0x505610[_0xee5a('0x19')],function(_0x4ec4e2){return{'model':db[_0x4ec4e2['model']],'as':_0x4ec4e2['as'],'attributes':_0x4ec4e2['attributes'],'include':_0x4ec4e2[_0xee5a('0x19')]?_['map'](_0x4ec4e2[_0xee5a('0x19')],function(_0x3d36e1){return{'model':db[_0x3d36e1[_0xee5a('0x1a')]],'as':_0x3d36e1['as'],'attributes':_0x3d36e1[_0xee5a('0x17')]};}):[]};}):[]};}):[]:[]})[_0xee5a('0xa')](function(_0x39db92){logger[_0xee5a('0xb')](_0xee5a('0x1c'),_0x1c24a6);logger[_0xee5a('0xd')](_0xee5a('0x1c'),_0x1c24a6,JSON[_0xee5a('0xf')](_0x39db92));_0x25b208(_0x39db92);})[_0xee5a('0x12')](function(_0x815b5d){logger[_0xee5a('0x10')](_0xee5a('0x1c'),_0x815b5d['message'],_0x1c24a6);_0x503564(_0x399c6d[_0xee5a('0x10')](0x1f4,_0x815b5d[_0xee5a('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 71f239c..1e91097 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 _0x4f54=['isAuthenticated','index','/:id','show','post','/:id/clone','clone','create','update','delete','exports','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./trunk.controller','get'];(function(_0x4c630b,_0x25f8ef){var _0x181259=function(_0x5d0e58){while(--_0x5d0e58){_0x4c630b['push'](_0x4c630b['shift']());}};_0x181259(++_0x25f8ef);}(_0x4f54,0x19a));var _0x44f5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4f54[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x44f5('0x0'));var path=require(_0x44f5('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x44f5('0x2')]();var fs_extra=require(_0x44f5('0x3'));var auth=require(_0x44f5('0x4'));var interaction=require(_0x44f5('0x5'));var config=require('../../config/environment');var controller=require(_0x44f5('0x6'));router[_0x44f5('0x7')]('/',auth[_0x44f5('0x8')](),controller[_0x44f5('0x9')]);router['get'](_0x44f5('0xa'),auth[_0x44f5('0x8')](),controller[_0x44f5('0xb')]);router[_0x44f5('0xc')](_0x44f5('0xd'),auth[_0x44f5('0x8')](),controller[_0x44f5('0xe')]);router[_0x44f5('0xc')]('/',auth[_0x44f5('0x8')](),controller[_0x44f5('0xf')]);router['put'](_0x44f5('0xa'),auth[_0x44f5('0x8')](),controller[_0x44f5('0x10')]);router[_0x44f5('0x11')]('/:id',auth[_0x44f5('0x8')](),controller['destroy']);module[_0x44f5('0x12')]=router; \ No newline at end of file +var _0x366b=['get','/:id','isAuthenticated','post','/:id/clone','clone','create','put','update','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x565a15,_0x14c08c){var _0x3f8098=function(_0x457706){while(--_0x457706){_0x565a15['push'](_0x565a15['shift']());}};_0x3f8098(++_0x14c08c);}(_0x366b,0x19a));var _0xb366=function(_0x315bef,_0x56c228){_0x315bef=_0x315bef-0x0;var _0x4d6176=_0x366b[_0x315bef];return _0x4d6176;};'use strict';var multer=require(_0xb366('0x0'));var util=require('util');var path=require(_0xb366('0x1'));var timeout=require('connect-timeout');var express=require(_0xb366('0x2'));var router=express[_0xb366('0x3')]();var fs_extra=require(_0xb366('0x4'));var auth=require(_0xb366('0x5'));var interaction=require(_0xb366('0x6'));var config=require(_0xb366('0x7'));var controller=require('./trunk.controller');router[_0xb366('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xb366('0x8')](_0xb366('0x9'),auth[_0xb366('0xa')](),controller['show']);router[_0xb366('0xb')](_0xb366('0xc'),auth[_0xb366('0xa')](),controller[_0xb366('0xd')]);router['post']('/',auth[_0xb366('0xa')](),controller[_0xb366('0xe')]);router[_0xb366('0xf')](_0xb366('0x9'),auth[_0xb366('0xa')](),controller[_0xb366('0x10')]);router[_0xb366('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xb366('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 2a3a861..f2a66f4 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 _0x40ad=['PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','nonat','update','outgoing','yes','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','always','accept','originate','uas','certificate','active','passive','actpass','BOOLEAN','sequelize','exports','STRING','name','friend','user','peer','from-voip-provider','ENUM','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN'];(function(_0x2e2681,_0x4089c1){var _0x368a64=function(_0x267262){while(--_0x267262){_0x2e2681['push'](_0x2e2681['shift']());}};_0x368a64(++_0x4089c1);}(_0x40ad,0x164));var _0xd40a=function(_0x461d52,_0x43604b){_0x461d52=_0x461d52-0x0;var _0x25d252=_0x40ad[_0x461d52];return _0x25d252;};'use strict';var Sequelize=require(_0xd40a('0x0'));module[_0xd40a('0x1')]={'name':{'type':Sequelize[_0xd40a('0x2')],'allowNull':![],'unique':_0xd40a('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0xd40a('0x4'),_0xd40a('0x5'),_0xd40a('0x6')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0xd40a('0x2')],'allowNull':![],'defaultValue':_0xd40a('0x7')},'callingpres':{'type':Sequelize[_0xd40a('0x8')](_0xd40a('0x9'),_0xd40a('0xa'),_0xd40a('0xb'),_0xd40a('0xc'),_0xd40a('0xd'),_0xd40a('0xe'),_0xd40a('0xf'),_0xd40a('0x10'))},'deny':{'type':Sequelize[_0xd40a('0x2')]},'permit':{'type':Sequelize[_0xd40a('0x2')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize[_0xd40a('0x2')]},'transport':{'type':Sequelize[_0xd40a('0x2')],'defaultValue':_0xd40a('0x11'),'set':function(_0x4d8268){this[_0xd40a('0x12')](_0xd40a('0x13'),_0x4d8268?_0x4d8268[_0xd40a('0x14')](','):null);},'get':function(){return this['getDataValue'](_0xd40a('0x13'))?this[_0xd40a('0x15')](_0xd40a('0x13'))[_0xd40a('0x16')](','):null;},'comment':_0xd40a('0x17')},'dtmfmode':{'type':Sequelize[_0xd40a('0x8')](_0xd40a('0x18'),_0xd40a('0x19'),_0xd40a('0x1a'),_0xd40a('0x1b'),_0xd40a('0x1c')),'defaultValue':_0xd40a('0x18')},'directmedia':{'type':Sequelize['ENUM']('yes','no',_0xd40a('0x1d'),_0xd40a('0x1e'),_0xd40a('0x1f')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xd40a('0x8')](_0xd40a('0x20'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xd40a('0x2')]},'directmediadeny':{'type':Sequelize[_0xd40a('0x2')]},'nat':{'type':Sequelize[_0xd40a('0x2')],'defaultValue':_0xd40a('0x21'),'set':function(_0x6780e5){this[_0xd40a('0x12')](_0xd40a('0x22'),_0x6780e5?_0x6780e5[_0xd40a('0x14')](','):null);},'get':function(){return this[_0xd40a('0x15')](_0xd40a('0x22'))?this[_0xd40a('0x15')](_0xd40a('0x22'))['split'](','):null;},'comment':_0xd40a('0x23')},'callgroup':{'type':Sequelize[_0xd40a('0x2')]},'namedcallgroup':{'type':Sequelize[_0xd40a('0x2')]},'pickupgroup':{'type':Sequelize[_0xd40a('0x2')]},'namedpickupgroup':{'type':Sequelize[_0xd40a('0x2')]},'language':{'type':Sequelize[_0xd40a('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xd40a('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xd40a('0x2')],'defaultValue':_0xd40a('0x24')},'allow':{'type':Sequelize[_0xd40a('0x2')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x4d962e){this[_0xd40a('0x12')](_0xd40a('0x25'),_0x4d962e?_0x4d962e[_0xd40a('0x14')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0xd40a('0x15')](_0xd40a('0x25'))?this['getDataValue']('allow')['split'](';'):null;},'comment':_0xd40a('0x26')},'autoframing':{'type':Sequelize[_0xd40a('0x8')](_0xd40a('0x20'),'no')},'insecure':{'type':Sequelize[_0xd40a('0x2')],'defaultValue':'port,invite','set':function(_0x333815){this[_0xd40a('0x12')]('insecure',_0x333815?_0x333815[_0xd40a('0x14')](','):null);},'get':function(){return this[_0xd40a('0x15')](_0xd40a('0x27'))?this[_0xd40a('0x15')]('insecure')[_0xd40a('0x16')](','):null;},'comment':_0xd40a('0x28')},'trustrpid':{'type':Sequelize[_0xd40a('0x8')](_0xd40a('0x20'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xd40a('0x8')](_0xd40a('0x20'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0xd40a('0x20'),'no',_0xd40a('0x29'))},'promiscredir':{'type':Sequelize[_0xd40a('0x8')](_0xd40a('0x20'),'no')},'useclientcode':{'type':Sequelize[_0xd40a('0x8')]('yes','no')},'accountcode':{'type':Sequelize[_0xd40a('0x2a')](0xb)},'setvar':{'type':Sequelize[_0xd40a('0x2')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0xd40a('0x2b')},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0xd40a('0x8')](_0xd40a('0x20'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0xd40a('0x2a')](0xb)},'allowoverlap':{'type':Sequelize[_0xd40a('0x8')](_0xd40a('0x20'),'no')},'allowsubscribe':{'type':Sequelize[_0xd40a('0x8')]('yes','no')},'allowtransfer':{'type':Sequelize[_0xd40a('0x8')](_0xd40a('0x20'),'no')},'ignoresdpversion':{'type':Sequelize[_0xd40a('0x8')](_0xd40a('0x20'),'no')},'subscribecontext':{'type':Sequelize[_0xd40a('0x2')]},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize[_0xd40a('0x8')](_0xd40a('0x20'),'no',_0xd40a('0x2c')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xd40a('0x2a')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xd40a('0x8')]('yes','no')},'mailbox':{'type':Sequelize[_0xd40a('0x2')]},'session_timers':{'type':Sequelize['ENUM'](_0xd40a('0x2d'),'refuse',_0xd40a('0x2e'))},'session_expires':{'type':Sequelize[_0xd40a('0x2a')](0xb)},'session_minse':{'type':Sequelize[_0xd40a('0x2a')](0xb)},'session_refresher':{'type':Sequelize[_0xd40a('0x8')]('uac','uas'),'defaultValue':_0xd40a('0x2f')},'t38pt_usertpsource':{'type':Sequelize[_0xd40a('0x2')]},'regexten':{'type':Sequelize[_0xd40a('0x2')]},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize[_0xd40a('0x2')]},'port':{'type':Sequelize[_0xd40a('0x2a')](0x5)},'qualify':{'type':Sequelize[_0xd40a('0x8')](_0xd40a('0x20'),'no'),'defaultValue':_0xd40a('0x20')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0xd40a('0x2')]},'defaultuser':{'type':Sequelize[_0xd40a('0x2')]},'rtptimeout':{'type':Sequelize[_0xd40a('0x2a')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xd40a('0x2a')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize[_0xd40a('0x8')](_0xd40a('0x20'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xd40a('0x2')]},'callbackextension':{'type':Sequelize[_0xd40a('0x2')]},'timert1':{'type':Sequelize[_0xd40a('0x2a')](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize[_0xd40a('0x2a')](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize[_0xd40a('0x2')]},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0xd40a('0x2')]},'use_q850_reason':{'type':Sequelize[_0xd40a('0x2')]},'maxforwards':{'type':Sequelize[_0xd40a('0x2a')](0xb)},'encryption':{'type':Sequelize['ENUM'](_0xd40a('0x20'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xd40a('0x8')]('yes','no')},'force_avp':{'type':Sequelize[_0xd40a('0x8')]('yes','no')},'icesupport':{'type':Sequelize[_0xd40a('0x8')]('yes','no')},'dtlsenable':{'type':Sequelize[_0xd40a('0x8')](_0xd40a('0x20'),'no')},'dtlsverify':{'type':Sequelize[_0xd40a('0x8')]('yes','no','fingerprint',_0xd40a('0x30'))},'dtlsrekey':{'type':Sequelize[_0xd40a('0x2a')](0xb)},'dtlscertfile':{'type':Sequelize[_0xd40a('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0xd40a('0x2')]},'dtlscipher':{'type':Sequelize[_0xd40a('0x2')]},'dtlscafile':{'type':Sequelize[_0xd40a('0x2')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0xd40a('0x8')](_0xd40a('0x31'),_0xd40a('0x32'),_0xd40a('0x33')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xd40a('0x2')]},'usereqphone':{'type':Sequelize[_0xd40a('0x8')](_0xd40a('0x20'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xd40a('0x2')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0xd40a('0x2a')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xd40a('0x8')](_0xd40a('0x20'),'no')},'subscribemwi':{'type':Sequelize[_0xd40a('0x8')](_0xd40a('0x20'),'no')},'vmexten':{'type':Sequelize[_0xd40a('0x2')]},'mohinterpret':{'type':Sequelize[_0xd40a('0x2')]},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd40a('0x2')]},'host':{'type':Sequelize[_0xd40a('0x2')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize['ENUM'](_0xd40a('0x20'),'no',_0xd40a('0x1d'),'update','update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0xd40a('0x2')]},'active':{'type':Sequelize[_0xd40a('0x34')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}}; \ No newline at end of file +var _0xf1d8=['\x22\x22\x20<>','INTEGER','accept','refuse','originate','uac','uas','pai','fingerprint','certificate','active','actpass','dynamic','nonat','update,nonat','BOOLEAN','exports','STRING','name','ENUM','user','peer','friend','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB','setDataValue','transport','join','getDataValue','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','update','outgoing','yes','force_rport,comedia','nat','all','allow','ulaw;alaw;gsm','port,invite','insecure','split','never'];(function(_0x379273,_0x31d66c){var _0x378140=function(_0x206235){while(--_0x206235){_0x379273['push'](_0x379273['shift']());}};_0x378140(++_0x31d66c);}(_0xf1d8,0x1a8));var _0x8f1d=function(_0x36feb2,_0x53abef){_0x36feb2=_0x36feb2-0x0;var _0x292b43=_0xf1d8[_0x36feb2];return _0x292b43;};'use strict';var Sequelize=require('sequelize');module[_0x8f1d('0x0')]={'name':{'type':Sequelize[_0x8f1d('0x1')],'allowNull':![],'unique':_0x8f1d('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x8f1d('0x3')]('friend',_0x8f1d('0x4'),_0x8f1d('0x5')),'allowNull':![],'defaultValue':_0x8f1d('0x6')},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8f1d('0x7')},'callingpres':{'type':Sequelize[_0x8f1d('0x3')](_0x8f1d('0x8'),_0x8f1d('0x9'),_0x8f1d('0xa'),_0x8f1d('0xb'),'PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN',_0x8f1d('0xc'))},'deny':{'type':Sequelize[_0x8f1d('0x1')]},'permit':{'type':Sequelize[_0x8f1d('0x1')]},'secret':{'type':Sequelize[_0x8f1d('0x1')]},'md5secret':{'type':Sequelize[_0x8f1d('0x1')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0x8f1d('0x1')],'defaultValue':'udp','set':function(_0x57c5e7){this[_0x8f1d('0xd')](_0x8f1d('0xe'),_0x57c5e7?_0x57c5e7[_0x8f1d('0xf')](','):null);},'get':function(){return this[_0x8f1d('0x10')]('transport')?this['getDataValue'](_0x8f1d('0xe'))['split'](','):null;},'comment':_0x8f1d('0x11')},'dtmfmode':{'type':Sequelize[_0x8f1d('0x3')](_0x8f1d('0x12'),_0x8f1d('0x13'),_0x8f1d('0x14'),_0x8f1d('0x15'),_0x8f1d('0x16')),'defaultValue':_0x8f1d('0x12')},'directmedia':{'type':Sequelize[_0x8f1d('0x3')]('yes','no','nonat',_0x8f1d('0x17'),_0x8f1d('0x18')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x8f1d('0x3')](_0x8f1d('0x19'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x8f1d('0x1')]},'directmediadeny':{'type':Sequelize[_0x8f1d('0x1')]},'nat':{'type':Sequelize['STRING'],'defaultValue':_0x8f1d('0x1a'),'set':function(_0x385c84){this['setDataValue'](_0x8f1d('0x1b'),_0x385c84?_0x385c84[_0x8f1d('0xf')](','):null);},'get':function(){return this[_0x8f1d('0x10')](_0x8f1d('0x1b'))?this[_0x8f1d('0x10')](_0x8f1d('0x1b'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x8f1d('0x1')]},'namedcallgroup':{'type':Sequelize[_0x8f1d('0x1')]},'pickupgroup':{'type':Sequelize[_0x8f1d('0x1')]},'namedpickupgroup':{'type':Sequelize[_0x8f1d('0x1')]},'language':{'type':Sequelize[_0x8f1d('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0x8f1d('0x1c')},'allow':{'type':Sequelize[_0x8f1d('0x1')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x5f3b5b){this[_0x8f1d('0xd')](_0x8f1d('0x1d'),_0x5f3b5b?_0x5f3b5b[_0x8f1d('0xf')](';'):_0x8f1d('0x1e'));},'get':function(){return this['getDataValue'](_0x8f1d('0x1d'))?this[_0x8f1d('0x10')](_0x8f1d('0x1d'))['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0x8f1d('0x3')](_0x8f1d('0x19'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0x8f1d('0x1f'),'set':function(_0x57944e){this[_0x8f1d('0xd')](_0x8f1d('0x20'),_0x57944e?_0x57944e[_0x8f1d('0xf')](','):null);},'get':function(){return this[_0x8f1d('0x10')](_0x8f1d('0x20'))?this[_0x8f1d('0x10')]('insecure')[_0x8f1d('0x21')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x8f1d('0x3')](_0x8f1d('0x19'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x8f1d('0x19'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x8f1d('0x3')](_0x8f1d('0x19'),'no',_0x8f1d('0x22'))},'promiscredir':{'type':Sequelize[_0x8f1d('0x3')](_0x8f1d('0x19'),'no')},'useclientcode':{'type':Sequelize[_0x8f1d('0x3')](_0x8f1d('0x19'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0x8f1d('0x1')]},'callerid':{'type':Sequelize[_0x8f1d('0x1')],'defaultValue':_0x8f1d('0x23')},'amaflags':{'type':Sequelize[_0x8f1d('0x1')]},'callcounter':{'type':Sequelize[_0x8f1d('0x3')](_0x8f1d('0x19'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x8f1d('0x24')](0xb)},'allowoverlap':{'type':Sequelize[_0x8f1d('0x3')](_0x8f1d('0x19'),'no')},'allowsubscribe':{'type':Sequelize[_0x8f1d('0x3')](_0x8f1d('0x19'),'no')},'allowtransfer':{'type':Sequelize[_0x8f1d('0x3')](_0x8f1d('0x19'),'no')},'ignoresdpversion':{'type':Sequelize[_0x8f1d('0x3')](_0x8f1d('0x19'),'no')},'subscribecontext':{'type':Sequelize[_0x8f1d('0x1')]},'template':{'type':Sequelize[_0x8f1d('0x1')]},'videosupport':{'type':Sequelize['ENUM'](_0x8f1d('0x19'),'no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x8f1d('0x24')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM']('yes','no')},'mailbox':{'type':Sequelize[_0x8f1d('0x1')]},'session_timers':{'type':Sequelize['ENUM'](_0x8f1d('0x25'),_0x8f1d('0x26'),_0x8f1d('0x27'))},'session_expires':{'type':Sequelize[_0x8f1d('0x24')](0xb)},'session_minse':{'type':Sequelize[_0x8f1d('0x24')](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0x8f1d('0x28'),_0x8f1d('0x29')),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x8f1d('0x1')]},'regexten':{'type':Sequelize[_0x8f1d('0x1')]},'fromdomain':{'type':Sequelize[_0x8f1d('0x1')]},'fromuser':{'type':Sequelize[_0x8f1d('0x1')]},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize[_0x8f1d('0x3')](_0x8f1d('0x19'),'no'),'defaultValue':_0x8f1d('0x19')},'keepalive':{'type':Sequelize[_0x8f1d('0x24')](0xb)},'defaultip':{'type':Sequelize[_0x8f1d('0x1')]},'defaultuser':{'type':Sequelize[_0x8f1d('0x1')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0x8f1d('0x24')](0xb)},'sendrpid':{'type':Sequelize[_0x8f1d('0x3')]('yes','no',_0x8f1d('0x2a')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x8f1d('0x1')]},'callbackextension':{'type':Sequelize[_0x8f1d('0x1')]},'timert1':{'type':Sequelize[_0x8f1d('0x24')](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize[_0x8f1d('0x24')](0xb)},'contactpermit':{'type':Sequelize[_0x8f1d('0x1')]},'contactdeny':{'type':Sequelize[_0x8f1d('0x1')]},'contactacl':{'type':Sequelize[_0x8f1d('0x1')]},'unsolicited_mailbox':{'type':Sequelize[_0x8f1d('0x1')]},'use_q850_reason':{'type':Sequelize[_0x8f1d('0x1')]},'maxforwards':{'type':Sequelize[_0x8f1d('0x24')](0xb)},'encryption':{'type':Sequelize[_0x8f1d('0x3')](_0x8f1d('0x19'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x8f1d('0x19'),'no')},'force_avp':{'type':Sequelize['ENUM']('yes','no')},'icesupport':{'type':Sequelize[_0x8f1d('0x3')](_0x8f1d('0x19'),'no')},'dtlsenable':{'type':Sequelize[_0x8f1d('0x3')](_0x8f1d('0x19'),'no')},'dtlsverify':{'type':Sequelize[_0x8f1d('0x3')]('yes','no',_0x8f1d('0x2b'),_0x8f1d('0x2c'))},'dtlsrekey':{'type':Sequelize[_0x8f1d('0x24')](0xb)},'dtlscertfile':{'type':Sequelize[_0x8f1d('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0x8f1d('0x1')]},'dtlscipher':{'type':Sequelize[_0x8f1d('0x1')]},'dtlscafile':{'type':Sequelize[_0x8f1d('0x1')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0x8f1d('0x3')](_0x8f1d('0x2d'),'passive',_0x8f1d('0x2e')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x8f1d('0x1')]},'usereqphone':{'type':Sequelize[_0x8f1d('0x3')](_0x8f1d('0x19'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x8f1d('0x1')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0x8f1d('0x24')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x8f1d('0x3')](_0x8f1d('0x19'),'no')},'subscribemwi':{'type':Sequelize[_0x8f1d('0x3')](_0x8f1d('0x19'),'no')},'vmexten':{'type':Sequelize[_0x8f1d('0x1')]},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize[_0x8f1d('0x1')]},'parkinglot':{'type':Sequelize[_0x8f1d('0x1')]},'description':{'type':Sequelize[_0x8f1d('0x1')]},'host':{'type':Sequelize[_0x8f1d('0x1')],'defaultValue':_0x8f1d('0x2f')},'canreinvite':{'type':Sequelize[_0x8f1d('0x3')](_0x8f1d('0x19'),'no',_0x8f1d('0x30'),'update',_0x8f1d('0x31')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0x8f1d('0x1')]},'active':{'type':Sequelize[_0x8f1d('0x32')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x8f1d('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 2566e98..edb0f54 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 _0x34e8=['limit','count','set','Content-Range','json','apply','save','update','destroy','get','Trunks','UserProfileResource','stack','name','index','map','Trunk','key','query','keys','intersection','model','attributes','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','fields','length','find','clone','rawAttributes','omit','createdAt','updatedAt','body','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','join','root','server/files/templates/trunk.ejs','utf8','readFileSync','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','render','Reload','chan_sip.so','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','/etc/asterisk/sip_xcally_registers.conf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','then','info','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','sendStatus','status','end','offset','undefined'];(function(_0x45b900,_0x2d7019){var _0x40233d=function(_0xafe74f){while(--_0xafe74f){_0x45b900['push'](_0x45b900['shift']());}};_0x40233d(++_0x2d7019);}(_0x34e8,0x12c));var _0x834e=function(_0x210524,_0x3b4a22){_0x210524=_0x210524-0x0;var _0x15678e=_0x34e8[_0x210524];return _0x15678e;};'use strict';var emlformat=require(_0x834e('0x0'));var rimraf=require(_0x834e('0x1'));var zipdir=require(_0x834e('0x2'));var jsonpatch=require(_0x834e('0x3'));var rp=require('request-promise');var moment=require(_0x834e('0x4'));var BPromise=require(_0x834e('0x5'));var Mustache=require(_0x834e('0x6'));var util=require(_0x834e('0x7'));var path=require(_0x834e('0x8'));var sox=require(_0x834e('0x9'));var csv=require(_0x834e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x834e('0xb'));var _=require('lodash');var squel=require(_0x834e('0xc'));var crypto=require(_0x834e('0xd'));var jsforce=require(_0x834e('0xe'));var deskjs=require(_0x834e('0xf'));var toCsv=require(_0x834e('0xa'));var querystring=require(_0x834e('0x10'));var Papa=require(_0x834e('0x11'));var Redis=require(_0x834e('0x12'));var authService=require(_0x834e('0x13'));var qs=require(_0x834e('0x14'));var as=require(_0x834e('0x15'));var hardwareService=require(_0x834e('0x16'));var logger=require(_0x834e('0x17'))(_0x834e('0x18'));var utils=require(_0x834e('0x19'));var config=require(_0x834e('0x1a'));var licenseUtil=require(_0x834e('0x1b'));var db=require('../../mysqldb')['db'];var jayson=require(_0x834e('0x1c'));var client=jayson[_0x834e('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x23848e,_0x2d95f2,_0x28e659,_0x21cc0a){return new BPromise(function(_0x50e860,_0x43156c){var _0x302cbd=_0x21cc0a||client;return _0x302cbd['request'](_0x23848e,_0x28e659)[_0x834e('0x1e')](function(_0x4a9cdc){logger[_0x834e('0x1f')](_0x834e('0x20'),_0x2d95f2,'request\x20sent');logger[_0x834e('0x21')](_0x834e('0x22'),_0x2d95f2,_0x834e('0x23'),JSON['stringify'](_0x4a9cdc));if(_0x4a9cdc[_0x834e('0x24')]){if(_0x4a9cdc[_0x834e('0x24')][_0x834e('0x25')]===0x1f4){logger[_0x834e('0x24')](_0x834e('0x20'),_0x2d95f2,_0x4a9cdc[_0x834e('0x24')][_0x834e('0x26')]);return _0x43156c(_0x4a9cdc['error'][_0x834e('0x26')]);}logger[_0x834e('0x24')](_0x834e('0x20'),_0x2d95f2,_0x4a9cdc[_0x834e('0x24')]['message']);return _0x50e860(_0x4a9cdc[_0x834e('0x24')][_0x834e('0x26')]);}else{logger['info'](_0x834e('0x20'),_0x2d95f2,_0x834e('0x23'));_0x50e860(_0x4a9cdc[_0x834e('0x27')]['message']);}})['catch'](function(_0x231619){logger[_0x834e('0x24')]('Trunk,\x20%s,\x20%s',_0x2d95f2,_0x231619);_0x43156c(_0x231619);});});}function respondWithStatusCode(_0x25ee1d,_0x1dc1e0){_0x1dc1e0=_0x1dc1e0||0xcc;return function(_0x58f4fd){if(_0x58f4fd){return _0x25ee1d[_0x834e('0x28')](_0x1dc1e0);}return _0x25ee1d[_0x834e('0x29')](_0x1dc1e0)[_0x834e('0x2a')]();};}function respondWithResult(_0x561cd2,_0x24fcf7){_0x24fcf7=_0x24fcf7||0xc8;return function(_0x3e310f){if(_0x3e310f){return _0x561cd2['status'](_0x24fcf7)['json'](_0x3e310f);}};}function respondWithFilteredResult(_0x1e713a,_0x508a1d){return function(_0x2826ec){if(_0x2826ec){var _0x3f1b0b=typeof _0x508a1d[_0x834e('0x2b')]===_0x834e('0x2c')&&typeof _0x508a1d[_0x834e('0x2d')]===_0x834e('0x2c');var _0x491919=_0x2826ec['count'];var _0x4dc64a=_0x3f1b0b?0x0:_0x508a1d['offset'];var _0x2c7a8d=_0x3f1b0b?_0x2826ec[_0x834e('0x2e')]:_0x508a1d[_0x834e('0x2b')]+_0x508a1d['limit'];var _0xb5bc06;if(_0x2c7a8d>=_0x491919){_0x2c7a8d=_0x491919;_0xb5bc06=0xc8;}else{_0xb5bc06=0xce;}_0x1e713a[_0x834e('0x29')](_0xb5bc06);return _0x1e713a[_0x834e('0x2f')](_0x834e('0x30'),_0x4dc64a+'-'+_0x2c7a8d+'/'+_0x491919)[_0x834e('0x31')](_0x2826ec);}return null;};}function patchUpdates(_0x390119){return function(_0x3d149d){try{jsonpatch[_0x834e('0x32')](_0x3d149d,_0x390119,!![]);}catch(_0x278db3){return BPromise['reject'](_0x278db3);}return _0x3d149d[_0x834e('0x33')]();};}function saveUpdates(_0x5cad11,_0x2c75c2){return function(_0x3787b0){if(_0x3787b0){return _0x3787b0[_0x834e('0x34')](_0x5cad11)[_0x834e('0x1e')](function(_0x444366){return _0x444366;});}return null;};}function removeEntity(_0x4689c2,_0x4696a1){return function(_0x38cd29){if(_0x38cd29){return _0x38cd29[_0x834e('0x35')]()[_0x834e('0x1e')](function(){var _0x5bd232=_0x38cd29[_0x834e('0x36')]({'plain':!![]});var _0x2f408a=_0x834e('0x37');return db[_0x834e('0x38')]['destroy']({'where':{'type':_0x2f408a,'resourceId':_0x5bd232['id']}})[_0x834e('0x1e')](function(){return _0x38cd29;});})[_0x834e('0x1e')](function(){_0x4689c2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x59385a,_0x3e58fa){return function(_0x41bf4d){if(!_0x41bf4d){_0x59385a[_0x834e('0x28')](0x194);}return _0x41bf4d;};}function handleError(_0x34fefb,_0x339e28){_0x339e28=_0x339e28||0x1f4;return function(_0x1b76dd){logger['error'](_0x1b76dd[_0x834e('0x39')]);if(_0x1b76dd['name']){delete _0x1b76dd[_0x834e('0x3a')];}_0x34fefb[_0x834e('0x29')](_0x339e28)['send'](_0x1b76dd);};}exports[_0x834e('0x3b')]=function(_0x2f56c7,_0x491c28){var _0x481f70={},_0x388711={},_0xd0d43a={'count':0x0,'rows':[]};var _0x2e9383=_[_0x834e('0x3c')](db[_0x834e('0x3d')]['rawAttributes'],function(_0x1c5ed6){return{'name':_0x1c5ed6['fieldName'],'type':_0x1c5ed6['type'][_0x834e('0x3e')]};});_0x388711['model']=_[_0x834e('0x3c')](_0x2e9383,_0x834e('0x3a'));_0x388711[_0x834e('0x3f')]=_[_0x834e('0x40')](_0x2f56c7[_0x834e('0x3f')]);_0x388711['filters']=_[_0x834e('0x41')](_0x388711[_0x834e('0x42')],_0x388711[_0x834e('0x3f')]);_0x481f70['attributes']=_[_0x834e('0x41')](_0x388711[_0x834e('0x42')],qs['fields'](_0x2f56c7[_0x834e('0x3f')]['fields']));_0x481f70[_0x834e('0x43')]=_0x481f70[_0x834e('0x43')]['length']?_0x481f70['attributes']:_0x388711[_0x834e('0x42')];if(!_0x2f56c7[_0x834e('0x3f')][_0x834e('0x44')](_0x834e('0x45'))){_0x481f70[_0x834e('0x2d')]=qs[_0x834e('0x2d')](_0x2f56c7[_0x834e('0x3f')]['limit']);_0x481f70[_0x834e('0x2b')]=qs['offset'](_0x2f56c7[_0x834e('0x3f')]['offset']);}_0x481f70[_0x834e('0x46')]=qs['sort'](_0x2f56c7[_0x834e('0x3f')][_0x834e('0x47')]);_0x481f70['where']=qs[_0x834e('0x48')](_[_0x834e('0x49')](_0x2f56c7[_0x834e('0x3f')],_0x388711[_0x834e('0x48')]),_0x2e9383);if(_0x2f56c7[_0x834e('0x3f')][_0x834e('0x4a')]){_0x481f70[_0x834e('0x4b')]=_[_0x834e('0x4c')](_0x481f70[_0x834e('0x4b')],{'$or':_[_0x834e('0x3c')](_0x2e9383,function(_0x5f3943){if(_0x5f3943[_0x834e('0x4d')]!==_0x834e('0x4e')){var _0x47a8a9={};_0x47a8a9[_0x5f3943[_0x834e('0x3a')]]={'$like':'%'+_0x2f56c7[_0x834e('0x3f')][_0x834e('0x4a')]+'%'};return _0x47a8a9;}})});}_0x481f70=_[_0x834e('0x4c')]({},_0x481f70,_0x2f56c7[_0x834e('0x4f')]);var _0x4264b8={'where':_0x481f70['where']};return db['Trunk'][_0x834e('0x2e')](_0x4264b8)[_0x834e('0x1e')](function(_0x30568e){_0xd0d43a[_0x834e('0x2e')]=_0x30568e;if(_0x2f56c7[_0x834e('0x3f')][_0x834e('0x50')]){_0x481f70[_0x834e('0x51')]=[{'all':!![]}];}return db[_0x834e('0x3d')][_0x834e('0x52')](_0x481f70);})[_0x834e('0x1e')](function(_0xf02f0d){_0xd0d43a[_0x834e('0x53')]=_0xf02f0d;return _0xd0d43a;})[_0x834e('0x1e')](respondWithFilteredResult(_0x491c28,_0x481f70))[_0x834e('0x54')](handleError(_0x491c28,null));};exports[_0x834e('0x55')]=function(_0x1a3855,_0x3df078){var _0x32b8f7={'raw':![],'where':{'id':_0x1a3855[_0x834e('0x56')]['id']}},_0x420841={};_0x420841['model']=_[_0x834e('0x40')](db[_0x834e('0x3d')]['rawAttributes']);_0x420841[_0x834e('0x3f')]=_[_0x834e('0x40')](_0x1a3855['query']);_0x420841[_0x834e('0x48')]=_[_0x834e('0x41')](_0x420841[_0x834e('0x42')],_0x420841[_0x834e('0x3f')]);_0x32b8f7[_0x834e('0x43')]=_[_0x834e('0x41')](_0x420841[_0x834e('0x42')],qs['fields'](_0x1a3855[_0x834e('0x3f')][_0x834e('0x57')]));_0x32b8f7[_0x834e('0x43')]=_0x32b8f7[_0x834e('0x43')][_0x834e('0x58')]?_0x32b8f7[_0x834e('0x43')]:_0x420841[_0x834e('0x42')];if(_0x1a3855[_0x834e('0x3f')]['includeAll']){_0x32b8f7[_0x834e('0x51')]=[{'all':!![]}];}_0x32b8f7=_['merge']({},_0x32b8f7,_0x1a3855[_0x834e('0x4f')]);return db['Trunk'][_0x834e('0x59')](_0x32b8f7)['then'](handleEntityNotFound(_0x3df078,null))['then'](respondWithResult(_0x3df078,null))[_0x834e('0x54')](handleError(_0x3df078,null));};exports[_0x834e('0x5a')]=function(_0x5291ae,_0x5be43d){var _0x2c8155={'where':{'id':_0x5291ae[_0x834e('0x56')]['id']}},_0x2452b4={};_0x2452b4[_0x834e('0x42')]=_[_0x834e('0x40')](db[_0x834e('0x3d')][_0x834e('0x5b')]);_0x2c8155[_0x834e('0x43')]=_['intersection'](_0x2452b4[_0x834e('0x42')],qs[_0x834e('0x57')](_0x5291ae['query'][_0x834e('0x57')]));_0x2c8155['attributes']=_0x2c8155[_0x834e('0x43')][_0x834e('0x58')]?_0x2c8155['attributes']:_0x2452b4[_0x834e('0x42')];if(_0x5291ae[_0x834e('0x3f')][_0x834e('0x50')]){_0x2c8155[_0x834e('0x51')]=[{'all':!![]}];}_0x2c8155=_['merge']({},_0x2c8155,_0x5291ae[_0x834e('0x4f')]);return db[_0x834e('0x3d')][_0x834e('0x59')](_0x2c8155)['then'](handleEntityNotFound(_0x5be43d,null))[_0x834e('0x1e')](function(_0x1fcae9){if(_0x1fcae9){var _0x3a7683=_0x1fcae9[_0x834e('0x36')]({'plain':!![]});_0x3a7683=qs[_0x834e('0x5c')](_0x3a7683,['id',_0x834e('0x5d'),_0x834e('0x5e')]);_0x5291ae[_0x834e('0x5f')]=_[_0x834e('0x5c')](_0x5291ae[_0x834e('0x5f')],['id',_0x834e('0x5d'),_0x834e('0x5e')]);return db[_0x834e('0x3d')][_0x834e('0x60')](_[_0x834e('0x4c')](_0x3a7683,_0x5291ae[_0x834e('0x5f')]),{'include':_0x5291ae[_0x834e('0x3f')][_0x834e('0x50')]?[{'all':!![]}]:undefined})[_0x834e('0x1e')](function(_0x3e3467){var _0xed4081=_0x5291ae[_0x834e('0x61')]['get']({'plain':!![]});if(!_0xed4081)throw new Error(_0x834e('0x62'));if(_0xed4081[_0x834e('0x63')]===_0x834e('0x61')){var _0x36cc14=_0x3e3467['get']({'plain':!![]});var _0x30faa8='Trunks';return db['UserProfileSection'][_0x834e('0x59')]({'where':{'name':_0x30faa8,'userProfileId':_0xed4081[_0x834e('0x64')]},'raw':!![]})[_0x834e('0x1e')](function(_0xe79465){if(_0xe79465&&_0xe79465[_0x834e('0x65')]===0x0){return db[_0x834e('0x38')][_0x834e('0x60')]({'name':_0x36cc14[_0x834e('0x3a')],'resourceId':_0x36cc14['id'],'type':_0xe79465['name'],'sectionId':_0xe79465['id']},{})[_0x834e('0x1e')](function(){return _0x3e3467;});}else{return _0x3e3467;}})['catch'](function(_0x17e223){logger[_0x834e('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x17e223);throw _0x17e223;});}return _0x3e3467;});}})['then'](respondWithResult(_0x5be43d,0xc9))[_0x834e('0x54')](handleError(_0x5be43d,null));};exports[_0x834e('0x60')]=function(_0x363cc2,_0x2cca07,_0x2c41bd){var _0x5a4854;return db[_0x834e('0x3d')][_0x834e('0x60')](_0x363cc2[_0x834e('0x5f')],{'raw':!![]})[_0x834e('0x1e')](function(_0x3181af){_0x5a4854=_0x3181af;return db[_0x834e('0x3d')][_0x834e('0x52')]({'raw':!![]});})[_0x834e('0x1e')](function(_0x376f72){var _0x324f67=fs['readFileSync'](path[_0x834e('0x66')](config[_0x834e('0x67')],_0x834e('0x68')),_0x834e('0x69'));var _0x51cfab=fs[_0x834e('0x6a')](path['join'](config['root'],'server/files/templates/registry.ejs'),_0x834e('0x69'));var _0x332d8f=ejs['render'](_0x324f67,{'trunks':_0x376f72||[]});fs[_0x834e('0x6b')](_0x834e('0x6c'),_0x332d8f);if(_0x5a4854['registry']){var _0x353246=ejs[_0x834e('0x6d')](_0x51cfab,{'trunks':_0x376f72||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0x353246);}})[_0x834e('0x1e')](function(){return respondWithRpcPromise(_0x834e('0x6e'),_0x834e('0x60'),{'module':_0x834e('0x6f')});})[_0x834e('0x1e')](function(){var _0x493239=_0x363cc2[_0x834e('0x61')]['get']({'plain':!![]});if(!_0x493239)throw new Error(_0x834e('0x62'));if(_0x493239[_0x834e('0x63')]===_0x834e('0x61')){var _0x5afb41=_0x5a4854[_0x834e('0x36')]({'plain':!![]});return db[_0x834e('0x70')]['find']({'where':{'name':_0x834e('0x37'),'userProfileId':_0x493239[_0x834e('0x64')]},'raw':!![]})[_0x834e('0x1e')](function(_0x50d0a3){if(_0x50d0a3&&_0x50d0a3[_0x834e('0x65')]===0x0){return db[_0x834e('0x38')][_0x834e('0x60')]({'name':_0x5afb41[_0x834e('0x3a')],'resourceId':_0x5afb41['id'],'type':_0x50d0a3[_0x834e('0x3a')],'sectionId':_0x50d0a3['id']},{})[_0x834e('0x1e')](function(){return _0x5a4854;});}else{return _0x5a4854;}})[_0x834e('0x54')](function(_0x23b5d9){logger[_0x834e('0x24')](_0x834e('0x71'),_0x23b5d9);throw _0x23b5d9;});}return _0x5a4854;})['then'](respondWithResult(_0x2cca07,0xc9))['catch'](handleError(_0x2cca07,null));};exports['update']=function(_0x36ede9,_0x1135a5,_0x313c03){var _0x37fa2c;return db[_0x834e('0x3d')]['find']({'where':{'id':_0x36ede9['params']['id']}})[_0x834e('0x1e')](handleEntityNotFound(_0x1135a5,null))[_0x834e('0x1e')](saveUpdates(_0x36ede9[_0x834e('0x5f')],null))[_0x834e('0x1e')](function(_0x40a705){if(_0x40a705){_0x37fa2c=_0x40a705;return db['Trunk'][_0x834e('0x52')]({'raw':!![]});}})[_0x834e('0x1e')](function(_0x113714){if(_0x113714){var _0x4e1735=fs[_0x834e('0x6a')](path[_0x834e('0x66')](config[_0x834e('0x67')],_0x834e('0x68')),_0x834e('0x69'));var _0x585d02=fs['readFileSync'](path[_0x834e('0x66')](config[_0x834e('0x67')],'server/files/templates/registry.ejs'),_0x834e('0x69'));var _0x509427=ejs[_0x834e('0x6d')](_0x4e1735,{'trunks':_0x113714||[]});fs[_0x834e('0x6b')](_0x834e('0x6c'),_0x509427);var _0x53012d=ejs[_0x834e('0x6d')](_0x585d02,{'trunks':_0x113714||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0x53012d);return respondWithRpcPromise('Reload',_0x834e('0x34'),{'module':_0x834e('0x6f')});}return null;})[_0x834e('0x1e')](function(_0x1d76c6){if(_0x1d76c6){return _0x37fa2c;}})[_0x834e('0x1e')](respondWithResult(_0x1135a5,null))[_0x834e('0x54')](handleError(_0x1135a5,null));};exports[_0x834e('0x35')]=function(_0x179892,_0x17e61a,_0x53f6e3){var _0x2f775a;return db['Trunk'][_0x834e('0x59')]({'where':{'id':_0x179892[_0x834e('0x56')]['id']}})[_0x834e('0x1e')](handleEntityNotFound(_0x17e61a,null))[_0x834e('0x1e')](removeEntity(_0x17e61a,null))[_0x834e('0x1e')](function(){return db[_0x834e('0x3d')]['findAll']({'raw':!![]});})['then'](function(_0xeb096d){var _0x2a854a=fs['readFileSync'](path[_0x834e('0x66')](config[_0x834e('0x67')],_0x834e('0x68')),_0x834e('0x69'));var _0xc75f5e=fs['readFileSync'](path[_0x834e('0x66')](config[_0x834e('0x67')],'server/files/templates/registry.ejs'),'utf8');var _0x5ede29=ejs[_0x834e('0x6d')](_0x2a854a,{'trunks':_0xeb096d});var _0x1f3e26=ejs['render'](_0xc75f5e,{'trunks':_0xeb096d});fs[_0x834e('0x6b')](_0x834e('0x6c'),_0x5ede29);fs['writeFileSync'](_0x834e('0x72'),_0x1f3e26);return respondWithRpcPromise('Reload','destroy',{'module':_0x834e('0x6f')});})[_0x834e('0x54')](handleError(_0x17e61a,null));}; \ No newline at end of file +var _0x98a8=['../../mysqldb','jayson/promise','client','request','Trunk,\x20%s,\x20%s','debug','request\x20sent','error','code','message','info','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','get','Trunks','UserProfileResource','stack','name','map','fieldName','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','Trunk','include','show','params','keys','rawAttributes','includeAll','clone','find','createdAt','updatedAt','body','omit','create','user','role','UserProfileSection','userProfileId','autoAssociation','findAll','readFileSync','root','server/files/templates/trunk.ejs','join','server/files/templates/registry.ejs','utf8','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment'];(function(_0x12ed0b,_0x3edc86){var _0x188e65=function(_0x4cf6df){while(--_0x4cf6df){_0x12ed0b['push'](_0x12ed0b['shift']());}};_0x188e65(++_0x3edc86);}(_0x98a8,0x12c));var _0x898a=function(_0x57846a,_0x424de1){_0x57846a=_0x57846a-0x0;var _0x4a85ba=_0x98a8[_0x57846a];return _0x4a85ba;};'use strict';var emlformat=require(_0x898a('0x0'));var rimraf=require(_0x898a('0x1'));var zipdir=require(_0x898a('0x2'));var jsonpatch=require(_0x898a('0x3'));var rp=require(_0x898a('0x4'));var moment=require(_0x898a('0x5'));var BPromise=require(_0x898a('0x6'));var Mustache=require('mustache');var util=require(_0x898a('0x7'));var path=require(_0x898a('0x8'));var sox=require(_0x898a('0x9'));var csv=require(_0x898a('0xa'));var ejs=require(_0x898a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x898a('0xc'));var squel=require('squel');var crypto=require(_0x898a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x898a('0xe'));var toCsv=require(_0x898a('0xa'));var querystring=require(_0x898a('0xf'));var Papa=require(_0x898a('0x10'));var Redis=require(_0x898a('0x11'));var authService=require(_0x898a('0x12'));var qs=require(_0x898a('0x13'));var as=require(_0x898a('0x14'));var hardwareService=require(_0x898a('0x15'));var logger=require('../../config/logger')(_0x898a('0x16'));var utils=require('../../config/utils');var config=require(_0x898a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x898a('0x18'))['db'];var jayson=require(_0x898a('0x19'));var client=jayson[_0x898a('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5bfded,_0x5b5c9c,_0x373d53,_0x1f5be4){return new BPromise(function(_0xb24335,_0x116fbe){var _0x1873e9=_0x1f5be4||client;return _0x1873e9[_0x898a('0x1b')](_0x5bfded,_0x373d53)['then'](function(_0x47033c){logger['info'](_0x898a('0x1c'),_0x5b5c9c,'request\x20sent');logger[_0x898a('0x1d')]('Trunk,\x20%s,\x20%s,\x20%s',_0x5b5c9c,_0x898a('0x1e'),JSON['stringify'](_0x47033c));if(_0x47033c[_0x898a('0x1f')]){if(_0x47033c[_0x898a('0x1f')][_0x898a('0x20')]===0x1f4){logger['error'](_0x898a('0x1c'),_0x5b5c9c,_0x47033c['error']['message']);return _0x116fbe(_0x47033c[_0x898a('0x1f')][_0x898a('0x21')]);}logger['error']('Trunk,\x20%s,\x20%s',_0x5b5c9c,_0x47033c[_0x898a('0x1f')][_0x898a('0x21')]);return _0xb24335(_0x47033c[_0x898a('0x1f')][_0x898a('0x21')]);}else{logger[_0x898a('0x22')](_0x898a('0x1c'),_0x5b5c9c,_0x898a('0x1e'));_0xb24335(_0x47033c['result'][_0x898a('0x21')]);}})[_0x898a('0x23')](function(_0x11cae2){logger[_0x898a('0x1f')](_0x898a('0x1c'),_0x5b5c9c,_0x11cae2);_0x116fbe(_0x11cae2);});});}function respondWithStatusCode(_0x310bfa,_0x4e254d){_0x4e254d=_0x4e254d||0xcc;return function(_0x274cdf){if(_0x274cdf){return _0x310bfa[_0x898a('0x24')](_0x4e254d);}return _0x310bfa[_0x898a('0x25')](_0x4e254d)[_0x898a('0x26')]();};}function respondWithResult(_0x3901ab,_0x1426e3){_0x1426e3=_0x1426e3||0xc8;return function(_0x5b7719){if(_0x5b7719){return _0x3901ab[_0x898a('0x25')](_0x1426e3)['json'](_0x5b7719);}};}function respondWithFilteredResult(_0x513c6b,_0x53ddb2){return function(_0x3678be){if(_0x3678be){var _0x1f4d86=typeof _0x53ddb2[_0x898a('0x27')]===_0x898a('0x28')&&typeof _0x53ddb2[_0x898a('0x29')]===_0x898a('0x28');var _0x398e98=_0x3678be[_0x898a('0x2a')];var _0xd31922=_0x1f4d86?0x0:_0x53ddb2['offset'];var _0x4b3e68=_0x1f4d86?_0x3678be['count']:_0x53ddb2[_0x898a('0x27')]+_0x53ddb2[_0x898a('0x29')];var _0x3b7704;if(_0x4b3e68>=_0x398e98){_0x4b3e68=_0x398e98;_0x3b7704=0xc8;}else{_0x3b7704=0xce;}_0x513c6b[_0x898a('0x25')](_0x3b7704);return _0x513c6b[_0x898a('0x2b')](_0x898a('0x2c'),_0xd31922+'-'+_0x4b3e68+'/'+_0x398e98)[_0x898a('0x2d')](_0x3678be);}return null;};}function patchUpdates(_0xf74645){return function(_0x18773a){try{jsonpatch[_0x898a('0x2e')](_0x18773a,_0xf74645,!![]);}catch(_0x44c5d2){return BPromise[_0x898a('0x2f')](_0x44c5d2);}return _0x18773a['save']();};}function saveUpdates(_0x7a1eb5,_0x17a5f3){return function(_0x26eead){if(_0x26eead){return _0x26eead[_0x898a('0x30')](_0x7a1eb5)[_0x898a('0x31')](function(_0x47af5b){return _0x47af5b;});}return null;};}function removeEntity(_0x48cefb,_0x20a3fe){return function(_0x1e2fd4){if(_0x1e2fd4){return _0x1e2fd4[_0x898a('0x32')]()['then'](function(){var _0x105477=_0x1e2fd4[_0x898a('0x33')]({'plain':!![]});var _0x5eafc7=_0x898a('0x34');return db[_0x898a('0x35')][_0x898a('0x32')]({'where':{'type':_0x5eafc7,'resourceId':_0x105477['id']}})[_0x898a('0x31')](function(){return _0x1e2fd4;});})[_0x898a('0x31')](function(){_0x48cefb['status'](0xcc)[_0x898a('0x26')]();});}};}function handleEntityNotFound(_0x5baf5b,_0x573eb3){return function(_0x14e2dc){if(!_0x14e2dc){_0x5baf5b['sendStatus'](0x194);}return _0x14e2dc;};}function handleError(_0x3c9588,_0x4b3aac){_0x4b3aac=_0x4b3aac||0x1f4;return function(_0x37cb11){logger['error'](_0x37cb11[_0x898a('0x36')]);if(_0x37cb11[_0x898a('0x37')]){delete _0x37cb11[_0x898a('0x37')];}_0x3c9588['status'](_0x4b3aac)['send'](_0x37cb11);};}exports['index']=function(_0x1575d2,_0x429c32){var _0x5a228f={},_0xdd019d={},_0x3d3463={'count':0x0,'rows':[]};var _0xe84f7e=_[_0x898a('0x38')](db['Trunk']['rawAttributes'],function(_0x3aed01){return{'name':_0x3aed01[_0x898a('0x39')],'type':_0x3aed01['type']['key']};});_0xdd019d[_0x898a('0x3a')]=_[_0x898a('0x38')](_0xe84f7e,_0x898a('0x37'));_0xdd019d[_0x898a('0x3b')]=_['keys'](_0x1575d2[_0x898a('0x3b')]);_0xdd019d[_0x898a('0x3c')]=_['intersection'](_0xdd019d['model'],_0xdd019d['query']);_0x5a228f[_0x898a('0x3d')]=_[_0x898a('0x3e')](_0xdd019d[_0x898a('0x3a')],qs[_0x898a('0x3f')](_0x1575d2[_0x898a('0x3b')][_0x898a('0x3f')]));_0x5a228f[_0x898a('0x3d')]=_0x5a228f[_0x898a('0x3d')][_0x898a('0x40')]?_0x5a228f[_0x898a('0x3d')]:_0xdd019d[_0x898a('0x3a')];if(!_0x1575d2[_0x898a('0x3b')][_0x898a('0x41')](_0x898a('0x42'))){_0x5a228f[_0x898a('0x29')]=qs['limit'](_0x1575d2[_0x898a('0x3b')][_0x898a('0x29')]);_0x5a228f[_0x898a('0x27')]=qs['offset'](_0x1575d2[_0x898a('0x3b')][_0x898a('0x27')]);}_0x5a228f[_0x898a('0x43')]=qs[_0x898a('0x44')](_0x1575d2[_0x898a('0x3b')][_0x898a('0x44')]);_0x5a228f[_0x898a('0x45')]=qs[_0x898a('0x3c')](_['pick'](_0x1575d2[_0x898a('0x3b')],_0xdd019d[_0x898a('0x3c')]),_0xe84f7e);if(_0x1575d2[_0x898a('0x3b')][_0x898a('0x46')]){_0x5a228f['where']=_[_0x898a('0x47')](_0x5a228f[_0x898a('0x45')],{'$or':_['map'](_0xe84f7e,function(_0x241677){if(_0x241677['type']!==_0x898a('0x48')){var _0x5137c4={};_0x5137c4[_0x241677['name']]={'$like':'%'+_0x1575d2[_0x898a('0x3b')]['filter']+'%'};return _0x5137c4;}})});}_0x5a228f=_[_0x898a('0x47')]({},_0x5a228f,_0x1575d2[_0x898a('0x49')]);var _0x4d6ac0={'where':_0x5a228f[_0x898a('0x45')]};return db[_0x898a('0x4a')]['count'](_0x4d6ac0)[_0x898a('0x31')](function(_0x199437){_0x3d3463[_0x898a('0x2a')]=_0x199437;if(_0x1575d2[_0x898a('0x3b')]['includeAll']){_0x5a228f[_0x898a('0x4b')]=[{'all':!![]}];}return db[_0x898a('0x4a')]['findAll'](_0x5a228f);})[_0x898a('0x31')](function(_0x1d8c16){_0x3d3463['rows']=_0x1d8c16;return _0x3d3463;})[_0x898a('0x31')](respondWithFilteredResult(_0x429c32,_0x5a228f))['catch'](handleError(_0x429c32,null));};exports[_0x898a('0x4c')]=function(_0x41f291,_0x32ccb9){var _0x50f9e3={'raw':![],'where':{'id':_0x41f291[_0x898a('0x4d')]['id']}},_0x2f6cb3={};_0x2f6cb3[_0x898a('0x3a')]=_[_0x898a('0x4e')](db['Trunk'][_0x898a('0x4f')]);_0x2f6cb3['query']=_[_0x898a('0x4e')](_0x41f291[_0x898a('0x3b')]);_0x2f6cb3[_0x898a('0x3c')]=_['intersection'](_0x2f6cb3[_0x898a('0x3a')],_0x2f6cb3[_0x898a('0x3b')]);_0x50f9e3[_0x898a('0x3d')]=_['intersection'](_0x2f6cb3['model'],qs[_0x898a('0x3f')](_0x41f291[_0x898a('0x3b')][_0x898a('0x3f')]));_0x50f9e3[_0x898a('0x3d')]=_0x50f9e3[_0x898a('0x3d')][_0x898a('0x40')]?_0x50f9e3[_0x898a('0x3d')]:_0x2f6cb3[_0x898a('0x3a')];if(_0x41f291[_0x898a('0x3b')][_0x898a('0x50')]){_0x50f9e3[_0x898a('0x4b')]=[{'all':!![]}];}_0x50f9e3=_['merge']({},_0x50f9e3,_0x41f291[_0x898a('0x49')]);return db[_0x898a('0x4a')]['find'](_0x50f9e3)[_0x898a('0x31')](handleEntityNotFound(_0x32ccb9,null))['then'](respondWithResult(_0x32ccb9,null))['catch'](handleError(_0x32ccb9,null));};exports[_0x898a('0x51')]=function(_0x124f9b,_0x209529){var _0x5bfd61={'where':{'id':_0x124f9b[_0x898a('0x4d')]['id']}},_0x556fd8={};_0x556fd8[_0x898a('0x3a')]=_['keys'](db[_0x898a('0x4a')][_0x898a('0x4f')]);_0x5bfd61['attributes']=_[_0x898a('0x3e')](_0x556fd8[_0x898a('0x3a')],qs[_0x898a('0x3f')](_0x124f9b['query'][_0x898a('0x3f')]));_0x5bfd61[_0x898a('0x3d')]=_0x5bfd61[_0x898a('0x3d')][_0x898a('0x40')]?_0x5bfd61[_0x898a('0x3d')]:_0x556fd8[_0x898a('0x3a')];if(_0x124f9b['query'][_0x898a('0x50')]){_0x5bfd61['include']=[{'all':!![]}];}_0x5bfd61=_[_0x898a('0x47')]({},_0x5bfd61,_0x124f9b[_0x898a('0x49')]);return db[_0x898a('0x4a')][_0x898a('0x52')](_0x5bfd61)[_0x898a('0x31')](handleEntityNotFound(_0x209529,null))[_0x898a('0x31')](function(_0x2486a5){if(_0x2486a5){var _0x75ff57=_0x2486a5[_0x898a('0x33')]({'plain':!![]});_0x75ff57=qs['omit'](_0x75ff57,['id',_0x898a('0x53'),_0x898a('0x54')]);_0x124f9b[_0x898a('0x55')]=_[_0x898a('0x56')](_0x124f9b[_0x898a('0x55')],['id',_0x898a('0x53'),_0x898a('0x54')]);return db[_0x898a('0x4a')][_0x898a('0x57')](_[_0x898a('0x47')](_0x75ff57,_0x124f9b[_0x898a('0x55')]),{'include':_0x124f9b[_0x898a('0x3b')][_0x898a('0x50')]?[{'all':!![]}]:undefined})[_0x898a('0x31')](function(_0x22f9ba){var _0x5f42ae=_0x124f9b[_0x898a('0x58')][_0x898a('0x33')]({'plain':!![]});if(!_0x5f42ae)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5f42ae[_0x898a('0x59')]===_0x898a('0x58')){var _0x5f0944=_0x22f9ba[_0x898a('0x33')]({'plain':!![]});var _0x1daecd=_0x898a('0x34');return db[_0x898a('0x5a')]['find']({'where':{'name':_0x1daecd,'userProfileId':_0x5f42ae[_0x898a('0x5b')]},'raw':!![]})[_0x898a('0x31')](function(_0x137935){if(_0x137935&&_0x137935[_0x898a('0x5c')]===0x0){return db['UserProfileResource'][_0x898a('0x57')]({'name':_0x5f0944[_0x898a('0x37')],'resourceId':_0x5f0944['id'],'type':_0x137935['name'],'sectionId':_0x137935['id']},{})[_0x898a('0x31')](function(){return _0x22f9ba;});}else{return _0x22f9ba;}})[_0x898a('0x23')](function(_0x5b7019){logger[_0x898a('0x1f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5b7019);throw _0x5b7019;});}return _0x22f9ba;});}})[_0x898a('0x31')](respondWithResult(_0x209529,0xc9))['catch'](handleError(_0x209529,null));};exports['create']=function(_0x5ed35e,_0xfdd6d8,_0x473f5c){var _0x3909c5;return db[_0x898a('0x4a')]['create'](_0x5ed35e['body'],{'raw':!![]})[_0x898a('0x31')](function(_0x232be0){_0x3909c5=_0x232be0;return db[_0x898a('0x4a')][_0x898a('0x5d')]({'raw':!![]});})[_0x898a('0x31')](function(_0x41cf94){var _0x30051d=fs[_0x898a('0x5e')](path['join'](config[_0x898a('0x5f')],_0x898a('0x60')),'utf8');var _0x42fda8=fs[_0x898a('0x5e')](path[_0x898a('0x61')](config[_0x898a('0x5f')],_0x898a('0x62')),_0x898a('0x63'));var _0x3bcc3d=ejs[_0x898a('0x64')](_0x30051d,{'trunks':_0x41cf94||[]});fs[_0x898a('0x65')](_0x898a('0x66'),_0x3bcc3d);if(_0x3909c5[_0x898a('0x67')]){var _0x307849=ejs[_0x898a('0x64')](_0x42fda8,{'trunks':_0x41cf94||[]});fs['writeFileSync'](_0x898a('0x68'),_0x307849);}})['then'](function(){return respondWithRpcPromise(_0x898a('0x69'),_0x898a('0x57'),{'module':_0x898a('0x6a')});})['then'](function(){var _0x31102d=_0x5ed35e[_0x898a('0x58')][_0x898a('0x33')]({'plain':!![]});if(!_0x31102d)throw new Error(_0x898a('0x6b'));if(_0x31102d[_0x898a('0x59')]==='user'){var _0x4b9487=_0x3909c5[_0x898a('0x33')]({'plain':!![]});return db[_0x898a('0x5a')][_0x898a('0x52')]({'where':{'name':_0x898a('0x34'),'userProfileId':_0x31102d['userProfileId']},'raw':!![]})[_0x898a('0x31')](function(_0x3d3451){if(_0x3d3451&&_0x3d3451[_0x898a('0x5c')]===0x0){return db[_0x898a('0x35')][_0x898a('0x57')]({'name':_0x4b9487[_0x898a('0x37')],'resourceId':_0x4b9487['id'],'type':_0x3d3451[_0x898a('0x37')],'sectionId':_0x3d3451['id']},{})[_0x898a('0x31')](function(){return _0x3909c5;});}else{return _0x3909c5;}})['catch'](function(_0x32a207){logger[_0x898a('0x1f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x32a207);throw _0x32a207;});}return _0x3909c5;})[_0x898a('0x31')](respondWithResult(_0xfdd6d8,0xc9))['catch'](handleError(_0xfdd6d8,null));};exports[_0x898a('0x30')]=function(_0x4b2575,_0x2471d8,_0x387f2c){var _0x3b07dc;return db[_0x898a('0x4a')][_0x898a('0x52')]({'where':{'id':_0x4b2575[_0x898a('0x4d')]['id']}})[_0x898a('0x31')](handleEntityNotFound(_0x2471d8,null))[_0x898a('0x31')](saveUpdates(_0x4b2575[_0x898a('0x55')],null))['then'](function(_0x3fe54b){if(_0x3fe54b){_0x3b07dc=_0x3fe54b;return db[_0x898a('0x4a')][_0x898a('0x5d')]({'raw':!![]});}})[_0x898a('0x31')](function(_0x290972){if(_0x290972){var _0x1d594b=fs[_0x898a('0x5e')](path[_0x898a('0x61')](config[_0x898a('0x5f')],_0x898a('0x60')),'utf8');var _0x4fad03=fs[_0x898a('0x5e')](path[_0x898a('0x61')](config['root'],'server/files/templates/registry.ejs'),_0x898a('0x63'));var _0x4a79a4=ejs[_0x898a('0x64')](_0x1d594b,{'trunks':_0x290972||[]});fs[_0x898a('0x65')]('/etc/asterisk/sip_xcally_trunks.conf',_0x4a79a4);var _0x3f6815=ejs[_0x898a('0x64')](_0x4fad03,{'trunks':_0x290972||[]});fs[_0x898a('0x65')](_0x898a('0x68'),_0x3f6815);return respondWithRpcPromise(_0x898a('0x69'),_0x898a('0x30'),{'module':_0x898a('0x6a')});}return null;})['then'](function(_0x3237e8){if(_0x3237e8){return _0x3b07dc;}})[_0x898a('0x31')](respondWithResult(_0x2471d8,null))[_0x898a('0x23')](handleError(_0x2471d8,null));};exports['destroy']=function(_0x27560f,_0x61247c,_0x5c6247){var _0x39e917;return db['Trunk']['find']({'where':{'id':_0x27560f['params']['id']}})[_0x898a('0x31')](handleEntityNotFound(_0x61247c,null))[_0x898a('0x31')](removeEntity(_0x61247c,null))[_0x898a('0x31')](function(){return db[_0x898a('0x4a')][_0x898a('0x5d')]({'raw':!![]});})[_0x898a('0x31')](function(_0x12e54b){var _0x50dd52=fs[_0x898a('0x5e')](path['join'](config[_0x898a('0x5f')],_0x898a('0x60')),'utf8');var _0x24670c=fs[_0x898a('0x5e')](path[_0x898a('0x61')](config[_0x898a('0x5f')],_0x898a('0x62')),'utf8');var _0x5847cb=ejs['render'](_0x50dd52,{'trunks':_0x12e54b});var _0x3b8fb5=ejs[_0x898a('0x64')](_0x24670c,{'trunks':_0x12e54b});fs[_0x898a('0x65')]('/etc/asterisk/sip_xcally_trunks.conf',_0x5847cb);fs[_0x898a('0x65')]('/etc/asterisk/sip_xcally_registers.conf',_0x3b8fb5);return respondWithRpcPromise('Reload',_0x898a('0x32'),{'module':_0x898a('0x6a')});})[_0x898a('0x23')](handleError(_0x61247c,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index ce9e095..5a17534 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 _0x4663=['tools_trunks','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','exports','define','Trunk'];(function(_0x1407e4,_0x193f4a){var _0x217bb7=function(_0x51da8c){while(--_0x51da8c){_0x1407e4['push'](_0x1407e4['shift']());}};_0x217bb7(++_0x193f4a);}(_0x4663,0x181));var _0x3466=function(_0x46f0fa,_0x3e40b6){_0x46f0fa=_0x46f0fa-0x0;var _0x57cf6d=_0x4663[_0x46f0fa];return _0x57cf6d;};'use strict';var _=require(_0x3466('0x0'));var util=require(_0x3466('0x1'));var logger=require(_0x3466('0x2'))(_0x3466('0x3'));var moment=require('moment');var BPromise=require(_0x3466('0x4'));var rp=require(_0x3466('0x5'));var fs=require('fs');var path=require(_0x3466('0x6'));var rimraf=require('rimraf');var config=require(_0x3466('0x7'));var attributes=require('./trunk.attributes');module[_0x3466('0x8')]=function(_0x3c6831,_0x830078){return _0x3c6831[_0x3466('0x9')](_0x3466('0xa'),attributes,{'tableName':_0x3466('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x40c1=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./trunk.attributes','Trunk','tools_trunks','lodash'];(function(_0x24cc61,_0x39a24d){var _0x141c7c=function(_0x52a49c){while(--_0x52a49c){_0x24cc61['push'](_0x24cc61['shift']());}};_0x141c7c(++_0x39a24d);}(_0x40c1,0x1ee));var _0x140c=function(_0x56a986,_0xb12824){_0x56a986=_0x56a986-0x0;var _0x3ed6f3=_0x40c1[_0x56a986];return _0x3ed6f3;};'use strict';var _=require(_0x140c('0x0'));var util=require('util');var logger=require(_0x140c('0x1'))(_0x140c('0x2'));var moment=require(_0x140c('0x3'));var BPromise=require(_0x140c('0x4'));var rp=require(_0x140c('0x5'));var fs=require('fs');var path=require(_0x140c('0x6'));var rimraf=require(_0x140c('0x7'));var config=require('../../config/environment');var attributes=require(_0x140c('0x8'));module['exports']=function(_0x41ca2b,_0x2522ef){return _0x41ca2b['define'](_0x140c('0x9'),attributes,{'tableName':_0x140c('0xa'),'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 bf120ac..6de260e 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 _0x8c9e=['model','stringify','catch','ShowTrunk','Trunk','find','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','GetTrunk','options','raw','where','attributes','include','map'];(function(_0x1dd8f6,_0x3ea487){var _0xf083b7=function(_0x237d1d){while(--_0x237d1d){_0x1dd8f6['push'](_0x1dd8f6['shift']());}};_0xf083b7(++_0x3ea487);}(_0x8c9e,0x69));var _0xe8c9=function(_0x406e46,_0x5799cb){_0x406e46=_0x406e46-0x0;var _0x4a3742=_0x8c9e[_0x406e46];return _0x4a3742;};'use strict';var _=require(_0xe8c9('0x0'));var util=require('util');var moment=require(_0xe8c9('0x1'));var BPromise=require(_0xe8c9('0x2'));var rs=require(_0xe8c9('0x3'));var fs=require('fs');var Redis=require(_0xe8c9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe8c9('0x5'));var logger=require(_0xe8c9('0x6'))('rpc');var config=require(_0xe8c9('0x7'));var jayson=require(_0xe8c9('0x8'));var client=jayson[_0xe8c9('0x9')][_0xe8c9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2992e6,_0x149bff,_0x8b6fce){return new BPromise(function(_0x419c1d,_0x105c8d){return client['request'](_0x2992e6,_0x8b6fce)[_0xe8c9('0xb')](function(_0x3aba3c){logger[_0xe8c9('0xc')](_0xe8c9('0xd'),_0x149bff,_0xe8c9('0xe'));logger[_0xe8c9('0xf')]('Trunk,\x20%s,\x20%s,\x20%s',_0x149bff,'request\x20sent',JSON['stringify'](_0x3aba3c));if(_0x3aba3c[_0xe8c9('0x10')]){if(_0x3aba3c[_0xe8c9('0x10')][_0xe8c9('0x11')]===0x1f4){logger[_0xe8c9('0x10')]('Trunk,\x20%s,\x20%s',_0x149bff,_0x3aba3c[_0xe8c9('0x10')]['message']);return _0x105c8d(_0x3aba3c[_0xe8c9('0x10')][_0xe8c9('0x12')]);}logger[_0xe8c9('0x10')](_0xe8c9('0xd'),_0x149bff,_0x3aba3c[_0xe8c9('0x10')][_0xe8c9('0x12')]);return _0x419c1d(_0x3aba3c[_0xe8c9('0x10')][_0xe8c9('0x12')]);}else{logger[_0xe8c9('0xc')](_0xe8c9('0xd'),_0x149bff,_0xe8c9('0xe'));_0x419c1d(_0x3aba3c[_0xe8c9('0x13')]['message']);}})['catch'](function(_0x5c198b){logger[_0xe8c9('0x10')](_0xe8c9('0xd'),_0x149bff,_0x5c198b);_0x105c8d(_0x5c198b);});});}exports[_0xe8c9('0x14')]=function(_0x1b0199){var _0x3a9a27=this;return new Promise(function(_0x5a7bf3,_0x34d40e){return db['Trunk']['findAll']({'raw':_0x1b0199[_0xe8c9('0x15')]?_0x1b0199[_0xe8c9('0x15')][_0xe8c9('0x16')]===undefined?!![]:![]:!![],'where':_0x1b0199[_0xe8c9('0x15')]?_0x1b0199[_0xe8c9('0x15')][_0xe8c9('0x17')]||null:null,'attributes':_0x1b0199['options']?_0x1b0199[_0xe8c9('0x15')][_0xe8c9('0x18')]||null:null,'limit':_0x1b0199[_0xe8c9('0x15')]?_0x1b0199[_0xe8c9('0x15')]['limit']||null:null,'include':_0x1b0199['options']?_0x1b0199[_0xe8c9('0x15')][_0xe8c9('0x19')]?_[_0xe8c9('0x1a')](_0x1b0199['options'][_0xe8c9('0x19')],function(_0x2d7f59){return{'model':db[_0x2d7f59[_0xe8c9('0x1b')]],'as':_0x2d7f59['as'],'attributes':_0x2d7f59[_0xe8c9('0x18')],'include':_0x2d7f59['include']?_['map'](_0x2d7f59['include'],function(_0x55b0c6){return{'model':db[_0x55b0c6[_0xe8c9('0x1b')]],'as':_0x55b0c6['as'],'attributes':_0x55b0c6['attributes'],'include':_0x55b0c6[_0xe8c9('0x19')]?_['map'](_0x55b0c6[_0xe8c9('0x19')],function(_0xfd1460){return{'model':db[_0xfd1460[_0xe8c9('0x1b')]],'as':_0xfd1460['as'],'attributes':_0xfd1460[_0xe8c9('0x18')]};}):[]};}):[]};}):[]:[]})[_0xe8c9('0xb')](function(_0x2f03f2){logger[_0xe8c9('0xc')](_0xe8c9('0x14'),_0x1b0199);logger[_0xe8c9('0xf')](_0xe8c9('0x14'),_0x1b0199,JSON[_0xe8c9('0x1c')](_0x2f03f2));_0x5a7bf3(_0x2f03f2);})[_0xe8c9('0x1d')](function(_0x577e7c){logger[_0xe8c9('0x10')](_0xe8c9('0x14'),_0x577e7c[_0xe8c9('0x12')],_0x1b0199);_0x34d40e(_0x3a9a27['error'](0x1f4,_0x577e7c[_0xe8c9('0x12')]));});});};exports[_0xe8c9('0x1e')]=function(_0x2a4c71){var _0x47316a=this;return new Promise(function(_0x19bb95,_0xea382a){return db[_0xe8c9('0x1f')][_0xe8c9('0x20')]({'raw':_0x2a4c71['options']?_0x2a4c71[_0xe8c9('0x15')][_0xe8c9('0x16')]===undefined?!![]:![]:!![],'where':_0x2a4c71['options']?_0x2a4c71['options'][_0xe8c9('0x17')]||null:null,'attributes':_0x2a4c71[_0xe8c9('0x15')]?_0x2a4c71[_0xe8c9('0x15')][_0xe8c9('0x18')]||null:null,'include':_0x2a4c71[_0xe8c9('0x15')]?_0x2a4c71[_0xe8c9('0x15')][_0xe8c9('0x19')]?_['map'](_0x2a4c71[_0xe8c9('0x15')][_0xe8c9('0x19')],function(_0x4ddf50){return{'model':db[_0x4ddf50['model']],'as':_0x4ddf50['as'],'attributes':_0x4ddf50[_0xe8c9('0x18')],'include':_0x4ddf50[_0xe8c9('0x19')]?_['map'](_0x4ddf50[_0xe8c9('0x19')],function(_0x1d9c8a){return{'model':db[_0x1d9c8a[_0xe8c9('0x1b')]],'as':_0x1d9c8a['as'],'attributes':_0x1d9c8a[_0xe8c9('0x18')],'include':_0x1d9c8a[_0xe8c9('0x19')]?_[_0xe8c9('0x1a')](_0x1d9c8a[_0xe8c9('0x19')],function(_0x1ed03e){return{'model':db[_0x1ed03e[_0xe8c9('0x1b')]],'as':_0x1ed03e['as'],'attributes':_0x1ed03e[_0xe8c9('0x18')]};}):[]};}):[]};}):[]:[]})[_0xe8c9('0xb')](function(_0x58a4c4){logger[_0xe8c9('0xc')](_0xe8c9('0x1e'),_0x2a4c71);logger[_0xe8c9('0xf')](_0xe8c9('0x1e'),_0x2a4c71,JSON['stringify'](_0x58a4c4));_0x19bb95(_0x58a4c4);})[_0xe8c9('0x1d')](function(_0x2471e){logger[_0xe8c9('0x10')](_0xe8c9('0x1e'),_0x2471e['message'],_0x2a4c71);_0xea382a(_0x47316a['error'](0x1f4,_0x2471e[_0xe8c9('0x12')]));});});}; \ No newline at end of file +var _0xdf66=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','Trunk,\x20%s,\x20%s','message','result','catch','Trunk','options','where','attributes','limit','include','map','model','GetTrunk','ShowTrunk','find','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0xdf66,0x8c));var _0x6df6=function(_0x408d22,_0x53eef9){_0x408d22=_0x408d22-0x0;var _0x58effd=_0xdf66[_0x408d22];return _0x58effd;};'use strict';var _=require('lodash');var util=require(_0x6df6('0x0'));var moment=require(_0x6df6('0x1'));var BPromise=require(_0x6df6('0x2'));var rs=require(_0x6df6('0x3'));var fs=require('fs');var Redis=require(_0x6df6('0x4'));var db=require(_0x6df6('0x5'))['db'];var utils=require(_0x6df6('0x6'));var logger=require(_0x6df6('0x7'))(_0x6df6('0x8'));var config=require(_0x6df6('0x9'));var jayson=require(_0x6df6('0xa'));var client=jayson[_0x6df6('0xb')][_0x6df6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1faa4e,_0x3ad437,_0x33f0e3){return new BPromise(function(_0x4e9cb3,_0xcbe268){return client[_0x6df6('0xd')](_0x1faa4e,_0x33f0e3)[_0x6df6('0xe')](function(_0x35095f){logger[_0x6df6('0xf')]('Trunk,\x20%s,\x20%s',_0x3ad437,'request\x20sent');logger[_0x6df6('0x10')](_0x6df6('0x11'),_0x3ad437,_0x6df6('0x12'),JSON[_0x6df6('0x13')](_0x35095f));if(_0x35095f[_0x6df6('0x14')]){if(_0x35095f[_0x6df6('0x14')]['code']===0x1f4){logger[_0x6df6('0x14')](_0x6df6('0x15'),_0x3ad437,_0x35095f[_0x6df6('0x14')]['message']);return _0xcbe268(_0x35095f[_0x6df6('0x14')][_0x6df6('0x16')]);}logger[_0x6df6('0x14')]('Trunk,\x20%s,\x20%s',_0x3ad437,_0x35095f['error'][_0x6df6('0x16')]);return _0x4e9cb3(_0x35095f['error'][_0x6df6('0x16')]);}else{logger['info'](_0x6df6('0x15'),_0x3ad437,_0x6df6('0x12'));_0x4e9cb3(_0x35095f[_0x6df6('0x17')][_0x6df6('0x16')]);}})[_0x6df6('0x18')](function(_0x37fbfe){logger[_0x6df6('0x14')](_0x6df6('0x15'),_0x3ad437,_0x37fbfe);_0xcbe268(_0x37fbfe);});});}exports['GetTrunk']=function(_0x3949da){var _0x1495af=this;return new Promise(function(_0x5ca005,_0x5949af){return db[_0x6df6('0x19')]['findAll']({'raw':_0x3949da[_0x6df6('0x1a')]?_0x3949da[_0x6df6('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x3949da[_0x6df6('0x1a')]?_0x3949da['options'][_0x6df6('0x1b')]||null:null,'attributes':_0x3949da[_0x6df6('0x1a')]?_0x3949da[_0x6df6('0x1a')][_0x6df6('0x1c')]||null:null,'limit':_0x3949da[_0x6df6('0x1a')]?_0x3949da[_0x6df6('0x1a')][_0x6df6('0x1d')]||null:null,'include':_0x3949da[_0x6df6('0x1a')]?_0x3949da[_0x6df6('0x1a')][_0x6df6('0x1e')]?_[_0x6df6('0x1f')](_0x3949da[_0x6df6('0x1a')][_0x6df6('0x1e')],function(_0x2b1154){return{'model':db[_0x2b1154[_0x6df6('0x20')]],'as':_0x2b1154['as'],'attributes':_0x2b1154['attributes'],'include':_0x2b1154[_0x6df6('0x1e')]?_['map'](_0x2b1154[_0x6df6('0x1e')],function(_0x4ee665){return{'model':db[_0x4ee665['model']],'as':_0x4ee665['as'],'attributes':_0x4ee665[_0x6df6('0x1c')],'include':_0x4ee665[_0x6df6('0x1e')]?_['map'](_0x4ee665['include'],function(_0xee0355){return{'model':db[_0xee0355['model']],'as':_0xee0355['as'],'attributes':_0xee0355[_0x6df6('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x6df6('0xe')](function(_0x17a97b){logger[_0x6df6('0xf')](_0x6df6('0x21'),_0x3949da);logger['debug'](_0x6df6('0x21'),_0x3949da,JSON[_0x6df6('0x13')](_0x17a97b));_0x5ca005(_0x17a97b);})[_0x6df6('0x18')](function(_0x357c45){logger[_0x6df6('0x14')](_0x6df6('0x21'),_0x357c45[_0x6df6('0x16')],_0x3949da);_0x5949af(_0x1495af[_0x6df6('0x14')](0x1f4,_0x357c45['message']));});});};exports[_0x6df6('0x22')]=function(_0x45b6a9){var _0xcdfbb7=this;return new Promise(function(_0x4af943,_0x9592b7){return db[_0x6df6('0x19')][_0x6df6('0x23')]({'raw':_0x45b6a9['options']?_0x45b6a9['options'][_0x6df6('0x24')]===undefined?!![]:![]:!![],'where':_0x45b6a9[_0x6df6('0x1a')]?_0x45b6a9[_0x6df6('0x1a')][_0x6df6('0x1b')]||null:null,'attributes':_0x45b6a9[_0x6df6('0x1a')]?_0x45b6a9[_0x6df6('0x1a')]['attributes']||null:null,'include':_0x45b6a9[_0x6df6('0x1a')]?_0x45b6a9['options']['include']?_['map'](_0x45b6a9[_0x6df6('0x1a')][_0x6df6('0x1e')],function(_0x25653a){return{'model':db[_0x25653a['model']],'as':_0x25653a['as'],'attributes':_0x25653a[_0x6df6('0x1c')],'include':_0x25653a['include']?_[_0x6df6('0x1f')](_0x25653a[_0x6df6('0x1e')],function(_0x404a83){return{'model':db[_0x404a83[_0x6df6('0x20')]],'as':_0x404a83['as'],'attributes':_0x404a83['attributes'],'include':_0x404a83[_0x6df6('0x1e')]?_[_0x6df6('0x1f')](_0x404a83[_0x6df6('0x1e')],function(_0x48dee1){return{'model':db[_0x48dee1[_0x6df6('0x20')]],'as':_0x48dee1['as'],'attributes':_0x48dee1[_0x6df6('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x6df6('0xe')](function(_0x5e1b7e){logger[_0x6df6('0xf')](_0x6df6('0x22'),_0x45b6a9);logger[_0x6df6('0x10')]('ShowTrunk',_0x45b6a9,JSON[_0x6df6('0x13')](_0x5e1b7e));_0x4af943(_0x5e1b7e);})[_0x6df6('0x18')](function(_0x5bc853){logger[_0x6df6('0x14')](_0x6df6('0x22'),_0x5bc853[_0x6df6('0x16')],_0x45b6a9);_0x9592b7(_0xcdfbb7[_0x6df6('0x14')](0x1f4,_0x5bc853[_0x6df6('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index bfad4a3..c601a69 100644 --- a/server/api/user-setting/index.js +++ b/server/api/user-setting/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa5df=['exports','express','../../components/auth/service','./user-setting.controller','/:id','isAuthenticated','update'];(function(_0x40c874,_0x398d97){var _0x39790f=function(_0x14d071){while(--_0x14d071){_0x40c874['push'](_0x40c874['shift']());}};_0x39790f(++_0x398d97);}(_0xa5df,0x1dd));var _0xfa5d=function(_0x5dfd4a,_0x290a37){_0x5dfd4a=_0x5dfd4a-0x0;var _0x408af1=_0xa5df[_0x5dfd4a];return _0x408af1;};'use strict';var express=require(_0xfa5d('0x0'));var router=express['Router']();var auth=require(_0xfa5d('0x1'));var controller=require(_0xfa5d('0x2'));router['put'](_0xfa5d('0x3'),auth[_0xfa5d('0x4')](),controller[_0xfa5d('0x5')]);module[_0xfa5d('0x6')]=router; \ No newline at end of file +var _0x00a2=['express','Router','put','/:id','isAuthenticated','exports'];(function(_0x5bb8c3,_0x4e244c){var _0x27f270=function(_0x373d39){while(--_0x373d39){_0x5bb8c3['push'](_0x5bb8c3['shift']());}};_0x27f270(++_0x4e244c);}(_0x00a2,0x180));var _0x200a=function(_0x48feeb,_0x252dea){_0x48feeb=_0x48feeb-0x0;var _0x362555=_0x00a2[_0x48feeb];return _0x362555;};'use strict';var express=require(_0x200a('0x0'));var router=express[_0x200a('0x1')]();var auth=require('../../components/auth/service');var controller=require('./user-setting.controller');router[_0x200a('0x2')](_0x200a('0x3'),auth[_0x200a('0x4')](),controller['update']);module[_0x200a('0x5')]=router; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.attributes.js b/server/api/user-setting/user-setting.attributes.js index 5711fa7..93595d8 100644 --- a/server/api/user-setting/user-setting.attributes.js +++ b/server/api/user-setting/user-setting.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x38c1=['DATE','INTEGER','UserId','error','warning','info','exports','BOOLEAN','TEXT'];(function(_0x44fca2,_0x86201){var _0x5ce526=function(_0x1731d3){while(--_0x1731d3){_0x44fca2['push'](_0x44fca2['shift']());}};_0x5ce526(++_0x86201);}(_0x38c1,0x8a));var _0x138c=function(_0x19a4ae,_0x21054a){_0x19a4ae=_0x19a4ae-0x0;var _0x13b6c3=_0x38c1[_0x19a4ae];return _0x13b6c3;};'use strict';var Sequelize=require('sequelize');const CLIENT_SIDE_LOG_LEVELS=[_0x138c('0x0'),_0x138c('0x1'),_0x138c('0x2'),'debug'];module[_0x138c('0x3')]={'clientSideLoggingLevel':{'type':Sequelize['ENUM'](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':'error','validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x138c('0x4')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x138c('0x5')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x138c('0x6')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x138c('0x7')],'unique':_0x138c('0x8')}}; \ No newline at end of file +var _0x1ea5=['BOOLEAN','DATE','INTEGER','sequelize','error','warning','debug','exports','ENUM'];(function(_0x5e4a6d,_0xff45ac){var _0x531c13=function(_0x495ef3){while(--_0x495ef3){_0x5e4a6d['push'](_0x5e4a6d['shift']());}};_0x531c13(++_0xff45ac);}(_0x1ea5,0x135));var _0x51ea=function(_0x3817a9,_0x29e215){_0x3817a9=_0x3817a9-0x0;var _0x443f30=_0x1ea5[_0x3817a9];return _0x443f30;};'use strict';var Sequelize=require(_0x51ea('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0x51ea('0x1'),_0x51ea('0x2'),'info',_0x51ea('0x3')];module[_0x51ea('0x4')]={'clientSideLoggingLevel':{'type':Sequelize[_0x51ea('0x5')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x51ea('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x51ea('0x6')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize['TEXT'],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x51ea('0x7')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x51ea('0x8')],'unique':'UserId'}}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.controller.js b/server/api/user-setting/user-setting.controller.js index a1b5344..c9f61bf 100644 --- a/server/api/user-setting/user-setting.controller.js +++ b/server/api/user-setting/user-setting.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0fc2=['find','catch','lodash','ioredis','../../config/logger','api','../../mysqldb','socket.io-emitter','redis','./user-setting.socket','register','defaults','localhost','status','json','then','sendStatus','error','stack','name','send','user','admin','Unauthorized','params','Invalid\x20user\x20setting\x20id','UserSetting'];(function(_0x5efa62,_0x6b3d77){var _0x15c874=function(_0x32e172){while(--_0x32e172){_0x5efa62['push'](_0x5efa62['shift']());}};_0x15c874(++_0x6b3d77);}(_0x0fc2,0x6e));var _0x20fc=function(_0x4d9fe1,_0x65ee91){_0x4d9fe1=_0x4d9fe1-0x0;var _0xf3437d=_0x0fc2[_0x4d9fe1];return _0xf3437d;};'use strict';var _=require(_0x20fc('0x0'));var Redis=require(_0x20fc('0x1'));var logger=require(_0x20fc('0x2'))(_0x20fc('0x3'));var config=require('../../config/environment');var db=require(_0x20fc('0x4'))['db'];var socket=require(_0x20fc('0x5'))(new Redis(config[_0x20fc('0x6')]));require(_0x20fc('0x7'))[_0x20fc('0x8')](socket);config[_0x20fc('0x6')]=_[_0x20fc('0x9')](config[_0x20fc('0x6')],{'host':_0x20fc('0xa'),'port':0x18eb});function respondWithResult(_0xc556e8,_0x157c28){_0x157c28=_0x157c28||0xc8;return function(_0x470d1a){if(_0x470d1a){return _0xc556e8[_0x20fc('0xb')](_0x157c28)[_0x20fc('0xc')](_0x470d1a);}};}function saveUpdates(_0x1e28b5){return function(_0xc12138){if(_0xc12138){return _0xc12138['update'](_0x1e28b5)[_0x20fc('0xd')](function(_0x3f25d1){return _0x3f25d1;});}return null;};}function handleEntityNotFound(_0x31413f){return function(_0x4da5b3){if(!_0x4da5b3){_0x31413f[_0x20fc('0xe')](0x194);}return _0x4da5b3;};}function handleError(_0x42537c,_0x431c45){_0x431c45=_0x431c45||0x1f4;return function(_0x42b609){logger[_0x20fc('0xf')](_0x42b609[_0x20fc('0x10')]);if(_0x42b609[_0x20fc('0x11')]){delete _0x42b609[_0x20fc('0x11')];}_0x42537c['status'](_0x431c45)[_0x20fc('0x12')](_0x42b609);};}exports['update']=function(_0x2b0b4a,_0x501ab7){if(_0x2b0b4a[_0x20fc('0x13')]['role']!==_0x20fc('0x14'))throw new Error(_0x20fc('0x15'));if(isNaN(Number(_0x2b0b4a[_0x20fc('0x16')]['id'])))throw new Error(_0x20fc('0x17'));return db[_0x20fc('0x18')][_0x20fc('0x19')]({'where':{'id':_0x2b0b4a[_0x20fc('0x16')]['id']}})[_0x20fc('0xd')](handleEntityNotFound(_0x501ab7,null))['then'](saveUpdates(_0x2b0b4a['body'],null))[_0x20fc('0xd')](respondWithResult(_0x501ab7,null))[_0x20fc('0x1a')](handleError(_0x501ab7,null));}; \ No newline at end of file +var _0x9bde=['stack','name','admin','Unauthorized','params','Invalid\x20user\x20setting\x20id','UserSetting','find','body','ioredis','api','../../mysqldb','socket.io-emitter','redis','./user-setting.socket','register','defaults','localhost','status','json','update','then','sendStatus','error'];(function(_0x15bb3f,_0x40d0a5){var _0x53b4ae=function(_0x134412){while(--_0x134412){_0x15bb3f['push'](_0x15bb3f['shift']());}};_0x53b4ae(++_0x40d0a5);}(_0x9bde,0xe1));var _0xe9bd=function(_0x214f95,_0x5bedb5){_0x214f95=_0x214f95-0x0;var _0x159c0d=_0x9bde[_0x214f95];return _0x159c0d;};'use strict';var _=require('lodash');var Redis=require(_0xe9bd('0x0'));var logger=require('../../config/logger')(_0xe9bd('0x1'));var config=require('../../config/environment');var db=require(_0xe9bd('0x2'))['db'];var socket=require(_0xe9bd('0x3'))(new Redis(config[_0xe9bd('0x4')]));require(_0xe9bd('0x5'))[_0xe9bd('0x6')](socket);config[_0xe9bd('0x4')]=_[_0xe9bd('0x7')](config['redis'],{'host':_0xe9bd('0x8'),'port':0x18eb});function respondWithResult(_0x5f18fe,_0x22a438){_0x22a438=_0x22a438||0xc8;return function(_0xa66ae2){if(_0xa66ae2){return _0x5f18fe[_0xe9bd('0x9')](_0x22a438)[_0xe9bd('0xa')](_0xa66ae2);}};}function saveUpdates(_0x29bc2b){return function(_0xbefddb){if(_0xbefddb){return _0xbefddb[_0xe9bd('0xb')](_0x29bc2b)[_0xe9bd('0xc')](function(_0x581602){return _0x581602;});}return null;};}function handleEntityNotFound(_0x5f36c8){return function(_0x3c8e95){if(!_0x3c8e95){_0x5f36c8[_0xe9bd('0xd')](0x194);}return _0x3c8e95;};}function handleError(_0x2601ac,_0x581ab9){_0x581ab9=_0x581ab9||0x1f4;return function(_0x12c96e){logger[_0xe9bd('0xe')](_0x12c96e[_0xe9bd('0xf')]);if(_0x12c96e[_0xe9bd('0x10')]){delete _0x12c96e['name'];}_0x2601ac[_0xe9bd('0x9')](_0x581ab9)['send'](_0x12c96e);};}exports[_0xe9bd('0xb')]=function(_0x429e88,_0x3435b4){if(_0x429e88['user']['role']!==_0xe9bd('0x11'))throw new Error(_0xe9bd('0x12'));if(isNaN(Number(_0x429e88[_0xe9bd('0x13')]['id'])))throw new Error(_0xe9bd('0x14'));return db[_0xe9bd('0x15')][_0xe9bd('0x16')]({'where':{'id':_0x429e88[_0xe9bd('0x13')]['id']}})['then'](handleEntityNotFound(_0x3435b4,null))[_0xe9bd('0xc')](saveUpdates(_0x429e88[_0xe9bd('0x17')],null))[_0xe9bd('0xc')](respondWithResult(_0x3435b4,null))['catch'](handleError(_0x3435b4,null));}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.events.js b/server/api/user-setting/user-setting.events.js index 6fe9cf1..ad960b0 100644 --- a/server/api/user-setting/user-setting.events.js +++ b/server/api/user-setting/user-setting.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3d4e=['exports','events','UserSetting','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x250fa0,_0x3d0ca7){var _0x45a2e6=function(_0x183927){while(--_0x183927){_0x250fa0['push'](_0x250fa0['shift']());}};_0x45a2e6(++_0x3d0ca7);}(_0x3d4e,0x160));var _0xe3d4=function(_0x44f3ce,_0x1b09f3){_0x44f3ce=_0x44f3ce-0x0;var _0x26a2f2=_0x3d4e[_0x44f3ce];return _0x26a2f2;};'use strict';var EventEmitter=require(_0xe3d4('0x0'));var UserSetting=require('../../mysqldb')['db'][_0xe3d4('0x1')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0xe3d4('0x2')](0x0);var events={'afterCreate':_0xe3d4('0x3'),'afterUpdate':_0xe3d4('0x4'),'afterDestroy':'remove'};function emitEvent(_0x256640){return function(_0x9ac433,_0x2c5439,_0xfeadbc){UserSettingEvents[_0xe3d4('0x5')](_0x256640+':'+_0x9ac433['id'],_0x9ac433);UserSettingEvents['emit'](_0x256640,_0x9ac433);_0xfeadbc(null);};}for(var e in events){if(events[_0xe3d4('0x6')](e)){var event=events[e];UserSetting[_0xe3d4('0x7')](e,emitEvent(event));}}module[_0xe3d4('0x8')]=UserSettingEvents; \ No newline at end of file +var _0x8b43=['update','remove','emit','hasOwnProperty','exports','../../mysqldb','setMaxListeners'];(function(_0x3bad26,_0x1cf013){var _0x42e1ff=function(_0xb53d84){while(--_0xb53d84){_0x3bad26['push'](_0x3bad26['shift']());}};_0x42e1ff(++_0x1cf013);}(_0x8b43,0x18d));var _0x38b4=function(_0x112e05,_0xd275c1){_0x112e05=_0x112e05-0x0;var _0x565beb=_0x8b43[_0x112e05];return _0x565beb;};'use strict';var EventEmitter=require('events');var UserSetting=require(_0x38b4('0x0'))['db']['UserSetting'];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x38b4('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x38b4('0x2'),'afterDestroy':_0x38b4('0x3')};function emitEvent(_0x3bbc5b){return function(_0x1f81e4,_0x23b6ca,_0x566b6c){UserSettingEvents['emit'](_0x3bbc5b+':'+_0x1f81e4['id'],_0x1f81e4);UserSettingEvents[_0x38b4('0x4')](_0x3bbc5b,_0x1f81e4);_0x566b6c(null);};}for(var e in events){if(events[_0x38b4('0x5')](e)){var event=events[e];UserSetting['hook'](e,emitEvent(event));}}module[_0x38b4('0x6')]=UserSettingEvents; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.model.js b/server/api/user-setting/user-setting.model.js index 9edde71..458775e 100644 --- a/server/api/user-setting/user-setting.model.js +++ b/server/api/user-setting/user-setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7dc2=['user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince','define','UserSetting'];(function(_0x31080a,_0x55b5cd){var _0x58d2fc=function(_0x446558){while(--_0x446558){_0x31080a['push'](_0x31080a['shift']());}};_0x58d2fc(++_0x55b5cd);}(_0x7dc2,0x19d));var _0x27dc=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7dc2[_0x20a584];return _0x4b41a8;};'use strict';var attributes=require('./user-setting.attributes');module['exports']=function(_0xf99173){return _0xf99173[_0x27dc('0x0')](_0x27dc('0x1'),attributes,{'tableName':_0x27dc('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x57d4b4){if(!_0x57d4b4[_0x27dc('0x3')])_0x57d4b4[_0x27dc('0x4')]=null;else if(_0x57d4b4['clientSideLoggingEnabledSince']===null)_0x57d4b4[_0x27dc('0x4')]=new Date();}}});}; \ No newline at end of file +var _0x2964=['define','UserSetting','user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes','exports'];(function(_0x3d5425,_0x1337c0){var _0x1224b7=function(_0x45965a){while(--_0x45965a){_0x3d5425['push'](_0x3d5425['shift']());}};_0x1224b7(++_0x1337c0);}(_0x2964,0x108));var _0x4296=function(_0x400c97,_0x59135c){_0x400c97=_0x400c97-0x0;var _0x18e146=_0x2964[_0x400c97];return _0x18e146;};'use strict';var attributes=require(_0x4296('0x0'));module[_0x4296('0x1')]=function(_0x31be5e){return _0x31be5e[_0x4296('0x2')](_0x4296('0x3'),attributes,{'tableName':_0x4296('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xb24db7){if(!_0xb24db7[_0x4296('0x5')])_0xb24db7[_0x4296('0x6')]=null;else if(_0xb24db7['clientSideLoggingEnabledSince']===null)_0xb24db7[_0x4296('0x6')]=new Date();}}});}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.socket.js b/server/api/user-setting/user-setting.socket.js index 00e2893..d100add 100644 --- a/server/api/user-setting/user-setting.socket.js +++ b/server/api/user-setting/user-setting.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8d87=['emit','user-setting:update:user-','UserId','length','user-setting:','./user-setting.events','save','remove','update'];(function(_0x4f6f8d,_0xae71c0){var _0x275f2=function(_0x4f3494){while(--_0x4f3494){_0x4f6f8d['push'](_0x4f6f8d['shift']());}};_0x275f2(++_0xae71c0);}(_0x8d87,0x1ac));var _0x78d8=function(_0x2b84d5,_0x428914){_0x2b84d5=_0x2b84d5-0x0;var _0x51452a=_0x8d87[_0x2b84d5];return _0x51452a;};'use strict';var UserSettingEvents=require(_0x78d8('0x0'));var events=[_0x78d8('0x1'),_0x78d8('0x2'),_0x78d8('0x3')];function createListener(_0x3efc6f,_0x40b079){return function(_0x452b78){_0x40b079[_0x78d8('0x4')](_0x3efc6f,_0x452b78);if(_0x3efc6f==='user-setting:update'){_0x40b079[_0x78d8('0x4')](_0x78d8('0x5')+_0x452b78[_0x78d8('0x6')],_0x452b78);}};}exports['register']=function(_0x1c0897){for(var _0xf11d67=0x0,_0x464ea6=events[_0x78d8('0x7')];_0xf11d67<_0x464ea6;_0xf11d67++){var _0x4744b0=events[_0xf11d67];var _0x38fefa=createListener(_0x78d8('0x8')+_0x4744b0,_0x1c0897);UserSettingEvents['on'](_0x4744b0,_0x38fefa);}}; \ No newline at end of file +var _0xa557=['UserId','register','length','user-setting:','save','remove','update','emit','user-setting:update:user-'];(function(_0x4206f5,_0x21f338){var _0xa29cf3=function(_0x2d35d7){while(--_0x2d35d7){_0x4206f5['push'](_0x4206f5['shift']());}};_0xa29cf3(++_0x21f338);}(_0xa557,0x1ab));var _0x7a55=function(_0x1edba1,_0x4fe9e3){_0x1edba1=_0x1edba1-0x0;var _0x20c988=_0xa557[_0x1edba1];return _0x20c988;};'use strict';var UserSettingEvents=require('./user-setting.events');var events=[_0x7a55('0x0'),_0x7a55('0x1'),_0x7a55('0x2')];function createListener(_0x6f7067,_0x54a9c5){return function(_0x21e496){_0x54a9c5[_0x7a55('0x3')](_0x6f7067,_0x21e496);if(_0x6f7067==='user-setting:update'){_0x54a9c5[_0x7a55('0x3')](_0x7a55('0x4')+_0x21e496[_0x7a55('0x5')],_0x21e496);}};}exports[_0x7a55('0x6')]=function(_0x475956){for(var _0x5c6385=0x0,_0x2c6396=events[_0x7a55('0x7')];_0x5c6385<_0x2c6396;_0x5c6385++){var _0x1cb28c=events[_0x5c6385];var _0x1e9e5f=createListener(_0x7a55('0x8')+_0x1cb28c,_0x475956);UserSettingEvents['on'](_0x1cb28c,_0x1e9e5f);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index af97ec3..e687b49 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 _0x7c21=['getSmsAccounts','/:id/chat_websites','getChatWebsites','getWhatsappAccounts','/:id/scheduled_calls','getScheduledCalls','addContacts','post','create','/create_many','bulkCreate','join','root','format','%s-%s','now','originalname','/:id/avatar','addAvatar','/:id/login','logout','/:id/pause','pause','/:id/teams','/:id/chat_interactions','/:id/mail_interactions','/:id/fax_interactions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','/:id/whatsapp_accounts','/:id/api_key','createApiKey','put','/:id','changePassword','delete','removeMailInteractions','removeFaxInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeMailAccounts','removeSmsAccounts','removeWhatsappAccounts','removeApiKey','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','isAuthenticated','/describe','describe','get','/whoami','whoami','/presence','show','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','getTeams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','/:id/sms_accounts'];(function(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0x7c21,0x1e2));var _0x17c2=function(_0x539b0f,_0x511c48){_0x539b0f=_0x539b0f-0x0;var _0xf5d0e1=_0x7c21[_0x539b0f];return _0xf5d0e1;};'use strict';var multer=require(_0x17c2('0x0'));var util=require(_0x17c2('0x1'));var path=require(_0x17c2('0x2'));var timeout=require('connect-timeout');var express=require(_0x17c2('0x3'));var router=express[_0x17c2('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x17c2('0x5'));var interaction=require(_0x17c2('0x6'));var config=require(_0x17c2('0x7'));var controller=require(_0x17c2('0x8'));router['get']('/',auth[_0x17c2('0x9')](),controller['index']);router['get'](_0x17c2('0xa'),auth[_0x17c2('0x9')](),controller[_0x17c2('0xb')]);router[_0x17c2('0xc')](_0x17c2('0xd'),auth[_0x17c2('0x9')](),controller[_0x17c2('0xe')]);router['get'](_0x17c2('0xf'),auth['isAuthenticated'](),controller['getPresence']);router[_0x17c2('0xc')]('/:id',auth[_0x17c2('0x9')](),controller[_0x17c2('0x10')]);router[_0x17c2('0xc')]('/:id/avatar',controller['getAvatar']);router[_0x17c2('0xc')]('/:id/open_tabs',auth[_0x17c2('0x9')](),controller[_0x17c2('0x11')]);router[_0x17c2('0xc')](_0x17c2('0x12'),auth['isAuthenticated'](),controller[_0x17c2('0x13')]);router[_0x17c2('0xc')](_0x17c2('0x14'),auth[_0x17c2('0x9')](),controller[_0x17c2('0x15')]);router['get'](_0x17c2('0x16'),auth[_0x17c2('0x9')](),controller[_0x17c2('0x17')]);router[_0x17c2('0xc')](_0x17c2('0x18'),auth[_0x17c2('0x9')](),controller[_0x17c2('0x19')]);router['get'](_0x17c2('0x1a'),auth[_0x17c2('0x9')](),controller[_0x17c2('0x1b')]);router[_0x17c2('0xc')](_0x17c2('0x1c'),auth[_0x17c2('0x9')](),controller[_0x17c2('0x1d')]);router[_0x17c2('0xc')](_0x17c2('0x1e'),auth[_0x17c2('0x9')](),controller[_0x17c2('0x1f')]);router[_0x17c2('0xc')](_0x17c2('0x20'),auth[_0x17c2('0x9')](),controller['getOpenchannelInteractions']);router['get']('/:id/mail/interactions',auth[_0x17c2('0x9')](),controller[_0x17c2('0x21')]);router[_0x17c2('0xc')](_0x17c2('0x22'),auth[_0x17c2('0x9')](),controller[_0x17c2('0x23')]);router[_0x17c2('0xc')](_0x17c2('0x24'),auth[_0x17c2('0x9')](),controller[_0x17c2('0x25')]);router[_0x17c2('0xc')](_0x17c2('0x26'),auth[_0x17c2('0x9')](),controller[_0x17c2('0x27')]);router[_0x17c2('0xc')]('/:id/teams',auth[_0x17c2('0x9')](),controller[_0x17c2('0x28')]);router['get'](_0x17c2('0x29'),auth[_0x17c2('0x9')](),controller[_0x17c2('0x2a')]);router[_0x17c2('0xc')](_0x17c2('0x2b'),auth['isAuthenticated'](),controller[_0x17c2('0x2c')]);router['get'](_0x17c2('0x2d'),auth[_0x17c2('0x9')](),controller[_0x17c2('0x2e')]);router[_0x17c2('0xc')](_0x17c2('0x2f'),auth['isAuthenticated'](),controller[_0x17c2('0x30')]);router[_0x17c2('0xc')](_0x17c2('0x31'),auth['isAuthenticated'](),controller[_0x17c2('0x32')]);router[_0x17c2('0xc')](_0x17c2('0x33'),auth[_0x17c2('0x9')](),controller['getOpenchannelAccounts']);router[_0x17c2('0xc')](_0x17c2('0x34'),auth['isAuthenticated'](),controller[_0x17c2('0x35')]);router['get'](_0x17c2('0x36'),auth[_0x17c2('0x9')](),controller[_0x17c2('0x37')]);router['get']('/:id/whatsapp_accounts',auth[_0x17c2('0x9')](),controller[_0x17c2('0x38')]);router[_0x17c2('0xc')](_0x17c2('0x39'),auth['isAuthenticated'](),controller[_0x17c2('0x3a')]);router[_0x17c2('0xc')]('/:id/api_key',auth[_0x17c2('0x9')](),controller['getApiKey']);router['post'](_0x17c2('0x12'),auth['isAuthenticated'](),controller[_0x17c2('0x3b')]);router[_0x17c2('0x3c')]('/',auth['isAuthenticated'](),controller[_0x17c2('0x3d')]);router[_0x17c2('0x3c')](_0x17c2('0x3e'),auth['isAuthenticated'](),controller[_0x17c2('0x3f')]);router[_0x17c2('0x3c')]('/:id/queues',auth[_0x17c2('0x9')](),controller['addQueues']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x48b98a,_0x54b355,_0x34cb6e){_0x34cb6e(null,path[_0x17c2('0x40')](config[_0x17c2('0x41')],'server/files/images/'));},'filename':function(_0x1658ec,_0x48e793,_0x9ddc3b){_0x9ddc3b(null,util[_0x17c2('0x42')](_0x17c2('0x43'),Date[_0x17c2('0x44')](),_0x48e793[_0x17c2('0x45')]));}})});router[_0x17c2('0x3c')](_0x17c2('0x46'),upload['single']('file'),controller[_0x17c2('0x47')]);router[_0x17c2('0x3c')](_0x17c2('0x48'),auth[_0x17c2('0x9')](),controller['login']);router['post']('/:id/logout',auth[_0x17c2('0x9')](),controller[_0x17c2('0x49')]);router[_0x17c2('0x3c')](_0x17c2('0x4a'),auth[_0x17c2('0x9')](),controller[_0x17c2('0x4b')]);router['post']('/:id/unpause',auth[_0x17c2('0x9')](),controller['unpause']);router['post'](_0x17c2('0x4c'),auth[_0x17c2('0x9')](),controller['addTeams']);router[_0x17c2('0x3c')](_0x17c2('0x4d'),auth[_0x17c2('0x9')](),controller['addChatInteractions']);router[_0x17c2('0x3c')](_0x17c2('0x4e'),auth[_0x17c2('0x9')](),controller['addMailInteractions']);router['post'](_0x17c2('0x4f'),auth[_0x17c2('0x9')](),controller['addFaxInteractions']);router[_0x17c2('0x3c')](_0x17c2('0x50'),auth[_0x17c2('0x9')](),controller[_0x17c2('0x51')]);router[_0x17c2('0x3c')](_0x17c2('0x52'),auth[_0x17c2('0x9')](),controller[_0x17c2('0x53')]);router[_0x17c2('0x3c')](_0x17c2('0x54'),auth[_0x17c2('0x9')](),controller[_0x17c2('0x55')]);router[_0x17c2('0x3c')]('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0x17c2('0x56')]);router[_0x17c2('0x3c')]('/:id/mail_accounts',auth[_0x17c2('0x9')](),controller[_0x17c2('0x57')]);router[_0x17c2('0x3c')](_0x17c2('0x33'),auth[_0x17c2('0x9')](),controller[_0x17c2('0x58')]);router['post'](_0x17c2('0x34'),auth['isAuthenticated'](),controller[_0x17c2('0x59')]);router['post']('/:id/chat_websites',auth[_0x17c2('0x9')](),controller[_0x17c2('0x5a')]);router['post'](_0x17c2('0x5b'),auth['isAuthenticated'](),controller['addWhatsappAccounts']);router[_0x17c2('0x3c')](_0x17c2('0x5c'),auth[_0x17c2('0x9')](),controller[_0x17c2('0x5d')]);router[_0x17c2('0x5e')](_0x17c2('0x5f'),auth[_0x17c2('0x9')](),controller['update']);router[_0x17c2('0x5e')]('/:id/password',auth[_0x17c2('0x9')](),controller[_0x17c2('0x60')]);router[_0x17c2('0x61')](_0x17c2('0x14'),auth[_0x17c2('0x9')](),controller['removeQueues']);router[_0x17c2('0x61')]('/:id/teams',auth[_0x17c2('0x9')](),controller['removeTeams']);router[_0x17c2('0x61')]('/:id',auth[_0x17c2('0x9')](),controller['destroy']);router['delete']('/:id/chat_interactions',auth[_0x17c2('0x9')](),controller['removeChatInteractions']);router[_0x17c2('0x61')](_0x17c2('0x4e'),auth['isAuthenticated'](),controller[_0x17c2('0x62')]);router['delete']('/:id/fax_interactions',auth[_0x17c2('0x9')](),controller[_0x17c2('0x63')]);router['delete'](_0x17c2('0x50'),auth[_0x17c2('0x9')](),controller['removeSmsInteractions']);router[_0x17c2('0x61')](_0x17c2('0x52'),auth['isAuthenticated'](),controller[_0x17c2('0x64')]);router['delete'](_0x17c2('0x54'),auth['isAuthenticated'](),controller[_0x17c2('0x65')]);router[_0x17c2('0x61')](_0x17c2('0x2f'),auth[_0x17c2('0x9')](),controller['removeFaxAccounts']);router[_0x17c2('0x61')](_0x17c2('0x31'),auth['isAuthenticated'](),controller[_0x17c2('0x66')]);router[_0x17c2('0x61')](_0x17c2('0x33'),auth[_0x17c2('0x9')](),controller['removeOpenchannelAccounts']);router[_0x17c2('0x61')](_0x17c2('0x34'),auth['isAuthenticated'](),controller[_0x17c2('0x67')]);router[_0x17c2('0x61')](_0x17c2('0x36'),auth['isAuthenticated'](),controller['removeChatWebsites']);router[_0x17c2('0x61')]('/:id/whatsapp_accounts',auth[_0x17c2('0x9')](),controller[_0x17c2('0x68')]);router[_0x17c2('0x61')](_0x17c2('0x5c'),auth[_0x17c2('0x9')](),controller[_0x17c2('0x69')]);module[_0x17c2('0x6a')]=router; \ No newline at end of file +var _0x29c1=['../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','index','/describe','isAuthenticated','/whoami','getPresence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','getRecordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','getTeams','getLists','/:id/agents','getAgents','/:id/prefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','addContacts','create','/create_many','bulkCreate','addQueues','diskStorage','join','root','server/files/images/','%s-%s','now','originalname','single','file','/:id/login','login','/:id/logout','logout','/:id/pause','pause','unpause','/:id/teams','addTeams','addChatInteractions','addMailInteractions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addOpenchannelAccounts','addSmsAccounts','/:id/chat_websites','addWhatsappAccounts','update','put','/:id/password','changePassword','delete','removeQueues','destroy','/:id/chat_interactions','removeMailInteractions','/:id/fax_interactions','removeFaxInteractions','removeSmsInteractions','/:id/openchannel_interactions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeApiKey','exports','util','path','connect-timeout','Router','fs-extra'];(function(_0x13d1ac,_0x3faa4f){var _0x30038f=function(_0x2bf602){while(--_0x2bf602){_0x13d1ac['push'](_0x13d1ac['shift']());}};_0x30038f(++_0x3faa4f);}(_0x29c1,0x72));var _0x129c=function(_0x492fb1,_0xe6be31){_0x492fb1=_0x492fb1-0x0;var _0x17a60c=_0x29c1[_0x492fb1];return _0x17a60c;};'use strict';var multer=require('multer');var util=require(_0x129c('0x0'));var path=require(_0x129c('0x1'));var timeout=require(_0x129c('0x2'));var express=require('express');var router=express[_0x129c('0x3')]();var fs_extra=require(_0x129c('0x4'));var auth=require(_0x129c('0x5'));var interaction=require(_0x129c('0x6'));var config=require(_0x129c('0x7'));var controller=require(_0x129c('0x8'));router[_0x129c('0x9')]('/',auth['isAuthenticated'](),controller[_0x129c('0xa')]);router[_0x129c('0x9')](_0x129c('0xb'),auth[_0x129c('0xc')](),controller['describe']);router[_0x129c('0x9')](_0x129c('0xd'),auth[_0x129c('0xc')](),controller['whoami']);router[_0x129c('0x9')]('/presence',auth[_0x129c('0xc')](),controller[_0x129c('0xe')]);router[_0x129c('0x9')](_0x129c('0xf'),auth[_0x129c('0xc')](),controller[_0x129c('0x10')]);router[_0x129c('0x9')](_0x129c('0x11'),controller[_0x129c('0x12')]);router[_0x129c('0x9')](_0x129c('0x13'),auth[_0x129c('0xc')](),controller[_0x129c('0x14')]);router[_0x129c('0x9')](_0x129c('0x15'),auth[_0x129c('0xc')](),controller[_0x129c('0x16')]);router['get'](_0x129c('0x17'),auth[_0x129c('0xc')](),controller[_0x129c('0x18')]);router[_0x129c('0x9')](_0x129c('0x19'),auth[_0x129c('0xc')](),controller[_0x129c('0x1a')]);router['get'](_0x129c('0x1b'),auth[_0x129c('0xc')](),controller[_0x129c('0x1c')]);router[_0x129c('0x9')]('/:id/recordings',auth[_0x129c('0xc')](),controller[_0x129c('0x1d')]);router['get']('/:id/screen_recordings',auth[_0x129c('0xc')](),controller[_0x129c('0x1e')]);router['get'](_0x129c('0x1f'),auth[_0x129c('0xc')](),controller[_0x129c('0x20')]);router[_0x129c('0x9')](_0x129c('0x21'),auth[_0x129c('0xc')](),controller[_0x129c('0x22')]);router[_0x129c('0x9')](_0x129c('0x23'),auth['isAuthenticated'](),controller[_0x129c('0x24')]);router[_0x129c('0x9')](_0x129c('0x25'),auth[_0x129c('0xc')](),controller[_0x129c('0x26')]);router[_0x129c('0x9')]('/:id/fax/interactions',auth['isAuthenticated'](),controller[_0x129c('0x27')]);router[_0x129c('0x9')](_0x129c('0x28'),auth[_0x129c('0xc')](),controller[_0x129c('0x29')]);router[_0x129c('0x9')]('/:id/teams',auth[_0x129c('0xc')](),controller[_0x129c('0x2a')]);router[_0x129c('0x9')]('/:id/lists',auth[_0x129c('0xc')](),controller[_0x129c('0x2b')]);router[_0x129c('0x9')](_0x129c('0x2c'),auth[_0x129c('0xc')](),controller[_0x129c('0x2d')]);router[_0x129c('0x9')](_0x129c('0x2e'),auth[_0x129c('0xc')](),controller['getVoicePrefixes']);router[_0x129c('0x9')](_0x129c('0x2f'),auth[_0x129c('0xc')](),controller[_0x129c('0x30')]);router[_0x129c('0x9')](_0x129c('0x31'),auth[_0x129c('0xc')](),controller[_0x129c('0x32')]);router['get'](_0x129c('0x33'),auth[_0x129c('0xc')](),controller[_0x129c('0x34')]);router[_0x129c('0x9')](_0x129c('0x35'),auth[_0x129c('0xc')](),controller['getSmsAccounts']);router[_0x129c('0x9')]('/:id/chat_websites',auth[_0x129c('0xc')](),controller[_0x129c('0x36')]);router[_0x129c('0x9')](_0x129c('0x37'),auth[_0x129c('0xc')](),controller[_0x129c('0x38')]);router[_0x129c('0x9')](_0x129c('0x39'),auth[_0x129c('0xc')](),controller[_0x129c('0x3a')]);router[_0x129c('0x9')](_0x129c('0x3b'),auth['isAuthenticated'](),controller[_0x129c('0x3c')]);router[_0x129c('0x3d')](_0x129c('0x15'),auth[_0x129c('0xc')](),controller[_0x129c('0x3e')]);router[_0x129c('0x3d')]('/',auth['isAuthenticated'](),controller[_0x129c('0x3f')]);router[_0x129c('0x3d')](_0x129c('0x40'),auth['isAuthenticated'](),controller[_0x129c('0x41')]);router[_0x129c('0x3d')](_0x129c('0x17'),auth[_0x129c('0xc')](),controller[_0x129c('0x42')]);var upload=multer({'storage':multer[_0x129c('0x43')]({'destination':function(_0x30920a,_0x307f63,_0x141d83){_0x141d83(null,path[_0x129c('0x44')](config[_0x129c('0x45')],_0x129c('0x46')));},'filename':function(_0x123d56,_0x237554,_0x32d586){_0x32d586(null,util['format'](_0x129c('0x47'),Date[_0x129c('0x48')](),_0x237554[_0x129c('0x49')]));}})});router['post'](_0x129c('0x11'),upload[_0x129c('0x4a')](_0x129c('0x4b')),controller['addAvatar']);router[_0x129c('0x3d')](_0x129c('0x4c'),auth['isAuthenticated'](),controller[_0x129c('0x4d')]);router[_0x129c('0x3d')](_0x129c('0x4e'),auth[_0x129c('0xc')](),controller[_0x129c('0x4f')]);router[_0x129c('0x3d')](_0x129c('0x50'),auth[_0x129c('0xc')](),controller[_0x129c('0x51')]);router['post']('/:id/unpause',auth[_0x129c('0xc')](),controller[_0x129c('0x52')]);router[_0x129c('0x3d')](_0x129c('0x53'),auth[_0x129c('0xc')](),controller[_0x129c('0x54')]);router[_0x129c('0x3d')]('/:id/chat_interactions',auth[_0x129c('0xc')](),controller[_0x129c('0x55')]);router[_0x129c('0x3d')]('/:id/mail_interactions',auth[_0x129c('0xc')](),controller[_0x129c('0x56')]);router['post']('/:id/fax_interactions',auth[_0x129c('0xc')](),controller[_0x129c('0x57')]);router[_0x129c('0x3d')](_0x129c('0x58'),auth[_0x129c('0xc')](),controller[_0x129c('0x59')]);router[_0x129c('0x3d')]('/:id/openchannel_interactions',auth['isAuthenticated'](),controller['addOpenchannelInteractions']);router[_0x129c('0x3d')](_0x129c('0x5a'),auth[_0x129c('0xc')](),controller[_0x129c('0x5b')]);router['post'](_0x129c('0x2f'),auth[_0x129c('0xc')](),controller['addFaxAccounts']);router[_0x129c('0x3d')]('/:id/mail_accounts',auth[_0x129c('0xc')](),controller['addMailAccounts']);router[_0x129c('0x3d')]('/:id/openchannel_accounts',auth[_0x129c('0xc')](),controller[_0x129c('0x5c')]);router[_0x129c('0x3d')](_0x129c('0x35'),auth['isAuthenticated'](),controller[_0x129c('0x5d')]);router['post'](_0x129c('0x5e'),auth[_0x129c('0xc')](),controller['addChatWebsites']);router['post'](_0x129c('0x37'),auth[_0x129c('0xc')](),controller[_0x129c('0x5f')]);router['post'](_0x129c('0x3b'),auth['isAuthenticated'](),controller['createApiKey']);router['put']('/:id',auth[_0x129c('0xc')](),controller[_0x129c('0x60')]);router[_0x129c('0x61')](_0x129c('0x62'),auth[_0x129c('0xc')](),controller[_0x129c('0x63')]);router[_0x129c('0x64')](_0x129c('0x17'),auth[_0x129c('0xc')](),controller[_0x129c('0x65')]);router[_0x129c('0x64')](_0x129c('0x53'),auth[_0x129c('0xc')](),controller['removeTeams']);router[_0x129c('0x64')](_0x129c('0xf'),auth[_0x129c('0xc')](),controller[_0x129c('0x66')]);router['delete'](_0x129c('0x67'),auth[_0x129c('0xc')](),controller['removeChatInteractions']);router['delete']('/:id/mail_interactions',auth[_0x129c('0xc')](),controller[_0x129c('0x68')]);router[_0x129c('0x64')](_0x129c('0x69'),auth['isAuthenticated'](),controller[_0x129c('0x6a')]);router[_0x129c('0x64')](_0x129c('0x58'),auth[_0x129c('0xc')](),controller[_0x129c('0x6b')]);router[_0x129c('0x64')](_0x129c('0x6c'),auth['isAuthenticated'](),controller[_0x129c('0x6d')]);router[_0x129c('0x64')](_0x129c('0x5a'),auth[_0x129c('0xc')](),controller[_0x129c('0x6e')]);router[_0x129c('0x64')](_0x129c('0x2f'),auth[_0x129c('0xc')](),controller[_0x129c('0x6f')]);router['delete'](_0x129c('0x31'),auth[_0x129c('0xc')](),controller[_0x129c('0x70')]);router[_0x129c('0x64')](_0x129c('0x33'),auth[_0x129c('0xc')](),controller[_0x129c('0x71')]);router[_0x129c('0x64')](_0x129c('0x35'),auth[_0x129c('0xc')](),controller[_0x129c('0x72')]);router[_0x129c('0x64')]('/:id/chat_websites',auth['isAuthenticated'](),controller[_0x129c('0x73')]);router[_0x129c('0x64')](_0x129c('0x37'),auth[_0x129c('0xc')](),controller[_0x129c('0x74')]);router[_0x129c('0x64')](_0x129c('0x3b'),auth[_0x129c('0xc')](),controller[_0x129c('0x75')]);module[_0x129c('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 d1345dc..644ba26 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 _0xa9e0=['certificate','passive','nonat','update,nonat','TEXT','showWebBar','wss','encryption','force_avp','icesupport','dtlsenable','dtlssetup','dtlscertfile','rtcp_mux','avpf','dtlsverify','actpass','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','blockedAt','loginAttempts','sequelize','moment','util','STRING','setDataValue','name','defaultuser','callerid','getDataValue','internal','email','admin','user','agent','telephone','INTEGER','format','fullname','BOOLEAN','DATE','dynamic','ENUM','friend','peer','from-sip','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','udp','join','transport','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','update','outgoing','force_rport,comedia','nat','split','ulaw;alaw;gsm','allow','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas'];(function(_0x710815,_0x520da8){var _0x5b3b89=function(_0x2e1a8e){while(--_0x2e1a8e){_0x710815['push'](_0x710815['shift']());}};_0x5b3b89(++_0x520da8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x333808){this[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x333808);this[_0x0a9e('0x4')](_0x0a9e('0x6'),_0x333808);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'set':function(_0x441e3a){this[_0x0a9e('0x4')]('fullname',_0x441e3a);this['setDataValue'](_0x0a9e('0x7'),util['format']('\x22%s\x22\x20<%s>',_0x441e3a,this[_0x0a9e('0x8')](_0x0a9e('0x9'))));}},'alias':{'type':Sequelize[_0x0a9e('0x3')]},'email':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'unique':_0x0a9e('0xa'),'validate':{'isEmail':!![]},'set':function(_0xbd1168){if(_0xbd1168){this['setDataValue']('email',_0xbd1168['toLowerCase']());}}},'role':{'type':Sequelize['ENUM'](_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe')),'allowNull':![]},'password':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'local'},'internal':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':![],'unique':_0x0a9e('0x9'),'set':function(_0x2b4227){this[_0x0a9e('0x4')](_0x0a9e('0x9'),_0x2b4227);this[_0x0a9e('0x4')]('accountcode',_0x2b4227);this[_0x0a9e('0x4')]('callerid',util[_0x0a9e('0x10')]('\x22%s\x22\x20<%s>',this[_0x0a9e('0x8')](_0x0a9e('0x11')),_0x2b4227));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x0a9e('0x3')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0x0a9e('0x3')]},'zipcode':{'type':Sequelize[_0x0a9e('0x3')]},'userpic':{'type':Sequelize[_0x0a9e('0x3')]},'city':{'type':Sequelize[_0x0a9e('0x3')]},'country':{'type':Sequelize[_0x0a9e('0x3')]},'online':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x0a9e('0x13')]},'voicePause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0x0a9e('0x13')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x0a9e('0xf')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x0a9e('0xf')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x14')},'ipaddr':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0x0a9e('0xf')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x16'),_0x0a9e('0xc'),_0x0a9e('0x17')),'allowNull':!![],'defaultValue':_0x0a9e('0x16')},'context':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x18')},'callingpres':{'type':Sequelize[_0x0a9e('0x15')]('ALLOWED_NOT_SCREENED',_0x0a9e('0x19'),_0x0a9e('0x1a'),_0x0a9e('0x1b'),_0x0a9e('0x1c'),'PROHIB_PASSED_SCREEN',_0x0a9e('0x1d'),_0x0a9e('0x1e')),'allowNull':!![]},'deny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x1f'),'set':function(_0x540530){this[_0x0a9e('0x4')]('transport',_0x540530?_0x540530[_0x0a9e('0x20')](','):null);},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x21'))?this[_0x0a9e('0x8')](_0x0a9e('0x21'))['split'](','):null;},'comment':_0x0a9e('0x22')},'dtmfmode':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x23'),_0x0a9e('0x24'),_0x0a9e('0x25'),_0x0a9e('0x26'),_0x0a9e('0x27')),'allowNull':!![],'defaultValue':_0x0a9e('0x23')},'directmedia':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no','nonat',_0x0a9e('0x29'),_0x0a9e('0x2a')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'nat':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x2b'),'set':function(_0x15de0e){this['setDataValue']('nat',_0x15de0e?_0x15de0e[_0x0a9e('0x20')](','):null);},'get':function(){return this['getDataValue'](_0x0a9e('0x2c'))?this[_0x0a9e('0x8')](_0x0a9e('0x2c'))[_0x0a9e('0x2d')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x0a9e('0x3')]},'namedcallgroup':{'type':Sequelize[_0x0a9e('0x3')]},'pickupgroup':{'type':Sequelize[_0x0a9e('0x3')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x0a9e('0x3')]},'disallow':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0a9e('0x2e'),'set':function(_0x40d766){this['setDataValue'](_0x0a9e('0x2f'),_0x40d766?_0x40d766[_0x0a9e('0x20')](';'):_0x0a9e('0x2e'));},'get':function(){return this[_0x0a9e('0x8')]('allow')?this['getDataValue'](_0x0a9e('0x2f'))[_0x0a9e('0x2d')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'set':function(_0x5b4f5e){this[_0x0a9e('0x4')](_0x0a9e('0x30'),_0x5b4f5e?_0x5b4f5e[_0x0a9e('0x20')](','):null);},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x30'))?this[_0x0a9e('0x8')](_0x0a9e('0x30'))[_0x0a9e('0x2d')](','):null;},'comment':_0x0a9e('0x31')},'trustrpid':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x32')},'amaflags':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':_0x0a9e('0x28')},'busylevel':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x0a9e('0x15')]('yes','no',_0x0a9e('0x33')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x34'),_0x0a9e('0x35'),_0x0a9e('0x36')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM'](_0x0a9e('0x37'),_0x0a9e('0x38')),'allowNull':!![],'defaultValue':_0x0a9e('0x38')},'t38pt_usertpsource':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no','fingerprint',_0x0a9e('0x39')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x0a9e('0x15')]('active',_0x0a9e('0x3a'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM'](_0x0a9e('0x28'),'no',_0x0a9e('0x3b'),_0x0a9e('0x29'),_0x0a9e('0x3c')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x0a9e('0x3')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize[_0x0a9e('0x13')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x0a9e('0x3d')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x3649cc){this['setDataValue'](_0x0a9e('0x3e'),_0x3649cc);var _0x5ba1f9=this['get']({'plain':!![]});switch(_0x3649cc){case 0x0:case 0x1:var _0x5674ee=_0x5ba1f9[_0x0a9e('0x21')]?_['isArray'](_0x5ba1f9[_0x0a9e('0x21')])?_0x5ba1f9[_0x0a9e('0x21')][_0x0a9e('0x20')]():_0x5ba1f9[_0x0a9e('0x21')]:_0x0a9e('0x1f');if(_0x5674ee===_0x0a9e('0x3f')){_0x5674ee='udp';}this[_0x0a9e('0x4')]('transport',_0x5674ee);this[_0x0a9e('0x4')](_0x0a9e('0x40'),'no');this[_0x0a9e('0x4')]('avpf',null);this[_0x0a9e('0x4')](_0x0a9e('0x41'),null);this[_0x0a9e('0x4')](_0x0a9e('0x42'),null);this['setDataValue'](_0x0a9e('0x43'),null);this[_0x0a9e('0x4')]('dtlsverify',null);this[_0x0a9e('0x4')](_0x0a9e('0x44'),null);this[_0x0a9e('0x4')](_0x0a9e('0x45'),null);this[_0x0a9e('0x4')]('dtlsprivatekey',null);this[_0x0a9e('0x4')](_0x0a9e('0x46'),'no');break;case 0x2:this[_0x0a9e('0x4')]('transport',_0x0a9e('0x3f'));this['setDataValue']('encryption',_0x0a9e('0x28'));this[_0x0a9e('0x4')](_0x0a9e('0x47'),_0x0a9e('0x28'));this[_0x0a9e('0x4')](_0x0a9e('0x41'),_0x0a9e('0x28'));this[_0x0a9e('0x4')](_0x0a9e('0x42'),_0x0a9e('0x28'));this[_0x0a9e('0x4')](_0x0a9e('0x43'),_0x0a9e('0x28'));this[_0x0a9e('0x4')](_0x0a9e('0x48'),'no');this[_0x0a9e('0x4')](_0x0a9e('0x44'),_0x0a9e('0x49'));this['setDataValue'](_0x0a9e('0x45'),_0x5ba1f9[_0x0a9e('0x45')]||_0x0a9e('0x4a'));this['setDataValue'](_0x0a9e('0x4b'),_0x5ba1f9[_0x0a9e('0x4b')]||'/etc/pki/tls/private/motion.key');this[_0x0a9e('0x4')](_0x0a9e('0x46'),_0x0a9e('0x28'));break;default:}}},'permissions':{'type':Sequelize[_0x0a9e('0x3d')],'set':function(_0x13b5c0){this['setDataValue']('permissions',_0x13b5c0?_0x13b5c0['join'](','):[]);},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x4c'))?_[_0x0a9e('0x4d')](this[_0x0a9e('0x8')](_0x0a9e('0x4c'))[_0x0a9e('0x2d')](','),function(_0xeef20){return parseInt(_0xeef20,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x28'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x0a9e('0x4e')],'get':function(){return this[_0x0a9e('0x8')]('phoneBarEnableScreenRecordingByAgent')?this[_0x0a9e('0x8')](_0x0a9e('0x4f')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![],'set':function(_0xdb98ca){if(typeof _0xdb98ca===_0x0a9e('0x50')){var _0x3df0e3=_0xdb98ca==='1'?!![]:_0xdb98ca==='0'?![]:_0xdb98ca===_0x0a9e('0x51')?!![]:_0xdb98ca===_0x0a9e('0x52')?![]:![];this[_0x0a9e('0x4')](_0x0a9e('0x53'),_0x3df0e3);}else{this[_0x0a9e('0x4')](_0x0a9e('0x53'),_0xdb98ca);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0xf4120f){this[_0x0a9e('0x4')](_0x0a9e('0x54'),_0xf4120f);if(_0xf4120f===!![]){this['setDataValue'](_0x0a9e('0x55'),moment());this[_0x0a9e('0x4')](_0x0a9e('0x56'),0x0);}else{this[_0x0a9e('0x4')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x0a9e('0xf')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9c44=['get','udp','encryption','avpf','force_avp','icesupport','dtlscertfile','dtlsprivatekey','wss','dtlsenable','dtlsverify','dtlssetup','actpass','/etc/pki/tls/certs/motion.crt','rtcp_mux','permissions','phoneBarEnableScreenRecordingByAgent','string','false','screenrecording','blocked','loginAttempts','blockedAt','UNSIGNED','util','lodash','exports','STRING','name','setDataValue','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','email','admin','user','telephone','local','INTEGER','internal','accountcode','DATE','BOOLEAN','DEFAULT\x20PAUSE','dynamic','ENUM','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','yes','nonat','update','outgoing','force_rport,comedia','nat','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','originate','uac','uas','fingerprint','certificate','active','update,nonat','TEXT'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x9c44,0x178));var _0x49c4=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0x9c44[_0x17b6e3];return _0x3906f3;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');var util=require(_0x49c4('0x0'));var _=require(_0x49c4('0x1'));module[_0x49c4('0x2')]={'name':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'unique':_0x49c4('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x2ad237){this['setDataValue']('name',_0x2ad237);this[_0x49c4('0x5')]('defaultuser',_0x2ad237);},'comment':_0x49c4('0x6')},'fullname':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'set':function(_0x69bc41){this[_0x49c4('0x5')](_0x49c4('0x7'),_0x69bc41);this['setDataValue'](_0x49c4('0x8'),util[_0x49c4('0x9')](_0x49c4('0xa'),_0x69bc41,this[_0x49c4('0xb')]('internal')));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'unique':_0x49c4('0xc'),'validate':{'isEmail':!![]},'set':function(_0x58cad7){if(_0x58cad7){this[_0x49c4('0x5')](_0x49c4('0xc'),_0x58cad7['toLowerCase']());}}},'role':{'type':Sequelize['ENUM'](_0x49c4('0xd'),_0x49c4('0xe'),'agent',_0x49c4('0xf')),'allowNull':![]},'password':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':_0x49c4('0x10')},'internal':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':![],'unique':_0x49c4('0x12'),'set':function(_0x2decee){this[_0x49c4('0x5')](_0x49c4('0x12'),_0x2decee);this[_0x49c4('0x5')](_0x49c4('0x13'),_0x2decee);this['setDataValue'](_0x49c4('0x8'),util[_0x49c4('0x9')](_0x49c4('0xa'),this[_0x49c4('0xb')](_0x49c4('0x7')),_0x2decee));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x49c4('0x3')]},'mobile':{'type':Sequelize[_0x49c4('0x3')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0x49c4('0x3')]},'city':{'type':Sequelize[_0x49c4('0x3')]},'country':{'type':Sequelize[_0x49c4('0x3')]},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x49c4('0x14')]},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x49c4('0x3')],'defaultValue':_0x49c4('0x16')},'lastPauseAt':{'type':Sequelize[_0x49c4('0x14')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x49c4('0x11')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x49c4('0x11')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'host':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![],'defaultValue':_0x49c4('0x17')},'ipaddr':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x19'),'user',_0x49c4('0x1a')),'allowNull':!![],'defaultValue':_0x49c4('0x19')},'context':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![],'defaultValue':_0x49c4('0x1b')},'callingpres':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x1c'),_0x49c4('0x1d'),_0x49c4('0x1e'),_0x49c4('0x1f'),_0x49c4('0x20'),_0x49c4('0x21'),'PROHIB_FAILED_SCREEN','PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![],'defaultValue':'udp','set':function(_0x38ad77){this[_0x49c4('0x5')](_0x49c4('0x22'),_0x38ad77?_0x38ad77[_0x49c4('0x23')](','):null);},'get':function(){return this['getDataValue']('transport')?this[_0x49c4('0xb')](_0x49c4('0x22'))[_0x49c4('0x24')](','):null;},'comment':_0x49c4('0x25')},'dtmfmode':{'type':Sequelize[_0x49c4('0x18')]('rfc2833',_0x49c4('0x26'),_0x49c4('0x27'),_0x49c4('0x28'),'auto'),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no',_0x49c4('0x2a'),_0x49c4('0x2b'),_0x49c4('0x2c')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x49c4('0x2d'),'set':function(_0x5b96df){this[_0x49c4('0x5')](_0x49c4('0x2e'),_0x5b96df?_0x5b96df[_0x49c4('0x23')](','):null);},'get':function(){return this[_0x49c4('0xb')]('nat')?this[_0x49c4('0xb')](_0x49c4('0x2e'))[_0x49c4('0x24')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x49c4('0x3')]},'namedcallgroup':{'type':Sequelize[_0x49c4('0x3')]},'pickupgroup':{'type':Sequelize[_0x49c4('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x49c4('0x3')]},'language':{'type':Sequelize[_0x49c4('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x49c4('0x3')]},'disallow':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'defaultValue':_0x49c4('0x2f')},'allow':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'defaultValue':_0x49c4('0x30'),'set':function(_0x1e506a){this['setDataValue'](_0x49c4('0x31'),_0x1e506a?_0x1e506a[_0x49c4('0x23')](';'):_0x49c4('0x30'));},'get':function(){return this[_0x49c4('0xb')](_0x49c4('0x31'))?this[_0x49c4('0xb')](_0x49c4('0x31'))[_0x49c4('0x24')](';'):null;},'comment':_0x49c4('0x32')},'autoframing':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![],'set':function(_0x326142){this['setDataValue'](_0x49c4('0x33'),_0x326142?_0x326142['join'](','):null);},'get':function(){return this[_0x49c4('0xb')](_0x49c4('0x33'))?this[_0x49c4('0xb')](_0x49c4('0x33'))[_0x49c4('0x24')](','):null;},'comment':_0x49c4('0x34')},'trustrpid':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![],'defaultValue':_0x49c4('0x35')},'amaflags':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x36'),_0x49c4('0x37'),_0x49c4('0x38')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x39'),'uas'),'allowNull':!![],'defaultValue':_0x49c4('0x3a')},'t38pt_usertpsource':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x49c4('0x18')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x49c4('0x18')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no',_0x49c4('0x3b'),_0x49c4('0x3c')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x3d'),'passive','actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x49c4('0x18')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no',_0x49c4('0x2a'),_0x49c4('0x2b'),_0x49c4('0x3e')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x49c4('0x3')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize[_0x49c4('0x14')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x49c4('0x3f')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x10dec7){this[_0x49c4('0x5')]('showWebBar',_0x10dec7);var _0x39c455=this[_0x49c4('0x40')]({'plain':!![]});switch(_0x10dec7){case 0x0:case 0x1:var _0x4f50bf=_0x39c455['transport']?_['isArray'](_0x39c455['transport'])?_0x39c455[_0x49c4('0x22')]['join']():_0x39c455[_0x49c4('0x22')]:_0x49c4('0x41');if(_0x4f50bf==='wss'){_0x4f50bf=_0x49c4('0x41');}this[_0x49c4('0x5')]('transport',_0x4f50bf);this[_0x49c4('0x5')](_0x49c4('0x42'),'no');this[_0x49c4('0x5')](_0x49c4('0x43'),null);this['setDataValue'](_0x49c4('0x44'),null);this[_0x49c4('0x5')](_0x49c4('0x45'),null);this[_0x49c4('0x5')]('dtlsenable',null);this[_0x49c4('0x5')]('dtlsverify',null);this['setDataValue']('dtlssetup',null);this['setDataValue'](_0x49c4('0x46'),null);this[_0x49c4('0x5')](_0x49c4('0x47'),null);this[_0x49c4('0x5')]('rtcp_mux','no');break;case 0x2:this['setDataValue'](_0x49c4('0x22'),_0x49c4('0x48'));this[_0x49c4('0x5')](_0x49c4('0x42'),_0x49c4('0x29'));this[_0x49c4('0x5')](_0x49c4('0x43'),_0x49c4('0x29'));this['setDataValue'](_0x49c4('0x44'),'yes');this[_0x49c4('0x5')](_0x49c4('0x45'),_0x49c4('0x29'));this[_0x49c4('0x5')](_0x49c4('0x49'),_0x49c4('0x29'));this[_0x49c4('0x5')](_0x49c4('0x4a'),'no');this[_0x49c4('0x5')](_0x49c4('0x4b'),_0x49c4('0x4c'));this[_0x49c4('0x5')](_0x49c4('0x46'),_0x39c455[_0x49c4('0x46')]||_0x49c4('0x4d'));this[_0x49c4('0x5')](_0x49c4('0x47'),_0x39c455[_0x49c4('0x47')]||'/etc/pki/tls/private/motion.key');this['setDataValue'](_0x49c4('0x4e'),_0x49c4('0x29'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x1a15f3){this[_0x49c4('0x5')](_0x49c4('0x4f'),_0x1a15f3?_0x1a15f3[_0x49c4('0x23')](','):[]);},'get':function(){return this['getDataValue']('permissions')?_['map'](this[_0x49c4('0xb')](_0x49c4('0x4f'))[_0x49c4('0x24')](','),function(_0x2f4289){return parseInt(_0x2f4289,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x49c4('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x49c4('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x49c4('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x49c4('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x49c4('0x3')]},'phoneBarEnableJaws':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x49c4('0xb')](_0x49c4('0x50'))?this[_0x49c4('0xb')](_0x49c4('0x50')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0x49c4('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize['STRING'],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![],'set':function(_0x27b77d){if(typeof _0x27b77d===_0x49c4('0x51')){var _0x34870e=_0x27b77d==='1'?!![]:_0x27b77d==='0'?![]:_0x27b77d==='true'?!![]:_0x27b77d===_0x49c4('0x52')?![]:![];this[_0x49c4('0x5')](_0x49c4('0x53'),_0x34870e);}else{this[_0x49c4('0x5')](_0x49c4('0x53'),_0x27b77d);}}},'blocked':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![],'set':function(_0x38b291){this[_0x49c4('0x5')](_0x49c4('0x54'),_0x38b291);if(_0x38b291===!![]){this[_0x49c4('0x5')]('blockedAt',moment());this[_0x49c4('0x5')](_0x49c4('0x55'),0x0);}else{this['setDataValue'](_0x49c4('0x56'),null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x49c4('0x11')](0x5)[_0x49c4('0x57')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 215cee2..6beef41 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 _0x0ed5=['getDataValue','removeTeams','Query\x20parameter\x20\x27ids\x27\x20is\x20required','transaction','removeAgent','Voice','UserVoicePrefix','CmList','getLists','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','addFaxAccounts','removeFaxAccounts','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getScheduledCalls','$or','$gte','$lte','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$contains','$contained','$any','CmHopper','firstName','lastName','CmContact','Contact','dialActive','getApiKey','retrieveApiKey','json','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','generateApiKey','iat','nonce','removeApiKey','apiKeyIat','API\x20key\x20not\x20available','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getUserSetting','getPresence','queues','inbound','flatten','getAgents','lower','toString','desc','asc','substring','uniqBy','orderBy','request','http','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','idle','unknown','unavailable','voiceStatus','busy','slice','charAt','toUpperCase','select','field','ui.','InteractionId','_interactions','ui.UserId\x20=\x20?','OpenTabs','moment','path','lodash','squel','ioredis','../../components/auth/service','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../errors/api','APIBadRequestError','APINotFoundError','handleError','../../mysqldb','socket.io-emitter','redis','./user.socket','defaults','localhost','client','sendStatus','status','end','undefined','offset','count','set','Content-Range','update','role','agent','emit','userNotification:recalc:','destroy','then','get','admin','Users','user','Telephones','telephone','filter','value','includes','find','name','UserProfileResource','error','stack','send','map','fieldName','type','password','salt','previousPasswords','resetPasswordToken','resetPasswordExpires','passwordResetAt','md5secret','getOptions','where','User','query','includeAll','include','userSetting','true','UserSetting','attributes','push','findAll','rows','openTabs','length','chat','dataValues','sms','fax','mail','openchannel','whatsapp','all','catch','params','merge','options','body','describe','addContacts','ids','omit','Setting','securePassword','internal','min_internal','isNil','sequelize','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','QueryTypes','SELECT','from','voicemail','mailbox','fullname','email','permissions','101','113','104','105','106','100','111','114','create','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','userProfileId','VoiceMail','UserProfileSection','Agents','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','some','isEmpty','compact','changePassword','oldPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','Wrong\x20credentials','newPassword','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','enforcePasswordHistory','validatePasswordPattern','validatePasswordHistory','passwordHistoryLimit','updatePasswordsHistory','online','loginInPause','interface','isValidChannel','Unknown\x20channel','add','capitalize','toLowerCase','Queues','spread','Queue:save','voice','VoiceQueue','format','SIP/%s','voicePause','penalty','upsert','removeQueues','channel','remove','isArray','QueueId','Queue:remove','UserVoiceQueueRt','userpic','filename','getAvatar','server/files/images/logos/default_profile.png','download','existsSync','join','root','server/files/images/','getOpenTabs','ChatOpenTabs','CHAT','createdAt','FaxOpenTabs','OPENCHANNEL','MailOpenTabs','MAIL','SMS','WhatsappOpenTabs','WHATSAPP','concat','getContacts','User\x20with\x20id\x20%s\x20not\x20found','hasOwnProperty','List','color','tag','model','keys','Queue','filters','intersection','fields','order','sort','pick','Unknown\x20role','limit','getVoiceQueuesRt','rawAttributes','getGroups','ChatGroup','nolimit','getRecordings','VoiceRecording','getScreenRecordings','ScreenRecording','UserId','getChatInteractions','ChatInteraction','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','SmsInteraction','getSmsInteractions','getFaxInteractions','FaxInteraction','getWhatsappInteractions','WhatsappInteraction','login','phone','mobile','intrf','user:%s','headers','x-forwarded-for','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','MemberReport','YYYY-MM-DD\x20HH:mm:ss','getChannels','forEach','LOGIN','PAUSE','LOGININPAUSE','isMiddleware','logout','pause','DEFAULT\x20PAUSE','mailPause','chatPause','openchannelPause','smsPause','whatsappPause','pauseType','lastPauseAt','unpause','getTeams','Team','addTeams','resolve','Body\x20parameter\x20\x27ids\x27\x20is\x20required','getAssociatedQueues','flattenDeep','TeamVoicePrefix','VoicePrefixId'];(function(_0x51a8ae,_0xb9e2f8){var _0x14d808=function(_0x491b37){while(--_0x491b37){_0x51a8ae['push'](_0x51a8ae['shift']());}};_0x14d808(++_0xb9e2f8);}(_0x0ed5,0x78));var _0x50ed=function(_0x553bd2,_0x38aa4a){_0x553bd2=_0x553bd2-0x0;var _0x34f705=_0x0ed5[_0x553bd2];return _0x34f705;};'use strict';var moment=require(_0x50ed('0x0'));var util=require('util');var path=require(_0x50ed('0x1'));var fs=require('fs');var _=require(_0x50ed('0x2'));var squel=require(_0x50ed('0x3'));var jayson=require('jayson/promise');var Redis=require(_0x50ed('0x4'));var authService=require(_0x50ed('0x5'));var contacts=require(_0x50ed('0x6'));var qs=require(_0x50ed('0x7'));var logger=require(_0x50ed('0x8'))(_0x50ed('0x9'));var utils=require(_0x50ed('0xa'));var config=require(_0x50ed('0xb'));var licenseUtil=require(_0x50ed('0xc'));var APIBadRequestError=require(_0x50ed('0xd'))[_0x50ed('0xe')];var APINotFoundError=require(_0x50ed('0xd'))[_0x50ed('0xf')];var APIHandleError=require(_0x50ed('0xd'))[_0x50ed('0x10')];var db=require(_0x50ed('0x11'))['db'];var socket=require(_0x50ed('0x12'))(new Redis(config[_0x50ed('0x13')]));require(_0x50ed('0x14'))['register'](socket);config[_0x50ed('0x13')]=_[_0x50ed('0x15')](config[_0x50ed('0x13')],{'host':_0x50ed('0x16'),'port':0x18eb});var amiClient=jayson[_0x50ed('0x17')]['http']({'port':0x232a});var values;function respondWithStatusCode(_0x3603cf,_0x23afb8){_0x23afb8=_0x23afb8||0xcc;return function(_0xe24d6b){if(_0xe24d6b){return _0x3603cf[_0x50ed('0x18')](_0x23afb8);}return _0x3603cf[_0x50ed('0x19')](_0x23afb8)[_0x50ed('0x1a')]();};}function respondWithResult(_0x59b092,_0x57d082){_0x57d082=_0x57d082||0xc8;return function(_0x32ec8d){if(_0x32ec8d){return _0x59b092[_0x50ed('0x19')](_0x57d082)['json'](_0x32ec8d);}};}function respondWithFilteredResult(_0xbe0701,_0x228193){return function(_0x13ec4d){if(_0x13ec4d){var _0x32a559=typeof _0x228193['offset']==='undefined'&&typeof _0x228193['limit']===_0x50ed('0x1b');var _0x47ca7a=_0x13ec4d['count'];var _0x2268ab=_0x32a559?0x0:_0x228193[_0x50ed('0x1c')];var _0x2b2d31=_0x32a559?_0x13ec4d[_0x50ed('0x1d')]:_0x228193[_0x50ed('0x1c')]+_0x228193['limit'];var _0x257968;if(_0x2b2d31>=_0x47ca7a){_0x2b2d31=_0x47ca7a;_0x257968=0xc8;}else{_0x257968=0xce;}_0xbe0701[_0x50ed('0x19')](_0x257968);return _0xbe0701[_0x50ed('0x1e')](_0x50ed('0x1f'),_0x2268ab+'-'+_0x2b2d31+'/'+_0x47ca7a)['json'](_0x13ec4d);}return null;};}function saveUpdates(_0x241e0c){return function(_0x16be34){if(_0x16be34){return _0x16be34[_0x50ed('0x20')](_0x241e0c)['then'](function(_0xd00f2f){if(_0xd00f2f[_0x50ed('0x21')]===_0x50ed('0x22')){socket[_0x50ed('0x23')](_0x50ed('0x24')+_0xd00f2f['id'],_0xd00f2f);}return _0xd00f2f;});}return null;};}function removeEntity(_0x4d3711){return function(_0x4a02c3){if(_0x4a02c3){return _0x4a02c3[_0x50ed('0x25')]()[_0x50ed('0x26')](function(){var _0x12bf9b=_0x4a02c3[_0x50ed('0x27')]({'plain':!![]});if(_0x12bf9b[_0x50ed('0x21')]===_0x50ed('0x28'))return;var _0x396708=[{'name':_0x50ed('0x29'),'value':_0x50ed('0x2a'),'ignore':!![]},{'name':'Agents','value':_0x50ed('0x22'),'ignore':![]},{'name':_0x50ed('0x2b'),'value':_0x50ed('0x2c'),'ignore':![]}];var _0x5f3c27=_(_0x396708)[_0x50ed('0x2d')]('ignore')['map'](_0x50ed('0x2e'))[_0x50ed('0x2e')]();if(_[_0x50ed('0x2f')](_0x5f3c27,_0x12bf9b[_0x50ed('0x21')])){return;}var _0x2da271=_[_0x50ed('0x30')](_0x396708,[_0x50ed('0x2e'),_0x12bf9b[_0x50ed('0x21')]])[_0x50ed('0x31')];return db[_0x50ed('0x32')][_0x50ed('0x25')]({'where':{'type':_0x2da271,'resourceId':_0x12bf9b['id']}})[_0x50ed('0x26')](function(){return _0x4a02c3;});})[_0x50ed('0x26')](function(){_0x4d3711[_0x50ed('0x19')](0xcc)[_0x50ed('0x1a')]();});}};}function handleEntityNotFound(_0x14051a){return function(_0x34d4b1){if(!_0x34d4b1){_0x14051a[_0x50ed('0x18')](0x194);}return _0x34d4b1;};}function handleError(_0x5131d4,_0x530343){_0x530343=_0x530343||0x1f4;return function(_0x56b250){logger[_0x50ed('0x33')](_0x56b250[_0x50ed('0x34')]);if(_0x56b250[_0x50ed('0x31')]){delete _0x56b250[_0x50ed('0x31')];}_0x5131d4['status'](_0x530343)[_0x50ed('0x35')](_0x56b250);};}function getUserAttributes(){return _(db['User']['rawAttributes'])[_0x50ed('0x36')](function(_0x12bfbe){return{'name':_0x12bfbe[_0x50ed('0x37')],'type':_0x12bfbe[_0x50ed('0x38')]['key']};})[_0x50ed('0x2d')](function(_0x235ec5){return![_0x50ed('0x39'),_0x50ed('0x3a'),_0x50ed('0x3b'),_0x50ed('0x3c'),_0x50ed('0x3d'),_0x50ed('0x3e'),_0x50ed('0x3f')][_0x50ed('0x2f')](_0x235ec5[_0x50ed('0x31')]);})[_0x50ed('0x2e')]();}exports['index']=function(_0x36b2ff,_0x241977){var _0x7020d={},_0x55ac6b={'count':0x0,'rows':[]};var _0x189c1c=getUserAttributes();_0x7020d=qs[_0x50ed('0x40')](_0x189c1c,_0x36b2ff);var _0x2ec61b={'where':_0x7020d[_0x50ed('0x41')]};return db[_0x50ed('0x42')][_0x50ed('0x1d')](_0x2ec61b)['then'](function(_0x40d346){_0x55ac6b[_0x50ed('0x1d')]=_0x40d346;if(_0x36b2ff[_0x50ed('0x43')][_0x50ed('0x44')]){_0x7020d[_0x50ed('0x45')]=[{'all':!![]}];}if(_0x36b2ff[_0x50ed('0x43')][_0x50ed('0x46')]===_0x50ed('0x47')){_0x7020d[_0x50ed('0x45')]=[{'model':db[_0x50ed('0x48')],'as':_0x50ed('0x46')}];}if(!_['includes'](_0x7020d[_0x50ed('0x49')],'id')){_0x7020d[_0x50ed('0x49')][_0x50ed('0x4a')]('id');}return db['User'][_0x50ed('0x4b')](_0x7020d);})[_0x50ed('0x26')](function(_0xaa3261){_0x55ac6b[_0x50ed('0x4c')]=_0xaa3261;if(_0x36b2ff[_0x50ed('0x43')][_0x50ed('0x4d')]===_0x50ed('0x47')){var _0x4a076d=[];for(var _0x1939de=0x0;_0x1939de<_0x55ac6b[_0x50ed('0x4c')][_0x50ed('0x4e')];_0x1939de++){_0x4a076d[_0x50ed('0x4a')](get_open_tabs(_0x50ed('0x4f'),_0x55ac6b[_0x50ed('0x4c')][_0x1939de][_0x50ed('0x50')]));_0x4a076d[_0x50ed('0x4a')](get_open_tabs(_0x50ed('0x51'),_0x55ac6b[_0x50ed('0x4c')][_0x1939de]['dataValues']));_0x4a076d[_0x50ed('0x4a')](get_open_tabs(_0x50ed('0x52'),_0x55ac6b[_0x50ed('0x4c')][_0x1939de][_0x50ed('0x50')]));_0x4a076d['push'](get_open_tabs(_0x50ed('0x53'),_0x55ac6b[_0x50ed('0x4c')][_0x1939de]['dataValues']));_0x4a076d[_0x50ed('0x4a')](get_open_tabs(_0x50ed('0x54'),_0x55ac6b[_0x50ed('0x4c')][_0x1939de][_0x50ed('0x50')]));_0x4a076d[_0x50ed('0x4a')](get_open_tabs(_0x50ed('0x55'),_0x55ac6b[_0x50ed('0x4c')][_0x1939de]['dataValues']));}return Promise[_0x50ed('0x56')](_0x4a076d)[_0x50ed('0x26')](function(){return _0x55ac6b;});}else{return _0x55ac6b;}})[_0x50ed('0x26')](respondWithFilteredResult(_0x241977,_0x7020d))[_0x50ed('0x57')](handleError(_0x241977,null));};exports['show']=function(_0x3f2b8d,_0x3e2853){var _0xc12ae5=getUserAttributes();_0x3f2b8d[_0x50ed('0x43')]['id']=_0x3f2b8d[_0x50ed('0x58')]['id'];var _0x3fcbbd=qs[_0x50ed('0x40')](_0xc12ae5,_0x3f2b8d);if(_0x3f2b8d[_0x50ed('0x43')][_0x50ed('0x44')]){_0x3fcbbd[_0x50ed('0x45')]=[{'all':!![]}];}if(_0x3f2b8d[_0x50ed('0x43')][_0x50ed('0x46')]==='true'){_0x3fcbbd[_0x50ed('0x45')]=[{'model':db[_0x50ed('0x48')],'as':_0x50ed('0x46')}];}_0x3fcbbd=_[_0x50ed('0x59')]({},_0x3fcbbd,_0x3f2b8d[_0x50ed('0x5a')]);if(!_['includes'](_0x3fcbbd[_0x50ed('0x49')],'id')){_0x3fcbbd[_0x50ed('0x49')][_0x50ed('0x4a')]('id');}return db['User'][_0x50ed('0x30')](_0x3fcbbd)[_0x50ed('0x26')](handleEntityNotFound(_0x3e2853,null))[_0x50ed('0x26')](function(_0x5a6d0b){var _0x30adc=[];values=_0x5a6d0b;if(_0x3f2b8d[_0x50ed('0x43')][_0x50ed('0x4d')]===_0x50ed('0x47')){_0x30adc[_0x50ed('0x4a')](get_open_tabs(_0x50ed('0x4f'),_0x5a6d0b['dataValues']));_0x30adc['push'](get_open_tabs(_0x50ed('0x51'),_0x5a6d0b[_0x50ed('0x50')]));_0x30adc['push'](get_open_tabs(_0x50ed('0x54'),_0x5a6d0b['dataValues']));_0x30adc[_0x50ed('0x4a')](get_open_tabs(_0x50ed('0x55'),_0x5a6d0b[_0x50ed('0x50')]));_0x30adc['push'](get_open_tabs(_0x50ed('0x52'),_0x5a6d0b[_0x50ed('0x50')]));_0x30adc[_0x50ed('0x4a')](get_open_tabs(_0x50ed('0x53'),_0x5a6d0b['dataValues']));return Promise[_0x50ed('0x56')](_0x30adc);}else{return values;}})[_0x50ed('0x26')](function(){return values;})[_0x50ed('0x26')](respondWithResult(_0x3e2853,null))['catch'](handleError(_0x3e2853,null));};exports[_0x50ed('0x20')]=function(_0x379a1f,_0x2b99f4){if(_0x379a1f['body']['id']){delete _0x379a1f['body']['id'];}delete _0x379a1f[_0x50ed('0x5b')][_0x50ed('0x21')];return db[_0x50ed('0x42')][_0x50ed('0x30')]({'where':{'id':_0x379a1f[_0x50ed('0x58')]['id']}})['then'](handleEntityNotFound(_0x2b99f4,null))['then'](saveUpdates(_0x379a1f[_0x50ed('0x5b')],null))['then'](respondWithResult(_0x2b99f4,null))['catch'](handleError(_0x2b99f4,null));};exports[_0x50ed('0x5c')]=function(_0x91b6d,_0x1917e7){return db[_0x50ed('0x42')][_0x50ed('0x5c')]()[_0x50ed('0x26')](respondWithResult(_0x1917e7,null))['catch'](handleError(_0x1917e7,null));};exports['addContacts']=function(_0x52da7a,_0x24ecec){return db[_0x50ed('0x42')]['find']({'where':{'id':_0x52da7a['params']['id']}})[_0x50ed('0x26')](handleEntityNotFound(_0x24ecec,null))[_0x50ed('0x26')](function(_0x20a9b4){if(_0x20a9b4){return _0x20a9b4[_0x50ed('0x5d')](_0x52da7a[_0x50ed('0x5b')][_0x50ed('0x5e')],_[_0x50ed('0x5f')](_0x52da7a[_0x50ed('0x5b')],[_0x50ed('0x5e'),'id'])||{});}})[_0x50ed('0x26')](respondWithResult(_0x24ecec,null))[_0x50ed('0x57')](handleError(_0x24ecec,null));};function validateUser(_0x52a0c0){return new Promise(function(_0x35b6e8,_0x377dbb){if(_0x52a0c0['internal'])return _0x35b6e8(_0x52a0c0);return db[_0x50ed('0x60')]['findById'](0x1)[_0x50ed('0x26')](function(_0x43bdc8){if(_0x43bdc8[_0x50ed('0x61')])authService['validatePasswordPattern'](_0x52a0c0[_0x50ed('0x39')]);db[_0x50ed('0x42')]['max'](_0x50ed('0x62'))['then'](function(_0x1a92a4){if(_['isNil'](_0x1a92a4)){_0x52a0c0['internal']=_0x43bdc8[_0x50ed('0x63')]||0x1;return;}if(_[_0x50ed('0x64')](_0x43bdc8[_0x50ed('0x63')])||_0x43bdc8[_0x50ed('0x63')]===_0x1a92a4){_0x52a0c0['internal']=_0x1a92a4+0x1;return;}if(_0x43bdc8[_0x50ed('0x63')]>_0x1a92a4){_0x52a0c0[_0x50ed('0x62')]=_0x43bdc8[_0x50ed('0x63')];return;}return db[_0x50ed('0x65')][_0x50ed('0x43')](_0x50ed('0x66'),{'type':db[_0x50ed('0x65')][_0x50ed('0x67')][_0x50ed('0x68')]})[_0x50ed('0x26')](function(_0x4b5151){if(_0x4b5151&&_0x4b5151['length']){for(var _0x3c5bd9=0x0,_0x596eab=_0x4b5151[_0x50ed('0x4e')];_0x3c5bd9<_0x596eab&&_['isNil'](_0x52a0c0['internal']);_0x3c5bd9++){if(_0x43bdc8['min_internal']<=_0x4b5151[_0x3c5bd9]['from']){_0x52a0c0[_0x50ed('0x62')]=_0x4b5151[_0x3c5bd9][_0x50ed('0x69')];}else if(_0x43bdc8[_0x50ed('0x63')]>_0x4b5151[_0x3c5bd9][_0x50ed('0x69')]&&_0x43bdc8[_0x50ed('0x63')]<=_0x4b5151[_0x3c5bd9]['to']){_0x52a0c0[_0x50ed('0x62')]=_0x43bdc8[_0x50ed('0x63')];}}}if(_[_0x50ed('0x64')](_0x52a0c0[_0x50ed('0x62')])){_0x52a0c0[_0x50ed('0x62')]=_0x1a92a4+0x1;}return _0x35b6e8(_0x52a0c0);});});})[_0x50ed('0x57')](function(_0x176431){_0x377dbb(_0x176431);});});}function updateUser(_0x3f73c9){return new Promise(function(_0x50feaa,_0x43ab73){try{if(_0x3f73c9[_0x50ed('0x6a')]){_0x3f73c9[_0x50ed('0x6b')]=_0x3f73c9[_0x50ed('0x62')];_0x3f73c9['VoiceMail']={'mailbox':_0x3f73c9[_0x50ed('0x62')],'password':_0x3f73c9[_0x50ed('0x39')],'fullname':_0x3f73c9[_0x50ed('0x6c')],'email':_0x3f73c9[_0x50ed('0x6d')]};}if(_0x3f73c9[_0x50ed('0x21')]===_0x50ed('0x22')){if(!_0x3f73c9['permissions'])_0x3f73c9[_0x50ed('0x6e')]=[_0x50ed('0x6f'),'102','103',_0x50ed('0x70'),'110',_0x50ed('0x71'),_0x50ed('0x72'),_0x50ed('0x73'),'107','108','109',_0x50ed('0x74'),_0x50ed('0x75'),_0x50ed('0x76'),'115'];}_0x50feaa(_0x3f73c9);}catch(_0x2893bb){_0x43ab73(_0x2893bb);}});}exports[_0x50ed('0x77')]=function(_0x29e696,_0xfc998e){if(_0x29e696[_0x50ed('0x2a')]['role']==='agent')throw new Error(_0x50ed('0x78'));if(_0x29e696[_0x50ed('0x5b')][_0x50ed('0x21')]===_0x50ed('0x2a')&&_0x29e696[_0x50ed('0x2a')][_0x50ed('0x21')]!=='admin'){throw new Error(_0x50ed('0x79'));}if(_0x29e696[_0x50ed('0x5b')]['role']===_0x50ed('0x28')&&_0x29e696[_0x50ed('0x2a')]['role']!==_0x50ed('0x28')){throw new Error(_0x50ed('0x7a'));}return licenseUtil[_0x50ed('0x7b')]([_0x29e696[_0x50ed('0x5b')]])[_0x50ed('0x26')](function(){return validateUser(_0x29e696['body']);})[_0x50ed('0x26')](function(_0x63857f){return updateUser(_0x63857f)['then'](function(_0x369725){if(_0x369725[_0x50ed('0x21')]===_0x50ed('0x28')){_0x369725[_0x50ed('0x7c')]=_0x29e696['user']['settingsEnabled'];delete _0x369725[_0x50ed('0x7d')];}return _0x369725;});})[_0x50ed('0x26')](function(_0x13d40b){return db[_0x50ed('0x42')][_0x50ed('0x77')](_0x13d40b,{'include':[{'model':db[_0x50ed('0x7e')],'as':'VoiceMail'}]});})[_0x50ed('0x26')](function(_0x184201){if(_0x29e696[_0x50ed('0x5b')]['role']===_0x50ed('0x2a'))return _0x184201;if(_0x29e696[_0x50ed('0x2a')]['role']!==_0x50ed('0x2a'))return _0x184201;return db[_0x50ed('0x7f')][_0x50ed('0x30')]({'where':{'name':_0x184201[_0x50ed('0x21')]==='agent'?_0x50ed('0x80'):'Telephones','userProfileId':_0x29e696[_0x50ed('0x2a')]['userProfileId']},'raw':!![]})['then'](function(_0x198fa2){if(!_0x198fa2||_0x198fa2[_0x50ed('0x81')]!=0x0)return _0x184201;return db['UserProfileResource']['create']({'name':_0x184201['name'],'resourceId':_0x184201['id'],'type':_0x198fa2['name'],'sectionId':_0x198fa2['id']},{})[_0x50ed('0x26')](function(){return _0x184201;});})[_0x50ed('0x57')](function(_0x2f1c94){logger[_0x50ed('0x33')](_0x50ed('0x82'),_0x2f1c94);throw _0x2f1c94;});})[_0x50ed('0x26')](respondWithResult(_0xfc998e,0xc9))[_0x50ed('0x57')](handleError(_0xfc998e,null));};exports[_0x50ed('0x83')]=function(_0x2975bd,_0x30a865){var _0x4760c2=_0x2975bd[_0x50ed('0x5b')];var _0x597597=[];if(_0x2975bd[_0x50ed('0x2a')][_0x50ed('0x21')]==='agent')throw new Error(_0x50ed('0x78'));if(_['some'](_0x4760c2,[_0x50ed('0x21'),_0x50ed('0x2a')])&&_0x2975bd[_0x50ed('0x2a')][_0x50ed('0x21')]!==_0x50ed('0x28')){throw new Error(_0x50ed('0x79'));}if(_['some'](_0x4760c2,[_0x50ed('0x21'),_0x50ed('0x28')])&&_0x2975bd[_0x50ed('0x2a')][_0x50ed('0x21')]!==_0x50ed('0x28')){throw new Error(_0x50ed('0x84'));}return licenseUtil[_0x50ed('0x7b')](_0x4760c2)[_0x50ed('0x26')](function(){return validateUser(_0x4760c2[0x0]);})[_0x50ed('0x26')](function(){for(var _0x338a54=0x1;_0x338a54<_0x4760c2[_0x50ed('0x4e')];_0x338a54++){var _0x570076=_0x4760c2[_0x338a54-0x1][_0x50ed('0x62')];if(!_0x4760c2[_0x338a54][_0x50ed('0x62')])_0x4760c2[_0x338a54][_0x50ed('0x62')]=_0x570076+0x1;_0x597597['push'](validateUser(_0x4760c2[_0x338a54]));}return Promise['all'](_0x597597);})[_0x50ed('0x26')](function(){_0x597597=[];for(var _0x2bb7cc=0x0;_0x2bb7cc<_0x4760c2['length'];_0x2bb7cc++){_0x597597[_0x50ed('0x4a')](updateUser(_0x4760c2[_0x2bb7cc]));}return Promise[_0x50ed('0x56')](_0x597597);})['then'](function(){_0x597597=_0x4760c2[_0x50ed('0x36')](function(_0x33a92d){return db[_0x50ed('0x42')]['create'](_0x33a92d,{'include':[{'model':db[_0x50ed('0x7e')],'as':_0x50ed('0x7e')}]})[_0x50ed('0x26')](function(_0x51f1d0){_0x33a92d['id']=_0x51f1d0['id'];return _0x33a92d;});});return Promise['all'](_0x597597);})[_0x50ed('0x26')](function(_0x453042){if(_0x2975bd['body']['role']===_0x50ed('0x2a'))return _0x453042;if(_0x2975bd[_0x50ed('0x2a')][_0x50ed('0x21')]!==_0x50ed('0x2a'))return _0x453042;var _0x41d9ba=_[_0x50ed('0x85')](_0x453042,function(_0x32095f){return _0x32095f['role']===_0x50ed('0x22')||_0x32095f['role']===_0x50ed('0x2c');});if(!_0x41d9ba)return _0x453042;return db[_0x50ed('0x7f')][_0x50ed('0x4b')]({'where':{'name':{'$or':[_0x50ed('0x80'),_0x50ed('0x2b')]},'userProfileId':_0x2975bd[_0x50ed('0x2a')]['userProfileId']},'raw':!![]})[_0x50ed('0x26')](function(_0x3cbc0a){if(_[_0x50ed('0x86')](_0x3cbc0a)||!_['some'](_0x3cbc0a,['autoAssociation',0x0]))return _0x453042;_0x597597=[];var _0x2cba29=_(_0x3cbc0a)[_0x50ed('0x36')](function(_0x5e228d){if(_0x5e228d[_0x50ed('0x81')]===0x1)return;return _0x5e228d['name']===_0x50ed('0x80')?'agent':_0x50ed('0x2c');})[_0x50ed('0x87')]()[_0x50ed('0x2e')]();for(var _0x27e93d=0x0;_0x27e93d<_0x453042[_0x50ed('0x4e')];_0x27e93d++){if(!_[_0x50ed('0x2f')](_0x2cba29,_0x453042[_0x27e93d][_0x50ed('0x21')]))return;var _0x5d1ac2=_0x453042[_0x27e93d][_0x50ed('0x21')]===_0x50ed('0x22')?_0x50ed('0x80'):_0x50ed('0x2b');_0x597597[_0x50ed('0x4a')](db['UserProfileResource'][_0x50ed('0x77')]({'name':_0x453042[_0x27e93d][_0x50ed('0x31')],'resourceId':_0x453042[_0x27e93d]['id'],'type':_0x5d1ac2,'sectionId':_['find'](_0x3cbc0a,[_0x50ed('0x31'),_0x5d1ac2])['id']},{}));}return Promise[_0x50ed('0x56')](_0x597597);});})[_0x50ed('0x26')](respondWithResult(_0x30a865,0xc9))['catch'](handleError(_0x30a865,null));};exports[_0x50ed('0x88')]=function(_0x2e5d10,_0x320499){if(_0x2e5d10[_0x50ed('0x5b')]['id']){delete _0x2e5d10[_0x50ed('0x5b')]['id'];}return db[_0x50ed('0x42')][_0x50ed('0x30')]({'where':{'id':_0x2e5d10[_0x50ed('0x58')]['id']}})[_0x50ed('0x26')](function(_0x3e2b0f){if(!_0x3e2b0f)return null;if(_0x3e2b0f['id']===_0x2e5d10['user']['id']){if(!_0x2e5d10['body'][_0x50ed('0x89')]||!_0x2e5d10[_0x50ed('0x5b')]['newPassword']){throw new db[(_0x50ed('0x8a'))][(_0x50ed('0x8b'))](_0x50ed('0x8c'));}if(!_0x3e2b0f[_0x50ed('0x8d')](_0x2e5d10[_0x50ed('0x5b')]['oldPassword'])){throw new db[(_0x50ed('0x8a'))][(_0x50ed('0x8b'))](_0x50ed('0x8e'));}if(_0x2e5d10[_0x50ed('0x5b')]['oldPassword']===_0x2e5d10[_0x50ed('0x5b')][_0x50ed('0x8f')]){throw new db['Sequelize'][(_0x50ed('0x8b'))](_0x50ed('0x90'));}}else if(_0x2e5d10[_0x50ed('0x2a')][_0x50ed('0x21')]==='admin'){if(!_0x2e5d10[_0x50ed('0x5b')]['newPassword']){throw new db[(_0x50ed('0x8a'))][(_0x50ed('0x8b'))](_0x50ed('0x91'));}}else if(_0x2e5d10[_0x50ed('0x2a')][_0x50ed('0x21')]==='user'){if(!_0x2e5d10['body'][_0x50ed('0x8f')]){throw new db[(_0x50ed('0x8a'))]['ValidationError']('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x3e2b0f[_0x50ed('0x21')]!==_0x50ed('0x22')){throw new db[(_0x50ed('0x8a'))][(_0x50ed('0x8b'))]('Unauthorized');}}else{throw new db[(_0x50ed('0x8a'))][(_0x50ed('0x8b'))](_0x50ed('0x78'));}return _0x3e2b0f;})[_0x50ed('0x26')](handleEntityNotFound(_0x320499,null))[_0x50ed('0x26')](function(_0x5ae330){return db[_0x50ed('0x60')][_0x50ed('0x92')]({'attributes':['id',_0x50ed('0x61'),_0x50ed('0x93'),'passwordHistoryLimit']})[_0x50ed('0x26')](function(_0x34fdd5){if(_0x34fdd5[_0x50ed('0x61')])authService[_0x50ed('0x94')](_0x2e5d10['body']['newPassword']);if(!_0x34fdd5['enforcePasswordHistory']||!_0x5ae330[_0x50ed('0x3b')])return _0x5ae330;authService[_0x50ed('0x95')](_0x2e5d10[_0x50ed('0x5b')]['newPassword'],_0x5ae330[_0x50ed('0x3b')],_0x34fdd5[_0x50ed('0x96')]);return _0x5ae330;})[_0x50ed('0x26')](saveUpdates({'password':_0x2e5d10[_0x50ed('0x5b')][_0x50ed('0x8f')],'passwordResetAt':_0x2e5d10['user']['id']==_0x2e5d10['params']['id']?moment():null,'previousPasswords':authService[_0x50ed('0x97')](_0x2e5d10['body']['newPassword'],_0x5ae330[_0x50ed('0x3b')])},null));})['then'](respondWithResult(_0x320499,null))[_0x50ed('0x57')](handleError(_0x320499,null));};exports['addQueues']=function(_0x57e297,_0x174b7e){var _0x2c4d44=_0x57e297[_0x50ed('0x5b')]['channel'];return db[_0x50ed('0x42')]['find']({'where':{'id':_0x57e297[_0x50ed('0x58')]['id']},'attributes':['id',_0x50ed('0x31'),_0x50ed('0x21'),_0x50ed('0x98'),_0x50ed('0x99'),'voicePause',_0x50ed('0x9a')]})[_0x50ed('0x26')](handleEntityNotFound(_0x174b7e,null))[_0x50ed('0x26')](function(_0x325f59){if(_0x325f59){if(!utils[_0x50ed('0x9b')](_0x2c4d44)){throw new db['Sequelize'][(_0x50ed('0x8b'))](_0x50ed('0x9c'));}return _0x325f59[_0x50ed('0x9d')+_[_0x50ed('0x9e')](_0x2c4d44[_0x50ed('0x9f')]())+_0x50ed('0xa0')](_0x57e297[_0x50ed('0x5b')][_0x50ed('0x5e')],{'penalty':_0x57e297['body']['penalty']||0x0})[_0x50ed('0xa1')](function(_0x39763b){for(var _0x5bfef9=0x0;_0x5bfef9<_0x57e297['body'][_0x50ed('0x5e')]['length'];_0x5bfef9+=0x1){var _0x5a7591={'UserId':Number(_0x57e297[_0x50ed('0x58')]['id'])};_0x5a7591[_[_0x50ed('0x9e')](_0x2c4d44[_0x50ed('0x9f')]())+'QueueId']=Number(_0x57e297[_0x50ed('0x5b')][_0x50ed('0x5e')][_0x5bfef9]);socket[_0x50ed('0x23')](_0x50ed('0x2a')+_['capitalize'](_0x2c4d44['toLowerCase']())+_0x50ed('0xa2'),_0x5a7591);}return _0x39763b;})['then'](function(){if(_0x2c4d44===_0x50ed('0xa3')){return db[_0x50ed('0xa4')][_0x50ed('0x4b')]({'where':{'id':_0x57e297['body'][_0x50ed('0x5e')]||[]},'raw':!![],'attributes':['id',_0x50ed('0x31')]});}})[_0x50ed('0x26')](function(_0x417532){var _0x5e1755=_0x325f59[_0x50ed('0x27')]({'plain':!![]});var _0x2d2505=[];if(_0x2c4d44===_0x50ed('0xa3')&&_0x5e1755[_0x50ed('0x21')]===_0x50ed('0x22')&&_0x5e1755[_0x50ed('0x98')]){for(let _0x44942f=0x0;_0x44942f<_0x417532[_0x50ed('0x4e')];_0x44942f+=0x1){_0x2d2505[_0x50ed('0x4a')]({'membername':_0x5e1755[_0x50ed('0x31')],'UserId':_0x5e1755['id'],'queue_name':_0x417532[_0x44942f][_0x50ed('0x31')],'VoiceQueueId':_0x417532[_0x44942f]['id'],'interface':_[_0x50ed('0x64')](_0x5e1755[_0x50ed('0x9a')])?util[_0x50ed('0xa5')](_0x50ed('0xa6'),_0x5e1755[_0x50ed('0x31')]):_0x5e1755[_0x50ed('0x9a')],'paused':_0x5e1755[_0x50ed('0xa7')]||![],'penalty':_0x57e297[_0x50ed('0x5b')][_0x50ed('0xa8')]||0x0});}return Promise[_0x50ed('0x56')](_0x2d2505[_0x50ed('0x36')](function(_0x5e4c96){return db['UserVoiceQueueRt'][_0x50ed('0xa9')](_0x5e4c96);}));}return _0x325f59;});}})[_0x50ed('0x26')](respondWithStatusCode(_0x174b7e,null))['catch'](handleError(_0x174b7e,null));};exports[_0x50ed('0xaa')]=function(_0x37eadf,_0x487320){var _0x38c450,_0x242dfd;return db[_0x50ed('0x42')][_0x50ed('0x30')]({'where':{'id':_0x37eadf[_0x50ed('0x58')]['id']},'attributes':['id',_0x50ed('0x31'),_0x50ed('0x21')]})[_0x50ed('0x26')](handleEntityNotFound(_0x487320,null))[_0x50ed('0x26')](function(_0x614a4){if(_0x614a4){_0x38c450=_0x614a4;if(!_0x37eadf[_0x50ed('0x43')][_0x50ed('0xab')]||!utils[_0x50ed('0x9b')](_0x37eadf[_0x50ed('0x43')][_0x50ed('0xab')])){throw new db[(_0x50ed('0x8a'))][(_0x50ed('0x8b'))](_0x50ed('0x9c'));}return _0x614a4[_0x50ed('0xac')+_[_0x50ed('0x9e')](_0x37eadf['query'][_0x50ed('0xab')][_0x50ed('0x9f')]())+'Queues'](_0x37eadf[_0x50ed('0x43')][_0x50ed('0x5e')]);}})[_0x50ed('0x26')](function(_0xc4db99){if(_[_0x50ed('0xad')](_0x37eadf['query']['ids'])){for(var _0xaebf16=0x0;_0xaebf16<_0x37eadf[_0x50ed('0x43')][_0x50ed('0x5e')][_0x50ed('0x4e')];_0xaebf16+=0x1){_0x242dfd={'UserId':Number(_0x37eadf[_0x50ed('0x58')]['id'])};_0x242dfd[_[_0x50ed('0x9e')](_0x37eadf[_0x50ed('0x43')][_0x50ed('0xab')][_0x50ed('0x9f')]())+_0x50ed('0xae')]=Number(_0x37eadf[_0x50ed('0x43')][_0x50ed('0x5e')][_0xaebf16]);socket[_0x50ed('0x23')](_0x50ed('0x2a')+_[_0x50ed('0x9e')](_0x37eadf[_0x50ed('0x43')][_0x50ed('0xab')][_0x50ed('0x9f')]())+_0x50ed('0xaf'),_0x242dfd);}}else{_0x242dfd={'UserId':Number(_0x37eadf[_0x50ed('0x58')]['id'])};_0x242dfd[_[_0x50ed('0x9e')](_0x37eadf[_0x50ed('0x43')][_0x50ed('0xab')]['toLowerCase']())+_0x50ed('0xae')]=Number(_0x37eadf['query'][_0x50ed('0x5e')]);socket[_0x50ed('0x23')](_0x50ed('0x2a')+_['capitalize'](_0x37eadf['query']['channel']['toLowerCase']())+_0x50ed('0xaf'),_0x242dfd);}return _0xc4db99;})[_0x50ed('0x26')](function(){if(_0x37eadf[_0x50ed('0x43')][_0x50ed('0xab')]===_0x50ed('0xa3')){return db[_0x50ed('0xb0')]['destroy']({'where':{'UserId':_0x37eadf[_0x50ed('0x58')]['id'],'VoiceQueueId':_0x37eadf[_0x50ed('0x43')]['ids']},'individualHooks':!![]})[_0x50ed('0x26')](function(){return _0x38c450;});}return _0x38c450;})[_0x50ed('0x26')](respondWithStatusCode(_0x487320,null))[_0x50ed('0x57')](handleError(_0x487320,null));};exports['addAvatar']=function(_0x24d6a1,_0x25badc){_0x24d6a1[_0x50ed('0x5b')][_0x50ed('0xb1')]=_0x24d6a1['file'][_0x50ed('0xb2')];return db['User'][_0x50ed('0x30')]({'where':{'id':_0x24d6a1[_0x50ed('0x58')]['id']}})[_0x50ed('0x26')](handleEntityNotFound(_0x25badc,null))[_0x50ed('0x26')](saveUpdates(_0x24d6a1[_0x50ed('0x5b')],null))[_0x50ed('0x26')](respondWithResult(_0x25badc,null))['catch'](handleError(_0x25badc,null));};exports[_0x50ed('0xb3')]=function(_0x542b0e,_0x5cd7a6){var _0x5abe63=path['join'](config['root'],_0x50ed('0xb4'));return db[_0x50ed('0x42')][_0x50ed('0x30')]({'where':{'id':_0x542b0e['params']['id']},'attributes':['id','userpic'],'raw':!![]})[_0x50ed('0x26')](handleEntityNotFound(_0x5cd7a6,null))['then'](function(_0x387ac8){if(_0x387ac8){if(_[_0x50ed('0x64')](_0x387ac8[_0x50ed('0xb1')])){return _0x5cd7a6[_0x50ed('0xb5')](_0x5abe63);}else{if(!fs[_0x50ed('0xb6')](path[_0x50ed('0xb7')](config[_0x50ed('0xb8')],_0x50ed('0xb9'),_0x387ac8['userpic']))){return _0x5cd7a6['download'](_0x5abe63);}return _0x5cd7a6[_0x50ed('0xb5')](path['join'](config[_0x50ed('0xb8')],_0x50ed('0xb9'),_0x387ac8[_0x50ed('0xb1')]));}}})[_0x50ed('0x57')](handleError(_0x5cd7a6,null));};exports[_0x50ed('0xba')]=function(_0x28759b,_0x19707b){return db[_0x50ed('0x42')][_0x50ed('0x30')]({'where':{'id':_0x28759b['params']['id']},'attributes':['id']})['then'](handleEntityNotFound(_0x19707b,null))[_0x50ed('0x26')](function(_0x512015){var _0x279cb3=[];values=_0x512015['dataValues'];_0x279cb3['push'](get_open_tabs('chat',_0x512015['dataValues']));_0x279cb3[_0x50ed('0x4a')](get_open_tabs(_0x50ed('0x51'),_0x512015[_0x50ed('0x50')]));_0x279cb3[_0x50ed('0x4a')](get_open_tabs(_0x50ed('0x54'),_0x512015[_0x50ed('0x50')]));_0x279cb3[_0x50ed('0x4a')](get_open_tabs(_0x50ed('0x55'),_0x512015[_0x50ed('0x50')]));_0x279cb3[_0x50ed('0x4a')](get_open_tabs(_0x50ed('0x52'),_0x512015[_0x50ed('0x50')]));_0x279cb3[_0x50ed('0x4a')](get_open_tabs('mail',_0x512015[_0x50ed('0x50')]));return Promise[_0x50ed('0x56')](_0x279cb3);})['then'](function(_0x4c12c6){if(_0x4c12c6){var _0x1fcc53=_['map'](values[_0x50ed('0xbb')],function(_0x3352c6){return{'channel':_0x50ed('0xbc'),'id':_0x3352c6['id'],'createdAt':_0x3352c6[_0x50ed('0xbd')]};});var _0x486f1a=_[_0x50ed('0x36')](values[_0x50ed('0xbe')],function(_0x4d2b63){return{'channel':'FAX','id':_0x4d2b63['id'],'createdAt':_0x4d2b63['createdAt']};});var _0x5320d9=_[_0x50ed('0x36')](values['OpenchannelOpenTabs'],function(_0x55fbba){return{'channel':_0x50ed('0xbf'),'id':_0x55fbba['id'],'createdAt':_0x55fbba[_0x50ed('0xbd')]};});var _0x4864db=_[_0x50ed('0x36')](values[_0x50ed('0xc0')],function(_0x1f2759){return{'channel':_0x50ed('0xc1'),'id':_0x1f2759['id'],'createdAt':_0x1f2759[_0x50ed('0xbd')]};});var _0x24a34d=_[_0x50ed('0x36')](values['SmsOpenTabs'],function(_0x4c9a8b){return{'channel':_0x50ed('0xc2'),'id':_0x4c9a8b['id'],'createdAt':_0x4c9a8b[_0x50ed('0xbd')]};});var _0x5c1868=_[_0x50ed('0x36')](values[_0x50ed('0xc3')],function(_0x412c58){return{'channel':_0x50ed('0xc4'),'id':_0x412c58['id'],'createdAt':_0x412c58['createdAt']};});var _0x13fba8=_[_0x50ed('0xc5')](_0x1fcc53,_0x486f1a,_0x5320d9,_0x4864db,_0x24a34d,_0x5c1868);var _0x18a190={'count':_0x13fba8['length'],'rows':_0x13fba8};return _0x18a190;}else return null;})[_0x50ed('0x26')](respondWithResult(_0x19707b,null))[_0x50ed('0x57')](handleError(_0x19707b,null));};exports[_0x50ed('0xc6')]=function(_0x971dc7,_0x3f9eb9){var _0x55d054={};return db[_0x50ed('0x42')][_0x50ed('0x92')]({'where':{'id':_0x971dc7[_0x50ed('0x58')]['id']}})[_0x50ed('0x26')](function(_0x17e8f4){if(!_0x17e8f4){throw new APINotFoundError(util[_0x50ed('0xa5')](_0x50ed('0xc7'),_0x971dc7['params']['id']));}return contacts[_0x50ed('0x5c')]();})[_0x50ed('0x26')](function(_0x2257a0){_0x971dc7[_0x50ed('0x43')][_0x50ed('0x42')]=_0x971dc7['params']['id'];_0x55d054=qs[_0x50ed('0x40')](_0x2257a0,_0x971dc7);if(_0x971dc7['query'][_0x50ed('0xc8')](_0x50ed('0x44'))){_0x55d054[_0x50ed('0x45')]=[{'model':db['CmList'],'as':_0x50ed('0xc9'),'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x50ed('0x31'),_0x50ed('0xca')],'where':_0x971dc7['query'][_0x50ed('0xcb')]?{'id':_0x971dc7['query'][_0x50ed('0xcb')]}:undefined,'required':_0x971dc7[_0x50ed('0x43')][_0x50ed('0xcb')]?!![]:![]}];}return contacts['findAll'](_0x971dc7[_0x50ed('0x43')],_0x971dc7[_0x50ed('0x2a')],_0x55d054,_0x2257a0);})[_0x50ed('0x26')](respondWithFilteredResult(_0x3f9eb9,_0x55d054))[_0x50ed('0x57')](APIHandleError(_0x3f9eb9));};exports['getQueues']=function(_0x513773,_0x39e3e3){var _0x5e2776;var _0x488199={};var _0x4a95a0;return db['User'][_0x50ed('0x92')]({'where':{'id':_0x513773['params']['id']},'attributes':['id',_0x50ed('0x31'),'role']})['then'](handleEntityNotFound(_0x39e3e3,null))[_0x50ed('0x26')](function(_0x16aaa8){if(!utils[_0x50ed('0x9b')](_0x513773['query'][_0x50ed('0xab')])){throw new db[(_0x50ed('0x8a'))][(_0x50ed('0x8b'))](_0x50ed('0x9c'));}_0x5e2776=_0x16aaa8;var _0x339ae6={};_0x339ae6[_0x50ed('0xcc')]=_[_0x50ed('0xcd')](db[_['capitalize'](_0x513773[_0x50ed('0x43')][_0x50ed('0xab')])+_0x50ed('0xce')]['rawAttributes']);_0x339ae6[_0x50ed('0x43')]=_[_0x50ed('0xcd')](_0x513773[_0x50ed('0x43')]);_0x339ae6[_0x50ed('0xcf')]=_[_0x50ed('0xd0')](_0x339ae6['model'],_0x339ae6[_0x50ed('0x43')]);_0x488199[_0x50ed('0x49')]=_[_0x50ed('0xd0')](_0x339ae6[_0x50ed('0xcc')],qs[_0x50ed('0xd1')](_0x513773['query']['fields']));_0x488199[_0x50ed('0x49')]=_0x488199[_0x50ed('0x49')][_0x50ed('0x4e')]?_0x488199[_0x50ed('0x49')]:_0x339ae6[_0x50ed('0xcc')];_0x488199[_0x50ed('0xd2')]=qs[_0x50ed('0xd3')](_0x513773[_0x50ed('0x43')][_0x50ed('0xd3')]);_0x488199[_0x50ed('0x41')]=qs[_0x50ed('0xcf')](_[_0x50ed('0xd4')](_0x513773[_0x50ed('0x43')],_0x339ae6[_0x50ed('0xcf')]));if(_0x513773[_0x50ed('0x43')][_0x50ed('0x2d')]){_0x488199['where']=_['merge'](_0x488199['where'],{'$or':_[_0x50ed('0x36')](_0x488199['attributes'],function(_0x47c669){var _0x48fe3f={};_0x48fe3f[_0x47c669]={'$like':'%'+_0x513773[_0x50ed('0x43')][_0x50ed('0x2d')]+'%'};return _0x48fe3f;})});}_0x488199=_[_0x50ed('0x59')]({},_0x488199,_0x513773[_0x50ed('0x5a')]);switch(_0x5e2776['role']){case _0x50ed('0x28'):return db[_[_0x50ed('0x9e')](_0x513773['query'][_0x50ed('0xab')])+_0x50ed('0xce')][_0x50ed('0x4b')](_0x488199);case'user':case _0x50ed('0x22'):return _0x5e2776[_0x50ed('0x27')+_[_0x50ed('0x9e')](_0x513773[_0x50ed('0x43')][_0x50ed('0xab')])+_0x50ed('0xa0')](_0x488199);default:throw new db[(_0x50ed('0x8a'))]['ValidationError'](_0x50ed('0xd5'));}})[_0x50ed('0x26')](function(_0x408251){_0x4a95a0=_0x408251['length'];if(!_0x513773[_0x50ed('0x43')][_0x50ed('0xc8')]('nolimit')){_0x488199[_0x50ed('0xd6')]=qs['limit'](_0x513773[_0x50ed('0x43')][_0x50ed('0xd6')]);_0x488199['offset']=qs[_0x50ed('0x1c')](_0x513773[_0x50ed('0x43')][_0x50ed('0x1c')]);}switch(_0x5e2776[_0x50ed('0x21')]){case _0x50ed('0x28'):return db[_[_0x50ed('0x9e')](_0x513773[_0x50ed('0x43')][_0x50ed('0xab')])+_0x50ed('0xce')][_0x50ed('0x4b')](_0x488199);case _0x50ed('0x2a'):case _0x50ed('0x22'):return _0x5e2776[_0x50ed('0x27')+_['capitalize'](_0x513773['query']['channel'])+_0x50ed('0xa0')](_0x488199);}})[_0x50ed('0x26')](function(_0x4aa174){return{'count':_0x4a95a0,'rows':_0x4aa174};})[_0x50ed('0x26')](respondWithResult(_0x39e3e3,null))['catch'](handleError(_0x39e3e3,null));};exports[_0x50ed('0xd7')]=function(_0xe85295,_0x109c6c){var _0xe86294={};var _0x9c626a={};var _0x2ffcf8;var _0x5b9635;return db['User']['findOne']({'where':{'id':_0xe85295[_0x50ed('0x58')]['id']}})[_0x50ed('0x26')](handleEntityNotFound(_0x109c6c,null))[_0x50ed('0x26')](function(_0x3cdc30){if(_0x3cdc30){_0x2ffcf8=_0x3cdc30;_0x9c626a[_0x50ed('0xcc')]=_[_0x50ed('0xcd')](db[_0x50ed('0xb0')][_0x50ed('0xd8')]);_0x9c626a[_0x50ed('0x43')]=_[_0x50ed('0xcd')](_0xe85295['query']);_0x9c626a['filters']=_[_0x50ed('0xd0')](_0x9c626a[_0x50ed('0xcc')],_0x9c626a['query']);_0xe86294['attributes']=_[_0x50ed('0xd0')](_0x9c626a['model'],qs[_0x50ed('0xd1')](_0xe85295[_0x50ed('0x43')][_0x50ed('0xd1')]));_0xe86294[_0x50ed('0x49')]=_0xe86294[_0x50ed('0x49')][_0x50ed('0x4e')]?_0xe86294['attributes']:_0x9c626a[_0x50ed('0xcc')];_0xe86294[_0x50ed('0xd2')]=qs[_0x50ed('0xd3')](_0xe85295[_0x50ed('0x43')]['sort']);_0xe86294[_0x50ed('0x41')]=qs[_0x50ed('0xcf')](_[_0x50ed('0xd4')](_0xe85295['query'],_0x9c626a[_0x50ed('0xcf')]));if(_0xe85295['query'][_0x50ed('0x2d')]){_0xe86294[_0x50ed('0x41')]=_[_0x50ed('0x59')](_0xe86294[_0x50ed('0x41')],{'$or':_['map'](_0xe86294[_0x50ed('0x49')],function(_0x1fe12a){var _0x124f27={};_0x124f27[_0x1fe12a]={'$like':'%'+_0xe85295[_0x50ed('0x43')][_0x50ed('0x2d')]+'%'};return _0x124f27;})});}_0xe86294=_[_0x50ed('0x59')]({},_0xe86294,_0xe85295[_0x50ed('0x5a')]);return _0x2ffcf8[_0x50ed('0xd7')](_0xe86294);}})['then'](function(_0x16cd5e){if(_0x16cd5e){_0x5b9635=_0x16cd5e[_0x50ed('0x4e')];if(!_0xe85295[_0x50ed('0x43')][_0x50ed('0xc8')]('nolimit')){_0xe86294[_0x50ed('0xd6')]=qs['limit'](_0xe85295[_0x50ed('0x43')][_0x50ed('0xd6')]);_0xe86294[_0x50ed('0x1c')]=qs[_0x50ed('0x1c')](_0xe85295['query'][_0x50ed('0x1c')]);}return _0x2ffcf8[_0x50ed('0xd7')](_0xe86294);}})[_0x50ed('0x26')](function(_0x3365ca){if(_0x3365ca){return _0x3365ca?{'count':_0x5b9635,'rows':_0x3365ca}:null;}})[_0x50ed('0x26')](respondWithResult(_0x109c6c,null))[_0x50ed('0x57')](handleError(_0x109c6c,null));};exports[_0x50ed('0xd9')]=function(_0x533aae,_0x23812c){var _0x1f0099={};var _0x3680fc={};var _0x3f21c1;var _0x5a9020;return db[_0x50ed('0x42')][_0x50ed('0x92')]({'where':{'id':_0x533aae[_0x50ed('0x58')]['id']}})[_0x50ed('0x26')](handleEntityNotFound(_0x23812c,null))[_0x50ed('0x26')](function(_0x29c4f9){if(_0x29c4f9){_0x3f21c1=_0x29c4f9;_0x3680fc[_0x50ed('0xcc')]=_[_0x50ed('0xcd')](db[_0x50ed('0xda')][_0x50ed('0xd8')]);_0x3680fc['query']=_[_0x50ed('0xcd')](_0x533aae['query']);_0x3680fc[_0x50ed('0xcf')]=_[_0x50ed('0xd0')](_0x3680fc[_0x50ed('0xcc')],_0x3680fc[_0x50ed('0x43')]);_0x1f0099[_0x50ed('0x49')]=_[_0x50ed('0xd0')](_0x3680fc[_0x50ed('0xcc')],qs[_0x50ed('0xd1')](_0x533aae[_0x50ed('0x43')][_0x50ed('0xd1')]));_0x1f0099[_0x50ed('0x49')]=_0x1f0099['attributes'][_0x50ed('0x4e')]?_0x1f0099[_0x50ed('0x49')]:_0x3680fc[_0x50ed('0xcc')];_0x1f0099['order']=qs['sort'](_0x533aae[_0x50ed('0x43')][_0x50ed('0xd3')]);_0x1f0099[_0x50ed('0x41')]=qs['filters'](_[_0x50ed('0xd4')](_0x533aae['query'],_0x3680fc[_0x50ed('0xcf')]));if(_0x533aae[_0x50ed('0x43')]['filter']){_0x1f0099[_0x50ed('0x41')]=_[_0x50ed('0x59')](_0x1f0099[_0x50ed('0x41')],{'$or':_['map'](_0x1f0099[_0x50ed('0x49')],function(_0xc8f709){var _0x5c741f={};_0x5c741f[_0xc8f709]={'$like':'%'+_0x533aae[_0x50ed('0x43')][_0x50ed('0x2d')]+'%'};return _0x5c741f;})});}_0x1f0099=_['merge']({},_0x1f0099,_0x533aae[_0x50ed('0x5a')]);return _0x3f21c1[_0x50ed('0xd9')](_0x1f0099);}})[_0x50ed('0x26')](function(_0x1add75){if(_0x1add75){_0x5a9020=_0x1add75[_0x50ed('0x4e')];if(!_0x533aae['query']['hasOwnProperty'](_0x50ed('0xdb'))){_0x1f0099[_0x50ed('0xd6')]=qs[_0x50ed('0xd6')](_0x533aae[_0x50ed('0x43')][_0x50ed('0xd6')]);_0x1f0099['offset']=qs[_0x50ed('0x1c')](_0x533aae['query'][_0x50ed('0x1c')]);}return _0x3f21c1[_0x50ed('0xd9')](_0x1f0099);}})[_0x50ed('0x26')](function(_0x1b10d9){if(_0x1b10d9){return _0x1b10d9?{'count':_0x5a9020,'rows':_0x1b10d9}:null;}})[_0x50ed('0x26')](respondWithResult(_0x23812c,null))['catch'](handleError(_0x23812c,null));};exports[_0x50ed('0xdc')]=function(_0x58aaf1,_0x4eb20f){var _0x1ecd50={'raw':!![],'where':{}};var _0x15658e={};var _0x2d8a8c={'count':0x0,'rows':[]};return db[_0x50ed('0x42')][_0x50ed('0x92')]({'where':{'id':_0x58aaf1['params']['id']}})[_0x50ed('0x26')](handleEntityNotFound(_0x4eb20f,null))[_0x50ed('0x26')](function(_0x49d6d1){if(_0x49d6d1){_0x15658e['model']=_[_0x50ed('0xcd')](db['VoiceRecording']['rawAttributes']);_0x15658e['query']=_[_0x50ed('0xcd')](_0x58aaf1[_0x50ed('0x43')]);_0x15658e['filters']=_[_0x50ed('0xd0')](_0x15658e[_0x50ed('0xcc')],_0x15658e[_0x50ed('0x43')]);_0x1ecd50[_0x50ed('0x49')]=_[_0x50ed('0xd0')](_0x15658e['model'],qs[_0x50ed('0xd1')](_0x58aaf1[_0x50ed('0x43')][_0x50ed('0xd1')]));_0x1ecd50['attributes']=_0x1ecd50['attributes'][_0x50ed('0x4e')]?_0x1ecd50[_0x50ed('0x49')]:_0x15658e[_0x50ed('0xcc')];if(!_0x58aaf1['query'][_0x50ed('0xc8')](_0x50ed('0xdb'))){_0x1ecd50[_0x50ed('0xd6')]=qs['limit'](_0x58aaf1['query'][_0x50ed('0xd6')]);_0x1ecd50[_0x50ed('0x1c')]=qs['offset'](_0x58aaf1[_0x50ed('0x43')][_0x50ed('0x1c')]);}_0x1ecd50[_0x50ed('0xd2')]=qs[_0x50ed('0xd3')](_0x58aaf1[_0x50ed('0x43')][_0x50ed('0xd3')]);_0x1ecd50[_0x50ed('0x41')]=qs[_0x50ed('0xcf')](_['pick'](_0x58aaf1[_0x50ed('0x43')],_0x15658e[_0x50ed('0xcf')]));_0x1ecd50[_0x50ed('0x41')]['UserId']=_0x49d6d1['id'];if(_0x58aaf1[_0x50ed('0x43')]['filter']){_0x1ecd50[_0x50ed('0x41')]=_[_0x50ed('0x59')](_0x1ecd50[_0x50ed('0x41')],{'$or':_['map'](_0x1ecd50[_0x50ed('0x49')],function(_0x58c1af){var _0x2d8b76={};_0x2d8b76[_0x58c1af]={'$like':'%'+_0x58aaf1[_0x50ed('0x43')][_0x50ed('0x2d')]+'%'};return _0x2d8b76;})});}_0x1ecd50=_[_0x50ed('0x59')]({},_0x1ecd50,_0x58aaf1[_0x50ed('0x5a')]);return db[_0x50ed('0xdd')][_0x50ed('0x1d')]({'where':_0x1ecd50[_0x50ed('0x41')]})[_0x50ed('0x26')](function(_0x468616){_0x2d8a8c[_0x50ed('0x1d')]=_0x468616;if(_0x58aaf1[_0x50ed('0x43')]['includeAll']){_0x1ecd50['include']=[{'all':!![]}];}return db[_0x50ed('0xdd')]['findAll'](_0x1ecd50);})['then'](function(_0x178e72){_0x2d8a8c[_0x50ed('0x4c')]=_0x178e72;return _0x2d8a8c;});}})['then'](respondWithFilteredResult(_0x4eb20f,_0x1ecd50))[_0x50ed('0x57')](handleError(_0x4eb20f,null));};exports[_0x50ed('0xde')]=function(_0x1749aa,_0x31aa62){var _0x5a06b2={'raw':!![],'where':{}};var _0x5bf789={};var _0x132fa3={'count':0x0,'rows':[]};return db[_0x50ed('0x42')]['findOne']({'where':{'id':_0x1749aa[_0x50ed('0x58')]['id']}})['then'](handleEntityNotFound(_0x31aa62,null))[_0x50ed('0x26')](function(_0x1dcce8){if(_0x1dcce8){_0x5bf789[_0x50ed('0xcc')]=_[_0x50ed('0xcd')](db[_0x50ed('0xdf')][_0x50ed('0xd8')]);_0x5bf789[_0x50ed('0x43')]=_[_0x50ed('0xcd')](_0x1749aa[_0x50ed('0x43')]);_0x5bf789[_0x50ed('0xcf')]=_[_0x50ed('0xd0')](_0x5bf789[_0x50ed('0xcc')],_0x5bf789[_0x50ed('0x43')]);_0x5a06b2[_0x50ed('0x49')]=_[_0x50ed('0xd0')](_0x5bf789[_0x50ed('0xcc')],qs['fields'](_0x1749aa[_0x50ed('0x43')]['fields']));_0x5a06b2[_0x50ed('0x49')]=_0x5a06b2[_0x50ed('0x49')][_0x50ed('0x4e')]?_0x5a06b2['attributes']:_0x5bf789[_0x50ed('0xcc')];if(!_0x1749aa[_0x50ed('0x43')][_0x50ed('0xc8')](_0x50ed('0xdb'))){_0x5a06b2[_0x50ed('0xd6')]=qs['limit'](_0x1749aa[_0x50ed('0x43')]['limit']);_0x5a06b2[_0x50ed('0x1c')]=qs[_0x50ed('0x1c')](_0x1749aa[_0x50ed('0x43')][_0x50ed('0x1c')]);}_0x5a06b2[_0x50ed('0xd2')]=qs[_0x50ed('0xd3')](_0x1749aa['query'][_0x50ed('0xd3')]);_0x5a06b2['where']=qs[_0x50ed('0xcf')](_[_0x50ed('0xd4')](_0x1749aa['query'],_0x5bf789[_0x50ed('0xcf')]));_0x5a06b2[_0x50ed('0x41')][_0x50ed('0xe0')]=_0x1dcce8['id'];if(_0x1749aa[_0x50ed('0x43')][_0x50ed('0x2d')]){_0x5a06b2[_0x50ed('0x41')]=_[_0x50ed('0x59')](_0x5a06b2[_0x50ed('0x41')],{'$or':_['map'](_0x5a06b2[_0x50ed('0x49')],function(_0x234258){var _0x5c1d93={};_0x5c1d93[_0x234258]={'$like':'%'+_0x1749aa[_0x50ed('0x43')][_0x50ed('0x2d')]+'%'};return _0x5c1d93;})});}_0x5a06b2=_['merge']({},_0x5a06b2,_0x1749aa[_0x50ed('0x5a')]);return db[_0x50ed('0xdf')][_0x50ed('0x1d')]({'where':_0x5a06b2[_0x50ed('0x41')]})['then'](function(_0x317a3b){_0x132fa3[_0x50ed('0x1d')]=_0x317a3b;if(_0x1749aa[_0x50ed('0x43')][_0x50ed('0x44')]){_0x5a06b2['include']=[{'all':!![]}];}return db[_0x50ed('0xdf')]['findAll'](_0x5a06b2);})['then'](function(_0x6d734c){_0x132fa3[_0x50ed('0x4c')]=_0x6d734c;return _0x132fa3;});}})[_0x50ed('0x26')](respondWithFilteredResult(_0x31aa62,_0x5a06b2))[_0x50ed('0x57')](handleError(_0x31aa62,null));};exports[_0x50ed('0xe1')]=function(_0x25f491,_0x3b0b32){var _0x41024c={};var _0x19a4c4={};var _0x34201e;var _0x54ed89;return db[_0x50ed('0x42')][_0x50ed('0x92')]({'where':{'id':_0x25f491[_0x50ed('0x58')]['id']}})[_0x50ed('0x26')](handleEntityNotFound(_0x3b0b32,null))['then'](function(_0x15fd51){if(_0x15fd51){_0x34201e=_0x15fd51;_0x19a4c4[_0x50ed('0xcc')]=_['keys'](db[_0x50ed('0xe2')][_0x50ed('0xd8')]);_0x19a4c4[_0x50ed('0x43')]=_[_0x50ed('0xcd')](_0x25f491['query']);_0x19a4c4['filters']=_[_0x50ed('0xd0')](_0x19a4c4[_0x50ed('0xcc')],_0x19a4c4['query']);_0x41024c[_0x50ed('0x49')]=_[_0x50ed('0xd0')](_0x19a4c4['model'],qs[_0x50ed('0xd1')](_0x25f491[_0x50ed('0x43')][_0x50ed('0xd1')]));_0x41024c['attributes']=_0x41024c[_0x50ed('0x49')]['length']?_0x41024c[_0x50ed('0x49')]:_0x19a4c4[_0x50ed('0xcc')];_0x41024c[_0x50ed('0xd2')]=qs[_0x50ed('0xd3')](_0x25f491['query'][_0x50ed('0xd3')]);_0x41024c[_0x50ed('0x41')]=qs[_0x50ed('0xcf')](_['pick'](_0x25f491['query'],_0x19a4c4[_0x50ed('0xcf')]));if(_0x25f491[_0x50ed('0x43')][_0x50ed('0x2d')]){_0x41024c[_0x50ed('0x41')]=_[_0x50ed('0x59')](_0x41024c[_0x50ed('0x41')],{'$or':_[_0x50ed('0x36')](_0x41024c[_0x50ed('0x49')],function(_0x23501d){var _0x3c38e0={};_0x3c38e0[_0x23501d]={'$like':'%'+_0x25f491[_0x50ed('0x43')][_0x50ed('0x2d')]+'%'};return _0x3c38e0;})});}_0x41024c=_[_0x50ed('0x59')]({},_0x41024c,_0x25f491[_0x50ed('0x5a')]);return _0x34201e[_0x50ed('0xe1')](_0x41024c);}})['then'](function(_0x443ba9){if(_0x443ba9){_0x54ed89=_0x443ba9[_0x50ed('0x4e')];if(!_0x25f491[_0x50ed('0x43')][_0x50ed('0xc8')](_0x50ed('0xdb'))){_0x41024c[_0x50ed('0xd6')]=qs[_0x50ed('0xd6')](_0x25f491[_0x50ed('0x43')]['limit']);_0x41024c[_0x50ed('0x1c')]=qs[_0x50ed('0x1c')](_0x25f491[_0x50ed('0x43')][_0x50ed('0x1c')]);}return _0x34201e['getChatInteractions'](_0x41024c);}})[_0x50ed('0x26')](function(_0x584010){if(_0x584010){return _0x584010?{'count':_0x54ed89,'rows':_0x584010}:null;}})[_0x50ed('0x26')](respondWithResult(_0x3b0b32,null))[_0x50ed('0x57')](handleError(_0x3b0b32,null));};exports[_0x50ed('0xe3')]=function(_0x366f5e,_0x10b94f){var _0x5e7b1b={};var _0x4e9c4a={};var _0x29f6a1;var _0x3b7fa3;return db['User'][_0x50ed('0x92')]({'where':{'id':_0x366f5e[_0x50ed('0x58')]['id']}})[_0x50ed('0x26')](handleEntityNotFound(_0x10b94f,null))[_0x50ed('0x26')](function(_0x24ff17){if(_0x24ff17){_0x29f6a1=_0x24ff17;_0x4e9c4a['model']=_['keys'](db[_0x50ed('0xe4')][_0x50ed('0xd8')]);_0x4e9c4a[_0x50ed('0x43')]=_[_0x50ed('0xcd')](_0x366f5e[_0x50ed('0x43')]);_0x4e9c4a[_0x50ed('0xcf')]=_[_0x50ed('0xd0')](_0x4e9c4a[_0x50ed('0xcc')],_0x4e9c4a['query']);_0x5e7b1b[_0x50ed('0x49')]=_[_0x50ed('0xd0')](_0x4e9c4a[_0x50ed('0xcc')],qs[_0x50ed('0xd1')](_0x366f5e[_0x50ed('0x43')][_0x50ed('0xd1')]));_0x5e7b1b[_0x50ed('0x49')]=_0x5e7b1b[_0x50ed('0x49')][_0x50ed('0x4e')]?_0x5e7b1b['attributes']:_0x4e9c4a[_0x50ed('0xcc')];_0x5e7b1b[_0x50ed('0xd2')]=qs[_0x50ed('0xd3')](_0x366f5e[_0x50ed('0x43')][_0x50ed('0xd3')]);_0x5e7b1b['where']=qs['filters'](_[_0x50ed('0xd4')](_0x366f5e[_0x50ed('0x43')],_0x4e9c4a[_0x50ed('0xcf')]));if(_0x366f5e[_0x50ed('0x43')][_0x50ed('0x2d')]){_0x5e7b1b['where']=_[_0x50ed('0x59')](_0x5e7b1b['where'],{'$or':_['map'](_0x5e7b1b['attributes'],function(_0x2def55){var _0x1ed62d={};_0x1ed62d[_0x2def55]={'$like':'%'+_0x366f5e[_0x50ed('0x43')][_0x50ed('0x2d')]+'%'};return _0x1ed62d;})});}_0x5e7b1b=_['merge']({},_0x5e7b1b,_0x366f5e[_0x50ed('0x5a')]);return _0x29f6a1[_0x50ed('0xe3')](_0x5e7b1b);}})[_0x50ed('0x26')](function(_0x19548b){if(_0x19548b){_0x3b7fa3=_0x19548b[_0x50ed('0x4e')];if(!_0x366f5e[_0x50ed('0x43')]['hasOwnProperty'](_0x50ed('0xdb'))){_0x5e7b1b[_0x50ed('0xd6')]=qs['limit'](_0x366f5e[_0x50ed('0x43')][_0x50ed('0xd6')]);_0x5e7b1b[_0x50ed('0x1c')]=qs[_0x50ed('0x1c')](_0x366f5e[_0x50ed('0x43')][_0x50ed('0x1c')]);}return _0x29f6a1['getOpenchannelInteractions'](_0x5e7b1b);}})[_0x50ed('0x26')](function(_0x25636a){if(_0x25636a){return _0x25636a?{'count':_0x3b7fa3,'rows':_0x25636a}:null;}})[_0x50ed('0x26')](respondWithResult(_0x10b94f,null))[_0x50ed('0x57')](handleError(_0x10b94f,null));};exports[_0x50ed('0xe5')]=function(_0x104a78,_0x40882f){var _0x28460e={'raw':!![],'where':{}};var _0x41717d={};var _0xe11af1={'count':0x0,'rows':[]};return db[_0x50ed('0x42')][_0x50ed('0x92')]({'where':{'id':_0x104a78[_0x50ed('0x58')]['id']}})['then'](handleEntityNotFound(_0x40882f,null))['then'](function(_0x268d31){if(_0x268d31){_0x41717d[_0x50ed('0xcc')]=_[_0x50ed('0xcd')](db[_0x50ed('0xe6')][_0x50ed('0xd8')]);_0x41717d['query']=_[_0x50ed('0xcd')](_0x104a78['query']);_0x41717d[_0x50ed('0xcf')]=_[_0x50ed('0xd0')](_0x41717d['model'],_0x41717d[_0x50ed('0x43')]);_0x28460e[_0x50ed('0x49')]=_[_0x50ed('0xd0')](_0x41717d['model'],qs['fields'](_0x104a78[_0x50ed('0x43')][_0x50ed('0xd1')]));_0x28460e[_0x50ed('0x49')]=_0x28460e[_0x50ed('0x49')]['length']?_0x28460e[_0x50ed('0x49')]:_0x41717d[_0x50ed('0xcc')];if(!_0x104a78['query']['hasOwnProperty'](_0x50ed('0xdb'))){_0x28460e[_0x50ed('0xd6')]=qs[_0x50ed('0xd6')](_0x104a78[_0x50ed('0x43')][_0x50ed('0xd6')]);_0x28460e[_0x50ed('0x1c')]=qs[_0x50ed('0x1c')](_0x104a78[_0x50ed('0x43')][_0x50ed('0x1c')]);}_0x28460e[_0x50ed('0xd2')]=qs[_0x50ed('0xd3')](_0x104a78[_0x50ed('0x43')]['sort']);_0x28460e[_0x50ed('0x41')]=qs[_0x50ed('0xcf')](_[_0x50ed('0xd4')](_0x104a78['query'],_0x41717d[_0x50ed('0xcf')]));_0x28460e['where'][_0x50ed('0xe0')]=_0x268d31['id'];if(_0x104a78[_0x50ed('0x43')][_0x50ed('0x2d')]){_0x28460e[_0x50ed('0x41')]=_['merge'](_0x28460e[_0x50ed('0x41')],{'$or':_[_0x50ed('0x36')](_0x28460e[_0x50ed('0x49')],function(_0x2986b6){var _0x552838={};_0x552838[_0x2986b6]={'$like':'%'+_0x104a78[_0x50ed('0x43')]['filter']+'%'};return _0x552838;})});}_0x28460e=_[_0x50ed('0x59')]({},_0x28460e,_0x104a78[_0x50ed('0x5a')]);return db[_0x50ed('0xe6')][_0x50ed('0x1d')]({'where':_0x28460e[_0x50ed('0x41')]})[_0x50ed('0x26')](function(_0x50c21b){_0xe11af1[_0x50ed('0x1d')]=_0x50c21b;if(_0x104a78[_0x50ed('0x43')]['includeAll']){_0x28460e[_0x50ed('0x45')]=[{'all':!![]}];}return db[_0x50ed('0xe6')][_0x50ed('0x4b')](_0x28460e);})[_0x50ed('0x26')](function(_0x5b789f){_0xe11af1[_0x50ed('0x4c')]=_0x5b789f;return _0xe11af1;});}})[_0x50ed('0x26')](respondWithFilteredResult(_0x40882f,_0x28460e))['catch'](handleError(_0x40882f,null));};exports['getSmsInteractions']=function(_0x6e7289,_0x318454){var _0x40eea3={};var _0x9f6e4b={};var _0x34f7c1;var _0x340afb;return db[_0x50ed('0x42')][_0x50ed('0x92')]({'where':{'id':_0x6e7289[_0x50ed('0x58')]['id']}})['then'](handleEntityNotFound(_0x318454,null))[_0x50ed('0x26')](function(_0xa9da80){if(_0xa9da80){_0x34f7c1=_0xa9da80;_0x9f6e4b[_0x50ed('0xcc')]=_[_0x50ed('0xcd')](db[_0x50ed('0xe7')]['rawAttributes']);_0x9f6e4b[_0x50ed('0x43')]=_[_0x50ed('0xcd')](_0x6e7289[_0x50ed('0x43')]);_0x9f6e4b['filters']=_[_0x50ed('0xd0')](_0x9f6e4b[_0x50ed('0xcc')],_0x9f6e4b[_0x50ed('0x43')]);_0x40eea3[_0x50ed('0x49')]=_['intersection'](_0x9f6e4b[_0x50ed('0xcc')],qs[_0x50ed('0xd1')](_0x6e7289[_0x50ed('0x43')][_0x50ed('0xd1')]));_0x40eea3['attributes']=_0x40eea3[_0x50ed('0x49')]['length']?_0x40eea3['attributes']:_0x9f6e4b[_0x50ed('0xcc')];_0x40eea3[_0x50ed('0xd2')]=qs[_0x50ed('0xd3')](_0x6e7289[_0x50ed('0x43')][_0x50ed('0xd3')]);_0x40eea3[_0x50ed('0x41')]=qs[_0x50ed('0xcf')](_[_0x50ed('0xd4')](_0x6e7289['query'],_0x9f6e4b[_0x50ed('0xcf')]));if(_0x6e7289[_0x50ed('0x43')]['filter']){_0x40eea3[_0x50ed('0x41')]=_[_0x50ed('0x59')](_0x40eea3[_0x50ed('0x41')],{'$or':_[_0x50ed('0x36')](_0x40eea3['attributes'],function(_0x5e9d67){var _0x362529={};_0x362529[_0x5e9d67]={'$like':'%'+_0x6e7289[_0x50ed('0x43')][_0x50ed('0x2d')]+'%'};return _0x362529;})});}_0x40eea3=_['merge']({},_0x40eea3,_0x6e7289[_0x50ed('0x5a')]);return _0x34f7c1['getSmsInteractions'](_0x40eea3);}})[_0x50ed('0x26')](function(_0x5bd27f){if(_0x5bd27f){_0x340afb=_0x5bd27f[_0x50ed('0x4e')];if(!_0x6e7289[_0x50ed('0x43')][_0x50ed('0xc8')]('nolimit')){_0x40eea3['limit']=qs['limit'](_0x6e7289[_0x50ed('0x43')]['limit']);_0x40eea3[_0x50ed('0x1c')]=qs[_0x50ed('0x1c')](_0x6e7289[_0x50ed('0x43')][_0x50ed('0x1c')]);}return _0x34f7c1[_0x50ed('0xe8')](_0x40eea3);}})[_0x50ed('0x26')](function(_0x495890){if(_0x495890){return _0x495890?{'count':_0x340afb,'rows':_0x495890}:null;}})[_0x50ed('0x26')](respondWithResult(_0x318454,null))[_0x50ed('0x57')](handleError(_0x318454,null));};exports[_0x50ed('0xe9')]=function(_0x27648b,_0x1bc46e){var _0xb8ef8e={};var _0x77349d={};var _0x4f6af5;var _0x5f0b53;return db[_0x50ed('0x42')][_0x50ed('0x92')]({'where':{'id':_0x27648b[_0x50ed('0x58')]['id']}})[_0x50ed('0x26')](handleEntityNotFound(_0x1bc46e,null))[_0x50ed('0x26')](function(_0x10dbf2){if(_0x10dbf2){_0x4f6af5=_0x10dbf2;_0x77349d[_0x50ed('0xcc')]=_[_0x50ed('0xcd')](db[_0x50ed('0xea')][_0x50ed('0xd8')]);_0x77349d[_0x50ed('0x43')]=_['keys'](_0x27648b[_0x50ed('0x43')]);_0x77349d['filters']=_['intersection'](_0x77349d[_0x50ed('0xcc')],_0x77349d[_0x50ed('0x43')]);_0xb8ef8e[_0x50ed('0x49')]=_['intersection'](_0x77349d[_0x50ed('0xcc')],qs['fields'](_0x27648b[_0x50ed('0x43')][_0x50ed('0xd1')]));_0xb8ef8e[_0x50ed('0x49')]=_0xb8ef8e[_0x50ed('0x49')][_0x50ed('0x4e')]?_0xb8ef8e[_0x50ed('0x49')]:_0x77349d[_0x50ed('0xcc')];_0xb8ef8e[_0x50ed('0xd2')]=qs[_0x50ed('0xd3')](_0x27648b[_0x50ed('0x43')][_0x50ed('0xd3')]);_0xb8ef8e['where']=qs['filters'](_[_0x50ed('0xd4')](_0x27648b[_0x50ed('0x43')],_0x77349d[_0x50ed('0xcf')]));if(_0x27648b[_0x50ed('0x43')][_0x50ed('0x2d')]){_0xb8ef8e[_0x50ed('0x41')]=_[_0x50ed('0x59')](_0xb8ef8e[_0x50ed('0x41')],{'$or':_[_0x50ed('0x36')](_0xb8ef8e[_0x50ed('0x49')],function(_0x4ddf3e){var _0x506c94={};_0x506c94[_0x4ddf3e]={'$like':'%'+_0x27648b[_0x50ed('0x43')][_0x50ed('0x2d')]+'%'};return _0x506c94;})});}_0xb8ef8e=_[_0x50ed('0x59')]({},_0xb8ef8e,_0x27648b[_0x50ed('0x5a')]);return _0x4f6af5[_0x50ed('0xe9')](_0xb8ef8e);}})[_0x50ed('0x26')](function(_0x274e39){if(_0x274e39){_0x5f0b53=_0x274e39[_0x50ed('0x4e')];if(!_0x27648b[_0x50ed('0x43')]['hasOwnProperty'](_0x50ed('0xdb'))){_0xb8ef8e[_0x50ed('0xd6')]=qs[_0x50ed('0xd6')](_0x27648b[_0x50ed('0x43')][_0x50ed('0xd6')]);_0xb8ef8e[_0x50ed('0x1c')]=qs[_0x50ed('0x1c')](_0x27648b['query'][_0x50ed('0x1c')]);}return _0x4f6af5['getFaxInteractions'](_0xb8ef8e);}})[_0x50ed('0x26')](function(_0x4e6b27){if(_0x4e6b27){return _0x4e6b27?{'count':_0x5f0b53,'rows':_0x4e6b27}:null;}})[_0x50ed('0x26')](respondWithResult(_0x1bc46e,null))[_0x50ed('0x57')](handleError(_0x1bc46e,null));};exports[_0x50ed('0xeb')]=function(_0x43d27c,_0xded272){var _0x1594e6={};var _0x40cedd={};var _0x125e20;var _0x6865af;return db[_0x50ed('0x42')]['findOne']({'where':{'id':_0x43d27c[_0x50ed('0x58')]['id']}})[_0x50ed('0x26')](handleEntityNotFound(_0xded272,null))[_0x50ed('0x26')](function(_0x415800){if(_0x415800){_0x125e20=_0x415800;_0x40cedd[_0x50ed('0xcc')]=_[_0x50ed('0xcd')](db[_0x50ed('0xec')][_0x50ed('0xd8')]);_0x40cedd[_0x50ed('0x43')]=_[_0x50ed('0xcd')](_0x43d27c[_0x50ed('0x43')]);_0x40cedd[_0x50ed('0xcf')]=_[_0x50ed('0xd0')](_0x40cedd[_0x50ed('0xcc')],_0x40cedd[_0x50ed('0x43')]);_0x1594e6[_0x50ed('0x49')]=_[_0x50ed('0xd0')](_0x40cedd[_0x50ed('0xcc')],qs[_0x50ed('0xd1')](_0x43d27c[_0x50ed('0x43')]['fields']));_0x1594e6[_0x50ed('0x49')]=_0x1594e6[_0x50ed('0x49')][_0x50ed('0x4e')]?_0x1594e6['attributes']:_0x40cedd[_0x50ed('0xcc')];_0x1594e6[_0x50ed('0xd2')]=qs[_0x50ed('0xd3')](_0x43d27c[_0x50ed('0x43')][_0x50ed('0xd3')]);_0x1594e6[_0x50ed('0x41')]=qs[_0x50ed('0xcf')](_[_0x50ed('0xd4')](_0x43d27c['query'],_0x40cedd[_0x50ed('0xcf')]));if(_0x43d27c['query'][_0x50ed('0x2d')]){_0x1594e6['where']=_['merge'](_0x1594e6[_0x50ed('0x41')],{'$or':_[_0x50ed('0x36')](_0x1594e6[_0x50ed('0x49')],function(_0x4fcea6){var _0x17f05d={};_0x17f05d[_0x4fcea6]={'$like':'%'+_0x43d27c['query'][_0x50ed('0x2d')]+'%'};return _0x17f05d;})});}_0x1594e6=_['merge']({},_0x1594e6,_0x43d27c[_0x50ed('0x5a')]);return _0x125e20['getWhatsappInteractions'](_0x1594e6);}})[_0x50ed('0x26')](function(_0x52867b){if(_0x52867b){_0x6865af=_0x52867b[_0x50ed('0x4e')];if(!_0x43d27c[_0x50ed('0x43')][_0x50ed('0xc8')](_0x50ed('0xdb'))){_0x1594e6[_0x50ed('0xd6')]=qs[_0x50ed('0xd6')](_0x43d27c[_0x50ed('0x43')][_0x50ed('0xd6')]);_0x1594e6['offset']=qs[_0x50ed('0x1c')](_0x43d27c[_0x50ed('0x43')][_0x50ed('0x1c')]);}return _0x125e20[_0x50ed('0xeb')](_0x1594e6);}})['then'](function(_0x239580){if(_0x239580){return _0x239580?{'count':_0x6865af,'rows':_0x239580}:null;}})[_0x50ed('0x26')](respondWithResult(_0xded272,null))['catch'](handleError(_0xded272,null));};exports[_0x50ed('0xed')]=function(_0x3bd538,_0x5eaf3a,_0xbee48d){var _0x5c7f63;var _0xd36f79;var _0x596a77;var _0x2ddc8e=!_[_0x50ed('0x64')](_0x3bd538[_0x50ed('0x58')]['id'])?_0x3bd538[_0x50ed('0x58')]['id']:!_[_0x50ed('0x64')](_0x3bd538[_0x50ed('0x2a')]['id'])?_0x3bd538[_0x50ed('0x2a')]['id']:null;return db[_0x50ed('0x42')][_0x50ed('0x30')]({'where':{'id':_0x2ddc8e,'role':{'$or':[_0x50ed('0x28'),_0x50ed('0x2a'),'agent']}},'attributes':['id',_0x50ed('0x31'),_0x50ed('0xee'),_0x50ed('0xef'),'role',_0x50ed('0x62'),'loginInPause']})['then'](function(_0x2478d1){if(_0x2478d1){if(_0x2478d1[_0x50ed('0x21')]===_0x50ed('0x22')){_0x5c7f63=_0x2478d1;if(_0x3bd538[_0x50ed('0x5b')][_0x50ed('0x9a')]){_0x596a77=util[_0x50ed('0xa5')]('LOCAL/%s@from-sip/n',_0x5c7f63[_0x3bd538[_0x50ed('0x5b')][_0x50ed('0x9a')]]);}else if(_0x3bd538[_0x50ed('0x5b')][_0x50ed('0xf0')]){_0x596a77=util[_0x50ed('0xa5')](_0x50ed('0xa6'),_0x3bd538['body']['intrf']);}else{_0x596a77=util[_0x50ed('0xa5')]('SIP/%s',_0x5c7f63[_0x50ed('0x31')]);}socket['to'](util[_0x50ed('0xa5')](_0x50ed('0xf1'),_0x5c7f63[_0x50ed('0x31')]))[_0x50ed('0x23')]('user:forcelogout',{'user':{'id':_0x5c7f63['id'],'name':_0x5c7f63['name']},'ip':_0x3bd538[_0x50ed('0xf2')][_0x50ed('0xf3')]||_0x3bd538[_0x50ed('0xf4')][_0x50ed('0xf5')]||_0x3bd538[_0x50ed('0xf6')][_0x50ed('0xf5')]||_0x3bd538[_0x50ed('0xf4')][_0x50ed('0xf6')]['remoteAddress']});return db[_0x50ed('0xb0')]['destroy']({'where':{'membername':_0x5c7f63[_0x50ed('0x31')]},'individualHooks':!![]});}}else{throw new db['Sequelize'][(_0x50ed('0x8b'))](_0x50ed('0xf7'));}})['then'](function(){if(_0x5c7f63){return _0x5c7f63[_0x50ed('0xf8')]({'raw':!![]});}})['then'](function(_0x30e2ad){if(_0x5c7f63){if(_0x30e2ad){_0xd36f79=_0x30e2ad;if(_0xd36f79['length']){var _0x55c6ec=_0xd36f79[_0x50ed('0x36')](function(_0x2b916d){var _0x52536d={'membername':_0x5c7f63[_0x50ed('0x31')],'UserId':_0x5c7f63['id'],'queue_name':_0x2b916d[_0x50ed('0x31')],'VoiceQueueId':_0x2b916d['id'],'interface':_0x596a77,'paused':_0x5c7f63[_0x50ed('0x99')]||![],'penalty':_0x2b916d[_0x50ed('0xf9')]||0x0};return db['UserVoiceQueueRt']['upsert'](_0x52536d);});return Promise[_0x50ed('0x56')](_0x55c6ec);}}}})[_0x50ed('0x26')](function(){if(_0x5c7f63){return db[_0x50ed('0xfa')][_0x50ed('0x4b')]({'where':{'membername':_0x5c7f63['name'],'exitAt':null}});}})[_0x50ed('0x26')](function(_0x448801){if(_0x5c7f63){var _0x6ab641=[];_0x448801['forEach'](function(_0x2f66ef){_0x6ab641[_0x50ed('0x4a')](_0x2f66ef[_0x50ed('0x20')]({'exitAt':moment()['format'](_0x50ed('0xfb'))}));});return Promise[_0x50ed('0x56')](_0x6ab641);}})['then'](function(){if(_0x5c7f63){var _0x1c43b2=[];var _0x3e7eed=[];var _0x155f85=utils[_0x50ed('0xfc')]();var _0x4eed84={'membername':_0x5c7f63[_0x50ed('0x31')],'interface':_0x596a77,'enterAt':moment()['format'](_0x50ed('0xfb')),'role':_0x5c7f63[_0x50ed('0x21')],'internal':_0x5c7f63[_0x50ed('0x62')]};_0x155f85[_0x50ed('0xfd')](function(_0x343762){_0x1c43b2['push'](_[_0x50ed('0x59')]({'channel':_0x343762,'type':_0x50ed('0xfe'),'data1':_0x3bd538[_0x50ed('0x5b')]['device'],'data2':_0x596a77},_0x4eed84));if(_0x5c7f63['loginInPause']){_0x3e7eed['push'](_[_0x50ed('0x59')]({'channel':_0x343762,'type':_0x50ed('0xff'),'data1':_0x50ed('0x100')},_0x4eed84));}});return db['MemberReport']['bulkCreate'](_0x1c43b2[_0x50ed('0xc5')](_0x3e7eed),{'individualHooks':!![]});}})[_0x50ed('0x26')](function(){if(_0x5c7f63){return _0x5c7f63[_0x50ed('0x20')]({'online':!![],'lastLoginAt':moment()['format'](_0x50ed('0xfb')),'voicePause':_0x5c7f63[_0x50ed('0x99')]||![],'mailPause':_0x5c7f63[_0x50ed('0x99')]||![],'chatPause':_0x5c7f63['loginInPause']||![],'faxPause':_0x5c7f63['loginInPause']||![],'smsPause':_0x5c7f63[_0x50ed('0x99')]||![],'openchannelPause':_0x5c7f63[_0x50ed('0x99')]||![],'whatsappPause':_0x5c7f63[_0x50ed('0x99')]||![],'pauseType':_0x5c7f63[_0x50ed('0x99')]?_0x50ed('0x100'):null,'interface':_0x596a77,'lastPauseAt':moment()['format'](_0x50ed('0xfb'))});}})['then'](function(_0x4a4de9){if(_0x3bd538[_0x50ed('0x101')]){return _0xbee48d();}else{return Promise['resolve'](_0x4a4de9)['then'](respondWithResult(_0x5eaf3a,null));}})[_0x50ed('0x57')](handleError(_0x5eaf3a,null));};exports[_0x50ed('0x102')]=function(_0x5de733,_0x26a057){var _0x4e8e9e;return db['User'][_0x50ed('0x30')]({'where':{'id':_0x5de733[_0x50ed('0x58')]['id'],'role':_0x50ed('0x22')},'attributes':['id',_0x50ed('0x31'),'role']})[_0x50ed('0x26')](handleEntityNotFound(_0x26a057,null))['then'](function(_0x1355c3){if(_0x1355c3){_0x4e8e9e=_0x1355c3;return db[_0x50ed('0xb0')][_0x50ed('0x25')]({'where':{'membername':_0x4e8e9e[_0x50ed('0x31')]},'individualHooks':!![]});}})['then'](function(){return db[_0x50ed('0xfa')][_0x50ed('0x4b')]({'where':{'membername':_0x4e8e9e[_0x50ed('0x31')],'exitAt':null}});})['then'](function(_0x22d0c6){var _0x53f81e=[];_0x22d0c6[_0x50ed('0xfd')](function(_0x1e6951){_0x53f81e[_0x50ed('0x4a')](_0x1e6951[_0x50ed('0x20')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise['all'](_0x53f81e);})['then'](function(){return _0x4e8e9e[_0x50ed('0x20')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x50ed('0x26')](respondWithResult(_0x26a057,null))[_0x50ed('0x57')](handleError(_0x26a057,null));};exports[_0x50ed('0x103')]=function(_0x320661,_0x4e5034){var _0x335f1d;return db[_0x50ed('0xb0')][_0x50ed('0x20')]({'paused':0x1},{'where':{'UserId':_0x320661[_0x50ed('0x58')]['id']},'individualHooks':!![]})[_0x50ed('0x26')](function(){return db[_0x50ed('0x42')][_0x50ed('0x30')]({'where':{'id':_0x320661[_0x50ed('0x58')]['id'],'role':_0x50ed('0x22')},'attributes':['id',_0x50ed('0x31'),_0x50ed('0x21'),_0x50ed('0x62'),'interface',_0x50ed('0x98')]});})['then'](handleEntityNotFound(_0x4e5034,null))[_0x50ed('0x26')](function(_0x30f28a){if(_0x30f28a){_0x335f1d=_0x30f28a;return db['MemberReport'][_0x50ed('0x4b')]({'where':{'membername':_0x335f1d[_0x50ed('0x31')],'type':_0x50ed('0xff'),'exitAt':null}});}})[_0x50ed('0x26')](function(_0x1555fe){if(_0x1555fe[_0x50ed('0x4e')]){var _0x2b0a86=moment()[_0x50ed('0xa5')](_0x50ed('0xfb'));for(var _0x38a170=0x0,_0x171ef9=_0x1555fe['length'];_0x38a170<_0x171ef9;_0x38a170++){_0x1555fe[_0x38a170]['updateAttributes']({'exitAt':_0x2b0a86});}}})[_0x50ed('0x26')](function(){var _0x1ccb55=[];var _0x218511=utils[_0x50ed('0xfc')]();_0x218511[_0x50ed('0xfd')](function(_0x343c4f){_0x1ccb55['push']({'channel':_0x343c4f,'membername':_0x335f1d[_0x50ed('0x31')],'interface':_['isNil'](_0x335f1d[_0x50ed('0x9a')])?util[_0x50ed('0xa5')](_0x50ed('0xa6'),_0x335f1d[_0x50ed('0x31')]):_0x335f1d[_0x50ed('0x9a')],'type':'PAUSE','enterAt':moment()[_0x50ed('0xa5')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x320661[_0x50ed('0x5b')][_0x50ed('0x38')]||_0x50ed('0x104'),'role':_0x335f1d[_0x50ed('0x21')],'internal':_0x335f1d[_0x50ed('0x62')]});});return db[_0x50ed('0xfa')]['bulkCreate'](_0x1ccb55,{'individualHooks':!![]});})[_0x50ed('0x26')](function(){return _0x335f1d[_0x50ed('0x20')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x320661[_0x50ed('0x5b')][_0x50ed('0x38')]||_0x50ed('0x104'),'lastPauseAt':moment()[_0x50ed('0xa5')](_0x50ed('0xfb'))});})['then'](respondWithResult(_0x4e5034,null))[_0x50ed('0x57')](handleError(_0x4e5034,null));};exports['unpause']=function(_0x3a6ba5,_0x58fd64){if(_0x3a6ba5['body'][_0x50ed('0xab')]&&!utils['isValidChannel'](_0x3a6ba5[_0x50ed('0x5b')]['channel'])){throw new APIBadRequestError(util[_0x50ed('0xa5')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0x3a6ba5[_0x50ed('0x5b')][_0x50ed('0xab')]));}return db[_0x50ed('0x42')]['find']({'where':{'id':_0x3a6ba5['params']['id']},'attributes':['id',_0x50ed('0x31'),_0x50ed('0x21'),_0x50ed('0x62'),'interface',_0x50ed('0x98'),_0x50ed('0xa7'),_0x50ed('0x105'),_0x50ed('0x106'),'faxPause',_0x50ed('0x107'),_0x50ed('0x108'),_0x50ed('0x109'),_0x50ed('0x10a'),_0x50ed('0x10b')]})[_0x50ed('0x26')](function(_0x38002c){if(!_0x38002c){throw new APINotFoundError(util['format']('User\x20with\x20id\x20%s\x20not\x20found',_0x3a6ba5[_0x50ed('0x58')]['id']));}return _0x38002c[_0x50ed('0x10c')](_0x3a6ba5['body']['channel']);})[_0x50ed('0x26')](respondWithResult(_0x58fd64,null))['catch'](APIHandleError(_0x58fd64));};exports[_0x50ed('0x10d')]=function(_0x154c01,_0x18c5c3){var _0x4dc139={};var _0x3f34b9={};var _0x407709;var _0xf82c58;return db[_0x50ed('0x42')][_0x50ed('0x92')]({'where':{'id':_0x154c01['params']['id']}})[_0x50ed('0x26')](handleEntityNotFound(_0x18c5c3,null))[_0x50ed('0x26')](function(_0xda2d2c){if(_0xda2d2c){_0x407709=_0xda2d2c;_0x3f34b9['model']=_[_0x50ed('0xcd')](db[_0x50ed('0x10e')][_0x50ed('0xd8')]);_0x3f34b9[_0x50ed('0x43')]=_['keys'](_0x154c01[_0x50ed('0x43')]);_0x3f34b9[_0x50ed('0xcf')]=_[_0x50ed('0xd0')](_0x3f34b9[_0x50ed('0xcc')],_0x3f34b9['query']);_0x4dc139[_0x50ed('0x49')]=_[_0x50ed('0xd0')](_0x3f34b9[_0x50ed('0xcc')],qs[_0x50ed('0xd1')](_0x154c01[_0x50ed('0x43')][_0x50ed('0xd1')]));_0x4dc139[_0x50ed('0x49')]=_0x4dc139[_0x50ed('0x49')][_0x50ed('0x4e')]?_0x4dc139[_0x50ed('0x49')]:_0x3f34b9[_0x50ed('0xcc')];_0x4dc139[_0x50ed('0xd2')]=qs['sort'](_0x154c01['query'][_0x50ed('0xd3')]);_0x4dc139[_0x50ed('0x41')]=qs[_0x50ed('0xcf')](_[_0x50ed('0xd4')](_0x154c01[_0x50ed('0x43')],_0x3f34b9[_0x50ed('0xcf')]));if(_0x154c01[_0x50ed('0x43')][_0x50ed('0x2d')]){_0x4dc139['where']=_['merge'](_0x4dc139[_0x50ed('0x41')],{'$or':_[_0x50ed('0x36')](_0x4dc139[_0x50ed('0x49')],function(_0x2de404){var _0x463af3={};_0x463af3[_0x2de404]={'$like':'%'+_0x154c01[_0x50ed('0x43')][_0x50ed('0x2d')]+'%'};return _0x463af3;})});}_0x4dc139=_[_0x50ed('0x59')]({},_0x4dc139,_0x154c01['options']);return _0x407709[_0x50ed('0x10d')](_0x4dc139);}})[_0x50ed('0x26')](function(_0x297575){if(_0x297575){_0xf82c58=_0x297575[_0x50ed('0x4e')];if(!_0x154c01['query'][_0x50ed('0xc8')](_0x50ed('0xdb'))){_0x4dc139[_0x50ed('0xd6')]=qs[_0x50ed('0xd6')](_0x154c01[_0x50ed('0x43')][_0x50ed('0xd6')]);_0x4dc139[_0x50ed('0x1c')]=qs['offset'](_0x154c01[_0x50ed('0x43')]['offset']);}return _0x407709[_0x50ed('0x10d')](_0x4dc139);}})[_0x50ed('0x26')](function(_0x2d7d50){if(_0x2d7d50){return _0x2d7d50?{'count':_0xf82c58,'rows':_0x2d7d50}:null;}})[_0x50ed('0x26')](respondWithResult(_0x18c5c3,null))[_0x50ed('0x57')](handleError(_0x18c5c3,null));};exports[_0x50ed('0x10f')]=function(_0x40abe3,_0x1925eb){var _0x39641d=_0x40abe3['params']['id'];var _0x5b7c2c=_0x40abe3['body']?_0x40abe3[_0x50ed('0x5b')][_0x50ed('0x5e')]:null;var _0x1e3b0e=[];return Promise[_0x50ed('0x110')]()['then'](function(){if(!_0x5b7c2c)throw new APIBadRequestError(_0x50ed('0x111'));})[_0x50ed('0x26')](function(){return db[_0x50ed('0x42')][_0x50ed('0x92')]({'where':{'id':_0x39641d}});})['then'](function(_0x142586){if(!_0x142586)throw new APINotFoundError(util['format']('User\x20with\x20id\x20%s\x20not\x20found',_0x40abe3[_0x50ed('0x58')]['id']));return db[_0x50ed('0x65')]['transaction'](function(_0x204342){return _0x142586[_0x50ed('0x10f')](_0x5b7c2c,{'transaction':_0x204342})['then'](function(){return db[_0x50ed('0x10e')][_0x50ed('0x4b')]({'where':{'id':{'$in':_0x5b7c2c}}});})[_0x50ed('0x26')](function(_0x3bc586){var _0x1d52fd=_[_0x50ed('0x36')](_0x3bc586,function(_0x1a4894){return _0x1a4894[_0x50ed('0x112')]();});return Promise[_0x50ed('0x56')](_0x1d52fd);})[_0x50ed('0x26')](function(_0x126d39){_0x1e3b0e=_[_0x50ed('0x113')](_0x126d39);var _0x49dbf3=_[_0x50ed('0x36')](_0x1e3b0e,function(_0x3d7583){return _0x3d7583['addAgent'](_0x142586['id'],{'transaction':_0x204342});});return Promise[_0x50ed('0x56')](_0x49dbf3);})[_0x50ed('0x26')](function(){if(!_0x142586[_0x50ed('0x98')])return;var _0x382528=_[_0x50ed('0x2d')](_0x1e3b0e,function(_0x50238e){return _0x50238e['getDataValue']('channel')==='Voice';});var _0x757f47=_[_0x50ed('0x36')](_0x382528,function(_0x5830de){return db[_0x50ed('0xb0')][_0x50ed('0xa9')]({'membername':_0x142586[_0x50ed('0x31')],'UserId':_0x142586['id'],'queue_name':_0x5830de['name'],'VoiceQueueId':_0x5830de['id'],'interface':_[_0x50ed('0x64')](_0x142586['interface'])?util[_0x50ed('0xa5')]('SIP/%s',_0x142586[_0x50ed('0x31')]):_0x142586['interface'],'paused':_0x142586[_0x50ed('0xa7')]||![],'penalty':_0x142586[_0x50ed('0xa8')]},{'transaction':_0x204342});});return Promise[_0x50ed('0x56')](_0x757f47);})[_0x50ed('0x26')](function(){return db[_0x50ed('0x114')][_0x50ed('0x4b')]({'where':{'teamId':{'$in':_0x5b7c2c}}});})['then'](function(_0x79fdc0){var _0xb2f7a7=_[_0x50ed('0x36')](_0x79fdc0,function(_0x2610e3){return db['UserVoicePrefix'][_0x50ed('0x77')]({'UserId':_0x142586['id'],'VoicePrefixId':_0x2610e3[_0x50ed('0x115')]},{'transaction':_0x204342});});return Promise['all'](_0xb2f7a7);});});})['then'](function(){for(var _0x20b6d7=0x0;_0x20b6d7<_0x1e3b0e[_0x50ed('0x4e')];_0x20b6d7++){var _0x570ee7=_0x1e3b0e[_0x20b6d7][_0x50ed('0x116')](_0x50ed('0xab'));var _0x1de97f=_0x570ee7+_0x50ed('0xae');socket['emit'](_0x50ed('0x2a')+_0x570ee7+'Queue:save',{'UserId':_0x39641d,['queueField']:_0x1e3b0e[_0x20b6d7]['id']});}})[_0x50ed('0x26')](respondWithStatusCode(_0x1925eb,null))[_0x50ed('0x57')](APIHandleError(_0x1925eb));};exports[_0x50ed('0x117')]=function(_0x2f4f6f,_0x55a7de){var _0x49fbc5=_0x2f4f6f['params']['id'];var _0x4eddd3=null;if(_0x2f4f6f['query']['ids']){_0x4eddd3=_[_0x50ed('0xad')](_0x2f4f6f[_0x50ed('0x43')]['ids'])?_0x2f4f6f['query'][_0x50ed('0x5e')]:[_0x2f4f6f[_0x50ed('0x43')][_0x50ed('0x5e')]];}var _0x3f39d4=[];return Promise['resolve']()[_0x50ed('0x26')](function(){if(!_0x4eddd3)throw new APIBadRequestError(_0x50ed('0x118'));})[_0x50ed('0x26')](function(){return db['User'][_0x50ed('0x92')]({'where':{'id':_0x49fbc5}});})[_0x50ed('0x26')](function(_0x5d6295){if(!_0x5d6295)throw new APINotFoundError(util[_0x50ed('0xa5')](_0x50ed('0xc7'),_0x2f4f6f[_0x50ed('0x58')]['id']));return db['sequelize'][_0x50ed('0x119')](function(_0x38e8d6){return _0x5d6295[_0x50ed('0x117')](_0x4eddd3,{'transaction':_0x38e8d6})[_0x50ed('0x26')](function(){return db[_0x50ed('0x10e')]['findAll']({'where':{'id':{'$in':_0x4eddd3}}});})[_0x50ed('0x26')](function(_0x2514b7){var _0x54b18f=_[_0x50ed('0x36')](_0x2514b7,function(_0x2d6971){return _0x2d6971['getAssociatedQueues']();});return Promise['all'](_0x54b18f);})[_0x50ed('0x26')](function(_0x377bbb){_0x3f39d4=_[_0x50ed('0x113')](_0x377bbb);var _0x562d5a=_[_0x50ed('0x36')](_0x3f39d4,function(_0xc481b6){return _0xc481b6[_0x50ed('0x11a')](_0x5d6295['id'],{'transaction':_0x38e8d6});});return Promise[_0x50ed('0x56')](_0x562d5a);})[_0x50ed('0x26')](function(){if(!_0x5d6295[_0x50ed('0x98')])return;var _0x338fe7=_[_0x50ed('0x2d')](_0x3f39d4,function(_0xdf55ab){return _0xdf55ab[_0x50ed('0x116')](_0x50ed('0xab'))===_0x50ed('0x11b');});var _0x50eef0=_[_0x50ed('0x36')](_0x338fe7,function(_0x3309e4){return db[_0x50ed('0xb0')][_0x50ed('0x25')]({'where':{'VoiceQueueId':_0x3309e4['id'],'UserId':_0x5d6295['id']},'transaction':_0x38e8d6});});return Promise[_0x50ed('0x56')](_0x50eef0);})[_0x50ed('0x26')](function(){return db[_0x50ed('0x114')][_0x50ed('0x4b')]({'where':{'teamId':{'$in':_0x4eddd3}}});})['then'](function(_0x2f7dba){var _0x559308=_[_0x50ed('0x36')](_0x2f7dba,function(_0x3b5f7b){return db[_0x50ed('0x11c')][_0x50ed('0x25')]({'where':{'UserId':_0x5d6295['id'],'VoicePrefixId':_0x3b5f7b[_0x50ed('0x115')]}},{'transaction':_0x38e8d6});});return Promise[_0x50ed('0x56')](_0x559308);});});})[_0x50ed('0x26')](function(){for(var _0xc00cdb=0x0;_0xc00cdb<_0x3f39d4[_0x50ed('0x4e')];_0xc00cdb++){var _0x141722=_0x3f39d4[_0xc00cdb]['getDataValue'](_0x50ed('0xab'));var _0x2759d9=_0x141722+_0x50ed('0xae');socket[_0x50ed('0x23')]('user'+_0x141722+'Queue:remove',{'UserId':_0x49fbc5,['queueField']:_0x3f39d4[_0xc00cdb]['id']});}})[_0x50ed('0x26')](respondWithStatusCode(_0x55a7de,null))[_0x50ed('0x57')](APIHandleError(_0x55a7de));};exports['getLists']=function(_0x1f01d3,_0x556c0f){var _0x27286d={};var _0x31e598={};var _0x31abeb;var _0x569e2d;return db[_0x50ed('0x42')]['findOne']({'where':{'id':_0x1f01d3[_0x50ed('0x58')]['id']}})[_0x50ed('0x26')](handleEntityNotFound(_0x556c0f,null))[_0x50ed('0x26')](function(_0x127fee){if(_0x127fee){_0x31abeb=_0x127fee;_0x31e598[_0x50ed('0xcc')]=_[_0x50ed('0xcd')](db[_0x50ed('0x11d')][_0x50ed('0xd8')]);_0x31e598[_0x50ed('0x43')]=_['keys'](_0x1f01d3['query']);_0x31e598['filters']=_[_0x50ed('0xd0')](_0x31e598[_0x50ed('0xcc')],_0x31e598[_0x50ed('0x43')]);_0x27286d[_0x50ed('0x49')]=_[_0x50ed('0xd0')](_0x31e598[_0x50ed('0xcc')],qs['fields'](_0x1f01d3[_0x50ed('0x43')][_0x50ed('0xd1')]));_0x27286d[_0x50ed('0x49')]=_0x27286d[_0x50ed('0x49')][_0x50ed('0x4e')]?_0x27286d[_0x50ed('0x49')]:_0x31e598['model'];_0x27286d['order']=qs[_0x50ed('0xd3')](_0x1f01d3[_0x50ed('0x43')][_0x50ed('0xd3')]);_0x27286d[_0x50ed('0x41')]=qs['filters'](_[_0x50ed('0xd4')](_0x1f01d3[_0x50ed('0x43')],_0x31e598[_0x50ed('0xcf')]));if(_0x1f01d3['query'][_0x50ed('0x2d')]){_0x27286d['where']=_[_0x50ed('0x59')](_0x27286d[_0x50ed('0x41')],{'$or':_[_0x50ed('0x36')](_0x27286d[_0x50ed('0x49')],function(_0x59410b){var _0xd5e2b7={};_0xd5e2b7[_0x59410b]={'$like':'%'+_0x1f01d3[_0x50ed('0x43')][_0x50ed('0x2d')]+'%'};return _0xd5e2b7;})});}_0x27286d=_[_0x50ed('0x59')]({},_0x27286d,_0x1f01d3['options']);return _0x31abeb[_0x50ed('0x11e')](_0x27286d);}})[_0x50ed('0x26')](function(_0x1232e6){if(_0x1232e6){_0x569e2d=_0x1232e6['length'];if(!_0x1f01d3[_0x50ed('0x43')][_0x50ed('0xc8')](_0x50ed('0xdb'))){_0x27286d['limit']=qs[_0x50ed('0xd6')](_0x1f01d3[_0x50ed('0x43')][_0x50ed('0xd6')]);_0x27286d[_0x50ed('0x1c')]=qs[_0x50ed('0x1c')](_0x1f01d3['query'][_0x50ed('0x1c')]);}return _0x31abeb[_0x50ed('0x11e')](_0x27286d);}})[_0x50ed('0x26')](function(_0x3c07f0){if(_0x3c07f0){return _0x3c07f0?{'count':_0x569e2d,'rows':_0x3c07f0}:null;}})[_0x50ed('0x26')](respondWithResult(_0x556c0f,null))[_0x50ed('0x57')](handleError(_0x556c0f,null));};exports['getAgents']=function(_0x2f14d3,_0x582055){var _0x3cadba={};var _0x1f98b2={};var _0x1e07dd;return db['User'][_0x50ed('0x92')]({'where':{'id':_0x2f14d3[_0x50ed('0x58')]['id']}})['then'](handleEntityNotFound(_0x582055,null))[_0x50ed('0x26')](function(_0x479042){if(_0x479042){_0x1e07dd=_0x479042;_0x1f98b2[_0x50ed('0xcc')]=_[_0x50ed('0xcd')](db[_0x50ed('0x42')][_0x50ed('0xd8')]);_0x1f98b2[_0x50ed('0x43')]=_[_0x50ed('0xcd')](_0x2f14d3[_0x50ed('0x43')]);_0x1f98b2[_0x50ed('0xcf')]=_[_0x50ed('0xd0')](_0x1f98b2[_0x50ed('0xcc')],_0x1f98b2[_0x50ed('0x43')]);_0x3cadba[_0x50ed('0x49')]=_[_0x50ed('0xd0')](_0x1f98b2[_0x50ed('0xcc')],qs[_0x50ed('0xd1')](_0x2f14d3[_0x50ed('0x43')][_0x50ed('0xd1')]));_0x3cadba['attributes']=_0x3cadba['attributes'][_0x50ed('0x4e')]?_0x3cadba[_0x50ed('0x49')]:_0x1f98b2[_0x50ed('0xcc')];_0x3cadba[_0x50ed('0xd2')]=qs[_0x50ed('0xd3')](_0x2f14d3[_0x50ed('0x43')][_0x50ed('0xd3')]);_0x3cadba[_0x50ed('0x41')]=qs[_0x50ed('0xcf')](_[_0x50ed('0xd4')](_0x2f14d3['query'],_0x1f98b2['filters']));if(_0x2f14d3[_0x50ed('0x43')][_0x50ed('0x2d')]){_0x3cadba[_0x50ed('0x41')]=_['merge'](_0x3cadba[_0x50ed('0x41')],{'$or':_[_0x50ed('0x36')](_0x3cadba[_0x50ed('0x49')],function(_0x3f5c82){var _0xe08755={};_0xe08755[_0x3f5c82]={'$like':'%'+_0x2f14d3['query'][_0x50ed('0x2d')]+'%'};return _0xe08755;})});}_0x3cadba['model']=db['User'];_0x3cadba['as']=_0x50ed('0x80');_0x3cadba=_[_0x50ed('0x59')]({},_0x3cadba,_0x2f14d3[_0x50ed('0x5a')]);return _0x1e07dd['getVoiceQueues']({'include':[_0x3cadba]});}})[_0x50ed('0x26')](function(_0x21a0a3){if(_0x21a0a3){var _0x2e0d28={},_0x1dd4dc=[];for(var _0x3e01ef=0x0;_0x3e01ef<_0x21a0a3[_0x50ed('0x4e')];_0x3e01ef+=0x1){for(var _0x3e9649=0x0,_0x5093a4;_0x3e9649<_0x21a0a3[_0x3e01ef][_0x50ed('0x80')][_0x50ed('0x4e')];_0x3e9649+=0x1){_0x5093a4=_0x21a0a3[_0x3e01ef][_0x50ed('0x80')][_0x3e9649][_0x50ed('0x27')]({'plain':!![]});_0x2e0d28[_0x5093a4['id']]=_0x5093a4;}}_0x2e0d28=_[_0x50ed('0x11f')](_0x2e0d28);for(var _0xe18485=qs[_0x50ed('0x1c')](_0x2f14d3[_0x50ed('0x43')][_0x50ed('0x1c')]);_0xe18485<_0x2e0d28[_0x50ed('0x4e')]&&_0x1dd4dc[_0x50ed('0x4e')]=_0x439c92){_0x21ae04=_0x439c92;_0x534845=0xc8;}else{_0x534845=0xce;}_0x25dea1['status'](_0x534845);return _0x25dea1['set'](_0x098c('0x19'),_0x48049d+'-'+_0x21ae04+'/'+_0x439c92)[_0x098c('0x14')](_0x3265ba);}return null;};}function saveUpdates(_0x586048){return function(_0x568db7){if(_0x568db7){return _0x568db7['update'](_0x586048)['then'](function(_0xeceebb){if(_0xeceebb['role']===_0x098c('0x1a')){socket['emit'](_0x098c('0x1b')+_0xeceebb['id'],_0xeceebb);}return _0xeceebb;});}return null;};}function removeEntity(_0x17c2f7){return function(_0x37176c){if(_0x37176c){return _0x37176c[_0x098c('0x1c')]()[_0x098c('0x1d')](function(){var _0x9eb63d=_0x37176c[_0x098c('0x1e')]({'plain':!![]});if(_0x9eb63d[_0x098c('0x1f')]===_0x098c('0x20'))return;var _0x322265=[{'name':_0x098c('0x21'),'value':_0x098c('0x22'),'ignore':!![]},{'name':_0x098c('0x23'),'value':'agent','ignore':![]},{'name':'Telephones','value':_0x098c('0x24'),'ignore':![]}];var _0x4b6b76=_(_0x322265)['filter'](_0x098c('0x25'))[_0x098c('0x26')](_0x098c('0x27'))['value']();if(_[_0x098c('0x28')](_0x4b6b76,_0x9eb63d[_0x098c('0x1f')])){return;}var _0x69cf71=_[_0x098c('0x29')](_0x322265,[_0x098c('0x27'),_0x9eb63d['role']])['name'];return db[_0x098c('0x2a')][_0x098c('0x1c')]({'where':{'type':_0x69cf71,'resourceId':_0x9eb63d['id']}})[_0x098c('0x1d')](function(){return _0x37176c;});})[_0x098c('0x1d')](function(){_0x17c2f7['status'](0xcc)[_0x098c('0x12')]();});}};}function handleEntityNotFound(_0x1c4649){return function(_0x4e1ba4){if(!_0x4e1ba4){_0x1c4649[_0x098c('0x11')](0x194);}return _0x4e1ba4;};}function handleError(_0x7781bf,_0xd632a4){_0xd632a4=_0xd632a4||0x1f4;return function(_0x3e9613){logger[_0x098c('0x2b')](_0x3e9613['stack']);if(_0x3e9613[_0x098c('0x2c')]){delete _0x3e9613[_0x098c('0x2c')];}_0x7781bf[_0x098c('0x13')](_0xd632a4)[_0x098c('0x2d')](_0x3e9613);};}function getUserAttributes(){return _(db[_0x098c('0x2e')]['rawAttributes'])['map'](function(_0x1d6f5d){return{'name':_0x1d6f5d['fieldName'],'type':_0x1d6f5d[_0x098c('0x2f')][_0x098c('0x30')]};})['filter'](function(_0x39ed4a){return![_0x098c('0x31'),_0x098c('0x32'),_0x098c('0x33'),_0x098c('0x34'),_0x098c('0x35'),_0x098c('0x36'),_0x098c('0x37')][_0x098c('0x28')](_0x39ed4a[_0x098c('0x2c')]);})[_0x098c('0x27')]();}exports[_0x098c('0x38')]=function(_0x1ebd15,_0x45c3a8){var _0x21865e={},_0x1a2cfd={'count':0x0,'rows':[]};var _0x429f3b=getUserAttributes();_0x21865e=qs[_0x098c('0x39')](_0x429f3b,_0x1ebd15);var _0x4d3783={'where':_0x21865e[_0x098c('0x3a')]};return db[_0x098c('0x2e')]['count'](_0x4d3783)[_0x098c('0x1d')](function(_0x4c43eb){_0x1a2cfd[_0x098c('0x17')]=_0x4c43eb;if(_0x1ebd15[_0x098c('0x3b')][_0x098c('0x3c')]){_0x21865e[_0x098c('0x3d')]=[{'all':!![]}];}if(_0x1ebd15[_0x098c('0x3b')][_0x098c('0x3e')]==='true'){_0x21865e[_0x098c('0x3d')]=[{'model':db['UserSetting'],'as':_0x098c('0x3e')}];}if(!_[_0x098c('0x28')](_0x21865e[_0x098c('0x3f')],'id')){_0x21865e[_0x098c('0x3f')][_0x098c('0x40')]('id');}return db['User'][_0x098c('0x41')](_0x21865e);})[_0x098c('0x1d')](function(_0x368cd7){_0x1a2cfd[_0x098c('0x42')]=_0x368cd7;if(_0x1ebd15[_0x098c('0x3b')][_0x098c('0x43')]==='true'){var _0x3ea25a=[];for(var _0x59b31d=0x0;_0x59b31d<_0x1a2cfd['rows'][_0x098c('0x44')];_0x59b31d++){_0x3ea25a[_0x098c('0x40')](get_open_tabs(_0x098c('0x45'),_0x1a2cfd[_0x098c('0x42')][_0x59b31d][_0x098c('0x46')]));_0x3ea25a[_0x098c('0x40')](get_open_tabs('sms',_0x1a2cfd[_0x098c('0x42')][_0x59b31d][_0x098c('0x46')]));_0x3ea25a[_0x098c('0x40')](get_open_tabs(_0x098c('0x47'),_0x1a2cfd[_0x098c('0x42')][_0x59b31d][_0x098c('0x46')]));_0x3ea25a[_0x098c('0x40')](get_open_tabs('mail',_0x1a2cfd[_0x098c('0x42')][_0x59b31d]['dataValues']));_0x3ea25a[_0x098c('0x40')](get_open_tabs(_0x098c('0x48'),_0x1a2cfd[_0x098c('0x42')][_0x59b31d][_0x098c('0x46')]));_0x3ea25a[_0x098c('0x40')](get_open_tabs('whatsapp',_0x1a2cfd[_0x098c('0x42')][_0x59b31d][_0x098c('0x46')]));}return Promise[_0x098c('0x49')](_0x3ea25a)[_0x098c('0x1d')](function(){return _0x1a2cfd;});}else{return _0x1a2cfd;}})[_0x098c('0x1d')](respondWithFilteredResult(_0x45c3a8,_0x21865e))[_0x098c('0x4a')](handleError(_0x45c3a8,null));};exports[_0x098c('0x4b')]=function(_0x127953,_0x55d7e8){var _0xcd577c=getUserAttributes();_0x127953[_0x098c('0x3b')]['id']=_0x127953[_0x098c('0x4c')]['id'];var _0x1ebe93=qs[_0x098c('0x39')](_0xcd577c,_0x127953);if(_0x127953[_0x098c('0x3b')][_0x098c('0x3c')]){_0x1ebe93[_0x098c('0x3d')]=[{'all':!![]}];}if(_0x127953['query'][_0x098c('0x3e')]===_0x098c('0x4d')){_0x1ebe93[_0x098c('0x3d')]=[{'model':db[_0x098c('0x4e')],'as':_0x098c('0x3e')}];}_0x1ebe93=_[_0x098c('0x4f')]({},_0x1ebe93,_0x127953[_0x098c('0x50')]);if(!_[_0x098c('0x28')](_0x1ebe93[_0x098c('0x3f')],'id')){_0x1ebe93[_0x098c('0x3f')]['push']('id');}return db[_0x098c('0x2e')][_0x098c('0x29')](_0x1ebe93)[_0x098c('0x1d')](handleEntityNotFound(_0x55d7e8,null))[_0x098c('0x1d')](function(_0x15792d){var _0x2241c0=[];values=_0x15792d;if(_0x127953[_0x098c('0x3b')][_0x098c('0x43')]===_0x098c('0x4d')){_0x2241c0[_0x098c('0x40')](get_open_tabs('chat',_0x15792d[_0x098c('0x46')]));_0x2241c0[_0x098c('0x40')](get_open_tabs(_0x098c('0x51'),_0x15792d['dataValues']));_0x2241c0[_0x098c('0x40')](get_open_tabs(_0x098c('0x48'),_0x15792d['dataValues']));_0x2241c0[_0x098c('0x40')](get_open_tabs('whatsapp',_0x15792d[_0x098c('0x46')]));_0x2241c0[_0x098c('0x40')](get_open_tabs(_0x098c('0x47'),_0x15792d[_0x098c('0x46')]));_0x2241c0['push'](get_open_tabs('mail',_0x15792d['dataValues']));return Promise['all'](_0x2241c0);}else{return values;}})['then'](function(){return values;})['then'](respondWithResult(_0x55d7e8,null))[_0x098c('0x4a')](handleError(_0x55d7e8,null));};exports[_0x098c('0x52')]=function(_0x554bcb,_0x2f057d){if(_0x554bcb['body']['id']){delete _0x554bcb[_0x098c('0x53')]['id'];}delete _0x554bcb[_0x098c('0x53')][_0x098c('0x1f')];return db[_0x098c('0x2e')][_0x098c('0x29')]({'where':{'id':_0x554bcb[_0x098c('0x4c')]['id']}})[_0x098c('0x1d')](handleEntityNotFound(_0x2f057d,null))[_0x098c('0x1d')](saveUpdates(_0x554bcb['body'],null))[_0x098c('0x1d')](respondWithResult(_0x2f057d,null))[_0x098c('0x4a')](handleError(_0x2f057d,null));};exports[_0x098c('0x54')]=function(_0x324f4d,_0x1e4ca7){return db[_0x098c('0x2e')][_0x098c('0x54')]()['then'](respondWithResult(_0x1e4ca7,null))['catch'](handleError(_0x1e4ca7,null));};exports[_0x098c('0x55')]=function(_0x4e32eb,_0x130b24){return db[_0x098c('0x2e')][_0x098c('0x29')]({'where':{'id':_0x4e32eb[_0x098c('0x4c')]['id']}})[_0x098c('0x1d')](handleEntityNotFound(_0x130b24,null))[_0x098c('0x1d')](function(_0x356fbd){if(_0x356fbd){return _0x356fbd[_0x098c('0x55')](_0x4e32eb[_0x098c('0x53')][_0x098c('0x56')],_[_0x098c('0x57')](_0x4e32eb['body'],[_0x098c('0x56'),'id'])||{});}})[_0x098c('0x1d')](respondWithResult(_0x130b24,null))['catch'](handleError(_0x130b24,null));};function validateUser(_0x41d406){return new Promise(function(_0x4cdda8,_0x54ff82){if(_0x41d406[_0x098c('0x58')])return _0x4cdda8(_0x41d406);return db[_0x098c('0x59')][_0x098c('0x5a')](0x1)[_0x098c('0x1d')](function(_0x4b7306){if(_0x4b7306[_0x098c('0x5b')])authService[_0x098c('0x5c')](_0x41d406[_0x098c('0x31')]);db[_0x098c('0x2e')][_0x098c('0x5d')](_0x098c('0x58'))['then'](function(_0x1a06ed){if(_[_0x098c('0x5e')](_0x1a06ed)){_0x41d406[_0x098c('0x58')]=_0x4b7306[_0x098c('0x5f')]||0x1;return;}if(_[_0x098c('0x5e')](_0x4b7306['min_internal'])||_0x4b7306[_0x098c('0x5f')]===_0x1a06ed){_0x41d406['internal']=_0x1a06ed+0x1;return;}if(_0x4b7306[_0x098c('0x5f')]>_0x1a06ed){_0x41d406[_0x098c('0x58')]=_0x4b7306['min_internal'];return;}return db[_0x098c('0x60')][_0x098c('0x3b')](_0x098c('0x61'),{'type':db[_0x098c('0x60')][_0x098c('0x62')][_0x098c('0x63')]})[_0x098c('0x1d')](function(_0x46d980){if(_0x46d980&&_0x46d980[_0x098c('0x44')]){for(var _0x32b9bd=0x0,_0x15597f=_0x46d980['length'];_0x32b9bd<_0x15597f&&_[_0x098c('0x5e')](_0x41d406[_0x098c('0x58')]);_0x32b9bd++){if(_0x4b7306[_0x098c('0x5f')]<=_0x46d980[_0x32b9bd][_0x098c('0x64')]){_0x41d406['internal']=_0x46d980[_0x32b9bd][_0x098c('0x64')];}else if(_0x4b7306['min_internal']>_0x46d980[_0x32b9bd]['from']&&_0x4b7306['min_internal']<=_0x46d980[_0x32b9bd]['to']){_0x41d406[_0x098c('0x58')]=_0x4b7306[_0x098c('0x5f')];}}}if(_[_0x098c('0x5e')](_0x41d406[_0x098c('0x58')])){_0x41d406[_0x098c('0x58')]=_0x1a06ed+0x1;}return _0x4cdda8(_0x41d406);});});})['catch'](function(_0x470767){_0x54ff82(_0x470767);});});}function updateUser(_0x526343){return new Promise(function(_0x42e9d4,_0x593cf6){try{if(_0x526343[_0x098c('0x65')]){_0x526343[_0x098c('0x66')]=_0x526343['internal'];_0x526343['VoiceMail']={'mailbox':_0x526343[_0x098c('0x58')],'password':_0x526343[_0x098c('0x31')],'fullname':_0x526343[_0x098c('0x67')],'email':_0x526343[_0x098c('0x68')]};}if(_0x526343[_0x098c('0x1f')]==='agent'){if(!_0x526343[_0x098c('0x69')])_0x526343[_0x098c('0x69')]=[_0x098c('0x6a'),_0x098c('0x6b'),_0x098c('0x6c'),_0x098c('0x6d'),_0x098c('0x6e'),_0x098c('0x6f'),'105','106',_0x098c('0x70'),_0x098c('0x71'),_0x098c('0x72'),_0x098c('0x73'),_0x098c('0x74'),'114',_0x098c('0x75')];}_0x42e9d4(_0x526343);}catch(_0x32c9b4){_0x593cf6(_0x32c9b4);}});}exports['create']=function(_0x2132e7,_0x5e8e81){if(_0x2132e7[_0x098c('0x22')][_0x098c('0x1f')]==='agent')throw new Error('Unauthorized');if(_0x2132e7['body'][_0x098c('0x1f')]===_0x098c('0x22')&&_0x2132e7[_0x098c('0x22')][_0x098c('0x1f')]!==_0x098c('0x20')){throw new Error(_0x098c('0x76'));}if(_0x2132e7[_0x098c('0x53')][_0x098c('0x1f')]===_0x098c('0x20')&&_0x2132e7['user'][_0x098c('0x1f')]!==_0x098c('0x20')){throw new Error(_0x098c('0x77'));}return licenseUtil[_0x098c('0x78')]([_0x2132e7[_0x098c('0x53')]])['then'](function(){return validateUser(_0x2132e7[_0x098c('0x53')]);})[_0x098c('0x1d')](function(_0x32cb3e){return updateUser(_0x32cb3e)[_0x098c('0x1d')](function(_0x58bb71){if(_0x58bb71[_0x098c('0x1f')]===_0x098c('0x20')){_0x58bb71[_0x098c('0x79')]=_0x2132e7[_0x098c('0x22')][_0x098c('0x79')];delete _0x58bb71[_0x098c('0x7a')];}return _0x58bb71;});})[_0x098c('0x1d')](function(_0x313446){return db['User'][_0x098c('0x7b')](_0x313446,{'include':[{'model':db[_0x098c('0x7c')],'as':_0x098c('0x7c')}]});})[_0x098c('0x1d')](function(_0x3ad123){if(_0x2132e7[_0x098c('0x53')][_0x098c('0x1f')]===_0x098c('0x22'))return _0x3ad123;if(_0x2132e7['user'][_0x098c('0x1f')]!==_0x098c('0x22'))return _0x3ad123;return db[_0x098c('0x7d')][_0x098c('0x29')]({'where':{'name':_0x3ad123[_0x098c('0x1f')]===_0x098c('0x1a')?'Agents':_0x098c('0x7e'),'userProfileId':_0x2132e7[_0x098c('0x22')][_0x098c('0x7a')]},'raw':!![]})[_0x098c('0x1d')](function(_0x146534){if(!_0x146534||_0x146534[_0x098c('0x7f')]!=0x0)return _0x3ad123;return db[_0x098c('0x2a')][_0x098c('0x7b')]({'name':_0x3ad123[_0x098c('0x2c')],'resourceId':_0x3ad123['id'],'type':_0x146534[_0x098c('0x2c')],'sectionId':_0x146534['id']},{})[_0x098c('0x1d')](function(){return _0x3ad123;});})[_0x098c('0x4a')](function(_0x4b5a58){logger[_0x098c('0x2b')](_0x098c('0x80'),_0x4b5a58);throw _0x4b5a58;});})[_0x098c('0x1d')](respondWithResult(_0x5e8e81,0xc9))[_0x098c('0x4a')](handleError(_0x5e8e81,null));};exports['bulkCreate']=function(_0x49d6c1,_0x35c7c5){var _0x2e5707=_0x49d6c1[_0x098c('0x53')];var _0x50e399=[];if(_0x49d6c1[_0x098c('0x22')][_0x098c('0x1f')]==='agent')throw new Error(_0x098c('0x81'));if(_[_0x098c('0x82')](_0x2e5707,['role',_0x098c('0x22')])&&_0x49d6c1[_0x098c('0x22')]['role']!==_0x098c('0x20')){throw new Error(_0x098c('0x76'));}if(_[_0x098c('0x82')](_0x2e5707,[_0x098c('0x1f'),_0x098c('0x20')])&&_0x49d6c1[_0x098c('0x22')][_0x098c('0x1f')]!=='admin'){throw new Error(_0x098c('0x83'));}return licenseUtil['checkUserLimits'](_0x2e5707)['then'](function(){return validateUser(_0x2e5707[0x0]);})[_0x098c('0x1d')](function(){for(var _0x57c3fa=0x1;_0x57c3fa<_0x2e5707[_0x098c('0x44')];_0x57c3fa++){var _0x33cf98=_0x2e5707[_0x57c3fa-0x1][_0x098c('0x58')];if(!_0x2e5707[_0x57c3fa][_0x098c('0x58')])_0x2e5707[_0x57c3fa]['internal']=_0x33cf98+0x1;_0x50e399[_0x098c('0x40')](validateUser(_0x2e5707[_0x57c3fa]));}return Promise['all'](_0x50e399);})[_0x098c('0x1d')](function(){_0x50e399=[];for(var _0x50221c=0x0;_0x50221c<_0x2e5707['length'];_0x50221c++){_0x50e399[_0x098c('0x40')](updateUser(_0x2e5707[_0x50221c]));}return Promise[_0x098c('0x49')](_0x50e399);})[_0x098c('0x1d')](function(){_0x50e399=_0x2e5707[_0x098c('0x26')](function(_0xfa58a7){return db[_0x098c('0x2e')][_0x098c('0x7b')](_0xfa58a7,{'include':[{'model':db[_0x098c('0x7c')],'as':'VoiceMail'}]})['then'](function(_0x12c1eb){_0xfa58a7['id']=_0x12c1eb['id'];return _0xfa58a7;});});return Promise['all'](_0x50e399);})[_0x098c('0x1d')](function(_0x2bf981){if(_0x49d6c1['body'][_0x098c('0x1f')]===_0x098c('0x22'))return _0x2bf981;if(_0x49d6c1[_0x098c('0x22')][_0x098c('0x1f')]!==_0x098c('0x22'))return _0x2bf981;var _0x1c2e0a=_[_0x098c('0x82')](_0x2bf981,function(_0x3e1a85){return _0x3e1a85['role']===_0x098c('0x1a')||_0x3e1a85['role']==='telephone';});if(!_0x1c2e0a)return _0x2bf981;return db[_0x098c('0x7d')][_0x098c('0x41')]({'where':{'name':{'$or':['Agents',_0x098c('0x7e')]},'userProfileId':_0x49d6c1[_0x098c('0x22')]['userProfileId']},'raw':!![]})[_0x098c('0x1d')](function(_0x4e766e){if(_[_0x098c('0x84')](_0x4e766e)||!_['some'](_0x4e766e,[_0x098c('0x7f'),0x0]))return _0x2bf981;_0x50e399=[];var _0x54935b=_(_0x4e766e)[_0x098c('0x26')](function(_0x1b319d){if(_0x1b319d['autoAssociation']===0x1)return;return _0x1b319d[_0x098c('0x2c')]==='Agents'?_0x098c('0x1a'):_0x098c('0x24');})[_0x098c('0x85')]()[_0x098c('0x27')]();for(var _0x24a84c=0x0;_0x24a84c<_0x2bf981[_0x098c('0x44')];_0x24a84c++){if(!_[_0x098c('0x28')](_0x54935b,_0x2bf981[_0x24a84c][_0x098c('0x1f')]))return;var _0x254948=_0x2bf981[_0x24a84c][_0x098c('0x1f')]===_0x098c('0x1a')?_0x098c('0x23'):_0x098c('0x7e');_0x50e399[_0x098c('0x40')](db[_0x098c('0x2a')][_0x098c('0x7b')]({'name':_0x2bf981[_0x24a84c][_0x098c('0x2c')],'resourceId':_0x2bf981[_0x24a84c]['id'],'type':_0x254948,'sectionId':_[_0x098c('0x29')](_0x4e766e,[_0x098c('0x2c'),_0x254948])['id']},{}));}return Promise[_0x098c('0x49')](_0x50e399);});})[_0x098c('0x1d')](respondWithResult(_0x35c7c5,0xc9))[_0x098c('0x4a')](handleError(_0x35c7c5,null));};exports[_0x098c('0x86')]=function(_0xc5ecec,_0x23ed27){if(_0xc5ecec[_0x098c('0x53')]['id']){delete _0xc5ecec[_0x098c('0x53')]['id'];}return db[_0x098c('0x2e')][_0x098c('0x29')]({'where':{'id':_0xc5ecec['params']['id']}})[_0x098c('0x1d')](function(_0x5a022c){if(!_0x5a022c)return null;if(_0x5a022c['id']===_0xc5ecec[_0x098c('0x22')]['id']){if(!_0xc5ecec[_0x098c('0x53')][_0x098c('0x87')]||!_0xc5ecec['body'][_0x098c('0x88')]){throw new db[(_0x098c('0x89'))][(_0x098c('0x8a'))](_0x098c('0x8b'));}if(!_0x5a022c[_0x098c('0x8c')](_0xc5ecec[_0x098c('0x53')]['oldPassword'])){throw new db['Sequelize'][(_0x098c('0x8a'))](_0x098c('0x8d'));}if(_0xc5ecec[_0x098c('0x53')][_0x098c('0x87')]===_0xc5ecec[_0x098c('0x53')][_0x098c('0x88')]){throw new db['Sequelize'][(_0x098c('0x8a'))]('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}}else if(_0xc5ecec[_0x098c('0x22')][_0x098c('0x1f')]===_0x098c('0x20')){if(!_0xc5ecec[_0x098c('0x53')][_0x098c('0x88')]){throw new db[(_0x098c('0x89'))]['ValidationError'](_0x098c('0x8e'));}}else if(_0xc5ecec[_0x098c('0x22')][_0x098c('0x1f')]==='user'){if(!_0xc5ecec[_0x098c('0x53')][_0x098c('0x88')]){throw new db[(_0x098c('0x89'))][(_0x098c('0x8a'))](_0x098c('0x8e'));}if(_0x5a022c[_0x098c('0x1f')]!==_0x098c('0x1a')){throw new db['Sequelize'][(_0x098c('0x8a'))]('Unauthorized');}}else{throw new db[(_0x098c('0x89'))]['ValidationError'](_0x098c('0x81'));}return _0x5a022c;})['then'](handleEntityNotFound(_0x23ed27,null))[_0x098c('0x1d')](function(_0x175aae){return db[_0x098c('0x59')][_0x098c('0x8f')]({'attributes':['id','securePassword','enforcePasswordHistory',_0x098c('0x90')]})[_0x098c('0x1d')](function(_0x209b93){if(_0x209b93[_0x098c('0x5b')])authService[_0x098c('0x5c')](_0xc5ecec[_0x098c('0x53')][_0x098c('0x88')]);if(!_0x209b93[_0x098c('0x91')]||!_0x175aae[_0x098c('0x33')])return _0x175aae;authService[_0x098c('0x92')](_0xc5ecec[_0x098c('0x53')][_0x098c('0x88')],_0x175aae[_0x098c('0x33')],_0x209b93[_0x098c('0x90')]);return _0x175aae;})[_0x098c('0x1d')](saveUpdates({'password':_0xc5ecec[_0x098c('0x53')][_0x098c('0x88')],'passwordResetAt':_0xc5ecec[_0x098c('0x22')]['id']==_0xc5ecec['params']['id']?moment():null,'previousPasswords':authService[_0x098c('0x93')](_0xc5ecec[_0x098c('0x53')][_0x098c('0x88')],_0x175aae[_0x098c('0x33')])},null));})[_0x098c('0x1d')](respondWithResult(_0x23ed27,null))[_0x098c('0x4a')](handleError(_0x23ed27,null));};exports[_0x098c('0x94')]=function(_0x5f1b77,_0x57dffb){var _0x517745=_0x5f1b77['body']['channel'];return db[_0x098c('0x2e')][_0x098c('0x29')]({'where':{'id':_0x5f1b77['params']['id']},'attributes':['id',_0x098c('0x2c'),_0x098c('0x1f'),_0x098c('0x95'),_0x098c('0x96'),_0x098c('0x97'),_0x098c('0x98')]})[_0x098c('0x1d')](handleEntityNotFound(_0x57dffb,null))['then'](function(_0x2c1f8a){if(_0x2c1f8a){if(!utils['isValidChannel'](_0x517745)){throw new db[(_0x098c('0x89'))][(_0x098c('0x8a'))](_0x098c('0x99'));}return _0x2c1f8a[_0x098c('0x9a')+_[_0x098c('0x9b')](_0x517745[_0x098c('0x9c')]())+_0x098c('0x9d')](_0x5f1b77['body'][_0x098c('0x56')],{'penalty':_0x5f1b77[_0x098c('0x53')]['penalty']||0x0})['spread'](function(_0x2125d5){for(var _0x20c0e2=0x0;_0x20c0e2<_0x5f1b77['body'][_0x098c('0x56')][_0x098c('0x44')];_0x20c0e2+=0x1){var _0x312b8a={'UserId':Number(_0x5f1b77['params']['id'])};_0x312b8a[_['capitalize'](_0x517745[_0x098c('0x9c')]())+_0x098c('0x9e')]=Number(_0x5f1b77['body'][_0x098c('0x56')][_0x20c0e2]);socket[_0x098c('0x9f')](_0x098c('0x22')+_['capitalize'](_0x517745[_0x098c('0x9c')]())+_0x098c('0xa0'),_0x312b8a);}return _0x2125d5;})['then'](function(){if(_0x517745==='voice'){return db['VoiceQueue'][_0x098c('0x41')]({'where':{'id':_0x5f1b77['body']['ids']||[]},'raw':!![],'attributes':['id',_0x098c('0x2c')]});}})[_0x098c('0x1d')](function(_0x2676ef){var _0x411d64=_0x2c1f8a[_0x098c('0x1e')]({'plain':!![]});var _0x3a19fc=[];if(_0x517745==='voice'&&_0x411d64[_0x098c('0x1f')]===_0x098c('0x1a')&&_0x411d64['online']){for(let _0xddf397=0x0;_0xddf397<_0x2676ef[_0x098c('0x44')];_0xddf397+=0x1){_0x3a19fc[_0x098c('0x40')]({'membername':_0x411d64[_0x098c('0x2c')],'UserId':_0x411d64['id'],'queue_name':_0x2676ef[_0xddf397][_0x098c('0x2c')],'VoiceQueueId':_0x2676ef[_0xddf397]['id'],'interface':_[_0x098c('0x5e')](_0x411d64[_0x098c('0x98')])?util[_0x098c('0xa1')](_0x098c('0xa2'),_0x411d64[_0x098c('0x2c')]):_0x411d64['interface'],'paused':_0x411d64[_0x098c('0x97')]||![],'penalty':_0x5f1b77[_0x098c('0x53')]['penalty']||0x0});}return Promise[_0x098c('0x49')](_0x3a19fc[_0x098c('0x26')](function(_0x4746df){return db[_0x098c('0xa3')][_0x098c('0xa4')](_0x4746df);}));}return _0x2c1f8a;});}})[_0x098c('0x1d')](respondWithStatusCode(_0x57dffb,null))['catch'](handleError(_0x57dffb,null));};exports['removeQueues']=function(_0x351fcf,_0x563c3a){var _0x29cb98,_0x4ad9fc;return db[_0x098c('0x2e')]['find']({'where':{'id':_0x351fcf['params']['id']},'attributes':['id',_0x098c('0x2c'),_0x098c('0x1f')]})['then'](handleEntityNotFound(_0x563c3a,null))[_0x098c('0x1d')](function(_0xfc16d4){if(_0xfc16d4){_0x29cb98=_0xfc16d4;if(!_0x351fcf[_0x098c('0x3b')][_0x098c('0xa5')]||!utils['isValidChannel'](_0x351fcf['query'][_0x098c('0xa5')])){throw new db['Sequelize'][(_0x098c('0x8a'))](_0x098c('0x99'));}return _0xfc16d4['remove'+_[_0x098c('0x9b')](_0x351fcf[_0x098c('0x3b')]['channel']['toLowerCase']())+_0x098c('0x9d')](_0x351fcf[_0x098c('0x3b')][_0x098c('0x56')]);}})[_0x098c('0x1d')](function(_0x43bdff){if(_[_0x098c('0xa6')](_0x351fcf[_0x098c('0x3b')][_0x098c('0x56')])){for(var _0x5db64b=0x0;_0x5db64b<_0x351fcf['query']['ids'][_0x098c('0x44')];_0x5db64b+=0x1){_0x4ad9fc={'UserId':Number(_0x351fcf['params']['id'])};_0x4ad9fc[_[_0x098c('0x9b')](_0x351fcf[_0x098c('0x3b')][_0x098c('0xa5')][_0x098c('0x9c')]())+_0x098c('0x9e')]=Number(_0x351fcf[_0x098c('0x3b')][_0x098c('0x56')][_0x5db64b]);socket[_0x098c('0x9f')](_0x098c('0x22')+_[_0x098c('0x9b')](_0x351fcf[_0x098c('0x3b')][_0x098c('0xa5')][_0x098c('0x9c')]())+_0x098c('0xa7'),_0x4ad9fc);}}else{_0x4ad9fc={'UserId':Number(_0x351fcf[_0x098c('0x4c')]['id'])};_0x4ad9fc[_[_0x098c('0x9b')](_0x351fcf[_0x098c('0x3b')][_0x098c('0xa5')][_0x098c('0x9c')]())+_0x098c('0x9e')]=Number(_0x351fcf[_0x098c('0x3b')]['ids']);socket[_0x098c('0x9f')](_0x098c('0x22')+_['capitalize'](_0x351fcf['query']['channel'][_0x098c('0x9c')]())+_0x098c('0xa7'),_0x4ad9fc);}return _0x43bdff;})[_0x098c('0x1d')](function(){if(_0x351fcf['query'][_0x098c('0xa5')]===_0x098c('0xa8')){return db[_0x098c('0xa3')][_0x098c('0x1c')]({'where':{'UserId':_0x351fcf[_0x098c('0x4c')]['id'],'VoiceQueueId':_0x351fcf[_0x098c('0x3b')][_0x098c('0x56')]},'individualHooks':!![]})['then'](function(){return _0x29cb98;});}return _0x29cb98;})[_0x098c('0x1d')](respondWithStatusCode(_0x563c3a,null))[_0x098c('0x4a')](handleError(_0x563c3a,null));};exports['addAvatar']=function(_0x2a67ae,_0x3135bb){_0x2a67ae[_0x098c('0x53')][_0x098c('0xa9')]=_0x2a67ae[_0x098c('0xaa')][_0x098c('0xab')];return db[_0x098c('0x2e')][_0x098c('0x29')]({'where':{'id':_0x2a67ae[_0x098c('0x4c')]['id']}})[_0x098c('0x1d')](handleEntityNotFound(_0x3135bb,null))['then'](saveUpdates(_0x2a67ae[_0x098c('0x53')],null))[_0x098c('0x1d')](respondWithResult(_0x3135bb,null))[_0x098c('0x4a')](handleError(_0x3135bb,null));};exports[_0x098c('0xac')]=function(_0x48c27b,_0x519095){var _0x39a07c=path[_0x098c('0xad')](config['root'],_0x098c('0xae'));return db[_0x098c('0x2e')][_0x098c('0x29')]({'where':{'id':_0x48c27b[_0x098c('0x4c')]['id']},'attributes':['id',_0x098c('0xa9')],'raw':!![]})[_0x098c('0x1d')](handleEntityNotFound(_0x519095,null))[_0x098c('0x1d')](function(_0x4b35b0){if(_0x4b35b0){if(_[_0x098c('0x5e')](_0x4b35b0['userpic'])){return _0x519095[_0x098c('0xaf')](_0x39a07c);}else{if(!fs[_0x098c('0xb0')](path[_0x098c('0xad')](config[_0x098c('0xb1')],'server/files/images/',_0x4b35b0[_0x098c('0xa9')]))){return _0x519095['download'](_0x39a07c);}return _0x519095[_0x098c('0xaf')](path['join'](config[_0x098c('0xb1')],_0x098c('0xb2'),_0x4b35b0['userpic']));}}})[_0x098c('0x4a')](handleError(_0x519095,null));};exports['getOpenTabs']=function(_0xa811a2,_0x2e5f25){return db[_0x098c('0x2e')][_0x098c('0x29')]({'where':{'id':_0xa811a2[_0x098c('0x4c')]['id']},'attributes':['id']})[_0x098c('0x1d')](handleEntityNotFound(_0x2e5f25,null))[_0x098c('0x1d')](function(_0x48db52){var _0x288147=[];values=_0x48db52[_0x098c('0x46')];_0x288147[_0x098c('0x40')](get_open_tabs(_0x098c('0x45'),_0x48db52['dataValues']));_0x288147['push'](get_open_tabs('sms',_0x48db52[_0x098c('0x46')]));_0x288147['push'](get_open_tabs(_0x098c('0x48'),_0x48db52[_0x098c('0x46')]));_0x288147[_0x098c('0x40')](get_open_tabs('whatsapp',_0x48db52['dataValues']));_0x288147[_0x098c('0x40')](get_open_tabs(_0x098c('0x47'),_0x48db52[_0x098c('0x46')]));_0x288147[_0x098c('0x40')](get_open_tabs(_0x098c('0xb3'),_0x48db52[_0x098c('0x46')]));return Promise[_0x098c('0x49')](_0x288147);})[_0x098c('0x1d')](function(_0x45764b){if(_0x45764b){var _0x44d15f=_[_0x098c('0x26')](values[_0x098c('0xb4')],function(_0x4a5310){return{'channel':_0x098c('0xb5'),'id':_0x4a5310['id'],'createdAt':_0x4a5310[_0x098c('0xb6')]};});var _0x25cdf7=_[_0x098c('0x26')](values[_0x098c('0xb7')],function(_0x15061d){return{'channel':_0x098c('0xb8'),'id':_0x15061d['id'],'createdAt':_0x15061d[_0x098c('0xb6')]};});var _0x4d87c2=_[_0x098c('0x26')](values['OpenchannelOpenTabs'],function(_0x5f289d){return{'channel':_0x098c('0xb9'),'id':_0x5f289d['id'],'createdAt':_0x5f289d[_0x098c('0xb6')]};});var _0x15573d=_[_0x098c('0x26')](values[_0x098c('0xba')],function(_0x30f943){return{'channel':_0x098c('0xbb'),'id':_0x30f943['id'],'createdAt':_0x30f943[_0x098c('0xb6')]};});var _0x171e9c=_['map'](values[_0x098c('0xbc')],function(_0x140448){return{'channel':_0x098c('0xbd'),'id':_0x140448['id'],'createdAt':_0x140448[_0x098c('0xb6')]};});var _0x575cce=_[_0x098c('0x26')](values['WhatsappOpenTabs'],function(_0x30d41b){return{'channel':_0x098c('0xbe'),'id':_0x30d41b['id'],'createdAt':_0x30d41b[_0x098c('0xb6')]};});var _0x26ea2d=_[_0x098c('0xbf')](_0x44d15f,_0x25cdf7,_0x4d87c2,_0x15573d,_0x171e9c,_0x575cce);var _0x3a4a6f={'count':_0x26ea2d['length'],'rows':_0x26ea2d};return _0x3a4a6f;}else return null;})[_0x098c('0x1d')](respondWithResult(_0x2e5f25,null))[_0x098c('0x4a')](handleError(_0x2e5f25,null));};exports[_0x098c('0xc0')]=function(_0x23832c,_0x3f25de){var _0xd0880d={};return db[_0x098c('0x2e')][_0x098c('0x8f')]({'where':{'id':_0x23832c[_0x098c('0x4c')]['id']}})[_0x098c('0x1d')](function(_0x4f8370){if(!_0x4f8370){throw new APINotFoundError(util[_0x098c('0xa1')](_0x098c('0xc1'),_0x23832c[_0x098c('0x4c')]['id']));}return contacts['describe']();})[_0x098c('0x1d')](function(_0x554611){_0x23832c[_0x098c('0x3b')][_0x098c('0x2e')]=_0x23832c['params']['id'];_0xd0880d=qs[_0x098c('0x39')](_0x554611,_0x23832c);if(_0x23832c[_0x098c('0x3b')][_0x098c('0xc2')](_0x098c('0x3c'))){_0xd0880d['include']=[{'model':db[_0x098c('0xc3')],'as':_0x098c('0xc4'),'required':![]},{'model':db[_0x098c('0xc5')],'as':_0x098c('0xc6'),'attributes':['id',_0x098c('0x2c'),'color'],'where':_0x23832c['query'][_0x098c('0xc7')]?{'id':_0x23832c[_0x098c('0x3b')][_0x098c('0xc7')]}:undefined,'required':_0x23832c[_0x098c('0x3b')][_0x098c('0xc7')]?!![]:![]}];}return contacts[_0x098c('0x41')](_0x23832c[_0x098c('0x3b')],_0x23832c[_0x098c('0x22')],_0xd0880d,_0x554611);})[_0x098c('0x1d')](respondWithFilteredResult(_0x3f25de,_0xd0880d))[_0x098c('0x4a')](APIHandleError(_0x3f25de));};exports[_0x098c('0xc8')]=function(_0x131267,_0x51f3dd){var _0x285ccc;var _0x387c5a={};var _0x15a423;return db['User'][_0x098c('0x8f')]({'where':{'id':_0x131267[_0x098c('0x4c')]['id']},'attributes':['id','name',_0x098c('0x1f')]})['then'](handleEntityNotFound(_0x51f3dd,null))[_0x098c('0x1d')](function(_0x5e2726){if(!utils['isValidChannel'](_0x131267[_0x098c('0x3b')]['channel'])){throw new db[(_0x098c('0x89'))]['ValidationError'](_0x098c('0x99'));}_0x285ccc=_0x5e2726;var _0x320be6={};_0x320be6[_0x098c('0xc9')]=_['keys'](db[_[_0x098c('0x9b')](_0x131267[_0x098c('0x3b')][_0x098c('0xa5')])+_0x098c('0xca')][_0x098c('0xcb')]);_0x320be6['query']=_[_0x098c('0xcc')](_0x131267[_0x098c('0x3b')]);_0x320be6['filters']=_[_0x098c('0xcd')](_0x320be6['model'],_0x320be6[_0x098c('0x3b')]);_0x387c5a[_0x098c('0x3f')]=_[_0x098c('0xcd')](_0x320be6['model'],qs[_0x098c('0xce')](_0x131267[_0x098c('0x3b')][_0x098c('0xce')]));_0x387c5a[_0x098c('0x3f')]=_0x387c5a[_0x098c('0x3f')]['length']?_0x387c5a[_0x098c('0x3f')]:_0x320be6['model'];_0x387c5a[_0x098c('0xcf')]=qs[_0x098c('0xd0')](_0x131267[_0x098c('0x3b')]['sort']);_0x387c5a[_0x098c('0x3a')]=qs[_0x098c('0xd1')](_[_0x098c('0xd2')](_0x131267[_0x098c('0x3b')],_0x320be6[_0x098c('0xd1')]));if(_0x131267[_0x098c('0x3b')]['filter']){_0x387c5a[_0x098c('0x3a')]=_[_0x098c('0x4f')](_0x387c5a[_0x098c('0x3a')],{'$or':_[_0x098c('0x26')](_0x387c5a['attributes'],function(_0x24bab2){var _0x238184={};_0x238184[_0x24bab2]={'$like':'%'+_0x131267[_0x098c('0x3b')]['filter']+'%'};return _0x238184;})});}_0x387c5a=_['merge']({},_0x387c5a,_0x131267[_0x098c('0x50')]);switch(_0x285ccc[_0x098c('0x1f')]){case'admin':return db[_[_0x098c('0x9b')](_0x131267['query'][_0x098c('0xa5')])+_0x098c('0xca')][_0x098c('0x41')](_0x387c5a);case _0x098c('0x22'):case _0x098c('0x1a'):return _0x285ccc[_0x098c('0x1e')+_[_0x098c('0x9b')](_0x131267[_0x098c('0x3b')]['channel'])+_0x098c('0x9d')](_0x387c5a);default:throw new db[(_0x098c('0x89'))][(_0x098c('0x8a'))](_0x098c('0xd3'));}})['then'](function(_0x3bac3f){_0x15a423=_0x3bac3f[_0x098c('0x44')];if(!_0x131267['query'][_0x098c('0xc2')](_0x098c('0xd4'))){_0x387c5a[_0x098c('0x18')]=qs[_0x098c('0x18')](_0x131267[_0x098c('0x3b')][_0x098c('0x18')]);_0x387c5a[_0x098c('0x15')]=qs['offset'](_0x131267[_0x098c('0x3b')][_0x098c('0x15')]);}switch(_0x285ccc[_0x098c('0x1f')]){case _0x098c('0x20'):return db[_[_0x098c('0x9b')](_0x131267[_0x098c('0x3b')]['channel'])+_0x098c('0xca')][_0x098c('0x41')](_0x387c5a);case _0x098c('0x22'):case _0x098c('0x1a'):return _0x285ccc['get'+_['capitalize'](_0x131267[_0x098c('0x3b')]['channel'])+'Queues'](_0x387c5a);}})['then'](function(_0x1aee28){return{'count':_0x15a423,'rows':_0x1aee28};})[_0x098c('0x1d')](respondWithResult(_0x51f3dd,null))[_0x098c('0x4a')](handleError(_0x51f3dd,null));};exports[_0x098c('0xd5')]=function(_0x48c401,_0x597a9c){var _0x2bdc9f={};var _0x65a928={};var _0x4710b8;var _0x572499;return db['User'][_0x098c('0x8f')]({'where':{'id':_0x48c401[_0x098c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x597a9c,null))[_0x098c('0x1d')](function(_0x104e41){if(_0x104e41){_0x4710b8=_0x104e41;_0x65a928['model']=_[_0x098c('0xcc')](db['UserVoiceQueueRt'][_0x098c('0xcb')]);_0x65a928['query']=_['keys'](_0x48c401[_0x098c('0x3b')]);_0x65a928['filters']=_[_0x098c('0xcd')](_0x65a928[_0x098c('0xc9')],_0x65a928[_0x098c('0x3b')]);_0x2bdc9f[_0x098c('0x3f')]=_[_0x098c('0xcd')](_0x65a928[_0x098c('0xc9')],qs['fields'](_0x48c401[_0x098c('0x3b')][_0x098c('0xce')]));_0x2bdc9f[_0x098c('0x3f')]=_0x2bdc9f[_0x098c('0x3f')]['length']?_0x2bdc9f['attributes']:_0x65a928['model'];_0x2bdc9f[_0x098c('0xcf')]=qs['sort'](_0x48c401[_0x098c('0x3b')][_0x098c('0xd0')]);_0x2bdc9f[_0x098c('0x3a')]=qs[_0x098c('0xd1')](_[_0x098c('0xd2')](_0x48c401[_0x098c('0x3b')],_0x65a928[_0x098c('0xd1')]));if(_0x48c401[_0x098c('0x3b')][_0x098c('0xd6')]){_0x2bdc9f['where']=_[_0x098c('0x4f')](_0x2bdc9f['where'],{'$or':_[_0x098c('0x26')](_0x2bdc9f[_0x098c('0x3f')],function(_0x14694b){var _0x4eaec9={};_0x4eaec9[_0x14694b]={'$like':'%'+_0x48c401[_0x098c('0x3b')][_0x098c('0xd6')]+'%'};return _0x4eaec9;})});}_0x2bdc9f=_['merge']({},_0x2bdc9f,_0x48c401[_0x098c('0x50')]);return _0x4710b8['getVoiceQueuesRt'](_0x2bdc9f);}})[_0x098c('0x1d')](function(_0x47caa8){if(_0x47caa8){_0x572499=_0x47caa8[_0x098c('0x44')];if(!_0x48c401[_0x098c('0x3b')][_0x098c('0xc2')](_0x098c('0xd4'))){_0x2bdc9f[_0x098c('0x18')]=qs[_0x098c('0x18')](_0x48c401[_0x098c('0x3b')][_0x098c('0x18')]);_0x2bdc9f[_0x098c('0x15')]=qs['offset'](_0x48c401[_0x098c('0x3b')][_0x098c('0x15')]);}return _0x4710b8[_0x098c('0xd5')](_0x2bdc9f);}})['then'](function(_0x3a7586){if(_0x3a7586){return _0x3a7586?{'count':_0x572499,'rows':_0x3a7586}:null;}})[_0x098c('0x1d')](respondWithResult(_0x597a9c,null))[_0x098c('0x4a')](handleError(_0x597a9c,null));};exports['getGroups']=function(_0x48dd0c,_0x2669e4){var _0x1584a1={};var _0x133dd0={};var _0x33c8a1;var _0x336f97;return db[_0x098c('0x2e')][_0x098c('0x8f')]({'where':{'id':_0x48dd0c[_0x098c('0x4c')]['id']}})[_0x098c('0x1d')](handleEntityNotFound(_0x2669e4,null))['then'](function(_0x4212df){if(_0x4212df){_0x33c8a1=_0x4212df;_0x133dd0[_0x098c('0xc9')]=_['keys'](db[_0x098c('0xd7')][_0x098c('0xcb')]);_0x133dd0[_0x098c('0x3b')]=_[_0x098c('0xcc')](_0x48dd0c[_0x098c('0x3b')]);_0x133dd0[_0x098c('0xd1')]=_[_0x098c('0xcd')](_0x133dd0[_0x098c('0xc9')],_0x133dd0[_0x098c('0x3b')]);_0x1584a1[_0x098c('0x3f')]=_[_0x098c('0xcd')](_0x133dd0['model'],qs[_0x098c('0xce')](_0x48dd0c[_0x098c('0x3b')][_0x098c('0xce')]));_0x1584a1[_0x098c('0x3f')]=_0x1584a1[_0x098c('0x3f')]['length']?_0x1584a1[_0x098c('0x3f')]:_0x133dd0[_0x098c('0xc9')];_0x1584a1[_0x098c('0xcf')]=qs[_0x098c('0xd0')](_0x48dd0c[_0x098c('0x3b')][_0x098c('0xd0')]);_0x1584a1[_0x098c('0x3a')]=qs[_0x098c('0xd1')](_[_0x098c('0xd2')](_0x48dd0c['query'],_0x133dd0['filters']));if(_0x48dd0c[_0x098c('0x3b')][_0x098c('0xd6')]){_0x1584a1[_0x098c('0x3a')]=_[_0x098c('0x4f')](_0x1584a1[_0x098c('0x3a')],{'$or':_['map'](_0x1584a1['attributes'],function(_0x59342f){var _0x559d25={};_0x559d25[_0x59342f]={'$like':'%'+_0x48dd0c[_0x098c('0x3b')]['filter']+'%'};return _0x559d25;})});}_0x1584a1=_[_0x098c('0x4f')]({},_0x1584a1,_0x48dd0c['options']);return _0x33c8a1[_0x098c('0xd8')](_0x1584a1);}})[_0x098c('0x1d')](function(_0x2c6ed8){if(_0x2c6ed8){_0x336f97=_0x2c6ed8[_0x098c('0x44')];if(!_0x48dd0c[_0x098c('0x3b')][_0x098c('0xc2')]('nolimit')){_0x1584a1[_0x098c('0x18')]=qs[_0x098c('0x18')](_0x48dd0c[_0x098c('0x3b')][_0x098c('0x18')]);_0x1584a1[_0x098c('0x15')]=qs[_0x098c('0x15')](_0x48dd0c[_0x098c('0x3b')][_0x098c('0x15')]);}return _0x33c8a1[_0x098c('0xd8')](_0x1584a1);}})['then'](function(_0x5efdb3){if(_0x5efdb3){return _0x5efdb3?{'count':_0x336f97,'rows':_0x5efdb3}:null;}})[_0x098c('0x1d')](respondWithResult(_0x2669e4,null))[_0x098c('0x4a')](handleError(_0x2669e4,null));};exports[_0x098c('0xd9')]=function(_0x5a0e7b,_0x44c0d9){var _0x3409cf={'raw':!![],'where':{}};var _0x5eb3ea={};var _0x3c7020={'count':0x0,'rows':[]};return db[_0x098c('0x2e')][_0x098c('0x8f')]({'where':{'id':_0x5a0e7b[_0x098c('0x4c')]['id']}})[_0x098c('0x1d')](handleEntityNotFound(_0x44c0d9,null))[_0x098c('0x1d')](function(_0x435889){if(_0x435889){_0x5eb3ea[_0x098c('0xc9')]=_[_0x098c('0xcc')](db[_0x098c('0xda')][_0x098c('0xcb')]);_0x5eb3ea['query']=_[_0x098c('0xcc')](_0x5a0e7b[_0x098c('0x3b')]);_0x5eb3ea['filters']=_[_0x098c('0xcd')](_0x5eb3ea[_0x098c('0xc9')],_0x5eb3ea[_0x098c('0x3b')]);_0x3409cf[_0x098c('0x3f')]=_[_0x098c('0xcd')](_0x5eb3ea[_0x098c('0xc9')],qs[_0x098c('0xce')](_0x5a0e7b[_0x098c('0x3b')]['fields']));_0x3409cf[_0x098c('0x3f')]=_0x3409cf['attributes'][_0x098c('0x44')]?_0x3409cf['attributes']:_0x5eb3ea[_0x098c('0xc9')];if(!_0x5a0e7b[_0x098c('0x3b')][_0x098c('0xc2')](_0x098c('0xd4'))){_0x3409cf['limit']=qs[_0x098c('0x18')](_0x5a0e7b['query'][_0x098c('0x18')]);_0x3409cf['offset']=qs[_0x098c('0x15')](_0x5a0e7b[_0x098c('0x3b')][_0x098c('0x15')]);}_0x3409cf['order']=qs[_0x098c('0xd0')](_0x5a0e7b[_0x098c('0x3b')][_0x098c('0xd0')]);_0x3409cf[_0x098c('0x3a')]=qs[_0x098c('0xd1')](_['pick'](_0x5a0e7b[_0x098c('0x3b')],_0x5eb3ea[_0x098c('0xd1')]));_0x3409cf[_0x098c('0x3a')]['UserId']=_0x435889['id'];if(_0x5a0e7b[_0x098c('0x3b')][_0x098c('0xd6')]){_0x3409cf[_0x098c('0x3a')]=_[_0x098c('0x4f')](_0x3409cf[_0x098c('0x3a')],{'$or':_['map'](_0x3409cf[_0x098c('0x3f')],function(_0x25ba70){var _0x50d61c={};_0x50d61c[_0x25ba70]={'$like':'%'+_0x5a0e7b[_0x098c('0x3b')][_0x098c('0xd6')]+'%'};return _0x50d61c;})});}_0x3409cf=_[_0x098c('0x4f')]({},_0x3409cf,_0x5a0e7b['options']);return db['VoiceRecording'][_0x098c('0x17')]({'where':_0x3409cf[_0x098c('0x3a')]})[_0x098c('0x1d')](function(_0x1521be){_0x3c7020[_0x098c('0x17')]=_0x1521be;if(_0x5a0e7b['query'][_0x098c('0x3c')]){_0x3409cf['include']=[{'all':!![]}];}return db[_0x098c('0xda')]['findAll'](_0x3409cf);})['then'](function(_0x136082){_0x3c7020['rows']=_0x136082;return _0x3c7020;});}})[_0x098c('0x1d')](respondWithFilteredResult(_0x44c0d9,_0x3409cf))[_0x098c('0x4a')](handleError(_0x44c0d9,null));};exports[_0x098c('0xdb')]=function(_0x58a183,_0x1b0a7f){var _0x3b07db={'raw':!![],'where':{}};var _0x2ea607={};var _0xa2cc13={'count':0x0,'rows':[]};return db[_0x098c('0x2e')][_0x098c('0x8f')]({'where':{'id':_0x58a183[_0x098c('0x4c')]['id']}})[_0x098c('0x1d')](handleEntityNotFound(_0x1b0a7f,null))[_0x098c('0x1d')](function(_0x2c1b85){if(_0x2c1b85){_0x2ea607[_0x098c('0xc9')]=_[_0x098c('0xcc')](db[_0x098c('0xdc')]['rawAttributes']);_0x2ea607[_0x098c('0x3b')]=_[_0x098c('0xcc')](_0x58a183[_0x098c('0x3b')]);_0x2ea607[_0x098c('0xd1')]=_[_0x098c('0xcd')](_0x2ea607[_0x098c('0xc9')],_0x2ea607[_0x098c('0x3b')]);_0x3b07db[_0x098c('0x3f')]=_[_0x098c('0xcd')](_0x2ea607[_0x098c('0xc9')],qs[_0x098c('0xce')](_0x58a183[_0x098c('0x3b')]['fields']));_0x3b07db['attributes']=_0x3b07db['attributes'][_0x098c('0x44')]?_0x3b07db['attributes']:_0x2ea607[_0x098c('0xc9')];if(!_0x58a183[_0x098c('0x3b')][_0x098c('0xc2')](_0x098c('0xd4'))){_0x3b07db[_0x098c('0x18')]=qs[_0x098c('0x18')](_0x58a183[_0x098c('0x3b')][_0x098c('0x18')]);_0x3b07db[_0x098c('0x15')]=qs[_0x098c('0x15')](_0x58a183['query'][_0x098c('0x15')]);}_0x3b07db[_0x098c('0xcf')]=qs[_0x098c('0xd0')](_0x58a183['query'][_0x098c('0xd0')]);_0x3b07db[_0x098c('0x3a')]=qs[_0x098c('0xd1')](_[_0x098c('0xd2')](_0x58a183[_0x098c('0x3b')],_0x2ea607[_0x098c('0xd1')]));_0x3b07db[_0x098c('0x3a')][_0x098c('0xdd')]=_0x2c1b85['id'];if(_0x58a183[_0x098c('0x3b')][_0x098c('0xd6')]){_0x3b07db['where']=_[_0x098c('0x4f')](_0x3b07db[_0x098c('0x3a')],{'$or':_[_0x098c('0x26')](_0x3b07db['attributes'],function(_0x4e9666){var _0x5ccbda={};_0x5ccbda[_0x4e9666]={'$like':'%'+_0x58a183[_0x098c('0x3b')][_0x098c('0xd6')]+'%'};return _0x5ccbda;})});}_0x3b07db=_[_0x098c('0x4f')]({},_0x3b07db,_0x58a183['options']);return db[_0x098c('0xdc')][_0x098c('0x17')]({'where':_0x3b07db[_0x098c('0x3a')]})['then'](function(_0x7bc22a){_0xa2cc13['count']=_0x7bc22a;if(_0x58a183[_0x098c('0x3b')][_0x098c('0x3c')]){_0x3b07db[_0x098c('0x3d')]=[{'all':!![]}];}return db[_0x098c('0xdc')]['findAll'](_0x3b07db);})['then'](function(_0x5938ca){_0xa2cc13['rows']=_0x5938ca;return _0xa2cc13;});}})[_0x098c('0x1d')](respondWithFilteredResult(_0x1b0a7f,_0x3b07db))[_0x098c('0x4a')](handleError(_0x1b0a7f,null));};exports['getChatInteractions']=function(_0x596810,_0x2c704b){var _0x49fcb1={};var _0xdf9fd7={};var _0x31a13f;var _0x487201;return db[_0x098c('0x2e')][_0x098c('0x8f')]({'where':{'id':_0x596810[_0x098c('0x4c')]['id']}})[_0x098c('0x1d')](handleEntityNotFound(_0x2c704b,null))[_0x098c('0x1d')](function(_0x5ce5b3){if(_0x5ce5b3){_0x31a13f=_0x5ce5b3;_0xdf9fd7[_0x098c('0xc9')]=_[_0x098c('0xcc')](db[_0x098c('0xde')][_0x098c('0xcb')]);_0xdf9fd7['query']=_[_0x098c('0xcc')](_0x596810[_0x098c('0x3b')]);_0xdf9fd7[_0x098c('0xd1')]=_[_0x098c('0xcd')](_0xdf9fd7[_0x098c('0xc9')],_0xdf9fd7[_0x098c('0x3b')]);_0x49fcb1[_0x098c('0x3f')]=_[_0x098c('0xcd')](_0xdf9fd7[_0x098c('0xc9')],qs[_0x098c('0xce')](_0x596810['query'][_0x098c('0xce')]));_0x49fcb1['attributes']=_0x49fcb1['attributes'][_0x098c('0x44')]?_0x49fcb1['attributes']:_0xdf9fd7[_0x098c('0xc9')];_0x49fcb1['order']=qs[_0x098c('0xd0')](_0x596810[_0x098c('0x3b')][_0x098c('0xd0')]);_0x49fcb1['where']=qs[_0x098c('0xd1')](_[_0x098c('0xd2')](_0x596810[_0x098c('0x3b')],_0xdf9fd7[_0x098c('0xd1')]));if(_0x596810[_0x098c('0x3b')][_0x098c('0xd6')]){_0x49fcb1[_0x098c('0x3a')]=_[_0x098c('0x4f')](_0x49fcb1[_0x098c('0x3a')],{'$or':_['map'](_0x49fcb1['attributes'],function(_0x308441){var _0x435f3b={};_0x435f3b[_0x308441]={'$like':'%'+_0x596810['query'][_0x098c('0xd6')]+'%'};return _0x435f3b;})});}_0x49fcb1=_[_0x098c('0x4f')]({},_0x49fcb1,_0x596810[_0x098c('0x50')]);return _0x31a13f[_0x098c('0xdf')](_0x49fcb1);}})[_0x098c('0x1d')](function(_0xf553a){if(_0xf553a){_0x487201=_0xf553a[_0x098c('0x44')];if(!_0x596810['query'][_0x098c('0xc2')](_0x098c('0xd4'))){_0x49fcb1[_0x098c('0x18')]=qs[_0x098c('0x18')](_0x596810[_0x098c('0x3b')]['limit']);_0x49fcb1[_0x098c('0x15')]=qs[_0x098c('0x15')](_0x596810[_0x098c('0x3b')][_0x098c('0x15')]);}return _0x31a13f['getChatInteractions'](_0x49fcb1);}})[_0x098c('0x1d')](function(_0x1ecfe9){if(_0x1ecfe9){return _0x1ecfe9?{'count':_0x487201,'rows':_0x1ecfe9}:null;}})['then'](respondWithResult(_0x2c704b,null))[_0x098c('0x4a')](handleError(_0x2c704b,null));};exports[_0x098c('0xe0')]=function(_0xa0be06,_0x5636d4){var _0x4b70cf={};var _0x1409cb={};var _0x10dfb5;var _0x47efea;return db['User'][_0x098c('0x8f')]({'where':{'id':_0xa0be06[_0x098c('0x4c')]['id']}})[_0x098c('0x1d')](handleEntityNotFound(_0x5636d4,null))[_0x098c('0x1d')](function(_0xdeb68a){if(_0xdeb68a){_0x10dfb5=_0xdeb68a;_0x1409cb[_0x098c('0xc9')]=_['keys'](db['OpenchannelInteraction'][_0x098c('0xcb')]);_0x1409cb[_0x098c('0x3b')]=_[_0x098c('0xcc')](_0xa0be06[_0x098c('0x3b')]);_0x1409cb[_0x098c('0xd1')]=_[_0x098c('0xcd')](_0x1409cb[_0x098c('0xc9')],_0x1409cb['query']);_0x4b70cf['attributes']=_[_0x098c('0xcd')](_0x1409cb[_0x098c('0xc9')],qs[_0x098c('0xce')](_0xa0be06[_0x098c('0x3b')][_0x098c('0xce')]));_0x4b70cf[_0x098c('0x3f')]=_0x4b70cf[_0x098c('0x3f')][_0x098c('0x44')]?_0x4b70cf[_0x098c('0x3f')]:_0x1409cb[_0x098c('0xc9')];_0x4b70cf[_0x098c('0xcf')]=qs[_0x098c('0xd0')](_0xa0be06['query'][_0x098c('0xd0')]);_0x4b70cf['where']=qs[_0x098c('0xd1')](_['pick'](_0xa0be06[_0x098c('0x3b')],_0x1409cb['filters']));if(_0xa0be06[_0x098c('0x3b')][_0x098c('0xd6')]){_0x4b70cf[_0x098c('0x3a')]=_[_0x098c('0x4f')](_0x4b70cf['where'],{'$or':_[_0x098c('0x26')](_0x4b70cf[_0x098c('0x3f')],function(_0x364dfb){var _0x441e6a={};_0x441e6a[_0x364dfb]={'$like':'%'+_0xa0be06['query'][_0x098c('0xd6')]+'%'};return _0x441e6a;})});}_0x4b70cf=_[_0x098c('0x4f')]({},_0x4b70cf,_0xa0be06[_0x098c('0x50')]);return _0x10dfb5[_0x098c('0xe0')](_0x4b70cf);}})[_0x098c('0x1d')](function(_0x5ef510){if(_0x5ef510){_0x47efea=_0x5ef510[_0x098c('0x44')];if(!_0xa0be06[_0x098c('0x3b')][_0x098c('0xc2')]('nolimit')){_0x4b70cf['limit']=qs['limit'](_0xa0be06[_0x098c('0x3b')][_0x098c('0x18')]);_0x4b70cf[_0x098c('0x15')]=qs['offset'](_0xa0be06[_0x098c('0x3b')]['offset']);}return _0x10dfb5[_0x098c('0xe0')](_0x4b70cf);}})[_0x098c('0x1d')](function(_0x5e42ef){if(_0x5e42ef){return _0x5e42ef?{'count':_0x47efea,'rows':_0x5e42ef}:null;}})[_0x098c('0x1d')](respondWithResult(_0x5636d4,null))[_0x098c('0x4a')](handleError(_0x5636d4,null));};exports['getMailInteractions']=function(_0x911d51,_0x301c37){var _0x1d7d9f={'raw':!![],'where':{}};var _0x3fb20e={};var _0x3f252d={'count':0x0,'rows':[]};return db[_0x098c('0x2e')][_0x098c('0x8f')]({'where':{'id':_0x911d51[_0x098c('0x4c')]['id']}})[_0x098c('0x1d')](handleEntityNotFound(_0x301c37,null))['then'](function(_0xc1ef71){if(_0xc1ef71){_0x3fb20e[_0x098c('0xc9')]=_[_0x098c('0xcc')](db[_0x098c('0xe1')]['rawAttributes']);_0x3fb20e[_0x098c('0x3b')]=_['keys'](_0x911d51[_0x098c('0x3b')]);_0x3fb20e[_0x098c('0xd1')]=_[_0x098c('0xcd')](_0x3fb20e['model'],_0x3fb20e[_0x098c('0x3b')]);_0x1d7d9f[_0x098c('0x3f')]=_[_0x098c('0xcd')](_0x3fb20e[_0x098c('0xc9')],qs[_0x098c('0xce')](_0x911d51[_0x098c('0x3b')][_0x098c('0xce')]));_0x1d7d9f[_0x098c('0x3f')]=_0x1d7d9f[_0x098c('0x3f')][_0x098c('0x44')]?_0x1d7d9f[_0x098c('0x3f')]:_0x3fb20e[_0x098c('0xc9')];if(!_0x911d51[_0x098c('0x3b')][_0x098c('0xc2')](_0x098c('0xd4'))){_0x1d7d9f['limit']=qs[_0x098c('0x18')](_0x911d51[_0x098c('0x3b')]['limit']);_0x1d7d9f[_0x098c('0x15')]=qs[_0x098c('0x15')](_0x911d51['query'][_0x098c('0x15')]);}_0x1d7d9f[_0x098c('0xcf')]=qs['sort'](_0x911d51['query']['sort']);_0x1d7d9f['where']=qs['filters'](_['pick'](_0x911d51[_0x098c('0x3b')],_0x3fb20e[_0x098c('0xd1')]));_0x1d7d9f[_0x098c('0x3a')][_0x098c('0xdd')]=_0xc1ef71['id'];if(_0x911d51[_0x098c('0x3b')][_0x098c('0xd6')]){_0x1d7d9f[_0x098c('0x3a')]=_[_0x098c('0x4f')](_0x1d7d9f[_0x098c('0x3a')],{'$or':_[_0x098c('0x26')](_0x1d7d9f['attributes'],function(_0x516b96){var _0x5a0480={};_0x5a0480[_0x516b96]={'$like':'%'+_0x911d51['query'][_0x098c('0xd6')]+'%'};return _0x5a0480;})});}_0x1d7d9f=_[_0x098c('0x4f')]({},_0x1d7d9f,_0x911d51[_0x098c('0x50')]);return db['MailInteraction'][_0x098c('0x17')]({'where':_0x1d7d9f[_0x098c('0x3a')]})[_0x098c('0x1d')](function(_0x2bca75){_0x3f252d['count']=_0x2bca75;if(_0x911d51['query'][_0x098c('0x3c')]){_0x1d7d9f['include']=[{'all':!![]}];}return db[_0x098c('0xe1')][_0x098c('0x41')](_0x1d7d9f);})[_0x098c('0x1d')](function(_0x133bcd){_0x3f252d['rows']=_0x133bcd;return _0x3f252d;});}})[_0x098c('0x1d')](respondWithFilteredResult(_0x301c37,_0x1d7d9f))[_0x098c('0x4a')](handleError(_0x301c37,null));};exports[_0x098c('0xe2')]=function(_0x57b1ec,_0x56491d){var _0x21d7aa={};var _0x9af98f={};var _0x2e951d;var _0x50b88b;return db[_0x098c('0x2e')]['findOne']({'where':{'id':_0x57b1ec[_0x098c('0x4c')]['id']}})[_0x098c('0x1d')](handleEntityNotFound(_0x56491d,null))[_0x098c('0x1d')](function(_0x5ab288){if(_0x5ab288){_0x2e951d=_0x5ab288;_0x9af98f['model']=_[_0x098c('0xcc')](db[_0x098c('0xe3')]['rawAttributes']);_0x9af98f['query']=_[_0x098c('0xcc')](_0x57b1ec[_0x098c('0x3b')]);_0x9af98f[_0x098c('0xd1')]=_[_0x098c('0xcd')](_0x9af98f[_0x098c('0xc9')],_0x9af98f[_0x098c('0x3b')]);_0x21d7aa[_0x098c('0x3f')]=_[_0x098c('0xcd')](_0x9af98f[_0x098c('0xc9')],qs[_0x098c('0xce')](_0x57b1ec[_0x098c('0x3b')][_0x098c('0xce')]));_0x21d7aa[_0x098c('0x3f')]=_0x21d7aa[_0x098c('0x3f')][_0x098c('0x44')]?_0x21d7aa[_0x098c('0x3f')]:_0x9af98f[_0x098c('0xc9')];_0x21d7aa[_0x098c('0xcf')]=qs[_0x098c('0xd0')](_0x57b1ec[_0x098c('0x3b')][_0x098c('0xd0')]);_0x21d7aa[_0x098c('0x3a')]=qs['filters'](_['pick'](_0x57b1ec[_0x098c('0x3b')],_0x9af98f[_0x098c('0xd1')]));if(_0x57b1ec[_0x098c('0x3b')]['filter']){_0x21d7aa[_0x098c('0x3a')]=_[_0x098c('0x4f')](_0x21d7aa[_0x098c('0x3a')],{'$or':_[_0x098c('0x26')](_0x21d7aa['attributes'],function(_0xebdc86){var _0xb254da={};_0xb254da[_0xebdc86]={'$like':'%'+_0x57b1ec[_0x098c('0x3b')][_0x098c('0xd6')]+'%'};return _0xb254da;})});}_0x21d7aa=_[_0x098c('0x4f')]({},_0x21d7aa,_0x57b1ec[_0x098c('0x50')]);return _0x2e951d[_0x098c('0xe2')](_0x21d7aa);}})[_0x098c('0x1d')](function(_0x59e962){if(_0x59e962){_0x50b88b=_0x59e962['length'];if(!_0x57b1ec[_0x098c('0x3b')][_0x098c('0xc2')](_0x098c('0xd4'))){_0x21d7aa['limit']=qs['limit'](_0x57b1ec[_0x098c('0x3b')][_0x098c('0x18')]);_0x21d7aa['offset']=qs[_0x098c('0x15')](_0x57b1ec[_0x098c('0x3b')][_0x098c('0x15')]);}return _0x2e951d[_0x098c('0xe2')](_0x21d7aa);}})[_0x098c('0x1d')](function(_0x404335){if(_0x404335){return _0x404335?{'count':_0x50b88b,'rows':_0x404335}:null;}})[_0x098c('0x1d')](respondWithResult(_0x56491d,null))['catch'](handleError(_0x56491d,null));};exports[_0x098c('0xe4')]=function(_0x51b8d8,_0x5592b3){var _0x331262={};var _0x3cc098={};var _0x26551d;var _0x45a530;return db[_0x098c('0x2e')][_0x098c('0x8f')]({'where':{'id':_0x51b8d8[_0x098c('0x4c')]['id']}})[_0x098c('0x1d')](handleEntityNotFound(_0x5592b3,null))[_0x098c('0x1d')](function(_0x1886c4){if(_0x1886c4){_0x26551d=_0x1886c4;_0x3cc098[_0x098c('0xc9')]=_[_0x098c('0xcc')](db[_0x098c('0xe5')][_0x098c('0xcb')]);_0x3cc098[_0x098c('0x3b')]=_[_0x098c('0xcc')](_0x51b8d8['query']);_0x3cc098[_0x098c('0xd1')]=_[_0x098c('0xcd')](_0x3cc098['model'],_0x3cc098[_0x098c('0x3b')]);_0x331262[_0x098c('0x3f')]=_[_0x098c('0xcd')](_0x3cc098['model'],qs[_0x098c('0xce')](_0x51b8d8[_0x098c('0x3b')][_0x098c('0xce')]));_0x331262[_0x098c('0x3f')]=_0x331262[_0x098c('0x3f')]['length']?_0x331262['attributes']:_0x3cc098[_0x098c('0xc9')];_0x331262[_0x098c('0xcf')]=qs[_0x098c('0xd0')](_0x51b8d8[_0x098c('0x3b')][_0x098c('0xd0')]);_0x331262['where']=qs['filters'](_[_0x098c('0xd2')](_0x51b8d8[_0x098c('0x3b')],_0x3cc098['filters']));if(_0x51b8d8[_0x098c('0x3b')][_0x098c('0xd6')]){_0x331262[_0x098c('0x3a')]=_[_0x098c('0x4f')](_0x331262[_0x098c('0x3a')],{'$or':_[_0x098c('0x26')](_0x331262[_0x098c('0x3f')],function(_0x31d7b6){var _0x1cadfb={};_0x1cadfb[_0x31d7b6]={'$like':'%'+_0x51b8d8[_0x098c('0x3b')][_0x098c('0xd6')]+'%'};return _0x1cadfb;})});}_0x331262=_[_0x098c('0x4f')]({},_0x331262,_0x51b8d8[_0x098c('0x50')]);return _0x26551d[_0x098c('0xe4')](_0x331262);}})[_0x098c('0x1d')](function(_0x1db315){if(_0x1db315){_0x45a530=_0x1db315[_0x098c('0x44')];if(!_0x51b8d8[_0x098c('0x3b')][_0x098c('0xc2')](_0x098c('0xd4'))){_0x331262[_0x098c('0x18')]=qs[_0x098c('0x18')](_0x51b8d8[_0x098c('0x3b')][_0x098c('0x18')]);_0x331262[_0x098c('0x15')]=qs['offset'](_0x51b8d8[_0x098c('0x3b')][_0x098c('0x15')]);}return _0x26551d[_0x098c('0xe4')](_0x331262);}})[_0x098c('0x1d')](function(_0x4e3eb3){if(_0x4e3eb3){return _0x4e3eb3?{'count':_0x45a530,'rows':_0x4e3eb3}:null;}})[_0x098c('0x1d')](respondWithResult(_0x5592b3,null))[_0x098c('0x4a')](handleError(_0x5592b3,null));};exports['getWhatsappInteractions']=function(_0x5f05c4,_0x32118a){var _0x3a7c15={};var _0x3a81f2={};var _0x30a73e;var _0xf76c9e;return db[_0x098c('0x2e')][_0x098c('0x8f')]({'where':{'id':_0x5f05c4[_0x098c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x32118a,null))[_0x098c('0x1d')](function(_0x3a1b68){if(_0x3a1b68){_0x30a73e=_0x3a1b68;_0x3a81f2[_0x098c('0xc9')]=_[_0x098c('0xcc')](db[_0x098c('0xe6')][_0x098c('0xcb')]);_0x3a81f2[_0x098c('0x3b')]=_[_0x098c('0xcc')](_0x5f05c4['query']);_0x3a81f2[_0x098c('0xd1')]=_['intersection'](_0x3a81f2[_0x098c('0xc9')],_0x3a81f2[_0x098c('0x3b')]);_0x3a7c15[_0x098c('0x3f')]=_['intersection'](_0x3a81f2[_0x098c('0xc9')],qs[_0x098c('0xce')](_0x5f05c4[_0x098c('0x3b')][_0x098c('0xce')]));_0x3a7c15['attributes']=_0x3a7c15[_0x098c('0x3f')][_0x098c('0x44')]?_0x3a7c15['attributes']:_0x3a81f2[_0x098c('0xc9')];_0x3a7c15['order']=qs[_0x098c('0xd0')](_0x5f05c4[_0x098c('0x3b')][_0x098c('0xd0')]);_0x3a7c15['where']=qs['filters'](_[_0x098c('0xd2')](_0x5f05c4[_0x098c('0x3b')],_0x3a81f2[_0x098c('0xd1')]));if(_0x5f05c4['query']['filter']){_0x3a7c15['where']=_[_0x098c('0x4f')](_0x3a7c15['where'],{'$or':_[_0x098c('0x26')](_0x3a7c15[_0x098c('0x3f')],function(_0x5ea1bb){var _0x28431={};_0x28431[_0x5ea1bb]={'$like':'%'+_0x5f05c4[_0x098c('0x3b')][_0x098c('0xd6')]+'%'};return _0x28431;})});}_0x3a7c15=_[_0x098c('0x4f')]({},_0x3a7c15,_0x5f05c4['options']);return _0x30a73e[_0x098c('0xe7')](_0x3a7c15);}})['then'](function(_0x27bbee){if(_0x27bbee){_0xf76c9e=_0x27bbee[_0x098c('0x44')];if(!_0x5f05c4['query'][_0x098c('0xc2')](_0x098c('0xd4'))){_0x3a7c15['limit']=qs[_0x098c('0x18')](_0x5f05c4[_0x098c('0x3b')][_0x098c('0x18')]);_0x3a7c15[_0x098c('0x15')]=qs['offset'](_0x5f05c4[_0x098c('0x3b')][_0x098c('0x15')]);}return _0x30a73e['getWhatsappInteractions'](_0x3a7c15);}})[_0x098c('0x1d')](function(_0x32d8ce){if(_0x32d8ce){return _0x32d8ce?{'count':_0xf76c9e,'rows':_0x32d8ce}:null;}})[_0x098c('0x1d')](respondWithResult(_0x32118a,null))[_0x098c('0x4a')](handleError(_0x32118a,null));};exports['login']=function(_0x40e09f,_0x52babf,_0x2fbf33){var _0x4fd4eb;var _0x99b7e7;var _0x4b0818;var _0x46cf00=!_['isNil'](_0x40e09f['params']['id'])?_0x40e09f['params']['id']:!_[_0x098c('0x5e')](_0x40e09f[_0x098c('0x22')]['id'])?_0x40e09f[_0x098c('0x22')]['id']:null;return db['User']['find']({'where':{'id':_0x46cf00,'role':{'$or':[_0x098c('0x20'),_0x098c('0x22'),'agent']}},'attributes':['id',_0x098c('0x2c'),_0x098c('0xe8'),_0x098c('0xe9'),_0x098c('0x1f'),'internal',_0x098c('0x96')]})[_0x098c('0x1d')](function(_0x225d11){if(_0x225d11){if(_0x225d11[_0x098c('0x1f')]==='agent'){_0x4fd4eb=_0x225d11;if(_0x40e09f[_0x098c('0x53')]['interface']){_0x4b0818=util[_0x098c('0xa1')](_0x098c('0xea'),_0x4fd4eb[_0x40e09f['body'][_0x098c('0x98')]]);}else if(_0x40e09f[_0x098c('0x53')][_0x098c('0xeb')]){_0x4b0818=util[_0x098c('0xa1')](_0x098c('0xa2'),_0x40e09f[_0x098c('0x53')][_0x098c('0xeb')]);}else{_0x4b0818=util[_0x098c('0xa1')]('SIP/%s',_0x4fd4eb[_0x098c('0x2c')]);}socket['to'](util[_0x098c('0xa1')]('user:%s',_0x4fd4eb['name']))[_0x098c('0x9f')](_0x098c('0xec'),{'user':{'id':_0x4fd4eb['id'],'name':_0x4fd4eb[_0x098c('0x2c')]},'ip':_0x40e09f['headers'][_0x098c('0xed')]||_0x40e09f[_0x098c('0xee')][_0x098c('0xef')]||_0x40e09f[_0x098c('0xf0')][_0x098c('0xef')]||_0x40e09f['connection'][_0x098c('0xf0')]['remoteAddress']});return db[_0x098c('0xa3')][_0x098c('0x1c')]({'where':{'membername':_0x4fd4eb['name']},'individualHooks':!![]});}}else{throw new db[(_0x098c('0x89'))][(_0x098c('0x8a'))](_0x098c('0xf1'));}})[_0x098c('0x1d')](function(){if(_0x4fd4eb){return _0x4fd4eb[_0x098c('0xf2')]({'raw':!![]});}})['then'](function(_0x4dc14e){if(_0x4fd4eb){if(_0x4dc14e){_0x99b7e7=_0x4dc14e;if(_0x99b7e7[_0x098c('0x44')]){var _0x91b6e6=_0x99b7e7[_0x098c('0x26')](function(_0x3befad){var _0xb9b885={'membername':_0x4fd4eb[_0x098c('0x2c')],'UserId':_0x4fd4eb['id'],'queue_name':_0x3befad[_0x098c('0x2c')],'VoiceQueueId':_0x3befad['id'],'interface':_0x4b0818,'paused':_0x4fd4eb['loginInPause']||![],'penalty':_0x3befad[_0x098c('0xf3')]||0x0};return db[_0x098c('0xa3')][_0x098c('0xa4')](_0xb9b885);});return Promise[_0x098c('0x49')](_0x91b6e6);}}}})['then'](function(){if(_0x4fd4eb){return db[_0x098c('0xf4')][_0x098c('0x41')]({'where':{'membername':_0x4fd4eb[_0x098c('0x2c')],'exitAt':null}});}})[_0x098c('0x1d')](function(_0x58fbb6){if(_0x4fd4eb){var _0x355948=[];_0x58fbb6['forEach'](function(_0x26e385){_0x355948['push'](_0x26e385[_0x098c('0x52')]({'exitAt':moment()[_0x098c('0xa1')](_0x098c('0xf5'))}));});return Promise[_0x098c('0x49')](_0x355948);}})[_0x098c('0x1d')](function(){if(_0x4fd4eb){var _0x51f8c9=[];var _0x5adb79=[];var _0x4d2ee6=utils[_0x098c('0xf6')]();var _0x2ab777={'membername':_0x4fd4eb[_0x098c('0x2c')],'interface':_0x4b0818,'enterAt':moment()[_0x098c('0xa1')](_0x098c('0xf5')),'role':_0x4fd4eb[_0x098c('0x1f')],'internal':_0x4fd4eb[_0x098c('0x58')]};_0x4d2ee6[_0x098c('0xf7')](function(_0xe7d2a2){_0x51f8c9[_0x098c('0x40')](_['merge']({'channel':_0xe7d2a2,'type':_0x098c('0xf8'),'data1':_0x40e09f[_0x098c('0x53')][_0x098c('0xf9')],'data2':_0x4b0818},_0x2ab777));if(_0x4fd4eb[_0x098c('0x96')]){_0x5adb79['push'](_[_0x098c('0x4f')]({'channel':_0xe7d2a2,'type':_0x098c('0xfa'),'data1':_0x098c('0xfb')},_0x2ab777));}});return db[_0x098c('0xf4')]['bulkCreate'](_0x51f8c9[_0x098c('0xbf')](_0x5adb79),{'individualHooks':!![]});}})[_0x098c('0x1d')](function(){if(_0x4fd4eb){return _0x4fd4eb[_0x098c('0x52')]({'online':!![],'lastLoginAt':moment()['format'](_0x098c('0xf5')),'voicePause':_0x4fd4eb['loginInPause']||![],'mailPause':_0x4fd4eb[_0x098c('0x96')]||![],'chatPause':_0x4fd4eb[_0x098c('0x96')]||![],'faxPause':_0x4fd4eb['loginInPause']||![],'smsPause':_0x4fd4eb[_0x098c('0x96')]||![],'openchannelPause':_0x4fd4eb[_0x098c('0x96')]||![],'whatsappPause':_0x4fd4eb[_0x098c('0x96')]||![],'pauseType':_0x4fd4eb['loginInPause']?_0x098c('0xfb'):null,'interface':_0x4b0818,'lastPauseAt':moment()[_0x098c('0xa1')](_0x098c('0xf5'))});}})[_0x098c('0x1d')](function(_0x21a479){if(_0x40e09f[_0x098c('0xfc')]){return _0x2fbf33();}else{return Promise[_0x098c('0xfd')](_0x21a479)[_0x098c('0x1d')](respondWithResult(_0x52babf,null));}})[_0x098c('0x4a')](handleError(_0x52babf,null));};exports[_0x098c('0xfe')]=function(_0xd02fc5,_0x46eede){var _0x4c8b9d;return db[_0x098c('0x2e')][_0x098c('0x29')]({'where':{'id':_0xd02fc5['params']['id'],'role':_0x098c('0x1a')},'attributes':['id','name',_0x098c('0x1f')]})[_0x098c('0x1d')](handleEntityNotFound(_0x46eede,null))[_0x098c('0x1d')](function(_0x2c91e7){if(_0x2c91e7){_0x4c8b9d=_0x2c91e7;return db[_0x098c('0xa3')][_0x098c('0x1c')]({'where':{'membername':_0x4c8b9d[_0x098c('0x2c')]},'individualHooks':!![]});}})[_0x098c('0x1d')](function(){return db[_0x098c('0xf4')][_0x098c('0x41')]({'where':{'membername':_0x4c8b9d[_0x098c('0x2c')],'exitAt':null}});})['then'](function(_0x459942){var _0x34c675=[];_0x459942['forEach'](function(_0xc771ed){_0x34c675[_0x098c('0x40')](_0xc771ed[_0x098c('0x52')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise[_0x098c('0x49')](_0x34c675);})[_0x098c('0x1d')](function(){return _0x4c8b9d[_0x098c('0x52')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x098c('0x1d')](respondWithResult(_0x46eede,null))[_0x098c('0x4a')](handleError(_0x46eede,null));};exports['pause']=function(_0x411a94,_0x563f10){var _0x37ce6f;return db[_0x098c('0xa3')][_0x098c('0x52')]({'paused':0x1},{'where':{'UserId':_0x411a94[_0x098c('0x4c')]['id']},'individualHooks':!![]})[_0x098c('0x1d')](function(){return db[_0x098c('0x2e')][_0x098c('0x29')]({'where':{'id':_0x411a94[_0x098c('0x4c')]['id'],'role':_0x098c('0x1a')},'attributes':['id',_0x098c('0x2c'),_0x098c('0x1f'),'internal','interface',_0x098c('0x95')]});})[_0x098c('0x1d')](handleEntityNotFound(_0x563f10,null))['then'](function(_0x9aedb1){if(_0x9aedb1){_0x37ce6f=_0x9aedb1;return db[_0x098c('0xf4')][_0x098c('0x41')]({'where':{'membername':_0x37ce6f[_0x098c('0x2c')],'type':_0x098c('0xfa'),'exitAt':null}});}})[_0x098c('0x1d')](function(_0x1fce15){if(_0x1fce15['length']){var _0x8dd79c=moment()['format'](_0x098c('0xf5'));for(var _0x431b88=0x0,_0xfdd656=_0x1fce15[_0x098c('0x44')];_0x431b88<_0xfdd656;_0x431b88++){_0x1fce15[_0x431b88][_0x098c('0xff')]({'exitAt':_0x8dd79c});}}})[_0x098c('0x1d')](function(){var _0xaa219b=[];var _0x27fc9f=utils[_0x098c('0xf6')]();_0x27fc9f[_0x098c('0xf7')](function(_0x186ae8){_0xaa219b[_0x098c('0x40')]({'channel':_0x186ae8,'membername':_0x37ce6f['name'],'interface':_[_0x098c('0x5e')](_0x37ce6f[_0x098c('0x98')])?util[_0x098c('0xa1')](_0x098c('0xa2'),_0x37ce6f[_0x098c('0x2c')]):_0x37ce6f[_0x098c('0x98')],'type':_0x098c('0xfa'),'enterAt':moment()[_0x098c('0xa1')](_0x098c('0xf5')),'data1':_0x411a94[_0x098c('0x53')][_0x098c('0x2f')]||_0x098c('0x100'),'role':_0x37ce6f[_0x098c('0x1f')],'internal':_0x37ce6f[_0x098c('0x58')]});});return db[_0x098c('0xf4')][_0x098c('0x101')](_0xaa219b,{'individualHooks':!![]});})['then'](function(){return _0x37ce6f['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x411a94[_0x098c('0x53')]['type']||'DEFAULT\x20PAUSE','lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});})[_0x098c('0x1d')](respondWithResult(_0x563f10,null))[_0x098c('0x4a')](handleError(_0x563f10,null));};exports[_0x098c('0x102')]=function(_0xc63c9b,_0xb762cc){if(_0xc63c9b['body']['channel']&&!utils[_0x098c('0x103')](_0xc63c9b[_0x098c('0x53')][_0x098c('0xa5')])){throw new APIBadRequestError(util[_0x098c('0xa1')](_0x098c('0x104'),_0xc63c9b[_0x098c('0x53')]['channel']));}return db[_0x098c('0x2e')][_0x098c('0x29')]({'where':{'id':_0xc63c9b[_0x098c('0x4c')]['id']},'attributes':['id',_0x098c('0x2c'),'role',_0x098c('0x58'),_0x098c('0x98'),_0x098c('0x95'),'voicePause',_0x098c('0x105'),'chatPause',_0x098c('0x106'),_0x098c('0x107'),'smsPause',_0x098c('0x108'),_0x098c('0x109'),'lastPauseAt']})[_0x098c('0x1d')](function(_0x45ad90){if(!_0x45ad90){throw new APINotFoundError(util[_0x098c('0xa1')]('User\x20with\x20id\x20%s\x20not\x20found',_0xc63c9b[_0x098c('0x4c')]['id']));}return _0x45ad90[_0x098c('0x102')](_0xc63c9b[_0x098c('0x53')][_0x098c('0xa5')]);})['then'](respondWithResult(_0xb762cc,null))[_0x098c('0x4a')](APIHandleError(_0xb762cc));};exports[_0x098c('0x10a')]=function(_0x3528f2,_0x2c937a){var _0x13ffdc={};var _0x81e64c={};var _0x5776e0;var _0xe9c45b;return db['User']['findOne']({'where':{'id':_0x3528f2['params']['id']}})['then'](handleEntityNotFound(_0x2c937a,null))[_0x098c('0x1d')](function(_0x4f3270){if(_0x4f3270){_0x5776e0=_0x4f3270;_0x81e64c[_0x098c('0xc9')]=_['keys'](db[_0x098c('0x10b')]['rawAttributes']);_0x81e64c[_0x098c('0x3b')]=_[_0x098c('0xcc')](_0x3528f2['query']);_0x81e64c[_0x098c('0xd1')]=_[_0x098c('0xcd')](_0x81e64c[_0x098c('0xc9')],_0x81e64c[_0x098c('0x3b')]);_0x13ffdc[_0x098c('0x3f')]=_[_0x098c('0xcd')](_0x81e64c[_0x098c('0xc9')],qs[_0x098c('0xce')](_0x3528f2[_0x098c('0x3b')][_0x098c('0xce')]));_0x13ffdc[_0x098c('0x3f')]=_0x13ffdc['attributes'][_0x098c('0x44')]?_0x13ffdc['attributes']:_0x81e64c[_0x098c('0xc9')];_0x13ffdc[_0x098c('0xcf')]=qs[_0x098c('0xd0')](_0x3528f2[_0x098c('0x3b')]['sort']);_0x13ffdc[_0x098c('0x3a')]=qs[_0x098c('0xd1')](_[_0x098c('0xd2')](_0x3528f2['query'],_0x81e64c['filters']));if(_0x3528f2['query'][_0x098c('0xd6')]){_0x13ffdc['where']=_[_0x098c('0x4f')](_0x13ffdc['where'],{'$or':_[_0x098c('0x26')](_0x13ffdc[_0x098c('0x3f')],function(_0x116ccc){var _0x5ea63a={};_0x5ea63a[_0x116ccc]={'$like':'%'+_0x3528f2[_0x098c('0x3b')][_0x098c('0xd6')]+'%'};return _0x5ea63a;})});}_0x13ffdc=_[_0x098c('0x4f')]({},_0x13ffdc,_0x3528f2['options']);return _0x5776e0['getTeams'](_0x13ffdc);}})[_0x098c('0x1d')](function(_0x174011){if(_0x174011){_0xe9c45b=_0x174011[_0x098c('0x44')];if(!_0x3528f2[_0x098c('0x3b')]['hasOwnProperty']('nolimit')){_0x13ffdc[_0x098c('0x18')]=qs['limit'](_0x3528f2[_0x098c('0x3b')]['limit']);_0x13ffdc[_0x098c('0x15')]=qs[_0x098c('0x15')](_0x3528f2[_0x098c('0x3b')][_0x098c('0x15')]);}return _0x5776e0['getTeams'](_0x13ffdc);}})[_0x098c('0x1d')](function(_0x36b080){if(_0x36b080){return _0x36b080?{'count':_0xe9c45b,'rows':_0x36b080}:null;}})[_0x098c('0x1d')](respondWithResult(_0x2c937a,null))['catch'](handleError(_0x2c937a,null));};exports[_0x098c('0x10c')]=function(_0x41a371,_0x52b8b1){var _0x300231=_0x41a371[_0x098c('0x4c')]['id'];var _0x456121=_0x41a371['body']?_0x41a371[_0x098c('0x53')][_0x098c('0x56')]:null;var _0x39c2a0=[];return Promise[_0x098c('0xfd')]()['then'](function(){if(!_0x456121)throw new APIBadRequestError(_0x098c('0x10d'));})['then'](function(){return db['User'][_0x098c('0x8f')]({'where':{'id':_0x300231}});})[_0x098c('0x1d')](function(_0x3feaaa){if(!_0x3feaaa)throw new APINotFoundError(util[_0x098c('0xa1')]('User\x20with\x20id\x20%s\x20not\x20found',_0x41a371[_0x098c('0x4c')]['id']));return db['sequelize']['transaction'](function(_0x5b33ac){return _0x3feaaa[_0x098c('0x10c')](_0x456121,{'transaction':_0x5b33ac})['then'](function(){return db[_0x098c('0x10b')]['findAll']({'where':{'id':{'$in':_0x456121}}});})['then'](function(_0x934452){var _0x593fba=_[_0x098c('0x26')](_0x934452,function(_0x470f97){return _0x470f97[_0x098c('0x10e')]();});return Promise['all'](_0x593fba);})[_0x098c('0x1d')](function(_0x5e23e2){_0x39c2a0=_[_0x098c('0x10f')](_0x5e23e2);var _0x5acd01=_[_0x098c('0x26')](_0x39c2a0,function(_0x3ecd7b){return _0x3ecd7b['addAgent'](_0x3feaaa['id'],{'transaction':_0x5b33ac});});return Promise[_0x098c('0x49')](_0x5acd01);})['then'](function(){if(!_0x3feaaa[_0x098c('0x95')])return;var _0x45ea63=_['filter'](_0x39c2a0,function(_0x325dc7){return _0x325dc7['getDataValue'](_0x098c('0xa5'))===_0x098c('0x110');});var _0xd1cd0d=_[_0x098c('0x26')](_0x45ea63,function(_0x38419f){return db[_0x098c('0xa3')]['upsert']({'membername':_0x3feaaa[_0x098c('0x2c')],'UserId':_0x3feaaa['id'],'queue_name':_0x38419f[_0x098c('0x2c')],'VoiceQueueId':_0x38419f['id'],'interface':_[_0x098c('0x5e')](_0x3feaaa['interface'])?util['format'](_0x098c('0xa2'),_0x3feaaa[_0x098c('0x2c')]):_0x3feaaa['interface'],'paused':_0x3feaaa[_0x098c('0x97')]||![],'penalty':_0x3feaaa['penalty']},{'transaction':_0x5b33ac});});return Promise[_0x098c('0x49')](_0xd1cd0d);})[_0x098c('0x1d')](function(){return db[_0x098c('0x111')]['findAll']({'where':{'teamId':{'$in':_0x456121}}});})[_0x098c('0x1d')](function(_0x1b3298){var _0x5406b4=_[_0x098c('0x26')](_0x1b3298,function(_0x5175ac){return db[_0x098c('0x112')][_0x098c('0x7b')]({'UserId':_0x3feaaa['id'],'VoicePrefixId':_0x5175ac['VoicePrefixId']},{'transaction':_0x5b33ac});});return Promise[_0x098c('0x49')](_0x5406b4);});});})[_0x098c('0x1d')](function(){for(var _0xcb4d2f=0x0;_0xcb4d2f<_0x39c2a0[_0x098c('0x44')];_0xcb4d2f++){var _0x16c66d=_0x39c2a0[_0xcb4d2f][_0x098c('0x113')]('channel');var _0x50d6e5=_0x16c66d+'QueueId';socket[_0x098c('0x9f')](_0x098c('0x22')+_0x16c66d+_0x098c('0xa0'),{'UserId':_0x300231,['queueField']:_0x39c2a0[_0xcb4d2f]['id']});}})[_0x098c('0x1d')](respondWithStatusCode(_0x52b8b1,null))['catch'](APIHandleError(_0x52b8b1));};exports['removeTeams']=function(_0x331b4d,_0x166ab2){var _0x281f8f=_0x331b4d['params']['id'];var _0x169492=null;if(_0x331b4d[_0x098c('0x3b')][_0x098c('0x56')]){_0x169492=_[_0x098c('0xa6')](_0x331b4d[_0x098c('0x3b')]['ids'])?_0x331b4d[_0x098c('0x3b')][_0x098c('0x56')]:[_0x331b4d[_0x098c('0x3b')]['ids']];}var _0xfa7f7f=[];return Promise[_0x098c('0xfd')]()[_0x098c('0x1d')](function(){if(!_0x169492)throw new APIBadRequestError('Query\x20parameter\x20\x27ids\x27\x20is\x20required');})[_0x098c('0x1d')](function(){return db[_0x098c('0x2e')][_0x098c('0x8f')]({'where':{'id':_0x281f8f}});})[_0x098c('0x1d')](function(_0x48c521){if(!_0x48c521)throw new APINotFoundError(util[_0x098c('0xa1')](_0x098c('0xc1'),_0x331b4d[_0x098c('0x4c')]['id']));return db[_0x098c('0x60')][_0x098c('0x114')](function(_0x3a0610){return _0x48c521[_0x098c('0x115')](_0x169492,{'transaction':_0x3a0610})[_0x098c('0x1d')](function(){return db['Team'][_0x098c('0x41')]({'where':{'id':{'$in':_0x169492}}});})[_0x098c('0x1d')](function(_0x137620){var _0x42ad59=_[_0x098c('0x26')](_0x137620,function(_0x4cc6bf){return _0x4cc6bf[_0x098c('0x10e')]();});return Promise[_0x098c('0x49')](_0x42ad59);})['then'](function(_0x25e01c){_0xfa7f7f=_[_0x098c('0x10f')](_0x25e01c);var _0x7a1ba5=_[_0x098c('0x26')](_0xfa7f7f,function(_0x408dd5){return _0x408dd5[_0x098c('0x116')](_0x48c521['id'],{'transaction':_0x3a0610});});return Promise[_0x098c('0x49')](_0x7a1ba5);})['then'](function(){if(!_0x48c521['online'])return;var _0xeb7080=_[_0x098c('0xd6')](_0xfa7f7f,function(_0x17c9bd){return _0x17c9bd[_0x098c('0x113')](_0x098c('0xa5'))===_0x098c('0x110');});var _0xf2ee60=_[_0x098c('0x26')](_0xeb7080,function(_0x439b31){return db[_0x098c('0xa3')][_0x098c('0x1c')]({'where':{'VoiceQueueId':_0x439b31['id'],'UserId':_0x48c521['id']},'transaction':_0x3a0610});});return Promise[_0x098c('0x49')](_0xf2ee60);})['then'](function(){return db[_0x098c('0x111')]['findAll']({'where':{'teamId':{'$in':_0x169492}}});})['then'](function(_0x1d38bc){var _0x5772d3=_[_0x098c('0x26')](_0x1d38bc,function(_0x373bb6){return db[_0x098c('0x112')][_0x098c('0x1c')]({'where':{'UserId':_0x48c521['id'],'VoicePrefixId':_0x373bb6[_0x098c('0x117')]}},{'transaction':_0x3a0610});});return Promise[_0x098c('0x49')](_0x5772d3);});});})['then'](function(){for(var _0x5bfe15=0x0;_0x5bfe15<_0xfa7f7f[_0x098c('0x44')];_0x5bfe15++){var _0x1f2391=_0xfa7f7f[_0x5bfe15][_0x098c('0x113')](_0x098c('0xa5'));var _0x2d93f8=_0x1f2391+'QueueId';socket[_0x098c('0x9f')]('user'+_0x1f2391+_0x098c('0xa7'),{'UserId':_0x281f8f,['queueField']:_0xfa7f7f[_0x5bfe15]['id']});}})[_0x098c('0x1d')](respondWithStatusCode(_0x166ab2,null))[_0x098c('0x4a')](APIHandleError(_0x166ab2));};exports[_0x098c('0x118')]=function(_0x32461a,_0x19870c){var _0x1b6c6a={};var _0x1acb49={};var _0x4e2ad9;var _0x2de5cc;return db[_0x098c('0x2e')][_0x098c('0x8f')]({'where':{'id':_0x32461a[_0x098c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x19870c,null))[_0x098c('0x1d')](function(_0x4ed2b0){if(_0x4ed2b0){_0x4e2ad9=_0x4ed2b0;_0x1acb49[_0x098c('0xc9')]=_[_0x098c('0xcc')](db['CmList']['rawAttributes']);_0x1acb49[_0x098c('0x3b')]=_['keys'](_0x32461a[_0x098c('0x3b')]);_0x1acb49['filters']=_[_0x098c('0xcd')](_0x1acb49[_0x098c('0xc9')],_0x1acb49['query']);_0x1b6c6a[_0x098c('0x3f')]=_['intersection'](_0x1acb49['model'],qs['fields'](_0x32461a[_0x098c('0x3b')]['fields']));_0x1b6c6a[_0x098c('0x3f')]=_0x1b6c6a[_0x098c('0x3f')][_0x098c('0x44')]?_0x1b6c6a[_0x098c('0x3f')]:_0x1acb49[_0x098c('0xc9')];_0x1b6c6a[_0x098c('0xcf')]=qs['sort'](_0x32461a[_0x098c('0x3b')][_0x098c('0xd0')]);_0x1b6c6a['where']=qs['filters'](_[_0x098c('0xd2')](_0x32461a[_0x098c('0x3b')],_0x1acb49[_0x098c('0xd1')]));if(_0x32461a[_0x098c('0x3b')][_0x098c('0xd6')]){_0x1b6c6a[_0x098c('0x3a')]=_[_0x098c('0x4f')](_0x1b6c6a[_0x098c('0x3a')],{'$or':_[_0x098c('0x26')](_0x1b6c6a[_0x098c('0x3f')],function(_0x29fffa){var _0x275a9b={};_0x275a9b[_0x29fffa]={'$like':'%'+_0x32461a['query'][_0x098c('0xd6')]+'%'};return _0x275a9b;})});}_0x1b6c6a=_[_0x098c('0x4f')]({},_0x1b6c6a,_0x32461a[_0x098c('0x50')]);return _0x4e2ad9[_0x098c('0x118')](_0x1b6c6a);}})[_0x098c('0x1d')](function(_0x1a0b6d){if(_0x1a0b6d){_0x2de5cc=_0x1a0b6d['length'];if(!_0x32461a['query']['hasOwnProperty'](_0x098c('0xd4'))){_0x1b6c6a[_0x098c('0x18')]=qs[_0x098c('0x18')](_0x32461a[_0x098c('0x3b')][_0x098c('0x18')]);_0x1b6c6a[_0x098c('0x15')]=qs['offset'](_0x32461a['query'][_0x098c('0x15')]);}return _0x4e2ad9[_0x098c('0x118')](_0x1b6c6a);}})['then'](function(_0x163fc6){if(_0x163fc6){return _0x163fc6?{'count':_0x2de5cc,'rows':_0x163fc6}:null;}})[_0x098c('0x1d')](respondWithResult(_0x19870c,null))[_0x098c('0x4a')](handleError(_0x19870c,null));};exports[_0x098c('0x119')]=function(_0x1428e9,_0xdcf244){var _0x3e28a8={};var _0x341090={};var _0x153ddf;return db[_0x098c('0x2e')]['findOne']({'where':{'id':_0x1428e9['params']['id']}})[_0x098c('0x1d')](handleEntityNotFound(_0xdcf244,null))[_0x098c('0x1d')](function(_0x4f375a){if(_0x4f375a){_0x153ddf=_0x4f375a;_0x341090['model']=_[_0x098c('0xcc')](db[_0x098c('0x2e')][_0x098c('0xcb')]);_0x341090[_0x098c('0x3b')]=_[_0x098c('0xcc')](_0x1428e9['query']);_0x341090[_0x098c('0xd1')]=_[_0x098c('0xcd')](_0x341090[_0x098c('0xc9')],_0x341090['query']);_0x3e28a8[_0x098c('0x3f')]=_[_0x098c('0xcd')](_0x341090[_0x098c('0xc9')],qs[_0x098c('0xce')](_0x1428e9[_0x098c('0x3b')][_0x098c('0xce')]));_0x3e28a8[_0x098c('0x3f')]=_0x3e28a8['attributes'][_0x098c('0x44')]?_0x3e28a8[_0x098c('0x3f')]:_0x341090[_0x098c('0xc9')];_0x3e28a8[_0x098c('0xcf')]=qs[_0x098c('0xd0')](_0x1428e9[_0x098c('0x3b')]['sort']);_0x3e28a8[_0x098c('0x3a')]=qs[_0x098c('0xd1')](_[_0x098c('0xd2')](_0x1428e9['query'],_0x341090['filters']));if(_0x1428e9[_0x098c('0x3b')][_0x098c('0xd6')]){_0x3e28a8[_0x098c('0x3a')]=_[_0x098c('0x4f')](_0x3e28a8[_0x098c('0x3a')],{'$or':_[_0x098c('0x26')](_0x3e28a8['attributes'],function(_0x13b57c){var _0x1129a3={};_0x1129a3[_0x13b57c]={'$like':'%'+_0x1428e9[_0x098c('0x3b')][_0x098c('0xd6')]+'%'};return _0x1129a3;})});}_0x3e28a8[_0x098c('0xc9')]=db[_0x098c('0x2e')];_0x3e28a8['as']=_0x098c('0x23');_0x3e28a8=_[_0x098c('0x4f')]({},_0x3e28a8,_0x1428e9[_0x098c('0x50')]);return _0x153ddf[_0x098c('0xf2')]({'include':[_0x3e28a8]});}})[_0x098c('0x1d')](function(_0x1ac4e4){if(_0x1ac4e4){var _0x2d72df={},_0x6de4c=[];for(var _0x50679f=0x0;_0x50679f<_0x1ac4e4[_0x098c('0x44')];_0x50679f+=0x1){for(var _0x2db192=0x0,_0x1ce47f;_0x2db192<_0x1ac4e4[_0x50679f]['Agents'][_0x098c('0x44')];_0x2db192+=0x1){_0x1ce47f=_0x1ac4e4[_0x50679f]['Agents'][_0x2db192][_0x098c('0x1e')]({'plain':!![]});_0x2d72df[_0x1ce47f['id']]=_0x1ce47f;}}_0x2d72df=_[_0x098c('0x11a')](_0x2d72df);for(var _0x617228=qs['offset'](_0x1428e9[_0x098c('0x3b')]['offset']);_0x617228<_0x2d72df[_0x098c('0x44')]&&_0x6de4c[_0x098c('0x44')]=_0x31f8ba[_0xb5c9('0x48')]){throw new Error(_0xb5c9('0x49'));}})[_0xb5c9('0x12')](function(){if(_0x1fe865){return db[_0xb5c9('0x40')][_0xb5c9('0x41')]({'where':{'membername':_0x1fe865['name']},'individualHooks':!![]});}})[_0xb5c9('0x12')](function(){if(_0x1fe865){return _0x1fe865['getVoiceQueues']({'raw':!![]});}})[_0xb5c9('0x12')](function(_0x3106b5){if(_0x1fe865){if(_0x3106b5){var _0xb97c81=[];_0x57f100=_0x3106b5;if(_0x57f100[_0xb5c9('0x26')]){for(var _0x504a7e=0x0;_0x504a7e<_0x57f100['length'];_0x504a7e++){_0xb97c81[_0xb5c9('0x29')](db['UserVoiceQueueRt']['upsert']({'membername':_0x1fe865[_0xb5c9('0x1e')],'UserId':_0x1fe865['id'],'queue_name':_0x57f100[_0x504a7e][_0xb5c9('0x1e')],'VoiceQueueId':_0x57f100[_0x504a7e]['id'],'interface':_0x38327b,'paused':_0x1fe865[_0xb5c9('0x44')]||![],'penalty':_0x57f100[_0x504a7e][_0xb5c9('0x4a')]||0x0}));}return BPromise[_0xb5c9('0x42')](_0xb97c81);}}}})[_0xb5c9('0x12')](function(){if(_0x1fe865){return db['MemberReport'][_0xb5c9('0x24')]({'where':{'membername':_0x1fe865[_0xb5c9('0x1e')],'exitAt':null}});}})['then'](function(_0x1536da){if(_0x1fe865){if(_0x1536da&&_0x1536da[_0xb5c9('0x26')]){var _0x3ae0e5=[];_0x1536da['forEach'](function(_0x41b904){_0x3ae0e5[_0xb5c9('0x29')](_0x41b904[_0xb5c9('0x22')]({'exitAt':moment()[_0xb5c9('0x20')](_0xb5c9('0x2c'))}));});return BPromise[_0xb5c9('0x42')](_0x3ae0e5);}}})['then'](function(){if(_0x1fe865){var _0x1c553e=[];var _0x4cc16b=[];var _0x5982b5=utils[_0xb5c9('0x28')]();var _0x15155e={'membername':_0x1fe865[_0xb5c9('0x1e')],'interface':_0x38327b,'enterAt':moment()[_0xb5c9('0x20')](_0xb5c9('0x2c')),'role':_0x1fe865[_0xb5c9('0x1f')],'internal':_0x1fe865[_0xb5c9('0x34')]};_0x5982b5[_0xb5c9('0x4b')](function(_0x971d8){_0x1c553e[_0xb5c9('0x29')](_[_0xb5c9('0x4c')]({'channel':_0x971d8,'type':'LOGIN','data1':_0xb5c9('0x4d'),'data2':_0x38327b},_0x15155e));if(_0x1fe865[_0xb5c9('0x44')]){_0x4cc16b[_0xb5c9('0x29')](_['merge']({'channel':_0x971d8,'type':_0xb5c9('0x25'),'data1':_0xb5c9('0x4e')},_0x15155e));}});return db[_0xb5c9('0x23')][_0xb5c9('0x30')](_0x1c553e['concat'](_0x4cc16b),{'individualHooks':!![]});}})[_0xb5c9('0x12')](function(){if(_0x1fe865){return _0x1fe865[_0xb5c9('0x22')]({'online':!![],'lastLoginAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x1fe865['loginInPause']||![],'mailPause':_0x1fe865[_0xb5c9('0x44')]||![],'chatPause':_0x1fe865[_0xb5c9('0x44')]||![],'faxPause':_0x1fe865['loginInPause']||![],'smsPause':_0x1fe865['loginInPause']||![],'openchannelPause':_0x1fe865[_0xb5c9('0x44')]||![],'pauseType':_0x1fe865[_0xb5c9('0x44')]?_0xb5c9('0x4e'):null,'lastPauseAt':moment()[_0xb5c9('0x20')](_0xb5c9('0x2c')),'interface':_0x38327b});}})[_0xb5c9('0x12')](function(_0x1c93f3){_0x550131(_0x1c93f3);})[_0xb5c9('0x16')](function(_0x484b40){_0xd5694f(_0x23c4b2[_0xb5c9('0x18')](0x1f4,_0x484b40[_0xb5c9('0x17')]));});});}; \ No newline at end of file +var _0x654d=['unpause','LogoutUser','destroy','LoginUser','mobile','internal','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','loginInPause','all','LOGIN','callysquare','merge','LOGININPAUSE','concat','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','./user.socket','register','GetUser','User','findAll','raw','options','attributes','include','map','model','then','info','stringify','catch','error','message','find','where','debug','ShowUser','PauseUser','role','format','params','UserVoiceQueueRt','update','MemberReport','name','PAUSE','length','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','getChannels','forEach','push','isNil','interface','body','DEFAULT\x20PAUSE','uniqueid','bulkCreate','resolve','channel','isValidChannel','Channel\x20parameter\x20%s\x20is\x20invalid','findOne','online','voicePause','chatPause','openchannelPause','smsPause','whatsappPause','pauseType'];(function(_0x39a82a,_0x23ee9f){var _0x5af9e5=function(_0x2a0586){while(--_0x2a0586){_0x39a82a['push'](_0x39a82a['shift']());}};_0x5af9e5(++_0x23ee9f);}(_0x654d,0x1bc));var _0xd654=function(_0x3d5fec,_0x5614ef){_0x3d5fec=_0x3d5fec-0x0;var _0x3cc5ed=_0x654d[_0x3d5fec];return _0x3cc5ed;};'use strict';var _=require(_0xd654('0x0'));var util=require(_0xd654('0x1'));var moment=require(_0xd654('0x2'));var BPromise=require(_0xd654('0x3'));var Redis=require('ioredis');var db=require(_0xd654('0x4'))['db'];var utils=require(_0xd654('0x5'));var logger=require(_0xd654('0x6'))(_0xd654('0x7'));var config=require(_0xd654('0x8'));config[_0xd654('0x9')]=_[_0xd654('0xa')](config['redis'],{'host':_0xd654('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd654('0x9')]));require(_0xd654('0xc'))[_0xd654('0xd')](socket);exports[_0xd654('0xe')]=function(_0x1ecb45){var _0x39fbe8=this;return new Promise(function(_0x2e6fe8,_0x4d863c){return db[_0xd654('0xf')][_0xd654('0x10')]({'raw':_0x1ecb45['options']?_0x1ecb45['options'][_0xd654('0x11')]===undefined?!![]:![]:!![],'where':_0x1ecb45[_0xd654('0x12')]?_0x1ecb45['options']['where']||null:null,'attributes':_0x1ecb45['options']?_0x1ecb45[_0xd654('0x12')][_0xd654('0x13')]||null:null,'limit':_0x1ecb45['options']?_0x1ecb45[_0xd654('0x12')]['limit']||null:null,'include':_0x1ecb45[_0xd654('0x12')]?_0x1ecb45[_0xd654('0x12')][_0xd654('0x14')]?_[_0xd654('0x15')](_0x1ecb45['options'][_0xd654('0x14')],function(_0x316671){return{'model':db[_0x316671[_0xd654('0x16')]],'as':_0x316671['as'],'attributes':_0x316671['attributes'],'include':_0x316671[_0xd654('0x14')]?_[_0xd654('0x15')](_0x316671[_0xd654('0x14')],function(_0x5b37c5){return{'model':db[_0x5b37c5[_0xd654('0x16')]],'as':_0x5b37c5['as'],'attributes':_0x5b37c5[_0xd654('0x13')],'include':_0x5b37c5['include']?_[_0xd654('0x15')](_0x5b37c5['include'],function(_0x12aac6){return{'model':db[_0x12aac6[_0xd654('0x16')]],'as':_0x12aac6['as'],'attributes':_0x12aac6[_0xd654('0x13')]};}):[]};}):[]};}):[]:[]})[_0xd654('0x17')](function(_0x6dcb30){logger[_0xd654('0x18')](_0xd654('0xe'),_0x1ecb45);logger['debug'](_0xd654('0xe'),_0x1ecb45,JSON[_0xd654('0x19')](_0x6dcb30));_0x2e6fe8(_0x6dcb30);})[_0xd654('0x1a')](function(_0x287aa9){logger[_0xd654('0x1b')](_0xd654('0xe'),_0x287aa9['message'],_0x1ecb45);_0x4d863c(_0x39fbe8[_0xd654('0x1b')](0x1f4,_0x287aa9[_0xd654('0x1c')]));});});};exports['ShowUser']=function(_0x424d91){var _0x4344d8=this;return new Promise(function(_0x313aef,_0x50dc0b){return db[_0xd654('0xf')][_0xd654('0x1d')]({'raw':_0x424d91['options']?_0x424d91[_0xd654('0x12')]['raw']===undefined?!![]:![]:!![],'where':_0x424d91[_0xd654('0x12')]?_0x424d91['options'][_0xd654('0x1e')]||null:null,'attributes':_0x424d91[_0xd654('0x12')]?_0x424d91[_0xd654('0x12')][_0xd654('0x13')]||null:null,'include':_0x424d91[_0xd654('0x12')]?_0x424d91[_0xd654('0x12')][_0xd654('0x14')]?_[_0xd654('0x15')](_0x424d91[_0xd654('0x12')]['include'],function(_0x39a6dc){return{'model':db[_0x39a6dc[_0xd654('0x16')]],'as':_0x39a6dc['as'],'attributes':_0x39a6dc['attributes'],'include':_0x39a6dc[_0xd654('0x14')]?_[_0xd654('0x15')](_0x39a6dc[_0xd654('0x14')],function(_0x55b8e1){return{'model':db[_0x55b8e1[_0xd654('0x16')]],'as':_0x55b8e1['as'],'attributes':_0x55b8e1[_0xd654('0x13')],'include':_0x55b8e1['include']?_[_0xd654('0x15')](_0x55b8e1[_0xd654('0x14')],function(_0x164c41){return{'model':db[_0x164c41[_0xd654('0x16')]],'as':_0x164c41['as'],'attributes':_0x164c41[_0xd654('0x13')]};}):[]};}):[]};}):[]:[]})[_0xd654('0x17')](function(_0x3eb956){logger[_0xd654('0x18')]('ShowUser',_0x424d91);logger[_0xd654('0x1f')]('ShowUser',_0x424d91,JSON['stringify'](_0x3eb956));_0x313aef(_0x3eb956);})['catch'](function(_0x4aa02c){logger[_0xd654('0x1b')](_0xd654('0x20'),_0x4aa02c['message'],_0x424d91);_0x50dc0b(_0x4344d8['error'](0x1f4,_0x4aa02c[_0xd654('0x1c')]));});});};exports[_0xd654('0x21')]=function(_0x50c983){var _0xb17cef;return db[_0xd654('0xf')][_0xd654('0x1d')]({'where':_0x50c983[_0xd654('0x12')]['where']||{},'attributes':['id','name',_0xd654('0x22'),'internal','interface']})[_0xd654('0x17')](function(_0x87a507){if(!_0x87a507){throw new Error(util[_0xd654('0x23')]('User\x20with\x20id\x20%s\x20not\x20found',_0x50c983[_0xd654('0x24')]['id']));}_0xb17cef=_0x87a507;return db[_0xd654('0x25')][_0xd654('0x26')]({'paused':0x1},{'where':{'UserId':_0xb17cef['id']},'individualHooks':!![]});})[_0xd654('0x17')](function(){return db[_0xd654('0x27')][_0xd654('0x10')]({'where':{'membername':_0xb17cef[_0xd654('0x28')],'type':_0xd654('0x29'),'exitAt':null}});})[_0xd654('0x17')](function(_0xc84aea){if(_0xc84aea&&_0xc84aea[_0xd654('0x2a')]){var _0x5e97c7=moment()['format'](_0xd654('0x2b'));for(var _0x19fecd=0x0,_0x264b77=_0xc84aea[_0xd654('0x2a')];_0x19fecd<_0x264b77;_0x19fecd++){_0xc84aea[_0x19fecd][_0xd654('0x2c')]({'exitAt':_0x5e97c7});}}})[_0xd654('0x17')](function(){var _0x335828=[];var _0x2d628e=utils[_0xd654('0x2d')]();_0x2d628e[_0xd654('0x2e')](function(_0x1601f9){_0x335828[_0xd654('0x2f')]({'channel':_0x1601f9,'membername':_0xb17cef[_0xd654('0x28')],'interface':_[_0xd654('0x30')](_0xb17cef['interface'])?util['format']('SIP/%s',_0xb17cef[_0xd654('0x28')]):_0xb17cef[_0xd654('0x31')],'type':_0xd654('0x29'),'enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x50c983[_0xd654('0x32')]['type']||_0xd654('0x33'),'role':_0xb17cef[_0xd654('0x22')],'internal':_0xb17cef['internal'],'uniqueid':_0x50c983[_0xd654('0x32')][_0xd654('0x34')]||null});});return db['MemberReport'][_0xd654('0x35')](_0x335828,{'individualHooks':!![]});})[_0xd654('0x17')](function(){return _0xb17cef[_0xd654('0x26')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x50c983[_0xd654('0x32')]['type']||_0xd654('0x33'),'lastPauseAt':moment()['format'](_0xd654('0x2b'))});})['catch'](function(_0x5c5c55){throw _0x5c5c55;});};exports['UnpauseUser']=function(_0x4693b2){return Promise[_0xd654('0x36')]()[_0xd654('0x17')](function(){if(_0x4693b2[_0xd654('0x32')][_0xd654('0x37')]&&!utils[_0xd654('0x38')](_0x4693b2[_0xd654('0x32')]['channel'])){throw new Error(util[_0xd654('0x23')](_0xd654('0x39'),_0x4693b2[_0xd654('0x32')]['channel']));}return db[_0xd654('0xf')][_0xd654('0x3a')]({'where':_0x4693b2[_0xd654('0x12')]['where']||{},'attributes':['id',_0xd654('0x28'),_0xd654('0x22'),'internal',_0xd654('0x31'),_0xd654('0x3b'),_0xd654('0x3c'),'mailPause',_0xd654('0x3d'),'faxPause',_0xd654('0x3e'),_0xd654('0x3f'),_0xd654('0x40'),_0xd654('0x41'),'lastPauseAt']});})[_0xd654('0x17')](function(_0xff6015){if(!_0xff6015){throw new Error(util[_0xd654('0x23')]('User\x20with\x20id\x20%s\x20not\x20found',_0x4693b2[_0xd654('0x24')]['id']));}return _0xff6015[_0xd654('0x42')](_0x4693b2['body'][_0xd654('0x37')],'system');})[_0xd654('0x1a')](function(_0x59814a){throw _0x59814a;});};exports[_0xd654('0x43')]=function(_0x5829e0){var _0x30fc01=this;return new Promise(function(_0x4f4760,_0x3725d4){var _0xbfd75;return db[_0xd654('0xf')][_0xd654('0x3a')]({'where':_0x5829e0['options'][_0xd654('0x1e')]||{},'attributes':['id',_0xd654('0x28')]})[_0xd654('0x17')](function(_0x25f494){if(_0x25f494){_0xbfd75=_0x25f494;return db['UserVoiceQueueRt'][_0xd654('0x44')]({'where':{'membername':_0xbfd75[_0xd654('0x28')]},'individualHooks':!![]});}})[_0xd654('0x17')](function(){if(_0xbfd75){return db[_0xd654('0x27')][_0xd654('0x10')]({'where':{'membername':_0xbfd75['name'],'exitAt':null}});}})[_0xd654('0x17')](function(_0x370cea){if(_0xbfd75){if(_0x370cea&&_0x370cea[_0xd654('0x2a')]){var _0x5d840a=[];_0x370cea[_0xd654('0x2e')](function(_0x36a270){_0x5d840a['push'](_0x36a270['update']({'exitAt':moment()[_0xd654('0x23')](_0xd654('0x2b'))}));});return BPromise['all'](_0x5d840a);}}})['then'](function(){if(_0xbfd75){return _0xbfd75['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xd654('0x17')](function(_0x54c52f){_0x4f4760(_0x54c52f);})[_0xd654('0x1a')](function(_0x48b31b){_0x3725d4(_0x30fc01[_0xd654('0x1b')](0x1f4,_0x48b31b[_0xd654('0x1c')]));});});};exports[_0xd654('0x45')]=function(_0x162d37){var _0x3e4f37=this;return new Promise(function(_0x113308,_0x318d4e){var _0x2f68ed;var _0x15c204;var _0x2e2c74;var _0x1f475d;return db[_0xd654('0xf')][_0xd654('0x3a')]({'where':_0x162d37['options'][_0xd654('0x1e')]||{},'attributes':['id',_0xd654('0x28'),_0xd654('0x22'),_0xd654('0x46'),'phone',_0xd654('0x47'),'loginInPause',_0xd654('0x31')]})['then'](function(_0xc2b3bf){if(_0xc2b3bf){_0x2f68ed=_0xc2b3bf;_0x1f475d=_0x162d37[_0xd654('0x32')][_0xd654('0x31')]?_0x162d37[_0xd654('0x32')]['interface']:util[_0xd654('0x23')]('SIP/%s',_0x2f68ed[_0xd654('0x28')]);return db['User']['count']({'where':{'role':'agent','online':!![],'id':{'$ne':_0x2f68ed['id']}}});}})[_0xd654('0x17')](function(_0x5a5d63){if(_0x5a5d63){_0x2e2c74=_0x5a5d63;return require(_0xd654('0x48'))[_0xd654('0x49')]();}})['then'](function(_0x4318dc){if(_0x4318dc&&_0x4318dc[_0xd654('0x4a')]&&_0x2e2c74>=_0x4318dc[_0xd654('0x4a')]){throw new Error(_0xd654('0x4b'));}})[_0xd654('0x17')](function(){if(_0x2f68ed){return db[_0xd654('0x25')][_0xd654('0x44')]({'where':{'membername':_0x2f68ed[_0xd654('0x28')]},'individualHooks':!![]});}})['then'](function(){if(_0x2f68ed){return _0x2f68ed[_0xd654('0x4c')]({'raw':!![]});}})[_0xd654('0x17')](function(_0x264ae5){if(_0x2f68ed){if(_0x264ae5){var _0x374422=[];_0x15c204=_0x264ae5;if(_0x15c204['length']){for(var _0x3f5f39=0x0;_0x3f5f39<_0x15c204[_0xd654('0x2a')];_0x3f5f39++){_0x374422[_0xd654('0x2f')](db[_0xd654('0x25')][_0xd654('0x4d')]({'membername':_0x2f68ed[_0xd654('0x28')],'UserId':_0x2f68ed['id'],'queue_name':_0x15c204[_0x3f5f39]['name'],'VoiceQueueId':_0x15c204[_0x3f5f39]['id'],'interface':_0x1f475d,'paused':_0x2f68ed[_0xd654('0x4e')]||![],'penalty':_0x15c204[_0x3f5f39]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0xd654('0x4f')](_0x374422);}}}})['then'](function(){if(_0x2f68ed){return db[_0xd654('0x27')]['findAll']({'where':{'membername':_0x2f68ed[_0xd654('0x28')],'exitAt':null}});}})['then'](function(_0x5aae6e){if(_0x2f68ed){if(_0x5aae6e&&_0x5aae6e[_0xd654('0x2a')]){var _0x598fd5=[];_0x5aae6e['forEach'](function(_0x1baf26){_0x598fd5[_0xd654('0x2f')](_0x1baf26[_0xd654('0x26')]({'exitAt':moment()['format'](_0xd654('0x2b'))}));});return BPromise[_0xd654('0x4f')](_0x598fd5);}}})[_0xd654('0x17')](function(){if(_0x2f68ed){var _0x52a707=[];var _0x2d035f=[];var _0x31ccd9=utils['getChannels']();var _0x33fe02={'membername':_0x2f68ed[_0xd654('0x28')],'interface':_0x1f475d,'enterAt':moment()[_0xd654('0x23')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x2f68ed[_0xd654('0x22')],'internal':_0x2f68ed[_0xd654('0x47')]};_0x31ccd9[_0xd654('0x2e')](function(_0x16b64b){_0x52a707[_0xd654('0x2f')](_['merge']({'channel':_0x16b64b,'type':_0xd654('0x50'),'data1':_0xd654('0x51'),'data2':_0x1f475d},_0x33fe02));if(_0x2f68ed['loginInPause']){_0x2d035f[_0xd654('0x2f')](_[_0xd654('0x52')]({'channel':_0x16b64b,'type':_0xd654('0x29'),'data1':_0xd654('0x53')},_0x33fe02));}});return db['MemberReport']['bulkCreate'](_0x52a707[_0xd654('0x54')](_0x2d035f),{'individualHooks':!![]});}})[_0xd654('0x17')](function(){if(_0x2f68ed){return _0x2f68ed[_0xd654('0x26')]({'online':!![],'lastLoginAt':moment()[_0xd654('0x23')](_0xd654('0x2b')),'voicePause':_0x2f68ed[_0xd654('0x4e')]||![],'mailPause':_0x2f68ed[_0xd654('0x4e')]||![],'chatPause':_0x2f68ed[_0xd654('0x4e')]||![],'faxPause':_0x2f68ed[_0xd654('0x4e')]||![],'smsPause':_0x2f68ed[_0xd654('0x4e')]||![],'openchannelPause':_0x2f68ed['loginInPause']||![],'pauseType':_0x2f68ed[_0xd654('0x4e')]?_0xd654('0x53'):null,'lastPauseAt':moment()[_0xd654('0x23')]('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x1f475d});}})[_0xd654('0x17')](function(_0x1058ee){_0x113308(_0x1058ee);})[_0xd654('0x1a')](function(_0x489ec0){_0x318d4e(_0x3e4f37[_0xd654('0x1b')](0x1f4,_0x489ec0[_0xd654('0x1c')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 19a67c7..6362e06 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 _0xa507=['user:','./user.events','save','remove','update','emit','removeListener','register'];(function(_0x45242a,_0xaad760){var _0x225aaa=function(_0x36d828){while(--_0x36d828){_0x45242a['push'](_0x45242a['shift']());}};_0x225aaa(++_0xaad760);}(_0xa507,0x1e9));var _0x7a50=function(_0x2555d0,_0x4150a6){_0x2555d0=_0x2555d0-0x0;var _0x3bb486=_0xa507[_0x2555d0];return _0x3bb486;};'use strict';var UserEvents=require(_0x7a50('0x0'));var events=[_0x7a50('0x1'),_0x7a50('0x2'),_0x7a50('0x3')];function createListener(_0x32c18d,_0x1550ee){return function(_0x2ee66d){_0x1550ee[_0x7a50('0x4')](_0x32c18d,_0x2ee66d);};}function removeListener(_0xf054be,_0x224f0b){return function(){UserEvents[_0x7a50('0x5')](_0xf054be,_0x224f0b);};}exports[_0x7a50('0x6')]=function(_0x1ee01d){for(var _0x43f50e=0x0,_0xc1cbde=events['length'];_0x43f50e<_0xc1cbde;_0x43f50e++){var _0x2f1955=events[_0x43f50e];var _0x31236d=createListener(_0x7a50('0x7')+_0x2f1955,_0x1ee01d);UserEvents['on'](_0x2f1955,_0x31236d);}}; \ No newline at end of file +var _0x7e8b=['remove','update','emit','register','length','./user.events'];(function(_0x1cf574,_0x3d6f2a){var _0x25556b=function(_0x23c0b7){while(--_0x23c0b7){_0x1cf574['push'](_0x1cf574['shift']());}};_0x25556b(++_0x3d6f2a);}(_0x7e8b,0xcb));var _0xb7e8=function(_0x45be7a,_0x150ca7){_0x45be7a=_0x45be7a-0x0;var _0x4a9234=_0x7e8b[_0x45be7a];return _0x4a9234;};'use strict';var UserEvents=require(_0xb7e8('0x0'));var events=['save',_0xb7e8('0x1'),_0xb7e8('0x2')];function createListener(_0xa0f937,_0x3adc3b){return function(_0x34e9bc){_0x3adc3b[_0xb7e8('0x3')](_0xa0f937,_0x34e9bc);};}function removeListener(_0xa2b26b,_0x5e2091){return function(){UserEvents['removeListener'](_0xa2b26b,_0x5e2091);};}exports[_0xb7e8('0x4')]=function(_0x20d765){for(var _0x40271e=0x0,_0x5a2290=events[_0xb7e8('0x5')];_0x40271e<_0x5a2290;_0x40271e++){var _0x58d5d2=events[_0x40271e];var _0x2a11fb=createListener('user:'+_0x58d5d2,_0x20d765);UserEvents['on'](_0x58d5d2,_0x2a11fb);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 91fd48d..8c02ccd 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x75c2cc,_0x3ada99){var _0x340fe4=function(_0x3b2401){while(--_0x3b2401){_0x75c2cc['push'](_0x75c2cc['shift']());}};_0x340fe4(++_0x3ada99);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x17316b,_0x1b42c0){var _0x2ce0fd=function(_0x33f458){while(--_0x33f458){_0x17316b['push'](_0x17316b['shift']());}};_0x2ce0fd(++_0x1b42c0);}(_0xe706,0xa3));var _0x6e70=function(_0x2d50be,_0x4e2d7c){_0x2d50be=_0x2d50be-0x0;var _0x2d3545=_0xe706[_0x2d50be];return _0x2d3545;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 968b16e..42f4664 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 _0xc1bf=['INTEGER','sequelize','exports'];(function(_0x20c57d,_0x1c79a9){var _0x1a076e=function(_0x34a84f){while(--_0x34a84f){_0x20c57d['push'](_0x20c57d['shift']());}};_0x1a076e(++_0x1c79a9);}(_0xc1bf,0x79));var _0xfc1b=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xc1bf[_0x465a0c];return _0x1e202e;};'use strict';var Sequelize=require(_0xfc1b('0x0'));module[_0xfc1b('0x1')]={'penalty':{'type':Sequelize[_0xfc1b('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x0f4a=['exports','INTEGER','sequelize'];(function(_0x38eefb,_0x4f2887){var _0x5e590c=function(_0xf135cb){while(--_0xf135cb){_0x38eefb['push'](_0x38eefb['shift']());}};_0x5e590c(++_0x4f2887);}(_0x0f4a,0x185));var _0xa0f4=function(_0x1ed239,_0x539309){_0x1ed239=_0x1ed239-0x0;var _0x274cb1=_0x0f4a[_0x1ed239];return _0x274cb1;};'use strict';var Sequelize=require(_0xa0f4('0x0'));module[_0xa0f4('0x1')]={'penalty':{'type':Sequelize[_0xa0f4('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index c8c313f..7614f7b 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 _0xcb6a=['moment','bluebird','request-promise','path','../../config/environment','exports','define','user_has_chat_queues','util','../../config/logger','api'];(function(_0x4afc2c,_0x336a88){var _0x164084=function(_0x14b783){while(--_0x14b783){_0x4afc2c['push'](_0x4afc2c['shift']());}};_0x164084(++_0x336a88);}(_0xcb6a,0xb8));var _0xacb6=function(_0x46d0c9,_0x526bfa){_0x46d0c9=_0x46d0c9-0x0;var _0x174506=_0xcb6a[_0x46d0c9];return _0x174506;};'use strict';var _=require('lodash');var util=require(_0xacb6('0x0'));var logger=require(_0xacb6('0x1'))(_0xacb6('0x2'));var moment=require(_0xacb6('0x3'));var BPromise=require(_0xacb6('0x4'));var rp=require(_0xacb6('0x5'));var fs=require('fs');var path=require(_0xacb6('0x6'));var rimraf=require('rimraf');var config=require(_0xacb6('0x7'));var attributes=require('./userChatQueue.attributes');module[_0xacb6('0x8')]=function(_0x18fcc7,_0x3eace){return _0x18fcc7[_0xacb6('0x9')]('UserChatQueue',attributes,{'tableName':_0xacb6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x769b=['../../config/environment','./userChatQueue.attributes','define','UserChatQueue','user_has_chat_queues','util','../../config/logger','moment','request-promise','path','rimraf'];(function(_0x4a93ea,_0xc94ef5){var _0x85e3b7=function(_0x3e1ab5){while(--_0x3e1ab5){_0x4a93ea['push'](_0x4a93ea['shift']());}};_0x85e3b7(++_0xc94ef5);}(_0x769b,0x139));var _0xb769=function(_0x476717,_0x3ac85e){_0x476717=_0x476717-0x0;var _0x1d0601=_0x769b[_0x476717];return _0x1d0601;};'use strict';var _=require('lodash');var util=require(_0xb769('0x0'));var logger=require(_0xb769('0x1'))('api');var moment=require(_0xb769('0x2'));var BPromise=require('bluebird');var rp=require(_0xb769('0x3'));var fs=require('fs');var path=require(_0xb769('0x4'));var rimraf=require(_0xb769('0x5'));var config=require(_0xb769('0x6'));var attributes=require(_0xb769('0x7'));module['exports']=function(_0x18d9e3,_0x259168){return _0x18d9e3[_0xb769('0x8')](_0xb769('0x9'),attributes,{'tableName':_0xb769('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.rpc.js b/server/api/userChatQueue/userChatQueue.rpc.js index 7a036f0..ef6dd3d 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 _0x2f0e=['UserChatQueue,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','catch','lodash','util','moment','../../mysqldb','../../config/logger','rpc','../../config/environment','request','then','info'];(function(_0x3f60ea,_0x20de57){var _0x1ebd41=function(_0x291787){while(--_0x291787){_0x3f60ea['push'](_0x3f60ea['shift']());}};_0x1ebd41(++_0x20de57);}(_0x2f0e,0x104));var _0xe2f0=function(_0x3da542,_0x393dc9){_0x3da542=_0x3da542-0x0;var _0x4e10a0=_0x2f0e[_0x3da542];return _0x4e10a0;};'use strict';var _=require(_0xe2f0('0x0'));var util=require(_0xe2f0('0x1'));var moment=require(_0xe2f0('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe2f0('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xe2f0('0x4'))(_0xe2f0('0x5'));var config=require(_0xe2f0('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4d81b4,_0x5a2e6b,_0x27772d){return new BPromise(function(_0x36481a,_0x6c736a){return client[_0xe2f0('0x7')](_0x4d81b4,_0x27772d)[_0xe2f0('0x8')](function(_0x347264){logger[_0xe2f0('0x9')](_0xe2f0('0xa'),_0x5a2e6b,'request\x20sent');logger[_0xe2f0('0xb')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x5a2e6b,'request\x20sent',JSON[_0xe2f0('0xc')](_0x347264));if(_0x347264[_0xe2f0('0xd')]){if(_0x347264[_0xe2f0('0xd')][_0xe2f0('0xe')]===0x1f4){logger[_0xe2f0('0xd')](_0xe2f0('0xa'),_0x5a2e6b,_0x347264[_0xe2f0('0xd')][_0xe2f0('0xf')]);return _0x6c736a(_0x347264[_0xe2f0('0xd')]['message']);}logger['error'](_0xe2f0('0xa'),_0x5a2e6b,_0x347264[_0xe2f0('0xd')][_0xe2f0('0xf')]);return _0x36481a(_0x347264['error'][_0xe2f0('0xf')]);}else{logger[_0xe2f0('0x9')](_0xe2f0('0xa'),_0x5a2e6b,_0xe2f0('0x10'));_0x36481a(_0x347264['result'][_0xe2f0('0xf')]);}})[_0xe2f0('0x11')](function(_0x2ef9de){logger[_0xe2f0('0xd')](_0xe2f0('0xa'),_0x5a2e6b,_0x2ef9de);_0x6c736a(_0x2ef9de);});});} \ No newline at end of file +var _0xe700=['lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch'];(function(_0x49e53b,_0x511d96){var _0x233bde=function(_0x572d24){while(--_0x572d24){_0x49e53b['push'](_0x49e53b['shift']());}};_0x233bde(++_0x511d96);}(_0xe700,0x1b8));var _0x0e70=function(_0x53b43a,_0x21eb2f){_0x53b43a=_0x53b43a-0x0;var _0x3c3b62=_0xe700[_0x53b43a];return _0x3c3b62;};'use strict';var _=require(_0x0e70('0x0'));var util=require(_0x0e70('0x1'));var moment=require('moment');var BPromise=require(_0x0e70('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0e70('0x3'));var db=require(_0x0e70('0x4'))['db'];var utils=require(_0x0e70('0x5'));var logger=require(_0x0e70('0x6'))('rpc');var config=require(_0x0e70('0x7'));var jayson=require(_0x0e70('0x8'));var client=jayson[_0x0e70('0x9')][_0x0e70('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x708ce9,_0x39e1d1,_0x265e30){return new BPromise(function(_0x341354,_0x2394eb){return client[_0x0e70('0xb')](_0x708ce9,_0x265e30)[_0x0e70('0xc')](function(_0x271103){logger[_0x0e70('0xd')](_0x0e70('0xe'),_0x39e1d1,_0x0e70('0xf'));logger[_0x0e70('0x10')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x39e1d1,_0x0e70('0xf'),JSON[_0x0e70('0x11')](_0x271103));if(_0x271103[_0x0e70('0x12')]){if(_0x271103['error']['code']===0x1f4){logger[_0x0e70('0x12')](_0x0e70('0xe'),_0x39e1d1,_0x271103['error'][_0x0e70('0x13')]);return _0x2394eb(_0x271103[_0x0e70('0x12')][_0x0e70('0x13')]);}logger[_0x0e70('0x12')](_0x0e70('0xe'),_0x39e1d1,_0x271103[_0x0e70('0x12')]['message']);return _0x341354(_0x271103[_0x0e70('0x12')][_0x0e70('0x13')]);}else{logger[_0x0e70('0xd')](_0x0e70('0xe'),_0x39e1d1,_0x0e70('0xf'));_0x341354(_0x271103[_0x0e70('0x14')]['message']);}})[_0x0e70('0x15')](function(_0x246a1b){logger[_0x0e70('0x12')](_0x0e70('0xe'),_0x39e1d1,_0x246a1b);_0x2394eb(_0x246a1b);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 4c31fa9..7cf993f 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x4ff685,_0x282dce){var _0x10522f=function(_0x2e977a){while(--_0x2e977a){_0x4ff685['push'](_0x4ff685['shift']());}};_0x10522f(++_0x282dce);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x31a8fd,_0x3b069e){var _0x3c9f87=function(_0x193208){while(--_0x193208){_0x31a8fd['push'](_0x31a8fd['shift']());}};_0x3c9f87(++_0x3b069e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 27b88bd..1c012a7 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 _0x64df=['INTEGER','STRING','sequelize','exports'];(function(_0x5753f7,_0x4a27bb){var _0x5201ef=function(_0x23aab4){while(--_0x23aab4){_0x5753f7['push'](_0x5753f7['shift']());}};_0x5201ef(++_0x4a27bb);}(_0x64df,0x162));var _0xf64d=function(_0x373daf,_0x18b9a8){_0x373daf=_0x373daf-0x0;var _0x1fa416=_0x64df[_0x373daf];return _0x1fa416;};'use strict';var Sequelize=require(_0xf64d('0x0'));module[_0xf64d('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xf64d('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xf64d('0x3')]}}; \ No newline at end of file +var _0xae9d=['sequelize','exports','INTEGER','STRING'];(function(_0x5ad771,_0x34186f){var _0x5b5dce=function(_0x5ad0fb){while(--_0x5ad0fb){_0x5ad771['push'](_0x5ad771['shift']());}};_0x5b5dce(++_0x34186f);}(_0xae9d,0x98));var _0xdae9=function(_0x37065a,_0xd1f059){_0x37065a=_0x37065a-0x0;var _0x293d11=_0xae9d[_0x37065a];return _0x293d11;};'use strict';var Sequelize=require(_0xdae9('0x0'));module[_0xdae9('0x1')]={'penalty':{'type':Sequelize[_0xdae9('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize[_0xdae9('0x3')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 5c3d276..cf04eff 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 _0x4d1b=['exports','define','UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./userFaxQueue.attributes'];(function(_0x41ae8,_0x2541ae){var _0x93d0b2=function(_0x397cbf){while(--_0x397cbf){_0x41ae8['push'](_0x41ae8['shift']());}};_0x93d0b2(++_0x2541ae);}(_0x4d1b,0x154));var _0xb4d1=function(_0x46111d,_0x5d286b){_0x46111d=_0x46111d-0x0;var _0xe82586=_0x4d1b[_0x46111d];return _0xe82586;};'use strict';var _=require(_0xb4d1('0x0'));var util=require(_0xb4d1('0x1'));var logger=require(_0xb4d1('0x2'))(_0xb4d1('0x3'));var moment=require(_0xb4d1('0x4'));var BPromise=require(_0xb4d1('0x5'));var rp=require(_0xb4d1('0x6'));var fs=require('fs');var path=require(_0xb4d1('0x7'));var rimraf=require('rimraf');var config=require(_0xb4d1('0x8'));var attributes=require(_0xb4d1('0x9'));module[_0xb4d1('0xa')]=function(_0x59b61f,_0x2f1868){return _0x59b61f[_0xb4d1('0xb')](_0xb4d1('0xc'),attributes,{'tableName':_0xb4d1('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x88f7=['moment','request-promise','path','rimraf','../../config/environment','exports','define','UserFaxQueue','user_has_fax_queues','lodash','util'];(function(_0x9d6855,_0x5b6da6){var _0x3bbc78=function(_0x17d464){while(--_0x17d464){_0x9d6855['push'](_0x9d6855['shift']());}};_0x3bbc78(++_0x5b6da6);}(_0x88f7,0x1ab));var _0x788f=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x88f7[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x788f('0x0'));var util=require(_0x788f('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x788f('0x2'));var BPromise=require('bluebird');var rp=require(_0x788f('0x3'));var fs=require('fs');var path=require(_0x788f('0x4'));var rimraf=require(_0x788f('0x5'));var config=require(_0x788f('0x6'));var attributes=require('./userFaxQueue.attributes');module[_0x788f('0x7')]=function(_0x2d6b8f,_0x592924){return _0x2d6b8f[_0x788f('0x8')](_0x788f('0x9'),attributes,{'tableName':_0x788f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index b0a24b0..27e0708 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 _0x54c4=['UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info'];(function(_0x8811a2,_0x1c7266){var _0x4b58ed=function(_0x37a15a){while(--_0x37a15a){_0x8811a2['push'](_0x8811a2['shift']());}};_0x4b58ed(++_0x1c7266);}(_0x54c4,0x137));var _0x454c=function(_0xbb54ed,_0x484a6b){_0xbb54ed=_0xbb54ed-0x0;var _0x1f877a=_0x54c4[_0xbb54ed];return _0x1f877a;};'use strict';var _=require(_0x454c('0x0'));var util=require(_0x454c('0x1'));var moment=require(_0x454c('0x2'));var BPromise=require('bluebird');var rs=require(_0x454c('0x3'));var fs=require('fs');var Redis=require(_0x454c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x454c('0x5'));var logger=require(_0x454c('0x6'))('rpc');var config=require(_0x454c('0x7'));var jayson=require(_0x454c('0x8'));var client=jayson['client'][_0x454c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x296763,_0x3f39b9,_0x145a0a){return new BPromise(function(_0x1c1c9a,_0x34839c){return client[_0x454c('0xa')](_0x296763,_0x145a0a)['then'](function(_0x385f05){logger[_0x454c('0xb')](_0x454c('0xc'),_0x3f39b9,_0x454c('0xd'));logger[_0x454c('0xe')](_0x454c('0xf'),_0x3f39b9,_0x454c('0xd'),JSON['stringify'](_0x385f05));if(_0x385f05['error']){if(_0x385f05[_0x454c('0x10')]['code']===0x1f4){logger[_0x454c('0x10')](_0x454c('0xc'),_0x3f39b9,_0x385f05['error'][_0x454c('0x11')]);return _0x34839c(_0x385f05[_0x454c('0x10')]['message']);}logger[_0x454c('0x10')](_0x454c('0xc'),_0x3f39b9,_0x385f05[_0x454c('0x10')][_0x454c('0x11')]);return _0x1c1c9a(_0x385f05[_0x454c('0x10')][_0x454c('0x11')]);}else{logger[_0x454c('0xb')](_0x454c('0xc'),_0x3f39b9,'request\x20sent');_0x1c1c9a(_0x385f05['result'][_0x454c('0x11')]);}})[_0x454c('0x12')](function(_0x4dc16c){logger['error'](_0x454c('0xc'),_0x3f39b9,_0x4dc16c);_0x34839c(_0x4dc16c);});});} \ No newline at end of file +var _0x1256=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','UserFaxQueue,\x20%s,\x20%s','request\x20sent','UserFaxQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','result','lodash'];(function(_0x3e2522,_0x5ceddb){var _0x1894ec=function(_0x261fe9){while(--_0x261fe9){_0x3e2522['push'](_0x3e2522['shift']());}};_0x1894ec(++_0x5ceddb);}(_0x1256,0x107));var _0x6125=function(_0x2a1a31,_0x1b8b1a){_0x2a1a31=_0x2a1a31-0x0;var _0xe175e8=_0x1256[_0x2a1a31];return _0xe175e8;};'use strict';var _=require(_0x6125('0x0'));var util=require(_0x6125('0x1'));var moment=require(_0x6125('0x2'));var BPromise=require(_0x6125('0x3'));var rs=require(_0x6125('0x4'));var fs=require('fs');var Redis=require(_0x6125('0x5'));var db=require(_0x6125('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x6125('0x7'))(_0x6125('0x8'));var config=require(_0x6125('0x9'));var jayson=require(_0x6125('0xa'));var client=jayson[_0x6125('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x40cd89,_0x4214c6,_0x438957){return new BPromise(function(_0x1d03eb,_0xb79714){return client[_0x6125('0xc')](_0x40cd89,_0x438957)[_0x6125('0xd')](function(_0x5e47f3){logger['info'](_0x6125('0xe'),_0x4214c6,_0x6125('0xf'));logger['debug'](_0x6125('0x10'),_0x4214c6,_0x6125('0xf'),JSON['stringify'](_0x5e47f3));if(_0x5e47f3[_0x6125('0x11')]){if(_0x5e47f3['error'][_0x6125('0x12')]===0x1f4){logger[_0x6125('0x11')](_0x6125('0xe'),_0x4214c6,_0x5e47f3[_0x6125('0x11')]['message']);return _0xb79714(_0x5e47f3[_0x6125('0x11')][_0x6125('0x13')]);}logger[_0x6125('0x11')](_0x6125('0xe'),_0x4214c6,_0x5e47f3['error'][_0x6125('0x13')]);return _0x1d03eb(_0x5e47f3['error'][_0x6125('0x13')]);}else{logger[_0x6125('0x14')](_0x6125('0xe'),_0x4214c6,_0x6125('0xf'));_0x1d03eb(_0x5e47f3[_0x6125('0x15')][_0x6125('0x13')]);}})['catch'](function(_0x5405ae){logger['error'](_0x6125('0xe'),_0x4214c6,_0x5405ae);_0xb79714(_0x5405ae);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index eab2c82..e995427 100644 --- a/server/api/userMailQueue/index.js +++ b/server/api/userMailQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x308ec4,_0x4f98d9){var _0x3fef67=function(_0x1cadc6){while(--_0x1cadc6){_0x308ec4['push'](_0x308ec4['shift']());}};_0x3fef67(++_0x4f98d9);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2a4095,_0x13f4f0){_0x2a4095=_0x2a4095-0x0;var _0x52eeab=_0xcb91[_0x2a4095];return _0x52eeab;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x472161,_0x8b06e1){var _0x752e83=function(_0x1b4647){while(--_0x1b4647){_0x472161['push'](_0x472161['shift']());}};_0x752e83(++_0x8b06e1);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0xcb91[_0x1caf6a];return _0x1bf493;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 4826df3..9a114b7 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 _0x87e3=['exports','INTEGER','sequelize'];(function(_0x6dbb,_0xe4e135){var _0x54639c=function(_0x4074e8){while(--_0x4074e8){_0x6dbb['push'](_0x6dbb['shift']());}};_0x54639c(++_0xe4e135);}(_0x87e3,0x80));var _0x387e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0x87e3[_0x1c546c];return _0x2cc384;};'use strict';var Sequelize=require(_0x387e('0x0'));module[_0x387e('0x1')]={'penalty':{'type':Sequelize[_0x387e('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x4f28=['exports','INTEGER'];(function(_0x494d1f,_0x3f72ff){var _0x457b6e=function(_0x38cb16){while(--_0x38cb16){_0x494d1f['push'](_0x494d1f['shift']());}};_0x457b6e(++_0x3f72ff);}(_0x4f28,0x7a));var _0x84f2=function(_0x359bbe,_0x5b7fcc){_0x359bbe=_0x359bbe-0x0;var _0x1b3353=_0x4f28[_0x359bbe];return _0x1b3353;};'use strict';var Sequelize=require('sequelize');module[_0x84f2('0x0')]={'penalty':{'type':Sequelize[_0x84f2('0x1')],'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 503f363..cba1d04 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 _0xfbb3=['moment','bluebird','request-promise','path','rimraf','./userMailQueue.attributes','exports','define','UserMailQueue','user_has_mail_queues','api'];(function(_0x10fc4a,_0x58442d){var _0x45d274=function(_0x2d62fc){while(--_0x2d62fc){_0x10fc4a['push'](_0x10fc4a['shift']());}};_0x45d274(++_0x58442d);}(_0xfbb3,0x1ac));var _0x3fbb=function(_0xd5426a,_0x5ee9ab){_0xd5426a=_0xd5426a-0x0;var _0x3d51f1=_0xfbb3[_0xd5426a];return _0x3d51f1;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x3fbb('0x0'));var moment=require(_0x3fbb('0x1'));var BPromise=require(_0x3fbb('0x2'));var rp=require(_0x3fbb('0x3'));var fs=require('fs');var path=require(_0x3fbb('0x4'));var rimraf=require(_0x3fbb('0x5'));var config=require('../../config/environment');var attributes=require(_0x3fbb('0x6'));module[_0x3fbb('0x7')]=function(_0x15995d,_0x12a2d4){return _0x15995d[_0x3fbb('0x8')](_0x3fbb('0x9'),attributes,{'tableName':_0x3fbb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x44fc=['./userMailQueue.attributes','define','UserMailQueue','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x26b1c6,_0x130e69){var _0x1a65b4=function(_0x37f14b){while(--_0x37f14b){_0x26b1c6['push'](_0x26b1c6['shift']());}};_0x1a65b4(++_0x130e69);}(_0x44fc,0xb7));var _0xc44f=function(_0x2bddf9,_0x22c873){_0x2bddf9=_0x2bddf9-0x0;var _0x3f3ae9=_0x44fc[_0x2bddf9];return _0x3f3ae9;};'use strict';var _=require('lodash');var util=require(_0xc44f('0x0'));var logger=require('../../config/logger')(_0xc44f('0x1'));var moment=require(_0xc44f('0x2'));var BPromise=require(_0xc44f('0x3'));var rp=require(_0xc44f('0x4'));var fs=require('fs');var path=require(_0xc44f('0x5'));var rimraf=require(_0xc44f('0x6'));var config=require('../../config/environment');var attributes=require(_0xc44f('0x7'));module['exports']=function(_0x4b3a6f,_0x1aff9c){return _0x4b3a6f[_0xc44f('0x8')](_0xc44f('0x9'),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 8f3ed21..dcd823d 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 _0x7217=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserMailQueue,\x20%s,\x20%s','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x7217,0x19e));var _0x7721=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0x7217[_0x3ce3c];return _0x55a2c9;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('UserMailQueue,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('UserMailQueue,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});} \ No newline at end of file +var _0xe14b=['../../config/environment','jayson/promise','client','http','then','info','UserMailQueue,\x20%s,\x20%s','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x460fb7,_0x3ba45c){var _0x27693c=function(_0x147fcf){while(--_0x147fcf){_0x460fb7['push'](_0x460fb7['shift']());}};_0x27693c(++_0x3ba45c);}(_0xe14b,0x93));var _0xbe14=function(_0x398ce1,_0x319ffe){_0x398ce1=_0x398ce1-0x0;var _0x402c16=_0xe14b[_0x398ce1];return _0x402c16;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 608b70b..d6af8d7 100644 --- a/server/api/userNotification/index.js +++ b/server/api/userNotification/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa1d0=['./userNotification.controller','post','isAuthenticated','sendUserNotification','exports','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment'];(function(_0x510b36,_0x2d4070){var _0xf9e6a3=function(_0x50796d){while(--_0x50796d){_0x510b36['push'](_0x510b36['shift']());}};_0xf9e6a3(++_0x2d4070);}(_0xa1d0,0xad));var _0x0a1d=function(_0x57154e,_0x5351c4){_0x57154e=_0x57154e-0x0;var _0x5883c9=_0xa1d0[_0x57154e];return _0x5883c9;};'use strict';var multer=require(_0x0a1d('0x0'));var util=require(_0x0a1d('0x1'));var path=require(_0x0a1d('0x2'));var timeout=require(_0x0a1d('0x3'));var express=require('express');var router=express[_0x0a1d('0x4')]();var fs_extra=require(_0x0a1d('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0a1d('0x6'));var controller=require(_0x0a1d('0x7'));router[_0x0a1d('0x8')]('/',auth[_0x0a1d('0x9')](),controller[_0x0a1d('0xa')]);module[_0x0a1d('0xb')]=router; \ No newline at end of file +var _0xf582=['Router','../../components/auth/service','../../components/interaction/service','./userNotification.controller','isAuthenticated','sendUserNotification','exports','multer','util','path','connect-timeout','express'];(function(_0x12f688,_0x585c25){var _0x59c3de=function(_0x4ac301){while(--_0x4ac301){_0x12f688['push'](_0x12f688['shift']());}};_0x59c3de(++_0x585c25);}(_0xf582,0xf7));var _0x2f58=function(_0x13d2e8,_0x193847){_0x13d2e8=_0x13d2e8-0x0;var _0x230601=_0xf582[_0x13d2e8];return _0x230601;};'use strict';var multer=require(_0x2f58('0x0'));var util=require(_0x2f58('0x1'));var path=require(_0x2f58('0x2'));var timeout=require(_0x2f58('0x3'));var express=require(_0x2f58('0x4'));var router=express[_0x2f58('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x2f58('0x6'));var interaction=require(_0x2f58('0x7'));var config=require('../../config/environment');var controller=require(_0x2f58('0x8'));router['post']('/',auth[_0x2f58('0x9')](),controller[_0x2f58('0xa')]);module[_0x2f58('0xb')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index c4f8470..177034e 100644 --- a/server/api/userNotification/userNotification.attributes.js +++ b/server/api/userNotification/userNotification.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3b7c=['TEXT','BOOLEAN','sequelize','exports','STRING'];(function(_0x5632ff,_0x35158e){var _0x12726c=function(_0xea2c98){while(--_0xea2c98){_0x5632ff['push'](_0x5632ff['shift']());}};_0x12726c(++_0x35158e);}(_0x3b7c,0x7f));var _0xc3b7=function(_0x4e5960,_0x5c1bf0){_0x4e5960=_0x4e5960-0x0;var _0x38cf9a=_0x3b7c[_0x4e5960];return _0x38cf9a;};'use strict';var Sequelize=require(_0xc3b7('0x0'));module[_0xc3b7('0x1')]={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize[_0xc3b7('0x2')]},'recipientsId':{'type':Sequelize[_0xc3b7('0x3')]},'recipientsDescription':{'type':Sequelize[_0xc3b7('0x2')]},'beep':{'type':Sequelize[_0xc3b7('0x4')]}}; \ No newline at end of file +var _0x53bd=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x53bd,0x186));var _0xd53b=function(_0x747227,_0x347936){_0x747227=_0x747227-0x0;var _0x452f92=_0x53bd[_0x747227];return _0x452f92;};'use strict';var Sequelize=require(_0xd53b('0x0'));module[_0xd53b('0x1')]={'body':{'type':Sequelize[_0xd53b('0x2')]},'senderName':{'type':Sequelize[_0xd53b('0x3')]},'recipientsId':{'type':Sequelize[_0xd53b('0x2')]},'recipientsDescription':{'type':Sequelize[_0xd53b('0x3')]},'beep':{'type':Sequelize[_0xd53b('0x4')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 39625ff..fbee90c 100644 --- a/server/api/userNotification/userNotification.controller.js +++ b/server/api/userNotification/userNotification.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1af7=['join','sequelize','transaction','create','recipient','emit','userNotification:send','catch','text','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','forEach','User','ids','includes','queue','Queue','all','union','getAgents','zip-dir','fast-json-patch','moment','mustache','sox','to-csv','ejs','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','update','then','destroy','error','sendUserNotification','body','hasOwnProperty','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','faxqueue','mailqueue','openchannelqueue','voicequeue','team','user','some','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','beep','sortBy'];(function(_0x582efa,_0x3d749d){var _0x2868bf=function(_0x34d86f){while(--_0x34d86f){_0x582efa['push'](_0x582efa['shift']());}};_0x2868bf(++_0x3d749d);}(_0x1af7,0x1ce));var _0x71af=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x1af7[_0x57b54c];return _0x59cc19;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x71af('0x0'));var jsonpatch=require(_0x71af('0x1'));var rp=require('request-promise');var moment=require(_0x71af('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x71af('0x3'));var util=require('util');var path=require('path');var sox=require(_0x71af('0x4'));var csv=require(_0x71af('0x5'));var ejs=require(_0x71af('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x71af('0x7'));var crypto=require(_0x71af('0x8'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x71af('0x5'));var querystring=require('querystring');var Papa=require(_0x71af('0x9'));var Redis=require(_0x71af('0xa'));var authService=require(_0x71af('0xb'));var qs=require(_0x71af('0xc'));var as=require(_0x71af('0xd'));var hardwareService=require(_0x71af('0xe'));var logger=require(_0x71af('0xf'))(_0x71af('0x10'));var utils=require('../../config/utils');var config=require(_0x71af('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0x71af('0x12'))['db'];config[_0x71af('0x13')]=_[_0x71af('0x14')](config[_0x71af('0x13')],{'host':_0x71af('0x15'),'port':0x18eb});var socket=require(_0x71af('0x16'))(new Redis(config[_0x71af('0x13')]));require(_0x71af('0x17'))[_0x71af('0x18')](socket);function respondWithStatusCode(_0x3eac72,_0x366822){_0x366822=_0x366822||0xcc;return function(_0x4c22ef){if(_0x4c22ef){return _0x3eac72[_0x71af('0x19')](_0x366822);}return _0x3eac72[_0x71af('0x1a')](_0x366822)[_0x71af('0x1b')]();};}function respondWithResult(_0x4cd40a,_0x579fb7){_0x579fb7=_0x579fb7||0xc8;return function(_0x27195f){if(_0x27195f){return _0x4cd40a[_0x71af('0x1a')](_0x579fb7)[_0x71af('0x1c')](_0x27195f);}};}function respondWithFilteredResult(_0x43145c,_0x81973a){return function(_0x3fc921){if(_0x3fc921){var _0xfb5dca=typeof _0x81973a[_0x71af('0x1d')]==='undefined'&&typeof _0x81973a[_0x71af('0x1e')]===_0x71af('0x1f');var _0x3afa89=_0x3fc921[_0x71af('0x20')];var _0x594cb3=_0xfb5dca?0x0:_0x81973a['offset'];var _0x2411d0=_0xfb5dca?_0x3fc921[_0x71af('0x20')]:_0x81973a['offset']+_0x81973a['limit'];var _0x4246f7;if(_0x2411d0>=_0x3afa89){_0x2411d0=_0x3afa89;_0x4246f7=0xc8;}else{_0x4246f7=0xce;}_0x43145c[_0x71af('0x1a')](_0x4246f7);return _0x43145c[_0x71af('0x21')](_0x71af('0x22'),_0x594cb3+'-'+_0x2411d0+'/'+_0x3afa89)['json'](_0x3fc921);}return null;};}function patchUpdates(_0x3ad1e3){return function(_0x1b767f){try{jsonpatch['apply'](_0x1b767f,_0x3ad1e3,!![]);}catch(_0x4e24a4){return BPromise[_0x71af('0x23')](_0x4e24a4);}return _0x1b767f['save']();};}function saveUpdates(_0x5d20ac,_0x2d1ce4){return function(_0x15b366){if(_0x15b366){return _0x15b366[_0x71af('0x24')](_0x5d20ac)[_0x71af('0x25')](function(_0x5c260f){return _0x5c260f;});}return null;};}function removeEntity(_0xdbfd4e,_0x4fb3e7){return function(_0x4c6db9){if(_0x4c6db9){return _0x4c6db9[_0x71af('0x26')]()[_0x71af('0x25')](function(){_0xdbfd4e[_0x71af('0x1a')](0xcc)[_0x71af('0x1b')]();});}};}function handleEntityNotFound(_0x5133f5,_0x4f75ec){return function(_0x17aea7){if(!_0x17aea7){_0x5133f5[_0x71af('0x19')](0x194);}return _0x17aea7;};}function handleError(_0x3425ab,_0x22b631){_0x22b631=_0x22b631||0x1f4;return function(_0x568d5b){logger[_0x71af('0x27')](_0x568d5b['stack']);if(_0x568d5b['name']){delete _0x568d5b['name'];}_0x3425ab[_0x71af('0x1a')](_0x22b631)['send'](_0x568d5b);};}exports[_0x71af('0x28')]=function(_0x4719d5,_0x1655a6,_0x2b9cec){if(!_0x4719d5[_0x71af('0x29')]['hasOwnProperty']('text')&&!_0x4719d5[_0x71af('0x29')][_0x71af('0x2a')](_0x71af('0x2b'))){throw new db[(_0x71af('0x2c'))][(_0x71af('0x2d'))](_0x71af('0x2e'));}else{if(_0x4719d5['body'][_0x71af('0x2a')](_0x71af('0x2b'))&&!_0x4719d5[_0x71af('0x29')][_0x71af('0x2a')](_0x71af('0x2f'))){throw new db[(_0x71af('0x2c'))]['ValidationError']('Missing\x20\x27view\x27\x20parameter');}if(!_0x4719d5[_0x71af('0x29')][_0x71af('0x2a')]('recipients')){throw new db[(_0x71af('0x2c'))][(_0x71af('0x2d'))](_0x71af('0x30'));}else{try{var _0x42aa00=JSON[_0x71af('0x31')](_0x4719d5[_0x71af('0x29')]['recipients']);}catch(_0x5d0e5f){logger[_0x71af('0x27')](_0x5d0e5f);throw new db[(_0x71af('0x2c'))][(_0x71af('0x2d'))](_0x71af('0x32'));}var _0x1ea299=['chatqueue',_0x71af('0x33'),_0x71af('0x34'),_0x71af('0x35'),'smsqueue',_0x71af('0x36'),'whatsappqueue',_0x71af('0x37'),_0x71af('0x38')];if(_[_0x71af('0x39')](_0x42aa00,function(_0x188b53){return!_['includes'](_0x1ea299,_0x188b53[_0x71af('0x3a')][_0x71af('0x3b')]());})){throw new db['Sequelize'][(_0x71af('0x2d'))](_0x71af('0x3c'));}}}var _0x1aeab2={};_0x1aeab2[_0x71af('0x3d')]=_0x4719d5[_0x71af('0x29')][_0x71af('0x2a')](_0x71af('0x3d'))?_0x4719d5['body'][_0x71af('0x3d')]:_0x4719d5[_0x71af('0x38')][_0x71af('0x3e')];_0x1aeab2[_0x71af('0x3f')]=_['isEmpty'](_0x4719d5[_0x71af('0x29')][_0x71af('0x3f')])?null:_0x4719d5[_0x71af('0x29')][_0x71af('0x3f')];_0x1aeab2[_0x71af('0x40')]=_0x4719d5[_0x71af('0x29')]['beep']||![];_0x1aeab2['SenderId']=_0x4719d5[_0x71af('0x38')]['id'];return getContent(_0x4719d5[_0x71af('0x29')])[_0x71af('0x25')](function(_0x4cbd27){_0x1aeab2[_0x71af('0x29')]=_0x4cbd27;return getRecipients(_0x42aa00);})[_0x71af('0x25')](function(_0x12e838){_0x1aeab2['recipientsId']=_[_0x71af('0x41')](_0x12e838)[_0x71af('0x42')](',');return db[_0x71af('0x43')][_0x71af('0x44')](function(_0x593a97){return db['UserNotification'][_0x71af('0x45')](_0x1aeab2,{'raw':!![],'transaction':_0x593a97})[_0x71af('0x25')](function(_0x1c7f83){var _0x4bd0a6={'sender':_0x1aeab2[_0x71af('0x3d')],'description':_0x1aeab2['recipientsDescription'],'content':_0x1aeab2[_0x71af('0x29')],'beep':_0x1aeab2[_0x71af('0x40')]};_0x12e838['forEach'](function(_0x430e9e){_0x4bd0a6[_0x71af('0x46')]=_0x430e9e;socket[_0x71af('0x47')](_0x71af('0x48'),_0x4bd0a6);});return _0x1c7f83;});});})[_0x71af('0x25')](respondWithResult(_0x1655a6,0xc9))[_0x71af('0x49')](handleError(_0x1655a6,null));};function getContent(_0x5961d3){return new BPromise(function(_0x1b277c,_0x4bf916){if(_0x5961d3[_0x71af('0x4a')]){_0x1b277c(_0x5961d3[_0x71af('0x4a')]);return;}return db['Template'][_0x71af('0x4b')]({'attributes':[_0x71af('0x4c')],'where':{'id':_0x5961d3['TemplateId']},'raw':!![]})[_0x71af('0x25')](function(_0x23df23){if(!_0x23df23)throw new db[(_0x71af('0x2c'))][(_0x71af('0x2d'))](_0x71af('0x4d'));var _0x359c06=Mustache[_0x71af('0x4e')](_0x23df23[_0x71af('0x4c')],_0x5961d3['view']);_0x1b277c(_0x359c06);})[_0x71af('0x49')](function(_0x26029c){_0x4bf916(_0x26029c);});});}function getRecipients(_0x371539){return new BPromise(function(_0x1a3a81,_0x4b650a){var _0xe2638=[];var _0x1058d9=[];_0x371539[_0x71af('0x4f')](function(_0x46bfca){var _0x3a772c=_['startCase'](_0x46bfca[_0x71af('0x3a')][_0x71af('0x3b')]());if(_0x3a772c===_0x71af('0x50')){_0xe2638=_['union'](_0xe2638,_0x46bfca[_0x71af('0x51')]);}else{if(_[_0x71af('0x52')](_0x3a772c,_0x71af('0x53')))_0x3a772c=_0x3a772c['replace'](_0x71af('0x53'),_0x71af('0x54'));_0x46bfca[_0x71af('0x51')][_0x71af('0x4f')](function(_0x5998f1){_0x1058d9['push'](getAgents(_0x3a772c,_0x5998f1));});}});return BPromise[_0x71af('0x55')](_0x1058d9)['then'](function(_0x4ff374){_0xe2638=_[_0x71af('0x56')](_0xe2638,_['flatten'](_0x4ff374));_0x1a3a81(_0xe2638);})[_0x71af('0x49')](function(_0x1148d6){_0x4b650a(_0x1148d6);});});}function getAgents(_0x2341fc,_0x4f418b){return new BPromise(function(_0x4e6ab2,_0x395d7b){return db[_0x2341fc]['findOne']({'where':{'id':_0x4f418b}})[_0x71af('0x25')](function(_0x167b06){return _0x167b06[_0x71af('0x57')]({'attributes':['id'],'raw':!![]})['then'](function(_0x1527c0){var _0x410860=_['map'](_0x1527c0,'id');_0x4e6ab2(_0x410860);});})[_0x71af('0x49')](function(_0x229412){_0x395d7b(_0x229412);});});} \ No newline at end of file +var _0x11e9=['TemplateId','Sequelize','ValidationError','view','Missing\x20\x27view\x27\x20parameter','recipients','parse','error','chatqueue','faxqueue','smsqueue','whatsappqueue','user','some','includes','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','sortBy','join','sequelize','transaction','UserNotification','create','forEach','emit','userNotification:send','catch','html','Invalid\x20\x27TemplateId\x27\x20parameter','model','union','replace','queue','ids','push','all','flatten','findOne','getAgents','map','eml-format','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./userNotification.socket','register','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','stack','name','send','sendUserNotification','body','hasOwnProperty','text'];(function(_0x58df7d,_0x46456e){var _0x3437c0=function(_0x488e0c){while(--_0x488e0c){_0x58df7d['push'](_0x58df7d['shift']());}};_0x3437c0(++_0x46456e);}(_0x11e9,0xeb));var _0x911e=function(_0x44ba61,_0x381224){_0x44ba61=_0x44ba61-0x0;var _0x2f5637=_0x11e9[_0x44ba61];return _0x2f5637;};'use strict';var emlformat=require(_0x911e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x911e('0x1'));var rp=require(_0x911e('0x2'));var moment=require(_0x911e('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x911e('0x4'));var path=require('path');var sox=require(_0x911e('0x5'));var csv=require(_0x911e('0x6'));var ejs=require(_0x911e('0x7'));var fs=require('fs');var fs_extra=require(_0x911e('0x8'));var _=require(_0x911e('0x9'));var squel=require(_0x911e('0xa'));var crypto=require('crypto');var jsforce=require(_0x911e('0xb'));var deskjs=require(_0x911e('0xc'));var toCsv=require('to-csv');var querystring=require(_0x911e('0xd'));var Papa=require(_0x911e('0xe'));var Redis=require(_0x911e('0xf'));var authService=require(_0x911e('0x10'));var qs=require(_0x911e('0x11'));var as=require(_0x911e('0x12'));var hardwareService=require(_0x911e('0x13'));var logger=require('../../config/logger')(_0x911e('0x14'));var utils=require(_0x911e('0x15'));var config=require(_0x911e('0x16'));var licenseUtil=require(_0x911e('0x17'));var db=require('../../mysqldb')['db'];config[_0x911e('0x18')]=_[_0x911e('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x911e('0x1a'))(new Redis(config[_0x911e('0x18')]));require(_0x911e('0x1b'))[_0x911e('0x1c')](socket);function respondWithStatusCode(_0x11d582,_0x4106bc){_0x4106bc=_0x4106bc||0xcc;return function(_0x4e6ab3){if(_0x4e6ab3){return _0x11d582[_0x911e('0x1d')](_0x4106bc);}return _0x11d582['status'](_0x4106bc)[_0x911e('0x1e')]();};}function respondWithResult(_0x1a0943,_0x2c76ed){_0x2c76ed=_0x2c76ed||0xc8;return function(_0x4ad4c3){if(_0x4ad4c3){return _0x1a0943[_0x911e('0x1f')](_0x2c76ed)[_0x911e('0x20')](_0x4ad4c3);}};}function respondWithFilteredResult(_0x57ea66,_0xb1d8f){return function(_0x86789f){if(_0x86789f){var _0x8649c7=typeof _0xb1d8f[_0x911e('0x21')]===_0x911e('0x22')&&typeof _0xb1d8f['limit']===_0x911e('0x22');var _0x41fdfa=_0x86789f[_0x911e('0x23')];var _0x574755=_0x8649c7?0x0:_0xb1d8f[_0x911e('0x21')];var _0xb4fd00=_0x8649c7?_0x86789f[_0x911e('0x23')]:_0xb1d8f['offset']+_0xb1d8f[_0x911e('0x24')];var _0x504e44;if(_0xb4fd00>=_0x41fdfa){_0xb4fd00=_0x41fdfa;_0x504e44=0xc8;}else{_0x504e44=0xce;}_0x57ea66[_0x911e('0x1f')](_0x504e44);return _0x57ea66[_0x911e('0x25')](_0x911e('0x26'),_0x574755+'-'+_0xb4fd00+'/'+_0x41fdfa)[_0x911e('0x20')](_0x86789f);}return null;};}function patchUpdates(_0x2a5a07){return function(_0x28fc89){try{jsonpatch[_0x911e('0x27')](_0x28fc89,_0x2a5a07,!![]);}catch(_0x1cd875){return BPromise['reject'](_0x1cd875);}return _0x28fc89[_0x911e('0x28')]();};}function saveUpdates(_0x1b7650,_0x82389e){return function(_0x22d1c8){if(_0x22d1c8){return _0x22d1c8[_0x911e('0x29')](_0x1b7650)[_0x911e('0x2a')](function(_0x424452){return _0x424452;});}return null;};}function removeEntity(_0xe294df,_0x228123){return function(_0x5a6b43){if(_0x5a6b43){return _0x5a6b43['destroy']()[_0x911e('0x2a')](function(){_0xe294df[_0x911e('0x1f')](0xcc)[_0x911e('0x1e')]();});}};}function handleEntityNotFound(_0xcb4ce7,_0x19dbdd){return function(_0x41df0e){if(!_0x41df0e){_0xcb4ce7[_0x911e('0x1d')](0x194);}return _0x41df0e;};}function handleError(_0x131f84,_0x133363){_0x133363=_0x133363||0x1f4;return function(_0x3cf670){logger['error'](_0x3cf670[_0x911e('0x2b')]);if(_0x3cf670[_0x911e('0x2c')]){delete _0x3cf670['name'];}_0x131f84[_0x911e('0x1f')](_0x133363)[_0x911e('0x2d')](_0x3cf670);};}exports[_0x911e('0x2e')]=function(_0x12706c,_0x406161,_0xa63d8){if(!_0x12706c[_0x911e('0x2f')][_0x911e('0x30')](_0x911e('0x31'))&&!_0x12706c['body'][_0x911e('0x30')](_0x911e('0x32'))){throw new db[(_0x911e('0x33'))][(_0x911e('0x34'))]('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x12706c[_0x911e('0x2f')][_0x911e('0x30')]('TemplateId')&&!_0x12706c[_0x911e('0x2f')]['hasOwnProperty'](_0x911e('0x35'))){throw new db[(_0x911e('0x33'))][(_0x911e('0x34'))](_0x911e('0x36'));}if(!_0x12706c[_0x911e('0x2f')][_0x911e('0x30')](_0x911e('0x37'))){throw new db['Sequelize'][(_0x911e('0x34'))]('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x222814=JSON[_0x911e('0x38')](_0x12706c[_0x911e('0x2f')]['recipients']);}catch(_0x151be2){logger[_0x911e('0x39')](_0x151be2);throw new db[(_0x911e('0x33'))][(_0x911e('0x34'))]('Invalid\x20\x27recipients\x27\x20object');}var _0x59738b=[_0x911e('0x3a'),_0x911e('0x3b'),'mailqueue','openchannelqueue',_0x911e('0x3c'),'voicequeue',_0x911e('0x3d'),'team',_0x911e('0x3e')];if(_[_0x911e('0x3f')](_0x222814,function(_0x3b2929){return!_[_0x911e('0x40')](_0x59738b,_0x3b2929['model']['toLowerCase']());})){throw new db[(_0x911e('0x33'))][(_0x911e('0x34'))](_0x911e('0x41'));}}}var _0x5dc976={};_0x5dc976[_0x911e('0x42')]=_0x12706c[_0x911e('0x2f')][_0x911e('0x30')](_0x911e('0x42'))?_0x12706c[_0x911e('0x2f')][_0x911e('0x42')]:_0x12706c[_0x911e('0x3e')][_0x911e('0x43')];_0x5dc976[_0x911e('0x44')]=_[_0x911e('0x45')](_0x12706c[_0x911e('0x2f')][_0x911e('0x44')])?null:_0x12706c[_0x911e('0x2f')][_0x911e('0x44')];_0x5dc976[_0x911e('0x46')]=_0x12706c[_0x911e('0x2f')][_0x911e('0x46')]||![];_0x5dc976[_0x911e('0x47')]=_0x12706c['user']['id'];return getContent(_0x12706c[_0x911e('0x2f')])['then'](function(_0x12cb77){_0x5dc976[_0x911e('0x2f')]=_0x12cb77;return getRecipients(_0x222814);})[_0x911e('0x2a')](function(_0x3c2316){_0x5dc976['recipientsId']=_[_0x911e('0x48')](_0x3c2316)[_0x911e('0x49')](',');return db[_0x911e('0x4a')][_0x911e('0x4b')](function(_0x1c7fb2){return db[_0x911e('0x4c')][_0x911e('0x4d')](_0x5dc976,{'raw':!![],'transaction':_0x1c7fb2})['then'](function(_0x28b637){var _0x2f1501={'sender':_0x5dc976[_0x911e('0x42')],'description':_0x5dc976['recipientsDescription'],'content':_0x5dc976[_0x911e('0x2f')],'beep':_0x5dc976[_0x911e('0x46')]};_0x3c2316[_0x911e('0x4e')](function(_0x267e18){_0x2f1501['recipient']=_0x267e18;socket[_0x911e('0x4f')](_0x911e('0x50'),_0x2f1501);});return _0x28b637;});});})[_0x911e('0x2a')](respondWithResult(_0x406161,0xc9))[_0x911e('0x51')](handleError(_0x406161,null));};function getContent(_0x4ef4f5){return new BPromise(function(_0x2e3531,_0x5ce902){if(_0x4ef4f5['text']){_0x2e3531(_0x4ef4f5[_0x911e('0x31')]);return;}return db['Template']['findOne']({'attributes':[_0x911e('0x52')],'where':{'id':_0x4ef4f5['TemplateId']},'raw':!![]})[_0x911e('0x2a')](function(_0x1a9223){if(!_0x1a9223)throw new db[(_0x911e('0x33'))][(_0x911e('0x34'))](_0x911e('0x53'));var _0x1a6453=Mustache['render'](_0x1a9223['html'],_0x4ef4f5[_0x911e('0x35')]);_0x2e3531(_0x1a6453);})[_0x911e('0x51')](function(_0x462952){_0x5ce902(_0x462952);});});}function getRecipients(_0x1cfc0c){return new BPromise(function(_0x59f368,_0x12707a){var _0x24f03a=[];var _0x19a13e=[];_0x1cfc0c[_0x911e('0x4e')](function(_0xd10a1d){var _0x9149ef=_['startCase'](_0xd10a1d[_0x911e('0x54')]['toLowerCase']());if(_0x9149ef==='User'){_0x24f03a=_[_0x911e('0x55')](_0x24f03a,_0xd10a1d['ids']);}else{if(_[_0x911e('0x40')](_0x9149ef,'queue'))_0x9149ef=_0x9149ef[_0x911e('0x56')](_0x911e('0x57'),'Queue');_0xd10a1d[_0x911e('0x58')]['forEach'](function(_0x18c475){_0x19a13e[_0x911e('0x59')](getAgents(_0x9149ef,_0x18c475));});}});return BPromise[_0x911e('0x5a')](_0x19a13e)[_0x911e('0x2a')](function(_0x226057){_0x24f03a=_['union'](_0x24f03a,_[_0x911e('0x5b')](_0x226057));_0x59f368(_0x24f03a);})[_0x911e('0x51')](function(_0x4039ac){_0x12707a(_0x4039ac);});});}function getAgents(_0x160a92,_0xd49617){return new BPromise(function(_0x1861b4,_0x3ff618){return db[_0x160a92][_0x911e('0x5c')]({'where':{'id':_0xd49617}})[_0x911e('0x2a')](function(_0x3992ee){return _0x3992ee[_0x911e('0x5d')]({'attributes':['id'],'raw':!![]})['then'](function(_0x4915d8){var _0x5e9164=_[_0x911e('0x5e')](_0x4915d8,'id');_0x1861b4(_0x5e9164);});})[_0x911e('0x51')](function(_0x3c9f27){_0x3ff618(_0x3c9f27);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 7cc598e..77a3970 100644 --- a/server/api/userNotification/userNotification.events.js +++ b/server/api/userNotification/userNotification.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb50=['events','../../mysqldb','update','emit','hasOwnProperty','hook'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xdb50,0x7e));var _0x0db5=function(_0x268d6c,_0x38f9c3){_0x268d6c=_0x268d6c-0x0;var _0x885e9e=_0xdb50[_0x268d6c];return _0x885e9e;};'use strict';var EventEmitter=require(_0x0db5('0x0'));var UserNotification=require(_0x0db5('0x1'))['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x0db5('0x2'),'afterDestroy':'remove'};function emitEvent(_0x3174b6){return function(_0x3e7010,_0xeac505,_0xe57d60){UserNotificationEvents[_0x0db5('0x3')](_0x3174b6+':'+_0x3e7010['id'],_0x3e7010);UserNotificationEvents['emit'](_0x3174b6,_0x3e7010);_0xe57d60(null);};}for(var e in events){if(events[_0x0db5('0x4')](e)){var event=events[e];UserNotification[_0x0db5('0x5')](e,emitEvent(event));}}module['exports']=UserNotificationEvents; \ No newline at end of file +var _0x8223=['../../mysqldb','update','emit','exports','events'];(function(_0x322522,_0x4db288){var _0x293bcf=function(_0xf108b8){while(--_0xf108b8){_0x322522['push'](_0x322522['shift']());}};_0x293bcf(++_0x4db288);}(_0x8223,0x108));var _0x3822=function(_0x15503e,_0x2ce699){_0x15503e=_0x15503e-0x0;var _0x271c52=_0x8223[_0x15503e];return _0x271c52;};'use strict';var EventEmitter=require(_0x3822('0x0'));var UserNotification=require(_0x3822('0x1'))['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x3822('0x2'),'afterDestroy':'remove'};function emitEvent(_0x56b3de){return function(_0xdbbd2c,_0x276c9a,_0x543058){UserNotificationEvents[_0x3822('0x3')](_0x56b3de+':'+_0xdbbd2c['id'],_0xdbbd2c);UserNotificationEvents['emit'](_0x56b3de,_0xdbbd2c);_0x543058(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0x3822('0x4')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index b8cabc4..b547c0f 100644 --- a/server/api/userNotification/userNotification.model.js +++ b/server/api/userNotification/userNotification.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0254=['request-promise','path','rimraf','../../config/environment','./userNotification.attributes','define','UserNotification','utf8mb4','lodash','../../config/logger','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0254,0x11c));var _0x4025=function(_0x388642,_0x28bd27){_0x388642=_0x388642-0x0;var _0x18adc2=_0x0254[_0x388642];return _0x18adc2;};'use strict';var _=require(_0x4025('0x0'));var util=require('util');var logger=require(_0x4025('0x1'))('api');var moment=require(_0x4025('0x2'));var BPromise=require(_0x4025('0x3'));var rp=require(_0x4025('0x4'));var fs=require('fs');var path=require(_0x4025('0x5'));var rimraf=require(_0x4025('0x6'));var config=require(_0x4025('0x7'));var attributes=require(_0x4025('0x8'));module['exports']=function(_0x48f27d,_0x54a076){return _0x48f27d[_0x4025('0x9')](_0x4025('0xa'),attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4025('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x8b15=['exports','define','UserNotification','userNotifications','utf8mb4_unicode_ci','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userNotification.attributes'];(function(_0x22bdd3,_0x552e50){var _0x44d9d9=function(_0x2b4ab9){while(--_0x2b4ab9){_0x22bdd3['push'](_0x22bdd3['shift']());}};_0x44d9d9(++_0x552e50);}(_0x8b15,0x130));var _0x58b1=function(_0x2216b3,_0x2892b3){_0x2216b3=_0x2216b3-0x0;var _0x514d21=_0x8b15[_0x2216b3];return _0x514d21;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x58b1('0x0'));var moment=require(_0x58b1('0x1'));var BPromise=require(_0x58b1('0x2'));var rp=require(_0x58b1('0x3'));var fs=require('fs');var path=require(_0x58b1('0x4'));var rimraf=require(_0x58b1('0x5'));var config=require(_0x58b1('0x6'));var attributes=require(_0x58b1('0x7'));module[_0x58b1('0x8')]=function(_0x29e86d,_0x45b032){return _0x29e86d[_0x58b1('0x9')](_0x58b1('0xa'),attributes,{'tableName':_0x58b1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x58b1('0xc')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 41a8eb5..68b35cf 100644 --- a/server/api/userNotification/userNotification.rpc.js +++ b/server/api/userNotification/userNotification.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe56d=['randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','register','request','info','UserNotification,\x20%s,\x20%s','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','util','moment','bluebird'];(function(_0x28661f,_0x2bfcd6){var _0x1aac56=function(_0x3f6fc4){while(--_0x3f6fc4){_0x28661f['push'](_0x28661f['shift']());}};_0x1aac56(++_0x2bfcd6);}(_0xe56d,0x65));var _0xde56=function(_0x1b1a3b,_0x52a88a){_0x1b1a3b=_0x1b1a3b-0x0;var _0x385347=_0xe56d[_0x1b1a3b];return _0x385347;};'use strict';var _=require('lodash');var util=require(_0xde56('0x0'));var moment=require(_0xde56('0x1'));var BPromise=require(_0xde56('0x2'));var rs=require(_0xde56('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xde56('0x4'));var logger=require(_0xde56('0x5'))(_0xde56('0x6'));var config=require(_0xde56('0x7'));var jayson=require(_0xde56('0x8'));var client=jayson[_0xde56('0x9')][_0xde56('0xa')]({'port':0x232a});config[_0xde56('0xb')]=_[_0xde56('0xc')](config[_0xde56('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xde56('0xb')]));require('./userNotification.socket')[_0xde56('0xd')](socket);function respondWithRpcPromise(_0x54ab71,_0x458643,_0x564f34){return new BPromise(function(_0x474a9a,_0x542134){return client[_0xde56('0xe')](_0x54ab71,_0x564f34)['then'](function(_0x327ae2){logger[_0xde56('0xf')](_0xde56('0x10'),_0x458643,'request\x20sent');logger[_0xde56('0x11')](_0xde56('0x12'),_0x458643,'request\x20sent',JSON[_0xde56('0x13')](_0x327ae2));if(_0x327ae2[_0xde56('0x14')]){if(_0x327ae2['error'][_0xde56('0x15')]===0x1f4){logger[_0xde56('0x14')]('UserNotification,\x20%s,\x20%s',_0x458643,_0x327ae2[_0xde56('0x14')][_0xde56('0x16')]);return _0x542134(_0x327ae2[_0xde56('0x14')][_0xde56('0x16')]);}logger[_0xde56('0x14')](_0xde56('0x10'),_0x458643,_0x327ae2[_0xde56('0x14')][_0xde56('0x16')]);return _0x474a9a(_0x327ae2[_0xde56('0x14')][_0xde56('0x16')]);}else{logger[_0xde56('0xf')](_0xde56('0x10'),_0x458643,_0xde56('0x17'));_0x474a9a(_0x327ae2[_0xde56('0x18')][_0xde56('0x16')]);}})[_0xde56('0x19')](function(_0x3ac8c5){logger['error'](_0xde56('0x10'),_0x458643,_0x3ac8c5);_0x542134(_0x3ac8c5);});});} \ No newline at end of file +var _0x903d=['then','info','debug','UserNotification,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','UserNotification,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','redis','socket.io-emitter','./userNotification.socket','register','request'];(function(_0xc4e3dd,_0x383223){var _0x4d02ed=function(_0x348cc2){while(--_0x348cc2){_0xc4e3dd['push'](_0xc4e3dd['shift']());}};_0x4d02ed(++_0x383223);}(_0x903d,0xf9));var _0xd903=function(_0x3e65f6,_0x36f728){_0x3e65f6=_0x3e65f6-0x0;var _0x552607=_0x903d[_0x3e65f6];return _0x552607;};'use strict';var _=require(_0xd903('0x0'));var util=require(_0xd903('0x1'));var moment=require(_0xd903('0x2'));var BPromise=require(_0xd903('0x3'));var rs=require(_0xd903('0x4'));var fs=require('fs');var Redis=require(_0xd903('0x5'));var db=require(_0xd903('0x6'))['db'];var utils=require(_0xd903('0x7'));var logger=require(_0xd903('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd903('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0xd903('0xa')]=_['defaults'](config[_0xd903('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xd903('0xb'))(new Redis(config[_0xd903('0xa')]));require(_0xd903('0xc'))[_0xd903('0xd')](socket);function respondWithRpcPromise(_0x12c8c0,_0x12a5a6,_0xad99e2){return new BPromise(function(_0x532a20,_0x3862f1){return client[_0xd903('0xe')](_0x12c8c0,_0xad99e2)[_0xd903('0xf')](function(_0x293e85){logger[_0xd903('0x10')]('UserNotification,\x20%s,\x20%s',_0x12a5a6,'request\x20sent');logger[_0xd903('0x11')](_0xd903('0x12'),_0x12a5a6,_0xd903('0x13'),JSON['stringify'](_0x293e85));if(_0x293e85[_0xd903('0x14')]){if(_0x293e85[_0xd903('0x14')][_0xd903('0x15')]===0x1f4){logger[_0xd903('0x14')](_0xd903('0x16'),_0x12a5a6,_0x293e85[_0xd903('0x14')]['message']);return _0x3862f1(_0x293e85['error'][_0xd903('0x17')]);}logger[_0xd903('0x14')]('UserNotification,\x20%s,\x20%s',_0x12a5a6,_0x293e85[_0xd903('0x14')][_0xd903('0x17')]);return _0x532a20(_0x293e85['error'][_0xd903('0x17')]);}else{logger[_0xd903('0x10')]('UserNotification,\x20%s,\x20%s',_0x12a5a6,_0xd903('0x13'));_0x532a20(_0x293e85['result'][_0xd903('0x17')]);}})['catch'](function(_0x5023d0){logger[_0xd903('0x14')](_0xd903('0x16'),_0x12a5a6,_0x5023d0);_0x3862f1(_0x5023d0);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index ea20470..f10fa91 100644 --- a/server/api/userNotification/userNotification.socket.js +++ b/server/api/userNotification/userNotification.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xba21=['remove','update','emit','removeListener','register','length','userNotification:','./userNotification.events','save'];(function(_0x263f20,_0x1a044e){var _0xa8429f=function(_0x23705e){while(--_0x23705e){_0x263f20['push'](_0x263f20['shift']());}};_0xa8429f(++_0x1a044e);}(_0xba21,0xb2));var _0x1ba2=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xba21[_0x321bb2];return _0x9c12ed;};'use strict';var UserNotificationEvents=require(_0x1ba2('0x0'));var events=[_0x1ba2('0x1'),_0x1ba2('0x2'),_0x1ba2('0x3')];function createListener(_0x388f99,_0x24fff5){return function(_0x2a45d4){_0x24fff5[_0x1ba2('0x4')](_0x388f99,_0x2a45d4);};}function removeListener(_0x5e9943,_0xafe6fb){return function(){UserNotificationEvents[_0x1ba2('0x5')](_0x5e9943,_0xafe6fb);};}exports[_0x1ba2('0x6')]=function(_0x4480a1){for(var _0x3c70d4=0x0,_0x3a15dc=events[_0x1ba2('0x7')];_0x3c70d4<_0x3a15dc;_0x3c70d4++){var _0x133d83=events[_0x3c70d4];var _0x11bc0f=createListener(_0x1ba2('0x8')+_0x133d83,_0x4480a1);UserNotificationEvents['on'](_0x133d83,_0x11bc0f);}}; \ No newline at end of file +var _0x8483=['length','userNotification:','save','removeListener','register'];(function(_0xaaa00,_0x158555){var _0x344271=function(_0xf0b2b9){while(--_0xf0b2b9){_0xaaa00['push'](_0xaaa00['shift']());}};_0x344271(++_0x158555);}(_0x8483,0x101));var _0x3848=function(_0x45d0bf,_0x60da2b){_0x45d0bf=_0x45d0bf-0x0;var _0x285d1e=_0x8483[_0x45d0bf];return _0x285d1e;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=[_0x3848('0x0'),'remove','update'];function createListener(_0x20ca30,_0x3305b3){return function(_0xe08ed7){_0x3305b3['emit'](_0x20ca30,_0xe08ed7);};}function removeListener(_0x18d987,_0x532082){return function(){UserNotificationEvents[_0x3848('0x1')](_0x18d987,_0x532082);};}exports[_0x3848('0x2')]=function(_0x105e34){for(var _0x3fb081=0x0,_0x57d34d=events[_0x3848('0x3')];_0x3fb081<_0x57d34d;_0x3fb081++){var _0x58b6ad=events[_0x3fb081];var _0x6c1da5=createListener(_0x3848('0x4')+_0x58b6ad,_0x105e34);UserNotificationEvents['on'](_0x58b6ad,_0x6c1da5);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index aea04f9..585fbd1 100644 --- a/server/api/userOpenchannelQueue/index.js +++ b/server/api/userOpenchannelQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x76d0dd,_0x16716d){var _0x508d20=function(_0x15af09){while(--_0x15af09){_0x76d0dd['push'](_0x76d0dd['shift']());}};_0x508d20(++_0x16716d);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x466161,_0x29cc00){var _0x2f9c1d=function(_0x1b76cc){while(--_0x1b76cc){_0x466161['push'](_0x466161['shift']());}};_0x2f9c1d(++_0x29cc00);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index d81aa57..b44a07a 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 _0x8457=['INTEGER','sequelize','exports'];(function(_0x6942e0,_0x131e6d){var _0xb86490=function(_0x2fd5d7){while(--_0x2fd5d7){_0x6942e0['push'](_0x6942e0['shift']());}};_0xb86490(++_0x131e6d);}(_0x8457,0x142));var _0x7845=function(_0x19572a,_0x31ff16){_0x19572a=_0x19572a-0x0;var _0x1b9b8e=_0x8457[_0x19572a];return _0x1b9b8e;};'use strict';var Sequelize=require(_0x7845('0x0'));module[_0x7845('0x1')]={'penalty':{'type':Sequelize[_0x7845('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x6061=['sequelize','exports'];(function(_0x48788c,_0x22c6cf){var _0x111b0f=function(_0x4087db){while(--_0x4087db){_0x48788c['push'](_0x48788c['shift']());}};_0x111b0f(++_0x22c6cf);}(_0x6061,0x82));var _0x1606=function(_0x5c7439,_0xf6dc84){_0x5c7439=_0x5c7439-0x0;var _0x4fb665=_0x6061[_0x5c7439];return _0x4fb665;};'use strict';var Sequelize=require(_0x1606('0x0'));module[_0x1606('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index 24cd7b7..81c86a7 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 _0x0a9f=['./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x56f6e9,_0x12b2c4){var _0x42879f=function(_0x31cbd8){while(--_0x31cbd8){_0x56f6e9['push'](_0x56f6e9['shift']());}};_0x42879f(++_0x12b2c4);}(_0x0a9f,0xa0));var _0xf0a9=function(_0xd4f90b,_0x148333){_0xd4f90b=_0xd4f90b-0x0;var _0x451848=_0x0a9f[_0xd4f90b];return _0x451848;};'use strict';var _=require(_0xf0a9('0x0'));var util=require(_0xf0a9('0x1'));var logger=require(_0xf0a9('0x2'))('api');var moment=require(_0xf0a9('0x3'));var BPromise=require(_0xf0a9('0x4'));var rp=require(_0xf0a9('0x5'));var fs=require('fs');var path=require(_0xf0a9('0x6'));var rimraf=require(_0xf0a9('0x7'));var config=require('../../config/environment');var attributes=require(_0xf0a9('0x8'));module[_0xf0a9('0x9')]=function(_0x12b356,_0xba1ac7){return _0x12b356[_0xf0a9('0xa')](_0xf0a9('0xb'),attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9f8d=['UserOpenchannelQueue','user_has_openchannel_queues','lodash','../../config/logger','api','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define'];(function(_0x5c2454,_0x4b1584){var _0xc8a390=function(_0x53220b){while(--_0x53220b){_0x5c2454['push'](_0x5c2454['shift']());}};_0xc8a390(++_0x4b1584);}(_0x9f8d,0x7b));var _0xd9f8=function(_0x57f6df,_0xc89854){_0x57f6df=_0x57f6df-0x0;var _0x423b33=_0x9f8d[_0x57f6df];return _0x423b33;};'use strict';var _=require(_0xd9f8('0x0'));var util=require('util');var logger=require(_0xd9f8('0x1'))(_0xd9f8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd9f8('0x3'));var rimraf=require(_0xd9f8('0x4'));var config=require(_0xd9f8('0x5'));var attributes=require(_0xd9f8('0x6'));module[_0xd9f8('0x7')]=function(_0x5c7964,_0x506fa2){return _0x5c7964[_0xd9f8('0x8')](_0xd9f8('0x9'),attributes,{'tableName':_0xd9f8('0xa'),'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 1a472ae..585ae9e 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 _0xe0b8=['result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x367442,_0xf9e528){var _0x32b6a4=function(_0x22d18c){while(--_0x22d18c){_0x367442['push'](_0x367442['shift']());}};_0x32b6a4(++_0xf9e528);}(_0xe0b8,0x1bb));var _0x8e0b=function(_0x2430ca,_0x43b568){_0x2430ca=_0x2430ca-0x0;var _0x31ca4a=_0xe0b8[_0x2430ca];return _0x31ca4a;};'use strict';var _=require(_0x8e0b('0x0'));var util=require(_0x8e0b('0x1'));var moment=require(_0x8e0b('0x2'));var BPromise=require(_0x8e0b('0x3'));var rs=require(_0x8e0b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8e0b('0x5'));var logger=require(_0x8e0b('0x6'))('rpc');var config=require(_0x8e0b('0x7'));var jayson=require(_0x8e0b('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x48069b,_0x46520c,_0x170be9){return new BPromise(function(_0x44aa14,_0x316025){return client[_0x8e0b('0x9')](_0x48069b,_0x170be9)[_0x8e0b('0xa')](function(_0x551860){logger[_0x8e0b('0xb')](_0x8e0b('0xc'),_0x46520c,_0x8e0b('0xd'));logger[_0x8e0b('0xe')](_0x8e0b('0xf'),_0x46520c,_0x8e0b('0xd'),JSON[_0x8e0b('0x10')](_0x551860));if(_0x551860['error']){if(_0x551860['error']['code']===0x1f4){logger[_0x8e0b('0x11')](_0x8e0b('0xc'),_0x46520c,_0x551860['error'][_0x8e0b('0x12')]);return _0x316025(_0x551860[_0x8e0b('0x11')]['message']);}logger[_0x8e0b('0x11')](_0x8e0b('0xc'),_0x46520c,_0x551860['error'][_0x8e0b('0x12')]);return _0x44aa14(_0x551860[_0x8e0b('0x11')][_0x8e0b('0x12')]);}else{logger[_0x8e0b('0xb')](_0x8e0b('0xc'),_0x46520c,_0x8e0b('0xd'));_0x44aa14(_0x551860[_0x8e0b('0x13')][_0x8e0b('0x12')]);}})[_0x8e0b('0x14')](function(_0x262400){logger[_0x8e0b('0x11')](_0x8e0b('0xc'),_0x46520c,_0x262400);_0x316025(_0x262400);});});} \ No newline at end of file +var _0xd6ae=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x92a987,_0x4415b6){var _0x331f4c=function(_0x223e9d){while(--_0x223e9d){_0x92a987['push'](_0x92a987['shift']());}};_0x331f4c(++_0x4415b6);}(_0xd6ae,0x19d));var _0xed6a=function(_0x4d9743,_0x571915){_0x4d9743=_0x4d9743-0x0;var _0x24a5f6=_0xd6ae[_0x4d9743];return _0x24a5f6;};'use strict';var _=require(_0xed6a('0x0'));var util=require(_0xed6a('0x1'));var moment=require(_0xed6a('0x2'));var BPromise=require(_0xed6a('0x3'));var rs=require(_0xed6a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xed6a('0x5'))['db'];var utils=require(_0xed6a('0x6'));var logger=require(_0xed6a('0x7'))('rpc');var config=require(_0xed6a('0x8'));var jayson=require(_0xed6a('0x9'));var client=jayson['client'][_0xed6a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5857c8,_0x496cac,_0x221364){return new BPromise(function(_0x258e17,_0x40d565){return client[_0xed6a('0xb')](_0x5857c8,_0x221364)[_0xed6a('0xc')](function(_0x5779c4){logger[_0xed6a('0xd')](_0xed6a('0xe'),_0x496cac,_0xed6a('0xf'));logger['debug'](_0xed6a('0x10'),_0x496cac,_0xed6a('0xf'),JSON[_0xed6a('0x11')](_0x5779c4));if(_0x5779c4[_0xed6a('0x12')]){if(_0x5779c4['error'][_0xed6a('0x13')]===0x1f4){logger[_0xed6a('0x12')](_0xed6a('0xe'),_0x496cac,_0x5779c4[_0xed6a('0x12')]['message']);return _0x40d565(_0x5779c4[_0xed6a('0x12')][_0xed6a('0x14')]);}logger[_0xed6a('0x12')](_0xed6a('0xe'),_0x496cac,_0x5779c4[_0xed6a('0x12')][_0xed6a('0x14')]);return _0x258e17(_0x5779c4[_0xed6a('0x12')][_0xed6a('0x14')]);}else{logger[_0xed6a('0xd')](_0xed6a('0xe'),_0x496cac,_0xed6a('0xf'));_0x258e17(_0x5779c4[_0xed6a('0x15')][_0xed6a('0x14')]);}})[_0xed6a('0x16')](function(_0x26d1da){logger[_0xed6a('0x12')](_0xed6a('0xe'),_0x496cac,_0x26d1da);_0x40d565(_0x26d1da);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 8bcb010..189610b 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 _0x8af3=['addResources','put','update','delete','/:id','destroy','removeSections','removeResources','multer','util','connect-timeout','express','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/describe','describe','show','/:id/sections','/:id/resources','post','create','addSections'];(function(_0x30ae2b,_0x35c706){var _0x566ce2=function(_0x1b85bc){while(--_0x1b85bc){_0x30ae2b['push'](_0x30ae2b['shift']());}};_0x566ce2(++_0x35c706);}(_0x8af3,0x140));var _0x38af=function(_0x1556af,_0x15535a){_0x1556af=_0x1556af-0x0;var _0x16d593=_0x8af3[_0x1556af];return _0x16d593;};'use strict';var multer=require(_0x38af('0x0'));var util=require(_0x38af('0x1'));var path=require('path');var timeout=require(_0x38af('0x2'));var express=require(_0x38af('0x3'));var router=express[_0x38af('0x4')]();var fs_extra=require(_0x38af('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x38af('0x6'));var controller=require('./userProfile.controller');router[_0x38af('0x7')]('/',auth[_0x38af('0x8')](),controller[_0x38af('0x9')]);router[_0x38af('0x7')](_0x38af('0xa'),auth['isAuthenticated'](),controller[_0x38af('0xb')]);router[_0x38af('0x7')]('/:id',auth[_0x38af('0x8')](),controller[_0x38af('0xc')]);router[_0x38af('0x7')](_0x38af('0xd'),auth[_0x38af('0x8')](),controller['getSections']);router[_0x38af('0x7')](_0x38af('0xe'),auth[_0x38af('0x8')](),controller['getResources']);router[_0x38af('0xf')]('/',auth[_0x38af('0x8')](),controller[_0x38af('0x10')]);router[_0x38af('0xf')]('/:id/clone',auth[_0x38af('0x8')](),controller['clone']);router[_0x38af('0xf')](_0x38af('0xd'),auth['isAuthenticated'](),controller[_0x38af('0x11')]);router[_0x38af('0xf')]('/:id/resources',auth[_0x38af('0x8')](),controller[_0x38af('0x12')]);router[_0x38af('0x13')]('/:id',auth[_0x38af('0x8')](),controller[_0x38af('0x14')]);router[_0x38af('0x15')](_0x38af('0x16'),auth[_0x38af('0x8')](),controller[_0x38af('0x17')]);router[_0x38af('0x15')](_0x38af('0xd'),auth[_0x38af('0x8')](),controller[_0x38af('0x18')]);router[_0x38af('0x15')]('/:id/resources',auth['isAuthenticated'](),controller[_0x38af('0x19')]);module['exports']=router; \ No newline at end of file +var _0xa9d1=['multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./userProfile.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/sections','getSections','/:id/resources','getResources','post','create','/:id/clone','clone','addResources','put','delete','destroy','removeSections','removeResources'];(function(_0x1b9965,_0x2df747){var _0x83e7c1=function(_0x452dab){while(--_0x452dab){_0x1b9965['push'](_0x1b9965['shift']());}};_0x83e7c1(++_0x2df747);}(_0xa9d1,0x74));var _0x1a9d=function(_0xca2427,_0x4f1902){_0xca2427=_0xca2427-0x0;var _0x5099ee=_0xa9d1[_0xca2427];return _0x5099ee;};'use strict';var multer=require(_0x1a9d('0x0'));var util=require(_0x1a9d('0x1'));var path=require(_0x1a9d('0x2'));var timeout=require(_0x1a9d('0x3'));var express=require(_0x1a9d('0x4'));var router=express[_0x1a9d('0x5')]();var fs_extra=require(_0x1a9d('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1a9d('0x7'));var controller=require(_0x1a9d('0x8'));router[_0x1a9d('0x9')]('/',auth[_0x1a9d('0xa')](),controller[_0x1a9d('0xb')]);router[_0x1a9d('0x9')](_0x1a9d('0xc'),auth[_0x1a9d('0xa')](),controller[_0x1a9d('0xd')]);router['get'](_0x1a9d('0xe'),auth[_0x1a9d('0xa')](),controller['show']);router[_0x1a9d('0x9')](_0x1a9d('0xf'),auth[_0x1a9d('0xa')](),controller[_0x1a9d('0x10')]);router[_0x1a9d('0x9')](_0x1a9d('0x11'),auth[_0x1a9d('0xa')](),controller[_0x1a9d('0x12')]);router[_0x1a9d('0x13')]('/',auth[_0x1a9d('0xa')](),controller[_0x1a9d('0x14')]);router[_0x1a9d('0x13')](_0x1a9d('0x15'),auth[_0x1a9d('0xa')](),controller[_0x1a9d('0x16')]);router[_0x1a9d('0x13')](_0x1a9d('0xf'),auth[_0x1a9d('0xa')](),controller['addSections']);router[_0x1a9d('0x13')](_0x1a9d('0x11'),auth[_0x1a9d('0xa')](),controller[_0x1a9d('0x17')]);router[_0x1a9d('0x18')](_0x1a9d('0xe'),auth[_0x1a9d('0xa')](),controller['update']);router[_0x1a9d('0x19')](_0x1a9d('0xe'),auth[_0x1a9d('0xa')](),controller[_0x1a9d('0x1a')]);router[_0x1a9d('0x19')](_0x1a9d('0xf'),auth['isAuthenticated'](),controller[_0x1a9d('0x1b')]);router[_0x1a9d('0x19')]('/:id/resources',auth[_0x1a9d('0xa')](),controller[_0x1a9d('0x1c')]);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 bdfe46e..44bfc67 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 _0x3d83=['crudPermissions','join','split','BOOLEAN','sequelize','exports','STRING','name'];(function(_0x48e6db,_0x3ba203){var _0xed6d55=function(_0x274fea){while(--_0x274fea){_0x48e6db['push'](_0x48e6db['shift']());}};_0xed6d55(++_0x3ba203);}(_0x3d83,0xdc));var _0x33d8=function(_0x1b1c66,_0x250f97){_0x1b1c66=_0x1b1c66-0x0;var _0x44ae1d=_0x3d83[_0x1b1c66];return _0x44ae1d;};'use strict';var Sequelize=require(_0x33d8('0x0'));module[_0x33d8('0x1')]={'name':{'type':Sequelize[_0x33d8('0x2')],'allowNull':![],'unique':_0x33d8('0x3')},'crudPermissions':{'type':Sequelize[_0x33d8('0x2')],'set':function(_0x2b7427){this['setDataValue'](_0x33d8('0x4'),_0x2b7427?_0x2b7427[_0x33d8('0x5')](''):[]);},'get':function(){return this['getDataValue'](_0x33d8('0x4'))?this['getDataValue']('crudPermissions')[_0x33d8('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x33d8('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x33d8('0x7')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x33d8('0x7')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x33d8('0x7')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x33d8('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x33d8('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x33d8('0x7')],'defaultValue':!![]}}; \ No newline at end of file +var _0x722c=['setDataValue','join','getDataValue','crudPermissions','split','BOOLEAN','sequelize','STRING'];(function(_0x103432,_0x54eeb2){var _0x4bcf38=function(_0x58d4cf){while(--_0x58d4cf){_0x103432['push'](_0x103432['shift']());}};_0x4bcf38(++_0x54eeb2);}(_0x722c,0x1a6));var _0xc722=function(_0x1d537c,_0x8f8150){_0x1d537c=_0x1d537c-0x0;var _0x5aa284=_0x722c[_0x1d537c];return _0x5aa284;};'use strict';var Sequelize=require(_0xc722('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0xc722('0x1')],'set':function(_0x407989){this[_0xc722('0x2')]('crudPermissions',_0x407989?_0x407989[_0xc722('0x3')](''):[]);},'get':function(){return this[_0xc722('0x4')](_0xc722('0x5'))?this['getDataValue'](_0xc722('0x5'))[_0xc722('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xc722('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xc722('0x7')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xc722('0x7')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xc722('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xc722('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xc722('0x7')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 77f3c5a..db7f458 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 _0x4f64=['path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','name','send','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','UserProfile','includeAll','include','findAll','rows','catch','params','keys','find','create','body','clone','get','omit','createdAt','updatedAt','sequelize','transaction','each','autoAssociation','sectionId','userProfileId','Resources','UserProfileSection','destroy','describe','addSections','UserProfileResource','push','removeSections','ids','getSections','enabled','includes','isEmpty','subsections','concat','findOne','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','getResources','Missing\x20section\x20parameter','nolimit','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x4f64,0xdf));var _0x44f6=function(_0x3afa6a,_0x5ea7e0){_0x3afa6a=_0x3afa6a-0x0;var _0x362852=_0x4f64[_0x3afa6a];return _0x362852;};'use strict';var emlformat=require(_0x44f6('0x0'));var rimraf=require(_0x44f6('0x1'));var zipdir=require(_0x44f6('0x2'));var jsonpatch=require(_0x44f6('0x3'));var rp=require(_0x44f6('0x4'));var moment=require('moment');var BPromise=require(_0x44f6('0x5'));var Mustache=require(_0x44f6('0x6'));var util=require('util');var path=require(_0x44f6('0x7'));var sox=require(_0x44f6('0x8'));var csv=require(_0x44f6('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x44f6('0xa'));var _=require(_0x44f6('0xb'));var squel=require(_0x44f6('0xc'));var crypto=require(_0x44f6('0xd'));var jsforce=require(_0x44f6('0xe'));var deskjs=require(_0x44f6('0xf'));var toCsv=require(_0x44f6('0x9'));var querystring=require(_0x44f6('0x10'));var Papa=require(_0x44f6('0x11'));var Redis=require('ioredis');var authService=require(_0x44f6('0x12'));var qs=require(_0x44f6('0x13'));var as=require(_0x44f6('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x44f6('0x15'))('api');var utils=require(_0x44f6('0x16'));var config=require(_0x44f6('0x17'));var licenseUtil=require(_0x44f6('0x18'));var db=require('../../mysqldb')['db'];config[_0x44f6('0x19')]=_[_0x44f6('0x1a')](config['redis'],{'host':_0x44f6('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x44f6('0x19')]));require('./userProfile.socket')[_0x44f6('0x1c')](socket);function respondWithStatusCode(_0x46b4e9,_0x516ddc){_0x516ddc=_0x516ddc||0xcc;return function(_0x425dec){if(_0x425dec){return _0x46b4e9[_0x44f6('0x1d')](_0x516ddc);}return _0x46b4e9[_0x44f6('0x1e')](_0x516ddc)[_0x44f6('0x1f')]();};}function respondWithResult(_0x547516,_0x164147){_0x164147=_0x164147||0xc8;return function(_0xb6f0db){if(_0xb6f0db){return _0x547516[_0x44f6('0x1e')](_0x164147)[_0x44f6('0x20')](_0xb6f0db);}};}function respondWithFilteredResult(_0x1af44c,_0x27d2dc){return function(_0x22a659){if(_0x22a659){var _0x3ace4e=typeof _0x27d2dc[_0x44f6('0x21')]===_0x44f6('0x22')&&typeof _0x27d2dc[_0x44f6('0x23')]==='undefined';var _0xe6ddc9=_0x22a659['count'];var _0x43cf3f=_0x3ace4e?0x0:_0x27d2dc[_0x44f6('0x21')];var _0x144c75=_0x3ace4e?_0x22a659[_0x44f6('0x24')]:_0x27d2dc[_0x44f6('0x21')]+_0x27d2dc[_0x44f6('0x23')];var _0x475b34;if(_0x144c75>=_0xe6ddc9){_0x144c75=_0xe6ddc9;_0x475b34=0xc8;}else{_0x475b34=0xce;}_0x1af44c[_0x44f6('0x1e')](_0x475b34);return _0x1af44c[_0x44f6('0x25')](_0x44f6('0x26'),_0x43cf3f+'-'+_0x144c75+'/'+_0xe6ddc9)[_0x44f6('0x20')](_0x22a659);}return null;};}function patchUpdates(_0x2aea97){return function(_0x2b4d53){try{jsonpatch['apply'](_0x2b4d53,_0x2aea97,!![]);}catch(_0x5f098f){return BPromise[_0x44f6('0x27')](_0x5f098f);}return _0x2b4d53[_0x44f6('0x28')]();};}function saveUpdates(_0x4220be,_0x1690e9){return function(_0xeffdec){if(_0xeffdec){return _0xeffdec[_0x44f6('0x29')](_0x4220be)[_0x44f6('0x2a')](function(_0x1bb1c0){return _0x1bb1c0;});}return null;};}function removeEntity(_0x4ca529,_0x5aeaf5){return function(_0x4d7f38){if(_0x4d7f38){return _0x4d7f38['destroy']()[_0x44f6('0x2a')](function(){_0x4ca529[_0x44f6('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2cf742,_0x579218){return function(_0x4d8d7f){if(!_0x4d8d7f){_0x2cf742[_0x44f6('0x1d')](0x194);}return _0x4d8d7f;};}function handleError(_0x118faa,_0xdd5193){_0xdd5193=_0xdd5193||0x1f4;return function(_0x1f2ae7){logger[_0x44f6('0x2b')](_0x1f2ae7['stack']);if(_0x1f2ae7['name']){delete _0x1f2ae7[_0x44f6('0x2c')];}_0x118faa['status'](_0xdd5193)[_0x44f6('0x2d')](_0x1f2ae7);};}exports[_0x44f6('0x2e')]=function(_0x3861ac,_0x5d889d){var _0x165064={},_0x2a801a={},_0x549f00={'count':0x0,'rows':[]};var _0x2455b4=_[_0x44f6('0x2f')](db['UserProfile'][_0x44f6('0x30')],function(_0x263f45){return{'name':_0x263f45[_0x44f6('0x31')],'type':_0x263f45[_0x44f6('0x32')]['key']};});_0x2a801a[_0x44f6('0x33')]=_[_0x44f6('0x2f')](_0x2455b4,_0x44f6('0x2c'));_0x2a801a[_0x44f6('0x34')]=_['keys'](_0x3861ac[_0x44f6('0x34')]);_0x2a801a[_0x44f6('0x35')]=_[_0x44f6('0x36')](_0x2a801a[_0x44f6('0x33')],_0x2a801a[_0x44f6('0x34')]);_0x165064[_0x44f6('0x37')]=_[_0x44f6('0x36')](_0x2a801a[_0x44f6('0x33')],qs['fields'](_0x3861ac['query'][_0x44f6('0x38')]));_0x165064['attributes']=_0x165064[_0x44f6('0x37')][_0x44f6('0x39')]?_0x165064[_0x44f6('0x37')]:_0x2a801a[_0x44f6('0x33')];if(!_0x3861ac[_0x44f6('0x34')][_0x44f6('0x3a')]('nolimit')){_0x165064['limit']=qs['limit'](_0x3861ac['query'][_0x44f6('0x23')]);_0x165064['offset']=qs[_0x44f6('0x21')](_0x3861ac[_0x44f6('0x34')][_0x44f6('0x21')]);}_0x165064[_0x44f6('0x3b')]=qs[_0x44f6('0x3c')](_0x3861ac['query'][_0x44f6('0x3c')]);_0x165064[_0x44f6('0x3d')]=qs[_0x44f6('0x35')](_[_0x44f6('0x3e')](_0x3861ac[_0x44f6('0x34')],_0x2a801a[_0x44f6('0x35')]),_0x2455b4);if(_0x3861ac['query'][_0x44f6('0x3f')]){_0x165064[_0x44f6('0x3d')]=_['merge'](_0x165064[_0x44f6('0x3d')],{'$or':_[_0x44f6('0x2f')](_0x2455b4,function(_0x434102){if(_0x434102[_0x44f6('0x32')]!==_0x44f6('0x40')){var _0x33ed89={};_0x33ed89[_0x434102['name']]={'$like':'%'+_0x3861ac[_0x44f6('0x34')][_0x44f6('0x3f')]+'%'};return _0x33ed89;}})});}_0x165064=_[_0x44f6('0x41')]({},_0x165064,_0x3861ac[_0x44f6('0x42')]);var _0x164c77={'where':_0x165064['where']};return db[_0x44f6('0x43')]['count'](_0x164c77)['then'](function(_0x4542ef){_0x549f00[_0x44f6('0x24')]=_0x4542ef;if(_0x3861ac[_0x44f6('0x34')][_0x44f6('0x44')]){_0x165064[_0x44f6('0x45')]=[{'all':!![]}];}return db['UserProfile'][_0x44f6('0x46')](_0x165064);})['then'](function(_0xf848f4){_0x549f00[_0x44f6('0x47')]=_0xf848f4;return _0x549f00;})['then'](respondWithFilteredResult(_0x5d889d,_0x165064))[_0x44f6('0x48')](handleError(_0x5d889d,null));};exports['show']=function(_0x5c1bd4,_0x413227){var _0x574cb0={'raw':![],'where':{'id':_0x5c1bd4[_0x44f6('0x49')]['id']}},_0x558ab5={};_0x558ab5[_0x44f6('0x33')]=_[_0x44f6('0x4a')](db[_0x44f6('0x43')][_0x44f6('0x30')]);_0x558ab5[_0x44f6('0x34')]=_[_0x44f6('0x4a')](_0x5c1bd4[_0x44f6('0x34')]);_0x558ab5[_0x44f6('0x35')]=_[_0x44f6('0x36')](_0x558ab5[_0x44f6('0x33')],_0x558ab5['query']);_0x574cb0[_0x44f6('0x37')]=_[_0x44f6('0x36')](_0x558ab5[_0x44f6('0x33')],qs[_0x44f6('0x38')](_0x5c1bd4['query'][_0x44f6('0x38')]));_0x574cb0[_0x44f6('0x37')]=_0x574cb0[_0x44f6('0x37')]['length']?_0x574cb0[_0x44f6('0x37')]:_0x558ab5[_0x44f6('0x33')];if(_0x5c1bd4['query']['includeAll']){_0x574cb0['include']=[{'all':!![]}];}_0x574cb0=_[_0x44f6('0x41')]({},_0x574cb0,_0x5c1bd4[_0x44f6('0x42')]);return db[_0x44f6('0x43')][_0x44f6('0x4b')](_0x574cb0)[_0x44f6('0x2a')](handleEntityNotFound(_0x413227,null))[_0x44f6('0x2a')](respondWithResult(_0x413227,null))[_0x44f6('0x48')](handleError(_0x413227,null));};exports[_0x44f6('0x4c')]=function(_0x285757,_0x1327e8){return db[_0x44f6('0x43')]['create'](_0x285757[_0x44f6('0x4d')],{})[_0x44f6('0x2a')](respondWithResult(_0x1327e8,0xc9))[_0x44f6('0x48')](handleError(_0x1327e8,null));};exports[_0x44f6('0x4e')]=function(_0x505987,_0x306efa){var _0x1a4aec={'where':{'id':_0x505987[_0x44f6('0x49')]['id']}},_0x463bd5={};_0x463bd5['model']=_[_0x44f6('0x4a')](db[_0x44f6('0x43')][_0x44f6('0x30')]);_0x1a4aec[_0x44f6('0x37')]=_[_0x44f6('0x36')](_0x463bd5[_0x44f6('0x33')],qs['fields'](_0x505987[_0x44f6('0x34')]['fields']));_0x1a4aec['attributes']=_0x1a4aec['attributes']['length']?_0x1a4aec['attributes']:_0x463bd5[_0x44f6('0x33')];if(_0x505987[_0x44f6('0x34')][_0x44f6('0x44')]){_0x1a4aec[_0x44f6('0x45')]=[{'all':!![]}];}_0x1a4aec=_['merge']({},_0x1a4aec,_0x505987[_0x44f6('0x42')]);return db[_0x44f6('0x43')][_0x44f6('0x4b')](_0x1a4aec)['then'](handleEntityNotFound(_0x306efa,null))[_0x44f6('0x2a')](function(_0x3df9ed){if(_0x3df9ed){var _0x375b35=_0x3df9ed[_0x44f6('0x4f')]({'plain':!![]});_0x375b35=qs[_0x44f6('0x50')](_0x375b35,['id',_0x44f6('0x51'),_0x44f6('0x52'),'crudPermissions']);_0x505987['body']=_[_0x44f6('0x50')](_0x505987[_0x44f6('0x4d')],['id',_0x44f6('0x51'),_0x44f6('0x52')]);return db[_0x44f6('0x53')][_0x44f6('0x54')](function(_0x5cff41){return db[_0x44f6('0x43')][_0x44f6('0x4c')](_[_0x44f6('0x41')](_0x375b35,_0x505987[_0x44f6('0x4d')]),{'include':_0x505987[_0x44f6('0x34')][_0x44f6('0x44')]?[{'all':!![]}]:undefined,'transaction':_0x5cff41})['then'](function(_0x83f89){var _0x109cf4=_0x83f89['get']({'plain':!![]});return db['UserProfileSection'][_0x44f6('0x46')]({'where':{'userProfileId':_0x505987['params']['id']},'raw':!![]})[_0x44f6('0x2a')](function(_0x468fb5){if(_0x468fb5){return BPromise[_0x44f6('0x55')](_0x468fb5,function(_0x183e6b){return new BPromise(function(_0x372f74,_0xcf9766){if(_0x183e6b['autoAssociation']===null||_0x183e6b[_0x44f6('0x56')]===0x1)_0x372f74(null);return db['UserProfileResource'][_0x44f6('0x46')]({'where':{'sectionId':_0x183e6b['id']},'raw':!![]})[_0x44f6('0x2a')](function(_0x6f12ae){var _0x4601e3=_['map'](_0x6f12ae,function(_0x1f86c0){return qs[_0x44f6('0x50')](_0x1f86c0,['id',_0x44f6('0x51'),'updatedAt',_0x44f6('0x57')]);});_0x372f74(_0x4601e3);})[_0x44f6('0x48')](function(_0x33304e){_0xcf9766(_0x33304e);});})[_0x44f6('0x2a')](function(_0x29f210){var _0x57502a=qs[_0x44f6('0x50')](_0x183e6b,['id','createdAt',_0x44f6('0x52')]);_0x57502a[_0x44f6('0x58')]=_0x109cf4['id'];if(_0x29f210)_0x57502a[_0x44f6('0x59')]=_0x29f210;return _0x57502a;})[_0x44f6('0x2a')](function(_0x65f1db){return db[_0x44f6('0x5a')][_0x44f6('0x4c')](_0x65f1db,{'include':[{'model':db['UserProfileResource'],'as':_0x44f6('0x59')}],'raw':!![],'transaction':_0x5cff41});});})['then'](function(){return _0x109cf4;});}});});});}})[_0x44f6('0x2a')](respondWithResult(_0x306efa,0xc9))[_0x44f6('0x48')](handleError(_0x306efa,null));};exports[_0x44f6('0x29')]=function(_0x48cdfc,_0x19dda7){if(_0x48cdfc[_0x44f6('0x4d')]['id']){delete _0x48cdfc[_0x44f6('0x4d')]['id'];}return db[_0x44f6('0x43')][_0x44f6('0x4b')]({'where':{'id':_0x48cdfc[_0x44f6('0x49')]['id']}})[_0x44f6('0x2a')](handleEntityNotFound(_0x19dda7,null))[_0x44f6('0x2a')](saveUpdates(_0x48cdfc[_0x44f6('0x4d')],null))[_0x44f6('0x2a')](respondWithResult(_0x19dda7,null))[_0x44f6('0x48')](handleError(_0x19dda7,null));};exports[_0x44f6('0x5b')]=function(_0x2d21a4,_0x36d11e){return db[_0x44f6('0x43')][_0x44f6('0x4b')]({'where':{'id':_0x2d21a4[_0x44f6('0x49')]['id']}})['then'](handleEntityNotFound(_0x36d11e,null))[_0x44f6('0x2a')](removeEntity(_0x36d11e,null))[_0x44f6('0x48')](handleError(_0x36d11e,null));};exports[_0x44f6('0x5c')]=function(_0x16e61d,_0x1c5f5d){return db[_0x44f6('0x43')][_0x44f6('0x5c')]()[_0x44f6('0x2a')](respondWithResult(_0x1c5f5d,null))[_0x44f6('0x48')](handleError(_0x1c5f5d,null));};exports[_0x44f6('0x5d')]=function(_0x25beab,_0xa2059d){var _0x12c4bc=_0x25beab[_0x44f6('0x4d')];return db[_0x44f6('0x43')]['find']({'where':{'id':_0x25beab[_0x44f6('0x49')]['id']}})['then'](handleEntityNotFound(_0xa2059d,null))[_0x44f6('0x2a')](function(_0x10728e){if(_0x10728e){return db['sequelize'][_0x44f6('0x54')](function(_0x39debe){return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x25beab[_0x44f6('0x49')]['id'],'sectionId':_[_0x44f6('0x2f')](_0x12c4bc,function(_0x3cf2bb){return _0x3cf2bb[_0x44f6('0x57')];})},'transaction':_0x39debe})['then'](function(){var _0x1febfe=_[_0x44f6('0x2f')](_0x12c4bc,function(_0x5d456d){_0x5d456d['userProfileId']=_0x25beab[_0x44f6('0x49')]['id'];return _0x5d456d;});var _0x58dbec=[];return BPromise[_0x44f6('0x55')](_0x1febfe,function(_0x3b787f){return db[_0x44f6('0x5a')]['create'](_0x3b787f,{'include':[{'model':db[_0x44f6('0x5e')],'as':'Resources'}],'raw':!![],'transaction':_0x39debe})[_0x44f6('0x2a')](function(_0x248e2d){_0x58dbec[_0x44f6('0x5f')](_0x248e2d['get']({'plain':!![]}));});})['then'](function(){return _0x58dbec;});});});}})[_0x44f6('0x2a')](function(_0x2df06c){return _0x2df06c;})[_0x44f6('0x2a')](respondWithResult(_0xa2059d,null))['catch'](handleError(_0xa2059d,null));};exports[_0x44f6('0x60')]=function(_0x45fc58,_0x164cf4){var _0x3646c7;return db[_0x44f6('0x43')][_0x44f6('0x4b')]({'where':{'id':_0x45fc58[_0x44f6('0x49')]['id']},'attributes':['id',_0x44f6('0x2c')]})['then'](handleEntityNotFound(_0x164cf4,null))['then'](function(_0x1d136b){if(_0x1d136b){_0x3646c7=_0x1d136b;return db[_0x44f6('0x5a')][_0x44f6('0x5b')]({'where':{'userProfileId':_0x45fc58[_0x44f6('0x49')]['id'],'sectionId':_0x45fc58[_0x44f6('0x34')][_0x44f6('0x61')]}});}})[_0x44f6('0x2a')](function(){return _0x3646c7;})['then'](respondWithStatusCode(_0x164cf4,null))[_0x44f6('0x48')](handleError(_0x164cf4,null));};exports[_0x44f6('0x62')]=function(_0x714dcc,_0x11ac6c){var _0x5c84b5=[];var _0x45e332=[];return db[_0x44f6('0x5a')]['findAll']({'where':{'userProfileId':_0x714dcc[_0x44f6('0x49')]['id']},'raw':!![]})[_0x44f6('0x2a')](function(_0xbe8860){_0x5c84b5=_['filter'](_0xbe8860,function(_0x31f833){return _0x31f833[_0x44f6('0x63')]===0x1||_[_0x44f6('0x64')]([0x3eb,0x709],_0x31f833[_0x44f6('0x57')]);});if(!_[_0x44f6('0x65')](_0x5c84b5)){return _['map'](_0x5c84b5,function(_0xb141e2){return _0xb141e2[_0x44f6('0x57')];});}else{return;}})[_0x44f6('0x2a')](function(_0x20409e){if(_0x20409e)_0x45e332=_0x20409e;if(_[_0x44f6('0x64')](_0x45e332,0x64)){var _0x3e6bca=_[_0x44f6('0x4b')](_0x5c84b5,{'sectionId':0x64});return hasDefaultDashboard(_0x3e6bca)[_0x44f6('0x2a')](function(_0x4bd897){return _['map'](_0x5c84b5,function(_0x5ece0a){if(_0x5ece0a[_0x44f6('0x57')]===0x64){_0x5ece0a[_0x44f6('0x66')]=_0x4bd897;}return _0x5ece0a;});});}else{return;}})[_0x44f6('0x2a')](function(_0x190c90){if(_0x190c90)_0x5c84b5=_0x190c90;if(_[_0x44f6('0x64')](_0x45e332,0x3eb)){var _0x16813a=_[_0x44f6('0x4b')](_0x5c84b5,{'sectionId':0x3eb});return getCustomDashboards(_0x16813a)['then'](function(_0x5cddde){return _[_0x44f6('0x2f')](_0x5c84b5,function(_0x5edcaf){if(_0x16813a[_0x44f6('0x63')]){if(_0x5edcaf[_0x44f6('0x57')]===0x3eb){_0x5edcaf['subsections']=_0x5cddde;}}else{if(_0x5edcaf[_0x44f6('0x57')]===0x64){if(!_0x5edcaf['subsections']){_0x5edcaf[_0x44f6('0x66')]=[];}_0x5edcaf[_0x44f6('0x66')]=_0x5edcaf['subsections'][_0x44f6('0x67')](_0x5cddde);}}return _0x5edcaf;});});}else{return;}})[_0x44f6('0x2a')](function(_0x325625){if(_0x325625)_0x5c84b5=_0x325625;if(_[_0x44f6('0x64')](_0x45e332,0x709)){var _0x1ed968=_['find'](_0x5c84b5,{'sectionId':0x709});return getPlugins(_0x1ed968)[_0x44f6('0x2a')](function(_0x1ea287){if(_0x1ed968[_0x44f6('0x63')]){return _[_0x44f6('0x2f')](_0x5c84b5,function(_0x4a678c){if(_0x4a678c[_0x44f6('0x57')]===0x709){_0x4a678c['subsections']=_0x1ea287;}return _0x4a678c;});}else{var _0x49921b={'sectionId':0x76c,'enabled':0x1,'subsections':_0x1ea287};var _0xb99b80=_['map'](_0x5c84b5);_0xb99b80['push'](_0x49921b);return _0xb99b80;}});}else{return;}})[_0x44f6('0x2a')](function(_0x4d1f0e){if(_0x4d1f0e)_0x5c84b5=_0x4d1f0e;return _[_0x44f6('0x3f')](_0x5c84b5,[_0x44f6('0x63'),0x1]);})[_0x44f6('0x2a')](respondWithResult(_0x11ac6c,null))[_0x44f6('0x48')](handleError(_0x11ac6c,null));};function hasDefaultDashboard(_0x319d82){var _0x34c941=[0x65];return new BPromise(function(_0x147016,_0x2bbe4a){try{if(_0x319d82[_0x44f6('0x56')]){_0x147016(_0x34c941);}else{return db[_0x44f6('0x5e')][_0x44f6('0x68')]({'where':{'sectionId':_0x319d82['id']},'raw':!![]})[_0x44f6('0x2a')](function(_0x3ef24b){_0x3ef24b?_0x147016(_0x34c941):_0x147016();});}}catch(_0x17beb6){_0x2bbe4a(_0x17beb6);}});}function getCustomDashboards(_0x750d51){var _0x1864ff=[];return new BPromise(function(_0x3879d7,_0x3a541d){try{if(_0x750d51[_0x44f6('0x56')]){return db['Dashboard'][_0x44f6('0x46')]({'raw':!![]})[_0x44f6('0x2a')](function(_0x321747){_0x321747['forEach'](function(_0x3651c5){_0x1864ff[_0x44f6('0x5f')](_0x3651c5['id']+0x1869f);});_0x3879d7(_0x1864ff);});}else{return db[_0x44f6('0x5e')][_0x44f6('0x46')]({'where':{'sectionId':_0x750d51['id']},'raw':!![]})[_0x44f6('0x2a')](function(_0x37f8b4){_0x37f8b4[_0x44f6('0x69')](function(_0x43aad3){_0x1864ff[_0x44f6('0x5f')](_0x43aad3[_0x44f6('0x6a')]+0x1869f);});_0x3879d7(_0x1864ff);});}}catch(_0x328a1a){_0x3a541d(_0x328a1a);}});}function getPlugins(_0x41f48a){var _0x46b155=[];return new BPromise(function(_0x2cccbe,_0xfe1a0a){try{if(_0x41f48a[_0x44f6('0x56')]){return db[_0x44f6('0x6b')][_0x44f6('0x46')]({'raw':!![]})[_0x44f6('0x2a')](function(_0x4cbea9){_0x4cbea9[_0x44f6('0x69')](function(_0x1bbabc){_0x46b155['push'](_0x1bbabc['id']+0x15b38);});_0x2cccbe(_0x46b155);});}else{return db[_0x44f6('0x5e')][_0x44f6('0x46')]({'where':{'sectionId':_0x41f48a['id']},'raw':!![]})[_0x44f6('0x2a')](function(_0x3e5631){_0x3e5631[_0x44f6('0x69')](function(_0x551e9a){_0x46b155[_0x44f6('0x5f')](_0x551e9a['resourceId']+0x15b38);});_0x2cccbe(_0x46b155);});}}catch(_0x2f594a){_0xfe1a0a(_0x2f594a);}});}exports[_0x44f6('0x6c')]=function(_0x5d65b9,_0x2825ba){return db[_0x44f6('0x43')][_0x44f6('0x4b')]({'where':{'id':_0x5d65b9[_0x44f6('0x49')]['id']}})[_0x44f6('0x2a')](handleEntityNotFound(_0x2825ba,null))[_0x44f6('0x2a')](function(_0x33efbf){if(_0x33efbf){return db[_0x44f6('0x53')][_0x44f6('0x54')](function(_0x2e7686){return db[_0x44f6('0x5a')]['findAll']({'where':{'userProfileId':_0x5d65b9[_0x44f6('0x49')]['id']},'attributes':['id'],'raw':!![]})[_0x44f6('0x2a')](function(_0x45cc49){if(_0x45cc49){return db[_0x44f6('0x5a')][_0x44f6('0x5b')]({'where':{'userProfileId':_0x5d65b9[_0x44f6('0x49')]['id'],'id':_[_0x44f6('0x2f')](_0x45cc49,function(_0x40955e){return _0x40955e['id'];})},'transaction':_0x2e7686});}})['then'](function(_0x1ded80){var _0x5dd817=_[_0x44f6('0x2f')](_0x5d65b9[_0x44f6('0x4d')],function(_0x2c37e9){_0x2c37e9[_0x44f6('0x58')]=_0x5d65b9[_0x44f6('0x49')]['id'];return _0x2c37e9;});return db['UserProfileSection'][_0x44f6('0x6d')](_0x5dd817,{'raw':!![],'transaction':_0x2e7686});})[_0x44f6('0x2a')](function(_0xc27c3c){var _0x494284=_[_0x44f6('0x3f')](_[_0x44f6('0x2f')](_0xc27c3c,function(_0x2d73cb){return _0x2d73cb['get']({'plain':!![]});}),{'includeAll':![]});if(_0x494284){return db['UserProfileSection'][_0x44f6('0x46')]({'where':{'userProfileId':_0x5d65b9[_0x44f6('0x49')]['id'],'sectionId':_['map'](_0x494284,function(_0x57e6c1){return _0x57e6c1[_0x44f6('0x57')];})},'attributes':['id','sectionId'],'raw':!![]})[_0x44f6('0x2a')](function(_0x47ef83){var _0x1c4c52=_['map'](_0x5d65b9[_0x44f6('0x4d')],function(_0x349a7f){_0x349a7f[_0x44f6('0x58')]=_0x5d65b9['params']['id'];return _0x349a7f;});return db[_0x44f6('0x5e')][_0x44f6('0x6d')](_0x1c4c52,{'raw':!![],'transaction':_0x2e7686});});}})['catch'](handleError(_0x2825ba,null));});}})[_0x44f6('0x2a')](function(_0x2a84a5){var _0x3443a3=_[_0x44f6('0x2f')](_0x2a84a5,function(_0x1f7658){return _0x1f7658['get']({'plain':!![]});});})[_0x44f6('0x2a')](respondWithResult(_0x2825ba,null))['catch'](handleError(_0x2825ba,null));};exports[_0x44f6('0x6e')]=function(_0x1d4eb5,_0x2877ec,_0xd6614){return db[_0x44f6('0x43')][_0x44f6('0x4b')]({'where':{'id':_0x1d4eb5[_0x44f6('0x49')]['id']}})['then'](handleEntityNotFound(_0x2877ec,null))[_0x44f6('0x2a')](function(_0x2ecb71){if(_0x2ecb71){return _0x2ecb71['removeResources'](_0x1d4eb5[_0x44f6('0x34')][_0x44f6('0x61')]);}})[_0x44f6('0x2a')](respondWithStatusCode(_0x2877ec,null))['catch'](handleError(_0x2877ec,null));};exports[_0x44f6('0x6f')]=function(_0x32737a,_0x5a47be){var _0x247635={};if(!_0x32737a['query']['section'])throw new Error(_0x44f6('0x70'));if(!_0x32737a['query']['hasOwnProperty'](_0x44f6('0x71'))){_0x247635[_0x44f6('0x23')]=qs[_0x44f6('0x23')](_0x32737a[_0x44f6('0x34')]['limit']);_0x247635[_0x44f6('0x21')]=qs[_0x44f6('0x21')](_0x32737a['query'][_0x44f6('0x21')]);}return db[_0x44f6('0x43')][_0x44f6('0x4b')]({'where':{'id':_0x32737a['params']['id']}})[_0x44f6('0x2a')](function(_0x2656cd){if(!_0x2656cd)throw new Error(_0x44f6('0x72')+_0x32737a[_0x44f6('0x49')]['id']);return db[_0x44f6('0x43')][_0x44f6('0x6f')](_0x32737a);})[_0x44f6('0x2a')](respondWithFilteredResult(_0x5a47be,_0x247635))['catch'](handleError(_0x5a47be,null));}; \ No newline at end of file +var _0xa9f2=['mustache','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','end','status','json','limit','undefined','offset','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','UserProfile','rawAttributes','type','key','model','query','keys','intersection','length','sort','filters','where','merge','VIRTUAL','filter','options','count','findAll','rows','catch','params','attributes','fields','includeAll','include','create','body','clone','find','get','omit','createdAt','updatedAt','crudPermissions','transaction','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','UserProfileSection','describe','sequelize','push','removeSections','ids','getSections','includes','subsections','concat','enabled','findOne','Dashboard','forEach','resourceId','addResources','bulkCreate','removeResources','getResources','section','nolimit','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird'];(function(_0x5834bc,_0x3d4801){var _0x3e183a=function(_0x18b023){while(--_0x18b023){_0x5834bc['push'](_0x5834bc['shift']());}};_0x3e183a(++_0x3d4801);}(_0xa9f2,0x150));var _0x2a9f=function(_0x46222d,_0x3b9e5b){_0x46222d=_0x46222d-0x0;var _0x5e943a=_0xa9f2[_0x46222d];return _0x5e943a;};'use strict';var emlformat=require(_0x2a9f('0x0'));var rimraf=require(_0x2a9f('0x1'));var zipdir=require(_0x2a9f('0x2'));var jsonpatch=require(_0x2a9f('0x3'));var rp=require('request-promise');var moment=require(_0x2a9f('0x4'));var BPromise=require(_0x2a9f('0x5'));var Mustache=require(_0x2a9f('0x6'));var util=require('util');var path=require(_0x2a9f('0x7'));var sox=require(_0x2a9f('0x8'));var csv=require('to-csv');var ejs=require(_0x2a9f('0x9'));var fs=require('fs');var fs_extra=require(_0x2a9f('0xa'));var _=require(_0x2a9f('0xb'));var squel=require(_0x2a9f('0xc'));var crypto=require('crypto');var jsforce=require(_0x2a9f('0xd'));var deskjs=require(_0x2a9f('0xe'));var toCsv=require('to-csv');var querystring=require(_0x2a9f('0xf'));var Papa=require(_0x2a9f('0x10'));var Redis=require('ioredis');var authService=require(_0x2a9f('0x11'));var qs=require(_0x2a9f('0x12'));var as=require(_0x2a9f('0x13'));var hardwareService=require(_0x2a9f('0x14'));var logger=require(_0x2a9f('0x15'))(_0x2a9f('0x16'));var utils=require(_0x2a9f('0x17'));var config=require(_0x2a9f('0x18'));var licenseUtil=require(_0x2a9f('0x19'));var db=require('../../mysqldb')['db'];config[_0x2a9f('0x1a')]=_[_0x2a9f('0x1b')](config['redis'],{'host':_0x2a9f('0x1c'),'port':0x18eb});var socket=require(_0x2a9f('0x1d'))(new Redis(config[_0x2a9f('0x1a')]));require(_0x2a9f('0x1e'))[_0x2a9f('0x1f')](socket);function respondWithStatusCode(_0x469010,_0xaebd63){_0xaebd63=_0xaebd63||0xcc;return function(_0x361cfa){if(_0x361cfa){return _0x469010[_0x2a9f('0x20')](_0xaebd63);}return _0x469010['status'](_0xaebd63)[_0x2a9f('0x21')]();};}function respondWithResult(_0x1bee61,_0x1b5b35){_0x1b5b35=_0x1b5b35||0xc8;return function(_0x5cd925){if(_0x5cd925){return _0x1bee61[_0x2a9f('0x22')](_0x1b5b35)[_0x2a9f('0x23')](_0x5cd925);}};}function respondWithFilteredResult(_0x17e529,_0x4d5d08){return function(_0x5c4951){if(_0x5c4951){var _0x46b594=typeof _0x4d5d08['offset']==='undefined'&&typeof _0x4d5d08[_0x2a9f('0x24')]===_0x2a9f('0x25');var _0x3b85e2=_0x5c4951['count'];var _0xeb6ef=_0x46b594?0x0:_0x4d5d08[_0x2a9f('0x26')];var _0x46f1f8=_0x46b594?_0x5c4951['count']:_0x4d5d08[_0x2a9f('0x26')]+_0x4d5d08[_0x2a9f('0x24')];var _0x100226;if(_0x46f1f8>=_0x3b85e2){_0x46f1f8=_0x3b85e2;_0x100226=0xc8;}else{_0x100226=0xce;}_0x17e529[_0x2a9f('0x22')](_0x100226);return _0x17e529[_0x2a9f('0x27')]('Content-Range',_0xeb6ef+'-'+_0x46f1f8+'/'+_0x3b85e2)[_0x2a9f('0x23')](_0x5c4951);}return null;};}function patchUpdates(_0x26e656){return function(_0x1f5a88){try{jsonpatch[_0x2a9f('0x28')](_0x1f5a88,_0x26e656,!![]);}catch(_0x2e87d5){return BPromise[_0x2a9f('0x29')](_0x2e87d5);}return _0x1f5a88[_0x2a9f('0x2a')]();};}function saveUpdates(_0xdd6f32,_0x2cff6d){return function(_0x54a218){if(_0x54a218){return _0x54a218[_0x2a9f('0x2b')](_0xdd6f32)[_0x2a9f('0x2c')](function(_0x49b025){return _0x49b025;});}return null;};}function removeEntity(_0x5c4ec2,_0x506fcb){return function(_0x115453){if(_0x115453){return _0x115453[_0x2a9f('0x2d')]()[_0x2a9f('0x2c')](function(){_0x5c4ec2[_0x2a9f('0x22')](0xcc)[_0x2a9f('0x21')]();});}};}function handleEntityNotFound(_0x24de3a,_0x444de8){return function(_0x1d0bf6){if(!_0x1d0bf6){_0x24de3a[_0x2a9f('0x20')](0x194);}return _0x1d0bf6;};}function handleError(_0x44ba9d,_0x5a74fb){_0x5a74fb=_0x5a74fb||0x1f4;return function(_0x4d0c19){logger[_0x2a9f('0x2e')](_0x4d0c19[_0x2a9f('0x2f')]);if(_0x4d0c19[_0x2a9f('0x30')]){delete _0x4d0c19[_0x2a9f('0x30')];}_0x44ba9d['status'](_0x5a74fb)[_0x2a9f('0x31')](_0x4d0c19);};}exports[_0x2a9f('0x32')]=function(_0x10b771,_0x47203f){var _0x250936={},_0x550314={},_0x54ec6b={'count':0x0,'rows':[]};var _0x6d2d5d=_[_0x2a9f('0x33')](db[_0x2a9f('0x34')][_0x2a9f('0x35')],function(_0x358d37){return{'name':_0x358d37['fieldName'],'type':_0x358d37[_0x2a9f('0x36')][_0x2a9f('0x37')]};});_0x550314[_0x2a9f('0x38')]=_[_0x2a9f('0x33')](_0x6d2d5d,_0x2a9f('0x30'));_0x550314[_0x2a9f('0x39')]=_[_0x2a9f('0x3a')](_0x10b771['query']);_0x550314['filters']=_[_0x2a9f('0x3b')](_0x550314[_0x2a9f('0x38')],_0x550314[_0x2a9f('0x39')]);_0x250936['attributes']=_['intersection'](_0x550314[_0x2a9f('0x38')],qs['fields'](_0x10b771[_0x2a9f('0x39')]['fields']));_0x250936['attributes']=_0x250936['attributes'][_0x2a9f('0x3c')]?_0x250936['attributes']:_0x550314[_0x2a9f('0x38')];if(!_0x10b771[_0x2a9f('0x39')]['hasOwnProperty']('nolimit')){_0x250936['limit']=qs[_0x2a9f('0x24')](_0x10b771[_0x2a9f('0x39')][_0x2a9f('0x24')]);_0x250936[_0x2a9f('0x26')]=qs[_0x2a9f('0x26')](_0x10b771[_0x2a9f('0x39')]['offset']);}_0x250936['order']=qs[_0x2a9f('0x3d')](_0x10b771['query'][_0x2a9f('0x3d')]);_0x250936['where']=qs[_0x2a9f('0x3e')](_['pick'](_0x10b771[_0x2a9f('0x39')],_0x550314['filters']),_0x6d2d5d);if(_0x10b771[_0x2a9f('0x39')]['filter']){_0x250936[_0x2a9f('0x3f')]=_[_0x2a9f('0x40')](_0x250936[_0x2a9f('0x3f')],{'$or':_['map'](_0x6d2d5d,function(_0x569b32){if(_0x569b32[_0x2a9f('0x36')]!==_0x2a9f('0x41')){var _0x39003f={};_0x39003f[_0x569b32[_0x2a9f('0x30')]]={'$like':'%'+_0x10b771[_0x2a9f('0x39')][_0x2a9f('0x42')]+'%'};return _0x39003f;}})});}_0x250936=_['merge']({},_0x250936,_0x10b771[_0x2a9f('0x43')]);var _0x468a15={'where':_0x250936[_0x2a9f('0x3f')]};return db[_0x2a9f('0x34')][_0x2a9f('0x44')](_0x468a15)[_0x2a9f('0x2c')](function(_0x4e3e29){_0x54ec6b[_0x2a9f('0x44')]=_0x4e3e29;if(_0x10b771[_0x2a9f('0x39')]['includeAll']){_0x250936['include']=[{'all':!![]}];}return db[_0x2a9f('0x34')][_0x2a9f('0x45')](_0x250936);})[_0x2a9f('0x2c')](function(_0x2dd775){_0x54ec6b[_0x2a9f('0x46')]=_0x2dd775;return _0x54ec6b;})[_0x2a9f('0x2c')](respondWithFilteredResult(_0x47203f,_0x250936))[_0x2a9f('0x47')](handleError(_0x47203f,null));};exports['show']=function(_0x11a75d,_0x5067f2){var _0x197396={'raw':![],'where':{'id':_0x11a75d[_0x2a9f('0x48')]['id']}},_0x163964={};_0x163964[_0x2a9f('0x38')]=_[_0x2a9f('0x3a')](db['UserProfile']['rawAttributes']);_0x163964[_0x2a9f('0x39')]=_[_0x2a9f('0x3a')](_0x11a75d[_0x2a9f('0x39')]);_0x163964['filters']=_[_0x2a9f('0x3b')](_0x163964[_0x2a9f('0x38')],_0x163964[_0x2a9f('0x39')]);_0x197396[_0x2a9f('0x49')]=_[_0x2a9f('0x3b')](_0x163964[_0x2a9f('0x38')],qs['fields'](_0x11a75d[_0x2a9f('0x39')][_0x2a9f('0x4a')]));_0x197396[_0x2a9f('0x49')]=_0x197396['attributes'][_0x2a9f('0x3c')]?_0x197396[_0x2a9f('0x49')]:_0x163964['model'];if(_0x11a75d[_0x2a9f('0x39')][_0x2a9f('0x4b')]){_0x197396[_0x2a9f('0x4c')]=[{'all':!![]}];}_0x197396=_['merge']({},_0x197396,_0x11a75d[_0x2a9f('0x43')]);return db[_0x2a9f('0x34')]['find'](_0x197396)[_0x2a9f('0x2c')](handleEntityNotFound(_0x5067f2,null))[_0x2a9f('0x2c')](respondWithResult(_0x5067f2,null))[_0x2a9f('0x47')](handleError(_0x5067f2,null));};exports['create']=function(_0x2706db,_0x530d35){return db[_0x2a9f('0x34')][_0x2a9f('0x4d')](_0x2706db[_0x2a9f('0x4e')],{})['then'](respondWithResult(_0x530d35,0xc9))[_0x2a9f('0x47')](handleError(_0x530d35,null));};exports[_0x2a9f('0x4f')]=function(_0x41d9c9,_0x3dfafd){var _0x41a8e1={'where':{'id':_0x41d9c9['params']['id']}},_0x5640e7={};_0x5640e7[_0x2a9f('0x38')]=_[_0x2a9f('0x3a')](db[_0x2a9f('0x34')][_0x2a9f('0x35')]);_0x41a8e1[_0x2a9f('0x49')]=_[_0x2a9f('0x3b')](_0x5640e7['model'],qs[_0x2a9f('0x4a')](_0x41d9c9[_0x2a9f('0x39')][_0x2a9f('0x4a')]));_0x41a8e1[_0x2a9f('0x49')]=_0x41a8e1['attributes']['length']?_0x41a8e1[_0x2a9f('0x49')]:_0x5640e7[_0x2a9f('0x38')];if(_0x41d9c9[_0x2a9f('0x39')][_0x2a9f('0x4b')]){_0x41a8e1[_0x2a9f('0x4c')]=[{'all':!![]}];}_0x41a8e1=_[_0x2a9f('0x40')]({},_0x41a8e1,_0x41d9c9[_0x2a9f('0x43')]);return db[_0x2a9f('0x34')][_0x2a9f('0x50')](_0x41a8e1)[_0x2a9f('0x2c')](handleEntityNotFound(_0x3dfafd,null))[_0x2a9f('0x2c')](function(_0x1da85a){if(_0x1da85a){var _0x42242f=_0x1da85a[_0x2a9f('0x51')]({'plain':!![]});_0x42242f=qs[_0x2a9f('0x52')](_0x42242f,['id',_0x2a9f('0x53'),_0x2a9f('0x54'),_0x2a9f('0x55')]);_0x41d9c9[_0x2a9f('0x4e')]=_['omit'](_0x41d9c9[_0x2a9f('0x4e')],['id',_0x2a9f('0x53'),'updatedAt']);return db['sequelize'][_0x2a9f('0x56')](function(_0x1ca560){return db['UserProfile']['create'](_['merge'](_0x42242f,_0x41d9c9[_0x2a9f('0x4e')]),{'include':_0x41d9c9[_0x2a9f('0x39')]['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x1ca560})[_0x2a9f('0x2c')](function(_0x52abb7){var _0x184df0=_0x52abb7['get']({'plain':!![]});return db['UserProfileSection'][_0x2a9f('0x45')]({'where':{'userProfileId':_0x41d9c9[_0x2a9f('0x48')]['id']},'raw':!![]})[_0x2a9f('0x2c')](function(_0x2b3f2f){if(_0x2b3f2f){return BPromise['each'](_0x2b3f2f,function(_0x2a26cb){return new BPromise(function(_0xa76935,_0x6c239a){if(_0x2a26cb[_0x2a9f('0x57')]===null||_0x2a26cb[_0x2a9f('0x57')]===0x1)_0xa76935(null);return db[_0x2a9f('0x58')][_0x2a9f('0x45')]({'where':{'sectionId':_0x2a26cb['id']},'raw':!![]})[_0x2a9f('0x2c')](function(_0x117e1e){var _0x4cd5db=_[_0x2a9f('0x33')](_0x117e1e,function(_0x2c2d15){return qs[_0x2a9f('0x52')](_0x2c2d15,['id','createdAt',_0x2a9f('0x54'),_0x2a9f('0x59')]);});_0xa76935(_0x4cd5db);})['catch'](function(_0x5649a6){_0x6c239a(_0x5649a6);});})[_0x2a9f('0x2c')](function(_0x2fc309){var _0x55cde5=qs[_0x2a9f('0x52')](_0x2a26cb,['id',_0x2a9f('0x53'),_0x2a9f('0x54')]);_0x55cde5[_0x2a9f('0x5a')]=_0x184df0['id'];if(_0x2fc309)_0x55cde5[_0x2a9f('0x5b')]=_0x2fc309;return _0x55cde5;})[_0x2a9f('0x2c')](function(_0x3ac87c){return db[_0x2a9f('0x5c')]['create'](_0x3ac87c,{'include':[{'model':db[_0x2a9f('0x58')],'as':_0x2a9f('0x5b')}],'raw':!![],'transaction':_0x1ca560});});})[_0x2a9f('0x2c')](function(){return _0x184df0;});}});});});}})['then'](respondWithResult(_0x3dfafd,0xc9))[_0x2a9f('0x47')](handleError(_0x3dfafd,null));};exports[_0x2a9f('0x2b')]=function(_0x1fb697,_0x5811af){if(_0x1fb697[_0x2a9f('0x4e')]['id']){delete _0x1fb697[_0x2a9f('0x4e')]['id'];}return db[_0x2a9f('0x34')]['find']({'where':{'id':_0x1fb697[_0x2a9f('0x48')]['id']}})[_0x2a9f('0x2c')](handleEntityNotFound(_0x5811af,null))[_0x2a9f('0x2c')](saveUpdates(_0x1fb697[_0x2a9f('0x4e')],null))['then'](respondWithResult(_0x5811af,null))[_0x2a9f('0x47')](handleError(_0x5811af,null));};exports[_0x2a9f('0x2d')]=function(_0x54c688,_0x57b697){return db['UserProfile'][_0x2a9f('0x50')]({'where':{'id':_0x54c688[_0x2a9f('0x48')]['id']}})[_0x2a9f('0x2c')](handleEntityNotFound(_0x57b697,null))[_0x2a9f('0x2c')](removeEntity(_0x57b697,null))[_0x2a9f('0x47')](handleError(_0x57b697,null));};exports[_0x2a9f('0x5d')]=function(_0x46d14b,_0x1250d3){return db['UserProfile'][_0x2a9f('0x5d')]()[_0x2a9f('0x2c')](respondWithResult(_0x1250d3,null))[_0x2a9f('0x47')](handleError(_0x1250d3,null));};exports['addSections']=function(_0x45b0d2,_0x144b52){var _0x2b06f2=_0x45b0d2[_0x2a9f('0x4e')];return db[_0x2a9f('0x34')]['find']({'where':{'id':_0x45b0d2[_0x2a9f('0x48')]['id']}})[_0x2a9f('0x2c')](handleEntityNotFound(_0x144b52,null))[_0x2a9f('0x2c')](function(_0x4d3351){if(_0x4d3351){return db[_0x2a9f('0x5e')][_0x2a9f('0x56')](function(_0x3178ba){return db[_0x2a9f('0x5c')]['destroy']({'where':{'userProfileId':_0x45b0d2[_0x2a9f('0x48')]['id'],'sectionId':_[_0x2a9f('0x33')](_0x2b06f2,function(_0x1c20f5){return _0x1c20f5[_0x2a9f('0x59')];})},'transaction':_0x3178ba})[_0x2a9f('0x2c')](function(){var _0x216004=_[_0x2a9f('0x33')](_0x2b06f2,function(_0xa0a6fd){_0xa0a6fd['userProfileId']=_0x45b0d2['params']['id'];return _0xa0a6fd;});var _0x4f41d0=[];return BPromise['each'](_0x216004,function(_0x57a51f){return db[_0x2a9f('0x5c')][_0x2a9f('0x4d')](_0x57a51f,{'include':[{'model':db[_0x2a9f('0x58')],'as':_0x2a9f('0x5b')}],'raw':!![],'transaction':_0x3178ba})['then'](function(_0x2ba227){_0x4f41d0[_0x2a9f('0x5f')](_0x2ba227['get']({'plain':!![]}));});})[_0x2a9f('0x2c')](function(){return _0x4f41d0;});});});}})['then'](function(_0x3a6039){return _0x3a6039;})[_0x2a9f('0x2c')](respondWithResult(_0x144b52,null))[_0x2a9f('0x47')](handleError(_0x144b52,null));};exports[_0x2a9f('0x60')]=function(_0x23167a,_0x1c67a6){var _0x363b69;return db['UserProfile'][_0x2a9f('0x50')]({'where':{'id':_0x23167a[_0x2a9f('0x48')]['id']},'attributes':['id',_0x2a9f('0x30')]})['then'](handleEntityNotFound(_0x1c67a6,null))[_0x2a9f('0x2c')](function(_0x439944){if(_0x439944){_0x363b69=_0x439944;return db[_0x2a9f('0x5c')][_0x2a9f('0x2d')]({'where':{'userProfileId':_0x23167a['params']['id'],'sectionId':_0x23167a['query'][_0x2a9f('0x61')]}});}})['then'](function(){return _0x363b69;})[_0x2a9f('0x2c')](respondWithStatusCode(_0x1c67a6,null))[_0x2a9f('0x47')](handleError(_0x1c67a6,null));};exports[_0x2a9f('0x62')]=function(_0x4e32d9,_0x4a5163){var _0x23eebf=[];var _0x1c5dbd=[];return db[_0x2a9f('0x5c')][_0x2a9f('0x45')]({'where':{'userProfileId':_0x4e32d9[_0x2a9f('0x48')]['id']},'raw':!![]})[_0x2a9f('0x2c')](function(_0x3ff073){_0x23eebf=_[_0x2a9f('0x42')](_0x3ff073,function(_0x22a67a){return _0x22a67a['enabled']===0x1||_[_0x2a9f('0x63')]([0x3eb,0x709],_0x22a67a[_0x2a9f('0x59')]);});if(!_['isEmpty'](_0x23eebf)){return _['map'](_0x23eebf,function(_0x45b17b){return _0x45b17b[_0x2a9f('0x59')];});}else{return;}})[_0x2a9f('0x2c')](function(_0x1c4c87){if(_0x1c4c87)_0x1c5dbd=_0x1c4c87;if(_[_0x2a9f('0x63')](_0x1c5dbd,0x64)){var _0x55ec5a=_[_0x2a9f('0x50')](_0x23eebf,{'sectionId':0x64});return hasDefaultDashboard(_0x55ec5a)[_0x2a9f('0x2c')](function(_0x1da086){return _[_0x2a9f('0x33')](_0x23eebf,function(_0x3a5869){if(_0x3a5869[_0x2a9f('0x59')]===0x64){_0x3a5869[_0x2a9f('0x64')]=_0x1da086;}return _0x3a5869;});});}else{return;}})[_0x2a9f('0x2c')](function(_0x5c79ec){if(_0x5c79ec)_0x23eebf=_0x5c79ec;if(_[_0x2a9f('0x63')](_0x1c5dbd,0x3eb)){var _0x10be86=_['find'](_0x23eebf,{'sectionId':0x3eb});return getCustomDashboards(_0x10be86)[_0x2a9f('0x2c')](function(_0x43255e){return _['map'](_0x23eebf,function(_0x1ff931){if(_0x10be86['enabled']){if(_0x1ff931['sectionId']===0x3eb){_0x1ff931[_0x2a9f('0x64')]=_0x43255e;}}else{if(_0x1ff931[_0x2a9f('0x59')]===0x64){if(!_0x1ff931[_0x2a9f('0x64')]){_0x1ff931['subsections']=[];}_0x1ff931['subsections']=_0x1ff931[_0x2a9f('0x64')][_0x2a9f('0x65')](_0x43255e);}}return _0x1ff931;});});}else{return;}})[_0x2a9f('0x2c')](function(_0xefdc){if(_0xefdc)_0x23eebf=_0xefdc;if(_[_0x2a9f('0x63')](_0x1c5dbd,0x709)){var _0x48c721=_[_0x2a9f('0x50')](_0x23eebf,{'sectionId':0x709});return getPlugins(_0x48c721)[_0x2a9f('0x2c')](function(_0x4695a6){if(_0x48c721[_0x2a9f('0x66')]){return _[_0x2a9f('0x33')](_0x23eebf,function(_0x1f3872){if(_0x1f3872['sectionId']===0x709){_0x1f3872[_0x2a9f('0x64')]=_0x4695a6;}return _0x1f3872;});}else{var _0x8cd0ef={'sectionId':0x76c,'enabled':0x1,'subsections':_0x4695a6};var _0x494f09=_[_0x2a9f('0x33')](_0x23eebf);_0x494f09[_0x2a9f('0x5f')](_0x8cd0ef);return _0x494f09;}});}else{return;}})[_0x2a9f('0x2c')](function(_0x554ac7){if(_0x554ac7)_0x23eebf=_0x554ac7;return _[_0x2a9f('0x42')](_0x23eebf,[_0x2a9f('0x66'),0x1]);})['then'](respondWithResult(_0x4a5163,null))['catch'](handleError(_0x4a5163,null));};function hasDefaultDashboard(_0x27caa3){var _0x23f105=[0x65];return new BPromise(function(_0x392168,_0x4719ea){try{if(_0x27caa3[_0x2a9f('0x57')]){_0x392168(_0x23f105);}else{return db[_0x2a9f('0x58')][_0x2a9f('0x67')]({'where':{'sectionId':_0x27caa3['id']},'raw':!![]})[_0x2a9f('0x2c')](function(_0x4d499f){_0x4d499f?_0x392168(_0x23f105):_0x392168();});}}catch(_0x402732){_0x4719ea(_0x402732);}});}function getCustomDashboards(_0x54ee85){var _0x381f47=[];return new BPromise(function(_0x37b232,_0xd366f5){try{if(_0x54ee85[_0x2a9f('0x57')]){return db[_0x2a9f('0x68')][_0x2a9f('0x45')]({'raw':!![]})[_0x2a9f('0x2c')](function(_0x24e002){_0x24e002[_0x2a9f('0x69')](function(_0x337d69){_0x381f47['push'](_0x337d69['id']+0x1869f);});_0x37b232(_0x381f47);});}else{return db['UserProfileResource'][_0x2a9f('0x45')]({'where':{'sectionId':_0x54ee85['id']},'raw':!![]})[_0x2a9f('0x2c')](function(_0x471607){_0x471607[_0x2a9f('0x69')](function(_0x43363b){_0x381f47[_0x2a9f('0x5f')](_0x43363b[_0x2a9f('0x6a')]+0x1869f);});_0x37b232(_0x381f47);});}}catch(_0x11e119){_0xd366f5(_0x11e119);}});}function getPlugins(_0x4a351e){var _0x4f94e4=[];return new BPromise(function(_0x5d2be9,_0x4b697f){try{if(_0x4a351e[_0x2a9f('0x57')]){return db['Plugin']['findAll']({'raw':!![]})[_0x2a9f('0x2c')](function(_0x4522ed){_0x4522ed['forEach'](function(_0x4fa366){_0x4f94e4[_0x2a9f('0x5f')](_0x4fa366['id']+0x15b38);});_0x5d2be9(_0x4f94e4);});}else{return db[_0x2a9f('0x58')][_0x2a9f('0x45')]({'where':{'sectionId':_0x4a351e['id']},'raw':!![]})['then'](function(_0x300eca){_0x300eca['forEach'](function(_0x116059){_0x4f94e4[_0x2a9f('0x5f')](_0x116059['resourceId']+0x15b38);});_0x5d2be9(_0x4f94e4);});}}catch(_0x378bd9){_0x4b697f(_0x378bd9);}});}exports[_0x2a9f('0x6b')]=function(_0x2afa89,_0x16115c){return db[_0x2a9f('0x34')]['find']({'where':{'id':_0x2afa89[_0x2a9f('0x48')]['id']}})[_0x2a9f('0x2c')](handleEntityNotFound(_0x16115c,null))[_0x2a9f('0x2c')](function(_0xdc1372){if(_0xdc1372){return db[_0x2a9f('0x5e')]['transaction'](function(_0x42724a){return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x2afa89[_0x2a9f('0x48')]['id']},'attributes':['id'],'raw':!![]})[_0x2a9f('0x2c')](function(_0x27c8e9){if(_0x27c8e9){return db[_0x2a9f('0x5c')][_0x2a9f('0x2d')]({'where':{'userProfileId':_0x2afa89[_0x2a9f('0x48')]['id'],'id':_['map'](_0x27c8e9,function(_0x56ea0a){return _0x56ea0a['id'];})},'transaction':_0x42724a});}})[_0x2a9f('0x2c')](function(_0x46f6b8){var _0x34cb12=_['map'](_0x2afa89['body'],function(_0x310b2d){_0x310b2d[_0x2a9f('0x5a')]=_0x2afa89[_0x2a9f('0x48')]['id'];return _0x310b2d;});return db['UserProfileSection'][_0x2a9f('0x6c')](_0x34cb12,{'raw':!![],'transaction':_0x42724a});})[_0x2a9f('0x2c')](function(_0x4e3c02){var _0x3eff66=_[_0x2a9f('0x42')](_['map'](_0x4e3c02,function(_0x5cacf4){return _0x5cacf4[_0x2a9f('0x51')]({'plain':!![]});}),{'includeAll':![]});if(_0x3eff66){return db[_0x2a9f('0x5c')][_0x2a9f('0x45')]({'where':{'userProfileId':_0x2afa89[_0x2a9f('0x48')]['id'],'sectionId':_[_0x2a9f('0x33')](_0x3eff66,function(_0x134398){return _0x134398['sectionId'];})},'attributes':['id',_0x2a9f('0x59')],'raw':!![]})[_0x2a9f('0x2c')](function(_0x5befa1){var _0x509fca=_[_0x2a9f('0x33')](_0x2afa89[_0x2a9f('0x4e')],function(_0x269658){_0x269658[_0x2a9f('0x5a')]=_0x2afa89[_0x2a9f('0x48')]['id'];return _0x269658;});return db[_0x2a9f('0x58')][_0x2a9f('0x6c')](_0x509fca,{'raw':!![],'transaction':_0x42724a});});}})[_0x2a9f('0x47')](handleError(_0x16115c,null));});}})[_0x2a9f('0x2c')](function(_0x4ef616){var _0x56b648=_[_0x2a9f('0x33')](_0x4ef616,function(_0x137704){return _0x137704[_0x2a9f('0x51')]({'plain':!![]});});})[_0x2a9f('0x2c')](respondWithResult(_0x16115c,null))['catch'](handleError(_0x16115c,null));};exports[_0x2a9f('0x6d')]=function(_0x2702c5,_0x348a3b,_0x2b15ea){return db['UserProfile'][_0x2a9f('0x50')]({'where':{'id':_0x2702c5['params']['id']}})[_0x2a9f('0x2c')](handleEntityNotFound(_0x348a3b,null))[_0x2a9f('0x2c')](function(_0x5545b9){if(_0x5545b9){return _0x5545b9[_0x2a9f('0x6d')](_0x2702c5['query']['ids']);}})['then'](respondWithStatusCode(_0x348a3b,null))[_0x2a9f('0x47')](handleError(_0x348a3b,null));};exports[_0x2a9f('0x6e')]=function(_0x5a4e49,_0x4974ea){var _0x5d9e9f={};if(!_0x5a4e49[_0x2a9f('0x39')][_0x2a9f('0x6f')])throw new Error('Missing\x20section\x20parameter');if(!_0x5a4e49[_0x2a9f('0x39')]['hasOwnProperty'](_0x2a9f('0x70'))){_0x5d9e9f[_0x2a9f('0x24')]=qs[_0x2a9f('0x24')](_0x5a4e49[_0x2a9f('0x39')][_0x2a9f('0x24')]);_0x5d9e9f[_0x2a9f('0x26')]=qs[_0x2a9f('0x26')](_0x5a4e49['query']['offset']);}return db[_0x2a9f('0x34')][_0x2a9f('0x50')]({'where':{'id':_0x5a4e49[_0x2a9f('0x48')]['id']}})['then'](function(_0x23b83a){if(!_0x23b83a)throw new Error(_0x2a9f('0x71')+_0x5a4e49[_0x2a9f('0x48')]['id']);return db[_0x2a9f('0x34')][_0x2a9f('0x6e')](_0x5a4e49);})[_0x2a9f('0x2c')](respondWithFilteredResult(_0x4974ea,_0x5d9e9f))[_0x2a9f('0x47')](handleError(_0x4974ea,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 0f7e607..2c839dc 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 _0xeaab=['exports','events','UserProfile','setMaxListeners','remove','emit','hasOwnProperty','hook'];(function(_0x44876c,_0xfcfa43){var _0x2760c6=function(_0x5c6bb8){while(--_0x5c6bb8){_0x44876c['push'](_0x44876c['shift']());}};_0x2760c6(++_0xfcfa43);}(_0xeaab,0xd9));var _0xbeaa=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xeaab[_0x432682];return _0x463d05;};'use strict';var EventEmitter=require(_0xbeaa('0x0'));var UserProfile=require('../../mysqldb')['db'][_0xbeaa('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xbeaa('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xbeaa('0x3')};function emitEvent(_0x4486d4){return function(_0x36515c,_0x3e9c3b,_0x281a29){UserProfileEvents[_0xbeaa('0x4')](_0x4486d4+':'+_0x36515c['id'],_0x36515c);UserProfileEvents[_0xbeaa('0x4')](_0x4486d4,_0x36515c);_0x281a29(null);};}for(var e in events){if(events[_0xbeaa('0x5')](e)){var event=events[e];UserProfile[_0xbeaa('0x6')](e,emitEvent(event));}}module[_0xbeaa('0x7')]=UserProfileEvents; \ No newline at end of file +var _0x9e8a=['remove','hasOwnProperty','hook','exports','events','../../mysqldb','UserProfile','setMaxListeners','save','update'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x9e8a,0x112));var _0xa9e8=function(_0x2d4340,_0x14bd7f){_0x2d4340=_0x2d4340-0x0;var _0x5a2e9e=_0x9e8a[_0x2d4340];return _0x5a2e9e;};'use strict';var EventEmitter=require(_0xa9e8('0x0'));var UserProfile=require(_0xa9e8('0x1'))['db'][_0xa9e8('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xa9e8('0x3')](0x0);var events={'afterCreate':_0xa9e8('0x4'),'afterUpdate':_0xa9e8('0x5'),'afterDestroy':_0xa9e8('0x6')};function emitEvent(_0x337024){return function(_0xe3b2c8,_0x57736c,_0x4f9ddb){UserProfileEvents['emit'](_0x337024+':'+_0xe3b2c8['id'],_0xe3b2c8);UserProfileEvents['emit'](_0x337024,_0xe3b2c8);_0x4f9ddb(null);};}for(var e in events){if(events[_0xa9e8('0x7')](e)){var event=events[e];UserProfile[_0xa9e8('0x8')](e,emitEvent(event));}}module[_0xa9e8('0x9')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 69645fb..50edede 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 _0xf4aa=['fields','attributes','hasOwnProperty','limit','offset','order','sort','pick','VIRTUAL','foreignKey','forEach','merge','options','includeAll','reportType','default','DefaultReports','custom','CustomReports','count','rows','ids','customSorting','extraQueryConditions','CmContact','color','tag','ThroughTags','Agents','openTabs','true','chat','dataValues','sms','fax','mail','openchannel','lodash','./userProfile.attributes','../../components/parsers/qs','squel','models','filter','field','value','findAll','map','catch','model','then','associatedResources','UserProfileResource','type','resourceId','toLowerCase','squareprojects','childModel','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projectName','projects','JscriptyProject','contacts','Lists','ListId','lists','CmList','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceContext','voicemails','voicerecordings','membername','role','Telephones','name','User','telephone','VoiceQueue','QueueCampaigns','queue','outbound','musiconholds','VoiceMusicOnHold','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','MailAccount','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','teams','voicequeues','queuecampaigns','VoiceQueues','users','agents','telephones','admin','user','salesforceaccounts','SalesforceAccount','freshdeskaccounts','sugarcrmaccounts','SugarcrmAccount','deskaccounts','zohoaccounts','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','customdashboards','intervals','Interval','pauses','Pause','scheduler','Schedule','sounds','Tag','Template','triggers','Trigger','trunks','variables','Variable','plugins','Plugin','extractedreports','AnalyticExtractedReport','Reports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','slice','SELECT','select','ui.','InteractionId','ui.createdAt','from','user_has_','where','ui.UserId\x20=\x20?','sequelize','query','toString','OpenTabs','define','UserProfile','user_profiles','raw','mergeResources','length','push','find','params','ignore','isEmpty','union','autoAssociation','rawAttributes','keys','filters','intersection'];(function(_0x6e8d3,_0x2907c3){var _0xa14283=function(_0x250814){while(--_0x250814){_0x6e8d3['push'](_0x6e8d3['shift']());}};_0xa14283(++_0x2907c3);}(_0xf4aa,0xe6));var _0xaf4a=function(_0x1bc437,_0x404518){_0x1bc437=_0x1bc437-0x0;var _0x4caa4a=_0xf4aa[_0x1bc437];return _0x4caa4a;};'use strict';var _=require(_0xaf4a('0x0'));var attributes=require(_0xaf4a('0x1'));var qs=require(_0xaf4a('0x2'));var squel=require(_0xaf4a('0x3'));module['exports']=function(_0x5453da){var _0x104af7=_0x5453da[_0xaf4a('0x4')];function _0x14c370(_0x4b551e,_0x26b73a){return new Promise(function(_0x1660ea,_0x404783){if(!_0x26b73a)return _0x1660ea(null);var _0x1d9665=_0x26b73a[_0xaf4a('0x5')]?{[_0x26b73a[_0xaf4a('0x5')][_0xaf4a('0x6')]]:_0x26b73a[_0xaf4a('0x5')][_0xaf4a('0x7')]}:undefined;return _0x104af7[_0x4b551e][_0xaf4a('0x8')]({'where':_0x1d9665,'raw':!![]})['then'](function(_0x6ac73){_0x26b73a['associatedResources']=_[_0xaf4a('0x9')](_0x6ac73,'id');_0x1660ea(_0x26b73a);})[_0xaf4a('0xa')](function(_0x2157db){_0x404783(_0x2157db);});});}function _0x184975(_0x2d5513,_0x3a5e76){return new Promise(function(_0x2f3b3b,_0x15a7a6){var _0x48214f=_0x2d5513[_0xaf4a('0x5')]?{[_0x2d5513[_0xaf4a('0x5')]['field']]:_0x2d5513[_0xaf4a('0x5')][_0xaf4a('0x7')]}:undefined;return _0x104af7[_0x2d5513[_0xaf4a('0xb')]][_0xaf4a('0x8')]({'where':_0x48214f,'raw':!![]})[_0xaf4a('0xc')](function(_0x3bcbe9){_0x3a5e76[_0xaf4a('0xd')]=_[_0xaf4a('0x9')](_0x3bcbe9,function(_0x558e65){return _0x558e65['name'];});_0x2f3b3b(_0x3a5e76);})[_0xaf4a('0xa')](function(_0x18bedd){_0x15a7a6(_0x18bedd);});});}function _0x357d94(_0xc9d431,_0x501bcb,_0x2601aa){if(!_0x501bcb)return Promise['resolve'](null);return new Promise(function(_0x23f022,_0x25ac31){return _0x104af7[_0xaf4a('0xe')][_0xaf4a('0x8')]({'where':{'sectionId':_0x501bcb['id']},'raw':!![]})[_0xaf4a('0xc')](function(_0x3c138d){if(_0xc9d431[_0xaf4a('0x6')]&&_0xc9d431[_0xaf4a('0x6')]!=='id'){_0x501bcb[_0xaf4a('0xd')]=_[_0xaf4a('0x9')](_0x3c138d,function(_0x121e32){return _0x121e32[_0xc9d431[_0xaf4a('0x6')]];});}else{if(_0x2601aa==='AnalyticExtractedReport'){_0x501bcb[_0xaf4a('0xd')]=_[_0xaf4a('0x9')](_0x3c138d,function(_0x111c74){return{'id':_0x111c74['resourceId'],'type':_0x111c74[_0xaf4a('0xf')]};});}else{_0x501bcb[_0xaf4a('0xd')]=_[_0xaf4a('0x9')](_0x3c138d,function(_0x2c90b4){return _0x2c90b4[_0xaf4a('0x10')];});}}_0x23f022(_0x501bcb);})[_0xaf4a('0xa')](function(_0x576c91){_0x25ac31(_0x576c91);});});}function _0x1da66f(_0x1c0f2f,_0x388df2){var _0x1e0ca4={'parentSections':[]};switch(_0x1c0f2f[_0xaf4a('0x11')]()){case _0xaf4a('0x12'):_0x1e0ca4[_0xaf4a('0x13')]=_0xaf4a('0x14');break;case _0xaf4a('0x15'):_0x1e0ca4['childModel']=_0xaf4a('0x16');break;case _0xaf4a('0x17'):_0x1e0ca4[_0xaf4a('0x13')]=_0xaf4a('0x18');_0x1e0ca4[_0xaf4a('0x19')]=[{'name':_0xaf4a('0x1a'),'field':'name','foreignKey':_0xaf4a('0x1b')}];break;case _0xaf4a('0x1c'):_0x1e0ca4[_0xaf4a('0x13')]=_0xaf4a('0x1d');break;case _0xaf4a('0x1e'):_0x1e0ca4[_0xaf4a('0x13')]='CmContact';_0x1e0ca4[_0xaf4a('0x19')]=[{'name':_0xaf4a('0x1f'),'field':'id','foreignKey':_0xaf4a('0x20')}];break;case _0xaf4a('0x21'):_0x1e0ca4[_0xaf4a('0x13')]=_0xaf4a('0x22');break;case'companies':_0x1e0ca4[_0xaf4a('0x13')]=_0xaf4a('0x23');break;case _0xaf4a('0x24'):_0x1e0ca4[_0xaf4a('0x13')]=_0xaf4a('0x25');break;case _0xaf4a('0x26'):_0x1e0ca4[_0xaf4a('0x13')]=_0xaf4a('0x27');break;case'chatwebsites':_0x1e0ca4[_0xaf4a('0x13')]=_0xaf4a('0x28');break;case _0xaf4a('0x29'):_0x1e0ca4[_0xaf4a('0x13')]=_0xaf4a('0x2a');break;case _0xaf4a('0x2b'):_0x1e0ca4[_0xaf4a('0x13')]=_0xaf4a('0x2c');break;case _0xaf4a('0x2d'):case _0xaf4a('0x2e'):case _0xaf4a('0x2f'):_0x1e0ca4[_0xaf4a('0x13')]='VoiceExtension';break;case'contexts':_0x1e0ca4[_0xaf4a('0x13')]=_0xaf4a('0x30');break;case _0xaf4a('0x31'):_0x1e0ca4[_0xaf4a('0x13')]='VoiceMail';break;case _0xaf4a('0x32'):_0x1e0ca4[_0xaf4a('0x13')]='VoiceRecording';_0x1e0ca4[_0xaf4a('0x19')]=[{'name':'Agents','field':'name','foreignKey':_0xaf4a('0x33'),'model':'User','filter':{'field':_0xaf4a('0x34'),'value':['agent']}},{'name':_0xaf4a('0x35'),'field':_0xaf4a('0x36'),'foreignKey':_0xaf4a('0x33'),'model':_0xaf4a('0x37'),'filter':{'field':_0xaf4a('0x34'),'value':[_0xaf4a('0x38')]}},{'name':'VoiceQueues','field':_0xaf4a('0x36'),'foreignKey':'queue','model':_0xaf4a('0x39'),'filter':{'field':_0xaf4a('0xf'),'value':['inbound']}},{'name':_0xaf4a('0x3a'),'field':_0xaf4a('0x36'),'foreignKey':_0xaf4a('0x3b'),'model':_0xaf4a('0x39'),'filter':{'field':'type','value':[_0xaf4a('0x3c')]}}];break;case _0xaf4a('0x3d'):_0x1e0ca4[_0xaf4a('0x13')]=_0xaf4a('0x3e');break;case'chanspies':_0x1e0ca4[_0xaf4a('0x13')]=_0xaf4a('0x3f');break;case _0xaf4a('0x40'):_0x1e0ca4[_0xaf4a('0x13')]=_0xaf4a('0x41');break;case _0xaf4a('0x42'):_0x1e0ca4[_0xaf4a('0x13')]=_0xaf4a('0x43');break;case _0xaf4a('0x44'):_0x1e0ca4['childModel']=_0xaf4a('0x45');break;case'mailaccounts':_0x1e0ca4[_0xaf4a('0x13')]=_0xaf4a('0x46');break;case'mailsubstatuses':_0x1e0ca4['childModel']=_0xaf4a('0x47');break;case _0xaf4a('0x48'):_0x1e0ca4[_0xaf4a('0x13')]=_0xaf4a('0x49');break;case _0xaf4a('0x4a'):_0x1e0ca4['childModel']=_0xaf4a('0x4b');break;case _0xaf4a('0x4c'):_0x1e0ca4[_0xaf4a('0x13')]=_0xaf4a('0x4d');break;case _0xaf4a('0x4e'):_0x1e0ca4['childModel']=_0xaf4a('0x4f');break;case'whatsappqueues':_0x1e0ca4[_0xaf4a('0x13')]='WhatsappQueue';break;case'whatsappaccounts':_0x1e0ca4[_0xaf4a('0x13')]='WhatsappAccount';break;case _0xaf4a('0x50'):_0x1e0ca4[_0xaf4a('0x13')]='Team';break;case _0xaf4a('0x51'):case _0xaf4a('0x52'):_0x1e0ca4[_0xaf4a('0x13')]=_0xaf4a('0x39');if(_0x388df2){_0x1e0ca4[_0xaf4a('0x19')]=[{'name':_0xaf4a('0x53')},{'name':_0xaf4a('0x3a')}];}break;case _0xaf4a('0x54'):case _0xaf4a('0x55'):case _0xaf4a('0x56'):_0x1e0ca4[_0xaf4a('0x13')]='User';if(_0x388df2){_0x1e0ca4[_0xaf4a('0x19')]=[{'name':'Users','filter':{'field':_0xaf4a('0x34'),'value':[_0xaf4a('0x57'),_0xaf4a('0x58')]},'ignore':!![]},{'name':'Agents'},{'name':_0xaf4a('0x35')}];}break;case'zendeskaccounts':_0x1e0ca4['childModel']='ZendeskAccount';break;case _0xaf4a('0x59'):_0x1e0ca4[_0xaf4a('0x13')]=_0xaf4a('0x5a');break;case _0xaf4a('0x5b'):_0x1e0ca4['childModel']='FreshdeskAccount';break;case _0xaf4a('0x5c'):_0x1e0ca4[_0xaf4a('0x13')]=_0xaf4a('0x5d');break;case _0xaf4a('0x5e'):_0x1e0ca4[_0xaf4a('0x13')]='DeskAccount';break;case _0xaf4a('0x5f'):_0x1e0ca4[_0xaf4a('0x13')]='ZohoAccount';break;case _0xaf4a('0x60'):_0x1e0ca4[_0xaf4a('0x13')]=_0xaf4a('0x37');break;case _0xaf4a('0x61'):_0x1e0ca4[_0xaf4a('0x13')]=_0xaf4a('0x62');break;case _0xaf4a('0x63'):_0x1e0ca4['childModel']='Disposition';break;case _0xaf4a('0x64'):_0x1e0ca4[_0xaf4a('0x13')]='Dashboard';break;case _0xaf4a('0x65'):_0x1e0ca4[_0xaf4a('0x13')]=_0xaf4a('0x66');break;case _0xaf4a('0x67'):_0x1e0ca4['childModel']=_0xaf4a('0x68');break;case _0xaf4a('0x69'):_0x1e0ca4[_0xaf4a('0x13')]=_0xaf4a('0x6a');break;case _0xaf4a('0x6b'):_0x1e0ca4['childModel']='Sound';break;case'tags':_0x1e0ca4['childModel']=_0xaf4a('0x6c');break;case'templates':_0x1e0ca4['childModel']=_0xaf4a('0x6d');break;case _0xaf4a('0x6e'):_0x1e0ca4[_0xaf4a('0x13')]=_0xaf4a('0x6f');break;case _0xaf4a('0x70'):_0x1e0ca4[_0xaf4a('0x13')]='Trunk';break;case _0xaf4a('0x71'):_0x1e0ca4[_0xaf4a('0x13')]=_0xaf4a('0x72');break;case _0xaf4a('0x73'):_0x1e0ca4[_0xaf4a('0x13')]=_0xaf4a('0x74');break;case _0xaf4a('0x75'):_0x1e0ca4[_0xaf4a('0x13')]=_0xaf4a('0x76');_0x1e0ca4[_0xaf4a('0x19')]=[{'name':_0xaf4a('0x77'),'field':'id','foreignKey':_0xaf4a('0x78')}];break;case _0xaf4a('0x79'):_0x1e0ca4[_0xaf4a('0x13')]=_0xaf4a('0x7a');break;}return _0x1e0ca4;}function _0x21da95(_0x4c92fb,_0x535a2e){var _0xee9b1b=_0x4c92fb[_0xaf4a('0x7b')](0x0)[_0xaf4a('0x7c')]()+_0x4c92fb[_0xaf4a('0x7d')](0x1);var _0x354666={'type':_0x104af7['Sequelize']['QueryTypes'][_0xaf4a('0x7e')],'raw':!![]};return new Promise(function(_0x356a28,_0x375cb7){var _0x1f7362=squel[_0xaf4a('0x7f')]()['field'](_0xaf4a('0x80')+_0xee9b1b+_0xaf4a('0x81'),'id')[_0xaf4a('0x6')](_0xaf4a('0x82'))[_0xaf4a('0x83')](_0xaf4a('0x84')+_0x4c92fb+'_interactions','ui')[_0xaf4a('0x85')](_0xaf4a('0x86'),_0x535a2e['id']);return _0x104af7[_0xaf4a('0x87')][_0xaf4a('0x88')](_0x1f7362[_0xaf4a('0x89')](),_0x354666)['then'](function(_0x351f11){_0x535a2e[_0xee9b1b+_0xaf4a('0x8a')]=_0x351f11;_0x356a28(_0x351f11);})['catch'](function(_0x1c7aae){_0x375cb7(_0x1c7aae);});});}return _0x5453da[_0xaf4a('0x8b')](_0xaf4a('0x8c'),attributes,{'tableName':_0xaf4a('0x8d'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x3627b7){var _0x542924={'raw':_0x3627b7[_0xaf4a('0x88')][_0xaf4a('0x8e')],'where':{}};var _0x3258a4={};var _0x419c58={'count':0x0,'rows':[]};var _0x2194f1=_0x3627b7[_0xaf4a('0x88')]['section'];var _0x577b1e=_0x3627b7[_0xaf4a('0x88')][_0xaf4a('0x8f')]||![];var _0xa4e816=_0x1da66f(_0x2194f1,_0x577b1e);if(!_0xa4e816['childModel'])throw new Error('Invalid\x20section\x20\x27'+_0x2194f1+'\x27');var _0x2333eb=[{'name':_0x2194f1}];if(!_['isEmpty'](_0xa4e816[_0xaf4a('0x19')]))_0x2333eb=_0xa4e816[_0xaf4a('0x19')];var _0x4a84a3=[];for(var _0x1e9922=0x0;_0x1e9922<_0x2333eb[_0xaf4a('0x90')];_0x1e9922++){_0x4a84a3[_0xaf4a('0x91')](_0x104af7['UserProfileSection'][_0xaf4a('0x92')]({'where':{'userProfileId':_0x3627b7[_0xaf4a('0x93')]['id'],'name':_0x2333eb[_0x1e9922][_0xaf4a('0x36')]},'raw':!![]}));}return Promise['all'](_0x4a84a3)[_0xaf4a('0xc')](function(_0x541cba){var _0x4f3ba5=_[_0xaf4a('0x5')](_0x541cba,function(_0x28c256){return _0x28c256?_0x28c256:undefined;});var _0x523ce3=_['filter'](_0x2333eb,[_0xaf4a('0x94'),!![]]);var _0xf1a257=_['isEmpty'](_0x4f3ba5)&&_[_0xaf4a('0x95')](_0x523ce3)?null:_[_0xaf4a('0x96')](_0x523ce3,_0x4f3ba5);if(!_0xf1a257)return null;var _0x357218=[];for(var _0x32c2a2=0x0;_0x32c2a2<_0xf1a257[_0xaf4a('0x90')];_0x32c2a2++){var _0x7d6a52=_[_0xaf4a('0x92')](_0x2333eb,function(_0x5ad916){return _0xf1a257[_0x32c2a2]?_0x5ad916['name']===_0xf1a257[_0x32c2a2][_0xaf4a('0x36')]:null;});if(_0x7d6a52){if(_0xf1a257[_0x32c2a2][_0xaf4a('0x94')]){_0x357218['push'](_0x14c370(_0xa4e816[_0xaf4a('0x13')],_0xf1a257[_0x32c2a2]));}else{if(!_0xf1a257[_0x32c2a2][_0xaf4a('0x97')]){_0x357218[_0xaf4a('0x91')](_0x357d94(_0x7d6a52,_0xf1a257[_0x32c2a2],_0xa4e816[_0xaf4a('0x13')]));}else{if(_0x7d6a52['model']){_0x357218['push'](_0x184975(_0x7d6a52,_0xf1a257[_0x32c2a2]));}}}}}return Promise['all'](_0x357218);})[_0xaf4a('0xc')](function(_0x20328b){var _0x5e9265=_0x20328b;var _0x777e00=null;if(_0x5e9265){_0x777e00=_0x5e9265[_0xaf4a('0x90')]===0x1?_0x5e9265[0x0]:null;}if(!_0x777e00&&!_0x5e9265)return _0x419c58;var _0x561445=_0x104af7[_0xa4e816['childModel']][_0xaf4a('0x98')];_0x3258a4['model']=_['keys'](_0x561445);_0x3258a4['query']=_[_0xaf4a('0x99')](_0x3627b7[_0xaf4a('0x88')]);_0x3258a4[_0xaf4a('0x9a')]=_[_0xaf4a('0x9b')](_0x3258a4['model'],_0x3258a4['query']);_0x542924['attributes']=_['intersection'](_0x3258a4['model'],qs[_0xaf4a('0x9c')](_0x3627b7[_0xaf4a('0x88')][_0xaf4a('0x9c')]));_0x542924['attributes']=_0x542924['attributes'][_0xaf4a('0x90')]?_0x542924[_0xaf4a('0x9d')]:_0x3258a4[_0xaf4a('0xb')];if(!_0x3627b7[_0xaf4a('0x88')][_0xaf4a('0x9e')]('nolimit')){_0x542924['limit']=qs[_0xaf4a('0x9f')](_0x3627b7[_0xaf4a('0x88')]['limit']);_0x542924['offset']=qs[_0xaf4a('0xa0')](_0x3627b7[_0xaf4a('0x88')]['offset']);}_0x542924[_0xaf4a('0xa1')]=qs[_0xaf4a('0xa2')](_0x3627b7[_0xaf4a('0x88')][_0xaf4a('0xa2')]);_0x542924['where']=qs[_0xaf4a('0x9a')](_[_0xaf4a('0xa3')](_0x3627b7[_0xaf4a('0x88')],_0x3258a4['filters']));if(_0x3627b7[_0xaf4a('0x88')][_0xaf4a('0x5')]){_0x542924[_0xaf4a('0x85')]=_['merge'](_0x542924['where'],{'$or':_['map'](_0x561445,function(_0x43c5d2){if(_0x43c5d2['type']['key']!==_0xaf4a('0xa4')){var _0x5b0e5b={};_0x5b0e5b[_0x43c5d2[_0xaf4a('0x6')]]={'$like':'%'+_0x3627b7[_0xaf4a('0x88')][_0xaf4a('0x5')]+'%'};return _0x5b0e5b;}})});}var _0x54d3ff=[];var _0x24c639=null;var _0x40d9e9={};if(_0x777e00){_0x24c639=_[_0xaf4a('0x92')](_0x2333eb,[_0xaf4a('0x36'),_0x777e00['name']]);if(_0x24c639[_0xaf4a('0x6')]){_0x40d9e9={};if(_0xa4e816[_0xaf4a('0x13')]===_0xaf4a('0x76')){_0x40d9e9[_0x24c639[_0xaf4a('0xa5')]]=_[_0xaf4a('0x9')](_0x777e00[_0xaf4a('0xd')],'id');}else{_0x40d9e9[_0x24c639[_0xaf4a('0xa5')]]=_0x777e00[_0xaf4a('0xd')];}_0x54d3ff['push'](_0x40d9e9);}else{_0x542924[_0xaf4a('0x85')]['id']=_0x777e00[_0xaf4a('0xd')];}}else{for(var _0x53858c=0x0;_0x53858c<_0x5e9265[_0xaf4a('0x90')];_0x53858c++){_0x24c639=_[_0xaf4a('0x92')](_0x2333eb,[_0xaf4a('0x36'),_0x5e9265[_0x53858c]['name']]);if(_0x24c639['field']){_0x40d9e9={};_0x40d9e9[_0x24c639[_0xaf4a('0xa5')]]=_0x5e9265[_0x53858c][_0xaf4a('0xd')];_0x54d3ff[_0xaf4a('0x91')](_0x40d9e9);}else{if(!_0x542924['where']['id'])_0x542924[_0xaf4a('0x85')]['id']=[];_0x5e9265[_0x53858c][_0xaf4a('0xd')][_0xaf4a('0xa6')](function(_0x37f0bf){_0x542924['where']['id']['push'](_0x37f0bf);});}}}if(!_[_0xaf4a('0x95')](_0x54d3ff)){_0x542924['where']=_[_0xaf4a('0xa7')](_0x542924[_0xaf4a('0x85')],{'$and':{'$or':_0x54d3ff}});}_0x542924=_['merge']({},_0x542924,_0x3627b7[_0xaf4a('0xa8')]);if(_0x777e00&&!_0x777e00['autoAssociation']&&_0xa4e816[_0xaf4a('0x13')]===_0xaf4a('0x76')){if(_0x3627b7[_0xaf4a('0x88')][_0xaf4a('0xa9')]){_0x542924['include']=[{'all':!![]}];}return _0x104af7[_0xa4e816[_0xaf4a('0x13')]][_0xaf4a('0x8')](_0x542924)[_0xaf4a('0xc')](function(_0xc713bb){var _0xeef7d0=[];_0xc713bb[_0xaf4a('0xa6')](function(_0x394bc0){var _0x463d46;switch(_0x394bc0[_0xaf4a('0xaa')]){case _0xaf4a('0xab'):_0x463d46=_[_0xaf4a('0x92')](_0x777e00[_0xaf4a('0xd')],function(_0x25cb4b){return _0x25cb4b['id']===_0x394bc0[_0xaf4a('0x78')]&&_0x25cb4b[_0xaf4a('0xf')]===_0xaf4a('0xac');});break;case _0xaf4a('0xad'):_0x463d46=_[_0xaf4a('0x92')](_0x777e00[_0xaf4a('0xd')],function(_0xe6e3e7){return _0xe6e3e7['id']===_0x394bc0['reportId']&&_0xe6e3e7[_0xaf4a('0xf')]===_0xaf4a('0xae');});break;}if(_0x463d46)_0xeef7d0['push'](_0x394bc0);});_0x419c58[_0xaf4a('0xaf')]=_0xeef7d0[_0xaf4a('0x90')];_0x419c58[_0xaf4a('0xb0')]=_0xeef7d0;return _0x419c58;});}else{if(!_['isEmpty'](_0x3627b7[_0xaf4a('0x88')]['ids'])){_0x542924[_0xaf4a('0x85')]['id']=_0x542924['where']['id']?_['intersection'](_0x542924[_0xaf4a('0x85')]['id'],_0x3627b7[_0xaf4a('0x88')][_0xaf4a('0xb1')]):_0x3627b7[_0xaf4a('0x88')][_0xaf4a('0xb1')];if(_0x3627b7[_0xaf4a('0x88')][_0xaf4a('0xb2')]){_0x542924[_0xaf4a('0xa1')]=_0x3627b7[_0xaf4a('0x88')][_0xaf4a('0xb2')];}}if(_0x3627b7[_0xaf4a('0x88')][_0xaf4a('0xb3')]){_0x542924[_0xaf4a('0x85')]=_['merge'](_0x542924[_0xaf4a('0x85')],{'$and':_0x3627b7['query'][_0xaf4a('0xb3')]});}return _0x104af7[_0xa4e816[_0xaf4a('0x13')]][_0xaf4a('0xaf')]({'where':_0x542924['where']})[_0xaf4a('0xc')](function(_0x52ba3a){_0x419c58[_0xaf4a('0xaf')]=_0x52ba3a;if(_0x3627b7['query'][_0xaf4a('0xa9')]){if(_0xa4e816['childModel']===_0xaf4a('0xb4')){_0x542924['include']=[{'model':_0x104af7['Tag'],'as':'Tags','attributes':['id',_0xaf4a('0x36'),_0xaf4a('0xb5')],'required':_0x3627b7[_0xaf4a('0x88')][_0xaf4a('0xb6')]?!![]:![]},{'model':_0x104af7['Tag'],'as':_0xaf4a('0xb7'),'attributes':['id',_0xaf4a('0x36'),_0xaf4a('0xb5')],'through':_0x3627b7['query']['tag']?{'attributes':[],'where':{'TagId':_0x3627b7[_0xaf4a('0x88')][_0xaf4a('0xb6')]||undefined}}:{},'required':_0x3627b7[_0xaf4a('0x88')]['tag']?!![]:![]}];}else{_0x542924['include']=[{'all':!![]}];}}return _0x104af7[_0xa4e816[_0xaf4a('0x13')]][_0xaf4a('0x8')](_0x542924);})[_0xaf4a('0xc')](function(_0x4766c0){_0x419c58['rows']=_0x4766c0;if(_0x2194f1===_0xaf4a('0xb8')&&_0x3627b7[_0xaf4a('0x88')][_0xaf4a('0xb9')]===_0xaf4a('0xba')){var _0x57df1c=[];for(var _0x31cadd=0x0;_0x31cadd<_0x419c58[_0xaf4a('0xb0')][_0xaf4a('0x90')];_0x31cadd++){_0x57df1c['push'](_0x21da95(_0xaf4a('0xbb'),_0x419c58[_0xaf4a('0xb0')][_0x31cadd][_0xaf4a('0xbc')]));_0x57df1c[_0xaf4a('0x91')](_0x21da95(_0xaf4a('0xbd'),_0x419c58[_0xaf4a('0xb0')][_0x31cadd][_0xaf4a('0xbc')]));_0x57df1c[_0xaf4a('0x91')](_0x21da95(_0xaf4a('0xbe'),_0x419c58[_0xaf4a('0xb0')][_0x31cadd]['dataValues']));_0x57df1c[_0xaf4a('0x91')](_0x21da95(_0xaf4a('0xbf'),_0x419c58[_0xaf4a('0xb0')][_0x31cadd]['dataValues']));_0x57df1c[_0xaf4a('0x91')](_0x21da95(_0xaf4a('0xc0'),_0x419c58[_0xaf4a('0xb0')][_0x31cadd][_0xaf4a('0xbc')]));_0x57df1c[_0xaf4a('0x91')](_0x21da95('whatsapp',_0x419c58['rows'][_0x31cadd][_0xaf4a('0xbc')]));}return Promise['all'](_0x57df1c)[_0xaf4a('0xc')](function(){return _0x419c58;});}return _0x419c58;});}});}}});}; \ No newline at end of file +var _0xd2f8=['Agents','membername','User','role','agent','Telephones','telephone','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','VoicePrefix','ivrcampaigns','mailqueues','MailQueue','mailaccounts','mailsubstatuses','openchannelaccounts','OpenchannelAccount','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','teams','Team','voicequeues','agents','telephones','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','Pause','scheduler','sounds','Sound','Tag','templates','Template','triggers','Trigger','trunks','Trunk','variables','Variable','plugins','Plugin','Reports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','Sequelize','QueryTypes','ui.','InteractionId','ui.createdAt','from','user_has_','where','ui.UserId\x20=\x20?','toString','OpenTabs','define','UserProfile','user_profiles','query','raw','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','push','find','params','all','ignore','union','autoAssociation','keys','filters','attributes','fields','nolimit','limit','offset','order','sort','pick','key','VIRTUAL','foreignKey','merge','options','include','forEach','reportType','custom','CustomReports','rows','ids','intersection','customSorting','extraQueryConditions','count','includeAll','color','tag','true','chat','dataValues','sms','fax','openchannel','lodash','./userProfile.attributes','../../components/parsers/qs','exports','models','filter','field','value','findAll','then','associatedResources','map','catch','model','name','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','childModel','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','contacts','CmContact','Lists','lists','CmList','CmCustomField','chatqueues','ChatQueue','chatwebsites','faxqueues','faxaccounts','FaxAccount','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','VoiceRecording'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xd2f8,0x8b));var _0x8d2f=function(_0x32144d,_0x3bf972){_0x32144d=_0x32144d-0x0;var _0x47a0bf=_0xd2f8[_0x32144d];return _0x47a0bf;};'use strict';var _=require(_0x8d2f('0x0'));var attributes=require(_0x8d2f('0x1'));var qs=require(_0x8d2f('0x2'));var squel=require('squel');module[_0x8d2f('0x3')]=function(_0x8d9e0d){var _0x2da760=_0x8d9e0d[_0x8d2f('0x4')];function _0x38010f(_0x435fa5,_0x27aa8d){return new Promise(function(_0x15326f,_0x36979e){if(!_0x27aa8d)return _0x15326f(null);var _0x1b0902=_0x27aa8d['filter']?{[_0x27aa8d[_0x8d2f('0x5')][_0x8d2f('0x6')]]:_0x27aa8d[_0x8d2f('0x5')][_0x8d2f('0x7')]}:undefined;return _0x2da760[_0x435fa5][_0x8d2f('0x8')]({'where':_0x1b0902,'raw':!![]})[_0x8d2f('0x9')](function(_0x37a9b4){_0x27aa8d[_0x8d2f('0xa')]=_[_0x8d2f('0xb')](_0x37a9b4,'id');_0x15326f(_0x27aa8d);})[_0x8d2f('0xc')](function(_0x441870){_0x36979e(_0x441870);});});}function _0x3ce139(_0x27f4e4,_0x13b3a4){return new Promise(function(_0x9f1e0a,_0x531ef4){var _0x3d057f=_0x27f4e4[_0x8d2f('0x5')]?{[_0x27f4e4[_0x8d2f('0x5')][_0x8d2f('0x6')]]:_0x27f4e4['filter'][_0x8d2f('0x7')]}:undefined;return _0x2da760[_0x27f4e4[_0x8d2f('0xd')]][_0x8d2f('0x8')]({'where':_0x3d057f,'raw':!![]})[_0x8d2f('0x9')](function(_0x412336){_0x13b3a4[_0x8d2f('0xa')]=_[_0x8d2f('0xb')](_0x412336,function(_0x17e610){return _0x17e610[_0x8d2f('0xe')];});_0x9f1e0a(_0x13b3a4);})[_0x8d2f('0xc')](function(_0x353730){_0x531ef4(_0x353730);});});}function _0x411a96(_0x5610f1,_0x26ff19,_0x39b36b){if(!_0x26ff19)return Promise[_0x8d2f('0xf')](null);return new Promise(function(_0x26e385,_0xe750f9){return _0x2da760[_0x8d2f('0x10')]['findAll']({'where':{'sectionId':_0x26ff19['id']},'raw':!![]})['then'](function(_0x3f9600){if(_0x5610f1[_0x8d2f('0x6')]&&_0x5610f1[_0x8d2f('0x6')]!=='id'){_0x26ff19['associatedResources']=_[_0x8d2f('0xb')](_0x3f9600,function(_0xcb070b){return _0xcb070b[_0x5610f1[_0x8d2f('0x6')]];});}else{if(_0x39b36b===_0x8d2f('0x11')){_0x26ff19[_0x8d2f('0xa')]=_[_0x8d2f('0xb')](_0x3f9600,function(_0x327189){return{'id':_0x327189[_0x8d2f('0x12')],'type':_0x327189[_0x8d2f('0x13')]};});}else{_0x26ff19[_0x8d2f('0xa')]=_[_0x8d2f('0xb')](_0x3f9600,function(_0x39da94){return _0x39da94[_0x8d2f('0x12')];});}}_0x26e385(_0x26ff19);})[_0x8d2f('0xc')](function(_0x524b72){_0xe750f9(_0x524b72);});});}function _0x357005(_0x2ac945,_0x160a9d){var _0x4100e6={'parentSections':[]};switch(_0x2ac945[_0x8d2f('0x14')]()){case _0x8d2f('0x15'):_0x4100e6[_0x8d2f('0x16')]='SquareProject';break;case'odbc':_0x4100e6[_0x8d2f('0x16')]=_0x8d2f('0x17');break;case _0x8d2f('0x18'):_0x4100e6[_0x8d2f('0x16')]=_0x8d2f('0x19');_0x4100e6[_0x8d2f('0x1a')]=[{'name':_0x8d2f('0x1b'),'field':_0x8d2f('0xe'),'foreignKey':'projectName'}];break;case'projects':_0x4100e6[_0x8d2f('0x16')]='JscriptyProject';break;case _0x8d2f('0x1c'):_0x4100e6[_0x8d2f('0x16')]=_0x8d2f('0x1d');_0x4100e6['parentSections']=[{'name':_0x8d2f('0x1e'),'field':'id','foreignKey':'ListId'}];break;case _0x8d2f('0x1f'):_0x4100e6[_0x8d2f('0x16')]=_0x8d2f('0x20');break;case'companies':_0x4100e6[_0x8d2f('0x16')]='CmCompany';break;case'globalcustomfields':_0x4100e6[_0x8d2f('0x16')]=_0x8d2f('0x21');break;case _0x8d2f('0x22'):_0x4100e6[_0x8d2f('0x16')]=_0x8d2f('0x23');break;case _0x8d2f('0x24'):_0x4100e6[_0x8d2f('0x16')]='ChatWebsite';break;case _0x8d2f('0x25'):_0x4100e6[_0x8d2f('0x16')]='FaxQueue';break;case _0x8d2f('0x26'):_0x4100e6[_0x8d2f('0x16')]=_0x8d2f('0x27');break;case'inboundroutes':case'internalroutes':case _0x8d2f('0x28'):_0x4100e6['childModel']=_0x8d2f('0x29');break;case _0x8d2f('0x2a'):_0x4100e6[_0x8d2f('0x16')]=_0x8d2f('0x2b');break;case _0x8d2f('0x2c'):_0x4100e6[_0x8d2f('0x16')]=_0x8d2f('0x2d');break;case'voicerecordings':_0x4100e6[_0x8d2f('0x16')]=_0x8d2f('0x2e');_0x4100e6['parentSections']=[{'name':_0x8d2f('0x2f'),'field':_0x8d2f('0xe'),'foreignKey':_0x8d2f('0x30'),'model':_0x8d2f('0x31'),'filter':{'field':_0x8d2f('0x32'),'value':[_0x8d2f('0x33')]}},{'name':_0x8d2f('0x34'),'field':'name','foreignKey':_0x8d2f('0x30'),'model':'User','filter':{'field':_0x8d2f('0x32'),'value':[_0x8d2f('0x35')]}},{'name':_0x8d2f('0x36'),'field':_0x8d2f('0xe'),'foreignKey':_0x8d2f('0x37'),'model':_0x8d2f('0x38'),'filter':{'field':'type','value':[_0x8d2f('0x39')]}},{'name':_0x8d2f('0x3a'),'field':'name','foreignKey':'queue','model':'VoiceQueue','filter':{'field':_0x8d2f('0x13'),'value':[_0x8d2f('0x3b')]}}];break;case _0x8d2f('0x3c'):_0x4100e6[_0x8d2f('0x16')]=_0x8d2f('0x3d');break;case _0x8d2f('0x3e'):_0x4100e6[_0x8d2f('0x16')]=_0x8d2f('0x3f');break;case'voiceprefixes':_0x4100e6[_0x8d2f('0x16')]=_0x8d2f('0x40');break;case _0x8d2f('0x41'):_0x4100e6[_0x8d2f('0x16')]='Campaign';break;case _0x8d2f('0x42'):_0x4100e6['childModel']=_0x8d2f('0x43');break;case _0x8d2f('0x44'):_0x4100e6[_0x8d2f('0x16')]='MailAccount';break;case _0x8d2f('0x45'):_0x4100e6['childModel']='MailSubstatus';break;case'openchannelqueues':_0x4100e6[_0x8d2f('0x16')]='OpenchannelQueue';break;case _0x8d2f('0x46'):_0x4100e6[_0x8d2f('0x16')]=_0x8d2f('0x47');break;case'smsqueues':_0x4100e6[_0x8d2f('0x16')]=_0x8d2f('0x48');break;case _0x8d2f('0x49'):_0x4100e6['childModel']=_0x8d2f('0x4a');break;case _0x8d2f('0x4b'):_0x4100e6[_0x8d2f('0x16')]=_0x8d2f('0x4c');break;case _0x8d2f('0x4d'):_0x4100e6[_0x8d2f('0x16')]='WhatsappAccount';break;case _0x8d2f('0x4e'):_0x4100e6[_0x8d2f('0x16')]=_0x8d2f('0x4f');break;case _0x8d2f('0x50'):case'queuecampaigns':_0x4100e6[_0x8d2f('0x16')]=_0x8d2f('0x38');if(_0x160a9d){_0x4100e6[_0x8d2f('0x1a')]=[{'name':_0x8d2f('0x36')},{'name':'QueueCampaigns'}];}break;case'users':case _0x8d2f('0x51'):case _0x8d2f('0x52'):_0x4100e6[_0x8d2f('0x16')]='User';if(_0x160a9d){_0x4100e6['parentSections']=[{'name':'Users','filter':{'field':'role','value':['admin',_0x8d2f('0x53')]},'ignore':!![]},{'name':_0x8d2f('0x2f')},{'name':_0x8d2f('0x34')}];}break;case _0x8d2f('0x54'):_0x4100e6[_0x8d2f('0x16')]=_0x8d2f('0x55');break;case _0x8d2f('0x56'):_0x4100e6['childModel']='SalesforceAccount';break;case _0x8d2f('0x57'):_0x4100e6[_0x8d2f('0x16')]=_0x8d2f('0x58');break;case _0x8d2f('0x59'):_0x4100e6[_0x8d2f('0x16')]=_0x8d2f('0x5a');break;case _0x8d2f('0x5b'):_0x4100e6[_0x8d2f('0x16')]=_0x8d2f('0x5c');break;case'zohoaccounts':_0x4100e6['childModel']='ZohoAccount';break;case'vtigeraccounts':_0x4100e6[_0x8d2f('0x16')]=_0x8d2f('0x31');break;case _0x8d2f('0x5d'):_0x4100e6['childModel']=_0x8d2f('0x5e');break;case _0x8d2f('0x5f'):_0x4100e6[_0x8d2f('0x16')]=_0x8d2f('0x60');break;case _0x8d2f('0x61'):_0x4100e6['childModel']=_0x8d2f('0x62');break;case _0x8d2f('0x63'):_0x4100e6[_0x8d2f('0x16')]=_0x8d2f('0x64');break;case _0x8d2f('0x65'):_0x4100e6[_0x8d2f('0x16')]=_0x8d2f('0x66');break;case _0x8d2f('0x67'):_0x4100e6[_0x8d2f('0x16')]='Schedule';break;case _0x8d2f('0x68'):_0x4100e6[_0x8d2f('0x16')]=_0x8d2f('0x69');break;case'tags':_0x4100e6[_0x8d2f('0x16')]=_0x8d2f('0x6a');break;case _0x8d2f('0x6b'):_0x4100e6[_0x8d2f('0x16')]=_0x8d2f('0x6c');break;case _0x8d2f('0x6d'):_0x4100e6['childModel']=_0x8d2f('0x6e');break;case _0x8d2f('0x6f'):_0x4100e6['childModel']=_0x8d2f('0x70');break;case _0x8d2f('0x71'):_0x4100e6[_0x8d2f('0x16')]=_0x8d2f('0x72');break;case _0x8d2f('0x73'):_0x4100e6[_0x8d2f('0x16')]=_0x8d2f('0x74');break;case'extractedreports':_0x4100e6[_0x8d2f('0x16')]=_0x8d2f('0x11');_0x4100e6['parentSections']=[{'name':_0x8d2f('0x75'),'field':'id','foreignKey':_0x8d2f('0x76')}];break;case _0x8d2f('0x77'):_0x4100e6[_0x8d2f('0x16')]=_0x8d2f('0x78');break;}return _0x4100e6;}function _0x2a5fc5(_0x3b7b32,_0x11d466){var _0x1ca8c6=_0x3b7b32[_0x8d2f('0x79')](0x0)[_0x8d2f('0x7a')]()+_0x3b7b32['slice'](0x1);var _0x5e5452={'type':_0x2da760[_0x8d2f('0x7b')][_0x8d2f('0x7c')]['SELECT'],'raw':!![]};return new Promise(function(_0x5e2baf,_0x1c8439){var _0x36e2a1=squel['select']()['field'](_0x8d2f('0x7d')+_0x1ca8c6+_0x8d2f('0x7e'),'id')[_0x8d2f('0x6')](_0x8d2f('0x7f'))[_0x8d2f('0x80')](_0x8d2f('0x81')+_0x3b7b32+'_interactions','ui')[_0x8d2f('0x82')](_0x8d2f('0x83'),_0x11d466['id']);return _0x2da760['sequelize']['query'](_0x36e2a1[_0x8d2f('0x84')](),_0x5e5452)[_0x8d2f('0x9')](function(_0x3e1bdc){_0x11d466[_0x1ca8c6+_0x8d2f('0x85')]=_0x3e1bdc;_0x5e2baf(_0x3e1bdc);})[_0x8d2f('0xc')](function(_0x5b7706){_0x1c8439(_0x5b7706);});});}return _0x8d9e0d[_0x8d2f('0x86')](_0x8d2f('0x87'),attributes,{'tableName':_0x8d2f('0x88'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0xba375){var _0x586e65={'raw':_0xba375[_0x8d2f('0x89')][_0x8d2f('0x8a')],'where':{}};var _0x58f332={};var _0x507e1c={'count':0x0,'rows':[]};var _0x632c45=_0xba375['query'][_0x8d2f('0x8b')];var _0x3c3cc3=_0xba375[_0x8d2f('0x89')][_0x8d2f('0x8c')]||![];var _0x3fc15a=_0x357005(_0x632c45,_0x3c3cc3);if(!_0x3fc15a[_0x8d2f('0x16')])throw new Error(_0x8d2f('0x8d')+_0x632c45+'\x27');var _0x461034=[{'name':_0x632c45}];if(!_[_0x8d2f('0x8e')](_0x3fc15a[_0x8d2f('0x1a')]))_0x461034=_0x3fc15a[_0x8d2f('0x1a')];var _0x437f08=[];for(var _0x4e8ff0=0x0;_0x4e8ff0<_0x461034[_0x8d2f('0x8f')];_0x4e8ff0++){_0x437f08[_0x8d2f('0x90')](_0x2da760['UserProfileSection'][_0x8d2f('0x91')]({'where':{'userProfileId':_0xba375[_0x8d2f('0x92')]['id'],'name':_0x461034[_0x4e8ff0]['name']},'raw':!![]}));}return Promise[_0x8d2f('0x93')](_0x437f08)[_0x8d2f('0x9')](function(_0x532e96){var _0x3ba5a8=_[_0x8d2f('0x5')](_0x532e96,function(_0x21b3f4){return _0x21b3f4?_0x21b3f4:undefined;});var _0x4455ef=_[_0x8d2f('0x5')](_0x461034,[_0x8d2f('0x94'),!![]]);var _0x18cc3f=_[_0x8d2f('0x8e')](_0x3ba5a8)&&_[_0x8d2f('0x8e')](_0x4455ef)?null:_[_0x8d2f('0x95')](_0x4455ef,_0x3ba5a8);if(!_0x18cc3f)return null;var _0x505569=[];for(var _0x1220e6=0x0;_0x1220e6<_0x18cc3f['length'];_0x1220e6++){var _0x559b9d=_['find'](_0x461034,function(_0x2d3cf3){return _0x18cc3f[_0x1220e6]?_0x2d3cf3[_0x8d2f('0xe')]===_0x18cc3f[_0x1220e6][_0x8d2f('0xe')]:null;});if(_0x559b9d){if(_0x18cc3f[_0x1220e6][_0x8d2f('0x94')]){_0x505569[_0x8d2f('0x90')](_0x38010f(_0x3fc15a['childModel'],_0x18cc3f[_0x1220e6]));}else{if(!_0x18cc3f[_0x1220e6][_0x8d2f('0x96')]){_0x505569[_0x8d2f('0x90')](_0x411a96(_0x559b9d,_0x18cc3f[_0x1220e6],_0x3fc15a[_0x8d2f('0x16')]));}else{if(_0x559b9d['model']){_0x505569[_0x8d2f('0x90')](_0x3ce139(_0x559b9d,_0x18cc3f[_0x1220e6]));}}}}}return Promise['all'](_0x505569);})['then'](function(_0x2506d9){var _0x5761ce=_0x2506d9;var _0xa68d22=null;if(_0x5761ce){_0xa68d22=_0x5761ce[_0x8d2f('0x8f')]===0x1?_0x5761ce[0x0]:null;}if(!_0xa68d22&&!_0x5761ce)return _0x507e1c;var _0x400784=_0x2da760[_0x3fc15a['childModel']]['rawAttributes'];_0x58f332['model']=_[_0x8d2f('0x97')](_0x400784);_0x58f332[_0x8d2f('0x89')]=_[_0x8d2f('0x97')](_0xba375[_0x8d2f('0x89')]);_0x58f332[_0x8d2f('0x98')]=_['intersection'](_0x58f332[_0x8d2f('0xd')],_0x58f332['query']);_0x586e65[_0x8d2f('0x99')]=_['intersection'](_0x58f332[_0x8d2f('0xd')],qs['fields'](_0xba375[_0x8d2f('0x89')][_0x8d2f('0x9a')]));_0x586e65[_0x8d2f('0x99')]=_0x586e65[_0x8d2f('0x99')][_0x8d2f('0x8f')]?_0x586e65['attributes']:_0x58f332[_0x8d2f('0xd')];if(!_0xba375[_0x8d2f('0x89')]['hasOwnProperty'](_0x8d2f('0x9b'))){_0x586e65[_0x8d2f('0x9c')]=qs[_0x8d2f('0x9c')](_0xba375[_0x8d2f('0x89')][_0x8d2f('0x9c')]);_0x586e65['offset']=qs[_0x8d2f('0x9d')](_0xba375[_0x8d2f('0x89')][_0x8d2f('0x9d')]);}_0x586e65[_0x8d2f('0x9e')]=qs[_0x8d2f('0x9f')](_0xba375['query']['sort']);_0x586e65['where']=qs[_0x8d2f('0x98')](_[_0x8d2f('0xa0')](_0xba375['query'],_0x58f332[_0x8d2f('0x98')]));if(_0xba375[_0x8d2f('0x89')][_0x8d2f('0x5')]){_0x586e65['where']=_['merge'](_0x586e65['where'],{'$or':_[_0x8d2f('0xb')](_0x400784,function(_0x4f8d1e){if(_0x4f8d1e[_0x8d2f('0x13')][_0x8d2f('0xa1')]!==_0x8d2f('0xa2')){var _0x1e4091={};_0x1e4091[_0x4f8d1e['field']]={'$like':'%'+_0xba375[_0x8d2f('0x89')]['filter']+'%'};return _0x1e4091;}})});}var _0x3fae72=[];var _0x2c9a9e=null;var _0x4160e3={};if(_0xa68d22){_0x2c9a9e=_[_0x8d2f('0x91')](_0x461034,[_0x8d2f('0xe'),_0xa68d22['name']]);if(_0x2c9a9e[_0x8d2f('0x6')]){_0x4160e3={};if(_0x3fc15a[_0x8d2f('0x16')]===_0x8d2f('0x11')){_0x4160e3[_0x2c9a9e[_0x8d2f('0xa3')]]=_['map'](_0xa68d22['associatedResources'],'id');}else{_0x4160e3[_0x2c9a9e['foreignKey']]=_0xa68d22['associatedResources'];}_0x3fae72[_0x8d2f('0x90')](_0x4160e3);}else{_0x586e65[_0x8d2f('0x82')]['id']=_0xa68d22['associatedResources'];}}else{for(var _0x4b2d01=0x0;_0x4b2d01<_0x5761ce['length'];_0x4b2d01++){_0x2c9a9e=_[_0x8d2f('0x91')](_0x461034,[_0x8d2f('0xe'),_0x5761ce[_0x4b2d01][_0x8d2f('0xe')]]);if(_0x2c9a9e[_0x8d2f('0x6')]){_0x4160e3={};_0x4160e3[_0x2c9a9e[_0x8d2f('0xa3')]]=_0x5761ce[_0x4b2d01][_0x8d2f('0xa')];_0x3fae72[_0x8d2f('0x90')](_0x4160e3);}else{if(!_0x586e65[_0x8d2f('0x82')]['id'])_0x586e65[_0x8d2f('0x82')]['id']=[];_0x5761ce[_0x4b2d01][_0x8d2f('0xa')]['forEach'](function(_0x4ef956){_0x586e65[_0x8d2f('0x82')]['id'][_0x8d2f('0x90')](_0x4ef956);});}}}if(!_[_0x8d2f('0x8e')](_0x3fae72)){_0x586e65[_0x8d2f('0x82')]=_['merge'](_0x586e65[_0x8d2f('0x82')],{'$and':{'$or':_0x3fae72}});}_0x586e65=_[_0x8d2f('0xa4')]({},_0x586e65,_0xba375[_0x8d2f('0xa5')]);if(_0xa68d22&&!_0xa68d22[_0x8d2f('0x96')]&&_0x3fc15a['childModel']===_0x8d2f('0x11')){if(_0xba375[_0x8d2f('0x89')]['includeAll']){_0x586e65[_0x8d2f('0xa6')]=[{'all':!![]}];}return _0x2da760[_0x3fc15a[_0x8d2f('0x16')]]['findAll'](_0x586e65)['then'](function(_0x2f210c){var _0x1c0729=[];_0x2f210c[_0x8d2f('0xa7')](function(_0x57b248){var _0x5d11b6;switch(_0x57b248[_0x8d2f('0xa8')]){case'default':_0x5d11b6=_[_0x8d2f('0x91')](_0xa68d22['associatedResources'],function(_0x36626f){return _0x36626f['id']===_0x57b248[_0x8d2f('0x76')]&&_0x36626f[_0x8d2f('0x13')]==='DefaultReports';});break;case _0x8d2f('0xa9'):_0x5d11b6=_['find'](_0xa68d22['associatedResources'],function(_0x56e215){return _0x56e215['id']===_0x57b248[_0x8d2f('0x76')]&&_0x56e215[_0x8d2f('0x13')]===_0x8d2f('0xaa');});break;}if(_0x5d11b6)_0x1c0729[_0x8d2f('0x90')](_0x57b248);});_0x507e1c['count']=_0x1c0729['length'];_0x507e1c[_0x8d2f('0xab')]=_0x1c0729;return _0x507e1c;});}else{if(!_[_0x8d2f('0x8e')](_0xba375['query'][_0x8d2f('0xac')])){_0x586e65[_0x8d2f('0x82')]['id']=_0x586e65['where']['id']?_[_0x8d2f('0xad')](_0x586e65['where']['id'],_0xba375[_0x8d2f('0x89')][_0x8d2f('0xac')]):_0xba375[_0x8d2f('0x89')][_0x8d2f('0xac')];if(_0xba375['query'][_0x8d2f('0xae')]){_0x586e65[_0x8d2f('0x9e')]=_0xba375[_0x8d2f('0x89')]['customSorting'];}}if(_0xba375[_0x8d2f('0x89')][_0x8d2f('0xaf')]){_0x586e65[_0x8d2f('0x82')]=_['merge'](_0x586e65[_0x8d2f('0x82')],{'$and':_0xba375[_0x8d2f('0x89')][_0x8d2f('0xaf')]});}return _0x2da760[_0x3fc15a['childModel']][_0x8d2f('0xb0')]({'where':_0x586e65[_0x8d2f('0x82')]})['then'](function(_0x3775a0){_0x507e1c[_0x8d2f('0xb0')]=_0x3775a0;if(_0xba375[_0x8d2f('0x89')][_0x8d2f('0xb1')]){if(_0x3fc15a[_0x8d2f('0x16')]===_0x8d2f('0x1d')){_0x586e65[_0x8d2f('0xa6')]=[{'model':_0x2da760[_0x8d2f('0x6a')],'as':'Tags','attributes':['id',_0x8d2f('0xe'),_0x8d2f('0xb2')],'required':_0xba375[_0x8d2f('0x89')][_0x8d2f('0xb3')]?!![]:![]},{'model':_0x2da760[_0x8d2f('0x6a')],'as':'ThroughTags','attributes':['id',_0x8d2f('0xe'),_0x8d2f('0xb2')],'through':_0xba375['query']['tag']?{'attributes':[],'where':{'TagId':_0xba375['query'][_0x8d2f('0xb3')]||undefined}}:{},'required':_0xba375['query'][_0x8d2f('0xb3')]?!![]:![]}];}else{_0x586e65[_0x8d2f('0xa6')]=[{'all':!![]}];}}return _0x2da760[_0x3fc15a[_0x8d2f('0x16')]][_0x8d2f('0x8')](_0x586e65);})[_0x8d2f('0x9')](function(_0x3899d5){_0x507e1c[_0x8d2f('0xab')]=_0x3899d5;if(_0x632c45===_0x8d2f('0x2f')&&_0xba375[_0x8d2f('0x89')]['openTabs']===_0x8d2f('0xb4')){var _0x59041f=[];for(var _0x813699=0x0;_0x813699<_0x507e1c['rows'][_0x8d2f('0x8f')];_0x813699++){_0x59041f[_0x8d2f('0x90')](_0x2a5fc5(_0x8d2f('0xb5'),_0x507e1c[_0x8d2f('0xab')][_0x813699][_0x8d2f('0xb6')]));_0x59041f[_0x8d2f('0x90')](_0x2a5fc5(_0x8d2f('0xb7'),_0x507e1c[_0x8d2f('0xab')][_0x813699][_0x8d2f('0xb6')]));_0x59041f[_0x8d2f('0x90')](_0x2a5fc5(_0x8d2f('0xb8'),_0x507e1c['rows'][_0x813699][_0x8d2f('0xb6')]));_0x59041f['push'](_0x2a5fc5('mail',_0x507e1c[_0x8d2f('0xab')][_0x813699][_0x8d2f('0xb6')]));_0x59041f[_0x8d2f('0x90')](_0x2a5fc5(_0x8d2f('0xb9'),_0x507e1c[_0x8d2f('0xab')][_0x813699][_0x8d2f('0xb6')]));_0x59041f[_0x8d2f('0x90')](_0x2a5fc5('whatsapp',_0x507e1c[_0x8d2f('0xab')][_0x813699][_0x8d2f('0xb6')]));}return Promise[_0x8d2f('0x93')](_0x59041f)['then'](function(){return _0x507e1c;});}return _0x507e1c;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index d145367..d611df6 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 _0x9582=['redis','defaults','register','request','then','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x2dbb97,_0x5a0143){var _0x53564b=function(_0x56e879){while(--_0x56e879){_0x2dbb97['push'](_0x2dbb97['shift']());}};_0x53564b(++_0x5a0143);}(_0x9582,0x95));var _0x2958=function(_0x2900ba,_0x40bef5){_0x2900ba=_0x2900ba-0x0;var _0x2e5347=_0x9582[_0x2900ba];return _0x2e5347;};'use strict';var _=require(_0x2958('0x0'));var util=require(_0x2958('0x1'));var moment=require(_0x2958('0x2'));var BPromise=require(_0x2958('0x3'));var rs=require(_0x2958('0x4'));var fs=require('fs');var Redis=require(_0x2958('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2958('0x6'));var logger=require(_0x2958('0x7'))(_0x2958('0x8'));var config=require(_0x2958('0x9'));var jayson=require(_0x2958('0xa'));var client=jayson[_0x2958('0xb')][_0x2958('0xc')]({'port':0x232a});config[_0x2958('0xd')]=_[_0x2958('0xe')](config[_0x2958('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2958('0xd')]));require('./userProfile.socket')[_0x2958('0xf')](socket);function respondWithRpcPromise(_0x51e460,_0x44cccc,_0x5ef23c){return new BPromise(function(_0x3aacfa,_0x29776c){return client[_0x2958('0x10')](_0x51e460,_0x5ef23c)[_0x2958('0x11')](function(_0x11ec8d){logger['info'](_0x2958('0x12'),_0x44cccc,_0x2958('0x13'));logger[_0x2958('0x14')](_0x2958('0x15'),_0x44cccc,_0x2958('0x13'),JSON[_0x2958('0x16')](_0x11ec8d));if(_0x11ec8d[_0x2958('0x17')]){if(_0x11ec8d[_0x2958('0x17')]['code']===0x1f4){logger[_0x2958('0x17')](_0x2958('0x12'),_0x44cccc,_0x11ec8d['error']['message']);return _0x29776c(_0x11ec8d[_0x2958('0x17')][_0x2958('0x18')]);}logger['error'](_0x2958('0x12'),_0x44cccc,_0x11ec8d['error']['message']);return _0x3aacfa(_0x11ec8d[_0x2958('0x17')][_0x2958('0x18')]);}else{logger['info']('UserProfile,\x20%s,\x20%s',_0x44cccc,_0x2958('0x13'));_0x3aacfa(_0x11ec8d[_0x2958('0x19')][_0x2958('0x18')]);}})[_0x2958('0x1a')](function(_0x27599c){logger['error'](_0x2958('0x12'),_0x44cccc,_0x27599c);_0x29776c(_0x27599c);});});} \ No newline at end of file +var _0x16ce=['redis','defaults','localhost','socket.io-emitter','register','request','then','info','UserProfile,\x20%s,\x20%s','debug','UserProfile,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','client','http'];(function(_0x185452,_0x5bd71a){var _0x4eeb8e=function(_0x49942f){while(--_0x49942f){_0x185452['push'](_0x185452['shift']());}};_0x4eeb8e(++_0x5bd71a);}(_0x16ce,0xfb));var _0xe16c=function(_0x1b32a2,_0x51a13e){_0x1b32a2=_0x1b32a2-0x0;var _0x36997a=_0x16ce[_0x1b32a2];return _0x36997a;};'use strict';var _=require('lodash');var util=require(_0xe16c('0x0'));var moment=require(_0xe16c('0x1'));var BPromise=require(_0xe16c('0x2'));var rs=require(_0xe16c('0x3'));var fs=require('fs');var Redis=require(_0xe16c('0x4'));var db=require(_0xe16c('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xe16c('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xe16c('0x7')][_0xe16c('0x8')]({'port':0x232a});config[_0xe16c('0x9')]=_[_0xe16c('0xa')](config[_0xe16c('0x9')],{'host':_0xe16c('0xb'),'port':0x18eb});var socket=require(_0xe16c('0xc'))(new Redis(config[_0xe16c('0x9')]));require('./userProfile.socket')[_0xe16c('0xd')](socket);function respondWithRpcPromise(_0x1dfa84,_0x3cc96b,_0x2e59ad){return new BPromise(function(_0x1b7da7,_0x280e21){return client[_0xe16c('0xe')](_0x1dfa84,_0x2e59ad)[_0xe16c('0xf')](function(_0x1b460c){logger[_0xe16c('0x10')](_0xe16c('0x11'),_0x3cc96b,'request\x20sent');logger[_0xe16c('0x12')](_0xe16c('0x13'),_0x3cc96b,_0xe16c('0x14'),JSON[_0xe16c('0x15')](_0x1b460c));if(_0x1b460c['error']){if(_0x1b460c['error'][_0xe16c('0x16')]===0x1f4){logger[_0xe16c('0x17')](_0xe16c('0x11'),_0x3cc96b,_0x1b460c[_0xe16c('0x17')]['message']);return _0x280e21(_0x1b460c[_0xe16c('0x17')]['message']);}logger[_0xe16c('0x17')](_0xe16c('0x11'),_0x3cc96b,_0x1b460c[_0xe16c('0x17')]['message']);return _0x1b7da7(_0x1b460c[_0xe16c('0x17')][_0xe16c('0x18')]);}else{logger[_0xe16c('0x10')](_0xe16c('0x11'),_0x3cc96b,_0xe16c('0x14'));_0x1b7da7(_0x1b460c['result'][_0xe16c('0x18')]);}})[_0xe16c('0x19')](function(_0x22fe04){logger['error']('UserProfile,\x20%s,\x20%s',_0x3cc96b,_0x22fe04);_0x280e21(_0x22fe04);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 87d16dc..2dd0dca 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 _0x9ad4=['save','remove','emit','removeListener','register','length','userProfile:'];(function(_0x24e721,_0x518869){var _0x2e476a=function(_0x4be963){while(--_0x4be963){_0x24e721['push'](_0x24e721['shift']());}};_0x2e476a(++_0x518869);}(_0x9ad4,0x150));var _0x49ad=function(_0x4a4a43,_0x115ccf){_0x4a4a43=_0x4a4a43-0x0;var _0x5893a6=_0x9ad4[_0x4a4a43];return _0x5893a6;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0x49ad('0x0'),_0x49ad('0x1'),'update'];function createListener(_0x18c4b4,_0x2e1ef8){return function(_0x544a16){_0x2e1ef8[_0x49ad('0x2')](_0x18c4b4,_0x544a16);};}function removeListener(_0x3e365c,_0x1fafd9){return function(){UserProfileEvents[_0x49ad('0x3')](_0x3e365c,_0x1fafd9);};}exports[_0x49ad('0x4')]=function(_0x471a9c){for(var _0x306f47=0x0,_0x5dd6a7=events[_0x49ad('0x5')];_0x306f47<_0x5dd6a7;_0x306f47++){var _0xdb866a=events[_0x306f47];var _0x75d7e6=createListener(_0x49ad('0x6')+_0xdb866a,_0x471a9c);UserProfileEvents['on'](_0xdb866a,_0x75d7e6);}}; \ No newline at end of file +var _0xac29=['emit','register','length','userProfile:','save','update'];(function(_0x485933,_0x1e4f14){var _0x52446b=function(_0x5f2aa1){while(--_0x5f2aa1){_0x485933['push'](_0x485933['shift']());}};_0x52446b(++_0x1e4f14);}(_0xac29,0x148));var _0x9ac2=function(_0x41c361,_0xd484dd){_0x41c361=_0x41c361-0x0;var _0x1e3ac3=_0xac29[_0x41c361];return _0x1e3ac3;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0x9ac2('0x0'),'remove',_0x9ac2('0x1')];function createListener(_0x453dc9,_0x563bc7){return function(_0x516ebf){_0x563bc7[_0x9ac2('0x2')](_0x453dc9,_0x516ebf);};}function removeListener(_0x537016,_0x2a004e){return function(){UserProfileEvents['removeListener'](_0x537016,_0x2a004e);};}exports[_0x9ac2('0x3')]=function(_0x21b3cf){for(var _0x3f18aa=0x0,_0x36dc4b=events[_0x9ac2('0x4')];_0x3f18aa<_0x36dc4b;_0x3f18aa++){var _0xe6b599=events[_0x3f18aa];var _0x380467=createListener(_0x9ac2('0x5')+_0xe6b599,_0x21b3cf);UserProfileEvents['on'](_0xe6b599,_0x380467);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index ef95859..bd5d409 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 _0x4181=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','isAuthenticated','index','get','/describe','describe','show','create','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0xc4090c,_0x48e336){var _0x458be2=function(_0x559cd4){while(--_0x559cd4){_0xc4090c['push'](_0xc4090c['shift']());}};_0x458be2(++_0x48e336);}(_0x4181,0x12f));var _0x1418=function(_0x249800,_0x3e4ce2){_0x249800=_0x249800-0x0;var _0x45b7c1=_0x4181[_0x249800];return _0x45b7c1;};'use strict';var multer=require(_0x1418('0x0'));var util=require(_0x1418('0x1'));var path=require(_0x1418('0x2'));var timeout=require(_0x1418('0x3'));var express=require(_0x1418('0x4'));var router=express[_0x1418('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x1418('0x6'));var interaction=require(_0x1418('0x7'));var config=require(_0x1418('0x8'));var controller=require(_0x1418('0x9'));router['get']('/',auth[_0x1418('0xa')](),controller[_0x1418('0xb')]);router[_0x1418('0xc')](_0x1418('0xd'),auth['isAuthenticated'](),controller[_0x1418('0xe')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x1418('0xf')]);router['post']('/',auth[_0x1418('0xa')](),controller[_0x1418('0x10')]);router['put'](_0x1418('0x11'),auth[_0x1418('0xa')](),controller[_0x1418('0x12')]);router[_0x1418('0x13')](_0x1418('0x11'),auth[_0x1418('0xa')](),controller[_0x1418('0x14')]);module[_0x1418('0x15')]=router; \ No newline at end of file +var _0x52f2=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','isAuthenticated','index','get','/describe','/:id','show','post','create','put','update','delete','destroy','multer','util'];(function(_0xdd481c,_0x2d98cd){var _0x1bd8db=function(_0x40bf8c){while(--_0x40bf8c){_0xdd481c['push'](_0xdd481c['shift']());}};_0x1bd8db(++_0x2d98cd);}(_0x52f2,0x11c));var _0x252f=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0x52f2[_0x2cfb58];return _0xd99951;};'use strict';var multer=require(_0x252f('0x0'));var util=require(_0x252f('0x1'));var path=require(_0x252f('0x2'));var timeout=require(_0x252f('0x3'));var express=require(_0x252f('0x4'));var router=express[_0x252f('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x252f('0x6'));var interaction=require(_0x252f('0x7'));var config=require(_0x252f('0x8'));var controller=require(_0x252f('0x9'));router['get']('/',auth[_0x252f('0xa')](),controller[_0x252f('0xb')]);router[_0x252f('0xc')](_0x252f('0xd'),auth[_0x252f('0xa')](),controller['describe']);router['get'](_0x252f('0xe'),auth['isAuthenticated'](),controller[_0x252f('0xf')]);router[_0x252f('0x10')]('/',auth[_0x252f('0xa')](),controller[_0x252f('0x11')]);router[_0x252f('0x12')](_0x252f('0xe'),auth[_0x252f('0xa')](),controller[_0x252f('0x13')]);router[_0x252f('0x14')](_0x252f('0xe'),auth['isAuthenticated'](),controller[_0x252f('0x15')]);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 c4ae406..7956c7b 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 _0x7658=['sequelize','STRING'];(function(_0x4cabcb,_0x520a0e){var _0x47494f=function(_0x24b115){while(--_0x24b115){_0x4cabcb['push'](_0x4cabcb['shift']());}};_0x47494f(++_0x520a0e);}(_0x7658,0x150));var _0x8765=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7658[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x8765('0x0'));module['exports']={'name':{'type':Sequelize[_0x8765('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x3a2c=['exports','STRING','sequelize'];(function(_0x365143,_0x46fd86){var _0x45bb49=function(_0x20bb4b){while(--_0x20bb4b){_0x365143['push'](_0x365143['shift']());}};_0x45bb49(++_0x46fd86);}(_0x3a2c,0x1bb));var _0xc3a2=function(_0x3195a5,_0x102f2a){_0x3195a5=_0x3195a5-0x0;var _0x5181a4=_0x3a2c[_0x3195a5];return _0x5181a4;};'use strict';var Sequelize=require(_0xc3a2('0x0'));module[_0xc3a2('0x1')]={'name':{'type':Sequelize[_0xc3a2('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize[_0xc3a2('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 34b194f..4e2a5fb 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 _0x7880=['destroy','error','stack','name','send','index','UserProfileResource','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','show','params','keys','options','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','limit','set','json','apply','reject','save','update','then'];(function(_0x27d020,_0x3e50af){var _0x14a24b=function(_0x2cf88b){while(--_0x2cf88b){_0x27d020['push'](_0x27d020['shift']());}};_0x14a24b(++_0x3e50af);}(_0x7880,0x1f4));var _0x0788=function(_0x10d670,_0x178996){_0x10d670=_0x10d670-0x0;var _0x20d6f8=_0x7880[_0x10d670];return _0x20d6f8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0788('0x0'));var zipdir=require(_0x0788('0x1'));var jsonpatch=require(_0x0788('0x2'));var rp=require(_0x0788('0x3'));var moment=require(_0x0788('0x4'));var BPromise=require(_0x0788('0x5'));var Mustache=require('mustache');var util=require(_0x0788('0x6'));var path=require(_0x0788('0x7'));var sox=require(_0x0788('0x8'));var csv=require(_0x0788('0x9'));var ejs=require(_0x0788('0xa'));var fs=require('fs');var fs_extra=require(_0x0788('0xb'));var _=require(_0x0788('0xc'));var squel=require(_0x0788('0xd'));var crypto=require(_0x0788('0xe'));var jsforce=require(_0x0788('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x0788('0x9'));var querystring=require('querystring');var Papa=require(_0x0788('0x10'));var Redis=require('ioredis');var authService=require(_0x0788('0x11'));var qs=require(_0x0788('0x12'));var as=require(_0x0788('0x13'));var hardwareService=require(_0x0788('0x14'));var logger=require(_0x0788('0x15'))('api');var utils=require(_0x0788('0x16'));var config=require(_0x0788('0x17'));var licenseUtil=require(_0x0788('0x18'));var db=require(_0x0788('0x19'))['db'];function respondWithStatusCode(_0x311729,_0xce4342){_0xce4342=_0xce4342||0xcc;return function(_0x261ebc){if(_0x261ebc){return _0x311729['sendStatus'](_0xce4342);}return _0x311729[_0x0788('0x1a')](_0xce4342)[_0x0788('0x1b')]();};}function respondWithResult(_0x3bdcdf,_0x13cf07){_0x13cf07=_0x13cf07||0xc8;return function(_0x51e5d3){if(_0x51e5d3){return _0x3bdcdf[_0x0788('0x1a')](_0x13cf07)['json'](_0x51e5d3);}};}function respondWithFilteredResult(_0x195f14,_0x170d56){return function(_0x3fd1e4){if(_0x3fd1e4){var _0xb406fb=typeof _0x170d56[_0x0788('0x1c')]===_0x0788('0x1d')&&typeof _0x170d56['limit']==='undefined';var _0x17d805=_0x3fd1e4[_0x0788('0x1e')];var _0x5b2bdc=_0xb406fb?0x0:_0x170d56[_0x0788('0x1c')];var _0x415f19=_0xb406fb?_0x3fd1e4[_0x0788('0x1e')]:_0x170d56['offset']+_0x170d56[_0x0788('0x1f')];var _0x3fb723;if(_0x415f19>=_0x17d805){_0x415f19=_0x17d805;_0x3fb723=0xc8;}else{_0x3fb723=0xce;}_0x195f14['status'](_0x3fb723);return _0x195f14[_0x0788('0x20')]('Content-Range',_0x5b2bdc+'-'+_0x415f19+'/'+_0x17d805)[_0x0788('0x21')](_0x3fd1e4);}return null;};}function patchUpdates(_0x48bc5f){return function(_0x17cca3){try{jsonpatch[_0x0788('0x22')](_0x17cca3,_0x48bc5f,!![]);}catch(_0x18ff22){return BPromise[_0x0788('0x23')](_0x18ff22);}return _0x17cca3[_0x0788('0x24')]();};}function saveUpdates(_0x4f0005,_0x48ec43){return function(_0x2270d4){if(_0x2270d4){return _0x2270d4[_0x0788('0x25')](_0x4f0005)[_0x0788('0x26')](function(_0x7a99a1){return _0x7a99a1;});}return null;};}function removeEntity(_0x5ba1da,_0x4d5c93){return function(_0x79204e){if(_0x79204e){return _0x79204e[_0x0788('0x27')]()[_0x0788('0x26')](function(){_0x5ba1da['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x240459,_0xa1f7dc){return function(_0x5f2dda){if(!_0x5f2dda){_0x240459['sendStatus'](0x194);}return _0x5f2dda;};}function handleError(_0x5a54a5,_0x44798c){_0x44798c=_0x44798c||0x1f4;return function(_0x57fda1){logger[_0x0788('0x28')](_0x57fda1[_0x0788('0x29')]);if(_0x57fda1[_0x0788('0x2a')]){delete _0x57fda1[_0x0788('0x2a')];}_0x5a54a5[_0x0788('0x1a')](_0x44798c)[_0x0788('0x2b')](_0x57fda1);};}exports[_0x0788('0x2c')]=function(_0x3ffe4f,_0x5b7594){var _0x5a5178={},_0x3c5246={},_0x40d345={'count':0x0,'rows':[]};var _0x54979a=_['map'](db[_0x0788('0x2d')][_0x0788('0x2e')],function(_0x20fcd8){return{'name':_0x20fcd8[_0x0788('0x2f')],'type':_0x20fcd8[_0x0788('0x30')][_0x0788('0x31')]};});_0x3c5246[_0x0788('0x32')]=_[_0x0788('0x33')](_0x54979a,_0x0788('0x2a'));_0x3c5246[_0x0788('0x34')]=_['keys'](_0x3ffe4f[_0x0788('0x34')]);_0x3c5246[_0x0788('0x35')]=_[_0x0788('0x36')](_0x3c5246[_0x0788('0x32')],_0x3c5246[_0x0788('0x34')]);_0x5a5178[_0x0788('0x37')]=_[_0x0788('0x36')](_0x3c5246[_0x0788('0x32')],qs[_0x0788('0x38')](_0x3ffe4f[_0x0788('0x34')]['fields']));_0x5a5178['attributes']=_0x5a5178['attributes']['length']?_0x5a5178['attributes']:_0x3c5246['model'];if(!_0x3ffe4f[_0x0788('0x34')][_0x0788('0x39')](_0x0788('0x3a'))){_0x5a5178['limit']=qs[_0x0788('0x1f')](_0x3ffe4f[_0x0788('0x34')][_0x0788('0x1f')]);_0x5a5178[_0x0788('0x1c')]=qs['offset'](_0x3ffe4f[_0x0788('0x34')]['offset']);}_0x5a5178[_0x0788('0x3b')]=qs['sort'](_0x3ffe4f[_0x0788('0x34')][_0x0788('0x3c')]);_0x5a5178['where']=qs[_0x0788('0x35')](_[_0x0788('0x3d')](_0x3ffe4f['query'],_0x3c5246[_0x0788('0x35')]),_0x54979a);if(_0x3ffe4f['query'][_0x0788('0x3e')]){_0x5a5178['where']=_[_0x0788('0x3f')](_0x5a5178['where'],{'$or':_[_0x0788('0x33')](_0x54979a,function(_0x57fec9){if(_0x57fec9['type']!==_0x0788('0x40')){var _0x68d9d4={};_0x68d9d4[_0x57fec9[_0x0788('0x2a')]]={'$like':'%'+_0x3ffe4f[_0x0788('0x34')][_0x0788('0x3e')]+'%'};return _0x68d9d4;}})});}_0x5a5178=_['merge']({},_0x5a5178,_0x3ffe4f['options']);var _0x530d83={'where':_0x5a5178['where']};return db[_0x0788('0x2d')][_0x0788('0x1e')](_0x530d83)[_0x0788('0x26')](function(_0x358a22){_0x40d345[_0x0788('0x1e')]=_0x358a22;if(_0x3ffe4f['query']['includeAll']){_0x5a5178[_0x0788('0x41')]=[{'all':!![]}];}return db[_0x0788('0x2d')][_0x0788('0x42')](_0x5a5178);})[_0x0788('0x26')](function(_0x236b63){_0x40d345[_0x0788('0x43')]=_0x236b63;return _0x40d345;})[_0x0788('0x26')](respondWithFilteredResult(_0x5b7594,_0x5a5178))[_0x0788('0x44')](handleError(_0x5b7594,null));};exports[_0x0788('0x45')]=function(_0x50e8f5,_0x5581e6){var _0x441aec={'raw':![],'where':{'id':_0x50e8f5[_0x0788('0x46')]['id']}},_0x1d579d={};_0x1d579d['model']=_['keys'](db['UserProfileResource'][_0x0788('0x2e')]);_0x1d579d[_0x0788('0x34')]=_[_0x0788('0x47')](_0x50e8f5[_0x0788('0x34')]);_0x1d579d[_0x0788('0x35')]=_[_0x0788('0x36')](_0x1d579d[_0x0788('0x32')],_0x1d579d[_0x0788('0x34')]);_0x441aec['attributes']=_[_0x0788('0x36')](_0x1d579d[_0x0788('0x32')],qs[_0x0788('0x38')](_0x50e8f5[_0x0788('0x34')]['fields']));_0x441aec[_0x0788('0x37')]=_0x441aec[_0x0788('0x37')]['length']?_0x441aec['attributes']:_0x1d579d['model'];if(_0x50e8f5[_0x0788('0x34')]['includeAll']){_0x441aec[_0x0788('0x41')]=[{'all':!![]}];}_0x441aec=_[_0x0788('0x3f')]({},_0x441aec,_0x50e8f5[_0x0788('0x48')]);return db[_0x0788('0x2d')][_0x0788('0x49')](_0x441aec)[_0x0788('0x26')](handleEntityNotFound(_0x5581e6,null))[_0x0788('0x26')](respondWithResult(_0x5581e6,null))[_0x0788('0x44')](handleError(_0x5581e6,null));};exports['create']=function(_0x4c6366,_0x39c3cc){return db[_0x0788('0x2d')][_0x0788('0x4a')](_0x4c6366['body'],{})[_0x0788('0x26')](respondWithResult(_0x39c3cc,0xc9))[_0x0788('0x44')](handleError(_0x39c3cc,null));};exports[_0x0788('0x25')]=function(_0x4563cd,_0x2395ad){if(_0x4563cd['body']['id']){delete _0x4563cd['body']['id'];}return db[_0x0788('0x2d')][_0x0788('0x49')]({'where':{'id':_0x4563cd['params']['id']}})[_0x0788('0x26')](handleEntityNotFound(_0x2395ad,null))['then'](saveUpdates(_0x4563cd[_0x0788('0x4b')],null))[_0x0788('0x26')](respondWithResult(_0x2395ad,null))[_0x0788('0x44')](handleError(_0x2395ad,null));};exports[_0x0788('0x27')]=function(_0x3c757a,_0x379928){return db[_0x0788('0x2d')][_0x0788('0x49')]({'where':{'id':_0x3c757a['params']['id']}})[_0x0788('0x26')](handleEntityNotFound(_0x379928,null))[_0x0788('0x26')](removeEntity(_0x379928,null))[_0x0788('0x44')](handleError(_0x379928,null));};exports['describe']=function(_0x1693d0,_0x5d32ae){return db['UserProfileResource'][_0x0788('0x4c')]()[_0x0788('0x26')](respondWithResult(_0x5d32ae,null))[_0x0788('0x44')](handleError(_0x5d32ae,null));}; \ No newline at end of file +var _0x47c5=['query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','map','VIRTUAL','filter','merge','count','includeAll','include','findAll','show','params','options','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','UserProfileResource','rawAttributes','fieldName','type','key','model'];(function(_0x1efacb,_0x6fa8a2){var _0x4c4e49=function(_0x3bbf5b){while(--_0x3bbf5b){_0x1efacb['push'](_0x1efacb['shift']());}};_0x4c4e49(++_0x6fa8a2);}(_0x47c5,0x165));var _0x547c=function(_0x35a220,_0x2ac12c){_0x35a220=_0x35a220-0x0;var _0x1dc1b3=_0x47c5[_0x35a220];return _0x1dc1b3;};'use strict';var emlformat=require(_0x547c('0x0'));var rimraf=require(_0x547c('0x1'));var zipdir=require(_0x547c('0x2'));var jsonpatch=require(_0x547c('0x3'));var rp=require(_0x547c('0x4'));var moment=require(_0x547c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x547c('0x6'));var util=require(_0x547c('0x7'));var path=require('path');var sox=require(_0x547c('0x8'));var csv=require(_0x547c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x547c('0xa'));var _=require(_0x547c('0xb'));var squel=require(_0x547c('0xc'));var crypto=require(_0x547c('0xd'));var jsforce=require(_0x547c('0xe'));var deskjs=require(_0x547c('0xf'));var toCsv=require(_0x547c('0x9'));var querystring=require(_0x547c('0x10'));var Papa=require(_0x547c('0x11'));var Redis=require(_0x547c('0x12'));var authService=require(_0x547c('0x13'));var qs=require(_0x547c('0x14'));var as=require(_0x547c('0x15'));var hardwareService=require(_0x547c('0x16'));var logger=require(_0x547c('0x17'))(_0x547c('0x18'));var utils=require(_0x547c('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x547c('0x1a'));var db=require(_0x547c('0x1b'))['db'];function respondWithStatusCode(_0x5eea67,_0x436c19){_0x436c19=_0x436c19||0xcc;return function(_0x201d95){if(_0x201d95){return _0x5eea67[_0x547c('0x1c')](_0x436c19);}return _0x5eea67[_0x547c('0x1d')](_0x436c19)[_0x547c('0x1e')]();};}function respondWithResult(_0x150317,_0x2bc289){_0x2bc289=_0x2bc289||0xc8;return function(_0xa3c7b0){if(_0xa3c7b0){return _0x150317[_0x547c('0x1d')](_0x2bc289)[_0x547c('0x1f')](_0xa3c7b0);}};}function respondWithFilteredResult(_0x240243,_0x103455){return function(_0x39f316){if(_0x39f316){var _0x23644b=typeof _0x103455[_0x547c('0x20')]===_0x547c('0x21')&&typeof _0x103455[_0x547c('0x22')]===_0x547c('0x21');var _0x49acca=_0x39f316['count'];var _0x23fa9e=_0x23644b?0x0:_0x103455[_0x547c('0x20')];var _0xeb059e=_0x23644b?_0x39f316['count']:_0x103455[_0x547c('0x20')]+_0x103455[_0x547c('0x22')];var _0x1ddbd3;if(_0xeb059e>=_0x49acca){_0xeb059e=_0x49acca;_0x1ddbd3=0xc8;}else{_0x1ddbd3=0xce;}_0x240243['status'](_0x1ddbd3);return _0x240243[_0x547c('0x23')](_0x547c('0x24'),_0x23fa9e+'-'+_0xeb059e+'/'+_0x49acca)['json'](_0x39f316);}return null;};}function patchUpdates(_0x5453f9){return function(_0x35040a){try{jsonpatch[_0x547c('0x25')](_0x35040a,_0x5453f9,!![]);}catch(_0x4f20c1){return BPromise[_0x547c('0x26')](_0x4f20c1);}return _0x35040a[_0x547c('0x27')]();};}function saveUpdates(_0x592e46,_0x2e317a){return function(_0x17fd97){if(_0x17fd97){return _0x17fd97[_0x547c('0x28')](_0x592e46)['then'](function(_0x3a55a0){return _0x3a55a0;});}return null;};}function removeEntity(_0x361c5c,_0x470694){return function(_0x26823c){if(_0x26823c){return _0x26823c[_0x547c('0x29')]()[_0x547c('0x2a')](function(){_0x361c5c[_0x547c('0x1d')](0xcc)[_0x547c('0x1e')]();});}};}function handleEntityNotFound(_0x507895,_0x39c5f9){return function(_0x4c66b9){if(!_0x4c66b9){_0x507895['sendStatus'](0x194);}return _0x4c66b9;};}function handleError(_0x4855fd,_0x478f04){_0x478f04=_0x478f04||0x1f4;return function(_0x2c725d){logger['error'](_0x2c725d[_0x547c('0x2b')]);if(_0x2c725d['name']){delete _0x2c725d[_0x547c('0x2c')];}_0x4855fd['status'](_0x478f04)[_0x547c('0x2d')](_0x2c725d);};}exports[_0x547c('0x2e')]=function(_0x2389de,_0x30a96c){var _0x198afb={},_0x569924={},_0x575c74={'count':0x0,'rows':[]};var _0x28c282=_['map'](db[_0x547c('0x2f')][_0x547c('0x30')],function(_0x3e7652){return{'name':_0x3e7652[_0x547c('0x31')],'type':_0x3e7652[_0x547c('0x32')][_0x547c('0x33')]};});_0x569924[_0x547c('0x34')]=_['map'](_0x28c282,'name');_0x569924[_0x547c('0x35')]=_[_0x547c('0x36')](_0x2389de[_0x547c('0x35')]);_0x569924[_0x547c('0x37')]=_[_0x547c('0x38')](_0x569924[_0x547c('0x34')],_0x569924[_0x547c('0x35')]);_0x198afb[_0x547c('0x39')]=_[_0x547c('0x38')](_0x569924[_0x547c('0x34')],qs[_0x547c('0x3a')](_0x2389de[_0x547c('0x35')][_0x547c('0x3a')]));_0x198afb[_0x547c('0x39')]=_0x198afb['attributes'][_0x547c('0x3b')]?_0x198afb['attributes']:_0x569924['model'];if(!_0x2389de['query'][_0x547c('0x3c')](_0x547c('0x3d'))){_0x198afb[_0x547c('0x22')]=qs[_0x547c('0x22')](_0x2389de[_0x547c('0x35')][_0x547c('0x22')]);_0x198afb['offset']=qs['offset'](_0x2389de['query'][_0x547c('0x20')]);}_0x198afb[_0x547c('0x3e')]=qs[_0x547c('0x3f')](_0x2389de[_0x547c('0x35')][_0x547c('0x3f')]);_0x198afb[_0x547c('0x40')]=qs['filters'](_[_0x547c('0x41')](_0x2389de['query'],_0x569924[_0x547c('0x37')]),_0x28c282);if(_0x2389de[_0x547c('0x35')]['filter']){_0x198afb[_0x547c('0x40')]=_['merge'](_0x198afb['where'],{'$or':_[_0x547c('0x42')](_0x28c282,function(_0x281d52){if(_0x281d52[_0x547c('0x32')]!==_0x547c('0x43')){var _0x4c36b9={};_0x4c36b9[_0x281d52['name']]={'$like':'%'+_0x2389de[_0x547c('0x35')][_0x547c('0x44')]+'%'};return _0x4c36b9;}})});}_0x198afb=_[_0x547c('0x45')]({},_0x198afb,_0x2389de['options']);var _0x3886ae={'where':_0x198afb[_0x547c('0x40')]};return db[_0x547c('0x2f')]['count'](_0x3886ae)[_0x547c('0x2a')](function(_0x3a6a0a){_0x575c74[_0x547c('0x46')]=_0x3a6a0a;if(_0x2389de['query'][_0x547c('0x47')]){_0x198afb[_0x547c('0x48')]=[{'all':!![]}];}return db['UserProfileResource'][_0x547c('0x49')](_0x198afb);})[_0x547c('0x2a')](function(_0x9c3cb2){_0x575c74['rows']=_0x9c3cb2;return _0x575c74;})[_0x547c('0x2a')](respondWithFilteredResult(_0x30a96c,_0x198afb))['catch'](handleError(_0x30a96c,null));};exports[_0x547c('0x4a')]=function(_0x5393a2,_0xb86f5f){var _0x414b9d={'raw':![],'where':{'id':_0x5393a2[_0x547c('0x4b')]['id']}},_0x3d37d7={};_0x3d37d7[_0x547c('0x34')]=_[_0x547c('0x36')](db['UserProfileResource']['rawAttributes']);_0x3d37d7[_0x547c('0x35')]=_[_0x547c('0x36')](_0x5393a2[_0x547c('0x35')]);_0x3d37d7['filters']=_[_0x547c('0x38')](_0x3d37d7[_0x547c('0x34')],_0x3d37d7[_0x547c('0x35')]);_0x414b9d[_0x547c('0x39')]=_[_0x547c('0x38')](_0x3d37d7[_0x547c('0x34')],qs['fields'](_0x5393a2[_0x547c('0x35')][_0x547c('0x3a')]));_0x414b9d[_0x547c('0x39')]=_0x414b9d['attributes'][_0x547c('0x3b')]?_0x414b9d[_0x547c('0x39')]:_0x3d37d7[_0x547c('0x34')];if(_0x5393a2[_0x547c('0x35')]['includeAll']){_0x414b9d[_0x547c('0x48')]=[{'all':!![]}];}_0x414b9d=_['merge']({},_0x414b9d,_0x5393a2[_0x547c('0x4c')]);return db['UserProfileResource'][_0x547c('0x4d')](_0x414b9d)[_0x547c('0x2a')](handleEntityNotFound(_0xb86f5f,null))['then'](respondWithResult(_0xb86f5f,null))[_0x547c('0x4e')](handleError(_0xb86f5f,null));};exports[_0x547c('0x4f')]=function(_0xa005cc,_0x1ddf30){return db['UserProfileResource'][_0x547c('0x4f')](_0xa005cc['body'],{})['then'](respondWithResult(_0x1ddf30,0xc9))[_0x547c('0x4e')](handleError(_0x1ddf30,null));};exports[_0x547c('0x28')]=function(_0x3e3f52,_0x11a878){if(_0x3e3f52[_0x547c('0x50')]['id']){delete _0x3e3f52[_0x547c('0x50')]['id'];}return db[_0x547c('0x2f')][_0x547c('0x4d')]({'where':{'id':_0x3e3f52[_0x547c('0x4b')]['id']}})[_0x547c('0x2a')](handleEntityNotFound(_0x11a878,null))[_0x547c('0x2a')](saveUpdates(_0x3e3f52[_0x547c('0x50')],null))['then'](respondWithResult(_0x11a878,null))['catch'](handleError(_0x11a878,null));};exports[_0x547c('0x29')]=function(_0x21ea26,_0x48de6e){return db[_0x547c('0x2f')][_0x547c('0x4d')]({'where':{'id':_0x21ea26[_0x547c('0x4b')]['id']}})[_0x547c('0x2a')](handleEntityNotFound(_0x48de6e,null))[_0x547c('0x2a')](removeEntity(_0x48de6e,null))[_0x547c('0x4e')](handleError(_0x48de6e,null));};exports['describe']=function(_0x152982,_0x5258cf){return db[_0x547c('0x2f')][_0x547c('0x51')]()[_0x547c('0x2a')](respondWithResult(_0x5258cf,null))['catch'](handleError(_0x5258cf,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 9b5ba0c..5d61f8e 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 _0x98ab=['compositeIndex','resourceId','sectionId','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./userProfileResource.attributes','exports','define','UserProfileResource','user_profile_has_resources'];(function(_0x3fcccb,_0x246213){var _0x126a11=function(_0xa5f00a){while(--_0xa5f00a){_0x3fcccb['push'](_0x3fcccb['shift']());}};_0x126a11(++_0x246213);}(_0x98ab,0x153));var _0xb98a=function(_0x1f67c6,_0x31b8ec){_0x1f67c6=_0x1f67c6-0x0;var _0x47416e=_0x98ab[_0x1f67c6];return _0x47416e;};'use strict';var _=require(_0xb98a('0x0'));var util=require('util');var logger=require(_0xb98a('0x1'))(_0xb98a('0x2'));var moment=require(_0xb98a('0x3'));var BPromise=require('bluebird');var rp=require(_0xb98a('0x4'));var fs=require('fs');var path=require(_0xb98a('0x5'));var rimraf=require(_0xb98a('0x6'));var config=require(_0xb98a('0x7'));var attributes=require(_0xb98a('0x8'));module[_0xb98a('0x9')]=function(_0x116538,_0xce5824){return _0x116538[_0xb98a('0xa')](_0xb98a('0xb'),attributes,{'tableName':_0xb98a('0xc'),'paranoid':![],'indexes':[{'name':_0xb98a('0xd'),'fields':[_0xb98a('0xe'),_0xb98a('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x79b6=['lodash','util','moment','bluebird','request-promise','path','../../config/environment','./userProfileResource.attributes','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId','sectionId'];(function(_0x357766,_0x1ade36){var _0xe28a73=function(_0x1d8449){while(--_0x1d8449){_0x357766['push'](_0x357766['shift']());}};_0xe28a73(++_0x1ade36);}(_0x79b6,0x1ee));var _0x679b=function(_0x4ea5d3,_0x3b4a2a){_0x4ea5d3=_0x4ea5d3-0x0;var _0x1ee7de=_0x79b6[_0x4ea5d3];return _0x1ee7de;};'use strict';var _=require(_0x679b('0x0'));var util=require(_0x679b('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x679b('0x2'));var BPromise=require(_0x679b('0x3'));var rp=require(_0x679b('0x4'));var fs=require('fs');var path=require(_0x679b('0x5'));var rimraf=require('rimraf');var config=require(_0x679b('0x6'));var attributes=require(_0x679b('0x7'));module['exports']=function(_0x5d1df6,_0xe86938){return _0x5d1df6['define'](_0x679b('0x8'),attributes,{'tableName':_0x679b('0x9'),'paranoid':![],'indexes':[{'name':_0x679b('0xa'),'fields':[_0x679b('0xb'),_0x679b('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index c37e7b5..0a686db 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 _0xffb8=['stringify','error','code','message','result','lodash','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','UserProfileResource,\x20%s,\x20%s','UserProfileResource,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x5ad549,_0x5770d8){var _0x551940=function(_0x23d391){while(--_0x23d391){_0x5ad549['push'](_0x5ad549['shift']());}};_0x551940(++_0x5770d8);}(_0xffb8,0x15b));var _0x8ffb=function(_0x2538d7,_0x251043){_0x2538d7=_0x2538d7-0x0;var _0x549b93=_0xffb8[_0x2538d7];return _0x549b93;};'use strict';var _=require(_0x8ffb('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8ffb('0x1'));var fs=require('fs');var Redis=require(_0x8ffb('0x2'));var db=require(_0x8ffb('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8ffb('0x4'));var config=require(_0x8ffb('0x5'));var jayson=require(_0x8ffb('0x6'));var client=jayson[_0x8ffb('0x7')][_0x8ffb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x406688,_0x4120d2,_0x480026){return new BPromise(function(_0x2b0174,_0x244dcf){return client[_0x8ffb('0x9')](_0x406688,_0x480026)[_0x8ffb('0xa')](function(_0x197db2){logger['info'](_0x8ffb('0xb'),_0x4120d2,'request\x20sent');logger['debug'](_0x8ffb('0xc'),_0x4120d2,_0x8ffb('0xd'),JSON[_0x8ffb('0xe')](_0x197db2));if(_0x197db2[_0x8ffb('0xf')]){if(_0x197db2[_0x8ffb('0xf')][_0x8ffb('0x10')]===0x1f4){logger['error'](_0x8ffb('0xb'),_0x4120d2,_0x197db2['error']['message']);return _0x244dcf(_0x197db2[_0x8ffb('0xf')][_0x8ffb('0x11')]);}logger[_0x8ffb('0xf')](_0x8ffb('0xb'),_0x4120d2,_0x197db2[_0x8ffb('0xf')][_0x8ffb('0x11')]);return _0x2b0174(_0x197db2[_0x8ffb('0xf')][_0x8ffb('0x11')]);}else{logger['info'](_0x8ffb('0xb'),_0x4120d2,_0x8ffb('0xd'));_0x2b0174(_0x197db2[_0x8ffb('0x12')][_0x8ffb('0x11')]);}})['catch'](function(_0x21ea38){logger['error'](_0x8ffb('0xb'),_0x4120d2,_0x21ea38);_0x244dcf(_0x21ea38);});});} \ No newline at end of file +var _0xe98c=['then','UserProfileResource,\x20%s,\x20%s','request\x20sent','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','util','bluebird','../../config/utils','rpc','../../config/environment','request'];(function(_0x53ca59,_0xd35a81){var _0x2fc48e=function(_0x6a07f2){while(--_0x6a07f2){_0x53ca59['push'](_0x53ca59['shift']());}};_0x2fc48e(++_0xd35a81);}(_0xe98c,0x10a));var _0xce98=function(_0x438bba,_0x1d229f){_0x438bba=_0x438bba-0x0;var _0x1428fd=_0xe98c[_0x438bba];return _0x1428fd;};'use strict';var _=require('lodash');var util=require(_0xce98('0x0'));var moment=require('moment');var BPromise=require(_0xce98('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xce98('0x2'));var logger=require('../../config/logger')(_0xce98('0x3'));var config=require(_0xce98('0x4'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3446e3,_0x5ccb50,_0x53c790){return new BPromise(function(_0x92a2d8,_0x41e480){return client[_0xce98('0x5')](_0x3446e3,_0x53c790)[_0xce98('0x6')](function(_0x11969e){logger['info'](_0xce98('0x7'),_0x5ccb50,_0xce98('0x8'));logger['debug'](_0xce98('0x9'),_0x5ccb50,'request\x20sent',JSON[_0xce98('0xa')](_0x11969e));if(_0x11969e[_0xce98('0xb')]){if(_0x11969e[_0xce98('0xb')]['code']===0x1f4){logger[_0xce98('0xb')](_0xce98('0x7'),_0x5ccb50,_0x11969e[_0xce98('0xb')]['message']);return _0x41e480(_0x11969e[_0xce98('0xb')][_0xce98('0xc')]);}logger[_0xce98('0xb')]('UserProfileResource,\x20%s,\x20%s',_0x5ccb50,_0x11969e[_0xce98('0xb')][_0xce98('0xc')]);return _0x92a2d8(_0x11969e['error'][_0xce98('0xc')]);}else{logger[_0xce98('0xd')](_0xce98('0x7'),_0x5ccb50,_0xce98('0x8'));_0x92a2d8(_0x11969e[_0xce98('0xe')]['message']);}})[_0xce98('0xf')](function(_0x836ec7){logger[_0xce98('0xb')]('UserProfileResource,\x20%s,\x20%s',_0x5ccb50,_0x836ec7);_0x41e480(_0x836ec7);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 4ee348f..37bede4 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 _0x3b61=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','destroy','exports','util','path','connect-timeout'];(function(_0xb52981,_0x525d65){var _0x261c96=function(_0x5663db){while(--_0x5663db){_0xb52981['push'](_0xb52981['shift']());}};_0x261c96(++_0x525d65);}(_0x3b61,0x14d));var _0x13b6=function(_0x46d9cc,_0x4ec9ce){_0x46d9cc=_0x46d9cc-0x0;var _0xc70e83=_0x3b61[_0x46d9cc];return _0xc70e83;};'use strict';var multer=require('multer');var util=require(_0x13b6('0x0'));var path=require(_0x13b6('0x1'));var timeout=require(_0x13b6('0x2'));var express=require(_0x13b6('0x3'));var router=express['Router']();var fs_extra=require(_0x13b6('0x4'));var auth=require(_0x13b6('0x5'));var interaction=require(_0x13b6('0x6'));var config=require(_0x13b6('0x7'));var controller=require(_0x13b6('0x8'));router[_0x13b6('0x9')]('/',auth[_0x13b6('0xa')](),controller[_0x13b6('0xb')]);router[_0x13b6('0x9')](_0x13b6('0xc'),auth['isAuthenticated'](),controller[_0x13b6('0xd')]);router[_0x13b6('0x9')](_0x13b6('0xe'),auth[_0x13b6('0xa')](),controller[_0x13b6('0xf')]);router[_0x13b6('0x10')]('/',auth[_0x13b6('0xa')](),controller[_0x13b6('0x11')]);router[_0x13b6('0x12')](_0x13b6('0xe'),auth[_0x13b6('0xa')](),controller['update']);router['delete'](_0x13b6('0xe'),auth[_0x13b6('0xa')](),controller[_0x13b6('0x13')]);module[_0x13b6('0x14')]=router; \ No newline at end of file +var _0xcd79=['Router','fs-extra','../../components/auth/service','../../config/environment','get','index','isAuthenticated','show','create','put','/:id','update','exports','multer','util','path','connect-timeout','express'];(function(_0x59eff8,_0x49ccd3){var _0xefe13e=function(_0x28f652){while(--_0x28f652){_0x59eff8['push'](_0x59eff8['shift']());}};_0xefe13e(++_0x49ccd3);}(_0xcd79,0xe5));var _0x9cd7=function(_0x2a645f,_0x4edaf6){_0x2a645f=_0x2a645f-0x0;var _0x56d0c3=_0xcd79[_0x2a645f];return _0x56d0c3;};'use strict';var multer=require(_0x9cd7('0x0'));var util=require(_0x9cd7('0x1'));var path=require(_0x9cd7('0x2'));var timeout=require(_0x9cd7('0x3'));var express=require(_0x9cd7('0x4'));var router=express[_0x9cd7('0x5')]();var fs_extra=require(_0x9cd7('0x6'));var auth=require(_0x9cd7('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x9cd7('0x8'));var controller=require('./userProfileSection.controller');router[_0x9cd7('0x9')]('/',auth['isAuthenticated'](),controller[_0x9cd7('0xa')]);router[_0x9cd7('0x9')]('/describe',auth[_0x9cd7('0xb')](),controller['describe']);router[_0x9cd7('0x9')]('/:id',auth[_0x9cd7('0xb')](),controller[_0x9cd7('0xc')]);router['post']('/',auth[_0x9cd7('0xb')](),controller[_0x9cd7('0xd')]);router[_0x9cd7('0xe')](_0x9cd7('0xf'),auth['isAuthenticated'](),controller[_0x9cd7('0x10')]);router['delete'](_0x9cd7('0xf'),auth[_0x9cd7('0xb')](),controller['destroy']);module[_0x9cd7('0x11')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 13909d0..fa0c7a8 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 _0x757a=['BOOLEAN','setDataValue','crudPermissions','join','getDataValue','split','exports','STRING'];(function(_0x173dd9,_0x4ecf44){var _0x5a0d5a=function(_0x4d731a){while(--_0x4d731a){_0x173dd9['push'](_0x173dd9['shift']());}};_0x5a0d5a(++_0x4ecf44);}(_0x757a,0xde));var _0xa757=function(_0x20951c,_0x4b86ba){_0x20951c=_0x20951c-0x0;var _0x421776=_0x757a[_0x20951c];return _0x421776;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'name':{'type':Sequelize[_0xa757('0x1')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xa757('0x2')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xa757('0x1')],'set':function(_0x1c2932){this[_0xa757('0x3')](_0xa757('0x4'),_0x1c2932?_0x1c2932[_0xa757('0x5')](''):[]);},'get':function(){return this['getDataValue'](_0xa757('0x4'))?this[_0xa757('0x6')]('crudPermissions')[_0xa757('0x7')](''):[];}}}; \ No newline at end of file +var _0xb688=['STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions','join','split','exports'];(function(_0x3c87e2,_0x45a1b4){var _0xc1e8c1=function(_0x3dacb7){while(--_0x3dacb7){_0x3c87e2['push'](_0x3c87e2['shift']());}};_0xc1e8c1(++_0x45a1b4);}(_0xb688,0xcf));var _0x8b68=function(_0x18065d,_0x46fab3){_0x18065d=_0x18065d-0x0;var _0x18af2f=_0xb688[_0x18065d];return _0x18af2f;};'use strict';var Sequelize=require('sequelize');module[_0x8b68('0x0')]={'name':{'type':Sequelize[_0x8b68('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0x8b68('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x8b68('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0x8b68('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x8b68('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x41030e){this[_0x8b68('0x4')](_0x8b68('0x5'),_0x41030e?_0x41030e[_0x8b68('0x6')](''):[]);},'get':function(){return this['getDataValue'](_0x8b68('0x5'))?this['getDataValue'](_0x8b68('0x5'))[_0x8b68('0x7')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index e2ae529..3bebb9f 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 _0x5a7b=['rows','catch','show','intersection','find','body','update','params','describe','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','fields','length','nolimit','sort','where','merge','VIRTUAL','filter','options','includeAll','include','UserProfileSection'];(function(_0x1a777e,_0x5c67c5){var _0x2a8be5=function(_0x387d54){while(--_0x387d54){_0x1a777e['push'](_0x1a777e['shift']());}};_0x2a8be5(++_0x5c67c5);}(_0x5a7b,0x9b));var _0xb5a7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5a7b[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb5a7('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb5a7('0x1'));var rp=require('request-promise');var moment=require(_0xb5a7('0x2'));var BPromise=require(_0xb5a7('0x3'));var Mustache=require(_0xb5a7('0x4'));var util=require(_0xb5a7('0x5'));var path=require(_0xb5a7('0x6'));var sox=require(_0xb5a7('0x7'));var csv=require(_0xb5a7('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb5a7('0x9'));var _=require('lodash');var squel=require(_0xb5a7('0xa'));var crypto=require(_0xb5a7('0xb'));var jsforce=require(_0xb5a7('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb5a7('0xd'));var Papa=require(_0xb5a7('0xe'));var Redis=require(_0xb5a7('0xf'));var authService=require(_0xb5a7('0x10'));var qs=require(_0xb5a7('0x11'));var as=require(_0xb5a7('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb5a7('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xb5a7('0x14'));var licenseUtil=require(_0xb5a7('0x15'));var db=require(_0xb5a7('0x16'))['db'];function respondWithStatusCode(_0x40759d,_0x52e05f){_0x52e05f=_0x52e05f||0xcc;return function(_0x214181){if(_0x214181){return _0x40759d[_0xb5a7('0x17')](_0x52e05f);}return _0x40759d[_0xb5a7('0x18')](_0x52e05f)[_0xb5a7('0x19')]();};}function respondWithResult(_0x5d0120,_0x5cb9f8){_0x5cb9f8=_0x5cb9f8||0xc8;return function(_0x49fa8c){if(_0x49fa8c){return _0x5d0120[_0xb5a7('0x18')](_0x5cb9f8)[_0xb5a7('0x1a')](_0x49fa8c);}};}function respondWithFilteredResult(_0x19f8fc,_0x227d5c){return function(_0x40bf9f){if(_0x40bf9f){var _0x3b6229=typeof _0x227d5c[_0xb5a7('0x1b')]===_0xb5a7('0x1c')&&typeof _0x227d5c[_0xb5a7('0x1d')]===_0xb5a7('0x1c');var _0x40cc78=_0x40bf9f[_0xb5a7('0x1e')];var _0x554e94=_0x3b6229?0x0:_0x227d5c[_0xb5a7('0x1b')];var _0x18c85f=_0x3b6229?_0x40bf9f[_0xb5a7('0x1e')]:_0x227d5c[_0xb5a7('0x1b')]+_0x227d5c[_0xb5a7('0x1d')];var _0x3ac915;if(_0x18c85f>=_0x40cc78){_0x18c85f=_0x40cc78;_0x3ac915=0xc8;}else{_0x3ac915=0xce;}_0x19f8fc[_0xb5a7('0x18')](_0x3ac915);return _0x19f8fc['set'](_0xb5a7('0x1f'),_0x554e94+'-'+_0x18c85f+'/'+_0x40cc78)['json'](_0x40bf9f);}return null;};}function patchUpdates(_0x572676){return function(_0x21f8ba){try{jsonpatch[_0xb5a7('0x20')](_0x21f8ba,_0x572676,!![]);}catch(_0x5127de){return BPromise[_0xb5a7('0x21')](_0x5127de);}return _0x21f8ba[_0xb5a7('0x22')]();};}function saveUpdates(_0x4b2421,_0x16a471){return function(_0x41a06f){if(_0x41a06f){return _0x41a06f['update'](_0x4b2421)['then'](function(_0x972cb6){return _0x972cb6;});}return null;};}function removeEntity(_0x5c8ecd,_0x4397e9){return function(_0x4e1947){if(_0x4e1947){return _0x4e1947[_0xb5a7('0x23')]()[_0xb5a7('0x24')](function(){_0x5c8ecd[_0xb5a7('0x18')](0xcc)[_0xb5a7('0x19')]();});}};}function handleEntityNotFound(_0x16a83b,_0x87ad37){return function(_0xb9b14d){if(!_0xb9b14d){_0x16a83b[_0xb5a7('0x17')](0x194);}return _0xb9b14d;};}function handleError(_0x2d7ad2,_0x2f130a){_0x2f130a=_0x2f130a||0x1f4;return function(_0x1b789a){logger[_0xb5a7('0x25')](_0x1b789a[_0xb5a7('0x26')]);if(_0x1b789a[_0xb5a7('0x27')]){delete _0x1b789a[_0xb5a7('0x27')];}_0x2d7ad2[_0xb5a7('0x18')](_0x2f130a)[_0xb5a7('0x28')](_0x1b789a);};}exports[_0xb5a7('0x29')]=function(_0x1a0f14,_0x23b947){var _0x471268={},_0x278ab7={},_0x15490e={'count':0x0,'rows':[]};var _0x3945cf=_[_0xb5a7('0x2a')](db['UserProfileSection'][_0xb5a7('0x2b')],function(_0x5ed855){return{'name':_0x5ed855[_0xb5a7('0x2c')],'type':_0x5ed855[_0xb5a7('0x2d')][_0xb5a7('0x2e')]};});_0x278ab7['model']=_[_0xb5a7('0x2a')](_0x3945cf,_0xb5a7('0x27'));_0x278ab7[_0xb5a7('0x2f')]=_[_0xb5a7('0x30')](_0x1a0f14[_0xb5a7('0x2f')]);_0x278ab7[_0xb5a7('0x31')]=_['intersection'](_0x278ab7[_0xb5a7('0x32')],_0x278ab7[_0xb5a7('0x2f')]);_0x471268[_0xb5a7('0x33')]=_['intersection'](_0x278ab7[_0xb5a7('0x32')],qs[_0xb5a7('0x34')](_0x1a0f14[_0xb5a7('0x2f')][_0xb5a7('0x34')]));_0x471268[_0xb5a7('0x33')]=_0x471268[_0xb5a7('0x33')][_0xb5a7('0x35')]?_0x471268['attributes']:_0x278ab7[_0xb5a7('0x32')];if(!_0x1a0f14[_0xb5a7('0x2f')]['hasOwnProperty'](_0xb5a7('0x36'))){_0x471268['limit']=qs['limit'](_0x1a0f14[_0xb5a7('0x2f')][_0xb5a7('0x1d')]);_0x471268['offset']=qs['offset'](_0x1a0f14[_0xb5a7('0x2f')][_0xb5a7('0x1b')]);}_0x471268['order']=qs[_0xb5a7('0x37')](_0x1a0f14['query'][_0xb5a7('0x37')]);_0x471268[_0xb5a7('0x38')]=qs['filters'](_['pick'](_0x1a0f14['query'],_0x278ab7[_0xb5a7('0x31')]),_0x3945cf);if(_0x1a0f14[_0xb5a7('0x2f')]['filter']){_0x471268['where']=_[_0xb5a7('0x39')](_0x471268[_0xb5a7('0x38')],{'$or':_[_0xb5a7('0x2a')](_0x3945cf,function(_0x338ac9){if(_0x338ac9[_0xb5a7('0x2d')]!==_0xb5a7('0x3a')){var _0x736126={};_0x736126[_0x338ac9[_0xb5a7('0x27')]]={'$like':'%'+_0x1a0f14[_0xb5a7('0x2f')][_0xb5a7('0x3b')]+'%'};return _0x736126;}})});}_0x471268=_['merge']({},_0x471268,_0x1a0f14[_0xb5a7('0x3c')]);var _0x4f54b3={'where':_0x471268[_0xb5a7('0x38')]};return db['UserProfileSection'][_0xb5a7('0x1e')](_0x4f54b3)['then'](function(_0x5bb3a8){_0x15490e[_0xb5a7('0x1e')]=_0x5bb3a8;if(_0x1a0f14[_0xb5a7('0x2f')][_0xb5a7('0x3d')]){_0x471268[_0xb5a7('0x3e')]=[{'all':!![]}];}return db[_0xb5a7('0x3f')]['findAll'](_0x471268);})[_0xb5a7('0x24')](function(_0x3f5c21){_0x15490e[_0xb5a7('0x40')]=_0x3f5c21;return _0x15490e;})[_0xb5a7('0x24')](respondWithFilteredResult(_0x23b947,_0x471268))[_0xb5a7('0x41')](handleError(_0x23b947,null));};exports[_0xb5a7('0x42')]=function(_0x59d7d2,_0x4e8650){var _0x4b6d04={'raw':![],'where':{'id':_0x59d7d2['params']['id']}},_0x42358d={};_0x42358d[_0xb5a7('0x32')]=_[_0xb5a7('0x30')](db[_0xb5a7('0x3f')]['rawAttributes']);_0x42358d['query']=_[_0xb5a7('0x30')](_0x59d7d2[_0xb5a7('0x2f')]);_0x42358d[_0xb5a7('0x31')]=_[_0xb5a7('0x43')](_0x42358d[_0xb5a7('0x32')],_0x42358d[_0xb5a7('0x2f')]);_0x4b6d04[_0xb5a7('0x33')]=_[_0xb5a7('0x43')](_0x42358d[_0xb5a7('0x32')],qs[_0xb5a7('0x34')](_0x59d7d2[_0xb5a7('0x2f')]['fields']));_0x4b6d04[_0xb5a7('0x33')]=_0x4b6d04[_0xb5a7('0x33')][_0xb5a7('0x35')]?_0x4b6d04['attributes']:_0x42358d[_0xb5a7('0x32')];if(_0x59d7d2[_0xb5a7('0x2f')][_0xb5a7('0x3d')]){_0x4b6d04[_0xb5a7('0x3e')]=[{'all':!![]}];}_0x4b6d04=_[_0xb5a7('0x39')]({},_0x4b6d04,_0x59d7d2[_0xb5a7('0x3c')]);return db[_0xb5a7('0x3f')][_0xb5a7('0x44')](_0x4b6d04)['then'](handleEntityNotFound(_0x4e8650,null))['then'](respondWithResult(_0x4e8650,null))['catch'](handleError(_0x4e8650,null));};exports['create']=function(_0x43feba,_0x509147){return db['UserProfileSection']['create'](_0x43feba[_0xb5a7('0x45')],{})[_0xb5a7('0x24')](respondWithResult(_0x509147,0xc9))[_0xb5a7('0x41')](handleError(_0x509147,null));};exports[_0xb5a7('0x46')]=function(_0x454e60,_0x1e69e1){if(_0x454e60[_0xb5a7('0x45')]['id']){delete _0x454e60[_0xb5a7('0x45')]['id'];}return db[_0xb5a7('0x3f')][_0xb5a7('0x44')]({'where':{'id':_0x454e60['params']['id']}})[_0xb5a7('0x24')](handleEntityNotFound(_0x1e69e1,null))['then'](saveUpdates(_0x454e60['body'],null))['then'](respondWithResult(_0x1e69e1,null))[_0xb5a7('0x41')](handleError(_0x1e69e1,null));};exports[_0xb5a7('0x23')]=function(_0x4856ce,_0x5e32be){return db[_0xb5a7('0x3f')][_0xb5a7('0x44')]({'where':{'id':_0x4856ce[_0xb5a7('0x47')]['id']}})[_0xb5a7('0x24')](handleEntityNotFound(_0x5e32be,null))[_0xb5a7('0x24')](removeEntity(_0x5e32be,null))[_0xb5a7('0x41')](handleError(_0x5e32be,null));};exports[_0xb5a7('0x48')]=function(_0x278c2e,_0x422bfa){return db[_0xb5a7('0x3f')]['describe']()[_0xb5a7('0x24')](respondWithResult(_0x422bfa,null))[_0xb5a7('0x41')](handleError(_0x422bfa,null));}; \ No newline at end of file +var _0xd223=['filter','merge','VIRTUAL','options','include','UserProfileSection','findAll','rows','show','params','includeAll','find','catch','create','body','describe','eml-format','request-promise','mustache','util','sox','to-csv','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','error','name','index','map','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xd223,0x1b4));var _0x3d22=function(_0x44ba71,_0x4cd8a1){_0x44ba71=_0x44ba71-0x0;var _0x1ad78d=_0xd223[_0x44ba71];return _0x1ad78d;};'use strict';var emlformat=require(_0x3d22('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3d22('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3d22('0x2'));var util=require(_0x3d22('0x3'));var path=require('path');var sox=require(_0x3d22('0x4'));var csv=require(_0x3d22('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3d22('0x6'));var _=require(_0x3d22('0x7'));var squel=require(_0x3d22('0x8'));var crypto=require('crypto');var jsforce=require(_0x3d22('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x3d22('0x5'));var querystring=require(_0x3d22('0xa'));var Papa=require(_0x3d22('0xb'));var Redis=require('ioredis');var authService=require(_0x3d22('0xc'));var qs=require(_0x3d22('0xd'));var as=require(_0x3d22('0xe'));var hardwareService=require(_0x3d22('0xf'));var logger=require('../../config/logger')(_0x3d22('0x10'));var utils=require(_0x3d22('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x3d22('0x12'));var db=require(_0x3d22('0x13'))['db'];function respondWithStatusCode(_0x5e6750,_0x558d25){_0x558d25=_0x558d25||0xcc;return function(_0xecbf1d){if(_0xecbf1d){return _0x5e6750[_0x3d22('0x14')](_0x558d25);}return _0x5e6750[_0x3d22('0x15')](_0x558d25)[_0x3d22('0x16')]();};}function respondWithResult(_0x527ae8,_0x4cbb9f){_0x4cbb9f=_0x4cbb9f||0xc8;return function(_0xdcbca2){if(_0xdcbca2){return _0x527ae8[_0x3d22('0x15')](_0x4cbb9f)[_0x3d22('0x17')](_0xdcbca2);}};}function respondWithFilteredResult(_0x50d3c9,_0x257f62){return function(_0x54413f){if(_0x54413f){var _0x494cbf=typeof _0x257f62[_0x3d22('0x18')]===_0x3d22('0x19')&&typeof _0x257f62[_0x3d22('0x1a')]==='undefined';var _0x1aa2f4=_0x54413f[_0x3d22('0x1b')];var _0x1ea8fb=_0x494cbf?0x0:_0x257f62[_0x3d22('0x18')];var _0x5db654=_0x494cbf?_0x54413f[_0x3d22('0x1b')]:_0x257f62[_0x3d22('0x18')]+_0x257f62[_0x3d22('0x1a')];var _0x7c0802;if(_0x5db654>=_0x1aa2f4){_0x5db654=_0x1aa2f4;_0x7c0802=0xc8;}else{_0x7c0802=0xce;}_0x50d3c9['status'](_0x7c0802);return _0x50d3c9[_0x3d22('0x1c')](_0x3d22('0x1d'),_0x1ea8fb+'-'+_0x5db654+'/'+_0x1aa2f4)[_0x3d22('0x17')](_0x54413f);}return null;};}function patchUpdates(_0x590172){return function(_0x53174e){try{jsonpatch[_0x3d22('0x1e')](_0x53174e,_0x590172,!![]);}catch(_0x9b599a){return BPromise['reject'](_0x9b599a);}return _0x53174e[_0x3d22('0x1f')]();};}function saveUpdates(_0x406d62,_0x598651){return function(_0x4b0bb9){if(_0x4b0bb9){return _0x4b0bb9[_0x3d22('0x20')](_0x406d62)[_0x3d22('0x21')](function(_0x1f0e40){return _0x1f0e40;});}return null;};}function removeEntity(_0x38d79a,_0x332d9d){return function(_0x2682bf){if(_0x2682bf){return _0x2682bf['destroy']()[_0x3d22('0x21')](function(){_0x38d79a[_0x3d22('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x26309a,_0x1a50e5){return function(_0x132998){if(!_0x132998){_0x26309a[_0x3d22('0x14')](0x194);}return _0x132998;};}function handleError(_0x237734,_0x1beee7){_0x1beee7=_0x1beee7||0x1f4;return function(_0x3bf4d1){logger[_0x3d22('0x22')](_0x3bf4d1['stack']);if(_0x3bf4d1[_0x3d22('0x23')]){delete _0x3bf4d1[_0x3d22('0x23')];}_0x237734[_0x3d22('0x15')](_0x1beee7)['send'](_0x3bf4d1);};}exports[_0x3d22('0x24')]=function(_0x16b38f,_0x35dace){var _0x24149d={},_0xe104a6={},_0x12fc0d={'count':0x0,'rows':[]};var _0x3efa0c=_[_0x3d22('0x25')](db['UserProfileSection']['rawAttributes'],function(_0x3627b0){return{'name':_0x3627b0[_0x3d22('0x26')],'type':_0x3627b0[_0x3d22('0x27')][_0x3d22('0x28')]};});_0xe104a6['model']=_[_0x3d22('0x25')](_0x3efa0c,_0x3d22('0x23'));_0xe104a6[_0x3d22('0x29')]=_[_0x3d22('0x2a')](_0x16b38f[_0x3d22('0x29')]);_0xe104a6['filters']=_[_0x3d22('0x2b')](_0xe104a6[_0x3d22('0x2c')],_0xe104a6[_0x3d22('0x29')]);_0x24149d[_0x3d22('0x2d')]=_['intersection'](_0xe104a6[_0x3d22('0x2c')],qs[_0x3d22('0x2e')](_0x16b38f[_0x3d22('0x29')][_0x3d22('0x2e')]));_0x24149d[_0x3d22('0x2d')]=_0x24149d['attributes'][_0x3d22('0x2f')]?_0x24149d[_0x3d22('0x2d')]:_0xe104a6[_0x3d22('0x2c')];if(!_0x16b38f[_0x3d22('0x29')][_0x3d22('0x30')](_0x3d22('0x31'))){_0x24149d[_0x3d22('0x1a')]=qs[_0x3d22('0x1a')](_0x16b38f[_0x3d22('0x29')][_0x3d22('0x1a')]);_0x24149d[_0x3d22('0x18')]=qs[_0x3d22('0x18')](_0x16b38f[_0x3d22('0x29')][_0x3d22('0x18')]);}_0x24149d[_0x3d22('0x32')]=qs[_0x3d22('0x33')](_0x16b38f[_0x3d22('0x29')][_0x3d22('0x33')]);_0x24149d[_0x3d22('0x34')]=qs[_0x3d22('0x35')](_['pick'](_0x16b38f['query'],_0xe104a6[_0x3d22('0x35')]),_0x3efa0c);if(_0x16b38f[_0x3d22('0x29')][_0x3d22('0x36')]){_0x24149d['where']=_[_0x3d22('0x37')](_0x24149d[_0x3d22('0x34')],{'$or':_[_0x3d22('0x25')](_0x3efa0c,function(_0x5485a5){if(_0x5485a5[_0x3d22('0x27')]!==_0x3d22('0x38')){var _0x4b41f6={};_0x4b41f6[_0x5485a5[_0x3d22('0x23')]]={'$like':'%'+_0x16b38f['query']['filter']+'%'};return _0x4b41f6;}})});}_0x24149d=_[_0x3d22('0x37')]({},_0x24149d,_0x16b38f[_0x3d22('0x39')]);var _0x8ee87a={'where':_0x24149d['where']};return db['UserProfileSection'][_0x3d22('0x1b')](_0x8ee87a)[_0x3d22('0x21')](function(_0x29a2c5){_0x12fc0d[_0x3d22('0x1b')]=_0x29a2c5;if(_0x16b38f[_0x3d22('0x29')]['includeAll']){_0x24149d[_0x3d22('0x3a')]=[{'all':!![]}];}return db[_0x3d22('0x3b')][_0x3d22('0x3c')](_0x24149d);})[_0x3d22('0x21')](function(_0x500105){_0x12fc0d[_0x3d22('0x3d')]=_0x500105;return _0x12fc0d;})[_0x3d22('0x21')](respondWithFilteredResult(_0x35dace,_0x24149d))['catch'](handleError(_0x35dace,null));};exports[_0x3d22('0x3e')]=function(_0x155f05,_0x18fbb4){var _0x5f0295={'raw':![],'where':{'id':_0x155f05[_0x3d22('0x3f')]['id']}},_0x307010={};_0x307010[_0x3d22('0x2c')]=_[_0x3d22('0x2a')](db[_0x3d22('0x3b')]['rawAttributes']);_0x307010['query']=_[_0x3d22('0x2a')](_0x155f05[_0x3d22('0x29')]);_0x307010[_0x3d22('0x35')]=_[_0x3d22('0x2b')](_0x307010['model'],_0x307010[_0x3d22('0x29')]);_0x5f0295[_0x3d22('0x2d')]=_[_0x3d22('0x2b')](_0x307010[_0x3d22('0x2c')],qs[_0x3d22('0x2e')](_0x155f05[_0x3d22('0x29')]['fields']));_0x5f0295[_0x3d22('0x2d')]=_0x5f0295[_0x3d22('0x2d')][_0x3d22('0x2f')]?_0x5f0295['attributes']:_0x307010[_0x3d22('0x2c')];if(_0x155f05[_0x3d22('0x29')][_0x3d22('0x40')]){_0x5f0295[_0x3d22('0x3a')]=[{'all':!![]}];}_0x5f0295=_['merge']({},_0x5f0295,_0x155f05[_0x3d22('0x39')]);return db[_0x3d22('0x3b')][_0x3d22('0x41')](_0x5f0295)[_0x3d22('0x21')](handleEntityNotFound(_0x18fbb4,null))['then'](respondWithResult(_0x18fbb4,null))[_0x3d22('0x42')](handleError(_0x18fbb4,null));};exports[_0x3d22('0x43')]=function(_0x3c0576,_0x231e5a){return db[_0x3d22('0x3b')]['create'](_0x3c0576['body'],{})[_0x3d22('0x21')](respondWithResult(_0x231e5a,0xc9))[_0x3d22('0x42')](handleError(_0x231e5a,null));};exports[_0x3d22('0x20')]=function(_0x628b53,_0x514fbd){if(_0x628b53[_0x3d22('0x44')]['id']){delete _0x628b53[_0x3d22('0x44')]['id'];}return db[_0x3d22('0x3b')][_0x3d22('0x41')]({'where':{'id':_0x628b53['params']['id']}})[_0x3d22('0x21')](handleEntityNotFound(_0x514fbd,null))[_0x3d22('0x21')](saveUpdates(_0x628b53[_0x3d22('0x44')],null))[_0x3d22('0x21')](respondWithResult(_0x514fbd,null))[_0x3d22('0x42')](handleError(_0x514fbd,null));};exports['destroy']=function(_0x346488,_0x29b230){return db[_0x3d22('0x3b')][_0x3d22('0x41')]({'where':{'id':_0x346488[_0x3d22('0x3f')]['id']}})[_0x3d22('0x21')](handleEntityNotFound(_0x29b230,null))[_0x3d22('0x21')](removeEntity(_0x29b230,null))[_0x3d22('0x42')](handleError(_0x29b230,null));};exports[_0x3d22('0x45')]=function(_0xe47901,_0x53e87a){return db[_0x3d22('0x3b')][_0x3d22('0x45')]()[_0x3d22('0x21')](respondWithResult(_0x53e87a,null))[_0x3d22('0x42')](handleError(_0x53e87a,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 3760c1b..7ee35ea 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 _0x2f69=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','UserProfileSection','user_profile_has_sections','compositeIndex','userProfileId','lodash','util','../../config/logger','api'];(function(_0x115b33,_0x39f834){var _0x277e69=function(_0x136d7b){while(--_0x136d7b){_0x115b33['push'](_0x115b33['shift']());}};_0x277e69(++_0x39f834);}(_0x2f69,0x14c));var _0x92f6=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x2f69[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x92f6('0x0'));var util=require(_0x92f6('0x1'));var logger=require(_0x92f6('0x2'))(_0x92f6('0x3'));var moment=require(_0x92f6('0x4'));var BPromise=require(_0x92f6('0x5'));var rp=require(_0x92f6('0x6'));var fs=require('fs');var path=require(_0x92f6('0x7'));var rimraf=require(_0x92f6('0x8'));var config=require(_0x92f6('0x9'));var attributes=require('./userProfileSection.attributes');module[_0x92f6('0xa')]=function(_0x120736,_0x6c3032){return _0x120736[_0x92f6('0xb')](_0x92f6('0xc'),attributes,{'tableName':_0x92f6('0xd'),'paranoid':![],'indexes':[{'name':_0x92f6('0xe'),'fields':['sectionId',_0x92f6('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9f39=['exports','define','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash','util','../../config/logger','moment','bluebird','request-promise','../../config/environment'];(function(_0x2bf112,_0x79a549){var _0x43cb87=function(_0x27ffc5){while(--_0x27ffc5){_0x2bf112['push'](_0x2bf112['shift']());}};_0x43cb87(++_0x79a549);}(_0x9f39,0x181));var _0x99f3=function(_0x2c9af0,_0x5a6f07){_0x2c9af0=_0x2c9af0-0x0;var _0x380d91=_0x9f39[_0x2c9af0];return _0x380d91;};'use strict';var _=require(_0x99f3('0x0'));var util=require(_0x99f3('0x1'));var logger=require(_0x99f3('0x2'))('api');var moment=require(_0x99f3('0x3'));var BPromise=require(_0x99f3('0x4'));var rp=require(_0x99f3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x99f3('0x6'));var attributes=require('./userProfileSection.attributes');module[_0x99f3('0x7')]=function(_0x331d3b,_0x6f2888){return _0x331d3b[_0x99f3('0x8')](_0x99f3('0x9'),attributes,{'tableName':_0x99f3('0xa'),'paranoid':![],'indexes':[{'name':_0x99f3('0xb'),'fields':[_0x99f3('0xc'),_0x99f3('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index cbef73b..d8c1e61 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 _0xe35c=['UserProfileSection,\x20%s,\x20%s','message','result','catch','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','request\x20sent','debug','stringify','error'];(function(_0x3d4d91,_0x577d8a){var _0xa30755=function(_0x1299ba){while(--_0x1299ba){_0x3d4d91['push'](_0x3d4d91['shift']());}};_0xa30755(++_0x577d8a);}(_0xe35c,0x7c));var _0xce35=function(_0xb6298b,_0x2631cc){_0xb6298b=_0xb6298b-0x0;var _0x3239d9=_0xe35c[_0xb6298b];return _0x3239d9;};'use strict';var _=require(_0xce35('0x0'));var util=require('util');var moment=require(_0xce35('0x1'));var BPromise=require('bluebird');var rs=require(_0xce35('0x2'));var fs=require('fs');var Redis=require(_0xce35('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xce35('0x4'));var logger=require(_0xce35('0x5'))(_0xce35('0x6'));var config=require('../../config/environment');var jayson=require(_0xce35('0x7'));var client=jayson[_0xce35('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c9808,_0x4388c2,_0x59ccf7){return new BPromise(function(_0x12a677,_0x30e990){return client[_0xce35('0x9')](_0x3c9808,_0x59ccf7)[_0xce35('0xa')](function(_0x86ef7c){logger[_0xce35('0xb')]('UserProfileSection,\x20%s,\x20%s',_0x4388c2,_0xce35('0xc'));logger[_0xce35('0xd')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x4388c2,_0xce35('0xc'),JSON[_0xce35('0xe')](_0x86ef7c));if(_0x86ef7c[_0xce35('0xf')]){if(_0x86ef7c['error']['code']===0x1f4){logger[_0xce35('0xf')](_0xce35('0x10'),_0x4388c2,_0x86ef7c[_0xce35('0xf')][_0xce35('0x11')]);return _0x30e990(_0x86ef7c[_0xce35('0xf')][_0xce35('0x11')]);}logger['error']('UserProfileSection,\x20%s,\x20%s',_0x4388c2,_0x86ef7c[_0xce35('0xf')]['message']);return _0x12a677(_0x86ef7c[_0xce35('0xf')][_0xce35('0x11')]);}else{logger[_0xce35('0xb')](_0xce35('0x10'),_0x4388c2,_0xce35('0xc'));_0x12a677(_0x86ef7c[_0xce35('0x12')][_0xce35('0x11')]);}})[_0xce35('0x13')](function(_0x1522f6){logger[_0xce35('0xf')](_0xce35('0x10'),_0x4388c2,_0x1522f6);_0x30e990(_0x1522f6);});});} \ No newline at end of file +var _0xfa42=['moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util'];(function(_0x382c0d,_0x30bbfd){var _0x252320=function(_0x2d41d8){while(--_0x2d41d8){_0x382c0d['push'](_0x382c0d['shift']());}};_0x252320(++_0x30bbfd);}(_0xfa42,0xf0));var _0x2fa4=function(_0x342956,_0x57ca4d){_0x342956=_0x342956-0x0;var _0x1e7093=_0xfa42[_0x342956];return _0x1e7093;};'use strict';var _=require(_0x2fa4('0x0'));var util=require(_0x2fa4('0x1'));var moment=require(_0x2fa4('0x2'));var BPromise=require(_0x2fa4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2fa4('0x4'))['db'];var utils=require(_0x2fa4('0x5'));var logger=require(_0x2fa4('0x6'))(_0x2fa4('0x7'));var config=require(_0x2fa4('0x8'));var jayson=require(_0x2fa4('0x9'));var client=jayson[_0x2fa4('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x7054ab,_0x3e3945,_0x1318da){return new BPromise(function(_0x5b3159,_0x5b4068){return client[_0x2fa4('0xb')](_0x7054ab,_0x1318da)[_0x2fa4('0xc')](function(_0x39cd3a){logger[_0x2fa4('0xd')](_0x2fa4('0xe'),_0x3e3945,_0x2fa4('0xf'));logger['debug'](_0x2fa4('0x10'),_0x3e3945,_0x2fa4('0xf'),JSON[_0x2fa4('0x11')](_0x39cd3a));if(_0x39cd3a[_0x2fa4('0x12')]){if(_0x39cd3a[_0x2fa4('0x12')][_0x2fa4('0x13')]===0x1f4){logger['error'](_0x2fa4('0xe'),_0x3e3945,_0x39cd3a[_0x2fa4('0x12')][_0x2fa4('0x14')]);return _0x5b4068(_0x39cd3a[_0x2fa4('0x12')][_0x2fa4('0x14')]);}logger['error'](_0x2fa4('0xe'),_0x3e3945,_0x39cd3a[_0x2fa4('0x12')][_0x2fa4('0x14')]);return _0x5b3159(_0x39cd3a[_0x2fa4('0x12')]['message']);}else{logger['info'](_0x2fa4('0xe'),_0x3e3945,_0x2fa4('0xf'));_0x5b3159(_0x39cd3a[_0x2fa4('0x15')][_0x2fa4('0x14')]);}})['catch'](function(_0x1df465){logger[_0x2fa4('0x12')](_0x2fa4('0xe'),_0x3e3945,_0x1df465);_0x5b4068(_0x1df465);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 9761091..1781b8c 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x1f9c40,_0x19214a){var _0x31b2f0=function(_0x4fdaf2){while(--_0x4fdaf2){_0x1f9c40['push'](_0x1f9c40['shift']());}};_0x31b2f0(++_0x19214a);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3f3f40,_0x4c71f4){_0x3f3f40=_0x3f3f40-0x0;var _0x403b7a=_0xcb91[_0x3f3f40];return _0x403b7a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x243652,_0x422d96){var _0x2d1bbe=function(_0xefb56d){while(--_0xefb56d){_0x243652['push'](_0x243652['shift']());}};_0x2d1bbe(++_0x422d96);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3c4dad,_0x25ffd5){_0x3c4dad=_0x3c4dad-0x0;var _0x1a4f49=_0xcb91[_0x3c4dad];return _0x1a4f49;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index a853169..8c0ad6e 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 _0xb6d1=['sequelize','exports'];(function(_0x3149bf,_0x8e6a90){var _0x4a8563=function(_0x153d46){while(--_0x153d46){_0x3149bf['push'](_0x3149bf['shift']());}};_0x4a8563(++_0x8e6a90);}(_0xb6d1,0x15c));var _0x1b6d=function(_0x402f88,_0xaa6ea3){_0x402f88=_0x402f88-0x0;var _0x4a7acc=_0xb6d1[_0x402f88];return _0x4a7acc;};'use strict';var Sequelize=require(_0x1b6d('0x0'));module[_0x1b6d('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xdd04=['INTEGER','sequelize'];(function(_0x53de10,_0x40cab9){var _0x3b4f36=function(_0x4a16bb){while(--_0x4a16bb){_0x53de10['push'](_0x53de10['shift']());}};_0x3b4f36(++_0x40cab9);}(_0xdd04,0xab));var _0x4dd0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdd04[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x4dd0('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x4dd0('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 06e088d..fb6f257 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 _0xb511=['rimraf','../../config/environment','exports','define','UserSmsQueue','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xb511,0x165));var _0x1b51=function(_0x5cec58,_0x76eb6e){_0x5cec58=_0x5cec58-0x0;var _0x6e5f37=_0xb511[_0x5cec58];return _0x6e5f37;};'use strict';var _=require(_0x1b51('0x0'));var util=require(_0x1b51('0x1'));var logger=require(_0x1b51('0x2'))('api');var moment=require(_0x1b51('0x3'));var BPromise=require(_0x1b51('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1b51('0x5'));var rimraf=require(_0x1b51('0x6'));var config=require(_0x1b51('0x7'));var attributes=require('./userSmsQueue.attributes');module[_0x1b51('0x8')]=function(_0x463bec,_0x506653){return _0x463bec[_0x1b51('0x9')](_0x1b51('0xa'),attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf69c=['../../config/environment','exports','define','UserSmsQueue','lodash','../../config/logger','api','bluebird','path'];(function(_0xe1b102,_0x542a72){var _0xed6dcc=function(_0x3191a6){while(--_0x3191a6){_0xe1b102['push'](_0xe1b102['shift']());}};_0xed6dcc(++_0x542a72);}(_0xf69c,0x151));var _0xcf69=function(_0x1a124d,_0x3e04b0){_0x1a124d=_0x1a124d-0x0;var _0x5f0830=_0xf69c[_0x1a124d];return _0x5f0830;};'use strict';var _=require(_0xcf69('0x0'));var util=require('util');var logger=require(_0xcf69('0x1'))(_0xcf69('0x2'));var moment=require('moment');var BPromise=require(_0xcf69('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcf69('0x4'));var rimraf=require('rimraf');var config=require(_0xcf69('0x5'));var attributes=require('./userSmsQueue.attributes');module[_0xcf69('0x6')]=function(_0x168197,_0x225c65){return _0x168197[_0xcf69('0x7')](_0xcf69('0x8'),attributes,{'tableName':'user_has_sms_queues','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 3f67c84..2239374 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 _0x792d=['info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x792d,0x189));var _0xd792=function(_0x36e57f,_0xd423f1){_0x36e57f=_0x36e57f-0x0;var _0x5389d0=_0x792d[_0x36e57f];return _0x5389d0;};'use strict';var _=require(_0xd792('0x0'));var util=require(_0xd792('0x1'));var moment=require(_0xd792('0x2'));var BPromise=require(_0xd792('0x3'));var rs=require(_0xd792('0x4'));var fs=require('fs');var Redis=require(_0xd792('0x5'));var db=require(_0xd792('0x6'))['db'];var utils=require(_0xd792('0x7'));var logger=require(_0xd792('0x8'))('rpc');var config=require(_0xd792('0x9'));var jayson=require(_0xd792('0xa'));var client=jayson[_0xd792('0xb')][_0xd792('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4ead4f,_0x29b24e,_0x3fa4d1){return new BPromise(function(_0x155080,_0xdd5aaf){return client[_0xd792('0xd')](_0x4ead4f,_0x3fa4d1)[_0xd792('0xe')](function(_0xad6a94){logger['info'](_0xd792('0xf'),_0x29b24e,_0xd792('0x10'));logger[_0xd792('0x11')](_0xd792('0x12'),_0x29b24e,'request\x20sent',JSON[_0xd792('0x13')](_0xad6a94));if(_0xad6a94[_0xd792('0x14')]){if(_0xad6a94[_0xd792('0x14')][_0xd792('0x15')]===0x1f4){logger['error']('UserSmsQueue,\x20%s,\x20%s',_0x29b24e,_0xad6a94[_0xd792('0x14')][_0xd792('0x16')]);return _0xdd5aaf(_0xad6a94[_0xd792('0x14')][_0xd792('0x16')]);}logger[_0xd792('0x14')](_0xd792('0xf'),_0x29b24e,_0xad6a94['error'][_0xd792('0x16')]);return _0x155080(_0xad6a94[_0xd792('0x14')][_0xd792('0x16')]);}else{logger[_0xd792('0x17')](_0xd792('0xf'),_0x29b24e,_0xd792('0x10'));_0x155080(_0xad6a94[_0xd792('0x18')][_0xd792('0x16')]);}})[_0xd792('0x19')](function(_0x564379){logger[_0xd792('0x14')](_0xd792('0xf'),_0x29b24e,_0x564379);_0xdd5aaf(_0x564379);});});} \ No newline at end of file +var _0x71fb=['jayson/promise','client','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x21ad54,_0x440378){var _0x1df8ff=function(_0x39be8c){while(--_0x39be8c){_0x21ad54['push'](_0x21ad54['shift']());}};_0x1df8ff(++_0x440378);}(_0x71fb,0x10a));var _0xb71f=function(_0x4a1739,_0x4a3a33){_0x4a1739=_0x4a1739-0x0;var _0x235497=_0x71fb[_0x4a1739];return _0x235497;};'use strict';var _=require(_0xb71f('0x0'));var util=require(_0xb71f('0x1'));var moment=require(_0xb71f('0x2'));var BPromise=require(_0xb71f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb71f('0x4'));var db=require(_0xb71f('0x5'))['db'];var utils=require(_0xb71f('0x6'));var logger=require(_0xb71f('0x7'))(_0xb71f('0x8'));var config=require(_0xb71f('0x9'));var jayson=require(_0xb71f('0xa'));var client=jayson[_0xb71f('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x130554,_0x354d90,_0x123339){return new BPromise(function(_0x32cc1c,_0x18b474){return client[_0xb71f('0xc')](_0x130554,_0x123339)[_0xb71f('0xd')](function(_0x43f08f){logger[_0xb71f('0xe')](_0xb71f('0xf'),_0x354d90,_0xb71f('0x10'));logger['debug'](_0xb71f('0x11'),_0x354d90,_0xb71f('0x10'),JSON[_0xb71f('0x12')](_0x43f08f));if(_0x43f08f[_0xb71f('0x13')]){if(_0x43f08f[_0xb71f('0x13')][_0xb71f('0x14')]===0x1f4){logger[_0xb71f('0x13')](_0xb71f('0xf'),_0x354d90,_0x43f08f[_0xb71f('0x13')][_0xb71f('0x15')]);return _0x18b474(_0x43f08f[_0xb71f('0x13')][_0xb71f('0x15')]);}logger[_0xb71f('0x13')](_0xb71f('0xf'),_0x354d90,_0x43f08f[_0xb71f('0x13')]['message']);return _0x32cc1c(_0x43f08f[_0xb71f('0x13')][_0xb71f('0x15')]);}else{logger[_0xb71f('0xe')](_0xb71f('0xf'),_0x354d90,_0xb71f('0x10'));_0x32cc1c(_0x43f08f[_0xb71f('0x16')][_0xb71f('0x15')]);}})['catch'](function(_0x4017ff){logger[_0xb71f('0x13')](_0xb71f('0xf'),_0x354d90,_0x4017ff);_0x18b474(_0x4017ff);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index cedeb5b..0dde5bb 100644 --- a/server/api/userVoicePrefix/userVoicePrefix.attributes.js +++ b/server/api/userVoicePrefix/userVoicePrefix.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7c17=['INTEGER','sequelize'];(function(_0x3f2713,_0x1052d5){var _0x182fc1=function(_0x4eccdb){while(--_0x4eccdb){_0x3f2713['push'](_0x3f2713['shift']());}};_0x182fc1(++_0x1052d5);}(_0x7c17,0x67));var _0x77c1=function(_0x136123,_0x3a04be){_0x136123=_0x136123-0x0;var _0x33c855=_0x7c17[_0x136123];return _0x33c855;};'use strict';var Sequelize=require(_0x77c1('0x0'));module['exports']={'UserId':{'type':Sequelize[_0x77c1('0x1')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x00f9=['exports','INTEGER','sequelize'];(function(_0x5d08cb,_0x1dfdb5){var _0x3d9137=function(_0x1fbe64){while(--_0x1fbe64){_0x5d08cb['push'](_0x5d08cb['shift']());}};_0x3d9137(++_0x1dfdb5);}(_0x00f9,0x8f));var _0x900f=function(_0x8dc04d,_0xaa7559){_0x8dc04d=_0x8dc04d-0x0;var _0x2f5f28=_0x00f9[_0x8dc04d];return _0x2f5f28;};'use strict';var Sequelize=require(_0x900f('0x0'));module[_0x900f('0x1')]={'UserId':{'type':Sequelize[_0x900f('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x900f('0x2')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index 60d650b..9d90b9e 100644 --- a/server/api/userVoicePrefix/userVoicePrefix.model.js +++ b/server/api/userVoicePrefix/userVoicePrefix.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../config/environment','./userVoicePrefix.attributes','exports','define','UserVoicePrefix','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x2a856d,_0x4f7a65){var _0x2823a6=function(_0x35ef53){while(--_0x35ef53){_0x2a856d['push'](_0x2a856d['shift']());}};_0x2823a6(++_0x4f7a65);}(_0xa9e0,0x123));var _0x0a9e=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xa9e0[_0x521929];return _0x632436;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'user_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./userVoicePrefix.attributes','exports','define','UserVoicePrefix','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x164e2a,_0x4da188){var _0x530f99=function(_0x3cf56b){while(--_0x3cf56b){_0x164e2a['push'](_0x164e2a['shift']());}};_0x530f99(++_0x4da188);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'user_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index e83e331..bc36a35 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x1a2cbb,_0x5ad6f1){var _0x430d8e=function(_0x1a1c79){while(--_0x1a1c79){_0x1a2cbb['push'](_0x1a2cbb['shift']());}};_0x430d8e(++_0x5ad6f1);}(_0xe706,0xa3));var _0x6e70=function(_0x147ab3,_0x487355){_0x147ab3=_0x147ab3-0x0;var _0x510108=_0xe706[_0x147ab3];return _0x510108;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x455198,_0x4b6927){var _0x479a26=function(_0x3d03c0){while(--_0x3d03c0){_0x455198['push'](_0x455198['shift']());}};_0x479a26(++_0x4b6927);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index b0189d0..dbcbe86 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 _0x4c6c=['sequelize','exports','INTEGER'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x4c6c,0xb7));var _0xc4c6=function(_0x4bef30,_0x565852){_0x4bef30=_0x4bef30-0x0;var _0xb64426=_0x4c6c[_0x4bef30];return _0xb64426;};'use strict';var Sequelize=require(_0xc4c6('0x0'));module[_0xc4c6('0x1')]={'penalty':{'type':Sequelize[_0xc4c6('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x3bdb=['exports','sequelize'];(function(_0x48f06a,_0x526b53){var _0x448cdc=function(_0x3af5de){while(--_0x3af5de){_0x48f06a['push'](_0x48f06a['shift']());}};_0x448cdc(++_0x526b53);}(_0x3bdb,0xf9));var _0xb3bd=function(_0x1b2371,_0x10e1d1){_0x1b2371=_0x1b2371-0x0;var _0x360590=_0x3bdb[_0x1b2371];return _0x360590;};'use strict';var Sequelize=require(_0xb3bd('0x0'));module[_0xb3bd('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index 09cae94..df73027 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 _0x9292=['define','UserVoiceQueue','user_has_voice_queues','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','exports'];(function(_0x1196b0,_0x36c47a){var _0x111c52=function(_0x5604c7){while(--_0x5604c7){_0x1196b0['push'](_0x1196b0['shift']());}};_0x111c52(++_0x36c47a);}(_0x9292,0x157));var _0x2929=function(_0x3d7cd3,_0x251b6f){_0x3d7cd3=_0x3d7cd3-0x0;var _0xd578bc=_0x9292[_0x3d7cd3];return _0xd578bc;};'use strict';var _=require(_0x2929('0x0'));var util=require('util');var logger=require(_0x2929('0x1'))('api');var moment=require(_0x2929('0x2'));var BPromise=require(_0x2929('0x3'));var rp=require(_0x2929('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2929('0x5'));var config=require('../../config/environment');var attributes=require('./userVoiceQueue.attributes');module[_0x2929('0x6')]=function(_0x3d1e25,_0x55e950){return _0x3d1e25[_0x2929('0x7')](_0x2929('0x8'),attributes,{'tableName':_0x2929('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x08f1=['util','../../config/logger','moment','path','../../config/environment','./userVoiceQueue.attributes','define','UserVoiceQueue'];(function(_0x4cba56,_0x5b2c44){var _0x3cc9f3=function(_0x5bb80a){while(--_0x5bb80a){_0x4cba56['push'](_0x4cba56['shift']());}};_0x3cc9f3(++_0x5b2c44);}(_0x08f1,0xd8));var _0x108f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x08f1[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x108f('0x0'));var logger=require(_0x108f('0x1'))('api');var moment=require(_0x108f('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x108f('0x3'));var rimraf=require('rimraf');var config=require(_0x108f('0x4'));var attributes=require(_0x108f('0x5'));module['exports']=function(_0x1a3a5e,_0x2f1b08){return _0x1a3a5e[_0x108f('0x6')](_0x108f('0x7'),attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index 04cfe25..30944b3 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 _0xa97c=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','UserVoiceQueue,\x20%s,\x20%s','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','lodash','moment'];(function(_0x58e469,_0x95ee3e){var _0x4c01c5=function(_0x1ef7ae){while(--_0x1ef7ae){_0x58e469['push'](_0x58e469['shift']());}};_0x4c01c5(++_0x95ee3e);}(_0xa97c,0x14e));var _0xca97=function(_0x540d6c,_0x115b44){_0x540d6c=_0x540d6c-0x0;var _0x526aca=_0xa97c[_0x540d6c];return _0x526aca;};'use strict';var _=require(_0xca97('0x0'));var util=require('util');var moment=require(_0xca97('0x1'));var BPromise=require(_0xca97('0x2'));var rs=require(_0xca97('0x3'));var fs=require('fs');var Redis=require(_0xca97('0x4'));var db=require(_0xca97('0x5'))['db'];var utils=require(_0xca97('0x6'));var logger=require('../../config/logger')(_0xca97('0x7'));var config=require(_0xca97('0x8'));var jayson=require(_0xca97('0x9'));var client=jayson[_0xca97('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x232cf6,_0x149f73,_0x47f4ba){return new BPromise(function(_0x3689fe,_0x211b3d){return client[_0xca97('0xb')](_0x232cf6,_0x47f4ba)[_0xca97('0xc')](function(_0x2ffe60){logger['info'](_0xca97('0xd'),_0x149f73,'request\x20sent');logger[_0xca97('0xe')](_0xca97('0xf'),_0x149f73,_0xca97('0x10'),JSON['stringify'](_0x2ffe60));if(_0x2ffe60[_0xca97('0x11')]){if(_0x2ffe60[_0xca97('0x11')][_0xca97('0x12')]===0x1f4){logger[_0xca97('0x11')](_0xca97('0xd'),_0x149f73,_0x2ffe60['error']['message']);return _0x211b3d(_0x2ffe60['error']['message']);}logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x149f73,_0x2ffe60['error'][_0xca97('0x13')]);return _0x3689fe(_0x2ffe60[_0xca97('0x11')][_0xca97('0x13')]);}else{logger[_0xca97('0x14')](_0xca97('0xd'),_0x149f73,_0xca97('0x10'));_0x3689fe(_0x2ffe60['result'][_0xca97('0x13')]);}})['catch'](function(_0xd1e740){logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x149f73,_0xd1e740);_0x211b3d(_0xd1e740);});});} \ No newline at end of file +var _0x821e=['moment','bluebird','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util'];(function(_0x41de3c,_0x284168){var _0x468351=function(_0x4ff72d){while(--_0x4ff72d){_0x41de3c['push'](_0x41de3c['shift']());}};_0x468351(++_0x284168);}(_0x821e,0xbb));var _0xe821=function(_0x52f1e6,_0xf70489){_0x52f1e6=_0x52f1e6-0x0;var _0x21f104=_0x821e[_0x52f1e6];return _0x21f104;};'use strict';var _=require(_0xe821('0x0'));var util=require(_0xe821('0x1'));var moment=require(_0xe821('0x2'));var BPromise=require(_0xe821('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe821('0x4'));var logger=require('../../config/logger')(_0xe821('0x5'));var config=require(_0xe821('0x6'));var jayson=require(_0xe821('0x7'));var client=jayson[_0xe821('0x8')][_0xe821('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x143eea,_0x46bd35,_0x159996){return new BPromise(function(_0x3ebebc,_0x1e6934){return client[_0xe821('0xa')](_0x143eea,_0x159996)['then'](function(_0x3a3b30){logger['info'](_0xe821('0xb'),_0x46bd35,_0xe821('0xc'));logger[_0xe821('0xd')](_0xe821('0xe'),_0x46bd35,_0xe821('0xc'),JSON[_0xe821('0xf')](_0x3a3b30));if(_0x3a3b30['error']){if(_0x3a3b30[_0xe821('0x10')]['code']===0x1f4){logger[_0xe821('0x10')](_0xe821('0xb'),_0x46bd35,_0x3a3b30[_0xe821('0x10')][_0xe821('0x11')]);return _0x1e6934(_0x3a3b30[_0xe821('0x10')]['message']);}logger[_0xe821('0x10')](_0xe821('0xb'),_0x46bd35,_0x3a3b30[_0xe821('0x10')]['message']);return _0x3ebebc(_0x3a3b30['error'][_0xe821('0x11')]);}else{logger[_0xe821('0x12')](_0xe821('0xb'),_0x46bd35,_0xe821('0xc'));_0x3ebebc(_0x3a3b30[_0xe821('0x13')][_0xe821('0x11')]);}})[_0xe821('0x14')](function(_0x5635da){logger[_0xe821('0x10')](_0xe821('0xb'),_0x46bd35,_0x5635da);_0x1e6934(_0x5635da);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 9d07c03..557e8ae 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x1a02db,_0x4568d1){var _0x33c17b=function(_0x1d7c22){while(--_0x1d7c22){_0x1a02db['push'](_0x1a02db['shift']());}};_0x33c17b(++_0x4568d1);}(_0xedd9,0xfc));var _0x9edd=function(_0x3149b7,_0x1fc481){_0x3149b7=_0x3149b7-0x0;var _0x425a20=_0xedd9[_0x3149b7];return _0x425a20;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x5c8547,_0x228e91){var _0xbc53e=function(_0x20fd71){while(--_0x20fd71){_0x5c8547['push'](_0x5c8547['shift']());}};_0xbc53e(++_0x228e91);}(_0xe706,0xa3));var _0x6e70=function(_0x30edd9,_0x3a66f8){_0x30edd9=_0x30edd9-0x0;var _0x35a7ee=_0xe706[_0x30edd9];return _0x35a7ee;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index f3b130a..bfb5105 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 _0x03ea=['STRING','Required\x20by\x20Asterisk','INTEGER','queue_interface','sequelize','exports'];(function(_0x2d36e8,_0x4684ec){var _0x3deeab=function(_0x281f27){while(--_0x281f27){_0x2d36e8['push'](_0x2d36e8['shift']());}};_0x3deeab(++_0x4684ec);}(_0x03ea,0x1ba));var _0xa03e=function(_0x48a1c0,_0x4fdec){_0x48a1c0=_0x48a1c0-0x0;var _0x316823=_0x03ea[_0x48a1c0];return _0x316823;};'use strict';var Sequelize=require(_0xa03e('0x0'));module[_0xa03e('0x1')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0xa03e('0x2')],'allowNull':![],'comment':_0xa03e('0x3')},'UserId':{'type':Sequelize[_0xa03e('0x4')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xa03e('0x2')],'allowNull':![],'unique':_0xa03e('0x5'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize[_0xa03e('0x4')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':'queue_interface','comment':_0xa03e('0x3')},'penalty':{'type':Sequelize[_0xa03e('0x4')](0xb),'defaultValue':0x0,'comment':_0xa03e('0x3')},'paused':{'type':Sequelize[_0xa03e('0x4')](0xb),'defaultValue':0x0,'comment':_0xa03e('0x3')}}; \ No newline at end of file +var _0x3f20=['queue_interface','sequelize','INTEGER','Required\x20by\x20Asterisk','STRING'];(function(_0x4e2b12,_0x225f87){var _0x24eebe=function(_0x5371a5){while(--_0x5371a5){_0x4e2b12['push'](_0x4e2b12['shift']());}};_0x24eebe(++_0x225f87);}(_0x3f20,0x137));var _0x03f2=function(_0x25b858,_0x19ab59){_0x25b858=_0x25b858-0x0;var _0x5e5787=_0x3f20[_0x25b858];return _0x5e5787;};'use strict';var Sequelize=require(_0x03f2('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x03f2('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x03f2('0x2')},'membername':{'type':Sequelize[_0x03f2('0x3')],'allowNull':![],'comment':_0x03f2('0x2')},'UserId':{'type':Sequelize[_0x03f2('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x03f2('0x4'),'comment':_0x03f2('0x2')},'VoiceQueueId':{'type':Sequelize[_0x03f2('0x1')],'allowNull':![]},'interface':{'type':Sequelize[_0x03f2('0x3')],'allowNull':![],'unique':_0x03f2('0x4'),'comment':_0x03f2('0x2')},'penalty':{'type':Sequelize[_0x03f2('0x1')](0xb),'defaultValue':0x0,'comment':_0x03f2('0x2')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x03f2('0x2')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 1efaa8b..27a1aa9 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 _0x86aa=['emit','hasOwnProperty','hook','exports','../../mysqldb','UserVoiceQueueRt','save','remove'];(function(_0xae1a83,_0x1980d4){var _0xdb9da8=function(_0x36fc99){while(--_0x36fc99){_0xae1a83['push'](_0xae1a83['shift']());}};_0xdb9da8(++_0x1980d4);}(_0x86aa,0xbc));var _0xa86a=function(_0x4f2e08,_0x18d785){_0x4f2e08=_0x4f2e08-0x0;var _0x25b457=_0x86aa[_0x4f2e08];return _0x25b457;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0xa86a('0x0'))['db'][_0xa86a('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa86a('0x2'),'afterUpdate':'update','afterDestroy':_0xa86a('0x3')};function emitEvent(_0x46f46d){return function(_0x14a059,_0x1143c2,_0x14aebb){UserVoiceQueueRtEvents[_0xa86a('0x4')](_0x46f46d+':'+_0x14a059['id'],_0x14a059);UserVoiceQueueRtEvents[_0xa86a('0x4')](_0x46f46d,_0x14a059);_0x14aebb(null);};}for(var e in events){if(events[_0xa86a('0x5')](e)){var event=events[e];UserVoiceQueueRt[_0xa86a('0x6')](e,emitEvent(event));}}module[_0xa86a('0x7')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x4240=['update','emit','hasOwnProperty','hook','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save'];(function(_0x298032,_0x37da5e){var _0x2107c1=function(_0x1098db){while(--_0x1098db){_0x298032['push'](_0x298032['shift']());}};_0x2107c1(++_0x37da5e);}(_0x4240,0xf7));var _0x0424=function(_0x561369,_0x5e037b){_0x561369=_0x561369-0x0;var _0x5b071d=_0x4240[_0x561369];return _0x5b071d;};'use strict';var EventEmitter=require(_0x0424('0x0'));var UserVoiceQueueRt=require(_0x0424('0x1'))['db'][_0x0424('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x0424('0x3')](0x0);var events={'afterCreate':_0x0424('0x4'),'afterUpdate':_0x0424('0x5'),'afterDestroy':'remove'};function emitEvent(_0xf3a8e5){return function(_0x2b29f1,_0x2d9ec6,_0x5c1032){UserVoiceQueueRtEvents[_0x0424('0x6')](_0xf3a8e5+':'+_0x2b29f1['id'],_0x2b29f1);UserVoiceQueueRtEvents[_0x0424('0x6')](_0xf3a8e5,_0x2b29f1);_0x5c1032(null);};}for(var e in events){if(events[_0x0424('0x7')](e)){var event=events[e];UserVoiceQueueRt[_0x0424('0x8')](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 1e3e909..85da386 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 _0xf9f0=['bluebird','path','rimraf','../../config/environment','exports','user_has_voice_queues_rt','lodash','util','../../config/logger'];(function(_0xf0bcac,_0x531755){var _0x4e4c65=function(_0x35a77a){while(--_0x35a77a){_0xf0bcac['push'](_0xf0bcac['shift']());}};_0x4e4c65(++_0x531755);}(_0xf9f0,0x14a));var _0x0f9f=function(_0x249a2e,_0x53711f){_0x249a2e=_0x249a2e-0x0;var _0x3936fb=_0xf9f0[_0x249a2e];return _0x3936fb;};'use strict';var _=require(_0x0f9f('0x0'));var util=require(_0x0f9f('0x1'));var logger=require(_0x0f9f('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0f9f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0f9f('0x4'));var rimraf=require(_0x0f9f('0x5'));var config=require(_0x0f9f('0x6'));var attributes=require('./userVoiceQueueRt.attributes');module[_0x0f9f('0x7')]=function(_0x54865c,_0x31a358){return _0x54865c['define']('UserVoiceQueueRt',attributes,{'tableName':_0x0f9f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x97b5=['./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x352d66,_0x460b0c){var _0x1f024f=function(_0x25ba76){while(--_0x25ba76){_0x352d66['push'](_0x352d66['shift']());}};_0x1f024f(++_0x460b0c);}(_0x97b5,0x101));var _0x597b=function(_0x25db26,_0x48f45f){_0x25db26=_0x25db26-0x0;var _0x748fa6=_0x97b5[_0x25db26];return _0x748fa6;};'use strict';var _=require(_0x597b('0x0'));var util=require(_0x597b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x597b('0x2'));var rp=require(_0x597b('0x3'));var fs=require('fs');var path=require(_0x597b('0x4'));var rimraf=require(_0x597b('0x5'));var config=require(_0x597b('0x6'));var attributes=require(_0x597b('0x7'));module[_0x597b('0x8')]=function(_0x13a708,_0x4937b0){return _0x13a708[_0x597b('0x9')](_0x597b('0xa'),attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js index 8dc80d4..bea2329 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 _0x67b6=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./userVoiceQueueRt.socket','register','request','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','UserVoiceQueueRt','findAll','options','raw','sequelize','COUNT','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','then','GetVoiceQueueRtPauses','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x4751e1,_0x7665ef){var _0xae82e4=function(_0x3f302e){while(--_0x3f302e){_0x4751e1['push'](_0x4751e1['shift']());}};_0xae82e4(++_0x7665ef);}(_0x67b6,0x1a7));var _0x667b=function(_0x3da388,_0x5c7df0){_0x3da388=_0x3da388-0x0;var _0xde15b9=_0x67b6[_0x3da388];return _0xde15b9;};'use strict';var _=require(_0x667b('0x0'));var util=require(_0x667b('0x1'));var moment=require(_0x667b('0x2'));var BPromise=require(_0x667b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x667b('0x4'));var db=require(_0x667b('0x5'))['db'];var utils=require(_0x667b('0x6'));var logger=require(_0x667b('0x7'))(_0x667b('0x8'));var config=require(_0x667b('0x9'));var jayson=require(_0x667b('0xa'));var client=jayson[_0x667b('0xb')][_0x667b('0xc')]({'port':0x232a});config[_0x667b('0xd')]=_[_0x667b('0xe')](config[_0x667b('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x667b('0xf'))(new Redis(config[_0x667b('0xd')]));require(_0x667b('0x10'))[_0x667b('0x11')](socket);function respondWithRpcPromise(_0x5ce47c,_0x38989e,_0x46cafe){return new BPromise(function(_0x3024c1,_0x324068){return client[_0x667b('0x12')](_0x5ce47c,_0x46cafe)['then'](function(_0x574e04){logger['info'](_0x667b('0x13'),_0x38989e,_0x667b('0x14'));logger[_0x667b('0x15')](_0x667b('0x16'),_0x38989e,_0x667b('0x14'),JSON[_0x667b('0x17')](_0x574e04));if(_0x574e04[_0x667b('0x18')]){if(_0x574e04[_0x667b('0x18')]['code']===0x1f4){logger[_0x667b('0x18')](_0x667b('0x13'),_0x38989e,_0x574e04[_0x667b('0x18')][_0x667b('0x19')]);return _0x324068(_0x574e04[_0x667b('0x18')][_0x667b('0x19')]);}logger[_0x667b('0x18')](_0x667b('0x13'),_0x38989e,_0x574e04[_0x667b('0x18')][_0x667b('0x19')]);return _0x3024c1(_0x574e04[_0x667b('0x18')][_0x667b('0x19')]);}else{logger[_0x667b('0x1a')](_0x667b('0x13'),_0x38989e,_0x667b('0x14'));_0x3024c1(_0x574e04[_0x667b('0x1b')][_0x667b('0x19')]);}})[_0x667b('0x1c')](function(_0x406506){logger[_0x667b('0x18')](_0x667b('0x13'),_0x38989e,_0x406506);_0x324068(_0x406506);});});}exports['GetVoiceQueueRtPauses']=function(_0x4df15e){var _0x3b70df=this;return new Promise(function(_0x4b1fef,_0x4d8599){return db[_0x667b('0x1d')][_0x667b('0x1e')]({'raw':_0x4df15e[_0x667b('0x1f')]?_0x4df15e[_0x667b('0x1f')][_0x667b('0x20')]===undefined?!![]:![]:!![],'where':_0x4df15e[_0x667b('0x1f')]?_0x4df15e[_0x667b('0x1f')]['where']||null:null,'attributes':[[db[_0x667b('0x21')]['fn'](_0x667b('0x22'),db[_0x667b('0x21')]['fn']('IF',db[_0x667b('0x21')]['literal'](_0x667b('0x23')))),_0x667b('0x24')]]})[_0x667b('0x25')](function(_0xb1decc){logger['info'](_0x667b('0x26'),_0x4df15e);logger[_0x667b('0x15')](_0x667b('0x26'),_0x4df15e,JSON[_0x667b('0x17')](_0xb1decc));_0x4b1fef(_0xb1decc);})['catch'](function(_0x17778f){logger[_0x667b('0x18')]('GetVoiceQueueRtPauses',_0x17778f[_0x667b('0x19')],_0x4df15e);_0x4d8599(_0x3b70df[_0x667b('0x18')](0x1f4,_0x17778f[_0x667b('0x19')]));});});}; \ No newline at end of file +var _0x980a=['redis','defaults','./userVoiceQueueRt.socket','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','COUNT','sequelize','literal','outboundQueuePauses','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x4ef05e,_0x18b00a){var _0x241f30=function(_0x5440db){while(--_0x5440db){_0x4ef05e['push'](_0x4ef05e['shift']());}};_0x241f30(++_0x18b00a);}(_0x980a,0x66));var _0xa980=function(_0x3843f3,_0x499a61){_0x3843f3=_0x3843f3-0x0;var _0x2ae87f=_0x980a[_0x3843f3];return _0x2ae87f;};'use strict';var _=require(_0xa980('0x0'));var util=require(_0xa980('0x1'));var moment=require(_0xa980('0x2'));var BPromise=require(_0xa980('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa980('0x4'));var db=require(_0xa980('0x5'))['db'];var utils=require(_0xa980('0x6'));var logger=require(_0xa980('0x7'))(_0xa980('0x8'));var config=require(_0xa980('0x9'));var jayson=require(_0xa980('0xa'));var client=jayson[_0xa980('0xb')]['http']({'port':0x232a});config[_0xa980('0xc')]=_[_0xa980('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa980('0xc')]));require(_0xa980('0xe'))[_0xa980('0xf')](socket);function respondWithRpcPromise(_0x113cf7,_0xdce01f,_0x3df31e){return new BPromise(function(_0x462bff,_0x56891d){return client[_0xa980('0x10')](_0x113cf7,_0x3df31e)[_0xa980('0x11')](function(_0x2c4c16){logger[_0xa980('0x12')](_0xa980('0x13'),_0xdce01f,_0xa980('0x14'));logger[_0xa980('0x15')]('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0xdce01f,_0xa980('0x14'),JSON[_0xa980('0x16')](_0x2c4c16));if(_0x2c4c16[_0xa980('0x17')]){if(_0x2c4c16[_0xa980('0x17')][_0xa980('0x18')]===0x1f4){logger[_0xa980('0x17')](_0xa980('0x13'),_0xdce01f,_0x2c4c16[_0xa980('0x17')][_0xa980('0x19')]);return _0x56891d(_0x2c4c16[_0xa980('0x17')][_0xa980('0x19')]);}logger[_0xa980('0x17')]('UserVoiceQueueRt,\x20%s,\x20%s',_0xdce01f,_0x2c4c16[_0xa980('0x17')]['message']);return _0x462bff(_0x2c4c16[_0xa980('0x17')]['message']);}else{logger[_0xa980('0x12')]('UserVoiceQueueRt,\x20%s,\x20%s',_0xdce01f,_0xa980('0x14'));_0x462bff(_0x2c4c16[_0xa980('0x1a')]['message']);}})[_0xa980('0x1b')](function(_0x19201f){logger[_0xa980('0x17')](_0xa980('0x13'),_0xdce01f,_0x19201f);_0x56891d(_0x19201f);});});}exports[_0xa980('0x1c')]=function(_0x4f6556){var _0x33c906=this;return new Promise(function(_0x86fb11,_0x55b3e8){return db[_0xa980('0x1d')][_0xa980('0x1e')]({'raw':_0x4f6556[_0xa980('0x1f')]?_0x4f6556[_0xa980('0x1f')][_0xa980('0x20')]===undefined?!![]:![]:!![],'where':_0x4f6556[_0xa980('0x1f')]?_0x4f6556[_0xa980('0x1f')][_0xa980('0x21')]||null:null,'attributes':[[db['sequelize']['fn'](_0xa980('0x22'),db[_0xa980('0x23')]['fn']('IF',db['sequelize'][_0xa980('0x24')]('`paused`\x20=\x201,\x201,\x20null'))),_0xa980('0x25')]]})[_0xa980('0x11')](function(_0xeae907){logger['info'](_0xa980('0x1c'),_0x4f6556);logger[_0xa980('0x15')](_0xa980('0x1c'),_0x4f6556,JSON[_0xa980('0x16')](_0xeae907));_0x86fb11(_0xeae907);})[_0xa980('0x1b')](function(_0x4b2dda){logger[_0xa980('0x17')]('GetVoiceQueueRtPauses',_0x4b2dda[_0xa980('0x19')],_0x4f6556);_0x55b3e8(_0x33c906[_0xa980('0x17')](0x1f4,_0x4b2dda[_0xa980('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index a40dcb0..9298417 100644 --- a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js +++ b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6333=['removeListener','register','length','update'];(function(_0x42b4be,_0x23f2a2){var _0x1f44e1=function(_0x363281){while(--_0x363281){_0x42b4be['push'](_0x42b4be['shift']());}};_0x1f44e1(++_0x23f2a2);}(_0x6333,0x83));var _0x3633=function(_0x2d0894,_0x47fbf2){_0x2d0894=_0x2d0894-0x0;var _0xec8b9=_0x6333[_0x2d0894];return _0xec8b9;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=['save','remove',_0x3633('0x0')];function createListener(_0x528e8c,_0x2c7f7e){return function(_0x31ea34){_0x2c7f7e['emit'](_0x528e8c,_0x31ea34);};}function removeListener(_0x3e0961,_0x5cb6c6){return function(){UserVoiceQueueRtEvents[_0x3633('0x1')](_0x3e0961,_0x5cb6c6);};}exports[_0x3633('0x2')]=function(_0x566b21){for(var _0x547e6d=0x0,_0x23c014=events[_0x3633('0x3')];_0x547e6d<_0x23c014;_0x547e6d++){var _0x272da5=events[_0x547e6d];var _0x5c35ba=createListener('userVoiceQueueRt:'+_0x272da5,_0x566b21);UserVoiceQueueRtEvents['on'](_0x272da5,_0x5c35ba);}}; \ No newline at end of file +var _0xe015=['emit','removeListener','userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove'];(function(_0x4ce8f0,_0x59b04e){var _0x51e8ed=function(_0x41ab3a){while(--_0x41ab3a){_0x4ce8f0['push'](_0x4ce8f0['shift']());}};_0x51e8ed(++_0x59b04e);}(_0xe015,0x13b));var _0x5e01=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xe015[_0xa464c9];return _0x3d73c4;};'use strict';var UserVoiceQueueRtEvents=require(_0x5e01('0x0'));var events=[_0x5e01('0x1'),_0x5e01('0x2'),'update'];function createListener(_0x51f689,_0x46ed0d){return function(_0x4e3569){_0x46ed0d[_0x5e01('0x3')](_0x51f689,_0x4e3569);};}function removeListener(_0x420f00,_0x7ce4b9){return function(){UserVoiceQueueRtEvents[_0x5e01('0x4')](_0x420f00,_0x7ce4b9);};}exports['register']=function(_0x1814cb){for(var _0x3d2da2=0x0,_0x4de678=events['length'];_0x3d2da2<_0x4de678;_0x3d2da2++){var _0x414f73=events[_0x3d2da2];var _0x3aeaef=createListener(_0x5e01('0x5')+_0x414f73,_0x1814cb);UserVoiceQueueRtEvents['on'](_0x414f73,_0x3aeaef);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 74b3b31..9e0c234 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0xec9c4e,_0x1f3b34){var _0x49cf7b=function(_0x34c86d){while(--_0x34c86d){_0xec9c4e['push'](_0xec9c4e['shift']());}};_0x49cf7b(++_0x1f3b34);}(_0x9c44,0x178));var _0x49c4=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x9c44[_0x2b7764];return _0x848dcb;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x4df58e,_0xf2d8dd){var _0x16ac17=function(_0x28a08c){while(--_0x28a08c){_0x4df58e['push'](_0x4df58e['shift']());}};_0x16ac17(++_0xf2d8dd);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 157b369..b158905 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 _0x025d=['INTEGER','sequelize','exports'];(function(_0x1f337b,_0x5512fb){var _0x5eb800=function(_0x12d8a9){while(--_0x12d8a9){_0x1f337b['push'](_0x1f337b['shift']());}};_0x5eb800(++_0x5512fb);}(_0x025d,0x112));var _0xd025=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x025d[_0x2c91e9];return _0x13f0ff;};'use strict';var Sequelize=require(_0xd025('0x0'));module[_0xd025('0x1')]={'penalty':{'type':Sequelize[_0xd025('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x43c0=['sequelize','exports','INTEGER'];(function(_0x4f747f,_0x39db76){var _0x3eae2f=function(_0x1440b5){while(--_0x1440b5){_0x4f747f['push'](_0x4f747f['shift']());}};_0x3eae2f(++_0x39db76);}(_0x43c0,0x13b));var _0x043c=function(_0x53d283,_0x11e790){_0x53d283=_0x53d283-0x0;var _0x52ac28=_0x43c0[_0x53d283];return _0x52ac28;};'use strict';var Sequelize=require(_0x043c('0x0'));module[_0x043c('0x1')]={'penalty':{'type':Sequelize[_0x043c('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.model.js b/server/api/userWhatsappQueue/userWhatsappQueue.model.js index 8d490d8..5de2585 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 _0x9689=['lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','UserWhatsappQueue','user_has_whatsapp_queues'];(function(_0x504691,_0x2d34f4){var _0x24364c=function(_0x5cb917){while(--_0x5cb917){_0x504691['push'](_0x504691['shift']());}};_0x24364c(++_0x2d34f4);}(_0x9689,0x181));var _0x9968=function(_0x20fb96,_0x4ea238){_0x20fb96=_0x20fb96-0x0;var _0x14dcb4=_0x9689[_0x20fb96];return _0x14dcb4;};'use strict';var _=require(_0x9968('0x0'));var util=require(_0x9968('0x1'));var logger=require('../../config/logger')(_0x9968('0x2'));var moment=require('moment');var BPromise=require(_0x9968('0x3'));var rp=require(_0x9968('0x4'));var fs=require('fs');var path=require(_0x9968('0x5'));var rimraf=require(_0x9968('0x6'));var config=require(_0x9968('0x7'));var attributes=require('./userWhatsappQueue.attributes');module[_0x9968('0x8')]=function(_0x16b848,_0x2cf577){return _0x16b848['define'](_0x9968('0x9'),attributes,{'tableName':_0x9968('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6efc=['../../config/logger','api','bluebird','path','rimraf','./userWhatsappQueue.attributes','define','UserWhatsappQueue','user_has_whatsapp_queues','lodash','util'];(function(_0x1acd6b,_0x11ec1a){var _0x135db0=function(_0x1fd1f2){while(--_0x1fd1f2){_0x1acd6b['push'](_0x1acd6b['shift']());}};_0x135db0(++_0x11ec1a);}(_0x6efc,0x1d7));var _0xc6ef=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6efc[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xc6ef('0x0'));var util=require(_0xc6ef('0x1'));var logger=require(_0xc6ef('0x2'))(_0xc6ef('0x3'));var moment=require('moment');var BPromise=require(_0xc6ef('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc6ef('0x5'));var rimraf=require(_0xc6ef('0x6'));var config=require('../../config/environment');var attributes=require(_0xc6ef('0x7'));module['exports']=function(_0xbfe1b1,_0x157e41){return _0xbfe1b1[_0xc6ef('0x8')](_0xc6ef('0x9'),attributes,{'tableName':_0xc6ef('0xa'),'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 9182795..9f9d3c7 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 _0xe9da=['message','result','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','code','error'];(function(_0x1eda20,_0x1149f4){var _0x31b953=function(_0x25f0d8){while(--_0x25f0d8){_0x1eda20['push'](_0x1eda20['shift']());}};_0x31b953(++_0x1149f4);}(_0xe9da,0x70));var _0xae9d=function(_0x3bed4d,_0x2e596c){_0x3bed4d=_0x3bed4d-0x0;var _0x55b181=_0xe9da[_0x3bed4d];return _0x55b181;};'use strict';var _=require(_0xae9d('0x0'));var util=require(_0xae9d('0x1'));var moment=require(_0xae9d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xae9d('0x3'));var db=require(_0xae9d('0x4'))['db'];var utils=require(_0xae9d('0x5'));var logger=require(_0xae9d('0x6'))(_0xae9d('0x7'));var config=require(_0xae9d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xae9d('0x9')][_0xae9d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x544d03,_0x702b66,_0x7ef478){return new BPromise(function(_0x369975,_0x26440c){return client['request'](_0x544d03,_0x7ef478)[_0xae9d('0xb')](function(_0x323763){logger[_0xae9d('0xc')](_0xae9d('0xd'),_0x702b66,_0xae9d('0xe'));logger[_0xae9d('0xf')](_0xae9d('0x10'),_0x702b66,_0xae9d('0xe'),JSON[_0xae9d('0x11')](_0x323763));if(_0x323763['error']){if(_0x323763['error'][_0xae9d('0x12')]===0x1f4){logger['error']('UserWhatsappQueue,\x20%s,\x20%s',_0x702b66,_0x323763[_0xae9d('0x13')][_0xae9d('0x14')]);return _0x26440c(_0x323763[_0xae9d('0x13')]['message']);}logger[_0xae9d('0x13')](_0xae9d('0xd'),_0x702b66,_0x323763[_0xae9d('0x13')][_0xae9d('0x14')]);return _0x369975(_0x323763[_0xae9d('0x13')]['message']);}else{logger[_0xae9d('0xc')](_0xae9d('0xd'),_0x702b66,_0xae9d('0xe'));_0x369975(_0x323763[_0xae9d('0x15')][_0xae9d('0x14')]);}})['catch'](function(_0x3232ea){logger[_0xae9d('0x13')]('UserWhatsappQueue,\x20%s,\x20%s',_0x702b66,_0x3232ea);_0x26440c(_0x3232ea);});});} \ No newline at end of file +var _0x7f82=['then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http'];(function(_0x20c9b2,_0x55d7b1){var _0x2c6030=function(_0x10845f){while(--_0x10845f){_0x20c9b2['push'](_0x20c9b2['shift']());}};_0x2c6030(++_0x55d7b1);}(_0x7f82,0x84));var _0x27f8=function(_0x29ce14,_0x334166){_0x29ce14=_0x29ce14-0x0;var _0x48f289=_0x7f82[_0x29ce14];return _0x48f289;};'use strict';var _=require(_0x27f8('0x0'));var util=require(_0x27f8('0x1'));var moment=require(_0x27f8('0x2'));var BPromise=require(_0x27f8('0x3'));var rs=require(_0x27f8('0x4'));var fs=require('fs');var Redis=require(_0x27f8('0x5'));var db=require(_0x27f8('0x6'))['db'];var utils=require(_0x27f8('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x27f8('0x8'));var jayson=require(_0x27f8('0x9'));var client=jayson[_0x27f8('0xa')][_0x27f8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x370ea9,_0x455a79,_0x1b1662){return new BPromise(function(_0x59b8b8,_0x21a3e7){return client['request'](_0x370ea9,_0x1b1662)[_0x27f8('0xc')](function(_0x399829){logger[_0x27f8('0xd')](_0x27f8('0xe'),_0x455a79,_0x27f8('0xf'));logger[_0x27f8('0x10')](_0x27f8('0x11'),_0x455a79,'request\x20sent',JSON[_0x27f8('0x12')](_0x399829));if(_0x399829[_0x27f8('0x13')]){if(_0x399829[_0x27f8('0x13')][_0x27f8('0x14')]===0x1f4){logger[_0x27f8('0x13')]('UserWhatsappQueue,\x20%s,\x20%s',_0x455a79,_0x399829[_0x27f8('0x13')][_0x27f8('0x15')]);return _0x21a3e7(_0x399829[_0x27f8('0x13')][_0x27f8('0x15')]);}logger[_0x27f8('0x13')]('UserWhatsappQueue,\x20%s,\x20%s',_0x455a79,_0x399829[_0x27f8('0x13')]['message']);return _0x59b8b8(_0x399829[_0x27f8('0x13')][_0x27f8('0x15')]);}else{logger[_0x27f8('0xd')](_0x27f8('0xe'),_0x455a79,_0x27f8('0xf'));_0x59b8b8(_0x399829[_0x27f8('0x16')][_0x27f8('0x15')]);}})[_0x27f8('0x17')](function(_0x3feb40){logger[_0x27f8('0x13')](_0x27f8('0xe'),_0x455a79,_0x3feb40);_0x21a3e7(_0x3feb40);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 0f4f56b..8d22e56 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 _0x4bc3=['post','create','put','/:id','delete','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','show'];(function(_0x2edd87,_0x4b49e8){var _0x2ad924=function(_0x4e8920){while(--_0x4e8920){_0x2edd87['push'](_0x2edd87['shift']());}};_0x2ad924(++_0x4b49e8);}(_0x4bc3,0x16e));var _0x34bc=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x4bc3[_0x11005e];return _0x29338f;};'use strict';var multer=require(_0x34bc('0x0'));var util=require(_0x34bc('0x1'));var path=require('path');var timeout=require(_0x34bc('0x2'));var express=require(_0x34bc('0x3'));var router=express['Router']();var fs_extra=require(_0x34bc('0x4'));var auth=require(_0x34bc('0x5'));var interaction=require(_0x34bc('0x6'));var config=require(_0x34bc('0x7'));var controller=require(_0x34bc('0x8'));router[_0x34bc('0x9')]('/',auth[_0x34bc('0xa')](),controller['index']);router[_0x34bc('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x34bc('0xb')]);router[_0x34bc('0xc')]('/',auth[_0x34bc('0xa')](),controller[_0x34bc('0xd')]);router[_0x34bc('0xe')](_0x34bc('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x34bc('0x10')](_0x34bc('0xf'),auth[_0x34bc('0xa')](),controller['destroy']);module[_0x34bc('0x11')]=router; \ No newline at end of file +var _0xa566=['update','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','post','put','/:id'];(function(_0x2f8407,_0x2bd443){var _0x38725d=function(_0x45bbe2){while(--_0x45bbe2){_0x2f8407['push'](_0x2f8407['shift']());}};_0x38725d(++_0x2bd443);}(_0xa566,0x1c1));var _0x6a56=function(_0xaea49e,_0x44d385){_0xaea49e=_0xaea49e-0x0;var _0x3ce0c=_0xa566[_0xaea49e];return _0x3ce0c;};'use strict';var multer=require(_0x6a56('0x0'));var util=require(_0x6a56('0x1'));var path=require(_0x6a56('0x2'));var timeout=require('connect-timeout');var express=require(_0x6a56('0x3'));var router=express[_0x6a56('0x4')]();var fs_extra=require(_0x6a56('0x5'));var auth=require(_0x6a56('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6a56('0x7'));var controller=require('./variable.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x6a56('0x8')]('/:id',auth[_0x6a56('0x9')](),controller['show']);router[_0x6a56('0xa')]('/',auth[_0x6a56('0x9')](),controller['create']);router[_0x6a56('0xb')](_0x6a56('0xc'),auth[_0x6a56('0x9')](),controller[_0x6a56('0xd')]);router['delete'](_0x6a56('0xc'),auth[_0x6a56('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index cfe5e66..bed3840 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 _0x5f1d=['STRING','name','sequelize'];(function(_0x100d53,_0x40bab7){var _0x172f2b=function(_0x249779){while(--_0x249779){_0x100d53['push'](_0x100d53['shift']());}};_0x172f2b(++_0x40bab7);}(_0x5f1d,0x17f));var _0xd5f1=function(_0x21754d,_0x6b5b66){_0x21754d=_0x21754d-0x0;var _0x32d80e=_0x5f1d[_0x21754d];return _0x32d80e;};'use strict';var Sequelize=require(_0xd5f1('0x0'));module['exports']={'name':{'type':Sequelize[_0xd5f1('0x1')],'unique':_0xd5f1('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6302=['sequelize','exports','STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6302,0x6c));var _0x2630=function(_0x2ad5ea,_0x30ee98){_0x2ad5ea=_0x2ad5ea-0x0;var _0xd06aef=_0x6302[_0x2ad5ea];return _0xd06aef;};'use strict';var Sequelize=require(_0x2630('0x0'));module[_0x2630('0x1')]={'name':{'type':Sequelize[_0x2630('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x2630('0x2')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index eb63103..6aa8c76 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 _0xbbc2=['fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','count','findAll','rows','catch','show','params','rawAttributes','includeAll','include','find','user','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Variables','error','stack','name','send','map','Variable'];(function(_0x25bfd5,_0x3213bd){var _0x5bd289=function(_0x1c00c2){while(--_0x1c00c2){_0x25bfd5['push'](_0x25bfd5['shift']());}};_0x5bd289(++_0x3213bd);}(_0xbbc2,0x11e));var _0x2bbc=function(_0x595c44,_0x1aa6d2){_0x595c44=_0x595c44-0x0;var _0x2cf952=_0xbbc2[_0x595c44];return _0x2cf952;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2bbc('0x0'));var zipdir=require(_0x2bbc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2bbc('0x2'));var moment=require(_0x2bbc('0x3'));var BPromise=require(_0x2bbc('0x4'));var Mustache=require('mustache');var util=require(_0x2bbc('0x5'));var path=require(_0x2bbc('0x6'));var sox=require('sox');var csv=require(_0x2bbc('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2bbc('0x8'));var _=require(_0x2bbc('0x9'));var squel=require('squel');var crypto=require(_0x2bbc('0xa'));var jsforce=require(_0x2bbc('0xb'));var deskjs=require(_0x2bbc('0xc'));var toCsv=require(_0x2bbc('0x7'));var querystring=require('querystring');var Papa=require(_0x2bbc('0xd'));var Redis=require('ioredis');var authService=require(_0x2bbc('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x2bbc('0xf'));var hardwareService=require(_0x2bbc('0x10'));var logger=require(_0x2bbc('0x11'))(_0x2bbc('0x12'));var utils=require(_0x2bbc('0x13'));var config=require(_0x2bbc('0x14'));var licenseUtil=require(_0x2bbc('0x15'));var db=require(_0x2bbc('0x16'))['db'];function respondWithStatusCode(_0x486716,_0x3f8c0d){_0x3f8c0d=_0x3f8c0d||0xcc;return function(_0x124487){if(_0x124487){return _0x486716[_0x2bbc('0x17')](_0x3f8c0d);}return _0x486716[_0x2bbc('0x18')](_0x3f8c0d)[_0x2bbc('0x19')]();};}function respondWithResult(_0x5932b1,_0x44ee88){_0x44ee88=_0x44ee88||0xc8;return function(_0x23bafc){if(_0x23bafc){return _0x5932b1[_0x2bbc('0x18')](_0x44ee88)[_0x2bbc('0x1a')](_0x23bafc);}};}function respondWithFilteredResult(_0x2d329f,_0x4059b0){return function(_0x579c38){if(_0x579c38){var _0x27b386=typeof _0x4059b0[_0x2bbc('0x1b')]===_0x2bbc('0x1c')&&typeof _0x4059b0[_0x2bbc('0x1d')]===_0x2bbc('0x1c');var _0x343544=_0x579c38['count'];var _0x16a839=_0x27b386?0x0:_0x4059b0[_0x2bbc('0x1b')];var _0x47d7d6=_0x27b386?_0x579c38['count']:_0x4059b0[_0x2bbc('0x1b')]+_0x4059b0[_0x2bbc('0x1d')];var _0x253597;if(_0x47d7d6>=_0x343544){_0x47d7d6=_0x343544;_0x253597=0xc8;}else{_0x253597=0xce;}_0x2d329f[_0x2bbc('0x18')](_0x253597);return _0x2d329f[_0x2bbc('0x1e')](_0x2bbc('0x1f'),_0x16a839+'-'+_0x47d7d6+'/'+_0x343544)['json'](_0x579c38);}return null;};}function patchUpdates(_0x4cf793){return function(_0x3784cf){try{jsonpatch[_0x2bbc('0x20')](_0x3784cf,_0x4cf793,!![]);}catch(_0x4eaf02){return BPromise[_0x2bbc('0x21')](_0x4eaf02);}return _0x3784cf[_0x2bbc('0x22')]();};}function saveUpdates(_0x23c79e,_0x4c5097){return function(_0x13df57){if(_0x13df57){return _0x13df57[_0x2bbc('0x23')](_0x23c79e)[_0x2bbc('0x24')](function(_0x3d5eba){return _0x3d5eba;});}return null;};}function removeEntity(_0x2b3e3f,_0x574b55){return function(_0x3039b3){if(_0x3039b3){return _0x3039b3[_0x2bbc('0x25')]()[_0x2bbc('0x24')](function(){var _0xa0bbb=_0x3039b3[_0x2bbc('0x26')]({'plain':!![]});var _0x59d0cb=_0x2bbc('0x27');return db['UserProfileResource'][_0x2bbc('0x25')]({'where':{'type':_0x59d0cb,'resourceId':_0xa0bbb['id']}})[_0x2bbc('0x24')](function(){return _0x3039b3;});})[_0x2bbc('0x24')](function(){_0x2b3e3f[_0x2bbc('0x18')](0xcc)[_0x2bbc('0x19')]();});}};}function handleEntityNotFound(_0x338bd2,_0x1cc423){return function(_0x194890){if(!_0x194890){_0x338bd2['sendStatus'](0x194);}return _0x194890;};}function handleError(_0x427799,_0x147ba6){_0x147ba6=_0x147ba6||0x1f4;return function(_0x1a0d79){logger[_0x2bbc('0x28')](_0x1a0d79[_0x2bbc('0x29')]);if(_0x1a0d79[_0x2bbc('0x2a')]){delete _0x1a0d79[_0x2bbc('0x2a')];}_0x427799[_0x2bbc('0x18')](_0x147ba6)[_0x2bbc('0x2b')](_0x1a0d79);};}exports['index']=function(_0x5a6336,_0x2b2680){var _0x3838b9={},_0x50ace7={},_0x17131c={'count':0x0,'rows':[]};var _0x561d67=_[_0x2bbc('0x2c')](db[_0x2bbc('0x2d')]['rawAttributes'],function(_0x2648f8){return{'name':_0x2648f8[_0x2bbc('0x2e')],'type':_0x2648f8[_0x2bbc('0x2f')][_0x2bbc('0x30')]};});_0x50ace7[_0x2bbc('0x31')]=_[_0x2bbc('0x2c')](_0x561d67,'name');_0x50ace7[_0x2bbc('0x32')]=_[_0x2bbc('0x33')](_0x5a6336[_0x2bbc('0x32')]);_0x50ace7[_0x2bbc('0x34')]=_[_0x2bbc('0x35')](_0x50ace7[_0x2bbc('0x31')],_0x50ace7['query']);_0x3838b9[_0x2bbc('0x36')]=_['intersection'](_0x50ace7[_0x2bbc('0x31')],qs[_0x2bbc('0x37')](_0x5a6336['query'][_0x2bbc('0x37')]));_0x3838b9['attributes']=_0x3838b9[_0x2bbc('0x36')][_0x2bbc('0x38')]?_0x3838b9[_0x2bbc('0x36')]:_0x50ace7[_0x2bbc('0x31')];if(!_0x5a6336['query'][_0x2bbc('0x39')](_0x2bbc('0x3a'))){_0x3838b9[_0x2bbc('0x1d')]=qs[_0x2bbc('0x1d')](_0x5a6336[_0x2bbc('0x32')][_0x2bbc('0x1d')]);_0x3838b9['offset']=qs['offset'](_0x5a6336[_0x2bbc('0x32')][_0x2bbc('0x1b')]);}_0x3838b9['order']=qs[_0x2bbc('0x3b')](_0x5a6336[_0x2bbc('0x32')]['sort']);_0x3838b9[_0x2bbc('0x3c')]=qs[_0x2bbc('0x34')](_[_0x2bbc('0x3d')](_0x5a6336['query'],_0x50ace7['filters']),_0x561d67);if(_0x5a6336['query'][_0x2bbc('0x3e')]){_0x3838b9[_0x2bbc('0x3c')]=_[_0x2bbc('0x3f')](_0x3838b9[_0x2bbc('0x3c')],{'$or':_[_0x2bbc('0x2c')](_0x561d67,function(_0x55cadf){if(_0x55cadf[_0x2bbc('0x2f')]!==_0x2bbc('0x40')){var _0x2680a1={};_0x2680a1[_0x55cadf[_0x2bbc('0x2a')]]={'$like':'%'+_0x5a6336[_0x2bbc('0x32')][_0x2bbc('0x3e')]+'%'};return _0x2680a1;}})});}_0x3838b9=_[_0x2bbc('0x3f')]({},_0x3838b9,_0x5a6336[_0x2bbc('0x41')]);var _0x2ce844={'where':_0x3838b9['where']};return db['Variable'][_0x2bbc('0x42')](_0x2ce844)[_0x2bbc('0x24')](function(_0xc0ffb1){_0x17131c[_0x2bbc('0x42')]=_0xc0ffb1;if(_0x5a6336[_0x2bbc('0x32')]['includeAll']){_0x3838b9['include']=[{'all':!![]}];}return db[_0x2bbc('0x2d')][_0x2bbc('0x43')](_0x3838b9);})[_0x2bbc('0x24')](function(_0x36d1fa){_0x17131c[_0x2bbc('0x44')]=_0x36d1fa;return _0x17131c;})[_0x2bbc('0x24')](respondWithFilteredResult(_0x2b2680,_0x3838b9))[_0x2bbc('0x45')](handleError(_0x2b2680,null));};exports[_0x2bbc('0x46')]=function(_0x50fe20,_0x2693dd){var _0x4a7d02={'raw':!![],'where':{'id':_0x50fe20[_0x2bbc('0x47')]['id']}},_0x415763={};_0x415763[_0x2bbc('0x31')]=_[_0x2bbc('0x33')](db[_0x2bbc('0x2d')][_0x2bbc('0x48')]);_0x415763['query']=_['keys'](_0x50fe20[_0x2bbc('0x32')]);_0x415763[_0x2bbc('0x34')]=_[_0x2bbc('0x35')](_0x415763['model'],_0x415763[_0x2bbc('0x32')]);_0x4a7d02[_0x2bbc('0x36')]=_[_0x2bbc('0x35')](_0x415763[_0x2bbc('0x31')],qs[_0x2bbc('0x37')](_0x50fe20['query']['fields']));_0x4a7d02[_0x2bbc('0x36')]=_0x4a7d02[_0x2bbc('0x36')][_0x2bbc('0x38')]?_0x4a7d02[_0x2bbc('0x36')]:_0x415763[_0x2bbc('0x31')];if(_0x50fe20[_0x2bbc('0x32')][_0x2bbc('0x49')]){_0x4a7d02[_0x2bbc('0x4a')]=[{'all':!![]}];}_0x4a7d02=_[_0x2bbc('0x3f')]({},_0x4a7d02,_0x50fe20['options']);return db[_0x2bbc('0x2d')][_0x2bbc('0x4b')](_0x4a7d02)[_0x2bbc('0x24')](handleEntityNotFound(_0x2693dd,null))['then'](respondWithResult(_0x2693dd,null))['catch'](handleError(_0x2693dd,null));};exports['create']=function(_0x4135e1,_0x18a57a){return db[_0x2bbc('0x2d')]['create'](_0x4135e1['body'],{})[_0x2bbc('0x24')](function(_0x2fe5a5){var _0x3e678e=_0x4135e1[_0x2bbc('0x4c')][_0x2bbc('0x26')]({'plain':!![]});if(!_0x3e678e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3e678e['role']===_0x2bbc('0x4c')){var _0x3b8223=_0x2fe5a5[_0x2bbc('0x26')]({'plain':!![]});var _0x488320='Variables';return db[_0x2bbc('0x4d')]['find']({'where':{'name':_0x488320,'userProfileId':_0x3e678e[_0x2bbc('0x4e')]},'raw':!![]})[_0x2bbc('0x24')](function(_0x1aaaed){if(_0x1aaaed&&_0x1aaaed[_0x2bbc('0x4f')]===0x0){return db['UserProfileResource'][_0x2bbc('0x50')]({'name':_0x3b8223[_0x2bbc('0x2a')],'resourceId':_0x3b8223['id'],'type':_0x1aaaed[_0x2bbc('0x2a')],'sectionId':_0x1aaaed['id']},{})['then'](function(){return _0x2fe5a5;});}else{return _0x2fe5a5;}})[_0x2bbc('0x45')](function(_0x30475b){logger[_0x2bbc('0x28')](_0x2bbc('0x51'),_0x30475b);throw _0x30475b;});}return _0x2fe5a5;})[_0x2bbc('0x24')](respondWithResult(_0x18a57a,0xc9))['catch'](handleError(_0x18a57a,null));};exports[_0x2bbc('0x23')]=function(_0x26251c,_0x36c535){if(_0x26251c['body']['id']){delete _0x26251c[_0x2bbc('0x52')]['id'];}return db[_0x2bbc('0x2d')][_0x2bbc('0x4b')]({'where':{'id':_0x26251c[_0x2bbc('0x47')]['id']}})[_0x2bbc('0x24')](handleEntityNotFound(_0x36c535,null))[_0x2bbc('0x24')](saveUpdates(_0x26251c['body'],null))[_0x2bbc('0x24')](respondWithResult(_0x36c535,null))['catch'](handleError(_0x36c535,null));};exports[_0x2bbc('0x25')]=function(_0x22064c,_0x583dd6){return db[_0x2bbc('0x2d')]['find']({'where':{'id':_0x22064c[_0x2bbc('0x47')]['id']}})['then'](handleEntityNotFound(_0x583dd6,null))['then'](removeEntity(_0x583dd6,null))[_0x2bbc('0x45')](handleError(_0x583dd6,null));}; \ No newline at end of file +var _0x89db=['merge','filter','include','findAll','rows','catch','show','includeAll','options','create','body','user','role','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','get','Variables','UserProfileResource','error','stack','name','index','Variable','rawAttributes','fieldName','type','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters'];(function(_0x335665,_0x2c20a5){var _0x2202a1=function(_0x1e1d3d){while(--_0x1e1d3d){_0x335665['push'](_0x335665['shift']());}};_0x2202a1(++_0x2c20a5);}(_0x89db,0x192));var _0xb89d=function(_0xe47aed,_0x3f7ff9){_0xe47aed=_0xe47aed-0x0;var _0x36eea5=_0x89db[_0xe47aed];return _0x36eea5;};'use strict';var emlformat=require(_0xb89d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb89d('0x1'));var moment=require('moment');var BPromise=require(_0xb89d('0x2'));var Mustache=require(_0xb89d('0x3'));var util=require('util');var path=require(_0xb89d('0x4'));var sox=require('sox');var csv=require(_0xb89d('0x5'));var ejs=require(_0xb89d('0x6'));var fs=require('fs');var fs_extra=require(_0xb89d('0x7'));var _=require(_0xb89d('0x8'));var squel=require('squel');var crypto=require(_0xb89d('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xb89d('0xa'));var toCsv=require(_0xb89d('0x5'));var querystring=require('querystring');var Papa=require(_0xb89d('0xb'));var Redis=require(_0xb89d('0xc'));var authService=require(_0xb89d('0xd'));var qs=require(_0xb89d('0xe'));var as=require(_0xb89d('0xf'));var hardwareService=require(_0xb89d('0x10'));var logger=require(_0xb89d('0x11'))(_0xb89d('0x12'));var utils=require('../../config/utils');var config=require(_0xb89d('0x13'));var licenseUtil=require(_0xb89d('0x14'));var db=require(_0xb89d('0x15'))['db'];function respondWithStatusCode(_0x5020c1,_0x5bad7e){_0x5bad7e=_0x5bad7e||0xcc;return function(_0xfc13eb){if(_0xfc13eb){return _0x5020c1[_0xb89d('0x16')](_0x5bad7e);}return _0x5020c1[_0xb89d('0x17')](_0x5bad7e)[_0xb89d('0x18')]();};}function respondWithResult(_0x274902,_0x1d1f84){_0x1d1f84=_0x1d1f84||0xc8;return function(_0x3fb8b8){if(_0x3fb8b8){return _0x274902[_0xb89d('0x17')](_0x1d1f84)[_0xb89d('0x19')](_0x3fb8b8);}};}function respondWithFilteredResult(_0x40fa87,_0x3f3dd5){return function(_0x1d89e8){if(_0x1d89e8){var _0x46782b=typeof _0x3f3dd5[_0xb89d('0x1a')]===_0xb89d('0x1b')&&typeof _0x3f3dd5[_0xb89d('0x1c')]==='undefined';var _0x2e3678=_0x1d89e8[_0xb89d('0x1d')];var _0x48d2d0=_0x46782b?0x0:_0x3f3dd5['offset'];var _0xac3112=_0x46782b?_0x1d89e8[_0xb89d('0x1d')]:_0x3f3dd5[_0xb89d('0x1a')]+_0x3f3dd5[_0xb89d('0x1c')];var _0x2f91bb;if(_0xac3112>=_0x2e3678){_0xac3112=_0x2e3678;_0x2f91bb=0xc8;}else{_0x2f91bb=0xce;}_0x40fa87['status'](_0x2f91bb);return _0x40fa87['set'](_0xb89d('0x1e'),_0x48d2d0+'-'+_0xac3112+'/'+_0x2e3678)[_0xb89d('0x19')](_0x1d89e8);}return null;};}function patchUpdates(_0x5b88e3){return function(_0x57da6e){try{jsonpatch[_0xb89d('0x1f')](_0x57da6e,_0x5b88e3,!![]);}catch(_0x26dae3){return BPromise[_0xb89d('0x20')](_0x26dae3);}return _0x57da6e['save']();};}function saveUpdates(_0x279fa0,_0x3bc06b){return function(_0x4e6991){if(_0x4e6991){return _0x4e6991[_0xb89d('0x21')](_0x279fa0)[_0xb89d('0x22')](function(_0x26bd53){return _0x26bd53;});}return null;};}function removeEntity(_0x477889,_0x2f8737){return function(_0x58afba){if(_0x58afba){return _0x58afba[_0xb89d('0x23')]()[_0xb89d('0x22')](function(){var _0x594fd6=_0x58afba[_0xb89d('0x24')]({'plain':!![]});var _0x1ec942=_0xb89d('0x25');return db[_0xb89d('0x26')][_0xb89d('0x23')]({'where':{'type':_0x1ec942,'resourceId':_0x594fd6['id']}})[_0xb89d('0x22')](function(){return _0x58afba;});})[_0xb89d('0x22')](function(){_0x477889[_0xb89d('0x17')](0xcc)[_0xb89d('0x18')]();});}};}function handleEntityNotFound(_0x29ec57,_0x14b930){return function(_0x1e73b3){if(!_0x1e73b3){_0x29ec57[_0xb89d('0x16')](0x194);}return _0x1e73b3;};}function handleError(_0x1fe403,_0xac9bb9){_0xac9bb9=_0xac9bb9||0x1f4;return function(_0xfdb4e6){logger[_0xb89d('0x27')](_0xfdb4e6[_0xb89d('0x28')]);if(_0xfdb4e6[_0xb89d('0x29')]){delete _0xfdb4e6['name'];}_0x1fe403[_0xb89d('0x17')](_0xac9bb9)['send'](_0xfdb4e6);};}exports[_0xb89d('0x2a')]=function(_0x42b9c6,_0x39c39b){var _0x17a98d={},_0x4f6e48={},_0x5c05c6={'count':0x0,'rows':[]};var _0xc9c9c9=_['map'](db[_0xb89d('0x2b')][_0xb89d('0x2c')],function(_0x16738c){return{'name':_0x16738c[_0xb89d('0x2d')],'type':_0x16738c[_0xb89d('0x2e')]['key']};});_0x4f6e48[_0xb89d('0x2f')]=_[_0xb89d('0x30')](_0xc9c9c9,'name');_0x4f6e48[_0xb89d('0x31')]=_[_0xb89d('0x32')](_0x42b9c6[_0xb89d('0x31')]);_0x4f6e48['filters']=_[_0xb89d('0x33')](_0x4f6e48[_0xb89d('0x2f')],_0x4f6e48[_0xb89d('0x31')]);_0x17a98d[_0xb89d('0x34')]=_['intersection'](_0x4f6e48[_0xb89d('0x2f')],qs[_0xb89d('0x35')](_0x42b9c6[_0xb89d('0x31')][_0xb89d('0x35')]));_0x17a98d[_0xb89d('0x34')]=_0x17a98d[_0xb89d('0x34')]['length']?_0x17a98d[_0xb89d('0x34')]:_0x4f6e48[_0xb89d('0x2f')];if(!_0x42b9c6[_0xb89d('0x31')][_0xb89d('0x36')](_0xb89d('0x37'))){_0x17a98d[_0xb89d('0x1c')]=qs[_0xb89d('0x1c')](_0x42b9c6[_0xb89d('0x31')][_0xb89d('0x1c')]);_0x17a98d['offset']=qs[_0xb89d('0x1a')](_0x42b9c6[_0xb89d('0x31')][_0xb89d('0x1a')]);}_0x17a98d[_0xb89d('0x38')]=qs[_0xb89d('0x39')](_0x42b9c6['query'][_0xb89d('0x39')]);_0x17a98d[_0xb89d('0x3a')]=qs[_0xb89d('0x3b')](_['pick'](_0x42b9c6[_0xb89d('0x31')],_0x4f6e48[_0xb89d('0x3b')]),_0xc9c9c9);if(_0x42b9c6[_0xb89d('0x31')]['filter']){_0x17a98d[_0xb89d('0x3a')]=_[_0xb89d('0x3c')](_0x17a98d['where'],{'$or':_['map'](_0xc9c9c9,function(_0x3b2427){if(_0x3b2427[_0xb89d('0x2e')]!=='VIRTUAL'){var _0x255be1={};_0x255be1[_0x3b2427[_0xb89d('0x29')]]={'$like':'%'+_0x42b9c6[_0xb89d('0x31')][_0xb89d('0x3d')]+'%'};return _0x255be1;}})});}_0x17a98d=_[_0xb89d('0x3c')]({},_0x17a98d,_0x42b9c6['options']);var _0x6eb04b={'where':_0x17a98d[_0xb89d('0x3a')]};return db[_0xb89d('0x2b')][_0xb89d('0x1d')](_0x6eb04b)[_0xb89d('0x22')](function(_0x11d86f){_0x5c05c6[_0xb89d('0x1d')]=_0x11d86f;if(_0x42b9c6['query']['includeAll']){_0x17a98d[_0xb89d('0x3e')]=[{'all':!![]}];}return db['Variable'][_0xb89d('0x3f')](_0x17a98d);})['then'](function(_0x1364a9){_0x5c05c6[_0xb89d('0x40')]=_0x1364a9;return _0x5c05c6;})[_0xb89d('0x22')](respondWithFilteredResult(_0x39c39b,_0x17a98d))[_0xb89d('0x41')](handleError(_0x39c39b,null));};exports[_0xb89d('0x42')]=function(_0x4b8684,_0x664ac0){var _0x388788={'raw':!![],'where':{'id':_0x4b8684['params']['id']}},_0x2077d4={};_0x2077d4['model']=_[_0xb89d('0x32')](db[_0xb89d('0x2b')][_0xb89d('0x2c')]);_0x2077d4[_0xb89d('0x31')]=_[_0xb89d('0x32')](_0x4b8684[_0xb89d('0x31')]);_0x2077d4[_0xb89d('0x3b')]=_[_0xb89d('0x33')](_0x2077d4[_0xb89d('0x2f')],_0x2077d4[_0xb89d('0x31')]);_0x388788[_0xb89d('0x34')]=_[_0xb89d('0x33')](_0x2077d4[_0xb89d('0x2f')],qs['fields'](_0x4b8684['query']['fields']));_0x388788[_0xb89d('0x34')]=_0x388788['attributes']['length']?_0x388788[_0xb89d('0x34')]:_0x2077d4[_0xb89d('0x2f')];if(_0x4b8684[_0xb89d('0x31')][_0xb89d('0x43')]){_0x388788[_0xb89d('0x3e')]=[{'all':!![]}];}_0x388788=_[_0xb89d('0x3c')]({},_0x388788,_0x4b8684[_0xb89d('0x44')]);return db[_0xb89d('0x2b')]['find'](_0x388788)[_0xb89d('0x22')](handleEntityNotFound(_0x664ac0,null))['then'](respondWithResult(_0x664ac0,null))[_0xb89d('0x41')](handleError(_0x664ac0,null));};exports[_0xb89d('0x45')]=function(_0x47eda6,_0x6f97e7){return db[_0xb89d('0x2b')][_0xb89d('0x45')](_0x47eda6[_0xb89d('0x46')],{})['then'](function(_0x4620dc){var _0x47a928=_0x47eda6[_0xb89d('0x47')][_0xb89d('0x24')]({'plain':!![]});if(!_0x47a928)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x47a928[_0xb89d('0x48')]==='user'){var _0x579e9e=_0x4620dc['get']({'plain':!![]});var _0x85b589='Variables';return db['UserProfileSection'][_0xb89d('0x49')]({'where':{'name':_0x85b589,'userProfileId':_0x47a928['userProfileId']},'raw':!![]})[_0xb89d('0x22')](function(_0x4328dc){if(_0x4328dc&&_0x4328dc[_0xb89d('0x4a')]===0x0){return db[_0xb89d('0x26')][_0xb89d('0x45')]({'name':_0x579e9e[_0xb89d('0x29')],'resourceId':_0x579e9e['id'],'type':_0x4328dc['name'],'sectionId':_0x4328dc['id']},{})[_0xb89d('0x22')](function(){return _0x4620dc;});}else{return _0x4620dc;}})[_0xb89d('0x41')](function(_0x4c1df9){logger['error'](_0xb89d('0x4b'),_0x4c1df9);throw _0x4c1df9;});}return _0x4620dc;})[_0xb89d('0x22')](respondWithResult(_0x6f97e7,0xc9))['catch'](handleError(_0x6f97e7,null));};exports[_0xb89d('0x21')]=function(_0x7d1092,_0x34b3ea){if(_0x7d1092['body']['id']){delete _0x7d1092[_0xb89d('0x46')]['id'];}return db[_0xb89d('0x2b')]['find']({'where':{'id':_0x7d1092[_0xb89d('0x4c')]['id']}})[_0xb89d('0x22')](handleEntityNotFound(_0x34b3ea,null))['then'](saveUpdates(_0x7d1092[_0xb89d('0x46')],null))[_0xb89d('0x22')](respondWithResult(_0x34b3ea,null))[_0xb89d('0x41')](handleError(_0x34b3ea,null));};exports[_0xb89d('0x23')]=function(_0x576c4e,_0x4056fe){return db[_0xb89d('0x2b')][_0xb89d('0x49')]({'where':{'id':_0x576c4e['params']['id']}})[_0xb89d('0x22')](handleEntityNotFound(_0x4056fe,null))[_0xb89d('0x22')](removeEntity(_0x4056fe,null))[_0xb89d('0x41')](handleError(_0x4056fe,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 7b8ed75..91474e0 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 _0x6af9=['path','rimraf','../../config/environment','./variable.attributes','exports','define','Variable','lodash','util','api','request-promise'];(function(_0x25549f,_0x1d4623){var _0x1bf507=function(_0x26ffb5){while(--_0x26ffb5){_0x25549f['push'](_0x25549f['shift']());}};_0x1bf507(++_0x1d4623);}(_0x6af9,0x1a9));var _0x96af=function(_0x3b5766,_0x21de63){_0x3b5766=_0x3b5766-0x0;var _0x14968f=_0x6af9[_0x3b5766];return _0x14968f;};'use strict';var _=require(_0x96af('0x0'));var util=require(_0x96af('0x1'));var logger=require('../../config/logger')(_0x96af('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x96af('0x3'));var fs=require('fs');var path=require(_0x96af('0x4'));var rimraf=require(_0x96af('0x5'));var config=require(_0x96af('0x6'));var attributes=require(_0x96af('0x7'));module[_0x96af('0x8')]=function(_0x5a31ee,_0x35c72e){return _0x5a31ee[_0x96af('0x9')](_0x96af('0xa'),attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf70f=['exports','define','tools_variables','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./variable.attributes'];(function(_0x2c32fb,_0x45b9a8){var _0x1f2836=function(_0x277504){while(--_0x277504){_0x2c32fb['push'](_0x2c32fb['shift']());}};_0x1f2836(++_0x45b9a8);}(_0xf70f,0x1ef));var _0xff70=function(_0x53594d,_0xb372ae){_0x53594d=_0x53594d-0x0;var _0x3b2544=_0xf70f[_0x53594d];return _0x3b2544;};'use strict';var _=require(_0xff70('0x0'));var util=require('util');var logger=require(_0xff70('0x1'))('api');var moment=require(_0xff70('0x2'));var BPromise=require(_0xff70('0x3'));var rp=require(_0xff70('0x4'));var fs=require('fs');var path=require(_0xff70('0x5'));var rimraf=require(_0xff70('0x6'));var config=require(_0xff70('0x7'));var attributes=require(_0xff70('0x8'));module[_0xff70('0x9')]=function(_0x2b12c2,_0x58ce4f){return _0x2b12c2[_0xff70('0xa')]('Variable',attributes,{'tableName':_0xff70('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/variable/variable.rpc.js b/server/api/variable/variable.rpc.js index 386598e..692ff99 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 _0x3e74=['catch','Variable','find','options','raw','where','attributes','include','map','model','then','ShowVariable','stringify','lodash','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','error','Variable,\x20%s,\x20%s','message','info'];(function(_0x5ecc63,_0x110d0d){var _0x56e65f=function(_0x138202){while(--_0x138202){_0x5ecc63['push'](_0x5ecc63['shift']());}};_0x56e65f(++_0x110d0d);}(_0x3e74,0x175));var _0x43e7=function(_0x542f70,_0xdce472){_0x542f70=_0x542f70-0x0;var _0x429b6e=_0x3e74[_0x542f70];return _0x429b6e;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var moment=require(_0x43e7('0x1'));var BPromise=require(_0x43e7('0x2'));var rs=require(_0x43e7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x43e7('0x4'));var logger=require('../../config/logger')(_0x43e7('0x5'));var config=require(_0x43e7('0x6'));var jayson=require(_0x43e7('0x7'));var client=jayson[_0x43e7('0x8')][_0x43e7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x503698,_0x45a0d1,_0x3491d6){return new BPromise(function(_0x2ede2d,_0x8528fc){return client[_0x43e7('0xa')](_0x503698,_0x3491d6)['then'](function(_0x212c6c){logger['info']('Variable,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'));logger[_0x43e7('0xc')]('Variable,\x20%s,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'),JSON['stringify'](_0x212c6c));if(_0x212c6c[_0x43e7('0xd')]){if(_0x212c6c[_0x43e7('0xd')]['code']===0x1f4){logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')][_0x43e7('0xf')]);return _0x8528fc(_0x212c6c['error']['message']);}logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')]['message']);return _0x2ede2d(_0x212c6c['error'][_0x43e7('0xf')]);}else{logger[_0x43e7('0x10')](_0x43e7('0xe'),_0x45a0d1,_0x43e7('0xb'));_0x2ede2d(_0x212c6c['result']['message']);}})[_0x43e7('0x11')](function(_0x264575){logger[_0x43e7('0xd')]('Variable,\x20%s,\x20%s',_0x45a0d1,_0x264575);_0x8528fc(_0x264575);});});}exports['ShowVariable']=function(_0x446986){var _0x1ca758=this;return new Promise(function(_0x9037d3,_0x140657){return db[_0x43e7('0x12')][_0x43e7('0x13')]({'raw':_0x446986[_0x43e7('0x14')]?_0x446986[_0x43e7('0x14')][_0x43e7('0x15')]===undefined?!![]:![]:!![],'where':_0x446986[_0x43e7('0x14')]?_0x446986[_0x43e7('0x14')][_0x43e7('0x16')]||null:null,'attributes':_0x446986['options']?_0x446986[_0x43e7('0x14')][_0x43e7('0x17')]||null:null,'include':_0x446986['options']?_0x446986[_0x43e7('0x14')][_0x43e7('0x18')]?_[_0x43e7('0x19')](_0x446986[_0x43e7('0x14')][_0x43e7('0x18')],function(_0x2f4cb4){return{'model':db[_0x2f4cb4['model']],'as':_0x2f4cb4['as'],'attributes':_0x2f4cb4[_0x43e7('0x17')],'include':_0x2f4cb4['include']?_['map'](_0x2f4cb4[_0x43e7('0x18')],function(_0x43f4ff){return{'model':db[_0x43f4ff['model']],'as':_0x43f4ff['as'],'attributes':_0x43f4ff[_0x43e7('0x17')],'include':_0x43f4ff['include']?_[_0x43e7('0x19')](_0x43f4ff['include'],function(_0x1af208){return{'model':db[_0x1af208[_0x43e7('0x1a')]],'as':_0x1af208['as'],'attributes':_0x1af208[_0x43e7('0x17')]};}):[]};}):[]};}):[]:[]})[_0x43e7('0x1b')](function(_0x51f4d7){logger['info'](_0x43e7('0x1c'),_0x446986);logger['debug'](_0x43e7('0x1c'),_0x446986,JSON[_0x43e7('0x1d')](_0x51f4d7));_0x9037d3(_0x51f4d7);})[_0x43e7('0x11')](function(_0xb1fc63){logger['error'](_0x43e7('0x1c'),_0xb1fc63[_0x43e7('0xf')],_0x446986);_0x140657(_0x1ca758[_0x43e7('0xd')](0x1f4,_0xb1fc63[_0x43e7('0xf')]));});});}; \ No newline at end of file +var _0x814b=['model','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ShowVariable','options','where','include','map','attributes'];(function(_0x362f58,_0xa5f36e){var _0x5ebd20=function(_0xa7fdf5){while(--_0xa7fdf5){_0x362f58['push'](_0x362f58['shift']());}};_0x5ebd20(++_0xa5f36e);}(_0x814b,0x1a2));var _0xb814=function(_0x5e2b34,_0x58385c){_0x5e2b34=_0x5e2b34-0x0;var _0x4859f9=_0x814b[_0x5e2b34];return _0x4859f9;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('Variable,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});}exports[_0xb814('0x18')]=function(_0x55ba16){var _0x270598=this;return new Promise(function(_0xfac75b,_0x4c3007){return db['Variable']['find']({'raw':_0x55ba16[_0xb814('0x19')]?_0x55ba16['options']['raw']===undefined?!![]:![]:!![],'where':_0x55ba16[_0xb814('0x19')]?_0x55ba16[_0xb814('0x19')][_0xb814('0x1a')]||null:null,'attributes':_0x55ba16['options']?_0x55ba16[_0xb814('0x19')]['attributes']||null:null,'include':_0x55ba16[_0xb814('0x19')]?_0x55ba16[_0xb814('0x19')][_0xb814('0x1b')]?_[_0xb814('0x1c')](_0x55ba16[_0xb814('0x19')][_0xb814('0x1b')],function(_0x1f5d40){return{'model':db[_0x1f5d40['model']],'as':_0x1f5d40['as'],'attributes':_0x1f5d40[_0xb814('0x1d')],'include':_0x1f5d40['include']?_[_0xb814('0x1c')](_0x1f5d40[_0xb814('0x1b')],function(_0x31c7ec){return{'model':db[_0x31c7ec[_0xb814('0x1e')]],'as':_0x31c7ec['as'],'attributes':_0x31c7ec[_0xb814('0x1d')],'include':_0x31c7ec[_0xb814('0x1b')]?_[_0xb814('0x1c')](_0x31c7ec['include'],function(_0x392222){return{'model':db[_0x392222[_0xb814('0x1e')]],'as':_0x392222['as'],'attributes':_0x392222[_0xb814('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xb814('0xd')](function(_0x32ed56){logger[_0xb814('0xe')](_0xb814('0x18'),_0x55ba16);logger[_0xb814('0x11')]('ShowVariable',_0x55ba16,JSON[_0xb814('0x1f')](_0x32ed56));_0xfac75b(_0x32ed56);})[_0xb814('0x17')](function(_0x52ed64){logger[_0xb814('0x13')](_0xb814('0x18'),_0x52ed64[_0xb814('0x15')],_0x55ba16);_0x4c3007(_0x270598['error'](0x1f4,_0x52ed64[_0xb814('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 0cd65c3..9c75685 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 _0xb922=['Router','./version.controller','get','index','fetch','/reset','reset','/pull','canUpdate','pull','/restart','isAuthenticated','migrations','exports','express'];(function(_0x31ace8,_0x3f96e3){var _0x343b1f=function(_0x55eef3){while(--_0x55eef3){_0x31ace8['push'](_0x31ace8['shift']());}};_0x343b1f(++_0x3f96e3);}(_0xb922,0x13a));var _0x2b92=function(_0x5c1932,_0x5b1a24){_0x5c1932=_0x5c1932-0x0;var _0x2e8728=_0xb922[_0x5c1932];return _0x2e8728;};'use strict';var express=require(_0x2b92('0x0'));var router=express[_0x2b92('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x2b92('0x2'));router[_0x2b92('0x3')]('/',controller[_0x2b92('0x4')]);router[_0x2b92('0x3')]('/fetch',auth['isAuthenticated'](),auth['canUpdate'](),controller[_0x2b92('0x5')]);router[_0x2b92('0x3')](_0x2b92('0x6'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0x2b92('0x7')]);router[_0x2b92('0x3')](_0x2b92('0x8'),auth['isAuthenticated'](),auth[_0x2b92('0x9')](),controller[_0x2b92('0xa')]);router['get'](_0x2b92('0xb'),auth[_0x2b92('0xc')](),controller['restart']);router[_0x2b92('0x3')]('/migrations',controller[_0x2b92('0xd')]);module[_0x2b92('0xe')]=router; \ No newline at end of file +var _0x982e=['/migrations','migrations','exports','express','Router','../../components/auth/service','./version.controller','get','index','/fetch','isAuthenticated','canUpdate','/pull','pull','/restart'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x982e,0x1d4));var _0xe982=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x982e[_0x40a045];return _0x1a687c;};'use strict';var express=require(_0xe982('0x0'));var router=express[_0xe982('0x1')]();var auth=require(_0xe982('0x2'));var controller=require(_0xe982('0x3'));router[_0xe982('0x4')]('/',controller[_0xe982('0x5')]);router[_0xe982('0x4')](_0xe982('0x6'),auth[_0xe982('0x7')](),auth[_0xe982('0x8')](),controller['fetch']);router[_0xe982('0x4')]('/reset',auth[_0xe982('0x7')](),auth[_0xe982('0x8')](),controller['reset']);router['get'](_0xe982('0x9'),auth[_0xe982('0x7')](),auth['canUpdate'](),controller[_0xe982('0xa')]);router[_0xe982('0x4')](_0xe982('0xb'),auth[_0xe982('0x7')](),controller['restart']);router[_0xe982('0x4')](_0xe982('0xc'),controller[_0xe982('0xd')]);module[_0xe982('0xe')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index ad9df28..f25661b 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 _0x2c50=['git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','readdirSync','join','server','replace','.js','exports','push','sort','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','Database\x20already\x20up-to-date','path','lodash','pkginfo','version','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','simple-git','index','query','latest','2.0.0','status','json','fetch','origin','master','error','reset','--hard','FETCH_HEAD','info','git\x20reset\x20--hard\x20FETCH_HEAD'];(function(_0x329efe,_0x2b8cb1){var _0x2faf5a=function(_0x1cd8e1){while(--_0x1cd8e1){_0x329efe['push'](_0x329efe['shift']());}};_0x2faf5a(++_0x2b8cb1);}(_0x2c50,0x84));var _0x02c5=function(_0x466af7,_0x2f7551){_0x466af7=_0x466af7-0x0;var _0x348c96=_0x2c50[_0x466af7];return _0x348c96;};'use strict';var Umzug=require('umzug');var path=require(_0x02c5('0x0'));var fs=require('fs');var _=require(_0x02c5('0x1'));var pkginfo=require(_0x02c5('0x2'))(module,_0x02c5('0x3'));var compareVersions=require(_0x02c5('0x4'));var exec=require(_0x02c5('0x5'))[_0x02c5('0x6')];var db=require(_0x02c5('0x7'))['db'];var config=require(_0x02c5('0x8'));var pm2=require(_0x02c5('0x9'));var logger=require(_0x02c5('0xa'))('update');var git=require(_0x02c5('0xb'))(config['root']);exports[_0x02c5('0xc')]=function(_0x7ecf5d,_0x423f01){var _0x106d48={'current':module['exports'][_0x02c5('0x3')],'phonebar':0x2};if(_0x7ecf5d[_0x02c5('0xd')]&&_0x7ecf5d['query'][_0x02c5('0xe')]){return git['fetch']()['tags'](function(_0x5581ad,_0x5bd635){_0x106d48[_0x02c5('0xe')]=(_0x5581ad?module['exports'][_0x02c5('0x3')]:_0x5bd635[_0x02c5('0xe')])||_0x02c5('0xf');return _0x423f01[_0x02c5('0x10')](0xc8)['json'](_0x106d48);});}else{return _0x423f01['status'](0xc8)[_0x02c5('0x11')](_0x106d48);}};exports[_0x02c5('0x12')]=function(_0x1e6f83,_0x14c365){return git[_0x02c5('0x12')]([_0x02c5('0x13'),_0x02c5('0x14')],function(_0x531e3f){if(_0x531e3f){logger[_0x02c5('0x15')](_0x531e3f);return _0x14c365['status'](0x1f4)[_0x02c5('0x11')](_0x531e3f);}logger['info']('git\x20fetch');return _0x14c365[_0x02c5('0x10')](0xc8)[_0x02c5('0x11')]({'output':'git\x20fetch\x20origin\x20master'});});};exports['reset']=function(_0x46dfd0,_0x2cde11){return git[_0x02c5('0x16')]([_0x02c5('0x17'),_0x02c5('0x18')],function(_0x412a3f){if(_0x412a3f){logger[_0x02c5('0x15')](_0x412a3f);return _0x2cde11[_0x02c5('0x10')](0x1f4)[_0x02c5('0x11')](_0x412a3f);}logger[_0x02c5('0x19')](_0x02c5('0x1a'));return _0x2cde11[_0x02c5('0x10')](0xc8)['json']({'output':_0x02c5('0x1b')});});};exports[_0x02c5('0x1c')]=function(_0x3df775,_0x564f2c){exec(_0x02c5('0x1d'),function(_0x279e94,_0x29cd2b,_0x514c3a){logger[_0x02c5('0x19')](_0x29cd2b);logger['info'](_0x514c3a);if(_0x279e94){logger[_0x02c5('0x15')](_0x279e94);return _0x564f2c[_0x02c5('0x10')](0x1f4)[_0x02c5('0x11')](_0x279e94);}return _0x564f2c['status'](0xc8)[_0x02c5('0x11')]({'output':_0x29cd2b});});};exports[_0x02c5('0x1e')]=function(_0x212d6a,_0x1a8742){return pm2['restart']('motion2')[_0x02c5('0x1f')](function(_0x272456){logger[_0x02c5('0x19')](_0x02c5('0x20'),_0x272456);return _0x1a8742[_0x02c5('0x10')](0xc8)[_0x02c5('0x11')]({'output':_0x02c5('0x21')});})['catch'](function(_0x376953){logger[_0x02c5('0x15')](_0x376953);return _0x1a8742[_0x02c5('0x10')](0x1f4)['json'](_0x376953);});};exports[_0x02c5('0x22')]=function(_0x11b4c0,_0x287dc5){var _0x116a76=fs[_0x02c5('0x23')](path[_0x02c5('0x24')](config['root'],_0x02c5('0x25'),_0x02c5('0x22')));var _0x2d6517=[];for(var _0x4e7947=0x0;_0x4e7947<_0x116a76['length'];_0x4e7947++){var _0x5eefa7=_0x116a76[_0x4e7947][_0x02c5('0x26')](_0x02c5('0x27'),'');if(compareVersions(module[_0x02c5('0x28')][_0x02c5('0x3')],_0x5eefa7)===-0x1){_0x2d6517[_0x02c5('0x29')](_0x5eefa7);}}if(_0x2d6517['length']){var _0x2a8025=_0x2d6517[_0x02c5('0x2a')](compareVersions);var _0x4ff1e7=new Umzug({'storage':_0x02c5('0x2b'),'storageOptions':{'model':db[_0x02c5('0x2c')],'modelName':_0x02c5('0x2c'),'columnName':_0x02c5('0x3')},'migrations':{'params':[db[_0x02c5('0x2b')][_0x02c5('0x2d')](),db[_0x02c5('0x2b')][_0x02c5('0x2e')],function(){throw new Error(_0x02c5('0x2f'));}],'path':path[_0x02c5('0x24')](config['root'],_0x02c5('0x25'),_0x02c5('0x22')),'pattern':/\.js$/}});_0x4ff1e7['up']({'migrations':_[_0x02c5('0x30')](_0x2a8025,function(_0xbdc335){return _0xbdc335+_0x02c5('0x27');})})[_0x02c5('0x1f')](function(){return _0x287dc5[_0x02c5('0x10')](0xc8)['json']({'output':_0x02c5('0x31')+module[_0x02c5('0x28')][_0x02c5('0x3')]+_0x02c5('0x32')+_[_0x02c5('0x33')](_0x2a8025),'migrations':_[_0x02c5('0x24')](_0x2a8025)});})['catch'](function(_0x22010b){if(_0x22010b instanceof db[_0x02c5('0x2b')]['UniqueConstraintError']){return _0x287dc5[_0x02c5('0x10')](0xc8)[_0x02c5('0x11')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x287dc5[_0x02c5('0x10')](0x1f4)[_0x02c5('0x11')](_0x22010b);}});}else{return _0x287dc5[_0x02c5('0x10')](0xc8)[_0x02c5('0x11')]({'output':_0x02c5('0x34')});}}; \ No newline at end of file +var _0x5402=['Database\x20migrated\x20successfully\x20from\x20version\x20','join','UniqueConstraintError','Database\x20already\x20up-to-date','version','compare-versions','exec','../../mysqldb','../../config/pm2','../../config/logger','root','query','fetch','tags','latest','exports','2.0.0','json','origin','master','error','status','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','pull','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','server','replace','length','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.','.js'];(function(_0x2946d0,_0x2a777a){var _0x5ce534=function(_0x576849){while(--_0x576849){_0x2946d0['push'](_0x2946d0['shift']());}};_0x5ce534(++_0x2a777a);}(_0x5402,0x1da));var _0x2540=function(_0x5b1fa7,_0x34bb1b){_0x5b1fa7=_0x5b1fa7-0x0;var _0x60c0f2=_0x5402[_0x5b1fa7];return _0x60c0f2;};'use strict';var Umzug=require('umzug');var path=require('path');var fs=require('fs');var _=require('lodash');var pkginfo=require('pkginfo')(module,_0x2540('0x0'));var compareVersions=require(_0x2540('0x1'));var exec=require('child_process')[_0x2540('0x2')];var db=require(_0x2540('0x3'))['db'];var config=require('../../config/environment');var pm2=require(_0x2540('0x4'));var logger=require(_0x2540('0x5'))('update');var git=require('simple-git')(config[_0x2540('0x6')]);exports['index']=function(_0x3371a6,_0x14f81c){var _0x2ece7e={'current':module['exports'][_0x2540('0x0')],'phonebar':0x2};if(_0x3371a6[_0x2540('0x7')]&&_0x3371a6[_0x2540('0x7')]['latest']){return git[_0x2540('0x8')]()[_0x2540('0x9')](function(_0x44b983,_0x4c6d03){_0x2ece7e[_0x2540('0xa')]=(_0x44b983?module[_0x2540('0xb')][_0x2540('0x0')]:_0x4c6d03[_0x2540('0xa')])||_0x2540('0xc');return _0x14f81c['status'](0xc8)[_0x2540('0xd')](_0x2ece7e);});}else{return _0x14f81c['status'](0xc8)[_0x2540('0xd')](_0x2ece7e);}};exports['fetch']=function(_0x5147c4,_0x258a70){return git[_0x2540('0x8')]([_0x2540('0xe'),_0x2540('0xf')],function(_0x5082d5){if(_0x5082d5){logger[_0x2540('0x10')](_0x5082d5);return _0x258a70[_0x2540('0x11')](0x1f4)[_0x2540('0xd')](_0x5082d5);}logger[_0x2540('0x12')](_0x2540('0x13'));return _0x258a70[_0x2540('0x11')](0xc8)['json']({'output':_0x2540('0x14')});});};exports[_0x2540('0x15')]=function(_0x5de8ff,_0x45c741){return git[_0x2540('0x15')]([_0x2540('0x16'),_0x2540('0x17')],function(_0x518cc5){if(_0x518cc5){logger[_0x2540('0x10')](_0x518cc5);return _0x45c741['status'](0x1f4)[_0x2540('0xd')](_0x518cc5);}logger[_0x2540('0x12')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x45c741[_0x2540('0x11')](0xc8)['json']({'output':'git\x20reset\x20--hard'});});};exports[_0x2540('0x18')]=function(_0x4cf6da,_0x3f04bf){exec(_0x2540('0x19'),function(_0x20ef41,_0x2e0290,_0x49b0a4){logger[_0x2540('0x12')](_0x2e0290);logger['info'](_0x49b0a4);if(_0x20ef41){logger[_0x2540('0x10')](_0x20ef41);return _0x3f04bf[_0x2540('0x11')](0x1f4)[_0x2540('0xd')](_0x20ef41);}return _0x3f04bf[_0x2540('0x11')](0xc8)[_0x2540('0xd')]({'output':_0x2e0290});});};exports[_0x2540('0x1a')]=function(_0x4dfcc6,_0x542550){return pm2[_0x2540('0x1a')](_0x2540('0x1b'))[_0x2540('0x1c')](function(_0x416760){logger['info'](_0x2540('0x1d'),_0x416760);return _0x542550['status'](0xc8)[_0x2540('0xd')]({'output':_0x2540('0x1e')});})[_0x2540('0x1f')](function(_0x5b75eb){logger[_0x2540('0x10')](_0x5b75eb);return _0x542550[_0x2540('0x11')](0x1f4)['json'](_0x5b75eb);});};exports[_0x2540('0x20')]=function(_0x291d7a,_0x2c6742){var _0x13fd12=fs[_0x2540('0x21')](path['join'](config[_0x2540('0x6')],_0x2540('0x22'),_0x2540('0x20')));var _0x1bad46=[];for(var _0x373391=0x0;_0x373391<_0x13fd12['length'];_0x373391++){var _0x291158=_0x13fd12[_0x373391][_0x2540('0x23')]('.js','');if(compareVersions(module[_0x2540('0xb')][_0x2540('0x0')],_0x291158)===-0x1){_0x1bad46['push'](_0x291158);}}if(_0x1bad46[_0x2540('0x24')]){var _0x554e88=_0x1bad46[_0x2540('0x25')](compareVersions);var _0x2d28e4=new Umzug({'storage':_0x2540('0x26'),'storageOptions':{'model':db[_0x2540('0x27')],'modelName':_0x2540('0x27'),'columnName':_0x2540('0x0')},'migrations':{'params':[db[_0x2540('0x26')]['getQueryInterface'](),db['sequelize'][_0x2540('0x28')],function(){throw new Error(_0x2540('0x29'));}],'path':path['join'](config['root'],_0x2540('0x22'),'migrations'),'pattern':/\.js$/}});_0x2d28e4['up']({'migrations':_['map'](_0x554e88,function(_0x9016f9){return _0x9016f9+_0x2540('0x2a');})})[_0x2540('0x1c')](function(){return _0x2c6742['status'](0xc8)['json']({'output':_0x2540('0x2b')+module['exports'][_0x2540('0x0')]+'\x20to\x20'+_['last'](_0x554e88),'migrations':_[_0x2540('0x2c')](_0x554e88)});})[_0x2540('0x1f')](function(_0x221ac7){if(_0x221ac7 instanceof db[_0x2540('0x26')][_0x2540('0x2d')]){return _0x2c6742[_0x2540('0x11')](0xc8)[_0x2540('0xd')]({'output':_0x2540('0x2e')});}else{return _0x2c6742[_0x2540('0x11')](0x1f4)['json'](_0x221ac7);}});}else{return _0x2c6742[_0x2540('0x11')](0xc8)[_0x2540('0xd')]({'output':_0x2540('0x2e')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 2f782cd..abc1811 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 _0x8daa=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','index','/describe','isAuthenticated','/:id','show','post','put','delete','exports','multer','util','path'];(function(_0x48d67c,_0xcd3d64){var _0x3822ed=function(_0x2fc1b7){while(--_0x2fc1b7){_0x48d67c['push'](_0x48d67c['shift']());}};_0x3822ed(++_0xcd3d64);}(_0x8daa,0x179));var _0xa8da=function(_0x460150,_0x232949){_0x460150=_0x460150-0x0;var _0x340677=_0x8daa[_0x460150];return _0x340677;};'use strict';var multer=require(_0xa8da('0x0'));var util=require(_0xa8da('0x1'));var path=require(_0xa8da('0x2'));var timeout=require(_0xa8da('0x3'));var express=require('express');var router=express[_0xa8da('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa8da('0x5'));var interaction=require(_0xa8da('0x6'));var config=require(_0xa8da('0x7'));var controller=require(_0xa8da('0x8'));router[_0xa8da('0x9')]('/',auth['isAuthenticated'](),controller[_0xa8da('0xa')]);router[_0xa8da('0x9')](_0xa8da('0xb'),auth[_0xa8da('0xc')](),controller['describe']);router[_0xa8da('0x9')](_0xa8da('0xd'),auth[_0xa8da('0xc')](),controller[_0xa8da('0xe')]);router[_0xa8da('0xf')]('/',auth[_0xa8da('0xc')](),controller['create']);router[_0xa8da('0x10')](_0xa8da('0xd'),auth[_0xa8da('0xc')](),controller['update']);router[_0xa8da('0x11')](_0xa8da('0xd'),auth[_0xa8da('0xc')](),controller['destroy']);module[_0xa8da('0x12')]=router; \ No newline at end of file +var _0x8e1a=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','isAuthenticated','index','get','/describe','describe','/:id','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x25da61,_0x5a0c32){var _0x28eeeb=function(_0x1077a1){while(--_0x1077a1){_0x25da61['push'](_0x25da61['shift']());}};_0x28eeeb(++_0x5a0c32);}(_0x8e1a,0xfb));var _0xa8e1=function(_0x323eec,_0x46c57d){_0x323eec=_0x323eec-0x0;var _0x19b7cc=_0x8e1a[_0x323eec];return _0x19b7cc;};'use strict';var multer=require(_0xa8e1('0x0'));var util=require(_0xa8e1('0x1'));var path=require(_0xa8e1('0x2'));var timeout=require(_0xa8e1('0x3'));var express=require(_0xa8e1('0x4'));var router=express['Router']();var fs_extra=require(_0xa8e1('0x5'));var auth=require(_0xa8e1('0x6'));var interaction=require(_0xa8e1('0x7'));var config=require(_0xa8e1('0x8'));var controller=require(_0xa8e1('0x9'));router['get']('/',auth[_0xa8e1('0xa')](),controller[_0xa8e1('0xb')]);router[_0xa8e1('0xc')](_0xa8e1('0xd'),auth[_0xa8e1('0xa')](),controller[_0xa8e1('0xe')]);router[_0xa8e1('0xc')](_0xa8e1('0xf'),auth['isAuthenticated'](),controller['show']);router[_0xa8e1('0x10')]('/',auth['isAuthenticated'](),controller[_0xa8e1('0x11')]);router[_0xa8e1('0x12')]('/:id',auth[_0xa8e1('0xa')](),controller[_0xa8e1('0x13')]);router[_0xa8e1('0x14')](_0xa8e1('0xf'),auth[_0xa8e1('0xa')](),controller[_0xa8e1('0x15')]);module[_0xa8e1('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 12ef8a4..43f2899 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 _0x0b70=['INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','exports','STRING','DATE'];(function(_0x5c817d,_0x14275e){var _0x8d5f6f=function(_0x47afd4){while(--_0x47afd4){_0x5c817d['push'](_0x5c817d['shift']());}};_0x8d5f6f(++_0x14275e);}(_0x0b70,0x159));var _0x00b7=function(_0x3f9c14,_0x4649d1){_0x3f9c14=_0x3f9c14-0x0;var _0x2d0851=_0x0b70[_0x3f9c14];return _0x2d0851;};'use strict';var Sequelize=require('sequelize');module[_0x00b7('0x0')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x00b7('0x1')]},'calleridnum':{'type':Sequelize[_0x00b7('0x1')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x00b7('0x1')]},'interface':{'type':Sequelize[_0x00b7('0x1')]},'membername':{'type':Sequelize[_0x00b7('0x1')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x00b7('0x2')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0x00b7('0x2')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x00b7('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x00b7('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0x00b7('0x3')]},'agentacw':{'type':Sequelize[_0x00b7('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x00b7('0x3')]},'reason':{'type':Sequelize[_0x00b7('0x1')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x00b7('0x1')]},'channelstate':{'type':Sequelize[_0x00b7('0x3')]},'channelstatedesc':{'type':Sequelize[_0x00b7('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x00b7('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x00b7('0x1')]},'context':{'type':Sequelize[_0x00b7('0x1')]},'exten':{'type':Sequelize[_0x00b7('0x1')]},'priority':{'type':Sequelize[_0x00b7('0x1')]},'destchannel':{'type':Sequelize[_0x00b7('0x1')]},'destchannelstate':{'type':Sequelize[_0x00b7('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x00b7('0x1')]},'destcalleridnum':{'type':Sequelize[_0x00b7('0x1')]},'destcalleridname':{'type':Sequelize[_0x00b7('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x00b7('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x00b7('0x1')]},'destaccountcode':{'type':Sequelize[_0x00b7('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x00b7('0x1')]},'destuniqueid':{'type':Sequelize[_0x00b7('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x00b7('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0x00b7('0x1')]},'transfer':{'type':Sequelize[_0x00b7('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x00b7('0x1')],'comment':_0x00b7('0x5')},'transferexten':{'type':Sequelize[_0x00b7('0x1')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0x00b7('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9f0e=['STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports'];(function(_0x175a34,_0x29eadf){var _0x3afdf8=function(_0xd7c9dd){while(--_0xd7c9dd){_0x175a34['push'](_0x175a34['shift']());}};_0x3afdf8(++_0x29eadf);}(_0x9f0e,0x116));var _0xe9f0=function(_0x516c92,_0x4d3d55){_0x516c92=_0x516c92-0x0;var _0x3ac310=_0x9f0e[_0x516c92];return _0x3ac310;};'use strict';var Sequelize=require(_0xe9f0('0x0'));module[_0xe9f0('0x1')]={'type':{'type':Sequelize[_0xe9f0('0x2')]},'uniqueid':{'type':Sequelize[_0xe9f0('0x2')]},'calleridnum':{'type':Sequelize[_0xe9f0('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xe9f0('0x2')]},'membername':{'type':Sequelize[_0xe9f0('0x2')]},'agentcalledAt':{'type':Sequelize[_0xe9f0('0x3')]},'agentconnectAt':{'type':Sequelize[_0xe9f0('0x3')]},'agentcompleteAt':{'type':Sequelize[_0xe9f0('0x3')]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0xe9f0('0x4')]},'agentcomplete':{'type':Sequelize[_0xe9f0('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xe9f0('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0xe9f0('0x4')]},'agentacw':{'type':Sequelize[_0xe9f0('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xe9f0('0x4')]},'reason':{'type':Sequelize[_0xe9f0('0x2')]},'lastevent':{'type':Sequelize[_0xe9f0('0x2')]},'channel':{'type':Sequelize[_0xe9f0('0x2')]},'channelstate':{'type':Sequelize[_0xe9f0('0x4')]},'channelstatedesc':{'type':Sequelize[_0xe9f0('0x2')]},'connectedlinenum':{'type':Sequelize[_0xe9f0('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xe9f0('0x2')]},'accountcode':{'type':Sequelize[_0xe9f0('0x2')]},'context':{'type':Sequelize[_0xe9f0('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xe9f0('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xe9f0('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0xe9f0('0x2')]},'destcalleridnum':{'type':Sequelize[_0xe9f0('0x2')]},'destcalleridname':{'type':Sequelize[_0xe9f0('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xe9f0('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0xe9f0('0x2')]},'destcontext':{'type':Sequelize[_0xe9f0('0x2')]},'destexten':{'type':Sequelize[_0xe9f0('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0xe9f0('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xe9f0('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0xe9f0('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xe9f0('0x2')],'comment':_0xe9f0('0x6')},'transferexten':{'type':Sequelize[_0xe9f0('0x2')]},'transferuniqueid':{'type':Sequelize[_0xe9f0('0x2')]},'agententerreason':{'type':Sequelize[_0xe9f0('0x4')],'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 b375e0e..f95ab18 100644 --- a/server/api/voiceAgentReport/voiceAgentReport.controller.js +++ b/server/api/voiceAgentReport/voiceAgentReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['type','options','includeAll','include','findAll','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','VoiceAgentReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x5627e1,_0x1b2dbf){var _0x2f013f=function(_0x142015){while(--_0x142015){_0x5627e1['push'](_0x5627e1['shift']());}};_0x2f013f(++_0x1b2dbf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x21')]=function(_0x45c845,_0x37be73){if(_0x45c845[_0x0a9e('0x44')]['id']){delete _0x45c845['body']['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x45c845[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x22')](saveUpdates(_0x45c845[_0x0a9e('0x44')],null))[_0x0a9e('0x22')](respondWithResult(_0x37be73,null))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x23')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x22')](removeEntity(_0xe401a,null))[_0x0a9e('0x40')](handleError(_0xe401a,null));};exports[_0x0a9e('0x45')]=function(_0x11545a,_0x61bb17){return db[_0x0a9e('0x28')][_0x0a9e('0x45')]()[_0x0a9e('0x22')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));}; \ No newline at end of file +var _0xa9e0=['type','options','includeAll','include','findAll','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','VoiceAgentReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x2db12b,_0x30ab1d){var _0x20990b=function(_0x589477){while(--_0x589477){_0x2db12b['push'](_0x2db12b['shift']());}};_0x20990b(++_0x30ab1d);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x21')]=function(_0x45c845,_0x37be73){if(_0x45c845[_0x0a9e('0x44')]['id']){delete _0x45c845['body']['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x45c845[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x22')](saveUpdates(_0x45c845[_0x0a9e('0x44')],null))[_0x0a9e('0x22')](respondWithResult(_0x37be73,null))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x23')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x22')](removeEntity(_0xe401a,null))[_0x0a9e('0x40')](handleError(_0xe401a,null));};exports[_0x0a9e('0x45')]=function(_0x11545a,_0x61bb17){return db[_0x0a9e('0x28')][_0x0a9e('0x45')]()[_0x0a9e('0x22')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.model.js b/server/api/voiceAgentReport/voiceAgentReport.model.js index e31ce4c..c504632 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 _0xbeea=['moment','request-promise','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','VoiceAgentReport','report_agent','destuniqueid','lodash','../../config/logger','api'];(function(_0x2906b9,_0x409510){var _0x1c03d0=function(_0xed505){while(--_0xed505){_0x2906b9['push'](_0x2906b9['shift']());}};_0x1c03d0(++_0x409510);}(_0xbeea,0xb1));var _0xabee=function(_0x33eef7,_0xdfe1f2){_0x33eef7=_0x33eef7-0x0;var _0x2415be=_0xbeea[_0x33eef7];return _0x2415be;};'use strict';var _=require(_0xabee('0x0'));var util=require('util');var logger=require(_0xabee('0x1'))(_0xabee('0x2'));var moment=require(_0xabee('0x3'));var BPromise=require('bluebird');var rp=require(_0xabee('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xabee('0x5'));var config=require(_0xabee('0x6'));var attributes=require(_0xabee('0x7'));module[_0xabee('0x8')]=function(_0x1ea258,_0x58c9ef){return _0x1ea258['define'](_0xabee('0x9'),attributes,{'tableName':_0xabee('0xa'),'paranoid':![],'indexes':[{'fields':['uniqueid',_0xabee('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1a28=['api','moment','bluebird','rimraf','../../config/environment','./voiceAgentReport.attributes','VoiceAgentReport','report_agent','uniqueid','destuniqueid','lodash','util','../../config/logger'];(function(_0x4f57e6,_0x5dbcad){var _0x23f04b=function(_0x47523c){while(--_0x47523c){_0x4f57e6['push'](_0x4f57e6['shift']());}};_0x23f04b(++_0x5dbcad);}(_0x1a28,0x10e));var _0x81a2=function(_0x378891,_0x4e3e16){_0x378891=_0x378891-0x0;var _0xfbfda2=_0x1a28[_0x378891];return _0xfbfda2;};'use strict';var _=require(_0x81a2('0x0'));var util=require(_0x81a2('0x1'));var logger=require(_0x81a2('0x2'))(_0x81a2('0x3'));var moment=require(_0x81a2('0x4'));var BPromise=require(_0x81a2('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x81a2('0x6'));var config=require(_0x81a2('0x7'));var attributes=require(_0x81a2('0x8'));module['exports']=function(_0x4188d7,_0x20dcd4){return _0x4188d7['define'](_0x81a2('0x9'),attributes,{'tableName':_0x81a2('0xa'),'paranoid':![],'indexes':[{'fields':[_0x81a2('0xb'),_0x81a2('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 0b78907..9b22755 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 _0xc957=['error','code','VoiceAgentReport,\x20%s,\x20%s','message','catch','VoiceAgentReport','body','options','raw','then','CreateVoiceAgentReport','UpdateVoiceAgentReport','update','attributes','limit','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3afcff,_0xcf4d5){var _0x24364d=function(_0x2150eb){while(--_0x2150eb){_0x3afcff['push'](_0x3afcff['shift']());}};_0x24364d(++_0xcf4d5);}(_0xc957,0x183));var _0x7c95=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0xc957[_0xb0f7c3];return _0x28ea68;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7c95('0x0'));var BPromise=require(_0x7c95('0x1'));var rs=require(_0x7c95('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7c95('0x3'))['db'];var utils=require(_0x7c95('0x4'));var logger=require('../../config/logger')(_0x7c95('0x5'));var config=require(_0x7c95('0x6'));var jayson=require(_0x7c95('0x7'));var client=jayson[_0x7c95('0x8')][_0x7c95('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5e1e61,_0x2a2441,_0xd60fc5){return new BPromise(function(_0xabf0bc,_0x51c70e){return client[_0x7c95('0xa')](_0x5e1e61,_0xd60fc5)['then'](function(_0xf0acfc){logger[_0x7c95('0xb')]('VoiceAgentReport,\x20%s,\x20%s',_0x2a2441,_0x7c95('0xc'));logger[_0x7c95('0xd')](_0x7c95('0xe'),_0x2a2441,'request\x20sent',JSON[_0x7c95('0xf')](_0xf0acfc));if(_0xf0acfc['error']){if(_0xf0acfc[_0x7c95('0x10')][_0x7c95('0x11')]===0x1f4){logger['error'](_0x7c95('0x12'),_0x2a2441,_0xf0acfc[_0x7c95('0x10')][_0x7c95('0x13')]);return _0x51c70e(_0xf0acfc['error']['message']);}logger[_0x7c95('0x10')](_0x7c95('0x12'),_0x2a2441,_0xf0acfc[_0x7c95('0x10')][_0x7c95('0x13')]);return _0xabf0bc(_0xf0acfc[_0x7c95('0x10')][_0x7c95('0x13')]);}else{logger[_0x7c95('0xb')](_0x7c95('0x12'),_0x2a2441,'request\x20sent');_0xabf0bc(_0xf0acfc['result'][_0x7c95('0x13')]);}})[_0x7c95('0x14')](function(_0x548123){logger[_0x7c95('0x10')](_0x7c95('0x12'),_0x2a2441,_0x548123);_0x51c70e(_0x548123);});});}exports['CreateVoiceAgentReport']=function(_0x2299cc){var _0x3ecb2f=this;return new Promise(function(_0x2d6bef,_0x392051){return db[_0x7c95('0x15')]['create'](_0x2299cc[_0x7c95('0x16')],{'raw':_0x2299cc['options']?_0x2299cc[_0x7c95('0x17')][_0x7c95('0x18')]===undefined?!![]:![]:!![]})[_0x7c95('0x19')](function(_0x3aa22f){logger[_0x7c95('0xb')](_0x7c95('0x1a'),_0x2299cc);logger['debug'](_0x7c95('0x1a'),_0x2299cc,JSON['stringify'](_0x3aa22f));_0x2d6bef(_0x3aa22f);})['catch'](function(_0x1f847a){logger[_0x7c95('0x10')](_0x7c95('0x1a'),_0x1f847a['message'],_0x2299cc);_0x392051(_0x3ecb2f[_0x7c95('0x10')](0x1f4,_0x1f847a['message']));});});};exports[_0x7c95('0x1b')]=function(_0x17e41a){var _0x571ebf=this;return new Promise(function(_0x1da008,_0x503746){return db[_0x7c95('0x15')][_0x7c95('0x1c')](_0x17e41a[_0x7c95('0x16')],{'raw':_0x17e41a[_0x7c95('0x17')]?_0x17e41a['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x17e41a[_0x7c95('0x17')]?_0x17e41a[_0x7c95('0x17')]['where']||null:null,'attributes':_0x17e41a[_0x7c95('0x17')]?_0x17e41a[_0x7c95('0x17')][_0x7c95('0x1d')]||null:null,'limit':_0x17e41a['options']?_0x17e41a['options'][_0x7c95('0x1e')]||null:null})[_0x7c95('0x19')](function(_0x4fd7c4){logger[_0x7c95('0xb')](_0x7c95('0x1b'),_0x17e41a);logger[_0x7c95('0xd')](_0x7c95('0x1b'),_0x17e41a,JSON['stringify'](_0x4fd7c4));_0x1da008(_0x4fd7c4);})[_0x7c95('0x14')](function(_0x29fa54){logger['error'](_0x7c95('0x1b'),_0x29fa54[_0x7c95('0x13')],_0x17e41a);_0x503746(_0x571ebf[_0x7c95('0x10')](0x1f4,_0x29fa54[_0x7c95('0x13')]));});});}; \ No newline at end of file +var _0x07e0=['ioredis','../../config/logger','rpc','../../config/environment','client','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','VoiceAgentReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateVoiceAgentReport','create','body','options','raw','debug','UpdateVoiceAgentReport','VoiceAgentReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x07e0,0x19f));var _0x007e=function(_0x3811d4,_0x2abdfb){_0x3811d4=_0x3811d4-0x0;var _0x3f1fae=_0x07e0[_0x3811d4];return _0x3f1fae;};'use strict';var _=require(_0x007e('0x0'));var util=require(_0x007e('0x1'));var moment=require(_0x007e('0x2'));var BPromise=require(_0x007e('0x3'));var rs=require(_0x007e('0x4'));var fs=require('fs');var Redis=require(_0x007e('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x007e('0x6'))(_0x007e('0x7'));var config=require(_0x007e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x007e('0x9')][_0x007e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x85f80d,_0x323264,_0xd82987){return new BPromise(function(_0x2e2c58,_0x24fe70){return client[_0x007e('0xb')](_0x85f80d,_0xd82987)[_0x007e('0xc')](function(_0x27dec4){logger[_0x007e('0xd')](_0x007e('0xe'),_0x323264,'request\x20sent');logger['debug'](_0x007e('0xf'),_0x323264,_0x007e('0x10'),JSON[_0x007e('0x11')](_0x27dec4));if(_0x27dec4[_0x007e('0x12')]){if(_0x27dec4[_0x007e('0x12')][_0x007e('0x13')]===0x1f4){logger[_0x007e('0x12')](_0x007e('0xe'),_0x323264,_0x27dec4[_0x007e('0x12')][_0x007e('0x14')]);return _0x24fe70(_0x27dec4[_0x007e('0x12')]['message']);}logger[_0x007e('0x12')](_0x007e('0xe'),_0x323264,_0x27dec4[_0x007e('0x12')]['message']);return _0x2e2c58(_0x27dec4['error']['message']);}else{logger[_0x007e('0xd')]('VoiceAgentReport,\x20%s,\x20%s',_0x323264,_0x007e('0x10'));_0x2e2c58(_0x27dec4[_0x007e('0x15')][_0x007e('0x14')]);}})[_0x007e('0x16')](function(_0x4f3604){logger['error'](_0x007e('0xe'),_0x323264,_0x4f3604);_0x24fe70(_0x4f3604);});});}exports[_0x007e('0x17')]=function(_0x3a2760){var _0x582cf9=this;return new Promise(function(_0x443b68,_0x1139fe){return db['VoiceAgentReport'][_0x007e('0x18')](_0x3a2760[_0x007e('0x19')],{'raw':_0x3a2760[_0x007e('0x1a')]?_0x3a2760[_0x007e('0x1a')][_0x007e('0x1b')]===undefined?!![]:![]:!![]})[_0x007e('0xc')](function(_0x47dea5){logger[_0x007e('0xd')](_0x007e('0x17'),_0x3a2760);logger[_0x007e('0x1c')](_0x007e('0x17'),_0x3a2760,JSON[_0x007e('0x11')](_0x47dea5));_0x443b68(_0x47dea5);})[_0x007e('0x16')](function(_0x8c10a0){logger[_0x007e('0x12')](_0x007e('0x17'),_0x8c10a0['message'],_0x3a2760);_0x1139fe(_0x582cf9[_0x007e('0x12')](0x1f4,_0x8c10a0[_0x007e('0x14')]));});});};exports[_0x007e('0x1d')]=function(_0x4a46e0){var _0x5671e6=this;return new Promise(function(_0x1f4077,_0x4c8fd4){return db[_0x007e('0x1e')][_0x007e('0x1f')](_0x4a46e0[_0x007e('0x19')],{'raw':_0x4a46e0[_0x007e('0x1a')]?_0x4a46e0[_0x007e('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a46e0[_0x007e('0x1a')]?_0x4a46e0[_0x007e('0x1a')][_0x007e('0x20')]||null:null,'attributes':_0x4a46e0[_0x007e('0x1a')]?_0x4a46e0[_0x007e('0x1a')][_0x007e('0x21')]||null:null,'limit':_0x4a46e0[_0x007e('0x1a')]?_0x4a46e0[_0x007e('0x1a')][_0x007e('0x22')]||null:null})[_0x007e('0xc')](function(_0x16e425){logger[_0x007e('0xd')](_0x007e('0x1d'),_0x4a46e0);logger[_0x007e('0x1c')](_0x007e('0x1d'),_0x4a46e0,JSON[_0x007e('0x11')](_0x16e425));_0x1f4077(_0x16e425);})['catch'](function(_0x2ac1ad){logger[_0x007e('0x12')]('UpdateVoiceAgentReport',_0x2ac1ad[_0x007e('0x14')],_0x4a46e0);_0x4c8fd4(_0x5671e6['error'](0x1f4,_0x2ac1ad[_0x007e('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index b29ce83..da91c51 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 _0x6b8f=['destroy','exports','util','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./voiceCallReport.controller','get','index','/describe','isAuthenticated','/:id','show','post','create','put'];(function(_0x4c825d,_0x10ec2b){var _0x43de87=function(_0xcab4a3){while(--_0xcab4a3){_0x4c825d['push'](_0x4c825d['shift']());}};_0x43de87(++_0x10ec2b);}(_0x6b8f,0x1bc));var _0xf6b8=function(_0x55eccf,_0x2a9061){_0x55eccf=_0x55eccf-0x0;var _0x58d2f1=_0x6b8f[_0x55eccf];return _0x58d2f1;};'use strict';var multer=require('multer');var util=require(_0xf6b8('0x0'));var path=require('path');var timeout=require(_0xf6b8('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf6b8('0x2'));var auth=require(_0xf6b8('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xf6b8('0x4'));var controller=require(_0xf6b8('0x5'));router[_0xf6b8('0x6')]('/',auth['isAuthenticated'](),controller[_0xf6b8('0x7')]);router[_0xf6b8('0x6')](_0xf6b8('0x8'),auth[_0xf6b8('0x9')](),controller['describe']);router['get'](_0xf6b8('0xa'),auth['isAuthenticated'](),controller[_0xf6b8('0xb')]);router[_0xf6b8('0xc')]('/',auth[_0xf6b8('0x9')](),controller[_0xf6b8('0xd')]);router[_0xf6b8('0xe')](_0xf6b8('0xa'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xf6b8('0xa'),auth[_0xf6b8('0x9')](),controller[_0xf6b8('0xf')]);module[_0xf6b8('0x10')]=router; \ No newline at end of file +var _0x3937=['get','isAuthenticated','index','/describe','describe','show','post','create','delete','/:id','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./voiceCallReport.controller'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3937,0xbf));var _0x7393=function(_0x31aa18,_0xbd38db){_0x31aa18=_0x31aa18-0x0;var _0x51ae52=_0x3937[_0x31aa18];return _0x51ae52;};'use strict';var multer=require(_0x7393('0x0'));var util=require('util');var path=require(_0x7393('0x1'));var timeout=require(_0x7393('0x2'));var express=require('express');var router=express[_0x7393('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x7393('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x7393('0x5'));var controller=require(_0x7393('0x6'));router[_0x7393('0x7')]('/',auth[_0x7393('0x8')](),controller[_0x7393('0x9')]);router[_0x7393('0x7')](_0x7393('0xa'),auth[_0x7393('0x8')](),controller[_0x7393('0xb')]);router['get']('/:id',auth[_0x7393('0x8')](),controller[_0x7393('0xc')]);router[_0x7393('0xd')]('/',auth['isAuthenticated'](),controller[_0x7393('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x7393('0xf')](_0x7393('0x10'),auth[_0x7393('0x8')](),controller['destroy']);module[_0x7393('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 d4d145a..c079b31 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 _0xb36b=['DATE','INTEGER','sequelize','STRING','ENUM','inbound','internal','outbound','outbound-fax','dialer'];(function(_0x534a02,_0x288eef){var _0x30f7c1=function(_0x593734){while(--_0x593734){_0x534a02['push'](_0x534a02['shift']());}};_0x30f7c1(++_0x288eef);}(_0xb36b,0xac));var _0xbb36=function(_0x3f98f5,_0x199a69){_0x3f98f5=_0x3f98f5-0x0;var _0xe7b776=_0xb36b[_0x3f98f5];return _0xe7b776;};'use strict';var Sequelize=require(_0xbb36('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb36('0x1')]},'type':{'type':Sequelize[_0xbb36('0x2')](_0xbb36('0x3'),_0xbb36('0x4'),_0xbb36('0x5'),'inbound-fax',_0xbb36('0x6'),_0xbb36('0x7'))},'tag':{'type':Sequelize[_0xbb36('0x1')]},'accountcode':{'type':Sequelize[_0xbb36('0x1')]},'source':{'type':Sequelize[_0xbb36('0x1')]},'destination':{'type':Sequelize[_0xbb36('0x1')]},'destinationcontext':{'type':Sequelize[_0xbb36('0x1')]},'callerid':{'type':Sequelize[_0xbb36('0x1')]},'channel':{'type':Sequelize[_0xbb36('0x1')]},'destinationchannel':{'type':Sequelize[_0xbb36('0x1')]},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0xbb36('0x8')]},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xbb36('0x8')]},'duration':{'type':Sequelize[_0xbb36('0x9')]},'billableseconds':{'type':Sequelize[_0xbb36('0x9')]},'mohtime':{'type':Sequelize[_0xbb36('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xbb36('0x1')]},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0xbb36('0x1')]},'userDisposition':{'type':Sequelize[_0xbb36('0x1')]},'userSecondDisposition':{'type':Sequelize[_0xbb36('0x1')]},'userThirdDisposition':{'type':Sequelize[_0xbb36('0x1')]},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0xbb36('0x1')]},'routeid':{'type':Sequelize[_0xbb36('0x9')]},'sipcallid':{'type':Sequelize[_0xbb36('0x1')]}}; \ No newline at end of file +var _0x3f77=['dialer','TEXT','DATE','INTEGER','sequelize','exports','STRING','ENUM','inbound','outbound','inbound-fax','outbound-fax'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x3f77,0xa0));var _0x73f7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3f77[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x73f7('0x0'));module[_0x73f7('0x1')]={'uniqueid':{'type':Sequelize[_0x73f7('0x2')]},'type':{'type':Sequelize[_0x73f7('0x3')](_0x73f7('0x4'),'internal',_0x73f7('0x5'),_0x73f7('0x6'),_0x73f7('0x7'),_0x73f7('0x8'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x73f7('0x2')]},'source':{'type':Sequelize[_0x73f7('0x2')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x73f7('0x2')]},'channel':{'type':Sequelize[_0x73f7('0x2')]},'destinationchannel':{'type':Sequelize[_0x73f7('0x2')]},'lastapplication':{'type':Sequelize[_0x73f7('0x2')]},'lastdata':{'type':Sequelize[_0x73f7('0x9')]},'starttime':{'type':Sequelize[_0x73f7('0xa')]},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x73f7('0xa')]},'endtime':{'type':Sequelize[_0x73f7('0xa')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0x73f7('0xb')]},'mohtime':{'type':Sequelize[_0x73f7('0xb')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x73f7('0x2')]},'amaflags':{'type':Sequelize[_0x73f7('0x2')]},'userfield':{'type':Sequelize[_0x73f7('0x2')]},'userDisposition':{'type':Sequelize[_0x73f7('0x2')]},'userSecondDisposition':{'type':Sequelize[_0x73f7('0x2')]},'userThirdDisposition':{'type':Sequelize[_0x73f7('0x2')]},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x73f7('0x2')]},'routeid':{'type':Sequelize[_0x73f7('0xb')]},'sipcallid':{'type':Sequelize[_0x73f7('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 263cc56..89489bc 100644 --- a/server/api/voiceCallReport/voiceCallReport.controller.js +++ b/server/api/voiceCallReport/voiceCallReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f66=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','VoiceCallReport','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','type','VIRTUAL','includeAll','include','fullname','alias','User','rows','catch','show','params','find','create','body','describe','uniqueid','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x5f66,0x1a0));var _0x65f6=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x5f66[_0x17d9e3];return _0x14192d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65f6('0x1'));var rp=require(_0x65f6('0x2'));var moment=require(_0x65f6('0x3'));var BPromise=require(_0x65f6('0x4'));var Mustache=require(_0x65f6('0x5'));var util=require('util');var path=require(_0x65f6('0x6'));var sox=require('sox');var csv=require(_0x65f6('0x7'));var ejs=require(_0x65f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x7'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x65f6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419819,_0x4862a5){_0x4862a5=_0x4862a5||0xcc;return function(_0x2f964a){if(_0x2f964a){return _0x419819[_0x65f6('0x14')](_0x4862a5);}return _0x419819[_0x65f6('0x15')](_0x4862a5)[_0x65f6('0x16')]();};}function respondWithResult(_0x369f96,_0x1d29fd){_0x1d29fd=_0x1d29fd||0xc8;return function(_0x44144b){if(_0x44144b){return _0x369f96[_0x65f6('0x15')](_0x1d29fd)[_0x65f6('0x17')](_0x44144b);}};}function respondWithFilteredResult(_0x3440af,_0x59154e){return function(_0x19b9ff){if(_0x19b9ff){var _0x49a913=typeof _0x59154e['offset']===_0x65f6('0x18')&&typeof _0x59154e[_0x65f6('0x19')]===_0x65f6('0x18');var _0x1c955c=_0x19b9ff[_0x65f6('0x1a')];var _0x1f974c=_0x49a913?0x0:_0x59154e[_0x65f6('0x1b')];var _0x18380e=_0x49a913?_0x19b9ff['count']:_0x59154e['offset']+_0x59154e[_0x65f6('0x19')];var _0x5b4055;if(_0x18380e>=_0x1c955c){_0x18380e=_0x1c955c;_0x5b4055=0xc8;}else{_0x5b4055=0xce;}_0x3440af['status'](_0x5b4055);return _0x3440af['set'](_0x65f6('0x1c'),_0x1f974c+'-'+_0x18380e+'/'+_0x1c955c)[_0x65f6('0x17')](_0x19b9ff);}return null;};}function patchUpdates(_0x5114a4){return function(_0x39e19f){try{jsonpatch[_0x65f6('0x1d')](_0x39e19f,_0x5114a4,!![]);}catch(_0xbee6a4){return BPromise[_0x65f6('0x1e')](_0xbee6a4);}return _0x39e19f[_0x65f6('0x1f')]();};}function saveUpdates(_0xc139c2,_0x581374){return function(_0x197a49){if(_0x197a49){return _0x197a49['update'](_0xc139c2)['then'](function(_0x212247){return _0x212247;});}return null;};}function removeEntity(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(_0x1eeaaa){return _0x1eeaaa[_0x65f6('0x20')]()[_0x65f6('0x21')](function(){_0xd173f4[_0x65f6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d7bb0,_0x59ea32){return function(_0x20a161){if(!_0x20a161){_0x9d7bb0['sendStatus'](0x194);}return _0x20a161;};}function handleError(_0x5cb131,_0x4fde2f){_0x4fde2f=_0x4fde2f||0x1f4;return function(_0x29abdb){logger[_0x65f6('0x22')](_0x29abdb['stack']);if(_0x29abdb[_0x65f6('0x23')]){delete _0x29abdb[_0x65f6('0x23')];}_0x5cb131['status'](_0x4fde2f)[_0x65f6('0x24')](_0x29abdb);};}exports[_0x65f6('0x25')]=function(_0x28d0df,_0x559330){var _0x4ac04b={},_0x488d36={},_0x266cfe={'count':0x0,'rows':[]};var _0x3c032f=_[_0x65f6('0x26')](db[_0x65f6('0x27')][_0x65f6('0x28')],function(_0x14a387){return{'name':_0x14a387[_0x65f6('0x29')],'type':_0x14a387['type']['key']};});_0x488d36[_0x65f6('0x2a')]=_[_0x65f6('0x26')](_0x3c032f,'name');_0x488d36['query']=_[_0x65f6('0x2b')](_0x28d0df[_0x65f6('0x2c')]);_0x488d36[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],_0x488d36[_0x65f6('0x2c')]);_0x4ac04b['attributes']=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x28d0df['query'][_0x65f6('0x2f')]));_0x4ac04b[_0x65f6('0x30')]=_0x4ac04b[_0x65f6('0x30')][_0x65f6('0x31')]?_0x4ac04b[_0x65f6('0x30')]:_0x488d36[_0x65f6('0x2a')];if(!_0x28d0df['query'][_0x65f6('0x32')](_0x65f6('0x33'))){_0x4ac04b['limit']=qs[_0x65f6('0x19')](_0x28d0df['query'][_0x65f6('0x19')]);_0x4ac04b['offset']=qs[_0x65f6('0x1b')](_0x28d0df[_0x65f6('0x2c')]['offset']);}_0x4ac04b[_0x65f6('0x34')]=qs[_0x65f6('0x35')](_0x28d0df[_0x65f6('0x2c')]['sort']);_0x4ac04b['where']=qs[_0x65f6('0x2d')](_['pick'](_0x28d0df[_0x65f6('0x2c')],_0x488d36['filters']),_0x3c032f);if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]){_0x4ac04b['where']=_[_0x65f6('0x37')](_0x4ac04b['where'],{'$or':_['map'](_0x3c032f,function(_0x71b16b){if(_0x71b16b[_0x65f6('0x38')]!==_0x65f6('0x39')){var _0x313be5={};_0x313be5[_0x71b16b[_0x65f6('0x23')]]={'$like':'%'+_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]+'%'};return _0x313be5;}})});}_0x4ac04b=_[_0x65f6('0x37')]({},_0x4ac04b,_0x28d0df['options']);var _0x3aa254={'where':_0x4ac04b['where']};return db[_0x65f6('0x27')][_0x65f6('0x1a')](_0x3aa254)[_0x65f6('0x21')](function(_0x2ea7f7){_0x266cfe['count']=_0x2ea7f7;if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x4ac04b[_0x65f6('0x3b')]=[{'attributes':['id',_0x65f6('0x23'),_0x65f6('0x3c'),_0x65f6('0x3d')],'model':db[_0x65f6('0x3e')],'as':_0x65f6('0x3e')}];}return db[_0x65f6('0x27')]['findAll'](_0x4ac04b);})[_0x65f6('0x21')](function(_0x400ed2){_0x266cfe[_0x65f6('0x3f')]=_0x400ed2;return _0x266cfe;})[_0x65f6('0x21')](respondWithFilteredResult(_0x559330,_0x4ac04b))[_0x65f6('0x40')](handleError(_0x559330,null));};exports[_0x65f6('0x41')]=function(_0xe0b72d,_0x2e91e8){var _0x461393={'raw':!![],'where':{'id':_0xe0b72d[_0x65f6('0x42')]['id']}},_0x2abbed={};_0x2abbed[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](db[_0x65f6('0x27')][_0x65f6('0x28')]);_0x2abbed[_0x65f6('0x2c')]=_['keys'](_0xe0b72d[_0x65f6('0x2c')]);_0x2abbed[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],_0x2abbed['query']);_0x461393[_0x65f6('0x30')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],qs['fields'](_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x2f')]));_0x461393[_0x65f6('0x30')]=_0x461393[_0x65f6('0x30')]['length']?_0x461393[_0x65f6('0x30')]:_0x2abbed['model'];if(_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x461393['include']=[{'all':!![]}];}_0x461393=_[_0x65f6('0x37')]({},_0x461393,_0xe0b72d['options']);return db[_0x65f6('0x27')][_0x65f6('0x43')](_0x461393)[_0x65f6('0x21')](handleEntityNotFound(_0x2e91e8,null))[_0x65f6('0x21')](respondWithResult(_0x2e91e8,null))[_0x65f6('0x40')](handleError(_0x2e91e8,null));};exports[_0x65f6('0x44')]=function(_0x4d30c5,_0x51bf6c){return db[_0x65f6('0x27')][_0x65f6('0x44')](_0x4d30c5[_0x65f6('0x45')],{})[_0x65f6('0x21')](respondWithResult(_0x51bf6c,0xc9))[_0x65f6('0x40')](handleError(_0x51bf6c,null));};exports[_0x65f6('0x20')]=function(_0x149c28,_0x41690c){return db[_0x65f6('0x27')]['find']({'where':{'id':_0x149c28[_0x65f6('0x42')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x41690c,null))[_0x65f6('0x21')](removeEntity(_0x41690c,null))['catch'](handleError(_0x41690c,null));};exports[_0x65f6('0x46')]=function(_0x42d453,_0x49ba5a){return db[_0x65f6('0x27')][_0x65f6('0x46')]()['then'](respondWithResult(_0x49ba5a,null))[_0x65f6('0x40')](handleError(_0x49ba5a,null));};exports['update']=function(_0x247be3,_0x3b241f){if(_0x247be3[_0x65f6('0x45')]['uniqueid']){delete _0x247be3[_0x65f6('0x45')][_0x65f6('0x47')];}return db['VoiceCallReport'][_0x65f6('0x43')]({'where':{'uniqueid':_0x247be3[_0x65f6('0x42')]['id'],'UserId':{'$or':[null,_0x247be3['user']['id']]}}})[_0x65f6('0x21')](handleEntityNotFound(_0x3b241f,null))[_0x65f6('0x21')](saveUpdates(_0x247be3[_0x65f6('0x45')],null))[_0x65f6('0x21')](respondWithResult(_0x3b241f,null))[_0x65f6('0x40')](handleError(_0x3b241f,null));}; \ No newline at end of file +var _0x0b0e=['bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','undefined','offset','limit','set','json','apply','reject','save','then','destroy','error','stack','name','index','map','VoiceCallReport','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','merge','where','VIRTUAL','options','count','includeAll','fullname','alias','User','findAll','rows','params','find','create','body','catch','describe','update','uniqueid','user','eml-format','zip-dir','request-promise','moment'];(function(_0x10fc4f,_0xb3df9e){var _0x7f5099=function(_0xc37af5){while(--_0xc37af5){_0x10fc4f['push'](_0x10fc4f['shift']());}};_0x7f5099(++_0xb3df9e);}(_0x0b0e,0x187));var _0xe0b0=function(_0x1e6db3,_0x5643ac){_0x1e6db3=_0x1e6db3-0x0;var _0x1de886=_0x0b0e[_0x1e6db3];return _0x1de886;};'use strict';var emlformat=require(_0xe0b0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0b0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe0b0('0x2'));var moment=require(_0xe0b0('0x3'));var BPromise=require(_0xe0b0('0x4'));var Mustache=require(_0xe0b0('0x5'));var util=require(_0xe0b0('0x6'));var path=require(_0xe0b0('0x7'));var sox=require(_0xe0b0('0x8'));var csv=require(_0xe0b0('0x9'));var ejs=require(_0xe0b0('0xa'));var fs=require('fs');var fs_extra=require(_0xe0b0('0xb'));var _=require(_0xe0b0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe0b0('0xd'));var deskjs=require(_0xe0b0('0xe'));var toCsv=require(_0xe0b0('0x9'));var querystring=require(_0xe0b0('0xf'));var Papa=require('papaparse');var Redis=require(_0xe0b0('0x10'));var authService=require(_0xe0b0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe0b0('0x12'));var hardwareService=require(_0xe0b0('0x13'));var logger=require('../../config/logger')(_0xe0b0('0x14'));var utils=require(_0xe0b0('0x15'));var config=require(_0xe0b0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe0b0('0x17'))['db'];function respondWithStatusCode(_0x1c358a,_0x3cc19a){_0x3cc19a=_0x3cc19a||0xcc;return function(_0x45f914){if(_0x45f914){return _0x1c358a[_0xe0b0('0x18')](_0x3cc19a);}return _0x1c358a['status'](_0x3cc19a)[_0xe0b0('0x19')]();};}function respondWithResult(_0x154de6,_0x743318){_0x743318=_0x743318||0xc8;return function(_0x24babd){if(_0x24babd){return _0x154de6[_0xe0b0('0x1a')](_0x743318)['json'](_0x24babd);}};}function respondWithFilteredResult(_0x41a7e2,_0x5adb01){return function(_0x35cb40){if(_0x35cb40){var _0xadee6e=typeof _0x5adb01['offset']===_0xe0b0('0x1b')&&typeof _0x5adb01['limit']===_0xe0b0('0x1b');var _0x100204=_0x35cb40['count'];var _0x54a3eb=_0xadee6e?0x0:_0x5adb01[_0xe0b0('0x1c')];var _0x50a441=_0xadee6e?_0x35cb40['count']:_0x5adb01['offset']+_0x5adb01[_0xe0b0('0x1d')];var _0x50fa4a;if(_0x50a441>=_0x100204){_0x50a441=_0x100204;_0x50fa4a=0xc8;}else{_0x50fa4a=0xce;}_0x41a7e2['status'](_0x50fa4a);return _0x41a7e2[_0xe0b0('0x1e')]('Content-Range',_0x54a3eb+'-'+_0x50a441+'/'+_0x100204)[_0xe0b0('0x1f')](_0x35cb40);}return null;};}function patchUpdates(_0x5dba2f){return function(_0x2c84cc){try{jsonpatch[_0xe0b0('0x20')](_0x2c84cc,_0x5dba2f,!![]);}catch(_0x3e10b3){return BPromise[_0xe0b0('0x21')](_0x3e10b3);}return _0x2c84cc[_0xe0b0('0x22')]();};}function saveUpdates(_0x58b804,_0x4cae54){return function(_0x2fa820){if(_0x2fa820){return _0x2fa820['update'](_0x58b804)[_0xe0b0('0x23')](function(_0x31b5f8){return _0x31b5f8;});}return null;};}function removeEntity(_0x513e63,_0x170ad8){return function(_0x503883){if(_0x503883){return _0x503883[_0xe0b0('0x24')]()['then'](function(){_0x513e63[_0xe0b0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e5c88,_0x4de537){return function(_0x4700cc){if(!_0x4700cc){_0x3e5c88['sendStatus'](0x194);}return _0x4700cc;};}function handleError(_0x3c221d,_0x5c5317){_0x5c5317=_0x5c5317||0x1f4;return function(_0x362aba){logger[_0xe0b0('0x25')](_0x362aba[_0xe0b0('0x26')]);if(_0x362aba[_0xe0b0('0x27')]){delete _0x362aba[_0xe0b0('0x27')];}_0x3c221d[_0xe0b0('0x1a')](_0x5c5317)['send'](_0x362aba);};}exports[_0xe0b0('0x28')]=function(_0x1b8aa8,_0x5b7a64){var _0x15e13b={},_0x419b1f={},_0x36d137={'count':0x0,'rows':[]};var _0x1d5759=_[_0xe0b0('0x29')](db[_0xe0b0('0x2a')][_0xe0b0('0x2b')],function(_0x4fb3b7){return{'name':_0x4fb3b7[_0xe0b0('0x2c')],'type':_0x4fb3b7[_0xe0b0('0x2d')]['key']};});_0x419b1f['model']=_[_0xe0b0('0x29')](_0x1d5759,_0xe0b0('0x27'));_0x419b1f[_0xe0b0('0x2e')]=_[_0xe0b0('0x2f')](_0x1b8aa8[_0xe0b0('0x2e')]);_0x419b1f['filters']=_[_0xe0b0('0x30')](_0x419b1f[_0xe0b0('0x31')],_0x419b1f[_0xe0b0('0x2e')]);_0x15e13b[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x419b1f['model'],qs[_0xe0b0('0x33')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x33')]));_0x15e13b[_0xe0b0('0x32')]=_0x15e13b[_0xe0b0('0x32')][_0xe0b0('0x34')]?_0x15e13b[_0xe0b0('0x32')]:_0x419b1f[_0xe0b0('0x31')];if(!_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x35')](_0xe0b0('0x36'))){_0x15e13b[_0xe0b0('0x1d')]=qs[_0xe0b0('0x1d')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1d')]);_0x15e13b['offset']=qs[_0xe0b0('0x1c')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1c')]);}_0x15e13b[_0xe0b0('0x37')]=qs[_0xe0b0('0x38')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x38')]);_0x15e13b['where']=qs['filters'](_['pick'](_0x1b8aa8['query'],_0x419b1f[_0xe0b0('0x39')]),_0x1d5759);if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]){_0x15e13b['where']=_[_0xe0b0('0x3b')](_0x15e13b[_0xe0b0('0x3c')],{'$or':_[_0xe0b0('0x29')](_0x1d5759,function(_0x297c64){if(_0x297c64['type']!==_0xe0b0('0x3d')){var _0xfbb61d={};_0xfbb61d[_0x297c64[_0xe0b0('0x27')]]={'$like':'%'+_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]+'%'};return _0xfbb61d;}})});}_0x15e13b=_[_0xe0b0('0x3b')]({},_0x15e13b,_0x1b8aa8[_0xe0b0('0x3e')]);var _0x115a69={'where':_0x15e13b[_0xe0b0('0x3c')]};return db['VoiceCallReport'][_0xe0b0('0x3f')](_0x115a69)['then'](function(_0x34178d){_0x36d137[_0xe0b0('0x3f')]=_0x34178d;if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x15e13b['include']=[{'attributes':['id',_0xe0b0('0x27'),_0xe0b0('0x41'),_0xe0b0('0x42')],'model':db[_0xe0b0('0x43')],'as':_0xe0b0('0x43')}];}return db[_0xe0b0('0x2a')][_0xe0b0('0x44')](_0x15e13b);})[_0xe0b0('0x23')](function(_0x52ffe4){_0x36d137[_0xe0b0('0x45')]=_0x52ffe4;return _0x36d137;})[_0xe0b0('0x23')](respondWithFilteredResult(_0x5b7a64,_0x15e13b))['catch'](handleError(_0x5b7a64,null));};exports['show']=function(_0x327fb4,_0x247f8d){var _0x56e7df={'raw':!![],'where':{'id':_0x327fb4[_0xe0b0('0x46')]['id']}},_0x18a59d={};_0x18a59d[_0xe0b0('0x31')]=_[_0xe0b0('0x2f')](db[_0xe0b0('0x2a')]['rawAttributes']);_0x18a59d['query']=_['keys'](_0x327fb4[_0xe0b0('0x2e')]);_0x18a59d[_0xe0b0('0x39')]=_['intersection'](_0x18a59d[_0xe0b0('0x31')],_0x18a59d[_0xe0b0('0x2e')]);_0x56e7df[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x18a59d[_0xe0b0('0x31')],qs['fields'](_0x327fb4['query'][_0xe0b0('0x33')]));_0x56e7df[_0xe0b0('0x32')]=_0x56e7df[_0xe0b0('0x32')][_0xe0b0('0x34')]?_0x56e7df[_0xe0b0('0x32')]:_0x18a59d['model'];if(_0x327fb4[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x56e7df['include']=[{'all':!![]}];}_0x56e7df=_['merge']({},_0x56e7df,_0x327fb4['options']);return db[_0xe0b0('0x2a')][_0xe0b0('0x47')](_0x56e7df)[_0xe0b0('0x23')](handleEntityNotFound(_0x247f8d,null))[_0xe0b0('0x23')](respondWithResult(_0x247f8d,null))['catch'](handleError(_0x247f8d,null));};exports[_0xe0b0('0x48')]=function(_0x87d8f3,_0x483f12){return db['VoiceCallReport'][_0xe0b0('0x48')](_0x87d8f3[_0xe0b0('0x49')],{})['then'](respondWithResult(_0x483f12,0xc9))[_0xe0b0('0x4a')](handleError(_0x483f12,null));};exports[_0xe0b0('0x24')]=function(_0x504284,_0x5cb2b6){return db[_0xe0b0('0x2a')]['find']({'where':{'id':_0x504284[_0xe0b0('0x46')]['id']}})[_0xe0b0('0x23')](handleEntityNotFound(_0x5cb2b6,null))[_0xe0b0('0x23')](removeEntity(_0x5cb2b6,null))[_0xe0b0('0x4a')](handleError(_0x5cb2b6,null));};exports[_0xe0b0('0x4b')]=function(_0xf9e694,_0x5f5486){return db['VoiceCallReport'][_0xe0b0('0x4b')]()['then'](respondWithResult(_0x5f5486,null))['catch'](handleError(_0x5f5486,null));};exports[_0xe0b0('0x4c')]=function(_0x222174,_0x54cf7b){if(_0x222174['body'][_0xe0b0('0x4d')]){delete _0x222174[_0xe0b0('0x49')][_0xe0b0('0x4d')];}return db[_0xe0b0('0x2a')][_0xe0b0('0x47')]({'where':{'uniqueid':_0x222174[_0xe0b0('0x46')]['id'],'UserId':{'$or':[null,_0x222174[_0xe0b0('0x4e')]['id']]}}})['then'](handleEntityNotFound(_0x54cf7b,null))[_0xe0b0('0x23')](saveUpdates(_0x222174['body'],null))[_0xe0b0('0x23')](respondWithResult(_0x54cf7b,null))['catch'](handleError(_0x54cf7b,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index c36e673..3382082 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 _0xf538=['report_call','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./voiceCallReport.attributes','define','VoiceCallReport'];(function(_0x546b40,_0x148453){var _0xc4fd89=function(_0xed4cd8){while(--_0xed4cd8){_0x546b40['push'](_0x546b40['shift']());}};_0xc4fd89(++_0x148453);}(_0xf538,0x65));var _0x8f53=function(_0x1d30c7,_0x3a7edb){_0x1d30c7=_0x1d30c7-0x0;var _0x26b3b0=_0xf538[_0x1d30c7];return _0x26b3b0;};'use strict';var _=require('lodash');var util=require(_0x8f53('0x0'));var logger=require(_0x8f53('0x1'))('api');var moment=require('moment');var BPromise=require(_0x8f53('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8f53('0x3'));var rimraf=require(_0x8f53('0x4'));var config=require(_0x8f53('0x5'));var attributes=require(_0x8f53('0x6'));module['exports']=function(_0x423085,_0x3e46c4){return _0x423085[_0x8f53('0x7')](_0x8f53('0x8'),attributes,{'tableName':_0x8f53('0x9'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x02d9=['bluebird','path','rimraf','../../config/environment','./voiceCallReport.attributes','exports','VoiceCallReport','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x51a09f,_0x2b8031){var _0x21804a=function(_0x71b980){while(--_0x71b980){_0x51a09f['push'](_0x51a09f['shift']());}};_0x21804a(++_0x2b8031);}(_0x02d9,0x97));var _0x902d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x02d9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x902d('0x0'));var util=require(_0x902d('0x1'));var logger=require(_0x902d('0x2'))(_0x902d('0x3'));var moment=require(_0x902d('0x4'));var BPromise=require(_0x902d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x902d('0x6'));var rimraf=require(_0x902d('0x7'));var config=require(_0x902d('0x8'));var attributes=require(_0x902d('0x9'));module[_0x902d('0xa')]=function(_0x6b5dfe,_0x1dc30a){return _0x6b5dfe['define'](_0x902d('0xb'),attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':[_0x902d('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index f7e4b3c..808956e 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 _0x1810=['http','request','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','VoiceCallReport','findAll','options','attributes','limit','include','map','model','GetVoiceCallReport','CreateVoiceCallReport','create','body','raw','then','UpdateVoiceCallReport','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x191394,_0x19f5a1){var _0x214099=function(_0xa87e6b){while(--_0xa87e6b){_0x191394['push'](_0x191394['shift']());}};_0x214099(++_0x19f5a1);}(_0x1810,0x65));var _0x0181=function(_0x12c98e,_0x2d0b4b){_0x12c98e=_0x12c98e-0x0;var _0x198b35=_0x1810[_0x12c98e];return _0x198b35;};'use strict';var _=require(_0x0181('0x0'));var util=require(_0x0181('0x1'));var moment=require(_0x0181('0x2'));var BPromise=require('bluebird');var rs=require(_0x0181('0x3'));var fs=require('fs');var Redis=require(_0x0181('0x4'));var db=require(_0x0181('0x5'))['db'];var utils=require(_0x0181('0x6'));var logger=require('../../config/logger')(_0x0181('0x7'));var config=require(_0x0181('0x8'));var jayson=require(_0x0181('0x9'));var client=jayson['client'][_0x0181('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5f2c96,_0x521d36,_0x4fcc77){return new BPromise(function(_0x491e8d,_0x322ff8){return client[_0x0181('0xb')](_0x5f2c96,_0x4fcc77)['then'](function(_0x259995){logger[_0x0181('0xc')](_0x0181('0xd'),_0x521d36,_0x0181('0xe'));logger[_0x0181('0xf')](_0x0181('0x10'),_0x521d36,_0x0181('0xe'),JSON[_0x0181('0x11')](_0x259995));if(_0x259995[_0x0181('0x12')]){if(_0x259995['error'][_0x0181('0x13')]===0x1f4){logger[_0x0181('0x12')]('VoiceCallReport,\x20%s,\x20%s',_0x521d36,_0x259995[_0x0181('0x12')][_0x0181('0x14')]);return _0x322ff8(_0x259995[_0x0181('0x12')][_0x0181('0x14')]);}logger[_0x0181('0x12')](_0x0181('0xd'),_0x521d36,_0x259995[_0x0181('0x12')][_0x0181('0x14')]);return _0x491e8d(_0x259995[_0x0181('0x12')][_0x0181('0x14')]);}else{logger['info'](_0x0181('0xd'),_0x521d36,_0x0181('0xe'));_0x491e8d(_0x259995['result'][_0x0181('0x14')]);}})[_0x0181('0x15')](function(_0x167ad4){logger['error'](_0x0181('0xd'),_0x521d36,_0x167ad4);_0x322ff8(_0x167ad4);});});}exports['GetVoiceCallReport']=function(_0x236a90){var _0x423b6d=this;return new Promise(function(_0x35908f,_0x29ede6){return db[_0x0181('0x16')][_0x0181('0x17')]({'raw':_0x236a90[_0x0181('0x18')]?_0x236a90['options']['raw']===undefined?!![]:![]:!![],'where':_0x236a90[_0x0181('0x18')]?_0x236a90[_0x0181('0x18')]['where']||null:null,'attributes':_0x236a90['options']?_0x236a90[_0x0181('0x18')][_0x0181('0x19')]||null:null,'limit':_0x236a90['options']?_0x236a90[_0x0181('0x18')][_0x0181('0x1a')]||null:null,'include':_0x236a90['options']?_0x236a90['options'][_0x0181('0x1b')]?_[_0x0181('0x1c')](_0x236a90['options'][_0x0181('0x1b')],function(_0x2998a3){return{'model':db[_0x2998a3[_0x0181('0x1d')]],'as':_0x2998a3['as'],'attributes':_0x2998a3[_0x0181('0x19')],'include':_0x2998a3[_0x0181('0x1b')]?_[_0x0181('0x1c')](_0x2998a3[_0x0181('0x1b')],function(_0x200893){return{'model':db[_0x200893[_0x0181('0x1d')]],'as':_0x200893['as'],'attributes':_0x200893['attributes'],'include':_0x200893[_0x0181('0x1b')]?_['map'](_0x200893[_0x0181('0x1b')],function(_0x337cb1){return{'model':db[_0x337cb1['model']],'as':_0x337cb1['as'],'attributes':_0x337cb1[_0x0181('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x563a93){logger[_0x0181('0xc')]('GetVoiceCallReport',_0x236a90);logger['debug'](_0x0181('0x1e'),_0x236a90,JSON['stringify'](_0x563a93));_0x35908f(_0x563a93);})[_0x0181('0x15')](function(_0x4c5a69){logger[_0x0181('0x12')](_0x0181('0x1e'),_0x4c5a69[_0x0181('0x14')],_0x236a90);_0x29ede6(_0x423b6d[_0x0181('0x12')](0x1f4,_0x4c5a69['message']));});});};exports[_0x0181('0x1f')]=function(_0x4cc10b){var _0xeba74d=this;return new Promise(function(_0x5843d5,_0x1aa18b){return db[_0x0181('0x16')][_0x0181('0x20')](_0x4cc10b[_0x0181('0x21')],{'raw':_0x4cc10b[_0x0181('0x18')]?_0x4cc10b[_0x0181('0x18')][_0x0181('0x22')]===undefined?!![]:![]:!![]})[_0x0181('0x23')](function(_0x4392d6){logger[_0x0181('0xc')](_0x0181('0x1f'),_0x4cc10b);logger[_0x0181('0xf')](_0x0181('0x1f'),_0x4cc10b,JSON['stringify'](_0x4392d6));_0x5843d5(_0x4392d6);})[_0x0181('0x15')](function(_0x4a8728){logger['error'](_0x0181('0x1f'),_0x4a8728[_0x0181('0x14')],_0x4cc10b);_0x1aa18b(_0xeba74d['error'](0x1f4,_0x4a8728[_0x0181('0x14')]));});});};exports[_0x0181('0x24')]=function(_0x90f4a4){var _0xca8f7a=this;return new Promise(function(_0x4ad86c,_0x294ac7){return db[_0x0181('0x16')]['update'](_0x90f4a4[_0x0181('0x21')],{'raw':_0x90f4a4[_0x0181('0x18')]?_0x90f4a4['options'][_0x0181('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x90f4a4[_0x0181('0x18')]?_0x90f4a4['options']['where']||null:null,'attributes':_0x90f4a4[_0x0181('0x18')]?_0x90f4a4[_0x0181('0x18')][_0x0181('0x19')]||null:null,'limit':_0x90f4a4[_0x0181('0x18')]?_0x90f4a4[_0x0181('0x18')][_0x0181('0x1a')]||null:null})['then'](function(_0x43fcc5){logger[_0x0181('0xc')](_0x0181('0x24'),_0x90f4a4);logger[_0x0181('0xf')](_0x0181('0x24'),_0x90f4a4,JSON[_0x0181('0x11')](_0x43fcc5));_0x4ad86c(_0x43fcc5);})['catch'](function(_0x31a1e6){logger[_0x0181('0x12')]('UpdateVoiceCallReport',_0x31a1e6['message'],_0x90f4a4);_0x294ac7(_0xca8f7a['error'](0x1f4,_0x31a1e6[_0x0181('0x14')]));});});}; \ No newline at end of file +var _0x082e=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceCallReport','findAll','options','raw','where','include','map','model','attributes','CreateVoiceCallReport','VoiceCallReport','UpdateVoiceCallReport','update','body','limit','lodash'];(function(_0x6107d8,_0x516ed7){var _0x5d3c82=function(_0x17e896){while(--_0x17e896){_0x6107d8['push'](_0x6107d8['shift']());}};_0x5d3c82(++_0x516ed7);}(_0x082e,0x1eb));var _0xe082=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x082e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe082('0x0'));var util=require(_0xe082('0x1'));var moment=require(_0xe082('0x2'));var BPromise=require(_0xe082('0x3'));var rs=require(_0xe082('0x4'));var fs=require('fs');var Redis=require(_0xe082('0x5'));var db=require(_0xe082('0x6'))['db'];var utils=require(_0xe082('0x7'));var logger=require(_0xe082('0x8'))(_0xe082('0x9'));var config=require(_0xe082('0xa'));var jayson=require(_0xe082('0xb'));var client=jayson[_0xe082('0xc')][_0xe082('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x2259e9,_0x3965a4,_0x59ff44){return new BPromise(function(_0x3171fa,_0x427bb5){return client['request'](_0x2259e9,_0x59ff44)[_0xe082('0xe')](function(_0x13ec0f){logger[_0xe082('0xf')](_0xe082('0x10'),_0x3965a4,_0xe082('0x11'));logger[_0xe082('0x12')](_0xe082('0x13'),_0x3965a4,_0xe082('0x11'),JSON[_0xe082('0x14')](_0x13ec0f));if(_0x13ec0f['error']){if(_0x13ec0f[_0xe082('0x15')][_0xe082('0x16')]===0x1f4){logger[_0xe082('0x15')](_0xe082('0x10'),_0x3965a4,_0x13ec0f[_0xe082('0x15')][_0xe082('0x17')]);return _0x427bb5(_0x13ec0f[_0xe082('0x15')][_0xe082('0x17')]);}logger[_0xe082('0x15')]('VoiceCallReport,\x20%s,\x20%s',_0x3965a4,_0x13ec0f[_0xe082('0x15')][_0xe082('0x17')]);return _0x3171fa(_0x13ec0f[_0xe082('0x15')]['message']);}else{logger[_0xe082('0xf')](_0xe082('0x10'),_0x3965a4,_0xe082('0x11'));_0x3171fa(_0x13ec0f[_0xe082('0x18')][_0xe082('0x17')]);}})[_0xe082('0x19')](function(_0x45ad7d){logger['error'](_0xe082('0x10'),_0x3965a4,_0x45ad7d);_0x427bb5(_0x45ad7d);});});}exports[_0xe082('0x1a')]=function(_0x31f7a1){var _0x81eff3=this;return new Promise(function(_0x2e546f,_0x59252c){return db['VoiceCallReport'][_0xe082('0x1b')]({'raw':_0x31f7a1[_0xe082('0x1c')]?_0x31f7a1[_0xe082('0x1c')][_0xe082('0x1d')]===undefined?!![]:![]:!![],'where':_0x31f7a1['options']?_0x31f7a1[_0xe082('0x1c')][_0xe082('0x1e')]||null:null,'attributes':_0x31f7a1[_0xe082('0x1c')]?_0x31f7a1[_0xe082('0x1c')]['attributes']||null:null,'limit':_0x31f7a1[_0xe082('0x1c')]?_0x31f7a1[_0xe082('0x1c')]['limit']||null:null,'include':_0x31f7a1['options']?_0x31f7a1[_0xe082('0x1c')][_0xe082('0x1f')]?_[_0xe082('0x20')](_0x31f7a1['options']['include'],function(_0x541026){return{'model':db[_0x541026[_0xe082('0x21')]],'as':_0x541026['as'],'attributes':_0x541026[_0xe082('0x22')],'include':_0x541026[_0xe082('0x1f')]?_['map'](_0x541026['include'],function(_0x31db19){return{'model':db[_0x31db19[_0xe082('0x21')]],'as':_0x31db19['as'],'attributes':_0x31db19[_0xe082('0x22')],'include':_0x31db19[_0xe082('0x1f')]?_[_0xe082('0x20')](_0x31db19['include'],function(_0x583a82){return{'model':db[_0x583a82[_0xe082('0x21')]],'as':_0x583a82['as'],'attributes':_0x583a82['attributes']};}):[]};}):[]};}):[]:[]})[_0xe082('0xe')](function(_0x4e6ca7){logger[_0xe082('0xf')](_0xe082('0x1a'),_0x31f7a1);logger[_0xe082('0x12')](_0xe082('0x1a'),_0x31f7a1,JSON[_0xe082('0x14')](_0x4e6ca7));_0x2e546f(_0x4e6ca7);})['catch'](function(_0x5214bf){logger[_0xe082('0x15')]('GetVoiceCallReport',_0x5214bf['message'],_0x31f7a1);_0x59252c(_0x81eff3[_0xe082('0x15')](0x1f4,_0x5214bf[_0xe082('0x17')]));});});};exports[_0xe082('0x23')]=function(_0x3e519c){var _0x47d891=this;return new Promise(function(_0x1136de,_0x381192){return db[_0xe082('0x24')]['create'](_0x3e519c['body'],{'raw':_0x3e519c[_0xe082('0x1c')]?_0x3e519c[_0xe082('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0xe082('0xe')](function(_0x5a970a){logger[_0xe082('0xf')](_0xe082('0x23'),_0x3e519c);logger[_0xe082('0x12')]('CreateVoiceCallReport',_0x3e519c,JSON[_0xe082('0x14')](_0x5a970a));_0x1136de(_0x5a970a);})[_0xe082('0x19')](function(_0x33e0da){logger[_0xe082('0x15')](_0xe082('0x23'),_0x33e0da[_0xe082('0x17')],_0x3e519c);_0x381192(_0x47d891[_0xe082('0x15')](0x1f4,_0x33e0da[_0xe082('0x17')]));});});};exports[_0xe082('0x25')]=function(_0x37f595){var _0x222fd9=this;return new Promise(function(_0x427d59,_0x38938e){return db[_0xe082('0x24')][_0xe082('0x26')](_0x37f595[_0xe082('0x27')],{'raw':_0x37f595[_0xe082('0x1c')]?_0x37f595[_0xe082('0x1c')][_0xe082('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x37f595[_0xe082('0x1c')]?_0x37f595[_0xe082('0x1c')]['where']||null:null,'attributes':_0x37f595[_0xe082('0x1c')]?_0x37f595['options'][_0xe082('0x22')]||null:null,'limit':_0x37f595[_0xe082('0x1c')]?_0x37f595[_0xe082('0x1c')][_0xe082('0x28')]||null:null})['then'](function(_0x515486){logger[_0xe082('0xf')](_0xe082('0x25'),_0x37f595);logger[_0xe082('0x12')](_0xe082('0x25'),_0x37f595,JSON[_0xe082('0x14')](_0x515486));_0x427d59(_0x515486);})['catch'](function(_0xf8c79f){logger[_0xe082('0x15')](_0xe082('0x25'),_0xf8c79f[_0xe082('0x17')],_0x37f595);_0x38938e(_0x222fd9[_0xe082('0x15')](0x1f4,_0xf8c79f[_0xe082('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index bc5bd67..6f98e80 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 _0x5fd7=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','index','show','post','create','put','delete','/:id','destroy','exports','multer','util'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0x5fd7,0x1a2));var _0x75fd=function(_0x3bca12,_0x3d262a){_0x3bca12=_0x3bca12-0x0;var _0x55b5b7=_0x5fd7[_0x3bca12];return _0x55b5b7;};'use strict';var multer=require(_0x75fd('0x0'));var util=require(_0x75fd('0x1'));var path=require('path');var timeout=require(_0x75fd('0x2'));var express=require(_0x75fd('0x3'));var router=express[_0x75fd('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x75fd('0x5'));var interaction=require(_0x75fd('0x6'));var config=require(_0x75fd('0x7'));var controller=require(_0x75fd('0x8'));router[_0x75fd('0x9')]('/',auth[_0x75fd('0xa')](),controller[_0x75fd('0xb')]);router[_0x75fd('0x9')]('/:id',auth[_0x75fd('0xa')](),controller[_0x75fd('0xc')]);router[_0x75fd('0xd')]('/',auth['isAuthenticated'](),controller[_0x75fd('0xe')]);router[_0x75fd('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x75fd('0x10')](_0x75fd('0x11'),auth[_0x75fd('0xa')](),controller[_0x75fd('0x12')]);module[_0x75fd('0x13')]=router; \ No newline at end of file +var _0x6dd0=['get','isAuthenticated','show','post','create','put','/:id','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller'];(function(_0x49aee4,_0xabdc6c){var _0x4980b7=function(_0x4b1262){while(--_0x4b1262){_0x49aee4['push'](_0x49aee4['shift']());}};_0x4980b7(++_0xabdc6c);}(_0x6dd0,0xcf));var _0x06dd=function(_0xfd31e3,_0x15ecc9){_0xfd31e3=_0xfd31e3-0x0;var _0x350766=_0x6dd0[_0xfd31e3];return _0x350766;};'use strict';var multer=require(_0x06dd('0x0'));var util=require(_0x06dd('0x1'));var path=require('path');var timeout=require(_0x06dd('0x2'));var express=require(_0x06dd('0x3'));var router=express[_0x06dd('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x06dd('0x5'));var interaction=require(_0x06dd('0x6'));var config=require(_0x06dd('0x7'));var controller=require(_0x06dd('0x8'));router[_0x06dd('0x9')]('/',auth[_0x06dd('0xa')](),controller['index']);router[_0x06dd('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x06dd('0xb')]);router[_0x06dd('0xc')]('/',auth['isAuthenticated'](),controller[_0x06dd('0xd')]);router[_0x06dd('0xe')](_0x06dd('0xf'),auth[_0x06dd('0xa')](),controller['update']);router[_0x06dd('0x10')](_0x06dd('0xf'),auth[_0x06dd('0xa')](),controller['destroy']);module[_0x06dd('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 8ff2af9..9c13a82 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 _0x75bf=['getDataValue','options','split','BOOLEAN','sequelize','exports','STRING','name','setDataValue'];(function(_0x435044,_0x36ab8e){var _0x33d4c6=function(_0x15efa0){while(--_0x15efa0){_0x435044['push'](_0x435044['shift']());}};_0x33d4c6(++_0x36ab8e);}(_0x75bf,0x199));var _0xf75b=function(_0x4ef6a3,_0x475432){_0x4ef6a3=_0x4ef6a3-0x0;var _0x3322ec=_0x75bf[_0x4ef6a3];return _0x3322ec;};'use strict';var Sequelize=require(_0xf75b('0x0'));module[_0xf75b('0x1')]={'name':{'type':Sequelize[_0xf75b('0x2')]},'prefix':{'type':Sequelize['STRING'],'unique':_0xf75b('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0xf75b('0x2')],'set':function(_0x5d82f5){this[_0xf75b('0x4')]('options',_0x5d82f5?_0x5d82f5['join'](''):[]);},'get':function(){return this[_0xf75b('0x5')]('options')?this['getDataValue'](_0xf75b('0x6'))[_0xf75b('0x7')](''):[];}},'auth':{'type':Sequelize[_0xf75b('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0xf75b('0x2')]},'record':{'type':Sequelize[_0xf75b('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xf75b('0x2')]},'description':{'type':Sequelize[_0xf75b('0x2')]}}; \ No newline at end of file +var _0x64d1=['split','BOOLEAN','exports','STRING','name','options','join','getDataValue'];(function(_0x1d872b,_0x113336){var _0x146831=function(_0x402f9e){while(--_0x402f9e){_0x1d872b['push'](_0x1d872b['shift']());}};_0x146831(++_0x113336);}(_0x64d1,0x10a));var _0x164d=function(_0x3c8e9a,_0x384306){_0x3c8e9a=_0x3c8e9a-0x0;var _0x2d4c57=_0x64d1[_0x3c8e9a];return _0x2d4c57;};'use strict';var Sequelize=require('sequelize');module[_0x164d('0x0')]={'name':{'type':Sequelize[_0x164d('0x1')]},'prefix':{'type':Sequelize[_0x164d('0x1')],'unique':_0x164d('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0x164d('0x1')],'set':function(_0x2291a7){this['setDataValue'](_0x164d('0x3'),_0x2291a7?_0x2291a7[_0x164d('0x4')](''):[]);},'get':function(){return this[_0x164d('0x5')](_0x164d('0x3'))?this[_0x164d('0x5')](_0x164d('0x3'))[_0x164d('0x6')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize[_0x164d('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x164d('0x1')]},'description':{'type':Sequelize[_0x164d('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index e744498..bb42fda 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 _0x6ce9=['query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','VoiceChanSpy','includeAll','include','findAll','rows','catch','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','params','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','ChanSpies','UserProfileResource','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model'];(function(_0x577379,_0xbd74e6){var _0x177c0f=function(_0x1f3079){while(--_0x1f3079){_0x577379['push'](_0x577379['shift']());}};_0x177c0f(++_0xbd74e6);}(_0x6ce9,0x76));var _0x96ce=function(_0x24f08a,_0x4d5b51){_0x24f08a=_0x24f08a-0x0;var _0x405dcf=_0x6ce9[_0x24f08a];return _0x405dcf;};'use strict';var emlformat=require(_0x96ce('0x0'));var rimraf=require(_0x96ce('0x1'));var zipdir=require(_0x96ce('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x96ce('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x96ce('0x4'));var util=require(_0x96ce('0x5'));var path=require(_0x96ce('0x6'));var sox=require(_0x96ce('0x7'));var csv=require('to-csv');var ejs=require(_0x96ce('0x8'));var fs=require('fs');var fs_extra=require(_0x96ce('0x9'));var _=require(_0x96ce('0xa'));var squel=require('squel');var crypto=require(_0x96ce('0xb'));var jsforce=require(_0x96ce('0xc'));var deskjs=require(_0x96ce('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x96ce('0xe'));var Redis=require(_0x96ce('0xf'));var authService=require(_0x96ce('0x10'));var qs=require(_0x96ce('0x11'));var as=require(_0x96ce('0x12'));var hardwareService=require(_0x96ce('0x13'));var logger=require(_0x96ce('0x14'))(_0x96ce('0x15'));var utils=require(_0x96ce('0x16'));var config=require(_0x96ce('0x17'));var licenseUtil=require(_0x96ce('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x41e35b,_0xb2a714){_0xb2a714=_0xb2a714||0xcc;return function(_0xa3c20e){if(_0xa3c20e){return _0x41e35b['sendStatus'](_0xb2a714);}return _0x41e35b[_0x96ce('0x19')](_0xb2a714)[_0x96ce('0x1a')]();};}function respondWithResult(_0x167bf4,_0x715161){_0x715161=_0x715161||0xc8;return function(_0x402431){if(_0x402431){return _0x167bf4[_0x96ce('0x19')](_0x715161)[_0x96ce('0x1b')](_0x402431);}};}function respondWithFilteredResult(_0x3d46d1,_0x329d7a){return function(_0xc3f97f){if(_0xc3f97f){var _0x1515ea=typeof _0x329d7a[_0x96ce('0x1c')]===_0x96ce('0x1d')&&typeof _0x329d7a[_0x96ce('0x1e')]===_0x96ce('0x1d');var _0x53eaa9=_0xc3f97f['count'];var _0x15b4a1=_0x1515ea?0x0:_0x329d7a[_0x96ce('0x1c')];var _0x2db255=_0x1515ea?_0xc3f97f[_0x96ce('0x1f')]:_0x329d7a[_0x96ce('0x1c')]+_0x329d7a[_0x96ce('0x1e')];var _0x381915;if(_0x2db255>=_0x53eaa9){_0x2db255=_0x53eaa9;_0x381915=0xc8;}else{_0x381915=0xce;}_0x3d46d1[_0x96ce('0x19')](_0x381915);return _0x3d46d1[_0x96ce('0x20')](_0x96ce('0x21'),_0x15b4a1+'-'+_0x2db255+'/'+_0x53eaa9)['json'](_0xc3f97f);}return null;};}function patchUpdates(_0x8ad008){return function(_0x162d2d){try{jsonpatch[_0x96ce('0x22')](_0x162d2d,_0x8ad008,!![]);}catch(_0x30dcdf){return BPromise[_0x96ce('0x23')](_0x30dcdf);}return _0x162d2d[_0x96ce('0x24')]();};}function saveUpdates(_0x2002dd,_0x5014bb){return function(_0x5c39a2){if(_0x5c39a2){return _0x5c39a2[_0x96ce('0x25')](_0x2002dd)[_0x96ce('0x26')](function(_0x47a5a6){return _0x47a5a6;});}return null;};}function removeEntity(_0x4f320d,_0x58196f){return function(_0x495b9f){if(_0x495b9f){return _0x495b9f[_0x96ce('0x27')]()[_0x96ce('0x26')](function(){var _0xa703d=_0x495b9f[_0x96ce('0x28')]({'plain':!![]});var _0x56f0dd=_0x96ce('0x29');return db[_0x96ce('0x2a')][_0x96ce('0x27')]({'where':{'type':_0x56f0dd,'resourceId':_0xa703d['id']}})['then'](function(){return _0x495b9f;});})[_0x96ce('0x26')](function(){_0x4f320d[_0x96ce('0x19')](0xcc)[_0x96ce('0x1a')]();});}};}function handleEntityNotFound(_0x25c309,_0x1672b7){return function(_0x558b93){if(!_0x558b93){_0x25c309[_0x96ce('0x2b')](0x194);}return _0x558b93;};}function handleError(_0x4276e0,_0x174c2e){_0x174c2e=_0x174c2e||0x1f4;return function(_0x131073){logger['error'](_0x131073[_0x96ce('0x2c')]);if(_0x131073[_0x96ce('0x2d')]){delete _0x131073[_0x96ce('0x2d')];}_0x4276e0['status'](_0x174c2e)[_0x96ce('0x2e')](_0x131073);};}exports[_0x96ce('0x2f')]=function(_0x710dc8,_0x402ce0){var _0xb4eba9={},_0x31faa1={},_0x4aaed8={'count':0x0,'rows':[]};var _0x272f89=_[_0x96ce('0x30')](db['VoiceChanSpy'][_0x96ce('0x31')],function(_0xb3ab57){return{'name':_0xb3ab57[_0x96ce('0x32')],'type':_0xb3ab57[_0x96ce('0x33')][_0x96ce('0x34')]};});_0x31faa1[_0x96ce('0x35')]=_[_0x96ce('0x30')](_0x272f89,'name');_0x31faa1[_0x96ce('0x36')]=_[_0x96ce('0x37')](_0x710dc8[_0x96ce('0x36')]);_0x31faa1[_0x96ce('0x38')]=_[_0x96ce('0x39')](_0x31faa1[_0x96ce('0x35')],_0x31faa1[_0x96ce('0x36')]);_0xb4eba9[_0x96ce('0x3a')]=_[_0x96ce('0x39')](_0x31faa1[_0x96ce('0x35')],qs[_0x96ce('0x3b')](_0x710dc8[_0x96ce('0x36')]['fields']));_0xb4eba9[_0x96ce('0x3a')]=_0xb4eba9[_0x96ce('0x3a')][_0x96ce('0x3c')]?_0xb4eba9['attributes']:_0x31faa1['model'];if(!_0x710dc8[_0x96ce('0x36')][_0x96ce('0x3d')](_0x96ce('0x3e'))){_0xb4eba9['limit']=qs[_0x96ce('0x1e')](_0x710dc8[_0x96ce('0x36')][_0x96ce('0x1e')]);_0xb4eba9[_0x96ce('0x1c')]=qs[_0x96ce('0x1c')](_0x710dc8['query'][_0x96ce('0x1c')]);}_0xb4eba9[_0x96ce('0x3f')]=qs[_0x96ce('0x40')](_0x710dc8[_0x96ce('0x36')]['sort']);_0xb4eba9[_0x96ce('0x41')]=qs[_0x96ce('0x38')](_[_0x96ce('0x42')](_0x710dc8['query'],_0x31faa1[_0x96ce('0x38')]),_0x272f89);if(_0x710dc8[_0x96ce('0x36')]['filter']){_0xb4eba9[_0x96ce('0x41')]=_[_0x96ce('0x43')](_0xb4eba9[_0x96ce('0x41')],{'$or':_[_0x96ce('0x30')](_0x272f89,function(_0x5d95f1){if(_0x5d95f1['type']!==_0x96ce('0x44')){var _0x4e63eb={};_0x4e63eb[_0x5d95f1[_0x96ce('0x2d')]]={'$like':'%'+_0x710dc8[_0x96ce('0x36')]['filter']+'%'};return _0x4e63eb;}})});}_0xb4eba9=_[_0x96ce('0x43')]({},_0xb4eba9,_0x710dc8[_0x96ce('0x45')]);var _0x5e7e21={'where':_0xb4eba9[_0x96ce('0x41')]};return db[_0x96ce('0x46')][_0x96ce('0x1f')](_0x5e7e21)[_0x96ce('0x26')](function(_0x5cc875){_0x4aaed8[_0x96ce('0x1f')]=_0x5cc875;if(_0x710dc8[_0x96ce('0x36')][_0x96ce('0x47')]){_0xb4eba9[_0x96ce('0x48')]=[{'all':!![]}];}return db[_0x96ce('0x46')][_0x96ce('0x49')](_0xb4eba9);})[_0x96ce('0x26')](function(_0x3d57a9){_0x4aaed8[_0x96ce('0x4a')]=_0x3d57a9;return _0x4aaed8;})['then'](respondWithFilteredResult(_0x402ce0,_0xb4eba9))[_0x96ce('0x4b')](handleError(_0x402ce0,null));};exports['show']=function(_0x961494,_0x2d5c45){var _0x2f33dc={'raw':![],'where':{'id':_0x961494['params']['id']}},_0x20cffe={};_0x20cffe['model']=_[_0x96ce('0x37')](db[_0x96ce('0x46')][_0x96ce('0x31')]);_0x20cffe[_0x96ce('0x36')]=_['keys'](_0x961494['query']);_0x20cffe[_0x96ce('0x38')]=_[_0x96ce('0x39')](_0x20cffe[_0x96ce('0x35')],_0x20cffe[_0x96ce('0x36')]);_0x2f33dc[_0x96ce('0x3a')]=_[_0x96ce('0x39')](_0x20cffe[_0x96ce('0x35')],qs['fields'](_0x961494[_0x96ce('0x36')]['fields']));_0x2f33dc[_0x96ce('0x3a')]=_0x2f33dc['attributes'][_0x96ce('0x3c')]?_0x2f33dc[_0x96ce('0x3a')]:_0x20cffe['model'];if(_0x961494[_0x96ce('0x36')]['includeAll']){_0x2f33dc['include']=[{'all':!![]}];}_0x2f33dc=_[_0x96ce('0x43')]({},_0x2f33dc,_0x961494[_0x96ce('0x45')]);return db[_0x96ce('0x46')][_0x96ce('0x4c')](_0x2f33dc)[_0x96ce('0x26')](handleEntityNotFound(_0x2d5c45,null))[_0x96ce('0x26')](respondWithResult(_0x2d5c45,null))['catch'](handleError(_0x2d5c45,null));};exports[_0x96ce('0x4d')]=function(_0xa9353c,_0x2021aa){return db['VoiceChanSpy']['create'](_0xa9353c[_0x96ce('0x4e')],{})[_0x96ce('0x26')](function(_0x51fb91){var _0x50c1df=_0xa9353c[_0x96ce('0x4f')]['get']({'plain':!![]});if(!_0x50c1df)throw new Error(_0x96ce('0x50'));if(_0x50c1df[_0x96ce('0x51')]===_0x96ce('0x4f')){var _0x5b4b69=_0x51fb91[_0x96ce('0x28')]({'plain':!![]});var _0x59807a=_0x96ce('0x29');return db[_0x96ce('0x52')]['find']({'where':{'name':_0x59807a,'userProfileId':_0x50c1df[_0x96ce('0x53')]},'raw':!![]})['then'](function(_0x445990){if(_0x445990&&_0x445990[_0x96ce('0x54')]===0x0){return db[_0x96ce('0x2a')][_0x96ce('0x4d')]({'name':_0x5b4b69[_0x96ce('0x2d')],'resourceId':_0x5b4b69['id'],'type':_0x445990[_0x96ce('0x2d')],'sectionId':_0x445990['id']},{})[_0x96ce('0x26')](function(){return _0x51fb91;});}else{return _0x51fb91;}})['catch'](function(_0x194d06){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x194d06);throw _0x194d06;});}return _0x51fb91;})[_0x96ce('0x26')](respondWithResult(_0x2021aa,0xc9))['catch'](handleError(_0x2021aa,null));};exports[_0x96ce('0x25')]=function(_0x27a7a8,_0x3054e7){if(_0x27a7a8['body']['id']){delete _0x27a7a8[_0x96ce('0x4e')]['id'];}return db['VoiceChanSpy'][_0x96ce('0x4c')]({'where':{'id':_0x27a7a8[_0x96ce('0x55')]['id']}})[_0x96ce('0x26')](handleEntityNotFound(_0x3054e7,null))[_0x96ce('0x26')](saveUpdates(_0x27a7a8[_0x96ce('0x4e')],null))[_0x96ce('0x26')](respondWithResult(_0x3054e7,null))[_0x96ce('0x4b')](handleError(_0x3054e7,null));};exports[_0x96ce('0x27')]=function(_0x120119,_0x521616){return db[_0x96ce('0x46')][_0x96ce('0x4c')]({'where':{'id':_0x120119[_0x96ce('0x55')]['id']}})[_0x96ce('0x26')](handleEntityNotFound(_0x521616,null))['then'](removeEntity(_0x521616,null))['catch'](handleError(_0x521616,null));}; \ No newline at end of file +var _0x26bc=['UserProfileSection','userProfileId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','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','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','update','then','ChanSpies','UserProfileResource','destroy','sendStatus','error','stack','name','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','VoiceChanSpy','includeAll','include','findAll','rows','catch','show','params','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user'];(function(_0x428af8,_0x477193){var _0x3ecb5e=function(_0x1b1890){while(--_0x1b1890){_0x428af8['push'](_0x428af8['shift']());}};_0x3ecb5e(++_0x477193);}(_0x26bc,0x162));var _0xc26b=function(_0x41be7e,_0x338dea){_0x41be7e=_0x41be7e-0x0;var _0xc9fc83=_0x26bc[_0x41be7e];return _0xc9fc83;};'use strict';var emlformat=require(_0xc26b('0x0'));var rimraf=require(_0xc26b('0x1'));var zipdir=require(_0xc26b('0x2'));var jsonpatch=require(_0xc26b('0x3'));var rp=require(_0xc26b('0x4'));var moment=require('moment');var BPromise=require(_0xc26b('0x5'));var Mustache=require(_0xc26b('0x6'));var util=require(_0xc26b('0x7'));var path=require('path');var sox=require(_0xc26b('0x8'));var csv=require('to-csv');var ejs=require(_0xc26b('0x9'));var fs=require('fs');var fs_extra=require(_0xc26b('0xa'));var _=require(_0xc26b('0xb'));var squel=require('squel');var crypto=require(_0xc26b('0xc'));var jsforce=require(_0xc26b('0xd'));var deskjs=require(_0xc26b('0xe'));var toCsv=require(_0xc26b('0xf'));var querystring=require(_0xc26b('0x10'));var Papa=require(_0xc26b('0x11'));var Redis=require(_0xc26b('0x12'));var authService=require(_0xc26b('0x13'));var qs=require(_0xc26b('0x14'));var as=require(_0xc26b('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc26b('0x16'))(_0xc26b('0x17'));var utils=require(_0xc26b('0x18'));var config=require(_0xc26b('0x19'));var licenseUtil=require(_0xc26b('0x1a'));var db=require(_0xc26b('0x1b'))['db'];function respondWithStatusCode(_0x5c9ca1,_0x3d0813){_0x3d0813=_0x3d0813||0xcc;return function(_0x5a95fc){if(_0x5a95fc){return _0x5c9ca1['sendStatus'](_0x3d0813);}return _0x5c9ca1[_0xc26b('0x1c')](_0x3d0813)[_0xc26b('0x1d')]();};}function respondWithResult(_0x21f711,_0x27d81c){_0x27d81c=_0x27d81c||0xc8;return function(_0x4b692b){if(_0x4b692b){return _0x21f711[_0xc26b('0x1c')](_0x27d81c)[_0xc26b('0x1e')](_0x4b692b);}};}function respondWithFilteredResult(_0x19be02,_0x5bd8c4){return function(_0x20f796){if(_0x20f796){var _0x34e006=typeof _0x5bd8c4['offset']===_0xc26b('0x1f')&&typeof _0x5bd8c4[_0xc26b('0x20')]==='undefined';var _0x1dba27=_0x20f796['count'];var _0x4802c7=_0x34e006?0x0:_0x5bd8c4[_0xc26b('0x21')];var _0x47e75b=_0x34e006?_0x20f796[_0xc26b('0x22')]:_0x5bd8c4[_0xc26b('0x21')]+_0x5bd8c4[_0xc26b('0x20')];var _0x9d9098;if(_0x47e75b>=_0x1dba27){_0x47e75b=_0x1dba27;_0x9d9098=0xc8;}else{_0x9d9098=0xce;}_0x19be02['status'](_0x9d9098);return _0x19be02[_0xc26b('0x23')](_0xc26b('0x24'),_0x4802c7+'-'+_0x47e75b+'/'+_0x1dba27)[_0xc26b('0x1e')](_0x20f796);}return null;};}function patchUpdates(_0x8531d6){return function(_0x3fb860){try{jsonpatch[_0xc26b('0x25')](_0x3fb860,_0x8531d6,!![]);}catch(_0x4f90f3){return BPromise[_0xc26b('0x26')](_0x4f90f3);}return _0x3fb860['save']();};}function saveUpdates(_0x1f8240,_0x129080){return function(_0x282928){if(_0x282928){return _0x282928[_0xc26b('0x27')](_0x1f8240)['then'](function(_0x261d3c){return _0x261d3c;});}return null;};}function removeEntity(_0x297286,_0x176f29){return function(_0x465bdd){if(_0x465bdd){return _0x465bdd['destroy']()[_0xc26b('0x28')](function(){var _0x367824=_0x465bdd['get']({'plain':!![]});var _0x4c0095=_0xc26b('0x29');return db[_0xc26b('0x2a')][_0xc26b('0x2b')]({'where':{'type':_0x4c0095,'resourceId':_0x367824['id']}})[_0xc26b('0x28')](function(){return _0x465bdd;});})[_0xc26b('0x28')](function(){_0x297286[_0xc26b('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3eea3b,_0x5b181d){return function(_0x3e44e2){if(!_0x3e44e2){_0x3eea3b[_0xc26b('0x2c')](0x194);}return _0x3e44e2;};}function handleError(_0x302485,_0x5422df){_0x5422df=_0x5422df||0x1f4;return function(_0x1f7d2e){logger[_0xc26b('0x2d')](_0x1f7d2e[_0xc26b('0x2e')]);if(_0x1f7d2e[_0xc26b('0x2f')]){delete _0x1f7d2e[_0xc26b('0x2f')];}_0x302485[_0xc26b('0x1c')](_0x5422df)['send'](_0x1f7d2e);};}exports[_0xc26b('0x30')]=function(_0x5eaa9a,_0x2f7db7){var _0x4c8a7d={},_0x4a4bb0={},_0x4681ac={'count':0x0,'rows':[]};var _0x405e37=_[_0xc26b('0x31')](db['VoiceChanSpy'][_0xc26b('0x32')],function(_0x1e192c){return{'name':_0x1e192c['fieldName'],'type':_0x1e192c[_0xc26b('0x33')][_0xc26b('0x34')]};});_0x4a4bb0[_0xc26b('0x35')]=_[_0xc26b('0x31')](_0x405e37,_0xc26b('0x2f'));_0x4a4bb0[_0xc26b('0x36')]=_[_0xc26b('0x37')](_0x5eaa9a[_0xc26b('0x36')]);_0x4a4bb0[_0xc26b('0x38')]=_[_0xc26b('0x39')](_0x4a4bb0['model'],_0x4a4bb0[_0xc26b('0x36')]);_0x4c8a7d['attributes']=_[_0xc26b('0x39')](_0x4a4bb0[_0xc26b('0x35')],qs['fields'](_0x5eaa9a[_0xc26b('0x36')][_0xc26b('0x3a')]));_0x4c8a7d[_0xc26b('0x3b')]=_0x4c8a7d[_0xc26b('0x3b')][_0xc26b('0x3c')]?_0x4c8a7d[_0xc26b('0x3b')]:_0x4a4bb0[_0xc26b('0x35')];if(!_0x5eaa9a[_0xc26b('0x36')][_0xc26b('0x3d')](_0xc26b('0x3e'))){_0x4c8a7d['limit']=qs[_0xc26b('0x20')](_0x5eaa9a[_0xc26b('0x36')][_0xc26b('0x20')]);_0x4c8a7d[_0xc26b('0x21')]=qs[_0xc26b('0x21')](_0x5eaa9a[_0xc26b('0x36')][_0xc26b('0x21')]);}_0x4c8a7d[_0xc26b('0x3f')]=qs[_0xc26b('0x40')](_0x5eaa9a[_0xc26b('0x36')][_0xc26b('0x40')]);_0x4c8a7d[_0xc26b('0x41')]=qs[_0xc26b('0x38')](_[_0xc26b('0x42')](_0x5eaa9a[_0xc26b('0x36')],_0x4a4bb0['filters']),_0x405e37);if(_0x5eaa9a[_0xc26b('0x36')]['filter']){_0x4c8a7d[_0xc26b('0x41')]=_[_0xc26b('0x43')](_0x4c8a7d['where'],{'$or':_['map'](_0x405e37,function(_0x19633e){if(_0x19633e[_0xc26b('0x33')]!==_0xc26b('0x44')){var _0x5093a4={};_0x5093a4[_0x19633e['name']]={'$like':'%'+_0x5eaa9a[_0xc26b('0x36')][_0xc26b('0x45')]+'%'};return _0x5093a4;}})});}_0x4c8a7d=_[_0xc26b('0x43')]({},_0x4c8a7d,_0x5eaa9a[_0xc26b('0x46')]);var _0x154190={'where':_0x4c8a7d[_0xc26b('0x41')]};return db[_0xc26b('0x47')][_0xc26b('0x22')](_0x154190)[_0xc26b('0x28')](function(_0x13f760){_0x4681ac[_0xc26b('0x22')]=_0x13f760;if(_0x5eaa9a['query'][_0xc26b('0x48')]){_0x4c8a7d[_0xc26b('0x49')]=[{'all':!![]}];}return db[_0xc26b('0x47')][_0xc26b('0x4a')](_0x4c8a7d);})['then'](function(_0x5e0abc){_0x4681ac[_0xc26b('0x4b')]=_0x5e0abc;return _0x4681ac;})['then'](respondWithFilteredResult(_0x2f7db7,_0x4c8a7d))[_0xc26b('0x4c')](handleError(_0x2f7db7,null));};exports[_0xc26b('0x4d')]=function(_0x2b5ff7,_0x282ff4){var _0x46b39d={'raw':![],'where':{'id':_0x2b5ff7[_0xc26b('0x4e')]['id']}},_0x9e2e90={};_0x9e2e90['model']=_['keys'](db[_0xc26b('0x47')][_0xc26b('0x32')]);_0x9e2e90[_0xc26b('0x36')]=_[_0xc26b('0x37')](_0x2b5ff7['query']);_0x9e2e90[_0xc26b('0x38')]=_['intersection'](_0x9e2e90[_0xc26b('0x35')],_0x9e2e90[_0xc26b('0x36')]);_0x46b39d[_0xc26b('0x3b')]=_[_0xc26b('0x39')](_0x9e2e90[_0xc26b('0x35')],qs['fields'](_0x2b5ff7[_0xc26b('0x36')]['fields']));_0x46b39d[_0xc26b('0x3b')]=_0x46b39d[_0xc26b('0x3b')][_0xc26b('0x3c')]?_0x46b39d[_0xc26b('0x3b')]:_0x9e2e90['model'];if(_0x2b5ff7['query'][_0xc26b('0x48')]){_0x46b39d['include']=[{'all':!![]}];}_0x46b39d=_['merge']({},_0x46b39d,_0x2b5ff7[_0xc26b('0x46')]);return db[_0xc26b('0x47')][_0xc26b('0x4f')](_0x46b39d)[_0xc26b('0x28')](handleEntityNotFound(_0x282ff4,null))[_0xc26b('0x28')](respondWithResult(_0x282ff4,null))[_0xc26b('0x4c')](handleError(_0x282ff4,null));};exports[_0xc26b('0x50')]=function(_0x16933f,_0x3bef7f){return db[_0xc26b('0x47')][_0xc26b('0x50')](_0x16933f[_0xc26b('0x51')],{})[_0xc26b('0x28')](function(_0x312ee4){var _0x5b06b4=_0x16933f['user'][_0xc26b('0x52')]({'plain':!![]});if(!_0x5b06b4)throw new Error(_0xc26b('0x53'));if(_0x5b06b4[_0xc26b('0x54')]===_0xc26b('0x55')){var _0x51448d=_0x312ee4[_0xc26b('0x52')]({'plain':!![]});var _0x5dee03=_0xc26b('0x29');return db[_0xc26b('0x56')]['find']({'where':{'name':_0x5dee03,'userProfileId':_0x5b06b4[_0xc26b('0x57')]},'raw':!![]})['then'](function(_0x5b8502){if(_0x5b8502&&_0x5b8502['autoAssociation']===0x0){return db['UserProfileResource'][_0xc26b('0x50')]({'name':_0x51448d[_0xc26b('0x2f')],'resourceId':_0x51448d['id'],'type':_0x5b8502[_0xc26b('0x2f')],'sectionId':_0x5b8502['id']},{})[_0xc26b('0x28')](function(){return _0x312ee4;});}else{return _0x312ee4;}})['catch'](function(_0x580102){logger[_0xc26b('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x580102);throw _0x580102;});}return _0x312ee4;})[_0xc26b('0x28')](respondWithResult(_0x3bef7f,0xc9))[_0xc26b('0x4c')](handleError(_0x3bef7f,null));};exports['update']=function(_0x304070,_0x3ab92a){if(_0x304070['body']['id']){delete _0x304070[_0xc26b('0x51')]['id'];}return db[_0xc26b('0x47')][_0xc26b('0x4f')]({'where':{'id':_0x304070[_0xc26b('0x4e')]['id']}})[_0xc26b('0x28')](handleEntityNotFound(_0x3ab92a,null))[_0xc26b('0x28')](saveUpdates(_0x304070[_0xc26b('0x51')],null))['then'](respondWithResult(_0x3ab92a,null))[_0xc26b('0x4c')](handleError(_0x3ab92a,null));};exports[_0xc26b('0x2b')]=function(_0x2c3d51,_0x39d256){return db[_0xc26b('0x47')][_0xc26b('0x4f')]({'where':{'id':_0x2c3d51[_0xc26b('0x4e')]['id']}})[_0xc26b('0x28')](handleEntityNotFound(_0x39d256,null))[_0xc26b('0x28')](removeEntity(_0x39d256,null))[_0xc26b('0x4c')](handleError(_0x39d256,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 4e26b35..6f48f2e 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 _0x6428=['CDR(type)=%s','push','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor','length','concat','internal','agent','catch','exports','models','define','then','VoiceExtension','destroy','lodash','bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s','prefix','system','merge','Set'];(function(_0x1c46dc,_0x4ed128){var _0x5e8d18=function(_0x254798){while(--_0x254798){_0x1c46dc['push'](_0x1c46dc['shift']());}};_0x5e8d18(++_0x4ed128);}(_0x6428,0x10d));var _0x8642=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x6428[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x8642('0x0'));var util=require('util');var BPromise=require(_0x8642('0x1'));var attributes=require(_0x8642('0x2'));var getUserApplications=function(_0x5803b6,_0x11e81a,_0x544e0f){var _0x1e3ba8=0x1;var _0x32914b=[];var _0x1eddfd={'context':_0x11e81a[_0x8642('0x3')]||_0x8642('0x4'),'exten':util[_0x8642('0x5')](_0x8642('0x6'),_0x5803b6[_0x8642('0x7')],_0x544e0f),'type':_0x8642('0x8'),'isApp':![],'ChanSpyId':_0x5803b6['id'],'UserId':_0x11e81a['id']};_0x32914b['push'](_[_0x8642('0x9')]({'app':_0x8642('0xa'),'appdata':util[_0x8642('0x5')](_0x8642('0xb'),'chanspy'),'priority':_0x1e3ba8++},_0x1eddfd));if(_0x5803b6['record']){_0x32914b[_0x8642('0xc')](_[_0x8642('0x9')]({'app':_0x8642('0xd'),'appdata':util[_0x8642('0x5')](_0x8642('0xe'),_0x5803b6[_0x8642('0xf')]),'priority':_0x1e3ba8++},_0x1eddfd));}if(_0x5803b6['auth']){_0x32914b[_0x8642('0xc')](_['merge']({'app':_0x8642('0x10'),'appdata':_0x5803b6[_0x8642('0x11')],'priority':_0x1e3ba8++},_0x1eddfd));}_0x32914b[_0x8642('0xc')](_[_0x8642('0x9')]({'app':_0x8642('0x12'),'appdata':util[_0x8642('0x5')](_0x8642('0x13'),_0x11e81a[_0x8642('0x14')],_0x5803b6[_0x8642('0x15')]?_0x5803b6['options'][_0x8642('0x16')](''):''),'priority':_0x1e3ba8++},_0x1eddfd));if(_0x5803b6['record']){_0x32914b[_0x8642('0xc')](_[_0x8642('0x9')]({'app':_0x8642('0x17'),'priority':_0x1e3ba8++},_0x1eddfd));}return _0x32914b;};var getChanSpyApplications=function(_0x3ec93c,_0x45520b){var _0x311ebd=[];for(var _0x478e49=0x0,_0x1d7489=0x1;_0x478e49<_0x45520b[_0x8642('0x18')];_0x478e49++,_0x1d7489=0x1){_0x311ebd=_0x311ebd[_0x8642('0x19')](getUserApplications(_0x3ec93c,_0x45520b[_0x478e49],_0x45520b[_0x478e49]['internal']));if(_0x45520b[_0x478e49][_0x8642('0x1a')]!=_0x45520b[_0x478e49][_0x8642('0x14')]){_0x311ebd=_0x311ebd['concat'](getUserApplications(_0x3ec93c,_0x45520b[_0x478e49],_0x45520b[_0x478e49][_0x8642('0x14')]));}}return _0x311ebd;};var getChanSpyPromise=function(_0x478bc3,_0x3db2a0){return new BPromise(function(_0x185e96,_0x388b89){return _0x478bc3['User']['findAll']({'attributes':['id',_0x8642('0x14'),_0x8642('0x1a')],'where':{'role':_0x8642('0x1b'),'chanspy':!![]},'raw':!![]})['then'](function(_0x1d8f2d){if(_0x1d8f2d){return _0x185e96(getChanSpyApplications(_0x3db2a0,_0x1d8f2d));}return _0x185e96([]);})[_0x8642('0x1c')](function(_0x564e17){_0x388b89(_0x564e17);});});};module[_0x8642('0x1d')]=function(_0x5877e9,_0x5e9456){var _0x451ca0=_0x5877e9[_0x8642('0x1e')];return _0x5877e9[_0x8642('0x1f')]('VoiceChanSpy',attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x46f056,_0x5166a6,_0x446a65){return getChanSpyPromise(_0x451ca0,_0x46f056)[_0x8642('0x20')](function(_0x1bc30e){if(_0x1bc30e&&_0x1bc30e['length']){return _0x451ca0[_0x8642('0x21')]['bulkCreate'](_0x1bc30e);}})['then'](function(){_0x446a65();})[_0x8642('0x1c')](function(_0x4f2563){_0x446a65(_0x4f2563);});},'afterUpdate':function(_0x38685e,_0x442fe0,_0x340b90){return _0x451ca0[_0x8642('0x21')][_0x8642('0x22')]({'where':{'ChanSpyId':_0x38685e['id']}})['then'](function(){return getChanSpyPromise(_0x451ca0,_0x38685e);})['then'](function(_0x2f904e){if(_0x2f904e&&_0x2f904e[_0x8642('0x18')]){return _0x451ca0[_0x8642('0x21')]['bulkCreate'](_0x2f904e);}})[_0x8642('0x20')](function(){_0x340b90();})['catch'](function(_0x40c4b2){_0x340b90(_0x40c4b2);});},'afterDestroy':function(_0x55bc00,_0x1240cf,_0x557387){return _0x451ca0[_0x8642('0x21')]['destroy']({'where':{'ChanSpyId':_0x55bc00['id']}})[_0x8642('0x20')](function(){_0x557387();})[_0x8642('0x1c')](function(_0x52539b){_0x557387(_0x52539b);});}}});}; \ No newline at end of file +var _0x3407=['ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor','length','concat','internal','User','findAll','agent','catch','models','define','VoiceChanSpy','voice_chanspy','then','VoiceExtension','bulkCreate','lodash','util','bluebird','./voiceChanSpy.attributes','from-sip','%s%s','push','merge','Set','format','CDR(type)=%s','chanspy','record','${UNIQUEID}.%s,a','auth','password'];(function(_0x11d116,_0x4ba7ce){var _0x20989e=function(_0x16455f){while(--_0x16455f){_0x11d116['push'](_0x11d116['shift']());}};_0x20989e(++_0x4ba7ce);}(_0x3407,0xa4));var _0x7340=function(_0x3ad85b,_0x4b3c44){_0x3ad85b=_0x3ad85b-0x0;var _0xb8ec16=_0x3407[_0x3ad85b];return _0xb8ec16;};'use strict';var _=require(_0x7340('0x0'));var util=require(_0x7340('0x1'));var BPromise=require(_0x7340('0x2'));var attributes=require(_0x7340('0x3'));var getUserApplications=function(_0x5113a8,_0x31c968,_0x5ae97b){var _0x588cab=0x1;var _0x13c269=[];var _0x4c2e92={'context':_0x31c968['context']||_0x7340('0x4'),'exten':util['format'](_0x7340('0x5'),_0x5113a8['prefix'],_0x5ae97b),'type':'system','isApp':![],'ChanSpyId':_0x5113a8['id'],'UserId':_0x31c968['id']};_0x13c269[_0x7340('0x6')](_[_0x7340('0x7')]({'app':_0x7340('0x8'),'appdata':util[_0x7340('0x9')](_0x7340('0xa'),_0x7340('0xb')),'priority':_0x588cab++},_0x4c2e92));if(_0x5113a8[_0x7340('0xc')]){_0x13c269[_0x7340('0x6')](_['merge']({'app':'MixMonitor','appdata':util[_0x7340('0x9')](_0x7340('0xd'),_0x5113a8['recordingFormat']),'priority':_0x588cab++},_0x4c2e92));}if(_0x5113a8[_0x7340('0xe')]){_0x13c269[_0x7340('0x6')](_[_0x7340('0x7')]({'app':'Authenticate','appdata':_0x5113a8[_0x7340('0xf')],'priority':_0x588cab++},_0x4c2e92));}_0x13c269[_0x7340('0x6')](_['merge']({'app':_0x7340('0x10'),'appdata':util[_0x7340('0x9')](_0x7340('0x11'),_0x31c968[_0x7340('0x12')],_0x5113a8[_0x7340('0x13')]?_0x5113a8[_0x7340('0x13')][_0x7340('0x14')](''):''),'priority':_0x588cab++},_0x4c2e92));if(_0x5113a8['record']){_0x13c269[_0x7340('0x6')](_[_0x7340('0x7')]({'app':_0x7340('0x15'),'priority':_0x588cab++},_0x4c2e92));}return _0x13c269;};var getChanSpyApplications=function(_0x128d0b,_0x2e963d){var _0x283b00=[];for(var _0x1fbad5=0x0,_0x571ea4=0x1;_0x1fbad5<_0x2e963d[_0x7340('0x16')];_0x1fbad5++,_0x571ea4=0x1){_0x283b00=_0x283b00[_0x7340('0x17')](getUserApplications(_0x128d0b,_0x2e963d[_0x1fbad5],_0x2e963d[_0x1fbad5][_0x7340('0x18')]));if(_0x2e963d[_0x1fbad5][_0x7340('0x18')]!=_0x2e963d[_0x1fbad5][_0x7340('0x12')]){_0x283b00=_0x283b00[_0x7340('0x17')](getUserApplications(_0x128d0b,_0x2e963d[_0x1fbad5],_0x2e963d[_0x1fbad5][_0x7340('0x12')]));}}return _0x283b00;};var getChanSpyPromise=function(_0x55c7c9,_0x40f13c){return new BPromise(function(_0x29058c,_0xabc2b7){return _0x55c7c9[_0x7340('0x19')][_0x7340('0x1a')]({'attributes':['id',_0x7340('0x12'),_0x7340('0x18')],'where':{'role':_0x7340('0x1b'),'chanspy':!![]},'raw':!![]})['then'](function(_0x564828){if(_0x564828){return _0x29058c(getChanSpyApplications(_0x40f13c,_0x564828));}return _0x29058c([]);})[_0x7340('0x1c')](function(_0x8bb7da){_0xabc2b7(_0x8bb7da);});});};module['exports']=function(_0x4a595d,_0x2b0fe2){var _0x4aa664=_0x4a595d[_0x7340('0x1d')];return _0x4a595d[_0x7340('0x1e')](_0x7340('0x1f'),attributes,{'tableName':_0x7340('0x20'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x173620,_0x5b3d26,_0x2e4c62){return getChanSpyPromise(_0x4aa664,_0x173620)[_0x7340('0x21')](function(_0x9eb9c5){if(_0x9eb9c5&&_0x9eb9c5[_0x7340('0x16')]){return _0x4aa664[_0x7340('0x22')][_0x7340('0x23')](_0x9eb9c5);}})['then'](function(){_0x2e4c62();})[_0x7340('0x1c')](function(_0x5e2cab){_0x2e4c62(_0x5e2cab);});},'afterUpdate':function(_0x55ad5e,_0x363a50,_0x9eb9da){return _0x4aa664[_0x7340('0x22')]['destroy']({'where':{'ChanSpyId':_0x55ad5e['id']}})['then'](function(){return getChanSpyPromise(_0x4aa664,_0x55ad5e);})[_0x7340('0x21')](function(_0xcee344){if(_0xcee344&&_0xcee344[_0x7340('0x16')]){return _0x4aa664[_0x7340('0x22')][_0x7340('0x23')](_0xcee344);}})[_0x7340('0x21')](function(){_0x9eb9da();})[_0x7340('0x1c')](function(_0x29f53c){_0x9eb9da(_0x29f53c);});},'afterDestroy':function(_0xd9f5f6,_0x1dadaf,_0xcea83a){return _0x4aa664[_0x7340('0x22')]['destroy']({'where':{'ChanSpyId':_0xd9f5f6['id']}})[_0x7340('0x21')](function(){_0xcea83a();})['catch'](function(_0x52f3d5){_0xcea83a(_0x52f3d5);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 4539275..06e38ec 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 _0x8130=['stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','info','VoiceChanSpy,\x20%s,\x20%s','VoiceChanSpy,\x20%s,\x20%s,\x20%s'];(function(_0x44fb60,_0x587b51){var _0x45ad5a=function(_0x104294){while(--_0x104294){_0x44fb60['push'](_0x44fb60['shift']());}};_0x45ad5a(++_0x587b51);}(_0x8130,0x146));var _0x0813=function(_0x4a6c9d,_0x1eddfe){_0x4a6c9d=_0x4a6c9d-0x0;var _0x289fcd=_0x8130[_0x4a6c9d];return _0x289fcd;};'use strict';var _=require(_0x0813('0x0'));var util=require(_0x0813('0x1'));var moment=require('moment');var BPromise=require(_0x0813('0x2'));var rs=require(_0x0813('0x3'));var fs=require('fs');var Redis=require(_0x0813('0x4'));var db=require(_0x0813('0x5'))['db'];var utils=require(_0x0813('0x6'));var logger=require(_0x0813('0x7'))('rpc');var config=require(_0x0813('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0813('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2df45a,_0x2bbdfd,_0x19a508){return new BPromise(function(_0x2ab8f0,_0x115a90){return client[_0x0813('0xa')](_0x2df45a,_0x19a508)['then'](function(_0x44ec2c){logger[_0x0813('0xb')](_0x0813('0xc'),_0x2bbdfd,'request\x20sent');logger['debug'](_0x0813('0xd'),_0x2bbdfd,'request\x20sent',JSON[_0x0813('0xe')](_0x44ec2c));if(_0x44ec2c['error']){if(_0x44ec2c[_0x0813('0xf')][_0x0813('0x10')]===0x1f4){logger[_0x0813('0xf')](_0x0813('0xc'),_0x2bbdfd,_0x44ec2c['error']['message']);return _0x115a90(_0x44ec2c[_0x0813('0xf')][_0x0813('0x11')]);}logger['error'](_0x0813('0xc'),_0x2bbdfd,_0x44ec2c['error']['message']);return _0x2ab8f0(_0x44ec2c[_0x0813('0xf')][_0x0813('0x11')]);}else{logger['info'](_0x0813('0xc'),_0x2bbdfd,'request\x20sent');_0x2ab8f0(_0x44ec2c[_0x0813('0x12')][_0x0813('0x11')]);}})[_0x0813('0x13')](function(_0xee126d){logger[_0x0813('0xf')](_0x0813('0xc'),_0x2bbdfd,_0xee126d);_0x115a90(_0xee126d);});});} \ No newline at end of file +var _0x6324=['client','http','then','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceChanSpy,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','jayson/promise'];(function(_0x4e1d48,_0x234135){var _0x17cd6f=function(_0x1ac9c5){while(--_0x1ac9c5){_0x4e1d48['push'](_0x4e1d48['shift']());}};_0x17cd6f(++_0x234135);}(_0x6324,0x142));var _0x4632=function(_0x3e618a,_0x135251){_0x3e618a=_0x3e618a-0x0;var _0x1f3d61=_0x6324[_0x3e618a];return _0x1f3d61;};'use strict';var _=require(_0x4632('0x0'));var util=require(_0x4632('0x1'));var moment=require(_0x4632('0x2'));var BPromise=require(_0x4632('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4632('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4632('0x5'));var logger=require('../../config/logger')(_0x4632('0x6'));var config=require('../../config/environment');var jayson=require(_0x4632('0x7'));var client=jayson[_0x4632('0x8')][_0x4632('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x126e9a,_0x4a15b2,_0x17e860){return new BPromise(function(_0x44dd6d,_0x390a46){return client['request'](_0x126e9a,_0x17e860)[_0x4632('0xa')](function(_0x47824c){logger['info']('VoiceChanSpy,\x20%s,\x20%s',_0x4a15b2,_0x4632('0xb'));logger[_0x4632('0xc')](_0x4632('0xd'),_0x4a15b2,_0x4632('0xb'),JSON[_0x4632('0xe')](_0x47824c));if(_0x47824c[_0x4632('0xf')]){if(_0x47824c[_0x4632('0xf')][_0x4632('0x10')]===0x1f4){logger['error'](_0x4632('0x11'),_0x4a15b2,_0x47824c['error'][_0x4632('0x12')]);return _0x390a46(_0x47824c[_0x4632('0xf')][_0x4632('0x12')]);}logger[_0x4632('0xf')]('VoiceChanSpy,\x20%s,\x20%s',_0x4a15b2,_0x47824c[_0x4632('0xf')][_0x4632('0x12')]);return _0x44dd6d(_0x47824c[_0x4632('0xf')][_0x4632('0x12')]);}else{logger[_0x4632('0x13')]('VoiceChanSpy,\x20%s,\x20%s',_0x4a15b2,'request\x20sent');_0x44dd6d(_0x47824c[_0x4632('0x14')][_0x4632('0x12')]);}})[_0x4632('0x15')](function(_0x125eb9){logger['error'](_0x4632('0x11'),_0x4a15b2,_0x125eb9);_0x390a46(_0x125eb9);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index b51ebf1..e00d727 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 _0xdbdb=['post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','isAuthenticated','index','get','/:id','show'];(function(_0x8ae98b,_0x155f88){var _0xc30bd4=function(_0x5ca462){while(--_0x5ca462){_0x8ae98b['push'](_0x8ae98b['shift']());}};_0xc30bd4(++_0x155f88);}(_0xdbdb,0x17d));var _0xbdbd=function(_0x32a767,_0x4e3e76){_0x32a767=_0x32a767-0x0;var _0x2b4e6d=_0xdbdb[_0x32a767];return _0x2b4e6d;};'use strict';var multer=require(_0xbdbd('0x0'));var util=require(_0xbdbd('0x1'));var path=require(_0xbdbd('0x2'));var timeout=require(_0xbdbd('0x3'));var express=require('express');var router=express[_0xbdbd('0x4')]();var fs_extra=require(_0xbdbd('0x5'));var auth=require(_0xbdbd('0x6'));var interaction=require(_0xbdbd('0x7'));var config=require(_0xbdbd('0x8'));var controller=require(_0xbdbd('0x9'));router['get']('/',auth[_0xbdbd('0xa')](),controller[_0xbdbd('0xb')]);router[_0xbdbd('0xc')](_0xbdbd('0xd'),auth[_0xbdbd('0xa')](),controller[_0xbdbd('0xe')]);router[_0xbdbd('0xf')]('/',auth[_0xbdbd('0xa')](),controller[_0xbdbd('0x10')]);router[_0xbdbd('0x11')](_0xbdbd('0xd'),auth['isAuthenticated'](),controller[_0xbdbd('0x12')]);router[_0xbdbd('0x13')](_0xbdbd('0xd'),auth[_0xbdbd('0xa')](),controller[_0xbdbd('0x14')]);module[_0xbdbd('0x15')]=router; \ No newline at end of file +var _0x1d0c=['path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','index','/:id','isAuthenticated','post','put','update','delete','destroy','exports','util'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x1d0c,0x18f));var _0xc1d0=function(_0x1c37b5,_0x5462d1){_0x1c37b5=_0x1c37b5-0x0;var _0x2abe7a=_0x1d0c[_0x1c37b5];return _0x2abe7a;};'use strict';var multer=require('multer');var util=require(_0xc1d0('0x0'));var path=require(_0xc1d0('0x1'));var timeout=require('connect-timeout');var express=require(_0xc1d0('0x2'));var router=express[_0xc1d0('0x3')]();var fs_extra=require(_0xc1d0('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xc1d0('0x5'));var config=require(_0xc1d0('0x6'));var controller=require('./voiceContext.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xc1d0('0x7')]);router['get'](_0xc1d0('0x8'),auth[_0xc1d0('0x9')](),controller['show']);router[_0xc1d0('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc1d0('0xb')](_0xc1d0('0x8'),auth[_0xc1d0('0x9')](),controller[_0xc1d0('0xc')]);router[_0xc1d0('0xd')](_0xc1d0('0x8'),auth[_0xc1d0('0x9')](),controller[_0xc1d0('0xe')]);module[_0xc1d0('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index e1e28e9..23f3723 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 _0xd05a=['BOOLEAN','sequelize','name'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0xd05a,0x16f));var _0xad05=function(_0x1eabbf,_0x2d35f0){_0x1eabbf=_0x1eabbf-0x0;var _0x50a21c=_0xd05a[_0x1eabbf];return _0x50a21c;};'use strict';var Sequelize=require(_0xad05('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xad05('0x1')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xad05('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x6fc5=['BOOLEAN','sequelize','exports','STRING','name'];(function(_0x187caa,_0x4eb368){var _0x288473=function(_0x368efe){while(--_0x368efe){_0x187caa['push'](_0x187caa['shift']());}};_0x288473(++_0x4eb368);}(_0x6fc5,0x173));var _0x56fc=function(_0x898b5,_0x389f86){_0x898b5=_0x898b5-0x0;var _0x3af2d8=_0x6fc5[_0x898b5];return _0x3af2d8;};'use strict';var Sequelize=require(_0x56fc('0x0'));module[_0x56fc('0x1')]={'name':{'type':Sequelize[_0x56fc('0x2')],'unique':_0x56fc('0x3')},'description':{'type':Sequelize[_0x56fc('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x56fc('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index b893c02..6886c5a 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 _0x86f6=['model','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filters','merge','VIRTUAL','filter','options','findAll','rows','show','params','includeAll','include','create','body','join','root','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','readFileSync','chan_sip.so','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','reject','update','destroy','Contexts','UserProfileResource','stack','name','send','index','map','VoiceContext','rawAttributes','fieldName','type'];(function(_0x24ac2d,_0x550b0b){var _0x4d2ce3=function(_0x11a000){while(--_0x11a000){_0x24ac2d['push'](_0x24ac2d['shift']());}};_0x4d2ce3(++_0x550b0b);}(_0x86f6,0xfc));var _0x686f=function(_0xd5c308,_0x5d6ae6){_0xd5c308=_0xd5c308-0x0;var _0x42d6bd=_0x86f6[_0xd5c308];return _0x42d6bd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x686f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x686f('0x1'));var rp=require(_0x686f('0x2'));var moment=require(_0x686f('0x3'));var BPromise=require(_0x686f('0x4'));var Mustache=require(_0x686f('0x5'));var util=require(_0x686f('0x6'));var path=require(_0x686f('0x7'));var sox=require(_0x686f('0x8'));var csv=require(_0x686f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x686f('0xa'));var squel=require(_0x686f('0xb'));var crypto=require('crypto');var jsforce=require(_0x686f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x686f('0x9'));var querystring=require(_0x686f('0xd'));var Papa=require(_0x686f('0xe'));var Redis=require(_0x686f('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x686f('0x10'));var as=require(_0x686f('0x11'));var hardwareService=require(_0x686f('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x686f('0x13'));var config=require(_0x686f('0x14'));var licenseUtil=require(_0x686f('0x15'));var db=require(_0x686f('0x16'))['db'];var jayson=require(_0x686f('0x17'));var client=jayson['client'][_0x686f('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x29e343,_0x5b5212,_0x39a9d1,_0x2edada){return new BPromise(function(_0x30e411,_0x30d4ed){var _0x4ef8fb=_0x2edada||client;return _0x4ef8fb[_0x686f('0x19')](_0x29e343,_0x39a9d1)[_0x686f('0x1a')](function(_0x2c105e){logger[_0x686f('0x1b')](_0x686f('0x1c'),_0x5b5212,_0x686f('0x1d'));logger['debug']('VoiceContext,\x20%s,\x20%s,\x20%s',_0x5b5212,_0x686f('0x1d'),JSON[_0x686f('0x1e')](_0x2c105e));if(_0x2c105e[_0x686f('0x1f')]){if(_0x2c105e[_0x686f('0x1f')][_0x686f('0x20')]===0x1f4){logger[_0x686f('0x1f')](_0x686f('0x1c'),_0x5b5212,_0x2c105e[_0x686f('0x1f')][_0x686f('0x21')]);return _0x30d4ed(_0x2c105e[_0x686f('0x1f')][_0x686f('0x21')]);}logger[_0x686f('0x1f')](_0x686f('0x1c'),_0x5b5212,_0x2c105e[_0x686f('0x1f')]['message']);return _0x30e411(_0x2c105e[_0x686f('0x1f')]['message']);}else{logger['info'](_0x686f('0x1c'),_0x5b5212,'request\x20sent');_0x30e411(_0x2c105e[_0x686f('0x22')]['message']);}})[_0x686f('0x23')](function(_0x2cc596){logger[_0x686f('0x1f')](_0x686f('0x1c'),_0x5b5212,_0x2cc596);_0x30d4ed(_0x2cc596);});});}function respondWithStatusCode(_0x45d815,_0x29ed21){_0x29ed21=_0x29ed21||0xcc;return function(_0xb98304){if(_0xb98304){return _0x45d815[_0x686f('0x24')](_0x29ed21);}return _0x45d815['status'](_0x29ed21)[_0x686f('0x25')]();};}function respondWithResult(_0x2898ab,_0x311808){_0x311808=_0x311808||0xc8;return function(_0x3d1f21){if(_0x3d1f21){return _0x2898ab[_0x686f('0x26')](_0x311808)[_0x686f('0x27')](_0x3d1f21);}};}function respondWithFilteredResult(_0x4cc35d,_0x51fade){return function(_0x53945c){if(_0x53945c){var _0xaab9c3=typeof _0x51fade[_0x686f('0x28')]==='undefined'&&typeof _0x51fade[_0x686f('0x29')]===_0x686f('0x2a');var _0x53495e=_0x53945c[_0x686f('0x2b')];var _0x21571b=_0xaab9c3?0x0:_0x51fade[_0x686f('0x28')];var _0x5c4829=_0xaab9c3?_0x53945c[_0x686f('0x2b')]:_0x51fade[_0x686f('0x28')]+_0x51fade['limit'];var _0x29ff45;if(_0x5c4829>=_0x53495e){_0x5c4829=_0x53495e;_0x29ff45=0xc8;}else{_0x29ff45=0xce;}_0x4cc35d[_0x686f('0x26')](_0x29ff45);return _0x4cc35d[_0x686f('0x2c')](_0x686f('0x2d'),_0x21571b+'-'+_0x5c4829+'/'+_0x53495e)['json'](_0x53945c);}return null;};}function patchUpdates(_0x3c1958){return function(_0x2f3235){try{jsonpatch['apply'](_0x2f3235,_0x3c1958,!![]);}catch(_0x5afc2a){return BPromise[_0x686f('0x2e')](_0x5afc2a);}return _0x2f3235['save']();};}function saveUpdates(_0x2b8f4b,_0x410db5){return function(_0x1796d3){if(_0x1796d3){return _0x1796d3[_0x686f('0x2f')](_0x2b8f4b)['then'](function(_0x10375d){return _0x10375d;});}return null;};}function removeEntity(_0x3f3fe3,_0x249644){return function(_0x19864e){if(_0x19864e){return _0x19864e[_0x686f('0x30')]()[_0x686f('0x1a')](function(){var _0x222e00=_0x19864e['get']({'plain':!![]});var _0x4c5caa=_0x686f('0x31');return db[_0x686f('0x32')]['destroy']({'where':{'type':_0x4c5caa,'resourceId':_0x222e00['id']}})[_0x686f('0x1a')](function(){return _0x19864e;});})['then'](function(){_0x3f3fe3[_0x686f('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x310e49,_0x32b190){return function(_0x295692){if(!_0x295692){_0x310e49[_0x686f('0x24')](0x194);}return _0x295692;};}function handleError(_0x16d561,_0x43435d){_0x43435d=_0x43435d||0x1f4;return function(_0x26f5b2){logger[_0x686f('0x1f')](_0x26f5b2[_0x686f('0x33')]);if(_0x26f5b2[_0x686f('0x34')]){delete _0x26f5b2[_0x686f('0x34')];}_0x16d561[_0x686f('0x26')](_0x43435d)[_0x686f('0x35')](_0x26f5b2);};}exports[_0x686f('0x36')]=function(_0x1ec69a,_0x5629a1){var _0x3c3613={},_0x30e66f={},_0x1eeefd={'count':0x0,'rows':[]};var _0x5c160c=_[_0x686f('0x37')](db[_0x686f('0x38')][_0x686f('0x39')],function(_0x1988ae){return{'name':_0x1988ae[_0x686f('0x3a')],'type':_0x1988ae[_0x686f('0x3b')]['key']};});_0x30e66f[_0x686f('0x3c')]=_[_0x686f('0x37')](_0x5c160c,'name');_0x30e66f[_0x686f('0x3d')]=_[_0x686f('0x3e')](_0x1ec69a[_0x686f('0x3d')]);_0x30e66f['filters']=_['intersection'](_0x30e66f[_0x686f('0x3c')],_0x30e66f[_0x686f('0x3d')]);_0x3c3613[_0x686f('0x3f')]=_[_0x686f('0x40')](_0x30e66f[_0x686f('0x3c')],qs[_0x686f('0x41')](_0x1ec69a[_0x686f('0x3d')]['fields']));_0x3c3613[_0x686f('0x3f')]=_0x3c3613[_0x686f('0x3f')][_0x686f('0x42')]?_0x3c3613[_0x686f('0x3f')]:_0x30e66f[_0x686f('0x3c')];if(!_0x1ec69a[_0x686f('0x3d')][_0x686f('0x43')]('nolimit')){_0x3c3613[_0x686f('0x29')]=qs[_0x686f('0x29')](_0x1ec69a[_0x686f('0x3d')][_0x686f('0x29')]);_0x3c3613[_0x686f('0x28')]=qs[_0x686f('0x28')](_0x1ec69a[_0x686f('0x3d')][_0x686f('0x28')]);}_0x3c3613[_0x686f('0x44')]=qs[_0x686f('0x45')](_0x1ec69a[_0x686f('0x3d')][_0x686f('0x45')]);_0x3c3613[_0x686f('0x46')]=qs['filters'](_[_0x686f('0x47')](_0x1ec69a['query'],_0x30e66f[_0x686f('0x48')]),_0x5c160c);if(_0x1ec69a[_0x686f('0x3d')]['filter']){_0x3c3613[_0x686f('0x46')]=_[_0x686f('0x49')](_0x3c3613[_0x686f('0x46')],{'$or':_[_0x686f('0x37')](_0x5c160c,function(_0x94b250){if(_0x94b250[_0x686f('0x3b')]!==_0x686f('0x4a')){var _0x41a91e={};_0x41a91e[_0x94b250[_0x686f('0x34')]]={'$like':'%'+_0x1ec69a[_0x686f('0x3d')][_0x686f('0x4b')]+'%'};return _0x41a91e;}})});}_0x3c3613=_[_0x686f('0x49')]({},_0x3c3613,_0x1ec69a[_0x686f('0x4c')]);var _0x55521a={'where':_0x3c3613[_0x686f('0x46')]};return db[_0x686f('0x38')][_0x686f('0x2b')](_0x55521a)[_0x686f('0x1a')](function(_0x50bbae){_0x1eeefd[_0x686f('0x2b')]=_0x50bbae;if(_0x1ec69a[_0x686f('0x3d')]['includeAll']){_0x3c3613['include']=[{'all':!![]}];}return db[_0x686f('0x38')][_0x686f('0x4d')](_0x3c3613);})['then'](function(_0x5866a8){_0x1eeefd[_0x686f('0x4e')]=_0x5866a8;return _0x1eeefd;})[_0x686f('0x1a')](respondWithFilteredResult(_0x5629a1,_0x3c3613))[_0x686f('0x23')](handleError(_0x5629a1,null));};exports[_0x686f('0x4f')]=function(_0x7622ea,_0x44396c){var _0x2591c2={'raw':![],'where':{'id':_0x7622ea[_0x686f('0x50')]['id']}},_0x3b1d90={};_0x3b1d90['model']=_['keys'](db[_0x686f('0x38')][_0x686f('0x39')]);_0x3b1d90['query']=_[_0x686f('0x3e')](_0x7622ea[_0x686f('0x3d')]);_0x3b1d90[_0x686f('0x48')]=_[_0x686f('0x40')](_0x3b1d90[_0x686f('0x3c')],_0x3b1d90['query']);_0x2591c2[_0x686f('0x3f')]=_['intersection'](_0x3b1d90[_0x686f('0x3c')],qs[_0x686f('0x41')](_0x7622ea['query']['fields']));_0x2591c2['attributes']=_0x2591c2[_0x686f('0x3f')]['length']?_0x2591c2[_0x686f('0x3f')]:_0x3b1d90[_0x686f('0x3c')];if(_0x7622ea[_0x686f('0x3d')][_0x686f('0x51')]){_0x2591c2[_0x686f('0x52')]=[{'all':!![]}];}_0x2591c2=_['merge']({},_0x2591c2,_0x7622ea[_0x686f('0x4c')]);return db['VoiceContext']['find'](_0x2591c2)[_0x686f('0x1a')](handleEntityNotFound(_0x44396c,null))[_0x686f('0x1a')](respondWithResult(_0x44396c,null))['catch'](handleError(_0x44396c,null));};exports[_0x686f('0x53')]=function(_0x3f0a0e,_0x5a00be,_0x646597){var _0x315870;return db[_0x686f('0x38')][_0x686f('0x53')](_0x3f0a0e[_0x686f('0x54')],{'raw':!![]})[_0x686f('0x1a')](function(_0x461c13){_0x315870=_0x461c13;return db['VoiceContext']['findAll']({'raw':!![]});})[_0x686f('0x1a')](function(_0x361b81){var _0x58293b=fs['readFileSync'](path[_0x686f('0x55')](config[_0x686f('0x56')],_0x686f('0x57')),_0x686f('0x58'));var _0xee103b=ejs[_0x686f('0x59')](_0x58293b,{'contexts':_0x361b81||[]});fs[_0x686f('0x5a')](_0x686f('0x5b'),_0xee103b);})[_0x686f('0x1a')](function(){return respondWithRpcPromise(_0x686f('0x5c'),_0x686f('0x53'),{'module':'chan_sip.so'});})[_0x686f('0x1a')](function(){var _0x3cc8ce=_0x3f0a0e[_0x686f('0x5d')][_0x686f('0x5e')]({'plain':!![]});if(!_0x3cc8ce)throw new Error(_0x686f('0x5f'));if(_0x3cc8ce[_0x686f('0x60')]===_0x686f('0x5d')){var _0x2a2e9c=_0x315870[_0x686f('0x5e')]({'plain':!![]});return db[_0x686f('0x61')]['find']({'where':{'name':_0x686f('0x31'),'userProfileId':_0x3cc8ce[_0x686f('0x62')]},'raw':!![]})[_0x686f('0x1a')](function(_0x2de2f0){if(_0x2de2f0&&_0x2de2f0[_0x686f('0x63')]===0x0){return db[_0x686f('0x32')][_0x686f('0x53')]({'name':_0x2a2e9c[_0x686f('0x34')],'resourceId':_0x2a2e9c['id'],'type':_0x2de2f0['name'],'sectionId':_0x2de2f0['id']},{})['then'](function(){return _0x315870;});}else{return _0x315870;}})[_0x686f('0x23')](function(_0x38222a){logger['error'](_0x686f('0x64'),_0x38222a);throw _0x38222a;});}return _0x315870;})[_0x686f('0x1a')](respondWithResult(_0x5a00be,0xc9))[_0x686f('0x23')](handleError(_0x5a00be,null));};exports['update']=function(_0xc246b0,_0x3a05ff,_0x404e16){var _0x214c6;return db['VoiceContext'][_0x686f('0x65')]({'where':{'id':_0xc246b0[_0x686f('0x50')]['id']}})['then'](handleEntityNotFound(_0x3a05ff,null))[_0x686f('0x1a')](saveUpdates(_0xc246b0[_0x686f('0x54')],null))[_0x686f('0x1a')](function(_0x27424e){if(_0x27424e){_0x214c6=_0x27424e;return db[_0x686f('0x38')][_0x686f('0x4d')]({'raw':!![]});}})['then'](function(_0xee08da){var _0x4d54cb=fs[_0x686f('0x66')](path['join'](config[_0x686f('0x56')],_0x686f('0x57')),_0x686f('0x58'));var _0x514494=ejs[_0x686f('0x59')](_0x4d54cb,{'contexts':_0xee08da||[]});fs[_0x686f('0x5a')](_0x686f('0x5b'),_0x514494);})[_0x686f('0x1a')](function(){return respondWithRpcPromise(_0x686f('0x5c'),_0x686f('0x2f'),{'module':_0x686f('0x67')});})['then'](function(){return _0x214c6;})[_0x686f('0x1a')](respondWithResult(_0x3a05ff,null))[_0x686f('0x23')](handleError(_0x3a05ff,null));};exports[_0x686f('0x30')]=function(_0x2eab5e,_0xa5733e,_0x5d5f5b){var _0x393b50;return db['VoiceContext'][_0x686f('0x65')]({'where':{'id':_0x2eab5e[_0x686f('0x50')]['id']}})[_0x686f('0x1a')](handleEntityNotFound(_0xa5733e,null))['then'](removeEntity(_0xa5733e,null))['then'](function(){return db[_0x686f('0x38')][_0x686f('0x4d')]({'raw':!![]});})['then'](function(_0x3461a5){var _0x3738dc=fs['readFileSync'](path[_0x686f('0x55')](config[_0x686f('0x56')],_0x686f('0x57')),'utf8');var _0x3ce5e2=ejs[_0x686f('0x59')](_0x3738dc,{'contexts':_0x3461a5});fs[_0x686f('0x5a')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x3ce5e2);return respondWithRpcPromise(_0x686f('0x5c'),_0x686f('0x30'),{'module':_0x686f('0x67')});})['catch'](handleError(_0xa5733e,null));}; \ No newline at end of file +var _0x83a4=['userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','/etc/asterisk/extensions_xcally_contexts.conf','Reload','eml-format','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','destroy','Contexts','UserProfileResource','name','index','map','VoiceContext','rawAttributes','fieldName','key','keys','filters','intersection','model','fields','query','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','type','options','includeAll','include','findAll','find','create','body','readFileSync','join','root','server/files/templates/context.ejs','utf8','render','writeFileSync','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','UserProfileSection'];(function(_0x2e414d,_0x5c5112){var _0x25be4b=function(_0x3abbb7){while(--_0x3abbb7){_0x2e414d['push'](_0x2e414d['shift']());}};_0x25be4b(++_0x5c5112);}(_0x83a4,0x19a));var _0x483a=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x83a4[_0x15bc81];return _0x59440e;};'use strict';var emlformat=require(_0x483a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x483a('0x1'));var rp=require('request-promise');var moment=require(_0x483a('0x2'));var BPromise=require(_0x483a('0x3'));var Mustache=require(_0x483a('0x4'));var util=require(_0x483a('0x5'));var path=require('path');var sox=require(_0x483a('0x6'));var csv=require(_0x483a('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x483a('0x8'));var _=require(_0x483a('0x9'));var squel=require(_0x483a('0xa'));var crypto=require(_0x483a('0xb'));var jsforce=require(_0x483a('0xc'));var deskjs=require(_0x483a('0xd'));var toCsv=require(_0x483a('0x7'));var querystring=require(_0x483a('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x483a('0xf'));var qs=require(_0x483a('0x10'));var as=require(_0x483a('0x11'));var hardwareService=require(_0x483a('0x12'));var logger=require('../../config/logger')(_0x483a('0x13'));var utils=require(_0x483a('0x14'));var config=require(_0x483a('0x15'));var licenseUtil=require(_0x483a('0x16'));var db=require(_0x483a('0x17'))['db'];var jayson=require(_0x483a('0x18'));var client=jayson[_0x483a('0x19')][_0x483a('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x53da31,_0x133589,_0x3f0ac3,_0xc94ee1){return new BPromise(function(_0x41bbd8,_0x54939d){var _0x2a1460=_0xc94ee1||client;return _0x2a1460['request'](_0x53da31,_0x3f0ac3)[_0x483a('0x1b')](function(_0x231b8f){logger[_0x483a('0x1c')](_0x483a('0x1d'),_0x133589,_0x483a('0x1e'));logger[_0x483a('0x1f')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x133589,_0x483a('0x1e'),JSON[_0x483a('0x20')](_0x231b8f));if(_0x231b8f[_0x483a('0x21')]){if(_0x231b8f[_0x483a('0x21')][_0x483a('0x22')]===0x1f4){logger[_0x483a('0x21')](_0x483a('0x1d'),_0x133589,_0x231b8f['error'][_0x483a('0x23')]);return _0x54939d(_0x231b8f['error']['message']);}logger[_0x483a('0x21')](_0x483a('0x1d'),_0x133589,_0x231b8f['error'][_0x483a('0x23')]);return _0x41bbd8(_0x231b8f[_0x483a('0x21')]['message']);}else{logger['info'](_0x483a('0x1d'),_0x133589,_0x483a('0x1e'));_0x41bbd8(_0x231b8f['result'][_0x483a('0x23')]);}})[_0x483a('0x24')](function(_0x6e3003){logger[_0x483a('0x21')]('VoiceContext,\x20%s,\x20%s',_0x133589,_0x6e3003);_0x54939d(_0x6e3003);});});}function respondWithStatusCode(_0x394b95,_0x1aed80){_0x1aed80=_0x1aed80||0xcc;return function(_0x35a710){if(_0x35a710){return _0x394b95[_0x483a('0x25')](_0x1aed80);}return _0x394b95[_0x483a('0x26')](_0x1aed80)[_0x483a('0x27')]();};}function respondWithResult(_0x187a70,_0x17f8f1){_0x17f8f1=_0x17f8f1||0xc8;return function(_0x463d85){if(_0x463d85){return _0x187a70[_0x483a('0x26')](_0x17f8f1)['json'](_0x463d85);}};}function respondWithFilteredResult(_0x3854e7,_0x1b1dbe){return function(_0x229612){if(_0x229612){var _0x16892b=typeof _0x1b1dbe[_0x483a('0x28')]===_0x483a('0x29')&&typeof _0x1b1dbe['limit']===_0x483a('0x29');var _0x57846d=_0x229612[_0x483a('0x2a')];var _0x42a449=_0x16892b?0x0:_0x1b1dbe[_0x483a('0x28')];var _0x4b774c=_0x16892b?_0x229612[_0x483a('0x2a')]:_0x1b1dbe[_0x483a('0x28')]+_0x1b1dbe[_0x483a('0x2b')];var _0xe7df59;if(_0x4b774c>=_0x57846d){_0x4b774c=_0x57846d;_0xe7df59=0xc8;}else{_0xe7df59=0xce;}_0x3854e7[_0x483a('0x26')](_0xe7df59);return _0x3854e7[_0x483a('0x2c')](_0x483a('0x2d'),_0x42a449+'-'+_0x4b774c+'/'+_0x57846d)[_0x483a('0x2e')](_0x229612);}return null;};}function patchUpdates(_0x31fd99){return function(_0x243f43){try{jsonpatch['apply'](_0x243f43,_0x31fd99,!![]);}catch(_0x955b3b){return BPromise[_0x483a('0x2f')](_0x955b3b);}return _0x243f43[_0x483a('0x30')]();};}function saveUpdates(_0x11491d,_0x1b62f5){return function(_0x19cf3a){if(_0x19cf3a){return _0x19cf3a[_0x483a('0x31')](_0x11491d)['then'](function(_0x171cfc){return _0x171cfc;});}return null;};}function removeEntity(_0x2290bb,_0xa17735){return function(_0x47e541){if(_0x47e541){return _0x47e541[_0x483a('0x32')]()['then'](function(){var _0x358858=_0x47e541['get']({'plain':!![]});var _0x4b4b33=_0x483a('0x33');return db[_0x483a('0x34')][_0x483a('0x32')]({'where':{'type':_0x4b4b33,'resourceId':_0x358858['id']}})[_0x483a('0x1b')](function(){return _0x47e541;});})[_0x483a('0x1b')](function(){_0x2290bb[_0x483a('0x26')](0xcc)[_0x483a('0x27')]();});}};}function handleEntityNotFound(_0x538fe8,_0xefac4){return function(_0x177cee){if(!_0x177cee){_0x538fe8[_0x483a('0x25')](0x194);}return _0x177cee;};}function handleError(_0x18a98a,_0x47f092){_0x47f092=_0x47f092||0x1f4;return function(_0x2b8e18){logger['error'](_0x2b8e18['stack']);if(_0x2b8e18['name']){delete _0x2b8e18[_0x483a('0x35')];}_0x18a98a[_0x483a('0x26')](_0x47f092)['send'](_0x2b8e18);};}exports[_0x483a('0x36')]=function(_0x1f427f,_0x404b70){var _0x5e737a={},_0x1f442a={},_0x4c48cd={'count':0x0,'rows':[]};var _0xc8629e=_[_0x483a('0x37')](db[_0x483a('0x38')][_0x483a('0x39')],function(_0x4113f9){return{'name':_0x4113f9[_0x483a('0x3a')],'type':_0x4113f9['type'][_0x483a('0x3b')]};});_0x1f442a['model']=_[_0x483a('0x37')](_0xc8629e,_0x483a('0x35'));_0x1f442a['query']=_[_0x483a('0x3c')](_0x1f427f['query']);_0x1f442a[_0x483a('0x3d')]=_[_0x483a('0x3e')](_0x1f442a[_0x483a('0x3f')],_0x1f442a['query']);_0x5e737a['attributes']=_[_0x483a('0x3e')](_0x1f442a[_0x483a('0x3f')],qs[_0x483a('0x40')](_0x1f427f[_0x483a('0x41')][_0x483a('0x40')]));_0x5e737a[_0x483a('0x42')]=_0x5e737a[_0x483a('0x42')][_0x483a('0x43')]?_0x5e737a[_0x483a('0x42')]:_0x1f442a[_0x483a('0x3f')];if(!_0x1f427f[_0x483a('0x41')][_0x483a('0x44')]('nolimit')){_0x5e737a[_0x483a('0x2b')]=qs[_0x483a('0x2b')](_0x1f427f['query'][_0x483a('0x2b')]);_0x5e737a[_0x483a('0x28')]=qs[_0x483a('0x28')](_0x1f427f[_0x483a('0x41')][_0x483a('0x28')]);}_0x5e737a[_0x483a('0x45')]=qs[_0x483a('0x46')](_0x1f427f['query'][_0x483a('0x46')]);_0x5e737a['where']=qs[_0x483a('0x3d')](_[_0x483a('0x47')](_0x1f427f[_0x483a('0x41')],_0x1f442a[_0x483a('0x3d')]),_0xc8629e);if(_0x1f427f[_0x483a('0x41')][_0x483a('0x48')]){_0x5e737a[_0x483a('0x49')]=_[_0x483a('0x4a')](_0x5e737a[_0x483a('0x49')],{'$or':_['map'](_0xc8629e,function(_0x5a1721){if(_0x5a1721[_0x483a('0x4b')]!=='VIRTUAL'){var _0x1fed0c={};_0x1fed0c[_0x5a1721[_0x483a('0x35')]]={'$like':'%'+_0x1f427f[_0x483a('0x41')][_0x483a('0x48')]+'%'};return _0x1fed0c;}})});}_0x5e737a=_[_0x483a('0x4a')]({},_0x5e737a,_0x1f427f[_0x483a('0x4c')]);var _0x1cf709={'where':_0x5e737a[_0x483a('0x49')]};return db[_0x483a('0x38')][_0x483a('0x2a')](_0x1cf709)[_0x483a('0x1b')](function(_0x59c7cc){_0x4c48cd['count']=_0x59c7cc;if(_0x1f427f[_0x483a('0x41')][_0x483a('0x4d')]){_0x5e737a[_0x483a('0x4e')]=[{'all':!![]}];}return db[_0x483a('0x38')][_0x483a('0x4f')](_0x5e737a);})[_0x483a('0x1b')](function(_0x293d61){_0x4c48cd['rows']=_0x293d61;return _0x4c48cd;})[_0x483a('0x1b')](respondWithFilteredResult(_0x404b70,_0x5e737a))[_0x483a('0x24')](handleError(_0x404b70,null));};exports['show']=function(_0x83d24a,_0x5e8374){var _0x2af416={'raw':![],'where':{'id':_0x83d24a['params']['id']}},_0x46c787={};_0x46c787[_0x483a('0x3f')]=_['keys'](db[_0x483a('0x38')][_0x483a('0x39')]);_0x46c787['query']=_[_0x483a('0x3c')](_0x83d24a[_0x483a('0x41')]);_0x46c787[_0x483a('0x3d')]=_[_0x483a('0x3e')](_0x46c787[_0x483a('0x3f')],_0x46c787[_0x483a('0x41')]);_0x2af416[_0x483a('0x42')]=_[_0x483a('0x3e')](_0x46c787['model'],qs[_0x483a('0x40')](_0x83d24a[_0x483a('0x41')]['fields']));_0x2af416[_0x483a('0x42')]=_0x2af416[_0x483a('0x42')][_0x483a('0x43')]?_0x2af416[_0x483a('0x42')]:_0x46c787[_0x483a('0x3f')];if(_0x83d24a[_0x483a('0x41')][_0x483a('0x4d')]){_0x2af416[_0x483a('0x4e')]=[{'all':!![]}];}_0x2af416=_[_0x483a('0x4a')]({},_0x2af416,_0x83d24a[_0x483a('0x4c')]);return db[_0x483a('0x38')][_0x483a('0x50')](_0x2af416)[_0x483a('0x1b')](handleEntityNotFound(_0x5e8374,null))[_0x483a('0x1b')](respondWithResult(_0x5e8374,null))['catch'](handleError(_0x5e8374,null));};exports['create']=function(_0x1797d6,_0xa8176a,_0x46f958){var _0x5c4846;return db[_0x483a('0x38')][_0x483a('0x51')](_0x1797d6[_0x483a('0x52')],{'raw':!![]})[_0x483a('0x1b')](function(_0x20928a){_0x5c4846=_0x20928a;return db[_0x483a('0x38')][_0x483a('0x4f')]({'raw':!![]});})[_0x483a('0x1b')](function(_0x7b8f89){var _0x53fe31=fs[_0x483a('0x53')](path[_0x483a('0x54')](config[_0x483a('0x55')],_0x483a('0x56')),_0x483a('0x57'));var _0xafd001=ejs[_0x483a('0x58')](_0x53fe31,{'contexts':_0x7b8f89||[]});fs[_0x483a('0x59')]('/etc/asterisk/extensions_xcally_contexts.conf',_0xafd001);})[_0x483a('0x1b')](function(){return respondWithRpcPromise('Reload',_0x483a('0x51'),{'module':_0x483a('0x5a')});})[_0x483a('0x1b')](function(){var _0x3aaa6e=_0x1797d6['user']['get']({'plain':!![]});if(!_0x3aaa6e)throw new Error(_0x483a('0x5b'));if(_0x3aaa6e['role']===_0x483a('0x5c')){var _0x9812b0=_0x5c4846[_0x483a('0x5d')]({'plain':!![]});return db[_0x483a('0x5e')]['find']({'where':{'name':_0x483a('0x33'),'userProfileId':_0x3aaa6e[_0x483a('0x5f')]},'raw':!![]})['then'](function(_0x30eb13){if(_0x30eb13&&_0x30eb13[_0x483a('0x60')]===0x0){return db[_0x483a('0x34')][_0x483a('0x51')]({'name':_0x9812b0[_0x483a('0x35')],'resourceId':_0x9812b0['id'],'type':_0x30eb13['name'],'sectionId':_0x30eb13['id']},{})[_0x483a('0x1b')](function(){return _0x5c4846;});}else{return _0x5c4846;}})['catch'](function(_0x1e1069){logger[_0x483a('0x21')](_0x483a('0x61'),_0x1e1069);throw _0x1e1069;});}return _0x5c4846;})[_0x483a('0x1b')](respondWithResult(_0xa8176a,0xc9))[_0x483a('0x24')](handleError(_0xa8176a,null));};exports[_0x483a('0x31')]=function(_0x542f7a,_0x4e00e9,_0x4681e7){var _0x3edac0;return db[_0x483a('0x38')][_0x483a('0x50')]({'where':{'id':_0x542f7a[_0x483a('0x62')]['id']}})['then'](handleEntityNotFound(_0x4e00e9,null))[_0x483a('0x1b')](saveUpdates(_0x542f7a[_0x483a('0x52')],null))['then'](function(_0x4b58fc){if(_0x4b58fc){_0x3edac0=_0x4b58fc;return db[_0x483a('0x38')][_0x483a('0x4f')]({'raw':!![]});}})[_0x483a('0x1b')](function(_0x55d4b2){var _0x291364=fs['readFileSync'](path[_0x483a('0x54')](config[_0x483a('0x55')],'server/files/templates/context.ejs'),_0x483a('0x57'));var _0x1a6e1f=ejs[_0x483a('0x58')](_0x291364,{'contexts':_0x55d4b2||[]});fs[_0x483a('0x59')](_0x483a('0x63'),_0x1a6e1f);})[_0x483a('0x1b')](function(){return respondWithRpcPromise(_0x483a('0x64'),'update',{'module':_0x483a('0x5a')});})[_0x483a('0x1b')](function(){return _0x3edac0;})['then'](respondWithResult(_0x4e00e9,null))[_0x483a('0x24')](handleError(_0x4e00e9,null));};exports[_0x483a('0x32')]=function(_0x536e37,_0x542092,_0x1711df){var _0x50f69f;return db[_0x483a('0x38')][_0x483a('0x50')]({'where':{'id':_0x536e37[_0x483a('0x62')]['id']}})[_0x483a('0x1b')](handleEntityNotFound(_0x542092,null))[_0x483a('0x1b')](removeEntity(_0x542092,null))[_0x483a('0x1b')](function(){return db[_0x483a('0x38')]['findAll']({'raw':!![]});})[_0x483a('0x1b')](function(_0x13d7aa){var _0x3ef6bc=fs[_0x483a('0x53')](path[_0x483a('0x54')](config[_0x483a('0x55')],_0x483a('0x56')),_0x483a('0x57'));var _0x2fd1e1=ejs[_0x483a('0x58')](_0x3ef6bc,{'contexts':_0x13d7aa});fs[_0x483a('0x59')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x2fd1e1);return respondWithRpcPromise(_0x483a('0x64'),_0x483a('0x32'),{'module':'chan_sip.so'});})[_0x483a('0x24')](handleError(_0x542092,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 1acea91..e143c94 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 _0x2100=['../../config/environment','exports','define','voice_contexts','api','moment','rimraf'];(function(_0x3132b8,_0x4b07ab){var _0x2ba6f9=function(_0x8d8b28){while(--_0x8d8b28){_0x3132b8['push'](_0x3132b8['shift']());}};_0x2ba6f9(++_0x4b07ab);}(_0x2100,0x15b));var _0x0210=function(_0x122d9f,_0x2c9e5b){_0x122d9f=_0x122d9f-0x0;var _0x41a09e=_0x2100[_0x122d9f];return _0x41a09e;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x0210('0x0'));var moment=require(_0x0210('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0210('0x2'));var config=require(_0x0210('0x3'));var attributes=require('./voiceContext.attributes');module[_0x0210('0x4')]=function(_0x378158,_0x148df6){return _0x378158[_0x0210('0x5')]('VoiceContext',attributes,{'tableName':_0x0210('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x527c=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./voiceContext.attributes','define','VoiceContext','voice_contexts','lodash'];(function(_0x191072,_0x46094f){var _0x2bd0a8=function(_0x472f1c){while(--_0x472f1c){_0x191072['push'](_0x191072['shift']());}};_0x2bd0a8(++_0x46094f);}(_0x527c,0xb3));var _0xc527=function(_0x562362,_0x5d54f4){_0x562362=_0x562362-0x0;var _0x3a18ce=_0x527c[_0x562362];return _0x3a18ce;};'use strict';var _=require(_0xc527('0x0'));var util=require(_0xc527('0x1'));var logger=require(_0xc527('0x2'))(_0xc527('0x3'));var moment=require(_0xc527('0x4'));var BPromise=require(_0xc527('0x5'));var rp=require(_0xc527('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc527('0x7'));var config=require('../../config/environment');var attributes=require(_0xc527('0x8'));module['exports']=function(_0x4ba9e2,_0x38e99c){return _0x4ba9e2[_0xc527('0x9')](_0xc527('0xa'),attributes,{'tableName':_0xc527('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.rpc.js b/server/api/voiceContext/voiceContext.rpc.js index 459c9c9..6c2e1ab 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 _0xabad=['lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xabad,0x150));var _0xdaba=function(_0x57bd4f,_0x42a4f5){_0x57bd4f=_0x57bd4f-0x0;var _0x25c08f=_0xabad[_0x57bd4f];return _0x25c08f;};'use strict';var _=require(_0xdaba('0x0'));var util=require('util');var moment=require(_0xdaba('0x1'));var BPromise=require(_0xdaba('0x2'));var rs=require(_0xdaba('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdaba('0x4'))['db'];var utils=require(_0xdaba('0x5'));var logger=require('../../config/logger')(_0xdaba('0x6'));var config=require(_0xdaba('0x7'));var jayson=require(_0xdaba('0x8'));var client=jayson[_0xdaba('0x9')][_0xdaba('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x23ae0f,_0x4045f5,_0x352a74){return new BPromise(function(_0x5214dc,_0x2344d1){return client[_0xdaba('0xb')](_0x23ae0f,_0x352a74)[_0xdaba('0xc')](function(_0x1e22ba){logger['info'](_0xdaba('0xd'),_0x4045f5,_0xdaba('0xe'));logger[_0xdaba('0xf')](_0xdaba('0x10'),_0x4045f5,_0xdaba('0xe'),JSON[_0xdaba('0x11')](_0x1e22ba));if(_0x1e22ba[_0xdaba('0x12')]){if(_0x1e22ba[_0xdaba('0x12')][_0xdaba('0x13')]===0x1f4){logger['error'](_0xdaba('0xd'),_0x4045f5,_0x1e22ba['error'][_0xdaba('0x14')]);return _0x2344d1(_0x1e22ba[_0xdaba('0x12')][_0xdaba('0x14')]);}logger[_0xdaba('0x12')](_0xdaba('0xd'),_0x4045f5,_0x1e22ba[_0xdaba('0x12')][_0xdaba('0x14')]);return _0x5214dc(_0x1e22ba['error'][_0xdaba('0x14')]);}else{logger[_0xdaba('0x15')](_0xdaba('0xd'),_0x4045f5,_0xdaba('0xe'));_0x5214dc(_0x1e22ba[_0xdaba('0x16')][_0xdaba('0x14')]);}})[_0xdaba('0x17')](function(_0x5c4ec1){logger[_0xdaba('0x12')](_0xdaba('0xd'),_0x4045f5,_0x5c4ec1);_0x2344d1(_0x5c4ec1);});});} \ No newline at end of file +var _0xe2cf=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util'];(function(_0x1f5f3a,_0x1e19a3){var _0x2432c9=function(_0x1ffe75){while(--_0x1ffe75){_0x1f5f3a['push'](_0x1f5f3a['shift']());}};_0x2432c9(++_0x1e19a3);}(_0xe2cf,0x1a1));var _0xfe2c=function(_0x53a8d3,_0x1a0799){_0x53a8d3=_0x53a8d3-0x0;var _0x15e434=_0xe2cf[_0x53a8d3];return _0x15e434;};'use strict';var _=require('lodash');var util=require(_0xfe2c('0x0'));var moment=require('moment');var BPromise=require(_0xfe2c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfe2c('0x2'));var db=require(_0xfe2c('0x3'))['db'];var utils=require(_0xfe2c('0x4'));var logger=require(_0xfe2c('0x5'))('rpc');var config=require(_0xfe2c('0x6'));var jayson=require(_0xfe2c('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4e0b97,_0x417bc4,_0x5e5b46){return new BPromise(function(_0x485a24,_0x30aafe){return client[_0xfe2c('0x8')](_0x4e0b97,_0x5e5b46)[_0xfe2c('0x9')](function(_0x562414){logger['info'](_0xfe2c('0xa'),_0x417bc4,_0xfe2c('0xb'));logger['debug'](_0xfe2c('0xc'),_0x417bc4,_0xfe2c('0xb'),JSON[_0xfe2c('0xd')](_0x562414));if(_0x562414[_0xfe2c('0xe')]){if(_0x562414[_0xfe2c('0xe')][_0xfe2c('0xf')]===0x1f4){logger[_0xfe2c('0xe')]('VoiceContext,\x20%s,\x20%s',_0x417bc4,_0x562414['error']['message']);return _0x30aafe(_0x562414['error'][_0xfe2c('0x10')]);}logger['error']('VoiceContext,\x20%s,\x20%s',_0x417bc4,_0x562414[_0xfe2c('0xe')][_0xfe2c('0x10')]);return _0x485a24(_0x562414[_0xfe2c('0xe')][_0xfe2c('0x10')]);}else{logger['info']('VoiceContext,\x20%s,\x20%s',_0x417bc4,_0xfe2c('0xb'));_0x485a24(_0x562414[_0xfe2c('0x11')][_0xfe2c('0x10')]);}})[_0xfe2c('0x12')](function(_0x565f40){logger[_0xfe2c('0xe')](_0xfe2c('0xa'),_0x417bc4,_0x565f40);_0x30aafe(_0x565f40);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index b15ebf1..cd07604 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 _0x744b=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','isAuthenticated','index','get','/describe','describe','show','post','create','/:id','delete','exports','multer','util','path','Router','fs-extra'];(function(_0x5df0a3,_0x26948f){var _0x36c3c2=function(_0x402b69){while(--_0x402b69){_0x5df0a3['push'](_0x5df0a3['shift']());}};_0x36c3c2(++_0x26948f);}(_0x744b,0xff));var _0xb744=function(_0x4a9fda,_0x375c91){_0x4a9fda=_0x4a9fda-0x0;var _0x5db607=_0x744b[_0x4a9fda];return _0x5db607;};'use strict';var multer=require(_0xb744('0x0'));var util=require(_0xb744('0x1'));var path=require(_0xb744('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb744('0x3')]();var fs_extra=require(_0xb744('0x4'));var auth=require(_0xb744('0x5'));var interaction=require(_0xb744('0x6'));var config=require(_0xb744('0x7'));var controller=require(_0xb744('0x8'));router['get']('/',auth[_0xb744('0x9')](),controller[_0xb744('0xa')]);router[_0xb744('0xb')](_0xb744('0xc'),auth[_0xb744('0x9')](),controller[_0xb744('0xd')]);router['get']('/:id',auth[_0xb744('0x9')](),controller[_0xb744('0xe')]);router[_0xb744('0xf')]('/',auth[_0xb744('0x9')](),controller[_0xb744('0x10')]);router['put'](_0xb744('0x11'),auth['isAuthenticated'](),controller['update']);router[_0xb744('0x12')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xb744('0x13')]=router; \ No newline at end of file +var _0xab09=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','destroy'];(function(_0x39c341,_0x2f47ff){var _0x58f61e=function(_0x101e79){while(--_0x101e79){_0x39c341['push'](_0x39c341['shift']());}};_0x58f61e(++_0x2f47ff);}(_0xab09,0x6a));var _0x9ab0=function(_0x5cb157,_0x26a384){_0x5cb157=_0x5cb157-0x0;var _0x233e33=_0xab09[_0x5cb157];return _0x233e33;};'use strict';var multer=require('multer');var util=require(_0x9ab0('0x0'));var path=require(_0x9ab0('0x1'));var timeout=require(_0x9ab0('0x2'));var express=require(_0x9ab0('0x3'));var router=express[_0x9ab0('0x4')]();var fs_extra=require(_0x9ab0('0x5'));var auth=require(_0x9ab0('0x6'));var interaction=require(_0x9ab0('0x7'));var config=require(_0x9ab0('0x8'));var controller=require(_0x9ab0('0x9'));router[_0x9ab0('0xa')]('/',auth[_0x9ab0('0xb')](),controller[_0x9ab0('0xc')]);router[_0x9ab0('0xa')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x9ab0('0xa')]('/:id',auth[_0x9ab0('0xb')](),controller[_0x9ab0('0xd')]);router[_0x9ab0('0xe')]('/',auth['isAuthenticated'](),controller[_0x9ab0('0xf')]);router[_0x9ab0('0x10')](_0x9ab0('0x11'),auth[_0x9ab0('0xb')](),controller[_0x9ab0('0x12')]);router['delete'](_0x9ab0('0x11'),auth[_0x9ab0('0xb')](),controller[_0x9ab0('0x13')]);module[_0x9ab0('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index d90cefc..deea7f5 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 _0x008c=['INTEGER','DATE','sequelize','exports','STRING'];(function(_0x57adc4,_0x5e592b){var _0x41a038=function(_0x1068dc){while(--_0x1068dc){_0x57adc4['push'](_0x57adc4['shift']());}};_0x41a038(++_0x5e592b);}(_0x008c,0x188));var _0xc008=function(_0x4e4d5c,_0x25dd3a){_0x4e4d5c=_0x4e4d5c-0x0;var _0x56854a=_0x008c[_0x4e4d5c];return _0x56854a;};'use strict';var Sequelize=require(_0xc008('0x0'));module[_0xc008('0x1')]={'privilege':{'type':Sequelize[_0xc008('0x2')]},'channel':{'type':Sequelize[_0xc008('0x2')]},'channelstate':{'type':Sequelize[_0xc008('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xc008('0x2')]},'calleridname':{'type':Sequelize[_0xc008('0x2')]},'connectedlinenum':{'type':Sequelize[_0xc008('0x2')]},'connectedlinename':{'type':Sequelize[_0xc008('0x2')]},'language':{'type':Sequelize[_0xc008('0x2')]},'accountcode':{'type':Sequelize[_0xc008('0x2')]},'context':{'type':Sequelize[_0xc008('0x2')]},'exten':{'type':Sequelize[_0xc008('0x2')]},'priority':{'type':Sequelize[_0xc008('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xc008('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xc008('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xc008('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xc008('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xc008('0x2')]},'destexten':{'type':Sequelize[_0xc008('0x2')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0xc008('0x2')]},'destlinkedid':{'type':Sequelize[_0xc008('0x2')]},'dialstring':{'type':Sequelize[_0xc008('0x2')]},'dialstatus':{'type':Sequelize[_0xc008('0x2')]},'starttime':{'type':Sequelize[_0xc008('0x4')]},'answertime':{'type':Sequelize[_0xc008('0x4')]},'endtime':{'type':Sequelize[_0xc008('0x4')]},'lastevent':{'type':Sequelize['STRING'],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0xc008('0x3')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0xc008('0x3')]},'billableseconds':{'type':Sequelize[_0xc008('0x3')]}}; \ No newline at end of file +var _0xb821=['DATE','called,connect,complete','exports','STRING','INTEGER'];(function(_0x1fd84d,_0x386ebb){var _0xfe50df=function(_0x257128){while(--_0x257128){_0x1fd84d['push'](_0x1fd84d['shift']());}};_0xfe50df(++_0x386ebb);}(_0xb821,0xa7));var _0x1b82=function(_0x837192,_0x140330){_0x837192=_0x837192-0x0;var _0x57b75a=_0xb821[_0x837192];return _0x57b75a;};'use strict';var Sequelize=require('sequelize');module[_0x1b82('0x0')]={'privilege':{'type':Sequelize[_0x1b82('0x1')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x1b82('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x1b82('0x1')]},'connectedlinename':{'type':Sequelize[_0x1b82('0x1')]},'language':{'type':Sequelize[_0x1b82('0x1')]},'accountcode':{'type':Sequelize[_0x1b82('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x1b82('0x1')]},'priority':{'type':Sequelize[_0x1b82('0x2')]},'uniqueid':{'type':Sequelize[_0x1b82('0x1')]},'linkedid':{'type':Sequelize[_0x1b82('0x1')]},'destchannel':{'type':Sequelize[_0x1b82('0x1')]},'destchannelstate':{'type':Sequelize[_0x1b82('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x1b82('0x1')]},'destcalleridnum':{'type':Sequelize[_0x1b82('0x1')]},'destcalleridname':{'type':Sequelize[_0x1b82('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x1b82('0x1')]},'destlanguage':{'type':Sequelize[_0x1b82('0x1')]},'destaccountcode':{'type':Sequelize[_0x1b82('0x1')]},'destcontext':{'type':Sequelize[_0x1b82('0x1')]},'destexten':{'type':Sequelize[_0x1b82('0x1')]},'destpriority':{'type':Sequelize[_0x1b82('0x2')]},'destuniqueid':{'type':Sequelize[_0x1b82('0x1')]},'destlinkedid':{'type':Sequelize[_0x1b82('0x1')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0x1b82('0x1')]},'starttime':{'type':Sequelize[_0x1b82('0x3')]},'answertime':{'type':Sequelize[_0x1b82('0x3')]},'endtime':{'type':Sequelize[_0x1b82('0x3')]},'lastevent':{'type':Sequelize['STRING'],'comment':_0x1b82('0x4')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0x1b82('0x2')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index a3a72fe..707a70d 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 _0xbb35=['json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','error','stack','name','index','map','VoiceDialReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','params','include','find','create','body','destroy','describe','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status'];(function(_0x5bd2d4,_0x4fb19b){var _0x3d26cf=function(_0x366514){while(--_0x366514){_0x5bd2d4['push'](_0x5bd2d4['shift']());}};_0x3d26cf(++_0x4fb19b);}(_0xbb35,0x197));var _0x5bb3=function(_0x28c95c,_0x5c7e18){_0x28c95c=_0x28c95c-0x0;var _0x339ee7=_0xbb35[_0x28c95c];return _0x339ee7;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5bb3('0x0'));var rp=require(_0x5bb3('0x1'));var moment=require('moment');var BPromise=require(_0x5bb3('0x2'));var Mustache=require(_0x5bb3('0x3'));var util=require(_0x5bb3('0x4'));var path=require(_0x5bb3('0x5'));var sox=require('sox');var csv=require(_0x5bb3('0x6'));var ejs=require(_0x5bb3('0x7'));var fs=require('fs');var fs_extra=require(_0x5bb3('0x8'));var _=require(_0x5bb3('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5bb3('0xa'));var deskjs=require(_0x5bb3('0xb'));var toCsv=require(_0x5bb3('0x6'));var querystring=require('querystring');var Papa=require(_0x5bb3('0xc'));var Redis=require(_0x5bb3('0xd'));var authService=require(_0x5bb3('0xe'));var qs=require(_0x5bb3('0xf'));var as=require(_0x5bb3('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5bb3('0x11'))(_0x5bb3('0x12'));var utils=require(_0x5bb3('0x13'));var config=require(_0x5bb3('0x14'));var licenseUtil=require(_0x5bb3('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x952ff4,_0x4464ce){_0x4464ce=_0x4464ce||0xcc;return function(_0x3dd9cf){if(_0x3dd9cf){return _0x952ff4[_0x5bb3('0x16')](_0x4464ce);}return _0x952ff4['status'](_0x4464ce)[_0x5bb3('0x17')]();};}function respondWithResult(_0x4ab91b,_0x1fc88a){_0x1fc88a=_0x1fc88a||0xc8;return function(_0x1d1b98){if(_0x1d1b98){return _0x4ab91b[_0x5bb3('0x18')](_0x1fc88a)[_0x5bb3('0x19')](_0x1d1b98);}};}function respondWithFilteredResult(_0x2442e1,_0x11ae6e){return function(_0x10c995){if(_0x10c995){var _0x45676b=typeof _0x11ae6e[_0x5bb3('0x1a')]==='undefined'&&typeof _0x11ae6e[_0x5bb3('0x1b')]===_0x5bb3('0x1c');var _0x2ab4ff=_0x10c995[_0x5bb3('0x1d')];var _0x378d9c=_0x45676b?0x0:_0x11ae6e[_0x5bb3('0x1a')];var _0x255515=_0x45676b?_0x10c995[_0x5bb3('0x1d')]:_0x11ae6e[_0x5bb3('0x1a')]+_0x11ae6e[_0x5bb3('0x1b')];var _0x357ef9;if(_0x255515>=_0x2ab4ff){_0x255515=_0x2ab4ff;_0x357ef9=0xc8;}else{_0x357ef9=0xce;}_0x2442e1[_0x5bb3('0x18')](_0x357ef9);return _0x2442e1[_0x5bb3('0x1e')](_0x5bb3('0x1f'),_0x378d9c+'-'+_0x255515+'/'+_0x2ab4ff)['json'](_0x10c995);}return null;};}function patchUpdates(_0x4c66f1){return function(_0x249a47){try{jsonpatch['apply'](_0x249a47,_0x4c66f1,!![]);}catch(_0x5e5094){return BPromise[_0x5bb3('0x20')](_0x5e5094);}return _0x249a47[_0x5bb3('0x21')]();};}function saveUpdates(_0x3c8a0c,_0x53a8f3){return function(_0x579692){if(_0x579692){return _0x579692[_0x5bb3('0x22')](_0x3c8a0c)[_0x5bb3('0x23')](function(_0x48e35c){return _0x48e35c;});}return null;};}function removeEntity(_0x3d7abb,_0x454e53){return function(_0x32fb25){if(_0x32fb25){return _0x32fb25['destroy']()[_0x5bb3('0x23')](function(){_0x3d7abb['status'](0xcc)[_0x5bb3('0x17')]();});}};}function handleEntityNotFound(_0xc23f0a,_0x1581f5){return function(_0xbfc80c){if(!_0xbfc80c){_0xc23f0a[_0x5bb3('0x16')](0x194);}return _0xbfc80c;};}function handleError(_0x4257aa,_0x13ceb3){_0x13ceb3=_0x13ceb3||0x1f4;return function(_0x32546a){logger[_0x5bb3('0x24')](_0x32546a[_0x5bb3('0x25')]);if(_0x32546a[_0x5bb3('0x26')]){delete _0x32546a[_0x5bb3('0x26')];}_0x4257aa[_0x5bb3('0x18')](_0x13ceb3)['send'](_0x32546a);};}exports[_0x5bb3('0x27')]=function(_0x536560,_0x526938){var _0x51fe28={},_0x55926c={},_0x5798b7={'count':0x0,'rows':[]};var _0x40f038=_[_0x5bb3('0x28')](db[_0x5bb3('0x29')][_0x5bb3('0x2a')],function(_0x378e8a){return{'name':_0x378e8a['fieldName'],'type':_0x378e8a[_0x5bb3('0x2b')][_0x5bb3('0x2c')]};});_0x55926c[_0x5bb3('0x2d')]=_[_0x5bb3('0x28')](_0x40f038,_0x5bb3('0x26'));_0x55926c[_0x5bb3('0x2e')]=_[_0x5bb3('0x2f')](_0x536560[_0x5bb3('0x2e')]);_0x55926c[_0x5bb3('0x30')]=_[_0x5bb3('0x31')](_0x55926c['model'],_0x55926c[_0x5bb3('0x2e')]);_0x51fe28[_0x5bb3('0x32')]=_[_0x5bb3('0x31')](_0x55926c[_0x5bb3('0x2d')],qs[_0x5bb3('0x33')](_0x536560[_0x5bb3('0x2e')][_0x5bb3('0x33')]));_0x51fe28[_0x5bb3('0x32')]=_0x51fe28['attributes'][_0x5bb3('0x34')]?_0x51fe28['attributes']:_0x55926c[_0x5bb3('0x2d')];if(!_0x536560['query'][_0x5bb3('0x35')]('nolimit')){_0x51fe28[_0x5bb3('0x1b')]=qs[_0x5bb3('0x1b')](_0x536560[_0x5bb3('0x2e')][_0x5bb3('0x1b')]);_0x51fe28['offset']=qs['offset'](_0x536560[_0x5bb3('0x2e')][_0x5bb3('0x1a')]);}_0x51fe28[_0x5bb3('0x36')]=qs[_0x5bb3('0x37')](_0x536560['query'][_0x5bb3('0x37')]);_0x51fe28[_0x5bb3('0x38')]=qs[_0x5bb3('0x30')](_['pick'](_0x536560[_0x5bb3('0x2e')],_0x55926c[_0x5bb3('0x30')]),_0x40f038);if(_0x536560['query'][_0x5bb3('0x39')]){_0x51fe28[_0x5bb3('0x38')]=_[_0x5bb3('0x3a')](_0x51fe28[_0x5bb3('0x38')],{'$or':_[_0x5bb3('0x28')](_0x40f038,function(_0x354ec8){if(_0x354ec8[_0x5bb3('0x2b')]!==_0x5bb3('0x3b')){var _0xd70984={};_0xd70984[_0x354ec8['name']]={'$like':'%'+_0x536560[_0x5bb3('0x2e')]['filter']+'%'};return _0xd70984;}})});}_0x51fe28=_['merge']({},_0x51fe28,_0x536560[_0x5bb3('0x3c')]);var _0x445700={'where':_0x51fe28['where']};return db[_0x5bb3('0x29')][_0x5bb3('0x1d')](_0x445700)[_0x5bb3('0x23')](function(_0x5c5689){_0x5798b7[_0x5bb3('0x1d')]=_0x5c5689;if(_0x536560[_0x5bb3('0x2e')][_0x5bb3('0x3d')]){_0x51fe28['include']=[{'all':!![]}];}return db[_0x5bb3('0x29')]['findAll'](_0x51fe28);})['then'](function(_0xb2a7d2){_0x5798b7[_0x5bb3('0x3e')]=_0xb2a7d2;return _0x5798b7;})[_0x5bb3('0x23')](respondWithFilteredResult(_0x526938,_0x51fe28))[_0x5bb3('0x3f')](handleError(_0x526938,null));};exports[_0x5bb3('0x40')]=function(_0x26ed36,_0x188200){var _0x599180={'raw':!![],'where':{'id':_0x26ed36[_0x5bb3('0x41')]['id']}},_0x5bbb8b={};_0x5bbb8b[_0x5bb3('0x2d')]=_['keys'](db['VoiceDialReport'][_0x5bb3('0x2a')]);_0x5bbb8b[_0x5bb3('0x2e')]=_['keys'](_0x26ed36[_0x5bb3('0x2e')]);_0x5bbb8b['filters']=_[_0x5bb3('0x31')](_0x5bbb8b['model'],_0x5bbb8b['query']);_0x599180[_0x5bb3('0x32')]=_[_0x5bb3('0x31')](_0x5bbb8b[_0x5bb3('0x2d')],qs[_0x5bb3('0x33')](_0x26ed36[_0x5bb3('0x2e')]['fields']));_0x599180['attributes']=_0x599180[_0x5bb3('0x32')][_0x5bb3('0x34')]?_0x599180['attributes']:_0x5bbb8b[_0x5bb3('0x2d')];if(_0x26ed36[_0x5bb3('0x2e')]['includeAll']){_0x599180[_0x5bb3('0x42')]=[{'all':!![]}];}_0x599180=_['merge']({},_0x599180,_0x26ed36[_0x5bb3('0x3c')]);return db['VoiceDialReport'][_0x5bb3('0x43')](_0x599180)['then'](handleEntityNotFound(_0x188200,null))[_0x5bb3('0x23')](respondWithResult(_0x188200,null))[_0x5bb3('0x3f')](handleError(_0x188200,null));};exports[_0x5bb3('0x44')]=function(_0x26f753,_0xa318f6){return db[_0x5bb3('0x29')][_0x5bb3('0x44')](_0x26f753[_0x5bb3('0x45')],{})[_0x5bb3('0x23')](respondWithResult(_0xa318f6,0xc9))['catch'](handleError(_0xa318f6,null));};exports[_0x5bb3('0x22')]=function(_0x3be1fb,_0x26524e){if(_0x3be1fb[_0x5bb3('0x45')]['id']){delete _0x3be1fb[_0x5bb3('0x45')]['id'];}return db[_0x5bb3('0x29')][_0x5bb3('0x43')]({'where':{'id':_0x3be1fb[_0x5bb3('0x41')]['id']}})[_0x5bb3('0x23')](handleEntityNotFound(_0x26524e,null))['then'](saveUpdates(_0x3be1fb[_0x5bb3('0x45')],null))['then'](respondWithResult(_0x26524e,null))[_0x5bb3('0x3f')](handleError(_0x26524e,null));};exports[_0x5bb3('0x46')]=function(_0x12d9b3,_0x311426){return db[_0x5bb3('0x29')][_0x5bb3('0x43')]({'where':{'id':_0x12d9b3['params']['id']}})[_0x5bb3('0x23')](handleEntityNotFound(_0x311426,null))['then'](removeEntity(_0x311426,null))[_0x5bb3('0x3f')](handleError(_0x311426,null));};exports[_0x5bb3('0x47')]=function(_0x397083,_0x2c92e9){return db[_0x5bb3('0x29')][_0x5bb3('0x47')]()['then'](respondWithResult(_0x2c92e9,null))[_0x5bb3('0x3f')](handleError(_0x2c92e9,null));}; \ No newline at end of file +var _0x4353=['create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','save','update','then','destroy','sendStatus','error','stack','name','send','VoiceDialReport','key','map','query','keys','filters','model','intersection','fields','length','attributes','nolimit','sort','where','pick','filter','merge','type','include','catch','show','includeAll','find'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x4353,0xd6));var _0x3435=function(_0x96daba,_0x92c14){_0x96daba=_0x96daba-0x0;var _0x3ec16c=_0x4353[_0x96daba];return _0x3ec16c;};'use strict';var emlformat=require(_0x3435('0x0'));var rimraf=require(_0x3435('0x1'));var zipdir=require(_0x3435('0x2'));var jsonpatch=require(_0x3435('0x3'));var rp=require(_0x3435('0x4'));var moment=require(_0x3435('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x3435('0x6'));var sox=require(_0x3435('0x7'));var csv=require(_0x3435('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3435('0x9'));var squel=require(_0x3435('0xa'));var crypto=require(_0x3435('0xb'));var jsforce=require(_0x3435('0xc'));var deskjs=require(_0x3435('0xd'));var toCsv=require(_0x3435('0x8'));var querystring=require(_0x3435('0xe'));var Papa=require(_0x3435('0xf'));var Redis=require(_0x3435('0x10'));var authService=require(_0x3435('0x11'));var qs=require(_0x3435('0x12'));var as=require(_0x3435('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3435('0x14'))(_0x3435('0x15'));var utils=require(_0x3435('0x16'));var config=require(_0x3435('0x17'));var licenseUtil=require(_0x3435('0x18'));var db=require(_0x3435('0x19'))['db'];function respondWithStatusCode(_0x1f7b47,_0x136302){_0x136302=_0x136302||0xcc;return function(_0x5561b6){if(_0x5561b6){return _0x1f7b47['sendStatus'](_0x136302);}return _0x1f7b47[_0x3435('0x1a')](_0x136302)[_0x3435('0x1b')]();};}function respondWithResult(_0x358654,_0x4bbc5b){_0x4bbc5b=_0x4bbc5b||0xc8;return function(_0x45f3b6){if(_0x45f3b6){return _0x358654[_0x3435('0x1a')](_0x4bbc5b)[_0x3435('0x1c')](_0x45f3b6);}};}function respondWithFilteredResult(_0x4d57bd,_0x1ece62){return function(_0x5a4e73){if(_0x5a4e73){var _0x44ed95=typeof _0x1ece62[_0x3435('0x1d')]===_0x3435('0x1e')&&typeof _0x1ece62[_0x3435('0x1f')]==='undefined';var _0x2023ba=_0x5a4e73[_0x3435('0x20')];var _0x31afd9=_0x44ed95?0x0:_0x1ece62[_0x3435('0x1d')];var _0x354343=_0x44ed95?_0x5a4e73['count']:_0x1ece62['offset']+_0x1ece62[_0x3435('0x1f')];var _0xb6e3ee;if(_0x354343>=_0x2023ba){_0x354343=_0x2023ba;_0xb6e3ee=0xc8;}else{_0xb6e3ee=0xce;}_0x4d57bd[_0x3435('0x1a')](_0xb6e3ee);return _0x4d57bd[_0x3435('0x21')]('Content-Range',_0x31afd9+'-'+_0x354343+'/'+_0x2023ba)['json'](_0x5a4e73);}return null;};}function patchUpdates(_0x541416){return function(_0x5041fb){try{jsonpatch['apply'](_0x5041fb,_0x541416,!![]);}catch(_0x26b0c0){return BPromise['reject'](_0x26b0c0);}return _0x5041fb[_0x3435('0x22')]();};}function saveUpdates(_0x311654,_0x309b28){return function(_0x2383f8){if(_0x2383f8){return _0x2383f8[_0x3435('0x23')](_0x311654)[_0x3435('0x24')](function(_0x214371){return _0x214371;});}return null;};}function removeEntity(_0x39b9a4,_0x407e31){return function(_0x24df0a){if(_0x24df0a){return _0x24df0a[_0x3435('0x25')]()[_0x3435('0x24')](function(){_0x39b9a4[_0x3435('0x1a')](0xcc)[_0x3435('0x1b')]();});}};}function handleEntityNotFound(_0x52c652,_0x2d5d9a){return function(_0x10e47e){if(!_0x10e47e){_0x52c652[_0x3435('0x26')](0x194);}return _0x10e47e;};}function handleError(_0x460f8b,_0x3eb407){_0x3eb407=_0x3eb407||0x1f4;return function(_0x52b0f9){logger[_0x3435('0x27')](_0x52b0f9[_0x3435('0x28')]);if(_0x52b0f9[_0x3435('0x29')]){delete _0x52b0f9['name'];}_0x460f8b[_0x3435('0x1a')](_0x3eb407)[_0x3435('0x2a')](_0x52b0f9);};}exports['index']=function(_0x110165,_0x4f96aa){var _0x12577f={},_0x1ef064={},_0xf00769={'count':0x0,'rows':[]};var _0xaba734=_['map'](db[_0x3435('0x2b')]['rawAttributes'],function(_0x11c07d){return{'name':_0x11c07d['fieldName'],'type':_0x11c07d['type'][_0x3435('0x2c')]};});_0x1ef064['model']=_[_0x3435('0x2d')](_0xaba734,_0x3435('0x29'));_0x1ef064[_0x3435('0x2e')]=_[_0x3435('0x2f')](_0x110165[_0x3435('0x2e')]);_0x1ef064[_0x3435('0x30')]=_['intersection'](_0x1ef064[_0x3435('0x31')],_0x1ef064[_0x3435('0x2e')]);_0x12577f['attributes']=_[_0x3435('0x32')](_0x1ef064[_0x3435('0x31')],qs[_0x3435('0x33')](_0x110165['query'][_0x3435('0x33')]));_0x12577f['attributes']=_0x12577f['attributes'][_0x3435('0x34')]?_0x12577f[_0x3435('0x35')]:_0x1ef064[_0x3435('0x31')];if(!_0x110165[_0x3435('0x2e')]['hasOwnProperty'](_0x3435('0x36'))){_0x12577f[_0x3435('0x1f')]=qs[_0x3435('0x1f')](_0x110165[_0x3435('0x2e')][_0x3435('0x1f')]);_0x12577f[_0x3435('0x1d')]=qs['offset'](_0x110165[_0x3435('0x2e')]['offset']);}_0x12577f['order']=qs[_0x3435('0x37')](_0x110165['query'][_0x3435('0x37')]);_0x12577f[_0x3435('0x38')]=qs[_0x3435('0x30')](_[_0x3435('0x39')](_0x110165[_0x3435('0x2e')],_0x1ef064[_0x3435('0x30')]),_0xaba734);if(_0x110165['query'][_0x3435('0x3a')]){_0x12577f[_0x3435('0x38')]=_[_0x3435('0x3b')](_0x12577f[_0x3435('0x38')],{'$or':_[_0x3435('0x2d')](_0xaba734,function(_0x5a9a20){if(_0x5a9a20[_0x3435('0x3c')]!=='VIRTUAL'){var _0x1c0cd4={};_0x1c0cd4[_0x5a9a20['name']]={'$like':'%'+_0x110165[_0x3435('0x2e')][_0x3435('0x3a')]+'%'};return _0x1c0cd4;}})});}_0x12577f=_[_0x3435('0x3b')]({},_0x12577f,_0x110165['options']);var _0x5bfeb0={'where':_0x12577f[_0x3435('0x38')]};return db[_0x3435('0x2b')][_0x3435('0x20')](_0x5bfeb0)[_0x3435('0x24')](function(_0x264414){_0xf00769['count']=_0x264414;if(_0x110165['query']['includeAll']){_0x12577f[_0x3435('0x3d')]=[{'all':!![]}];}return db[_0x3435('0x2b')]['findAll'](_0x12577f);})[_0x3435('0x24')](function(_0x4a4794){_0xf00769['rows']=_0x4a4794;return _0xf00769;})[_0x3435('0x24')](respondWithFilteredResult(_0x4f96aa,_0x12577f))[_0x3435('0x3e')](handleError(_0x4f96aa,null));};exports[_0x3435('0x3f')]=function(_0x72af6f,_0x724d2e){var _0x5bada1={'raw':!![],'where':{'id':_0x72af6f['params']['id']}},_0x5862de={};_0x5862de[_0x3435('0x31')]=_['keys'](db['VoiceDialReport']['rawAttributes']);_0x5862de['query']=_['keys'](_0x72af6f[_0x3435('0x2e')]);_0x5862de[_0x3435('0x30')]=_['intersection'](_0x5862de['model'],_0x5862de[_0x3435('0x2e')]);_0x5bada1[_0x3435('0x35')]=_[_0x3435('0x32')](_0x5862de['model'],qs['fields'](_0x72af6f[_0x3435('0x2e')][_0x3435('0x33')]));_0x5bada1[_0x3435('0x35')]=_0x5bada1['attributes'][_0x3435('0x34')]?_0x5bada1[_0x3435('0x35')]:_0x5862de[_0x3435('0x31')];if(_0x72af6f[_0x3435('0x2e')][_0x3435('0x40')]){_0x5bada1['include']=[{'all':!![]}];}_0x5bada1=_[_0x3435('0x3b')]({},_0x5bada1,_0x72af6f['options']);return db[_0x3435('0x2b')][_0x3435('0x41')](_0x5bada1)[_0x3435('0x24')](handleEntityNotFound(_0x724d2e,null))[_0x3435('0x24')](respondWithResult(_0x724d2e,null))[_0x3435('0x3e')](handleError(_0x724d2e,null));};exports[_0x3435('0x42')]=function(_0x5da19b,_0x57a4a6){return db[_0x3435('0x2b')][_0x3435('0x42')](_0x5da19b['body'],{})[_0x3435('0x24')](respondWithResult(_0x57a4a6,0xc9))[_0x3435('0x3e')](handleError(_0x57a4a6,null));};exports[_0x3435('0x23')]=function(_0x4dc48a,_0x545f6d){if(_0x4dc48a['body']['id']){delete _0x4dc48a[_0x3435('0x43')]['id'];}return db[_0x3435('0x2b')]['find']({'where':{'id':_0x4dc48a[_0x3435('0x44')]['id']}})[_0x3435('0x24')](handleEntityNotFound(_0x545f6d,null))[_0x3435('0x24')](saveUpdates(_0x4dc48a[_0x3435('0x43')],null))[_0x3435('0x24')](respondWithResult(_0x545f6d,null))[_0x3435('0x3e')](handleError(_0x545f6d,null));};exports[_0x3435('0x25')]=function(_0x1d9664,_0x363e95){return db['VoiceDialReport'][_0x3435('0x41')]({'where':{'id':_0x1d9664[_0x3435('0x44')]['id']}})[_0x3435('0x24')](handleEntityNotFound(_0x363e95,null))['then'](removeEntity(_0x363e95,null))[_0x3435('0x3e')](handleError(_0x363e95,null));};exports['describe']=function(_0x50b5c6,_0xdf5d5d){return db[_0x3435('0x2b')][_0x3435('0x45')]()[_0x3435('0x24')](respondWithResult(_0xdf5d5d,null))['catch'](handleError(_0xdf5d5d,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index a6b61df..b5b6b06 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 _0xd5cc=['define','report_dial','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x526108,_0x1fb861){var _0x521a0a=function(_0x5db266){while(--_0x5db266){_0x526108['push'](_0x526108['shift']());}};_0x521a0a(++_0x1fb861);}(_0xd5cc,0x93));var _0xcd5c=function(_0x415f64,_0x258dc6){_0x415f64=_0x415f64-0x0;var _0x364b0e=_0xd5cc[_0x415f64];return _0x364b0e;};'use strict';var _=require('lodash');var util=require(_0xcd5c('0x0'));var logger=require(_0xcd5c('0x1'))(_0xcd5c('0x2'));var moment=require(_0xcd5c('0x3'));var BPromise=require(_0xcd5c('0x4'));var rp=require(_0xcd5c('0x5'));var fs=require('fs');var path=require(_0xcd5c('0x6'));var rimraf=require(_0xcd5c('0x7'));var config=require(_0xcd5c('0x8'));var attributes=require('./voiceDialReport.attributes');module['exports']=function(_0x38e6a0,_0x3fc05f){return _0x38e6a0[_0xcd5c('0x9')]('VoiceDialReport',attributes,{'tableName':_0xcd5c('0xa'),'paranoid':![],'indexes':[{'fields':[_0xcd5c('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x072c=['bluebird','request-promise','../../config/environment','./voiceDialReport.attributes','exports','uniqueid','util','../../config/logger'];(function(_0x41217c,_0x190555){var _0x1cce05=function(_0x41f2c7){while(--_0x41f2c7){_0x41217c['push'](_0x41217c['shift']());}};_0x1cce05(++_0x190555);}(_0x072c,0x10e));var _0xc072=function(_0x37497f,_0x11dc54){_0x37497f=_0x37497f-0x0;var _0x5001df=_0x072c[_0x37497f];return _0x5001df;};'use strict';var _=require('lodash');var util=require(_0xc072('0x0'));var logger=require(_0xc072('0x1'))('api');var moment=require('moment');var BPromise=require(_0xc072('0x2'));var rp=require(_0xc072('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc072('0x4'));var attributes=require(_0xc072('0x5'));module[_0xc072('0x6')]=function(_0x23c62b,_0x27514c){return _0x23c62b['define']('VoiceDialReport',attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':[_0xc072('0x7')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 41e87d3..f607a6a 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 _0xa31f=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateVoiceDialReport','VoiceDialReport','body','raw','catch','UpdateVoiceDialReport','update','options','where','attributes','limit','lodash','util','moment','bluebird','randomstring'];(function(_0x5c742e,_0x4fb205){var _0x21854f=function(_0x553f9f){while(--_0x553f9f){_0x5c742e['push'](_0x5c742e['shift']());}};_0x21854f(++_0x4fb205);}(_0xa31f,0x8b));var _0xfa31=function(_0x19f53c,_0x5cee32){_0x19f53c=_0x19f53c-0x0;var _0x262271=_0xa31f[_0x19f53c];return _0x262271;};'use strict';var _=require(_0xfa31('0x0'));var util=require(_0xfa31('0x1'));var moment=require(_0xfa31('0x2'));var BPromise=require(_0xfa31('0x3'));var rs=require(_0xfa31('0x4'));var fs=require('fs');var Redis=require(_0xfa31('0x5'));var db=require(_0xfa31('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xfa31('0x7'))(_0xfa31('0x8'));var config=require(_0xfa31('0x9'));var jayson=require(_0xfa31('0xa'));var client=jayson[_0xfa31('0xb')][_0xfa31('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1d2425,_0x2a756b,_0x54726d){return new BPromise(function(_0x347fb1,_0x3599a4){return client[_0xfa31('0xd')](_0x1d2425,_0x54726d)[_0xfa31('0xe')](function(_0x151f91){logger[_0xfa31('0xf')](_0xfa31('0x10'),_0x2a756b,_0xfa31('0x11'));logger[_0xfa31('0x12')](_0xfa31('0x13'),_0x2a756b,'request\x20sent',JSON[_0xfa31('0x14')](_0x151f91));if(_0x151f91[_0xfa31('0x15')]){if(_0x151f91[_0xfa31('0x15')][_0xfa31('0x16')]===0x1f4){logger['error'](_0xfa31('0x10'),_0x2a756b,_0x151f91['error'][_0xfa31('0x17')]);return _0x3599a4(_0x151f91[_0xfa31('0x15')][_0xfa31('0x17')]);}logger['error'](_0xfa31('0x10'),_0x2a756b,_0x151f91[_0xfa31('0x15')]['message']);return _0x347fb1(_0x151f91['error'][_0xfa31('0x17')]);}else{logger[_0xfa31('0xf')](_0xfa31('0x10'),_0x2a756b,_0xfa31('0x11'));_0x347fb1(_0x151f91[_0xfa31('0x18')][_0xfa31('0x17')]);}})['catch'](function(_0x981eea){logger[_0xfa31('0x15')](_0xfa31('0x10'),_0x2a756b,_0x981eea);_0x3599a4(_0x981eea);});});}exports[_0xfa31('0x19')]=function(_0x1c5f87){var _0x42e71b=this;return new Promise(function(_0x47642c,_0x4ca26e){return db[_0xfa31('0x1a')]['create'](_0x1c5f87[_0xfa31('0x1b')],{'raw':_0x1c5f87['options']?_0x1c5f87['options'][_0xfa31('0x1c')]===undefined?!![]:![]:!![]})[_0xfa31('0xe')](function(_0x3daef3){logger[_0xfa31('0xf')](_0xfa31('0x19'),_0x1c5f87);logger[_0xfa31('0x12')](_0xfa31('0x19'),_0x1c5f87,JSON[_0xfa31('0x14')](_0x3daef3));_0x47642c(_0x3daef3);})[_0xfa31('0x1d')](function(_0x4f25ed){logger[_0xfa31('0x15')](_0xfa31('0x19'),_0x4f25ed[_0xfa31('0x17')],_0x1c5f87);_0x4ca26e(_0x42e71b[_0xfa31('0x15')](0x1f4,_0x4f25ed[_0xfa31('0x17')]));});});};exports[_0xfa31('0x1e')]=function(_0x342942){var _0x5d3fbb=this;return new Promise(function(_0x49f8dd,_0x31a88e){return db[_0xfa31('0x1a')][_0xfa31('0x1f')](_0x342942[_0xfa31('0x1b')],{'raw':_0x342942['options']?_0x342942[_0xfa31('0x20')][_0xfa31('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x342942[_0xfa31('0x20')]?_0x342942[_0xfa31('0x20')][_0xfa31('0x21')]||null:null,'attributes':_0x342942[_0xfa31('0x20')]?_0x342942[_0xfa31('0x20')][_0xfa31('0x22')]||null:null,'limit':_0x342942['options']?_0x342942[_0xfa31('0x20')][_0xfa31('0x23')]||null:null})[_0xfa31('0xe')](function(_0x51fb0c){logger['info']('UpdateVoiceDialReport',_0x342942);logger[_0xfa31('0x12')](_0xfa31('0x1e'),_0x342942,JSON[_0xfa31('0x14')](_0x51fb0c));_0x49f8dd(_0x51fb0c);})['catch'](function(_0x43d12d){logger[_0xfa31('0x15')](_0xfa31('0x1e'),_0x43d12d['message'],_0x342942);_0x31a88e(_0x5d3fbb[_0xfa31('0x15')](0x1f4,_0x43d12d['message']));});});}; \ No newline at end of file +var _0x93ce=['CreateVoiceDialReport','UpdateVoiceDialReport','update','where','attributes','limit','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then','info','request\x20sent','debug','stringify','error','code','VoiceDialReport,\x20%s,\x20%s','message','result','catch','VoiceDialReport','create','options','raw'];(function(_0x2cc711,_0x300328){var _0x31a52e=function(_0x588378){while(--_0x588378){_0x2cc711['push'](_0x2cc711['shift']());}};_0x31a52e(++_0x300328);}(_0x93ce,0x1b8));var _0xe93c=function(_0x51d00b,_0x2b9cb8){_0x51d00b=_0x51d00b-0x0;var _0x272118=_0x93ce[_0x51d00b];return _0x272118;};'use strict';var _=require('lodash');var util=require(_0xe93c('0x0'));var moment=require('moment');var BPromise=require(_0xe93c('0x1'));var rs=require(_0xe93c('0x2'));var fs=require('fs');var Redis=require(_0xe93c('0x3'));var db=require(_0xe93c('0x4'))['db'];var utils=require(_0xe93c('0x5'));var logger=require(_0xe93c('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe93c('0x7'));var client=jayson[_0xe93c('0x8')][_0xe93c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3775b5,_0x45dc75,_0x76f2a5){return new BPromise(function(_0x112d96,_0x4b0739){return client['request'](_0x3775b5,_0x76f2a5)[_0xe93c('0xa')](function(_0x1595a0){logger[_0xe93c('0xb')]('VoiceDialReport,\x20%s,\x20%s',_0x45dc75,_0xe93c('0xc'));logger[_0xe93c('0xd')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x45dc75,'request\x20sent',JSON[_0xe93c('0xe')](_0x1595a0));if(_0x1595a0[_0xe93c('0xf')]){if(_0x1595a0[_0xe93c('0xf')][_0xe93c('0x10')]===0x1f4){logger['error'](_0xe93c('0x11'),_0x45dc75,_0x1595a0[_0xe93c('0xf')]['message']);return _0x4b0739(_0x1595a0[_0xe93c('0xf')][_0xe93c('0x12')]);}logger[_0xe93c('0xf')](_0xe93c('0x11'),_0x45dc75,_0x1595a0[_0xe93c('0xf')][_0xe93c('0x12')]);return _0x112d96(_0x1595a0[_0xe93c('0xf')][_0xe93c('0x12')]);}else{logger[_0xe93c('0xb')](_0xe93c('0x11'),_0x45dc75,_0xe93c('0xc'));_0x112d96(_0x1595a0[_0xe93c('0x13')][_0xe93c('0x12')]);}})[_0xe93c('0x14')](function(_0x4fc7ae){logger['error'](_0xe93c('0x11'),_0x45dc75,_0x4fc7ae);_0x4b0739(_0x4fc7ae);});});}exports['CreateVoiceDialReport']=function(_0x5f5c57){var _0x439ead=this;return new Promise(function(_0xbd4ee4,_0x25fb4a){return db[_0xe93c('0x15')][_0xe93c('0x16')](_0x5f5c57['body'],{'raw':_0x5f5c57[_0xe93c('0x17')]?_0x5f5c57[_0xe93c('0x17')][_0xe93c('0x18')]===undefined?!![]:![]:!![]})[_0xe93c('0xa')](function(_0x129329){logger[_0xe93c('0xb')]('CreateVoiceDialReport',_0x5f5c57);logger[_0xe93c('0xd')](_0xe93c('0x19'),_0x5f5c57,JSON[_0xe93c('0xe')](_0x129329));_0xbd4ee4(_0x129329);})[_0xe93c('0x14')](function(_0x5cc642){logger[_0xe93c('0xf')](_0xe93c('0x19'),_0x5cc642[_0xe93c('0x12')],_0x5f5c57);_0x25fb4a(_0x439ead['error'](0x1f4,_0x5cc642[_0xe93c('0x12')]));});});};exports[_0xe93c('0x1a')]=function(_0xab25ca){var _0x148a6d=this;return new Promise(function(_0x415f8e,_0xc540be){return db[_0xe93c('0x15')][_0xe93c('0x1b')](_0xab25ca['body'],{'raw':_0xab25ca['options']?_0xab25ca[_0xe93c('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xab25ca[_0xe93c('0x17')]?_0xab25ca['options'][_0xe93c('0x1c')]||null:null,'attributes':_0xab25ca[_0xe93c('0x17')]?_0xab25ca[_0xe93c('0x17')][_0xe93c('0x1d')]||null:null,'limit':_0xab25ca[_0xe93c('0x17')]?_0xab25ca[_0xe93c('0x17')][_0xe93c('0x1e')]||null:null})[_0xe93c('0xa')](function(_0x3d9347){logger[_0xe93c('0xb')](_0xe93c('0x1a'),_0xab25ca);logger['debug'](_0xe93c('0x1a'),_0xab25ca,JSON[_0xe93c('0xe')](_0x3d9347));_0x415f8e(_0x3d9347);})[_0xe93c('0x14')](function(_0x567ab0){logger[_0xe93c('0xf')](_0xe93c('0x1a'),_0x567ab0[_0xe93c('0x12')],_0xab25ca);_0xc540be(_0x148a6d[_0xe93c('0xf')](0x1f4,_0x567ab0[_0xe93c('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 130f8fb..f9e5a50 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 _0xf336=['connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','index','/:id','isAuthenticated','show','post','create','addApplications','put','update','delete','multer','util','path'];(function(_0x527b5a,_0x22382a){var _0x4caf7d=function(_0x2a6eab){while(--_0x2a6eab){_0x527b5a['push'](_0x527b5a['shift']());}};_0x4caf7d(++_0x22382a);}(_0xf336,0x101));var _0x6f33=function(_0x31a454,_0x3ac66d){_0x31a454=_0x31a454-0x0;var _0x1595bb=_0xf336[_0x31a454];return _0x1595bb;};'use strict';var multer=require(_0x6f33('0x0'));var util=require(_0x6f33('0x1'));var path=require(_0x6f33('0x2'));var timeout=require(_0x6f33('0x3'));var express=require('express');var router=express[_0x6f33('0x4')]();var fs_extra=require(_0x6f33('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6f33('0x6'));var config=require(_0x6f33('0x7'));var controller=require(_0x6f33('0x8'));router[_0x6f33('0x9')]('/',auth['isAuthenticated'](),controller[_0x6f33('0xa')]);router['get'](_0x6f33('0xb'),auth[_0x6f33('0xc')](),controller[_0x6f33('0xd')]);router[_0x6f33('0xe')]('/',auth['isAuthenticated'](),controller[_0x6f33('0xf')]);router['post']('/:id/applications',auth[_0x6f33('0xc')](),controller[_0x6f33('0x10')]);router[_0x6f33('0x11')](_0x6f33('0xb'),auth[_0x6f33('0xc')](),controller[_0x6f33('0x12')]);router[_0x6f33('0x13')](_0x6f33('0xb'),auth[_0x6f33('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x2cb1=['./voiceExtension.controller','get','index','/:id','isAuthenticated','post','create','/:id/applications','addApplications','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x5db324,_0x313daa){var _0xadd578=function(_0x592cde){while(--_0x592cde){_0x5db324['push'](_0x5db324['shift']());}};_0xadd578(++_0x313daa);}(_0x2cb1,0x1d9));var _0x12cb=function(_0xb44aa5,_0x25a0cd){_0xb44aa5=_0xb44aa5-0x0;var _0x2405db=_0x2cb1[_0xb44aa5];return _0x2405db;};'use strict';var multer=require(_0x12cb('0x0'));var util=require('util');var path=require(_0x12cb('0x1'));var timeout=require(_0x12cb('0x2'));var express=require('express');var router=express[_0x12cb('0x3')]();var fs_extra=require(_0x12cb('0x4'));var auth=require(_0x12cb('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x12cb('0x6'));var controller=require(_0x12cb('0x7'));router[_0x12cb('0x8')]('/',auth['isAuthenticated'](),controller[_0x12cb('0x9')]);router[_0x12cb('0x8')](_0x12cb('0xa'),auth[_0x12cb('0xb')](),controller['show']);router[_0x12cb('0xc')]('/',auth['isAuthenticated'](),controller[_0x12cb('0xd')]);router['post'](_0x12cb('0xe'),auth[_0x12cb('0xb')](),controller[_0x12cb('0xf')]);router['put'](_0x12cb('0xa'),auth['isAuthenticated'](),controller[_0x12cb('0x10')]);router[_0x12cb('0x11')]('/:id',auth[_0x12cb('0xb')](),controller[_0x12cb('0x12')]);module[_0x12cb('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 55546cf..df76024 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 _0xf84f=['STRING','compositeIndex','NoOp','ENUM','inbound','outbound','inbound-fax','outbound-fax','any','*,*,*,*','BOOLEAN','wav','VIRTUAL','exten','sequelize'];(function(_0x59d916,_0x1b5574){var _0x5ef3ea=function(_0x710ad9){while(--_0x710ad9){_0x59d916['push'](_0x59d916['shift']());}};_0x5ef3ea(++_0x1b5574);}(_0xf84f,0x158));var _0xff84=function(_0x2ef593,_0x4719f4){_0x2ef593=_0x2ef593-0x0;var _0x494095=_0xf84f[_0x2ef593];return _0x494095;};'use strict';var Sequelize=require(_0xff84('0x0'));module['exports']={'context':{'type':Sequelize[_0xff84('0x1')],'allowNull':![],'unique':_0xff84('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xff84('0x1')],'allowNull':![],'unique':_0xff84('0x2')},'priority':{'type':Sequelize[_0xff84('0x1')],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize[_0xff84('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xff84('0x1')],'allowNull':![],'defaultValue':_0xff84('0x3')},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xff84('0x4')](_0xff84('0x5'),_0xff84('0x6'),'internal',_0xff84('0x7'),_0xff84('0x8'),'system',_0xff84('0x9')),'allowNull':![]},'description':{'type':Sequelize[_0xff84('0x1')]},'interval':{'type':Sequelize[_0xff84('0x1')],'allowNull':![],'defaultValue':_0xff84('0xa')},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize[_0xff84('0xb')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xff84('0x1')],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0xff84('0xb')],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize[_0xff84('0x1')],'defaultValue':_0xff84('0xc')},'answer':{'type':Sequelize[_0xff84('0xb')],'defaultValue':!![]},'name':{'type':Sequelize[_0xff84('0xd')],'get':function(_0x136382){return this['getDataValue'](_0xff84('0xe'));}},'alias':{'type':Sequelize[_0xff84('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0x3b03=['inbound','outbound','outbound-fax','system','any','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','exten','sequelize','STRING','compositeIndex','NoOp','ENUM'];(function(_0x5d3b20,_0x2f43f1){var _0x1a0cb0=function(_0x23c5da){while(--_0x23c5da){_0x5d3b20['push'](_0x5d3b20['shift']());}};_0x1a0cb0(++_0x2f43f1);}(_0x3b03,0x72));var _0x33b0=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x3b03[_0x2bf141];return _0x48277b;};'use strict';var Sequelize=require(_0x33b0('0x0'));module['exports']={'context':{'type':Sequelize[_0x33b0('0x1')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x33b0('0x1')],'allowNull':![],'unique':_0x33b0('0x2')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0x33b0('0x2')},'tag':{'type':Sequelize[_0x33b0('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x33b0('0x3')},'appdata':{'type':Sequelize[_0x33b0('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x33b0('0x4')](_0x33b0('0x5'),_0x33b0('0x6'),'internal','inbound-fax',_0x33b0('0x7'),_0x33b0('0x8'),_0x33b0('0x9')),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x33b0('0xa')},'IntervalId':{'type':Sequelize[_0x33b0('0xb')]},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x33b0('0x1')],'defaultValue':null},'callerID':{'type':Sequelize[_0x33b0('0x1')],'allowNull':!![]},'record':{'type':Sequelize[_0x33b0('0xc')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x33b0('0xb')]},'recordingFormat':{'type':Sequelize[_0x33b0('0x1')],'defaultValue':_0x33b0('0xd')},'answer':{'type':Sequelize[_0x33b0('0xc')],'defaultValue':!![]},'name':{'type':Sequelize[_0x33b0('0xe')],'get':function(_0x48482a){return this[_0x33b0('0xf')](_0x33b0('0x10'));}},'alias':{'type':Sequelize[_0x33b0('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 802d88e..14ca7b8 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 _0xbc7f=['intersection','attributes','fields','nolimit','order','sort','where','pick','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','length','include','create','body','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','InboundRoutes','InternalRoutes','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','description','cutdigits','mandatoryDisposition','alias','context','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','findOne','VoiceExtensionId','isApp','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','send','ioredis','../../components/parsers/qs','../../config/logger','api','defaults','redis','./voiceExtension.socket','register','sendStatus','status','json','offset','undefined','count','limit','set','destroy','then','get','inbound','OutboundRoutes','outbound','internal','filter','map','value','includes','type','find','name','UserProfileResource','end','stack','index','VoiceExtension','fieldName','key','model','keys','query','filters'];(function(_0x506538,_0x2fe4f7){var _0x360146=function(_0x3a7eca){while(--_0x3a7eca){_0x506538['push'](_0x506538['shift']());}};_0x360146(++_0x2fe4f7);}(_0xbc7f,0x143));var _0xfbc7=function(_0x123eda,_0x29efd9){_0x123eda=_0x123eda-0x0;var _0x132547=_0xbc7f[_0x123eda];return _0x132547;};'use strict';var _=require('lodash');var Redis=require(_0xfbc7('0x0'));var qs=require(_0xfbc7('0x1'));var logger=require(_0xfbc7('0x2'))(_0xfbc7('0x3'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_[_0xfbc7('0x4')](config[_0xfbc7('0x5')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfbc7('0x5')]));require(_0xfbc7('0x6'))[_0xfbc7('0x7')](socket);function respondWithStatusCode(_0x41c628,_0x4c2558){_0x4c2558=_0x4c2558||0xcc;return function(_0x245f84){if(_0x245f84){return _0x41c628[_0xfbc7('0x8')](_0x4c2558);}return _0x41c628[_0xfbc7('0x9')](_0x4c2558)['end']();};}function respondWithResult(_0x16a995,_0x3d8e7a){_0x3d8e7a=_0x3d8e7a||0xc8;return function(_0x554b20){if(_0x554b20){return _0x16a995[_0xfbc7('0x9')](_0x3d8e7a)[_0xfbc7('0xa')](_0x554b20);}};}function respondWithFilteredResult(_0x23f164,_0x44efe0){return function(_0x36bcbf){if(_0x36bcbf){var _0x1a7208=typeof _0x44efe0[_0xfbc7('0xb')]===_0xfbc7('0xc')&&typeof _0x44efe0['limit']===_0xfbc7('0xc');var _0x47d3c6=_0x36bcbf['count'];var _0x1cca46=_0x1a7208?0x0:_0x44efe0[_0xfbc7('0xb')];var _0x117b92=_0x1a7208?_0x36bcbf[_0xfbc7('0xd')]:_0x44efe0[_0xfbc7('0xb')]+_0x44efe0[_0xfbc7('0xe')];var _0x1091d0;if(_0x117b92>=_0x47d3c6){_0x117b92=_0x47d3c6;_0x1091d0=0xc8;}else{_0x1091d0=0xce;}_0x23f164[_0xfbc7('0x9')](_0x1091d0);return _0x23f164[_0xfbc7('0xf')]('Content-Range',_0x1cca46+'-'+_0x117b92+'/'+_0x47d3c6)['json'](_0x36bcbf);}return null;};}function removeEntity(_0x1ce835){return function(_0x4d075e){if(_0x4d075e){return _0x4d075e[_0xfbc7('0x10')]()[_0xfbc7('0x11')](function(){var _0x5cbdb0=_0x4d075e[_0xfbc7('0x12')]({'plain':!![]});var _0x4b6ffe=[{'name':'InboundRoutes','value':_0xfbc7('0x13'),'ignore':![]},{'name':_0xfbc7('0x14'),'value':_0xfbc7('0x15'),'ignore':![]},{'name':'InternalRoutes','value':_0xfbc7('0x16'),'ignore':![]}];var _0x22b02b=_(_0x4b6ffe)[_0xfbc7('0x17')]('ignore')[_0xfbc7('0x18')](_0xfbc7('0x19'))[_0xfbc7('0x19')]();if(_[_0xfbc7('0x1a')](_0x22b02b,_0x5cbdb0[_0xfbc7('0x1b')])){return;}var _0x4f3a3d=_[_0xfbc7('0x1c')](_0x4b6ffe,[_0xfbc7('0x19'),_0x5cbdb0[_0xfbc7('0x1b')]])[_0xfbc7('0x1d')];return db[_0xfbc7('0x1e')]['destroy']({'where':{'type':_0x4f3a3d,'resourceId':_0x5cbdb0['id']}})[_0xfbc7('0x11')](function(){return _0x4d075e;});})[_0xfbc7('0x11')](function(){_0x1ce835['status'](0xcc)[_0xfbc7('0x1f')]();});}};}function handleEntityNotFound(_0x5d6d58){return function(_0x20c733){if(!_0x20c733){_0x5d6d58[_0xfbc7('0x8')](0x194);}return _0x20c733;};}function handleError(_0x8e4385,_0x1009c1){_0x1009c1=_0x1009c1||0x1f4;return function(_0x2399fb){logger['error'](_0x2399fb[_0xfbc7('0x20')]);if(_0x2399fb[_0xfbc7('0x1d')]){delete _0x2399fb[_0xfbc7('0x1d')];}_0x8e4385[_0xfbc7('0x9')](_0x1009c1)['send'](_0x2399fb);};}exports[_0xfbc7('0x21')]=function(_0x13e4e0,_0x4009ec){var _0x409873={},_0x183d49={},_0x7bd328={'count':0x0,'rows':[]};var _0x34661b=_[_0xfbc7('0x18')](db[_0xfbc7('0x22')]['rawAttributes'],function(_0x54289e){return{'name':_0x54289e[_0xfbc7('0x23')],'type':_0x54289e['type'][_0xfbc7('0x24')]};});_0x183d49[_0xfbc7('0x25')]=_[_0xfbc7('0x18')](_0x34661b,'name');_0x183d49['query']=_[_0xfbc7('0x26')](_0x13e4e0[_0xfbc7('0x27')]);_0x183d49[_0xfbc7('0x28')]=_[_0xfbc7('0x29')](_0x183d49[_0xfbc7('0x25')],_0x183d49[_0xfbc7('0x27')]);_0x409873[_0xfbc7('0x2a')]=_[_0xfbc7('0x29')](_0x183d49[_0xfbc7('0x25')],qs[_0xfbc7('0x2b')](_0x13e4e0[_0xfbc7('0x27')][_0xfbc7('0x2b')]));_0x409873['attributes']=_0x409873[_0xfbc7('0x2a')]['length']?_0x409873['attributes']:_0x183d49['model'];if(!_0x13e4e0[_0xfbc7('0x27')]['hasOwnProperty'](_0xfbc7('0x2c'))){_0x409873[_0xfbc7('0xe')]=qs[_0xfbc7('0xe')](_0x13e4e0['query'][_0xfbc7('0xe')]);_0x409873['offset']=qs[_0xfbc7('0xb')](_0x13e4e0[_0xfbc7('0x27')][_0xfbc7('0xb')]);}_0x409873[_0xfbc7('0x2d')]=qs[_0xfbc7('0x2e')](_0x13e4e0['query'][_0xfbc7('0x2e')]);_0x409873[_0xfbc7('0x2f')]=qs[_0xfbc7('0x28')](_[_0xfbc7('0x30')](_0x13e4e0[_0xfbc7('0x27')],_0x183d49['filters']),_0x34661b);if(_0x13e4e0[_0xfbc7('0x27')][_0xfbc7('0x17')]){_0x409873[_0xfbc7('0x2f')]=_[_0xfbc7('0x31')](_0x409873[_0xfbc7('0x2f')],{'$or':_[_0xfbc7('0x18')](_0x34661b,function(_0x3efd74){if(_0x3efd74[_0xfbc7('0x1b')]!==_0xfbc7('0x32')){var _0x42f113={};_0x42f113[_0x3efd74[_0xfbc7('0x1d')]]={'$like':'%'+_0x13e4e0[_0xfbc7('0x27')][_0xfbc7('0x17')]+'%'};return _0x42f113;}})});}_0x409873=_['merge']({},_0x409873,_0x13e4e0['options']);var _0x115dac={'where':_0x409873['where']};return db[_0xfbc7('0x22')]['count'](_0x115dac)[_0xfbc7('0x11')](function(_0x4b579f){_0x7bd328[_0xfbc7('0xd')]=_0x4b579f;if(_0x13e4e0[_0xfbc7('0x27')][_0xfbc7('0x33')]){_0x409873['include']=[{'all':!![]}];}return db[_0xfbc7('0x22')][_0xfbc7('0x34')](_0x409873);})[_0xfbc7('0x11')](function(_0x13c0da){_0x7bd328[_0xfbc7('0x35')]=_0x13c0da;return _0x7bd328;})[_0xfbc7('0x11')](respondWithFilteredResult(_0x4009ec,_0x409873))[_0xfbc7('0x36')](handleError(_0x4009ec,null));};exports[_0xfbc7('0x37')]=function(_0x18e790,_0x1d2151){var _0x5c7595={'raw':![],'where':{'id':_0x18e790[_0xfbc7('0x38')]['id']}},_0x488ad8={};_0x488ad8['model']=_[_0xfbc7('0x26')](db[_0xfbc7('0x22')]['rawAttributes']);_0x488ad8[_0xfbc7('0x27')]=_[_0xfbc7('0x26')](_0x18e790[_0xfbc7('0x27')]);_0x488ad8[_0xfbc7('0x28')]=_['intersection'](_0x488ad8['model'],_0x488ad8[_0xfbc7('0x27')]);_0x5c7595[_0xfbc7('0x2a')]=_[_0xfbc7('0x29')](_0x488ad8[_0xfbc7('0x25')],qs[_0xfbc7('0x2b')](_0x18e790[_0xfbc7('0x27')][_0xfbc7('0x2b')]));_0x5c7595[_0xfbc7('0x2a')]=_0x5c7595[_0xfbc7('0x2a')][_0xfbc7('0x39')]?_0x5c7595[_0xfbc7('0x2a')]:_0x488ad8[_0xfbc7('0x25')];if(_0x18e790['query'][_0xfbc7('0x33')]){_0x5c7595[_0xfbc7('0x3a')]=[{'all':!![]}];}_0x5c7595=_['merge']({},_0x5c7595,_0x18e790['options']);return db[_0xfbc7('0x22')]['find'](_0x5c7595)[_0xfbc7('0x11')](handleEntityNotFound(_0x1d2151,null))[_0xfbc7('0x11')](respondWithResult(_0x1d2151,null))[_0xfbc7('0x36')](handleError(_0x1d2151,null));};exports['destroy']=function(_0x29c699,_0xd0d131){return db[_0xfbc7('0x22')][_0xfbc7('0x1c')]({'where':{'id':_0x29c699[_0xfbc7('0x38')]['id']}})[_0xfbc7('0x11')](handleEntityNotFound(_0xd0d131,null))[_0xfbc7('0x11')](removeEntity(_0xd0d131,null))[_0xfbc7('0x36')](handleError(_0xd0d131,null));};exports[_0xfbc7('0x3b')]=function(_0x37c255,_0x213397){if(_0x37c255[_0xfbc7('0x3c')]['type']===_0xfbc7('0x15')&&!_['startsWith'](_0x37c255[_0xfbc7('0x3c')][_0xfbc7('0x3d')],'_')){_0x37c255[_0xfbc7('0x3c')][_0xfbc7('0x3d')]='_'[_0xfbc7('0x3e')](_0x37c255['body']['exten']);}return db[_0xfbc7('0x22')][_0xfbc7('0x3b')](_0x37c255[_0xfbc7('0x3c')],{'raw':![]})[_0xfbc7('0x11')](function(_0x24480f){var _0x48784e=_0x37c255[_0xfbc7('0x3f')][_0xfbc7('0x12')]({'plain':!![]});if(!_0x48784e)throw new Error(_0xfbc7('0x40'));if(_0x48784e[_0xfbc7('0x41')]==='user'){var _0xe56c56=_0x24480f[_0xfbc7('0x12')]({'plain':!![]});var _0x55e8fe=[{'name':_0xfbc7('0x42'),'value':_0xfbc7('0x13')},{'name':_0xfbc7('0x14'),'value':'outbound'},{'name':_0xfbc7('0x43'),'value':_0xfbc7('0x16')}];var _0x2c5bf1=_['find'](_0x55e8fe,[_0xfbc7('0x19'),_0xe56c56[_0xfbc7('0x1b')]])[_0xfbc7('0x1d')];return db[_0xfbc7('0x44')][_0xfbc7('0x1c')]({'where':{'name':_0x2c5bf1,'userProfileId':_0x48784e['userProfileId']},'raw':!![]})[_0xfbc7('0x11')](function(_0x4ecdbd){if(_0x4ecdbd&&_0x4ecdbd[_0xfbc7('0x45')]===0x0){return db[_0xfbc7('0x1e')][_0xfbc7('0x3b')]({'name':_0xe56c56[_0xfbc7('0x1d')],'resourceId':_0xe56c56['id'],'type':_0x4ecdbd[_0xfbc7('0x1d')],'sectionId':_0x4ecdbd['id']},{})['then'](function(){return _0x24480f;});}else{return _0x24480f;}})[_0xfbc7('0x36')](function(_0x2d54f0){logger[_0xfbc7('0x46')](_0xfbc7('0x47'),_0x2d54f0);throw _0x2d54f0;});}return _0x24480f;})[_0xfbc7('0x11')](respondWithResult(_0x213397,0xc9))[_0xfbc7('0x36')](handleError(_0x213397,null));};exports[_0xfbc7('0x48')]=function(_0x32b12b,_0x2a6e6f){if(_0x32b12b[_0xfbc7('0x3c')]['id']){delete _0x32b12b[_0xfbc7('0x3c')]['id'];}return db[_0xfbc7('0x22')]['find']({'where':{'id':_0x32b12b[_0xfbc7('0x38')]['id']}})['then'](handleEntityNotFound(_0x2a6e6f,null))[_0xfbc7('0x11')](function(_0x224acc){if(_0x224acc){return db[_0xfbc7('0x22')][_0xfbc7('0x48')](_[_0xfbc7('0x30')](_0x32b12b[_0xfbc7('0x3c')],['exten','context',_0xfbc7('0x49'),'recordingFormat',_0xfbc7('0x4a'),_0xfbc7('0x4b'),_0xfbc7('0x4c')]),{'where':{'context':_0x224acc[_0xfbc7('0x4d')],'exten':_0x224acc[_0xfbc7('0x3d')]},'individualHooks':!![]})['then'](function(_0x2f08e3){return _0x2f08e3;});}return null;})[_0xfbc7('0x11')](respondWithStatusCode(_0x2a6e6f,null))[_0xfbc7('0x36')](handleError(_0x2a6e6f,null));};exports[_0xfbc7('0x4e')]=function(_0x263055,_0x3304f4){var _0x885ce8=_0x263055[_0xfbc7('0x38')]['id'];var _0x554d04=_0x263055['body'];var _0x47a404=0xc8;var _0x3a05bb=null;return db[_0xfbc7('0x4f')][_0xfbc7('0x50')]({'isolationLevel':db[_0xfbc7('0x4f')][_0xfbc7('0x51')]['ISOLATION_LEVELS'][_0xfbc7('0x52')]},function(_0x4bdca5){return db[_0xfbc7('0x22')][_0xfbc7('0x53')]({'where':{'id':_0x885ce8},'transaction':_0x4bdca5})[_0xfbc7('0x11')](function(_0x1b0b04){if(_0x1b0b04){return db[_0xfbc7('0x22')][_0xfbc7('0x10')]({'where':{'VoiceExtensionId':_0x885ce8},'transaction':_0x4bdca5})[_0xfbc7('0x11')](function(){var _0x5b425c=_[_0xfbc7('0x18')](_0x554d04,function(_0x47c825){_0x47c825[_0xfbc7('0x54')]=_0x885ce8;_0x47c825[_0xfbc7('0x55')]=!![];return _0x47c825;});return _0x1b0b04[_0xfbc7('0x56')](_0x5b425c);})[_0xfbc7('0x11')](function(_0x350e7b){return db['VoiceExtension'][_0xfbc7('0x57')](_0x350e7b,{'transaction':_0x4bdca5});});}else{_0x47a404=0x194;_0x3a05bb=[];}});})['then'](function(){if(_0x47a404!==0x194){return db[_0xfbc7('0x22')][_0xfbc7('0x58')]({'where':{'isApp':!![],'VoiceExtensionId':_0x885ce8},'order':_0xfbc7('0x59')})[_0xfbc7('0x11')](function(_0x16d4e1){_0x3a05bb=_0x16d4e1;});}})['catch'](function(_0x47d738){_0x47a404=0x1f4;logger[_0xfbc7('0x46')](_0x47d738[_0xfbc7('0x20')]);if(_0x47d738[_0xfbc7('0x1d')]){delete _0x47d738[_0xfbc7('0x1d')];}_0x3a05bb=_0x47d738;})['finally'](function(){if(_0x3a05bb===null){_0x3304f4['sendStatus'](_0x47a404);}else{if(_0x47a404===0x1f4){_0x3304f4[_0xfbc7('0x9')](_0x47a404)[_0xfbc7('0x5a')](_0x3a05bb);}else{_0x3304f4['status'](_0x47a404)[_0xfbc7('0xa')](_0x3a05bb);}}});}; \ No newline at end of file +var _0x0dc9=['sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','destroy','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','internal','filter','ignore','map','value','includes','type','find','name','UserProfileResource','error','stack','VoiceExtension','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','show','params','create','body','startsWith','exten','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description','recordingFormat','cutdigits','mandatoryDisposition','alias','addApplications','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','isApp','bulkCreate','cast(priority\x20as\x20unsigned)','finally','send','lodash','ioredis','../../config/logger','api','../../config/environment','redis','defaults','socket.io-emitter','./voiceExtension.socket','register'];(function(_0x1e172a,_0x52102b){var _0x96338b=function(_0x307313){while(--_0x307313){_0x1e172a['push'](_0x1e172a['shift']());}};_0x96338b(++_0x52102b);}(_0x0dc9,0xb0));var _0x90dc=function(_0x246e1a,_0x30ee98){_0x246e1a=_0x246e1a-0x0;var _0x19a13c=_0x0dc9[_0x246e1a];return _0x19a13c;};'use strict';var _=require(_0x90dc('0x0'));var Redis=require(_0x90dc('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0x90dc('0x2'))(_0x90dc('0x3'));var config=require(_0x90dc('0x4'));var db=require('../../mysqldb')['db'];config[_0x90dc('0x5')]=_[_0x90dc('0x6')](config[_0x90dc('0x5')],{'host':'localhost','port':0x18eb});var socket=require(_0x90dc('0x7'))(new Redis(config[_0x90dc('0x5')]));require(_0x90dc('0x8'))[_0x90dc('0x9')](socket);function respondWithStatusCode(_0x8a45de,_0x1189ff){_0x1189ff=_0x1189ff||0xcc;return function(_0x461998){if(_0x461998){return _0x8a45de[_0x90dc('0xa')](_0x1189ff);}return _0x8a45de[_0x90dc('0xb')](_0x1189ff)[_0x90dc('0xc')]();};}function respondWithResult(_0x43fade,_0x4a7b8d){_0x4a7b8d=_0x4a7b8d||0xc8;return function(_0x1d2f5a){if(_0x1d2f5a){return _0x43fade['status'](_0x4a7b8d)[_0x90dc('0xd')](_0x1d2f5a);}};}function respondWithFilteredResult(_0x43b07e,_0x1e5b99){return function(_0x551044){if(_0x551044){var _0x2a6add=typeof _0x1e5b99['offset']===_0x90dc('0xe')&&typeof _0x1e5b99[_0x90dc('0xf')]===_0x90dc('0xe');var _0x5ace15=_0x551044[_0x90dc('0x10')];var _0x2042cb=_0x2a6add?0x0:_0x1e5b99['offset'];var _0x4d0d65=_0x2a6add?_0x551044[_0x90dc('0x10')]:_0x1e5b99[_0x90dc('0x11')]+_0x1e5b99[_0x90dc('0xf')];var _0x43bf8d;if(_0x4d0d65>=_0x5ace15){_0x4d0d65=_0x5ace15;_0x43bf8d=0xc8;}else{_0x43bf8d=0xce;}_0x43b07e['status'](_0x43bf8d);return _0x43b07e['set'](_0x90dc('0x12'),_0x2042cb+'-'+_0x4d0d65+'/'+_0x5ace15)['json'](_0x551044);}return null;};}function removeEntity(_0x1aeaf9){return function(_0xa87a99){if(_0xa87a99){return _0xa87a99[_0x90dc('0x13')]()['then'](function(){var _0x2608e2=_0xa87a99[_0x90dc('0x14')]({'plain':!![]});var _0x360255=[{'name':_0x90dc('0x15'),'value':_0x90dc('0x16'),'ignore':![]},{'name':_0x90dc('0x17'),'value':_0x90dc('0x18'),'ignore':![]},{'name':_0x90dc('0x19'),'value':_0x90dc('0x1a'),'ignore':![]}];var _0x4e5110=_(_0x360255)[_0x90dc('0x1b')](_0x90dc('0x1c'))[_0x90dc('0x1d')](_0x90dc('0x1e'))['value']();if(_[_0x90dc('0x1f')](_0x4e5110,_0x2608e2[_0x90dc('0x20')])){return;}var _0x558106=_[_0x90dc('0x21')](_0x360255,[_0x90dc('0x1e'),_0x2608e2[_0x90dc('0x20')]])[_0x90dc('0x22')];return db[_0x90dc('0x23')][_0x90dc('0x13')]({'where':{'type':_0x558106,'resourceId':_0x2608e2['id']}})['then'](function(){return _0xa87a99;});})['then'](function(){_0x1aeaf9[_0x90dc('0xb')](0xcc)[_0x90dc('0xc')]();});}};}function handleEntityNotFound(_0x527847){return function(_0x5aa0bf){if(!_0x5aa0bf){_0x527847[_0x90dc('0xa')](0x194);}return _0x5aa0bf;};}function handleError(_0x3646ac,_0x23aa9b){_0x23aa9b=_0x23aa9b||0x1f4;return function(_0x5d2deb){logger[_0x90dc('0x24')](_0x5d2deb[_0x90dc('0x25')]);if(_0x5d2deb['name']){delete _0x5d2deb[_0x90dc('0x22')];}_0x3646ac['status'](_0x23aa9b)['send'](_0x5d2deb);};}exports['index']=function(_0x53fa20,_0x5a638e){var _0x996c43={},_0x1cf4ed={},_0x2c488a={'count':0x0,'rows':[]};var _0x617214=_[_0x90dc('0x1d')](db[_0x90dc('0x26')][_0x90dc('0x27')],function(_0x2c05e0){return{'name':_0x2c05e0[_0x90dc('0x28')],'type':_0x2c05e0['type'][_0x90dc('0x29')]};});_0x1cf4ed[_0x90dc('0x2a')]=_[_0x90dc('0x1d')](_0x617214,_0x90dc('0x22'));_0x1cf4ed[_0x90dc('0x2b')]=_[_0x90dc('0x2c')](_0x53fa20['query']);_0x1cf4ed['filters']=_[_0x90dc('0x2d')](_0x1cf4ed[_0x90dc('0x2a')],_0x1cf4ed['query']);_0x996c43[_0x90dc('0x2e')]=_['intersection'](_0x1cf4ed[_0x90dc('0x2a')],qs[_0x90dc('0x2f')](_0x53fa20[_0x90dc('0x2b')][_0x90dc('0x2f')]));_0x996c43[_0x90dc('0x2e')]=_0x996c43[_0x90dc('0x2e')][_0x90dc('0x30')]?_0x996c43[_0x90dc('0x2e')]:_0x1cf4ed[_0x90dc('0x2a')];if(!_0x53fa20[_0x90dc('0x2b')][_0x90dc('0x31')](_0x90dc('0x32'))){_0x996c43[_0x90dc('0xf')]=qs[_0x90dc('0xf')](_0x53fa20['query'][_0x90dc('0xf')]);_0x996c43[_0x90dc('0x11')]=qs[_0x90dc('0x11')](_0x53fa20[_0x90dc('0x2b')][_0x90dc('0x11')]);}_0x996c43['order']=qs[_0x90dc('0x33')](_0x53fa20['query']['sort']);_0x996c43[_0x90dc('0x34')]=qs[_0x90dc('0x35')](_[_0x90dc('0x36')](_0x53fa20['query'],_0x1cf4ed[_0x90dc('0x35')]),_0x617214);if(_0x53fa20[_0x90dc('0x2b')][_0x90dc('0x1b')]){_0x996c43[_0x90dc('0x34')]=_[_0x90dc('0x37')](_0x996c43['where'],{'$or':_[_0x90dc('0x1d')](_0x617214,function(_0x4fe526){if(_0x4fe526[_0x90dc('0x20')]!==_0x90dc('0x38')){var _0x3e71b6={};_0x3e71b6[_0x4fe526['name']]={'$like':'%'+_0x53fa20[_0x90dc('0x2b')]['filter']+'%'};return _0x3e71b6;}})});}_0x996c43=_[_0x90dc('0x37')]({},_0x996c43,_0x53fa20[_0x90dc('0x39')]);var _0x52966f={'where':_0x996c43[_0x90dc('0x34')]};return db['VoiceExtension'][_0x90dc('0x10')](_0x52966f)[_0x90dc('0x3a')](function(_0x4ea001){_0x2c488a[_0x90dc('0x10')]=_0x4ea001;if(_0x53fa20[_0x90dc('0x2b')][_0x90dc('0x3b')]){_0x996c43[_0x90dc('0x3c')]=[{'all':!![]}];}return db[_0x90dc('0x26')][_0x90dc('0x3d')](_0x996c43);})[_0x90dc('0x3a')](function(_0x15eec2){_0x2c488a[_0x90dc('0x3e')]=_0x15eec2;return _0x2c488a;})['then'](respondWithFilteredResult(_0x5a638e,_0x996c43))[_0x90dc('0x3f')](handleError(_0x5a638e,null));};exports[_0x90dc('0x40')]=function(_0x1f8f5f,_0x10e468){var _0x59ff84={'raw':![],'where':{'id':_0x1f8f5f[_0x90dc('0x41')]['id']}},_0x5252cd={};_0x5252cd[_0x90dc('0x2a')]=_[_0x90dc('0x2c')](db[_0x90dc('0x26')]['rawAttributes']);_0x5252cd[_0x90dc('0x2b')]=_['keys'](_0x1f8f5f['query']);_0x5252cd[_0x90dc('0x35')]=_[_0x90dc('0x2d')](_0x5252cd[_0x90dc('0x2a')],_0x5252cd[_0x90dc('0x2b')]);_0x59ff84['attributes']=_[_0x90dc('0x2d')](_0x5252cd[_0x90dc('0x2a')],qs[_0x90dc('0x2f')](_0x1f8f5f['query'][_0x90dc('0x2f')]));_0x59ff84[_0x90dc('0x2e')]=_0x59ff84[_0x90dc('0x2e')][_0x90dc('0x30')]?_0x59ff84[_0x90dc('0x2e')]:_0x5252cd[_0x90dc('0x2a')];if(_0x1f8f5f[_0x90dc('0x2b')][_0x90dc('0x3b')]){_0x59ff84['include']=[{'all':!![]}];}_0x59ff84=_[_0x90dc('0x37')]({},_0x59ff84,_0x1f8f5f['options']);return db[_0x90dc('0x26')]['find'](_0x59ff84)['then'](handleEntityNotFound(_0x10e468,null))[_0x90dc('0x3a')](respondWithResult(_0x10e468,null))[_0x90dc('0x3f')](handleError(_0x10e468,null));};exports['destroy']=function(_0x5e9704,_0x4ff4b7){return db[_0x90dc('0x26')][_0x90dc('0x21')]({'where':{'id':_0x5e9704[_0x90dc('0x41')]['id']}})[_0x90dc('0x3a')](handleEntityNotFound(_0x4ff4b7,null))['then'](removeEntity(_0x4ff4b7,null))['catch'](handleError(_0x4ff4b7,null));};exports[_0x90dc('0x42')]=function(_0xd1bf2f,_0xb06b78){if(_0xd1bf2f[_0x90dc('0x43')][_0x90dc('0x20')]===_0x90dc('0x18')&&!_[_0x90dc('0x44')](_0xd1bf2f[_0x90dc('0x43')][_0x90dc('0x45')],'_')){_0xd1bf2f[_0x90dc('0x43')][_0x90dc('0x45')]='_'['concat'](_0xd1bf2f['body'][_0x90dc('0x45')]);}return db[_0x90dc('0x26')][_0x90dc('0x42')](_0xd1bf2f[_0x90dc('0x43')],{'raw':![]})[_0x90dc('0x3a')](function(_0x249d81){var _0xdb7ab1=_0xd1bf2f[_0x90dc('0x46')][_0x90dc('0x14')]({'plain':!![]});if(!_0xdb7ab1)throw new Error(_0x90dc('0x47'));if(_0xdb7ab1[_0x90dc('0x48')]===_0x90dc('0x46')){var _0x54c7b5=_0x249d81['get']({'plain':!![]});var _0x111b70=[{'name':'InboundRoutes','value':_0x90dc('0x16')},{'name':_0x90dc('0x17'),'value':'outbound'},{'name':_0x90dc('0x19'),'value':_0x90dc('0x1a')}];var _0x2c4a31=_['find'](_0x111b70,[_0x90dc('0x1e'),_0x54c7b5[_0x90dc('0x20')]])[_0x90dc('0x22')];return db['UserProfileSection'][_0x90dc('0x21')]({'where':{'name':_0x2c4a31,'userProfileId':_0xdb7ab1['userProfileId']},'raw':!![]})['then'](function(_0x5e9041){if(_0x5e9041&&_0x5e9041['autoAssociation']===0x0){return db[_0x90dc('0x23')][_0x90dc('0x42')]({'name':_0x54c7b5[_0x90dc('0x22')],'resourceId':_0x54c7b5['id'],'type':_0x5e9041[_0x90dc('0x22')],'sectionId':_0x5e9041['id']},{})[_0x90dc('0x3a')](function(){return _0x249d81;});}else{return _0x249d81;}})['catch'](function(_0x25c115){logger[_0x90dc('0x24')](_0x90dc('0x49'),_0x25c115);throw _0x25c115;});}return _0x249d81;})[_0x90dc('0x3a')](respondWithResult(_0xb06b78,0xc9))[_0x90dc('0x3f')](handleError(_0xb06b78,null));};exports['update']=function(_0x4ea11e,_0x4a1683){if(_0x4ea11e['body']['id']){delete _0x4ea11e[_0x90dc('0x43')]['id'];}return db[_0x90dc('0x26')][_0x90dc('0x21')]({'where':{'id':_0x4ea11e[_0x90dc('0x41')]['id']}})[_0x90dc('0x3a')](handleEntityNotFound(_0x4a1683,null))[_0x90dc('0x3a')](function(_0x53a1f8){if(_0x53a1f8){return db[_0x90dc('0x26')][_0x90dc('0x4a')](_[_0x90dc('0x36')](_0x4ea11e[_0x90dc('0x43')],[_0x90dc('0x45'),_0x90dc('0x4b'),_0x90dc('0x4c'),_0x90dc('0x4d'),_0x90dc('0x4e'),_0x90dc('0x4f'),_0x90dc('0x50')]),{'where':{'context':_0x53a1f8[_0x90dc('0x4b')],'exten':_0x53a1f8[_0x90dc('0x45')]},'individualHooks':!![]})[_0x90dc('0x3a')](function(_0x2dc9a6){return _0x2dc9a6;});}return null;})['then'](respondWithStatusCode(_0x4a1683,null))[_0x90dc('0x3f')](handleError(_0x4a1683,null));};exports[_0x90dc('0x51')]=function(_0x183e70,_0x3f4da1){var _0x382bf8=_0x183e70[_0x90dc('0x41')]['id'];var _0x336624=_0x183e70[_0x90dc('0x43')];var _0x1960b5=0xc8;var _0x1df2cf=null;return db['sequelize'][_0x90dc('0x52')]({'isolationLevel':db['sequelize'][_0x90dc('0x53')][_0x90dc('0x54')][_0x90dc('0x55')]},function(_0x2e87b1){return db[_0x90dc('0x26')][_0x90dc('0x56')]({'where':{'id':_0x382bf8},'transaction':_0x2e87b1})[_0x90dc('0x3a')](function(_0x53e58f){if(_0x53e58f){return db[_0x90dc('0x26')][_0x90dc('0x13')]({'where':{'VoiceExtensionId':_0x382bf8},'transaction':_0x2e87b1})[_0x90dc('0x3a')](function(){var _0x3c6af8=_[_0x90dc('0x1d')](_0x336624,function(_0x177d3b){_0x177d3b[_0x90dc('0x57')]=_0x382bf8;_0x177d3b[_0x90dc('0x58')]=!![];return _0x177d3b;});return _0x53e58f['createRouting'](_0x3c6af8);})[_0x90dc('0x3a')](function(_0x36247b){return db['VoiceExtension'][_0x90dc('0x59')](_0x36247b,{'transaction':_0x2e87b1});});}else{_0x1960b5=0x194;_0x1df2cf=[];}});})['then'](function(){if(_0x1960b5!==0x194){return db['VoiceExtension']['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x382bf8},'order':_0x90dc('0x5a')})['then'](function(_0x4a24ba){_0x1df2cf=_0x4a24ba;});}})[_0x90dc('0x3f')](function(_0x21e3aa){_0x1960b5=0x1f4;logger[_0x90dc('0x24')](_0x21e3aa[_0x90dc('0x25')]);if(_0x21e3aa[_0x90dc('0x22')]){delete _0x21e3aa[_0x90dc('0x22')];}_0x1df2cf=_0x21e3aa;})[_0x90dc('0x5b')](function(){if(_0x1df2cf===null){_0x3f4da1[_0x90dc('0xa')](_0x1960b5);}else{if(_0x1960b5===0x1f4){_0x3f4da1[_0x90dc('0xb')](_0x1960b5)[_0x90dc('0x5c')](_0x1df2cf);}else{_0x3f4da1[_0x90dc('0xb')](_0x1960b5)[_0x90dc('0xd')](_0x1df2cf);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index b4c1590..462846d 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 _0xb630=['VoiceExtension','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','../../mysqldb'];(function(_0x97f4a3,_0x583e0f){var _0x3c8ec7=function(_0x4155f6){while(--_0x4155f6){_0x97f4a3['push'](_0x97f4a3['shift']());}};_0x3c8ec7(++_0x583e0f);}(_0xb630,0x1dc));var _0x0b63=function(_0x527228,_0x2bf9d1){_0x527228=_0x527228-0x0;var _0x18fc82=_0xb630[_0x527228];return _0x18fc82;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0x0b63('0x0'))['db'][_0x0b63('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x0b63('0x2')](0x0);var events={'afterCreate':_0x0b63('0x3'),'afterUpdate':_0x0b63('0x4'),'afterDestroy':_0x0b63('0x5')};function emitEvent(_0x5ad05e){return function(_0x520d73,_0x598a90,_0x536911){VoiceExtensionEvents[_0x0b63('0x6')](_0x5ad05e+':'+_0x520d73['id'],_0x520d73);VoiceExtensionEvents['emit'](_0x5ad05e,_0x520d73);_0x536911(null);};}for(var e in events){if(events[_0x0b63('0x7')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0x0b63('0x8')]=VoiceExtensionEvents; \ No newline at end of file +var _0x1692=['save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x4e99fd,_0x3a2f2c){var _0x46b44e=function(_0x2ecebe){while(--_0x2ecebe){_0x4e99fd['push'](_0x4e99fd['shift']());}};_0x46b44e(++_0x3a2f2c);}(_0x1692,0x1b6));var _0x2169=function(_0x506088,_0x292336){_0x506088=_0x506088-0x0;var _0x36d3e5=_0x1692[_0x506088];return _0x36d3e5;};'use strict';var EventEmitter=require(_0x2169('0x0'));var VoiceExtension=require(_0x2169('0x1'))['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x2169('0x2')](0x0);var events={'afterCreate':_0x2169('0x3'),'afterUpdate':_0x2169('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2928){return function(_0x4b35bb,_0x4cf5c5,_0x13bedf){VoiceExtensionEvents['emit'](_0x2928+':'+_0x4b35bb['id'],_0x4b35bb);VoiceExtensionEvents[_0x2169('0x5')](_0x2928,_0x4b35bb);_0x13bedf(null);};}for(var e in events){if(events[_0x2169('0x6')](e)){var event=events[e];VoiceExtension[_0x2169('0x7')](e,emitEvent(event));}}module[_0x2169('0x8')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index b2635f9..da961a2 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 _0x25f0=['isEmpty','Interval','findAll','interval','IntervalId','then','length','intervals','toLowerCase','tag','CDR(tag)=','Set(CALLERID(all)=','callerID','NoOp(No\x20number\x20available)','answer','queue','includes','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice',',${EXTEN},','outboundDial','appdata','priority','last','concat','catch','define','voice_extensions','Hangup','lodash','./voiceExtension.attributes','models','Set','type','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','inbound','CDR(routeid)=','context','exten','push','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','XCALLY-MOTION-PROGRESS=0','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','trunk','timeout','split','name','param','phone','prefix','SIP','join','options','indexOf','U(xcally-mixmonitor-context)'];(function(_0x1cb267,_0xab55ce){var _0x8b30ff=function(_0x119b6e){while(--_0x119b6e){_0x1cb267['push'](_0x1cb267['shift']());}};_0x8b30ff(++_0xab55ce);}(_0x25f0,0x10c));var _0x025f=function(_0x4908ac,_0x1b66f8){_0x4908ac=_0x4908ac-0x0;var _0x2e2734=_0x25f0[_0x4908ac];return _0x2e2734;};'use strict';var _=require(_0x025f('0x0'));var attributes=require(_0x025f('0x1'));module['exports']=function(_0x565fb3){var _0x5b16ac=_0x565fb3[_0x025f('0x2')];function _0x4c126d(_0x1d4dc7){var _0x571c09=0x2;var _0x3962d2=[{'type':_0x1d4dc7['type'],'app':_0x025f('0x3'),'appdata':'CDR(type)='+_0x1d4dc7[_0x025f('0x4')],'context':_0x1d4dc7['context'],'exten':_0x1d4dc7['exten'],'priority':_0x571c09++,'VoiceExtensionId':_0x1d4dc7['id']},{'type':_0x1d4dc7[_0x025f('0x4')],'app':_0x1d4dc7[_0x025f('0x5')]?_0x025f('0x3'):_0x025f('0x6'),'appdata':_0x1d4dc7['alias']?_0x025f('0x7')+_0x1d4dc7[_0x025f('0x5')]:_0x025f('0x8'),'context':_0x1d4dc7['context'],'exten':_0x1d4dc7['exten'],'priority':_0x571c09++,'VoiceExtensionId':_0x1d4dc7['id']}];if(_0x1d4dc7[_0x025f('0x4')]==='inbound'){_0x3962d2['push']({'type':_0x025f('0x9'),'app':_0x025f('0x3'),'appdata':_0x025f('0xa')+_0x1d4dc7['id'],'context':_0x1d4dc7[_0x025f('0xb')],'exten':_0x1d4dc7[_0x025f('0xc')],'priority':_0x571c09++,'VoiceExtensionId':_0x1d4dc7['id']});}_0x3962d2[_0x025f('0xd')]({'type':_0x1d4dc7[_0x025f('0x4')],'app':_0x025f('0x3'),'appdata':_0x025f('0xe'),'context':_0x1d4dc7[_0x025f('0xb')],'exten':_0x1d4dc7['exten'],'priority':_0x571c09++,'VoiceExtensionId':_0x1d4dc7['id']},{'type':_0x1d4dc7[_0x025f('0x4')],'app':_0x025f('0x3'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x1d4dc7['context'],'exten':_0x1d4dc7['exten'],'priority':_0x571c09++,'VoiceExtensionId':_0x1d4dc7['id']},{'type':_0x1d4dc7[_0x025f('0x4')],'app':'Set','appdata':_0x025f('0xf'),'context':_0x1d4dc7['context'],'exten':_0x1d4dc7[_0x025f('0xc')],'priority':_0x571c09++,'VoiceExtensionId':_0x1d4dc7['id']});return _0x3962d2;}function _0x4c8482(_0x2df88c){var _0x59a09d=0x2;var _0x337fc1=[{'type':_0x025f('0x10'),'app':_0x025f('0x3'),'appdata':_0x025f('0x11'),'context':_0x2df88c[_0x025f('0xb')],'exten':_0x2df88c['exten'],'priority':_0x59a09d++,'VoiceExtensionId':_0x2df88c['id']},{'type':_0x025f('0x10'),'app':_0x2df88c[_0x025f('0x5')]?_0x025f('0x3'):_0x025f('0x6'),'appdata':_0x2df88c[_0x025f('0x5')]?_0x025f('0x7')+_0x2df88c[_0x025f('0x5')]:_0x025f('0x8'),'context':_0x2df88c[_0x025f('0xb')],'exten':_0x2df88c[_0x025f('0xc')],'priority':_0x59a09d++,'VoiceExtensionId':_0x2df88c['id']},{'type':'outbound','app':_0x025f('0x3'),'appdata':_0x025f('0x12')+(_0x2df88c[_0x025f('0x13')]?_0x025f('0x14')+_0x2df88c[_0x025f('0x13')]+'}':_0x025f('0x15')),'context':_0x2df88c[_0x025f('0xb')],'exten':_0x2df88c[_0x025f('0xc')],'priority':_0x59a09d++,'VoiceExtensionId':_0x2df88c['id']},{'type':'outbound','app':_0x025f('0x3'),'appdata':'CDR(routeid)='+_0x2df88c['id'],'context':_0x2df88c[_0x025f('0xb')],'exten':_0x2df88c[_0x025f('0xc')],'priority':_0x59a09d++,'VoiceExtensionId':_0x2df88c['id']},{'type':'outbound','app':_0x025f('0x16'),'appdata':_0x025f('0x17')+(_0x59a09d+0x2)+_0x025f('0x18')+(_0x59a09d+0x1)+')','context':_0x2df88c[_0x025f('0xb')],'exten':_0x2df88c[_0x025f('0xc')],'priority':_0x59a09d++,'VoiceExtensionId':_0x2df88c['id']},{'type':_0x025f('0x10'),'app':_0x025f('0x3'),'appdata':_0x2df88c['cutdigits']?_0x025f('0x19')+_0x2df88c[_0x025f('0x13')]+'}':_0x025f('0x1a'),'context':_0x2df88c['context'],'exten':_0x2df88c[_0x025f('0xc')],'priority':_0x59a09d++,'VoiceExtensionId':_0x2df88c['id']},{'type':'outbound','app':_0x025f('0x3'),'appdata':_0x025f('0xe'),'context':_0x2df88c['context'],'exten':_0x2df88c['exten'],'priority':_0x59a09d++,'VoiceExtensionId':_0x2df88c['id']},{'type':_0x025f('0x10'),'app':_0x025f('0x3'),'appdata':_0x025f('0x1b'),'context':_0x2df88c[_0x025f('0xb')],'exten':_0x2df88c['exten'],'priority':_0x59a09d++,'VoiceExtensionId':_0x2df88c['id']},{'type':'outbound','app':_0x025f('0x3'),'appdata':_0x025f('0xf'),'context':_0x2df88c['context'],'exten':_0x2df88c[_0x025f('0xc')],'priority':_0x59a09d++,'VoiceExtensionId':_0x2df88c['id']},{'type':_0x025f('0x10'),'app':_0x025f('0x3'),'appdata':'outboundrouteid='+_0x2df88c['id'],'context':_0x2df88c[_0x025f('0xb')],'exten':_0x2df88c[_0x025f('0xc')],'priority':_0x59a09d++,'VoiceExtensionId':_0x2df88c['id']}];if(_0x2df88c[_0x025f('0x1c')](_0x025f('0x1d'))&&_0x2df88c[_0x025f('0x1d')]!==_0x025f('0x1e')){_0x337fc1['push']({'type':'outbound','app':_0x025f('0x3'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x2df88c[_0x025f('0xb')],'exten':_0x2df88c[_0x025f('0xc')],'priority':_0x59a09d++,'VoiceExtensionId':_0x2df88c['id']},{'type':_0x025f('0x10'),'app':'Set','appdata':_0x025f('0x1f')+_0x2df88c[_0x025f('0x1d')]||'wav','context':_0x2df88c[_0x025f('0xb')],'exten':_0x2df88c[_0x025f('0xc')],'priority':_0x59a09d++,'VoiceExtensionId':_0x2df88c['id']});}return _0x337fc1;}function _0x9da3dc(_0x448f14,_0x2993d3){var _0xf6c2e6=[{'name':_0x025f('0x20'),'param':0x0},{'name':_0x025f('0x21'),'param':0x1},{'name':'options','param':0x2},{'name':'url','param':0x3}];var _0x286135={};var _0x35578b=_0x2993d3[_0x025f('0x22')](',');var _0x53c553=[];for(var _0x10c9a8=0x0;_0x10c9a8<_0xf6c2e6['length'];_0x10c9a8++){switch(_0xf6c2e6[_0x10c9a8][_0x025f('0x23')]){case _0x025f('0x20'):_0x286135[_0x025f('0x20')]=_0x35578b[_0xf6c2e6[_0x10c9a8][_0x025f('0x24')]][_0x025f('0x22')]('/')[0x1];_0x286135[_0x025f('0x25')]=_0x35578b[_0xf6c2e6[_0x10c9a8][_0x025f('0x24')]]['split']('/')[0x2];_0x286135[_0x025f('0x26')]=_0x286135[_0x025f('0x25')]?_0x286135[_0x025f('0x25')][_0x025f('0x22')]('$')[0x0]:undefined;_0x286135['phone']=_0x448f14[_0x025f('0x13')]?(_0x286135[_0x025f('0x26')]||'')+'${EXTEN:'+_0x448f14[_0x025f('0x13')]+'}':(_0x286135[_0x025f('0x26')]||'')+_0x025f('0x15');_0x53c553[_0xf6c2e6[_0x10c9a8]['param']]=[_0x025f('0x27'),_0x286135[_0x025f('0x20')],_0x286135['phone']][_0x025f('0x28')]('/');break;case'options':_0x286135[_0x025f('0x29')]=_0x35578b[_0xf6c2e6[_0x10c9a8][_0x025f('0x24')]];if(_0x448f14[_0x025f('0x1d')]!==_0x025f('0x1e')){if(_0x286135[_0x025f('0x29')][_0x025f('0x2a')](_0x025f('0x2b'))<0x0){_0x286135['options']+=_0x025f('0x2b');}}else{_0x286135[_0x025f('0x29')]=_0x286135[_0x025f('0x29')]['replace']('U(xcally-mixmonitor-context)','');}_0x53c553[_0xf6c2e6[_0x10c9a8][_0x025f('0x24')]]=_0x286135[_0x025f('0x29')];break;default:_0x53c553[_0xf6c2e6[_0x10c9a8][_0x025f('0x24')]]=_0x35578b[_0xf6c2e6[_0x10c9a8][_0x025f('0x24')]];}}return _0x53c553[_0x025f('0x28')](',');}function _0x3a645d(_0x3a5163,_0x2317a4,_0x1ae6dd){return new Promise(function(_0x1cfaf6,_0x577d21){var _0xeb1d09=[];if(_[_0x025f('0x2c')](_0x2317a4))return _0x1cfaf6(_0xeb1d09);_0x5b16ac[_0x025f('0x2d')][_0x025f('0x2e')]({'attributes':['id',_0x025f('0x2f'),_0x025f('0x30')],'raw':!![]})[_0x025f('0x31')](function(_0xfa9bf8){for(var _0x3a618e=0x0,_0x3e78f4=0x0;_0x3a618e<_0x2317a4[_0x025f('0x32')];_0x3a618e++,_0x3e78f4=0x0){var _0x3d90b2=_0x2317a4[_0x3a618e];var _0x2b9c97=[];var _0x137ddb=[];delete _0x3d90b2['id'];if(_0x3d90b2[_0x025f('0x2f')]!=='*,*,*,*'){_0x3d90b2[_0x025f('0x33')]=[_0x3d90b2[_0x025f('0x2f')]];}else{_0x3d90b2[_0x025f('0x33')]=_0x3d90b2['IntervalId']?_['map'](_['filter'](_0xfa9bf8,{'IntervalId':_0x3d90b2[_0x025f('0x30')]}),_0x025f('0x2f')):[];}_0x3d90b2[_0x025f('0xb')]=_0x3a5163['context'];_0x3d90b2[_0x025f('0xc')]=_0x3a5163['exten'];if(_0x3d90b2[_0x025f('0x4')])_0x3d90b2[_0x025f('0x4')]=_0x3d90b2[_0x025f('0x4')][_0x025f('0x34')]();if(_0x3a5163[_0x025f('0x4')]===_0x025f('0x10')){if(_0x3d90b2[_0x025f('0x1c')](_0x025f('0x35'))&&_0x3d90b2[_0x025f('0x35')]&&_0x3d90b2[_0x025f('0x35')]!=='--'){_0x2b9c97[_0x025f('0xd')]({'type':_0x3d90b2[_0x025f('0x4')][_0x025f('0x34')](),'app':_0x025f('0x3'),'appdata':_0x025f('0x36')+_0x3d90b2['tag'],'context':_0x3a5163[_0x025f('0xb')],'exten':_0x3a5163[_0x025f('0xc')],'priority':_0x3d90b2['intervals'][_0x025f('0x32')]+_0x1ae6dd+_0x3e78f4++,'VoiceExtensionId':_0x3a5163['id']});}_0x2b9c97['push']({'type':_0x3d90b2[_0x025f('0x4')]['toLowerCase'](),'app':_0x025f('0x16'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x3d90b2['callerID']?_0x025f('0x37')+_0x3d90b2[_0x025f('0x38')]+')':_0x025f('0x39')),'context':_0x3a5163[_0x025f('0xb')],'exten':_0x3a5163[_0x025f('0xc')],'priority':_0x3d90b2[_0x025f('0x33')][_0x025f('0x32')]+_0x1ae6dd+_0x3e78f4++,'VoiceExtensionId':_0x3a5163['id']});}else{if(_0x3d90b2[_0x025f('0x1c')](_0x025f('0x3a'))){if([_0x025f('0x3b'),'playback'][_0x025f('0x3c')](_0x3d90b2[_0x025f('0x3d')][_0x025f('0x34')]())&&_0x3d90b2[_0x025f('0x3e')]!==_0x025f('0x3f')){if(_0x3d90b2[_0x025f('0x3a')]){_0x2b9c97[_0x025f('0xd')]({'type':_0x3d90b2[_0x025f('0x4')][_0x025f('0x34')](),'app':_0x025f('0x16'),'appdata':_0x025f('0x40'),'context':_0x3a5163[_0x025f('0xb')],'exten':_0x3a5163[_0x025f('0xc')],'priority':_0x3d90b2[_0x025f('0x33')]['length']+_0x1ae6dd+_0x3e78f4++,'VoiceExtensionId':_0x3a5163['id']});_0x2b9c97['push']({'type':_0x3d90b2[_0x025f('0x4')][_0x025f('0x34')](),'app':_0x025f('0x3'),'appdata':_0x025f('0x41'),'context':_0x3a5163[_0x025f('0xb')],'exten':_0x3a5163[_0x025f('0xc')],'priority':_0x3d90b2[_0x025f('0x33')][_0x025f('0x32')]+_0x1ae6dd+_0x3e78f4++,'VoiceExtensionId':_0x3a5163['id']});}else{_0x2b9c97[_0x025f('0xd')]({'type':_0x3d90b2[_0x025f('0x4')][_0x025f('0x34')](),'app':'ExecIf','appdata':_0x025f('0x42'),'context':_0x3a5163['context'],'exten':_0x3a5163[_0x025f('0xc')],'priority':_0x3d90b2[_0x025f('0x33')]['length']+_0x1ae6dd+_0x3e78f4++,'VoiceExtensionId':_0x3a5163['id']});_0x2b9c97[_0x025f('0xd')]({'type':_0x3d90b2[_0x025f('0x4')][_0x025f('0x34')](),'app':_0x025f('0x3'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x3a5163[_0x025f('0xb')],'exten':_0x3a5163[_0x025f('0xc')],'priority':_0x3d90b2[_0x025f('0x33')][_0x025f('0x32')]+_0x1ae6dd+_0x3e78f4++,'VoiceExtensionId':_0x3a5163['id']});}}}}for(var _0x3c1c3d=0x0;_0x3c1c3d<_0x3d90b2[_0x025f('0x33')][_0x025f('0x32')];_0x3c1c3d++){var _0x14dcfe=_0x1ae6dd+_0x3d90b2[_0x025f('0x33')][_0x025f('0x32')];var _0x4e55af=_0x3c1c3d===_0x3d90b2['intervals']['length']-0x1?_0x1ae6dd+_0x2b9c97['length']+_0x137ddb['length']+0x2:_0x1ae6dd+_0x3c1c3d+0x1;_0x2b9c97[_0x025f('0x43')](_0x3c1c3d,0x0,{'type':_0x3a5163[_0x025f('0x4')],'app':'GotoIfTime','appdata':_0x3d90b2[_0x025f('0x33')][_0x3c1c3d]+'?'+_0x3a5163[_0x025f('0xb')]+_0x025f('0x44')+_0x14dcfe+':'+_0x3a5163[_0x025f('0xb')]+_0x025f('0x44')+_0x4e55af,'exten':_0x3a5163[_0x025f('0xc')],'context':_0x3a5163[_0x025f('0xb')],'priority':_0x1ae6dd+_0x3c1c3d,'VoiceExtensionId':_0x3a5163['id']});}if(_0x3d90b2['appType']===_0x025f('0x45'))_0x3d90b2[_0x025f('0x46')]=_0x9da3dc(_0x3a5163,_0x3d90b2[_0x025f('0x46')]);_0x3d90b2[_0x025f('0x47')]=_0x2b9c97[_0x025f('0x32')]?_[_0x025f('0x48')](_0x2b9c97)[_0x025f('0x47')]+0x1:_0x1ae6dd;_0xeb1d09=_[_0x025f('0x49')](_0xeb1d09,_0x2b9c97,[_0x3d90b2],_0x137ddb);_0x1ae6dd=_[_0x025f('0x48')](_0xeb1d09)[_0x025f('0x47')]+0x1;}return _0x1cfaf6(_0xeb1d09);})[_0x025f('0x4a')](function(_0x14efd5){_0x577d21(_0x14efd5);});});}return _0x565fb3[_0x025f('0x4b')]('VoiceExtension',attributes,{'tableName':_0x025f('0x4c'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x56a58a){var _0x5afe72=this['get']({'plain':!![]});var _0x535efb=_0x5afe72[_0x025f('0x4')]===_0x025f('0x10')?_0x4c8482(_0x5afe72):_0x4c126d(_0x5afe72);return _0x3a645d(_0x5afe72,_0x56a58a,_[_0x025f('0x48')](_0x535efb)[_0x025f('0x47')]+0x1)[_0x025f('0x31')](function(_0x77a576){var _0x59495f=_['concat'](_0x535efb,_0x77a576);_0x59495f[_0x025f('0xd')]({'type':_0x5afe72[_0x025f('0x4')],'app':_0x025f('0x4d'),'exten':_0x5afe72['exten'],'context':_0x5afe72[_0x025f('0xb')],'priority':_['last'](_0x59495f)['priority']+0x1,'VoiceExtensionId':_0x5afe72['id']});return _0x59495f;});}}});}; \ No newline at end of file +var _0x83b1=['_XCALLY_MIXMONITOR_FORMAT=','timeout','options','url','length','name','trunk','param','split','phone','prefix','${EXTEN:','SIP','join','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','findAll','interval','IntervalId','then','*,*,*,*','intervals','map','toLowerCase','tag','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','NoOp(No\x20number\x20available)','answer','playback','includes','app','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','appType','agi','XMCS-UNIQUEID=${CHANNEL(LINKEDID)}','priority','last','concat','catch','define','VoiceExtension','get','Hangup','lodash','./voiceExtension.attributes','exports','models','Set','CDR(type)=','type','alias','CDR(routeAlias)=','No\x20alias\x20set','context','exten','inbound','CDR(routeid)=','push','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','CDR(type)=outbound','outbound','CDR(destination)=','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}'];(function(_0x22cc16,_0x1f4fa2){var _0x399b70=function(_0x34d464){while(--_0x34d464){_0x22cc16['push'](_0x22cc16['shift']());}};_0x399b70(++_0x1f4fa2);}(_0x83b1,0x128));var _0x183b=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0x83b1[_0x4b7b62];return _0x2280df;};'use strict';var _=require(_0x183b('0x0'));var attributes=require(_0x183b('0x1'));module[_0x183b('0x2')]=function(_0x1b848e){var _0x17bc06=_0x1b848e[_0x183b('0x3')];function _0x3655eb(_0x309cc5){var _0x2cd7eb=0x2;var _0x2db43a=[{'type':_0x309cc5['type'],'app':_0x183b('0x4'),'appdata':_0x183b('0x5')+_0x309cc5[_0x183b('0x6')],'context':_0x309cc5['context'],'exten':_0x309cc5['exten'],'priority':_0x2cd7eb++,'VoiceExtensionId':_0x309cc5['id']},{'type':_0x309cc5['type'],'app':_0x309cc5[_0x183b('0x7')]?_0x183b('0x4'):'NoOp','appdata':_0x309cc5[_0x183b('0x7')]?_0x183b('0x8')+_0x309cc5['alias']:_0x183b('0x9'),'context':_0x309cc5[_0x183b('0xa')],'exten':_0x309cc5[_0x183b('0xb')],'priority':_0x2cd7eb++,'VoiceExtensionId':_0x309cc5['id']}];if(_0x309cc5['type']===_0x183b('0xc')){_0x2db43a['push']({'type':_0x183b('0xc'),'app':_0x183b('0x4'),'appdata':_0x183b('0xd')+_0x309cc5['id'],'context':_0x309cc5[_0x183b('0xa')],'exten':_0x309cc5[_0x183b('0xb')],'priority':_0x2cd7eb++,'VoiceExtensionId':_0x309cc5['id']});}_0x2db43a[_0x183b('0xe')]({'type':_0x309cc5[_0x183b('0x6')],'app':_0x183b('0x4'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x309cc5[_0x183b('0xa')],'exten':_0x309cc5[_0x183b('0xb')],'priority':_0x2cd7eb++,'VoiceExtensionId':_0x309cc5['id']},{'type':_0x309cc5[_0x183b('0x6')],'app':'Set','appdata':_0x183b('0xf'),'context':_0x309cc5[_0x183b('0xa')],'exten':_0x309cc5['exten'],'priority':_0x2cd7eb++,'VoiceExtensionId':_0x309cc5['id']},{'type':_0x309cc5['type'],'app':_0x183b('0x4'),'appdata':_0x183b('0x10'),'context':_0x309cc5[_0x183b('0xa')],'exten':_0x309cc5[_0x183b('0xb')],'priority':_0x2cd7eb++,'VoiceExtensionId':_0x309cc5['id']});return _0x2db43a;}function _0x26ac1f(_0x4938c9){var _0x1dc872=0x2;var _0xa1ed79=[{'type':'outbound','app':_0x183b('0x4'),'appdata':_0x183b('0x11'),'context':_0x4938c9[_0x183b('0xa')],'exten':_0x4938c9[_0x183b('0xb')],'priority':_0x1dc872++,'VoiceExtensionId':_0x4938c9['id']},{'type':_0x183b('0x12'),'app':_0x4938c9[_0x183b('0x7')]?_0x183b('0x4'):'NoOp','appdata':_0x4938c9[_0x183b('0x7')]?_0x183b('0x8')+_0x4938c9['alias']:_0x183b('0x9'),'context':_0x4938c9[_0x183b('0xa')],'exten':_0x4938c9[_0x183b('0xb')],'priority':_0x1dc872++,'VoiceExtensionId':_0x4938c9['id']},{'type':'outbound','app':_0x183b('0x4'),'appdata':_0x183b('0x13')+(_0x4938c9[_0x183b('0x14')]?'${EXTEN:'+_0x4938c9['cutdigits']+'}':_0x183b('0x15')),'context':_0x4938c9[_0x183b('0xa')],'exten':_0x4938c9[_0x183b('0xb')],'priority':_0x1dc872++,'VoiceExtensionId':_0x4938c9['id']},{'type':_0x183b('0x12'),'app':_0x183b('0x4'),'appdata':_0x183b('0xd')+_0x4938c9['id'],'context':_0x4938c9[_0x183b('0xa')],'exten':_0x4938c9[_0x183b('0xb')],'priority':_0x1dc872++,'VoiceExtensionId':_0x4938c9['id']},{'type':_0x183b('0x12'),'app':_0x183b('0x16'),'appdata':_0x183b('0x17')+(_0x1dc872+0x2)+_0x183b('0x18')+(_0x1dc872+0x1)+')','context':_0x4938c9['context'],'exten':_0x4938c9[_0x183b('0xb')],'priority':_0x1dc872++,'VoiceExtensionId':_0x4938c9['id']},{'type':_0x183b('0x12'),'app':_0x183b('0x4'),'appdata':_0x4938c9['cutdigits']?_0x183b('0x19')+_0x4938c9[_0x183b('0x14')]+'}':_0x183b('0x1a'),'context':_0x4938c9[_0x183b('0xa')],'exten':_0x4938c9[_0x183b('0xb')],'priority':_0x1dc872++,'VoiceExtensionId':_0x4938c9['id']},{'type':_0x183b('0x12'),'app':_0x183b('0x4'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x4938c9[_0x183b('0xa')],'exten':_0x4938c9[_0x183b('0xb')],'priority':_0x1dc872++,'VoiceExtensionId':_0x4938c9['id']},{'type':'outbound','app':'Set','appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x4938c9['context'],'exten':_0x4938c9[_0x183b('0xb')],'priority':_0x1dc872++,'VoiceExtensionId':_0x4938c9['id']},{'type':_0x183b('0x12'),'app':_0x183b('0x4'),'appdata':_0x183b('0x10'),'context':_0x4938c9[_0x183b('0xa')],'exten':_0x4938c9[_0x183b('0xb')],'priority':_0x1dc872++,'VoiceExtensionId':_0x4938c9['id']},{'type':_0x183b('0x12'),'app':_0x183b('0x4'),'appdata':_0x183b('0x1b')+_0x4938c9['id'],'context':_0x4938c9[_0x183b('0xa')],'exten':_0x4938c9['exten'],'priority':_0x1dc872++,'VoiceExtensionId':_0x4938c9['id']}];if(_0x4938c9[_0x183b('0x1c')]('recordingFormat')&&_0x4938c9[_0x183b('0x1d')]!==_0x183b('0x1e')){_0xa1ed79['push']({'type':'outbound','app':_0x183b('0x4'),'appdata':_0x183b('0x1f'),'context':_0x4938c9[_0x183b('0xa')],'exten':_0x4938c9[_0x183b('0xb')],'priority':_0x1dc872++,'VoiceExtensionId':_0x4938c9['id']},{'type':_0x183b('0x12'),'app':'Set','appdata':_0x183b('0x20')+_0x4938c9[_0x183b('0x1d')]||'wav','context':_0x4938c9['context'],'exten':_0x4938c9[_0x183b('0xb')],'priority':_0x1dc872++,'VoiceExtensionId':_0x4938c9['id']});}return _0xa1ed79;}function _0x5a8c88(_0x54b328,_0x35c183){var _0x21781f=[{'name':'trunk','param':0x0},{'name':_0x183b('0x21'),'param':0x1},{'name':_0x183b('0x22'),'param':0x2},{'name':_0x183b('0x23'),'param':0x3}];var _0x492131={};var _0xa897e9=_0x35c183['split'](',');var _0x510d87=[];for(var _0x1aaf0c=0x0;_0x1aaf0c<_0x21781f[_0x183b('0x24')];_0x1aaf0c++){switch(_0x21781f[_0x1aaf0c][_0x183b('0x25')]){case _0x183b('0x26'):_0x492131[_0x183b('0x26')]=_0xa897e9[_0x21781f[_0x1aaf0c][_0x183b('0x27')]][_0x183b('0x28')]('/')[0x1];_0x492131[_0x183b('0x29')]=_0xa897e9[_0x21781f[_0x1aaf0c][_0x183b('0x27')]][_0x183b('0x28')]('/')[0x2];_0x492131[_0x183b('0x2a')]=_0x492131[_0x183b('0x29')]?_0x492131[_0x183b('0x29')][_0x183b('0x28')]('$')[0x0]:undefined;_0x492131[_0x183b('0x29')]=_0x54b328[_0x183b('0x14')]?(_0x492131[_0x183b('0x2a')]||'')+_0x183b('0x2b')+_0x54b328[_0x183b('0x14')]+'}':(_0x492131[_0x183b('0x2a')]||'')+'${EXTEN}';_0x510d87[_0x21781f[_0x1aaf0c][_0x183b('0x27')]]=[_0x183b('0x2c'),_0x492131[_0x183b('0x26')],_0x492131[_0x183b('0x29')]][_0x183b('0x2d')]('/');break;case _0x183b('0x22'):_0x492131['options']=_0xa897e9[_0x21781f[_0x1aaf0c]['param']];if(_0x54b328['recordingFormat']!==_0x183b('0x1e')){if(_0x492131[_0x183b('0x22')]['indexOf'](_0x183b('0x2e'))<0x0){_0x492131[_0x183b('0x22')]+=_0x183b('0x2e');}}else{_0x492131[_0x183b('0x22')]=_0x492131[_0x183b('0x22')][_0x183b('0x2f')](_0x183b('0x2e'),'');}_0x510d87[_0x21781f[_0x1aaf0c][_0x183b('0x27')]]=_0x492131[_0x183b('0x22')];break;default:_0x510d87[_0x21781f[_0x1aaf0c][_0x183b('0x27')]]=_0xa897e9[_0x21781f[_0x1aaf0c][_0x183b('0x27')]];}}return _0x510d87[_0x183b('0x2d')](',');}function _0x267b94(_0xf0dd93,_0x3bda85,_0x213311){return new Promise(function(_0x15b94e,_0x2ec247){var _0x30e91c=[];if(_[_0x183b('0x30')](_0x3bda85))return _0x15b94e(_0x30e91c);_0x17bc06[_0x183b('0x31')][_0x183b('0x32')]({'attributes':['id',_0x183b('0x33'),_0x183b('0x34')],'raw':!![]})[_0x183b('0x35')](function(_0x3a9ff8){for(var _0x419950=0x0,_0x5d8333=0x0;_0x419950<_0x3bda85[_0x183b('0x24')];_0x419950++,_0x5d8333=0x0){var _0x2d38e8=_0x3bda85[_0x419950];var _0x34de81=[];var _0x4a927e=[];delete _0x2d38e8['id'];if(_0x2d38e8[_0x183b('0x33')]!==_0x183b('0x36')){_0x2d38e8[_0x183b('0x37')]=[_0x2d38e8[_0x183b('0x33')]];}else{_0x2d38e8[_0x183b('0x37')]=_0x2d38e8[_0x183b('0x34')]?_[_0x183b('0x38')](_['filter'](_0x3a9ff8,{'IntervalId':_0x2d38e8[_0x183b('0x34')]}),_0x183b('0x33')):[];}_0x2d38e8['context']=_0xf0dd93[_0x183b('0xa')];_0x2d38e8[_0x183b('0xb')]=_0xf0dd93[_0x183b('0xb')];if(_0x2d38e8[_0x183b('0x6')])_0x2d38e8[_0x183b('0x6')]=_0x2d38e8[_0x183b('0x6')][_0x183b('0x39')]();if(_0xf0dd93[_0x183b('0x6')]==='outbound'){if(_0x2d38e8['hasOwnProperty'](_0x183b('0x3a'))&&_0x2d38e8[_0x183b('0x3a')]&&_0x2d38e8[_0x183b('0x3a')]!=='--'){_0x34de81[_0x183b('0xe')]({'type':_0x2d38e8[_0x183b('0x6')][_0x183b('0x39')](),'app':_0x183b('0x4'),'appdata':'CDR(tag)='+_0x2d38e8[_0x183b('0x3a')],'context':_0xf0dd93[_0x183b('0xa')],'exten':_0xf0dd93[_0x183b('0xb')],'priority':_0x2d38e8[_0x183b('0x37')][_0x183b('0x24')]+_0x213311+_0x5d8333++,'VoiceExtensionId':_0xf0dd93['id']});}_0x34de81[_0x183b('0xe')]({'type':_0x2d38e8[_0x183b('0x6')][_0x183b('0x39')](),'app':_0x183b('0x16'),'appdata':_0x183b('0x3b')+(_0x2d38e8[_0x183b('0x3c')]?'Set(CALLERID(all)='+_0x2d38e8[_0x183b('0x3c')]+')':_0x183b('0x3d')),'context':_0xf0dd93[_0x183b('0xa')],'exten':_0xf0dd93[_0x183b('0xb')],'priority':_0x2d38e8[_0x183b('0x37')][_0x183b('0x24')]+_0x213311+_0x5d8333++,'VoiceExtensionId':_0xf0dd93['id']});}else{if(_0x2d38e8[_0x183b('0x1c')](_0x183b('0x3e'))){if(['queue',_0x183b('0x3f')][_0x183b('0x40')](_0x2d38e8[_0x183b('0x41')][_0x183b('0x39')]())&&_0x2d38e8['appType']!=='custom'){if(_0x2d38e8[_0x183b('0x3e')]){_0x34de81[_0x183b('0xe')]({'type':_0x2d38e8['type'][_0x183b('0x39')](),'app':_0x183b('0x16'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0xf0dd93[_0x183b('0xa')],'exten':_0xf0dd93['exten'],'priority':_0x2d38e8['intervals']['length']+_0x213311+_0x5d8333++,'VoiceExtensionId':_0xf0dd93['id']});_0x34de81[_0x183b('0xe')]({'type':_0x2d38e8[_0x183b('0x6')][_0x183b('0x39')](),'app':'Set','appdata':'XCALLY-MOTION-ANSWER=1','context':_0xf0dd93[_0x183b('0xa')],'exten':_0xf0dd93['exten'],'priority':_0x2d38e8[_0x183b('0x37')][_0x183b('0x24')]+_0x213311+_0x5d8333++,'VoiceExtensionId':_0xf0dd93['id']});}else{_0x34de81['push']({'type':_0x2d38e8[_0x183b('0x6')][_0x183b('0x39')](),'app':_0x183b('0x16'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0xf0dd93['context'],'exten':_0xf0dd93[_0x183b('0xb')],'priority':_0x2d38e8[_0x183b('0x37')][_0x183b('0x24')]+_0x213311+_0x5d8333++,'VoiceExtensionId':_0xf0dd93['id']});_0x34de81[_0x183b('0xe')]({'type':_0x2d38e8[_0x183b('0x6')]['toLowerCase'](),'app':_0x183b('0x4'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0xf0dd93[_0x183b('0xa')],'exten':_0xf0dd93[_0x183b('0xb')],'priority':_0x2d38e8[_0x183b('0x37')][_0x183b('0x24')]+_0x213311+_0x5d8333++,'VoiceExtensionId':_0xf0dd93['id']});}}}}for(var _0x3c1851=0x0;_0x3c1851<_0x2d38e8[_0x183b('0x37')][_0x183b('0x24')];_0x3c1851++){var _0x73ffd0=_0x213311+_0x2d38e8[_0x183b('0x37')]['length'];var _0xa9ead4=_0x3c1851===_0x2d38e8[_0x183b('0x37')][_0x183b('0x24')]-0x1?_0x213311+_0x34de81[_0x183b('0x24')]+_0x4a927e[_0x183b('0x24')]+0x2:_0x213311+_0x3c1851+0x1;_0x34de81[_0x183b('0x42')](_0x3c1851,0x0,{'type':_0xf0dd93[_0x183b('0x6')],'app':_0x183b('0x43'),'appdata':_0x2d38e8['intervals'][_0x3c1851]+'?'+_0xf0dd93[_0x183b('0xa')]+_0x183b('0x44')+_0x73ffd0+':'+_0xf0dd93[_0x183b('0xa')]+_0x183b('0x44')+_0xa9ead4,'exten':_0xf0dd93['exten'],'context':_0xf0dd93[_0x183b('0xa')],'priority':_0x213311+_0x3c1851,'VoiceExtensionId':_0xf0dd93['id']});}if(_0x2d38e8['appType']===_0x183b('0x45')){_0x2d38e8[_0x183b('0x46')]=_0x5a8c88(_0xf0dd93,_0x2d38e8[_0x183b('0x46')]);}if(_0x2d38e8[_0x183b('0x47')]===_0x183b('0x48')){_0x34de81['push']({'type':_0x2d38e8['type'][_0x183b('0x39')](),'app':_0x183b('0x4'),'appdata':_0x183b('0x49'),'context':_0xf0dd93[_0x183b('0xa')],'exten':_0xf0dd93[_0x183b('0xb')],'priority':_0x2d38e8['intervals'][_0x183b('0x24')]+_0x213311+_0x5d8333++,'VoiceExtensionId':_0xf0dd93['id']});}_0x2d38e8[_0x183b('0x4a')]=_0x34de81[_0x183b('0x24')]?_[_0x183b('0x4b')](_0x34de81)[_0x183b('0x4a')]+0x1:_0x213311;_0x30e91c=_[_0x183b('0x4c')](_0x30e91c,_0x34de81,[_0x2d38e8],_0x4a927e);_0x213311=_[_0x183b('0x4b')](_0x30e91c)[_0x183b('0x4a')]+0x1;}return _0x15b94e(_0x30e91c);})[_0x183b('0x4d')](function(_0x37d7b1){_0x2ec247(_0x37d7b1);});});}return _0x1b848e[_0x183b('0x4e')](_0x183b('0x4f'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x372bc2){var _0x2c7267=this[_0x183b('0x50')]({'plain':!![]});var _0x38a91c=_0x2c7267['type']===_0x183b('0x12')?_0x26ac1f(_0x2c7267):_0x3655eb(_0x2c7267);return _0x267b94(_0x2c7267,_0x372bc2,_['last'](_0x38a91c)[_0x183b('0x4a')]+0x1)[_0x183b('0x35')](function(_0xcf055d){var _0x11d623=_[_0x183b('0x4c')](_0x38a91c,_0xcf055d);_0x11d623[_0x183b('0xe')]({'type':_0x2c7267[_0x183b('0x6')],'app':_0x183b('0x51'),'exten':_0x2c7267['exten'],'context':_0x2c7267['context'],'priority':_[_0x183b('0x4b')](_0x11d623)[_0x183b('0x4a')]+0x1,'VoiceExtensionId':_0x2c7267['id']});return _0x11d623;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 265df4f..83c5363 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 _0x80c3=['error','code','message','result','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','attributes','limit','include','map','model','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','jayson/promise','redis','defaults','socket.io-emitter','register','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0x80c3,0x18f));var _0x380c=function(_0x175e89,_0x20835f){_0x175e89=_0x175e89-0x0;var _0x2ed996=_0x80c3[_0x175e89];return _0x2ed996;};'use strict';var _=require(_0x380c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x380c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x380c('0x2'));var db=require(_0x380c('0x3'))['db'];var utils=require(_0x380c('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x380c('0x5'));var client=jayson['client']['http']({'port':0x232a});config[_0x380c('0x6')]=_[_0x380c('0x7')](config[_0x380c('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0x380c('0x8'))(new Redis(config[_0x380c('0x6')]));require('./voiceExtension.socket')[_0x380c('0x9')](socket);function respondWithRpcPromise(_0x1d5493,_0x50be52,_0x58886c){return new BPromise(function(_0x3a1ebb,_0x35f424){return client['request'](_0x1d5493,_0x58886c)[_0x380c('0xa')](function(_0x41fbf2){logger[_0x380c('0xb')](_0x380c('0xc'),_0x50be52,_0x380c('0xd'));logger[_0x380c('0xe')](_0x380c('0xf'),_0x50be52,_0x380c('0xd'),JSON[_0x380c('0x10')](_0x41fbf2));if(_0x41fbf2[_0x380c('0x11')]){if(_0x41fbf2['error'][_0x380c('0x12')]===0x1f4){logger[_0x380c('0x11')]('VoiceExtension,\x20%s,\x20%s',_0x50be52,_0x41fbf2[_0x380c('0x11')][_0x380c('0x13')]);return _0x35f424(_0x41fbf2[_0x380c('0x11')][_0x380c('0x13')]);}logger[_0x380c('0x11')](_0x380c('0xc'),_0x50be52,_0x41fbf2[_0x380c('0x11')][_0x380c('0x13')]);return _0x3a1ebb(_0x41fbf2[_0x380c('0x11')]['message']);}else{logger[_0x380c('0xb')]('VoiceExtension,\x20%s,\x20%s',_0x50be52,'request\x20sent');_0x3a1ebb(_0x41fbf2[_0x380c('0x14')]['message']);}})['catch'](function(_0x4901fe){logger['error'](_0x380c('0xc'),_0x50be52,_0x4901fe);_0x35f424(_0x4901fe);});});}exports[_0x380c('0x15')]=function(_0x1689b3){var _0x10c9ee=this;return new Promise(function(_0x92ea5f,_0x4086c2){return db[_0x380c('0x16')][_0x380c('0x17')]({'raw':_0x1689b3[_0x380c('0x18')]?_0x1689b3[_0x380c('0x18')][_0x380c('0x19')]===undefined?!![]:![]:!![],'where':_0x1689b3[_0x380c('0x18')]?_0x1689b3[_0x380c('0x18')][_0x380c('0x1a')]||null:null,'attributes':_0x1689b3[_0x380c('0x18')]?_0x1689b3[_0x380c('0x18')][_0x380c('0x1b')]||null:null,'limit':_0x1689b3[_0x380c('0x18')]?_0x1689b3[_0x380c('0x18')][_0x380c('0x1c')]||null:null,'include':_0x1689b3[_0x380c('0x18')]?_0x1689b3['options'][_0x380c('0x1d')]?_['map'](_0x1689b3[_0x380c('0x18')]['include'],function(_0x2f2e98){return{'model':db[_0x2f2e98['model']],'as':_0x2f2e98['as'],'attributes':_0x2f2e98['attributes'],'include':_0x2f2e98[_0x380c('0x1d')]?_[_0x380c('0x1e')](_0x2f2e98['include'],function(_0x24d551){return{'model':db[_0x24d551[_0x380c('0x1f')]],'as':_0x24d551['as'],'attributes':_0x24d551[_0x380c('0x1b')],'include':_0x24d551[_0x380c('0x1d')]?_[_0x380c('0x1e')](_0x24d551[_0x380c('0x1d')],function(_0x229840){return{'model':db[_0x229840[_0x380c('0x1f')]],'as':_0x229840['as'],'attributes':_0x229840['attributes']};}):[]};}):[]};}):[]:[]})[_0x380c('0xa')](function(_0x3a32f9){logger[_0x380c('0xb')](_0x380c('0x15'),_0x1689b3);logger[_0x380c('0xe')]('GetVoiceExtension',_0x1689b3,JSON['stringify'](_0x3a32f9));_0x92ea5f(_0x3a32f9);})['catch'](function(_0x339774){logger['error'](_0x380c('0x15'),_0x339774[_0x380c('0x13')],_0x1689b3);_0x4086c2(_0x10c9ee['error'](0x1f4,_0x339774[_0x380c('0x13')]));});});}; \ No newline at end of file +var _0xb7ae=['jayson/promise','client','http','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','error','message','result','GetVoiceExtension','VoiceExtension','options','where','attributes','include','model','map','then','stringify','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x5b4d06,_0x3edc8d){var _0xad4053=function(_0x1e2748){while(--_0x1e2748){_0x5b4d06['push'](_0x5b4d06['shift']());}};_0xad4053(++_0x3edc8d);}(_0xb7ae,0xf3));var _0xeb7a=function(_0x731d4,_0x5ae4ae){_0x731d4=_0x731d4-0x0;var _0x54bd42=_0xb7ae[_0x731d4];return _0x54bd42;};'use strict';var _=require(_0xeb7a('0x0'));var util=require(_0xeb7a('0x1'));var moment=require(_0xeb7a('0x2'));var BPromise=require(_0xeb7a('0x3'));var rs=require(_0xeb7a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeb7a('0x5'))['db'];var utils=require(_0xeb7a('0x6'));var logger=require(_0xeb7a('0x7'))('rpc');var config=require(_0xeb7a('0x8'));var jayson=require(_0xeb7a('0x9'));var client=jayson[_0xeb7a('0xa')][_0xeb7a('0xb')]({'port':0x232a});config[_0xeb7a('0xc')]=_['defaults'](config[_0xeb7a('0xc')],{'host':_0xeb7a('0xd'),'port':0x18eb});var socket=require(_0xeb7a('0xe'))(new Redis(config['redis']));require(_0xeb7a('0xf'))[_0xeb7a('0x10')](socket);function respondWithRpcPromise(_0xb440a6,_0x15581b,_0x1a997e){return new BPromise(function(_0x275d58,_0x1e56db){return client['request'](_0xb440a6,_0x1a997e)['then'](function(_0x31222f){logger[_0xeb7a('0x11')](_0xeb7a('0x12'),_0x15581b,_0xeb7a('0x13'));logger[_0xeb7a('0x14')](_0xeb7a('0x15'),_0x15581b,_0xeb7a('0x13'),JSON['stringify'](_0x31222f));if(_0x31222f[_0xeb7a('0x16')]){if(_0x31222f[_0xeb7a('0x16')]['code']===0x1f4){logger[_0xeb7a('0x16')](_0xeb7a('0x12'),_0x15581b,_0x31222f['error'][_0xeb7a('0x17')]);return _0x1e56db(_0x31222f['error']['message']);}logger[_0xeb7a('0x16')]('VoiceExtension,\x20%s,\x20%s',_0x15581b,_0x31222f['error'][_0xeb7a('0x17')]);return _0x275d58(_0x31222f[_0xeb7a('0x16')][_0xeb7a('0x17')]);}else{logger[_0xeb7a('0x11')]('VoiceExtension,\x20%s,\x20%s',_0x15581b,'request\x20sent');_0x275d58(_0x31222f[_0xeb7a('0x18')][_0xeb7a('0x17')]);}})['catch'](function(_0x538311){logger[_0xeb7a('0x16')](_0xeb7a('0x12'),_0x15581b,_0x538311);_0x1e56db(_0x538311);});});}exports[_0xeb7a('0x19')]=function(_0x268a17){var _0x302e41=this;return new Promise(function(_0x3025fc,_0x29fa3f){return db[_0xeb7a('0x1a')]['findAll']({'raw':_0x268a17[_0xeb7a('0x1b')]?_0x268a17[_0xeb7a('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x268a17['options']?_0x268a17[_0xeb7a('0x1b')][_0xeb7a('0x1c')]||null:null,'attributes':_0x268a17[_0xeb7a('0x1b')]?_0x268a17[_0xeb7a('0x1b')][_0xeb7a('0x1d')]||null:null,'limit':_0x268a17[_0xeb7a('0x1b')]?_0x268a17[_0xeb7a('0x1b')]['limit']||null:null,'include':_0x268a17[_0xeb7a('0x1b')]?_0x268a17[_0xeb7a('0x1b')][_0xeb7a('0x1e')]?_['map'](_0x268a17[_0xeb7a('0x1b')][_0xeb7a('0x1e')],function(_0x182335){return{'model':db[_0x182335[_0xeb7a('0x1f')]],'as':_0x182335['as'],'attributes':_0x182335['attributes'],'include':_0x182335[_0xeb7a('0x1e')]?_['map'](_0x182335[_0xeb7a('0x1e')],function(_0x42698d){return{'model':db[_0x42698d[_0xeb7a('0x1f')]],'as':_0x42698d['as'],'attributes':_0x42698d[_0xeb7a('0x1d')],'include':_0x42698d[_0xeb7a('0x1e')]?_[_0xeb7a('0x20')](_0x42698d[_0xeb7a('0x1e')],function(_0x3917eb){return{'model':db[_0x3917eb[_0xeb7a('0x1f')]],'as':_0x3917eb['as'],'attributes':_0x3917eb[_0xeb7a('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xeb7a('0x21')](function(_0x567bbe){logger[_0xeb7a('0x11')](_0xeb7a('0x19'),_0x268a17);logger[_0xeb7a('0x14')](_0xeb7a('0x19'),_0x268a17,JSON[_0xeb7a('0x22')](_0x567bbe));_0x3025fc(_0x567bbe);})[_0xeb7a('0x23')](function(_0x1662ee){logger[_0xeb7a('0x16')](_0xeb7a('0x19'),_0x1662ee[_0xeb7a('0x17')],_0x268a17);_0x29fa3f(_0x302e41[_0xeb7a('0x16')](0x1f4,_0x1662ee['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 8e07ac9..93edba4 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 _0x7a54=['remove','emit','removeListener','register','length','voiceExtension:','./voiceExtension.events','save'];(function(_0x5aaaa5,_0x1684d7){var _0x48a86e=function(_0x558bb0){while(--_0x558bb0){_0x5aaaa5['push'](_0x5aaaa5['shift']());}};_0x48a86e(++_0x1684d7);}(_0x7a54,0x106));var _0x47a5=function(_0x6a4c05,_0x1895dd){_0x6a4c05=_0x6a4c05-0x0;var _0x178a55=_0x7a54[_0x6a4c05];return _0x178a55;};'use strict';var VoiceExtensionEvents=require(_0x47a5('0x0'));var events=[_0x47a5('0x1'),_0x47a5('0x2'),'update'];function createListener(_0x1d33e,_0x4086cd){return function(_0x4880bf){_0x4086cd[_0x47a5('0x3')](_0x1d33e,_0x4880bf);};}function removeListener(_0x11bf85,_0x2a1a7e){return function(){VoiceExtensionEvents[_0x47a5('0x4')](_0x11bf85,_0x2a1a7e);};}exports[_0x47a5('0x5')]=function(_0x545a97){for(var _0x3d5629=0x0,_0x59199c=events[_0x47a5('0x6')];_0x3d5629<_0x59199c;_0x3d5629++){var _0x30e405=events[_0x3d5629];var _0x506eda=createListener(_0x47a5('0x7')+_0x30e405,_0x545a97);VoiceExtensionEvents['on'](_0x30e405,_0x506eda);}}; \ No newline at end of file +var _0x0295=['emit','removeListener','register','voiceExtension:','./voiceExtension.events','update'];(function(_0x5b761b,_0xa1a618){var _0x35190e=function(_0xdee747){while(--_0xdee747){_0x5b761b['push'](_0x5b761b['shift']());}};_0x35190e(++_0xa1a618);}(_0x0295,0x1f0));var _0x5029=function(_0x3a9661,_0x530b12){_0x3a9661=_0x3a9661-0x0;var _0x5bb119=_0x0295[_0x3a9661];return _0x5bb119;};'use strict';var VoiceExtensionEvents=require(_0x5029('0x0'));var events=['save','remove',_0x5029('0x1')];function createListener(_0x4f552a,_0x53c2e1){return function(_0x315589){_0x53c2e1[_0x5029('0x2')](_0x4f552a,_0x315589);};}function removeListener(_0x157a4f,_0x3d0af1){return function(){VoiceExtensionEvents[_0x5029('0x3')](_0x157a4f,_0x3d0af1);};}exports[_0x5029('0x4')]=function(_0x200217){for(var _0x215955=0x0,_0x5b3cd=events['length'];_0x215955<_0x5b3cd;_0x215955++){var _0x54978f=events[_0x215955];var _0x4ee867=createListener(_0x5029('0x5')+_0x54978f,_0x200217);VoiceExtensionEvents['on'](_0x54978f,_0x4ee867);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 0139e84..91b380c 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 _0x5fdc=['delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index','/:id/messages','getMessages','create','put','/:id','update'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x5fdc,0x127));var _0xc5fd=function(_0x59b9be,_0x308971){_0x59b9be=_0x59b9be-0x0;var _0x8f19ef=_0x5fdc[_0x59b9be];return _0x8f19ef;};'use strict';var multer=require(_0xc5fd('0x0'));var util=require(_0xc5fd('0x1'));var path=require(_0xc5fd('0x2'));var timeout=require(_0xc5fd('0x3'));var express=require(_0xc5fd('0x4'));var router=express[_0xc5fd('0x5')]();var fs_extra=require(_0xc5fd('0x6'));var auth=require(_0xc5fd('0x7'));var interaction=require(_0xc5fd('0x8'));var config=require(_0xc5fd('0x9'));var controller=require(_0xc5fd('0xa'));router[_0xc5fd('0xb')]('/',auth[_0xc5fd('0xc')](),controller[_0xc5fd('0xd')]);router[_0xc5fd('0xb')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xc5fd('0xb')](_0xc5fd('0xe'),auth[_0xc5fd('0xc')](),controller[_0xc5fd('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc5fd('0x10')]);router[_0xc5fd('0x11')](_0xc5fd('0x12'),auth[_0xc5fd('0xc')](),controller[_0xc5fd('0x13')]);router[_0xc5fd('0x14')]('/:id',auth[_0xc5fd('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x4fb4=['update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index','/:id','show','getMessages','post','create','put'];(function(_0x409353,_0xe9f04d){var _0x4f4b59=function(_0x64b587){while(--_0x64b587){_0x409353['push'](_0x409353['shift']());}};_0x4f4b59(++_0xe9f04d);}(_0x4fb4,0x190));var _0x44fb=function(_0x161668,_0x59cf59){_0x161668=_0x161668-0x0;var _0x582927=_0x4fb4[_0x161668];return _0x582927;};'use strict';var multer=require('multer');var util=require(_0x44fb('0x0'));var path=require(_0x44fb('0x1'));var timeout=require(_0x44fb('0x2'));var express=require(_0x44fb('0x3'));var router=express[_0x44fb('0x4')]();var fs_extra=require(_0x44fb('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x44fb('0x6'));var config=require(_0x44fb('0x7'));var controller=require(_0x44fb('0x8'));router[_0x44fb('0x9')]('/',auth[_0x44fb('0xa')](),controller[_0x44fb('0xb')]);router[_0x44fb('0x9')](_0x44fb('0xc'),auth['isAuthenticated'](),controller[_0x44fb('0xd')]);router[_0x44fb('0x9')]('/:id/messages',auth[_0x44fb('0xa')](),controller[_0x44fb('0xe')]);router[_0x44fb('0xf')]('/',auth[_0x44fb('0xa')](),controller[_0x44fb('0x10')]);router[_0x44fb('0x11')](_0x44fb('0xc'),auth[_0x44fb('0xa')](),controller[_0x44fb('0x12')]);router[_0x44fb('0x13')]('/:id',auth[_0x44fb('0xa')](),controller[_0x44fb('0x14')]);module[_0x44fb('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 8c3de75..9d1c78c 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 _0x4905=['yes','TINYINT(4)','INTEGER','VIRTUAL','fullname','getDataValue','mailbox','sequelize','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','central','ENUM'];(function(_0x5471ec,_0x1ce81a){var _0x121d4c=function(_0xefb655){while(--_0xefb655){_0x5471ec['push'](_0x5471ec['shift']());}};_0x121d4c(++_0x1ce81a);}(_0x4905,0xa0));var _0x5490=function(_0x9d1e6b,_0x3bdc22){_0x9d1e6b=_0x9d1e6b-0x0;var _0x2b3070=_0x4905[_0x9d1e6b];return _0x2b3070;};'use strict';var Sequelize=require(_0x5490('0x0'));module['exports']={'customer_id':{'type':Sequelize[_0x5490('0x1')]},'context':{'type':Sequelize['STRING'],'defaultValue':_0x5490('0x2'),'unique':_0x5490('0x3')},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0x5490('0x3')},'password':{'type':Sequelize[_0x5490('0x1')]},'fullname':{'type':Sequelize[_0x5490('0x1')]},'email':{'type':Sequelize[_0x5490('0x1')],'validate':{'isEmail':!![]},'set':function(_0x2aa725){this[_0x5490('0x4')](_0x5490('0x5'),typeof _0x2aa725===_0x5490('0x6')&&_0x2aa725['trim']()?_0x2aa725[_0x5490('0x7')]():null);}},'pager':{'type':Sequelize[_0x5490('0x1')]},'tz':{'type':Sequelize[_0x5490('0x1')],'defaultValue':_0x5490('0x8')},'attach':{'type':Sequelize[_0x5490('0x9')](_0x5490('0xa'),'no'),'defaultValue':_0x5490('0xa'),'allowNull':![]},'saycid':{'type':Sequelize[_0x5490('0x9')](_0x5490('0xa'),'no'),'defaultValue':_0x5490('0xa'),'allowNull':![]},'dialout':{'type':Sequelize[_0x5490('0x1')]},'callback':{'type':Sequelize[_0x5490('0x1')]},'review':{'type':Sequelize[_0x5490('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x5490('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0x5490('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM'](_0x5490('0xa'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x5490('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0x5490('0xa'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM'](_0x5490('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x5490('0x9')](_0x5490('0xa'),'no'),'defaultValue':_0x5490('0xa'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0x5490('0xa'),'no'),'defaultValue':_0x5490('0xa'),'allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize[_0x5490('0x1')]},'emailbody':{'type':Sequelize[_0x5490('0x1')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x5490('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x5490('0xd')],'get':function(){return this['getDataValue'](_0x5490('0xe'))+'\x20-\x20'+this[_0x5490('0xf')](_0x5490('0x10'));}}}; \ No newline at end of file +var _0xb9c3=['ENUM','TIMESTAMP','INTEGER','VIRTUAL','fullname','\x20-\x20','getDataValue','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','string','trim','central','yes'];(function(_0x4335ed,_0x570b3c){var _0x5fc711=function(_0x1af333){while(--_0x1af333){_0x4335ed['push'](_0x4335ed['shift']());}};_0x5fc711(++_0x570b3c);}(_0xb9c3,0x1e3));var _0x3b9c=function(_0x30d686,_0x2ceccf){_0x30d686=_0x30d686-0x0;var _0x2af9d0=_0xb9c3[_0x30d686];return _0x2af9d0;};'use strict';var Sequelize=require(_0x3b9c('0x0'));module[_0x3b9c('0x1')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x3b9c('0x2')],'defaultValue':_0x3b9c('0x3'),'unique':_0x3b9c('0x4')},'mailbox':{'type':Sequelize[_0x3b9c('0x2')],'defaultValue':'','allowNull':![],'unique':_0x3b9c('0x4')},'password':{'type':Sequelize[_0x3b9c('0x2')]},'fullname':{'type':Sequelize[_0x3b9c('0x2')]},'email':{'type':Sequelize[_0x3b9c('0x2')],'validate':{'isEmail':!![]},'set':function(_0x5bd293){this[_0x3b9c('0x5')]('email',typeof _0x5bd293===_0x3b9c('0x6')&&_0x5bd293['trim']()?_0x5bd293[_0x3b9c('0x7')]():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0x3b9c('0x2')],'defaultValue':_0x3b9c('0x8')},'attach':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x3b9c('0x9'),'allowNull':![]},'saycid':{'type':Sequelize[_0x3b9c('0xa')](_0x3b9c('0x9'),'no'),'defaultValue':_0x3b9c('0x9'),'allowNull':![]},'dialout':{'type':Sequelize[_0x3b9c('0x2')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize['ENUM'](_0x3b9c('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x3b9c('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x3b9c('0xa')](_0x3b9c('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM'](_0x3b9c('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x3b9c('0xa')](_0x3b9c('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0x3b9c('0xa')](_0x3b9c('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x3b9c('0xa')](_0x3b9c('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x3b9c('0xa')](_0x3b9c('0x9'),'no'),'defaultValue':_0x3b9c('0x9'),'allowNull':![]},'stamp':{'type':_0x3b9c('0xb')},'emailsubject':{'type':Sequelize[_0x3b9c('0x2')]},'emailbody':{'type':Sequelize[_0x3b9c('0x2')]},'maxsecs':{'type':Sequelize[_0x3b9c('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x3b9c('0xd')],'get':function(){return this['getDataValue'](_0x3b9c('0xe'))+_0x3b9c('0xf')+this[_0x3b9c('0x10')]('mailbox');}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index f02c5c0..b090d49 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 _0xa74f=['ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','offset','undefined','limit','count','set','json','reject','save','destroy','then','Voicemails','UserProfileResource','error','stack','send','map','VoiceMail','rawAttributes','fieldName','type','key','model','name','query','intersection','attributes','fields','length','order','sort','where','filters','pick','filter','merge','VIRTUAL','rows','catch','show','params','keys','include','find','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','findOne','VoiceMailMessage','hasOwnProperty','nolimit','mailbox','options','findAndCountAll','zip-dir','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x5477bf,_0x571dc0){var _0x5f34cc=function(_0xce5b9a){while(--_0xce5b9a){_0x5477bf['push'](_0x5477bf['shift']());}};_0x5f34cc(++_0x571dc0);}(_0xa74f,0x9a));var _0xfa74=function(_0x31a938,_0x4daec6){_0x31a938=_0x31a938-0x0;var _0x1bf341=_0xa74f[_0x31a938];return _0x1bf341;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xfa74('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xfa74('0x1'));var BPromise=require(_0xfa74('0x2'));var Mustache=require(_0xfa74('0x3'));var util=require(_0xfa74('0x4'));var path=require('path');var sox=require(_0xfa74('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfa74('0x6'));var _=require(_0xfa74('0x7'));var squel=require(_0xfa74('0x8'));var crypto=require(_0xfa74('0x9'));var jsforce=require(_0xfa74('0xa'));var deskjs=require(_0xfa74('0xb'));var toCsv=require('to-csv');var querystring=require(_0xfa74('0xc'));var Papa=require(_0xfa74('0xd'));var Redis=require(_0xfa74('0xe'));var authService=require(_0xfa74('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xfa74('0x10'));var hardwareService=require(_0xfa74('0x11'));var logger=require('../../config/logger')(_0xfa74('0x12'));var utils=require(_0xfa74('0x13'));var config=require(_0xfa74('0x14'));var licenseUtil=require(_0xfa74('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x23591a,_0x998585){_0x998585=_0x998585||0xcc;return function(_0x78173f){if(_0x78173f){return _0x23591a[_0xfa74('0x16')](_0x998585);}return _0x23591a['status'](_0x998585)[_0xfa74('0x17')]();};}function respondWithResult(_0x33cda3,_0x3eb49b){_0x3eb49b=_0x3eb49b||0xc8;return function(_0x3947ca){if(_0x3947ca){return _0x33cda3[_0xfa74('0x18')](_0x3eb49b)['json'](_0x3947ca);}};}function respondWithFilteredResult(_0x199d20,_0x13d911){return function(_0x947da6){if(_0x947da6){var _0x1f1de0=typeof _0x13d911[_0xfa74('0x19')]===_0xfa74('0x1a')&&typeof _0x13d911[_0xfa74('0x1b')]==='undefined';var _0x58a67a=_0x947da6[_0xfa74('0x1c')];var _0x51dda1=_0x1f1de0?0x0:_0x13d911['offset'];var _0x31d3c1=_0x1f1de0?_0x947da6[_0xfa74('0x1c')]:_0x13d911[_0xfa74('0x19')]+_0x13d911['limit'];var _0x3bede6;if(_0x31d3c1>=_0x58a67a){_0x31d3c1=_0x58a67a;_0x3bede6=0xc8;}else{_0x3bede6=0xce;}_0x199d20[_0xfa74('0x18')](_0x3bede6);return _0x199d20[_0xfa74('0x1d')]('Content-Range',_0x51dda1+'-'+_0x31d3c1+'/'+_0x58a67a)[_0xfa74('0x1e')](_0x947da6);}return null;};}function patchUpdates(_0x302eb4){return function(_0x2e6c33){try{jsonpatch['apply'](_0x2e6c33,_0x302eb4,!![]);}catch(_0x5466ca){return BPromise[_0xfa74('0x1f')](_0x5466ca);}return _0x2e6c33[_0xfa74('0x20')]();};}function saveUpdates(_0x9932db,_0xeaaa19){return function(_0x1a453d){if(_0x1a453d){return _0x1a453d['update'](_0x9932db)['then'](function(_0x3721bf){return _0x3721bf;});}return null;};}function removeEntity(_0x5aa8a7,_0x48cbd3){return function(_0x529810){if(_0x529810){return _0x529810[_0xfa74('0x21')]()[_0xfa74('0x22')](function(){var _0x42d9bf=_0x529810['get']({'plain':!![]});var _0x530f99=_0xfa74('0x23');return db[_0xfa74('0x24')]['destroy']({'where':{'type':_0x530f99,'resourceId':_0x42d9bf['id']}})[_0xfa74('0x22')](function(){return _0x529810;});})['then'](function(){_0x5aa8a7[_0xfa74('0x18')](0xcc)[_0xfa74('0x17')]();});}};}function handleEntityNotFound(_0x55d8e4,_0x298388){return function(_0x1130de){if(!_0x1130de){_0x55d8e4[_0xfa74('0x16')](0x194);}return _0x1130de;};}function handleError(_0x218c86,_0x4f7337){_0x4f7337=_0x4f7337||0x1f4;return function(_0xd9c55d){logger[_0xfa74('0x25')](_0xd9c55d[_0xfa74('0x26')]);if(_0xd9c55d['name']){delete _0xd9c55d['name'];}_0x218c86[_0xfa74('0x18')](_0x4f7337)[_0xfa74('0x27')](_0xd9c55d);};}exports['index']=function(_0x4b38fc,_0x343466){var _0x564060={},_0x2238d4={},_0x4d6d0a={'count':0x0,'rows':[]};var _0x363173=_[_0xfa74('0x28')](db[_0xfa74('0x29')][_0xfa74('0x2a')],function(_0x4c506f){return{'name':_0x4c506f[_0xfa74('0x2b')],'type':_0x4c506f[_0xfa74('0x2c')][_0xfa74('0x2d')]};});_0x2238d4[_0xfa74('0x2e')]=_[_0xfa74('0x28')](_0x363173,_0xfa74('0x2f'));_0x2238d4[_0xfa74('0x30')]=_['keys'](_0x4b38fc[_0xfa74('0x30')]);_0x2238d4['filters']=_[_0xfa74('0x31')](_0x2238d4[_0xfa74('0x2e')],_0x2238d4[_0xfa74('0x30')]);_0x564060[_0xfa74('0x32')]=_['intersection'](_0x2238d4['model'],qs[_0xfa74('0x33')](_0x4b38fc[_0xfa74('0x30')][_0xfa74('0x33')]));_0x564060[_0xfa74('0x32')]=_0x564060['attributes'][_0xfa74('0x34')]?_0x564060[_0xfa74('0x32')]:_0x2238d4['model'];if(!_0x4b38fc['query']['hasOwnProperty']('nolimit')){_0x564060['limit']=qs[_0xfa74('0x1b')](_0x4b38fc[_0xfa74('0x30')][_0xfa74('0x1b')]);_0x564060[_0xfa74('0x19')]=qs[_0xfa74('0x19')](_0x4b38fc[_0xfa74('0x30')][_0xfa74('0x19')]);}_0x564060[_0xfa74('0x35')]=qs[_0xfa74('0x36')](_0x4b38fc['query'][_0xfa74('0x36')]);_0x564060[_0xfa74('0x37')]=qs[_0xfa74('0x38')](_[_0xfa74('0x39')](_0x4b38fc[_0xfa74('0x30')],_0x2238d4[_0xfa74('0x38')]),_0x363173);if(_0x4b38fc['query'][_0xfa74('0x3a')]){_0x564060[_0xfa74('0x37')]=_[_0xfa74('0x3b')](_0x564060[_0xfa74('0x37')],{'$or':_['map'](_0x363173,function(_0x207566){if(_0x207566[_0xfa74('0x2c')]!==_0xfa74('0x3c')){var _0x35f252={};_0x35f252[_0x207566['name']]={'$like':'%'+_0x4b38fc[_0xfa74('0x30')][_0xfa74('0x3a')]+'%'};return _0x35f252;}})});}_0x564060=_[_0xfa74('0x3b')]({},_0x564060,_0x4b38fc['options']);var _0x5d32bc={'where':_0x564060[_0xfa74('0x37')]};return db[_0xfa74('0x29')][_0xfa74('0x1c')](_0x5d32bc)[_0xfa74('0x22')](function(_0x55f4e3){_0x4d6d0a[_0xfa74('0x1c')]=_0x55f4e3;if(_0x4b38fc[_0xfa74('0x30')]['includeAll']){_0x564060['include']=[{'all':!![]}];}return db['VoiceMail']['findAll'](_0x564060);})[_0xfa74('0x22')](function(_0x3098ca){_0x4d6d0a[_0xfa74('0x3d')]=_0x3098ca;return _0x4d6d0a;})[_0xfa74('0x22')](respondWithFilteredResult(_0x343466,_0x564060))[_0xfa74('0x3e')](handleError(_0x343466,null));};exports[_0xfa74('0x3f')]=function(_0x7735c5,_0x5aac45){var _0x274062={'raw':!![],'where':{'id':_0x7735c5[_0xfa74('0x40')]['id']}},_0x3938c1={};_0x3938c1[_0xfa74('0x2e')]=_[_0xfa74('0x41')](db['VoiceMail'][_0xfa74('0x2a')]);_0x3938c1[_0xfa74('0x30')]=_[_0xfa74('0x41')](_0x7735c5[_0xfa74('0x30')]);_0x3938c1[_0xfa74('0x38')]=_[_0xfa74('0x31')](_0x3938c1[_0xfa74('0x2e')],_0x3938c1[_0xfa74('0x30')]);_0x274062[_0xfa74('0x32')]=_[_0xfa74('0x31')](_0x3938c1['model'],qs[_0xfa74('0x33')](_0x7735c5['query'][_0xfa74('0x33')]));_0x274062[_0xfa74('0x32')]=_0x274062[_0xfa74('0x32')][_0xfa74('0x34')]?_0x274062['attributes']:_0x3938c1[_0xfa74('0x2e')];if(_0x7735c5[_0xfa74('0x30')]['includeAll']){_0x274062[_0xfa74('0x42')]=[{'all':!![]}];}_0x274062=_[_0xfa74('0x3b')]({},_0x274062,_0x7735c5['options']);return db[_0xfa74('0x29')][_0xfa74('0x43')](_0x274062)[_0xfa74('0x22')](handleEntityNotFound(_0x5aac45,null))[_0xfa74('0x22')](respondWithResult(_0x5aac45,null))[_0xfa74('0x3e')](handleError(_0x5aac45,null));};exports['create']=function(_0x54e06c,_0x36f6ca){return db[_0xfa74('0x29')]['create'](_0x54e06c[_0xfa74('0x44')],{})[_0xfa74('0x22')](function(_0x3100f2){var _0x4ca49e=_0x54e06c['user'][_0xfa74('0x45')]({'plain':!![]});if(!_0x4ca49e)throw new Error(_0xfa74('0x46'));if(_0x4ca49e[_0xfa74('0x47')]===_0xfa74('0x48')){var _0x36508a=_0x3100f2[_0xfa74('0x45')]({'plain':!![]});var _0x2d217d=_0xfa74('0x23');return db['UserProfileSection'][_0xfa74('0x43')]({'where':{'name':_0x2d217d,'userProfileId':_0x4ca49e[_0xfa74('0x49')]},'raw':!![]})[_0xfa74('0x22')](function(_0x2654b5){if(_0x2654b5&&_0x2654b5['autoAssociation']===0x0){return db['UserProfileResource'][_0xfa74('0x4a')]({'name':_0x36508a['name'],'resourceId':_0x36508a['id'],'type':_0x2654b5[_0xfa74('0x2f')],'sectionId':_0x2654b5['id']},{})[_0xfa74('0x22')](function(){return _0x3100f2;});}else{return _0x3100f2;}})[_0xfa74('0x3e')](function(_0x33e31e){logger[_0xfa74('0x25')](_0xfa74('0x4b'),_0x33e31e);throw _0x33e31e;});}return _0x3100f2;})[_0xfa74('0x22')](respondWithResult(_0x36f6ca,0xc9))['catch'](handleError(_0x36f6ca,null));};exports[_0xfa74('0x4c')]=function(_0x4bcee3,_0x21d7c5){if(_0x4bcee3['body']['id']){delete _0x4bcee3['body']['id'];}return db[_0xfa74('0x29')][_0xfa74('0x43')]({'where':{'id':_0x4bcee3['params']['id']}})['then'](handleEntityNotFound(_0x21d7c5,null))[_0xfa74('0x22')](saveUpdates(_0x4bcee3[_0xfa74('0x44')],null))[_0xfa74('0x22')](respondWithResult(_0x21d7c5,null))[_0xfa74('0x3e')](handleError(_0x21d7c5,null));};exports[_0xfa74('0x21')]=function(_0xfc3547,_0x1198f3){return db[_0xfa74('0x29')][_0xfa74('0x43')]({'where':{'id':_0xfc3547[_0xfa74('0x40')]['id']}})['then'](handleEntityNotFound(_0x1198f3,null))[_0xfa74('0x22')](removeEntity(_0x1198f3,null))[_0xfa74('0x3e')](handleError(_0x1198f3,null));};exports['getMessages']=function(_0x550974,_0x3d88dc,_0x2e7262){return db[_0xfa74('0x29')][_0xfa74('0x4d')]({'where':{'id':_0x550974[_0xfa74('0x40')]['id']}})['then'](handleEntityNotFound(_0x3d88dc,null))[_0xfa74('0x22')](function(_0x4d6235){var _0x26b398;var _0x2fff37={},_0x375bf7={};_0x375bf7['model']=_['keys'](db[_0xfa74('0x4e')][_0xfa74('0x2a')]);_0x375bf7[_0xfa74('0x30')]=_[_0xfa74('0x41')](_0x550974['query']);_0x375bf7[_0xfa74('0x38')]=_[_0xfa74('0x31')](_0x375bf7['model'],_0x375bf7[_0xfa74('0x30')]);_0x2fff37[_0xfa74('0x32')]=_[_0xfa74('0x31')](_0x375bf7[_0xfa74('0x2e')],qs['fields'](_0x550974[_0xfa74('0x30')]['fields']));_0x2fff37[_0xfa74('0x32')]=_0x2fff37[_0xfa74('0x32')][_0xfa74('0x34')]?_0x2fff37[_0xfa74('0x32')]:_0x375bf7[_0xfa74('0x2e')];if(!_0x550974[_0xfa74('0x30')][_0xfa74('0x4f')](_0xfa74('0x50'))){_0x2fff37[_0xfa74('0x1b')]=qs[_0xfa74('0x1b')](_0x550974[_0xfa74('0x30')][_0xfa74('0x1b')]);_0x2fff37[_0xfa74('0x19')]=qs[_0xfa74('0x19')](_0x550974[_0xfa74('0x30')]['offset']);}_0x2fff37[_0xfa74('0x35')]=qs[_0xfa74('0x36')](_0x550974['query']['sort']);_0x2fff37[_0xfa74('0x37')]=qs['filters'](_[_0xfa74('0x39')](_0x550974[_0xfa74('0x30')],_0x375bf7[_0xfa74('0x38')]));if(_0x550974['query'][_0xfa74('0x3a')]){_0x2fff37['where']=_['merge'](_0x2fff37[_0xfa74('0x37')],{'$or':_[_0xfa74('0x28')](_0x2fff37[_0xfa74('0x32')],function(_0x414e31){var _0x474c7d={};_0x474c7d[_0x414e31]={'$like':'%'+_0x550974[_0xfa74('0x30')][_0xfa74('0x3a')]+'%'};return _0x474c7d;})});}_0x2fff37[_0xfa74('0x37')]=_[_0xfa74('0x3b')](_0x2fff37[_0xfa74('0x37')],{'mailboxuser':_0x4d6235[_0xfa74('0x51')]});_0x2fff37=_['merge']({},_0x2fff37,_0x550974[_0xfa74('0x52')]);return db['VoiceMailMessage'][_0xfa74('0x53')](_0x2fff37)[_0xfa74('0x22')](respondWithFilteredResult(_0x3d88dc,_0x2fff37));})[_0xfa74('0x3e')](handleError(_0x3d88dc,null));}; \ No newline at end of file +var _0x02ce=['lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','count','limit','status','Content-Range','apply','reject','save','update','then','destroy','Voicemails','UserProfileResource','end','error','stack','name','send','index','map','VoiceMail','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','catch','show','params','find','create','body','user','get','role','UserProfileSection','getMessages','findOne','VoiceMailMessage','findAndCountAll','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x02ce,0x1ac));var _0xe02c=function(_0x15a38c,_0x26eb67){_0x15a38c=_0x15a38c-0x0;var _0x3ae576=_0x02ce[_0x15a38c];return _0x3ae576;};'use strict';var emlformat=require(_0xe02c('0x0'));var rimraf=require(_0xe02c('0x1'));var zipdir=require(_0xe02c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe02c('0x3'));var moment=require('moment');var BPromise=require(_0xe02c('0x4'));var Mustache=require(_0xe02c('0x5'));var util=require(_0xe02c('0x6'));var path=require(_0xe02c('0x7'));var sox=require(_0xe02c('0x8'));var csv=require(_0xe02c('0x9'));var ejs=require(_0xe02c('0xa'));var fs=require('fs');var fs_extra=require(_0xe02c('0xb'));var _=require(_0xe02c('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe02c('0xd'));var deskjs=require(_0xe02c('0xe'));var toCsv=require(_0xe02c('0x9'));var querystring=require(_0xe02c('0xf'));var Papa=require(_0xe02c('0x10'));var Redis=require(_0xe02c('0x11'));var authService=require(_0xe02c('0x12'));var qs=require(_0xe02c('0x13'));var as=require(_0xe02c('0x14'));var hardwareService=require(_0xe02c('0x15'));var logger=require(_0xe02c('0x16'))(_0xe02c('0x17'));var utils=require(_0xe02c('0x18'));var config=require(_0xe02c('0x19'));var licenseUtil=require(_0xe02c('0x1a'));var db=require(_0xe02c('0x1b'))['db'];function respondWithStatusCode(_0x23d886,_0x32fc45){_0x32fc45=_0x32fc45||0xcc;return function(_0x5d6d13){if(_0x5d6d13){return _0x23d886[_0xe02c('0x1c')](_0x32fc45);}return _0x23d886['status'](_0x32fc45)['end']();};}function respondWithResult(_0x3f4e28,_0x56405a){_0x56405a=_0x56405a||0xc8;return function(_0x221910){if(_0x221910){return _0x3f4e28['status'](_0x56405a)[_0xe02c('0x1d')](_0x221910);}};}function respondWithFilteredResult(_0x4e9c6d,_0x256311){return function(_0x366893){if(_0x366893){var _0x59f2f6=typeof _0x256311[_0xe02c('0x1e')]===_0xe02c('0x1f')&&typeof _0x256311['limit']===_0xe02c('0x1f');var _0x20f492=_0x366893['count'];var _0x52917f=_0x59f2f6?0x0:_0x256311[_0xe02c('0x1e')];var _0x49604a=_0x59f2f6?_0x366893[_0xe02c('0x20')]:_0x256311[_0xe02c('0x1e')]+_0x256311[_0xe02c('0x21')];var _0x36fed0;if(_0x49604a>=_0x20f492){_0x49604a=_0x20f492;_0x36fed0=0xc8;}else{_0x36fed0=0xce;}_0x4e9c6d[_0xe02c('0x22')](_0x36fed0);return _0x4e9c6d['set'](_0xe02c('0x23'),_0x52917f+'-'+_0x49604a+'/'+_0x20f492)['json'](_0x366893);}return null;};}function patchUpdates(_0x4ea9b5){return function(_0x393621){try{jsonpatch[_0xe02c('0x24')](_0x393621,_0x4ea9b5,!![]);}catch(_0x480b9a){return BPromise[_0xe02c('0x25')](_0x480b9a);}return _0x393621[_0xe02c('0x26')]();};}function saveUpdates(_0x4ce5ee,_0x38dce2){return function(_0x45fd82){if(_0x45fd82){return _0x45fd82[_0xe02c('0x27')](_0x4ce5ee)[_0xe02c('0x28')](function(_0x2d44c8){return _0x2d44c8;});}return null;};}function removeEntity(_0x557142,_0x3e80e3){return function(_0xf41d4c){if(_0xf41d4c){return _0xf41d4c[_0xe02c('0x29')]()[_0xe02c('0x28')](function(){var _0x60b65e=_0xf41d4c['get']({'plain':!![]});var _0xefd882=_0xe02c('0x2a');return db[_0xe02c('0x2b')][_0xe02c('0x29')]({'where':{'type':_0xefd882,'resourceId':_0x60b65e['id']}})[_0xe02c('0x28')](function(){return _0xf41d4c;});})[_0xe02c('0x28')](function(){_0x557142[_0xe02c('0x22')](0xcc)[_0xe02c('0x2c')]();});}};}function handleEntityNotFound(_0x55ef2a,_0x55e475){return function(_0x3790eb){if(!_0x3790eb){_0x55ef2a[_0xe02c('0x1c')](0x194);}return _0x3790eb;};}function handleError(_0x481e02,_0x18b572){_0x18b572=_0x18b572||0x1f4;return function(_0x2d1d98){logger[_0xe02c('0x2d')](_0x2d1d98[_0xe02c('0x2e')]);if(_0x2d1d98[_0xe02c('0x2f')]){delete _0x2d1d98[_0xe02c('0x2f')];}_0x481e02[_0xe02c('0x22')](_0x18b572)[_0xe02c('0x30')](_0x2d1d98);};}exports[_0xe02c('0x31')]=function(_0x288004,_0x17d5b3){var _0x5a2da0={},_0x3c3d2c={},_0x3c1858={'count':0x0,'rows':[]};var _0x22b783=_[_0xe02c('0x32')](db[_0xe02c('0x33')][_0xe02c('0x34')],function(_0x58bf16){return{'name':_0x58bf16[_0xe02c('0x35')],'type':_0x58bf16[_0xe02c('0x36')]['key']};});_0x3c3d2c[_0xe02c('0x37')]=_[_0xe02c('0x32')](_0x22b783,_0xe02c('0x2f'));_0x3c3d2c[_0xe02c('0x38')]=_[_0xe02c('0x39')](_0x288004['query']);_0x3c3d2c['filters']=_[_0xe02c('0x3a')](_0x3c3d2c[_0xe02c('0x37')],_0x3c3d2c['query']);_0x5a2da0[_0xe02c('0x3b')]=_['intersection'](_0x3c3d2c[_0xe02c('0x37')],qs[_0xe02c('0x3c')](_0x288004[_0xe02c('0x38')][_0xe02c('0x3c')]));_0x5a2da0[_0xe02c('0x3b')]=_0x5a2da0['attributes'][_0xe02c('0x3d')]?_0x5a2da0['attributes']:_0x3c3d2c[_0xe02c('0x37')];if(!_0x288004[_0xe02c('0x38')][_0xe02c('0x3e')](_0xe02c('0x3f'))){_0x5a2da0[_0xe02c('0x21')]=qs[_0xe02c('0x21')](_0x288004['query'][_0xe02c('0x21')]);_0x5a2da0[_0xe02c('0x1e')]=qs['offset'](_0x288004[_0xe02c('0x38')][_0xe02c('0x1e')]);}_0x5a2da0['order']=qs[_0xe02c('0x40')](_0x288004['query'][_0xe02c('0x40')]);_0x5a2da0[_0xe02c('0x41')]=qs['filters'](_[_0xe02c('0x42')](_0x288004[_0xe02c('0x38')],_0x3c3d2c[_0xe02c('0x43')]),_0x22b783);if(_0x288004[_0xe02c('0x38')][_0xe02c('0x44')]){_0x5a2da0[_0xe02c('0x41')]=_['merge'](_0x5a2da0[_0xe02c('0x41')],{'$or':_['map'](_0x22b783,function(_0x5ae8cd){if(_0x5ae8cd[_0xe02c('0x36')]!==_0xe02c('0x45')){var _0x42fbac={};_0x42fbac[_0x5ae8cd[_0xe02c('0x2f')]]={'$like':'%'+_0x288004['query'][_0xe02c('0x44')]+'%'};return _0x42fbac;}})});}_0x5a2da0=_[_0xe02c('0x46')]({},_0x5a2da0,_0x288004[_0xe02c('0x47')]);var _0x5baef6={'where':_0x5a2da0['where']};return db[_0xe02c('0x33')][_0xe02c('0x20')](_0x5baef6)[_0xe02c('0x28')](function(_0x2313d2){_0x3c1858[_0xe02c('0x20')]=_0x2313d2;if(_0x288004[_0xe02c('0x38')][_0xe02c('0x48')]){_0x5a2da0[_0xe02c('0x49')]=[{'all':!![]}];}return db[_0xe02c('0x33')]['findAll'](_0x5a2da0);})[_0xe02c('0x28')](function(_0x5ef4a1){_0x3c1858['rows']=_0x5ef4a1;return _0x3c1858;})[_0xe02c('0x28')](respondWithFilteredResult(_0x17d5b3,_0x5a2da0))[_0xe02c('0x4a')](handleError(_0x17d5b3,null));};exports[_0xe02c('0x4b')]=function(_0x1719cf,_0x24d506){var _0x12ca0e={'raw':!![],'where':{'id':_0x1719cf[_0xe02c('0x4c')]['id']}},_0x165f4a={};_0x165f4a['model']=_['keys'](db[_0xe02c('0x33')][_0xe02c('0x34')]);_0x165f4a[_0xe02c('0x38')]=_['keys'](_0x1719cf[_0xe02c('0x38')]);_0x165f4a[_0xe02c('0x43')]=_[_0xe02c('0x3a')](_0x165f4a[_0xe02c('0x37')],_0x165f4a[_0xe02c('0x38')]);_0x12ca0e[_0xe02c('0x3b')]=_[_0xe02c('0x3a')](_0x165f4a[_0xe02c('0x37')],qs[_0xe02c('0x3c')](_0x1719cf[_0xe02c('0x38')]['fields']));_0x12ca0e[_0xe02c('0x3b')]=_0x12ca0e[_0xe02c('0x3b')][_0xe02c('0x3d')]?_0x12ca0e[_0xe02c('0x3b')]:_0x165f4a[_0xe02c('0x37')];if(_0x1719cf[_0xe02c('0x38')][_0xe02c('0x48')]){_0x12ca0e[_0xe02c('0x49')]=[{'all':!![]}];}_0x12ca0e=_[_0xe02c('0x46')]({},_0x12ca0e,_0x1719cf[_0xe02c('0x47')]);return db[_0xe02c('0x33')][_0xe02c('0x4d')](_0x12ca0e)[_0xe02c('0x28')](handleEntityNotFound(_0x24d506,null))['then'](respondWithResult(_0x24d506,null))[_0xe02c('0x4a')](handleError(_0x24d506,null));};exports['create']=function(_0x15b05c,_0x324911){return db[_0xe02c('0x33')][_0xe02c('0x4e')](_0x15b05c[_0xe02c('0x4f')],{})[_0xe02c('0x28')](function(_0x160969){var _0xc2b5dd=_0x15b05c[_0xe02c('0x50')][_0xe02c('0x51')]({'plain':!![]});if(!_0xc2b5dd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xc2b5dd[_0xe02c('0x52')]===_0xe02c('0x50')){var _0xeb4214=_0x160969['get']({'plain':!![]});var _0xdab6cb='Voicemails';return db[_0xe02c('0x53')]['find']({'where':{'name':_0xdab6cb,'userProfileId':_0xc2b5dd['userProfileId']},'raw':!![]})['then'](function(_0x55cf99){if(_0x55cf99&&_0x55cf99['autoAssociation']===0x0){return db['UserProfileResource'][_0xe02c('0x4e')]({'name':_0xeb4214[_0xe02c('0x2f')],'resourceId':_0xeb4214['id'],'type':_0x55cf99[_0xe02c('0x2f')],'sectionId':_0x55cf99['id']},{})[_0xe02c('0x28')](function(){return _0x160969;});}else{return _0x160969;}})['catch'](function(_0x274beb){logger[_0xe02c('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x274beb);throw _0x274beb;});}return _0x160969;})[_0xe02c('0x28')](respondWithResult(_0x324911,0xc9))[_0xe02c('0x4a')](handleError(_0x324911,null));};exports[_0xe02c('0x27')]=function(_0x51f940,_0x57a00f){if(_0x51f940[_0xe02c('0x4f')]['id']){delete _0x51f940[_0xe02c('0x4f')]['id'];}return db[_0xe02c('0x33')]['find']({'where':{'id':_0x51f940[_0xe02c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x57a00f,null))['then'](saveUpdates(_0x51f940[_0xe02c('0x4f')],null))[_0xe02c('0x28')](respondWithResult(_0x57a00f,null))['catch'](handleError(_0x57a00f,null));};exports[_0xe02c('0x29')]=function(_0x849eea,_0x1ead72){return db['VoiceMail'][_0xe02c('0x4d')]({'where':{'id':_0x849eea[_0xe02c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1ead72,null))[_0xe02c('0x28')](removeEntity(_0x1ead72,null))[_0xe02c('0x4a')](handleError(_0x1ead72,null));};exports[_0xe02c('0x54')]=function(_0x1c7206,_0x446c71,_0x188046){return db[_0xe02c('0x33')][_0xe02c('0x55')]({'where':{'id':_0x1c7206[_0xe02c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x446c71,null))['then'](function(_0x47f61c){var _0x130fca;var _0x299770={},_0x42f2fd={};_0x42f2fd['model']=_['keys'](db[_0xe02c('0x56')][_0xe02c('0x34')]);_0x42f2fd[_0xe02c('0x38')]=_[_0xe02c('0x39')](_0x1c7206[_0xe02c('0x38')]);_0x42f2fd['filters']=_[_0xe02c('0x3a')](_0x42f2fd[_0xe02c('0x37')],_0x42f2fd['query']);_0x299770['attributes']=_[_0xe02c('0x3a')](_0x42f2fd['model'],qs['fields'](_0x1c7206['query'][_0xe02c('0x3c')]));_0x299770[_0xe02c('0x3b')]=_0x299770[_0xe02c('0x3b')][_0xe02c('0x3d')]?_0x299770[_0xe02c('0x3b')]:_0x42f2fd[_0xe02c('0x37')];if(!_0x1c7206['query'][_0xe02c('0x3e')]('nolimit')){_0x299770['limit']=qs[_0xe02c('0x21')](_0x1c7206[_0xe02c('0x38')][_0xe02c('0x21')]);_0x299770[_0xe02c('0x1e')]=qs['offset'](_0x1c7206[_0xe02c('0x38')][_0xe02c('0x1e')]);}_0x299770['order']=qs[_0xe02c('0x40')](_0x1c7206[_0xe02c('0x38')]['sort']);_0x299770[_0xe02c('0x41')]=qs[_0xe02c('0x43')](_[_0xe02c('0x42')](_0x1c7206[_0xe02c('0x38')],_0x42f2fd[_0xe02c('0x43')]));if(_0x1c7206[_0xe02c('0x38')][_0xe02c('0x44')]){_0x299770['where']=_[_0xe02c('0x46')](_0x299770['where'],{'$or':_['map'](_0x299770['attributes'],function(_0x3a4dd3){var _0x9b3be5={};_0x9b3be5[_0x3a4dd3]={'$like':'%'+_0x1c7206[_0xe02c('0x38')][_0xe02c('0x44')]+'%'};return _0x9b3be5;})});}_0x299770['where']=_[_0xe02c('0x46')](_0x299770[_0xe02c('0x41')],{'mailboxuser':_0x47f61c['mailbox']});_0x299770=_['merge']({},_0x299770,_0x1c7206['options']);return db[_0xe02c('0x56')][_0xe02c('0x57')](_0x299770)['then'](respondWithFilteredResult(_0x446c71,_0x299770));})['catch'](handleError(_0x446c71,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 6c01443..5304945 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 _0x6d06=['./voiceMail.attributes','exports','voice_voicemail','mailbox','context','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x28ab82,_0x5c221f){var _0x46a08c=function(_0xcdba26){while(--_0xcdba26){_0x28ab82['push'](_0x28ab82['shift']());}};_0x46a08c(++_0x5c221f);}(_0x6d06,0xbb));var _0x66d0=function(_0x571a17,_0x63fb3d){_0x571a17=_0x571a17-0x0;var _0x3ef337=_0x6d06[_0x571a17];return _0x3ef337;};'use strict';var _=require(_0x66d0('0x0'));var util=require(_0x66d0('0x1'));var logger=require(_0x66d0('0x2'))(_0x66d0('0x3'));var moment=require('moment');var BPromise=require(_0x66d0('0x4'));var rp=require(_0x66d0('0x5'));var fs=require('fs');var path=require(_0x66d0('0x6'));var rimraf=require(_0x66d0('0x7'));var config=require('../../config/environment');var attributes=require(_0x66d0('0x8'));module[_0x66d0('0x9')]=function(_0x3c0bd5,_0x2e2bf5){return _0x3c0bd5['define']('VoiceMail',attributes,{'tableName':_0x66d0('0xa'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0x66d0('0xb'),_0x66d0('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x66c5=['util','../../config/logger','api','moment','request-promise','path','rimraf','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','mailbox_context','mailbox','context','lodash'];(function(_0x3fe393,_0x234a3a){var _0x534d14=function(_0x277fab){while(--_0x277fab){_0x3fe393['push'](_0x3fe393['shift']());}};_0x534d14(++_0x234a3a);}(_0x66c5,0x1df));var _0x566c=function(_0x1b70e3,_0x3a15b1){_0x1b70e3=_0x1b70e3-0x0;var _0x1452ab=_0x66c5[_0x1b70e3];return _0x1452ab;};'use strict';var _=require(_0x566c('0x0'));var util=require(_0x566c('0x1'));var logger=require(_0x566c('0x2'))(_0x566c('0x3'));var moment=require(_0x566c('0x4'));var BPromise=require('bluebird');var rp=require(_0x566c('0x5'));var fs=require('fs');var path=require(_0x566c('0x6'));var rimraf=require(_0x566c('0x7'));var config=require('../../config/environment');var attributes=require(_0x566c('0x8'));module[_0x566c('0x9')]=function(_0x1f9da8,_0x5c714d){return _0x1f9da8[_0x566c('0xa')](_0x566c('0xb'),attributes,{'tableName':_0x566c('0xc'),'paranoid':![],'indexes':[{'name':_0x566c('0xd'),'fields':[_0x566c('0xe'),_0x566c('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 fae5b53..308a500 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 _0x1be5=['rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','ioredis','../../mysqldb'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x1be5,0x1dc));var _0x51be=function(_0x7e3c22,_0x290d55){_0x7e3c22=_0x7e3c22-0x0;var _0x50250e=_0x1be5[_0x7e3c22];return _0x50250e;};'use strict';var _=require(_0x51be('0x0'));var util=require(_0x51be('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x51be('0x2'));var db=require(_0x51be('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x51be('0x4'));var config=require(_0x51be('0x5'));var jayson=require(_0x51be('0x6'));var client=jayson['client'][_0x51be('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5cb015,_0xeb1c61,_0x3564d3){return new BPromise(function(_0x3d0e9c,_0x2af46a){return client[_0x51be('0x8')](_0x5cb015,_0x3564d3)[_0x51be('0x9')](function(_0xa6277a){logger[_0x51be('0xa')](_0x51be('0xb'),_0xeb1c61,_0x51be('0xc'));logger['debug'](_0x51be('0xd'),_0xeb1c61,_0x51be('0xc'),JSON[_0x51be('0xe')](_0xa6277a));if(_0xa6277a[_0x51be('0xf')]){if(_0xa6277a[_0x51be('0xf')][_0x51be('0x10')]===0x1f4){logger[_0x51be('0xf')](_0x51be('0xb'),_0xeb1c61,_0xa6277a[_0x51be('0xf')]['message']);return _0x2af46a(_0xa6277a[_0x51be('0xf')][_0x51be('0x11')]);}logger[_0x51be('0xf')]('VoiceMail,\x20%s,\x20%s',_0xeb1c61,_0xa6277a[_0x51be('0xf')]['message']);return _0x3d0e9c(_0xa6277a['error']['message']);}else{logger[_0x51be('0xa')](_0x51be('0xb'),_0xeb1c61,_0x51be('0xc'));_0x3d0e9c(_0xa6277a[_0x51be('0x12')][_0x51be('0x11')]);}})[_0x51be('0x13')](function(_0x3caed0){logger[_0x51be('0xf')](_0x51be('0xb'),_0xeb1c61,_0x3caed0);_0x2af46a(_0x3caed0);});});} \ No newline at end of file +var _0xfeb3=['lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x1caea2,_0x4b926e){var _0x81cdd1=function(_0x4f5e5f){while(--_0x4f5e5f){_0x1caea2['push'](_0x1caea2['shift']());}};_0x81cdd1(++_0x4b926e);}(_0xfeb3,0xf2));var _0x3feb=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xfeb3[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x3feb('0x0'));var util=require(_0x3feb('0x1'));var moment=require('moment');var BPromise=require(_0x3feb('0x2'));var rs=require(_0x3feb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3feb('0x4'))['db'];var utils=require(_0x3feb('0x5'));var logger=require(_0x3feb('0x6'))('rpc');var config=require(_0x3feb('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3feb('0x8')][_0x3feb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x411ede,_0x118e3d,_0x5a1272){return new BPromise(function(_0x475587,_0x28d246){return client[_0x3feb('0xa')](_0x411ede,_0x5a1272)['then'](function(_0x5897d6){logger[_0x3feb('0xb')](_0x3feb('0xc'),_0x118e3d,_0x3feb('0xd'));logger[_0x3feb('0xe')](_0x3feb('0xf'),_0x118e3d,_0x3feb('0xd'),JSON[_0x3feb('0x10')](_0x5897d6));if(_0x5897d6[_0x3feb('0x11')]){if(_0x5897d6['error'][_0x3feb('0x12')]===0x1f4){logger[_0x3feb('0x11')]('VoiceMail,\x20%s,\x20%s',_0x118e3d,_0x5897d6[_0x3feb('0x11')][_0x3feb('0x13')]);return _0x28d246(_0x5897d6['error'][_0x3feb('0x13')]);}logger['error'](_0x3feb('0xc'),_0x118e3d,_0x5897d6[_0x3feb('0x11')][_0x3feb('0x13')]);return _0x475587(_0x5897d6[_0x3feb('0x11')][_0x3feb('0x13')]);}else{logger[_0x3feb('0xb')](_0x3feb('0xc'),_0x118e3d,'request\x20sent');_0x475587(_0x5897d6[_0x3feb('0x14')][_0x3feb('0x13')]);}})[_0x3feb('0x15')](function(_0x840a55){logger['error']('VoiceMail,\x20%s,\x20%s',_0x118e3d,_0x840a55);_0x28d246(_0x840a55);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 468ffb0..d7a90b8 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 _0xf19f=['get','isAuthenticated','index','show','/:id/download','download','post','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x16d369,_0xbbaa52){var _0x53c1ca=function(_0x49908d){while(--_0x49908d){_0x16d369['push'](_0x16d369['shift']());}};_0x53c1ca(++_0xbbaa52);}(_0xf19f,0x172));var _0xff19=function(_0x151721,_0x20d5bc){_0x151721=_0x151721-0x0;var _0x2deaa7=_0xf19f[_0x151721];return _0x2deaa7;};'use strict';var multer=require(_0xff19('0x0'));var util=require(_0xff19('0x1'));var path=require('path');var timeout=require(_0xff19('0x2'));var express=require(_0xff19('0x3'));var router=express[_0xff19('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xff19('0x5'));var interaction=require(_0xff19('0x6'));var config=require(_0xff19('0x7'));var controller=require('./voiceMailMessage.controller');router[_0xff19('0x8')]('/',auth[_0xff19('0x9')](),controller[_0xff19('0xa')]);router[_0xff19('0x8')]('/:id',auth[_0xff19('0x9')](),controller[_0xff19('0xb')]);router[_0xff19('0x8')](_0xff19('0xc'),auth[_0xff19('0x9')](),controller[_0xff19('0xd')]);router[_0xff19('0xe')]('/',auth[_0xff19('0x9')](),controller['create']);router[_0xff19('0xf')](_0xff19('0x10'),auth[_0xff19('0x9')](),controller[_0xff19('0x11')]);router[_0xff19('0x12')](_0xff19('0x10'),auth[_0xff19('0x9')](),controller[_0xff19('0x13')]);module[_0xff19('0x14')]=router; \ No newline at end of file +var _0x56af=['delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','put','update'];(function(_0x41b773,_0x344571){var _0x51e120=function(_0x30beaf){while(--_0x30beaf){_0x41b773['push'](_0x41b773['shift']());}};_0x51e120(++_0x344571);}(_0x56af,0xb3));var _0xf56a=function(_0x3c73d1,_0x2c5b98){_0x3c73d1=_0x3c73d1-0x0;var _0x200bba=_0x56af[_0x3c73d1];return _0x200bba;};'use strict';var multer=require('multer');var util=require(_0xf56a('0x0'));var path=require(_0xf56a('0x1'));var timeout=require(_0xf56a('0x2'));var express=require('express');var router=express[_0xf56a('0x3')]();var fs_extra=require(_0xf56a('0x4'));var auth=require(_0xf56a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf56a('0x6'));var controller=require(_0xf56a('0x7'));router[_0xf56a('0x8')]('/',auth[_0xf56a('0x9')](),controller[_0xf56a('0xa')]);router[_0xf56a('0x8')](_0xf56a('0xb'),auth[_0xf56a('0x9')](),controller[_0xf56a('0xc')]);router[_0xf56a('0x8')](_0xf56a('0xd'),auth[_0xf56a('0x9')](),controller[_0xf56a('0xe')]);router[_0xf56a('0xf')]('/',auth[_0xf56a('0x9')](),controller[_0xf56a('0x10')]);router[_0xf56a('0x11')](_0xf56a('0xb'),auth['isAuthenticated'](),controller[_0xf56a('0x12')]);router[_0xf56a('0x13')](_0xf56a('0xb'),auth[_0xf56a('0x9')](),controller[_0xf56a('0x14')]);module[_0xf56a('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 1ec6380..69cbe71 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 _0xddf5=['literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','VIRTUAL','INTEGER','STRING','BLOB','long','TIMESTAMP'];(function(_0xf7f60a,_0x15f736){var _0x2567ad=function(_0x396850){while(--_0x396850){_0xf7f60a['push'](_0xf7f60a['shift']());}};_0x2567ad(++_0x15f736);}(_0xddf5,0x84));var _0x5ddf=function(_0x339853,_0x1883cd){_0x339853=_0x339853-0x0;var _0x4825ad=_0xddf5[_0x339853];return _0x4825ad;};'use strict';var Sequelize=require(_0x5ddf('0x0'));module[_0x5ddf('0x1')]={'name':{'type':Sequelize[_0x5ddf('0x2')],'get':function(_0x5b9520){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize[_0x5ddf('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0x5ddf('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0x5ddf('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0x5ddf('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize[_0x5ddf('0x5')](_0x5ddf('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0x5ddf('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x5ddf('0x4')],'defaultValue':''},'stamp':{'type':_0x5ddf('0x7'),'defaultValue':Sequelize[_0x5ddf('0x8')](_0x5ddf('0x9'))}}; \ No newline at end of file +var _0xb5aa=['VIRTUAL','getDataValue','INTEGER','STRING','BLOB','long','TIMESTAMP','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP'];(function(_0x1f85df,_0xfff595){var _0x5d9bac=function(_0x5d92e4){while(--_0x5d92e4){_0x1f85df['push'](_0x1f85df['shift']());}};_0x5d9bac(++_0xfff595);}(_0xb5aa,0xc0));var _0xab5a=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xb5aa[_0x126558];return _0x1f6d14;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xab5a('0x0')],'get':function(_0x3bb85d){return this[_0xab5a('0x1')]('id');}},'msgnum':{'type':Sequelize[_0xab5a('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xab5a('0x3')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0xab5a('0x3')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize[_0xab5a('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xab5a('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xab5a('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0xab5a('0x4')](_0xab5a('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0xab5a('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0xab5a('0x6'),'defaultValue':Sequelize['literal'](_0xab5a('0x7'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 01f1b89..83f1bed 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 _0x913f=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','Content-Range','apply','reject','save','destroy','then','sendStatus','error','stack','name','send','index','map','VoiceMailMessage','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','filter','options','count','include','rows','catch','show','params','length','includeAll','find','create','update','body','recording','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','attachment','Content-Disposition','attachment;\x20filename=\x22','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs'];(function(_0x489c7b,_0x8a3862){var _0x2a85fb=function(_0x59ba69){while(--_0x59ba69){_0x489c7b['push'](_0x489c7b['shift']());}};_0x2a85fb(++_0x8a3862);}(_0x913f,0x9a));var _0xf913=function(_0x3d4a02,_0x4c5d8d){_0x3d4a02=_0x3d4a02-0x0;var _0x517c58=_0x913f[_0x3d4a02];return _0x517c58;};'use strict';var emlformat=require(_0xf913('0x0'));var rimraf=require(_0xf913('0x1'));var zipdir=require(_0xf913('0x2'));var jsonpatch=require(_0xf913('0x3'));var rp=require(_0xf913('0x4'));var moment=require('moment');var BPromise=require(_0xf913('0x5'));var Mustache=require(_0xf913('0x6'));var util=require('util');var path=require(_0xf913('0x7'));var sox=require(_0xf913('0x8'));var csv=require(_0xf913('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf913('0xa'));var _=require(_0xf913('0xb'));var squel=require(_0xf913('0xc'));var crypto=require(_0xf913('0xd'));var jsforce=require(_0xf913('0xe'));var deskjs=require(_0xf913('0xf'));var toCsv=require(_0xf913('0x9'));var querystring=require(_0xf913('0x10'));var Papa=require(_0xf913('0x11'));var Redis=require('ioredis');var authService=require(_0xf913('0x12'));var qs=require(_0xf913('0x13'));var as=require(_0xf913('0x14'));var hardwareService=require(_0xf913('0x15'));var logger=require('../../config/logger')(_0xf913('0x16'));var utils=require(_0xf913('0x17'));var config=require(_0xf913('0x18'));var licenseUtil=require(_0xf913('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4d39b5,_0x38b80f){_0x38b80f=_0x38b80f||0xcc;return function(_0x5cadc4){if(_0x5cadc4){return _0x4d39b5['sendStatus'](_0x38b80f);}return _0x4d39b5[_0xf913('0x1a')](_0x38b80f)[_0xf913('0x1b')]();};}function respondWithResult(_0x391517,_0x549c4b){_0x549c4b=_0x549c4b||0xc8;return function(_0x5488f0){if(_0x5488f0){return _0x391517[_0xf913('0x1a')](_0x549c4b)[_0xf913('0x1c')](_0x5488f0);}};}function respondWithFilteredResult(_0x2aaa5d,_0x6c1daf){return function(_0x19dfab){if(_0x19dfab){var _0x31cfa7=typeof _0x6c1daf[_0xf913('0x1d')]===_0xf913('0x1e')&&typeof _0x6c1daf[_0xf913('0x1f')]===_0xf913('0x1e');var _0x38e980=_0x19dfab['count'];var _0x3bb0cb=_0x31cfa7?0x0:_0x6c1daf['offset'];var _0x1c302a=_0x31cfa7?_0x19dfab['count']:_0x6c1daf[_0xf913('0x1d')]+_0x6c1daf['limit'];var _0x26b5bb;if(_0x1c302a>=_0x38e980){_0x1c302a=_0x38e980;_0x26b5bb=0xc8;}else{_0x26b5bb=0xce;}_0x2aaa5d[_0xf913('0x1a')](_0x26b5bb);return _0x2aaa5d['set'](_0xf913('0x20'),_0x3bb0cb+'-'+_0x1c302a+'/'+_0x38e980)[_0xf913('0x1c')](_0x19dfab);}return null;};}function patchUpdates(_0x1ca946){return function(_0xaa76bf){try{jsonpatch[_0xf913('0x21')](_0xaa76bf,_0x1ca946,!![]);}catch(_0x1aefaf){return BPromise[_0xf913('0x22')](_0x1aefaf);}return _0xaa76bf[_0xf913('0x23')]();};}function saveUpdates(_0x47f815,_0x72d16a){return function(_0x2142ae){if(_0x2142ae){return _0x2142ae['update'](_0x47f815)['then'](function(_0x176fbd){return _0x176fbd;});}return null;};}function removeEntity(_0x56ca03,_0x25ea2c){return function(_0x18391b){if(_0x18391b){return _0x18391b[_0xf913('0x24')]()[_0xf913('0x25')](function(){_0x56ca03[_0xf913('0x1a')](0xcc)[_0xf913('0x1b')]();});}};}function handleEntityNotFound(_0x3e5969,_0x5d8ca6){return function(_0x5e1a0e){if(!_0x5e1a0e){_0x3e5969[_0xf913('0x26')](0x194);}return _0x5e1a0e;};}function handleError(_0x31139f,_0x232d74){_0x232d74=_0x232d74||0x1f4;return function(_0x12444b){logger[_0xf913('0x27')](_0x12444b[_0xf913('0x28')]);if(_0x12444b['name']){delete _0x12444b[_0xf913('0x29')];}_0x31139f['status'](_0x232d74)[_0xf913('0x2a')](_0x12444b);};}exports[_0xf913('0x2b')]=function(_0x3d2d87,_0x4b0b46){var _0x267a1d={},_0x1894f2={},_0x4216be={'count':0x0,'rows':[]};var _0x5b93cf=_[_0xf913('0x2c')](db[_0xf913('0x2d')][_0xf913('0x2e')],function(_0x4c8c58){return{'name':_0x4c8c58[_0xf913('0x2f')],'type':_0x4c8c58[_0xf913('0x30')][_0xf913('0x31')]};});_0x1894f2[_0xf913('0x32')]=_[_0xf913('0x33')](_[_0xf913('0x2c')](_0x5b93cf,_0xf913('0x29')),[_0xf913('0x29')]);_0x1894f2[_0xf913('0x34')]=_[_0xf913('0x35')](_0x3d2d87[_0xf913('0x34')]);_0x1894f2['filters']=_[_0xf913('0x36')](_0x1894f2[_0xf913('0x32')],_0x1894f2['query']);_0x267a1d[_0xf913('0x37')]=_[_0xf913('0x36')](_0x1894f2[_0xf913('0x32')],qs['fields'](_0x3d2d87['query'][_0xf913('0x38')]));_0x267a1d[_0xf913('0x37')]=_0x267a1d[_0xf913('0x37')]['length']?_0x267a1d['attributes']:_0x1894f2[_0xf913('0x32')];if(!_0x3d2d87[_0xf913('0x34')][_0xf913('0x39')](_0xf913('0x3a'))){_0x267a1d['limit']=qs['limit'](_0x3d2d87[_0xf913('0x34')][_0xf913('0x1f')]);_0x267a1d['offset']=qs[_0xf913('0x1d')](_0x3d2d87['query'][_0xf913('0x1d')]);}_0x267a1d[_0xf913('0x3b')]=qs[_0xf913('0x3c')](_0x3d2d87[_0xf913('0x34')][_0xf913('0x3c')]);_0x267a1d[_0xf913('0x3d')]=qs[_0xf913('0x3e')](_[_0xf913('0x3f')](_0x3d2d87['query'],_0x1894f2[_0xf913('0x3e')]),_0x5b93cf);if(_0x3d2d87['query']['filter']){_0x267a1d[_0xf913('0x3d')]=_[_0xf913('0x40')](_0x267a1d[_0xf913('0x3d')],{'$or':_['map'](_0x5b93cf,function(_0x1e9467){if(_0x1e9467[_0xf913('0x30')]!=='VIRTUAL'){var _0x4e33da={};_0x4e33da[_0x1e9467['name']]={'$like':'%'+_0x3d2d87['query'][_0xf913('0x41')]+'%'};return _0x4e33da;}})});}_0x267a1d=_[_0xf913('0x40')]({},_0x267a1d,_0x3d2d87[_0xf913('0x42')]);var _0x3ad193={'where':_0x267a1d[_0xf913('0x3d')]};return db[_0xf913('0x2d')]['count'](_0x3ad193)[_0xf913('0x25')](function(_0x531798){_0x4216be[_0xf913('0x43')]=_0x531798;if(_0x3d2d87[_0xf913('0x34')]['includeAll']){_0x267a1d[_0xf913('0x44')]=[{'all':!![]}];}return db[_0xf913('0x2d')]['findAll'](_0x267a1d);})[_0xf913('0x25')](function(_0xcf6721){_0x4216be[_0xf913('0x45')]=_0xcf6721;return _0x4216be;})['then'](respondWithFilteredResult(_0x4b0b46,_0x267a1d))[_0xf913('0x46')](handleError(_0x4b0b46,null));};exports[_0xf913('0x47')]=function(_0xf04268,_0x5e3aa0){var _0x20a40={'raw':!![],'where':{'id':_0xf04268[_0xf913('0x48')]['id']}},_0x1e65cc={};_0x1e65cc[_0xf913('0x32')]=_[_0xf913('0x35')](db[_0xf913('0x2d')][_0xf913('0x2e')]);_0x1e65cc[_0xf913('0x34')]=_[_0xf913('0x35')](_0xf04268[_0xf913('0x34')]);_0x1e65cc['filters']=_[_0xf913('0x36')](_0x1e65cc[_0xf913('0x32')],_0x1e65cc[_0xf913('0x34')]);_0x20a40[_0xf913('0x37')]=_[_0xf913('0x36')](_0x1e65cc[_0xf913('0x32')],qs[_0xf913('0x38')](_0xf04268[_0xf913('0x34')][_0xf913('0x38')]));_0x20a40[_0xf913('0x37')]=_0x20a40[_0xf913('0x37')][_0xf913('0x49')]?_0x20a40[_0xf913('0x37')]:_0x1e65cc[_0xf913('0x32')];if(_0xf04268[_0xf913('0x34')][_0xf913('0x4a')]){_0x20a40[_0xf913('0x44')]=[{'all':!![]}];}_0x20a40=_[_0xf913('0x40')]({},_0x20a40,_0xf04268[_0xf913('0x42')]);return db[_0xf913('0x2d')][_0xf913('0x4b')](_0x20a40)[_0xf913('0x25')](handleEntityNotFound(_0x5e3aa0,null))['then'](respondWithResult(_0x5e3aa0,null))['catch'](handleError(_0x5e3aa0,null));};exports[_0xf913('0x4c')]=function(_0x591926,_0x319a41){return db[_0xf913('0x2d')]['create'](_0x591926['body'],{})['then'](respondWithResult(_0x319a41,0xc9))[_0xf913('0x46')](handleError(_0x319a41,null));};exports[_0xf913('0x4d')]=function(_0x1e25cb,_0x320e10){if(_0x1e25cb[_0xf913('0x4e')]['id']){delete _0x1e25cb[_0xf913('0x4e')]['id'];}return db[_0xf913('0x2d')][_0xf913('0x4b')]({'where':{'id':_0x1e25cb[_0xf913('0x48')]['id']}})[_0xf913('0x25')](handleEntityNotFound(_0x320e10,null))[_0xf913('0x25')](saveUpdates(_0x1e25cb[_0xf913('0x4e')],null))[_0xf913('0x25')](respondWithResult(_0x320e10,null))[_0xf913('0x46')](handleError(_0x320e10,null));};exports[_0xf913('0x24')]=function(_0x566896,_0x4c91d9){return db[_0xf913('0x2d')][_0xf913('0x4b')]({'where':{'id':_0x566896[_0xf913('0x48')]['id']}})['then'](handleEntityNotFound(_0x4c91d9,null))['then'](removeEntity(_0x4c91d9,null))['catch'](handleError(_0x4c91d9,null));};exports['download']=function(_0x5b4a5f,_0x3ea40a,_0x134fe9){return db['VoiceMailMessage'][_0xf913('0x4b')]({'where':{'id':_0x5b4a5f['params']['id']},'attributes':['id',_0xf913('0x4f'),_0xf913('0x50')]})[_0xf913('0x25')](handleEntityNotFound(_0x3ea40a,null))[_0xf913('0x25')](function(_0x3b2cc6){if(_0x3b2cc6){if(!_0x3b2cc6[_0xf913('0x4f')]){throw new db[(_0xf913('0x51'))][(_0xf913('0x52'))](_0xf913('0x53'));}var _0x235646={'Content-Type':'audio/wav','Content-Disposition':_0xf913('0x54')};if(_0x3b2cc6[_0xf913('0x50')]){_0x235646[_0xf913('0x55')]=_0xf913('0x56')+_0x3b2cc6['msg_id']+'.wav\x22';}_0x3ea40a['set'](_0x235646);return _0x3ea40a[_0xf913('0x2a')](new Buffer(_0x3b2cc6[_0xf913('0x4f')]));}})[_0xf913('0x46')](handleError(_0x3ea40a,null));}; \ No newline at end of file +var _0x0d5d=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','key','differenceBy','query','keys','filters','intersection','attributes','fields','length','model','nolimit','order','sort','where','filter','merge','type','options','VoiceMailMessage','rows','show','includeAll','include','catch','create','body','find','params','download','msg_id','recording','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','.wav\x22','eml-format','zip-dir','moment','bluebird','util','path','to-csv','ejs'];(function(_0x4916df,_0x11c178){var _0x18106c=function(_0x3abc9f){while(--_0x3abc9f){_0x4916df['push'](_0x4916df['shift']());}};_0x18106c(++_0x11c178);}(_0x0d5d,0x183));var _0xd0d5=function(_0xd7f96b,_0x53c959){_0xd7f96b=_0xd7f96b-0x0;var _0x5421cc=_0x0d5d[_0xd7f96b];return _0x5421cc;};'use strict';var emlformat=require(_0xd0d5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd0d5('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd0d5('0x2'));var BPromise=require(_0xd0d5('0x3'));var Mustache=require('mustache');var util=require(_0xd0d5('0x4'));var path=require(_0xd0d5('0x5'));var sox=require('sox');var csv=require(_0xd0d5('0x6'));var ejs=require(_0xd0d5('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd0d5('0x8'));var toCsv=require('to-csv');var querystring=require(_0xd0d5('0x9'));var Papa=require(_0xd0d5('0xa'));var Redis=require(_0xd0d5('0xb'));var authService=require(_0xd0d5('0xc'));var qs=require(_0xd0d5('0xd'));var as=require(_0xd0d5('0xe'));var hardwareService=require(_0xd0d5('0xf'));var logger=require('../../config/logger')(_0xd0d5('0x10'));var utils=require(_0xd0d5('0x11'));var config=require(_0xd0d5('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2847eb,_0x1a5402){_0x1a5402=_0x1a5402||0xcc;return function(_0x3a306b){if(_0x3a306b){return _0x2847eb[_0xd0d5('0x13')](_0x1a5402);}return _0x2847eb[_0xd0d5('0x14')](_0x1a5402)[_0xd0d5('0x15')]();};}function respondWithResult(_0x59ec37,_0x1b6dd5){_0x1b6dd5=_0x1b6dd5||0xc8;return function(_0xde4cdd){if(_0xde4cdd){return _0x59ec37[_0xd0d5('0x14')](_0x1b6dd5)[_0xd0d5('0x16')](_0xde4cdd);}};}function respondWithFilteredResult(_0x1fb6db,_0x4fad04){return function(_0xfebcc7){if(_0xfebcc7){var _0x57779e=typeof _0x4fad04[_0xd0d5('0x17')]===_0xd0d5('0x18')&&typeof _0x4fad04['limit']===_0xd0d5('0x18');var _0x34eabe=_0xfebcc7[_0xd0d5('0x19')];var _0x522c74=_0x57779e?0x0:_0x4fad04[_0xd0d5('0x17')];var _0x3c5809=_0x57779e?_0xfebcc7['count']:_0x4fad04[_0xd0d5('0x17')]+_0x4fad04[_0xd0d5('0x1a')];var _0x1c98a6;if(_0x3c5809>=_0x34eabe){_0x3c5809=_0x34eabe;_0x1c98a6=0xc8;}else{_0x1c98a6=0xce;}_0x1fb6db[_0xd0d5('0x14')](_0x1c98a6);return _0x1fb6db[_0xd0d5('0x1b')](_0xd0d5('0x1c'),_0x522c74+'-'+_0x3c5809+'/'+_0x34eabe)[_0xd0d5('0x16')](_0xfebcc7);}return null;};}function patchUpdates(_0x5b021a){return function(_0xa9f67b){try{jsonpatch[_0xd0d5('0x1d')](_0xa9f67b,_0x5b021a,!![]);}catch(_0x5b8071){return BPromise['reject'](_0x5b8071);}return _0xa9f67b[_0xd0d5('0x1e')]();};}function saveUpdates(_0x27e1b9,_0x4d51d9){return function(_0x1c32c6){if(_0x1c32c6){return _0x1c32c6[_0xd0d5('0x1f')](_0x27e1b9)[_0xd0d5('0x20')](function(_0x1fcf3c){return _0x1fcf3c;});}return null;};}function removeEntity(_0x16d862,_0x3691ef){return function(_0x322a2d){if(_0x322a2d){return _0x322a2d[_0xd0d5('0x21')]()['then'](function(){_0x16d862[_0xd0d5('0x14')](0xcc)[_0xd0d5('0x15')]();});}};}function handleEntityNotFound(_0x1ff02f,_0x1b76b5){return function(_0x400e79){if(!_0x400e79){_0x1ff02f[_0xd0d5('0x13')](0x194);}return _0x400e79;};}function handleError(_0x2293df,_0x414329){_0x414329=_0x414329||0x1f4;return function(_0x88a2e4){logger[_0xd0d5('0x22')](_0x88a2e4[_0xd0d5('0x23')]);if(_0x88a2e4[_0xd0d5('0x24')]){delete _0x88a2e4['name'];}_0x2293df[_0xd0d5('0x14')](_0x414329)[_0xd0d5('0x25')](_0x88a2e4);};}exports[_0xd0d5('0x26')]=function(_0x4f01fa,_0x36d6e1){var _0x404af0={},_0x82aaf5={},_0x503ce6={'count':0x0,'rows':[]};var _0xd57505=_[_0xd0d5('0x27')](db['VoiceMailMessage'][_0xd0d5('0x28')],function(_0x20684a){return{'name':_0x20684a[_0xd0d5('0x29')],'type':_0x20684a['type'][_0xd0d5('0x2a')]};});_0x82aaf5['model']=_[_0xd0d5('0x2b')](_[_0xd0d5('0x27')](_0xd57505,_0xd0d5('0x24')),['name']);_0x82aaf5[_0xd0d5('0x2c')]=_[_0xd0d5('0x2d')](_0x4f01fa[_0xd0d5('0x2c')]);_0x82aaf5[_0xd0d5('0x2e')]=_[_0xd0d5('0x2f')](_0x82aaf5['model'],_0x82aaf5['query']);_0x404af0[_0xd0d5('0x30')]=_[_0xd0d5('0x2f')](_0x82aaf5['model'],qs[_0xd0d5('0x31')](_0x4f01fa[_0xd0d5('0x2c')][_0xd0d5('0x31')]));_0x404af0[_0xd0d5('0x30')]=_0x404af0['attributes'][_0xd0d5('0x32')]?_0x404af0[_0xd0d5('0x30')]:_0x82aaf5[_0xd0d5('0x33')];if(!_0x4f01fa['query']['hasOwnProperty'](_0xd0d5('0x34'))){_0x404af0[_0xd0d5('0x1a')]=qs[_0xd0d5('0x1a')](_0x4f01fa[_0xd0d5('0x2c')]['limit']);_0x404af0[_0xd0d5('0x17')]=qs[_0xd0d5('0x17')](_0x4f01fa['query']['offset']);}_0x404af0[_0xd0d5('0x35')]=qs[_0xd0d5('0x36')](_0x4f01fa['query'][_0xd0d5('0x36')]);_0x404af0[_0xd0d5('0x37')]=qs[_0xd0d5('0x2e')](_['pick'](_0x4f01fa[_0xd0d5('0x2c')],_0x82aaf5[_0xd0d5('0x2e')]),_0xd57505);if(_0x4f01fa['query'][_0xd0d5('0x38')]){_0x404af0[_0xd0d5('0x37')]=_[_0xd0d5('0x39')](_0x404af0[_0xd0d5('0x37')],{'$or':_[_0xd0d5('0x27')](_0xd57505,function(_0x5c4b2f){if(_0x5c4b2f[_0xd0d5('0x3a')]!=='VIRTUAL'){var _0x55eaea={};_0x55eaea[_0x5c4b2f[_0xd0d5('0x24')]]={'$like':'%'+_0x4f01fa['query'][_0xd0d5('0x38')]+'%'};return _0x55eaea;}})});}_0x404af0=_[_0xd0d5('0x39')]({},_0x404af0,_0x4f01fa[_0xd0d5('0x3b')]);var _0x6fab26={'where':_0x404af0[_0xd0d5('0x37')]};return db[_0xd0d5('0x3c')]['count'](_0x6fab26)[_0xd0d5('0x20')](function(_0x5ef933){_0x503ce6[_0xd0d5('0x19')]=_0x5ef933;if(_0x4f01fa[_0xd0d5('0x2c')]['includeAll']){_0x404af0['include']=[{'all':!![]}];}return db[_0xd0d5('0x3c')]['findAll'](_0x404af0);})[_0xd0d5('0x20')](function(_0x2e997c){_0x503ce6[_0xd0d5('0x3d')]=_0x2e997c;return _0x503ce6;})[_0xd0d5('0x20')](respondWithFilteredResult(_0x36d6e1,_0x404af0))['catch'](handleError(_0x36d6e1,null));};exports[_0xd0d5('0x3e')]=function(_0xe6de8b,_0x4c6ebe){var _0xab5753={'raw':!![],'where':{'id':_0xe6de8b['params']['id']}},_0x1e66c9={};_0x1e66c9[_0xd0d5('0x33')]=_[_0xd0d5('0x2d')](db['VoiceMailMessage'][_0xd0d5('0x28')]);_0x1e66c9[_0xd0d5('0x2c')]=_[_0xd0d5('0x2d')](_0xe6de8b[_0xd0d5('0x2c')]);_0x1e66c9[_0xd0d5('0x2e')]=_[_0xd0d5('0x2f')](_0x1e66c9[_0xd0d5('0x33')],_0x1e66c9[_0xd0d5('0x2c')]);_0xab5753[_0xd0d5('0x30')]=_[_0xd0d5('0x2f')](_0x1e66c9[_0xd0d5('0x33')],qs[_0xd0d5('0x31')](_0xe6de8b[_0xd0d5('0x2c')][_0xd0d5('0x31')]));_0xab5753['attributes']=_0xab5753[_0xd0d5('0x30')][_0xd0d5('0x32')]?_0xab5753['attributes']:_0x1e66c9['model'];if(_0xe6de8b[_0xd0d5('0x2c')][_0xd0d5('0x3f')]){_0xab5753[_0xd0d5('0x40')]=[{'all':!![]}];}_0xab5753=_[_0xd0d5('0x39')]({},_0xab5753,_0xe6de8b[_0xd0d5('0x3b')]);return db[_0xd0d5('0x3c')]['find'](_0xab5753)[_0xd0d5('0x20')](handleEntityNotFound(_0x4c6ebe,null))['then'](respondWithResult(_0x4c6ebe,null))[_0xd0d5('0x41')](handleError(_0x4c6ebe,null));};exports[_0xd0d5('0x42')]=function(_0xfdc7af,_0x88769d){return db[_0xd0d5('0x3c')][_0xd0d5('0x42')](_0xfdc7af[_0xd0d5('0x43')],{})[_0xd0d5('0x20')](respondWithResult(_0x88769d,0xc9))[_0xd0d5('0x41')](handleError(_0x88769d,null));};exports['update']=function(_0x580994,_0xf024f8){if(_0x580994[_0xd0d5('0x43')]['id']){delete _0x580994[_0xd0d5('0x43')]['id'];}return db[_0xd0d5('0x3c')][_0xd0d5('0x44')]({'where':{'id':_0x580994['params']['id']}})[_0xd0d5('0x20')](handleEntityNotFound(_0xf024f8,null))[_0xd0d5('0x20')](saveUpdates(_0x580994[_0xd0d5('0x43')],null))[_0xd0d5('0x20')](respondWithResult(_0xf024f8,null))[_0xd0d5('0x41')](handleError(_0xf024f8,null));};exports['destroy']=function(_0x5414c5,_0x39696b){return db[_0xd0d5('0x3c')]['find']({'where':{'id':_0x5414c5[_0xd0d5('0x45')]['id']}})[_0xd0d5('0x20')](handleEntityNotFound(_0x39696b,null))[_0xd0d5('0x20')](removeEntity(_0x39696b,null))[_0xd0d5('0x41')](handleError(_0x39696b,null));};exports[_0xd0d5('0x46')]=function(_0x190a28,_0x4ad2c0,_0x269530){return db['VoiceMailMessage']['find']({'where':{'id':_0x190a28['params']['id']},'attributes':['id','recording',_0xd0d5('0x47')]})[_0xd0d5('0x20')](handleEntityNotFound(_0x4ad2c0,null))[_0xd0d5('0x20')](function(_0x4075ab){if(_0x4075ab){if(!_0x4075ab[_0xd0d5('0x48')]){throw new db[(_0xd0d5('0x49'))][(_0xd0d5('0x4a'))](_0xd0d5('0x4b'));}var _0x3c13fd={'Content-Type':_0xd0d5('0x4c'),'Content-Disposition':_0xd0d5('0x4d')};if(_0x4075ab[_0xd0d5('0x47')]){_0x3c13fd['Content-Disposition']='attachment;\x20filename=\x22'+_0x4075ab['msg_id']+_0xd0d5('0x4e');}_0x4ad2c0[_0xd0d5('0x1b')](_0x3c13fd);return _0x4ad2c0['send'](new Buffer(_0x4075ab[_0xd0d5('0x48')]));}})[_0xd0d5('0x41')](handleError(_0x4ad2c0,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index cb36df3..4760033 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 _0xb06b=['rimraf','../../config/environment','./voiceMailMessage.attributes','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x570b34,_0x537c5c){var _0x325f61=function(_0x3dfca6){while(--_0x3dfca6){_0x570b34['push'](_0x570b34['shift']());}};_0x325f61(++_0x537c5c);}(_0xb06b,0xd9));var _0xbb06=function(_0x4cc7e2,_0x1e8ce1){_0x4cc7e2=_0x4cc7e2-0x0;var _0x35f19b=_0xb06b[_0x4cc7e2];return _0x35f19b;};'use strict';var _=require(_0xbb06('0x0'));var util=require('util');var logger=require(_0xbb06('0x1'))(_0xbb06('0x2'));var moment=require(_0xbb06('0x3'));var BPromise=require(_0xbb06('0x4'));var rp=require(_0xbb06('0x5'));var fs=require('fs');var path=require(_0xbb06('0x6'));var rimraf=require(_0xbb06('0x7'));var config=require(_0xbb06('0x8'));var attributes=require(_0xbb06('0x9'));module['exports']=function(_0x66566d,_0x28d5cc){return _0x66566d[_0xbb06('0xa')](_0xbb06('0xb'),attributes,{'tableName':_0xbb06('0xc'),'paranoid':![],'indexes':[{'name':_0xbb06('0xd'),'fields':[_0xbb06('0xd')]}],'timestamps':![]});}; \ No newline at end of file +var _0xe204=['rimraf','../../config/environment','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','dir','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x4a1fe4,_0x1dfa5b){var _0x4e4294=function(_0x53d79d){while(--_0x53d79d){_0x4a1fe4['push'](_0x4a1fe4['shift']());}};_0x4e4294(++_0x1dfa5b);}(_0xe204,0x11f));var _0x4e20=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xe204[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x4e20('0x0'));var util=require(_0x4e20('0x1'));var logger=require(_0x4e20('0x2'))(_0x4e20('0x3'));var moment=require(_0x4e20('0x4'));var BPromise=require('bluebird');var rp=require(_0x4e20('0x5'));var fs=require('fs');var path=require(_0x4e20('0x6'));var rimraf=require(_0x4e20('0x7'));var config=require(_0x4e20('0x8'));var attributes=require(_0x4e20('0x9'));module[_0x4e20('0xa')]=function(_0x2e5952,_0x2167ab){return _0x2e5952[_0x4e20('0xb')](_0x4e20('0xc'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0x4e20('0xd'),'fields':['dir']}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 23cc6c1..1f4fbd4 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 _0xc6dc=['then','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request'];(function(_0x4503df,_0xfec122){var _0x3f1b2b=function(_0x32b1de){while(--_0x32b1de){_0x4503df['push'](_0x4503df['shift']());}};_0x3f1b2b(++_0xfec122);}(_0xc6dc,0x15e));var _0xcc6d=function(_0x6d0904,_0x5c881f){_0x6d0904=_0x6d0904-0x0;var _0x9adefb=_0xc6dc[_0x6d0904];return _0x9adefb;};'use strict';var _=require('lodash');var util=require(_0xcc6d('0x0'));var moment=require(_0xcc6d('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcc6d('0x2'));var db=require(_0xcc6d('0x3'))['db'];var utils=require(_0xcc6d('0x4'));var logger=require(_0xcc6d('0x5'))('rpc');var config=require(_0xcc6d('0x6'));var jayson=require(_0xcc6d('0x7'));var client=jayson['client'][_0xcc6d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x517116,_0x8d155c,_0x4b593b){return new BPromise(function(_0x5bccec,_0x5b83f7){return client[_0xcc6d('0x9')](_0x517116,_0x4b593b)[_0xcc6d('0xa')](function(_0x34ccc8){logger['info'](_0xcc6d('0xb'),_0x8d155c,_0xcc6d('0xc'));logger[_0xcc6d('0xd')](_0xcc6d('0xe'),_0x8d155c,_0xcc6d('0xc'),JSON['stringify'](_0x34ccc8));if(_0x34ccc8[_0xcc6d('0xf')]){if(_0x34ccc8[_0xcc6d('0xf')][_0xcc6d('0x10')]===0x1f4){logger[_0xcc6d('0xf')](_0xcc6d('0xb'),_0x8d155c,_0x34ccc8[_0xcc6d('0xf')][_0xcc6d('0x11')]);return _0x5b83f7(_0x34ccc8[_0xcc6d('0xf')][_0xcc6d('0x11')]);}logger[_0xcc6d('0xf')]('VoiceMailMessage,\x20%s,\x20%s',_0x8d155c,_0x34ccc8[_0xcc6d('0xf')]['message']);return _0x5bccec(_0x34ccc8[_0xcc6d('0xf')][_0xcc6d('0x11')]);}else{logger['info']('VoiceMailMessage,\x20%s,\x20%s',_0x8d155c,_0xcc6d('0xc'));_0x5bccec(_0x34ccc8[_0xcc6d('0x12')]['message']);}})[_0xcc6d('0x13')](function(_0x1bb7b2){logger[_0xcc6d('0xf')]('VoiceMailMessage,\x20%s,\x20%s',_0x8d155c,_0x1bb7b2);_0x5b83f7(_0x1bb7b2);});});} \ No newline at end of file +var _0xd337=['../../config/environment','jayson/promise','client','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc'];(function(_0x3dcf7d,_0x57a28d){var _0x3cff50=function(_0x49f381){while(--_0x49f381){_0x3dcf7d['push'](_0x3dcf7d['shift']());}};_0x3cff50(++_0x57a28d);}(_0xd337,0x9a));var _0x7d33=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd337[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x7d33('0x0'));var moment=require(_0x7d33('0x1'));var BPromise=require(_0x7d33('0x2'));var rs=require(_0x7d33('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7d33('0x4'));var logger=require(_0x7d33('0x5'))(_0x7d33('0x6'));var config=require(_0x7d33('0x7'));var jayson=require(_0x7d33('0x8'));var client=jayson[_0x7d33('0x9')][_0x7d33('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x147670,_0x2ca5b6,_0x539016){return new BPromise(function(_0x1eb3f0,_0xe3bc38){return client[_0x7d33('0xb')](_0x147670,_0x539016)[_0x7d33('0xc')](function(_0x22ccbe){logger[_0x7d33('0xd')](_0x7d33('0xe'),_0x2ca5b6,_0x7d33('0xf'));logger['debug'](_0x7d33('0x10'),_0x2ca5b6,'request\x20sent',JSON[_0x7d33('0x11')](_0x22ccbe));if(_0x22ccbe[_0x7d33('0x12')]){if(_0x22ccbe[_0x7d33('0x12')][_0x7d33('0x13')]===0x1f4){logger[_0x7d33('0x12')]('VoiceMailMessage,\x20%s,\x20%s',_0x2ca5b6,_0x22ccbe['error'][_0x7d33('0x14')]);return _0xe3bc38(_0x22ccbe[_0x7d33('0x12')][_0x7d33('0x14')]);}logger[_0x7d33('0x12')](_0x7d33('0xe'),_0x2ca5b6,_0x22ccbe['error'][_0x7d33('0x14')]);return _0x1eb3f0(_0x22ccbe[_0x7d33('0x12')]['message']);}else{logger[_0x7d33('0xd')](_0x7d33('0xe'),_0x2ca5b6,'request\x20sent');_0x1eb3f0(_0x22ccbe[_0x7d33('0x15')][_0x7d33('0x14')]);}})[_0x7d33('0x16')](function(_0x15a761){logger['error'](_0x7d33('0xe'),_0x2ca5b6,_0x15a761);_0xe3bc38(_0x15a761);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 928a6ad..1646bab 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 _0x56a4=['fs-extra','../../components/auth/service','./voiceMusicOnHold.controller','get','isAuthenticated','index','post','/:id/sounds','put','/:id','update','delete','destroy','/:id/sounds/:id2','removeSound','exports','multer','util','path','express','Router'];(function(_0x119d5a,_0x19b457){var _0x15bff4=function(_0x1b7c78){while(--_0x1b7c78){_0x119d5a['push'](_0x119d5a['shift']());}};_0x15bff4(++_0x19b457);}(_0x56a4,0xcd));var _0x456a=function(_0x2d2949,_0x24c559){_0x2d2949=_0x2d2949-0x0;var _0x4bb11f=_0x56a4[_0x2d2949];return _0x4bb11f;};'use strict';var multer=require(_0x456a('0x0'));var util=require(_0x456a('0x1'));var path=require(_0x456a('0x2'));var timeout=require('connect-timeout');var express=require(_0x456a('0x3'));var router=express[_0x456a('0x4')]();var fs_extra=require(_0x456a('0x5'));var auth=require(_0x456a('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x456a('0x7'));router[_0x456a('0x8')]('/',auth[_0x456a('0x9')](),controller[_0x456a('0xa')]);router[_0x456a('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x456a('0x8')]('/:id/sounds',auth[_0x456a('0x9')](),controller['getSounds']);router[_0x456a('0xb')]('/',auth[_0x456a('0x9')](),controller['create']);router[_0x456a('0xb')](_0x456a('0xc'),auth['isAuthenticated'](),controller['addSound']);router[_0x456a('0xd')](_0x456a('0xe'),auth[_0x456a('0x9')](),controller[_0x456a('0xf')]);router[_0x456a('0x10')](_0x456a('0xe'),auth[_0x456a('0x9')](),controller[_0x456a('0x11')]);router['delete'](_0x456a('0x12'),auth[_0x456a('0x9')](),controller[_0x456a('0x13')]);module[_0x456a('0x14')]=router; \ No newline at end of file +var _0x161d=['../../components/auth/service','../../config/environment','./voiceMusicOnHold.controller','isAuthenticated','get','/:id','show','/:id/sounds','create','addSound','update','delete','removeSound','exports','util','path','connect-timeout','express','Router'];(function(_0x4f49bf,_0x6d06a9){var _0x240456=function(_0x34317a){while(--_0x34317a){_0x4f49bf['push'](_0x4f49bf['shift']());}};_0x240456(++_0x6d06a9);}(_0x161d,0x1d6));var _0xd161=function(_0x2fb2ff,_0x36b6bf){_0x2fb2ff=_0x2fb2ff-0x0;var _0xd29713=_0x161d[_0x2fb2ff];return _0xd29713;};'use strict';var multer=require('multer');var util=require(_0xd161('0x0'));var path=require(_0xd161('0x1'));var timeout=require(_0xd161('0x2'));var express=require(_0xd161('0x3'));var router=express[_0xd161('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd161('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd161('0x6'));var controller=require(_0xd161('0x7'));router['get']('/',auth[_0xd161('0x8')](),controller['index']);router[_0xd161('0x9')](_0xd161('0xa'),auth[_0xd161('0x8')](),controller[_0xd161('0xb')]);router[_0xd161('0x9')](_0xd161('0xc'),auth[_0xd161('0x8')](),controller['getSounds']);router['post']('/',auth['isAuthenticated'](),controller[_0xd161('0xd')]);router['post']('/:id/sounds',auth['isAuthenticated'](),controller[_0xd161('0xe')]);router['put']('/:id',auth[_0xd161('0x8')](),controller[_0xd161('0xf')]);router['delete'](_0xd161('0xa'),auth['isAuthenticated'](),controller['destroy']);router[_0xd161('0x10')]('/:id/sounds/:id2',auth[_0xd161('0x8')](),controller[_0xd161('0x11')]);module[_0xd161('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index a2468a3..9b6674a 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 _0x678a=['mp3nb','quietmp3nb','quietmp3','mp3','TIMESTAMP','BOOLEAN','exports','STRING','name','ENUM','custom','files'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x678a,0xde));var _0xa678=function(_0x3b05ae,_0x4d639b){_0x3b05ae=_0x3b05ae-0x0;var _0x460eef=_0x678a[_0x3b05ae];return _0x460eef;};'use strict';var Sequelize=require('sequelize');module[_0xa678('0x0')]={'name':{'type':Sequelize[_0xa678('0x1')],'allowNull':![],'unique':_0xa678('0x2')},'mode':{'type':Sequelize[_0xa678('0x3')](_0xa678('0x4'),_0xa678('0x5'),_0xa678('0x6'),_0xa678('0x7'),_0xa678('0x8'),_0xa678('0x9')),'allowNull':!![],'defaultValue':_0xa678('0x5')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0xa678('0x1')],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize[_0xa678('0x1')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0xa678('0x1')],'allowNull':!![]},'stamp':{'type':_0xa678('0xa')},'defaultEntry':{'type':Sequelize[_0xa678('0xb')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd5b8=['STRING','name','mp3nb','quietmp3nb','mp3','files','alpha','TIMESTAMP','BOOLEAN','exports'];(function(_0x587eb6,_0x677fcb){var _0x3405ba=function(_0x187f5f){while(--_0x187f5f){_0x587eb6['push'](_0x587eb6['shift']());}};_0x3405ba(++_0x677fcb);}(_0xd5b8,0x1e9));var _0x8d5b=function(_0x3c772b,_0x4f909f){_0x3c772b=_0x3c772b-0x0;var _0x4f7bbd=_0xd5b8[_0x3c772b];return _0x4f7bbd;};'use strict';var Sequelize=require('sequelize');module[_0x8d5b('0x0')]={'name':{'type':Sequelize[_0x8d5b('0x1')],'allowNull':![],'unique':_0x8d5b('0x2')},'mode':{'type':Sequelize['ENUM']('custom','files',_0x8d5b('0x3'),_0x8d5b('0x4'),'quietmp3',_0x8d5b('0x5')),'allowNull':!![],'defaultValue':_0x8d5b('0x6')},'directory':{'type':Sequelize[_0x8d5b('0x1')],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize[_0x8d5b('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0x8d5b('0x1')],'allowNull':!![],'defaultValue':_0x8d5b('0x7')},'format':{'type':Sequelize[_0x8d5b('0x1')],'allowNull':!![]},'stamp':{'type':_0x8d5b('0x8')},'defaultEntry':{'type':Sequelize[_0x8d5b('0x9')],'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 bcc7fee..372e770 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 _0xedbf=['sequelize','transaction','directory','root','server/files/moh','create','files','mkdirSync','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','MusicOnHolds','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','unlinkSync','join','Sequelize','ValidationError','message','addSound','Sound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','format','%s.%s','basename','symlinkSync','removeSound','id2','getSounds','rawAttributes','pick','rimraf','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','name','index','VoiceMusicOnHold','fieldName','type','key','map','query','keys','filters','attributes','intersection','model','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','length','find','update','body'];(function(_0x5b1490,_0x96d186){var _0x1c615c=function(_0x4250a0){while(--_0x4250a0){_0x5b1490['push'](_0x5b1490['shift']());}};_0x1c615c(++_0x96d186);}(_0xedbf,0x172));var _0xfedb=function(_0x55c99e,_0x46d478){_0x55c99e=_0x55c99e-0x0;var _0x5a89be=_0xedbf[_0x55c99e];return _0x5a89be;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfedb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfedb('0x1'));var rp=require(_0xfedb('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xfedb('0x3'));var util=require(_0xfedb('0x4'));var path=require('path');var sox=require(_0xfedb('0x5'));var csv=require(_0xfedb('0x6'));var ejs=require(_0xfedb('0x7'));var fs=require('fs');var fs_extra=require(_0xfedb('0x8'));var _=require(_0xfedb('0x9'));var squel=require(_0xfedb('0xa'));var crypto=require(_0xfedb('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xfedb('0x6'));var querystring=require(_0xfedb('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xfedb('0xd'));var qs=require(_0xfedb('0xe'));var as=require(_0xfedb('0xf'));var hardwareService=require(_0xfedb('0x10'));var logger=require(_0xfedb('0x11'))('api');var utils=require(_0xfedb('0x12'));var config=require(_0xfedb('0x13'));var licenseUtil=require(_0xfedb('0x14'));var db=require(_0xfedb('0x15'))['db'];function respondWithStatusCode(_0x449107,_0x1e8005){_0x1e8005=_0x1e8005||0xcc;return function(_0x34bb5d){if(_0x34bb5d){return _0x449107[_0xfedb('0x16')](_0x1e8005);}return _0x449107['status'](_0x1e8005)[_0xfedb('0x17')]();};}function respondWithResult(_0x169a4c,_0x3df4e7){_0x3df4e7=_0x3df4e7||0xc8;return function(_0x4dcfd7){if(_0x4dcfd7){return _0x169a4c[_0xfedb('0x18')](_0x3df4e7)[_0xfedb('0x19')](_0x4dcfd7);}};}function respondWithFilteredResult(_0x4516bc,_0x3acbc8){return function(_0x3f23ca){if(_0x3f23ca){var _0x29914f=typeof _0x3acbc8[_0xfedb('0x1a')]===_0xfedb('0x1b')&&typeof _0x3acbc8[_0xfedb('0x1c')]===_0xfedb('0x1b');var _0x35627b=_0x3f23ca[_0xfedb('0x1d')];var _0x3f4b1b=_0x29914f?0x0:_0x3acbc8['offset'];var _0x387e4a=_0x29914f?_0x3f23ca[_0xfedb('0x1d')]:_0x3acbc8[_0xfedb('0x1a')]+_0x3acbc8[_0xfedb('0x1c')];var _0x98f3ec;if(_0x387e4a>=_0x35627b){_0x387e4a=_0x35627b;_0x98f3ec=0xc8;}else{_0x98f3ec=0xce;}_0x4516bc[_0xfedb('0x18')](_0x98f3ec);return _0x4516bc[_0xfedb('0x1e')](_0xfedb('0x1f'),_0x3f4b1b+'-'+_0x387e4a+'/'+_0x35627b)[_0xfedb('0x19')](_0x3f23ca);}return null;};}function patchUpdates(_0x649b4e){return function(_0x2d4165){try{jsonpatch[_0xfedb('0x20')](_0x2d4165,_0x649b4e,!![]);}catch(_0xe2e41){return BPromise[_0xfedb('0x21')](_0xe2e41);}return _0x2d4165[_0xfedb('0x22')]();};}function saveUpdates(_0x3d2810,_0x13277a){return function(_0x120d86){if(_0x120d86){return _0x120d86['update'](_0x3d2810)[_0xfedb('0x23')](function(_0xd90fa7){return _0xd90fa7;});}return null;};}function removeEntity(_0x16fafa,_0x15d75b){return function(_0x4168f1){if(_0x4168f1){return _0x4168f1[_0xfedb('0x24')]()[_0xfedb('0x23')](function(){var _0x39816d=_0x4168f1['get']({'plain':!![]});var _0x2d4182='MusicOnHolds';return db['UserProfileResource'][_0xfedb('0x24')]({'where':{'type':_0x2d4182,'resourceId':_0x39816d['id']}})[_0xfedb('0x23')](function(){return _0x4168f1;});})[_0xfedb('0x23')](function(){_0x16fafa['status'](0xcc)[_0xfedb('0x17')]();});}};}function handleEntityNotFound(_0x28d37a,_0x7f1cda){return function(_0x4c68ab){if(!_0x4c68ab){_0x28d37a['sendStatus'](0x194);}return _0x4c68ab;};}function handleError(_0x4e68cf,_0x9f1127){_0x9f1127=_0x9f1127||0x1f4;return function(_0x368e67){logger['error'](_0x368e67['stack']);if(_0x368e67['name']){delete _0x368e67[_0xfedb('0x25')];}_0x4e68cf[_0xfedb('0x18')](_0x9f1127)['send'](_0x368e67);};}exports[_0xfedb('0x26')]=function(_0x502fe2,_0x2488c6){var _0x207922={},_0x253fc6={},_0x147a43={'count':0x0,'rows':[]};var _0x5c1b29=_['map'](db[_0xfedb('0x27')]['rawAttributes'],function(_0x1232c6){return{'name':_0x1232c6[_0xfedb('0x28')],'type':_0x1232c6[_0xfedb('0x29')][_0xfedb('0x2a')]};});_0x253fc6['model']=_[_0xfedb('0x2b')](_0x5c1b29,'name');_0x253fc6[_0xfedb('0x2c')]=_[_0xfedb('0x2d')](_0x502fe2[_0xfedb('0x2c')]);_0x253fc6[_0xfedb('0x2e')]=_['intersection'](_0x253fc6['model'],_0x253fc6[_0xfedb('0x2c')]);_0x207922[_0xfedb('0x2f')]=_[_0xfedb('0x30')](_0x253fc6[_0xfedb('0x31')],qs[_0xfedb('0x32')](_0x502fe2['query']['fields']));_0x207922[_0xfedb('0x2f')]=_0x207922[_0xfedb('0x2f')]['length']?_0x207922['attributes']:_0x253fc6['model'];if(!_0x502fe2[_0xfedb('0x2c')][_0xfedb('0x33')](_0xfedb('0x34'))){_0x207922[_0xfedb('0x1c')]=qs[_0xfedb('0x1c')](_0x502fe2[_0xfedb('0x2c')][_0xfedb('0x1c')]);_0x207922[_0xfedb('0x1a')]=qs[_0xfedb('0x1a')](_0x502fe2[_0xfedb('0x2c')]['offset']);}_0x207922[_0xfedb('0x35')]=qs[_0xfedb('0x36')](_0x502fe2[_0xfedb('0x2c')]['sort']);delete _0x502fe2[_0xfedb('0x2c')][_0xfedb('0x36')];_0x207922['where']=qs['filters'](_['pick'](_0x502fe2[_0xfedb('0x2c')],_0x253fc6[_0xfedb('0x2e')]),_0x5c1b29);if(_0x502fe2[_0xfedb('0x2c')][_0xfedb('0x37')]){_0x207922[_0xfedb('0x38')]=_[_0xfedb('0x39')](_0x207922[_0xfedb('0x38')],{'$or':_[_0xfedb('0x2b')](_0x5c1b29,function(_0x4de610){if(_0x4de610[_0xfedb('0x29')]!==_0xfedb('0x3a')){var _0x155524={};_0x155524[_0x4de610[_0xfedb('0x25')]]={'$like':'%'+_0x502fe2['query'][_0xfedb('0x37')]+'%'};return _0x155524;}})});}_0x207922=_[_0xfedb('0x39')]({},_0x207922,_0x502fe2[_0xfedb('0x3b')]);var _0x20f22f={'where':_0x207922['where']};return db[_0xfedb('0x27')][_0xfedb('0x1d')](_0x20f22f)['then'](function(_0x2b5aa5){_0x147a43[_0xfedb('0x1d')]=_0x2b5aa5;if(_0x502fe2[_0xfedb('0x2c')][_0xfedb('0x3c')]){_0x207922[_0xfedb('0x3d')]=[{'all':!![]}];}return db[_0xfedb('0x27')][_0xfedb('0x3e')](_0x207922);})[_0xfedb('0x23')](function(_0x3db57a){_0x147a43['rows']=_0x3db57a;return _0x147a43;})['then'](respondWithFilteredResult(_0x2488c6,_0x207922))[_0xfedb('0x3f')](handleError(_0x2488c6,null));};exports[_0xfedb('0x40')]=function(_0x4f1ccc,_0x5525cb){var _0x5c375b={'raw':![],'where':{'id':_0x4f1ccc[_0xfedb('0x41')]['id']}},_0x21d85a={};_0x21d85a[_0xfedb('0x31')]=_[_0xfedb('0x2d')](db[_0xfedb('0x27')]['rawAttributes']);_0x21d85a[_0xfedb('0x2c')]=_[_0xfedb('0x2d')](_0x4f1ccc[_0xfedb('0x2c')]);_0x21d85a['filters']=_[_0xfedb('0x30')](_0x21d85a['model'],_0x21d85a[_0xfedb('0x2c')]);_0x5c375b[_0xfedb('0x2f')]=_[_0xfedb('0x30')](_0x21d85a[_0xfedb('0x31')],qs['fields'](_0x4f1ccc['query'][_0xfedb('0x32')]));_0x5c375b['attributes']=_0x5c375b[_0xfedb('0x2f')][_0xfedb('0x42')]?_0x5c375b['attributes']:_0x21d85a[_0xfedb('0x31')];if(_0x4f1ccc[_0xfedb('0x2c')]['includeAll']){_0x5c375b[_0xfedb('0x3d')]=[{'all':!![]}];}_0x5c375b=_[_0xfedb('0x39')]({},_0x5c375b,_0x4f1ccc['options']);return db[_0xfedb('0x27')][_0xfedb('0x43')](_0x5c375b)[_0xfedb('0x23')](handleEntityNotFound(_0x5525cb,null))[_0xfedb('0x23')](respondWithResult(_0x5525cb,null))[_0xfedb('0x3f')](handleError(_0x5525cb,null));};exports[_0xfedb('0x44')]=function(_0x36b356,_0x1c8510){if(_0x36b356['body']['id']){delete _0x36b356[_0xfedb('0x45')]['id'];}return db['VoiceMusicOnHold']['find']({'where':{'id':_0x36b356[_0xfedb('0x41')]['id']}})[_0xfedb('0x23')](handleEntityNotFound(_0x1c8510,null))[_0xfedb('0x23')](saveUpdates(_0x36b356[_0xfedb('0x45')],null))[_0xfedb('0x23')](respondWithResult(_0x1c8510,null))['catch'](handleError(_0x1c8510,null));};exports['create']=function(_0x2142aa,_0x3085f3,_0x36c6cf){return db[_0xfedb('0x46')][_0xfedb('0x47')](function(_0x5be500){if(_0x2142aa[_0xfedb('0x45')]['mode']==='files'){_0x2142aa['body'][_0xfedb('0x48')]=path['join'](config[_0xfedb('0x49')],_0xfedb('0x4a'),_0x2142aa[_0xfedb('0x45')][_0xfedb('0x25')]);}return db['VoiceMusicOnHold'][_0xfedb('0x4b')](_0x2142aa['body'],{'transaction':_0x5be500})[_0xfedb('0x23')](function(_0x4f92dd){if(_0x2142aa[_0xfedb('0x45')]['mode']===_0xfedb('0x4c')){fs[_0xfedb('0x4d')](_0x4f92dd[_0xfedb('0x48')],parseInt('0777',0x8));}var _0x38aa8d=_0x2142aa[_0xfedb('0x4e')][_0xfedb('0x4f')]({'plain':!![]});if(!_0x38aa8d)throw new Error(_0xfedb('0x50'));if(_0x38aa8d[_0xfedb('0x51')]===_0xfedb('0x4e')){var _0x5c450c=_0x4f92dd[_0xfedb('0x4f')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0xfedb('0x52'),'userProfileId':_0x38aa8d['userProfileId']},'raw':!![]})[_0xfedb('0x23')](function(_0x17bf9e){if(_0x17bf9e&&_0x17bf9e[_0xfedb('0x53')]===0x0){return db[_0xfedb('0x54')][_0xfedb('0x4b')]({'name':_0x5c450c[_0xfedb('0x25')],'resourceId':_0x5c450c['id'],'type':_0x17bf9e['name'],'sectionId':_0x17bf9e['id']},{})[_0xfedb('0x23')](function(){return _0x4f92dd;});}else{return _0x4f92dd;}})[_0xfedb('0x3f')](function(_0x399a84){logger[_0xfedb('0x55')](_0xfedb('0x56'),_0x399a84);});}return _0x4f92dd;});})[_0xfedb('0x23')](respondWithResult(_0x3085f3,0xc9))['catch'](handleError(_0x3085f3,null));};exports[_0xfedb('0x24')]=function(_0x4654d8,_0xac442,_0x2a1a0d){var _0x497375;return db[_0xfedb('0x27')][_0xfedb('0x43')]({'where':{'id':_0x4654d8['params']['id']}})['then'](function(_0x238c3f){if(_0x238c3f){return db[_0xfedb('0x46')]['transaction'](function(_0x4f0168){return _0x238c3f[_0xfedb('0x24')]({'transaction':_0x4f0168,'raw':!![]})[_0xfedb('0x23')](function(_0x1dfdee){if(_0x1dfdee['directory']){fs[_0xfedb('0x57')](_0x1dfdee[_0xfedb('0x48')])[_0xfedb('0x58')](function(_0xfb6e3){fs[_0xfedb('0x59')](path[_0xfedb('0x5a')](_0x1dfdee[_0xfedb('0x48')],_0xfb6e3));});fs['rmdirSync'](_0x1dfdee[_0xfedb('0x48')]);}return _0x1dfdee;});})[_0xfedb('0x3f')](function(_0x398408){throw new db[(_0xfedb('0x5b'))][(_0xfedb('0x5c'))](_0x398408[_0xfedb('0x5d')]);});}})[_0xfedb('0x23')](handleEntityNotFound(_0xac442,null))['then'](removeEntity(_0xac442,null))[_0xfedb('0x3f')](handleError(_0xac442,null));};exports[_0xfedb('0x5e')]=function(_0x103a20,_0x5913f7,_0x1e9eb3){return db[_0xfedb('0x46')]['transaction'](function(_0x2080eb){var _0x27932c;return db[_0xfedb('0x27')][_0xfedb('0x43')]({'where':{'id':_0x103a20[_0xfedb('0x41')]['id']}})['then'](function(_0x37c546){if(_0x37c546){_0x27932c=_0x37c546;return _0x37c546[_0xfedb('0x5e')](_0x103a20[_0xfedb('0x45')]['id'],{'transaction':_0x2080eb});}})[_0xfedb('0x23')](function(_0xfc9f5f){if(_0xfc9f5f){return db[_0xfedb('0x5f')][_0xfedb('0x60')]({'where':{'id':_0x103a20[_0xfedb('0x45')]['id']},'attributes':['id','name',_0xfedb('0x61'),_0xfedb('0x62'),_0xfedb('0x63')],'raw':!![]});}})[_0xfedb('0x23')](function(_0x2c1696){if(_0x2c1696){var _0x4b36a9=path['join'](config[_0xfedb('0x49')],_0xfedb('0x64'),util[_0xfedb('0x65')](_0xfedb('0x66'),path[_0xfedb('0x67')](_0x2c1696['save_name'],path['extname'](_0x2c1696[_0xfedb('0x61')])),_0x2c1696[_0xfedb('0x62')]));var _0x581439=path[_0xfedb('0x5a')](config[_0xfedb('0x49')],_0xfedb('0x4a'),_0x27932c['name'],util[_0xfedb('0x65')](_0xfedb('0x66'),_0x2c1696[_0xfedb('0x25')],_0x2c1696[_0xfedb('0x62')]));fs[_0xfedb('0x68')](_0x4b36a9,_0x581439);return _0x2c1696;}})[_0xfedb('0x3f')](function(_0x51cfba){throw new db[(_0xfedb('0x5b'))][(_0xfedb('0x5c'))](_0x51cfba[_0xfedb('0x5d')]);});})[_0xfedb('0x23')](handleEntityNotFound(_0x5913f7,null))[_0xfedb('0x23')](respondWithResult(_0x5913f7,0xc9))[_0xfedb('0x3f')](handleError(_0x5913f7,null));};exports['removeSound']=function(_0xae632,_0xe44a3f,_0x4ebb68){return db[_0xfedb('0x46')]['transaction'](function(_0x490418){var _0x2d6a71;return db['VoiceMusicOnHold'][_0xfedb('0x60')]({'where':{'id':_0xae632[_0xfedb('0x41')]['id']}})[_0xfedb('0x23')](handleEntityNotFound(_0xe44a3f,null))['then'](function(_0x48a986){if(_0x48a986){_0x2d6a71=_0x48a986;return _0x48a986[_0xfedb('0x69')](_0xae632['params'][_0xfedb('0x6a')]);}})[_0xfedb('0x23')](function(_0x538ef2){if(_0x538ef2){return db[_0xfedb('0x5f')][_0xfedb('0x60')]({'where':{'id':_0xae632[_0xfedb('0x41')][_0xfedb('0x6a')]},'attributes':['id',_0xfedb('0x25'),_0xfedb('0x61'),_0xfedb('0x62'),_0xfedb('0x63')],'raw':!![]});}})[_0xfedb('0x23')](function(_0x15a8e1){if(_0x15a8e1){fs[_0xfedb('0x59')](path[_0xfedb('0x5a')](_0x2d6a71[_0xfedb('0x48')],util[_0xfedb('0x65')]('%s.%s',_0x15a8e1[_0xfedb('0x25')],_0x15a8e1[_0xfedb('0x62')])));return _0x15a8e1;}})['catch'](function(_0x14cd1c){throw new db[(_0xfedb('0x5b'))][(_0xfedb('0x5c'))](_0x14cd1c[_0xfedb('0x5d')]);});})['then'](handleEntityNotFound(_0xe44a3f,null))[_0xfedb('0x23')](respondWithStatusCode(_0xe44a3f,0xcc))['catch'](handleError(_0xe44a3f,null));};exports[_0xfedb('0x6b')]=function(_0x1c6e7a,_0x111421,_0x3ad8f8){var _0x3d6017={};var _0x55500e={};var _0x203217;var _0x1aa8c0;return db[_0xfedb('0x27')]['findOne']({'where':{'id':_0x1c6e7a['params']['id']}})[_0xfedb('0x23')](handleEntityNotFound(_0x111421,null))[_0xfedb('0x23')](function(_0xcb89c8){if(_0xcb89c8){_0x203217=_0xcb89c8;_0x55500e['model']=_[_0xfedb('0x2d')](db[_0xfedb('0x5f')][_0xfedb('0x6c')]);_0x55500e['query']=_[_0xfedb('0x2d')](_0x1c6e7a[_0xfedb('0x2c')]);_0x55500e[_0xfedb('0x2e')]=_['intersection'](_0x55500e['model'],_0x55500e[_0xfedb('0x2c')]);_0x3d6017[_0xfedb('0x2f')]=_[_0xfedb('0x30')](_0x55500e[_0xfedb('0x31')],qs[_0xfedb('0x32')](_0x1c6e7a[_0xfedb('0x2c')][_0xfedb('0x32')]));_0x3d6017[_0xfedb('0x2f')]=_0x3d6017[_0xfedb('0x2f')][_0xfedb('0x42')]?_0x3d6017[_0xfedb('0x2f')]:_0x55500e[_0xfedb('0x31')];_0x3d6017[_0xfedb('0x35')]=qs[_0xfedb('0x36')](_0x1c6e7a[_0xfedb('0x2c')]['sort']);_0x3d6017[_0xfedb('0x38')]=qs['filters'](_[_0xfedb('0x6d')](_0x1c6e7a[_0xfedb('0x2c')],_0x55500e[_0xfedb('0x2e')]));if(_0x1c6e7a['query'][_0xfedb('0x37')]){_0x3d6017[_0xfedb('0x38')]=_['merge'](_0x3d6017[_0xfedb('0x38')],{'$or':_['map'](_0x3d6017[_0xfedb('0x2f')],function(_0x34ca8a){var _0x2c91f3={};_0x2c91f3[_0x34ca8a]={'$like':'%'+_0x1c6e7a[_0xfedb('0x2c')][_0xfedb('0x37')]+'%'};return _0x2c91f3;})});}_0x3d6017=_[_0xfedb('0x39')]({},_0x3d6017,_0x1c6e7a[_0xfedb('0x3b')]);return _0x203217[_0xfedb('0x6b')](_0x3d6017);}})[_0xfedb('0x23')](function(_0x4b204e){if(_0x4b204e){_0x1aa8c0=_0x4b204e['length'];if(!_0x1c6e7a[_0xfedb('0x2c')][_0xfedb('0x33')](_0xfedb('0x34'))){_0x3d6017[_0xfedb('0x1c')]=qs[_0xfedb('0x1c')](_0x1c6e7a[_0xfedb('0x2c')][_0xfedb('0x1c')]);_0x3d6017[_0xfedb('0x1a')]=qs[_0xfedb('0x1a')](_0x1c6e7a[_0xfedb('0x2c')]['offset']);}return _0x203217[_0xfedb('0x6b')](_0x3d6017);}})['then'](function(_0x1c8f0c){if(_0x1c8f0c){return _0x1c8f0c?{'count':_0x1aa8c0,'rows':_0x1c8f0c}:null;}})[_0xfedb('0x23')](respondWithResult(_0x111421,null))[_0xfedb('0x3f')](handleError(_0x111421,null));}; \ No newline at end of file +var _0x3acc=['server/files/moh','create','mkdirSync','0777','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','sequelize','readdirSync','unlinkSync','rmdirSync','ValidationError','message','addSound','Sound','findOne','save_name','createdAt','server/files/sounds/converted','format','%s.%s','basename','extname','root','converted_format','symlinkSync','removeSound','id2','Sequelize','getSounds','order','eml-format','rimraf','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','MusicOnHolds','UserProfileResource','destroy','stack','name','index','VoiceMusicOnHold','rawAttributes','fieldName','type','key','keys','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','map','VIRTUAL','options','include','findAll','rows','catch','includeAll','find','body','params','transaction','mode','files','directory','join'];(function(_0x48de28,_0x46862e){var _0x5548c9=function(_0x4b1a53){while(--_0x4b1a53){_0x48de28['push'](_0x48de28['shift']());}};_0x5548c9(++_0x46862e);}(_0x3acc,0x117));var _0xc3ac=function(_0x52d19d,_0x29dce){_0x52d19d=_0x52d19d-0x0;var _0x4705d4=_0x3acc[_0x52d19d];return _0x4705d4;};'use strict';var emlformat=require(_0xc3ac('0x0'));var rimraf=require(_0xc3ac('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc3ac('0x2'));var moment=require('moment');var BPromise=require(_0xc3ac('0x3'));var Mustache=require(_0xc3ac('0x4'));var util=require(_0xc3ac('0x5'));var path=require('path');var sox=require(_0xc3ac('0x6'));var csv=require(_0xc3ac('0x7'));var ejs=require(_0xc3ac('0x8'));var fs=require('fs');var fs_extra=require(_0xc3ac('0x9'));var _=require(_0xc3ac('0xa'));var squel=require(_0xc3ac('0xb'));var crypto=require(_0xc3ac('0xc'));var jsforce=require(_0xc3ac('0xd'));var deskjs=require(_0xc3ac('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc3ac('0xf'));var Papa=require(_0xc3ac('0x10'));var Redis=require(_0xc3ac('0x11'));var authService=require(_0xc3ac('0x12'));var qs=require(_0xc3ac('0x13'));var as=require(_0xc3ac('0x14'));var hardwareService=require(_0xc3ac('0x15'));var logger=require(_0xc3ac('0x16'))(_0xc3ac('0x17'));var utils=require(_0xc3ac('0x18'));var config=require(_0xc3ac('0x19'));var licenseUtil=require(_0xc3ac('0x1a'));var db=require(_0xc3ac('0x1b'))['db'];function respondWithStatusCode(_0x15822c,_0x2a7380){_0x2a7380=_0x2a7380||0xcc;return function(_0x577cf6){if(_0x577cf6){return _0x15822c[_0xc3ac('0x1c')](_0x2a7380);}return _0x15822c[_0xc3ac('0x1d')](_0x2a7380)[_0xc3ac('0x1e')]();};}function respondWithResult(_0x249eea,_0x5b9061){_0x5b9061=_0x5b9061||0xc8;return function(_0x571a53){if(_0x571a53){return _0x249eea[_0xc3ac('0x1d')](_0x5b9061)[_0xc3ac('0x1f')](_0x571a53);}};}function respondWithFilteredResult(_0x22679c,_0x24b8d7){return function(_0x674095){if(_0x674095){var _0x1fc3c9=typeof _0x24b8d7[_0xc3ac('0x20')]==='undefined'&&typeof _0x24b8d7[_0xc3ac('0x21')]==='undefined';var _0x5e0456=_0x674095[_0xc3ac('0x22')];var _0x34e028=_0x1fc3c9?0x0:_0x24b8d7['offset'];var _0x5d167e=_0x1fc3c9?_0x674095[_0xc3ac('0x22')]:_0x24b8d7['offset']+_0x24b8d7['limit'];var _0x7c191d;if(_0x5d167e>=_0x5e0456){_0x5d167e=_0x5e0456;_0x7c191d=0xc8;}else{_0x7c191d=0xce;}_0x22679c[_0xc3ac('0x1d')](_0x7c191d);return _0x22679c[_0xc3ac('0x23')](_0xc3ac('0x24'),_0x34e028+'-'+_0x5d167e+'/'+_0x5e0456)['json'](_0x674095);}return null;};}function patchUpdates(_0x1c6b97){return function(_0x5b972f){try{jsonpatch[_0xc3ac('0x25')](_0x5b972f,_0x1c6b97,!![]);}catch(_0x50716a){return BPromise[_0xc3ac('0x26')](_0x50716a);}return _0x5b972f[_0xc3ac('0x27')]();};}function saveUpdates(_0x199766,_0x3cd3e3){return function(_0x3804c8){if(_0x3804c8){return _0x3804c8[_0xc3ac('0x28')](_0x199766)[_0xc3ac('0x29')](function(_0x2808aa){return _0x2808aa;});}return null;};}function removeEntity(_0x3ff063,_0x13de9d){return function(_0x5be7bc){if(_0x5be7bc){return _0x5be7bc['destroy']()[_0xc3ac('0x29')](function(){var _0x1d428b=_0x5be7bc['get']({'plain':!![]});var _0x351e85=_0xc3ac('0x2a');return db[_0xc3ac('0x2b')][_0xc3ac('0x2c')]({'where':{'type':_0x351e85,'resourceId':_0x1d428b['id']}})[_0xc3ac('0x29')](function(){return _0x5be7bc;});})[_0xc3ac('0x29')](function(){_0x3ff063[_0xc3ac('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x306be3,_0x582bd2){return function(_0x2b6e79){if(!_0x2b6e79){_0x306be3['sendStatus'](0x194);}return _0x2b6e79;};}function handleError(_0x1a7004,_0x393fab){_0x393fab=_0x393fab||0x1f4;return function(_0x20c4f9){logger['error'](_0x20c4f9[_0xc3ac('0x2d')]);if(_0x20c4f9[_0xc3ac('0x2e')]){delete _0x20c4f9[_0xc3ac('0x2e')];}_0x1a7004[_0xc3ac('0x1d')](_0x393fab)['send'](_0x20c4f9);};}exports[_0xc3ac('0x2f')]=function(_0x2206e9,_0xcca1eb){var _0x5c8b6a={},_0x36a095={},_0x498913={'count':0x0,'rows':[]};var _0x2387c2=_['map'](db[_0xc3ac('0x30')][_0xc3ac('0x31')],function(_0x5ced92){return{'name':_0x5ced92[_0xc3ac('0x32')],'type':_0x5ced92[_0xc3ac('0x33')][_0xc3ac('0x34')]};});_0x36a095['model']=_['map'](_0x2387c2,'name');_0x36a095['query']=_[_0xc3ac('0x35')](_0x2206e9['query']);_0x36a095['filters']=_[_0xc3ac('0x36')](_0x36a095[_0xc3ac('0x37')],_0x36a095[_0xc3ac('0x38')]);_0x5c8b6a[_0xc3ac('0x39')]=_['intersection'](_0x36a095[_0xc3ac('0x37')],qs[_0xc3ac('0x3a')](_0x2206e9[_0xc3ac('0x38')][_0xc3ac('0x3a')]));_0x5c8b6a['attributes']=_0x5c8b6a[_0xc3ac('0x39')][_0xc3ac('0x3b')]?_0x5c8b6a[_0xc3ac('0x39')]:_0x36a095[_0xc3ac('0x37')];if(!_0x2206e9[_0xc3ac('0x38')][_0xc3ac('0x3c')](_0xc3ac('0x3d'))){_0x5c8b6a['limit']=qs[_0xc3ac('0x21')](_0x2206e9[_0xc3ac('0x38')][_0xc3ac('0x21')]);_0x5c8b6a[_0xc3ac('0x20')]=qs[_0xc3ac('0x20')](_0x2206e9['query'][_0xc3ac('0x20')]);}_0x5c8b6a['order']=qs[_0xc3ac('0x3e')](_0x2206e9[_0xc3ac('0x38')][_0xc3ac('0x3e')]);delete _0x2206e9[_0xc3ac('0x38')][_0xc3ac('0x3e')];_0x5c8b6a[_0xc3ac('0x3f')]=qs[_0xc3ac('0x40')](_[_0xc3ac('0x41')](_0x2206e9[_0xc3ac('0x38')],_0x36a095['filters']),_0x2387c2);if(_0x2206e9[_0xc3ac('0x38')][_0xc3ac('0x42')]){_0x5c8b6a[_0xc3ac('0x3f')]=_[_0xc3ac('0x43')](_0x5c8b6a[_0xc3ac('0x3f')],{'$or':_[_0xc3ac('0x44')](_0x2387c2,function(_0x4f5791){if(_0x4f5791[_0xc3ac('0x33')]!==_0xc3ac('0x45')){var _0x3a4948={};_0x3a4948[_0x4f5791['name']]={'$like':'%'+_0x2206e9[_0xc3ac('0x38')][_0xc3ac('0x42')]+'%'};return _0x3a4948;}})});}_0x5c8b6a=_[_0xc3ac('0x43')]({},_0x5c8b6a,_0x2206e9[_0xc3ac('0x46')]);var _0x4e98e8={'where':_0x5c8b6a[_0xc3ac('0x3f')]};return db[_0xc3ac('0x30')][_0xc3ac('0x22')](_0x4e98e8)[_0xc3ac('0x29')](function(_0x5c53c4){_0x498913['count']=_0x5c53c4;if(_0x2206e9[_0xc3ac('0x38')]['includeAll']){_0x5c8b6a[_0xc3ac('0x47')]=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0xc3ac('0x48')](_0x5c8b6a);})[_0xc3ac('0x29')](function(_0x34354d){_0x498913[_0xc3ac('0x49')]=_0x34354d;return _0x498913;})['then'](respondWithFilteredResult(_0xcca1eb,_0x5c8b6a))[_0xc3ac('0x4a')](handleError(_0xcca1eb,null));};exports['show']=function(_0x3a515d,_0x53faf7){var _0x3dab63={'raw':![],'where':{'id':_0x3a515d['params']['id']}},_0xa5ce81={};_0xa5ce81[_0xc3ac('0x37')]=_[_0xc3ac('0x35')](db[_0xc3ac('0x30')]['rawAttributes']);_0xa5ce81[_0xc3ac('0x38')]=_[_0xc3ac('0x35')](_0x3a515d['query']);_0xa5ce81[_0xc3ac('0x40')]=_[_0xc3ac('0x36')](_0xa5ce81['model'],_0xa5ce81[_0xc3ac('0x38')]);_0x3dab63[_0xc3ac('0x39')]=_[_0xc3ac('0x36')](_0xa5ce81[_0xc3ac('0x37')],qs['fields'](_0x3a515d['query'][_0xc3ac('0x3a')]));_0x3dab63[_0xc3ac('0x39')]=_0x3dab63['attributes'][_0xc3ac('0x3b')]?_0x3dab63[_0xc3ac('0x39')]:_0xa5ce81['model'];if(_0x3a515d['query'][_0xc3ac('0x4b')]){_0x3dab63[_0xc3ac('0x47')]=[{'all':!![]}];}_0x3dab63=_[_0xc3ac('0x43')]({},_0x3dab63,_0x3a515d[_0xc3ac('0x46')]);return db[_0xc3ac('0x30')][_0xc3ac('0x4c')](_0x3dab63)[_0xc3ac('0x29')](handleEntityNotFound(_0x53faf7,null))[_0xc3ac('0x29')](respondWithResult(_0x53faf7,null))[_0xc3ac('0x4a')](handleError(_0x53faf7,null));};exports[_0xc3ac('0x28')]=function(_0xb3855b,_0x327259){if(_0xb3855b[_0xc3ac('0x4d')]['id']){delete _0xb3855b['body']['id'];}return db[_0xc3ac('0x30')][_0xc3ac('0x4c')]({'where':{'id':_0xb3855b[_0xc3ac('0x4e')]['id']}})['then'](handleEntityNotFound(_0x327259,null))['then'](saveUpdates(_0xb3855b[_0xc3ac('0x4d')],null))['then'](respondWithResult(_0x327259,null))['catch'](handleError(_0x327259,null));};exports['create']=function(_0xf06565,_0x416052,_0x16ec7b){return db['sequelize'][_0xc3ac('0x4f')](function(_0xac39e5){if(_0xf06565[_0xc3ac('0x4d')][_0xc3ac('0x50')]===_0xc3ac('0x51')){_0xf06565['body'][_0xc3ac('0x52')]=path[_0xc3ac('0x53')](config['root'],_0xc3ac('0x54'),_0xf06565['body'][_0xc3ac('0x2e')]);}return db[_0xc3ac('0x30')][_0xc3ac('0x55')](_0xf06565[_0xc3ac('0x4d')],{'transaction':_0xac39e5})[_0xc3ac('0x29')](function(_0x3ed128){if(_0xf06565[_0xc3ac('0x4d')][_0xc3ac('0x50')]===_0xc3ac('0x51')){fs[_0xc3ac('0x56')](_0x3ed128[_0xc3ac('0x52')],parseInt(_0xc3ac('0x57'),0x8));}var _0x4e2111=_0xf06565['user'][_0xc3ac('0x58')]({'plain':!![]});if(!_0x4e2111)throw new Error(_0xc3ac('0x59'));if(_0x4e2111[_0xc3ac('0x5a')]===_0xc3ac('0x5b')){var _0x582991=_0x3ed128[_0xc3ac('0x58')]({'plain':!![]});return db[_0xc3ac('0x5c')][_0xc3ac('0x4c')]({'where':{'name':'MusicOnHolds','userProfileId':_0x4e2111[_0xc3ac('0x5d')]},'raw':!![]})[_0xc3ac('0x29')](function(_0x3d1670){if(_0x3d1670&&_0x3d1670[_0xc3ac('0x5e')]===0x0){return db[_0xc3ac('0x2b')][_0xc3ac('0x55')]({'name':_0x582991['name'],'resourceId':_0x582991['id'],'type':_0x3d1670[_0xc3ac('0x2e')],'sectionId':_0x3d1670['id']},{})[_0xc3ac('0x29')](function(){return _0x3ed128;});}else{return _0x3ed128;}})['catch'](function(_0x3a583){logger[_0xc3ac('0x5f')](_0xc3ac('0x60'),_0x3a583);});}return _0x3ed128;});})[_0xc3ac('0x29')](respondWithResult(_0x416052,0xc9))[_0xc3ac('0x4a')](handleError(_0x416052,null));};exports[_0xc3ac('0x2c')]=function(_0x5d303c,_0x18f857,_0x459883){var _0x847302;return db['VoiceMusicOnHold']['find']({'where':{'id':_0x5d303c['params']['id']}})[_0xc3ac('0x29')](function(_0x5ce354){if(_0x5ce354){return db[_0xc3ac('0x61')][_0xc3ac('0x4f')](function(_0x211ba3){return _0x5ce354[_0xc3ac('0x2c')]({'transaction':_0x211ba3,'raw':!![]})[_0xc3ac('0x29')](function(_0x240d72){if(_0x240d72[_0xc3ac('0x52')]){fs[_0xc3ac('0x62')](_0x240d72[_0xc3ac('0x52')])['forEach'](function(_0x136dbc){fs[_0xc3ac('0x63')](path[_0xc3ac('0x53')](_0x240d72[_0xc3ac('0x52')],_0x136dbc));});fs[_0xc3ac('0x64')](_0x240d72['directory']);}return _0x240d72;});})['catch'](function(_0x3cb188){throw new db['Sequelize'][(_0xc3ac('0x65'))](_0x3cb188[_0xc3ac('0x66')]);});}})[_0xc3ac('0x29')](handleEntityNotFound(_0x18f857,null))['then'](removeEntity(_0x18f857,null))[_0xc3ac('0x4a')](handleError(_0x18f857,null));};exports[_0xc3ac('0x67')]=function(_0x170824,_0x1a201d,_0x19ed6e){return db[_0xc3ac('0x61')][_0xc3ac('0x4f')](function(_0x5967bf){var _0x41a5b4;return db['VoiceMusicOnHold']['find']({'where':{'id':_0x170824[_0xc3ac('0x4e')]['id']}})['then'](function(_0x4a4800){if(_0x4a4800){_0x41a5b4=_0x4a4800;return _0x4a4800['addSound'](_0x170824['body']['id'],{'transaction':_0x5967bf});}})[_0xc3ac('0x29')](function(_0x196dfd){if(_0x196dfd){return db[_0xc3ac('0x68')][_0xc3ac('0x69')]({'where':{'id':_0x170824[_0xc3ac('0x4d')]['id']},'attributes':['id',_0xc3ac('0x2e'),_0xc3ac('0x6a'),'converted_format',_0xc3ac('0x6b')],'raw':!![]});}})[_0xc3ac('0x29')](function(_0x210066){if(_0x210066){var _0x34c256=path[_0xc3ac('0x53')](config['root'],_0xc3ac('0x6c'),util[_0xc3ac('0x6d')](_0xc3ac('0x6e'),path[_0xc3ac('0x6f')](_0x210066['save_name'],path[_0xc3ac('0x70')](_0x210066[_0xc3ac('0x6a')])),_0x210066['converted_format']));var _0x5bd4d9=path[_0xc3ac('0x53')](config[_0xc3ac('0x71')],_0xc3ac('0x54'),_0x41a5b4[_0xc3ac('0x2e')],util['format'](_0xc3ac('0x6e'),_0x210066['name'],_0x210066[_0xc3ac('0x72')]));fs[_0xc3ac('0x73')](_0x34c256,_0x5bd4d9);return _0x210066;}})[_0xc3ac('0x4a')](function(_0x21258a){throw new db['Sequelize'][(_0xc3ac('0x65'))](_0x21258a['message']);});})[_0xc3ac('0x29')](handleEntityNotFound(_0x1a201d,null))[_0xc3ac('0x29')](respondWithResult(_0x1a201d,0xc9))['catch'](handleError(_0x1a201d,null));};exports[_0xc3ac('0x74')]=function(_0x2fddd5,_0x4869de,_0x507e21){return db['sequelize'][_0xc3ac('0x4f')](function(_0x38a3e4){var _0x5211c8;return db[_0xc3ac('0x30')][_0xc3ac('0x69')]({'where':{'id':_0x2fddd5[_0xc3ac('0x4e')]['id']}})[_0xc3ac('0x29')](handleEntityNotFound(_0x4869de,null))[_0xc3ac('0x29')](function(_0x467fec){if(_0x467fec){_0x5211c8=_0x467fec;return _0x467fec[_0xc3ac('0x74')](_0x2fddd5[_0xc3ac('0x4e')][_0xc3ac('0x75')]);}})[_0xc3ac('0x29')](function(_0x3560b5){if(_0x3560b5){return db['Sound'][_0xc3ac('0x69')]({'where':{'id':_0x2fddd5[_0xc3ac('0x4e')][_0xc3ac('0x75')]},'attributes':['id','name',_0xc3ac('0x6a'),_0xc3ac('0x72'),'createdAt'],'raw':!![]});}})[_0xc3ac('0x29')](function(_0xe35a3){if(_0xe35a3){fs[_0xc3ac('0x63')](path['join'](_0x5211c8['directory'],util[_0xc3ac('0x6d')](_0xc3ac('0x6e'),_0xe35a3[_0xc3ac('0x2e')],_0xe35a3[_0xc3ac('0x72')])));return _0xe35a3;}})[_0xc3ac('0x4a')](function(_0x167963){throw new db[(_0xc3ac('0x76'))][(_0xc3ac('0x65'))](_0x167963['message']);});})['then'](handleEntityNotFound(_0x4869de,null))['then'](respondWithStatusCode(_0x4869de,0xcc))['catch'](handleError(_0x4869de,null));};exports[_0xc3ac('0x77')]=function(_0x319cb6,_0x27c842,_0x232f6c){var _0x47c6f3={};var _0x2ab63f={};var _0x4e1e60;var _0x2bee4d;return db[_0xc3ac('0x30')][_0xc3ac('0x69')]({'where':{'id':_0x319cb6[_0xc3ac('0x4e')]['id']}})[_0xc3ac('0x29')](handleEntityNotFound(_0x27c842,null))[_0xc3ac('0x29')](function(_0x12f0d9){if(_0x12f0d9){_0x4e1e60=_0x12f0d9;_0x2ab63f[_0xc3ac('0x37')]=_[_0xc3ac('0x35')](db[_0xc3ac('0x68')]['rawAttributes']);_0x2ab63f['query']=_[_0xc3ac('0x35')](_0x319cb6[_0xc3ac('0x38')]);_0x2ab63f[_0xc3ac('0x40')]=_['intersection'](_0x2ab63f[_0xc3ac('0x37')],_0x2ab63f[_0xc3ac('0x38')]);_0x47c6f3[_0xc3ac('0x39')]=_[_0xc3ac('0x36')](_0x2ab63f[_0xc3ac('0x37')],qs['fields'](_0x319cb6[_0xc3ac('0x38')][_0xc3ac('0x3a')]));_0x47c6f3[_0xc3ac('0x39')]=_0x47c6f3['attributes'][_0xc3ac('0x3b')]?_0x47c6f3[_0xc3ac('0x39')]:_0x2ab63f[_0xc3ac('0x37')];_0x47c6f3[_0xc3ac('0x78')]=qs['sort'](_0x319cb6[_0xc3ac('0x38')]['sort']);_0x47c6f3[_0xc3ac('0x3f')]=qs[_0xc3ac('0x40')](_[_0xc3ac('0x41')](_0x319cb6['query'],_0x2ab63f[_0xc3ac('0x40')]));if(_0x319cb6[_0xc3ac('0x38')]['filter']){_0x47c6f3[_0xc3ac('0x3f')]=_[_0xc3ac('0x43')](_0x47c6f3['where'],{'$or':_[_0xc3ac('0x44')](_0x47c6f3[_0xc3ac('0x39')],function(_0x51e23c){var _0x3e1ceb={};_0x3e1ceb[_0x51e23c]={'$like':'%'+_0x319cb6['query'][_0xc3ac('0x42')]+'%'};return _0x3e1ceb;})});}_0x47c6f3=_[_0xc3ac('0x43')]({},_0x47c6f3,_0x319cb6[_0xc3ac('0x46')]);return _0x4e1e60[_0xc3ac('0x77')](_0x47c6f3);}})[_0xc3ac('0x29')](function(_0x570fde){if(_0x570fde){_0x2bee4d=_0x570fde[_0xc3ac('0x3b')];if(!_0x319cb6['query']['hasOwnProperty']('nolimit')){_0x47c6f3[_0xc3ac('0x21')]=qs[_0xc3ac('0x21')](_0x319cb6[_0xc3ac('0x38')][_0xc3ac('0x21')]);_0x47c6f3[_0xc3ac('0x20')]=qs['offset'](_0x319cb6['query'][_0xc3ac('0x20')]);}return _0x4e1e60[_0xc3ac('0x77')](_0x47c6f3);}})[_0xc3ac('0x29')](function(_0x3370e5){if(_0x3370e5){return _0x3370e5?{'count':_0x2bee4d,'rows':_0x3370e5}:null;}})['then'](respondWithResult(_0x27c842,null))[_0xc3ac('0x4a')](handleError(_0x27c842,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 45eecea..3532609 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 _0xca47=['bluebird','rimraf','../../config/environment','./voiceMusicOnHold.attributes','VoiceMusicOnHold','voice_musiconhold','util','api','moment'];(function(_0x9c70dd,_0x11579e){var _0xb5e2e2=function(_0x283b7b){while(--_0x283b7b){_0x9c70dd['push'](_0x9c70dd['shift']());}};_0xb5e2e2(++_0x11579e);}(_0xca47,0xb1));var _0x7ca4=function(_0x142659,_0x106470){_0x142659=_0x142659-0x0;var _0x372087=_0xca47[_0x142659];return _0x372087;};'use strict';var _=require('lodash');var util=require(_0x7ca4('0x0'));var logger=require('../../config/logger')(_0x7ca4('0x1'));var moment=require(_0x7ca4('0x2'));var BPromise=require(_0x7ca4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7ca4('0x4'));var config=require(_0x7ca4('0x5'));var attributes=require(_0x7ca4('0x6'));module['exports']=function(_0x44d35c,_0x18a36a){return _0x44d35c['define'](_0x7ca4('0x7'),attributes,{'tableName':_0x7ca4('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xca66=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','voice_musiconhold','lodash','../../config/logger'];(function(_0x57a9da,_0x2d3d7a){var _0x33ba51=function(_0x215e52){while(--_0x215e52){_0x57a9da['push'](_0x57a9da['shift']());}};_0x33ba51(++_0x2d3d7a);}(_0xca66,0x76));var _0x6ca6=function(_0x43e672,_0x14c59b){_0x43e672=_0x43e672-0x0;var _0x98f6ad=_0xca66[_0x43e672];return _0x98f6ad;};'use strict';var _=require(_0x6ca6('0x0'));var util=require('util');var logger=require(_0x6ca6('0x1'))(_0x6ca6('0x2'));var moment=require(_0x6ca6('0x3'));var BPromise=require(_0x6ca6('0x4'));var rp=require(_0x6ca6('0x5'));var fs=require('fs');var path=require(_0x6ca6('0x6'));var rimraf=require(_0x6ca6('0x7'));var config=require(_0x6ca6('0x8'));var attributes=require('./voiceMusicOnHold.attributes');module[_0x6ca6('0x9')]=function(_0x4451e8,_0x2e579f){return _0x4451e8[_0x6ca6('0xa')]('VoiceMusicOnHold',attributes,{'tableName':_0x6ca6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js index d4146e2..e79a595 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['http','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x1e6aa7,_0x3a5a43){var _0x39946d=function(_0xbda8bb){while(--_0xbda8bb){_0x1e6aa7['push'](_0x1e6aa7['shift']());}};_0x39946d(++_0x3a5a43);}(_0xe706,0xa3));var _0x6e70=function(_0x484da6,_0x10686f){_0x484da6=_0x484da6-0x0;var _0x4cbfb7=_0xe706[_0x484da6];return _0x4cbfb7;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});} \ No newline at end of file +var _0x0713=['VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\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(_0x594456,_0xb621e4){var _0x2a8c33=function(_0x55b68a){while(--_0x55b68a){_0x594456['push'](_0x594456['shift']());}};_0x2a8c33(++_0xb621e4);}(_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')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('VoiceMusicOnHold,\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')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index b75ad9f..72fd740 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 _0xdf67=['isAuthenticated','/describe','/:id','show','/:id/users','getAgents','/:id/teams','getTeams','post','create','addAgents','addTeams','put','update','delete','removeAgents','removeTeams','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0xdf67,0x117));var _0x7df6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdf67[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x7df6('0x0'));var util=require(_0x7df6('0x1'));var path=require(_0x7df6('0x2'));var timeout=require(_0x7df6('0x3'));var express=require('express');var router=express[_0x7df6('0x4')]();var fs_extra=require(_0x7df6('0x5'));var auth=require(_0x7df6('0x6'));var interaction=require(_0x7df6('0x7'));var config=require(_0x7df6('0x8'));var controller=require(_0x7df6('0x9'));router[_0x7df6('0xa')]('/',auth[_0x7df6('0xb')](),controller['index']);router[_0x7df6('0xa')](_0x7df6('0xc'),auth[_0x7df6('0xb')](),controller['describe']);router[_0x7df6('0xa')](_0x7df6('0xd'),auth[_0x7df6('0xb')](),controller[_0x7df6('0xe')]);router[_0x7df6('0xa')](_0x7df6('0xf'),auth['isAuthenticated'](),controller[_0x7df6('0x10')]);router[_0x7df6('0xa')](_0x7df6('0x11'),auth[_0x7df6('0xb')](),controller[_0x7df6('0x12')]);router[_0x7df6('0x13')]('/',auth['isAuthenticated'](),controller[_0x7df6('0x14')]);router[_0x7df6('0x13')](_0x7df6('0xf'),auth[_0x7df6('0xb')](),controller[_0x7df6('0x15')]);router[_0x7df6('0x13')]('/:id/teams',auth[_0x7df6('0xb')](),controller[_0x7df6('0x16')]);router[_0x7df6('0x17')](_0x7df6('0xd'),auth[_0x7df6('0xb')](),controller[_0x7df6('0x18')]);router[_0x7df6('0x19')]('/:id',auth[_0x7df6('0xb')](),controller['destroy']);router[_0x7df6('0x19')](_0x7df6('0xf'),auth[_0x7df6('0xb')](),controller[_0x7df6('0x1a')]);router[_0x7df6('0x19')](_0x7df6('0x11'),auth[_0x7df6('0xb')](),controller[_0x7df6('0x1b')]);module[_0x7df6('0x1c')]=router; \ No newline at end of file +var _0xf8db=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','/:id','show','/:id/users','getAgents','/:id/teams','getTeams','post','create','addAgents','addTeams','put','update','delete','destroy','removeTeams','exports','multer'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf8db,0x16b));var _0xbf8d=function(_0x2c9bf0,_0x4999f1){_0x2c9bf0=_0x2c9bf0-0x0;var _0x14fa8a=_0xf8db[_0x2c9bf0];return _0x14fa8a;};'use strict';var multer=require(_0xbf8d('0x0'));var util=require('util');var path=require(_0xbf8d('0x1'));var timeout=require(_0xbf8d('0x2'));var express=require(_0xbf8d('0x3'));var router=express[_0xbf8d('0x4')]();var fs_extra=require(_0xbf8d('0x5'));var auth=require(_0xbf8d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xbf8d('0x7'));var controller=require(_0xbf8d('0x8'));router[_0xbf8d('0x9')]('/',auth[_0xbf8d('0xa')](),controller[_0xbf8d('0xb')]);router[_0xbf8d('0x9')]('/describe',auth[_0xbf8d('0xa')](),controller['describe']);router['get'](_0xbf8d('0xc'),auth[_0xbf8d('0xa')](),controller[_0xbf8d('0xd')]);router[_0xbf8d('0x9')](_0xbf8d('0xe'),auth[_0xbf8d('0xa')](),controller[_0xbf8d('0xf')]);router[_0xbf8d('0x9')](_0xbf8d('0x10'),auth[_0xbf8d('0xa')](),controller[_0xbf8d('0x11')]);router[_0xbf8d('0x12')]('/',auth[_0xbf8d('0xa')](),controller[_0xbf8d('0x13')]);router[_0xbf8d('0x12')](_0xbf8d('0xe'),auth[_0xbf8d('0xa')](),controller[_0xbf8d('0x14')]);router[_0xbf8d('0x12')](_0xbf8d('0x10'),auth[_0xbf8d('0xa')](),controller[_0xbf8d('0x15')]);router[_0xbf8d('0x16')](_0xbf8d('0xc'),auth[_0xbf8d('0xa')](),controller[_0xbf8d('0x17')]);router[_0xbf8d('0x18')](_0xbf8d('0xc'),auth[_0xbf8d('0xa')](),controller[_0xbf8d('0x19')]);router[_0xbf8d('0x18')](_0xbf8d('0xe'),auth[_0xbf8d('0xa')](),controller['removeAgents']);router[_0xbf8d('0x18')](_0xbf8d('0x10'),auth[_0xbf8d('0xa')](),controller[_0xbf8d('0x1a')]);module[_0xbf8d('0x1b')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 57c5831..c3d8e6b 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 _0x38dc=['STRING','name','system-','getDataValue','INTEGER','sequelize','exports'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x38dc,0x8a));var _0xc38d=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x38dc[_0x167cc1];return _0x10bc4b;};'use strict';var Sequelize=require(_0xc38d('0x0'));module[_0xc38d('0x1')]={'name':{'type':Sequelize[_0xc38d('0x2')],'allowNull':![],'unique':_0xc38d('0x3')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x3a00e7){return _0xc38d('0x4')+this[_0xc38d('0x5')](_0xc38d('0x3'))+'-';}},'description':{'type':Sequelize[_0xc38d('0x2')]},'callerIdAll':{'type':Sequelize[_0xc38d('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0xc38d('0x6')]}}; \ No newline at end of file +var _0x8a9a=['exports','STRING','VIRTUAL','system-','getDataValue','name'];(function(_0x106f2d,_0x21645f){var _0x11200d=function(_0x3f2266){while(--_0x3f2266){_0x106f2d['push'](_0x106f2d['shift']());}};_0x11200d(++_0x21645f);}(_0x8a9a,0x13e));var _0xa8a9=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0x8a9a[_0x2b5eae];return _0x5f3ac9;};'use strict';var Sequelize=require('sequelize');module[_0xa8a9('0x0')]={'name':{'type':Sequelize[_0xa8a9('0x1')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0xa8a9('0x2')],'get':function(_0x271563){return _0xa8a9('0x3')+this[_0xa8a9('0x4')](_0xa8a9('0x5'))+'-';}},'description':{'type':Sequelize[_0xa8a9('0x1')]},'callerIdAll':{'type':Sequelize[_0xa8a9('0x1')]},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index c05a994..d334b54 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 _0xdd4f=['lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./voicePrefix.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','get','VoicePrefixes','UserProfileResource','destroy','error','stack','name','send','map','VoicePrefix','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','describe','create','transaction','body','VoiceExtension','find','VoiceExtensionId','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','exten','app','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','Set','CDR(prefix)=','callerIdAll','push','PREFIX-CALLERIDALL=','No\x20callerid\x20available','charAt','update','system-','sequelize','findById','addAgents','spread','ids','emit','userVoicePrefix:save','removeAgents','isArray','getAgents','findOne','rawAttributes','order','getTeams','Team','nolimit','findAll','User','Agents','online','voicePause','interface','flatMap','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','forEach','select','field','tq.TeamId','from','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','union','compact','removeTeams','userVoicePrefix:remove','eml-format','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra'];(function(_0x3a5b25,_0x369069){var _0x4d8720=function(_0x4713a9){while(--_0x4713a9){_0x3a5b25['push'](_0x3a5b25['shift']());}};_0x4d8720(++_0x369069);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x25b456,_0x588613){_0x25b456=_0x25b456-0x0;var _0x44d453=_0xdd4f[_0x25b456];return _0x44d453;};'use strict';var emlformat=require(_0xfdd4('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xfdd4('0x1'));var moment=require(_0xfdd4('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xfdd4('0x3'));var util=require(_0xfdd4('0x4'));var path=require(_0xfdd4('0x5'));var sox=require('sox');var csv=require(_0xfdd4('0x6'));var ejs=require(_0xfdd4('0x7'));var fs=require('fs');var fs_extra=require(_0xfdd4('0x8'));var _=require(_0xfdd4('0x9'));var squel=require(_0xfdd4('0xa'));var crypto=require('crypto');var jsforce=require(_0xfdd4('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xfdd4('0x6'));var querystring=require(_0xfdd4('0xc'));var Papa=require(_0xfdd4('0xd'));var Redis=require('ioredis');var authService=require(_0xfdd4('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xfdd4('0xf'));var hardwareService=require(_0xfdd4('0x10'));var logger=require(_0xfdd4('0x11'))(_0xfdd4('0x12'));var utils=require(_0xfdd4('0x13'));var config=require(_0xfdd4('0x14'));var licenseUtil=require(_0xfdd4('0x15'));var db=require(_0xfdd4('0x16'))['db'];config[_0xfdd4('0x17')]=_[_0xfdd4('0x18')](config[_0xfdd4('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xfdd4('0x19'))(new Redis(config[_0xfdd4('0x17')]));require(_0xfdd4('0x1a'))['register'](socket);function respondWithStatusCode(_0x1b7da1,_0x4aaeee){_0x4aaeee=_0x4aaeee||0xcc;return function(_0x467824){if(_0x467824){return _0x1b7da1[_0xfdd4('0x1b')](_0x4aaeee);}return _0x1b7da1[_0xfdd4('0x1c')](_0x4aaeee)[_0xfdd4('0x1d')]();};}function respondWithResult(_0x37b05f,_0x52cf2c){_0x52cf2c=_0x52cf2c||0xc8;return function(_0x47ed1d){if(_0x47ed1d){return _0x37b05f['status'](_0x52cf2c)[_0xfdd4('0x1e')](_0x47ed1d);}};}function respondWithFilteredResult(_0x216c7e,_0x2eb174){return function(_0x2ccc88){if(_0x2ccc88){var _0x32b5f7=typeof _0x2eb174[_0xfdd4('0x1f')]===_0xfdd4('0x20')&&typeof _0x2eb174[_0xfdd4('0x21')]===_0xfdd4('0x20');var _0x52ce34=_0x2ccc88[_0xfdd4('0x22')];var _0x3e8eac=_0x32b5f7?0x0:_0x2eb174[_0xfdd4('0x1f')];var _0x36e611=_0x32b5f7?_0x2ccc88[_0xfdd4('0x22')]:_0x2eb174[_0xfdd4('0x1f')]+_0x2eb174[_0xfdd4('0x21')];var _0x34dfa8;if(_0x36e611>=_0x52ce34){_0x36e611=_0x52ce34;_0x34dfa8=0xc8;}else{_0x34dfa8=0xce;}_0x216c7e['status'](_0x34dfa8);return _0x216c7e[_0xfdd4('0x23')](_0xfdd4('0x24'),_0x3e8eac+'-'+_0x36e611+'/'+_0x52ce34)[_0xfdd4('0x1e')](_0x2ccc88);}return null;};}function patchUpdates(_0x16e81b){return function(_0xb7856d){try{jsonpatch[_0xfdd4('0x25')](_0xb7856d,_0x16e81b,!![]);}catch(_0x451767){return BPromise[_0xfdd4('0x26')](_0x451767);}return _0xb7856d['save']();};}function saveUpdates(_0x1e14da,_0x1112e8){return function(_0x4397a3){if(_0x4397a3){return _0x4397a3['update'](_0x1e14da)[_0xfdd4('0x27')](function(_0x39b712){return _0x39b712;});}return null;};}function removeEntity(_0xf9c346,_0x2f8268){return function(_0x1ade42){if(_0x1ade42){return _0x1ade42['destroy']()[_0xfdd4('0x27')](function(){var _0x2c88ad=_0x1ade42[_0xfdd4('0x28')]({'plain':!![]});var _0x31e053=_0xfdd4('0x29');return db[_0xfdd4('0x2a')][_0xfdd4('0x2b')]({'where':{'type':_0x31e053,'resourceId':_0x2c88ad['id']}})[_0xfdd4('0x27')](function(){return _0x1ade42;});})['then'](function(){_0xf9c346[_0xfdd4('0x1c')](0xcc)[_0xfdd4('0x1d')]();});}};}function handleEntityNotFound(_0x385a68,_0xef012e){return function(_0x2207ae){if(!_0x2207ae){_0x385a68['sendStatus'](0x194);}return _0x2207ae;};}function handleError(_0xd127b1,_0x3372d2){_0x3372d2=_0x3372d2||0x1f4;return function(_0xbf38b4){logger[_0xfdd4('0x2c')](_0xbf38b4[_0xfdd4('0x2d')]);if(_0xbf38b4['name']){delete _0xbf38b4[_0xfdd4('0x2e')];}_0xd127b1[_0xfdd4('0x1c')](_0x3372d2)[_0xfdd4('0x2f')](_0xbf38b4);};}exports['index']=function(_0x3fd07a,_0x502776){var _0x2a65c8={},_0x2b22f9={},_0x4aa4f2={'count':0x0,'rows':[]};var _0x50b748=_[_0xfdd4('0x30')](db[_0xfdd4('0x31')]['rawAttributes'],function(_0x557d7b){return{'name':_0x557d7b[_0xfdd4('0x32')],'type':_0x557d7b[_0xfdd4('0x33')][_0xfdd4('0x34')]};});_0x2b22f9[_0xfdd4('0x35')]=_[_0xfdd4('0x30')](_0x50b748,_0xfdd4('0x2e'));_0x2b22f9[_0xfdd4('0x36')]=_[_0xfdd4('0x37')](_0x3fd07a[_0xfdd4('0x36')]);_0x2b22f9[_0xfdd4('0x38')]=_[_0xfdd4('0x39')](_0x2b22f9[_0xfdd4('0x35')],_0x2b22f9[_0xfdd4('0x36')]);_0x2a65c8[_0xfdd4('0x3a')]=_[_0xfdd4('0x39')](_0x2b22f9[_0xfdd4('0x35')],qs[_0xfdd4('0x3b')](_0x3fd07a[_0xfdd4('0x36')][_0xfdd4('0x3b')]));_0x2a65c8[_0xfdd4('0x3a')]=_0x2a65c8[_0xfdd4('0x3a')][_0xfdd4('0x3c')]?_0x2a65c8[_0xfdd4('0x3a')]:_0x2b22f9[_0xfdd4('0x35')];if(!_0x3fd07a[_0xfdd4('0x36')][_0xfdd4('0x3d')]('nolimit')){_0x2a65c8[_0xfdd4('0x21')]=qs[_0xfdd4('0x21')](_0x3fd07a[_0xfdd4('0x36')][_0xfdd4('0x21')]);_0x2a65c8[_0xfdd4('0x1f')]=qs[_0xfdd4('0x1f')](_0x3fd07a['query'][_0xfdd4('0x1f')]);}_0x2a65c8['order']=qs[_0xfdd4('0x3e')](_0x3fd07a[_0xfdd4('0x36')][_0xfdd4('0x3e')]);_0x2a65c8[_0xfdd4('0x3f')]=qs['filters'](_[_0xfdd4('0x40')](_0x3fd07a[_0xfdd4('0x36')],_0x2b22f9[_0xfdd4('0x38')]),_0x50b748);if(_0x3fd07a[_0xfdd4('0x36')][_0xfdd4('0x41')]){_0x2a65c8[_0xfdd4('0x3f')]=_[_0xfdd4('0x42')](_0x2a65c8[_0xfdd4('0x3f')],{'$or':_[_0xfdd4('0x30')](_0x50b748,function(_0x83673d){if(_0x83673d['type']!==_0xfdd4('0x43')){var _0x2196f={};_0x2196f[_0x83673d[_0xfdd4('0x2e')]]={'$like':'%'+_0x3fd07a[_0xfdd4('0x36')]['filter']+'%'};return _0x2196f;}})});}_0x2a65c8=_[_0xfdd4('0x42')]({},_0x2a65c8,_0x3fd07a[_0xfdd4('0x44')]);var _0x30524f={'where':_0x2a65c8[_0xfdd4('0x3f')]};return db[_0xfdd4('0x31')]['count'](_0x30524f)[_0xfdd4('0x27')](function(_0x23af2a){_0x4aa4f2[_0xfdd4('0x22')]=_0x23af2a;if(_0x3fd07a[_0xfdd4('0x36')][_0xfdd4('0x45')]){_0x2a65c8[_0xfdd4('0x46')]=[{'all':!![]}];}return db[_0xfdd4('0x31')]['findAll'](_0x2a65c8);})[_0xfdd4('0x27')](function(_0x586713){_0x4aa4f2[_0xfdd4('0x47')]=_0x586713;return _0x4aa4f2;})[_0xfdd4('0x27')](respondWithFilteredResult(_0x502776,_0x2a65c8))[_0xfdd4('0x48')](handleError(_0x502776,null));};exports[_0xfdd4('0x49')]=function(_0x5367aa,_0x419578){var _0x11e90a={'raw':![],'where':{'id':_0x5367aa[_0xfdd4('0x4a')]['id']}},_0x4d1dfe={};_0x4d1dfe[_0xfdd4('0x35')]=_['keys'](db[_0xfdd4('0x31')]['rawAttributes']);_0x4d1dfe['query']=_['keys'](_0x5367aa[_0xfdd4('0x36')]);_0x4d1dfe[_0xfdd4('0x38')]=_[_0xfdd4('0x39')](_0x4d1dfe['model'],_0x4d1dfe[_0xfdd4('0x36')]);_0x11e90a[_0xfdd4('0x3a')]=_['intersection'](_0x4d1dfe[_0xfdd4('0x35')],qs[_0xfdd4('0x3b')](_0x5367aa[_0xfdd4('0x36')][_0xfdd4('0x3b')]));_0x11e90a[_0xfdd4('0x3a')]=_0x11e90a[_0xfdd4('0x3a')][_0xfdd4('0x3c')]?_0x11e90a[_0xfdd4('0x3a')]:_0x4d1dfe[_0xfdd4('0x35')];if(_0x5367aa[_0xfdd4('0x36')][_0xfdd4('0x45')]){_0x11e90a[_0xfdd4('0x46')]=[{'all':!![]}];}_0x11e90a=_[_0xfdd4('0x42')]({},_0x11e90a,_0x5367aa[_0xfdd4('0x44')]);return db['VoicePrefix']['find'](_0x11e90a)[_0xfdd4('0x27')](handleEntityNotFound(_0x419578,null))[_0xfdd4('0x27')](respondWithResult(_0x419578,null))[_0xfdd4('0x48')](handleError(_0x419578,null));};exports[_0xfdd4('0x2b')]=function(_0x507bf5,_0x3c6828){return db[_0xfdd4('0x31')]['find']({'where':{'id':_0x507bf5['params']['id']}})['then'](handleEntityNotFound(_0x3c6828,null))['then'](removeEntity(_0x3c6828,null))['catch'](handleError(_0x3c6828,null));};exports[_0xfdd4('0x4b')]=function(_0x88e9ef,_0x3a4202){return db[_0xfdd4('0x31')][_0xfdd4('0x4b')]()[_0xfdd4('0x27')](respondWithResult(_0x3a4202,null))['catch'](handleError(_0x3a4202,null));};exports[_0xfdd4('0x4c')]=function(_0x1f521a,_0x1dd417){var _0x2355b5;return db['sequelize'][_0xfdd4('0x4d')](function(_0x8aa0ea){return db['VoicePrefix'][_0xfdd4('0x4c')](_0x1f521a[_0xfdd4('0x4e')],{'transaction':_0x8aa0ea})['then'](function(_0x5467d1){_0x2355b5=_0x5467d1[_0xfdd4('0x28')]({'plain':!![]});return db[_0xfdd4('0x4f')][_0xfdd4('0x50')]({'where':{'id':_0x2355b5[_0xfdd4('0x51')]},'raw':!![]})[_0xfdd4('0x27')](function(_0x1b9979){return createVoicePrefixExtensions(_0x2355b5,_0x1b9979,_0x8aa0ea);});});})[_0xfdd4('0x27')](function(){var _0x3de4fd=_0x1f521a['user'][_0xfdd4('0x28')]({'plain':!![]});if(!_0x3de4fd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3de4fd['role']===_0xfdd4('0x52')){var _0x1d9a8d=_0x2355b5;return db['UserProfileSection']['find']({'where':{'name':'VoicePrefixes','userProfileId':_0x3de4fd[_0xfdd4('0x53')]},'raw':!![]})[_0xfdd4('0x27')](function(_0x4dc113){if(_0x4dc113&&_0x4dc113[_0xfdd4('0x54')]===0x0){return db[_0xfdd4('0x2a')][_0xfdd4('0x4c')]({'name':_0x1d9a8d[_0xfdd4('0x2e')],'resourceId':_0x1d9a8d['id'],'type':_0x4dc113[_0xfdd4('0x2e')],'sectionId':_0x4dc113['id']},{})['then'](function(){return _0x2355b5;});}else{return _0x2355b5;}})['catch'](function(_0x483942){logger['error'](_0xfdd4('0x55'),_0x483942);throw _0x483942;});}return _0x2355b5;})[_0xfdd4('0x27')](respondWithResult(_0x1dd417,null))['catch'](handleError(_0x1dd417,null));};function Extension(_0x1eee3d,_0x2abe50,_0x4d4304,_0x45dcc8){this[_0xfdd4('0x56')]='from-sip';this[_0xfdd4('0x57')]=_0x1eee3d;this[_0xfdd4('0x58')]=_0x4d4304;this[_0xfdd4('0x33')]='system';this[_0xfdd4('0x59')]=_0xfdd4('0x5a');this[_0xfdd4('0x5b')]=_0x2abe50;this[_0xfdd4('0x5c')]=_0x45dcc8;}function createVoicePrefixExtensions(_0x5c7be,_0x562417,_0x2cc3e2){return new BPromise(function(_0x2ee4b6,_0x3be4d5){var _0x202124=new Extension(formatPrefixName(_0x5c7be[_0xfdd4('0x5d')]),0x1,_0xfdd4('0x5e'),_0xfdd4('0x5f'));_0x202124[_0xfdd4('0x60')]=_0x5c7be['id'];return db[_0xfdd4('0x4f')]['create'](_0x202124,{'transaction':_0x2cc3e2})[_0xfdd4('0x27')](function(_0x2799b2){var _0x4483e1=_0x2799b2[_0xfdd4('0x28')]({'plain':!![]});var _0x3096fa=_['map'](addVoicePrefixExtensions(_0x5c7be,_0x562417),function(_0x46e7eb){_0x46e7eb[_0xfdd4('0x51')]=_0x4483e1['id'];_0x46e7eb[_0xfdd4('0x60')]=_0x5c7be['id'];return _0x46e7eb;});return db[_0xfdd4('0x4f')][_0xfdd4('0x61')](_0x3096fa,{'transaction':_0x2cc3e2})[_0xfdd4('0x27')](function(_0x180ad9){if(!_0x180ad9){return _0x3be4d5(_0xfdd4('0x62'));}else{return _0x2ee4b6(_0x180ad9);}})[_0xfdd4('0x48')](function(_0x2a0dd8){return _0x3be4d5(_0x2a0dd8);});});;});};function addVoicePrefixExtensions(_0x2fff30,_0x2792c4){var _0x1205b8=[];var _0x527068=formatPrefixName(_0x2fff30[_0xfdd4('0x5d')]);_0x1205b8['push'](new Extension(_0x527068,0x2,_0xfdd4('0x63'),_0xfdd4('0x64')+_0x2fff30[_0xfdd4('0x2e')]));if(_0x2fff30[_0xfdd4('0x65')]){_0x1205b8[_0xfdd4('0x66')](new Extension(_0x527068,0x3,_0xfdd4('0x63'),_0xfdd4('0x67')+_0x2fff30[_0xfdd4('0x65')]));}else{_0x1205b8[_0xfdd4('0x66')](new Extension(_0x527068,0x3,_0xfdd4('0x5e'),_0xfdd4('0x68')));}_0x1205b8[_0xfdd4('0x66')](new Extension(_0x527068,0x4,'goto',_0x2792c4['context']+','+'${EXTEN:'+(0x8+_0x2fff30[_0xfdd4('0x2e')][_0xfdd4('0x3c')])+'}'+','+0x1));return _0x1205b8;}function formatPrefixName(_0x4bb18b){var _0x3a367c='_';for(var _0x3f027b=0x0;_0x3f027b<_0x4bb18b[_0xfdd4('0x3c')];_0x3f027b++){if(_0x4bb18b[_0xfdd4('0x69')](_0x3f027b)=='-'){_0x3a367c+=_0x4bb18b[_0xfdd4('0x69')](_0x3f027b);}else{_0x3a367c+='['+_0x4bb18b['charAt'](_0x3f027b)+']';}}_0x3a367c+='.';return _0x3a367c;}exports[_0xfdd4('0x6a')]=function(_0x297432,_0x3958cd,_0x523085){var _0x366f1c=_0x297432['body'];_0x366f1c[_0xfdd4('0x5d')]=_0xfdd4('0x6b')+_0x366f1c[_0xfdd4('0x2e')]+'-';return db[_0xfdd4('0x6c')]['transaction'](function(_0x2351b6){return db[_0xfdd4('0x31')]['update'](_0x366f1c,{'where':{'id':_0x366f1c['id']},'transaction':_0x2351b6})[_0xfdd4('0x27')](function(){return db[_0xfdd4('0x4f')][_0xfdd4('0x2b')]({'where':{'VoicePrefixId':_0x366f1c['id']},'transaction':_0x2351b6})['then'](function(){return db[_0xfdd4('0x4f')][_0xfdd4('0x50')]({'where':{'id':_0x366f1c[_0xfdd4('0x51')]},'raw':!![]})['then'](function(_0x3f4337){return createVoicePrefixExtensions(_0x366f1c,_0x3f4337,_0x2351b6);});});});})[_0xfdd4('0x27')](function(){return db[_0xfdd4('0x31')][_0xfdd4('0x6d')](_0x366f1c['id']);})[_0xfdd4('0x27')](respondWithResult(_0x3958cd,null))[_0xfdd4('0x48')](handleError(_0x3958cd,null));};exports[_0xfdd4('0x6e')]=function(_0x539d3b,_0x147d54,_0x36b615){return db[_0xfdd4('0x31')][_0xfdd4('0x50')]({'where':{'id':_0x539d3b[_0xfdd4('0x4a')]['id']}})[_0xfdd4('0x27')](handleEntityNotFound(_0x147d54,null))[_0xfdd4('0x27')](function(_0x4987d6){if(_0x4987d6){return _0x4987d6['addAgents'](_0x539d3b[_0xfdd4('0x4e')]['ids'],_['omit'](_0x539d3b[_0xfdd4('0x4e')],['ids','id'])||{})[_0xfdd4('0x6f')](function(_0x51711a){for(var _0x4576ce=0x0;_0x4576ce<_0x539d3b[_0xfdd4('0x4e')][_0xfdd4('0x70')][_0xfdd4('0x3c')];_0x4576ce+=0x1){socket[_0xfdd4('0x71')](_0xfdd4('0x72'),{'UserId':Number(_0x539d3b[_0xfdd4('0x4e')]['ids'][_0x4576ce]),'VoicePrefixId':Number(_0x539d3b['params']['id'])});}return _0x51711a;});}})[_0xfdd4('0x27')](respondWithResult(_0x147d54,null))['catch'](handleError(_0x147d54,null));};exports[_0xfdd4('0x73')]=function(_0x1a82ee,_0x3b205f,_0x1d57f8){return db[_0xfdd4('0x31')][_0xfdd4('0x50')]({'where':{'id':_0x1a82ee[_0xfdd4('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3b205f,null))['then'](function(_0x37a342){if(_0x37a342){return _0x37a342[_0xfdd4('0x73')](_0x1a82ee[_0xfdd4('0x36')][_0xfdd4('0x70')])[_0xfdd4('0x27')](function(){if(_[_0xfdd4('0x74')](_0x1a82ee[_0xfdd4('0x36')][_0xfdd4('0x70')])){for(var _0xf78c69=0x0;_0xf78c69<_0x1a82ee[_0xfdd4('0x36')][_0xfdd4('0x70')][_0xfdd4('0x3c')];_0xf78c69+=0x1){socket[_0xfdd4('0x71')]('userVoicePrefix:remove',{'UserId':Number(_0x1a82ee['query'][_0xfdd4('0x70')][_0xf78c69]),'VoicePrefixId':Number(_0x1a82ee[_0xfdd4('0x4a')]['id'])});}}else{socket['emit']('userVoicePrefix:remove',{'UserId':Number(_0x1a82ee[_0xfdd4('0x36')][_0xfdd4('0x70')]),'VoicePrefixId':Number(_0x1a82ee['params']['id'])});}});}})[_0xfdd4('0x27')](respondWithStatusCode(_0x3b205f,null))[_0xfdd4('0x48')](handleError(_0x3b205f,null));};exports[_0xfdd4('0x75')]=function(_0x11db43,_0x5ec62b,_0x25c078){var _0x5d356c={};var _0x3924c7={};var _0x2f65d7;var _0x4783b9;return db[_0xfdd4('0x31')][_0xfdd4('0x76')]({'where':{'id':_0x11db43[_0xfdd4('0x4a')]['id']}})[_0xfdd4('0x27')](handleEntityNotFound(_0x5ec62b,null))[_0xfdd4('0x27')](function(_0x575bc2){if(_0x575bc2){_0x2f65d7=_0x575bc2;_0x3924c7['model']=_[_0xfdd4('0x37')](db['User'][_0xfdd4('0x77')]);_0x3924c7[_0xfdd4('0x36')]=_[_0xfdd4('0x37')](_0x11db43[_0xfdd4('0x36')]);_0x3924c7[_0xfdd4('0x38')]=_['intersection'](_0x3924c7['model'],_0x3924c7[_0xfdd4('0x36')]);_0x5d356c['attributes']=_[_0xfdd4('0x39')](_0x3924c7['model'],qs[_0xfdd4('0x3b')](_0x11db43[_0xfdd4('0x36')][_0xfdd4('0x3b')]));_0x5d356c[_0xfdd4('0x3a')]=_0x5d356c[_0xfdd4('0x3a')][_0xfdd4('0x3c')]?_0x5d356c[_0xfdd4('0x3a')]:_0x3924c7[_0xfdd4('0x35')];_0x5d356c[_0xfdd4('0x78')]=qs[_0xfdd4('0x3e')](_0x11db43[_0xfdd4('0x36')]['sort']);_0x5d356c[_0xfdd4('0x3f')]=qs[_0xfdd4('0x38')](_[_0xfdd4('0x40')](_0x11db43[_0xfdd4('0x36')],_0x3924c7[_0xfdd4('0x38')]));if(_0x11db43[_0xfdd4('0x36')][_0xfdd4('0x41')]){_0x5d356c[_0xfdd4('0x3f')]=_[_0xfdd4('0x42')](_0x5d356c['where'],{'$or':_['map'](_0x5d356c[_0xfdd4('0x3a')],function(_0x244d6d){var _0x30bd32={};_0x30bd32[_0x244d6d]={'$like':'%'+_0x11db43['query'][_0xfdd4('0x41')]+'%'};return _0x30bd32;})});}_0x5d356c=_[_0xfdd4('0x42')]({},_0x5d356c,_0x11db43[_0xfdd4('0x44')]);return _0x2f65d7[_0xfdd4('0x75')](_0x5d356c);}})['then'](function(_0x5868e6){if(_0x5868e6){_0x4783b9=_0x5868e6[_0xfdd4('0x3c')];if(!_0x11db43[_0xfdd4('0x36')][_0xfdd4('0x3d')]('nolimit')){_0x5d356c[_0xfdd4('0x21')]=qs[_0xfdd4('0x21')](_0x11db43[_0xfdd4('0x36')][_0xfdd4('0x21')]);_0x5d356c[_0xfdd4('0x1f')]=qs[_0xfdd4('0x1f')](_0x11db43['query']['offset']);}return _0x2f65d7[_0xfdd4('0x75')](_0x5d356c);}})[_0xfdd4('0x27')](function(_0x6a1410){if(_0x6a1410){return _0x6a1410?{'count':_0x4783b9,'rows':_0x6a1410}:null;}})[_0xfdd4('0x27')](respondWithResult(_0x5ec62b,null))[_0xfdd4('0x48')](handleError(_0x5ec62b,null));};exports[_0xfdd4('0x79')]=function(_0x46edc9,_0x2a4366,_0x5d1a3f){var _0x218d83={};var _0x547c4c={};var _0x464eb0;var _0x1871d6;return db['VoicePrefix'][_0xfdd4('0x76')]({'where':{'id':_0x46edc9[_0xfdd4('0x4a')]['id']}})[_0xfdd4('0x27')](handleEntityNotFound(_0x2a4366,null))[_0xfdd4('0x27')](function(_0x3cd7ae){if(_0x3cd7ae){_0x464eb0=_0x3cd7ae;_0x547c4c[_0xfdd4('0x35')]=_[_0xfdd4('0x37')](db[_0xfdd4('0x7a')][_0xfdd4('0x77')]);_0x547c4c['query']=_[_0xfdd4('0x37')](_0x46edc9['query']);_0x547c4c[_0xfdd4('0x38')]=_['intersection'](_0x547c4c['model'],_0x547c4c[_0xfdd4('0x36')]);_0x218d83[_0xfdd4('0x3a')]=_[_0xfdd4('0x39')](_0x547c4c[_0xfdd4('0x35')],qs[_0xfdd4('0x3b')](_0x46edc9['query'][_0xfdd4('0x3b')]));_0x218d83[_0xfdd4('0x3a')]=_0x218d83[_0xfdd4('0x3a')][_0xfdd4('0x3c')]?_0x218d83[_0xfdd4('0x3a')]:_0x547c4c[_0xfdd4('0x35')];_0x218d83['order']=qs[_0xfdd4('0x3e')](_0x46edc9[_0xfdd4('0x36')]['sort']);_0x218d83['where']=qs[_0xfdd4('0x38')](_[_0xfdd4('0x40')](_0x46edc9[_0xfdd4('0x36')],_0x547c4c['filters']));if(_0x46edc9['query'][_0xfdd4('0x41')]){_0x218d83[_0xfdd4('0x3f')]=_[_0xfdd4('0x42')](_0x218d83['where'],{'$or':_['map'](_0x218d83[_0xfdd4('0x3a')],function(_0xd6eb47){var _0x1927ed={};_0x1927ed[_0xd6eb47]={'$like':'%'+_0x46edc9['query'][_0xfdd4('0x41')]+'%'};return _0x1927ed;})});}_0x218d83=_['merge']({},_0x218d83,_0x46edc9[_0xfdd4('0x44')]);return _0x464eb0[_0xfdd4('0x79')](_0x218d83);}})[_0xfdd4('0x27')](function(_0x4e1dbc){if(_0x4e1dbc){_0x1871d6=_0x4e1dbc[_0xfdd4('0x3c')];if(!_0x46edc9[_0xfdd4('0x36')][_0xfdd4('0x3d')](_0xfdd4('0x7b'))){_0x218d83[_0xfdd4('0x21')]=qs['limit'](_0x46edc9[_0xfdd4('0x36')][_0xfdd4('0x21')]);_0x218d83[_0xfdd4('0x1f')]=qs['offset'](_0x46edc9[_0xfdd4('0x36')][_0xfdd4('0x1f')]);}return _0x464eb0[_0xfdd4('0x79')](_0x218d83);}})[_0xfdd4('0x27')](function(_0x56e5d3){if(_0x56e5d3){return _0x56e5d3?{'count':_0x1871d6,'rows':_0x56e5d3}:null;}})[_0xfdd4('0x27')](respondWithResult(_0x2a4366,null))['catch'](handleError(_0x2a4366,null));};exports['addTeams']=function(_0x528004,_0x206a59,_0x545475){var _0x5e5362=_0x528004['body'][_0xfdd4('0x70')];var _0x728e25;return db[_0xfdd4('0x7a')][_0xfdd4('0x7c')]({'where':{'id':_0x5e5362},'attributes':['id'],'include':[{'model':db[_0xfdd4('0x7d')],'as':_0xfdd4('0x7e'),'attributes':['id',_0xfdd4('0x2e'),_0xfdd4('0x7f'),_0xfdd4('0x80'),_0xfdd4('0x81')],'raw':!![]}]})[_0xfdd4('0x27')](function(_0x2911ca){if(_0x2911ca){_0x728e25=_0x2911ca;var _0x31303f=_[_0xfdd4('0x82')](_0x2911ca,function(_0x46b927){var _0x450c67=_0x46b927[_0xfdd4('0x28')]({'plain':!![]});return _0x450c67[_0xfdd4('0x7e')];});return db[_0xfdd4('0x31')][_0xfdd4('0x50')]({'where':{'id':_0x528004[_0xfdd4('0x4a')]['id']}})[_0xfdd4('0x27')](function(_0x189baf){return db[_0xfdd4('0x6c')][_0xfdd4('0x4d')](function(_0x22f93b){return _0x189baf['addTeams'](_0x5e5362,{'transaction':_0x22f93b})[_0xfdd4('0x27')](function(){return BPromise[_0xfdd4('0x83')](_0x728e25,function(_0xaef5e2){return db[_0xfdd4('0x84')][_0xfdd4('0x85')]({'TeamId':_0xaef5e2['id'],'VoicePrefixId':_0x528004['params']['id']},{'transaction':_0x22f93b});});})[_0xfdd4('0x27')](function(){return BPromise[_0xfdd4('0x83')](_0x31303f,function(_0x19b679){return db[_0xfdd4('0x86')][_0xfdd4('0x87')]({'where':{'UserId':_0x19b679['id'],'VoicePrefixId':_0x528004[_0xfdd4('0x4a')]['id']},'transaction':_0x22f93b});});})['then'](function(){_0x31303f[_0xfdd4('0x88')](function(_0x1a9e62){socket[_0xfdd4('0x71')](_0xfdd4('0x72'),{'UserId':_0x1a9e62['id'],'VoicePrefixId':_0x189baf['id']});});});});});}})[_0xfdd4('0x27')](respondWithStatusCode(_0x206a59,null))[_0xfdd4('0x48')](handleError(_0x206a59,null));};exports['removeTeams']=function(_0x2a6a0d,_0x3d82d1,_0x17d272){return db['Team'][_0xfdd4('0x7c')]({'where':{'id':_0x2a6a0d[_0xfdd4('0x36')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0xfdd4('0x7e'),'attributes':['id'],'raw':!![]}]})[_0xfdd4('0x27')](handleEntityNotFound(_0x3d82d1,null))[_0xfdd4('0x27')](function(_0xd07645){var _0x5a3249=_[_0xfdd4('0x30')](_0xd07645,'id');var _0x5b22b1=[];var _0xc9955e=[];var _0x42204a=squel[_0xfdd4('0x89')]();_0x42204a[_0xfdd4('0x8a')](_0xfdd4('0x8b'))[_0xfdd4('0x8c')](_0xfdd4('0x8d'),'tq')[_0xfdd4('0x8e')](_0xfdd4('0x8f'),'ut',_0xfdd4('0x90'))[_0xfdd4('0x3f')]('VoicePrefixId\x20=\x20?',_0x2a6a0d[_0xfdd4('0x4a')]['id']);for(var _0x42a3dc=0x0;_0x42a3dc<_0xd07645[_0xfdd4('0x3c')];_0x42a3dc+=0x1){let _0x26316c=_0xd07645[_0x42a3dc];for(var _0x1e7bbb=0x0;_0x1e7bbb<_0x26316c[_0xfdd4('0x7e')]['length'];_0x1e7bbb+=0x1){let _0xfd0c1=_0x26316c[_0xfdd4('0x7e')][_0x1e7bbb];var _0x2ae92=_0x42204a[_0xfdd4('0x91')]();_0x2ae92['where'](_0xfdd4('0x92'),_0xfd0c1['id']);_0xc9955e[_0xfdd4('0x66')](db['sequelize'][_0xfdd4('0x36')](_0x2ae92[_0xfdd4('0x93')](),{'type':db[_0xfdd4('0x6c')][_0xfdd4('0x94')][_0xfdd4('0x95')]})[_0xfdd4('0x27')](function(_0x191ab6){if(_0x191ab6[_0xfdd4('0x3c')]===0x1){return _0xfd0c1['id'];}else{var _0x1d460f=_[_0xfdd4('0x96')](_[_0xfdd4('0x30')](_0x191ab6,_0xfdd4('0x97')),function(_0x25c508){return _[_0xfdd4('0x98')](_0x5a3249,_0x25c508);});if(_0x1d460f){return _0xfd0c1['id'];}}}));}}return BPromise['all'](_0xc9955e)[_0xfdd4('0x27')](function(_0x349fc6){_0x5b22b1=_(_0x5b22b1)[_0xfdd4('0x99')](_0x349fc6)[_0xfdd4('0x9a')]()['value']();return db[_0xfdd4('0x31')][_0xfdd4('0x50')]({'where':{'id':_0x2a6a0d['params']['id']}})[_0xfdd4('0x27')](function(_0x401681){return db[_0xfdd4('0x6c')][_0xfdd4('0x4d')](function(_0x5a7c85){return _0x401681[_0xfdd4('0x9b')](_0x2a6a0d['query'][_0xfdd4('0x70')],{'transaction':_0x5a7c85})[_0xfdd4('0x27')](function(){if(!_['isEmpty'](_0x5b22b1)){return _0x401681[_0xfdd4('0x73')](_0x5b22b1,{'transaction':_0x5a7c85});}})['then'](function(){_0x5b22b1['forEach'](function(_0x10a396){socket[_0xfdd4('0x71')](_0xfdd4('0x9c'),{'UserId':_0x10a396,'VoicePrefixId':_0x401681['id']});});});});});});})[_0xfdd4('0x27')](respondWithStatusCode(_0x3d82d1,null))['catch'](handleError(_0x3d82d1,null));}; \ No newline at end of file +var _0xd914=['Voice\x20Prefix\x20Extension','priority','appdata','prefix','Voice\x20Prefix','VoicePrefixId','bulkCreate','push','Set','PREFIX-CALLERIDALL=','callerIdAll','NoOp','No\x20callerid\x20available','goto','${EXTEN:','charAt','update','sequelize','findById','addAgents','ids','omit','emit','removeAgents','isArray','userVoicePrefix:remove','findOne','User','pick','getAgents','hasOwnProperty','nolimit','getTeams','Team','addTeams','Agents','online','voicePause','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','forEach','userVoicePrefix:save','removeTeams','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','union','compact','value','isEmpty','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./voicePrefix.socket','register','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','destroy','then','VoicePrefixes','UserProfileResource','sendStatus','error','stack','name','send','map','VoicePrefix','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','describe','create','transaction','body','get','VoiceExtension','VoiceExtensionId','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','app','type','system','description'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xd914,0x17f));var _0x4d91=function(_0xfd9b19,_0x21d75f){_0xfd9b19=_0xfd9b19-0x0;var _0x514918=_0xd914[_0xfd9b19];return _0x514918;};'use strict';var emlformat=require(_0x4d91('0x0'));var rimraf=require(_0x4d91('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4d91('0x2'));var rp=require(_0x4d91('0x3'));var moment=require(_0x4d91('0x4'));var BPromise=require(_0x4d91('0x5'));var Mustache=require(_0x4d91('0x6'));var util=require(_0x4d91('0x7'));var path=require('path');var sox=require(_0x4d91('0x8'));var csv=require('to-csv');var ejs=require(_0x4d91('0x9'));var fs=require('fs');var fs_extra=require(_0x4d91('0xa'));var _=require(_0x4d91('0xb'));var squel=require(_0x4d91('0xc'));var crypto=require(_0x4d91('0xd'));var jsforce=require(_0x4d91('0xe'));var deskjs=require(_0x4d91('0xf'));var toCsv=require(_0x4d91('0x10'));var querystring=require('querystring');var Papa=require(_0x4d91('0x11'));var Redis=require(_0x4d91('0x12'));var authService=require(_0x4d91('0x13'));var qs=require(_0x4d91('0x14'));var as=require(_0x4d91('0x15'));var hardwareService=require(_0x4d91('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x4d91('0x17'));var config=require(_0x4d91('0x18'));var licenseUtil=require(_0x4d91('0x19'));var db=require(_0x4d91('0x1a'))['db'];config[_0x4d91('0x1b')]=_[_0x4d91('0x1c')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4d91('0x1d'))(new Redis(config[_0x4d91('0x1b')]));require(_0x4d91('0x1e'))[_0x4d91('0x1f')](socket);function respondWithStatusCode(_0x33fbd4,_0x25bafc){_0x25bafc=_0x25bafc||0xcc;return function(_0x36f606){if(_0x36f606){return _0x33fbd4['sendStatus'](_0x25bafc);}return _0x33fbd4[_0x4d91('0x20')](_0x25bafc)[_0x4d91('0x21')]();};}function respondWithResult(_0x1e2ef7,_0xb92681){_0xb92681=_0xb92681||0xc8;return function(_0x280e80){if(_0x280e80){return _0x1e2ef7['status'](_0xb92681)[_0x4d91('0x22')](_0x280e80);}};}function respondWithFilteredResult(_0xb75abf,_0x241564){return function(_0x44b9a7){if(_0x44b9a7){var _0x4cfa40=typeof _0x241564[_0x4d91('0x23')]===_0x4d91('0x24')&&typeof _0x241564[_0x4d91('0x25')]==='undefined';var _0x13ef2c=_0x44b9a7[_0x4d91('0x26')];var _0x351388=_0x4cfa40?0x0:_0x241564[_0x4d91('0x23')];var _0x10b767=_0x4cfa40?_0x44b9a7[_0x4d91('0x26')]:_0x241564[_0x4d91('0x23')]+_0x241564[_0x4d91('0x25')];var _0x30d911;if(_0x10b767>=_0x13ef2c){_0x10b767=_0x13ef2c;_0x30d911=0xc8;}else{_0x30d911=0xce;}_0xb75abf[_0x4d91('0x20')](_0x30d911);return _0xb75abf['set'](_0x4d91('0x27'),_0x351388+'-'+_0x10b767+'/'+_0x13ef2c)['json'](_0x44b9a7);}return null;};}function patchUpdates(_0x57913e){return function(_0x74a697){try{jsonpatch[_0x4d91('0x28')](_0x74a697,_0x57913e,!![]);}catch(_0x341d18){return BPromise[_0x4d91('0x29')](_0x341d18);}return _0x74a697[_0x4d91('0x2a')]();};}function saveUpdates(_0x12b722,_0x100cd4){return function(_0x123606){if(_0x123606){return _0x123606['update'](_0x12b722)['then'](function(_0x1ee6b3){return _0x1ee6b3;});}return null;};}function removeEntity(_0x112923,_0x3bed98){return function(_0x45fc91){if(_0x45fc91){return _0x45fc91[_0x4d91('0x2b')]()[_0x4d91('0x2c')](function(){var _0x14bdb4=_0x45fc91['get']({'plain':!![]});var _0x3dc353=_0x4d91('0x2d');return db[_0x4d91('0x2e')]['destroy']({'where':{'type':_0x3dc353,'resourceId':_0x14bdb4['id']}})['then'](function(){return _0x45fc91;});})[_0x4d91('0x2c')](function(){_0x112923[_0x4d91('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x50fe76,_0x42d5a0){return function(_0x2d6981){if(!_0x2d6981){_0x50fe76[_0x4d91('0x2f')](0x194);}return _0x2d6981;};}function handleError(_0x17c7bc,_0x4f23dd){_0x4f23dd=_0x4f23dd||0x1f4;return function(_0x2587a1){logger[_0x4d91('0x30')](_0x2587a1[_0x4d91('0x31')]);if(_0x2587a1[_0x4d91('0x32')]){delete _0x2587a1[_0x4d91('0x32')];}_0x17c7bc[_0x4d91('0x20')](_0x4f23dd)[_0x4d91('0x33')](_0x2587a1);};}exports['index']=function(_0x82f585,_0x4f44ff){var _0x4ad7bf={},_0x292808={},_0x3a2780={'count':0x0,'rows':[]};var _0x4f95f0=_[_0x4d91('0x34')](db[_0x4d91('0x35')][_0x4d91('0x36')],function(_0x2be3f5){return{'name':_0x2be3f5[_0x4d91('0x37')],'type':_0x2be3f5['type'][_0x4d91('0x38')]};});_0x292808[_0x4d91('0x39')]=_[_0x4d91('0x34')](_0x4f95f0,_0x4d91('0x32'));_0x292808[_0x4d91('0x3a')]=_[_0x4d91('0x3b')](_0x82f585['query']);_0x292808[_0x4d91('0x3c')]=_[_0x4d91('0x3d')](_0x292808['model'],_0x292808[_0x4d91('0x3a')]);_0x4ad7bf[_0x4d91('0x3e')]=_[_0x4d91('0x3d')](_0x292808['model'],qs[_0x4d91('0x3f')](_0x82f585[_0x4d91('0x3a')][_0x4d91('0x3f')]));_0x4ad7bf[_0x4d91('0x3e')]=_0x4ad7bf['attributes'][_0x4d91('0x40')]?_0x4ad7bf[_0x4d91('0x3e')]:_0x292808[_0x4d91('0x39')];if(!_0x82f585[_0x4d91('0x3a')]['hasOwnProperty']('nolimit')){_0x4ad7bf[_0x4d91('0x25')]=qs[_0x4d91('0x25')](_0x82f585['query'][_0x4d91('0x25')]);_0x4ad7bf[_0x4d91('0x23')]=qs[_0x4d91('0x23')](_0x82f585[_0x4d91('0x3a')]['offset']);}_0x4ad7bf[_0x4d91('0x41')]=qs[_0x4d91('0x42')](_0x82f585['query'][_0x4d91('0x42')]);_0x4ad7bf['where']=qs[_0x4d91('0x3c')](_['pick'](_0x82f585[_0x4d91('0x3a')],_0x292808['filters']),_0x4f95f0);if(_0x82f585[_0x4d91('0x3a')][_0x4d91('0x43')]){_0x4ad7bf[_0x4d91('0x44')]=_[_0x4d91('0x45')](_0x4ad7bf['where'],{'$or':_['map'](_0x4f95f0,function(_0x25e0f5){if(_0x25e0f5['type']!==_0x4d91('0x46')){var _0x282d64={};_0x282d64[_0x25e0f5['name']]={'$like':'%'+_0x82f585[_0x4d91('0x3a')][_0x4d91('0x43')]+'%'};return _0x282d64;}})});}_0x4ad7bf=_[_0x4d91('0x45')]({},_0x4ad7bf,_0x82f585[_0x4d91('0x47')]);var _0x1c6d0b={'where':_0x4ad7bf[_0x4d91('0x44')]};return db[_0x4d91('0x35')]['count'](_0x1c6d0b)[_0x4d91('0x2c')](function(_0x4c70af){_0x3a2780[_0x4d91('0x26')]=_0x4c70af;if(_0x82f585[_0x4d91('0x3a')][_0x4d91('0x48')]){_0x4ad7bf[_0x4d91('0x49')]=[{'all':!![]}];}return db[_0x4d91('0x35')][_0x4d91('0x4a')](_0x4ad7bf);})['then'](function(_0x4ffc08){_0x3a2780[_0x4d91('0x4b')]=_0x4ffc08;return _0x3a2780;})[_0x4d91('0x2c')](respondWithFilteredResult(_0x4f44ff,_0x4ad7bf))['catch'](handleError(_0x4f44ff,null));};exports[_0x4d91('0x4c')]=function(_0x164658,_0x342de1){var _0x3f8659={'raw':![],'where':{'id':_0x164658[_0x4d91('0x4d')]['id']}},_0x31f21a={};_0x31f21a[_0x4d91('0x39')]=_[_0x4d91('0x3b')](db[_0x4d91('0x35')]['rawAttributes']);_0x31f21a['query']=_[_0x4d91('0x3b')](_0x164658['query']);_0x31f21a[_0x4d91('0x3c')]=_[_0x4d91('0x3d')](_0x31f21a[_0x4d91('0x39')],_0x31f21a[_0x4d91('0x3a')]);_0x3f8659['attributes']=_[_0x4d91('0x3d')](_0x31f21a['model'],qs['fields'](_0x164658[_0x4d91('0x3a')][_0x4d91('0x3f')]));_0x3f8659[_0x4d91('0x3e')]=_0x3f8659[_0x4d91('0x3e')][_0x4d91('0x40')]?_0x3f8659[_0x4d91('0x3e')]:_0x31f21a['model'];if(_0x164658[_0x4d91('0x3a')][_0x4d91('0x48')]){_0x3f8659[_0x4d91('0x49')]=[{'all':!![]}];}_0x3f8659=_[_0x4d91('0x45')]({},_0x3f8659,_0x164658[_0x4d91('0x47')]);return db[_0x4d91('0x35')][_0x4d91('0x4e')](_0x3f8659)[_0x4d91('0x2c')](handleEntityNotFound(_0x342de1,null))[_0x4d91('0x2c')](respondWithResult(_0x342de1,null))[_0x4d91('0x4f')](handleError(_0x342de1,null));};exports[_0x4d91('0x2b')]=function(_0x5a67fa,_0xa5c630){return db['VoicePrefix'][_0x4d91('0x4e')]({'where':{'id':_0x5a67fa[_0x4d91('0x4d')]['id']}})[_0x4d91('0x2c')](handleEntityNotFound(_0xa5c630,null))[_0x4d91('0x2c')](removeEntity(_0xa5c630,null))[_0x4d91('0x4f')](handleError(_0xa5c630,null));};exports[_0x4d91('0x50')]=function(_0x3028b1,_0x22b341){return db['VoicePrefix'][_0x4d91('0x50')]()[_0x4d91('0x2c')](respondWithResult(_0x22b341,null))[_0x4d91('0x4f')](handleError(_0x22b341,null));};exports[_0x4d91('0x51')]=function(_0x26ecd7,_0x19e57e){var _0x5765ce;return db['sequelize'][_0x4d91('0x52')](function(_0x2159e4){return db[_0x4d91('0x35')][_0x4d91('0x51')](_0x26ecd7[_0x4d91('0x53')],{'transaction':_0x2159e4})[_0x4d91('0x2c')](function(_0x2875f4){_0x5765ce=_0x2875f4[_0x4d91('0x54')]({'plain':!![]});return db[_0x4d91('0x55')][_0x4d91('0x4e')]({'where':{'id':_0x5765ce[_0x4d91('0x56')]},'raw':!![]})[_0x4d91('0x2c')](function(_0x280c41){return createVoicePrefixExtensions(_0x5765ce,_0x280c41,_0x2159e4);});});})[_0x4d91('0x2c')](function(){var _0x3e9154=_0x26ecd7[_0x4d91('0x57')][_0x4d91('0x54')]({'plain':!![]});if(!_0x3e9154)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3e9154['role']==='user'){var _0x45cf4e=_0x5765ce;return db[_0x4d91('0x58')][_0x4d91('0x4e')]({'where':{'name':'VoicePrefixes','userProfileId':_0x3e9154[_0x4d91('0x59')]},'raw':!![]})[_0x4d91('0x2c')](function(_0x3985f3){if(_0x3985f3&&_0x3985f3['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x45cf4e[_0x4d91('0x32')],'resourceId':_0x45cf4e['id'],'type':_0x3985f3[_0x4d91('0x32')],'sectionId':_0x3985f3['id']},{})[_0x4d91('0x2c')](function(){return _0x5765ce;});}else{return _0x5765ce;}})[_0x4d91('0x4f')](function(_0x31d6e5){logger['error'](_0x4d91('0x5a'),_0x31d6e5);throw _0x31d6e5;});}return _0x5765ce;})[_0x4d91('0x2c')](respondWithResult(_0x19e57e,null))['catch'](handleError(_0x19e57e,null));};function Extension(_0x563558,_0x3f4f24,_0x544711,_0x3fda50){this[_0x4d91('0x5b')]=_0x4d91('0x5c');this['exten']=_0x563558;this[_0x4d91('0x5d')]=_0x544711;this[_0x4d91('0x5e')]=_0x4d91('0x5f');this[_0x4d91('0x60')]=_0x4d91('0x61');this[_0x4d91('0x62')]=_0x3f4f24;this[_0x4d91('0x63')]=_0x3fda50;}function createVoicePrefixExtensions(_0x524b4f,_0x533572,_0x5eeba8){return new BPromise(function(_0x4bd66d,_0x83395){var _0x8d6db2=new Extension(formatPrefixName(_0x524b4f[_0x4d91('0x64')]),0x1,'NoOp',_0x4d91('0x65'));_0x8d6db2['VoicePrefixId']=_0x524b4f['id'];return db[_0x4d91('0x55')][_0x4d91('0x51')](_0x8d6db2,{'transaction':_0x5eeba8})['then'](function(_0x51a594){var _0x1a707f=_0x51a594[_0x4d91('0x54')]({'plain':!![]});var _0x31150f=_[_0x4d91('0x34')](addVoicePrefixExtensions(_0x524b4f,_0x533572),function(_0x24661a){_0x24661a[_0x4d91('0x56')]=_0x1a707f['id'];_0x24661a[_0x4d91('0x66')]=_0x524b4f['id'];return _0x24661a;});return db[_0x4d91('0x55')][_0x4d91('0x67')](_0x31150f,{'transaction':_0x5eeba8})[_0x4d91('0x2c')](function(_0x5bfb08){if(!_0x5bfb08){return _0x83395('Extensions\x20creation\x20failed');}else{return _0x4bd66d(_0x5bfb08);}})[_0x4d91('0x4f')](function(_0x7e26c2){return _0x83395(_0x7e26c2);});});;});};function addVoicePrefixExtensions(_0x2049ca,_0x13281d){var _0x16ba26=[];var _0x16d384=formatPrefixName(_0x2049ca[_0x4d91('0x64')]);_0x16ba26[_0x4d91('0x68')](new Extension(_0x16d384,0x2,_0x4d91('0x69'),'CDR(prefix)='+_0x2049ca['name']));if(_0x2049ca['callerIdAll']){_0x16ba26['push'](new Extension(_0x16d384,0x3,_0x4d91('0x69'),_0x4d91('0x6a')+_0x2049ca[_0x4d91('0x6b')]));}else{_0x16ba26[_0x4d91('0x68')](new Extension(_0x16d384,0x3,_0x4d91('0x6c'),_0x4d91('0x6d')));}_0x16ba26[_0x4d91('0x68')](new Extension(_0x16d384,0x4,_0x4d91('0x6e'),_0x13281d[_0x4d91('0x5b')]+','+_0x4d91('0x6f')+(0x8+_0x2049ca[_0x4d91('0x32')][_0x4d91('0x40')])+'}'+','+0x1));return _0x16ba26;}function formatPrefixName(_0x4444a2){var _0xef787='_';for(var _0x3bc828=0x0;_0x3bc828<_0x4444a2[_0x4d91('0x40')];_0x3bc828++){if(_0x4444a2[_0x4d91('0x70')](_0x3bc828)=='-'){_0xef787+=_0x4444a2['charAt'](_0x3bc828);}else{_0xef787+='['+_0x4444a2[_0x4d91('0x70')](_0x3bc828)+']';}}_0xef787+='.';return _0xef787;}exports[_0x4d91('0x71')]=function(_0xc4ef10,_0x2e2105,_0x1cad5b){var _0x5ab447=_0xc4ef10[_0x4d91('0x53')];_0x5ab447[_0x4d91('0x64')]='system-'+_0x5ab447[_0x4d91('0x32')]+'-';return db[_0x4d91('0x72')][_0x4d91('0x52')](function(_0xa469a4){return db[_0x4d91('0x35')]['update'](_0x5ab447,{'where':{'id':_0x5ab447['id']},'transaction':_0xa469a4})[_0x4d91('0x2c')](function(){return db[_0x4d91('0x55')]['destroy']({'where':{'VoicePrefixId':_0x5ab447['id']},'transaction':_0xa469a4})[_0x4d91('0x2c')](function(){return db[_0x4d91('0x55')][_0x4d91('0x4e')]({'where':{'id':_0x5ab447['VoiceExtensionId']},'raw':!![]})[_0x4d91('0x2c')](function(_0x403e0c){return createVoicePrefixExtensions(_0x5ab447,_0x403e0c,_0xa469a4);});});});})[_0x4d91('0x2c')](function(){return db[_0x4d91('0x35')][_0x4d91('0x73')](_0x5ab447['id']);})[_0x4d91('0x2c')](respondWithResult(_0x2e2105,null))[_0x4d91('0x4f')](handleError(_0x2e2105,null));};exports['addAgents']=function(_0xdbb484,_0x2e014b,_0x4e7994){return db[_0x4d91('0x35')]['find']({'where':{'id':_0xdbb484['params']['id']}})[_0x4d91('0x2c')](handleEntityNotFound(_0x2e014b,null))['then'](function(_0x1a5376){if(_0x1a5376){return _0x1a5376[_0x4d91('0x74')](_0xdbb484[_0x4d91('0x53')][_0x4d91('0x75')],_[_0x4d91('0x76')](_0xdbb484[_0x4d91('0x53')],[_0x4d91('0x75'),'id'])||{})['spread'](function(_0x485da1){for(var _0x1c27e7=0x0;_0x1c27e7<_0xdbb484[_0x4d91('0x53')][_0x4d91('0x75')][_0x4d91('0x40')];_0x1c27e7+=0x1){socket[_0x4d91('0x77')]('userVoicePrefix:save',{'UserId':Number(_0xdbb484['body'][_0x4d91('0x75')][_0x1c27e7]),'VoicePrefixId':Number(_0xdbb484['params']['id'])});}return _0x485da1;});}})['then'](respondWithResult(_0x2e014b,null))[_0x4d91('0x4f')](handleError(_0x2e014b,null));};exports['removeAgents']=function(_0x585a8d,_0x216c33,_0x1b813c){return db[_0x4d91('0x35')]['find']({'where':{'id':_0x585a8d['params']['id']}})['then'](handleEntityNotFound(_0x216c33,null))[_0x4d91('0x2c')](function(_0x8d84f3){if(_0x8d84f3){return _0x8d84f3[_0x4d91('0x78')](_0x585a8d[_0x4d91('0x3a')][_0x4d91('0x75')])[_0x4d91('0x2c')](function(){if(_[_0x4d91('0x79')](_0x585a8d[_0x4d91('0x3a')][_0x4d91('0x75')])){for(var _0x542f58=0x0;_0x542f58<_0x585a8d[_0x4d91('0x3a')]['ids']['length'];_0x542f58+=0x1){socket[_0x4d91('0x77')](_0x4d91('0x7a'),{'UserId':Number(_0x585a8d[_0x4d91('0x3a')][_0x4d91('0x75')][_0x542f58]),'VoicePrefixId':Number(_0x585a8d['params']['id'])});}}else{socket[_0x4d91('0x77')](_0x4d91('0x7a'),{'UserId':Number(_0x585a8d[_0x4d91('0x3a')][_0x4d91('0x75')]),'VoicePrefixId':Number(_0x585a8d[_0x4d91('0x4d')]['id'])});}});}})[_0x4d91('0x2c')](respondWithStatusCode(_0x216c33,null))[_0x4d91('0x4f')](handleError(_0x216c33,null));};exports['getAgents']=function(_0x28322e,_0x24376e,_0x7bc606){var _0x49d81c={};var _0xc37e2e={};var _0x45a628;var _0x2cf518;return db[_0x4d91('0x35')][_0x4d91('0x7b')]({'where':{'id':_0x28322e[_0x4d91('0x4d')]['id']}})['then'](handleEntityNotFound(_0x24376e,null))[_0x4d91('0x2c')](function(_0x582bee){if(_0x582bee){_0x45a628=_0x582bee;_0xc37e2e[_0x4d91('0x39')]=_['keys'](db[_0x4d91('0x7c')][_0x4d91('0x36')]);_0xc37e2e['query']=_['keys'](_0x28322e['query']);_0xc37e2e[_0x4d91('0x3c')]=_[_0x4d91('0x3d')](_0xc37e2e[_0x4d91('0x39')],_0xc37e2e[_0x4d91('0x3a')]);_0x49d81c[_0x4d91('0x3e')]=_['intersection'](_0xc37e2e['model'],qs[_0x4d91('0x3f')](_0x28322e[_0x4d91('0x3a')][_0x4d91('0x3f')]));_0x49d81c[_0x4d91('0x3e')]=_0x49d81c[_0x4d91('0x3e')][_0x4d91('0x40')]?_0x49d81c[_0x4d91('0x3e')]:_0xc37e2e['model'];_0x49d81c[_0x4d91('0x41')]=qs[_0x4d91('0x42')](_0x28322e[_0x4d91('0x3a')][_0x4d91('0x42')]);_0x49d81c[_0x4d91('0x44')]=qs[_0x4d91('0x3c')](_[_0x4d91('0x7d')](_0x28322e[_0x4d91('0x3a')],_0xc37e2e[_0x4d91('0x3c')]));if(_0x28322e['query'][_0x4d91('0x43')]){_0x49d81c[_0x4d91('0x44')]=_[_0x4d91('0x45')](_0x49d81c[_0x4d91('0x44')],{'$or':_[_0x4d91('0x34')](_0x49d81c[_0x4d91('0x3e')],function(_0x4682a8){var _0x51a30d={};_0x51a30d[_0x4682a8]={'$like':'%'+_0x28322e[_0x4d91('0x3a')][_0x4d91('0x43')]+'%'};return _0x51a30d;})});}_0x49d81c=_['merge']({},_0x49d81c,_0x28322e[_0x4d91('0x47')]);return _0x45a628[_0x4d91('0x7e')](_0x49d81c);}})['then'](function(_0x22cd5a){if(_0x22cd5a){_0x2cf518=_0x22cd5a[_0x4d91('0x40')];if(!_0x28322e[_0x4d91('0x3a')][_0x4d91('0x7f')](_0x4d91('0x80'))){_0x49d81c[_0x4d91('0x25')]=qs['limit'](_0x28322e[_0x4d91('0x3a')][_0x4d91('0x25')]);_0x49d81c[_0x4d91('0x23')]=qs[_0x4d91('0x23')](_0x28322e[_0x4d91('0x3a')]['offset']);}return _0x45a628[_0x4d91('0x7e')](_0x49d81c);}})[_0x4d91('0x2c')](function(_0x3b0ab3){if(_0x3b0ab3){return _0x3b0ab3?{'count':_0x2cf518,'rows':_0x3b0ab3}:null;}})[_0x4d91('0x2c')](respondWithResult(_0x24376e,null))[_0x4d91('0x4f')](handleError(_0x24376e,null));};exports[_0x4d91('0x81')]=function(_0x18f844,_0x3e93d0,_0x53d973){var _0x367c30={};var _0x28b505={};var _0x451e14;var _0x37fe62;return db[_0x4d91('0x35')][_0x4d91('0x7b')]({'where':{'id':_0x18f844[_0x4d91('0x4d')]['id']}})[_0x4d91('0x2c')](handleEntityNotFound(_0x3e93d0,null))[_0x4d91('0x2c')](function(_0x5abc1d){if(_0x5abc1d){_0x451e14=_0x5abc1d;_0x28b505[_0x4d91('0x39')]=_[_0x4d91('0x3b')](db[_0x4d91('0x82')][_0x4d91('0x36')]);_0x28b505['query']=_['keys'](_0x18f844[_0x4d91('0x3a')]);_0x28b505[_0x4d91('0x3c')]=_[_0x4d91('0x3d')](_0x28b505[_0x4d91('0x39')],_0x28b505['query']);_0x367c30[_0x4d91('0x3e')]=_[_0x4d91('0x3d')](_0x28b505[_0x4d91('0x39')],qs[_0x4d91('0x3f')](_0x18f844[_0x4d91('0x3a')][_0x4d91('0x3f')]));_0x367c30[_0x4d91('0x3e')]=_0x367c30[_0x4d91('0x3e')][_0x4d91('0x40')]?_0x367c30['attributes']:_0x28b505[_0x4d91('0x39')];_0x367c30[_0x4d91('0x41')]=qs[_0x4d91('0x42')](_0x18f844[_0x4d91('0x3a')][_0x4d91('0x42')]);_0x367c30[_0x4d91('0x44')]=qs[_0x4d91('0x3c')](_[_0x4d91('0x7d')](_0x18f844[_0x4d91('0x3a')],_0x28b505[_0x4d91('0x3c')]));if(_0x18f844[_0x4d91('0x3a')][_0x4d91('0x43')]){_0x367c30['where']=_[_0x4d91('0x45')](_0x367c30[_0x4d91('0x44')],{'$or':_[_0x4d91('0x34')](_0x367c30[_0x4d91('0x3e')],function(_0x3e57a1){var _0x41fbc7={};_0x41fbc7[_0x3e57a1]={'$like':'%'+_0x18f844[_0x4d91('0x3a')][_0x4d91('0x43')]+'%'};return _0x41fbc7;})});}_0x367c30=_[_0x4d91('0x45')]({},_0x367c30,_0x18f844[_0x4d91('0x47')]);return _0x451e14[_0x4d91('0x81')](_0x367c30);}})[_0x4d91('0x2c')](function(_0x5a241a){if(_0x5a241a){_0x37fe62=_0x5a241a['length'];if(!_0x18f844[_0x4d91('0x3a')]['hasOwnProperty'](_0x4d91('0x80'))){_0x367c30[_0x4d91('0x25')]=qs[_0x4d91('0x25')](_0x18f844[_0x4d91('0x3a')][_0x4d91('0x25')]);_0x367c30[_0x4d91('0x23')]=qs['offset'](_0x18f844[_0x4d91('0x3a')][_0x4d91('0x23')]);}return _0x451e14[_0x4d91('0x81')](_0x367c30);}})[_0x4d91('0x2c')](function(_0x1419c5){if(_0x1419c5){return _0x1419c5?{'count':_0x37fe62,'rows':_0x1419c5}:null;}})[_0x4d91('0x2c')](respondWithResult(_0x3e93d0,null))[_0x4d91('0x4f')](handleError(_0x3e93d0,null));};exports[_0x4d91('0x83')]=function(_0x47cbca,_0x1df276,_0x3e2771){var _0x15d270=_0x47cbca[_0x4d91('0x53')][_0x4d91('0x75')];var _0x17e3bc;return db[_0x4d91('0x82')][_0x4d91('0x4a')]({'where':{'id':_0x15d270},'attributes':['id'],'include':[{'model':db[_0x4d91('0x7c')],'as':_0x4d91('0x84'),'attributes':['id','name',_0x4d91('0x85'),_0x4d91('0x86'),'interface'],'raw':!![]}]})[_0x4d91('0x2c')](function(_0x1f836b){if(_0x1f836b){_0x17e3bc=_0x1f836b;var _0x455dd6=_['flatMap'](_0x1f836b,function(_0x46ccf4){var _0xcc22a2=_0x46ccf4['get']({'plain':!![]});return _0xcc22a2['Agents'];});return db[_0x4d91('0x35')][_0x4d91('0x4e')]({'where':{'id':_0x47cbca[_0x4d91('0x4d')]['id']}})['then'](function(_0x352e84){return db[_0x4d91('0x72')][_0x4d91('0x52')](function(_0x3b2e36){return _0x352e84[_0x4d91('0x83')](_0x15d270,{'transaction':_0x3b2e36})[_0x4d91('0x2c')](function(){return BPromise[_0x4d91('0x87')](_0x17e3bc,function(_0x185ded){return db[_0x4d91('0x88')][_0x4d91('0x89')]({'TeamId':_0x185ded['id'],'VoicePrefixId':_0x47cbca[_0x4d91('0x4d')]['id']},{'transaction':_0x3b2e36});});})['then'](function(){return BPromise[_0x4d91('0x87')](_0x455dd6,function(_0x2a9069){return db[_0x4d91('0x8a')][_0x4d91('0x8b')]({'where':{'UserId':_0x2a9069['id'],'VoicePrefixId':_0x47cbca[_0x4d91('0x4d')]['id']},'transaction':_0x3b2e36});});})[_0x4d91('0x2c')](function(){_0x455dd6[_0x4d91('0x8c')](function(_0xb67bd3){socket[_0x4d91('0x77')](_0x4d91('0x8d'),{'UserId':_0xb67bd3['id'],'VoicePrefixId':_0x352e84['id']});});});});});}})[_0x4d91('0x2c')](respondWithStatusCode(_0x1df276,null))[_0x4d91('0x4f')](handleError(_0x1df276,null));};exports[_0x4d91('0x8e')]=function(_0xbadba4,_0xe88619,_0x44f21b){return db[_0x4d91('0x82')]['findAll']({'where':{'id':_0xbadba4['query'][_0x4d91('0x75')]},'attributes':['id'],'include':[{'model':db[_0x4d91('0x7c')],'as':_0x4d91('0x84'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0xe88619,null))[_0x4d91('0x2c')](function(_0x2882d5){var _0x2678e7=_[_0x4d91('0x34')](_0x2882d5,'id');var _0x236a61=[];var _0x54f720=[];var _0x5f2ce4=squel['select']();_0x5f2ce4['field'](_0x4d91('0x8f'))[_0x4d91('0x90')]('team_has_voice_prefixes','tq')[_0x4d91('0x91')](_0x4d91('0x92'),'ut',_0x4d91('0x93'))['where'](_0x4d91('0x94'),_0xbadba4[_0x4d91('0x4d')]['id']);for(var _0x237074=0x0;_0x237074<_0x2882d5['length'];_0x237074+=0x1){let _0x3b4804=_0x2882d5[_0x237074];for(var _0x20212f=0x0;_0x20212f<_0x3b4804[_0x4d91('0x84')][_0x4d91('0x40')];_0x20212f+=0x1){let _0x39de93=_0x3b4804['Agents'][_0x20212f];var _0xe60b6=_0x5f2ce4[_0x4d91('0x95')]();_0xe60b6[_0x4d91('0x44')](_0x4d91('0x96'),_0x39de93['id']);_0x54f720['push'](db[_0x4d91('0x72')][_0x4d91('0x3a')](_0xe60b6[_0x4d91('0x97')](),{'type':db[_0x4d91('0x72')][_0x4d91('0x98')][_0x4d91('0x99')]})['then'](function(_0x12e226){if(_0x12e226[_0x4d91('0x40')]===0x1){return _0x39de93['id'];}else{var _0x448a12=_[_0x4d91('0x9a')](_[_0x4d91('0x34')](_0x12e226,_0x4d91('0x9b')),function(_0x2c5ccc){return _['includes'](_0x2678e7,_0x2c5ccc);});if(_0x448a12){return _0x39de93['id'];}}}));}}return BPromise['all'](_0x54f720)[_0x4d91('0x2c')](function(_0x4026b3){_0x236a61=_(_0x236a61)[_0x4d91('0x9c')](_0x4026b3)[_0x4d91('0x9d')]()[_0x4d91('0x9e')]();return db[_0x4d91('0x35')]['find']({'where':{'id':_0xbadba4[_0x4d91('0x4d')]['id']}})['then'](function(_0x3e23df){return db[_0x4d91('0x72')]['transaction'](function(_0x9d7ff1){return _0x3e23df[_0x4d91('0x8e')](_0xbadba4['query']['ids'],{'transaction':_0x9d7ff1})['then'](function(){if(!_[_0x4d91('0x9f')](_0x236a61)){return _0x3e23df['removeAgents'](_0x236a61,{'transaction':_0x9d7ff1});}})[_0x4d91('0x2c')](function(){_0x236a61[_0x4d91('0x8c')](function(_0x4da3b1){socket['emit'](_0x4d91('0x7a'),{'UserId':_0x4da3b1,'VoicePrefixId':_0x3e23df['id']});});});});});});})[_0x4d91('0x2c')](respondWithStatusCode(_0xe88619,null))[_0x4d91('0x4f')](handleError(_0xe88619,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 31a4dfe..f0bf3be 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 _0x0083=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','VoicePrefix'];(function(_0x2c7d7c,_0xa298c3){var _0x135555=function(_0x17ed5c){while(--_0x17ed5c){_0x2c7d7c['push'](_0x2c7d7c['shift']());}};_0x135555(++_0xa298c3);}(_0x0083,0x1b5));var _0x3008=function(_0x2c3bd9,_0x17d57b){_0x2c3bd9=_0x2c3bd9-0x0;var _0x6803cd=_0x0083[_0x2c3bd9];return _0x6803cd;};'use strict';var EventEmitter=require(_0x3008('0x0'));var VoicePrefix=require(_0x3008('0x1'))['db'][_0x3008('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x3008('0x3')](0x0);var events={'afterCreate':_0x3008('0x4'),'afterUpdate':_0x3008('0x5'),'afterDestroy':_0x3008('0x6')};function emitEvent(_0x4b2a11){return function(_0x23d403,_0x5bef29,_0x403669){VoicePrefixEvents[_0x3008('0x7')](_0x4b2a11+':'+_0x23d403['id'],_0x23d403);VoicePrefixEvents[_0x3008('0x7')](_0x4b2a11,_0x23d403);_0x403669(null);};}for(var e in events){if(events[_0x3008('0x8')](e)){var event=events[e];VoicePrefix[_0x3008('0x9')](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file +var _0xf79a=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','VoicePrefix','setMaxListeners','save','update'];(function(_0xf42142,_0x448cd8){var _0x195537=function(_0x5d3598){while(--_0x5d3598){_0xf42142['push'](_0xf42142['shift']());}};_0x195537(++_0x448cd8);}(_0xf79a,0xb9));var _0xaf79=function(_0x2c5a7e,_0x42816f){_0x2c5a7e=_0x2c5a7e-0x0;var _0x20a935=_0xf79a[_0x2c5a7e];return _0x20a935;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0xaf79('0x0'))['db'][_0xaf79('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xaf79('0x2')](0x0);var events={'afterCreate':_0xaf79('0x3'),'afterUpdate':_0xaf79('0x4'),'afterDestroy':_0xaf79('0x5')};function emitEvent(_0x20bbe6){return function(_0x261aac,_0x54a858,_0xbeea89){VoicePrefixEvents[_0xaf79('0x6')](_0x20bbe6+':'+_0x261aac['id'],_0x261aac);VoicePrefixEvents[_0xaf79('0x6')](_0x20bbe6,_0x261aac);_0xbeea89(null);};}for(var e in events){if(events[_0xaf79('0x7')](e)){var event=events[e];VoicePrefix[_0xaf79('0x8')](e,emitEvent(event));}}module[_0xaf79('0x9')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 2594531..11ab870 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 _0x0dba=['lodash','util','api','moment','path','../../config/environment','define','VoicePrefix'];(function(_0x397bf6,_0x3e88f6){var _0x19f515=function(_0x569a3d){while(--_0x569a3d){_0x397bf6['push'](_0x397bf6['shift']());}};_0x19f515(++_0x3e88f6);}(_0x0dba,0xa0));var _0xa0db=function(_0x3d13be,_0x540183){_0x3d13be=_0x3d13be-0x0;var _0x3dde50=_0x0dba[_0x3d13be];return _0x3dde50;};'use strict';var _=require(_0xa0db('0x0'));var util=require(_0xa0db('0x1'));var logger=require('../../config/logger')(_0xa0db('0x2'));var moment=require(_0xa0db('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa0db('0x4'));var rimraf=require('rimraf');var config=require(_0xa0db('0x5'));var attributes=require('./voicePrefix.attributes');module['exports']=function(_0x934829,_0x5e44ec){return _0x934829[_0xa0db('0x6')](_0xa0db('0x7'),attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcfc8=['define','VoicePrefix','voice_prefixes','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./voicePrefix.attributes','exports'];(function(_0x2f45ea,_0x15c656){var _0x485a84=function(_0x4a1fe3){while(--_0x4a1fe3){_0x2f45ea['push'](_0x2f45ea['shift']());}};_0x485a84(++_0x15c656);}(_0xcfc8,0x9f));var _0x8cfc=function(_0x227bf8,_0x58f286){_0x227bf8=_0x227bf8-0x0;var _0x56c81d=_0xcfc8[_0x227bf8];return _0x56c81d;};'use strict';var _=require(_0x8cfc('0x0'));var util=require(_0x8cfc('0x1'));var logger=require(_0x8cfc('0x2'))(_0x8cfc('0x3'));var moment=require(_0x8cfc('0x4'));var BPromise=require(_0x8cfc('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8cfc('0x6'));var rimraf=require(_0x8cfc('0x7'));var config=require('../../config/environment');var attributes=require(_0x8cfc('0x8'));module[_0x8cfc('0x9')]=function(_0x38e054,_0xf5008a){return _0x38e054[_0x8cfc('0xa')](_0x8cfc('0xb'),attributes,{'tableName':_0x8cfc('0xc'),'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 8369ab4..0110699 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 _0xc1c6=['./voicePrefix.socket','register','then','info','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','VoicePrefix,\x20%s,\x20%s','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','defaults','redis','localhost','socket.io-emitter'];(function(_0x5829ae,_0x17cc9c){var _0x569e9b=function(_0x3cb355){while(--_0x3cb355){_0x5829ae['push'](_0x5829ae['shift']());}};_0x569e9b(++_0x17cc9c);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x5c2de1,_0xb4e789){_0x5c2de1=_0x5c2de1-0x0;var _0x3010ee=_0xc1c6[_0x5c2de1];return _0x3010ee;};'use strict';var _=require(_0x6c1c('0x0'));var util=require(_0x6c1c('0x1'));var moment=require(_0x6c1c('0x2'));var BPromise=require('bluebird');var rs=require(_0x6c1c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6c1c('0x4'))['db'];var utils=require(_0x6c1c('0x5'));var logger=require(_0x6c1c('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6c1c('0x7'));var client=jayson['client'][_0x6c1c('0x8')]({'port':0x232a});config['redis']=_[_0x6c1c('0x9')](config[_0x6c1c('0xa')],{'host':_0x6c1c('0xb'),'port':0x18eb});var socket=require(_0x6c1c('0xc'))(new Redis(config['redis']));require(_0x6c1c('0xd'))[_0x6c1c('0xe')](socket);function respondWithRpcPromise(_0x524d21,_0x147c7b,_0x36275f){return new BPromise(function(_0xb3bd12,_0x1137e8){return client['request'](_0x524d21,_0x36275f)[_0x6c1c('0xf')](function(_0x2a4fd4){logger[_0x6c1c('0x10')]('VoicePrefix,\x20%s,\x20%s',_0x147c7b,_0x6c1c('0x11'));logger[_0x6c1c('0x12')](_0x6c1c('0x13'),_0x147c7b,'request\x20sent',JSON[_0x6c1c('0x14')](_0x2a4fd4));if(_0x2a4fd4['error']){if(_0x2a4fd4[_0x6c1c('0x15')][_0x6c1c('0x16')]===0x1f4){logger[_0x6c1c('0x15')](_0x6c1c('0x17'),_0x147c7b,_0x2a4fd4[_0x6c1c('0x15')][_0x6c1c('0x18')]);return _0x1137e8(_0x2a4fd4[_0x6c1c('0x15')][_0x6c1c('0x18')]);}logger[_0x6c1c('0x15')]('VoicePrefix,\x20%s,\x20%s',_0x147c7b,_0x2a4fd4[_0x6c1c('0x15')][_0x6c1c('0x18')]);return _0xb3bd12(_0x2a4fd4['error'][_0x6c1c('0x18')]);}else{logger[_0x6c1c('0x10')]('VoicePrefix,\x20%s,\x20%s',_0x147c7b,_0x6c1c('0x11'));_0xb3bd12(_0x2a4fd4['result'][_0x6c1c('0x18')]);}})[_0x6c1c('0x19')](function(_0x5a3bb7){logger[_0x6c1c('0x15')]('VoicePrefix,\x20%s,\x20%s',_0x147c7b,_0x5a3bb7);_0x1137e8(_0x5a3bb7);});});} \ No newline at end of file +var _0xf417=['moment','bluebird','ioredis','../../config/logger','http','defaults','redis','socket.io-emitter','./voicePrefix.socket','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','error','message','result','util'];(function(_0x42b8f4,_0x19ae7c){var _0x1d4610=function(_0x360025){while(--_0x360025){_0x42b8f4['push'](_0x42b8f4['shift']());}};_0x1d4610(++_0x19ae7c);}(_0xf417,0x8f));var _0x7f41=function(_0x2ae489,_0x9f8183){_0x2ae489=_0x2ae489-0x0;var _0x144cd2=_0xf417[_0x2ae489];return _0x144cd2;};'use strict';var _=require('lodash');var util=require(_0x7f41('0x0'));var moment=require(_0x7f41('0x1'));var BPromise=require(_0x7f41('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7f41('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7f41('0x4'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x7f41('0x5')]({'port':0x232a});config['redis']=_[_0x7f41('0x6')](config[_0x7f41('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x7f41('0x8'))(new Redis(config['redis']));require(_0x7f41('0x9'))['register'](socket);function respondWithRpcPromise(_0x23d64c,_0x1c9776,_0x52c3a2){return new BPromise(function(_0x51067f,_0x48b265){return client['request'](_0x23d64c,_0x52c3a2)['then'](function(_0x45f11b){logger[_0x7f41('0xa')](_0x7f41('0xb'),_0x1c9776,_0x7f41('0xc'));logger[_0x7f41('0xd')](_0x7f41('0xe'),_0x1c9776,_0x7f41('0xc'),JSON['stringify'](_0x45f11b));if(_0x45f11b['error']){if(_0x45f11b[_0x7f41('0xf')]['code']===0x1f4){logger['error'](_0x7f41('0xb'),_0x1c9776,_0x45f11b[_0x7f41('0xf')][_0x7f41('0x10')]);return _0x48b265(_0x45f11b['error'][_0x7f41('0x10')]);}logger['error'](_0x7f41('0xb'),_0x1c9776,_0x45f11b[_0x7f41('0xf')][_0x7f41('0x10')]);return _0x51067f(_0x45f11b['error'][_0x7f41('0x10')]);}else{logger[_0x7f41('0xa')](_0x7f41('0xb'),_0x1c9776,'request\x20sent');_0x51067f(_0x45f11b[_0x7f41('0x11')][_0x7f41('0x10')]);}})['catch'](function(_0x98210f){logger[_0x7f41('0xf')](_0x7f41('0xb'),_0x1c9776,_0x98210f);_0x48b265(_0x98210f);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 82b408a..3dbcb19 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 _0x3140=['removeListener','register','length','voicePrefix:','./voicePrefix.events','save','remove','update','emit'];(function(_0xccea26,_0x4b9c03){var _0x482e66=function(_0x3eadff){while(--_0x3eadff){_0xccea26['push'](_0xccea26['shift']());}};_0x482e66(++_0x4b9c03);}(_0x3140,0xaf));var _0x0314=function(_0xba0c2,_0x54cc50){_0xba0c2=_0xba0c2-0x0;var _0x5a9fa0=_0x3140[_0xba0c2];return _0x5a9fa0;};'use strict';var VoicePrefixEvents=require(_0x0314('0x0'));var events=[_0x0314('0x1'),_0x0314('0x2'),_0x0314('0x3')];function createListener(_0x4ac557,_0x4cf353){return function(_0x285be5){_0x4cf353[_0x0314('0x4')](_0x4ac557,_0x285be5);};}function removeListener(_0x1c0f66,_0x3e4284){return function(){VoicePrefixEvents[_0x0314('0x5')](_0x1c0f66,_0x3e4284);};}exports[_0x0314('0x6')]=function(_0x9e308d){for(var _0xf87d26=0x0,_0x11ee94=events[_0x0314('0x7')];_0xf87d26<_0x11ee94;_0xf87d26++){var _0x176944=events[_0xf87d26];var _0x495b27=createListener(_0x0314('0x8')+_0x176944,_0x9e308d);VoicePrefixEvents['on'](_0x176944,_0x495b27);}}; \ No newline at end of file +var _0x130d=['remove','emit','removeListener','register','length','./voicePrefix.events'];(function(_0x4cb33e,_0x34061f){var _0x1e1980=function(_0x57cebc){while(--_0x57cebc){_0x4cb33e['push'](_0x4cb33e['shift']());}};_0x1e1980(++_0x34061f);}(_0x130d,0x125));var _0xd130=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x130d[_0x3dd15e];return _0x231fd0;};'use strict';var VoicePrefixEvents=require(_0xd130('0x0'));var events=['save',_0xd130('0x1'),'update'];function createListener(_0x45f869,_0x389725){return function(_0x3591d2){_0x389725[_0xd130('0x2')](_0x45f869,_0x3591d2);};}function removeListener(_0x321e49,_0x2bc19d){return function(){VoicePrefixEvents[_0xd130('0x3')](_0x321e49,_0x2bc19d);};}exports[_0xd130('0x4')]=function(_0x287e61){for(var _0x4689a8=0x0,_0x44c215=events[_0xd130('0x5')];_0x4689a8<_0x44c215;_0x4689a8++){var _0x3f77e1=events[_0x4689a8];var _0x1b9875=createListener('voicePrefix:'+_0x3f77e1,_0x287e61);VoicePrefixEvents['on'](_0x3f77e1,_0x1b9875);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 0844270..92c4ac3 100644 --- a/server/api/voiceQueue/index.js +++ b/server/api/voiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['addAgents','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','create','/:id/clone','clone','addTeams'];(function(_0x12c767,_0xfbca2c){var _0x7ff536=function(_0x3d1e72){while(--_0x3d1e72){_0x12c767['push'](_0x12c767['shift']());}};_0x7ff536(++_0xfbca2c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getTeams']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x8')]('/:id/blacklists',auth[_0x0a9e('0xd')](),controller['getBlackLists']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/users',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0x0a9e('0x18')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x22')]);router['delete']('/:id/teams',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router[_0x0a9e('0x21')](_0x0a9e('0x12'),auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['delete'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x21')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x26')]);module[_0x0a9e('0x27')]=router; \ No newline at end of file +var _0xa9e0=['addAgents','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','create','/:id/clone','clone','addTeams'];(function(_0x52a58b,_0x442daa){var _0xd8a95a=function(_0x172c98){while(--_0x172c98){_0x52a58b['push'](_0x52a58b['shift']());}};_0xd8a95a(++_0x442daa);}(_0xa9e0,0x123));var _0x0a9e=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xa9e0[_0x55f8b4];return _0x2475f9;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getTeams']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x8')]('/:id/blacklists',auth[_0x0a9e('0xd')](),controller['getBlackLists']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/users',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0x0a9e('0x18')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x22')]);router['delete']('/:id/teams',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router[_0x0a9e('0x21')](_0x0a9e('0x12'),auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['delete'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x21')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x26')]);module[_0x0a9e('0x27')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index d867247..c7a867c 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 _0x4144=['linear','wrandom','rrordered','setDataValue','strategy','getDataValue','type','preview','booked','includes','INTEGER','yes','once','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','progressive','power','predictive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','sequelize','STRING','name','ENUM','inbound','outbound','ringall','leastrecent','fewestcalls','rrmemory'];(function(_0x5dd036,_0x3109a6){var _0x6b2816=function(_0x18cc49){while(--_0x18cc49){_0x5dd036['push'](_0x5dd036['shift']());}};_0x6b2816(++_0x3109a6);}(_0x4144,0x168));var _0x4414=function(_0x21defa,_0x5d3f10){_0x21defa=_0x21defa-0x0;var _0x26af1d=_0x4144[_0x21defa];return _0x26af1d;};'use strict';var Sequelize=require(_0x4414('0x0'));module['exports']={'name':{'type':Sequelize[_0x4414('0x1')],'allowNull':![],'unique':_0x4414('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x4414('0x3')](_0x4414('0x4'),_0x4414('0x5')),'allowNull':![],'defaultValue':_0x4414('0x4')},'musiconhold':{'type':Sequelize[_0x4414('0x1')],'defaultValue':'default'},'announce':{'type':Sequelize[_0x4414('0x1')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0x4414('0x6'),_0x4414('0x7'),_0x4414('0x8'),'random',_0x4414('0x9'),_0x4414('0xa'),_0x4414('0xb'),_0x4414('0xc')),'allowNull':![],'defaultValue':_0x4414('0x6'),'set':function(_0x5b0b7b){this[_0x4414('0xd')](_0x4414('0xe'),_0x5b0b7b?_0x5b0b7b:_0x4414('0x9'));},'get':function(){var _0x38756a=this[_0x4414('0xf')](_0x4414('0x10'));var _0x2b4dd9=this[_0x4414('0xf')]('dialMethod');var _0x43386a=this[_0x4414('0xf')]('strategy');if(_0x38756a===_0x4414('0x5')){if(_0x2b4dd9===_0x4414('0x11')){return null;}if(_0x2b4dd9===_0x4414('0x12')&&![_0x4414('0x9'),'roundrobin'][_0x4414('0x13')](_0x43386a)){this[_0x4414('0xd')](_0x4414('0xe'),_0x4414('0x9'));}}return _0x43386a;}},'servicelevel':{'type':Sequelize[_0x4414('0x14')](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x4414('0x14')](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x4414('0x14')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize[_0x4414('0x14')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x4414('0x3')]('yes','no'),'defaultValue':_0x4414('0x15')},'autopause':{'type':Sequelize['ENUM'](_0x4414('0x15'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x4414('0x14')](0xb)},'autopausebusy':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x4414('0x3')](_0x4414('0x15'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x4414('0x3')](_0x4414('0x15'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x4414('0x3')](_0x4414('0x15'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x4414('0x3')](_0x4414('0x15'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x4414('0x3')](_0x4414('0x15'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x4414('0x1')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x4414('0x1')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x4414('0x14')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x4414('0x14')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x4414('0x14')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x4414('0x3')](_0x4414('0x15'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x4414('0x15'),'no'),'defaultValue':_0x4414('0x15')},'announce_holdtime':{'type':Sequelize[_0x4414('0x3')](_0x4414('0x15'),'no',_0x4414('0x16')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x4414('0x3')]('yes','no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0x4414('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x4414('0x1')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x4414('0x1')]},'queue_youarenext':{'type':Sequelize[_0x4414('0x1')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x4414('0x1')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x4414('0x1')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x4414('0x1')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x4414('0x1')]},'queue_quantity1':{'type':Sequelize[_0x4414('0x1')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize[_0x4414('0x1')]},'queue_less_than':{'type':Sequelize[_0x4414('0x1')]},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x4630c0){this[_0x4414('0xd')](_0x4414('0x17'),_0x4630c0?_0x4630c0[_0x4414('0x18')](','):[]);},'get':function(){return this['getDataValue'](_0x4414('0x17'))?this[_0x4414('0xf')](_0x4414('0x17'))[_0x4414('0x19')](','):[];}},'joinempty':{'type':Sequelize[_0x4414('0x1')],'defaultValue':_0x4414('0x15'),'set':function(_0x52e9f5){this[_0x4414('0xd')]('joinempty',_0x52e9f5?_0x52e9f5[_0x4414('0x18')](','):undefined);},'get':function(){return this['getDataValue'](_0x4414('0x1a'))?this[_0x4414('0xf')]('joinempty')['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x130a16){this[_0x4414('0xd')](_0x4414('0x1b'),_0x130a16?_0x130a16[_0x4414('0x18')](','):undefined);},'get':function(){return this['getDataValue'](_0x4414('0x1b'))?this[_0x4414('0xf')](_0x4414('0x1b'))[_0x4414('0x19')](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM'](_0x4414('0x15'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x4414('0x3')](_0x4414('0x15'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x4414('0x14')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x4414('0x3')](_0x4414('0x15'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x4414('0x1')]},'description':{'type':Sequelize[_0x4414('0x1')]},'acw':{'type':Sequelize[_0x4414('0x1c')],'defaultValue':0x0,'set':function(_0x3ed04e){this[_0x4414('0xd')](_0x4414('0x1d'),_0x3ed04e);if(_0x3ed04e){if(this[_0x4414('0xf')]('wrapuptime')<0x2){this[_0x4414('0xd')](_0x4414('0x1e'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x4414('0x14')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x4414('0x1c')],'defaultValue':0x0,'comment':_0x4414('0x1f')},'dialMethod':{'type':Sequelize[_0x4414('0x3')](_0x4414('0x11'),_0x4414('0x20'),_0x4414('0x21'),_0x4414('0x22'),_0x4414('0x12')),'defaultValue':_0x4414('0x20'),'comment':_0x4414('0x23')},'dialLimitChannel':{'type':Sequelize[_0x4414('0x14')](0x4)[_0x4414('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x4414('0x25')},'dialLimitQueue':{'type':Sequelize[_0x4414('0x14')](0x4)[_0x4414('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x4414('0x26')},'dialPowerLevel':{'type':Sequelize[_0x4414('0x27')](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize[_0x4414('0x3')]('agentBusyFactor',_0x4414('0x28')),'defaultValue':_0x4414('0x28'),'comment':_0x4414('0x29')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x4414('0x27')](0x2)[_0x4414('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x4414('0x2a')},'dialPredictiveInterval':{'type':Sequelize[_0x4414('0x14')](0x3)[_0x4414('0x24')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x4414('0x2b')},'dialOriginateCallerIdName':{'type':Sequelize[_0x4414('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x4414('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x4414('0x14')](0x3)[_0x4414('0x24')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4414('0x2c')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0x4414('0x2d'),'comment':_0x4414('0x2e')},'dialQueueTimeout':{'type':Sequelize[_0x4414('0x14')](0x3)[_0x4414('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4414('0x2f')},'dialQueueProject':{'type':Sequelize[_0x4414('0x1')],'comment':_0x4414('0x30')},'dialCongestionMaxRetry':{'type':Sequelize[_0x4414('0x14')](0x3)[_0x4414('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4414('0x31')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x4414('0x14')](0x5)[_0x4414('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4414('0x32')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x4414('0x14')](0x5)[_0x4414('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4414('0x33')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x4414('0x14')](0x3)[_0x4414('0x24')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x4414('0x14')](0x5)[_0x4414('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4414('0x34')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x4414('0x24')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x4414('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0x4414('0x1')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x4414('0x3')](_0x4414('0x35'),_0x4414('0x36'),_0x4414('0x37')),'defaultValue':_0x4414('0x35')},'dialAMDActive':{'type':Sequelize[_0x4414('0x1c')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x4414('0x14')](0x9)[_0x4414('0x24')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x4414('0x38')},'dialAMDGreeting':{'type':Sequelize[_0x4414('0x14')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x4414('0x39')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x4414('0x14')](0x9)[_0x4414('0x24')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x4414('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x4414('0x14')](0x9)[_0x4414('0x24')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x4414('0x3a')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x4414('0x14')](0x9)[_0x4414('0x24')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x4414('0x3b')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x4414('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x4414('0x14')](0x9)[_0x4414('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x4414('0x3c')},'dialRecallMeTimeout':{'type':Sequelize[_0x4414('0x14')](0x5)[_0x4414('0x24')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x4414('0x3d')},'dialRecallInQueue':{'type':Sequelize[_0x4414('0x1c')],'defaultValue':0x0,'comment':_0x4414('0x3e')},'dialOrderByScheduledAt':{'type':Sequelize[_0x4414('0x3')](_0x4414('0x3f'),'ASC'),'defaultValue':_0x4414('0x3f')},'dialQueueProject2':{'type':Sequelize[_0x4414('0x1')],'comment':_0x4414('0x30')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x4414('0x1c')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x4414('0x14')](0x3)[_0x4414('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x4414('0x14')](0x3)[_0x4414('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x4414('0x14')](0x3)[_0x4414('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4414('0x40')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x4414('0x14')](0x5)[_0x4414('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4414('0x41')},'dialDropMaxRetry':{'type':Sequelize[_0x4414('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4414('0x42')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x4414('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4414('0x43')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x4414('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x4414('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4414('0x44')},'dialMachineMaxRetry':{'type':Sequelize[_0x4414('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x4414('0x14')](0x5)[_0x4414('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x4414('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4414('0x45')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x4414('0x14')](0x5)[_0x4414('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4414('0x46')},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':_0x4414('0x47')},'mandatoryDisposition':{'type':Sequelize[_0x4414('0x1c')],'defaultValue':![],'comment':_0x4414('0x48'),'set':function(_0x30b5fd){if(!_0x30b5fd)this[_0x4414('0xd')](_0x4414('0x49'),null);this[_0x4414('0xd')]('mandatoryDisposition',_0x30b5fd);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x4414('0x14')](0x3)[_0x4414('0x24')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x4414('0x14')](0x3)[_0x4414('0x24')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x4414('0x1c')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x4414('0x14')](0x3)[_0x4414('0x24')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x4414('0x1c')],'defaultValue':![]}}; \ No newline at end of file +var _0xf4fe=['split','join','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','power','predictive','progressive','Dial\x20Method.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','onlyIfOpen','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','sequelize','STRING','name','ENUM','inbound','default','ringall','leastrecent','fewestcalls','random','rrmemory','linear','wrandom','setDataValue','strategy','getDataValue','type','dialMethod','outbound','preview','booked','roundrobin','includes','INTEGER','yes','once','periodic_announce'];(function(_0x3899d1,_0x4aa04c){var _0xeb4a7d=function(_0x3ea5ee){while(--_0x3ea5ee){_0x3899d1['push'](_0x3899d1['shift']());}};_0xeb4a7d(++_0x4aa04c);}(_0xf4fe,0xc9));var _0xef4f=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0xf4fe[_0x278e3c];return _0x3e2d9b;};'use strict';var Sequelize=require(_0xef4f('0x0'));module['exports']={'name':{'type':Sequelize[_0xef4f('0x1')],'allowNull':![],'unique':_0xef4f('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xef4f('0x3')](_0xef4f('0x4'),'outbound'),'allowNull':![],'defaultValue':_0xef4f('0x4')},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':_0xef4f('0x5')},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize[_0xef4f('0x3')]('rr',_0xef4f('0x6'),_0xef4f('0x7'),_0xef4f('0x8'),_0xef4f('0x9'),_0xef4f('0xa'),_0xef4f('0xb'),_0xef4f('0xc'),'rrordered'),'allowNull':![],'defaultValue':_0xef4f('0x6'),'set':function(_0x23e25d){this[_0xef4f('0xd')](_0xef4f('0xe'),_0x23e25d?_0x23e25d:_0xef4f('0xa'));},'get':function(){var _0x4dd636=this[_0xef4f('0xf')](_0xef4f('0x10'));var _0x3fbe70=this[_0xef4f('0xf')](_0xef4f('0x11'));var _0x1758fd=this['getDataValue'](_0xef4f('0xe'));if(_0x4dd636===_0xef4f('0x12')){if(_0x3fbe70===_0xef4f('0x13')){return null;}if(_0x3fbe70===_0xef4f('0x14')&&![_0xef4f('0xa'),_0xef4f('0x15')][_0xef4f('0x16')](_0x1758fd)){this[_0xef4f('0xd')](_0xef4f('0xe'),_0xef4f('0xa'));}}return _0x1758fd;}},'servicelevel':{'type':Sequelize[_0xef4f('0x17')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xef4f('0x1')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xef4f('0x17')](0xb)},'timeout':{'type':Sequelize[_0xef4f('0x17')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xef4f('0x17')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xef4f('0x1')]},'weight':{'type':Sequelize[_0xef4f('0x17')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0xef4f('0x18'),'no'),'defaultValue':_0xef4f('0x18')},'autopause':{'type':Sequelize[_0xef4f('0x3')](_0xef4f('0x18'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xef4f('0x17')](0xb)},'autopausebusy':{'type':Sequelize[_0xef4f('0x3')](_0xef4f('0x18'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM'](_0xef4f('0x18'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xef4f('0x17')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM'](_0xef4f('0x18'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0xef4f('0x18'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xef4f('0x3')](_0xef4f('0x18'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xef4f('0x3')](_0xef4f('0x18'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xef4f('0x1')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xef4f('0x1')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xef4f('0x17')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xef4f('0x3')](_0xef4f('0x18'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xef4f('0x3')]('yes','no'),'defaultValue':_0xef4f('0x18')},'announce_holdtime':{'type':Sequelize['ENUM'](_0xef4f('0x18'),'no',_0xef4f('0x19')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xef4f('0x1')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xef4f('0x3')](_0xef4f('0x18'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0xef4f('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xef4f('0x1')],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize[_0xef4f('0x1')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xef4f('0x1')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xef4f('0x1')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xef4f('0x1')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xef4f('0x1')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xef4f('0x1')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xef4f('0x1')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xef4f('0x1')]},'queue_quantity1':{'type':Sequelize[_0xef4f('0x1')]},'queue_quantity2':{'type':Sequelize[_0xef4f('0x1')]},'queue_periodic_announce':{'type':Sequelize[_0xef4f('0x1')]},'queue_less_than':{'type':Sequelize[_0xef4f('0x1')]},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x59ae10){this[_0xef4f('0xd')](_0xef4f('0x1a'),_0x59ae10?_0x59ae10['join'](','):[]);},'get':function(){return this[_0xef4f('0xf')](_0xef4f('0x1a'))?this[_0xef4f('0xf')]('periodic_announce')[_0xef4f('0x1b')](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':_0xef4f('0x18'),'set':function(_0x1d796f){this[_0xef4f('0xd')]('joinempty',_0x1d796f?_0x1d796f[_0xef4f('0x1c')](','):undefined);},'get':function(){return this[_0xef4f('0xf')]('joinempty')?this[_0xef4f('0xf')](_0xef4f('0x1d'))[_0xef4f('0x1b')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0xef4f('0x1')],'defaultValue':'no','set':function(_0x495742){this['setDataValue']('leavewhenempty',_0x495742?_0x495742[_0xef4f('0x1c')](','):undefined);},'get':function(){return this[_0xef4f('0xf')](_0xef4f('0x1e'))?this[_0xef4f('0xf')](_0xef4f('0x1e'))['split'](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xef4f('0x3')]('yes','no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xef4f('0x3')](_0xef4f('0x18'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xef4f('0x17')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xef4f('0x3')](_0xef4f('0x18'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xef4f('0x1')]},'description':{'type':Sequelize[_0xef4f('0x1')]},'acw':{'type':Sequelize[_0xef4f('0x1f')],'defaultValue':0x0,'set':function(_0x130b24){this[_0xef4f('0xd')](_0xef4f('0x20'),_0x130b24);if(_0x130b24){if(this[_0xef4f('0xf')](_0xef4f('0x21'))<0x2){this[_0xef4f('0xd')](_0xef4f('0x21'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0xef4f('0x3')]('preview','progressive',_0xef4f('0x22'),_0xef4f('0x23'),_0xef4f('0x14')),'defaultValue':_0xef4f('0x24'),'comment':_0xef4f('0x25')},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)[_0xef4f('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0xef4f('0x17')](0x4)[_0xef4f('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xef4f('0x27')},'dialPowerLevel':{'type':Sequelize[_0xef4f('0x28')](0x2)[_0xef4f('0x26')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xef4f('0x29')},'dialPredictiveOptimization':{'type':Sequelize[_0xef4f('0x3')](_0xef4f('0x2a'),_0xef4f('0x2b')),'defaultValue':'dropRate','comment':_0xef4f('0x2c')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0xef4f('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xef4f('0x2d')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)[_0xef4f('0x26')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xef4f('0x2e')},'dialOriginateCallerIdName':{'type':Sequelize[_0xef4f('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xef4f('0x1')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xef4f('0x26')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xef4f('0x2f')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0xef4f('0x30'),'comment':_0xef4f('0x31')},'dialQueueTimeout':{'type':Sequelize[_0xef4f('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xef4f('0x32')},'dialQueueProject':{'type':Sequelize[_0xef4f('0x1')],'comment':_0xef4f('0x33')},'dialCongestionMaxRetry':{'type':Sequelize[_0xef4f('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xef4f('0x17')](0x5)[_0xef4f('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xef4f('0x34')},'dialBusyMaxRetry':{'type':Sequelize[_0xef4f('0x17')](0x3)[_0xef4f('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xef4f('0x35')},'dialBusyRetryFrequency':{'type':Sequelize[_0xef4f('0x17')](0x5)[_0xef4f('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xef4f('0x36')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xef4f('0x26')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xef4f('0x17')](0x5)[_0xef4f('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xef4f('0x37')},'dialGlobalMaxRetry':{'type':Sequelize[_0xef4f('0x17')](0x3)[_0xef4f('0x26')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xef4f('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xef4f('0x1')],'defaultValue':_0xef4f('0x38')},'dialPrefix':{'type':Sequelize[_0xef4f('0x1')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xef4f('0x3')](_0xef4f('0x39'),'never',_0xef4f('0x3a')),'defaultValue':_0xef4f('0x39')},'dialAMDActive':{'type':Sequelize[_0xef4f('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xef4f('0x17')](0x9)[_0xef4f('0x26')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xef4f('0x17')](0x9)[_0xef4f('0x26')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xef4f('0x3b')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xef4f('0x26')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xef4f('0x3c')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xef4f('0x17')](0x9)[_0xef4f('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xef4f('0x3d')},'dialAMDMinWordLength':{'type':Sequelize[_0xef4f('0x17')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xef4f('0x17')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xef4f('0x3e')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xef4f('0x17')](0x9)[_0xef4f('0x26')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xef4f('0x17')](0x5)[_0xef4f('0x26')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xef4f('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize[_0xef4f('0x17')](0x5)[_0xef4f('0x26')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0xef4f('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xef4f('0x3f'),_0xef4f('0x40')),'defaultValue':_0xef4f('0x3f')},'dialQueueProject2':{'type':Sequelize[_0xef4f('0x1')],'comment':_0xef4f('0x33')},'dialAgiAfterHangupClient':{'type':Sequelize[_0xef4f('0x1f')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xef4f('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xef4f('0x17')](0x3)[_0xef4f('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xef4f('0x41')},'dialCutDigit':{'type':Sequelize[_0xef4f('0x17')](0x3)[_0xef4f('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xef4f('0x17')](0x3)[_0xef4f('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xef4f('0x42')},'dialDropMaxRetry':{'type':Sequelize[_0xef4f('0x17')](0x3)[_0xef4f('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xef4f('0x43')},'dialDropRetryFrequency':{'type':Sequelize[_0xef4f('0x17')](0x5)[_0xef4f('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xef4f('0x44')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xef4f('0x17')](0x3)[_0xef4f('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xef4f('0x45')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xef4f('0x17')](0x5)[_0xef4f('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0xef4f('0x17')](0x3)[_0xef4f('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xef4f('0x46')},'dialMachineRetryFrequency':{'type':Sequelize[_0xef4f('0x17')](0x5)[_0xef4f('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xef4f('0x47')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xef4f('0x17')](0x3)[_0xef4f('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xef4f('0x48')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xef4f('0x17')](0x5)[_0xef4f('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0xef4f('0x17')],'allowNull':!![],'comment':_0xef4f('0x49')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xef4f('0x4a'),'set':function(_0x297bf3){if(!_0x297bf3)this[_0xef4f('0xd')](_0xef4f('0x4b'),null);this['setDataValue']('mandatoryDisposition',_0x297bf3);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xef4f('0x17')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xef4f('0x17')](0x3)[_0xef4f('0x26')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0xef4f('0x1f')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize['INTEGER'](0x3)[_0xef4f('0x26')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0xef4f('0x1f')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index acd440e..9f1202d 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 _0xf3a7=['Content-Range','apply','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','map','value','includes','type','find','name','error','stack','send','VoiceQueue','rawAttributes','fieldName','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','merge','VIRTUAL','options','where','include','includeAll','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','UserProfileResource','clone','params','omit','updatedAt','createdAt','autoAssociation','update','getHoppers','findOne','CmHopper','VoiceQueueId','getHopperHistories','CmHopperHistory','findAll','rows','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','Agents','online','voicePause','interface','flatMap','forEach','penalty','transaction','upsert','each','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','format','SIP/%s','emit','ids','User','select','tq.TeamId','from','team_has_voice_queues','join','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','every','TeamId','union','compact','removeTeams','isEmpty','removeAgents','addAgents','all','isArray','userVoiceQueue:remove','getAgents','getMembers','CmList','getLists','addLists','spread','dialCheckDuplicateType','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','field','CmListId','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','VoiceQueueId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','into','cm_hopper_additional_phones','ci.item','ci.OrderBy+1','h.ContactId=ci.CmContactId','ci.ItemClass=?','PHONE','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','sendStatus','status','end','json','offset','undefined','count','limit','set'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xf3a7,0x99));var _0x7f3a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf3a7[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7f3a('0x0'));var zipdir=require(_0x7f3a('0x1'));var jsonpatch=require(_0x7f3a('0x2'));var rp=require(_0x7f3a('0x3'));var moment=require(_0x7f3a('0x4'));var BPromise=require(_0x7f3a('0x5'));var Mustache=require(_0x7f3a('0x6'));var util=require(_0x7f3a('0x7'));var path=require(_0x7f3a('0x8'));var sox=require(_0x7f3a('0x9'));var csv=require('to-csv');var ejs=require(_0x7f3a('0xa'));var fs=require('fs');var fs_extra=require(_0x7f3a('0xb'));var _=require(_0x7f3a('0xc'));var squel=require(_0x7f3a('0xd'));var crypto=require(_0x7f3a('0xe'));var jsforce=require(_0x7f3a('0xf'));var deskjs=require(_0x7f3a('0x10'));var toCsv=require('to-csv');var querystring=require(_0x7f3a('0x11'));var Papa=require(_0x7f3a('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7f3a('0x13'));var as=require(_0x7f3a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7f3a('0x15'))('api');var utils=require(_0x7f3a('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x7f3a('0x17'));var db=require(_0x7f3a('0x18'))['db'];config[_0x7f3a('0x19')]=_[_0x7f3a('0x1a')](config[_0x7f3a('0x19')],{'host':_0x7f3a('0x1b'),'port':0x18eb});var socket=require(_0x7f3a('0x1c'))(new Redis(config[_0x7f3a('0x19')]));require(_0x7f3a('0x1d'))['register'](socket);function respondWithStatusCode(_0x2bb3e4,_0x576ec5){_0x576ec5=_0x576ec5||0xcc;return function(_0x19dac1){if(_0x19dac1){return _0x2bb3e4[_0x7f3a('0x1e')](_0x576ec5);}return _0x2bb3e4[_0x7f3a('0x1f')](_0x576ec5)[_0x7f3a('0x20')]();};}function respondWithResult(_0x22112c,_0x336a28){_0x336a28=_0x336a28||0xc8;return function(_0x2ce340){if(_0x2ce340){return _0x22112c['status'](_0x336a28)[_0x7f3a('0x21')](_0x2ce340);}};}function respondWithFilteredResult(_0x1a9dab,_0x512762){return function(_0x2eefb1){if(_0x2eefb1){var _0x2f46fb=typeof _0x512762[_0x7f3a('0x22')]===_0x7f3a('0x23')&&typeof _0x512762['limit']==='undefined';var _0x2d2164=_0x2eefb1[_0x7f3a('0x24')];var _0xf6d87c=_0x2f46fb?0x0:_0x512762[_0x7f3a('0x22')];var _0x3f5ad9=_0x2f46fb?_0x2eefb1['count']:_0x512762[_0x7f3a('0x22')]+_0x512762[_0x7f3a('0x25')];var _0x17f0e8;if(_0x3f5ad9>=_0x2d2164){_0x3f5ad9=_0x2d2164;_0x17f0e8=0xc8;}else{_0x17f0e8=0xce;}_0x1a9dab[_0x7f3a('0x1f')](_0x17f0e8);return _0x1a9dab[_0x7f3a('0x26')](_0x7f3a('0x27'),_0xf6d87c+'-'+_0x3f5ad9+'/'+_0x2d2164)[_0x7f3a('0x21')](_0x2eefb1);}return null;};}function patchUpdates(_0x203067){return function(_0x292a77){try{jsonpatch[_0x7f3a('0x28')](_0x292a77,_0x203067,!![]);}catch(_0x5c96a2){return BPromise['reject'](_0x5c96a2);}return _0x292a77['save']();};}function saveUpdates(_0x22cb57,_0x153e8e){return function(_0x8da81b){if(_0x8da81b){return _0x8da81b['update'](_0x22cb57)[_0x7f3a('0x29')](function(_0x38ccbf){return _0x38ccbf;});}return null;};}function removeEntity(_0x2505de,_0x3479dc){return function(_0x24ebb2){if(_0x24ebb2){return _0x24ebb2[_0x7f3a('0x2a')]()[_0x7f3a('0x29')](function(){var _0x1f48d6=_0x24ebb2[_0x7f3a('0x2b')]({'plain':!![]});var _0x4a9dd1=[{'name':_0x7f3a('0x2c'),'value':_0x7f3a('0x2d'),'ignore':![]},{'name':_0x7f3a('0x2e'),'value':_0x7f3a('0x2f'),'ignore':![]}];var _0xf5e37d=_(_0x4a9dd1)[_0x7f3a('0x30')](_0x7f3a('0x31'))[_0x7f3a('0x32')](_0x7f3a('0x33'))[_0x7f3a('0x33')]();if(_[_0x7f3a('0x34')](_0xf5e37d,_0x1f48d6[_0x7f3a('0x35')])){return;}var _0x28f468=_[_0x7f3a('0x36')](_0x4a9dd1,['value',_0x1f48d6[_0x7f3a('0x35')]])[_0x7f3a('0x37')];return db['UserProfileResource']['destroy']({'where':{'type':_0x28f468,'resourceId':_0x1f48d6['id']}})[_0x7f3a('0x29')](function(){return _0x24ebb2;});})[_0x7f3a('0x29')](function(){_0x2505de[_0x7f3a('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x37ebda,_0x2411ef){return function(_0x1c8be3){if(!_0x1c8be3){_0x37ebda['sendStatus'](0x194);}return _0x1c8be3;};}function handleError(_0xb29e1f,_0x472f63){_0x472f63=_0x472f63||0x1f4;return function(_0x497110){logger[_0x7f3a('0x38')](_0x497110[_0x7f3a('0x39')]);if(_0x497110['name']){delete _0x497110['name'];}_0xb29e1f['status'](_0x472f63)[_0x7f3a('0x3a')](_0x497110);};}exports['index']=function(_0x1d6e11,_0x257a8e){var _0x39c4cb={},_0xb5be15={},_0xfd5c7d={'count':0x0,'rows':[]};var _0x3ea8e5=_[_0x7f3a('0x32')](db[_0x7f3a('0x3b')][_0x7f3a('0x3c')],function(_0x238f28){return{'name':_0x238f28[_0x7f3a('0x3d')],'type':_0x238f28['type']['key']};});_0xb5be15[_0x7f3a('0x3e')]=_['map'](_0x3ea8e5,'name');_0xb5be15[_0x7f3a('0x3f')]=_[_0x7f3a('0x40')](_0x1d6e11[_0x7f3a('0x3f')]);_0xb5be15['filters']=_[_0x7f3a('0x41')](_0xb5be15['model'],_0xb5be15[_0x7f3a('0x3f')]);_0x39c4cb[_0x7f3a('0x42')]=_['intersection'](_0xb5be15[_0x7f3a('0x3e')],qs[_0x7f3a('0x43')](_0x1d6e11[_0x7f3a('0x3f')][_0x7f3a('0x43')]));_0x39c4cb[_0x7f3a('0x42')]=_0x39c4cb[_0x7f3a('0x42')][_0x7f3a('0x44')]?_0x39c4cb['attributes']:_0xb5be15['model'];if(!_0x1d6e11[_0x7f3a('0x3f')][_0x7f3a('0x45')](_0x7f3a('0x46'))){_0x39c4cb['limit']=qs['limit'](_0x1d6e11[_0x7f3a('0x3f')][_0x7f3a('0x25')]);_0x39c4cb[_0x7f3a('0x22')]=qs['offset'](_0x1d6e11[_0x7f3a('0x3f')][_0x7f3a('0x22')]);}_0x39c4cb[_0x7f3a('0x47')]=qs[_0x7f3a('0x48')](_0x1d6e11[_0x7f3a('0x3f')][_0x7f3a('0x48')]);_0x39c4cb['where']=qs[_0x7f3a('0x49')](_[_0x7f3a('0x4a')](_0x1d6e11[_0x7f3a('0x3f')],_0xb5be15['filters']),_0x3ea8e5);if(_0x1d6e11[_0x7f3a('0x3f')][_0x7f3a('0x30')]){_0x39c4cb['where']=_[_0x7f3a('0x4b')](_0x39c4cb['where'],{'$or':_['map'](_0x3ea8e5,function(_0xf0a65){if(_0xf0a65[_0x7f3a('0x35')]!==_0x7f3a('0x4c')){var _0x685188={};_0x685188[_0xf0a65['name']]={'$like':'%'+_0x1d6e11[_0x7f3a('0x3f')]['filter']+'%'};return _0x685188;}})});}_0x39c4cb=_['merge']({},_0x39c4cb,_0x1d6e11[_0x7f3a('0x4d')]);var _0x2c1a0a={'where':_0x39c4cb[_0x7f3a('0x4e')]};return db[_0x7f3a('0x3b')][_0x7f3a('0x24')](_0x2c1a0a)[_0x7f3a('0x29')](function(_0x36ac14){_0xfd5c7d[_0x7f3a('0x24')]=_0x36ac14;if(_0x1d6e11[_0x7f3a('0x3f')]['includeAll']){_0x39c4cb[_0x7f3a('0x4f')]=[{'all':!![]}];}return db[_0x7f3a('0x3b')]['findAll'](_0x39c4cb);})[_0x7f3a('0x29')](function(_0x17ca38){_0xfd5c7d['rows']=_0x17ca38;return _0xfd5c7d;})[_0x7f3a('0x29')](respondWithFilteredResult(_0x257a8e,_0x39c4cb))['catch'](handleError(_0x257a8e,null));};exports['show']=function(_0x1b3cd6,_0x2b094a){var _0x1e6bcd={'raw':![],'where':{'id':_0x1b3cd6['params']['id']}},_0x3b3496={};_0x3b3496[_0x7f3a('0x3e')]=_['keys'](db[_0x7f3a('0x3b')][_0x7f3a('0x3c')]);_0x3b3496[_0x7f3a('0x3f')]=_[_0x7f3a('0x40')](_0x1b3cd6[_0x7f3a('0x3f')]);_0x3b3496[_0x7f3a('0x49')]=_[_0x7f3a('0x41')](_0x3b3496[_0x7f3a('0x3e')],_0x3b3496[_0x7f3a('0x3f')]);_0x1e6bcd[_0x7f3a('0x42')]=_['intersection'](_0x3b3496['model'],qs['fields'](_0x1b3cd6[_0x7f3a('0x3f')]['fields']));_0x1e6bcd['attributes']=_0x1e6bcd[_0x7f3a('0x42')][_0x7f3a('0x44')]?_0x1e6bcd[_0x7f3a('0x42')]:_0x3b3496['model'];if(_0x1b3cd6[_0x7f3a('0x3f')][_0x7f3a('0x50')]){_0x1e6bcd[_0x7f3a('0x4f')]=[{'all':!![]}];}_0x1e6bcd=_[_0x7f3a('0x4b')]({},_0x1e6bcd,_0x1b3cd6[_0x7f3a('0x4d')]);return db[_0x7f3a('0x3b')][_0x7f3a('0x36')](_0x1e6bcd)[_0x7f3a('0x29')](handleEntityNotFound(_0x2b094a,null))['then'](respondWithResult(_0x2b094a,null))[_0x7f3a('0x51')](handleError(_0x2b094a,null));};exports[_0x7f3a('0x52')]=function(_0x1c7fc3,_0x3b0f26){return db[_0x7f3a('0x3b')][_0x7f3a('0x52')](_0x1c7fc3[_0x7f3a('0x53')],{})['then'](function(_0x3e614d){var _0x367fd3=_0x1c7fc3[_0x7f3a('0x54')][_0x7f3a('0x2b')]({'plain':!![]});if(!_0x367fd3)throw new Error(_0x7f3a('0x55'));if(_0x367fd3[_0x7f3a('0x56')]===_0x7f3a('0x54')){var _0x2ce903=_0x3e614d['get']({'plain':!![]});var _0x51125c=[{'name':'VoiceQueues','value':'inbound'},{'name':_0x7f3a('0x2e'),'value':_0x7f3a('0x2f')}];var _0x524e89=_[_0x7f3a('0x36')](_0x51125c,[_0x7f3a('0x33'),_0x2ce903[_0x7f3a('0x35')]])[_0x7f3a('0x37')];return db['UserProfileSection'][_0x7f3a('0x36')]({'where':{'name':_0x524e89,'userProfileId':_0x367fd3[_0x7f3a('0x57')]},'raw':!![]})[_0x7f3a('0x29')](function(_0x7afa9a){if(_0x7afa9a&&_0x7afa9a['autoAssociation']===0x0){return db[_0x7f3a('0x58')][_0x7f3a('0x52')]({'name':_0x2ce903[_0x7f3a('0x37')],'resourceId':_0x2ce903['id'],'type':_0x7afa9a[_0x7f3a('0x37')],'sectionId':_0x7afa9a['id']},{})[_0x7f3a('0x29')](function(){return _0x3e614d;});}else{return _0x3e614d;}})['catch'](function(_0x1478fb){logger[_0x7f3a('0x38')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1478fb);throw _0x1478fb;});}return _0x3e614d;})[_0x7f3a('0x29')](respondWithResult(_0x3b0f26,0xc9))[_0x7f3a('0x51')](handleError(_0x3b0f26,null));};exports[_0x7f3a('0x59')]=function(_0x3a0423,_0x311915){var _0x4bd525={'where':{'id':_0x3a0423[_0x7f3a('0x5a')]['id']}},_0x38bc55={};_0x38bc55[_0x7f3a('0x3e')]=_[_0x7f3a('0x40')](db['VoiceQueue'][_0x7f3a('0x3c')]);_0x4bd525[_0x7f3a('0x42')]=_[_0x7f3a('0x41')](_0x38bc55[_0x7f3a('0x3e')],qs[_0x7f3a('0x43')](_0x3a0423[_0x7f3a('0x3f')][_0x7f3a('0x43')]));_0x4bd525[_0x7f3a('0x42')]=_0x4bd525[_0x7f3a('0x42')][_0x7f3a('0x44')]?_0x4bd525[_0x7f3a('0x42')]:_0x38bc55[_0x7f3a('0x3e')];if(_0x3a0423[_0x7f3a('0x3f')][_0x7f3a('0x50')]){_0x4bd525[_0x7f3a('0x4f')]=[{'all':!![]}];}_0x4bd525=_[_0x7f3a('0x4b')]({},_0x4bd525,_0x3a0423['options']);return db['VoiceQueue'][_0x7f3a('0x36')](_0x4bd525)[_0x7f3a('0x29')](handleEntityNotFound(_0x311915,null))[_0x7f3a('0x29')](function(_0x7be140){if(_0x7be140){var _0x1ede5e=_0x7be140['get']({'plain':!![]});_0x1ede5e=qs[_0x7f3a('0x5b')](_0x1ede5e,['id','createdAt',_0x7f3a('0x5c')]);_0x3a0423[_0x7f3a('0x53')]=_[_0x7f3a('0x5b')](_0x3a0423['body'],['id',_0x7f3a('0x5d'),_0x7f3a('0x5c')]);return db[_0x7f3a('0x3b')][_0x7f3a('0x52')](_['merge'](_0x1ede5e,_0x3a0423[_0x7f3a('0x53')]),{'include':_0x3a0423['query'][_0x7f3a('0x50')]?[{'all':!![]}]:undefined})[_0x7f3a('0x29')](function(_0x28842a){var _0x391649=_0x3a0423[_0x7f3a('0x54')][_0x7f3a('0x2b')]({'plain':!![]});if(!_0x391649)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x391649[_0x7f3a('0x56')]===_0x7f3a('0x54')){var _0x1bfb9e=_0x28842a[_0x7f3a('0x2b')]({'plain':!![]});var _0x5ea653=[{'name':'VoiceQueues','value':'inbound'},{'name':_0x7f3a('0x2e'),'value':'outbound'}];var _0x3d5c9f=_['find'](_0x5ea653,[_0x7f3a('0x33'),_0x1bfb9e['type']])[_0x7f3a('0x37')];return db['UserProfileSection'][_0x7f3a('0x36')]({'where':{'name':_0x3d5c9f,'userProfileId':_0x391649[_0x7f3a('0x57')]},'raw':!![]})[_0x7f3a('0x29')](function(_0xd72ca9){if(_0xd72ca9&&_0xd72ca9[_0x7f3a('0x5e')]===0x0){return db['UserProfileResource'][_0x7f3a('0x52')]({'name':_0x1bfb9e[_0x7f3a('0x37')],'resourceId':_0x1bfb9e['id'],'type':_0xd72ca9[_0x7f3a('0x37')],'sectionId':_0xd72ca9['id']},{})['then'](function(){return _0x28842a;});}else{return _0x28842a;}})[_0x7f3a('0x51')](function(_0x1936e1){logger[_0x7f3a('0x38')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1936e1);throw _0x1936e1;});}return _0x28842a;});}})[_0x7f3a('0x29')](respondWithResult(_0x311915,0xc9))[_0x7f3a('0x51')](handleError(_0x311915,null));};exports[_0x7f3a('0x5f')]=function(_0x4a64a5,_0x2250b4){if(_0x4a64a5['body']['id']){delete _0x4a64a5[_0x7f3a('0x53')]['id'];}return db[_0x7f3a('0x3b')][_0x7f3a('0x36')]({'where':{'id':_0x4a64a5[_0x7f3a('0x5a')]['id']}})['then'](handleEntityNotFound(_0x2250b4,null))['then'](saveUpdates(_0x4a64a5[_0x7f3a('0x53')],null))[_0x7f3a('0x29')](respondWithResult(_0x2250b4,null))[_0x7f3a('0x51')](handleError(_0x2250b4,null));};exports[_0x7f3a('0x2a')]=function(_0x5f6fff,_0x1aa99e){return db[_0x7f3a('0x3b')][_0x7f3a('0x36')]({'where':{'id':_0x5f6fff[_0x7f3a('0x5a')]['id']}})[_0x7f3a('0x29')](handleEntityNotFound(_0x1aa99e,null))[_0x7f3a('0x29')](removeEntity(_0x1aa99e,null))[_0x7f3a('0x51')](handleError(_0x1aa99e,null));};exports[_0x7f3a('0x60')]=function(_0x3c09c6,_0x4f03de,_0x363c22){var _0xbec887={'raw':![],'where':{}};var _0x28510c={};var _0x240ece={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x7f3a('0x61')]({'where':{'id':_0x3c09c6['params']['id']}})['then'](handleEntityNotFound(_0x4f03de,null))[_0x7f3a('0x29')](function(_0x147c27){if(_0x147c27){_0x28510c[_0x7f3a('0x3e')]=_[_0x7f3a('0x40')](db[_0x7f3a('0x62')][_0x7f3a('0x3c')]);_0x28510c[_0x7f3a('0x3f')]=_[_0x7f3a('0x40')](_0x3c09c6[_0x7f3a('0x3f')]);_0x28510c['filters']=_[_0x7f3a('0x41')](_0x28510c[_0x7f3a('0x3e')],_0x28510c[_0x7f3a('0x3f')]);_0xbec887[_0x7f3a('0x42')]=_[_0x7f3a('0x41')](_0x28510c[_0x7f3a('0x3e')],qs[_0x7f3a('0x43')](_0x3c09c6[_0x7f3a('0x3f')][_0x7f3a('0x43')]));_0xbec887[_0x7f3a('0x42')]=_0xbec887[_0x7f3a('0x42')][_0x7f3a('0x44')]?_0xbec887['attributes']:_0x28510c[_0x7f3a('0x3e')];if(!_0x3c09c6[_0x7f3a('0x3f')][_0x7f3a('0x45')](_0x7f3a('0x46'))){_0xbec887[_0x7f3a('0x25')]=qs['limit'](_0x3c09c6[_0x7f3a('0x3f')][_0x7f3a('0x25')]);_0xbec887['offset']=qs[_0x7f3a('0x22')](_0x3c09c6[_0x7f3a('0x3f')][_0x7f3a('0x22')]);}_0xbec887[_0x7f3a('0x47')]=qs[_0x7f3a('0x48')](_0x3c09c6[_0x7f3a('0x3f')][_0x7f3a('0x48')]);_0xbec887[_0x7f3a('0x4e')]=qs[_0x7f3a('0x49')](_['pick'](_0x3c09c6[_0x7f3a('0x3f')],_0x28510c[_0x7f3a('0x49')]));_0xbec887['where'][_0x7f3a('0x63')]=_0x147c27['id'];if(_0x3c09c6['query'][_0x7f3a('0x30')]){_0xbec887['where']=_[_0x7f3a('0x4b')](_0xbec887[_0x7f3a('0x4e')],{'$or':_[_0x7f3a('0x32')](_0xbec887[_0x7f3a('0x42')],function(_0x609ad9){var _0x124bcc={};_0x124bcc[_0x609ad9]={'$like':'%'+_0x3c09c6[_0x7f3a('0x3f')]['filter']+'%'};return _0x124bcc;})});}_0xbec887=_[_0x7f3a('0x4b')]({},_0xbec887,_0x3c09c6[_0x7f3a('0x4d')]);return db[_0x7f3a('0x62')]['count']({'where':_0xbec887[_0x7f3a('0x4e')]})[_0x7f3a('0x29')](function(_0x996fdb){_0x240ece[_0x7f3a('0x24')]=_0x996fdb;if(_0x3c09c6[_0x7f3a('0x3f')][_0x7f3a('0x50')]){_0xbec887[_0x7f3a('0x4f')]=[{'all':!![]}];}return db[_0x7f3a('0x62')]['findAll'](_0xbec887);})[_0x7f3a('0x29')](function(_0x4db2c7){_0x240ece['rows']=_0x4db2c7;return _0x240ece;});}})[_0x7f3a('0x29')](respondWithFilteredResult(_0x4f03de,_0xbec887))['catch'](handleError(_0x4f03de,null));};exports[_0x7f3a('0x64')]=function(_0x1f4688,_0x4a31f5,_0x13e55a){var _0x529555={'raw':!![],'where':{}};var _0x21de53={};var _0x2fe30d={'count':0x0,'rows':[]};return db[_0x7f3a('0x3b')]['findOne']({'where':{'id':_0x1f4688[_0x7f3a('0x5a')]['id']}})[_0x7f3a('0x29')](handleEntityNotFound(_0x4a31f5,null))[_0x7f3a('0x29')](function(_0x14c2a6){if(_0x14c2a6){_0x21de53[_0x7f3a('0x3e')]=_['keys'](db[_0x7f3a('0x65')]['rawAttributes']);_0x21de53[_0x7f3a('0x3f')]=_[_0x7f3a('0x40')](_0x1f4688[_0x7f3a('0x3f')]);_0x21de53[_0x7f3a('0x49')]=_['intersection'](_0x21de53['model'],_0x21de53['query']);_0x529555[_0x7f3a('0x42')]=_[_0x7f3a('0x41')](_0x21de53[_0x7f3a('0x3e')],qs[_0x7f3a('0x43')](_0x1f4688[_0x7f3a('0x3f')][_0x7f3a('0x43')]));_0x529555[_0x7f3a('0x42')]=_0x529555[_0x7f3a('0x42')]['length']?_0x529555[_0x7f3a('0x42')]:_0x21de53[_0x7f3a('0x3e')];if(!_0x1f4688[_0x7f3a('0x3f')][_0x7f3a('0x45')](_0x7f3a('0x46'))){_0x529555[_0x7f3a('0x25')]=qs[_0x7f3a('0x25')](_0x1f4688[_0x7f3a('0x3f')][_0x7f3a('0x25')]);_0x529555[_0x7f3a('0x22')]=qs['offset'](_0x1f4688[_0x7f3a('0x3f')]['offset']);}_0x529555[_0x7f3a('0x47')]=qs[_0x7f3a('0x48')](_0x1f4688[_0x7f3a('0x3f')][_0x7f3a('0x48')]);_0x529555[_0x7f3a('0x4e')]=qs[_0x7f3a('0x49')](_['pick'](_0x1f4688['query'],_0x21de53[_0x7f3a('0x49')]));_0x529555[_0x7f3a('0x4e')][_0x7f3a('0x63')]=_0x14c2a6['id'];if(_0x1f4688[_0x7f3a('0x3f')]['filter']){_0x529555[_0x7f3a('0x4e')]=_['merge'](_0x529555[_0x7f3a('0x4e')],{'$or':_['map'](_0x529555['attributes'],function(_0x36e876){var _0x2d1f2d={};_0x2d1f2d[_0x36e876]={'$like':'%'+_0x1f4688[_0x7f3a('0x3f')]['filter']+'%'};return _0x2d1f2d;})});}_0x529555=_[_0x7f3a('0x4b')]({},_0x529555,_0x1f4688[_0x7f3a('0x4d')]);return db[_0x7f3a('0x65')][_0x7f3a('0x24')]({'where':_0x529555['where']})['then'](function(_0x181f10){_0x2fe30d[_0x7f3a('0x24')]=_0x181f10;if(_0x1f4688['query'][_0x7f3a('0x50')]){_0x529555[_0x7f3a('0x4f')]=[{'all':!![]}];}return db[_0x7f3a('0x65')][_0x7f3a('0x66')](_0x529555);})['then'](function(_0x458ad6){_0x2fe30d[_0x7f3a('0x67')]=_0x458ad6;return _0x2fe30d;});}})[_0x7f3a('0x29')](respondWithFilteredResult(_0x4a31f5,_0x529555))['catch'](handleError(_0x4a31f5,null));};exports[_0x7f3a('0x68')]=function(_0x1b2dab,_0x57ecf2,_0xb63867){var _0x1d8eaf={'raw':!![],'where':{}};var _0xf222cf={};var _0x3f23f5={'count':0x0,'rows':[]};return db[_0x7f3a('0x3b')][_0x7f3a('0x61')]({'where':{'id':_0x1b2dab[_0x7f3a('0x5a')]['id']}})[_0x7f3a('0x29')](handleEntityNotFound(_0x57ecf2,null))[_0x7f3a('0x29')](function(_0x426d80){if(_0x426d80){_0xf222cf[_0x7f3a('0x3e')]=_[_0x7f3a('0x40')](db['CmHopperFinal'][_0x7f3a('0x3c')]);_0xf222cf[_0x7f3a('0x3f')]=_['keys'](_0x1b2dab['query']);_0xf222cf[_0x7f3a('0x49')]=_[_0x7f3a('0x41')](_0xf222cf[_0x7f3a('0x3e')],_0xf222cf['query']);_0x1d8eaf['attributes']=_['intersection'](_0xf222cf['model'],qs[_0x7f3a('0x43')](_0x1b2dab[_0x7f3a('0x3f')]['fields']));_0x1d8eaf[_0x7f3a('0x42')]=_0x1d8eaf[_0x7f3a('0x42')][_0x7f3a('0x44')]?_0x1d8eaf[_0x7f3a('0x42')]:_0xf222cf[_0x7f3a('0x3e')];if(!_0x1b2dab[_0x7f3a('0x3f')][_0x7f3a('0x45')]('nolimit')){_0x1d8eaf[_0x7f3a('0x25')]=qs['limit'](_0x1b2dab['query'][_0x7f3a('0x25')]);_0x1d8eaf[_0x7f3a('0x22')]=qs['offset'](_0x1b2dab[_0x7f3a('0x3f')]['offset']);}_0x1d8eaf[_0x7f3a('0x47')]=qs[_0x7f3a('0x48')](_0x1b2dab[_0x7f3a('0x3f')][_0x7f3a('0x48')]);_0x1d8eaf[_0x7f3a('0x4e')]=qs['filters'](_[_0x7f3a('0x4a')](_0x1b2dab['query'],_0xf222cf[_0x7f3a('0x49')]));_0x1d8eaf[_0x7f3a('0x4e')][_0x7f3a('0x63')]=_0x426d80['id'];if(_0x1b2dab[_0x7f3a('0x3f')][_0x7f3a('0x30')]){_0x1d8eaf[_0x7f3a('0x4e')]=_['merge'](_0x1d8eaf[_0x7f3a('0x4e')],{'$or':_[_0x7f3a('0x32')](_0x1d8eaf[_0x7f3a('0x42')],function(_0x15d73c){var _0x2de906={};_0x2de906[_0x15d73c]={'$like':'%'+_0x1b2dab[_0x7f3a('0x3f')]['filter']+'%'};return _0x2de906;})});}_0x1d8eaf=_['merge']({},_0x1d8eaf,_0x1b2dab['options']);return db['CmHopperFinal']['count']({'where':_0x1d8eaf[_0x7f3a('0x4e')]})[_0x7f3a('0x29')](function(_0x4613ea){_0x3f23f5[_0x7f3a('0x24')]=_0x4613ea;if(_0x1b2dab[_0x7f3a('0x3f')][_0x7f3a('0x50')]){_0x1d8eaf[_0x7f3a('0x4f')]=[{'all':!![]}];}return db[_0x7f3a('0x69')][_0x7f3a('0x66')](_0x1d8eaf);})[_0x7f3a('0x29')](function(_0x1fafb8){_0x3f23f5[_0x7f3a('0x67')]=_0x1fafb8;return _0x3f23f5;});}})[_0x7f3a('0x29')](respondWithFilteredResult(_0x57ecf2,_0x1d8eaf))[_0x7f3a('0x51')](handleError(_0x57ecf2,null));};exports[_0x7f3a('0x6a')]=function(_0xd61d9a,_0x55122b,_0xd8f789){var _0x51ca63={'raw':!![],'where':{}};var _0xa97939={};var _0x2d5a0c={'count':0x0,'rows':[]};return db[_0x7f3a('0x3b')][_0x7f3a('0x61')]({'where':{'id':_0xd61d9a[_0x7f3a('0x5a')]['id']}})[_0x7f3a('0x29')](handleEntityNotFound(_0x55122b,null))[_0x7f3a('0x29')](function(_0x5b0367){if(_0x5b0367){_0xa97939[_0x7f3a('0x3e')]=_['keys'](db[_0x7f3a('0x6b')][_0x7f3a('0x3c')]);_0xa97939[_0x7f3a('0x3f')]=_[_0x7f3a('0x40')](_0xd61d9a['query']);_0xa97939['filters']=_[_0x7f3a('0x41')](_0xa97939[_0x7f3a('0x3e')],_0xa97939[_0x7f3a('0x3f')]);_0x51ca63['attributes']=_[_0x7f3a('0x41')](_0xa97939['model'],qs['fields'](_0xd61d9a[_0x7f3a('0x3f')][_0x7f3a('0x43')]));_0x51ca63[_0x7f3a('0x42')]=_0x51ca63[_0x7f3a('0x42')]['length']?_0x51ca63[_0x7f3a('0x42')]:_0xa97939[_0x7f3a('0x3e')];if(!_0xd61d9a[_0x7f3a('0x3f')][_0x7f3a('0x45')]('nolimit')){_0x51ca63['limit']=qs[_0x7f3a('0x25')](_0xd61d9a[_0x7f3a('0x3f')][_0x7f3a('0x25')]);_0x51ca63[_0x7f3a('0x22')]=qs['offset'](_0xd61d9a[_0x7f3a('0x3f')][_0x7f3a('0x22')]);}_0x51ca63['order']=qs['sort'](_0xd61d9a['query'][_0x7f3a('0x48')]);_0x51ca63[_0x7f3a('0x4e')]=qs[_0x7f3a('0x49')](_[_0x7f3a('0x4a')](_0xd61d9a['query'],_0xa97939['filters']));_0x51ca63[_0x7f3a('0x4e')][_0x7f3a('0x63')]=_0x5b0367['id'];if(_0xd61d9a[_0x7f3a('0x3f')]['filter']){_0x51ca63[_0x7f3a('0x4e')]=_[_0x7f3a('0x4b')](_0x51ca63[_0x7f3a('0x4e')],{'$or':_[_0x7f3a('0x32')](_0x51ca63['attributes'],function(_0x11befd){var _0x1a68ac={};_0x1a68ac[_0x11befd]={'$like':'%'+_0xd61d9a['query'][_0x7f3a('0x30')]+'%'};return _0x1a68ac;})});}_0x51ca63=_[_0x7f3a('0x4b')]({},_0x51ca63,_0xd61d9a[_0x7f3a('0x4d')]);return db[_0x7f3a('0x6b')]['count']({'where':_0x51ca63[_0x7f3a('0x4e')]})['then'](function(_0x2d370d){_0x2d5a0c['count']=_0x2d370d;if(_0xd61d9a['query'][_0x7f3a('0x50')]){_0x51ca63[_0x7f3a('0x4f')]=[{'all':!![]}];}return db[_0x7f3a('0x6b')][_0x7f3a('0x66')](_0x51ca63);})['then'](function(_0x4286da){_0x2d5a0c[_0x7f3a('0x67')]=_0x4286da;return _0x2d5a0c;});}})[_0x7f3a('0x29')](respondWithFilteredResult(_0x55122b,_0x51ca63))[_0x7f3a('0x51')](handleError(_0x55122b,null));};exports[_0x7f3a('0x6c')]=function(_0x57cf31,_0x53b845,_0x578f59){var _0x221eb9={};var _0xa47d3a={};var _0x2fe3a0;var _0x55756a;return db[_0x7f3a('0x3b')]['findOne']({'where':{'id':_0x57cf31['params']['id']}})['then'](handleEntityNotFound(_0x53b845,null))[_0x7f3a('0x29')](function(_0x2f4601){if(_0x2f4601){_0x2fe3a0=_0x2f4601;_0xa47d3a['model']=_[_0x7f3a('0x40')](db[_0x7f3a('0x6d')][_0x7f3a('0x3c')]);_0xa47d3a[_0x7f3a('0x3f')]=_[_0x7f3a('0x40')](_0x57cf31[_0x7f3a('0x3f')]);_0xa47d3a['filters']=_[_0x7f3a('0x41')](_0xa47d3a[_0x7f3a('0x3e')],_0xa47d3a['query']);_0x221eb9[_0x7f3a('0x42')]=_[_0x7f3a('0x41')](_0xa47d3a['model'],qs[_0x7f3a('0x43')](_0x57cf31['query'][_0x7f3a('0x43')]));_0x221eb9[_0x7f3a('0x42')]=_0x221eb9[_0x7f3a('0x42')][_0x7f3a('0x44')]?_0x221eb9[_0x7f3a('0x42')]:_0xa47d3a[_0x7f3a('0x3e')];_0x221eb9[_0x7f3a('0x47')]=qs[_0x7f3a('0x48')](_0x57cf31['query'][_0x7f3a('0x48')]);_0x221eb9[_0x7f3a('0x4e')]=qs['filters'](_[_0x7f3a('0x4a')](_0x57cf31[_0x7f3a('0x3f')],_0xa47d3a[_0x7f3a('0x49')]));if(_0x57cf31['query'][_0x7f3a('0x30')]){_0x221eb9[_0x7f3a('0x4e')]=_[_0x7f3a('0x4b')](_0x221eb9[_0x7f3a('0x4e')],{'$or':_[_0x7f3a('0x32')](_0x221eb9[_0x7f3a('0x42')],function(_0x4d9b38){var _0x2d1d5d={};_0x2d1d5d[_0x4d9b38]={'$like':'%'+_0x57cf31[_0x7f3a('0x3f')][_0x7f3a('0x30')]+'%'};return _0x2d1d5d;})});}_0x221eb9=_[_0x7f3a('0x4b')]({},_0x221eb9,_0x57cf31['options']);return _0x2fe3a0[_0x7f3a('0x6c')](_0x221eb9);}})[_0x7f3a('0x29')](function(_0x50b4b6){if(_0x50b4b6){_0x55756a=_0x50b4b6[_0x7f3a('0x44')];if(!_0x57cf31[_0x7f3a('0x3f')][_0x7f3a('0x45')]('nolimit')){_0x221eb9[_0x7f3a('0x25')]=qs[_0x7f3a('0x25')](_0x57cf31[_0x7f3a('0x3f')][_0x7f3a('0x25')]);_0x221eb9[_0x7f3a('0x22')]=qs[_0x7f3a('0x22')](_0x57cf31[_0x7f3a('0x3f')][_0x7f3a('0x22')]);}return _0x2fe3a0['getTeams'](_0x221eb9);}})[_0x7f3a('0x29')](function(_0x383c85){if(_0x383c85){return _0x383c85?{'count':_0x55756a,'rows':_0x383c85}:null;}})[_0x7f3a('0x29')](respondWithResult(_0x53b845,null))[_0x7f3a('0x51')](handleError(_0x53b845,null));};exports[_0x7f3a('0x6e')]=function(_0x394009,_0x4f5a71,_0x1c6ba4){var _0x202d63=_0x394009[_0x7f3a('0x53')][_0x7f3a('0x6f')];var _0x1ce1de=_['map'](_0x202d63,'id');return db['Team'][_0x7f3a('0x66')]({'where':{'id':_0x1ce1de},'attributes':['id'],'include':[{'model':db['User'],'as':_0x7f3a('0x70'),'attributes':['id',_0x7f3a('0x37'),_0x7f3a('0x71'),_0x7f3a('0x72'),_0x7f3a('0x73')],'raw':!![]}]})[_0x7f3a('0x29')](function(_0x23c5e2){if(_0x23c5e2){var _0x1f785f=_[_0x7f3a('0x74')](_0x23c5e2,function(_0x324846){var _0x2e872b=_0x324846[_0x7f3a('0x2b')]({'plain':!![]});_0x2e872b['Agents'][_0x7f3a('0x75')](function(_0x1ddbc7){_0x1ddbc7[_0x7f3a('0x76')]=_[_0x7f3a('0x36')](_0x202d63,{'id':_0x2e872b['id']})[_0x7f3a('0x76')];});return _0x2e872b[_0x7f3a('0x70')];});return db[_0x7f3a('0x3b')][_0x7f3a('0x36')]({'where':{'id':_0x394009[_0x7f3a('0x5a')]['id']}})[_0x7f3a('0x29')](function(_0x338003){return db['sequelize'][_0x7f3a('0x77')](function(_0xa4050e){return _0x338003[_0x7f3a('0x6e')](_0x1ce1de,{'transaction':_0xa4050e})[_0x7f3a('0x29')](function(){return BPromise['each'](_0x202d63,function(_0x561744){return db['TeamVoiceQueue'][_0x7f3a('0x78')]({'TeamId':_0x561744['id'],'VoiceQueueId':_0x394009['params']['id'],'penalty':_0x561744[_0x7f3a('0x76')]},{'transaction':_0xa4050e});});})[_0x7f3a('0x29')](function(){return BPromise[_0x7f3a('0x79')](_0x1f785f,function(_0x48c25c){return db[_0x7f3a('0x7a')][_0x7f3a('0x7b')]({'where':{'UserId':_0x48c25c['id'],'VoiceQueueId':_0x394009['params']['id']},'defaults':{'penalty':_0x48c25c[_0x7f3a('0x76')]},'transaction':_0xa4050e});});})['then'](function(){return BPromise[_0x7f3a('0x79')](_[_0x7f3a('0x30')](_0x1f785f,{'online':!![]}),function(_0x4a0ba3){return db[_0x7f3a('0x7c')][_0x7f3a('0x78')]({'membername':_0x4a0ba3['name'],'UserId':_0x4a0ba3['id'],'queue_name':_0x338003[_0x7f3a('0x37')],'VoiceQueueId':_0x338003['id'],'interface':_[_0x7f3a('0x7d')](_0x4a0ba3['interface'])?util[_0x7f3a('0x7e')](_0x7f3a('0x7f'),_0x4a0ba3[_0x7f3a('0x37')]):_0x4a0ba3['interface'],'paused':_0x4a0ba3[_0x7f3a('0x72')]||![],'penalty':_0x4a0ba3[_0x7f3a('0x76')]},{'transaction':_0xa4050e});});})[_0x7f3a('0x29')](function(){_0x1f785f[_0x7f3a('0x75')](function(_0x171cbe){socket[_0x7f3a('0x80')]('userVoiceQueue:save',{'UserId':_0x171cbe['id'],'VoiceQueueId':_0x338003['id']});});});});});}})['then'](respondWithStatusCode(_0x4f5a71,null))['catch'](handleError(_0x4f5a71,null));};exports['removeTeams']=function(_0xcd8511,_0x1f1bdd,_0x52a73d){return db[_0x7f3a('0x6d')]['findAll']({'where':{'id':_0xcd8511['query'][_0x7f3a('0x81')]},'attributes':['id'],'include':[{'model':db[_0x7f3a('0x82')],'as':_0x7f3a('0x70'),'attributes':['id'],'raw':!![]}]})[_0x7f3a('0x29')](handleEntityNotFound(_0x1f1bdd,null))[_0x7f3a('0x29')](function(_0x36cab6){var _0x17d00d=_[_0x7f3a('0x32')](_0x36cab6,'id');var _0x2ec156=[];var _0x1ac434=[];var _0x1d3df9=squel[_0x7f3a('0x83')]();_0x1d3df9['field'](_0x7f3a('0x84'))[_0x7f3a('0x85')](_0x7f3a('0x86'),'tq')[_0x7f3a('0x87')]('user_has_teams','ut',_0x7f3a('0x88'))[_0x7f3a('0x4e')]('VoiceQueueId\x20=\x20?',_0xcd8511[_0x7f3a('0x5a')]['id']);for(var _0x254b16=0x0;_0x254b16<_0x36cab6['length'];_0x254b16+=0x1){let _0xbe9527=_0x36cab6[_0x254b16];for(var _0x3b1c67=0x0;_0x3b1c67<_0xbe9527['Agents'][_0x7f3a('0x44')];_0x3b1c67+=0x1){let _0x235163=_0xbe9527[_0x7f3a('0x70')][_0x3b1c67];var _0x473961=_0x1d3df9[_0x7f3a('0x59')]();_0x473961[_0x7f3a('0x4e')](_0x7f3a('0x89'),_0x235163['id']);_0x1ac434[_0x7f3a('0x8a')](db[_0x7f3a('0x8b')][_0x7f3a('0x3f')](_0x473961[_0x7f3a('0x8c')](),{'type':db[_0x7f3a('0x8b')][_0x7f3a('0x8d')]['SELECT']})['then'](function(_0x83d94a){if(_0x83d94a['length']===0x1){return _0x235163['id'];}else{var _0x1de0d8=_[_0x7f3a('0x8e')](_['map'](_0x83d94a,_0x7f3a('0x8f')),function(_0x3b9475){return _['includes'](_0x17d00d,_0x3b9475);});if(_0x1de0d8){return _0x235163['id'];}}}));}}return BPromise['all'](_0x1ac434)[_0x7f3a('0x29')](function(_0x5308f7){_0x2ec156=_(_0x2ec156)[_0x7f3a('0x90')](_0x5308f7)[_0x7f3a('0x91')]()[_0x7f3a('0x33')]();return db[_0x7f3a('0x3b')][_0x7f3a('0x36')]({'where':{'id':_0xcd8511[_0x7f3a('0x5a')]['id']}})[_0x7f3a('0x29')](function(_0x23914a){return db['sequelize'][_0x7f3a('0x77')](function(_0x262cc8){return _0x23914a[_0x7f3a('0x92')](_0xcd8511[_0x7f3a('0x3f')][_0x7f3a('0x81')],{'transaction':_0x262cc8})[_0x7f3a('0x29')](function(){if(!_[_0x7f3a('0x93')](_0x2ec156)){return _0x23914a[_0x7f3a('0x94')](_0x2ec156,{'transaction':_0x262cc8})[_0x7f3a('0x29')](function(){return db[_0x7f3a('0x7c')]['destroy']({'where':{'VoiceQueueId':_0xcd8511[_0x7f3a('0x5a')]['id'],'UserId':_0x2ec156},'transaction':_0x262cc8});});}})[_0x7f3a('0x29')](function(){_0x2ec156[_0x7f3a('0x75')](function(_0x1d97ac){socket[_0x7f3a('0x80')]('userVoiceQueue:remove',{'UserId':_0x1d97ac,'VoiceQueueId':_0x23914a['id']});});});});});});})[_0x7f3a('0x29')](respondWithStatusCode(_0x1f1bdd,null))['catch'](handleError(_0x1f1bdd,null));};exports[_0x7f3a('0x95')]=function(_0x24ee2e,_0x37ab82,_0x9bc2a9){var _0x5c7b31,_0x35dd91;return db[_0x7f3a('0x3b')]['find']({'where':{'id':_0x24ee2e['params']['id']}})[_0x7f3a('0x29')](handleEntityNotFound(_0x37ab82,null))[_0x7f3a('0x29')](function(_0x384c0d){if(_0x384c0d){_0x35dd91=_0x384c0d;return _0x384c0d[_0x7f3a('0x95')](_0x24ee2e[_0x7f3a('0x53')][_0x7f3a('0x81')],_[_0x7f3a('0x5b')](_0x24ee2e['body'],['ids','id'])||{})['spread'](function(_0x22afb3){for(var _0x23b4ca=0x0;_0x23b4ca<_0x24ee2e[_0x7f3a('0x53')][_0x7f3a('0x81')][_0x7f3a('0x44')];_0x23b4ca+=0x1){socket[_0x7f3a('0x80')]('userVoiceQueue:save',{'UserId':Number(_0x24ee2e[_0x7f3a('0x53')]['ids'][_0x23b4ca]),'VoiceQueueId':Number(_0x24ee2e[_0x7f3a('0x5a')]['id'])});}return _0x22afb3;});}})[_0x7f3a('0x29')](function(_0x956575){_0x5c7b31=_0x956575||[];if(_0x35dd91){return db[_0x7f3a('0x82')]['findAll']({'where':{'id':_0x24ee2e[_0x7f3a('0x53')][_0x7f3a('0x81')]},'attributes':['id',_0x7f3a('0x37'),_0x7f3a('0x71'),_0x7f3a('0x72'),'interface'],'raw':!![]});}})[_0x7f3a('0x29')](function(_0x5ea12c){if(!_[_0x7f3a('0x93')](_0x5ea12c)){var _0x20c2bd=[];for(var _0x3433d5=0x0;_0x3433d5<_0x5ea12c['length'];_0x3433d5++){if(_0x5ea12c[_0x3433d5][_0x7f3a('0x71')]){_0x20c2bd['push'](db[_0x7f3a('0x7c')][_0x7f3a('0x78')]({'membername':_0x5ea12c[_0x3433d5][_0x7f3a('0x37')],'UserId':_0x5ea12c[_0x3433d5]['id'],'queue_name':_0x35dd91[_0x7f3a('0x37')],'VoiceQueueId':_0x35dd91['id'],'interface':_[_0x7f3a('0x7d')](_0x5ea12c[_0x3433d5][_0x7f3a('0x73')])?util[_0x7f3a('0x7e')](_0x7f3a('0x7f'),_0x5ea12c[_0x3433d5][_0x7f3a('0x37')]):_0x5ea12c[_0x3433d5]['interface'],'paused':_0x5ea12c[_0x3433d5][_0x7f3a('0x72')]||![],'penalty':_0x24ee2e['body'][_0x7f3a('0x76')]||0x0}));}}return BPromise[_0x7f3a('0x96')](_0x20c2bd);}})[_0x7f3a('0x29')](function(){return _0x5c7b31;})['then'](respondWithResult(_0x37ab82,null))['catch'](handleError(_0x37ab82,null));};exports[_0x7f3a('0x94')]=function(_0xabafef,_0x313639,_0x4ff60c){return db[_0x7f3a('0x3b')][_0x7f3a('0x36')]({'where':{'id':_0xabafef[_0x7f3a('0x5a')]['id']}})[_0x7f3a('0x29')](handleEntityNotFound(_0x313639,null))[_0x7f3a('0x29')](function(_0x54cd9b){if(_0x54cd9b){return _0x54cd9b[_0x7f3a('0x94')](_0xabafef[_0x7f3a('0x3f')][_0x7f3a('0x81')])[_0x7f3a('0x29')](function(){if(_[_0x7f3a('0x97')](_0xabafef[_0x7f3a('0x3f')][_0x7f3a('0x81')])){for(var _0x30889e=0x0;_0x30889e<_0xabafef[_0x7f3a('0x3f')]['ids'][_0x7f3a('0x44')];_0x30889e+=0x1){socket[_0x7f3a('0x80')]('userVoiceQueue:remove',{'UserId':Number(_0xabafef[_0x7f3a('0x3f')][_0x7f3a('0x81')][_0x30889e]),'VoiceQueueId':Number(_0xabafef[_0x7f3a('0x5a')]['id'])});}}else{socket['emit'](_0x7f3a('0x98'),{'UserId':Number(_0xabafef[_0x7f3a('0x3f')]['ids']),'VoiceQueueId':Number(_0xabafef[_0x7f3a('0x5a')]['id'])});}});}})['then'](function(_0x4ac422){return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0xabafef[_0x7f3a('0x5a')]['id'],'UserId':_0xabafef[_0x7f3a('0x3f')][_0x7f3a('0x81')]}})[_0x7f3a('0x29')](function(){return _0x4ac422;});})['then'](respondWithStatusCode(_0x313639,null))[_0x7f3a('0x51')](handleError(_0x313639,null));};exports['getAgents']=function(_0x40bc14,_0x14a3ef,_0x25bba7){var _0x1aac85={};var _0x579060={};var _0x1d5ba5;var _0x4a4c03;return db[_0x7f3a('0x3b')]['findOne']({'where':{'id':_0x40bc14['params']['id']}})[_0x7f3a('0x29')](handleEntityNotFound(_0x14a3ef,null))[_0x7f3a('0x29')](function(_0x4470e0){if(_0x4470e0){_0x1d5ba5=_0x4470e0;_0x579060[_0x7f3a('0x3e')]=_[_0x7f3a('0x40')](db['User'][_0x7f3a('0x3c')]);_0x579060[_0x7f3a('0x3f')]=_[_0x7f3a('0x40')](_0x40bc14[_0x7f3a('0x3f')]);_0x579060[_0x7f3a('0x49')]=_[_0x7f3a('0x41')](_0x579060[_0x7f3a('0x3e')],_0x579060['query']);_0x1aac85[_0x7f3a('0x42')]=_[_0x7f3a('0x41')](_0x579060[_0x7f3a('0x3e')],qs['fields'](_0x40bc14[_0x7f3a('0x3f')][_0x7f3a('0x43')]));_0x1aac85[_0x7f3a('0x42')]=_0x1aac85['attributes'][_0x7f3a('0x44')]?_0x1aac85[_0x7f3a('0x42')]:_0x579060['model'];_0x1aac85[_0x7f3a('0x47')]=qs[_0x7f3a('0x48')](_0x40bc14['query'][_0x7f3a('0x48')]);_0x1aac85['where']=qs[_0x7f3a('0x49')](_[_0x7f3a('0x4a')](_0x40bc14['query'],_0x579060['filters']));if(_0x40bc14[_0x7f3a('0x3f')][_0x7f3a('0x30')]){_0x1aac85[_0x7f3a('0x4e')]=_[_0x7f3a('0x4b')](_0x1aac85[_0x7f3a('0x4e')],{'$or':_[_0x7f3a('0x32')](_0x1aac85[_0x7f3a('0x42')],function(_0x25deed){var _0x1c80ce={};_0x1c80ce[_0x25deed]={'$like':'%'+_0x40bc14[_0x7f3a('0x3f')][_0x7f3a('0x30')]+'%'};return _0x1c80ce;})});}_0x1aac85=_['merge']({},_0x1aac85,_0x40bc14[_0x7f3a('0x4d')]);return _0x1d5ba5[_0x7f3a('0x99')](_0x1aac85);}})[_0x7f3a('0x29')](function(_0x3b1e41){if(_0x3b1e41){_0x4a4c03=_0x3b1e41[_0x7f3a('0x44')];if(!_0x40bc14['query'][_0x7f3a('0x45')]('nolimit')){_0x1aac85[_0x7f3a('0x25')]=qs[_0x7f3a('0x25')](_0x40bc14[_0x7f3a('0x3f')][_0x7f3a('0x25')]);_0x1aac85[_0x7f3a('0x22')]=qs['offset'](_0x40bc14[_0x7f3a('0x3f')][_0x7f3a('0x22')]);}return _0x1d5ba5[_0x7f3a('0x99')](_0x1aac85);}})['then'](function(_0x3cf65a){if(_0x3cf65a){return _0x3cf65a?{'count':_0x4a4c03,'rows':_0x3cf65a}:null;}})[_0x7f3a('0x29')](respondWithResult(_0x14a3ef,null))['catch'](handleError(_0x14a3ef,null));};exports[_0x7f3a('0x9a')]=function(_0x10c83d,_0x48acdb,_0x4bf7e3){var _0x2e61dd={};var _0x1b414f={};var _0x2108ad;var _0x135de6;return db['VoiceQueue'][_0x7f3a('0x61')]({'where':{'id':_0x10c83d[_0x7f3a('0x5a')]['id']}})[_0x7f3a('0x29')](handleEntityNotFound(_0x48acdb,null))[_0x7f3a('0x29')](function(_0x90dcc5){if(_0x90dcc5){_0x2108ad=_0x90dcc5;_0x1b414f['model']=_['keys'](db[_0x7f3a('0x7c')][_0x7f3a('0x3c')]);_0x1b414f[_0x7f3a('0x3f')]=_['keys'](_0x10c83d[_0x7f3a('0x3f')]);_0x1b414f[_0x7f3a('0x49')]=_[_0x7f3a('0x41')](_0x1b414f[_0x7f3a('0x3e')],_0x1b414f[_0x7f3a('0x3f')]);_0x2e61dd[_0x7f3a('0x42')]=_[_0x7f3a('0x41')](_0x1b414f[_0x7f3a('0x3e')],qs[_0x7f3a('0x43')](_0x10c83d[_0x7f3a('0x3f')][_0x7f3a('0x43')]));_0x2e61dd[_0x7f3a('0x42')]=_0x2e61dd['attributes'][_0x7f3a('0x44')]?_0x2e61dd[_0x7f3a('0x42')]:_0x1b414f[_0x7f3a('0x3e')];_0x2e61dd[_0x7f3a('0x47')]=qs['sort'](_0x10c83d[_0x7f3a('0x3f')]['sort']);_0x2e61dd[_0x7f3a('0x4e')]=qs[_0x7f3a('0x49')](_[_0x7f3a('0x4a')](_0x10c83d[_0x7f3a('0x3f')],_0x1b414f[_0x7f3a('0x49')]));if(_0x10c83d[_0x7f3a('0x3f')][_0x7f3a('0x30')]){_0x2e61dd[_0x7f3a('0x4e')]=_[_0x7f3a('0x4b')](_0x2e61dd[_0x7f3a('0x4e')],{'$or':_['map'](_0x2e61dd[_0x7f3a('0x42')],function(_0x15fdc2){var _0x232a87={};_0x232a87[_0x15fdc2]={'$like':'%'+_0x10c83d[_0x7f3a('0x3f')]['filter']+'%'};return _0x232a87;})});}_0x2e61dd=_[_0x7f3a('0x4b')]({},_0x2e61dd,_0x10c83d[_0x7f3a('0x4d')]);return _0x2108ad[_0x7f3a('0x9a')](_0x2e61dd);}})[_0x7f3a('0x29')](function(_0x15360f){if(_0x15360f){_0x135de6=_0x15360f['length'];if(!_0x10c83d[_0x7f3a('0x3f')][_0x7f3a('0x45')]('nolimit')){_0x2e61dd[_0x7f3a('0x25')]=qs[_0x7f3a('0x25')](_0x10c83d[_0x7f3a('0x3f')]['limit']);_0x2e61dd[_0x7f3a('0x22')]=qs[_0x7f3a('0x22')](_0x10c83d[_0x7f3a('0x3f')][_0x7f3a('0x22')]);}return _0x2108ad[_0x7f3a('0x9a')](_0x2e61dd);}})[_0x7f3a('0x29')](function(_0x23af00){return _0x23af00?{'count':_0x135de6,'rows':_0x23af00}:null;})[_0x7f3a('0x29')](respondWithResult(_0x48acdb,null))['catch'](handleError(_0x48acdb,null));};exports['getLists']=function(_0x1b831f,_0x100fe9,_0x53f6ec){var _0x2b6c4={};var _0x3bce6a={};var _0x1cfd79;var _0x418e91;return db[_0x7f3a('0x3b')][_0x7f3a('0x61')]({'where':{'id':_0x1b831f[_0x7f3a('0x5a')]['id']}})[_0x7f3a('0x29')](handleEntityNotFound(_0x100fe9,null))[_0x7f3a('0x29')](function(_0x3a432d){if(_0x3a432d){_0x1cfd79=_0x3a432d;_0x3bce6a[_0x7f3a('0x3e')]=_['keys'](db[_0x7f3a('0x9b')][_0x7f3a('0x3c')]);_0x3bce6a[_0x7f3a('0x3f')]=_['keys'](_0x1b831f[_0x7f3a('0x3f')]);_0x3bce6a[_0x7f3a('0x49')]=_['intersection'](_0x3bce6a['model'],_0x3bce6a[_0x7f3a('0x3f')]);_0x2b6c4[_0x7f3a('0x42')]=_[_0x7f3a('0x41')](_0x3bce6a['model'],qs[_0x7f3a('0x43')](_0x1b831f[_0x7f3a('0x3f')][_0x7f3a('0x43')]));_0x2b6c4[_0x7f3a('0x42')]=_0x2b6c4[_0x7f3a('0x42')][_0x7f3a('0x44')]?_0x2b6c4[_0x7f3a('0x42')]:_0x3bce6a[_0x7f3a('0x3e')];_0x2b6c4[_0x7f3a('0x47')]=qs[_0x7f3a('0x48')](_0x1b831f[_0x7f3a('0x3f')]['sort']);_0x2b6c4[_0x7f3a('0x4e')]=qs['filters'](_[_0x7f3a('0x4a')](_0x1b831f['query'],_0x3bce6a[_0x7f3a('0x49')]));if(_0x1b831f[_0x7f3a('0x3f')]['filter']){_0x2b6c4[_0x7f3a('0x4e')]=_['merge'](_0x2b6c4[_0x7f3a('0x4e')],{'$or':_[_0x7f3a('0x32')](_0x2b6c4[_0x7f3a('0x42')],function(_0x39c783){var _0x55233d={};_0x55233d[_0x39c783]={'$like':'%'+_0x1b831f[_0x7f3a('0x3f')][_0x7f3a('0x30')]+'%'};return _0x55233d;})});}_0x2b6c4=_[_0x7f3a('0x4b')]({},_0x2b6c4,_0x1b831f[_0x7f3a('0x4d')]);return _0x1cfd79[_0x7f3a('0x9c')](_0x2b6c4);}})[_0x7f3a('0x29')](function(_0xe270c9){if(_0xe270c9){_0x418e91=_0xe270c9[_0x7f3a('0x44')];if(!_0x1b831f['query'][_0x7f3a('0x45')](_0x7f3a('0x46'))){_0x2b6c4[_0x7f3a('0x25')]=qs[_0x7f3a('0x25')](_0x1b831f[_0x7f3a('0x3f')][_0x7f3a('0x25')]);_0x2b6c4[_0x7f3a('0x22')]=qs[_0x7f3a('0x22')](_0x1b831f['query'][_0x7f3a('0x22')]);}return _0x1cfd79['getLists'](_0x2b6c4);}})['then'](function(_0x33d9d8){if(_0x33d9d8){return _0x33d9d8?{'count':_0x418e91,'rows':_0x33d9d8}:null;}})['then'](respondWithResult(_0x100fe9,null))[_0x7f3a('0x51')](handleError(_0x100fe9,null));};exports[_0x7f3a('0x9d')]=function(_0x2523ac,_0x338888,_0x2f0392){var _0x5b6c58=moment()[_0x7f3a('0x7e')]('YYYY-MM-DD\x20HH:mm:ss');var _0x3505fb,_0x156530;return db['VoiceQueue'][_0x7f3a('0x36')]({'where':{'id':_0x2523ac[_0x7f3a('0x5a')]['id']}})[_0x7f3a('0x29')](handleEntityNotFound(_0x338888,null))['then'](function(_0x1ddcf1){if(_0x1ddcf1){_0x156530=_0x1ddcf1;return _0x1ddcf1[_0x7f3a('0x9d')](_0x2523ac[_0x7f3a('0x53')][_0x7f3a('0x81')],_[_0x7f3a('0x5b')](_0x2523ac['body'],['ids','id'])||{});}return null;})[_0x7f3a('0x9e')](function(_0x51a9c6){var _0x1fa713;_0x3505fb=_0x51a9c6||[];var _0x2e1417=[];if(_0x51a9c6){for(var _0x2d3d46=0x0;_0x2d3d46<_0x51a9c6[_0x7f3a('0x44')];_0x2d3d46+=0x1){var _0x486101=_0x51a9c6[_0x2d3d46][_0x7f3a('0x2b')]({'plain':!![]});_0x156530[_0x7f3a('0x9f')]=_0x2523ac[_0x7f3a('0x53')][_0x7f3a('0x9f')]?_0x2523ac['body']['dialCheckDuplicateType']:_0x156530[_0x7f3a('0x9f')];switch(_0x156530[_0x7f3a('0x9f')]){case'always':_0x1fa713=squel['insert']()['into'](_0x7f3a('0xa0'))[_0x7f3a('0xa1')]([_0x7f3a('0xa2'),_0x7f3a('0xa3'),_0x7f3a('0xa4'),_0x7f3a('0xa5'),_0x7f3a('0x63'),_0x7f3a('0x5d'),_0x7f3a('0x5c')],squel['select']()[_0x7f3a('0xa6')](_0x7f3a('0xa2'),_0x7f3a('0xa2'))['field']('\x27'+_0x5b6c58+'\x27',_0x7f3a('0xa3'))[_0x7f3a('0xa6')]('id',_0x7f3a('0xa4'))[_0x7f3a('0xa6')](_0x486101[_0x7f3a('0xa7')]['toString'](),_0x7f3a('0xa5'))[_0x7f3a('0xa6')](_0x2523ac[_0x7f3a('0x5a')]['id'][_0x7f3a('0x8c')](),_0x7f3a('0x63'))[_0x7f3a('0xa6')]('\x27'+_0x5b6c58+'\x27',_0x7f3a('0x5d'))[_0x7f3a('0xa6')]('\x27'+_0x5b6c58+'\x27',_0x7f3a('0x5c'))[_0x7f3a('0x85')](_0x7f3a('0xa8'))[_0x7f3a('0x4e')](_0x7f3a('0xa9'))['where']('ListId\x20=\x20?',_0x486101['CmListId'][_0x7f3a('0x8c')]())['where']('phone\x20IS\x20NOT\x20NULL')['where'](_0x7f3a('0xaa'),squel[_0x7f3a('0x83')]()[_0x7f3a('0xa6')](_0x7f3a('0xab'))[_0x7f3a('0x85')](_0x7f3a('0xac'))[_0x7f3a('0x4e')](_0x7f3a('0xad'),_0x2523ac[_0x7f3a('0x5a')]['id']['toString']()))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x7f3a('0x83')]()[_0x7f3a('0xa6')](_0x7f3a('0xae'))[_0x7f3a('0x85')](_0x7f3a('0xa0'))[_0x7f3a('0x4e')]('VoiceQueueId\x20=\x20?',_0x2523ac[_0x7f3a('0x5a')]['id'][_0x7f3a('0x8c')]())))[_0x7f3a('0x8c')]();break;case _0x7f3a('0xaf'):_0x1fa713=squel[_0x7f3a('0xb0')]()['into']('cm_hopper')[_0x7f3a('0xa1')](['phone','scheduledAt',_0x7f3a('0xa4'),_0x7f3a('0xa5'),'VoiceQueueId',_0x7f3a('0x5d'),_0x7f3a('0x5c')],squel[_0x7f3a('0x83')]()[_0x7f3a('0xa6')](_0x7f3a('0xa2'),_0x7f3a('0xa2'))[_0x7f3a('0xa6')]('\x27'+_0x5b6c58+'\x27',_0x7f3a('0xa3'))['field']('id',_0x7f3a('0xa4'))[_0x7f3a('0xa6')](_0x486101[_0x7f3a('0xa7')][_0x7f3a('0x8c')](),_0x7f3a('0xa5'))[_0x7f3a('0xa6')](_0x2523ac[_0x7f3a('0x5a')]['id'][_0x7f3a('0x8c')](),_0x7f3a('0x63'))[_0x7f3a('0xa6')]('\x27'+_0x5b6c58+'\x27',_0x7f3a('0x5d'))[_0x7f3a('0xa6')]('\x27'+_0x5b6c58+'\x27','updatedAt')['from']('cm_contacts')[_0x7f3a('0x4e')](_0x7f3a('0xa9'))[_0x7f3a('0x4e')](_0x7f3a('0xb1'),_0x486101[_0x7f3a('0xa7')]['toString']())[_0x7f3a('0x4e')](_0x7f3a('0xb2'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x7f3a('0x83')]()[_0x7f3a('0xa6')](_0x7f3a('0xae'))[_0x7f3a('0x85')]('cm_hopper')['where'](_0x7f3a('0xad'),_0x2523ac[_0x7f3a('0x5a')]['id'][_0x7f3a('0x8c')]())))[_0x7f3a('0x8c')]();break;default:_0x1fa713=squel[_0x7f3a('0xb0')]()[_0x7f3a('0xb3')]('cm_hopper')[_0x7f3a('0xa1')]([_0x7f3a('0xa2'),'scheduledAt',_0x7f3a('0xa4'),_0x7f3a('0xa5'),_0x7f3a('0x63'),_0x7f3a('0x5d'),_0x7f3a('0x5c')],squel['select']()[_0x7f3a('0xa6')](_0x7f3a('0xa2'),'phone')[_0x7f3a('0xa6')]('\x27'+_0x5b6c58+'\x27',_0x7f3a('0xa3'))[_0x7f3a('0xa6')]('id',_0x7f3a('0xa4'))[_0x7f3a('0xa6')](_0x486101[_0x7f3a('0xa7')]['toString'](),_0x7f3a('0xa5'))['field'](_0x2523ac[_0x7f3a('0x5a')]['id'][_0x7f3a('0x8c')](),_0x7f3a('0x63'))[_0x7f3a('0xa6')]('\x27'+_0x5b6c58+'\x27','createdAt')[_0x7f3a('0xa6')]('\x27'+_0x5b6c58+'\x27',_0x7f3a('0x5c'))[_0x7f3a('0x85')](_0x7f3a('0xa8'))[_0x7f3a('0x4e')](_0x7f3a('0xa9'))[_0x7f3a('0x4e')]('ListId\x20=\x20?',_0x486101[_0x7f3a('0xa7')]['toString']())[_0x7f3a('0x4e')](_0x7f3a('0xb2')))[_0x7f3a('0x8c')]();}_0x2e1417[_0x7f3a('0x8a')](db[_0x7f3a('0x8b')][_0x7f3a('0x3f')](_0x1fa713));}return BPromise[_0x7f3a('0x96')](_0x2e1417);}})[_0x7f3a('0x29')](function(){var _0x2f4337=[];var _0x404945=squel[_0x7f3a('0xb0')]()['into'](_0x7f3a('0xb4'))[_0x7f3a('0xa1')](['CmHopperId',_0x7f3a('0xa2'),'OrderBy',_0x7f3a('0x5d'),_0x7f3a('0x5c')],squel['select']()[_0x7f3a('0xa6')]('h.id')[_0x7f3a('0xa6')](_0x7f3a('0xb5'))['field'](_0x7f3a('0xb6'))[_0x7f3a('0xa6')]('\x27'+_0x5b6c58+'\x27','createdAt')[_0x7f3a('0xa6')]('\x27'+_0x5b6c58+'\x27',_0x7f3a('0x5c'))[_0x7f3a('0x85')]('cm_contact_has_items','ci')[_0x7f3a('0x87')]('cm_hopper','h',_0x7f3a('0xb7'))[_0x7f3a('0x4e')]('h.scheduledat=?',_0x5b6c58)[_0x7f3a('0x4e')](_0x7f3a('0xb8'),_0x7f3a('0xb9')))[_0x7f3a('0x8c')]();_0x2f4337[_0x7f3a('0x8a')](db['sequelize'][_0x7f3a('0x3f')](_0x404945));return BPromise['all'](_0x2f4337);})['then'](function(){return _0x3505fb;})[_0x7f3a('0x29')](respondWithResult(_0x338888,null))[_0x7f3a('0x51')](handleError(_0x338888,null));};exports[_0x7f3a('0xba')]=function(_0x4d0dd1,_0x4a0280,_0x64e93){return db[_0x7f3a('0x3b')][_0x7f3a('0x36')]({'where':{'id':_0x4d0dd1['params']['id']}})[_0x7f3a('0x29')](handleEntityNotFound(_0x4a0280,null))['then'](function(_0x9bae4a){if(_0x9bae4a){return _0x9bae4a[_0x7f3a('0xba')](_0x4d0dd1[_0x7f3a('0x3f')][_0x7f3a('0x81')]);}})['then'](function(_0x197368){if(_0x197368){return db[_0x7f3a('0x62')]['destroy']({'where':{'ListId':_0x4d0dd1[_0x7f3a('0x3f')][_0x7f3a('0x81')],'VoiceQueueId':_0x4d0dd1['params']['id']}})[_0x7f3a('0x29')](function(){return _0x197368;});}})[_0x7f3a('0x29')](respondWithStatusCode(_0x4a0280,null))[_0x7f3a('0x51')](handleError(_0x4a0280,null));};exports[_0x7f3a('0xbb')]=function(_0x321374,_0x35c390,_0x851990){var _0x1f8667={};var _0x363867={};var _0x3c054c;var _0x18f665;return db[_0x7f3a('0x3b')][_0x7f3a('0x61')]({'where':{'id':_0x321374[_0x7f3a('0x5a')]['id']}})[_0x7f3a('0x29')](handleEntityNotFound(_0x35c390,null))['then'](function(_0x8a1ee2){if(_0x8a1ee2){_0x3c054c=_0x8a1ee2;_0x363867[_0x7f3a('0x3e')]=_[_0x7f3a('0x40')](db[_0x7f3a('0x9b')][_0x7f3a('0x3c')]);_0x363867['query']=_[_0x7f3a('0x40')](_0x321374[_0x7f3a('0x3f')]);_0x363867[_0x7f3a('0x49')]=_[_0x7f3a('0x41')](_0x363867[_0x7f3a('0x3e')],_0x363867[_0x7f3a('0x3f')]);_0x1f8667['attributes']=_['intersection'](_0x363867[_0x7f3a('0x3e')],qs[_0x7f3a('0x43')](_0x321374[_0x7f3a('0x3f')][_0x7f3a('0x43')]));_0x1f8667[_0x7f3a('0x42')]=_0x1f8667['attributes'][_0x7f3a('0x44')]?_0x1f8667[_0x7f3a('0x42')]:_0x363867['model'];_0x1f8667[_0x7f3a('0x47')]=qs['sort'](_0x321374[_0x7f3a('0x3f')][_0x7f3a('0x48')]);_0x1f8667['where']=qs[_0x7f3a('0x49')](_[_0x7f3a('0x4a')](_0x321374[_0x7f3a('0x3f')],_0x363867['filters']));if(_0x321374[_0x7f3a('0x3f')][_0x7f3a('0x30')]){_0x1f8667['where']=_[_0x7f3a('0x4b')](_0x1f8667['where'],{'$or':_[_0x7f3a('0x32')](_0x1f8667['attributes'],function(_0x35d23b){var _0x29cd8e={};_0x29cd8e[_0x35d23b]={'$like':'%'+_0x321374['query'][_0x7f3a('0x30')]+'%'};return _0x29cd8e;})});}_0x1f8667=_[_0x7f3a('0x4b')]({},_0x1f8667,_0x321374[_0x7f3a('0x4d')]);return _0x3c054c[_0x7f3a('0xbb')](_0x1f8667);}})[_0x7f3a('0x29')](function(_0x566431){if(_0x566431){_0x18f665=_0x566431[_0x7f3a('0x44')];if(!_0x321374[_0x7f3a('0x3f')]['hasOwnProperty'](_0x7f3a('0x46'))){_0x1f8667['limit']=qs[_0x7f3a('0x25')](_0x321374[_0x7f3a('0x3f')][_0x7f3a('0x25')]);_0x1f8667['offset']=qs[_0x7f3a('0x22')](_0x321374[_0x7f3a('0x3f')][_0x7f3a('0x22')]);}return _0x3c054c[_0x7f3a('0xbb')](_0x1f8667);}})['then'](function(_0xd39a4f){if(_0xd39a4f){return _0xd39a4f?{'count':_0x18f665,'rows':_0xd39a4f}:null;}})[_0x7f3a('0x29')](respondWithResult(_0x35c390,null))[_0x7f3a('0x51')](handleError(_0x35c390,null));};exports[_0x7f3a('0xbc')]=function(_0x427309,_0x484567,_0x1c52e9){var _0x55f76e,_0x1f89c0;return db[_0x7f3a('0x3b')]['find']({'where':{'id':_0x427309[_0x7f3a('0x5a')]['id']}})[_0x7f3a('0x29')](handleEntityNotFound(_0x484567,null))['then'](function(_0x1cdfe9){if(_0x1cdfe9){_0x1f89c0=_0x1cdfe9;return _0x1cdfe9[_0x7f3a('0xbc')](_0x427309[_0x7f3a('0x53')]['ids'],_[_0x7f3a('0x5b')](_0x427309[_0x7f3a('0x53')],['ids','id'])||{});}return null;})[_0x7f3a('0x9e')](function(_0x14bc29){var _0x3214b1;_0x55f76e=_0x14bc29||[];var _0x221192=[];if(_0x14bc29){for(var _0x2a7703=0x0;_0x2a7703<_0x14bc29['length'];_0x2a7703+=0x1){var _0x18cf29=_0x14bc29[_0x2a7703]['get']({'plain':!![]});_0x3214b1=squel[_0x7f3a('0xb0')]()['into'](_0x7f3a('0xbd'))[_0x7f3a('0xa1')]([_0x7f3a('0xa2'),_0x7f3a('0xa4'),_0x7f3a('0xa5'),_0x7f3a('0x63'),'createdAt',_0x7f3a('0x5c')],squel[_0x7f3a('0x83')]()[_0x7f3a('0xa6')](_0x7f3a('0xa2'),_0x7f3a('0xa2'))[_0x7f3a('0xa6')]('id','ContactId')[_0x7f3a('0xa6')](_0x18cf29[_0x7f3a('0xa7')]['toString'](),'ListId')[_0x7f3a('0xa6')](_0x427309['params']['id']['toString'](),_0x7f3a('0x63'))[_0x7f3a('0xa6')](_0x7f3a('0xbe'),_0x7f3a('0x5d'))[_0x7f3a('0xa6')](_0x7f3a('0xbe'),_0x7f3a('0x5c'))[_0x7f3a('0x85')](_0x7f3a('0xa8'))[_0x7f3a('0x4e')](_0x7f3a('0xa9'))[_0x7f3a('0x4e')](_0x7f3a('0xb1'),_0x18cf29[_0x7f3a('0xa7')][_0x7f3a('0x8c')]())[_0x7f3a('0x4e')]('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x221192[_0x7f3a('0x8a')](db[_0x7f3a('0x8b')][_0x7f3a('0x3f')](_0x3214b1));}return BPromise[_0x7f3a('0x96')](_0x221192);}})[_0x7f3a('0x29')](function(){return _0x55f76e;})[_0x7f3a('0x29')](respondWithResult(_0x484567,null))['catch'](handleError(_0x484567,null));};exports[_0x7f3a('0xbf')]=function(_0x43189c,_0x1ebf54,_0x18191e){return db[_0x7f3a('0x3b')][_0x7f3a('0x36')]({'where':{'id':_0x43189c[_0x7f3a('0x5a')]['id']}})[_0x7f3a('0x29')](handleEntityNotFound(_0x1ebf54,null))['then'](function(_0x3a8647){if(_0x3a8647){return _0x3a8647[_0x7f3a('0xbf')](_0x43189c[_0x7f3a('0x3f')]['ids']);}})[_0x7f3a('0x29')](function(_0x4c2784){if(_0x4c2784){return db[_0x7f3a('0x6b')][_0x7f3a('0x2a')]({'where':{'ListId':_0x43189c[_0x7f3a('0x3f')][_0x7f3a('0x81')],'VoiceQueueId':_0x43189c[_0x7f3a('0x5a')]['id']}})[_0x7f3a('0x29')](function(){return _0x4c2784;});}})[_0x7f3a('0x29')](respondWithStatusCode(_0x1ebf54,null))[_0x7f3a('0x51')](handleError(_0x1ebf54,null));}; \ No newline at end of file +var _0x77d4=['penalty','sequelize','transaction','each','TeamVoiceQueue','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','userVoiceQueue:save','removeTeams','select','tq.TeamId','from','join','user_has_teams','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','SELECT','every','TeamId','all','union','compact','ids','isEmpty','removeAgents','emit','addAgents','spread','online','push','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','addLists','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','ContactId','field','CmListId','toString','ListId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','COALESCE(phone,\x27\x27)','onlyIfOpen','scheduledAt','cm_hopper_additional_phones','CmHopperId','h.id','ci.item','ci.OrderBy+1','cm_contact_has_items','h.ContactId=ci.CmContactId','ci.ItemClass=?','PHONE','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','rimraf','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','./voiceQueue.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','VoiceQueues','QueueCampaigns','outbound','filter','ignore','value','includes','type','find','name','UserProfileResource','stack','send','index','map','VoiceQueue','fieldName','model','query','filters','intersection','fields','length','attributes','nolimit','order','sort','where','pick','merge','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','inbound','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','autoAssociation','error','getHoppers','findOne','hasOwnProperty','CmHopper','getHopperHistories','CmHopperHistory','VoiceQueueId','CmHopperFinal','CmHopperBlack','getTeams','Team','addTeams','teams','User','Agents','voicePause','interface','flatMap'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0x77d4,0x108));var _0x477d=function(_0x342179,_0x40d790){_0x342179=_0x342179-0x0;var _0x54a8d2=_0x77d4[_0x342179];return _0x54a8d2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x477d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x477d('0x1'));var rp=require('request-promise');var moment=require(_0x477d('0x2'));var BPromise=require(_0x477d('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x477d('0x4'));var sox=require(_0x477d('0x5'));var csv=require(_0x477d('0x6'));var ejs=require(_0x477d('0x7'));var fs=require('fs');var fs_extra=require(_0x477d('0x8'));var _=require(_0x477d('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x477d('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x477d('0xb'));var Papa=require(_0x477d('0xc'));var Redis=require(_0x477d('0xd'));var authService=require(_0x477d('0xe'));var qs=require(_0x477d('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x477d('0x10'));var logger=require('../../config/logger')(_0x477d('0x11'));var utils=require(_0x477d('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x477d('0x13'));var db=require(_0x477d('0x14'))['db'];config['redis']=_['defaults'](config[_0x477d('0x15')],{'host':_0x477d('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x477d('0x15')]));require(_0x477d('0x17'))['register'](socket);function respondWithStatusCode(_0x4b2021,_0x38a0a8){_0x38a0a8=_0x38a0a8||0xcc;return function(_0x4bbfef){if(_0x4bbfef){return _0x4b2021[_0x477d('0x18')](_0x38a0a8);}return _0x4b2021[_0x477d('0x19')](_0x38a0a8)[_0x477d('0x1a')]();};}function respondWithResult(_0x5985b5,_0x116aa7){_0x116aa7=_0x116aa7||0xc8;return function(_0x78d1f2){if(_0x78d1f2){return _0x5985b5[_0x477d('0x19')](_0x116aa7)[_0x477d('0x1b')](_0x78d1f2);}};}function respondWithFilteredResult(_0x57b38e,_0x28f17a){return function(_0x5d5553){if(_0x5d5553){var _0x367965=typeof _0x28f17a[_0x477d('0x1c')]===_0x477d('0x1d')&&typeof _0x28f17a[_0x477d('0x1e')]===_0x477d('0x1d');var _0x2145ce=_0x5d5553['count'];var _0x33db7a=_0x367965?0x0:_0x28f17a['offset'];var _0xe934a7=_0x367965?_0x5d5553[_0x477d('0x1f')]:_0x28f17a[_0x477d('0x1c')]+_0x28f17a[_0x477d('0x1e')];var _0x27b3aa;if(_0xe934a7>=_0x2145ce){_0xe934a7=_0x2145ce;_0x27b3aa=0xc8;}else{_0x27b3aa=0xce;}_0x57b38e[_0x477d('0x19')](_0x27b3aa);return _0x57b38e[_0x477d('0x20')](_0x477d('0x21'),_0x33db7a+'-'+_0xe934a7+'/'+_0x2145ce)[_0x477d('0x1b')](_0x5d5553);}return null;};}function patchUpdates(_0x5981a){return function(_0x3d2943){try{jsonpatch[_0x477d('0x22')](_0x3d2943,_0x5981a,!![]);}catch(_0x43c845){return BPromise[_0x477d('0x23')](_0x43c845);}return _0x3d2943['save']();};}function saveUpdates(_0x4481b0,_0x583444){return function(_0x239b56){if(_0x239b56){return _0x239b56[_0x477d('0x24')](_0x4481b0)[_0x477d('0x25')](function(_0x2287b4){return _0x2287b4;});}return null;};}function removeEntity(_0x4bb50e,_0xd6dca5){return function(_0x2dfa90){if(_0x2dfa90){return _0x2dfa90[_0x477d('0x26')]()['then'](function(){var _0x585648=_0x2dfa90[_0x477d('0x27')]({'plain':!![]});var _0x3c6270=[{'name':_0x477d('0x28'),'value':'inbound','ignore':![]},{'name':_0x477d('0x29'),'value':_0x477d('0x2a'),'ignore':![]}];var _0x74ebb4=_(_0x3c6270)[_0x477d('0x2b')](_0x477d('0x2c'))['map'](_0x477d('0x2d'))[_0x477d('0x2d')]();if(_[_0x477d('0x2e')](_0x74ebb4,_0x585648[_0x477d('0x2f')])){return;}var _0x32c5d7=_[_0x477d('0x30')](_0x3c6270,[_0x477d('0x2d'),_0x585648[_0x477d('0x2f')]])[_0x477d('0x31')];return db[_0x477d('0x32')][_0x477d('0x26')]({'where':{'type':_0x32c5d7,'resourceId':_0x585648['id']}})[_0x477d('0x25')](function(){return _0x2dfa90;});})[_0x477d('0x25')](function(){_0x4bb50e[_0x477d('0x19')](0xcc)[_0x477d('0x1a')]();});}};}function handleEntityNotFound(_0x4127c1,_0x9857c2){return function(_0x3a5509){if(!_0x3a5509){_0x4127c1[_0x477d('0x18')](0x194);}return _0x3a5509;};}function handleError(_0x266dbf,_0x49851b){_0x49851b=_0x49851b||0x1f4;return function(_0x304d25){logger['error'](_0x304d25[_0x477d('0x33')]);if(_0x304d25[_0x477d('0x31')]){delete _0x304d25[_0x477d('0x31')];}_0x266dbf['status'](_0x49851b)[_0x477d('0x34')](_0x304d25);};}exports[_0x477d('0x35')]=function(_0x2b2091,_0x3d34e4){var _0x249b82={},_0x463fca={},_0xca8bf={'count':0x0,'rows':[]};var _0xf84c4c=_[_0x477d('0x36')](db[_0x477d('0x37')]['rawAttributes'],function(_0x36a247){return{'name':_0x36a247[_0x477d('0x38')],'type':_0x36a247[_0x477d('0x2f')]['key']};});_0x463fca[_0x477d('0x39')]=_[_0x477d('0x36')](_0xf84c4c,_0x477d('0x31'));_0x463fca['query']=_['keys'](_0x2b2091[_0x477d('0x3a')]);_0x463fca[_0x477d('0x3b')]=_[_0x477d('0x3c')](_0x463fca[_0x477d('0x39')],_0x463fca[_0x477d('0x3a')]);_0x249b82['attributes']=_[_0x477d('0x3c')](_0x463fca['model'],qs[_0x477d('0x3d')](_0x2b2091[_0x477d('0x3a')][_0x477d('0x3d')]));_0x249b82['attributes']=_0x249b82['attributes'][_0x477d('0x3e')]?_0x249b82[_0x477d('0x3f')]:_0x463fca[_0x477d('0x39')];if(!_0x2b2091[_0x477d('0x3a')]['hasOwnProperty'](_0x477d('0x40'))){_0x249b82[_0x477d('0x1e')]=qs[_0x477d('0x1e')](_0x2b2091[_0x477d('0x3a')][_0x477d('0x1e')]);_0x249b82['offset']=qs[_0x477d('0x1c')](_0x2b2091[_0x477d('0x3a')]['offset']);}_0x249b82[_0x477d('0x41')]=qs['sort'](_0x2b2091[_0x477d('0x3a')][_0x477d('0x42')]);_0x249b82[_0x477d('0x43')]=qs[_0x477d('0x3b')](_[_0x477d('0x44')](_0x2b2091[_0x477d('0x3a')],_0x463fca[_0x477d('0x3b')]),_0xf84c4c);if(_0x2b2091[_0x477d('0x3a')][_0x477d('0x2b')]){_0x249b82['where']=_[_0x477d('0x45')](_0x249b82[_0x477d('0x43')],{'$or':_[_0x477d('0x36')](_0xf84c4c,function(_0x432985){if(_0x432985['type']!=='VIRTUAL'){var _0x41397b={};_0x41397b[_0x432985[_0x477d('0x31')]]={'$like':'%'+_0x2b2091['query'][_0x477d('0x2b')]+'%'};return _0x41397b;}})});}_0x249b82=_['merge']({},_0x249b82,_0x2b2091['options']);var _0x983c91={'where':_0x249b82[_0x477d('0x43')]};return db[_0x477d('0x37')][_0x477d('0x1f')](_0x983c91)[_0x477d('0x25')](function(_0x26c463){_0xca8bf['count']=_0x26c463;if(_0x2b2091[_0x477d('0x3a')][_0x477d('0x46')]){_0x249b82[_0x477d('0x47')]=[{'all':!![]}];}return db[_0x477d('0x37')][_0x477d('0x48')](_0x249b82);})['then'](function(_0x4aad41){_0xca8bf[_0x477d('0x49')]=_0x4aad41;return _0xca8bf;})[_0x477d('0x25')](respondWithFilteredResult(_0x3d34e4,_0x249b82))[_0x477d('0x4a')](handleError(_0x3d34e4,null));};exports['show']=function(_0x45a5da,_0xf4685b){var _0x3154da={'raw':![],'where':{'id':_0x45a5da[_0x477d('0x4b')]['id']}},_0x1ad4d1={};_0x1ad4d1[_0x477d('0x39')]=_[_0x477d('0x4c')](db['VoiceQueue'][_0x477d('0x4d')]);_0x1ad4d1[_0x477d('0x3a')]=_[_0x477d('0x4c')](_0x45a5da[_0x477d('0x3a')]);_0x1ad4d1[_0x477d('0x3b')]=_[_0x477d('0x3c')](_0x1ad4d1[_0x477d('0x39')],_0x1ad4d1[_0x477d('0x3a')]);_0x3154da[_0x477d('0x3f')]=_[_0x477d('0x3c')](_0x1ad4d1[_0x477d('0x39')],qs[_0x477d('0x3d')](_0x45a5da[_0x477d('0x3a')][_0x477d('0x3d')]));_0x3154da[_0x477d('0x3f')]=_0x3154da['attributes'][_0x477d('0x3e')]?_0x3154da[_0x477d('0x3f')]:_0x1ad4d1['model'];if(_0x45a5da['query']['includeAll']){_0x3154da[_0x477d('0x47')]=[{'all':!![]}];}_0x3154da=_[_0x477d('0x45')]({},_0x3154da,_0x45a5da[_0x477d('0x4e')]);return db[_0x477d('0x37')][_0x477d('0x30')](_0x3154da)[_0x477d('0x25')](handleEntityNotFound(_0xf4685b,null))[_0x477d('0x25')](respondWithResult(_0xf4685b,null))[_0x477d('0x4a')](handleError(_0xf4685b,null));};exports['create']=function(_0x15dcaf,_0x470d3e){return db[_0x477d('0x37')][_0x477d('0x4f')](_0x15dcaf[_0x477d('0x50')],{})[_0x477d('0x25')](function(_0x22fc49){var _0x20e6b1=_0x15dcaf['user'][_0x477d('0x27')]({'plain':!![]});if(!_0x20e6b1)throw new Error(_0x477d('0x51'));if(_0x20e6b1[_0x477d('0x52')]===_0x477d('0x53')){var _0x45cf6d=_0x22fc49['get']({'plain':!![]});var _0x1c496a=[{'name':_0x477d('0x28'),'value':_0x477d('0x54')},{'name':_0x477d('0x29'),'value':_0x477d('0x2a')}];var _0x54c044=_['find'](_0x1c496a,[_0x477d('0x2d'),_0x45cf6d[_0x477d('0x2f')]])[_0x477d('0x31')];return db[_0x477d('0x55')][_0x477d('0x30')]({'where':{'name':_0x54c044,'userProfileId':_0x20e6b1[_0x477d('0x56')]},'raw':!![]})[_0x477d('0x25')](function(_0x39b961){if(_0x39b961&&_0x39b961['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x45cf6d['name'],'resourceId':_0x45cf6d['id'],'type':_0x39b961['name'],'sectionId':_0x39b961['id']},{})[_0x477d('0x25')](function(){return _0x22fc49;});}else{return _0x22fc49;}})['catch'](function(_0x43c3e5){logger['error'](_0x477d('0x57'),_0x43c3e5);throw _0x43c3e5;});}return _0x22fc49;})[_0x477d('0x25')](respondWithResult(_0x470d3e,0xc9))['catch'](handleError(_0x470d3e,null));};exports[_0x477d('0x58')]=function(_0x4739ac,_0x3d8a12){var _0x851020={'where':{'id':_0x4739ac['params']['id']}},_0x5e5e09={};_0x5e5e09[_0x477d('0x39')]=_[_0x477d('0x4c')](db['VoiceQueue'][_0x477d('0x4d')]);_0x851020[_0x477d('0x3f')]=_[_0x477d('0x3c')](_0x5e5e09[_0x477d('0x39')],qs[_0x477d('0x3d')](_0x4739ac['query']['fields']));_0x851020[_0x477d('0x3f')]=_0x851020[_0x477d('0x3f')]['length']?_0x851020[_0x477d('0x3f')]:_0x5e5e09['model'];if(_0x4739ac['query'][_0x477d('0x46')]){_0x851020[_0x477d('0x47')]=[{'all':!![]}];}_0x851020=_[_0x477d('0x45')]({},_0x851020,_0x4739ac[_0x477d('0x4e')]);return db[_0x477d('0x37')]['find'](_0x851020)['then'](handleEntityNotFound(_0x3d8a12,null))[_0x477d('0x25')](function(_0x23c435){if(_0x23c435){var _0x3510db=_0x23c435[_0x477d('0x27')]({'plain':!![]});_0x3510db=qs[_0x477d('0x59')](_0x3510db,['id',_0x477d('0x5a'),_0x477d('0x5b')]);_0x4739ac[_0x477d('0x50')]=_[_0x477d('0x59')](_0x4739ac['body'],['id','createdAt',_0x477d('0x5b')]);return db['VoiceQueue'][_0x477d('0x4f')](_[_0x477d('0x45')](_0x3510db,_0x4739ac[_0x477d('0x50')]),{'include':_0x4739ac['query'][_0x477d('0x46')]?[{'all':!![]}]:undefined})[_0x477d('0x25')](function(_0x5ec335){var _0x2d1e6d=_0x4739ac[_0x477d('0x53')][_0x477d('0x27')]({'plain':!![]});if(!_0x2d1e6d)throw new Error(_0x477d('0x51'));if(_0x2d1e6d[_0x477d('0x52')]===_0x477d('0x53')){var _0x55f1a9=_0x5ec335[_0x477d('0x27')]({'plain':!![]});var _0x36bfa3=[{'name':_0x477d('0x28'),'value':_0x477d('0x54')},{'name':'QueueCampaigns','value':_0x477d('0x2a')}];var _0x543673=_[_0x477d('0x30')](_0x36bfa3,[_0x477d('0x2d'),_0x55f1a9['type']])[_0x477d('0x31')];return db[_0x477d('0x55')][_0x477d('0x30')]({'where':{'name':_0x543673,'userProfileId':_0x2d1e6d['userProfileId']},'raw':!![]})['then'](function(_0x10654d){if(_0x10654d&&_0x10654d[_0x477d('0x5c')]===0x0){return db[_0x477d('0x32')][_0x477d('0x4f')]({'name':_0x55f1a9['name'],'resourceId':_0x55f1a9['id'],'type':_0x10654d[_0x477d('0x31')],'sectionId':_0x10654d['id']},{})[_0x477d('0x25')](function(){return _0x5ec335;});}else{return _0x5ec335;}})['catch'](function(_0x38e06f){logger[_0x477d('0x5d')](_0x477d('0x57'),_0x38e06f);throw _0x38e06f;});}return _0x5ec335;});}})['then'](respondWithResult(_0x3d8a12,0xc9))[_0x477d('0x4a')](handleError(_0x3d8a12,null));};exports[_0x477d('0x24')]=function(_0x120e0e,_0x5ef582){if(_0x120e0e[_0x477d('0x50')]['id']){delete _0x120e0e[_0x477d('0x50')]['id'];}return db[_0x477d('0x37')][_0x477d('0x30')]({'where':{'id':_0x120e0e[_0x477d('0x4b')]['id']}})[_0x477d('0x25')](handleEntityNotFound(_0x5ef582,null))[_0x477d('0x25')](saveUpdates(_0x120e0e[_0x477d('0x50')],null))[_0x477d('0x25')](respondWithResult(_0x5ef582,null))['catch'](handleError(_0x5ef582,null));};exports['destroy']=function(_0x3d7f61,_0x48cb39){return db[_0x477d('0x37')]['find']({'where':{'id':_0x3d7f61[_0x477d('0x4b')]['id']}})['then'](handleEntityNotFound(_0x48cb39,null))[_0x477d('0x25')](removeEntity(_0x48cb39,null))[_0x477d('0x4a')](handleError(_0x48cb39,null));};exports[_0x477d('0x5e')]=function(_0x239a3d,_0x5c8fd8,_0x5e9459){var _0x5cd5c4={'raw':![],'where':{}};var _0x54924b={};var _0x4928f8={'count':0x0,'rows':[]};return db[_0x477d('0x37')][_0x477d('0x5f')]({'where':{'id':_0x239a3d[_0x477d('0x4b')]['id']}})[_0x477d('0x25')](handleEntityNotFound(_0x5c8fd8,null))[_0x477d('0x25')](function(_0x1a09f8){if(_0x1a09f8){_0x54924b['model']=_[_0x477d('0x4c')](db['CmHopper']['rawAttributes']);_0x54924b[_0x477d('0x3a')]=_[_0x477d('0x4c')](_0x239a3d[_0x477d('0x3a')]);_0x54924b[_0x477d('0x3b')]=_[_0x477d('0x3c')](_0x54924b[_0x477d('0x39')],_0x54924b['query']);_0x5cd5c4['attributes']=_[_0x477d('0x3c')](_0x54924b[_0x477d('0x39')],qs[_0x477d('0x3d')](_0x239a3d['query']['fields']));_0x5cd5c4[_0x477d('0x3f')]=_0x5cd5c4[_0x477d('0x3f')][_0x477d('0x3e')]?_0x5cd5c4[_0x477d('0x3f')]:_0x54924b[_0x477d('0x39')];if(!_0x239a3d[_0x477d('0x3a')][_0x477d('0x60')](_0x477d('0x40'))){_0x5cd5c4[_0x477d('0x1e')]=qs['limit'](_0x239a3d[_0x477d('0x3a')][_0x477d('0x1e')]);_0x5cd5c4['offset']=qs[_0x477d('0x1c')](_0x239a3d[_0x477d('0x3a')][_0x477d('0x1c')]);}_0x5cd5c4[_0x477d('0x41')]=qs[_0x477d('0x42')](_0x239a3d['query'][_0x477d('0x42')]);_0x5cd5c4['where']=qs[_0x477d('0x3b')](_[_0x477d('0x44')](_0x239a3d['query'],_0x54924b[_0x477d('0x3b')]));_0x5cd5c4[_0x477d('0x43')]['VoiceQueueId']=_0x1a09f8['id'];if(_0x239a3d[_0x477d('0x3a')][_0x477d('0x2b')]){_0x5cd5c4['where']=_[_0x477d('0x45')](_0x5cd5c4[_0x477d('0x43')],{'$or':_[_0x477d('0x36')](_0x5cd5c4[_0x477d('0x3f')],function(_0x1cc5e1){var _0x231db4={};_0x231db4[_0x1cc5e1]={'$like':'%'+_0x239a3d[_0x477d('0x3a')][_0x477d('0x2b')]+'%'};return _0x231db4;})});}_0x5cd5c4=_[_0x477d('0x45')]({},_0x5cd5c4,_0x239a3d[_0x477d('0x4e')]);return db[_0x477d('0x61')][_0x477d('0x1f')]({'where':_0x5cd5c4[_0x477d('0x43')]})[_0x477d('0x25')](function(_0x1fb4cc){_0x4928f8['count']=_0x1fb4cc;if(_0x239a3d[_0x477d('0x3a')]['includeAll']){_0x5cd5c4['include']=[{'all':!![]}];}return db[_0x477d('0x61')][_0x477d('0x48')](_0x5cd5c4);})['then'](function(_0x210c4d){_0x4928f8[_0x477d('0x49')]=_0x210c4d;return _0x4928f8;});}})[_0x477d('0x25')](respondWithFilteredResult(_0x5c8fd8,_0x5cd5c4))[_0x477d('0x4a')](handleError(_0x5c8fd8,null));};exports[_0x477d('0x62')]=function(_0x1a4d12,_0x1731ff,_0x4b23d9){var _0x19e391={'raw':!![],'where':{}};var _0x3d1808={};var _0x5ae446={'count':0x0,'rows':[]};return db[_0x477d('0x37')][_0x477d('0x5f')]({'where':{'id':_0x1a4d12[_0x477d('0x4b')]['id']}})[_0x477d('0x25')](handleEntityNotFound(_0x1731ff,null))[_0x477d('0x25')](function(_0x135a69){if(_0x135a69){_0x3d1808[_0x477d('0x39')]=_[_0x477d('0x4c')](db[_0x477d('0x63')][_0x477d('0x4d')]);_0x3d1808[_0x477d('0x3a')]=_[_0x477d('0x4c')](_0x1a4d12[_0x477d('0x3a')]);_0x3d1808[_0x477d('0x3b')]=_[_0x477d('0x3c')](_0x3d1808[_0x477d('0x39')],_0x3d1808['query']);_0x19e391['attributes']=_[_0x477d('0x3c')](_0x3d1808['model'],qs['fields'](_0x1a4d12['query'][_0x477d('0x3d')]));_0x19e391[_0x477d('0x3f')]=_0x19e391['attributes'][_0x477d('0x3e')]?_0x19e391[_0x477d('0x3f')]:_0x3d1808[_0x477d('0x39')];if(!_0x1a4d12[_0x477d('0x3a')][_0x477d('0x60')]('nolimit')){_0x19e391['limit']=qs[_0x477d('0x1e')](_0x1a4d12[_0x477d('0x3a')][_0x477d('0x1e')]);_0x19e391[_0x477d('0x1c')]=qs[_0x477d('0x1c')](_0x1a4d12['query']['offset']);}_0x19e391['order']=qs[_0x477d('0x42')](_0x1a4d12[_0x477d('0x3a')]['sort']);_0x19e391[_0x477d('0x43')]=qs[_0x477d('0x3b')](_[_0x477d('0x44')](_0x1a4d12[_0x477d('0x3a')],_0x3d1808[_0x477d('0x3b')]));_0x19e391[_0x477d('0x43')][_0x477d('0x64')]=_0x135a69['id'];if(_0x1a4d12['query'][_0x477d('0x2b')]){_0x19e391['where']=_[_0x477d('0x45')](_0x19e391[_0x477d('0x43')],{'$or':_[_0x477d('0x36')](_0x19e391[_0x477d('0x3f')],function(_0x26658d){var _0x266f99={};_0x266f99[_0x26658d]={'$like':'%'+_0x1a4d12[_0x477d('0x3a')]['filter']+'%'};return _0x266f99;})});}_0x19e391=_[_0x477d('0x45')]({},_0x19e391,_0x1a4d12[_0x477d('0x4e')]);return db[_0x477d('0x63')][_0x477d('0x1f')]({'where':_0x19e391['where']})[_0x477d('0x25')](function(_0x56db60){_0x5ae446[_0x477d('0x1f')]=_0x56db60;if(_0x1a4d12[_0x477d('0x3a')][_0x477d('0x46')]){_0x19e391[_0x477d('0x47')]=[{'all':!![]}];}return db[_0x477d('0x63')]['findAll'](_0x19e391);})[_0x477d('0x25')](function(_0x5044c3){_0x5ae446[_0x477d('0x49')]=_0x5044c3;return _0x5ae446;});}})[_0x477d('0x25')](respondWithFilteredResult(_0x1731ff,_0x19e391))[_0x477d('0x4a')](handleError(_0x1731ff,null));};exports['getHopperFinals']=function(_0x40112e,_0x2c7a72,_0x3e70c7){var _0x71cbd5={'raw':!![],'where':{}};var _0x12acd2={};var _0x30ed3a={'count':0x0,'rows':[]};return db[_0x477d('0x37')][_0x477d('0x5f')]({'where':{'id':_0x40112e[_0x477d('0x4b')]['id']}})[_0x477d('0x25')](handleEntityNotFound(_0x2c7a72,null))[_0x477d('0x25')](function(_0x104d8b){if(_0x104d8b){_0x12acd2['model']=_['keys'](db[_0x477d('0x65')][_0x477d('0x4d')]);_0x12acd2[_0x477d('0x3a')]=_['keys'](_0x40112e['query']);_0x12acd2['filters']=_['intersection'](_0x12acd2[_0x477d('0x39')],_0x12acd2[_0x477d('0x3a')]);_0x71cbd5[_0x477d('0x3f')]=_[_0x477d('0x3c')](_0x12acd2[_0x477d('0x39')],qs['fields'](_0x40112e[_0x477d('0x3a')][_0x477d('0x3d')]));_0x71cbd5[_0x477d('0x3f')]=_0x71cbd5[_0x477d('0x3f')][_0x477d('0x3e')]?_0x71cbd5[_0x477d('0x3f')]:_0x12acd2['model'];if(!_0x40112e[_0x477d('0x3a')][_0x477d('0x60')](_0x477d('0x40'))){_0x71cbd5['limit']=qs[_0x477d('0x1e')](_0x40112e[_0x477d('0x3a')][_0x477d('0x1e')]);_0x71cbd5[_0x477d('0x1c')]=qs[_0x477d('0x1c')](_0x40112e['query'][_0x477d('0x1c')]);}_0x71cbd5[_0x477d('0x41')]=qs['sort'](_0x40112e[_0x477d('0x3a')][_0x477d('0x42')]);_0x71cbd5[_0x477d('0x43')]=qs[_0x477d('0x3b')](_['pick'](_0x40112e[_0x477d('0x3a')],_0x12acd2['filters']));_0x71cbd5['where'][_0x477d('0x64')]=_0x104d8b['id'];if(_0x40112e[_0x477d('0x3a')]['filter']){_0x71cbd5['where']=_['merge'](_0x71cbd5[_0x477d('0x43')],{'$or':_[_0x477d('0x36')](_0x71cbd5[_0x477d('0x3f')],function(_0x3ebe19){var _0x57a4cd={};_0x57a4cd[_0x3ebe19]={'$like':'%'+_0x40112e['query'][_0x477d('0x2b')]+'%'};return _0x57a4cd;})});}_0x71cbd5=_[_0x477d('0x45')]({},_0x71cbd5,_0x40112e[_0x477d('0x4e')]);return db[_0x477d('0x65')][_0x477d('0x1f')]({'where':_0x71cbd5['where']})[_0x477d('0x25')](function(_0x458fa5){_0x30ed3a['count']=_0x458fa5;if(_0x40112e['query']['includeAll']){_0x71cbd5[_0x477d('0x47')]=[{'all':!![]}];}return db[_0x477d('0x65')][_0x477d('0x48')](_0x71cbd5);})[_0x477d('0x25')](function(_0x44c2fa){_0x30ed3a[_0x477d('0x49')]=_0x44c2fa;return _0x30ed3a;});}})[_0x477d('0x25')](respondWithFilteredResult(_0x2c7a72,_0x71cbd5))[_0x477d('0x4a')](handleError(_0x2c7a72,null));};exports['getHopperBlacks']=function(_0x40495c,_0x137160,_0x59052e){var _0x451e18={'raw':!![],'where':{}};var _0x1e6db7={};var _0x1ac227={'count':0x0,'rows':[]};return db[_0x477d('0x37')][_0x477d('0x5f')]({'where':{'id':_0x40495c[_0x477d('0x4b')]['id']}})[_0x477d('0x25')](handleEntityNotFound(_0x137160,null))[_0x477d('0x25')](function(_0x1821b1){if(_0x1821b1){_0x1e6db7[_0x477d('0x39')]=_['keys'](db['CmHopperBlack']['rawAttributes']);_0x1e6db7[_0x477d('0x3a')]=_[_0x477d('0x4c')](_0x40495c[_0x477d('0x3a')]);_0x1e6db7[_0x477d('0x3b')]=_[_0x477d('0x3c')](_0x1e6db7[_0x477d('0x39')],_0x1e6db7['query']);_0x451e18[_0x477d('0x3f')]=_['intersection'](_0x1e6db7[_0x477d('0x39')],qs[_0x477d('0x3d')](_0x40495c[_0x477d('0x3a')]['fields']));_0x451e18[_0x477d('0x3f')]=_0x451e18['attributes']['length']?_0x451e18['attributes']:_0x1e6db7['model'];if(!_0x40495c['query'][_0x477d('0x60')]('nolimit')){_0x451e18[_0x477d('0x1e')]=qs['limit'](_0x40495c[_0x477d('0x3a')]['limit']);_0x451e18[_0x477d('0x1c')]=qs[_0x477d('0x1c')](_0x40495c['query'][_0x477d('0x1c')]);}_0x451e18[_0x477d('0x41')]=qs[_0x477d('0x42')](_0x40495c[_0x477d('0x3a')]['sort']);_0x451e18[_0x477d('0x43')]=qs[_0x477d('0x3b')](_['pick'](_0x40495c[_0x477d('0x3a')],_0x1e6db7[_0x477d('0x3b')]));_0x451e18[_0x477d('0x43')][_0x477d('0x64')]=_0x1821b1['id'];if(_0x40495c[_0x477d('0x3a')][_0x477d('0x2b')]){_0x451e18[_0x477d('0x43')]=_[_0x477d('0x45')](_0x451e18[_0x477d('0x43')],{'$or':_[_0x477d('0x36')](_0x451e18[_0x477d('0x3f')],function(_0x42271d){var _0x2cbcc5={};_0x2cbcc5[_0x42271d]={'$like':'%'+_0x40495c[_0x477d('0x3a')][_0x477d('0x2b')]+'%'};return _0x2cbcc5;})});}_0x451e18=_[_0x477d('0x45')]({},_0x451e18,_0x40495c[_0x477d('0x4e')]);return db[_0x477d('0x66')][_0x477d('0x1f')]({'where':_0x451e18['where']})['then'](function(_0x45b405){_0x1ac227[_0x477d('0x1f')]=_0x45b405;if(_0x40495c[_0x477d('0x3a')]['includeAll']){_0x451e18['include']=[{'all':!![]}];}return db[_0x477d('0x66')][_0x477d('0x48')](_0x451e18);})['then'](function(_0x561c87){_0x1ac227[_0x477d('0x49')]=_0x561c87;return _0x1ac227;});}})[_0x477d('0x25')](respondWithFilteredResult(_0x137160,_0x451e18))[_0x477d('0x4a')](handleError(_0x137160,null));};exports[_0x477d('0x67')]=function(_0xb2a31,_0x3498ca,_0xa999e0){var _0x13967e={};var _0x3140d1={};var _0x492ac7;var _0x877a51;return db[_0x477d('0x37')][_0x477d('0x5f')]({'where':{'id':_0xb2a31[_0x477d('0x4b')]['id']}})[_0x477d('0x25')](handleEntityNotFound(_0x3498ca,null))['then'](function(_0x15e155){if(_0x15e155){_0x492ac7=_0x15e155;_0x3140d1[_0x477d('0x39')]=_[_0x477d('0x4c')](db[_0x477d('0x68')]['rawAttributes']);_0x3140d1[_0x477d('0x3a')]=_[_0x477d('0x4c')](_0xb2a31['query']);_0x3140d1[_0x477d('0x3b')]=_['intersection'](_0x3140d1['model'],_0x3140d1['query']);_0x13967e['attributes']=_['intersection'](_0x3140d1[_0x477d('0x39')],qs['fields'](_0xb2a31[_0x477d('0x3a')][_0x477d('0x3d')]));_0x13967e[_0x477d('0x3f')]=_0x13967e[_0x477d('0x3f')][_0x477d('0x3e')]?_0x13967e['attributes']:_0x3140d1[_0x477d('0x39')];_0x13967e[_0x477d('0x41')]=qs[_0x477d('0x42')](_0xb2a31[_0x477d('0x3a')][_0x477d('0x42')]);_0x13967e[_0x477d('0x43')]=qs[_0x477d('0x3b')](_[_0x477d('0x44')](_0xb2a31[_0x477d('0x3a')],_0x3140d1[_0x477d('0x3b')]));if(_0xb2a31['query'][_0x477d('0x2b')]){_0x13967e[_0x477d('0x43')]=_[_0x477d('0x45')](_0x13967e[_0x477d('0x43')],{'$or':_[_0x477d('0x36')](_0x13967e[_0x477d('0x3f')],function(_0x49e480){var _0x4b3974={};_0x4b3974[_0x49e480]={'$like':'%'+_0xb2a31[_0x477d('0x3a')]['filter']+'%'};return _0x4b3974;})});}_0x13967e=_[_0x477d('0x45')]({},_0x13967e,_0xb2a31[_0x477d('0x4e')]);return _0x492ac7['getTeams'](_0x13967e);}})[_0x477d('0x25')](function(_0xb492a7){if(_0xb492a7){_0x877a51=_0xb492a7[_0x477d('0x3e')];if(!_0xb2a31['query'][_0x477d('0x60')](_0x477d('0x40'))){_0x13967e[_0x477d('0x1e')]=qs[_0x477d('0x1e')](_0xb2a31[_0x477d('0x3a')][_0x477d('0x1e')]);_0x13967e[_0x477d('0x1c')]=qs[_0x477d('0x1c')](_0xb2a31[_0x477d('0x3a')]['offset']);}return _0x492ac7[_0x477d('0x67')](_0x13967e);}})['then'](function(_0x45af5a){if(_0x45af5a){return _0x45af5a?{'count':_0x877a51,'rows':_0x45af5a}:null;}})[_0x477d('0x25')](respondWithResult(_0x3498ca,null))[_0x477d('0x4a')](handleError(_0x3498ca,null));};exports[_0x477d('0x69')]=function(_0x4996e6,_0x2fba34,_0x361807){var _0x513519=_0x4996e6[_0x477d('0x50')][_0x477d('0x6a')];var _0x377b3f=_[_0x477d('0x36')](_0x513519,'id');return db[_0x477d('0x68')][_0x477d('0x48')]({'where':{'id':_0x377b3f},'attributes':['id'],'include':[{'model':db[_0x477d('0x6b')],'as':_0x477d('0x6c'),'attributes':['id',_0x477d('0x31'),'online',_0x477d('0x6d'),_0x477d('0x6e')],'raw':!![]}]})[_0x477d('0x25')](function(_0x20281a){if(_0x20281a){var _0xd9fe10=_[_0x477d('0x6f')](_0x20281a,function(_0x44928b){var _0xe309bd=_0x44928b['get']({'plain':!![]});_0xe309bd[_0x477d('0x6c')]['forEach'](function(_0xc1d4bd){_0xc1d4bd[_0x477d('0x70')]=_[_0x477d('0x30')](_0x513519,{'id':_0xe309bd['id']})['penalty'];});return _0xe309bd['Agents'];});return db['VoiceQueue'][_0x477d('0x30')]({'where':{'id':_0x4996e6[_0x477d('0x4b')]['id']}})['then'](function(_0x320666){return db[_0x477d('0x71')][_0x477d('0x72')](function(_0x374539){return _0x320666['addTeams'](_0x377b3f,{'transaction':_0x374539})[_0x477d('0x25')](function(){return BPromise[_0x477d('0x73')](_0x513519,function(_0x36b530){return db[_0x477d('0x74')]['upsert']({'TeamId':_0x36b530['id'],'VoiceQueueId':_0x4996e6[_0x477d('0x4b')]['id'],'penalty':_0x36b530[_0x477d('0x70')]},{'transaction':_0x374539});});})['then'](function(){return BPromise[_0x477d('0x73')](_0xd9fe10,function(_0x21788f){return db['UserVoiceQueue']['findOrCreate']({'where':{'UserId':_0x21788f['id'],'VoiceQueueId':_0x4996e6[_0x477d('0x4b')]['id']},'defaults':{'penalty':_0x21788f['penalty']},'transaction':_0x374539});});})['then'](function(){return BPromise['each'](_[_0x477d('0x2b')](_0xd9fe10,{'online':!![]}),function(_0x77d5af){return db[_0x477d('0x75')][_0x477d('0x76')]({'membername':_0x77d5af['name'],'UserId':_0x77d5af['id'],'queue_name':_0x320666[_0x477d('0x31')],'VoiceQueueId':_0x320666['id'],'interface':_[_0x477d('0x77')](_0x77d5af[_0x477d('0x6e')])?util[_0x477d('0x78')](_0x477d('0x79'),_0x77d5af['name']):_0x77d5af[_0x477d('0x6e')],'paused':_0x77d5af[_0x477d('0x6d')]||![],'penalty':_0x77d5af[_0x477d('0x70')]},{'transaction':_0x374539});});})['then'](function(){_0xd9fe10['forEach'](function(_0x50cb27){socket['emit'](_0x477d('0x7a'),{'UserId':_0x50cb27['id'],'VoiceQueueId':_0x320666['id']});});});});});}})[_0x477d('0x25')](respondWithStatusCode(_0x2fba34,null))[_0x477d('0x4a')](handleError(_0x2fba34,null));};exports[_0x477d('0x7b')]=function(_0x28cd00,_0x41bbd3,_0x79ab31){return db[_0x477d('0x68')][_0x477d('0x48')]({'where':{'id':_0x28cd00[_0x477d('0x3a')]['ids']},'attributes':['id'],'include':[{'model':db[_0x477d('0x6b')],'as':_0x477d('0x6c'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x41bbd3,null))['then'](function(_0x1e4f03){var _0x280860=_['map'](_0x1e4f03,'id');var _0xead4a9=[];var _0x4f1512=[];var _0x12487e=squel[_0x477d('0x7c')]();_0x12487e['field'](_0x477d('0x7d'))[_0x477d('0x7e')]('team_has_voice_queues','tq')[_0x477d('0x7f')](_0x477d('0x80'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x477d('0x81'),_0x28cd00[_0x477d('0x4b')]['id']);for(var _0x196ef2=0x0;_0x196ef2<_0x1e4f03[_0x477d('0x3e')];_0x196ef2+=0x1){let _0x3b9d27=_0x1e4f03[_0x196ef2];for(var _0x524c15=0x0;_0x524c15<_0x3b9d27[_0x477d('0x6c')]['length'];_0x524c15+=0x1){let _0xb4000c=_0x3b9d27[_0x477d('0x6c')][_0x524c15];var _0xd4aed2=_0x12487e[_0x477d('0x58')]();_0xd4aed2[_0x477d('0x43')](_0x477d('0x82'),_0xb4000c['id']);_0x4f1512['push'](db[_0x477d('0x71')][_0x477d('0x3a')](_0xd4aed2['toString'](),{'type':db['sequelize']['QueryTypes'][_0x477d('0x83')]})['then'](function(_0x770f1e){if(_0x770f1e[_0x477d('0x3e')]===0x1){return _0xb4000c['id'];}else{var _0x17d484=_[_0x477d('0x84')](_[_0x477d('0x36')](_0x770f1e,_0x477d('0x85')),function(_0x3bb6ce){return _[_0x477d('0x2e')](_0x280860,_0x3bb6ce);});if(_0x17d484){return _0xb4000c['id'];}}}));}}return BPromise[_0x477d('0x86')](_0x4f1512)['then'](function(_0x41baa1){_0xead4a9=_(_0xead4a9)[_0x477d('0x87')](_0x41baa1)[_0x477d('0x88')]()[_0x477d('0x2d')]();return db[_0x477d('0x37')]['find']({'where':{'id':_0x28cd00[_0x477d('0x4b')]['id']}})[_0x477d('0x25')](function(_0x119513){return db[_0x477d('0x71')][_0x477d('0x72')](function(_0x24bb45){return _0x119513[_0x477d('0x7b')](_0x28cd00['query'][_0x477d('0x89')],{'transaction':_0x24bb45})[_0x477d('0x25')](function(){if(!_[_0x477d('0x8a')](_0xead4a9)){return _0x119513[_0x477d('0x8b')](_0xead4a9,{'transaction':_0x24bb45})[_0x477d('0x25')](function(){return db[_0x477d('0x75')][_0x477d('0x26')]({'where':{'VoiceQueueId':_0x28cd00['params']['id'],'UserId':_0xead4a9},'transaction':_0x24bb45});});}})[_0x477d('0x25')](function(){_0xead4a9['forEach'](function(_0x2aee43){socket[_0x477d('0x8c')]('userVoiceQueue:remove',{'UserId':_0x2aee43,'VoiceQueueId':_0x119513['id']});});});});});});})[_0x477d('0x25')](respondWithStatusCode(_0x41bbd3,null))[_0x477d('0x4a')](handleError(_0x41bbd3,null));};exports[_0x477d('0x8d')]=function(_0x109a13,_0x2fe95b,_0x2ccd9a){var _0x12d53f,_0x5257ce;return db[_0x477d('0x37')][_0x477d('0x30')]({'where':{'id':_0x109a13[_0x477d('0x4b')]['id']}})[_0x477d('0x25')](handleEntityNotFound(_0x2fe95b,null))[_0x477d('0x25')](function(_0x166181){if(_0x166181){_0x5257ce=_0x166181;return _0x166181['addAgents'](_0x109a13[_0x477d('0x50')][_0x477d('0x89')],_[_0x477d('0x59')](_0x109a13['body'],[_0x477d('0x89'),'id'])||{})[_0x477d('0x8e')](function(_0x3474da){for(var _0x4e0c9c=0x0;_0x4e0c9c<_0x109a13['body'][_0x477d('0x89')]['length'];_0x4e0c9c+=0x1){socket['emit'](_0x477d('0x7a'),{'UserId':Number(_0x109a13[_0x477d('0x50')][_0x477d('0x89')][_0x4e0c9c]),'VoiceQueueId':Number(_0x109a13[_0x477d('0x4b')]['id'])});}return _0x3474da;});}})[_0x477d('0x25')](function(_0x3563c6){_0x12d53f=_0x3563c6||[];if(_0x5257ce){return db['User'][_0x477d('0x48')]({'where':{'id':_0x109a13[_0x477d('0x50')][_0x477d('0x89')]},'attributes':['id',_0x477d('0x31'),_0x477d('0x8f'),_0x477d('0x6d'),_0x477d('0x6e')],'raw':!![]});}})['then'](function(_0x1512ae){if(!_[_0x477d('0x8a')](_0x1512ae)){var _0x26402a=[];for(var _0x3edbf8=0x0;_0x3edbf8<_0x1512ae['length'];_0x3edbf8++){if(_0x1512ae[_0x3edbf8][_0x477d('0x8f')]){_0x26402a[_0x477d('0x90')](db[_0x477d('0x75')][_0x477d('0x76')]({'membername':_0x1512ae[_0x3edbf8]['name'],'UserId':_0x1512ae[_0x3edbf8]['id'],'queue_name':_0x5257ce[_0x477d('0x31')],'VoiceQueueId':_0x5257ce['id'],'interface':_[_0x477d('0x77')](_0x1512ae[_0x3edbf8][_0x477d('0x6e')])?util['format'](_0x477d('0x79'),_0x1512ae[_0x3edbf8][_0x477d('0x31')]):_0x1512ae[_0x3edbf8][_0x477d('0x6e')],'paused':_0x1512ae[_0x3edbf8][_0x477d('0x6d')]||![],'penalty':_0x109a13[_0x477d('0x50')][_0x477d('0x70')]||0x0}));}}return BPromise['all'](_0x26402a);}})['then'](function(){return _0x12d53f;})[_0x477d('0x25')](respondWithResult(_0x2fe95b,null))[_0x477d('0x4a')](handleError(_0x2fe95b,null));};exports[_0x477d('0x8b')]=function(_0x3f61f5,_0x478c2d,_0x1f012b){return db['VoiceQueue'][_0x477d('0x30')]({'where':{'id':_0x3f61f5[_0x477d('0x4b')]['id']}})[_0x477d('0x25')](handleEntityNotFound(_0x478c2d,null))[_0x477d('0x25')](function(_0x368930){if(_0x368930){return _0x368930['removeAgents'](_0x3f61f5[_0x477d('0x3a')][_0x477d('0x89')])[_0x477d('0x25')](function(){if(_[_0x477d('0x91')](_0x3f61f5[_0x477d('0x3a')]['ids'])){for(var _0xfe8776=0x0;_0xfe8776<_0x3f61f5[_0x477d('0x3a')][_0x477d('0x89')]['length'];_0xfe8776+=0x1){socket[_0x477d('0x8c')](_0x477d('0x92'),{'UserId':Number(_0x3f61f5[_0x477d('0x3a')][_0x477d('0x89')][_0xfe8776]),'VoiceQueueId':Number(_0x3f61f5['params']['id'])});}}else{socket[_0x477d('0x8c')](_0x477d('0x92'),{'UserId':Number(_0x3f61f5[_0x477d('0x3a')][_0x477d('0x89')]),'VoiceQueueId':Number(_0x3f61f5['params']['id'])});}});}})[_0x477d('0x25')](function(_0x4933ae){return db[_0x477d('0x75')]['destroy']({'where':{'VoiceQueueId':_0x3f61f5[_0x477d('0x4b')]['id'],'UserId':_0x3f61f5[_0x477d('0x3a')][_0x477d('0x89')]}})['then'](function(){return _0x4933ae;});})[_0x477d('0x25')](respondWithStatusCode(_0x478c2d,null))[_0x477d('0x4a')](handleError(_0x478c2d,null));};exports[_0x477d('0x93')]=function(_0xa63cba,_0x15f9ff,_0x1b24c6){var _0x542c21={};var _0x1c2b62={};var _0x3f07d3;var _0x438124;return db[_0x477d('0x37')][_0x477d('0x5f')]({'where':{'id':_0xa63cba[_0x477d('0x4b')]['id']}})[_0x477d('0x25')](handleEntityNotFound(_0x15f9ff,null))['then'](function(_0x375867){if(_0x375867){_0x3f07d3=_0x375867;_0x1c2b62[_0x477d('0x39')]=_[_0x477d('0x4c')](db[_0x477d('0x6b')][_0x477d('0x4d')]);_0x1c2b62[_0x477d('0x3a')]=_[_0x477d('0x4c')](_0xa63cba[_0x477d('0x3a')]);_0x1c2b62[_0x477d('0x3b')]=_[_0x477d('0x3c')](_0x1c2b62[_0x477d('0x39')],_0x1c2b62[_0x477d('0x3a')]);_0x542c21[_0x477d('0x3f')]=_[_0x477d('0x3c')](_0x1c2b62[_0x477d('0x39')],qs[_0x477d('0x3d')](_0xa63cba[_0x477d('0x3a')]['fields']));_0x542c21['attributes']=_0x542c21[_0x477d('0x3f')]['length']?_0x542c21[_0x477d('0x3f')]:_0x1c2b62['model'];_0x542c21[_0x477d('0x41')]=qs['sort'](_0xa63cba[_0x477d('0x3a')][_0x477d('0x42')]);_0x542c21['where']=qs[_0x477d('0x3b')](_[_0x477d('0x44')](_0xa63cba[_0x477d('0x3a')],_0x1c2b62[_0x477d('0x3b')]));if(_0xa63cba[_0x477d('0x3a')]['filter']){_0x542c21[_0x477d('0x43')]=_[_0x477d('0x45')](_0x542c21['where'],{'$or':_['map'](_0x542c21[_0x477d('0x3f')],function(_0x581bd1){var _0x96b0da={};_0x96b0da[_0x581bd1]={'$like':'%'+_0xa63cba[_0x477d('0x3a')]['filter']+'%'};return _0x96b0da;})});}_0x542c21=_['merge']({},_0x542c21,_0xa63cba['options']);return _0x3f07d3[_0x477d('0x93')](_0x542c21);}})['then'](function(_0x341307){if(_0x341307){_0x438124=_0x341307[_0x477d('0x3e')];if(!_0xa63cba[_0x477d('0x3a')][_0x477d('0x60')](_0x477d('0x40'))){_0x542c21['limit']=qs[_0x477d('0x1e')](_0xa63cba['query'][_0x477d('0x1e')]);_0x542c21[_0x477d('0x1c')]=qs[_0x477d('0x1c')](_0xa63cba['query'][_0x477d('0x1c')]);}return _0x3f07d3[_0x477d('0x93')](_0x542c21);}})[_0x477d('0x25')](function(_0x534aad){if(_0x534aad){return _0x534aad?{'count':_0x438124,'rows':_0x534aad}:null;}})['then'](respondWithResult(_0x15f9ff,null))[_0x477d('0x4a')](handleError(_0x15f9ff,null));};exports['getMembers']=function(_0x3da01d,_0x17b2e2,_0x579e75){var _0x109acb={};var _0x4dc91e={};var _0x1ea699;var _0x517536;return db[_0x477d('0x37')][_0x477d('0x5f')]({'where':{'id':_0x3da01d[_0x477d('0x4b')]['id']}})[_0x477d('0x25')](handleEntityNotFound(_0x17b2e2,null))[_0x477d('0x25')](function(_0x4a3632){if(_0x4a3632){_0x1ea699=_0x4a3632;_0x4dc91e[_0x477d('0x39')]=_[_0x477d('0x4c')](db[_0x477d('0x75')][_0x477d('0x4d')]);_0x4dc91e[_0x477d('0x3a')]=_[_0x477d('0x4c')](_0x3da01d['query']);_0x4dc91e[_0x477d('0x3b')]=_['intersection'](_0x4dc91e[_0x477d('0x39')],_0x4dc91e['query']);_0x109acb[_0x477d('0x3f')]=_[_0x477d('0x3c')](_0x4dc91e['model'],qs[_0x477d('0x3d')](_0x3da01d[_0x477d('0x3a')][_0x477d('0x3d')]));_0x109acb[_0x477d('0x3f')]=_0x109acb[_0x477d('0x3f')]['length']?_0x109acb[_0x477d('0x3f')]:_0x4dc91e[_0x477d('0x39')];_0x109acb['order']=qs['sort'](_0x3da01d[_0x477d('0x3a')]['sort']);_0x109acb[_0x477d('0x43')]=qs['filters'](_[_0x477d('0x44')](_0x3da01d[_0x477d('0x3a')],_0x4dc91e['filters']));if(_0x3da01d['query'][_0x477d('0x2b')]){_0x109acb['where']=_[_0x477d('0x45')](_0x109acb[_0x477d('0x43')],{'$or':_[_0x477d('0x36')](_0x109acb['attributes'],function(_0x2ef92a){var _0x487640={};_0x487640[_0x2ef92a]={'$like':'%'+_0x3da01d['query'][_0x477d('0x2b')]+'%'};return _0x487640;})});}_0x109acb=_[_0x477d('0x45')]({},_0x109acb,_0x3da01d[_0x477d('0x4e')]);return _0x1ea699[_0x477d('0x94')](_0x109acb);}})['then'](function(_0x3a699b){if(_0x3a699b){_0x517536=_0x3a699b[_0x477d('0x3e')];if(!_0x3da01d[_0x477d('0x3a')][_0x477d('0x60')](_0x477d('0x40'))){_0x109acb[_0x477d('0x1e')]=qs[_0x477d('0x1e')](_0x3da01d[_0x477d('0x3a')][_0x477d('0x1e')]);_0x109acb['offset']=qs[_0x477d('0x1c')](_0x3da01d[_0x477d('0x3a')][_0x477d('0x1c')]);}return _0x1ea699[_0x477d('0x94')](_0x109acb);}})['then'](function(_0x5c03f5){return _0x5c03f5?{'count':_0x517536,'rows':_0x5c03f5}:null;})[_0x477d('0x25')](respondWithResult(_0x17b2e2,null))['catch'](handleError(_0x17b2e2,null));};exports[_0x477d('0x95')]=function(_0x4ac7a7,_0x33f153,_0x29715b){var _0x4212e4={};var _0x48934d={};var _0x9fef79;var _0x2720cb;return db['VoiceQueue'][_0x477d('0x5f')]({'where':{'id':_0x4ac7a7[_0x477d('0x4b')]['id']}})['then'](handleEntityNotFound(_0x33f153,null))[_0x477d('0x25')](function(_0x583deb){if(_0x583deb){_0x9fef79=_0x583deb;_0x48934d[_0x477d('0x39')]=_['keys'](db['CmList']['rawAttributes']);_0x48934d[_0x477d('0x3a')]=_[_0x477d('0x4c')](_0x4ac7a7['query']);_0x48934d[_0x477d('0x3b')]=_[_0x477d('0x3c')](_0x48934d[_0x477d('0x39')],_0x48934d[_0x477d('0x3a')]);_0x4212e4[_0x477d('0x3f')]=_[_0x477d('0x3c')](_0x48934d[_0x477d('0x39')],qs[_0x477d('0x3d')](_0x4ac7a7[_0x477d('0x3a')]['fields']));_0x4212e4[_0x477d('0x3f')]=_0x4212e4['attributes'][_0x477d('0x3e')]?_0x4212e4[_0x477d('0x3f')]:_0x48934d[_0x477d('0x39')];_0x4212e4[_0x477d('0x41')]=qs['sort'](_0x4ac7a7['query'][_0x477d('0x42')]);_0x4212e4['where']=qs[_0x477d('0x3b')](_[_0x477d('0x44')](_0x4ac7a7['query'],_0x48934d[_0x477d('0x3b')]));if(_0x4ac7a7[_0x477d('0x3a')][_0x477d('0x2b')]){_0x4212e4[_0x477d('0x43')]=_[_0x477d('0x45')](_0x4212e4[_0x477d('0x43')],{'$or':_[_0x477d('0x36')](_0x4212e4[_0x477d('0x3f')],function(_0x3eff80){var _0x1104ba={};_0x1104ba[_0x3eff80]={'$like':'%'+_0x4ac7a7[_0x477d('0x3a')]['filter']+'%'};return _0x1104ba;})});}_0x4212e4=_[_0x477d('0x45')]({},_0x4212e4,_0x4ac7a7[_0x477d('0x4e')]);return _0x9fef79['getLists'](_0x4212e4);}})[_0x477d('0x25')](function(_0x98745){if(_0x98745){_0x2720cb=_0x98745['length'];if(!_0x4ac7a7['query'][_0x477d('0x60')](_0x477d('0x40'))){_0x4212e4[_0x477d('0x1e')]=qs[_0x477d('0x1e')](_0x4ac7a7[_0x477d('0x3a')][_0x477d('0x1e')]);_0x4212e4['offset']=qs['offset'](_0x4ac7a7['query'][_0x477d('0x1c')]);}return _0x9fef79[_0x477d('0x95')](_0x4212e4);}})[_0x477d('0x25')](function(_0x2a14f8){if(_0x2a14f8){return _0x2a14f8?{'count':_0x2720cb,'rows':_0x2a14f8}:null;}})[_0x477d('0x25')](respondWithResult(_0x33f153,null))[_0x477d('0x4a')](handleError(_0x33f153,null));};exports[_0x477d('0x96')]=function(_0x53bae5,_0x12ec9f,_0x2d7844){var _0x493bfa=moment()[_0x477d('0x78')]('YYYY-MM-DD\x20HH:mm:ss');var _0x5e9214,_0x506f4e;return db[_0x477d('0x37')][_0x477d('0x30')]({'where':{'id':_0x53bae5['params']['id']}})['then'](handleEntityNotFound(_0x12ec9f,null))[_0x477d('0x25')](function(_0x5953e4){if(_0x5953e4){_0x506f4e=_0x5953e4;return _0x5953e4['addLists'](_0x53bae5['body']['ids'],_['omit'](_0x53bae5['body'],['ids','id'])||{});}return null;})[_0x477d('0x8e')](function(_0x2b09f2){var _0x547b6d;_0x5e9214=_0x2b09f2||[];var _0x839ef0=[];if(_0x2b09f2){for(var _0x1c46ad=0x0;_0x1c46ad<_0x2b09f2[_0x477d('0x3e')];_0x1c46ad+=0x1){var _0x44b16f=_0x2b09f2[_0x1c46ad]['get']({'plain':!![]});_0x506f4e[_0x477d('0x97')]=_0x53bae5[_0x477d('0x50')][_0x477d('0x97')]?_0x53bae5[_0x477d('0x50')][_0x477d('0x97')]:_0x506f4e[_0x477d('0x97')];switch(_0x506f4e[_0x477d('0x97')]){case _0x477d('0x98'):_0x547b6d=squel[_0x477d('0x99')]()[_0x477d('0x9a')](_0x477d('0x9b'))[_0x477d('0x9c')]([_0x477d('0x9d'),'scheduledAt',_0x477d('0x9e'),'ListId',_0x477d('0x64'),_0x477d('0x5a'),_0x477d('0x5b')],squel[_0x477d('0x7c')]()[_0x477d('0x9f')](_0x477d('0x9d'),_0x477d('0x9d'))['field']('\x27'+_0x493bfa+'\x27','scheduledAt')[_0x477d('0x9f')]('id',_0x477d('0x9e'))[_0x477d('0x9f')](_0x44b16f[_0x477d('0xa0')][_0x477d('0xa1')](),_0x477d('0xa2'))[_0x477d('0x9f')](_0x53bae5[_0x477d('0x4b')]['id'][_0x477d('0xa1')](),_0x477d('0x64'))['field']('\x27'+_0x493bfa+'\x27',_0x477d('0x5a'))[_0x477d('0x9f')]('\x27'+_0x493bfa+'\x27',_0x477d('0x5b'))[_0x477d('0x7e')](_0x477d('0xa3'))[_0x477d('0x43')](_0x477d('0xa4'))[_0x477d('0x43')](_0x477d('0xa5'),_0x44b16f[_0x477d('0xa0')]['toString']())[_0x477d('0x43')](_0x477d('0xa6'))[_0x477d('0x43')](_0x477d('0xa7'),squel[_0x477d('0x7c')]()['field'](_0x477d('0xa8'))['from']('cm_hopper_final')[_0x477d('0x43')](_0x477d('0x81'),_0x53bae5['params']['id']['toString']()))[_0x477d('0x43')](_0x477d('0xa7'),squel[_0x477d('0x7c')]()[_0x477d('0x9f')](_0x477d('0xa9'))[_0x477d('0x7e')]('cm_hopper')[_0x477d('0x43')]('VoiceQueueId\x20=\x20?',_0x53bae5[_0x477d('0x4b')]['id'][_0x477d('0xa1')]())))[_0x477d('0xa1')]();break;case _0x477d('0xaa'):_0x547b6d=squel[_0x477d('0x99')]()[_0x477d('0x9a')](_0x477d('0x9b'))[_0x477d('0x9c')]([_0x477d('0x9d'),_0x477d('0xab'),_0x477d('0x9e'),_0x477d('0xa2'),_0x477d('0x64'),_0x477d('0x5a'),_0x477d('0x5b')],squel[_0x477d('0x7c')]()[_0x477d('0x9f')](_0x477d('0x9d'),'phone')[_0x477d('0x9f')]('\x27'+_0x493bfa+'\x27',_0x477d('0xab'))['field']('id','ContactId')[_0x477d('0x9f')](_0x44b16f['CmListId'][_0x477d('0xa1')](),_0x477d('0xa2'))['field'](_0x53bae5['params']['id']['toString'](),_0x477d('0x64'))[_0x477d('0x9f')]('\x27'+_0x493bfa+'\x27',_0x477d('0x5a'))[_0x477d('0x9f')]('\x27'+_0x493bfa+'\x27',_0x477d('0x5b'))['from']('cm_contacts')[_0x477d('0x43')](_0x477d('0xa4'))['where'](_0x477d('0xa5'),_0x44b16f['CmListId']['toString']())[_0x477d('0x43')](_0x477d('0xa6'))[_0x477d('0x43')](_0x477d('0xa7'),squel[_0x477d('0x7c')]()['field'](_0x477d('0xa9'))[_0x477d('0x7e')](_0x477d('0x9b'))[_0x477d('0x43')](_0x477d('0x81'),_0x53bae5[_0x477d('0x4b')]['id'][_0x477d('0xa1')]())))['toString']();break;default:_0x547b6d=squel[_0x477d('0x99')]()[_0x477d('0x9a')](_0x477d('0x9b'))[_0x477d('0x9c')](['phone',_0x477d('0xab'),_0x477d('0x9e'),_0x477d('0xa2'),'VoiceQueueId',_0x477d('0x5a'),_0x477d('0x5b')],squel[_0x477d('0x7c')]()[_0x477d('0x9f')](_0x477d('0x9d'),'phone')[_0x477d('0x9f')]('\x27'+_0x493bfa+'\x27','scheduledAt')[_0x477d('0x9f')]('id',_0x477d('0x9e'))[_0x477d('0x9f')](_0x44b16f['CmListId']['toString'](),'ListId')['field'](_0x53bae5['params']['id'][_0x477d('0xa1')](),_0x477d('0x64'))['field']('\x27'+_0x493bfa+'\x27',_0x477d('0x5a'))[_0x477d('0x9f')]('\x27'+_0x493bfa+'\x27',_0x477d('0x5b'))[_0x477d('0x7e')](_0x477d('0xa3'))[_0x477d('0x43')](_0x477d('0xa4'))[_0x477d('0x43')](_0x477d('0xa5'),_0x44b16f[_0x477d('0xa0')][_0x477d('0xa1')]())['where'](_0x477d('0xa6')))[_0x477d('0xa1')]();}_0x839ef0[_0x477d('0x90')](db[_0x477d('0x71')]['query'](_0x547b6d));}return BPromise[_0x477d('0x86')](_0x839ef0);}})[_0x477d('0x25')](function(){var _0x1d37d6=[];var _0x256bac=squel['insert']()[_0x477d('0x9a')](_0x477d('0xac'))['fromQuery']([_0x477d('0xad'),_0x477d('0x9d'),'OrderBy',_0x477d('0x5a'),_0x477d('0x5b')],squel[_0x477d('0x7c')]()[_0x477d('0x9f')](_0x477d('0xae'))[_0x477d('0x9f')](_0x477d('0xaf'))[_0x477d('0x9f')](_0x477d('0xb0'))[_0x477d('0x9f')]('\x27'+_0x493bfa+'\x27',_0x477d('0x5a'))[_0x477d('0x9f')]('\x27'+_0x493bfa+'\x27','updatedAt')['from'](_0x477d('0xb1'),'ci')[_0x477d('0x7f')](_0x477d('0x9b'),'h',_0x477d('0xb2'))[_0x477d('0x43')]('h.scheduledat=?',_0x493bfa)[_0x477d('0x43')](_0x477d('0xb3'),_0x477d('0xb4')))[_0x477d('0xa1')]();_0x1d37d6['push'](db[_0x477d('0x71')][_0x477d('0x3a')](_0x256bac));return BPromise['all'](_0x1d37d6);})[_0x477d('0x25')](function(){return _0x5e9214;})[_0x477d('0x25')](respondWithResult(_0x12ec9f,null))[_0x477d('0x4a')](handleError(_0x12ec9f,null));};exports[_0x477d('0xb5')]=function(_0x585f7e,_0x3faf93,_0x3f085d){return db['VoiceQueue'][_0x477d('0x30')]({'where':{'id':_0x585f7e[_0x477d('0x4b')]['id']}})[_0x477d('0x25')](handleEntityNotFound(_0x3faf93,null))[_0x477d('0x25')](function(_0xd68325){if(_0xd68325){return _0xd68325[_0x477d('0xb5')](_0x585f7e[_0x477d('0x3a')][_0x477d('0x89')]);}})[_0x477d('0x25')](function(_0x318107){if(_0x318107){return db[_0x477d('0x61')][_0x477d('0x26')]({'where':{'ListId':_0x585f7e['query']['ids'],'VoiceQueueId':_0x585f7e[_0x477d('0x4b')]['id']}})[_0x477d('0x25')](function(){return _0x318107;});}})['then'](respondWithStatusCode(_0x3faf93,null))[_0x477d('0x4a')](handleError(_0x3faf93,null));};exports[_0x477d('0xb6')]=function(_0xb71be6,_0x294394,_0x5dba15){var _0x1eb546={};var _0xc8a414={};var _0x211f74;var _0xc13868;return db['VoiceQueue'][_0x477d('0x5f')]({'where':{'id':_0xb71be6['params']['id']}})['then'](handleEntityNotFound(_0x294394,null))[_0x477d('0x25')](function(_0x2833c3){if(_0x2833c3){_0x211f74=_0x2833c3;_0xc8a414[_0x477d('0x39')]=_['keys'](db[_0x477d('0xb7')][_0x477d('0x4d')]);_0xc8a414['query']=_[_0x477d('0x4c')](_0xb71be6[_0x477d('0x3a')]);_0xc8a414[_0x477d('0x3b')]=_[_0x477d('0x3c')](_0xc8a414[_0x477d('0x39')],_0xc8a414[_0x477d('0x3a')]);_0x1eb546[_0x477d('0x3f')]=_[_0x477d('0x3c')](_0xc8a414['model'],qs[_0x477d('0x3d')](_0xb71be6[_0x477d('0x3a')][_0x477d('0x3d')]));_0x1eb546[_0x477d('0x3f')]=_0x1eb546[_0x477d('0x3f')][_0x477d('0x3e')]?_0x1eb546['attributes']:_0xc8a414[_0x477d('0x39')];_0x1eb546[_0x477d('0x41')]=qs[_0x477d('0x42')](_0xb71be6[_0x477d('0x3a')][_0x477d('0x42')]);_0x1eb546[_0x477d('0x43')]=qs[_0x477d('0x3b')](_[_0x477d('0x44')](_0xb71be6['query'],_0xc8a414[_0x477d('0x3b')]));if(_0xb71be6[_0x477d('0x3a')][_0x477d('0x2b')]){_0x1eb546[_0x477d('0x43')]=_[_0x477d('0x45')](_0x1eb546[_0x477d('0x43')],{'$or':_[_0x477d('0x36')](_0x1eb546[_0x477d('0x3f')],function(_0x2cdbd2){var _0x101d6f={};_0x101d6f[_0x2cdbd2]={'$like':'%'+_0xb71be6[_0x477d('0x3a')][_0x477d('0x2b')]+'%'};return _0x101d6f;})});}_0x1eb546=_[_0x477d('0x45')]({},_0x1eb546,_0xb71be6[_0x477d('0x4e')]);return _0x211f74[_0x477d('0xb6')](_0x1eb546);}})['then'](function(_0x41cd11){if(_0x41cd11){_0xc13868=_0x41cd11[_0x477d('0x3e')];if(!_0xb71be6['query'][_0x477d('0x60')](_0x477d('0x40'))){_0x1eb546[_0x477d('0x1e')]=qs[_0x477d('0x1e')](_0xb71be6['query']['limit']);_0x1eb546[_0x477d('0x1c')]=qs['offset'](_0xb71be6[_0x477d('0x3a')]['offset']);}return _0x211f74['getBlackLists'](_0x1eb546);}})[_0x477d('0x25')](function(_0x500ac0){if(_0x500ac0){return _0x500ac0?{'count':_0xc13868,'rows':_0x500ac0}:null;}})[_0x477d('0x25')](respondWithResult(_0x294394,null))[_0x477d('0x4a')](handleError(_0x294394,null));};exports[_0x477d('0xb8')]=function(_0x42af76,_0x1ef70f,_0xb4dad0){var _0x2b84b9,_0x281a7a;return db[_0x477d('0x37')][_0x477d('0x30')]({'where':{'id':_0x42af76[_0x477d('0x4b')]['id']}})[_0x477d('0x25')](handleEntityNotFound(_0x1ef70f,null))[_0x477d('0x25')](function(_0x2d699f){if(_0x2d699f){_0x281a7a=_0x2d699f;return _0x2d699f[_0x477d('0xb8')](_0x42af76['body'][_0x477d('0x89')],_[_0x477d('0x59')](_0x42af76[_0x477d('0x50')],[_0x477d('0x89'),'id'])||{});}return null;})[_0x477d('0x8e')](function(_0x1e8632){var _0x3848dd;_0x2b84b9=_0x1e8632||[];var _0x1666b1=[];if(_0x1e8632){for(var _0x4d88b5=0x0;_0x4d88b5<_0x1e8632[_0x477d('0x3e')];_0x4d88b5+=0x1){var _0x2c5a62=_0x1e8632[_0x4d88b5][_0x477d('0x27')]({'plain':!![]});_0x3848dd=squel[_0x477d('0x99')]()['into'](_0x477d('0xb9'))[_0x477d('0x9c')]([_0x477d('0x9d'),'ContactId',_0x477d('0xa2'),_0x477d('0x64'),_0x477d('0x5a'),_0x477d('0x5b')],squel[_0x477d('0x7c')]()['field'](_0x477d('0x9d'),_0x477d('0x9d'))[_0x477d('0x9f')]('id',_0x477d('0x9e'))[_0x477d('0x9f')](_0x2c5a62[_0x477d('0xa0')][_0x477d('0xa1')](),'ListId')[_0x477d('0x9f')](_0x42af76['params']['id']['toString'](),'VoiceQueueId')[_0x477d('0x9f')]('NOW()',_0x477d('0x5a'))['field'](_0x477d('0xba'),'updatedAt')[_0x477d('0x7e')](_0x477d('0xa3'))[_0x477d('0x43')](_0x477d('0xa4'))[_0x477d('0x43')](_0x477d('0xa5'),_0x2c5a62[_0x477d('0xa0')]['toString']())[_0x477d('0x43')](_0x477d('0xa6')))[_0x477d('0xa1')]();_0x1666b1[_0x477d('0x90')](db[_0x477d('0x71')][_0x477d('0x3a')](_0x3848dd));}return BPromise[_0x477d('0x86')](_0x1666b1);}})[_0x477d('0x25')](function(){return _0x2b84b9;})[_0x477d('0x25')](respondWithResult(_0x1ef70f,null))[_0x477d('0x4a')](handleError(_0x1ef70f,null));};exports[_0x477d('0xbb')]=function(_0x3a26b9,_0x488cf9,_0x3dd854){return db[_0x477d('0x37')]['find']({'where':{'id':_0x3a26b9['params']['id']}})[_0x477d('0x25')](handleEntityNotFound(_0x488cf9,null))[_0x477d('0x25')](function(_0x4095d0){if(_0x4095d0){return _0x4095d0[_0x477d('0xbb')](_0x3a26b9[_0x477d('0x3a')][_0x477d('0x89')]);}})[_0x477d('0x25')](function(_0x46f63c){if(_0x46f63c){return db['CmHopperBlack'][_0x477d('0x26')]({'where':{'ListId':_0x3a26b9[_0x477d('0x3a')][_0x477d('0x89')],'VoiceQueueId':_0x3a26b9[_0x477d('0x4b')]['id']}})[_0x477d('0x25')](function(){return _0x46f63c;});}})[_0x477d('0x25')](respondWithStatusCode(_0x488cf9,null))[_0x477d('0x4a')](handleError(_0x488cf9,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 5dd7202..b2c582d 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 _0x5cd2=['../../mysqldb','VoiceQueue','setMaxListeners','update','emit','hasOwnProperty','exports'];(function(_0x970761,_0x5b3236){var _0x417c60=function(_0x2c8f55){while(--_0x2c8f55){_0x970761['push'](_0x970761['shift']());}};_0x417c60(++_0x5b3236);}(_0x5cd2,0xee));var _0x25cd=function(_0x1e7562,_0x25c25f){_0x1e7562=_0x1e7562-0x0;var _0x38ccf7=_0x5cd2[_0x1e7562];return _0x38ccf7;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0x25cd('0x0'))['db'][_0x25cd('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x25cd('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x25cd('0x3'),'afterDestroy':'remove'};function emitEvent(_0x572717){return function(_0xc5c415,_0x297107,_0x41c833){VoiceQueueEvents[_0x25cd('0x4')](_0x572717+':'+_0xc5c415['id'],_0xc5c415);VoiceQueueEvents[_0x25cd('0x4')](_0x572717,_0xc5c415);_0x41c833(null);};}for(var e in events){if(events[_0x25cd('0x5')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0x25cd('0x6')]=VoiceQueueEvents; \ No newline at end of file +var _0xaa63=['save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners'];(function(_0x3b9fee,_0x1387a9){var _0x5c8d94=function(_0x3ed99c){while(--_0x3ed99c){_0x3b9fee['push'](_0x3b9fee['shift']());}};_0x5c8d94(++_0x1387a9);}(_0xaa63,0xc4));var _0x3aa6=function(_0x3e7396,_0x1b0b41){_0x3e7396=_0x3e7396-0x0;var _0x3a72b9=_0xaa63[_0x3e7396];return _0x3a72b9;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0x3aa6('0x0'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x3aa6('0x1')](0x0);var events={'afterCreate':_0x3aa6('0x2'),'afterUpdate':_0x3aa6('0x3'),'afterDestroy':_0x3aa6('0x4')};function emitEvent(_0x5e1ba8){return function(_0x5d2644,_0x3fce2f,_0x322761){VoiceQueueEvents[_0x3aa6('0x5')](_0x5e1ba8+':'+_0x5d2644['id'],_0x5d2644);VoiceQueueEvents['emit'](_0x5e1ba8,_0x5d2644);_0x322761(null);};}for(var e in events){if(events[_0x3aa6('0x6')](e)){var event=events[e];VoiceQueue[_0x3aa6('0x7')](e,emitEvent(event));}}module[_0x3aa6('0x8')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index c358bdc..14ea67e 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 _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceQueue.attributes','exports','VoiceQueue','util'];(function(_0x2cd1f5,_0x15f114){var _0x54aa6b=function(_0x38d4d2){while(--_0x38d4d2){_0x2cd1f5['push'](_0x2cd1f5['shift']());}};_0x54aa6b(++_0x15f114);}(_0xedd9,0xfc));var _0x9edd=function(_0x2dacba,_0x521989){_0x2dacba=_0x2dacba-0x0;var _0x5d67f9=_0xedd9[_0x2dacba];return _0x5d67f9;};'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':'voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceQueue.attributes','exports','VoiceQueue','util'];(function(_0x18c844,_0x20cc35){var _0x3aa130=function(_0x1f8fa6){while(--_0x1f8fa6){_0x18c844['push'](_0x18c844['shift']());}};_0x3aa130(++_0x20cc35);}(_0xedd9,0xfc));var _0x9edd=function(_0x33420a,_0x6972ec){_0x33420a=_0x33420a-0x0;var _0x2fe724=_0xedd9[_0x33420a];return _0x2fe724;};'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':'voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index a36b8e0..6c8d5e8 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 _0x1c56=['model','attributes','map','catch','ShowVoiceQueue','find','where','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','request','then','info','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceQueue,\x20%s,\x20%s','message','result','GetVoiceQueue','VoiceQueue','findAll','options','raw','limit','include'];(function(_0x2cef86,_0xbae0a6){var _0x46dfd6=function(_0x52e464){while(--_0x52e464){_0x2cef86['push'](_0x2cef86['shift']());}};_0x46dfd6(++_0xbae0a6);}(_0x1c56,0xab));var _0x61c5=function(_0x33c9f8,_0x5aedbb){_0x33c9f8=_0x33c9f8-0x0;var _0x2d7004=_0x1c56[_0x33c9f8];return _0x2d7004;};'use strict';var _=require(_0x61c5('0x0'));var util=require(_0x61c5('0x1'));var moment=require(_0x61c5('0x2'));var BPromise=require('bluebird');var rs=require(_0x61c5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x61c5('0x4'))['db'];var utils=require(_0x61c5('0x5'));var logger=require('../../config/logger')(_0x61c5('0x6'));var config=require(_0x61c5('0x7'));var jayson=require(_0x61c5('0x8'));var client=jayson[_0x61c5('0x9')]['http']({'port':0x232a});config[_0x61c5('0xa')]=_['defaults'](config['redis'],{'host':_0x61c5('0xb'),'port':0x18eb});var socket=require(_0x61c5('0xc'))(new Redis(config[_0x61c5('0xa')]));require(_0x61c5('0xd'))[_0x61c5('0xe')](socket);function respondWithRpcPromise(_0x56d8d8,_0x494912,_0x49968d){return new BPromise(function(_0x5457db,_0x54d262){return client[_0x61c5('0xf')](_0x56d8d8,_0x49968d)[_0x61c5('0x10')](function(_0x37bd51){logger[_0x61c5('0x11')]('VoiceQueue,\x20%s,\x20%s',_0x494912,_0x61c5('0x12'));logger[_0x61c5('0x13')](_0x61c5('0x14'),_0x494912,'request\x20sent',JSON[_0x61c5('0x15')](_0x37bd51));if(_0x37bd51[_0x61c5('0x16')]){if(_0x37bd51[_0x61c5('0x16')][_0x61c5('0x17')]===0x1f4){logger[_0x61c5('0x16')](_0x61c5('0x18'),_0x494912,_0x37bd51[_0x61c5('0x16')][_0x61c5('0x19')]);return _0x54d262(_0x37bd51[_0x61c5('0x16')][_0x61c5('0x19')]);}logger[_0x61c5('0x16')](_0x61c5('0x18'),_0x494912,_0x37bd51[_0x61c5('0x16')][_0x61c5('0x19')]);return _0x5457db(_0x37bd51[_0x61c5('0x16')][_0x61c5('0x19')]);}else{logger[_0x61c5('0x11')](_0x61c5('0x18'),_0x494912,'request\x20sent');_0x5457db(_0x37bd51[_0x61c5('0x1a')][_0x61c5('0x19')]);}})['catch'](function(_0x24f8ea){logger['error']('VoiceQueue,\x20%s,\x20%s',_0x494912,_0x24f8ea);_0x54d262(_0x24f8ea);});});}exports[_0x61c5('0x1b')]=function(_0x51f08e){var _0x4924cc=this;return new Promise(function(_0x2bdcd1,_0x185e59){return db[_0x61c5('0x1c')][_0x61c5('0x1d')]({'raw':_0x51f08e[_0x61c5('0x1e')]?_0x51f08e[_0x61c5('0x1e')][_0x61c5('0x1f')]===undefined?!![]:![]:!![],'where':_0x51f08e[_0x61c5('0x1e')]?_0x51f08e[_0x61c5('0x1e')]['where']||null:null,'attributes':_0x51f08e[_0x61c5('0x1e')]?_0x51f08e['options']['attributes']||null:null,'limit':_0x51f08e[_0x61c5('0x1e')]?_0x51f08e[_0x61c5('0x1e')][_0x61c5('0x20')]||null:null,'include':_0x51f08e[_0x61c5('0x1e')]?_0x51f08e[_0x61c5('0x1e')][_0x61c5('0x21')]?_['map'](_0x51f08e[_0x61c5('0x1e')][_0x61c5('0x21')],function(_0x2724ca){return{'model':db[_0x2724ca[_0x61c5('0x22')]],'as':_0x2724ca['as'],'attributes':_0x2724ca[_0x61c5('0x23')],'include':_0x2724ca['include']?_[_0x61c5('0x24')](_0x2724ca[_0x61c5('0x21')],function(_0x8588a0){return{'model':db[_0x8588a0['model']],'as':_0x8588a0['as'],'attributes':_0x8588a0['attributes'],'include':_0x8588a0[_0x61c5('0x21')]?_[_0x61c5('0x24')](_0x8588a0[_0x61c5('0x21')],function(_0x977b9d){return{'model':db[_0x977b9d['model']],'as':_0x977b9d['as'],'attributes':_0x977b9d[_0x61c5('0x23')]};}):[]};}):[]};}):[]:[]})[_0x61c5('0x10')](function(_0x464336){logger[_0x61c5('0x11')]('GetVoiceQueue',_0x51f08e);logger[_0x61c5('0x13')](_0x61c5('0x1b'),_0x51f08e,JSON[_0x61c5('0x15')](_0x464336));_0x2bdcd1(_0x464336);})[_0x61c5('0x25')](function(_0x152faa){logger[_0x61c5('0x16')](_0x61c5('0x1b'),_0x152faa[_0x61c5('0x19')],_0x51f08e);_0x185e59(_0x4924cc[_0x61c5('0x16')](0x1f4,_0x152faa[_0x61c5('0x19')]));});});};exports[_0x61c5('0x26')]=function(_0xa8aa4d){var _0x48e92b=this;return new Promise(function(_0x55d9c7,_0x50adca){return db[_0x61c5('0x1c')][_0x61c5('0x27')]({'raw':_0xa8aa4d[_0x61c5('0x1e')]?_0xa8aa4d[_0x61c5('0x1e')][_0x61c5('0x1f')]===undefined?!![]:![]:!![],'where':_0xa8aa4d[_0x61c5('0x1e')]?_0xa8aa4d[_0x61c5('0x1e')][_0x61c5('0x28')]||null:null,'attributes':_0xa8aa4d[_0x61c5('0x1e')]?_0xa8aa4d[_0x61c5('0x1e')]['attributes']||null:null,'include':_0xa8aa4d[_0x61c5('0x1e')]?_0xa8aa4d[_0x61c5('0x1e')]['include']?_['map'](_0xa8aa4d[_0x61c5('0x1e')][_0x61c5('0x21')],function(_0x2260ea){return{'model':db[_0x2260ea[_0x61c5('0x22')]],'as':_0x2260ea['as'],'attributes':_0x2260ea[_0x61c5('0x23')],'include':_0x2260ea[_0x61c5('0x21')]?_['map'](_0x2260ea['include'],function(_0x3bf6d9){return{'model':db[_0x3bf6d9['model']],'as':_0x3bf6d9['as'],'attributes':_0x3bf6d9[_0x61c5('0x23')],'include':_0x3bf6d9[_0x61c5('0x21')]?_[_0x61c5('0x24')](_0x3bf6d9[_0x61c5('0x21')],function(_0x20a8df){return{'model':db[_0x20a8df['model']],'as':_0x20a8df['as'],'attributes':_0x20a8df[_0x61c5('0x23')]};}):[]};}):[]};}):[]:[]})[_0x61c5('0x10')](function(_0x27ed29){logger[_0x61c5('0x11')](_0x61c5('0x26'),_0xa8aa4d);logger[_0x61c5('0x13')]('ShowVoiceQueue',_0xa8aa4d,JSON[_0x61c5('0x15')](_0x27ed29));_0x55d9c7(_0x27ed29);})[_0x61c5('0x25')](function(_0x4eb8b4){logger['error'](_0x61c5('0x26'),_0x4eb8b4['message'],_0xa8aa4d);_0x50adca(_0x48e92b['error'](0x1f4,_0x4eb8b4[_0x61c5('0x19')]));});});}; \ No newline at end of file +var _0xda39=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./voiceQueue.socket','register','then','VoiceQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','VoiceQueue','findAll','options','raw','where','limit','include','attributes','map','model','GetVoiceQueue','ShowVoiceQueue','find','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x4025c6,_0x5f0390){var _0x5558de=function(_0x2f85cb){while(--_0x2f85cb){_0x4025c6['push'](_0x4025c6['shift']());}};_0x5558de(++_0x5f0390);}(_0xda39,0x1cf));var _0x9da3=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xda39[_0x19950b];return _0x3c6b41;};'use strict';var _=require('lodash');var util=require(_0x9da3('0x0'));var moment=require(_0x9da3('0x1'));var BPromise=require(_0x9da3('0x2'));var rs=require(_0x9da3('0x3'));var fs=require('fs');var Redis=require(_0x9da3('0x4'));var db=require(_0x9da3('0x5'))['db'];var utils=require(_0x9da3('0x6'));var logger=require('../../config/logger')(_0x9da3('0x7'));var config=require(_0x9da3('0x8'));var jayson=require(_0x9da3('0x9'));var client=jayson[_0x9da3('0xa')]['http']({'port':0x232a});config[_0x9da3('0xb')]=_[_0x9da3('0xc')](config[_0x9da3('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x9da3('0xd'))(new Redis(config['redis']));require(_0x9da3('0xe'))[_0x9da3('0xf')](socket);function respondWithRpcPromise(_0x149bd6,_0x536f3e,_0x29ff18){return new BPromise(function(_0xfaf95c,_0x3184e7){return client['request'](_0x149bd6,_0x29ff18)[_0x9da3('0x10')](function(_0x4ee94e){logger['info'](_0x9da3('0x11'),_0x536f3e,'request\x20sent');logger['debug']('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x536f3e,_0x9da3('0x12'),JSON[_0x9da3('0x13')](_0x4ee94e));if(_0x4ee94e[_0x9da3('0x14')]){if(_0x4ee94e['error'][_0x9da3('0x15')]===0x1f4){logger[_0x9da3('0x14')](_0x9da3('0x11'),_0x536f3e,_0x4ee94e[_0x9da3('0x14')][_0x9da3('0x16')]);return _0x3184e7(_0x4ee94e[_0x9da3('0x14')][_0x9da3('0x16')]);}logger[_0x9da3('0x14')](_0x9da3('0x11'),_0x536f3e,_0x4ee94e[_0x9da3('0x14')][_0x9da3('0x16')]);return _0xfaf95c(_0x4ee94e[_0x9da3('0x14')]['message']);}else{logger[_0x9da3('0x17')]('VoiceQueue,\x20%s,\x20%s',_0x536f3e,'request\x20sent');_0xfaf95c(_0x4ee94e[_0x9da3('0x18')][_0x9da3('0x16')]);}})['catch'](function(_0x20d48d){logger[_0x9da3('0x14')](_0x9da3('0x11'),_0x536f3e,_0x20d48d);_0x3184e7(_0x20d48d);});});}exports['GetVoiceQueue']=function(_0x342a4a){var _0xaf5243=this;return new Promise(function(_0x456ede,_0x26725c){return db[_0x9da3('0x19')][_0x9da3('0x1a')]({'raw':_0x342a4a[_0x9da3('0x1b')]?_0x342a4a[_0x9da3('0x1b')][_0x9da3('0x1c')]===undefined?!![]:![]:!![],'where':_0x342a4a[_0x9da3('0x1b')]?_0x342a4a[_0x9da3('0x1b')][_0x9da3('0x1d')]||null:null,'attributes':_0x342a4a['options']?_0x342a4a[_0x9da3('0x1b')]['attributes']||null:null,'limit':_0x342a4a['options']?_0x342a4a[_0x9da3('0x1b')][_0x9da3('0x1e')]||null:null,'include':_0x342a4a[_0x9da3('0x1b')]?_0x342a4a[_0x9da3('0x1b')][_0x9da3('0x1f')]?_['map'](_0x342a4a[_0x9da3('0x1b')][_0x9da3('0x1f')],function(_0x1cd1d6){return{'model':db[_0x1cd1d6['model']],'as':_0x1cd1d6['as'],'attributes':_0x1cd1d6[_0x9da3('0x20')],'include':_0x1cd1d6[_0x9da3('0x1f')]?_[_0x9da3('0x21')](_0x1cd1d6[_0x9da3('0x1f')],function(_0x53c2e8){return{'model':db[_0x53c2e8[_0x9da3('0x22')]],'as':_0x53c2e8['as'],'attributes':_0x53c2e8[_0x9da3('0x20')],'include':_0x53c2e8[_0x9da3('0x1f')]?_[_0x9da3('0x21')](_0x53c2e8[_0x9da3('0x1f')],function(_0x24a6b6){return{'model':db[_0x24a6b6[_0x9da3('0x22')]],'as':_0x24a6b6['as'],'attributes':_0x24a6b6[_0x9da3('0x20')]};}):[]};}):[]};}):[]:[]})[_0x9da3('0x10')](function(_0x10f69d){logger['info'](_0x9da3('0x23'),_0x342a4a);logger['debug']('GetVoiceQueue',_0x342a4a,JSON['stringify'](_0x10f69d));_0x456ede(_0x10f69d);})['catch'](function(_0x5d1ed1){logger['error'](_0x9da3('0x23'),_0x5d1ed1[_0x9da3('0x16')],_0x342a4a);_0x26725c(_0xaf5243[_0x9da3('0x14')](0x1f4,_0x5d1ed1['message']));});});};exports[_0x9da3('0x24')]=function(_0x2d7327){var _0x4f7b76=this;return new Promise(function(_0x3da5ed,_0x207ae8){return db[_0x9da3('0x19')][_0x9da3('0x25')]({'raw':_0x2d7327['options']?_0x2d7327['options'][_0x9da3('0x1c')]===undefined?!![]:![]:!![],'where':_0x2d7327[_0x9da3('0x1b')]?_0x2d7327[_0x9da3('0x1b')][_0x9da3('0x1d')]||null:null,'attributes':_0x2d7327[_0x9da3('0x1b')]?_0x2d7327[_0x9da3('0x1b')][_0x9da3('0x20')]||null:null,'include':_0x2d7327[_0x9da3('0x1b')]?_0x2d7327['options']['include']?_[_0x9da3('0x21')](_0x2d7327[_0x9da3('0x1b')][_0x9da3('0x1f')],function(_0x20f48e){return{'model':db[_0x20f48e[_0x9da3('0x22')]],'as':_0x20f48e['as'],'attributes':_0x20f48e[_0x9da3('0x20')],'include':_0x20f48e[_0x9da3('0x1f')]?_['map'](_0x20f48e[_0x9da3('0x1f')],function(_0x4985f2){return{'model':db[_0x4985f2['model']],'as':_0x4985f2['as'],'attributes':_0x4985f2[_0x9da3('0x20')],'include':_0x4985f2[_0x9da3('0x1f')]?_[_0x9da3('0x21')](_0x4985f2[_0x9da3('0x1f')],function(_0x295244){return{'model':db[_0x295244[_0x9da3('0x22')]],'as':_0x295244['as'],'attributes':_0x295244[_0x9da3('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x25e380){logger['info']('ShowVoiceQueue',_0x2d7327);logger['debug'](_0x9da3('0x24'),_0x2d7327,JSON[_0x9da3('0x13')](_0x25e380));_0x3da5ed(_0x25e380);})[_0x9da3('0x26')](function(_0x5db429){logger[_0x9da3('0x14')](_0x9da3('0x24'),_0x5db429[_0x9da3('0x16')],_0x2d7327);_0x207ae8(_0x4f7b76[_0x9da3('0x14')](0x1f4,_0x5db429[_0x9da3('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 1e346c6..fa999d0 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 _0xa537=['emit','removeListener','register','length','save','remove'];(function(_0x5b35dc,_0x114032){var _0x36b398=function(_0x4b5425){while(--_0x4b5425){_0x5b35dc['push'](_0x5b35dc['shift']());}};_0x36b398(++_0x114032);}(_0xa537,0x1c0));var _0x7a53=function(_0x4b6c94,_0x4bb634){_0x4b6c94=_0x4b6c94-0x0;var _0x3e7bbb=_0xa537[_0x4b6c94];return _0x3e7bbb;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0x7a53('0x0'),_0x7a53('0x1'),'update'];function createListener(_0x2eb9fd,_0x2eaeab){return function(_0x33f1be){_0x2eaeab[_0x7a53('0x2')](_0x2eb9fd,_0x33f1be);};}function removeListener(_0x7654fa,_0x93590f){return function(){VoiceQueueEvents[_0x7a53('0x3')](_0x7654fa,_0x93590f);};}exports[_0x7a53('0x4')]=function(_0x32ba78){for(var _0x4c8ad7=0x0,_0x100f67=events[_0x7a53('0x5')];_0x4c8ad7<_0x100f67;_0x4c8ad7++){var _0x5b495f=events[_0x4c8ad7];var _0x58b060=createListener('voiceQueue:'+_0x5b495f,_0x32ba78);VoiceQueueEvents['on'](_0x5b495f,_0x58b060);}}; \ No newline at end of file +var _0xd943=['register','length','./voiceQueue.events','remove','update','emit'];(function(_0x1cf792,_0x2c1d1e){var _0x3c7e0a=function(_0xd5717c){while(--_0xd5717c){_0x1cf792['push'](_0x1cf792['shift']());}};_0x3c7e0a(++_0x2c1d1e);}(_0xd943,0x128));var _0x3d94=function(_0x595f3c,_0x1d58af){_0x595f3c=_0x595f3c-0x0;var _0x5bdeb3=_0xd943[_0x595f3c];return _0x5bdeb3;};'use strict';var VoiceQueueEvents=require(_0x3d94('0x0'));var events=['save',_0x3d94('0x1'),_0x3d94('0x2')];function createListener(_0x319131,_0x331402){return function(_0x389503){_0x331402[_0x3d94('0x3')](_0x319131,_0x389503);};}function removeListener(_0x59a3bb,_0x4c1ff1){return function(){VoiceQueueEvents['removeListener'](_0x59a3bb,_0x4c1ff1);};}exports[_0x3d94('0x4')]=function(_0x4352ce){for(var _0x2776d9=0x0,_0x388ae2=events[_0x3d94('0x5')];_0x2776d9<_0x388ae2;_0x2776d9++){var _0x4495d1=events[_0x2776d9];var _0x30e07c=createListener('voiceQueue:'+_0x4495d1,_0x4352ce);VoiceQueueEvents['on'](_0x4495d1,_0x30e07c);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 95f6fb9..ebb75a0 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 _0xbf96=['fs-extra','../../components/auth/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','/describe','/:id','show','post','create','update','destroy','exports','multer','util','path','connect-timeout'];(function(_0x3c9585,_0x24e144){var _0x1d4f54=function(_0x392d5d){while(--_0x392d5d){_0x3c9585['push'](_0x3c9585['shift']());}};_0x1d4f54(++_0x24e144);}(_0xbf96,0x1e2));var _0x6bf9=function(_0x23b6c7,_0xf57e14){_0x23b6c7=_0x23b6c7-0x0;var _0x24ec4d=_0xbf96[_0x23b6c7];return _0x24ec4d;};'use strict';var multer=require(_0x6bf9('0x0'));var util=require(_0x6bf9('0x1'));var path=require(_0x6bf9('0x2'));var timeout=require(_0x6bf9('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6bf9('0x4'));var auth=require(_0x6bf9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6bf9('0x6'));var controller=require(_0x6bf9('0x7'));router[_0x6bf9('0x8')]('/',auth[_0x6bf9('0x9')](),controller['index']);router[_0x6bf9('0x8')](_0x6bf9('0xa'),auth[_0x6bf9('0x9')](),controller['describe']);router['get']('/index',auth[_0x6bf9('0x9')](),controller['getVoiceQueuesReport']);router['get'](_0x6bf9('0xb'),auth[_0x6bf9('0x9')](),controller[_0x6bf9('0xc')]);router[_0x6bf9('0xd')]('/',auth[_0x6bf9('0x9')](),controller[_0x6bf9('0xe')]);router['put'](_0x6bf9('0xb'),auth['isAuthenticated'](),controller[_0x6bf9('0xf')]);router['delete'](_0x6bf9('0xb'),auth[_0x6bf9('0x9')](),controller[_0x6bf9('0x10')]);module[_0x6bf9('0x11')]=router; \ No newline at end of file +var _0x5d54=['/describe','/index','getVoiceQueuesReport','/:id','show','post','put','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x377304,_0x49256d){var _0x3f17f0=function(_0x5a7986){while(--_0x5a7986){_0x377304['push'](_0x377304['shift']());}};_0x3f17f0(++_0x49256d);}(_0x5d54,0x78));var _0x45d5=function(_0xbbc552,_0x14702f){_0xbbc552=_0xbbc552-0x0;var _0x35615d=_0x5d54[_0xbbc552];return _0x35615d;};'use strict';var multer=require('multer');var util=require(_0x45d5('0x0'));var path=require(_0x45d5('0x1'));var timeout=require(_0x45d5('0x2'));var express=require(_0x45d5('0x3'));var router=express[_0x45d5('0x4')]();var fs_extra=require(_0x45d5('0x5'));var auth=require(_0x45d5('0x6'));var interaction=require(_0x45d5('0x7'));var config=require(_0x45d5('0x8'));var controller=require('./voiceQueueReport.controller');router[_0x45d5('0x9')]('/',auth[_0x45d5('0xa')](),controller[_0x45d5('0xb')]);router[_0x45d5('0x9')](_0x45d5('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x45d5('0x9')](_0x45d5('0xd'),auth[_0x45d5('0xa')](),controller[_0x45d5('0xe')]);router[_0x45d5('0x9')](_0x45d5('0xf'),auth[_0x45d5('0xa')](),controller[_0x45d5('0x10')]);router[_0x45d5('0x11')]('/',auth[_0x45d5('0xa')](),controller['create']);router[_0x45d5('0x12')](_0x45d5('0xf'),auth[_0x45d5('0xa')](),controller[_0x45d5('0x13')]);router[_0x45d5('0x14')](_0x45d5('0xf'),auth['isAuthenticated'](),controller[_0x45d5('0x15')]);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 ba99dae..b8894c6 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 _0x75b9=['queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','getDataValue'];(function(_0x2237ec,_0xf3a93d){var _0xf0dfa5=function(_0x76614e){while(--_0x76614e){_0x2237ec['push'](_0x2237ec['shift']());}};_0xf0dfa5(++_0xf3a93d);}(_0x75b9,0x1ba));var _0x975b=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x75b9[_0x167cc1];return _0x10bc4b;};'use strict';var Sequelize=require(_0x975b('0x0'));var moment=require(_0x975b('0x1'));module[_0x975b('0x2')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x975b('0x3')]},'calleridnum':{'type':Sequelize[_0x975b('0x3')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x975b('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0x975b('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0x975b('0x4')],'set':function(_0x25e826){var _0x1a306d=moment(_0x25e826);var _0x4c61b5=moment(this[_0x975b('0x5')](_0x975b('0x6')))[_0x975b('0x7')](_0x975b('0x8'));var _0x53deac=_0x1a306d['diff'](_0x4c61b5,'seconds');this[_0x975b('0x9')](_0x975b('0xa'),_0x25e826);this['setDataValue'](_0x975b('0xb'),_0x53deac||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0x975b('0xc')]},'queuecallerabandon':{'type':Sequelize[_0x975b('0xd')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x975b('0x4')]},'queuecallercomplete':{'type':Sequelize[_0x975b('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x975b('0x4')]},'queuecallerexit':{'type':Sequelize[_0x975b('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x975b('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0x975b('0x3')],'comment':_0x975b('0xe')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x975b('0x3')]},'connectedlinename':{'type':Sequelize[_0x975b('0x3')]},'accountcode':{'type':Sequelize[_0x975b('0x3')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x975b('0x3')]},'priority':{'type':Sequelize[_0x975b('0x3')]},'holdtime':{'type':Sequelize[_0x975b('0xc')]},'mohtime':{'type':Sequelize[_0x975b('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x975b('0xd')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x975b('0x3')]},'transfer':{'type':Sequelize[_0x975b('0xd')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x975b('0x3')],'comment':_0x975b('0xf')},'transferexten':{'type':Sequelize[_0x975b('0x3')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x975b('0x3')]},'secondDisposition':{'type':Sequelize[_0x975b('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize[_0x975b('0xc')],'defaultValue':0x0},'note':{'type':Sequelize[_0x975b('0x3')]}}; \ No newline at end of file +var _0xd18f=['COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','STRING','DATE','getDataValue','format','YYYY-MM-DD\x20HH:mm:ss','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN'];(function(_0x2071cc,_0x5d728e){var _0x31aa5d=function(_0x2febbd){while(--_0x2febbd){_0x2071cc['push'](_0x2071cc['shift']());}};_0x31aa5d(++_0x5d728e);}(_0xd18f,0x188));var _0xfd18=function(_0x338057,_0x5d0c4c){_0x338057=_0x338057-0x0;var _0x3539ef=_0xd18f[_0x338057];return _0x3539ef;};'use strict';var Sequelize=require(_0xfd18('0x0'));var moment=require(_0xfd18('0x1'));module['exports']={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xfd18('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xfd18('0x2')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0xfd18('0x3')],'set':function(_0x28f658){var _0x506d4c=moment(_0x28f658);var _0x399c03=moment(this[_0xfd18('0x4')]('queuecallerjoinAt'))[_0xfd18('0x5')](_0xfd18('0x6'));var _0x109b57=_0x506d4c['diff'](_0x399c03,_0xfd18('0x7'));this[_0xfd18('0x8')](_0xfd18('0x9'),_0x28f658);this[_0xfd18('0x8')](_0xfd18('0xa'),_0x109b57||null);}},'position':{'type':Sequelize[_0xfd18('0xb')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0xfd18('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xfd18('0x3')]},'queuecallercomplete':{'type':Sequelize[_0xfd18('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize[_0xfd18('0xc')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xfd18('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0xfd18('0x2')],'comment':_0xfd18('0xd')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0xfd18('0x2')]},'connectedlinenum':{'type':Sequelize[_0xfd18('0x2')]},'connectedlinename':{'type':Sequelize[_0xfd18('0x2')]},'accountcode':{'type':Sequelize[_0xfd18('0x2')]},'context':{'type':Sequelize[_0xfd18('0x2')]},'exten':{'type':Sequelize[_0xfd18('0x2')]},'priority':{'type':Sequelize[_0xfd18('0x2')]},'holdtime':{'type':Sequelize[_0xfd18('0xb')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xfd18('0xc')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xfd18('0x2')]},'transfer':{'type':Sequelize[_0xfd18('0xc')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xfd18('0x2')],'comment':_0xfd18('0xe')},'transferexten':{'type':Sequelize[_0xfd18('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0xfd18('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xfd18('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0xfd18('0xb')],'defaultValue':0x0},'note':{'type':Sequelize[_0xfd18('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index 62a2620..90e0686 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 _0xcf45=['getVoiceQueuesReport','findAll','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','crypto','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','./voiceQueueReport.socket','register','sendStatus','status','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','end','error','name','send','map','VoiceQueueReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','then','includeAll','include','rows','catch','show','params','options','find','create','body','destroy','describe'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xcf45,0xfe));var _0x5cf4=function(_0x41961e,_0xa9694f){_0x41961e=_0x41961e-0x0;var _0x1e7e1e=_0xcf45[_0x41961e];return _0x1e7e1e;};'use strict';var emlformat=require(_0x5cf4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5cf4('0x1'));var jsonpatch=require(_0x5cf4('0x2'));var rp=require(_0x5cf4('0x3'));var moment=require(_0x5cf4('0x4'));var BPromise=require(_0x5cf4('0x5'));var Mustache=require(_0x5cf4('0x6'));var util=require('util');var path=require(_0x5cf4('0x7'));var sox=require('sox');var csv=require(_0x5cf4('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5cf4('0x9'));var _=require(_0x5cf4('0xa'));var squel=require(_0x5cf4('0xb'));var crypto=require(_0x5cf4('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5cf4('0x8'));var querystring=require(_0x5cf4('0xd'));var Papa=require(_0x5cf4('0xe'));var Redis=require(_0x5cf4('0xf'));var authService=require(_0x5cf4('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x5cf4('0x11'));var hardwareService=require(_0x5cf4('0x12'));var logger=require(_0x5cf4('0x13'))(_0x5cf4('0x14'));var utils=require(_0x5cf4('0x15'));var config=require(_0x5cf4('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x5cf4('0x17'))['db'];config[_0x5cf4('0x18')]=_[_0x5cf4('0x19')](config['redis'],{'host':_0x5cf4('0x1a'),'port':0x18eb});var socket=require(_0x5cf4('0x1b'))(new Redis(config[_0x5cf4('0x18')]));require(_0x5cf4('0x1c'))[_0x5cf4('0x1d')](socket);function respondWithStatusCode(_0x20e7f8,_0x36c3e4){_0x36c3e4=_0x36c3e4||0xcc;return function(_0x2a58d7){if(_0x2a58d7){return _0x20e7f8[_0x5cf4('0x1e')](_0x36c3e4);}return _0x20e7f8[_0x5cf4('0x1f')](_0x36c3e4)['end']();};}function respondWithResult(_0x496926,_0xacff46){_0xacff46=_0xacff46||0xc8;return function(_0x49d29b){if(_0x49d29b){return _0x496926['status'](_0xacff46)[_0x5cf4('0x20')](_0x49d29b);}};}function respondWithFilteredResult(_0x216bd7,_0x4cd791){return function(_0x2fde1e){if(_0x2fde1e){var _0xce3398=typeof _0x4cd791['offset']===_0x5cf4('0x21')&&typeof _0x4cd791[_0x5cf4('0x22')]===_0x5cf4('0x21');var _0x27ccb9=_0x2fde1e['count'];var _0x513b5d=_0xce3398?0x0:_0x4cd791[_0x5cf4('0x23')];var _0x4edcfb=_0xce3398?_0x2fde1e[_0x5cf4('0x24')]:_0x4cd791['offset']+_0x4cd791['limit'];var _0x3a41d2;if(_0x4edcfb>=_0x27ccb9){_0x4edcfb=_0x27ccb9;_0x3a41d2=0xc8;}else{_0x3a41d2=0xce;}_0x216bd7['status'](_0x3a41d2);return _0x216bd7[_0x5cf4('0x25')](_0x5cf4('0x26'),_0x513b5d+'-'+_0x4edcfb+'/'+_0x27ccb9)[_0x5cf4('0x20')](_0x2fde1e);}return null;};}function patchUpdates(_0x344899){return function(_0x3f451b){try{jsonpatch[_0x5cf4('0x27')](_0x3f451b,_0x344899,!![]);}catch(_0x2b98e8){return BPromise[_0x5cf4('0x28')](_0x2b98e8);}return _0x3f451b[_0x5cf4('0x29')]();};}function saveUpdates(_0x1903ee,_0x16f917){return function(_0x4236e8){if(_0x4236e8){return _0x4236e8[_0x5cf4('0x2a')](_0x1903ee)['then'](function(_0x1c5f76){return _0x1c5f76;});}return null;};}function removeEntity(_0x299517,_0x538892){return function(_0x1d20a4){if(_0x1d20a4){return _0x1d20a4['destroy']()['then'](function(){_0x299517['status'](0xcc)[_0x5cf4('0x2b')]();});}};}function handleEntityNotFound(_0x5c2a59,_0x353f6b){return function(_0x441157){if(!_0x441157){_0x5c2a59['sendStatus'](0x194);}return _0x441157;};}function handleError(_0x214d2f,_0xf808fb){_0xf808fb=_0xf808fb||0x1f4;return function(_0x27646f){logger[_0x5cf4('0x2c')](_0x27646f['stack']);if(_0x27646f[_0x5cf4('0x2d')]){delete _0x27646f[_0x5cf4('0x2d')];}_0x214d2f['status'](_0xf808fb)[_0x5cf4('0x2e')](_0x27646f);};}exports['index']=function(_0x169d6b,_0x5112d2){var _0xdc32c2={},_0x579910={},_0x1109dc={'count':0x0,'rows':[]};var _0x30a08c=_[_0x5cf4('0x2f')](db[_0x5cf4('0x30')][_0x5cf4('0x31')],function(_0x1999cb){return{'name':_0x1999cb[_0x5cf4('0x32')],'type':_0x1999cb[_0x5cf4('0x33')][_0x5cf4('0x34')]};});_0x579910[_0x5cf4('0x35')]=_['map'](_0x30a08c,_0x5cf4('0x2d'));_0x579910[_0x5cf4('0x36')]=_[_0x5cf4('0x37')](_0x169d6b[_0x5cf4('0x36')]);_0x579910['filters']=_[_0x5cf4('0x38')](_0x579910[_0x5cf4('0x35')],_0x579910['query']);_0xdc32c2[_0x5cf4('0x39')]=_[_0x5cf4('0x38')](_0x579910[_0x5cf4('0x35')],qs[_0x5cf4('0x3a')](_0x169d6b[_0x5cf4('0x36')]['fields']));_0xdc32c2[_0x5cf4('0x39')]=_0xdc32c2[_0x5cf4('0x39')][_0x5cf4('0x3b')]?_0xdc32c2[_0x5cf4('0x39')]:_0x579910[_0x5cf4('0x35')];if(!_0x169d6b[_0x5cf4('0x36')][_0x5cf4('0x3c')](_0x5cf4('0x3d'))){_0xdc32c2[_0x5cf4('0x22')]=qs[_0x5cf4('0x22')](_0x169d6b['query'][_0x5cf4('0x22')]);_0xdc32c2[_0x5cf4('0x23')]=qs['offset'](_0x169d6b[_0x5cf4('0x36')]['offset']);}_0xdc32c2[_0x5cf4('0x3e')]=qs[_0x5cf4('0x3f')](_0x169d6b[_0x5cf4('0x36')][_0x5cf4('0x3f')]);_0xdc32c2[_0x5cf4('0x40')]=qs[_0x5cf4('0x41')](_[_0x5cf4('0x42')](_0x169d6b[_0x5cf4('0x36')],_0x579910[_0x5cf4('0x41')]),_0x30a08c);if(_0x169d6b[_0x5cf4('0x36')][_0x5cf4('0x43')]){_0xdc32c2[_0x5cf4('0x40')]=_[_0x5cf4('0x44')](_0xdc32c2[_0x5cf4('0x40')],{'$or':_[_0x5cf4('0x2f')](_0x30a08c,function(_0x3b42ca){if(_0x3b42ca[_0x5cf4('0x33')]!=='VIRTUAL'){var _0x2e6124={};_0x2e6124[_0x3b42ca['name']]={'$like':'%'+_0x169d6b[_0x5cf4('0x36')]['filter']+'%'};return _0x2e6124;}})});}_0xdc32c2=_[_0x5cf4('0x44')]({},_0xdc32c2,_0x169d6b['options']);var _0x4a97e7={'where':_0xdc32c2[_0x5cf4('0x40')]};return db[_0x5cf4('0x30')][_0x5cf4('0x24')](_0x4a97e7)[_0x5cf4('0x45')](function(_0x56a3b6){_0x1109dc[_0x5cf4('0x24')]=_0x56a3b6;if(_0x169d6b[_0x5cf4('0x36')][_0x5cf4('0x46')]){_0xdc32c2[_0x5cf4('0x47')]=[{'all':!![]}];}return db[_0x5cf4('0x30')]['findAll'](_0xdc32c2);})[_0x5cf4('0x45')](function(_0x472aa0){_0x1109dc[_0x5cf4('0x48')]=_0x472aa0;return _0x1109dc;})[_0x5cf4('0x45')](respondWithFilteredResult(_0x5112d2,_0xdc32c2))[_0x5cf4('0x49')](handleError(_0x5112d2,null));};exports[_0x5cf4('0x4a')]=function(_0x5974c2,_0x29576e){var _0x36441a={'raw':![],'where':{'id':_0x5974c2[_0x5cf4('0x4b')]['id']}},_0x4f5693={};_0x4f5693[_0x5cf4('0x35')]=_[_0x5cf4('0x37')](db[_0x5cf4('0x30')]['rawAttributes']);_0x4f5693[_0x5cf4('0x36')]=_[_0x5cf4('0x37')](_0x5974c2['query']);_0x4f5693[_0x5cf4('0x41')]=_['intersection'](_0x4f5693[_0x5cf4('0x35')],_0x4f5693['query']);_0x36441a[_0x5cf4('0x39')]=_[_0x5cf4('0x38')](_0x4f5693[_0x5cf4('0x35')],qs[_0x5cf4('0x3a')](_0x5974c2['query']['fields']));_0x36441a[_0x5cf4('0x39')]=_0x36441a[_0x5cf4('0x39')][_0x5cf4('0x3b')]?_0x36441a[_0x5cf4('0x39')]:_0x4f5693[_0x5cf4('0x35')];if(_0x5974c2['query'][_0x5cf4('0x46')]){_0x36441a[_0x5cf4('0x47')]=[{'all':!![]}];}_0x36441a=_[_0x5cf4('0x44')]({},_0x36441a,_0x5974c2[_0x5cf4('0x4c')]);return db[_0x5cf4('0x30')][_0x5cf4('0x4d')](_0x36441a)['then'](handleEntityNotFound(_0x29576e,null))['then'](respondWithResult(_0x29576e,null))[_0x5cf4('0x49')](handleError(_0x29576e,null));};exports[_0x5cf4('0x4e')]=function(_0x3b5a02,_0x209cdf){return db[_0x5cf4('0x30')][_0x5cf4('0x4e')](_0x3b5a02[_0x5cf4('0x4f')],{})[_0x5cf4('0x45')](respondWithResult(_0x209cdf,0xc9))[_0x5cf4('0x49')](handleError(_0x209cdf,null));};exports[_0x5cf4('0x2a')]=function(_0x2ea3fc,_0x52611b){if(_0x2ea3fc['body']['id']){delete _0x2ea3fc['body']['id'];}return db[_0x5cf4('0x30')][_0x5cf4('0x4d')]({'where':{'id':_0x2ea3fc[_0x5cf4('0x4b')]['id']}})[_0x5cf4('0x45')](handleEntityNotFound(_0x52611b,null))['then'](saveUpdates(_0x2ea3fc[_0x5cf4('0x4f')],null))[_0x5cf4('0x45')](respondWithResult(_0x52611b,null))[_0x5cf4('0x49')](handleError(_0x52611b,null));};exports[_0x5cf4('0x50')]=function(_0x18d02b,_0x1362d8){return db[_0x5cf4('0x30')][_0x5cf4('0x4d')]({'where':{'id':_0x18d02b[_0x5cf4('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1362d8,null))[_0x5cf4('0x45')](removeEntity(_0x1362d8,null))[_0x5cf4('0x49')](handleError(_0x1362d8,null));};exports[_0x5cf4('0x51')]=function(_0x399bad,_0x35a8a6){return db['VoiceQueueReport']['describe']()[_0x5cf4('0x45')](respondWithResult(_0x35a8a6,null))[_0x5cf4('0x49')](handleError(_0x35a8a6,null));};exports[_0x5cf4('0x52')]=function(_0x4b72d6,_0x37c7ac){var _0x4cc04e={},_0x22f5d5={},_0x503de1={'count':0x0,'rows':[]};_0x22f5d5[_0x5cf4('0x35')]=_['keys'](db[_0x5cf4('0x30')][_0x5cf4('0x31')]);_0x22f5d5[_0x5cf4('0x36')]=_[_0x5cf4('0x37')](_0x4b72d6[_0x5cf4('0x36')]);_0x22f5d5[_0x5cf4('0x41')]=_['intersection'](_0x22f5d5[_0x5cf4('0x35')],_0x22f5d5['query']);_0x4cc04e[_0x5cf4('0x39')]=_[_0x5cf4('0x38')](_0x22f5d5[_0x5cf4('0x35')],qs[_0x5cf4('0x3a')](_0x4b72d6['query'][_0x5cf4('0x3a')]));_0x4cc04e['attributes']=_0x4cc04e[_0x5cf4('0x39')][_0x5cf4('0x3b')]?_0x4cc04e['attributes']:_0x22f5d5[_0x5cf4('0x35')];if(!_0x4b72d6[_0x5cf4('0x36')][_0x5cf4('0x3c')](_0x5cf4('0x3d'))){_0x4cc04e[_0x5cf4('0x22')]=qs['limit'](_0x4b72d6['query'][_0x5cf4('0x22')]);_0x4cc04e[_0x5cf4('0x23')]=qs['offset'](_0x4b72d6['query']['offset']);}_0x4cc04e['order']=qs[_0x5cf4('0x3f')](_0x4b72d6[_0x5cf4('0x36')][_0x5cf4('0x3f')]);_0x4cc04e['where']=qs[_0x5cf4('0x41')](_['pick'](_0x4b72d6['query'],_0x22f5d5['filters']));if(_0x4b72d6[_0x5cf4('0x36')][_0x5cf4('0x43')]){_0x4cc04e[_0x5cf4('0x40')]=_['merge'](_0x4cc04e['where'],{'$or':_['map'](_0x4cc04e['attributes'],function(_0x6a3e3a){var _0x41bad1={};_0x41bad1[_0x6a3e3a]={'$like':'%'+_0x4b72d6['query'][_0x5cf4('0x43')]+'%'};return _0x41bad1;})});}_0x4cc04e=_['merge']({},_0x4cc04e,_0x4b72d6['options']);var _0x7d290c={'where':_0x4cc04e[_0x5cf4('0x40')]};return db[_0x5cf4('0x30')][_0x5cf4('0x24')](_0x7d290c)[_0x5cf4('0x45')](function(_0x554eeb){_0x503de1[_0x5cf4('0x24')]=_0x554eeb;if(_0x4b72d6[_0x5cf4('0x36')][_0x5cf4('0x46')]){_0x4cc04e[_0x5cf4('0x47')]=[{'all':!![]}];}return db[_0x5cf4('0x30')][_0x5cf4('0x53')](_0x4cc04e);})[_0x5cf4('0x45')](function(_0x263e02){_0x503de1[_0x5cf4('0x48')]=_0x263e02;return _0x503de1;})[_0x5cf4('0x45')](respondWithFilteredResult(_0x37c7ac,_0x4cc04e,_0x5cf4('0x52')))[_0x5cf4('0x49')](handleError(_0x37c7ac,null,_0x5cf4('0x52')));}; \ No newline at end of file +var _0x09cf=['VoiceQueueReport','rawAttributes','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','filter','options','include','findAll','rows','params','find','create','body','catch','update','describe','getVoiceQueuesReport','nolimit','includeAll','eml-format','zip-dir','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./voiceQueueReport.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','error','stack','name','send','map'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x09cf,0x117));var _0xf09c=function(_0x14f6b8,_0x2d9f1d){_0x14f6b8=_0x14f6b8-0x0;var _0x1efccf=_0x09cf[_0x14f6b8];return _0x1efccf;};'use strict';var emlformat=require(_0xf09c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf09c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf09c('0x2'));var moment=require(_0xf09c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf09c('0x4'));var util=require(_0xf09c('0x5'));var path=require(_0xf09c('0x6'));var sox=require('sox');var csv=require(_0xf09c('0x7'));var ejs=require(_0xf09c('0x8'));var fs=require('fs');var fs_extra=require(_0xf09c('0x9'));var _=require('lodash');var squel=require(_0xf09c('0xa'));var crypto=require(_0xf09c('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xf09c('0xc'));var toCsv=require(_0xf09c('0x7'));var querystring=require(_0xf09c('0xd'));var Papa=require(_0xf09c('0xe'));var Redis=require(_0xf09c('0xf'));var authService=require(_0xf09c('0x10'));var qs=require(_0xf09c('0x11'));var as=require(_0xf09c('0x12'));var hardwareService=require(_0xf09c('0x13'));var logger=require(_0xf09c('0x14'))(_0xf09c('0x15'));var utils=require(_0xf09c('0x16'));var config=require(_0xf09c('0x17'));var licenseUtil=require(_0xf09c('0x18'));var db=require(_0xf09c('0x19'))['db'];config[_0xf09c('0x1a')]=_['defaults'](config[_0xf09c('0x1a')],{'host':_0xf09c('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xf09c('0x1c'))[_0xf09c('0x1d')](socket);function respondWithStatusCode(_0x3a3461,_0x2719df){_0x2719df=_0x2719df||0xcc;return function(_0x156661){if(_0x156661){return _0x3a3461[_0xf09c('0x1e')](_0x2719df);}return _0x3a3461[_0xf09c('0x1f')](_0x2719df)[_0xf09c('0x20')]();};}function respondWithResult(_0x1730e1,_0x4228a9){_0x4228a9=_0x4228a9||0xc8;return function(_0x99a391){if(_0x99a391){return _0x1730e1['status'](_0x4228a9)[_0xf09c('0x21')](_0x99a391);}};}function respondWithFilteredResult(_0x294b65,_0x371392){return function(_0x238f68){if(_0x238f68){var _0x34f5ca=typeof _0x371392['offset']===_0xf09c('0x22')&&typeof _0x371392[_0xf09c('0x23')]==='undefined';var _0x3c13f8=_0x238f68[_0xf09c('0x24')];var _0x312be8=_0x34f5ca?0x0:_0x371392[_0xf09c('0x25')];var _0x2d37d5=_0x34f5ca?_0x238f68['count']:_0x371392['offset']+_0x371392['limit'];var _0x118a61;if(_0x2d37d5>=_0x3c13f8){_0x2d37d5=_0x3c13f8;_0x118a61=0xc8;}else{_0x118a61=0xce;}_0x294b65[_0xf09c('0x1f')](_0x118a61);return _0x294b65['set'](_0xf09c('0x26'),_0x312be8+'-'+_0x2d37d5+'/'+_0x3c13f8)[_0xf09c('0x21')](_0x238f68);}return null;};}function patchUpdates(_0x44d5fc){return function(_0x4106be){try{jsonpatch[_0xf09c('0x27')](_0x4106be,_0x44d5fc,!![]);}catch(_0xe7dfce){return BPromise[_0xf09c('0x28')](_0xe7dfce);}return _0x4106be[_0xf09c('0x29')]();};}function saveUpdates(_0x41d75a,_0x343499){return function(_0x250084){if(_0x250084){return _0x250084['update'](_0x41d75a)['then'](function(_0x572866){return _0x572866;});}return null;};}function removeEntity(_0x4f2f9d,_0x369c57){return function(_0x3b8adf){if(_0x3b8adf){return _0x3b8adf[_0xf09c('0x2a')]()[_0xf09c('0x2b')](function(){_0x4f2f9d[_0xf09c('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3eaa9e,_0x192606){return function(_0x4c32b7){if(!_0x4c32b7){_0x3eaa9e[_0xf09c('0x1e')](0x194);}return _0x4c32b7;};}function handleError(_0x39ab53,_0x537a00){_0x537a00=_0x537a00||0x1f4;return function(_0x232286){logger[_0xf09c('0x2c')](_0x232286[_0xf09c('0x2d')]);if(_0x232286[_0xf09c('0x2e')]){delete _0x232286['name'];}_0x39ab53['status'](_0x537a00)[_0xf09c('0x2f')](_0x232286);};}exports['index']=function(_0x58b370,_0x58a710){var _0x12aee0={},_0x839f0e={},_0x21384f={'count':0x0,'rows':[]};var _0x228fd0=_[_0xf09c('0x30')](db[_0xf09c('0x31')][_0xf09c('0x32')],function(_0x5a0c50){return{'name':_0x5a0c50['fieldName'],'type':_0x5a0c50[_0xf09c('0x33')][_0xf09c('0x34')]};});_0x839f0e[_0xf09c('0x35')]=_['map'](_0x228fd0,_0xf09c('0x2e'));_0x839f0e['query']=_[_0xf09c('0x36')](_0x58b370[_0xf09c('0x37')]);_0x839f0e[_0xf09c('0x38')]=_[_0xf09c('0x39')](_0x839f0e[_0xf09c('0x35')],_0x839f0e[_0xf09c('0x37')]);_0x12aee0['attributes']=_[_0xf09c('0x39')](_0x839f0e[_0xf09c('0x35')],qs[_0xf09c('0x3a')](_0x58b370[_0xf09c('0x37')][_0xf09c('0x3a')]));_0x12aee0['attributes']=_0x12aee0[_0xf09c('0x3b')][_0xf09c('0x3c')]?_0x12aee0[_0xf09c('0x3b')]:_0x839f0e[_0xf09c('0x35')];if(!_0x58b370['query'][_0xf09c('0x3d')]('nolimit')){_0x12aee0['limit']=qs[_0xf09c('0x23')](_0x58b370[_0xf09c('0x37')][_0xf09c('0x23')]);_0x12aee0['offset']=qs[_0xf09c('0x25')](_0x58b370[_0xf09c('0x37')]['offset']);}_0x12aee0[_0xf09c('0x3e')]=qs['sort'](_0x58b370[_0xf09c('0x37')][_0xf09c('0x3f')]);_0x12aee0[_0xf09c('0x40')]=qs['filters'](_[_0xf09c('0x41')](_0x58b370[_0xf09c('0x37')],_0x839f0e[_0xf09c('0x38')]),_0x228fd0);if(_0x58b370[_0xf09c('0x37')]['filter']){_0x12aee0[_0xf09c('0x40')]=_[_0xf09c('0x42')](_0x12aee0[_0xf09c('0x40')],{'$or':_['map'](_0x228fd0,function(_0x6c34b9){if(_0x6c34b9['type']!=='VIRTUAL'){var _0xc88cf2={};_0xc88cf2[_0x6c34b9[_0xf09c('0x2e')]]={'$like':'%'+_0x58b370[_0xf09c('0x37')][_0xf09c('0x43')]+'%'};return _0xc88cf2;}})});}_0x12aee0=_[_0xf09c('0x42')]({},_0x12aee0,_0x58b370[_0xf09c('0x44')]);var _0x2e2541={'where':_0x12aee0[_0xf09c('0x40')]};return db[_0xf09c('0x31')][_0xf09c('0x24')](_0x2e2541)[_0xf09c('0x2b')](function(_0x1af08a){_0x21384f[_0xf09c('0x24')]=_0x1af08a;if(_0x58b370[_0xf09c('0x37')]['includeAll']){_0x12aee0[_0xf09c('0x45')]=[{'all':!![]}];}return db[_0xf09c('0x31')][_0xf09c('0x46')](_0x12aee0);})[_0xf09c('0x2b')](function(_0x369854){_0x21384f[_0xf09c('0x47')]=_0x369854;return _0x21384f;})[_0xf09c('0x2b')](respondWithFilteredResult(_0x58a710,_0x12aee0))['catch'](handleError(_0x58a710,null));};exports['show']=function(_0x994917,_0x2c54f8){var _0x47d78a={'raw':![],'where':{'id':_0x994917[_0xf09c('0x48')]['id']}},_0x480a25={};_0x480a25[_0xf09c('0x35')]=_[_0xf09c('0x36')](db[_0xf09c('0x31')]['rawAttributes']);_0x480a25[_0xf09c('0x37')]=_[_0xf09c('0x36')](_0x994917[_0xf09c('0x37')]);_0x480a25[_0xf09c('0x38')]=_[_0xf09c('0x39')](_0x480a25[_0xf09c('0x35')],_0x480a25['query']);_0x47d78a[_0xf09c('0x3b')]=_[_0xf09c('0x39')](_0x480a25[_0xf09c('0x35')],qs[_0xf09c('0x3a')](_0x994917['query'][_0xf09c('0x3a')]));_0x47d78a[_0xf09c('0x3b')]=_0x47d78a[_0xf09c('0x3b')][_0xf09c('0x3c')]?_0x47d78a[_0xf09c('0x3b')]:_0x480a25['model'];if(_0x994917[_0xf09c('0x37')]['includeAll']){_0x47d78a[_0xf09c('0x45')]=[{'all':!![]}];}_0x47d78a=_['merge']({},_0x47d78a,_0x994917[_0xf09c('0x44')]);return db[_0xf09c('0x31')][_0xf09c('0x49')](_0x47d78a)[_0xf09c('0x2b')](handleEntityNotFound(_0x2c54f8,null))[_0xf09c('0x2b')](respondWithResult(_0x2c54f8,null))['catch'](handleError(_0x2c54f8,null));};exports[_0xf09c('0x4a')]=function(_0x147d39,_0x48fba2){return db[_0xf09c('0x31')][_0xf09c('0x4a')](_0x147d39[_0xf09c('0x4b')],{})[_0xf09c('0x2b')](respondWithResult(_0x48fba2,0xc9))[_0xf09c('0x4c')](handleError(_0x48fba2,null));};exports[_0xf09c('0x4d')]=function(_0x101209,_0x118202){if(_0x101209[_0xf09c('0x4b')]['id']){delete _0x101209[_0xf09c('0x4b')]['id'];}return db[_0xf09c('0x31')][_0xf09c('0x49')]({'where':{'id':_0x101209[_0xf09c('0x48')]['id']}})[_0xf09c('0x2b')](handleEntityNotFound(_0x118202,null))['then'](saveUpdates(_0x101209['body'],null))[_0xf09c('0x2b')](respondWithResult(_0x118202,null))['catch'](handleError(_0x118202,null));};exports[_0xf09c('0x2a')]=function(_0x12ddf4,_0x5e6ec){return db[_0xf09c('0x31')]['find']({'where':{'id':_0x12ddf4[_0xf09c('0x48')]['id']}})[_0xf09c('0x2b')](handleEntityNotFound(_0x5e6ec,null))[_0xf09c('0x2b')](removeEntity(_0x5e6ec,null))['catch'](handleError(_0x5e6ec,null));};exports['describe']=function(_0x1f512e,_0x27fa99){return db[_0xf09c('0x31')][_0xf09c('0x4e')]()[_0xf09c('0x2b')](respondWithResult(_0x27fa99,null))[_0xf09c('0x4c')](handleError(_0x27fa99,null));};exports[_0xf09c('0x4f')]=function(_0xfdeb6a,_0x509ea3){var _0x7f9563={},_0x335a67={},_0x309dea={'count':0x0,'rows':[]};_0x335a67['model']=_[_0xf09c('0x36')](db[_0xf09c('0x31')][_0xf09c('0x32')]);_0x335a67['query']=_[_0xf09c('0x36')](_0xfdeb6a[_0xf09c('0x37')]);_0x335a67[_0xf09c('0x38')]=_[_0xf09c('0x39')](_0x335a67[_0xf09c('0x35')],_0x335a67[_0xf09c('0x37')]);_0x7f9563[_0xf09c('0x3b')]=_[_0xf09c('0x39')](_0x335a67['model'],qs[_0xf09c('0x3a')](_0xfdeb6a[_0xf09c('0x37')]['fields']));_0x7f9563['attributes']=_0x7f9563[_0xf09c('0x3b')]['length']?_0x7f9563[_0xf09c('0x3b')]:_0x335a67['model'];if(!_0xfdeb6a[_0xf09c('0x37')]['hasOwnProperty'](_0xf09c('0x50'))){_0x7f9563[_0xf09c('0x23')]=qs['limit'](_0xfdeb6a[_0xf09c('0x37')][_0xf09c('0x23')]);_0x7f9563['offset']=qs[_0xf09c('0x25')](_0xfdeb6a[_0xf09c('0x37')][_0xf09c('0x25')]);}_0x7f9563[_0xf09c('0x3e')]=qs[_0xf09c('0x3f')](_0xfdeb6a[_0xf09c('0x37')]['sort']);_0x7f9563[_0xf09c('0x40')]=qs[_0xf09c('0x38')](_[_0xf09c('0x41')](_0xfdeb6a[_0xf09c('0x37')],_0x335a67[_0xf09c('0x38')]));if(_0xfdeb6a[_0xf09c('0x37')][_0xf09c('0x43')]){_0x7f9563['where']=_['merge'](_0x7f9563[_0xf09c('0x40')],{'$or':_[_0xf09c('0x30')](_0x7f9563[_0xf09c('0x3b')],function(_0x31d619){var _0x55393e={};_0x55393e[_0x31d619]={'$like':'%'+_0xfdeb6a['query'][_0xf09c('0x43')]+'%'};return _0x55393e;})});}_0x7f9563=_['merge']({},_0x7f9563,_0xfdeb6a[_0xf09c('0x44')]);var _0x2bd913={'where':_0x7f9563[_0xf09c('0x40')]};return db['VoiceQueueReport']['count'](_0x2bd913)[_0xf09c('0x2b')](function(_0x34d533){_0x309dea[_0xf09c('0x24')]=_0x34d533;if(_0xfdeb6a[_0xf09c('0x37')][_0xf09c('0x51')]){_0x7f9563[_0xf09c('0x45')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0xf09c('0x46')](_0x7f9563);})['then'](function(_0x5757bc){_0x309dea['rows']=_0x5757bc;return _0x309dea;})[_0xf09c('0x2b')](respondWithFilteredResult(_0x509ea3,_0x7f9563,_0xf09c('0x4f')))[_0xf09c('0x4c')](handleError(_0x509ea3,null,_0xf09c('0x4f')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index fd195bf..a16e25f 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 _0xd3a5=['hasOwnProperty','exports','events','../../mysqldb','VoiceQueueReport','setMaxListeners','update','remove','emit'];(function(_0x69a748,_0x7e2ee1){var _0x116db0=function(_0x67e3ab){while(--_0x67e3ab){_0x69a748['push'](_0x69a748['shift']());}};_0x116db0(++_0x7e2ee1);}(_0xd3a5,0x1cd));var _0x5d3a=function(_0x5aba03,_0x161ec6){_0x5aba03=_0x5aba03-0x0;var _0x24d080=_0xd3a5[_0x5aba03];return _0x24d080;};'use strict';var EventEmitter=require(_0x5d3a('0x0'));var VoiceQueueReport=require(_0x5d3a('0x1'))['db'][_0x5d3a('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x5d3a('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5d3a('0x4'),'afterDestroy':_0x5d3a('0x5')};function emitEvent(_0x413206){return function(_0xd8f941,_0x568955,_0x49bc4f){VoiceQueueReportEvents['emit'](_0x413206+':'+_0xd8f941['id'],_0xd8f941);VoiceQueueReportEvents[_0x5d3a('0x6')](_0x413206,_0xd8f941);_0x49bc4f(null);};}for(var e in events){if(events[_0x5d3a('0x7')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0x5d3a('0x8')]=VoiceQueueReportEvents; \ No newline at end of file +var _0xe2f4=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','update','remove'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xe2f4,0x100));var _0x4e2f=function(_0x29f48c,_0x125e1f){_0x29f48c=_0x29f48c-0x0;var _0x1816d1=_0xe2f4[_0x29f48c];return _0x1816d1;};'use strict';var EventEmitter=require(_0x4e2f('0x0'));var VoiceQueueReport=require(_0x4e2f('0x1'))['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x4e2f('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4e2f('0x3'),'afterDestroy':_0x4e2f('0x4')};function emitEvent(_0x544da0){return function(_0x38b6b7,_0x298e95,_0x3fb141){VoiceQueueReportEvents['emit'](_0x544da0+':'+_0x38b6b7['id'],_0x38b6b7);VoiceQueueReportEvents[_0x4e2f('0x5')](_0x544da0,_0x38b6b7);_0x3fb141(null);};}for(var e in events){if(events[_0x4e2f('0x6')](e)){var event=events[e];VoiceQueueReport[_0x4e2f('0x7')](e,emitEvent(event));}}module[_0x4e2f('0x8')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 319afbb..95351c4 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 _0x2d0b=['define','VoiceQueueReport','uniqueid','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./voiceQueueReport.attributes'];(function(_0xf51c06,_0x388e5b){var _0x1d5420=function(_0x5e077b){while(--_0x5e077b){_0xf51c06['push'](_0xf51c06['shift']());}};_0x1d5420(++_0x388e5b);}(_0x2d0b,0x116));var _0xb2d0=function(_0x3e457a,_0x5445c3){_0x3e457a=_0x3e457a-0x0;var _0x1dac81=_0x2d0b[_0x3e457a];return _0x1dac81;};'use strict';var _=require(_0xb2d0('0x0'));var util=require(_0xb2d0('0x1'));var logger=require(_0xb2d0('0x2'))('api');var moment=require('moment');var BPromise=require(_0xb2d0('0x3'));var rp=require(_0xb2d0('0x4'));var fs=require('fs');var path=require(_0xb2d0('0x5'));var rimraf=require(_0xb2d0('0x6'));var config=require('../../config/environment');var attributes=require(_0xb2d0('0x7'));module['exports']=function(_0x2a9490,_0x4fb87d){return _0x2a9490[_0xb2d0('0x8')](_0xb2d0('0x9'),attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':[_0xb2d0('0xa')]},{'fields':['calleridnum']}],'timestamps':!![]});}; \ No newline at end of file +var _0x4dd8=['lodash','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue','uniqueid','calleridnum'];(function(_0x260117,_0x4afbde){var _0x497f33=function(_0x15b181){while(--_0x15b181){_0x260117['push'](_0x260117['shift']());}};_0x497f33(++_0x4afbde);}(_0x4dd8,0x15e));var _0x84dd=function(_0x5315b4,_0x1b4e72){_0x5315b4=_0x5315b4-0x0;var _0x2f6106=_0x4dd8[_0x5315b4];return _0x2f6106;};'use strict';var _=require(_0x84dd('0x0'));var util=require(_0x84dd('0x1'));var logger=require(_0x84dd('0x2'))('api');var moment=require('moment');var BPromise=require(_0x84dd('0x3'));var rp=require(_0x84dd('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x84dd('0x5'));var config=require(_0x84dd('0x6'));var attributes=require(_0x84dd('0x7'));module[_0x84dd('0x8')]=function(_0x4057d3,_0xd9774d){return _0x4057d3[_0x84dd('0x9')](_0x84dd('0xa'),attributes,{'tableName':_0x84dd('0xb'),'paranoid':![],'indexes':[{'fields':[_0x84dd('0xc')]},{'fields':[_0x84dd('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index d4e8406..fa15ff0 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 _0x1695=['options','raw','where','attributes','include','map','model','then','debug','GetVoiceQueueReport','CreateVoiceQueueReport','create','body','update','limit','UpdateVoiceQueueReport','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','redis','defaults','localhost','./voiceQueueReport.socket','request','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','VoiceQueueReport','findAll'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x1695,0x136));var _0x5169=function(_0x57c547,_0x54ca70){_0x57c547=_0x57c547-0x0;var _0x42785e=_0x1695[_0x57c547];return _0x42785e;};'use strict';var _=require(_0x5169('0x0'));var util=require('util');var moment=require(_0x5169('0x1'));var BPromise=require(_0x5169('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5169('0x3'));var db=require(_0x5169('0x4'))['db'];var utils=require(_0x5169('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x5169('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x5169('0x7')][_0x5169('0x8')]({'port':0x232a});config[_0x5169('0x9')]=_[_0x5169('0xa')](config[_0x5169('0x9')],{'host':_0x5169('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5169('0x9')]));require(_0x5169('0xc'))['register'](socket);function respondWithRpcPromise(_0x114696,_0x274d9f,_0x162bee){return new BPromise(function(_0x5f001e,_0x3edfd9){return client[_0x5169('0xd')](_0x114696,_0x162bee)['then'](function(_0x4d6de1){logger[_0x5169('0xe')](_0x5169('0xf'),_0x274d9f,_0x5169('0x10'));logger['debug'](_0x5169('0x11'),_0x274d9f,'request\x20sent',JSON[_0x5169('0x12')](_0x4d6de1));if(_0x4d6de1['error']){if(_0x4d6de1[_0x5169('0x13')][_0x5169('0x14')]===0x1f4){logger[_0x5169('0x13')]('VoiceQueueReport,\x20%s,\x20%s',_0x274d9f,_0x4d6de1['error'][_0x5169('0x15')]);return _0x3edfd9(_0x4d6de1[_0x5169('0x13')][_0x5169('0x15')]);}logger[_0x5169('0x13')]('VoiceQueueReport,\x20%s,\x20%s',_0x274d9f,_0x4d6de1[_0x5169('0x13')][_0x5169('0x15')]);return _0x5f001e(_0x4d6de1[_0x5169('0x13')][_0x5169('0x15')]);}else{logger['info']('VoiceQueueReport,\x20%s,\x20%s',_0x274d9f,_0x5169('0x10'));_0x5f001e(_0x4d6de1[_0x5169('0x16')]['message']);}})[_0x5169('0x17')](function(_0x4aa0c6){logger[_0x5169('0x13')](_0x5169('0xf'),_0x274d9f,_0x4aa0c6);_0x3edfd9(_0x4aa0c6);});});}exports['GetVoiceQueueReport']=function(_0x202ff6){var _0x4b3d1f=this;return new Promise(function(_0x3e5160,_0x348198){return db[_0x5169('0x18')][_0x5169('0x19')]({'raw':_0x202ff6[_0x5169('0x1a')]?_0x202ff6[_0x5169('0x1a')][_0x5169('0x1b')]===undefined?!![]:![]:!![],'where':_0x202ff6[_0x5169('0x1a')]?_0x202ff6[_0x5169('0x1a')][_0x5169('0x1c')]||null:null,'attributes':_0x202ff6['options']?_0x202ff6[_0x5169('0x1a')][_0x5169('0x1d')]||null:null,'limit':_0x202ff6[_0x5169('0x1a')]?_0x202ff6[_0x5169('0x1a')]['limit']||null:null,'include':_0x202ff6[_0x5169('0x1a')]?_0x202ff6['options'][_0x5169('0x1e')]?_[_0x5169('0x1f')](_0x202ff6[_0x5169('0x1a')][_0x5169('0x1e')],function(_0x24d773){return{'model':db[_0x24d773[_0x5169('0x20')]],'as':_0x24d773['as'],'attributes':_0x24d773[_0x5169('0x1d')],'include':_0x24d773['include']?_[_0x5169('0x1f')](_0x24d773[_0x5169('0x1e')],function(_0x2db996){return{'model':db[_0x2db996['model']],'as':_0x2db996['as'],'attributes':_0x2db996[_0x5169('0x1d')],'include':_0x2db996[_0x5169('0x1e')]?_['map'](_0x2db996[_0x5169('0x1e')],function(_0x1273aa){return{'model':db[_0x1273aa[_0x5169('0x20')]],'as':_0x1273aa['as'],'attributes':_0x1273aa[_0x5169('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x5169('0x21')](function(_0x4a0cbe){logger[_0x5169('0xe')]('GetVoiceQueueReport',_0x202ff6);logger[_0x5169('0x22')]('GetVoiceQueueReport',_0x202ff6,JSON[_0x5169('0x12')](_0x4a0cbe));_0x3e5160(_0x4a0cbe);})[_0x5169('0x17')](function(_0x5cd491){logger[_0x5169('0x13')](_0x5169('0x23'),_0x5cd491[_0x5169('0x15')],_0x202ff6);_0x348198(_0x4b3d1f[_0x5169('0x13')](0x1f4,_0x5cd491[_0x5169('0x15')]));});});};exports[_0x5169('0x24')]=function(_0x1e2601){var _0x39444c=this;return new Promise(function(_0x4f6346,_0x5ae119){return db[_0x5169('0x18')][_0x5169('0x25')](_0x1e2601[_0x5169('0x26')],{'raw':_0x1e2601[_0x5169('0x1a')]?_0x1e2601['options']['raw']===undefined?!![]:![]:!![]})[_0x5169('0x21')](function(_0x283642){logger['info'](_0x5169('0x24'),_0x1e2601);logger[_0x5169('0x22')](_0x5169('0x24'),_0x1e2601,JSON[_0x5169('0x12')](_0x283642));_0x4f6346(_0x283642);})['catch'](function(_0x3a2e3f){logger[_0x5169('0x13')](_0x5169('0x24'),_0x3a2e3f[_0x5169('0x15')],_0x1e2601);_0x5ae119(_0x39444c[_0x5169('0x13')](0x1f4,_0x3a2e3f[_0x5169('0x15')]));});});};exports['UpdateVoiceQueueReport']=function(_0x4aaad8){var _0x56e20d=this;return new Promise(function(_0x65cfe3,_0x30a16c){return db[_0x5169('0x18')][_0x5169('0x27')](_0x4aaad8['body'],{'raw':_0x4aaad8[_0x5169('0x1a')]?_0x4aaad8[_0x5169('0x1a')][_0x5169('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4aaad8[_0x5169('0x1a')]?_0x4aaad8['options'][_0x5169('0x1c')]||null:null,'attributes':_0x4aaad8[_0x5169('0x1a')]?_0x4aaad8[_0x5169('0x1a')][_0x5169('0x1d')]||null:null,'limit':_0x4aaad8[_0x5169('0x1a')]?_0x4aaad8[_0x5169('0x1a')][_0x5169('0x28')]||null:null})['then'](function(_0x4d522d){logger[_0x5169('0xe')]('UpdateVoiceQueueReport',_0x4aaad8);logger[_0x5169('0x22')]('UpdateVoiceQueueReport',_0x4aaad8,JSON[_0x5169('0x12')](_0x4d522d));_0x65cfe3(_0x4d522d);})[_0x5169('0x17')](function(_0x1fe986){logger[_0x5169('0x13')](_0x5169('0x29'),_0x1fe986[_0x5169('0x15')],_0x4aaad8);_0x30a16c(_0x56e20d['error'](0x1f4,_0x1fe986[_0x5169('0x15')]));});});}; \ No newline at end of file +var _0xc24b=['VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','options','raw','where','attributes','limit','include','map','model','CreateVoiceQueueReport','create','body','UpdateVoiceQueueReport','update','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x240273,_0x53ef2b){var _0x50373a=function(_0x2eb5c9){while(--_0x2eb5c9){_0x240273['push'](_0x240273['shift']());}};_0x50373a(++_0x53ef2b);}(_0xc24b,0x6e));var _0xbc24=function(_0x19f9e6,_0x4f59a6){_0x19f9e6=_0x19f9e6-0x0;var _0x45c862=_0xc24b[_0x19f9e6];return _0x45c862;};'use strict';var _=require(_0xbc24('0x0'));var util=require(_0xbc24('0x1'));var moment=require('moment');var BPromise=require(_0xbc24('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbc24('0x3'));var db=require(_0xbc24('0x4'))['db'];var utils=require(_0xbc24('0x5'));var logger=require(_0xbc24('0x6'))(_0xbc24('0x7'));var config=require(_0xbc24('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xbc24('0x9')][_0xbc24('0xa')]({'port':0x232a});config[_0xbc24('0xb')]=_['defaults'](config[_0xbc24('0xb')],{'host':_0xbc24('0xc'),'port':0x18eb});var socket=require(_0xbc24('0xd'))(new Redis(config[_0xbc24('0xb')]));require(_0xbc24('0xe'))[_0xbc24('0xf')](socket);function respondWithRpcPromise(_0x4cad3b,_0x3c25f8,_0x562675){return new BPromise(function(_0x8bb9b7,_0xf432a0){return client[_0xbc24('0x10')](_0x4cad3b,_0x562675)[_0xbc24('0x11')](function(_0x55d298){logger[_0xbc24('0x12')](_0xbc24('0x13'),_0x3c25f8,_0xbc24('0x14'));logger[_0xbc24('0x15')](_0xbc24('0x16'),_0x3c25f8,_0xbc24('0x14'),JSON[_0xbc24('0x17')](_0x55d298));if(_0x55d298[_0xbc24('0x18')]){if(_0x55d298[_0xbc24('0x18')][_0xbc24('0x19')]===0x1f4){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x3c25f8,_0x55d298[_0xbc24('0x18')][_0xbc24('0x1a')]);return _0xf432a0(_0x55d298[_0xbc24('0x18')][_0xbc24('0x1a')]);}logger[_0xbc24('0x18')]('VoiceQueueReport,\x20%s,\x20%s',_0x3c25f8,_0x55d298[_0xbc24('0x18')][_0xbc24('0x1a')]);return _0x8bb9b7(_0x55d298[_0xbc24('0x18')][_0xbc24('0x1a')]);}else{logger[_0xbc24('0x12')](_0xbc24('0x13'),_0x3c25f8,_0xbc24('0x14'));_0x8bb9b7(_0x55d298[_0xbc24('0x1b')][_0xbc24('0x1a')]);}})[_0xbc24('0x1c')](function(_0x3d7124){logger[_0xbc24('0x18')](_0xbc24('0x13'),_0x3c25f8,_0x3d7124);_0xf432a0(_0x3d7124);});});}exports[_0xbc24('0x1d')]=function(_0x40a54e){var _0x38bc03=this;return new Promise(function(_0x43ad64,_0x2bbd82){return db[_0xbc24('0x1e')]['findAll']({'raw':_0x40a54e[_0xbc24('0x1f')]?_0x40a54e['options'][_0xbc24('0x20')]===undefined?!![]:![]:!![],'where':_0x40a54e[_0xbc24('0x1f')]?_0x40a54e['options'][_0xbc24('0x21')]||null:null,'attributes':_0x40a54e['options']?_0x40a54e['options'][_0xbc24('0x22')]||null:null,'limit':_0x40a54e[_0xbc24('0x1f')]?_0x40a54e[_0xbc24('0x1f')][_0xbc24('0x23')]||null:null,'include':_0x40a54e[_0xbc24('0x1f')]?_0x40a54e[_0xbc24('0x1f')][_0xbc24('0x24')]?_['map'](_0x40a54e['options']['include'],function(_0xa5ede0){return{'model':db[_0xa5ede0['model']],'as':_0xa5ede0['as'],'attributes':_0xa5ede0[_0xbc24('0x22')],'include':_0xa5ede0[_0xbc24('0x24')]?_[_0xbc24('0x25')](_0xa5ede0[_0xbc24('0x24')],function(_0x57f243){return{'model':db[_0x57f243[_0xbc24('0x26')]],'as':_0x57f243['as'],'attributes':_0x57f243[_0xbc24('0x22')],'include':_0x57f243[_0xbc24('0x24')]?_[_0xbc24('0x25')](_0x57f243[_0xbc24('0x24')],function(_0x3706a6){return{'model':db[_0x3706a6['model']],'as':_0x3706a6['as'],'attributes':_0x3706a6[_0xbc24('0x22')]};}):[]};}):[]};}):[]:[]})[_0xbc24('0x11')](function(_0x2f87cf){logger['info'](_0xbc24('0x1d'),_0x40a54e);logger[_0xbc24('0x15')](_0xbc24('0x1d'),_0x40a54e,JSON[_0xbc24('0x17')](_0x2f87cf));_0x43ad64(_0x2f87cf);})[_0xbc24('0x1c')](function(_0x548979){logger[_0xbc24('0x18')](_0xbc24('0x1d'),_0x548979[_0xbc24('0x1a')],_0x40a54e);_0x2bbd82(_0x38bc03[_0xbc24('0x18')](0x1f4,_0x548979[_0xbc24('0x1a')]));});});};exports[_0xbc24('0x27')]=function(_0x5f4b2d){var _0x11d273=this;return new Promise(function(_0x512a40,_0x3a6eef){return db[_0xbc24('0x1e')][_0xbc24('0x28')](_0x5f4b2d[_0xbc24('0x29')],{'raw':_0x5f4b2d[_0xbc24('0x1f')]?_0x5f4b2d[_0xbc24('0x1f')][_0xbc24('0x20')]===undefined?!![]:![]:!![]})[_0xbc24('0x11')](function(_0x1c2cbc){logger[_0xbc24('0x12')](_0xbc24('0x27'),_0x5f4b2d);logger[_0xbc24('0x15')](_0xbc24('0x27'),_0x5f4b2d,JSON[_0xbc24('0x17')](_0x1c2cbc));_0x512a40(_0x1c2cbc);})[_0xbc24('0x1c')](function(_0x240758){logger[_0xbc24('0x18')](_0xbc24('0x27'),_0x240758[_0xbc24('0x1a')],_0x5f4b2d);_0x3a6eef(_0x11d273[_0xbc24('0x18')](0x1f4,_0x240758[_0xbc24('0x1a')]));});});};exports[_0xbc24('0x2a')]=function(_0x321246){var _0xe01549=this;return new Promise(function(_0xa26b3e,_0x566e5f){return db[_0xbc24('0x1e')][_0xbc24('0x2b')](_0x321246[_0xbc24('0x29')],{'raw':_0x321246[_0xbc24('0x1f')]?_0x321246['options'][_0xbc24('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x321246[_0xbc24('0x1f')]?_0x321246['options'][_0xbc24('0x21')]||null:null,'attributes':_0x321246['options']?_0x321246[_0xbc24('0x1f')]['attributes']||null:null,'limit':_0x321246[_0xbc24('0x1f')]?_0x321246[_0xbc24('0x1f')][_0xbc24('0x23')]||null:null})[_0xbc24('0x11')](function(_0x551207){logger[_0xbc24('0x12')](_0xbc24('0x2a'),_0x321246);logger[_0xbc24('0x15')]('UpdateVoiceQueueReport',_0x321246,JSON[_0xbc24('0x17')](_0x551207));_0xa26b3e(_0x551207);})[_0xbc24('0x1c')](function(_0x11e643){logger[_0xbc24('0x18')](_0xbc24('0x2a'),_0x11e643['message'],_0x321246);_0x566e5f(_0xe01549[_0xbc24('0x18')](0x1f4,_0x11e643[_0xbc24('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index e5a4edd..97783e2 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 _0x6631=['length','voiceQueueReport:','./voiceQueueReport.events','save','remove','update','emit','removeListener','register'];(function(_0x3c4bc0,_0x36d95f){var _0x228967=function(_0x21e087){while(--_0x21e087){_0x3c4bc0['push'](_0x3c4bc0['shift']());}};_0x228967(++_0x36d95f);}(_0x6631,0x134));var _0x1663=function(_0x4e58d6,_0x26c780){_0x4e58d6=_0x4e58d6-0x0;var _0x11d379=_0x6631[_0x4e58d6];return _0x11d379;};'use strict';var VoiceQueueReportEvents=require(_0x1663('0x0'));var events=[_0x1663('0x1'),_0x1663('0x2'),_0x1663('0x3')];function createListener(_0x3f563e,_0x26971d){return function(_0x5e5e43){_0x26971d[_0x1663('0x4')](_0x3f563e,_0x5e5e43);};}function removeListener(_0x1e2fcc,_0x232bfe){return function(){VoiceQueueReportEvents[_0x1663('0x5')](_0x1e2fcc,_0x232bfe);};}exports[_0x1663('0x6')]=function(_0x1faf52){for(var _0x23a307=0x0,_0x347c23=events[_0x1663('0x7')];_0x23a307<_0x347c23;_0x23a307++){var _0x231edf=events[_0x23a307];var _0x8adcee=createListener(_0x1663('0x8')+_0x231edf,_0x1faf52);VoiceQueueReportEvents['on'](_0x231edf,_0x8adcee);}}; \ No newline at end of file +var _0x757c=['update','emit','removeListener','register','length','./voiceQueueReport.events','save'];(function(_0x349262,_0x57fe8f){var _0x3abf60=function(_0x3b4bb0){while(--_0x3b4bb0){_0x349262['push'](_0x349262['shift']());}};_0x3abf60(++_0x57fe8f);}(_0x757c,0xc9));var _0xc757=function(_0x3889da,_0x2116be){_0x3889da=_0x3889da-0x0;var _0x46a21d=_0x757c[_0x3889da];return _0x46a21d;};'use strict';var VoiceQueueReportEvents=require(_0xc757('0x0'));var events=[_0xc757('0x1'),'remove',_0xc757('0x2')];function createListener(_0x1e89ff,_0x104de2){return function(_0x3556a2){_0x104de2[_0xc757('0x3')](_0x1e89ff,_0x3556a2);};}function removeListener(_0x4165bb,_0x2ad58b){return function(){VoiceQueueReportEvents[_0xc757('0x4')](_0x4165bb,_0x2ad58b);};}exports[_0xc757('0x5')]=function(_0x29cb3a){for(var _0x4f15ef=0x0,_0x1d5777=events[_0xc757('0x6')];_0x4f15ef<_0x1d5777;_0x4f15ef++){var _0xe6caa5=events[_0x4f15ef];var _0xa7a346=createListener('voiceQueueReport:'+_0xe6caa5,_0x29cb3a);VoiceQueueReportEvents['on'](_0xe6caa5,_0xa7a346);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 053d006..5239e78 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 _0x4276=['get','isAuthenticated','index','create','/:id','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller'];(function(_0x204191,_0x55d566){var _0x526ccf=function(_0x22427d){while(--_0x22427d){_0x204191['push'](_0x204191['shift']());}};_0x526ccf(++_0x55d566);}(_0x4276,0x98));var _0x6427=function(_0x5b91f5,_0x1e7dea){_0x5b91f5=_0x5b91f5-0x0;var _0x1fa21e=_0x4276[_0x5b91f5];return _0x1fa21e;};'use strict';var multer=require(_0x6427('0x0'));var util=require(_0x6427('0x1'));var path=require(_0x6427('0x2'));var timeout=require('connect-timeout');var express=require(_0x6427('0x3'));var router=express[_0x6427('0x4')]();var fs_extra=require(_0x6427('0x5'));var auth=require(_0x6427('0x6'));var interaction=require(_0x6427('0x7'));var config=require(_0x6427('0x8'));var controller=require(_0x6427('0x9'));router[_0x6427('0xa')]('/',auth[_0x6427('0xb')](),controller[_0x6427('0xc')]);router[_0x6427('0xa')]('/:id',auth[_0x6427('0xb')](),controller['show']);router['post']('/',auth[_0x6427('0xb')](),controller[_0x6427('0xd')]);router['put'](_0x6427('0xe'),auth[_0x6427('0xb')](),controller['update']);router[_0x6427('0xf')](_0x6427('0xe'),auth[_0x6427('0xb')](),controller[_0x6427('0x10')]);module[_0x6427('0x11')]=router; \ No newline at end of file +var _0x510c=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','index','/:id','show','post','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x3ff685,_0x304b9e){var _0x2046c9=function(_0x7a10e9){while(--_0x7a10e9){_0x3ff685['push'](_0x3ff685['shift']());}};_0x2046c9(++_0x304b9e);}(_0x510c,0x117));var _0xc510=function(_0x505bda,_0x51bd16){_0x505bda=_0x505bda-0x0;var _0x1e4795=_0x510c[_0x505bda];return _0x1e4795;};'use strict';var multer=require(_0xc510('0x0'));var util=require(_0xc510('0x1'));var path=require(_0xc510('0x2'));var timeout=require(_0xc510('0x3'));var express=require(_0xc510('0x4'));var router=express[_0xc510('0x5')]();var fs_extra=require(_0xc510('0x6'));var auth=require(_0xc510('0x7'));var interaction=require(_0xc510('0x8'));var config=require(_0xc510('0x9'));var controller=require(_0xc510('0xa'));router[_0xc510('0xb')]('/',auth[_0xc510('0xc')](),controller[_0xc510('0xd')]);router[_0xc510('0xb')](_0xc510('0xe'),auth[_0xc510('0xc')](),controller[_0xc510('0xf')]);router[_0xc510('0x10')]('/',auth[_0xc510('0xc')](),controller['create']);router['put'](_0xc510('0xe'),auth[_0xc510('0xc')](),controller['update']);router['delete'](_0xc510('0xe'),auth[_0xc510('0xc')](),controller[_0xc510('0x11')]);module[_0xc510('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index eff0ad2..bfb9804 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 _0x9630=['STRING','DATE','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','moment','exports'];(function(_0x4656fe,_0xf16c21){var _0x156907=function(_0x455d2a){while(--_0x455d2a){_0x4656fe['push'](_0x4656fe['shift']());}};_0x156907(++_0xf16c21);}(_0x9630,0xa0));var _0x0963=function(_0x2a458f,_0x198f82){_0x2a458f=_0x2a458f-0x0;var _0x91fb7=_0x9630[_0x2a458f];return _0x91fb7;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x0963('0x0'));module[_0x0963('0x1')]={'time':{'type':Sequelize[_0x0963('0x2')]},'callid':{'type':Sequelize[_0x0963('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x0963('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x0963('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x0963('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x0963('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x0963('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x0963('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x0963('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x0963('0x3')],'allowNull':![],'defaultValue':Sequelize[_0x0963('0x4')](_0x0963('0x5'))}}; \ No newline at end of file +var _0x2762=['DATE','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','moment','exports','STRING'];(function(_0x98b88d,_0x3e28b8){var _0x50cbb2=function(_0x13f7c){while(--_0x13f7c){_0x98b88d['push'](_0x98b88d['shift']());}};_0x50cbb2(++_0x3e28b8);}(_0x2762,0x6e));var _0x2276=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2762[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x2276('0x0'));var moment=require(_0x2276('0x1'));module[_0x2276('0x2')]={'time':{'type':Sequelize[_0x2276('0x3')]},'callid':{'type':Sequelize[_0x2276('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x2276('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x2276('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x2276('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x2276('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x2276('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x2276('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x2276('0x4')],'allowNull':![],'defaultValue':Sequelize['literal'](_0x2276('0x5'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 4428404..b15d467 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 _0xed6e=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','VoiceQueuesLog','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','fields','find','catch','create','body','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x3f4252,_0x3b6a23){var _0x3fcc84=function(_0x2e3100){while(--_0x2e3100){_0x3f4252['push'](_0x3f4252['shift']());}};_0x3fcc84(++_0x3b6a23);}(_0xed6e,0x160));var _0xeed6=function(_0x411017,_0x4a8117){_0x411017=_0x411017-0x0;var _0x2adeea=_0xed6e[_0x411017];return _0x2adeea;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xeed6('0x0'));var zipdir=require(_0xeed6('0x1'));var jsonpatch=require(_0xeed6('0x2'));var rp=require(_0xeed6('0x3'));var moment=require('moment');var BPromise=require(_0xeed6('0x4'));var Mustache=require('mustache');var util=require(_0xeed6('0x5'));var path=require('path');var sox=require(_0xeed6('0x6'));var csv=require(_0xeed6('0x7'));var ejs=require(_0xeed6('0x8'));var fs=require('fs');var fs_extra=require(_0xeed6('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xeed6('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xeed6('0x7'));var querystring=require(_0xeed6('0xb'));var Papa=require(_0xeed6('0xc'));var Redis=require(_0xeed6('0xd'));var authService=require(_0xeed6('0xe'));var qs=require(_0xeed6('0xf'));var as=require(_0xeed6('0x10'));var hardwareService=require(_0xeed6('0x11'));var logger=require(_0xeed6('0x12'))(_0xeed6('0x13'));var utils=require(_0xeed6('0x14'));var config=require(_0xeed6('0x15'));var licenseUtil=require(_0xeed6('0x16'));var db=require(_0xeed6('0x17'))['db'];function respondWithStatusCode(_0x3f5595,_0x46f023){_0x46f023=_0x46f023||0xcc;return function(_0xf7ca65){if(_0xf7ca65){return _0x3f5595['sendStatus'](_0x46f023);}return _0x3f5595[_0xeed6('0x18')](_0x46f023)[_0xeed6('0x19')]();};}function respondWithResult(_0x3d4597,_0x1faa34){_0x1faa34=_0x1faa34||0xc8;return function(_0x4452d6){if(_0x4452d6){return _0x3d4597[_0xeed6('0x18')](_0x1faa34)['json'](_0x4452d6);}};}function respondWithFilteredResult(_0x2650ce,_0x332ae0){return function(_0x2de986){if(_0x2de986){var _0x5b50da=typeof _0x332ae0[_0xeed6('0x1a')]===_0xeed6('0x1b')&&typeof _0x332ae0['limit']===_0xeed6('0x1b');var _0x553272=_0x2de986[_0xeed6('0x1c')];var _0x3c1358=_0x5b50da?0x0:_0x332ae0[_0xeed6('0x1a')];var _0x455d5b=_0x5b50da?_0x2de986[_0xeed6('0x1c')]:_0x332ae0[_0xeed6('0x1a')]+_0x332ae0[_0xeed6('0x1d')];var _0x2fd2d6;if(_0x455d5b>=_0x553272){_0x455d5b=_0x553272;_0x2fd2d6=0xc8;}else{_0x2fd2d6=0xce;}_0x2650ce[_0xeed6('0x18')](_0x2fd2d6);return _0x2650ce[_0xeed6('0x1e')](_0xeed6('0x1f'),_0x3c1358+'-'+_0x455d5b+'/'+_0x553272)[_0xeed6('0x20')](_0x2de986);}return null;};}function patchUpdates(_0x563090){return function(_0x217cf3){try{jsonpatch[_0xeed6('0x21')](_0x217cf3,_0x563090,!![]);}catch(_0x1aef47){return BPromise[_0xeed6('0x22')](_0x1aef47);}return _0x217cf3[_0xeed6('0x23')]();};}function saveUpdates(_0x29e750,_0x1168ab){return function(_0x38b155){if(_0x38b155){return _0x38b155[_0xeed6('0x24')](_0x29e750)[_0xeed6('0x25')](function(_0x1b7d86){return _0x1b7d86;});}return null;};}function removeEntity(_0x262e1f,_0x1a3d38){return function(_0x9612f5){if(_0x9612f5){return _0x9612f5[_0xeed6('0x26')]()['then'](function(){_0x262e1f[_0xeed6('0x18')](0xcc)[_0xeed6('0x19')]();});}};}function handleEntityNotFound(_0x388a13,_0xb7383c){return function(_0x14b83f){if(!_0x14b83f){_0x388a13[_0xeed6('0x27')](0x194);}return _0x14b83f;};}function handleError(_0x3233bc,_0x23c903){_0x23c903=_0x23c903||0x1f4;return function(_0x2d786c){logger[_0xeed6('0x28')](_0x2d786c[_0xeed6('0x29')]);if(_0x2d786c['name']){delete _0x2d786c[_0xeed6('0x2a')];}_0x3233bc[_0xeed6('0x18')](_0x23c903)['send'](_0x2d786c);};}exports[_0xeed6('0x2b')]=function(_0x3b3b82,_0x166f6a){var _0x3f14d6={},_0x3f5d6e={},_0x269700={'count':0x0,'rows':[]};var _0x40d92a=_[_0xeed6('0x2c')](db[_0xeed6('0x2d')][_0xeed6('0x2e')],function(_0x399ada){return{'name':_0x399ada[_0xeed6('0x2f')],'type':_0x399ada[_0xeed6('0x30')]['key']};});_0x3f5d6e[_0xeed6('0x31')]=_['map'](_0x40d92a,_0xeed6('0x2a'));_0x3f5d6e[_0xeed6('0x32')]=_[_0xeed6('0x33')](_0x3b3b82[_0xeed6('0x32')]);_0x3f5d6e[_0xeed6('0x34')]=_[_0xeed6('0x35')](_0x3f5d6e[_0xeed6('0x31')],_0x3f5d6e[_0xeed6('0x32')]);_0x3f14d6['attributes']=_[_0xeed6('0x35')](_0x3f5d6e[_0xeed6('0x31')],qs['fields'](_0x3b3b82[_0xeed6('0x32')]['fields']));_0x3f14d6['attributes']=_0x3f14d6[_0xeed6('0x36')]['length']?_0x3f14d6[_0xeed6('0x36')]:_0x3f5d6e[_0xeed6('0x31')];if(!_0x3b3b82[_0xeed6('0x32')][_0xeed6('0x37')]('nolimit')){_0x3f14d6[_0xeed6('0x1d')]=qs[_0xeed6('0x1d')](_0x3b3b82[_0xeed6('0x32')]['limit']);_0x3f14d6[_0xeed6('0x1a')]=qs[_0xeed6('0x1a')](_0x3b3b82[_0xeed6('0x32')][_0xeed6('0x1a')]);}_0x3f14d6[_0xeed6('0x38')]=qs['sort'](_0x3b3b82[_0xeed6('0x32')][_0xeed6('0x39')]);_0x3f14d6[_0xeed6('0x3a')]=qs[_0xeed6('0x34')](_[_0xeed6('0x3b')](_0x3b3b82[_0xeed6('0x32')],_0x3f5d6e[_0xeed6('0x34')]),_0x40d92a);if(_0x3b3b82[_0xeed6('0x32')]['filter']){_0x3f14d6[_0xeed6('0x3a')]=_[_0xeed6('0x3c')](_0x3f14d6[_0xeed6('0x3a')],{'$or':_['map'](_0x40d92a,function(_0x51476a){if(_0x51476a[_0xeed6('0x30')]!==_0xeed6('0x3d')){var _0x5e568d={};_0x5e568d[_0x51476a[_0xeed6('0x2a')]]={'$like':'%'+_0x3b3b82['query'][_0xeed6('0x3e')]+'%'};return _0x5e568d;}})});}_0x3f14d6=_[_0xeed6('0x3c')]({},_0x3f14d6,_0x3b3b82[_0xeed6('0x3f')]);var _0x8ab8e0={'where':_0x3f14d6['where']};return db[_0xeed6('0x2d')]['count'](_0x8ab8e0)[_0xeed6('0x25')](function(_0x4ee178){_0x269700['count']=_0x4ee178;if(_0x3b3b82[_0xeed6('0x32')][_0xeed6('0x40')]){_0x3f14d6[_0xeed6('0x41')]=[{'all':!![]}];}return db[_0xeed6('0x2d')][_0xeed6('0x42')](_0x3f14d6);})[_0xeed6('0x25')](function(_0x9e34a){_0x269700[_0xeed6('0x43')]=_0x9e34a;return _0x269700;})[_0xeed6('0x25')](respondWithFilteredResult(_0x166f6a,_0x3f14d6))['catch'](handleError(_0x166f6a,null));};exports[_0xeed6('0x44')]=function(_0x35a512,_0xb2d2ad){var _0x2ce26b={'raw':!![],'where':{'id':_0x35a512['params']['id']}},_0x6317fe={};_0x6317fe['model']=_[_0xeed6('0x33')](db['VoiceQueuesLog'][_0xeed6('0x2e')]);_0x6317fe[_0xeed6('0x32')]=_[_0xeed6('0x33')](_0x35a512['query']);_0x6317fe[_0xeed6('0x34')]=_[_0xeed6('0x35')](_0x6317fe[_0xeed6('0x31')],_0x6317fe[_0xeed6('0x32')]);_0x2ce26b['attributes']=_[_0xeed6('0x35')](_0x6317fe['model'],qs[_0xeed6('0x45')](_0x35a512['query'][_0xeed6('0x45')]));_0x2ce26b['attributes']=_0x2ce26b['attributes']['length']?_0x2ce26b['attributes']:_0x6317fe[_0xeed6('0x31')];if(_0x35a512[_0xeed6('0x32')][_0xeed6('0x40')]){_0x2ce26b[_0xeed6('0x41')]=[{'all':!![]}];}_0x2ce26b=_[_0xeed6('0x3c')]({},_0x2ce26b,_0x35a512[_0xeed6('0x3f')]);return db[_0xeed6('0x2d')][_0xeed6('0x46')](_0x2ce26b)[_0xeed6('0x25')](handleEntityNotFound(_0xb2d2ad,null))[_0xeed6('0x25')](respondWithResult(_0xb2d2ad,null))[_0xeed6('0x47')](handleError(_0xb2d2ad,null));};exports['create']=function(_0x30f1d2,_0x52ce1e){return db[_0xeed6('0x2d')][_0xeed6('0x48')](_0x30f1d2['body'],{})[_0xeed6('0x25')](respondWithResult(_0x52ce1e,0xc9))['catch'](handleError(_0x52ce1e,null));};exports['update']=function(_0x1ba77d,_0x2adf21){if(_0x1ba77d[_0xeed6('0x49')]['id']){delete _0x1ba77d[_0xeed6('0x49')]['id'];}return db[_0xeed6('0x2d')][_0xeed6('0x46')]({'where':{'id':_0x1ba77d['params']['id']}})[_0xeed6('0x25')](handleEntityNotFound(_0x2adf21,null))[_0xeed6('0x25')](saveUpdates(_0x1ba77d[_0xeed6('0x49')],null))['then'](respondWithResult(_0x2adf21,null))['catch'](handleError(_0x2adf21,null));};exports[_0xeed6('0x26')]=function(_0x4a2645,_0xad2099){return db[_0xeed6('0x2d')][_0xeed6('0x46')]({'where':{'id':_0x4a2645['params']['id']}})[_0xeed6('0x25')](handleEntityNotFound(_0xad2099,null))[_0xeed6('0x25')](removeEntity(_0xad2099,null))[_0xeed6('0x47')](handleError(_0xad2099,null));}; \ No newline at end of file +var _0xfb28=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','map','VoiceQueuesLog','rawAttributes','type','key','model','query','keys','attributes','fields','length','nolimit','limit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','rows','catch','show','params','intersection','find','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x3f16a4,_0x175963){var _0x355559=function(_0x200415){while(--_0x200415){_0x3f16a4['push'](_0x3f16a4['shift']());}};_0x355559(++_0x175963);}(_0xfb28,0xd5));var _0x8fb2=function(_0x391cd8,_0x37e968){_0x391cd8=_0x391cd8-0x0;var _0x5bdf6b=_0xfb28[_0x391cd8];return _0x5bdf6b;};'use strict';var emlformat=require(_0x8fb2('0x0'));var rimraf=require(_0x8fb2('0x1'));var zipdir=require(_0x8fb2('0x2'));var jsonpatch=require(_0x8fb2('0x3'));var rp=require(_0x8fb2('0x4'));var moment=require(_0x8fb2('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8fb2('0x6'));var path=require(_0x8fb2('0x7'));var sox=require(_0x8fb2('0x8'));var csv=require(_0x8fb2('0x9'));var ejs=require(_0x8fb2('0xa'));var fs=require('fs');var fs_extra=require(_0x8fb2('0xb'));var _=require(_0x8fb2('0xc'));var squel=require(_0x8fb2('0xd'));var crypto=require(_0x8fb2('0xe'));var jsforce=require(_0x8fb2('0xf'));var deskjs=require(_0x8fb2('0x10'));var toCsv=require(_0x8fb2('0x9'));var querystring=require(_0x8fb2('0x11'));var Papa=require(_0x8fb2('0x12'));var Redis=require(_0x8fb2('0x13'));var authService=require(_0x8fb2('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8fb2('0x15'));var utils=require(_0x8fb2('0x16'));var config=require(_0x8fb2('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x8fb2('0x18'))['db'];function respondWithStatusCode(_0x2f0e16,_0x39c7e1){_0x39c7e1=_0x39c7e1||0xcc;return function(_0xc32fd4){if(_0xc32fd4){return _0x2f0e16['sendStatus'](_0x39c7e1);}return _0x2f0e16['status'](_0x39c7e1)[_0x8fb2('0x19')]();};}function respondWithResult(_0x119449,_0x492c1f){_0x492c1f=_0x492c1f||0xc8;return function(_0x1c1a63){if(_0x1c1a63){return _0x119449[_0x8fb2('0x1a')](_0x492c1f)[_0x8fb2('0x1b')](_0x1c1a63);}};}function respondWithFilteredResult(_0x35d979,_0x525362){return function(_0x4b96b5){if(_0x4b96b5){var _0x44380c=typeof _0x525362[_0x8fb2('0x1c')]===_0x8fb2('0x1d')&&typeof _0x525362['limit']===_0x8fb2('0x1d');var _0x5a48eb=_0x4b96b5[_0x8fb2('0x1e')];var _0x5be409=_0x44380c?0x0:_0x525362[_0x8fb2('0x1c')];var _0x1a6546=_0x44380c?_0x4b96b5['count']:_0x525362['offset']+_0x525362['limit'];var _0x243771;if(_0x1a6546>=_0x5a48eb){_0x1a6546=_0x5a48eb;_0x243771=0xc8;}else{_0x243771=0xce;}_0x35d979[_0x8fb2('0x1a')](_0x243771);return _0x35d979[_0x8fb2('0x1f')](_0x8fb2('0x20'),_0x5be409+'-'+_0x1a6546+'/'+_0x5a48eb)[_0x8fb2('0x1b')](_0x4b96b5);}return null;};}function patchUpdates(_0x3c4e37){return function(_0xb6795f){try{jsonpatch[_0x8fb2('0x21')](_0xb6795f,_0x3c4e37,!![]);}catch(_0x17a431){return BPromise[_0x8fb2('0x22')](_0x17a431);}return _0xb6795f[_0x8fb2('0x23')]();};}function saveUpdates(_0x1e4af7,_0x38171f){return function(_0x38f37a){if(_0x38f37a){return _0x38f37a[_0x8fb2('0x24')](_0x1e4af7)[_0x8fb2('0x25')](function(_0x4abd6b){return _0x4abd6b;});}return null;};}function removeEntity(_0x48c6a1,_0x190e35){return function(_0x5037bb){if(_0x5037bb){return _0x5037bb['destroy']()[_0x8fb2('0x25')](function(){_0x48c6a1['status'](0xcc)[_0x8fb2('0x19')]();});}};}function handleEntityNotFound(_0x4dc1a4,_0x1a46a4){return function(_0x343555){if(!_0x343555){_0x4dc1a4[_0x8fb2('0x26')](0x194);}return _0x343555;};}function handleError(_0x5dc7c9,_0x277abe){_0x277abe=_0x277abe||0x1f4;return function(_0x514873){logger[_0x8fb2('0x27')](_0x514873[_0x8fb2('0x28')]);if(_0x514873[_0x8fb2('0x29')]){delete _0x514873[_0x8fb2('0x29')];}_0x5dc7c9[_0x8fb2('0x1a')](_0x277abe)[_0x8fb2('0x2a')](_0x514873);};}exports[_0x8fb2('0x2b')]=function(_0x33b8a8,_0x2bdac9){var _0x5ba198={},_0xbe3fe1={},_0x2a198b={'count':0x0,'rows':[]};var _0x487413=_[_0x8fb2('0x2c')](db[_0x8fb2('0x2d')][_0x8fb2('0x2e')],function(_0x19d142){return{'name':_0x19d142['fieldName'],'type':_0x19d142[_0x8fb2('0x2f')][_0x8fb2('0x30')]};});_0xbe3fe1[_0x8fb2('0x31')]=_[_0x8fb2('0x2c')](_0x487413,'name');_0xbe3fe1[_0x8fb2('0x32')]=_[_0x8fb2('0x33')](_0x33b8a8[_0x8fb2('0x32')]);_0xbe3fe1['filters']=_['intersection'](_0xbe3fe1[_0x8fb2('0x31')],_0xbe3fe1['query']);_0x5ba198[_0x8fb2('0x34')]=_['intersection'](_0xbe3fe1['model'],qs['fields'](_0x33b8a8[_0x8fb2('0x32')][_0x8fb2('0x35')]));_0x5ba198[_0x8fb2('0x34')]=_0x5ba198[_0x8fb2('0x34')][_0x8fb2('0x36')]?_0x5ba198[_0x8fb2('0x34')]:_0xbe3fe1['model'];if(!_0x33b8a8[_0x8fb2('0x32')]['hasOwnProperty'](_0x8fb2('0x37'))){_0x5ba198[_0x8fb2('0x38')]=qs['limit'](_0x33b8a8[_0x8fb2('0x32')][_0x8fb2('0x38')]);_0x5ba198[_0x8fb2('0x1c')]=qs[_0x8fb2('0x1c')](_0x33b8a8[_0x8fb2('0x32')][_0x8fb2('0x1c')]);}_0x5ba198[_0x8fb2('0x39')]=qs[_0x8fb2('0x3a')](_0x33b8a8[_0x8fb2('0x32')][_0x8fb2('0x3a')]);_0x5ba198[_0x8fb2('0x3b')]=qs[_0x8fb2('0x3c')](_[_0x8fb2('0x3d')](_0x33b8a8[_0x8fb2('0x32')],_0xbe3fe1['filters']),_0x487413);if(_0x33b8a8[_0x8fb2('0x32')][_0x8fb2('0x3e')]){_0x5ba198[_0x8fb2('0x3b')]=_[_0x8fb2('0x3f')](_0x5ba198['where'],{'$or':_[_0x8fb2('0x2c')](_0x487413,function(_0x3e8033){if(_0x3e8033['type']!=='VIRTUAL'){var _0x14d24c={};_0x14d24c[_0x3e8033['name']]={'$like':'%'+_0x33b8a8['query'][_0x8fb2('0x3e')]+'%'};return _0x14d24c;}})});}_0x5ba198=_['merge']({},_0x5ba198,_0x33b8a8[_0x8fb2('0x40')]);var _0x1b875c={'where':_0x5ba198[_0x8fb2('0x3b')]};return db['VoiceQueuesLog'][_0x8fb2('0x1e')](_0x1b875c)[_0x8fb2('0x25')](function(_0x4ccb60){_0x2a198b[_0x8fb2('0x1e')]=_0x4ccb60;if(_0x33b8a8[_0x8fb2('0x32')][_0x8fb2('0x41')]){_0x5ba198[_0x8fb2('0x42')]=[{'all':!![]}];}return db[_0x8fb2('0x2d')]['findAll'](_0x5ba198);})[_0x8fb2('0x25')](function(_0x19e516){_0x2a198b[_0x8fb2('0x43')]=_0x19e516;return _0x2a198b;})['then'](respondWithFilteredResult(_0x2bdac9,_0x5ba198))[_0x8fb2('0x44')](handleError(_0x2bdac9,null));};exports[_0x8fb2('0x45')]=function(_0x60ce,_0x1378cb){var _0x4cde23={'raw':!![],'where':{'id':_0x60ce[_0x8fb2('0x46')]['id']}},_0x5d04d9={};_0x5d04d9[_0x8fb2('0x31')]=_['keys'](db[_0x8fb2('0x2d')][_0x8fb2('0x2e')]);_0x5d04d9[_0x8fb2('0x32')]=_[_0x8fb2('0x33')](_0x60ce[_0x8fb2('0x32')]);_0x5d04d9[_0x8fb2('0x3c')]=_[_0x8fb2('0x47')](_0x5d04d9[_0x8fb2('0x31')],_0x5d04d9[_0x8fb2('0x32')]);_0x4cde23[_0x8fb2('0x34')]=_[_0x8fb2('0x47')](_0x5d04d9[_0x8fb2('0x31')],qs['fields'](_0x60ce[_0x8fb2('0x32')][_0x8fb2('0x35')]));_0x4cde23[_0x8fb2('0x34')]=_0x4cde23['attributes'][_0x8fb2('0x36')]?_0x4cde23[_0x8fb2('0x34')]:_0x5d04d9[_0x8fb2('0x31')];if(_0x60ce['query'][_0x8fb2('0x41')]){_0x4cde23[_0x8fb2('0x42')]=[{'all':!![]}];}_0x4cde23=_[_0x8fb2('0x3f')]({},_0x4cde23,_0x60ce[_0x8fb2('0x40')]);return db['VoiceQueuesLog'][_0x8fb2('0x48')](_0x4cde23)['then'](handleEntityNotFound(_0x1378cb,null))['then'](respondWithResult(_0x1378cb,null))[_0x8fb2('0x44')](handleError(_0x1378cb,null));};exports['create']=function(_0x46a007,_0x338422){return db[_0x8fb2('0x2d')]['create'](_0x46a007[_0x8fb2('0x49')],{})[_0x8fb2('0x25')](respondWithResult(_0x338422,0xc9))[_0x8fb2('0x44')](handleError(_0x338422,null));};exports[_0x8fb2('0x24')]=function(_0x14842,_0x40dfc0){if(_0x14842[_0x8fb2('0x49')]['id']){delete _0x14842[_0x8fb2('0x49')]['id'];}return db[_0x8fb2('0x2d')][_0x8fb2('0x48')]({'where':{'id':_0x14842[_0x8fb2('0x46')]['id']}})[_0x8fb2('0x25')](handleEntityNotFound(_0x40dfc0,null))[_0x8fb2('0x25')](saveUpdates(_0x14842[_0x8fb2('0x49')],null))[_0x8fb2('0x25')](respondWithResult(_0x40dfc0,null))['catch'](handleError(_0x40dfc0,null));};exports[_0x8fb2('0x4a')]=function(_0x59dee1,_0x3d616d){return db[_0x8fb2('0x2d')][_0x8fb2('0x48')]({'where':{'id':_0x59dee1[_0x8fb2('0x46')]['id']}})[_0x8fb2('0x25')](handleEntityNotFound(_0x3d616d,null))[_0x8fb2('0x25')](removeEntity(_0x3d616d,null))[_0x8fb2('0x44')](handleError(_0x3d616d,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index b5bb35d..900084d 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 _0x5e45=['./voiceQueuesLog.attributes','define','VoiceQueuesLog','voice_queues_log','event_dtm','event','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x106884,_0x3558c0){var _0x13d06c=function(_0x193903){while(--_0x193903){_0x106884['push'](_0x106884['shift']());}};_0x13d06c(++_0x3558c0);}(_0x5e45,0x172));var _0x55e4=function(_0x279af2,_0x48152b){_0x279af2=_0x279af2-0x0;var _0x3d498c=_0x5e45[_0x279af2];return _0x3d498c;};'use strict';var _=require(_0x55e4('0x0'));var util=require('util');var logger=require(_0x55e4('0x1'))(_0x55e4('0x2'));var moment=require(_0x55e4('0x3'));var BPromise=require(_0x55e4('0x4'));var rp=require(_0x55e4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x55e4('0x6'));var config=require(_0x55e4('0x7'));var attributes=require(_0x55e4('0x8'));module['exports']=function(_0x267087,_0x831337){return _0x267087[_0x55e4('0x9')](_0x55e4('0xa'),attributes,{'tableName':_0x55e4('0xb'),'paranoid':![],'indexes':[{'name':_0x55e4('0xc'),'fields':[_0x55e4('0xd'),'dtm']}],'timestamps':![]});}; \ No newline at end of file +var _0xad8a=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm'];(function(_0x5def21,_0x373041){var _0xc41e1a=function(_0x485ef8){while(--_0x485ef8){_0x5def21['push'](_0x5def21['shift']());}};_0xc41e1a(++_0x373041);}(_0xad8a,0xb0));var _0xaad8=function(_0x102827,_0x403147){_0x102827=_0x102827-0x0;var _0x1b6b27=_0xad8a[_0x102827];return _0x1b6b27;};'use strict';var _=require(_0xaad8('0x0'));var util=require(_0xaad8('0x1'));var logger=require(_0xaad8('0x2'))(_0xaad8('0x3'));var moment=require(_0xaad8('0x4'));var BPromise=require('bluebird');var rp=require(_0xaad8('0x5'));var fs=require('fs');var path=require(_0xaad8('0x6'));var rimraf=require(_0xaad8('0x7'));var config=require('../../config/environment');var attributes=require(_0xaad8('0x8'));module[_0xaad8('0x9')]=function(_0x22c799,_0xeb5d15){return _0x22c799[_0xaad8('0xa')](_0xaad8('0xb'),attributes,{'tableName':_0xaad8('0xc'),'paranoid':![],'indexes':[{'name':_0xaad8('0xd'),'fields':[_0xaad8('0xe'),_0xaad8('0xf')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 80450e9..d821296 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 _0xf972=['client','http','then','info','request\x20sent','stringify','error','code','VoiceQueuesLog,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf972,0x171));var _0x2f97=function(_0x1cba8b,_0x59b0d6){_0x1cba8b=_0x1cba8b-0x0;var _0x1497d5=_0xf972[_0x1cba8b];return _0x1497d5;};'use strict';var _=require(_0x2f97('0x0'));var util=require('util');var moment=require(_0x2f97('0x1'));var BPromise=require(_0x2f97('0x2'));var rs=require(_0x2f97('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2f97('0x4'))['db'];var utils=require(_0x2f97('0x5'));var logger=require('../../config/logger')(_0x2f97('0x6'));var config=require(_0x2f97('0x7'));var jayson=require(_0x2f97('0x8'));var client=jayson[_0x2f97('0x9')][_0x2f97('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x77824f,_0x3f872b,_0x322e02){return new BPromise(function(_0x11c897,_0x51eead){return client['request'](_0x77824f,_0x322e02)[_0x2f97('0xb')](function(_0x449290){logger[_0x2f97('0xc')]('VoiceQueuesLog,\x20%s,\x20%s',_0x3f872b,_0x2f97('0xd'));logger['debug']('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x3f872b,_0x2f97('0xd'),JSON[_0x2f97('0xe')](_0x449290));if(_0x449290[_0x2f97('0xf')]){if(_0x449290[_0x2f97('0xf')][_0x2f97('0x10')]===0x1f4){logger['error'](_0x2f97('0x11'),_0x3f872b,_0x449290[_0x2f97('0xf')][_0x2f97('0x12')]);return _0x51eead(_0x449290[_0x2f97('0xf')][_0x2f97('0x12')]);}logger[_0x2f97('0xf')]('VoiceQueuesLog,\x20%s,\x20%s',_0x3f872b,_0x449290['error'][_0x2f97('0x12')]);return _0x11c897(_0x449290[_0x2f97('0xf')][_0x2f97('0x12')]);}else{logger['info'](_0x2f97('0x11'),_0x3f872b,_0x2f97('0xd'));_0x11c897(_0x449290[_0x2f97('0x13')][_0x2f97('0x12')]);}})[_0x2f97('0x14')](function(_0xcccb2d){logger['error'](_0x2f97('0x11'),_0x3f872b,_0xcccb2d);_0x51eead(_0xcccb2d);});});} \ No newline at end of file +var _0xab2a=['util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xab2a,0x1a1));var _0xaab2=function(_0x205ceb,_0x1eb500){_0x205ceb=_0x205ceb-0x0;var _0x2d9f8e=_0xab2a[_0x205ceb];return _0x2d9f8e;};'use strict';var _=require(_0xaab2('0x0'));var util=require(_0xaab2('0x1'));var moment=require(_0xaab2('0x2'));var BPromise=require('bluebird');var rs=require(_0xaab2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaab2('0x4'))['db'];var utils=require(_0xaab2('0x5'));var logger=require(_0xaab2('0x6'))('rpc');var config=require(_0xaab2('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5ec536,_0x113939,_0x2a700e){return new BPromise(function(_0x8ea9c0,_0x19cbc4){return client[_0xaab2('0x8')](_0x5ec536,_0x2a700e)[_0xaab2('0x9')](function(_0x43c442){logger[_0xaab2('0xa')](_0xaab2('0xb'),_0x113939,_0xaab2('0xc'));logger[_0xaab2('0xd')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x113939,_0xaab2('0xc'),JSON['stringify'](_0x43c442));if(_0x43c442[_0xaab2('0xe')]){if(_0x43c442[_0xaab2('0xe')][_0xaab2('0xf')]===0x1f4){logger[_0xaab2('0xe')]('VoiceQueuesLog,\x20%s,\x20%s',_0x113939,_0x43c442[_0xaab2('0xe')][_0xaab2('0x10')]);return _0x19cbc4(_0x43c442[_0xaab2('0xe')][_0xaab2('0x10')]);}logger[_0xaab2('0xe')](_0xaab2('0xb'),_0x113939,_0x43c442['error']['message']);return _0x8ea9c0(_0x43c442[_0xaab2('0xe')][_0xaab2('0x10')]);}else{logger['info'](_0xaab2('0xb'),_0x113939,_0xaab2('0xc'));_0x8ea9c0(_0x43c442[_0xaab2('0x11')][_0xaab2('0x10')]);}})[_0xaab2('0x12')](function(_0x4f4b3c){logger['error'](_0xaab2('0xb'),_0x113939,_0x4f4b3c);_0x19cbc4(_0x4f4b3c);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index a56d073..61c6e5b 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 _0x6923=['create','runTranscribe','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','index','describe','/:id/download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post'];(function(_0x3ebb55,_0x2fba65){var _0x2c316=function(_0x4448f6){while(--_0x4448f6){_0x3ebb55['push'](_0x3ebb55['shift']());}};_0x2c316(++_0x2fba65);}(_0x6923,0x77));var _0x3692=function(_0x506f4f,_0x5369ef){_0x506f4f=_0x506f4f-0x0;var _0x3f6f58=_0x6923[_0x506f4f];return _0x3f6f58;};'use strict';var multer=require(_0x3692('0x0'));var util=require(_0x3692('0x1'));var path=require(_0x3692('0x2'));var timeout=require(_0x3692('0x3'));var express=require(_0x3692('0x4'));var router=express[_0x3692('0x5')]();var fs_extra=require(_0x3692('0x6'));var auth=require(_0x3692('0x7'));var interaction=require(_0x3692('0x8'));var config=require(_0x3692('0x9'));var controller=require(_0x3692('0xa'));router[_0x3692('0xb')]('/',auth[_0x3692('0xc')](),controller[_0x3692('0xd')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x3692('0xe')]);router[_0x3692('0xb')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x3692('0xb')](_0x3692('0xf'),auth[_0x3692('0xc')](),controller['download']);router[_0x3692('0xb')](_0x3692('0x10'),controller[_0x3692('0x11')]);router['get'](_0x3692('0x12'),auth[_0x3692('0xc')](),controller[_0x3692('0x13')]);router[_0x3692('0x14')]('/',auth[_0x3692('0xc')](),controller[_0x3692('0x15')]);router[_0x3692('0x14')](_0x3692('0x12'),auth[_0x3692('0xc')](),controller[_0x3692('0x16')]);router[_0x3692('0x17')](_0x3692('0x18'),auth[_0x3692('0xc')](),controller[_0x3692('0x19')]);router[_0x3692('0x1a')](_0x3692('0x18'),auth[_0x3692('0xc')](),controller[_0x3692('0x1b')]);module['exports']=router; \ No newline at end of file +var _0x002f=['put','update','delete','destroy','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/download','download','downloads','/:id/transcribe','downloadTranscribe','post','runTranscribe'];(function(_0x2b0102,_0xe3da2e){var _0x22e6e1=function(_0x5c18fb){while(--_0x5c18fb){_0x2b0102['push'](_0x2b0102['shift']());}};_0x22e6e1(++_0xe3da2e);}(_0x002f,0x94));var _0xf002=function(_0x35b80e,_0x120fd7){_0x35b80e=_0x35b80e-0x0;var _0x363914=_0x002f[_0x35b80e];return _0x363914;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xf002('0x0'));var express=require(_0xf002('0x1'));var router=express[_0xf002('0x2')]();var fs_extra=require(_0xf002('0x3'));var auth=require(_0xf002('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xf002('0x5'));var controller=require('./voiceRecording.controller');router[_0xf002('0x6')]('/',auth['isAuthenticated'](),controller[_0xf002('0x7')]);router['get'](_0xf002('0x8'),auth[_0xf002('0x9')](),controller[_0xf002('0xa')]);router[_0xf002('0x6')](_0xf002('0xb'),auth[_0xf002('0x9')](),controller[_0xf002('0xc')]);router[_0xf002('0x6')](_0xf002('0xd'),auth[_0xf002('0x9')](),controller[_0xf002('0xe')]);router[_0xf002('0x6')]('/:id/downloads',controller[_0xf002('0xf')]);router[_0xf002('0x6')](_0xf002('0x10'),auth['isAuthenticated'](),controller[_0xf002('0x11')]);router[_0xf002('0x12')]('/',auth[_0xf002('0x9')](),controller['create']);router['post'](_0xf002('0x10'),auth[_0xf002('0x9')](),controller[_0xf002('0x13')]);router[_0xf002('0x14')]('/:id',auth[_0xf002('0x9')](),controller[_0xf002('0x15')]);router[_0xf002('0x16')](_0xf002('0xb'),auth[_0xf002('0x9')](),controller[_0xf002('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 7e229ce..639f9cf 100644 --- a/server/api/voiceRecording/voiceRecording.attributes.js +++ b/server/api/voiceRecording/voiceRecording.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['DATE','updatedAt','toString','sequelize','moment','path','getDataValue','extname','value','STRING','setDataValue','channel','TEXT','NEW','FLOAT','BOOLEAN','format','MM-DD-YYYY\x20HH:mm'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x3')]('value')?path[_0x0a9e('0x4')](this[_0x0a9e('0x3')](_0x0a9e('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x0a9e('0x6')]},'channel':{'type':Sequelize[_0x0a9e('0x6')],'set':function(_0x57b080){if(_0x57b080){this[_0x0a9e('0x7')](_0x0a9e('0x8'),_0x57b080);this[_0x0a9e('0x7')]('membername',_0x57b080['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0a9e('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0a9e('0x6')]},'connectedlinename':{'type':Sequelize[_0x0a9e('0x6')]},'accountcode':{'type':Sequelize[_0x0a9e('0x6')]},'context':{'type':Sequelize[_0x0a9e('0x6')]},'exten':{'type':Sequelize[_0x0a9e('0x6')]},'value':{'type':Sequelize[_0x0a9e('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'location':{'type':Sequelize[_0x0a9e('0x9')]},'transcribeName':{'type':Sequelize[_0x0a9e('0x6')]},'transcribeStatus':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':_0x0a9e('0xa')},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize[_0x0a9e('0x9')]},'failureReason':{'type':Sequelize[_0x0a9e('0x9')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')]},'sPositive':{'type':Sequelize[_0x0a9e('0xb')]},'sNegative':{'type':Sequelize[_0x0a9e('0xb')]},'sNeutral':{'type':Sequelize[_0x0a9e('0xb')]},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x0a9e('0xc')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0a9e('0x3')]('createdAt'))[_0x0a9e('0xd')](_0x0a9e('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0x0a9e('0xf')],'get':function(){return moment(this['getDataValue'](_0x0a9e('0x10')))[_0x0a9e('0xd')](_0x0a9e('0xe'))[_0x0a9e('0x11')]();}}}; \ No newline at end of file +var _0xa9e0=['DATE','updatedAt','toString','sequelize','moment','path','getDataValue','extname','value','STRING','setDataValue','channel','TEXT','NEW','FLOAT','BOOLEAN','format','MM-DD-YYYY\x20HH:mm'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x3')]('value')?path[_0x0a9e('0x4')](this[_0x0a9e('0x3')](_0x0a9e('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x0a9e('0x6')]},'channel':{'type':Sequelize[_0x0a9e('0x6')],'set':function(_0x57b080){if(_0x57b080){this[_0x0a9e('0x7')](_0x0a9e('0x8'),_0x57b080);this[_0x0a9e('0x7')]('membername',_0x57b080['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0a9e('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0a9e('0x6')]},'connectedlinename':{'type':Sequelize[_0x0a9e('0x6')]},'accountcode':{'type':Sequelize[_0x0a9e('0x6')]},'context':{'type':Sequelize[_0x0a9e('0x6')]},'exten':{'type':Sequelize[_0x0a9e('0x6')]},'value':{'type':Sequelize[_0x0a9e('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'location':{'type':Sequelize[_0x0a9e('0x9')]},'transcribeName':{'type':Sequelize[_0x0a9e('0x6')]},'transcribeStatus':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':_0x0a9e('0xa')},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize[_0x0a9e('0x9')]},'failureReason':{'type':Sequelize[_0x0a9e('0x9')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')]},'sPositive':{'type':Sequelize[_0x0a9e('0xb')]},'sNegative':{'type':Sequelize[_0x0a9e('0xb')]},'sNeutral':{'type':Sequelize[_0x0a9e('0xb')]},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x0a9e('0xc')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0a9e('0x3')]('createdAt'))[_0x0a9e('0xd')](_0x0a9e('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0x0a9e('0xf')],'get':function(){return moment(this['getDataValue'](_0x0a9e('0x10')))[_0x0a9e('0xd')](_0x0a9e('0xe'))[_0x0a9e('0x11')]();}}}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.controller.js b/server/api/voiceRecording/voiceRecording.controller.js index 0f69a92..302caee 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 _0x0283=['include','findAll','rows','show','params','find','catch','create','body','describe','download','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','decryptFile','secrets','recording','ValidationError','VoiceRecording\x20not\x20found','filename','unlink','message','Not\x20found','downloads','sequelize','MD5','col','$and','extname','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','listBuckets','upload','TranscribeService','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','TranscriptionJob','TranscriptionJobName','transcribeName','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribeRegion','Sequelize','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','sentimentRegion','language','Sentiment\x20Analysis\x20not\x20configured','transcribeAccountId','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','updateAttributes','writeFile','downloadTranscribe','fileText','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','zip-dir','fast-json-patch','request-promise','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','aws-sdk','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','VoiceRecording','rawAttributes','fieldName','type','key','differenceBy','format','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','map','includeAll'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0283,0xe6));var _0x3028=function(_0x2fc5db,_0x2253b1){_0x2fc5db=_0x2fc5db-0x0;var _0x1ef11b=_0x0283[_0x2fc5db];return _0x1ef11b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3028('0x0'));var jsonpatch=require(_0x3028('0x1'));var rp=require(_0x3028('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x3028('0x3'));var csv=require(_0x3028('0x4'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3028('0x5'));var _=require(_0x3028('0x6'));var squel=require(_0x3028('0x7'));var crypto=require(_0x3028('0x8'));var jsforce=require(_0x3028('0x9'));var deskjs=require(_0x3028('0xa'));var toCsv=require(_0x3028('0x4'));var querystring=require('querystring');var Papa=require(_0x3028('0xb'));var AWS=require(_0x3028('0xc'));var uuidv4=require('uuid/v4');var Redis=require('ioredis');var authService=require(_0x3028('0xd'));var qs=require(_0x3028('0xe'));var as=require(_0x3028('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3028('0x10'))(_0x3028('0x11'));var utils=require(_0x3028('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x3028('0x13'));var db=require(_0x3028('0x14'))['db'];function respondWithStatusCode(_0x4b15d0,_0x495af0){_0x495af0=_0x495af0||0xcc;return function(_0x42e811){if(_0x42e811){return _0x4b15d0[_0x3028('0x15')](_0x495af0);}return _0x4b15d0[_0x3028('0x16')](_0x495af0)['end']();};}function respondWithResult(_0x1511b9,_0x593d28){_0x593d28=_0x593d28||0xc8;return function(_0x1a359a){if(_0x1a359a){return _0x1511b9[_0x3028('0x16')](_0x593d28)[_0x3028('0x17')](_0x1a359a);}};}function respondWithFilteredResult(_0xf5a5b7,_0x2a7145){return function(_0x374f41){if(_0x374f41){var _0x549fd7=typeof _0x2a7145['offset']==='undefined'&&typeof _0x2a7145['limit']===_0x3028('0x18');var _0x2ec277=_0x374f41[_0x3028('0x19')];var _0x8921d4=_0x549fd7?0x0:_0x2a7145[_0x3028('0x1a')];var _0x2dc202=_0x549fd7?_0x374f41[_0x3028('0x19')]:_0x2a7145[_0x3028('0x1a')]+_0x2a7145[_0x3028('0x1b')];var _0x293385;if(_0x2dc202>=_0x2ec277){_0x2dc202=_0x2ec277;_0x293385=0xc8;}else{_0x293385=0xce;}_0xf5a5b7['status'](_0x293385);return _0xf5a5b7[_0x3028('0x1c')](_0x3028('0x1d'),_0x8921d4+'-'+_0x2dc202+'/'+_0x2ec277)[_0x3028('0x17')](_0x374f41);}return null;};}function patchUpdates(_0x19f88e){return function(_0x287250){try{jsonpatch[_0x3028('0x1e')](_0x287250,_0x19f88e,!![]);}catch(_0x43b41e){return BPromise[_0x3028('0x1f')](_0x43b41e);}return _0x287250[_0x3028('0x20')]();};}function saveUpdates(_0x22da4a,_0x7df7b4){return function(_0x52c969){if(_0x52c969){return _0x52c969[_0x3028('0x21')](_0x22da4a)[_0x3028('0x22')](function(_0x369d68){return _0x369d68;});}return null;};}function removeEntity(_0x289a07,_0x40d42b){return function(_0x328fc8){if(_0x328fc8){return _0x328fc8[_0x3028('0x23')]()[_0x3028('0x22')](function(){_0x289a07[_0x3028('0x16')](0xcc)[_0x3028('0x24')]();});}};}function handleEntityNotFound(_0x26b5c0,_0x132a3b){return function(_0x560711){if(!_0x560711){_0x26b5c0[_0x3028('0x15')](0x194);}return _0x560711;};}function handleError(_0x25d335,_0x193669){_0x193669=_0x193669||0x1f4;return function(_0x2c9935){logger[_0x3028('0x25')](_0x2c9935[_0x3028('0x26')]);if(_0x2c9935[_0x3028('0x27')]){delete _0x2c9935[_0x3028('0x27')];}_0x25d335[_0x3028('0x16')](_0x193669)[_0x3028('0x28')](_0x2c9935);};}exports['index']=function(_0x387d19,_0x4d4e2f){var _0x24bb97={},_0x2cb20e={},_0x3b5210={'count':0x0,'rows':[]};var _0x2b9495=_['map'](db[_0x3028('0x29')][_0x3028('0x2a')],function(_0x49700b){return{'name':_0x49700b[_0x3028('0x2b')],'type':_0x49700b[_0x3028('0x2c')][_0x3028('0x2d')]};});_0x2cb20e['model']=_[_0x3028('0x2e')](_['map'](_0x2b9495,_0x3028('0x27')),[_0x3028('0x2f')]);_0x2cb20e['query']=_[_0x3028('0x30')](_0x387d19[_0x3028('0x31')]);_0x2cb20e[_0x3028('0x32')]=_[_0x3028('0x33')](_0x2cb20e['model'],_0x2cb20e[_0x3028('0x31')]);_0x24bb97[_0x3028('0x34')]=_[_0x3028('0x33')](_0x2cb20e[_0x3028('0x35')],qs[_0x3028('0x36')](_0x387d19[_0x3028('0x31')][_0x3028('0x36')]));_0x24bb97[_0x3028('0x34')]=_0x24bb97['attributes'][_0x3028('0x37')]?_0x24bb97[_0x3028('0x34')]:_0x2cb20e['model'];if(!_0x387d19[_0x3028('0x31')][_0x3028('0x38')](_0x3028('0x39'))){_0x24bb97[_0x3028('0x1b')]=qs[_0x3028('0x1b')](_0x387d19[_0x3028('0x31')]['limit']);_0x24bb97[_0x3028('0x1a')]=qs[_0x3028('0x1a')](_0x387d19[_0x3028('0x31')][_0x3028('0x1a')]);}_0x24bb97['order']=qs[_0x3028('0x3a')](_0x387d19['query'][_0x3028('0x3a')]);_0x24bb97[_0x3028('0x3b')]=qs[_0x3028('0x32')](_['pick'](_0x387d19['query'],_0x2cb20e[_0x3028('0x32')]),_0x2b9495);if(_0x387d19['query'][_0x3028('0x3c')]){_0x24bb97[_0x3028('0x3b')]=_[_0x3028('0x3d')](_0x24bb97[_0x3028('0x3b')],{'$or':_[_0x3028('0x3e')](_0x2b9495,function(_0x1f0f86){if(_0x1f0f86[_0x3028('0x2c')]!=='VIRTUAL'){var _0xf01bb={};_0xf01bb[_0x1f0f86[_0x3028('0x27')]]={'$like':'%'+_0x387d19[_0x3028('0x31')][_0x3028('0x3c')]+'%'};return _0xf01bb;}})});}_0x24bb97=_['merge']({},_0x24bb97,_0x387d19['options']);var _0x56d600={'where':_0x24bb97['where']};return db['VoiceRecording'][_0x3028('0x19')](_0x56d600)['then'](function(_0x29a604){_0x3b5210['count']=_0x29a604;if(_0x387d19[_0x3028('0x31')][_0x3028('0x3f')]){_0x24bb97[_0x3028('0x40')]=[{'all':!![]}];}return db['VoiceRecording'][_0x3028('0x41')](_0x24bb97);})[_0x3028('0x22')](function(_0x1896be){_0x3b5210[_0x3028('0x42')]=_0x1896be;return _0x3b5210;})[_0x3028('0x22')](respondWithFilteredResult(_0x4d4e2f,_0x24bb97))['catch'](handleError(_0x4d4e2f,null));};exports[_0x3028('0x43')]=function(_0x1f7f0c,_0x57f112){var _0x584832={'raw':![],'where':{'id':_0x1f7f0c[_0x3028('0x44')]['id']}},_0x27e16a={};_0x27e16a[_0x3028('0x35')]=_[_0x3028('0x30')](db[_0x3028('0x29')]['rawAttributes']);_0x27e16a[_0x3028('0x31')]=_[_0x3028('0x30')](_0x1f7f0c[_0x3028('0x31')]);_0x27e16a[_0x3028('0x32')]=_[_0x3028('0x33')](_0x27e16a['model'],_0x27e16a[_0x3028('0x31')]);_0x584832[_0x3028('0x34')]=_['intersection'](_0x27e16a[_0x3028('0x35')],qs[_0x3028('0x36')](_0x1f7f0c[_0x3028('0x31')][_0x3028('0x36')]));_0x584832[_0x3028('0x34')]=_0x584832[_0x3028('0x34')][_0x3028('0x37')]?_0x584832[_0x3028('0x34')]:_0x27e16a[_0x3028('0x35')];if(_0x1f7f0c[_0x3028('0x31')][_0x3028('0x3f')]){_0x584832[_0x3028('0x40')]=[{'all':!![]}];}_0x584832=_[_0x3028('0x3d')]({},_0x584832,_0x1f7f0c['options']);return db['VoiceRecording'][_0x3028('0x45')](_0x584832)['then'](handleEntityNotFound(_0x57f112,null))[_0x3028('0x22')](respondWithResult(_0x57f112,null))[_0x3028('0x46')](handleError(_0x57f112,null));};exports[_0x3028('0x47')]=function(_0x3d2181,_0xf558cc){return db['VoiceRecording'][_0x3028('0x47')](_0x3d2181[_0x3028('0x48')],{})[_0x3028('0x22')](respondWithResult(_0xf558cc,0xc9))[_0x3028('0x46')](handleError(_0xf558cc,null));};exports[_0x3028('0x21')]=function(_0x382b7e,_0x8c1dc7){if(_0x382b7e[_0x3028('0x48')]['id']){delete _0x382b7e['body']['id'];}return db[_0x3028('0x29')]['find']({'where':{'id':_0x382b7e[_0x3028('0x44')]['id']}})['then'](handleEntityNotFound(_0x8c1dc7,null))[_0x3028('0x22')](saveUpdates(_0x382b7e[_0x3028('0x48')],null))['then'](respondWithResult(_0x8c1dc7,null))[_0x3028('0x46')](handleError(_0x8c1dc7,null));};exports[_0x3028('0x49')]=function(_0x33d868,_0x5de8c7){return db['VoiceRecording']['describe']()[_0x3028('0x22')](respondWithResult(_0x5de8c7,null))[_0x3028('0x46')](handleError(_0x5de8c7,null));};exports[_0x3028('0x4a')]=function(_0x586ab7,_0x325c2e,_0x46725d){var _0x3d9d96=require(_0x3028('0x4b'));var _0x45353f=![];var _0x1de27={};if(_0x586ab7['query'][_0x3028('0x2c')]&&_0x586ab7[_0x3028('0x31')][_0x3028('0x2c')]===_0x3028('0x4c')){_0x1de27[_0x3028('0x4c')]=_0x586ab7[_0x3028('0x44')]['id'];}else{_0x1de27['id']=_0x586ab7[_0x3028('0x44')]['id'];}return db['VoiceRecording'][_0x3028('0x45')]({'where':_0x1de27,'attributes':['id',_0x3028('0x4d')],'raw':!![]})[_0x3028('0x22')](handleEntityNotFound(_0x325c2e,null))[_0x3028('0x22')](function(_0x44d237){if(_0x44d237){var _0x1ed196=_0x44d237[_0x3028('0x4d')];var _0x5ab164=util['format'](_0x3028('0x4e'),_0x1ed196);if(fs[_0x3028('0x4f')](_0x5ab164)){_0x45353f=!![];return _0x3d9d96[_0x3028('0x50')](_0x5ab164,_0x1ed196,config[_0x3028('0x51')][_0x3028('0x52')])[_0x3028('0x22')](function(){return _0x44d237;});}return _0x44d237;}})['then'](function(_0x121f2e){if(_0x121f2e){var _0x11758c=_0x121f2e[_0x3028('0x4d')];if(!fs[_0x3028('0x4f')](_0x11758c)){throw new db['Sequelize'][(_0x3028('0x53'))](_0x3028('0x54'));}if(_0x121f2e[_0x3028('0x55')]){return _0x325c2e[_0x3028('0x4a')](_0x11758c,_0x121f2e[_0x3028('0x55')]+path['extname'](_0x11758c),function(){if(_0x45353f){fs[_0x3028('0x56')](_0x11758c);}});}else{return _0x325c2e[_0x3028('0x4a')](_0x11758c,function(_0x13a180){if(_0x45353f){fs['unlink'](_0x11758c);}});}}})['catch'](function(_0x1d3dd1){if(_0x1d3dd1[_0x3028('0x57')]===_0x3028('0x54')){_0x325c2e[_0x3028('0x16')](0x194)['send'](_0x3028('0x58'));}else{return handleError(_0x325c2e,null);}});};exports[_0x3028('0x59')]=function(_0x21b492,_0x5d6e5d,_0x353943){var _0x1e5d9b=require(_0x3028('0x4b'));var _0x5d9f51=![];var _0x2b619f={'$and':[db[_0x3028('0x5a')]['where'](db['sequelize']['fn'](_0x3028('0x5b'),db['sequelize'][_0x3028('0x5c')](_0x3028('0x4c'))),_0x21b492[_0x3028('0x31')]['token'])]};if(_0x21b492['query'][_0x3028('0x2c')]&&_0x21b492[_0x3028('0x31')][_0x3028('0x2c')]===_0x3028('0x4c')){_0x2b619f['$and']['push']({'uniqueid':_0x21b492[_0x3028('0x44')]['id']});}else{_0x2b619f[_0x3028('0x5d')]['push']({'id':_0x21b492[_0x3028('0x44')]['id']});}return db[_0x3028('0x29')][_0x3028('0x45')]({'where':_0x2b619f,'attributes':['id',_0x3028('0x4d')],'raw':!![]})[_0x3028('0x22')](handleEntityNotFound(_0x5d6e5d,null))[_0x3028('0x22')](function(_0x50678c){if(_0x50678c){var _0x447d91=util[_0x3028('0x2f')](_0x3028('0x4e'),_0x50678c[_0x3028('0x4d')]);if(fs[_0x3028('0x4f')](_0x447d91)){_0x5d9f51=!![];return _0x1e5d9b[_0x3028('0x50')](_0x447d91,_0x50678c['value'],config[_0x3028('0x51')][_0x3028('0x52')])[_0x3028('0x22')](function(){return _0x50678c;});}return _0x50678c;}})[_0x3028('0x22')](function(_0x1c580c){if(_0x1c580c){if(!fs[_0x3028('0x4f')](_0x1c580c[_0x3028('0x4d')])){throw new db['Sequelize'][(_0x3028('0x53'))](_0x3028('0x54'));}if(_0x1c580c['filename']){return _0x5d6e5d[_0x3028('0x4a')](_0x1c580c[_0x3028('0x4d')],_0x1c580c[_0x3028('0x55')]+path[_0x3028('0x5e')](_0x1c580c[_0x3028('0x4d')]),function(){if(_0x5d9f51){fs['unlink'](_0x1c580c[_0x3028('0x4d')]);}});}else{return _0x5d6e5d[_0x3028('0x4a')](_0x1c580c[_0x3028('0x4d')],function(_0x302d5d){if(_0x5d9f51){fs[_0x3028('0x56')](_0x1c580c[_0x3028('0x4d')]);}});}}})[_0x3028('0x46')](handleError(_0x5d6e5d,null));};exports['destroy']=function(_0x122df8,_0xf3f589){return db[_0x3028('0x29')][_0x3028('0x45')]({'where':{'id':_0x122df8['params']['id']}})['then'](function(_0xd496e8){if(_[_0x3028('0x5f')](_0xd496e8)){throw new ReferenceError(_0x3028('0x60'));}return _0xd496e8;})[_0x3028('0x22')](function(_0x5cdf14){var _0x25a561=_0x5cdf14['value'];logger[_0x3028('0x61')](_0x3028('0x62'),_0x25a561);if(!_[_0x3028('0x5f')](_0x5cdf14[_0x3028('0x4d')])&&fs['existsSync'](_0x25a561)){logger[_0x3028('0x61')](_0x3028('0x63')+_0x25a561+_0x3028('0x64'));fs['unlinkSync'](_0x25a561);}_0x25a561=_0x25a561+_0x3028('0x65');if(!_['isNil'](_0x5cdf14[_0x3028('0x4d')])&&fs[_0x3028('0x4f')](_0x25a561)){logger['info'](_0x3028('0x63')+_0x25a561+_0x3028('0x64'));fs[_0x3028('0x66')](_0x25a561);}return _0x5cdf14;})['then'](function(_0x214677){if(!_0x214677)throw new InternalError();return _0x214677[_0x3028('0x23')]();})['then'](function(){_0xf3f589[_0x3028('0x16')](0xcc)[_0x3028('0x24')]();})[_0x3028('0x46')](handleError(_0xf3f589,null));};function getBucketslist(_0x4b8f43,_0x4d73a8,_0x296c16){return new Promise(function(_0x179cde,_0x299620){var _0x35b059=new AWS['S3']({'accessKeyId':_0x4d73a8,'secretAccessKey':_0x4b8f43,'region':_0x296c16});_0x35b059[_0x3028('0x67')]({},function(_0xbe8c50,_0x4559ea){if(_0xbe8c50){return _0x299620(_0xbe8c50);}else{return _0x179cde(_0x4559ea);}});});}function createBucket(_0x5c1be1,_0x31b563,_0x4927aa,_0x3e6585){return new Promise(function(_0x4087eb,_0x493ae4){var _0x56b3d3=new AWS['S3']({'accessKeyId':_0x31b563,'secretAccessKey':_0x5c1be1,'region':_0x4927aa});_0x56b3d3['createBucket']({'Bucket':_0x3e6585},function(_0x18c6f5,_0x355ad2){if(_0x18c6f5){return _0x493ae4(_0x18c6f5);}else{return _0x4087eb(_0x355ad2);}});});}function uploadFile(_0x699f7b,_0xcd2050,_0x4c6937,_0x22acbc,_0x54671d,_0x3e8d75){return new Promise(function(_0x5c0109,_0x263779){var _0x100f43=new AWS['S3']({'accessKeyId':_0xcd2050,'secretAccessKey':_0x699f7b,'region':_0x4c6937});_0x100f43[_0x3028('0x68')]({'Bucket':_0x22acbc,'Key':_0x54671d,'Body':_0x3e8d75},function(_0x576bae,_0x148da5){if(_0x576bae){return _0x263779(_0x576bae);}else{return _0x5c0109(_0x148da5);}});});}function startTranscribe(_0x2ee63a,_0x5f00ff,_0x2463ba,_0x526a22,_0x52e4fa,_0x173acb){return new Promise(function(_0x182d58,_0x373bfd){var _0x4db81e=new AWS[(_0x3028('0x69'))]({'accessKeyId':_0x5f00ff,'secretAccessKey':_0x2ee63a,'region':_0x2463ba});_0x4db81e['startTranscriptionJob']({'TranscriptionJobName':_0x526a22,'LanguageCode':_0x52e4fa,'Media':{'MediaFileUri':_0x173acb}},function(_0x1334ed,_0x2a6797){if(_0x1334ed){return _0x373bfd(_0x1334ed);}else{return _0x182d58(_0x2a6797);}});});}function transcribe(_0x27c299,_0x2f6b9c,_0x49c9b1,_0x174357,_0x4115ca,_0x3d893a,_0x2b3f22){return new Promise(function(_0x12daf4,_0x5ef221){var _0x247525={};logger[_0x3028('0x61')](util['format'](_0x3028('0x6a'),_0x27c299,_0x4115ca));return uploadFile(_0x2f6b9c,_0x49c9b1,_0x174357,_0x4115ca,path[_0x3028('0x6b')](_0x3d893a),fs[_0x3028('0x6c')](_0x3d893a))[_0x3028('0x22')](function(_0x44cdbf){logger[_0x3028('0x61')](util[_0x3028('0x2f')](_0x3028('0x6d'),_0x27c299,_0x4115ca,_0x44cdbf[_0x3028('0x6e')]));_0x247525[_0x3028('0x6f')]=_0x44cdbf[_0x3028('0x70')];_0x247525[_0x3028('0x71')]=_0x44cdbf[_0x3028('0x6e')];logger[_0x3028('0x61')](util['format'](_0x3028('0x72'),_0x27c299));return startTranscribe(_0x2f6b9c,_0x49c9b1,_0x174357,uuidv4(),_0x2b3f22,_0x44cdbf[_0x3028('0x6e')]);})[_0x3028('0x22')](function(_0x32d95f){logger['info'](util[_0x3028('0x2f')]('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x27c299,_0x32d95f[_0x3028('0x73')][_0x3028('0x74')]));_0x247525[_0x3028('0x75')]=_0x32d95f['TranscriptionJob'][_0x3028('0x74')];_0x247525['transcribeStatus']=_0x32d95f['TranscriptionJob'][_0x3028('0x76')];return _0x12daf4(_0x247525);})[_0x3028('0x46')](function(_0x51d652){return _0x5ef221(_0x51d652);});});}exports[_0x3028('0x77')]=function(_0x470a35,_0x27ff60,_0x49e8a5){var _0x2bc66a;var _0x1c22e7;var _0x54aed9;var _0x35b6c5=require(_0x3028('0x4b'));return db[_0x3028('0x29')][_0x3028('0x78')]({'where':{'id':_0x470a35['params']['id']}})[_0x3028('0x22')](function(_0x1a9e80){if(_0x1a9e80){var _0x4e77d2=util['format'](_0x3028('0x4e'),_0x1a9e80[_0x3028('0x4d')]);if(fs[_0x3028('0x4f')](_0x4e77d2)){cypher=!![];return _0x35b6c5['decryptFile'](_0x4e77d2,_0x1a9e80[_0x3028('0x4d')],config[_0x3028('0x51')]['recording'])[_0x3028('0x22')](function(){return _0x1a9e80;});}return _0x1a9e80;}})[_0x3028('0x22')](function(_0x2069fb){if(!_0x2069fb){throw new db['Sequelize']['ValidationError'](_0x3028('0x79'));}_0x1c22e7=_0x2069fb;return db[_0x3028('0x7a')][_0x3028('0x78')]({'where':{'id':0x1}});})[_0x3028('0x22')](handleEntityNotFound(_0x27ff60,null))['then'](function(_0x306e74){if(_0x306e74){_0x2bc66a=_0x306e74;if(!_0x2bc66a['transcribe']||!_0x2bc66a['transcribeAccountId']||!_0x2bc66a[_0x3028('0x7b')]||!_0x2bc66a['language']||!_0x2bc66a[_0x3028('0x6f')]){throw new db[(_0x3028('0x7c'))][(_0x3028('0x53'))](_0x3028('0x7d'));}if(_0x470a35[_0x3028('0x48')][_0x3028('0x7e')]&&(!_0x2bc66a[_0x3028('0x7f')]||!_0x2bc66a[_0x3028('0x80')]||!_0x2bc66a[_0x3028('0x81')]||!_0x2bc66a[_0x3028('0x82')]||!_0x2bc66a[_0x3028('0x6f')])){throw new db[(_0x3028('0x7c'))]['ValidationError'](_0x3028('0x83'));}return db['CloudProvider'][_0x3028('0x78')]({'where':{'id':_0x2bc66a[_0x3028('0x84')]}});}})[_0x3028('0x22')](function(_0x1ec6b5){if(!_0x1ec6b5){throw new db[(_0x3028('0x7c'))][(_0x3028('0x53'))](_0x3028('0x85'));}if(!_0x1ec6b5[_0x3028('0x86')]||!_0x1ec6b5[_0x3028('0x87')]){throw new db[(_0x3028('0x7c'))][(_0x3028('0x53'))](_0x3028('0x88'));}_0x54aed9=_0x1ec6b5;return getBucketslist(_0x54aed9[_0x3028('0x86')],_0x54aed9[_0x3028('0x87')],_0x2bc66a[_0x3028('0x7b')]);})[_0x3028('0x22')](function(_0x28fe08){if(_0x28fe08&&_0x28fe08[_0x3028('0x89')]){var _0x3aa6c2=_[_0x3028('0x45')](_0x28fe08[_0x3028('0x89')],function(_0x1fd9f9){return _0x1fd9f9['Name']===_0x2bc66a[_0x3028('0x6f')];});if(!_0x3aa6c2){logger[_0x3028('0x61')](util['format']('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0x470a35[_0x3028('0x44')]['id'],_0x2bc66a[_0x3028('0x6f')]));return createBucket(_0x54aed9[_0x3028('0x86')],_0x54aed9['data2'],_0x2bc66a['transcribeRegion'],_0x2bc66a[_0x3028('0x6f')]);}logger[_0x3028('0x61')](util[_0x3028('0x2f')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0x470a35['params']['id'],_0x2bc66a[_0x3028('0x6f')]));return;}})['then'](function(_0x171d5b){if(_0x1c22e7['transcribeStatus']==='NEW'){return transcribe(_0x470a35[_0x3028('0x44')]['id'],_0x54aed9[_0x3028('0x86')],_0x54aed9[_0x3028('0x87')],_0x2bc66a['transcribeRegion'],_0x2bc66a[_0x3028('0x6f')],_0x1c22e7[_0x3028('0x4d')],_0x2bc66a['language']);}else{logger['info'](util[_0x3028('0x2f')](_0x3028('0x8a'),_0x470a35[_0x3028('0x44')]['id']));return{'transcribeStatus':_0x3028('0x8b')};}})[_0x3028('0x22')](function(_0x17c812){if(_0x17c812){_0x17c812['tempSentiment']=_0x470a35['body'][_0x3028('0x7e')];return _0x1c22e7[_0x3028('0x8c')](_0x17c812);}})[_0x3028('0x22')](respondWithResult(_0x27ff60,null))[_0x3028('0x46')](handleError(_0x27ff60,null));};function writeFile(_0x2c3d59,_0x2137bb){return new Promise(function(_0x44205b,_0x41e650){fs[_0x3028('0x8d')](_0x2137bb,_0x2c3d59,function(_0x200231,_0x2e3a9c){if(_0x200231){return _0x41e650(_0x200231);}else{return _0x44205b(_0x2e3a9c);}});});}exports[_0x3028('0x8e')]=function(_0x4097a5,_0x173467,_0x1b8543){return db[_0x3028('0x29')]['findOne']({'where':{'id':_0x4097a5[_0x3028('0x44')]['id']}})[_0x3028('0x22')](handleEntityNotFound(_0x173467))[_0x3028('0x22')](function(_0x31aaa6){if(_0x31aaa6&&_0x31aaa6[_0x3028('0x8f')]){var _0x417802=_0x31aaa6[_0x3028('0x8f')];var _0x54cd1c=config['root']+_0x3028('0x90')+_0x31aaa6['id']+_0x3028('0x91');if(fs[_0x3028('0x4f')](_0x54cd1c)){return _0x54cd1c;}return writeFile(_0x417802,_0x54cd1c)[_0x3028('0x22')](function(){return _0x54cd1c;});}else{throw new db[(_0x3028('0x7c'))][(_0x3028('0x53'))](_0x3028('0x92'));}})[_0x3028('0x22')](function(_0x1be5f4){return _0x173467[_0x3028('0x4a')](_0x1be5f4);})[_0x3028('0x46')](handleError(_0x173467));}; \ No newline at end of file +var _0x42d1=['[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','transcribeStatus','TranscriptionJobStatus','runTranscribe','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','language','Transcribe\x20not\x20configured','runSentiment','sentimentAccountId','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','data1','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','data2','transcribeRegion','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','crypto','desk.js','querystring','papaparse','aws-sdk','uuid/v4','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','set','Content-Range','json','apply','update','then','error','stack','name','VoiceRecording','fieldName','type','model','differenceBy','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','count','include','findAll','rows','catch','show','params','includeAll','body','describe','../../components/encryptor','uniqueid','find','format','%s.cypher','secrets','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','download','extname','unlink','message','send','downloads','sequelize','MD5','col','token','$and','push','existsSync','decryptFile','recording','value','destroy','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','listBuckets','createBucket','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request'];(function(_0x223996,_0x43a9b7){var _0x2f1ec8=function(_0x2e9ff2){while(--_0x2e9ff2){_0x223996['push'](_0x223996['shift']());}};_0x2f1ec8(++_0x43a9b7);}(_0x42d1,0x1eb));var _0x142d=function(_0x16acb4,_0x2ad48d){_0x16acb4=_0x16acb4-0x0;var _0xfeed39=_0x42d1[_0x16acb4];return _0xfeed39;};'use strict';var emlformat=require(_0x142d('0x0'));var rimraf=require(_0x142d('0x1'));var zipdir=require(_0x142d('0x2'));var jsonpatch=require(_0x142d('0x3'));var rp=require(_0x142d('0x4'));var moment=require(_0x142d('0x5'));var BPromise=require(_0x142d('0x6'));var Mustache=require(_0x142d('0x7'));var util=require(_0x142d('0x8'));var path=require(_0x142d('0x9'));var sox=require('sox');var csv=require(_0x142d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x142d('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x142d('0xc'));var toCsv=require('to-csv');var querystring=require(_0x142d('0xd'));var Papa=require(_0x142d('0xe'));var AWS=require(_0x142d('0xf'));var uuidv4=require(_0x142d('0x10'));var Redis=require('ioredis');var authService=require(_0x142d('0x11'));var qs=require(_0x142d('0x12'));var as=require(_0x142d('0x13'));var hardwareService=require(_0x142d('0x14'));var logger=require(_0x142d('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x142d('0x16'));var db=require(_0x142d('0x17'))['db'];function respondWithStatusCode(_0x2a332b,_0x4dd243){_0x4dd243=_0x4dd243||0xcc;return function(_0x8a238a){if(_0x8a238a){return _0x2a332b[_0x142d('0x18')](_0x4dd243);}return _0x2a332b[_0x142d('0x19')](_0x4dd243)[_0x142d('0x1a')]();};}function respondWithResult(_0x335649,_0x1c9e4a){_0x1c9e4a=_0x1c9e4a||0xc8;return function(_0x1137bf){if(_0x1137bf){return _0x335649[_0x142d('0x19')](_0x1c9e4a)['json'](_0x1137bf);}};}function respondWithFilteredResult(_0x38465a,_0x1713fb){return function(_0x4b6307){if(_0x4b6307){var _0x26a048=typeof _0x1713fb[_0x142d('0x1b')]===_0x142d('0x1c')&&typeof _0x1713fb[_0x142d('0x1d')]===_0x142d('0x1c');var _0x5cc852=_0x4b6307['count'];var _0x1343dd=_0x26a048?0x0:_0x1713fb[_0x142d('0x1b')];var _0x5c3416=_0x26a048?_0x4b6307['count']:_0x1713fb[_0x142d('0x1b')]+_0x1713fb[_0x142d('0x1d')];var _0x4d22bc;if(_0x5c3416>=_0x5cc852){_0x5c3416=_0x5cc852;_0x4d22bc=0xc8;}else{_0x4d22bc=0xce;}_0x38465a[_0x142d('0x19')](_0x4d22bc);return _0x38465a[_0x142d('0x1e')](_0x142d('0x1f'),_0x1343dd+'-'+_0x5c3416+'/'+_0x5cc852)[_0x142d('0x20')](_0x4b6307);}return null;};}function patchUpdates(_0x386417){return function(_0x49bd4f){try{jsonpatch[_0x142d('0x21')](_0x49bd4f,_0x386417,!![]);}catch(_0x260ff2){return BPromise['reject'](_0x260ff2);}return _0x49bd4f['save']();};}function saveUpdates(_0x5d3368,_0x54926a){return function(_0xdef55e){if(_0xdef55e){return _0xdef55e[_0x142d('0x22')](_0x5d3368)[_0x142d('0x23')](function(_0x3a3a5b){return _0x3a3a5b;});}return null;};}function removeEntity(_0x1f804a,_0xcec7a){return function(_0x259cf9){if(_0x259cf9){return _0x259cf9['destroy']()[_0x142d('0x23')](function(){_0x1f804a[_0x142d('0x19')](0xcc)[_0x142d('0x1a')]();});}};}function handleEntityNotFound(_0x36d126,_0x45eceb){return function(_0x4b0d6a){if(!_0x4b0d6a){_0x36d126[_0x142d('0x18')](0x194);}return _0x4b0d6a;};}function handleError(_0xff1f6f,_0x2f0ca7){_0x2f0ca7=_0x2f0ca7||0x1f4;return function(_0x28fea3){logger[_0x142d('0x24')](_0x28fea3[_0x142d('0x25')]);if(_0x28fea3[_0x142d('0x26')]){delete _0x28fea3[_0x142d('0x26')];}_0xff1f6f[_0x142d('0x19')](_0x2f0ca7)['send'](_0x28fea3);};}exports['index']=function(_0xa58c85,_0x90381a){var _0x48cae7={},_0x22f5b5={},_0x132e4e={'count':0x0,'rows':[]};var _0x3fd8e1=_['map'](db[_0x142d('0x27')]['rawAttributes'],function(_0x50cad3){return{'name':_0x50cad3[_0x142d('0x28')],'type':_0x50cad3[_0x142d('0x29')]['key']};});_0x22f5b5[_0x142d('0x2a')]=_[_0x142d('0x2b')](_[_0x142d('0x2c')](_0x3fd8e1,_0x142d('0x26')),['format']);_0x22f5b5[_0x142d('0x2d')]=_[_0x142d('0x2e')](_0xa58c85[_0x142d('0x2d')]);_0x22f5b5['filters']=_[_0x142d('0x2f')](_0x22f5b5['model'],_0x22f5b5[_0x142d('0x2d')]);_0x48cae7[_0x142d('0x30')]=_['intersection'](_0x22f5b5[_0x142d('0x2a')],qs[_0x142d('0x31')](_0xa58c85['query'][_0x142d('0x31')]));_0x48cae7[_0x142d('0x30')]=_0x48cae7[_0x142d('0x30')][_0x142d('0x32')]?_0x48cae7[_0x142d('0x30')]:_0x22f5b5['model'];if(!_0xa58c85[_0x142d('0x2d')][_0x142d('0x33')]('nolimit')){_0x48cae7[_0x142d('0x1d')]=qs[_0x142d('0x1d')](_0xa58c85[_0x142d('0x2d')]['limit']);_0x48cae7['offset']=qs[_0x142d('0x1b')](_0xa58c85[_0x142d('0x2d')][_0x142d('0x1b')]);}_0x48cae7[_0x142d('0x34')]=qs['sort'](_0xa58c85[_0x142d('0x2d')][_0x142d('0x35')]);_0x48cae7[_0x142d('0x36')]=qs[_0x142d('0x37')](_[_0x142d('0x38')](_0xa58c85[_0x142d('0x2d')],_0x22f5b5[_0x142d('0x37')]),_0x3fd8e1);if(_0xa58c85[_0x142d('0x2d')]['filter']){_0x48cae7[_0x142d('0x36')]=_[_0x142d('0x39')](_0x48cae7[_0x142d('0x36')],{'$or':_[_0x142d('0x2c')](_0x3fd8e1,function(_0x8c9f57){if(_0x8c9f57[_0x142d('0x29')]!==_0x142d('0x3a')){var _0x250863={};_0x250863[_0x8c9f57[_0x142d('0x26')]]={'$like':'%'+_0xa58c85[_0x142d('0x2d')][_0x142d('0x3b')]+'%'};return _0x250863;}})});}_0x48cae7=_[_0x142d('0x39')]({},_0x48cae7,_0xa58c85[_0x142d('0x3c')]);var _0x233881={'where':_0x48cae7[_0x142d('0x36')]};return db[_0x142d('0x27')][_0x142d('0x3d')](_0x233881)[_0x142d('0x23')](function(_0x4dda31){_0x132e4e[_0x142d('0x3d')]=_0x4dda31;if(_0xa58c85[_0x142d('0x2d')]['includeAll']){_0x48cae7[_0x142d('0x3e')]=[{'all':!![]}];}return db[_0x142d('0x27')][_0x142d('0x3f')](_0x48cae7);})['then'](function(_0x2deeaf){_0x132e4e[_0x142d('0x40')]=_0x2deeaf;return _0x132e4e;})[_0x142d('0x23')](respondWithFilteredResult(_0x90381a,_0x48cae7))[_0x142d('0x41')](handleError(_0x90381a,null));};exports[_0x142d('0x42')]=function(_0x148613,_0x1e693a){var _0x242ecf={'raw':![],'where':{'id':_0x148613[_0x142d('0x43')]['id']}},_0x4edf54={};_0x4edf54[_0x142d('0x2a')]=_['keys'](db['VoiceRecording']['rawAttributes']);_0x4edf54[_0x142d('0x2d')]=_[_0x142d('0x2e')](_0x148613[_0x142d('0x2d')]);_0x4edf54['filters']=_['intersection'](_0x4edf54[_0x142d('0x2a')],_0x4edf54[_0x142d('0x2d')]);_0x242ecf[_0x142d('0x30')]=_[_0x142d('0x2f')](_0x4edf54[_0x142d('0x2a')],qs[_0x142d('0x31')](_0x148613[_0x142d('0x2d')][_0x142d('0x31')]));_0x242ecf['attributes']=_0x242ecf[_0x142d('0x30')]['length']?_0x242ecf[_0x142d('0x30')]:_0x4edf54[_0x142d('0x2a')];if(_0x148613[_0x142d('0x2d')][_0x142d('0x44')]){_0x242ecf['include']=[{'all':!![]}];}_0x242ecf=_[_0x142d('0x39')]({},_0x242ecf,_0x148613[_0x142d('0x3c')]);return db[_0x142d('0x27')]['find'](_0x242ecf)[_0x142d('0x23')](handleEntityNotFound(_0x1e693a,null))['then'](respondWithResult(_0x1e693a,null))['catch'](handleError(_0x1e693a,null));};exports['create']=function(_0x1444dd,_0x4e1600){return db[_0x142d('0x27')]['create'](_0x1444dd[_0x142d('0x45')],{})[_0x142d('0x23')](respondWithResult(_0x4e1600,0xc9))[_0x142d('0x41')](handleError(_0x4e1600,null));};exports[_0x142d('0x22')]=function(_0x1f0d4f,_0x2a1562){if(_0x1f0d4f['body']['id']){delete _0x1f0d4f[_0x142d('0x45')]['id'];}return db[_0x142d('0x27')]['find']({'where':{'id':_0x1f0d4f[_0x142d('0x43')]['id']}})[_0x142d('0x23')](handleEntityNotFound(_0x2a1562,null))[_0x142d('0x23')](saveUpdates(_0x1f0d4f[_0x142d('0x45')],null))[_0x142d('0x23')](respondWithResult(_0x2a1562,null))['catch'](handleError(_0x2a1562,null));};exports[_0x142d('0x46')]=function(_0x4ad1c2,_0x5eec1b){return db[_0x142d('0x27')][_0x142d('0x46')]()[_0x142d('0x23')](respondWithResult(_0x5eec1b,null))[_0x142d('0x41')](handleError(_0x5eec1b,null));};exports['download']=function(_0xef3d9c,_0x402b66,_0x539301){var _0x104846=require(_0x142d('0x47'));var _0x5c0eb8=![];var _0x29e0bb={};if(_0xef3d9c[_0x142d('0x2d')][_0x142d('0x29')]&&_0xef3d9c[_0x142d('0x2d')]['type']===_0x142d('0x48')){_0x29e0bb['uniqueid']=_0xef3d9c['params']['id'];}else{_0x29e0bb['id']=_0xef3d9c[_0x142d('0x43')]['id'];}return db[_0x142d('0x27')][_0x142d('0x49')]({'where':_0x29e0bb,'attributes':['id','value'],'raw':!![]})[_0x142d('0x23')](handleEntityNotFound(_0x402b66,null))['then'](function(_0xbbc8a9){if(_0xbbc8a9){var _0x3d3a53=_0xbbc8a9['value'];var _0x55f390=util[_0x142d('0x4a')](_0x142d('0x4b'),_0x3d3a53);if(fs['existsSync'](_0x55f390)){_0x5c0eb8=!![];return _0x104846['decryptFile'](_0x55f390,_0x3d3a53,config[_0x142d('0x4c')]['recording'])['then'](function(){return _0xbbc8a9;});}return _0xbbc8a9;}})['then'](function(_0x54fef0){if(_0x54fef0){var _0x5676e3=_0x54fef0['value'];if(!fs['existsSync'](_0x5676e3)){throw new db[(_0x142d('0x4d'))][(_0x142d('0x4e'))](_0x142d('0x4f'));}if(_0x54fef0[_0x142d('0x50')]){return _0x402b66[_0x142d('0x51')](_0x5676e3,_0x54fef0['filename']+path[_0x142d('0x52')](_0x5676e3),function(){if(_0x5c0eb8){fs[_0x142d('0x53')](_0x5676e3);}});}else{return _0x402b66[_0x142d('0x51')](_0x5676e3,function(_0x121ca0){if(_0x5c0eb8){fs[_0x142d('0x53')](_0x5676e3);}});}}})['catch'](function(_0x590f19){if(_0x590f19[_0x142d('0x54')]===_0x142d('0x4f')){_0x402b66[_0x142d('0x19')](0x194)[_0x142d('0x55')]('Not\x20found');}else{return handleError(_0x402b66,null);}});};exports[_0x142d('0x56')]=function(_0x42b51a,_0xd7919f,_0xce1818){var _0x5b5e3c=require('../../components/encryptor');var _0x3ab0b4=![];var _0x2d5f07={'$and':[db[_0x142d('0x57')]['where'](db[_0x142d('0x57')]['fn'](_0x142d('0x58'),db[_0x142d('0x57')][_0x142d('0x59')]('uniqueid')),_0x42b51a[_0x142d('0x2d')][_0x142d('0x5a')])]};if(_0x42b51a[_0x142d('0x2d')]['type']&&_0x42b51a[_0x142d('0x2d')][_0x142d('0x29')]===_0x142d('0x48')){_0x2d5f07[_0x142d('0x5b')][_0x142d('0x5c')]({'uniqueid':_0x42b51a[_0x142d('0x43')]['id']});}else{_0x2d5f07['$and'][_0x142d('0x5c')]({'id':_0x42b51a[_0x142d('0x43')]['id']});}return db[_0x142d('0x27')][_0x142d('0x49')]({'where':_0x2d5f07,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0xd7919f,null))[_0x142d('0x23')](function(_0xd75c74){if(_0xd75c74){var _0x5a3557=util[_0x142d('0x4a')]('%s.cypher',_0xd75c74['value']);if(fs[_0x142d('0x5d')](_0x5a3557)){_0x3ab0b4=!![];return _0x5b5e3c[_0x142d('0x5e')](_0x5a3557,_0xd75c74['value'],config[_0x142d('0x4c')][_0x142d('0x5f')])['then'](function(){return _0xd75c74;});}return _0xd75c74;}})[_0x142d('0x23')](function(_0x3b5a2f){if(_0x3b5a2f){if(!fs[_0x142d('0x5d')](_0x3b5a2f[_0x142d('0x60')])){throw new db['Sequelize'][(_0x142d('0x4e'))](_0x142d('0x4f'));}if(_0x3b5a2f['filename']){return _0xd7919f['download'](_0x3b5a2f[_0x142d('0x60')],_0x3b5a2f[_0x142d('0x50')]+path['extname'](_0x3b5a2f[_0x142d('0x60')]),function(){if(_0x3ab0b4){fs[_0x142d('0x53')](_0x3b5a2f[_0x142d('0x60')]);}});}else{return _0xd7919f[_0x142d('0x51')](_0x3b5a2f[_0x142d('0x60')],function(_0x22cd8f){if(_0x3ab0b4){fs[_0x142d('0x53')](_0x3b5a2f[_0x142d('0x60')]);}});}}})['catch'](handleError(_0xd7919f,null));};exports[_0x142d('0x61')]=function(_0x17fa33,_0x5f5490){return db[_0x142d('0x27')][_0x142d('0x49')]({'where':{'id':_0x17fa33[_0x142d('0x43')]['id']}})['then'](function(_0x25181b){if(_[_0x142d('0x62')](_0x25181b)){throw new ReferenceError(_0x142d('0x63'));}return _0x25181b;})[_0x142d('0x23')](function(_0x1e5bcf){var _0x16266a=_0x1e5bcf[_0x142d('0x60')];logger[_0x142d('0x64')](_0x142d('0x65'),_0x16266a);if(!_[_0x142d('0x62')](_0x1e5bcf[_0x142d('0x60')])&&fs[_0x142d('0x5d')](_0x16266a)){logger[_0x142d('0x64')](_0x142d('0x66')+_0x16266a+_0x142d('0x67'));fs[_0x142d('0x68')](_0x16266a);}_0x16266a=_0x16266a+_0x142d('0x69');if(!_[_0x142d('0x62')](_0x1e5bcf[_0x142d('0x60')])&&fs[_0x142d('0x5d')](_0x16266a)){logger[_0x142d('0x64')](_0x142d('0x66')+_0x16266a+_0x142d('0x67'));fs[_0x142d('0x68')](_0x16266a);}return _0x1e5bcf;})[_0x142d('0x23')](function(_0x4435b1){if(!_0x4435b1)throw new InternalError();return _0x4435b1[_0x142d('0x61')]();})[_0x142d('0x23')](function(){_0x5f5490['status'](0xcc)[_0x142d('0x1a')]();})['catch'](handleError(_0x5f5490,null));};function getBucketslist(_0x9ef993,_0x4f5493,_0x53f90a){return new Promise(function(_0x24e7cd,_0x281c2a){var _0x17e9bd=new AWS['S3']({'accessKeyId':_0x4f5493,'secretAccessKey':_0x9ef993,'region':_0x53f90a});_0x17e9bd[_0x142d('0x6a')]({},function(_0x108a09,_0x4cb6a2){if(_0x108a09){return _0x281c2a(_0x108a09);}else{return _0x24e7cd(_0x4cb6a2);}});});}function createBucket(_0x2d1383,_0x26a23f,_0x4ac3c3,_0xc8dbc5){return new Promise(function(_0x3fd4dd,_0x37038b){var _0x3d5846=new AWS['S3']({'accessKeyId':_0x26a23f,'secretAccessKey':_0x2d1383,'region':_0x4ac3c3});_0x3d5846[_0x142d('0x6b')]({'Bucket':_0xc8dbc5},function(_0x45ecb9,_0xdab8d7){if(_0x45ecb9){return _0x37038b(_0x45ecb9);}else{return _0x3fd4dd(_0xdab8d7);}});});}function uploadFile(_0x1fa175,_0x36af4b,_0x4c643c,_0x555edd,_0x2499a6,_0x43fe37){return new Promise(function(_0x3a4d2b,_0x4eb48f){var _0x485e8e=new AWS['S3']({'accessKeyId':_0x36af4b,'secretAccessKey':_0x1fa175,'region':_0x4c643c});_0x485e8e['upload']({'Bucket':_0x555edd,'Key':_0x2499a6,'Body':_0x43fe37},function(_0x4e4fd5,_0x523805){if(_0x4e4fd5){return _0x4eb48f(_0x4e4fd5);}else{return _0x3a4d2b(_0x523805);}});});}function startTranscribe(_0x33f473,_0x35fa23,_0x53fd02,_0x2b5cab,_0x2f22a8,_0x31f94c){return new Promise(function(_0x30ff1e,_0x406251){var _0x1df139=new AWS['TranscribeService']({'accessKeyId':_0x35fa23,'secretAccessKey':_0x33f473,'region':_0x53fd02});_0x1df139[_0x142d('0x6c')]({'TranscriptionJobName':_0x2b5cab,'LanguageCode':_0x2f22a8,'Media':{'MediaFileUri':_0x31f94c}},function(_0x2837de,_0x34347e){if(_0x2837de){return _0x406251(_0x2837de);}else{return _0x30ff1e(_0x34347e);}});});}function transcribe(_0x29e256,_0x1de2ec,_0x51f945,_0x41e653,_0x4297df,_0x562d04,_0x16daf7){return new Promise(function(_0x2c4522,_0x4d4dd2){var _0x343107={};logger[_0x142d('0x64')](util['format'](_0x142d('0x6d'),_0x29e256,_0x4297df));return uploadFile(_0x1de2ec,_0x51f945,_0x41e653,_0x4297df,path['basename'](_0x562d04),fs[_0x142d('0x6e')](_0x562d04))['then'](function(_0x450e4a){logger[_0x142d('0x64')](util[_0x142d('0x4a')](_0x142d('0x6f'),_0x29e256,_0x4297df,_0x450e4a[_0x142d('0x70')]));_0x343107[_0x142d('0x71')]=_0x450e4a[_0x142d('0x72')];_0x343107[_0x142d('0x73')]=_0x450e4a[_0x142d('0x70')];logger[_0x142d('0x64')](util['format'](_0x142d('0x74'),_0x29e256));return startTranscribe(_0x1de2ec,_0x51f945,_0x41e653,uuidv4(),_0x16daf7,_0x450e4a[_0x142d('0x70')]);})[_0x142d('0x23')](function(_0x396b9f){logger[_0x142d('0x64')](util[_0x142d('0x4a')](_0x142d('0x75'),_0x29e256,_0x396b9f['TranscriptionJob']['TranscriptionJobName']));_0x343107['transcribeName']=_0x396b9f[_0x142d('0x76')]['TranscriptionJobName'];_0x343107[_0x142d('0x77')]=_0x396b9f[_0x142d('0x76')][_0x142d('0x78')];return _0x2c4522(_0x343107);})[_0x142d('0x41')](function(_0x53ec4b){return _0x4d4dd2(_0x53ec4b);});});}exports[_0x142d('0x79')]=function(_0x517c74,_0x45e84a,_0x49d7d3){var _0x38b162;var _0x4b0865;var _0x199181;var _0x5d31eb=require(_0x142d('0x47'));return db[_0x142d('0x27')]['findOne']({'where':{'id':_0x517c74['params']['id']}})[_0x142d('0x23')](function(_0x1110fb){if(_0x1110fb){var _0x1da76f=util['format'](_0x142d('0x4b'),_0x1110fb[_0x142d('0x60')]);if(fs['existsSync'](_0x1da76f)){cypher=!![];return _0x5d31eb['decryptFile'](_0x1da76f,_0x1110fb['value'],config[_0x142d('0x4c')][_0x142d('0x5f')])[_0x142d('0x23')](function(){return _0x1110fb;});}return _0x1110fb;}})[_0x142d('0x23')](function(_0x2476ec){if(!_0x2476ec){throw new db['Sequelize'][(_0x142d('0x4e'))](_0x142d('0x7a'));}_0x4b0865=_0x2476ec;return db[_0x142d('0x7b')]['findOne']({'where':{'id':0x1}});})[_0x142d('0x23')](handleEntityNotFound(_0x45e84a,null))[_0x142d('0x23')](function(_0x2d7caa){if(_0x2d7caa){_0x38b162=_0x2d7caa;if(!_0x38b162[_0x142d('0x7c')]||!_0x38b162[_0x142d('0x7d')]||!_0x38b162['transcribeRegion']||!_0x38b162[_0x142d('0x7e')]||!_0x38b162[_0x142d('0x71')]){throw new db['Sequelize'][(_0x142d('0x4e'))](_0x142d('0x7f'));}if(_0x517c74[_0x142d('0x45')][_0x142d('0x80')]&&(!_0x38b162['sentiment']||!_0x38b162[_0x142d('0x81')]||!_0x38b162['sentimentRegion']||!_0x38b162[_0x142d('0x7e')]||!_0x38b162[_0x142d('0x71')])){throw new db['Sequelize'][(_0x142d('0x4e'))](_0x142d('0x82'));}return db[_0x142d('0x83')][_0x142d('0x84')]({'where':{'id':_0x38b162[_0x142d('0x7d')]}});}})[_0x142d('0x23')](function(_0x2e5bce){if(!_0x2e5bce){throw new db[(_0x142d('0x4d'))][(_0x142d('0x4e'))](_0x142d('0x85'));}if(!_0x2e5bce[_0x142d('0x86')]||!_0x2e5bce['data2']){throw new db[(_0x142d('0x4d'))][(_0x142d('0x4e'))](_0x142d('0x87'));}_0x199181=_0x2e5bce;return getBucketslist(_0x199181[_0x142d('0x86')],_0x199181['data2'],_0x38b162['transcribeRegion']);})[_0x142d('0x23')](function(_0x1826fa){if(_0x1826fa&&_0x1826fa[_0x142d('0x88')]){var _0x3e3773=_['find'](_0x1826fa['Buckets'],function(_0x2784b9){return _0x2784b9[_0x142d('0x89')]===_0x38b162[_0x142d('0x71')];});if(!_0x3e3773){logger['info'](util[_0x142d('0x4a')](_0x142d('0x8a'),_0x517c74[_0x142d('0x43')]['id'],_0x38b162['bucket']));return createBucket(_0x199181[_0x142d('0x86')],_0x199181[_0x142d('0x8b')],_0x38b162[_0x142d('0x8c')],_0x38b162[_0x142d('0x71')]);}logger[_0x142d('0x64')](util[_0x142d('0x4a')](_0x142d('0x8d'),_0x517c74[_0x142d('0x43')]['id'],_0x38b162[_0x142d('0x71')]));return;}})[_0x142d('0x23')](function(_0xe2c19d){if(_0x4b0865[_0x142d('0x77')]===_0x142d('0x8e')){return transcribe(_0x517c74[_0x142d('0x43')]['id'],_0x199181[_0x142d('0x86')],_0x199181['data2'],_0x38b162['transcribeRegion'],_0x38b162[_0x142d('0x71')],_0x4b0865[_0x142d('0x60')],_0x38b162['language']);}else{logger[_0x142d('0x64')](util[_0x142d('0x4a')](_0x142d('0x8f'),_0x517c74[_0x142d('0x43')]['id']));return{'transcribeStatus':_0x142d('0x90')};}})[_0x142d('0x23')](function(_0x176877){if(_0x176877){_0x176877['tempSentiment']=_0x517c74[_0x142d('0x45')][_0x142d('0x80')];return _0x4b0865[_0x142d('0x91')](_0x176877);}})[_0x142d('0x23')](respondWithResult(_0x45e84a,null))[_0x142d('0x41')](handleError(_0x45e84a,null));};function writeFile(_0x18bcea,_0xb5e4b0){return new Promise(function(_0xd9f01f,_0x23e841){fs[_0x142d('0x92')](_0xb5e4b0,_0x18bcea,function(_0x13b6c8,_0x3fdfa2){if(_0x13b6c8){return _0x23e841(_0x13b6c8);}else{return _0xd9f01f(_0x3fdfa2);}});});}exports[_0x142d('0x93')]=function(_0xb06b26,_0x16defb,_0x579895){return db[_0x142d('0x27')][_0x142d('0x84')]({'where':{'id':_0xb06b26['params']['id']}})[_0x142d('0x23')](handleEntityNotFound(_0x16defb))[_0x142d('0x23')](function(_0x364959){if(_0x364959&&_0x364959[_0x142d('0x94')]){var _0x5a0a2f=_0x364959['fileText'];var _0x3d0c2b=config[_0x142d('0x95')]+_0x142d('0x96')+_0x364959['id']+_0x142d('0x97');if(fs[_0x142d('0x5d')](_0x3d0c2b)){return _0x3d0c2b;}return writeFile(_0x5a0a2f,_0x3d0c2b)[_0x142d('0x23')](function(){return _0x3d0c2b;});}else{throw new db[(_0x142d('0x4d'))][(_0x142d('0x4e'))]('Transcript\x20not\x20available');}})[_0x142d('0x23')](function(_0x7cc250){return _0x16defb[_0x142d('0x51')](_0x7cc250);})[_0x142d('0x41')](handleError(_0x16defb));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 32f4265..201876e 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 _0xb469=['./voiceRecording.attributes','exports','define','VoiceRecording','voice_recordings','uniqueid','transcribeStatus'];(function(_0x2630d6,_0x535349){var _0x1a668e=function(_0xb7da71){while(--_0xb7da71){_0x2630d6['push'](_0x2630d6['shift']());}};_0x1a668e(++_0x535349);}(_0xb469,0x13b));var _0x9b46=function(_0x1b42e9,_0x73df49){_0x1b42e9=_0x1b42e9-0x0;var _0x46fdec=_0xb469[_0x1b42e9];return _0x46fdec;};'use strict';var attributes=require(_0x9b46('0x0'));module[_0x9b46('0x1')]=function(_0x2d18d9,_0x34f477){return _0x2d18d9[_0x9b46('0x2')](_0x9b46('0x3'),attributes,{'tableName':_0x9b46('0x4'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x9b46('0x5')]},{'name':_0x9b46('0x6'),'fields':['transcribeStatus']}],'timestamps':!![]});}; \ No newline at end of file +var _0x292e=['voice_recordings','uniqueid','transcribeStatus','./voiceRecording.attributes','exports'];(function(_0x2d946d,_0x4c2c73){var _0x4872fa=function(_0x51d62a){while(--_0x51d62a){_0x2d946d['push'](_0x2d946d['shift']());}};_0x4872fa(++_0x4c2c73);}(_0x292e,0xcb));var _0xe292=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x292e[_0x3e5086];return _0xfeb102;};'use strict';var attributes=require(_0xe292('0x0'));module[_0xe292('0x1')]=function(_0x34fdf4,_0x24230a){return _0x34fdf4['define']('VoiceRecording',attributes,{'tableName':_0xe292('0x2'),'paranoid':![],'indexes':[{'name':_0xe292('0x3'),'fields':[_0xe292('0x3')]},{'name':_0xe292('0x4'),'fields':['transcribeStatus']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 46f3ea9..083b2dd 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 _0xa30a=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','VoiceRecording,\x20%s,\x20%s','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','UpdateVoiceRecording','update','body','options','where','limit','debug','../../components/encryptor','Setting','findOne','callRecordingEncryption','VoiceRecording','create','existsSync','value','format','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x133be6,_0x467d46){var _0x54a5cc=function(_0x7de899){while(--_0x7de899){_0x133be6['push'](_0x133be6['shift']());}};_0x54a5cc(++_0x467d46);}(_0xa30a,0xd7));var _0xaa30=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa30a[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xaa30('0x0'));var util=require(_0xaa30('0x1'));var moment=require(_0xaa30('0x2'));var BPromise=require('bluebird');var rs=require(_0xaa30('0x3'));var fs=require('fs');var Redis=require(_0xaa30('0x4'));var db=require(_0xaa30('0x5'))['db'];var utils=require(_0xaa30('0x6'));var logger=require(_0xaa30('0x7'))(_0xaa30('0x8'));var config=require(_0xaa30('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa30('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8af448,_0x14fe09,_0x42dc22){return new BPromise(function(_0x5d076a,_0xedbc45){return client[_0xaa30('0xb')](_0x8af448,_0x42dc22)[_0xaa30('0xc')](function(_0x59d028){logger[_0xaa30('0xd')](_0xaa30('0xe'),_0x14fe09,'request\x20sent');logger['debug'](_0xaa30('0xf'),_0x14fe09,'request\x20sent',JSON[_0xaa30('0x10')](_0x59d028));if(_0x59d028[_0xaa30('0x11')]){if(_0x59d028[_0xaa30('0x11')][_0xaa30('0x12')]===0x1f4){logger['error'](_0xaa30('0xe'),_0x14fe09,_0x59d028[_0xaa30('0x11')][_0xaa30('0x13')]);return _0xedbc45(_0x59d028['error'][_0xaa30('0x13')]);}logger[_0xaa30('0x11')](_0xaa30('0xe'),_0x14fe09,_0x59d028[_0xaa30('0x11')][_0xaa30('0x13')]);return _0x5d076a(_0x59d028[_0xaa30('0x11')][_0xaa30('0x13')]);}else{logger[_0xaa30('0xd')](_0xaa30('0xe'),_0x14fe09,_0xaa30('0x14'));_0x5d076a(_0x59d028['result'][_0xaa30('0x13')]);}})['catch'](function(_0x5eb356){logger[_0xaa30('0x11')](_0xaa30('0xe'),_0x14fe09,_0x5eb356);_0xedbc45(_0x5eb356);});});}exports[_0xaa30('0x15')]=function(_0x540e36){var _0x54fa49=this;return new Promise(function(_0x53f9fd,_0x23ad3b){return db['VoiceRecording'][_0xaa30('0x16')](_0x540e36[_0xaa30('0x17')],{'raw':_0x540e36['options']?_0x540e36['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x540e36[_0xaa30('0x18')]?_0x540e36[_0xaa30('0x18')][_0xaa30('0x19')]||null:null,'attributes':_0x540e36[_0xaa30('0x18')]?_0x540e36[_0xaa30('0x18')]['attributes']||null:null,'limit':_0x540e36[_0xaa30('0x18')]?_0x540e36[_0xaa30('0x18')][_0xaa30('0x1a')]||null:null})[_0xaa30('0xc')](function(_0x1ff442){logger['info'](_0xaa30('0x15'),_0x540e36);logger[_0xaa30('0x1b')](_0xaa30('0x15'),_0x540e36,JSON[_0xaa30('0x10')](_0x1ff442));_0x53f9fd(_0x1ff442);})['catch'](function(_0x14d7fa){logger[_0xaa30('0x11')](_0xaa30('0x15'),_0x14d7fa[_0xaa30('0x13')],_0x540e36);_0x23ad3b(_0x54fa49[_0xaa30('0x11')](0x1f4,_0x14d7fa[_0xaa30('0x13')]));});});};exports['CreateVoiceRecording']=function(_0x467850){var _0x465701=this;return new Promise(function(_0x5d4da8,_0xb043e4){var _0x5b3efb=require(_0xaa30('0x1c'));var _0x33a0c9;return db[_0xaa30('0x1d')][_0xaa30('0x1e')]({'attributes':['id',_0xaa30('0x1f')],'where':{'id':0x1},'raw':!![]})[_0xaa30('0xc')](function(_0x6ff09a){_0x33a0c9=_0x6ff09a;return db[_0xaa30('0x20')][_0xaa30('0x21')](_0x467850[_0xaa30('0x17')]);})[_0xaa30('0xc')](function(_0x43003f){if(_0x33a0c9[_0xaa30('0x1f')]&&fs[_0xaa30('0x22')](_0x43003f[_0xaa30('0x23')])){var _0x1a3f64=util[_0xaa30('0x24')](_0xaa30('0x25'),_0x43003f['value']);return _0x5b3efb[_0xaa30('0x26')](_0x43003f[_0xaa30('0x23')],_0x1a3f64,config[_0xaa30('0x27')][_0xaa30('0x28')])[_0xaa30('0xc')](function(){fs[_0xaa30('0x29')](_0x43003f['value']);logger['info']('CreateVoiceRecording\x20file\x20encrypted');return _0x43003f;});}return _0x43003f;})[_0xaa30('0xc')](function(_0x407090){logger[_0xaa30('0xd')](_0xaa30('0x2a'),_0x467850);logger[_0xaa30('0x1b')]('CreateVoiceRecording',_0x467850,JSON['stringify'](_0x407090));_0x5d4da8(_0x407090);})[_0xaa30('0x2b')](function(_0x2d26fb){logger['error'](_0xaa30('0x2a'),_0x2d26fb['message'],_0x467850);_0xb043e4(_0x465701[_0xaa30('0x11')](0x1f4,_0x2d26fb['message']));});});}; \ No newline at end of file +var _0x955f=['randomstring','../../mysqldb','rpc','jayson/promise','client','http','request','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','update','body','options','raw','where','attributes','limit','debug','UpdateVoiceRecording','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','VoiceRecording','create','existsSync','%s.cypher','value','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird'];(function(_0x36f949,_0x5aaf32){var _0x194ed6=function(_0x5f547e){while(--_0x5f547e){_0x36f949['push'](_0x36f949['shift']());}};_0x194ed6(++_0x5aaf32);}(_0x955f,0x1eb));var _0xf955=function(_0x10d2c5,_0x534542){_0x10d2c5=_0x10d2c5-0x0;var _0xe33258=_0x955f[_0x10d2c5];return _0xe33258;};'use strict';var _=require(_0xf955('0x0'));var util=require(_0xf955('0x1'));var moment=require(_0xf955('0x2'));var BPromise=require(_0xf955('0x3'));var rs=require(_0xf955('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf955('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf955('0x6'));var config=require('../../config/environment');var jayson=require(_0xf955('0x7'));var client=jayson[_0xf955('0x8')][_0xf955('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x59d5b3,_0x18432f,_0x20c096){return new BPromise(function(_0x4f58fb,_0x254b38){return client[_0xf955('0xa')](_0x59d5b3,_0x20c096)[_0xf955('0xb')](function(_0x38b190){logger[_0xf955('0xc')](_0xf955('0xd'),_0x18432f,_0xf955('0xe'));logger['debug'](_0xf955('0xf'),_0x18432f,'request\x20sent',JSON[_0xf955('0x10')](_0x38b190));if(_0x38b190[_0xf955('0x11')]){if(_0x38b190[_0xf955('0x11')]['code']===0x1f4){logger[_0xf955('0x11')]('VoiceRecording,\x20%s,\x20%s',_0x18432f,_0x38b190[_0xf955('0x11')]['message']);return _0x254b38(_0x38b190[_0xf955('0x11')][_0xf955('0x12')]);}logger[_0xf955('0x11')](_0xf955('0xd'),_0x18432f,_0x38b190[_0xf955('0x11')][_0xf955('0x12')]);return _0x4f58fb(_0x38b190[_0xf955('0x11')][_0xf955('0x12')]);}else{logger[_0xf955('0xc')](_0xf955('0xd'),_0x18432f,'request\x20sent');_0x4f58fb(_0x38b190[_0xf955('0x13')]['message']);}})[_0xf955('0x14')](function(_0x3a814f){logger[_0xf955('0x11')](_0xf955('0xd'),_0x18432f,_0x3a814f);_0x254b38(_0x3a814f);});});}exports['UpdateVoiceRecording']=function(_0x5ac6cb){var _0x1e20d1=this;return new Promise(function(_0xe6de5c,_0x3c49c0){return db['VoiceRecording'][_0xf955('0x15')](_0x5ac6cb[_0xf955('0x16')],{'raw':_0x5ac6cb[_0xf955('0x17')]?_0x5ac6cb[_0xf955('0x17')][_0xf955('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5ac6cb['options']?_0x5ac6cb[_0xf955('0x17')][_0xf955('0x19')]||null:null,'attributes':_0x5ac6cb[_0xf955('0x17')]?_0x5ac6cb['options'][_0xf955('0x1a')]||null:null,'limit':_0x5ac6cb['options']?_0x5ac6cb[_0xf955('0x17')][_0xf955('0x1b')]||null:null})[_0xf955('0xb')](function(_0xa4ebb4){logger[_0xf955('0xc')]('UpdateVoiceRecording',_0x5ac6cb);logger[_0xf955('0x1c')](_0xf955('0x1d'),_0x5ac6cb,JSON[_0xf955('0x10')](_0xa4ebb4));_0xe6de5c(_0xa4ebb4);})[_0xf955('0x14')](function(_0x17dec2){logger[_0xf955('0x11')](_0xf955('0x1d'),_0x17dec2['message'],_0x5ac6cb);_0x3c49c0(_0x1e20d1[_0xf955('0x11')](0x1f4,_0x17dec2[_0xf955('0x12')]));});});};exports[_0xf955('0x1e')]=function(_0x406632){var _0x2dcd55=this;return new Promise(function(_0x13a86d,_0x3796f7){var _0x51f3ab=require(_0xf955('0x1f'));var _0x145098;return db[_0xf955('0x20')][_0xf955('0x21')]({'attributes':['id',_0xf955('0x22')],'where':{'id':0x1},'raw':!![]})[_0xf955('0xb')](function(_0x4d4af0){_0x145098=_0x4d4af0;return db[_0xf955('0x23')][_0xf955('0x24')](_0x406632['body']);})[_0xf955('0xb')](function(_0x2c8df1){if(_0x145098[_0xf955('0x22')]&&fs[_0xf955('0x25')](_0x2c8df1['value'])){var _0x3a951c=util['format'](_0xf955('0x26'),_0x2c8df1[_0xf955('0x27')]);return _0x51f3ab[_0xf955('0x28')](_0x2c8df1[_0xf955('0x27')],_0x3a951c,config[_0xf955('0x29')][_0xf955('0x2a')])[_0xf955('0xb')](function(){fs[_0xf955('0x2b')](_0x2c8df1['value']);logger[_0xf955('0xc')](_0xf955('0x2c'));return _0x2c8df1;});}return _0x2c8df1;})[_0xf955('0xb')](function(_0x2046c8){logger['info'](_0xf955('0x1e'),_0x406632);logger[_0xf955('0x1c')](_0xf955('0x1e'),_0x406632,JSON[_0xf955('0x10')](_0x2046c8));_0x13a86d(_0x2046c8);})[_0xf955('0x14')](function(_0x4eb2c3){logger['error']('CreateVoiceRecording',_0x4eb2c3[_0xf955('0x12')],_0x406632);_0x3796f7(_0x2dcd55[_0xf955('0x11')](0x1f4,_0x4eb2c3[_0xf955('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 1f9b03c..c3f7157 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 _0x7127=['connect-timeout','Router','fs-extra','../../components/auth/service','./voiceTransferReport.controller','get','isAuthenticated','index','/describe','describe','create','put','/:id','update','delete','exports','multer','util','path'];(function(_0x104b35,_0x13f218){var _0x55584d=function(_0x2bbb71){while(--_0x2bbb71){_0x104b35['push'](_0x104b35['shift']());}};_0x55584d(++_0x13f218);}(_0x7127,0x6f));var _0x7712=function(_0x3278d6,_0x9f99b){_0x3278d6=_0x3278d6-0x0;var _0x4e7bcd=_0x7127[_0x3278d6];return _0x4e7bcd;};'use strict';var multer=require(_0x7712('0x0'));var util=require(_0x7712('0x1'));var path=require(_0x7712('0x2'));var timeout=require(_0x7712('0x3'));var express=require('express');var router=express[_0x7712('0x4')]();var fs_extra=require(_0x7712('0x5'));var auth=require(_0x7712('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7712('0x7'));router[_0x7712('0x8')]('/',auth[_0x7712('0x9')](),controller[_0x7712('0xa')]);router[_0x7712('0x8')](_0x7712('0xb'),auth[_0x7712('0x9')](),controller[_0x7712('0xc')]);router[_0x7712('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x7712('0xd')]);router[_0x7712('0xe')](_0x7712('0xf'),auth['isAuthenticated'](),controller[_0x7712('0x10')]);router[_0x7712('0x11')](_0x7712('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x7712('0x12')]=router; \ No newline at end of file +var _0x5020=['post','create','put','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/describe','/:id','show'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0x5020,0x136));var _0x0502=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0x5020[_0x4bfac3];return _0x15f0f2;};'use strict';var multer=require(_0x0502('0x0'));var util=require(_0x0502('0x1'));var path=require(_0x0502('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0502('0x3')]();var fs_extra=require(_0x0502('0x4'));var auth=require(_0x0502('0x5'));var interaction=require(_0x0502('0x6'));var config=require('../../config/environment');var controller=require('./voiceTransferReport.controller');router['get']('/',auth[_0x0502('0x7')](),controller[_0x0502('0x8')]);router[_0x0502('0x9')](_0x0502('0xa'),auth[_0x0502('0x7')](),controller['describe']);router[_0x0502('0x9')](_0x0502('0xb'),auth[_0x0502('0x7')](),controller[_0x0502('0xc')]);router[_0x0502('0xd')]('/',auth[_0x0502('0x7')](),controller[_0x0502('0xe')]);router[_0x0502('0xf')](_0x0502('0xb'),auth[_0x0502('0x7')](),controller['update']);router[_0x0502('0x10')]('/:id',auth[_0x0502('0x7')](),controller[_0x0502('0x11')]);module[_0x0502('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index f1ded8b..cc4a566 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 _0x98ba=['STRING','Yes','sequelize','moment','exports','ENUM','blind'];(function(_0x940e8f,_0x215952){var _0xb837e8=function(_0xae6c1e){while(--_0xae6c1e){_0x940e8f['push'](_0x940e8f['shift']());}};_0xb837e8(++_0x215952);}(_0x98ba,0x160));var _0xa98b=function(_0x113d7a,_0x56c294){_0x113d7a=_0x113d7a-0x0;var _0x43452b=_0x98ba[_0x113d7a];return _0x43452b;};'use strict';var Sequelize=require(_0xa98b('0x0'));var moment=require(_0xa98b('0x1'));module[_0xa98b('0x2')]={'type':{'type':Sequelize[_0xa98b('0x3')](_0xa98b('0x4'),'attended')},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0xa98b('0x5')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0xa98b('0x5')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0xa98b('0x5')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0xa98b('0x5')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0xa98b('0x5')]},'transfereechannel':{'type':Sequelize[_0xa98b('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0xa98b('0x5')]},'transfereecalleridname':{'type':Sequelize[_0xa98b('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0xa98b('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0xa98b('0x5')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0xa98b('0x5')]},'transfereelinkedid':{'type':Sequelize[_0xa98b('0x5')]},'isexternal':{'type':Sequelize['ENUM'](_0xa98b('0x6'),'No')},'context':{'type':Sequelize[_0xa98b('0x5')]},'extension':{'type':Sequelize[_0xa98b('0x5')]}}; \ No newline at end of file +var _0xf84b=['Yes','sequelize','moment','ENUM','blind','attended','STRING'];(function(_0x37724c,_0x331a09){var _0x19b30e=function(_0x40953d){while(--_0x40953d){_0x37724c['push'](_0x37724c['shift']());}};_0x19b30e(++_0x331a09);}(_0xf84b,0x1eb));var _0xbf84=function(_0x2caac4,_0x4216c8){_0x2caac4=_0x2caac4-0x0;var _0x2997b7=_0xf84b[_0x2caac4];return _0x2997b7;};'use strict';var Sequelize=require(_0xbf84('0x0'));var moment=require(_0xbf84('0x1'));module['exports']={'type':{'type':Sequelize[_0xbf84('0x2')](_0xbf84('0x3'),_0xbf84('0x4'))},'result':{'type':Sequelize[_0xbf84('0x5')]},'transfererchannel':{'type':Sequelize[_0xbf84('0x5')]},'transferercalleridnum':{'type':Sequelize[_0xbf84('0x5')]},'transferercalleridname':{'type':Sequelize[_0xbf84('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0xbf84('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0xbf84('0x5')]},'transfereraccountcode':{'type':Sequelize[_0xbf84('0x5')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0xbf84('0x5')]},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0xbf84('0x5')]},'transfereecalleridname':{'type':Sequelize[_0xbf84('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0xbf84('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0xbf84('0x5')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize[_0xbf84('0x5')]},'isexternal':{'type':Sequelize['ENUM'](_0xbf84('0x6'),'No')},'context':{'type':Sequelize[_0xbf84('0x5')]},'extension':{'type':Sequelize[_0xbf84('0x5')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 8e59b35..b59035f 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 _0xdebf=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','sendStatus','error','name','map','VoiceTransferReport','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x314331,_0x31e602){var _0xe15a39=function(_0x47d522){while(--_0x47d522){_0x314331['push'](_0x314331['shift']());}};_0xe15a39(++_0x31e602);}(_0xdebf,0x81));var _0xfdeb=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xdebf[_0x40ac5e];return _0x2839d6;};'use strict';var emlformat=require(_0xfdeb('0x0'));var rimraf=require(_0xfdeb('0x1'));var zipdir=require(_0xfdeb('0x2'));var jsonpatch=require(_0xfdeb('0x3'));var rp=require(_0xfdeb('0x4'));var moment=require(_0xfdeb('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xfdeb('0x6'));var util=require('util');var path=require(_0xfdeb('0x7'));var sox=require(_0xfdeb('0x8'));var csv=require(_0xfdeb('0x9'));var ejs=require(_0xfdeb('0xa'));var fs=require('fs');var fs_extra=require(_0xfdeb('0xb'));var _=require(_0xfdeb('0xc'));var squel=require(_0xfdeb('0xd'));var crypto=require(_0xfdeb('0xe'));var jsforce=require(_0xfdeb('0xf'));var deskjs=require(_0xfdeb('0x10'));var toCsv=require('to-csv');var querystring=require(_0xfdeb('0x11'));var Papa=require(_0xfdeb('0x12'));var Redis=require(_0xfdeb('0x13'));var authService=require(_0xfdeb('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xfdeb('0x15'));var hardwareService=require(_0xfdeb('0x16'));var logger=require(_0xfdeb('0x17'))(_0xfdeb('0x18'));var utils=require(_0xfdeb('0x19'));var config=require(_0xfdeb('0x1a'));var licenseUtil=require(_0xfdeb('0x1b'));var db=require(_0xfdeb('0x1c'))['db'];function respondWithStatusCode(_0x140288,_0xfb1aad){_0xfb1aad=_0xfb1aad||0xcc;return function(_0x624256){if(_0x624256){return _0x140288['sendStatus'](_0xfb1aad);}return _0x140288[_0xfdeb('0x1d')](_0xfb1aad)[_0xfdeb('0x1e')]();};}function respondWithResult(_0x5ad69b,_0x3be1a3){_0x3be1a3=_0x3be1a3||0xc8;return function(_0x43a91f){if(_0x43a91f){return _0x5ad69b['status'](_0x3be1a3)[_0xfdeb('0x1f')](_0x43a91f);}};}function respondWithFilteredResult(_0x249325,_0x330cba){return function(_0x3e73fb){if(_0x3e73fb){var _0x5a3434=typeof _0x330cba[_0xfdeb('0x20')]===_0xfdeb('0x21')&&typeof _0x330cba[_0xfdeb('0x22')]===_0xfdeb('0x21');var _0x43f06d=_0x3e73fb[_0xfdeb('0x23')];var _0x213297=_0x5a3434?0x0:_0x330cba[_0xfdeb('0x20')];var _0x2d9681=_0x5a3434?_0x3e73fb[_0xfdeb('0x23')]:_0x330cba[_0xfdeb('0x20')]+_0x330cba[_0xfdeb('0x22')];var _0xf8745d;if(_0x2d9681>=_0x43f06d){_0x2d9681=_0x43f06d;_0xf8745d=0xc8;}else{_0xf8745d=0xce;}_0x249325[_0xfdeb('0x1d')](_0xf8745d);return _0x249325[_0xfdeb('0x24')](_0xfdeb('0x25'),_0x213297+'-'+_0x2d9681+'/'+_0x43f06d)[_0xfdeb('0x1f')](_0x3e73fb);}return null;};}function patchUpdates(_0x3857e4){return function(_0x1965be){try{jsonpatch[_0xfdeb('0x26')](_0x1965be,_0x3857e4,!![]);}catch(_0x3022c8){return BPromise['reject'](_0x3022c8);}return _0x1965be[_0xfdeb('0x27')]();};}function saveUpdates(_0x3d05ef,_0x19bebc){return function(_0x15c2e9){if(_0x15c2e9){return _0x15c2e9['update'](_0x3d05ef)[_0xfdeb('0x28')](function(_0x49e892){return _0x49e892;});}return null;};}function removeEntity(_0x27cecd,_0x2e726f){return function(_0x57051a){if(_0x57051a){return _0x57051a[_0xfdeb('0x29')]()['then'](function(){_0x27cecd[_0xfdeb('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c1484,_0x5a5ca5){return function(_0x3f3634){if(!_0x3f3634){_0x4c1484[_0xfdeb('0x2a')](0x194);}return _0x3f3634;};}function handleError(_0x3411f5,_0x36d0ad){_0x36d0ad=_0x36d0ad||0x1f4;return function(_0xc7d87d){logger[_0xfdeb('0x2b')](_0xc7d87d['stack']);if(_0xc7d87d[_0xfdeb('0x2c')]){delete _0xc7d87d[_0xfdeb('0x2c')];}_0x3411f5[_0xfdeb('0x1d')](_0x36d0ad)['send'](_0xc7d87d);};}exports['index']=function(_0x302e5d,_0x358d85){var _0x137c75={},_0x99d1ff={},_0xa9e67d={'count':0x0,'rows':[]};var _0x55de5a=_[_0xfdeb('0x2d')](db[_0xfdeb('0x2e')]['rawAttributes'],function(_0x113ebd){return{'name':_0x113ebd[_0xfdeb('0x2f')],'type':_0x113ebd[_0xfdeb('0x30')][_0xfdeb('0x31')]};});_0x99d1ff[_0xfdeb('0x32')]=_['map'](_0x55de5a,'name');_0x99d1ff[_0xfdeb('0x33')]=_[_0xfdeb('0x34')](_0x302e5d['query']);_0x99d1ff[_0xfdeb('0x35')]=_['intersection'](_0x99d1ff['model'],_0x99d1ff['query']);_0x137c75[_0xfdeb('0x36')]=_[_0xfdeb('0x37')](_0x99d1ff['model'],qs[_0xfdeb('0x38')](_0x302e5d[_0xfdeb('0x33')]['fields']));_0x137c75[_0xfdeb('0x36')]=_0x137c75[_0xfdeb('0x36')][_0xfdeb('0x39')]?_0x137c75[_0xfdeb('0x36')]:_0x99d1ff[_0xfdeb('0x32')];if(!_0x302e5d[_0xfdeb('0x33')]['hasOwnProperty'](_0xfdeb('0x3a'))){_0x137c75['limit']=qs[_0xfdeb('0x22')](_0x302e5d['query'][_0xfdeb('0x22')]);_0x137c75[_0xfdeb('0x20')]=qs[_0xfdeb('0x20')](_0x302e5d[_0xfdeb('0x33')][_0xfdeb('0x20')]);}_0x137c75[_0xfdeb('0x3b')]=qs['sort'](_0x302e5d[_0xfdeb('0x33')][_0xfdeb('0x3c')]);_0x137c75[_0xfdeb('0x3d')]=qs[_0xfdeb('0x35')](_['pick'](_0x302e5d[_0xfdeb('0x33')],_0x99d1ff[_0xfdeb('0x35')]),_0x55de5a);if(_0x302e5d['query'][_0xfdeb('0x3e')]){_0x137c75[_0xfdeb('0x3d')]=_[_0xfdeb('0x3f')](_0x137c75[_0xfdeb('0x3d')],{'$or':_['map'](_0x55de5a,function(_0x24ab4c){if(_0x24ab4c[_0xfdeb('0x30')]!=='VIRTUAL'){var _0x5b55fb={};_0x5b55fb[_0x24ab4c[_0xfdeb('0x2c')]]={'$like':'%'+_0x302e5d['query'][_0xfdeb('0x3e')]+'%'};return _0x5b55fb;}})});}_0x137c75=_['merge']({},_0x137c75,_0x302e5d[_0xfdeb('0x40')]);var _0x2e8b4a={'where':_0x137c75['where']};return db[_0xfdeb('0x2e')][_0xfdeb('0x23')](_0x2e8b4a)[_0xfdeb('0x28')](function(_0x43dc99){_0xa9e67d[_0xfdeb('0x23')]=_0x43dc99;if(_0x302e5d[_0xfdeb('0x33')][_0xfdeb('0x41')]){_0x137c75[_0xfdeb('0x42')]=[{'all':!![]}];}return db[_0xfdeb('0x2e')][_0xfdeb('0x43')](_0x137c75);})[_0xfdeb('0x28')](function(_0x9d67dd){_0xa9e67d[_0xfdeb('0x44')]=_0x9d67dd;return _0xa9e67d;})[_0xfdeb('0x28')](respondWithFilteredResult(_0x358d85,_0x137c75))[_0xfdeb('0x45')](handleError(_0x358d85,null));};exports['show']=function(_0x2c900f,_0x399b12){var _0x20bb27={'raw':!![],'where':{'id':_0x2c900f[_0xfdeb('0x46')]['id']}},_0x3d0c40={};_0x3d0c40[_0xfdeb('0x32')]=_[_0xfdeb('0x34')](db[_0xfdeb('0x2e')][_0xfdeb('0x47')]);_0x3d0c40[_0xfdeb('0x33')]=_['keys'](_0x2c900f['query']);_0x3d0c40[_0xfdeb('0x35')]=_[_0xfdeb('0x37')](_0x3d0c40[_0xfdeb('0x32')],_0x3d0c40[_0xfdeb('0x33')]);_0x20bb27['attributes']=_['intersection'](_0x3d0c40[_0xfdeb('0x32')],qs[_0xfdeb('0x38')](_0x2c900f[_0xfdeb('0x33')][_0xfdeb('0x38')]));_0x20bb27[_0xfdeb('0x36')]=_0x20bb27[_0xfdeb('0x36')]['length']?_0x20bb27[_0xfdeb('0x36')]:_0x3d0c40['model'];if(_0x2c900f[_0xfdeb('0x33')]['includeAll']){_0x20bb27[_0xfdeb('0x42')]=[{'all':!![]}];}_0x20bb27=_[_0xfdeb('0x3f')]({},_0x20bb27,_0x2c900f[_0xfdeb('0x40')]);return db[_0xfdeb('0x2e')][_0xfdeb('0x48')](_0x20bb27)[_0xfdeb('0x28')](handleEntityNotFound(_0x399b12,null))[_0xfdeb('0x28')](respondWithResult(_0x399b12,null))[_0xfdeb('0x45')](handleError(_0x399b12,null));};exports['create']=function(_0x561d42,_0x42fb07){return db[_0xfdeb('0x2e')][_0xfdeb('0x49')](_0x561d42['body'],{})[_0xfdeb('0x28')](respondWithResult(_0x42fb07,0xc9))['catch'](handleError(_0x42fb07,null));};exports['update']=function(_0x2a97bd,_0x364e8c){if(_0x2a97bd[_0xfdeb('0x4a')]['id']){delete _0x2a97bd[_0xfdeb('0x4a')]['id'];}return db['VoiceTransferReport'][_0xfdeb('0x48')]({'where':{'id':_0x2a97bd['params']['id']}})[_0xfdeb('0x28')](handleEntityNotFound(_0x364e8c,null))['then'](saveUpdates(_0x2a97bd[_0xfdeb('0x4a')],null))[_0xfdeb('0x28')](respondWithResult(_0x364e8c,null))[_0xfdeb('0x45')](handleError(_0x364e8c,null));};exports[_0xfdeb('0x29')]=function(_0xa72138,_0x5ca729){return db[_0xfdeb('0x2e')][_0xfdeb('0x48')]({'where':{'id':_0xa72138[_0xfdeb('0x46')]['id']}})[_0xfdeb('0x28')](handleEntityNotFound(_0x5ca729,null))[_0xfdeb('0x28')](removeEntity(_0x5ca729,null))[_0xfdeb('0x45')](handleError(_0x5ca729,null));};exports[_0xfdeb('0x4b')]=function(_0x56dee7,_0x1b7ec1){return db[_0xfdeb('0x2e')][_0xfdeb('0x4b')]()[_0xfdeb('0x28')](respondWithResult(_0x1b7ec1,null))[_0xfdeb('0x45')](handleError(_0x1b7ec1,null));}; \ No newline at end of file +var _0x47c8=['path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','destroy','end','error','name','send','map','VoiceTransferReport','rawAttributes','fieldName','type','key','keys','query','attributes','intersection','model','fields','length','hasOwnProperty','sort','filter','merge','VIRTUAL','options','then','rows','catch','show','params','filters','includeAll','include','find','create','body','describe','zip-dir','request-promise','moment','bluebird','mustache','util'];(function(_0x532c54,_0x54f860){var _0x5887e5=function(_0xbf8d0a){while(--_0xbf8d0a){_0x532c54['push'](_0x532c54['shift']());}};_0x5887e5(++_0x54f860);}(_0x47c8,0x1eb));var _0x847c=function(_0xcefe78,_0x394ad1){_0xcefe78=_0xcefe78-0x0;var _0xe6f466=_0x47c8[_0xcefe78];return _0xe6f466;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x847c('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x847c('0x1'));var moment=require(_0x847c('0x2'));var BPromise=require(_0x847c('0x3'));var Mustache=require(_0x847c('0x4'));var util=require(_0x847c('0x5'));var path=require(_0x847c('0x6'));var sox=require(_0x847c('0x7'));var csv=require('to-csv');var ejs=require(_0x847c('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x847c('0x9'));var squel=require('squel');var crypto=require(_0x847c('0xa'));var jsforce=require(_0x847c('0xb'));var deskjs=require(_0x847c('0xc'));var toCsv=require(_0x847c('0xd'));var querystring=require(_0x847c('0xe'));var Papa=require(_0x847c('0xf'));var Redis=require('ioredis');var authService=require(_0x847c('0x10'));var qs=require(_0x847c('0x11'));var as=require(_0x847c('0x12'));var hardwareService=require(_0x847c('0x13'));var logger=require('../../config/logger')(_0x847c('0x14'));var utils=require('../../config/utils');var config=require(_0x847c('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x847c('0x16'))['db'];function respondWithStatusCode(_0x4c84cf,_0x1b867f){_0x1b867f=_0x1b867f||0xcc;return function(_0x1d2f9d){if(_0x1d2f9d){return _0x4c84cf[_0x847c('0x17')](_0x1b867f);}return _0x4c84cf[_0x847c('0x18')](_0x1b867f)['end']();};}function respondWithResult(_0x465c86,_0xc848c5){_0xc848c5=_0xc848c5||0xc8;return function(_0x545d6b){if(_0x545d6b){return _0x465c86[_0x847c('0x18')](_0xc848c5)['json'](_0x545d6b);}};}function respondWithFilteredResult(_0x1d99a1,_0x241e58){return function(_0x23ff8a){if(_0x23ff8a){var _0x115634=typeof _0x241e58[_0x847c('0x19')]==='undefined'&&typeof _0x241e58[_0x847c('0x1a')]===_0x847c('0x1b');var _0x455637=_0x23ff8a[_0x847c('0x1c')];var _0x47dd0=_0x115634?0x0:_0x241e58[_0x847c('0x19')];var _0x48cec5=_0x115634?_0x23ff8a['count']:_0x241e58[_0x847c('0x19')]+_0x241e58[_0x847c('0x1a')];var _0x1547a3;if(_0x48cec5>=_0x455637){_0x48cec5=_0x455637;_0x1547a3=0xc8;}else{_0x1547a3=0xce;}_0x1d99a1[_0x847c('0x18')](_0x1547a3);return _0x1d99a1[_0x847c('0x1d')](_0x847c('0x1e'),_0x47dd0+'-'+_0x48cec5+'/'+_0x455637)[_0x847c('0x1f')](_0x23ff8a);}return null;};}function patchUpdates(_0x34f953){return function(_0x32ac26){try{jsonpatch[_0x847c('0x20')](_0x32ac26,_0x34f953,!![]);}catch(_0x125146){return BPromise[_0x847c('0x21')](_0x125146);}return _0x32ac26[_0x847c('0x22')]();};}function saveUpdates(_0x412a2b,_0xfdb331){return function(_0x221a48){if(_0x221a48){return _0x221a48['update'](_0x412a2b)['then'](function(_0x450823){return _0x450823;});}return null;};}function removeEntity(_0x9e9815,_0x373f6b){return function(_0x31c83b){if(_0x31c83b){return _0x31c83b[_0x847c('0x23')]()['then'](function(){_0x9e9815[_0x847c('0x18')](0xcc)[_0x847c('0x24')]();});}};}function handleEntityNotFound(_0x3fa2b6,_0x3a9019){return function(_0x58b847){if(!_0x58b847){_0x3fa2b6[_0x847c('0x17')](0x194);}return _0x58b847;};}function handleError(_0x55fd71,_0x419f4e){_0x419f4e=_0x419f4e||0x1f4;return function(_0xdc454f){logger[_0x847c('0x25')](_0xdc454f['stack']);if(_0xdc454f[_0x847c('0x26')]){delete _0xdc454f[_0x847c('0x26')];}_0x55fd71[_0x847c('0x18')](_0x419f4e)[_0x847c('0x27')](_0xdc454f);};}exports['index']=function(_0x1e2943,_0x4dbce6){var _0x34d98f={},_0x4c5ebe={},_0x2c6df3={'count':0x0,'rows':[]};var _0x570332=_[_0x847c('0x28')](db[_0x847c('0x29')][_0x847c('0x2a')],function(_0x2281cd){return{'name':_0x2281cd[_0x847c('0x2b')],'type':_0x2281cd[_0x847c('0x2c')][_0x847c('0x2d')]};});_0x4c5ebe['model']=_[_0x847c('0x28')](_0x570332,'name');_0x4c5ebe['query']=_[_0x847c('0x2e')](_0x1e2943[_0x847c('0x2f')]);_0x4c5ebe['filters']=_['intersection'](_0x4c5ebe['model'],_0x4c5ebe[_0x847c('0x2f')]);_0x34d98f[_0x847c('0x30')]=_[_0x847c('0x31')](_0x4c5ebe[_0x847c('0x32')],qs['fields'](_0x1e2943['query'][_0x847c('0x33')]));_0x34d98f[_0x847c('0x30')]=_0x34d98f['attributes'][_0x847c('0x34')]?_0x34d98f[_0x847c('0x30')]:_0x4c5ebe['model'];if(!_0x1e2943[_0x847c('0x2f')][_0x847c('0x35')]('nolimit')){_0x34d98f[_0x847c('0x1a')]=qs[_0x847c('0x1a')](_0x1e2943[_0x847c('0x2f')][_0x847c('0x1a')]);_0x34d98f['offset']=qs[_0x847c('0x19')](_0x1e2943[_0x847c('0x2f')][_0x847c('0x19')]);}_0x34d98f['order']=qs[_0x847c('0x36')](_0x1e2943[_0x847c('0x2f')][_0x847c('0x36')]);_0x34d98f['where']=qs['filters'](_['pick'](_0x1e2943[_0x847c('0x2f')],_0x4c5ebe['filters']),_0x570332);if(_0x1e2943[_0x847c('0x2f')][_0x847c('0x37')]){_0x34d98f['where']=_[_0x847c('0x38')](_0x34d98f['where'],{'$or':_[_0x847c('0x28')](_0x570332,function(_0x120855){if(_0x120855['type']!==_0x847c('0x39')){var _0x30c0bd={};_0x30c0bd[_0x120855[_0x847c('0x26')]]={'$like':'%'+_0x1e2943[_0x847c('0x2f')][_0x847c('0x37')]+'%'};return _0x30c0bd;}})});}_0x34d98f=_[_0x847c('0x38')]({},_0x34d98f,_0x1e2943[_0x847c('0x3a')]);var _0x3e7b04={'where':_0x34d98f['where']};return db[_0x847c('0x29')]['count'](_0x3e7b04)[_0x847c('0x3b')](function(_0x494724){_0x2c6df3['count']=_0x494724;if(_0x1e2943[_0x847c('0x2f')]['includeAll']){_0x34d98f['include']=[{'all':!![]}];}return db[_0x847c('0x29')]['findAll'](_0x34d98f);})[_0x847c('0x3b')](function(_0x293d07){_0x2c6df3[_0x847c('0x3c')]=_0x293d07;return _0x2c6df3;})[_0x847c('0x3b')](respondWithFilteredResult(_0x4dbce6,_0x34d98f))[_0x847c('0x3d')](handleError(_0x4dbce6,null));};exports[_0x847c('0x3e')]=function(_0x5cef3c,_0x4870be){var _0x4f2374={'raw':!![],'where':{'id':_0x5cef3c[_0x847c('0x3f')]['id']}},_0x5a3314={};_0x5a3314[_0x847c('0x32')]=_['keys'](db['VoiceTransferReport'][_0x847c('0x2a')]);_0x5a3314[_0x847c('0x2f')]=_[_0x847c('0x2e')](_0x5cef3c[_0x847c('0x2f')]);_0x5a3314[_0x847c('0x40')]=_['intersection'](_0x5a3314[_0x847c('0x32')],_0x5a3314[_0x847c('0x2f')]);_0x4f2374[_0x847c('0x30')]=_['intersection'](_0x5a3314[_0x847c('0x32')],qs['fields'](_0x5cef3c['query'][_0x847c('0x33')]));_0x4f2374[_0x847c('0x30')]=_0x4f2374[_0x847c('0x30')]['length']?_0x4f2374[_0x847c('0x30')]:_0x5a3314[_0x847c('0x32')];if(_0x5cef3c[_0x847c('0x2f')][_0x847c('0x41')]){_0x4f2374[_0x847c('0x42')]=[{'all':!![]}];}_0x4f2374=_['merge']({},_0x4f2374,_0x5cef3c[_0x847c('0x3a')]);return db['VoiceTransferReport'][_0x847c('0x43')](_0x4f2374)[_0x847c('0x3b')](handleEntityNotFound(_0x4870be,null))[_0x847c('0x3b')](respondWithResult(_0x4870be,null))['catch'](handleError(_0x4870be,null));};exports['create']=function(_0x3faf45,_0x535a9e){return db[_0x847c('0x29')][_0x847c('0x44')](_0x3faf45[_0x847c('0x45')],{})[_0x847c('0x3b')](respondWithResult(_0x535a9e,0xc9))[_0x847c('0x3d')](handleError(_0x535a9e,null));};exports['update']=function(_0x436591,_0x5450b3){if(_0x436591['body']['id']){delete _0x436591[_0x847c('0x45')]['id'];}return db[_0x847c('0x29')]['find']({'where':{'id':_0x436591[_0x847c('0x3f')]['id']}})[_0x847c('0x3b')](handleEntityNotFound(_0x5450b3,null))[_0x847c('0x3b')](saveUpdates(_0x436591[_0x847c('0x45')],null))[_0x847c('0x3b')](respondWithResult(_0x5450b3,null))[_0x847c('0x3d')](handleError(_0x5450b3,null));};exports[_0x847c('0x23')]=function(_0x2f324c,_0x416998){return db[_0x847c('0x29')]['find']({'where':{'id':_0x2f324c[_0x847c('0x3f')]['id']}})[_0x847c('0x3b')](handleEntityNotFound(_0x416998,null))[_0x847c('0x3b')](removeEntity(_0x416998,null))[_0x847c('0x3d')](handleError(_0x416998,null));};exports[_0x847c('0x46')]=function(_0x5c4b2b,_0x391c7a){return db[_0x847c('0x29')][_0x847c('0x46')]()[_0x847c('0x3b')](respondWithResult(_0x391c7a,null))[_0x847c('0x3d')](handleError(_0x391c7a,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 803f489..8397f49 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 _0xedd2=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','VoiceTransferReport','util'];(function(_0x26ef47,_0x37cb03){var _0x5c2064=function(_0x543aca){while(--_0x543aca){_0x26ef47['push'](_0x26ef47['shift']());}};_0x5c2064(++_0x37cb03);}(_0xedd2,0x170));var _0x2edd=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xedd2[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x2edd('0x0'));var logger=require('../../config/logger')(_0x2edd('0x1'));var moment=require(_0x2edd('0x2'));var BPromise=require(_0x2edd('0x3'));var rp=require(_0x2edd('0x4'));var fs=require('fs');var path=require(_0x2edd('0x5'));var rimraf=require(_0x2edd('0x6'));var config=require(_0x2edd('0x7'));var attributes=require('./voiceTransferReport.attributes');module['exports']=function(_0x4580f9,_0x48eada){return _0x4580f9['define'](_0x2edd('0x8'),attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x893d=['path','../../config/environment','./voiceTransferReport.attributes','VoiceTransferReport','report_call_transfer','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x27d958,_0x29ef87){var _0x53e63e=function(_0x4130ec){while(--_0x4130ec){_0x27d958['push'](_0x27d958['shift']());}};_0x53e63e(++_0x29ef87);}(_0x893d,0x10d));var _0xd893=function(_0x4258c5,_0x3390fd){_0x4258c5=_0x4258c5-0x0;var _0x5b953c=_0x893d[_0x4258c5];return _0x5b953c;};'use strict';var _=require(_0xd893('0x0'));var util=require(_0xd893('0x1'));var logger=require(_0xd893('0x2'))(_0xd893('0x3'));var moment=require(_0xd893('0x4'));var BPromise=require(_0xd893('0x5'));var rp=require(_0xd893('0x6'));var fs=require('fs');var path=require(_0xd893('0x7'));var rimraf=require('rimraf');var config=require(_0xd893('0x8'));var attributes=require(_0xd893('0x9'));module['exports']=function(_0x1eebfb,_0x45ef6e){return _0x1eebfb['define'](_0xd893('0xa'),attributes,{'tableName':_0xd893('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js index 3adf536..b302639 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 _0xa028=['stringify','error','VoiceTransferReport,\x20%s,\x20%s','message','result','catch','CreateVoiceTransferReport','create','body','options','raw','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x3084f6,_0x40809a){var _0xbcda8d=function(_0x399c91){while(--_0x399c91){_0x3084f6['push'](_0x3084f6['shift']());}};_0xbcda8d(++_0x40809a);}(_0xa028,0x1a0));var _0x8a02=function(_0x20b10f,_0xc23e9c){_0x20b10f=_0x20b10f-0x0;var _0x279391=_0xa028[_0x20b10f];return _0x279391;};'use strict';var _=require('lodash');var util=require(_0x8a02('0x0'));var moment=require('moment');var BPromise=require(_0x8a02('0x1'));var rs=require(_0x8a02('0x2'));var fs=require('fs');var Redis=require(_0x8a02('0x3'));var db=require(_0x8a02('0x4'))['db'];var utils=require(_0x8a02('0x5'));var logger=require(_0x8a02('0x6'))(_0x8a02('0x7'));var config=require(_0x8a02('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8a02('0x9')][_0x8a02('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2637f1,_0x194cfc,_0x5d64b5){return new BPromise(function(_0x453031,_0x1474ea){return client['request'](_0x2637f1,_0x5d64b5)[_0x8a02('0xb')](function(_0xd50b51){logger[_0x8a02('0xc')]('VoiceTransferReport,\x20%s,\x20%s',_0x194cfc,_0x8a02('0xd'));logger[_0x8a02('0xe')](_0x8a02('0xf'),_0x194cfc,_0x8a02('0xd'),JSON[_0x8a02('0x10')](_0xd50b51));if(_0xd50b51[_0x8a02('0x11')]){if(_0xd50b51['error']['code']===0x1f4){logger[_0x8a02('0x11')](_0x8a02('0x12'),_0x194cfc,_0xd50b51[_0x8a02('0x11')][_0x8a02('0x13')]);return _0x1474ea(_0xd50b51[_0x8a02('0x11')][_0x8a02('0x13')]);}logger[_0x8a02('0x11')](_0x8a02('0x12'),_0x194cfc,_0xd50b51[_0x8a02('0x11')]['message']);return _0x453031(_0xd50b51[_0x8a02('0x11')][_0x8a02('0x13')]);}else{logger[_0x8a02('0xc')](_0x8a02('0x12'),_0x194cfc,_0x8a02('0xd'));_0x453031(_0xd50b51[_0x8a02('0x14')][_0x8a02('0x13')]);}})[_0x8a02('0x15')](function(_0x504d87){logger[_0x8a02('0x11')]('VoiceTransferReport,\x20%s,\x20%s',_0x194cfc,_0x504d87);_0x1474ea(_0x504d87);});});}exports[_0x8a02('0x16')]=function(_0x6e342e){var _0xbef670=this;return new Promise(function(_0x2307d2,_0x22e1d3){return db['VoiceTransferReport'][_0x8a02('0x17')](_0x6e342e[_0x8a02('0x18')],{'raw':_0x6e342e[_0x8a02('0x19')]?_0x6e342e['options'][_0x8a02('0x1a')]===undefined?!![]:![]:!![]})[_0x8a02('0xb')](function(_0x4d6eb1){logger[_0x8a02('0xc')](_0x8a02('0x16'),_0x6e342e);logger[_0x8a02('0xe')]('CreateVoiceTransferReport',_0x6e342e,JSON['stringify'](_0x4d6eb1));_0x2307d2(_0x4d6eb1);})[_0x8a02('0x15')](function(_0x1686e6){logger[_0x8a02('0x11')](_0x8a02('0x16'),_0x1686e6[_0x8a02('0x13')],_0x6e342e);_0x22e1d3(_0xbef670['error'](0x1f4,_0x1686e6[_0x8a02('0x13')]));});});}; \ No newline at end of file +var _0x3c0d=['client','request','then','info','VoiceTransferReport,\x20%s,\x20%s','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','create','body','options','raw','CreateVoiceTransferReport','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x5678b5,_0x1c4aa8){var _0x4c09a5=function(_0x2aa89a){while(--_0x2aa89a){_0x5678b5['push'](_0x5678b5['shift']());}};_0x4c09a5(++_0x1c4aa8);}(_0x3c0d,0x10b));var _0xd3c0=function(_0x2910e2,_0x388d98){_0x2910e2=_0x2910e2-0x0;var _0x52665b=_0x3c0d[_0x2910e2];return _0x52665b;};'use strict';var _=require(_0xd3c0('0x0'));var util=require(_0xd3c0('0x1'));var moment=require(_0xd3c0('0x2'));var BPromise=require(_0xd3c0('0x3'));var rs=require(_0xd3c0('0x4'));var fs=require('fs');var Redis=require(_0xd3c0('0x5'));var db=require(_0xd3c0('0x6'))['db'];var utils=require(_0xd3c0('0x7'));var logger=require(_0xd3c0('0x8'))(_0xd3c0('0x9'));var config=require(_0xd3c0('0xa'));var jayson=require(_0xd3c0('0xb'));var client=jayson[_0xd3c0('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x279f84,_0x419e33,_0x311c22){return new BPromise(function(_0x9fad7b,_0x2e0d13){return client[_0xd3c0('0xd')](_0x279f84,_0x311c22)[_0xd3c0('0xe')](function(_0x28f93a){logger[_0xd3c0('0xf')](_0xd3c0('0x10'),_0x419e33,'request\x20sent');logger[_0xd3c0('0x11')](_0xd3c0('0x12'),_0x419e33,_0xd3c0('0x13'),JSON[_0xd3c0('0x14')](_0x28f93a));if(_0x28f93a['error']){if(_0x28f93a[_0xd3c0('0x15')][_0xd3c0('0x16')]===0x1f4){logger[_0xd3c0('0x15')](_0xd3c0('0x10'),_0x419e33,_0x28f93a[_0xd3c0('0x15')]['message']);return _0x2e0d13(_0x28f93a[_0xd3c0('0x15')][_0xd3c0('0x17')]);}logger[_0xd3c0('0x15')]('VoiceTransferReport,\x20%s,\x20%s',_0x419e33,_0x28f93a[_0xd3c0('0x15')]['message']);return _0x9fad7b(_0x28f93a[_0xd3c0('0x15')][_0xd3c0('0x17')]);}else{logger[_0xd3c0('0xf')](_0xd3c0('0x10'),_0x419e33,'request\x20sent');_0x9fad7b(_0x28f93a[_0xd3c0('0x18')][_0xd3c0('0x17')]);}})['catch'](function(_0x1c5b3d){logger[_0xd3c0('0x15')](_0xd3c0('0x10'),_0x419e33,_0x1c5b3d);_0x2e0d13(_0x1c5b3d);});});}exports['CreateVoiceTransferReport']=function(_0xe521f9){var _0x35fe33=this;return new Promise(function(_0x6ce550,_0x5d8898){return db['VoiceTransferReport'][_0xd3c0('0x19')](_0xe521f9[_0xd3c0('0x1a')],{'raw':_0xe521f9[_0xd3c0('0x1b')]?_0xe521f9[_0xd3c0('0x1b')][_0xd3c0('0x1c')]===undefined?!![]:![]:!![]})[_0xd3c0('0xe')](function(_0x4d7c9a){logger[_0xd3c0('0xf')]('CreateVoiceTransferReport',_0xe521f9);logger['debug'](_0xd3c0('0x1d'),_0xe521f9,JSON[_0xd3c0('0x14')](_0x4d7c9a));_0x6ce550(_0x4d7c9a);})[_0xd3c0('0x1e')](function(_0x504e08){logger['error'](_0xd3c0('0x1d'),_0x504e08['message'],_0xe521f9);_0x5d8898(_0x35fe33[_0xd3c0('0x15')](0x1f4,_0x504e08['message']));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index ed270ae..691d799 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 _0xdace=['unhold','calls','/transfer','transfer','exports','express','../../components/auth/service','./webbar.controller','post','isAuthenticated','isWebrtcLicence','originate','hangup','/answer','/hold','/unhold'];(function(_0x47877a,_0x2e7044){var _0x3cc89a=function(_0x2d754a){while(--_0x2d754a){_0x47877a['push'](_0x47877a['shift']());}};_0x3cc89a(++_0x2e7044);}(_0xdace,0xc5));var _0xedac=function(_0xa6cc5c,_0x239c99){_0xa6cc5c=_0xa6cc5c-0x0;var _0x44803d=_0xdace[_0xa6cc5c];return _0x44803d;};'use strict';var express=require(_0xedac('0x0'));var router=express['Router']();var auth=require(_0xedac('0x1'));var controller=require(_0xedac('0x2'));router[_0xedac('0x3')]('/originate',auth[_0xedac('0x4')](),auth[_0xedac('0x5')](),controller[_0xedac('0x6')]);router[_0xedac('0x3')]('/hangup',auth[_0xedac('0x4')](),auth[_0xedac('0x5')](),controller[_0xedac('0x7')]);router['post'](_0xedac('0x8'),auth[_0xedac('0x4')](),auth[_0xedac('0x5')](),controller['answer']);router[_0xedac('0x3')](_0xedac('0x9'),auth[_0xedac('0x4')](),auth['isWebrtcLicence'](),controller['hold']);router[_0xedac('0x3')](_0xedac('0xa'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0xedac('0xb')]);router[_0xedac('0x3')]('/calls',auth[_0xedac('0x4')](),auth['isWebrtcLicence'](),controller[_0xedac('0xc')]);router[_0xedac('0x3')](_0xedac('0xd'),auth[_0xedac('0x4')](),auth[_0xedac('0x5')](),controller[_0xedac('0xe')]);module[_0xedac('0xf')]=router; \ No newline at end of file +var _0xe5b3=['transfer','Router','../../components/auth/service','./webbar.controller','post','/originate','isAuthenticated','isWebrtcLicence','originate','/hangup','hangup','answer','hold','/unhold','unhold','/calls','calls','/transfer'];(function(_0x4d521e,_0x58ba39){var _0x3beb42=function(_0x1a7bd2){while(--_0x1a7bd2){_0x4d521e['push'](_0x4d521e['shift']());}};_0x3beb42(++_0x58ba39);}(_0xe5b3,0x133));var _0x3e5b=function(_0x5e7a65,_0x2dc2c2){_0x5e7a65=_0x5e7a65-0x0;var _0x514f3e=_0xe5b3[_0x5e7a65];return _0x514f3e;};'use strict';var express=require('express');var router=express[_0x3e5b('0x0')]();var auth=require(_0x3e5b('0x1'));var controller=require(_0x3e5b('0x2'));router[_0x3e5b('0x3')](_0x3e5b('0x4'),auth[_0x3e5b('0x5')](),auth[_0x3e5b('0x6')](),controller[_0x3e5b('0x7')]);router[_0x3e5b('0x3')](_0x3e5b('0x8'),auth[_0x3e5b('0x5')](),auth['isWebrtcLicence'](),controller[_0x3e5b('0x9')]);router[_0x3e5b('0x3')]('/answer',auth[_0x3e5b('0x5')](),auth[_0x3e5b('0x6')](),controller[_0x3e5b('0xa')]);router[_0x3e5b('0x3')]('/hold',auth['isAuthenticated'](),auth[_0x3e5b('0x6')](),controller[_0x3e5b('0xb')]);router[_0x3e5b('0x3')](_0x3e5b('0xc'),auth[_0x3e5b('0x5')](),auth['isWebrtcLicence'](),controller[_0x3e5b('0xd')]);router['post'](_0x3e5b('0xe'),auth[_0x3e5b('0x5')](),auth[_0x3e5b('0x6')](),controller[_0x3e5b('0xf')]);router[_0x3e5b('0x3')](_0x3e5b('0x10'),auth[_0x3e5b('0x5')](),auth['isWebrtcLicence'](),controller[_0x3e5b('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 9fd0b6d..30c331e 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 _0x524a=['webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','all','conference','conference\x20fired:','transfer','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','bluebird','jayson/promise','client','webbarapi','ioredis','redis','socket.io-emitter','number','userId\x20is\x20required','string','callNumber\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','stringify','emit','log','handleError:','error','stack','name','status','send','NotFound','request','then','code','message','catch','User','findOne','VoiceChannels','filter','rows','UserId','sessionId','length','sessionId\x20','\x20not\x20found!','originate','info','validate','body','callNumber','callerId','callbackUrl','user:%s','originate\x20executed!','json','userId','entityFound:','format','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:'];(function(_0x31b5a5,_0x44376a){var _0x364cc9=function(_0x4e5f95){while(--_0x4e5f95){_0x31b5a5['push'](_0x31b5a5['shift']());}};_0x364cc9(++_0x44376a);}(_0x524a,0xf5));var _0xa524=function(_0x456165,_0x3ba6cb){_0x456165=_0x456165-0x0;var _0x44f287=_0x524a[_0x456165];return _0x44f287;};'use strict';var path=require(_0xa524('0x0'));var fs=require('fs');var _=require(_0xa524('0x1'));var db=require(_0xa524('0x2'))['db'];var config=require(_0xa524('0x3'));var util=require('util');var BPromise=require(_0xa524('0x4'));var jayson=require(_0xa524('0x5'));var amiClient=jayson[_0xa524('0x6')]['http']({'port':0x232a});var logger=require('../../config/logger')(_0xa524('0x7'));var Redis=require(_0xa524('0x8'));config[_0xa524('0x9')]=_['defaults'](config[_0xa524('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0xa524('0xa'))(new Redis(config[_0xa524('0x9')]));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':_0xa524('0xb'),'required':[!![],_0xa524('0xc')]},'callNumber':{'type':_0xa524('0xd'),'required':[!![],_0xa524('0xe')]},'callerId':{'type':_0xa524('0xd')},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':_0xa524('0xb'),'required':[!![],_0xa524('0xc')]},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],_0xa524('0xc')]},'sessionId':{'type':_0xa524('0xd'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xa524('0xb'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':[!![],_0xa524('0xf')]},'transferNumber':{'type':'string','required':[!![],_0xa524('0x10')]}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0xa524('0xc')]},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xa524('0xb'),'required':[!![],_0xa524('0xc')]},'sessionId':{'type':'string','required':![]}});var callsValidation=new Schema({'userId':{'type':_0xa524('0xb'),'required':[!![],_0xa524('0xc')]}});var conferenceValidation=new Schema({'userId':{'type':_0xa524('0xb'),'required':[!![],_0xa524('0xc')]}});function emit(_0x45347f,_0x433c8a,_0x371385){logger['info'](_0x45347f,_0x433c8a,JSON[_0xa524('0x11')](_0x371385));io['to'](_0x45347f)[_0xa524('0x12')](_0x433c8a,_0x371385);}function handleError(_0x1fd8f5){return function(_0x3d6a0d){console[_0xa524('0x13')](_0xa524('0x14'),_0x3d6a0d,_0x3d6a0d instanceof RangeError);logger[_0xa524('0x15')](_0x3d6a0d[_0xa524('0x16')]);if(_0x3d6a0d instanceof RangeError){if(_0x3d6a0d['name']){delete _0x3d6a0d[_0xa524('0x17')];}_0x1fd8f5[_0xa524('0x18')](0x194)[_0xa524('0x19')](_0x3d6a0d);}else{if(_0x3d6a0d[_0xa524('0x17')]){delete _0x3d6a0d['name'];}_0x1fd8f5['status'](0x1f4)[_0xa524('0x19')](_0x3d6a0d);}};}function checkError(){return function(_0xc560dd){if(!_0xc560dd){throw new RangeError(_0xa524('0x1a'));}return _0xc560dd;};}function respondWithRpcPromise(_0x1093cc,_0x1e6abb){return new BPromise(function(_0x3866e2,_0x4abffe){var _0x262eac=amiClient;return _0x262eac[_0xa524('0x1b')](_0x1093cc,_0x1e6abb)[_0xa524('0x1c')](function(_0x40fb4b){if(_0x40fb4b[_0xa524('0x15')]){if(_0x40fb4b[_0xa524('0x15')][_0xa524('0x1d')]===0x1f4){return _0x4abffe(_0x40fb4b['error'][_0xa524('0x1e')]);}return _0x3866e2(_0x40fb4b[_0xa524('0x15')]['message']);}else{_0x3866e2(_0x40fb4b['result']);}})[_0xa524('0x1f')](function(_0x2ed3b0){_0x4abffe(_0x2ed3b0);});});}function getAgent(_0x156b8b){return db[_0xa524('0x20')][_0xa524('0x21')]({'where':{'id':_0x156b8b,'role':'agent'}})['then'](checkError());}function getAgentCheckSession(_0x1aeabc,_0x869b22){return new BPromise(function(_0x1582fa,_0x9e9e5e){var _0x505c42=respondWithRpcPromise(_0xa524('0x22'));var _0x32ba03=getAgent(_0x1aeabc);Promise['all']([_0x505c42,_0x32ba03])[_0xa524('0x1c')](function(_0x147094){var _0x4c587b=_0x147094[0x0];var _0x393813=_0x147094[0x1];var _0x5f03ad=_[_0xa524('0x23')](_0x4c587b[_0xa524('0x24')],function(_0x45b846){return _0x45b846[_0xa524('0x25')]==_0x393813['id']&&_0x45b846[_0xa524('0x26')]==_0x869b22;});if(_0x5f03ad[_0xa524('0x27')]==0x1){_0x1582fa(_0x393813);}else{_0x9e9e5e(new RangeError(_0xa524('0x28')+_0x869b22+_0xa524('0x29')));}});});}exports[_0xa524('0x2a')]=function(_0x5b6a54,_0x535e41){logger[_0xa524('0x2b')]('originate\x20fired:',_0x5b6a54['body']);var _0x46af1b=originateValidation[_0xa524('0x2c')](_0x5b6a54[_0xa524('0x2d')]);if(_0x46af1b[_0xa524('0x27')]>0x0){return _0x535e41['status'](0x190)['json'](_0x46af1b);}var _0x1facef=_0x5b6a54['body']['userId'];var _0x268341=_0x5b6a54[_0xa524('0x2d')][_0xa524('0x2e')];var _0x35086a=_0x5b6a54[_0xa524('0x2d')][_0xa524('0x2f')];var _0x9bb038=_0x5b6a54[_0xa524('0x2d')][_0xa524('0x30')];return getAgent(_0x1facef)[_0xa524('0x1c')](function(_0xc7b408){logger[_0xa524('0x2b')]('entityFound:',_0xc7b408['name']);emit(util['format'](_0xa524('0x31'),_0xc7b408[_0xa524('0x17')]),'webbar:originate',{'callNumber':_0x268341,'callerId':_0x35086a,'callbackUrl':_0x9bb038});return _0x535e41[_0xa524('0x18')](0xc8)['json']({'error':![],'message':_0xa524('0x32')});})[_0xa524('0x1f')](handleError(_0x535e41));};exports['hangup']=function(_0x208822,_0x259532){logger[_0xa524('0x2b')]('hangup\x20fired:',_0x208822[_0xa524('0x2d')]);var _0x268930=hangupValidation['validate'](_0x208822[_0xa524('0x2d')]);if(_0x268930[_0xa524('0x27')]>0x0){return _0x259532['status'](0x190)[_0xa524('0x33')](_0x268930);}var _0x31d21d=_0x208822['body'][_0xa524('0x34')];var _0x462af9=_0x208822[_0xa524('0x2d')][_0xa524('0x26')];return getAgent(_0x31d21d)[_0xa524('0x1c')](function(_0x38f87a){logger[_0xa524('0x2b')](_0xa524('0x35'),_0x38f87a[_0xa524('0x17')]);emit(util[_0xa524('0x36')](_0xa524('0x31'),_0x38f87a['name']),_0xa524('0x37'),{'sessionId':_0x462af9});return _0x259532['status'](0xc8)[_0xa524('0x33')]({'error':![],'message':_0xa524('0x38')});})[_0xa524('0x1f')](handleError(_0x259532));};exports[_0xa524('0x39')]=function(_0x33068e,_0x3ba597){logger[_0xa524('0x2b')](_0xa524('0x3a'),_0x33068e[_0xa524('0x2d')]);var _0x2dc240=answerValidation['validate'](_0x33068e[_0xa524('0x2d')]);if(_0x2dc240[_0xa524('0x27')]>0x0){return _0x3ba597['status'](0x190)[_0xa524('0x33')](_0x2dc240);}var _0x3f5564=_0x33068e['body']['userId'];var _0x4dff4b=_0x33068e['body']['sessionId'];return getAgent(_0x3f5564)[_0xa524('0x1c')](function(_0x2cf0f5){logger[_0xa524('0x2b')](_0xa524('0x35'),_0x2cf0f5['name']);emit(util[_0xa524('0x36')](_0xa524('0x31'),_0x2cf0f5[_0xa524('0x17')]),_0xa524('0x3b'),{'sessionId':_0x4dff4b});return _0x3ba597['status'](0xc8)[_0xa524('0x33')]({'error':![],'message':_0xa524('0x3c')});})[_0xa524('0x1f')](handleError(_0x3ba597));};exports[_0xa524('0x3d')]=function(_0x239c77,_0x4b5eed){logger[_0xa524('0x2b')](_0xa524('0x3e'),_0x239c77[_0xa524('0x2d')]);var _0x150428=holdValidation[_0xa524('0x2c')](_0x239c77[_0xa524('0x2d')]);if(_0x150428[_0xa524('0x27')]>0x0){return _0x4b5eed[_0xa524('0x18')](0x190)[_0xa524('0x33')](_0x150428);}var _0x4cee61=_0x239c77['body'][_0xa524('0x34')];var _0x26096a=_0x239c77[_0xa524('0x2d')][_0xa524('0x26')];return getAgent(_0x4cee61)[_0xa524('0x1c')](function(_0xddc80){logger['info'](_0xa524('0x35'),_0xddc80[_0xa524('0x17')]);emit(util[_0xa524('0x36')](_0xa524('0x31'),_0xddc80[_0xa524('0x17')]),_0xa524('0x3f'),{'sessionId':_0x26096a});return _0x4b5eed['status'](0xc8)[_0xa524('0x33')]({'error':![],'message':_0xa524('0x40')});})[_0xa524('0x1f')](handleError(_0x4b5eed));};exports[_0xa524('0x41')]=function(_0x25ffbd,_0x244efa){logger[_0xa524('0x2b')](_0xa524('0x42'),_0x25ffbd[_0xa524('0x2d')]);var _0x217314=unholdValidation[_0xa524('0x2c')](_0x25ffbd[_0xa524('0x2d')]);if(_0x217314[_0xa524('0x27')]>0x0){return _0x244efa[_0xa524('0x18')](0x190)[_0xa524('0x33')](_0x217314);}var _0x5e9919=_0x25ffbd[_0xa524('0x2d')][_0xa524('0x34')];var _0x4eeab2=_0x25ffbd['body'][_0xa524('0x26')];return getAgent(_0x5e9919)[_0xa524('0x1c')](function(_0x2278d2){logger[_0xa524('0x2b')](_0xa524('0x35'),_0x2278d2[_0xa524('0x17')]);emit(util[_0xa524('0x36')]('user:%s',_0x2278d2[_0xa524('0x17')]),_0xa524('0x43'),{'sessionId':_0x4eeab2});return _0x244efa[_0xa524('0x18')](0xc8)[_0xa524('0x33')]({'error':![],'message':_0xa524('0x44')});})['catch'](handleError(_0x244efa));};exports[_0xa524('0x45')]=function(_0x4f7531,_0x205a09){logger[_0xa524('0x2b')](_0xa524('0x46'),_0x205a09[_0xa524('0x2d')]);var _0x161393=callsValidation[_0xa524('0x2c')](_0x4f7531[_0xa524('0x2d')]);if(_0x161393['length']>0x0){return _0x205a09['status'](0x190)[_0xa524('0x33')](_0x161393);}var _0x17b33d=_0x4f7531[_0xa524('0x2d')]['userId'];var _0x2e21f3=respondWithRpcPromise(_0xa524('0x22'));var _0x49a480=getAgent(_0x17b33d);return Promise[_0xa524('0x47')]([_0x2e21f3,_0x49a480])[_0xa524('0x1c')](function(_0x1563ef){var _0x3e841e=_0x1563ef[0x0];var _0x6aad5c=_0x1563ef[0x1];var _0x248ba2=_[_0xa524('0x23')](_0x3e841e['rows'],function(_0xdbda6e){return _0xdbda6e[_0xa524('0x25')]==_0x6aad5c['id'];});return _0x205a09[_0xa524('0x18')](0xc8)[_0xa524('0x33')]({'count':_0x248ba2['length'],'rows':_0x248ba2});})[_0xa524('0x1f')](handleError(_0x205a09));};exports[_0xa524('0x48')]=function(_0x5cd707,_0x1d5df2){logger[_0xa524('0x2b')](_0xa524('0x49'),_0x5cd707[_0xa524('0x2d')]);var _0x541645=conferenceValidation['validate'](_0x5cd707[_0xa524('0x2d')]);if(_0x541645['length']>0x0){return _0x1d5df2['status'](0x190)['json'](_0x541645);}var _0x2e5216=_0x5cd707['body']['userId'];return getAgent(_0x2e5216)[_0xa524('0x1c')](function(_0x3e4255){logger[_0xa524('0x2b')](_0xa524('0x35'),_0x3e4255['name']);emit(util[_0xa524('0x36')](_0xa524('0x31'),_0x3e4255[_0xa524('0x17')]),'webbar:conference');return _0x1d5df2[_0xa524('0x18')](0xc8)[_0xa524('0x33')]({'error':![],'message':'conference\x20executed!'});})['catch'](handleError(_0x1d5df2));};exports[_0xa524('0x4a')]=function(_0x3e8167,_0x158e1c){logger[_0xa524('0x2b')]('transfer\x20fired:',_0x3e8167['body']);var _0x300bb7=transferValidation[_0xa524('0x2c')](_0x3e8167[_0xa524('0x2d')]);if(_0x300bb7['length']>0x0){return _0x158e1c['status'](0x190)[_0xa524('0x33')](_0x300bb7);}var _0x4a9127=_0x3e8167['body']['userId'];var _0x4f71b1=_0x3e8167[_0xa524('0x2d')][_0xa524('0x26')];var _0x5a5ce4=_0x3e8167['body'][_0xa524('0x4b')];return getAgent(_0x4a9127)[_0xa524('0x1c')](function(_0x50ec48){logger[_0xa524('0x2b')](_0xa524('0x35'),_0x50ec48[_0xa524('0x17')]);emit(util[_0xa524('0x36')](_0xa524('0x31'),_0x50ec48[_0xa524('0x17')]),_0xa524('0x4c'),{'sessionId':_0x4f71b1,'transferNumber':_0x5a5ce4});return _0x158e1c[_0xa524('0x18')](0xc8)[_0xa524('0x33')]({'error':![],'message':_0xa524('0x4d')});})['catch'](handleError(_0x158e1c));}; \ No newline at end of file +var _0xbb53=['info','stringify','emit','log','handleError:','error','name','status','send','NotFound','request','then','code','message','result','User','findOne','agent','VoiceChannels','filter','rows','UserId','sessionId','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','validate','body','userId','callerId','callbackUrl','format','webbar:originate','json','originate\x20executed!','entityFound:','user:%s','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','answer\x20executed!','webbar:hold','catch','unhold','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','all','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','webbar:transfer','path','lodash','../../mysqldb','../../config/environment','util','bluebird','jayson/promise','client','http','../../config/logger','redis','defaults','localhost','socket.io-emitter','userId\x20is\x20required','string','callNumber\x20is\x20required','number','transferNumber\x20is\x20required'];(function(_0xa276cf,_0x447157){var _0x38eb3d=function(_0x4a5ee6){while(--_0x4a5ee6){_0xa276cf['push'](_0xa276cf['shift']());}};_0x38eb3d(++_0x447157);}(_0xbb53,0x121));var _0x3bb5=function(_0x27e86e,_0x49d030){_0x27e86e=_0x27e86e-0x0;var _0x57d83e=_0xbb53[_0x27e86e];return _0x57d83e;};'use strict';var path=require(_0x3bb5('0x0'));var fs=require('fs');var _=require(_0x3bb5('0x1'));var db=require(_0x3bb5('0x2'))['db'];var config=require(_0x3bb5('0x3'));var util=require(_0x3bb5('0x4'));var BPromise=require(_0x3bb5('0x5'));var jayson=require(_0x3bb5('0x6'));var amiClient=jayson[_0x3bb5('0x7')][_0x3bb5('0x8')]({'port':0x232a});var logger=require(_0x3bb5('0x9'))('webbarapi');var Redis=require('ioredis');config[_0x3bb5('0xa')]=_[_0x3bb5('0xb')](config[_0x3bb5('0xa')],{'host':_0x3bb5('0xc'),'port':0x18eb});var io=require(_0x3bb5('0xd'))(new Redis(config['redis']));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':'number','required':[!![],_0x3bb5('0xe')]},'callNumber':{'type':_0x3bb5('0xf'),'required':[!![],_0x3bb5('0x10')]},'callerId':{'type':'string'},'callbackUrl':{'type':_0x3bb5('0xf')}});var hangupValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x3bb5('0xf'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x3bb5('0x11'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x3bb5('0xf'),'required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],_0x3bb5('0xe')]},'sessionId':{'type':'string','required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0x3bb5('0xf'),'required':[!![],_0x3bb5('0x12')]}});var holdValidation=new Schema({'userId':{'type':_0x3bb5('0x11'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x3bb5('0xf'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x3bb5('0x11'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x3bb5('0xf'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x3bb5('0x11'),'required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']}});function emit(_0x42ef1b,_0x4693d6,_0x5245cc){logger[_0x3bb5('0x13')](_0x42ef1b,_0x4693d6,JSON[_0x3bb5('0x14')](_0x5245cc));io['to'](_0x42ef1b)[_0x3bb5('0x15')](_0x4693d6,_0x5245cc);}function handleError(_0x262059){return function(_0x48bc25){console[_0x3bb5('0x16')](_0x3bb5('0x17'),_0x48bc25,_0x48bc25 instanceof RangeError);logger[_0x3bb5('0x18')](_0x48bc25['stack']);if(_0x48bc25 instanceof RangeError){if(_0x48bc25['name']){delete _0x48bc25[_0x3bb5('0x19')];}_0x262059[_0x3bb5('0x1a')](0x194)[_0x3bb5('0x1b')](_0x48bc25);}else{if(_0x48bc25['name']){delete _0x48bc25[_0x3bb5('0x19')];}_0x262059[_0x3bb5('0x1a')](0x1f4)[_0x3bb5('0x1b')](_0x48bc25);}};}function checkError(){return function(_0x34fc60){if(!_0x34fc60){throw new RangeError(_0x3bb5('0x1c'));}return _0x34fc60;};}function respondWithRpcPromise(_0x11d156,_0x504c29){return new BPromise(function(_0x37444e,_0x3eae85){var _0x438a8d=amiClient;return _0x438a8d[_0x3bb5('0x1d')](_0x11d156,_0x504c29)[_0x3bb5('0x1e')](function(_0xfb9e8){if(_0xfb9e8[_0x3bb5('0x18')]){if(_0xfb9e8['error'][_0x3bb5('0x1f')]===0x1f4){return _0x3eae85(_0xfb9e8[_0x3bb5('0x18')]['message']);}return _0x37444e(_0xfb9e8['error'][_0x3bb5('0x20')]);}else{_0x37444e(_0xfb9e8[_0x3bb5('0x21')]);}})['catch'](function(_0x483689){_0x3eae85(_0x483689);});});}function getAgent(_0x477d1f){return db[_0x3bb5('0x22')][_0x3bb5('0x23')]({'where':{'id':_0x477d1f,'role':_0x3bb5('0x24')}})['then'](checkError());}function getAgentCheckSession(_0x5baf9a,_0x33e943){return new BPromise(function(_0x4e8c65,_0x175593){var _0x2d65ec=respondWithRpcPromise(_0x3bb5('0x25'));var _0x534b15=getAgent(_0x5baf9a);Promise['all']([_0x2d65ec,_0x534b15])[_0x3bb5('0x1e')](function(_0x39f1ad){var _0x17ada7=_0x39f1ad[0x0];var _0x18304c=_0x39f1ad[0x1];var _0x311680=_[_0x3bb5('0x26')](_0x17ada7[_0x3bb5('0x27')],function(_0x5ce225){return _0x5ce225[_0x3bb5('0x28')]==_0x18304c['id']&&_0x5ce225[_0x3bb5('0x29')]==_0x33e943;});if(_0x311680[_0x3bb5('0x2a')]==0x1){_0x4e8c65(_0x18304c);}else{_0x175593(new RangeError(_0x3bb5('0x2b')+_0x33e943+_0x3bb5('0x2c')));}});});}exports[_0x3bb5('0x2d')]=function(_0x464c2f,_0x52cd46){logger[_0x3bb5('0x13')](_0x3bb5('0x2e'),_0x464c2f['body']);var _0x396345=originateValidation[_0x3bb5('0x2f')](_0x464c2f[_0x3bb5('0x30')]);if(_0x396345[_0x3bb5('0x2a')]>0x0){return _0x52cd46[_0x3bb5('0x1a')](0x190)['json'](_0x396345);}var _0x31a1f9=_0x464c2f[_0x3bb5('0x30')][_0x3bb5('0x31')];var _0xdb73f4=_0x464c2f['body']['callNumber'];var _0x125820=_0x464c2f[_0x3bb5('0x30')][_0x3bb5('0x32')];var _0x3be007=_0x464c2f[_0x3bb5('0x30')][_0x3bb5('0x33')];return getAgent(_0x31a1f9)[_0x3bb5('0x1e')](function(_0x2a0a19){logger[_0x3bb5('0x13')]('entityFound:',_0x2a0a19[_0x3bb5('0x19')]);emit(util[_0x3bb5('0x34')]('user:%s',_0x2a0a19['name']),_0x3bb5('0x35'),{'callNumber':_0xdb73f4,'callerId':_0x125820,'callbackUrl':_0x3be007});return _0x52cd46[_0x3bb5('0x1a')](0xc8)[_0x3bb5('0x36')]({'error':![],'message':_0x3bb5('0x37')});})['catch'](handleError(_0x52cd46));};exports['hangup']=function(_0x1fd27b,_0x5ac528){logger[_0x3bb5('0x13')]('hangup\x20fired:',_0x1fd27b['body']);var _0x29c29f=hangupValidation['validate'](_0x1fd27b['body']);if(_0x29c29f[_0x3bb5('0x2a')]>0x0){return _0x5ac528[_0x3bb5('0x1a')](0x190)[_0x3bb5('0x36')](_0x29c29f);}var _0x53aead=_0x1fd27b[_0x3bb5('0x30')]['userId'];var _0x2361e2=_0x1fd27b['body'][_0x3bb5('0x29')];return getAgent(_0x53aead)[_0x3bb5('0x1e')](function(_0x4209d2){logger[_0x3bb5('0x13')](_0x3bb5('0x38'),_0x4209d2[_0x3bb5('0x19')]);emit(util['format'](_0x3bb5('0x39'),_0x4209d2[_0x3bb5('0x19')]),'webbar:hangup',{'sessionId':_0x2361e2});return _0x5ac528[_0x3bb5('0x1a')](0xc8)[_0x3bb5('0x36')]({'error':![],'message':_0x3bb5('0x3a')});})['catch'](handleError(_0x5ac528));};exports[_0x3bb5('0x3b')]=function(_0x29ea70,_0x495de7){logger[_0x3bb5('0x13')](_0x3bb5('0x3c'),_0x29ea70[_0x3bb5('0x30')]);var _0x2291e9=answerValidation[_0x3bb5('0x2f')](_0x29ea70[_0x3bb5('0x30')]);if(_0x2291e9[_0x3bb5('0x2a')]>0x0){return _0x495de7[_0x3bb5('0x1a')](0x190)[_0x3bb5('0x36')](_0x2291e9);}var _0x42676d=_0x29ea70[_0x3bb5('0x30')][_0x3bb5('0x31')];var _0x20478a=_0x29ea70[_0x3bb5('0x30')]['sessionId'];return getAgent(_0x42676d)[_0x3bb5('0x1e')](function(_0xc6dc91){logger['info']('entityFound:',_0xc6dc91[_0x3bb5('0x19')]);emit(util[_0x3bb5('0x34')](_0x3bb5('0x39'),_0xc6dc91[_0x3bb5('0x19')]),_0x3bb5('0x3d'),{'sessionId':_0x20478a});return _0x495de7[_0x3bb5('0x1a')](0xc8)[_0x3bb5('0x36')]({'error':![],'message':_0x3bb5('0x3e')});})['catch'](handleError(_0x495de7));};exports['hold']=function(_0x3882cf,_0x2bce57){logger[_0x3bb5('0x13')]('hold\x20fired:',_0x3882cf[_0x3bb5('0x30')]);var _0x54feb9=holdValidation[_0x3bb5('0x2f')](_0x3882cf[_0x3bb5('0x30')]);if(_0x54feb9[_0x3bb5('0x2a')]>0x0){return _0x2bce57[_0x3bb5('0x1a')](0x190)[_0x3bb5('0x36')](_0x54feb9);}var _0x2b7c68=_0x3882cf['body'][_0x3bb5('0x31')];var _0x545a42=_0x3882cf['body'][_0x3bb5('0x29')];return getAgent(_0x2b7c68)[_0x3bb5('0x1e')](function(_0x5075bd){logger[_0x3bb5('0x13')](_0x3bb5('0x38'),_0x5075bd[_0x3bb5('0x19')]);emit(util[_0x3bb5('0x34')](_0x3bb5('0x39'),_0x5075bd['name']),_0x3bb5('0x3f'),{'sessionId':_0x545a42});return _0x2bce57[_0x3bb5('0x1a')](0xc8)['json']({'error':![],'message':'hold\x20executed!'});})[_0x3bb5('0x40')](handleError(_0x2bce57));};exports[_0x3bb5('0x41')]=function(_0x1e5b64,_0x90d5b6){logger[_0x3bb5('0x13')]('unhold\x20fired:',_0x1e5b64[_0x3bb5('0x30')]);var _0x2c342c=unholdValidation[_0x3bb5('0x2f')](_0x1e5b64[_0x3bb5('0x30')]);if(_0x2c342c[_0x3bb5('0x2a')]>0x0){return _0x90d5b6[_0x3bb5('0x1a')](0x190)[_0x3bb5('0x36')](_0x2c342c);}var _0x5d0751=_0x1e5b64[_0x3bb5('0x30')][_0x3bb5('0x31')];var _0x1c02fa=_0x1e5b64[_0x3bb5('0x30')][_0x3bb5('0x29')];return getAgent(_0x5d0751)['then'](function(_0x1747a7){logger[_0x3bb5('0x13')](_0x3bb5('0x38'),_0x1747a7[_0x3bb5('0x19')]);emit(util[_0x3bb5('0x34')](_0x3bb5('0x39'),_0x1747a7[_0x3bb5('0x19')]),_0x3bb5('0x42'),{'sessionId':_0x1c02fa});return _0x90d5b6['status'](0xc8)[_0x3bb5('0x36')]({'error':![],'message':_0x3bb5('0x43')});})[_0x3bb5('0x40')](handleError(_0x90d5b6));};exports[_0x3bb5('0x44')]=function(_0x5d6d39,_0x44f21b){logger['info'](_0x3bb5('0x45'),_0x44f21b[_0x3bb5('0x30')]);var _0xe04576=callsValidation[_0x3bb5('0x2f')](_0x5d6d39[_0x3bb5('0x30')]);if(_0xe04576['length']>0x0){return _0x44f21b[_0x3bb5('0x1a')](0x190)[_0x3bb5('0x36')](_0xe04576);}var _0x1e2d16=_0x5d6d39[_0x3bb5('0x30')]['userId'];var _0xe88e97=respondWithRpcPromise(_0x3bb5('0x25'));var _0x314684=getAgent(_0x1e2d16);return Promise[_0x3bb5('0x46')]([_0xe88e97,_0x314684])[_0x3bb5('0x1e')](function(_0xe5b850){var _0x1b1b09=_0xe5b850[0x0];var _0x458854=_0xe5b850[0x1];var _0x4a711b=_[_0x3bb5('0x26')](_0x1b1b09[_0x3bb5('0x27')],function(_0x3a61cb){return _0x3a61cb['UserId']==_0x458854['id'];});return _0x44f21b['status'](0xc8)[_0x3bb5('0x36')]({'count':_0x4a711b[_0x3bb5('0x2a')],'rows':_0x4a711b});})[_0x3bb5('0x40')](handleError(_0x44f21b));};exports['conference']=function(_0x2b0d73,_0x901d51){logger[_0x3bb5('0x13')](_0x3bb5('0x47'),_0x2b0d73[_0x3bb5('0x30')]);var _0x447359=conferenceValidation[_0x3bb5('0x2f')](_0x2b0d73['body']);if(_0x447359['length']>0x0){return _0x901d51[_0x3bb5('0x1a')](0x190)[_0x3bb5('0x36')](_0x447359);}var _0x29f774=_0x2b0d73[_0x3bb5('0x30')][_0x3bb5('0x31')];return getAgent(_0x29f774)[_0x3bb5('0x1e')](function(_0x4d5e0b){logger[_0x3bb5('0x13')](_0x3bb5('0x38'),_0x4d5e0b[_0x3bb5('0x19')]);emit(util[_0x3bb5('0x34')]('user:%s',_0x4d5e0b[_0x3bb5('0x19')]),_0x3bb5('0x48'));return _0x901d51[_0x3bb5('0x1a')](0xc8)[_0x3bb5('0x36')]({'error':![],'message':_0x3bb5('0x49')});})[_0x3bb5('0x40')](handleError(_0x901d51));};exports[_0x3bb5('0x4a')]=function(_0x3e0d3c,_0x5a9663){logger[_0x3bb5('0x13')](_0x3bb5('0x4b'),_0x3e0d3c[_0x3bb5('0x30')]);var _0xca4e93=transferValidation[_0x3bb5('0x2f')](_0x3e0d3c['body']);if(_0xca4e93[_0x3bb5('0x2a')]>0x0){return _0x5a9663['status'](0x190)[_0x3bb5('0x36')](_0xca4e93);}var _0x58851f=_0x3e0d3c[_0x3bb5('0x30')][_0x3bb5('0x31')];var _0x102428=_0x3e0d3c['body'][_0x3bb5('0x29')];var _0x30611b=_0x3e0d3c[_0x3bb5('0x30')]['transferNumber'];return getAgent(_0x58851f)[_0x3bb5('0x1e')](function(_0x14cf65){logger[_0x3bb5('0x13')]('entityFound:',_0x14cf65[_0x3bb5('0x19')]);emit(util[_0x3bb5('0x34')](_0x3bb5('0x39'),_0x14cf65[_0x3bb5('0x19')]),_0x3bb5('0x4c'),{'sessionId':_0x102428,'transferNumber':_0x30611b});return _0x5a9663[_0x3bb5('0x1a')](0xc8)[_0x3bb5('0x36')]({'error':![],'message':'transfer\x20executed!'});})['catch'](handleError(_0x5a9663));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index cf07f58..ec2723d 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 _0xda2d=['/:id','removeDispositions','removeAnswers','/:id/users','removeAgents','exports','util','path','connect-timeout','express','Router','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','post','create','addDisposition','addAnswer','addApplications','/:id/notify','notify','/:id/send','send','put','delete'];(function(_0x19b5ed,_0x32ff8d){var _0x139dd5=function(_0x1d1f5b){while(--_0x1d1f5b){_0x19b5ed['push'](_0x19b5ed['shift']());}};_0x139dd5(++_0x32ff8d);}(_0xda2d,0x102));var _0xdda2=function(_0x2ad31a,_0x289e93){_0x2ad31a=_0x2ad31a-0x0;var _0x4626d7=_0xda2d[_0x2ad31a];return _0x4626d7;};'use strict';var multer=require('multer');var util=require(_0xdda2('0x0'));var path=require(_0xdda2('0x1'));var timeout=require(_0xdda2('0x2'));var express=require(_0xdda2('0x3'));var router=express[_0xdda2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdda2('0x5'));var controller=require(_0xdda2('0x6'));router[_0xdda2('0x7')]('/',auth[_0xdda2('0x8')](),controller[_0xdda2('0x9')]);router[_0xdda2('0x7')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0xb')]);router[_0xdda2('0x7')]('/:id',auth[_0xdda2('0x8')](),controller[_0xdda2('0xc')]);router['get'](_0xdda2('0xd'),auth[_0xdda2('0x8')](),controller[_0xdda2('0xe')]);router[_0xdda2('0x7')](_0xdda2('0xf'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x10')]);router[_0xdda2('0x7')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0xdda2('0x7')](_0xdda2('0x11'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x12')]);router[_0xdda2('0x13')]('/',auth[_0xdda2('0x8')](),controller[_0xdda2('0x14')]);router['post'](_0xdda2('0xd'),auth['isAuthenticated'](),controller[_0xdda2('0x15')]);router[_0xdda2('0x13')](_0xdda2('0xf'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x16')]);router['post']('/:id/users',auth[_0xdda2('0x8')](),controller['addAgents']);router[_0xdda2('0x13')](_0xdda2('0x11'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x17')]);router[_0xdda2('0x13')](_0xdda2('0x18'),controller[_0xdda2('0x19')]);router[_0xdda2('0x13')](_0xdda2('0x1a'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x1b')]);router[_0xdda2('0x1c')]('/:id',auth[_0xdda2('0x8')](),controller['update']);router[_0xdda2('0x1d')](_0xdda2('0x1e'),auth[_0xdda2('0x8')](),controller['destroy']);router[_0xdda2('0x1d')]('/:id/dispositions',auth[_0xdda2('0x8')](),controller[_0xdda2('0x1f')]);router['delete'](_0xdda2('0xf'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x20')]);router[_0xdda2('0x1d')](_0xdda2('0x21'),auth['isAuthenticated'](),controller[_0xdda2('0x22')]);module[_0xdda2('0x23')]=router; \ No newline at end of file +var _0x9582=['destroy','delete','removeDispositions','removeAnswers','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','getApplications','post','create','addDisposition','addApplications','/:id/notify','/:id/send','put'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9582,0x95));var _0x2958=function(_0x183a39,_0x40dda0){_0x183a39=_0x183a39-0x0;var _0x5676fa=_0x9582[_0x183a39];return _0x5676fa;};'use strict';var multer=require(_0x2958('0x0'));var util=require(_0x2958('0x1'));var path=require(_0x2958('0x2'));var timeout=require(_0x2958('0x3'));var express=require(_0x2958('0x4'));var router=express[_0x2958('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x2958('0x6'));var interaction=require(_0x2958('0x7'));var config=require(_0x2958('0x8'));var controller=require(_0x2958('0x9'));router[_0x2958('0xa')]('/',auth[_0x2958('0xb')](),controller[_0x2958('0xc')]);router[_0x2958('0xa')](_0x2958('0xd'),auth[_0x2958('0xb')](),controller['describe']);router['get'](_0x2958('0xe'),auth['isAuthenticated'](),controller[_0x2958('0xf')]);router['get'](_0x2958('0x10'),auth['isAuthenticated'](),controller[_0x2958('0x11')]);router[_0x2958('0xa')](_0x2958('0x12'),auth[_0x2958('0xb')](),controller[_0x2958('0x13')]);router['get'](_0x2958('0x14'),auth[_0x2958('0xb')](),controller[_0x2958('0x15')]);router[_0x2958('0xa')](_0x2958('0x16'),auth[_0x2958('0xb')](),controller[_0x2958('0x17')]);router[_0x2958('0x18')]('/',auth['isAuthenticated'](),controller[_0x2958('0x19')]);router[_0x2958('0x18')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x2958('0x1a')]);router[_0x2958('0x18')]('/:id/canned_answers',auth[_0x2958('0xb')](),controller['addAnswer']);router['post'](_0x2958('0x14'),auth[_0x2958('0xb')](),controller['addAgents']);router['post'](_0x2958('0x16'),auth[_0x2958('0xb')](),controller[_0x2958('0x1b')]);router[_0x2958('0x18')](_0x2958('0x1c'),controller['notify']);router[_0x2958('0x18')](_0x2958('0x1d'),auth[_0x2958('0xb')](),controller['send']);router[_0x2958('0x1e')]('/:id',auth[_0x2958('0xb')](),controller['update']);router['delete'](_0x2958('0xe'),auth[_0x2958('0xb')](),controller[_0x2958('0x1f')]);router[_0x2958('0x20')](_0x2958('0x10'),auth[_0x2958('0xb')](),controller[_0x2958('0x21')]);router[_0x2958('0x20')](_0x2958('0x12'),auth[_0x2958('0xb')](),controller[_0x2958('0x22')]);router[_0x2958('0x20')](_0x2958('0x14'),auth[_0x2958('0xb')](),controller[_0x2958('0x23')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 8a51d6f..6b72339 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 _0x7605=['BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','generate','ENUM','twilio','sinch','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}'];(function(_0x373dc8,_0x3a22ec){var _0x1158fe=function(_0x17d3f6){while(--_0x17d3f6){_0x373dc8['push'](_0x373dc8['shift']());}};_0x1158fe(++_0x3a22ec);}(_0x7605,0x1c6));var _0x5760=function(_0x5d3752,_0x2f540a){_0x5d3752=_0x5d3752-0x0;var _0x413ac9=_0x7605[_0x5d3752];return _0x413ac9;};'use strict';var Sequelize=require(_0x5760('0x0'));var rs=require(_0x5760('0x1'));module[_0x5760('0x2')]={'name':{'type':Sequelize[_0x5760('0x3')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0x5760('0x3')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x5760('0x3')],'defaultValue':function(){return rs[_0x5760('0x4')]();}},'phone':{'type':Sequelize[_0x5760('0x3')]},'type':{'type':Sequelize[_0x5760('0x5')](_0x5760('0x6'),_0x5760('0x7'))},'accountSid':{'type':Sequelize[_0x5760('0x3')]},'baseUrl':{'type':Sequelize[_0x5760('0x3')]},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x5760('0x8')],'defaultValue':function(){return _0x5760('0x9');}},'notificationSound':{'type':Sequelize[_0x5760('0xa')],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x5760('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x5760('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5760('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5760('0xb')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x5760('0xa')],'defaultValue':![],'comment':_0x5760('0xc'),'set':function(_0x16b9a1){if(!_0x16b9a1){this[_0x5760('0xd')](_0x5760('0xe'),null);}this[_0x5760('0xd')](_0x5760('0xf'),_0x16b9a1);}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x52d5=['TEXT','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','ENUM','twilio','sinch'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x52d5,0xc8));var _0x552d=function(_0x3e5b1a,_0x177a4b){_0x3e5b1a=_0x3e5b1a-0x0;var _0x43b680=_0x52d5[_0x3e5b1a];return _0x43b680;};'use strict';var Sequelize=require(_0x552d('0x0'));var rs=require(_0x552d('0x1'));module[_0x552d('0x2')]={'name':{'type':Sequelize[_0x552d('0x3')],'unique':_0x552d('0x4'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0x552d('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x552d('0x3')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0x552d('0x3')]},'type':{'type':Sequelize[_0x552d('0x5')](_0x552d('0x6'),_0x552d('0x7'))},'accountSid':{'type':Sequelize['STRING']},'baseUrl':{'type':Sequelize[_0x552d('0x3')]},'authToken':{'type':Sequelize[_0x552d('0x3')]},'notificationTemplate':{'type':Sequelize[_0x552d('0x8')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x552d('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x552d('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x552d('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x552d('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x552d('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x552d('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x552d('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x552d('0xa')],'comment':_0x552d('0xb')},'mandatoryDisposition':{'type':Sequelize[_0x552d('0x9')],'defaultValue':![],'comment':_0x552d('0xc'),'set':function(_0x54fb0e){if(!_0x54fb0e){this[_0x552d('0xd')](_0x552d('0xe'),null);}this[_0x552d('0xd')](_0x552d('0xf'),_0x54fb0e);}},'description':{'type':Sequelize[_0x552d('0x3')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 3a7e0a6..93702d3 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 _0xf4e1=['map','WhatsappAccount','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','mandatoryDispositionPause','include','find','create','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','removeDispositions','ids','addAnswer','getAnswers','findOne','CannedAnswer','removeAnswers','omit','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','finally','send','getApplications','notify','whatsapp','Applications','account','sinch','statuses','state','read','WhatsappMessage','timestamp','message_id','orderBy','asc','CmContact','Sequelize','no\x20available\x20attributes','updatedAt','difference','createdAt','CompanyId','ListId','mobile','twilio','replace','whatsapp:','messageId','MessageSid','from','notifications','ValidationError','from\x20is\x20mandatory','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','DESC','list','contact','WhatsappInteraction','interaction','created','autoclose','applications','unmanaged','*,*,*,*','ContactId','AttachmentId','unshift','agent','Start','startRouting','receiveMessage','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','stringify','Content-Type','text/xml','\x0a','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','CmList','List','out','dataValues','Messages','push','rimraf','request-promise','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','client','http','then','info','WhatsappAccount,\x20%s,\x20%s','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','end','undefined','count','offset','limit','Content-Range','json','apply','reject','save','update','destroy','get','WhatsappAccounts','UserProfileResource','stack','name','index','Pause'];(function(_0x51d94a,_0x4becf4){var _0x2e8cd7=function(_0x20816c){while(--_0x20816c){_0x51d94a['push'](_0x51d94a['shift']());}};_0x2e8cd7(++_0x4becf4);}(_0xf4e1,0x8d));var _0x1f4e=function(_0x41f629,_0x2fd1a6){_0x41f629=_0x41f629-0x0;var _0x4d6940=_0xf4e1[_0x41f629];return _0x4d6940;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1f4e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1f4e('0x1'));var moment=require('moment');var BPromise=require(_0x1f4e('0x2'));var Mustache=require(_0x1f4e('0x3'));var util=require(_0x1f4e('0x4'));var path=require(_0x1f4e('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1f4e('0x6'));var fs=require('fs');var fs_extra=require(_0x1f4e('0x7'));var _=require(_0x1f4e('0x8'));var squel=require(_0x1f4e('0x9'));var crypto=require(_0x1f4e('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x1f4e('0xb'));var toCsv=require(_0x1f4e('0xc'));var querystring=require(_0x1f4e('0xd'));var Papa=require(_0x1f4e('0xe'));var Redis=require(_0x1f4e('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x1f4e('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1f4e('0x11'));var logger=require('../../config/logger')(_0x1f4e('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1f4e('0x13'));var db=require(_0x1f4e('0x14'))['db'];config[_0x1f4e('0x15')]=_[_0x1f4e('0x16')](config[_0x1f4e('0x15')],{'host':_0x1f4e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./whatsappAccount.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x1f4e('0x18')][_0x1f4e('0x19')]({'port':0x232c});function respondWithRpcPromise(_0x20a42b,_0x23d487,_0x3b5cf8,_0x2a0a7f){return new BPromise(function(_0x5df607,_0x2312fe){var _0xa9f8cc=_0x2a0a7f||client;return _0xa9f8cc['request'](_0x20a42b,_0x3b5cf8)[_0x1f4e('0x1a')](function(_0x57f10a){logger[_0x1f4e('0x1b')](_0x1f4e('0x1c'),_0x23d487,'request\x20sent');logger['debug'](_0x1f4e('0x1d'),_0x23d487,_0x1f4e('0x1e'),JSON['stringify'](_0x57f10a));if(_0x57f10a[_0x1f4e('0x1f')]){if(_0x57f10a[_0x1f4e('0x1f')][_0x1f4e('0x20')]===0x1f4){logger[_0x1f4e('0x1f')](_0x1f4e('0x1c'),_0x23d487,_0x57f10a[_0x1f4e('0x1f')][_0x1f4e('0x21')]);return _0x2312fe(_0x57f10a[_0x1f4e('0x1f')][_0x1f4e('0x21')]);}logger[_0x1f4e('0x1f')](_0x1f4e('0x1c'),_0x23d487,_0x57f10a[_0x1f4e('0x1f')]['message']);return _0x5df607(_0x57f10a[_0x1f4e('0x1f')]['message']);}else{logger['info'](_0x1f4e('0x1c'),_0x23d487,_0x1f4e('0x1e'));_0x5df607(_0x57f10a[_0x1f4e('0x22')][_0x1f4e('0x21')]);}})[_0x1f4e('0x23')](function(_0x391a37){logger[_0x1f4e('0x1f')](_0x1f4e('0x1c'),_0x23d487,_0x391a37);_0x2312fe(_0x391a37);});});}function respondWithStatusCode(_0x498bc8,_0x2ca783){_0x2ca783=_0x2ca783||0xcc;return function(_0x28130b){if(_0x28130b){return _0x498bc8[_0x1f4e('0x24')](_0x2ca783);}return _0x498bc8[_0x1f4e('0x25')](_0x2ca783)[_0x1f4e('0x26')]();};}function respondWithResult(_0x124ddd,_0x3a5446){_0x3a5446=_0x3a5446||0xc8;return function(_0x1a1b1c){if(_0x1a1b1c){return _0x124ddd['status'](_0x3a5446)['json'](_0x1a1b1c);}};}function respondWithFilteredResult(_0x31134c,_0x3b9b00){return function(_0x50e05c){if(_0x50e05c){var _0x3eaf73=typeof _0x3b9b00['offset']===_0x1f4e('0x27')&&typeof _0x3b9b00['limit']==='undefined';var _0x499b04=_0x50e05c[_0x1f4e('0x28')];var _0x32d372=_0x3eaf73?0x0:_0x3b9b00[_0x1f4e('0x29')];var _0x1a8e35=_0x3eaf73?_0x50e05c[_0x1f4e('0x28')]:_0x3b9b00[_0x1f4e('0x29')]+_0x3b9b00[_0x1f4e('0x2a')];var _0x1eb8d7;if(_0x1a8e35>=_0x499b04){_0x1a8e35=_0x499b04;_0x1eb8d7=0xc8;}else{_0x1eb8d7=0xce;}_0x31134c['status'](_0x1eb8d7);return _0x31134c['set'](_0x1f4e('0x2b'),_0x32d372+'-'+_0x1a8e35+'/'+_0x499b04)[_0x1f4e('0x2c')](_0x50e05c);}return null;};}function patchUpdates(_0x2d4cac){return function(_0x183dc0){try{jsonpatch[_0x1f4e('0x2d')](_0x183dc0,_0x2d4cac,!![]);}catch(_0x348fd2){return BPromise[_0x1f4e('0x2e')](_0x348fd2);}return _0x183dc0[_0x1f4e('0x2f')]();};}function saveUpdates(_0x2f1dbb,_0x30bdff){return function(_0x3ee0f5){if(_0x3ee0f5){return _0x3ee0f5[_0x1f4e('0x30')](_0x2f1dbb)[_0x1f4e('0x1a')](function(_0xa37a4b){return _0xa37a4b;});}return null;};}function removeEntity(_0x3cd54c,_0x4d8066){return function(_0x4d0681){if(_0x4d0681){return _0x4d0681[_0x1f4e('0x31')]()[_0x1f4e('0x1a')](function(){var _0x2c084b=_0x4d0681[_0x1f4e('0x32')]({'plain':!![]});var _0x58fcb6=_0x1f4e('0x33');return db[_0x1f4e('0x34')][_0x1f4e('0x31')]({'where':{'type':_0x58fcb6,'resourceId':_0x2c084b['id']}})[_0x1f4e('0x1a')](function(){return _0x4d0681;});})[_0x1f4e('0x1a')](function(){_0x3cd54c[_0x1f4e('0x25')](0xcc)[_0x1f4e('0x26')]();});}};}function handleEntityNotFound(_0x4ed3af,_0x5bf074){return function(_0x198d6f){if(!_0x198d6f){_0x4ed3af[_0x1f4e('0x24')](0x194);}return _0x198d6f;};}function handleError(_0x5518ac,_0x4b240e){_0x4b240e=_0x4b240e||0x1f4;return function(_0x23c484){logger['error'](_0x23c484[_0x1f4e('0x35')]);if(_0x23c484[_0x1f4e('0x36')]){delete _0x23c484['name'];}_0x5518ac['status'](_0x4b240e)['send'](_0x23c484);};}exports[_0x1f4e('0x37')]=function(_0x55c2f6,_0x34b5c2){var _0x2eb0c0={'include':[{'model':db[_0x1f4e('0x38')],'as':'mandatoryDispositionPause'}]},_0x472b16={},_0x58ce30={'count':0x0,'rows':[]};var _0x2764b1=_[_0x1f4e('0x39')](db[_0x1f4e('0x3a')][_0x1f4e('0x3b')],function(_0x50d7d1){return{'name':_0x50d7d1['fieldName'],'type':_0x50d7d1[_0x1f4e('0x3c')][_0x1f4e('0x3d')]};});_0x472b16['model']=_[_0x1f4e('0x39')](_0x2764b1,_0x1f4e('0x36'));_0x472b16[_0x1f4e('0x3e')]=_[_0x1f4e('0x3f')](_0x55c2f6[_0x1f4e('0x3e')]);_0x472b16[_0x1f4e('0x40')]=_[_0x1f4e('0x41')](_0x472b16[_0x1f4e('0x42')],_0x472b16[_0x1f4e('0x3e')]);_0x2eb0c0[_0x1f4e('0x43')]=_[_0x1f4e('0x41')](_0x472b16['model'],qs[_0x1f4e('0x44')](_0x55c2f6[_0x1f4e('0x3e')]['fields']));_0x2eb0c0[_0x1f4e('0x43')]=_0x2eb0c0[_0x1f4e('0x43')][_0x1f4e('0x45')]?_0x2eb0c0['attributes']:_0x472b16[_0x1f4e('0x42')];if(!_0x55c2f6['query'][_0x1f4e('0x46')](_0x1f4e('0x47'))){_0x2eb0c0[_0x1f4e('0x2a')]=qs[_0x1f4e('0x2a')](_0x55c2f6['query'][_0x1f4e('0x2a')]);_0x2eb0c0['offset']=qs[_0x1f4e('0x29')](_0x55c2f6[_0x1f4e('0x3e')][_0x1f4e('0x29')]);}_0x2eb0c0[_0x1f4e('0x48')]=qs[_0x1f4e('0x49')](_0x55c2f6[_0x1f4e('0x3e')][_0x1f4e('0x49')]);_0x2eb0c0[_0x1f4e('0x4a')]=qs[_0x1f4e('0x40')](_[_0x1f4e('0x4b')](_0x55c2f6[_0x1f4e('0x3e')],_0x472b16[_0x1f4e('0x40')]),_0x2764b1);if(_0x55c2f6[_0x1f4e('0x3e')][_0x1f4e('0x4c')]){_0x2eb0c0[_0x1f4e('0x4a')]=_[_0x1f4e('0x4d')](_0x2eb0c0[_0x1f4e('0x4a')],{'$or':_[_0x1f4e('0x39')](_0x2764b1,function(_0x1c4910){if(_0x1c4910['type']!==_0x1f4e('0x4e')){var _0x1f4d2c={};_0x1f4d2c[_0x1c4910[_0x1f4e('0x36')]]={'$like':'%'+_0x55c2f6[_0x1f4e('0x3e')][_0x1f4e('0x4c')]+'%'};return _0x1f4d2c;}})});}_0x2eb0c0=_[_0x1f4e('0x4d')]({},_0x2eb0c0,_0x55c2f6[_0x1f4e('0x4f')]);var _0x2a6df8={'where':_0x2eb0c0['where']};return db[_0x1f4e('0x3a')][_0x1f4e('0x28')](_0x2a6df8)['then'](function(_0x2b8b5e){_0x58ce30[_0x1f4e('0x28')]=_0x2b8b5e;if(_0x55c2f6[_0x1f4e('0x3e')][_0x1f4e('0x50')]){_0x2eb0c0['include']=[{'all':!![]}];}return db[_0x1f4e('0x3a')][_0x1f4e('0x51')](_0x2eb0c0);})[_0x1f4e('0x1a')](function(_0x1a1bb9){_0x58ce30[_0x1f4e('0x52')]=_0x1a1bb9;return _0x58ce30;})[_0x1f4e('0x1a')](respondWithFilteredResult(_0x34b5c2,_0x2eb0c0))['catch'](handleError(_0x34b5c2,null));};exports[_0x1f4e('0x53')]=function(_0x50da4d,_0x32157f){var _0x3ee26b={'raw':![],'where':{'id':_0x50da4d[_0x1f4e('0x54')]['id']},'include':[{'model':db[_0x1f4e('0x38')],'as':_0x1f4e('0x55')}]},_0x5eb66d={};_0x5eb66d[_0x1f4e('0x42')]=_[_0x1f4e('0x3f')](db[_0x1f4e('0x3a')][_0x1f4e('0x3b')]);_0x5eb66d[_0x1f4e('0x3e')]=_[_0x1f4e('0x3f')](_0x50da4d[_0x1f4e('0x3e')]);_0x5eb66d[_0x1f4e('0x40')]=_['intersection'](_0x5eb66d[_0x1f4e('0x42')],_0x5eb66d[_0x1f4e('0x3e')]);_0x3ee26b['attributes']=_[_0x1f4e('0x41')](_0x5eb66d[_0x1f4e('0x42')],qs[_0x1f4e('0x44')](_0x50da4d[_0x1f4e('0x3e')][_0x1f4e('0x44')]));_0x3ee26b[_0x1f4e('0x43')]=_0x3ee26b[_0x1f4e('0x43')][_0x1f4e('0x45')]?_0x3ee26b[_0x1f4e('0x43')]:_0x5eb66d[_0x1f4e('0x42')];if(_0x50da4d[_0x1f4e('0x3e')][_0x1f4e('0x50')]){_0x3ee26b[_0x1f4e('0x56')]=[{'all':!![]}];}_0x3ee26b=_[_0x1f4e('0x4d')]({},_0x3ee26b,_0x50da4d[_0x1f4e('0x4f')]);return db[_0x1f4e('0x3a')][_0x1f4e('0x57')](_0x3ee26b)[_0x1f4e('0x1a')](handleEntityNotFound(_0x32157f,null))[_0x1f4e('0x1a')](respondWithResult(_0x32157f,null))[_0x1f4e('0x23')](handleError(_0x32157f,null));};exports[_0x1f4e('0x58')]=function(_0x19ee2f,_0x1b1baf){return db['WhatsappAccount']['create'](_0x19ee2f['body'],{})[_0x1f4e('0x1a')](function(_0x41977f){var _0x447392=_0x19ee2f[_0x1f4e('0x59')][_0x1f4e('0x32')]({'plain':!![]});if(!_0x447392)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x447392[_0x1f4e('0x5a')]===_0x1f4e('0x59')){var _0x1bbeee=_0x41977f[_0x1f4e('0x32')]({'plain':!![]});var _0x54275f=_0x1f4e('0x33');return db[_0x1f4e('0x5b')][_0x1f4e('0x57')]({'where':{'name':_0x54275f,'userProfileId':_0x447392[_0x1f4e('0x5c')]},'raw':!![]})[_0x1f4e('0x1a')](function(_0x282fa5){if(_0x282fa5&&_0x282fa5[_0x1f4e('0x5d')]===0x0){return db[_0x1f4e('0x34')][_0x1f4e('0x58')]({'name':_0x1bbeee[_0x1f4e('0x36')],'resourceId':_0x1bbeee['id'],'type':_0x282fa5[_0x1f4e('0x36')],'sectionId':_0x282fa5['id']},{})['then'](function(){return _0x41977f;});}else{return _0x41977f;}})['catch'](function(_0x1789c7){logger[_0x1f4e('0x1f')](_0x1f4e('0x5e'),_0x1789c7);throw _0x1789c7;});}return _0x41977f;})[_0x1f4e('0x1a')](respondWithResult(_0x1b1baf,0xc9))['catch'](handleError(_0x1b1baf,null));};exports['update']=function(_0x1b2873,_0x478d4d){if(_0x1b2873[_0x1f4e('0x5f')]['id']){delete _0x1b2873['body']['id'];}return db[_0x1f4e('0x3a')][_0x1f4e('0x57')]({'where':{'id':_0x1b2873['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x1f4e('0x1a')](handleEntityNotFound(_0x478d4d,null))[_0x1f4e('0x1a')](saveUpdates(_0x1b2873[_0x1f4e('0x5f')],null))[_0x1f4e('0x1a')](respondWithResult(_0x478d4d,null))[_0x1f4e('0x23')](handleError(_0x478d4d,null));};exports[_0x1f4e('0x31')]=function(_0x18b24f,_0x4ab70d){return db['WhatsappAccount'][_0x1f4e('0x57')]({'where':{'id':_0x18b24f['params']['id']}})['then'](handleEntityNotFound(_0x4ab70d,null))['then'](removeEntity(_0x4ab70d,null))[_0x1f4e('0x23')](handleError(_0x4ab70d,null));};exports['describe']=function(_0x2a71e5,_0x5f3af4){return db[_0x1f4e('0x3a')][_0x1f4e('0x60')]()[_0x1f4e('0x1a')](respondWithResult(_0x5f3af4,null))['catch'](handleError(_0x5f3af4,null));};exports[_0x1f4e('0x61')]=function(_0x5d9b8e,_0x5a55e6,_0xa728c9){if(_0x5d9b8e[_0x1f4e('0x5f')]['id']){delete _0x5d9b8e[_0x1f4e('0x5f')]['id'];}return db[_0x1f4e('0x3a')][_0x1f4e('0x57')]({'where':{'id':_0x5d9b8e[_0x1f4e('0x54')]['id']}})['then'](handleEntityNotFound(_0x5a55e6,null))[_0x1f4e('0x1a')](function(_0x32db79){if(_0x32db79){_0x5d9b8e[_0x1f4e('0x5f')][_0x1f4e('0x62')]=_0x32db79['id'];return db[_0x1f4e('0x63')][_0x1f4e('0x58')](_0x5d9b8e[_0x1f4e('0x5f')]);}})['then'](respondWithResult(_0x5a55e6,null))['catch'](handleError(_0x5a55e6,null));};exports[_0x1f4e('0x64')]=function(_0x5b4977,_0x4fe513,_0x23e17c){var _0x45142a={'raw':![],'where':{}};var _0x5661c9={};var _0x35545b={'count':0x0,'rows':[]};return db[_0x1f4e('0x3a')]['findOne']({'where':{'id':_0x5b4977[_0x1f4e('0x54')]['id']}})[_0x1f4e('0x1a')](handleEntityNotFound(_0x4fe513,null))[_0x1f4e('0x1a')](function(_0x2e1960){if(_0x2e1960){_0x5661c9[_0x1f4e('0x42')]=_[_0x1f4e('0x3f')](db[_0x1f4e('0x63')]['rawAttributes']);_0x5661c9[_0x1f4e('0x3e')]=_[_0x1f4e('0x3f')](_0x5b4977[_0x1f4e('0x3e')]);_0x5661c9[_0x1f4e('0x40')]=_[_0x1f4e('0x41')](_0x5661c9[_0x1f4e('0x42')],_0x5661c9[_0x1f4e('0x3e')]);_0x45142a[_0x1f4e('0x43')]=_[_0x1f4e('0x41')](_0x5661c9['model'],qs[_0x1f4e('0x44')](_0x5b4977['query'][_0x1f4e('0x44')]));_0x45142a[_0x1f4e('0x43')]=_0x45142a['attributes'][_0x1f4e('0x45')]?_0x45142a[_0x1f4e('0x43')]:_0x5661c9[_0x1f4e('0x42')];if(!_0x5b4977[_0x1f4e('0x3e')]['hasOwnProperty']('nolimit')){_0x45142a[_0x1f4e('0x2a')]=qs[_0x1f4e('0x2a')](_0x5b4977[_0x1f4e('0x3e')][_0x1f4e('0x2a')]);_0x45142a[_0x1f4e('0x29')]=qs['offset'](_0x5b4977['query']['offset']);}_0x45142a['order']=qs[_0x1f4e('0x49')](_0x5b4977[_0x1f4e('0x3e')]['sort']);_0x45142a[_0x1f4e('0x4a')]=qs[_0x1f4e('0x40')](_[_0x1f4e('0x4b')](_0x5b4977[_0x1f4e('0x3e')],_0x5661c9[_0x1f4e('0x40')]));_0x45142a['where'][_0x1f4e('0x62')]=_0x2e1960['id'];if(_0x5b4977[_0x1f4e('0x3e')][_0x1f4e('0x4c')]){_0x45142a['where']=_[_0x1f4e('0x4d')](_0x45142a[_0x1f4e('0x4a')],{'$or':_[_0x1f4e('0x39')](_0x45142a[_0x1f4e('0x43')],function(_0x4a4ac0){var _0x413af5={};_0x413af5[_0x4a4ac0]={'$like':'%'+_0x5b4977[_0x1f4e('0x3e')][_0x1f4e('0x4c')]+'%'};return _0x413af5;})});}_0x45142a=_[_0x1f4e('0x4d')]({},_0x45142a,_0x5b4977[_0x1f4e('0x4f')]);return db['Disposition']['count']({'where':_0x45142a[_0x1f4e('0x4a')]})['then'](function(_0xf84a74){_0x35545b[_0x1f4e('0x28')]=_0xf84a74;if(_0x5b4977[_0x1f4e('0x3e')][_0x1f4e('0x50')]){_0x45142a['include']=[{'all':!![]}];}return db[_0x1f4e('0x63')][_0x1f4e('0x51')](_0x45142a);})['then'](function(_0x4d1282){_0x35545b[_0x1f4e('0x52')]=_0x4d1282;return _0x35545b;});}})[_0x1f4e('0x1a')](respondWithFilteredResult(_0x4fe513,_0x45142a))[_0x1f4e('0x23')](handleError(_0x4fe513,null));};exports[_0x1f4e('0x65')]=function(_0x5a65b0,_0x51aeb0,_0xeffea8){return db[_0x1f4e('0x3a')][_0x1f4e('0x57')]({'where':{'id':_0x5a65b0[_0x1f4e('0x54')]['id']}})['then'](handleEntityNotFound(_0x51aeb0,null))[_0x1f4e('0x1a')](function(_0x2d2e8e){if(_0x2d2e8e){return _0x2d2e8e['removeDispositions'](_0x5a65b0[_0x1f4e('0x3e')][_0x1f4e('0x66')]);}})[_0x1f4e('0x1a')](respondWithStatusCode(_0x51aeb0,null))[_0x1f4e('0x23')](handleError(_0x51aeb0,null));};exports[_0x1f4e('0x67')]=function(_0x7149e7,_0x1e9e02,_0x2c8301){if(_0x7149e7[_0x1f4e('0x5f')]['id']){delete _0x7149e7[_0x1f4e('0x5f')]['id'];}return db['WhatsappAccount'][_0x1f4e('0x57')]({'where':{'id':_0x7149e7[_0x1f4e('0x54')]['id']}})[_0x1f4e('0x1a')](handleEntityNotFound(_0x1e9e02,null))[_0x1f4e('0x1a')](function(_0x46bd84){if(_0x46bd84){_0x7149e7[_0x1f4e('0x5f')][_0x1f4e('0x62')]=_0x46bd84['id'];return db['CannedAnswer']['create'](_0x7149e7[_0x1f4e('0x5f')]);}})[_0x1f4e('0x1a')](respondWithResult(_0x1e9e02,null))['catch'](handleError(_0x1e9e02,null));};exports[_0x1f4e('0x68')]=function(_0x170704,_0x534635,_0x9eaa0d){var _0x564217={'raw':![],'where':{}};var _0xe7752={};var _0x3cdbc4={'count':0x0,'rows':[]};return db[_0x1f4e('0x3a')][_0x1f4e('0x69')]({'where':{'id':_0x170704[_0x1f4e('0x54')]['id']}})[_0x1f4e('0x1a')](handleEntityNotFound(_0x534635,null))[_0x1f4e('0x1a')](function(_0x8d4b97){if(_0x8d4b97){_0xe7752[_0x1f4e('0x42')]=_[_0x1f4e('0x3f')](db[_0x1f4e('0x6a')][_0x1f4e('0x3b')]);_0xe7752['query']=_[_0x1f4e('0x3f')](_0x170704[_0x1f4e('0x3e')]);_0xe7752[_0x1f4e('0x40')]=_['intersection'](_0xe7752['model'],_0xe7752[_0x1f4e('0x3e')]);_0x564217[_0x1f4e('0x43')]=_['intersection'](_0xe7752[_0x1f4e('0x42')],qs[_0x1f4e('0x44')](_0x170704[_0x1f4e('0x3e')][_0x1f4e('0x44')]));_0x564217['attributes']=_0x564217[_0x1f4e('0x43')]['length']?_0x564217[_0x1f4e('0x43')]:_0xe7752[_0x1f4e('0x42')];if(!_0x170704[_0x1f4e('0x3e')][_0x1f4e('0x46')](_0x1f4e('0x47'))){_0x564217[_0x1f4e('0x2a')]=qs[_0x1f4e('0x2a')](_0x170704[_0x1f4e('0x3e')][_0x1f4e('0x2a')]);_0x564217[_0x1f4e('0x29')]=qs[_0x1f4e('0x29')](_0x170704[_0x1f4e('0x3e')][_0x1f4e('0x29')]);}_0x564217['order']=qs['sort'](_0x170704[_0x1f4e('0x3e')][_0x1f4e('0x49')]);_0x564217[_0x1f4e('0x4a')]=qs[_0x1f4e('0x40')](_['pick'](_0x170704['query'],_0xe7752['filters']));_0x564217[_0x1f4e('0x4a')][_0x1f4e('0x62')]=_0x8d4b97['id'];if(_0x170704['query']['filter']){_0x564217['where']=_[_0x1f4e('0x4d')](_0x564217[_0x1f4e('0x4a')],{'$or':_['map'](_0x564217[_0x1f4e('0x43')],function(_0x278676){var _0xbe257={};_0xbe257[_0x278676]={'$like':'%'+_0x170704[_0x1f4e('0x3e')][_0x1f4e('0x4c')]+'%'};return _0xbe257;})});}_0x564217=_['merge']({},_0x564217,_0x170704['options']);return db[_0x1f4e('0x6a')]['count']({'where':_0x564217['where']})['then'](function(_0x5e6810){_0x3cdbc4[_0x1f4e('0x28')]=_0x5e6810;if(_0x170704[_0x1f4e('0x3e')]['includeAll']){_0x564217[_0x1f4e('0x56')]=[{'all':!![]}];}return db['CannedAnswer'][_0x1f4e('0x51')](_0x564217);})[_0x1f4e('0x1a')](function(_0x1d3c56){_0x3cdbc4[_0x1f4e('0x52')]=_0x1d3c56;return _0x3cdbc4;});}})[_0x1f4e('0x1a')](respondWithFilteredResult(_0x534635,_0x564217))['catch'](handleError(_0x534635,null));};exports['removeAnswers']=function(_0x54ce7d,_0x1651d0,_0x1a6c69){return db[_0x1f4e('0x3a')][_0x1f4e('0x57')]({'where':{'id':_0x54ce7d[_0x1f4e('0x54')]['id']}})['then'](handleEntityNotFound(_0x1651d0,null))['then'](function(_0x56dae5){if(_0x56dae5){return _0x56dae5[_0x1f4e('0x6b')](_0x54ce7d[_0x1f4e('0x3e')][_0x1f4e('0x66')]);}})[_0x1f4e('0x1a')](respondWithStatusCode(_0x1651d0,null))[_0x1f4e('0x23')](handleError(_0x1651d0,null));};exports['addAgents']=function(_0x40bdfe,_0x200b41,_0xfe14ca){return db[_0x1f4e('0x3a')][_0x1f4e('0x57')]({'where':{'id':_0x40bdfe[_0x1f4e('0x54')]['id']}})[_0x1f4e('0x1a')](handleEntityNotFound(_0x200b41,null))[_0x1f4e('0x1a')](function(_0xf27d89){if(_0xf27d89){return _0xf27d89['addAgents'](_0x40bdfe['body'][_0x1f4e('0x66')],_[_0x1f4e('0x6c')](_0x40bdfe['body'],['ids','id'])||{})[_0x1f4e('0x6d')](function(_0x1bf2e8){for(var _0x265c9e=0x0;_0x265c9e<_0x40bdfe[_0x1f4e('0x5f')]['ids'][_0x1f4e('0x45')];_0x265c9e+=0x1){socket[_0x1f4e('0x6e')](_0x1f4e('0x6f'),{'UserId':Number(_0x40bdfe[_0x1f4e('0x5f')][_0x1f4e('0x66')][_0x265c9e]),'WhatsappAccountId':Number(_0x40bdfe[_0x1f4e('0x54')]['id'])});}return _0x1bf2e8;});}})[_0x1f4e('0x1a')](respondWithResult(_0x200b41,null))[_0x1f4e('0x23')](handleError(_0x200b41,null));};exports['removeAgents']=function(_0x208b5c,_0x415d7e,_0x2d959c){return db[_0x1f4e('0x3a')][_0x1f4e('0x57')]({'where':{'id':_0x208b5c[_0x1f4e('0x54')]['id']}})[_0x1f4e('0x1a')](handleEntityNotFound(_0x415d7e,null))[_0x1f4e('0x1a')](function(_0x49c63d){if(_0x49c63d){return _0x49c63d[_0x1f4e('0x70')](_0x208b5c['query'][_0x1f4e('0x66')])[_0x1f4e('0x1a')](function(){if(_[_0x1f4e('0x71')](_0x208b5c[_0x1f4e('0x3e')][_0x1f4e('0x66')])){for(var _0x36c79d=0x0;_0x36c79d<_0x208b5c[_0x1f4e('0x3e')][_0x1f4e('0x66')][_0x1f4e('0x45')];_0x36c79d+=0x1){socket['emit'](_0x1f4e('0x72'),{'UserId':Number(_0x208b5c[_0x1f4e('0x3e')]['ids'][_0x36c79d]),'WhatsappAccountId':Number(_0x208b5c[_0x1f4e('0x54')]['id'])});}}else{socket[_0x1f4e('0x6e')]('userWhatsappAccount:remove',{'UserId':Number(_0x208b5c['query'][_0x1f4e('0x66')]),'WhatsappAccountId':Number(_0x208b5c[_0x1f4e('0x54')]['id'])});}});}})['then'](respondWithStatusCode(_0x415d7e,null))['catch'](handleError(_0x415d7e,null));};exports[_0x1f4e('0x73')]=function(_0x415797,_0xb63d35,_0x30c4c5){var _0x4c578b={};var _0x22b327={};var _0x48afca;var _0x198210;return db[_0x1f4e('0x3a')][_0x1f4e('0x69')]({'where':{'id':_0x415797[_0x1f4e('0x54')]['id']}})[_0x1f4e('0x1a')](handleEntityNotFound(_0xb63d35,null))['then'](function(_0xb6052a){if(_0xb6052a){_0x48afca=_0xb6052a;_0x22b327[_0x1f4e('0x42')]=_[_0x1f4e('0x3f')](db[_0x1f4e('0x74')][_0x1f4e('0x3b')]);_0x22b327[_0x1f4e('0x3e')]=_[_0x1f4e('0x3f')](_0x415797['query']);_0x22b327['filters']=_[_0x1f4e('0x41')](_0x22b327[_0x1f4e('0x42')],_0x22b327['query']);_0x4c578b[_0x1f4e('0x43')]=_[_0x1f4e('0x41')](_0x22b327[_0x1f4e('0x42')],qs['fields'](_0x415797[_0x1f4e('0x3e')]['fields']));_0x4c578b['attributes']=_0x4c578b[_0x1f4e('0x43')][_0x1f4e('0x45')]?_0x4c578b[_0x1f4e('0x43')]:_0x22b327[_0x1f4e('0x42')];_0x4c578b[_0x1f4e('0x48')]=qs[_0x1f4e('0x49')](_0x415797['query']['sort']);_0x4c578b[_0x1f4e('0x4a')]=qs[_0x1f4e('0x40')](_[_0x1f4e('0x4b')](_0x415797['query'],_0x22b327['filters']));if(_0x415797[_0x1f4e('0x3e')][_0x1f4e('0x4c')]){_0x4c578b[_0x1f4e('0x4a')]=_[_0x1f4e('0x4d')](_0x4c578b[_0x1f4e('0x4a')],{'$or':_[_0x1f4e('0x39')](_0x4c578b[_0x1f4e('0x43')],function(_0x4424c4){var _0x1ce283={};_0x1ce283[_0x4424c4]={'$like':'%'+_0x415797[_0x1f4e('0x3e')][_0x1f4e('0x4c')]+'%'};return _0x1ce283;})});}_0x4c578b=_['merge']({},_0x4c578b,_0x415797['options']);return _0x48afca[_0x1f4e('0x73')](_0x4c578b);}})[_0x1f4e('0x1a')](function(_0x3ae639){if(_0x3ae639){_0x198210=_0x3ae639[_0x1f4e('0x45')];if(!_0x415797[_0x1f4e('0x3e')][_0x1f4e('0x46')](_0x1f4e('0x47'))){_0x4c578b['limit']=qs[_0x1f4e('0x2a')](_0x415797[_0x1f4e('0x3e')][_0x1f4e('0x2a')]);_0x4c578b[_0x1f4e('0x29')]=qs[_0x1f4e('0x29')](_0x415797['query'][_0x1f4e('0x29')]);}return _0x48afca[_0x1f4e('0x73')](_0x4c578b);}})[_0x1f4e('0x1a')](function(_0x480003){if(_0x480003){return _0x480003?{'count':_0x198210,'rows':_0x480003}:null;}})[_0x1f4e('0x1a')](respondWithResult(_0xb63d35,null))[_0x1f4e('0x23')](handleError(_0xb63d35,null));};exports['addApplications']=function(_0x2a15d4,_0x2714cb){var _0x173ae9=_0x2a15d4[_0x1f4e('0x54')]['id'];var _0x1225fa=_0x2a15d4[_0x1f4e('0x5f')];var _0x4d9b30=0xc8;var _0x3c40df=null;return db[_0x1f4e('0x75')][_0x1f4e('0x76')]({'isolationLevel':db['sequelize'][_0x1f4e('0x77')][_0x1f4e('0x78')][_0x1f4e('0x79')]},function(_0xedda8c){return db[_0x1f4e('0x3a')][_0x1f4e('0x69')]({'where':{'id':_0x173ae9},'transaction':_0xedda8c})[_0x1f4e('0x1a')](function(_0x495bf8){if(_0x495bf8){return db[_0x1f4e('0x7a')][_0x1f4e('0x31')]({'where':{'WhatsappAccountId':_0x173ae9},'transaction':_0xedda8c})['then'](function(){var _0x1a2a37=_[_0x1f4e('0x39')](_0x1225fa,function(_0xf3eb6c){_0xf3eb6c['WhatsappAccountId']=_0x173ae9;return _0xf3eb6c;});return db['WhatsappApplication'][_0x1f4e('0x7b')](_0x1a2a37,{'transaction':_0xedda8c});});}else{_0x4d9b30=0x194;_0x3c40df=[];}});})['then'](function(){if(_0x4d9b30!==0x194){return db['WhatsappApplication'][_0x1f4e('0x7c')]({'where':{'WhatsappAccountId':_0x173ae9},'order':_0x1f4e('0x7d')})['then'](function(_0x4c57be){_0x3c40df=_0x4c57be;});}})[_0x1f4e('0x23')](function(_0x2ca119){_0x4d9b30=0x1f4;logger['error'](_0x2ca119[_0x1f4e('0x35')]);if(_0x2ca119[_0x1f4e('0x36')]){delete _0x2ca119[_0x1f4e('0x36')];}_0x3c40df=_0x2ca119;})[_0x1f4e('0x7e')](function(){if(_0x3c40df===null){_0x2714cb['sendStatus'](_0x4d9b30);}else{if(_0x4d9b30===0x1f4){_0x2714cb['status'](_0x4d9b30)[_0x1f4e('0x7f')](_0x3c40df);}else{_0x2714cb[_0x1f4e('0x25')](_0x4d9b30)['json'](_0x3c40df);}}});};exports[_0x1f4e('0x80')]=function(_0x21c562,_0x10eee7,_0x1bea08){var _0x14f7d8={};var _0x3d0437={};var _0x3c9de2;var _0x55022e;return db[_0x1f4e('0x3a')]['findOne']({'where':{'id':_0x21c562[_0x1f4e('0x54')]['id']}})[_0x1f4e('0x1a')](handleEntityNotFound(_0x10eee7,null))[_0x1f4e('0x1a')](function(_0x7cb0c6){if(_0x7cb0c6){_0x3c9de2=_0x7cb0c6;_0x3d0437[_0x1f4e('0x42')]=_[_0x1f4e('0x3f')](db[_0x1f4e('0x7a')]['rawAttributes']);_0x3d0437[_0x1f4e('0x3e')]=_['keys'](_0x21c562[_0x1f4e('0x3e')]);_0x3d0437[_0x1f4e('0x40')]=_['intersection'](_0x3d0437[_0x1f4e('0x42')],_0x3d0437['query']);_0x14f7d8[_0x1f4e('0x43')]=_['intersection'](_0x3d0437[_0x1f4e('0x42')],qs[_0x1f4e('0x44')](_0x21c562[_0x1f4e('0x3e')][_0x1f4e('0x44')]));_0x14f7d8[_0x1f4e('0x43')]=_0x14f7d8['attributes']['length']?_0x14f7d8[_0x1f4e('0x43')]:_0x3d0437[_0x1f4e('0x42')];_0x14f7d8['order']=qs[_0x1f4e('0x49')](_0x21c562[_0x1f4e('0x3e')][_0x1f4e('0x49')]);_0x14f7d8[_0x1f4e('0x4a')]=qs[_0x1f4e('0x40')](_[_0x1f4e('0x4b')](_0x21c562[_0x1f4e('0x3e')],_0x3d0437[_0x1f4e('0x40')]));if(_0x21c562[_0x1f4e('0x3e')][_0x1f4e('0x4c')]){_0x14f7d8[_0x1f4e('0x4a')]=_[_0x1f4e('0x4d')](_0x14f7d8[_0x1f4e('0x4a')],{'$or':_[_0x1f4e('0x39')](_0x14f7d8[_0x1f4e('0x43')],function(_0x198fb0){var _0x28b629={};_0x28b629[_0x198fb0]={'$like':'%'+_0x21c562[_0x1f4e('0x3e')][_0x1f4e('0x4c')]+'%'};return _0x28b629;})});}_0x14f7d8=_[_0x1f4e('0x4d')]({},_0x14f7d8,_0x21c562['options']);return _0x3c9de2[_0x1f4e('0x80')](_0x14f7d8);}})[_0x1f4e('0x1a')](function(_0x4811df){if(_0x4811df){_0x55022e=_0x4811df[_0x1f4e('0x45')];if(!_0x21c562[_0x1f4e('0x3e')][_0x1f4e('0x46')](_0x1f4e('0x47'))){_0x14f7d8[_0x1f4e('0x2a')]=qs[_0x1f4e('0x2a')](_0x21c562[_0x1f4e('0x3e')][_0x1f4e('0x2a')]);_0x14f7d8[_0x1f4e('0x29')]=qs['offset'](_0x21c562[_0x1f4e('0x3e')][_0x1f4e('0x29')]);}return _0x3c9de2[_0x1f4e('0x80')](_0x14f7d8);}})['then'](function(_0x28e64d){if(_0x28e64d){return _0x28e64d?{'count':_0x55022e,'rows':_0x28e64d}:null;}})[_0x1f4e('0x1a')](respondWithResult(_0x10eee7,null))['catch'](handleError(_0x10eee7,null));};exports[_0x1f4e('0x81')]=function(_0x107230,_0x25a26f,_0x2eac55){var _0x1a449a={'channel':_0x1f4e('0x82')};var _0x33a822=[];var _0x544453=[];var _0x4ac818={};return db[_0x1f4e('0x3a')][_0x1f4e('0x57')]({'where':{'id':_0x107230[_0x1f4e('0x54')]['id']},'include':[{'model':db['WhatsappApplication'],'as':_0x1f4e('0x83')}]})[_0x1f4e('0x1a')](handleEntityNotFound(_0x25a26f,null))[_0x1f4e('0x1a')](function(_0x28ea10){_0x1a449a['account']=_0x28ea10;if(_0x1a449a[_0x1f4e('0x84')]&&_0x1a449a[_0x1f4e('0x84')][_0x1f4e('0x3c')]===_0x1f4e('0x85')&&_0x107230[_0x1f4e('0x5f')][_0x1f4e('0x86')]){if(_0x107230[_0x1f4e('0x5f')]['statuses']['length']===0x0)return;if(_0x107230['body']['statuses'][0x0][_0x1f4e('0x87')]!==_0x1f4e('0x88'))return;return db[_0x1f4e('0x89')][_0x1f4e('0x30')]({'read':!![],'readAt':_0x107230['body'][_0x1f4e('0x86')][0x0][_0x1f4e('0x8a')]},{'where':{'messageId':_0x107230[_0x1f4e('0x5f')][_0x1f4e('0x86')][0x0][_0x1f4e('0x8b')]},'individualHooks':!![]})[_0x1f4e('0x1a')](function(_0xcff0eb){return _0x25a26f[_0x1f4e('0x25')](0xc8)[_0x1f4e('0x2c')](_0xcff0eb);});}_0x1a449a['applications']=_[_0x1f4e('0x8c')](_0x28ea10[_0x1f4e('0x83')],[_0x1f4e('0x7d')],[_0x1f4e('0x8d')]);if(_0x1a449a['account'][_0x1f4e('0x83')]){delete _0x1a449a['account'][_0x1f4e('0x83')];}return db[_0x1f4e('0x8e')][_0x1f4e('0x60')]()[_0x1f4e('0x1a')](function(_0x411ebc){if(!_0x411ebc){throw new db[(_0x1f4e('0x8f'))]['ValidationError'](_0x1f4e('0x90'));}_0x33a822=_['difference'](_[_0x1f4e('0x3f')](_0x411ebc),['createdAt',_0x1f4e('0x91')]);_0x544453=_[_0x1f4e('0x92')](_['keys'](_0x411ebc),[_0x1f4e('0x93'),_0x1f4e('0x91'),_0x1f4e('0x94'),_0x1f4e('0x95')]);_0x1a449a['body']={'mapKey':_0x1f4e('0x96')};if(_0x1a449a['account']&&_0x1a449a[_0x1f4e('0x84')][_0x1f4e('0x3c')]===_0x1f4e('0x97')){_0x1a449a[_0x1f4e('0x5f')]['from']=_0x107230['body']['From'][_0x1f4e('0x98')](_0x1f4e('0x99'),'');_0x1a449a[_0x1f4e('0x5f')][_0x1f4e('0x5f')]=_0x107230[_0x1f4e('0x5f')]['Body'];_0x1a449a[_0x1f4e('0x5f')][_0x1f4e('0x9a')]=_0x107230[_0x1f4e('0x5f')][_0x1f4e('0x9b')];}if(_0x1a449a[_0x1f4e('0x84')]&&_0x1a449a['account'][_0x1f4e('0x3c')]===_0x1f4e('0x85')){_0x1a449a['body'][_0x1f4e('0x9c')]=_0x107230[_0x1f4e('0x5f')][_0x1f4e('0x9d')][0x0]['from'];_0x1a449a[_0x1f4e('0x5f')]['body']=_0x107230[_0x1f4e('0x5f')]['notifications'][0x0]['message'][_0x1f4e('0x5f')];_0x1a449a[_0x1f4e('0x5f')][_0x1f4e('0x9a')]=_0x107230[_0x1f4e('0x5f')]['notifications'][0x0][_0x1f4e('0x8b')];}if(_0x1a449a[_0x1f4e('0x5f')]['id']){delete _0x1a449a[_0x1f4e('0x5f')]['id'];}if(_['isNil'](_0x1a449a[_0x1f4e('0x5f')][_0x1f4e('0x9c')])){throw new db['Sequelize'][(_0x1f4e('0x9e'))](_0x1f4e('0x9f'));}if(_[_0x1f4e('0xa0')](_0x1a449a[_0x1f4e('0x5f')][_0x1f4e('0x5f')])||_0x1a449a[_0x1f4e('0x5f')]['body']===''){throw new db[(_0x1f4e('0x8f'))][(_0x1f4e('0x9e'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x1a449a[_0x1f4e('0x5f')][_0x1f4e('0xa1')])){throw new db[(_0x1f4e('0x8f'))][(_0x1f4e('0x9e'))](_0x1f4e('0xa2')+_0x544453);}if(!_[_0x1f4e('0xa3')](_0x544453,_0x1a449a[_0x1f4e('0x5f')][_0x1f4e('0xa1')])){throw new db[(_0x1f4e('0x8f'))]['ValidationError'](_0x1f4e('0xa4')+_0x544453);}_0x4ac818[_0x1a449a[_0x1f4e('0x5f')][_0x1f4e('0xa1')]]=_0x1a449a[_0x1f4e('0x5f')][_0x1f4e('0x9c')];return db['CmList'][_0x1f4e('0x57')]({'where':{'id':_0x1a449a[_0x1f4e('0x84')][_0x1f4e('0x95')]},'include':[{'model':db[_0x1f4e('0x8e')],'as':_0x1f4e('0xa5'),'where':_0x4ac818,'limit':0x1,'order':[['updatedAt',_0x1f4e('0xa6')]]}]});})[_0x1f4e('0x1a')](handleEntityNotFound(_0x25a26f,null))[_0x1f4e('0x1a')](function(_0x2185a3){if(_0x2185a3){_0x1a449a[_0x1f4e('0xa7')]=_['omit'](_0x2185a3,[_0x1f4e('0xa5')]);if(_0x2185a3[_0x1f4e('0xa5')][_0x1f4e('0x45')]){return _0x2185a3['Contacts'][0x0];}var _0x57a35e=_[_0x1f4e('0x16')](_0x1a449a[_0x1f4e('0x5f')],{'firstName':_0x1a449a['body'][_0x1f4e('0x9c')],'ListId':_0x2185a3['id']});_0x57a35e[_0x1a449a[_0x1f4e('0x5f')][_0x1f4e('0xa1')]]=_0x1a449a[_0x1f4e('0x5f')][_0x1f4e('0x9c')];return db['CmContact'][_0x1f4e('0x58')](_0x57a35e,{'fields':_0x33a822,'raw':!![]});}})[_0x1f4e('0x1a')](handleEntityNotFound(_0x25a26f,null))[_0x1f4e('0x1a')](function(_0x52148a){if(_0x52148a){_0x1a449a[_0x1f4e('0xa8')]=_0x52148a;var _0x1e35d6={'ContactId':_0x52148a['id'],'phone':_0x1a449a[_0x1f4e('0x5f')][_0x1f4e('0x9c')],'WhatsappAccountId':_0x107230[_0x1f4e('0x54')]['id']};var _0x5c1057={'ContactId':_0x52148a['id'],'WhatsappAccountId':_0x107230[_0x1f4e('0x54')]['id'],'closed':![]};return db[_0x1f4e('0xa9')][_0x1f4e('0x57')]({'where':_0x5c1057})[_0x1f4e('0x1a')](function(_0x17cb56){if(_0x17cb56){return[_0x17cb56,![]];}return db[_0x1f4e('0xa9')][_0x1f4e('0x58')](_0x1e35d6)[_0x1f4e('0x1a')](function(_0x2dc63b){return[_0x2dc63b,!![]];});});}})[_0x1f4e('0x6d')](function(_0x9608,_0x3e401a){_0x1a449a[_0x1f4e('0xaa')]=_0x9608[_0x1f4e('0x32')]({'plain':!![]});_0x1a449a[_0x1f4e('0xaa')][_0x1f4e('0xab')]=![];if(_0x3e401a){if(_0x1a449a[_0x1f4e('0x84')][_0x1f4e('0xac')]){_0x1a449a[_0x1f4e('0xad')]['push']({'id':0x0,'priority':_0x1a449a['applications'][_0x1f4e('0x45')]+0x1,'app':'close','appdata':_0x1f4e('0xae'),'interval':_0x1f4e('0xaf')});}_0x1a449a[_0x1f4e('0xaa')]['created']=!![];}return db['WhatsappMessage'][_0x1f4e('0x58')]({'phone':_0x1a449a[_0x1f4e('0x5f')]['from'],'messageId':_0x1a449a[_0x1f4e('0x5f')]['messageId'],'body':_0x1a449a[_0x1f4e('0x5f')][_0x1f4e('0x5f')],'WhatsappAccountId':_0x107230[_0x1f4e('0x54')]['id'],'WhatsappInteractionId':_0x9608['id'],'direction':'in','ContactId':_0x9608[_0x1f4e('0xb0')],'AttachmentId':_0x1a449a[_0x1f4e('0x5f')][_0x1f4e('0xb1')]});})[_0x1f4e('0x1a')](function(_0x496930){_0x1a449a[_0x1f4e('0x21')]=_0x496930;if(_0x1a449a[_0x1f4e('0xaa')]['UserId']){return db[_0x1f4e('0x74')][_0x1f4e('0x57')]({'attributes':['id','name'],'where':{'id':_0x1a449a[_0x1f4e('0xaa')]['UserId']}})[_0x1f4e('0x1a')](function(_0x4a2129){if(_0x4a2129){_0x1a449a[_0x1f4e('0xad')][_0x1f4e('0xb2')]({'id':0x0,'priority':0x0,'app':_0x1f4e('0xb3'),'appdata':_0x4a2129[_0x1f4e('0x36')]+','+(_0x1a449a['account']['waitForTheAssignedAgent']||0xa),'interval':_0x1f4e('0xaf')});}return respondWithRpcPromise(_0x1f4e('0xb4'),_0x1f4e('0xb5'),_0x1a449a);});}return respondWithRpcPromise(_0x1f4e('0xb4'),_0x1f4e('0xb5'),_0x1a449a);})[_0x1f4e('0x1a')](function(_0xb202ec){if(_0xb202ec){var _0x3e82aa=0xc8;var _0x4993f2=_0x1f4e('0xb6');logger[_0x1f4e('0x1b')](_0x1f4e('0x1d'),_0x4993f2,_0x3e82aa,'entity\x20found');logger[_0x1f4e('0xb7')](_0x1f4e('0xb8'),_0x4993f2,_0x3e82aa,_0x1f4e('0xb9'),JSON[_0x1f4e('0xba')](_0xb202ec));if(_0x1a449a[_0x1f4e('0x84')][_0x1f4e('0x3c')]===_0x1f4e('0x97')){return _0x25a26f[_0x1f4e('0x25')](_0x3e82aa)['set'](_0x1f4e('0xbb'),_0x1f4e('0xbc'))[_0x1f4e('0x7f')](_0x1f4e('0xbd'));}else{return _0x25a26f[_0x1f4e('0x25')](_0x3e82aa)[_0x1f4e('0x2c')](_0xb202ec);}}});})['catch'](handleError(_0x25a26f,null));};exports[_0x1f4e('0x7f')]=function(_0x17686a,_0x138f89,_0x98be37){var _0x58e5ec,_0x318d5a,_0x4ed0ff;if(_[_0x1f4e('0xa0')](_0x17686a[_0x1f4e('0x5f')][_0x1f4e('0x5f')])||_0x17686a[_0x1f4e('0x5f')][_0x1f4e('0x5f')]===''){throw new db['Sequelize'][(_0x1f4e('0x9e'))](_0x1f4e('0xbe'));}if(_[_0x1f4e('0xa0')](_0x17686a[_0x1f4e('0x5f')]['to'])){throw new db[(_0x1f4e('0x8f'))][(_0x1f4e('0x9e'))](_0x1f4e('0xbf'));}_0x58e5ec=_0x17686a[_0x1f4e('0x5f')]['to'];return db[_0x1f4e('0x3a')][_0x1f4e('0x57')]({'where':{'id':_0x17686a[_0x1f4e('0x54')]['id']},'include':[{'model':db[_0x1f4e('0xc0')],'as':_0x1f4e('0xc1'),'include':[{'model':db[_0x1f4e('0x8e')],'as':_0x1f4e('0xa5'),'where':{'mobile':_0x58e5ec},'limit':0x1,'order':[[_0x1f4e('0x91'),_0x1f4e('0xa6')]]}]}]})['then'](handleEntityNotFound(_0x138f89,null))['then'](function(_0x595581){if(_0x595581&&_0x595581[_0x1f4e('0xc1')]){_0x318d5a=_0x595581[_0x1f4e('0x32')]({'plain':!![]});if(_0x318d5a['List']&&_0x318d5a['List'][_0x1f4e('0xa5')][_0x1f4e('0x45')]){return _0x318d5a[_0x1f4e('0xc1')][_0x1f4e('0xa5')][0x0];}return db['CmContact'][_0x1f4e('0x58')](_['defaults'](_0x17686a['body'],{'firstName':_0x58e5ec,'mobile':_0x58e5ec,'phone':_0x58e5ec,'ListId':_0x318d5a[_0x1f4e('0x95')]}));}})[_0x1f4e('0x1a')](handleEntityNotFound(_0x138f89,null))[_0x1f4e('0x1a')](function(_0xaa208a){if(_0xaa208a){_0x4ed0ff=_0xaa208a;return db[_0x1f4e('0xa9')][_0x1f4e('0x57')]({'where':{'ContactId':_0x4ed0ff['id'],'closed':![],'WhatsappAccountId':_0x318d5a['id']}})[_0x1f4e('0x1a')](function(_0x2c4a05){if(_0x2c4a05){return[_0x2c4a05,![]];}return db['WhatsappInteraction'][_0x1f4e('0x58')]({'UserId':_0x17686a[_0x1f4e('0x59')]['id'],'ContactId':_0x4ed0ff['id'],'WhatsappAccountId':_0x318d5a['id'],'phone':_0x58e5ec,'firstMsgDirection':_0x1f4e('0xc2'),'Messages':[_[_0x1f4e('0x4d')](_0x17686a[_0x1f4e('0x5f')],{'read':![],'body':_0x17686a[_0x1f4e('0x5f')][_0x1f4e('0x5f')],'phone':_0x58e5ec,'WhatsappAccountId':_0x318d5a['id'],'UserId':_0x17686a[_0x1f4e('0x59')]['id'],'ContactId':_0x4ed0ff['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':'Messages'}]})[_0x1f4e('0x1a')](function(_0x25e2d0){return[_0x25e2d0,!![]];});});}})['spread'](function(_0x534c1a,_0x178f58){if(_0x178f58){return _0x534c1a;}return db[_0x1f4e('0x89')][_0x1f4e('0x58')](_[_0x1f4e('0x4d')](_0x17686a[_0x1f4e('0x5f')],{'read':![],'body':_0x17686a[_0x1f4e('0x5f')][_0x1f4e('0x5f')],'phone':_0x58e5ec,'WhatsappAccountId':_0x318d5a['id'],'WhatsappInteractionId':_0x534c1a['id'],'UserId':_0x17686a[_0x1f4e('0x59')]['id'],'ContactId':_0x4ed0ff['id']}))[_0x1f4e('0x1a')](function(_0x3dcf5c){_0x534c1a[_0x1f4e('0xc3')][_0x1f4e('0xc4')]=[];_0x534c1a[_0x1f4e('0xc3')][_0x1f4e('0xc4')][_0x1f4e('0xc5')](_0x3dcf5c[_0x1f4e('0xc3')]);return _0x534c1a;});})[_0x1f4e('0x1a')](respondWithResult(_0x138f89,null))[_0x1f4e('0x23')](handleError(_0x138f89,null));}; \ No newline at end of file +var _0xd176=['mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','contact','WhatsappInteraction','spread','interaction','close','unmanaged','*,*,*,*','created','ContactId','AttachmentId','UserId','unshift','waitForTheAssignedAgent','Start','startRouting','receiveMessage','debug','entity\x20found','Content-Type','text/xml','to\x20is\x20mandatory','List','out','dataValues','Messages','push','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','request','then','info','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','WhatsappAccount,\x20%s,\x20%s','message','status','offset','undefined','count','limit','set','Content-Range','json','reject','destroy','get','WhatsappAccounts','UserProfileResource','end','sendStatus','name','send','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','includeAll','include','findAll','rows','show','params','options','catch','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','addDisposition','WhatsappAccountId','getDispositions','findOne','Disposition','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addAgents','omit','emit','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','stack','finally','getApplications','notify','Applications','account','sinch','statuses','state','read','WhatsappMessage','update','applications','asc','CmContact','Sequelize','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','From','replace','whatsapp:','messageId','notifications','from','isNil','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'];(function(_0x5d55e5,_0xcb987a){var _0x328ef6=function(_0x42681b){while(--_0x42681b){_0x5d55e5['push'](_0x5d55e5['shift']());}};_0x328ef6(++_0xcb987a);}(_0xd176,0x19f));var _0x6d17=function(_0x46a3e8,_0x2e1b35){_0x46a3e8=_0x46a3e8-0x0;var _0xf1442e=_0xd176[_0x46a3e8];return _0xf1442e;};'use strict';var emlformat=require(_0x6d17('0x0'));var rimraf=require(_0x6d17('0x1'));var zipdir=require(_0x6d17('0x2'));var jsonpatch=require(_0x6d17('0x3'));var rp=require(_0x6d17('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6d17('0x5'));var util=require(_0x6d17('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x6d17('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6d17('0x8'));var _=require(_0x6d17('0x9'));var squel=require(_0x6d17('0xa'));var crypto=require(_0x6d17('0xb'));var jsforce=require(_0x6d17('0xc'));var deskjs=require(_0x6d17('0xd'));var toCsv=require(_0x6d17('0x7'));var querystring=require(_0x6d17('0xe'));var Papa=require(_0x6d17('0xf'));var Redis=require(_0x6d17('0x10'));var authService=require(_0x6d17('0x11'));var qs=require(_0x6d17('0x12'));var as=require(_0x6d17('0x13'));var hardwareService=require(_0x6d17('0x14'));var logger=require(_0x6d17('0x15'))(_0x6d17('0x16'));var utils=require('../../config/utils');var config=require(_0x6d17('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x6d17('0x18')]=_[_0x6d17('0x19')](config[_0x6d17('0x18')],{'host':_0x6d17('0x1a'),'port':0x18eb});var socket=require(_0x6d17('0x1b'))(new Redis(config[_0x6d17('0x18')]));require('./whatsappAccount.socket')[_0x6d17('0x1c')](socket);var jayson=require(_0x6d17('0x1d'));var client=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x21dc18,_0x101c51,_0x42e2f0,_0x22615f){return new BPromise(function(_0x44d083,_0x1040b4){var _0x3b423b=_0x22615f||client;return _0x3b423b[_0x6d17('0x1e')](_0x21dc18,_0x42e2f0)[_0x6d17('0x1f')](function(_0x46a517){logger[_0x6d17('0x20')]('WhatsappAccount,\x20%s,\x20%s',_0x101c51,'request\x20sent');logger['debug'](_0x6d17('0x21'),_0x101c51,_0x6d17('0x22'),JSON[_0x6d17('0x23')](_0x46a517));if(_0x46a517[_0x6d17('0x24')]){if(_0x46a517[_0x6d17('0x24')]['code']===0x1f4){logger[_0x6d17('0x24')](_0x6d17('0x25'),_0x101c51,_0x46a517[_0x6d17('0x24')][_0x6d17('0x26')]);return _0x1040b4(_0x46a517[_0x6d17('0x24')][_0x6d17('0x26')]);}logger['error'](_0x6d17('0x25'),_0x101c51,_0x46a517[_0x6d17('0x24')]['message']);return _0x44d083(_0x46a517[_0x6d17('0x24')][_0x6d17('0x26')]);}else{logger[_0x6d17('0x20')](_0x6d17('0x25'),_0x101c51,_0x6d17('0x22'));_0x44d083(_0x46a517['result'][_0x6d17('0x26')]);}})['catch'](function(_0x5aaeb3){logger['error'](_0x6d17('0x25'),_0x101c51,_0x5aaeb3);_0x1040b4(_0x5aaeb3);});});}function respondWithStatusCode(_0x1b2282,_0x293974){_0x293974=_0x293974||0xcc;return function(_0x23a14c){if(_0x23a14c){return _0x1b2282['sendStatus'](_0x293974);}return _0x1b2282[_0x6d17('0x27')](_0x293974)['end']();};}function respondWithResult(_0xc738a,_0xff3e61){_0xff3e61=_0xff3e61||0xc8;return function(_0x5757ba){if(_0x5757ba){return _0xc738a[_0x6d17('0x27')](_0xff3e61)['json'](_0x5757ba);}};}function respondWithFilteredResult(_0x5cfa7d,_0x3006a3){return function(_0x49f899){if(_0x49f899){var _0x232eda=typeof _0x3006a3[_0x6d17('0x28')]===_0x6d17('0x29')&&typeof _0x3006a3['limit']==='undefined';var _0x582236=_0x49f899[_0x6d17('0x2a')];var _0x30713c=_0x232eda?0x0:_0x3006a3[_0x6d17('0x28')];var _0x18fe0d=_0x232eda?_0x49f899[_0x6d17('0x2a')]:_0x3006a3[_0x6d17('0x28')]+_0x3006a3[_0x6d17('0x2b')];var _0x58e221;if(_0x18fe0d>=_0x582236){_0x18fe0d=_0x582236;_0x58e221=0xc8;}else{_0x58e221=0xce;}_0x5cfa7d[_0x6d17('0x27')](_0x58e221);return _0x5cfa7d[_0x6d17('0x2c')](_0x6d17('0x2d'),_0x30713c+'-'+_0x18fe0d+'/'+_0x582236)[_0x6d17('0x2e')](_0x49f899);}return null;};}function patchUpdates(_0x5b623d){return function(_0x5a87ea){try{jsonpatch['apply'](_0x5a87ea,_0x5b623d,!![]);}catch(_0xa3d9cf){return BPromise[_0x6d17('0x2f')](_0xa3d9cf);}return _0x5a87ea['save']();};}function saveUpdates(_0x1d45e9,_0x4028f9){return function(_0x33a755){if(_0x33a755){return _0x33a755['update'](_0x1d45e9)[_0x6d17('0x1f')](function(_0x3d9023){return _0x3d9023;});}return null;};}function removeEntity(_0x4b8e00,_0x2dfdf3){return function(_0x22a719){if(_0x22a719){return _0x22a719[_0x6d17('0x30')]()[_0x6d17('0x1f')](function(){var _0x46f3bb=_0x22a719[_0x6d17('0x31')]({'plain':!![]});var _0x142190=_0x6d17('0x32');return db[_0x6d17('0x33')][_0x6d17('0x30')]({'where':{'type':_0x142190,'resourceId':_0x46f3bb['id']}})[_0x6d17('0x1f')](function(){return _0x22a719;});})[_0x6d17('0x1f')](function(){_0x4b8e00[_0x6d17('0x27')](0xcc)[_0x6d17('0x34')]();});}};}function handleEntityNotFound(_0x31d719,_0xa324d6){return function(_0x5c18ed){if(!_0x5c18ed){_0x31d719[_0x6d17('0x35')](0x194);}return _0x5c18ed;};}function handleError(_0x26a20d,_0x5715df){_0x5715df=_0x5715df||0x1f4;return function(_0x4aa061){logger['error'](_0x4aa061['stack']);if(_0x4aa061[_0x6d17('0x36')]){delete _0x4aa061['name'];}_0x26a20d[_0x6d17('0x27')](_0x5715df)[_0x6d17('0x37')](_0x4aa061);};}exports[_0x6d17('0x38')]=function(_0x2763c8,_0x28398f){var _0x14c994={'include':[{'model':db[_0x6d17('0x39')],'as':_0x6d17('0x3a')}]},_0x14df51={},_0x4c66ef={'count':0x0,'rows':[]};var _0xb3f7a7=_[_0x6d17('0x3b')](db[_0x6d17('0x3c')][_0x6d17('0x3d')],function(_0xebee8){return{'name':_0xebee8['fieldName'],'type':_0xebee8[_0x6d17('0x3e')][_0x6d17('0x3f')]};});_0x14df51[_0x6d17('0x40')]=_[_0x6d17('0x3b')](_0xb3f7a7,_0x6d17('0x36'));_0x14df51[_0x6d17('0x41')]=_[_0x6d17('0x42')](_0x2763c8[_0x6d17('0x41')]);_0x14df51[_0x6d17('0x43')]=_[_0x6d17('0x44')](_0x14df51[_0x6d17('0x40')],_0x14df51[_0x6d17('0x41')]);_0x14c994[_0x6d17('0x45')]=_[_0x6d17('0x44')](_0x14df51[_0x6d17('0x40')],qs[_0x6d17('0x46')](_0x2763c8['query']['fields']));_0x14c994['attributes']=_0x14c994[_0x6d17('0x45')][_0x6d17('0x47')]?_0x14c994[_0x6d17('0x45')]:_0x14df51[_0x6d17('0x40')];if(!_0x2763c8[_0x6d17('0x41')][_0x6d17('0x48')](_0x6d17('0x49'))){_0x14c994['limit']=qs[_0x6d17('0x2b')](_0x2763c8[_0x6d17('0x41')][_0x6d17('0x2b')]);_0x14c994['offset']=qs[_0x6d17('0x28')](_0x2763c8[_0x6d17('0x41')][_0x6d17('0x28')]);}_0x14c994[_0x6d17('0x4a')]=qs[_0x6d17('0x4b')](_0x2763c8[_0x6d17('0x41')][_0x6d17('0x4b')]);_0x14c994['where']=qs[_0x6d17('0x43')](_[_0x6d17('0x4c')](_0x2763c8['query'],_0x14df51[_0x6d17('0x43')]),_0xb3f7a7);if(_0x2763c8[_0x6d17('0x41')][_0x6d17('0x4d')]){_0x14c994[_0x6d17('0x4e')]=_['merge'](_0x14c994['where'],{'$or':_[_0x6d17('0x3b')](_0xb3f7a7,function(_0x1a949f){if(_0x1a949f['type']!==_0x6d17('0x4f')){var _0x216cee={};_0x216cee[_0x1a949f['name']]={'$like':'%'+_0x2763c8['query']['filter']+'%'};return _0x216cee;}})});}_0x14c994=_[_0x6d17('0x50')]({},_0x14c994,_0x2763c8['options']);var _0x57e0a8={'where':_0x14c994[_0x6d17('0x4e')]};return db[_0x6d17('0x3c')][_0x6d17('0x2a')](_0x57e0a8)[_0x6d17('0x1f')](function(_0x2dc1a2){_0x4c66ef[_0x6d17('0x2a')]=_0x2dc1a2;if(_0x2763c8[_0x6d17('0x41')][_0x6d17('0x51')]){_0x14c994[_0x6d17('0x52')]=[{'all':!![]}];}return db[_0x6d17('0x3c')][_0x6d17('0x53')](_0x14c994);})[_0x6d17('0x1f')](function(_0x33d137){_0x4c66ef[_0x6d17('0x54')]=_0x33d137;return _0x4c66ef;})[_0x6d17('0x1f')](respondWithFilteredResult(_0x28398f,_0x14c994))['catch'](handleError(_0x28398f,null));};exports[_0x6d17('0x55')]=function(_0x5a2ebe,_0x2d4dce){var _0x2c978b={'raw':![],'where':{'id':_0x5a2ebe[_0x6d17('0x56')]['id']},'include':[{'model':db[_0x6d17('0x39')],'as':_0x6d17('0x3a')}]},_0x341742={};_0x341742[_0x6d17('0x40')]=_[_0x6d17('0x42')](db[_0x6d17('0x3c')][_0x6d17('0x3d')]);_0x341742[_0x6d17('0x41')]=_[_0x6d17('0x42')](_0x5a2ebe[_0x6d17('0x41')]);_0x341742[_0x6d17('0x43')]=_[_0x6d17('0x44')](_0x341742[_0x6d17('0x40')],_0x341742[_0x6d17('0x41')]);_0x2c978b['attributes']=_[_0x6d17('0x44')](_0x341742[_0x6d17('0x40')],qs[_0x6d17('0x46')](_0x5a2ebe[_0x6d17('0x41')][_0x6d17('0x46')]));_0x2c978b['attributes']=_0x2c978b['attributes'][_0x6d17('0x47')]?_0x2c978b[_0x6d17('0x45')]:_0x341742[_0x6d17('0x40')];if(_0x5a2ebe[_0x6d17('0x41')][_0x6d17('0x51')]){_0x2c978b[_0x6d17('0x52')]=[{'all':!![]}];}_0x2c978b=_['merge']({},_0x2c978b,_0x5a2ebe[_0x6d17('0x57')]);return db[_0x6d17('0x3c')]['find'](_0x2c978b)[_0x6d17('0x1f')](handleEntityNotFound(_0x2d4dce,null))[_0x6d17('0x1f')](respondWithResult(_0x2d4dce,null))[_0x6d17('0x58')](handleError(_0x2d4dce,null));};exports[_0x6d17('0x59')]=function(_0x366ce7,_0xb761eb){return db[_0x6d17('0x3c')][_0x6d17('0x59')](_0x366ce7[_0x6d17('0x5a')],{})[_0x6d17('0x1f')](function(_0x2a4848){var _0x2fe48c=_0x366ce7[_0x6d17('0x5b')]['get']({'plain':!![]});if(!_0x2fe48c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2fe48c[_0x6d17('0x5c')]===_0x6d17('0x5b')){var _0x55d252=_0x2a4848[_0x6d17('0x31')]({'plain':!![]});var _0x139d3d='WhatsappAccounts';return db[_0x6d17('0x5d')]['find']({'where':{'name':_0x139d3d,'userProfileId':_0x2fe48c[_0x6d17('0x5e')]},'raw':!![]})['then'](function(_0x4271c5){if(_0x4271c5&&_0x4271c5[_0x6d17('0x5f')]===0x0){return db[_0x6d17('0x33')][_0x6d17('0x59')]({'name':_0x55d252[_0x6d17('0x36')],'resourceId':_0x55d252['id'],'type':_0x4271c5[_0x6d17('0x36')],'sectionId':_0x4271c5['id']},{})[_0x6d17('0x1f')](function(){return _0x2a4848;});}else{return _0x2a4848;}})[_0x6d17('0x58')](function(_0xb82afc){logger['error'](_0x6d17('0x60'),_0xb82afc);throw _0xb82afc;});}return _0x2a4848;})[_0x6d17('0x1f')](respondWithResult(_0xb761eb,0xc9))[_0x6d17('0x58')](handleError(_0xb761eb,null));};exports['update']=function(_0x195d57,_0xe4d6ca){if(_0x195d57['body']['id']){delete _0x195d57[_0x6d17('0x5a')]['id'];}return db['WhatsappAccount'][_0x6d17('0x61')]({'where':{'id':_0x195d57[_0x6d17('0x56')]['id']},'include':[{'model':db[_0x6d17('0x39')],'as':_0x6d17('0x3a')}]})[_0x6d17('0x1f')](handleEntityNotFound(_0xe4d6ca,null))[_0x6d17('0x1f')](saveUpdates(_0x195d57[_0x6d17('0x5a')],null))['then'](respondWithResult(_0xe4d6ca,null))[_0x6d17('0x58')](handleError(_0xe4d6ca,null));};exports['destroy']=function(_0x3f1205,_0x23683b){return db['WhatsappAccount']['find']({'where':{'id':_0x3f1205[_0x6d17('0x56')]['id']}})['then'](handleEntityNotFound(_0x23683b,null))[_0x6d17('0x1f')](removeEntity(_0x23683b,null))[_0x6d17('0x58')](handleError(_0x23683b,null));};exports[_0x6d17('0x62')]=function(_0x4be466,_0x52de73){return db['WhatsappAccount'][_0x6d17('0x62')]()[_0x6d17('0x1f')](respondWithResult(_0x52de73,null))[_0x6d17('0x58')](handleError(_0x52de73,null));};exports[_0x6d17('0x63')]=function(_0x5905a2,_0x3783e1,_0x5646ff){if(_0x5905a2['body']['id']){delete _0x5905a2[_0x6d17('0x5a')]['id'];}return db[_0x6d17('0x3c')][_0x6d17('0x61')]({'where':{'id':_0x5905a2[_0x6d17('0x56')]['id']}})['then'](handleEntityNotFound(_0x3783e1,null))['then'](function(_0x424b1f){if(_0x424b1f){_0x5905a2[_0x6d17('0x5a')][_0x6d17('0x64')]=_0x424b1f['id'];return db['Disposition'][_0x6d17('0x59')](_0x5905a2[_0x6d17('0x5a')]);}})['then'](respondWithResult(_0x3783e1,null))['catch'](handleError(_0x3783e1,null));};exports[_0x6d17('0x65')]=function(_0x1f4daf,_0x305d82,_0x5539c5){var _0xcb1c16={'raw':![],'where':{}};var _0x1dce77={};var _0x28fe70={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0x6d17('0x66')]({'where':{'id':_0x1f4daf[_0x6d17('0x56')]['id']}})['then'](handleEntityNotFound(_0x305d82,null))[_0x6d17('0x1f')](function(_0x1fd2ee){if(_0x1fd2ee){_0x1dce77[_0x6d17('0x40')]=_['keys'](db[_0x6d17('0x67')][_0x6d17('0x3d')]);_0x1dce77['query']=_[_0x6d17('0x42')](_0x1f4daf[_0x6d17('0x41')]);_0x1dce77[_0x6d17('0x43')]=_[_0x6d17('0x44')](_0x1dce77[_0x6d17('0x40')],_0x1dce77[_0x6d17('0x41')]);_0xcb1c16[_0x6d17('0x45')]=_[_0x6d17('0x44')](_0x1dce77[_0x6d17('0x40')],qs[_0x6d17('0x46')](_0x1f4daf[_0x6d17('0x41')][_0x6d17('0x46')]));_0xcb1c16[_0x6d17('0x45')]=_0xcb1c16[_0x6d17('0x45')][_0x6d17('0x47')]?_0xcb1c16[_0x6d17('0x45')]:_0x1dce77[_0x6d17('0x40')];if(!_0x1f4daf[_0x6d17('0x41')][_0x6d17('0x48')](_0x6d17('0x49'))){_0xcb1c16[_0x6d17('0x2b')]=qs[_0x6d17('0x2b')](_0x1f4daf[_0x6d17('0x41')][_0x6d17('0x2b')]);_0xcb1c16[_0x6d17('0x28')]=qs[_0x6d17('0x28')](_0x1f4daf['query'][_0x6d17('0x28')]);}_0xcb1c16[_0x6d17('0x4a')]=qs[_0x6d17('0x4b')](_0x1f4daf['query'][_0x6d17('0x4b')]);_0xcb1c16['where']=qs[_0x6d17('0x43')](_[_0x6d17('0x4c')](_0x1f4daf[_0x6d17('0x41')],_0x1dce77[_0x6d17('0x43')]));_0xcb1c16[_0x6d17('0x4e')][_0x6d17('0x64')]=_0x1fd2ee['id'];if(_0x1f4daf['query'][_0x6d17('0x4d')]){_0xcb1c16[_0x6d17('0x4e')]=_[_0x6d17('0x50')](_0xcb1c16[_0x6d17('0x4e')],{'$or':_[_0x6d17('0x3b')](_0xcb1c16['attributes'],function(_0x44ae8a){var _0x2b6b24={};_0x2b6b24[_0x44ae8a]={'$like':'%'+_0x1f4daf[_0x6d17('0x41')][_0x6d17('0x4d')]+'%'};return _0x2b6b24;})});}_0xcb1c16=_[_0x6d17('0x50')]({},_0xcb1c16,_0x1f4daf[_0x6d17('0x57')]);return db[_0x6d17('0x67')][_0x6d17('0x2a')]({'where':_0xcb1c16[_0x6d17('0x4e')]})[_0x6d17('0x1f')](function(_0x301c14){_0x28fe70[_0x6d17('0x2a')]=_0x301c14;if(_0x1f4daf[_0x6d17('0x41')][_0x6d17('0x51')]){_0xcb1c16[_0x6d17('0x52')]=[{'all':!![]}];}return db['Disposition'][_0x6d17('0x53')](_0xcb1c16);})[_0x6d17('0x1f')](function(_0x5136b6){_0x28fe70[_0x6d17('0x54')]=_0x5136b6;return _0x28fe70;});}})[_0x6d17('0x1f')](respondWithFilteredResult(_0x305d82,_0xcb1c16))[_0x6d17('0x58')](handleError(_0x305d82,null));};exports['removeDispositions']=function(_0xe79116,_0x21dd32,_0x5caae6){return db[_0x6d17('0x3c')][_0x6d17('0x61')]({'where':{'id':_0xe79116[_0x6d17('0x56')]['id']}})[_0x6d17('0x1f')](handleEntityNotFound(_0x21dd32,null))[_0x6d17('0x1f')](function(_0x20f803){if(_0x20f803){return _0x20f803['removeDispositions'](_0xe79116[_0x6d17('0x41')][_0x6d17('0x68')]);}})[_0x6d17('0x1f')](respondWithStatusCode(_0x21dd32,null))[_0x6d17('0x58')](handleError(_0x21dd32,null));};exports[_0x6d17('0x69')]=function(_0x3d9dbd,_0x58fb7e,_0x4bca96){if(_0x3d9dbd[_0x6d17('0x5a')]['id']){delete _0x3d9dbd[_0x6d17('0x5a')]['id'];}return db[_0x6d17('0x3c')][_0x6d17('0x61')]({'where':{'id':_0x3d9dbd[_0x6d17('0x56')]['id']}})[_0x6d17('0x1f')](handleEntityNotFound(_0x58fb7e,null))['then'](function(_0x5976e8){if(_0x5976e8){_0x3d9dbd[_0x6d17('0x5a')]['WhatsappAccountId']=_0x5976e8['id'];return db[_0x6d17('0x6a')][_0x6d17('0x59')](_0x3d9dbd[_0x6d17('0x5a')]);}})[_0x6d17('0x1f')](respondWithResult(_0x58fb7e,null))[_0x6d17('0x58')](handleError(_0x58fb7e,null));};exports[_0x6d17('0x6b')]=function(_0xe9f871,_0x23594b,_0x4a2a0f){var _0x11b820={'raw':![],'where':{}};var _0x67f52e={};var _0x179a32={'count':0x0,'rows':[]};return db[_0x6d17('0x3c')][_0x6d17('0x66')]({'where':{'id':_0xe9f871['params']['id']}})[_0x6d17('0x1f')](handleEntityNotFound(_0x23594b,null))[_0x6d17('0x1f')](function(_0xcb8e00){if(_0xcb8e00){_0x67f52e[_0x6d17('0x40')]=_[_0x6d17('0x42')](db[_0x6d17('0x6a')]['rawAttributes']);_0x67f52e[_0x6d17('0x41')]=_[_0x6d17('0x42')](_0xe9f871['query']);_0x67f52e[_0x6d17('0x43')]=_[_0x6d17('0x44')](_0x67f52e[_0x6d17('0x40')],_0x67f52e[_0x6d17('0x41')]);_0x11b820['attributes']=_[_0x6d17('0x44')](_0x67f52e[_0x6d17('0x40')],qs[_0x6d17('0x46')](_0xe9f871[_0x6d17('0x41')]['fields']));_0x11b820['attributes']=_0x11b820[_0x6d17('0x45')][_0x6d17('0x47')]?_0x11b820[_0x6d17('0x45')]:_0x67f52e[_0x6d17('0x40')];if(!_0xe9f871[_0x6d17('0x41')][_0x6d17('0x48')](_0x6d17('0x49'))){_0x11b820[_0x6d17('0x2b')]=qs[_0x6d17('0x2b')](_0xe9f871[_0x6d17('0x41')][_0x6d17('0x2b')]);_0x11b820['offset']=qs[_0x6d17('0x28')](_0xe9f871[_0x6d17('0x41')]['offset']);}_0x11b820[_0x6d17('0x4a')]=qs[_0x6d17('0x4b')](_0xe9f871[_0x6d17('0x41')][_0x6d17('0x4b')]);_0x11b820[_0x6d17('0x4e')]=qs[_0x6d17('0x43')](_[_0x6d17('0x4c')](_0xe9f871[_0x6d17('0x41')],_0x67f52e[_0x6d17('0x43')]));_0x11b820[_0x6d17('0x4e')][_0x6d17('0x64')]=_0xcb8e00['id'];if(_0xe9f871[_0x6d17('0x41')][_0x6d17('0x4d')]){_0x11b820['where']=_[_0x6d17('0x50')](_0x11b820[_0x6d17('0x4e')],{'$or':_[_0x6d17('0x3b')](_0x11b820[_0x6d17('0x45')],function(_0x257f5d){var _0x9394b={};_0x9394b[_0x257f5d]={'$like':'%'+_0xe9f871[_0x6d17('0x41')][_0x6d17('0x4d')]+'%'};return _0x9394b;})});}_0x11b820=_['merge']({},_0x11b820,_0xe9f871[_0x6d17('0x57')]);return db[_0x6d17('0x6a')][_0x6d17('0x2a')]({'where':_0x11b820['where']})[_0x6d17('0x1f')](function(_0x17c337){_0x179a32[_0x6d17('0x2a')]=_0x17c337;if(_0xe9f871[_0x6d17('0x41')][_0x6d17('0x51')]){_0x11b820[_0x6d17('0x52')]=[{'all':!![]}];}return db['CannedAnswer'][_0x6d17('0x53')](_0x11b820);})[_0x6d17('0x1f')](function(_0x2c8bf5){_0x179a32[_0x6d17('0x54')]=_0x2c8bf5;return _0x179a32;});}})[_0x6d17('0x1f')](respondWithFilteredResult(_0x23594b,_0x11b820))['catch'](handleError(_0x23594b,null));};exports[_0x6d17('0x6c')]=function(_0x3c9697,_0x529790,_0x1f879f){return db['WhatsappAccount'][_0x6d17('0x61')]({'where':{'id':_0x3c9697[_0x6d17('0x56')]['id']}})[_0x6d17('0x1f')](handleEntityNotFound(_0x529790,null))[_0x6d17('0x1f')](function(_0x398811){if(_0x398811){return _0x398811[_0x6d17('0x6c')](_0x3c9697[_0x6d17('0x41')]['ids']);}})[_0x6d17('0x1f')](respondWithStatusCode(_0x529790,null))[_0x6d17('0x58')](handleError(_0x529790,null));};exports[_0x6d17('0x6d')]=function(_0x3b885c,_0x3b7281,_0x1d3be0){return db[_0x6d17('0x3c')]['find']({'where':{'id':_0x3b885c[_0x6d17('0x56')]['id']}})[_0x6d17('0x1f')](handleEntityNotFound(_0x3b7281,null))[_0x6d17('0x1f')](function(_0x9ed6db){if(_0x9ed6db){return _0x9ed6db['addAgents'](_0x3b885c[_0x6d17('0x5a')][_0x6d17('0x68')],_[_0x6d17('0x6e')](_0x3b885c[_0x6d17('0x5a')],[_0x6d17('0x68'),'id'])||{})['spread'](function(_0x5d4e2f){for(var _0x414d65=0x0;_0x414d65<_0x3b885c['body']['ids'][_0x6d17('0x47')];_0x414d65+=0x1){socket[_0x6d17('0x6f')]('userWhatsappAccount:save',{'UserId':Number(_0x3b885c[_0x6d17('0x5a')][_0x6d17('0x68')][_0x414d65]),'WhatsappAccountId':Number(_0x3b885c['params']['id'])});}return _0x5d4e2f;});}})[_0x6d17('0x1f')](respondWithResult(_0x3b7281,null))[_0x6d17('0x58')](handleError(_0x3b7281,null));};exports[_0x6d17('0x70')]=function(_0x3dc6af,_0x4c4941,_0x55473b){return db[_0x6d17('0x3c')]['find']({'where':{'id':_0x3dc6af[_0x6d17('0x56')]['id']}})[_0x6d17('0x1f')](handleEntityNotFound(_0x4c4941,null))['then'](function(_0x97d6d2){if(_0x97d6d2){return _0x97d6d2[_0x6d17('0x70')](_0x3dc6af[_0x6d17('0x41')][_0x6d17('0x68')])[_0x6d17('0x1f')](function(){if(_[_0x6d17('0x71')](_0x3dc6af[_0x6d17('0x41')][_0x6d17('0x68')])){for(var _0x402b42=0x0;_0x402b42<_0x3dc6af[_0x6d17('0x41')][_0x6d17('0x68')][_0x6d17('0x47')];_0x402b42+=0x1){socket[_0x6d17('0x6f')](_0x6d17('0x72'),{'UserId':Number(_0x3dc6af['query'][_0x6d17('0x68')][_0x402b42]),'WhatsappAccountId':Number(_0x3dc6af[_0x6d17('0x56')]['id'])});}}else{socket[_0x6d17('0x6f')](_0x6d17('0x72'),{'UserId':Number(_0x3dc6af[_0x6d17('0x41')][_0x6d17('0x68')]),'WhatsappAccountId':Number(_0x3dc6af[_0x6d17('0x56')]['id'])});}});}})[_0x6d17('0x1f')](respondWithStatusCode(_0x4c4941,null))[_0x6d17('0x58')](handleError(_0x4c4941,null));};exports[_0x6d17('0x73')]=function(_0xba6ad,_0x37b6a9,_0x532702){var _0x11df3f={};var _0x41f98b={};var _0x56dc47;var _0x3c797f;return db[_0x6d17('0x3c')][_0x6d17('0x66')]({'where':{'id':_0xba6ad[_0x6d17('0x56')]['id']}})[_0x6d17('0x1f')](handleEntityNotFound(_0x37b6a9,null))['then'](function(_0x1d3829){if(_0x1d3829){_0x56dc47=_0x1d3829;_0x41f98b[_0x6d17('0x40')]=_[_0x6d17('0x42')](db[_0x6d17('0x74')][_0x6d17('0x3d')]);_0x41f98b[_0x6d17('0x41')]=_[_0x6d17('0x42')](_0xba6ad[_0x6d17('0x41')]);_0x41f98b[_0x6d17('0x43')]=_['intersection'](_0x41f98b['model'],_0x41f98b[_0x6d17('0x41')]);_0x11df3f[_0x6d17('0x45')]=_[_0x6d17('0x44')](_0x41f98b[_0x6d17('0x40')],qs[_0x6d17('0x46')](_0xba6ad['query'][_0x6d17('0x46')]));_0x11df3f[_0x6d17('0x45')]=_0x11df3f[_0x6d17('0x45')][_0x6d17('0x47')]?_0x11df3f[_0x6d17('0x45')]:_0x41f98b['model'];_0x11df3f[_0x6d17('0x4a')]=qs[_0x6d17('0x4b')](_0xba6ad[_0x6d17('0x41')]['sort']);_0x11df3f['where']=qs[_0x6d17('0x43')](_[_0x6d17('0x4c')](_0xba6ad[_0x6d17('0x41')],_0x41f98b[_0x6d17('0x43')]));if(_0xba6ad['query'][_0x6d17('0x4d')]){_0x11df3f['where']=_['merge'](_0x11df3f[_0x6d17('0x4e')],{'$or':_['map'](_0x11df3f[_0x6d17('0x45')],function(_0x22ee18){var _0x3b7c7f={};_0x3b7c7f[_0x22ee18]={'$like':'%'+_0xba6ad[_0x6d17('0x41')][_0x6d17('0x4d')]+'%'};return _0x3b7c7f;})});}_0x11df3f=_['merge']({},_0x11df3f,_0xba6ad['options']);return _0x56dc47['getAgents'](_0x11df3f);}})[_0x6d17('0x1f')](function(_0xbfdabd){if(_0xbfdabd){_0x3c797f=_0xbfdabd[_0x6d17('0x47')];if(!_0xba6ad['query']['hasOwnProperty']('nolimit')){_0x11df3f[_0x6d17('0x2b')]=qs[_0x6d17('0x2b')](_0xba6ad[_0x6d17('0x41')]['limit']);_0x11df3f[_0x6d17('0x28')]=qs[_0x6d17('0x28')](_0xba6ad[_0x6d17('0x41')][_0x6d17('0x28')]);}return _0x56dc47['getAgents'](_0x11df3f);}})[_0x6d17('0x1f')](function(_0x41c9f5){if(_0x41c9f5){return _0x41c9f5?{'count':_0x3c797f,'rows':_0x41c9f5}:null;}})[_0x6d17('0x1f')](respondWithResult(_0x37b6a9,null))[_0x6d17('0x58')](handleError(_0x37b6a9,null));};exports[_0x6d17('0x75')]=function(_0x44a6fb,_0x43d1ec){var _0xd3c672=_0x44a6fb[_0x6d17('0x56')]['id'];var _0x154740=_0x44a6fb[_0x6d17('0x5a')];var _0x35117f=0xc8;var _0x625741=null;return db[_0x6d17('0x76')][_0x6d17('0x77')]({'isolationLevel':db[_0x6d17('0x76')][_0x6d17('0x78')]['ISOLATION_LEVELS'][_0x6d17('0x79')]},function(_0x93380e){return db['WhatsappAccount'][_0x6d17('0x66')]({'where':{'id':_0xd3c672},'transaction':_0x93380e})['then'](function(_0x576744){if(_0x576744){return db[_0x6d17('0x7a')]['destroy']({'where':{'WhatsappAccountId':_0xd3c672},'transaction':_0x93380e})[_0x6d17('0x1f')](function(){var _0x49b75b=_['map'](_0x154740,function(_0x314c4b){_0x314c4b[_0x6d17('0x64')]=_0xd3c672;return _0x314c4b;});return db[_0x6d17('0x7a')][_0x6d17('0x7b')](_0x49b75b,{'transaction':_0x93380e});});}else{_0x35117f=0x194;_0x625741=[];}});})[_0x6d17('0x1f')](function(){if(_0x35117f!==0x194){return db[_0x6d17('0x7a')][_0x6d17('0x7c')]({'where':{'WhatsappAccountId':_0xd3c672},'order':_0x6d17('0x7d')})[_0x6d17('0x1f')](function(_0xa8f81f){_0x625741=_0xa8f81f;});}})[_0x6d17('0x58')](function(_0x474996){_0x35117f=0x1f4;logger[_0x6d17('0x24')](_0x474996[_0x6d17('0x7e')]);if(_0x474996[_0x6d17('0x36')]){delete _0x474996['name'];}_0x625741=_0x474996;})[_0x6d17('0x7f')](function(){if(_0x625741===null){_0x43d1ec[_0x6d17('0x35')](_0x35117f);}else{if(_0x35117f===0x1f4){_0x43d1ec['status'](_0x35117f)[_0x6d17('0x37')](_0x625741);}else{_0x43d1ec[_0x6d17('0x27')](_0x35117f)[_0x6d17('0x2e')](_0x625741);}}});};exports[_0x6d17('0x80')]=function(_0x47ba82,_0x1172b6,_0x334f91){var _0x2e7a9f={};var _0x57bfd0={};var _0x3c56f2;var _0x1e4644;return db[_0x6d17('0x3c')][_0x6d17('0x66')]({'where':{'id':_0x47ba82[_0x6d17('0x56')]['id']}})[_0x6d17('0x1f')](handleEntityNotFound(_0x1172b6,null))[_0x6d17('0x1f')](function(_0x5e3e38){if(_0x5e3e38){_0x3c56f2=_0x5e3e38;_0x57bfd0['model']=_[_0x6d17('0x42')](db[_0x6d17('0x7a')][_0x6d17('0x3d')]);_0x57bfd0['query']=_[_0x6d17('0x42')](_0x47ba82[_0x6d17('0x41')]);_0x57bfd0[_0x6d17('0x43')]=_[_0x6d17('0x44')](_0x57bfd0[_0x6d17('0x40')],_0x57bfd0[_0x6d17('0x41')]);_0x2e7a9f[_0x6d17('0x45')]=_[_0x6d17('0x44')](_0x57bfd0['model'],qs['fields'](_0x47ba82[_0x6d17('0x41')]['fields']));_0x2e7a9f['attributes']=_0x2e7a9f[_0x6d17('0x45')][_0x6d17('0x47')]?_0x2e7a9f['attributes']:_0x57bfd0[_0x6d17('0x40')];_0x2e7a9f[_0x6d17('0x4a')]=qs[_0x6d17('0x4b')](_0x47ba82[_0x6d17('0x41')][_0x6d17('0x4b')]);_0x2e7a9f[_0x6d17('0x4e')]=qs[_0x6d17('0x43')](_['pick'](_0x47ba82['query'],_0x57bfd0[_0x6d17('0x43')]));if(_0x47ba82[_0x6d17('0x41')]['filter']){_0x2e7a9f[_0x6d17('0x4e')]=_[_0x6d17('0x50')](_0x2e7a9f[_0x6d17('0x4e')],{'$or':_['map'](_0x2e7a9f[_0x6d17('0x45')],function(_0x33e199){var _0x5d2086={};_0x5d2086[_0x33e199]={'$like':'%'+_0x47ba82[_0x6d17('0x41')][_0x6d17('0x4d')]+'%'};return _0x5d2086;})});}_0x2e7a9f=_[_0x6d17('0x50')]({},_0x2e7a9f,_0x47ba82[_0x6d17('0x57')]);return _0x3c56f2[_0x6d17('0x80')](_0x2e7a9f);}})['then'](function(_0xd190c){if(_0xd190c){_0x1e4644=_0xd190c[_0x6d17('0x47')];if(!_0x47ba82['query'][_0x6d17('0x48')](_0x6d17('0x49'))){_0x2e7a9f[_0x6d17('0x2b')]=qs[_0x6d17('0x2b')](_0x47ba82['query']['limit']);_0x2e7a9f[_0x6d17('0x28')]=qs[_0x6d17('0x28')](_0x47ba82[_0x6d17('0x41')][_0x6d17('0x28')]);}return _0x3c56f2[_0x6d17('0x80')](_0x2e7a9f);}})[_0x6d17('0x1f')](function(_0x4631f9){if(_0x4631f9){return _0x4631f9?{'count':_0x1e4644,'rows':_0x4631f9}:null;}})[_0x6d17('0x1f')](respondWithResult(_0x1172b6,null))[_0x6d17('0x58')](handleError(_0x1172b6,null));};exports[_0x6d17('0x81')]=function(_0x499db5,_0x472ffa,_0x59f131){var _0x5d294e={'channel':'whatsapp'};var _0x32ce0b=[];var _0xc817ba=[];var _0x4e9f98={};return db['WhatsappAccount'][_0x6d17('0x61')]({'where':{'id':_0x499db5[_0x6d17('0x56')]['id']},'include':[{'model':db['WhatsappApplication'],'as':_0x6d17('0x82')}]})['then'](handleEntityNotFound(_0x472ffa,null))['then'](function(_0x2f28d5){_0x5d294e['account']=_0x2f28d5;if(_0x5d294e['account']&&_0x5d294e[_0x6d17('0x83')][_0x6d17('0x3e')]===_0x6d17('0x84')&&_0x499db5[_0x6d17('0x5a')][_0x6d17('0x85')]){if(_0x499db5[_0x6d17('0x5a')][_0x6d17('0x85')][_0x6d17('0x47')]===0x0)return;if(_0x499db5[_0x6d17('0x5a')][_0x6d17('0x85')][0x0][_0x6d17('0x86')]!==_0x6d17('0x87'))return;return db[_0x6d17('0x88')][_0x6d17('0x89')]({'read':!![],'readAt':_0x499db5[_0x6d17('0x5a')][_0x6d17('0x85')][0x0]['timestamp']},{'where':{'messageId':_0x499db5['body'][_0x6d17('0x85')][0x0]['message_id']},'individualHooks':!![]})[_0x6d17('0x1f')](function(_0x3dc12d){return _0x472ffa['status'](0xc8)[_0x6d17('0x2e')](_0x3dc12d);});}_0x5d294e[_0x6d17('0x8a')]=_['orderBy'](_0x2f28d5[_0x6d17('0x82')],['priority'],[_0x6d17('0x8b')]);if(_0x5d294e[_0x6d17('0x83')]['Applications']){delete _0x5d294e[_0x6d17('0x83')][_0x6d17('0x82')];}return db[_0x6d17('0x8c')][_0x6d17('0x62')]()[_0x6d17('0x1f')](function(_0x4e06a4){if(!_0x4e06a4){throw new db[(_0x6d17('0x8d'))]['ValidationError']('no\x20available\x20attributes');}_0x32ce0b=_[_0x6d17('0x8e')](_['keys'](_0x4e06a4),[_0x6d17('0x8f'),_0x6d17('0x90')]);_0xc817ba=_[_0x6d17('0x8e')](_[_0x6d17('0x42')](_0x4e06a4),[_0x6d17('0x8f'),'updatedAt',_0x6d17('0x91'),_0x6d17('0x92')]);_0x5d294e['body']={'mapKey':_0x6d17('0x93')};if(_0x5d294e[_0x6d17('0x83')]&&_0x5d294e[_0x6d17('0x83')][_0x6d17('0x3e')]===_0x6d17('0x94')){_0x5d294e[_0x6d17('0x5a')]['from']=_0x499db5[_0x6d17('0x5a')][_0x6d17('0x95')][_0x6d17('0x96')](_0x6d17('0x97'),'');_0x5d294e[_0x6d17('0x5a')]['body']=_0x499db5[_0x6d17('0x5a')]['Body'];_0x5d294e['body'][_0x6d17('0x98')]=_0x499db5[_0x6d17('0x5a')]['MessageSid'];}if(_0x5d294e['account']&&_0x5d294e['account'][_0x6d17('0x3e')]==='sinch'){_0x5d294e[_0x6d17('0x5a')]['from']=_0x499db5[_0x6d17('0x5a')][_0x6d17('0x99')][0x0][_0x6d17('0x9a')];_0x5d294e[_0x6d17('0x5a')][_0x6d17('0x5a')]=_0x499db5[_0x6d17('0x5a')][_0x6d17('0x99')][0x0]['message'][_0x6d17('0x5a')];_0x5d294e[_0x6d17('0x5a')][_0x6d17('0x98')]=_0x499db5[_0x6d17('0x5a')][_0x6d17('0x99')][0x0]['message_id'];}if(_0x5d294e['body']['id']){delete _0x5d294e[_0x6d17('0x5a')]['id'];}if(_[_0x6d17('0x9b')](_0x5d294e[_0x6d17('0x5a')]['from'])){throw new db[(_0x6d17('0x8d'))][(_0x6d17('0x9c'))](_0x6d17('0x9d'));}if(_[_0x6d17('0x9b')](_0x5d294e[_0x6d17('0x5a')]['body'])||_0x5d294e[_0x6d17('0x5a')]['body']===''){throw new db[(_0x6d17('0x8d'))]['ValidationError'](_0x6d17('0x9e'));}if(_[_0x6d17('0x9b')](_0x5d294e[_0x6d17('0x5a')][_0x6d17('0x9f')])){throw new db[(_0x6d17('0x8d'))][(_0x6d17('0x9c'))](_0x6d17('0xa0')+_0xc817ba);}if(!_['includes'](_0xc817ba,_0x5d294e[_0x6d17('0x5a')][_0x6d17('0x9f')])){throw new db[(_0x6d17('0x8d'))][(_0x6d17('0x9c'))](_0x6d17('0xa1')+_0xc817ba);}_0x4e9f98[_0x5d294e[_0x6d17('0x5a')][_0x6d17('0x9f')]]=_0x5d294e['body'][_0x6d17('0x9a')];return db[_0x6d17('0xa2')][_0x6d17('0x61')]({'where':{'id':_0x5d294e[_0x6d17('0x83')][_0x6d17('0x92')]},'include':[{'model':db['CmContact'],'as':_0x6d17('0xa3'),'where':_0x4e9f98,'limit':0x1,'order':[[_0x6d17('0x90'),_0x6d17('0xa4')]]}]});})[_0x6d17('0x1f')](handleEntityNotFound(_0x472ffa,null))[_0x6d17('0x1f')](function(_0x2d2a68){if(_0x2d2a68){_0x5d294e[_0x6d17('0xa5')]=_[_0x6d17('0x6e')](_0x2d2a68,[_0x6d17('0xa3')]);if(_0x2d2a68['Contacts'][_0x6d17('0x47')]){return _0x2d2a68[_0x6d17('0xa3')][0x0];}var _0x3efb0b=_[_0x6d17('0x19')](_0x5d294e[_0x6d17('0x5a')],{'firstName':_0x5d294e[_0x6d17('0x5a')][_0x6d17('0x9a')],'ListId':_0x2d2a68['id']});_0x3efb0b[_0x5d294e[_0x6d17('0x5a')][_0x6d17('0x9f')]]=_0x5d294e[_0x6d17('0x5a')][_0x6d17('0x9a')];return db['CmContact']['create'](_0x3efb0b,{'fields':_0x32ce0b,'raw':!![]});}})['then'](handleEntityNotFound(_0x472ffa,null))[_0x6d17('0x1f')](function(_0x193575){if(_0x193575){_0x5d294e[_0x6d17('0xa6')]=_0x193575;var _0xc766aa={'ContactId':_0x193575['id'],'phone':_0x5d294e['body'][_0x6d17('0x9a')],'WhatsappAccountId':_0x499db5[_0x6d17('0x56')]['id']};var _0x593acb={'ContactId':_0x193575['id'],'WhatsappAccountId':_0x499db5[_0x6d17('0x56')]['id'],'closed':![]};return db[_0x6d17('0xa7')][_0x6d17('0x61')]({'where':_0x593acb})['then'](function(_0x35e1e2){if(_0x35e1e2){return[_0x35e1e2,![]];}return db[_0x6d17('0xa7')][_0x6d17('0x59')](_0xc766aa)['then'](function(_0x4be2a2){return[_0x4be2a2,!![]];});});}})[_0x6d17('0xa8')](function(_0x3d72c5,_0x40d292){_0x5d294e[_0x6d17('0xa9')]=_0x3d72c5[_0x6d17('0x31')]({'plain':!![]});_0x5d294e[_0x6d17('0xa9')]['created']=![];if(_0x40d292){if(_0x5d294e['account']['autoclose']){_0x5d294e[_0x6d17('0x8a')]['push']({'id':0x0,'priority':_0x5d294e[_0x6d17('0x8a')]['length']+0x1,'app':_0x6d17('0xaa'),'appdata':_0x6d17('0xab'),'interval':_0x6d17('0xac')});}_0x5d294e[_0x6d17('0xa9')][_0x6d17('0xad')]=!![];}return db[_0x6d17('0x88')]['create']({'phone':_0x5d294e[_0x6d17('0x5a')]['from'],'messageId':_0x5d294e[_0x6d17('0x5a')][_0x6d17('0x98')],'body':_0x5d294e[_0x6d17('0x5a')][_0x6d17('0x5a')],'WhatsappAccountId':_0x499db5[_0x6d17('0x56')]['id'],'WhatsappInteractionId':_0x3d72c5['id'],'direction':'in','ContactId':_0x3d72c5[_0x6d17('0xae')],'AttachmentId':_0x5d294e[_0x6d17('0x5a')][_0x6d17('0xaf')]});})['then'](function(_0x487676){_0x5d294e['message']=_0x487676;if(_0x5d294e[_0x6d17('0xa9')]['UserId']){return db[_0x6d17('0x74')]['find']({'attributes':['id',_0x6d17('0x36')],'where':{'id':_0x5d294e['interaction'][_0x6d17('0xb0')]}})['then'](function(_0x574705){if(_0x574705){_0x5d294e['applications'][_0x6d17('0xb1')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x574705[_0x6d17('0x36')]+','+(_0x5d294e['account'][_0x6d17('0xb2')]||0xa),'interval':_0x6d17('0xac')});}return respondWithRpcPromise(_0x6d17('0xb3'),_0x6d17('0xb4'),_0x5d294e);});}return respondWithRpcPromise(_0x6d17('0xb3'),_0x6d17('0xb4'),_0x5d294e);})[_0x6d17('0x1f')](function(_0x14c2e1){if(_0x14c2e1){var _0x3e778f=0xc8;var _0x970fa0=_0x6d17('0xb5');logger[_0x6d17('0x20')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x970fa0,_0x3e778f,'entity\x20found');logger[_0x6d17('0xb6')]('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x970fa0,_0x3e778f,_0x6d17('0xb7'),JSON['stringify'](_0x14c2e1));if(_0x5d294e[_0x6d17('0x83')][_0x6d17('0x3e')]===_0x6d17('0x94')){return _0x472ffa[_0x6d17('0x27')](_0x3e778f)['set'](_0x6d17('0xb8'),_0x6d17('0xb9'))[_0x6d17('0x37')]('\x0a');}else{return _0x472ffa[_0x6d17('0x27')](_0x3e778f)[_0x6d17('0x2e')](_0x14c2e1);}}});})[_0x6d17('0x58')](handleError(_0x472ffa,null));};exports[_0x6d17('0x37')]=function(_0x1927d6,_0x25dbc7,_0x2a9eea){var _0x56f786,_0x768718,_0x2d4f77;if(_[_0x6d17('0x9b')](_0x1927d6[_0x6d17('0x5a')][_0x6d17('0x5a')])||_0x1927d6['body']['body']===''){throw new db['Sequelize'][(_0x6d17('0x9c'))](_0x6d17('0x9e'));}if(_[_0x6d17('0x9b')](_0x1927d6[_0x6d17('0x5a')]['to'])){throw new db[(_0x6d17('0x8d'))][(_0x6d17('0x9c'))](_0x6d17('0xba'));}_0x56f786=_0x1927d6[_0x6d17('0x5a')]['to'];return db['WhatsappAccount']['find']({'where':{'id':_0x1927d6[_0x6d17('0x56')]['id']},'include':[{'model':db[_0x6d17('0xa2')],'as':_0x6d17('0xbb'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'mobile':_0x56f786},'limit':0x1,'order':[[_0x6d17('0x90'),_0x6d17('0xa4')]]}]}]})[_0x6d17('0x1f')](handleEntityNotFound(_0x25dbc7,null))[_0x6d17('0x1f')](function(_0x214475){if(_0x214475&&_0x214475[_0x6d17('0xbb')]){_0x768718=_0x214475['get']({'plain':!![]});if(_0x768718[_0x6d17('0xbb')]&&_0x768718[_0x6d17('0xbb')][_0x6d17('0xa3')][_0x6d17('0x47')]){return _0x768718[_0x6d17('0xbb')][_0x6d17('0xa3')][0x0];}return db['CmContact'][_0x6d17('0x59')](_[_0x6d17('0x19')](_0x1927d6[_0x6d17('0x5a')],{'firstName':_0x56f786,'mobile':_0x56f786,'phone':_0x56f786,'ListId':_0x768718['ListId']}));}})[_0x6d17('0x1f')](handleEntityNotFound(_0x25dbc7,null))[_0x6d17('0x1f')](function(_0x45839a){if(_0x45839a){_0x2d4f77=_0x45839a;return db['WhatsappInteraction'][_0x6d17('0x61')]({'where':{'ContactId':_0x2d4f77['id'],'closed':![],'WhatsappAccountId':_0x768718['id']}})[_0x6d17('0x1f')](function(_0x6bcfa2){if(_0x6bcfa2){return[_0x6bcfa2,![]];}return db['WhatsappInteraction'][_0x6d17('0x59')]({'UserId':_0x1927d6[_0x6d17('0x5b')]['id'],'ContactId':_0x2d4f77['id'],'WhatsappAccountId':_0x768718['id'],'phone':_0x56f786,'firstMsgDirection':_0x6d17('0xbc'),'Messages':[_[_0x6d17('0x50')](_0x1927d6['body'],{'read':![],'body':_0x1927d6[_0x6d17('0x5a')][_0x6d17('0x5a')],'phone':_0x56f786,'WhatsappAccountId':_0x768718['id'],'UserId':_0x1927d6['user']['id'],'ContactId':_0x2d4f77['id']})]},{'include':[{'model':db[_0x6d17('0x88')],'as':'Messages'}]})[_0x6d17('0x1f')](function(_0xc22b71){return[_0xc22b71,!![]];});});}})[_0x6d17('0xa8')](function(_0x1ca372,_0x5c5b05){if(_0x5c5b05){return _0x1ca372;}return db[_0x6d17('0x88')][_0x6d17('0x59')](_[_0x6d17('0x50')](_0x1927d6['body'],{'read':![],'body':_0x1927d6[_0x6d17('0x5a')]['body'],'phone':_0x56f786,'WhatsappAccountId':_0x768718['id'],'WhatsappInteractionId':_0x1ca372['id'],'UserId':_0x1927d6[_0x6d17('0x5b')]['id'],'ContactId':_0x2d4f77['id']}))['then'](function(_0x3acdf3){_0x1ca372[_0x6d17('0xbd')][_0x6d17('0xbe')]=[];_0x1ca372[_0x6d17('0xbd')][_0x6d17('0xbe')][_0x6d17('0xbf')](_0x3acdf3[_0x6d17('0xbd')]);return _0x1ca372;});})[_0x6d17('0x1f')](respondWithResult(_0x25dbc7,null))[_0x6d17('0x58')](handleError(_0x25dbc7,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 440c1a9..907c5ca 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 _0x2eba=['update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','WhatsappAccount','setMaxListeners','save'];(function(_0x51649c,_0x469d41){var _0x3c1d38=function(_0x2d5765){while(--_0x2d5765){_0x51649c['push'](_0x51649c['shift']());}};_0x3c1d38(++_0x469d41);}(_0x2eba,0x1c8));var _0xa2eb=function(_0xa64cdd,_0x5d7f63){_0xa64cdd=_0xa64cdd-0x0;var _0x182dc6=_0x2eba[_0xa64cdd];return _0x182dc6;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0xa2eb('0x0'))['db'][_0xa2eb('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xa2eb('0x2')](0x0);var events={'afterCreate':_0xa2eb('0x3'),'afterUpdate':_0xa2eb('0x4'),'afterDestroy':_0xa2eb('0x5')};function emitEvent(_0x27bdc3){return function(_0x2d8e10,_0x2b3900,_0xc1404b){WhatsappAccountEvents[_0xa2eb('0x6')](_0x27bdc3+':'+_0x2d8e10['id'],_0x2d8e10);WhatsappAccountEvents[_0xa2eb('0x6')](_0x27bdc3,_0x2d8e10);_0xc1404b(null);};}for(var e in events){if(events[_0xa2eb('0x7')](e)){var event=events[e];WhatsappAccount[_0xa2eb('0x8')](e,emitEvent(event));}}module[_0xa2eb('0x9')]=WhatsappAccountEvents; \ No newline at end of file +var _0x5409=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','events','../../mysqldb','WhatsappAccount'];(function(_0x3c3982,_0x560ed1){var _0x12c1e0=function(_0x3575d1){while(--_0x3575d1){_0x3c3982['push'](_0x3c3982['shift']());}};_0x12c1e0(++_0x560ed1);}(_0x5409,0x177));var _0x9540=function(_0x35a04c,_0x3ce1e9){_0x35a04c=_0x35a04c-0x0;var _0x260778=_0x5409[_0x35a04c];return _0x260778;};'use strict';var EventEmitter=require(_0x9540('0x0'));var WhatsappAccount=require(_0x9540('0x1'))['db'][_0x9540('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x9540('0x3')](0x0);var events={'afterCreate':_0x9540('0x4'),'afterUpdate':'update','afterDestroy':_0x9540('0x5')};function emitEvent(_0x4203f7){return function(_0x2cc6c7,_0x2d0694,_0x241ff6){WhatsappAccountEvents[_0x9540('0x6')](_0x4203f7+':'+_0x2cc6c7['id'],_0x2cc6c7);WhatsappAccountEvents[_0x9540('0x6')](_0x4203f7,_0x2cc6c7);_0x241ff6(null);};}for(var e in events){if(events[_0x9540('0x7')](e)){var event=events[e];WhatsappAccount[_0x9540('0x8')](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index bdc1a2a..66f20ff 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 _0xe13b=['bluebird','request-promise','path','rimraf','./whatsappAccount.attributes','exports','WhatsappAccount','whatsapp_accounts','util'];(function(_0x4332b4,_0x412874){var _0x2e063d=function(_0x57801f){while(--_0x57801f){_0x4332b4['push'](_0x4332b4['shift']());}};_0x2e063d(++_0x412874);}(_0xe13b,0x86));var _0xbe13=function(_0x55257d,_0x3bdecf){_0x55257d=_0x55257d-0x0;var _0x5c3c46=_0xe13b[_0x55257d];return _0x5c3c46;};'use strict';var _=require('lodash');var util=require(_0xbe13('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xbe13('0x1'));var rp=require(_0xbe13('0x2'));var fs=require('fs');var path=require(_0xbe13('0x3'));var rimraf=require(_0xbe13('0x4'));var config=require('../../config/environment');var attributes=require(_0xbe13('0x5'));module[_0xbe13('0x6')]=function(_0x3a9ca1,_0x2942ae){return _0x3a9ca1['define'](_0xbe13('0x7'),attributes,{'tableName':_0xbe13('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x55eb=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappAccount.attributes','exports','define','WhatsappAccount','whatsapp_accounts','lodash'];(function(_0x5b848c,_0x4602d0){var _0x32bd45=function(_0x1f8d5a){while(--_0x1f8d5a){_0x5b848c['push'](_0x5b848c['shift']());}};_0x32bd45(++_0x4602d0);}(_0x55eb,0xe0));var _0xb55e=function(_0x187d17,_0x3b5b56){_0x187d17=_0x187d17-0x0;var _0x15dbb3=_0x55eb[_0x187d17];return _0x15dbb3;};'use strict';var _=require(_0xb55e('0x0'));var util=require(_0xb55e('0x1'));var logger=require(_0xb55e('0x2'))(_0xb55e('0x3'));var moment=require(_0xb55e('0x4'));var BPromise=require(_0xb55e('0x5'));var rp=require(_0xb55e('0x6'));var fs=require('fs');var path=require(_0xb55e('0x7'));var rimraf=require(_0xb55e('0x8'));var config=require(_0xb55e('0x9'));var attributes=require(_0xb55e('0xa'));module[_0xb55e('0xb')]=function(_0x28e27e,_0x4c103a){return _0x28e27e[_0xb55e('0xc')](_0xb55e('0xd'),attributes,{'tableName':_0xb55e('0xe'),'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 05f86ad..0cca2df 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 _0x563f=['debug','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','then','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappAccount,\x20%s,\x20%s','message','info','result','catch','WhatsappAccount','find','options','where','attributes','include','map','model','ShowWhatsappAccount'];(function(_0x1a9f6f,_0x73e636){var _0x38ae40=function(_0x1956c5){while(--_0x1956c5){_0x1a9f6f['push'](_0x1a9f6f['shift']());}};_0x38ae40(++_0x73e636);}(_0x563f,0x121));var _0xf563=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x563f[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0xf563('0x0'));var util=require(_0xf563('0x1'));var moment=require('moment');var BPromise=require(_0xf563('0x2'));var rs=require(_0xf563('0x3'));var fs=require('fs');var Redis=require(_0xf563('0x4'));var db=require(_0xf563('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf563('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf563('0x7'));var client=jayson['client'][_0xf563('0x8')]({'port':0x232a});config[_0xf563('0x9')]=_[_0xf563('0xa')](config[_0xf563('0x9')],{'host':_0xf563('0xb'),'port':0x18eb});var socket=require(_0xf563('0xc'))(new Redis(config['redis']));require(_0xf563('0xd'))[_0xf563('0xe')](socket);function respondWithRpcPromise(_0x226d9f,_0xbe51c8,_0x199b92){return new BPromise(function(_0xddcba5,_0x3596eb){return client['request'](_0x226d9f,_0x199b92)[_0xf563('0xf')](function(_0x55c038){logger['info']('WhatsappAccount,\x20%s,\x20%s',_0xbe51c8,_0xf563('0x10'));logger['debug'](_0xf563('0x11'),_0xbe51c8,_0xf563('0x10'),JSON[_0xf563('0x12')](_0x55c038));if(_0x55c038['error']){if(_0x55c038[_0xf563('0x13')][_0xf563('0x14')]===0x1f4){logger['error'](_0xf563('0x15'),_0xbe51c8,_0x55c038[_0xf563('0x13')][_0xf563('0x16')]);return _0x3596eb(_0x55c038[_0xf563('0x13')][_0xf563('0x16')]);}logger[_0xf563('0x13')](_0xf563('0x15'),_0xbe51c8,_0x55c038['error']['message']);return _0xddcba5(_0x55c038[_0xf563('0x13')][_0xf563('0x16')]);}else{logger[_0xf563('0x17')](_0xf563('0x15'),_0xbe51c8,_0xf563('0x10'));_0xddcba5(_0x55c038[_0xf563('0x18')][_0xf563('0x16')]);}})[_0xf563('0x19')](function(_0x414d02){logger[_0xf563('0x13')](_0xf563('0x15'),_0xbe51c8,_0x414d02);_0x3596eb(_0x414d02);});});}exports['ShowWhatsappAccount']=function(_0x4df2c0){var _0x98f6d0=this;return new Promise(function(_0x3930c6,_0x58dc05){return db[_0xf563('0x1a')][_0xf563('0x1b')]({'raw':_0x4df2c0[_0xf563('0x1c')]?_0x4df2c0[_0xf563('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x4df2c0[_0xf563('0x1c')]?_0x4df2c0[_0xf563('0x1c')][_0xf563('0x1d')]||null:null,'attributes':_0x4df2c0[_0xf563('0x1c')]?_0x4df2c0[_0xf563('0x1c')][_0xf563('0x1e')]||null:null,'include':_0x4df2c0[_0xf563('0x1c')]?_0x4df2c0[_0xf563('0x1c')][_0xf563('0x1f')]?_[_0xf563('0x20')](_0x4df2c0[_0xf563('0x1c')][_0xf563('0x1f')],function(_0x1e9ee5){return{'model':db[_0x1e9ee5[_0xf563('0x21')]],'as':_0x1e9ee5['as'],'attributes':_0x1e9ee5[_0xf563('0x1e')],'include':_0x1e9ee5[_0xf563('0x1f')]?_['map'](_0x1e9ee5['include'],function(_0x1cea1a){return{'model':db[_0x1cea1a['model']],'as':_0x1cea1a['as'],'attributes':_0x1cea1a[_0xf563('0x1e')],'include':_0x1cea1a['include']?_[_0xf563('0x20')](_0x1cea1a['include'],function(_0x521c5c){return{'model':db[_0x521c5c['model']],'as':_0x521c5c['as'],'attributes':_0x521c5c[_0xf563('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xf563('0xf')](function(_0x4bb967){logger['info'](_0xf563('0x22'),_0x4df2c0);logger[_0xf563('0x23')](_0xf563('0x22'),_0x4df2c0,JSON[_0xf563('0x12')](_0x4bb967));_0x3930c6(_0x4bb967);})['catch'](function(_0x5cd572){logger[_0xf563('0x13')]('ShowWhatsappAccount',_0x5cd572[_0xf563('0x16')],_0x4df2c0);_0x58dc05(_0x98f6d0[_0xf563('0x13')](0x1f4,_0x5cd572[_0xf563('0x16')]));});});}; \ No newline at end of file +var _0x0f4b=['model','map','ShowWhatsappAccount','stringify','catch','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./whatsappAccount.socket','request','then','info','WhatsappAccount,\x20%s,\x20%s','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','find','options','raw','where','attributes','include'];(function(_0x2f8819,_0xebcf42){var _0x37181f=function(_0x17c832){while(--_0x17c832){_0x2f8819['push'](_0x2f8819['shift']());}};_0x37181f(++_0xebcf42);}(_0x0f4b,0x1a9));var _0xb0f4=function(_0x1e150d,_0x140399){_0x1e150d=_0x1e150d-0x0;var _0x47b858=_0x0f4b[_0x1e150d];return _0x47b858;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb0f4('0x0'));var BPromise=require(_0xb0f4('0x1'));var rs=require(_0xb0f4('0x2'));var fs=require('fs');var Redis=require(_0xb0f4('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb0f4('0x4'))(_0xb0f4('0x5'));var config=require(_0xb0f4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xb0f4('0x7')][_0xb0f4('0x8')]({'port':0x232a});config[_0xb0f4('0x9')]=_[_0xb0f4('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xb0f4('0xb'))(new Redis(config[_0xb0f4('0x9')]));require(_0xb0f4('0xc'))['register'](socket);function respondWithRpcPromise(_0x54de2e,_0x511ab8,_0x2b832a){return new BPromise(function(_0x3ded44,_0x54f19b){return client[_0xb0f4('0xd')](_0x54de2e,_0x2b832a)[_0xb0f4('0xe')](function(_0x23e798){logger[_0xb0f4('0xf')](_0xb0f4('0x10'),_0x511ab8,'request\x20sent');logger[_0xb0f4('0x11')](_0xb0f4('0x12'),_0x511ab8,_0xb0f4('0x13'),JSON['stringify'](_0x23e798));if(_0x23e798[_0xb0f4('0x14')]){if(_0x23e798[_0xb0f4('0x14')][_0xb0f4('0x15')]===0x1f4){logger[_0xb0f4('0x14')](_0xb0f4('0x10'),_0x511ab8,_0x23e798[_0xb0f4('0x14')][_0xb0f4('0x16')]);return _0x54f19b(_0x23e798[_0xb0f4('0x14')][_0xb0f4('0x16')]);}logger['error'](_0xb0f4('0x10'),_0x511ab8,_0x23e798[_0xb0f4('0x14')][_0xb0f4('0x16')]);return _0x3ded44(_0x23e798['error']['message']);}else{logger['info'](_0xb0f4('0x10'),_0x511ab8,_0xb0f4('0x13'));_0x3ded44(_0x23e798[_0xb0f4('0x17')]['message']);}})['catch'](function(_0xc221f6){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x511ab8,_0xc221f6);_0x54f19b(_0xc221f6);});});}exports['ShowWhatsappAccount']=function(_0x314611){var _0x2ae717=this;return new Promise(function(_0x20d87c,_0x1c8a80){return db['WhatsappAccount'][_0xb0f4('0x18')]({'raw':_0x314611[_0xb0f4('0x19')]?_0x314611[_0xb0f4('0x19')][_0xb0f4('0x1a')]===undefined?!![]:![]:!![],'where':_0x314611['options']?_0x314611[_0xb0f4('0x19')][_0xb0f4('0x1b')]||null:null,'attributes':_0x314611[_0xb0f4('0x19')]?_0x314611['options'][_0xb0f4('0x1c')]||null:null,'include':_0x314611[_0xb0f4('0x19')]?_0x314611['options'][_0xb0f4('0x1d')]?_['map'](_0x314611[_0xb0f4('0x19')][_0xb0f4('0x1d')],function(_0x40fe61){return{'model':db[_0x40fe61[_0xb0f4('0x1e')]],'as':_0x40fe61['as'],'attributes':_0x40fe61[_0xb0f4('0x1c')],'include':_0x40fe61[_0xb0f4('0x1d')]?_[_0xb0f4('0x1f')](_0x40fe61[_0xb0f4('0x1d')],function(_0x164f9c){return{'model':db[_0x164f9c[_0xb0f4('0x1e')]],'as':_0x164f9c['as'],'attributes':_0x164f9c['attributes'],'include':_0x164f9c[_0xb0f4('0x1d')]?_[_0xb0f4('0x1f')](_0x164f9c[_0xb0f4('0x1d')],function(_0x25ff00){return{'model':db[_0x25ff00[_0xb0f4('0x1e')]],'as':_0x25ff00['as'],'attributes':_0x25ff00[_0xb0f4('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x123e1e){logger[_0xb0f4('0xf')](_0xb0f4('0x20'),_0x314611);logger['debug'](_0xb0f4('0x20'),_0x314611,JSON[_0xb0f4('0x21')](_0x123e1e));_0x20d87c(_0x123e1e);})[_0xb0f4('0x22')](function(_0x1fa8b2){logger[_0xb0f4('0x14')](_0xb0f4('0x20'),_0x1fa8b2[_0xb0f4('0x16')],_0x314611);_0x1c8a80(_0x2ae717[_0xb0f4('0x14')](0x1f4,_0x1fa8b2[_0xb0f4('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index e50423c..f9374ef 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 _0xd20a=['length','whatsappAccount:','./whatsappAccount.events','save','emit','removeListener'];(function(_0x2def85,_0x39b650){var _0x12ce04=function(_0x150aa1){while(--_0x150aa1){_0x2def85['push'](_0x2def85['shift']());}};_0x12ce04(++_0x39b650);}(_0xd20a,0x8c));var _0xad20=function(_0xd6d419,_0x38cf73){_0xd6d419=_0xd6d419-0x0;var _0x3a8aed=_0xd20a[_0xd6d419];return _0x3a8aed;};'use strict';var WhatsappAccountEvents=require(_0xad20('0x0'));var events=[_0xad20('0x1'),'remove','update'];function createListener(_0x4fb1e4,_0x194d89){return function(_0x522cd3){_0x194d89[_0xad20('0x2')](_0x4fb1e4,_0x522cd3);};}function removeListener(_0x3c9cf0,_0x21a922){return function(){WhatsappAccountEvents[_0xad20('0x3')](_0x3c9cf0,_0x21a922);};}exports['register']=function(_0x15571e){for(var _0x419eba=0x0,_0x241aad=events[_0xad20('0x4')];_0x419eba<_0x241aad;_0x419eba++){var _0x83e024=events[_0x419eba];var _0x51114e=createListener(_0xad20('0x5')+_0x83e024,_0x15571e);WhatsappAccountEvents['on'](_0x83e024,_0x51114e);}}; \ No newline at end of file +var _0x9471=['remove','update','emit','removeListener','register','length','whatsappAccount:','./whatsappAccount.events','save'];(function(_0x17a2c4,_0x2363ef){var _0x212e21=function(_0x4dfa18){while(--_0x4dfa18){_0x17a2c4['push'](_0x17a2c4['shift']());}};_0x212e21(++_0x2363ef);}(_0x9471,0x127));var _0x1947=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9471[_0x3dd15e];return _0x231fd0;};'use strict';var WhatsappAccountEvents=require(_0x1947('0x0'));var events=[_0x1947('0x1'),_0x1947('0x2'),_0x1947('0x3')];function createListener(_0x4bdfe4,_0x55756f){return function(_0x5ad77b){_0x55756f[_0x1947('0x4')](_0x4bdfe4,_0x5ad77b);};}function removeListener(_0x166a47,_0x8207fd){return function(){WhatsappAccountEvents[_0x1947('0x5')](_0x166a47,_0x8207fd);};}exports[_0x1947('0x6')]=function(_0x61bb09){for(var _0x81e53a=0x0,_0x1faadf=events[_0x1947('0x7')];_0x81e53a<_0x1faadf;_0x81e53a++){var _0x33f064=events[_0x81e53a];var _0x21dfc2=createListener(_0x1947('0x8')+_0x33f064,_0x61bb09);WhatsappAccountEvents['on'](_0x33f064,_0x21dfc2);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index eecb656..0ace5be 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 _0x981e=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated','index','/:id','show','post','create','destroy','exports','multer','util','path','connect-timeout'];(function(_0x160895,_0x142072){var _0x5238f3=function(_0x539f68){while(--_0x539f68){_0x160895['push'](_0x160895['shift']());}};_0x5238f3(++_0x142072);}(_0x981e,0x1dc));var _0xe981=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x981e[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xe981('0x0'));var util=require(_0xe981('0x1'));var path=require(_0xe981('0x2'));var timeout=require(_0xe981('0x3'));var express=require(_0xe981('0x4'));var router=express[_0xe981('0x5')]();var fs_extra=require(_0xe981('0x6'));var auth=require(_0xe981('0x7'));var interaction=require(_0xe981('0x8'));var config=require(_0xe981('0x9'));var controller=require(_0xe981('0xa'));router[_0xe981('0xb')]('/',auth[_0xe981('0xc')](),controller[_0xe981('0xd')]);router['get'](_0xe981('0xe'),auth[_0xe981('0xc')](),controller[_0xe981('0xf')]);router[_0xe981('0x10')]('/',auth[_0xe981('0xc')](),controller[_0xe981('0x11')]);router['put'](_0xe981('0xe'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0xe981('0xc')](),controller[_0xe981('0x12')]);module[_0xe981('0x13')]=router; \ No newline at end of file +var _0xbf22=['../../components/interaction/service','./whatsappApplication.controller','get','index','/:id','show','post','isAuthenticated','create','put','update','exports','multer','util','path','express','fs-extra'];(function(_0xdd2bfa,_0x5bd304){var _0x55397e=function(_0x196f7d){while(--_0x196f7d){_0xdd2bfa['push'](_0xdd2bfa['shift']());}};_0x55397e(++_0x5bd304);}(_0xbf22,0xc7));var _0x2bf2=function(_0x2ce08e,_0x572c37){_0x2ce08e=_0x2ce08e-0x0;var _0xc39a83=_0xbf22[_0x2ce08e];return _0xc39a83;};'use strict';var multer=require(_0x2bf2('0x0'));var util=require(_0x2bf2('0x1'));var path=require(_0x2bf2('0x2'));var timeout=require('connect-timeout');var express=require(_0x2bf2('0x3'));var router=express['Router']();var fs_extra=require(_0x2bf2('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2bf2('0x5'));var config=require('../../config/environment');var controller=require(_0x2bf2('0x6'));router[_0x2bf2('0x7')]('/',auth['isAuthenticated'](),controller[_0x2bf2('0x8')]);router[_0x2bf2('0x7')](_0x2bf2('0x9'),auth['isAuthenticated'](),controller[_0x2bf2('0xa')]);router[_0x2bf2('0xb')]('/',auth[_0x2bf2('0xc')](),controller[_0x2bf2('0xd')]);router[_0x2bf2('0xe')](_0x2bf2('0x9'),auth['isAuthenticated'](),controller[_0x2bf2('0xf')]);router['delete'](_0x2bf2('0x9'),auth[_0x2bf2('0xc')](),controller['destroy']);module[_0x2bf2('0x10')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 8c42b9e..8ed8fb2 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 _0x188a=['*,*,*,*','sequelize','exports','STRING','noop','TEXT'];(function(_0x536eca,_0x18b615){var _0x28f35f=function(_0x34bbbe){while(--_0x34bbbe){_0x536eca['push'](_0x536eca['shift']());}};_0x28f35f(++_0x18b615);}(_0x188a,0xe5));var _0xa188=function(_0x42b900,_0x7b9643){_0x42b900=_0x42b900-0x0;var _0x5aa7f3=_0x188a[_0x42b900];return _0x5aa7f3;};'use strict';var Sequelize=require(_0xa188('0x0'));module[_0xa188('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xa188('0x2')],'allowNull':![],'defaultValue':_0xa188('0x3')},'appdata':{'type':Sequelize[_0xa188('0x4')]()},'description':{'type':Sequelize[_0xa188('0x2')]},'interval':{'type':Sequelize[_0xa188('0x2')],'defaultValue':_0xa188('0x5')}}; \ No newline at end of file +var _0xf98b=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x5c1de9,_0x16b37a){var _0x452529=function(_0x42a23b){while(--_0x42a23b){_0x5c1de9['push'](_0x5c1de9['shift']());}};_0x452529(++_0x16b37a);}(_0xf98b,0xe9));var _0xbf98=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0xf98b[_0x2b7764];return _0x848dcb;};'use strict';var Sequelize=require(_0xbf98('0x0'));module[_0xbf98('0x1')]={'priority':{'type':Sequelize[_0xbf98('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xbf98('0x3')],'allowNull':![],'defaultValue':_0xbf98('0x4')},'appdata':{'type':Sequelize[_0xbf98('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xbf98('0x3')],'defaultValue':_0xbf98('0x6')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 155c231..0b12baa 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 _0xa24d=['rawAttributes','includeAll','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','stack','name','index','map','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','where','type','WhatsappApplication','include','findAll','rows','catch','show','params'];(function(_0x229bdf,_0x4c4218){var _0x197bd5=function(_0x4e9eb8){while(--_0x4e9eb8){_0x229bdf['push'](_0x229bdf['shift']());}};_0x197bd5(++_0x4c4218);}(_0xa24d,0x1c1));var _0xda24=function(_0x299e1e,_0x20eab5){_0x299e1e=_0x299e1e-0x0;var _0x3757dc=_0xa24d[_0x299e1e];return _0x3757dc;};'use strict';var emlformat=require(_0xda24('0x0'));var rimraf=require(_0xda24('0x1'));var zipdir=require(_0xda24('0x2'));var jsonpatch=require(_0xda24('0x3'));var rp=require(_0xda24('0x4'));var moment=require(_0xda24('0x5'));var BPromise=require(_0xda24('0x6'));var Mustache=require('mustache');var util=require(_0xda24('0x7'));var path=require(_0xda24('0x8'));var sox=require(_0xda24('0x9'));var csv=require(_0xda24('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xda24('0xb'));var _=require(_0xda24('0xc'));var squel=require('squel');var crypto=require(_0xda24('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xda24('0xe'));var toCsv=require(_0xda24('0xa'));var querystring=require(_0xda24('0xf'));var Papa=require(_0xda24('0x10'));var Redis=require('ioredis');var authService=require(_0xda24('0x11'));var qs=require(_0xda24('0x12'));var as=require(_0xda24('0x13'));var hardwareService=require(_0xda24('0x14'));var logger=require(_0xda24('0x15'))('api');var utils=require(_0xda24('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xda24('0x17'));var db=require(_0xda24('0x18'))['db'];function respondWithStatusCode(_0x519fb9,_0x54b23d){_0x54b23d=_0x54b23d||0xcc;return function(_0x2e3505){if(_0x2e3505){return _0x519fb9[_0xda24('0x19')](_0x54b23d);}return _0x519fb9[_0xda24('0x1a')](_0x54b23d)[_0xda24('0x1b')]();};}function respondWithResult(_0x4f34a4,_0xef067b){_0xef067b=_0xef067b||0xc8;return function(_0x53dadc){if(_0x53dadc){return _0x4f34a4[_0xda24('0x1a')](_0xef067b)[_0xda24('0x1c')](_0x53dadc);}};}function respondWithFilteredResult(_0x57f4d6,_0x547e1c){return function(_0x53749f){if(_0x53749f){var _0x26764=typeof _0x547e1c[_0xda24('0x1d')]===_0xda24('0x1e')&&typeof _0x547e1c[_0xda24('0x1f')]===_0xda24('0x1e');var _0x8f6c65=_0x53749f[_0xda24('0x20')];var _0x847878=_0x26764?0x0:_0x547e1c['offset'];var _0x22b57d=_0x26764?_0x53749f[_0xda24('0x20')]:_0x547e1c['offset']+_0x547e1c[_0xda24('0x1f')];var _0x510b07;if(_0x22b57d>=_0x8f6c65){_0x22b57d=_0x8f6c65;_0x510b07=0xc8;}else{_0x510b07=0xce;}_0x57f4d6['status'](_0x510b07);return _0x57f4d6[_0xda24('0x21')](_0xda24('0x22'),_0x847878+'-'+_0x22b57d+'/'+_0x8f6c65)[_0xda24('0x1c')](_0x53749f);}return null;};}function patchUpdates(_0x46cb50){return function(_0x3cdeb5){try{jsonpatch[_0xda24('0x23')](_0x3cdeb5,_0x46cb50,!![]);}catch(_0xc7fab5){return BPromise['reject'](_0xc7fab5);}return _0x3cdeb5[_0xda24('0x24')]();};}function saveUpdates(_0x5f53a3,_0x232df2){return function(_0x2fdf18){if(_0x2fdf18){return _0x2fdf18[_0xda24('0x25')](_0x5f53a3)[_0xda24('0x26')](function(_0x17c573){return _0x17c573;});}return null;};}function removeEntity(_0x2f9ae2,_0x454d04){return function(_0xd74f8d){if(_0xd74f8d){return _0xd74f8d[_0xda24('0x27')]()[_0xda24('0x26')](function(){_0x2f9ae2[_0xda24('0x1a')](0xcc)[_0xda24('0x1b')]();});}};}function handleEntityNotFound(_0x5edfc0,_0x468647){return function(_0x30e886){if(!_0x30e886){_0x5edfc0[_0xda24('0x19')](0x194);}return _0x30e886;};}function handleError(_0x35ff0f,_0x196304){_0x196304=_0x196304||0x1f4;return function(_0x3f666b){logger['error'](_0x3f666b[_0xda24('0x28')]);if(_0x3f666b['name']){delete _0x3f666b[_0xda24('0x29')];}_0x35ff0f[_0xda24('0x1a')](_0x196304)['send'](_0x3f666b);};}exports[_0xda24('0x2a')]=function(_0xd6d60f,_0x49a311){var _0x40487d={},_0xc98aa2={},_0x9a6911={'count':0x0,'rows':[]};var _0x11ffb5=_[_0xda24('0x2b')](db['WhatsappApplication']['rawAttributes'],function(_0x20f60d){return{'name':_0x20f60d['fieldName'],'type':_0x20f60d['type'][_0xda24('0x2c')]};});_0xc98aa2[_0xda24('0x2d')]=_['map'](_0x11ffb5,'name');_0xc98aa2[_0xda24('0x2e')]=_[_0xda24('0x2f')](_0xd6d60f['query']);_0xc98aa2['filters']=_[_0xda24('0x30')](_0xc98aa2[_0xda24('0x2d')],_0xc98aa2[_0xda24('0x2e')]);_0x40487d[_0xda24('0x31')]=_[_0xda24('0x30')](_0xc98aa2['model'],qs[_0xda24('0x32')](_0xd6d60f[_0xda24('0x2e')][_0xda24('0x32')]));_0x40487d[_0xda24('0x31')]=_0x40487d['attributes'][_0xda24('0x33')]?_0x40487d['attributes']:_0xc98aa2[_0xda24('0x2d')];if(!_0xd6d60f[_0xda24('0x2e')][_0xda24('0x34')](_0xda24('0x35'))){_0x40487d[_0xda24('0x1f')]=qs['limit'](_0xd6d60f[_0xda24('0x2e')][_0xda24('0x1f')]);_0x40487d[_0xda24('0x1d')]=qs[_0xda24('0x1d')](_0xd6d60f[_0xda24('0x2e')]['offset']);}_0x40487d[_0xda24('0x36')]=qs[_0xda24('0x37')](_0xd6d60f['query']['sort']);_0x40487d['where']=qs[_0xda24('0x38')](_[_0xda24('0x39')](_0xd6d60f[_0xda24('0x2e')],_0xc98aa2[_0xda24('0x38')]),_0x11ffb5);if(_0xd6d60f[_0xda24('0x2e')][_0xda24('0x3a')]){_0x40487d['where']=_[_0xda24('0x3b')](_0x40487d[_0xda24('0x3c')],{'$or':_[_0xda24('0x2b')](_0x11ffb5,function(_0x5aa0aa){if(_0x5aa0aa[_0xda24('0x3d')]!=='VIRTUAL'){var _0x25d0cd={};_0x25d0cd[_0x5aa0aa['name']]={'$like':'%'+_0xd6d60f[_0xda24('0x2e')]['filter']+'%'};return _0x25d0cd;}})});}_0x40487d=_[_0xda24('0x3b')]({},_0x40487d,_0xd6d60f['options']);var _0x5e81e8={'where':_0x40487d[_0xda24('0x3c')]};return db[_0xda24('0x3e')][_0xda24('0x20')](_0x5e81e8)[_0xda24('0x26')](function(_0x46c18b){_0x9a6911[_0xda24('0x20')]=_0x46c18b;if(_0xd6d60f[_0xda24('0x2e')]['includeAll']){_0x40487d[_0xda24('0x3f')]=[{'all':!![]}];}return db[_0xda24('0x3e')][_0xda24('0x40')](_0x40487d);})[_0xda24('0x26')](function(_0xe42050){_0x9a6911[_0xda24('0x41')]=_0xe42050;return _0x9a6911;})[_0xda24('0x26')](respondWithFilteredResult(_0x49a311,_0x40487d))[_0xda24('0x42')](handleError(_0x49a311,null));};exports[_0xda24('0x43')]=function(_0x1aa0eb,_0x4aea76){var _0x3e6597={'raw':!![],'where':{'id':_0x1aa0eb[_0xda24('0x44')]['id']}},_0x61f885={};_0x61f885[_0xda24('0x2d')]=_['keys'](db[_0xda24('0x3e')][_0xda24('0x45')]);_0x61f885['query']=_['keys'](_0x1aa0eb['query']);_0x61f885['filters']=_['intersection'](_0x61f885['model'],_0x61f885[_0xda24('0x2e')]);_0x3e6597[_0xda24('0x31')]=_[_0xda24('0x30')](_0x61f885[_0xda24('0x2d')],qs[_0xda24('0x32')](_0x1aa0eb['query'][_0xda24('0x32')]));_0x3e6597[_0xda24('0x31')]=_0x3e6597[_0xda24('0x31')][_0xda24('0x33')]?_0x3e6597['attributes']:_0x61f885[_0xda24('0x2d')];if(_0x1aa0eb[_0xda24('0x2e')][_0xda24('0x46')]){_0x3e6597[_0xda24('0x3f')]=[{'all':!![]}];}_0x3e6597=_[_0xda24('0x3b')]({},_0x3e6597,_0x1aa0eb['options']);return db['WhatsappApplication'][_0xda24('0x47')](_0x3e6597)[_0xda24('0x26')](handleEntityNotFound(_0x4aea76,null))[_0xda24('0x26')](respondWithResult(_0x4aea76,null))[_0xda24('0x42')](handleError(_0x4aea76,null));};exports[_0xda24('0x48')]=function(_0x37a834,_0xcfcbd5){return db['WhatsappApplication'][_0xda24('0x48')](_0x37a834[_0xda24('0x49')],{})['then'](respondWithResult(_0xcfcbd5,0xc9))['catch'](handleError(_0xcfcbd5,null));};exports[_0xda24('0x25')]=function(_0x2eb12b,_0x302e2b){if(_0x2eb12b['body']['id']){delete _0x2eb12b[_0xda24('0x49')]['id'];}return db[_0xda24('0x3e')][_0xda24('0x47')]({'where':{'id':_0x2eb12b['params']['id']}})[_0xda24('0x26')](handleEntityNotFound(_0x302e2b,null))[_0xda24('0x26')](saveUpdates(_0x2eb12b['body'],null))[_0xda24('0x26')](respondWithResult(_0x302e2b,null))[_0xda24('0x42')](handleError(_0x302e2b,null));};exports[_0xda24('0x27')]=function(_0x264eb0,_0x2f87b7){return db['WhatsappApplication'][_0xda24('0x47')]({'where':{'id':_0x264eb0[_0xda24('0x44')]['id']}})[_0xda24('0x26')](handleEntityNotFound(_0x2f87b7,null))[_0xda24('0x26')](removeEntity(_0x2f87b7,null))['catch'](handleError(_0x2f87b7,null));}; \ No newline at end of file +var _0x7a54=['offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','WhatsappApplication','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x4d585e,_0x31afc5){var _0x1a3b23=function(_0x4816e0){while(--_0x4816e0){_0x4d585e['push'](_0x4d585e['shift']());}};_0x1a3b23(++_0x31afc5);}(_0x7a54,0x106));var _0x47a5=function(_0x55a289,_0x5f29ed){_0x55a289=_0x55a289-0x0;var _0xc11419=_0x7a54[_0x55a289];return _0xc11419;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['WhatsappApplication'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['WhatsappApplication']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['WhatsappApplication']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index a1637d2..0f5e749 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 _0x47c7=['api','bluebird','request-promise','rimraf','../../config/environment','./whatsappApplication.attributes','exports','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger'];(function(_0x2bfd4f,_0x1bbf2c){var _0x341849=function(_0x4c246e){while(--_0x4c246e){_0x2bfd4f['push'](_0x2bfd4f['shift']());}};_0x341849(++_0x1bbf2c);}(_0x47c7,0x1ab));var _0x747c=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0x47c7[_0x5c2e3e];return _0x53f64a;};'use strict';var _=require(_0x747c('0x0'));var util=require('util');var logger=require(_0x747c('0x1'))(_0x747c('0x2'));var moment=require('moment');var BPromise=require(_0x747c('0x3'));var rp=require(_0x747c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x747c('0x5'));var config=require(_0x747c('0x6'));var attributes=require(_0x747c('0x7'));module[_0x747c('0x8')]=function(_0x5e991e,_0xa1148a){return _0x5e991e['define'](_0x747c('0x9'),attributes,{'tableName':_0x747c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x747c('0xb'),'collate':_0x747c('0xc')});}; \ No newline at end of file +var _0x4b19=['utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','request-promise','path','rimraf','./whatsappApplication.attributes','exports','define','whatsapp_applications'];(function(_0x126fb9,_0x122c59){var _0xc8a3b1=function(_0x355744){while(--_0x355744){_0x126fb9['push'](_0x126fb9['shift']());}};_0xc8a3b1(++_0x122c59);}(_0x4b19,0x195));var _0x94b1=function(_0x59835f,_0x495f32){_0x59835f=_0x59835f-0x0;var _0x3af3ee=_0x4b19[_0x59835f];return _0x3af3ee;};'use strict';var _=require(_0x94b1('0x0'));var util=require('util');var logger=require(_0x94b1('0x1'))(_0x94b1('0x2'));var moment=require(_0x94b1('0x3'));var BPromise=require('bluebird');var rp=require(_0x94b1('0x4'));var fs=require('fs');var path=require(_0x94b1('0x5'));var rimraf=require(_0x94b1('0x6'));var config=require('../../config/environment');var attributes=require(_0x94b1('0x7'));module[_0x94b1('0x8')]=function(_0x52d6c1,_0x24df76){return _0x52d6c1[_0x94b1('0x9')]('WhatsappApplication',attributes,{'tableName':_0x94b1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x94b1('0xb'),'collate':_0x94b1('0xc')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index fed4778..10ff848 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 _0xbd50=['WhatsappApplication,\x20%s,\x20%s','request\x20sent','WhatsappApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xbd50,0x196));var _0x0bd5=function(_0x2a781c,_0x21831e){_0x2a781c=_0x2a781c-0x0;var _0x4cb263=_0xbd50[_0x2a781c];return _0x4cb263;};'use strict';var _=require(_0x0bd5('0x0'));var util=require(_0x0bd5('0x1'));var moment=require(_0x0bd5('0x2'));var BPromise=require('bluebird');var rs=require(_0x0bd5('0x3'));var fs=require('fs');var Redis=require(_0x0bd5('0x4'));var db=require(_0x0bd5('0x5'))['db'];var utils=require(_0x0bd5('0x6'));var logger=require(_0x0bd5('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0bd5('0x8')][_0x0bd5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xcc6cfa,_0x2c0db1,_0x1b99f3){return new BPromise(function(_0x5ebe64,_0x47e78d){return client[_0x0bd5('0xa')](_0xcc6cfa,_0x1b99f3)[_0x0bd5('0xb')](function(_0x259f4c){logger['info'](_0x0bd5('0xc'),_0x2c0db1,_0x0bd5('0xd'));logger['debug'](_0x0bd5('0xe'),_0x2c0db1,_0x0bd5('0xd'),JSON['stringify'](_0x259f4c));if(_0x259f4c[_0x0bd5('0xf')]){if(_0x259f4c[_0x0bd5('0xf')][_0x0bd5('0x10')]===0x1f4){logger['error'](_0x0bd5('0xc'),_0x2c0db1,_0x259f4c[_0x0bd5('0xf')][_0x0bd5('0x11')]);return _0x47e78d(_0x259f4c[_0x0bd5('0xf')][_0x0bd5('0x11')]);}logger[_0x0bd5('0xf')](_0x0bd5('0xc'),_0x2c0db1,_0x259f4c[_0x0bd5('0xf')]['message']);return _0x5ebe64(_0x259f4c[_0x0bd5('0xf')][_0x0bd5('0x11')]);}else{logger['info'](_0x0bd5('0xc'),_0x2c0db1,_0x0bd5('0xd'));_0x5ebe64(_0x259f4c[_0x0bd5('0x12')][_0x0bd5('0x11')]);}})['catch'](function(_0x14f32c){logger[_0x0bd5('0xf')](_0x0bd5('0xc'),_0x2c0db1,_0x14f32c);_0x47e78d(_0x14f32c);});});} \ No newline at end of file +var _0x54ef=['result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message'];(function(_0x4d9e21,_0x55793d){var _0x1c58e7=function(_0x37a6fe){while(--_0x37a6fe){_0x4d9e21['push'](_0x4d9e21['shift']());}};_0x1c58e7(++_0x55793d);}(_0x54ef,0x112));var _0xf54e=function(_0x355af4,_0x56fc59){_0x355af4=_0x355af4-0x0;var _0x59905d=_0x54ef[_0x355af4];return _0x59905d;};'use strict';var _=require(_0xf54e('0x0'));var util=require(_0xf54e('0x1'));var moment=require(_0xf54e('0x2'));var BPromise=require('bluebird');var rs=require(_0xf54e('0x3'));var fs=require('fs');var Redis=require(_0xf54e('0x4'));var db=require(_0xf54e('0x5'))['db'];var utils=require(_0xf54e('0x6'));var logger=require(_0xf54e('0x7'))(_0xf54e('0x8'));var config=require(_0xf54e('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf54e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x99cf9,_0x2464ae,_0x561870){return new BPromise(function(_0x27e69b,_0x57a1ce){return client[_0xf54e('0xb')](_0x99cf9,_0x561870)[_0xf54e('0xc')](function(_0x47c5e1){logger[_0xf54e('0xd')](_0xf54e('0xe'),_0x2464ae,_0xf54e('0xf'));logger[_0xf54e('0x10')]('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x2464ae,_0xf54e('0xf'),JSON[_0xf54e('0x11')](_0x47c5e1));if(_0x47c5e1[_0xf54e('0x12')]){if(_0x47c5e1[_0xf54e('0x12')]['code']===0x1f4){logger[_0xf54e('0x12')]('WhatsappApplication,\x20%s,\x20%s',_0x2464ae,_0x47c5e1['error'][_0xf54e('0x13')]);return _0x57a1ce(_0x47c5e1[_0xf54e('0x12')][_0xf54e('0x13')]);}logger[_0xf54e('0x12')]('WhatsappApplication,\x20%s,\x20%s',_0x2464ae,_0x47c5e1[_0xf54e('0x12')][_0xf54e('0x13')]);return _0x27e69b(_0x47c5e1[_0xf54e('0x12')][_0xf54e('0x13')]);}else{logger['info'](_0xf54e('0xe'),_0x2464ae,_0xf54e('0xf'));_0x27e69b(_0x47c5e1[_0xf54e('0x14')]['message']);}})['catch'](function(_0xd87020){logger[_0xf54e('0x12')](_0xf54e('0xe'),_0x2464ae,_0xd87020);_0x57a1ce(_0xd87020);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index eecf2b6..5b414be 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 _0xb091=['./whatsappInteraction.controller','isAuthenticated','index','get','describe','/:id','show','/:id/messages','getMessages','download','create','post','addMessage','/:id/tags','tracked','whatsappinteraction:addtags','addTags','put','whatsapp','whatsappinteraction:update','update','delete','whatsappinteraction:destroy','destroy','exports','util','path','connect-timeout','express','fs-extra','../../config/environment'];(function(_0x4b4a4e,_0x145653){var _0x443bf3=function(_0x2b628b){while(--_0x2b628b){_0x4b4a4e['push'](_0x4b4a4e['shift']());}};_0x443bf3(++_0x145653);}(_0xb091,0x16e));var _0x1b09=function(_0x449fe1,_0x2b7412){_0x449fe1=_0x449fe1-0x0;var _0x3cf761=_0xb091[_0x449fe1];return _0x3cf761;};'use strict';var multer=require('multer');var util=require(_0x1b09('0x0'));var path=require(_0x1b09('0x1'));var timeout=require(_0x1b09('0x2'));var express=require(_0x1b09('0x3'));var router=express['Router']();var fs_extra=require(_0x1b09('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1b09('0x5'));var controller=require(_0x1b09('0x6'));router['get']('/',auth[_0x1b09('0x7')](),controller[_0x1b09('0x8')]);router[_0x1b09('0x9')]('/describe',auth[_0x1b09('0x7')](),controller[_0x1b09('0xa')]);router[_0x1b09('0x9')](_0x1b09('0xb'),auth[_0x1b09('0x7')](),controller[_0x1b09('0xc')]);router[_0x1b09('0x9')](_0x1b09('0xd'),auth[_0x1b09('0x7')](),controller[_0x1b09('0xe')]);router[_0x1b09('0x9')]('/:id/download',auth[_0x1b09('0x7')](),controller[_0x1b09('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1b09('0x10')]);router[_0x1b09('0x11')](_0x1b09('0xd'),auth[_0x1b09('0x7')](),controller[_0x1b09('0x12')]);router[_0x1b09('0x11')](_0x1b09('0x13'),auth['isAuthenticated'](),interaction[_0x1b09('0x14')]('whatsapp',_0x1b09('0x15')),controller[_0x1b09('0x16')]);router[_0x1b09('0x17')](_0x1b09('0xb'),auth[_0x1b09('0x7')](),interaction[_0x1b09('0x14')](_0x1b09('0x18'),_0x1b09('0x19')),controller[_0x1b09('0x1a')]);router[_0x1b09('0x1b')](_0x1b09('0xb'),auth[_0x1b09('0x7')](),interaction[_0x1b09('0x14')]('whatsapp',_0x1b09('0x1c')),controller[_0x1b09('0x1d')]);router['delete']('/:id/tags',auth[_0x1b09('0x7')](),controller['removeTags']);module[_0x1b09('0x1e')]=router; \ No newline at end of file +var _0x1883=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/messages','getMessages','download','create','post','addMessage','whatsappinteraction:addtags','tracked','whatsapp','whatsappinteraction:update','update','whatsappinteraction:destroy','destroy','delete','/:id/tags','removeTags'];(function(_0x2258cd,_0x4ea1ce){var _0x5157a0=function(_0x1498ce){while(--_0x1498ce){_0x2258cd['push'](_0x2258cd['shift']());}};_0x5157a0(++_0x4ea1ce);}(_0x1883,0xab));var _0x3188=function(_0x29d743,_0x293bd5){_0x29d743=_0x29d743-0x0;var _0x5cd542=_0x1883[_0x29d743];return _0x5cd542;};'use strict';var multer=require(_0x3188('0x0'));var util=require(_0x3188('0x1'));var path=require(_0x3188('0x2'));var timeout=require(_0x3188('0x3'));var express=require(_0x3188('0x4'));var router=express[_0x3188('0x5')]();var fs_extra=require(_0x3188('0x6'));var auth=require(_0x3188('0x7'));var interaction=require(_0x3188('0x8'));var config=require(_0x3188('0x9'));var controller=require(_0x3188('0xa'));router[_0x3188('0xb')]('/',auth[_0x3188('0xc')](),controller[_0x3188('0xd')]);router[_0x3188('0xb')](_0x3188('0xe'),auth[_0x3188('0xc')](),controller['describe']);router[_0x3188('0xb')](_0x3188('0xf'),auth['isAuthenticated'](),controller[_0x3188('0x10')]);router['get'](_0x3188('0x11'),auth[_0x3188('0xc')](),controller[_0x3188('0x12')]);router[_0x3188('0xb')]('/:id/download',auth[_0x3188('0xc')](),controller[_0x3188('0x13')]);router['post']('/',auth['isAuthenticated'](),controller[_0x3188('0x14')]);router[_0x3188('0x15')](_0x3188('0x11'),auth[_0x3188('0xc')](),controller[_0x3188('0x16')]);router[_0x3188('0x15')]('/:id/tags',auth[_0x3188('0xc')](),interaction['tracked']('whatsapp',_0x3188('0x17')),controller['addTags']);router['put'](_0x3188('0xf'),auth[_0x3188('0xc')](),interaction[_0x3188('0x18')](_0x3188('0x19'),_0x3188('0x1a')),controller[_0x3188('0x1b')]);router['delete'](_0x3188('0xf'),auth[_0x3188('0xc')](),interaction[_0x3188('0x18')](_0x3188('0x19'),_0x3188('0x1c')),controller[_0x3188('0x1d')]);router[_0x3188('0x1e')](_0x3188('0x1f'),auth['isAuthenticated'](),controller[_0x3188('0x20')]);module[_0x3188('0x21')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 51d5114..b1ec3cf 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 _0x0dd6=['DATE','STRING','out','ENUM','exports','BOOLEAN'];(function(_0x5c8d83,_0x55e1fe){var _0x3f6320=function(_0x294449){while(--_0x294449){_0x5c8d83['push'](_0x5c8d83['shift']());}};_0x3f6320(++_0x55e1fe);}(_0x0dd6,0xca));var _0x60dd=function(_0x8f270,_0x2f435f){_0x8f270=_0x8f270-0x0;var _0x5446cb=_0x0dd6[_0x8f270];return _0x5446cb;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x60dd('0x0')]={'closed':{'type':Sequelize[_0x60dd('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x60dd('0x2')]},'disposition':{'type':Sequelize[_0x60dd('0x3')]},'secondDisposition':{'type':Sequelize[_0x60dd('0x3')]},'thirdDisposition':{'type':Sequelize[_0x60dd('0x3')]},'note':{'type':Sequelize[_0x60dd('0x3')]},'phone':{'type':Sequelize[_0x60dd('0x3')]},'read1stAt':{'type':Sequelize[_0x60dd('0x2')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x60dd('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x60dd('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x60dd('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0xfd8f=['moment','BOOLEAN','DATE','STRING','ENUM','out','sequelize'];(function(_0x5af59e,_0x3771c1){var _0x4240df=function(_0x2267fd){while(--_0x2267fd){_0x5af59e['push'](_0x5af59e['shift']());}};_0x4240df(++_0x3771c1);}(_0xfd8f,0xae));var _0xffd8=function(_0x18db97,_0x1b13cf){_0x18db97=_0x18db97-0x0;var _0x3f6612=_0xfd8f[_0x18db97];return _0x3f6612;};'use strict';var Sequelize=require(_0xffd8('0x0'));var moment=require(_0xffd8('0x1'));module['exports']={'closed':{'type':Sequelize[_0xffd8('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xffd8('0x3')]},'disposition':{'type':Sequelize[_0xffd8('0x4')]},'secondDisposition':{'type':Sequelize[_0xffd8('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xffd8('0x4')]},'phone':{'type':Sequelize[_0xffd8('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xffd8('0x5')]('in',_0xffd8('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xffd8('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xffd8('0x5')]('in',_0xffd8('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xffd8('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 70d9e63..6eaf9c1 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 _0x25e4=['then','error','stack','name','send','index','rawAttributes','fieldName','type','key','whatsapp','query','user','show','keys','WhatsappInteraction','filters','intersection','model','fields','attributes','length','includeAll','include','merge','catch','create','body','params','destroy','find','describe','addMessage','omit','ids','getMessages','WhatsappMessage','hasOwnProperty','order','where','WhatsappInteractionId','filter','map','$gte','YYYY-MM-DD\x20HH:mm:ss','options','findAll','rows','addTags','setTags','spread','Tag','color','emit','removeTags','download','unix','toString','root','server','files','tmp','join','format','transcript-%d-%s.zip','User','push','CmContact','Contact','lastName','attachments','Attachment','Messages','createdAt','direction','read','Account','Owner','get','mkdirSync','Whatsapp','fullname','closed','closedAt','disposition','existsSync','createWriteStream','basename','out','System','firstName','secret','value','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','sendStatus','rimraf','bluebird','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','status','end','json','offset','undefined','count','limit','set','Content-Range','update'];(function(_0x4b4040,_0x738b89){var _0x2adec9=function(_0x47062f){while(--_0x47062f){_0x4b4040['push'](_0x4b4040['shift']());}};_0x2adec9(++_0x738b89);}(_0x25e4,0xe8));var _0x425e=function(_0x51c092,_0x3c651e){_0x51c092=_0x51c092-0x0;var _0x6bab8d=_0x25e4[_0x51c092];return _0x6bab8d;};'use strict';var rimraf=require(_0x425e('0x0'));var zipdir=require('zip-dir');var moment=require('moment');var BPromise=require(_0x425e('0x1'));var util=require(_0x425e('0x2'));var path=require(_0x425e('0x3'));var ejs=require(_0x425e('0x4'));var fs=require('fs');var _=require(_0x425e('0x5'));var Redis=require(_0x425e('0x6'));var interaction=require(_0x425e('0x7'));var qs=require(_0x425e('0x8'));var pdf=require(_0x425e('0x9'));var logger=require(_0x425e('0xa'))(_0x425e('0xb'));var config=require(_0x425e('0xc'));var db=require(_0x425e('0xd'))['db'];config['redis']=_[_0x425e('0xe')](config[_0x425e('0xf')],{'host':_0x425e('0x10'),'port':0x18eb});var socket=require(_0x425e('0x11'))(new Redis(config[_0x425e('0xf')]));require(_0x425e('0x12'))[_0x425e('0x13')](socket);function respondWithStatusCode(_0x176b3d,_0x12727f){_0x12727f=_0x12727f||0xcc;return function(_0x3332d0){if(_0x3332d0){return _0x176b3d['sendStatus'](_0x12727f);}return _0x176b3d[_0x425e('0x14')](_0x12727f)[_0x425e('0x15')]();};}function respondWithResult(_0x398485,_0x16720d){_0x16720d=_0x16720d||0xc8;return function(_0x3dd2a6){if(_0x3dd2a6){return _0x398485[_0x425e('0x14')](_0x16720d)[_0x425e('0x16')](_0x3dd2a6);}};}function respondWithFilteredResult(_0x2e1825,_0x5ac02b){return function(_0x3398ed){if(_0x3398ed){var _0x4aa73e=typeof _0x5ac02b[_0x425e('0x17')]==='undefined'&&typeof _0x5ac02b['limit']===_0x425e('0x18');var _0x24f07e=_0x3398ed[_0x425e('0x19')];var _0x65c413=_0x4aa73e?0x0:_0x5ac02b[_0x425e('0x17')];var _0x5888ec=_0x4aa73e?_0x3398ed['count']:_0x5ac02b[_0x425e('0x17')]+_0x5ac02b[_0x425e('0x1a')];var _0x97ce9d;if(_0x5888ec>=_0x24f07e){_0x5888ec=_0x24f07e;_0x97ce9d=0xc8;}else{_0x97ce9d=0xce;}_0x2e1825[_0x425e('0x14')](_0x97ce9d);return _0x2e1825[_0x425e('0x1b')](_0x425e('0x1c'),_0x65c413+'-'+_0x5888ec+'/'+_0x24f07e)[_0x425e('0x16')](_0x3398ed);}return null;};}function saveUpdates(_0x1767f4){return function(_0x256aa0){if(_0x256aa0){return _0x256aa0[_0x425e('0x1d')](_0x1767f4)[_0x425e('0x1e')](function(_0x14fe2a){return _0x14fe2a;});}return null;};}function removeEntity(_0x4f51e8){return function(_0x4b419d){if(_0x4b419d){return _0x4b419d['destroy']()[_0x425e('0x1e')](function(){_0x4f51e8[_0x425e('0x14')](0xcc)[_0x425e('0x15')]();});}};}function handleEntityNotFound(_0x362707){return function(_0x1f52c9){if(!_0x1f52c9){_0x362707['sendStatus'](0x194);}return _0x1f52c9;};}function handleError(_0x3cc17c,_0x58fa7f){_0x58fa7f=_0x58fa7f||0x1f4;return function(_0x14336b){logger[_0x425e('0x1f')](_0x14336b[_0x425e('0x20')]);if(_0x14336b[_0x425e('0x21')]){delete _0x14336b[_0x425e('0x21')];}_0x3cc17c['status'](_0x58fa7f)[_0x425e('0x22')](_0x14336b);};}exports[_0x425e('0x23')]=function(_0x19d15a,_0x32489d){var _0x23e265={};var _0x10f85b=_['map'](db['WhatsappInteraction'][_0x425e('0x24')],function(_0x5e7979){return{'name':_0x5e7979[_0x425e('0x25')],'type':_0x5e7979[_0x425e('0x26')][_0x425e('0x27')]};});_0x23e265=qs['getOptions'](_0x10f85b,_0x19d15a);return interaction['findAll'](_0x425e('0x28'),_0x19d15a[_0x425e('0x29')],_0x19d15a[_0x425e('0x2a')],_0x23e265,_0x10f85b)[_0x425e('0x1e')](respondWithFilteredResult(_0x32489d,_0x23e265))['catch'](handleError(_0x32489d,null));};exports[_0x425e('0x2b')]=function(_0x26586d,_0x4acdf7){var _0x2dce14={'raw':![],'where':{'id':_0x26586d['params']['id']}},_0x4792f4={};_0x4792f4['model']=_[_0x425e('0x2c')](db[_0x425e('0x2d')][_0x425e('0x24')]);_0x4792f4[_0x425e('0x29')]=_['keys'](_0x26586d[_0x425e('0x29')]);_0x4792f4[_0x425e('0x2e')]=_[_0x425e('0x2f')](_0x4792f4[_0x425e('0x30')],_0x4792f4[_0x425e('0x29')]);_0x2dce14['attributes']=_[_0x425e('0x2f')](_0x4792f4[_0x425e('0x30')],qs[_0x425e('0x31')](_0x26586d['query'][_0x425e('0x31')]));_0x2dce14[_0x425e('0x32')]=_0x2dce14[_0x425e('0x32')][_0x425e('0x33')]?_0x2dce14[_0x425e('0x32')]:_0x4792f4[_0x425e('0x30')];if(_0x26586d[_0x425e('0x29')][_0x425e('0x34')]){_0x2dce14[_0x425e('0x35')]=[{'all':!![]}];}_0x2dce14=_[_0x425e('0x36')]({},_0x2dce14,_0x26586d['options']);return db[_0x425e('0x2d')]['find'](_0x2dce14)['then'](handleEntityNotFound(_0x4acdf7,null))['then'](respondWithResult(_0x4acdf7,null))[_0x425e('0x37')](handleError(_0x4acdf7,null));};exports[_0x425e('0x38')]=function(_0x3525b3,_0x249ca7){return db[_0x425e('0x2d')]['create'](_0x3525b3[_0x425e('0x39')],{})['then'](respondWithResult(_0x249ca7,0xc9))[_0x425e('0x37')](handleError(_0x249ca7,null));};exports[_0x425e('0x1d')]=function(_0x17d99e,_0x1c9f94){if(_0x17d99e[_0x425e('0x39')]['id']){delete _0x17d99e[_0x425e('0x39')]['id'];}return db[_0x425e('0x2d')]['find']({'where':{'id':_0x17d99e[_0x425e('0x3a')]['id']}})['then'](handleEntityNotFound(_0x1c9f94,null))[_0x425e('0x1e')](saveUpdates(_0x17d99e[_0x425e('0x39')],null))[_0x425e('0x1e')](respondWithResult(_0x1c9f94,null))[_0x425e('0x37')](handleError(_0x1c9f94,null));};exports[_0x425e('0x3b')]=function(_0xa0bb94,_0x4a29c2){return db[_0x425e('0x2d')][_0x425e('0x3c')]({'where':{'id':_0xa0bb94[_0x425e('0x3a')]['id']}})[_0x425e('0x1e')](handleEntityNotFound(_0x4a29c2,null))['then'](removeEntity(_0x4a29c2,null))[_0x425e('0x37')](handleError(_0x4a29c2,null));};exports['describe']=function(_0x459a5c,_0x5f4cd7){return db[_0x425e('0x2d')][_0x425e('0x3d')]()[_0x425e('0x1e')](respondWithResult(_0x5f4cd7,null))['catch'](handleError(_0x5f4cd7,null));};exports[_0x425e('0x3e')]=function(_0x45cfb1,_0x1a3533){return db['WhatsappMessage']['find']({'where':{'id':_0x45cfb1[_0x425e('0x3a')]['id']}})[_0x425e('0x1e')](handleEntityNotFound(_0x1a3533,null))[_0x425e('0x1e')](function(_0x187182){if(_0x187182){return _0x187182[_0x425e('0x3e')](_0x45cfb1['body']['ids'],_[_0x425e('0x3f')](_0x45cfb1[_0x425e('0x39')],[_0x425e('0x40'),'id'])||{});}})[_0x425e('0x1e')](respondWithResult(_0x1a3533,null))[_0x425e('0x37')](handleError(_0x1a3533,null));};exports[_0x425e('0x41')]=function(_0x562fa0,_0x473366){var _0xd5c3b2={'raw':![],'where':{}};var _0x1c60b9={};var _0x3d85c6={'count':0x0,'rows':[]};return db['WhatsappInteraction']['findOne']({'where':{'id':_0x562fa0['params']['id']}})['then'](handleEntityNotFound(_0x473366,null))['then'](function(_0x428232){if(_0x428232){_0x1c60b9[_0x425e('0x30')]=_['keys'](db[_0x425e('0x42')][_0x425e('0x24')]);_0x1c60b9[_0x425e('0x29')]=_[_0x425e('0x2c')](_0x562fa0[_0x425e('0x29')]);_0x1c60b9[_0x425e('0x2e')]=_[_0x425e('0x2f')](_0x1c60b9[_0x425e('0x30')],_0x1c60b9[_0x425e('0x29')]);_0xd5c3b2[_0x425e('0x32')]=_['intersection'](_0x1c60b9['model'],qs[_0x425e('0x31')](_0x562fa0[_0x425e('0x29')][_0x425e('0x31')]));_0xd5c3b2['attributes']=_0xd5c3b2['attributes'][_0x425e('0x33')]?_0xd5c3b2['attributes']:_0x1c60b9[_0x425e('0x30')];if(!_0x562fa0['query'][_0x425e('0x43')]('nolimit')){_0xd5c3b2[_0x425e('0x1a')]=qs[_0x425e('0x1a')](_0x562fa0[_0x425e('0x29')][_0x425e('0x1a')]);_0xd5c3b2[_0x425e('0x17')]=qs[_0x425e('0x17')](_0x562fa0['query'][_0x425e('0x17')]);}_0xd5c3b2[_0x425e('0x44')]=qs['sort'](_0x562fa0[_0x425e('0x29')]['sort']);_0xd5c3b2[_0x425e('0x45')]=qs[_0x425e('0x2e')](_['pick'](_0x562fa0[_0x425e('0x29')],_0x1c60b9[_0x425e('0x2e')]));_0xd5c3b2[_0x425e('0x45')][_0x425e('0x46')]=_0x428232['id'];if(_0x562fa0['query'][_0x425e('0x47')]){_0xd5c3b2[_0x425e('0x45')]=_[_0x425e('0x36')](_0xd5c3b2[_0x425e('0x45')],{'$or':_[_0x425e('0x48')](_0xd5c3b2['attributes'],function(_0x229469){var _0xf43d22={};_0xf43d22[_0x229469]={'$like':'%'+_0x562fa0['query'][_0x425e('0x47')]+'%'};return _0xf43d22;})});}if(_0x562fa0['query']['$gte']){var _0x2dad92=_0x562fa0['query'][_0x425e('0x49')]['split'](',');var _0x1de653={};_0x1de653[_0x2dad92[0x0]]={'$gte':moment(_0x2dad92[0x1])['format'](_0x425e('0x4a'))};_0xd5c3b2[_0x425e('0x45')]=_[_0x425e('0x36')](_0xd5c3b2[_0x425e('0x45')],_0x1de653);}_0xd5c3b2=_[_0x425e('0x36')]({},_0xd5c3b2,_0x562fa0[_0x425e('0x4b')]);return db[_0x425e('0x42')][_0x425e('0x19')]({'where':_0xd5c3b2[_0x425e('0x45')]})['then'](function(_0x4de8f4){_0x3d85c6[_0x425e('0x19')]=_0x4de8f4;if(_0x562fa0[_0x425e('0x29')]['includeAll']){_0xd5c3b2[_0x425e('0x35')]=[{'all':!![]}];}return db[_0x425e('0x42')][_0x425e('0x4c')](_0xd5c3b2);})[_0x425e('0x1e')](function(_0x11d945){_0x3d85c6[_0x425e('0x4d')]=_0x11d945;return _0x3d85c6;});}})[_0x425e('0x1e')](respondWithFilteredResult(_0x473366,_0xd5c3b2))['catch'](handleError(_0x473366,null));};exports[_0x425e('0x4e')]=function(_0x235a36,_0x5bcbcc){return db[_0x425e('0x2d')][_0x425e('0x3c')]({'where':{'id':_0x235a36[_0x425e('0x3a')]['id']}})[_0x425e('0x1e')](handleEntityNotFound(_0x5bcbcc,null))[_0x425e('0x1e')](function(_0x19d017){if(_0x19d017){return _0x19d017[_0x425e('0x4f')](_0x235a36[_0x425e('0x39')][_0x425e('0x40')],_[_0x425e('0x3f')](_0x235a36[_0x425e('0x39')],[_0x425e('0x40'),'id'])||{})[_0x425e('0x50')](function(){return db[_0x425e('0x51')]['findAll']({'attributes':['id',_0x425e('0x21'),_0x425e('0x52')],'where':{'id':_0x235a36['body'][_0x425e('0x40')]}});})[_0x425e('0x1e')](function(_0x5769cf){socket[_0x425e('0x53')]('whatsappInteractionTags:save',{'id':Number(_0x235a36[_0x425e('0x3a')]['id']),'tags':_0x5769cf||[]});return{'id':Number(_0x235a36[_0x425e('0x3a')]['id']),'tags':_0x5769cf||[]};});}})[_0x425e('0x1e')](respondWithResult(_0x5bcbcc,null))[_0x425e('0x37')](handleError(_0x5bcbcc,null));};exports[_0x425e('0x54')]=function(_0x5272ba,_0xc43b1f){return db['WhatsappInteraction'][_0x425e('0x3c')]({'where':{'id':_0x5272ba[_0x425e('0x3a')]['id']}})[_0x425e('0x1e')](handleEntityNotFound(_0xc43b1f,null))[_0x425e('0x1e')](function(_0x3d23d9){if(_0x3d23d9){return _0x3d23d9[_0x425e('0x54')](_0x5272ba['query'][_0x425e('0x40')]);}})[_0x425e('0x1e')](respondWithStatusCode(_0xc43b1f,null))[_0x425e('0x37')](handleError(_0xc43b1f,null));};exports[_0x425e('0x55')]=function(_0x1ae9ee,_0x2af610){var _0x30c8d7=moment()[_0x425e('0x56')]()[_0x425e('0x57')]();var _0x3680f6=path['join'](config[_0x425e('0x58')],_0x425e('0x59'),_0x425e('0x5a'),_0x425e('0x5b'));var _0x4486de=path['join'](config[_0x425e('0x58')],'server',_0x425e('0x5a'),'attachments');var _0x465bf0=path[_0x425e('0x5c')](_0x3680f6,_0x30c8d7);var _0x20ee44=util[_0x425e('0x5d')](_0x425e('0x5e'),_0x1ae9ee['params']['id'],_0x30c8d7);var _0x48f139=path['join'](_0x3680f6,_0x20ee44);var _0x277a63=[];_0x277a63['push']({'model':db[_0x425e('0x5f')],'as':_0x425e('0x5f'),'attributes':['id','fullname'],'raw':!![]});_0x277a63[_0x425e('0x60')]({'model':db[_0x425e('0x61')],'as':_0x425e('0x62'),'attributes':['id','firstName',_0x425e('0x63')],'raw':!![]});if(_0x1ae9ee['query'][_0x425e('0x64')]){_0x277a63[_0x425e('0x60')]({'model':db[_0x425e('0x65')],'as':'Attachment','raw':!![]});}var _0xa5d476=[{'model':db[_0x425e('0x42')],'as':_0x425e('0x66'),'attributes':['id',_0x425e('0x39'),_0x425e('0x67'),_0x425e('0x68'),'secret',_0x425e('0x69')],'include':_0x277a63}];_0xa5d476[_0x425e('0x60')]({'model':db['WhatsappAccount'],'as':_0x425e('0x6a'),'attributes':['id',_0x425e('0x21')]});_0xa5d476[_0x425e('0x60')]({'model':db[_0x425e('0x5f')],'as':_0x425e('0x6b'),'attributes':['id','fullname']});return db[_0x425e('0x2d')][_0x425e('0x3c')]({'where':{'id':_0x1ae9ee[_0x425e('0x3a')]['id']},'include':_0xa5d476})[_0x425e('0x1e')](handleEntityNotFound(_0x2af610,null))['then'](function(_0x5d4b15){if(_0x5d4b15){var _0x52fca4=_0x5d4b15[_0x425e('0x6c')]({'plain':!![]});fs[_0x425e('0x6d')](_0x465bf0);var _0x5d4de3={'channel':_0x425e('0x6e'),'account':_0x52fca4['Account'][_0x425e('0x21')],'agent':_0x52fca4[_0x425e('0x6b')]?_0x52fca4[_0x425e('0x6b')][_0x425e('0x6f')]:'N.A.','createdAt':moment(_0x52fca4[_0x425e('0x67')])[_0x425e('0x5d')](_0x425e('0x4a'))[_0x425e('0x57')](),'closedAt':_0x52fca4[_0x425e('0x70')]?moment(_0x52fca4[_0x425e('0x71')])[_0x425e('0x5d')](_0x425e('0x4a'))[_0x425e('0x57')]():'','disposition':_0x52fca4[_0x425e('0x72')],'messages':_(_0x52fca4['Messages'])[_0x425e('0x47')]({'secret':![]})[_0x425e('0x48')](function(_0x4f1e8e){if(_0x4f1e8e[_0x425e('0x65')]){var _0x3c99ee=path['join'](_0x4486de,_0x4f1e8e['Attachment']['basename']);if(fs[_0x425e('0x73')](_0x3c99ee)){fs['createReadStream'](_0x3c99ee)['pipe'](fs[_0x425e('0x74')](path[_0x425e('0x5c')](_0x465bf0,_0x4f1e8e['Attachment'][_0x425e('0x75')])));}}return{'date':moment(_0x4f1e8e[_0x425e('0x67')])[_0x425e('0x5d')](_0x425e('0x4a'))[_0x425e('0x57')](),'sender':_0x4f1e8e[_0x425e('0x68')]===_0x425e('0x76')?_0x4f1e8e[_0x425e('0x5f')]?_0x4f1e8e[_0x425e('0x5f')][_0x425e('0x6f')]:_0x425e('0x77'):_0x4f1e8e['Contact'][_0x425e('0x78')]+(_0x4f1e8e[_0x425e('0x62')][_0x425e('0x63')]?'\x20'+_0x4f1e8e['Contact']['lastName']:''),'body':_0x4f1e8e[_0x425e('0x65')]?_0x4f1e8e[_0x425e('0x65')]['basename']:_0x4f1e8e[_0x425e('0x39')],'direction':_0x4f1e8e[_0x425e('0x68')]==='out'?'A':'C','secret':_0x4f1e8e[_0x425e('0x79')],'read':_0x4f1e8e[_0x425e('0x69')],'attachment':_0x4f1e8e[_0x425e('0x65')]};})[_0x425e('0x7a')]()};return ejs['renderFile'](path['join'](config[_0x425e('0x58')],_0x425e('0x59'),'views',_0x425e('0x7b')),{'interaction':_0x5d4de3})[_0x425e('0x1e')](function(_0x44f306){var _0x17cdc3=path[_0x425e('0x5c')](_0x465bf0,_0x425e('0x7c')+_0x52fca4['id']+'-'+_0x30c8d7+_0x425e('0x7d'));var _0x355d08={'path':_0x17cdc3,'channel':_0x425e('0x6e'),'interactionId':_0x52fca4['id']};return pdf[_0x425e('0x7e')](_0x44f306,_0x355d08);})['then'](function(){return new BPromise(function(_0xb4ae7e,_0x136151){zipdir(_0x465bf0,{'saveTo':_0x48f139},function(_0x45beb3,_0x83f5d){if(_0x45beb3)return _0x136151(_0x45beb3);return _0xb4ae7e(_0x83f5d);});})[_0x425e('0x1e')](function(){return new BPromise(function(_0x56b898,_0x328e14){rimraf(_0x465bf0,function(_0x4be0da){if(_0x4be0da)_0x328e14(_0x4be0da);return _0x56b898();});});})[_0x425e('0x1e')](function(){return _0x2af610['download'](_0x48f139,_0x20ee44,function(_0x4bf27d){if(_0x4bf27d){console[_0x425e('0x7f')](_0x425e('0x80'),_0x4bf27d);}else{fs[_0x425e('0x81')](_0x48f139);}});});});}else{return _0x2af610[_0x425e('0x82')](0xc8);}})[_0x425e('0x37')](handleError(_0x2af610,null));}; \ No newline at end of file +var _0xb86e=['user','catch','params','model','keys','WhatsappInteraction','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','create','body','destroy','describe','addMessage','ids','omit','getMessages','WhatsappMessage','hasOwnProperty','nolimit','where','pick','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','spread','Tag','color','emit','whatsappInteractionTags:save','removeTags','unix','toString','join','root','server','files','transcript-%d-%s.zip','User','fullname','push','CmContact','Contact','Attachment','createdAt','secret','read','WhatsappAccount','Owner','get','mkdirSync','Account','N.A.','closed','closedAt','Messages','map','existsSync','createReadStream','createWriteStream','direction','out','firstName','lastName','basename','value','renderFile','downloadInteraction.ejs','.pdf','Whatsapp','createPdfFromHTML','log','err','unlinkSync','rimraf','moment','bluebird','util','path','ejs','lodash','../../components/parsers/qs','../../components/export/pdf','api','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./whatsappInteraction.socket','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','update','then','error','stack','name','rawAttributes','type','getOptions','findAll','whatsapp','query'];(function(_0x2b3abb,_0x4c54f6){var _0x340eaf=function(_0x46357c){while(--_0x46357c){_0x2b3abb['push'](_0x2b3abb['shift']());}};_0x340eaf(++_0x4c54f6);}(_0xb86e,0x1c7));var _0xeb86=function(_0x17ef56,_0x374f14){_0x17ef56=_0x17ef56-0x0;var _0xf75b6f=_0xb86e[_0x17ef56];return _0xf75b6f;};'use strict';var rimraf=require(_0xeb86('0x0'));var zipdir=require('zip-dir');var moment=require(_0xeb86('0x1'));var BPromise=require(_0xeb86('0x2'));var util=require(_0xeb86('0x3'));var path=require(_0xeb86('0x4'));var ejs=require(_0xeb86('0x5'));var fs=require('fs');var _=require(_0xeb86('0x6'));var Redis=require('ioredis');var interaction=require('../../components/interaction/service');var qs=require(_0xeb86('0x7'));var pdf=require(_0xeb86('0x8'));var logger=require('../../config/logger')(_0xeb86('0x9'));var config=require(_0xeb86('0xa'));var db=require(_0xeb86('0xb'))['db'];config['redis']=_[_0xeb86('0xc')](config[_0xeb86('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xeb86('0xe'))(new Redis(config[_0xeb86('0xd')]));require(_0xeb86('0xf'))['register'](socket);function respondWithStatusCode(_0x78fee9,_0x29ecc5){_0x29ecc5=_0x29ecc5||0xcc;return function(_0x28f4a8){if(_0x28f4a8){return _0x78fee9[_0xeb86('0x10')](_0x29ecc5);}return _0x78fee9[_0xeb86('0x11')](_0x29ecc5)[_0xeb86('0x12')]();};}function respondWithResult(_0x2f1e7,_0x4b5541){_0x4b5541=_0x4b5541||0xc8;return function(_0x163b05){if(_0x163b05){return _0x2f1e7['status'](_0x4b5541)['json'](_0x163b05);}};}function respondWithFilteredResult(_0x403d37,_0x3a217e){return function(_0x33f9fd){if(_0x33f9fd){var _0x1cfc12=typeof _0x3a217e[_0xeb86('0x13')]===_0xeb86('0x14')&&typeof _0x3a217e[_0xeb86('0x15')]===_0xeb86('0x14');var _0x3a7a67=_0x33f9fd[_0xeb86('0x16')];var _0x2f55c3=_0x1cfc12?0x0:_0x3a217e[_0xeb86('0x13')];var _0x4b5e1b=_0x1cfc12?_0x33f9fd[_0xeb86('0x16')]:_0x3a217e['offset']+_0x3a217e[_0xeb86('0x15')];var _0x4a6dff;if(_0x4b5e1b>=_0x3a7a67){_0x4b5e1b=_0x3a7a67;_0x4a6dff=0xc8;}else{_0x4a6dff=0xce;}_0x403d37[_0xeb86('0x11')](_0x4a6dff);return _0x403d37[_0xeb86('0x17')](_0xeb86('0x18'),_0x2f55c3+'-'+_0x4b5e1b+'/'+_0x3a7a67)[_0xeb86('0x19')](_0x33f9fd);}return null;};}function saveUpdates(_0x294c88){return function(_0x42ae84){if(_0x42ae84){return _0x42ae84[_0xeb86('0x1a')](_0x294c88)[_0xeb86('0x1b')](function(_0x503ff5){return _0x503ff5;});}return null;};}function removeEntity(_0x32320a){return function(_0x3ccaa4){if(_0x3ccaa4){return _0x3ccaa4['destroy']()[_0xeb86('0x1b')](function(){_0x32320a[_0xeb86('0x11')](0xcc)[_0xeb86('0x12')]();});}};}function handleEntityNotFound(_0x1e4252){return function(_0x155d70){if(!_0x155d70){_0x1e4252['sendStatus'](0x194);}return _0x155d70;};}function handleError(_0x118b3d,_0x126ecf){_0x126ecf=_0x126ecf||0x1f4;return function(_0x52d2cc){logger[_0xeb86('0x1c')](_0x52d2cc[_0xeb86('0x1d')]);if(_0x52d2cc[_0xeb86('0x1e')]){delete _0x52d2cc[_0xeb86('0x1e')];}_0x118b3d[_0xeb86('0x11')](_0x126ecf)['send'](_0x52d2cc);};}exports['index']=function(_0xf4d6a9,_0x4a9137){var _0x18fc79={};var _0x297148=_['map'](db['WhatsappInteraction'][_0xeb86('0x1f')],function(_0x35f868){return{'name':_0x35f868['fieldName'],'type':_0x35f868[_0xeb86('0x20')]['key']};});_0x18fc79=qs[_0xeb86('0x21')](_0x297148,_0xf4d6a9);return interaction[_0xeb86('0x22')](_0xeb86('0x23'),_0xf4d6a9[_0xeb86('0x24')],_0xf4d6a9[_0xeb86('0x25')],_0x18fc79,_0x297148)[_0xeb86('0x1b')](respondWithFilteredResult(_0x4a9137,_0x18fc79))[_0xeb86('0x26')](handleError(_0x4a9137,null));};exports['show']=function(_0x3b85ce,_0x13b2fc){var _0x2b850c={'raw':![],'where':{'id':_0x3b85ce[_0xeb86('0x27')]['id']}},_0x17408d={};_0x17408d[_0xeb86('0x28')]=_[_0xeb86('0x29')](db[_0xeb86('0x2a')][_0xeb86('0x1f')]);_0x17408d['query']=_[_0xeb86('0x29')](_0x3b85ce[_0xeb86('0x24')]);_0x17408d[_0xeb86('0x2b')]=_[_0xeb86('0x2c')](_0x17408d[_0xeb86('0x28')],_0x17408d[_0xeb86('0x24')]);_0x2b850c[_0xeb86('0x2d')]=_[_0xeb86('0x2c')](_0x17408d[_0xeb86('0x28')],qs[_0xeb86('0x2e')](_0x3b85ce['query'][_0xeb86('0x2e')]));_0x2b850c[_0xeb86('0x2d')]=_0x2b850c[_0xeb86('0x2d')][_0xeb86('0x2f')]?_0x2b850c[_0xeb86('0x2d')]:_0x17408d[_0xeb86('0x28')];if(_0x3b85ce['query'][_0xeb86('0x30')]){_0x2b850c[_0xeb86('0x31')]=[{'all':!![]}];}_0x2b850c=_[_0xeb86('0x32')]({},_0x2b850c,_0x3b85ce[_0xeb86('0x33')]);return db['WhatsappInteraction'][_0xeb86('0x34')](_0x2b850c)[_0xeb86('0x1b')](handleEntityNotFound(_0x13b2fc,null))[_0xeb86('0x1b')](respondWithResult(_0x13b2fc,null))[_0xeb86('0x26')](handleError(_0x13b2fc,null));};exports[_0xeb86('0x35')]=function(_0x190c87,_0x238c9a){return db['WhatsappInteraction'][_0xeb86('0x35')](_0x190c87[_0xeb86('0x36')],{})[_0xeb86('0x1b')](respondWithResult(_0x238c9a,0xc9))[_0xeb86('0x26')](handleError(_0x238c9a,null));};exports[_0xeb86('0x1a')]=function(_0x2b826c,_0x5815aa){if(_0x2b826c[_0xeb86('0x36')]['id']){delete _0x2b826c[_0xeb86('0x36')]['id'];}return db[_0xeb86('0x2a')]['find']({'where':{'id':_0x2b826c['params']['id']}})[_0xeb86('0x1b')](handleEntityNotFound(_0x5815aa,null))[_0xeb86('0x1b')](saveUpdates(_0x2b826c['body'],null))[_0xeb86('0x1b')](respondWithResult(_0x5815aa,null))[_0xeb86('0x26')](handleError(_0x5815aa,null));};exports[_0xeb86('0x37')]=function(_0x56f8fb,_0x34506a){return db['WhatsappInteraction'][_0xeb86('0x34')]({'where':{'id':_0x56f8fb[_0xeb86('0x27')]['id']}})['then'](handleEntityNotFound(_0x34506a,null))[_0xeb86('0x1b')](removeEntity(_0x34506a,null))[_0xeb86('0x26')](handleError(_0x34506a,null));};exports['describe']=function(_0x1c7332,_0x5131bb){return db[_0xeb86('0x2a')][_0xeb86('0x38')]()[_0xeb86('0x1b')](respondWithResult(_0x5131bb,null))[_0xeb86('0x26')](handleError(_0x5131bb,null));};exports[_0xeb86('0x39')]=function(_0x31abec,_0x433711){return db['WhatsappMessage'][_0xeb86('0x34')]({'where':{'id':_0x31abec[_0xeb86('0x27')]['id']}})[_0xeb86('0x1b')](handleEntityNotFound(_0x433711,null))['then'](function(_0x595597){if(_0x595597){return _0x595597[_0xeb86('0x39')](_0x31abec[_0xeb86('0x36')][_0xeb86('0x3a')],_[_0xeb86('0x3b')](_0x31abec[_0xeb86('0x36')],[_0xeb86('0x3a'),'id'])||{});}})[_0xeb86('0x1b')](respondWithResult(_0x433711,null))[_0xeb86('0x26')](handleError(_0x433711,null));};exports[_0xeb86('0x3c')]=function(_0x2ccb31,_0x1a7b9a){var _0xa36719={'raw':![],'where':{}};var _0x5944e2={};var _0x129398={'count':0x0,'rows':[]};return db[_0xeb86('0x2a')]['findOne']({'where':{'id':_0x2ccb31[_0xeb86('0x27')]['id']}})[_0xeb86('0x1b')](handleEntityNotFound(_0x1a7b9a,null))[_0xeb86('0x1b')](function(_0x5297fd){if(_0x5297fd){_0x5944e2[_0xeb86('0x28')]=_['keys'](db[_0xeb86('0x3d')][_0xeb86('0x1f')]);_0x5944e2['query']=_['keys'](_0x2ccb31[_0xeb86('0x24')]);_0x5944e2[_0xeb86('0x2b')]=_[_0xeb86('0x2c')](_0x5944e2['model'],_0x5944e2[_0xeb86('0x24')]);_0xa36719[_0xeb86('0x2d')]=_[_0xeb86('0x2c')](_0x5944e2[_0xeb86('0x28')],qs[_0xeb86('0x2e')](_0x2ccb31[_0xeb86('0x24')][_0xeb86('0x2e')]));_0xa36719[_0xeb86('0x2d')]=_0xa36719[_0xeb86('0x2d')][_0xeb86('0x2f')]?_0xa36719[_0xeb86('0x2d')]:_0x5944e2[_0xeb86('0x28')];if(!_0x2ccb31[_0xeb86('0x24')][_0xeb86('0x3e')](_0xeb86('0x3f'))){_0xa36719[_0xeb86('0x15')]=qs[_0xeb86('0x15')](_0x2ccb31[_0xeb86('0x24')][_0xeb86('0x15')]);_0xa36719[_0xeb86('0x13')]=qs[_0xeb86('0x13')](_0x2ccb31['query']['offset']);}_0xa36719['order']=qs['sort'](_0x2ccb31[_0xeb86('0x24')]['sort']);_0xa36719[_0xeb86('0x40')]=qs[_0xeb86('0x2b')](_[_0xeb86('0x41')](_0x2ccb31[_0xeb86('0x24')],_0x5944e2[_0xeb86('0x2b')]));_0xa36719[_0xeb86('0x40')]['WhatsappInteractionId']=_0x5297fd['id'];if(_0x2ccb31[_0xeb86('0x24')][_0xeb86('0x42')]){_0xa36719[_0xeb86('0x40')]=_['merge'](_0xa36719[_0xeb86('0x40')],{'$or':_['map'](_0xa36719[_0xeb86('0x2d')],function(_0x216297){var _0x3ae07d={};_0x3ae07d[_0x216297]={'$like':'%'+_0x2ccb31[_0xeb86('0x24')][_0xeb86('0x42')]+'%'};return _0x3ae07d;})});}if(_0x2ccb31[_0xeb86('0x24')][_0xeb86('0x43')]){var _0x31f0c3=_0x2ccb31[_0xeb86('0x24')][_0xeb86('0x43')][_0xeb86('0x44')](',');var _0x4a4e98={};_0x4a4e98[_0x31f0c3[0x0]]={'$gte':moment(_0x31f0c3[0x1])[_0xeb86('0x45')](_0xeb86('0x46'))};_0xa36719['where']=_['merge'](_0xa36719['where'],_0x4a4e98);}_0xa36719=_[_0xeb86('0x32')]({},_0xa36719,_0x2ccb31[_0xeb86('0x33')]);return db[_0xeb86('0x3d')][_0xeb86('0x16')]({'where':_0xa36719[_0xeb86('0x40')]})[_0xeb86('0x1b')](function(_0x32009c){_0x129398['count']=_0x32009c;if(_0x2ccb31[_0xeb86('0x24')][_0xeb86('0x30')]){_0xa36719[_0xeb86('0x31')]=[{'all':!![]}];}return db[_0xeb86('0x3d')][_0xeb86('0x22')](_0xa36719);})[_0xeb86('0x1b')](function(_0x12bbd1){_0x129398[_0xeb86('0x47')]=_0x12bbd1;return _0x129398;});}})[_0xeb86('0x1b')](respondWithFilteredResult(_0x1a7b9a,_0xa36719))[_0xeb86('0x26')](handleError(_0x1a7b9a,null));};exports[_0xeb86('0x48')]=function(_0x24f27b,_0x154f8b){return db['WhatsappInteraction']['find']({'where':{'id':_0x24f27b[_0xeb86('0x27')]['id']}})[_0xeb86('0x1b')](handleEntityNotFound(_0x154f8b,null))['then'](function(_0x5067ee){if(_0x5067ee){return _0x5067ee[_0xeb86('0x49')](_0x24f27b[_0xeb86('0x36')][_0xeb86('0x3a')],_['omit'](_0x24f27b[_0xeb86('0x36')],[_0xeb86('0x3a'),'id'])||{})[_0xeb86('0x4a')](function(){return db[_0xeb86('0x4b')][_0xeb86('0x22')]({'attributes':['id','name',_0xeb86('0x4c')],'where':{'id':_0x24f27b[_0xeb86('0x36')][_0xeb86('0x3a')]}});})['then'](function(_0x5a2287){socket[_0xeb86('0x4d')](_0xeb86('0x4e'),{'id':Number(_0x24f27b[_0xeb86('0x27')]['id']),'tags':_0x5a2287||[]});return{'id':Number(_0x24f27b[_0xeb86('0x27')]['id']),'tags':_0x5a2287||[]};});}})[_0xeb86('0x1b')](respondWithResult(_0x154f8b,null))[_0xeb86('0x26')](handleError(_0x154f8b,null));};exports[_0xeb86('0x4f')]=function(_0x3948a6,_0x300fc9){return db[_0xeb86('0x2a')][_0xeb86('0x34')]({'where':{'id':_0x3948a6[_0xeb86('0x27')]['id']}})[_0xeb86('0x1b')](handleEntityNotFound(_0x300fc9,null))['then'](function(_0x3857fb){if(_0x3857fb){return _0x3857fb[_0xeb86('0x4f')](_0x3948a6[_0xeb86('0x24')]['ids']);}})[_0xeb86('0x1b')](respondWithStatusCode(_0x300fc9,null))[_0xeb86('0x26')](handleError(_0x300fc9,null));};exports['download']=function(_0x136185,_0xfeb395){var _0x188963=moment()[_0xeb86('0x50')]()[_0xeb86('0x51')]();var _0x303f5f=path[_0xeb86('0x52')](config[_0xeb86('0x53')],_0xeb86('0x54'),'files','tmp');var _0x154847=path[_0xeb86('0x52')](config[_0xeb86('0x53')],_0xeb86('0x54'),_0xeb86('0x55'),'attachments');var _0x273275=path[_0xeb86('0x52')](_0x303f5f,_0x188963);var _0x82e52d=util[_0xeb86('0x45')](_0xeb86('0x56'),_0x136185[_0xeb86('0x27')]['id'],_0x188963);var _0x5c4e26=path['join'](_0x303f5f,_0x82e52d);var _0xa16341=[];_0xa16341['push']({'model':db['User'],'as':_0xeb86('0x57'),'attributes':['id',_0xeb86('0x58')],'raw':!![]});_0xa16341[_0xeb86('0x59')]({'model':db[_0xeb86('0x5a')],'as':_0xeb86('0x5b'),'attributes':['id','firstName','lastName'],'raw':!![]});if(_0x136185['query']['attachments']){_0xa16341[_0xeb86('0x59')]({'model':db[_0xeb86('0x5c')],'as':'Attachment','raw':!![]});}var _0x4dfee6=[{'model':db['WhatsappMessage'],'as':'Messages','attributes':['id',_0xeb86('0x36'),_0xeb86('0x5d'),'direction',_0xeb86('0x5e'),_0xeb86('0x5f')],'include':_0xa16341}];_0x4dfee6['push']({'model':db[_0xeb86('0x60')],'as':'Account','attributes':['id',_0xeb86('0x1e')]});_0x4dfee6[_0xeb86('0x59')]({'model':db[_0xeb86('0x57')],'as':_0xeb86('0x61'),'attributes':['id',_0xeb86('0x58')]});return db[_0xeb86('0x2a')][_0xeb86('0x34')]({'where':{'id':_0x136185[_0xeb86('0x27')]['id']},'include':_0x4dfee6})['then'](handleEntityNotFound(_0xfeb395,null))[_0xeb86('0x1b')](function(_0x9b4b58){if(_0x9b4b58){var _0x19f4a3=_0x9b4b58[_0xeb86('0x62')]({'plain':!![]});fs[_0xeb86('0x63')](_0x273275);var _0xbafcd9={'channel':'Whatsapp','account':_0x19f4a3[_0xeb86('0x64')][_0xeb86('0x1e')],'agent':_0x19f4a3['Owner']?_0x19f4a3[_0xeb86('0x61')][_0xeb86('0x58')]:_0xeb86('0x65'),'createdAt':moment(_0x19f4a3[_0xeb86('0x5d')])[_0xeb86('0x45')](_0xeb86('0x46'))['toString'](),'closedAt':_0x19f4a3[_0xeb86('0x66')]?moment(_0x19f4a3[_0xeb86('0x67')])['format'](_0xeb86('0x46'))[_0xeb86('0x51')]():'','disposition':_0x19f4a3['disposition'],'messages':_(_0x19f4a3[_0xeb86('0x68')])[_0xeb86('0x42')]({'secret':![]})[_0xeb86('0x69')](function(_0xc42428){if(_0xc42428[_0xeb86('0x5c')]){var _0x5b088f=path[_0xeb86('0x52')](_0x154847,_0xc42428[_0xeb86('0x5c')]['basename']);if(fs[_0xeb86('0x6a')](_0x5b088f)){fs[_0xeb86('0x6b')](_0x5b088f)['pipe'](fs[_0xeb86('0x6c')](path['join'](_0x273275,_0xc42428[_0xeb86('0x5c')]['basename'])));}}return{'date':moment(_0xc42428['createdAt'])[_0xeb86('0x45')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0xc42428[_0xeb86('0x6d')]===_0xeb86('0x6e')?_0xc42428['User']?_0xc42428[_0xeb86('0x57')][_0xeb86('0x58')]:'System':_0xc42428[_0xeb86('0x5b')][_0xeb86('0x6f')]+(_0xc42428['Contact']['lastName']?'\x20'+_0xc42428['Contact'][_0xeb86('0x70')]:''),'body':_0xc42428[_0xeb86('0x5c')]?_0xc42428['Attachment'][_0xeb86('0x71')]:_0xc42428['body'],'direction':_0xc42428[_0xeb86('0x6d')]===_0xeb86('0x6e')?'A':'C','secret':_0xc42428[_0xeb86('0x5e')],'read':_0xc42428[_0xeb86('0x5f')],'attachment':_0xc42428['Attachment']};})[_0xeb86('0x72')]()};return ejs[_0xeb86('0x73')](path['join'](config['root'],_0xeb86('0x54'),'views',_0xeb86('0x74')),{'interaction':_0xbafcd9})[_0xeb86('0x1b')](function(_0x3e75f0){var _0x460238=path[_0xeb86('0x52')](_0x273275,'transcript-'+_0x19f4a3['id']+'-'+_0x188963+_0xeb86('0x75'));var _0x41b296={'path':_0x460238,'channel':_0xeb86('0x76'),'interactionId':_0x19f4a3['id']};return pdf[_0xeb86('0x77')](_0x3e75f0,_0x41b296);})[_0xeb86('0x1b')](function(){return new BPromise(function(_0x579faa,_0x1eb9c5){zipdir(_0x273275,{'saveTo':_0x5c4e26},function(_0x5ebd98,_0x45be2c){if(_0x5ebd98)return _0x1eb9c5(_0x5ebd98);return _0x579faa(_0x45be2c);});})['then'](function(){return new BPromise(function(_0x89f4f1,_0xa9f70a){rimraf(_0x273275,function(_0xd14ec1){if(_0xd14ec1)_0xa9f70a(_0xd14ec1);return _0x89f4f1();});});})['then'](function(){return _0xfeb395['download'](_0x5c4e26,_0x82e52d,function(_0x1b5647){if(_0x1b5647){console[_0xeb86('0x78')](_0xeb86('0x79'),_0x1b5647);}else{fs[_0xeb86('0x7a')](_0x5c4e26);}});});});}else{return _0xfeb395['sendStatus'](0xc8);}})['catch'](handleError(_0xfeb395,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index c8a18d8..e34fde8 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 _0xa478=['unreadMessages','length','emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappInteraction','WhatsappMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','map','findAll'];(function(_0x45b100,_0x29a4b1){var _0x1b41f8=function(_0x5a48b4){while(--_0x5a48b4){_0x45b100['push'](_0x45b100['shift']());}};_0x1b41f8(++_0x29a4b1);}(_0xa478,0x136));var _0x8a47=function(_0x514c15,_0x486901){_0x514c15=_0x514c15-0x0;var _0x16283e=_0xa478[_0x514c15];return _0x16283e;};'use strict';var EventEmitter=require(_0x8a47('0x0'));var WhatsappInteraction=require(_0x8a47('0x1'))['db'][_0x8a47('0x2')];var WhatsappMessage=require(_0x8a47('0x1'))['db'][_0x8a47('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x8a47('0x4')](0x0);var events={'afterCreate':_0x8a47('0x5'),'afterUpdate':_0x8a47('0x6'),'afterDestroy':_0x8a47('0x7')};function emitEvent(_0x256550){return function(_0x6e2ab5,_0x46a4cd,_0x50226a){_0x6e2ab5[_0x8a47('0x8')]({'attributes':['id'],'raw':!![]})[_0x8a47('0x9')](function(_0x3de815){_0x6e2ab5[_0x8a47('0xa')]('Users',_0x3de815[_0x8a47('0xb')](function(_0x547fe7){return{'id':_0x547fe7['id']};}));return WhatsappMessage[_0x8a47('0xc')]({'where':{'WhatsappInteractionId':_0x6e2ab5['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8a47('0x9')](function(_0x3a6cc4){_0x6e2ab5['setDataValue'](_0x8a47('0xd'),_0x3a6cc4[_0x8a47('0xe')]);WhatsappInteractionEvents['emit'](_0x256550+':'+_0x6e2ab5['id'],_0x6e2ab5);WhatsappInteractionEvents[_0x8a47('0xf')](_0x256550,_0x6e2ab5);_0x50226a(null);})['catch'](_0x50226a(null));};}for(var e in events){if(events[_0x8a47('0x10')](e)){var event=events[e];WhatsappInteraction[_0x8a47('0x11')](e,emitEvent(event));}}module[_0x8a47('0x12')]=WhatsappInteractionEvents; \ No newline at end of file +var _0x4b6c=['events','../../mysqldb','WhatsappMessage','setMaxListeners','update','remove','getUsers','then','setDataValue','findAll','unreadMessages','emit','hasOwnProperty','hook','exports'];(function(_0x18bdbd,_0xfb8516){var _0x65ad3=function(_0x1235db){while(--_0x1235db){_0x18bdbd['push'](_0x18bdbd['shift']());}};_0x65ad3(++_0xfb8516);}(_0x4b6c,0x14a));var _0xc4b6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4b6c[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xc4b6('0x0'));var WhatsappInteraction=require(_0xc4b6('0x1'))['db']['WhatsappInteraction'];var WhatsappMessage=require(_0xc4b6('0x1'))['db'][_0xc4b6('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xc4b6('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc4b6('0x4'),'afterDestroy':_0xc4b6('0x5')};function emitEvent(_0x3c532b){return function(_0x4cf5e5,_0xce03bb,_0x1d5e09){_0x4cf5e5[_0xc4b6('0x6')]({'attributes':['id'],'raw':!![]})[_0xc4b6('0x7')](function(_0x5829a9){_0x4cf5e5[_0xc4b6('0x8')]('Users',_0x5829a9['map'](function(_0x27daa9){return{'id':_0x27daa9['id']};}));return WhatsappMessage[_0xc4b6('0x9')]({'where':{'WhatsappInteractionId':_0x4cf5e5['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc4b6('0x7')](function(_0x2f0cc9){_0x4cf5e5[_0xc4b6('0x8')](_0xc4b6('0xa'),_0x2f0cc9['length']);WhatsappInteractionEvents[_0xc4b6('0xb')](_0x3c532b+':'+_0x4cf5e5['id'],_0x4cf5e5);WhatsappInteractionEvents[_0xc4b6('0xb')](_0x3c532b,_0x4cf5e5);_0x1d5e09(null);})['catch'](_0x1d5e09(null));};}for(var e in events){if(events[_0xc4b6('0xc')](e)){var event=events[e];WhatsappInteraction[_0xc4b6('0xd')](e,emitEvent(event));}}module[_0xc4b6('0xe')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 81f41ca..3635211 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 _0xaa16=['closedAt','format','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','whatsapp_interactions','changed','closed'];(function(_0x288d54,_0x932e1f){var _0x1638a5=function(_0x2d339e){while(--_0x2d339e){_0x288d54['push'](_0x288d54['shift']());}};_0x1638a5(++_0x932e1f);}(_0xaa16,0x146));var _0x6aa1=function(_0x432a4a,_0xf65b8b){_0x432a4a=_0x432a4a-0x0;var _0x2dcad3=_0xaa16[_0x432a4a];return _0x2dcad3;};'use strict';var _=require(_0x6aa1('0x0'));var util=require(_0x6aa1('0x1'));var logger=require(_0x6aa1('0x2'))('api');var moment=require(_0x6aa1('0x3'));var BPromise=require(_0x6aa1('0x4'));var rp=require(_0x6aa1('0x5'));var fs=require('fs');var path=require(_0x6aa1('0x6'));var rimraf=require(_0x6aa1('0x7'));var config=require(_0x6aa1('0x8'));var attributes=require(_0x6aa1('0x9'));module[_0x6aa1('0xa')]=function(_0x549a32,_0x1336e7){return _0x549a32[_0x6aa1('0xb')](_0x6aa1('0xc'),attributes,{'tableName':_0x6aa1('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x29539a,_0xaee0b5,_0x178854){if(_0x29539a[_0x6aa1('0xe')](_0x6aa1('0xf'))){_0x29539a[_0x6aa1('0x10')]=moment()[_0x6aa1('0x11')]('YYYY-MM-DD\x20HH:mm:ss');}_0x178854(null,_0x29539a);}}});}; \ No newline at end of file +var _0x5e63=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./whatsappInteraction.attributes','WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash'];(function(_0x24b8ec,_0x3c8c5b){var _0x1d1b63=function(_0x316c98){while(--_0x316c98){_0x24b8ec['push'](_0x24b8ec['shift']());}};_0x1d1b63(++_0x3c8c5b);}(_0x5e63,0x19f));var _0x35e6=function(_0x15a8e1,_0x21e63d){_0x15a8e1=_0x15a8e1-0x0;var _0x185130=_0x5e63[_0x15a8e1];return _0x185130;};'use strict';var _=require(_0x35e6('0x0'));var util=require('util');var logger=require(_0x35e6('0x1'))(_0x35e6('0x2'));var moment=require(_0x35e6('0x3'));var BPromise=require('bluebird');var rp=require(_0x35e6('0x4'));var fs=require('fs');var path=require(_0x35e6('0x5'));var rimraf=require(_0x35e6('0x6'));var config=require(_0x35e6('0x7'));var attributes=require(_0x35e6('0x8'));module['exports']=function(_0x341cc6,_0x394566){return _0x341cc6['define'](_0x35e6('0x9'),attributes,{'tableName':_0x35e6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x55ba6a,_0x31f0e3,_0x25df5b){if(_0x55ba6a[_0x35e6('0xb')](_0x35e6('0xc'))){_0x55ba6a[_0x35e6('0xd')]=moment()[_0x35e6('0xe')](_0x35e6('0xf'));}_0x25df5b(null,_0x55ba6a);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index e509d6a..1360820 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 _0xb124=['raw','where','limit','debug','UpdateWhatsappInteraction','AddTagsToWhatsappInteraction','find','ids','omit','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','localhost','./whatsappInteraction.socket','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','WhatsappInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','catch','WhatsappInteraction','update','body','options'];(function(_0x5aa143,_0x5cceb8){var _0x1d6cbe=function(_0x16cd31){while(--_0x16cd31){_0x5aa143['push'](_0x5aa143['shift']());}};_0x1d6cbe(++_0x5cceb8);}(_0xb124,0xdd));var _0x4b12=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xb124[_0x28947d];return _0x12d2ee;};'use strict';var _=require('lodash');var util=require(_0x4b12('0x0'));var moment=require(_0x4b12('0x1'));var BPromise=require(_0x4b12('0x2'));var rs=require(_0x4b12('0x3'));var fs=require('fs');var Redis=require(_0x4b12('0x4'));var db=require(_0x4b12('0x5'))['db'];var utils=require(_0x4b12('0x6'));var logger=require('../../config/logger')(_0x4b12('0x7'));var config=require('../../config/environment');var jayson=require(_0x4b12('0x8'));var client=jayson[_0x4b12('0x9')][_0x4b12('0xa')]({'port':0x232a});config[_0x4b12('0xb')]=_[_0x4b12('0xc')](config[_0x4b12('0xb')],{'host':_0x4b12('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4b12('0xb')]));require(_0x4b12('0xe'))[_0x4b12('0xf')](socket);function respondWithRpcPromise(_0x509fc9,_0x577b0b,_0x134ac4){return new BPromise(function(_0x45445f,_0x4b1cff){return client[_0x4b12('0x10')](_0x509fc9,_0x134ac4)[_0x4b12('0x11')](function(_0x2f20d5){logger[_0x4b12('0x12')](_0x4b12('0x13'),_0x577b0b,'request\x20sent');logger['debug'](_0x4b12('0x14'),_0x577b0b,_0x4b12('0x15'),JSON[_0x4b12('0x16')](_0x2f20d5));if(_0x2f20d5['error']){if(_0x2f20d5['error'][_0x4b12('0x17')]===0x1f4){logger['error'](_0x4b12('0x13'),_0x577b0b,_0x2f20d5[_0x4b12('0x18')]['message']);return _0x4b1cff(_0x2f20d5[_0x4b12('0x18')][_0x4b12('0x19')]);}logger[_0x4b12('0x18')](_0x4b12('0x13'),_0x577b0b,_0x2f20d5[_0x4b12('0x18')][_0x4b12('0x19')]);return _0x45445f(_0x2f20d5['error']['message']);}else{logger[_0x4b12('0x12')](_0x4b12('0x13'),_0x577b0b,_0x4b12('0x15'));_0x45445f(_0x2f20d5['result'][_0x4b12('0x19')]);}})[_0x4b12('0x1a')](function(_0x1757f1){logger[_0x4b12('0x18')](_0x4b12('0x13'),_0x577b0b,_0x1757f1);_0x4b1cff(_0x1757f1);});});}exports['UpdateWhatsappInteraction']=function(_0x59da9e){var _0x5e9210=this;return new Promise(function(_0x1a341d,_0x3f0b0c){return db[_0x4b12('0x1b')][_0x4b12('0x1c')](_0x59da9e[_0x4b12('0x1d')],{'raw':_0x59da9e[_0x4b12('0x1e')]?_0x59da9e[_0x4b12('0x1e')][_0x4b12('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59da9e[_0x4b12('0x1e')]?_0x59da9e['options'][_0x4b12('0x20')]||null:null,'attributes':_0x59da9e[_0x4b12('0x1e')]?_0x59da9e[_0x4b12('0x1e')]['attributes']||null:null,'limit':_0x59da9e[_0x4b12('0x1e')]?_0x59da9e[_0x4b12('0x1e')][_0x4b12('0x21')]||null:null})[_0x4b12('0x11')](function(_0x28b247){logger[_0x4b12('0x12')]('UpdateWhatsappInteraction',_0x59da9e);logger[_0x4b12('0x22')](_0x4b12('0x23'),_0x59da9e,JSON[_0x4b12('0x16')](_0x28b247));_0x1a341d(_0x28b247);})[_0x4b12('0x1a')](function(_0x37ca64){logger['error'](_0x4b12('0x23'),_0x37ca64[_0x4b12('0x19')],_0x59da9e);_0x3f0b0c(_0x5e9210[_0x4b12('0x18')](0x1f4,_0x37ca64[_0x4b12('0x19')]));});});};exports[_0x4b12('0x24')]=function(_0x44b338){return new Promise(function(_0x17c4f7,_0x3b9528){return db['WhatsappInteraction'][_0x4b12('0x25')]({'where':_0x44b338[_0x4b12('0x1e')]?_0x44b338['options'][_0x4b12('0x20')]||null:null})[_0x4b12('0x11')](function(_0x43b881){if(_0x43b881){return _0x43b881['addTags'](_0x44b338[_0x4b12('0x1d')][_0x4b12('0x26')],_[_0x4b12('0x27')](_0x44b338[_0x4b12('0x1d')],[_0x4b12('0x26'),'id'])||{});}})[_0x4b12('0x28')](function(_0x1067b2){logger['info'](_0x4b12('0x29'),_0x44b338);logger[_0x4b12('0x22')](_0x4b12('0x29'),_0x44b338,JSON[_0x4b12('0x16')](_0x1067b2));_0x17c4f7(_0x1067b2);})[_0x4b12('0x1a')](function(_0x1d0834){logger[_0x4b12('0x18')](_0x4b12('0x29'),_0x1d0834[_0x4b12('0x19')],_0x44b338);_0x3b9528(_this[_0x4b12('0x18')](0x1f4,_0x1d0834['message']));});});}; \ No newline at end of file +var _0x5aaf=['addTags','ids','omit','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','./whatsappInteraction.socket','register','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','UpdateWhatsappInteraction','body','options','raw','where','limit','WhatsappInteraction','find'];(function(_0x46f915,_0x21cb25){var _0x3ea8c1=function(_0x3d29ea){while(--_0x3d29ea){_0x46f915['push'](_0x46f915['shift']());}};_0x3ea8c1(++_0x21cb25);}(_0x5aaf,0xee));var _0xf5aa=function(_0x1e474c,_0x35e2cb){_0x1e474c=_0x1e474c-0x0;var _0x4a769f=_0x5aaf[_0x1e474c];return _0x4a769f;};'use strict';var _=require(_0xf5aa('0x0'));var util=require(_0xf5aa('0x1'));var moment=require(_0xf5aa('0x2'));var BPromise=require(_0xf5aa('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf5aa('0x4'));var db=require(_0xf5aa('0x5'))['db'];var utils=require(_0xf5aa('0x6'));var logger=require(_0xf5aa('0x7'))(_0xf5aa('0x8'));var config=require(_0xf5aa('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf5aa('0xa')][_0xf5aa('0xb')]({'port':0x232a});config['redis']=_[_0xf5aa('0xc')](config[_0xf5aa('0xd')],{'host':_0xf5aa('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf5aa('0xd')]));require(_0xf5aa('0xf'))[_0xf5aa('0x10')](socket);function respondWithRpcPromise(_0x3461c9,_0x45ccf3,_0x400008){return new BPromise(function(_0x138b47,_0x29efcd){return client['request'](_0x3461c9,_0x400008)[_0xf5aa('0x11')](function(_0x4f8ea5){logger[_0xf5aa('0x12')](_0xf5aa('0x13'),_0x45ccf3,_0xf5aa('0x14'));logger[_0xf5aa('0x15')]('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x45ccf3,_0xf5aa('0x14'),JSON[_0xf5aa('0x16')](_0x4f8ea5));if(_0x4f8ea5[_0xf5aa('0x17')]){if(_0x4f8ea5[_0xf5aa('0x17')]['code']===0x1f4){logger[_0xf5aa('0x17')](_0xf5aa('0x13'),_0x45ccf3,_0x4f8ea5['error']['message']);return _0x29efcd(_0x4f8ea5['error'][_0xf5aa('0x18')]);}logger[_0xf5aa('0x17')](_0xf5aa('0x13'),_0x45ccf3,_0x4f8ea5[_0xf5aa('0x17')]['message']);return _0x138b47(_0x4f8ea5['error']['message']);}else{logger[_0xf5aa('0x12')](_0xf5aa('0x13'),_0x45ccf3,'request\x20sent');_0x138b47(_0x4f8ea5[_0xf5aa('0x19')][_0xf5aa('0x18')]);}})[_0xf5aa('0x1a')](function(_0x4c135b){logger[_0xf5aa('0x17')](_0xf5aa('0x13'),_0x45ccf3,_0x4c135b);_0x29efcd(_0x4c135b);});});}exports[_0xf5aa('0x1b')]=function(_0x102a47){var _0x3c80e0=this;return new Promise(function(_0x3d2507,_0x42f50a){return db['WhatsappInteraction']['update'](_0x102a47[_0xf5aa('0x1c')],{'raw':_0x102a47[_0xf5aa('0x1d')]?_0x102a47[_0xf5aa('0x1d')][_0xf5aa('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x102a47[_0xf5aa('0x1d')]?_0x102a47['options'][_0xf5aa('0x1f')]||null:null,'attributes':_0x102a47[_0xf5aa('0x1d')]?_0x102a47[_0xf5aa('0x1d')]['attributes']||null:null,'limit':_0x102a47[_0xf5aa('0x1d')]?_0x102a47['options'][_0xf5aa('0x20')]||null:null})[_0xf5aa('0x11')](function(_0x1e54e5){logger[_0xf5aa('0x12')](_0xf5aa('0x1b'),_0x102a47);logger[_0xf5aa('0x15')]('UpdateWhatsappInteraction',_0x102a47,JSON[_0xf5aa('0x16')](_0x1e54e5));_0x3d2507(_0x1e54e5);})[_0xf5aa('0x1a')](function(_0x22cdd6){logger[_0xf5aa('0x17')](_0xf5aa('0x1b'),_0x22cdd6[_0xf5aa('0x18')],_0x102a47);_0x42f50a(_0x3c80e0[_0xf5aa('0x17')](0x1f4,_0x22cdd6[_0xf5aa('0x18')]));});});};exports['AddTagsToWhatsappInteraction']=function(_0x37a74d){return new Promise(function(_0x14222a,_0x1eda74){return db[_0xf5aa('0x21')][_0xf5aa('0x22')]({'where':_0x37a74d[_0xf5aa('0x1d')]?_0x37a74d['options'][_0xf5aa('0x1f')]||null:null})[_0xf5aa('0x11')](function(_0x46a4d7){if(_0x46a4d7){return _0x46a4d7[_0xf5aa('0x23')](_0x37a74d[_0xf5aa('0x1c')][_0xf5aa('0x24')],_[_0xf5aa('0x25')](_0x37a74d['body'],[_0xf5aa('0x24'),'id'])||{});}})['spread'](function(_0x236f44){logger['info'](_0xf5aa('0x26'),_0x37a74d);logger[_0xf5aa('0x15')](_0xf5aa('0x26'),_0x37a74d,JSON[_0xf5aa('0x16')](_0x236f44));_0x14222a(_0x236f44);})['catch'](function(_0x2d3bb9){logger[_0xf5aa('0x17')](_0xf5aa('0x26'),_0x2d3bb9['message'],_0x37a74d);_0x1eda74(_this[_0xf5aa('0x17')](0x1f4,_0x2d3bb9[_0xf5aa('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 64cb97e..0acbabd 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 _0x51a8=['removeListener','register','length','whatsappInteraction:','./whatsappInteraction.events','save','remove','update'];(function(_0xe97a9e,_0x165c6e){var _0x63de0e=function(_0x16d800){while(--_0x16d800){_0xe97a9e['push'](_0xe97a9e['shift']());}};_0x63de0e(++_0x165c6e);}(_0x51a8,0x8c));var _0x851a=function(_0x2fe7e9,_0x49a79a){_0x2fe7e9=_0x2fe7e9-0x0;var _0x1cc6e2=_0x51a8[_0x2fe7e9];return _0x1cc6e2;};'use strict';var WhatsappInteractionEvents=require(_0x851a('0x0'));var events=[_0x851a('0x1'),_0x851a('0x2'),_0x851a('0x3')];function createListener(_0x26d4f9,_0x4b43bd){return function(_0xa96191){_0x4b43bd['emit'](_0x26d4f9,_0xa96191);};}function removeListener(_0xeaf0a1,_0x4f9fa7){return function(){WhatsappInteractionEvents[_0x851a('0x4')](_0xeaf0a1,_0x4f9fa7);};}exports[_0x851a('0x5')]=function(_0x5c5c0f){for(var _0x19e54b=0x0,_0x8bb350=events[_0x851a('0x6')];_0x19e54b<_0x8bb350;_0x19e54b++){var _0xacbe92=events[_0x19e54b];var _0xf7fbd8=createListener(_0x851a('0x7')+_0xacbe92,_0x5c5c0f);WhatsappInteractionEvents['on'](_0xacbe92,_0xf7fbd8);}}; \ No newline at end of file +var _0xc1d4=['length','whatsappInteraction:','./whatsappInteraction.events','save','update','emit','removeListener'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc1d4,0x14b));var _0x4c1d=function(_0x282a84,_0x5d77ae){_0x282a84=_0x282a84-0x0;var _0x58ff1c=_0xc1d4[_0x282a84];return _0x58ff1c;};'use strict';var WhatsappInteractionEvents=require(_0x4c1d('0x0'));var events=[_0x4c1d('0x1'),'remove',_0x4c1d('0x2')];function createListener(_0x597cad,_0x7b2aba){return function(_0x15e52e){_0x7b2aba[_0x4c1d('0x3')](_0x597cad,_0x15e52e);};}function removeListener(_0x1fdc30,_0x5f4104){return function(){WhatsappInteractionEvents[_0x4c1d('0x4')](_0x1fdc30,_0x5f4104);};}exports['register']=function(_0xdaf150){for(var _0x5f3955=0x0,_0x50b506=events[_0x4c1d('0x5')];_0x5f3955<_0x50b506;_0x5f3955++){var _0x5e076b=events[_0x5f3955];var _0x43224a=createListener(_0x4c1d('0x6')+_0x5e076b,_0xdaf150);WhatsappInteractionEvents['on'](_0x5e076b,_0x43224a);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 1ffc886..21b3f51 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 _0x4e5d=['status','put','update','/:id/accept','accept','/:id/reject','reject','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','tracked','whatsapp','whatsappmessage:create','create','post','/:id/status'];(function(_0x5de359,_0x4f179f){var _0x3760ac=function(_0x5dac02){while(--_0x5dac02){_0x5de359['push'](_0x5de359['shift']());}};_0x3760ac(++_0x4f179f);}(_0x4e5d,0xc5));var _0xd4e5=function(_0x2bf031,_0x2e84d8){_0x2bf031=_0x2bf031-0x0;var _0x215504=_0x4e5d[_0x2bf031];return _0x215504;};'use strict';var multer=require(_0xd4e5('0x0'));var util=require(_0xd4e5('0x1'));var path=require(_0xd4e5('0x2'));var timeout=require(_0xd4e5('0x3'));var express=require(_0xd4e5('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd4e5('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd4e5('0x6'));var controller=require('./whatsappMessage.controller');router[_0xd4e5('0x7')]('/',auth[_0xd4e5('0x8')](),controller[_0xd4e5('0x9')]);router['get'](_0xd4e5('0xa'),auth[_0xd4e5('0x8')](),controller['describe']);router[_0xd4e5('0x7')](_0xd4e5('0xb'),auth[_0xd4e5('0x8')](),controller[_0xd4e5('0xc')]);router['post']('/',auth['isAuthenticated'](),interaction[_0xd4e5('0xd')](_0xd4e5('0xe'),_0xd4e5('0xf')),controller[_0xd4e5('0x10')]);router[_0xd4e5('0x11')](_0xd4e5('0x12'),controller[_0xd4e5('0x13')]);router[_0xd4e5('0x14')](_0xd4e5('0xb'),auth[_0xd4e5('0x8')](),controller[_0xd4e5('0x15')]);router[_0xd4e5('0x14')](_0xd4e5('0x16'),auth[_0xd4e5('0x8')](),controller[_0xd4e5('0x17')]);router['put'](_0xd4e5('0x18'),auth[_0xd4e5('0x8')](),controller[_0xd4e5('0x19')]);router['delete'](_0xd4e5('0xb'),auth[_0xd4e5('0x8')](),controller['destroy']);module[_0xd4e5('0x1a')]=router; \ No newline at end of file +var _0x7ba2=['/:id/accept','accept','/:id/reject','reject','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','index','/describe','/:id','post','tracked','whatsapp','whatsappmessage:create','create','/:id/status','put','update'];(function(_0x4a5b15,_0x5529f2){var _0x4f9fc7=function(_0xf71317){while(--_0xf71317){_0x4a5b15['push'](_0x4a5b15['shift']());}};_0x4f9fc7(++_0x5529f2);}(_0x7ba2,0x149));var _0x27ba=function(_0x186872,_0x50a406){_0x186872=_0x186872-0x0;var _0x2f440d=_0x7ba2[_0x186872];return _0x2f440d;};'use strict';var multer=require(_0x27ba('0x0'));var util=require(_0x27ba('0x1'));var path=require('path');var timeout=require(_0x27ba('0x2'));var express=require(_0x27ba('0x3'));var router=express[_0x27ba('0x4')]();var fs_extra=require(_0x27ba('0x5'));var auth=require(_0x27ba('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x27ba('0x7'));var controller=require(_0x27ba('0x8'));router[_0x27ba('0x9')]('/',auth[_0x27ba('0xa')](),controller[_0x27ba('0xb')]);router['get'](_0x27ba('0xc'),auth[_0x27ba('0xa')](),controller['describe']);router[_0x27ba('0x9')](_0x27ba('0xd'),auth[_0x27ba('0xa')](),controller['show']);router[_0x27ba('0xe')]('/',auth[_0x27ba('0xa')](),interaction[_0x27ba('0xf')](_0x27ba('0x10'),_0x27ba('0x11')),controller[_0x27ba('0x12')]);router[_0x27ba('0xe')](_0x27ba('0x13'),controller['status']);router[_0x27ba('0x14')]('/:id',auth[_0x27ba('0xa')](),controller[_0x27ba('0x15')]);router[_0x27ba('0x14')](_0x27ba('0x16'),auth[_0x27ba('0xa')](),controller[_0x27ba('0x17')]);router['put'](_0x27ba('0x18'),auth[_0x27ba('0xa')](),controller[_0x27ba('0x19')]);router['delete'](_0x27ba('0xd'),auth[_0x27ba('0xa')](),controller['destroy']);module[_0x27ba('0x1a')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 76fee75..04a0a98 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 _0xff7b=['TEXT','sequelize','exports','medium','BOOLEAN','out','STRING'];(function(_0x1bf301,_0xda5c4c){var _0x51c947=function(_0x5196d5){while(--_0x5196d5){_0x1bf301['push'](_0x1bf301['shift']());}};_0x51c947(++_0xda5c4c);}(_0xff7b,0xe8));var _0xbff7=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xff7b[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0xbff7('0x0'));module[_0xbff7('0x1')]={'body':{'type':Sequelize['TEXT'](_0xbff7('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xbff7('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xbff7('0x4')),'defaultValue':_0xbff7('0x4'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0xbff7('0x5')]},'providerResponse':{'type':Sequelize[_0xbff7('0x6')]}}; \ No newline at end of file +var _0xfcb1=['exports','TEXT','medium','out','STRING','DATE','BOOLEAN'];(function(_0x1275ca,_0x3bd8a0){var _0x473a9d=function(_0x5b1b56){while(--_0x5b1b56){_0x1275ca['push'](_0x1275ca['shift']());}};_0x473a9d(++_0x3bd8a0);}(_0xfcb1,0x134));var _0x1fcb=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xfcb1[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module[_0x1fcb('0x0')]={'body':{'type':Sequelize[_0x1fcb('0x1')](_0x1fcb('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x1fcb('0x3')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x1fcb('0x4')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x1fcb('0x5')]},'secret':{'type':Sequelize[_0x1fcb('0x6')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x1fcb('0x4')]},'providerResponse':{'type':Sequelize[_0x1fcb('0x1')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index fc3ea73..d74a1d9 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 _0x020f=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','jayson/promise','client','http','request','then','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message','info','result','status','limit','undefined','count','offset','set','Content-Range','json','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','WhatsappMessage','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','length','options','find','create','body','params','describe','whatsapp-interactions','accept','read','format','UserId','user','agent','get','WhatsappInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','contact','User','fullname','email','internal','manual','SIP/%s','channel','motionChannel','event','EventManager','whatsapp','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','RejectMessage','rejectMessage','QueryTypes','SELECT','interface','rejectmessage','WhatsappAccount','WhatsappAccountId','debug','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','zip-dir','fast-json-patch','moment','mustache','util','sox','ejs','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x5506c6,_0x1d0933){var _0x26692a=function(_0x3fdf40){while(--_0x3fdf40){_0x5506c6['push'](_0x5506c6['shift']());}};_0x26692a(++_0x1d0933);}(_0x020f,0x10d));var _0xf020=function(_0x4a32bb,_0x5b0198){_0x4a32bb=_0x4a32bb-0x0;var _0x1a6092=_0x020f[_0x4a32bb];return _0x1a6092;};'use strict';var emlformat=require(_0xf020('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf020('0x1'));var jsonpatch=require(_0xf020('0x2'));var rp=require('request-promise');var moment=require(_0xf020('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf020('0x4'));var util=require(_0xf020('0x5'));var path=require('path');var sox=require(_0xf020('0x6'));var csv=require('to-csv');var ejs=require(_0xf020('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf020('0x8'));var crypto=require(_0xf020('0x9'));var jsforce=require(_0xf020('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf020('0xb'));var Redis=require(_0xf020('0xc'));var authService=require(_0xf020('0xd'));var qs=require(_0xf020('0xe'));var as=require(_0xf020('0xf'));var hardwareService=require(_0xf020('0x10'));var logger=require(_0xf020('0x11'))(_0xf020('0x12'));var utils=require(_0xf020('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xf020('0x14'));var db=require(_0xf020('0x15'))['db'];config[_0xf020('0x16')]=_[_0xf020('0x17')](config[_0xf020('0x16')],{'host':_0xf020('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./whatsappMessage.socket')[_0xf020('0x19')](socket);var jayson=require(_0xf020('0x1a'));var client=jayson[_0xf020('0x1b')][_0xf020('0x1c')]({'port':0x232c});var client9002=jayson[_0xf020('0x1b')][_0xf020('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x25f0fa,_0x522796,_0x489422,_0x140bd1){return new BPromise(function(_0x4a98ba,_0x5ee7c9){var _0x4b88ac=_0x140bd1||client;return _0x4b88ac[_0xf020('0x1d')](_0x25f0fa,_0x489422)[_0xf020('0x1e')](function(_0x33db1b){logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x522796,'request\x20sent');logger['debug'](_0xf020('0x1f'),_0x522796,_0xf020('0x20'),JSON[_0xf020('0x21')](_0x33db1b));if(_0x33db1b[_0xf020('0x22')]){if(_0x33db1b[_0xf020('0x22')][_0xf020('0x23')]===0x1f4){logger[_0xf020('0x22')](_0xf020('0x24'),_0x522796,_0x33db1b[_0xf020('0x22')]['message']);return _0x5ee7c9(_0x33db1b[_0xf020('0x22')][_0xf020('0x25')]);}logger[_0xf020('0x22')](_0xf020('0x24'),_0x522796,_0x33db1b[_0xf020('0x22')][_0xf020('0x25')]);return _0x4a98ba(_0x33db1b[_0xf020('0x22')][_0xf020('0x25')]);}else{logger[_0xf020('0x26')](_0xf020('0x24'),_0x522796,_0xf020('0x20'));_0x4a98ba(_0x33db1b[_0xf020('0x27')][_0xf020('0x25')]);}})['catch'](function(_0x1be558){logger[_0xf020('0x22')]('WhatsappMessage,\x20%s,\x20%s',_0x522796,_0x1be558);_0x5ee7c9(_0x1be558);});});}function respondWithStatusCode(_0x3e7728,_0x130473){_0x130473=_0x130473||0xcc;return function(_0x1833b8){if(_0x1833b8){return _0x3e7728['sendStatus'](_0x130473);}return _0x3e7728['status'](_0x130473)['end']();};}function respondWithResult(_0x5b3075,_0x2758c0){_0x2758c0=_0x2758c0||0xc8;return function(_0x467168){if(_0x467168){return _0x5b3075[_0xf020('0x28')](_0x2758c0)['json'](_0x467168);}};}function respondWithFilteredResult(_0x41c075,_0x40ad91){return function(_0x3d730c){if(_0x3d730c){var _0x43ae6b=typeof _0x40ad91['offset']==='undefined'&&typeof _0x40ad91[_0xf020('0x29')]===_0xf020('0x2a');var _0x4168c7=_0x3d730c['count'];var _0x565583=_0x43ae6b?0x0:_0x40ad91['offset'];var _0x4ea039=_0x43ae6b?_0x3d730c[_0xf020('0x2b')]:_0x40ad91[_0xf020('0x2c')]+_0x40ad91[_0xf020('0x29')];var _0x3439b2;if(_0x4ea039>=_0x4168c7){_0x4ea039=_0x4168c7;_0x3439b2=0xc8;}else{_0x3439b2=0xce;}_0x41c075['status'](_0x3439b2);return _0x41c075[_0xf020('0x2d')](_0xf020('0x2e'),_0x565583+'-'+_0x4ea039+'/'+_0x4168c7)[_0xf020('0x2f')](_0x3d730c);}return null;};}function patchUpdates(_0x226018){return function(_0x88e619){try{jsonpatch[_0xf020('0x30')](_0x88e619,_0x226018,!![]);}catch(_0x299f3c){return BPromise[_0xf020('0x31')](_0x299f3c);}return _0x88e619[_0xf020('0x32')]();};}function saveUpdates(_0x54fa71,_0x350a9d){return function(_0x3a57e7){if(_0x3a57e7){return _0x3a57e7[_0xf020('0x33')](_0x54fa71)['then'](function(_0xe7d6e5){return _0xe7d6e5;});}return null;};}function removeEntity(_0x5911dc,_0x42d556){return function(_0xfe57a3){if(_0xfe57a3){return _0xfe57a3[_0xf020('0x34')]()[_0xf020('0x1e')](function(){_0x5911dc[_0xf020('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x423a89,_0x4c4e7c){return function(_0x41b033){if(!_0x41b033){_0x423a89[_0xf020('0x35')](0x194);}return _0x41b033;};}function handleError(_0x2a43b4,_0x524ad2){_0x524ad2=_0x524ad2||0x1f4;return function(_0x4a2058){logger[_0xf020('0x22')](_0x4a2058[_0xf020('0x36')]);if(_0x4a2058[_0xf020('0x37')]){delete _0x4a2058[_0xf020('0x37')];}_0x2a43b4[_0xf020('0x28')](_0x524ad2)[_0xf020('0x38')](_0x4a2058);};}exports[_0xf020('0x39')]=function(_0x3ab455,_0x509bc3){var _0x2ac619={},_0x12d7ec={},_0x5627d3={'count':0x0,'rows':[]};var _0x4d1db1=_[_0xf020('0x3a')](db[_0xf020('0x3b')][_0xf020('0x3c')],function(_0xdbf8d8){return{'name':_0xdbf8d8[_0xf020('0x3d')],'type':_0xdbf8d8[_0xf020('0x3e')][_0xf020('0x3f')]};});_0x12d7ec[_0xf020('0x40')]=_[_0xf020('0x3a')](_0x4d1db1,_0xf020('0x37'));_0x12d7ec[_0xf020('0x41')]=_[_0xf020('0x42')](_0x3ab455[_0xf020('0x41')]);_0x12d7ec['filters']=_[_0xf020('0x43')](_0x12d7ec[_0xf020('0x40')],_0x12d7ec['query']);_0x2ac619[_0xf020('0x44')]=_[_0xf020('0x43')](_0x12d7ec[_0xf020('0x40')],qs[_0xf020('0x45')](_0x3ab455['query'][_0xf020('0x45')]));_0x2ac619[_0xf020('0x44')]=_0x2ac619[_0xf020('0x44')]['length']?_0x2ac619['attributes']:_0x12d7ec[_0xf020('0x40')];if(!_0x3ab455['query'][_0xf020('0x46')]('nolimit')){_0x2ac619[_0xf020('0x29')]=qs['limit'](_0x3ab455[_0xf020('0x41')]['limit']);_0x2ac619[_0xf020('0x2c')]=qs['offset'](_0x3ab455['query'][_0xf020('0x2c')]);}_0x2ac619[_0xf020('0x47')]=qs[_0xf020('0x48')](_0x3ab455['query'][_0xf020('0x48')]);_0x2ac619[_0xf020('0x49')]=qs[_0xf020('0x4a')](_[_0xf020('0x4b')](_0x3ab455[_0xf020('0x41')],_0x12d7ec[_0xf020('0x4a')]),_0x4d1db1);if(_0x3ab455[_0xf020('0x41')][_0xf020('0x4c')]){_0x2ac619[_0xf020('0x49')]=_[_0xf020('0x4d')](_0x2ac619[_0xf020('0x49')],{'$or':_[_0xf020('0x3a')](_0x4d1db1,function(_0x1668d2){if(_0x1668d2[_0xf020('0x3e')]!==_0xf020('0x4e')){var _0x427777={};_0x427777[_0x1668d2['name']]={'$like':'%'+_0x3ab455[_0xf020('0x41')][_0xf020('0x4c')]+'%'};return _0x427777;}})});}_0x2ac619=_['merge']({},_0x2ac619,_0x3ab455['options']);var _0x38a073={'where':_0x2ac619[_0xf020('0x49')]};return db[_0xf020('0x3b')][_0xf020('0x2b')](_0x38a073)['then'](function(_0x225fd5){_0x5627d3[_0xf020('0x2b')]=_0x225fd5;if(_0x3ab455['query'][_0xf020('0x4f')]){_0x2ac619[_0xf020('0x50')]=[{'all':!![]}];}return db['WhatsappMessage'][_0xf020('0x51')](_0x2ac619);})[_0xf020('0x1e')](function(_0x9f9c1a){_0x5627d3[_0xf020('0x52')]=_0x9f9c1a;return _0x5627d3;})[_0xf020('0x1e')](respondWithFilteredResult(_0x509bc3,_0x2ac619))[_0xf020('0x53')](handleError(_0x509bc3,null));};exports['show']=function(_0x2a1ace,_0x48cb68){var _0x1b4901={'raw':!![],'where':{'id':_0x2a1ace['params']['id']}},_0x5ec0f1={};_0x5ec0f1[_0xf020('0x40')]=_[_0xf020('0x42')](db[_0xf020('0x3b')][_0xf020('0x3c')]);_0x5ec0f1['query']=_[_0xf020('0x42')](_0x2a1ace['query']);_0x5ec0f1[_0xf020('0x4a')]=_['intersection'](_0x5ec0f1[_0xf020('0x40')],_0x5ec0f1['query']);_0x1b4901[_0xf020('0x44')]=_[_0xf020('0x43')](_0x5ec0f1['model'],qs[_0xf020('0x45')](_0x2a1ace[_0xf020('0x41')][_0xf020('0x45')]));_0x1b4901[_0xf020('0x44')]=_0x1b4901[_0xf020('0x44')][_0xf020('0x54')]?_0x1b4901[_0xf020('0x44')]:_0x5ec0f1[_0xf020('0x40')];if(_0x2a1ace[_0xf020('0x41')]['includeAll']){_0x1b4901[_0xf020('0x50')]=[{'all':!![]}];}_0x1b4901=_['merge']({},_0x1b4901,_0x2a1ace[_0xf020('0x55')]);return db[_0xf020('0x3b')][_0xf020('0x56')](_0x1b4901)[_0xf020('0x1e')](handleEntityNotFound(_0x48cb68,null))['then'](respondWithResult(_0x48cb68,null))['catch'](handleError(_0x48cb68,null));};exports[_0xf020('0x57')]=function(_0x5b772e,_0x110e91){return db[_0xf020('0x3b')][_0xf020('0x57')](_0x5b772e[_0xf020('0x58')],{})[_0xf020('0x1e')](respondWithResult(_0x110e91,0xc9))[_0xf020('0x53')](handleError(_0x110e91,null));};exports['update']=function(_0x4e69ec,_0x5e5e80){if(_0x4e69ec['body']['id']){delete _0x4e69ec[_0xf020('0x58')]['id'];}return db[_0xf020('0x3b')][_0xf020('0x56')]({'where':{'id':_0x4e69ec[_0xf020('0x59')]['id']}})[_0xf020('0x1e')](handleEntityNotFound(_0x5e5e80,null))[_0xf020('0x1e')](saveUpdates(_0x4e69ec[_0xf020('0x58')],null))[_0xf020('0x1e')](respondWithResult(_0x5e5e80,null))[_0xf020('0x53')](handleError(_0x5e5e80,null));};exports[_0xf020('0x34')]=function(_0x16baaf,_0xe55b43){return db[_0xf020('0x3b')][_0xf020('0x56')]({'where':{'id':_0x16baaf[_0xf020('0x59')]['id']}})[_0xf020('0x1e')](handleEntityNotFound(_0xe55b43,null))[_0xf020('0x1e')](removeEntity(_0xe55b43,null))['catch'](handleError(_0xe55b43,null));};exports[_0xf020('0x5a')]=function(_0x19d809,_0x47ba0f){return db['WhatsappMessage'][_0xf020('0x5a')]()[_0xf020('0x1e')](respondWithResult(_0x47ba0f,null))['catch'](handleError(_0x47ba0f,null));};var interaction_log=require(_0xf020('0x11'))(_0xf020('0x5b'));exports[_0xf020('0x5c')]=function(_0x2650ff,_0x431abf,_0x13e71c){var _0x5031a4={'agent':{},'channel':'whatsapp'};if(_0x2650ff[_0xf020('0x58')]['id']){delete _0x2650ff[_0xf020('0x58')]['id'];}_0x2650ff[_0xf020('0x58')][_0xf020('0x5d')]=!![];_0x2650ff[_0xf020('0x58')]['readAt']=moment()[_0xf020('0x5e')]('YYYY-MM-DD\x20HH:mm:ss');_0x2650ff[_0xf020('0x58')]['UserId']=_0x2650ff['body'][_0xf020('0x5f')]||_0x2650ff[_0xf020('0x60')]['id'];_0x5031a4[_0xf020('0x61')]['id']=_0x2650ff['body'][_0xf020('0x5f')];return db[_0xf020('0x3b')][_0xf020('0x56')]({'where':{'id':_0x2650ff[_0xf020('0x59')]['id'],'UserId':null}})[_0xf020('0x1e')](handleEntityNotFound(_0x431abf,null))[_0xf020('0x1e')](saveUpdates(_0x2650ff['body'],null))[_0xf020('0x1e')](function(_0x1effb3){if(_0x1effb3){_0x5031a4['message']=_0x1effb3[_0xf020('0x62')]({'plain':!![]});return db['WhatsappInteraction']['find']({'where':{'id':_0x1effb3[_0xf020('0x63')]}});}return null;})[_0xf020('0x1e')](handleEntityNotFound(_0x431abf,null))['then'](function(_0x3e9f9c){if(_0x3e9f9c){return _0x3e9f9c['update']({'UserId':_0x2650ff[_0xf020('0x58')]['UserId'],'read1stAt':_[_0xf020('0x64')](_0x3e9f9c[_0xf020('0x65')])?moment()[_0xf020('0x5e')](_0xf020('0x66')):undefined});}return null;})['then'](function(_0x4c1bc4){if(_0x4c1bc4){_0x5031a4['interaction']=_0x4c1bc4[_0xf020('0x62')]({'plain':!![]});interaction_log[_0xf020('0x26')](_0xf020('0x67'),_0x2650ff[_0xf020('0x60')]['id'],_0x2650ff[_0xf020('0x60')][_0xf020('0x37')],_0x2650ff[_0xf020('0x60')]['role'],_0x5031a4[_0xf020('0x68')]['id'],_0x2650ff[_0xf020('0x58')]?JSON['stringify'](_0x2650ff[_0xf020('0x58')]):'null');return respondWithRpcPromise('AcceptMessage',_0xf020('0x69'),_0x5031a4);}return null;})['then'](function(_0x414b94){var _0x5b3a8d=_0xf020('0x6a')+_0x414b94['message'][_0xf020('0x6b')];return db[_0xf020('0x6c')][_0xf020('0x41')](_0x5b3a8d,{'type':db[_0xf020('0x6d')]['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x476344){return _0x476344;});})[_0xf020('0x1e')](function(_0x23194a){if(_0x23194a){_0x5031a4['message'][_0xf020('0x6e')]=_0x23194a[0x0];if(!_0x2650ff[_0xf020('0x58')][_0xf020('0x5f')])return;return db[_0xf020('0x6f')][_0xf020('0x56')]({'where':{'id':_0x2650ff['body'][_0xf020('0x5f')],'role':'agent'},'attributes':['id','name',_0xf020('0x70'),_0xf020('0x71'),_0xf020('0x72')],'raw':!![]});}return null;})['then'](function(_0xad0c60){if(!_0xad0c60)return null;_0x5031a4[_0xf020('0x25')]['agent']=_0xad0c60;return _0x5031a4;})[_0xf020('0x1e')](function(_0x4d7b58){if(_0x4d7b58){if(_0x2650ff['body'][_0xf020('0x73')]){_0x5031a4[_0xf020('0x25')]['interface']=util[_0xf020('0x5e')](_0xf020('0x74'),_0x2650ff[_0xf020('0x60')]['name']);_0x5031a4[_0xf020('0x25')]['channel']=_0x5031a4[_0xf020('0x75')];_0x5031a4[_0xf020('0x25')][_0xf020('0x76')]=_0x5031a4[_0xf020('0x75')];_0x5031a4[_0xf020('0x25')][_0xf020('0x77')]=_0xf020('0x5c');return respondWithRpcPromise('EventManager',_0xf020('0x78'),{'event':'acceptmessage','message':_0x5031a4['message']},client9002)[_0xf020('0x1e')](function(){return _0x5031a4;});}return _0x5031a4;}return null;})[_0xf020('0x1e')](respondWithResult(_0x431abf,null))[_0xf020('0x53')](handleError(_0x431abf,null));};var interaction_log=require('../../config/logger')(_0xf020('0x5b'));exports['reject']=function(_0x3e8834,_0x393894,_0x3100d9){var _0x1cd00d={'agent':{},'channel':_0xf020('0x79')};if(_0x3e8834[_0xf020('0x58')]['id']){delete _0x3e8834[_0xf020('0x58')]['id'];}_0x3e8834[_0xf020('0x58')]['UserId']=_0x3e8834[_0xf020('0x58')][_0xf020('0x5f')]||_0x3e8834[_0xf020('0x60')]['id'];_0x1cd00d['agent']['id']=_0x3e8834[_0xf020('0x58')][_0xf020('0x5f')];return db[_0xf020('0x3b')]['find']({'where':{'id':_0x3e8834['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x393894,null))['then'](function(_0x294700){if(_0x294700){_0x1cd00d[_0xf020('0x25')]=_0x294700['get']({'plain':!![]});return db['WhatsappInteraction']['find']({'where':{'id':_0x294700['WhatsappInteractionId']}});}return null;})[_0xf020('0x1e')](handleEntityNotFound(_0x393894,null))['then'](function(_0x12443f){if(_0x12443f){_0x1cd00d[_0xf020('0x68')]=_0x12443f[_0xf020('0x62')]({'plain':!![]});interaction_log[_0xf020('0x26')](_0xf020('0x7a'),_0x3e8834[_0xf020('0x60')]['id'],_0x3e8834['user'][_0xf020('0x37')],_0x3e8834[_0xf020('0x60')][_0xf020('0x7b')],_0x1cd00d[_0xf020('0x68')]['id'],_0x3e8834[_0xf020('0x58')]?JSON[_0xf020('0x21')](_0x3e8834[_0xf020('0x58')]):_0xf020('0x7c'));return respondWithRpcPromise(_0xf020('0x7d'),_0xf020('0x7e'),_0x1cd00d);}return null;})['then'](function(_0x86517){var _0x1cfd1f=_0xf020('0x6a')+_0x86517['message'][_0xf020('0x6b')];return db[_0xf020('0x6c')][_0xf020('0x41')](_0x1cfd1f,{'type':db[_0xf020('0x6d')][_0xf020('0x7f')][_0xf020('0x80')],'raw':!![]})[_0xf020('0x1e')](function(_0x38d38e){return _0x38d38e;});})[_0xf020('0x1e')](function(_0x1491af){if(_0x1491af){_0x1cd00d[_0xf020('0x25')][_0xf020('0x6e')]=_0x1491af[0x0];if(!_0x3e8834[_0xf020('0x58')][_0xf020('0x5f')])return;return db[_0xf020('0x6f')]['find']({'where':{'id':_0x3e8834[_0xf020('0x58')][_0xf020('0x5f')],'role':_0xf020('0x61')},'attributes':['id',_0xf020('0x37'),_0xf020('0x70'),_0xf020('0x71'),_0xf020('0x72')],'raw':!![]});}return null;})[_0xf020('0x1e')](function(_0x435cfb){if(!_0x435cfb)return null;_0x1cd00d[_0xf020('0x25')][_0xf020('0x61')]=_0x435cfb;return _0x1cd00d;})['then'](function(_0x505bc6){if(_0x505bc6){_0x505bc6['message'][_0xf020('0x81')]=util['format'](_0xf020('0x74'),_0x3e8834[_0xf020('0x60')][_0xf020('0x37')]);_0x505bc6[_0xf020('0x25')]['channel']=_0x1cd00d[_0xf020('0x75')];_0x505bc6[_0xf020('0x25')]['motionChannel']=_0x1cd00d[_0xf020('0x75')];_0x505bc6['message'][_0xf020('0x77')]=_0xf020('0x31');respondWithRpcPromise(_0xf020('0x78'),_0xf020('0x78'),{'event':_0xf020('0x82'),'message':_0x505bc6['message']},client9002);return _0x1cd00d;}return null;})[_0xf020('0x1e')](respondWithResult(_0x393894,null))[_0xf020('0x53')](handleError(_0x393894,null));};exports['status']=function(_0x345905,_0x3d9c53,_0x24d2a1){if(_0x345905[_0xf020('0x58')]['id']){delete _0x345905[_0xf020('0x58')]['id'];}var _0x582b99;return db[_0xf020('0x3b')]['find']({'where':{'id':_0x345905[_0xf020('0x59')]['id']}})[_0xf020('0x1e')](handleEntityNotFound(_0x3d9c53,null))[_0xf020('0x1e')](function(_0x1379ed){if(_0x1379ed){_0x582b99=_0x1379ed;return db[_0xf020('0x83')][_0xf020('0x56')]({'where':{'id':_0x1379ed[_0xf020('0x84')]}});}})[_0xf020('0x1e')](handleEntityNotFound(_0x3d9c53,null))[_0xf020('0x1e')](function(_0x4f046f){if(_0x4f046f){logger[_0xf020('0x85')](_0xf020('0x86'),_0xf020('0x28'),_0xf020('0x87'),_0x4f046f[_0xf020('0x3e')],util[_0xf020('0x88')](_0x345905[_0xf020('0x58')],{'showHidden':![],'depth':null}));switch(_0x4f046f[_0xf020('0x3e')]){case _0xf020('0x89'):if(_0x345905['body'][_0xf020('0x8a')]&&_0x345905[_0xf020('0x58')]['MessageSid']===_0x582b99[_0xf020('0x8b')]&&_0x345905['body'][_0xf020('0x8c')]&&_0x345905[_0xf020('0x58')][_0xf020('0x8c')]===_0xf020('0x5d')){return _0x582b99[_0xf020('0x33')]({'read':!![]});}else{logger[_0xf020('0x22')](_0xf020('0x8d'),_0xf020('0x28'),_0xf020('0x89'),util[_0xf020('0x88')](_0x345905[_0xf020('0x58')],{'showHidden':![],'depth':null}));}break;}return _0x582b99;}})['then'](respondWithResult(_0x3d9c53,null))[_0xf020('0x53')](handleError(_0x3d9c53,null));}; \ No newline at end of file +var _0xe88f=['WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','redis','defaults','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','client','http','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','save','update','destroy','stack','name','send','index','map','WhatsappMessage','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','whatsapp-interactions','accept','whatsapp','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','WhatsappInteractionId','isNil','interaction','role','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','contact','User','email','manual','interface','SIP/%s','channel','motionChannel','EventManager','reject','WhatsappInteraction','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','ContactId','fullname','internal','event','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','inspect','twilio','MessageSid','messageId','MessageStatus'];(function(_0x3d8e56,_0x8988ff){var _0x1e0594=function(_0x4772fb){while(--_0x4772fb){_0x3d8e56['push'](_0x3d8e56['shift']());}};_0x1e0594(++_0x8988ff);}(_0xe88f,0x8a));var _0xfe88=function(_0x4bb581,_0x6f7037){_0x4bb581=_0x4bb581-0x0;var _0x316bf5=_0xe88f[_0x4bb581];return _0x316bf5;};'use strict';var emlformat=require(_0xfe88('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfe88('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfe88('0x2'));var moment=require('moment');var BPromise=require(_0xfe88('0x3'));var Mustache=require(_0xfe88('0x4'));var util=require('util');var path=require(_0xfe88('0x5'));var sox=require(_0xfe88('0x6'));var csv=require(_0xfe88('0x7'));var ejs=require(_0xfe88('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfe88('0x9'));var squel=require(_0xfe88('0xa'));var crypto=require(_0xfe88('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xfe88('0xc'));var toCsv=require(_0xfe88('0x7'));var querystring=require(_0xfe88('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xfe88('0xe'));var as=require(_0xfe88('0xf'));var hardwareService=require(_0xfe88('0x10'));var logger=require(_0xfe88('0x11'))('api');var utils=require(_0xfe88('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xfe88('0x13'));var db=require('../../mysqldb')['db'];config[_0xfe88('0x14')]=_[_0xfe88('0x15')](config[_0xfe88('0x14')],{'host':'localhost','port':0x18eb});var socket=require(_0xfe88('0x16'))(new Redis(config[_0xfe88('0x14')]));require(_0xfe88('0x17'))[_0xfe88('0x18')](socket);var jayson=require(_0xfe88('0x19'));var client=jayson[_0xfe88('0x1a')][_0xfe88('0x1b')]({'port':0x232c});var client9002=jayson[_0xfe88('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1e751b,_0x45c506,_0x221230,_0x53e504){return new BPromise(function(_0x39c0f9,_0x503fd0){var _0x3472e8=_0x53e504||client;return _0x3472e8[_0xfe88('0x1c')](_0x1e751b,_0x221230)[_0xfe88('0x1d')](function(_0x22321b){logger[_0xfe88('0x1e')](_0xfe88('0x1f'),_0x45c506,_0xfe88('0x20'));logger[_0xfe88('0x21')](_0xfe88('0x22'),_0x45c506,_0xfe88('0x20'),JSON['stringify'](_0x22321b));if(_0x22321b[_0xfe88('0x23')]){if(_0x22321b[_0xfe88('0x23')][_0xfe88('0x24')]===0x1f4){logger[_0xfe88('0x23')](_0xfe88('0x1f'),_0x45c506,_0x22321b[_0xfe88('0x23')][_0xfe88('0x25')]);return _0x503fd0(_0x22321b[_0xfe88('0x23')][_0xfe88('0x25')]);}logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x45c506,_0x22321b[_0xfe88('0x23')]['message']);return _0x39c0f9(_0x22321b['error'][_0xfe88('0x25')]);}else{logger[_0xfe88('0x1e')]('WhatsappMessage,\x20%s,\x20%s',_0x45c506,_0xfe88('0x20'));_0x39c0f9(_0x22321b[_0xfe88('0x26')][_0xfe88('0x25')]);}})['catch'](function(_0x2df9ae){logger[_0xfe88('0x23')](_0xfe88('0x1f'),_0x45c506,_0x2df9ae);_0x503fd0(_0x2df9ae);});});}function respondWithStatusCode(_0x30ddc6,_0x155ccb){_0x155ccb=_0x155ccb||0xcc;return function(_0x2c3dfc){if(_0x2c3dfc){return _0x30ddc6[_0xfe88('0x27')](_0x155ccb);}return _0x30ddc6[_0xfe88('0x28')](_0x155ccb)[_0xfe88('0x29')]();};}function respondWithResult(_0x20dd25,_0x1e1c6a){_0x1e1c6a=_0x1e1c6a||0xc8;return function(_0x3e17f2){if(_0x3e17f2){return _0x20dd25[_0xfe88('0x28')](_0x1e1c6a)[_0xfe88('0x2a')](_0x3e17f2);}};}function respondWithFilteredResult(_0x25168c,_0x16aa97){return function(_0x13793c){if(_0x13793c){var _0x5c38b9=typeof _0x16aa97['offset']===_0xfe88('0x2b')&&typeof _0x16aa97[_0xfe88('0x2c')]===_0xfe88('0x2b');var _0x2de4c7=_0x13793c[_0xfe88('0x2d')];var _0x10ab42=_0x5c38b9?0x0:_0x16aa97[_0xfe88('0x2e')];var _0x17b6e5=_0x5c38b9?_0x13793c[_0xfe88('0x2d')]:_0x16aa97[_0xfe88('0x2e')]+_0x16aa97['limit'];var _0x419332;if(_0x17b6e5>=_0x2de4c7){_0x17b6e5=_0x2de4c7;_0x419332=0xc8;}else{_0x419332=0xce;}_0x25168c['status'](_0x419332);return _0x25168c['set'](_0xfe88('0x2f'),_0x10ab42+'-'+_0x17b6e5+'/'+_0x2de4c7)[_0xfe88('0x2a')](_0x13793c);}return null;};}function patchUpdates(_0x15f00c){return function(_0x122bc7){try{jsonpatch[_0xfe88('0x30')](_0x122bc7,_0x15f00c,!![]);}catch(_0x2e1771){return BPromise['reject'](_0x2e1771);}return _0x122bc7[_0xfe88('0x31')]();};}function saveUpdates(_0x3ca3cd,_0x18c33e){return function(_0x35e383){if(_0x35e383){return _0x35e383[_0xfe88('0x32')](_0x3ca3cd)['then'](function(_0x1888a1){return _0x1888a1;});}return null;};}function removeEntity(_0x34268b,_0x178c5a){return function(_0x4ac499){if(_0x4ac499){return _0x4ac499[_0xfe88('0x33')]()[_0xfe88('0x1d')](function(){_0x34268b[_0xfe88('0x28')](0xcc)[_0xfe88('0x29')]();});}};}function handleEntityNotFound(_0xdf22dd,_0x530f4b){return function(_0x1d545b){if(!_0x1d545b){_0xdf22dd[_0xfe88('0x27')](0x194);}return _0x1d545b;};}function handleError(_0x47c0e4,_0x505f71){_0x505f71=_0x505f71||0x1f4;return function(_0x463d8b){logger[_0xfe88('0x23')](_0x463d8b[_0xfe88('0x34')]);if(_0x463d8b[_0xfe88('0x35')]){delete _0x463d8b[_0xfe88('0x35')];}_0x47c0e4[_0xfe88('0x28')](_0x505f71)[_0xfe88('0x36')](_0x463d8b);};}exports[_0xfe88('0x37')]=function(_0x2d15bc,_0x7dc0b7){var _0x451641={},_0x453118={},_0x55ac51={'count':0x0,'rows':[]};var _0x2650b6=_[_0xfe88('0x38')](db[_0xfe88('0x39')][_0xfe88('0x3a')],function(_0x214f31){return{'name':_0x214f31[_0xfe88('0x3b')],'type':_0x214f31[_0xfe88('0x3c')][_0xfe88('0x3d')]};});_0x453118[_0xfe88('0x3e')]=_[_0xfe88('0x38')](_0x2650b6,_0xfe88('0x35'));_0x453118['query']=_[_0xfe88('0x3f')](_0x2d15bc['query']);_0x453118[_0xfe88('0x40')]=_[_0xfe88('0x41')](_0x453118[_0xfe88('0x3e')],_0x453118[_0xfe88('0x42')]);_0x451641[_0xfe88('0x43')]=_[_0xfe88('0x41')](_0x453118[_0xfe88('0x3e')],qs[_0xfe88('0x44')](_0x2d15bc[_0xfe88('0x42')][_0xfe88('0x44')]));_0x451641[_0xfe88('0x43')]=_0x451641[_0xfe88('0x43')][_0xfe88('0x45')]?_0x451641[_0xfe88('0x43')]:_0x453118[_0xfe88('0x3e')];if(!_0x2d15bc[_0xfe88('0x42')][_0xfe88('0x46')](_0xfe88('0x47'))){_0x451641[_0xfe88('0x2c')]=qs[_0xfe88('0x2c')](_0x2d15bc[_0xfe88('0x42')][_0xfe88('0x2c')]);_0x451641['offset']=qs['offset'](_0x2d15bc[_0xfe88('0x42')][_0xfe88('0x2e')]);}_0x451641['order']=qs['sort'](_0x2d15bc[_0xfe88('0x42')]['sort']);_0x451641[_0xfe88('0x48')]=qs[_0xfe88('0x40')](_['pick'](_0x2d15bc[_0xfe88('0x42')],_0x453118['filters']),_0x2650b6);if(_0x2d15bc[_0xfe88('0x42')][_0xfe88('0x49')]){_0x451641[_0xfe88('0x48')]=_[_0xfe88('0x4a')](_0x451641['where'],{'$or':_[_0xfe88('0x38')](_0x2650b6,function(_0x295f7a){if(_0x295f7a[_0xfe88('0x3c')]!==_0xfe88('0x4b')){var _0x18e782={};_0x18e782[_0x295f7a[_0xfe88('0x35')]]={'$like':'%'+_0x2d15bc[_0xfe88('0x42')]['filter']+'%'};return _0x18e782;}})});}_0x451641=_[_0xfe88('0x4a')]({},_0x451641,_0x2d15bc[_0xfe88('0x4c')]);var _0x5396cb={'where':_0x451641[_0xfe88('0x48')]};return db[_0xfe88('0x39')][_0xfe88('0x2d')](_0x5396cb)[_0xfe88('0x1d')](function(_0x220631){_0x55ac51[_0xfe88('0x2d')]=_0x220631;if(_0x2d15bc[_0xfe88('0x42')][_0xfe88('0x4d')]){_0x451641[_0xfe88('0x4e')]=[{'all':!![]}];}return db[_0xfe88('0x39')][_0xfe88('0x4f')](_0x451641);})[_0xfe88('0x1d')](function(_0x26c800){_0x55ac51[_0xfe88('0x50')]=_0x26c800;return _0x55ac51;})[_0xfe88('0x1d')](respondWithFilteredResult(_0x7dc0b7,_0x451641))[_0xfe88('0x51')](handleError(_0x7dc0b7,null));};exports[_0xfe88('0x52')]=function(_0x319f76,_0x2ad05d){var _0x5617bc={'raw':!![],'where':{'id':_0x319f76[_0xfe88('0x53')]['id']}},_0x4f511f={};_0x4f511f[_0xfe88('0x3e')]=_[_0xfe88('0x3f')](db[_0xfe88('0x39')][_0xfe88('0x3a')]);_0x4f511f[_0xfe88('0x42')]=_[_0xfe88('0x3f')](_0x319f76['query']);_0x4f511f[_0xfe88('0x40')]=_['intersection'](_0x4f511f[_0xfe88('0x3e')],_0x4f511f[_0xfe88('0x42')]);_0x5617bc[_0xfe88('0x43')]=_[_0xfe88('0x41')](_0x4f511f['model'],qs[_0xfe88('0x44')](_0x319f76[_0xfe88('0x42')][_0xfe88('0x44')]));_0x5617bc[_0xfe88('0x43')]=_0x5617bc[_0xfe88('0x43')]['length']?_0x5617bc[_0xfe88('0x43')]:_0x4f511f[_0xfe88('0x3e')];if(_0x319f76[_0xfe88('0x42')][_0xfe88('0x4d')]){_0x5617bc[_0xfe88('0x4e')]=[{'all':!![]}];}_0x5617bc=_[_0xfe88('0x4a')]({},_0x5617bc,_0x319f76[_0xfe88('0x4c')]);return db[_0xfe88('0x39')][_0xfe88('0x54')](_0x5617bc)['then'](handleEntityNotFound(_0x2ad05d,null))[_0xfe88('0x1d')](respondWithResult(_0x2ad05d,null))[_0xfe88('0x51')](handleError(_0x2ad05d,null));};exports[_0xfe88('0x55')]=function(_0x39ba8d,_0xf08dd){return db[_0xfe88('0x39')][_0xfe88('0x55')](_0x39ba8d[_0xfe88('0x56')],{})[_0xfe88('0x1d')](respondWithResult(_0xf08dd,0xc9))[_0xfe88('0x51')](handleError(_0xf08dd,null));};exports[_0xfe88('0x32')]=function(_0x4c75bd,_0xfb2e54){if(_0x4c75bd[_0xfe88('0x56')]['id']){delete _0x4c75bd[_0xfe88('0x56')]['id'];}return db[_0xfe88('0x39')][_0xfe88('0x54')]({'where':{'id':_0x4c75bd[_0xfe88('0x53')]['id']}})[_0xfe88('0x1d')](handleEntityNotFound(_0xfb2e54,null))[_0xfe88('0x1d')](saveUpdates(_0x4c75bd[_0xfe88('0x56')],null))['then'](respondWithResult(_0xfb2e54,null))[_0xfe88('0x51')](handleError(_0xfb2e54,null));};exports[_0xfe88('0x33')]=function(_0x3d2cf8,_0x233bad){return db[_0xfe88('0x39')][_0xfe88('0x54')]({'where':{'id':_0x3d2cf8[_0xfe88('0x53')]['id']}})[_0xfe88('0x1d')](handleEntityNotFound(_0x233bad,null))[_0xfe88('0x1d')](removeEntity(_0x233bad,null))[_0xfe88('0x51')](handleError(_0x233bad,null));};exports['describe']=function(_0x266380,_0x2182db){return db['WhatsappMessage'][_0xfe88('0x57')]()['then'](respondWithResult(_0x2182db,null))[_0xfe88('0x51')](handleError(_0x2182db,null));};var interaction_log=require('../../config/logger')(_0xfe88('0x58'));exports[_0xfe88('0x59')]=function(_0x43b097,_0x2abfd6,_0x2af975){var _0x34993b={'agent':{},'channel':_0xfe88('0x5a')};if(_0x43b097[_0xfe88('0x56')]['id']){delete _0x43b097['body']['id'];}_0x43b097[_0xfe88('0x56')][_0xfe88('0x5b')]=!![];_0x43b097[_0xfe88('0x56')][_0xfe88('0x5c')]=moment()[_0xfe88('0x5d')](_0xfe88('0x5e'));_0x43b097[_0xfe88('0x56')][_0xfe88('0x5f')]=_0x43b097[_0xfe88('0x56')][_0xfe88('0x5f')]||_0x43b097[_0xfe88('0x60')]['id'];_0x34993b[_0xfe88('0x61')]['id']=_0x43b097[_0xfe88('0x56')][_0xfe88('0x5f')];return db[_0xfe88('0x39')][_0xfe88('0x54')]({'where':{'id':_0x43b097[_0xfe88('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2abfd6,null))[_0xfe88('0x1d')](saveUpdates(_0x43b097['body'],null))[_0xfe88('0x1d')](function(_0x1c3217){if(_0x1c3217){_0x34993b['message']=_0x1c3217[_0xfe88('0x62')]({'plain':!![]});return db['WhatsappInteraction'][_0xfe88('0x54')]({'where':{'id':_0x1c3217[_0xfe88('0x63')]}});}return null;})[_0xfe88('0x1d')](handleEntityNotFound(_0x2abfd6,null))[_0xfe88('0x1d')](function(_0x20fbde){if(_0x20fbde){return _0x20fbde[_0xfe88('0x32')]({'UserId':_0x43b097[_0xfe88('0x56')][_0xfe88('0x5f')],'read1stAt':_[_0xfe88('0x64')](_0x20fbde['read1stAt'])?moment()[_0xfe88('0x5d')](_0xfe88('0x5e')):undefined});}return null;})[_0xfe88('0x1d')](function(_0x1b2be7){if(_0x1b2be7){_0x34993b[_0xfe88('0x65')]=_0x1b2be7[_0xfe88('0x62')]({'plain':!![]});interaction_log[_0xfe88('0x1e')]('[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x43b097[_0xfe88('0x60')]['id'],_0x43b097['user'][_0xfe88('0x35')],_0x43b097[_0xfe88('0x60')][_0xfe88('0x66')],_0x34993b[_0xfe88('0x65')]['id'],_0x43b097[_0xfe88('0x56')]?JSON[_0xfe88('0x67')](_0x43b097[_0xfe88('0x56')]):_0xfe88('0x68'));return respondWithRpcPromise(_0xfe88('0x69'),_0xfe88('0x6a'),_0x34993b);}return null;})[_0xfe88('0x1d')](function(_0x358fc8){var _0x3afa14=_0xfe88('0x6b')+_0x358fc8[_0xfe88('0x25')]['ContactId'];return db[_0xfe88('0x6c')][_0xfe88('0x42')](_0x3afa14,{'type':db[_0xfe88('0x6d')][_0xfe88('0x6e')]['SELECT'],'raw':!![]})['then'](function(_0x23b3de){return _0x23b3de;});})[_0xfe88('0x1d')](function(_0x508762){if(_0x508762){_0x34993b['message'][_0xfe88('0x6f')]=_0x508762[0x0];if(!_0x43b097[_0xfe88('0x56')][_0xfe88('0x5f')])return;return db[_0xfe88('0x70')][_0xfe88('0x54')]({'where':{'id':_0x43b097[_0xfe88('0x56')][_0xfe88('0x5f')],'role':_0xfe88('0x61')},'attributes':['id',_0xfe88('0x35'),'fullname',_0xfe88('0x71'),'internal'],'raw':!![]});}return null;})[_0xfe88('0x1d')](function(_0x5be6b7){if(!_0x5be6b7)return null;_0x34993b[_0xfe88('0x25')][_0xfe88('0x61')]=_0x5be6b7;return _0x34993b;})[_0xfe88('0x1d')](function(_0x19e057){if(_0x19e057){if(_0x43b097[_0xfe88('0x56')][_0xfe88('0x72')]){_0x34993b[_0xfe88('0x25')][_0xfe88('0x73')]=util[_0xfe88('0x5d')](_0xfe88('0x74'),_0x43b097['user'][_0xfe88('0x35')]);_0x34993b[_0xfe88('0x25')][_0xfe88('0x75')]=_0x34993b[_0xfe88('0x75')];_0x34993b[_0xfe88('0x25')][_0xfe88('0x76')]=_0x34993b[_0xfe88('0x75')];_0x34993b['message']['event']=_0xfe88('0x59');return respondWithRpcPromise(_0xfe88('0x77'),_0xfe88('0x77'),{'event':'acceptmessage','message':_0x34993b[_0xfe88('0x25')]},client9002)[_0xfe88('0x1d')](function(){return _0x34993b;});}return _0x34993b;}return null;})[_0xfe88('0x1d')](respondWithResult(_0x2abfd6,null))[_0xfe88('0x51')](handleError(_0x2abfd6,null));};var interaction_log=require(_0xfe88('0x11'))(_0xfe88('0x58'));exports[_0xfe88('0x78')]=function(_0x1c0924,_0x13ea03,_0x5a1594){var _0x465413={'agent':{},'channel':_0xfe88('0x5a')};if(_0x1c0924[_0xfe88('0x56')]['id']){delete _0x1c0924[_0xfe88('0x56')]['id'];}_0x1c0924['body'][_0xfe88('0x5f')]=_0x1c0924[_0xfe88('0x56')][_0xfe88('0x5f')]||_0x1c0924[_0xfe88('0x60')]['id'];_0x465413[_0xfe88('0x61')]['id']=_0x1c0924[_0xfe88('0x56')]['UserId'];return db[_0xfe88('0x39')][_0xfe88('0x54')]({'where':{'id':_0x1c0924[_0xfe88('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x13ea03,null))[_0xfe88('0x1d')](function(_0x9bd9fe){if(_0x9bd9fe){_0x465413[_0xfe88('0x25')]=_0x9bd9fe['get']({'plain':!![]});return db[_0xfe88('0x79')][_0xfe88('0x54')]({'where':{'id':_0x9bd9fe[_0xfe88('0x63')]}});}return null;})[_0xfe88('0x1d')](handleEntityNotFound(_0x13ea03,null))['then'](function(_0x4626de){if(_0x4626de){_0x465413[_0xfe88('0x65')]=_0x4626de['get']({'plain':!![]});interaction_log[_0xfe88('0x1e')](_0xfe88('0x7a'),_0x1c0924[_0xfe88('0x60')]['id'],_0x1c0924[_0xfe88('0x60')][_0xfe88('0x35')],_0x1c0924['user'][_0xfe88('0x66')],_0x465413[_0xfe88('0x65')]['id'],_0x1c0924[_0xfe88('0x56')]?JSON[_0xfe88('0x67')](_0x1c0924[_0xfe88('0x56')]):_0xfe88('0x68'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x465413);}return null;})[_0xfe88('0x1d')](function(_0xb7bf79){var _0x280d14=_0xfe88('0x6b')+_0xb7bf79[_0xfe88('0x25')][_0xfe88('0x7b')];return db[_0xfe88('0x6c')][_0xfe88('0x42')](_0x280d14,{'type':db['Sequelize'][_0xfe88('0x6e')]['SELECT'],'raw':!![]})['then'](function(_0x4c9565){return _0x4c9565;});})[_0xfe88('0x1d')](function(_0xaf6c75){if(_0xaf6c75){_0x465413[_0xfe88('0x25')][_0xfe88('0x6f')]=_0xaf6c75[0x0];if(!_0x1c0924[_0xfe88('0x56')][_0xfe88('0x5f')])return;return db[_0xfe88('0x70')][_0xfe88('0x54')]({'where':{'id':_0x1c0924[_0xfe88('0x56')][_0xfe88('0x5f')],'role':'agent'},'attributes':['id',_0xfe88('0x35'),_0xfe88('0x7c'),'email',_0xfe88('0x7d')],'raw':!![]});}return null;})['then'](function(_0x11b266){if(!_0x11b266)return null;_0x465413['message']['agent']=_0x11b266;return _0x465413;})[_0xfe88('0x1d')](function(_0x5ac548){if(_0x5ac548){_0x5ac548[_0xfe88('0x25')][_0xfe88('0x73')]=util[_0xfe88('0x5d')](_0xfe88('0x74'),_0x1c0924[_0xfe88('0x60')][_0xfe88('0x35')]);_0x5ac548[_0xfe88('0x25')][_0xfe88('0x75')]=_0x465413[_0xfe88('0x75')];_0x5ac548['message'][_0xfe88('0x76')]=_0x465413[_0xfe88('0x75')];_0x5ac548[_0xfe88('0x25')][_0xfe88('0x7e')]=_0xfe88('0x78');respondWithRpcPromise(_0xfe88('0x77'),_0xfe88('0x77'),{'event':_0xfe88('0x7f'),'message':_0x5ac548[_0xfe88('0x25')]},client9002);return _0x465413;}return null;})['then'](respondWithResult(_0x13ea03,null))[_0xfe88('0x51')](handleError(_0x13ea03,null));};exports[_0xfe88('0x28')]=function(_0x5aae80,_0x5bb997,_0xb9a27c){if(_0x5aae80[_0xfe88('0x56')]['id']){delete _0x5aae80[_0xfe88('0x56')]['id'];}var _0xcef325;return db[_0xfe88('0x39')][_0xfe88('0x54')]({'where':{'id':_0x5aae80[_0xfe88('0x53')]['id']}})['then'](handleEntityNotFound(_0x5bb997,null))['then'](function(_0x5c9f2d){if(_0x5c9f2d){_0xcef325=_0x5c9f2d;return db[_0xfe88('0x80')]['find']({'where':{'id':_0x5c9f2d[_0xfe88('0x81')]}});}})[_0xfe88('0x1d')](handleEntityNotFound(_0x5bb997,null))[_0xfe88('0x1d')](function(_0x1e8c88){if(_0x1e8c88){logger[_0xfe88('0x21')](_0xfe88('0x82'),_0xfe88('0x28'),'received\x20delivery\x20report\x20from',_0x1e8c88[_0xfe88('0x3c')],util[_0xfe88('0x83')](_0x5aae80[_0xfe88('0x56')],{'showHidden':![],'depth':null}));switch(_0x1e8c88[_0xfe88('0x3c')]){case _0xfe88('0x84'):if(_0x5aae80[_0xfe88('0x56')][_0xfe88('0x85')]&&_0x5aae80[_0xfe88('0x56')][_0xfe88('0x85')]===_0xcef325[_0xfe88('0x86')]&&_0x5aae80[_0xfe88('0x56')][_0xfe88('0x87')]&&_0x5aae80[_0xfe88('0x56')]['MessageStatus']===_0xfe88('0x5b')){return _0xcef325[_0xfe88('0x32')]({'read':!![]});}else{logger[_0xfe88('0x23')](_0xfe88('0x88'),_0xfe88('0x28'),_0xfe88('0x84'),util[_0xfe88('0x83')](_0x5aae80[_0xfe88('0x56')],{'showHidden':![],'depth':null}));}break;}return _0xcef325;}})[_0xfe88('0x1d')](respondWithResult(_0x5bb997,null))[_0xfe88('0x51')](handleError(_0x5bb997,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 0994dbc..267cb97 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 _0xab40=['hook','exports','events','../../mysqldb','update','remove','emit'];(function(_0x2cce70,_0x417165){var _0x798d77=function(_0x59a2e1){while(--_0x59a2e1){_0x2cce70['push'](_0x2cce70['shift']());}};_0x798d77(++_0x417165);}(_0xab40,0xcd));var _0x0ab4=function(_0x127271,_0x5ea98d){_0x127271=_0x127271-0x0;var _0x58e192=_0xab40[_0x127271];return _0x58e192;};'use strict';var EventEmitter=require(_0x0ab4('0x0'));var WhatsappMessage=require(_0x0ab4('0x1'))['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x0ab4('0x2'),'afterDestroy':_0x0ab4('0x3')};function emitEvent(_0xa340d8){return function(_0x2bf1ba,_0x14634a,_0x57fac1){WhatsappMessageEvents['emit'](_0xa340d8+':'+_0x2bf1ba['id'],_0x2bf1ba);WhatsappMessageEvents[_0x0ab4('0x4')](_0xa340d8,_0x2bf1ba);_0x57fac1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappMessage[_0x0ab4('0x5')](e,emitEvent(event));}}module[_0x0ab4('0x6')]=WhatsappMessageEvents; \ No newline at end of file +var _0x263f=['emit','exports','events','../../mysqldb','WhatsappMessage','setMaxListeners','save','update'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0x263f,0x182));var _0xf263=function(_0x35255a,_0x2ccfb4){_0x35255a=_0x35255a-0x0;var _0x4c2ee1=_0x263f[_0x35255a];return _0x4c2ee1;};'use strict';var EventEmitter=require(_0xf263('0x0'));var WhatsappMessage=require(_0xf263('0x1'))['db'][_0xf263('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xf263('0x3')](0x0);var events={'afterCreate':_0xf263('0x4'),'afterUpdate':_0xf263('0x5'),'afterDestroy':'remove'};function emitEvent(_0x3696a6){return function(_0x3c76e4,_0x453b6e,_0x528b98){WhatsappMessageEvents[_0xf263('0x6')](_0x3696a6+':'+_0x3c76e4['id'],_0x3c76e4);WhatsappMessageEvents[_0xf263('0x6')](_0x3696a6,_0x3c76e4);_0x528b98(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0xf263('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 ecdf39f..06714e9 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 _0x7196=['body','Bearer\x20','application/json','statuses','message_id','err','finally','utf8mb4','utf8mb4_unicode_ci','api','moment','node-fetch','path','../../config/environment','./whatsappMessage.attributes','exports','define','WhatsappMessage','whatsapp_messages','messageId','FULLTEXT','models','get','toLowerCase','out','secret','isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','createdAt','direction','catch','error','WhatsappAccount','WhatsappAccountId','then','type','twilio','authToken','phone','create','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','sid','update','inspect','WhatsappMessage,\x20%s,\x20%s,\x20%s','sinch','accountSid','baseUrl','/whatsapp/v1/','/messages/'];(function(_0x30004,_0x454184){var _0x8e205b=function(_0x28847b){while(--_0x28847b){_0x30004['push'](_0x30004['shift']());}};_0x8e205b(++_0x454184);}(_0x7196,0xb4));var _0x6719=function(_0x42cc6c,_0x2798b5){_0x42cc6c=_0x42cc6c-0x0;var _0x2e0af0=_0x7196[_0x42cc6c];return _0x2e0af0;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x6719('0x0'));var moment=require(_0x6719('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fetch=require(_0x6719('0x2'));var fs=require('fs');var path=require(_0x6719('0x3'));var rimraf=require('rimraf');var config=require(_0x6719('0x4'));var attributes=require(_0x6719('0x5'));module[_0x6719('0x6')]=function(_0x4bddf4,_0x58c6a8){return _0x4bddf4[_0x6719('0x7')](_0x6719('0x8'),attributes,{'tableName':_0x6719('0x9'),'paranoid':![],'indexes':[{'name':_0x6719('0xa'),'fields':[_0x6719('0xa')]},{'name':'fti_whatsapp_messages','fields':['body'],'type':_0x6719('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x84f50b,_0x31b59b,_0x5c9203){var _0x3ffe51=_0x4bddf4[_0x6719('0xc')];var _0x385ca5=_0x84f50b[_0x6719('0xd')]({'plain':!![]});if(_0x385ca5['direction'][_0x6719('0xe')]()==='in'||_0x385ca5['direction']['toLowerCase']()===_0x6719('0xf')&&!_0x385ca5[_0x6719('0x10')]&&!_[_0x6719('0x11')](_0x385ca5[_0x6719('0x12')])){_0x3ffe51[_0x6719('0x13')][_0x6719('0x14')]({'where':{'id':_0x385ca5[_0x6719('0x15')]}})['then'](function(_0x2da607){if(_0x2da607){_0x2da607['update']({'lastMsgAt':_0x385ca5[_0x6719('0x16')],'lastMsgDirection':_0x385ca5[_0x6719('0x17')]['toLowerCase']()});}})[_0x6719('0x18')](function(_0x40fce3){console[_0x6719('0x19')](_0x40fce3);});}if(_0x385ca5[_0x6719('0x17')]===_0x6719('0xf')&&!_0x385ca5[_0x6719('0x10')]){var _0x48add8;_0x3ffe51[_0x6719('0x1a')]['find']({'where':{'id':_0x385ca5[_0x6719('0x1b')]},'raw':!![]})[_0x6719('0x1c')](function(_0x3015b8){_0x48add8=_0x3015b8;if(_0x48add8&&_0x48add8[_0x6719('0x1d')]){switch(_0x48add8[_0x6719('0x1d')]){case _0x6719('0x1e'):var _0xf3df77=require('twilio');if(_0x48add8['accountSid']&&_0x48add8[_0x6719('0x1f')]&&_0x48add8[_0x6719('0x20')]){var _0x5a9fdb=new _0xf3df77(_0x48add8['accountSid'],_0x48add8[_0x6719('0x1f')]);_0x5a9fdb['messages'][_0x6719('0x21')]({'body':_0x385ca5['body'],'to':'whatsapp:'+_0x385ca5[_0x6719('0x20')],'from':_0x6719('0x22')+_0x48add8['phone'],'statusCallback':_0x48add8[_0x6719('0x23')]+_0x6719('0x24')+_0x385ca5['id']+_0x6719('0x25')+_0x48add8[_0x6719('0x26')]})[_0x6719('0x1c')](function(_0x2961f5){if(_0x2961f5[_0x6719('0x27')]){return _0x84f50b[_0x6719('0x28')]({'messageId':_0x2961f5[_0x6719('0x27')]});}})[_0x6719('0x18')](function(_0x5ef459){logger[_0x6719('0x19')]('WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','twilio',util[_0x6719('0x29')](_0x5ef459,{'showHidden':![],'depth':null}));});}else{logger[_0x6719('0x19')](_0x6719('0x2a'),'afterCreate',_0x6719('0x1e'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x6719('0x2b'):var _0xad07c0=_0x48add8[_0x6719('0x2c')];var _0x5c266f=_0x48add8[_0x6719('0x1f')];var _0x3bc1c5=_0x48add8[_0x6719('0x2d')]+_0x6719('0x2e')+_0xad07c0+_0x6719('0x2f');var _0x127e95={'to':[_0x385ca5[_0x6719('0x20')]],'message':{'type':'text','text':_0x385ca5[_0x6719('0x30')]}};var _0x22943e={'method':'POST','uri':_0x3bc1c5,'headers':{'Authorization':_0x6719('0x31')+_0x5c266f,'Content-Type':_0x6719('0x32')},'body':_0x127e95,'json':!![]};rp(_0x22943e)[_0x6719('0x1c')](function(_0x245bdc){if(_0x245bdc[_0x6719('0x33')][0x0][_0x6719('0x34')]){return _0x84f50b[_0x6719('0x28')]({'messageId':_0x245bdc[_0x6719('0x33')][0x0][_0x6719('0x34')]});}})[_0x6719('0x18')](function(_0x32a008){logger[_0x6719('0x35')]('WhatsappMessage,\x20%s',_0x32a008);});break;}}})[_0x6719('0x36')](function(){_0x5c9203();});}else{_0x5c9203();}}},'charset':_0x6719('0x37'),'collate':_0x6719('0x38')});}; \ No newline at end of file +var _0x4b99=['type','twilio','accountSid','authToken','messages','create','whatsapp:','phone','remote','/api/whatsapp/messages/','/status?token=','sid','update','catch','inspect','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','application/json','message_id','statuses','WhatsappMessage,\x20%s','utf8mb4','lodash','util','../../config/logger','bluebird','request-promise','path','./whatsappMessage.attributes','exports','define','whatsapp_messages','messageId','body','models','get','direction','toLowerCase','out','secret','isNil','findOne','then','createdAt','error','WhatsappAccount','find'];(function(_0x3c98d1,_0x37954c){var _0xc59d4a=function(_0x4dc5b6){while(--_0x4dc5b6){_0x3c98d1['push'](_0x3c98d1['shift']());}};_0xc59d4a(++_0x37954c);}(_0x4b99,0x107));var _0x94b9=function(_0x3f734c,_0x2007e1){_0x3f734c=_0x3f734c-0x0;var _0x183ef9=_0x4b99[_0x3f734c];return _0x183ef9;};'use strict';var _=require(_0x94b9('0x0'));var util=require(_0x94b9('0x1'));var logger=require(_0x94b9('0x2'))('api');var moment=require('moment');var BPromise=require(_0x94b9('0x3'));var rp=require(_0x94b9('0x4'));var fetch=require('node-fetch');var fs=require('fs');var path=require(_0x94b9('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x94b9('0x6'));module[_0x94b9('0x7')]=function(_0x37ee29,_0x25fea7){return _0x37ee29[_0x94b9('0x8')]('WhatsappMessage',attributes,{'tableName':_0x94b9('0x9'),'paranoid':![],'indexes':[{'name':_0x94b9('0xa'),'fields':[_0x94b9('0xa')]},{'name':'fti_whatsapp_messages','fields':[_0x94b9('0xb')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x26679e,_0x146ad1,_0x282147){var _0x152e87=_0x37ee29[_0x94b9('0xc')];var _0x323ab6=_0x26679e[_0x94b9('0xd')]({'plain':!![]});if(_0x323ab6[_0x94b9('0xe')][_0x94b9('0xf')]()==='in'||_0x323ab6[_0x94b9('0xe')][_0x94b9('0xf')]()===_0x94b9('0x10')&&!_0x323ab6[_0x94b9('0x11')]&&!_[_0x94b9('0x12')](_0x323ab6['UserId'])){_0x152e87['WhatsappInteraction'][_0x94b9('0x13')]({'where':{'id':_0x323ab6['WhatsappInteractionId']}})[_0x94b9('0x14')](function(_0x93012f){if(_0x93012f){_0x93012f['update']({'lastMsgAt':_0x323ab6[_0x94b9('0x15')],'lastMsgDirection':_0x323ab6[_0x94b9('0xe')]['toLowerCase']()});}})['catch'](function(_0x1d488f){console[_0x94b9('0x16')](_0x1d488f);});}if(_0x323ab6[_0x94b9('0xe')]===_0x94b9('0x10')&&!_0x323ab6[_0x94b9('0x11')]){var _0x4f9384;_0x152e87[_0x94b9('0x17')][_0x94b9('0x18')]({'where':{'id':_0x323ab6['WhatsappAccountId']},'raw':!![]})[_0x94b9('0x14')](function(_0x5ad329){_0x4f9384=_0x5ad329;if(_0x4f9384&&_0x4f9384[_0x94b9('0x19')]){switch(_0x4f9384[_0x94b9('0x19')]){case _0x94b9('0x1a'):var _0x1afeec=require(_0x94b9('0x1a'));if(_0x4f9384[_0x94b9('0x1b')]&&_0x4f9384[_0x94b9('0x1c')]&&_0x4f9384['phone']){var _0x1b690d=new _0x1afeec(_0x4f9384[_0x94b9('0x1b')],_0x4f9384[_0x94b9('0x1c')]);_0x1b690d[_0x94b9('0x1d')][_0x94b9('0x1e')]({'body':_0x323ab6['body'],'to':_0x94b9('0x1f')+_0x323ab6[_0x94b9('0x20')],'from':_0x94b9('0x1f')+_0x4f9384[_0x94b9('0x20')],'statusCallback':_0x4f9384[_0x94b9('0x21')]+_0x94b9('0x22')+_0x323ab6['id']+_0x94b9('0x23')+_0x4f9384['token']})[_0x94b9('0x14')](function(_0x11d5f4){if(_0x11d5f4[_0x94b9('0x24')]){return _0x26679e[_0x94b9('0x25')]({'messageId':_0x11d5f4[_0x94b9('0x24')]});}})[_0x94b9('0x26')](function(_0x825fb9){logger[_0x94b9('0x16')]('WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','twilio',util[_0x94b9('0x27')](_0x825fb9,{'showHidden':![],'depth':null}));});}else{logger[_0x94b9('0x16')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x94b9('0x28'),_0x94b9('0x1a'),_0x94b9('0x29'));}break;case _0x94b9('0x2a'):var _0x37c3da=_0x4f9384[_0x94b9('0x1b')];var _0x341fbd=_0x4f9384[_0x94b9('0x1c')];var _0x3f9fa7=_0x4f9384['baseUrl']+'/whatsapp/v1/'+_0x37c3da+'/messages/';var _0x443426={'to':[_0x323ab6['phone']],'message':{'type':'text','text':_0x323ab6['body']}};var _0x2776c9={'method':'POST','uri':_0x3f9fa7,'headers':{'Authorization':'Bearer\x20'+_0x341fbd,'Content-Type':_0x94b9('0x2b')},'body':_0x443426,'json':!![]};rp(_0x2776c9)[_0x94b9('0x14')](function(_0x3c9c93){if(_0x3c9c93['statuses'][0x0][_0x94b9('0x2c')]){return _0x26679e[_0x94b9('0x25')]({'messageId':_0x3c9c93[_0x94b9('0x2d')][0x0][_0x94b9('0x2c')]});}})[_0x94b9('0x26')](function(_0x5a8737){logger['err'](_0x94b9('0x2e'),_0x5a8737);});break;}}})['finally'](function(){_0x282147();});}else{_0x282147();}}},'charset':_0x94b9('0x2f'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index f153a62..641fc3d 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 _0xfd9c=['moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','client','redis','defaults','localhost','socket.io-emitter','register','request','then','WhatsappMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','catch','CreateWhatsappMessage','WhatsappMessage','create','body','options','raw','lodash'];(function(_0x41a05b,_0x364092){var _0x5d5afc=function(_0x1c7c23){while(--_0x1c7c23){_0x41a05b['push'](_0x41a05b['shift']());}};_0x5d5afc(++_0x364092);}(_0xfd9c,0xef));var _0xcfd9=function(_0x33bcdb,_0x11846b){_0x33bcdb=_0x33bcdb-0x0;var _0x18a9bf=_0xfd9c[_0x33bcdb];return _0x18a9bf;};'use strict';var _=require(_0xcfd9('0x0'));var util=require('util');var moment=require(_0xcfd9('0x1'));var BPromise=require(_0xcfd9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcfd9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xcfd9('0x4'));var logger=require(_0xcfd9('0x5'))(_0xcfd9('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xcfd9('0x7')]['http']({'port':0x232a});config[_0xcfd9('0x8')]=_[_0xcfd9('0x9')](config[_0xcfd9('0x8')],{'host':_0xcfd9('0xa'),'port':0x18eb});var socket=require(_0xcfd9('0xb'))(new Redis(config[_0xcfd9('0x8')]));require('./whatsappMessage.socket')[_0xcfd9('0xc')](socket);function respondWithRpcPromise(_0x1be393,_0x19a018,_0x13116d){return new BPromise(function(_0x531a11,_0x8c753a){return client[_0xcfd9('0xd')](_0x1be393,_0x13116d)[_0xcfd9('0xe')](function(_0x21e074){logger['info'](_0xcfd9('0xf'),_0x19a018,'request\x20sent');logger[_0xcfd9('0x10')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x19a018,_0xcfd9('0x11'),JSON[_0xcfd9('0x12')](_0x21e074));if(_0x21e074[_0xcfd9('0x13')]){if(_0x21e074['error'][_0xcfd9('0x14')]===0x1f4){logger[_0xcfd9('0x13')](_0xcfd9('0xf'),_0x19a018,_0x21e074[_0xcfd9('0x13')][_0xcfd9('0x15')]);return _0x8c753a(_0x21e074['error']['message']);}logger['error'](_0xcfd9('0xf'),_0x19a018,_0x21e074[_0xcfd9('0x13')][_0xcfd9('0x15')]);return _0x531a11(_0x21e074[_0xcfd9('0x13')][_0xcfd9('0x15')]);}else{logger[_0xcfd9('0x16')]('WhatsappMessage,\x20%s,\x20%s',_0x19a018,'request\x20sent');_0x531a11(_0x21e074['result'][_0xcfd9('0x15')]);}})[_0xcfd9('0x17')](function(_0x4d050f){logger[_0xcfd9('0x13')](_0xcfd9('0xf'),_0x19a018,_0x4d050f);_0x8c753a(_0x4d050f);});});}exports[_0xcfd9('0x18')]=function(_0x1164be){var _0x1a084e=this;return new Promise(function(_0x35759b,_0x1e083c){return db[_0xcfd9('0x19')][_0xcfd9('0x1a')](_0x1164be[_0xcfd9('0x1b')],{'raw':_0x1164be[_0xcfd9('0x1c')]?_0x1164be[_0xcfd9('0x1c')][_0xcfd9('0x1d')]===undefined?!![]:![]:!![]})[_0xcfd9('0xe')](function(_0x33df9c){logger[_0xcfd9('0x16')](_0xcfd9('0x18'),_0x1164be);logger[_0xcfd9('0x10')](_0xcfd9('0x18'),_0x1164be,JSON[_0xcfd9('0x12')](_0x33df9c));_0x35759b(_0x33df9c);})['catch'](function(_0x3d84df){logger[_0xcfd9('0x13')]('CreateWhatsappMessage',_0x3d84df[_0xcfd9('0x15')],_0x1164be);_0x1e083c(_0x1a084e[_0xcfd9('0x13')](0x1f4,_0x3d84df[_0xcfd9('0x15')]));});});}; \ No newline at end of file +var _0x5efb=['util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./whatsappMessage.socket','register','info','WhatsappMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','CreateWhatsappMessage','WhatsappMessage','create','options','then','catch','lodash'];(function(_0x2e55b5,_0x3c30c7){var _0x295cb4=function(_0x5bcdc7){while(--_0x5bcdc7){_0x2e55b5['push'](_0x2e55b5['shift']());}};_0x295cb4(++_0x3c30c7);}(_0x5efb,0x1d0));var _0xb5ef=function(_0x66f455,_0x43978d){_0x66f455=_0x66f455-0x0;var _0x2f4d67=_0x5efb[_0x66f455];return _0x2f4d67;};'use strict';var _=require(_0xb5ef('0x0'));var util=require(_0xb5ef('0x1'));var moment=require('moment');var BPromise=require(_0xb5ef('0x2'));var rs=require(_0xb5ef('0x3'));var fs=require('fs');var Redis=require(_0xb5ef('0x4'));var db=require(_0xb5ef('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb5ef('0x6'));var config=require(_0xb5ef('0x7'));var jayson=require(_0xb5ef('0x8'));var client=jayson[_0xb5ef('0x9')][_0xb5ef('0xa')]({'port':0x232a});config[_0xb5ef('0xb')]=_[_0xb5ef('0xc')](config[_0xb5ef('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xb5ef('0xd'))(new Redis(config['redis']));require(_0xb5ef('0xe'))[_0xb5ef('0xf')](socket);function respondWithRpcPromise(_0x2751ad,_0x4f6dfd,_0x1e1b0c){return new BPromise(function(_0x3de0f4,_0x57bfb4){return client['request'](_0x2751ad,_0x1e1b0c)['then'](function(_0x25671c){logger[_0xb5ef('0x10')](_0xb5ef('0x11'),_0x4f6dfd,'request\x20sent');logger[_0xb5ef('0x12')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x4f6dfd,_0xb5ef('0x13'),JSON[_0xb5ef('0x14')](_0x25671c));if(_0x25671c[_0xb5ef('0x15')]){if(_0x25671c[_0xb5ef('0x15')][_0xb5ef('0x16')]===0x1f4){logger['error'](_0xb5ef('0x11'),_0x4f6dfd,_0x25671c['error'][_0xb5ef('0x17')]);return _0x57bfb4(_0x25671c['error'][_0xb5ef('0x17')]);}logger[_0xb5ef('0x15')](_0xb5ef('0x11'),_0x4f6dfd,_0x25671c['error'][_0xb5ef('0x17')]);return _0x3de0f4(_0x25671c[_0xb5ef('0x15')][_0xb5ef('0x17')]);}else{logger[_0xb5ef('0x10')](_0xb5ef('0x11'),_0x4f6dfd,'request\x20sent');_0x3de0f4(_0x25671c[_0xb5ef('0x18')]['message']);}})['catch'](function(_0x19556b){logger[_0xb5ef('0x15')](_0xb5ef('0x11'),_0x4f6dfd,_0x19556b);_0x57bfb4(_0x19556b);});});}exports[_0xb5ef('0x19')]=function(_0x56acd4){var _0x50755d=this;return new Promise(function(_0xd2f9a5,_0x589718){return db[_0xb5ef('0x1a')][_0xb5ef('0x1b')](_0x56acd4['body'],{'raw':_0x56acd4[_0xb5ef('0x1c')]?_0x56acd4[_0xb5ef('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0xb5ef('0x1d')](function(_0x4b0453){logger['info'](_0xb5ef('0x19'),_0x56acd4);logger[_0xb5ef('0x12')](_0xb5ef('0x19'),_0x56acd4,JSON[_0xb5ef('0x14')](_0x4b0453));_0xd2f9a5(_0x4b0453);})[_0xb5ef('0x1e')](function(_0x2aa6ba){logger['error'](_0xb5ef('0x19'),_0x2aa6ba[_0xb5ef('0x17')],_0x56acd4);_0x589718(_0x50755d[_0xb5ef('0x15')](0x1f4,_0x2aa6ba[_0xb5ef('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 7f6d010..6d82c7b 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 _0x2170=['update','emit','register','whatsappMessage:','save'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0x2170,0x68));var _0x0217=function(_0x2e4032,_0x5e6c8c){_0x2e4032=_0x2e4032-0x0;var _0x5433f9=_0x2170[_0x2e4032];return _0x5433f9;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=[_0x0217('0x0'),'remove',_0x0217('0x1')];function createListener(_0x5cc059,_0x347757){return function(_0xd7939f){_0x347757[_0x0217('0x2')](_0x5cc059,_0xd7939f);};}function removeListener(_0xd3fed4,_0x2a5ef0){return function(){WhatsappMessageEvents['removeListener'](_0xd3fed4,_0x2a5ef0);};}exports[_0x0217('0x3')]=function(_0x3171ef){for(var _0x528c36=0x0,_0x1e21fe=events['length'];_0x528c36<_0x1e21fe;_0x528c36++){var _0x571a6c=events[_0x528c36];var _0x59fe76=createListener(_0x0217('0x4')+_0x571a6c,_0x3171ef);WhatsappMessageEvents['on'](_0x571a6c,_0x59fe76);}}; \ No newline at end of file +var _0x3f90=['./whatsappMessage.events','save','update','emit','removeListener','length','whatsappMessage:'];(function(_0x515054,_0x5d42bb){var _0x26206d=function(_0x3359b8){while(--_0x3359b8){_0x515054['push'](_0x515054['shift']());}};_0x26206d(++_0x5d42bb);}(_0x3f90,0x157));var _0x03f9=function(_0x2ad56f,_0x53f456){_0x2ad56f=_0x2ad56f-0x0;var _0x1c99cb=_0x3f90[_0x2ad56f];return _0x1c99cb;};'use strict';var WhatsappMessageEvents=require(_0x03f9('0x0'));var events=[_0x03f9('0x1'),'remove',_0x03f9('0x2')];function createListener(_0x3d2c8b,_0x37b9a0){return function(_0x57d12a){_0x37b9a0[_0x03f9('0x3')](_0x3d2c8b,_0x57d12a);};}function removeListener(_0x51f22c,_0x25d40e){return function(){WhatsappMessageEvents[_0x03f9('0x4')](_0x51f22c,_0x25d40e);};}exports['register']=function(_0x364e39){for(var _0x89f051=0x0,_0x3b7404=events[_0x03f9('0x5')];_0x89f051<_0x3b7404;_0x89f051++){var _0x2b037d=events[_0x89f051];var _0x2e5e18=createListener(_0x03f9('0x6')+_0x2b037d,_0x364e39);WhatsappMessageEvents['on'](_0x2b037d,_0x2e5e18);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 221c2d0..0eaf43e 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 _0xbb9d=['../../components/auth/service','../../components/interaction/service','./whatsappQueue.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/users','getAgents','post','create','addTeams','destroy','delete','/:id/teams','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','fs-extra'];(function(_0x42e7b5,_0x50157e){var _0x24f305=function(_0xc246e1){while(--_0xc246e1){_0x42e7b5['push'](_0x42e7b5['shift']());}};_0x24f305(++_0x50157e);}(_0xbb9d,0x113));var _0xdbb9=function(_0x432e52,_0x271664){_0x432e52=_0x432e52-0x0;var _0x5b96cd=_0xbb9d[_0x432e52];return _0x5b96cd;};'use strict';var multer=require(_0xdbb9('0x0'));var util=require(_0xdbb9('0x1'));var path=require('path');var timeout=require(_0xdbb9('0x2'));var express=require(_0xdbb9('0x3'));var router=express['Router']();var fs_extra=require(_0xdbb9('0x4'));var auth=require(_0xdbb9('0x5'));var interaction=require(_0xdbb9('0x6'));var config=require('../../config/environment');var controller=require(_0xdbb9('0x7'));router[_0xdbb9('0x8')]('/',auth['isAuthenticated'](),controller[_0xdbb9('0x9')]);router[_0xdbb9('0x8')](_0xdbb9('0xa'),auth[_0xdbb9('0xb')](),controller[_0xdbb9('0xc')]);router[_0xdbb9('0x8')](_0xdbb9('0xd'),auth[_0xdbb9('0xb')](),controller[_0xdbb9('0xe')]);router['get'](_0xdbb9('0xf'),auth[_0xdbb9('0xb')](),controller[_0xdbb9('0x10')]);router['get']('/:id/teams',auth['isAuthenticated'](),controller['getTeams']);router['get'](_0xdbb9('0x11'),auth['isAuthenticated'](),controller[_0xdbb9('0x12')]);router[_0xdbb9('0x13')]('/',auth['isAuthenticated'](),controller[_0xdbb9('0x14')]);router[_0xdbb9('0x13')]('/:id/teams',auth[_0xdbb9('0xb')](),controller[_0xdbb9('0x15')]);router['post'](_0xdbb9('0x11'),auth[_0xdbb9('0xb')](),controller['addAgents']);router['put']('/:id',auth[_0xdbb9('0xb')](),controller['update']);router['delete']('/:id',auth[_0xdbb9('0xb')](),controller[_0xdbb9('0x16')]);router[_0xdbb9('0x17')](_0xdbb9('0x18'),auth[_0xdbb9('0xb')](),controller[_0xdbb9('0x19')]);router['delete']('/:id/users',auth[_0xdbb9('0xb')](),controller[_0xdbb9('0x1a')]);module[_0xdbb9('0x1b')]=router; \ No newline at end of file +var _0xc79b=['getAgents','post','addTeams','addAgents','delete','removeAgents','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xc79b,0x186));var _0xbc79=function(_0x3c6383,_0x2c18b3){_0x3c6383=_0x3c6383-0x0;var _0x1d3c69=_0xc79b[_0x3c6383];return _0x1d3c69;};'use strict';var multer=require('multer');var util=require(_0xbc79('0x0'));var path=require('path');var timeout=require(_0xbc79('0x1'));var express=require(_0xbc79('0x2'));var router=express[_0xbc79('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbc79('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xbc79('0x5'));var controller=require('./whatsappQueue.controller');router['get']('/',auth[_0xbc79('0x6')](),controller[_0xbc79('0x7')]);router[_0xbc79('0x8')](_0xbc79('0x9'),auth[_0xbc79('0x6')](),controller[_0xbc79('0xa')]);router[_0xbc79('0x8')](_0xbc79('0xb'),auth[_0xbc79('0x6')](),controller[_0xbc79('0xc')]);router['get'](_0xbc79('0xd'),auth[_0xbc79('0x6')](),controller[_0xbc79('0xe')]);router[_0xbc79('0x8')](_0xbc79('0xf'),auth['isAuthenticated'](),controller[_0xbc79('0x10')]);router[_0xbc79('0x8')](_0xbc79('0x11'),auth[_0xbc79('0x6')](),controller[_0xbc79('0x12')]);router[_0xbc79('0x13')]('/',auth[_0xbc79('0x6')](),controller['create']);router['post']('/:id/teams',auth['isAuthenticated'](),controller[_0xbc79('0x14')]);router[_0xbc79('0x13')]('/:id/users',auth[_0xbc79('0x6')](),controller[_0xbc79('0x15')]);router['put'](_0xbc79('0xb'),auth[_0xbc79('0x6')](),controller['update']);router['delete'](_0xbc79('0xb'),auth[_0xbc79('0x6')](),controller['destroy']);router['delete'](_0xbc79('0xf'),auth[_0xbc79('0x6')](),controller['removeTeams']);router[_0xbc79('0x16')](_0xbc79('0x11'),auth[_0xbc79('0x6')](),controller[_0xbc79('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 9ac51b6..f560f76 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 _0x2621=['STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports'];(function(_0x1147ab,_0x10e72b){var _0x55cb5a=function(_0x364bd6){while(--_0x364bd6){_0x1147ab['push'](_0x1147ab['shift']());}};_0x55cb5a(++_0x10e72b);}(_0x2621,0x1d2));var _0x1262=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2621[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x1262('0x0'));module[_0x1262('0x1')]={'name':{'type':Sequelize[_0x1262('0x2')],'unique':_0x1262('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x1262('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1262('0x5')](_0x1262('0x6'),_0x1262('0x7'),_0x1262('0x8'))},'description':{'type':Sequelize[_0x1262('0x2')]}}; \ No newline at end of file +var _0xffaa=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','ENUM'];(function(_0x207410,_0x45e49a){var _0xa8a72e=function(_0x47bf5f){while(--_0x47bf5f){_0x207410['push'](_0x207410['shift']());}};_0xa8a72e(++_0x45e49a);}(_0xffaa,0x130));var _0xaffa=function(_0x18c5c5,_0x3c4783){_0x18c5c5=_0x18c5c5-0x0;var _0x582bdf=_0xffaa[_0x18c5c5];return _0x582bdf;};'use strict';var Sequelize=require(_0xaffa('0x0'));module[_0xaffa('0x1')]={'name':{'type':Sequelize[_0xaffa('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xaffa('0x3')](_0xaffa('0x4'),_0xaffa('0x5'),_0xaffa('0x6'))},'description':{'type':Sequelize[_0xaffa('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index fad32c6..bc84b4b 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 _0x8a3a=['rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','user','role','WhatsappQueues','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','UserWhatsappQueue','WhatsappQueueId','User','findAndCountAll','UserId','agent','whatsappPause','createdAt','format','SIP','getTeams','findOne','Team','ids','Agents','online','voicePause','interface','transaction','addTeams','each','findOrCreate','forEach','emit','removeTeams','select','tq.TeamId','from','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','TeamId','all','union','compact','value','isEmpty','userWhatsappQueue:remove','addAgents','spread','userWhatsappQueue:save','removeAgents','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','WhatsappQueue'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0x8a3a,0xe4));var _0xa8a3=function(_0x39d215,_0x5b418c){_0x39d215=_0x39d215-0x0;var _0x6c6a61=_0x8a3a[_0x39d215];return _0x6c6a61;};'use strict';var emlformat=require(_0xa8a3('0x0'));var rimraf=require(_0xa8a3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa8a3('0x2'));var rp=require(_0xa8a3('0x3'));var moment=require(_0xa8a3('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa8a3('0x5'));var util=require('util');var path=require(_0xa8a3('0x6'));var sox=require(_0xa8a3('0x7'));var csv=require(_0xa8a3('0x8'));var ejs=require(_0xa8a3('0x9'));var fs=require('fs');var fs_extra=require(_0xa8a3('0xa'));var _=require('lodash');var squel=require(_0xa8a3('0xb'));var crypto=require(_0xa8a3('0xc'));var jsforce=require(_0xa8a3('0xd'));var deskjs=require(_0xa8a3('0xe'));var toCsv=require(_0xa8a3('0x8'));var querystring=require(_0xa8a3('0xf'));var Papa=require(_0xa8a3('0x10'));var Redis=require(_0xa8a3('0x11'));var authService=require(_0xa8a3('0x12'));var qs=require(_0xa8a3('0x13'));var as=require(_0xa8a3('0x14'));var hardwareService=require(_0xa8a3('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xa8a3('0x16'));var config=require(_0xa8a3('0x17'));var licenseUtil=require(_0xa8a3('0x18'));var db=require(_0xa8a3('0x19'))['db'];config['redis']=_[_0xa8a3('0x1a')](config[_0xa8a3('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0xa8a3('0x1c'))(new Redis(config[_0xa8a3('0x1b')]));require(_0xa8a3('0x1d'))[_0xa8a3('0x1e')](socket);function respondWithStatusCode(_0x1e26fe,_0x478ecc){_0x478ecc=_0x478ecc||0xcc;return function(_0x18e7ab){if(_0x18e7ab){return _0x1e26fe[_0xa8a3('0x1f')](_0x478ecc);}return _0x1e26fe[_0xa8a3('0x20')](_0x478ecc)[_0xa8a3('0x21')]();};}function respondWithResult(_0x3c8e55,_0x177b80){_0x177b80=_0x177b80||0xc8;return function(_0x3d1350){if(_0x3d1350){return _0x3c8e55[_0xa8a3('0x20')](_0x177b80)[_0xa8a3('0x22')](_0x3d1350);}};}function respondWithFilteredResult(_0x41d3ff,_0x130a79){return function(_0xb9cc2a){if(_0xb9cc2a){var _0x390fbb=typeof _0x130a79[_0xa8a3('0x23')]==='undefined'&&typeof _0x130a79['limit']===_0xa8a3('0x24');var _0x1f1bb0=_0xb9cc2a[_0xa8a3('0x25')];var _0x52f549=_0x390fbb?0x0:_0x130a79['offset'];var _0x255b7e=_0x390fbb?_0xb9cc2a['count']:_0x130a79[_0xa8a3('0x23')]+_0x130a79['limit'];var _0x35ed5d;if(_0x255b7e>=_0x1f1bb0){_0x255b7e=_0x1f1bb0;_0x35ed5d=0xc8;}else{_0x35ed5d=0xce;}_0x41d3ff['status'](_0x35ed5d);return _0x41d3ff[_0xa8a3('0x26')](_0xa8a3('0x27'),_0x52f549+'-'+_0x255b7e+'/'+_0x1f1bb0)[_0xa8a3('0x22')](_0xb9cc2a);}return null;};}function patchUpdates(_0x1abbce){return function(_0x8b7261){try{jsonpatch[_0xa8a3('0x28')](_0x8b7261,_0x1abbce,!![]);}catch(_0x4d4e63){return BPromise['reject'](_0x4d4e63);}return _0x8b7261[_0xa8a3('0x29')]();};}function saveUpdates(_0x50a38d,_0x28a7e7){return function(_0x191e11){if(_0x191e11){return _0x191e11[_0xa8a3('0x2a')](_0x50a38d)[_0xa8a3('0x2b')](function(_0x1af504){return _0x1af504;});}return null;};}function removeEntity(_0x5a3197,_0x26d7b5){return function(_0x22b09e){if(_0x22b09e){return _0x22b09e[_0xa8a3('0x2c')]()[_0xa8a3('0x2b')](function(){var _0xb21165=_0x22b09e[_0xa8a3('0x2d')]({'plain':!![]});var _0x4fbb30='WhatsappQueues';return db[_0xa8a3('0x2e')][_0xa8a3('0x2c')]({'where':{'type':_0x4fbb30,'resourceId':_0xb21165['id']}})[_0xa8a3('0x2b')](function(){return _0x22b09e;});})[_0xa8a3('0x2b')](function(){_0x5a3197[_0xa8a3('0x20')](0xcc)[_0xa8a3('0x21')]();});}};}function handleEntityNotFound(_0x3c34d2,_0x532224){return function(_0x641e58){if(!_0x641e58){_0x3c34d2['sendStatus'](0x194);}return _0x641e58;};}function handleError(_0x49723f,_0x46f6c6){_0x46f6c6=_0x46f6c6||0x1f4;return function(_0x43e4e5){logger[_0xa8a3('0x2f')](_0x43e4e5[_0xa8a3('0x30')]);if(_0x43e4e5[_0xa8a3('0x31')]){delete _0x43e4e5['name'];}_0x49723f[_0xa8a3('0x20')](_0x46f6c6)[_0xa8a3('0x32')](_0x43e4e5);};}exports[_0xa8a3('0x33')]=function(_0x371ff4,_0x1dd632){var _0x3f6fe4={},_0x536c01={},_0x29a41f={'count':0x0,'rows':[]};var _0x22a764=_[_0xa8a3('0x34')](db[_0xa8a3('0x35')][_0xa8a3('0x36')],function(_0x52b7ca){return{'name':_0x52b7ca[_0xa8a3('0x37')],'type':_0x52b7ca[_0xa8a3('0x38')][_0xa8a3('0x39')]};});_0x536c01[_0xa8a3('0x3a')]=_[_0xa8a3('0x34')](_0x22a764,_0xa8a3('0x31'));_0x536c01[_0xa8a3('0x3b')]=_[_0xa8a3('0x3c')](_0x371ff4['query']);_0x536c01['filters']=_[_0xa8a3('0x3d')](_0x536c01[_0xa8a3('0x3a')],_0x536c01[_0xa8a3('0x3b')]);_0x3f6fe4[_0xa8a3('0x3e')]=_[_0xa8a3('0x3d')](_0x536c01[_0xa8a3('0x3a')],qs[_0xa8a3('0x3f')](_0x371ff4[_0xa8a3('0x3b')]['fields']));_0x3f6fe4[_0xa8a3('0x3e')]=_0x3f6fe4[_0xa8a3('0x3e')]['length']?_0x3f6fe4['attributes']:_0x536c01['model'];if(!_0x371ff4[_0xa8a3('0x3b')][_0xa8a3('0x40')](_0xa8a3('0x41'))){_0x3f6fe4[_0xa8a3('0x42')]=qs[_0xa8a3('0x42')](_0x371ff4['query'][_0xa8a3('0x42')]);_0x3f6fe4[_0xa8a3('0x23')]=qs[_0xa8a3('0x23')](_0x371ff4[_0xa8a3('0x3b')][_0xa8a3('0x23')]);}_0x3f6fe4[_0xa8a3('0x43')]=qs[_0xa8a3('0x44')](_0x371ff4[_0xa8a3('0x3b')]['sort']);_0x3f6fe4[_0xa8a3('0x45')]=qs['filters'](_[_0xa8a3('0x46')](_0x371ff4[_0xa8a3('0x3b')],_0x536c01[_0xa8a3('0x47')]),_0x22a764);if(_0x371ff4[_0xa8a3('0x3b')][_0xa8a3('0x48')]){_0x3f6fe4['where']=_[_0xa8a3('0x49')](_0x3f6fe4['where'],{'$or':_[_0xa8a3('0x34')](_0x22a764,function(_0x137eb5){if(_0x137eb5[_0xa8a3('0x38')]!==_0xa8a3('0x4a')){var _0x446e8d={};_0x446e8d[_0x137eb5[_0xa8a3('0x31')]]={'$like':'%'+_0x371ff4['query'][_0xa8a3('0x48')]+'%'};return _0x446e8d;}})});}_0x3f6fe4=_['merge']({},_0x3f6fe4,_0x371ff4[_0xa8a3('0x4b')]);var _0x4472e2={'where':_0x3f6fe4[_0xa8a3('0x45')]};return db[_0xa8a3('0x35')][_0xa8a3('0x25')](_0x4472e2)['then'](function(_0x27d1d7){_0x29a41f['count']=_0x27d1d7;if(_0x371ff4['query'][_0xa8a3('0x4c')]){_0x3f6fe4[_0xa8a3('0x4d')]=[{'all':!![]}];}return db[_0xa8a3('0x35')][_0xa8a3('0x4e')](_0x3f6fe4);})['then'](function(_0x555ba0){_0x29a41f[_0xa8a3('0x4f')]=_0x555ba0;return _0x29a41f;})[_0xa8a3('0x2b')](respondWithFilteredResult(_0x1dd632,_0x3f6fe4))[_0xa8a3('0x50')](handleError(_0x1dd632,null));};exports[_0xa8a3('0x51')]=function(_0x51ca75,_0x3be5e5){var _0x249d7d={'raw':!![],'where':{'id':_0x51ca75[_0xa8a3('0x52')]['id']}},_0x3c9c7a={};_0x3c9c7a[_0xa8a3('0x3a')]=_[_0xa8a3('0x3c')](db[_0xa8a3('0x35')][_0xa8a3('0x36')]);_0x3c9c7a[_0xa8a3('0x3b')]=_[_0xa8a3('0x3c')](_0x51ca75[_0xa8a3('0x3b')]);_0x3c9c7a[_0xa8a3('0x47')]=_[_0xa8a3('0x3d')](_0x3c9c7a[_0xa8a3('0x3a')],_0x3c9c7a[_0xa8a3('0x3b')]);_0x249d7d['attributes']=_['intersection'](_0x3c9c7a[_0xa8a3('0x3a')],qs['fields'](_0x51ca75[_0xa8a3('0x3b')]['fields']));_0x249d7d[_0xa8a3('0x3e')]=_0x249d7d[_0xa8a3('0x3e')][_0xa8a3('0x53')]?_0x249d7d[_0xa8a3('0x3e')]:_0x3c9c7a['model'];if(_0x51ca75[_0xa8a3('0x3b')][_0xa8a3('0x4c')]){_0x249d7d[_0xa8a3('0x4d')]=[{'all':!![]}];}_0x249d7d=_[_0xa8a3('0x49')]({},_0x249d7d,_0x51ca75['options']);return db[_0xa8a3('0x35')][_0xa8a3('0x54')](_0x249d7d)[_0xa8a3('0x2b')](handleEntityNotFound(_0x3be5e5,null))[_0xa8a3('0x2b')](respondWithResult(_0x3be5e5,null))['catch'](handleError(_0x3be5e5,null));};exports[_0xa8a3('0x55')]=function(_0x4bae86,_0x419b7c){return db[_0xa8a3('0x35')][_0xa8a3('0x55')](_0x4bae86[_0xa8a3('0x56')],{})['then'](function(_0x3ad895){var _0x501c04=_0x4bae86[_0xa8a3('0x57')][_0xa8a3('0x2d')]({'plain':!![]});if(!_0x501c04)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x501c04[_0xa8a3('0x58')]===_0xa8a3('0x57')){var _0x35d3f9=_0x3ad895['get']({'plain':!![]});var _0x25ddb4=_0xa8a3('0x59');return db[_0xa8a3('0x5a')][_0xa8a3('0x54')]({'where':{'name':_0x25ddb4,'userProfileId':_0x501c04[_0xa8a3('0x5b')]},'raw':!![]})[_0xa8a3('0x2b')](function(_0x4509c8){if(_0x4509c8&&_0x4509c8['autoAssociation']===0x0){return db[_0xa8a3('0x2e')][_0xa8a3('0x55')]({'name':_0x35d3f9[_0xa8a3('0x31')],'resourceId':_0x35d3f9['id'],'type':_0x4509c8['name'],'sectionId':_0x4509c8['id']},{})[_0xa8a3('0x2b')](function(){return _0x3ad895;});}else{return _0x3ad895;}})[_0xa8a3('0x50')](function(_0x55ca9e){logger[_0xa8a3('0x2f')](_0xa8a3('0x5c'),_0x55ca9e);throw _0x55ca9e;});}return _0x3ad895;})[_0xa8a3('0x2b')](respondWithResult(_0x419b7c,0xc9))['catch'](handleError(_0x419b7c,null));};exports[_0xa8a3('0x2a')]=function(_0x52c915,_0x201a72){if(_0x52c915[_0xa8a3('0x56')]['id']){delete _0x52c915[_0xa8a3('0x56')]['id'];}return db[_0xa8a3('0x35')]['find']({'where':{'id':_0x52c915['params']['id']}})[_0xa8a3('0x2b')](handleEntityNotFound(_0x201a72,null))[_0xa8a3('0x2b')](saveUpdates(_0x52c915[_0xa8a3('0x56')],null))[_0xa8a3('0x2b')](respondWithResult(_0x201a72,null))[_0xa8a3('0x50')](handleError(_0x201a72,null));};exports[_0xa8a3('0x2c')]=function(_0x28db85,_0x4d4602){return db['WhatsappQueue']['find']({'where':{'id':_0x28db85[_0xa8a3('0x52')]['id']}})[_0xa8a3('0x2b')](handleEntityNotFound(_0x4d4602,null))['then'](removeEntity(_0x4d4602,null))[_0xa8a3('0x50')](handleError(_0x4d4602,null));};exports['describe']=function(_0x2151e6,_0x32cbd3){return db['WhatsappQueue'][_0xa8a3('0x5d')]()[_0xa8a3('0x2b')](respondWithResult(_0x32cbd3,null))[_0xa8a3('0x50')](handleError(_0x32cbd3,null));};exports['getMembers']=function(_0x3224df,_0x574298,_0x4dbf00){var _0x4ae4aa={'raw':!![],'where':{}},_0xe20fe4={},_0x2c3116;return db['WhatsappQueue']['findOne']({'where':{'id':_0x3224df['params']['id']}})[_0xa8a3('0x2b')](handleEntityNotFound(_0x574298,null))['then'](function(_0x2c048b){if(_0x2c048b){_0x2c3116=_0x2c048b['get']({'plain':!![]});_0xe20fe4[_0xa8a3('0x3a')]=_[_0xa8a3('0x3c')](db[_0xa8a3('0x5e')][_0xa8a3('0x36')]);_0xe20fe4[_0xa8a3('0x3b')]=_[_0xa8a3('0x3c')](_0x3224df[_0xa8a3('0x3b')]);_0xe20fe4['filters']=_[_0xa8a3('0x3d')](_0xe20fe4['model'],_0xe20fe4[_0xa8a3('0x3b')]);_0x4ae4aa[_0xa8a3('0x3e')]=_[_0xa8a3('0x3d')](_0xe20fe4['model'],qs['fields'](_0x3224df[_0xa8a3('0x3b')][_0xa8a3('0x3f')]));_0x4ae4aa[_0xa8a3('0x3e')]=_0x4ae4aa['attributes']['length']?_0x4ae4aa[_0xa8a3('0x3e')]:_0xe20fe4[_0xa8a3('0x3a')];if(!_0x3224df['query']['hasOwnProperty'](_0xa8a3('0x41'))){_0x4ae4aa['limit']=qs[_0xa8a3('0x42')](_0x3224df[_0xa8a3('0x3b')]['limit']);_0x4ae4aa[_0xa8a3('0x23')]=qs[_0xa8a3('0x23')](_0x3224df[_0xa8a3('0x3b')]['offset']);}_0x4ae4aa[_0xa8a3('0x43')]=qs[_0xa8a3('0x44')](_0x3224df[_0xa8a3('0x3b')][_0xa8a3('0x44')]);_0x4ae4aa[_0xa8a3('0x45')]=qs['filters'](_[_0xa8a3('0x46')](_0x3224df['query'],_0xe20fe4[_0xa8a3('0x47')]));_0x4ae4aa[_0xa8a3('0x45')][_0xa8a3('0x5f')]=_0x2c048b['id'];if(_0x3224df['query'][_0xa8a3('0x48')]){_0x4ae4aa[_0xa8a3('0x45')]=_[_0xa8a3('0x49')](_0x4ae4aa['where'],{'$or':_[_0xa8a3('0x34')](_0x4ae4aa[_0xa8a3('0x3e')],function(_0x14890f){var _0x1940b4={};_0x1940b4[_0x14890f]={'$like':'%'+_0x3224df[_0xa8a3('0x3b')][_0xa8a3('0x48')]+'%'};return _0x1940b4;})});}_0x4ae4aa=_['merge']({},_0x4ae4aa,_0x3224df['options']);return db[_0xa8a3('0x5e')][_0xa8a3('0x4e')](_0x4ae4aa);}})['then'](function(_0xffd4b0){if(_0xffd4b0){return db[_0xa8a3('0x60')][_0xa8a3('0x61')]({'where':{'id':_[_0xa8a3('0x34')](_0xffd4b0,_0xa8a3('0x62')),'role':_0xa8a3('0x63')},'attributes':['id','name',_0xa8a3('0x64'),'updatedAt',_0xa8a3('0x65')]});}})[_0xa8a3('0x2b')](function(_0x57e615){if(_0x57e615){return{'count':_0x57e615[_0xa8a3('0x25')],'rows':_[_0xa8a3('0x34')](_0x57e615['rows'],function(_0x82e678){return{'membername':_0x82e678['name'],'UserId':_0x82e678['id'],'queue_name':_0x2c3116[_0xa8a3('0x31')],'WhatsappQueueId':_0x2c3116['id'],'interface':util[_0xa8a3('0x66')]('%s/%s',_0xa8a3('0x67'),_0x82e678[_0xa8a3('0x31')]),'penalty':0x0,'paused':_0x82e678['whatsappPause'],'createdAt':_0x82e678[_0xa8a3('0x65')],'updatedAt':_0x82e678['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x574298,_0x4ae4aa))['catch'](handleError(_0x574298,null));};exports[_0xa8a3('0x68')]=function(_0x309197,_0x3ced51,_0x54f777){var _0x2dc377={};var _0x264bcd={};var _0x4d2fe5;var _0x2222e0;return db[_0xa8a3('0x35')][_0xa8a3('0x69')]({'where':{'id':_0x309197[_0xa8a3('0x52')]['id']}})['then'](handleEntityNotFound(_0x3ced51,null))[_0xa8a3('0x2b')](function(_0x1b94f7){if(_0x1b94f7){_0x4d2fe5=_0x1b94f7;_0x264bcd[_0xa8a3('0x3a')]=_[_0xa8a3('0x3c')](db[_0xa8a3('0x6a')][_0xa8a3('0x36')]);_0x264bcd[_0xa8a3('0x3b')]=_[_0xa8a3('0x3c')](_0x309197['query']);_0x264bcd[_0xa8a3('0x47')]=_[_0xa8a3('0x3d')](_0x264bcd[_0xa8a3('0x3a')],_0x264bcd[_0xa8a3('0x3b')]);_0x2dc377[_0xa8a3('0x3e')]=_[_0xa8a3('0x3d')](_0x264bcd[_0xa8a3('0x3a')],qs['fields'](_0x309197[_0xa8a3('0x3b')][_0xa8a3('0x3f')]));_0x2dc377[_0xa8a3('0x3e')]=_0x2dc377[_0xa8a3('0x3e')][_0xa8a3('0x53')]?_0x2dc377[_0xa8a3('0x3e')]:_0x264bcd['model'];_0x2dc377[_0xa8a3('0x43')]=qs[_0xa8a3('0x44')](_0x309197['query']['sort']);_0x2dc377[_0xa8a3('0x45')]=qs[_0xa8a3('0x47')](_[_0xa8a3('0x46')](_0x309197[_0xa8a3('0x3b')],_0x264bcd['filters']));if(_0x309197[_0xa8a3('0x3b')][_0xa8a3('0x48')]){_0x2dc377[_0xa8a3('0x45')]=_[_0xa8a3('0x49')](_0x2dc377[_0xa8a3('0x45')],{'$or':_[_0xa8a3('0x34')](_0x2dc377['attributes'],function(_0x2adedf){var _0x26457c={};_0x26457c[_0x2adedf]={'$like':'%'+_0x309197[_0xa8a3('0x3b')][_0xa8a3('0x48')]+'%'};return _0x26457c;})});}_0x2dc377=_['merge']({},_0x2dc377,_0x309197[_0xa8a3('0x4b')]);return _0x4d2fe5[_0xa8a3('0x68')](_0x2dc377);}})[_0xa8a3('0x2b')](function(_0x1cae29){if(_0x1cae29){_0x2222e0=_0x1cae29['length'];if(!_0x309197[_0xa8a3('0x3b')][_0xa8a3('0x40')]('nolimit')){_0x2dc377['limit']=qs[_0xa8a3('0x42')](_0x309197[_0xa8a3('0x3b')][_0xa8a3('0x42')]);_0x2dc377[_0xa8a3('0x23')]=qs[_0xa8a3('0x23')](_0x309197[_0xa8a3('0x3b')][_0xa8a3('0x23')]);}return _0x4d2fe5[_0xa8a3('0x68')](_0x2dc377);}})[_0xa8a3('0x2b')](function(_0x38dacf){if(_0x38dacf){return _0x38dacf?{'count':_0x2222e0,'rows':_0x38dacf}:null;}})[_0xa8a3('0x2b')](respondWithResult(_0x3ced51,null))['catch'](handleError(_0x3ced51,null));};exports['addTeams']=function(_0x508b8e,_0x54f58e,_0x4a4059){var _0x207c8b=_0x508b8e[_0xa8a3('0x56')][_0xa8a3('0x6b')];return db['Team'][_0xa8a3('0x4e')]({'where':{'id':_0x207c8b},'attributes':['id'],'include':[{'model':db[_0xa8a3('0x60')],'as':_0xa8a3('0x6c'),'attributes':['id','name',_0xa8a3('0x6d'),_0xa8a3('0x6e'),_0xa8a3('0x6f')],'raw':!![]}]})['then'](function(_0x607619){if(_0x607619){var _0x80be58=_['flatMap'](_0x607619,function(_0x37da79){var _0x5eaaf7=_0x37da79[_0xa8a3('0x2d')]({'plain':!![]});return _0x5eaaf7[_0xa8a3('0x6c')];});return db['WhatsappQueue'][_0xa8a3('0x54')]({'where':{'id':_0x508b8e['params']['id']}})[_0xa8a3('0x2b')](function(_0x191211){return db['sequelize'][_0xa8a3('0x70')](function(_0x368aa5){return _0x191211[_0xa8a3('0x71')](_0x207c8b,{'transaction':_0x368aa5})[_0xa8a3('0x2b')](function(){return BPromise[_0xa8a3('0x72')](_0x80be58,function(_0x128841){return db[_0xa8a3('0x5e')][_0xa8a3('0x73')]({'where':{'UserId':_0x128841['id'],'WhatsappQueueId':_0x508b8e[_0xa8a3('0x52')]['id']},'transaction':_0x368aa5});});})['then'](function(){_0x80be58[_0xa8a3('0x74')](function(_0x2bbab8){socket[_0xa8a3('0x75')]('userWhatsappQueue:save',{'UserId':_0x2bbab8['id'],'WhatsappQueueId':_0x191211['id']});});});});});}})[_0xa8a3('0x2b')](respondWithStatusCode(_0x54f58e,null))['catch'](handleError(_0x54f58e,null));};exports[_0xa8a3('0x76')]=function(_0xaee51d,_0x7e0de7,_0x2f2bec){return db['Team'][_0xa8a3('0x4e')]({'where':{'id':_0xaee51d[_0xa8a3('0x3b')][_0xa8a3('0x6b')]},'attributes':['id'],'include':[{'model':db[_0xa8a3('0x60')],'as':_0xa8a3('0x6c'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x7e0de7,null))[_0xa8a3('0x2b')](function(_0xf9f995){var _0x276652=_[_0xa8a3('0x34')](_0xf9f995,'id');var _0x5603cd=[];var _0x43e592=[];var _0x50c394=squel[_0xa8a3('0x77')]();_0x50c394['field'](_0xa8a3('0x78'))[_0xa8a3('0x79')]('team_has_whatsapp_queues','tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0xa8a3('0x7a'),_0xaee51d[_0xa8a3('0x52')]['id']);for(var _0x3a7b4b=0x0;_0x3a7b4b<_0xf9f995['length'];_0x3a7b4b+=0x1){let _0xf96017=_0xf9f995[_0x3a7b4b];for(var _0x2b9f5b=0x0;_0x2b9f5b<_0xf96017[_0xa8a3('0x6c')][_0xa8a3('0x53')];_0x2b9f5b+=0x1){let _0x34c080=_0xf96017['Agents'][_0x2b9f5b];var _0x227a37=_0x50c394[_0xa8a3('0x7b')]();_0x227a37[_0xa8a3('0x45')](_0xa8a3('0x7c'),_0x34c080['id']);_0x43e592[_0xa8a3('0x7d')](db[_0xa8a3('0x7e')]['query'](_0x227a37[_0xa8a3('0x7f')](),{'type':db['sequelize'][_0xa8a3('0x80')]['SELECT']})[_0xa8a3('0x2b')](function(_0x4584ed){if(_0x4584ed[_0xa8a3('0x53')]===0x1){return _0x34c080['id'];}else{var _0x42e6b2=_['every'](_[_0xa8a3('0x34')](_0x4584ed,_0xa8a3('0x81')),function(_0x23d7c6){return _['includes'](_0x276652,_0x23d7c6);});if(_0x42e6b2){return _0x34c080['id'];}}}));}}return BPromise[_0xa8a3('0x82')](_0x43e592)[_0xa8a3('0x2b')](function(_0x6d24bd){_0x5603cd=_(_0x5603cd)[_0xa8a3('0x83')](_0x6d24bd)[_0xa8a3('0x84')]()[_0xa8a3('0x85')]();return db[_0xa8a3('0x35')]['find']({'where':{'id':_0xaee51d['params']['id']}})[_0xa8a3('0x2b')](function(_0x4ad4c2){return db['sequelize'][_0xa8a3('0x70')](function(_0x3f1347){return _0x4ad4c2[_0xa8a3('0x76')](_0xaee51d[_0xa8a3('0x3b')]['ids'],{'transaction':_0x3f1347})[_0xa8a3('0x2b')](function(){if(!_[_0xa8a3('0x86')](_0x5603cd)){return _0x4ad4c2['removeAgents'](_0x5603cd,{'transaction':_0x3f1347});}})[_0xa8a3('0x2b')](function(){_0x5603cd[_0xa8a3('0x74')](function(_0xe839f4){socket[_0xa8a3('0x75')](_0xa8a3('0x87'),{'UserId':_0xe839f4,'WhatsappQueueId':_0x4ad4c2['id']});});});});});});})['then'](respondWithStatusCode(_0x7e0de7,null))[_0xa8a3('0x50')](handleError(_0x7e0de7,null));};exports[_0xa8a3('0x88')]=function(_0x18d1c8,_0x35cf48,_0x103446){return db[_0xa8a3('0x35')][_0xa8a3('0x54')]({'where':{'id':_0x18d1c8[_0xa8a3('0x52')]['id']}})[_0xa8a3('0x2b')](handleEntityNotFound(_0x35cf48,null))[_0xa8a3('0x2b')](function(_0x2ca429){if(_0x2ca429){return _0x2ca429[_0xa8a3('0x88')](_0x18d1c8[_0xa8a3('0x56')]['ids'],_['omit'](_0x18d1c8['body'],['ids','id'])||{})[_0xa8a3('0x89')](function(_0x3febff){for(var _0x49996c=0x0;_0x49996c<_0x18d1c8[_0xa8a3('0x56')][_0xa8a3('0x6b')][_0xa8a3('0x53')];_0x49996c+=0x1){socket[_0xa8a3('0x75')](_0xa8a3('0x8a'),{'UserId':Number(_0x18d1c8[_0xa8a3('0x56')][_0xa8a3('0x6b')][_0x49996c]),'WhatsappQueueId':Number(_0x18d1c8[_0xa8a3('0x52')]['id'])});}return _0x3febff;});}})[_0xa8a3('0x2b')](respondWithResult(_0x35cf48,null))[_0xa8a3('0x50')](handleError(_0x35cf48,null));};exports[_0xa8a3('0x8b')]=function(_0x50cc25,_0x102139,_0x46ef26){return db['WhatsappQueue'][_0xa8a3('0x54')]({'where':{'id':_0x50cc25[_0xa8a3('0x52')]['id']}})[_0xa8a3('0x2b')](handleEntityNotFound(_0x102139,null))['then'](function(_0x19d0d4){if(_0x19d0d4){return _0x19d0d4[_0xa8a3('0x8b')](_0x50cc25[_0xa8a3('0x3b')]['ids'])[_0xa8a3('0x2b')](function(){if(_['isArray'](_0x50cc25[_0xa8a3('0x3b')]['ids'])){for(var _0xdca143=0x0;_0xdca143<_0x50cc25[_0xa8a3('0x3b')]['ids'][_0xa8a3('0x53')];_0xdca143+=0x1){socket[_0xa8a3('0x75')]('userWhatsappQueue:remove',{'UserId':Number(_0x50cc25[_0xa8a3('0x3b')]['ids'][_0xdca143]),'WhatsappQueueId':Number(_0x50cc25[_0xa8a3('0x52')]['id'])});}}else{socket[_0xa8a3('0x75')](_0xa8a3('0x87'),{'UserId':Number(_0x50cc25[_0xa8a3('0x3b')][_0xa8a3('0x6b')]),'WhatsappQueueId':Number(_0x50cc25['params']['id'])});}});}})[_0xa8a3('0x2b')](respondWithStatusCode(_0x102139,null))['catch'](handleError(_0x102139,null));};exports[_0xa8a3('0x8c')]=function(_0x50a869,_0x4da0fe,_0x39f63f){var _0x8a74a8={};var _0x1906d6={};var _0xcab818;var _0x550177;return db[_0xa8a3('0x35')][_0xa8a3('0x69')]({'where':{'id':_0x50a869[_0xa8a3('0x52')]['id']}})[_0xa8a3('0x2b')](handleEntityNotFound(_0x4da0fe,null))[_0xa8a3('0x2b')](function(_0x59eda9){if(_0x59eda9){_0xcab818=_0x59eda9;_0x1906d6[_0xa8a3('0x3a')]=_[_0xa8a3('0x3c')](db[_0xa8a3('0x60')]['rawAttributes']);_0x1906d6[_0xa8a3('0x3b')]=_['keys'](_0x50a869['query']);_0x1906d6['filters']=_[_0xa8a3('0x3d')](_0x1906d6[_0xa8a3('0x3a')],_0x1906d6[_0xa8a3('0x3b')]);_0x8a74a8[_0xa8a3('0x3e')]=_[_0xa8a3('0x3d')](_0x1906d6[_0xa8a3('0x3a')],qs['fields'](_0x50a869[_0xa8a3('0x3b')]['fields']));_0x8a74a8[_0xa8a3('0x3e')]=_0x8a74a8[_0xa8a3('0x3e')]['length']?_0x8a74a8[_0xa8a3('0x3e')]:_0x1906d6[_0xa8a3('0x3a')];_0x8a74a8['order']=qs[_0xa8a3('0x44')](_0x50a869[_0xa8a3('0x3b')][_0xa8a3('0x44')]);_0x8a74a8[_0xa8a3('0x45')]=qs['filters'](_[_0xa8a3('0x46')](_0x50a869['query'],_0x1906d6[_0xa8a3('0x47')]));if(_0x50a869[_0xa8a3('0x3b')][_0xa8a3('0x48')]){_0x8a74a8[_0xa8a3('0x45')]=_[_0xa8a3('0x49')](_0x8a74a8[_0xa8a3('0x45')],{'$or':_[_0xa8a3('0x34')](_0x8a74a8[_0xa8a3('0x3e')],function(_0x520c0c){var _0x5b298f={};_0x5b298f[_0x520c0c]={'$like':'%'+_0x50a869['query'][_0xa8a3('0x48')]+'%'};return _0x5b298f;})});}_0x8a74a8=_['merge']({},_0x8a74a8,_0x50a869[_0xa8a3('0x4b')]);return _0xcab818[_0xa8a3('0x8c')](_0x8a74a8);}})['then'](function(_0x54b1f7){if(_0x54b1f7){_0x550177=_0x54b1f7[_0xa8a3('0x53')];if(!_0x50a869[_0xa8a3('0x3b')][_0xa8a3('0x40')]('nolimit')){_0x8a74a8['limit']=qs[_0xa8a3('0x42')](_0x50a869['query'][_0xa8a3('0x42')]);_0x8a74a8[_0xa8a3('0x23')]=qs[_0xa8a3('0x23')](_0x50a869[_0xa8a3('0x3b')][_0xa8a3('0x23')]);}return _0xcab818[_0xa8a3('0x8c')](_0x8a74a8);}})[_0xa8a3('0x2b')](function(_0x5c27d6){if(_0x5c27d6){return _0x5c27d6?{'count':_0x550177,'rows':_0x5c27d6}:null;}})[_0xa8a3('0x2b')](respondWithResult(_0x4da0fe,null))[_0xa8a3('0x50')](handleError(_0x4da0fe,null));}; \ No newline at end of file +var _0x3e3c=['status','end','json','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','WhatsappQueues','UserProfileResource','error','stack','name','map','WhatsappQueue','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','sort','pick','WhatsappQueueId','UserWhatsappQueue','User','findAndCountAll','UserId','whatsappPause','createdAt','%s/%s','SIP','updatedAt','getTeams','Team','online','voicePause','interface','flatMap','sequelize','each','forEach','emit','userWhatsappQueue:save','removeTeams','Agents','select','field','from','team_has_whatsapp_queues','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','includes','all','compact','ids','isEmpty','removeAgents','addAgents','omit','isArray','userWhatsappQueue:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus'];(function(_0x166e12,_0x29440b){var _0xca87f1=function(_0x3b5bdb){while(--_0x3b5bdb){_0x166e12['push'](_0x166e12['shift']());}};_0xca87f1(++_0x29440b);}(_0x3e3c,0x173));var _0xc3e3=function(_0x2c6a59,_0x3d2ca2){_0x2c6a59=_0x2c6a59-0x0;var _0x473ea1=_0x3e3c[_0x2c6a59];return _0x473ea1;};'use strict';var emlformat=require(_0xc3e3('0x0'));var rimraf=require(_0xc3e3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc3e3('0x2'));var rp=require(_0xc3e3('0x3'));var moment=require('moment');var BPromise=require(_0xc3e3('0x4'));var Mustache=require(_0xc3e3('0x5'));var util=require(_0xc3e3('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc3e3('0x7'));var squel=require(_0xc3e3('0x8'));var crypto=require(_0xc3e3('0x9'));var jsforce=require(_0xc3e3('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xc3e3('0xb'));var querystring=require(_0xc3e3('0xc'));var Papa=require(_0xc3e3('0xd'));var Redis=require(_0xc3e3('0xe'));var authService=require(_0xc3e3('0xf'));var qs=require(_0xc3e3('0x10'));var as=require(_0xc3e3('0x11'));var hardwareService=require(_0xc3e3('0x12'));var logger=require(_0xc3e3('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xc3e3('0x14'));var licenseUtil=require(_0xc3e3('0x15'));var db=require('../../mysqldb')['db'];config[_0xc3e3('0x16')]=_['defaults'](config[_0xc3e3('0x16')],{'host':_0xc3e3('0x17'),'port':0x18eb});var socket=require(_0xc3e3('0x18'))(new Redis(config[_0xc3e3('0x16')]));require(_0xc3e3('0x19'))[_0xc3e3('0x1a')](socket);function respondWithStatusCode(_0x28a484,_0x50075a){_0x50075a=_0x50075a||0xcc;return function(_0x37e730){if(_0x37e730){return _0x28a484[_0xc3e3('0x1b')](_0x50075a);}return _0x28a484[_0xc3e3('0x1c')](_0x50075a)[_0xc3e3('0x1d')]();};}function respondWithResult(_0x6cfa55,_0x1c51e9){_0x1c51e9=_0x1c51e9||0xc8;return function(_0x19c3da){if(_0x19c3da){return _0x6cfa55[_0xc3e3('0x1c')](_0x1c51e9)[_0xc3e3('0x1e')](_0x19c3da);}};}function respondWithFilteredResult(_0x206fdf,_0x271baf){return function(_0xc8f30b){if(_0xc8f30b){var _0x9c82a5=typeof _0x271baf['offset']==='undefined'&&typeof _0x271baf[_0xc3e3('0x1f')]==='undefined';var _0x28ea0a=_0xc8f30b[_0xc3e3('0x20')];var _0x1f583a=_0x9c82a5?0x0:_0x271baf['offset'];var _0x46d7a3=_0x9c82a5?_0xc8f30b[_0xc3e3('0x20')]:_0x271baf[_0xc3e3('0x21')]+_0x271baf[_0xc3e3('0x1f')];var _0x53896d;if(_0x46d7a3>=_0x28ea0a){_0x46d7a3=_0x28ea0a;_0x53896d=0xc8;}else{_0x53896d=0xce;}_0x206fdf['status'](_0x53896d);return _0x206fdf[_0xc3e3('0x22')](_0xc3e3('0x23'),_0x1f583a+'-'+_0x46d7a3+'/'+_0x28ea0a)['json'](_0xc8f30b);}return null;};}function patchUpdates(_0x523bd5){return function(_0x41a4b8){try{jsonpatch[_0xc3e3('0x24')](_0x41a4b8,_0x523bd5,!![]);}catch(_0x2c950e){return BPromise[_0xc3e3('0x25')](_0x2c950e);}return _0x41a4b8[_0xc3e3('0x26')]();};}function saveUpdates(_0x5d3aaa,_0x311ee7){return function(_0x47b59a){if(_0x47b59a){return _0x47b59a[_0xc3e3('0x27')](_0x5d3aaa)[_0xc3e3('0x28')](function(_0x1ec602){return _0x1ec602;});}return null;};}function removeEntity(_0x4a6355,_0x32947d){return function(_0x2baac3){if(_0x2baac3){return _0x2baac3[_0xc3e3('0x29')]()['then'](function(){var _0x2a4948=_0x2baac3[_0xc3e3('0x2a')]({'plain':!![]});var _0x2edc59=_0xc3e3('0x2b');return db[_0xc3e3('0x2c')][_0xc3e3('0x29')]({'where':{'type':_0x2edc59,'resourceId':_0x2a4948['id']}})['then'](function(){return _0x2baac3;});})[_0xc3e3('0x28')](function(){_0x4a6355[_0xc3e3('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x209131,_0x24b174){return function(_0x572ae5){if(!_0x572ae5){_0x209131[_0xc3e3('0x1b')](0x194);}return _0x572ae5;};}function handleError(_0x4c3a0b,_0x39de99){_0x39de99=_0x39de99||0x1f4;return function(_0x45b92b){logger[_0xc3e3('0x2d')](_0x45b92b[_0xc3e3('0x2e')]);if(_0x45b92b[_0xc3e3('0x2f')]){delete _0x45b92b[_0xc3e3('0x2f')];}_0x4c3a0b[_0xc3e3('0x1c')](_0x39de99)['send'](_0x45b92b);};}exports['index']=function(_0x2c10f8,_0x3fdf77){var _0x438448={},_0x36c62d={},_0x2405e3={'count':0x0,'rows':[]};var _0xe57bb5=_[_0xc3e3('0x30')](db[_0xc3e3('0x31')][_0xc3e3('0x32')],function(_0x52e66b){return{'name':_0x52e66b[_0xc3e3('0x33')],'type':_0x52e66b[_0xc3e3('0x34')]['key']};});_0x36c62d[_0xc3e3('0x35')]=_[_0xc3e3('0x30')](_0xe57bb5,_0xc3e3('0x2f'));_0x36c62d[_0xc3e3('0x36')]=_[_0xc3e3('0x37')](_0x2c10f8[_0xc3e3('0x36')]);_0x36c62d['filters']=_[_0xc3e3('0x38')](_0x36c62d[_0xc3e3('0x35')],_0x36c62d['query']);_0x438448[_0xc3e3('0x39')]=_[_0xc3e3('0x38')](_0x36c62d[_0xc3e3('0x35')],qs[_0xc3e3('0x3a')](_0x2c10f8['query'][_0xc3e3('0x3a')]));_0x438448[_0xc3e3('0x39')]=_0x438448[_0xc3e3('0x39')][_0xc3e3('0x3b')]?_0x438448[_0xc3e3('0x39')]:_0x36c62d[_0xc3e3('0x35')];if(!_0x2c10f8['query'][_0xc3e3('0x3c')](_0xc3e3('0x3d'))){_0x438448[_0xc3e3('0x1f')]=qs[_0xc3e3('0x1f')](_0x2c10f8[_0xc3e3('0x36')][_0xc3e3('0x1f')]);_0x438448[_0xc3e3('0x21')]=qs['offset'](_0x2c10f8[_0xc3e3('0x36')][_0xc3e3('0x21')]);}_0x438448[_0xc3e3('0x3e')]=qs['sort'](_0x2c10f8[_0xc3e3('0x36')]['sort']);_0x438448[_0xc3e3('0x3f')]=qs[_0xc3e3('0x40')](_['pick'](_0x2c10f8[_0xc3e3('0x36')],_0x36c62d[_0xc3e3('0x40')]),_0xe57bb5);if(_0x2c10f8['query'][_0xc3e3('0x41')]){_0x438448[_0xc3e3('0x3f')]=_[_0xc3e3('0x42')](_0x438448[_0xc3e3('0x3f')],{'$or':_['map'](_0xe57bb5,function(_0x597e59){if(_0x597e59[_0xc3e3('0x34')]!==_0xc3e3('0x43')){var _0x552a89={};_0x552a89[_0x597e59[_0xc3e3('0x2f')]]={'$like':'%'+_0x2c10f8[_0xc3e3('0x36')][_0xc3e3('0x41')]+'%'};return _0x552a89;}})});}_0x438448=_['merge']({},_0x438448,_0x2c10f8[_0xc3e3('0x44')]);var _0x3cb159={'where':_0x438448[_0xc3e3('0x3f')]};return db[_0xc3e3('0x31')][_0xc3e3('0x20')](_0x3cb159)[_0xc3e3('0x28')](function(_0x304ef3){_0x2405e3[_0xc3e3('0x20')]=_0x304ef3;if(_0x2c10f8['query'][_0xc3e3('0x45')]){_0x438448[_0xc3e3('0x46')]=[{'all':!![]}];}return db[_0xc3e3('0x31')][_0xc3e3('0x47')](_0x438448);})['then'](function(_0x474633){_0x2405e3[_0xc3e3('0x48')]=_0x474633;return _0x2405e3;})[_0xc3e3('0x28')](respondWithFilteredResult(_0x3fdf77,_0x438448))[_0xc3e3('0x49')](handleError(_0x3fdf77,null));};exports['show']=function(_0x3e4dcb,_0x3b373f){var _0x4a6ef9={'raw':!![],'where':{'id':_0x3e4dcb[_0xc3e3('0x4a')]['id']}},_0x4d8e6c={};_0x4d8e6c['model']=_[_0xc3e3('0x37')](db[_0xc3e3('0x31')][_0xc3e3('0x32')]);_0x4d8e6c[_0xc3e3('0x36')]=_[_0xc3e3('0x37')](_0x3e4dcb[_0xc3e3('0x36')]);_0x4d8e6c['filters']=_[_0xc3e3('0x38')](_0x4d8e6c['model'],_0x4d8e6c[_0xc3e3('0x36')]);_0x4a6ef9[_0xc3e3('0x39')]=_[_0xc3e3('0x38')](_0x4d8e6c[_0xc3e3('0x35')],qs[_0xc3e3('0x3a')](_0x3e4dcb[_0xc3e3('0x36')][_0xc3e3('0x3a')]));_0x4a6ef9[_0xc3e3('0x39')]=_0x4a6ef9[_0xc3e3('0x39')]['length']?_0x4a6ef9[_0xc3e3('0x39')]:_0x4d8e6c['model'];if(_0x3e4dcb[_0xc3e3('0x36')][_0xc3e3('0x45')]){_0x4a6ef9[_0xc3e3('0x46')]=[{'all':!![]}];}_0x4a6ef9=_[_0xc3e3('0x42')]({},_0x4a6ef9,_0x3e4dcb[_0xc3e3('0x44')]);return db[_0xc3e3('0x31')][_0xc3e3('0x4b')](_0x4a6ef9)[_0xc3e3('0x28')](handleEntityNotFound(_0x3b373f,null))[_0xc3e3('0x28')](respondWithResult(_0x3b373f,null))[_0xc3e3('0x49')](handleError(_0x3b373f,null));};exports['create']=function(_0x30a2ff,_0x1503aa){return db['WhatsappQueue'][_0xc3e3('0x4c')](_0x30a2ff[_0xc3e3('0x4d')],{})[_0xc3e3('0x28')](function(_0x5121a9){var _0x413b37=_0x30a2ff['user']['get']({'plain':!![]});if(!_0x413b37)throw new Error(_0xc3e3('0x4e'));if(_0x413b37[_0xc3e3('0x4f')]===_0xc3e3('0x50')){var _0x189bc5=_0x5121a9['get']({'plain':!![]});var _0x412c06=_0xc3e3('0x2b');return db[_0xc3e3('0x51')][_0xc3e3('0x4b')]({'where':{'name':_0x412c06,'userProfileId':_0x413b37['userProfileId']},'raw':!![]})['then'](function(_0x2b6f07){if(_0x2b6f07&&_0x2b6f07[_0xc3e3('0x52')]===0x0){return db[_0xc3e3('0x2c')]['create']({'name':_0x189bc5[_0xc3e3('0x2f')],'resourceId':_0x189bc5['id'],'type':_0x2b6f07['name'],'sectionId':_0x2b6f07['id']},{})[_0xc3e3('0x28')](function(){return _0x5121a9;});}else{return _0x5121a9;}})[_0xc3e3('0x49')](function(_0x1039c9){logger['error'](_0xc3e3('0x53'),_0x1039c9);throw _0x1039c9;});}return _0x5121a9;})[_0xc3e3('0x28')](respondWithResult(_0x1503aa,0xc9))[_0xc3e3('0x49')](handleError(_0x1503aa,null));};exports['update']=function(_0x3c40cf,_0x501e09){if(_0x3c40cf[_0xc3e3('0x4d')]['id']){delete _0x3c40cf['body']['id'];}return db['WhatsappQueue'][_0xc3e3('0x4b')]({'where':{'id':_0x3c40cf[_0xc3e3('0x4a')]['id']}})[_0xc3e3('0x28')](handleEntityNotFound(_0x501e09,null))[_0xc3e3('0x28')](saveUpdates(_0x3c40cf[_0xc3e3('0x4d')],null))[_0xc3e3('0x28')](respondWithResult(_0x501e09,null))[_0xc3e3('0x49')](handleError(_0x501e09,null));};exports[_0xc3e3('0x29')]=function(_0xee0e1a,_0x199443){return db[_0xc3e3('0x31')]['find']({'where':{'id':_0xee0e1a['params']['id']}})[_0xc3e3('0x28')](handleEntityNotFound(_0x199443,null))['then'](removeEntity(_0x199443,null))['catch'](handleError(_0x199443,null));};exports[_0xc3e3('0x54')]=function(_0x20b42d,_0x4a3aa7){return db[_0xc3e3('0x31')][_0xc3e3('0x54')]()[_0xc3e3('0x28')](respondWithResult(_0x4a3aa7,null))[_0xc3e3('0x49')](handleError(_0x4a3aa7,null));};exports['getMembers']=function(_0x51ff42,_0x556c38,_0x2a5a05){var _0x28cc79={'raw':!![],'where':{}},_0x16447f={},_0x290924;return db[_0xc3e3('0x31')][_0xc3e3('0x55')]({'where':{'id':_0x51ff42[_0xc3e3('0x4a')]['id']}})[_0xc3e3('0x28')](handleEntityNotFound(_0x556c38,null))['then'](function(_0x141e0d){if(_0x141e0d){_0x290924=_0x141e0d[_0xc3e3('0x2a')]({'plain':!![]});_0x16447f[_0xc3e3('0x35')]=_[_0xc3e3('0x37')](db['UserWhatsappQueue'][_0xc3e3('0x32')]);_0x16447f[_0xc3e3('0x36')]=_[_0xc3e3('0x37')](_0x51ff42['query']);_0x16447f[_0xc3e3('0x40')]=_[_0xc3e3('0x38')](_0x16447f[_0xc3e3('0x35')],_0x16447f[_0xc3e3('0x36')]);_0x28cc79[_0xc3e3('0x39')]=_[_0xc3e3('0x38')](_0x16447f[_0xc3e3('0x35')],qs[_0xc3e3('0x3a')](_0x51ff42['query'][_0xc3e3('0x3a')]));_0x28cc79[_0xc3e3('0x39')]=_0x28cc79[_0xc3e3('0x39')][_0xc3e3('0x3b')]?_0x28cc79[_0xc3e3('0x39')]:_0x16447f[_0xc3e3('0x35')];if(!_0x51ff42['query'][_0xc3e3('0x3c')](_0xc3e3('0x3d'))){_0x28cc79[_0xc3e3('0x1f')]=qs[_0xc3e3('0x1f')](_0x51ff42['query'][_0xc3e3('0x1f')]);_0x28cc79[_0xc3e3('0x21')]=qs['offset'](_0x51ff42[_0xc3e3('0x36')]['offset']);}_0x28cc79['order']=qs[_0xc3e3('0x56')](_0x51ff42['query'][_0xc3e3('0x56')]);_0x28cc79[_0xc3e3('0x3f')]=qs[_0xc3e3('0x40')](_[_0xc3e3('0x57')](_0x51ff42[_0xc3e3('0x36')],_0x16447f[_0xc3e3('0x40')]));_0x28cc79[_0xc3e3('0x3f')][_0xc3e3('0x58')]=_0x141e0d['id'];if(_0x51ff42[_0xc3e3('0x36')][_0xc3e3('0x41')]){_0x28cc79['where']=_[_0xc3e3('0x42')](_0x28cc79[_0xc3e3('0x3f')],{'$or':_[_0xc3e3('0x30')](_0x28cc79[_0xc3e3('0x39')],function(_0x22cc0b){var _0x1b6d31={};_0x1b6d31[_0x22cc0b]={'$like':'%'+_0x51ff42[_0xc3e3('0x36')][_0xc3e3('0x41')]+'%'};return _0x1b6d31;})});}_0x28cc79=_['merge']({},_0x28cc79,_0x51ff42['options']);return db[_0xc3e3('0x59')][_0xc3e3('0x47')](_0x28cc79);}})[_0xc3e3('0x28')](function(_0x364d93){if(_0x364d93){return db[_0xc3e3('0x5a')][_0xc3e3('0x5b')]({'where':{'id':_[_0xc3e3('0x30')](_0x364d93,_0xc3e3('0x5c')),'role':'agent'},'attributes':['id','name',_0xc3e3('0x5d'),'updatedAt',_0xc3e3('0x5e')]});}})[_0xc3e3('0x28')](function(_0x22f4c5){if(_0x22f4c5){return{'count':_0x22f4c5[_0xc3e3('0x20')],'rows':_[_0xc3e3('0x30')](_0x22f4c5[_0xc3e3('0x48')],function(_0x240b2d){return{'membername':_0x240b2d[_0xc3e3('0x2f')],'UserId':_0x240b2d['id'],'queue_name':_0x290924[_0xc3e3('0x2f')],'WhatsappQueueId':_0x290924['id'],'interface':util['format'](_0xc3e3('0x5f'),_0xc3e3('0x60'),_0x240b2d[_0xc3e3('0x2f')]),'penalty':0x0,'paused':_0x240b2d[_0xc3e3('0x5d')],'createdAt':_0x240b2d[_0xc3e3('0x5e')],'updatedAt':_0x240b2d[_0xc3e3('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xc3e3('0x28')](respondWithFilteredResult(_0x556c38,_0x28cc79))[_0xc3e3('0x49')](handleError(_0x556c38,null));};exports[_0xc3e3('0x62')]=function(_0x25f7a4,_0x405314,_0x2557f7){var _0x33841a={};var _0x5f5174={};var _0xb430dd;var _0x3372c4;return db[_0xc3e3('0x31')][_0xc3e3('0x55')]({'where':{'id':_0x25f7a4[_0xc3e3('0x4a')]['id']}})['then'](handleEntityNotFound(_0x405314,null))[_0xc3e3('0x28')](function(_0x11c411){if(_0x11c411){_0xb430dd=_0x11c411;_0x5f5174[_0xc3e3('0x35')]=_[_0xc3e3('0x37')](db[_0xc3e3('0x63')][_0xc3e3('0x32')]);_0x5f5174[_0xc3e3('0x36')]=_[_0xc3e3('0x37')](_0x25f7a4['query']);_0x5f5174['filters']=_['intersection'](_0x5f5174[_0xc3e3('0x35')],_0x5f5174['query']);_0x33841a['attributes']=_[_0xc3e3('0x38')](_0x5f5174['model'],qs[_0xc3e3('0x3a')](_0x25f7a4['query']['fields']));_0x33841a['attributes']=_0x33841a[_0xc3e3('0x39')][_0xc3e3('0x3b')]?_0x33841a[_0xc3e3('0x39')]:_0x5f5174[_0xc3e3('0x35')];_0x33841a[_0xc3e3('0x3e')]=qs[_0xc3e3('0x56')](_0x25f7a4[_0xc3e3('0x36')]['sort']);_0x33841a[_0xc3e3('0x3f')]=qs[_0xc3e3('0x40')](_['pick'](_0x25f7a4[_0xc3e3('0x36')],_0x5f5174['filters']));if(_0x25f7a4[_0xc3e3('0x36')]['filter']){_0x33841a[_0xc3e3('0x3f')]=_[_0xc3e3('0x42')](_0x33841a['where'],{'$or':_[_0xc3e3('0x30')](_0x33841a[_0xc3e3('0x39')],function(_0x4f1546){var _0x2b0bda={};_0x2b0bda[_0x4f1546]={'$like':'%'+_0x25f7a4[_0xc3e3('0x36')][_0xc3e3('0x41')]+'%'};return _0x2b0bda;})});}_0x33841a=_['merge']({},_0x33841a,_0x25f7a4['options']);return _0xb430dd['getTeams'](_0x33841a);}})[_0xc3e3('0x28')](function(_0xa5db3a){if(_0xa5db3a){_0x3372c4=_0xa5db3a[_0xc3e3('0x3b')];if(!_0x25f7a4['query']['hasOwnProperty'](_0xc3e3('0x3d'))){_0x33841a[_0xc3e3('0x1f')]=qs['limit'](_0x25f7a4[_0xc3e3('0x36')][_0xc3e3('0x1f')]);_0x33841a['offset']=qs[_0xc3e3('0x21')](_0x25f7a4[_0xc3e3('0x36')][_0xc3e3('0x21')]);}return _0xb430dd[_0xc3e3('0x62')](_0x33841a);}})[_0xc3e3('0x28')](function(_0x985493){if(_0x985493){return _0x985493?{'count':_0x3372c4,'rows':_0x985493}:null;}})[_0xc3e3('0x28')](respondWithResult(_0x405314,null))[_0xc3e3('0x49')](handleError(_0x405314,null));};exports['addTeams']=function(_0x1b15e0,_0x4d7292,_0x590cb6){var _0x58615f=_0x1b15e0[_0xc3e3('0x4d')]['ids'];return db[_0xc3e3('0x63')][_0xc3e3('0x47')]({'where':{'id':_0x58615f},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xc3e3('0x2f'),_0xc3e3('0x64'),_0xc3e3('0x65'),_0xc3e3('0x66')],'raw':!![]}]})[_0xc3e3('0x28')](function(_0x27e8e8){if(_0x27e8e8){var _0x26f5ee=_[_0xc3e3('0x67')](_0x27e8e8,function(_0x4974b0){var _0xbcf97=_0x4974b0[_0xc3e3('0x2a')]({'plain':!![]});return _0xbcf97['Agents'];});return db['WhatsappQueue'][_0xc3e3('0x4b')]({'where':{'id':_0x1b15e0['params']['id']}})['then'](function(_0x446520){return db[_0xc3e3('0x68')]['transaction'](function(_0x381308){return _0x446520['addTeams'](_0x58615f,{'transaction':_0x381308})['then'](function(){return BPromise[_0xc3e3('0x69')](_0x26f5ee,function(_0x58c629){return db[_0xc3e3('0x59')]['findOrCreate']({'where':{'UserId':_0x58c629['id'],'WhatsappQueueId':_0x1b15e0[_0xc3e3('0x4a')]['id']},'transaction':_0x381308});});})[_0xc3e3('0x28')](function(){_0x26f5ee[_0xc3e3('0x6a')](function(_0x1798c7){socket[_0xc3e3('0x6b')](_0xc3e3('0x6c'),{'UserId':_0x1798c7['id'],'WhatsappQueueId':_0x446520['id']});});});});});}})['then'](respondWithStatusCode(_0x4d7292,null))[_0xc3e3('0x49')](handleError(_0x4d7292,null));};exports[_0xc3e3('0x6d')]=function(_0x5a3d28,_0x1a1030,_0x168872){return db[_0xc3e3('0x63')][_0xc3e3('0x47')]({'where':{'id':_0x5a3d28[_0xc3e3('0x36')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0xc3e3('0x6e'),'attributes':['id'],'raw':!![]}]})[_0xc3e3('0x28')](handleEntityNotFound(_0x1a1030,null))[_0xc3e3('0x28')](function(_0x1fda94){var _0x4245dc=_[_0xc3e3('0x30')](_0x1fda94,'id');var _0x1f3372=[];var _0x36b671=[];var _0x57afa9=squel[_0xc3e3('0x6f')]();_0x57afa9[_0xc3e3('0x70')]('tq.TeamId')[_0xc3e3('0x71')](_0xc3e3('0x72'),'tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0xc3e3('0x3f')](_0xc3e3('0x73'),_0x5a3d28[_0xc3e3('0x4a')]['id']);for(var _0x2dd3cd=0x0;_0x2dd3cd<_0x1fda94[_0xc3e3('0x3b')];_0x2dd3cd+=0x1){let _0x2d5386=_0x1fda94[_0x2dd3cd];for(var _0x5512b6=0x0;_0x5512b6<_0x2d5386[_0xc3e3('0x6e')][_0xc3e3('0x3b')];_0x5512b6+=0x1){let _0x1e2f8b=_0x2d5386['Agents'][_0x5512b6];var _0x25ce9c=_0x57afa9[_0xc3e3('0x74')]();_0x25ce9c[_0xc3e3('0x3f')](_0xc3e3('0x75'),_0x1e2f8b['id']);_0x36b671[_0xc3e3('0x76')](db['sequelize'][_0xc3e3('0x36')](_0x25ce9c['toString'](),{'type':db[_0xc3e3('0x68')][_0xc3e3('0x77')][_0xc3e3('0x78')]})[_0xc3e3('0x28')](function(_0xd3633b){if(_0xd3633b[_0xc3e3('0x3b')]===0x1){return _0x1e2f8b['id'];}else{var _0xb3e8bd=_[_0xc3e3('0x79')](_[_0xc3e3('0x30')](_0xd3633b,'TeamId'),function(_0x13876a){return _[_0xc3e3('0x7a')](_0x4245dc,_0x13876a);});if(_0xb3e8bd){return _0x1e2f8b['id'];}}}));}}return BPromise[_0xc3e3('0x7b')](_0x36b671)[_0xc3e3('0x28')](function(_0x365cc5){_0x1f3372=_(_0x1f3372)['union'](_0x365cc5)[_0xc3e3('0x7c')]()['value']();return db[_0xc3e3('0x31')][_0xc3e3('0x4b')]({'where':{'id':_0x5a3d28[_0xc3e3('0x4a')]['id']}})[_0xc3e3('0x28')](function(_0x5aa708){return db[_0xc3e3('0x68')]['transaction'](function(_0x5369f2){return _0x5aa708[_0xc3e3('0x6d')](_0x5a3d28[_0xc3e3('0x36')][_0xc3e3('0x7d')],{'transaction':_0x5369f2})['then'](function(){if(!_[_0xc3e3('0x7e')](_0x1f3372)){return _0x5aa708[_0xc3e3('0x7f')](_0x1f3372,{'transaction':_0x5369f2});}})[_0xc3e3('0x28')](function(){_0x1f3372[_0xc3e3('0x6a')](function(_0x88d1eb){socket[_0xc3e3('0x6b')]('userWhatsappQueue:remove',{'UserId':_0x88d1eb,'WhatsappQueueId':_0x5aa708['id']});});});});});});})[_0xc3e3('0x28')](respondWithStatusCode(_0x1a1030,null))[_0xc3e3('0x49')](handleError(_0x1a1030,null));};exports[_0xc3e3('0x80')]=function(_0x5ace56,_0x30cc00,_0x134ef3){return db[_0xc3e3('0x31')][_0xc3e3('0x4b')]({'where':{'id':_0x5ace56[_0xc3e3('0x4a')]['id']}})[_0xc3e3('0x28')](handleEntityNotFound(_0x30cc00,null))[_0xc3e3('0x28')](function(_0x1c584a){if(_0x1c584a){return _0x1c584a[_0xc3e3('0x80')](_0x5ace56[_0xc3e3('0x4d')][_0xc3e3('0x7d')],_[_0xc3e3('0x81')](_0x5ace56['body'],[_0xc3e3('0x7d'),'id'])||{})['spread'](function(_0x498b57){for(var _0x22dd0d=0x0;_0x22dd0d<_0x5ace56[_0xc3e3('0x4d')][_0xc3e3('0x7d')][_0xc3e3('0x3b')];_0x22dd0d+=0x1){socket['emit'](_0xc3e3('0x6c'),{'UserId':Number(_0x5ace56['body'][_0xc3e3('0x7d')][_0x22dd0d]),'WhatsappQueueId':Number(_0x5ace56['params']['id'])});}return _0x498b57;});}})[_0xc3e3('0x28')](respondWithResult(_0x30cc00,null))[_0xc3e3('0x49')](handleError(_0x30cc00,null));};exports['removeAgents']=function(_0x13afdd,_0x5d868d,_0x443ca5){return db[_0xc3e3('0x31')]['find']({'where':{'id':_0x13afdd[_0xc3e3('0x4a')]['id']}})[_0xc3e3('0x28')](handleEntityNotFound(_0x5d868d,null))[_0xc3e3('0x28')](function(_0x2242df){if(_0x2242df){return _0x2242df[_0xc3e3('0x7f')](_0x13afdd['query']['ids'])[_0xc3e3('0x28')](function(){if(_[_0xc3e3('0x82')](_0x13afdd[_0xc3e3('0x36')][_0xc3e3('0x7d')])){for(var _0xccd3ca=0x0;_0xccd3ca<_0x13afdd[_0xc3e3('0x36')][_0xc3e3('0x7d')]['length'];_0xccd3ca+=0x1){socket['emit'](_0xc3e3('0x83'),{'UserId':Number(_0x13afdd[_0xc3e3('0x36')][_0xc3e3('0x7d')][_0xccd3ca]),'WhatsappQueueId':Number(_0x13afdd[_0xc3e3('0x4a')]['id'])});}}else{socket['emit'](_0xc3e3('0x83'),{'UserId':Number(_0x13afdd[_0xc3e3('0x36')][_0xc3e3('0x7d')]),'WhatsappQueueId':Number(_0x13afdd[_0xc3e3('0x4a')]['id'])});}});}})[_0xc3e3('0x28')](respondWithStatusCode(_0x5d868d,null))[_0xc3e3('0x49')](handleError(_0x5d868d,null));};exports[_0xc3e3('0x84')]=function(_0x5b0c98,_0x24e6aa,_0x1a87d4){var _0x47f7a2={};var _0x101147={};var _0x37c585;var _0x2a607d;return db[_0xc3e3('0x31')]['findOne']({'where':{'id':_0x5b0c98[_0xc3e3('0x4a')]['id']}})[_0xc3e3('0x28')](handleEntityNotFound(_0x24e6aa,null))[_0xc3e3('0x28')](function(_0x45a7bc){if(_0x45a7bc){_0x37c585=_0x45a7bc;_0x101147[_0xc3e3('0x35')]=_[_0xc3e3('0x37')](db[_0xc3e3('0x5a')][_0xc3e3('0x32')]);_0x101147[_0xc3e3('0x36')]=_['keys'](_0x5b0c98[_0xc3e3('0x36')]);_0x101147[_0xc3e3('0x40')]=_[_0xc3e3('0x38')](_0x101147[_0xc3e3('0x35')],_0x101147[_0xc3e3('0x36')]);_0x47f7a2[_0xc3e3('0x39')]=_['intersection'](_0x101147[_0xc3e3('0x35')],qs['fields'](_0x5b0c98[_0xc3e3('0x36')][_0xc3e3('0x3a')]));_0x47f7a2[_0xc3e3('0x39')]=_0x47f7a2[_0xc3e3('0x39')]['length']?_0x47f7a2['attributes']:_0x101147[_0xc3e3('0x35')];_0x47f7a2[_0xc3e3('0x3e')]=qs['sort'](_0x5b0c98['query'][_0xc3e3('0x56')]);_0x47f7a2[_0xc3e3('0x3f')]=qs['filters'](_[_0xc3e3('0x57')](_0x5b0c98[_0xc3e3('0x36')],_0x101147[_0xc3e3('0x40')]));if(_0x5b0c98[_0xc3e3('0x36')][_0xc3e3('0x41')]){_0x47f7a2[_0xc3e3('0x3f')]=_[_0xc3e3('0x42')](_0x47f7a2['where'],{'$or':_['map'](_0x47f7a2[_0xc3e3('0x39')],function(_0x141df3){var _0x5abc10={};_0x5abc10[_0x141df3]={'$like':'%'+_0x5b0c98[_0xc3e3('0x36')][_0xc3e3('0x41')]+'%'};return _0x5abc10;})});}_0x47f7a2=_[_0xc3e3('0x42')]({},_0x47f7a2,_0x5b0c98[_0xc3e3('0x44')]);return _0x37c585[_0xc3e3('0x84')](_0x47f7a2);}})['then'](function(_0x12c270){if(_0x12c270){_0x2a607d=_0x12c270['length'];if(!_0x5b0c98[_0xc3e3('0x36')][_0xc3e3('0x3c')](_0xc3e3('0x3d'))){_0x47f7a2[_0xc3e3('0x1f')]=qs['limit'](_0x5b0c98[_0xc3e3('0x36')][_0xc3e3('0x1f')]);_0x47f7a2['offset']=qs[_0xc3e3('0x21')](_0x5b0c98['query'][_0xc3e3('0x21')]);}return _0x37c585['getAgents'](_0x47f7a2);}})[_0xc3e3('0x28')](function(_0x5e6d3c){if(_0x5e6d3c){return _0x5e6d3c?{'count':_0x2a607d,'rows':_0x5e6d3c}:null;}})[_0xc3e3('0x28')](respondWithResult(_0x24e6aa,null))[_0xc3e3('0x49')](handleError(_0x24e6aa,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index f7e8925..7735277 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 _0xab33=['../../mysqldb','WhatsappQueue','save','update','emit','hook','exports','events'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xab33,0x1a7));var _0x3ab3=function(_0x22ca44,_0x384f52){_0x22ca44=_0x22ca44-0x0;var _0x4764e8=_0xab33[_0x22ca44];return _0x4764e8;};'use strict';var EventEmitter=require(_0x3ab3('0x0'));var WhatsappQueue=require(_0x3ab3('0x1'))['db'][_0x3ab3('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3ab3('0x3'),'afterUpdate':_0x3ab3('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3f0bbc){return function(_0x3e7311,_0x3a6f4b,_0x3f4680){WhatsappQueueEvents['emit'](_0x3f0bbc+':'+_0x3e7311['id'],_0x3e7311);WhatsappQueueEvents[_0x3ab3('0x5')](_0x3f0bbc,_0x3e7311);_0x3f4680(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0x3ab3('0x6')](e,emitEvent(event));}}module[_0x3ab3('0x7')]=WhatsappQueueEvents; \ No newline at end of file +var _0x3c23=['hook','exports','events','../../mysqldb','WhatsappQueue','save','update','remove','emit','hasOwnProperty'];(function(_0x46cf7a,_0x54e3a0){var _0x2a5cd0=function(_0x3eb419){while(--_0x3eb419){_0x46cf7a['push'](_0x46cf7a['shift']());}};_0x2a5cd0(++_0x54e3a0);}(_0x3c23,0xd4));var _0x33c2=function(_0x500d35,_0x3f5d69){_0x500d35=_0x500d35-0x0;var _0x383af4=_0x3c23[_0x500d35];return _0x383af4;};'use strict';var EventEmitter=require(_0x33c2('0x0'));var WhatsappQueue=require(_0x33c2('0x1'))['db'][_0x33c2('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x33c2('0x3'),'afterUpdate':_0x33c2('0x4'),'afterDestroy':_0x33c2('0x5')};function emitEvent(_0x4cce5c){return function(_0x3fcc80,_0x25b5a0,_0x33170e){WhatsappQueueEvents[_0x33c2('0x6')](_0x4cce5c+':'+_0x3fcc80['id'],_0x3fcc80);WhatsappQueueEvents[_0x33c2('0x6')](_0x4cce5c,_0x3fcc80);_0x33170e(null);};}for(var e in events){if(events[_0x33c2('0x7')](e)){var event=events[e];WhatsappQueue[_0x33c2('0x8')](e,emitEvent(event));}}module[_0x33c2('0x9')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index d43428e..38085c2 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 _0x1a8c=['bluebird','request-promise','path','../../config/environment','./whatsappQueue.attributes','whatsapp_queues','lodash','util','api'];(function(_0x836cbf,_0x1b74d5){var _0x525eb1=function(_0x5586f2){while(--_0x5586f2){_0x836cbf['push'](_0x836cbf['shift']());}};_0x525eb1(++_0x1b74d5);}(_0x1a8c,0x11d));var _0xc1a8=function(_0x2b5fce,_0x58a432){_0x2b5fce=_0x2b5fce-0x0;var _0x17985f=_0x1a8c[_0x2b5fce];return _0x17985f;};'use strict';var _=require(_0xc1a8('0x0'));var util=require(_0xc1a8('0x1'));var logger=require('../../config/logger')(_0xc1a8('0x2'));var moment=require('moment');var BPromise=require(_0xc1a8('0x3'));var rp=require(_0xc1a8('0x4'));var fs=require('fs');var path=require(_0xc1a8('0x5'));var rimraf=require('rimraf');var config=require(_0xc1a8('0x6'));var attributes=require(_0xc1a8('0x7'));module['exports']=function(_0x265b8f,_0x3b2d85){return _0x265b8f['define']('WhatsappQueue',attributes,{'tableName':_0xc1a8('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc0bd=['exports','define','WhatsappQueue','whatsapp_queues','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueue.attributes'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0xc0bd,0x1f0));var _0xdc0b=function(_0x83d214,_0x2f6968){_0x83d214=_0x83d214-0x0;var _0x335e1d=_0xc0bd[_0x83d214];return _0x335e1d;};'use strict';var _=require('lodash');var util=require(_0xdc0b('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xdc0b('0x1'));var BPromise=require(_0xdc0b('0x2'));var rp=require(_0xdc0b('0x3'));var fs=require('fs');var path=require(_0xdc0b('0x4'));var rimraf=require(_0xdc0b('0x5'));var config=require(_0xdc0b('0x6'));var attributes=require(_0xdc0b('0x7'));module[_0xdc0b('0x8')]=function(_0x3ecfc1,_0x81536f){return _0x3ecfc1[_0xdc0b('0x9')](_0xdc0b('0xa'),attributes,{'tableName':_0xdc0b('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 335b17d..59ae786 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 _0xbf2a=['http','defaults','redis','localhost','socket.io-emitter','./whatsappQueue.socket','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','options','raw','where','include','map','model','attributes','debug','GetWhatsappQueue','ShowWhatsappQueue','WhatsappQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xbf2a,0x1cc));var _0xabf2=function(_0x3a175b,_0x505d13){_0x3a175b=_0x3a175b-0x0;var _0x9b84fa=_0xbf2a[_0x3a175b];return _0x9b84fa;};'use strict';var _=require(_0xabf2('0x0'));var util=require(_0xabf2('0x1'));var moment=require(_0xabf2('0x2'));var BPromise=require(_0xabf2('0x3'));var rs=require(_0xabf2('0x4'));var fs=require('fs');var Redis=require(_0xabf2('0x5'));var db=require(_0xabf2('0x6'))['db'];var utils=require(_0xabf2('0x7'));var logger=require(_0xabf2('0x8'))(_0xabf2('0x9'));var config=require(_0xabf2('0xa'));var jayson=require(_0xabf2('0xb'));var client=jayson[_0xabf2('0xc')][_0xabf2('0xd')]({'port':0x232a});config['redis']=_[_0xabf2('0xe')](config[_0xabf2('0xf')],{'host':_0xabf2('0x10'),'port':0x18eb});var socket=require(_0xabf2('0x11'))(new Redis(config['redis']));require(_0xabf2('0x12'))[_0xabf2('0x13')](socket);function respondWithRpcPromise(_0x1b27a1,_0x163c85,_0xe0b00f){return new BPromise(function(_0x2b6405,_0x5099f5){return client[_0xabf2('0x14')](_0x1b27a1,_0xe0b00f)[_0xabf2('0x15')](function(_0x2ae4e9){logger[_0xabf2('0x16')](_0xabf2('0x17'),_0x163c85,_0xabf2('0x18'));logger['debug'](_0xabf2('0x19'),_0x163c85,_0xabf2('0x18'),JSON[_0xabf2('0x1a')](_0x2ae4e9));if(_0x2ae4e9[_0xabf2('0x1b')]){if(_0x2ae4e9[_0xabf2('0x1b')][_0xabf2('0x1c')]===0x1f4){logger[_0xabf2('0x1b')](_0xabf2('0x17'),_0x163c85,_0x2ae4e9[_0xabf2('0x1b')][_0xabf2('0x1d')]);return _0x5099f5(_0x2ae4e9[_0xabf2('0x1b')][_0xabf2('0x1d')]);}logger[_0xabf2('0x1b')](_0xabf2('0x17'),_0x163c85,_0x2ae4e9['error'][_0xabf2('0x1d')]);return _0x2b6405(_0x2ae4e9[_0xabf2('0x1b')][_0xabf2('0x1d')]);}else{logger[_0xabf2('0x16')](_0xabf2('0x17'),_0x163c85,_0xabf2('0x18'));_0x2b6405(_0x2ae4e9[_0xabf2('0x1e')]['message']);}})[_0xabf2('0x1f')](function(_0x1bac83){logger['error']('WhatsappQueue,\x20%s,\x20%s',_0x163c85,_0x1bac83);_0x5099f5(_0x1bac83);});});}exports['GetWhatsappQueue']=function(_0xafae11){var _0x405907=this;return new Promise(function(_0x58adf0,_0x5cdf9e){return db['WhatsappQueue']['findAll']({'raw':_0xafae11[_0xabf2('0x20')]?_0xafae11[_0xabf2('0x20')][_0xabf2('0x21')]===undefined?!![]:![]:!![],'where':_0xafae11['options']?_0xafae11[_0xabf2('0x20')][_0xabf2('0x22')]||null:null,'attributes':_0xafae11['options']?_0xafae11[_0xabf2('0x20')]['attributes']||null:null,'limit':_0xafae11['options']?_0xafae11[_0xabf2('0x20')]['limit']||null:null,'include':_0xafae11[_0xabf2('0x20')]?_0xafae11[_0xabf2('0x20')][_0xabf2('0x23')]?_[_0xabf2('0x24')](_0xafae11[_0xabf2('0x20')][_0xabf2('0x23')],function(_0x254c8b){return{'model':db[_0x254c8b[_0xabf2('0x25')]],'as':_0x254c8b['as'],'attributes':_0x254c8b['attributes'],'include':_0x254c8b[_0xabf2('0x23')]?_[_0xabf2('0x24')](_0x254c8b[_0xabf2('0x23')],function(_0xc4a180){return{'model':db[_0xc4a180[_0xabf2('0x25')]],'as':_0xc4a180['as'],'attributes':_0xc4a180[_0xabf2('0x26')],'include':_0xc4a180[_0xabf2('0x23')]?_[_0xabf2('0x24')](_0xc4a180[_0xabf2('0x23')],function(_0x1f7cd5){return{'model':db[_0x1f7cd5['model']],'as':_0x1f7cd5['as'],'attributes':_0x1f7cd5[_0xabf2('0x26')]};}):[]};}):[]};}):[]:[]})[_0xabf2('0x15')](function(_0x102952){logger[_0xabf2('0x16')]('GetWhatsappQueue',_0xafae11);logger[_0xabf2('0x27')](_0xabf2('0x28'),_0xafae11,JSON['stringify'](_0x102952));_0x58adf0(_0x102952);})[_0xabf2('0x1f')](function(_0x23c3af){logger[_0xabf2('0x1b')]('GetWhatsappQueue',_0x23c3af[_0xabf2('0x1d')],_0xafae11);_0x5cdf9e(_0x405907['error'](0x1f4,_0x23c3af[_0xabf2('0x1d')]));});});};exports[_0xabf2('0x29')]=function(_0x2804af){var _0x13559c=this;return new Promise(function(_0xbfbd7c,_0x1adb1a){return db[_0xabf2('0x2a')]['find']({'raw':_0x2804af[_0xabf2('0x20')]?_0x2804af[_0xabf2('0x20')][_0xabf2('0x21')]===undefined?!![]:![]:!![],'where':_0x2804af['options']?_0x2804af[_0xabf2('0x20')]['where']||null:null,'attributes':_0x2804af['options']?_0x2804af[_0xabf2('0x20')][_0xabf2('0x26')]||null:null,'include':_0x2804af[_0xabf2('0x20')]?_0x2804af['options'][_0xabf2('0x23')]?_[_0xabf2('0x24')](_0x2804af[_0xabf2('0x20')][_0xabf2('0x23')],function(_0x2b1018){return{'model':db[_0x2b1018[_0xabf2('0x25')]],'as':_0x2b1018['as'],'attributes':_0x2b1018[_0xabf2('0x26')],'include':_0x2b1018[_0xabf2('0x23')]?_[_0xabf2('0x24')](_0x2b1018[_0xabf2('0x23')],function(_0x25a04d){return{'model':db[_0x25a04d[_0xabf2('0x25')]],'as':_0x25a04d['as'],'attributes':_0x25a04d['attributes'],'include':_0x25a04d[_0xabf2('0x23')]?_['map'](_0x25a04d[_0xabf2('0x23')],function(_0x552ccd){return{'model':db[_0x552ccd['model']],'as':_0x552ccd['as'],'attributes':_0x552ccd[_0xabf2('0x26')]};}):[]};}):[]};}):[]:[]})[_0xabf2('0x15')](function(_0x40e415){logger['info']('ShowWhatsappQueue',_0x2804af);logger[_0xabf2('0x27')](_0xabf2('0x29'),_0x2804af,JSON[_0xabf2('0x1a')](_0x40e415));_0xbfbd7c(_0x40e415);})['catch'](function(_0x87730b){logger[_0xabf2('0x1b')](_0xabf2('0x29'),_0x87730b['message'],_0x2804af);_0x1adb1a(_0x13559c[_0xabf2('0x1b')](0x1f4,_0x87730b[_0xabf2('0x1d')]));});});}; \ No newline at end of file +var _0x5f47=['http','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','request','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','where','limit','include','map','model','attributes','then','catch','ShowWhatsappQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0xb2ec,_0x4b9c26){var _0x2156a6=function(_0x9fe858){while(--_0x9fe858){_0xb2ec['push'](_0xb2ec['shift']());}};_0x2156a6(++_0x4b9c26);}(_0x5f47,0x154));var _0x75f4=function(_0x2aa562,_0x3e73cf){_0x2aa562=_0x2aa562-0x0;var _0x40e7ec=_0x5f47[_0x2aa562];return _0x40e7ec;};'use strict';var _=require(_0x75f4('0x0'));var util=require(_0x75f4('0x1'));var moment=require(_0x75f4('0x2'));var BPromise=require(_0x75f4('0x3'));var rs=require(_0x75f4('0x4'));var fs=require('fs');var Redis=require(_0x75f4('0x5'));var db=require(_0x75f4('0x6'))['db'];var utils=require(_0x75f4('0x7'));var logger=require(_0x75f4('0x8'))('rpc');var config=require(_0x75f4('0x9'));var jayson=require(_0x75f4('0xa'));var client=jayson[_0x75f4('0xb')][_0x75f4('0xc')]({'port':0x232a});config[_0x75f4('0xd')]=_[_0x75f4('0xe')](config[_0x75f4('0xd')],{'host':_0x75f4('0xf'),'port':0x18eb});var socket=require(_0x75f4('0x10'))(new Redis(config[_0x75f4('0xd')]));require(_0x75f4('0x11'))[_0x75f4('0x12')](socket);function respondWithRpcPromise(_0x5913f0,_0x18d2a8,_0x3c7685){return new BPromise(function(_0xd38a57,_0x2faa73){return client[_0x75f4('0x13')](_0x5913f0,_0x3c7685)['then'](function(_0x11e474){logger[_0x75f4('0x14')](_0x75f4('0x15'),_0x18d2a8,_0x75f4('0x16'));logger[_0x75f4('0x17')](_0x75f4('0x18'),_0x18d2a8,_0x75f4('0x16'),JSON[_0x75f4('0x19')](_0x11e474));if(_0x11e474['error']){if(_0x11e474[_0x75f4('0x1a')][_0x75f4('0x1b')]===0x1f4){logger['error'](_0x75f4('0x15'),_0x18d2a8,_0x11e474[_0x75f4('0x1a')][_0x75f4('0x1c')]);return _0x2faa73(_0x11e474[_0x75f4('0x1a')]['message']);}logger[_0x75f4('0x1a')](_0x75f4('0x15'),_0x18d2a8,_0x11e474[_0x75f4('0x1a')][_0x75f4('0x1c')]);return _0xd38a57(_0x11e474[_0x75f4('0x1a')][_0x75f4('0x1c')]);}else{logger[_0x75f4('0x14')](_0x75f4('0x15'),_0x18d2a8,_0x75f4('0x16'));_0xd38a57(_0x11e474['result'][_0x75f4('0x1c')]);}})['catch'](function(_0x49a030){logger[_0x75f4('0x1a')](_0x75f4('0x15'),_0x18d2a8,_0x49a030);_0x2faa73(_0x49a030);});});}exports[_0x75f4('0x1d')]=function(_0x224d6c){var _0x5e32e8=this;return new Promise(function(_0x403b8a,_0x3f2114){return db[_0x75f4('0x1e')][_0x75f4('0x1f')]({'raw':_0x224d6c[_0x75f4('0x20')]?_0x224d6c['options'][_0x75f4('0x21')]===undefined?!![]:![]:!![],'where':_0x224d6c[_0x75f4('0x20')]?_0x224d6c[_0x75f4('0x20')][_0x75f4('0x22')]||null:null,'attributes':_0x224d6c[_0x75f4('0x20')]?_0x224d6c[_0x75f4('0x20')]['attributes']||null:null,'limit':_0x224d6c[_0x75f4('0x20')]?_0x224d6c[_0x75f4('0x20')][_0x75f4('0x23')]||null:null,'include':_0x224d6c['options']?_0x224d6c['options'][_0x75f4('0x24')]?_[_0x75f4('0x25')](_0x224d6c[_0x75f4('0x20')][_0x75f4('0x24')],function(_0x4c8b50){return{'model':db[_0x4c8b50[_0x75f4('0x26')]],'as':_0x4c8b50['as'],'attributes':_0x4c8b50[_0x75f4('0x27')],'include':_0x4c8b50['include']?_[_0x75f4('0x25')](_0x4c8b50[_0x75f4('0x24')],function(_0x318423){return{'model':db[_0x318423[_0x75f4('0x26')]],'as':_0x318423['as'],'attributes':_0x318423[_0x75f4('0x27')],'include':_0x318423['include']?_[_0x75f4('0x25')](_0x318423[_0x75f4('0x24')],function(_0x1ec6a9){return{'model':db[_0x1ec6a9[_0x75f4('0x26')]],'as':_0x1ec6a9['as'],'attributes':_0x1ec6a9['attributes']};}):[]};}):[]};}):[]:[]})[_0x75f4('0x28')](function(_0x2e9a48){logger[_0x75f4('0x14')](_0x75f4('0x1d'),_0x224d6c);logger[_0x75f4('0x17')](_0x75f4('0x1d'),_0x224d6c,JSON[_0x75f4('0x19')](_0x2e9a48));_0x403b8a(_0x2e9a48);})[_0x75f4('0x29')](function(_0x419757){logger['error'](_0x75f4('0x1d'),_0x419757[_0x75f4('0x1c')],_0x224d6c);_0x3f2114(_0x5e32e8[_0x75f4('0x1a')](0x1f4,_0x419757[_0x75f4('0x1c')]));});});};exports[_0x75f4('0x2a')]=function(_0x4a78d5){var _0x142fd6=this;return new Promise(function(_0x1aa77f,_0x186af6){return db[_0x75f4('0x1e')][_0x75f4('0x2b')]({'raw':_0x4a78d5[_0x75f4('0x20')]?_0x4a78d5[_0x75f4('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x4a78d5[_0x75f4('0x20')]?_0x4a78d5['options']['where']||null:null,'attributes':_0x4a78d5[_0x75f4('0x20')]?_0x4a78d5['options'][_0x75f4('0x27')]||null:null,'include':_0x4a78d5[_0x75f4('0x20')]?_0x4a78d5['options']['include']?_[_0x75f4('0x25')](_0x4a78d5[_0x75f4('0x20')]['include'],function(_0x5477d5){return{'model':db[_0x5477d5[_0x75f4('0x26')]],'as':_0x5477d5['as'],'attributes':_0x5477d5[_0x75f4('0x27')],'include':_0x5477d5[_0x75f4('0x24')]?_[_0x75f4('0x25')](_0x5477d5[_0x75f4('0x24')],function(_0x4edd5c){return{'model':db[_0x4edd5c[_0x75f4('0x26')]],'as':_0x4edd5c['as'],'attributes':_0x4edd5c['attributes'],'include':_0x4edd5c[_0x75f4('0x24')]?_[_0x75f4('0x25')](_0x4edd5c['include'],function(_0xf996e4){return{'model':db[_0xf996e4['model']],'as':_0xf996e4['as'],'attributes':_0xf996e4[_0x75f4('0x27')]};}):[]};}):[]};}):[]:[]})[_0x75f4('0x28')](function(_0x5744c9){logger[_0x75f4('0x14')](_0x75f4('0x2a'),_0x4a78d5);logger['debug']('ShowWhatsappQueue',_0x4a78d5,JSON[_0x75f4('0x19')](_0x5744c9));_0x1aa77f(_0x5744c9);})[_0x75f4('0x29')](function(_0xf007f7){logger[_0x75f4('0x1a')]('ShowWhatsappQueue',_0xf007f7[_0x75f4('0x1c')],_0x4a78d5);_0x186af6(_0x142fd6['error'](0x1f4,_0xf007f7[_0x75f4('0x1c')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 3b543b4..9dc71e0 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 _0x6894=['length','whatsappQueue:','./whatsappQueue.events','save','update','emit'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x6894,0x18e));var _0x4689=function(_0x46f1a6,_0xc7a582){_0x46f1a6=_0x46f1a6-0x0;var _0x38429a=_0x6894[_0x46f1a6];return _0x38429a;};'use strict';var WhatsappQueueEvents=require(_0x4689('0x0'));var events=[_0x4689('0x1'),'remove',_0x4689('0x2')];function createListener(_0x18621a,_0x572346){return function(_0x5d8aaa){_0x572346[_0x4689('0x3')](_0x18621a,_0x5d8aaa);};}function removeListener(_0x69b712,_0x196f1e){return function(){WhatsappQueueEvents['removeListener'](_0x69b712,_0x196f1e);};}exports['register']=function(_0x3de0e8){for(var _0x5bfb33=0x0,_0x7c6bde=events[_0x4689('0x4')];_0x5bfb33<_0x7c6bde;_0x5bfb33++){var _0x5eddbe=events[_0x5bfb33];var _0x1577db=createListener(_0x4689('0x5')+_0x5eddbe,_0x3de0e8);WhatsappQueueEvents['on'](_0x5eddbe,_0x1577db);}}; \ No newline at end of file +var _0x3f05=['length','whatsappQueue:','save','remove','update','removeListener','register'];(function(_0x3060e3,_0x14f2c6){var _0x497d2c=function(_0x2a274a){while(--_0x2a274a){_0x3060e3['push'](_0x3060e3['shift']());}};_0x497d2c(++_0x14f2c6);}(_0x3f05,0x12f));var _0x53f0=function(_0xc43cee,_0x234a10){_0xc43cee=_0xc43cee-0x0;var _0x5ce6dc=_0x3f05[_0xc43cee];return _0x5ce6dc;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=[_0x53f0('0x0'),_0x53f0('0x1'),_0x53f0('0x2')];function createListener(_0x27e18b,_0x470486){return function(_0x1bbff5){_0x470486['emit'](_0x27e18b,_0x1bbff5);};}function removeListener(_0x2bb35a,_0x541188){return function(){WhatsappQueueEvents[_0x53f0('0x3')](_0x2bb35a,_0x541188);};}exports[_0x53f0('0x4')]=function(_0x5488fe){for(var _0x32a3ea=0x0,_0x56f7db=events[_0x53f0('0x5')];_0x32a3ea<_0x56f7db;_0x32a3ea++){var _0x26bfb9=events[_0x32a3ea];var _0x502829=createListener(_0x53f0('0x6')+_0x26bfb9,_0x5488fe);WhatsappQueueEvents['on'](_0x26bfb9,_0x502829);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 1f1efe3..c3d3bf4 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 _0xa0d8=['put','isAuthenticated','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','/describe','describe','/:id','show','post','create'];(function(_0x3dfbc3,_0x41a601){var _0x53fc9e=function(_0xaeae50){while(--_0xaeae50){_0x3dfbc3['push'](_0x3dfbc3['shift']());}};_0x53fc9e(++_0x41a601);}(_0xa0d8,0x1bd));var _0x8a0d=function(_0x28db79,_0x2a1b2e){_0x28db79=_0x28db79-0x0;var _0x13fd6a=_0xa0d8[_0x28db79];return _0x13fd6a;};'use strict';var multer=require(_0x8a0d('0x0'));var util=require(_0x8a0d('0x1'));var path=require(_0x8a0d('0x2'));var timeout=require(_0x8a0d('0x3'));var express=require(_0x8a0d('0x4'));var router=express[_0x8a0d('0x5')]();var fs_extra=require(_0x8a0d('0x6'));var auth=require(_0x8a0d('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x8a0d('0x8'));var controller=require('./whatsappQueueReport.controller');router[_0x8a0d('0x9')]('/',auth['isAuthenticated'](),controller[_0x8a0d('0xa')]);router[_0x8a0d('0x9')](_0x8a0d('0xb'),auth['isAuthenticated'](),controller[_0x8a0d('0xc')]);router[_0x8a0d('0x9')](_0x8a0d('0xd'),auth['isAuthenticated'](),controller[_0x8a0d('0xe')]);router[_0x8a0d('0xf')]('/',auth['isAuthenticated'](),controller[_0x8a0d('0x10')]);router[_0x8a0d('0x11')](_0x8a0d('0xd'),auth[_0x8a0d('0x12')](),controller[_0x8a0d('0x13')]);router['delete'](_0x8a0d('0xd'),auth[_0x8a0d('0x12')](),controller[_0x8a0d('0x14')]);module[_0x8a0d('0x15')]=router; \ No newline at end of file +var _0x876d=['../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','delete','exports','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x274495,_0x38dae6){var _0x510f4f=function(_0x22f1b8){while(--_0x22f1b8){_0x274495['push'](_0x274495['shift']());}};_0x510f4f(++_0x38dae6);}(_0x876d,0xf2));var _0xd876=function(_0x76b4ee,_0x1f43ab){_0x76b4ee=_0x76b4ee-0x0;var _0x1d8e3f=_0x876d[_0x76b4ee];return _0x1d8e3f;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xd876('0x0'));var express=require(_0xd876('0x1'));var router=express[_0xd876('0x2')]();var fs_extra=require(_0xd876('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xd876('0x4'));var config=require(_0xd876('0x5'));var controller=require(_0xd876('0x6'));router[_0xd876('0x7')]('/',auth[_0xd876('0x8')](),controller[_0xd876('0x9')]);router[_0xd876('0x7')](_0xd876('0xa'),auth[_0xd876('0x8')](),controller[_0xd876('0xb')]);router[_0xd876('0x7')](_0xd876('0xc'),auth[_0xd876('0x8')](),controller[_0xd876('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xd876('0xe')]);router[_0xd876('0xf')](_0xd876('0xc'),auth[_0xd876('0x8')](),controller[_0xd876('0x10')]);router[_0xd876('0x11')](_0xd876('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xd876('0x12')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index d046c60..973a5be 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x42531a,_0x4113e2){var _0x982e9d=function(_0x864f93){while(--_0x864f93){_0x42531a['push'](_0x42531a['shift']());}};_0x982e9d(++_0x4113e2);}(_0x7a54,0x106));var _0x47a5=function(_0x1b08d6,_0x41249f){_0x1b08d6=_0x1b08d6-0x0;var _0x55b7a7=_0x7a54[_0x1b08d6];return _0x55b7a7;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file +var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x1f7bbe,_0x27ae81){var _0x2a5b14=function(_0x41c26b){while(--_0x41c26b){_0x1f7bbe['push'](_0x1f7bbe['shift']());}};_0x2a5b14(++_0x27ae81);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index 80fad19..b6f00d0 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 _0xeb74=['papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','merge','where','VIRTUAL','filter','options','WhatsappQueueReport','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring'];(function(_0x25c652,_0x311706){var _0x3cdbd6=function(_0x431640){while(--_0x431640){_0x25c652['push'](_0x25c652['shift']());}};_0x3cdbd6(++_0x311706);}(_0xeb74,0xe3));var _0x4eb7=function(_0x4e2852,_0xedb7ed){_0x4e2852=_0x4e2852-0x0;var _0x2f93f9=_0xeb74[_0x4e2852];return _0x2f93f9;};'use strict';var emlformat=require(_0x4eb7('0x0'));var rimraf=require(_0x4eb7('0x1'));var zipdir=require(_0x4eb7('0x2'));var jsonpatch=require(_0x4eb7('0x3'));var rp=require(_0x4eb7('0x4'));var moment=require(_0x4eb7('0x5'));var BPromise=require(_0x4eb7('0x6'));var Mustache=require('mustache');var util=require(_0x4eb7('0x7'));var path=require(_0x4eb7('0x8'));var sox=require(_0x4eb7('0x9'));var csv=require(_0x4eb7('0xa'));var ejs=require(_0x4eb7('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4eb7('0xc'));var squel=require('squel');var crypto=require(_0x4eb7('0xd'));var jsforce=require(_0x4eb7('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4eb7('0xf'));var Papa=require(_0x4eb7('0x10'));var Redis=require('ioredis');var authService=require(_0x4eb7('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4eb7('0x12'));var hardwareService=require(_0x4eb7('0x13'));var logger=require(_0x4eb7('0x14'))('api');var utils=require(_0x4eb7('0x15'));var config=require(_0x4eb7('0x16'));var licenseUtil=require(_0x4eb7('0x17'));var db=require(_0x4eb7('0x18'))['db'];function respondWithStatusCode(_0x35fa89,_0x4194e1){_0x4194e1=_0x4194e1||0xcc;return function(_0x3c9f45){if(_0x3c9f45){return _0x35fa89['sendStatus'](_0x4194e1);}return _0x35fa89['status'](_0x4194e1)['end']();};}function respondWithResult(_0x17fb81,_0x51f09d){_0x51f09d=_0x51f09d||0xc8;return function(_0x84c68b){if(_0x84c68b){return _0x17fb81[_0x4eb7('0x19')](_0x51f09d)[_0x4eb7('0x1a')](_0x84c68b);}};}function respondWithFilteredResult(_0x1c4a97,_0x5d6d5){return function(_0x21433d){if(_0x21433d){var _0x11674f=typeof _0x5d6d5[_0x4eb7('0x1b')]===_0x4eb7('0x1c')&&typeof _0x5d6d5[_0x4eb7('0x1d')]==='undefined';var _0xb86bc9=_0x21433d[_0x4eb7('0x1e')];var _0x3b6d41=_0x11674f?0x0:_0x5d6d5[_0x4eb7('0x1b')];var _0x302e16=_0x11674f?_0x21433d[_0x4eb7('0x1e')]:_0x5d6d5[_0x4eb7('0x1b')]+_0x5d6d5[_0x4eb7('0x1d')];var _0x5f4780;if(_0x302e16>=_0xb86bc9){_0x302e16=_0xb86bc9;_0x5f4780=0xc8;}else{_0x5f4780=0xce;}_0x1c4a97[_0x4eb7('0x19')](_0x5f4780);return _0x1c4a97[_0x4eb7('0x1f')](_0x4eb7('0x20'),_0x3b6d41+'-'+_0x302e16+'/'+_0xb86bc9)[_0x4eb7('0x1a')](_0x21433d);}return null;};}function patchUpdates(_0x32f0f5){return function(_0x2efd67){try{jsonpatch[_0x4eb7('0x21')](_0x2efd67,_0x32f0f5,!![]);}catch(_0x4ddbe4){return BPromise[_0x4eb7('0x22')](_0x4ddbe4);}return _0x2efd67[_0x4eb7('0x23')]();};}function saveUpdates(_0x4783b1,_0x164515){return function(_0x14a7be){if(_0x14a7be){return _0x14a7be[_0x4eb7('0x24')](_0x4783b1)[_0x4eb7('0x25')](function(_0x2df1b1){return _0x2df1b1;});}return null;};}function removeEntity(_0x1a2b8b,_0x13e871){return function(_0x4de2d9){if(_0x4de2d9){return _0x4de2d9[_0x4eb7('0x26')]()[_0x4eb7('0x25')](function(){_0x1a2b8b[_0x4eb7('0x19')](0xcc)[_0x4eb7('0x27')]();});}};}function handleEntityNotFound(_0x3e0da2,_0x25eb74){return function(_0x365060){if(!_0x365060){_0x3e0da2[_0x4eb7('0x28')](0x194);}return _0x365060;};}function handleError(_0x80b804,_0x248759){_0x248759=_0x248759||0x1f4;return function(_0xf83c11){logger[_0x4eb7('0x29')](_0xf83c11[_0x4eb7('0x2a')]);if(_0xf83c11[_0x4eb7('0x2b')]){delete _0xf83c11[_0x4eb7('0x2b')];}_0x80b804[_0x4eb7('0x19')](_0x248759)[_0x4eb7('0x2c')](_0xf83c11);};}exports[_0x4eb7('0x2d')]=function(_0x33a2c1,_0x28fda8){var _0x114c68={},_0x17030a={},_0x3ed224={'count':0x0,'rows':[]};var _0x50209d=_[_0x4eb7('0x2e')](db['WhatsappQueueReport'][_0x4eb7('0x2f')],function(_0x13f71a){return{'name':_0x13f71a[_0x4eb7('0x30')],'type':_0x13f71a[_0x4eb7('0x31')][_0x4eb7('0x32')]};});_0x17030a[_0x4eb7('0x33')]=_[_0x4eb7('0x2e')](_0x50209d,_0x4eb7('0x2b'));_0x17030a[_0x4eb7('0x34')]=_['keys'](_0x33a2c1[_0x4eb7('0x34')]);_0x17030a['filters']=_[_0x4eb7('0x35')](_0x17030a[_0x4eb7('0x33')],_0x17030a['query']);_0x114c68['attributes']=_[_0x4eb7('0x35')](_0x17030a[_0x4eb7('0x33')],qs[_0x4eb7('0x36')](_0x33a2c1[_0x4eb7('0x34')]['fields']));_0x114c68[_0x4eb7('0x37')]=_0x114c68[_0x4eb7('0x37')][_0x4eb7('0x38')]?_0x114c68[_0x4eb7('0x37')]:_0x17030a[_0x4eb7('0x33')];if(!_0x33a2c1['query'][_0x4eb7('0x39')](_0x4eb7('0x3a'))){_0x114c68[_0x4eb7('0x1d')]=qs['limit'](_0x33a2c1[_0x4eb7('0x34')][_0x4eb7('0x1d')]);_0x114c68[_0x4eb7('0x1b')]=qs['offset'](_0x33a2c1[_0x4eb7('0x34')]['offset']);}_0x114c68[_0x4eb7('0x3b')]=qs[_0x4eb7('0x3c')](_0x33a2c1[_0x4eb7('0x34')][_0x4eb7('0x3c')]);_0x114c68['where']=qs[_0x4eb7('0x3d')](_[_0x4eb7('0x3e')](_0x33a2c1[_0x4eb7('0x34')],_0x17030a[_0x4eb7('0x3d')]),_0x50209d);if(_0x33a2c1['query']['filter']){_0x114c68['where']=_[_0x4eb7('0x3f')](_0x114c68[_0x4eb7('0x40')],{'$or':_[_0x4eb7('0x2e')](_0x50209d,function(_0x20ac7b){if(_0x20ac7b[_0x4eb7('0x31')]!==_0x4eb7('0x41')){var _0x1038c1={};_0x1038c1[_0x20ac7b[_0x4eb7('0x2b')]]={'$like':'%'+_0x33a2c1[_0x4eb7('0x34')][_0x4eb7('0x42')]+'%'};return _0x1038c1;}})});}_0x114c68=_['merge']({},_0x114c68,_0x33a2c1[_0x4eb7('0x43')]);var _0x38218f={'where':_0x114c68[_0x4eb7('0x40')]};return db[_0x4eb7('0x44')][_0x4eb7('0x1e')](_0x38218f)[_0x4eb7('0x25')](function(_0x704d4d){_0x3ed224[_0x4eb7('0x1e')]=_0x704d4d;if(_0x33a2c1[_0x4eb7('0x34')][_0x4eb7('0x45')]){_0x114c68[_0x4eb7('0x46')]=[{'all':!![]}];}return db[_0x4eb7('0x44')][_0x4eb7('0x47')](_0x114c68);})[_0x4eb7('0x25')](function(_0x38af1f){_0x3ed224[_0x4eb7('0x48')]=_0x38af1f;return _0x3ed224;})[_0x4eb7('0x25')](respondWithFilteredResult(_0x28fda8,_0x114c68))[_0x4eb7('0x49')](handleError(_0x28fda8,null));};exports[_0x4eb7('0x4a')]=function(_0x79aec5,_0x5eff9e){var _0x2fd5c2={'raw':!![],'where':{'id':_0x79aec5[_0x4eb7('0x4b')]['id']}},_0x2df542={};_0x2df542[_0x4eb7('0x33')]=_[_0x4eb7('0x4c')](db[_0x4eb7('0x44')][_0x4eb7('0x2f')]);_0x2df542[_0x4eb7('0x34')]=_[_0x4eb7('0x4c')](_0x79aec5['query']);_0x2df542[_0x4eb7('0x3d')]=_['intersection'](_0x2df542[_0x4eb7('0x33')],_0x2df542[_0x4eb7('0x34')]);_0x2fd5c2[_0x4eb7('0x37')]=_['intersection'](_0x2df542[_0x4eb7('0x33')],qs[_0x4eb7('0x36')](_0x79aec5[_0x4eb7('0x34')][_0x4eb7('0x36')]));_0x2fd5c2['attributes']=_0x2fd5c2[_0x4eb7('0x37')]['length']?_0x2fd5c2[_0x4eb7('0x37')]:_0x2df542[_0x4eb7('0x33')];if(_0x79aec5[_0x4eb7('0x34')][_0x4eb7('0x45')]){_0x2fd5c2[_0x4eb7('0x46')]=[{'all':!![]}];}_0x2fd5c2=_['merge']({},_0x2fd5c2,_0x79aec5['options']);return db[_0x4eb7('0x44')][_0x4eb7('0x4d')](_0x2fd5c2)[_0x4eb7('0x25')](handleEntityNotFound(_0x5eff9e,null))[_0x4eb7('0x25')](respondWithResult(_0x5eff9e,null))[_0x4eb7('0x49')](handleError(_0x5eff9e,null));};exports['create']=function(_0x6086,_0x104284){return db['WhatsappQueueReport'][_0x4eb7('0x4e')](_0x6086[_0x4eb7('0x4f')],{})['then'](respondWithResult(_0x104284,0xc9))[_0x4eb7('0x49')](handleError(_0x104284,null));};exports[_0x4eb7('0x24')]=function(_0x3c8049,_0x5774d5){if(_0x3c8049[_0x4eb7('0x4f')]['id']){delete _0x3c8049['body']['id'];}return db['WhatsappQueueReport'][_0x4eb7('0x4d')]({'where':{'id':_0x3c8049[_0x4eb7('0x4b')]['id']}})[_0x4eb7('0x25')](handleEntityNotFound(_0x5774d5,null))[_0x4eb7('0x25')](saveUpdates(_0x3c8049[_0x4eb7('0x4f')],null))[_0x4eb7('0x25')](respondWithResult(_0x5774d5,null))[_0x4eb7('0x49')](handleError(_0x5774d5,null));};exports[_0x4eb7('0x26')]=function(_0x2913c5,_0x23c0d5){return db[_0x4eb7('0x44')][_0x4eb7('0x4d')]({'where':{'id':_0x2913c5[_0x4eb7('0x4b')]['id']}})[_0x4eb7('0x25')](handleEntityNotFound(_0x23c0d5,null))[_0x4eb7('0x25')](removeEntity(_0x23c0d5,null))[_0x4eb7('0x49')](handleError(_0x23c0d5,null));};exports[_0x4eb7('0x50')]=function(_0x1580ba,_0x1411c9){return db[_0x4eb7('0x44')]['describe']()[_0x4eb7('0x25')](respondWithResult(_0x1411c9,null))['catch'](handleError(_0x1411c9,null));}; \ No newline at end of file +var _0xb10b=['fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','VIRTUAL','filter','merge','options','WhatsappQueueReport','includeAll','include','rows','show','params','find','catch','create','body','describe','eml-format','zip-dir'];(function(_0x9154ee,_0x5f2a85){var _0x24c414=function(_0x1602da){while(--_0x1602da){_0x9154ee['push'](_0x9154ee['shift']());}};_0x24c414(++_0x5f2a85);}(_0xb10b,0x12a));var _0xbb10=function(_0x361026,_0x2375e2){_0x361026=_0x361026-0x0;var _0x37028e=_0xb10b[_0x361026];return _0x37028e;};'use strict';var emlformat=require(_0xbb10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb10('0x1'));var jsonpatch=require(_0xbb10('0x2'));var rp=require(_0xbb10('0x3'));var moment=require('moment');var BPromise=require(_0xbb10('0x4'));var Mustache=require(_0xbb10('0x5'));var util=require(_0xbb10('0x6'));var path=require(_0xbb10('0x7'));var sox=require(_0xbb10('0x8'));var csv=require(_0xbb10('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb10('0xa'));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('0x9'));var querystring=require(_0xbb10('0xf'));var Papa=require(_0xbb10('0x10'));var Redis=require(_0xbb10('0x11'));var authService=require(_0xbb10('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb10('0x13'));var logger=require(_0xbb10('0x14'))(_0xbb10('0x15'));var utils=require('../../config/utils');var config=require(_0xbb10('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xbb10('0x17'))['db'];function respondWithStatusCode(_0x916a32,_0x285009){_0x285009=_0x285009||0xcc;return function(_0x193a27){if(_0x193a27){return _0x916a32[_0xbb10('0x18')](_0x285009);}return _0x916a32[_0xbb10('0x19')](_0x285009)['end']();};}function respondWithResult(_0x26e021,_0x42d7e4){_0x42d7e4=_0x42d7e4||0xc8;return function(_0x45b9d6){if(_0x45b9d6){return _0x26e021[_0xbb10('0x19')](_0x42d7e4)[_0xbb10('0x1a')](_0x45b9d6);}};}function respondWithFilteredResult(_0x2f2ebf,_0x24a57b){return function(_0x36b5e8){if(_0x36b5e8){var _0x3e26f4=typeof _0x24a57b[_0xbb10('0x1b')]==='undefined'&&typeof _0x24a57b[_0xbb10('0x1c')]===_0xbb10('0x1d');var _0x133ac2=_0x36b5e8[_0xbb10('0x1e')];var _0x378da8=_0x3e26f4?0x0:_0x24a57b[_0xbb10('0x1b')];var _0x575cca=_0x3e26f4?_0x36b5e8[_0xbb10('0x1e')]:_0x24a57b[_0xbb10('0x1b')]+_0x24a57b[_0xbb10('0x1c')];var _0x48b6e9;if(_0x575cca>=_0x133ac2){_0x575cca=_0x133ac2;_0x48b6e9=0xc8;}else{_0x48b6e9=0xce;}_0x2f2ebf[_0xbb10('0x19')](_0x48b6e9);return _0x2f2ebf[_0xbb10('0x1f')](_0xbb10('0x20'),_0x378da8+'-'+_0x575cca+'/'+_0x133ac2)[_0xbb10('0x1a')](_0x36b5e8);}return null;};}function patchUpdates(_0xdf237d){return function(_0x44e563){try{jsonpatch['apply'](_0x44e563,_0xdf237d,!![]);}catch(_0x12f888){return BPromise[_0xbb10('0x21')](_0x12f888);}return _0x44e563['save']();};}function saveUpdates(_0x4c4b0d,_0x8e2b97){return function(_0x311abe){if(_0x311abe){return _0x311abe[_0xbb10('0x22')](_0x4c4b0d)[_0xbb10('0x23')](function(_0x445761){return _0x445761;});}return null;};}function removeEntity(_0x1824b7,_0x407cb4){return function(_0x436104){if(_0x436104){return _0x436104[_0xbb10('0x24')]()[_0xbb10('0x23')](function(){_0x1824b7[_0xbb10('0x19')](0xcc)[_0xbb10('0x25')]();});}};}function handleEntityNotFound(_0x537898,_0x4fedac){return function(_0x4fb5e0){if(!_0x4fb5e0){_0x537898[_0xbb10('0x18')](0x194);}return _0x4fb5e0;};}function handleError(_0x3c5ae7,_0x2c89b9){_0x2c89b9=_0x2c89b9||0x1f4;return function(_0x4e25ff){logger[_0xbb10('0x26')](_0x4e25ff[_0xbb10('0x27')]);if(_0x4e25ff[_0xbb10('0x28')]){delete _0x4e25ff[_0xbb10('0x28')];}_0x3c5ae7[_0xbb10('0x19')](_0x2c89b9)[_0xbb10('0x29')](_0x4e25ff);};}exports[_0xbb10('0x2a')]=function(_0x4aabb9,_0x3796c7){var _0x21ac54={},_0xfc3595={},_0x2e0249={'count':0x0,'rows':[]};var _0x1d30aa=_[_0xbb10('0x2b')](db['WhatsappQueueReport'][_0xbb10('0x2c')],function(_0x4ee02e){return{'name':_0x4ee02e[_0xbb10('0x2d')],'type':_0x4ee02e['type'][_0xbb10('0x2e')]};});_0xfc3595[_0xbb10('0x2f')]=_[_0xbb10('0x2b')](_0x1d30aa,'name');_0xfc3595['query']=_[_0xbb10('0x30')](_0x4aabb9[_0xbb10('0x31')]);_0xfc3595['filters']=_[_0xbb10('0x32')](_0xfc3595[_0xbb10('0x2f')],_0xfc3595[_0xbb10('0x31')]);_0x21ac54[_0xbb10('0x33')]=_[_0xbb10('0x32')](_0xfc3595[_0xbb10('0x2f')],qs[_0xbb10('0x34')](_0x4aabb9['query'][_0xbb10('0x34')]));_0x21ac54[_0xbb10('0x33')]=_0x21ac54[_0xbb10('0x33')][_0xbb10('0x35')]?_0x21ac54[_0xbb10('0x33')]:_0xfc3595[_0xbb10('0x2f')];if(!_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x36')](_0xbb10('0x37'))){_0x21ac54['limit']=qs[_0xbb10('0x1c')](_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x1c')]);_0x21ac54[_0xbb10('0x1b')]=qs['offset'](_0x4aabb9[_0xbb10('0x31')]['offset']);}_0x21ac54['order']=qs[_0xbb10('0x38')](_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x38')]);_0x21ac54[_0xbb10('0x39')]=qs[_0xbb10('0x3a')](_[_0xbb10('0x3b')](_0x4aabb9['query'],_0xfc3595[_0xbb10('0x3a')]),_0x1d30aa);if(_0x4aabb9[_0xbb10('0x31')]['filter']){_0x21ac54['where']=_['merge'](_0x21ac54[_0xbb10('0x39')],{'$or':_[_0xbb10('0x2b')](_0x1d30aa,function(_0x2b658a){if(_0x2b658a['type']!==_0xbb10('0x3c')){var _0x3e8538={};_0x3e8538[_0x2b658a[_0xbb10('0x28')]]={'$like':'%'+_0x4aabb9['query'][_0xbb10('0x3d')]+'%'};return _0x3e8538;}})});}_0x21ac54=_[_0xbb10('0x3e')]({},_0x21ac54,_0x4aabb9[_0xbb10('0x3f')]);var _0x446f49={'where':_0x21ac54['where']};return db[_0xbb10('0x40')][_0xbb10('0x1e')](_0x446f49)['then'](function(_0xe2040f){_0x2e0249[_0xbb10('0x1e')]=_0xe2040f;if(_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x41')]){_0x21ac54[_0xbb10('0x42')]=[{'all':!![]}];}return db[_0xbb10('0x40')]['findAll'](_0x21ac54);})[_0xbb10('0x23')](function(_0x1c7fae){_0x2e0249[_0xbb10('0x43')]=_0x1c7fae;return _0x2e0249;})[_0xbb10('0x23')](respondWithFilteredResult(_0x3796c7,_0x21ac54))['catch'](handleError(_0x3796c7,null));};exports[_0xbb10('0x44')]=function(_0x331751,_0x23dc18){var _0x403beb={'raw':!![],'where':{'id':_0x331751[_0xbb10('0x45')]['id']}},_0x5e2cfa={};_0x5e2cfa[_0xbb10('0x2f')]=_['keys'](db['WhatsappQueueReport'][_0xbb10('0x2c')]);_0x5e2cfa['query']=_[_0xbb10('0x30')](_0x331751[_0xbb10('0x31')]);_0x5e2cfa['filters']=_[_0xbb10('0x32')](_0x5e2cfa[_0xbb10('0x2f')],_0x5e2cfa[_0xbb10('0x31')]);_0x403beb['attributes']=_[_0xbb10('0x32')](_0x5e2cfa[_0xbb10('0x2f')],qs[_0xbb10('0x34')](_0x331751[_0xbb10('0x31')][_0xbb10('0x34')]));_0x403beb[_0xbb10('0x33')]=_0x403beb[_0xbb10('0x33')][_0xbb10('0x35')]?_0x403beb[_0xbb10('0x33')]:_0x5e2cfa[_0xbb10('0x2f')];if(_0x331751[_0xbb10('0x31')][_0xbb10('0x41')]){_0x403beb['include']=[{'all':!![]}];}_0x403beb=_[_0xbb10('0x3e')]({},_0x403beb,_0x331751[_0xbb10('0x3f')]);return db['WhatsappQueueReport'][_0xbb10('0x46')](_0x403beb)[_0xbb10('0x23')](handleEntityNotFound(_0x23dc18,null))[_0xbb10('0x23')](respondWithResult(_0x23dc18,null))[_0xbb10('0x47')](handleError(_0x23dc18,null));};exports[_0xbb10('0x48')]=function(_0x39f0de,_0x3e06b0){return db['WhatsappQueueReport']['create'](_0x39f0de[_0xbb10('0x49')],{})[_0xbb10('0x23')](respondWithResult(_0x3e06b0,0xc9))[_0xbb10('0x47')](handleError(_0x3e06b0,null));};exports['update']=function(_0x5f0c12,_0x3cd6f3){if(_0x5f0c12[_0xbb10('0x49')]['id']){delete _0x5f0c12[_0xbb10('0x49')]['id'];}return db[_0xbb10('0x40')][_0xbb10('0x46')]({'where':{'id':_0x5f0c12[_0xbb10('0x45')]['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x3cd6f3,null))[_0xbb10('0x23')](saveUpdates(_0x5f0c12[_0xbb10('0x49')],null))[_0xbb10('0x23')](respondWithResult(_0x3cd6f3,null))['catch'](handleError(_0x3cd6f3,null));};exports['destroy']=function(_0x412e13,_0x467dba){return db[_0xbb10('0x40')][_0xbb10('0x46')]({'where':{'id':_0x412e13[_0xbb10('0x45')]['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x467dba,null))[_0xbb10('0x23')](removeEntity(_0x467dba,null))[_0xbb10('0x47')](handleError(_0x467dba,null));};exports[_0xbb10('0x4a')]=function(_0x1214f7,_0x19ca3e){return db[_0xbb10('0x40')][_0xbb10('0x4a')]()[_0xbb10('0x23')](respondWithResult(_0x19ca3e,null))[_0xbb10('0x47')](handleError(_0x19ca3e,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 6a4824b..7e8048a 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 _0x813d=['WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','define'];(function(_0x15a10f,_0x33a73d){var _0x382e5d=function(_0x4310ea){while(--_0x4310ea){_0x15a10f['push'](_0x15a10f['shift']());}};_0x382e5d(++_0x33a73d);}(_0x813d,0x1dc));var _0xd813=function(_0x1ed2b8,_0x5b4e1b){_0x1ed2b8=_0x1ed2b8-0x0;var _0x3ddaa8=_0x813d[_0x1ed2b8];return _0x3ddaa8;};'use strict';var _=require(_0xd813('0x0'));var util=require('util');var logger=require(_0xd813('0x1'))('api');var moment=require('moment');var BPromise=require(_0xd813('0x2'));var rp=require(_0xd813('0x3'));var fs=require('fs');var path=require(_0xd813('0x4'));var rimraf=require(_0xd813('0x5'));var config=require(_0xd813('0x6'));var attributes=require('./whatsappQueueReport.attributes');module['exports']=function(_0x53b963,_0xbd7d1f){return _0x53b963[_0xd813('0x7')](_0xd813('0x8'),attributes,{'tableName':_0xd813('0x9'),'paranoid':![],'indexes':[{'name':_0xd813('0xa'),'fields':[_0xd813('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x180e=['util','../../config/logger','api','request-promise','../../config/environment','./whatsappQueueReport.attributes','exports','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash'];(function(_0x2daf50,_0xb8637a){var _0x2aea69=function(_0x255ac5){while(--_0x255ac5){_0x2daf50['push'](_0x2daf50['shift']());}};_0x2aea69(++_0xb8637a);}(_0x180e,0x6d));var _0xe180=function(_0x3d14d1,_0x23aa69){_0x3d14d1=_0x3d14d1-0x0;var _0xc78d1f=_0x180e[_0x3d14d1];return _0xc78d1f;};'use strict';var _=require(_0xe180('0x0'));var util=require(_0xe180('0x1'));var logger=require(_0xe180('0x2'))(_0xe180('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe180('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe180('0x5'));var attributes=require(_0xe180('0x6'));module[_0xe180('0x7')]=function(_0x3799c6,_0x5d15a9){return _0x3799c6['define'](_0xe180('0x8'),attributes,{'tableName':_0xe180('0x9'),'paranoid':![],'indexes':[{'name':_0xe180('0xa'),'fields':[_0xe180('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 3a87694..8aaafb5 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 _0x3a03=['CreateWhatsappQueueReport','WhatsappQueueReport','body','options','raw','stringify','UpdateWhatsappQueueReport','update','where','limit','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','error','code','WhatsappQueueReport,\x20%s,\x20%s','message','info','result','catch'];(function(_0x126fb9,_0x122c59){var _0xc8a3b1=function(_0x355744){while(--_0x355744){_0x126fb9['push'](_0x126fb9['shift']());}};_0xc8a3b1(++_0x122c59);}(_0x3a03,0xa5));var _0x33a0=function(_0x3829b6,_0x282605){_0x3829b6=_0x3829b6-0x0;var _0x16cb8e=_0x3a03[_0x3829b6];return _0x16cb8e;};'use strict';var _=require(_0x33a0('0x0'));var util=require('util');var moment=require(_0x33a0('0x1'));var BPromise=require('bluebird');var rs=require(_0x33a0('0x2'));var fs=require('fs');var Redis=require(_0x33a0('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x33a0('0x4'));var logger=require(_0x33a0('0x5'))(_0x33a0('0x6'));var config=require(_0x33a0('0x7'));var jayson=require(_0x33a0('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2ee2a3,_0x24902b,_0x3496f1){return new BPromise(function(_0x3f1982,_0x270fac){return client[_0x33a0('0x9')](_0x2ee2a3,_0x3496f1)[_0x33a0('0xa')](function(_0x308cb8){logger['info']('WhatsappQueueReport,\x20%s,\x20%s',_0x24902b,_0x33a0('0xb'));logger[_0x33a0('0xc')](_0x33a0('0xd'),_0x24902b,_0x33a0('0xb'),JSON['stringify'](_0x308cb8));if(_0x308cb8[_0x33a0('0xe')]){if(_0x308cb8[_0x33a0('0xe')][_0x33a0('0xf')]===0x1f4){logger[_0x33a0('0xe')](_0x33a0('0x10'),_0x24902b,_0x308cb8['error']['message']);return _0x270fac(_0x308cb8[_0x33a0('0xe')][_0x33a0('0x11')]);}logger[_0x33a0('0xe')](_0x33a0('0x10'),_0x24902b,_0x308cb8[_0x33a0('0xe')]['message']);return _0x3f1982(_0x308cb8[_0x33a0('0xe')]['message']);}else{logger[_0x33a0('0x12')]('WhatsappQueueReport,\x20%s,\x20%s',_0x24902b,'request\x20sent');_0x3f1982(_0x308cb8[_0x33a0('0x13')][_0x33a0('0x11')]);}})[_0x33a0('0x14')](function(_0x49fb5b){logger[_0x33a0('0xe')]('WhatsappQueueReport,\x20%s,\x20%s',_0x24902b,_0x49fb5b);_0x270fac(_0x49fb5b);});});}exports[_0x33a0('0x15')]=function(_0x5d9e1d){var _0x1f1add=this;return new Promise(function(_0x561a18,_0x45c591){return db[_0x33a0('0x16')]['create'](_0x5d9e1d[_0x33a0('0x17')],{'raw':_0x5d9e1d[_0x33a0('0x18')]?_0x5d9e1d['options'][_0x33a0('0x19')]===undefined?!![]:![]:!![]})[_0x33a0('0xa')](function(_0x5e25f4){logger[_0x33a0('0x12')](_0x33a0('0x15'),_0x5d9e1d);logger[_0x33a0('0xc')](_0x33a0('0x15'),_0x5d9e1d,JSON[_0x33a0('0x1a')](_0x5e25f4));_0x561a18(_0x5e25f4);})[_0x33a0('0x14')](function(_0x36792e){logger[_0x33a0('0xe')](_0x33a0('0x15'),_0x36792e[_0x33a0('0x11')],_0x5d9e1d);_0x45c591(_0x1f1add[_0x33a0('0xe')](0x1f4,_0x36792e[_0x33a0('0x11')]));});});};exports[_0x33a0('0x1b')]=function(_0x43305c){var _0x584666=this;return new Promise(function(_0x5b4629,_0x55141d){return db[_0x33a0('0x16')][_0x33a0('0x1c')](_0x43305c[_0x33a0('0x17')],{'raw':_0x43305c[_0x33a0('0x18')]?_0x43305c[_0x33a0('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x43305c['options']?_0x43305c[_0x33a0('0x18')][_0x33a0('0x1d')]||null:null,'attributes':_0x43305c['options']?_0x43305c[_0x33a0('0x18')]['attributes']||null:null,'limit':_0x43305c['options']?_0x43305c[_0x33a0('0x18')][_0x33a0('0x1e')]||null:null})['then'](function(_0x4aea8a){logger['info']('UpdateWhatsappQueueReport',_0x43305c);logger[_0x33a0('0xc')](_0x33a0('0x1b'),_0x43305c,JSON[_0x33a0('0x1a')](_0x4aea8a));_0x5b4629(_0x4aea8a);})[_0x33a0('0x14')](function(_0x4fcc6b){logger[_0x33a0('0xe')](_0x33a0('0x1b'),_0x4fcc6b[_0x33a0('0x11')],_0x43305c);_0x55141d(_0x584666['error'](0x1f4,_0x4fcc6b['message']));});});}; \ No newline at end of file +var _0x4a92=['update','raw','attributes','UpdateWhatsappQueueReport','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options'];(function(_0x68ee8b,_0x3cc6c5){var _0x5148f7=function(_0x5dcbd5){while(--_0x5dcbd5){_0x68ee8b['push'](_0x68ee8b['shift']());}};_0x5148f7(++_0x3cc6c5);}(_0x4a92,0xd0));var _0x24a9=function(_0x1bb47b,_0x54e02e){_0x1bb47b=_0x1bb47b-0x0;var _0x566418=_0x4a92[_0x1bb47b];return _0x566418;};'use strict';var _=require(_0x24a9('0x0'));var util=require(_0x24a9('0x1'));var moment=require(_0x24a9('0x2'));var BPromise=require(_0x24a9('0x3'));var rs=require(_0x24a9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x24a9('0x5'))['db'];var utils=require(_0x24a9('0x6'));var logger=require(_0x24a9('0x7'))('rpc');var config=require(_0x24a9('0x8'));var jayson=require(_0x24a9('0x9'));var client=jayson[_0x24a9('0xa')][_0x24a9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1b1b29,_0x194914,_0x28efe6){return new BPromise(function(_0x32c2b2,_0x44429f){return client[_0x24a9('0xc')](_0x1b1b29,_0x28efe6)[_0x24a9('0xd')](function(_0x25b09a){logger[_0x24a9('0xe')](_0x24a9('0xf'),_0x194914,_0x24a9('0x10'));logger[_0x24a9('0x11')](_0x24a9('0x12'),_0x194914,_0x24a9('0x10'),JSON[_0x24a9('0x13')](_0x25b09a));if(_0x25b09a['error']){if(_0x25b09a[_0x24a9('0x14')][_0x24a9('0x15')]===0x1f4){logger[_0x24a9('0x14')](_0x24a9('0xf'),_0x194914,_0x25b09a[_0x24a9('0x14')][_0x24a9('0x16')]);return _0x44429f(_0x25b09a[_0x24a9('0x14')][_0x24a9('0x16')]);}logger[_0x24a9('0x14')](_0x24a9('0xf'),_0x194914,_0x25b09a[_0x24a9('0x14')]['message']);return _0x32c2b2(_0x25b09a[_0x24a9('0x14')][_0x24a9('0x16')]);}else{logger['info']('WhatsappQueueReport,\x20%s,\x20%s',_0x194914,'request\x20sent');_0x32c2b2(_0x25b09a[_0x24a9('0x17')][_0x24a9('0x16')]);}})[_0x24a9('0x18')](function(_0x44f9cc){logger[_0x24a9('0x14')]('WhatsappQueueReport,\x20%s,\x20%s',_0x194914,_0x44f9cc);_0x44429f(_0x44f9cc);});});}exports[_0x24a9('0x19')]=function(_0x225b2a){var _0x4342d4=this;return new Promise(function(_0x3655dd,_0x1e747f){return db[_0x24a9('0x1a')][_0x24a9('0x1b')](_0x225b2a[_0x24a9('0x1c')],{'raw':_0x225b2a[_0x24a9('0x1d')]?_0x225b2a[_0x24a9('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x24a9('0xd')](function(_0x459f98){logger[_0x24a9('0xe')](_0x24a9('0x19'),_0x225b2a);logger[_0x24a9('0x11')](_0x24a9('0x19'),_0x225b2a,JSON[_0x24a9('0x13')](_0x459f98));_0x3655dd(_0x459f98);})['catch'](function(_0x201386){logger[_0x24a9('0x14')](_0x24a9('0x19'),_0x201386['message'],_0x225b2a);_0x1e747f(_0x4342d4['error'](0x1f4,_0x201386[_0x24a9('0x16')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x51a834){var _0x2d47bc=this;return new Promise(function(_0x6bf33c,_0x46c53c){return db[_0x24a9('0x1a')][_0x24a9('0x1e')](_0x51a834[_0x24a9('0x1c')],{'raw':_0x51a834[_0x24a9('0x1d')]?_0x51a834[_0x24a9('0x1d')][_0x24a9('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x51a834[_0x24a9('0x1d')]?_0x51a834[_0x24a9('0x1d')]['where']||null:null,'attributes':_0x51a834[_0x24a9('0x1d')]?_0x51a834['options'][_0x24a9('0x20')]||null:null,'limit':_0x51a834[_0x24a9('0x1d')]?_0x51a834[_0x24a9('0x1d')]['limit']||null:null})[_0x24a9('0xd')](function(_0x2128ef){logger[_0x24a9('0xe')](_0x24a9('0x21'),_0x51a834);logger['debug'](_0x24a9('0x21'),_0x51a834,JSON[_0x24a9('0x13')](_0x2128ef));_0x6bf33c(_0x2128ef);})[_0x24a9('0x18')](function(_0x3c94ce){logger[_0x24a9('0x14')]('UpdateWhatsappQueueReport',_0x3c94ce[_0x24a9('0x16')],_0x51a834);_0x46c53c(_0x2d47bc[_0x24a9('0x14')](0x1f4,_0x3c94ce['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index b917f8e..afe2c9f 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 _0x3a13=['isAuthenticated','/describe','describe','/:id','show','post','create','put','update','delete','destroy','multer','util','path','fs-extra','../../components/auth/service','../../config/environment','get'];(function(_0x12f32e,_0x4443a2){var _0x31d106=function(_0x26bed6){while(--_0x26bed6){_0x12f32e['push'](_0x12f32e['shift']());}};_0x31d106(++_0x4443a2);}(_0x3a13,0x1bb));var _0x33a1=function(_0x56fe98,_0x43dc16){_0x56fe98=_0x56fe98-0x0;var _0x212f4f=_0x3a13[_0x56fe98];return _0x212f4f;};'use strict';var multer=require(_0x33a1('0x0'));var util=require(_0x33a1('0x1'));var path=require(_0x33a1('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x33a1('0x3'));var auth=require(_0x33a1('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x33a1('0x5'));var controller=require('./whatsappTransferReport.controller');router[_0x33a1('0x6')]('/',auth[_0x33a1('0x7')](),controller['index']);router[_0x33a1('0x6')](_0x33a1('0x8'),auth['isAuthenticated'](),controller[_0x33a1('0x9')]);router[_0x33a1('0x6')](_0x33a1('0xa'),auth['isAuthenticated'](),controller[_0x33a1('0xb')]);router[_0x33a1('0xc')]('/',auth[_0x33a1('0x7')](),controller[_0x33a1('0xd')]);router[_0x33a1('0xe')](_0x33a1('0xa'),auth[_0x33a1('0x7')](),controller[_0x33a1('0xf')]);router[_0x33a1('0x10')](_0x33a1('0xa'),auth[_0x33a1('0x7')](),controller[_0x33a1('0x11')]);module['exports']=router; \ No newline at end of file +var _0xa9a4=['./whatsappTransferReport.controller','get','index','/describe','describe','/:id','post','create','isAuthenticated','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xe2ef79,_0x28c5ed){var _0x244b5f=function(_0x3ded2c){while(--_0x3ded2c){_0xe2ef79['push'](_0xe2ef79['shift']());}};_0x244b5f(++_0x28c5ed);}(_0xa9a4,0xfe));var _0x4a9a=function(_0xfb126c,_0x5b2edd){_0xfb126c=_0xfb126c-0x0;var _0x35b00d=_0xa9a4[_0xfb126c];return _0x35b00d;};'use strict';var multer=require(_0x4a9a('0x0'));var util=require(_0x4a9a('0x1'));var path=require(_0x4a9a('0x2'));var timeout=require(_0x4a9a('0x3'));var express=require(_0x4a9a('0x4'));var router=express[_0x4a9a('0x5')]();var fs_extra=require(_0x4a9a('0x6'));var auth=require(_0x4a9a('0x7'));var interaction=require(_0x4a9a('0x8'));var config=require(_0x4a9a('0x9'));var controller=require(_0x4a9a('0xa'));router[_0x4a9a('0xb')]('/',auth['isAuthenticated'](),controller[_0x4a9a('0xc')]);router[_0x4a9a('0xb')](_0x4a9a('0xd'),auth['isAuthenticated'](),controller[_0x4a9a('0xe')]);router[_0x4a9a('0xb')](_0x4a9a('0xf'),auth['isAuthenticated'](),controller['show']);router[_0x4a9a('0x10')]('/',auth['isAuthenticated'](),controller[_0x4a9a('0x11')]);router['put'](_0x4a9a('0xf'),auth[_0x4a9a('0x12')](),controller['update']);router[_0x4a9a('0x13')](_0x4a9a('0xf'),auth[_0x4a9a('0x12')](),controller[_0x4a9a('0x14')]);module[_0x4a9a('0x15')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 4e6869d..c948caa 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 _0xdac7=['exports','agent','queue','DATE','sequelize'];(function(_0x2faddb,_0xc18b78){var _0x273c05=function(_0x1a3785){while(--_0x1a3785){_0x2faddb['push'](_0x2faddb['shift']());}};_0x273c05(++_0xc18b78);}(_0xdac7,0x180));var _0x7dac=function(_0x2d3659,_0x2c93f8){_0x2d3659=_0x2d3659-0x0;var _0x276ad1=_0xdac7[_0x2d3659];return _0x276ad1;};'use strict';var Sequelize=require(_0x7dac('0x0'));module[_0x7dac('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM']('account',_0x7dac('0x2'),_0x7dac('0x3')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x7dac('0x4')]}}; \ No newline at end of file +var _0xb921=['account','DATE','sequelize','exports','STRING','ENUM'];(function(_0x22b405,_0x218099){var _0x18fa6e=function(_0x105cc4){while(--_0x105cc4){_0x22b405['push'](_0x22b405['shift']());}};_0x18fa6e(++_0x218099);}(_0xb921,0x16a));var _0x1b92=function(_0x5a1d97,_0x265b5a){_0x5a1d97=_0x5a1d97-0x0;var _0x401646=_0xb921[_0x5a1d97];return _0x401646;};'use strict';var Sequelize=require(_0x1b92('0x0'));module[_0x1b92('0x1')]={'uniqueid':{'type':Sequelize[_0x1b92('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x1b92('0x3')](_0x1b92('0x4'),'agent','queue'),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x1b92('0x5')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 8ca557c..b46be57 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 _0x4eaf=['end','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','stack','name','send','index','map','rawAttributes','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','merge','VIRTUAL','filter','options','where','WhatsappTransferReport','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','path','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x188926,_0x1b2429){var _0x17f4bf=function(_0x462e22){while(--_0x462e22){_0x188926['push'](_0x188926['shift']());}};_0x17f4bf(++_0x1b2429);}(_0x4eaf,0x199));var _0xf4ea=function(_0x30e473,_0x432924){_0x30e473=_0x30e473-0x0;var _0x3be8d1=_0x4eaf[_0x30e473];return _0x3be8d1;};'use strict';var emlformat=require(_0xf4ea('0x0'));var rimraf=require(_0xf4ea('0x1'));var zipdir=require(_0xf4ea('0x2'));var jsonpatch=require(_0xf4ea('0x3'));var rp=require('request-promise');var moment=require(_0xf4ea('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xf4ea('0x5'));var sox=require(_0xf4ea('0x6'));var csv=require('to-csv');var ejs=require(_0xf4ea('0x7'));var fs=require('fs');var fs_extra=require(_0xf4ea('0x8'));var _=require(_0xf4ea('0x9'));var squel=require(_0xf4ea('0xa'));var crypto=require('crypto');var jsforce=require(_0xf4ea('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xf4ea('0xc'));var querystring=require(_0xf4ea('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf4ea('0xe'));var as=require(_0xf4ea('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf4ea('0x10'));var utils=require(_0xf4ea('0x11'));var config=require(_0xf4ea('0x12'));var licenseUtil=require(_0xf4ea('0x13'));var db=require(_0xf4ea('0x14'))['db'];function respondWithStatusCode(_0x13ec2b,_0x4507c3){_0x4507c3=_0x4507c3||0xcc;return function(_0xfed75a){if(_0xfed75a){return _0x13ec2b[_0xf4ea('0x15')](_0x4507c3);}return _0x13ec2b[_0xf4ea('0x16')](_0x4507c3)[_0xf4ea('0x17')]();};}function respondWithResult(_0x4ac875,_0xb5b8b4){_0xb5b8b4=_0xb5b8b4||0xc8;return function(_0x4b9588){if(_0x4b9588){return _0x4ac875[_0xf4ea('0x16')](_0xb5b8b4)['json'](_0x4b9588);}};}function respondWithFilteredResult(_0x1a4037,_0x3108ee){return function(_0x6f7f5a){if(_0x6f7f5a){var _0x1b546e=typeof _0x3108ee[_0xf4ea('0x18')]===_0xf4ea('0x19')&&typeof _0x3108ee[_0xf4ea('0x1a')]==='undefined';var _0xb71e5=_0x6f7f5a['count'];var _0x31db18=_0x1b546e?0x0:_0x3108ee[_0xf4ea('0x18')];var _0x2b71fa=_0x1b546e?_0x6f7f5a[_0xf4ea('0x1b')]:_0x3108ee['offset']+_0x3108ee[_0xf4ea('0x1a')];var _0x593aad;if(_0x2b71fa>=_0xb71e5){_0x2b71fa=_0xb71e5;_0x593aad=0xc8;}else{_0x593aad=0xce;}_0x1a4037[_0xf4ea('0x16')](_0x593aad);return _0x1a4037['set'](_0xf4ea('0x1c'),_0x31db18+'-'+_0x2b71fa+'/'+_0xb71e5)['json'](_0x6f7f5a);}return null;};}function patchUpdates(_0x547b36){return function(_0x225a47){try{jsonpatch['apply'](_0x225a47,_0x547b36,!![]);}catch(_0xa1081b){return BPromise[_0xf4ea('0x1d')](_0xa1081b);}return _0x225a47[_0xf4ea('0x1e')]();};}function saveUpdates(_0x3ceab8,_0x447edf){return function(_0x3295ce){if(_0x3295ce){return _0x3295ce[_0xf4ea('0x1f')](_0x3ceab8)[_0xf4ea('0x20')](function(_0x5a44fb){return _0x5a44fb;});}return null;};}function removeEntity(_0x48ffde,_0x162b6d){return function(_0x16b5b8){if(_0x16b5b8){return _0x16b5b8[_0xf4ea('0x21')]()[_0xf4ea('0x20')](function(){_0x48ffde[_0xf4ea('0x16')](0xcc)[_0xf4ea('0x17')]();});}};}function handleEntityNotFound(_0x245480,_0x462538){return function(_0x5c5826){if(!_0x5c5826){_0x245480[_0xf4ea('0x15')](0x194);}return _0x5c5826;};}function handleError(_0x9c7b62,_0x3347bf){_0x3347bf=_0x3347bf||0x1f4;return function(_0xb154ea){logger['error'](_0xb154ea[_0xf4ea('0x22')]);if(_0xb154ea[_0xf4ea('0x23')]){delete _0xb154ea[_0xf4ea('0x23')];}_0x9c7b62['status'](_0x3347bf)[_0xf4ea('0x24')](_0xb154ea);};}exports[_0xf4ea('0x25')]=function(_0x2f7c8e,_0x555e28){var _0xdad98f={},_0x215d31={},_0x42a471={'count':0x0,'rows':[]};var _0x569d6a=_[_0xf4ea('0x26')](db['WhatsappTransferReport'][_0xf4ea('0x27')],function(_0x28a288){return{'name':_0x28a288['fieldName'],'type':_0x28a288[_0xf4ea('0x28')][_0xf4ea('0x29')]};});_0x215d31[_0xf4ea('0x2a')]=_[_0xf4ea('0x26')](_0x569d6a,_0xf4ea('0x23'));_0x215d31[_0xf4ea('0x2b')]=_['keys'](_0x2f7c8e[_0xf4ea('0x2b')]);_0x215d31['filters']=_[_0xf4ea('0x2c')](_0x215d31[_0xf4ea('0x2a')],_0x215d31[_0xf4ea('0x2b')]);_0xdad98f['attributes']=_['intersection'](_0x215d31[_0xf4ea('0x2a')],qs[_0xf4ea('0x2d')](_0x2f7c8e[_0xf4ea('0x2b')][_0xf4ea('0x2d')]));_0xdad98f[_0xf4ea('0x2e')]=_0xdad98f[_0xf4ea('0x2e')][_0xf4ea('0x2f')]?_0xdad98f[_0xf4ea('0x2e')]:_0x215d31[_0xf4ea('0x2a')];if(!_0x2f7c8e[_0xf4ea('0x2b')][_0xf4ea('0x30')](_0xf4ea('0x31'))){_0xdad98f[_0xf4ea('0x1a')]=qs['limit'](_0x2f7c8e[_0xf4ea('0x2b')][_0xf4ea('0x1a')]);_0xdad98f[_0xf4ea('0x18')]=qs[_0xf4ea('0x18')](_0x2f7c8e[_0xf4ea('0x2b')]['offset']);}_0xdad98f[_0xf4ea('0x32')]=qs[_0xf4ea('0x33')](_0x2f7c8e[_0xf4ea('0x2b')]['sort']);_0xdad98f['where']=qs[_0xf4ea('0x34')](_[_0xf4ea('0x35')](_0x2f7c8e[_0xf4ea('0x2b')],_0x215d31['filters']),_0x569d6a);if(_0x2f7c8e[_0xf4ea('0x2b')]['filter']){_0xdad98f['where']=_[_0xf4ea('0x36')](_0xdad98f['where'],{'$or':_[_0xf4ea('0x26')](_0x569d6a,function(_0x3bab0b){if(_0x3bab0b[_0xf4ea('0x28')]!==_0xf4ea('0x37')){var _0x3f075b={};_0x3f075b[_0x3bab0b[_0xf4ea('0x23')]]={'$like':'%'+_0x2f7c8e[_0xf4ea('0x2b')][_0xf4ea('0x38')]+'%'};return _0x3f075b;}})});}_0xdad98f=_['merge']({},_0xdad98f,_0x2f7c8e[_0xf4ea('0x39')]);var _0x5f2015={'where':_0xdad98f[_0xf4ea('0x3a')]};return db[_0xf4ea('0x3b')][_0xf4ea('0x1b')](_0x5f2015)[_0xf4ea('0x20')](function(_0x177676){_0x42a471[_0xf4ea('0x1b')]=_0x177676;if(_0x2f7c8e[_0xf4ea('0x2b')]['includeAll']){_0xdad98f[_0xf4ea('0x3c')]=[{'all':!![]}];}return db[_0xf4ea('0x3b')][_0xf4ea('0x3d')](_0xdad98f);})[_0xf4ea('0x20')](function(_0x1f356e){_0x42a471[_0xf4ea('0x3e')]=_0x1f356e;return _0x42a471;})[_0xf4ea('0x20')](respondWithFilteredResult(_0x555e28,_0xdad98f))[_0xf4ea('0x3f')](handleError(_0x555e28,null));};exports[_0xf4ea('0x40')]=function(_0x139c27,_0x51c753){var _0xbeb537={'raw':!![],'where':{'id':_0x139c27[_0xf4ea('0x41')]['id']}},_0x151d18={};_0x151d18['model']=_[_0xf4ea('0x42')](db[_0xf4ea('0x3b')][_0xf4ea('0x27')]);_0x151d18[_0xf4ea('0x2b')]=_[_0xf4ea('0x42')](_0x139c27[_0xf4ea('0x2b')]);_0x151d18[_0xf4ea('0x34')]=_[_0xf4ea('0x2c')](_0x151d18[_0xf4ea('0x2a')],_0x151d18[_0xf4ea('0x2b')]);_0xbeb537[_0xf4ea('0x2e')]=_[_0xf4ea('0x2c')](_0x151d18[_0xf4ea('0x2a')],qs[_0xf4ea('0x2d')](_0x139c27[_0xf4ea('0x2b')][_0xf4ea('0x2d')]));_0xbeb537['attributes']=_0xbeb537[_0xf4ea('0x2e')][_0xf4ea('0x2f')]?_0xbeb537[_0xf4ea('0x2e')]:_0x151d18[_0xf4ea('0x2a')];if(_0x139c27[_0xf4ea('0x2b')][_0xf4ea('0x43')]){_0xbeb537[_0xf4ea('0x3c')]=[{'all':!![]}];}_0xbeb537=_[_0xf4ea('0x36')]({},_0xbeb537,_0x139c27[_0xf4ea('0x39')]);return db[_0xf4ea('0x3b')][_0xf4ea('0x44')](_0xbeb537)[_0xf4ea('0x20')](handleEntityNotFound(_0x51c753,null))[_0xf4ea('0x20')](respondWithResult(_0x51c753,null))[_0xf4ea('0x3f')](handleError(_0x51c753,null));};exports[_0xf4ea('0x45')]=function(_0x3a3eea,_0xf87b3d){return db['WhatsappTransferReport'][_0xf4ea('0x45')](_0x3a3eea[_0xf4ea('0x46')],{})[_0xf4ea('0x20')](respondWithResult(_0xf87b3d,0xc9))[_0xf4ea('0x3f')](handleError(_0xf87b3d,null));};exports[_0xf4ea('0x1f')]=function(_0xdd7cbc,_0x3d94a7){if(_0xdd7cbc[_0xf4ea('0x46')]['id']){delete _0xdd7cbc[_0xf4ea('0x46')]['id'];}return db[_0xf4ea('0x3b')]['find']({'where':{'id':_0xdd7cbc[_0xf4ea('0x41')]['id']}})['then'](handleEntityNotFound(_0x3d94a7,null))[_0xf4ea('0x20')](saveUpdates(_0xdd7cbc[_0xf4ea('0x46')],null))[_0xf4ea('0x20')](respondWithResult(_0x3d94a7,null))[_0xf4ea('0x3f')](handleError(_0x3d94a7,null));};exports[_0xf4ea('0x21')]=function(_0xdb438e,_0x344c3f){return db[_0xf4ea('0x3b')][_0xf4ea('0x44')]({'where':{'id':_0xdb438e['params']['id']}})['then'](handleEntityNotFound(_0x344c3f,null))[_0xf4ea('0x20')](removeEntity(_0x344c3f,null))[_0xf4ea('0x3f')](handleError(_0x344c3f,null));};exports['describe']=function(_0x2a6f75,_0x3245f8){return db[_0xf4ea('0x3b')][_0xf4ea('0x47')]()[_0xf4ea('0x20')](respondWithResult(_0x3245f8,null))['catch'](handleError(_0x3245f8,null));}; \ No newline at end of file +var _0xb7a1=['update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','end','status','json','undefined','limit','count','set','Content-Range','reject','save','then','destroy','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filters','merge','filter','options','includeAll','include','WhatsappTransferReport','findAll','show','params','keys','find','create','catch'];(function(_0x4e50c7,_0x533ccd){var _0x4dd79f=function(_0x2bb22a){while(--_0x2bb22a){_0x4e50c7['push'](_0x4e50c7['shift']());}};_0x4dd79f(++_0x533ccd);}(_0xb7a1,0xe6));var _0x1b7a=function(_0x4b7faf,_0x283d0c){_0x4b7faf=_0x4b7faf-0x0;var _0x6d78e3=_0xb7a1[_0x4b7faf];return _0x6d78e3;};'use strict';var emlformat=require(_0x1b7a('0x0'));var rimraf=require(_0x1b7a('0x1'));var zipdir=require(_0x1b7a('0x2'));var jsonpatch=require(_0x1b7a('0x3'));var rp=require(_0x1b7a('0x4'));var moment=require(_0x1b7a('0x5'));var BPromise=require(_0x1b7a('0x6'));var Mustache=require(_0x1b7a('0x7'));var util=require(_0x1b7a('0x8'));var path=require(_0x1b7a('0x9'));var sox=require(_0x1b7a('0xa'));var csv=require(_0x1b7a('0xb'));var ejs=require(_0x1b7a('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');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('0xb'));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 licenseUtil=require(_0x1b7a('0x17'));var db=require(_0x1b7a('0x18'))['db'];function respondWithStatusCode(_0x4a6a10,_0x883f4c){_0x883f4c=_0x883f4c||0xcc;return function(_0xdd536b){if(_0xdd536b){return _0x4a6a10['sendStatus'](_0x883f4c);}return _0x4a6a10['status'](_0x883f4c)[_0x1b7a('0x19')]();};}function respondWithResult(_0x4908dc,_0x382d0d){_0x382d0d=_0x382d0d||0xc8;return function(_0x171bdb){if(_0x171bdb){return _0x4908dc[_0x1b7a('0x1a')](_0x382d0d)[_0x1b7a('0x1b')](_0x171bdb);}};}function respondWithFilteredResult(_0x291b9e,_0x2180f2){return function(_0x59afab){if(_0x59afab){var _0x1f2f86=typeof _0x2180f2['offset']===_0x1b7a('0x1c')&&typeof _0x2180f2[_0x1b7a('0x1d')]===_0x1b7a('0x1c');var _0x4b0a93=_0x59afab[_0x1b7a('0x1e')];var _0x2a86ab=_0x1f2f86?0x0:_0x2180f2['offset'];var _0x11305e=_0x1f2f86?_0x59afab[_0x1b7a('0x1e')]:_0x2180f2['offset']+_0x2180f2[_0x1b7a('0x1d')];var _0x4308e3;if(_0x11305e>=_0x4b0a93){_0x11305e=_0x4b0a93;_0x4308e3=0xc8;}else{_0x4308e3=0xce;}_0x291b9e[_0x1b7a('0x1a')](_0x4308e3);return _0x291b9e[_0x1b7a('0x1f')](_0x1b7a('0x20'),_0x2a86ab+'-'+_0x11305e+'/'+_0x4b0a93)['json'](_0x59afab);}return null;};}function patchUpdates(_0x179624){return function(_0x452a72){try{jsonpatch['apply'](_0x452a72,_0x179624,!![]);}catch(_0x41f616){return BPromise[_0x1b7a('0x21')](_0x41f616);}return _0x452a72[_0x1b7a('0x22')]();};}function saveUpdates(_0x46711b,_0x28004c){return function(_0x6dd4da){if(_0x6dd4da){return _0x6dd4da['update'](_0x46711b)[_0x1b7a('0x23')](function(_0x15cdae){return _0x15cdae;});}return null;};}function removeEntity(_0x41ced9,_0x51dd39){return function(_0x26be41){if(_0x26be41){return _0x26be41[_0x1b7a('0x24')]()[_0x1b7a('0x23')](function(){_0x41ced9[_0x1b7a('0x1a')](0xcc)[_0x1b7a('0x19')]();});}};}function handleEntityNotFound(_0x132d03,_0x232385){return function(_0x1a5f5c){if(!_0x1a5f5c){_0x132d03[_0x1b7a('0x25')](0x194);}return _0x1a5f5c;};}function handleError(_0x3ecb73,_0x59f7b0){_0x59f7b0=_0x59f7b0||0x1f4;return function(_0x116958){logger[_0x1b7a('0x26')](_0x116958['stack']);if(_0x116958['name']){delete _0x116958[_0x1b7a('0x27')];}_0x3ecb73[_0x1b7a('0x1a')](_0x59f7b0)[_0x1b7a('0x28')](_0x116958);};}exports[_0x1b7a('0x29')]=function(_0x46450d,_0x40823e){var _0x5d6362={},_0x5ea491={},_0x183f5d={'count':0x0,'rows':[]};var _0x293ca3=_[_0x1b7a('0x2a')](db['WhatsappTransferReport'][_0x1b7a('0x2b')],function(_0x14be7d){return{'name':_0x14be7d[_0x1b7a('0x2c')],'type':_0x14be7d[_0x1b7a('0x2d')][_0x1b7a('0x2e')]};});_0x5ea491[_0x1b7a('0x2f')]=_[_0x1b7a('0x2a')](_0x293ca3,_0x1b7a('0x27'));_0x5ea491[_0x1b7a('0x30')]=_['keys'](_0x46450d['query']);_0x5ea491['filters']=_[_0x1b7a('0x31')](_0x5ea491[_0x1b7a('0x2f')],_0x5ea491[_0x1b7a('0x30')]);_0x5d6362[_0x1b7a('0x32')]=_[_0x1b7a('0x31')](_0x5ea491['model'],qs[_0x1b7a('0x33')](_0x46450d[_0x1b7a('0x30')][_0x1b7a('0x33')]));_0x5d6362[_0x1b7a('0x32')]=_0x5d6362[_0x1b7a('0x32')][_0x1b7a('0x34')]?_0x5d6362['attributes']:_0x5ea491[_0x1b7a('0x2f')];if(!_0x46450d['query'][_0x1b7a('0x35')](_0x1b7a('0x36'))){_0x5d6362['limit']=qs['limit'](_0x46450d[_0x1b7a('0x30')][_0x1b7a('0x1d')]);_0x5d6362['offset']=qs[_0x1b7a('0x37')](_0x46450d[_0x1b7a('0x30')]['offset']);}_0x5d6362[_0x1b7a('0x38')]=qs[_0x1b7a('0x39')](_0x46450d[_0x1b7a('0x30')][_0x1b7a('0x39')]);_0x5d6362[_0x1b7a('0x3a')]=qs['filters'](_[_0x1b7a('0x3b')](_0x46450d[_0x1b7a('0x30')],_0x5ea491[_0x1b7a('0x3c')]),_0x293ca3);if(_0x46450d['query']['filter']){_0x5d6362['where']=_[_0x1b7a('0x3d')](_0x5d6362[_0x1b7a('0x3a')],{'$or':_[_0x1b7a('0x2a')](_0x293ca3,function(_0x72ca1c){if(_0x72ca1c[_0x1b7a('0x2d')]!=='VIRTUAL'){var _0x8a2d2c={};_0x8a2d2c[_0x72ca1c['name']]={'$like':'%'+_0x46450d[_0x1b7a('0x30')][_0x1b7a('0x3e')]+'%'};return _0x8a2d2c;}})});}_0x5d6362=_[_0x1b7a('0x3d')]({},_0x5d6362,_0x46450d[_0x1b7a('0x3f')]);var _0x38ac1b={'where':_0x5d6362[_0x1b7a('0x3a')]};return db['WhatsappTransferReport'][_0x1b7a('0x1e')](_0x38ac1b)[_0x1b7a('0x23')](function(_0x4cb81a){_0x183f5d[_0x1b7a('0x1e')]=_0x4cb81a;if(_0x46450d['query'][_0x1b7a('0x40')]){_0x5d6362[_0x1b7a('0x41')]=[{'all':!![]}];}return db[_0x1b7a('0x42')][_0x1b7a('0x43')](_0x5d6362);})[_0x1b7a('0x23')](function(_0x1b561d){_0x183f5d['rows']=_0x1b561d;return _0x183f5d;})[_0x1b7a('0x23')](respondWithFilteredResult(_0x40823e,_0x5d6362))['catch'](handleError(_0x40823e,null));};exports[_0x1b7a('0x44')]=function(_0x3bbb53,_0x4d8b1d){var _0x1bae16={'raw':!![],'where':{'id':_0x3bbb53[_0x1b7a('0x45')]['id']}},_0x289cc7={};_0x289cc7[_0x1b7a('0x2f')]=_[_0x1b7a('0x46')](db[_0x1b7a('0x42')]['rawAttributes']);_0x289cc7[_0x1b7a('0x30')]=_[_0x1b7a('0x46')](_0x3bbb53[_0x1b7a('0x30')]);_0x289cc7['filters']=_[_0x1b7a('0x31')](_0x289cc7['model'],_0x289cc7[_0x1b7a('0x30')]);_0x1bae16[_0x1b7a('0x32')]=_[_0x1b7a('0x31')](_0x289cc7['model'],qs[_0x1b7a('0x33')](_0x3bbb53[_0x1b7a('0x30')][_0x1b7a('0x33')]));_0x1bae16['attributes']=_0x1bae16[_0x1b7a('0x32')]['length']?_0x1bae16[_0x1b7a('0x32')]:_0x289cc7[_0x1b7a('0x2f')];if(_0x3bbb53[_0x1b7a('0x30')][_0x1b7a('0x40')]){_0x1bae16['include']=[{'all':!![]}];}_0x1bae16=_[_0x1b7a('0x3d')]({},_0x1bae16,_0x3bbb53[_0x1b7a('0x3f')]);return db[_0x1b7a('0x42')][_0x1b7a('0x47')](_0x1bae16)[_0x1b7a('0x23')](handleEntityNotFound(_0x4d8b1d,null))[_0x1b7a('0x23')](respondWithResult(_0x4d8b1d,null))['catch'](handleError(_0x4d8b1d,null));};exports[_0x1b7a('0x48')]=function(_0x21f46e,_0x4bc4cd){return db[_0x1b7a('0x42')][_0x1b7a('0x48')](_0x21f46e['body'],{})[_0x1b7a('0x23')](respondWithResult(_0x4bc4cd,0xc9))[_0x1b7a('0x49')](handleError(_0x4bc4cd,null));};exports[_0x1b7a('0x4a')]=function(_0x2e50f6,_0x3e01e4){if(_0x2e50f6['body']['id']){delete _0x2e50f6[_0x1b7a('0x4b')]['id'];}return db[_0x1b7a('0x42')][_0x1b7a('0x47')]({'where':{'id':_0x2e50f6[_0x1b7a('0x45')]['id']}})[_0x1b7a('0x23')](handleEntityNotFound(_0x3e01e4,null))[_0x1b7a('0x23')](saveUpdates(_0x2e50f6[_0x1b7a('0x4b')],null))[_0x1b7a('0x23')](respondWithResult(_0x3e01e4,null))[_0x1b7a('0x49')](handleError(_0x3e01e4,null));};exports[_0x1b7a('0x24')]=function(_0x5ae6da,_0x312dc0){return db[_0x1b7a('0x42')][_0x1b7a('0x47')]({'where':{'id':_0x5ae6da[_0x1b7a('0x45')]['id']}})['then'](handleEntityNotFound(_0x312dc0,null))[_0x1b7a('0x23')](removeEntity(_0x312dc0,null))[_0x1b7a('0x49')](handleError(_0x312dc0,null));};exports['describe']=function(_0x189c15,_0x18a595){return db[_0x1b7a('0x42')]['describe']()[_0x1b7a('0x23')](respondWithResult(_0x18a595,null))[_0x1b7a('0x49')](handleError(_0x18a595,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index d3f9736..a808252 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 _0x411a=['api','bluebird','path','rimraf','../../config/environment','./whatsappTransferReport.attributes','exports','uniqueid','lodash','util','../../config/logger'];(function(_0x4cfa2e,_0x5752b5){var _0x279b50=function(_0x3f817b){while(--_0x3f817b){_0x4cfa2e['push'](_0x4cfa2e['shift']());}};_0x279b50(++_0x5752b5);}(_0x411a,0xad));var _0xa411=function(_0x3a7455,_0x46b004){_0x3a7455=_0x3a7455-0x0;var _0x216c72=_0x411a[_0x3a7455];return _0x216c72;};'use strict';var _=require(_0xa411('0x0'));var util=require(_0xa411('0x1'));var logger=require(_0xa411('0x2'))(_0xa411('0x3'));var moment=require('moment');var BPromise=require(_0xa411('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa411('0x5'));var rimraf=require(_0xa411('0x6'));var config=require(_0xa411('0x7'));var attributes=require(_0xa411('0x8'));module[_0xa411('0x9')]=function(_0x3e1b32,_0xfdbdc5){return _0x3e1b32['define']('WhatsappTransferReport',attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':_0xa411('0xa'),'fields':[_0xa411('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x214f=['rimraf','../../config/environment','./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport','uniqueid','util','../../config/logger','moment','bluebird','path'];(function(_0x4643ce,_0x1aa3b6){var _0x25c522=function(_0x4bfcdc){while(--_0x4bfcdc){_0x4643ce['push'](_0x4643ce['shift']());}};_0x25c522(++_0x1aa3b6);}(_0x214f,0xa3));var _0xf214=function(_0x22cb00,_0x1b8c8a){_0x22cb00=_0x22cb00-0x0;var _0xcd11c2=_0x214f[_0x22cb00];return _0xcd11c2;};'use strict';var _=require('lodash');var util=require(_0xf214('0x0'));var logger=require(_0xf214('0x1'))('api');var moment=require(_0xf214('0x2'));var BPromise=require(_0xf214('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf214('0x4'));var rimraf=require(_0xf214('0x5'));var config=require(_0xf214('0x6'));var attributes=require(_0xf214('0x7'));module[_0xf214('0x8')]=function(_0x594cdb,_0x4b188b){return _0x594cdb[_0xf214('0x9')](_0xf214('0xa'),attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':_0xf214('0xb'),'fields':[_0xf214('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index ccbfe8d..d330104 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 _0x20e1=['../../config/utils','../../config/logger','rpc','client','http','request','info','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','WhatsappTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x2f4b5c,_0x2ed94f){var _0x1b20cd=function(_0x35c7fb){while(--_0x35c7fb){_0x2f4b5c['push'](_0x2f4b5c['shift']());}};_0x1b20cd(++_0x2ed94f);}(_0x20e1,0x9b));var _0x120e=function(_0x451353,_0x19710b){_0x451353=_0x451353-0x0;var _0x102315=_0x20e1[_0x451353];return _0x102315;};'use strict';var _=require(_0x120e('0x0'));var util=require(_0x120e('0x1'));var moment=require(_0x120e('0x2'));var BPromise=require(_0x120e('0x3'));var rs=require(_0x120e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x120e('0x5'));var logger=require(_0x120e('0x6'))(_0x120e('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x120e('0x8')][_0x120e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x21bf06,_0x3b8932,_0xe53301){return new BPromise(function(_0x4755d1,_0x36f2b4){return client[_0x120e('0xa')](_0x21bf06,_0xe53301)['then'](function(_0x21389c){logger[_0x120e('0xb')]('WhatsappTransferReport,\x20%s,\x20%s',_0x3b8932,'request\x20sent');logger[_0x120e('0xc')](_0x120e('0xd'),_0x3b8932,_0x120e('0xe'),JSON['stringify'](_0x21389c));if(_0x21389c[_0x120e('0xf')]){if(_0x21389c[_0x120e('0xf')]['code']===0x1f4){logger[_0x120e('0xf')](_0x120e('0x10'),_0x3b8932,_0x21389c[_0x120e('0xf')][_0x120e('0x11')]);return _0x36f2b4(_0x21389c[_0x120e('0xf')][_0x120e('0x11')]);}logger['error'](_0x120e('0x10'),_0x3b8932,_0x21389c[_0x120e('0xf')]['message']);return _0x4755d1(_0x21389c[_0x120e('0xf')][_0x120e('0x11')]);}else{logger['info'](_0x120e('0x10'),_0x3b8932,_0x120e('0xe'));_0x4755d1(_0x21389c[_0x120e('0x12')]['message']);}})[_0x120e('0x13')](function(_0x1d3a15){logger[_0x120e('0xf')](_0x120e('0x10'),_0x3b8932,_0x1d3a15);_0x36f2b4(_0x1d3a15);});});} \ No newline at end of file +var _0x1c8a=['WhatsappTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x283851,_0x441b92){var _0x4035b6=function(_0x2a18c4){while(--_0x2a18c4){_0x283851['push'](_0x283851['shift']());}};_0x4035b6(++_0x441b92);}(_0x1c8a,0x191));var _0xa1c8=function(_0x43a3e3,_0x304e20){_0x43a3e3=_0x43a3e3-0x0;var _0x28de71=_0x1c8a[_0x43a3e3];return _0x28de71;};'use strict';var _=require('lodash');var util=require(_0xa1c8('0x0'));var moment=require(_0xa1c8('0x1'));var BPromise=require(_0xa1c8('0x2'));var rs=require(_0xa1c8('0x3'));var fs=require('fs');var Redis=require(_0xa1c8('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa1c8('0x5'));var logger=require(_0xa1c8('0x6'))(_0xa1c8('0x7'));var config=require(_0xa1c8('0x8'));var jayson=require(_0xa1c8('0x9'));var client=jayson[_0xa1c8('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x58878d,_0x3383c0,_0x2e5dbb){return new BPromise(function(_0xc92486,_0x3623e6){return client[_0xa1c8('0xb')](_0x58878d,_0x2e5dbb)[_0xa1c8('0xc')](function(_0x564f3d){logger[_0xa1c8('0xd')](_0xa1c8('0xe'),_0x3383c0,_0xa1c8('0xf'));logger[_0xa1c8('0x10')](_0xa1c8('0x11'),_0x3383c0,_0xa1c8('0xf'),JSON['stringify'](_0x564f3d));if(_0x564f3d[_0xa1c8('0x12')]){if(_0x564f3d[_0xa1c8('0x12')][_0xa1c8('0x13')]===0x1f4){logger['error'](_0xa1c8('0xe'),_0x3383c0,_0x564f3d['error'][_0xa1c8('0x14')]);return _0x3623e6(_0x564f3d['error']['message']);}logger['error']('WhatsappTransferReport,\x20%s,\x20%s',_0x3383c0,_0x564f3d[_0xa1c8('0x12')][_0xa1c8('0x14')]);return _0xc92486(_0x564f3d['error'][_0xa1c8('0x14')]);}else{logger[_0xa1c8('0xd')]('WhatsappTransferReport,\x20%s,\x20%s',_0x3383c0,_0xa1c8('0xf'));_0xc92486(_0x564f3d[_0xa1c8('0x15')][_0xa1c8('0x14')]);}})['catch'](function(_0x5588f5){logger['error'](_0xa1c8('0xe'),_0x3383c0,_0x5588f5);_0x3623e6(_0x5588f5);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 1a28fbf..2188058 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xad78=['app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','seedDB','default','then','listen','info','start','filter','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name','online','join','Offline\x20apps:','status','None','log','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','lodash','./config/license','./rpc','./config/logger'];(function(_0x489b87,_0xd51c93){var _0x1823b6=function(_0x451c70){while(--_0x451c70){_0x489b87['push'](_0x489b87['shift']());}};_0x1823b6(++_0xd51c93);}(_0xad78,0x149));var _0x8ad7=function(_0x4bb5e0,_0x451d12){_0x4bb5e0=_0x4bb5e0-0x0;var _0x51cdf1=_0xad78[_0x4bb5e0];return _0x51cdf1;};'use strict';var _=require(_0x8ad7('0x0'));var db=require('./mysqldb')['db'];var seedDb=require('./config/seedDB');var checkLicense=require(_0x8ad7('0x1'));var rpc=require(_0x8ad7('0x2'));var config=require('./config/environment');var logger=require(_0x8ad7('0x3'))(_0x8ad7('0x4'));var pm2=require(_0x8ad7('0x5'));var pm2Config=require(_0x8ad7('0x6'));var schedule=require(_0x8ad7('0x7'));var chat=require(_0x8ad7('0x8'));var whatsapp=require(_0x8ad7('0x9'));var transcribe=require(_0x8ad7('0xa'));var provider=require(_0x8ad7('0xb'));function main(){return db[_0x8ad7('0xc')]['sync']()['then'](function(){if(config[_0x8ad7('0xd')]){return seedDb[_0x8ad7('0xe')]();}})[_0x8ad7('0xf')](function(){return checkLicense[_0x8ad7('0xe')]();})[_0x8ad7('0xf')](function(){return rpc[_0x8ad7('0x10')]();})[_0x8ad7('0xf')](function(_0x4929ca){logger[_0x8ad7('0x11')](_0x4929ca);return chat[_0x8ad7('0x12')]();})[_0x8ad7('0xf')](function(){return whatsapp['start']();})[_0x8ad7('0xf')](function(){return schedule[_0x8ad7('0x12')]();})[_0x8ad7('0xf')](function(){return transcribe[_0x8ad7('0x12')]();})[_0x8ad7('0xf')](function(){return provider[_0x8ad7('0x12')]();})[_0x8ad7('0xf')](function(_0x2fb005){logger[_0x8ad7('0x11')](_0x2fb005);return pm2[_0x8ad7('0x12')](pm2Config);})[_0x8ad7('0xf')](function(_0x5a23c0){var _0x48502c=_0x5a23c0[_0x8ad7('0x13')](function(_0x5ccbf7){return typeof _0x5ccbf7[_0x8ad7('0x14')]===_0x8ad7('0x15')&&_0x5ccbf7['exitCode']>=0x0;});if(_0x48502c['length']>0x0){throw new Error(_0x48502c[_0x8ad7('0x16')]+_0x8ad7('0x17')+_[_0x8ad7('0x18')](_0x48502c,function(_0x429dd1){return'\x22'+_0x429dd1[_0x8ad7('0x19')][_0x8ad7('0x1a')]+'\x22';}));}logger[_0x8ad7('0x11')]('Online\x20apps:',_['map'](_['filter'](_0x5a23c0,{'status':_0x8ad7('0x1b')}),'name')[_0x8ad7('0x1c')]());logger[_0x8ad7('0x11')](_0x8ad7('0x1d'),_['map'](_['filter'](_0x5a23c0,function(_0x5a2048){return _0x5a2048[_0x8ad7('0x1e')]!=='online';}),'name')[_0x8ad7('0x1c')]()||_0x8ad7('0x1f'));console[_0x8ad7('0x20')]('App\x20Ready!');})[_0x8ad7('0x21')](function(_0x2d178f){console[_0x8ad7('0x20')](_0x8ad7('0x22'),_0x2d178f);logger[_0x8ad7('0x23')](_0x8ad7('0x24'),_0x2d178f);process['exit'](0x1);});}main(); \ No newline at end of file +var _0xcf12=['app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','then','seedDB','default','info','start','exitCode','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name','Online\x20apps:','online','join','Offline\x20apps:','filter','status','None','log','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','./mysqldb','./config/license','./rpc','./config/environment'];(function(_0x517f70,_0x4814ec){var _0x2423c4=function(_0x59acf0){while(--_0x59acf0){_0x517f70['push'](_0x517f70['shift']());}};_0x2423c4(++_0x4814ec);}(_0xcf12,0x140));var _0x2cf1=function(_0x3e9f47,_0x106d5c){_0x3e9f47=_0x3e9f47-0x0;var _0x4cb445=_0xcf12[_0x3e9f47];return _0x4cb445;};'use strict';var _=require('lodash');var db=require(_0x2cf1('0x0'))['db'];var seedDb=require('./config/seedDB');var checkLicense=require(_0x2cf1('0x1'));var rpc=require(_0x2cf1('0x2'));var config=require(_0x2cf1('0x3'));var logger=require('./config/logger')(_0x2cf1('0x4'));var pm2=require(_0x2cf1('0x5'));var pm2Config=require(_0x2cf1('0x6'));var schedule=require(_0x2cf1('0x7'));var chat=require(_0x2cf1('0x8'));var whatsapp=require(_0x2cf1('0x9'));var transcribe=require(_0x2cf1('0xa'));var provider=require(_0x2cf1('0xb'));function main(){return db[_0x2cf1('0xc')]['sync']()[_0x2cf1('0xd')](function(){if(config[_0x2cf1('0xe')]){return seedDb[_0x2cf1('0xf')]();}})[_0x2cf1('0xd')](function(){return checkLicense[_0x2cf1('0xf')]();})[_0x2cf1('0xd')](function(){return rpc['listen']();})['then'](function(_0x4a4a08){logger[_0x2cf1('0x10')](_0x4a4a08);return chat['start']();})[_0x2cf1('0xd')](function(){return whatsapp[_0x2cf1('0x11')]();})[_0x2cf1('0xd')](function(){return schedule['start']();})[_0x2cf1('0xd')](function(){return transcribe['start']();})[_0x2cf1('0xd')](function(){return provider[_0x2cf1('0x11')]();})[_0x2cf1('0xd')](function(_0x3ae4e1){logger[_0x2cf1('0x10')](_0x3ae4e1);return pm2[_0x2cf1('0x11')](pm2Config);})[_0x2cf1('0xd')](function(_0x78e07e){var _0x10c491=_0x78e07e['filter'](function(_0x4298b9){return typeof _0x4298b9[_0x2cf1('0x12')]==='number'&&_0x4298b9[_0x2cf1('0x12')]>=0x0;});if(_0x10c491[_0x2cf1('0x13')]>0x0){throw new Error(_0x10c491[_0x2cf1('0x13')]+_0x2cf1('0x14')+_[_0x2cf1('0x15')](_0x10c491,function(_0x16ad2d){return'\x22'+_0x16ad2d[_0x2cf1('0x16')][_0x2cf1('0x17')]+'\x22';}));}logger[_0x2cf1('0x10')](_0x2cf1('0x18'),_[_0x2cf1('0x15')](_['filter'](_0x78e07e,{'status':_0x2cf1('0x19')}),'name')[_0x2cf1('0x1a')]());logger[_0x2cf1('0x10')](_0x2cf1('0x1b'),_[_0x2cf1('0x15')](_[_0x2cf1('0x1c')](_0x78e07e,function(_0x37c3ef){return _0x37c3ef[_0x2cf1('0x1d')]!==_0x2cf1('0x19');}),'name')[_0x2cf1('0x1a')]()||_0x2cf1('0x1e'));console[_0x2cf1('0x1f')]('App\x20Ready!');})[_0x2cf1('0x20')](function(_0x58b1b0){console[_0x2cf1('0x1f')](_0x2cf1('0x21'),_0x58b1b0);logger[_0x2cf1('0x22')](_0x2cf1('0x23'),_0x58b1b0);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 1a46c7f..dfad4d8 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 _0xedd9=['crypto','bluebird','util','moment','session','fullname','name','internal','email','permissions','voicePause','chatPause','faxPause','smsPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','hotdesk','interface','userProfileId','settingsEnabled','wssPort','downloadVoiceRecordings','downloadAttachments','selectRecallMeCampaign','chatAutoanswer','emailAutoanswerDelay','smsAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','closed','disposition','then','unmanaged','json','Unmanaged.','authorization','startsWith','headers','Basic','User','find','authenticate','pass','status','catch','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','Setting','blockDuration','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','blocked','blockedAt','add','Invalid\x20API\x20access\x20key','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','isWebrtcLicence','webrtc','isMiddleware','signToken','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','role','cookie','motion.token','redirect','send','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','toLowerCase','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','Sequelize','updatePasswordsHistory','split','unshift','join','promisify','secrets','payload','verify','hex','toString','HS512','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','lodash','jsonwebtoken','express-jwt','composable-middleware'];(function(_0x1a5e50,_0x4d75df){var _0x3e070f=function(_0x329a1b){while(--_0x329a1b){_0x1a5e50['push'](_0x1a5e50['shift']());}};_0x3e070f(++_0x4d75df);}(_0xedd9,0xfc));var _0x9edd=function(_0x4bfeec,_0xf12cfa){_0x4bfeec=_0x4bfeec-0x0;var _0x4cf2b2=_0xedd9[_0x4bfeec];return _0x4cf2b2;};'use strict';var db=require('../../mysqldb')['db'];var config=require(_0x9edd('0x0'));var hardwareConf=require(_0x9edd('0x1'));var licenseUtil=require(_0x9edd('0x2'));var encryptor=require(_0x9edd('0x3'));var _=require(_0x9edd('0x4'));var jwt=require(_0x9edd('0x5'));var expressJwt=require(_0x9edd('0x6'));var compose=require(_0x9edd('0x7'));var basicAuth=require('basic-auth');var crypto=require(_0x9edd('0x8'));var BPromise=require(_0x9edd('0x9'));var util=require(_0x9edd('0xa'));var moment=require(_0x9edd('0xb'));var validateJwt=expressJwt({'secret':config['secrets'][_0x9edd('0xc')]});var userAttributes=['id','role',_0x9edd('0xd'),_0x9edd('0xe'),_0x9edd('0xf'),_0x9edd('0x10'),'userpic',_0x9edd('0x11'),'md5secret',_0x9edd('0x12'),_0x9edd('0x13'),'mailPause',_0x9edd('0x14'),_0x9edd('0x15'),'openchannelPause',_0x9edd('0x16'),_0x9edd('0x17'),_0x9edd('0x18'),_0x9edd('0x19'),_0x9edd('0x1a'),_0x9edd('0x1b'),_0x9edd('0x1c'),_0x9edd('0x1d'),'phoneBarAutoAnswer',_0x9edd('0x1e'),_0x9edd('0x1f'),_0x9edd('0x20'),_0x9edd('0x21'),_0x9edd('0x22'),_0x9edd('0x23'),_0x9edd('0x24'),_0x9edd('0x25'),'phoneBarRemoteControlPort',_0x9edd('0x26'),_0x9edd('0x27'),_0x9edd('0x28'),'privacyEnabled',_0x9edd('0x29'),_0x9edd('0x2a'),_0x9edd('0x2b'),'downloadOmnichannelInteractions',_0x9edd('0x2c'),'ignorePauseForPreviewCalls',_0x9edd('0x2d'),_0x9edd('0x2e'),'chatAutoanswerDelay','emailAutoanswer',_0x9edd('0x2f'),'smsAutoanswer',_0x9edd('0x30'),'openchannelAutoanswer','openchannelAutoanswerDelay',_0x9edd('0x31'),_0x9edd('0x32'),'whatsappAutoanswer','whatsappAutoanswerDelay'];exports[_0x9edd('0x33')]=function(){return this[_0x9edd('0x34')](!![])[_0x9edd('0x35')](function(_0x542172,_0x3741c8,_0x1dca43){if(_0x542172[_0x9edd('0x36')]){_0x1dca43();}else{return db[_0x9edd('0x37')][_0x9edd('0x38')]({'where':{'id':_0x542172['params']['id']},'attributes':['id',_0x9edd('0x39'),_0x9edd('0x3a')],'raw':!![]})[_0x9edd('0x3b')](function(_0x2f9f86){if(_0x2f9f86&&_0x2f9f86[_0x9edd('0x39')]){return _0x3741c8['status'](_0x2f9f86['disposition']===_0x9edd('0x3c')?0x195:0x193)[_0x9edd('0x3d')]({'message':_0x2f9f86[_0x9edd('0x3a')]===_0x9edd('0x3c')?_0x9edd('0x3e'):'Forbidden.'});}else{_0x1dca43();}})['catch'](function(_0x214d0a){_0x1dca43(_0x214d0a);});}});};exports[_0x9edd('0x34')]=function isAuthenticated(_0x1c762c){return compose()['use'](function(_0x238b22,_0x28cfae,_0x2ae8dd){var _0x41af53;if(_0x238b22['headers'][_0x9edd('0x3f')]){if(_[_0x9edd('0x40')](_0x238b22[_0x9edd('0x41')][_0x9edd('0x3f')],_0x9edd('0x42'))){var _0x42e664=basicAuth(_0x238b22);db[_0x9edd('0x43')][_0x9edd('0x44')]({'where':{'name':_0x42e664[_0x9edd('0xe')]}})[_0x9edd('0x3b')](function(_0x4fd03f){if(!_0x4fd03f||!_0x4fd03f[_0x9edd('0x45')](_0x42e664[_0x9edd('0x46')])){return _0x28cfae[_0x9edd('0x47')](0x191)[_0x9edd('0x3d')]({'message':'Wrong\x20credentials.'});}_0x238b22[_0x9edd('0x36')]={'id':_0x4fd03f['id']};_0x2ae8dd();})[_0x9edd('0x48')](function(_0x267c74){_0x2ae8dd(_0x267c74);});}else if(_['startsWith'](_0x238b22[_0x9edd('0x41')][_0x9edd('0x3f')],_0x9edd('0x49'))){validateJwt(_0x238b22,_0x28cfae,_0x2ae8dd);}else{if(_0x1c762c){_0x2ae8dd();}else{return _0x28cfae[_0x9edd('0x47')](0x193)[_0x9edd('0x3d')]({'message':_0x9edd('0x4a')});}}}else if(_0x238b22[_0x9edd('0x4b')][_0x9edd('0x4c')]){try{var _0xd0fd74={'audience':hardwareConf[_0x9edd('0x4d')](),'issuer':hardwareConf[_0x9edd('0x4d')]()};verifyJwt(_0x238b22[_0x9edd('0x4b')][_0x9edd('0x4c')],_0xd0fd74)[_0x9edd('0x3b')](function(_0x5757fc){return db[_0x9edd('0x43')]['find']({'where':{'id':_0x5757fc[_0x9edd('0x4e')]}})[_0x9edd('0x3b')](function(_0x10d6fd){_0x41af53=_0x10d6fd;return db[_0x9edd('0x4f')][_0x9edd('0x38')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x9edd('0x50')],'raw':!![]});})[_0x9edd('0x3b')](function(_0x2b3469){if(!_0x41af53||!_[_0x9edd('0x51')](_0x41af53[_0x9edd('0x52')],_0x5757fc[_0x9edd('0x53')])){return _0x28cfae[_0x9edd('0x47')](0x191)[_0x9edd('0x3d')]({'message':_0x9edd('0x54')});}if(_0x41af53[_0x9edd('0x55')]){return _0x28cfae['status'](0x191)[_0x9edd('0x3d')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0x41af53[_0x9edd('0x56')]){if(_0x2b3469['blockDuration']>0x0){if(moment(_0x41af53[_0x9edd('0x57')])[_0x9edd('0x58')](_0x2b3469[_0x9edd('0x50')],'minutes')>moment()){return _0x28cfae[_0x9edd('0x47')](0x191)[_0x9edd('0x3d')]({'message':_0x9edd('0x59')});}}else{return _0x28cfae['status'](0x191)[_0x9edd('0x3d')]({'message':'Invalid\x20API\x20access\x20key'});}}_0x238b22[_0x9edd('0x36')]={'id':_0x41af53['id']};_0x2ae8dd();});})[_0x9edd('0x48')](function(){return _0x28cfae['status'](0x191)[_0x9edd('0x3d')]({'message':_0x9edd('0x59')});});}catch(_0x389f51){_0x2ae8dd(_0x389f51);}}else if(_0x1c762c){_0x2ae8dd();}else{return _0x28cfae[_0x9edd('0x47')](0x193)['json']({'message':_0x9edd('0x4a')});}})['use'](function(_0x2bdb3f,_0xc1e657,_0x587d74){if(_0x2bdb3f[_0x9edd('0x36')]){db['User']['find']({'where':{'id':_0x2bdb3f[_0x9edd('0x36')]['id']},'attributes':userAttributes})[_0x9edd('0x3b')](function(_0x1f276b){if(!_0x1f276b){return _0xc1e657[_0x9edd('0x47')](0x194)[_0x9edd('0x3d')]({'message':_0x9edd('0x5a')});}_0x2bdb3f[_0x9edd('0x36')]=_0x1f276b;_0x587d74();})[_0x9edd('0x48')](function(_0x18c149){_0x587d74(_0x18c149);});}else if(_0x1c762c){_0x587d74();}else{return _0xc1e657[_0x9edd('0x47')](0x194)[_0x9edd('0x3d')]({'message':_0x9edd('0x5b')});}});};exports[_0x9edd('0x5c')]=function canUpdate(){return compose()[_0x9edd('0x35')](function(_0x46e9f4,_0x5416f8,_0x13197d){return licenseUtil[_0x9edd('0x5d')]()[_0x9edd('0x3b')](function(_0x1e5805){if(_0x1e5805[_0x9edd('0x5e')]){_0x13197d();}else{return _0x5416f8[_0x9edd('0x47')](0x193)[_0x9edd('0x3d')]({'message':'Forbidden'});}})['catch'](function(_0x4bc7a1){_0x13197d(_0x4bc7a1);});});};exports[_0x9edd('0x5f')]=function isWebrtcLicence(){return compose()['use'](function(_0x8b1fdb,_0x19b56b,_0x2b06d3){return licenseUtil[_0x9edd('0x5d')]()[_0x9edd('0x3b')](function(_0x53005b){if(_0x53005b[_0x9edd('0x60')]){_0x2b06d3();}else{return _0x19b56b[_0x9edd('0x47')](0x193)[_0x9edd('0x3d')]({'message':'Forbidden'});}})[_0x9edd('0x48')](function(_0xfd7bd1){_0x2b06d3(_0xfd7bd1);});});};exports[_0x9edd('0x61')]=function(_0x293b03,_0x1d78c4,_0x35bdec){_0x293b03['isMiddleware']=!![];return _0x35bdec();};exports[_0x9edd('0x62')]=function signToken(_0x237e91){return signJwt(_0x237e91);};exports['setTokenCookie']=function(_0xb93816,_0x8d8701){if(!_0xb93816['user']){return _0x8d8701[_0x9edd('0x47')](0x194)[_0x9edd('0x3d')]({'message':_0x9edd('0x63')});}var _0x5215b0={'payload':{'id':_0xb93816[_0x9edd('0x36')]['id'],'role':_0xb93816[_0x9edd('0x36')][_0x9edd('0x64')]},'options':{'expiresIn':0x15180}};return signJwt(_0x5215b0)[_0x9edd('0x3b')](function(_0x53f6e3){_0x8d8701[_0x9edd('0x65')](_0x9edd('0x66'),_0x53f6e3);_0x8d8701[_0x9edd('0x67')]('/dashboards/general');})[_0x9edd('0x48')](function(_0x21f6ce){return _0x8d8701['status'](0x1f4)[_0x9edd('0x68')](_0x21f6ce);});};exports['retrieveApiKey']=function(_0x336494){if(_[_0x9edd('0x69')](_0x336494[_0x9edd('0x52')])||_[_0x9edd('0x69')](_0x336494[_0x9edd('0x6a')])){return null;}else{return createJwt(_0x336494);}};exports[_0x9edd('0x6b')]=function(_0x2334d4){_0x2334d4[_0x9edd('0x52')]=generateNonce();_0x2334d4[_0x9edd('0x6a')]=generateIssuedAt();return createJwt(_0x2334d4);};exports[_0x9edd('0x6c')]=function(_0x31272d,_0x5a3b1d){var _0x161bea=_0x31272d[_0x9edd('0x4b')][_0x9edd('0x4c')];if(_0x161bea){var _0x58fe29={'nonce':_0x5a3b1d[_0x9edd('0x52')],'iat':_0x5a3b1d['apiKeyIat'],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x161bea,_0x58fe29)[_0x9edd('0x3b')](function(){return generateApiKey(_0x5a3b1d);});}else{throw{'message':_0x9edd('0x6d')};}};exports[_0x9edd('0x6e')]=function(_0x35ddb3){var _0x48a900=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x48a900['test'](_0x35ddb3))throw new db['Sequelize'][(_0x9edd('0x6f'))](_0x9edd('0x70'));return;};exports[_0x9edd('0x71')]=function(_0x1091ff,_0x2e2920,_0x41ec97){var _0x25906c=encryptor[_0x9edd('0x72')](_0x2e2920)['split'](',');for(var _0x16dfdc=0x0;_0x16dfdc<_0x41ec97;_0x16dfdc++){if(!_0x25906c[_0x16dfdc])break;if(_0x1091ff['toLowerCase']()===_0x25906c[_0x16dfdc][_0x9edd('0x73')]()){var _0x6a1cfc=util['format'](_0x9edd('0x74'),_0x41ec97);if(_0x41ec97===0x1){_0x6a1cfc=_0x9edd('0x75');}throw new db[(_0x9edd('0x76'))]['ValidationError'](_0x6a1cfc);}}return;};exports[_0x9edd('0x77')]=function(_0x2e1ce3,_0x430eb4){var _0x15ebfa=_0x430eb4?encryptor[_0x9edd('0x72')](_0x430eb4)[_0x9edd('0x78')](','):[];if(_0x15ebfa['length']===0x5){_0x15ebfa['splice'](-0x1,0x1);}_0x15ebfa[_0x9edd('0x79')](_0x2e1ce3);return encryptor['encryptString'](_0x15ebfa[_0x9edd('0x7a')](','));};function signJwt(_0x3e9a3e){var _0x439083=BPromise[_0x9edd('0x7b')](jwt['sign'],{'context':jwt});var _0x21ead2=_0x3e9a3e['secret']||config[_0x9edd('0x7c')][_0x9edd('0xc')];return new BPromise(function(_0xc6bde6,_0x5ca123){_0x439083(_0x3e9a3e[_0x9edd('0x7d')],_0x21ead2,_0x3e9a3e['options'])[_0x9edd('0x3b')](function(_0x4e1eda){_0xc6bde6(_0x4e1eda);})['catch'](function(_0x236b82){_0x5ca123(_0x236b82);});});}function verifyJwt(_0x4a72d0,_0x141137,_0x134c9c){var _0x307a61=BPromise['promisify'](jwt[_0x9edd('0x7e')],{'context':jwt});var _0x321485=_0x134c9c||config[_0x9edd('0x7c')][_0x9edd('0xc')];return new BPromise(function(_0x467512,_0x4d8fbb){_0x307a61(_0x4a72d0,_0x321485,_0x141137)['then'](function(_0x2e1a96){_0x467512(_0x2e1a96);})[_0x9edd('0x48')](function(_0x5516c4){_0x4d8fbb(_0x5516c4);});});}function generateNonce(){return crypto['randomBytes'](0x10)['toString'](_0x9edd('0x7f'));}function generateIssuedAt(){return Math['floor'](Date['now']()/0x3e8)[_0x9edd('0x80')]();}function createJwt(_0x32ff46){var _0x589348={'payload':{'iat':_0x32ff46[_0x9edd('0x6a')],'nonce':_0x32ff46[_0x9edd('0x52')]},'options':{'algorithm':_0x9edd('0x81'),'subject':_0x32ff46['id']['toString'](),'issuer':hardwareConf[_0x9edd('0x4d')](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x589348)[_0x9edd('0x3b')](function(_0x18d1a0){return{'iat':_0x32ff46['apiKeyIat'],'nonce':_0x32ff46[_0x9edd('0x52')],'token':_0x18d1a0};});} \ No newline at end of file +var _0x4b84=['User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','Forbidden','isWebrtcLicence','webrtc','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','role','cookie','motion.token','redirect','/dashboards/general','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','split','toLowerCase','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','Sequelize','ValidationError','updatePasswordsHistory','length','splice','unshift','encryptString','join','promisify','secret','secrets','payload','randomBytes','hex','now','toString','HS512','../../mysqldb','../../config/environment','../encryptor','express-jwt','composable-middleware','basic-auth','moment','session','fullname','email','userpic','permissions','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','lastLoginAt','lastPauseAt','allowmessenger','alias','phoneBarAutoAnswer','phoneBarDnd','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','userProfileId','settingsEnabled','wssPort','downloadOmnichannelInteractions','downloadAttachments','selectRecallMeCampaign','chatAutoanswer','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswer','whatsappAutoanswerDelay','isChatInteractionAuthorized','isAuthenticated','user','ChatInteraction','params','disposition','then','closed','status','unmanaged','Forbidden.','catch','use','headers','authorization','Basic','User','find','name','authenticate','pass','json','startsWith','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','Setting','findOne','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','blocked','blockedAt','add','minutes','Invalid\x20API\x20access\x20key'];(function(_0x49d49a,_0x21fb75){var _0x1fe9f4=function(_0xb60097){while(--_0xb60097){_0x49d49a['push'](_0x49d49a['shift']());}};_0x1fe9f4(++_0x21fb75);}(_0x4b84,0x1cc));var _0x44b8=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0x4b84[_0x4709c0];return _0x13348b;};'use strict';var db=require(_0x44b8('0x0'))['db'];var config=require(_0x44b8('0x1'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require('../../config/license/util');var encryptor=require(_0x44b8('0x2'));var _=require('lodash');var jwt=require('jsonwebtoken');var expressJwt=require(_0x44b8('0x3'));var compose=require(_0x44b8('0x4'));var basicAuth=require(_0x44b8('0x5'));var crypto=require('crypto');var BPromise=require('bluebird');var util=require('util');var moment=require(_0x44b8('0x6'));var validateJwt=expressJwt({'secret':config['secrets'][_0x44b8('0x7')]});var userAttributes=['id','role',_0x44b8('0x8'),'name','internal',_0x44b8('0x9'),_0x44b8('0xa'),_0x44b8('0xb'),'md5secret',_0x44b8('0xc'),_0x44b8('0xd'),_0x44b8('0xe'),_0x44b8('0xf'),_0x44b8('0x10'),_0x44b8('0x11'),_0x44b8('0x12'),'showWebBar',_0x44b8('0x13'),_0x44b8('0x14'),'crudPermissions',_0x44b8('0x15'),'passwordResetAt',_0x44b8('0x16'),_0x44b8('0x17'),'phoneBarAutoAnswerDelay',_0x44b8('0x18'),'phoneBarEnableRecording','phoneBarEnableDtmfTone',_0x44b8('0x19'),_0x44b8('0x1a'),_0x44b8('0x1b'),_0x44b8('0x1c'),'phoneBarRemoteControlPort','hotdesk','interface',_0x44b8('0x1d'),'privacyEnabled',_0x44b8('0x1e'),_0x44b8('0x1f'),'downloadVoiceRecordings',_0x44b8('0x20'),_0x44b8('0x21'),'ignorePauseForPreviewCalls',_0x44b8('0x22'),_0x44b8('0x23'),'chatAutoanswerDelay',_0x44b8('0x24'),_0x44b8('0x25'),_0x44b8('0x26'),_0x44b8('0x27'),_0x44b8('0x28'),_0x44b8('0x29'),_0x44b8('0x2a'),_0x44b8('0x2b'),_0x44b8('0x2c'),_0x44b8('0x2d')];exports[_0x44b8('0x2e')]=function(){return this[_0x44b8('0x2f')](!![])['use'](function(_0x56549a,_0x3a8aa4,_0x416b34){if(_0x56549a[_0x44b8('0x30')]){_0x416b34();}else{return db[_0x44b8('0x31')]['findOne']({'where':{'id':_0x56549a[_0x44b8('0x32')]['id']},'attributes':['id','closed',_0x44b8('0x33')],'raw':!![]})[_0x44b8('0x34')](function(_0x25a0c1){if(_0x25a0c1&&_0x25a0c1[_0x44b8('0x35')]){return _0x3a8aa4[_0x44b8('0x36')](_0x25a0c1['disposition']===_0x44b8('0x37')?0x195:0x193)['json']({'message':_0x25a0c1[_0x44b8('0x33')]===_0x44b8('0x37')?'Unmanaged.':_0x44b8('0x38')});}else{_0x416b34();}})[_0x44b8('0x39')](function(_0x2656d7){_0x416b34(_0x2656d7);});}});};exports['isAuthenticated']=function isAuthenticated(_0xb22107){return compose()[_0x44b8('0x3a')](function(_0x53d9c7,_0x2e0174,_0x4a182d){var _0xfb0028;if(_0x53d9c7['headers']['authorization']){if(_['startsWith'](_0x53d9c7[_0x44b8('0x3b')][_0x44b8('0x3c')],_0x44b8('0x3d'))){var _0x1bd1be=basicAuth(_0x53d9c7);db[_0x44b8('0x3e')][_0x44b8('0x3f')]({'where':{'name':_0x1bd1be[_0x44b8('0x40')]}})[_0x44b8('0x34')](function(_0xd1d320){if(!_0xd1d320||!_0xd1d320[_0x44b8('0x41')](_0x1bd1be[_0x44b8('0x42')])){return _0x2e0174[_0x44b8('0x36')](0x191)[_0x44b8('0x43')]({'message':'Wrong\x20credentials.'});}_0x53d9c7[_0x44b8('0x30')]={'id':_0xd1d320['id']};_0x4a182d();})['catch'](function(_0x212983){_0x4a182d(_0x212983);});}else if(_[_0x44b8('0x44')](_0x53d9c7[_0x44b8('0x3b')][_0x44b8('0x3c')],_0x44b8('0x45'))){validateJwt(_0x53d9c7,_0x2e0174,_0x4a182d);}else{if(_0xb22107){_0x4a182d();}else{return _0x2e0174['status'](0x193)[_0x44b8('0x43')]({'message':_0x44b8('0x46')});}}}else if(_0x53d9c7[_0x44b8('0x47')][_0x44b8('0x48')]){try{var _0x46b008={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x44b8('0x49')]()};verifyJwt(_0x53d9c7[_0x44b8('0x47')][_0x44b8('0x48')],_0x46b008)[_0x44b8('0x34')](function(_0x140a79){return db[_0x44b8('0x3e')][_0x44b8('0x3f')]({'where':{'id':_0x140a79[_0x44b8('0x4a')]}})[_0x44b8('0x34')](function(_0x181761){_0xfb0028=_0x181761;return db[_0x44b8('0x4b')][_0x44b8('0x4c')]({'where':{'id':0x1},'attributes':[_0x44b8('0x4d'),_0x44b8('0x4e')],'raw':!![]});})[_0x44b8('0x34')](function(_0x1becb0){if(!_0xfb0028||!_[_0x44b8('0x4f')](_0xfb0028[_0x44b8('0x50')],_0x140a79[_0x44b8('0x51')])){return _0x2e0174[_0x44b8('0x36')](0x191)[_0x44b8('0x43')]({'message':_0x44b8('0x52')});}if(_0xfb0028['disabled']){return _0x2e0174[_0x44b8('0x36')](0x191)[_0x44b8('0x43')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0xfb0028[_0x44b8('0x53')]){if(_0x1becb0[_0x44b8('0x4e')]>0x0){if(moment(_0xfb0028[_0x44b8('0x54')])[_0x44b8('0x55')](_0x1becb0['blockDuration'],_0x44b8('0x56'))>moment()){return _0x2e0174[_0x44b8('0x36')](0x191)[_0x44b8('0x43')]({'message':_0x44b8('0x57')});}}else{return _0x2e0174[_0x44b8('0x36')](0x191)[_0x44b8('0x43')]({'message':_0x44b8('0x57')});}}_0x53d9c7[_0x44b8('0x30')]={'id':_0xfb0028['id']};_0x4a182d();});})[_0x44b8('0x39')](function(){return _0x2e0174[_0x44b8('0x36')](0x191)[_0x44b8('0x43')]({'message':_0x44b8('0x57')});});}catch(_0xd69398){_0x4a182d(_0xd69398);}}else if(_0xb22107){_0x4a182d();}else{return _0x2e0174[_0x44b8('0x36')](0x193)[_0x44b8('0x43')]({'message':_0x44b8('0x46')});}})['use'](function(_0x12a0a4,_0x43e43a,_0xbf444f){if(_0x12a0a4['user']){db[_0x44b8('0x3e')][_0x44b8('0x3f')]({'where':{'id':_0x12a0a4[_0x44b8('0x30')]['id']},'attributes':userAttributes})['then'](function(_0xbad4bb){if(!_0xbad4bb){return _0x43e43a[_0x44b8('0x36')](0x194)[_0x44b8('0x43')]({'message':_0x44b8('0x58')});}_0x12a0a4[_0x44b8('0x30')]=_0xbad4bb;_0xbf444f();})['catch'](function(_0x5ae5f9){_0xbf444f(_0x5ae5f9);});}else if(_0xb22107){_0xbf444f();}else{return _0x43e43a[_0x44b8('0x36')](0x194)[_0x44b8('0x43')]({'message':_0x44b8('0x59')});}});};exports[_0x44b8('0x5a')]=function canUpdate(){return compose()[_0x44b8('0x3a')](function(_0x26e1f1,_0x3fc41b,_0x457348){return licenseUtil[_0x44b8('0x5b')]()[_0x44b8('0x34')](function(_0x197782){if(_0x197782[_0x44b8('0x5c')]){_0x457348();}else{return _0x3fc41b[_0x44b8('0x36')](0x193)[_0x44b8('0x43')]({'message':_0x44b8('0x5d')});}})[_0x44b8('0x39')](function(_0xce06dc){_0x457348(_0xce06dc);});});};exports[_0x44b8('0x5e')]=function isWebrtcLicence(){return compose()[_0x44b8('0x3a')](function(_0x49c507,_0x547dc1,_0x3b1b12){return licenseUtil[_0x44b8('0x5b')]()[_0x44b8('0x34')](function(_0x269284){if(_0x269284[_0x44b8('0x5f')]){_0x3b1b12();}else{return _0x547dc1[_0x44b8('0x36')](0x193)[_0x44b8('0x43')]({'message':'Forbidden'});}})[_0x44b8('0x39')](function(_0x53edca){_0x3b1b12(_0x53edca);});});};exports[_0x44b8('0x60')]=function(_0x3ef886,_0x1dbc28,_0x9207bf){_0x3ef886[_0x44b8('0x60')]=!![];return _0x9207bf();};exports[_0x44b8('0x61')]=function signToken(_0x491600){return signJwt(_0x491600);};exports[_0x44b8('0x62')]=function(_0xff92fb,_0x10602c){if(!_0xff92fb[_0x44b8('0x30')]){return _0x10602c['status'](0x194)[_0x44b8('0x43')]({'message':_0x44b8('0x63')});}var _0x36afa9={'payload':{'id':_0xff92fb[_0x44b8('0x30')]['id'],'role':_0xff92fb[_0x44b8('0x30')][_0x44b8('0x64')]},'options':{'expiresIn':0x15180}};return signJwt(_0x36afa9)['then'](function(_0x19d95d){_0x10602c[_0x44b8('0x65')](_0x44b8('0x66'),_0x19d95d);_0x10602c[_0x44b8('0x67')](_0x44b8('0x68'));})['catch'](function(_0x493840){return _0x10602c[_0x44b8('0x36')](0x1f4)['send'](_0x493840);});};exports[_0x44b8('0x69')]=function(_0x5785ef){if(_[_0x44b8('0x6a')](_0x5785ef[_0x44b8('0x50')])||_[_0x44b8('0x6a')](_0x5785ef[_0x44b8('0x6b')])){return null;}else{return createJwt(_0x5785ef);}};exports[_0x44b8('0x6c')]=function(_0x32f588){_0x32f588[_0x44b8('0x50')]=generateNonce();_0x32f588['apiKeyIat']=generateIssuedAt();return createJwt(_0x32f588);};exports[_0x44b8('0x6d')]=function(_0x37b2c2,_0x1e6a5e){var _0x492be6=_0x37b2c2[_0x44b8('0x47')][_0x44b8('0x48')];if(_0x492be6){var _0x45f9a0={'nonce':_0x1e6a5e[_0x44b8('0x50')],'iat':_0x1e6a5e['apiKeyIat'],'audience':hardwareConf[_0x44b8('0x49')](),'issuer':hardwareConf[_0x44b8('0x49')]()};return verifyJwt(_0x492be6,_0x45f9a0)['then'](function(){return generateApiKey(_0x1e6a5e);});}else{throw{'message':_0x44b8('0x6e')};}};exports[_0x44b8('0x6f')]=function(_0x35136e){var _0x3df6aa=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x3df6aa[_0x44b8('0x70')](_0x35136e))throw new db['Sequelize']['ValidationError'](_0x44b8('0x71'));return;};exports[_0x44b8('0x72')]=function(_0xa30834,_0x4358aa,_0x765e45){var _0x3f6b92=encryptor[_0x44b8('0x73')](_0x4358aa)[_0x44b8('0x74')](',');for(var _0x10bbd9=0x0;_0x10bbd9<_0x765e45;_0x10bbd9++){if(!_0x3f6b92[_0x10bbd9])break;if(_0xa30834[_0x44b8('0x75')]()===_0x3f6b92[_0x10bbd9][_0x44b8('0x75')]()){var _0x3f7576=util['format'](_0x44b8('0x76'),_0x765e45);if(_0x765e45===0x1){_0x3f7576=_0x44b8('0x77');}throw new db[(_0x44b8('0x78'))][(_0x44b8('0x79'))](_0x3f7576);}}return;};exports[_0x44b8('0x7a')]=function(_0x1df915,_0x426a6a){var _0x172ff3=_0x426a6a?encryptor[_0x44b8('0x73')](_0x426a6a)[_0x44b8('0x74')](','):[];if(_0x172ff3[_0x44b8('0x7b')]===0x5){_0x172ff3[_0x44b8('0x7c')](-0x1,0x1);}_0x172ff3[_0x44b8('0x7d')](_0x1df915);return encryptor[_0x44b8('0x7e')](_0x172ff3[_0x44b8('0x7f')](','));};function signJwt(_0x293c2e){var _0x25f91c=BPromise[_0x44b8('0x80')](jwt['sign'],{'context':jwt});var _0x1ec516=_0x293c2e[_0x44b8('0x81')]||config[_0x44b8('0x82')][_0x44b8('0x7')];return new BPromise(function(_0x51f763,_0x29ed5d){_0x25f91c(_0x293c2e[_0x44b8('0x83')],_0x1ec516,_0x293c2e['options'])[_0x44b8('0x34')](function(_0xc4d667){_0x51f763(_0xc4d667);})['catch'](function(_0x2a95f6){_0x29ed5d(_0x2a95f6);});});}function verifyJwt(_0x3354bd,_0x520929,_0x37e42e){var _0x454fe6=BPromise[_0x44b8('0x80')](jwt['verify'],{'context':jwt});var _0x16e790=_0x37e42e||config['secrets'][_0x44b8('0x7')];return new BPromise(function(_0x5161ea,_0x176536){_0x454fe6(_0x3354bd,_0x16e790,_0x520929)[_0x44b8('0x34')](function(_0xf4d81f){_0x5161ea(_0xf4d81f);})[_0x44b8('0x39')](function(_0x3c6aad){_0x176536(_0x3c6aad);});});}function generateNonce(){return crypto[_0x44b8('0x84')](0x10)['toString'](_0x44b8('0x85'));}function generateIssuedAt(){return Math['floor'](Date[_0x44b8('0x86')]()/0x3e8)[_0x44b8('0x87')]();}function createJwt(_0x4c1a7c){var _0x3f9438={'payload':{'iat':_0x4c1a7c[_0x44b8('0x6b')],'nonce':_0x4c1a7c[_0x44b8('0x50')]},'options':{'algorithm':_0x44b8('0x88'),'subject':_0x4c1a7c['id'][_0x44b8('0x87')](),'issuer':hardwareConf[_0x44b8('0x49')](),'audience':hardwareConf[_0x44b8('0x49')]()}};return signJwt(_0x3f9438)[_0x44b8('0x34')](function(_0x3f9102){return{'iat':_0x4c1a7c[_0x44b8('0x6b')],'nonce':_0x4c1a7c[_0x44b8('0x50')],'token':_0x3f9102};});} \ No newline at end of file diff --git a/server/components/contacts/index.js b/server/components/contacts/index.js index f12a99f..de05325 100644 --- a/server/components/contacts/index.js +++ b/server/components/contacts/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7ad9=['findAll','skipContactsQuery','resolve','getContactsSubquery','then','search','parseAdvancedSearchFilter','parseQueryParameters','where','default','fields','filter','user','clause','tags','skip','checkListsRestrictions','ids','tag','countFilteredContacts','count','User','buildContactsQuery','getFilteredContacts','describe','CmContact','keys','startsWith','map','CmCustomField','findOne','slice','all','length','cf_','type','catch','lodash','./sql-utils','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7ad9,0x75));var _0x97ad=function(_0x272699,_0x373874){_0x272699=_0x272699-0x0;var _0x1ec458=_0x7ad9[_0x272699];return _0x1ec458;};'use strict';var _=require(_0x97ad('0x0'));var sqlUtils=require(_0x97ad('0x1'));var db=require(_0x97ad('0x2'))['db'];exports[_0x97ad('0x3')]=function(_0x38ac82,_0x3187bf,_0xc13eb7,_0x3b669f){var _0x1cbfa6={'count':0x0,'rows':[]};var _0xa252fc=sqlUtils[_0x97ad('0x4')](_0x3187bf,_0x38ac82);if(_0xa252fc){return Promise[_0x97ad('0x5')](_0x1cbfa6);}var _0x30de7d=sqlUtils[_0x97ad('0x6')]();var _0x5acb17={};var _0x37d8be=![];var _0x8dbeb0=![];return Promise[_0x97ad('0x5')]()[_0x97ad('0x7')](function(){if(_0x38ac82[_0x97ad('0x8')]){return sqlUtils[_0x97ad('0x9')](_0x38ac82['search'],_0x3b669f);}else{return sqlUtils[_0x97ad('0xa')](_0x38ac82,_0x3b669f);}})[_0x97ad('0x7')](function(_0x2f8b70){_0x30de7d[_0x97ad('0xb')](_0x2f8b70[_0x97ad('0xc')]);_0x30de7d[_0x97ad('0xb')](_0x2f8b70[_0x97ad('0xd')]);_0x30de7d['where'](_0x2f8b70[_0x97ad('0xe')]);_0x30de7d['where'](_0x2f8b70[_0x97ad('0xf')][_0x97ad('0x10')]);_0x5acb17=_0x2f8b70[_0x97ad('0x11')];_0x8dbeb0=_0x2f8b70[_0x97ad('0xf')][_0x97ad('0x12')];return sqlUtils[_0x97ad('0x13')](_0x3187bf,_0x38ac82,_0x8dbeb0);})[_0x97ad('0x7')](function(_0xf37bf3){_0x30de7d[_0x97ad('0xb')](_0xf37bf3);var _0x5a511e=_0x38ac82['search']?_0x5acb17[_0x97ad('0x14')]:_0x38ac82[_0x97ad('0x15')];_0x37d8be=_0x5a511e?!![]:![];return sqlUtils[_0x97ad('0x16')](_0x30de7d,_0x5a511e);})[_0x97ad('0x7')](function(_0x2954d2){_0x1cbfa6[_0x97ad('0x17')]=_0x2954d2;if(_0x1cbfa6[_0x97ad('0x17')]===0x0){return;}if(_0x38ac82[_0x97ad('0x18')]){_0x8dbeb0=!![];}return sqlUtils[_0x97ad('0x19')](_0x30de7d,_0x38ac82['fields'],_0xc13eb7,_0x37d8be,_0x5acb17[_0x97ad('0x10')],_0x8dbeb0);})['then'](function(_0x3e1fe7){if(!_0x3e1fe7){return[];}return sqlUtils[_0x97ad('0x1a')](_0x3e1fe7,_0x38ac82,_0xc13eb7);})[_0x97ad('0x7')](function(_0x361d05){_0x1cbfa6['rows']=_0x361d05;return _0x1cbfa6;})['catch'](function(_0x239340){throw _0x239340;});};exports[_0x97ad('0x1b')]=function(){var _0x23cf7f={};var _0x5d2371=[];return db[_0x97ad('0x1c')][_0x97ad('0x1b')]()[_0x97ad('0x7')](function(_0x1cb9f7){_0x23cf7f=_0x1cb9f7;var _0x4760da=Object[_0x97ad('0x1d')](_0x23cf7f)[_0x97ad('0xe')](function(_0x41312b){return _[_0x97ad('0x1e')](_0x41312b,'cf_')?_0x41312b:undefined;});var _0x86633c=_0x4760da[_0x97ad('0x1f')](function(_0x2c944c){return db[_0x97ad('0x20')][_0x97ad('0x21')]({'where':{'id':_0x2c944c[_0x97ad('0x22')](0x3)},'raw':!![]});});return Promise[_0x97ad('0x23')](_0x86633c);})[_0x97ad('0x7')](function(_0x1691fb){for(var _0x3669c4=0x0;_0x3669c4<_0x1691fb[_0x97ad('0x24')];_0x3669c4++){if(_0x1691fb[_0x3669c4]){var _0x3abf1a=_0x97ad('0x25')+_0x1691fb[_0x3669c4]['id'];_0x23cf7f[_0x3abf1a]['fieldType']=_0x1691fb[_0x3669c4][_0x97ad('0x26')];}}_0x5d2371=_[_0x97ad('0x1f')](Object[_0x97ad('0x1d')](_0x23cf7f),function(_0x29ebb9){return{'name':_0x29ebb9,'type':_0x23cf7f[_0x29ebb9][_0x97ad('0x26')]};});return _0x5d2371;})[_0x97ad('0x27')](function(_0x347c16){throw _0x347c16;});}; \ No newline at end of file +var _0x70fb=['getContactsSubquery','then','search','parseQueryParameters','default','where','fields','clause','tags','skip','ids','tag','countFilteredContacts','count','buildContactsQuery','getFilteredContacts','rows','catch','describe','keys','filter','startsWith','cf_','findOne','slice','all','length','type','map','lodash','./sql-utils','../../mysqldb','findAll','skipContactsQuery','resolve'];(function(_0x24867b,_0x310183){var _0x44afbc=function(_0x272acf){while(--_0x272acf){_0x24867b['push'](_0x24867b['shift']());}};_0x44afbc(++_0x310183);}(_0x70fb,0xcc));var _0xb70f=function(_0x1fbf82,_0x5a47f3){_0x1fbf82=_0x1fbf82-0x0;var _0x2374a5=_0x70fb[_0x1fbf82];return _0x2374a5;};'use strict';var _=require(_0xb70f('0x0'));var sqlUtils=require(_0xb70f('0x1'));var db=require(_0xb70f('0x2'))['db'];exports[_0xb70f('0x3')]=function(_0x473800,_0x5bdbbd,_0x64f2d0,_0x1043cc){var _0x4d4d54={'count':0x0,'rows':[]};var _0x38161f=sqlUtils[_0xb70f('0x4')](_0x5bdbbd,_0x473800);if(_0x38161f){return Promise[_0xb70f('0x5')](_0x4d4d54);}var _0x44864c=sqlUtils[_0xb70f('0x6')]();var _0x416b73={};var _0x1ce515=![];var _0x1f5c1c=![];return Promise[_0xb70f('0x5')]()[_0xb70f('0x7')](function(){if(_0x473800[_0xb70f('0x8')]){return sqlUtils['parseAdvancedSearchFilter'](_0x473800[_0xb70f('0x8')],_0x1043cc);}else{return sqlUtils[_0xb70f('0x9')](_0x473800,_0x1043cc);}})[_0xb70f('0x7')](function(_0x291ebf){_0x44864c['where'](_0x291ebf[_0xb70f('0xa')]);_0x44864c[_0xb70f('0xb')](_0x291ebf[_0xb70f('0xc')]);_0x44864c[_0xb70f('0xb')](_0x291ebf['filter']);_0x44864c['where'](_0x291ebf['user'][_0xb70f('0xd')]);_0x416b73=_0x291ebf[_0xb70f('0xe')];_0x1f5c1c=_0x291ebf['user'][_0xb70f('0xf')];return sqlUtils['checkListsRestrictions'](_0x5bdbbd,_0x473800,_0x1f5c1c);})[_0xb70f('0x7')](function(_0x157a2a){_0x44864c[_0xb70f('0xb')](_0x157a2a);var _0x18b814=_0x473800['search']?_0x416b73[_0xb70f('0x10')]:_0x473800[_0xb70f('0x11')];_0x1ce515=_0x18b814?!![]:![];return sqlUtils[_0xb70f('0x12')](_0x44864c,_0x18b814);})[_0xb70f('0x7')](function(_0x23bbe8){_0x4d4d54['count']=_0x23bbe8;if(_0x4d4d54[_0xb70f('0x13')]===0x0){return;}if(_0x473800['User']){_0x1f5c1c=!![];}return sqlUtils[_0xb70f('0x14')](_0x44864c,_0x473800['fields'],_0x64f2d0,_0x1ce515,_0x416b73[_0xb70f('0xd')],_0x1f5c1c);})[_0xb70f('0x7')](function(_0x380362){if(!_0x380362){return[];}return sqlUtils[_0xb70f('0x15')](_0x380362,_0x473800,_0x64f2d0);})[_0xb70f('0x7')](function(_0x561011){_0x4d4d54[_0xb70f('0x16')]=_0x561011;return _0x4d4d54;})[_0xb70f('0x17')](function(_0x2f3178){throw _0x2f3178;});};exports[_0xb70f('0x18')]=function(){var _0x2e139c={};var _0x31e803=[];return db['CmContact'][_0xb70f('0x18')]()[_0xb70f('0x7')](function(_0x3ee190){_0x2e139c=_0x3ee190;var _0x4c172f=Object[_0xb70f('0x19')](_0x2e139c)[_0xb70f('0x1a')](function(_0x16f3f1){return _[_0xb70f('0x1b')](_0x16f3f1,_0xb70f('0x1c'))?_0x16f3f1:undefined;});var _0x5ca200=_0x4c172f['map'](function(_0x5a3680){return db['CmCustomField'][_0xb70f('0x1d')]({'where':{'id':_0x5a3680[_0xb70f('0x1e')](0x3)},'raw':!![]});});return Promise[_0xb70f('0x1f')](_0x5ca200);})[_0xb70f('0x7')](function(_0x26207b){for(var _0x1fbba4=0x0;_0x1fbba4<_0x26207b[_0xb70f('0x20')];_0x1fbba4++){if(_0x26207b[_0x1fbba4]){var _0x3569ae='cf_'+_0x26207b[_0x1fbba4]['id'];_0x2e139c[_0x3569ae]['fieldType']=_0x26207b[_0x1fbba4][_0xb70f('0x21')];}}_0x31e803=_[_0xb70f('0x22')](Object[_0xb70f('0x19')](_0x2e139c),function(_0x545d1a){return{'name':_0x545d1a,'type':_0x2e139c[_0x545d1a]['type']};});return _0x31e803;})[_0xb70f('0x17')](function(_0x24d38a){throw _0x24d38a;});}; \ No newline at end of file diff --git a/server/components/contacts/sql-utils.js b/server/components/contacts/sql-utils.js index 9174952..811a723 100644 --- a/server/components/contacts/sql-utils.js +++ b/server/components/contacts/sql-utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a0d=['isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','sqlOperator','conditions','find','dateOfBirth','fieldType','datetime','castTo','DATE','buildExpression','type','default','value','start','map','clause','and','tags','ids','user','uc.UserId\x20=\x20?','skip','keys','some','name','compact','Contact','User','length','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','then','fields','tag','filter','resolve','getLists','c.ListId\x20IS\x20NULL','attributes','select','group','c.id','limit','offset','having','order','subqry.','DESC','Tag','findAll','color','Sequelize','SELECT','CmContact','query','toString','Tags','clone','COUNT(*)','isEmpty','t.id\x20IN\x20?','QueryTypes','sequelize','exports','squel','../parsers/advancedSearch','../parsers/qs','../interaction/utils','../../mysqldb','role','agent','search','ListId','autocomplete','true','from','cm_contacts','where','c.deletedAt\x20IS\x20NULL','subqry','left_join','uc.CmContactId\x20=\x20','.id','cm_contact_has_tags','ct.CmContactId\x20=\x20','tools_tags','t.id\x20=\x20ct.TagId','lastName','phone','mobile','fax','email','deletedAt','includes','push','forEach','TagIds','field','expr','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.mobile\x20LIKE\x20?'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0x7a0d,0x18e));var _0xd7a0=function(_0x310dc2,_0x2299c4){_0x310dc2=_0x310dc2-0x0;var _0x24980f=_0x7a0d[_0x310dc2];return _0x24980f;};'use strict';var _=require('lodash');var squel=require(_0xd7a0('0x0'));var as=require(_0xd7a0('0x1'));var qs=require(_0xd7a0('0x2'));var utils=require(_0xd7a0('0x3'));var db=require(_0xd7a0('0x4'))['db'];function skipContactsQuery(_0x18ea8c,_0x23b594){var _0x42dfe1=![];if(_0x18ea8c[_0xd7a0('0x5')]===_0xd7a0('0x6')&&!_0x23b594[_0xd7a0('0x7')]&&!_0x23b594[_0xd7a0('0x8')]&&_0x23b594[_0xd7a0('0x9')]!==_0xd7a0('0xa')){_0x42dfe1=!![];}return _0x42dfe1;}function getContactsSubquery(){return squel['select']()[_0xd7a0('0xb')](_0xd7a0('0xc'),'c')[_0xd7a0('0xd')](_0xd7a0('0xe'));}function applyJoinClauses(_0x31c6ac,_0x464d34){var _0x2d1010=_0x464d34?'c':_0xd7a0('0xf');_0x31c6ac[_0xd7a0('0x10')]('cm_user_has_contacts','uc',_0xd7a0('0x11')+_0x2d1010+_0xd7a0('0x12'))[_0xd7a0('0x10')](_0xd7a0('0x13'),'ct',_0xd7a0('0x14')+_0x2d1010+_0xd7a0('0x12'))[_0xd7a0('0x10')](_0xd7a0('0x15'),'t',_0xd7a0('0x16'));return _0x31c6ac;}function addFieldsToQuery(_0x147cfa,_0x213f9,_0x4a1db1,_0x5d0663,_0x17aa9){var _0x4c489c=_0x17aa9?'c':_0xd7a0('0xf');if(!_0x213f9){_0x213f9=['id','firstName',_0xd7a0('0x17'),_0xd7a0('0x18'),_0xd7a0('0x19'),_0xd7a0('0x1a'),_0xd7a0('0x1b'),_0xd7a0('0x8'),'CompanyId','createdAt','updatedAt',_0xd7a0('0x1c'),'TagIds'];}else if(!_0x213f9[_0xd7a0('0x1d')]('id')){_0x213f9[_0xd7a0('0x1e')]('id');}var _0x3ad779=_0x4a1db1&&_0x17aa9||!_0x4a1db1&&!_0x17aa9;if(_0x5d0663){_0x3ad779=_0x5d0663&&_0x17aa9||!_0x5d0663&&!_0x17aa9;}_0x213f9[_0xd7a0('0x1f')](function(_0x2ba801){if(_0x2ba801===_0xd7a0('0x20')){if(_0x3ad779){_0x147cfa['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0x2ba801);}else if(_0x4a1db1||_0x5d0663){_0x147cfa[_0xd7a0('0x21')](_0x4c489c+'.'+_0x2ba801);}}else{_0x147cfa[_0xd7a0('0x21')](_0x4c489c+'.'+_0x2ba801);}});return _0x147cfa;}function getSqlClauses(){var _0x1e1ef5={'default':squel[_0xd7a0('0x22')](),'fields':squel['expr'](),'filter':squel[_0xd7a0('0x22')](),'tags':{'clause':squel[_0xd7a0('0x22')](),'ids':null},'user':{'clause':squel[_0xd7a0('0x22')](),'skip':![]}};return _0x1e1ef5;}function parseTagParameter(_0x12fc08){var _0x7c8ecf=squel[_0xd7a0('0x22')]();if(_0x12fc08){var _0x2953ef=utils['getSelectedTags'](_0x12fc08);_0x2953ef['forEach'](function(_0x184e84){_0x7c8ecf['or'](_0xd7a0('0x23'),'%,'+_0x184e84+',%');});}return _0x7c8ecf;}function parseSearchFilter(_0x4d7ddc){var _0x2f01b6=squel[_0xd7a0('0x22')]();if(_0x4d7ddc){var _0x9d6556=_0x4d7ddc[_0xd7a0('0x24')]('\x5c','\x5c\x5c')[_0xd7a0('0x24')](/'/g,'\x27\x27');if(_0x9d6556[_0xd7a0('0x25')]('\x20')['length']>0x1){_0x2f01b6['or'](_0xd7a0('0x26'),qs[_0xd7a0('0x27')](_0x9d6556,!![]),null);}else{if(qs[_0xd7a0('0x28')](_0x9d6556)){_0x2f01b6['or']('c.id\x20LIKE\x20?',_0x9d6556+'%');_0x2f01b6['or']('c.phone\x20LIKE\x20?',_0x9d6556+'%');_0x2f01b6['or'](_0xd7a0('0x29'),_0x9d6556+'%');_0x2f01b6['or']('c.fax\x20LIKE\x20?',_0x9d6556+'%');}else if(qs[_0xd7a0('0x2a')](_0x9d6556)){_0x2f01b6['or'](_0xd7a0('0x2b'),_0x9d6556+'%');}else{_0x2f01b6['or'](_0xd7a0('0x2c'),'%'+_0x9d6556+'%');_0x2f01b6['or'](_0xd7a0('0x2d'),'%'+_0x9d6556+'%');_0x2f01b6['or']('c.email\x20LIKE\x20?','%'+_0x9d6556+'%');}}}return _0x2f01b6;}function parseAdvancedSearchFilter(_0x6c80e2,_0x5dcd27){var _0x36f270=getSqlClauses();var _0xb5e668=as['parseSearch'](_0x6c80e2);var _0x271f78=_0xb5e668[_0xd7a0('0x2e')];for(var _0x4e3bc1=0x0;_0x4e3bc1<_0xb5e668['conditions']['length'];_0x4e3bc1++){var _0x80bd41=_0xb5e668[_0xd7a0('0x2f')][_0x4e3bc1];var _0x5a92a4='c';var _0x358c5d=_[_0xd7a0('0x30')](_0x5dcd27,['name',_0x80bd41['field']]);if(_0x358c5d){if(_0x80bd41[_0xd7a0('0x21')]===_0xd7a0('0x31')||_0x358c5d[_0xd7a0('0x32')]===_0xd7a0('0x33')){_0x80bd41[_0xd7a0('0x34')]=_0xd7a0('0x35');}var _0x391f22=as[_0xd7a0('0x36')](_0x5a92a4,_0x358c5d[_0xd7a0('0x37')],_0x80bd41);_0x36f270[_0xd7a0('0x38')][_0x271f78](_0x391f22['text'],_0x391f22[_0xd7a0('0x39')][_0xd7a0('0x3a')],_0x391f22[_0xd7a0('0x39')]['end']);}else{if(_0x80bd41[_0xd7a0('0x21')]==='Tag'){var _0x4199a0=_0x80bd41['value'][_0xd7a0('0x25')](',')[_0xd7a0('0x3b')](function(_0x48ce33){return Number(_0x48ce33);});var _0x4a46d2=parseTagParameter(_0x4199a0);_0x36f270['tags'][_0xd7a0('0x3c')][_0xd7a0('0x3d')](_0x4a46d2);_0x36f270[_0xd7a0('0x3e')][_0xd7a0('0x3f')]=_0x4199a0;}else if(_0x80bd41[_0xd7a0('0x21')]==='User'){_0x36f270[_0xd7a0('0x40')][_0xd7a0('0x3c')][_0xd7a0('0x3d')](_0xd7a0('0x41'),_0x80bd41[_0xd7a0('0x39')]);_0x36f270[_0xd7a0('0x40')][_0xd7a0('0x42')]=!![];}}}return _0x36f270;}function parseModelFields(_0x53e1c0,_0x326b8e){var _0x123f5d=squel['expr']();var _0x51e95e=_(_0x53e1c0)[_0xd7a0('0x43')]()['map'](function(_0x4990da){return _[_0xd7a0('0x44')](_0x326b8e,[_0xd7a0('0x45'),_0x4990da])?_0x4990da:undefined;})[_0xd7a0('0x46')]()[_0xd7a0('0x39')]();if(_0x53e1c0['Contact']){_0x51e95e[_0xd7a0('0x1e')](_0xd7a0('0x47'));}if(_0x53e1c0[_0xd7a0('0x48')]){_0x51e95e[_0xd7a0('0x1e')](_0xd7a0('0x48'));}if(_0x51e95e[_0xd7a0('0x49')]>0x0){_0x51e95e[_0xd7a0('0x1f')](function(_0x11a9bd){if(_0x11a9bd===_0xd7a0('0x8')){_0x123f5d[_0xd7a0('0x3d')]('c.ListId\x20IN\x20?',[][_0xd7a0('0x4a')](_0x53e1c0[_0x11a9bd]));}else if(_0x11a9bd==='Contact'){var _0x19ac55='%'+_0x53e1c0[_0x11a9bd]+'%';_0x123f5d[_0xd7a0('0x3d')](_0xd7a0('0x4b'),_0x19ac55);}else if(_0x11a9bd===_0xd7a0('0x48')){_0x123f5d[_0xd7a0('0x3d')](_0xd7a0('0x41'),_0x53e1c0[_0x11a9bd]);}else{_0x123f5d[_0xd7a0('0x3d')]('c.'+_0x11a9bd+_0xd7a0('0x4c'),_0x53e1c0[_0x11a9bd]);}});}return _0x123f5d;}function parseQueryParameters(_0x3dc492,_0x45a734){var _0x45cb11=getSqlClauses();return Promise['resolve']()['then'](function(){return parseModelFields(_0x3dc492,_0x45a734);})[_0xd7a0('0x4d')](function(_0x1b278f){_0x45cb11[_0xd7a0('0x4e')][_0xd7a0('0x3d')](_0x1b278f);return parseTagParameter(_0x3dc492[_0xd7a0('0x4f')]);})[_0xd7a0('0x4d')](function(_0x58c8f8){_0x45cb11['tags'][_0xd7a0('0x3c')][_0xd7a0('0x3d')](_0x58c8f8);return parseSearchFilter(_0x3dc492[_0xd7a0('0x50')]);})['then'](function(_0x1936d3){_0x45cb11['filter']=_0x1936d3;return _0x45cb11;});}function checkListsRestrictions(_0x112aac,_0x1caa6f,_0x47c1f0){var _0x3a07a6=squel[_0xd7a0('0x22')]();return Promise[_0xd7a0('0x51')]()[_0xd7a0('0x4d')](function(){if(_0x1caa6f[_0xd7a0('0x7')]&&_0x112aac[_0xd7a0('0x5')]===_0xd7a0('0x6')&&!_0x47c1f0){return _0x112aac[_0xd7a0('0x52')]({'attributes':['id'],'raw':!![]});}})['then'](function(_0xb250ed){if(_0xb250ed){if(_0xb250ed[_0xd7a0('0x49')]===0x0){_0x3a07a6['and'](_0xd7a0('0x53'));}else{_0x3a07a6[_0xd7a0('0x3d')]('c.ListId\x20IN\x20?',_['map'](_0xb250ed,'id'));}}})['then'](function(){return _0x3a07a6;});}function buildContactsQuery(_0x310f48,_0x41e7b0,_0x198545,_0x6dcf14,_0x5577a1,_0x164c37){if(_0x41e7b0){_0x41e7b0=_0x198545[_0xd7a0('0x54')];}_0x310f48=addFieldsToQuery(_0x310f48,_0x41e7b0,_0x6dcf14,_0x164c37,!![]);var _0x551afb=squel[_0xd7a0('0x55')]();_0x551afb=addFieldsToQuery(_0x551afb,_0x41e7b0,_0x6dcf14,_0x164c37,![]);if(_0x6dcf14||_0x164c37){_0x310f48=applyJoinClauses(_0x310f48,!![]);_0x310f48[_0xd7a0('0x56')](_0xd7a0('0x57'));if(_0x198545[_0xd7a0('0x58')]){_0x551afb[_0xd7a0('0x58')](_0x198545[_0xd7a0('0x58')]);}if(_0x198545[_0xd7a0('0x59')]){_0x551afb['offset'](_0x198545['offset']);}}else{_0x551afb=applyJoinClauses(_0x551afb,![]);_0x551afb[_0xd7a0('0x56')]('subqry.id');if(_0x198545[_0xd7a0('0x58')]){_0x310f48[_0xd7a0('0x58')](_0x198545['limit']);}if(_0x198545[_0xd7a0('0x59')]){_0x310f48[_0xd7a0('0x59')](_0x198545[_0xd7a0('0x59')]);}}_0x551afb[_0xd7a0('0x5a')](_0x5577a1);if(_0x198545['order']){_0x198545[_0xd7a0('0x5b')][_0xd7a0('0x1f')](function(_0x16dded){_0x310f48['order']('c.'+_0x16dded[0x0],_0x16dded[0x1]==='DESC'?![]:!![]);_0x551afb['order'](_0xd7a0('0x5c')+_0x16dded[0x0],_0x16dded[0x1]===_0xd7a0('0x5d')?![]:!![]);});}_0x551afb[_0xd7a0('0xb')](_0x310f48,_0xd7a0('0xf'));return _0x551afb;}function getFilteredContacts(_0x560ad2){var _0x3cce18=[];return db[_0xd7a0('0x5e')][_0xd7a0('0x5f')]({'attributes':['id',_0xd7a0('0x45'),_0xd7a0('0x60')],'raw':!![]})['then'](function(_0x1cf97d){_0x3cce18=_['keyBy'](_0x1cf97d,'id');var _0x527f63={'type':db[_0xd7a0('0x61')]['QueryTypes'][_0xd7a0('0x62')],'model':db[_0xd7a0('0x63')],'mapToModel':!![],'nest':!![],'raw':!![]};return db['sequelize'][_0xd7a0('0x64')](_0x560ad2[_0xd7a0('0x65')](),_0x527f63);})['then'](function(_0x5d0bbf){_0x5d0bbf[_0xd7a0('0x1f')](function(_0x3e8269){if(_0x3e8269['TagIds']){_0x3e8269[_0xd7a0('0x66')]=[];_0x3e8269[_0xd7a0('0x20')][_0xd7a0('0x25')](',')[_0xd7a0('0x1f')](function(_0x3e5f55){_0x3e8269[_0xd7a0('0x66')]['push'](_0x3cce18[_0x3e5f55]);});}delete _0x3e8269[_0xd7a0('0x20')];});return _0x5d0bbf;});}function countFilteredContacts(_0x24772f,_0x1bba7c){var _0x2b7c15=_0x24772f[_0xd7a0('0x67')]();_0x2b7c15[_0xd7a0('0x21')](_0xd7a0('0x68'));_0x2b7c15=applyJoinClauses(_0x2b7c15,!![]);_0x24772f['group'](_0xd7a0('0x57'));var _0x1bb0a4=utils['getSelectedTags'](_0x1bba7c);if(!_[_0xd7a0('0x69')](_0x1bb0a4)){_0x2b7c15[_0xd7a0('0xd')](_0xd7a0('0x6a'),_0x1bb0a4);}var _0x144a81={'type':db[_0xd7a0('0x61')][_0xd7a0('0x6b')][_0xd7a0('0x62')],'raw':!![]};return db[_0xd7a0('0x6c')]['query'](_0x2b7c15['toString'](),_0x144a81)[_0xd7a0('0x4d')](function(_0x45fe0b){return _0x45fe0b[0x0]['COUNT(*)'];});}module[_0xd7a0('0x6d')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file +var _0x9f2f=['parseSearch','sqlOperator','conditions','find','name','fieldType','datetime','DATE','buildExpression','type','default','start','value','end','Tag','map','clause','and','tags','ids','User','user','keys','some','compact','Contact','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','resolve','then','fields','getLists','c.ListId\x20IS\x20NULL','attributes','c.id','limit','offset','subqry.id','having','order','subqry.','DESC','color','keyBy','Sequelize','QueryTypes','SELECT','CmContact','query','toString','Tags','clone','COUNT(*)','isEmpty','sequelize','lodash','squel','../parsers/advancedSearch','../../mysqldb','role','ListId','autocomplete','true','select','from','cm_contacts','c.deletedAt\x20IS\x20NULL','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20','.id','cm_contact_has_tags','ct.CmContactId\x20=\x20','tools_tags','subqry','firstName','lastName','phone','mobile','fax','email','CompanyId','createdAt','deletedAt','TagIds','push','forEach','field','expr','getSelectedTags','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?'];(function(_0x50cb12,_0x5787c2){var _0x4baa4f=function(_0x277e4b){while(--_0x277e4b){_0x50cb12['push'](_0x50cb12['shift']());}};_0x4baa4f(++_0x5787c2);}(_0x9f2f,0xa0));var _0xf9f2=function(_0xf8b99,_0x1da4e6){_0xf8b99=_0xf8b99-0x0;var _0x20609a=_0x9f2f[_0xf8b99];return _0x20609a;};'use strict';var _=require(_0xf9f2('0x0'));var squel=require(_0xf9f2('0x1'));var as=require(_0xf9f2('0x2'));var qs=require('../parsers/qs');var utils=require('../interaction/utils');var db=require(_0xf9f2('0x3'))['db'];function skipContactsQuery(_0x18366c,_0x2bfd76){var _0x5e7456=![];if(_0x18366c[_0xf9f2('0x4')]==='agent'&&!_0x2bfd76['search']&&!_0x2bfd76[_0xf9f2('0x5')]&&_0x2bfd76[_0xf9f2('0x6')]!==_0xf9f2('0x7')){_0x5e7456=!![];}return _0x5e7456;}function getContactsSubquery(){return squel[_0xf9f2('0x8')]()[_0xf9f2('0x9')](_0xf9f2('0xa'),'c')['where'](_0xf9f2('0xb'));}function applyJoinClauses(_0x2ec73f,_0x16a77b){var _0x39cf68=_0x16a77b?'c':'subqry';_0x2ec73f[_0xf9f2('0xc')](_0xf9f2('0xd'),'uc',_0xf9f2('0xe')+_0x39cf68+_0xf9f2('0xf'))[_0xf9f2('0xc')](_0xf9f2('0x10'),'ct',_0xf9f2('0x11')+_0x39cf68+_0xf9f2('0xf'))[_0xf9f2('0xc')](_0xf9f2('0x12'),'t','t.id\x20=\x20ct.TagId');return _0x2ec73f;}function addFieldsToQuery(_0x33fda8,_0x1c4358,_0x413044,_0x1919ff,_0x201427){var _0x524fe9=_0x201427?'c':_0xf9f2('0x13');if(!_0x1c4358){_0x1c4358=['id',_0xf9f2('0x14'),_0xf9f2('0x15'),_0xf9f2('0x16'),_0xf9f2('0x17'),_0xf9f2('0x18'),_0xf9f2('0x19'),_0xf9f2('0x5'),_0xf9f2('0x1a'),_0xf9f2('0x1b'),'updatedAt',_0xf9f2('0x1c'),_0xf9f2('0x1d')];}else if(!_0x1c4358['includes']('id')){_0x1c4358[_0xf9f2('0x1e')]('id');}var _0x4da604=_0x413044&&_0x201427||!_0x413044&&!_0x201427;if(_0x1919ff){_0x4da604=_0x1919ff&&_0x201427||!_0x1919ff&&!_0x201427;}_0x1c4358[_0xf9f2('0x1f')](function(_0x3aecfe){if(_0x3aecfe===_0xf9f2('0x1d')){if(_0x4da604){_0x33fda8[_0xf9f2('0x20')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x3aecfe);}else if(_0x413044||_0x1919ff){_0x33fda8[_0xf9f2('0x20')](_0x524fe9+'.'+_0x3aecfe);}}else{_0x33fda8[_0xf9f2('0x20')](_0x524fe9+'.'+_0x3aecfe);}});return _0x33fda8;}function getSqlClauses(){var _0x154cb0={'default':squel[_0xf9f2('0x21')](),'fields':squel[_0xf9f2('0x21')](),'filter':squel[_0xf9f2('0x21')](),'tags':{'clause':squel[_0xf9f2('0x21')](),'ids':null},'user':{'clause':squel[_0xf9f2('0x21')](),'skip':![]}};return _0x154cb0;}function parseTagParameter(_0x44d0ce){var _0x2d7598=squel[_0xf9f2('0x21')]();if(_0x44d0ce){var _0x229bce=utils[_0xf9f2('0x22')](_0x44d0ce);_0x229bce[_0xf9f2('0x1f')](function(_0x595349){_0x2d7598['or'](_0xf9f2('0x23'),'%,'+_0x595349+',%');});}return _0x2d7598;}function parseSearchFilter(_0x3cdf16){var _0x255847=squel[_0xf9f2('0x21')]();if(_0x3cdf16){var _0x5ad9b6=_0x3cdf16[_0xf9f2('0x24')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(_0x5ad9b6[_0xf9f2('0x25')]('\x20')[_0xf9f2('0x26')]>0x1){_0x255847['or'](_0xf9f2('0x27'),qs['getFullTextValue'](_0x5ad9b6,!![]),null);}else{if(qs[_0xf9f2('0x28')](_0x5ad9b6)){_0x255847['or'](_0xf9f2('0x29'),_0x5ad9b6+'%');_0x255847['or'](_0xf9f2('0x2a'),_0x5ad9b6+'%');_0x255847['or']('c.mobile\x20LIKE\x20?',_0x5ad9b6+'%');_0x255847['or'](_0xf9f2('0x2b'),_0x5ad9b6+'%');}else if(qs[_0xf9f2('0x2c')](_0x5ad9b6)){_0x255847['or'](_0xf9f2('0x2d'),_0x5ad9b6+'%');}else{_0x255847['or'](_0xf9f2('0x2e'),'%'+_0x5ad9b6+'%');_0x255847['or'](_0xf9f2('0x2f'),'%'+_0x5ad9b6+'%');_0x255847['or'](_0xf9f2('0x2d'),'%'+_0x5ad9b6+'%');}}}return _0x255847;}function parseAdvancedSearchFilter(_0x85e92e,_0x4c3ec2){var _0x717db8=getSqlClauses();var _0x5ef978=as[_0xf9f2('0x30')](_0x85e92e);var _0x3c41d6=_0x5ef978[_0xf9f2('0x31')];for(var _0x219e75=0x0;_0x219e75<_0x5ef978['conditions'][_0xf9f2('0x26')];_0x219e75++){var _0x59aba2=_0x5ef978[_0xf9f2('0x32')][_0x219e75];var _0x3ecbcb='c';var _0x285a2f=_[_0xf9f2('0x33')](_0x4c3ec2,[_0xf9f2('0x34'),_0x59aba2[_0xf9f2('0x20')]]);if(_0x285a2f){if(_0x59aba2[_0xf9f2('0x20')]==='dateOfBirth'||_0x285a2f[_0xf9f2('0x35')]===_0xf9f2('0x36')){_0x59aba2['castTo']=_0xf9f2('0x37');}var _0x5d13e0=as[_0xf9f2('0x38')](_0x3ecbcb,_0x285a2f[_0xf9f2('0x39')],_0x59aba2);_0x717db8[_0xf9f2('0x3a')][_0x3c41d6](_0x5d13e0['text'],_0x5d13e0['value'][_0xf9f2('0x3b')],_0x5d13e0[_0xf9f2('0x3c')][_0xf9f2('0x3d')]);}else{if(_0x59aba2[_0xf9f2('0x20')]===_0xf9f2('0x3e')){var _0x4c1e81=_0x59aba2[_0xf9f2('0x3c')][_0xf9f2('0x25')](',')[_0xf9f2('0x3f')](function(_0x5ac06b){return Number(_0x5ac06b);});var _0x3c1d13=parseTagParameter(_0x4c1e81);_0x717db8['tags'][_0xf9f2('0x40')][_0xf9f2('0x41')](_0x3c1d13);_0x717db8[_0xf9f2('0x42')][_0xf9f2('0x43')]=_0x4c1e81;}else if(_0x59aba2[_0xf9f2('0x20')]===_0xf9f2('0x44')){_0x717db8[_0xf9f2('0x45')][_0xf9f2('0x40')]['and']('uc.UserId\x20=\x20?',_0x59aba2[_0xf9f2('0x3c')]);_0x717db8['user']['skip']=!![];}}}return _0x717db8;}function parseModelFields(_0x9917f8,_0x56ce75){var _0x2a71cc=squel[_0xf9f2('0x21')]();var _0x122ab4=_(_0x9917f8)[_0xf9f2('0x46')]()[_0xf9f2('0x3f')](function(_0x35f4c3){return _[_0xf9f2('0x47')](_0x56ce75,[_0xf9f2('0x34'),_0x35f4c3])?_0x35f4c3:undefined;})[_0xf9f2('0x48')]()['value']();if(_0x9917f8[_0xf9f2('0x49')]){_0x122ab4[_0xf9f2('0x1e')]('Contact');}if(_0x9917f8['User']){_0x122ab4[_0xf9f2('0x1e')](_0xf9f2('0x44'));}if(_0x122ab4['length']>0x0){_0x122ab4[_0xf9f2('0x1f')](function(_0x2d9e00){if(_0x2d9e00===_0xf9f2('0x5')){_0x2a71cc[_0xf9f2('0x41')]('c.ListId\x20IN\x20?',[][_0xf9f2('0x4a')](_0x9917f8[_0x2d9e00]));}else if(_0x2d9e00==='Contact'){var _0xbaf9bc='%'+_0x9917f8[_0x2d9e00]+'%';_0x2a71cc[_0xf9f2('0x41')](_0xf9f2('0x4b'),_0xbaf9bc);}else if(_0x2d9e00==='User'){_0x2a71cc['and']('uc.UserId\x20=\x20?',_0x9917f8[_0x2d9e00]);}else{_0x2a71cc[_0xf9f2('0x41')]('c.'+_0x2d9e00+_0xf9f2('0x4c'),_0x9917f8[_0x2d9e00]);}});}return _0x2a71cc;}function parseQueryParameters(_0xd38b40,_0x2cde90){var _0x285fb8=getSqlClauses();return Promise[_0xf9f2('0x4d')]()[_0xf9f2('0x4e')](function(){return parseModelFields(_0xd38b40,_0x2cde90);})[_0xf9f2('0x4e')](function(_0x523ef7){_0x285fb8[_0xf9f2('0x4f')][_0xf9f2('0x41')](_0x523ef7);return parseTagParameter(_0xd38b40['tag']);})[_0xf9f2('0x4e')](function(_0x37071a){_0x285fb8[_0xf9f2('0x42')][_0xf9f2('0x40')][_0xf9f2('0x41')](_0x37071a);return parseSearchFilter(_0xd38b40['filter']);})['then'](function(_0x16864d){_0x285fb8['filter']=_0x16864d;return _0x285fb8;});}function checkListsRestrictions(_0x735743,_0x1a6351,_0x428d8d){var _0x1ab3e9=squel[_0xf9f2('0x21')]();return Promise['resolve']()[_0xf9f2('0x4e')](function(){if(_0x1a6351['search']&&_0x735743['role']==='agent'&&!_0x428d8d){return _0x735743[_0xf9f2('0x50')]({'attributes':['id'],'raw':!![]});}})[_0xf9f2('0x4e')](function(_0xe29c08){if(_0xe29c08){if(_0xe29c08['length']===0x0){_0x1ab3e9[_0xf9f2('0x41')](_0xf9f2('0x51'));}else{_0x1ab3e9['and']('c.ListId\x20IN\x20?',_[_0xf9f2('0x3f')](_0xe29c08,'id'));}}})[_0xf9f2('0x4e')](function(){return _0x1ab3e9;});}function buildContactsQuery(_0x3e08db,_0x4a7dc5,_0x491b1b,_0x39c196,_0x38c477,_0x1bdbd5){if(_0x4a7dc5){_0x4a7dc5=_0x491b1b[_0xf9f2('0x52')];}_0x3e08db=addFieldsToQuery(_0x3e08db,_0x4a7dc5,_0x39c196,_0x1bdbd5,!![]);var _0x565f85=squel[_0xf9f2('0x8')]();_0x565f85=addFieldsToQuery(_0x565f85,_0x4a7dc5,_0x39c196,_0x1bdbd5,![]);if(_0x39c196||_0x1bdbd5){_0x3e08db=applyJoinClauses(_0x3e08db,!![]);_0x3e08db['group'](_0xf9f2('0x53'));if(_0x491b1b['limit']){_0x565f85[_0xf9f2('0x54')](_0x491b1b[_0xf9f2('0x54')]);}if(_0x491b1b[_0xf9f2('0x55')]){_0x565f85[_0xf9f2('0x55')](_0x491b1b['offset']);}}else{_0x565f85=applyJoinClauses(_0x565f85,![]);_0x565f85['group'](_0xf9f2('0x56'));if(_0x491b1b['limit']){_0x3e08db[_0xf9f2('0x54')](_0x491b1b[_0xf9f2('0x54')]);}if(_0x491b1b[_0xf9f2('0x55')]){_0x3e08db[_0xf9f2('0x55')](_0x491b1b['offset']);}}_0x565f85[_0xf9f2('0x57')](_0x38c477);if(_0x491b1b['order']){_0x491b1b[_0xf9f2('0x58')][_0xf9f2('0x1f')](function(_0x498514){_0x3e08db[_0xf9f2('0x58')]('c.'+_0x498514[0x0],_0x498514[0x1]==='DESC'?![]:!![]);_0x565f85['order'](_0xf9f2('0x59')+_0x498514[0x0],_0x498514[0x1]===_0xf9f2('0x5a')?![]:!![]);});}_0x565f85['from'](_0x3e08db,_0xf9f2('0x13'));return _0x565f85;}function getFilteredContacts(_0x536a46){var _0x3dab73=[];return db[_0xf9f2('0x3e')]['findAll']({'attributes':['id',_0xf9f2('0x34'),_0xf9f2('0x5b')],'raw':!![]})[_0xf9f2('0x4e')](function(_0x52c0b5){_0x3dab73=_[_0xf9f2('0x5c')](_0x52c0b5,'id');var _0x522c7e={'type':db[_0xf9f2('0x5d')][_0xf9f2('0x5e')][_0xf9f2('0x5f')],'model':db[_0xf9f2('0x60')],'mapToModel':!![],'nest':!![],'raw':!![]};return db['sequelize'][_0xf9f2('0x61')](_0x536a46[_0xf9f2('0x62')](),_0x522c7e);})[_0xf9f2('0x4e')](function(_0x4c62be){_0x4c62be[_0xf9f2('0x1f')](function(_0x4869c9){if(_0x4869c9[_0xf9f2('0x1d')]){_0x4869c9[_0xf9f2('0x63')]=[];_0x4869c9[_0xf9f2('0x1d')][_0xf9f2('0x25')](',')[_0xf9f2('0x1f')](function(_0x4c0391){_0x4869c9['Tags'][_0xf9f2('0x1e')](_0x3dab73[_0x4c0391]);});}delete _0x4869c9[_0xf9f2('0x1d')];});return _0x4c62be;});}function countFilteredContacts(_0x1b4b8e,_0x35f6cc){var _0x59862a=_0x1b4b8e[_0xf9f2('0x64')]();_0x59862a[_0xf9f2('0x20')](_0xf9f2('0x65'));_0x59862a=applyJoinClauses(_0x59862a,!![]);_0x1b4b8e['group'](_0xf9f2('0x53'));var _0x2f8453=utils[_0xf9f2('0x22')](_0x35f6cc);if(!_[_0xf9f2('0x66')](_0x2f8453)){_0x59862a['where']('t.id\x20IN\x20?',_0x2f8453);}var _0x1c25ea={'type':db['Sequelize'][_0xf9f2('0x5e')][_0xf9f2('0x5f')],'raw':!![]};return db[_0xf9f2('0x67')][_0xf9f2('0x61')](_0x59862a[_0xf9f2('0x62')](),_0x1c25ea)[_0xf9f2('0x4e')](function(_0x73873b){return _0x73873b[0x0][_0xf9f2('0x65')];});}module['exports']={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index a6be6cf..a03ebf7 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 _0xa692=['../../config/environment','../../config/logger','app','session','aes-256-ctr','aes192','encrypt','algorithm','join','error','test','getCiphers','filter','hasOwnProperty','createReadStream','createWriteStream','createCipher','data','update','binary','write','end','final','close','unlink','createDecipher','encryptString','secret','utf8','base64','decryptString','crypto','bluebird'];(function(_0x592b13,_0x3f3a48){var _0x362545=function(_0x25096c){while(--_0x25096c){_0x592b13['push'](_0x592b13['shift']());}};_0x362545(++_0x3f3a48);}(_0xa692,0xc4));var _0x2a69=function(_0x466f2e,_0x5e2a7f){_0x466f2e=_0x466f2e-0x0;var _0x22dfbb=_0xa692[_0x466f2e];return _0x22dfbb;};'use strict';var crypto=require(_0x2a69('0x0'));var fs=require('fs');var BPromise=require(_0x2a69('0x1'));var _=require('lodash');var config=require(_0x2a69('0x2'));var logger=require(_0x2a69('0x3'))(_0x2a69('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets'][_0x2a69('0x5')],'algorithm':_0x2a69('0x6')};const fileOptions={'algorithm':_0x2a69('0x7')};if(config['encrypt']&&config[_0x2a69('0x8')][_0x2a69('0x9')]){var isSupported=isAlgorithmSupported(config[_0x2a69('0x8')]['algorithm']);if(isSupported){fileOptions['algorithm']=config[_0x2a69('0x8')][_0x2a69('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x2a69('0xa')](',\x20');logger[_0x2a69('0xb')](config[_0x2a69('0x8')][_0x2a69('0x9')],'is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:',supportedAlgorithms);}}function isASupportedCipher(_0x5cddd1){return AES_SUPPORTED_RX[_0x2a69('0xc')](_0x5cddd1);}function getSupportedCiphers(){return crypto[_0x2a69('0xd')]()[_0x2a69('0xe')](isASupportedCipher);}function isAlgorithmSupported(_0x447110){return getSupportedCiphers()['indexOf'](_0x447110)>-0x1;}function combineOptions(_0x3ab466){var _0x342b36={};for(var _0x4ab6e6 in fileOptions){if(fileOptions[_0x2a69('0xf')](_0x4ab6e6)){_0x342b36[_0x4ab6e6]=fileOptions[_0x4ab6e6];}}if(_0x3ab466){for(var _0x434a25 in _0x3ab466){if(_0x3ab466[_0x2a69('0xf')](_0x434a25)){_0x342b36[_0x434a25]=_0x3ab466[_0x434a25];}}}return _0x342b36;}exports['encryptFile']=function(_0x37c2c5,_0x217862,_0x48ebe0,_0x313bfe){return new BPromise(function(_0x183fb3,_0x50e274){_0x313bfe=combineOptions(_0x313bfe);var _0xce1b99=new Buffer(_0x48ebe0);var _0x2550f8=fs[_0x2a69('0x10')](_0x37c2c5);var _0x451c09=fs[_0x2a69('0x11')](_0x217862);var _0x5041c9=crypto[_0x2a69('0x12')](_0x313bfe[_0x2a69('0x9')],_0xce1b99);_0x2550f8['on'](_0x2a69('0x13'),function(_0x58c7ea){var _0x53577a=new Buffer(_0x5041c9[_0x2a69('0x14')](_0x58c7ea),_0x2a69('0x15'));_0x451c09[_0x2a69('0x16')](_0x53577a);});_0x2550f8['on'](_0x2a69('0x17'),function(){try{var _0x584069=new Buffer(_0x5041c9[_0x2a69('0x18')](_0x2a69('0x15')),_0x2a69('0x15'));_0x451c09[_0x2a69('0x16')](_0x584069);_0x451c09[_0x2a69('0x17')]();_0x451c09['on'](_0x2a69('0x19'),function(){return _0x183fb3(_0x217862);});}catch(_0x23ae0b){fs[_0x2a69('0x1a')](_0x217862);return _0x50e274(_0x23ae0b);}});});};exports['decryptFile']=function(_0x335498,_0x135562,_0x55ee96,_0x5ce212){return new BPromise(function(_0x40598e,_0x3c3bb9){_0x5ce212=combineOptions(_0x5ce212);var _0x4f89c7=new Buffer(_0x55ee96);var _0x3ac1d7=fs[_0x2a69('0x10')](_0x335498);var _0x6d1295=fs[_0x2a69('0x11')](_0x135562);var _0x65285=crypto[_0x2a69('0x1b')](_0x5ce212['algorithm'],_0x4f89c7);_0x3ac1d7['on'](_0x2a69('0x13'),function(_0x598d2d){var _0x58c84e=new Buffer(_0x65285[_0x2a69('0x14')](_0x598d2d),_0x2a69('0x15'));_0x6d1295[_0x2a69('0x16')](_0x58c84e);});_0x3ac1d7['on'](_0x2a69('0x17'),function(){try{var _0x2e8206=new Buffer(_0x65285[_0x2a69('0x18')](_0x2a69('0x15')),_0x2a69('0x15'));_0x6d1295['write'](_0x2e8206);_0x6d1295[_0x2a69('0x17')]();_0x6d1295['on'](_0x2a69('0x19'),function(){return _0x40598e(_0x135562);});}catch(_0x533629){fs['unlink'](_0x135562);return _0x3c3bb9(_0x533629);}});});};exports[_0x2a69('0x1c')]=function(_0x1b4506,_0x468189,_0x52a756){var _0xef3fc6=_0x52a756||stringOptions[_0x2a69('0x9')];var _0x372666=_0x468189||stringOptions[_0x2a69('0x1d')];var _0xecb63c=crypto['createCipher'](_0xef3fc6,_0x372666);var _0x36abeb=_0xecb63c[_0x2a69('0x14')](_0x1b4506,_0x2a69('0x1e'),'base64');_0x36abeb+=_0xecb63c[_0x2a69('0x18')](_0x2a69('0x1f'));return _0x36abeb;};exports[_0x2a69('0x20')]=function(_0xa74d4f,_0x1a0d84,_0x53639a){var _0x591eef=_0x53639a||stringOptions[_0x2a69('0x9')];var _0x17ea50=_0x1a0d84||stringOptions[_0x2a69('0x1d')];var _0x5c297b=crypto[_0x2a69('0x1b')](_0x591eef,_0x17ea50);var _0x2ce92c=_0x5c297b['update'](_0xa74d4f,_0x2a69('0x1f'),_0x2a69('0x1e'));_0x2ce92c+=_0x5c297b['final'](_0x2a69('0x1e'));return _0x2ce92c;}; \ No newline at end of file +var _0xef0f=['test','getCiphers','filter','indexOf','encryptFile','createWriteStream','createCipher','data','update','binary','write','final','close','unlink','decryptFile','createReadStream','createDecipher','end','encryptString','secret','base64','decryptString','utf8','crypto','bluebird','lodash','../../config/logger','app','secrets','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:'];(function(_0xbb6fb5,_0x4db9fb){var _0x2f9501=function(_0x4a9b92){while(--_0x4a9b92){_0xbb6fb5['push'](_0xbb6fb5['shift']());}};_0x2f9501(++_0x4db9fb);}(_0xef0f,0x80));var _0xfef0=function(_0x4941c6,_0x3ca9f8){_0x4941c6=_0x4941c6-0x0;var _0x4d3654=_0xef0f[_0x4941c6];return _0x4d3654;};'use strict';var crypto=require(_0xfef0('0x0'));var fs=require('fs');var BPromise=require(_0xfef0('0x1'));var _=require(_0xfef0('0x2'));var config=require('../../config/environment');var logger=require(_0xfef0('0x3'))(_0xfef0('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xfef0('0x5')]['session'],'algorithm':'aes-256-ctr'};const fileOptions={'algorithm':_0xfef0('0x6')};if(config['encrypt']&&config[_0xfef0('0x7')][_0xfef0('0x8')]){var isSupported=isAlgorithmSupported(config[_0xfef0('0x7')]['algorithm']);if(isSupported){fileOptions[_0xfef0('0x8')]=config['encrypt']['algorithm'];}else{var supportedAlgorithms=getSupportedCiphers()[_0xfef0('0x9')](',\x20');logger[_0xfef0('0xa')](config[_0xfef0('0x7')]['algorithm'],_0xfef0('0xb'),supportedAlgorithms);}}function isASupportedCipher(_0x18f604){return AES_SUPPORTED_RX[_0xfef0('0xc')](_0x18f604);}function getSupportedCiphers(){return crypto[_0xfef0('0xd')]()[_0xfef0('0xe')](isASupportedCipher);}function isAlgorithmSupported(_0x453f38){return getSupportedCiphers()[_0xfef0('0xf')](_0x453f38)>-0x1;}function combineOptions(_0x3b31cb){var _0x4b539e={};for(var _0x49b52f in fileOptions){if(fileOptions['hasOwnProperty'](_0x49b52f)){_0x4b539e[_0x49b52f]=fileOptions[_0x49b52f];}}if(_0x3b31cb){for(var _0x44d78f in _0x3b31cb){if(_0x3b31cb['hasOwnProperty'](_0x44d78f)){_0x4b539e[_0x44d78f]=_0x3b31cb[_0x44d78f];}}}return _0x4b539e;}exports[_0xfef0('0x10')]=function(_0x5ce22f,_0x2013ac,_0x1fcda2,_0x28185a){return new BPromise(function(_0x536bf6,_0x127e21){_0x28185a=combineOptions(_0x28185a);var _0x146733=new Buffer(_0x1fcda2);var _0x43bb4e=fs['createReadStream'](_0x5ce22f);var _0x374878=fs[_0xfef0('0x11')](_0x2013ac);var _0x25d929=crypto[_0xfef0('0x12')](_0x28185a[_0xfef0('0x8')],_0x146733);_0x43bb4e['on'](_0xfef0('0x13'),function(_0x1b2e85){var _0x1dbd3f=new Buffer(_0x25d929[_0xfef0('0x14')](_0x1b2e85),_0xfef0('0x15'));_0x374878[_0xfef0('0x16')](_0x1dbd3f);});_0x43bb4e['on']('end',function(){try{var _0x51f705=new Buffer(_0x25d929[_0xfef0('0x17')](_0xfef0('0x15')),_0xfef0('0x15'));_0x374878['write'](_0x51f705);_0x374878['end']();_0x374878['on'](_0xfef0('0x18'),function(){return _0x536bf6(_0x2013ac);});}catch(_0x2a7027){fs[_0xfef0('0x19')](_0x2013ac);return _0x127e21(_0x2a7027);}});});};exports[_0xfef0('0x1a')]=function(_0x439758,_0x5d9b08,_0x2fda4d,_0x225b0e){return new BPromise(function(_0x3f5926,_0x2210dd){_0x225b0e=combineOptions(_0x225b0e);var _0x108f9d=new Buffer(_0x2fda4d);var _0x1c6a0b=fs[_0xfef0('0x1b')](_0x439758);var _0x4f1c91=fs[_0xfef0('0x11')](_0x5d9b08);var _0x2b81ba=crypto[_0xfef0('0x1c')](_0x225b0e[_0xfef0('0x8')],_0x108f9d);_0x1c6a0b['on'](_0xfef0('0x13'),function(_0xaaa4bf){var _0x15c585=new Buffer(_0x2b81ba[_0xfef0('0x14')](_0xaaa4bf),'binary');_0x4f1c91[_0xfef0('0x16')](_0x15c585);});_0x1c6a0b['on'](_0xfef0('0x1d'),function(){try{var _0x24f254=new Buffer(_0x2b81ba[_0xfef0('0x17')](_0xfef0('0x15')),_0xfef0('0x15'));_0x4f1c91['write'](_0x24f254);_0x4f1c91[_0xfef0('0x1d')]();_0x4f1c91['on'](_0xfef0('0x18'),function(){return _0x3f5926(_0x5d9b08);});}catch(_0x4e4ac2){fs['unlink'](_0x5d9b08);return _0x2210dd(_0x4e4ac2);}});});};exports[_0xfef0('0x1e')]=function(_0x22ffcb,_0x22640c,_0x42f9e3){var _0x1344e4=_0x42f9e3||stringOptions[_0xfef0('0x8')];var _0x2623ec=_0x22640c||stringOptions[_0xfef0('0x1f')];var _0x24fccb=crypto[_0xfef0('0x12')](_0x1344e4,_0x2623ec);var _0x22eef2=_0x24fccb[_0xfef0('0x14')](_0x22ffcb,'utf8',_0xfef0('0x20'));_0x22eef2+=_0x24fccb[_0xfef0('0x17')]('base64');return _0x22eef2;};exports[_0xfef0('0x21')]=function(_0x59e225,_0x3caad6,_0x13f7cc){var _0x21c16f=_0x13f7cc||stringOptions['algorithm'];var _0x1fda90=_0x3caad6||stringOptions['secret'];var _0xd13df7=crypto['createDecipher'](_0x21c16f,_0x1fda90);var _0x5ea70e=_0xd13df7[_0xfef0('0x14')](_0x59e225,_0xfef0('0x20'),'utf8');_0x5ea70e+=_0xd13df7[_0xfef0('0x17')](_0xfef0('0x22'));return _0x5ea70e;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 99d9f6b..7e9d2c9 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 _0xef9e=['lodash','bluebird','zip-dir','rimraf','../../mysqldb','dbH','analytics','argv','savename','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','find','splitSizeCsv','then','sequelize','query','QueryTypes','SELECT','num','Empty','split','length','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','existsSync','join','mkdirSync','each','%s%d.%s','writeFileSync','%s.%s','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','csv','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','finally','path'];(function(_0x7a4b16,_0x2c3b70){var _0x59e441=function(_0xfc8375){while(--_0xfc8375){_0x7a4b16['push'](_0x7a4b16['shift']());}};_0x59e441(++_0x2c3b70);}(_0xef9e,0x8c));var _0xeef9=function(_0x31d5f8,_0x15ad85){_0x31d5f8=_0x31d5f8-0x0;var _0x3fb7d0=_0xef9e[_0x31d5f8];return _0x3fb7d0;};'use strict';var util=require('util');var path=require(_0xeef9('0x0'));var _=require(_0xeef9('0x1'));var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0xeef9('0x2'));var zipdir=require(_0xeef9('0x3'));var rimraf=require(_0xeef9('0x4'));var db=require(_0xeef9('0x5'))['db'];var dbH=require(_0xeef9('0x5'))[_0xeef9('0x6')];var logger=require('../../config/logger')(_0xeef9('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0xeef9('0x8')][0x2]);var QUERY=process[_0xeef9('0x8')][0x3];var PATH=process[_0xeef9('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x191ea9,_0x489106){var _0x402d0f={'status':_0x191ea9};var _0x114837={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x489106){_0x402d0f[_0xeef9('0x9')]=_0x489106;}return db[_0xeef9('0xa')]['update'](_0x402d0f,_0x114837);}function main(){var _0x5006b0=0x1388;var _0x5473cf;logger[_0xeef9('0xb')](util[_0xeef9('0xc')](_0xeef9('0xd'),EXTRACTED_REPORT_ID,_0xeef9('0xe')));return db['Setting'][_0xeef9('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xeef9('0x10')]})[_0xeef9('0x11')](function(_0x4c3ba8){if(_0x4c3ba8){_0x5473cf=_0x4c3ba8;_0x5006b0=_0x5473cf[_0xeef9('0x10')]||0x1388;}})[_0xeef9('0x11')](function(){return dbH[_0xeef9('0x12')][_0xeef9('0x13')](util[_0xeef9('0xc')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xeef9('0x12')][_0xeef9('0x14')][_0xeef9('0x15')]});})['then'](function(_0x1833bd){if(!_0x1833bd[0x0][_0xeef9('0x16')]){return analyticExtractedReport(_0xeef9('0x17'));}var _0x327510=[];var _0x47cac9=0x0;if(_0x5473cf[_0xeef9('0x18')]){if(_0x1833bd&&_0x1833bd[_0xeef9('0x19')]){var _0x99c5ad=_['range'](_0x1833bd[0x0][_0xeef9('0x16')]/_0x5006b0);var _0x1f8e66=Number[_0xeef9('0x1a')](_0x1833bd[0x0][_0xeef9('0x16')]/_0x5006b0)?_0x1833bd[0x0]['num']%_0x5006b0:0x0;_0x99c5ad[_0xeef9('0x1b')](function(_0x584155){if(_0x584155>0x0){_0x47cac9+=_0x5006b0;}_0x327510[_0xeef9('0x1c')](dbH[_0xeef9('0x12')][_0xeef9('0x13')](util[_0xeef9('0xc')](_0xeef9('0x1d'),QUERY,_0x5006b0,_0x47cac9),{'type':dbH['sequelize'][_0xeef9('0x14')]['SELECT']}));});if(_0x1f8e66>0x0){_0x47cac9+=_0x5006b0;_0x327510[_0xeef9('0x1c')](dbH['sequelize'][_0xeef9('0x13')](util[_0xeef9('0xc')](_0xeef9('0x1d'),QUERY,_0x1f8e66,_0x47cac9),{'type':dbH['sequelize'][_0xeef9('0x14')][_0xeef9('0x15')]}));}}}else{_0x327510['push'](dbH['sequelize']['query'](QUERY,{'type':dbH[_0xeef9('0x12')][_0xeef9('0x14')]['SELECT']}));}var _0x12e331=path[_0xeef9('0x1e')](PATH);var _0x1d3061=path[_0xeef9('0x1f')](PATH,'.csv');var _0x59053b=_0x5473cf['split']&&_0x327510[_0xeef9('0x19')]>0x1;var _0x2848e8=[];if(!fs[_0xeef9('0x20')](path[_0xeef9('0x21')](_0x12e331,_0x1d3061))&&_0x59053b){fs[_0xeef9('0x22')](path[_0xeef9('0x21')](_0x12e331,_0x1d3061));}return BPromise[_0xeef9('0x23')](_0x327510,function(_0x55ecaf){_0x2848e8[_0xeef9('0x1c')](_0x55ecaf);})[_0xeef9('0x11')](function(){for(var _0x457028=0x0;_0x457028<_0x2848e8[_0xeef9('0x19')];_0x457028+=0x1){var _0x1f55c9;var _0x473295=_0x2848e8[_0x457028];if(_0x59053b){_0x1f55c9=path['join'](_0x12e331,_0x1d3061,util[_0xeef9('0xc')](_0xeef9('0x24'),_0x1d3061,_0x457028,'csv'));}else{_0x1f55c9=path[_0xeef9('0x21')](_0x12e331,util[_0xeef9('0xc')]('%s.%s',_0x1d3061,'csv'));}fs[_0xeef9('0x25')](_0x1f55c9,csv(_0x473295));}})[_0xeef9('0x11')](function(){if(_0x59053b){return new Promise(function(_0x3c8d36){zipdir(path[_0xeef9('0x21')](_0x12e331,_0x1d3061),{'saveTo':path[_0xeef9('0x21')](_0x12e331,util['format'](_0xeef9('0x26'),_0x1d3061,_0xeef9('0x27')))},function(_0x5e262e,_0x3633a3){rimraf(path['join'](_0x12e331,_0x1d3061),function(){});_0x3c8d36(_0xeef9('0x28'));});});}})[_0xeef9('0x11')](function(){logger['info'](util['format'](_0xeef9('0x29'),EXTRACTED_REPORT_ID,_0xeef9('0xe')));return analyticExtractedReport(_0xeef9('0x2a'),_0x59053b?util[_0xeef9('0xc')](_0xeef9('0x26'),_0x1d3061,_0x59053b?_0xeef9('0x27'):_0xeef9('0x2b')):null);});})['catch'](function(_0x2c5c0c){logger[_0xeef9('0xb')](util['format'](_0xeef9('0x2c'),EXTRACTED_REPORT_ID,_0xeef9('0xe')),util[_0xeef9('0x2d')](_0x2c5c0c,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0xeef9('0x2e')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0xdb03=['length','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','.csv','join','each','%s%d.%s','csv','writeFileSync','%s.%s','zip','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty'];(function(_0x3beb1e,_0x1e32ff){var _0x271ac0=function(_0x116fc4){while(--_0x116fc4){_0x3beb1e['push'](_0x3beb1e['shift']());}};_0x271ac0(++_0x1e32ff);}(_0xdb03,0x18d));var _0x3db0=function(_0xed58a0,_0x4a88d3){_0xed58a0=_0xed58a0-0x0;var _0x49feb0=_0xdb03[_0xed58a0];return _0x49feb0;};'use strict';var util=require(_0x3db0('0x0'));var path=require('path');var _=require('lodash');var csv=require('to-csv');var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0x3db0('0x1'));var rimraf=require(_0x3db0('0x2'));var db=require('../../mysqldb')['db'];var dbH=require(_0x3db0('0x3'))[_0x3db0('0x4')];var logger=require(_0x3db0('0x5'))(_0x3db0('0x6'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x3db0('0x7')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0xa43081,_0x2634ed){var _0x43a2ef={'status':_0xa43081};var _0x303709={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2634ed){_0x43a2ef['savename']=_0x2634ed;}return db[_0x3db0('0x8')][_0x3db0('0x9')](_0x43a2ef,_0x303709);}function main(){var _0xb8e944=0x1388;var _0x20d2f8;logger[_0x3db0('0xa')](util[_0x3db0('0xb')](_0x3db0('0xc'),EXTRACTED_REPORT_ID,_0x3db0('0xd')));return db[_0x3db0('0xe')][_0x3db0('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x3db0('0x10'),_0x3db0('0x11')]})[_0x3db0('0x12')](function(_0x2b965a){if(_0x2b965a){_0x20d2f8=_0x2b965a;_0xb8e944=_0x20d2f8[_0x3db0('0x11')]||0x1388;}})[_0x3db0('0x12')](function(){return dbH[_0x3db0('0x13')][_0x3db0('0x14')](util[_0x3db0('0xb')](_0x3db0('0x15'),QUERY),{'type':dbH['sequelize'][_0x3db0('0x16')][_0x3db0('0x17')]});})[_0x3db0('0x12')](function(_0x5ba549){if(!_0x5ba549[0x0][_0x3db0('0x18')]){return analyticExtractedReport(_0x3db0('0x19'));}var _0x3e6895=[];var _0x468167=0x0;if(_0x20d2f8[_0x3db0('0x10')]){if(_0x5ba549&&_0x5ba549[_0x3db0('0x1a')]){var _0x17ef25=_['range'](_0x5ba549[0x0][_0x3db0('0x18')]/_0xb8e944);var _0x5eadcb=Number[_0x3db0('0x1b')](_0x5ba549[0x0][_0x3db0('0x18')]/_0xb8e944)?_0x5ba549[0x0][_0x3db0('0x18')]%_0xb8e944:0x0;_0x17ef25[_0x3db0('0x1c')](function(_0x42ccc4){if(_0x42ccc4>0x0){_0x468167+=_0xb8e944;}_0x3e6895[_0x3db0('0x1d')](dbH[_0x3db0('0x13')][_0x3db0('0x14')](util[_0x3db0('0xb')](_0x3db0('0x1e'),QUERY,_0xb8e944,_0x468167),{'type':dbH['sequelize'][_0x3db0('0x16')][_0x3db0('0x17')]}));});if(_0x5eadcb>0x0){_0x468167+=_0xb8e944;_0x3e6895['push'](dbH[_0x3db0('0x13')][_0x3db0('0x14')](util[_0x3db0('0xb')](_0x3db0('0x1e'),QUERY,_0x5eadcb,_0x468167),{'type':dbH[_0x3db0('0x13')][_0x3db0('0x16')]['SELECT']}));}}}else{_0x3e6895[_0x3db0('0x1d')](dbH[_0x3db0('0x13')]['query'](QUERY,{'type':dbH[_0x3db0('0x13')][_0x3db0('0x16')][_0x3db0('0x17')]}));}var _0x17faaf=path[_0x3db0('0x1f')](PATH);var _0x5c8826=path['basename'](PATH,_0x3db0('0x20'));var _0x4acce3=_0x20d2f8[_0x3db0('0x10')]&&_0x3e6895['length']>0x1;var _0x39c650=[];if(!fs['existsSync'](path[_0x3db0('0x21')](_0x17faaf,_0x5c8826))&&_0x4acce3){fs['mkdirSync'](path[_0x3db0('0x21')](_0x17faaf,_0x5c8826));}return BPromise[_0x3db0('0x22')](_0x3e6895,function(_0xc8cad5){_0x39c650[_0x3db0('0x1d')](_0xc8cad5);})[_0x3db0('0x12')](function(){for(var _0x4b8444=0x0;_0x4b8444<_0x39c650[_0x3db0('0x1a')];_0x4b8444+=0x1){var _0x17d174;var _0x264931=_0x39c650[_0x4b8444];if(_0x4acce3){_0x17d174=path[_0x3db0('0x21')](_0x17faaf,_0x5c8826,util[_0x3db0('0xb')](_0x3db0('0x23'),_0x5c8826,_0x4b8444,_0x3db0('0x24')));}else{_0x17d174=path[_0x3db0('0x21')](_0x17faaf,util[_0x3db0('0xb')]('%s.%s',_0x5c8826,'csv'));}fs[_0x3db0('0x25')](_0x17d174,csv(_0x264931));}})['then'](function(){if(_0x4acce3){return new Promise(function(_0x19a075){zipdir(path[_0x3db0('0x21')](_0x17faaf,_0x5c8826),{'saveTo':path[_0x3db0('0x21')](_0x17faaf,util[_0x3db0('0xb')](_0x3db0('0x26'),_0x5c8826,_0x3db0('0x27')))},function(_0x5dd97f,_0x40add1){rimraf(path['join'](_0x17faaf,_0x5c8826),function(){});_0x19a075('zip\x20finished');});});}})['then'](function(){logger['info'](util[_0x3db0('0xb')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0x3db0('0x28'),_0x4acce3?util['format'](_0x3db0('0x26'),_0x5c8826,_0x4acce3?'zip':_0x3db0('0x24')):null);});})[_0x3db0('0x29')](function(_0x4b1497){logger['info'](util[_0x3db0('0xb')](_0x3db0('0x2a'),EXTRACTED_REPORT_ID,_0x3db0('0xd')),util[_0x3db0('0x2b')](_0x4b1497,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x3db0('0x2c'));})[_0x3db0('0x2d')](function(){process[_0x3db0('0x2e')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 5e3fe29..a96086f 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 _0xf791=['channel','interactionId','YYYY-MM-DD','center','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','error','end','lodash','util','path','moment','html-to-pdfmake','pdfmake/src/printer','jsdom','JSDOM','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','map','tableHeader','pick','toString','length','auto','body','push','concat','chunk','keys','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','header','pageBreak','margin','\x20/\x20','footer','Arial','black','num','Empty','split','splitSizePdf','then','forEach','query','QueryTypes','SELECT','%s\x20limit\x20%d\x20OFFSET\x20%d','sequelize','basename','.pdf','existsSync','join','mkdirSync','each','flatten','createPdfKitDocument','%s%d.%s','pdf','%s.%s','all','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','zip','info','findOne','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','inspect','Failed','finally','exit','/fonts/arial-bold.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d'];(function(_0x40b66c,_0x578758){var _0x2fd22b=function(_0x3b721b){while(--_0x3b721b){_0x40b66c['push'](_0x40b66c['shift']());}};_0x2fd22b(++_0x578758);}(_0xf791,0x1c2));var _0x1f79=function(_0x3dc538,_0x4f7702){_0x3dc538=_0x3dc538-0x0;var _0x72c2fd=_0xf791[_0x3dc538];return _0x72c2fd;};'use strict';var _=require(_0x1f79('0x0'));var fs=require('fs');var util=require(_0x1f79('0x1'));var path=require(_0x1f79('0x2'));var moment=require(_0x1f79('0x3'));var htmlToPdfmake=require(_0x1f79('0x4'));var PdfPrinter=require(_0x1f79('0x5'));var zipdir=require('zip-dir');var rimraf=require('rimraf');var JSDOM=require(_0x1f79('0x6'))[_0x1f79('0x7')];var window=new JSDOM('')['window'];var BPromise=require(_0x1f79('0x8'));var db=require(_0x1f79('0x9'))['db'];var dbH=require(_0x1f79('0x9'))[_0x1f79('0xa')];var logger=require(_0x1f79('0xb'))(_0x1f79('0xc'));var EXTRACTED_REPORT_ID=Number(process[_0x1f79('0xd')][0x2]);var QUERY=process[_0x1f79('0xd')][0x3];var PATH=process[_0x1f79('0xd')][0x4];var NAME=process['argv'][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x4d9187,_0x5879e6){var _0x37db88={'status':_0x4d9187};var _0x482599={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5879e6){_0x37db88[_0x1f79('0xe')]=_0x5879e6;}return db[_0x1f79('0xf')][_0x1f79('0x10')](_0x37db88,_0x482599);}function getHeaders(_0x38d116){return _[_0x1f79('0x11')](_0x38d116,function(_0x5690e6){return{'text':_0x5690e6,'style':_0x1f79('0x12')};});}function getRows(_0x4d08ba,_0x35ea0d){return _[_0x1f79('0x11')](_0x35ea0d,function(_0x54e0d3){return _(_0x54e0d3)[_0x1f79('0x13')](_0x4d08ba)['map'](function(_0x46242f){return _0x46242f?_[_0x1f79('0x14')](_0x46242f):'';})['value']();});}function createTable(_0x1d78b5,_0x2114dd){var _0x50a972={'widths':_['fill'](Array(_0x1d78b5[_0x1f79('0x15')]),0x91),'heights':function(_0x2de622){return _0x2de622===0x0?_0x1f79('0x16'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x3fa751=getHeaders(_0x1d78b5);_0x50a972[_0x1f79('0x17')][_0x1f79('0x18')](_0x3fa751);var _0x5ea9c7=getRows(_0x1d78b5,_0x2114dd);_0x50a972[_0x1f79('0x17')]=_0x50a972[_0x1f79('0x17')][_0x1f79('0x19')](_0x5ea9c7);return _0x50a972;}function createTables(_0x4c064f){var _0x5b7aab=[];var _0x144bce=_[_0x1f79('0x1a')](Object[_0x1f79('0x1b')](_0x4c064f[0x0]),0x5);_0x144bce['forEach'](function(_0x4ab332){_0x5b7aab['push'](createTable(_0x4ab332,_0x4c064f));});return _0x5b7aab;}function getPDFDocDefinition(_0x3a574a){var _0x3c0e60=util[_0x1f79('0x1c')](_0x1f79('0x1d'),NAME,EXTRACTED_REPORT[_0x1f79('0x1e')],moment(EXTRACTED_REPORT[_0x1f79('0x1f')])[_0x1f79('0x1c')](FORMAT),moment(EXTRACTED_REPORT[_0x1f79('0x20')])['format'](FORMAT));var _0x45657d=[];for(var _0x3c560e=0x0;_0x3c560e<_0x3a574a['length'];_0x3c560e++){var _0x1c01de=[];if(_0x3c560e===0x0){_0x1c01de[_0x1f79('0x18')]({'text':_0x3c0e60,'style':_0x1f79('0x21')});}var _0xafdbc={'table':_0x3a574a[_0x3c560e]};if(_0x3c560e>0x0){_0xafdbc[_0x1f79('0x22')]='before';_0xafdbc[_0x1f79('0x23')]=[0x0,0x46,0x0,0x0];}_0x1c01de[_0x1f79('0x18')](_0xafdbc);_0x45657d['push'](_0x1c01de);}return{'pageSize':'A4','pageOrientation':'landscape','content':_0x45657d,'footer':function(_0xe3aabe,_0x19e0bd){return{'text':_0xe3aabe[_0x1f79('0x14')]()+_0x1f79('0x24')+_0x19e0bd,'style':_0x1f79('0x25')};},'defaultStyle':{'font':_0x1f79('0x26')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x1f79('0x27')},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x35e1fb){var _0x31b679=0x1388;var _0x2ef8e7;if(!_0x35e1fb[0x0][_0x1f79('0x28')]){return analyticExtractedReport(_0x1f79('0x29'));}return db['Setting']['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x1f79('0x2a'),_0x1f79('0x2b')]})[_0x1f79('0x2c')](function(_0x134072){if(_0x134072){_0x2ef8e7=_0x134072;_0x31b679=_0x2ef8e7[_0x1f79('0x2b')]||0x3e8;}})['then'](function(){var _0x3815f9=[];var _0x176906=0x0;if(_0x2ef8e7[_0x1f79('0x2a')]){if(_0x35e1fb&&_0x35e1fb['length']){var _0x112abd=_['range'](_0x35e1fb[0x0][_0x1f79('0x28')]/_0x31b679);var _0x527ea1=Number['isInteger'](_0x35e1fb[0x0][_0x1f79('0x28')]/_0x31b679)?_0x35e1fb[0x0]['num']%_0x31b679:0x0;_0x112abd[_0x1f79('0x2d')](function(_0x422ca0){if(_0x422ca0>0x0){_0x176906+=_0x31b679;}_0x3815f9[_0x1f79('0x18')](dbH['sequelize'][_0x1f79('0x2e')](util[_0x1f79('0x1c')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x31b679,_0x176906),{'type':dbH['sequelize'][_0x1f79('0x2f')][_0x1f79('0x30')]}));});if(_0x527ea1>0x0){_0x176906+=_0x31b679;_0x3815f9[_0x1f79('0x18')](dbH['sequelize'][_0x1f79('0x2e')](util[_0x1f79('0x1c')](_0x1f79('0x31'),QUERY,_0x527ea1,_0x176906),{'type':dbH[_0x1f79('0x32')]['QueryTypes']['SELECT']}));}}}else{_0x3815f9[_0x1f79('0x18')](dbH[_0x1f79('0x32')][_0x1f79('0x2e')](QUERY,{'type':dbH[_0x1f79('0x32')][_0x1f79('0x2f')]['SELECT']}));}var _0x28af91=path['dirname'](PATH);var _0x2bcdf2=path[_0x1f79('0x33')](PATH,_0x1f79('0x34'));var _0x1a0f1a=_0x2ef8e7[_0x1f79('0x2a')]&&_0x3815f9['length']>0x1;var _0x5cda42=[];if(!fs[_0x1f79('0x35')](path[_0x1f79('0x36')](_0x28af91,_0x2bcdf2))&&_0x1a0f1a){fs[_0x1f79('0x37')](path[_0x1f79('0x36')](_0x28af91,_0x2bcdf2));}return BPromise[_0x1f79('0x38')](_0x3815f9,function(_0x2e8aea){_0x5cda42['push'](_0x2e8aea);})['then'](function(){var _0x1b3111=[];for(var _0x229b1b=0x0;_0x229b1b<_0x5cda42['length'];_0x229b1b+=0x1){var _0xf19d8b=_0x5cda42[_0x229b1b];var _0x2e860d=createTables(_[_0x1f79('0x39')](_0xf19d8b));var _0xe88e70;var _0x42d7c7=getPDFDocDefinition(_0x2e860d);var _0x2fabff=getPDFPrinter();var _0x2c59a7=_0x2fabff[_0x1f79('0x3a')](_0x42d7c7);if(_0x1a0f1a){_0xe88e70=path[_0x1f79('0x36')](_0x28af91,_0x2bcdf2,util[_0x1f79('0x1c')](_0x1f79('0x3b'),_0x2bcdf2,_0x229b1b,_0x1f79('0x3c')));}else{_0xe88e70=path[_0x1f79('0x36')](_0x28af91,util[_0x1f79('0x1c')](_0x1f79('0x3d'),_0x2bcdf2,_0x1f79('0x3c')));}_0x1b3111[_0x1f79('0x18')](writePDFDocument(_0x2c59a7,_0xe88e70));}return Promise[_0x1f79('0x3e')](_0x1b3111);})[_0x1f79('0x2c')](function(){if(_0x1a0f1a){return new Promise(function(_0x2431da){zipdir(path[_0x1f79('0x36')](_0x28af91,_0x2bcdf2),{'saveTo':path['join'](_0x28af91,util['format'](_0x1f79('0x3d'),_0x2bcdf2,'zip'))},function(){rimraf(path[_0x1f79('0x36')](_0x28af91,_0x2bcdf2),function(){});_0x2431da('zip\x20finished');});});}})[_0x1f79('0x2c')](function(){if(!_0x1a0f1a)return;rimraf(path[_0x1f79('0x36')](_0x28af91,_0x2bcdf2),function(){});})[_0x1f79('0x2c')](function(){logger['info'](util['format'](_0x1f79('0x3f'),EXTRACTED_REPORT_ID,'PDF'));return analyticExtractedReport(_0x1f79('0x40'),_0x1a0f1a?util['format'](_0x1f79('0x3d'),_0x2bcdf2,_0x1a0f1a?_0x1f79('0x41'):_0x1f79('0x3c')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x1f79('0x42')](util[_0x1f79('0x1c')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'PDF'));return db[_0x1f79('0xf')][_0x1f79('0x43')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x1f79('0x2c')](function(_0x5804d1){EXTRACTED_REPORT=_0x5804d1;return dbH[_0x1f79('0x32')][_0x1f79('0x2e')](util['format']('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x1f79('0x32')]['QueryTypes'][_0x1f79('0x30')]});})['then'](extractReport)[_0x1f79('0x44')](function(_0x33820b){logger[_0x1f79('0x42')](util[_0x1f79('0x1c')](_0x1f79('0x45'),EXTRACTED_REPORT_ID,_0x1f79('0x46')),util[_0x1f79('0x47')](_0x33820b,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x1f79('0x48'));})[_0x1f79('0x49')](function(){process[_0x1f79('0x4a')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x13428b=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+_0x1f79('0x4b'),'italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+_0x1f79('0x4c')}});return _0x13428b;}function getPDFDocDefinitionFromHTML(_0x2bf793,_0x34d4ad){var _0x939034=util[_0x1f79('0x1c')](_0x1f79('0x4d'),_0x34d4ad[_0x1f79('0x4e')],_0x34d4ad[_0x1f79('0x4f')]);var _0x26c9fb=moment()[_0x1f79('0x1c')](_0x1f79('0x50'))[_0x1f79('0x14')]();var _0x5ce7c4=htmlToPdfmake(_0x2bf793,{'window':window,'tableAutoSize':!![]});return{'content':[_0x5ce7c4],'defaultStyle':{'font':_0x1f79('0x26')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x1f79('0x51'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x1f79('0x51')}},'header':function(){return[{'text':'Interaction\x20Transcript','style':_0x1f79('0x21')}];},'footer':function(_0x319883,_0x3059d8){return[{'text':util['format'](_0x1f79('0x52'),_0x939034,_0x319883,_0x3059d8,_0x26c9fb),'style':_0x1f79('0x25')}];}};}function writePDFDocument(_0x30b3d0,_0x2b1979){return new Promise(function(_0xd51453,_0x5788fe){var _0x26690a=_0x30b3d0[_0x1f79('0x53')](fs[_0x1f79('0x54')](_0x2b1979));_0x26690a['on'](_0x1f79('0x55'),function(){_0xd51453(_0x1f79('0x55'));});_0x26690a['on'](_0x1f79('0x56'),function(_0x3ea786){_0x5788fe(_0x3ea786);});_0x30b3d0[_0x1f79('0x57')]();});}exports['createPdfFromHTML']=function(_0x3d1b34,_0x1244cd){var _0x1ad679=getPDFPrinter();var _0x8792e7=getPDFDocDefinitionFromHTML(_0x3d1b34,_0x1244cd);var _0x240ae4=_0x1ad679[_0x1f79('0x3a')](_0x8792e7);return writePDFDocument(_0x240ae4,_0x1244cd['path'])['catch'](function(_0x4f7934){throw _0x4f7934;});}; \ No newline at end of file +var _0xfaad=['argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','update','map','tableHeader','toString','value','fill','length','body','push','concat','chunk','format','name','startDate','endDate','header','before','margin','landscape','\x20/\x20','footer','black','right','num','Empty','Setting','split','splitSizePdf','then','isInteger','forEach','sequelize','query','QueryTypes','SELECT','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','.pdf','existsSync','join','mkdirSync','createPdfKitDocument','%s%d.%s','pdf','%s.%s','all','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','AnalyticExtractedReport','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','Arial','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','error','lodash','path','moment','pdfmake/src/printer','zip-dir','rimraf','jsdom','window','../../mysqldb','../../config/logger','analytics'];(function(_0x5e1c85,_0x3fbf7e){var _0x36436c=function(_0x20f863){while(--_0x20f863){_0x5e1c85['push'](_0x5e1c85['shift']());}};_0x36436c(++_0x3fbf7e);}(_0xfaad,0x159));var _0xdfaa=function(_0x21a5bb,_0x2186ea){_0x21a5bb=_0x21a5bb-0x0;var _0x54cd3a=_0xfaad[_0x21a5bb];return _0x54cd3a;};'use strict';var _=require(_0xdfaa('0x0'));var fs=require('fs');var util=require('util');var path=require(_0xdfaa('0x1'));var moment=require(_0xdfaa('0x2'));var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require(_0xdfaa('0x3'));var zipdir=require(_0xdfaa('0x4'));var rimraf=require(_0xdfaa('0x5'));var JSDOM=require(_0xdfaa('0x6'))['JSDOM'];var window=new JSDOM('')[_0xdfaa('0x7')];var BPromise=require('bluebird');var db=require(_0xdfaa('0x8'))['db'];var dbH=require(_0xdfaa('0x8'))['dbH'];var logger=require(_0xdfaa('0x9'))(_0xdfaa('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0xdfaa('0xb')][0x2]);var QUERY=process[_0xdfaa('0xb')][0x3];var PATH=process[_0xdfaa('0xb')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0xdfaa('0xc');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x9d87b6,_0x35292f){var _0x67943c={'status':_0x9d87b6};var _0x4f878e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x35292f){_0x67943c[_0xdfaa('0xd')]=_0x35292f;}return db['AnalyticExtractedReport'][_0xdfaa('0xe')](_0x67943c,_0x4f878e);}function getHeaders(_0x25258f){return _[_0xdfaa('0xf')](_0x25258f,function(_0x3e05e8){return{'text':_0x3e05e8,'style':_0xdfaa('0x10')};});}function getRows(_0x5e5311,_0x5a1e1c){return _['map'](_0x5a1e1c,function(_0x55df3b){return _(_0x55df3b)['pick'](_0x5e5311)[_0xdfaa('0xf')](function(_0x4425ba){return _0x4425ba?_[_0xdfaa('0x11')](_0x4425ba):'';})[_0xdfaa('0x12')]();});}function createTable(_0x46b375,_0x47e624){var _0x3145e9={'widths':_[_0xdfaa('0x13')](Array(_0x46b375[_0xdfaa('0x14')]),0x91),'heights':function(_0x1822b5){return _0x1822b5===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x20c7fb=getHeaders(_0x46b375);_0x3145e9[_0xdfaa('0x15')][_0xdfaa('0x16')](_0x20c7fb);var _0xce895c=getRows(_0x46b375,_0x47e624);_0x3145e9[_0xdfaa('0x15')]=_0x3145e9[_0xdfaa('0x15')][_0xdfaa('0x17')](_0xce895c);return _0x3145e9;}function createTables(_0x2b6cec){var _0x3e5071=[];var _0x5e76f0=_[_0xdfaa('0x18')](Object['keys'](_0x2b6cec[0x0]),0x5);_0x5e76f0['forEach'](function(_0x47f099){_0x3e5071[_0xdfaa('0x16')](createTable(_0x47f099,_0x2b6cec));});return _0x3e5071;}function getPDFDocDefinition(_0x39e2f2){var _0x1fba58=util[_0xdfaa('0x19')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,EXTRACTED_REPORT[_0xdfaa('0x1a')],moment(EXTRACTED_REPORT[_0xdfaa('0x1b')])['format'](FORMAT),moment(EXTRACTED_REPORT[_0xdfaa('0x1c')])['format'](FORMAT));var _0x254497=[];for(var _0x2843c5=0x0;_0x2843c5<_0x39e2f2['length'];_0x2843c5++){var _0x3bcc47=[];if(_0x2843c5===0x0){_0x3bcc47[_0xdfaa('0x16')]({'text':_0x1fba58,'style':_0xdfaa('0x1d')});}var _0x5118ab={'table':_0x39e2f2[_0x2843c5]};if(_0x2843c5>0x0){_0x5118ab['pageBreak']=_0xdfaa('0x1e');_0x5118ab[_0xdfaa('0x1f')]=[0x0,0x46,0x0,0x0];}_0x3bcc47['push'](_0x5118ab);_0x254497['push'](_0x3bcc47);}return{'pageSize':'A4','pageOrientation':_0xdfaa('0x20'),'content':_0x254497,'footer':function(_0x5e0c18,_0x3bd75c){return{'text':_0x5e0c18[_0xdfaa('0x11')]()+_0xdfaa('0x21')+_0x3bd75c,'style':_0xdfaa('0x22')};},'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xdfaa('0x23')},'footer':{'alignment':_0xdfaa('0x24'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x30d53b){var _0x2402dc=0x1388;var _0x2fac1d;if(!_0x30d53b[0x0][_0xdfaa('0x25')]){return analyticExtractedReport(_0xdfaa('0x26'));}return db[_0xdfaa('0x27')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xdfaa('0x28'),_0xdfaa('0x29')]})['then'](function(_0x4d5b4e){if(_0x4d5b4e){_0x2fac1d=_0x4d5b4e;_0x2402dc=_0x2fac1d[_0xdfaa('0x29')]||0x3e8;}})[_0xdfaa('0x2a')](function(){var _0x4b25fb=[];var _0x204228=0x0;if(_0x2fac1d['split']){if(_0x30d53b&&_0x30d53b[_0xdfaa('0x14')]){var _0x5b4141=_['range'](_0x30d53b[0x0][_0xdfaa('0x25')]/_0x2402dc);var _0xf84d23=Number[_0xdfaa('0x2b')](_0x30d53b[0x0][_0xdfaa('0x25')]/_0x2402dc)?_0x30d53b[0x0][_0xdfaa('0x25')]%_0x2402dc:0x0;_0x5b4141[_0xdfaa('0x2c')](function(_0x44713b){if(_0x44713b>0x0){_0x204228+=_0x2402dc;}_0x4b25fb[_0xdfaa('0x16')](dbH[_0xdfaa('0x2d')][_0xdfaa('0x2e')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x2402dc,_0x204228),{'type':dbH['sequelize'][_0xdfaa('0x2f')][_0xdfaa('0x30')]}));});if(_0xf84d23>0x0){_0x204228+=_0x2402dc;_0x4b25fb[_0xdfaa('0x16')](dbH[_0xdfaa('0x2d')][_0xdfaa('0x2e')](util[_0xdfaa('0x19')](_0xdfaa('0x31'),QUERY,_0xf84d23,_0x204228),{'type':dbH['sequelize'][_0xdfaa('0x2f')][_0xdfaa('0x30')]}));}}}else{_0x4b25fb[_0xdfaa('0x16')](dbH['sequelize'][_0xdfaa('0x2e')](QUERY,{'type':dbH[_0xdfaa('0x2d')]['QueryTypes'][_0xdfaa('0x30')]}));}var _0x420c5e=path[_0xdfaa('0x32')](PATH);var _0x1b7426=path['basename'](PATH,_0xdfaa('0x33'));var _0x310b22=_0x2fac1d[_0xdfaa('0x28')]&&_0x4b25fb['length']>0x1;var _0x4133e4=[];if(!fs[_0xdfaa('0x34')](path[_0xdfaa('0x35')](_0x420c5e,_0x1b7426))&&_0x310b22){fs[_0xdfaa('0x36')](path['join'](_0x420c5e,_0x1b7426));}return BPromise['each'](_0x4b25fb,function(_0x127283){_0x4133e4[_0xdfaa('0x16')](_0x127283);})[_0xdfaa('0x2a')](function(){var _0x1f4069=[];for(var _0x12240e=0x0;_0x12240e<_0x4133e4[_0xdfaa('0x14')];_0x12240e+=0x1){var _0x452ed8=_0x4133e4[_0x12240e];var _0x3fac73=createTables(_['flatten'](_0x452ed8));var _0x2e9025;var _0x9755e6=getPDFDocDefinition(_0x3fac73);var _0x1db6dd=getPDFPrinter();var _0x47afa2=_0x1db6dd[_0xdfaa('0x37')](_0x9755e6);if(_0x310b22){_0x2e9025=path[_0xdfaa('0x35')](_0x420c5e,_0x1b7426,util[_0xdfaa('0x19')](_0xdfaa('0x38'),_0x1b7426,_0x12240e,_0xdfaa('0x39')));}else{_0x2e9025=path[_0xdfaa('0x35')](_0x420c5e,util[_0xdfaa('0x19')](_0xdfaa('0x3a'),_0x1b7426,_0xdfaa('0x39')));}_0x1f4069[_0xdfaa('0x16')](writePDFDocument(_0x47afa2,_0x2e9025));}return Promise[_0xdfaa('0x3b')](_0x1f4069);})['then'](function(){if(_0x310b22){return new Promise(function(_0x3e25ac){zipdir(path['join'](_0x420c5e,_0x1b7426),{'saveTo':path[_0xdfaa('0x35')](_0x420c5e,util[_0xdfaa('0x19')]('%s.%s',_0x1b7426,_0xdfaa('0x3c')))},function(){rimraf(path[_0xdfaa('0x35')](_0x420c5e,_0x1b7426),function(){});_0x3e25ac('zip\x20finished');});});}})['then'](function(){if(!_0x310b22)return;rimraf(path[_0xdfaa('0x35')](_0x420c5e,_0x1b7426),function(){});})['then'](function(){logger[_0xdfaa('0x3d')](util[_0xdfaa('0x19')](_0xdfaa('0x3e'),EXTRACTED_REPORT_ID,_0xdfaa('0x3f')));return analyticExtractedReport(_0xdfaa('0x40'),_0x310b22?util[_0xdfaa('0x19')](_0xdfaa('0x3a'),_0x1b7426,_0x310b22?'zip':'pdf'):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xdfaa('0x3d')](util[_0xdfaa('0x19')](_0xdfaa('0x41'),EXTRACTED_REPORT_ID,_0xdfaa('0x3f')));return db[_0xdfaa('0x42')][_0xdfaa('0x43')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xdfaa('0x2a')](function(_0x497a18){EXTRACTED_REPORT=_0x497a18;return dbH[_0xdfaa('0x2d')][_0xdfaa('0x2e')](util[_0xdfaa('0x19')](_0xdfaa('0x44'),QUERY),{'type':dbH[_0xdfaa('0x2d')][_0xdfaa('0x2f')]['SELECT']});})[_0xdfaa('0x2a')](extractReport)['catch'](function(_0xc4c206){logger['info'](util[_0xdfaa('0x19')](_0xdfaa('0x45'),EXTRACTED_REPORT_ID,_0xdfaa('0x3f')),util[_0xdfaa('0x46')](_0xc4c206,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xdfaa('0x47'));})[_0xdfaa('0x48')](function(){process[_0xdfaa('0x49')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x49bc06=new PdfPrinter({'Arial':{'normal':__dirname+_0xdfaa('0x4a'),'bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+_0xdfaa('0x4b'),'bolditalics':__dirname+_0xdfaa('0x4c')}});return _0x49bc06;}function getPDFDocDefinitionFromHTML(_0x433413,_0x4e8765){var _0x4d5d5a=util[_0xdfaa('0x19')](_0xdfaa('0x4d'),_0x4e8765[_0xdfaa('0x4e')],_0x4e8765[_0xdfaa('0x4f')]);var _0x325ab3=moment()[_0xdfaa('0x19')](_0xdfaa('0x50'))[_0xdfaa('0x11')]();var _0x278ea0=htmlToPdfmake(_0x433413,{'window':window,'tableAutoSize':!![]});return{'content':[_0x278ea0],'defaultStyle':{'font':_0xdfaa('0x51')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xdfaa('0x52'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xdfaa('0x52'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xdfaa('0x52')}},'header':function(){return[{'text':_0xdfaa('0x53'),'style':'header'}];},'footer':function(_0xc6224b,_0x16cc71){return[{'text':util[_0xdfaa('0x19')](_0xdfaa('0x54'),_0x4d5d5a,_0xc6224b,_0x16cc71,_0x325ab3),'style':_0xdfaa('0x22')}];}};}function writePDFDocument(_0x4d216b,_0x27df62){return new Promise(function(_0x48ce35,_0x4ee433){var _0x22d9fb=_0x4d216b[_0xdfaa('0x55')](fs[_0xdfaa('0x56')](_0x27df62));_0x22d9fb['on']('finish',function(){_0x48ce35(_0xdfaa('0x57'));});_0x22d9fb['on'](_0xdfaa('0x58'),function(_0x1bef26){_0x4ee433(_0x1bef26);});_0x4d216b['end']();});}exports['createPdfFromHTML']=function(_0x6714fa,_0x2b489b){var _0x1d0cd7=getPDFPrinter();var _0x6f254=getPDFDocDefinitionFromHTML(_0x6714fa,_0x2b489b);var _0x207ed0=_0x1d0cd7[_0xdfaa('0x37')](_0x6f254);return writePDFDocument(_0x207ed0,_0x2b489b[_0xdfaa('0x1')])['catch'](function(_0x4e7ba6){throw _0x4e7ba6;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 24b49a0..516b56c 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 _0x77a9=['range','isInteger','forEach','format','%s\x20limit\x20%d\x20OFFSET\x20%d','push','dirname','basename','.xlsx','existsSync','mkdirSync','join','each','xlsx','%s.%s','binary','zip','zip\x20finished','info','catch','inspect','Failed','util','path','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','argv','update','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','then','sequelize','query','QueryTypes','SELECT','num','Empty','length'];(function(_0x2b3746,_0xad8f69){var _0x54c9d5=function(_0x3616f3){while(--_0x3616f3){_0x2b3746['push'](_0x2b3746['shift']());}};_0x54c9d5(++_0xad8f69);}(_0x77a9,0x1ec));var _0x977a=function(_0x609f92,_0x59c70f){_0x609f92=_0x609f92-0x0;var _0x33bf0f=_0x77a9[_0x609f92];return _0x33bf0f;};'use strict';var util=require(_0x977a('0x0'));var path=require(_0x977a('0x1'));var _=require(_0x977a('0x2'));var fs=require('fs');var json2xls=require(_0x977a('0x3'));var BPromise=require(_0x977a('0x4'));var zipdir=require(_0x977a('0x5'));var rimraf=require(_0x977a('0x6'));var db=require(_0x977a('0x7'))['db'];var dbH=require(_0x977a('0x7'))[_0x977a('0x8')];var logger=require(_0x977a('0x9'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x977a('0xa')][0x2]);var QUERY=process['argv'][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x442103,_0x4363e4){var _0x270d66={'status':_0x442103};var _0x56b524={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4363e4){_0x270d66['savename']=_0x4363e4;}return db['AnalyticExtractedReport'][_0x977a('0xb')](_0x270d66,_0x56b524);}function main(){var _0x3259e7=0x1388;var _0x321786;logger['info'](util['format'](_0x977a('0xc'),EXTRACTED_REPORT_ID,_0x977a('0xd')));return db[_0x977a('0xe')][_0x977a('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x977a('0x10'),'splitSizeXlsx']})[_0x977a('0x11')](function(_0x925dd5){if(_0x925dd5){_0x321786=_0x925dd5;_0x3259e7=_0x321786['splitSizeXlsx']||0x1388;}})[_0x977a('0x11')](function(){return dbH[_0x977a('0x12')][_0x977a('0x13')](util['format']('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x977a('0x12')][_0x977a('0x14')][_0x977a('0x15')]});})[_0x977a('0x11')](function(_0x5654ea){if(!_0x5654ea[0x0][_0x977a('0x16')]){return analyticExtractedReport(_0x977a('0x17'));}var _0x464ba4=[];var _0x47020b=0x0;if(_0x321786[_0x977a('0x10')]){if(_0x5654ea&&_0x5654ea[_0x977a('0x18')]){var _0xf66122=_[_0x977a('0x19')](_0x5654ea[0x0]['num']/_0x3259e7);var _0x1582c8=Number[_0x977a('0x1a')](_0x5654ea[0x0][_0x977a('0x16')]/_0x3259e7)?_0x5654ea[0x0][_0x977a('0x16')]%_0x3259e7:0x0;_0xf66122[_0x977a('0x1b')](function(_0x57454a){if(_0x57454a>0x0){_0x47020b+=_0x3259e7;}_0x464ba4['push'](dbH[_0x977a('0x12')][_0x977a('0x13')](util[_0x977a('0x1c')](_0x977a('0x1d'),QUERY,_0x3259e7,_0x47020b),{'type':dbH[_0x977a('0x12')][_0x977a('0x14')]['SELECT']}));});if(_0x1582c8>0x0){_0x47020b+=_0x3259e7;_0x464ba4[_0x977a('0x1e')](dbH[_0x977a('0x12')][_0x977a('0x13')](util[_0x977a('0x1c')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x1582c8,_0x47020b),{'type':dbH['sequelize'][_0x977a('0x14')][_0x977a('0x15')]}));}}}else{_0x464ba4['push'](dbH['sequelize']['query'](QUERY,{'type':dbH[_0x977a('0x12')][_0x977a('0x14')][_0x977a('0x15')]}));}var _0xe4deeb=path[_0x977a('0x1f')](PATH);var _0x2c3550=path[_0x977a('0x20')](PATH,_0x977a('0x21'));var _0x1746ad=_0x321786['split']&&_0x464ba4[_0x977a('0x18')]>0x1;var _0x282c84=[];if(!fs[_0x977a('0x22')](path['join'](_0xe4deeb,_0x2c3550))&&_0x1746ad){fs[_0x977a('0x23')](path[_0x977a('0x24')](_0xe4deeb,_0x2c3550));}return BPromise[_0x977a('0x25')](_0x464ba4,function(_0x57e68f){_0x282c84[_0x977a('0x1e')](_0x57e68f);})['then'](function(){for(var _0x7fe43d=0x0;_0x7fe43d<_0x282c84[_0x977a('0x18')];_0x7fe43d+=0x1){var _0x35d83b;var _0xa8a644=_0x282c84[_0x7fe43d];if(_0x1746ad){_0x35d83b=path[_0x977a('0x24')](_0xe4deeb,_0x2c3550,util[_0x977a('0x1c')]('%s%d.%s',_0x2c3550,_0x7fe43d,_0x977a('0x26')));}else{_0x35d83b=path[_0x977a('0x24')](_0xe4deeb,util[_0x977a('0x1c')](_0x977a('0x27'),_0x2c3550,_0x977a('0x26')));}fs['writeFileSync'](_0x35d83b,json2xls(_0xa8a644),_0x977a('0x28'));}})[_0x977a('0x11')](function(){if(_0x1746ad){return new Promise(function(_0x4a67ed){zipdir(path[_0x977a('0x24')](_0xe4deeb,_0x2c3550),{'saveTo':path[_0x977a('0x24')](_0xe4deeb,util[_0x977a('0x1c')](_0x977a('0x27'),_0x2c3550,_0x977a('0x29')))},function(_0x4ac6b2,_0x2b6609){rimraf(path[_0x977a('0x24')](_0xe4deeb,_0x2c3550),function(){});_0x4a67ed(_0x977a('0x2a'));});});}})[_0x977a('0x11')](function(){logger[_0x977a('0x2b')](util[_0x977a('0x1c')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x977a('0xd')));return analyticExtractedReport('Completed',_0x1746ad?util[_0x977a('0x1c')](_0x977a('0x27'),_0x2c3550,_0x1746ad?_0x977a('0x29'):_0x977a('0x26')):null);});})[_0x977a('0x2c')](function(_0x18f285){logger[_0x977a('0x2b')](util[_0x977a('0x1c')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'XLSX'),util[_0x977a('0x2d')](_0x18f285,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x977a('0x2e'));})['finally'](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0xd674=['SELECT','num','length','range','isInteger','forEach','query','%s\x20limit\x20%d\x20OFFSET\x20%d','push','dirname','basename','.xlsx','join','each','xlsx','%s.%s','binary','zip\x20finished','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','inspect','finally','exit','util','path','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','then','splitSizeXlsx','sequelize','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes'];(function(_0x19dd8a,_0x4af545){var _0x6245d3=function(_0x16e70b){while(--_0x16e70b){_0x19dd8a['push'](_0x19dd8a['shift']());}};_0x6245d3(++_0x4af545);}(_0xd674,0xb9));var _0x4d67=function(_0x2c559b,_0x428179){_0x2c559b=_0x2c559b-0x0;var _0x46069a=_0xd674[_0x2c559b];return _0x46069a;};'use strict';var util=require(_0x4d67('0x0'));var path=require(_0x4d67('0x1'));var _=require(_0x4d67('0x2'));var fs=require('fs');var json2xls=require(_0x4d67('0x3'));var BPromise=require(_0x4d67('0x4'));var zipdir=require(_0x4d67('0x5'));var rimraf=require(_0x4d67('0x6'));var db=require(_0x4d67('0x7'))['db'];var dbH=require(_0x4d67('0x7'))[_0x4d67('0x8')];var logger=require(_0x4d67('0x9'))(_0x4d67('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0x4d67('0xb')][0x2]);var QUERY=process[_0x4d67('0xb')][0x3];var PATH=process[_0x4d67('0xb')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x5cc1d0,_0x484baa){var _0x4a21b6={'status':_0x5cc1d0};var _0x9ccd71={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x484baa){_0x4a21b6[_0x4d67('0xc')]=_0x484baa;}return db[_0x4d67('0xd')][_0x4d67('0xe')](_0x4a21b6,_0x9ccd71);}function main(){var _0x15f9b8=0x1388;var _0xf77a04;logger[_0x4d67('0xf')](util['format'](_0x4d67('0x10'),EXTRACTED_REPORT_ID,_0x4d67('0x11')));return db[_0x4d67('0x12')][_0x4d67('0x13')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x4d67('0x14'),'splitSizeXlsx']})[_0x4d67('0x15')](function(_0x41bf2a){if(_0x41bf2a){_0xf77a04=_0x41bf2a;_0x15f9b8=_0xf77a04[_0x4d67('0x16')]||0x1388;}})['then'](function(){return dbH[_0x4d67('0x17')]['query'](util[_0x4d67('0x18')](_0x4d67('0x19'),QUERY),{'type':dbH[_0x4d67('0x17')][_0x4d67('0x1a')][_0x4d67('0x1b')]});})['then'](function(_0xcabb9b){if(!_0xcabb9b[0x0][_0x4d67('0x1c')]){return analyticExtractedReport('Empty');}var _0x35f177=[];var _0x1deca8=0x0;if(_0xf77a04[_0x4d67('0x14')]){if(_0xcabb9b&&_0xcabb9b[_0x4d67('0x1d')]){var _0x1be977=_[_0x4d67('0x1e')](_0xcabb9b[0x0][_0x4d67('0x1c')]/_0x15f9b8);var _0x2369a0=Number[_0x4d67('0x1f')](_0xcabb9b[0x0]['num']/_0x15f9b8)?_0xcabb9b[0x0]['num']%_0x15f9b8:0x0;_0x1be977[_0x4d67('0x20')](function(_0x400de1){if(_0x400de1>0x0){_0x1deca8+=_0x15f9b8;}_0x35f177['push'](dbH[_0x4d67('0x17')][_0x4d67('0x21')](util[_0x4d67('0x18')](_0x4d67('0x22'),QUERY,_0x15f9b8,_0x1deca8),{'type':dbH[_0x4d67('0x17')]['QueryTypes'][_0x4d67('0x1b')]}));});if(_0x2369a0>0x0){_0x1deca8+=_0x15f9b8;_0x35f177[_0x4d67('0x23')](dbH[_0x4d67('0x17')][_0x4d67('0x21')](util['format'](_0x4d67('0x22'),QUERY,_0x2369a0,_0x1deca8),{'type':dbH[_0x4d67('0x17')][_0x4d67('0x1a')]['SELECT']}));}}}else{_0x35f177[_0x4d67('0x23')](dbH['sequelize'][_0x4d67('0x21')](QUERY,{'type':dbH['sequelize']['QueryTypes'][_0x4d67('0x1b')]}));}var _0x25c5ca=path[_0x4d67('0x24')](PATH);var _0x36f3cc=path[_0x4d67('0x25')](PATH,_0x4d67('0x26'));var _0x338e9e=_0xf77a04['split']&&_0x35f177[_0x4d67('0x1d')]>0x1;var _0x328396=[];if(!fs['existsSync'](path[_0x4d67('0x27')](_0x25c5ca,_0x36f3cc))&&_0x338e9e){fs['mkdirSync'](path[_0x4d67('0x27')](_0x25c5ca,_0x36f3cc));}return BPromise[_0x4d67('0x28')](_0x35f177,function(_0x1e0cf1){_0x328396[_0x4d67('0x23')](_0x1e0cf1);})['then'](function(){for(var _0x1b7c37=0x0;_0x1b7c37<_0x328396[_0x4d67('0x1d')];_0x1b7c37+=0x1){var _0x439360;var _0x2bac9d=_0x328396[_0x1b7c37];if(_0x338e9e){_0x439360=path[_0x4d67('0x27')](_0x25c5ca,_0x36f3cc,util[_0x4d67('0x18')]('%s%d.%s',_0x36f3cc,_0x1b7c37,_0x4d67('0x29')));}else{_0x439360=path['join'](_0x25c5ca,util[_0x4d67('0x18')](_0x4d67('0x2a'),_0x36f3cc,_0x4d67('0x29')));}fs['writeFileSync'](_0x439360,json2xls(_0x2bac9d),_0x4d67('0x2b'));}})['then'](function(){if(_0x338e9e){return new Promise(function(_0x55ce8f){zipdir(path[_0x4d67('0x27')](_0x25c5ca,_0x36f3cc),{'saveTo':path[_0x4d67('0x27')](_0x25c5ca,util[_0x4d67('0x18')](_0x4d67('0x2a'),_0x36f3cc,'zip'))},function(_0x15c39c,_0x50b688){rimraf(path[_0x4d67('0x27')](_0x25c5ca,_0x36f3cc),function(){});_0x55ce8f(_0x4d67('0x2c'));});});}})['then'](function(){logger[_0x4d67('0xf')](util[_0x4d67('0x18')](_0x4d67('0x2d'),EXTRACTED_REPORT_ID,_0x4d67('0x11')));return analyticExtractedReport(_0x4d67('0x2e'),_0x338e9e?util[_0x4d67('0x18')](_0x4d67('0x2a'),_0x36f3cc,_0x338e9e?_0x4d67('0x2f'):_0x4d67('0x29')):null);});})[_0x4d67('0x30')](function(_0x182a85){logger[_0x4d67('0xf')](util[_0x4d67('0x18')](_0x4d67('0x31'),EXTRACTED_REPORT_ID,_0x4d67('0x11')),util[_0x4d67('0x32')](_0x182a85,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x4d67('0x33')](function(){process[_0x4d67('0x34')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 05e9ed9..28e9f14 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 _0x3c13=['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)','indexOf','app','appType','custom','answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','error','rewrite','lodash','models','VoiceExtension','findAll','IntervalId','then','uniq','map','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','hasOwnProperty','priority','extensions','extension','find','type','Set','CDR(type)=%s','context','exten','inbound','push','VoiceExtensionId','cutdigits','${EXTEN:','${EXTEN}','CDR(routeid)=','ExecIf','):Goto(','CDR(prefix)=noprefix','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','interval','intervals'];(function(_0x368ecc,_0x505b9c){var _0x2fdc36=function(_0x25dfe4){while(--_0x25dfe4){_0x368ecc['push'](_0x368ecc['shift']());}};_0x2fdc36(++_0x505b9c);}(_0x3c13,0x96));var _0x33c1=function(_0x2dba1c,_0x3adba7){_0x2dba1c=_0x2dba1c-0x0;var _0x435e5e=_0x3c13[_0x2dba1c];return _0x435e5e;};'use strict';var _=require(_0x33c1('0x0'));var util=require('util');function rewrite(_0x4a75f8,_0x41238c){var _0x5584ce=this;return _0x4a75f8[_0x33c1('0x1')]['Interval']['findAll']({'raw':!![]})['then'](function(_0x1e8459){_0x5584ce['intervals']=_0x1e8459;return _0x4a75f8[_0x33c1('0x1')][_0x33c1('0x2')][_0x33c1('0x3')]({'where':{'IntervalId':_0x41238c[_0x33c1('0x4')]},'raw':!![]});})[_0x33c1('0x5')](function(_0x4432a5){return _0x4a75f8[_0x33c1('0x1')][_0x33c1('0x2')][_0x33c1('0x3')]({'where':{'exten':{'$in':_[_0x33c1('0x6')](_[_0x33c1('0x7')](_0x4432a5,'exten'))}},'order':[{'raw':_0x33c1('0x8')}],'raw':!![]});})[_0x33c1('0x5')](function(_0x45410b){var _0x4e3fb6=_[_0x33c1('0x9')](_0x45410b,{'priority':'1'});var _0x3a9186=_[_0x33c1('0x9')](_0x45410b,{'isApp':0x1});var _0x3f25df=_[_0x33c1('0xa')](_0x3a9186,'exten');var _0x56214c=[_0x33c1('0xb'),_0x33c1('0xc')];var _0x531a8b=[];var _0x538948=[];for(var _0x3df7af in _0x3f25df){if(_0x3f25df[_0x33c1('0xd')](_0x3df7af)){_0x5584ce[_0x33c1('0xe')]=0x2;_0x5584ce[_0x33c1('0xf')]=[];_0x5584ce[_0x33c1('0x10')]=_[_0x33c1('0x11')](_0x4e3fb6,{'exten':_0x3f25df[_0x3df7af][0x0]['exten']});_0x5584ce['extensions']['push']({'type':_0x3f25df[_0x3df7af][0x0][_0x33c1('0x12')],'app':_0x33c1('0x13'),'appdata':util['format'](_0x33c1('0x14'),_0x3f25df[_0x3df7af][0x0][_0x33c1('0x12')]),'context':_0x3f25df[_0x3df7af][0x0][_0x33c1('0x15')],'exten':_0x3f25df[_0x3df7af][0x0][_0x33c1('0x16')],'priority':_0x5584ce['priority']++,'VoiceExtensionId':_0x3f25df[_0x3df7af][0x0]['VoiceExtensionId']});if(_0x3f25df[_0x3df7af][0x0][_0x33c1('0x12')]===_0x33c1('0x17')){_0x5584ce[_0x33c1('0xf')][_0x33c1('0x18')]({'type':_0x3f25df[_0x3df7af][0x0][_0x33c1('0x12')],'app':_0x33c1('0x13'),'appdata':'CDR(routeid)='+_0x3f25df[_0x3df7af][0x0][_0x33c1('0x19')],'context':_0x3f25df[_0x3df7af][0x0][_0x33c1('0x15')],'exten':_0x3f25df[_0x3df7af][0x0]['exten'],'priority':_0x5584ce['priority']++,'VoiceExtensionId':_0x3f25df[_0x3df7af][0x0][_0x33c1('0x19')]});}else if(_0x3f25df[_0x3df7af][0x0]['type']==='outbound'){if(_0x5584ce['extension']){_0x5584ce[_0x33c1('0xf')][_0x33c1('0x18')]({'type':_0x3f25df[_0x3df7af][0x0][_0x33c1('0x12')],'app':_0x33c1('0x13'),'appdata':'CDR(destination)='+(_0x5584ce[_0x33c1('0x10')][_0x33c1('0x1a')]?_0x33c1('0x1b')+_0x5584ce['extension']['cutdigits']+'}':_0x33c1('0x1c')),'context':_0x3f25df[_0x3df7af][0x0][_0x33c1('0x15')],'exten':_0x3f25df[_0x3df7af][0x0]['exten'],'priority':_0x5584ce[_0x33c1('0xe')]++,'VoiceExtensionId':_0x3f25df[_0x3df7af][0x0]['VoiceExtensionId']});}_0x5584ce[_0x33c1('0xf')]['push']({'type':_0x3f25df[_0x3df7af][0x0][_0x33c1('0x12')],'app':_0x33c1('0x13'),'appdata':_0x33c1('0x1d')+_0x3f25df[_0x3df7af][0x0]['VoiceExtensionId'],'context':_0x3f25df[_0x3df7af][0x0]['context'],'exten':_0x3f25df[_0x3df7af][0x0][_0x33c1('0x16')],'priority':_0x5584ce['priority']++,'VoiceExtensionId':_0x3f25df[_0x3df7af][0x0][_0x33c1('0x19')]});var _0x25202=_0x5584ce[_0x33c1('0xe')]++;_0x5584ce[_0x33c1('0xf')][_0x33c1('0x18')]({'type':_0x3f25df[_0x3df7af][0x0][_0x33c1('0x12')],'app':_0x33c1('0x1e'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x25202+0x2)+_0x33c1('0x1f')+(_0x25202+0x1)+')','context':_0x3f25df[_0x3df7af][0x0][_0x33c1('0x15')],'exten':_0x3f25df[_0x3df7af][0x0][_0x33c1('0x16')],'priority':_0x25202,'VoiceExtensionId':_0x3f25df[_0x3df7af][0x0][_0x33c1('0x19')]});if(_0x5584ce['extension']){_0x5584ce[_0x33c1('0xf')][_0x33c1('0x18')]({'type':_0x3f25df[_0x3df7af][0x0][_0x33c1('0x12')],'app':_0x33c1('0x13'),'appdata':_0x5584ce[_0x33c1('0x10')][_0x33c1('0x1a')]?'CDR(prefix)=${EXTEN:0:'+_0x5584ce['extension'][_0x33c1('0x1a')]+'}':_0x33c1('0x20'),'context':_0x3f25df[_0x3df7af][0x0][_0x33c1('0x15')],'exten':_0x3f25df[_0x3df7af][0x0]['exten'],'priority':_0x5584ce[_0x33c1('0xe')]++,'VoiceExtensionId':_0x3f25df[_0x3df7af][0x0][_0x33c1('0x19')]});}_0x5584ce[_0x33c1('0xf')][_0x33c1('0x18')]({'type':_0x3f25df[_0x3df7af][0x0][_0x33c1('0x12')],'app':_0x33c1('0x13'),'appdata':'outboundrouteid='+_0x3f25df[_0x3df7af][0x0][_0x33c1('0x19')],'context':_0x3f25df[_0x3df7af][0x0][_0x33c1('0x15')],'exten':_0x3f25df[_0x3df7af][0x0][_0x33c1('0x16')],'priority':_0x5584ce[_0x33c1('0xe')]++,'VoiceExtensionId':_0x3f25df[_0x3df7af][0x0]['VoiceExtensionId']});if(_0x5584ce['extension']&&_0x5584ce[_0x33c1('0x10')][_0x33c1('0xd')](_0x33c1('0x21'))&&_0x5584ce[_0x33c1('0x10')][_0x33c1('0x21')]!==_0x33c1('0x22')){_0x5584ce[_0x33c1('0xf')][_0x33c1('0x18')]({'type':_0x3f25df[_0x3df7af][0x0]['type'],'app':_0x33c1('0x13'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x3f25df[_0x3df7af][0x0][_0x33c1('0x15')],'exten':_0x3f25df[_0x3df7af][0x0][_0x33c1('0x16')],'priority':_0x5584ce[_0x33c1('0xe')]++,'VoiceExtensionId':_0x3f25df[_0x3df7af][0x0][_0x33c1('0x19')]});_0x5584ce[_0x33c1('0xf')][_0x33c1('0x18')]({'type':_0x3f25df[_0x3df7af][0x0][_0x33c1('0x12')],'app':_0x33c1('0x13'),'appdata':_0x33c1('0x23')+_0x5584ce['extension'][_0x33c1('0x21')]||_0x33c1('0x24'),'context':_0x3f25df[_0x3df7af][0x0]['context'],'exten':_0x3f25df[_0x3df7af][0x0]['exten'],'priority':_0x5584ce[_0x33c1('0xe')]++,'VoiceExtensionId':_0x3f25df[_0x3df7af][0x0][_0x33c1('0x19')]});}}_0x5584ce[_0x33c1('0xf')][_0x33c1('0x18')]({'type':_0x3f25df[_0x3df7af][0x0]['type'],'app':_0x33c1('0x13'),'appdata':_0x33c1('0x25'),'context':_0x3f25df[_0x3df7af][0x0]['context'],'exten':_0x3f25df[_0x3df7af][0x0][_0x33c1('0x16')],'priority':_0x5584ce['priority']++,'VoiceExtensionId':_0x3f25df[_0x3df7af][0x0][_0x33c1('0x19')]});_0x5584ce[_0x33c1('0xf')][_0x33c1('0x18')]({'type':_0x3f25df[_0x3df7af][0x0][_0x33c1('0x12')],'app':_0x33c1('0x13'),'appdata':_0x33c1('0x26'),'context':_0x3f25df[_0x3df7af][0x0][_0x33c1('0x15')],'exten':_0x3f25df[_0x3df7af][0x0][_0x33c1('0x16')],'priority':_0x5584ce['priority']++,'VoiceExtensionId':_0x3f25df[_0x3df7af][0x0]['VoiceExtensionId']});_0x5584ce[_0x33c1('0xf')][_0x33c1('0x18')]({'type':_0x3f25df[_0x3df7af][0x0][_0x33c1('0x12')],'app':_0x33c1('0x13'),'appdata':_0x33c1('0x27'),'context':_0x3f25df[_0x3df7af][0x0][_0x33c1('0x15')],'exten':_0x3f25df[_0x3df7af][0x0][_0x33c1('0x16')],'priority':_0x5584ce['priority']++,'VoiceExtensionId':_0x3f25df[_0x3df7af][0x0]['VoiceExtensionId']});for(var _0x1b3063=0x0,_0x56c52a=0x0;_0x1b3063<_0x3f25df[_0x3df7af][_0x33c1('0x28')];_0x1b3063+=0x1,_0x56c52a=0x0){var _0x15f3ed=_0x3f25df[_0x3df7af][_0x1b3063];if(_0x15f3ed['type']){_0x15f3ed[_0x33c1('0x12')]=_0x15f3ed['type'][_0x33c1('0x29')]();}var _0x2b211e=[];var _0x248b7a=[];delete _0x15f3ed['id'];delete _0x15f3ed[_0x33c1('0x2a')];delete _0x15f3ed['updatedAt'];var _0x4807d9=_0x15f3ed[_0x33c1('0x2b')]!=='*,*,*,*'?[_0x15f3ed['interval']]:_0x15f3ed[_0x33c1('0x4')]?_[_0x33c1('0x7')](_[_0x33c1('0x9')](_0x5584ce[_0x33c1('0x2c')],{'IntervalId':_0x15f3ed['IntervalId']}),_0x33c1('0x2b')):[];if(_0x15f3ed[_0x33c1('0xd')](_0x33c1('0x2d'))){if(_0x15f3ed['tag']&&_0x15f3ed['tag']!=='--'){_0x2b211e[_0x33c1('0x18')]({'type':_0x15f3ed['type'],'app':_0x33c1('0x13'),'appdata':_0x33c1('0x2e')+_0x15f3ed[_0x33c1('0x2d')],'context':_0x15f3ed['context'],'exten':_0x15f3ed['exten'],'priority':_0x4807d9[_0x33c1('0x28')]+_0x5584ce[_0x33c1('0xe')]+_0x56c52a++,'VoiceExtensionId':_0x15f3ed['VoiceExtensionId']});}}if(_0x15f3ed[_0x33c1('0x12')]==='outbound'&&_0x15f3ed[_0x33c1('0xd')](_0x33c1('0x2f'))){if(_0x15f3ed[_0x33c1('0x2f')]){_0x2b211e[_0x33c1('0x18')]({'type':_0x15f3ed[_0x33c1('0x12')],'app':_0x33c1('0x1e'),'appdata':_0x33c1('0x30')+_0x15f3ed[_0x33c1('0x2f')]+')','context':_0x15f3ed[_0x33c1('0x15')],'exten':_0x15f3ed[_0x33c1('0x16')],'priority':_0x4807d9['length']+_0x5584ce[_0x33c1('0xe')]+_0x56c52a++,'VoiceExtensionId':_0x15f3ed['VoiceExtensionId']});}else{_0x2b211e['push']({'type':_0x15f3ed[_0x33c1('0x12')],'app':_0x33c1('0x1e'),'appdata':_0x33c1('0x31'),'context':_0x15f3ed[_0x33c1('0x15')],'exten':_0x15f3ed['exten'],'priority':_0x4807d9[_0x33c1('0x28')]+_0x5584ce[_0x33c1('0xe')]+_0x56c52a++,'VoiceExtensionId':_0x15f3ed['VoiceExtensionId']});}}if(_0x15f3ed['hasOwnProperty']('answer')){if(_0x56214c[_0x33c1('0x32')](_0x15f3ed[_0x33c1('0x33')][_0x33c1('0x29')]())>=0x0&&_0x15f3ed[_0x33c1('0x34')]!==_0x33c1('0x35')){if(_0x15f3ed[_0x33c1('0x36')]){_0x2b211e[_0x33c1('0x18')]({'type':_0x15f3ed['type'],'app':'ExecIf','appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x15f3ed['context'],'exten':_0x15f3ed[_0x33c1('0x16')],'priority':_0x4807d9[_0x33c1('0x28')]+_0x5584ce[_0x33c1('0xe')]+_0x56c52a++,'VoiceExtensionId':_0x15f3ed[_0x33c1('0x19')]});_0x2b211e[_0x33c1('0x18')]({'type':_0x15f3ed[_0x33c1('0x12')],'app':_0x33c1('0x13'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x15f3ed[_0x33c1('0x15')],'exten':_0x15f3ed['exten'],'priority':_0x4807d9[_0x33c1('0x28')]+_0x5584ce['priority']+_0x56c52a++,'VoiceExtensionId':_0x15f3ed['VoiceExtensionId']});}else{_0x2b211e['push']({'type':_0x15f3ed['type'],'app':_0x33c1('0x1e'),'appdata':_0x33c1('0x37'),'context':_0x15f3ed[_0x33c1('0x15')],'exten':_0x15f3ed[_0x33c1('0x16')],'priority':_0x4807d9[_0x33c1('0x28')]+_0x5584ce['priority']+_0x56c52a++,'VoiceExtensionId':_0x15f3ed[_0x33c1('0x19')]});_0x2b211e[_0x33c1('0x18')]({'type':_0x15f3ed[_0x33c1('0x12')],'app':_0x33c1('0x13'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x15f3ed['context'],'exten':_0x15f3ed[_0x33c1('0x16')],'priority':_0x4807d9[_0x33c1('0x28')]+_0x5584ce['priority']+_0x56c52a++,'VoiceExtensionId':_0x15f3ed['VoiceExtensionId']});}}}for(var _0x13aff0=0x0;_0x13aff0<_0x4807d9[_0x33c1('0x28')];_0x13aff0+=0x1){var _0x3e6c0c=_0x5584ce[_0x33c1('0xe')]+_0x4807d9[_0x33c1('0x28')];var _0x3940a5=_0x13aff0===_0x4807d9['length']-0x1?_0x5584ce['priority']+_0x2b211e[_0x33c1('0x28')]+_0x248b7a[_0x33c1('0x28')]+0x2:_0x5584ce['priority']+_0x13aff0+0x1;_0x2b211e[_0x33c1('0x38')](_0x13aff0,0x0,{'type':_0x15f3ed[_0x33c1('0x12')],'app':_0x33c1('0x39'),'appdata':_0x4807d9[_0x13aff0]+'?'+_0x15f3ed[_0x33c1('0x15')]+',${EXTEN},'+_0x3e6c0c+':'+_0x15f3ed[_0x33c1('0x15')]+_0x33c1('0x3a')+_0x3940a5,'exten':_0x15f3ed[_0x33c1('0x16')],'context':_0x15f3ed['context'],'priority':_0x5584ce[_0x33c1('0xe')]+_0x13aff0,'VoiceExtensionId':_0x3f25df[_0x3df7af][0x0][_0x33c1('0x19')]});}_0x15f3ed[_0x33c1('0xe')]=_0x2b211e['length']?_[_0x33c1('0x3b')](_0x2b211e)[_0x33c1('0xe')]+0x1:_0x5584ce[_0x33c1('0xe')];_0x5584ce[_0x33c1('0xe')]=(_0x248b7a[_0x33c1('0x28')]?_['last'](_0x248b7a)[_0x33c1('0xe')]:_0x15f3ed[_0x33c1('0xe')])+0x1;_0x5584ce[_0x33c1('0xf')]=_[_0x33c1('0x3c')](_0x5584ce[_0x33c1('0xf')],_0x2b211e,[_0x15f3ed],_0x248b7a);}_0x5584ce[_0x33c1('0xf')][_0x33c1('0x18')]({'type':_0x3f25df[_0x3df7af][0x0][_0x33c1('0x12')],'app':_0x33c1('0x3d'),'exten':_0x3f25df[_0x3df7af][0x0]['exten'],'context':_0x3f25df[_0x3df7af][0x0]['context'],'priority':_0x5584ce[_0x33c1('0xe')],'VoiceExtensionId':_0x3f25df[_0x3df7af][0x0]['VoiceExtensionId']});_0x531a8b[_0x33c1('0x18')](_0x3f25df[_0x3df7af][0x0]['VoiceExtensionId']);_0x538948=_[_0x33c1('0x3c')](_0x538948,_0x5584ce[_0x33c1('0xf')]);}}return _0x4a75f8[_0x33c1('0x3e')](function(_0x183b09){return _0x4a75f8['models'][_0x33c1('0x2')]['destroy']({'where':{'VoiceExtensionId':{'$in':_0x531a8b}},'transaction':_0x183b09})['then'](function(_0x54c51b){return _0x4a75f8[_0x33c1('0x1')]['VoiceExtension']['bulkCreate'](_['sortBy'](_0x538948,_0x33c1('0xe')),{'transaction':_0x183b09});});});})['catch'](function(_0x25301d){console[_0x33c1('0x3f')](_0x25301d);});}exports[_0x33c1('0x40')]=rewrite; \ No newline at end of file +var _0x86e8=['_XCALLY_MIXMONITOR_FORMAT=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','last','concat','transaction','models','destroy','bulkCreate','sortBy','error','rewrite','lodash','util','Interval','findAll','then','intervals','IntervalId','VoiceExtension','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','hasOwnProperty','priority','extensions','extension','find','push','Set','format','CDR(type)=%s','type','context','CDR(routeid)=','VoiceExtensionId','outbound','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}'];(function(_0x33bf93,_0x5ae58e){var _0x59a7d0=function(_0x19b78f){while(--_0x19b78f){_0x33bf93['push'](_0x33bf93['shift']());}};_0x59a7d0(++_0x5ae58e);}(_0x86e8,0x6b));var _0x886e=function(_0x420b1e,_0x238238){_0x420b1e=_0x420b1e-0x0;var _0x5a2552=_0x86e8[_0x420b1e];return _0x5a2552;};'use strict';var _=require(_0x886e('0x0'));var util=require(_0x886e('0x1'));function rewrite(_0x21f5c1,_0x10830a){var _0x3354cb=this;return _0x21f5c1['models'][_0x886e('0x2')][_0x886e('0x3')]({'raw':!![]})[_0x886e('0x4')](function(_0x3cff4c){_0x3354cb[_0x886e('0x5')]=_0x3cff4c;return _0x21f5c1['models']['VoiceExtension'][_0x886e('0x3')]({'where':{'IntervalId':_0x10830a[_0x886e('0x6')]},'raw':!![]});})[_0x886e('0x4')](function(_0x438ca3){return _0x21f5c1['models'][_0x886e('0x7')]['findAll']({'where':{'exten':{'$in':_[_0x886e('0x8')](_[_0x886e('0x9')](_0x438ca3,_0x886e('0xa')))}},'order':[{'raw':_0x886e('0xb')}],'raw':!![]});})[_0x886e('0x4')](function(_0x5f0963){var _0x3d422d=_[_0x886e('0xc')](_0x5f0963,{'priority':'1'});var _0x4b0fdc=_[_0x886e('0xc')](_0x5f0963,{'isApp':0x1});var _0x393394=_[_0x886e('0xd')](_0x4b0fdc,_0x886e('0xa'));var _0x20292f=['queue','playback'];var _0x510e0c=[];var _0x503bfd=[];for(var _0x418500 in _0x393394){if(_0x393394[_0x886e('0xe')](_0x418500)){_0x3354cb[_0x886e('0xf')]=0x2;_0x3354cb[_0x886e('0x10')]=[];_0x3354cb[_0x886e('0x11')]=_[_0x886e('0x12')](_0x3d422d,{'exten':_0x393394[_0x418500][0x0][_0x886e('0xa')]});_0x3354cb['extensions'][_0x886e('0x13')]({'type':_0x393394[_0x418500][0x0]['type'],'app':_0x886e('0x14'),'appdata':util[_0x886e('0x15')](_0x886e('0x16'),_0x393394[_0x418500][0x0][_0x886e('0x17')]),'context':_0x393394[_0x418500][0x0][_0x886e('0x18')],'exten':_0x393394[_0x418500][0x0][_0x886e('0xa')],'priority':_0x3354cb['priority']++,'VoiceExtensionId':_0x393394[_0x418500][0x0]['VoiceExtensionId']});if(_0x393394[_0x418500][0x0][_0x886e('0x17')]==='inbound'){_0x3354cb[_0x886e('0x10')][_0x886e('0x13')]({'type':_0x393394[_0x418500][0x0][_0x886e('0x17')],'app':_0x886e('0x14'),'appdata':_0x886e('0x19')+_0x393394[_0x418500][0x0][_0x886e('0x1a')],'context':_0x393394[_0x418500][0x0][_0x886e('0x18')],'exten':_0x393394[_0x418500][0x0][_0x886e('0xa')],'priority':_0x3354cb[_0x886e('0xf')]++,'VoiceExtensionId':_0x393394[_0x418500][0x0][_0x886e('0x1a')]});}else if(_0x393394[_0x418500][0x0][_0x886e('0x17')]===_0x886e('0x1b')){if(_0x3354cb['extension']){_0x3354cb['extensions'][_0x886e('0x13')]({'type':_0x393394[_0x418500][0x0][_0x886e('0x17')],'app':_0x886e('0x14'),'appdata':'CDR(destination)='+(_0x3354cb[_0x886e('0x11')][_0x886e('0x1c')]?_0x886e('0x1d')+_0x3354cb[_0x886e('0x11')][_0x886e('0x1c')]+'}':_0x886e('0x1e')),'context':_0x393394[_0x418500][0x0][_0x886e('0x18')],'exten':_0x393394[_0x418500][0x0][_0x886e('0xa')],'priority':_0x3354cb[_0x886e('0xf')]++,'VoiceExtensionId':_0x393394[_0x418500][0x0][_0x886e('0x1a')]});}_0x3354cb[_0x886e('0x10')][_0x886e('0x13')]({'type':_0x393394[_0x418500][0x0]['type'],'app':'Set','appdata':_0x886e('0x19')+_0x393394[_0x418500][0x0]['VoiceExtensionId'],'context':_0x393394[_0x418500][0x0][_0x886e('0x18')],'exten':_0x393394[_0x418500][0x0]['exten'],'priority':_0x3354cb['priority']++,'VoiceExtensionId':_0x393394[_0x418500][0x0][_0x886e('0x1a')]});var _0x12a4b7=_0x3354cb['priority']++;_0x3354cb[_0x886e('0x10')][_0x886e('0x13')]({'type':_0x393394[_0x418500][0x0][_0x886e('0x17')],'app':_0x886e('0x1f'),'appdata':_0x886e('0x20')+(_0x12a4b7+0x2)+_0x886e('0x21')+(_0x12a4b7+0x1)+')','context':_0x393394[_0x418500][0x0][_0x886e('0x18')],'exten':_0x393394[_0x418500][0x0][_0x886e('0xa')],'priority':_0x12a4b7,'VoiceExtensionId':_0x393394[_0x418500][0x0][_0x886e('0x1a')]});if(_0x3354cb[_0x886e('0x11')]){_0x3354cb[_0x886e('0x10')][_0x886e('0x13')]({'type':_0x393394[_0x418500][0x0][_0x886e('0x17')],'app':'Set','appdata':_0x3354cb[_0x886e('0x11')][_0x886e('0x1c')]?_0x886e('0x22')+_0x3354cb[_0x886e('0x11')][_0x886e('0x1c')]+'}':_0x886e('0x23'),'context':_0x393394[_0x418500][0x0]['context'],'exten':_0x393394[_0x418500][0x0]['exten'],'priority':_0x3354cb[_0x886e('0xf')]++,'VoiceExtensionId':_0x393394[_0x418500][0x0][_0x886e('0x1a')]});}_0x3354cb[_0x886e('0x10')]['push']({'type':_0x393394[_0x418500][0x0]['type'],'app':_0x886e('0x14'),'appdata':_0x886e('0x24')+_0x393394[_0x418500][0x0][_0x886e('0x1a')],'context':_0x393394[_0x418500][0x0][_0x886e('0x18')],'exten':_0x393394[_0x418500][0x0][_0x886e('0xa')],'priority':_0x3354cb['priority']++,'VoiceExtensionId':_0x393394[_0x418500][0x0]['VoiceExtensionId']});if(_0x3354cb[_0x886e('0x11')]&&_0x3354cb['extension']['hasOwnProperty'](_0x886e('0x25'))&&_0x3354cb[_0x886e('0x11')][_0x886e('0x25')]!=='none'){_0x3354cb[_0x886e('0x10')][_0x886e('0x13')]({'type':_0x393394[_0x418500][0x0][_0x886e('0x17')],'app':_0x886e('0x14'),'appdata':_0x886e('0x26'),'context':_0x393394[_0x418500][0x0][_0x886e('0x18')],'exten':_0x393394[_0x418500][0x0][_0x886e('0xa')],'priority':_0x3354cb[_0x886e('0xf')]++,'VoiceExtensionId':_0x393394[_0x418500][0x0]['VoiceExtensionId']});_0x3354cb['extensions'][_0x886e('0x13')]({'type':_0x393394[_0x418500][0x0][_0x886e('0x17')],'app':_0x886e('0x14'),'appdata':_0x886e('0x27')+_0x3354cb[_0x886e('0x11')]['recordingFormat']||'wav','context':_0x393394[_0x418500][0x0][_0x886e('0x18')],'exten':_0x393394[_0x418500][0x0][_0x886e('0xa')],'priority':_0x3354cb[_0x886e('0xf')]++,'VoiceExtensionId':_0x393394[_0x418500][0x0][_0x886e('0x1a')]});}}_0x3354cb[_0x886e('0x10')]['push']({'type':_0x393394[_0x418500][0x0][_0x886e('0x17')],'app':_0x886e('0x14'),'appdata':_0x886e('0x28'),'context':_0x393394[_0x418500][0x0][_0x886e('0x18')],'exten':_0x393394[_0x418500][0x0][_0x886e('0xa')],'priority':_0x3354cb[_0x886e('0xf')]++,'VoiceExtensionId':_0x393394[_0x418500][0x0][_0x886e('0x1a')]});_0x3354cb['extensions'][_0x886e('0x13')]({'type':_0x393394[_0x418500][0x0][_0x886e('0x17')],'app':_0x886e('0x14'),'appdata':_0x886e('0x29'),'context':_0x393394[_0x418500][0x0][_0x886e('0x18')],'exten':_0x393394[_0x418500][0x0][_0x886e('0xa')],'priority':_0x3354cb['priority']++,'VoiceExtensionId':_0x393394[_0x418500][0x0]['VoiceExtensionId']});_0x3354cb[_0x886e('0x10')]['push']({'type':_0x393394[_0x418500][0x0]['type'],'app':_0x886e('0x14'),'appdata':_0x886e('0x2a'),'context':_0x393394[_0x418500][0x0]['context'],'exten':_0x393394[_0x418500][0x0][_0x886e('0xa')],'priority':_0x3354cb[_0x886e('0xf')]++,'VoiceExtensionId':_0x393394[_0x418500][0x0][_0x886e('0x1a')]});for(var _0x28a750=0x0,_0x11c3a3=0x0;_0x28a750<_0x393394[_0x418500][_0x886e('0x2b')];_0x28a750+=0x1,_0x11c3a3=0x0){var _0x538dd3=_0x393394[_0x418500][_0x28a750];if(_0x538dd3[_0x886e('0x17')]){_0x538dd3[_0x886e('0x17')]=_0x538dd3['type'][_0x886e('0x2c')]();}var _0x6133e4=[];var _0x199ca4=[];delete _0x538dd3['id'];delete _0x538dd3[_0x886e('0x2d')];delete _0x538dd3[_0x886e('0x2e')];var _0x2e2c98=_0x538dd3[_0x886e('0x2f')]!==_0x886e('0x30')?[_0x538dd3[_0x886e('0x2f')]]:_0x538dd3[_0x886e('0x6')]?_[_0x886e('0x9')](_[_0x886e('0xc')](_0x3354cb[_0x886e('0x5')],{'IntervalId':_0x538dd3['IntervalId']}),_0x886e('0x2f')):[];if(_0x538dd3['hasOwnProperty'](_0x886e('0x31'))){if(_0x538dd3[_0x886e('0x31')]&&_0x538dd3[_0x886e('0x31')]!=='--'){_0x6133e4[_0x886e('0x13')]({'type':_0x538dd3['type'],'app':_0x886e('0x14'),'appdata':_0x886e('0x32')+_0x538dd3['tag'],'context':_0x538dd3[_0x886e('0x18')],'exten':_0x538dd3[_0x886e('0xa')],'priority':_0x2e2c98[_0x886e('0x2b')]+_0x3354cb[_0x886e('0xf')]+_0x11c3a3++,'VoiceExtensionId':_0x538dd3[_0x886e('0x1a')]});}}if(_0x538dd3[_0x886e('0x17')]===_0x886e('0x1b')&&_0x538dd3['hasOwnProperty']('callerID')){if(_0x538dd3['callerID']){_0x6133e4[_0x886e('0x13')]({'type':_0x538dd3['type'],'app':_0x886e('0x1f'),'appdata':_0x886e('0x33')+_0x538dd3[_0x886e('0x34')]+')','context':_0x538dd3[_0x886e('0x18')],'exten':_0x538dd3[_0x886e('0xa')],'priority':_0x2e2c98[_0x886e('0x2b')]+_0x3354cb[_0x886e('0xf')]+_0x11c3a3++,'VoiceExtensionId':_0x538dd3[_0x886e('0x1a')]});}else{_0x6133e4[_0x886e('0x13')]({'type':_0x538dd3[_0x886e('0x17')],'app':_0x886e('0x1f'),'appdata':_0x886e('0x35'),'context':_0x538dd3[_0x886e('0x18')],'exten':_0x538dd3['exten'],'priority':_0x2e2c98['length']+_0x3354cb[_0x886e('0xf')]+_0x11c3a3++,'VoiceExtensionId':_0x538dd3[_0x886e('0x1a')]});}}if(_0x538dd3[_0x886e('0xe')](_0x886e('0x36'))){if(_0x20292f[_0x886e('0x37')](_0x538dd3['app']['toLowerCase']())>=0x0&&_0x538dd3[_0x886e('0x38')]!==_0x886e('0x39')){if(_0x538dd3['answer']){_0x6133e4[_0x886e('0x13')]({'type':_0x538dd3[_0x886e('0x17')],'app':_0x886e('0x1f'),'appdata':_0x886e('0x3a'),'context':_0x538dd3[_0x886e('0x18')],'exten':_0x538dd3['exten'],'priority':_0x2e2c98[_0x886e('0x2b')]+_0x3354cb[_0x886e('0xf')]+_0x11c3a3++,'VoiceExtensionId':_0x538dd3[_0x886e('0x1a')]});_0x6133e4[_0x886e('0x13')]({'type':_0x538dd3[_0x886e('0x17')],'app':_0x886e('0x14'),'appdata':_0x886e('0x3b'),'context':_0x538dd3[_0x886e('0x18')],'exten':_0x538dd3[_0x886e('0xa')],'priority':_0x2e2c98[_0x886e('0x2b')]+_0x3354cb[_0x886e('0xf')]+_0x11c3a3++,'VoiceExtensionId':_0x538dd3[_0x886e('0x1a')]});}else{_0x6133e4[_0x886e('0x13')]({'type':_0x538dd3[_0x886e('0x17')],'app':_0x886e('0x1f'),'appdata':_0x886e('0x3c'),'context':_0x538dd3[_0x886e('0x18')],'exten':_0x538dd3[_0x886e('0xa')],'priority':_0x2e2c98[_0x886e('0x2b')]+_0x3354cb['priority']+_0x11c3a3++,'VoiceExtensionId':_0x538dd3['VoiceExtensionId']});_0x6133e4['push']({'type':_0x538dd3['type'],'app':_0x886e('0x14'),'appdata':_0x886e('0x3d'),'context':_0x538dd3['context'],'exten':_0x538dd3[_0x886e('0xa')],'priority':_0x2e2c98[_0x886e('0x2b')]+_0x3354cb[_0x886e('0xf')]+_0x11c3a3++,'VoiceExtensionId':_0x538dd3[_0x886e('0x1a')]});}}}for(var _0x45363b=0x0;_0x45363b<_0x2e2c98[_0x886e('0x2b')];_0x45363b+=0x1){var _0x3f0a48=_0x3354cb[_0x886e('0xf')]+_0x2e2c98[_0x886e('0x2b')];var _0x3a1891=_0x45363b===_0x2e2c98[_0x886e('0x2b')]-0x1?_0x3354cb[_0x886e('0xf')]+_0x6133e4[_0x886e('0x2b')]+_0x199ca4[_0x886e('0x2b')]+0x2:_0x3354cb['priority']+_0x45363b+0x1;_0x6133e4['splice'](_0x45363b,0x0,{'type':_0x538dd3['type'],'app':_0x886e('0x3e'),'appdata':_0x2e2c98[_0x45363b]+'?'+_0x538dd3['context']+_0x886e('0x3f')+_0x3f0a48+':'+_0x538dd3[_0x886e('0x18')]+',${EXTEN},'+_0x3a1891,'exten':_0x538dd3['exten'],'context':_0x538dd3[_0x886e('0x18')],'priority':_0x3354cb[_0x886e('0xf')]+_0x45363b,'VoiceExtensionId':_0x393394[_0x418500][0x0][_0x886e('0x1a')]});}_0x538dd3['priority']=_0x6133e4['length']?_['last'](_0x6133e4)[_0x886e('0xf')]+0x1:_0x3354cb[_0x886e('0xf')];_0x3354cb[_0x886e('0xf')]=(_0x199ca4['length']?_[_0x886e('0x40')](_0x199ca4)['priority']:_0x538dd3[_0x886e('0xf')])+0x1;_0x3354cb[_0x886e('0x10')]=_[_0x886e('0x41')](_0x3354cb[_0x886e('0x10')],_0x6133e4,[_0x538dd3],_0x199ca4);}_0x3354cb[_0x886e('0x10')][_0x886e('0x13')]({'type':_0x393394[_0x418500][0x0][_0x886e('0x17')],'app':'Hangup','exten':_0x393394[_0x418500][0x0][_0x886e('0xa')],'context':_0x393394[_0x418500][0x0]['context'],'priority':_0x3354cb[_0x886e('0xf')],'VoiceExtensionId':_0x393394[_0x418500][0x0][_0x886e('0x1a')]});_0x510e0c[_0x886e('0x13')](_0x393394[_0x418500][0x0][_0x886e('0x1a')]);_0x503bfd=_[_0x886e('0x41')](_0x503bfd,_0x3354cb['extensions']);}}return _0x21f5c1[_0x886e('0x42')](function(_0x7802c){return _0x21f5c1[_0x886e('0x43')][_0x886e('0x7')][_0x886e('0x44')]({'where':{'VoiceExtensionId':{'$in':_0x510e0c}},'transaction':_0x7802c})['then'](function(_0x2bfd3e){return _0x21f5c1[_0x886e('0x43')][_0x886e('0x7')][_0x886e('0x45')](_[_0x886e('0x46')](_0x503bfd,'priority'),{'transaction':_0x7802c});});});})['catch'](function(_0x2ebd1d){console[_0x886e('0x47')](_0x2ebd1d);});}exports[_0x886e('0x48')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 43ad05d..9ab3acf 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 _0x71f0=['Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','inspect','insert','into','cm_hopper','scheduledAt','ContactId','updatedAt','field','toString','createdAt','NOW()','cm_contacts','where','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','from','\x20=\x20?','fromQuery','ListId\x20=\x20?','id\x20IN\x20?','str','calleridnum','cm_hopper_black','VoiceQueue','outbound','Lists','dialCheckDuplicateType','always','push','onlyIfOpen','sequelize','query','VoiceQueueId','all','findAll','CmList','BlackLists','get','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','contact:csv_','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','SIGINT','CSV\x20import\x20process\x20stopped!','parse','info','CSV\x20parse\x20error','bluebird','util','lodash','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','api','defaults','redis','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','zipObject','split','Missing\x20socket_timestamp\x20parameter!','error','contact','index','test','isNil','errors','length','map','message','join','hasOwnProperty','data','firstName','phone','phone\x20not\x20specified!','birthDate','isValid','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','duplicate','CmContact','create','keys','then','pick','catch'];(function(_0x5a2d3f,_0x27b04e){var _0x5c65d8=function(_0x2d1965){while(--_0x2d1965){_0x5a2d3f['push'](_0x5a2d3f['shift']());}};_0x5c65d8(++_0x27b04e);}(_0x71f0,0xa5));var _0x071f=function(_0x36de4f,_0x350d30){_0x36de4f=_0x36de4f-0x0;var _0x1a91c2=_0x71f0[_0x36de4f];return _0x1a91c2;};'use strict';var BPromise=require(_0x071f('0x0'));var util=require(_0x071f('0x1'));var _=require(_0x071f('0x2'));var fs=require('fs');var squel=require(_0x071f('0x3'));var Papa=require('papaparse');var Redis=require(_0x071f('0x4'));var db=require(_0x071f('0x5'))['db'];var config=require(_0x071f('0x6'));var logger=require(_0x071f('0x7'))(_0x071f('0x8'));config['redis']=_[_0x071f('0x9')](config[_0x071f('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x071f('0xb'))(new Redis(config['redis']));require(_0x071f('0xc'))[_0x071f('0xd')](socket);try{if(!process[_0x071f('0xe')][0x2]||process[_0x071f('0xe')][0x2]===_0x071f('0xf')||process['argv'][0x2]===_0x071f('0x10')){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process['argv'][0x2];if(!process[_0x071f('0xe')][0x3]||process[_0x071f('0xe')][0x3]===_0x071f('0xf')||process[_0x071f('0xe')][0x3]===_0x071f('0x10')||!process[_0x071f('0xe')][0x4]||process['argv'][0x4]===_0x071f('0xf')||process[_0x071f('0xe')][0x4]===_0x071f('0x10')){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0x071f('0x11')](process[_0x071f('0xe')][0x3]['split'](','),process[_0x071f('0xe')][0x4][_0x071f('0x12')](','));if(!process[_0x071f('0xe')][0x5]||process['argv'][0x5]===_0x071f('0xf')||process['argv'][0x5]===_0x071f('0x10')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0x071f('0xe')][0x5];var COMPANYID=process[_0x071f('0xe')][0x6]&&process[_0x071f('0xe')][0x6]!=='undefined'&&process[_0x071f('0xe')][0x6]!==_0x071f('0x10')?process[_0x071f('0xe')][0x6]:null;var DUPLICATES=process[_0x071f('0xe')][0x7]&&process[_0x071f('0xe')][0x7]!==_0x071f('0xf')&&process[_0x071f('0xe')][0x7]!==_0x071f('0x10')?process[_0x071f('0xe')][0x7]:null;if(!process[_0x071f('0xe')][0x8]||process[_0x071f('0xe')][0x8]===_0x071f('0xf')||process['argv'][0x8]===_0x071f('0x10')){throw new Error(_0x071f('0x13'));}var SOCKET_TIMESTAMP=process[_0x071f('0xe')][0x8];}catch(_0x1b564f){logger[_0x071f('0x14')](_0x1b564f);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(_0x35d342,_0x3b0923,_0x1474b9,_0x1b27dd){var _0x2ce50a={'message':_0x3b0923};_0x2ce50a[_0x35d342]=!![];if(_0x1474b9){_0x2ce50a[_0x071f('0x15')]=_0x1474b9;}if(_0x1b27dd){_0x2ce50a[_0x071f('0x16')]=_0x1b27dd;}return _0x2ce50a;}function isEmail(_0x2f5317){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))*$/[_0x071f('0x17')](_0x2f5317);}function checkRow(_0xfd9f5,_0x3283b9,_0x3e9953){return new BPromise(function(_0x1d726d,_0x53c309){if(_[_0x071f('0x18')](_0xfd9f5)){return _0x53c309(handleCheckRowError('error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x3e9953));}if(_0xfd9f5[_0x071f('0x19')]&&_0xfd9f5[_0x071f('0x19')][_0x071f('0x1a')]){var _0x396cea=_[_0x071f('0x1b')](_0xfd9f5[_0x071f('0x19')],_0x071f('0x1c'))[_0x071f('0x1d')](';');return _0x53c309(handleCheckRowError('error',_0x396cea,null,_0x3e9953));}var _0x33de2e={};for(var _0x33c9a0 in FIELDS){if(FIELDS[_0x071f('0x1e')](_0x33c9a0)&&FIELDS[_0x33c9a0]){_0x33de2e[_0x33c9a0]=_0xfd9f5['data'][0x0][FIELDS[_0x33c9a0]]||_0xfd9f5[_0x071f('0x1f')][0x0]['\ufeff'+FIELDS[_0x33c9a0]];}}if(!_0x33de2e[_0x071f('0x20')]){return _0x53c309(handleCheckRowError(_0x071f('0x14'),'firstName\x20not\x20specified!',null,_0x3e9953));}if(!_0x33de2e[_0x071f('0x21')]){return _0x53c309(handleCheckRowError(_0x071f('0x14'),_0x071f('0x22'),null,_0x3e9953));}if(_0x33de2e[_0x071f('0x23')]){var _0x32ea2c=moment(_0x33de2e[_0x071f('0x23')],'YYYY-MM-DD');if(!_0x32ea2c[_0x071f('0x24')]()){return _0x53c309(handleCheckRowError('error','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x3e9953));}}if(_0x33de2e[_0x071f('0x25')]){if(!isEmail(_0x33de2e[_0x071f('0x25')])){return _0x53c309(handleCheckRowError(_0x071f('0x14'),_0x071f('0x26'),null,_0x3e9953));}}_0x33de2e[_0x071f('0x27')]=LISTID;_0x33de2e[_0x071f('0x28')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x071f('0x1a')]&&_0x3283b9){var _0xefebdd={};for(var _0x405e12=0x0,_0x437ea0=DUPLICATES[_0x071f('0x1a')];_0x405e12<_0x437ea0;_0x405e12+=0x1){_0xefebdd[DUPLICATES[_0x405e12]]=_0x33de2e[DUPLICATES[_0x405e12]];}var _0x40b73b=_[_0x071f('0x29')](_0x3283b9,_0xefebdd);if(_0x40b73b){return _0x53c309(handleCheckRowError(_0x071f('0x2a'),'Duplicate\x20Contact',_0x40b73b,_0x3e9953));}}return db[_0x071f('0x2b')][_0x071f('0x2c')](_0x33de2e,{'raw':!![],'hooks':![],'fields':_[_0x071f('0x2d')](_0x33de2e)})[_0x071f('0x2e')](function(_0x53c2ab){if(DUPLICATES&&DUPLICATES['length']&&_0x3283b9){_0x3283b9['push'](_[_0x071f('0x2f')](_0x33de2e,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x53c2ab['id'];return _0x1d726d();})[_0x071f('0x30')](function(_0x4f7f59){return _0x53c309(handleCheckRowError(_0x071f('0x14'),_0x071f('0x31')+(_0x4f7f59[_0x071f('0x1c')]||JSON[_0x071f('0x32')](_0x4f7f59)),null,_0x3e9953));});});}function checkHopper(){function _0x3dd3e9(){return function(_0x5c3e09){logger['error'](_0x071f('0x33'),'checkHopper',util[_0x071f('0x34')](_0x5c3e09,{'showHidden':![],'depth':null}));};}var _0x11b440=function(_0x8c1db3,_0x83816a){var _0x5cbe2e=squel[_0x071f('0x35')]()[_0x071f('0x36')](_0x071f('0x37'))['fromQuery'](['phone',_0x071f('0x38'),_0x071f('0x39'),'ListId',_0x83816a,'createdAt',_0x071f('0x3a')],squel['select']()[_0x071f('0x3b')](_0x071f('0x21'),_0x071f('0x21'))[_0x071f('0x3b')]('NOW()',_0x071f('0x38'))['field']('id',_0x071f('0x39'))[_0x071f('0x3b')](LISTID[_0x071f('0x3c')](),'ListId')[_0x071f('0x3b')](_0x8c1db3['id'][_0x071f('0x3c')](),_0x83816a)[_0x071f('0x3b')]('NOW()',_0x071f('0x3d'))[_0x071f('0x3b')](_0x071f('0x3e'),'updatedAt')['from'](_0x071f('0x3f'))[_0x071f('0x40')](_0x071f('0x41'))[_0x071f('0x40')]('ListId\x20=\x20?',LISTID['toString']())[_0x071f('0x40')](_0x071f('0x42'))['where'](_0x071f('0x43'),squel[_0x071f('0x44')]()[_0x071f('0x3b')](_0x071f('0x21'))[_0x071f('0x45')](_0x071f('0x37'))[_0x071f('0x40')](_0x83816a+_0x071f('0x46'),_0x8c1db3['id']['toString']())))['toString']();return _0x5cbe2e;};var _0x489903=function(_0x4e4383,_0x189774){var _0x25fc7a=squel[_0x071f('0x35')]()[_0x071f('0x36')]('cm_hopper')[_0x071f('0x47')](['phone',_0x071f('0x38'),_0x071f('0x39'),'ListId',_0x189774,_0x071f('0x3d'),'updatedAt'],squel[_0x071f('0x44')]()[_0x071f('0x3b')](_0x071f('0x21'),_0x071f('0x21'))['field'](_0x071f('0x3e'),_0x071f('0x38'))['field']('id',_0x071f('0x39'))['field'](LISTID[_0x071f('0x3c')](),_0x071f('0x27'))['field'](_0x4e4383['id'][_0x071f('0x3c')](),_0x189774)[_0x071f('0x3b')](_0x071f('0x3e'),_0x071f('0x3d'))[_0x071f('0x3b')](_0x071f('0x3e'),'updatedAt')[_0x071f('0x45')](_0x071f('0x3f'))['where'](_0x071f('0x41'))[_0x071f('0x40')](_0x071f('0x48'),LISTID[_0x071f('0x3c')]())['where'](_0x071f('0x49'),squel[_0x071f('0x4a')](hopperContacts))[_0x071f('0x40')]('phone\x20IS\x20NOT\x20NULL')[_0x071f('0x40')]('phone\x20NOT\x20IN\x20(?)',squel[_0x071f('0x44')]()[_0x071f('0x3b')](_0x071f('0x4b'))[_0x071f('0x45')]('cm_hopper_final')[_0x071f('0x40')](_0x189774+_0x071f('0x46'),_0x4e4383['id'][_0x071f('0x3c')]()))[_0x071f('0x40')](_0x071f('0x43'),squel[_0x071f('0x44')]()[_0x071f('0x3b')](_0x071f('0x21'))[_0x071f('0x45')]('cm_hopper')[_0x071f('0x40')](_0x189774+_0x071f('0x46'),_0x4e4383['id']['toString']())))[_0x071f('0x3c')]();return _0x25fc7a;};function _0x213de4(_0x4233b8,_0x29d988){var _0x119ae3=squel['insert']()[_0x071f('0x36')](_0x071f('0x37'))['fromQuery']([_0x071f('0x21'),_0x071f('0x38'),_0x071f('0x39'),'ListId',_0x29d988,_0x071f('0x3d'),_0x071f('0x3a')],squel['select']()[_0x071f('0x3b')](_0x071f('0x21'),_0x071f('0x21'))['field'](_0x071f('0x3e'),_0x071f('0x38'))[_0x071f('0x3b')]('id',_0x071f('0x39'))[_0x071f('0x3b')](LISTID[_0x071f('0x3c')](),_0x071f('0x27'))['field'](_0x4233b8['id'][_0x071f('0x3c')](),_0x29d988)[_0x071f('0x3b')](_0x071f('0x3e'),_0x071f('0x3d'))[_0x071f('0x3b')](_0x071f('0x3e'),_0x071f('0x3a'))[_0x071f('0x45')]('cm_contacts')[_0x071f('0x40')](_0x071f('0x41'))[_0x071f('0x40')](_0x071f('0x48'),LISTID[_0x071f('0x3c')]())[_0x071f('0x40')]('id\x20IN\x20?',squel[_0x071f('0x4a')](hopperContacts))[_0x071f('0x40')](_0x071f('0x42')))['toString']();return _0x119ae3;}function _0xbec20a(_0x4c5cc6,_0xbb955d){var _0x4356d0=squel['insert']()[_0x071f('0x36')](_0x071f('0x4c'))['fromQuery']([_0x071f('0x21'),_0x071f('0x39'),_0x071f('0x27'),_0xbb955d,'createdAt',_0x071f('0x3a')],squel['select']()[_0x071f('0x3b')]('phone',_0x071f('0x21'))[_0x071f('0x3b')]('id',_0x071f('0x39'))[_0x071f('0x3b')](LISTID[_0x071f('0x3c')](),_0x071f('0x27'))[_0x071f('0x3b')](_0x4c5cc6['id'][_0x071f('0x3c')](),_0xbb955d)[_0x071f('0x3b')](_0x071f('0x3e'),_0x071f('0x3d'))['field'](_0x071f('0x3e'),_0x071f('0x3a'))[_0x071f('0x45')](_0x071f('0x3f'))[_0x071f('0x40')](_0x071f('0x41'))[_0x071f('0x40')](_0x071f('0x48'),LISTID[_0x071f('0x3c')]())[_0x071f('0x40')](_0x071f('0x49'),squel[_0x071f('0x4a')](hopperContacts))[_0x071f('0x40')](_0x071f('0x42')))['toString']();return _0x4356d0;}return db[_0x071f('0x4d')]['findAll']({'where':{'type':_0x071f('0x4e')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db['CmList'],'as':_0x071f('0x4f'),'where':{'id':LISTID}}]})[_0x071f('0x2e')](function(_0x4e2382){var _0x15876a=[];if(_0x4e2382){var _0x5e5e4b;for(var _0x1cd270=0x0,_0x2e67d0;_0x1cd270<_0x4e2382[_0x071f('0x1a')];_0x1cd270+=0x1){_0x2e67d0=_0x4e2382[_0x1cd270]['get']({'plain':!![]});switch(_0x2e67d0[_0x071f('0x50')]){case _0x071f('0x51'):_0x15876a[_0x071f('0x52')](db['sequelize']['query'](_0x489903(_0x2e67d0,'VoiceQueueId'))[_0x071f('0x2e')](function(){})[_0x071f('0x30')](_0x3dd3e9()));break;case _0x071f('0x53'):_0x15876a['push'](db[_0x071f('0x54')][_0x071f('0x55')](_0x11b440(_0x2e67d0,_0x071f('0x56')))[_0x071f('0x2e')](function(){})[_0x071f('0x30')](_0x3dd3e9()));break;default:_0x15876a[_0x071f('0x52')](db[_0x071f('0x54')]['query'](_0x213de4(_0x2e67d0,_0x071f('0x56')))[_0x071f('0x2e')](function(){})['catch'](_0x3dd3e9()));}}}return _0x15876a;})[_0x071f('0x57')]()[_0x071f('0x2e')](function(){return db[_0x071f('0x4d')][_0x071f('0x58')]({'where':{'type':_0x071f('0x4e')},'attributes':['id'],'include':[{'model':db[_0x071f('0x59')],'as':_0x071f('0x5a'),'where':{'id':LISTID}}]})[_0x071f('0x2e')](function(_0x448dbf){var _0x125205=[];if(_0x448dbf){var _0x53c61c;for(var _0x459eda=0x0,_0x52e1f3;_0x459eda<_0x448dbf[_0x071f('0x1a')];_0x459eda+=0x1){_0x52e1f3=_0x448dbf[_0x459eda][_0x071f('0x5b')]({'plain':!![]});_0x125205['push'](db[_0x071f('0x54')]['query'](_0xbec20a(_0x52e1f3,_0x071f('0x56')))[_0x071f('0x2e')](function(){})[_0x071f('0x30')](_0x3dd3e9()));}}return _0x125205;})[_0x071f('0x57')]();})[_0x071f('0x2e')](function(){return db[_0x071f('0x5c')][_0x071f('0x58')]({'attributes':['id',_0x071f('0x50')],'include':[{'model':db[_0x071f('0x59')],'as':'Lists','where':{'id':LISTID}}]})[_0x071f('0x2e')](function(_0x4e5d9a){var _0x229398=[];if(_0x4e5d9a){for(var _0x2d3f9c=0x0,_0x159743;_0x2d3f9c<_0x4e5d9a[_0x071f('0x1a')];_0x2d3f9c+=0x1){_0x159743=_0x4e5d9a[_0x2d3f9c][_0x071f('0x5b')]({'plain':!![]});switch(_0x159743['dialCheckDuplicateType']){case'always':_0x229398[_0x071f('0x52')](db[_0x071f('0x54')][_0x071f('0x55')](_0x489903(_0x159743,'CampaignId'))[_0x071f('0x2e')](function(){})[_0x071f('0x30')](_0x3dd3e9()));break;case _0x071f('0x53'):_0x229398['push'](db[_0x071f('0x54')][_0x071f('0x55')](_0x11b440(_0x159743,_0x071f('0x5d')))[_0x071f('0x2e')](function(){})[_0x071f('0x30')](_0x3dd3e9()));break;default:_0x229398[_0x071f('0x52')](db[_0x071f('0x54')][_0x071f('0x55')](_0x213de4(_0x159743,_0x071f('0x5d')))[_0x071f('0x2e')](function(){})['catch'](_0x3dd3e9()));}}}return _0x229398;})[_0x071f('0x57')]();})[_0x071f('0x2e')](function(){return db['Campaign'][_0x071f('0x58')]({'attributes':['id'],'include':[{'model':db[_0x071f('0x59')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x071f('0x2e')](function(_0x2391fc){var _0x16aace=[];if(_0x2391fc){for(var _0x1ae031=0x0,_0x65b24c;_0x1ae031<_0x2391fc[_0x071f('0x1a')];_0x1ae031+=0x1){_0x65b24c=_0x2391fc[_0x1ae031][_0x071f('0x5b')]({'plain':!![]});_0x16aace[_0x071f('0x52')](db[_0x071f('0x54')][_0x071f('0x55')](_0xbec20a(_0x65b24c,_0x071f('0x5d')))['then'](function(){})[_0x071f('0x30')](_0x3dd3e9()));}}return _0x16aace;})[_0x071f('0x57')]();})[_0x071f('0x30')](function(_0x31f413){logger[_0x071f('0x14')](_0x071f('0x5e'),_0x071f('0x5f'),_0x31f413[_0x071f('0x1c')]);});}var processPromises=function(_0x4c0ca3){return BPromise[_0x071f('0x57')](promises)[_0x071f('0x2e')](function(_0x77c1c){})[_0x071f('0x30')](function(_0x184a4d){logger['error'](_0x071f('0x60'),JSON['stringify'](_0x184a4d));})[_0x071f('0x61')](function(){socket['emit'](_0x071f('0x62')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x4c0ca3){return _0x4c0ca3['resume']();}});};var endCsv=function(){return BPromise[_0x071f('0x63')]()[_0x071f('0x2e')](function(){if(hopperContacts){return checkHopper();}})[_0x071f('0x2e')](function(){socket['emit'](_0x071f('0x62')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x071f('0x64')](FILEPATH);}catch(_0x437794){logger['error'](_0x071f('0x65'),JSON['stringify'](_0x437794));}finally{process['exit'](0x0);}});};process['on'](_0x071f('0x66'),function(){logger['info'](_0x071f('0x67'));endCsv();});function main(){return BPromise[_0x071f('0x63')]()[_0x071f('0x2e')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x071f('0x12')](',');return db[_0x071f('0x2b')][_0x071f('0x58')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x45439f){var _0x4d84a0=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x071f('0x68')](_0x4d84a0,{'header':!![],'skipEmptyLines':!![],'step':function(_0xa07bca,_0x5a4883){total+=0x1;var _0x250c2f=total;promises[_0x071f('0x52')](checkRow(_0xa07bca,_0x45439f,_0x250c2f)['then'](function(){success+=0x1;})['catch'](function(_0x4e1c72){if(_0x4e1c72[_0x071f('0x14')]){errors+=0x1;delete _0x4e1c72[_0x071f('0x14')];}else if(_0x4e1c72[_0x071f('0x2a')]){duplicates+=0x1;delete _0x4e1c72[_0x071f('0x2a')];}rows['push'](_0x4e1c72);}));if(total%0xc8===0x0){_0x5a4883['pause']();return processPromises(_0x5a4883);}},'complete':function(){return processPromises()[_0x071f('0x2e')](function(){logger[_0x071f('0x69')]('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x360eee,_0x5dddaf){logger[_0x071f('0x69')](_0x071f('0x6a'),JSON['stringify'](_0x360eee));endCsv();}});})['catch'](function(_0x102049){logger[_0x071f('0x14')]('Error\x20executing\x20contact\x20csv\x20import:',JSON['stringify'](_0x102049));});}main(); \ No newline at end of file +var _0xd76a=['push','sequelize','query','VoiceQueueId','onlyIfOpen','all','CmList','BlackLists','Campaign','CampaignId','cmContact,\x20%s,\x20%s','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resolve','unlinkSync','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','createReadStream','parse','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','squel','papaparse','ioredis','../../../mysqldb','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','argv','Missing\x20filepath\x20parameter!','undefined','null','zipObject','split','Missing\x20ListId\x20parameter!','error','test','errors','map','message','join','hasOwnProperty','data','firstName','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','ListId','CompanyId','length','find','duplicate','Duplicate\x20Contact','CmContact','create','keys','pick','catch','stringify','cmContact','inspect','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','updatedAt','select','field','toString','NOW()','createdAt','from','cm_contacts','deletedAt\x20IS\x20NULL','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','\x20=\x20?','id\x20IN\x20?','phone\x20NOT\x20IN\x20(?)','str','VoiceQueue','findAll','outbound','Lists','then','get','dialCheckDuplicateType'];(function(_0x3a6c98,_0x401504){var _0x52cd39=function(_0x4070d8){while(--_0x4070d8){_0x3a6c98['push'](_0x3a6c98['shift']());}};_0x52cd39(++_0x401504);}(_0xd76a,0x82));var _0xad76=function(_0x315ed5,_0x3be6ce){_0x315ed5=_0x315ed5-0x0;var _0x5fc4b3=_0xd76a[_0x315ed5];return _0x5fc4b3;};'use strict';var BPromise=require(_0xad76('0x0'));var util=require(_0xad76('0x1'));var _=require(_0xad76('0x2'));var fs=require('fs');var squel=require(_0xad76('0x3'));var Papa=require(_0xad76('0x4'));var Redis=require(_0xad76('0x5'));var db=require(_0xad76('0x6'))['db'];var config=require('../../../config/environment');var logger=require('../../../config/logger')('api');config[_0xad76('0x7')]=_[_0xad76('0x8')](config['redis'],{'host':_0xad76('0x9'),'port':0x18eb});var socket=require(_0xad76('0xa'))(new Redis(config[_0xad76('0x7')]));require(_0xad76('0xb'))['register'](socket);try{if(!process[_0xad76('0xc')][0x2]||process[_0xad76('0xc')][0x2]==='undefined'||process[_0xad76('0xc')][0x2]==='null'){throw new Error(_0xad76('0xd'));}var FILEPATH=process[_0xad76('0xc')][0x2];if(!process[_0xad76('0xc')][0x3]||process[_0xad76('0xc')][0x3]===_0xad76('0xe')||process[_0xad76('0xc')][0x3]===_0xad76('0xf')||!process[_0xad76('0xc')][0x4]||process[_0xad76('0xc')][0x4]===_0xad76('0xe')||process[_0xad76('0xc')][0x4]===_0xad76('0xf')){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0xad76('0x10')](process['argv'][0x3][_0xad76('0x11')](','),process[_0xad76('0xc')][0x4][_0xad76('0x11')](','));if(!process['argv'][0x5]||process[_0xad76('0xc')][0x5]===_0xad76('0xe')||process[_0xad76('0xc')][0x5]===_0xad76('0xf')){throw new Error(_0xad76('0x12'));}var LISTID=process[_0xad76('0xc')][0x5];var COMPANYID=process[_0xad76('0xc')][0x6]&&process[_0xad76('0xc')][0x6]!==_0xad76('0xe')&&process[_0xad76('0xc')][0x6]!==_0xad76('0xf')?process[_0xad76('0xc')][0x6]:null;var DUPLICATES=process[_0xad76('0xc')][0x7]&&process[_0xad76('0xc')][0x7]!==_0xad76('0xe')&&process['argv'][0x7]!==_0xad76('0xf')?process['argv'][0x7]:null;if(!process[_0xad76('0xc')][0x8]||process['argv'][0x8]===_0xad76('0xe')||process['argv'][0x8]===_0xad76('0xf')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x3f3f0f){logger[_0xad76('0x13')](_0x3f3f0f);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(_0x1b9328,_0x4bbf48,_0x8b7aec,_0x5cec34){var _0x43c6a4={'message':_0x4bbf48};_0x43c6a4[_0x1b9328]=!![];if(_0x8b7aec){_0x43c6a4['contact']=_0x8b7aec;}if(_0x5cec34){_0x43c6a4['index']=_0x5cec34;}return _0x43c6a4;}function isEmail(_0x4990a4){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))*$/[_0xad76('0x14')](_0x4990a4);}function checkRow(_0x3b789b,_0x2ba467,_0x44b8bb){return new BPromise(function(_0x1f8bb8,_0x5c6147){if(_['isNil'](_0x3b789b)){return _0x5c6147(handleCheckRowError(_0xad76('0x13'),'The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x44b8bb));}if(_0x3b789b[_0xad76('0x15')]&&_0x3b789b[_0xad76('0x15')]['length']){var _0x5f6888=_[_0xad76('0x16')](_0x3b789b[_0xad76('0x15')],_0xad76('0x17'))[_0xad76('0x18')](';');return _0x5c6147(handleCheckRowError(_0xad76('0x13'),_0x5f6888,null,_0x44b8bb));}var _0x3d57d7={};for(var _0x479db5 in FIELDS){if(FIELDS[_0xad76('0x19')](_0x479db5)&&FIELDS[_0x479db5]){_0x3d57d7[_0x479db5]=_0x3b789b[_0xad76('0x1a')][0x0][FIELDS[_0x479db5]]||_0x3b789b['data'][0x0]['\ufeff'+FIELDS[_0x479db5]];}}if(!_0x3d57d7[_0xad76('0x1b')]){return _0x5c6147(handleCheckRowError('error','firstName\x20not\x20specified!',null,_0x44b8bb));}if(!_0x3d57d7[_0xad76('0x1c')]){return _0x5c6147(handleCheckRowError(_0xad76('0x13'),_0xad76('0x1d'),null,_0x44b8bb));}if(_0x3d57d7[_0xad76('0x1e')]){var _0x1ae760=moment(_0x3d57d7[_0xad76('0x1e')],_0xad76('0x1f'));if(!_0x1ae760[_0xad76('0x20')]()){return _0x5c6147(handleCheckRowError(_0xad76('0x13'),_0xad76('0x21'),null,_0x44b8bb));}}if(_0x3d57d7[_0xad76('0x22')]){if(!isEmail(_0x3d57d7[_0xad76('0x22')])){return _0x5c6147(handleCheckRowError('error','email\x20format\x20is\x20not\x20valid!',null,_0x44b8bb));}}_0x3d57d7[_0xad76('0x23')]=LISTID;_0x3d57d7[_0xad76('0x24')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x2ba467){var _0x1c0170={};for(var _0x3549b0=0x0,_0x844b6d=DUPLICATES[_0xad76('0x25')];_0x3549b0<_0x844b6d;_0x3549b0+=0x1){_0x1c0170[DUPLICATES[_0x3549b0]]=_0x3d57d7[DUPLICATES[_0x3549b0]];}var _0x1deb96=_[_0xad76('0x26')](_0x2ba467,_0x1c0170);if(_0x1deb96){return _0x5c6147(handleCheckRowError(_0xad76('0x27'),_0xad76('0x28'),_0x1deb96,_0x44b8bb));}}return db[_0xad76('0x29')][_0xad76('0x2a')](_0x3d57d7,{'raw':!![],'hooks':![],'fields':_[_0xad76('0x2b')](_0x3d57d7)})['then'](function(_0x413fb9){if(DUPLICATES&&DUPLICATES[_0xad76('0x25')]&&_0x2ba467){_0x2ba467['push'](_[_0xad76('0x2c')](_0x3d57d7,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x413fb9['id'];return _0x1f8bb8();})[_0xad76('0x2d')](function(_0x588fb6){return _0x5c6147(handleCheckRowError('error','Error\x20while\x20creating\x20contact:\x20'+(_0x588fb6[_0xad76('0x17')]||JSON[_0xad76('0x2e')](_0x588fb6)),null,_0x44b8bb));});});}function checkHopper(){function _0x33fa32(){return function(_0x459490){logger[_0xad76('0x13')](_0xad76('0x2f'),'checkHopper',util[_0xad76('0x30')](_0x459490,{'showHidden':![],'depth':null}));};}var _0x1c0ec3=function(_0xcbe1,_0xb7e281){var _0x1ce53b=squel[_0xad76('0x31')]()[_0xad76('0x32')](_0xad76('0x33'))[_0xad76('0x34')]([_0xad76('0x1c'),_0xad76('0x35'),_0xad76('0x36'),_0xad76('0x23'),_0xb7e281,'createdAt',_0xad76('0x37')],squel[_0xad76('0x38')]()[_0xad76('0x39')](_0xad76('0x1c'),_0xad76('0x1c'))[_0xad76('0x39')]('NOW()','scheduledAt')[_0xad76('0x39')]('id',_0xad76('0x36'))[_0xad76('0x39')](LISTID[_0xad76('0x3a')](),_0xad76('0x23'))[_0xad76('0x39')](_0xcbe1['id'][_0xad76('0x3a')](),_0xb7e281)['field'](_0xad76('0x3b'),_0xad76('0x3c'))[_0xad76('0x39')](_0xad76('0x3b'),_0xad76('0x37'))[_0xad76('0x3d')](_0xad76('0x3e'))['where'](_0xad76('0x3f'))[_0xad76('0x40')](_0xad76('0x41'),LISTID['toString']())['where'](_0xad76('0x42'))[_0xad76('0x40')]('phone\x20NOT\x20IN\x20(?)',squel[_0xad76('0x38')]()[_0xad76('0x39')](_0xad76('0x1c'))[_0xad76('0x3d')](_0xad76('0x33'))[_0xad76('0x40')](_0xb7e281+_0xad76('0x43'),_0xcbe1['id'][_0xad76('0x3a')]())))[_0xad76('0x3a')]();return _0x1ce53b;};var _0x24bd74=function(_0x13331c,_0x3ae823){var _0x5f0278=squel[_0xad76('0x31')]()[_0xad76('0x32')](_0xad76('0x33'))[_0xad76('0x34')]([_0xad76('0x1c'),_0xad76('0x35'),'ContactId',_0xad76('0x23'),_0x3ae823,_0xad76('0x3c'),_0xad76('0x37')],squel['select']()[_0xad76('0x39')](_0xad76('0x1c'),_0xad76('0x1c'))['field'](_0xad76('0x3b'),_0xad76('0x35'))[_0xad76('0x39')]('id','ContactId')[_0xad76('0x39')](LISTID[_0xad76('0x3a')](),_0xad76('0x23'))[_0xad76('0x39')](_0x13331c['id'][_0xad76('0x3a')](),_0x3ae823)[_0xad76('0x39')](_0xad76('0x3b'),'createdAt')[_0xad76('0x39')](_0xad76('0x3b'),_0xad76('0x37'))[_0xad76('0x3d')](_0xad76('0x3e'))[_0xad76('0x40')](_0xad76('0x3f'))[_0xad76('0x40')](_0xad76('0x41'),LISTID[_0xad76('0x3a')]())[_0xad76('0x40')](_0xad76('0x44'),squel['str'](hopperContacts))[_0xad76('0x40')](_0xad76('0x42'))['where'](_0xad76('0x45'),squel[_0xad76('0x38')]()[_0xad76('0x39')]('calleridnum')[_0xad76('0x3d')]('cm_hopper_final')[_0xad76('0x40')](_0x3ae823+_0xad76('0x43'),_0x13331c['id']['toString']()))[_0xad76('0x40')]('phone\x20NOT\x20IN\x20(?)',squel[_0xad76('0x38')]()[_0xad76('0x39')](_0xad76('0x1c'))['from'](_0xad76('0x33'))[_0xad76('0x40')](_0x3ae823+_0xad76('0x43'),_0x13331c['id']['toString']())))[_0xad76('0x3a')]();return _0x5f0278;};function _0xadd6b6(_0x56c468,_0x3f3cd9){var _0x11c347=squel[_0xad76('0x31')]()['into'](_0xad76('0x33'))['fromQuery'](['phone',_0xad76('0x35'),_0xad76('0x36'),'ListId',_0x3f3cd9,'createdAt',_0xad76('0x37')],squel[_0xad76('0x38')]()[_0xad76('0x39')](_0xad76('0x1c'),'phone')['field']('NOW()',_0xad76('0x35'))['field']('id',_0xad76('0x36'))[_0xad76('0x39')](LISTID['toString'](),'ListId')['field'](_0x56c468['id'][_0xad76('0x3a')](),_0x3f3cd9)['field']('NOW()','createdAt')[_0xad76('0x39')]('NOW()',_0xad76('0x37'))[_0xad76('0x3d')]('cm_contacts')[_0xad76('0x40')]('deletedAt\x20IS\x20NULL')[_0xad76('0x40')](_0xad76('0x41'),LISTID['toString']())[_0xad76('0x40')]('id\x20IN\x20?',squel[_0xad76('0x46')](hopperContacts))[_0xad76('0x40')](_0xad76('0x42')))[_0xad76('0x3a')]();return _0x11c347;}function _0x2fc32d(_0x44d8db,_0x374eb7){var _0x299456=squel[_0xad76('0x31')]()[_0xad76('0x32')]('cm_hopper_black')[_0xad76('0x34')]([_0xad76('0x1c'),_0xad76('0x36'),_0xad76('0x23'),_0x374eb7,_0xad76('0x3c'),_0xad76('0x37')],squel[_0xad76('0x38')]()[_0xad76('0x39')]('phone','phone')[_0xad76('0x39')]('id',_0xad76('0x36'))['field'](LISTID[_0xad76('0x3a')](),'ListId')[_0xad76('0x39')](_0x44d8db['id'][_0xad76('0x3a')](),_0x374eb7)[_0xad76('0x39')](_0xad76('0x3b'),_0xad76('0x3c'))[_0xad76('0x39')]('NOW()',_0xad76('0x37'))[_0xad76('0x3d')](_0xad76('0x3e'))[_0xad76('0x40')](_0xad76('0x3f'))[_0xad76('0x40')](_0xad76('0x41'),LISTID[_0xad76('0x3a')]())[_0xad76('0x40')](_0xad76('0x44'),squel[_0xad76('0x46')](hopperContacts))[_0xad76('0x40')]('phone\x20IS\x20NOT\x20NULL'))[_0xad76('0x3a')]();return _0x299456;}return db[_0xad76('0x47')][_0xad76('0x48')]({'where':{'type':_0xad76('0x49')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db['CmList'],'as':_0xad76('0x4a'),'where':{'id':LISTID}}]})[_0xad76('0x4b')](function(_0x147318){var _0x1e52ef=[];if(_0x147318){var _0x842f71;for(var _0x4a6f27=0x0,_0xaa7fbb;_0x4a6f27<_0x147318[_0xad76('0x25')];_0x4a6f27+=0x1){_0xaa7fbb=_0x147318[_0x4a6f27][_0xad76('0x4c')]({'plain':!![]});switch(_0xaa7fbb[_0xad76('0x4d')]){case'always':_0x1e52ef[_0xad76('0x4e')](db[_0xad76('0x4f')][_0xad76('0x50')](_0x24bd74(_0xaa7fbb,_0xad76('0x51')))[_0xad76('0x4b')](function(){})[_0xad76('0x2d')](_0x33fa32()));break;case _0xad76('0x52'):_0x1e52ef[_0xad76('0x4e')](db['sequelize']['query'](_0x1c0ec3(_0xaa7fbb,_0xad76('0x51')))[_0xad76('0x4b')](function(){})[_0xad76('0x2d')](_0x33fa32()));break;default:_0x1e52ef[_0xad76('0x4e')](db[_0xad76('0x4f')]['query'](_0xadd6b6(_0xaa7fbb,_0xad76('0x51')))[_0xad76('0x4b')](function(){})[_0xad76('0x2d')](_0x33fa32()));}}}return _0x1e52ef;})[_0xad76('0x53')]()['then'](function(){return db['VoiceQueue']['findAll']({'where':{'type':_0xad76('0x49')},'attributes':['id'],'include':[{'model':db[_0xad76('0x54')],'as':_0xad76('0x55'),'where':{'id':LISTID}}]})[_0xad76('0x4b')](function(_0x508a54){var _0x86a95b=[];if(_0x508a54){var _0x484f09;for(var _0x289843=0x0,_0x20d9c5;_0x289843<_0x508a54['length'];_0x289843+=0x1){_0x20d9c5=_0x508a54[_0x289843][_0xad76('0x4c')]({'plain':!![]});_0x86a95b[_0xad76('0x4e')](db['sequelize'][_0xad76('0x50')](_0x2fc32d(_0x20d9c5,_0xad76('0x51')))['then'](function(){})[_0xad76('0x2d')](_0x33fa32()));}}return _0x86a95b;})[_0xad76('0x53')]();})['then'](function(){return db[_0xad76('0x56')]['findAll']({'attributes':['id',_0xad76('0x4d')],'include':[{'model':db[_0xad76('0x54')],'as':_0xad76('0x4a'),'where':{'id':LISTID}}]})[_0xad76('0x4b')](function(_0x174710){var _0x303001=[];if(_0x174710){for(var _0xe85281=0x0,_0x3ae419;_0xe85281<_0x174710[_0xad76('0x25')];_0xe85281+=0x1){_0x3ae419=_0x174710[_0xe85281][_0xad76('0x4c')]({'plain':!![]});switch(_0x3ae419['dialCheckDuplicateType']){case'always':_0x303001['push'](db['sequelize'][_0xad76('0x50')](_0x24bd74(_0x3ae419,_0xad76('0x57')))['then'](function(){})['catch'](_0x33fa32()));break;case _0xad76('0x52'):_0x303001[_0xad76('0x4e')](db['sequelize'][_0xad76('0x50')](_0x1c0ec3(_0x3ae419,'CampaignId'))[_0xad76('0x4b')](function(){})[_0xad76('0x2d')](_0x33fa32()));break;default:_0x303001[_0xad76('0x4e')](db['sequelize']['query'](_0xadd6b6(_0x3ae419,_0xad76('0x57')))[_0xad76('0x4b')](function(){})['catch'](_0x33fa32()));}}}return _0x303001;})[_0xad76('0x53')]();})[_0xad76('0x4b')](function(){return db[_0xad76('0x56')]['findAll']({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0xad76('0x55'),'where':{'id':LISTID}}]})[_0xad76('0x4b')](function(_0x50923d){var _0x4e047a=[];if(_0x50923d){for(var _0x1e44e3=0x0,_0x4b1f95;_0x1e44e3<_0x50923d[_0xad76('0x25')];_0x1e44e3+=0x1){_0x4b1f95=_0x50923d[_0x1e44e3][_0xad76('0x4c')]({'plain':!![]});_0x4e047a[_0xad76('0x4e')](db['sequelize'][_0xad76('0x50')](_0x2fc32d(_0x4b1f95,'CampaignId'))[_0xad76('0x4b')](function(){})['catch'](_0x33fa32()));}}return _0x4e047a;})[_0xad76('0x53')]();})[_0xad76('0x2d')](function(_0xe102d9){logger[_0xad76('0x13')](_0xad76('0x58'),'generalCheckHopper',_0xe102d9['message']);});}var processPromises=function(_0x1a3bc9){return BPromise[_0xad76('0x53')](promises)[_0xad76('0x4b')](function(_0x203e8e){})['catch'](function(_0x408abd){logger[_0xad76('0x13')](_0xad76('0x59'),JSON[_0xad76('0x2e')](_0x408abd));})[_0xad76('0x5a')](function(){socket[_0xad76('0x5b')](_0xad76('0x5c')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x1a3bc9){return _0x1a3bc9['resume']();}});};var endCsv=function(){return BPromise[_0xad76('0x5d')]()[_0xad76('0x4b')](function(){if(hopperContacts){return checkHopper();}})[_0xad76('0x4b')](function(){socket[_0xad76('0x5b')](_0xad76('0x5c')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xad76('0x5e')](FILEPATH);}catch(_0x36a85d){logger['error']('Unable\x20to\x20delete\x20temp\x20file:',JSON['stringify'](_0x36a85d));}finally{process[_0xad76('0x5f')](0x0);}});};process['on'](_0xad76('0x60'),function(){logger[_0xad76('0x61')](_0xad76('0x62'));endCsv();});function main(){return BPromise[_0xad76('0x5d')]()[_0xad76('0x4b')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xad76('0x11')](',');return db['CmContact']['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xad76('0x4b')](function(_0x28e612){var _0x24d6ad=fs[_0xad76('0x63')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xad76('0x64')](_0x24d6ad,{'header':!![],'skipEmptyLines':!![],'step':function(_0x4891bc,_0x24b6ec){total+=0x1;var _0x33198d=total;promises['push'](checkRow(_0x4891bc,_0x28e612,_0x33198d)[_0xad76('0x4b')](function(){success+=0x1;})[_0xad76('0x2d')](function(_0x26f229){if(_0x26f229['error']){errors+=0x1;delete _0x26f229[_0xad76('0x13')];}else if(_0x26f229[_0xad76('0x27')]){duplicates+=0x1;delete _0x26f229['duplicate'];}rows['push'](_0x26f229);}));if(total%0xc8===0x0){_0x24b6ec['pause']();return processPromises(_0x24b6ec);}},'complete':function(){return processPromises()[_0xad76('0x4b')](function(){logger['info'](_0xad76('0x65'));endCsv();});},'error':function(_0x7da3dc,_0x3249f1){logger[_0xad76('0x61')](_0xad76('0x66'),JSON['stringify'](_0x7da3dc));endCsv();}});})[_0xad76('0x2d')](function(_0x5993ac){logger[_0xad76('0x13')](_0xad76('0x67'),JSON[_0xad76('0x2e')](_0x5993ac));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index b7ca029..c3530cb 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 _0xd463=['push','all','split','isNil','CmContactHasItem','findOne','update','updated','inserted','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','cm_hopper','fromQuery','ListId','createdAt','updatedAt','priority','UserId','fields','from','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.id\x20=\x20','.CmListId\x20=\x20?','where','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','toString','cm_contacts.phone','cm_contacts.id','cm_contacts.createdAt','into','cm_hopper_black','cm_contacts.createdAt\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','scheduledat','recallme','\x22onlyIfOpen\x22','ContactId','ListId\x20=\x20?','cm_hopper.id','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','keys','CompanyId','scheduledAt',')\x20NOT\x20IN\x20?','id\x20IN\x20?','MIN(id)','min_id','group','exit','errors','message','query','spread','catch','error','campaigns.id','campaigns.dialTimezone','campaigns','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','sequelize','voice_queues.id','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','utcOffset','set','info','stringify','send','start','binding','clone','socket_timestamp','root','.csv','header','ContactItemType','name','writeFileSync','parse','createReadStream','data','rows','find','_description','hasOwnProperty','trim','replace','YYYY-MM-DD\x20HH:mm:ss','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','includes','agent\x20not\x20exists','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','timezones','\x20not\x20specified','itemTypeId','description','SystemRow','appendFileSync','contact:import:','SystemError','step','duplicates','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','contactTypeId','orderBy','VoiceQueueId','voice_queues_has_cm_blacklists','CampaignId','campaigns_has_cm_blacklists','finish','affectedRows','emit','unlink','complete','argv','arguments\x20\x20\x20','server/files/tmp','existsSync','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','moment','squel','ioredis','../../../mysqldb','../../../config/environment','import','redis','defaults','localhost','socket.io-emitter','format','test','select','field','phone','join','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','findAll','AdditionalPhones','then','length'];(function(_0x468ce9,_0x5c61d6){var _0x25ed32=function(_0x3bea7b){while(--_0x3bea7b){_0x468ce9['push'](_0x468ce9['shift']());}};_0x25ed32(++_0x5c61d6);}(_0xd463,0xa2));var _0x3d46=function(_0x294cca,_0x2d3b8a){_0x294cca=_0x294cca-0x0;var _0x53054b=_0xd463[_0x294cca];return _0x53054b;};'use strict';var fs=require('fs');var path=require(_0x3d46('0x0'));var _=require(_0x3d46('0x1'));var Papa=require(_0x3d46('0x2'));var util=require('util');var BPromise=require('bluebird');var moment=require(_0x3d46('0x3'));var squel=require(_0x3d46('0x4'));var Redis=require(_0x3d46('0x5'));var db=require(_0x3d46('0x6'))['db'];var config=require(_0x3d46('0x7'));var shared=require('../../../config/environment/shared');var logger=require('../../../config/logger')(_0x3d46('0x8'));config[_0x3d46('0x9')]=_[_0x3d46('0xa')](config[_0x3d46('0x9')],{'host':_0x3d46('0xb'),'port':0x18eb});var socket=require(_0x3d46('0xc'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x3d46('0xd')]('YYYY-MM-DD\x20HH:mm:ss');var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x3d46('0xd')]('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x119b67){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))*$/[_0x3d46('0xe')](_0x119b67);}function selectNotIn(_0x452529,_0x5e4bc9,_0x145630,_0x7ba033,_0x13fee){return squel[_0x3d46('0xf')]()[_0x3d46('0x10')](_0x3d46('0x11'))['from'](_0x7ba033)[_0x3d46('0x12')](_0x5e4bc9,null,_0x5e4bc9+'.id\x20=\x20'+_0x7ba033+'.'+_0x145630)['where'](_0x7ba033+'.'+_0x145630+_0x3d46('0x13')+_0x452529+'.'+_0x145630)['where'](_0x5e4bc9+_0x3d46('0x14')+_0x13fee[_0x3d46('0x12')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x1fd77f,_0x57c4ea){promisesAdditionalPhones=[];return db['CmContact'][_0x3d46('0x15')]({'raw':!![],'attributes':['id',_0x3d46('0x16')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x3d46('0x17')](function(_0x394e36){if(_0x394e36!==null){var _0x1e58df=[];for(var _0x7067cf=0x0;_0x7067cf<_0x394e36[_0x3d46('0x18')];_0x7067cf++){var _0x5af4be=_0x394e36[_0x7067cf];_0x1e58df[_0x3d46('0x19')](insertAdditionalPhones(_0x5af4be));}}Promise[_0x3d46('0x1a')](_0x1e58df)[_0x3d46('0x17')](function(){_0x1fd77f({'val':0x1});});});});}function insertAdditionalPhones(_0x1512d4){return new Promise(function(_0x435f14,_0x168463){var _0x413933=_0x1512d4[_0x3d46('0x16')];var _0x3af433=_0x413933['split'](';');var _0x1edeed=[];orderBy=0x0;for(var _0x56177c=0x0;_0x56177c<_0x3af433[_0x3d46('0x18')];_0x56177c++){_0x1edeed['push'](splitAdditionalPhone(_0x1512d4['id'],_0x3af433[_0x56177c]));}Promise[_0x3d46('0x1a')](_0x1edeed)[_0x3d46('0x17')](function(){_0x435f14({'val':_0x3af433[_0x3d46('0x18')]});});});}function splitAdditionalPhone(_0xc31fb0,_0x1c5fdd){return new Promise(function(_0x4317c4,_0x9194d5){var _0x5e45cd=_0x1c5fdd[_0x3d46('0x1b')](':');var _0xad1c1a=_0x5e45cd[0x0];var _0x22afdf=_0x5e45cd[0x1];if(!_[_0x3d46('0x1c')](_0x22afdf)){var _0x5a6be5=_0x22afdf[_0x3d46('0x1b')]('|');var _0x35144c=[];for(var _0x30dd80=0x0;_0x30dd80<_0x5a6be5['length'];_0x30dd80++){if(_0x5a6be5[_0x30dd80]!==''){var _0x3c4ae2=_['filter'](promisesAdditionalPhones,{'contactId':_0xc31fb0,'phone':_0x5a6be5[_0x30dd80]});if(_0x3c4ae2[_0x3d46('0x18')]==0x0){orderBy++;promisesAdditionalPhones[_0x3d46('0x19')]({'contactId':_0xc31fb0,'contactTypeId':_0xad1c1a,'phone':_0x5a6be5[_0x30dd80],'orderBy':orderBy});}}}_0x4317c4({'ok':0x1});}else _0x4317c4({'res':0x0});});}function createAdditionalPhone(_0x18625f,_0x4f0098,_0xb36533,_0x49b978){var _0x4364e1='';var _0x34857e='';var _0x1ba1c9=_0xb36533['split']('§');_0x4364e1=_0x1ba1c9[0x0];if(_0x1ba1c9[_0x3d46('0x18')]==0x2)_0x34857e=_0x1ba1c9[0x1];return new Promise(function(_0x42cf71,_0x34e0b7){return db[_0x3d46('0x1d')][_0x3d46('0x1e')]({'where':{'CmContactId':_0x18625f,'item':_0x4364e1}})[_0x3d46('0x17')](function(_0x2aa5cf){if(_0x2aa5cf){return db[_0x3d46('0x1d')][_0x3d46('0x1f')]({'ItemTypeId':_0x4f0098,'description':_0x34857e,'OrderBy':_0x49b978},{'where':{'CmContactId':_0x18625f,'item':_0x4364e1}})[_0x3d46('0x17')](function(_0x33438f){_0x42cf71({'res':_0x3d46('0x20')});});}else{return db['CmContactHasItem']['create']({'CmContactId':_0x18625f,'item':_0x4364e1,'description':_0x34857e,'ItemTypeId':_0x4f0098,'OrderBy':_0x49b978,'ItemClass':'PHONE'})[_0x3d46('0x17')](function(_0x47d7ba){_0x42cf71({'res':_0x3d46('0x21')});});}});});}function insertCmHopper(_0x58fe47,_0x2be1ef,_0x2e94c6,_0x22288e,_0x430357){var _0x48c1c7=['cm_contacts.phone',_0x3d46('0x22'),'cm_contacts.id',_0x3d46('0x23'),_0x2be1ef+'.'+_0x22288e,'cm_contacts.createdAt',_0x3d46('0x24'),_0x3d46('0x25'),_0x3d46('0x26'),'\x22'+_0x430357+'\x22'];return squel[_0x3d46('0x27')]()['into'](_0x3d46('0x28'))[_0x3d46('0x29')]([_0x3d46('0x11'),'scheduledat','ContactId',_0x3d46('0x2a'),_0x22288e,_0x3d46('0x2b'),_0x3d46('0x2c'),_0x3d46('0x2d'),_0x3d46('0x2e'),'recallme'],squel[_0x3d46('0xf')]()[_0x3d46('0x2f')](_0x48c1c7)[_0x3d46('0x30')](_0x2be1ef)[_0x3d46('0x12')](_0x3d46('0x31'),null,_0x3d46('0x32')+_0x2be1ef+_0x3d46('0x33'))[_0x3d46('0x12')](_0x2e94c6,null,_0x2e94c6+_0x3d46('0x34')+_0x2be1ef+'.'+_0x22288e)['where'](_0x2be1ef+_0x3d46('0x35'),_0x58fe47)[_0x3d46('0x36')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x3d46('0x36')](_0x3d46('0x37'),selectNotIn(_0x2be1ef,_0x2e94c6,_0x22288e,'cm_hopper',[_0x3d46('0x38'),'\x22onlyIfOpen\x22']))[_0x3d46('0x36')](_0x3d46('0x37'),selectNotIn(_0x2be1ef,_0x2e94c6,_0x22288e,_0x3d46('0x28'),['\x22always\x22'])))[_0x3d46('0x39')]();}function insertCmHopperBlack(_0x1fedff,_0x251b1f,_0x593855,_0x272eac){var _0x1a7b85=[_0x3d46('0x3a'),_0x3d46('0x3b'),'cm_contacts.ListId',_0x251b1f+'.'+_0x272eac,_0x3d46('0x3c'),_0x3d46('0x24')];return squel[_0x3d46('0x27')]()[_0x3d46('0x3d')](_0x3d46('0x3e'))['fromQuery']([_0x3d46('0x11'),'ContactId',_0x3d46('0x2a'),_0x272eac,'createdAt',_0x3d46('0x2c')],squel[_0x3d46('0xf')]()['fields'](_0x1a7b85)[_0x3d46('0x30')](_0x251b1f)[_0x3d46('0x12')](_0x3d46('0x31'),null,'cm_contacts.ListId\x20=\x20'+_0x251b1f+_0x3d46('0x33'))[_0x3d46('0x12')](_0x593855,null,_0x593855+_0x3d46('0x34')+_0x251b1f+'.'+_0x272eac)[_0x3d46('0x36')](_0x251b1f+_0x3d46('0x35'),_0x1fedff)[_0x3d46('0x36')](_0x3d46('0x3f'),NOW)[_0x3d46('0x36')](_0x3d46('0x37'),squel[_0x3d46('0xf')]()['field'](_0x3d46('0x11'))[_0x3d46('0x30')](_0x3d46('0x3e'))['where']('ListId\x20=\x20?',_0x1fedff)[_0x3d46('0x36')](_0x272eac+'\x20=\x20'+_0x251b1f+'.'+_0x272eac)))[_0x3d46('0x39')]();}function insertTzCmHopper(_0x434eb0,_0x158942,_0x269477,_0x4ab2d7,_0x4b4520,_0x351621){var _0x36e722=[_0x3d46('0x3a'),_0x3d46('0x40')+_0x351621+_0x3d46('0x41'),'cm_contacts.id',_0x3d46('0x23'),_0x158942+'.'+_0x4ab2d7,_0x3d46('0x3c'),_0x3d46('0x24'),_0x3d46('0x25'),_0x3d46('0x26'),'\x22'+_0x4b4520+'\x22'];var _0x3b02dc=squel[_0x3d46('0x27')]()['into'](_0x3d46('0x28'))[_0x3d46('0x29')]([_0x3d46('0x11'),_0x3d46('0x42'),'ContactId','ListId',_0x4ab2d7,'createdAt',_0x3d46('0x2c'),_0x3d46('0x2d'),_0x3d46('0x2e'),_0x3d46('0x43')],squel[_0x3d46('0xf')]()[_0x3d46('0x2f')](_0x36e722)['from'](_0x158942)[_0x3d46('0x12')](_0x3d46('0x31'),null,'cm_contacts.ListId\x20=\x20'+_0x158942+_0x3d46('0x33'))[_0x3d46('0x12')](_0x269477,null,_0x269477+'.id\x20=\x20'+_0x158942+'.'+_0x4ab2d7)[_0x3d46('0x12')](_0x351621,null,_0x351621+_0x3d46('0x34')+_0x158942+'.'+_0x4ab2d7)['where'](_0x158942+_0x3d46('0x35'),_0x434eb0)[_0x3d46('0x36')](_0x3d46('0x3f'),NOW)[_0x3d46('0x36')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x158942,_0x269477,_0x4ab2d7,_0x3d46('0x28'),[_0x3d46('0x38'),_0x3d46('0x44')]))['where'](_0x3d46('0x37'),selectNotIn(_0x158942,_0x269477,_0x4ab2d7,'cm_hopper',[_0x3d46('0x38')])))['toString']();return _0x3b02dc;}function insertTzCmHopperBlack(_0xaed3ff,_0x4f68c5,_0x4d88f9,_0xf6a2f){var _0x39bcf3=[_0x3d46('0x3a'),_0x3d46('0x3b'),_0x3d46('0x23'),_0x4f68c5+'.'+_0xf6a2f,'cm_contacts.createdAt',_0x3d46('0x24')];return squel[_0x3d46('0x27')]()[_0x3d46('0x3d')](_0x3d46('0x3e'))[_0x3d46('0x29')]([_0x3d46('0x11'),_0x3d46('0x45'),'ListId',_0xf6a2f,_0x3d46('0x2b'),_0x3d46('0x2c')],squel[_0x3d46('0xf')]()[_0x3d46('0x2f')](_0x39bcf3)['from'](_0x4f68c5)[_0x3d46('0x12')]('cm_contacts',null,_0x3d46('0x32')+_0x4f68c5+_0x3d46('0x33'))[_0x3d46('0x12')](_0x4d88f9,null,_0x4d88f9+'.id\x20=\x20'+_0x4f68c5+'.'+_0xf6a2f)['where'](_0x4f68c5+_0x3d46('0x35'),_0xaed3ff)['where'](_0x3d46('0x3f'),NOW)[_0x3d46('0x36')](_0x3d46('0x37'),squel[_0x3d46('0xf')]()[_0x3d46('0x10')](_0x3d46('0x11'))[_0x3d46('0x30')](_0x3d46('0x3e'))['where'](_0x3d46('0x46'),_0xaed3ff)['where'](_0xf6a2f+'\x20=\x20'+_0x4f68c5+'.'+_0xf6a2f)))['toString']();}function insertCmHopperAdditionalPhones(_0x1defc3){var _0x32c44a=[_0x3d46('0x47'),'cm_contact_has_items.item',_0x3d46('0x48'),_0x3d46('0x49'),_0x3d46('0x4a')];return squel[_0x3d46('0x27')]()['into'](_0x3d46('0x4b'))[_0x3d46('0x29')]([_0x3d46('0x4c'),'phone',_0x3d46('0x4d'),_0x3d46('0x2b'),_0x3d46('0x2c')],squel[_0x3d46('0xf')]()[_0x3d46('0x2f')](_0x32c44a)[_0x3d46('0x30')](_0x3d46('0x28'))[_0x3d46('0x12')](_0x3d46('0x31'),null,_0x3d46('0x4e'))[_0x3d46('0x12')](_0x3d46('0x4f'),null,_0x3d46('0x50'))['where']('cm_hopper.ListId\x20=\x20?',_0x1defc3)['where'](_0x3d46('0x3f'),NOW))[_0x3d46('0x39')]();}function insertCmContact(_0x45b2a6,_0x284fa5,_0x6dc6b3,_0x5d5705){var _0x5d975c=_['concat'](_[_0x3d46('0x51')](_0x5d5705),[_0x3d46('0x2a'),_0x3d46('0x52'),_0x3d46('0x2b'),_0x3d46('0x2c'),_0x3d46('0x53')]);return squel[_0x3d46('0x27')]()[_0x3d46('0x3d')]('cm_contacts')[_0x3d46('0x29')](_0x5d975c,squel[_0x3d46('0xf')]()[_0x3d46('0x2f')](_0x5d975c)[_0x3d46('0x30')](_0x284fa5)[_0x3d46('0x36')]('('+_0x6dc6b3[_0x3d46('0x12')](',')+_0x3d46('0x54'),squel['select']()[_0x3d46('0x2f')](_0x6dc6b3)[_0x3d46('0x30')]('cm_contacts')[_0x3d46('0x36')]('ListId\x20=\x20?',_0x45b2a6)[_0x3d46('0x36')]('deletedAt\x20IS\x20NULL'))[_0x3d46('0x36')](_0x3d46('0x55'),squel[_0x3d46('0xf')]()[_0x3d46('0x10')](_0x3d46('0x56'),_0x3d46('0x57'))[_0x3d46('0x30')](_0x284fa5)[_0x3d46('0x58')](_0x6dc6b3[_0x3d46('0x12')](','))))[_0x3d46('0x39')]();}function handleStop(){logger['info']('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x5c4b6d){logger['error'](_0x5c4b6d['message']);process[_0x3d46('0x59')](0x1);}function handleError(_0x4430c4,_0x468eec){stats[_0x3d46('0x5a')]['push']({'name':_0x468eec['code'],'message':_0x468eec[_0x3d46('0x5b')],'row':_0x4430c4});}function handleQuery(_0x567e7f){logger['info'](_0x567e7f);return db['sequelize'][_0x3d46('0x5c')](_0x567e7f)[_0x3d46('0x5d')](function(_0x48aff6){results[_0x3d46('0x19')](_0x48aff6);})[_0x3d46('0x5e')](function(_0x168d5d){logger[_0x3d46('0x5f')](_0x168d5d[_0x3d46('0x5b')]);});}function updateTzCampaigns(_0x35a332){return new Promise(function(_0x245bfd,_0x354d18){var _0x233b02=squel[_0x3d46('0xf')]()[_0x3d46('0x2f')]([_0x3d46('0x60'),_0x3d46('0x61')])['from'](_0x3d46('0x62'))[_0x3d46('0x12')](_0x3d46('0x63'),null,_0x3d46('0x64'))[_0x3d46('0x36')](_0x3d46('0x65')+_0x35a332);db[_0x3d46('0x66')][_0x3d46('0x5c')](_0x233b02[_0x3d46('0x39')]())[_0x3d46('0x5d')](function(_0x24f53e){var _0x1d0c28=[];for(var _0x22a5ee=0x0;_0x22a5ee<_0x24f53e['length'];_0x22a5ee++){_0x1d0c28[_0x3d46('0x19')](getTimezoneData(_0x24f53e[_0x22a5ee],tmp_campaigns));}BPromise[_0x3d46('0x1a')](_0x1d0c28)[_0x3d46('0x17')](function(){_0x245bfd({'val':0x1});});})[_0x3d46('0x5e')](function(_0x20a8d0){logger[_0x3d46('0x5f')](_0x20a8d0[_0x3d46('0x5b')]);_0x245bfd({'val':0x0});});});}function updateTzVoiceQueues(_0x24a29e){return new Promise(function(_0x3c66d2,_0x4f3059){var _0x396898=squel[_0x3d46('0xf')]()[_0x3d46('0x2f')]([_0x3d46('0x67'),_0x3d46('0x68')])['from'](_0x3d46('0x69'))[_0x3d46('0x12')](_0x3d46('0x6a'),null,_0x3d46('0x6b'))[_0x3d46('0x36')](_0x3d46('0x6c')+_0x24a29e);db[_0x3d46('0x66')][_0x3d46('0x5c')](_0x396898[_0x3d46('0x39')]())['spread'](function(_0x288e2a){var _0x259d58=[];for(var _0x2696fd=0x0;_0x2696fd<_0x288e2a[_0x3d46('0x18')];_0x2696fd++){_0x259d58['push'](getTimezoneData(_0x288e2a[_0x2696fd],tmp_voice_queues));}BPromise[_0x3d46('0x1a')](_0x259d58)[_0x3d46('0x17')](function(){_0x3c66d2({'val':0x1});});})[_0x3d46('0x5e')](function(_0x26e316){logger[_0x3d46('0x5f')](_0x26e316[_0x3d46('0x5b')]);_0x3c66d2({'val':0x0});});});}function getTimezoneData(_0x465318,_0x43e926){return new Promise(function(_0x1d1fbb,_0x385825){var _0x4795a0=shared['timezones'];var _0x7d93df=_0x4795a0[_0x465318[_0x3d46('0x6d')]];if(_['isNil'](_0x7d93df)){_0x1d1fbb({'ret':0x1});}else{var _0x37eea4=_0x7d93df[_0x3d46('0x6e')];var _0x4e7bc3=squel[_0x3d46('0x27')]()[_0x3d46('0x3d')](_0x43e926)[_0x3d46('0x6f')]('id',_0x465318['id'])[_0x3d46('0x6f')]('offset',_0x37eea4)['set'](_0x3d46('0x6d'),_0x465318[_0x3d46('0x6d')])[_0x3d46('0x39')]();return db[_0x3d46('0x66')][_0x3d46('0x5c')](_0x4e7bc3)[_0x3d46('0x5d')](function(_0x329132){_0x1d1fbb({'ret':0x1});})['catch'](function(_0x3d9e95){logger[_0x3d46('0x5f')](_0x3d9e95[_0x3d46('0x5b')]);_0x385825({'ret':0x1});});}});}function handleTZQuery(_0x5517a3){logger[_0x3d46('0x70')](_0x5517a3);return db['sequelize'][_0x3d46('0x5c')](_0x5517a3)[_0x3d46('0x5d')](function(_0x2ad1d5){})[_0x3d46('0x5e')](function(_0x17aac3){logger[_0x3d46('0x5f')](_0x17aac3[_0x3d46('0x5b')]);});}function main(_0x46599a,_0x4b4fac,_0x96d9ef,_0x4cb6e7){logger[_0x3d46('0x70')]('main',_0x46599a,JSON[_0x3d46('0x71')](_0x4b4fac));process[_0x3d46('0x72')](_0x3d46('0x73'));var _0x342c6e=_0x4b4fac[_0x3d46('0x74')];var _0x4ffe0a=_[_0x3d46('0x75')](_0x342c6e);var _0x474109=_0x4b4fac[_0x3d46('0x76')];var _0x5aa78=path[_0x3d46('0x12')](config[_0x3d46('0x77')],'server/files/tmp',_0x474109+_0x3d46('0x78'));hasTZ=_[_0x3d46('0x51')](_0x342c6e)['includes'](_0x3d46('0x6d'));var _0x36031b=_['keys'](_0x342c6e)[_0x3d46('0x12')]();logger[_0x3d46('0x70')](_0x3d46('0x79'),_0x36031b);db[_0x3d46('0x7a')][_0x3d46('0x15')]({'raw':!![],'attributes':['id',_0x3d46('0x7b')]})[_0x3d46('0x17')](function(_0x12cebd){for(var _0x4a9823=0x0;_0x4a9823<_0x12cebd['length'];_0x4a9823++){if(_0x12cebd[_0x4a9823][_0x3d46('0x7b')]in _0x342c6e){contactItemTypes[_0x3d46('0x19')](_0x12cebd[_0x4a9823]);delete _0x4ffe0a[_0x12cebd[_0x4a9823]['name']];hasAdditionalPhones=!![];}for(var _0x5f53e3 in _0x342c6e){if(_0x12cebd[_0x4a9823][_0x3d46('0x7b')]+'_description'===_0x5f53e3){phoneDescriptions['push']({'itemTypeId':_0x12cebd[_0x4a9823]['id'],'description':_0x5f53e3});delete _0x4ffe0a[_0x5f53e3];}}}if(hasAdditionalPhones)_0x4ffe0a['AdditionalPhones']='';var _0x203c82=_['keys'](_0x4ffe0a)[_0x3d46('0x12')]();logger[_0x3d46('0x70')](_0x3d46('0x79'),_0x203c82);fs[_0x3d46('0x7c')](_0x5aa78,_0x203c82+'\x0a');Papa[_0x3d46('0x7d')](fs[_0x3d46('0x7e')](_0x46599a),{'header':!![],'skipEmptyLines':!![],'step':function(_0x2e4d05,_0x143b5a){try{for(var _0x4e5f2e=0x0,_0xe403fc=[];_0x4e5f2e<_0x2e4d05[_0x3d46('0x7f')][_0x3d46('0x18')];_0x4e5f2e++){stats[_0x3d46('0x80')]+=0x1;if(_0x2e4d05[_0x3d46('0x5a')][_0x4e5f2e]){handleError(_0x2e4d05[_0x3d46('0x7f')][_0x4e5f2e],_0x2e4d05[_0x3d46('0x5a')][_0x4e5f2e]);}else{var _0x132f29=[];var _0x377ce4=[];var _0x3f2813={};for(var _0x18b7be in _0x342c6e){let _0x2bee96=contactItemTypes[_0x3d46('0x81')](_0x1e3de3=>_0x1e3de3[_0x3d46('0x7b')]===_0x18b7be);let _0x1d0a70=contactItemTypes['find'](_0x393eae=>_0x393eae['name']+_0x3d46('0x82')===_0x18b7be);if(_[_0x3d46('0x1c')](_0x2bee96)&&_[_0x3d46('0x1c')](_0x1d0a70)){if(_0x342c6e[_0x3d46('0x83')](_0x18b7be)){if(_0x2e4d05[_0x3d46('0x7f')][_0x4e5f2e][_0x342c6e[_0x18b7be]]){var _0x286545=_[_0x3d46('0x84')](_0x2e4d05['data'][_0x4e5f2e][_0x342c6e[_0x18b7be]][_0x3d46('0x85')](/"/g,'\x27'));switch(_0x18b7be){case _0x3d46('0x42'):var _0x241e76=moment(_0x286545,_0x3d46('0x86'),!![]);if(_0x241e76[_0x3d46('0x87')]()){_0xe403fc[_0x3d46('0x19')]('\x22'+_0x286545+'\x22');}else{_0x132f29['push'](_0x3d46('0x88'));}break;case _0x3d46('0x2d'):var _0x1ca1f7=parseInt(_0x286545);_0x286545=_['isNaN'](_0x1ca1f7)||_0x1ca1f7<0x0||_0x1ca1f7>0x4?_0x4cb6e7?0x3:0x2:_0x1ca1f7;_0xe403fc['push']('\x22'+_0x286545+'\x22');break;case _0x3d46('0x2e'):var _0x37f58e=parseInt(_0x286545);if(_['isNumber'](_0x37f58e)&&_[_0x3d46('0x89')](_0x96d9ef,_0x37f58e)){_0xe403fc[_0x3d46('0x19')]('\x22'+_0x37f58e+'\x22');}else{_0x132f29[_0x3d46('0x19')](_0x3d46('0x8a'));}break;case'email':if(isEmail(_0x286545)){_0xe403fc[_0x3d46('0x19')]('\x22'+_0x286545+'\x22');}else{_0x132f29[_0x3d46('0x19')](_0x3d46('0x8b'));}break;case _0x3d46('0x8c'):var _0x4c62da=moment(_0x286545,_0x3d46('0x8d'),!![]);if(_0x4c62da[_0x3d46('0x87')]()){_0xe403fc['push']('\x22'+_0x286545+'\x22');}else{_0x132f29['push'](_0x3d46('0x8e'));}break;case _0x3d46('0x6d'):var _0x3b28fb=shared[_0x3d46('0x8f')];var _0x2b64a7=_0x3b28fb[_0x286545];if(!_[_0x3d46('0x1c')](_0x2b64a7)){var _0x2e2543=_0x2b64a7[_0x3d46('0x6e')];_0xe403fc[_0x3d46('0x19')]('\x22'+_0x286545+'\x22');_0xe403fc[_0x3d46('0x19')]('\x22'+_0x2e2543+'\x22');}break;default:_0xe403fc[_0x3d46('0x19')]('\x22'+_0x286545+'\x22');}}else{switch(_0x18b7be){case'firstName':case _0x3d46('0x11'):_0x132f29['push'](_0x18b7be+_0x3d46('0x90'));break;default:_0xe403fc[_0x3d46('0x19')]('\x22\x22');}}}}else{var _0x5123cd='';if(!_['isNil'](_0x2bee96)){if(!_0x3f2813[_0x3d46('0x83')](_0x2bee96['id'])){if(!_[_0x3d46('0x1c')](_0x2e4d05[_0x3d46('0x7f')][_0x4e5f2e][_0x342c6e[_0x18b7be]])){var _0x286545=_[_0x3d46('0x84')](_0x2e4d05[_0x3d46('0x7f')][_0x4e5f2e][_0x342c6e[_0x18b7be]][_0x3d46('0x85')](/"/g,'\x27'));var _0x4ed64d=phoneDescriptions[_0x3d46('0x81')](_0x2b6af2=>_0x2b6af2[_0x3d46('0x91')]===_0x2bee96['id']);if(!_[_0x3d46('0x1c')](_0x4ed64d)){var _0x106550=_['trim'](_0x2e4d05[_0x3d46('0x7f')][_0x4e5f2e][_0x342c6e[_0x4ed64d[_0x3d46('0x92')]]][_0x3d46('0x85')](/"/g,'\x27'));if(!_[_0x3d46('0x1c')](_0x106550))_0x286545=_0x286545+'§'+_0x106550;}if(_0x5123cd=='')_0x5123cd=_0x286545;else _0x5123cd+='|'+_0x286545;}_0x377ce4[_0x3d46('0x19')](_0x2bee96['id']+':'+_0x5123cd);_0x3f2813[_0x2bee96['id']]=0x1;}}}}if(hasAdditionalPhones){_0xe403fc[_0x3d46('0x19')]('\x22'+_0x377ce4['join'](';')+'\x22');}if(_0x132f29['length']){handleError(_0x2e4d05['data'][_0x4e5f2e],{'code':_0x3d46('0x93'),'message':_0x132f29['join']()});}else{fs[_0x3d46('0x94')](_0x5aa78,_0xe403fc['join']()+'\x0a');}_0xe403fc=[];}if(!(stats[_0x3d46('0x80')]%0xc8)){socket['emit'](_0x3d46('0x95')+_0x474109,stats);stats['errors']=[];}}if(stopped){logger[_0x3d46('0x70')]('Abort\x20parser');_0x143b5a['abort']();}}catch(_0x3c25cc){handleError(_0x2e4d05['data'][_0x4e5f2e],{'code':_0x3d46('0x96'),'message':_0x3c25cc[_0x3d46('0x5b')]});logger[_0x3d46('0x5f')](_0x3d46('0x97'),_0x3c25cc['message']);}},'complete':function(){try{var _0x2a775f=[];var _0xdfcac4=[];var _0x51cfd1=_0x3d46('0x31');if(_0x4b4fac[_0x3d46('0x98')]&&_0x4b4fac['duplicates']['length']){_0x51cfd1='cm_contacts_'+_0x474109;_0x2a775f[_0x3d46('0x19')](_0x3d46('0x99')+_0x51cfd1+_0x3d46('0x9a'));}tmp_campaigns=_0x3d46('0x9b')+_0x474109;tmp_voice_queues=_0x3d46('0x9c')+_0x474109;_0xdfcac4[_0x3d46('0x19')](_0x3d46('0x99')+tmp_campaigns+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');_0xdfcac4[_0x3d46('0x19')](_0x3d46('0x99')+tmp_voice_queues+_0x3d46('0x9d'));BPromise[_0x3d46('0x9e')](_0xdfcac4,handleTZQuery)[_0x3d46('0x17')](function(_0xaadff2){updateTzCampaigns(_0x4b4fac[_0x3d46('0x2a')])[_0x3d46('0x17')](function(_0x4d0db3){updateTzVoiceQueues(_0x4b4fac['ListId'])[_0x3d46('0x17')](function(_0x42304d){if(hasTZ)_0x203c82=_0x203c82[_0x3d46('0x85')](_0x3d46('0x6d'),'dialTimezone,utcOffset');var _0x403a87=util['format'](_0x3d46('0x9f'),_0x5aa78,_0x51cfd1,_0x203c82,_0x4b4fac['ListId'],_0x4b4fac['CompanyId']||null,NOW,NOW);if(_[_0x3d46('0x1c')](_0x342c6e[_0x3d46('0x42')])){_0x403a87+=_0x3d46('0xa0');}_0x2a775f[_0x3d46('0x19')](_0x403a87);if(_0x4b4fac['duplicates']&&_0x4b4fac[_0x3d46('0x98')]['length']){_0x2a775f[_0x3d46('0x19')](insertCmContact(_0x4b4fac[_0x3d46('0x2a')],_0x51cfd1,_0x4b4fac['duplicates'],_0x342c6e));_0x2a775f['push'](_0x3d46('0xa1')+_0x51cfd1+';');}BPromise['each'](_0x2a775f,handleQuery)['then'](function(_0x4f8d7c){BPromise[_0x3d46('0x1a')]([handleAdditionalPhones()])[_0x3d46('0x17')](function(){_0x2a775f=[];for(var _0x390532=0x0;_0x390532\x20\x20','existsSync','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','No\x20agent\x20available','path','lodash','papaparse','util','bluebird','moment','squel','../../../mysqldb','../../../config/environment','../../../config/environment/shared','../../../config/logger','import','redis','defaults','localhost','YYYY-MM-DD\x20HH:mm:ss','test','field','from','join','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','CmContact','findAll','AdditionalPhones','length','push','all','split','then','isNil','filter','CmContactHasItem','findOne','update','updated','PHONE','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','fromQuery','scheduledat','ContactId','ListId','updatedAt','UserId','select','fields','cm_contacts.ListId\x20=\x20','.CmListId','.id\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_hopper','\x22always\x22','toString'];(function(_0x12e7fc,_0x4d9c50){var _0x1b7f24=function(_0x38e235){while(--_0x38e235){_0x12e7fc['push'](_0x12e7fc['shift']());}};_0x1b7f24(++_0x4d9c50);}(_0xd92e,0x80));var _0xed92=function(_0x19e140,_0x2b5312){_0x19e140=_0x19e140-0x0;var _0x13145=_0xd92e[_0x19e140];return _0x13145;};'use strict';var fs=require('fs');var path=require(_0xed92('0x0'));var _=require(_0xed92('0x1'));var Papa=require(_0xed92('0x2'));var util=require(_0xed92('0x3'));var BPromise=require(_0xed92('0x4'));var moment=require(_0xed92('0x5'));var squel=require(_0xed92('0x6'));var Redis=require('ioredis');var db=require(_0xed92('0x7'))['db'];var config=require(_0xed92('0x8'));var shared=require(_0xed92('0x9'));var logger=require(_0xed92('0xa'))(_0xed92('0xb'));config[_0xed92('0xc')]=_[_0xed92('0xd')](config[_0xed92('0xc')],{'host':_0xed92('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xed92('0xc')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()['format'](_0xed92('0xf'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x2b5173){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))*$/[_0xed92('0x10')](_0x2b5173);}function selectNotIn(_0x40f0d0,_0xdf7af7,_0x1a3759,_0x5ddbeb,_0x50c752){return squel['select']()[_0xed92('0x11')]('phone')[_0xed92('0x12')](_0x5ddbeb)[_0xed92('0x13')](_0xdf7af7,null,_0xdf7af7+'.id\x20=\x20'+_0x5ddbeb+'.'+_0x1a3759)[_0xed92('0x14')](_0x5ddbeb+'.'+_0x1a3759+_0xed92('0x15')+_0x40f0d0+'.'+_0x1a3759)[_0xed92('0x14')](_0xdf7af7+_0xed92('0x16')+_0x50c752[_0xed92('0x13')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x5f3289,_0x2531c2){promisesAdditionalPhones=[];return db[_0xed92('0x17')][_0xed92('0x18')]({'raw':!![],'attributes':['id',_0xed92('0x19')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})['then'](function(_0x4efe11){if(_0x4efe11!==null){var _0x2af55e=[];for(var _0x1e0e6f=0x0;_0x1e0e6f<_0x4efe11[_0xed92('0x1a')];_0x1e0e6f++){var _0x25278e=_0x4efe11[_0x1e0e6f];_0x2af55e[_0xed92('0x1b')](insertAdditionalPhones(_0x25278e));}}Promise[_0xed92('0x1c')](_0x2af55e)['then'](function(){_0x5f3289({'val':0x1});});});});}function insertAdditionalPhones(_0x534794){return new Promise(function(_0x589e9b,_0x30ec24){var _0x5e84e4=_0x534794[_0xed92('0x19')];var _0x295c28=_0x5e84e4[_0xed92('0x1d')](';');var _0x4784e6=[];orderBy=0x0;for(var _0x2df8d1=0x0;_0x2df8d1<_0x295c28['length'];_0x2df8d1++){_0x4784e6['push'](splitAdditionalPhone(_0x534794['id'],_0x295c28[_0x2df8d1]));}Promise[_0xed92('0x1c')](_0x4784e6)[_0xed92('0x1e')](function(){_0x589e9b({'val':_0x295c28[_0xed92('0x1a')]});});});}function splitAdditionalPhone(_0xda7c21,_0x171f8e){return new Promise(function(_0x1af4d0,_0x6e8f2a){var _0x3dabb7=_0x171f8e[_0xed92('0x1d')](':');var _0x473aab=_0x3dabb7[0x0];var _0x5c5d35=_0x3dabb7[0x1];if(!_[_0xed92('0x1f')](_0x5c5d35)){var _0x2f6c3e=_0x5c5d35[_0xed92('0x1d')]('|');var _0x1340b2=[];for(var _0x33be59=0x0;_0x33be59<_0x2f6c3e[_0xed92('0x1a')];_0x33be59++){if(_0x2f6c3e[_0x33be59]!==''){var _0x9da0c7=_[_0xed92('0x20')](promisesAdditionalPhones,{'contactId':_0xda7c21,'phone':_0x2f6c3e[_0x33be59]});if(_0x9da0c7[_0xed92('0x1a')]==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0xda7c21,'contactTypeId':_0x473aab,'phone':_0x2f6c3e[_0x33be59],'orderBy':orderBy});}}}_0x1af4d0({'ok':0x1});}else _0x1af4d0({'res':0x0});});}function createAdditionalPhone(_0x170d53,_0x4d877c,_0x59a9ee,_0x10eaa8){var _0x316020='';var _0x24abb3='';var _0x3d9420=_0x59a9ee['split']('§');_0x316020=_0x3d9420[0x0];if(_0x3d9420[_0xed92('0x1a')]==0x2)_0x24abb3=_0x3d9420[0x1];return new Promise(function(_0x34cc33,_0x2e750c){return db[_0xed92('0x21')][_0xed92('0x22')]({'where':{'CmContactId':_0x170d53,'item':_0x316020}})[_0xed92('0x1e')](function(_0x486ce0){if(_0x486ce0){return db[_0xed92('0x21')][_0xed92('0x23')]({'ItemTypeId':_0x4d877c,'description':_0x24abb3,'OrderBy':_0x10eaa8},{'where':{'CmContactId':_0x170d53,'item':_0x316020}})[_0xed92('0x1e')](function(_0x1bde35){_0x34cc33({'res':_0xed92('0x24')});});}else{return db[_0xed92('0x21')]['create']({'CmContactId':_0x170d53,'item':_0x316020,'description':_0x24abb3,'ItemTypeId':_0x4d877c,'OrderBy':_0x10eaa8,'ItemClass':_0xed92('0x25')})['then'](function(_0x4443dd){_0x34cc33({'res':'inserted'});});}});});}function insertCmHopper(_0x4423f4,_0x33a626,_0x1c1dac,_0x45f613,_0x123f49){var _0x20819b=['cm_contacts.phone',_0xed92('0x26'),'cm_contacts.id',_0xed92('0x27'),_0x33a626+'.'+_0x45f613,'cm_contacts.createdAt',_0xed92('0x28'),_0xed92('0x29'),_0xed92('0x2a'),'\x22'+_0x123f49+'\x22'];return squel[_0xed92('0x2b')]()[_0xed92('0x2c')]('cm_hopper')[_0xed92('0x2d')](['phone',_0xed92('0x2e'),_0xed92('0x2f'),_0xed92('0x30'),_0x45f613,'createdAt',_0xed92('0x31'),'priority',_0xed92('0x32'),'recallme'],squel[_0xed92('0x33')]()[_0xed92('0x34')](_0x20819b)[_0xed92('0x12')](_0x33a626)[_0xed92('0x13')]('cm_contacts',null,_0xed92('0x35')+_0x33a626+_0xed92('0x36'))[_0xed92('0x13')](_0x1c1dac,null,_0x1c1dac+_0xed92('0x37')+_0x33a626+'.'+_0x45f613)['where'](_0x33a626+_0xed92('0x38'),_0x4423f4)[_0xed92('0x14')](_0xed92('0x39'),NOW)[_0xed92('0x14')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x33a626,_0x1c1dac,_0x45f613,_0xed92('0x3a'),[_0xed92('0x3b'),'\x22onlyIfOpen\x22']))[_0xed92('0x14')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x33a626,_0x1c1dac,_0x45f613,_0xed92('0x3a'),['\x22always\x22'])))[_0xed92('0x3c')]();}function insertCmHopperBlack(_0x22b18d,_0x201fc4,_0x15268f,_0x4b2e74){var _0x4d2cf2=[_0xed92('0x3d'),'cm_contacts.id','cm_contacts.ListId',_0x201fc4+'.'+_0x4b2e74,_0xed92('0x3e'),'cm_contacts.updatedAt'];return squel[_0xed92('0x2b')]()['into'](_0xed92('0x3f'))[_0xed92('0x2d')]([_0xed92('0x40'),_0xed92('0x2f'),_0xed92('0x30'),_0x4b2e74,_0xed92('0x41'),_0xed92('0x31')],squel['select']()[_0xed92('0x34')](_0x4d2cf2)['from'](_0x201fc4)[_0xed92('0x13')]('cm_contacts',null,_0xed92('0x35')+_0x201fc4+_0xed92('0x36'))[_0xed92('0x13')](_0x15268f,null,_0x15268f+_0xed92('0x37')+_0x201fc4+'.'+_0x4b2e74)[_0xed92('0x14')](_0x201fc4+_0xed92('0x38'),_0x22b18d)[_0xed92('0x14')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xed92('0x14')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0xed92('0x33')]()['field'](_0xed92('0x40'))['from']('cm_hopper_black')[_0xed92('0x14')]('ListId\x20=\x20?',_0x22b18d)[_0xed92('0x14')](_0x4b2e74+'\x20=\x20'+_0x201fc4+'.'+_0x4b2e74)))[_0xed92('0x3c')]();}function insertTzCmHopper(_0x3beaac,_0x1b68de,_0x28e1ea,_0x21a6b2,_0x4cce45,_0x3eeec7){var _0x24427b=[_0xed92('0x3d'),_0xed92('0x42')+_0x3eeec7+_0xed92('0x43'),_0xed92('0x44'),_0xed92('0x27'),_0x1b68de+'.'+_0x21a6b2,'cm_contacts.createdAt',_0xed92('0x28'),_0xed92('0x29'),_0xed92('0x2a'),'\x22'+_0x4cce45+'\x22'];var _0x25d48b=squel[_0xed92('0x2b')]()[_0xed92('0x2c')](_0xed92('0x3a'))[_0xed92('0x2d')]([_0xed92('0x40'),'scheduledat','ContactId',_0xed92('0x30'),_0x21a6b2,_0xed92('0x41'),'updatedAt',_0xed92('0x45'),'UserId','recallme'],squel['select']()[_0xed92('0x34')](_0x24427b)[_0xed92('0x12')](_0x1b68de)[_0xed92('0x13')](_0xed92('0x46'),null,_0xed92('0x35')+_0x1b68de+_0xed92('0x36'))[_0xed92('0x13')](_0x28e1ea,null,_0x28e1ea+'.id\x20=\x20'+_0x1b68de+'.'+_0x21a6b2)[_0xed92('0x13')](_0x3eeec7,null,_0x3eeec7+_0xed92('0x37')+_0x1b68de+'.'+_0x21a6b2)['where'](_0x1b68de+_0xed92('0x38'),_0x3beaac)[_0xed92('0x14')]('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0xed92('0x47'),selectNotIn(_0x1b68de,_0x28e1ea,_0x21a6b2,_0xed92('0x3a'),['\x22always\x22',_0xed92('0x48')]))['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x1b68de,_0x28e1ea,_0x21a6b2,_0xed92('0x3a'),['\x22always\x22'])))[_0xed92('0x3c')]();return _0x25d48b;}function insertTzCmHopperBlack(_0x222b99,_0x218a1b,_0x288bc8,_0x5805bf){var _0x20de4e=[_0xed92('0x3d'),_0xed92('0x44'),_0xed92('0x27'),_0x218a1b+'.'+_0x5805bf,_0xed92('0x3e'),'cm_contacts.updatedAt'];return squel['insert']()[_0xed92('0x2c')](_0xed92('0x3f'))['fromQuery']([_0xed92('0x40'),_0xed92('0x2f'),_0xed92('0x30'),_0x5805bf,_0xed92('0x41'),_0xed92('0x31')],squel[_0xed92('0x33')]()['fields'](_0x20de4e)[_0xed92('0x12')](_0x218a1b)[_0xed92('0x13')](_0xed92('0x46'),null,'cm_contacts.ListId\x20=\x20'+_0x218a1b+'.CmListId')[_0xed92('0x13')](_0x288bc8,null,_0x288bc8+_0xed92('0x37')+_0x218a1b+'.'+_0x5805bf)[_0xed92('0x14')](_0x218a1b+_0xed92('0x38'),_0x222b99)['where'](_0xed92('0x39'),NOW)[_0xed92('0x14')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0xed92('0x33')]()[_0xed92('0x11')](_0xed92('0x40'))[_0xed92('0x12')](_0xed92('0x3f'))[_0xed92('0x14')](_0xed92('0x49'),_0x222b99)[_0xed92('0x14')](_0x5805bf+_0xed92('0x15')+_0x218a1b+'.'+_0x5805bf)))[_0xed92('0x3c')]();}function insertCmHopperAdditionalPhones(_0x2bf97d){var _0x5c40f6=[_0xed92('0x4a'),_0xed92('0x4b'),_0xed92('0x4c'),_0xed92('0x4d'),_0xed92('0x4e')];return squel['insert']()[_0xed92('0x2c')]('cm_hopper_additional_phones')[_0xed92('0x2d')]([_0xed92('0x4f'),_0xed92('0x40'),'OrderBy',_0xed92('0x41'),_0xed92('0x31')],squel['select']()[_0xed92('0x34')](_0x5c40f6)[_0xed92('0x12')](_0xed92('0x3a'))[_0xed92('0x13')]('cm_contacts',null,_0xed92('0x50'))['join'](_0xed92('0x51'),null,_0xed92('0x52'))[_0xed92('0x14')](_0xed92('0x53'),_0x2bf97d)[_0xed92('0x14')](_0xed92('0x39'),NOW))[_0xed92('0x3c')]();}function insertCmContact(_0x3d053d,_0x2ee24b,_0xf63f0d,_0x23daa5){var _0x4468c0=_[_0xed92('0x54')](_['keys'](_0x23daa5),[_0xed92('0x30'),'CompanyId',_0xed92('0x41'),_0xed92('0x31'),_0xed92('0x55')]);return squel[_0xed92('0x2b')]()[_0xed92('0x2c')](_0xed92('0x46'))['fromQuery'](_0x4468c0,squel['select']()[_0xed92('0x34')](_0x4468c0)[_0xed92('0x12')](_0x2ee24b)[_0xed92('0x14')]('('+_0xf63f0d[_0xed92('0x13')](',')+_0xed92('0x56'),squel[_0xed92('0x33')]()[_0xed92('0x34')](_0xf63f0d)[_0xed92('0x12')]('cm_contacts')[_0xed92('0x14')]('ListId\x20=\x20?',_0x3d053d)[_0xed92('0x14')]('deletedAt\x20IS\x20NULL'))[_0xed92('0x14')](_0xed92('0x57'),squel[_0xed92('0x33')]()['field'](_0xed92('0x58'),_0xed92('0x59'))[_0xed92('0x12')](_0x2ee24b)[_0xed92('0x5a')](_0xf63f0d[_0xed92('0x13')](','))))[_0xed92('0x3c')]();}function handleStop(){logger[_0xed92('0x5b')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x484f2f){logger[_0xed92('0x5c')](_0x484f2f[_0xed92('0x5d')]);process[_0xed92('0x5e')](0x1);}function handleError(_0x7ee209,_0x32ecc9){stats[_0xed92('0x5f')][_0xed92('0x1b')]({'name':_0x32ecc9[_0xed92('0x60')],'message':_0x32ecc9[_0xed92('0x5d')],'row':_0x7ee209});}function handleQuery(_0x2c1264){logger[_0xed92('0x5b')](_0x2c1264);return db['sequelize'][_0xed92('0x61')](_0x2c1264)['spread'](function(_0x2a6b2f){results[_0xed92('0x1b')](_0x2a6b2f);})['catch'](function(_0x537e1e){logger[_0xed92('0x5c')](_0x537e1e['message']);});}function updateTzCampaigns(_0x2717e5){return new Promise(function(_0x1c6ce3,_0x2de99d){var _0x8b17a=squel[_0xed92('0x33')]()[_0xed92('0x34')]([_0xed92('0x62'),_0xed92('0x63')])[_0xed92('0x12')](_0xed92('0x64'))['join'](_0xed92('0x65'),null,_0xed92('0x66'))[_0xed92('0x14')](_0xed92('0x67')+_0x2717e5);db['sequelize'][_0xed92('0x61')](_0x8b17a[_0xed92('0x3c')]())[_0xed92('0x68')](function(_0x4db474){var _0x58826b=[];for(var _0x1e4faf=0x0;_0x1e4faf<_0x4db474[_0xed92('0x1a')];_0x1e4faf++){_0x58826b[_0xed92('0x1b')](getTimezoneData(_0x4db474[_0x1e4faf],tmp_campaigns));}BPromise[_0xed92('0x1c')](_0x58826b)[_0xed92('0x1e')](function(){_0x1c6ce3({'val':0x1});});})[_0xed92('0x69')](function(_0x2db0ee){logger['error'](_0x2db0ee[_0xed92('0x5d')]);_0x1c6ce3({'val':0x0});});});}function updateTzVoiceQueues(_0x13d0c9){return new Promise(function(_0x1340e2,_0x2e8bcb){var _0x30c0cf=squel['select']()[_0xed92('0x34')](['voice_queues.id',_0xed92('0x6a')])['from'](_0xed92('0x6b'))['join'](_0xed92('0x6c'),null,_0xed92('0x6d'))[_0xed92('0x14')](_0xed92('0x6e')+_0x13d0c9);db[_0xed92('0x6f')][_0xed92('0x61')](_0x30c0cf[_0xed92('0x3c')]())['spread'](function(_0x30e46d){var _0xdbe8d=[];for(var _0x40d45d=0x0;_0x40d45d<_0x30e46d['length'];_0x40d45d++){_0xdbe8d[_0xed92('0x1b')](getTimezoneData(_0x30e46d[_0x40d45d],tmp_voice_queues));}BPromise[_0xed92('0x1c')](_0xdbe8d)[_0xed92('0x1e')](function(){_0x1340e2({'val':0x1});});})[_0xed92('0x69')](function(_0x739c09){logger[_0xed92('0x5c')](_0x739c09[_0xed92('0x5d')]);_0x1340e2({'val':0x0});});});}function getTimezoneData(_0x204985,_0x4e4a7b){return new Promise(function(_0x1f2f0b,_0x1e31ae){var _0xe8bf3a=shared[_0xed92('0x70')];var _0x10259d=_0xe8bf3a[_0x204985[_0xed92('0x71')]];if(_[_0xed92('0x1f')](_0x10259d)){_0x1f2f0b({'ret':0x1});}else{var _0x4698d3=_0x10259d[_0xed92('0x72')];var _0x185ad1=squel[_0xed92('0x2b')]()[_0xed92('0x2c')](_0x4e4a7b)[_0xed92('0x73')]('id',_0x204985['id'])[_0xed92('0x73')]('offset',_0x4698d3)[_0xed92('0x73')](_0xed92('0x71'),_0x204985['dialTimezone'])[_0xed92('0x3c')]();return db['sequelize']['query'](_0x185ad1)['spread'](function(_0x5e9f38){_0x1f2f0b({'ret':0x1});})['catch'](function(_0x4e8cd1){logger[_0xed92('0x5c')](_0x4e8cd1[_0xed92('0x5d')]);_0x1e31ae({'ret':0x1});});}});}function handleTZQuery(_0x48bbf4){logger['info'](_0x48bbf4);return db[_0xed92('0x6f')][_0xed92('0x61')](_0x48bbf4)[_0xed92('0x68')](function(_0x4442e6){})['catch'](function(_0x8416de){logger[_0xed92('0x5c')](_0x8416de['message']);});}function main(_0x4c28ec,_0x37fbf8,_0x3c3421,_0x86ac23){logger[_0xed92('0x5b')](_0xed92('0x74'),_0x4c28ec,JSON[_0xed92('0x75')](_0x37fbf8));process[_0xed92('0x76')]('start');var _0x1b3d1e=_0x37fbf8[_0xed92('0x77')];var _0x46783e=_[_0xed92('0x78')](_0x1b3d1e);var _0xc5867b=_0x37fbf8[_0xed92('0x79')];var _0x44ad3d=path[_0xed92('0x13')](config[_0xed92('0x7a')],_0xed92('0x7b'),_0xc5867b+_0xed92('0x7c'));hasTZ=_[_0xed92('0x7d')](_0x1b3d1e)[_0xed92('0x7e')](_0xed92('0x71'));var _0x4395ec=_[_0xed92('0x7d')](_0x1b3d1e)[_0xed92('0x13')]();logger[_0xed92('0x5b')](_0xed92('0x7f'),_0x4395ec);db[_0xed92('0x80')][_0xed92('0x18')]({'raw':!![],'attributes':['id',_0xed92('0x81')]})['then'](function(_0x1372b9){for(var _0x2e0b99=0x0;_0x2e0b99<_0x1372b9['length'];_0x2e0b99++){if(_0x1372b9[_0x2e0b99][_0xed92('0x81')]in _0x1b3d1e){contactItemTypes[_0xed92('0x1b')](_0x1372b9[_0x2e0b99]);delete _0x46783e[_0x1372b9[_0x2e0b99][_0xed92('0x81')]];hasAdditionalPhones=!![];}for(var _0x32035e in _0x1b3d1e){if(_0x1372b9[_0x2e0b99]['name']+_0xed92('0x82')===_0x32035e){phoneDescriptions[_0xed92('0x1b')]({'itemTypeId':_0x1372b9[_0x2e0b99]['id'],'description':_0x32035e});delete _0x46783e[_0x32035e];}}}if(hasAdditionalPhones)_0x46783e[_0xed92('0x19')]='';var _0x268340=_[_0xed92('0x7d')](_0x46783e)[_0xed92('0x13')]();logger[_0xed92('0x5b')]('header',_0x268340);fs[_0xed92('0x83')](_0x44ad3d,_0x268340+'\x0a');Papa[_0xed92('0x84')](fs[_0xed92('0x85')](_0x4c28ec),{'header':!![],'skipEmptyLines':!![],'step':function(_0x59fc97,_0x2e0f71){try{for(var _0x1cdd4c=0x0,_0x24b0d5=[];_0x1cdd4c<_0x59fc97['data'][_0xed92('0x1a')];_0x1cdd4c++){stats[_0xed92('0x86')]+=0x1;if(_0x59fc97[_0xed92('0x5f')][_0x1cdd4c]){handleError(_0x59fc97[_0xed92('0x87')][_0x1cdd4c],_0x59fc97[_0xed92('0x5f')][_0x1cdd4c]);}else{var _0x5cbbd7=[];var _0xc12ac7=[];var _0x520012={};for(var _0x577e82 in _0x1b3d1e){let _0x452740=contactItemTypes[_0xed92('0x88')](_0x337825=>_0x337825[_0xed92('0x81')]===_0x577e82);let _0x531b42=contactItemTypes[_0xed92('0x88')](_0x17b3bd=>_0x17b3bd['name']+_0xed92('0x82')===_0x577e82);if(_[_0xed92('0x1f')](_0x452740)&&_[_0xed92('0x1f')](_0x531b42)){if(_0x1b3d1e[_0xed92('0x89')](_0x577e82)){if(_0x59fc97[_0xed92('0x87')][_0x1cdd4c][_0x1b3d1e[_0x577e82]]){var _0xcdf931=_[_0xed92('0x8a')](_0x59fc97[_0xed92('0x87')][_0x1cdd4c][_0x1b3d1e[_0x577e82]][_0xed92('0x8b')](/"/g,'\x27'));switch(_0x577e82){case _0xed92('0x2e'):var _0x11757e=moment(_0xcdf931,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x11757e['isValid']()){_0x24b0d5[_0xed92('0x1b')]('\x22'+_0xcdf931+'\x22');}else{_0x5cbbd7[_0xed92('0x1b')](_0xed92('0x8c'));}break;case'priority':var _0x3af18c=parseInt(_0xcdf931);_0xcdf931=_[_0xed92('0x8d')](_0x3af18c)||_0x3af18c<0x0||_0x3af18c>0x4?_0x86ac23?0x3:0x2:_0x3af18c;_0x24b0d5[_0xed92('0x1b')]('\x22'+_0xcdf931+'\x22');break;case'UserId':var _0xdf6335=parseInt(_0xcdf931);if(_[_0xed92('0x8e')](_0xdf6335)&&_[_0xed92('0x7e')](_0x3c3421,_0xdf6335)){_0x24b0d5[_0xed92('0x1b')]('\x22'+_0xdf6335+'\x22');}else{_0x5cbbd7[_0xed92('0x1b')](_0xed92('0x8f'));}break;case'email':if(isEmail(_0xcdf931)){_0x24b0d5['push']('\x22'+_0xcdf931+'\x22');}else{_0x5cbbd7['push'](_0xed92('0x90'));}break;case _0xed92('0x91'):var _0x5be4d8=moment(_0xcdf931,_0xed92('0x92'),!![]);if(_0x5be4d8['isValid']()){_0x24b0d5[_0xed92('0x1b')]('\x22'+_0xcdf931+'\x22');}else{_0x5cbbd7[_0xed92('0x1b')](_0xed92('0x93'));}break;case _0xed92('0x71'):var _0x5f238f=shared[_0xed92('0x70')];var _0x23ca0e=_0x5f238f[_0xcdf931];if(!_[_0xed92('0x1f')](_0x23ca0e)){var _0x11352a=_0x23ca0e[_0xed92('0x72')];_0x24b0d5[_0xed92('0x1b')]('\x22'+_0xcdf931+'\x22');_0x24b0d5[_0xed92('0x1b')]('\x22'+_0x11352a+'\x22');}break;default:_0x24b0d5[_0xed92('0x1b')]('\x22'+_0xcdf931+'\x22');}}else{switch(_0x577e82){case'firstName':case _0xed92('0x40'):_0x5cbbd7['push'](_0x577e82+_0xed92('0x94'));break;default:_0x24b0d5[_0xed92('0x1b')]('\x22\x22');}}}}else{var _0x4eead6='';if(!_[_0xed92('0x1f')](_0x452740)){if(!_0x520012['hasOwnProperty'](_0x452740['id'])){if(!_[_0xed92('0x1f')](_0x59fc97[_0xed92('0x87')][_0x1cdd4c][_0x1b3d1e[_0x577e82]])){var _0xcdf931=_[_0xed92('0x8a')](_0x59fc97[_0xed92('0x87')][_0x1cdd4c][_0x1b3d1e[_0x577e82]][_0xed92('0x8b')](/"/g,'\x27'));var _0x1a76c6=phoneDescriptions[_0xed92('0x88')](_0xe7f7fa=>_0xe7f7fa[_0xed92('0x95')]===_0x452740['id']);if(!_[_0xed92('0x1f')](_0x1a76c6)){var _0x5c8b5a=_['trim'](_0x59fc97['data'][_0x1cdd4c][_0x1b3d1e[_0x1a76c6[_0xed92('0x96')]]]['replace'](/"/g,'\x27'));if(!_[_0xed92('0x1f')](_0x5c8b5a))_0xcdf931=_0xcdf931+'§'+_0x5c8b5a;}if(_0x4eead6=='')_0x4eead6=_0xcdf931;else _0x4eead6+='|'+_0xcdf931;}_0xc12ac7[_0xed92('0x1b')](_0x452740['id']+':'+_0x4eead6);_0x520012[_0x452740['id']]=0x1;}}}}if(hasAdditionalPhones){_0x24b0d5[_0xed92('0x1b')]('\x22'+_0xc12ac7['join'](';')+'\x22');}if(_0x5cbbd7['length']){handleError(_0x59fc97[_0xed92('0x87')][_0x1cdd4c],{'code':_0xed92('0x97'),'message':_0x5cbbd7[_0xed92('0x13')]()});}else{fs[_0xed92('0x98')](_0x44ad3d,_0x24b0d5[_0xed92('0x13')]()+'\x0a');}_0x24b0d5=[];}if(!(stats[_0xed92('0x86')]%0xc8)){socket[_0xed92('0x99')](_0xed92('0x9a')+_0xc5867b,stats);stats[_0xed92('0x5f')]=[];}}if(stopped){logger[_0xed92('0x5b')](_0xed92('0x9b'));_0x2e0f71['abort']();}}catch(_0x5053ed){handleError(_0x59fc97[_0xed92('0x87')][_0x1cdd4c],{'code':'SystemError','message':_0x5053ed['message']});logger[_0xed92('0x5c')](_0xed92('0x9c'),_0x5053ed[_0xed92('0x5d')]);}},'complete':function(){try{var _0x5e54fb=[];var _0x1621e8=[];var _0x502cf2=_0xed92('0x46');if(_0x37fbf8['duplicates']&&_0x37fbf8[_0xed92('0x9d')]['length']){_0x502cf2=_0xed92('0x9e')+_0xc5867b;_0x5e54fb[_0xed92('0x1b')]('CREATE\x20TABLE\x20'+_0x502cf2+_0xed92('0x9f'));}tmp_campaigns=_0xed92('0xa0')+_0xc5867b;tmp_voice_queues=_0xed92('0xa1')+_0xc5867b;_0x1621e8[_0xed92('0x1b')](_0xed92('0xa2')+tmp_campaigns+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');_0x1621e8[_0xed92('0x1b')]('CREATE\x20TABLE\x20'+tmp_voice_queues+_0xed92('0xa3'));BPromise[_0xed92('0xa4')](_0x1621e8,handleTZQuery)[_0xed92('0x1e')](function(_0x409c92){updateTzCampaigns(_0x37fbf8[_0xed92('0x30')])[_0xed92('0x1e')](function(_0x58ba7a){updateTzVoiceQueues(_0x37fbf8[_0xed92('0x30')])[_0xed92('0x1e')](function(_0x41b764){if(hasTZ)_0x268340=_0x268340[_0xed92('0x8b')](_0xed92('0x71'),_0xed92('0xa5'));var _0x29ce69=util[_0xed92('0xa6')](_0xed92('0xa7'),_0x44ad3d,_0x502cf2,_0x268340,_0x37fbf8[_0xed92('0x30')],_0x37fbf8[_0xed92('0xa8')]||null,NOW,NOW);if(_['isNil'](_0x1b3d1e['scheduledat'])){_0x29ce69+=_0xed92('0xa9');}_0x5e54fb[_0xed92('0x1b')](_0x29ce69);if(_0x37fbf8[_0xed92('0x9d')]&&_0x37fbf8[_0xed92('0x9d')][_0xed92('0x1a')]){_0x5e54fb[_0xed92('0x1b')](insertCmContact(_0x37fbf8[_0xed92('0x30')],_0x502cf2,_0x37fbf8[_0xed92('0x9d')],_0x1b3d1e));_0x5e54fb[_0xed92('0x1b')]('DROP\x20TABLE\x20'+_0x502cf2+';');}BPromise['each'](_0x5e54fb,handleQuery)[_0xed92('0x1e')](function(_0x51cb5e){BPromise[_0xed92('0x1c')]([handleAdditionalPhones()])[_0xed92('0x1e')](function(){_0x5e54fb=[];for(var _0x4c7d0f=0x0;_0x4c7d0f\x20\x20','server/files/tmp','argv','existsSync','file\x20doesn\x27t\x20exists','binding','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','uncaughtException','path','lodash','papaparse','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','cm_contacts_temp_','test','select','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','sequelize','query','select\x20*\x20from\x20','spread','length','isNil','AdditionalPhones','push','then','catch','error','message','split','all','filter','findOne','CmContactHasItem','update','create','PHONE','inserted','CmContact','CmHopper','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','UserId','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','cm_contacts.phone','cm_contacts.id','cm_hopper_black','ListId\x20=\x20?','toString','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_hopper.ListId\x20=\x20?','concat','CompanyId',')\x20NOT\x20IN\x20?','id\x20IN\x20?','MIN(id)','info','Received\x20SIGINT','main','stringify','start','clone','socket_timestamp','root','.csv','body','ContactItemType','name','_description','writeFileSync','parse','createReadStream','data','errors','find','trim','replace','YYYY-MM-DD\x20HH:mm:ss','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','includes','agent\x20not\x20exists','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','isValid','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','itemTypeId','description','emit','contact:import:','Abort\x20parser','abort','SystemError','step','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','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','contact','contactId','contactTypeId','DROP\x20TABLE\x20','each','finish','affectedRows','unlink'];(function(_0x401ccd,_0x140815){var _0x5a57ad=function(_0x8ad698){while(--_0x8ad698){_0x401ccd['push'](_0x401ccd['shift']());}};_0x5a57ad(++_0x140815);}(_0x8b26,0x1f3));var _0x68b2=function(_0x3e5595,_0xbe4275){_0x3e5595=_0x3e5595-0x0;var _0x3fd3a6=_0x8b26[_0x3e5595];return _0x3fd3a6;};'use strict';var fs=require('fs');var path=require(_0x68b2('0x0'));var _=require(_0x68b2('0x1'));var Papa=require(_0x68b2('0x2'));var util=require('util');var BPromise=require(_0x68b2('0x3'));var moment=require(_0x68b2('0x4'));var squel=require(_0x68b2('0x5'));var Redis=require(_0x68b2('0x6'));var db=require(_0x68b2('0x7'))['db'];var config=require(_0x68b2('0x8'));var logger=require(_0x68b2('0x9'))(_0x68b2('0xa'));config[_0x68b2('0xb')]=_[_0x68b2('0xc')](config['redis'],{'host':_0x68b2('0xd'),'port':0x18eb});var socket=require(_0x68b2('0xe'))(new Redis(config[_0x68b2('0xb')]));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()[_0x68b2('0xf')]('YYYY-MM-DD\x20HH:mm:ss');var tempTableName=_0x68b2('0x10')+moment()['format']('YYYYMMDDHHmmss');var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x45e46b){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))*$/[_0x68b2('0x11')](_0x45e46b);}function selectNotIn(_0x179350,_0x4b31c6,_0x42616d,_0x54c949,_0x5ef591){return squel[_0x68b2('0x12')]()[_0x68b2('0x13')](_0x68b2('0x14'))[_0x68b2('0x15')](_0x54c949)[_0x68b2('0x16')](_0x4b31c6,null,_0x4b31c6+_0x68b2('0x17')+_0x54c949+'.'+_0x42616d)[_0x68b2('0x18')](_0x54c949+'.'+_0x42616d+_0x68b2('0x19')+_0x179350+'.'+_0x42616d)[_0x68b2('0x18')](_0x4b31c6+_0x68b2('0x1a')+_0x5ef591[_0x68b2('0x16')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x4c978d,_0x36cb47){promisesAdditionalPhones=[];promisesContact=[];return db[_0x68b2('0x1b')][_0x68b2('0x1c')](_0x68b2('0x1d')+tempTableName)[_0x68b2('0x1e')](function(_0x528823){if(_0x528823!==null){var _0x1b9955=[];for(var _0x5a01c6=0x0;_0x5a01c6<_0x528823[_0x68b2('0x1f')];_0x5a01c6++){var _0x306167=_0x528823[_0x5a01c6];if(!_[_0x68b2('0x20')](_0x306167['phone'])){if(!_['isNil'](_0x306167[_0x68b2('0x21')]))_0x1b9955[_0x68b2('0x22')](insertAdditionalPhones(_0x306167));promisesContact[_0x68b2('0x22')]({'contact':_0x306167});}}}Promise['all'](_0x1b9955)[_0x68b2('0x23')](function(){_0x4c978d({'val':0x1});});})[_0x68b2('0x24')](function(_0x3a969f){logger[_0x68b2('0x25')](_0x3a969f[_0x68b2('0x26')]);});});}function insertAdditionalPhones(_0x240c89){return new Promise(function(_0x8ddd65,_0x580aa9){var _0x2f1c44=_0x240c89[_0x68b2('0x21')];if(_[_0x68b2('0x20')](_0x2f1c44))_0x580aa9({'val':0x0});else{var _0x46b5c4=_0x2f1c44[_0x68b2('0x27')](';');var _0x5e0271=[];orderBy=0x0;for(var _0x2d2776=0x0;_0x2d2776<_0x46b5c4[_0x68b2('0x1f')];_0x2d2776++){_0x5e0271[_0x68b2('0x22')](splitAdditionalPhone(_0x240c89['id'],_0x46b5c4[_0x2d2776]));}Promise[_0x68b2('0x28')](_0x5e0271)['then'](function(){_0x8ddd65({'val':_0x46b5c4[_0x68b2('0x1f')]});});}});}function splitAdditionalPhone(_0x51a09d,_0x1ed70d){return new Promise(function(_0x25eed7,_0x41d80d){var _0x4a81b3=_0x1ed70d['split'](':');var _0x215f3a=_0x4a81b3[0x0];var _0x4ecbb3=_0x4a81b3[0x1];if(_0x4ecbb3!==''){var _0x1ceb95=_0x4ecbb3[_0x68b2('0x27')]('|');var _0x3632f0=[];for(var _0x2bb475=0x0;_0x2bb475<_0x1ceb95['length'];_0x2bb475++){if(_0x1ceb95[_0x2bb475]!==''){var _0x219142=_[_0x68b2('0x29')](promisesAdditionalPhones,{'contactId':_0x51a09d,'phone':_0x1ceb95[_0x2bb475]});if(_0x219142['length']==0x0){orderBy++;promisesAdditionalPhones[_0x68b2('0x22')]({'contactId':_0x51a09d,'contactTypeId':_0x215f3a,'phone':_0x1ceb95[_0x2bb475],'orderBy':orderBy});}}}_0x25eed7({'ok':0x1});}else _0x25eed7({'res':0x0});});}function createAdditionalPhone(_0x5a71a6,_0xdf08a1,_0x5a073b,_0x360dd2){var _0x432822='';var _0x4248f8='';var _0x356899=_0x5a073b[_0x68b2('0x27')]('§');_0x432822=_0x356899[0x0];if(_0x356899['length']==0x2)_0x4248f8=_0x356899[0x1];return new Promise(function(_0x4538e6,_0x15c820){return db['CmContactHasItem'][_0x68b2('0x2a')]({'where':{'CmContactId':_0x5a71a6,'item':_0x432822}})['then'](function(_0x40ede6){if(_0x40ede6){return db[_0x68b2('0x2b')][_0x68b2('0x2c')]({'ItemTypeId':_0xdf08a1,'description':_0x4248f8,'OrderBy':_0x360dd2},{'where':{'CmContactId':_0x5a71a6,'item':_0x432822}})[_0x68b2('0x23')](function(_0x9ce0a6){_0x4538e6({'res':'updated'});});}else{return db['CmContactHasItem'][_0x68b2('0x2d')]({'CmContactId':_0x5a71a6,'item':_0x432822,'ItemTypeId':_0xdf08a1,'description':_0x4248f8,'OrderBy':_0x360dd2,'ItemClass':_0x68b2('0x2e')})[_0x68b2('0x23')](function(_0x1d1fdb){_0x4538e6({'res':_0x68b2('0x2f')});});}});});}function updateContact(_0x55b01e){return new Promise(function(_0x1b34a2,_0xd18a6d){var _0x13be66=_0x55b01e['id'];delete _0x55b01e['id'];return db[_0x68b2('0x30')][_0x68b2('0x2c')](_0x55b01e,{'where':{'id':_0x13be66}})[_0x68b2('0x23')](function(_0x4a208c){updatedRows+=0x1;return db[_0x68b2('0x31')]['update']({'phone':_0x55b01e[_0x68b2('0x14')]},{'where':{'ContactId':_0x13be66}})[_0x68b2('0x23')](function(_0xd79b9a){_0x1b34a2({'ret':'OK'});});});});}function insertCmHopper(_0xa0aa37,_0x4a7c8d,_0x58552d,_0x37bfbc,_0x34194a){var _0x18e6f7=['cm_contacts.phone',_0x68b2('0x32'),'cm_contacts.id',_0x68b2('0x33'),_0x4a7c8d+'.'+_0x37bfbc,_0x68b2('0x34'),_0x68b2('0x35'),_0x68b2('0x36'),_0x68b2('0x37'),'\x22'+_0x34194a+'\x22'];return squel[_0x68b2('0x38')]()[_0x68b2('0x39')](_0x68b2('0x3a'))[_0x68b2('0x3b')](['phone',_0x68b2('0x3c'),_0x68b2('0x3d'),_0x68b2('0x3e'),_0x37bfbc,_0x68b2('0x3f'),_0x68b2('0x40'),_0x68b2('0x41'),_0x68b2('0x42'),_0x68b2('0x43')],squel[_0x68b2('0x12')]()[_0x68b2('0x44')](_0x18e6f7)[_0x68b2('0x15')](_0x4a7c8d)[_0x68b2('0x16')](_0x68b2('0x45'),null,_0x68b2('0x46')+_0x4a7c8d+_0x68b2('0x47'))['join'](_0x58552d,null,_0x58552d+'.id\x20=\x20'+_0x4a7c8d+'.'+_0x37bfbc)[_0x68b2('0x18')](_0x4a7c8d+_0x68b2('0x48'),_0xa0aa37)[_0x68b2('0x18')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x68b2('0x18')](_0x68b2('0x49'),selectNotIn(_0x4a7c8d,_0x58552d,_0x37bfbc,_0x68b2('0x3a'),['\x22always\x22','\x22onlyIfOpen\x22']))[_0x68b2('0x18')](_0x68b2('0x49'),selectNotIn(_0x4a7c8d,_0x58552d,_0x37bfbc,'cm_hopper',[_0x68b2('0x4a')])))['toString']();}function insertCmHopperBlack(_0x21859f,_0x1d26f4,_0x5c51f4,_0x274565){var _0x2607de=[_0x68b2('0x4b'),_0x68b2('0x4c'),_0x68b2('0x33'),_0x1d26f4+'.'+_0x274565,'cm_contacts.createdAt','cm_contacts.updatedAt'];return squel[_0x68b2('0x38')]()['into'](_0x68b2('0x4d'))['fromQuery']([_0x68b2('0x14'),'ContactId',_0x68b2('0x3e'),_0x274565,_0x68b2('0x3f'),_0x68b2('0x40')],squel['select']()[_0x68b2('0x44')](_0x2607de)[_0x68b2('0x15')](_0x1d26f4)[_0x68b2('0x16')]('cm_contacts',null,_0x68b2('0x46')+_0x1d26f4+_0x68b2('0x47'))[_0x68b2('0x16')](_0x5c51f4,null,_0x5c51f4+'.id\x20=\x20'+_0x1d26f4+'.'+_0x274565)[_0x68b2('0x18')](_0x1d26f4+_0x68b2('0x48'),_0x21859f)[_0x68b2('0x18')]('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0x68b2('0x49'),squel[_0x68b2('0x12')]()[_0x68b2('0x13')](_0x68b2('0x14'))[_0x68b2('0x15')](_0x68b2('0x4d'))[_0x68b2('0x18')](_0x68b2('0x4e'),_0x21859f)['where'](_0x274565+'\x20=\x20?',_0x1d26f4+'.'+_0x274565)))[_0x68b2('0x4f')]();}function insertCmHopperAdditionalPhones(_0x22b237){var _0x29fac9=[_0x68b2('0x50'),_0x68b2('0x51'),_0x68b2('0x52'),_0x68b2('0x53'),_0x68b2('0x54')];return squel[_0x68b2('0x38')]()['into'](_0x68b2('0x55'))['fromQuery']([_0x68b2('0x56'),'phone','OrderBy',_0x68b2('0x3f'),_0x68b2('0x40')],squel[_0x68b2('0x12')]()[_0x68b2('0x44')](_0x29fac9)[_0x68b2('0x15')]('cm_hopper')[_0x68b2('0x16')](_0x68b2('0x45'),null,_0x68b2('0x57'))[_0x68b2('0x16')](_0x68b2('0x58'),null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')[_0x68b2('0x18')](_0x68b2('0x59'),_0x22b237)['where']('cm_contacts.createdAt\x20=\x20?',NOW))[_0x68b2('0x4f')]();}function insertCmContact(_0x1aa02e,_0x516906,_0xa3841c,_0x3a2205){var _0x56c32d=_[_0x68b2('0x5a')](_['keys'](_0x3a2205),[_0x68b2('0x3e'),_0x68b2('0x5b'),'createdAt',_0x68b2('0x40')]);return squel[_0x68b2('0x38')]()['into'](_0x68b2('0x45'))['fromQuery'](_0x56c32d,squel[_0x68b2('0x12')]()[_0x68b2('0x44')](_0x56c32d)['from'](_0x516906)['where']('('+_0xa3841c[_0x68b2('0x16')](',')+_0x68b2('0x5c'),squel[_0x68b2('0x12')]()[_0x68b2('0x44')](_0xa3841c)[_0x68b2('0x15')](_0x68b2('0x45'))[_0x68b2('0x18')]('ListId\x20=\x20?',_0x1aa02e))['where'](_0x68b2('0x5d'),squel[_0x68b2('0x12')]()[_0x68b2('0x13')](_0x68b2('0x5e'),'min_id')[_0x68b2('0x15')](_0x516906)['group'](_0xa3841c[_0x68b2('0x16')](','))))[_0x68b2('0x4f')]();}function handleStop(){logger[_0x68b2('0x5f')](_0x68b2('0x60'));stopped=!![];}function handleUncaughtException(_0x2e6cac){logger[_0x68b2('0x25')](_0x2e6cac[_0x68b2('0x26')]);process['exit'](0x1);}function handleError(_0x4d13fc,_0x233dec){stats['errors'][_0x68b2('0x22')]({'name':_0x233dec['code'],'message':_0x233dec[_0x68b2('0x26')],'row':_0x4d13fc});}function handleQuery(_0x2de305){logger[_0x68b2('0x5f')](_0x2de305);return db[_0x68b2('0x1b')][_0x68b2('0x1c')](_0x2de305)[_0x68b2('0x1e')](function(_0x26f820){results[_0x68b2('0x22')](_0x26f820);})['catch'](function(_0x685971){logger['error'](_0x685971['message']);});}function main(_0x869506,_0x3588d1,_0x17c765,_0x29c561){logger[_0x68b2('0x5f')](_0x68b2('0x61'),_0x869506,JSON[_0x68b2('0x62')](_0x3588d1));process['send'](_0x68b2('0x63'));var _0x5ad1fd=_0x3588d1['binding'];var _0x2c533d=_[_0x68b2('0x64')](_0x5ad1fd);var _0x53e801=_0x3588d1[_0x68b2('0x65')];var _0x48ad10=path['join'](config[_0x68b2('0x66')],'server/files/tmp',_0x53e801+_0x68b2('0x67'));logger[_0x68b2('0x5f')](_0x68b2('0x68'),_0x3588d1);db[_0x68b2('0x69')]['findAll']({'raw':!![],'attributes':['id','name']})['then'](function(_0x4ad3f7){for(var _0x29d259=0x0;_0x29d259<_0x4ad3f7[_0x68b2('0x1f')];_0x29d259++){if(_0x4ad3f7[_0x29d259][_0x68b2('0x6a')]in _0x5ad1fd){contactItemTypes[_0x68b2('0x22')](_0x4ad3f7[_0x29d259]);delete _0x2c533d[_0x4ad3f7[_0x29d259][_0x68b2('0x6a')]];hasAdditionalPhones=!![];}for(var _0x3be72b in _0x5ad1fd){if(_0x4ad3f7[_0x29d259][_0x68b2('0x6a')]+_0x68b2('0x6b')===_0x3be72b){phoneDescriptions['push']({'itemTypeId':_0x4ad3f7[_0x29d259]['id'],'description':_0x3be72b});delete _0x2c533d[_0x3be72b];}}}if(hasAdditionalPhones)_0x2c533d[_0x68b2('0x21')]='';var _0x3f84c0=_['keys'](_0x2c533d)[_0x68b2('0x16')]();logger[_0x68b2('0x5f')]('header',_0x3f84c0);fs[_0x68b2('0x6c')](_0x48ad10,_0x3f84c0+'\x0a');Papa[_0x68b2('0x6d')](fs[_0x68b2('0x6e')](_0x869506),{'header':!![],'skipEmptyLines':!![],'step':function(_0x297f55,_0x101155){try{for(var _0x236ca8=0x0,_0x475257=[];_0x236ca8<_0x297f55[_0x68b2('0x6f')][_0x68b2('0x1f')];_0x236ca8++){stats['rows']+=0x1;if(_0x297f55[_0x68b2('0x70')][_0x236ca8]){handleError(_0x297f55['data'][_0x236ca8],_0x297f55[_0x68b2('0x70')][_0x236ca8]);}else{var _0x3fad48=[];var _0x2651aa=[];var _0x1eebdd={};for(var _0x43be18 in _0x5ad1fd){let _0x272cd6=contactItemTypes['find'](_0x3dffaa=>_0x3dffaa[_0x68b2('0x6a')]===_0x43be18);let _0x2a8d04=contactItemTypes[_0x68b2('0x71')](_0x2104f7=>_0x2104f7[_0x68b2('0x6a')]+'_description'===_0x43be18);if(_[_0x68b2('0x20')](_0x272cd6)&&_[_0x68b2('0x20')](_0x2a8d04)){if(_0x5ad1fd['hasOwnProperty'](_0x43be18)){if(_0x297f55[_0x68b2('0x6f')][_0x236ca8][_0x5ad1fd[_0x43be18]]){var _0x3864ba=_[_0x68b2('0x72')](_0x297f55['data'][_0x236ca8][_0x5ad1fd[_0x43be18]][_0x68b2('0x73')](/"/g,'\x27'));switch(_0x43be18){case _0x68b2('0x3c'):var _0x4b52be=moment(_0x3864ba,_0x68b2('0x74'),!![]);if(_0x4b52be['isValid']()){_0x475257[_0x68b2('0x22')]('\x22'+_0x3864ba+'\x22');}else{_0x3fad48[_0x68b2('0x22')](_0x68b2('0x75'));}break;case'priority':var _0x3b1041=parseInt(_0x3864ba);_0x3864ba=_[_0x68b2('0x76')](_0x3b1041)||_0x3b1041<0x0||_0x3b1041>0x4?_0x29c561?0x3:0x2:_0x3b1041;_0x475257[_0x68b2('0x22')]('\x22'+_0x3864ba+'\x22');break;case _0x68b2('0x42'):var _0x4870f8=parseInt(_0x3864ba);if(_[_0x68b2('0x77')](_0x4870f8)&&_[_0x68b2('0x78')](_0x17c765,_0x4870f8)){_0x475257['push']('\x22'+_0x4870f8+'\x22');}else{_0x3fad48[_0x68b2('0x22')](_0x68b2('0x79'));}break;case'email':if(isEmail(_0x3864ba)){_0x475257[_0x68b2('0x22')]('\x22'+_0x3864ba+'\x22');}else{_0x3fad48[_0x68b2('0x22')](_0x68b2('0x7a'));}break;case _0x68b2('0x7b'):var _0xbe2a66=moment(_0x3864ba,_0x68b2('0x7c'),!![]);if(_0xbe2a66[_0x68b2('0x7d')]()){_0x475257[_0x68b2('0x22')]('\x22'+_0x3864ba+'\x22');}else{_0x3fad48[_0x68b2('0x22')](_0x68b2('0x7e'));}break;default:_0x475257[_0x68b2('0x22')]('\x22'+_0x3864ba+'\x22');}}else{switch(_0x43be18){case _0x68b2('0x7f'):case _0x68b2('0x14'):_0x3fad48[_0x68b2('0x22')](_0x43be18+_0x68b2('0x80'));break;default:_0x475257[_0x68b2('0x22')]('\x22\x22');}}}}else{var _0x2c179f='';if(!_[_0x68b2('0x20')](_0x272cd6)){if(!_0x1eebdd['hasOwnProperty'](_0x272cd6['id'])){for(var _0x442e6e=0x0;_0x442e6e<_0x5ad1fd[_0x43be18][_0x68b2('0x1f')];_0x442e6e++){var _0x3864ba=_[_0x68b2('0x72')](_0x297f55['data'][_0x236ca8][_0x5ad1fd[_0x43be18][_0x442e6e]][_0x68b2('0x73')](/"/g,'\x27'));var _0x3d18cf=phoneDescriptions[_0x68b2('0x71')](_0xb1697=>_0xb1697[_0x68b2('0x81')]===_0x272cd6['id']);if(!_[_0x68b2('0x20')](_0x3d18cf)){var _0x52d7bc=_['trim'](_0x297f55[_0x68b2('0x6f')][_0x236ca8][_0x5ad1fd[_0x3d18cf[_0x68b2('0x82')]][0x0]][_0x68b2('0x73')](/"/g,'\x27'));if(!_['isNil'](_0x52d7bc))_0x3864ba=_0x3864ba+'§'+_0x52d7bc;}if(_0x2c179f=='')_0x2c179f=_0x3864ba;else _0x2c179f+='|'+_0x3864ba;}_0x2651aa[_0x68b2('0x22')](_0x272cd6['id']+':'+_0x2c179f);_0x1eebdd[_0x272cd6['id']]=0x1;}}}}if(hasAdditionalPhones){_0x475257[_0x68b2('0x22')]('\x22'+_0x2651aa[_0x68b2('0x16')](';')+'\x22');}if(_0x3fad48[_0x68b2('0x1f')]){handleError(_0x297f55[_0x68b2('0x6f')][_0x236ca8],{'code':'SystemRow','message':_0x3fad48[_0x68b2('0x16')]()});}else{fs['appendFileSync'](_0x48ad10,_0x475257[_0x68b2('0x16')]()+'\x0a');}_0x475257=[];}if(!(stats['rows']%0xc8)){socket[_0x68b2('0x83')](_0x68b2('0x84')+_0x53e801,stats);stats['errors']=[];}}if(stopped){logger[_0x68b2('0x5f')](_0x68b2('0x85'));_0x101155[_0x68b2('0x86')]();}}catch(_0x549791){handleError(_0x297f55[_0x68b2('0x6f')][_0x236ca8],{'code':_0x68b2('0x87'),'message':_0x549791[_0x68b2('0x26')]});logger[_0x68b2('0x25')](_0x68b2('0x88'),_0x549791[_0x68b2('0x26')]);}},'complete':function(){try{var _0x4d339f=[];var _0x6afd39=tempTableName;_0x4d339f[_0x68b2('0x22')](_0x68b2('0x89')+_0x6afd39+_0x68b2('0x8a'));logger[_0x68b2('0x5f')](_0x68b2('0x8b'),contactItemTypes[_0x68b2('0x1f')]);var _0x4141ae=util['format'](_0x68b2('0x8c'),_0x48ad10,_0x6afd39,_0x3f84c0,_0x3588d1[_0x68b2('0x3e')],_0x3588d1['CompanyId']||null,NOW,NOW);if(_[_0x68b2('0x20')](_0x5ad1fd[_0x68b2('0x3c')])){_0x4141ae+=',\x20scheduledAt\x20=\x20NOW()';}_0x4d339f[_0x68b2('0x22')](_0x4141ae);BPromise['each'](_0x4d339f,handleQuery)[_0x68b2('0x23')](function(_0x147a75){BPromise[_0x68b2('0x28')]([handleAdditionalPhones()])[_0x68b2('0x23')](function(){_0x4d339f=[];for(var _0x164590=0x0;_0x164590\x20\x20','existsSync','file\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','util','moment','squel','ioredis','../../../config/logger','import','redis','defaults','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','YYYYMMDDHHmmss','test','field','phone','from','join','.id\x20=\x20','where'];(function(_0x92c63d,_0x5408a0){var _0x273017=function(_0x8da781){while(--_0x8da781){_0x92c63d['push'](_0x92c63d['shift']());}};_0x273017(++_0x5408a0);}(_0x8c7a,0x8c));var _0xa8c7=function(_0x5da9e3,_0x3d80cd){_0x5da9e3=_0x5da9e3-0x0;var _0x5a68cd=_0x8c7a[_0x5da9e3];return _0x5a68cd;};'use strict';var fs=require('fs');var path=require(_0xa8c7('0x0'));var _=require('lodash');var Papa=require('papaparse');var util=require(_0xa8c7('0x1'));var BPromise=require('bluebird');var moment=require(_0xa8c7('0x2'));var squel=require(_0xa8c7('0x3'));var Redis=require(_0xa8c7('0x4'));var db=require('../../../mysqldb')['db'];var config=require('../../../config/environment');var logger=require(_0xa8c7('0x5'))(_0xa8c7('0x6'));config[_0xa8c7('0x7')]=_[_0xa8c7('0x8')](config[_0xa8c7('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0xa8c7('0x9'))(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()[_0xa8c7('0xa')](_0xa8c7('0xb'));var tempTableName=_0xa8c7('0xc')+moment()[_0xa8c7('0xa')](_0xa8c7('0xd'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x57bd28){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))*$/[_0xa8c7('0xe')](_0x57bd28);}function selectNotIn(_0x2b2b42,_0x79ba9a,_0x67875,_0x480f37,_0x4e2809){return squel['select']()[_0xa8c7('0xf')](_0xa8c7('0x10'))[_0xa8c7('0x11')](_0x480f37)[_0xa8c7('0x12')](_0x79ba9a,null,_0x79ba9a+_0xa8c7('0x13')+_0x480f37+'.'+_0x67875)[_0xa8c7('0x14')](_0x480f37+'.'+_0x67875+_0xa8c7('0x15')+_0x2b2b42+'.'+_0x67875)[_0xa8c7('0x14')](_0x79ba9a+'.dialCheckDuplicateType\x20IN\x20('+_0x4e2809[_0xa8c7('0x12')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x198791,_0x14e583){promisesAdditionalPhones=[];promisesContact=[];return db[_0xa8c7('0x16')][_0xa8c7('0x17')](_0xa8c7('0x18')+tempTableName)[_0xa8c7('0x19')](function(_0x256c04){if(_0x256c04!==null){var _0x2f815e=[];for(var _0x166aa5=0x0;_0x166aa5<_0x256c04[_0xa8c7('0x1a')];_0x166aa5++){var _0x45ed68=_0x256c04[_0x166aa5];if(!_['isNil'](_0x45ed68[_0xa8c7('0x10')])){if(!_[_0xa8c7('0x1b')](_0x45ed68[_0xa8c7('0x1c')]))_0x2f815e[_0xa8c7('0x1d')](insertAdditionalPhones(_0x45ed68));promisesContact[_0xa8c7('0x1d')]({'contact':_0x45ed68});}}}Promise[_0xa8c7('0x1e')](_0x2f815e)['then'](function(){_0x198791({'val':0x1});});})[_0xa8c7('0x1f')](function(_0x1dc022){logger[_0xa8c7('0x20')](_0x1dc022[_0xa8c7('0x21')]);});});}function insertAdditionalPhones(_0x16eb17){return new Promise(function(_0x1f865,_0x39cca8){var _0xc26020=_0x16eb17[_0xa8c7('0x1c')];if(_['isNil'](_0xc26020))_0x39cca8({'val':0x0});else{var _0x57cc7b=_0xc26020[_0xa8c7('0x22')](';');var _0x461712=[];orderBy=0x0;for(var _0x398717=0x0;_0x398717<_0x57cc7b[_0xa8c7('0x1a')];_0x398717++){_0x461712[_0xa8c7('0x1d')](splitAdditionalPhone(_0x16eb17['id'],_0x57cc7b[_0x398717]));}Promise[_0xa8c7('0x1e')](_0x461712)[_0xa8c7('0x23')](function(){_0x1f865({'val':_0x57cc7b[_0xa8c7('0x1a')]});});}});}function splitAdditionalPhone(_0x2bab45,_0x190f04){return new Promise(function(_0x2cb664,_0x4ea629){var _0x3520bb=_0x190f04[_0xa8c7('0x22')](':');var _0x5dee78=_0x3520bb[0x0];var _0x1cf95d=_0x3520bb[0x1];if(_0x1cf95d!==''){var _0xe1db98=_0x1cf95d['split']('|');var _0x2364d4=[];for(var _0x57bd0c=0x0;_0x57bd0c<_0xe1db98[_0xa8c7('0x1a')];_0x57bd0c++){if(_0xe1db98[_0x57bd0c]!==''){var _0x29fae4=_['filter'](promisesAdditionalPhones,{'contactId':_0x2bab45,'phone':_0xe1db98[_0x57bd0c]});if(_0x29fae4[_0xa8c7('0x1a')]==0x0){orderBy++;promisesAdditionalPhones[_0xa8c7('0x1d')]({'contactId':_0x2bab45,'contactTypeId':_0x5dee78,'phone':_0xe1db98[_0x57bd0c],'orderBy':orderBy});}}}_0x2cb664({'ok':0x1});}else _0x2cb664({'res':0x0});});}function createAdditionalPhone(_0x230f36,_0x49b0bb,_0x3fbf68,_0x413ef4){var _0x4d7bdf='';var _0x4a632c='';var _0x5c36f2=_0x3fbf68['split']('§');_0x4d7bdf=_0x5c36f2[0x0];if(_0x5c36f2[_0xa8c7('0x1a')]==0x2)_0x4a632c=_0x5c36f2[0x1];return new Promise(function(_0x15a73e,_0x258d73){return db[_0xa8c7('0x24')][_0xa8c7('0x25')]({'where':{'CmContactId':_0x230f36,'item':_0x4d7bdf}})[_0xa8c7('0x23')](function(_0x15deb6){if(_0x15deb6){return db[_0xa8c7('0x24')][_0xa8c7('0x26')]({'ItemTypeId':_0x49b0bb,'description':_0x4a632c,'OrderBy':_0x413ef4},{'where':{'CmContactId':_0x230f36,'item':_0x4d7bdf}})[_0xa8c7('0x23')](function(_0x19ae36){_0x15a73e({'res':'updated'});});}else{return db[_0xa8c7('0x24')][_0xa8c7('0x27')]({'CmContactId':_0x230f36,'item':_0x4d7bdf,'ItemTypeId':_0x49b0bb,'description':_0x4a632c,'OrderBy':_0x413ef4,'ItemClass':_0xa8c7('0x28')})[_0xa8c7('0x23')](function(_0x53298c){_0x15a73e({'res':_0xa8c7('0x29')});});}});});}function updateContact(_0x184cb2){return new Promise(function(_0x2b1ab2,_0xc964d7){var _0x41cddf=_0x184cb2['id'];delete _0x184cb2['id'];return db[_0xa8c7('0x2a')][_0xa8c7('0x26')](_0x184cb2,{'where':{'id':_0x41cddf}})[_0xa8c7('0x23')](function(_0x11ebf2){updatedRows+=0x1;return db[_0xa8c7('0x2b')][_0xa8c7('0x26')]({'phone':_0x184cb2[_0xa8c7('0x10')]},{'where':{'ContactId':_0x41cddf}})[_0xa8c7('0x23')](function(_0xe544eb){_0x2b1ab2({'ret':'OK'});});});});}function insertCmHopper(_0x4c761a,_0x2cd04d,_0x219df6,_0x53dc94,_0x451525){var _0x12a4e2=[_0xa8c7('0x2c'),_0xa8c7('0x2d'),_0xa8c7('0x2e'),'cm_contacts.ListId',_0x2cd04d+'.'+_0x53dc94,_0xa8c7('0x2f'),'cm_contacts.updatedAt',_0xa8c7('0x30'),'cm_contacts.UserId','\x22'+_0x451525+'\x22'];return squel['insert']()[_0xa8c7('0x31')]('cm_hopper')[_0xa8c7('0x32')]([_0xa8c7('0x10'),_0xa8c7('0x33'),_0xa8c7('0x34'),_0xa8c7('0x35'),_0x53dc94,_0xa8c7('0x36'),_0xa8c7('0x37'),_0xa8c7('0x38'),_0xa8c7('0x39'),_0xa8c7('0x3a')],squel[_0xa8c7('0x3b')]()['fields'](_0x12a4e2)[_0xa8c7('0x11')](_0x2cd04d)['join'](_0xa8c7('0x3c'),null,'cm_contacts.ListId\x20=\x20'+_0x2cd04d+'.CmListId')['join'](_0x219df6,null,_0x219df6+'.id\x20=\x20'+_0x2cd04d+'.'+_0x53dc94)['where'](_0x2cd04d+'.CmListId\x20=\x20?',_0x4c761a)[_0xa8c7('0x14')](_0xa8c7('0x3d'),NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x2cd04d,_0x219df6,_0x53dc94,_0xa8c7('0x3e'),[_0xa8c7('0x3f'),_0xa8c7('0x40')]))['where'](_0xa8c7('0x41'),selectNotIn(_0x2cd04d,_0x219df6,_0x53dc94,_0xa8c7('0x3e'),['\x22always\x22'])))[_0xa8c7('0x42')]();}function insertCmHopperBlack(_0x1505ce,_0x389eff,_0x360be8,_0x42bcdc){var _0x835f3c=[_0xa8c7('0x2c'),_0xa8c7('0x2e'),_0xa8c7('0x43'),_0x389eff+'.'+_0x42bcdc,_0xa8c7('0x2f'),_0xa8c7('0x44')];return squel[_0xa8c7('0x45')]()['into'](_0xa8c7('0x46'))['fromQuery']([_0xa8c7('0x10'),_0xa8c7('0x34'),'ListId',_0x42bcdc,_0xa8c7('0x36'),_0xa8c7('0x37')],squel[_0xa8c7('0x3b')]()[_0xa8c7('0x47')](_0x835f3c)['from'](_0x389eff)[_0xa8c7('0x12')](_0xa8c7('0x3c'),null,_0xa8c7('0x48')+_0x389eff+_0xa8c7('0x49'))[_0xa8c7('0x12')](_0x360be8,null,_0x360be8+_0xa8c7('0x13')+_0x389eff+'.'+_0x42bcdc)[_0xa8c7('0x14')](_0x389eff+_0xa8c7('0x4a'),_0x1505ce)[_0xa8c7('0x14')](_0xa8c7('0x3d'),NOW)['where'](_0xa8c7('0x41'),squel[_0xa8c7('0x3b')]()[_0xa8c7('0xf')](_0xa8c7('0x10'))['from']('cm_hopper_black')['where'](_0xa8c7('0x4b'),_0x1505ce)[_0xa8c7('0x14')](_0x42bcdc+_0xa8c7('0x4c'),_0x389eff+'.'+_0x42bcdc)))[_0xa8c7('0x42')]();}function insertCmHopperAdditionalPhones(_0x433a54){var _0x47479e=[_0xa8c7('0x4d'),_0xa8c7('0x4e'),_0xa8c7('0x4f'),_0xa8c7('0x50'),'cm_contact_has_items.updatedAt'];return squel['insert']()[_0xa8c7('0x31')](_0xa8c7('0x51'))[_0xa8c7('0x32')](['CmHopperId','phone',_0xa8c7('0x52'),_0xa8c7('0x36'),_0xa8c7('0x37')],squel['select']()[_0xa8c7('0x47')](_0x47479e)[_0xa8c7('0x11')](_0xa8c7('0x3e'))[_0xa8c7('0x12')](_0xa8c7('0x3c'),null,_0xa8c7('0x53'))[_0xa8c7('0x12')](_0xa8c7('0x54'),null,_0xa8c7('0x55'))[_0xa8c7('0x14')](_0xa8c7('0x56'),_0x433a54)[_0xa8c7('0x14')](_0xa8c7('0x3d'),NOW))['toString']();}function insertCmContact(_0x49c14e,_0x30df3e,_0x22900d,_0x4507b8){var _0x204cd9=_[_0xa8c7('0x57')](_[_0xa8c7('0x58')](_0x4507b8),[_0xa8c7('0x35'),'CompanyId',_0xa8c7('0x36'),'updatedAt']);return squel[_0xa8c7('0x45')]()['into'](_0xa8c7('0x3c'))[_0xa8c7('0x32')](_0x204cd9,squel[_0xa8c7('0x3b')]()['fields'](_0x204cd9)[_0xa8c7('0x11')](_0x30df3e)[_0xa8c7('0x14')]('('+_0x22900d[_0xa8c7('0x12')](',')+_0xa8c7('0x59'),squel[_0xa8c7('0x3b')]()[_0xa8c7('0x47')](_0x22900d)[_0xa8c7('0x11')](_0xa8c7('0x3c'))[_0xa8c7('0x14')]('ListId\x20=\x20?',_0x49c14e))[_0xa8c7('0x14')](_0xa8c7('0x5a'),squel[_0xa8c7('0x3b')]()[_0xa8c7('0xf')](_0xa8c7('0x5b'),'min_id')['from'](_0x30df3e)[_0xa8c7('0x5c')](_0x22900d[_0xa8c7('0x12')](','))))[_0xa8c7('0x42')]();}function handleStop(){logger[_0xa8c7('0x5d')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x4d5499){logger[_0xa8c7('0x20')](_0x4d5499[_0xa8c7('0x21')]);process['exit'](0x1);}function handleError(_0x2c6560,_0x3cce8d){stats[_0xa8c7('0x5e')][_0xa8c7('0x1d')]({'name':_0x3cce8d[_0xa8c7('0x5f')],'message':_0x3cce8d[_0xa8c7('0x21')],'row':_0x2c6560});}function handleQuery(_0x4ddc16){logger[_0xa8c7('0x5d')](_0x4ddc16);return db['sequelize'][_0xa8c7('0x17')](_0x4ddc16)['spread'](function(_0x532e0e){results[_0xa8c7('0x1d')](_0x532e0e);})['catch'](function(_0x57af11){logger[_0xa8c7('0x20')](_0x57af11['message']);});}function main(_0xbe865,_0x278dae,_0x589034,_0x177084){logger[_0xa8c7('0x5d')](_0xa8c7('0x60'),_0xbe865,JSON[_0xa8c7('0x61')](_0x278dae));process[_0xa8c7('0x62')](_0xa8c7('0x63'));var _0x47e943=_0x278dae[_0xa8c7('0x64')];var _0x57e14c=_[_0xa8c7('0x65')](_0x47e943);var _0x42df60=_0x278dae[_0xa8c7('0x66')];var _0x55849d=path[_0xa8c7('0x12')](config[_0xa8c7('0x67')],_0xa8c7('0x68'),_0x42df60+'.csv');logger[_0xa8c7('0x5d')](_0xa8c7('0x69'),_0x278dae);db[_0xa8c7('0x6a')][_0xa8c7('0x6b')]({'raw':!![],'attributes':['id',_0xa8c7('0x6c')]})[_0xa8c7('0x23')](function(_0x23481d){for(var _0x4ce781=0x0;_0x4ce781<_0x23481d[_0xa8c7('0x1a')];_0x4ce781++){if(_0x23481d[_0x4ce781]['name']in _0x47e943){contactItemTypes[_0xa8c7('0x1d')](_0x23481d[_0x4ce781]);delete _0x57e14c[_0x23481d[_0x4ce781]['name']];hasAdditionalPhones=!![];}for(var _0x526f81 in _0x47e943){if(_0x23481d[_0x4ce781][_0xa8c7('0x6c')]+_0xa8c7('0x6d')===_0x526f81){phoneDescriptions['push']({'itemTypeId':_0x23481d[_0x4ce781]['id'],'description':_0x526f81});delete _0x57e14c[_0x526f81];}}}if(hasAdditionalPhones)_0x57e14c['AdditionalPhones']='';var _0x3dc774=_[_0xa8c7('0x58')](_0x57e14c)[_0xa8c7('0x12')]();logger[_0xa8c7('0x5d')](_0xa8c7('0x6e'),_0x3dc774);fs[_0xa8c7('0x6f')](_0x55849d,_0x3dc774+'\x0a');Papa[_0xa8c7('0x70')](fs[_0xa8c7('0x71')](_0xbe865),{'header':!![],'skipEmptyLines':!![],'step':function(_0x249dfe,_0x189b00){try{for(var _0x2e6e24=0x0,_0x33161d=[];_0x2e6e24<_0x249dfe[_0xa8c7('0x72')][_0xa8c7('0x1a')];_0x2e6e24++){stats[_0xa8c7('0x73')]+=0x1;if(_0x249dfe[_0xa8c7('0x5e')][_0x2e6e24]){handleError(_0x249dfe['data'][_0x2e6e24],_0x249dfe[_0xa8c7('0x5e')][_0x2e6e24]);}else{var _0x38374d=[];var _0x167a71=[];var _0x18a6ec={};for(var _0x42727e in _0x47e943){let _0x343aad=contactItemTypes[_0xa8c7('0x74')](_0x15ed47=>_0x15ed47[_0xa8c7('0x6c')]===_0x42727e);let _0x12072a=contactItemTypes['find'](_0x23626c=>_0x23626c[_0xa8c7('0x6c')]+_0xa8c7('0x6d')===_0x42727e);if(_[_0xa8c7('0x1b')](_0x343aad)&&_[_0xa8c7('0x1b')](_0x12072a)){if(_0x47e943[_0xa8c7('0x75')](_0x42727e)){if(_0x249dfe[_0xa8c7('0x72')][_0x2e6e24][_0x47e943[_0x42727e]]){var _0x43c0ab=_[_0xa8c7('0x76')](_0x249dfe[_0xa8c7('0x72')][_0x2e6e24][_0x47e943[_0x42727e]][_0xa8c7('0x77')](/"/g,'\x27'));switch(_0x42727e){case _0xa8c7('0x33'):var _0x35dc2c=moment(_0x43c0ab,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x35dc2c[_0xa8c7('0x78')]()){_0x33161d[_0xa8c7('0x1d')]('\x22'+_0x43c0ab+'\x22');}else{_0x38374d[_0xa8c7('0x1d')](_0xa8c7('0x79'));}break;case'priority':var _0x14905d=parseInt(_0x43c0ab);_0x43c0ab=_[_0xa8c7('0x7a')](_0x14905d)||_0x14905d<0x0||_0x14905d>0x4?_0x177084?0x3:0x2:_0x14905d;_0x33161d[_0xa8c7('0x1d')]('\x22'+_0x43c0ab+'\x22');break;case'UserId':var _0x448aa1=parseInt(_0x43c0ab);if(_['isNumber'](_0x448aa1)&&_[_0xa8c7('0x7b')](_0x589034,_0x448aa1)){_0x33161d[_0xa8c7('0x1d')]('\x22'+_0x448aa1+'\x22');}else{_0x38374d[_0xa8c7('0x1d')](_0xa8c7('0x7c'));}break;case'email':if(isEmail(_0x43c0ab)){_0x33161d[_0xa8c7('0x1d')]('\x22'+_0x43c0ab+'\x22');}else{_0x38374d['push'](_0xa8c7('0x7d'));}break;case _0xa8c7('0x7e'):var _0x336dea=moment(_0x43c0ab,_0xa8c7('0x7f'),!![]);if(_0x336dea['isValid']()){_0x33161d[_0xa8c7('0x1d')]('\x22'+_0x43c0ab+'\x22');}else{_0x38374d['push'](_0xa8c7('0x80'));}break;default:_0x33161d[_0xa8c7('0x1d')]('\x22'+_0x43c0ab+'\x22');}}else{switch(_0x42727e){case _0xa8c7('0x81'):case _0xa8c7('0x10'):_0x38374d['push'](_0x42727e+_0xa8c7('0x82'));break;default:_0x33161d[_0xa8c7('0x1d')]('\x22\x22');}}}}else{var _0x3af415='';if(!_[_0xa8c7('0x1b')](_0x343aad)){if(!_0x18a6ec[_0xa8c7('0x75')](_0x343aad['id'])){for(var _0x451db6=0x0;_0x451db6<_0x47e943[_0x42727e][_0xa8c7('0x1a')];_0x451db6++){var _0x43c0ab=_['trim'](_0x249dfe[_0xa8c7('0x72')][_0x2e6e24][_0x47e943[_0x42727e][_0x451db6]][_0xa8c7('0x77')](/"/g,'\x27'));var _0x2d5e70=phoneDescriptions[_0xa8c7('0x74')](_0x460f41=>_0x460f41[_0xa8c7('0x83')]===_0x343aad['id']);if(!_[_0xa8c7('0x1b')](_0x2d5e70)){var _0x66909a=_[_0xa8c7('0x76')](_0x249dfe['data'][_0x2e6e24][_0x47e943[_0x2d5e70[_0xa8c7('0x84')]][0x0]][_0xa8c7('0x77')](/"/g,'\x27'));if(!_[_0xa8c7('0x1b')](_0x66909a))_0x43c0ab=_0x43c0ab+'§'+_0x66909a;}if(_0x3af415=='')_0x3af415=_0x43c0ab;else _0x3af415+='|'+_0x43c0ab;}_0x167a71['push'](_0x343aad['id']+':'+_0x3af415);_0x18a6ec[_0x343aad['id']]=0x1;}}}}if(hasAdditionalPhones){_0x33161d[_0xa8c7('0x1d')]('\x22'+_0x167a71[_0xa8c7('0x12')](';')+'\x22');}if(_0x38374d[_0xa8c7('0x1a')]){handleError(_0x249dfe[_0xa8c7('0x72')][_0x2e6e24],{'code':_0xa8c7('0x85'),'message':_0x38374d[_0xa8c7('0x12')]()});}else{fs[_0xa8c7('0x86')](_0x55849d,_0x33161d[_0xa8c7('0x12')]()+'\x0a');}_0x33161d=[];}if(!(stats[_0xa8c7('0x73')]%0xc8)){socket[_0xa8c7('0x87')]('contact:import:'+_0x42df60,stats);stats[_0xa8c7('0x5e')]=[];}}if(stopped){logger[_0xa8c7('0x5d')](_0xa8c7('0x88'));_0x189b00[_0xa8c7('0x89')]();}}catch(_0x137a79){handleError(_0x249dfe[_0xa8c7('0x72')][_0x2e6e24],{'code':'SystemError','message':_0x137a79['message']});logger[_0xa8c7('0x20')](_0xa8c7('0x8a'),_0x137a79[_0xa8c7('0x21')]);}},'complete':function(){try{var _0x14285d=[];var _0x205a14=tempTableName;_0x14285d['push'](_0xa8c7('0x8b')+_0x205a14+_0xa8c7('0x8c'));logger[_0xa8c7('0x5d')]('CIS\x20len',contactItemTypes['length']);var _0x3e8037=util[_0xa8c7('0xa')](_0xa8c7('0x8d'),_0x55849d,_0x205a14,_0x3dc774,_0x278dae['ListId'],_0x278dae[_0xa8c7('0x8e')]||null,NOW,NOW);if(_[_0xa8c7('0x1b')](_0x47e943[_0xa8c7('0x33')])){_0x3e8037+=_0xa8c7('0x8f');}_0x14285d[_0xa8c7('0x1d')](_0x3e8037);BPromise['each'](_0x14285d,handleQuery)[_0xa8c7('0x23')](function(_0x1ca1b9){BPromise['all']([handleAdditionalPhones()])['then'](function(){_0x14285d=[];for(var _0x1938e1=0x0;_0x1938e1\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','sequelize','findOne','enableEmailPreview','all','clone','COUNT(*)','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','isEmpty','t.id\x20IN\x20?','exports','lodash','squel','./update-interaction','updateInteraction','./utils','../../mysqldb','getAccountFK','role','search','select','field','name','color','from','tools_tags','getInteractionFK','user_has_','u.id','ui.','left_join','users','length','where','\x20IN\x20?','interactions','cm_contacts','o.id\x20=\x20i.UserId','accounts','a.id\x20=\x20i.','me.','\x20=\x20i.id','it.','expr','getSelectedTags','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','unreadMessages\x20{OPERATOR}\x200','replace','{OPERATOR}','isNumeric','i.id\x20LIKE\x20?','sms','whatsapp','includes','i.phone\x20LIKE\x20?','i.fax\x20LIKE\x20?'];(function(_0x39de5e,_0x1701bd){var _0x4041a9=function(_0x233adf){while(--_0x233adf){_0x39de5e['push'](_0x39de5e['shift']());}};_0x4041a9(++_0x1701bd);}(_0x6c69,0x1b2));var _0x96c6=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x6c69[_0x21549c];return _0x426cbd;};'use strict';var _=require(_0x96c6('0x0'));var squel=require(_0x96c6('0x1'));var as=require('../parsers/advancedSearch');var qs=require('../parsers/qs');var updateInteraction=require(_0x96c6('0x2'))[_0x96c6('0x3')];var utils=require(_0x96c6('0x4'));var db=require(_0x96c6('0x5'))['db'];function skipInteractionsQuery(_0x247695,_0x418bee,_0x32cbd5){var _0x4ae994=![];var _0x203304=utils[_0x96c6('0x6')](_0x247695);if(_0x418bee[_0x96c6('0x7')]==='agent'&&!_0x32cbd5[_0x96c6('0x8')]&&!_0x32cbd5[_0x203304]){_0x4ae994=!![];}return _0x4ae994;}function getTagsQuery(){return squel[_0x96c6('0x9')]()[_0x96c6('0xa')]('id')[_0x96c6('0xa')](_0x96c6('0xb'))[_0x96c6('0xa')](_0x96c6('0xc'))[_0x96c6('0xd')](_0x96c6('0xe'));}function getUsersQuery(_0x3d24f5,_0x36d624){var _0x92d69e=utils[_0x96c6('0xf')](_0x3d24f5);var _0x3fbf78=_0x96c6('0x10')+_0x3d24f5+'_interactions';var _0x42b22c=squel[_0x96c6('0x9')]()[_0x96c6('0xa')](_0x96c6('0x11'))[_0x96c6('0xa')]('u.fullname')['field'](_0x96c6('0x12')+_0x92d69e)[_0x96c6('0xd')](_0x3fbf78,'ui')[_0x96c6('0x13')](_0x96c6('0x14'),'u','u.id\x20=\x20ui.UserId');if(_0x36d624[_0x96c6('0x15')]>0x0){_0x42b22c[_0x96c6('0x16')](_0x96c6('0x12')+_0x92d69e+_0x96c6('0x17'),_['map'](_0x36d624,'id'));}return _0x42b22c;}function getInteractionsQuery(_0x6cad50){var _0x29c817=utils['getInteractionsTables'](_0x6cad50);var _0xd06f6b=utils['getAccountFK'](_0x6cad50);var _0x3547e1=utils[_0x96c6('0xf')](_0x6cad50);return squel['select']()[_0x96c6('0xd')](_0x29c817[_0x96c6('0x18')],'i')[_0x96c6('0x13')](_0x96c6('0x19'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x96c6('0x13')](_0x96c6('0x14'),'o',_0x96c6('0x1a'))['left_join'](_0x29c817[_0x96c6('0x1b')],'a',_0x96c6('0x1c')+_0xd06f6b)[_0x96c6('0x13')](_0x29c817['messages'],'me',_0x96c6('0x1d')+_0x3547e1+_0x96c6('0x1e'))['left_join'](_0x29c817['interactionsTags'],'it',_0x96c6('0x1f')+_0x3547e1+_0x96c6('0x1e'))[_0x96c6('0x13')](_0x96c6('0xe'),'t','t.id\x20=\x20it.TagId');}function getSqlClauses(){var _0x40a4b3={'body':squel[_0x96c6('0x20')](),'contact':squel['expr'](),'default':squel[_0x96c6('0x20')](),'fields':squel[_0x96c6('0x20')](),'filter':squel[_0x96c6('0x20')](),'read':squel[_0x96c6('0x20')](),'tags':{'clause':squel[_0x96c6('0x20')](),'ids':null},'user':squel[_0x96c6('0x20')]()};return _0x40a4b3;}function parseTagParameter(_0x223ede){var _0x378494=squel[_0x96c6('0x20')]();if(_0x223ede){var _0x296864=utils[_0x96c6('0x21')](_0x223ede);_0x296864[_0x96c6('0x22')](function(_0x422308){_0x378494['or'](_0x96c6('0x23'),'%,'+_0x422308+',%');});}return _0x378494;}function parseReadParameter(_0xc4acd5){var _0x545072='';if(_0xc4acd5){_0x545072=_0x96c6('0x24');if(_0xc4acd5==='1'){_0x545072=_0x545072[_0x96c6('0x25')](_0x96c6('0x26'),'=');}else{_0x545072=_0x545072[_0x96c6('0x25')](_0x96c6('0x26'),'>');}}return _0x545072;}function parseSearchFilter(_0x22c25b,_0x531a13){var _0x3caef2=squel[_0x96c6('0x20')]();if(_0x531a13){var _0x3457df=_0x531a13[_0x96c6('0x25')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x96c6('0x27')](_0x3457df)){_0x3caef2['or'](_0x96c6('0x28'),_0x3457df+'%');if([_0x96c6('0x29'),_0x96c6('0x2a')][_0x96c6('0x2b')](_0x22c25b)){_0x3caef2['or'](_0x96c6('0x2c'),_0x3457df+'%');}else if(_0x22c25b==='fax'){_0x3caef2['or'](_0x96c6('0x2d'),_0x3457df+'%');}else if(_0x22c25b===_0x96c6('0x2e')){_0x3caef2['or'](_0x96c6('0x2f'),_0x3457df+'%');}}else if(_0x22c25b===_0x96c6('0x30')&&qs[_0x96c6('0x31')](_0x3457df)){_0x3caef2['or']('c.email\x20LIKE\x20?',_0x3457df+'%');}else{if(_0x22c25b===_0x96c6('0x30')){_0x3caef2['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x96c6('0x32')](_0x3457df,!![]))['or'](_0x96c6('0x33'),qs[_0x96c6('0x32')](_0x3457df));}else if(_0x22c25b!==_0x96c6('0x34')){_0x3caef2['or'](_0x96c6('0x35'),qs[_0x96c6('0x32')](_0x3457df));}_0x3caef2['or'](_0x96c6('0x36'),qs[_0x96c6('0x32')](_0x3457df,!![]),null);}}return _0x3caef2;}function parseAdvancedSearchFilter(_0x42bcb7,_0xe9a908){var _0x3bd695=getSqlClauses();var _0x37c031=as['parseSearch'](_0x42bcb7);var _0xb97897=_0x37c031['sqlOperator'];for(var _0x4fe06e=0x0;_0x4fe06e<_0x37c031['conditions'][_0x96c6('0x15')];_0x4fe06e++){var _0x333cca=_0x37c031['conditions'][_0x4fe06e];var _0x45a4f0='i';var _0x2533da=_[_0x96c6('0x37')](_0xe9a908,[_0x96c6('0xb'),_0x333cca[_0x96c6('0xa')]]);if(_0x2533da){var _0x1f4ede=as['buildExpression'](_0x45a4f0,_0x2533da[_0x96c6('0x38')],_0x333cca);_0x3bd695['default'][_0xb97897](_0x1f4ede[_0x96c6('0x39')],_0x1f4ede[_0x96c6('0x3a')][_0x96c6('0x3b')],_0x1f4ede[_0x96c6('0x3a')][_0x96c6('0x3c')]);}else{switch(_0x333cca['field']){case _0x96c6('0x3d'):var _0x3dd5dc=parseReadParameter(_0x333cca['value']);_0x3bd695[_0x96c6('0x3e')]['and'](_0x3dd5dc);break;case'Contact':if(_0x333cca[_0x96c6('0x3f')]===_0x96c6('0x40')){if(_0x333cca['value']['split']('\x20')[_0x96c6('0x15')]>0x1){_0x3bd695[_0x96c6('0x41')][_0xb97897](_0x96c6('0x36'),qs['getFullTextValue'](_0x333cca['value'],!![]),null);}else{var _0x1ed56c='%'+_0x333cca[_0x96c6('0x3a')]+'%';_0x3bd695[_0x96c6('0x41')][_0xb97897](_0x96c6('0x42'),_0x1ed56c,_0x1ed56c,_0x1ed56c);}}else{_0x2533da=_['find'](_0xe9a908,[_0x96c6('0xb'),_0x96c6('0x43')]);_0x333cca[_0x96c6('0xa')]=_0x96c6('0x43');_0x1f4ede=as[_0x96c6('0x44')](_0x45a4f0,_0x2533da[_0x96c6('0x38')],_0x333cca);_0x3bd695[_0x96c6('0x41')][_0xb97897](_0x1f4ede[_0x96c6('0x39')],_0x1f4ede[_0x96c6('0x3a')][_0x96c6('0x3b')],_0x1f4ede['value'][_0x96c6('0x3c')]);}break;case _0x96c6('0x45'):var _0xadc934=_0x333cca['value'][_0x96c6('0x46')](',')['map'](function(_0x2514f9){return Number(_0x2514f9);});var _0x4eaf97=parseTagParameter(_0xadc934);_0x3bd695[_0x96c6('0x47')]['clause'][_0x96c6('0x48')](_0x4eaf97);_0x3bd695[_0x96c6('0x47')][_0x96c6('0x49')]=_0xadc934;break;case _0x96c6('0x4a'):if(_0x333cca['operator']==='$substring'){_0x3bd695[_0x96c6('0x4b')][_0xb97897]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x333cca['value']+'%',null);}else{_0x2533da=_[_0x96c6('0x37')](_0xe9a908,[_0x96c6('0xb'),_0x96c6('0x4c')]);_0x333cca['field']=_0x96c6('0x4c');_0x1f4ede=as['buildExpression'](_0x45a4f0,_0x2533da[_0x96c6('0x38')],_0x333cca);_0x3bd695['user'][_0xb97897](_0x1f4ede['text'],_0x1f4ede[_0x96c6('0x3a')][_0x96c6('0x3b')],_0x1f4ede['value'][_0x96c6('0x3c')]);}break;case _0x96c6('0x4d'):case'plainBody':_0x1f4ede=as[_0x96c6('0x44')]('me',null,_0x333cca);_0x3bd695[_0x96c6('0x4d')][_0xb97897](_0x1f4ede[_0x96c6('0x39')],_0x1f4ede[_0x96c6('0x3a')][_0x96c6('0x3b')],_0x1f4ede['value'][_0x96c6('0x3c')]);break;}}}return _0x3bd695;}function parseModelFields(_0x30b9c8,_0x7c0a14,_0x8e199a){var _0x4a5ffe=utils['getAccountFK'](_0x30b9c8);var _0x11abbe=squel[_0x96c6('0x20')]();var _0x3541a2=_(_0x7c0a14)[_0x96c6('0x4e')]()[_0x96c6('0x4f')](function(_0x3b129a){return _['some'](_0x8e199a,[_0x96c6('0xb'),_0x3b129a])?_0x3b129a:undefined;})[_0x96c6('0x50')]()['value']();if(_0x3541a2[_0x96c6('0x15')]>0x0){_0x3541a2[_0x96c6('0x22')](function(_0x201084){if(_0x201084===_0x4a5ffe){_0x11abbe[_0x96c6('0x48')]('i.'+_0x4a5ffe+_0x96c6('0x17'),[][_0x96c6('0x51')](_0x7c0a14[_0x201084]));}else if(_0x201084===_0x96c6('0x52')){var _0x3641b2=JSON['parse'](_0x7c0a14[_0x201084])[_0x96c6('0x53')];var _0xe6a2f8=JSON[_0x96c6('0x54')](_0x7c0a14[_0x201084])[_0x96c6('0x55')];_0x11abbe[_0x96c6('0x48')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x3641b2,_0xe6a2f8);}else{if(_0x7c0a14[_0x201084]==='null'){_0x11abbe[_0x96c6('0x48')]('i.'+_0x201084+_0x96c6('0x56'));}else{_0x11abbe[_0x96c6('0x48')]('i.'+_0x201084+_0x96c6('0x57'),_0x7c0a14[_0x201084]);}}});}return _0x11abbe;}function parseQueryParameters(_0x9df1b4,_0x42f8ca,_0xc58879){var _0x3572b4=getSqlClauses();return Promise[_0x96c6('0x58')]()['then'](function(){return parseModelFields(_0x9df1b4,_0x42f8ca,_0xc58879);})[_0x96c6('0x59')](function(_0x599f35){_0x3572b4['fields'][_0x96c6('0x48')](_0x599f35);return parseReadParameter(_0x42f8ca[_0x96c6('0x3e')]);})['then'](function(_0xb15e49){_0x3572b4[_0x96c6('0x3e')][_0x96c6('0x48')](_0xb15e49);return parseTagParameter(_0x42f8ca[_0x96c6('0x5a')]);})[_0x96c6('0x59')](function(_0x56e466){_0x3572b4[_0x96c6('0x47')]['clause'][_0x96c6('0x48')](_0x56e466);return parseSearchFilter(_0x9df1b4,_0x42f8ca[_0x96c6('0x5b')]);})[_0x96c6('0x59')](function(_0x4a855e){_0x3572b4[_0x96c6('0x5b')]=_0x4a855e;return _0x3572b4;});}function checkAccountsRestrictions(_0x275d31,_0x13f93f,_0x387ca2){var _0x2d3dc0=utils[_0x96c6('0x6')](_0x275d31);var _0x44f85c=_0x96c6('0x5c')+_[_0x96c6('0x5d')](_0x275d31)+(_0x275d31==='chat'?_0x96c6('0x5e'):'Accounts');var _0x3ef44a=squel[_0x96c6('0x20')]();return Promise[_0x96c6('0x58')]()[_0x96c6('0x59')](function(){if(_0x387ca2[_0x96c6('0x8')]&&_0x13f93f[_0x96c6('0x7')]===_0x96c6('0x5f')){return _0x13f93f[_0x44f85c]({'attributes':['id'],'raw':!![]});}})['then'](function(_0x57b4be){if(_0x57b4be){if(_0x57b4be[_0x96c6('0x15')]===0x0){_0x3ef44a[_0x96c6('0x48')]('i.'+_0x2d3dc0+'\x20IS\x20NULL');}else{_0x3ef44a[_0x96c6('0x48')]('i.'+_0x2d3dc0+_0x96c6('0x17'),_['map'](_0x57b4be,'id'));}}else if(!_0x387ca2[_0x2d3dc0]){_0x3ef44a[_0x96c6('0x48')]('i.'+_0x2d3dc0+_0x96c6('0x60'));}})[_0x96c6('0x59')](function(){return _0x3ef44a;});}function getClosedOrderClause(_0x49b256,_0x24ae8f){var _0x3c3eff='';var _0x59ca13=['i.thirdDisposition','i.secondDisposition','i.disposition'];if(_0x49b256===_0x96c6('0x30')){_0x59ca13[_0x96c6('0x61')]('i.substatus');}if(_0x24ae8f[_0x96c6('0x62')]==='0'&&_0x49b256===_0x96c6('0x30')){_0x3c3eff=_0x96c6('0x63');}else{if(_0x24ae8f[_0x96c6('0x62')]==='1'){_0x59ca13[_0x96c6('0x64')]();}_0x3c3eff=_0x96c6('0x65')+_0x59ca13['join'](',\x20')+')';}return _0x3c3eff;}function getFilteredInteractions(_0x4ed5a4,_0x326dc7,_0x41a1d9,_0x787226){var _0x4ed54a=utils['getInteractionFK'](_0x4ed5a4);var _0xb22305=_[_0x96c6('0x5d')](_0x4ed5a4)+_0x96c6('0x66');var _0x3ee147=[];var _0x216632=getTagsQuery();var _0x376235={'type':db[_0x96c6('0x67')][_0x96c6('0x68')][_0x96c6('0x69')],'raw':!![]};var _0x21c695=[];var _0x3784c6=[];return db['sequelize'][_0x96c6('0x6a')](_0x216632[_0x96c6('0x6b')](),_0x376235)[_0x96c6('0x59')](function(_0x46b80d){_0x3ee147=_[_0x96c6('0x6c')](_0x46b80d,'id');_0x376235=_['merge'](_0x376235,{'model':db[_0xb22305],'mapToModel':!![],'nest':!![]});if(_0x41a1d9[_0x96c6('0x6d')]){_0x787226['attributes']['forEach'](function(_0x311c69){_0x326dc7[_0x96c6('0xa')]('i.'+_0x311c69);});}else{_0x326dc7['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x96c6('0x3d'));_0x326dc7[_0x96c6('0xa')]('a.key',_0x96c6('0x6e'));_0x326dc7[_0x96c6('0xa')]('a.mandatoryDisposition',_0x96c6('0x6f'));if(_0x4ed5a4==='mail'){_0x326dc7[_0x96c6('0xa')](_0x96c6('0x70'),_0x96c6('0x71'));_0x326dc7[_0x96c6('0xa')]('CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');_0x326dc7['field'](_0x96c6('0x72'));_0x326dc7[_0x96c6('0xa')](_0x96c6('0x73'));_0x326dc7['field'](_0x96c6('0x74'));_0x326dc7[_0x96c6('0xa')](_0x96c6('0x75'));_0x326dc7[_0x96c6('0xa')](_0x96c6('0x76'));_0x326dc7[_0x96c6('0xa')](_0x96c6('0x77'));_0x326dc7[_0x96c6('0xa')](_0x96c6('0x78'));_0x326dc7[_0x96c6('0xa')](_0x96c6('0x79'));_0x326dc7['field'](_0x96c6('0x7a'));_0x326dc7[_0x96c6('0xa')](_0x96c6('0x7b'));_0x326dc7[_0x96c6('0xa')](_0x96c6('0x7c'));_0x326dc7[_0x96c6('0xa')](_0x96c6('0x7d'));_0x326dc7[_0x96c6('0xa')](_0x96c6('0x63'));_0x326dc7[_0x96c6('0xa')](_0x96c6('0x7e'));_0x326dc7['field'](_0x96c6('0x7f'));_0x326dc7['field'](_0x96c6('0x80'));_0x326dc7[_0x96c6('0xa')](_0x96c6('0x81'));}else if(_0x4ed5a4===_0x96c6('0x2e')){_0x326dc7[_0x96c6('0xa')]('CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0x96c6('0x82'));}else{_0x326dc7[_0x96c6('0xa')](_0x96c6('0x83'),'contactName');}if(_0x4ed5a4!=='mail'){_0x326dc7[_0x96c6('0xa')](_0x96c6('0x84'));}_0x326dc7[_0x96c6('0xa')](_0x96c6('0x85'),_0x96c6('0x86'));_0x326dc7[_0x96c6('0xa')](_0x96c6('0x87'),_0x96c6('0x88'));_0x326dc7['field'](_0x96c6('0x89'),_0x96c6('0x8a'));_0x326dc7[_0x96c6('0xa')]('c.phone',_0x96c6('0x8b'));_0x326dc7[_0x96c6('0xa')](_0x96c6('0x8c'),_0x96c6('0x8d'));_0x326dc7[_0x96c6('0xa')]('c.fax',_0x96c6('0x8e'));_0x326dc7[_0x96c6('0xa')](_0x96c6('0x8f'),_0x96c6('0x90'));_0x326dc7[_0x96c6('0xa')](_0x96c6('0x91'),_0x96c6('0x92'));_0x326dc7[_0x96c6('0xa')](_0x96c6('0x93'),_0x96c6('0x94'));}if(_0x787226[_0x96c6('0x95')]){_0x326dc7[_0x96c6('0x95')](_0x787226[_0x96c6('0x95')]);}if(_0x787226['offset']){_0x326dc7['offset'](_0x787226['offset']);}return db['sequelize']['query'](_0x326dc7['toString'](),_0x376235);})[_0x96c6('0x59')](function(_0x4d55e8){_0x21c695=_0x4d55e8;var _0xb2f611=getUsersQuery(_0x4ed5a4,_0x21c695);return db[_0x96c6('0x96')][_0x96c6('0x6a')](_0xb2f611[_0x96c6('0x6b')](),_0x376235);})[_0x96c6('0x59')](function(_0xdc7191){_0x3784c6=_['groupBy'](_0xdc7191,_0x4ed54a);if(_0x4ed5a4===_0x96c6('0x30')){return db['Setting'][_0x96c6('0x97')]({'attributes':['enableEmailPreview'],'raw':!![]});}})[_0x96c6('0x59')](function(_0x463529){var _0x4f58d9=_0x463529?_0x463529[_0x96c6('0x98')]:undefined;var _0x4812a5=_0x21c695['map'](function(_0x487c9c){return updateInteraction(_0x487c9c,_0x3ee147,_0x3784c6,_0x4f58d9);});return Promise[_0x96c6('0x99')](_0x4812a5);});}function countFilteredInteractions(_0x4fe203,_0x21a1db){var _0x4c3b1f=_0x4fe203[_0x96c6('0x9a')]();_0x4c3b1f[_0x96c6('0xa')](_0x96c6('0x9b'));_0x4c3b1f[_0x96c6('0xa')](_0x96c6('0x9c'),_0x96c6('0x3d'));var _0x6640ba=utils[_0x96c6('0x21')](_0x21a1db);if(!_[_0x96c6('0x9d')](_0x6640ba)){_0x4c3b1f[_0x96c6('0x16')](_0x96c6('0x9e'),_0x6640ba);}var _0x2f7730={'type':db[_0x96c6('0x67')][_0x96c6('0x68')][_0x96c6('0x69')],'raw':!![]};return db[_0x96c6('0x96')][_0x96c6('0x6a')](_0x4c3b1f[_0x96c6('0x6b')](),_0x2f7730);}module[_0x96c6('0x9f')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file +var _0x4d58=['lodash','squel','../parsers/advancedSearch','../parsers/qs','./update-interaction','./utils','role','agent','search','select','field','name','color','from','getInteractionFK','_interactions','u.id','u.fullname','ui.','left_join','users','\x20IN\x20?','map','getInteractionsTables','getAccountFK','interactions','cm_contacts','o.id\x20=\x20i.UserId','accounts','a.id\x20=\x20i.','messages','me.','\x20=\x20i.id','interactionsTags','it.','tools_tags','t.id\x20=\x20it.TagId','expr','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','{OPERATOR}','i.id\x20LIKE\x20?','sms','whatsapp','i.phone\x20LIKE\x20?','fax','openchannel','i.from\x20LIKE\x20?','mail','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','parseSearch','conditions','find','buildExpression','type','default','text','value','end','unreadMessages','read','and','Contact','$substring','contact','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','start','Tag','tags','clause','ids','operator','user','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','plainBody','keys','some','compact','length','concat','createdAt','parse','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','then','fields','tag','filter','capitalize','chat','Websites','Accounts','resolve','\x20IS\x20NOT\x20NULL','i.thirdDisposition','i.disposition','unshift','i.substatus','closed','shift','join','Interaction','sequelize','query','toString','keyBy','merge','attributes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','a.email','Account.email','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.id','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.secondDisposition','i.ContactId','i.MailAccountId','i.UserId','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','groupBy','Setting','enableEmailPreview','all','COUNT(*)','isEmpty','where','t.id\x20IN\x20?','Sequelize','QueryTypes','exports'];(function(_0x4ba1e0,_0x460925){var _0x5d333b=function(_0x39ca4a){while(--_0x39ca4a){_0x4ba1e0['push'](_0x4ba1e0['shift']());}};_0x5d333b(++_0x460925);}(_0x4d58,0x15e));var _0x84d5=function(_0x2e2251,_0x3480f0){_0x2e2251=_0x2e2251-0x0;var _0x309e22=_0x4d58[_0x2e2251];return _0x309e22;};'use strict';var _=require(_0x84d5('0x0'));var squel=require(_0x84d5('0x1'));var as=require(_0x84d5('0x2'));var qs=require(_0x84d5('0x3'));var updateInteraction=require(_0x84d5('0x4'))['updateInteraction'];var utils=require(_0x84d5('0x5'));var db=require('../../mysqldb')['db'];function skipInteractionsQuery(_0x2fd646,_0x56dc52,_0x337e7c){var _0x45aea7=![];var _0x3c503c=utils['getAccountFK'](_0x2fd646);if(_0x56dc52[_0x84d5('0x6')]===_0x84d5('0x7')&&!_0x337e7c[_0x84d5('0x8')]&&!_0x337e7c[_0x3c503c]){_0x45aea7=!![];}return _0x45aea7;}function getTagsQuery(){return squel[_0x84d5('0x9')]()[_0x84d5('0xa')]('id')[_0x84d5('0xa')](_0x84d5('0xb'))[_0x84d5('0xa')](_0x84d5('0xc'))[_0x84d5('0xd')]('tools_tags');}function getUsersQuery(_0x22f32b,_0x28c1fe){var _0x2151e1=utils[_0x84d5('0xe')](_0x22f32b);var _0x8bf2b4='user_has_'+_0x22f32b+_0x84d5('0xf');var _0x20bc0c=squel[_0x84d5('0x9')]()[_0x84d5('0xa')](_0x84d5('0x10'))[_0x84d5('0xa')](_0x84d5('0x11'))[_0x84d5('0xa')](_0x84d5('0x12')+_0x2151e1)['from'](_0x8bf2b4,'ui')[_0x84d5('0x13')](_0x84d5('0x14'),'u','u.id\x20=\x20ui.UserId');if(_0x28c1fe['length']>0x0){_0x20bc0c['where']('ui.'+_0x2151e1+_0x84d5('0x15'),_[_0x84d5('0x16')](_0x28c1fe,'id'));}return _0x20bc0c;}function getInteractionsQuery(_0x2146ae){var _0x520dd2=utils[_0x84d5('0x17')](_0x2146ae);var _0x536fb9=utils[_0x84d5('0x18')](_0x2146ae);var _0x8880d2=utils['getInteractionFK'](_0x2146ae);return squel[_0x84d5('0x9')]()[_0x84d5('0xd')](_0x520dd2[_0x84d5('0x19')],'i')[_0x84d5('0x13')](_0x84d5('0x1a'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x84d5('0x13')](_0x84d5('0x14'),'o',_0x84d5('0x1b'))['left_join'](_0x520dd2[_0x84d5('0x1c')],'a',_0x84d5('0x1d')+_0x536fb9)[_0x84d5('0x13')](_0x520dd2[_0x84d5('0x1e')],'me',_0x84d5('0x1f')+_0x8880d2+_0x84d5('0x20'))[_0x84d5('0x13')](_0x520dd2[_0x84d5('0x21')],'it',_0x84d5('0x22')+_0x8880d2+'\x20=\x20i.id')[_0x84d5('0x13')](_0x84d5('0x23'),'t',_0x84d5('0x24'));}function getSqlClauses(){var _0xb1bffd={'body':squel[_0x84d5('0x25')](),'contact':squel[_0x84d5('0x25')](),'default':squel[_0x84d5('0x25')](),'fields':squel[_0x84d5('0x25')](),'filter':squel[_0x84d5('0x25')](),'read':squel[_0x84d5('0x25')](),'tags':{'clause':squel['expr'](),'ids':null},'user':squel[_0x84d5('0x25')]()};return _0xb1bffd;}function parseTagParameter(_0x4b70c6){var _0x235907=squel[_0x84d5('0x25')]();if(_0x4b70c6){var _0x4904ae=utils['getSelectedTags'](_0x4b70c6);_0x4904ae[_0x84d5('0x26')](function(_0x14bfc4){_0x235907['or'](_0x84d5('0x27'),'%,'+_0x14bfc4+',%');});}return _0x235907;}function parseReadParameter(_0x6604a0){var _0x32ac5b='';if(_0x6604a0){_0x32ac5b='unreadMessages\x20{OPERATOR}\x200';if(_0x6604a0==='1'){_0x32ac5b=_0x32ac5b[_0x84d5('0x28')](_0x84d5('0x29'),'=');}else{_0x32ac5b=_0x32ac5b[_0x84d5('0x28')]('{OPERATOR}','>');}}return _0x32ac5b;}function parseSearchFilter(_0x46177e,_0x2d3972){var _0x88da7c=squel[_0x84d5('0x25')]();if(_0x2d3972){var _0x45d11e=_0x2d3972[_0x84d5('0x28')]('\x5c','\x5c\x5c')[_0x84d5('0x28')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x45d11e)){_0x88da7c['or'](_0x84d5('0x2a'),_0x45d11e+'%');if([_0x84d5('0x2b'),_0x84d5('0x2c')]['includes'](_0x46177e)){_0x88da7c['or'](_0x84d5('0x2d'),_0x45d11e+'%');}else if(_0x46177e===_0x84d5('0x2e')){_0x88da7c['or']('i.fax\x20LIKE\x20?',_0x45d11e+'%');}else if(_0x46177e===_0x84d5('0x2f')){_0x88da7c['or'](_0x84d5('0x30'),_0x45d11e+'%');}}else if(_0x46177e===_0x84d5('0x31')&&qs[_0x84d5('0x32')](_0x45d11e)){_0x88da7c['or'](_0x84d5('0x33'),_0x45d11e+'%');}else{if(_0x46177e===_0x84d5('0x31')){_0x88da7c['or'](_0x84d5('0x34'),qs[_0x84d5('0x35')](_0x45d11e,!![]))['or'](_0x84d5('0x36'),qs[_0x84d5('0x35')](_0x45d11e));}else if(_0x46177e!==_0x84d5('0x2e')){_0x88da7c['or'](_0x84d5('0x37'),qs['getFullTextValue'](_0x45d11e));}_0x88da7c['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x84d5('0x35')](_0x45d11e,!![]),null);}}return _0x88da7c;}function parseAdvancedSearchFilter(_0x1737b0,_0x30a3d6){var _0x4e5677=getSqlClauses();var _0x495eee=as[_0x84d5('0x38')](_0x1737b0);var _0x488d25=_0x495eee['sqlOperator'];for(var _0x168b77=0x0;_0x168b77<_0x495eee[_0x84d5('0x39')]['length'];_0x168b77++){var _0x3ad8fc=_0x495eee[_0x84d5('0x39')][_0x168b77];var _0x1940d3='i';var _0x123f78=_[_0x84d5('0x3a')](_0x30a3d6,[_0x84d5('0xb'),_0x3ad8fc[_0x84d5('0xa')]]);if(_0x123f78){var _0x56ad44=as[_0x84d5('0x3b')](_0x1940d3,_0x123f78[_0x84d5('0x3c')],_0x3ad8fc);_0x4e5677[_0x84d5('0x3d')][_0x488d25](_0x56ad44[_0x84d5('0x3e')],_0x56ad44[_0x84d5('0x3f')]['start'],_0x56ad44['value'][_0x84d5('0x40')]);}else{switch(_0x3ad8fc[_0x84d5('0xa')]){case _0x84d5('0x41'):var _0x20a23b=parseReadParameter(_0x3ad8fc['value']);_0x4e5677[_0x84d5('0x42')][_0x84d5('0x43')](_0x20a23b);break;case _0x84d5('0x44'):if(_0x3ad8fc['operator']===_0x84d5('0x45')){if(_0x3ad8fc[_0x84d5('0x3f')]['split']('\x20')['length']>0x1){_0x4e5677[_0x84d5('0x46')][_0x488d25](_0x84d5('0x47'),qs[_0x84d5('0x35')](_0x3ad8fc[_0x84d5('0x3f')],!![]),null);}else{var _0x28ca5e='%'+_0x3ad8fc['value']+'%';_0x4e5677[_0x84d5('0x46')][_0x488d25](_0x84d5('0x48'),_0x28ca5e,_0x28ca5e,_0x28ca5e);}}else{_0x123f78=_[_0x84d5('0x3a')](_0x30a3d6,[_0x84d5('0xb'),'ContactId']);_0x3ad8fc[_0x84d5('0xa')]=_0x84d5('0x49');_0x56ad44=as[_0x84d5('0x3b')](_0x1940d3,_0x123f78[_0x84d5('0x3c')],_0x3ad8fc);_0x4e5677['contact'][_0x488d25](_0x56ad44[_0x84d5('0x3e')],_0x56ad44['value'][_0x84d5('0x4a')],_0x56ad44[_0x84d5('0x3f')][_0x84d5('0x40')]);}break;case _0x84d5('0x4b'):var _0x808fbc=_0x3ad8fc['value']['split'](',')[_0x84d5('0x16')](function(_0x1a2505){return Number(_0x1a2505);});var _0x4a2056=parseTagParameter(_0x808fbc);_0x4e5677[_0x84d5('0x4c')][_0x84d5('0x4d')]['and'](_0x4a2056);_0x4e5677['tags'][_0x84d5('0x4e')]=_0x808fbc;break;case'User':if(_0x3ad8fc[_0x84d5('0x4f')]===_0x84d5('0x45')){_0x4e5677[_0x84d5('0x50')][_0x488d25](_0x84d5('0x51'),'%'+_0x3ad8fc['value']+'%',null);}else{_0x123f78=_[_0x84d5('0x3a')](_0x30a3d6,[_0x84d5('0xb'),_0x84d5('0x52')]);_0x3ad8fc[_0x84d5('0xa')]='UserId';_0x56ad44=as[_0x84d5('0x3b')](_0x1940d3,_0x123f78[_0x84d5('0x3c')],_0x3ad8fc);_0x4e5677['user'][_0x488d25](_0x56ad44[_0x84d5('0x3e')],_0x56ad44[_0x84d5('0x3f')][_0x84d5('0x4a')],_0x56ad44['value']['end']);}break;case _0x84d5('0x53'):case _0x84d5('0x54'):_0x56ad44=as['buildExpression']('me',null,_0x3ad8fc);_0x4e5677[_0x84d5('0x53')][_0x488d25](_0x56ad44[_0x84d5('0x3e')],_0x56ad44['value']['start'],_0x56ad44[_0x84d5('0x3f')][_0x84d5('0x40')]);break;}}}return _0x4e5677;}function parseModelFields(_0x511714,_0x3fec12,_0x97d4ad){var _0x33ad60=utils[_0x84d5('0x18')](_0x511714);var _0x3c9b1d=squel[_0x84d5('0x25')]();var _0x529c18=_(_0x3fec12)[_0x84d5('0x55')]()['map'](function(_0x510b32){return _[_0x84d5('0x56')](_0x97d4ad,['name',_0x510b32])?_0x510b32:undefined;})[_0x84d5('0x57')]()[_0x84d5('0x3f')]();if(_0x529c18[_0x84d5('0x58')]>0x0){_0x529c18[_0x84d5('0x26')](function(_0x520dbd){if(_0x520dbd===_0x33ad60){_0x3c9b1d[_0x84d5('0x43')]('i.'+_0x33ad60+_0x84d5('0x15'),[][_0x84d5('0x59')](_0x3fec12[_0x520dbd]));}else if(_0x520dbd===_0x84d5('0x5a')){var _0xf03ef6=JSON[_0x84d5('0x5b')](_0x3fec12[_0x520dbd])[_0x84d5('0x5c')];var _0x3e75a2=JSON[_0x84d5('0x5b')](_0x3fec12[_0x520dbd])[_0x84d5('0x5d')];_0x3c9b1d['and']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0xf03ef6,_0x3e75a2);}else{if(_0x3fec12[_0x520dbd]===_0x84d5('0x5e')){_0x3c9b1d['and']('i.'+_0x520dbd+_0x84d5('0x5f'));}else{_0x3c9b1d['and']('i.'+_0x520dbd+_0x84d5('0x60'),_0x3fec12[_0x520dbd]);}}});}return _0x3c9b1d;}function parseQueryParameters(_0x287fb2,_0x3fd904,_0x25c77a){var _0x97f94b=getSqlClauses();return Promise['resolve']()[_0x84d5('0x61')](function(){return parseModelFields(_0x287fb2,_0x3fd904,_0x25c77a);})[_0x84d5('0x61')](function(_0x5d528d){_0x97f94b[_0x84d5('0x62')][_0x84d5('0x43')](_0x5d528d);return parseReadParameter(_0x3fd904[_0x84d5('0x42')]);})[_0x84d5('0x61')](function(_0x48c8a4){_0x97f94b[_0x84d5('0x42')][_0x84d5('0x43')](_0x48c8a4);return parseTagParameter(_0x3fd904[_0x84d5('0x63')]);})[_0x84d5('0x61')](function(_0x393017){_0x97f94b[_0x84d5('0x4c')][_0x84d5('0x4d')][_0x84d5('0x43')](_0x393017);return parseSearchFilter(_0x287fb2,_0x3fd904[_0x84d5('0x64')]);})[_0x84d5('0x61')](function(_0x188e7a){_0x97f94b[_0x84d5('0x64')]=_0x188e7a;return _0x97f94b;});}function checkAccountsRestrictions(_0x5c132c,_0x2bc811,_0x4773e2){var _0x5c067a=utils[_0x84d5('0x18')](_0x5c132c);var _0x1a04b2='get'+_[_0x84d5('0x65')](_0x5c132c)+(_0x5c132c===_0x84d5('0x66')?_0x84d5('0x67'):_0x84d5('0x68'));var _0x2a5719=squel[_0x84d5('0x25')]();return Promise[_0x84d5('0x69')]()[_0x84d5('0x61')](function(){if(_0x4773e2['search']&&_0x2bc811['role']===_0x84d5('0x7')){return _0x2bc811[_0x1a04b2]({'attributes':['id'],'raw':!![]});}})['then'](function(_0x5b697a){if(_0x5b697a){if(_0x5b697a[_0x84d5('0x58')]===0x0){_0x2a5719[_0x84d5('0x43')]('i.'+_0x5c067a+_0x84d5('0x5f'));}else{_0x2a5719['and']('i.'+_0x5c067a+_0x84d5('0x15'),_[_0x84d5('0x16')](_0x5b697a,'id'));}}else if(!_0x4773e2[_0x5c067a]){_0x2a5719[_0x84d5('0x43')]('i.'+_0x5c067a+_0x84d5('0x6a'));}})[_0x84d5('0x61')](function(){return _0x2a5719;});}function getClosedOrderClause(_0x559449,_0x4797bb){var _0x14270a='';var _0x11daf7=[_0x84d5('0x6b'),'i.secondDisposition',_0x84d5('0x6c')];if(_0x559449===_0x84d5('0x31')){_0x11daf7[_0x84d5('0x6d')](_0x84d5('0x6e'));}if(_0x4797bb[_0x84d5('0x6f')]==='0'&&_0x559449===_0x84d5('0x31')){_0x14270a='i.substatus';}else{if(_0x4797bb[_0x84d5('0x6f')]==='1'){_0x11daf7[_0x84d5('0x70')]();}_0x14270a='CONCAT_WS(\x27\x27,\x20'+_0x11daf7[_0x84d5('0x71')](',\x20')+')';}return _0x14270a;}function getFilteredInteractions(_0x17cba3,_0x5f4290,_0x1ae940,_0x2c3aba){var _0x4c03ee=utils[_0x84d5('0xe')](_0x17cba3);var _0x6d4571=_[_0x84d5('0x65')](_0x17cba3)+_0x84d5('0x72');var _0x4f229e=[];var _0x448ab4=getTagsQuery();var _0x4e94d3={'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]};var _0x33ef5d=[];var _0x4351eb=[];return db[_0x84d5('0x73')][_0x84d5('0x74')](_0x448ab4[_0x84d5('0x75')](),_0x4e94d3)[_0x84d5('0x61')](function(_0x1d83f7){_0x4f229e=_[_0x84d5('0x76')](_0x1d83f7,'id');_0x4e94d3=_[_0x84d5('0x77')](_0x4e94d3,{'model':db[_0x6d4571],'mapToModel':!![],'nest':!![]});if(_0x1ae940[_0x84d5('0x62')]){_0x2c3aba[_0x84d5('0x78')][_0x84d5('0x26')](function(_0x384ded){_0x5f4290[_0x84d5('0xa')]('i.'+_0x384ded);});}else{_0x5f4290['field'](_0x84d5('0x79'),_0x84d5('0x41'));_0x5f4290[_0x84d5('0xa')](_0x84d5('0x7a'),_0x84d5('0x7b'));_0x5f4290['field'](_0x84d5('0x7c'),_0x84d5('0x7d'));if(_0x17cba3===_0x84d5('0x31')){_0x5f4290[_0x84d5('0xa')](_0x84d5('0x7e'),_0x84d5('0x7f'));_0x5f4290[_0x84d5('0xa')](_0x84d5('0x80'),'contactName');_0x5f4290[_0x84d5('0xa')](_0x84d5('0x81'));_0x5f4290[_0x84d5('0xa')]('i.createdAt');_0x5f4290[_0x84d5('0xa')](_0x84d5('0x82'));_0x5f4290['field'](_0x84d5('0x83'));_0x5f4290[_0x84d5('0xa')](_0x84d5('0x84'));_0x5f4290['field'](_0x84d5('0x85'));_0x5f4290[_0x84d5('0xa')](_0x84d5('0x86'));_0x5f4290[_0x84d5('0xa')](_0x84d5('0x87'));_0x5f4290[_0x84d5('0xa')](_0x84d5('0x88'));_0x5f4290['field']('i.disposition');_0x5f4290[_0x84d5('0xa')](_0x84d5('0x89'));_0x5f4290[_0x84d5('0xa')](_0x84d5('0x6b'));_0x5f4290['field'](_0x84d5('0x6e'));_0x5f4290[_0x84d5('0xa')]('i.to');_0x5f4290['field'](_0x84d5('0x8a'));_0x5f4290[_0x84d5('0xa')](_0x84d5('0x8b'));_0x5f4290[_0x84d5('0xa')](_0x84d5('0x8c'));}else if(_0x17cba3===_0x84d5('0x2f')){_0x5f4290[_0x84d5('0xa')](_0x84d5('0x8d'),_0x84d5('0x8e'));}else{_0x5f4290[_0x84d5('0xa')](_0x84d5('0x8f'),_0x84d5('0x8e'));}if(_0x17cba3!==_0x84d5('0x31')){_0x5f4290[_0x84d5('0xa')](_0x84d5('0x90'));}_0x5f4290[_0x84d5('0xa')](_0x84d5('0x91'),_0x84d5('0x92'));_0x5f4290[_0x84d5('0xa')](_0x84d5('0x93'),_0x84d5('0x94'));_0x5f4290[_0x84d5('0xa')](_0x84d5('0x95'),_0x84d5('0x96'));_0x5f4290[_0x84d5('0xa')](_0x84d5('0x97'),_0x84d5('0x98'));_0x5f4290['field']('c.mobile',_0x84d5('0x99'));_0x5f4290[_0x84d5('0xa')](_0x84d5('0x9a'),_0x84d5('0x9b'));_0x5f4290[_0x84d5('0xa')](_0x84d5('0x9c'),_0x84d5('0x9d'));_0x5f4290[_0x84d5('0xa')](_0x84d5('0x9e'),_0x84d5('0x9f'));_0x5f4290['field'](_0x84d5('0xa0'),_0x84d5('0xa1'));}if(_0x2c3aba[_0x84d5('0xa2')]){_0x5f4290[_0x84d5('0xa2')](_0x2c3aba[_0x84d5('0xa2')]);}if(_0x2c3aba[_0x84d5('0xa3')]){_0x5f4290[_0x84d5('0xa3')](_0x2c3aba[_0x84d5('0xa3')]);}return db[_0x84d5('0x73')]['query'](_0x5f4290['toString'](),_0x4e94d3);})['then'](function(_0x18d53b){_0x33ef5d=_0x18d53b;var _0x816b55=getUsersQuery(_0x17cba3,_0x33ef5d);return db[_0x84d5('0x73')][_0x84d5('0x74')](_0x816b55[_0x84d5('0x75')](),_0x4e94d3);})['then'](function(_0x5c5597){_0x4351eb=_[_0x84d5('0xa4')](_0x5c5597,_0x4c03ee);if(_0x17cba3===_0x84d5('0x31')){return db[_0x84d5('0xa5')]['findOne']({'attributes':['enableEmailPreview'],'raw':!![]});}})[_0x84d5('0x61')](function(_0x5783cb){var _0x455570=_0x5783cb?_0x5783cb[_0x84d5('0xa6')]:undefined;var _0x74c49e=_0x33ef5d['map'](function(_0x343d33){return updateInteraction(_0x343d33,_0x4f229e,_0x4351eb,_0x455570);});return Promise[_0x84d5('0xa7')](_0x74c49e);});}function countFilteredInteractions(_0x299391,_0x1251fa){var _0x386868=_0x299391['clone']();_0x386868[_0x84d5('0xa')](_0x84d5('0xa8'));_0x386868[_0x84d5('0xa')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');var _0x253b0d=utils['getSelectedTags'](_0x1251fa);if(!_[_0x84d5('0xa9')](_0x253b0d)){_0x386868[_0x84d5('0xaa')](_0x84d5('0xab'),_0x253b0d);}var _0x381761={'type':db[_0x84d5('0xac')][_0x84d5('0xad')]['SELECT'],'raw':!![]};return db[_0x84d5('0x73')][_0x84d5('0x74')](_0x386868[_0x84d5('0x75')](),_0x381761);}module[_0x84d5('0xae')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file diff --git a/server/components/interaction/update-interaction.js b/server/components/interaction/update-interaction.js index bdd49fb..3cb152a 100644 --- a/server/components/interaction/update-interaction.js +++ b/server/components/interaction/update-interaction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe9e5=['closed','disposition','abandoned','UserId','total','findOne','plainBody','-id','then','lastMsgText','trimStart','catch','updateInteraction','TagIds','Tags','fullname','split','push','waiting','talking','answered','unmanaged'];(function(_0x23e1f6,_0x1e3755){var _0x499b32=function(_0x20728f){while(--_0x20728f){_0x23e1f6['push'](_0x23e1f6['shift']());}};_0x499b32(++_0x1e3755);}(_0xe9e5,0x93));var _0x5e9e=function(_0x59f977,_0x43a7c2){_0x59f977=_0x59f977-0x0;var _0x372f8a=_0xe9e5[_0x59f977];return _0x372f8a;};'use strict';var _=require('lodash');var db=require('../../mysqldb')['db'];function getInteractionUsers(_0x21aec1,_0x16212d){return new Promise(function(_0x3ad2c4,_0x886e06){try{var _0x3d34a9=[];if(_0x16212d[_0x21aec1]){_0x3d34a9=_0x16212d[_0x21aec1]['map'](function(_0x2d9dbc){return{'id':_0x2d9dbc['id'],'fullname':_0x2d9dbc[_0x5e9e('0x0')]};});}return _0x3ad2c4(_0x3d34a9);}catch(_0x4d1c52){_0x886e06(_0x4d1c52);}});}function getInteractionTags(_0x1dbee7,_0x1e563a){var _0x5d7190=[];if(_0x1dbee7){_0x1dbee7[_0x5e9e('0x1')](',')['forEach'](function(_0x3cf7fc){_0x5d7190[_0x5e9e('0x2')](_0x1e563a[_0x3cf7fc]);});}return _0x5d7190;}function updateWaitingCounter(_0x30351c){if(_0x30351c[_0x5e9e('0x3')]){_0x30351c['waiting']-=0x1;}}function updateInteractionCounters(_0x2f4175){_0x2f4175[_0x5e9e('0x3')]=0x0;_0x2f4175[_0x5e9e('0x4')]=0x0;_0x2f4175[_0x5e9e('0x5')]=0x0;_0x2f4175[_0x5e9e('0x6')]=0x0;_0x2f4175['abandoned']=0x0;_0x2f4175['total']=0x0;if(_0x2f4175[_0x5e9e('0x7')]){if(_0x2f4175[_0x5e9e('0x8')]===_0x5e9e('0x9')){_0x2f4175[_0x5e9e('0x9')]+=0x1;updateWaitingCounter(_0x2f4175);}if(_0x2f4175[_0x5e9e('0xa')]){_0x2f4175['answered']+=0x1;if(_0x2f4175['talking']){_0x2f4175['talking']-=0x1;}}else{if(_0x2f4175[_0x5e9e('0x8')]){_0x2f4175['unmanaged']+=0x1;updateWaitingCounter(_0x2f4175);}}}else{if(!_0x2f4175[_0x5e9e('0xa')]){_0x2f4175[_0x5e9e('0x3')]+=0x1;}if(_0x2f4175[_0x5e9e('0xa')]){_0x2f4175[_0x5e9e('0x4')]+=0x1;updateWaitingCounter(_0x2f4175);}}_0x2f4175[_0x5e9e('0xb')]+=0x1;return _0x2f4175;}function getLastMessageText(_0x4aa8f0){return db['MailMessage'][_0x5e9e('0xc')]({'where':{'$and':[{'MailInteractionId':_0x4aa8f0['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':'out'},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x5e9e('0xd')],'order':_0x5e9e('0xe'),'raw':!![]})[_0x5e9e('0xf')](function(_0x23c8ca){if(_0x23c8ca&&_0x23c8ca[_0x5e9e('0xd')]){_0x4aa8f0[_0x5e9e('0x10')]=_[_0x5e9e('0x11')](_0x23c8ca[_0x5e9e('0xd')]);}return _0x4aa8f0;})[_0x5e9e('0x12')](function(_0x5064db){throw _0x5064db;});}exports[_0x5e9e('0x13')]=function(_0x46b9e9,_0x5091f3,_0x41b609,_0x2f2049){return new Promise(function(_0x468548,_0x214b35){return getInteractionUsers(_0x46b9e9['id'],_0x41b609)[_0x5e9e('0xf')](function(_0x3063c4){_0x46b9e9['Users']=_0x3063c4;return getInteractionTags(_0x46b9e9[_0x5e9e('0x14')],_0x5091f3);})[_0x5e9e('0xf')](function(_0x21078a){_0x46b9e9[_0x5e9e('0x15')]=_0x21078a;delete _0x46b9e9['TagIds'];return updateInteractionCounters(_0x46b9e9);})[_0x5e9e('0xf')](function(_0x204b71){if(_0x2f2049){return getLastMessageText(_0x204b71);}else{return _0x204b71;}})[_0x5e9e('0xf')](function(_0x449108){_0x468548(_0x449108);})[_0x5e9e('0x12')](function(_0x23d708){_0x214b35(_0x23d708);});});}; \ No newline at end of file +var _0xf3ad=['closed','disposition','UserId','total','MailMessage','out','plainBody','lastMsgText','catch','updateInteraction','then','Users','TagIds','Tags','lodash','../../mysqldb','map','fullname','split','push','waiting','talking','answered','unmanaged','abandoned'];(function(_0x476c0d,_0x590d92){var _0x2f9b7e=function(_0xf45282){while(--_0xf45282){_0x476c0d['push'](_0x476c0d['shift']());}};_0x2f9b7e(++_0x590d92);}(_0xf3ad,0x153));var _0xdf3a=function(_0x1236a7,_0x5346ba){_0x1236a7=_0x1236a7-0x0;var _0x18d594=_0xf3ad[_0x1236a7];return _0x18d594;};'use strict';var _=require(_0xdf3a('0x0'));var db=require(_0xdf3a('0x1'))['db'];function getInteractionUsers(_0x493c2d,_0x580abb){return new Promise(function(_0x36cead,_0x1bc383){try{var _0x438e7d=[];if(_0x580abb[_0x493c2d]){_0x438e7d=_0x580abb[_0x493c2d][_0xdf3a('0x2')](function(_0x344367){return{'id':_0x344367['id'],'fullname':_0x344367[_0xdf3a('0x3')]};});}return _0x36cead(_0x438e7d);}catch(_0xd45966){_0x1bc383(_0xd45966);}});}function getInteractionTags(_0xab806,_0x14d1f0){var _0x2eefbd=[];if(_0xab806){_0xab806[_0xdf3a('0x4')](',')['forEach'](function(_0x327d8c){_0x2eefbd[_0xdf3a('0x5')](_0x14d1f0[_0x327d8c]);});}return _0x2eefbd;}function updateWaitingCounter(_0xed024d){if(_0xed024d[_0xdf3a('0x6')]){_0xed024d[_0xdf3a('0x6')]-=0x1;}}function updateInteractionCounters(_0x5ce78d){_0x5ce78d[_0xdf3a('0x6')]=0x0;_0x5ce78d[_0xdf3a('0x7')]=0x0;_0x5ce78d[_0xdf3a('0x8')]=0x0;_0x5ce78d[_0xdf3a('0x9')]=0x0;_0x5ce78d[_0xdf3a('0xa')]=0x0;_0x5ce78d['total']=0x0;if(_0x5ce78d[_0xdf3a('0xb')]){if(_0x5ce78d[_0xdf3a('0xc')]===_0xdf3a('0xa')){_0x5ce78d['abandoned']+=0x1;updateWaitingCounter(_0x5ce78d);}if(_0x5ce78d[_0xdf3a('0xd')]){_0x5ce78d[_0xdf3a('0x8')]+=0x1;if(_0x5ce78d[_0xdf3a('0x7')]){_0x5ce78d[_0xdf3a('0x7')]-=0x1;}}else{if(_0x5ce78d[_0xdf3a('0xc')]){_0x5ce78d['unmanaged']+=0x1;updateWaitingCounter(_0x5ce78d);}}}else{if(!_0x5ce78d[_0xdf3a('0xd')]){_0x5ce78d['waiting']+=0x1;}if(_0x5ce78d['UserId']){_0x5ce78d['talking']+=0x1;updateWaitingCounter(_0x5ce78d);}}_0x5ce78d[_0xdf3a('0xe')]+=0x1;return _0x5ce78d;}function getLastMessageText(_0x1b6e10){return db[_0xdf3a('0xf')]['findOne']({'where':{'$and':[{'MailInteractionId':_0x1b6e10['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xdf3a('0x10')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xdf3a('0x11')],'order':'-id','raw':!![]})['then'](function(_0x52d8f4){if(_0x52d8f4&&_0x52d8f4['plainBody']){_0x1b6e10[_0xdf3a('0x12')]=_['trimStart'](_0x52d8f4[_0xdf3a('0x11')]);}return _0x1b6e10;})[_0xdf3a('0x13')](function(_0x136960){throw _0x136960;});}exports[_0xdf3a('0x14')]=function(_0x153697,_0x5d64a5,_0x16701c,_0x2ecdd0){return new Promise(function(_0x4bf7f2,_0x1ba810){return getInteractionUsers(_0x153697['id'],_0x16701c)[_0xdf3a('0x15')](function(_0x28a172){_0x153697[_0xdf3a('0x16')]=_0x28a172;return getInteractionTags(_0x153697[_0xdf3a('0x17')],_0x5d64a5);})[_0xdf3a('0x15')](function(_0x5a3f5e){_0x153697[_0xdf3a('0x18')]=_0x5a3f5e;delete _0x153697['TagIds'];return updateInteractionCounters(_0x153697);})[_0xdf3a('0x15')](function(_0x1a1d23){if(_0x2ecdd0){return getLastMessageText(_0x1a1d23);}else{return _0x1a1d23;}})[_0xdf3a('0x15')](function(_0x476528){_0x4bf7f2(_0x476528);})[_0xdf3a('0x13')](function(_0x180dd5){_0x1ba810(_0x180dd5);});});}; \ No newline at end of file diff --git a/server/components/interaction/utils.js b/server/components/interaction/utils.js index 25a191f..dfd5c90 100644 --- a/server/components/interaction/utils.js +++ b/server/components/interaction/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0a82=['exports','lodash','../../mysqldb','openchannel-interactions','../../config/logger','mail-interactions','fax-interactions','sms-interactions','chat-interactions','chat','Website','Account','capitalize','InteractionId','upperFirst','websites','_interaction_has_tags','_interactions','isArray','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','role','stringify','null','findOne','then','update','info','catch','error'];(function(_0xc7d2c5,_0x69445){var _0x49b40d=function(_0x6aaaec){while(--_0x6aaaec){_0xc7d2c5['push'](_0xc7d2c5['shift']());}};_0x49b40d(++_0x69445);}(_0x0a82,0x137));var _0x20a8=function(_0x378a69,_0x2d143c){_0x378a69=_0x378a69-0x0;var _0x4d186d=_0x0a82[_0x378a69];return _0x4d186d;};'use strict';var _=require(_0x20a8('0x0'));var db=require(_0x20a8('0x1'))['db'];var loggers={'openchannel':require('../../config/logger')(_0x20a8('0x2')),'mail':require(_0x20a8('0x3'))(_0x20a8('0x4')),'fax':require(_0x20a8('0x3'))(_0x20a8('0x5')),'sms':require(_0x20a8('0x3'))(_0x20a8('0x6')),'chat':require(_0x20a8('0x3'))(_0x20a8('0x7')),'whatsapp':require(_0x20a8('0x3'))('whatsapp-interactions')};function getAccountFK(_0x5a8f47){return _['capitalize'](_0x5a8f47)+(_0x5a8f47===_0x20a8('0x8')?_0x20a8('0x9'):_0x20a8('0xa'))+'Id';}function getInteractionFK(_0x42f37b){return _[_0x20a8('0xb')](_0x42f37b)+_0x20a8('0xc');}function getInteractionId(_0x5d41e4,_0x96d9f3,_0x3a9254){if(_0x5d41e4&&_0x5d41e4[_[_0x20a8('0xd')](_0x3a9254)+_0x20a8('0xc')]){return _0x5d41e4[_[_0x20a8('0xd')](_0x3a9254)+_0x20a8('0xc')];}else if(_0x5d41e4&&_0x5d41e4['id']){return _0x5d41e4['id'];}else if(_0x96d9f3&&_0x96d9f3['id']){return _0x96d9f3['id'];}else{return'unknown';}}function getInteractionsTables(_0x3719ac){return{'accounts':_0x3719ac+'_'+(_0x3719ac===_0x20a8('0x8')?_0x20a8('0xe'):'accounts'),'interactions':_0x3719ac+'_interactions','interactionsTags':_0x3719ac+_0x20a8('0xf'),'messages':_0x3719ac+'_messages','userInteractions':'user_has_'+_0x3719ac+_0x20a8('0x10')};}function getSelectedTags(_0x3209ac){var _0x1e0b31=[];if(_0x3209ac){_0x1e0b31=Array[_0x20a8('0x11')](_0x3209ac)?_0x3209ac:[_0x3209ac];}return _0x1e0b31;}function log(_0x10f011,_0xad0933,_0x3b03a7,_0x399cbd,_0x51afd7,_0x2172ee){loggers[_0x51afd7[_0x20a8('0x12')]()][_0x10f011](_0x20a8('0x13'),_0x2172ee[_0x20a8('0x14')](),_0xad0933?_0xad0933['id']:null,_0xad0933?_0xad0933['name']:null,_0xad0933?_0xad0933[_0x20a8('0x15')]:null,getInteractionId(_0x3b03a7,_0x399cbd,_0x51afd7),_0x3b03a7?JSON[_0x20a8('0x16')](_0x3b03a7):_0x20a8('0x17'));}function updateUser(_0x42c8b6,_0x497c96,_0x31e7a7,_0x391dc5,_0x58def3){db[_['upperFirst'](_0x391dc5)+'Interaction'][_0x20a8('0x18')]({'where':{'id':getInteractionId(_0x497c96,_0x31e7a7,_0x391dc5)}})[_0x20a8('0x19')](function(_0x476195){if(_0x476195){return _0x476195[_0x20a8('0x1a')]({'UserId':_0x42c8b6?_0x42c8b6['id']:null});}})[_0x20a8('0x19')](function(_0x2220de){if(_0x2220de){log(_0x20a8('0x1b'),_0x42c8b6,_0x497c96,_0x31e7a7,_0x391dc5,_0x58def3);}})[_0x20a8('0x1c')](function(){log(_0x20a8('0x1d'),_0x42c8b6,_0x497c96,_0x31e7a7,_0x391dc5,_0x58def3);});}module[_0x20a8('0x1e')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file +var _0x372b=['_messages','user_has_','isArray','toLowerCase','toUpperCase','name','role','null','Interaction','then','update','info','catch','error','exports','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','chat','Website','InteractionId','unknown','accounts','_interactions','_interaction_has_tags'];(function(_0x1da10a,_0x1fe948){var _0x5aea64=function(_0x1fa637){while(--_0x1fa637){_0x1da10a['push'](_0x1da10a['shift']());}};_0x5aea64(++_0x1fe948);}(_0x372b,0xc9));var _0xb372=function(_0x4748f0,_0xd13a77){_0x4748f0=_0x4748f0-0x0;var _0x431985=_0x372b[_0x4748f0];return _0x431985;};'use strict';var _=require(_0xb372('0x0'));var db=require(_0xb372('0x1'))['db'];var loggers={'openchannel':require(_0xb372('0x2'))(_0xb372('0x3')),'mail':require('../../config/logger')(_0xb372('0x4')),'fax':require(_0xb372('0x2'))(_0xb372('0x5')),'sms':require(_0xb372('0x2'))(_0xb372('0x6')),'chat':require(_0xb372('0x2'))(_0xb372('0x7')),'whatsapp':require(_0xb372('0x2'))(_0xb372('0x8'))};function getAccountFK(_0x17703f){return _['capitalize'](_0x17703f)+(_0x17703f===_0xb372('0x9')?_0xb372('0xa'):'Account')+'Id';}function getInteractionFK(_0x547328){return _['capitalize'](_0x547328)+_0xb372('0xb');}function getInteractionId(_0x5610d0,_0x17a913,_0x220a16){if(_0x5610d0&&_0x5610d0[_['upperFirst'](_0x220a16)+_0xb372('0xb')]){return _0x5610d0[_['upperFirst'](_0x220a16)+'InteractionId'];}else if(_0x5610d0&&_0x5610d0['id']){return _0x5610d0['id'];}else if(_0x17a913&&_0x17a913['id']){return _0x17a913['id'];}else{return _0xb372('0xc');}}function getInteractionsTables(_0x4f0914){return{'accounts':_0x4f0914+'_'+(_0x4f0914===_0xb372('0x9')?'websites':_0xb372('0xd')),'interactions':_0x4f0914+_0xb372('0xe'),'interactionsTags':_0x4f0914+_0xb372('0xf'),'messages':_0x4f0914+_0xb372('0x10'),'userInteractions':_0xb372('0x11')+_0x4f0914+_0xb372('0xe')};}function getSelectedTags(_0x309a3d){var _0x55ae5d=[];if(_0x309a3d){_0x55ae5d=Array[_0xb372('0x12')](_0x309a3d)?_0x309a3d:[_0x309a3d];}return _0x55ae5d;}function log(_0x39b998,_0x62987e,_0x4341ff,_0x1d6030,_0x33f1f7,_0x10ef31){loggers[_0x33f1f7[_0xb372('0x13')]()][_0x39b998]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x10ef31[_0xb372('0x14')](),_0x62987e?_0x62987e['id']:null,_0x62987e?_0x62987e[_0xb372('0x15')]:null,_0x62987e?_0x62987e[_0xb372('0x16')]:null,getInteractionId(_0x4341ff,_0x1d6030,_0x33f1f7),_0x4341ff?JSON['stringify'](_0x4341ff):_0xb372('0x17'));}function updateUser(_0xe63bfa,_0x5a44e9,_0x22faf6,_0x3473b7,_0x272a18){db[_['upperFirst'](_0x3473b7)+_0xb372('0x18')]['findOne']({'where':{'id':getInteractionId(_0x5a44e9,_0x22faf6,_0x3473b7)}})[_0xb372('0x19')](function(_0x3f8a69){if(_0x3f8a69){return _0x3f8a69[_0xb372('0x1a')]({'UserId':_0xe63bfa?_0xe63bfa['id']:null});}})['then'](function(_0x49ef00){if(_0x49ef00){log(_0xb372('0x1b'),_0xe63bfa,_0x5a44e9,_0x22faf6,_0x3473b7,_0x272a18);}})[_0xb372('0x1c')](function(){log(_0xb372('0x1d'),_0xe63bfa,_0x5a44e9,_0x22faf6,_0x3473b7,_0x272a18);});}module[_0xb372('0x1e')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 03d9643..aadf103 100644 --- a/server/components/license/service.js +++ b/server/components/license/service.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1563=['utf8','final','parse','hasOwnProperty','use','License','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin','util','composable-middleware','../../mysqldb','license','data1','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update'];(function(_0x28bb72,_0x4ae15e){var _0x3a7ecb=function(_0x11022b){while(--_0x11022b){_0x28bb72['push'](_0x28bb72['shift']());}};_0x3a7ecb(++_0x4ae15e);}(_0x1563,0x97));var _0x3156=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x1563[_0x413feb];return _0x40ee88;};'use strict';var crypto=require('crypto');var util=require(_0x3156('0x0'));var compose=require(_0x3156('0x1'));var db=require(_0x3156('0x2'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0xfd0745,_0x113f0b){if(_0xfd0745&&_0x113f0b){if(_0x113f0b['data1']&&_0x113f0b[_0x3156('0x3')]){var _0x491457=_0x113f0b[_0x3156('0x4')];var _0xdf10e5=_0x113f0b[_0x3156('0x3')];var _0x3bc9de=_0x491457[_0x3156('0x5')]('-')[0x4];var _0x34bac6=_0x491457[_0x3156('0x5')]('-')[0x0];var _0x51590e=crypto[_0x3156('0x6')](_0x3156('0x7'),util[_0x3156('0x8')](_0x3156('0x9'),_0x3bc9de,_0x491457,_0x34bac6));var _0x1eb060=_0x51590e[_0x3156('0xa')](_0xdf10e5,'base64',_0x3156('0xb'));_0x1eb060+=_0x51590e[_0x3156('0xc')](_0x3156('0xb'));var _0x9784dd=JSON[_0x3156('0xd')](_0x1eb060);return _0x9784dd[_0x3156('0xe')](_0xfd0745)?_0x9784dd[_0xfd0745]:null;}}return null;}function isLimit(_0x4082f0,_0x5674a8,_0x43c576,_0x5f1939){var _0x3d15c2=_0x5674a8;return compose()[_0x3156('0xf')](function(_0x1a94f7,_0x4ee384,_0x45980e){return db[_0x3156('0x10')][_0x3156('0x11')]({'where':{'id':0x1},'raw':!![]})[_0x3156('0x12')](function(_0xfa9dd3){var _0x59e5c0=getValueFromLicense(_0x4082f0,_0xfa9dd3);return _0x59e5c0?_0x59e5c0:_0x3d15c2;})[_0x3156('0x12')](function(_0x530917){_0x3d15c2=_0x530917;return _0x43c576[_0x3156('0x13')](_0x5f1939);})[_0x3156('0x12')](function(_0x2c8c83){if(_0x2c8c83>=_0x3d15c2){return _0x4ee384[_0x3156('0x14')](0x193)[_0x3156('0x15')]({'message':util[_0x3156('0x8')](_0x3156('0x16'),_0x4082f0)});}_0x45980e();})[_0x3156('0x17')](function(_0x377a75){_0x45980e(_0x377a75);});});}function isUserLimit(){return isLimit(_0x3156('0x18'),0x1,db[_0x3156('0x19')],{'where':{'$or':[{'role':_0x3156('0x1a')},{'role':'user'}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file +var _0xf85b=['createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','final','use','License','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','User','admin','user','composable-middleware','../../mysqldb','../../config/environment','license','data1','split'];(function(_0x185c5e,_0x1b05f5){var _0x14053a=function(_0xd55b4){while(--_0xd55b4){_0x185c5e['push'](_0x185c5e['shift']());}};_0x14053a(++_0x1b05f5);}(_0xf85b,0x158));var _0xbf85=function(_0x594cd6,_0x24f16e){_0x594cd6=_0x594cd6-0x0;var _0x4cf17b=_0xf85b[_0x594cd6];return _0x4cf17b;};'use strict';var crypto=require('crypto');var util=require('util');var compose=require(_0xbf85('0x0'));var db=require(_0xbf85('0x1'))['db'];var config=require(_0xbf85('0x2'));function getValueFromLicense(_0x498a70,_0xef5830){if(_0x498a70&&_0xef5830){if(_0xef5830['data1']&&_0xef5830[_0xbf85('0x3')]){var _0xee90ca=_0xef5830[_0xbf85('0x4')];var _0x21fc07=_0xef5830[_0xbf85('0x3')];var _0x5a3f2a=_0xee90ca[_0xbf85('0x5')]('-')[0x4];var _0xa4d88c=_0xee90ca['split']('-')[0x0];var _0x429ace=crypto[_0xbf85('0x6')](_0xbf85('0x7'),util[_0xbf85('0x8')](_0xbf85('0x9'),_0x5a3f2a,_0xee90ca,_0xa4d88c));var _0x389fe7=_0x429ace[_0xbf85('0xa')](_0x21fc07,_0xbf85('0xb'),_0xbf85('0xc'));_0x389fe7+=_0x429ace[_0xbf85('0xd')]('utf8');var _0x2d35e1=JSON['parse'](_0x389fe7);return _0x2d35e1['hasOwnProperty'](_0x498a70)?_0x2d35e1[_0x498a70]:null;}}return null;}function isLimit(_0x31e177,_0x59cc55,_0x5221c2,_0x45ac14){var _0x467637=_0x59cc55;return compose()[_0xbf85('0xe')](function(_0x11a2c1,_0x45450a,_0x1e8a14){return db[_0xbf85('0xf')][_0xbf85('0x10')]({'where':{'id':0x1},'raw':!![]})[_0xbf85('0x11')](function(_0x4c386a){var _0x30deb1=getValueFromLicense(_0x31e177,_0x4c386a);return _0x30deb1?_0x30deb1:_0x467637;})[_0xbf85('0x11')](function(_0x4ba478){_0x467637=_0x4ba478;return _0x5221c2[_0xbf85('0x12')](_0x45ac14);})[_0xbf85('0x11')](function(_0x400360){if(_0x400360>=_0x467637){return _0x45450a[_0xbf85('0x13')](0x193)[_0xbf85('0x14')]({'message':util[_0xbf85('0x8')](_0xbf85('0x15'),_0x31e177)});}_0x1e8a14();})['catch'](function(_0x1de009){_0x1e8a14(_0x1de009);});});}function isUserLimit(){return isLimit('users',0x1,db[_0xbf85('0x16')],{'where':{'$or':[{'role':_0xbf85('0x17')},{'role':_0xbf85('0x18')}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index f98d7f5..9995fb1 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 _0x3e8c=['format','YYYY-MM-DD','castTo','text','CAST(','\x20AS\x20','field','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','<\x20?','>\x20?','$gte','BETWEEN\x20?\x20AND\x20?','start','DATE','utcOffset','hours','minutes','seconds','lodash','moment','parseSearch','sqlOperator','startsWith','[$or]','replace','[$and]','length','split','slice','forEach','shift','match','filter','indexOf','map','conditions','buildExpression','$eq','$between','value','includes','$gt','$lte','operator','add','days'];(function(_0x531c55,_0x3f5d48){var _0x2968f9=function(_0x18f09a){while(--_0x18f09a){_0x531c55['push'](_0x531c55['shift']());}};_0x2968f9(++_0x3f5d48);}(_0x3e8c,0xc4));var _0xc3e8=function(_0x5d8de5,_0x259358){_0x5d8de5=_0x5d8de5-0x0;var _0xf48fe9=_0x3e8c[_0x5d8de5];return _0xf48fe9;};'use strict';var _=require(_0xc3e8('0x0'));var moment=require(_0xc3e8('0x1'));exports[_0xc3e8('0x2')]=function(_0x595863){var _0x27767e={'conditions':[]};_0x27767e[_0xc3e8('0x3')]=_[_0xc3e8('0x4')](_0x595863,_0xc3e8('0x5'))?'or':'and';var _0x7777f2=_0x595863[_0xc3e8('0x6')](_0xc3e8('0x7'),'')['replace'](_0xc3e8('0x5'),'')['split']('||');for(var _0x5a8f9b=0x0;_0x5a8f9b<_0x7777f2[_0xc3e8('0x8')];_0x5a8f9b++){var _0x206249=_0x7777f2[_0x5a8f9b][_0xc3e8('0x9')](':=');var _0x4fa648=_0x206249[0x0];var _0x193e7c=_0x206249[_0xc3e8('0xa')](0x1);_0x193e7c[_0xc3e8('0xb')](function(_0x1505b1){var _0x31fc17=_0x1505b1[_0xc3e8('0x9')]('[')[_0xc3e8('0xc')]();var _0x360e9a=_0x1505b1[_0xc3e8('0xd')](/\[(.*?)\]/g);_0x360e9a[_0xc3e8('0xb')](function(_0x27af2e){var _0x13e1a6=_0x27af2e[_0xc3e8('0x9')]('[')[_0xc3e8('0xe')](function(_0x216992){return _0x216992[_0xc3e8('0xf')](']')>-0x1;})[_0xc3e8('0x10')](function(_0x1e5469){return _0x1e5469[_0xc3e8('0x9')](']')[0x0];})[0x0];_0x27767e[_0xc3e8('0x11')]['push']({'field':_0x4fa648,'operator':_0x31fc17,'value':_0x13e1a6});});});}return _0x27767e;};exports[_0xc3e8('0x12')]=function(_0x55ba4b,_0x45b3f4,_0xb8bef3){var _0x5c1b6e={};if(_0x45b3f4==='DATE'){if(_0xb8bef3['operator']===_0xc3e8('0x13')){_0xb8bef3['operator']=_0xc3e8('0x14');_0xb8bef3[_0xc3e8('0x15')]+=','+_0xb8bef3[_0xc3e8('0x15')];}else if(_[_0xc3e8('0x16')]([_0xc3e8('0x17'),_0xc3e8('0x18')],_0xb8bef3[_0xc3e8('0x19')])){_0xb8bef3[_0xc3e8('0x15')]=moment(_0xb8bef3[_0xc3e8('0x15')])[_0xc3e8('0x1a')](0x1,_0xc3e8('0x1b'))[_0xc3e8('0x1c')](_0xc3e8('0x1d'));}}if(_0xb8bef3[_0xc3e8('0x1e')]){_0x45b3f4=_0xb8bef3[_0xc3e8('0x1e')];_0x5c1b6e[_0xc3e8('0x1f')]=_0xc3e8('0x20')+_0x55ba4b+'.'+_0xb8bef3['field']+_0xc3e8('0x21')+_0xb8bef3[_0xc3e8('0x1e')]+')\x20'+parseOperator(_0xb8bef3[_0xc3e8('0x19')]);}else{_0x5c1b6e[_0xc3e8('0x1f')]=_0x55ba4b+'.'+_0xb8bef3[_0xc3e8('0x22')]+'\x20'+parseOperator(_0xb8bef3['operator']);}if(_[_0xc3e8('0x16')]([_0xc3e8('0x23'),_0xc3e8('0x24')],_0xb8bef3[_0xc3e8('0x19')]))_0x5c1b6e[_0xc3e8('0x1f')]='('+_0x5c1b6e[_0xc3e8('0x1f')]+_0xc3e8('0x25')+_0x55ba4b+'.'+_0xb8bef3[_0xc3e8('0x22')]+_0xc3e8('0x26');_0x5c1b6e[_0xc3e8('0x15')]=parseValue(_0x45b3f4,_0xb8bef3[_0xc3e8('0x19')],_0xb8bef3['value']);return _0x5c1b6e;};function parseOperator(_0x231978){var _0x18dc4c;switch(_0x231978){case _0xc3e8('0x27'):_0x18dc4c=_0xc3e8('0x28');break;case _0xc3e8('0x24'):_0x18dc4c='NOT\x20IN\x20?';break;case _0xc3e8('0x13'):_0x18dc4c='=\x20?';break;case _0xc3e8('0x23'):_0x18dc4c=_0xc3e8('0x29');break;case _0xc3e8('0x2a'):case _0xc3e8('0x2b'):case _0xc3e8('0x2c'):_0x18dc4c=_0xc3e8('0x2d');break;case'$lt':_0x18dc4c=_0xc3e8('0x2e');break;case'$gt':_0x18dc4c=_0xc3e8('0x2f');break;case'$lte':_0x18dc4c='<=\x20?';break;case _0xc3e8('0x30'):_0x18dc4c='>=\x20?';break;case _0xc3e8('0x14'):_0x18dc4c=_0xc3e8('0x31');break;}return _0x18dc4c;}function parseValue(_0x556962,_0x38cd34,_0x643cbe){var _0x23d89f={'start':undefined,'end':undefined};switch(_0x38cd34){case _0xc3e8('0x27'):case _0xc3e8('0x24'):_0x23d89f['start']=_0x643cbe[_0xc3e8('0x9')](',');break;case _0xc3e8('0x2a'):_0x23d89f[_0xc3e8('0x32')]='%'+_0x643cbe+'%';break;case _0xc3e8('0x2b'):_0x23d89f[_0xc3e8('0x32')]=_0x643cbe+'%';break;case _0xc3e8('0x2c'):_0x23d89f[_0xc3e8('0x32')]='%'+_0x643cbe;break;case _0xc3e8('0x14'):var _0x538c54=_0x643cbe[_0xc3e8('0x9')](',');var _0x643cbe=_0x538c54[_0xc3e8('0xc')]();var _0x3ba04d=_0x538c54['pop']();if(_0x556962===_0xc3e8('0x33')){_0x643cbe=moment(_0x643cbe)[_0xc3e8('0x34')](0x0,!![])['format']();_0x3ba04d=moment(_0x3ba04d)['utcOffset'](0x0,!![])['add'](0x17,_0xc3e8('0x35'))[_0xc3e8('0x1a')](0x3b,_0xc3e8('0x36'))['add'](0x3b,_0xc3e8('0x37'))['format']();}_0x23d89f={'start':_0x643cbe,'end':_0x3ba04d};break;default:_0x23d89f[_0xc3e8('0x32')]=_0x643cbe;break;}return _0x23d89f;} \ No newline at end of file +var _0x4ecc=['start','pop','utcOffset','seconds','lodash','sqlOperator','[$or]','and','[$and]','replace','split','length','slice','shift','match','forEach','filter','conditions','buildExpression','DATE','operator','$between','value','$gt','$lte','add','days','format','YYYY-MM-DD','castTo','text','field','\x20AS\x20','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','$eq','=\x20?','<>\x20?','$substring','$startsWith','LIKE\x20?','$lt','<\x20?','>\x20?','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','$endsWith'];(function(_0x387dec,_0x48ceb5){var _0xbc50ca=function(_0x10aeaf){while(--_0x10aeaf){_0x387dec['push'](_0x387dec['shift']());}};_0xbc50ca(++_0x48ceb5);}(_0x4ecc,0xdc));var _0xc4ec=function(_0xebc193,_0x5b819d){_0xebc193=_0xebc193-0x0;var _0x47cb45=_0x4ecc[_0xebc193];return _0x47cb45;};'use strict';var _=require(_0xc4ec('0x0'));var moment=require('moment');exports['parseSearch']=function(_0x3b5946){var _0x3dfbc4={'conditions':[]};_0x3dfbc4[_0xc4ec('0x1')]=_['startsWith'](_0x3b5946,_0xc4ec('0x2'))?'or':_0xc4ec('0x3');var _0x140710=_0x3b5946['replace'](_0xc4ec('0x4'),'')[_0xc4ec('0x5')](_0xc4ec('0x2'),'')[_0xc4ec('0x6')]('||');for(var _0x2b5134=0x0;_0x2b5134<_0x140710[_0xc4ec('0x7')];_0x2b5134++){var _0x4458fd=_0x140710[_0x2b5134]['split'](':=');var _0x5d4c1a=_0x4458fd[0x0];var _0x2862ef=_0x4458fd[_0xc4ec('0x8')](0x1);_0x2862ef['forEach'](function(_0x4f0a83){var _0x47122e=_0x4f0a83[_0xc4ec('0x6')]('[')[_0xc4ec('0x9')]();var _0x2129f9=_0x4f0a83[_0xc4ec('0xa')](/\[(.*?)\]/g);_0x2129f9[_0xc4ec('0xb')](function(_0x7c1673){var _0x4587f9=_0x7c1673[_0xc4ec('0x6')]('[')[_0xc4ec('0xc')](function(_0x263523){return _0x263523['indexOf'](']')>-0x1;})['map'](function(_0x48f60b){return _0x48f60b['split'](']')[0x0];})[0x0];_0x3dfbc4[_0xc4ec('0xd')]['push']({'field':_0x5d4c1a,'operator':_0x47122e,'value':_0x4587f9});});});}return _0x3dfbc4;};exports[_0xc4ec('0xe')]=function(_0x5dfe2b,_0x77745e,_0x27ef66){var _0x394bcd={};if(_0x77745e===_0xc4ec('0xf')){if(_0x27ef66['operator']==='$eq'){_0x27ef66[_0xc4ec('0x10')]=_0xc4ec('0x11');_0x27ef66[_0xc4ec('0x12')]+=','+_0x27ef66[_0xc4ec('0x12')];}else if(_['includes']([_0xc4ec('0x13'),_0xc4ec('0x14')],_0x27ef66[_0xc4ec('0x10')])){_0x27ef66[_0xc4ec('0x12')]=moment(_0x27ef66[_0xc4ec('0x12')])[_0xc4ec('0x15')](0x1,_0xc4ec('0x16'))[_0xc4ec('0x17')](_0xc4ec('0x18'));}}if(_0x27ef66[_0xc4ec('0x19')]){_0x77745e=_0x27ef66[_0xc4ec('0x19')];_0x394bcd[_0xc4ec('0x1a')]='CAST('+_0x5dfe2b+'.'+_0x27ef66[_0xc4ec('0x1b')]+_0xc4ec('0x1c')+_0x27ef66[_0xc4ec('0x19')]+')\x20'+parseOperator(_0x27ef66['operator']);}else{_0x394bcd[_0xc4ec('0x1a')]=_0x5dfe2b+'.'+_0x27ef66[_0xc4ec('0x1b')]+'\x20'+parseOperator(_0x27ef66[_0xc4ec('0x10')]);}if(_['includes']([_0xc4ec('0x1d'),_0xc4ec('0x1e')],_0x27ef66[_0xc4ec('0x10')]))_0x394bcd['text']='('+_0x394bcd['text']+_0xc4ec('0x1f')+_0x5dfe2b+'.'+_0x27ef66['field']+_0xc4ec('0x20');_0x394bcd['value']=parseValue(_0x77745e,_0x27ef66[_0xc4ec('0x10')],_0x27ef66[_0xc4ec('0x12')]);return _0x394bcd;};function parseOperator(_0x51b6d3){var _0x502cb6;switch(_0x51b6d3){case _0xc4ec('0x21'):_0x502cb6=_0xc4ec('0x22');break;case _0xc4ec('0x1e'):_0x502cb6=_0xc4ec('0x23');break;case _0xc4ec('0x24'):_0x502cb6=_0xc4ec('0x25');break;case _0xc4ec('0x1d'):_0x502cb6=_0xc4ec('0x26');break;case _0xc4ec('0x27'):case _0xc4ec('0x28'):case'$endsWith':_0x502cb6=_0xc4ec('0x29');break;case _0xc4ec('0x2a'):_0x502cb6=_0xc4ec('0x2b');break;case _0xc4ec('0x13'):_0x502cb6=_0xc4ec('0x2c');break;case _0xc4ec('0x14'):_0x502cb6=_0xc4ec('0x2d');break;case _0xc4ec('0x2e'):_0x502cb6=_0xc4ec('0x2f');break;case _0xc4ec('0x11'):_0x502cb6=_0xc4ec('0x30');break;}return _0x502cb6;}function parseValue(_0x42d18f,_0x1590ed,_0x33c41c){var _0x1caf58={'start':undefined,'end':undefined};switch(_0x1590ed){case _0xc4ec('0x21'):case'$notIn':_0x1caf58['start']=_0x33c41c['split'](',');break;case _0xc4ec('0x27'):_0x1caf58['start']='%'+_0x33c41c+'%';break;case _0xc4ec('0x28'):_0x1caf58['start']=_0x33c41c+'%';break;case _0xc4ec('0x31'):_0x1caf58[_0xc4ec('0x32')]='%'+_0x33c41c;break;case'$between':var _0x1d7f4d=_0x33c41c['split'](',');var _0x33c41c=_0x1d7f4d['shift']();var _0x1c272d=_0x1d7f4d[_0xc4ec('0x33')]();if(_0x42d18f===_0xc4ec('0xf')){_0x33c41c=moment(_0x33c41c)['utcOffset'](0x0,!![])[_0xc4ec('0x17')]();_0x1c272d=moment(_0x1c272d)[_0xc4ec('0x34')](0x0,!![])[_0xc4ec('0x15')](0x17,'hours')[_0xc4ec('0x15')](0x3b,'minutes')[_0xc4ec('0x15')](0x3b,_0xc4ec('0x35'))[_0xc4ec('0x17')]();}_0x1caf58={'start':_0x33c41c,'end':_0x1c272d};break;default:_0x1caf58['start']=_0x33c41c;break;}return _0x1caf58;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index d923695..e7c5417 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 _0xd1bd=['{EXPR}','push','join','getOptions','query','$id','filters','intersection','attributes','model','nolimit','offset','order','where','filter','object','value','VIRTUAL','merge','options','sequelize','moment','parse','keys','fields','isEmpty','forOwn','find','type','isPlainObject','$gte','YYYY-MM-DD','utc','$lte','format','name','uniqueid','isArray','split','limit','sort','map','indexOf','priority','cast','col','unsigned','substr','ASC','length','omit','isObject','isString','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue'];(function(_0x2fff64,_0x200fdd){var _0x1f5c19=function(_0x4af402){while(--_0x4af402){_0x2fff64['push'](_0x2fff64['shift']());}};_0x1f5c19(++_0x200fdd);}(_0xd1bd,0x1b8));var _0xdd1b=function(_0x2d7161,_0xb92f69){_0x2d7161=_0x2d7161-0x0;var _0x4366df=_0xd1bd[_0x2d7161];return _0x4366df;};'use strict';var _=require('lodash');var sequelize=require(_0xdd1b('0x0'));var moment=require(_0xdd1b('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x21c584){var _0x23bfac=['ne'];try{var _0xd034d3=JSON[_0xdd1b('0x2')](_0x21c584);var _0x501ee8=Object[_0xdd1b('0x3')](_0xd034d3)[0x0];return _0x23bfac['includes'](_0x501ee8);}catch(_0x327e00){return![];}}function getOperatorValue(_0xd1bfd8){var _0x19948d=JSON[_0xdd1b('0x2')](_0xd1bfd8);var _0x2b0e2a=Object['keys'](_0x19948d)[0x0];var _0x2df752=_0x19948d[_0x2b0e2a];return{['$'+_0x2b0e2a]:_0x2df752};}exports[_0xdd1b('0x4')]=function(_0x438c3f){var _0x4ccf28=null;if(_0x438c3f){_0x4ccf28=_0x438c3f['split'](',');}return _0x4ccf28;};exports['filters']=function(_0x3c0e40,_0x5aa193){var _0x1a35d2={};if(!_[_0xdd1b('0x5')](_0x3c0e40)){_[_0xdd1b('0x6')](_0x3c0e40,function(_0x4668d1,_0x3c17f7){try{if(_0x5aa193){var _0x1a11cb=_[_0xdd1b('0x7')](_0x5aa193,{'name':_0x3c17f7})||{};if(hasSequelizeOperator(_0x4668d1)){_0x1a35d2[_0x3c17f7]=getOperatorValue(_0x4668d1);}else if(_0x1a11cb[_0xdd1b('0x8')]==='DATE'&&_[_0xdd1b('0x9')](_0x4668d1)){var _0x47a1f8=JSON['parse'](_0x4668d1);var _0x2296a7={'$gte':moment(moment(_0x47a1f8[_0xdd1b('0xa')])['format'](_0xdd1b('0xb')))[_0xdd1b('0xc')]()['format'](),'$lte':moment(moment(_0x47a1f8[_0xdd1b('0xd')])[_0xdd1b('0xe')](_0xdd1b('0xb')))[_0xdd1b('0xc')]()['subtract'](0x1,'s')[_0xdd1b('0xe')]()};_0x1a35d2[_0x3c17f7]=_0x2296a7;}else if(_0x1a11cb[_0xdd1b('0xf')]===_0xdd1b('0x10')){_0x1a35d2[_0x3c17f7]=_0x4668d1;}else{_0x1a35d2[_0x3c17f7]=_[_0xdd1b('0x11')](_0x4668d1)?_0x4668d1:JSON[_0xdd1b('0x2')](_0x4668d1);}}else{_0x1a35d2[_0x3c17f7]=_[_0xdd1b('0x11')](_0x4668d1)?_0x4668d1:JSON[_0xdd1b('0x2')](_0x4668d1);}}catch(_0x811a86){_0x1a35d2[_0x3c17f7]=_0x4668d1[_0xdd1b('0x12')](',');}});}return _0x1a35d2;};exports[_0xdd1b('0x13')]=function(_0x55b0d4){_0x55b0d4=parseInt(_0x55b0d4,0xa);if(!_0x55b0d4||_0x55b0d4<0x0){_0x55b0d4=LIMIT_VALUE;}return _0x55b0d4;};exports['offset']=function(_0x1589a0){_0x1589a0=parseInt(_0x1589a0,0xa);if(!_0x1589a0||_0x1589a0<0x0){_0x1589a0=0x0;}return _0x1589a0;};exports[_0xdd1b('0x14')]=function(_0x4b8d81){var _0x1ed01a,_0x4abf0b=null;if(_0x4b8d81){_0x1ed01a=_0x4b8d81['split'](',');_0x4abf0b=_[_0xdd1b('0x15')](_0x1ed01a,function(_0x137a22){if(_0x137a22[_0xdd1b('0x16')]('-')===0x0){return[_0x137a22===_0xdd1b('0x17')?sequelize[_0xdd1b('0x18')](sequelize[_0xdd1b('0x19')](_0xdd1b('0x17')),_0xdd1b('0x1a')):_0x137a22[_0xdd1b('0x1b')](0x1),'DESC'];}else{return[_0x137a22===_0xdd1b('0x17')?sequelize['cast'](sequelize[_0xdd1b('0x19')](_0xdd1b('0x17')),_0xdd1b('0x1a')):_0x137a22,_0xdd1b('0x1c')];}});}return _0x4abf0b;};exports['omit']=function(_0x2c2d2c,_0x4c3b5b){if(_[_0xdd1b('0x5')](_0x2c2d2c)){return _0x2c2d2c;}if(_[_0xdd1b('0x11')](_0x2c2d2c)){for(var _0x28bb04=0x0;_0x28bb04<_0x2c2d2c[_0xdd1b('0x1d')];_0x28bb04+=0x1){_0x2c2d2c[_0x28bb04]=this[_0xdd1b('0x1e')](_0x2c2d2c[_0x28bb04],_0x4c3b5b);}return _0x2c2d2c;}if(!_[_0xdd1b('0x1f')](_0x2c2d2c)){return _0x2c2d2c;}if(_[_0xdd1b('0x20')](_0x4c3b5b)){_0x4c3b5b=[_0x4c3b5b];}if(!_['isArray'](_0x4c3b5b)){return _0x2c2d2c;}for(var _0xd6ea36=0x0;_0xd6ea36<_0x4c3b5b[_0xdd1b('0x1d')];_0xd6ea36+=0x1){_[_0xdd1b('0x21')](_0x2c2d2c,_0x4c3b5b[_0xd6ea36]);}for(var _0x5dc2d6 in _0x2c2d2c){if(_0x2c2d2c[_0xdd1b('0x22')](_0x5dc2d6)){_0x2c2d2c[_0x5dc2d6]=this['omit'](_0x2c2d2c[_0x5dc2d6],_0x4c3b5b);}}return _0x2c2d2c;};exports[_0xdd1b('0x23')]=function(_0x29d50b){return _0x29d50b[_0xdd1b('0x24')](RegExp(_0xdd1b('0x25')))?!![]:![];};exports[_0xdd1b('0x26')]=function(_0x450ffb){return _0x450ffb[_0xdd1b('0x24')](/^\S+@\S+$/)?!![]:![];};exports[_0xdd1b('0x27')]=function(_0x4674e7,_0x1ec7c3){var _0x424d8d=[];var _0x551db6=/[ `!@#$%^&*()_\-?~]/;var _0x2c85c4=_0x1ec7c3?'\x22{EXPR}\x22':_0xdd1b('0x28');_0x4674e7['split'](/[ ,]+/)['forEach'](function(_0x401bea){_0x401bea=_0x401bea['replace'](/([^:]")"+/g,'$1');_0x401bea='+'+_0x401bea+'*';var _0x1937c4=_0x401bea['match'](_0x551db6);if(_0x1937c4){_0x401bea='\x22'+_0x401bea+'\x22';}_0x424d8d[_0xdd1b('0x29')](_0x401bea);});_0x2c85c4=_0x2c85c4['replace'](_0xdd1b('0x28'),_0x424d8d[_0xdd1b('0x2a')]('\x20'));return _0x2c85c4;};exports[_0xdd1b('0x2b')]=function(_0x1fab74,_0x39c9af,_0xe6810c){var _0x14076c={},_0x6a44d6={};if(_0x39c9af[_0xdd1b('0x2c')][_0xdd1b('0x2d')]){_0x39c9af['query']['id']=_0x39c9af['query'][_0xdd1b('0x2d')];delete _0x39c9af[_0xdd1b('0x2c')][_0xdd1b('0x2d')];}_0x14076c['model']=_['map'](_0x1fab74,_0xdd1b('0xf'));_0x14076c[_0xdd1b('0x2c')]=_['keys'](_0x39c9af[_0xdd1b('0x2c')]);_0x14076c[_0xdd1b('0x2e')]=_[_0xdd1b('0x2f')](_0x14076c['model'],_0x14076c[_0xdd1b('0x2c')]);_0x6a44d6[_0xdd1b('0x30')]=_[_0xdd1b('0x2f')](_0x14076c[_0xdd1b('0x31')],this[_0xdd1b('0x4')](_0x39c9af[_0xdd1b('0x2c')][_0xdd1b('0x4')]));_0x6a44d6[_0xdd1b('0x30')]=_0x6a44d6[_0xdd1b('0x30')][_0xdd1b('0x1d')]?_0x6a44d6[_0xdd1b('0x30')]:_0x14076c[_0xdd1b('0x31')];if(!_0x39c9af['query']['hasOwnProperty'](_0xdd1b('0x32'))){_0x6a44d6[_0xdd1b('0x13')]=this[_0xdd1b('0x13')](_0x39c9af[_0xdd1b('0x2c')][_0xdd1b('0x13')]);_0x6a44d6[_0xdd1b('0x33')]=this['offset'](_0x39c9af[_0xdd1b('0x2c')][_0xdd1b('0x33')]);}_0x6a44d6[_0xdd1b('0x34')]=this[_0xdd1b('0x14')](_0x39c9af['query'][_0xdd1b('0x14')]);_0x6a44d6[_0xdd1b('0x35')]=this[_0xdd1b('0x2e')](_['pick'](_0x39c9af['query'],_0x14076c[_0xdd1b('0x2e')]),_0x1fab74);if(_0x39c9af[_0xdd1b('0x2c')][_0xdd1b('0x36')]){var _0x199ff6=_0x1fab74;var _0x4e48da=_0x39c9af['query']['filter'];if(typeof _0x4e48da===_0xdd1b('0x37')){_0x199ff6=_['filter'](_0x1fab74,function(_0x5b5a1e){return _['includes'](_0x4e48da['columns'],_0x5b5a1e[_0xdd1b('0xf')]);});_0x4e48da=_0x4e48da[_0xdd1b('0x38')];}_0x6a44d6['where']=_['merge'](_0x6a44d6[_0xdd1b('0x35')],{'$or':_[_0xdd1b('0x15')](_0x199ff6,function(_0x3a7c85){if(_0x3a7c85['type']!==_0xdd1b('0x39')){if(_0xe6810c){return sequelize[_0xdd1b('0x35')](sequelize['fn']('lower',sequelize[_0xdd1b('0x19')](_0x3a7c85[_0xdd1b('0xf')])),{'$like':sequelize['fn']('lower','%'+_0x39c9af[_0xdd1b('0x2c')][_0xdd1b('0x36')]+'%')});}else{var _0x5c6a5b={};_0x5c6a5b[_0x3a7c85[_0xdd1b('0xf')]]={'$like':'%'+_0x39c9af[_0xdd1b('0x2c')][_0xdd1b('0x36')]+'%'};return _0x5c6a5b;}}})});}_0x6a44d6=_[_0xdd1b('0x3a')]({},_0x6a44d6,_0x39c9af[_0xdd1b('0x3b')]);return _0x6a44d6;}; \ No newline at end of file +var _0x0cdc=['col','unsigned','substr','omit','length','isString','unset','hasOwnProperty','isNumeric','^[+]?[0-9]*$','isEmail','match','getFullTextValue','\x22{EXPR}\x22','{EXPR}','forEach','replace','push','join','getOptions','query','model','intersection','attributes','nolimit','order','where','pick','filter','object','columns','value','merge','VIRTUAL','options','lodash','moment','parse','keys','fields','filters','isEmpty','find','type','$gte','format','utc','$lte','subtract','name','uniqueid','isArray','split','limit','offset','sort','map','indexOf','priority','cast'];(function(_0xd39959,_0x302d09){var _0x1ff69c=function(_0x17c97f){while(--_0x17c97f){_0xd39959['push'](_0xd39959['shift']());}};_0x1ff69c(++_0x302d09);}(_0x0cdc,0x113));var _0xc0cd=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x0cdc[_0x36c5b0];return _0xf19333;};'use strict';var _=require(_0xc0cd('0x0'));var sequelize=require('sequelize');var moment=require(_0xc0cd('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x3d3cf0){var _0xc4833b=['ne'];try{var _0x45ecd0=JSON[_0xc0cd('0x2')](_0x3d3cf0);var _0x4c85f9=Object[_0xc0cd('0x3')](_0x45ecd0)[0x0];return _0xc4833b['includes'](_0x4c85f9);}catch(_0x33596d){return![];}}function getOperatorValue(_0x36148d){var _0x2334a5=JSON['parse'](_0x36148d);var _0x53bf3e=Object['keys'](_0x2334a5)[0x0];var _0x3a6ff1=_0x2334a5[_0x53bf3e];return{['$'+_0x53bf3e]:_0x3a6ff1};}exports[_0xc0cd('0x4')]=function(_0x2a21bd){var _0x41eee9=null;if(_0x2a21bd){_0x41eee9=_0x2a21bd['split'](',');}return _0x41eee9;};exports[_0xc0cd('0x5')]=function(_0x671d5,_0x233b8f){var _0x5ce1c0={};if(!_[_0xc0cd('0x6')](_0x671d5)){_['forOwn'](_0x671d5,function(_0x1d5c11,_0x216c2e){try{if(_0x233b8f){var _0x521713=_[_0xc0cd('0x7')](_0x233b8f,{'name':_0x216c2e})||{};if(hasSequelizeOperator(_0x1d5c11)){_0x5ce1c0[_0x216c2e]=getOperatorValue(_0x1d5c11);}else if(_0x521713[_0xc0cd('0x8')]==='DATE'&&_['isPlainObject'](_0x1d5c11)){var _0x333a01=JSON[_0xc0cd('0x2')](_0x1d5c11);var _0x285fec={'$gte':moment(moment(_0x333a01[_0xc0cd('0x9')])[_0xc0cd('0xa')]('YYYY-MM-DD'))[_0xc0cd('0xb')]()['format'](),'$lte':moment(moment(_0x333a01[_0xc0cd('0xc')])['format']('YYYY-MM-DD'))[_0xc0cd('0xb')]()[_0xc0cd('0xd')](0x1,'s')[_0xc0cd('0xa')]()};_0x5ce1c0[_0x216c2e]=_0x285fec;}else if(_0x521713[_0xc0cd('0xe')]===_0xc0cd('0xf')){_0x5ce1c0[_0x216c2e]=_0x1d5c11;}else{_0x5ce1c0[_0x216c2e]=_[_0xc0cd('0x10')](_0x1d5c11)?_0x1d5c11:JSON['parse'](_0x1d5c11);}}else{_0x5ce1c0[_0x216c2e]=_['isArray'](_0x1d5c11)?_0x1d5c11:JSON['parse'](_0x1d5c11);}}catch(_0x12c87c){_0x5ce1c0[_0x216c2e]=_0x1d5c11[_0xc0cd('0x11')](',');}});}return _0x5ce1c0;};exports[_0xc0cd('0x12')]=function(_0x2ebd25){_0x2ebd25=parseInt(_0x2ebd25,0xa);if(!_0x2ebd25||_0x2ebd25<0x0){_0x2ebd25=LIMIT_VALUE;}return _0x2ebd25;};exports[_0xc0cd('0x13')]=function(_0x31e3c2){_0x31e3c2=parseInt(_0x31e3c2,0xa);if(!_0x31e3c2||_0x31e3c2<0x0){_0x31e3c2=0x0;}return _0x31e3c2;};exports[_0xc0cd('0x14')]=function(_0x57eff3){var _0x963395,_0x534d2b=null;if(_0x57eff3){_0x963395=_0x57eff3['split'](',');_0x534d2b=_[_0xc0cd('0x15')](_0x963395,function(_0x247dab){if(_0x247dab[_0xc0cd('0x16')]('-')===0x0){return[_0x247dab===_0xc0cd('0x17')?sequelize[_0xc0cd('0x18')](sequelize[_0xc0cd('0x19')](_0xc0cd('0x17')),_0xc0cd('0x1a')):_0x247dab[_0xc0cd('0x1b')](0x1),'DESC'];}else{return[_0x247dab===_0xc0cd('0x17')?sequelize[_0xc0cd('0x18')](sequelize[_0xc0cd('0x19')](_0xc0cd('0x17')),'unsigned'):_0x247dab,'ASC'];}});}return _0x534d2b;};exports[_0xc0cd('0x1c')]=function(_0x4b1e52,_0x11b6cd){if(_['isEmpty'](_0x4b1e52)){return _0x4b1e52;}if(_[_0xc0cd('0x10')](_0x4b1e52)){for(var _0x5464f4=0x0;_0x5464f4<_0x4b1e52[_0xc0cd('0x1d')];_0x5464f4+=0x1){_0x4b1e52[_0x5464f4]=this[_0xc0cd('0x1c')](_0x4b1e52[_0x5464f4],_0x11b6cd);}return _0x4b1e52;}if(!_['isObject'](_0x4b1e52)){return _0x4b1e52;}if(_[_0xc0cd('0x1e')](_0x11b6cd)){_0x11b6cd=[_0x11b6cd];}if(!_['isArray'](_0x11b6cd)){return _0x4b1e52;}for(var _0x281e2a=0x0;_0x281e2a<_0x11b6cd[_0xc0cd('0x1d')];_0x281e2a+=0x1){_[_0xc0cd('0x1f')](_0x4b1e52,_0x11b6cd[_0x281e2a]);}for(var _0x1fb739 in _0x4b1e52){if(_0x4b1e52[_0xc0cd('0x20')](_0x1fb739)){_0x4b1e52[_0x1fb739]=this[_0xc0cd('0x1c')](_0x4b1e52[_0x1fb739],_0x11b6cd);}}return _0x4b1e52;};exports[_0xc0cd('0x21')]=function(_0x3b1a85){return _0x3b1a85['match'](RegExp(_0xc0cd('0x22')))?!![]:![];};exports[_0xc0cd('0x23')]=function(_0x4b0e69){return _0x4b0e69[_0xc0cd('0x24')](/^\S+@\S+$/)?!![]:![];};exports[_0xc0cd('0x25')]=function(_0x528b90,_0x56f1f2){var _0x22d308=[];var _0x199d6c=/[ `!@#$%^&*()_\-?~]/;var _0x2c9131=_0x56f1f2?_0xc0cd('0x26'):_0xc0cd('0x27');_0x528b90[_0xc0cd('0x11')](/[ ,]+/)[_0xc0cd('0x28')](function(_0x4230bf){_0x4230bf=_0x4230bf[_0xc0cd('0x29')](/([^:]")"+/g,'$1');_0x4230bf='+'+_0x4230bf+'*';var _0x4d53da=_0x4230bf[_0xc0cd('0x24')](_0x199d6c);if(_0x4d53da){_0x4230bf='\x22'+_0x4230bf+'\x22';}_0x22d308[_0xc0cd('0x2a')](_0x4230bf);});_0x2c9131=_0x2c9131[_0xc0cd('0x29')](_0xc0cd('0x27'),_0x22d308[_0xc0cd('0x2b')]('\x20'));return _0x2c9131;};exports[_0xc0cd('0x2c')]=function(_0x38c91f,_0x2ae555,_0x3fcbd8){var _0x4b665e={},_0x3b541f={};if(_0x2ae555[_0xc0cd('0x2d')]['$id']){_0x2ae555['query']['id']=_0x2ae555[_0xc0cd('0x2d')]['$id'];delete _0x2ae555['query']['$id'];}_0x4b665e[_0xc0cd('0x2e')]=_[_0xc0cd('0x15')](_0x38c91f,_0xc0cd('0xe'));_0x4b665e['query']=_[_0xc0cd('0x3')](_0x2ae555['query']);_0x4b665e[_0xc0cd('0x5')]=_[_0xc0cd('0x2f')](_0x4b665e['model'],_0x4b665e['query']);_0x3b541f[_0xc0cd('0x30')]=_[_0xc0cd('0x2f')](_0x4b665e[_0xc0cd('0x2e')],this[_0xc0cd('0x4')](_0x2ae555[_0xc0cd('0x2d')][_0xc0cd('0x4')]));_0x3b541f[_0xc0cd('0x30')]=_0x3b541f[_0xc0cd('0x30')][_0xc0cd('0x1d')]?_0x3b541f[_0xc0cd('0x30')]:_0x4b665e[_0xc0cd('0x2e')];if(!_0x2ae555['query'][_0xc0cd('0x20')](_0xc0cd('0x31'))){_0x3b541f[_0xc0cd('0x12')]=this['limit'](_0x2ae555[_0xc0cd('0x2d')][_0xc0cd('0x12')]);_0x3b541f[_0xc0cd('0x13')]=this[_0xc0cd('0x13')](_0x2ae555[_0xc0cd('0x2d')][_0xc0cd('0x13')]);}_0x3b541f[_0xc0cd('0x32')]=this[_0xc0cd('0x14')](_0x2ae555[_0xc0cd('0x2d')]['sort']);_0x3b541f[_0xc0cd('0x33')]=this[_0xc0cd('0x5')](_[_0xc0cd('0x34')](_0x2ae555[_0xc0cd('0x2d')],_0x4b665e[_0xc0cd('0x5')]),_0x38c91f);if(_0x2ae555[_0xc0cd('0x2d')][_0xc0cd('0x35')]){var _0x455ed0=_0x38c91f;var _0x163f08=_0x2ae555['query']['filter'];if(typeof _0x163f08===_0xc0cd('0x36')){_0x455ed0=_[_0xc0cd('0x35')](_0x38c91f,function(_0xa999ad){return _['includes'](_0x163f08[_0xc0cd('0x37')],_0xa999ad[_0xc0cd('0xe')]);});_0x163f08=_0x163f08[_0xc0cd('0x38')];}_0x3b541f[_0xc0cd('0x33')]=_[_0xc0cd('0x39')](_0x3b541f['where'],{'$or':_['map'](_0x455ed0,function(_0x3f8141){if(_0x3f8141[_0xc0cd('0x8')]!==_0xc0cd('0x3a')){if(_0x3fcbd8){return sequelize[_0xc0cd('0x33')](sequelize['fn']('lower',sequelize[_0xc0cd('0x19')](_0x3f8141[_0xc0cd('0xe')])),{'$like':sequelize['fn']('lower','%'+_0x2ae555['query'][_0xc0cd('0x35')]+'%')});}else{var _0x5127cf={};_0x5127cf[_0x3f8141['name']]={'$like':'%'+_0x2ae555[_0xc0cd('0x2d')][_0xc0cd('0x35')]+'%'};return _0x5127cf;}}})});}_0x3b541f=_[_0xc0cd('0x39')]({},_0x3b541f,_0x2ae555[_0xc0cd('0x3b')]);return _0x3b541f;}; \ No newline at end of file diff --git a/server/components/realtime/agents.js b/server/components/realtime/agents.js index a72e217..e9ef350 100644 --- a/server/components/realtime/agents.js +++ b/server/components/realtime/agents.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbcb4=['Agents','then','error','result','catch','getRealtimeAgents','*pause','busy','getAgentStatus','isArray','startCase','Queue','map','findOne','flatten','uniq','value','includes','getAgentIdsByStatus','resolve','findAll','name','fullname','smsPause','pauseType','find','merge','globalStatus','fields','order','startsWith','DESC','ASC','substring','indexOf','validateSortParameter','sort','toLowerCase','sortAgentsByStatus','userpic','online','lastLoginAt','lastPauseAt','internal','address','chatPause','openchannelCapacity','mailCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','smsStatus','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableAutomaticScreenRecording','routealias','omit','pick','filterAgentAttributes','lodash','jayson/promise','../../mysqldb','http','faxPause','mailPause','openchannelPause','voicePause','whatsappPause','every','filter','length','unknown','unavailable','ringing','isNil','idle','voiceStatus','pause','chatStatus','faxStatus','mailStatus','openchannelStatus','whatsappStatus','request'];(function(_0x479904,_0x70604c){var _0x160af4=function(_0x56b2c5){while(--_0x56b2c5){_0x479904['push'](_0x479904['shift']());}};_0x160af4(++_0x70604c);}(_0xbcb4,0x163));var _0x4bcb=function(_0xc97139,_0x461711){_0xc97139=_0xc97139-0x0;var _0xaa6744=_0xbcb4[_0xc97139];return _0xaa6744;};'use strict';var _=require(_0x4bcb('0x0'));var jayson=require(_0x4bcb('0x1'));var db=require(_0x4bcb('0x2'))['db'];var amiClient=jayson['client'][_0x4bcb('0x3')]({'port':0x232a});var routingClient=jayson['client'][_0x4bcb('0x3')]({'port':0x232c});function isAgentPaused(_0x37be65,_0x2c140e){var _0x1b6757=[_0x37be65['chatPause'],_0x37be65[_0x4bcb('0x4')],_0x37be65[_0x4bcb('0x5')],_0x37be65[_0x4bcb('0x6')],_0x37be65['smsPause'],_0x37be65[_0x4bcb('0x7')],_0x37be65[_0x4bcb('0x8')]];if(!_0x2c140e)return _[_0x4bcb('0x9')](_0x1b6757);var _0x51b6be=_[_0x4bcb('0xa')](_0x1b6757);return _0x51b6be['length']>0x0&&_0x51b6be[_0x4bcb('0xb')]<_0x1b6757[_0x4bcb('0xb')]?!![]:![];}function isIdle(_0x3eb84d){return _0x3eb84d==='idle'||_0x3eb84d===_0x4bcb('0xc')||_0x3eb84d===_0x4bcb('0xd')||_0x3eb84d===_0x4bcb('0xe')||_[_0x4bcb('0xf')](_0x3eb84d);}function isAgentIdle(_0x1024ab){if(_0x1024ab['voiceStatus']!==_0x4bcb('0x10')&&_0x1024ab[_0x4bcb('0x7')]){_0x1024ab[_0x4bcb('0x11')]=_0x4bcb('0x12');return![];}return _[_0x4bcb('0x9')]([_0x1024ab[_0x4bcb('0x13')],_0x1024ab[_0x4bcb('0x14')],_0x1024ab[_0x4bcb('0x15')],_0x1024ab[_0x4bcb('0x16')],_0x1024ab['smsStatus'],_0x1024ab[_0x4bcb('0x11')],_0x1024ab[_0x4bcb('0x17')]],isIdle);}function getRealtimeAgents(){return amiClient[_0x4bcb('0x18')](_0x4bcb('0x19'),{})[_0x4bcb('0x1a')](function(_0x5c96c9){if(_0x5c96c9[_0x4bcb('0x1b')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');}var _0x36ef44=_0x5c96c9['result'];return routingClient[_0x4bcb('0x18')](_0x4bcb('0x19'),{})['then'](function(_0x3b08c7){if(_0x3b08c7[_0x4bcb('0x1b')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');}var _0x531224=_0x3b08c7[_0x4bcb('0x1c')];return _['merge']({},_0x36ef44,_0x531224);});})[_0x4bcb('0x1d')](function(_0x1647ef){throw _0x1647ef;});}exports[_0x4bcb('0x1e')]=getRealtimeAgents;function getAgentStatus(_0x5cb169){var _0x2ee2aa=_0x4bcb('0xc');if(isAgentPaused(_0x5cb169))_0x2ee2aa=_0x4bcb('0x12');else if(isAgentPaused(_0x5cb169,!![]))_0x2ee2aa=_0x4bcb('0x1f');else if(isAgentIdle(_0x5cb169))_0x2ee2aa=_0x4bcb('0x10');else _0x2ee2aa=_0x4bcb('0x20');return _0x2ee2aa;}exports[_0x4bcb('0x21')]=getAgentStatus;function getAgentIdsByQueues(_0x32075f,_0x347c8){var _0x28ab01=_[_0x4bcb('0x22')](_0x32075f)?_0x32075f:[_0x32075f];var _0x5ebccb=_[_0x4bcb('0x23')](_0x347c8)+_0x4bcb('0x24');var _0x148030=_[_0x4bcb('0x25')](_0x28ab01,function(_0x47fb3c){return db[_0x5ebccb][_0x4bcb('0x26')]({'where':{'id':_0x47fb3c}})[_0x4bcb('0x1a')](function(_0x3df121){if(!_0x3df121)return[];return _0x3df121['getAgents']({'attributes':['id'],'raw':!![]});});});return Promise['all'](_0x148030)[_0x4bcb('0x1a')](function(_0x5b71d8){var _0x2f6aa7=_(_0x5b71d8)[_0x4bcb('0x27')]()['map']('id')[_0x4bcb('0x28')]()[_0x4bcb('0x29')]();return _0x2f6aa7;});}exports['getAgentIdsByQueues']=getAgentIdsByQueues;function getAgentIdsByStatus(_0x297d9c,_0x16b9c2,_0x127c5d){try{if(_0x16b9c2[_0x4bcb('0xb')]>0x0){_0x297d9c=_0x297d9c[_0x4bcb('0xa')](function(_0x99f74e){return _0x16b9c2[_0x4bcb('0x2a')](_0x99f74e['id']);});}var _0x91fc00=_0x297d9c[_0x4bcb('0xa')](function(_0xeee1a7){var _0x68fa37=_0x4bcb('0x20');if(isAgentIdle(_0xeee1a7)){_0x68fa37=_0x4bcb('0x10');}return _0x68fa37===_0x127c5d;});return _['map'](_0x91fc00,'id');}catch(_0x1792a7){throw _0x1792a7;}}exports[_0x4bcb('0x2b')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x47966f,_0x12dcfd,_0x41b0ca){return Promise[_0x4bcb('0x2c')]()[_0x4bcb('0x1a')](function(){if(_0x12dcfd[_0x4bcb('0xb')]>0x0){_0x47966f=_0x47966f[_0x4bcb('0xa')](function(_0x40fc0b){return _0x12dcfd[_0x4bcb('0x2a')](_0x40fc0b['id']);});}return _0x47966f;})[_0x4bcb('0x1a')](function(){return db['User'][_0x4bcb('0x2d')]({'attributes':['id',_0x4bcb('0x2e'),_0x4bcb('0x2f'),'chatPause',_0x4bcb('0x4'),_0x4bcb('0x5'),_0x4bcb('0x6'),_0x4bcb('0x30'),_0x4bcb('0x7'),'whatsappPause',_0x4bcb('0x31')],'where':{'id':{'$in':_['map'](_0x47966f,'id')}},'raw':!![]});})[_0x4bcb('0x1a')](function(_0x52afc1){return _0x52afc1[_0x4bcb('0x25')](function(_0x2747f4){var _0x17917c=_[_0x4bcb('0x32')](_0x47966f,['id',_0x2747f4['id']]);var _0xc04922=filterAgentAttributes(_0x17917c);_[_0x4bcb('0x33')](_0x2747f4,_0xc04922);_0x2747f4[_0x4bcb('0x34')]=getAgentStatus(_0x2747f4);return _0x2747f4;});})['then'](function(_0x437d46){var _0x4e1d9a=sortAgentsByStatus(_0x437d46,_0x41b0ca);return _['map'](_0x4e1d9a,'id');})['catch'](function(_0x36e0b6){throw _0x36e0b6;});}exports['getSortedAgentsIdsByStatus']=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0xf8a966){var _0x47d795={'fields':[],'order':null};var _0x42f70b=_0xf8a966['split'](',');_0x47d795[_0x4bcb('0x35')]=_[_0x4bcb('0xa')](_0x42f70b,function(_0x1bbdfb){if(!_0x1bbdfb[_0x4bcb('0x2a')](_0x4bcb('0x34'))){return!![];}_0x47d795[_0x4bcb('0x36')]=_[_0x4bcb('0x37')](_0x1bbdfb,'-')?_0x4bcb('0x38'):_0x4bcb('0x39');return![];});return _0x47d795;}exports['getUpdatedSortOptions']=getUpdatedSortOptions;function validateSortParameter(_0x518546){if(_0x518546[_0x4bcb('0x2a')](_0x4bcb('0x2f'))&&!_0x518546[_0x4bcb('0x2a')]('internal')){var _0x2fde15=_0x518546[_0x4bcb('0x3a')](0x0,_0x518546[_0x4bcb('0x3b')]('fullname'));_0x518546+=','+_0x2fde15+'internal';}return _0x518546;}exports[_0x4bcb('0x3c')]=validateSortParameter;function sortAgentsByStatus(_0x543995,_0x5f4788){var _0x100973=_0x543995[_0x4bcb('0x3d')](function(_0x51adb4,_0x8d18ab){if(_0x51adb4[_0x4bcb('0x34')]===_0x8d18ab[_0x4bcb('0x34')]){if(_0x51adb4['globalStatus']==='pause'){if(_0x5f4788===_0x4bcb('0x38')){return(_0x51adb4[_0x4bcb('0x31')]||'')<(_0x8d18ab['pauseType']||'')||_0x51adb4['fullname'][_0x4bcb('0x3e')]()>_0x8d18ab['fullname'][_0x4bcb('0x3e')]()?0x1:-0x1;}else{return(_0x51adb4[_0x4bcb('0x31')]||'')<(_0x8d18ab['pauseType']||'')||_0x51adb4[_0x4bcb('0x2f')][_0x4bcb('0x3e')]()>_0x8d18ab['fullname'][_0x4bcb('0x3e')]()?-0x1:0x1;}}else{if(_0x5f4788===_0x4bcb('0x38')){return _0x51adb4['fullname'][_0x4bcb('0x3e')]()<_0x8d18ab[_0x4bcb('0x2f')][_0x4bcb('0x3e')]()?0x1:-0x1;}else{return _0x51adb4[_0x4bcb('0x2f')][_0x4bcb('0x3e')]()<_0x8d18ab['fullname']['toLowerCase']()?-0x1:0x1;}}}else{if(_0x5f4788===_0x4bcb('0x38')){return _0x51adb4[_0x4bcb('0x34')]<_0x8d18ab[_0x4bcb('0x34')]?0x1:-0x1;}else{return _0x51adb4[_0x4bcb('0x34')]<_0x8d18ab[_0x4bcb('0x34')]?-0x1:0x1;}}});return _0x100973;}exports[_0x4bcb('0x3f')]=sortAgentsByStatus;function filterAgentAttributes(_0x3678a6){var _0x3248ef=[_0x4bcb('0x40'),_0x4bcb('0x41'),_0x4bcb('0x42'),'lastPauseAt',_0x4bcb('0x31'),_0x4bcb('0x43'),_0x4bcb('0x44'),_0x4bcb('0x45'),_0x4bcb('0x46'),_0x4bcb('0x6'),'mailPause',_0x4bcb('0x30'),_0x4bcb('0x8'),_0x4bcb('0x4'),_0x4bcb('0x7'),'chatCapacity',_0x4bcb('0x47'),_0x4bcb('0x48'),'smsCapacity',_0x4bcb('0x49'),_0x4bcb('0x4a'),_0x4bcb('0x4b'),_0x4bcb('0x4c'),_0x4bcb('0x4d'),'smsCurrentCapacity',_0x4bcb('0x4e'),_0x4bcb('0x4f'),_0x4bcb('0x13'),_0x4bcb('0x16'),_0x4bcb('0x15'),_0x4bcb('0x50'),_0x4bcb('0x17'),_0x4bcb('0x14'),'voiceStatus',_0x4bcb('0x51'),_0x4bcb('0x52'),_0x4bcb('0x53'),_0x4bcb('0x54'),_0x4bcb('0x55'),_0x4bcb('0x56'),'voiceStatusTime',_0x4bcb('0x57'),_0x4bcb('0x58'),_0x4bcb('0x59'),'phoneBarEnableScreenRecordingByAgent',_0x4bcb('0x5a'),_0x4bcb('0x5b')];var _0x3a2899=['chatPause',_0x4bcb('0x6'),_0x4bcb('0x5'),'smsPause',_0x4bcb('0x8'),'faxPause','voicePause',_0x4bcb('0x41')];var _0x4d839f=_(_0x3678a6)[_0x4bcb('0x5c')](_0x3a2899)[_0x4bcb('0x5d')](_0x3248ef)[_0x4bcb('0x29')]();return _0x4d839f;}exports[_0x4bcb('0x5e')]=filterAgentAttributes; \ No newline at end of file +var _0x8706=['validateSortParameter','sort','pauseType','toLowerCase','sortAgentsByStatus','userpic','online','lastLoginAt','lastPauseAt','address','chatCapacity','openchannelCapacity','smsCapacity','whatsappCapacity','faxCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','chatStatusTime','mailStatusTime','smsStatusTime','voiceStatusTime','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','omit','pick','filterAgentAttributes','jayson/promise','../../mysqldb','http','client','chatPause','mailPause','openchannelPause','smsPause','voicePause','whatsappPause','every','filter','length','unavailable','ringing','isNil','voiceStatus','idle','pause','chatStatus','faxStatus','mailStatus','openchannelStatus','smsStatus','whatsappStatus','request','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','Agents','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','getRealtimeAgents','unknown','*pause','busy','isArray','startCase','map','findOne','getAgents','value','getAgentIdsByStatus','resolve','includes','User','name','fullname','faxPause','find','globalStatus','getSortedAgentsIdsByStatus','split','fields','startsWith','DESC','ASC','getUpdatedSortOptions','internal','substring','indexOf'];(function(_0x2d6eb0,_0x4d17ba){var _0x5c179f=function(_0x556c24){while(--_0x556c24){_0x2d6eb0['push'](_0x2d6eb0['shift']());}};_0x5c179f(++_0x4d17ba);}(_0x8706,0x132));var _0x6870=function(_0x4a6339,_0x30cd3a){_0x4a6339=_0x4a6339-0x0;var _0x5e9a19=_0x8706[_0x4a6339];return _0x5e9a19;};'use strict';var _=require('lodash');var jayson=require(_0x6870('0x0'));var db=require(_0x6870('0x1'))['db'];var amiClient=jayson['client'][_0x6870('0x2')]({'port':0x232a});var routingClient=jayson[_0x6870('0x3')][_0x6870('0x2')]({'port':0x232c});function isAgentPaused(_0x7eb4eb,_0x8efe9b){var _0x3343ec=[_0x7eb4eb[_0x6870('0x4')],_0x7eb4eb['faxPause'],_0x7eb4eb[_0x6870('0x5')],_0x7eb4eb[_0x6870('0x6')],_0x7eb4eb[_0x6870('0x7')],_0x7eb4eb[_0x6870('0x8')],_0x7eb4eb[_0x6870('0x9')]];if(!_0x8efe9b)return _[_0x6870('0xa')](_0x3343ec);var _0x19491c=_[_0x6870('0xb')](_0x3343ec);return _0x19491c[_0x6870('0xc')]>0x0&&_0x19491c[_0x6870('0xc')]<_0x3343ec['length']?!![]:![];}function isIdle(_0x340441){return _0x340441==='idle'||_0x340441==='unknown'||_0x340441===_0x6870('0xd')||_0x340441===_0x6870('0xe')||_[_0x6870('0xf')](_0x340441);}function isAgentIdle(_0x5adb46){if(_0x5adb46[_0x6870('0x10')]!==_0x6870('0x11')&&_0x5adb46[_0x6870('0x8')]){_0x5adb46[_0x6870('0x10')]=_0x6870('0x12');return![];}return _[_0x6870('0xa')]([_0x5adb46[_0x6870('0x13')],_0x5adb46[_0x6870('0x14')],_0x5adb46[_0x6870('0x15')],_0x5adb46[_0x6870('0x16')],_0x5adb46[_0x6870('0x17')],_0x5adb46['voiceStatus'],_0x5adb46[_0x6870('0x18')]],isIdle);}function getRealtimeAgents(){return amiClient[_0x6870('0x19')]('Agents',{})[_0x6870('0x1a')](function(_0x3114bc){if(_0x3114bc[_0x6870('0x1b')]){throw new Error(_0x6870('0x1c'));}var _0x3daa9=_0x3114bc['result'];return routingClient['request'](_0x6870('0x1d'),{})[_0x6870('0x1a')](function(_0x1c4cb5){if(_0x1c4cb5[_0x6870('0x1b')]){throw new Error(_0x6870('0x1e'));}var _0x325a5c=_0x1c4cb5['result'];return _[_0x6870('0x1f')]({},_0x3daa9,_0x325a5c);});})[_0x6870('0x20')](function(_0x1db500){throw _0x1db500;});}exports[_0x6870('0x21')]=getRealtimeAgents;function getAgentStatus(_0x1bf344){var _0x115f70=_0x6870('0x22');if(isAgentPaused(_0x1bf344))_0x115f70=_0x6870('0x12');else if(isAgentPaused(_0x1bf344,!![]))_0x115f70=_0x6870('0x23');else if(isAgentIdle(_0x1bf344))_0x115f70=_0x6870('0x11');else _0x115f70=_0x6870('0x24');return _0x115f70;}exports['getAgentStatus']=getAgentStatus;function getAgentIdsByQueues(_0x287cd7,_0x4174f9){var _0x38d962=_[_0x6870('0x25')](_0x287cd7)?_0x287cd7:[_0x287cd7];var _0x50e3fd=_[_0x6870('0x26')](_0x4174f9)+'Queue';var _0x37fcc6=_[_0x6870('0x27')](_0x38d962,function(_0x47a969){return db[_0x50e3fd][_0x6870('0x28')]({'where':{'id':_0x47a969}})[_0x6870('0x1a')](function(_0x14639d){if(!_0x14639d)return[];return _0x14639d[_0x6870('0x29')]({'attributes':['id'],'raw':!![]});});});return Promise['all'](_0x37fcc6)['then'](function(_0x11f9ff){var _0x42bfd2=_(_0x11f9ff)['flatten']()[_0x6870('0x27')]('id')['uniq']()[_0x6870('0x2a')]();return _0x42bfd2;});}exports['getAgentIdsByQueues']=getAgentIdsByQueues;function getAgentIdsByStatus(_0x5872e6,_0x5a2621,_0x13918b){try{if(_0x5a2621['length']>0x0){_0x5872e6=_0x5872e6[_0x6870('0xb')](function(_0x268ace){return _0x5a2621['includes'](_0x268ace['id']);});}var _0x380153=_0x5872e6[_0x6870('0xb')](function(_0x5418ad){var _0x63ffa8='busy';if(isAgentIdle(_0x5418ad)){_0x63ffa8=_0x6870('0x11');}return _0x63ffa8===_0x13918b;});return _['map'](_0x380153,'id');}catch(_0x39f8fa){throw _0x39f8fa;}}exports[_0x6870('0x2b')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x2e2d55,_0x3b4c5e,_0x37e994){return Promise[_0x6870('0x2c')]()[_0x6870('0x1a')](function(){if(_0x3b4c5e[_0x6870('0xc')]>0x0){_0x2e2d55=_0x2e2d55[_0x6870('0xb')](function(_0x5c75cd){return _0x3b4c5e[_0x6870('0x2d')](_0x5c75cd['id']);});}return _0x2e2d55;})['then'](function(){return db[_0x6870('0x2e')]['findAll']({'attributes':['id',_0x6870('0x2f'),_0x6870('0x30'),_0x6870('0x4'),_0x6870('0x31'),'mailPause','openchannelPause',_0x6870('0x7'),_0x6870('0x8'),'whatsappPause','pauseType'],'where':{'id':{'$in':_[_0x6870('0x27')](_0x2e2d55,'id')}},'raw':!![]});})['then'](function(_0x2e6724){return _0x2e6724[_0x6870('0x27')](function(_0x11a481){var _0x23ff78=_[_0x6870('0x32')](_0x2e2d55,['id',_0x11a481['id']]);var _0x44d923=filterAgentAttributes(_0x23ff78);_[_0x6870('0x1f')](_0x11a481,_0x44d923);_0x11a481[_0x6870('0x33')]=getAgentStatus(_0x11a481);return _0x11a481;});})[_0x6870('0x1a')](function(_0x5916d8){var _0xc0e56=sortAgentsByStatus(_0x5916d8,_0x37e994);return _['map'](_0xc0e56,'id');})['catch'](function(_0x34edd3){throw _0x34edd3;});}exports[_0x6870('0x34')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x313354){var _0x1d2875={'fields':[],'order':null};var _0x1d4b1e=_0x313354[_0x6870('0x35')](',');_0x1d2875[_0x6870('0x36')]=_[_0x6870('0xb')](_0x1d4b1e,function(_0x143344){if(!_0x143344[_0x6870('0x2d')](_0x6870('0x33'))){return!![];}_0x1d2875['order']=_[_0x6870('0x37')](_0x143344,'-')?_0x6870('0x38'):_0x6870('0x39');return![];});return _0x1d2875;}exports[_0x6870('0x3a')]=getUpdatedSortOptions;function validateSortParameter(_0x109cb9){if(_0x109cb9['includes'](_0x6870('0x30'))&&!_0x109cb9[_0x6870('0x2d')](_0x6870('0x3b'))){var _0x4d7d77=_0x109cb9[_0x6870('0x3c')](0x0,_0x109cb9[_0x6870('0x3d')](_0x6870('0x30')));_0x109cb9+=','+_0x4d7d77+_0x6870('0x3b');}return _0x109cb9;}exports[_0x6870('0x3e')]=validateSortParameter;function sortAgentsByStatus(_0x43c267,_0xea93bc){var _0x4a7fb0=_0x43c267[_0x6870('0x3f')](function(_0x494fb7,_0x701f03){if(_0x494fb7[_0x6870('0x33')]===_0x701f03[_0x6870('0x33')]){if(_0x494fb7['globalStatus']===_0x6870('0x12')){if(_0xea93bc===_0x6870('0x38')){return(_0x494fb7[_0x6870('0x40')]||'')<(_0x701f03[_0x6870('0x40')]||'')||_0x494fb7[_0x6870('0x30')]['toLowerCase']()>_0x701f03[_0x6870('0x30')][_0x6870('0x41')]()?0x1:-0x1;}else{return(_0x494fb7['pauseType']||'')<(_0x701f03[_0x6870('0x40')]||'')||_0x494fb7[_0x6870('0x30')]['toLowerCase']()>_0x701f03[_0x6870('0x30')]['toLowerCase']()?-0x1:0x1;}}else{if(_0xea93bc===_0x6870('0x38')){return _0x494fb7['fullname'][_0x6870('0x41')]()<_0x701f03[_0x6870('0x30')][_0x6870('0x41')]()?0x1:-0x1;}else{return _0x494fb7[_0x6870('0x30')][_0x6870('0x41')]()<_0x701f03[_0x6870('0x30')][_0x6870('0x41')]()?-0x1:0x1;}}}else{if(_0xea93bc===_0x6870('0x38')){return _0x494fb7[_0x6870('0x33')]<_0x701f03['globalStatus']?0x1:-0x1;}else{return _0x494fb7[_0x6870('0x33')]<_0x701f03[_0x6870('0x33')]?-0x1:0x1;}}});return _0x4a7fb0;}exports[_0x6870('0x42')]=sortAgentsByStatus;function filterAgentAttributes(_0x187e70){var _0x1d3778=[_0x6870('0x43'),_0x6870('0x44'),_0x6870('0x45'),'lastPauseAt',_0x6870('0x40'),_0x6870('0x46'),_0x6870('0x3b'),_0x6870('0x47'),_0x6870('0x4'),_0x6870('0x6'),_0x6870('0x5'),_0x6870('0x7'),_0x6870('0x9'),_0x6870('0x31'),_0x6870('0x8'),_0x6870('0x48'),_0x6870('0x49'),'mailCapacity',_0x6870('0x4a'),_0x6870('0x4b'),_0x6870('0x4c'),'chatCurrentCapacity','openchannelCurrentCapacity',_0x6870('0x4d'),_0x6870('0x4e'),_0x6870('0x4f'),'faxCurrentCapacity',_0x6870('0x13'),_0x6870('0x16'),_0x6870('0x15'),'smsStatus','whatsappStatus','faxStatus',_0x6870('0x10'),_0x6870('0x50'),'openchannelStatusTime',_0x6870('0x51'),_0x6870('0x52'),'whatsappStatusTime','faxStatusTime',_0x6870('0x53'),'queue',_0x6870('0x54'),_0x6870('0x55'),_0x6870('0x56'),_0x6870('0x57'),_0x6870('0x58')];var _0x158bd5=[_0x6870('0x4'),_0x6870('0x6'),_0x6870('0x5'),_0x6870('0x7'),_0x6870('0x9'),'faxPause',_0x6870('0x8'),_0x6870('0x44')];var _0x5852a2=_(_0x187e70)[_0x6870('0x59')](_0x158bd5)[_0x6870('0x5a')](_0x1d3778)[_0x6870('0x2a')]();return _0x5852a2;}exports[_0x6870('0x5b')]=filterAgentAttributes; \ No newline at end of file diff --git a/server/components/realtime/queues.js b/server/components/realtime/queues.js index 41795ea..8d6f367 100644 --- a/server/components/realtime/queues.js +++ b/server/components/realtime/queues.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x27be=['erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','voice','request','startCase','error','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','inbound','concat','paused','find','merge','pick','initializeQueues','lodash','jayson/promise','util','client','http','available','loggedIn','waiting','busy','inUse','invalid','loggedInDb','notInUse','ringing','ringInUse','talking','unavailable','unknown','pTalking','originated','message','statusMessage','Trunk','startProgressive','erlangCalls'];(function(_0x372a2f,_0x533bfd){var _0x291e83=function(_0x4d662d){while(--_0x4d662d){_0x372a2f['push'](_0x372a2f['shift']());}};_0x291e83(++_0x533bfd);}(_0x27be,0x167));var _0xe27b=function(_0x4f3463,_0x5a1ee7){_0x4f3463=_0x4f3463-0x0;var _0x5f0e49=_0x27be[_0x4f3463];return _0x5f0e49;};'use strict';var _=require(_0xe27b('0x0'));var jayson=require(_0xe27b('0x1'));var util=require(_0xe27b('0x2'));var amiClient=jayson[_0xe27b('0x3')][_0xe27b('0x4')]({'port':0x232a});var routingClient=jayson[_0xe27b('0x3')][_0xe27b('0x4')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0xe27b('0x5'),_0xe27b('0x6'),'paused',_0xe27b('0x7')];var VOICE_QUEUE_ATTRIBUTES=[_0xe27b('0x8'),_0xe27b('0x9'),_0xe27b('0xa'),_0xe27b('0xb'),_0xe27b('0xc'),'onHold',_0xe27b('0xd'),_0xe27b('0xe'),_0xe27b('0xf'),_0xe27b('0x10'),_0xe27b('0x11')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0xe27b('0x12'),_0xe27b('0x13'),_0xe27b('0x14'),_0xe27b('0x15'),'dialActive','dialMethod',_0xe27b('0x16'),'startPredictive',_0xe27b('0x17'),_0xe27b('0x18'),_0xe27b('0x19'),_0xe27b('0x1a'),_0xe27b('0x1b'),'dialPredictiveInterval',_0xe27b('0x1c'),_0xe27b('0x1d'),_0xe27b('0x1e'),'predictiveIntervalTotalCalls',_0xe27b('0x1f'),_0xe27b('0x20'),'predictiveIntervalDroppedCallsCallersExit',_0xe27b('0x21'),_0xe27b('0x22')];function getRealtimeQueues(_0x500362,_0x55062a){var _0x1e4f42=_0x55062a===_0xe27b('0x23')?amiClient:routingClient;return _0x1e4f42[_0xe27b('0x24')](_[_0xe27b('0x25')](_0x55062a)+'Queues',_0x500362)['then'](function(_0x77af72){if(_0x77af72[_0xe27b('0x26')])throw new Error(util['format'](_0xe27b('0x27'),_0x55062a));return _0x77af72[_0xe27b('0x28')];})['catch'](function(_0x2306ab){throw _0x2306ab;});}exports['getRealtimeQueues']=getRealtimeQueues;function initializeQueues(_0x36fe3c,_0x363171,_0x358655,_0x34e542){var _0x2243b8=DEFAULT_QUEUE_ATTRIBUTES;if(_0x358655===_0xe27b('0x23')){if(_0x34e542===_0xe27b('0x29')){_0x2243b8=_0x2243b8[_0xe27b('0x2a')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x34e542==='outbound'){_0x2243b8=_0x2243b8[_0xe27b('0x2a')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x36fe3c['map'](function(_0x351b70){var _0x18a19d=_0x351b70['get']({'plain':!![]});_0x18a19d[_0xe27b('0x2b')]=0x0;_0x18a19d[_0xe27b('0xb')]=0x0;_0x18a19d[_0xe27b('0x6')]=0x0;_0x18a19d['available']=0x0;_0x18a19d[_0xe27b('0x7')]=0x0;if(_0x358655===_0xe27b('0x23')){_0x18a19d[_0xe27b('0xf')]=0x0;_0x18a19d[_0xe27b('0x8')]=0x0;if(_0x34e542==='outbound'){_0x18a19d['pTalking']=0x0;_0x18a19d['originated']=0x0;}}var _0x2bbaa6=_[_0xe27b('0x2c')](_0x363171,['id',_0x18a19d['id']]);if(_0x2bbaa6){_[_0xe27b('0x2d')](_0x18a19d,_[_0xe27b('0x2e')](_0x2bbaa6,_0x2243b8));}return _0x18a19d;});}exports[_0xe27b('0x2f')]=initializeQueues; \ No newline at end of file +var _0x2ae0=['erlangAbandonmentRate','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','voice','request','Queues','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','catch','getRealtimeQueues','inbound','concat','outbound','map','get','available','busy','pTalking','originated','find','merge','pick','initializeQueues','lodash','jayson/promise','client','http','loggedIn','paused','waiting','invalid','onHold','ringing','talking','unavailable','unknown','message','statusMessage','dialActive','dialMethod','Trunk','erlangCalls','erlangCallToSecond'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x2ae0,0x1ae));var _0x02ae=function(_0x5b78fe,_0x44542c){_0x5b78fe=_0x5b78fe-0x0;var _0x24ac3c=_0x2ae0[_0x5b78fe];return _0x24ac3c;};'use strict';var _=require(_0x02ae('0x0'));var jayson=require(_0x02ae('0x1'));var util=require('util');var amiClient=jayson[_0x02ae('0x2')][_0x02ae('0x3')]({'port':0x232a});var routingClient=jayson[_0x02ae('0x2')]['http']({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=['available',_0x02ae('0x4'),_0x02ae('0x5'),_0x02ae('0x6')];var VOICE_QUEUE_ATTRIBUTES=['busy','inUse',_0x02ae('0x7'),'loggedInDb','notInUse',_0x02ae('0x8'),_0x02ae('0x9'),'ringInUse',_0x02ae('0xa'),_0x02ae('0xb'),_0x02ae('0xc')];var OUTBOUND_QUEUE_ATTRIBUTES=['pTalking','originated',_0x02ae('0xd'),_0x02ae('0xe'),_0x02ae('0xf'),_0x02ae('0x10'),_0x02ae('0x11'),'startPredictive','startProgressive',_0x02ae('0x12'),_0x02ae('0x13'),_0x02ae('0x14'),'erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold',_0x02ae('0x15'),_0x02ae('0x16'),_0x02ae('0x17'),_0x02ae('0x18'),_0x02ae('0x19'),_0x02ae('0x1a'),_0x02ae('0x1b'),_0x02ae('0x1c')];function getRealtimeQueues(_0x3dfa22,_0x2da4f0){var _0x4084cb=_0x2da4f0===_0x02ae('0x1d')?amiClient:routingClient;return _0x4084cb[_0x02ae('0x1e')](_['startCase'](_0x2da4f0)+_0x02ae('0x1f'),_0x3dfa22)['then'](function(_0x2afbe2){if(_0x2afbe2[_0x02ae('0x20')])throw new Error(util[_0x02ae('0x21')](_0x02ae('0x22'),_0x2da4f0));return _0x2afbe2['result'];})[_0x02ae('0x23')](function(_0x28b285){throw _0x28b285;});}exports[_0x02ae('0x24')]=getRealtimeQueues;function initializeQueues(_0x5b395a,_0x3aade9,_0x5c638a,_0x3f9cec){var _0x693989=DEFAULT_QUEUE_ATTRIBUTES;if(_0x5c638a===_0x02ae('0x1d')){if(_0x3f9cec===_0x02ae('0x25')){_0x693989=_0x693989[_0x02ae('0x26')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x3f9cec===_0x02ae('0x27')){_0x693989=_0x693989['concat'](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x5b395a[_0x02ae('0x28')](function(_0x2573d6){var _0xaa97c3=_0x2573d6[_0x02ae('0x29')]({'plain':!![]});_0xaa97c3[_0x02ae('0x5')]=0x0;_0xaa97c3['loggedInDb']=0x0;_0xaa97c3['loggedIn']=0x0;_0xaa97c3[_0x02ae('0x2a')]=0x0;_0xaa97c3[_0x02ae('0x6')]=0x0;if(_0x5c638a===_0x02ae('0x1d')){_0xaa97c3[_0x02ae('0xa')]=0x0;_0xaa97c3[_0x02ae('0x2b')]=0x0;if(_0x3f9cec===_0x02ae('0x27')){_0xaa97c3[_0x02ae('0x2c')]=0x0;_0xaa97c3[_0x02ae('0x2d')]=0x0;}}var _0x52738e=_[_0x02ae('0x2e')](_0x3aade9,['id',_0xaa97c3['id']]);if(_0x52738e){_[_0x02ae('0x2f')](_0xaa97c3,_[_0x02ae('0x30')](_0x52738e,_0x693989));}return _0xaa97c3;});}exports[_0x02ae('0x31')]=initializeQueues; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index c574770..f7277b8 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['root','public','test','join','client','use','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','json','50mb','express','method-override','cookie-parser','errorhandler','passport','cors','./environment','default','get','env','production','set','appPath'];(function(_0x55cffc,_0x96dbf5){var _0x4fd082=function(_0x358eb7){while(--_0x358eb7){_0x55cffc['push'](_0x55cffc['shift']());}};_0x4fd082(++_0x96dbf5);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var express=require(_0x7995('0x0'));var methodOverride=require(_0x7995('0x1'));var cookieParser=require(_0x7995('0x2'));var errorHandler=require(_0x7995('0x3'));var path=require('path');var passport=require(_0x7995('0x4'));var cors=require(_0x7995('0x5'));var config=require(_0x7995('0x6'));exports[_0x7995('0x7')]=function(_0x576d89){var _0x744bea=_0x576d89[_0x7995('0x8')](_0x7995('0x9'));if(_0x744bea===_0x7995('0xa')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path['join'](config[_0x7995('0xd')],_0x7995('0xe')));}if(_0x744bea==='development'||_0x744bea===_0x7995('0xf')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path[_0x7995('0x10')](config[_0x7995('0xd')],_0x7995('0x11')));_0x576d89[_0x7995('0x12')](errorHandler());}_0x576d89['set'](_0x7995('0x13'),function(_0x41c652,_0x581f22){if(this[_0x41c652]instanceof Date){_0x581f22=this[_0x41c652][_0x7995('0x14')]()[_0x7995('0x15')]('.')[0x0]+'Z';}return _0x581f22;});_0x576d89[_0x7995('0x12')](express[_0x7995('0x16')](_0x576d89[_0x7995('0x8')](_0x7995('0xc'))));_0x576d89[_0x7995('0xb')]('views',config['root']+_0x7995('0x17'));_0x576d89[_0x7995('0x18')](_0x7995('0x19'),require(_0x7995('0x1a'))[_0x7995('0x1b')]);_0x576d89[_0x7995('0xb')](_0x7995('0x1c'),_0x7995('0x19'));_0x576d89['use'](express[_0x7995('0x1d')]({'limit':'50mb','extended':!![]}));_0x576d89[_0x7995('0x12')](express[_0x7995('0x1e')]({'limit':_0x7995('0x1f')}));_0x576d89[_0x7995('0x12')](cors());_0x576d89[_0x7995('0x12')](methodOverride());_0x576d89[_0x7995('0x12')](cookieParser());_0x576d89['use'](passport['initialize']());}; \ No newline at end of file +var _0x9957=['root','public','test','join','client','use','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','json','50mb','express','method-override','cookie-parser','errorhandler','passport','cors','./environment','default','get','env','production','set','appPath'];(function(_0x4771a0,_0x45be9d){var _0x440d29=function(_0x56a3c0){while(--_0x56a3c0){_0x4771a0['push'](_0x4771a0['shift']());}};_0x440d29(++_0x45be9d);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var express=require(_0x7995('0x0'));var methodOverride=require(_0x7995('0x1'));var cookieParser=require(_0x7995('0x2'));var errorHandler=require(_0x7995('0x3'));var path=require('path');var passport=require(_0x7995('0x4'));var cors=require(_0x7995('0x5'));var config=require(_0x7995('0x6'));exports[_0x7995('0x7')]=function(_0x576d89){var _0x744bea=_0x576d89[_0x7995('0x8')](_0x7995('0x9'));if(_0x744bea===_0x7995('0xa')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path['join'](config[_0x7995('0xd')],_0x7995('0xe')));}if(_0x744bea==='development'||_0x744bea===_0x7995('0xf')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path[_0x7995('0x10')](config[_0x7995('0xd')],_0x7995('0x11')));_0x576d89[_0x7995('0x12')](errorHandler());}_0x576d89['set'](_0x7995('0x13'),function(_0x41c652,_0x581f22){if(this[_0x41c652]instanceof Date){_0x581f22=this[_0x41c652][_0x7995('0x14')]()[_0x7995('0x15')]('.')[0x0]+'Z';}return _0x581f22;});_0x576d89[_0x7995('0x12')](express[_0x7995('0x16')](_0x576d89[_0x7995('0x8')](_0x7995('0xc'))));_0x576d89[_0x7995('0xb')]('views',config['root']+_0x7995('0x17'));_0x576d89[_0x7995('0x18')](_0x7995('0x19'),require(_0x7995('0x1a'))[_0x7995('0x1b')]);_0x576d89[_0x7995('0xb')](_0x7995('0x1c'),_0x7995('0x19'));_0x576d89['use'](express[_0x7995('0x1d')]({'limit':'50mb','extended':!![]}));_0x576d89[_0x7995('0x12')](express[_0x7995('0x1e')]({'limit':_0x7995('0x1f')}));_0x576d89[_0x7995('0x12')](cors());_0x576d89[_0x7995('0x12')](methodOverride());_0x576d89[_0x7995('0x12')](cookieParser());_0x576d89['use'](passport['initialize']());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index aa76c71..8c60093 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 _0x6682=['getFirstInterface','orderBy','cpus','model','join','createHash','md5','digest','hex','platform','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','macAddress','ipAddress','update','substring','lodash','crypto','bimedia-machine-uuid','child_process','networkInterfaces','keys','length','filter','family','IPv4','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1'];(function(_0x1787fe,_0x2cd61d){var _0x225a39=function(_0x49f562){while(--_0x49f562){_0x1787fe['push'](_0x1787fe['shift']());}};_0x225a39(++_0x2cd61d);}(_0x6682,0x110));var _0x2668=function(_0x397694,_0x4e36ef){_0x397694=_0x397694-0x0;var _0x59dcae=_0x6682[_0x397694];return _0x59dcae;};'use strict';var _=require(_0x2668('0x0'));var os=require('os');var crypto=require(_0x2668('0x1'));var machine=require(_0x2668('0x2'));var exec=require(_0x2668('0x3'))['execSync'];var config=require('../environment');function getInterfaces(){var _0x31020a=[];var _0x345e9f=os[_0x2668('0x4')]();var _0x2ccef1=_['orderBy'](_[_0x2668('0x5')](_0x345e9f));for(var _0x5c92ff=0x0;_0x5c92ff<_0x2ccef1[_0x2668('0x6')];_0x5c92ff++){var _0x36dc2b=_0x345e9f[_0x2ccef1[_0x5c92ff]][_0x2668('0x7')](function(_0x3e2365){return _0x3e2365[_0x2668('0x8')]===_0x2668('0x9')&&_0x3e2365['internal']===![];});_0x31020a=_0x31020a[_0x2668('0xa')](_0x36dc2b);}return _0x31020a;}function getFirstInterface(){var _0x37acc1=_[_0x2668('0xb')](getInterfaces());return{'macAddress':_0x37acc1&&_0x37acc1['mac']?_0x37acc1[_0x2668('0xc')]:_0x2668('0xd'),'ipAddress':_0x37acc1&&_0x37acc1['address']?_0x37acc1[_0x2668('0xe')]:_0x2668('0xf')};}exports[_0x2668('0x10')]=getFirstInterface;function getCPUhash(){var _0x1abad7=_[_0x2668('0x11')](os[_0x2668('0x12')]()['map'](function(_0x1c41e1){return _0x1c41e1[_0x2668('0x13')];}))[_0x2668('0x14')](':');return crypto[_0x2668('0x15')](_0x2668('0x16'))['update'](_0x1abad7)[_0x2668('0x17')](_0x2668('0x18'));}exports['getUuid']=function(){var _0x472692=os[_0x2668('0x19')]();var _0x4e0e63=/[0-9a-f-]{36}/;if(config[_0x2668('0x1a')]&&_0x4e0e63[_0x2668('0x1b')](config[_0x2668('0x1a')])){return config[_0x2668('0x1a')];}else if(_0x472692===_0x2668('0x1c')){return exec(_0x2668('0x1d'),{'encoding':_0x2668('0x1e')})[_0x2668('0x1f')]('\x0d\x0a','');}else{var _0x11aa5b=getFirstInterface();var _0x279f5a=getCPUhash();var _0x2e5c66=_0x279f5a+'|'+os['hostname']()+'|'+_0x11aa5b[_0x2668('0x20')]+'|'+_0x11aa5b[_0x2668('0x21')];var _0x43d99c=crypto[_0x2668('0x15')](_0x2668('0x16'))[_0x2668('0x22')](_0x2e5c66)['digest'](_0x2668('0x18'));return _0x43d99c[_0x2668('0x23')](0x0,0x8)+'-'+_0x43d99c[_0x2668('0x23')](0x8,0xc)+'-'+_0x43d99c[_0x2668('0x23')](0xc,0x10)+'-'+_0x43d99c['substring'](0x10,0x14)+'-'+_0x43d99c[_0x2668('0x23')](0x14);}}; \ No newline at end of file +var _0x5da4=['127.0.0.1','getFirstInterface','cpus','map','model','join','createHash','md5','getUuid','platform','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','ipAddress','digest','hex','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','../environment','networkInterfaces','orderBy','keys','length','filter','family','IPv4','internal','concat','mac','00:00:00:00:00:00','address'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x5da4,0x1c2));var _0x45da=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x5da4[_0x50a0c2];return _0x5ebadd;};'use strict';var _=require(_0x45da('0x0'));var os=require('os');var crypto=require(_0x45da('0x1'));var machine=require(_0x45da('0x2'));var exec=require(_0x45da('0x3'))[_0x45da('0x4')];var config=require(_0x45da('0x5'));function getInterfaces(){var _0x2b942c=[];var _0x391ecd=os[_0x45da('0x6')]();var _0x4a87c7=_[_0x45da('0x7')](_[_0x45da('0x8')](_0x391ecd));for(var _0x1247b7=0x0;_0x1247b7<_0x4a87c7[_0x45da('0x9')];_0x1247b7++){var _0x23f00f=_0x391ecd[_0x4a87c7[_0x1247b7]][_0x45da('0xa')](function(_0x3630af){return _0x3630af[_0x45da('0xb')]===_0x45da('0xc')&&_0x3630af[_0x45da('0xd')]===![];});_0x2b942c=_0x2b942c[_0x45da('0xe')](_0x23f00f);}return _0x2b942c;}function getFirstInterface(){var _0x195f38=_['head'](getInterfaces());return{'macAddress':_0x195f38&&_0x195f38[_0x45da('0xf')]?_0x195f38[_0x45da('0xf')]:_0x45da('0x10'),'ipAddress':_0x195f38&&_0x195f38[_0x45da('0x11')]?_0x195f38[_0x45da('0x11')]:_0x45da('0x12')};}exports[_0x45da('0x13')]=getFirstInterface;function getCPUhash(){var _0x357c70=_[_0x45da('0x7')](os[_0x45da('0x14')]()[_0x45da('0x15')](function(_0x185965){return _0x185965[_0x45da('0x16')];}))[_0x45da('0x17')](':');return crypto[_0x45da('0x18')](_0x45da('0x19'))['update'](_0x357c70)['digest']('hex');}exports[_0x45da('0x1a')]=function(){var _0x33debb=os[_0x45da('0x1b')]();var _0xbc566e=/[0-9a-f-]{36}/;if(config[_0x45da('0x1c')]&&_0xbc566e[_0x45da('0x1d')](config[_0x45da('0x1c')])){return config[_0x45da('0x1c')];}else if(_0x33debb===_0x45da('0x1e')){return exec(_0x45da('0x1f'),{'encoding':_0x45da('0x20')})[_0x45da('0x21')]('\x0d\x0a','');}else{var _0x72b6ac=getFirstInterface();var _0x41c33c=getCPUhash();var _0x4018ef=_0x41c33c+'|'+os[_0x45da('0x22')]()+'|'+_0x72b6ac['macAddress']+'|'+_0x72b6ac[_0x45da('0x23')];var _0x3c027c=crypto[_0x45da('0x18')](_0x45da('0x19'))['update'](_0x4018ef)[_0x45da('0x24')](_0x45da('0x25'));return _0x3c027c[_0x45da('0x26')](0x0,0x8)+'-'+_0x3c027c[_0x45da('0x26')](0x8,0xc)+'-'+_0x3c027c['substring'](0xc,0x10)+'-'+_0x3c027c[_0x45da('0x26')](0x10,0x14)+'-'+_0x3c027c[_0x45da('0x26')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 1b243c1..ac5bb9a 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 _0xac7c=['NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','days','DEMO\x20START\x20AT\x20%s','error','message','finally','getUuid','License','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','moment','request-promise','pkginfo','version','../../mysqldb','../../components/encryptor','../logger','license','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','get','data1','data2','active','info','update','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED'];(function(_0x220dc6,_0x26d143){var _0x109e2e=function(_0x3e9566){while(--_0x3e9566){_0x220dc6['push'](_0x220dc6['shift']());}};_0x109e2e(++_0x26d143);}(_0xac7c,0x152));var _0xcac7=function(_0x235482,_0x14b833){_0x235482=_0x235482-0x0;var _0x5f5bea=_0xac7c[_0x235482];return _0x5f5bea;};'use strict';var util=require('util');var moment=require(_0xcac7('0x0'));var rp=require(_0xcac7('0x1'));var BPromise=require('bluebird');var pkginfo=require(_0xcac7('0x2'))(module,_0xcac7('0x3'));var db=require(_0xcac7('0x4'))['db'];var encryptor=require(_0xcac7('0x5'));var hardware=require('./hardware');var logger=require(_0xcac7('0x6'))(_0xcac7('0x7'));var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x1ed7a3){return new BPromise(function(_0x537a64,_0x24d5f8){var _0x4b1b75=util[_0xcac7('0x8')](_0xcac7('0x9'),HOST,_0x1ed7a3,module[_0xcac7('0xa')]['version']);if(oldToken){_0x4b1b75=util[_0xcac7('0x8')](_0xcac7('0xb'),HOST,_0x1ed7a3,module[_0xcac7('0xa')][_0xcac7('0x3')],oldToken);}var _0xe00c4e={'uri':_0x4b1b75,'method':_0xcac7('0xc'),'timeout':0xea60,'json':!![]};return rp(_0xe00c4e)[_0xcac7('0xd')](function(_0x362b79){_0x537a64(_0x362b79);})[_0xcac7('0xe')](function(_0x1edca1){_0x24d5f8(_0x1edca1);});});}function manageLicense(_0x45b93c,_0x36f1ab){var _0x313267=_0x36f1ab[_0xcac7('0xf')]({'plain':!![]});if(!isOldTokenSent&&_0x313267[_0xcac7('0x10')]!==_0x45b93c&&!_0x313267[_0xcac7('0x11')]){oldToken=_0x313267['data1'];}httpRequest(_0x45b93c)[_0xcac7('0xd')](function(_0x579ca8){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x579ca8[_0xcac7('0x12')]){isOldTokenSent=![];if(!_0x313267[_0xcac7('0x7')]&&_0x313267['license']!=_0x579ca8[_0xcac7('0x7')]||_0x313267[_0xcac7('0x7')]&&_0x313267[_0xcac7('0x11')]){logger[_0xcac7('0x13')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x313267[_0xcac7('0x7')]&&!_0x313267[_0xcac7('0x11')]&&_0x313267['license']!=_0x579ca8[_0xcac7('0x7')]){logger[_0xcac7('0x13')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x313267[_0xcac7('0x7')]&&!_0x313267['data2']&&_0x313267[_0xcac7('0x7')]==_0x579ca8[_0xcac7('0x7')]){return _0x36f1ab;}return _0x36f1ab[_0xcac7('0x14')]({'data1':_0x45b93c,'data2':null,'license':_0x579ca8[_0xcac7('0x7')]});}else{if(_0x579ca8[_0xcac7('0x7')]||_0x313267[_0xcac7('0x7')]){if(!_0x313267[_0xcac7('0x11')]){if(_0x313267[_0xcac7('0x10')]==_0x45b93c){GRAY_PERIOD_REASON='Disabled';logger[_0xcac7('0x13')](_0xcac7('0x15'));}else{GRAY_PERIOD_REASON='Changed';logger[_0xcac7('0x13')](_0xcac7('0x16'),_0x313267[_0xcac7('0x10')],_0x45b93c);}logger[_0xcac7('0x13')](_0xcac7('0x17'),GRAY_PERIOD_REASON[_0xcac7('0x18')](),moment()['format'](_0xcac7('0x19')));return _0x36f1ab[_0xcac7('0x14')]({'data2':encryptor['encryptString'](moment()[_0xcac7('0x8')](_0xcac7('0x19')))});}else{if(moment()['diff'](encryptor['decryptString'](_0x313267[_0xcac7('0x11')]),_0xcac7('0x1a'))>DAYS){logger[_0xcac7('0x13')](_0xcac7('0x1b'),moment()[_0xcac7('0x8')](_0xcac7('0x19')));isOldTokenSent=![];return _0x36f1ab[_0xcac7('0x14')]({'data1':_0x45b93c,'data2':null,'license':null});}}}else{if(_0x313267['data1']!=_0x45b93c){logger[_0xcac7('0x13')](_0xcac7('0x16'),_0x313267[_0xcac7('0x10')],_0x45b93c);return _0x36f1ab[_0xcac7('0x14')]({'data1':_0x45b93c,'data2':null,'license':null});}}}return _0x36f1ab;})['then'](function(_0x2c7797){_0x36f1ab=_0x2c7797;})['catch'](function(_0x130362){logger[_0xcac7('0x1c')](_0x130362[_0xcac7('0x1d')]);})[_0xcac7('0x1e')](function(){setTimeout(function(){manageLicense(hardware[_0xcac7('0x1f')](),_0x36f1ab);},TIME);});}function defaultLicense(){var _0x168427=hardware[_0xcac7('0x1f')]();if(_0x168427){return db[_0xcac7('0x20')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x168427}})[_0xcac7('0x21')](function(_0x15d6c8,_0x45044b){logger[_0xcac7('0x13')](_0xcac7('0x22'),_0x168427);manageLicense(_0x168427,_0x15d6c8);})[_0xcac7('0xe')](function(_0x698104){logger[_0xcac7('0x1c')](_0x698104[_0xcac7('0x1d')]);});}}exports[_0xcac7('0x23')]=defaultLicense; \ No newline at end of file +var _0x8276=['decryptString','DEMO\x20START\x20AT\x20%s','error','finally','getUuid','License','spread','message','default','moment','request-promise','pkginfo','version','../../mysqldb','../../components/encryptor','./hardware','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','catch','get','data1','data2','then','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','diff'];(function(_0x2eb89f,_0x16924f){var _0x48f1b3=function(_0x4655b8){while(--_0x4655b8){_0x2eb89f['push'](_0x2eb89f['shift']());}};_0x48f1b3(++_0x16924f);}(_0x8276,0x1d1));var _0x6827=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8276[_0x321bb2];return _0x9c12ed;};'use strict';var util=require('util');var moment=require(_0x6827('0x0'));var rp=require(_0x6827('0x1'));var BPromise=require('bluebird');var pkginfo=require(_0x6827('0x2'))(module,_0x6827('0x3'));var db=require(_0x6827('0x4'))['db'];var encryptor=require(_0x6827('0x5'));var hardware=require(_0x6827('0x6'));var logger=require(_0x6827('0x7'))(_0x6827('0x8'));var HOST=_0x6827('0x9');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x1c4d1d){return new BPromise(function(_0x55781f,_0x1bafaa){var _0x8c9e3a=util[_0x6827('0xa')](_0x6827('0xb'),HOST,_0x1c4d1d,module[_0x6827('0xc')]['version']);if(oldToken){_0x8c9e3a=util[_0x6827('0xa')](_0x6827('0xd'),HOST,_0x1c4d1d,module[_0x6827('0xc')][_0x6827('0x3')],oldToken);}var _0x4d6705={'uri':_0x8c9e3a,'method':_0x6827('0xe'),'timeout':0xea60,'json':!![]};return rp(_0x4d6705)['then'](function(_0x199c63){_0x55781f(_0x199c63);})[_0x6827('0xf')](function(_0x3465a2){_0x1bafaa(_0x3465a2);});});}function manageLicense(_0x3cfce3,_0x4d66b6){var _0xc9d753=_0x4d66b6[_0x6827('0x10')]({'plain':!![]});if(!isOldTokenSent&&_0xc9d753[_0x6827('0x11')]!==_0x3cfce3&&!_0xc9d753[_0x6827('0x12')]){oldToken=_0xc9d753[_0x6827('0x11')];}httpRequest(_0x3cfce3)[_0x6827('0x13')](function(_0x631917){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x631917['active']){isOldTokenSent=![];if(!_0xc9d753[_0x6827('0x8')]&&_0xc9d753[_0x6827('0x8')]!=_0x631917[_0x6827('0x8')]||_0xc9d753[_0x6827('0x8')]&&_0xc9d753['data2']){logger[_0x6827('0x14')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0xc9d753[_0x6827('0x8')]&&!_0xc9d753[_0x6827('0x12')]&&_0xc9d753[_0x6827('0x8')]!=_0x631917[_0x6827('0x8')]){logger[_0x6827('0x14')](_0x6827('0x15'));}if(_0xc9d753[_0x6827('0x8')]&&!_0xc9d753[_0x6827('0x12')]&&_0xc9d753[_0x6827('0x8')]==_0x631917[_0x6827('0x8')]){return _0x4d66b6;}return _0x4d66b6[_0x6827('0x16')]({'data1':_0x3cfce3,'data2':null,'license':_0x631917[_0x6827('0x8')]});}else{if(_0x631917['license']||_0xc9d753[_0x6827('0x8')]){if(!_0xc9d753[_0x6827('0x12')]){if(_0xc9d753[_0x6827('0x11')]==_0x3cfce3){GRAY_PERIOD_REASON=_0x6827('0x17');logger[_0x6827('0x14')](_0x6827('0x18'));}else{GRAY_PERIOD_REASON='Changed';logger['info'](_0x6827('0x19'),_0xc9d753['data1'],_0x3cfce3);}logger[_0x6827('0x14')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0x6827('0x1a')](),moment()['format'](_0x6827('0x1b')));return _0x4d66b6['update']({'data2':encryptor['encryptString'](moment()[_0x6827('0xa')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0x6827('0x1c')](encryptor[_0x6827('0x1d')](_0xc9d753[_0x6827('0x12')]),'days')>DAYS){logger[_0x6827('0x14')](_0x6827('0x1e'),moment()[_0x6827('0xa')](_0x6827('0x1b')));isOldTokenSent=![];return _0x4d66b6[_0x6827('0x16')]({'data1':_0x3cfce3,'data2':null,'license':null});}}}else{if(_0xc9d753[_0x6827('0x11')]!=_0x3cfce3){logger['info'](_0x6827('0x19'),_0xc9d753[_0x6827('0x11')],_0x3cfce3);return _0x4d66b6[_0x6827('0x16')]({'data1':_0x3cfce3,'data2':null,'license':null});}}}return _0x4d66b6;})['then'](function(_0xb1d423){_0x4d66b6=_0xb1d423;})[_0x6827('0xf')](function(_0x701c78){logger[_0x6827('0x1f')](_0x701c78['message']);})[_0x6827('0x20')](function(){setTimeout(function(){manageLicense(hardware[_0x6827('0x21')](),_0x4d66b6);},TIME);});}function defaultLicense(){var _0x3e16ac=hardware[_0x6827('0x21')]();if(_0x3e16ac){return db[_0x6827('0x22')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x3e16ac}})[_0x6827('0x23')](function(_0x3e9de6,_0x181d48){logger['info']('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x3e16ac);manageLicense(_0x3e16ac,_0x3e9de6);})['catch'](function(_0x2d11fc){logger[_0x6827('0x1f')](_0x2d11fc[_0x6827('0x24')]);});}}exports[_0x6827('0x25')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 6477094..a8123b0 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 _0xbea5=['./hardware','../../components/encryptor','2027-01-01T00:00:00.000Z','getUuid','License','find','defaults','then','uuid','data1','license','isEmpty','data2','split','decryptString','format','%s:%s:%s','demo','gray','deadline','add','days','grayReason','machineUuid','changed','message','User','findAll','role','sequelize','COUNT','count','admin','telephone','telephones','forEach','user','catch','pick','countBy','License\x20limit\x20reached\x20for\x20users','util','lodash','moment','bluebird'];(function(_0x2aeb9e,_0x5c4b49){var _0x50e8da=function(_0xfeaefa){while(--_0xfeaefa){_0x2aeb9e['push'](_0x2aeb9e['shift']());}};_0x50e8da(++_0x5c4b49);}(_0xbea5,0x137));var _0x5bea=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xbea5[_0xbb091];return _0x467a04;};'use strict';var util=require(_0x5bea('0x0'));var _=require(_0x5bea('0x1'));var moment=require(_0x5bea('0x2'));var BPromise=require(_0x5bea('0x3'));var hardware=require(_0x5bea('0x4'));var encryptor=require(_0x5bea('0x5'));var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x5bea('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware[_0x5bea('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x5bea('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware[_0x5bea('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x93310a){return new BPromise(function(_0x455b11,_0x20fa87){return db[_0x5bea('0x8')][_0x5bea('0x9')](_[_0x5bea('0xa')](_0x93310a,{'raw':!![],'where':{'id':0x1}}))[_0x5bea('0xb')](function(_0x3424f4){return checkLicense(_0x3424f4,null);})['then'](function(_0x4b1f9d){_0x455b11(_0x4b1f9d);return;})['catch'](function(_0x3a6137){_0x20fa87(_0x3a6137);});});}function checkLicense(_0x307e36,_0x2823f4){if(!_0x307e36){demoLicense[_0x5bea('0xc')]=_0x307e36[_0x5bea('0xd')];return demoLicense;}try{var _0x3ebc3e=_0x2823f4||_0x307e36[_0x5bea('0xe')];if(_[_0x5bea('0xf')](_0x3ebc3e)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x2417db=_0x307e36[_0x5bea('0xd')];var _0x26894c=_0x307e36[_0x5bea('0x10')];var _0x24eeb0=_0x2417db[_0x5bea('0x11')]('-')[0x4];var _0x2ee0e7=_0x2417db[_0x5bea('0x11')]('-')[0x0];var _0xfbe259=encryptor[_0x5bea('0x12')](_0x3ebc3e,util[_0x5bea('0x13')](_0x5bea('0x14'),_0x24eeb0,_0x2417db,_0x2ee0e7));var _0x43fc5c=JSON['parse'](_0xfbe259);_0x43fc5c[_0x5bea('0x15')]=![];_0x43fc5c[_0x5bea('0xc')]=_0x2417db;_0x43fc5c['machineUuid']=hardware[_0x5bea('0x7')]();if(_0x26894c){var _0x197575=encryptor[_0x5bea('0x12')](_0x26894c);_0x43fc5c[_0x5bea('0x16')]=_0x197575;_0x43fc5c[_0x5bea('0x17')]=moment(_0x197575)[_0x5bea('0x18')](0x7,_0x5bea('0x19'))[_0x5bea('0x13')]();_0x43fc5c[_0x5bea('0x1a')]=_0x43fc5c[_0x5bea('0xc')]!=_0x43fc5c[_0x5bea('0x1b')]?_0x5bea('0x1c'):'disabled';}return _0x43fc5c;}catch(_0x3189cb){breakingLicense[_0x5bea('0xc')]=_0x307e36[_0x5bea('0xd')];breakingLicense['message']=_0x3189cb[_0x5bea('0x1d')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x34efae,_0x490d09){getLicense()['then'](function(_0xd7017a){return db[_0x5bea('0x1e')][_0x5bea('0x1f')]({'attributes':[_0x5bea('0x20'),[db[_0x5bea('0x21')]['fn'](_0x5bea('0x22'),db['sequelize']['col']('role')),_0x5bea('0x23')]],'group':_0x5bea('0x20'),'where':{'role':{'$or':[_0x5bea('0x24'),'user',_0x5bea('0x25')]}},'raw':!![]})['then'](function(_0x1ed5f5){var _0x4f1390={'user':_0xd7017a['users']||0x0,'telephone':_0xd7017a[_0x5bea('0x26')]||0x0};_0x1ed5f5[_0x5bea('0x27')](function(_0x4cf7a3){var _0x37fcd8=_0x4cf7a3[_0x5bea('0x20')]===_0x5bea('0x24')?_0x5bea('0x28'):_0x4cf7a3[_0x5bea('0x20')];_0x4f1390[_0x37fcd8]-=_0x4cf7a3[_0x5bea('0x23')];if(_0x4f1390[_0x37fcd8]<0x0)_0x4f1390[_0x37fcd8]=0x0;});_0x34efae(_0x4f1390);return;});})[_0x5bea('0x29')](function(_0x44f73d){_0x490d09(_0x44f73d);});});}function checkUserLimits(_0x1fa42d){return new BPromise(function(_0x66748d,_0xc5d54e){getLimits()[_0x5bea('0xb')](function(_0x358250){var _0xeab7db=_[_0x5bea('0x2a')](_[_0x5bea('0x2b')](_0x1fa42d,_0x5bea('0x20')),[_0x5bea('0x24'),_0x5bea('0x28'),_0x5bea('0x25')]);var _0x133fc3=(_0xeab7db[_0x5bea('0x24')]||0x0)+(_0xeab7db[_0x5bea('0x28')]||0x0);var _0x1f0220=_0xeab7db[_0x5bea('0x25')]||0x0;if(_0x133fc3>_0x358250[_0x5bea('0x28')])return _0xc5d54e(_0x5bea('0x2c'));if(_0x1f0220>_0x358250[_0x5bea('0x25')])return _0xc5d54e('License\x20limit\x20reached\x20for\x20telephones');return _0x66748d();})[_0x5bea('0x29')](function(_0x545047){_0xc5d54e(_0x545047);});});}module['exports']={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x5480=['demo','gray','deadline','add','days','grayReason','changed','disabled','message','User','findAll','role','COUNT','col','count','admin','user','then','users','telephones','forEach','catch','countBy','telephone','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','moment','bluebird','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','getUuid','Breaking\x20license','License','find','defaults','uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','split','decryptString','format','%s:%s:%s','parse'];(function(_0x2067da,_0x231256){var _0x348f8b=function(_0x4d1bc6){while(--_0x4d1bc6){_0x2067da['push'](_0x2067da['shift']());}};_0x348f8b(++_0x231256);}(_0x5480,0xdb));var _0x0548=function(_0x4bc65f,_0x39ec43){_0x4bc65f=_0x4bc65f-0x0;var _0x44f85f=_0x5480[_0x4bc65f];return _0x44f85f;};'use strict';var util=require(_0x0548('0x0'));var _=require('lodash');var moment=require(_0x0548('0x1'));var BPromise=require(_0x0548('0x2'));var hardware=require('./hardware');var encryptor=require(_0x0548('0x3'));var db=require(_0x0548('0x4'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x0548('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware[_0x0548('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x0548('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x0548('0x7'),'machineUuid':hardware[_0x0548('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x1deb58){return new BPromise(function(_0x2f6aac,_0x33950b){return db[_0x0548('0x8')][_0x0548('0x9')](_[_0x0548('0xa')](_0x1deb58,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x172fd5){return checkLicense(_0x172fd5,null);})['then'](function(_0x59bf0e){_0x2f6aac(_0x59bf0e);return;})['catch'](function(_0x3fc521){_0x33950b(_0x3fc521);});});}function checkLicense(_0x15c726,_0x1b8e05){if(!_0x15c726){demoLicense[_0x0548('0xb')]=_0x15c726[_0x0548('0xc')];return demoLicense;}try{var _0x1a3639=_0x1b8e05||_0x15c726[_0x0548('0xd')];if(_[_0x0548('0xe')](_0x1a3639)){throw new Error(_0x0548('0xf'));}var _0x5a145b=_0x15c726[_0x0548('0xc')];var _0x431c33=_0x15c726['data2'];var _0x2f4cbe=_0x5a145b[_0x0548('0x10')]('-')[0x4];var _0x1abf06=_0x5a145b['split']('-')[0x0];var _0x1178fd=encryptor[_0x0548('0x11')](_0x1a3639,util[_0x0548('0x12')](_0x0548('0x13'),_0x2f4cbe,_0x5a145b,_0x1abf06));var _0x1b05ea=JSON[_0x0548('0x14')](_0x1178fd);_0x1b05ea[_0x0548('0x15')]=![];_0x1b05ea[_0x0548('0xb')]=_0x5a145b;_0x1b05ea['machineUuid']=hardware['getUuid']();if(_0x431c33){var _0x1d9e38=encryptor[_0x0548('0x11')](_0x431c33);_0x1b05ea[_0x0548('0x16')]=_0x1d9e38;_0x1b05ea[_0x0548('0x17')]=moment(_0x1d9e38)[_0x0548('0x18')](0x7,_0x0548('0x19'))[_0x0548('0x12')]();_0x1b05ea[_0x0548('0x1a')]=_0x1b05ea[_0x0548('0xb')]!=_0x1b05ea['machineUuid']?_0x0548('0x1b'):_0x0548('0x1c');}return _0x1b05ea;}catch(_0x3ca63b){breakingLicense['uuid']=_0x15c726[_0x0548('0xc')];breakingLicense[_0x0548('0x1d')]=_0x3ca63b[_0x0548('0x1d')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x20e044,_0x5b81cc){getLicense()['then'](function(_0x550785){return db[_0x0548('0x1e')][_0x0548('0x1f')]({'attributes':[_0x0548('0x20'),[db['sequelize']['fn'](_0x0548('0x21'),db['sequelize'][_0x0548('0x22')](_0x0548('0x20'))),_0x0548('0x23')]],'group':'role','where':{'role':{'$or':[_0x0548('0x24'),_0x0548('0x25'),'telephone']}},'raw':!![]})[_0x0548('0x26')](function(_0x4145c6){var _0x5b7cc1={'user':_0x550785[_0x0548('0x27')]||0x0,'telephone':_0x550785[_0x0548('0x28')]||0x0};_0x4145c6[_0x0548('0x29')](function(_0x3bbb8f){var _0x36dde6=_0x3bbb8f['role']==='admin'?_0x0548('0x25'):_0x3bbb8f[_0x0548('0x20')];_0x5b7cc1[_0x36dde6]-=_0x3bbb8f[_0x0548('0x23')];if(_0x5b7cc1[_0x36dde6]<0x0)_0x5b7cc1[_0x36dde6]=0x0;});_0x20e044(_0x5b7cc1);return;});})[_0x0548('0x2a')](function(_0x1c56f6){_0x5b81cc(_0x1c56f6);});});}function checkUserLimits(_0x1ba532){return new BPromise(function(_0x425d7d,_0x208680){getLimits()[_0x0548('0x26')](function(_0x409aa4){var _0x3ea0d3=_['pick'](_[_0x0548('0x2b')](_0x1ba532,_0x0548('0x20')),[_0x0548('0x24'),_0x0548('0x25'),_0x0548('0x2c')]);var _0x70d57e=(_0x3ea0d3[_0x0548('0x24')]||0x0)+(_0x3ea0d3[_0x0548('0x25')]||0x0);var _0x3e6832=_0x3ea0d3[_0x0548('0x2c')]||0x0;if(_0x70d57e>_0x409aa4[_0x0548('0x25')])return _0x208680(_0x0548('0x2d'));if(_0x3e6832>_0x409aa4['telephone'])return _0x208680(_0x0548('0x2e'));return _0x425d7d();})[_0x0548('0x2a')](function(_0x34c499){_0x208680(_0x34c499);});});}module[_0x0548('0x2f')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index 1a19e4e..410d490 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 _0xb10b=['app-id','secret','exports','myappanuglar-secret'];(function(_0x184770,_0x200315){var _0x469ef3=function(_0x187d1f){while(--_0x187d1f){_0x184770['push'](_0x184770['shift']());}};_0x469ef3(++_0x200315);}(_0xb10b,0x12a));var _0xbb10=function(_0x1d4663,_0x17cb51){_0x1d4663=_0x1d4663-0x0;var _0x581eb5=_0xb10b[_0x1d4663];return _0x581eb5;};'use strict';module[_0xbb10('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0xbb10('0x1'),'GOOGLE_ID':_0xbb10('0x2'),'GOOGLE_SECRET':_0xbb10('0x3'),'DEBUG':''}; \ No newline at end of file +var _0x1c9a=['myappanuglar-secret','secret','exports'];(function(_0x50eccf,_0x5d6c0b){var _0x14a93b=function(_0xd98995){while(--_0xd98995){_0x50eccf['push'](_0x50eccf['shift']());}};_0x14a93b(++_0x5d6c0b);}(_0x1c9a,0x98));var _0xa1c9=function(_0x583662,_0x4cf2ab){_0x583662=_0x583662-0x0;var _0x229062=_0x1c9a[_0x583662];return _0x229062;};'use strict';module[_0xa1c9('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0xa1c9('0x1'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':_0xa1c9('0x2'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 7a27258..d3ee5e6 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3f17=['exports','../utils/loggers','fileLogger'];(function(_0x2e6f20,_0x4b5265){var _0xd9fd0e=function(_0xc42887){while(--_0xc42887){_0x2e6f20['push'](_0x2e6f20['shift']());}};_0xd9fd0e(++_0x4b5265);}(_0x3f17,0x14e));var _0x73f1=function(_0x3bd9c2,_0x555788){_0x3bd9c2=_0x3bd9c2-0x0;var _0x22f804=_0x3f17[_0x3bd9c2];return _0x22f804;};'use strict';var fileLogger=require(_0x73f1('0x0'))[_0x73f1('0x1')];module[_0x73f1('0x2')]=fileLogger; \ No newline at end of file +var _0xa5e7=['../utils/loggers','exports'];(function(_0x7da6e8,_0x4756af){var _0x3e1217=function(_0x1507f1){while(--_0x1507f1){_0x7da6e8['push'](_0x7da6e8['shift']());}};_0x3e1217(++_0x4756af);}(_0xa5e7,0x86));var _0x7a5e=function(_0x4a1822,_0x722bc9){_0x4a1822=_0x4a1822-0x0;var _0x3eebb0=_0xa5e7[_0x4a1822];return _0x3eebb0;};'use strict';var fileLogger=require(_0x7a5e('0x0'))['fileLogger'];module[_0x7a5e('0x1')]=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index beb2444..3773a49 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 _0xf240=['../../services/xdr/index.js','../../config/environment','resolve','join','root','legacy-libs','express','ami','../../services/ami/index.js','agi','email','../../services/email/index.js','routing','xdr'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0xf240,0xc5));var _0x0f24=function(_0x3098ea,_0x3a3a44){_0x3098ea=_0x3098ea-0x0;var _0x312f0d=_0xf240[_0x3098ea];return _0x312f0d;};'use strict';var path=require('path');var cfg=require(_0x0f24('0x0'));var env={'NODE_PATH':path[_0x0f24('0x1')](path[_0x0f24('0x2')](cfg[_0x0f24('0x3')],_0x0f24('0x4')))};var pm2config={'apps':[{'name':_0x0f24('0x5'),'script':path[_0x0f24('0x2')](__dirname,'../../services/express/index.js'),'env':env},{'name':_0x0f24('0x6'),'script':path[_0x0f24('0x2')](__dirname,_0x0f24('0x7')),'env':env},{'name':_0x0f24('0x8'),'script':path[_0x0f24('0x2')](__dirname,'../../services/agi/index.js'),'env':env},{'name':_0x0f24('0x9'),'script':path[_0x0f24('0x2')](__dirname,_0x0f24('0xa')),'env':env},{'name':_0x0f24('0xb'),'script':path[_0x0f24('0x2')](__dirname,'../../services/routing/index.js'),'env':env},{'name':_0x0f24('0xc'),'script':path[_0x0f24('0x2')](__dirname,_0x0f24('0xd')),'env':env}]};module['exports']=pm2config; \ No newline at end of file +var _0x7c81=['../../services/email/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','path','../../config/environment','join','root','legacy-libs','express','ami','../../services/ami/index.js','email'];(function(_0x32905d,_0x2ed18c){var _0x2c3f12=function(_0x2a478b){while(--_0x2a478b){_0x32905d['push'](_0x32905d['shift']());}};_0x2c3f12(++_0x2ed18c);}(_0x7c81,0x171));var _0x17c8=function(_0x296144,_0x26bbbf){_0x296144=_0x296144-0x0;var _0x5329b1=_0x7c81[_0x296144];return _0x5329b1;};'use strict';var path=require(_0x17c8('0x0'));var cfg=require(_0x17c8('0x1'));var env={'NODE_PATH':path['resolve'](path[_0x17c8('0x2')](cfg[_0x17c8('0x3')],_0x17c8('0x4')))};var pm2config={'apps':[{'name':_0x17c8('0x5'),'script':path['join'](__dirname,'../../services/express/index.js'),'env':env},{'name':_0x17c8('0x6'),'script':path[_0x17c8('0x2')](__dirname,_0x17c8('0x7')),'env':env},{'name':'agi','script':path[_0x17c8('0x2')](__dirname,'../../services/agi/index.js'),'env':env},{'name':_0x17c8('0x8'),'script':path[_0x17c8('0x2')](__dirname,_0x17c8('0x9')),'env':env},{'name':_0x17c8('0xa'),'script':path[_0x17c8('0x2')](__dirname,_0x17c8('0xb')),'env':env},{'name':_0x17c8('0xc'),'script':path[_0x17c8('0x2')](__dirname,_0x17c8('0xd')),'env':env}]};module['exports']=pm2config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 304d481..deb443d 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 _0x4514=['delete','dump','saved','bluebird','./config','connect','start','then','disconnect','stop','restart','list','describe'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x4514,0xfa));var _0x4451=function(_0x4b72fb,_0x4bb164){_0x4b72fb=_0x4b72fb-0x0;var _0x24d70f=_0x4514[_0x4b72fb];return _0x24d70f;};'use strict';var pm2=require('pm2');var BPromise=require(_0x4451('0x0'));var config=require(_0x4451('0x1'));function connect(){return new BPromise(function(_0x25e9eb,_0x258f90){return pm2[_0x4451('0x2')](function(_0x1bfd50){if(_0x1bfd50){return _0x258f90(_0x1bfd50);}return _0x25e9eb('connected');});});};exports[_0x4451('0x3')]=function(_0x48301c){return connect()[_0x4451('0x4')](function(){return new BPromise(function(_0x31cf58,_0x507fb2){return pm2['start'](_0x48301c,function(_0x35a272,_0x13ba3c){if(_0x35a272){return _0x507fb2(_0x35a272);}pm2[_0x4451('0x5')]();return _0x31cf58(_0x13ba3c);});});});};exports[_0x4451('0x6')]=function(_0x4dfaef){return connect()['then'](function(){return new BPromise(function(_0x3bbefd,_0x421b41){return pm2[_0x4451('0x6')](_0x4dfaef,function(_0x209a31,_0xb0ea0a){if(_0x209a31){return _0x421b41(_0x209a31);}pm2[_0x4451('0x5')]();return _0x3bbefd(_0xb0ea0a);});});});};exports[_0x4451('0x7')]=function(_0x101ea2){return connect()[_0x4451('0x4')](function(){return new BPromise(function(_0x319c91,_0xfdaaf9){return pm2[_0x4451('0x7')](_0x101ea2,function(_0x27dbe0,_0x27dd33){if(_0x27dbe0){return _0xfdaaf9(_0x27dbe0);}pm2[_0x4451('0x5')]();return _0x319c91(_0x27dd33);});});});};exports[_0x4451('0x8')]=function(){return connect()[_0x4451('0x4')](function(){return new BPromise(function(_0x2e651b,_0x8765d3){return pm2[_0x4451('0x8')](function(_0x528ba6,_0x47e720){if(_0x528ba6){return _0x8765d3(_0x528ba6);}pm2['disconnect']();return _0x2e651b(_0x47e720);});});});};exports[_0x4451('0x9')]=function(_0x2196ea){return connect()[_0x4451('0x4')](function(){return new BPromise(function(_0x4eb4e3,_0x13b8d3){return pm2[_0x4451('0x9')](_0x2196ea,function(_0x10a083,_0x1f35d4){if(_0x10a083){return _0x13b8d3(_0x10a083);}pm2[_0x4451('0x5')]();return _0x4eb4e3(_0x1f35d4);});});});};exports[_0x4451('0xa')]=function(_0x523d80){return connect()[_0x4451('0x4')](function(){return new BPromise(function(_0x5cc38a,_0x34686a){return pm2['delete'](_0x523d80,function(_0xeda98b,_0x1de373){if(_0xeda98b){return _0x34686a(_0xeda98b);}pm2[_0x4451('0x5')]();return _0x5cc38a(_0x1de373);});});});};exports[_0x4451('0xb')]=function(){return connect()[_0x4451('0x4')](function(){return new BPromise(function(_0x41c74c,_0x56929d){return pm2[_0x4451('0xb')](function(_0x3ff97c){if(_0x3ff97c){return _0x56929d(_0x3ff97c);}return _0x41c74c(_0x4451('0xc'));});});});}; \ No newline at end of file +var _0xb85d=['pm2','bluebird','./config','start','then','stop','disconnect','restart','list','describe','delete','dump','saved'];(function(_0x1c12bd,_0x348360){var _0x1de620=function(_0x2ab4d5){while(--_0x2ab4d5){_0x1c12bd['push'](_0x1c12bd['shift']());}};_0x1de620(++_0x348360);}(_0xb85d,0xb6));var _0xdb85=function(_0x42449d,_0x5780c9){_0x42449d=_0x42449d-0x0;var _0x4c24c8=_0xb85d[_0x42449d];return _0x4c24c8;};'use strict';var pm2=require(_0xdb85('0x0'));var BPromise=require(_0xdb85('0x1'));var config=require(_0xdb85('0x2'));function connect(){return new BPromise(function(_0x22bd95,_0x4b3f62){return pm2['connect'](function(_0x49b4d5){if(_0x49b4d5){return _0x4b3f62(_0x49b4d5);}return _0x22bd95('connected');});});};exports[_0xdb85('0x3')]=function(_0x97c3ce){return connect()['then'](function(){return new BPromise(function(_0x5e6e0d,_0xd83672){return pm2[_0xdb85('0x3')](_0x97c3ce,function(_0x2617b7,_0x31697c){if(_0x2617b7){return _0xd83672(_0x2617b7);}pm2['disconnect']();return _0x5e6e0d(_0x31697c);});});});};exports['stop']=function(_0x1dbe59){return connect()[_0xdb85('0x4')](function(){return new BPromise(function(_0x1331af,_0x272ff6){return pm2[_0xdb85('0x5')](_0x1dbe59,function(_0xa80dcf,_0x596382){if(_0xa80dcf){return _0x272ff6(_0xa80dcf);}pm2[_0xdb85('0x6')]();return _0x1331af(_0x596382);});});});};exports[_0xdb85('0x7')]=function(_0x41492b){return connect()[_0xdb85('0x4')](function(){return new BPromise(function(_0x6e1f13,_0x59684a){return pm2[_0xdb85('0x7')](_0x41492b,function(_0x13d888,_0x45cc3f){if(_0x13d888){return _0x59684a(_0x13d888);}pm2[_0xdb85('0x6')]();return _0x6e1f13(_0x45cc3f);});});});};exports[_0xdb85('0x8')]=function(){return connect()[_0xdb85('0x4')](function(){return new BPromise(function(_0x5a9225,_0x1bd0ce){return pm2[_0xdb85('0x8')](function(_0x179406,_0x23fd15){if(_0x179406){return _0x1bd0ce(_0x179406);}pm2[_0xdb85('0x6')]();return _0x5a9225(_0x23fd15);});});});};exports[_0xdb85('0x9')]=function(_0x61f79e){return connect()[_0xdb85('0x4')](function(){return new BPromise(function(_0x481f35,_0x513ef3){return pm2[_0xdb85('0x9')](_0x61f79e,function(_0x444165,_0x2b3f08){if(_0x444165){return _0x513ef3(_0x444165);}pm2[_0xdb85('0x6')]();return _0x481f35(_0x2b3f08);});});});};exports[_0xdb85('0xa')]=function(_0x311a0d){return connect()[_0xdb85('0x4')](function(){return new BPromise(function(_0x20a315,_0x2d86dd){return pm2[_0xdb85('0xa')](_0x311a0d,function(_0x3a298e,_0x48fc2e){if(_0x3a298e){return _0x2d86dd(_0x3a298e);}pm2['disconnect']();return _0x20a315(_0x48fc2e);});});});};exports[_0xdb85('0xb')]=function(){return connect()[_0xdb85('0x4')](function(){return new BPromise(function(_0x612f2a,_0x29993d){return pm2['dump'](function(_0x29f361){if(_0x29f361){return _0x29993d(_0x29f361);}return _0x612f2a(_0xdb85('0xc'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 31746fd..3a9bcf4 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 _0x05d3=['start','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','schedule','redis','defaults','localhost','Setting','then','ChatInteraction','findAll','lastMsgAt','chatTimeout','minutes','info','join','system','timeout','format','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','length','emit','chatInteraction:update','error'];(function(_0x20c9b2,_0x55d7b1){var _0x2c6030=function(_0x10845f){while(--_0x10845f){_0x20c9b2['push'](_0x20c9b2['shift']());}};_0x2c6030(++_0x55d7b1);}(_0x05d3,0x1a5));var _0x305d=function(_0x36c6eb,_0x4fb127){_0x36c6eb=_0x36c6eb-0x0;var _0x30675b=_0x05d3[_0x36c6eb];return _0x30675b;};'use strict';var _=require(_0x305d('0x0'));var moment=require(_0x305d('0x1'));var Redis=require(_0x305d('0x2'));var util=require(_0x305d('0x3'));var config=require(_0x305d('0x4'));var db=require(_0x305d('0x5'))['db'];var logger=require('../logger')(_0x305d('0x6'));config[_0x305d('0x7')]=_[_0x305d('0x8')](config['redis'],{'host':_0x305d('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x305d('0x7')]));function closeInteractions(){var _0x23556b=0x0;var _0x5c1948=[];return db[_0x305d('0xa')]['find']({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0x305d('0xb')](function(_0xa18469){_0x23556b=_0xa18469['chatTimeout'];if(_0x23556b){return db[_0x305d('0xc')][_0x305d('0xd')]({'raw':!![],'attributes':['id',_0x305d('0xe')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0xa18469[_0x305d('0xf')],_0x305d('0x10'))}}});}else{return[];}})[_0x305d('0xb')](function(_0x2e4eaf){if(_0x2e4eaf&&_0x2e4eaf['length']){_0x5c1948=_['map'](_0x2e4eaf||[],'id');logger[_0x305d('0x11')]('[CHAT]\x20Interactions\x20to\x20close:',_0x5c1948[_0x305d('0x12')]());return db[_0x305d('0xc')]['update']({'closeReason':_0x305d('0x13'),'disposition':_0x305d('0x14'),'closed':!![],'closedAt':moment()[_0x305d('0x15')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x5c1948}});}})[_0x305d('0xb')](function(){if(_0x5c1948&&_0x5c1948['length']){logger[_0x305d('0x11')](_0x305d('0x16'),_0x5c1948[_0x305d('0x12')]());for(var _0x5bdfb7=0x0;_0x5bdfb7<_0x5c1948[_0x305d('0x17')];_0x5bdfb7++){io[_0x305d('0x18')](_0x305d('0x19'),{'id':_0x5c1948[_0x5bdfb7],'closed':!![]});}}})['catch'](function(_0x32b35a){logger[_0x305d('0x1a')]('[CHAT]\x20Error\x20closing\x20interactions',_0x32b35a?util['inspect'](_0x32b35a,{'showHidden':![],'depth':null}):'');});}exports[_0x305d('0x1b')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x04ed=['../../config/environment','../../mysqldb','../logger','defaults','redis','localhost','Setting','chatTimeout','ChatInteraction','findAll','subtract','minutes','length','info','[CHAT]\x20Interactions\x20to\x20close:','join','update','format','then','emit','chatInteraction:update','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','util'];(function(_0x591db7,_0x150445){var _0x4ad760=function(_0x5dd24e){while(--_0x5dd24e){_0x591db7['push'](_0x591db7['shift']());}};_0x4ad760(++_0x150445);}(_0x04ed,0x1a0));var _0xd04e=function(_0x1b0248,_0x2d5250){_0x1b0248=_0x1b0248-0x0;var _0x11e6d5=_0x04ed[_0x1b0248];return _0x11e6d5;};'use strict';var _=require(_0xd04e('0x0'));var moment=require(_0xd04e('0x1'));var Redis=require(_0xd04e('0x2'));var util=require(_0xd04e('0x3'));var config=require(_0xd04e('0x4'));var db=require(_0xd04e('0x5'))['db'];var logger=require(_0xd04e('0x6'))('schedule');config['redis']=_[_0xd04e('0x7')](config[_0xd04e('0x8')],{'host':_0xd04e('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xd04e('0x8')]));function closeInteractions(){var _0x4fef3d=0x0;var _0x1b65cf=[];return db[_0xd04e('0xa')]['find']({'raw':!![],'attributes':['id',_0xd04e('0xb')],'where':{'id':0x1}})['then'](function(_0x4753df){_0x4fef3d=_0x4753df[_0xd04e('0xb')];if(_0x4fef3d){return db[_0xd04e('0xc')][_0xd04e('0xd')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xd04e('0xe')](_0x4753df[_0xd04e('0xb')],_0xd04e('0xf'))}}});}else{return[];}})['then'](function(_0x1bffe2){if(_0x1bffe2&&_0x1bffe2[_0xd04e('0x10')]){_0x1b65cf=_['map'](_0x1bffe2||[],'id');logger[_0xd04e('0x11')](_0xd04e('0x12'),_0x1b65cf[_0xd04e('0x13')]());return db['ChatInteraction'][_0xd04e('0x14')]({'closeReason':'system','disposition':'timeout','closed':!![],'closedAt':moment()[_0xd04e('0x15')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x1b65cf}});}})[_0xd04e('0x16')](function(){if(_0x1b65cf&&_0x1b65cf[_0xd04e('0x10')]){logger[_0xd04e('0x11')]('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x1b65cf['join']());for(var _0x506366=0x0;_0x506366<_0x1b65cf[_0xd04e('0x10')];_0x506366++){io[_0xd04e('0x17')](_0xd04e('0x18'),{'id':_0x1b65cf[_0x506366],'closed':!![]});}}})['catch'](function(_0x4c9a7e){logger['error'](_0xd04e('0x19'),_0x4c9a7e?util[_0xd04e('0x1a')](_0x4c9a7e,{'showHidden':![],'depth':null}):'');});}exports[_0xd04e('0x1b')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/cloud-provider.js b/server/config/schedule/cloud-provider.js index 126cc5a..bc08a14 100644 --- a/server/config/schedule/cloud-provider.js +++ b/server/config/schedule/cloud-provider.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2c89=['../../api/cloudProvider/cloudProvider.oauth.js','exports'];(function(_0x149b5a,_0x4bd327){var _0x3658bf=function(_0x5c03e7){while(--_0x5c03e7){_0x149b5a['push'](_0x149b5a['shift']());}};_0x3658bf(++_0x4bd327);}(_0x2c89,0x92));var _0x92c8=function(_0x88029e,_0xe9d509){_0x88029e=_0x88029e-0x0;var _0x47263c=_0x2c89[_0x88029e];return _0x47263c;};'use strict';function start(){var _0x2038ff=require(_0x92c8('0x0'));return _0x2038ff['startAllRefreshIntervals']();}module[_0x92c8('0x1')]={'intervals':{},'start':start}; \ No newline at end of file +var _0x4507=['exports','startAllRefreshIntervals'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x4507,0xab));var _0x7450=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x4507[_0x5d6456];return _0x4d66c1;};'use strict';function start(){var _0x2ab90f=require('../../api/cloudProvider/cloudProvider.oauth.js');return _0x2ab90f[_0x7450('0x0')]();}module[_0x7450('0x1')]={'intervals':{},'start':start}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index 9993948..b74d048 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 _0xe6f1=['getSmtpOptions','format','\x22%s\x22\x20<%s>','name','user','bcc','subtractNumber','subtractUnit','../../files/reports','savename','%s.%s','basename','zip','join','status','Sent','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','existsSync','message','attachments','sendIfEmpty','info','empty\x20file,\x20email\x20not\x20sent','request','SendMail','error','error\x20mail','data','Smtp','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','then','catch','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','MailServerOut','CloudProvider','keys','toString','difference','intersection','length','exists','stop','deleteJob','delete\x20cron','toRun','my\x20id','resolve','run\x20job','cron','active','isBetween','endAt','add','start','add\x20cron','stop\x20cron','update\x20cron','run','util','path','cron-job-manager','jayson/promise','bluebird','../logger','../../mysqldb','client','http','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe6f1,0x1ec));var _0x1e6f=function(_0x1266f9,_0xbba76f){_0x1266f9=_0x1266f9-0x0;var _0x282acb=_0xe6f1[_0x1266f9];return _0x282acb;};'use strict';var fs=require('fs');var util=require(_0x1e6f('0x0'));var path=require(_0x1e6f('0x1'));var _=require('lodash');var moment=require('moment');var CronJobManager=require(_0x1e6f('0x2'));var jayson=require(_0x1e6f('0x3'));var BPromise=require(_0x1e6f('0x4'));var logger=require(_0x1e6f('0x5'))('schedule');var db=require(_0x1e6f('0x6'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0x1e6f('0x7')][_0x1e6f('0x8')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x4180c9,_0x3e1a29){return function(){logger['info'](_0x1e6f('0x9'),_0x4180c9[_0x1e6f('0xa')]);var _0x3f99ca=!![];var _0x5da37a=_0x4180c9[_0x1e6f('0xb')][_0x1e6f('0xc')]();var _0x1c4bca={'account':_0x5da37a,'message':{'from':util[_0x1e6f('0xd')](_0x1e6f('0xe'),_0x4180c9[_0x1e6f('0xb')][_0x1e6f('0xf')],_0x4180c9[_0x1e6f('0xb')][_0x1e6f('0xa')]||_0x4180c9[_0x1e6f('0xb')]['Smtp'][_0x1e6f('0x10')]),'to':_0x4180c9[_0x1e6f('0xa')],'cc':_0x4180c9['cc'],'bcc':_0x4180c9[_0x1e6f('0x11')],'subject':util[_0x1e6f('0xd')]('Report\x20%s\x20last\x20%s\x20%s',_0x3e1a29[_0x1e6f('0xf')],_0x4180c9[_0x1e6f('0x12')],_0x4180c9[_0x1e6f('0x13')])}};var _0x4fdf73=path['join'](__dirname,_0x1e6f('0x14'));var _0x22373f=_0x3e1a29[_0x1e6f('0x15')];var _0xa19b11=util[_0x1e6f('0xd')](_0x1e6f('0x16'),path[_0x1e6f('0x17')](_0x3e1a29[_0x1e6f('0x15')],path['extname'](_0x3e1a29[_0x1e6f('0x15')])),_0x1e6f('0x18'));var _0x3dae99=path[_0x1e6f('0x19')](_0x4fdf73,_0x22373f);var _0x4f774a=path[_0x1e6f('0x19')](_0x4fdf73,_0xa19b11);if(fs['existsSync'](_0x3dae99)){_0x3e1a29[_0x1e6f('0x1a')]=_0x1e6f('0x1b');_0x1c4bca['message']['attachments']=[{'filename':_0x22373f,'path':_0x3dae99}];_0x1c4bca['message'][_0x1e6f('0x1c')]=util[_0x1e6f('0xd')](_0x1e6f('0x1d'),JSON[_0x1e6f('0x1e')](_0x3e1a29,null,0x2));}else if(fs[_0x1e6f('0x1f')](_0x4f774a)){_0x3e1a29[_0x1e6f('0x1a')]=_0x1e6f('0x1b');_0x1c4bca[_0x1e6f('0x20')][_0x1e6f('0x21')]=[{'filename':_0xa19b11,'path':_0x4f774a}];}else{_0x1c4bca[_0x1e6f('0x20')][_0x1e6f('0x1c')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x4180c9[_0x1e6f('0x22')]){_0x3f99ca=![];logger[_0x1e6f('0x23')](_0x1e6f('0x24'));}}if(_0x3f99ca){return client[_0x1e6f('0x25')](_0x1e6f('0x26'),_0x1c4bca)['then'](function(_0x152ce2){if(_0x152ce2['error']){return logger[_0x1e6f('0x27')](_0x1e6f('0x28'),JSON[_0x1e6f('0x1e')](_0x152ce2));}return logger[_0x1e6f('0x23')]('email\x20sent');})['catch'](function(_0x402cb2){return logger[_0x1e6f('0x27')](_0x1e6f('0x28'),JSON[_0x1e6f('0x1e')](_0x402cb2));});}};}function handleError(){return function(_0x55e55c){return logger[_0x1e6f('0x27')](JSON[_0x1e6f('0x1e')](_0x55e55c));};}function handleResult(_0x4f0547){return function(_0x9f5de6){logger[_0x1e6f('0x23')](_0x1e6f('0x29'),JSON[_0x1e6f('0x1e')](_0x9f5de6));if(_0x4f0547[_0x1e6f('0xb')]&&_0x4f0547['MailAccount'][_0x1e6f('0x2a')]&&!_[_0x1e6f('0x2b')](_0x4f0547['email'])){setTimeout(handleSendEmail(_0x4f0547,_0x9f5de6),0x3c*0x3e8);}};}function handleJob(_0x47fd58){return function(){try{if(_[_0x1e6f('0x2b')](_0x47fd58[_0x1e6f('0x12')])){return logger[_0x1e6f('0x23')](_0x1e6f('0x2c'));}if(_[_0x1e6f('0x2b')](_0x47fd58[_0x1e6f('0x13')])){return logger[_0x1e6f('0x23')](_0x1e6f('0x2d'));}var _0x3ad8dc={'startDate':moment()[_0x1e6f('0x2e')](_0x47fd58[_0x1e6f('0x12')],_0x47fd58['subtractUnit'])[_0x1e6f('0xd')](_0x1e6f('0x2f')),'endDate':moment()[_0x1e6f('0xd')](_0x1e6f('0x2f')),'type':_0x1e6f('0x30'),'output':_0x47fd58[_0x1e6f('0x31')],'name':_0x47fd58[_0x1e6f('0xf')]};if(!_[_0x1e6f('0x2b')](_0x47fd58[_0x1e6f('0x32')])){logger[_0x1e6f('0x23')](_0x1e6f('0x33'),_0x47fd58[_0x1e6f('0x32')]);return analyticDefaultReportController[_0x1e6f('0x34')]({'id':_0x47fd58[_0x1e6f('0x32')]},_0x3ad8dc)[_0x1e6f('0x35')](handleResult(_0x47fd58))[_0x1e6f('0x36')](handleError());}if(!_['isNil'](_0x47fd58[_0x1e6f('0x37')])){logger[_0x1e6f('0x23')](_0x1e6f('0x38'),_0x47fd58[_0x1e6f('0x37')]);return analyticCustomReportController[_0x1e6f('0x34')]({'id':_0x47fd58[_0x1e6f('0x37')]},_0x3ad8dc)[_0x1e6f('0x35')](handleResult(_0x47fd58))[_0x1e6f('0x36')](handleError());}}catch(_0x4c1414){logger[_0x1e6f('0x27')](JSON[_0x1e6f('0x1e')](_0x4c1414));}return logger['info'](_0x1e6f('0x39'));};}function getJobs(_0x2b491b){var _0x1532cb={};if(_0x2b491b){_0x1532cb['id']=_0x2b491b;}return db[_0x1e6f('0x3a')]['findAll']({'where':_0x1532cb,'include':[{'model':db[_0x1e6f('0xb')],'attributes':['id','name',_0x1e6f('0xa')],'include':[{'model':db[_0x1e6f('0x3b')],'as':_0x1e6f('0x2a'),'include':[{'model':db['CloudProvider'],'as':_0x1e6f('0x3c')}]}]}]})[_0x1e6f('0x35')](function(_0x59019f){var _0x39d7bd=_[_0x1e6f('0x3d')](manager['jobs']);var _0x1440d0=_['map'](_0x59019f,function(_0x49dcc7){return _0x49dcc7['id']['toString']();});var _0x45cad7=_['keyBy'](_0x59019f,function(_0x14adc8){return _0x14adc8['id'][_0x1e6f('0x3e')]();});var _0x7ac8d2=_0x2b491b?_0x1440d0:_[_0x1e6f('0x3f')](_0x1440d0,_0x39d7bd);var _0x29be35=_[_0x1e6f('0x40')](_0x1440d0,_0x39d7bd);var _0x24b369=_[_0x1e6f('0x3f')](_0x39d7bd,_0x1440d0);var _0x2ca69a;var _0x97c302;for(_0x2ca69a=0x0;_0x2ca69a<_0x24b369[_0x1e6f('0x41')]&&!_0x2b491b;_0x2ca69a+=0x1){_0x97c302=_0x24b369[_0x2ca69a][_0x1e6f('0x3e')]();if(manager[_0x1e6f('0x42')](_0x97c302)){manager[_0x1e6f('0x43')](_0x97c302);manager[_0x1e6f('0x44')](_0x97c302);logger['info'](_0x1e6f('0x45'),_0x97c302);}}logger['info'](_0x1e6f('0x46'),JSON[_0x1e6f('0x1e')](_0x7ac8d2));for(_0x2ca69a=0x0;_0x2ca69a<_0x7ac8d2[_0x1e6f('0x41')];_0x2ca69a+=0x1){_0x97c302=_0x7ac8d2[_0x2ca69a][_0x1e6f('0x3e')]();logger[_0x1e6f('0x23')]('index',_0x97c302);if(_0x2b491b){logger[_0x1e6f('0x23')](_0x1e6f('0x47'),_0x2b491b);logger[_0x1e6f('0x23')](JSON[_0x1e6f('0x1e')](_0x45cad7[_0x97c302]));BPromise[_0x1e6f('0x48')]()[_0x1e6f('0x35')](handleJob(_0x45cad7[_0x97c302]));logger[_0x1e6f('0x23')](_0x1e6f('0x49'),_0x45cad7[_0x97c302][_0x1e6f('0xf')],_0x45cad7[_0x97c302][_0x1e6f('0x4a')]);}else if(_0x45cad7[_0x97c302][_0x1e6f('0x4a')]&&_0x45cad7[_0x97c302][_0x1e6f('0x4b')]&&moment()[_0x1e6f('0x4c')](_0x45cad7[_0x97c302]['startAt'],_0x45cad7[_0x97c302][_0x1e6f('0x4d')])){manager[_0x1e6f('0x4e')](_0x97c302,_0x45cad7[_0x97c302]['cron'],handleJob(_0x45cad7[_0x97c302]));manager[_0x1e6f('0x4f')](_0x97c302);logger['info'](_0x1e6f('0x50'),_0x45cad7[_0x97c302][_0x1e6f('0xf')],_0x45cad7[_0x97c302]['cron']);}else if(manager[_0x1e6f('0x42')](_0x97c302)){manager[_0x1e6f('0x43')](_0x97c302);manager['deleteJob'](_0x97c302);logger['info'](_0x1e6f('0x51'),_0x45cad7[_0x97c302][_0x1e6f('0xf')],_0x45cad7[_0x97c302][_0x1e6f('0x4a')]);}}for(_0x2ca69a=0x0,_0x97c302;_0x2ca69a<_0x29be35[_0x1e6f('0x41')]&&!_0x2b491b;_0x2ca69a+=0x1){_0x97c302=_0x29be35[_0x2ca69a][_0x1e6f('0x3e')]();if(manager[_0x1e6f('0x42')](_0x97c302)){if(_0x45cad7[_0x97c302][_0x1e6f('0x4a')]&&_0x45cad7[_0x97c302][_0x1e6f('0x4b')]&&moment()[_0x1e6f('0x4c')](_0x45cad7[_0x97c302]['startAt'],_0x45cad7[_0x97c302][_0x1e6f('0x4d')])){manager['update'](_0x97c302,_0x45cad7[_0x97c302]['cron'],handleJob(_0x45cad7[_0x97c302]));logger[_0x1e6f('0x23')](_0x1e6f('0x52'),_0x45cad7[_0x97c302][_0x1e6f('0xf')],_0x45cad7[_0x97c302]['cron']);}else{manager[_0x1e6f('0x43')](_0x97c302);manager['deleteJob'](_0x97c302);logger[_0x1e6f('0x23')](_0x1e6f('0x51'),_0x45cad7[_0x97c302]['name'],_0x45cad7[_0x97c302][_0x1e6f('0x4a')]);}}}})[_0x1e6f('0x36')](function(_0xe31253){logger[_0x1e6f('0x27')](JSON[_0x1e6f('0x1e')](_0xe31253));});}exports[_0x1e6f('0x53')]=function(_0x3dd8c6){return getJobs(_0x3dd8c6);};exports[_0x1e6f('0x4f')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0xf1f6=['Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','format','Smtp','user','bcc','subtractNumber','subtractUnit','join','savename','%s.%s','basename','extname','zip','existsSync','status','Sent','message','attachments','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','text','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error\x20mail','email\x20sent','catch','error','data','isNil','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','output','name','DefaultReportId','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','Schedule','findAll','keys','map','toString','intersection','difference','length','exists','deleteJob','toRun','index','resolve','run\x20job','cron','active','startAt','endAt','add','start','stop','stop\x20cron','isBetween','update\x20cron','run','lodash','cron-job-manager','jayson/promise','schedule','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info'];(function(_0xe085e3,_0x31a298){var _0x2b9d1d=function(_0x2b3bc8){while(--_0x2b3bc8){_0xe085e3['push'](_0xe085e3['shift']());}};_0x2b9d1d(++_0x31a298);}(_0xf1f6,0x128));var _0x6f1f=function(_0x3ed47d,_0x2ea818){_0x3ed47d=_0x3ed47d-0x0;var _0x1e4e75=_0xf1f6[_0x3ed47d];return _0x1e4e75;};'use strict';var fs=require('fs');var util=require('util');var path=require('path');var _=require(_0x6f1f('0x0'));var moment=require('moment');var CronJobManager=require(_0x6f1f('0x1'));var jayson=require(_0x6f1f('0x2'));var BPromise=require('bluebird');var logger=require('../logger')(_0x6f1f('0x3'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0x6f1f('0x4'));var client=jayson[_0x6f1f('0x5')][_0x6f1f('0x6')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x65b3b2,_0x48f2c8){return function(){logger[_0x6f1f('0x7')](_0x6f1f('0x8'),_0x65b3b2[_0x6f1f('0x9')]);var _0x3d85f1=!![];var _0x8c799f=_0x65b3b2[_0x6f1f('0xa')]['getSmtpOptions']();var _0x43d0a2={'account':_0x8c799f,'message':{'from':util[_0x6f1f('0xb')]('\x22%s\x22\x20<%s>',_0x65b3b2['MailAccount']['name'],_0x65b3b2['MailAccount'][_0x6f1f('0x9')]||_0x65b3b2[_0x6f1f('0xa')][_0x6f1f('0xc')][_0x6f1f('0xd')]),'to':_0x65b3b2[_0x6f1f('0x9')],'cc':_0x65b3b2['cc'],'bcc':_0x65b3b2[_0x6f1f('0xe')],'subject':util[_0x6f1f('0xb')]('Report\x20%s\x20last\x20%s\x20%s',_0x48f2c8['name'],_0x65b3b2[_0x6f1f('0xf')],_0x65b3b2[_0x6f1f('0x10')])}};var _0x1eed26=path[_0x6f1f('0x11')](__dirname,'../../files/reports');var _0x134dec=_0x48f2c8[_0x6f1f('0x12')];var _0x42fd68=util['format'](_0x6f1f('0x13'),path[_0x6f1f('0x14')](_0x48f2c8[_0x6f1f('0x12')],path[_0x6f1f('0x15')](_0x48f2c8[_0x6f1f('0x12')])),_0x6f1f('0x16'));var _0x1f1aef=path[_0x6f1f('0x11')](_0x1eed26,_0x134dec);var _0x2277d9=path[_0x6f1f('0x11')](_0x1eed26,_0x42fd68);if(fs[_0x6f1f('0x17')](_0x1f1aef)){_0x48f2c8[_0x6f1f('0x18')]=_0x6f1f('0x19');_0x43d0a2[_0x6f1f('0x1a')][_0x6f1f('0x1b')]=[{'filename':_0x134dec,'path':_0x1f1aef}];_0x43d0a2['message']['text']=util['format'](_0x6f1f('0x1c'),JSON[_0x6f1f('0x1d')](_0x48f2c8,null,0x2));}else if(fs[_0x6f1f('0x17')](_0x2277d9)){_0x48f2c8['status']=_0x6f1f('0x19');_0x43d0a2[_0x6f1f('0x1a')][_0x6f1f('0x1b')]=[{'filename':_0x42fd68,'path':_0x2277d9}];}else{_0x43d0a2['message'][_0x6f1f('0x1e')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x65b3b2[_0x6f1f('0x1f')]){_0x3d85f1=![];logger[_0x6f1f('0x7')](_0x6f1f('0x20'));}}if(_0x3d85f1){return client[_0x6f1f('0x21')](_0x6f1f('0x22'),_0x43d0a2)[_0x6f1f('0x23')](function(_0xdf000a){if(_0xdf000a['error']){return logger['error'](_0x6f1f('0x24'),JSON[_0x6f1f('0x1d')](_0xdf000a));}return logger[_0x6f1f('0x7')](_0x6f1f('0x25'));})[_0x6f1f('0x26')](function(_0x2fc53b){return logger[_0x6f1f('0x27')](_0x6f1f('0x24'),JSON['stringify'](_0x2fc53b));});}};}function handleError(){return function(_0x497aa0){return logger[_0x6f1f('0x27')](JSON[_0x6f1f('0x1d')](_0x497aa0));};}function handleResult(_0x198ef0){return function(_0x5d13c5){logger[_0x6f1f('0x7')](_0x6f1f('0x28'),JSON[_0x6f1f('0x1d')](_0x5d13c5));if(_0x198ef0[_0x6f1f('0xa')]&&_0x198ef0['MailAccount']['Smtp']&&!_['isNil'](_0x198ef0['email'])){setTimeout(handleSendEmail(_0x198ef0,_0x5d13c5),0x3c*0x3e8);}};}function handleJob(_0x586e1f){return function(){try{if(_[_0x6f1f('0x29')](_0x586e1f[_0x6f1f('0xf')])){return logger[_0x6f1f('0x7')]('subtractNumber\x20null\x20or\x20undefined');}if(_[_0x6f1f('0x29')](_0x586e1f[_0x6f1f('0x10')])){return logger['info'](_0x6f1f('0x2a'));}var _0xeee423={'startDate':moment()[_0x6f1f('0x2b')](_0x586e1f[_0x6f1f('0xf')],_0x586e1f[_0x6f1f('0x10')])[_0x6f1f('0xb')](_0x6f1f('0x2c')),'endDate':moment()[_0x6f1f('0xb')](_0x6f1f('0x2c')),'type':'scheduled','output':_0x586e1f[_0x6f1f('0x2d')],'name':_0x586e1f[_0x6f1f('0x2e')]};if(!_['isNil'](_0x586e1f['DefaultReportId'])){logger[_0x6f1f('0x7')]('exec\x20defaul\x20report\x20id:%s',_0x586e1f[_0x6f1f('0x2f')]);return analyticDefaultReportController[_0x6f1f('0x30')]({'id':_0x586e1f[_0x6f1f('0x2f')]},_0xeee423)[_0x6f1f('0x23')](handleResult(_0x586e1f))[_0x6f1f('0x26')](handleError());}if(!_[_0x6f1f('0x29')](_0x586e1f[_0x6f1f('0x31')])){logger['info'](_0x6f1f('0x32'),_0x586e1f[_0x6f1f('0x31')]);return analyticCustomReportController[_0x6f1f('0x30')]({'id':_0x586e1f['CustomReportId']},_0xeee423)[_0x6f1f('0x23')](handleResult(_0x586e1f))['catch'](handleError());}}catch(_0x3b4012){logger['error'](JSON[_0x6f1f('0x1d')](_0x3b4012));}return logger[_0x6f1f('0x7')]('no\x20report\x20id');};}function getJobs(_0x37475d){var _0x2e4b2c={};if(_0x37475d){_0x2e4b2c['id']=_0x37475d;}return db[_0x6f1f('0x33')][_0x6f1f('0x34')]({'where':_0x2e4b2c,'include':[{'model':db[_0x6f1f('0xa')],'attributes':['id','name',_0x6f1f('0x9')],'include':[{'model':db['MailServerOut'],'as':_0x6f1f('0xc'),'include':[{'model':db['CloudProvider'],'as':'CloudProvider'}]}]}]})[_0x6f1f('0x23')](function(_0x2fe10f){var _0xbe9742=_[_0x6f1f('0x35')](manager['jobs']);var _0x58ea77=_[_0x6f1f('0x36')](_0x2fe10f,function(_0x2d9135){return _0x2d9135['id'][_0x6f1f('0x37')]();});var _0x2ef5f8=_['keyBy'](_0x2fe10f,function(_0x5687eb){return _0x5687eb['id'][_0x6f1f('0x37')]();});var _0x4e526a=_0x37475d?_0x58ea77:_['difference'](_0x58ea77,_0xbe9742);var _0xb2a529=_[_0x6f1f('0x38')](_0x58ea77,_0xbe9742);var _0x2a9ad0=_[_0x6f1f('0x39')](_0xbe9742,_0x58ea77);var _0x500c9c;var _0x1da5ee;for(_0x500c9c=0x0;_0x500c9c<_0x2a9ad0[_0x6f1f('0x3a')]&&!_0x37475d;_0x500c9c+=0x1){_0x1da5ee=_0x2a9ad0[_0x500c9c]['toString']();if(manager[_0x6f1f('0x3b')](_0x1da5ee)){manager['stop'](_0x1da5ee);manager[_0x6f1f('0x3c')](_0x1da5ee);logger['info']('delete\x20cron',_0x1da5ee);}}logger[_0x6f1f('0x7')](_0x6f1f('0x3d'),JSON[_0x6f1f('0x1d')](_0x4e526a));for(_0x500c9c=0x0;_0x500c9c<_0x4e526a[_0x6f1f('0x3a')];_0x500c9c+=0x1){_0x1da5ee=_0x4e526a[_0x500c9c][_0x6f1f('0x37')]();logger['info'](_0x6f1f('0x3e'),_0x1da5ee);if(_0x37475d){logger[_0x6f1f('0x7')]('my\x20id',_0x37475d);logger['info'](JSON[_0x6f1f('0x1d')](_0x2ef5f8[_0x1da5ee]));BPromise[_0x6f1f('0x3f')]()[_0x6f1f('0x23')](handleJob(_0x2ef5f8[_0x1da5ee]));logger[_0x6f1f('0x7')](_0x6f1f('0x40'),_0x2ef5f8[_0x1da5ee][_0x6f1f('0x2e')],_0x2ef5f8[_0x1da5ee][_0x6f1f('0x41')]);}else if(_0x2ef5f8[_0x1da5ee]['cron']&&_0x2ef5f8[_0x1da5ee][_0x6f1f('0x42')]&&moment()['isBetween'](_0x2ef5f8[_0x1da5ee][_0x6f1f('0x43')],_0x2ef5f8[_0x1da5ee][_0x6f1f('0x44')])){manager[_0x6f1f('0x45')](_0x1da5ee,_0x2ef5f8[_0x1da5ee][_0x6f1f('0x41')],handleJob(_0x2ef5f8[_0x1da5ee]));manager[_0x6f1f('0x46')](_0x1da5ee);logger[_0x6f1f('0x7')]('add\x20cron',_0x2ef5f8[_0x1da5ee][_0x6f1f('0x2e')],_0x2ef5f8[_0x1da5ee][_0x6f1f('0x41')]);}else if(manager['exists'](_0x1da5ee)){manager[_0x6f1f('0x47')](_0x1da5ee);manager[_0x6f1f('0x3c')](_0x1da5ee);logger[_0x6f1f('0x7')](_0x6f1f('0x48'),_0x2ef5f8[_0x1da5ee][_0x6f1f('0x2e')],_0x2ef5f8[_0x1da5ee][_0x6f1f('0x41')]);}}for(_0x500c9c=0x0,_0x1da5ee;_0x500c9c<_0xb2a529[_0x6f1f('0x3a')]&&!_0x37475d;_0x500c9c+=0x1){_0x1da5ee=_0xb2a529[_0x500c9c][_0x6f1f('0x37')]();if(manager[_0x6f1f('0x3b')](_0x1da5ee)){if(_0x2ef5f8[_0x1da5ee][_0x6f1f('0x41')]&&_0x2ef5f8[_0x1da5ee]['active']&&moment()[_0x6f1f('0x49')](_0x2ef5f8[_0x1da5ee]['startAt'],_0x2ef5f8[_0x1da5ee][_0x6f1f('0x44')])){manager['update'](_0x1da5ee,_0x2ef5f8[_0x1da5ee][_0x6f1f('0x41')],handleJob(_0x2ef5f8[_0x1da5ee]));logger[_0x6f1f('0x7')](_0x6f1f('0x4a'),_0x2ef5f8[_0x1da5ee]['name'],_0x2ef5f8[_0x1da5ee][_0x6f1f('0x41')]);}else{manager['stop'](_0x1da5ee);manager[_0x6f1f('0x3c')](_0x1da5ee);logger[_0x6f1f('0x7')]('stop\x20cron',_0x2ef5f8[_0x1da5ee][_0x6f1f('0x2e')],_0x2ef5f8[_0x1da5ee]['cron']);}}}})[_0x6f1f('0x26')](function(_0x2f377d){logger[_0x6f1f('0x27')](JSON[_0x6f1f('0x1d')](_0x2f377d));});}exports[_0x6f1f('0x4b')]=function(_0xc184f7){return getJobs(_0xc184f7);};exports[_0x6f1f('0x46')]=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 e1c4ff0..3450020 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 _0xccde=['name','SequelizeValidationError','error','VoiceRecording','IN_PROGRESS','Setting','Settings\x20not\x20available','transcribe','Transcribe\x20not\x20configured','all','inspect','start','lodash','request-promise','bluebird','../../mysqldb','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','info','transcribeName','data1','data2','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','TranscriptFileUri','format','results','transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','language','Sentiment','SentimentScore','Positive','Negative','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','catch'];(function(_0x31dca1,_0x1c6038){var _0x804b22=function(_0xe877e1){while(--_0xe877e1){_0x31dca1['push'](_0x31dca1['shift']());}};_0x804b22(++_0x1c6038);}(_0xccde,0x1e1));var _0xeccd=function(_0x55fb83,_0x1d3856){_0x55fb83=_0x55fb83-0x0;var _0x59a87a=_0xccde[_0x55fb83];return _0x59a87a;};var _=require(_0xeccd('0x0'));var AWS=require('aws-sdk');var rp=require(_0xeccd('0x1'));var util=require('util');var BPromise=require(_0xeccd('0x2'));var db=require(_0xeccd('0x3'))['db'];var logger=require('../../config/logger')('transcribe');function getTranscriptionJob(_0x2d21f3,_0x3eede4,_0x175682,_0x397cd0){return new Promise(function(_0x323c74,_0x56972a){var _0x338742=new AWS[(_0xeccd('0x4'))]({'accessKeyId':_0x3eede4,'secretAccessKey':_0x2d21f3,'region':_0x175682});_0x338742[_0xeccd('0x5')]({'TranscriptionJobName':_0x397cd0},function(_0x1eebfb,_0x4b068e){if(_0x1eebfb){return _0x56972a(_0x1eebfb);}else{return _0x323c74(_0x4b068e);}});});}function sentiment(_0x1c029a,_0xe519de,_0x9dccd,_0x6baeb,_0x50b0b2){return new Promise(function(_0x58b867,_0x5baa39){var _0x5deb54=new AWS[(_0xeccd('0x6'))]({'accessKeyId':_0xe519de,'secretAccessKey':_0x1c029a,'region':_0x9dccd});_0x5deb54[_0xeccd('0x7')]({'Text':_0x6baeb,'LanguageCode':_0x50b0b2[_0xeccd('0x8')](0x0,0x2)},function(_0x53a7e1,_0x307e37){if(_0x53a7e1){return _0x5baa39(_0x53a7e1);}else{return _0x58b867(_0x307e37);}});});}function checkTranscribeJob(_0x59c910,_0x417bfc,_0x2d7e4c){var _0x377cd7;return new BPromise(function(_0x3bd19c,_0x3841c4){logger[_0xeccd('0x9')](util['format']('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0x59c910['id'],_0x59c910[_0xeccd('0xa')]));return getTranscriptionJob(_0x2d7e4c[_0xeccd('0xb')],_0x2d7e4c[_0xeccd('0xc')],_0x417bfc[_0xeccd('0xd')],_0x59c910['transcribeName'])[_0xeccd('0xe')](function(_0x3dc35f){logger['info'](util['format'](_0xeccd('0xf'),_0x59c910['id'],_0x59c910[_0xeccd('0xa')],_0x3dc35f[_0xeccd('0x10')][_0xeccd('0x11')]));if(!_0x59c910[_0xeccd('0x12')]){switch(_0x3dc35f[_0xeccd('0x10')][_0xeccd('0x11')]){case _0xeccd('0x13'):var _0x5ba676={'transcribeStatus':_0x3dc35f[_0xeccd('0x10')][_0xeccd('0x11')],'fileUri':_0x3dc35f[_0xeccd('0x10')][_0xeccd('0x14')][_0xeccd('0x15')]};logger[_0xeccd('0x9')](util['format']('[RECORDING:%d]\x20Get\x20transcript',_0x59c910['id']));return rp({'uri':_0x3dc35f['TranscriptionJob'][_0xeccd('0x14')]['TranscriptFileUri'],'json':!![]})[_0xeccd('0xe')](function(_0x20e7b5){logger['info'](util[_0xeccd('0x16')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0x59c910['id']));if(_0x20e7b5&&_0x20e7b5[_0xeccd('0x17')]&&_0x20e7b5[_0xeccd('0x17')][_0xeccd('0x18')]&&_0x20e7b5[_0xeccd('0x17')][_0xeccd('0x18')]['length']){_0x5ba676[_0xeccd('0x12')]='';for(var _0x560659=0x0;_0x560659<_0x20e7b5[_0xeccd('0x17')][_0xeccd('0x18')][_0xeccd('0x19')];_0x560659++){_0x5ba676[_0xeccd('0x12')]+=_0x20e7b5['results'][_0xeccd('0x18')][_0x560659][_0xeccd('0x1a')]+'';}}return _0x59c910[_0xeccd('0x1b')](_0x5ba676);})[_0xeccd('0xe')](function(){logger['info'](util[_0xeccd('0x16')](_0xeccd('0x1c'),_0x59c910['id']));if(!_0x59c910[_0xeccd('0x1d')]){throw new db[(_0xeccd('0x1e'))][(_0xeccd('0x1f'))](_0xeccd('0x20'));}if(!_0x417bfc[_0xeccd('0x21')]||!_0x417bfc[_0xeccd('0x22')]||!_0x417bfc[_0xeccd('0x23')]||!_0x417bfc['language']||!_0x417bfc[_0xeccd('0x24')]){throw new db['Sequelize'][(_0xeccd('0x1f'))](_0xeccd('0x25'));}if(!_0x5ba676[_0xeccd('0x12')]){throw new Error(_0xeccd('0x26'));}if(_0x417bfc[_0xeccd('0x22')]===_0x2d7e4c['id']){return _0x2d7e4c;}else{return db[_0xeccd('0x27')][_0xeccd('0x28')]({'where':{'id':_settings[_0xeccd('0x22')]}});}})[_0xeccd('0xe')](function(_0x2fdc7b){if(!_0x2fdc7b){throw new db[(_0xeccd('0x1e'))][(_0xeccd('0x1f'))](_0xeccd('0x29'));}if(!_0x2fdc7b[_0xeccd('0xb')]||!_0x2fdc7b['data2']){throw new db[(_0xeccd('0x1e'))][(_0xeccd('0x1f'))]('Cloud\x20Provider\x20not\x20configured');}_0x377cd7=_0x2fdc7b;logger[_0xeccd('0x9')](util[_0xeccd('0x16')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x59c910['id']));return sentiment(_0x377cd7[_0xeccd('0xb')],_0x377cd7[_0xeccd('0xc')],_0x417bfc[_0xeccd('0x23')],_0x5ba676[_0xeccd('0x12')],_0x417bfc[_0xeccd('0x2a')]);})[_0xeccd('0xe')](function(_0x37e189){logger[_0xeccd('0x9')](util[_0xeccd('0x16')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x59c910['id']));return _0x59c910['update']({'sentiment':_0x37e189[_0xeccd('0x2b')],'sPositive':_0x37e189[_0xeccd('0x2c')][_0xeccd('0x2d')],'sNegative':_0x37e189[_0xeccd('0x2c')][_0xeccd('0x2e')],'sMixed':_0x37e189[_0xeccd('0x2c')][_0xeccd('0x2f')],'sNeutral':_0x37e189[_0xeccd('0x2c')][_0xeccd('0x30')]});})[_0xeccd('0xe')](function(){logger[_0xeccd('0x9')](util[_0xeccd('0x16')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x59c910['id']));_0x3bd19c();});case _0xeccd('0x31'):return _0x59c910['update']({'transcribeStatus':_0xeccd('0x31'),'failureReason':_0x3dc35f[_0xeccd('0x10')][_0xeccd('0x32')]})['then'](function(){logger[_0xeccd('0x9')](util[_0xeccd('0x16')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x59c910['id']));_0x3bd19c();});default:logger['info'](util[_0xeccd('0x16')](_0xeccd('0x33'),_0x59c910['id']));break;}}else{return BPromise[_0xeccd('0x34')]()['then'](function(){if(!_0x59c910[_0xeccd('0x1d')]){throw new db['Sequelize'][(_0xeccd('0x1f'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x417bfc[_0xeccd('0x21')]||!_0x417bfc[_0xeccd('0x22')]||!_0x417bfc[_0xeccd('0x23')]||!_0x417bfc[_0xeccd('0x2a')]||!_0x417bfc['bucket']){throw new db['Sequelize'][(_0xeccd('0x1f'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x59c910[_0xeccd('0x12')]){throw new Error(_0xeccd('0x26'));}if(_0x417bfc['sentimentAccountId']===_0x2d7e4c['id']){return _0x2d7e4c;}else{return db['CloudProvider'][_0xeccd('0x28')]({'where':{'id':_settings[_0xeccd('0x22')]}});}})['then'](function(_0x12ece0){if(!_0x12ece0){throw new db[(_0xeccd('0x1e'))][(_0xeccd('0x1f'))](_0xeccd('0x29'));}if(!_0x12ece0[_0xeccd('0xb')]||!_0x12ece0[_0xeccd('0xc')]){throw new db['Sequelize'][(_0xeccd('0x1f'))]('Cloud\x20Provider\x20not\x20configured');}_0x377cd7=_0x12ece0;logger[_0xeccd('0x9')](util[_0xeccd('0x16')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x59c910['id']));return sentiment(_0x377cd7[_0xeccd('0xb')],_0x377cd7['data2'],_0x417bfc[_0xeccd('0x23')],_0x59c910[_0xeccd('0x12')],_0x417bfc[_0xeccd('0x2a')]);})['then'](function(_0x1ca85d){logger[_0xeccd('0x9')](util[_0xeccd('0x16')](_0xeccd('0x35'),_0x59c910['id']));return _0x59c910['update']({'sentiment':_0x1ca85d['Sentiment'],'sPositive':_0x1ca85d[_0xeccd('0x2c')][_0xeccd('0x2d')],'sNegative':_0x1ca85d[_0xeccd('0x2c')][_0xeccd('0x2e')],'sMixed':_0x1ca85d[_0xeccd('0x2c')][_0xeccd('0x2f')],'sNeutral':_0x1ca85d[_0xeccd('0x2c')][_0xeccd('0x30')],'transcribeStatus':_0xeccd('0x13')});})['then'](function(){logger['info'](util[_0xeccd('0x16')](_0xeccd('0x1c'),_0x59c910['id']));_0x3bd19c();});}})[_0xeccd('0x36')](function(_0x3a0c01){if(_0x3a0c01){if(!_0x3a0c01[_0xeccd('0x37')]||_0x3a0c01[_0xeccd('0x37')]!==_0xeccd('0x38')){logger[_0xeccd('0x39')](util['format']('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x59c910['id']),util['inspect'](_0x3a0c01,{'showHidden':![],'depth':null}));}}_0x3bd19c();});});}function checkTranscribe(){var _0x46baa9;var _0x5371b6;var _0x30777a;return db[_0xeccd('0x3a')]['findAll']({'where':{'transcribeStatus':_0xeccd('0x3b')}})[_0xeccd('0xe')](function(_0xc5d7e){if(!_0xc5d7e||!_0xc5d7e[_0xeccd('0x19')]){throw new db['Sequelize'][(_0xeccd('0x1f'))]('No\x20transcribe\x20job\x20to\x20check');}_0x46baa9=_0xc5d7e;return db[_0xeccd('0x3c')][_0xeccd('0x28')]({'where':{'id':0x1}});})[_0xeccd('0xe')](function(_0x216881){if(!_0x216881){throw new db[(_0xeccd('0x1e'))]['ValidationError'](_0xeccd('0x3d'));}_0x5371b6=_0x216881;if(!_0x5371b6[_0xeccd('0x3e')]||!_0x5371b6['transcribeAccountId']||!_0x5371b6['transcribeRegion']||!_0x5371b6[_0xeccd('0x2a')]||!_0x5371b6['bucket']){throw new db[(_0xeccd('0x1e'))]['ValidationError'](_0xeccd('0x3f'));}return db[_0xeccd('0x27')][_0xeccd('0x28')]({'where':{'id':_0x5371b6['transcribeAccountId']}});})['then'](function(_0x33c0dd){if(!_0x33c0dd){throw new db['Sequelize'][(_0xeccd('0x1f'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x33c0dd['data1']||!_0x33c0dd[_0xeccd('0xc')]){throw new db[(_0xeccd('0x1e'))][(_0xeccd('0x1f'))]('Cloud\x20Provider\x20not\x20configured');}_0x30777a=_0x33c0dd;var _0x37303f=[];_0x46baa9['forEach'](function(_0x21bdfa){_0x37303f['push'](checkTranscribeJob(_0x21bdfa,_0x5371b6,_0x30777a));});return BPromise[_0xeccd('0x40')](_0x37303f);})[_0xeccd('0x36')](function(_0x58f99d){if(_0x58f99d){if(!_0x58f99d[_0xeccd('0x37')]||_0x58f99d[_0xeccd('0x37')]!==_0xeccd('0x38')){logger[_0xeccd('0x39')](util[_0xeccd('0x41')](_0x58f99d,{'showHidden':![],'depth':null}));}}});}exports[_0xeccd('0x42')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x6be1=['sentiment','sentimentAccountId','sentimentRegion','language','bucket','Sequelize','Transcript\x20not\x20available','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Negative','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','Sentiment\x20Analysis\x20not\x20requested','Sentiment\x20Analysis\x20not\x20configured','findOne','Positive','COMPLETED','catch','name','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Settings\x20not\x20available','transcribeAccountId','transcribeRegion','Transcribe\x20not\x20configured','error','start','lodash','aws-sdk','../../config/logger','transcribe','TranscribeService','Comprehend','detectSentiment','substring','info','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data2','format','TranscriptionJobStatus','fileText','TranscriptionJob','Transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','then','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','ValidationError'];(function(_0x31c84b,_0x47bf85){var _0x1c8ffb=function(_0x1f6e02){while(--_0x1f6e02){_0x31c84b['push'](_0x31c84b['shift']());}};_0x1c8ffb(++_0x47bf85);}(_0x6be1,0x12f));var _0x16be=function(_0x212c83,_0x4e5d63){_0x212c83=_0x212c83-0x0;var _0x5d0989=_0x6be1[_0x212c83];return _0x5d0989;};var _=require(_0x16be('0x0'));var AWS=require(_0x16be('0x1'));var rp=require('request-promise');var util=require('util');var BPromise=require('bluebird');var db=require('../../mysqldb')['db'];var logger=require(_0x16be('0x2'))(_0x16be('0x3'));function getTranscriptionJob(_0x579ab9,_0x18fafc,_0x8e7a1,_0x5743a){return new Promise(function(_0x36e4da,_0x19754e){var _0x2f6c26=new AWS[(_0x16be('0x4'))]({'accessKeyId':_0x18fafc,'secretAccessKey':_0x579ab9,'region':_0x8e7a1});_0x2f6c26['getTranscriptionJob']({'TranscriptionJobName':_0x5743a},function(_0x36438c,_0x32ff9a){if(_0x36438c){return _0x19754e(_0x36438c);}else{return _0x36e4da(_0x32ff9a);}});});}function sentiment(_0x1c0460,_0x134253,_0x1a820e,_0x3227ca,_0xbace4f){return new Promise(function(_0x2a5ab3,_0x1a1a06){var _0x34dfe8=new AWS[(_0x16be('0x5'))]({'accessKeyId':_0x134253,'secretAccessKey':_0x1c0460,'region':_0x1a820e});_0x34dfe8[_0x16be('0x6')]({'Text':_0x3227ca,'LanguageCode':_0xbace4f[_0x16be('0x7')](0x0,0x2)},function(_0x39551d,_0xf25111){if(_0x39551d){return _0x1a1a06(_0x39551d);}else{return _0x2a5ab3(_0xf25111);}});});}function checkTranscribeJob(_0x5d38e4,_0x597c4d,_0x13aa8c){var _0xb321f1;return new BPromise(function(_0xe2330d,_0x142104){logger[_0x16be('0x8')](util['format'](_0x16be('0x9'),_0x5d38e4['id'],_0x5d38e4[_0x16be('0xa')]));return getTranscriptionJob(_0x13aa8c['data1'],_0x13aa8c[_0x16be('0xb')],_0x597c4d['transcribeRegion'],_0x5d38e4['transcribeName'])['then'](function(_0x74e610){logger[_0x16be('0x8')](util[_0x16be('0xc')]('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x5d38e4['id'],_0x5d38e4[_0x16be('0xa')],_0x74e610['TranscriptionJob'][_0x16be('0xd')]));if(!_0x5d38e4[_0x16be('0xe')]){switch(_0x74e610[_0x16be('0xf')][_0x16be('0xd')]){case'COMPLETED':var _0x2e1055={'transcribeStatus':_0x74e610[_0x16be('0xf')]['TranscriptionJobStatus'],'fileUri':_0x74e610[_0x16be('0xf')][_0x16be('0x10')]['TranscriptFileUri']};logger[_0x16be('0x8')](util[_0x16be('0xc')]('[RECORDING:%d]\x20Get\x20transcript',_0x5d38e4['id']));return rp({'uri':_0x74e610[_0x16be('0xf')][_0x16be('0x10')]['TranscriptFileUri'],'json':!![]})['then'](function(_0x2975cc){logger[_0x16be('0x8')](util['format'](_0x16be('0x11'),_0x5d38e4['id']));if(_0x2975cc&&_0x2975cc[_0x16be('0x12')]&&_0x2975cc[_0x16be('0x12')][_0x16be('0x13')]&&_0x2975cc['results'][_0x16be('0x13')][_0x16be('0x14')]){_0x2e1055['fileText']='';for(var _0x14ba98=0x0;_0x14ba98<_0x2975cc['results']['transcripts'][_0x16be('0x14')];_0x14ba98++){_0x2e1055[_0x16be('0xe')]+=_0x2975cc['results'][_0x16be('0x13')][_0x14ba98][_0x16be('0x15')]+'';}}return _0x5d38e4[_0x16be('0x16')](_0x2e1055);})[_0x16be('0x17')](function(){logger[_0x16be('0x8')](util[_0x16be('0xc')](_0x16be('0x18'),_0x5d38e4['id']));if(!_0x5d38e4[_0x16be('0x19')]){throw new db['Sequelize'][(_0x16be('0x1a'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x597c4d[_0x16be('0x1b')]||!_0x597c4d[_0x16be('0x1c')]||!_0x597c4d[_0x16be('0x1d')]||!_0x597c4d[_0x16be('0x1e')]||!_0x597c4d[_0x16be('0x1f')]){throw new db[(_0x16be('0x20'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x2e1055[_0x16be('0xe')]){throw new Error(_0x16be('0x21'));}if(_0x597c4d[_0x16be('0x1c')]===_0x13aa8c['id']){return _0x13aa8c;}else{return db[_0x16be('0x22')]['findOne']({'where':{'id':_settings[_0x16be('0x1c')]}});}})['then'](function(_0x9fa823){if(!_0x9fa823){throw new db[(_0x16be('0x20'))][(_0x16be('0x1a'))](_0x16be('0x23'));}if(!_0x9fa823[_0x16be('0x24')]||!_0x9fa823[_0x16be('0xb')]){throw new db['Sequelize'][(_0x16be('0x1a'))](_0x16be('0x25'));}_0xb321f1=_0x9fa823;logger[_0x16be('0x8')](util['format']('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x5d38e4['id']));return sentiment(_0xb321f1[_0x16be('0x24')],_0xb321f1[_0x16be('0xb')],_0x597c4d[_0x16be('0x1d')],_0x2e1055[_0x16be('0xe')],_0x597c4d[_0x16be('0x1e')]);})[_0x16be('0x17')](function(_0x24d842){logger['info'](util['format'](_0x16be('0x26'),_0x5d38e4['id']));return _0x5d38e4[_0x16be('0x16')]({'sentiment':_0x24d842[_0x16be('0x27')],'sPositive':_0x24d842[_0x16be('0x28')]['Positive'],'sNegative':_0x24d842[_0x16be('0x28')][_0x16be('0x29')],'sMixed':_0x24d842[_0x16be('0x28')][_0x16be('0x2a')],'sNeutral':_0x24d842['SentimentScore'][_0x16be('0x2b')]});})['then'](function(){logger['info'](util[_0x16be('0xc')](_0x16be('0x18'),_0x5d38e4['id']));_0xe2330d();});case'FAILED':return _0x5d38e4[_0x16be('0x16')]({'transcribeStatus':_0x16be('0x2c'),'failureReason':_0x74e610[_0x16be('0xf')][_0x16be('0x2d')]})[_0x16be('0x17')](function(){logger['info'](util[_0x16be('0xc')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x5d38e4['id']));_0xe2330d();});default:logger['info'](util[_0x16be('0xc')](_0x16be('0x2e'),_0x5d38e4['id']));break;}}else{return BPromise[_0x16be('0x2f')]()['then'](function(){if(!_0x5d38e4[_0x16be('0x19')]){throw new db[(_0x16be('0x20'))]['ValidationError'](_0x16be('0x30'));}if(!_0x597c4d['sentiment']||!_0x597c4d[_0x16be('0x1c')]||!_0x597c4d[_0x16be('0x1d')]||!_0x597c4d[_0x16be('0x1e')]||!_0x597c4d[_0x16be('0x1f')]){throw new db[(_0x16be('0x20'))][(_0x16be('0x1a'))](_0x16be('0x31'));}if(!_0x5d38e4[_0x16be('0xe')]){throw new Error(_0x16be('0x21'));}if(_0x597c4d[_0x16be('0x1c')]===_0x13aa8c['id']){return _0x13aa8c;}else{return db['CloudProvider'][_0x16be('0x32')]({'where':{'id':_settings[_0x16be('0x1c')]}});}})[_0x16be('0x17')](function(_0x5675fd){if(!_0x5675fd){throw new db[(_0x16be('0x20'))][(_0x16be('0x1a'))](_0x16be('0x23'));}if(!_0x5675fd['data1']||!_0x5675fd[_0x16be('0xb')]){throw new db['Sequelize'][(_0x16be('0x1a'))](_0x16be('0x25'));}_0xb321f1=_0x5675fd;logger['info'](util[_0x16be('0xc')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x5d38e4['id']));return sentiment(_0xb321f1[_0x16be('0x24')],_0xb321f1['data2'],_0x597c4d[_0x16be('0x1d')],_0x5d38e4[_0x16be('0xe')],_0x597c4d[_0x16be('0x1e')]);})['then'](function(_0x2c8ef4){logger['info'](util[_0x16be('0xc')](_0x16be('0x26'),_0x5d38e4['id']));return _0x5d38e4['update']({'sentiment':_0x2c8ef4[_0x16be('0x27')],'sPositive':_0x2c8ef4[_0x16be('0x28')][_0x16be('0x33')],'sNegative':_0x2c8ef4[_0x16be('0x28')][_0x16be('0x29')],'sMixed':_0x2c8ef4[_0x16be('0x28')][_0x16be('0x2a')],'sNeutral':_0x2c8ef4['SentimentScore'][_0x16be('0x2b')],'transcribeStatus':_0x16be('0x34')});})[_0x16be('0x17')](function(){logger[_0x16be('0x8')](util[_0x16be('0xc')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x5d38e4['id']));_0xe2330d();});}})[_0x16be('0x35')](function(_0x13c6a9){if(_0x13c6a9){if(!_0x13c6a9[_0x16be('0x36')]||_0x13c6a9[_0x16be('0x36')]!=='SequelizeValidationError'){logger['error'](util[_0x16be('0xc')](_0x16be('0x37'),_0x5d38e4['id']),util['inspect'](_0x13c6a9,{'showHidden':![],'depth':null}));}}_0xe2330d();});});}function checkTranscribe(){var _0x57af6a;var _0x345ec5;var _0x469229;return db[_0x16be('0x38')][_0x16be('0x39')]({'where':{'transcribeStatus':_0x16be('0x3a')}})[_0x16be('0x17')](function(_0x14f44b){if(!_0x14f44b||!_0x14f44b[_0x16be('0x14')]){throw new db[(_0x16be('0x20'))][(_0x16be('0x1a'))](_0x16be('0x3b'));}_0x57af6a=_0x14f44b;return db['Setting'][_0x16be('0x32')]({'where':{'id':0x1}});})[_0x16be('0x17')](function(_0x28add6){if(!_0x28add6){throw new db[(_0x16be('0x20'))][(_0x16be('0x1a'))](_0x16be('0x3c'));}_0x345ec5=_0x28add6;if(!_0x345ec5[_0x16be('0x3')]||!_0x345ec5[_0x16be('0x3d')]||!_0x345ec5[_0x16be('0x3e')]||!_0x345ec5[_0x16be('0x1e')]||!_0x345ec5['bucket']){throw new db[(_0x16be('0x20'))][(_0x16be('0x1a'))](_0x16be('0x3f'));}return db[_0x16be('0x22')]['findOne']({'where':{'id':_0x345ec5[_0x16be('0x3d')]}});})[_0x16be('0x17')](function(_0x2897b1){if(!_0x2897b1){throw new db[(_0x16be('0x20'))][(_0x16be('0x1a'))](_0x16be('0x23'));}if(!_0x2897b1['data1']||!_0x2897b1[_0x16be('0xb')]){throw new db['Sequelize'][(_0x16be('0x1a'))](_0x16be('0x25'));}_0x469229=_0x2897b1;var _0x50b7e2=[];_0x57af6a['forEach'](function(_0x4df719){_0x50b7e2['push'](checkTranscribeJob(_0x4df719,_0x345ec5,_0x469229));});return BPromise['all'](_0x50b7e2);})['catch'](function(_0x163913){if(_0x163913){if(!_0x163913['name']||_0x163913[_0x16be('0x36')]!=='SequelizeValidationError'){logger[_0x16be('0x40')](util['inspect'](_0x163913,{'showHidden':![],'depth':null}));}}});}exports[_0x16be('0x41')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file diff --git a/server/config/schedule/whatsapp.js b/server/config/schedule/whatsapp.js index 23929d9..4390884 100644 --- a/server/config/schedule/whatsapp.js +++ b/server/config/schedule/whatsapp.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6d0c=['info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','then','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','subtract','hours','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6d0c,0x171));var _0xc6d0=function(_0x3ca802,_0x5cafff){_0x3ca802=_0x3ca802-0x0;var _0x248c71=_0x6d0c[_0x3ca802];return _0x248c71;};'use strict';var _=require('lodash');var moment=require('moment');var Redis=require('ioredis');var util=require(_0xc6d0('0x0'));var config=require(_0xc6d0('0x1'));var db=require(_0xc6d0('0x2'))['db'];var logger=require(_0xc6d0('0x3'))(_0xc6d0('0x4'));config[_0xc6d0('0x5')]=_[_0xc6d0('0x6')](config[_0xc6d0('0x5')],{'host':_0xc6d0('0x7'),'port':0x18eb});var io=require(_0xc6d0('0x8'))(new Redis(config[_0xc6d0('0x5')]));function closeInteractions(){var _0x175038=[];return db[_0xc6d0('0x9')][_0xc6d0('0xa')]({'raw':!![],'attributes':['id',_0xc6d0('0xb')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xc6d0('0xc')](0x18,_0xc6d0('0xd'))}}})['then'](function(_0x307281){if(_0x307281&&_0x307281[_0xc6d0('0xe')]){_0x175038=_['map'](_0x307281||[],'id');logger[_0xc6d0('0xf')](_0xc6d0('0x10'),_0x175038[_0xc6d0('0x11')]());return db[_0xc6d0('0x9')][_0xc6d0('0x12')]({'closeReason':_0xc6d0('0x13'),'disposition':_0xc6d0('0x14'),'closed':!![],'closedAt':moment()[_0xc6d0('0x15')](_0xc6d0('0x16'))},{'where':{'id':_0x175038}});}})[_0xc6d0('0x17')](function(){if(_0x175038&&_0x175038[_0xc6d0('0xe')]){logger['info'](_0xc6d0('0x18'),_0x175038[_0xc6d0('0x11')]());for(var _0x2b5dc3=0x0;_0x2b5dc3<_0x175038['length'];_0x2b5dc3++){io[_0xc6d0('0x19')](_0xc6d0('0x1a'),{'id':_0x175038[_0x2b5dc3],'closed':!![]});}}})[_0xc6d0('0x1b')](function(_0x316c0f){logger[_0xc6d0('0x1c')](_0xc6d0('0x1d'),_0x316c0f?util[_0xc6d0('0x1e')](_0x316c0f,{'showHidden':![],'depth':null}):'');});}exports[_0xc6d0('0x1f')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xdd44=['ioredis','util','../../config/environment','../../mysqldb','../logger','redis','defaults','localhost','socket.io-emitter','findAll','subtract','hours','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','WhatsappInteraction','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0xdd44,0xa8));var _0x4dd4=function(_0x3e6d5d,_0x264c7a){_0x3e6d5d=_0x3e6d5d-0x0;var _0x238923=_0xdd44[_0x3e6d5d];return _0x238923;};'use strict';var _=require(_0x4dd4('0x0'));var moment=require(_0x4dd4('0x1'));var Redis=require(_0x4dd4('0x2'));var util=require(_0x4dd4('0x3'));var config=require(_0x4dd4('0x4'));var db=require(_0x4dd4('0x5'))['db'];var logger=require(_0x4dd4('0x6'))('schedule');config[_0x4dd4('0x7')]=_[_0x4dd4('0x8')](config['redis'],{'host':_0x4dd4('0x9'),'port':0x18eb});var io=require(_0x4dd4('0xa'))(new Redis(config[_0x4dd4('0x7')]));function closeInteractions(){var _0x4ce284=[];return db['WhatsappInteraction'][_0x4dd4('0xb')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x4dd4('0xc')](0x18,_0x4dd4('0xd'))}}})[_0x4dd4('0xe')](function(_0x40d376){if(_0x40d376&&_0x40d376[_0x4dd4('0xf')]){_0x4ce284=_[_0x4dd4('0x10')](_0x40d376||[],'id');logger[_0x4dd4('0x11')](_0x4dd4('0x12'),_0x4ce284[_0x4dd4('0x13')]());return db[_0x4dd4('0x14')][_0x4dd4('0x15')]({'closeReason':_0x4dd4('0x16'),'disposition':_0x4dd4('0x17'),'closed':!![],'closedAt':moment()[_0x4dd4('0x18')](_0x4dd4('0x19'))},{'where':{'id':_0x4ce284}});}})[_0x4dd4('0xe')](function(){if(_0x4ce284&&_0x4ce284[_0x4dd4('0xf')]){logger['info'](_0x4dd4('0x1a'),_0x4ce284[_0x4dd4('0x13')]());for(var _0x46a6bf=0x0;_0x46a6bf<_0x4ce284[_0x4dd4('0xf')];_0x46a6bf++){io[_0x4dd4('0x1b')](_0x4dd4('0x1c'),{'id':_0x4ce284[_0x46a6bf],'closed':!![]});}}})[_0x4dd4('0x1d')](function(_0x107840){logger[_0x4dd4('0x1e')](_0x4dd4('0x1f'),_0x107840?util[_0x4dd4('0x20')](_0x107840,{'showHidden':![],'depth':null}):'');});}exports[_0x4dd4('0x21')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index 6159eae..18434cc 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x45c5=['log','contacts2','hopper2','catch','util','../mysqldb','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','push','now','CmContact','destroy','then','finished\x20populating','contacts1','CmHopper'];(function(_0x55665c,_0x318e82){var _0x3ef790=function(_0x11b9f5){while(--_0x11b9f5){_0x55665c['push'](_0x55665c['shift']());}};_0x3ef790(++_0x318e82);}(_0x45c5,0x17e));var _0x545c=function(_0x26fa79,_0x3ef679){_0x26fa79=_0x26fa79-0x0;var _0x4a4c4e=_0x45c5[_0x26fa79];return _0x4a4c4e;};'use strict';var util=require(_0x545c('0x0'));var db=require(_0x545c('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0x545c('0x2')+i,'lastName':_0x545c('0x3')+i,'phone':0xf879fb460+i,'email':_0x545c('0x4')+i+_0x545c('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x545c('0x6')]({'id':i,'active':![],'scheduledat':Date[_0x545c('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x545c('0x7')](),'updatedAt':Date[_0x545c('0x7')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x545c('0x6')]({'id':i,'firstName':_0x545c('0x2')+i,'lastName':_0x545c('0x3')+i,'phone':0xf879fb460+i,'email':_0x545c('0x4')+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x545c('0x6')]({'id':i,'active':![],'scheduledat':Date[_0x545c('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x545c('0x7')](),'updatedAt':Date[_0x545c('0x7')]()});}db[_0x545c('0x8')][_0x545c('0x9')]({'where':{}})[_0x545c('0xa')](function(){return db[_0x545c('0x8')]['bulkCreate'](contacts);})[_0x545c('0xa')](function(){console['log'](_0x545c('0xb'),_0x545c('0xc'));return db[_0x545c('0xd')][_0x545c('0x9')]({'where':{}});})['then'](function(){return db[_0x545c('0xd')]['bulkCreate'](hopper);})[_0x545c('0xa')](function(){console[_0x545c('0xe')](_0x545c('0xb'),'hopper1');return db[_0x545c('0x8')]['bulkCreate'](contacts2);})[_0x545c('0xa')](function(){console[_0x545c('0xe')]('finished\x20populating',_0x545c('0xf'));return db[_0x545c('0xd')]['bulkCreate'](hopper2);})['then'](function(){console['log'](_0x545c('0xb'),_0x545c('0x10'));})[_0x545c('0x11')](function(_0xb1ce20){console[_0x545c('0xe')](_0xb1ce20);}); \ No newline at end of file +var _0xebe0=['../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact','destroy','then','bulkCreate','log','finished\x20populating','contacts1','CmHopper','hopper1','catch','util'];(function(_0xbf8ebe,_0x3b69a5){var _0x1e25e8=function(_0x40c390){while(--_0x40c390){_0xbf8ebe['push'](_0xbf8ebe['shift']());}};_0x1e25e8(++_0x3b69a5);}(_0xebe0,0xfb));var _0x0ebe=function(_0x46dec6,_0x27bf2b){_0x46dec6=_0x46dec6-0x0;var _0x47b60b=_0xebe0[_0x46dec6];return _0x47b60b;};'use strict';var util=require(_0x0ebe('0x0'));var db=require(_0x0ebe('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x0ebe('0x2')]({'id':i,'firstName':_0x0ebe('0x3')+i,'lastName':_0x0ebe('0x4')+i,'phone':0xf879fb460+i,'email':_0x0ebe('0x5')+i+_0x0ebe('0x6')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0x0ebe('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x0ebe('0x7')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x0ebe('0x4')+i,'phone':0xf879fb460+i,'email':_0x0ebe('0x5')+i+_0x0ebe('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x0ebe('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x0ebe('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date['now']()});}db[_0x0ebe('0x8')][_0x0ebe('0x9')]({'where':{}})[_0x0ebe('0xa')](function(){return db[_0x0ebe('0x8')][_0x0ebe('0xb')](contacts);})['then'](function(){console[_0x0ebe('0xc')](_0x0ebe('0xd'),_0x0ebe('0xe'));return db[_0x0ebe('0xf')][_0x0ebe('0x9')]({'where':{}});})[_0x0ebe('0xa')](function(){return db[_0x0ebe('0xf')]['bulkCreate'](hopper);})[_0x0ebe('0xa')](function(){console['log']('finished\x20populating',_0x0ebe('0x10'));return db['CmContact']['bulkCreate'](contacts2);})['then'](function(){console[_0x0ebe('0xc')](_0x0ebe('0xd'),'contacts2');return db[_0x0ebe('0xf')]['bulkCreate'](hopper2);})[_0x0ebe('0xa')](function(){console[_0x0ebe('0xc')](_0x0ebe('0xd'),'hopper2');})[_0x0ebe('0x11')](function(_0x3a25f4){console[_0x0ebe('0xc')](_0x3a25f4);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 104eccd..985f145 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa81d=['/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','then','add\x20user','util','../mysqldb','agent','format','%s%s','%s%s@xcally.com','password','friend','udp','all','yes'];(function(_0x39b0ee,_0x54473b){var _0x127942=function(_0x401382){while(--_0x401382){_0x39b0ee['push'](_0x39b0ee['shift']());}};_0x127942(++_0x54473b);}(_0xa81d,0x14b));var _0xda81=function(_0x39e2f1,_0x53ed8f){_0x39e2f1=_0x39e2f1-0x0;var _0x5272c5=_0xa81d[_0x39e2f1];return _0x5272c5;};'use strict';var util=require(_0xda81('0x0'));var db=require(_0xda81('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util['format']('%s%s',_0xda81('0x2'),i),'fullname':util[_0xda81('0x3')](_0xda81('0x4'),_0xda81('0x2'),i),'email':util[_0xda81('0x3')](_0xda81('0x5'),_0xda81('0x2'),i),'role':'agent','password':_0xda81('0x6'),'internal':0xfa0+i,'type':_0xda81('0x7'),'transport':[_0xda81('0x8'),'ws','wss'],'disallow':[_0xda81('0x9')],'allow':['ulaw'],'defaultuser':util[_0xda81('0x3')](_0xda81('0x4'),_0xda81('0x2'),i),'encryption':_0xda81('0xa'),'avpf':_0xda81('0xa'),'force_avp':_0xda81('0xa'),'icesupport':_0xda81('0xa'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':_0xda81('0xb'),'dtlsprivatekey':_0xda81('0xc'),'dtlssetup':_0xda81('0xd'),'callerid':util['format'](_0xda81('0xe'),util[_0xda81('0x3')](_0xda81('0x4'),_0xda81('0x2'),i),0xfa0+i)});}db[_0xda81('0xf')][_0xda81('0x10')](users)[_0xda81('0x11')](function(){console['log'](_0xda81('0x12'));})['catch'](function(_0x182df3){console['log'](_0x182df3);}); \ No newline at end of file +var _0x1a9a=['%s%s','agent','%s%s@xcally.com','password','friend','wss','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','then','log','add\x20user','../mysqldb','push','format'];(function(_0x57391d,_0x24d2ef){var _0x4d9c1e=function(_0x24f50b){while(--_0x24f50b){_0x57391d['push'](_0x57391d['shift']());}};_0x4d9c1e(++_0x24d2ef);}(_0x1a9a,0x166));var _0xa1a9=function(_0x4c2722,_0x16668c){_0x4c2722=_0x4c2722-0x0;var _0x25336d=_0x1a9a[_0x4c2722];return _0x25336d;};'use strict';var util=require('util');var db=require(_0xa1a9('0x0'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xa1a9('0x1')]({'name':util[_0xa1a9('0x2')](_0xa1a9('0x3'),_0xa1a9('0x4'),i),'fullname':util['format']('%s%s',_0xa1a9('0x4'),i),'email':util[_0xa1a9('0x2')](_0xa1a9('0x5'),_0xa1a9('0x4'),i),'role':_0xa1a9('0x4'),'password':_0xa1a9('0x6'),'internal':0xfa0+i,'type':_0xa1a9('0x7'),'transport':['udp','ws',_0xa1a9('0x8')],'disallow':['all'],'allow':[_0xa1a9('0x9')],'defaultuser':util[_0xa1a9('0x2')](_0xa1a9('0x3'),_0xa1a9('0x4'),i),'encryption':'yes','avpf':_0xa1a9('0xa'),'force_avp':_0xa1a9('0xa'),'icesupport':_0xa1a9('0xa'),'dtlsenable':_0xa1a9('0xa'),'dtlsverify':'no','dtlscertfile':_0xa1a9('0xb'),'dtlsprivatekey':_0xa1a9('0xc'),'dtlssetup':_0xa1a9('0xd'),'callerid':util[_0xa1a9('0x2')](_0xa1a9('0xe'),util[_0xa1a9('0x2')](_0xa1a9('0x3'),'agent',i),0xfa0+i)});}db[_0xa1a9('0xf')]['bulkCreate'](users)[_0xa1a9('0x10')](function(){console[_0xa1a9('0x11')](_0xa1a9('0x12'));})['catch'](function(_0x5c30dc){console[_0xa1a9('0x11')](_0x5c30dc);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 3f00ef7..3e0f1da 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa63a=['length','user:%s','handshake','query','find','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteractions','OpenchannelInteraction','WhatsappInteraction','WhatsappInteractions','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','SmsQueue','MailQueue','Trunk','user','VoiceQueues','FaxQueue','OpenchannelQueue','Telephones','Trunks','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getWhatsappQueues','voice','fax','sms','mail','openchannel','telephone:%s','campaign:%s:%s','leave','removeChatInteractions','emit','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','default','setMaxListeners','address','request','connection','remotePort','connectedAt','nsp','disconnect','util','bluebird','../mysqldb','./environment','name','Agents','User','role','agent','type','ivr','UserProfileSection','findOne','then','autoAssociation','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','IvrCampaigns','UserProfileResource','resourceId','map','where','format'];(function(_0x548200,_0x3241b8){var _0x1a6d74=function(_0x412f84){while(--_0x412f84){_0x548200['push'](_0x548200['shift']());}};_0x1a6d74(++_0x3241b8);}(_0xa63a,0x154));var _0xaa63=function(_0x41c49e,_0x4e9e2c){_0x41c49e=_0x41c49e-0x0;var _0x648a67=_0xa63a[_0x41c49e];return _0x648a67;};'use strict';var _=require('lodash');var util=require(_0xaa63('0x0'));var BPromise=require(_0xaa63('0x1'));var db=require(_0xaa63('0x2'))['db'];var config=require(_0xaa63('0x3'));var queryQueues={'attributes':['id',_0xaa63('0x4')],'include':[{'as':_0xaa63('0x5'),'model':db[_0xaa63('0x6')],'attributes':['id',_0xaa63('0x4'),_0xaa63('0x7')],'raw':!![],'where':{'role':_0xaa63('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xaa63('0x4')],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0xaa63('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0xaa63('0x9')],'where':{'type':_0xaa63('0xa')}};function getAssociatedResources(_0x4be7f7,_0x116a8b,_0x146c00){return db[_0xaa63('0xb')][_0xaa63('0xc')]({'where':{'name':_0x4be7f7,'userProfileId':_0x116a8b},'raw':!![]})[_0xaa63('0xd')](function(_0x12de55){if(_0x12de55){if(_0x12de55[_0xaa63('0xe')]){switch(_0x4be7f7){case'VoiceQueues':case _0xaa63('0xf'):case _0xaa63('0x10'):case _0xaa63('0x11'):case _0xaa63('0x12'):case _0xaa63('0x13'):case _0xaa63('0x14'):return db[_0x146c00]['findAll'](queryQueues);case'Telephones':return db[_0x146c00]['findAll'](queryTelephones);case'Trunks':return db[_0x146c00][_0xaa63('0x15')](queryTrunks);case _0xaa63('0x16'):return db[_0x146c00][_0xaa63('0x15')](queryCampaigns);}}else{return db[_0xaa63('0x17')][_0xaa63('0x15')]({'attributes':[_0xaa63('0x18')],'where':{'sectionId':_0x12de55['id']},'raw':!![]})[_0xaa63('0xd')](function(_0x345b97){if(_0x345b97){var _0x574a86={'where':{'id':_[_0xaa63('0x19')](_0x345b97,_0xaa63('0x18'))},'raw':!![]};switch(_0x146c00){case _0xaa63('0x6'):_0x574a86[_0xaa63('0x1a')][_0xaa63('0x7')]='telephone';break;case'Campaign':_0x574a86[_0xaa63('0x1a')][_0xaa63('0x9')]=_0xaa63('0xa');break;}return db[_0x146c00][_0xaa63('0x15')](_0x574a86);}else{return[];}});}}else{return[];}})[_0xaa63('0xd')](function(_0xa300c7){return _0xa300c7;});}function joinOrLeaveQueues(_0x115293,_0x1852fb,_0x1d7691,_0x560527){_0x115293[_0x1852fb](util[_0xaa63('0x1b')]('%s:queue:%s',_0x1d7691,_0x560527[_0xaa63('0x4')]));if(_0x560527[_0xaa63('0x5')]){for(var _0x45b325=0x0;_0x45b325<_0x560527[_0xaa63('0x5')][_0xaa63('0x1c')];_0x45b325+=0x1){_0x115293[_0x1852fb](util[_0xaa63('0x1b')](_0xaa63('0x1d'),_0x560527[_0xaa63('0x5')][_0x45b325][_0xaa63('0x4')]));}}}function joinOrLeave(_0x2194d1,_0x494112,_0x3f4f64){var _0x224e69;if(_0x2194d1[_0xaa63('0x1e')][_0xaa63('0x1f')]['id']){db['User'][_0xaa63('0x20')]({'attributes':['id',_0xaa63('0x4'),_0xaa63('0x7'),_0xaa63('0x21')],'where':{'id':_0x2194d1[_0xaa63('0x1e')]['query']['id']},'include':[{'model':db[_0xaa63('0x22')],'as':_0xaa63('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0xaa63('0x24')],'as':_0xaa63('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0xaa63('0x26')],'as':_0xaa63('0x27'),'attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':_0xaa63('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0xaa63('0x29')],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xaa63('0x2a')],'as':_0xaa63('0x2b'),'attributes':['id'],'raw':!![]}]})[_0xaa63('0xd')](function(_0x129233){if(_0x129233){_0x224e69=_0x129233;_0x2194d1[_0x494112](util[_0xaa63('0x1b')](_0xaa63('0x1d'),_0x129233[_0xaa63('0x4')]));var _0x52ead7=[];switch(_0x129233[_0xaa63('0x7')]){case'admin':_0x2194d1[_0x494112](_0xaa63('0x2c'));_0x2194d1[_0x494112](_0xaa63('0x2d'));if(queryQueues[_0xaa63('0x2e')]('include')){delete queryQueues[_0xaa63('0x2f')];}_0x52ead7[_0xaa63('0x30')](db[_0xaa63('0x31')][_0xaa63('0x15')](queryQueues));_0x52ead7[_0xaa63('0x30')](db[_0xaa63('0x32')][_0xaa63('0x15')](queryQueues));_0x52ead7['push'](db['FaxQueue']['findAll'](queryQueues));_0x52ead7[_0xaa63('0x30')](db[_0xaa63('0x33')][_0xaa63('0x15')](queryQueues));_0x52ead7[_0xaa63('0x30')](db[_0xaa63('0x34')][_0xaa63('0x15')](queryQueues));_0x52ead7['push'](db['OpenchannelQueue'][_0xaa63('0x15')](queryQueues));_0x52ead7[_0xaa63('0x30')](db['WhatsappQueue'][_0xaa63('0x15')](queryQueues));_0x52ead7[_0xaa63('0x30')](db[_0xaa63('0x6')][_0xaa63('0x15')](queryTelephones));_0x52ead7[_0xaa63('0x30')](db[_0xaa63('0x35')][_0xaa63('0x15')](queryTrunks));_0x52ead7['push'](db['Campaign'][_0xaa63('0x15')](queryCampaigns));_0x52ead7['push'](db[_0xaa63('0x6')][_0xaa63('0x15')](queryAgents));break;case _0xaa63('0x36'):_0x2194d1[_0x494112](_0xaa63('0x2c'));_0x2194d1[_0x494112]('voice:outbound');_0x52ead7[_0xaa63('0x30')](getAssociatedResources(_0xaa63('0x37'),_0x129233[_0xaa63('0x21')],_0xaa63('0x31')));_0x52ead7['push'](getAssociatedResources(_0xaa63('0xf'),_0x129233[_0xaa63('0x21')],_0xaa63('0x32')));_0x52ead7[_0xaa63('0x30')](getAssociatedResources(_0xaa63('0x10'),_0x129233[_0xaa63('0x21')],_0xaa63('0x38')));_0x52ead7[_0xaa63('0x30')](getAssociatedResources('SmsQueues',_0x129233['userProfileId'],_0xaa63('0x33')));_0x52ead7[_0xaa63('0x30')](getAssociatedResources(_0xaa63('0x12'),_0x129233[_0xaa63('0x21')],_0xaa63('0x34')));_0x52ead7[_0xaa63('0x30')](getAssociatedResources(_0xaa63('0x13'),_0x129233['userProfileId'],_0xaa63('0x39')));_0x52ead7[_0xaa63('0x30')](getAssociatedResources('WhatsappQueues',_0x129233['userProfileId'],'WhatsappQueue'));_0x52ead7[_0xaa63('0x30')](getAssociatedResources(_0xaa63('0x3a'),_0x129233[_0xaa63('0x21')],_0xaa63('0x6')));_0x52ead7[_0xaa63('0x30')](getAssociatedResources(_0xaa63('0x3b'),_0x129233[_0xaa63('0x21')],_0xaa63('0x35')));_0x52ead7[_0xaa63('0x30')](getAssociatedResources(_0xaa63('0x16'),_0x129233['userProfileId'],'Campaign'));_0x52ead7[_0xaa63('0x30')](db[_0xaa63('0x6')][_0xaa63('0x15')](queryAgents));break;case _0xaa63('0x8'):_0x2194d1[_0x494112]('voice:inbound');_0x2194d1[_0x494112](_0xaa63('0x2d'));_0x52ead7['push'](_0x129233['getVoiceQueues']({'attributes':['id','name']}));_0x52ead7['push'](_0x129233[_0xaa63('0x3c')]({'attributes':['id',_0xaa63('0x4')]}));_0x52ead7[_0xaa63('0x30')](_0x129233[_0xaa63('0x3d')]({'attributes':['id',_0xaa63('0x4')]}));_0x52ead7[_0xaa63('0x30')](_0x129233[_0xaa63('0x3e')]({'attributes':['id',_0xaa63('0x4')]}));_0x52ead7[_0xaa63('0x30')](_0x129233[_0xaa63('0x3f')]({'attributes':['id','name']}));_0x52ead7['push'](_0x129233['getOpenchannelQueues']({'attributes':['id',_0xaa63('0x4')]}));_0x52ead7['push'](_0x129233[_0xaa63('0x40')]({'attributes':['id',_0xaa63('0x4')]}));break;}return BPromise['all'](_0x52ead7);}})['then'](function(_0x4c6d8b){if(_0x4c6d8b&&_0x4c6d8b[_0xaa63('0x1c')]){for(var _0x16366d=0x0;_0x16366d<_0x4c6d8b[_0xaa63('0x1c')];_0x16366d+=0x1){for(var _0x1454ab=0x0;_0x1454ab<_0x4c6d8b[_0x16366d]['length'];_0x1454ab+=0x1){switch(_0x16366d){case 0x0:joinOrLeaveQueues(_0x2194d1,_0x494112,_0xaa63('0x41'),_0x4c6d8b[_0x16366d][_0x1454ab]);break;case 0x1:joinOrLeaveQueues(_0x2194d1,_0x494112,'chat',_0x4c6d8b[_0x16366d][_0x1454ab]);break;case 0x2:joinOrLeaveQueues(_0x2194d1,_0x494112,_0xaa63('0x42'),_0x4c6d8b[_0x16366d][_0x1454ab]);break;case 0x3:joinOrLeaveQueues(_0x2194d1,_0x494112,_0xaa63('0x43'),_0x4c6d8b[_0x16366d][_0x1454ab]);break;case 0x4:joinOrLeaveQueues(_0x2194d1,_0x494112,_0xaa63('0x44'),_0x4c6d8b[_0x16366d][_0x1454ab]);break;case 0x5:joinOrLeaveQueues(_0x2194d1,_0x494112,_0xaa63('0x45'),_0x4c6d8b[_0x16366d][_0x1454ab]);break;case 0x6:joinOrLeaveQueues(_0x2194d1,_0x494112,'whatsapp',_0x4c6d8b[_0x16366d][_0x1454ab]);break;case 0x7:if(_0x224e69[_0xaa63('0x7')]!==_0xaa63('0x8'))_0x2194d1[_0x494112](util[_0xaa63('0x1b')](_0xaa63('0x46'),_0x4c6d8b[_0x16366d][_0x1454ab][_0xaa63('0x4')]));break;case 0x8:if(_0x224e69[_0xaa63('0x7')]!==_0xaa63('0x8'))_0x2194d1[_0x494112](util['format']('trunk:%s',_0x4c6d8b[_0x16366d][_0x1454ab][_0xaa63('0x4')]));break;case 0x9:if(_0x224e69['role']!=='agent')_0x2194d1[_0x494112](util[_0xaa63('0x1b')](_0xaa63('0x47'),_0x4c6d8b[_0x16366d][_0x1454ab][_0xaa63('0x9')],_0x4c6d8b[_0x16366d][_0x1454ab]['name']));break;case 0xa:_0x2194d1[_0x494112](util[_0xaa63('0x1b')](_0xaa63('0x1d'),_0x4c6d8b[_0x16366d][_0x1454ab]['name']));break;}}}}})[_0xaa63('0xd')](function(){if(_0x494112===_0xaa63('0x48')){var _0x25b249=_[_0xaa63('0x19')](_0x224e69['ChatInteractions'],'id');return _0x224e69[_0xaa63('0x49')](_0x25b249)['then'](function(){for(var _0x50978d=0x0;_0x50978d<_0x25b249[_0xaa63('0x1c')];_0x50978d+=0x1){_0x3f4f64[_0xaa63('0x4a')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x25b249[_0x50978d]),'UserId':Number(_0x224e69['id'])});}});}})[_0xaa63('0xd')](function(){if(_0x494112===_0xaa63('0x48')){var _0x37ffaa=_[_0xaa63('0x19')](_0x224e69[_0xaa63('0x25')],'id');return _0x224e69['removeMailInteractions'](_0x37ffaa)[_0xaa63('0xd')](function(){for(var _0x503f3a=0x0;_0x503f3a<_0x37ffaa[_0xaa63('0x1c')];_0x503f3a+=0x1){_0x3f4f64[_0xaa63('0x4a')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x37ffaa[_0x503f3a]),'UserId':Number(_0x224e69['id'])});}});}})[_0xaa63('0xd')](function(){if(_0x494112===_0xaa63('0x48')){var _0x2808aa=_[_0xaa63('0x19')](_0x224e69['FaxInteractions'],'id');return _0x224e69[_0xaa63('0x4b')](_0x2808aa)['then'](function(){for(var _0xb76cf2=0x0;_0xb76cf2<_0x2808aa[_0xaa63('0x1c')];_0xb76cf2+=0x1){_0x3f4f64[_0xaa63('0x4a')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x2808aa[_0xb76cf2]),'UserId':Number(_0x224e69['id'])});}});}})[_0xaa63('0xd')](function(){if(_0x494112===_0xaa63('0x48')){var _0x5c976d=_[_0xaa63('0x19')](_0x224e69[_0xaa63('0x28')],'id');return _0x224e69[_0xaa63('0x4c')](_0x5c976d)[_0xaa63('0xd')](function(){for(var _0x565a9e=0x0;_0x565a9e<_0x5c976d['length'];_0x565a9e+=0x1){_0x3f4f64['emit']('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x5c976d[_0x565a9e]),'UserId':Number(_0x224e69['id'])});}});}})[_0xaa63('0xd')](function(){if(_0x494112==='leave'){var _0x2f14dc=_[_0xaa63('0x19')](_0x224e69['OpenchannelInteractions'],'id');return _0x224e69[_0xaa63('0x4d')](_0x2f14dc)['then'](function(){for(var _0x25b2e2=0x0;_0x25b2e2<_0x2f14dc[_0xaa63('0x1c')];_0x25b2e2+=0x1){_0x3f4f64[_0xaa63('0x4a')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x2f14dc[_0x25b2e2]),'UserId':Number(_0x224e69['id'])});}});}})[_0xaa63('0xd')](function(){if(_0x494112==='leave'){var _0x9b6e5a=_[_0xaa63('0x19')](_0x224e69[_0xaa63('0x2b')],'id');return _0x224e69[_0xaa63('0x4e')](_0x9b6e5a)[_0xaa63('0xd')](function(){for(var _0x12c05f=0x0;_0x12c05f<_0x9b6e5a[_0xaa63('0x1c')];_0x12c05f+=0x1){_0x3f4f64[_0xaa63('0x4a')](_0xaa63('0x4f'),{'WhatsappInteractionId':Number(_0x9b6e5a[_0x12c05f]),'UserId':Number(_0x224e69['id'])});}});}})[_0xaa63('0x50')](function(_0x1ce180){_0x2194d1[_0xaa63('0x51')](_0x1ce180);});}}function onDisconnect(_0x3e888a,_0x20c95e){joinOrLeave(_0x3e888a,_0xaa63('0x48'),_0x20c95e);}function onConnect(_0x12d839){joinOrLeave(_0x12d839,_0xaa63('0x52'));}exports[_0xaa63('0x53')]=function(_0xb25183){_0xb25183['on']('connection',function(_0x5778ed){_0x5778ed[_0xaa63('0x54')](0x0);_0x5778ed[_0xaa63('0x55')]=_0x5778ed[_0xaa63('0x56')][_0xaa63('0x57')]['remoteAddress']+':'+_0x5778ed[_0xaa63('0x56')]['connection'][_0xaa63('0x58')];_0x5778ed[_0xaa63('0x59')]=new Date();_0x5778ed[_0xaa63('0x51')]=function(_0x58c465){console[_0xaa63('0x51')]('SocketIO\x20'+_0x5778ed[_0xaa63('0x5a')][_0xaa63('0x4')]+'['+_0x5778ed[_0xaa63('0x55')]+']',_0x58c465);};_0x5778ed['on'](_0xaa63('0x5b'),function(){onDisconnect(_0x5778ed,_0xb25183);_0x5778ed[_0xaa63('0x51')]('DISCONNECTED');});onConnect(_0x5778ed);_0x5778ed[_0xaa63('0x51')]('CONNECTED');});}; \ No newline at end of file +var _0x16a2=['FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','admin','voice:inbound','hasOwnProperty','include','push','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','user','voice:outbound','VoiceQueue','userProfileId','MailQueues','Trunks','Trunk','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','all','chat','fax','sms','whatsapp','telephone:%s','campaign:%s:%s','leave','map','ChatInteractions','removeChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','user_has_whatsapp_interactions:remove','catch','join','connection','setMaxListeners','address','request','remoteAddress','remotePort','log','SocketIO\x20','nsp','disconnect','DISCONNECTED','lodash','util','bluebird','../mysqldb','./environment','User','name','role','agent','type','ivr','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','OpenchannelQueues','WhatsappQueues','Telephones','findAll','IvrCampaigns','UserProfileResource','resourceId','Campaign','format','Agents','length','user:%s','query','find','handshake','ChatInteraction','MailInteraction','MailInteractions'];(function(_0x512f81,_0x4a7986){var _0xa15099=function(_0x1f7371){while(--_0x1f7371){_0x512f81['push'](_0x512f81['shift']());}};_0xa15099(++_0x4a7986);}(_0x16a2,0x1d0));var _0x216a=function(_0x2df507,_0x553862){_0x2df507=_0x2df507-0x0;var _0x1f7167=_0x16a2[_0x2df507];return _0x1f7167;};'use strict';var _=require(_0x216a('0x0'));var util=require(_0x216a('0x1'));var BPromise=require(_0x216a('0x2'));var db=require(_0x216a('0x3'))['db'];var config=require(_0x216a('0x4'));var queryQueues={'attributes':['id','name'],'include':[{'as':'Agents','model':db[_0x216a('0x5')],'attributes':['id',_0x216a('0x6'),_0x216a('0x7')],'raw':!![],'where':{'role':_0x216a('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0x216a('0x6')]};var queryAgents={'raw':!![],'attributes':['id',_0x216a('0x6')],'where':{'role':_0x216a('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0x216a('0x9')],'where':{'type':_0x216a('0xa')}};function getAssociatedResources(_0x4551cc,_0xd71b89,_0x4ce00d){return db['UserProfileSection'][_0x216a('0xb')]({'where':{'name':_0x4551cc,'userProfileId':_0xd71b89},'raw':!![]})[_0x216a('0xc')](function(_0x5bd333){if(_0x5bd333){if(_0x5bd333[_0x216a('0xd')]){switch(_0x4551cc){case _0x216a('0xe'):case _0x216a('0xf'):case _0x216a('0x10'):case _0x216a('0x11'):case'MailQueues':case _0x216a('0x12'):case _0x216a('0x13'):return db[_0x4ce00d]['findAll'](queryQueues);case _0x216a('0x14'):return db[_0x4ce00d][_0x216a('0x15')](queryTelephones);case'Trunks':return db[_0x4ce00d][_0x216a('0x15')](queryTrunks);case _0x216a('0x16'):return db[_0x4ce00d]['findAll'](queryCampaigns);}}else{return db[_0x216a('0x17')]['findAll']({'attributes':[_0x216a('0x18')],'where':{'sectionId':_0x5bd333['id']},'raw':!![]})[_0x216a('0xc')](function(_0x2ff511){if(_0x2ff511){var _0x10de53={'where':{'id':_['map'](_0x2ff511,_0x216a('0x18'))},'raw':!![]};switch(_0x4ce00d){case _0x216a('0x5'):_0x10de53['where'][_0x216a('0x7')]='telephone';break;case _0x216a('0x19'):_0x10de53['where'][_0x216a('0x9')]=_0x216a('0xa');break;}return db[_0x4ce00d][_0x216a('0x15')](_0x10de53);}else{return[];}});}}else{return[];}})[_0x216a('0xc')](function(_0xe2beef){return _0xe2beef;});}function joinOrLeaveQueues(_0x5bb15b,_0x1ca65f,_0x17aec6,_0x140b9f){_0x5bb15b[_0x1ca65f](util[_0x216a('0x1a')]('%s:queue:%s',_0x17aec6,_0x140b9f[_0x216a('0x6')]));if(_0x140b9f[_0x216a('0x1b')]){for(var _0x418ab9=0x0;_0x418ab9<_0x140b9f[_0x216a('0x1b')][_0x216a('0x1c')];_0x418ab9+=0x1){_0x5bb15b[_0x1ca65f](util[_0x216a('0x1a')](_0x216a('0x1d'),_0x140b9f[_0x216a('0x1b')][_0x418ab9][_0x216a('0x6')]));}}}function joinOrLeave(_0x6c5b2f,_0x457253,_0x57fb2a){var _0x3f5803;if(_0x6c5b2f['handshake'][_0x216a('0x1e')]['id']){db[_0x216a('0x5')][_0x216a('0x1f')]({'attributes':['id','name',_0x216a('0x7'),'userProfileId'],'where':{'id':_0x6c5b2f[_0x216a('0x20')]['query']['id']},'include':[{'model':db[_0x216a('0x21')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x216a('0x22')],'as':_0x216a('0x23'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':_0x216a('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0x216a('0x25')],'as':_0x216a('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x216a('0x27')],'as':_0x216a('0x28'),'attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})[_0x216a('0xc')](function(_0x56a81c){if(_0x56a81c){_0x3f5803=_0x56a81c;_0x6c5b2f[_0x457253](util[_0x216a('0x1a')]('user:%s',_0x56a81c[_0x216a('0x6')]));var _0x4588b8=[];switch(_0x56a81c[_0x216a('0x7')]){case _0x216a('0x29'):_0x6c5b2f[_0x457253](_0x216a('0x2a'));_0x6c5b2f[_0x457253]('voice:outbound');if(queryQueues[_0x216a('0x2b')](_0x216a('0x2c'))){delete queryQueues[_0x216a('0x2c')];}_0x4588b8['push'](db['VoiceQueue']['findAll'](queryQueues));_0x4588b8[_0x216a('0x2d')](db[_0x216a('0x2e')][_0x216a('0x15')](queryQueues));_0x4588b8[_0x216a('0x2d')](db[_0x216a('0x2f')]['findAll'](queryQueues));_0x4588b8[_0x216a('0x2d')](db[_0x216a('0x30')][_0x216a('0x15')](queryQueues));_0x4588b8['push'](db[_0x216a('0x31')][_0x216a('0x15')](queryQueues));_0x4588b8[_0x216a('0x2d')](db[_0x216a('0x32')]['findAll'](queryQueues));_0x4588b8[_0x216a('0x2d')](db[_0x216a('0x33')][_0x216a('0x15')](queryQueues));_0x4588b8[_0x216a('0x2d')](db[_0x216a('0x5')][_0x216a('0x15')](queryTelephones));_0x4588b8[_0x216a('0x2d')](db['Trunk'][_0x216a('0x15')](queryTrunks));_0x4588b8[_0x216a('0x2d')](db['Campaign'][_0x216a('0x15')](queryCampaigns));_0x4588b8[_0x216a('0x2d')](db['User'][_0x216a('0x15')](queryAgents));break;case _0x216a('0x34'):_0x6c5b2f[_0x457253](_0x216a('0x2a'));_0x6c5b2f[_0x457253](_0x216a('0x35'));_0x4588b8[_0x216a('0x2d')](getAssociatedResources('VoiceQueues',_0x56a81c['userProfileId'],_0x216a('0x36')));_0x4588b8[_0x216a('0x2d')](getAssociatedResources(_0x216a('0xf'),_0x56a81c[_0x216a('0x37')],_0x216a('0x2e')));_0x4588b8[_0x216a('0x2d')](getAssociatedResources('FaxQueues',_0x56a81c[_0x216a('0x37')],'FaxQueue'));_0x4588b8[_0x216a('0x2d')](getAssociatedResources(_0x216a('0x11'),_0x56a81c['userProfileId'],_0x216a('0x30')));_0x4588b8[_0x216a('0x2d')](getAssociatedResources(_0x216a('0x38'),_0x56a81c[_0x216a('0x37')],_0x216a('0x31')));_0x4588b8['push'](getAssociatedResources(_0x216a('0x12'),_0x56a81c[_0x216a('0x37')],_0x216a('0x32')));_0x4588b8[_0x216a('0x2d')](getAssociatedResources(_0x216a('0x13'),_0x56a81c['userProfileId'],_0x216a('0x33')));_0x4588b8[_0x216a('0x2d')](getAssociatedResources('Telephones',_0x56a81c[_0x216a('0x37')],'User'));_0x4588b8['push'](getAssociatedResources(_0x216a('0x39'),_0x56a81c[_0x216a('0x37')],_0x216a('0x3a')));_0x4588b8['push'](getAssociatedResources('IvrCampaigns',_0x56a81c[_0x216a('0x37')],_0x216a('0x19')));_0x4588b8[_0x216a('0x2d')](db[_0x216a('0x5')][_0x216a('0x15')](queryAgents));break;case _0x216a('0x8'):_0x6c5b2f[_0x457253](_0x216a('0x2a'));_0x6c5b2f[_0x457253](_0x216a('0x35'));_0x4588b8[_0x216a('0x2d')](_0x56a81c[_0x216a('0x3b')]({'attributes':['id',_0x216a('0x6')]}));_0x4588b8['push'](_0x56a81c[_0x216a('0x3c')]({'attributes':['id',_0x216a('0x6')]}));_0x4588b8['push'](_0x56a81c[_0x216a('0x3d')]({'attributes':['id',_0x216a('0x6')]}));_0x4588b8['push'](_0x56a81c[_0x216a('0x3e')]({'attributes':['id',_0x216a('0x6')]}));_0x4588b8[_0x216a('0x2d')](_0x56a81c[_0x216a('0x3f')]({'attributes':['id',_0x216a('0x6')]}));_0x4588b8[_0x216a('0x2d')](_0x56a81c[_0x216a('0x40')]({'attributes':['id',_0x216a('0x6')]}));_0x4588b8[_0x216a('0x2d')](_0x56a81c['getWhatsappQueues']({'attributes':['id',_0x216a('0x6')]}));break;}return BPromise[_0x216a('0x41')](_0x4588b8);}})[_0x216a('0xc')](function(_0xf131a3){if(_0xf131a3&&_0xf131a3[_0x216a('0x1c')]){for(var _0x4208fb=0x0;_0x4208fb<_0xf131a3[_0x216a('0x1c')];_0x4208fb+=0x1){for(var _0x2a6c9b=0x0;_0x2a6c9b<_0xf131a3[_0x4208fb]['length'];_0x2a6c9b+=0x1){switch(_0x4208fb){case 0x0:joinOrLeaveQueues(_0x6c5b2f,_0x457253,'voice',_0xf131a3[_0x4208fb][_0x2a6c9b]);break;case 0x1:joinOrLeaveQueues(_0x6c5b2f,_0x457253,_0x216a('0x42'),_0xf131a3[_0x4208fb][_0x2a6c9b]);break;case 0x2:joinOrLeaveQueues(_0x6c5b2f,_0x457253,_0x216a('0x43'),_0xf131a3[_0x4208fb][_0x2a6c9b]);break;case 0x3:joinOrLeaveQueues(_0x6c5b2f,_0x457253,_0x216a('0x44'),_0xf131a3[_0x4208fb][_0x2a6c9b]);break;case 0x4:joinOrLeaveQueues(_0x6c5b2f,_0x457253,'mail',_0xf131a3[_0x4208fb][_0x2a6c9b]);break;case 0x5:joinOrLeaveQueues(_0x6c5b2f,_0x457253,'openchannel',_0xf131a3[_0x4208fb][_0x2a6c9b]);break;case 0x6:joinOrLeaveQueues(_0x6c5b2f,_0x457253,_0x216a('0x45'),_0xf131a3[_0x4208fb][_0x2a6c9b]);break;case 0x7:if(_0x3f5803[_0x216a('0x7')]!==_0x216a('0x8'))_0x6c5b2f[_0x457253](util[_0x216a('0x1a')](_0x216a('0x46'),_0xf131a3[_0x4208fb][_0x2a6c9b][_0x216a('0x6')]));break;case 0x8:if(_0x3f5803[_0x216a('0x7')]!==_0x216a('0x8'))_0x6c5b2f[_0x457253](util['format']('trunk:%s',_0xf131a3[_0x4208fb][_0x2a6c9b][_0x216a('0x6')]));break;case 0x9:if(_0x3f5803[_0x216a('0x7')]!=='agent')_0x6c5b2f[_0x457253](util[_0x216a('0x1a')](_0x216a('0x47'),_0xf131a3[_0x4208fb][_0x2a6c9b]['type'],_0xf131a3[_0x4208fb][_0x2a6c9b][_0x216a('0x6')]));break;case 0xa:_0x6c5b2f[_0x457253](util[_0x216a('0x1a')]('user:%s',_0xf131a3[_0x4208fb][_0x2a6c9b][_0x216a('0x6')]));break;}}}}})[_0x216a('0xc')](function(){if(_0x457253===_0x216a('0x48')){var _0x8ed621=_[_0x216a('0x49')](_0x3f5803[_0x216a('0x4a')],'id');return _0x3f5803[_0x216a('0x4b')](_0x8ed621)[_0x216a('0xc')](function(){for(var _0x132c83=0x0;_0x132c83<_0x8ed621[_0x216a('0x1c')];_0x132c83+=0x1){_0x57fb2a[_0x216a('0x4c')](_0x216a('0x4d'),{'ChatInteractionId':Number(_0x8ed621[_0x132c83]),'UserId':Number(_0x3f5803['id'])});}});}})['then'](function(){if(_0x457253==='leave'){var _0x2da4b2=_[_0x216a('0x49')](_0x3f5803[_0x216a('0x23')],'id');return _0x3f5803[_0x216a('0x4e')](_0x2da4b2)['then'](function(){for(var _0x18fc95=0x0;_0x18fc95<_0x2da4b2['length'];_0x18fc95+=0x1){_0x57fb2a[_0x216a('0x4c')](_0x216a('0x4f'),{'MailInteractionId':Number(_0x2da4b2[_0x18fc95]),'UserId':Number(_0x3f5803['id'])});}});}})['then'](function(){if(_0x457253===_0x216a('0x48')){var _0x39b05b=_[_0x216a('0x49')](_0x3f5803[_0x216a('0x24')],'id');return _0x3f5803[_0x216a('0x50')](_0x39b05b)[_0x216a('0xc')](function(){for(var _0x46b152=0x0;_0x46b152<_0x39b05b[_0x216a('0x1c')];_0x46b152+=0x1){_0x57fb2a[_0x216a('0x4c')](_0x216a('0x51'),{'FaxInteractionId':Number(_0x39b05b[_0x46b152]),'UserId':Number(_0x3f5803['id'])});}});}})[_0x216a('0xc')](function(){if(_0x457253===_0x216a('0x48')){var _0x8b92f0=_['map'](_0x3f5803[_0x216a('0x26')],'id');return _0x3f5803[_0x216a('0x52')](_0x8b92f0)['then'](function(){for(var _0x5c4993=0x0;_0x5c4993<_0x8b92f0['length'];_0x5c4993+=0x1){_0x57fb2a['emit'](_0x216a('0x53'),{'SmsInteractionId':Number(_0x8b92f0[_0x5c4993]),'UserId':Number(_0x3f5803['id'])});}});}})[_0x216a('0xc')](function(){if(_0x457253===_0x216a('0x48')){var _0x266f7d=_['map'](_0x3f5803[_0x216a('0x28')],'id');return _0x3f5803[_0x216a('0x54')](_0x266f7d)[_0x216a('0xc')](function(){for(var _0x4c76fa=0x0;_0x4c76fa<_0x266f7d[_0x216a('0x1c')];_0x4c76fa+=0x1){_0x57fb2a[_0x216a('0x4c')](_0x216a('0x55'),{'OpenchannelInteractionId':Number(_0x266f7d[_0x4c76fa]),'UserId':Number(_0x3f5803['id'])});}});}})[_0x216a('0xc')](function(){if(_0x457253===_0x216a('0x48')){var _0x9a63a7=_[_0x216a('0x49')](_0x3f5803['WhatsappInteractions'],'id');return _0x3f5803['removeWhatsappInteractions'](_0x9a63a7)[_0x216a('0xc')](function(){for(var _0x5089f6=0x0;_0x5089f6<_0x9a63a7['length'];_0x5089f6+=0x1){_0x57fb2a[_0x216a('0x4c')](_0x216a('0x56'),{'WhatsappInteractionId':Number(_0x9a63a7[_0x5089f6]),'UserId':Number(_0x3f5803['id'])});}});}})[_0x216a('0x57')](function(_0x427bcd){_0x6c5b2f['log'](_0x427bcd);});}}function onDisconnect(_0xc9da0f,_0x436c97){joinOrLeave(_0xc9da0f,_0x216a('0x48'),_0x436c97);}function onConnect(_0x129716){joinOrLeave(_0x129716,_0x216a('0x58'));}exports['default']=function(_0x2ad4b8){_0x2ad4b8['on'](_0x216a('0x59'),function(_0x1f3b3c){_0x1f3b3c[_0x216a('0x5a')](0x0);_0x1f3b3c[_0x216a('0x5b')]=_0x1f3b3c[_0x216a('0x5c')]['connection'][_0x216a('0x5d')]+':'+_0x1f3b3c['request'][_0x216a('0x59')][_0x216a('0x5e')];_0x1f3b3c['connectedAt']=new Date();_0x1f3b3c[_0x216a('0x5f')]=function(_0x4ff40e){console[_0x216a('0x5f')](_0x216a('0x60')+_0x1f3b3c[_0x216a('0x61')]['name']+'['+_0x1f3b3c[_0x216a('0x5b')]+']',_0x4ff40e);};_0x1f3b3c['on'](_0x216a('0x62'),function(){onDisconnect(_0x1f3b3c,_0x2ad4b8);_0x1f3b3c[_0x216a('0x5f')](_0x216a('0x63'));});onConnect(_0x1f3b3c);_0x1f3b3c['log']('CONNECTED');});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 06634e6..4e4f9b6 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 _0x0e43=['Sms','SmsInteraction','SmsMessage','WhatsappInteraction','Whatsapp','WhatsappMessage','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager','then','info','Trigger,\x20%s','error','code','catch','channel','motionChannel','direction','ContactId','undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','query','Sequelize','QueryTypes','SELECT','UserId','interface','format','name','incomingmessage','AfterCreateMessage','get','offlineMessage','event','contact','SIP/%s','agent','AfterCreate','changed','closed','substatus','AfterUpdate','User','find','internal','hasOwnProperty','model','callback','condition','util','../../mysqldb','jayson/promise','../logger','triggers','client','Chat','afterCreate','newinteraction','ChatInteraction','afterUpdate','closedinteraction','ChatMessage','newmessage','ChatOfflineMessage'];(function(_0x4d3b41,_0x4281e1){var _0x2dc795=function(_0x106729){while(--_0x106729){_0x4d3b41['push'](_0x4d3b41['shift']());}};_0x2dc795(++_0x4281e1);}(_0x0e43,0x1f0));var _0x30e4=function(_0x3bafa1,_0x41e9d4){_0x3bafa1=_0x3bafa1-0x0;var _0x32f78b=_0x0e43[_0x3bafa1];return _0x32f78b;};'use strict';var util=require(_0x30e4('0x0'));var db=require(_0x30e4('0x1'))['db'];var jayson=require(_0x30e4('0x2'));var logger=require(_0x30e4('0x3'))(_0x30e4('0x4'));var client=jayson[_0x30e4('0x5')]['http']({'port':0x232a});var triggers=[{'channel':_0x30e4('0x6'),'model':'ChatInteraction','event':_0x30e4('0x7'),'condition':_0x30e4('0x8'),'callback':afterCreate},{'channel':_0x30e4('0x6'),'model':_0x30e4('0x9'),'event':_0x30e4('0xa'),'condition':_0x30e4('0xb'),'callback':afterUpdate},{'channel':_0x30e4('0x6'),'model':_0x30e4('0xc'),'event':_0x30e4('0x7'),'condition':_0x30e4('0xd'),'callback':afterCreateMessage},{'channel':_0x30e4('0x6'),'model':_0x30e4('0xe'),'event':'afterCreate','condition':_0x30e4('0xd'),'callback':afterCreateOfflineMessage},{'channel':_0x30e4('0xf'),'model':_0x30e4('0x10'),'event':_0x30e4('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x30e4('0xf'),'model':_0x30e4('0x10'),'event':_0x30e4('0xa'),'condition':_0x30e4('0xb'),'callback':afterUpdate},{'channel':'Sms','model':_0x30e4('0x11'),'event':'afterCreate','condition':_0x30e4('0xd'),'callback':afterCreateMessage},{'channel':'Whatsapp','model':_0x30e4('0x12'),'event':_0x30e4('0x7'),'condition':_0x30e4('0x8'),'callback':afterCreate},{'channel':_0x30e4('0x13'),'model':'WhatsappInteraction','event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':_0x30e4('0x13'),'model':_0x30e4('0x14'),'event':_0x30e4('0x7'),'condition':_0x30e4('0xd'),'callback':afterCreateMessage},{'channel':_0x30e4('0x15'),'model':'FaxInteraction','event':'afterCreate','condition':_0x30e4('0x8'),'callback':afterCreate},{'channel':_0x30e4('0x15'),'model':_0x30e4('0x16'),'event':_0x30e4('0xa'),'condition':'closedinteraction','callback':afterUpdate},{'channel':'Fax','model':_0x30e4('0x17'),'event':'afterCreate','condition':_0x30e4('0xd'),'callback':afterCreateMessage},{'channel':_0x30e4('0x18'),'model':_0x30e4('0x19'),'event':_0x30e4('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x30e4('0x18'),'model':_0x30e4('0x19'),'event':_0x30e4('0xa'),'condition':_0x30e4('0xb'),'callback':afterUpdate},{'channel':_0x30e4('0x18'),'model':_0x30e4('0x1a'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0x30e4('0x1b'),'model':_0x30e4('0x1c'),'event':_0x30e4('0x7'),'condition':_0x30e4('0x8'),'callback':afterCreate},{'channel':_0x30e4('0x1b'),'model':_0x30e4('0x1c'),'event':_0x30e4('0xa'),'condition':_0x30e4('0xb'),'callback':afterUpdate},{'channel':'Openchannel','model':_0x30e4('0x1d'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage}];function request(_0x4b3fd5){return client[_0x30e4('0x1e')](_0x30e4('0x1f'),_0x4b3fd5)[_0x30e4('0x20')](function(_0x66e766){logger[_0x30e4('0x21')](_0x30e4('0x22'),_0x30e4('0x1f'),_0x66e766);if(_0x66e766[_0x30e4('0x23')]){if(_0x66e766[_0x30e4('0x23')][_0x30e4('0x24')]===0x1f4){logger[_0x30e4('0x23')](_0x30e4('0x22'),_0x30e4('0x1f'),_0x66e766['error']);}}})[_0x30e4('0x25')](function(_0x163b2a){logger[_0x30e4('0x23')](_0x30e4('0x22'),_0x30e4('0x1f'),_0x163b2a);});}function afterCreateMessage(_0x7fde43){return function(_0x5643df){_0x5643df=_0x5643df['get']({'plain':!![]});_0x5643df[_0x30e4('0x26')]=_0x7fde43;_0x5643df[_0x30e4('0x27')]=_0x7fde43;_0x5643df['event']=_0x5643df[_0x30e4('0x28')];Promise['resolve']()['then'](function(){if(typeof _0x5643df[_0x30e4('0x29')]===_0x30e4('0x2a'))return null;var _0x4d9ca0=_0x30e4('0x2b')+_0x5643df[_0x30e4('0x29')];return db[_0x30e4('0x2c')][_0x30e4('0x2d')](_0x4d9ca0,{'type':db[_0x30e4('0x2e')][_0x30e4('0x2f')][_0x30e4('0x30')],'raw':!![]});})[_0x30e4('0x20')](function(_0x12d6ee){if(_0x12d6ee){_0x5643df['contact']=_0x12d6ee[0x0];}if(typeof _0x5643df[_0x30e4('0x31')]===_0x30e4('0x2a'))return;return getAgent(_0x5643df[_0x30e4('0x31')]);})[_0x30e4('0x20')](function(_0x206187){if(_0x206187){_0x5643df[_0x30e4('0x32')]=util[_0x30e4('0x33')]('SIP/%s',_0x206187[_0x30e4('0x34')]);_0x5643df['agent']=_0x206187;_0x5643df[_0x30e4('0x26')]=_0x7fde43;return request({'event':_0x30e4('0x35'),'message':_0x5643df});}else{return request({'event':'outgoingmessage','message':_0x5643df});}})[_0x30e4('0x25')](function(_0x432b34){logger['error'](_0x30e4('0x22'),_0x30e4('0x36'),_0x432b34);});};}function afterCreateOfflineMessage(_0x5e6780){return function(_0x349f13){_0x349f13=_0x349f13[_0x30e4('0x37')]({'plain':!![]});_0x349f13[_0x30e4('0x26')]=_0x5e6780;_0x349f13[_0x30e4('0x27')]=_0x5e6780;_0x349f13['event']=_0x30e4('0x38');return request({'event':_0x349f13[_0x30e4('0x39')],'message':_0x349f13});};}function afterCreate(_0x4ec0c3,_0x59ecdc){return function(_0x15d12c){_0x15d12c=_0x15d12c['get']({'plain':!![]});_0x15d12c[_0x30e4('0x26')]=_0x4ec0c3;_0x15d12c[_0x30e4('0x27')]=_0x4ec0c3;_0x15d12c[_0x30e4('0x39')]='opened';Promise['resolve']()['then'](function(){var _0x4764e2=_0x30e4('0x2b')+_0x15d12c[_0x30e4('0x29')];return db[_0x30e4('0x2c')]['query'](_0x4764e2,{'type':db[_0x30e4('0x2e')]['QueryTypes'][_0x30e4('0x30')],'raw':!![]});})[_0x30e4('0x20')](function(_0x5dbda9){if(_0x5dbda9){_0x15d12c[_0x30e4('0x3a')]=_0x5dbda9[0x0];}if(typeof _0x15d12c[_0x30e4('0x31')]===_0x30e4('0x2a'))return;return getAgent(_0x15d12c[_0x30e4('0x31')]);})[_0x30e4('0x20')](function(_0x41d7d1){if(_0x41d7d1){_0x15d12c[_0x30e4('0x32')]=util['format'](_0x30e4('0x3b'),_0x41d7d1['name']);_0x15d12c[_0x30e4('0x3c')]=_0x41d7d1;}return request({'event':_0x59ecdc,'message':_0x15d12c});})['catch'](function(_0xfeb11e){logger[_0x30e4('0x23')](_0x30e4('0x22'),_0x30e4('0x3d'),_0xfeb11e);});};}function afterUpdate(_0x441593){return function(_0x1b361e){var _0x40d939=_0x1b361e[_0x30e4('0x3e')](_0x30e4('0x3f'))&&_0x1b361e[_0x30e4('0x3f')];var _0x5ec6e8=_0x1b361e[_0x30e4('0x3e')]('substatus');if(_0x40d939||_0x5ec6e8){var _0x1b394f=_0x40d939?_0x30e4('0xb'):'substatus';var _0xed7eaa=_0x1b361e[_0x30e4('0x37')]({'plain':!![]});_0xed7eaa[_0x30e4('0x26')]=_0x441593;_0xed7eaa['motionChannel']=_0x441593;_0xed7eaa['event']=_0x40d939?_0x30e4('0x3f'):_0x30e4('0x40');var _0x6c1f37=_0x30e4('0x2b')+_0xed7eaa[_0x30e4('0x29')];return db['sequelize'][_0x30e4('0x2d')](_0x6c1f37,{'type':db[_0x30e4('0x2e')][_0x30e4('0x2f')][_0x30e4('0x30')],'raw':!![]})[_0x30e4('0x20')](function(_0x316ffd){if(_0x316ffd){_0xed7eaa['contact']=_0x316ffd[0x0];}if(typeof _0xed7eaa['UserId']===_0x30e4('0x2a'))return;return getAgent(_0xed7eaa[_0x30e4('0x31')]);})[_0x30e4('0x20')](function(_0x1cccfb){if(_0x1cccfb){_0xed7eaa['interface']=util[_0x30e4('0x33')]('SIP/%s',_0x1cccfb['name']);_0xed7eaa['agent']=_0x1cccfb;}return request({'event':_0x1b394f,'message':_0xed7eaa});})['catch'](function(_0x30b49e){logger['error'](_0x30e4('0x22'),_0x30e4('0x41'),_0x30b49e);});}};}function getAgent(_0x81b198){return db[_0x30e4('0x42')][_0x30e4('0x43')]({'where':{'id':_0x81b198},'attributes':['id','name','fullname','email',_0x30e4('0x44')],'raw':!![]})[_0x30e4('0x20')](function(_0xdaa001){return _0xdaa001;});}exports['default']=function(){for(var _0x15d43b=0x0;_0x15d43b=_0x280e46[_0x7ef0('0x12')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x35f398(_0x9c0871);})[_0x7ef0('0x13')](function(_0x385ff9){_0x241835(_0x385ff9);});});}; \ No newline at end of file +var _0x5213=['count','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','../mysqldb','./license/util','voice','chat','fax','openchannel','getChannels','toLowerCase','includes','clearBlockUser','blockedAt','updateAttributes','getLicense','role','agent','User'];(function(_0x495d83,_0x4f86ac){var _0x5e803f=function(_0x465ebc){while(--_0x465ebc){_0x495d83['push'](_0x495d83['shift']());}};_0x5e803f(++_0x4f86ac);}(_0x5213,0x140));var _0x3521=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0x5213[_0x45d3f0];return _0x314b79;};'use strict';var _=require('lodash');var BPromise=require('bluebird');var db=require(_0x3521('0x0'))['db'];var util=require(_0x3521('0x1'));var channels=[_0x3521('0x2'),'mail',_0x3521('0x3'),_0x3521('0x4'),'sms','whatsapp',_0x3521('0x5')];exports[_0x3521('0x6')]=function(){return channels;};exports['isValidChannel']=function(_0xbe6114){_0xbe6114=_0xbe6114[_0x3521('0x7')]();return _[_0x3521('0x8')](channels,_0xbe6114);};exports[_0x3521('0x9')]=function(_0x4e2e31,_0x58f332,_0x55ef86,_0x2528a6){var _0x4d847d={'loginAttempts':_0x58f332,'blocked':_0x55ef86};if(!_['isUndefined'](_0x2528a6)){_0x4d847d[_0x3521('0xa')]=_0x2528a6;}return _0x4e2e31[_0x3521('0xb')](_0x4d847d);};exports[_0x3521('0xc')]=function(_0x873651){return new BPromise(function(_0x2e2ebc,_0x163364){var _0x3a1b5a=0x0;if(_0x873651[_0x3521('0xd')]!==_0x3521('0xe')){_0x2e2ebc(_0x873651);}db[_0x3521('0xf')][_0x3521('0x10')]({'where':{'role':_0x3521('0xe'),'online':!![],'id':{'$ne':_0x873651['id']}}})[_0x3521('0x11')](function(_0x265ef8){_0x3a1b5a=_0x265ef8;return util[_0x3521('0xc')]();})[_0x3521('0x11')](function(_0x160116){if(_0x160116&&_0x160116[_0x3521('0x12')]&&_0x3a1b5a>=_0x160116[_0x3521('0x12')]){throw Error(_0x3521('0x13'));}_0x2e2ebc(_0x873651);})[_0x3521('0x14')](function(_0x467206){_0x163364(_0x467206);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index 9af7697..da209cd 100644 --- a/server/errors/api.js +++ b/server/errors/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['inherits','Bad\x20Request','Entity\x20not\x20found','Not\x20Found','Forbidden','OutOfInterval','stack','status','send','exports','util','../config/logger','api','message','Internal\x20Server\x20Error','name','Error'];(function(_0x4c9380,_0x2fefc0){var _0x49a523=function(_0x165e85){while(--_0x165e85){_0x4c9380['push'](_0x4c9380['shift']());}};_0x49a523(++_0x2fefc0);}(_0xe706,0xa3));var _0x6e70=function(_0x40e76b,_0x9f1a5){_0x40e76b=_0x40e76b-0x0;var _0x8b2a31=_0xe706[_0x40e76b];return _0x8b2a31;};'use strict';var util=require(_0x6e70('0x0'));var logger=require(_0x6e70('0x1'))(_0x6e70('0x2'));var APIError=function(_0x5e8446,_0x2cae77){this[_0x6e70('0x3')]=_0x5e8446||_0x6e70('0x4');this[_0x6e70('0x5')]=_0x2cae77||_0x6e70('0x6');util[_0x6e70('0x7')](APIError,Error);};var APIBadRequestError=function(_0x376a8d){this[_0x6e70('0x3')]=_0x376a8d||_0x6e70('0x8');this[_0x6e70('0x5')]=_0x6e70('0x8');util[_0x6e70('0x7')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x45a2d4){this[_0x6e70('0x3')]=_0x45a2d4||_0x6e70('0x9');this[_0x6e70('0x5')]=_0x6e70('0xa');util[_0x6e70('0x7')](APINotFoundError,APIError);};function getStatusCode(_0x100eb7){switch(_0x100eb7){case _0x6e70('0x8'):return 0x190;case _0x6e70('0xb'),_0x6e70('0xc'):return 0x193;case _0x6e70('0xa'):return 0x194;default:return 0x1f4;}}function handleError(_0x4600f9){return function(_0x5b3d07){logger['error'](_0x5b3d07[_0x6e70('0xd')]);var _0x15a1a5=getStatusCode(_0x5b3d07[_0x6e70('0x5')]);if(_0x5b3d07[_0x6e70('0x5')])delete _0x5b3d07[_0x6e70('0x5')];return _0x4600f9[_0x6e70('0xe')](_0x15a1a5)[_0x6e70('0xf')](_0x5b3d07);};}module[_0x6e70('0x10')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file +var _0xb821=['status','exports','../config/logger','api','message','Error','inherits','name','Bad\x20Request','Entity\x20not\x20found','Not\x20Found','Forbidden','OutOfInterval','error','stack'];(function(_0x1465e6,_0x41c95d){var _0x25ff9d=function(_0x81e623){while(--_0x81e623){_0x1465e6['push'](_0x1465e6['shift']());}};_0x25ff9d(++_0x41c95d);}(_0xb821,0xa7));var _0x1b82=function(_0x111a2a,_0x4001ba){_0x111a2a=_0x111a2a-0x0;var _0x430afe=_0xb821[_0x111a2a];return _0x430afe;};'use strict';var util=require('util');var logger=require(_0x1b82('0x0'))(_0x1b82('0x1'));var APIError=function(_0x5924c6,_0x4a4f81){this[_0x1b82('0x2')]=_0x5924c6||'Internal\x20Server\x20Error';this['name']=_0x4a4f81||_0x1b82('0x3');util[_0x1b82('0x4')](APIError,Error);};var APIBadRequestError=function(_0x3fadf0){this[_0x1b82('0x2')]=_0x3fadf0||'Bad\x20Request';this[_0x1b82('0x5')]=_0x1b82('0x6');util[_0x1b82('0x4')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x3632dd){this[_0x1b82('0x2')]=_0x3632dd||_0x1b82('0x7');this[_0x1b82('0x5')]=_0x1b82('0x8');util[_0x1b82('0x4')](APINotFoundError,APIError);};function getStatusCode(_0x4955b5){switch(_0x4955b5){case _0x1b82('0x6'):return 0x190;case _0x1b82('0x9'),_0x1b82('0xa'):return 0x193;case _0x1b82('0x8'):return 0x194;default:return 0x1f4;}}function handleError(_0xcffb87){return function(_0x17a96b){logger[_0x1b82('0xb')](_0x17a96b[_0x1b82('0xc')]);var _0x5f521f=getStatusCode(_0x17a96b[_0x1b82('0x5')]);if(_0x17a96b[_0x1b82('0x5')])delete _0x17a96b[_0x1b82('0x5')];return _0xcffb87[_0x1b82('0xd')](_0x5f521f)['send'](_0x17a96b);};}module[_0x1b82('0xe')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index c564d76..27b9b65 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3ad9=['status','json','send'];(function(_0x4c321c,_0x3e9da0){var _0x25accb=function(_0x21bf7a){while(--_0x21bf7a){_0x4c321c['push'](_0x4c321c['shift']());}};_0x25accb(++_0x3e9da0);}(_0x3ad9,0x1b9));var _0x93ad=function(_0x5c2e5e,_0x2bc00e){_0x5c2e5e=_0x5c2e5e-0x0;var _0x46a5da=_0x3ad9[_0x5c2e5e];return _0x46a5da;};'use strict';module['exports'][0x194]=function pageNotFound(_0x310564,_0x3fda30){var _0x347b38='404';var _0x5228e0=0x194;var _0x2023ef={'status':_0x5228e0};_0x3fda30[_0x93ad('0x0')](_0x2023ef[_0x93ad('0x0')]);_0x3fda30['render'](_0x347b38,{},function(_0x2b9aec,_0x2701ec){if(_0x2b9aec){return _0x3fda30[_0x93ad('0x0')](_0x2023ef[_0x93ad('0x0')])[_0x93ad('0x1')](_0x2023ef);}_0x3fda30[_0x93ad('0x2')](_0x2701ec);});}; \ No newline at end of file +var _0x8d8f=['render','json','exports','404','status'];(function(_0x1509f4,_0x1975df){var _0x9f9bff=function(_0x460005){while(--_0x460005){_0x1509f4['push'](_0x1509f4['shift']());}};_0x9f9bff(++_0x1975df);}(_0x8d8f,0x13d));var _0xf8d8=function(_0x2f474b,_0x121610){_0x2f474b=_0x2f474b-0x0;var _0x802ac6=_0x8d8f[_0x2f474b];return _0x802ac6;};'use strict';module[_0xf8d8('0x0')][0x194]=function pageNotFound(_0x156ee7,_0xcbe087){var _0x25c217=_0xf8d8('0x1');var _0x3b787b=0x194;var _0x33f779={'status':_0x3b787b};_0xcbe087[_0xf8d8('0x2')](_0x33f779[_0xf8d8('0x2')]);_0xcbe087[_0xf8d8('0x3')](_0x25c217,{},function(_0x32cbae,_0x2b9544){if(_0x32cbae){return _0xcbe087['status'](_0x33f779['status'])[_0xf8d8('0x4')](_0x33f779);}_0xcbe087['send'](_0x2b9544);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 99c3b33..72bdc7a 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','License','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','VoicePrefix','UserProfile','UserProfileSection','UserProfileResource','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','hasOne','VoiceMail','userSetting','cascade','UserId','hasMany','VoiceRecording','Recordings','VoiceQueuesRt','Extensions','HopperFinals','CmHopperHistory','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteraction','MailInteraction','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsToMany','Groups','chat_group_has_users','CmContact','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','Team','user_has_teams','user_has_mail_interactions','FaxInteractions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','ChatQueues','UserChatQueue','FaxQueues','SmsQueues','OpenchannelQueue','WhatsappQueues','CmList','ChatWebsites','user_has_chat_websites','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','ChanSpyId','VoiceContext','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperBlacks','JscriptySessions','TrunkId','belongsTo','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPauseId','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailbox','mailboxuser','VoiceCallReport','QueueCalls','uniqueid','VoiceAgentReport','AgentReports','Contact','MailAccountId','CloudProviderId','MailServerOut','restrict','Imap','Smtp','Disposition','Dispositions','Answers','Interactions','MailApplication','List','ListId','TemplateId','mandatoryDispositionPause','Agents','team_has_mail_queues','ContactId','mail_interaction_has_tags','Tags','ThroughTags','Users','MailInteractionId','Attachments','Interaction','ChatWebsiteId','Interval','MailQueueReport','Dashboard','CannedAnswer','FaxAccountId','Exntensions','TagId','FaxInteractionId','Account','Owner','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','team_has_openchannel_queues','ChatProactiveAction','ProactiveActions','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','ChatOfflineMessageId','team_has_chat_queues','ChatGroupId','CmContactId','HopperHistories','CmCompany','Company','cm_contact_has_tags','CmHopperAdditionalPhone','AdditionalPhones','CmHopperId','Campaign','OwnerId','CampaignId','All','OneAll','OneAny','Actions','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','openchannel_interaction_has_tags','whatsapp_interaction_has_tags','CmContactHasItem','ItemType','ItemTypeId','Hopper','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','AnalyticCustomReport','Fields','MetricId','Configurations','Subjects','DescriptionId','FieldId','AccountId','Subject','SubjectId','Description','Field','SugarcrmField','Descriptions','VariableId','DeskAccount','ZendeskConfiguration','int_zendesk_configuration_has_tags','FreshdeskAccount','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','VtigerAccount','ServicenowField','ToId','JscriptyQuestionReport','JscriptyProject','ProjectId','MailQueues','OpenchannelQueues','team_has_whatsapp_queues','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','MailTransferReport','FromMailAccountId','FromAccount','FromAgent','ToUserId','ToAgent','ToMailAccountId','ToAccount','FromChatWebsiteId','FromUserId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToQueue','FromSmsAccountId','CmCustomField','CustomFields','voice_queues_has_cm_lists','userProfileId','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','WhatsappTransferReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','UserSetting','user','../config/environment','sequelize','lodash','motion2','xcall','xC@LL1234','127.0.0.1','utf8mb4','name','utf8','defaultsDeep','mysql','username','password','options','database','sequelizeHistory','User','import','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','ScreenRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','Trunk','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerOut/mailServerOut.model','MailAccount','MailQueue','MailSubstatus','MailMessage','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','OpenchannelMessage','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatApplication','ChatInteraction','ChatMessage','ChatOfflineMessage','ChatQueue','ChatGroup','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','ReportAgentPreview','Action','../api/action/action.model','Automation','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','Condition','../api/condition/condition.model','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','../api/cmContactHasItem/cmContactHasItem.model','Template','../api/template/template.model','Trigger','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmAccount','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','Dynamics365Account','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject'];(function(_0x3e531a,_0x28a82a){var _0x3c2574=function(_0x4a0c98){while(--_0x4a0c98){_0x3e531a['push'](_0x3e531a['shift']());}};_0x3c2574(++_0x28a82a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'use strict';var config=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var jstz=require('jstz');var timezone=jstz['determine']();config[_0x0a9e('0x1')]=_['defaultsDeep'](config[_0x0a9e('0x1')],{'database':_0x0a9e('0x3'),'username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':_0x0a9e('0x9'),'collate':'utf8_general_ci'}}});config['sequelizeHistory']=_[_0x0a9e('0xa')](config['sequelizeHistory'],{'database':'motion2','username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':_0x0a9e('0xb'),'dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize']['database'],config[_0x0a9e('0x1')][_0x0a9e('0xc')],config[_0x0a9e('0x1')][_0x0a9e('0xd')],config[_0x0a9e('0x1')][_0x0a9e('0xe')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0x0a9e('0xf')],config[_0x0a9e('0x10')][_0x0a9e('0xc')],config[_0x0a9e('0x10')][_0x0a9e('0xd')],config[_0x0a9e('0x10')]['options'])};db[_0x0a9e('0x11')]=db['sequelize'][_0x0a9e('0x12')]('../api/user/user.model');db[_0x0a9e('0x13')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x14'));db['VoiceContext']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x15'));db[_0x0a9e('0x16')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x17'));db[_0x0a9e('0x18')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x19'));db[_0x0a9e('0x1a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x1b'));db['VoiceRecording']=db[_0x0a9e('0x1')]['import']('../api/voiceRecording/voiceRecording.model');db[_0x0a9e('0x1c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1d'));db['VoiceMail']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1e'));db[_0x0a9e('0x1f')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x20'));db['VoiceCallReport']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x21'));db[_0x0a9e('0x22')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x23'));db['VoiceAgentReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x24'));db[_0x0a9e('0x25')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x26'));db[_0x0a9e('0x27')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/memberReport/memberReport.model');db[_0x0a9e('0x28')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x29'));db['VoiceTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2a'));db[_0x0a9e('0x2b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2c'));db[_0x0a9e('0x2d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x2e'));db['UserChatQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2f'));db[_0x0a9e('0x30')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x31'));db[_0x0a9e('0x32')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x33'));db[_0x0a9e('0x34')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userSmsQueue/userSmsQueue.model');db[_0x0a9e('0x35')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x36'));db[_0x0a9e('0x37')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x38'));db[_0x0a9e('0x39')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailServerIn/mailServerIn.model');db['MailServerOut']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x3a'));db[_0x0a9e('0x3b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailAccount/mailAccount.model');db[_0x0a9e('0x3c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailQueue/mailQueue.model');db[_0x0a9e('0x3d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailSubstatus/mailSubstatus.model');db['MailInteraction']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailInteraction/mailInteraction.model');db[_0x0a9e('0x3e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x3f'));db['MailApplication']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x40'));db['MailQueueReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x41'));db['Dashboard']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x42'));db[_0x0a9e('0x43')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x44'));db[_0x0a9e('0x45')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x46'));db[_0x0a9e('0x47')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x48'));db['FaxInteraction']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x49'));db[_0x0a9e('0x4a')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4b'));db[_0x0a9e('0x4c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4d'));db[_0x0a9e('0x4e')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x4f'));db[_0x0a9e('0x50')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x51'));db[_0x0a9e('0x52')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/smsApplication/smsApplication.model');db[_0x0a9e('0x53')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x54'));db[_0x0a9e('0x55')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x56'));db[_0x0a9e('0x57')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x58'));db[_0x0a9e('0x59')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x5a'));db[_0x0a9e('0x5b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5c'));db[_0x0a9e('0x5d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/openchannelInteraction/openchannelInteraction.model');db[_0x0a9e('0x5e')]=db[_0x0a9e('0x1')]['import']('../api/openchannelMessage/openchannelMessage.model');db['OpenchannelQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5f'));db[_0x0a9e('0x60')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x61'));db[_0x0a9e('0x62')]=db['sequelize']['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x0a9e('0x63')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatApplication/chatApplication.model');db[_0x0a9e('0x64')]=db[_0x0a9e('0x1')]['import']('../api/chatInteraction/chatInteraction.model');db[_0x0a9e('0x65')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatMessage/chatMessage.model');db[_0x0a9e('0x66')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0x0a9e('0x67')]=db[_0x0a9e('0x1')]['import']('../api/chatQueue/chatQueue.model');db[_0x0a9e('0x68')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x69'));db['ChatProactiveAction']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x6a'));db['CmCompany']=db['sequelize']['import'](_0x0a9e('0x6b'));db['CmContact']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6c'));db[_0x0a9e('0x6d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6e'));db[_0x0a9e('0x6f')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x70'));db[_0x0a9e('0x71')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x72'));db['CmHopperHistory']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0x0a9e('0x73')]=db['sequelize'][_0x0a9e('0x12')]('../api/reportAgentPreview/reportAgentPreview.model');db['CmCustomField']=db['sequelize'][_0x0a9e('0x12')]('../api/cmCustomField/cmCustomField.model');db[_0x0a9e('0x74')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x75'));db[_0x0a9e('0x76')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x77'));db['CannedAnswer']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x78'));db['Disposition']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x79'));db[_0x0a9e('0x7a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x7b'));db['Interval']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x7c'));db[_0x0a9e('0x7d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x7e'));db[_0x0a9e('0x7f')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x80'));db['VoiceQueuesLog']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x81'));db[_0x0a9e('0x82')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x83'));db[_0x0a9e('0x84')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x85'));db[_0x0a9e('0x86')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x87'));db[_0x0a9e('0x88')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x89'));db['CmContactHasItem']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8a'));db['CmHopperAdditionalPhone']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model');db[_0x0a9e('0x8b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8c'));db[_0x0a9e('0x8d')]=db['sequelize']['import']('../api/trigger/trigger.model');db[_0x0a9e('0x8e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8f'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['IntegrationReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x92'));db['AnalyticCustomReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x93'));db[_0x0a9e('0x94')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x95'));db[_0x0a9e('0x96')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x97'));db[_0x0a9e('0x98')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/analyticMetric/analyticMetric.model');db[_0x0a9e('0x99')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9a'));db['AnalyticTreeReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9b'));db[_0x0a9e('0x9c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9d'));db[_0x0a9e('0x9e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9f'));db[_0x0a9e('0xa0')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSalesforceField/intSalesforceField.model');db[_0x0a9e('0xa1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x0a9e('0xa2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa3'));db['SugarcrmField']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa4'));db['DeskAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xa5'));db[_0x0a9e('0xa6')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa7'));db[_0x0a9e('0xa8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa9'));db[_0x0a9e('0xaa')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xab'));db[_0x0a9e('0xac')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xad'));db[_0x0a9e('0xae')]=db['sequelize'][_0x0a9e('0x12')]('../api/intZohoField/intZohoField.model');db[_0x0a9e('0xaf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb0'));db['ZendeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb1'));db[_0x0a9e('0xb2')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb3'));db['FreshdeskAccount']=db['sequelize'][_0x0a9e('0x12')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db['FreshdeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb4'));db[_0x0a9e('0xb5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb6'));db['VtigerAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xb7'));db[_0x0a9e('0xb8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x0a9e('0xb9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerField/intVtigerField.model');db[_0x0a9e('0xba')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbb'));db[_0x0a9e('0xbc')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbd'));db['ServicenowField']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intServicenowField/intServicenowField.model');db[_0x0a9e('0xbe')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0x0a9e('0xbf')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xc0'));db[_0x0a9e('0xc1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc2'));db[_0x0a9e('0xc3')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xc4'));db[_0x0a9e('0xc5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc6'));db[_0x0a9e('0xc7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc8'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['Network']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc9'));db[_0x0a9e('0xca')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcb'));db[_0x0a9e('0xcc')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0x0a9e('0xcd')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xce'));db['JscriptyQuestionReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcf'));db[_0x0a9e('0xd0')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xd1'));db[_0x0a9e('0xd2')]=db['sequelize']['import'](_0x0a9e('0xd3'));db[_0x0a9e('0xd4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd5'));db[_0x0a9e('0xd6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd7'));db['JscriptyProject']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xd8'));db[_0x0a9e('0xd9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xda'));db['SquareOdbc']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xdb'));db[_0x0a9e('0xdc')]=db[_0x0a9e('0x1')]['import']('../api/squareProject/squareProject.model');db[_0x0a9e('0xdd')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xde'));db[_0x0a9e('0xdf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe0'));db['Team']=db['sequelize'][_0x0a9e('0x12')]('../api/team/team.model');db[_0x0a9e('0xe1')]=db['sequelize'][_0x0a9e('0x12')]('../api/license/license.model');db['Campaign']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/campaign/campaign.model');db[_0x0a9e('0xe2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe3'));db[_0x0a9e('0xe4')]=db['sequelize']['import'](_0x0a9e('0xe5'));db[_0x0a9e('0xe6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe7'));db['MailTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailTransferReport/mailTransferReport.model');db[_0x0a9e('0xe8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe9'));db[_0x0a9e('0xea')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xeb'));db[_0x0a9e('0xec')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xed'));db[_0x0a9e('0xee')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xef'));db['CmList']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf0'));db[_0x0a9e('0xf1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/voicePrefix/voicePrefix.model');db[_0x0a9e('0xf2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfile/userProfile.model');db[_0x0a9e('0xf3')]=db['sequelize'][_0x0a9e('0x12')]('../api/userProfileSection/userProfileSection.model');db[_0x0a9e('0xf4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfileResource/userProfileResource.model');db[_0x0a9e('0xf5')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf6'));db[_0x0a9e('0xf7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xf8'));db[_0x0a9e('0xf9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfa'));db[_0x0a9e('0xfb')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfc'));db[_0x0a9e('0xfd')]=db[_0x0a9e('0x1')]['import']('../api/whatsappMessage/whatsappMessage.model');db[_0x0a9e('0xfe')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xff'));db['WhatsappTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x100'));db[_0x0a9e('0x101')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x102'));db[_0x0a9e('0x103')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x104'));db[_0x0a9e('0x105')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x106'));db[_0x0a9e('0x107')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x108'));db[_0x0a9e('0x109')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x10a'));db['UserSetting']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/user-setting/user-setting.model');db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db[_0x0a9e('0x10c')],{'as':'VoiceMail','onDelete':'cascade','foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db['UserSetting'],{'as':_0x0a9e('0x10d'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x111')],{'as':_0x0a9e('0x112'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x113'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x117'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x118'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x11a'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xfb')],{'as':_0x0a9e('0x11e'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xf5')],{'as':_0x0a9e('0x11f'),'foreignKey':_0x0a9e('0x120')});db[_0x0a9e('0x11')]['belongsTo'](db[_0x0a9e('0xf2')],{'as':'UserProfile','foreignKey':'userProfileId'});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x68')],{'as':_0x0a9e('0x122'),'through':_0x0a9e('0x123')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x125'),'through':_0x0a9e('0x126')});db[_0x0a9e('0x11')]['belongsToMany'](db['CmList'],{'as':_0x0a9e('0x127'),'through':_0x0a9e('0x128')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x12a')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'through':_0x0a9e('0x12b')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'through':'user_has_chat_interactions'});db['User']['belongsToMany'](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x12c'),'through':_0x0a9e('0x12d')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x53')],{'as':'SmsInteractions','through':_0x0a9e('0x12e')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'as':_0x0a9e('0x118'),'through':_0x0a9e('0x12f')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0xfb')],{'as':'WhatsappInteractions','through':_0x0a9e('0x130')});db['User'][_0x0a9e('0x121')](db['VoiceQueue'],{'as':_0x0a9e('0x131'),'through':_0x0a9e('0x2d'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0xf1')],{'as':_0x0a9e('0x132'),'through':_0x0a9e('0x109'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x3c')],{'as':'MailQueues','through':_0x0a9e('0x30'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x133'),'through':_0x0a9e('0x134'),'required':![],'hooks':!![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x4c')],{'as':_0x0a9e('0x135'),'through':_0x0a9e('0x32'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'as':_0x0a9e('0x136'),'through':_0x0a9e('0x34'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x137')],{'as':'OpenchannelQueues','through':_0x0a9e('0x35'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'as':_0x0a9e('0x138'),'through':_0x0a9e('0x37'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'through':_0x0a9e('0x128')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x13a'),'through':_0x0a9e('0x13b')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x45')],{'as':'FaxAccounts','through':_0x0a9e('0x13c')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x13d'),'through':_0x0a9e('0x13e')});db[_0x0a9e('0x11')]['belongsToMany'](db['OpenchannelAccount'],{'as':_0x0a9e('0x13f'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x141'),'through':_0x0a9e('0x142')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x143'),'through':_0x0a9e('0x144')});db[_0x0a9e('0x13')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':'SpiedAgents','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x145')});db[_0x0a9e('0x146')]['hasMany'](db[_0x0a9e('0x16')],{'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x16')][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x147'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x18')][_0x0a9e('0x121')](db[_0x0a9e('0x84')],{'as':_0x0a9e('0x148'),'through':_0x0a9e('0x149')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x14a'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db['CmHopper'],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'VoiceQueueId'});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x116')],{'as':'HopperHistories','foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db['CmHopperBlack'],{'as':_0x0a9e('0x14d'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':_0x0a9e('0x14e'),'foreignKey':_0x0a9e('0x14b')});db['VoiceQueue']['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a')][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':_0x0a9e('0x151'),'foreignKey':_0x0a9e('0x152')});db['VoiceQueue'][_0x0a9e('0x150')](db['Interval'],{'as':'Interval','foreignKey':_0x0a9e('0x153')});db['VoiceQueue'][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db['VoiceQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x127'),'through':'voice_queues_has_cm_lists'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':'UserVoiceQueue'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'as':_0x0a9e('0x155'),'through':_0x0a9e('0x105')});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x157')});db['VoiceRecording']['belongsTo'](db['User'],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x1c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x10c')]['hasMany'](db['VoiceMailMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'mailboxuser','sourceKey':_0x0a9e('0x159')});db[_0x0a9e('0x1f')][_0x0a9e('0x150')](db[_0x0a9e('0x10c')],{'foreignKey':_0x0a9e('0x15a'),'targetKey':_0x0a9e('0x159')});db[_0x0a9e('0x15b')][_0x0a9e('0x110')](db[_0x0a9e('0x25')],{'as':_0x0a9e('0x15c'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')]['hasMany'](db[_0x0a9e('0x15e')],{'as':_0x0a9e('0x15f'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db['MailServerIn'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x39')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':'CloudProvider','foreignKey':_0x0a9e('0x162'),'onDelete':'restrict'});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':_0x0a9e('0x103'),'foreignKey':_0x0a9e('0x162'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x3b')][_0x0a9e('0x10b')](db[_0x0a9e('0x39')],{'as':_0x0a9e('0x165'),'onDelete':_0x0a9e('0x10e')});db['MailAccount']['hasOne'](db[_0x0a9e('0x163')],{'as':_0x0a9e('0x166'),'onDelete':'cascade'});db['MailAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'MailAccountId','onDelete':_0x0a9e('0x10e')});db['MailAccount'][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':'MailAccountId'});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x3e')],{'as':'Messages','foreignKey':_0x0a9e('0x161')});db['MailAccount']['hasMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x161'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x8b')],{'as':_0x0a9e('0x8b'),'foreignKey':_0x0a9e('0x16e')});db[_0x0a9e('0x3b')]['belongsTo'](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x3b')]['belongsToMany'](db['User'],{'as':'Agents','through':_0x0a9e('0x13e')});db['MailQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x30')});db[_0x0a9e('0x3c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x11c')]['hasMany'](db[_0x0a9e('0x3e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':'MailInteractionId'});db[_0x0a9e('0x11c')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x11c')]['belongsTo'](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11c')]['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12b'),'foreignKey':_0x0a9e('0x177')});db[_0x0a9e('0x3e')]['hasMany'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0x178'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':'User'});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x179'),'foreignKey':'MailInteractionId'});db['MailMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x60')],{'as':'ChatWebsite','foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':'ChatOfflineMessageId'});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')]['belongsTo'](db[_0x0a9e('0x3b')],{'onDelete':_0x0a9e('0x164')});db['MailApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':'TagId'});db['MailQueueReport']['belongsTo'](db['MailAccount'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':_0x0a9e('0x16d')});db['MailQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailInteraction'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailMessage'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{});db[_0x0a9e('0x17d')]['hasMany'](db[_0x0a9e('0x43')],{'as':'Items','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')]['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':'Answers','foreignKey':_0x0a9e('0x17f')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x147'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x180'),'onDelete':'cascade'});db[_0x0a9e('0x45')]['hasMany'](db['FaxMessage'],{'as':_0x0a9e('0x158')});db['FaxAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':'Trunk'});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x0a9e('0x45')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_fax_accounts'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'restrict'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x4c')],{'onDelete':'restrict'});db[_0x0a9e('0x47')]['belongsTo'](db[_0x0a9e('0x45')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['FaxInteraction'][_0x0a9e('0x110')](db[_0x0a9e('0x4a')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':'fax_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x185'),'as':'ThroughTags'});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12d'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x11')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x179'),'foreignKey':'FaxInteractionId'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':'Contact'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':'Account','foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db['User'],{'as':'Agents','through':_0x0a9e('0x32')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x187'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['FaxAccount'],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxInteraction'],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x4a')],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxQueue'],{});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x188'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db['SmsMessage'],{'as':_0x0a9e('0x158'),'foreignKey':_0x0a9e('0x188')});db['SmsAccount']['hasMany'](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x147'),'foreignKey':'SmsAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x50')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x142')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db['SmsApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{'onDelete':_0x0a9e('0x164')});db['SmsApplication']['belongsTo'](db[_0x0a9e('0x50')],{'onDelete':'restrict'});db[_0x0a9e('0x52')]['belongsTo'](db['Interval'],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x53')][_0x0a9e('0x110')](db[_0x0a9e('0x55')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x189')});db['SmsInteraction']['belongsTo'](db[_0x0a9e('0x50')],{'as':'Account','foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'sms_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x18a'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x53')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Users','through':_0x0a9e('0x12e'),'foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x55')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{'onDelete':'cascade','as':'Interaction','foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x57')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x34'),'foreignKey':_0x0a9e('0x18b')});db[_0x0a9e('0x57')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x59')]['hasMany'](db['Disposition'],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x59')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x16a'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','foreignKey':_0x0a9e('0x18d')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5b')],{'as':'Applications','foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x59')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x59')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x5b')]['belongsTo'](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db['OpenchannelQueue'],{'onDelete':'restrict','foreignKey':_0x0a9e('0x18e')});db['OpenchannelApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db['OpenchannelApplication']['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x5d')][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x18f')});db[_0x0a9e('0x5d')]['belongsTo'](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db['OpenchannelInteraction'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x5d')][_0x0a9e('0x150')](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x175')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':'user_has_openchannel_interactions','foreignKey':_0x0a9e('0x18f')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0x5d')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x179'),'foreignKey':'OpenchannelInteractionId'});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x35'),'foreignKey':_0x0a9e('0x18e')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x155')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x17a')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x191')],{'as':_0x0a9e('0x192')});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x63')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x65')],{'as':_0x0a9e('0x158')});db['ChatWebsite'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x60')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db['ChatWebsite'][_0x0a9e('0x150')](db['MailAccount'],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db['ChatWebsite'][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db['ChatWebsite'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x13b')});db['OpenchannelQueueReport']['belongsTo'](db['OpenchannelAccount'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x5d')],{});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db['OpenchannelMessage'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{});db['ChatApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x193'),'foreignKey':'UserId','onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x194'),'foreignKey':_0x0a9e('0x195'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':_0x0a9e('0x17a'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x64')][_0x0a9e('0x110')](db['ChatMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x64')]['belongsTo'](db['User'],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x199'),'foreignKey':_0x0a9e('0x197')});db['ChatMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x66')][_0x0a9e('0x110')](db['Attachment'],{'as':_0x0a9e('0x178'),'foreignKey':_0x0a9e('0x19a'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['ChatOfflineMessage']['belongsTo'](db['CmContact'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0x66')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x0a9e('0x67')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserChatQueue','hooks':!![]});db[_0x0a9e('0x67')]['belongsToMany'](db['Team'],{'through':_0x0a9e('0x19b'),'as':'Teams'});db[_0x0a9e('0x68')][_0x0a9e('0x110')](db[_0x0a9e('0xcc')],{'as':'Messages','foreignKey':_0x0a9e('0x19c'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x68')]['belongsToMany'](db['User'],{'as':_0x0a9e('0x14a'),'through':_0x0a9e('0x123')});db[_0x0a9e('0x191')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':'ChatWebsiteId'});db['CmCompany'][_0x0a9e('0x110')](db[_0x0a9e('0x124')],{'as':'Contacts','foreignKey':'CompanyId'});db['CmContact']['hasMany'](db['CmContactHasItem'],{'as':'Phones','foreignKey':_0x0a9e('0x19d')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':'HopperFinals','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':'JscriptySessions','foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':'OpenchannelInteractions','foreignKey':'ContactId','onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db['MailInteraction'],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x172'),'onDelete':'restrict'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x19f')],{'as':_0x0a9e('0x1a0'),'foreignKey':'CompanyId'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':'cascade'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':'cm_user_has_contacts'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'as':_0x0a9e('0x174'),'through':_0x0a9e('0x1a1')});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1a1'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x6d')][_0x0a9e('0x110')](db[_0x0a9e('0x1a2')],{'as':_0x0a9e('0x1a3'),'foreignKey':_0x0a9e('0x1a4')});db['CmHopper'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':'List','foreignKey':'ListId','onDelete':'cascade'});db['CmHopper'][_0x0a9e('0x150')](db['User'],{'as':'Agent','foreignKey':'UserId'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':_0x0a9e('0x194'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':'CampaignId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x1a6')});db['CmHopperBlack'][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172'),'onDelete':'cascade'});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':'Queue','foreignKey':_0x0a9e('0x14b'),'onDelete':_0x0a9e('0x10e')});db['CmHopperBlack'][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':_0x0a9e('0x1a7'),'onDelete':'cascade'});db[_0x0a9e('0x76')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1a8'),'singular':_0x0a9e('0x1a9')},'foreignKey':'AutomationAllId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x76')]['hasMany'](db[_0x0a9e('0x7a')],{'as':{'plural':'Any','singular':_0x0a9e('0x1aa')},'foreignKey':'AutomationAnyId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['Automation'][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'AutomationId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x167')]['hasMany'](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1ac'),'onDelete':'cascade'});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db['Interval'],{'as':_0x0a9e('0x1ad'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x10e'),'hooks':!![],'required':![]});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x164')});db['Interval'][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x1ae'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')]['hasMany'](db['ChatApplication'],{'as':_0x0a9e('0x1af'),'foreignKey':'IntervalId'});db[_0x0a9e('0x17b')]['hasMany'](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x1b0'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x1b1'),'foreignKey':'IntervalId'});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x94')],{'foreignKey':_0x0a9e('0x1b2')});db['Schedule']['belongsTo'](db['AnalyticCustomReport'],{'foreignKey':_0x0a9e('0x1b3')});db[_0x0a9e('0x84')][_0x0a9e('0x121')](db[_0x0a9e('0x18')],{'as':'Mohs','through':_0x0a9e('0x149'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0x124')],{'through':'cm_contact_has_tags'});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'through':'chat_interaction_has_tags'});db['Tag'][_0x0a9e('0x121')](db['MailInteraction'],{'through':_0x0a9e('0x173')});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x53')],{'through':_0x0a9e('0x18a')});db['Tag']['belongsToMany'](db[_0x0a9e('0x11b')],{'through':_0x0a9e('0x185')});db[_0x0a9e('0x86')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'through':_0x0a9e('0x1b4')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0xfb')],{'through':_0x0a9e('0x1b5')});db[_0x0a9e('0x1b6')]['belongsTo'](db[_0x0a9e('0x88')],{'as':_0x0a9e('0x1b7'),'foreignKey':_0x0a9e('0x1b8')});db[_0x0a9e('0x1a2')][_0x0a9e('0x150')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x1b9'),'foreignKey':_0x0a9e('0x1a4')});db[_0x0a9e('0x1b6')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x19d')});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1ba'),'singular':_0x0a9e('0x1bb')},'foreignKey':_0x0a9e('0x1bc'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db['Condition'],{'as':{'plural':_0x0a9e('0x1bd'),'singular':_0x0a9e('0x1be')},'foreignKey':_0x0a9e('0x1bf'),'onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'TriggerId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x1c0')]['hasMany'](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'CustomReportId','hooks':!![]});db['AnalyticDefaultReport'][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':'DefaultReportId'});db[_0x0a9e('0x98')][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c2')});db['AnalyticFieldReport']['belongsTo'](db[_0x0a9e('0x98')],{'foreignKey':_0x0a9e('0x1c2')});db[_0x0a9e('0x9c')]['hasMany'](db[_0x0a9e('0x9e')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['SalesforceConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c4'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0x9e')]['hasMany'](db['SalesforceField'],{'as':'Descriptions','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x9e')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db['SalesforceConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x9c')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa0')][_0x0a9e('0x110')](db['SalesforceField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa0')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['SalesforceField'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa0')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xa1')][_0x0a9e('0x110')](db[_0x0a9e('0xa2')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa2')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa2')][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['SugarcrmConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0xa1')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['SugarcrmField']['hasMany'](db['SugarcrmField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db['SugarcrmField'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1cc')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmField'][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1cf')]['hasMany'](db[_0x0a9e('0xa6')],{'as':'Configurations','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa6')]['hasMany'](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'DescriptionId'});db['DeskConfiguration']['hasMany'](db['DeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':'FieldId'});db[_0x0a9e('0xa6')][_0x0a9e('0x150')](db[_0x0a9e('0x1cf')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'int_desk_configuration_has_tags'});db['DeskField'][_0x0a9e('0x110')](db['DeskField'],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xa8')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['DeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':'Field','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa8')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xaa')][_0x0a9e('0x110')](db[_0x0a9e('0xac')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Subjects','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db['ZohoConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xac')][_0x0a9e('0x150')](db[_0x0a9e('0xaa')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xae')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xaf')][_0x0a9e('0x110')](db['ZendeskConfiguration'],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d0')]['hasMany'](db[_0x0a9e('0xb2')],{'as':'Descriptions','foreignKey':'DescriptionId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Fields','foreignKey':'FieldId'});db[_0x0a9e('0x1d0')][_0x0a9e('0x150')](db[_0x0a9e('0xaf')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0x1d0')]['belongsToMany'](db['Tag'],{'through':_0x0a9e('0x1d1')});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Subject','foreignKey':'SubjectId'});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['ZendeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb2')][_0x0a9e('0x150')](db['Variable'],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d2')][_0x0a9e('0x110')](db[_0x0a9e('0x1d3')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d3')]['hasMany'](db['FreshdeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['FreshdeskConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x1d2')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['FreshdeskConfiguration'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1d4')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db['FreshdeskField'],{'as':'Description','foreignKey':'DescriptionId'});db['FreshdeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb5')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d5')]['hasMany'](db[_0x0a9e('0xb8')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xb8')]['hasMany'](db[_0x0a9e('0xb9')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db['VtigerConfiguration'][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb8')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Fields','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb8')][_0x0a9e('0x150')](db[_0x0a9e('0x1d5')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db['VtigerField']['hasMany'](db[_0x0a9e('0xb9')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb9')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xba')]['hasMany'](db[_0x0a9e('0xbc')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbc')]['hasMany'](db['ServicenowField'],{'as':_0x0a9e('0x1c4'),'foreignKey':'SubjectId'});db[_0x0a9e('0xbc')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xbc')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c1'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbc')][_0x0a9e('0x150')](db[_0x0a9e('0xba')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['ServicenowField'][_0x0a9e('0x110')](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d6')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d6')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cb'),'foreignKey':'FieldId'});db[_0x0a9e('0x1d6')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xbe')]['hasMany'](db[_0x0a9e('0xbf')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbe')][_0x0a9e('0x150')](db['CloudProvider'],{'as':_0x0a9e('0x103'),'foreignKey':'CloudProviderId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['Dynamics365Configuration'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbf')][_0x0a9e('0x150')](db[_0x0a9e('0xbe')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['Dynamics365Field'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xc1')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['FreshsalesAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xc5')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db['FreshsalesField'],{'as':'Subjects','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cd'),'foreignKey':'DescriptionId'});db[_0x0a9e('0xc5')]['hasMany'](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1c1'),'foreignKey':'FieldId'});db[_0x0a9e('0xc5')]['belongsTo'](db[_0x0a9e('0xc3')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['FreshsalesField'][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['FreshsalesField']['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x60')],{});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':'ListId'});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{});db['ChatInternalMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':'FromId'});db['ChatInternalMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1d7')});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0x1d8')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0xcd')],{'foreignKey':'SessionId','onDelete':_0x0a9e('0x10e')});db['SmsQueueReport']['belongsTo'](db[_0x0a9e('0x50')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0xd2')]['belongsTo'](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xd2')]['belongsTo'](db['SmsMessage'],{});db['SmsQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0x1d8')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db['JscriptyAnswerReport'],{'foreignKey':'ProjectId'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_teams'});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0x1a')],{'through':'TeamVoiceQueue','as':_0x0a9e('0x131')});db['Team']['belongsToMany'](db[_0x0a9e('0x3c')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x1db')});db[_0x0a9e('0x129')]['belongsToMany'](db['ChatQueue'],{'through':_0x0a9e('0x19b'),'as':'ChatQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db['FaxQueue'],{'through':_0x0a9e('0x187'),'as':'FaxQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x136')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x137')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x1dc')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'through':_0x0a9e('0x1dd'),'as':_0x0a9e('0x138')});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0xf1')],{'through':_0x0a9e('0x107'),'as':_0x0a9e('0x132')});db['Campaign'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db['CmHopperHistory'],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')]['hasMany'](db[_0x0a9e('0x6f')],{'as':'HopperBlacks','foreignKey':'CampaignId'});db[_0x0a9e('0x1a5')]['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['Trunk'],{'as':_0x0a9e('0x151'),'foreignKey':'TrunkBackupId'});db['Campaign'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['SquareProject'],{'as':_0x0a9e('0xdc'),'foreignKey':_0x0a9e('0x1de')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':'Lists','through':_0x0a9e('0x1df')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x1e0')});db[_0x0a9e('0xe4')][_0x0a9e('0x150')](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':_0x0a9e('0x19a')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db['MailMessage'],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e2'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0x1e1')]['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'foreignKey':'ToMailQueueId','as':'ToQueue'});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e7'),'as':_0x0a9e('0x1e8')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['ChatInteraction'],{});db[_0x0a9e('0xe8')]['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1e9'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xe8')]['belongsTo'](db[_0x0a9e('0x67')],{'foreignKey':_0x0a9e('0x1eb'),'as':'ToQueue'});db['ChatTransferReport']['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1ec'),'as':_0x0a9e('0x1e8')});db['FaxTransferReport'][_0x0a9e('0x150')](db['FaxMessage'],{});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{});db['FaxTransferReport']['belongsTo'](db[_0x0a9e('0x45')],{'foreignKey':_0x0a9e('0x1ed'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xea')]['belongsTo'](db['FaxQueue'],{'foreignKey':_0x0a9e('0x1ee'),'as':_0x0a9e('0x1ef')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'foreignKey':'ToFaxAccountId','as':_0x0a9e('0x1e8')});db[_0x0a9e('0xec')]['belongsTo'](db[_0x0a9e('0x5e')],{});db['OpenchannelTransferReport']['belongsTo'](db['OpenchannelInteraction'],{});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['OpenchannelAccount'],{'foreignKey':'FromOpenchannelAccountId','as':_0x0a9e('0x1e3')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{'foreignKey':'ToOpenchannelQueueId','as':'ToQueue'});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'foreignKey':'ToOpenchannelAccountId','as':'ToAccount'});db['SmsTransferReport']['belongsTo'](db[_0x0a9e('0x55')],{});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':_0x0a9e('0x1f0'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xee')]['belongsTo'](db['SmsQueue'],{'foreignKey':'ToSmsQueueId','as':_0x0a9e('0x1ef')});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':'ToSmsAccountId','as':'ToAccount'});db['CmList']['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x1f1')],{'as':_0x0a9e('0x1f2'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db['CmContact'],{'as':_0x0a9e('0x125'),'onDelete':'cascade','foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':'HopperHistory','foreignKey':'ListId'});db['CmList'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':'ListId'});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x1a')],{'as':'Queues','through':_0x0a9e('0x1f3')});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x128')});db[_0x0a9e('0xf1')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf1')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserVoicePrefix'});db[_0x0a9e('0xf1')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':'TeamVoicePrefix','as':_0x0a9e('0x155')});db[_0x0a9e('0xf2')][_0x0a9e('0x110')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'foreignKey':_0x0a9e('0x1f4')});db['UserProfile'][_0x0a9e('0x110')](db['UserProfileSection'],{'as':_0x0a9e('0x1f5'),'foreignKey':_0x0a9e('0x1f4'),'onDelete':_0x0a9e('0x10e')});db['UserProfileSection']['hasMany'](db['UserProfileResource'],{'as':_0x0a9e('0x1f6'),'foreignKey':_0x0a9e('0x1f7'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x1f8')});db['WhatsappAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xfd')],{'as':_0x0a9e('0x158'),'foreignKey':'WhatsappAccountId'});db[_0x0a9e('0xf7')]['hasMany'](db[_0x0a9e('0xfb')],{'as':'Interactions'});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['WhatsappApplication'],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db['WhatsappAccount'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xf7')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0xf7')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x144')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x101')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db['WhatsappAccount'],{'onDelete':_0x0a9e('0x164')});db['WhatsappApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0xf9')]['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['WhatsappInteraction'][_0x0a9e('0x110')](db['WhatsappMessage'],{'as':'Messages','onDelete':'cascade','foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0xfb')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x174')});db['WhatsappInteraction'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x175')});db[_0x0a9e('0xfb')]['belongsToMany'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x130'),'foreignKey':'WhatsappInteractionId'});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':_0x0a9e('0x160')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db['WhatsappInteraction'],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfd')]['belongsTo'](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{});db['WhatsappQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['WhatsappInteraction'],{});db['WhatsappQueueReport']['belongsTo'](db[_0x0a9e('0x101')],{});db[_0x0a9e('0xfe')]['belongsTo'](db['WhatsappMessage'],{});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['User'],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfd')],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfb')],{});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappAccount'],{'foreignKey':_0x0a9e('0x1fb'),'as':_0x0a9e('0x1e3')});db['WhatsappTransferReport']['belongsTo'](db[_0x0a9e('0xf7')],{'foreignKey':_0x0a9e('0x1fc'),'as':'ToAccount'});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappQueue'],{'foreignKey':_0x0a9e('0x1fd'),'as':_0x0a9e('0x1ef')});db['WhatsappTransferReport']['belongsTo'](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':'FromAgent'});db[_0x0a9e('0x1fa')][_0x0a9e('0x150')](db['User'],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x37'),'foreignKey':'WhatsappQueueId'});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x1dd'),'as':'Teams'});db[_0x0a9e('0x1fe')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x1ff'),'foreignKey':_0x0a9e('0x10f'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x103')][_0x0a9e('0x10b')](db['Dynamics365Account'],{'as':_0x0a9e('0xbe'),'onDelete':_0x0a9e('0x164')});db['CloudProvider'][_0x0a9e('0x10b')](db['MailServerIn'],{'as':'Imap','onDelete':_0x0a9e('0x164')});db['CloudProvider']['hasOne'](db['MailServerOut'],{'as':'Smtp','onDelete':_0x0a9e('0x164')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xa9e0=['SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','License','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','VoicePrefix','UserProfile','UserProfileSection','UserProfileResource','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','hasOne','VoiceMail','userSetting','cascade','UserId','hasMany','VoiceRecording','Recordings','VoiceQueuesRt','Extensions','HopperFinals','CmHopperHistory','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteraction','MailInteraction','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsToMany','Groups','chat_group_has_users','CmContact','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','Team','user_has_teams','user_has_mail_interactions','FaxInteractions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','ChatQueues','UserChatQueue','FaxQueues','SmsQueues','OpenchannelQueue','WhatsappQueues','CmList','ChatWebsites','user_has_chat_websites','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','ChanSpyId','VoiceContext','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperBlacks','JscriptySessions','TrunkId','belongsTo','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPauseId','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailbox','mailboxuser','VoiceCallReport','QueueCalls','uniqueid','VoiceAgentReport','AgentReports','Contact','MailAccountId','CloudProviderId','MailServerOut','restrict','Imap','Smtp','Disposition','Dispositions','Answers','Interactions','MailApplication','List','ListId','TemplateId','mandatoryDispositionPause','Agents','team_has_mail_queues','ContactId','mail_interaction_has_tags','Tags','ThroughTags','Users','MailInteractionId','Attachments','Interaction','ChatWebsiteId','Interval','MailQueueReport','Dashboard','CannedAnswer','FaxAccountId','Exntensions','TagId','FaxInteractionId','Account','Owner','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','team_has_openchannel_queues','ChatProactiveAction','ProactiveActions','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','ChatOfflineMessageId','team_has_chat_queues','ChatGroupId','CmContactId','HopperHistories','CmCompany','Company','cm_contact_has_tags','CmHopperAdditionalPhone','AdditionalPhones','CmHopperId','Campaign','OwnerId','CampaignId','All','OneAll','OneAny','Actions','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','openchannel_interaction_has_tags','whatsapp_interaction_has_tags','CmContactHasItem','ItemType','ItemTypeId','Hopper','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','AnalyticCustomReport','Fields','MetricId','Configurations','Subjects','DescriptionId','FieldId','AccountId','Subject','SubjectId','Description','Field','SugarcrmField','Descriptions','VariableId','DeskAccount','ZendeskConfiguration','int_zendesk_configuration_has_tags','FreshdeskAccount','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','VtigerAccount','ServicenowField','ToId','JscriptyQuestionReport','JscriptyProject','ProjectId','MailQueues','OpenchannelQueues','team_has_whatsapp_queues','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','MailTransferReport','FromMailAccountId','FromAccount','FromAgent','ToUserId','ToAgent','ToMailAccountId','ToAccount','FromChatWebsiteId','FromUserId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToQueue','FromSmsAccountId','CmCustomField','CustomFields','voice_queues_has_cm_lists','userProfileId','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','WhatsappTransferReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','UserSetting','user','../config/environment','sequelize','lodash','motion2','xcall','xC@LL1234','127.0.0.1','utf8mb4','name','utf8','defaultsDeep','mysql','username','password','options','database','sequelizeHistory','User','import','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','ScreenRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','Trunk','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerOut/mailServerOut.model','MailAccount','MailQueue','MailSubstatus','MailMessage','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','OpenchannelMessage','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatApplication','ChatInteraction','ChatMessage','ChatOfflineMessage','ChatQueue','ChatGroup','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','ReportAgentPreview','Action','../api/action/action.model','Automation','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','Condition','../api/condition/condition.model','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','../api/cmContactHasItem/cmContactHasItem.model','Template','../api/template/template.model','Trigger','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmAccount','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','Dynamics365Account','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject'];(function(_0x519756,_0x288785){var _0x37047e=function(_0x3d64a7){while(--_0x3d64a7){_0x519756['push'](_0x519756['shift']());}};_0x37047e(++_0x288785);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'use strict';var config=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var jstz=require('jstz');var timezone=jstz['determine']();config[_0x0a9e('0x1')]=_['defaultsDeep'](config[_0x0a9e('0x1')],{'database':_0x0a9e('0x3'),'username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':_0x0a9e('0x9'),'collate':'utf8_general_ci'}}});config['sequelizeHistory']=_[_0x0a9e('0xa')](config['sequelizeHistory'],{'database':'motion2','username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':_0x0a9e('0xb'),'dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize']['database'],config[_0x0a9e('0x1')][_0x0a9e('0xc')],config[_0x0a9e('0x1')][_0x0a9e('0xd')],config[_0x0a9e('0x1')][_0x0a9e('0xe')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0x0a9e('0xf')],config[_0x0a9e('0x10')][_0x0a9e('0xc')],config[_0x0a9e('0x10')][_0x0a9e('0xd')],config[_0x0a9e('0x10')]['options'])};db[_0x0a9e('0x11')]=db['sequelize'][_0x0a9e('0x12')]('../api/user/user.model');db[_0x0a9e('0x13')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x14'));db['VoiceContext']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x15'));db[_0x0a9e('0x16')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x17'));db[_0x0a9e('0x18')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x19'));db[_0x0a9e('0x1a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x1b'));db['VoiceRecording']=db[_0x0a9e('0x1')]['import']('../api/voiceRecording/voiceRecording.model');db[_0x0a9e('0x1c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1d'));db['VoiceMail']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1e'));db[_0x0a9e('0x1f')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x20'));db['VoiceCallReport']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x21'));db[_0x0a9e('0x22')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x23'));db['VoiceAgentReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x24'));db[_0x0a9e('0x25')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x26'));db[_0x0a9e('0x27')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/memberReport/memberReport.model');db[_0x0a9e('0x28')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x29'));db['VoiceTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2a'));db[_0x0a9e('0x2b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2c'));db[_0x0a9e('0x2d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x2e'));db['UserChatQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2f'));db[_0x0a9e('0x30')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x31'));db[_0x0a9e('0x32')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x33'));db[_0x0a9e('0x34')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userSmsQueue/userSmsQueue.model');db[_0x0a9e('0x35')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x36'));db[_0x0a9e('0x37')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x38'));db[_0x0a9e('0x39')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailServerIn/mailServerIn.model');db['MailServerOut']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x3a'));db[_0x0a9e('0x3b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailAccount/mailAccount.model');db[_0x0a9e('0x3c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailQueue/mailQueue.model');db[_0x0a9e('0x3d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailSubstatus/mailSubstatus.model');db['MailInteraction']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailInteraction/mailInteraction.model');db[_0x0a9e('0x3e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x3f'));db['MailApplication']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x40'));db['MailQueueReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x41'));db['Dashboard']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x42'));db[_0x0a9e('0x43')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x44'));db[_0x0a9e('0x45')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x46'));db[_0x0a9e('0x47')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x48'));db['FaxInteraction']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x49'));db[_0x0a9e('0x4a')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4b'));db[_0x0a9e('0x4c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4d'));db[_0x0a9e('0x4e')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x4f'));db[_0x0a9e('0x50')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x51'));db[_0x0a9e('0x52')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/smsApplication/smsApplication.model');db[_0x0a9e('0x53')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x54'));db[_0x0a9e('0x55')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x56'));db[_0x0a9e('0x57')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x58'));db[_0x0a9e('0x59')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x5a'));db[_0x0a9e('0x5b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5c'));db[_0x0a9e('0x5d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/openchannelInteraction/openchannelInteraction.model');db[_0x0a9e('0x5e')]=db[_0x0a9e('0x1')]['import']('../api/openchannelMessage/openchannelMessage.model');db['OpenchannelQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5f'));db[_0x0a9e('0x60')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x61'));db[_0x0a9e('0x62')]=db['sequelize']['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x0a9e('0x63')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatApplication/chatApplication.model');db[_0x0a9e('0x64')]=db[_0x0a9e('0x1')]['import']('../api/chatInteraction/chatInteraction.model');db[_0x0a9e('0x65')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatMessage/chatMessage.model');db[_0x0a9e('0x66')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0x0a9e('0x67')]=db[_0x0a9e('0x1')]['import']('../api/chatQueue/chatQueue.model');db[_0x0a9e('0x68')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x69'));db['ChatProactiveAction']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x6a'));db['CmCompany']=db['sequelize']['import'](_0x0a9e('0x6b'));db['CmContact']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6c'));db[_0x0a9e('0x6d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6e'));db[_0x0a9e('0x6f')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x70'));db[_0x0a9e('0x71')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x72'));db['CmHopperHistory']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0x0a9e('0x73')]=db['sequelize'][_0x0a9e('0x12')]('../api/reportAgentPreview/reportAgentPreview.model');db['CmCustomField']=db['sequelize'][_0x0a9e('0x12')]('../api/cmCustomField/cmCustomField.model');db[_0x0a9e('0x74')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x75'));db[_0x0a9e('0x76')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x77'));db['CannedAnswer']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x78'));db['Disposition']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x79'));db[_0x0a9e('0x7a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x7b'));db['Interval']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x7c'));db[_0x0a9e('0x7d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x7e'));db[_0x0a9e('0x7f')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x80'));db['VoiceQueuesLog']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x81'));db[_0x0a9e('0x82')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x83'));db[_0x0a9e('0x84')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x85'));db[_0x0a9e('0x86')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x87'));db[_0x0a9e('0x88')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x89'));db['CmContactHasItem']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8a'));db['CmHopperAdditionalPhone']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model');db[_0x0a9e('0x8b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8c'));db[_0x0a9e('0x8d')]=db['sequelize']['import']('../api/trigger/trigger.model');db[_0x0a9e('0x8e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8f'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['IntegrationReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x92'));db['AnalyticCustomReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x93'));db[_0x0a9e('0x94')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x95'));db[_0x0a9e('0x96')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x97'));db[_0x0a9e('0x98')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/analyticMetric/analyticMetric.model');db[_0x0a9e('0x99')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9a'));db['AnalyticTreeReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9b'));db[_0x0a9e('0x9c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9d'));db[_0x0a9e('0x9e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9f'));db[_0x0a9e('0xa0')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSalesforceField/intSalesforceField.model');db[_0x0a9e('0xa1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x0a9e('0xa2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa3'));db['SugarcrmField']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa4'));db['DeskAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xa5'));db[_0x0a9e('0xa6')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa7'));db[_0x0a9e('0xa8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa9'));db[_0x0a9e('0xaa')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xab'));db[_0x0a9e('0xac')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xad'));db[_0x0a9e('0xae')]=db['sequelize'][_0x0a9e('0x12')]('../api/intZohoField/intZohoField.model');db[_0x0a9e('0xaf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb0'));db['ZendeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb1'));db[_0x0a9e('0xb2')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb3'));db['FreshdeskAccount']=db['sequelize'][_0x0a9e('0x12')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db['FreshdeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb4'));db[_0x0a9e('0xb5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb6'));db['VtigerAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xb7'));db[_0x0a9e('0xb8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x0a9e('0xb9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerField/intVtigerField.model');db[_0x0a9e('0xba')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbb'));db[_0x0a9e('0xbc')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbd'));db['ServicenowField']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intServicenowField/intServicenowField.model');db[_0x0a9e('0xbe')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0x0a9e('0xbf')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xc0'));db[_0x0a9e('0xc1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc2'));db[_0x0a9e('0xc3')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xc4'));db[_0x0a9e('0xc5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc6'));db[_0x0a9e('0xc7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc8'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['Network']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc9'));db[_0x0a9e('0xca')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcb'));db[_0x0a9e('0xcc')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0x0a9e('0xcd')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xce'));db['JscriptyQuestionReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcf'));db[_0x0a9e('0xd0')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xd1'));db[_0x0a9e('0xd2')]=db['sequelize']['import'](_0x0a9e('0xd3'));db[_0x0a9e('0xd4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd5'));db[_0x0a9e('0xd6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd7'));db['JscriptyProject']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xd8'));db[_0x0a9e('0xd9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xda'));db['SquareOdbc']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xdb'));db[_0x0a9e('0xdc')]=db[_0x0a9e('0x1')]['import']('../api/squareProject/squareProject.model');db[_0x0a9e('0xdd')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xde'));db[_0x0a9e('0xdf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe0'));db['Team']=db['sequelize'][_0x0a9e('0x12')]('../api/team/team.model');db[_0x0a9e('0xe1')]=db['sequelize'][_0x0a9e('0x12')]('../api/license/license.model');db['Campaign']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/campaign/campaign.model');db[_0x0a9e('0xe2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe3'));db[_0x0a9e('0xe4')]=db['sequelize']['import'](_0x0a9e('0xe5'));db[_0x0a9e('0xe6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe7'));db['MailTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailTransferReport/mailTransferReport.model');db[_0x0a9e('0xe8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe9'));db[_0x0a9e('0xea')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xeb'));db[_0x0a9e('0xec')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xed'));db[_0x0a9e('0xee')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xef'));db['CmList']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf0'));db[_0x0a9e('0xf1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/voicePrefix/voicePrefix.model');db[_0x0a9e('0xf2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfile/userProfile.model');db[_0x0a9e('0xf3')]=db['sequelize'][_0x0a9e('0x12')]('../api/userProfileSection/userProfileSection.model');db[_0x0a9e('0xf4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfileResource/userProfileResource.model');db[_0x0a9e('0xf5')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf6'));db[_0x0a9e('0xf7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xf8'));db[_0x0a9e('0xf9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfa'));db[_0x0a9e('0xfb')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfc'));db[_0x0a9e('0xfd')]=db[_0x0a9e('0x1')]['import']('../api/whatsappMessage/whatsappMessage.model');db[_0x0a9e('0xfe')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xff'));db['WhatsappTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x100'));db[_0x0a9e('0x101')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x102'));db[_0x0a9e('0x103')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x104'));db[_0x0a9e('0x105')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x106'));db[_0x0a9e('0x107')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x108'));db[_0x0a9e('0x109')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x10a'));db['UserSetting']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/user-setting/user-setting.model');db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db[_0x0a9e('0x10c')],{'as':'VoiceMail','onDelete':'cascade','foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db['UserSetting'],{'as':_0x0a9e('0x10d'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x111')],{'as':_0x0a9e('0x112'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x113'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x117'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x118'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x11a'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xfb')],{'as':_0x0a9e('0x11e'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xf5')],{'as':_0x0a9e('0x11f'),'foreignKey':_0x0a9e('0x120')});db[_0x0a9e('0x11')]['belongsTo'](db[_0x0a9e('0xf2')],{'as':'UserProfile','foreignKey':'userProfileId'});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x68')],{'as':_0x0a9e('0x122'),'through':_0x0a9e('0x123')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x125'),'through':_0x0a9e('0x126')});db[_0x0a9e('0x11')]['belongsToMany'](db['CmList'],{'as':_0x0a9e('0x127'),'through':_0x0a9e('0x128')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x12a')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'through':_0x0a9e('0x12b')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'through':'user_has_chat_interactions'});db['User']['belongsToMany'](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x12c'),'through':_0x0a9e('0x12d')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x53')],{'as':'SmsInteractions','through':_0x0a9e('0x12e')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'as':_0x0a9e('0x118'),'through':_0x0a9e('0x12f')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0xfb')],{'as':'WhatsappInteractions','through':_0x0a9e('0x130')});db['User'][_0x0a9e('0x121')](db['VoiceQueue'],{'as':_0x0a9e('0x131'),'through':_0x0a9e('0x2d'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0xf1')],{'as':_0x0a9e('0x132'),'through':_0x0a9e('0x109'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x3c')],{'as':'MailQueues','through':_0x0a9e('0x30'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x133'),'through':_0x0a9e('0x134'),'required':![],'hooks':!![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x4c')],{'as':_0x0a9e('0x135'),'through':_0x0a9e('0x32'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'as':_0x0a9e('0x136'),'through':_0x0a9e('0x34'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x137')],{'as':'OpenchannelQueues','through':_0x0a9e('0x35'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'as':_0x0a9e('0x138'),'through':_0x0a9e('0x37'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'through':_0x0a9e('0x128')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x13a'),'through':_0x0a9e('0x13b')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x45')],{'as':'FaxAccounts','through':_0x0a9e('0x13c')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x13d'),'through':_0x0a9e('0x13e')});db[_0x0a9e('0x11')]['belongsToMany'](db['OpenchannelAccount'],{'as':_0x0a9e('0x13f'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x141'),'through':_0x0a9e('0x142')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x143'),'through':_0x0a9e('0x144')});db[_0x0a9e('0x13')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':'SpiedAgents','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x145')});db[_0x0a9e('0x146')]['hasMany'](db[_0x0a9e('0x16')],{'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x16')][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x147'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x18')][_0x0a9e('0x121')](db[_0x0a9e('0x84')],{'as':_0x0a9e('0x148'),'through':_0x0a9e('0x149')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x14a'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db['CmHopper'],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'VoiceQueueId'});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x116')],{'as':'HopperHistories','foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db['CmHopperBlack'],{'as':_0x0a9e('0x14d'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':_0x0a9e('0x14e'),'foreignKey':_0x0a9e('0x14b')});db['VoiceQueue']['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a')][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':_0x0a9e('0x151'),'foreignKey':_0x0a9e('0x152')});db['VoiceQueue'][_0x0a9e('0x150')](db['Interval'],{'as':'Interval','foreignKey':_0x0a9e('0x153')});db['VoiceQueue'][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db['VoiceQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x127'),'through':'voice_queues_has_cm_lists'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':'UserVoiceQueue'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'as':_0x0a9e('0x155'),'through':_0x0a9e('0x105')});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x157')});db['VoiceRecording']['belongsTo'](db['User'],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x1c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x10c')]['hasMany'](db['VoiceMailMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'mailboxuser','sourceKey':_0x0a9e('0x159')});db[_0x0a9e('0x1f')][_0x0a9e('0x150')](db[_0x0a9e('0x10c')],{'foreignKey':_0x0a9e('0x15a'),'targetKey':_0x0a9e('0x159')});db[_0x0a9e('0x15b')][_0x0a9e('0x110')](db[_0x0a9e('0x25')],{'as':_0x0a9e('0x15c'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')]['hasMany'](db[_0x0a9e('0x15e')],{'as':_0x0a9e('0x15f'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db['MailServerIn'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x39')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':'CloudProvider','foreignKey':_0x0a9e('0x162'),'onDelete':'restrict'});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':_0x0a9e('0x103'),'foreignKey':_0x0a9e('0x162'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x3b')][_0x0a9e('0x10b')](db[_0x0a9e('0x39')],{'as':_0x0a9e('0x165'),'onDelete':_0x0a9e('0x10e')});db['MailAccount']['hasOne'](db[_0x0a9e('0x163')],{'as':_0x0a9e('0x166'),'onDelete':'cascade'});db['MailAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'MailAccountId','onDelete':_0x0a9e('0x10e')});db['MailAccount'][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':'MailAccountId'});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x3e')],{'as':'Messages','foreignKey':_0x0a9e('0x161')});db['MailAccount']['hasMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x161'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x8b')],{'as':_0x0a9e('0x8b'),'foreignKey':_0x0a9e('0x16e')});db[_0x0a9e('0x3b')]['belongsTo'](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x3b')]['belongsToMany'](db['User'],{'as':'Agents','through':_0x0a9e('0x13e')});db['MailQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x30')});db[_0x0a9e('0x3c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x11c')]['hasMany'](db[_0x0a9e('0x3e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':'MailInteractionId'});db[_0x0a9e('0x11c')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x11c')]['belongsTo'](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11c')]['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12b'),'foreignKey':_0x0a9e('0x177')});db[_0x0a9e('0x3e')]['hasMany'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0x178'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':'User'});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x179'),'foreignKey':'MailInteractionId'});db['MailMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x60')],{'as':'ChatWebsite','foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':'ChatOfflineMessageId'});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')]['belongsTo'](db[_0x0a9e('0x3b')],{'onDelete':_0x0a9e('0x164')});db['MailApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':'TagId'});db['MailQueueReport']['belongsTo'](db['MailAccount'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':_0x0a9e('0x16d')});db['MailQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailInteraction'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailMessage'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{});db[_0x0a9e('0x17d')]['hasMany'](db[_0x0a9e('0x43')],{'as':'Items','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')]['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':'Answers','foreignKey':_0x0a9e('0x17f')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x147'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x180'),'onDelete':'cascade'});db[_0x0a9e('0x45')]['hasMany'](db['FaxMessage'],{'as':_0x0a9e('0x158')});db['FaxAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':'Trunk'});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x0a9e('0x45')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_fax_accounts'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'restrict'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x4c')],{'onDelete':'restrict'});db[_0x0a9e('0x47')]['belongsTo'](db[_0x0a9e('0x45')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['FaxInteraction'][_0x0a9e('0x110')](db[_0x0a9e('0x4a')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':'fax_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x185'),'as':'ThroughTags'});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12d'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x11')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x179'),'foreignKey':'FaxInteractionId'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':'Contact'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':'Account','foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db['User'],{'as':'Agents','through':_0x0a9e('0x32')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x187'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['FaxAccount'],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxInteraction'],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x4a')],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxQueue'],{});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x188'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db['SmsMessage'],{'as':_0x0a9e('0x158'),'foreignKey':_0x0a9e('0x188')});db['SmsAccount']['hasMany'](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x147'),'foreignKey':'SmsAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x50')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x142')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db['SmsApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{'onDelete':_0x0a9e('0x164')});db['SmsApplication']['belongsTo'](db[_0x0a9e('0x50')],{'onDelete':'restrict'});db[_0x0a9e('0x52')]['belongsTo'](db['Interval'],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x53')][_0x0a9e('0x110')](db[_0x0a9e('0x55')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x189')});db['SmsInteraction']['belongsTo'](db[_0x0a9e('0x50')],{'as':'Account','foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'sms_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x18a'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x53')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Users','through':_0x0a9e('0x12e'),'foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x55')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{'onDelete':'cascade','as':'Interaction','foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x57')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x34'),'foreignKey':_0x0a9e('0x18b')});db[_0x0a9e('0x57')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x59')]['hasMany'](db['Disposition'],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x59')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x16a'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','foreignKey':_0x0a9e('0x18d')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5b')],{'as':'Applications','foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x59')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x59')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x5b')]['belongsTo'](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db['OpenchannelQueue'],{'onDelete':'restrict','foreignKey':_0x0a9e('0x18e')});db['OpenchannelApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db['OpenchannelApplication']['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x5d')][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x18f')});db[_0x0a9e('0x5d')]['belongsTo'](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db['OpenchannelInteraction'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x5d')][_0x0a9e('0x150')](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x175')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':'user_has_openchannel_interactions','foreignKey':_0x0a9e('0x18f')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0x5d')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x179'),'foreignKey':'OpenchannelInteractionId'});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x35'),'foreignKey':_0x0a9e('0x18e')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x155')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x17a')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x191')],{'as':_0x0a9e('0x192')});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x63')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x65')],{'as':_0x0a9e('0x158')});db['ChatWebsite'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x60')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db['ChatWebsite'][_0x0a9e('0x150')](db['MailAccount'],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db['ChatWebsite'][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db['ChatWebsite'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x13b')});db['OpenchannelQueueReport']['belongsTo'](db['OpenchannelAccount'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x5d')],{});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db['OpenchannelMessage'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{});db['ChatApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x193'),'foreignKey':'UserId','onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x194'),'foreignKey':_0x0a9e('0x195'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':_0x0a9e('0x17a'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x64')][_0x0a9e('0x110')](db['ChatMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x64')]['belongsTo'](db['User'],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x199'),'foreignKey':_0x0a9e('0x197')});db['ChatMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x66')][_0x0a9e('0x110')](db['Attachment'],{'as':_0x0a9e('0x178'),'foreignKey':_0x0a9e('0x19a'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['ChatOfflineMessage']['belongsTo'](db['CmContact'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0x66')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x0a9e('0x67')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserChatQueue','hooks':!![]});db[_0x0a9e('0x67')]['belongsToMany'](db['Team'],{'through':_0x0a9e('0x19b'),'as':'Teams'});db[_0x0a9e('0x68')][_0x0a9e('0x110')](db[_0x0a9e('0xcc')],{'as':'Messages','foreignKey':_0x0a9e('0x19c'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x68')]['belongsToMany'](db['User'],{'as':_0x0a9e('0x14a'),'through':_0x0a9e('0x123')});db[_0x0a9e('0x191')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':'ChatWebsiteId'});db['CmCompany'][_0x0a9e('0x110')](db[_0x0a9e('0x124')],{'as':'Contacts','foreignKey':'CompanyId'});db['CmContact']['hasMany'](db['CmContactHasItem'],{'as':'Phones','foreignKey':_0x0a9e('0x19d')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':'HopperFinals','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':'JscriptySessions','foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':'OpenchannelInteractions','foreignKey':'ContactId','onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db['MailInteraction'],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x172'),'onDelete':'restrict'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x19f')],{'as':_0x0a9e('0x1a0'),'foreignKey':'CompanyId'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':'cascade'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':'cm_user_has_contacts'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'as':_0x0a9e('0x174'),'through':_0x0a9e('0x1a1')});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1a1'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x6d')][_0x0a9e('0x110')](db[_0x0a9e('0x1a2')],{'as':_0x0a9e('0x1a3'),'foreignKey':_0x0a9e('0x1a4')});db['CmHopper'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':'List','foreignKey':'ListId','onDelete':'cascade'});db['CmHopper'][_0x0a9e('0x150')](db['User'],{'as':'Agent','foreignKey':'UserId'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':_0x0a9e('0x194'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':'CampaignId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x1a6')});db['CmHopperBlack'][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172'),'onDelete':'cascade'});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':'Queue','foreignKey':_0x0a9e('0x14b'),'onDelete':_0x0a9e('0x10e')});db['CmHopperBlack'][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':_0x0a9e('0x1a7'),'onDelete':'cascade'});db[_0x0a9e('0x76')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1a8'),'singular':_0x0a9e('0x1a9')},'foreignKey':'AutomationAllId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x76')]['hasMany'](db[_0x0a9e('0x7a')],{'as':{'plural':'Any','singular':_0x0a9e('0x1aa')},'foreignKey':'AutomationAnyId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['Automation'][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'AutomationId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x167')]['hasMany'](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1ac'),'onDelete':'cascade'});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db['Interval'],{'as':_0x0a9e('0x1ad'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x10e'),'hooks':!![],'required':![]});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x164')});db['Interval'][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x1ae'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')]['hasMany'](db['ChatApplication'],{'as':_0x0a9e('0x1af'),'foreignKey':'IntervalId'});db[_0x0a9e('0x17b')]['hasMany'](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x1b0'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x1b1'),'foreignKey':'IntervalId'});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x94')],{'foreignKey':_0x0a9e('0x1b2')});db['Schedule']['belongsTo'](db['AnalyticCustomReport'],{'foreignKey':_0x0a9e('0x1b3')});db[_0x0a9e('0x84')][_0x0a9e('0x121')](db[_0x0a9e('0x18')],{'as':'Mohs','through':_0x0a9e('0x149'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0x124')],{'through':'cm_contact_has_tags'});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'through':'chat_interaction_has_tags'});db['Tag'][_0x0a9e('0x121')](db['MailInteraction'],{'through':_0x0a9e('0x173')});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x53')],{'through':_0x0a9e('0x18a')});db['Tag']['belongsToMany'](db[_0x0a9e('0x11b')],{'through':_0x0a9e('0x185')});db[_0x0a9e('0x86')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'through':_0x0a9e('0x1b4')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0xfb')],{'through':_0x0a9e('0x1b5')});db[_0x0a9e('0x1b6')]['belongsTo'](db[_0x0a9e('0x88')],{'as':_0x0a9e('0x1b7'),'foreignKey':_0x0a9e('0x1b8')});db[_0x0a9e('0x1a2')][_0x0a9e('0x150')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x1b9'),'foreignKey':_0x0a9e('0x1a4')});db[_0x0a9e('0x1b6')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x19d')});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1ba'),'singular':_0x0a9e('0x1bb')},'foreignKey':_0x0a9e('0x1bc'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db['Condition'],{'as':{'plural':_0x0a9e('0x1bd'),'singular':_0x0a9e('0x1be')},'foreignKey':_0x0a9e('0x1bf'),'onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'TriggerId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x1c0')]['hasMany'](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'CustomReportId','hooks':!![]});db['AnalyticDefaultReport'][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':'DefaultReportId'});db[_0x0a9e('0x98')][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c2')});db['AnalyticFieldReport']['belongsTo'](db[_0x0a9e('0x98')],{'foreignKey':_0x0a9e('0x1c2')});db[_0x0a9e('0x9c')]['hasMany'](db[_0x0a9e('0x9e')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['SalesforceConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c4'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0x9e')]['hasMany'](db['SalesforceField'],{'as':'Descriptions','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x9e')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db['SalesforceConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x9c')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa0')][_0x0a9e('0x110')](db['SalesforceField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa0')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['SalesforceField'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa0')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xa1')][_0x0a9e('0x110')](db[_0x0a9e('0xa2')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa2')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa2')][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['SugarcrmConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0xa1')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['SugarcrmField']['hasMany'](db['SugarcrmField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db['SugarcrmField'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1cc')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmField'][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1cf')]['hasMany'](db[_0x0a9e('0xa6')],{'as':'Configurations','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa6')]['hasMany'](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'DescriptionId'});db['DeskConfiguration']['hasMany'](db['DeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':'FieldId'});db[_0x0a9e('0xa6')][_0x0a9e('0x150')](db[_0x0a9e('0x1cf')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'int_desk_configuration_has_tags'});db['DeskField'][_0x0a9e('0x110')](db['DeskField'],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xa8')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['DeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':'Field','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa8')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xaa')][_0x0a9e('0x110')](db[_0x0a9e('0xac')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Subjects','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db['ZohoConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xac')][_0x0a9e('0x150')](db[_0x0a9e('0xaa')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xae')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xaf')][_0x0a9e('0x110')](db['ZendeskConfiguration'],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d0')]['hasMany'](db[_0x0a9e('0xb2')],{'as':'Descriptions','foreignKey':'DescriptionId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Fields','foreignKey':'FieldId'});db[_0x0a9e('0x1d0')][_0x0a9e('0x150')](db[_0x0a9e('0xaf')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0x1d0')]['belongsToMany'](db['Tag'],{'through':_0x0a9e('0x1d1')});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Subject','foreignKey':'SubjectId'});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['ZendeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb2')][_0x0a9e('0x150')](db['Variable'],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d2')][_0x0a9e('0x110')](db[_0x0a9e('0x1d3')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d3')]['hasMany'](db['FreshdeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['FreshdeskConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x1d2')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['FreshdeskConfiguration'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1d4')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db['FreshdeskField'],{'as':'Description','foreignKey':'DescriptionId'});db['FreshdeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb5')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d5')]['hasMany'](db[_0x0a9e('0xb8')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xb8')]['hasMany'](db[_0x0a9e('0xb9')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db['VtigerConfiguration'][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb8')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Fields','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb8')][_0x0a9e('0x150')](db[_0x0a9e('0x1d5')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db['VtigerField']['hasMany'](db[_0x0a9e('0xb9')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb9')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xba')]['hasMany'](db[_0x0a9e('0xbc')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbc')]['hasMany'](db['ServicenowField'],{'as':_0x0a9e('0x1c4'),'foreignKey':'SubjectId'});db[_0x0a9e('0xbc')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xbc')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c1'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbc')][_0x0a9e('0x150')](db[_0x0a9e('0xba')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['ServicenowField'][_0x0a9e('0x110')](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d6')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d6')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cb'),'foreignKey':'FieldId'});db[_0x0a9e('0x1d6')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xbe')]['hasMany'](db[_0x0a9e('0xbf')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbe')][_0x0a9e('0x150')](db['CloudProvider'],{'as':_0x0a9e('0x103'),'foreignKey':'CloudProviderId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['Dynamics365Configuration'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbf')][_0x0a9e('0x150')](db[_0x0a9e('0xbe')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['Dynamics365Field'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xc1')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['FreshsalesAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xc5')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db['FreshsalesField'],{'as':'Subjects','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cd'),'foreignKey':'DescriptionId'});db[_0x0a9e('0xc5')]['hasMany'](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1c1'),'foreignKey':'FieldId'});db[_0x0a9e('0xc5')]['belongsTo'](db[_0x0a9e('0xc3')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['FreshsalesField'][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['FreshsalesField']['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x60')],{});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':'ListId'});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{});db['ChatInternalMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':'FromId'});db['ChatInternalMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1d7')});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0x1d8')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0xcd')],{'foreignKey':'SessionId','onDelete':_0x0a9e('0x10e')});db['SmsQueueReport']['belongsTo'](db[_0x0a9e('0x50')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0xd2')]['belongsTo'](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xd2')]['belongsTo'](db['SmsMessage'],{});db['SmsQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0x1d8')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db['JscriptyAnswerReport'],{'foreignKey':'ProjectId'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_teams'});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0x1a')],{'through':'TeamVoiceQueue','as':_0x0a9e('0x131')});db['Team']['belongsToMany'](db[_0x0a9e('0x3c')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x1db')});db[_0x0a9e('0x129')]['belongsToMany'](db['ChatQueue'],{'through':_0x0a9e('0x19b'),'as':'ChatQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db['FaxQueue'],{'through':_0x0a9e('0x187'),'as':'FaxQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x136')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x137')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x1dc')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'through':_0x0a9e('0x1dd'),'as':_0x0a9e('0x138')});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0xf1')],{'through':_0x0a9e('0x107'),'as':_0x0a9e('0x132')});db['Campaign'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db['CmHopperHistory'],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')]['hasMany'](db[_0x0a9e('0x6f')],{'as':'HopperBlacks','foreignKey':'CampaignId'});db[_0x0a9e('0x1a5')]['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['Trunk'],{'as':_0x0a9e('0x151'),'foreignKey':'TrunkBackupId'});db['Campaign'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['SquareProject'],{'as':_0x0a9e('0xdc'),'foreignKey':_0x0a9e('0x1de')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':'Lists','through':_0x0a9e('0x1df')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x1e0')});db[_0x0a9e('0xe4')][_0x0a9e('0x150')](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':_0x0a9e('0x19a')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db['MailMessage'],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e2'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0x1e1')]['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'foreignKey':'ToMailQueueId','as':'ToQueue'});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e7'),'as':_0x0a9e('0x1e8')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['ChatInteraction'],{});db[_0x0a9e('0xe8')]['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1e9'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xe8')]['belongsTo'](db[_0x0a9e('0x67')],{'foreignKey':_0x0a9e('0x1eb'),'as':'ToQueue'});db['ChatTransferReport']['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1ec'),'as':_0x0a9e('0x1e8')});db['FaxTransferReport'][_0x0a9e('0x150')](db['FaxMessage'],{});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{});db['FaxTransferReport']['belongsTo'](db[_0x0a9e('0x45')],{'foreignKey':_0x0a9e('0x1ed'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xea')]['belongsTo'](db['FaxQueue'],{'foreignKey':_0x0a9e('0x1ee'),'as':_0x0a9e('0x1ef')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'foreignKey':'ToFaxAccountId','as':_0x0a9e('0x1e8')});db[_0x0a9e('0xec')]['belongsTo'](db[_0x0a9e('0x5e')],{});db['OpenchannelTransferReport']['belongsTo'](db['OpenchannelInteraction'],{});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['OpenchannelAccount'],{'foreignKey':'FromOpenchannelAccountId','as':_0x0a9e('0x1e3')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{'foreignKey':'ToOpenchannelQueueId','as':'ToQueue'});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'foreignKey':'ToOpenchannelAccountId','as':'ToAccount'});db['SmsTransferReport']['belongsTo'](db[_0x0a9e('0x55')],{});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':_0x0a9e('0x1f0'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xee')]['belongsTo'](db['SmsQueue'],{'foreignKey':'ToSmsQueueId','as':_0x0a9e('0x1ef')});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':'ToSmsAccountId','as':'ToAccount'});db['CmList']['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x1f1')],{'as':_0x0a9e('0x1f2'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db['CmContact'],{'as':_0x0a9e('0x125'),'onDelete':'cascade','foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':'HopperHistory','foreignKey':'ListId'});db['CmList'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':'ListId'});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x1a')],{'as':'Queues','through':_0x0a9e('0x1f3')});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x128')});db[_0x0a9e('0xf1')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf1')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserVoicePrefix'});db[_0x0a9e('0xf1')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':'TeamVoicePrefix','as':_0x0a9e('0x155')});db[_0x0a9e('0xf2')][_0x0a9e('0x110')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'foreignKey':_0x0a9e('0x1f4')});db['UserProfile'][_0x0a9e('0x110')](db['UserProfileSection'],{'as':_0x0a9e('0x1f5'),'foreignKey':_0x0a9e('0x1f4'),'onDelete':_0x0a9e('0x10e')});db['UserProfileSection']['hasMany'](db['UserProfileResource'],{'as':_0x0a9e('0x1f6'),'foreignKey':_0x0a9e('0x1f7'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x1f8')});db['WhatsappAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xfd')],{'as':_0x0a9e('0x158'),'foreignKey':'WhatsappAccountId'});db[_0x0a9e('0xf7')]['hasMany'](db[_0x0a9e('0xfb')],{'as':'Interactions'});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['WhatsappApplication'],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db['WhatsappAccount'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xf7')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0xf7')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x144')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x101')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db['WhatsappAccount'],{'onDelete':_0x0a9e('0x164')});db['WhatsappApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0xf9')]['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['WhatsappInteraction'][_0x0a9e('0x110')](db['WhatsappMessage'],{'as':'Messages','onDelete':'cascade','foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0xfb')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x174')});db['WhatsappInteraction'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x175')});db[_0x0a9e('0xfb')]['belongsToMany'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x130'),'foreignKey':'WhatsappInteractionId'});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':_0x0a9e('0x160')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db['WhatsappInteraction'],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfd')]['belongsTo'](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{});db['WhatsappQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['WhatsappInteraction'],{});db['WhatsappQueueReport']['belongsTo'](db[_0x0a9e('0x101')],{});db[_0x0a9e('0xfe')]['belongsTo'](db['WhatsappMessage'],{});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['User'],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfd')],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfb')],{});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappAccount'],{'foreignKey':_0x0a9e('0x1fb'),'as':_0x0a9e('0x1e3')});db['WhatsappTransferReport']['belongsTo'](db[_0x0a9e('0xf7')],{'foreignKey':_0x0a9e('0x1fc'),'as':'ToAccount'});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappQueue'],{'foreignKey':_0x0a9e('0x1fd'),'as':_0x0a9e('0x1ef')});db['WhatsappTransferReport']['belongsTo'](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':'FromAgent'});db[_0x0a9e('0x1fa')][_0x0a9e('0x150')](db['User'],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x37'),'foreignKey':'WhatsappQueueId'});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x1dd'),'as':'Teams'});db[_0x0a9e('0x1fe')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x1ff'),'foreignKey':_0x0a9e('0x10f'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x103')][_0x0a9e('0x10b')](db['Dynamics365Account'],{'as':_0x0a9e('0xbe'),'onDelete':_0x0a9e('0x164')});db['CloudProvider'][_0x0a9e('0x10b')](db['MailServerIn'],{'as':'Imap','onDelete':_0x0a9e('0x164')});db['CloudProvider']['hasOne'](db['MailServerOut'],{'as':'Smtp','onDelete':_0x0a9e('0x164')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index ba396e2..fc7ea32 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaead=['/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/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','./api/intZohoAccount','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','/api/integrations/zendesk/configurations','./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/intVtigerConfiguration','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','/api/integrations/dynamics365/accounts','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','./api/intDynamics365Field','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','./api/network','/api/chat/reports/queue','/api/chat/internal/messages','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','./api/jscriptySessionReport','/api/sms/reports/queue','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','/api/settings','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','./api/squareRecording','/api/square/messages','./api/squareMessage','./api/team','/api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','./api/chatTransferReport','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','./api/smsTransferReport','/api/cm/lists','/api/voice/prefixes','/api/userProfiles','./api/userProfile','/api/userProfile/resources','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappInteraction','/api/whatsapp/messages','/api/whatsapp/reports/queue','/api/whatsapp/queues','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/user-settings','./api/user-setting','/api/auth/local','./api/authLocal','/api/auth/google','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','/api/system','./api/system','/api/pm2','./api/pm2','./api/webbar','/api/logs','join','/apidoc','/www','/demo','static','root','/snippet','snippet','3.1.0','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','express','./errors','./config/environment','./utils/client-side-logger','setupLoggers','./api/client-side-logs','then','use','/api/users','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','./api/smsMessage','./api/smsQueue','./api/openchannelAccount','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','./api/openchannelMessage','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/cmCompany','/api/cm/hopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_history','./api/cmHopperHistory','./api/cmCustomField','/api/actions','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','/api/intervals','/api/pauses','./api/pause','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','/api/contact_item_types','./api/contactItemType','/api/cm_contact_has_items','./api/cmContactHasItem','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables'];(function(_0x3e25c1,_0x1d15f9){var _0x52e7f2=function(_0x597a5a){while(--_0x597a5a){_0x3e25c1['push'](_0x3e25c1['shift']());}};_0x52e7f2(++_0x1d15f9);}(_0xaead,0x19e));var _0xdaea=function(_0x11069a,_0x39dcd3){_0x11069a=_0x11069a-0x0;var _0x42fcf9=_0xaead[_0x11069a];return _0x42fcf9;};'use strict';var path=require('path');var express=require(_0xdaea('0x0'));var errors=require(_0xdaea('0x1'));var config=require(_0xdaea('0x2'));var setupLoggers=require(_0xdaea('0x3'))[_0xdaea('0x4')];var clientSideLogs=require(_0xdaea('0x5'));exports['default']=function(_0xeaaf95){return setupLoggers(_0xeaaf95)[_0xdaea('0x6')](function(){_0xeaaf95[_0xdaea('0x7')](_0xdaea('0x8'),require('./api/user'));_0xeaaf95[_0xdaea('0x7')]('/api/voice/chanspy',require(_0xdaea('0x9')));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0xa'),require(_0xdaea('0xb')));_0xeaaf95['use']('/api/voice/extensions',require(_0xdaea('0xc')));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0xd'),require(_0xdaea('0xe')));_0xeaaf95['use'](_0xdaea('0xf'),require(_0xdaea('0x10')));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0x11'),require('./api/voiceRecording'));_0xeaaf95['use'](_0xdaea('0x12'),require(_0xdaea('0x13')));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0x14'),require(_0xdaea('0x15')));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0x16'),require('./api/voiceMailMessage'));_0xeaaf95[_0xdaea('0x7')]('/api/voice/calls/reports',require(_0xdaea('0x17')));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0x18'),require(_0xdaea('0x19')));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0x1a'),require(_0xdaea('0x1b')));_0xeaaf95['use']('/api/voice/queues/reports',require(_0xdaea('0x1c')));_0xeaaf95['use'](_0xdaea('0x1d'),require(_0xdaea('0x1e')));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0x1f'),require(_0xdaea('0x20')));_0xeaaf95[_0xdaea('0x7')]('/api/voice/transfers/reports',require('./api/voiceTransferReport'));_0xeaaf95[_0xdaea('0x7')]('/api/mail/out_servers',require(_0xdaea('0x21')));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0x22'),require(_0xdaea('0x23')));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0x24'),require(_0xdaea('0x25')));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0x26'),require(_0xdaea('0x27')));_0xeaaf95[_0xdaea('0x7')]('/api/mail/interactions',require('./api/mailInteraction'));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0x28'),require(_0xdaea('0x29')));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0x2a'),require(_0xdaea('0x2b')));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0x2c'),require(_0xdaea('0x2d')));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0x2e'),require(_0xdaea('0x2f')));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0x30'),require(_0xdaea('0x31')));_0xeaaf95['use'](_0xdaea('0x32'),require(_0xdaea('0x33')));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0x34'),require(_0xdaea('0x35')));_0xeaaf95[_0xdaea('0x7')]('/api/fax/interactions',require('./api/faxInteraction'));_0xeaaf95[_0xdaea('0x7')]('/api/fax/messages',require(_0xdaea('0x36')));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0x37'),require(_0xdaea('0x38')));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0x39'),require(_0xdaea('0x3a')));_0xeaaf95[_0xdaea('0x7')]('/api/sms/accounts',require(_0xdaea('0x3b')));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0x3c'),require(_0xdaea('0x3d')));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0x3e'),require(_0xdaea('0x3f')));_0xeaaf95[_0xdaea('0x7')]('/api/sms/messages',require(_0xdaea('0x40')));_0xeaaf95[_0xdaea('0x7')]('/api/sms/queues',require(_0xdaea('0x41')));_0xeaaf95[_0xdaea('0x7')]('/api/openchannel/accounts',require(_0xdaea('0x42')));_0xeaaf95[_0xdaea('0x7')]('/api/openchannel/applications',require(_0xdaea('0x43')));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0x44'),require(_0xdaea('0x45')));_0xeaaf95[_0xdaea('0x7')]('/api/openchannel/messages',require(_0xdaea('0x46')));_0xeaaf95['use']('/api/openchannel/queues',require(_0xdaea('0x47')));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0x48'),require(_0xdaea('0x49')));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0x4a'),require(_0xdaea('0x4b')));_0xeaaf95['use'](_0xdaea('0x4c'),require('./api/chatApplication'));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0x4d'),require(_0xdaea('0x4e')));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0x4f'),require(_0xdaea('0x50')));_0xeaaf95['use'](_0xdaea('0x51'),require(_0xdaea('0x52')));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0x53'),require(_0xdaea('0x54')));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0x55'),require(_0xdaea('0x56')));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0x57'),require('./api/chatProactiveAction'));_0xeaaf95[_0xdaea('0x7')]('/api/cm/companies',require(_0xdaea('0x58')));_0xeaaf95[_0xdaea('0x7')]('/api/cm/contacts',require('./api/cmContact'));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0x59'),require('./api/cmHopper'));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0x5a'),require(_0xdaea('0x5b')));_0xeaaf95[_0xdaea('0x7')]('/api/cm/hopper_final',require('./api/cmHopperFinal'));_0xeaaf95['use'](_0xdaea('0x5c'),require(_0xdaea('0x5d')));_0xeaaf95[_0xdaea('0x7')]('/api/cm/custom_fields',require(_0xdaea('0x5e')));_0xeaaf95['use'](_0xdaea('0x5f'),require('./api/action'));_0xeaaf95['use'](_0xdaea('0x60'),require(_0xdaea('0x61')));_0xeaaf95['use'](_0xdaea('0x62'),require(_0xdaea('0x63')));_0xeaaf95['use'](_0xdaea('0x64'),require(_0xdaea('0x65')));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0x66'),require('./api/condition'));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0x67'),require('./api/interval'));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0x68'),require(_0xdaea('0x69')));_0xeaaf95['use']('/api/cdr',require(_0xdaea('0x6a')));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0x6b'),require(_0xdaea('0x6c')));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0x6d'),require(_0xdaea('0x6e')));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0x6f'),require(_0xdaea('0x70')));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0x71'),require(_0xdaea('0x72')));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0x73'),require(_0xdaea('0x74')));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0x75'),require(_0xdaea('0x76')));_0xeaaf95['use']('/api/cm_hopper_additional_phones',require('./api/cmHopperAdditionalPhone'));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0x77'),require(_0xdaea('0x78')));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0x79'),require(_0xdaea('0x7a')));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0x7b'),require('./api/variable'));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0x7c'),require(_0xdaea('0x7d')));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0x7e'),require(_0xdaea('0x7f')));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0x80'),require(_0xdaea('0x81')));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0x82'),require('./api/analyticDefaultReport'));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0x83'),require(_0xdaea('0x84')));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0x85'),require(_0xdaea('0x86')));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0x87'),require(_0xdaea('0x88')));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0x89'),require(_0xdaea('0x8a')));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0x8b'),require(_0xdaea('0x8c')));_0xeaaf95[_0xdaea('0x7')]('/api/integrations/salesforce/configurations',require(_0xdaea('0x8d')));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0x8e'),require(_0xdaea('0x8f')));_0xeaaf95[_0xdaea('0x7')]('/api/integrations/sugarcrm/accounts',require(_0xdaea('0x90')));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0x91'),require(_0xdaea('0x92')));_0xeaaf95[_0xdaea('0x7')]('/api/integrations/sugarcrm/fields',require(_0xdaea('0x93')));_0xeaaf95['use'](_0xdaea('0x94'),require(_0xdaea('0x95')));_0xeaaf95['use'](_0xdaea('0x96'),require(_0xdaea('0x97')));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0x98'),require(_0xdaea('0x99')));_0xeaaf95[_0xdaea('0x7')]('/api/integrations/zoho/accounts',require(_0xdaea('0x9a')));_0xeaaf95['use']('/api/integrations/zoho/configurations',require(_0xdaea('0x9b')));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0x9c'),require(_0xdaea('0x9d')));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0x9e'),require('./api/intZendeskAccount'));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0x9f'),require(_0xdaea('0xa0')));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0xa1'),require(_0xdaea('0xa2')));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0xa3'),require(_0xdaea('0xa4')));_0xeaaf95['use']('/api/integrations/freshdesk/configurations',require(_0xdaea('0xa5')));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0xa6'),require('./api/intFreshdeskField'));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0xa7'),require(_0xdaea('0xa8')));_0xeaaf95[_0xdaea('0x7')]('/api/integrations/vtiger/configurations',require(_0xdaea('0xa9')));_0xeaaf95[_0xdaea('0x7')]('/api/integrations/vtiger/fields',require(_0xdaea('0xaa')));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0xab'),require(_0xdaea('0xac')));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0xad'),require(_0xdaea('0xae')));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0xaf'),require('./api/intServicenowField'));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0xb0'),require('./api/intDynamics365Account'));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0xb1'),require(_0xdaea('0xb2')));_0xeaaf95[_0xdaea('0x7')]('/api/integrations/dynamics365/fields',require(_0xdaea('0xb3')));_0xeaaf95[_0xdaea('0x7')]('/api/integrations/freshsales/accounts',require('./api/intFreshsalesAccount'));_0xeaaf95['use']('/api/integrations/freshsales/configurations',require(_0xdaea('0xb4')));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0xb5'),require(_0xdaea('0xb6')));_0xeaaf95[_0xdaea('0x7')]('/api/networks',require(_0xdaea('0xb7')));_0xeaaf95['use'](_0xdaea('0xb8'),require('./api/chatQueueReport'));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0xb9'),require('./api/chatInternalMessage'));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0xba'),require(_0xdaea('0xbb')));_0xeaaf95['use']('/api/jscripty/questions/reports',require('./api/jscriptyQuestionReport'));_0xeaaf95['use']('/api/jscripty/sessions/reports',require(_0xdaea('0xbc')));_0xeaaf95['use'](_0xdaea('0xbd'),require('./api/smsQueueReport'));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0xbe'),require(_0xdaea('0xbf')));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0xc0'),require(_0xdaea('0xc1')));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0xc2'),require('./api/jscriptyProject'));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0xc3'),require('./api/setting'));_0xeaaf95['use'](_0xdaea('0xc4'),require(_0xdaea('0xc5')));_0xeaaf95['use'](_0xdaea('0xc6'),require(_0xdaea('0xc7')));_0xeaaf95[_0xdaea('0x7')]('/api/square/recordings',require(_0xdaea('0xc8')));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0xc9'),require(_0xdaea('0xca')));_0xeaaf95[_0xdaea('0x7')]('/api/teams',require(_0xdaea('0xcb')));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0xcc'),require('./api/license'));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0xcd'),require(_0xdaea('0xce')));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0xcf'),require(_0xdaea('0xd0')));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0xd1'),require(_0xdaea('0xd2')));_0xeaaf95[_0xdaea('0x7')]('/api/plugins',require(_0xdaea('0xd3')));_0xeaaf95['use'](_0xdaea('0xd4'),require(_0xdaea('0xd5')));_0xeaaf95['use']('/api/chat/reports/transfer',require(_0xdaea('0xd6')));_0xeaaf95[_0xdaea('0x7')]('/api/fax/reports/transfer',require(_0xdaea('0xd7')));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0xd8'),require(_0xdaea('0xd9')));_0xeaaf95[_0xdaea('0x7')]('/api/sms/reports/transfer',require(_0xdaea('0xda')));_0xeaaf95['use'](_0xdaea('0xdb'),require('./api/cmList'));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0xdc'),require('./api/voicePrefix'));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0xdd'),require(_0xdaea('0xde')));_0xeaaf95[_0xdaea('0x7')]('/api/userProfile/sections',require('./api/userProfileSection'));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0xdf'),require('./api/userProfileResource'));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0xe0'),require(_0xdaea('0xe1')));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0xe2'),require(_0xdaea('0xe3')));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0xe4'),require('./api/whatsappApplication'));_0xeaaf95[_0xdaea('0x7')]('/api/whatsapp/interactions',require(_0xdaea('0xe5')));_0xeaaf95['use'](_0xdaea('0xe6'),require('./api/whatsappMessage'));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0xe7'),require('./api/whatsappQueueReport'));_0xeaaf95['use']('/api/whatsapp/reports/transfer',require('./api/whatsappTransferReport'));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0xe8'),require('./api/whatsappQueue'));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0xe9'),require(_0xdaea('0xea')));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0xeb'),require(_0xdaea('0xec')));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0xed'),require(_0xdaea('0xee')));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0xef'),require(_0xdaea('0xf0')));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0xf1'),require('./api/authGoogle'));_0xeaaf95[_0xdaea('0x7')]('/api/auth/activedirectory',require('./api/authActiveDirectory'));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0xf2'),require(_0xdaea('0xf3')));_0xeaaf95['use'](_0xdaea('0xf4'),require(_0xdaea('0xf5')));_0xeaaf95['use'](_0xdaea('0xf6'),require('./api/version'));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0xf7'),require(_0xdaea('0xf8')));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0xf9'),require(_0xdaea('0xfa')));_0xeaaf95['use']('/api/webbar',require(_0xdaea('0xfb')));_0xeaaf95['use'](_0xdaea('0xfc'),clientSideLogs);_0xeaaf95[_0xdaea('0x7')]('/apidoc',express['static'](path[_0xdaea('0xfd')](config['root'],_0xdaea('0xfe'))));_0xeaaf95['use'](_0xdaea('0xff'),express['static'](path[_0xdaea('0xfd')](config['root'],_0xdaea('0xff'))));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0x100'),express[_0xdaea('0x101')](path[_0xdaea('0xfd')](config[_0xdaea('0x102')],'/demo')));_0xeaaf95[_0xdaea('0x7')](_0xdaea('0x103'),express['static'](path[_0xdaea('0xfd')](config[_0xdaea('0x102')],_0xdaea('0x104'),_0xdaea('0x105'))));_0xeaaf95[_0xdaea('0x7')]('/plugins',express[_0xdaea('0x101')](path[_0xdaea('0xfd')](config['root'],_0xdaea('0x106'))));_0xeaaf95[_0xdaea('0x107')](_0xdaea('0x108'))[_0xdaea('0x109')](errors[0x194]);_0xeaaf95[_0xdaea('0x107')]('/*')[_0xdaea('0x109')](function(_0x323eb3,_0x2264ec){_0x2264ec[_0xdaea('0x10a')](path[_0xdaea('0x10b')](_0xeaaf95[_0xdaea('0x109')](_0xdaea('0x10c'))+'/index.html'));});return _0xeaaf95;});}; \ No newline at end of file +var _0x83f8=['/api/fax/reports/queue','./api/faxQueueReport','/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/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatGroup','/api/chat/proactive_actions','/api/cm/companies','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','/api/cm/hopper_history','/api/cm/custom_fields','./api/cmCustomField','/api/actions','/api/automations','./api/automation','/api/dispositions','./api/disposition','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','/api/schedules','/api/sounds','./api/sound','/api/tags','./api/tag','/api/contact_item_types','./api/contactItemType','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','/api/integrations','./api/integration','/api/integrations/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/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','./api/intFreshdeskConfiguration','./api/intFreshdeskField','/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/integrations/servicenow/fields','./api/intServicenowField','./api/intDynamics365Account','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','./api/network','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','/api/square/odbc','./api/squareOdbc','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','/api/license','./api/license','./api/campaign','/api/migrations','./api/migration','/api/attachments','/api/plugins','/api/mail/reports/transfer','/api/chat/reports/transfer','/api/fax/reports/transfer','./api/faxTransferReport','/api/sms/reports/transfer','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/user-settings','/api/auth/local','./api/authLocal','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','./api/jira','./api/rpc','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/api/logs','/apidoc','static','root','/www','join','/demo','/snippet','3.1.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','/index.html','express','./errors','./config/environment','./utils/client-side-logger','setupLoggers','default','then','use','/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/voice/queues','./api/voiceQueue','/api/voice/recordings','/api/screen/recordings','./api/screenRecording','/api/voice/mails/messages','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','./api/voiceTransferReport','/api/mail/accounts','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','/api/mail/interactions','/api/mail/messages','./api/mailMessage','/api/mail/applications','/api/mail/reports/queue','./api/mailQueueReport','./api/dashboard','/api/dashboards/items','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxMessage','/api/fax/queues','./api/faxQueue'];(function(_0x41b1ef,_0x11fd8f){var _0x1fb083=function(_0x125297){while(--_0x125297){_0x41b1ef['push'](_0x41b1ef['shift']());}};_0x1fb083(++_0x11fd8f);}(_0x83f8,0xdf));var _0x883f=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x83f8[_0x2641f9];return _0x585741;};'use strict';var path=require('path');var express=require(_0x883f('0x0'));var errors=require(_0x883f('0x1'));var config=require(_0x883f('0x2'));var setupLoggers=require(_0x883f('0x3'))[_0x883f('0x4')];var clientSideLogs=require('./api/client-side-logs');exports[_0x883f('0x5')]=function(_0x2dd390){return setupLoggers(_0x2dd390)[_0x883f('0x6')](function(){_0x2dd390[_0x883f('0x7')](_0x883f('0x8'),require(_0x883f('0x9')));_0x2dd390[_0x883f('0x7')](_0x883f('0xa'),require(_0x883f('0xb')));_0x2dd390['use'](_0x883f('0xc'),require(_0x883f('0xd')));_0x2dd390[_0x883f('0x7')](_0x883f('0xe'),require(_0x883f('0xf')));_0x2dd390[_0x883f('0x7')](_0x883f('0x10'),require(_0x883f('0x11')));_0x2dd390[_0x883f('0x7')](_0x883f('0x12'),require(_0x883f('0x13')));_0x2dd390[_0x883f('0x7')](_0x883f('0x14'),require('./api/voiceRecording'));_0x2dd390['use'](_0x883f('0x15'),require(_0x883f('0x16')));_0x2dd390[_0x883f('0x7')]('/api/voice/mails',require('./api/voiceMail'));_0x2dd390['use'](_0x883f('0x17'),require('./api/voiceMailMessage'));_0x2dd390[_0x883f('0x7')]('/api/voice/calls/reports',require(_0x883f('0x18')));_0x2dd390[_0x883f('0x7')](_0x883f('0x19'),require(_0x883f('0x1a')));_0x2dd390[_0x883f('0x7')]('/api/voice/agents/reports',require(_0x883f('0x1b')));_0x2dd390[_0x883f('0x7')](_0x883f('0x1c'),require(_0x883f('0x1d')));_0x2dd390['use'](_0x883f('0x1e'),require(_0x883f('0x1f')));_0x2dd390[_0x883f('0x7')](_0x883f('0x20'),require(_0x883f('0x21')));_0x2dd390[_0x883f('0x7')]('/api/voice/transfers/reports',require(_0x883f('0x22')));_0x2dd390['use']('/api/mail/out_servers',require('./api/mailServerOut'));_0x2dd390[_0x883f('0x7')](_0x883f('0x23'),require('./api/mailAccount'));_0x2dd390[_0x883f('0x7')](_0x883f('0x24'),require(_0x883f('0x25')));_0x2dd390[_0x883f('0x7')](_0x883f('0x26'),require('./api/mailSubstatus'));_0x2dd390[_0x883f('0x7')](_0x883f('0x27'),require('./api/mailInteraction'));_0x2dd390['use'](_0x883f('0x28'),require(_0x883f('0x29')));_0x2dd390['use'](_0x883f('0x2a'),require('./api/mailApplication'));_0x2dd390[_0x883f('0x7')](_0x883f('0x2b'),require(_0x883f('0x2c')));_0x2dd390[_0x883f('0x7')]('/api/dashboards',require(_0x883f('0x2d')));_0x2dd390[_0x883f('0x7')](_0x883f('0x2e'),require('./api/dashboardItem'));_0x2dd390[_0x883f('0x7')](_0x883f('0x2f'),require(_0x883f('0x30')));_0x2dd390[_0x883f('0x7')](_0x883f('0x31'),require(_0x883f('0x32')));_0x2dd390['use'](_0x883f('0x33'),require('./api/faxInteraction'));_0x2dd390[_0x883f('0x7')]('/api/fax/messages',require(_0x883f('0x34')));_0x2dd390[_0x883f('0x7')](_0x883f('0x35'),require(_0x883f('0x36')));_0x2dd390['use'](_0x883f('0x37'),require(_0x883f('0x38')));_0x2dd390[_0x883f('0x7')](_0x883f('0x39'),require(_0x883f('0x3a')));_0x2dd390[_0x883f('0x7')](_0x883f('0x3b'),require(_0x883f('0x3c')));_0x2dd390[_0x883f('0x7')](_0x883f('0x3d'),require('./api/smsInteraction'));_0x2dd390[_0x883f('0x7')](_0x883f('0x3e'),require('./api/smsMessage'));_0x2dd390[_0x883f('0x7')](_0x883f('0x3f'),require('./api/smsQueue'));_0x2dd390['use'](_0x883f('0x40'),require(_0x883f('0x41')));_0x2dd390[_0x883f('0x7')](_0x883f('0x42'),require(_0x883f('0x43')));_0x2dd390[_0x883f('0x7')](_0x883f('0x44'),require(_0x883f('0x45')));_0x2dd390['use'](_0x883f('0x46'),require(_0x883f('0x47')));_0x2dd390['use'](_0x883f('0x48'),require('./api/openchannelQueue'));_0x2dd390[_0x883f('0x7')]('/api/chat/websites',require(_0x883f('0x49')));_0x2dd390[_0x883f('0x7')](_0x883f('0x4a'),require(_0x883f('0x4b')));_0x2dd390[_0x883f('0x7')](_0x883f('0x4c'),require(_0x883f('0x4d')));_0x2dd390[_0x883f('0x7')](_0x883f('0x4e'),require(_0x883f('0x4f')));_0x2dd390[_0x883f('0x7')](_0x883f('0x50'),require(_0x883f('0x51')));_0x2dd390[_0x883f('0x7')](_0x883f('0x52'),require(_0x883f('0x53')));_0x2dd390['use'](_0x883f('0x54'),require('./api/chatQueue'));_0x2dd390[_0x883f('0x7')]('/api/chat/groups',require(_0x883f('0x55')));_0x2dd390['use'](_0x883f('0x56'),require('./api/chatProactiveAction'));_0x2dd390[_0x883f('0x7')](_0x883f('0x57'),require('./api/cmCompany'));_0x2dd390[_0x883f('0x7')](_0x883f('0x58'),require(_0x883f('0x59')));_0x2dd390[_0x883f('0x7')](_0x883f('0x5a'),require(_0x883f('0x5b')));_0x2dd390['use'](_0x883f('0x5c'),require(_0x883f('0x5d')));_0x2dd390[_0x883f('0x7')](_0x883f('0x5e'),require('./api/cmHopperFinal'));_0x2dd390['use'](_0x883f('0x5f'),require('./api/cmHopperHistory'));_0x2dd390[_0x883f('0x7')](_0x883f('0x60'),require(_0x883f('0x61')));_0x2dd390['use'](_0x883f('0x62'),require('./api/action'));_0x2dd390[_0x883f('0x7')](_0x883f('0x63'),require(_0x883f('0x64')));_0x2dd390['use']('/api/canned_answers',require('./api/cannedAnswer'));_0x2dd390[_0x883f('0x7')](_0x883f('0x65'),require(_0x883f('0x66')));_0x2dd390[_0x883f('0x7')]('/api/conditions',require(_0x883f('0x67')));_0x2dd390[_0x883f('0x7')](_0x883f('0x68'),require(_0x883f('0x69')));_0x2dd390['use'](_0x883f('0x6a'),require(_0x883f('0x6b')));_0x2dd390[_0x883f('0x7')](_0x883f('0x6c'),require(_0x883f('0x6d')));_0x2dd390['use'](_0x883f('0x6e'),require('./api/voiceQueuesLog'));_0x2dd390['use'](_0x883f('0x6f'),require('./api/schedule'));_0x2dd390[_0x883f('0x7')](_0x883f('0x70'),require(_0x883f('0x71')));_0x2dd390['use'](_0x883f('0x72'),require(_0x883f('0x73')));_0x2dd390[_0x883f('0x7')](_0x883f('0x74'),require(_0x883f('0x75')));_0x2dd390[_0x883f('0x7')]('/api/cm_contact_has_items',require(_0x883f('0x76')));_0x2dd390[_0x883f('0x7')](_0x883f('0x77'),require(_0x883f('0x78')));_0x2dd390[_0x883f('0x7')](_0x883f('0x79'),require(_0x883f('0x7a')));_0x2dd390[_0x883f('0x7')](_0x883f('0x7b'),require(_0x883f('0x7c')));_0x2dd390[_0x883f('0x7')](_0x883f('0x7d'),require('./api/variable'));_0x2dd390[_0x883f('0x7')](_0x883f('0x7e'),require(_0x883f('0x7f')));_0x2dd390[_0x883f('0x7')](_0x883f('0x80'),require('./api/integrationReport'));_0x2dd390[_0x883f('0x7')]('/api/analytics/custom_reports',require(_0x883f('0x81')));_0x2dd390[_0x883f('0x7')](_0x883f('0x82'),require(_0x883f('0x83')));_0x2dd390[_0x883f('0x7')](_0x883f('0x84'),require(_0x883f('0x85')));_0x2dd390[_0x883f('0x7')](_0x883f('0x86'),require(_0x883f('0x87')));_0x2dd390[_0x883f('0x7')](_0x883f('0x88'),require(_0x883f('0x89')));_0x2dd390[_0x883f('0x7')](_0x883f('0x8a'),require(_0x883f('0x8b')));_0x2dd390[_0x883f('0x7')](_0x883f('0x8c'),require(_0x883f('0x8d')));_0x2dd390[_0x883f('0x7')](_0x883f('0x8e'),require(_0x883f('0x8f')));_0x2dd390[_0x883f('0x7')](_0x883f('0x90'),require(_0x883f('0x91')));_0x2dd390[_0x883f('0x7')](_0x883f('0x92'),require(_0x883f('0x93')));_0x2dd390['use'](_0x883f('0x94'),require(_0x883f('0x95')));_0x2dd390['use'](_0x883f('0x96'),require(_0x883f('0x97')));_0x2dd390[_0x883f('0x7')]('/api/integrations/desk/accounts',require('./api/intDeskAccount'));_0x2dd390['use']('/api/integrations/desk/configurations',require(_0x883f('0x98')));_0x2dd390[_0x883f('0x7')](_0x883f('0x99'),require(_0x883f('0x9a')));_0x2dd390[_0x883f('0x7')](_0x883f('0x9b'),require(_0x883f('0x9c')));_0x2dd390[_0x883f('0x7')](_0x883f('0x9d'),require(_0x883f('0x9e')));_0x2dd390[_0x883f('0x7')](_0x883f('0x9f'),require(_0x883f('0xa0')));_0x2dd390['use']('/api/integrations/zendesk/accounts',require(_0x883f('0xa1')));_0x2dd390[_0x883f('0x7')](_0x883f('0xa2'),require('./api/intZendeskConfiguration'));_0x2dd390['use']('/api/integrations/zendesk/fields',require(_0x883f('0xa3')));_0x2dd390[_0x883f('0x7')](_0x883f('0xa4'),require(_0x883f('0xa5')));_0x2dd390[_0x883f('0x7')]('/api/integrations/freshdesk/configurations',require(_0x883f('0xa6')));_0x2dd390[_0x883f('0x7')]('/api/integrations/freshdesk/fields',require(_0x883f('0xa7')));_0x2dd390[_0x883f('0x7')](_0x883f('0xa8'),require(_0x883f('0xa9')));_0x2dd390[_0x883f('0x7')](_0x883f('0xaa'),require(_0x883f('0xab')));_0x2dd390[_0x883f('0x7')](_0x883f('0xac'),require(_0x883f('0xad')));_0x2dd390[_0x883f('0x7')](_0x883f('0xae'),require(_0x883f('0xaf')));_0x2dd390[_0x883f('0x7')](_0x883f('0xb0'),require('./api/intServicenowConfiguration'));_0x2dd390[_0x883f('0x7')](_0x883f('0xb1'),require(_0x883f('0xb2')));_0x2dd390[_0x883f('0x7')]('/api/integrations/dynamics365/accounts',require(_0x883f('0xb3')));_0x2dd390[_0x883f('0x7')]('/api/integrations/dynamics365/configurations',require(_0x883f('0xb4')));_0x2dd390[_0x883f('0x7')](_0x883f('0xb5'),require(_0x883f('0xb6')));_0x2dd390[_0x883f('0x7')]('/api/integrations/freshsales/accounts',require('./api/intFreshsalesAccount'));_0x2dd390[_0x883f('0x7')](_0x883f('0xb7'),require(_0x883f('0xb8')));_0x2dd390['use'](_0x883f('0xb9'),require(_0x883f('0xba')));_0x2dd390[_0x883f('0x7')]('/api/networks',require(_0x883f('0xbb')));_0x2dd390['use']('/api/chat/reports/queue',require(_0x883f('0xbc')));_0x2dd390[_0x883f('0x7')](_0x883f('0xbd'),require(_0x883f('0xbe')));_0x2dd390['use'](_0x883f('0xbf'),require(_0x883f('0xc0')));_0x2dd390['use']('/api/jscripty/questions/reports',require(_0x883f('0xc1')));_0x2dd390[_0x883f('0x7')](_0x883f('0xc2'),require(_0x883f('0xc3')));_0x2dd390[_0x883f('0x7')](_0x883f('0xc4'),require(_0x883f('0xc5')));_0x2dd390['use'](_0x883f('0xc6'),require('./api/squareReport'));_0x2dd390[_0x883f('0x7')](_0x883f('0xc7'),require(_0x883f('0xc8')));_0x2dd390[_0x883f('0x7')](_0x883f('0xc9'),require(_0x883f('0xca')));_0x2dd390[_0x883f('0x7')](_0x883f('0xcb'),require('./api/setting'));_0x2dd390[_0x883f('0x7')](_0x883f('0xcc'),require(_0x883f('0xcd')));_0x2dd390[_0x883f('0x7')]('/api/square/projects',require('./api/squareProject'));_0x2dd390[_0x883f('0x7')](_0x883f('0xce'),require(_0x883f('0xcf')));_0x2dd390['use'](_0x883f('0xd0'),require(_0x883f('0xd1')));_0x2dd390[_0x883f('0x7')](_0x883f('0xd2'),require('./api/team'));_0x2dd390[_0x883f('0x7')](_0x883f('0xd3'),require(_0x883f('0xd4')));_0x2dd390[_0x883f('0x7')]('/api/campaigns',require(_0x883f('0xd5')));_0x2dd390[_0x883f('0x7')](_0x883f('0xd6'),require(_0x883f('0xd7')));_0x2dd390[_0x883f('0x7')](_0x883f('0xd8'),require('./api/attachment'));_0x2dd390[_0x883f('0x7')](_0x883f('0xd9'),require('./api/plugin'));_0x2dd390[_0x883f('0x7')](_0x883f('0xda'),require('./api/mailTransferReport'));_0x2dd390[_0x883f('0x7')](_0x883f('0xdb'),require('./api/chatTransferReport'));_0x2dd390[_0x883f('0x7')](_0x883f('0xdc'),require(_0x883f('0xdd')));_0x2dd390[_0x883f('0x7')]('/api/openchannel/reports/transfer',require('./api/openchannelTransferReport'));_0x2dd390[_0x883f('0x7')](_0x883f('0xde'),require('./api/smsTransferReport'));_0x2dd390[_0x883f('0x7')](_0x883f('0xdf'),require(_0x883f('0xe0')));_0x2dd390[_0x883f('0x7')](_0x883f('0xe1'),require(_0x883f('0xe2')));_0x2dd390['use'](_0x883f('0xe3'),require(_0x883f('0xe4')));_0x2dd390[_0x883f('0x7')]('/api/userProfile/sections',require(_0x883f('0xe5')));_0x2dd390['use'](_0x883f('0xe6'),require(_0x883f('0xe7')));_0x2dd390[_0x883f('0x7')](_0x883f('0xe8'),require('./api/userNotification'));_0x2dd390[_0x883f('0x7')](_0x883f('0xe9'),require(_0x883f('0xea')));_0x2dd390[_0x883f('0x7')]('/api/whatsapp/applications',require('./api/whatsappApplication'));_0x2dd390[_0x883f('0x7')](_0x883f('0xeb'),require(_0x883f('0xec')));_0x2dd390[_0x883f('0x7')](_0x883f('0xed'),require('./api/whatsappMessage'));_0x2dd390['use'](_0x883f('0xee'),require(_0x883f('0xef')));_0x2dd390[_0x883f('0x7')](_0x883f('0xf0'),require(_0x883f('0xf1')));_0x2dd390[_0x883f('0x7')](_0x883f('0xf2'),require(_0x883f('0xf3')));_0x2dd390[_0x883f('0x7')](_0x883f('0xf4'),require(_0x883f('0xf5')));_0x2dd390[_0x883f('0x7')]('/api/realtime',require('./api/realtime'));_0x2dd390[_0x883f('0x7')](_0x883f('0xf6'),require('./api/user-setting'));_0x2dd390[_0x883f('0x7')](_0x883f('0xf7'),require(_0x883f('0xf8')));_0x2dd390[_0x883f('0x7')]('/api/auth/google',require(_0x883f('0xf9')));_0x2dd390[_0x883f('0x7')](_0x883f('0xfa'),require(_0x883f('0xfb')));_0x2dd390[_0x883f('0x7')]('/api/jira',require(_0x883f('0xfc')));_0x2dd390[_0x883f('0x7')]('/api/rpc',require(_0x883f('0xfd')));_0x2dd390[_0x883f('0x7')]('/api/version',require(_0x883f('0xfe')));_0x2dd390[_0x883f('0x7')](_0x883f('0xff'),require(_0x883f('0x100')));_0x2dd390[_0x883f('0x7')](_0x883f('0x101'),require(_0x883f('0x102')));_0x2dd390[_0x883f('0x7')](_0x883f('0x103'),require(_0x883f('0x104')));_0x2dd390['use'](_0x883f('0x105'),clientSideLogs);_0x2dd390['use'](_0x883f('0x106'),express[_0x883f('0x107')](path['join'](config[_0x883f('0x108')],'/apidoc')));_0x2dd390['use'](_0x883f('0x109'),express[_0x883f('0x107')](path['join'](config[_0x883f('0x108')],_0x883f('0x109'))));_0x2dd390[_0x883f('0x7')]('/demo',express[_0x883f('0x107')](path[_0x883f('0x10a')](config[_0x883f('0x108')],_0x883f('0x10b'))));_0x2dd390[_0x883f('0x7')](_0x883f('0x10c'),express[_0x883f('0x107')](path[_0x883f('0x10a')](config['root'],'snippet',_0x883f('0x10d'))));_0x2dd390[_0x883f('0x7')](_0x883f('0x10e'),express[_0x883f('0x107')](path[_0x883f('0x10a')](config['root'],_0x883f('0x10f'))));_0x2dd390[_0x883f('0x110')](_0x883f('0x111'))[_0x883f('0x112')](errors[0x194]);_0x2dd390['route']('/*')[_0x883f('0x112')](function(_0x2d9ef2,_0x31bf61){_0x31bf61[_0x883f('0x113')](path[_0x883f('0x114')](_0x2dd390['get']('appPath')+_0x883f('0x115')));});return _0x2dd390;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 6807509..d894996 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x28e1=['../api/voiceDialReport/voiceDialReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/variable/variable.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueue/whatsappQueue.rpc','port','rpc','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x28e1,0x85));var _0x128e=function(_0x548949,_0x1b5ed1){_0x548949=_0x548949-0x0;var _0x1585bc=_0x28e1[_0x548949];return _0x1585bc;};'use strict';var jayson=require(_0x128e('0x0'));var _=require('lodash');var config=require(_0x128e('0x1'));exports[_0x128e('0x2')]=function(){return new Promise(function(_0x2ef7c1,_0x454b7e){var _0x1eca02={};_0x1eca02=_[_0x128e('0x3')](_0x1eca02,require(_0x128e('0x4')));_0x1eca02=_[_0x128e('0x3')](_0x1eca02,require('../api/voiceExtension/voiceExtension.rpc'));_0x1eca02=_[_0x128e('0x3')](_0x1eca02,require(_0x128e('0x5')));_0x1eca02=_['merge'](_0x1eca02,require(_0x128e('0x6')));_0x1eca02=_[_0x128e('0x3')](_0x1eca02,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x1eca02=_[_0x128e('0x3')](_0x1eca02,require(_0x128e('0x7')));_0x1eca02=_[_0x128e('0x3')](_0x1eca02,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x1eca02=_['merge'](_0x1eca02,require(_0x128e('0x8')));_0x1eca02=_[_0x128e('0x3')](_0x1eca02,require(_0x128e('0x9')));_0x1eca02=_[_0x128e('0x3')](_0x1eca02,require(_0x128e('0xa')));_0x1eca02=_[_0x128e('0x3')](_0x1eca02,require(_0x128e('0xb')));_0x1eca02=_[_0x128e('0x3')](_0x1eca02,require(_0x128e('0xc')));_0x1eca02=_[_0x128e('0x3')](_0x1eca02,require(_0x128e('0xd')));_0x1eca02=_[_0x128e('0x3')](_0x1eca02,require(_0x128e('0xe')));_0x1eca02=_[_0x128e('0x3')](_0x1eca02,require(_0x128e('0xf')));_0x1eca02=_[_0x128e('0x3')](_0x1eca02,require('../api/mailInteraction/mailInteraction.rpc'));_0x1eca02=_[_0x128e('0x3')](_0x1eca02,require(_0x128e('0x10')));_0x1eca02=_['merge'](_0x1eca02,require(_0x128e('0x11')));_0x1eca02=_[_0x128e('0x3')](_0x1eca02,require(_0x128e('0x12')));_0x1eca02=_[_0x128e('0x3')](_0x1eca02,require('../api/faxAccount/faxAccount.rpc'));_0x1eca02=_[_0x128e('0x3')](_0x1eca02,require('../api/faxApplication/faxApplication.rpc'));_0x1eca02=_['merge'](_0x1eca02,require(_0x128e('0x13')));_0x1eca02=_[_0x128e('0x3')](_0x1eca02,require(_0x128e('0x14')));_0x1eca02=_['merge'](_0x1eca02,require(_0x128e('0x15')));_0x1eca02=_[_0x128e('0x3')](_0x1eca02,require(_0x128e('0x16')));_0x1eca02=_[_0x128e('0x3')](_0x1eca02,require(_0x128e('0x17')));_0x1eca02=_[_0x128e('0x3')](_0x1eca02,require('../api/smsInteraction/smsInteraction.rpc'));_0x1eca02=_[_0x128e('0x3')](_0x1eca02,require(_0x128e('0x18')));_0x1eca02=_[_0x128e('0x3')](_0x1eca02,require(_0x128e('0x19')));_0x1eca02=_[_0x128e('0x3')](_0x1eca02,require(_0x128e('0x1a')));_0x1eca02=_[_0x128e('0x3')](_0x1eca02,require(_0x128e('0x1b')));_0x1eca02=_['merge'](_0x1eca02,require(_0x128e('0x1c')));_0x1eca02=_[_0x128e('0x3')](_0x1eca02,require(_0x128e('0x1d')));_0x1eca02=_[_0x128e('0x3')](_0x1eca02,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x1eca02=_[_0x128e('0x3')](_0x1eca02,require(_0x128e('0x1e')));_0x1eca02=_[_0x128e('0x3')](_0x1eca02,require(_0x128e('0x1f')));_0x1eca02=_[_0x128e('0x3')](_0x1eca02,require(_0x128e('0x20')));_0x1eca02=_[_0x128e('0x3')](_0x1eca02,require('../api/cmContact/cmContact.rpc'));_0x1eca02=_[_0x128e('0x3')](_0x1eca02,require(_0x128e('0x21')));_0x1eca02=_['merge'](_0x1eca02,require(_0x128e('0x22')));_0x1eca02=_[_0x128e('0x3')](_0x1eca02,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x1eca02=_[_0x128e('0x3')](_0x1eca02,require(_0x128e('0x23')));_0x1eca02=_['merge'](_0x1eca02,require(_0x128e('0x24')));_0x1eca02=_['merge'](_0x1eca02,require(_0x128e('0x25')));_0x1eca02=_[_0x128e('0x3')](_0x1eca02,require(_0x128e('0x26')));_0x1eca02=_[_0x128e('0x3')](_0x1eca02,require(_0x128e('0x27')));_0x1eca02=_[_0x128e('0x3')](_0x1eca02,require(_0x128e('0x28')));_0x1eca02=_[_0x128e('0x3')](_0x1eca02,require(_0x128e('0x29')));_0x1eca02=_[_0x128e('0x3')](_0x1eca02,require('../api/trigger/trigger.rpc'));_0x1eca02=_[_0x128e('0x3')](_0x1eca02,require(_0x128e('0x2a')));_0x1eca02=_['merge'](_0x1eca02,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x1eca02=_[_0x128e('0x3')](_0x1eca02,require(_0x128e('0x2b')));_0x1eca02=_[_0x128e('0x3')](_0x1eca02,require(_0x128e('0x2c')));_0x1eca02=_[_0x128e('0x3')](_0x1eca02,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x1eca02=_[_0x128e('0x3')](_0x1eca02,require(_0x128e('0x2d')));_0x1eca02=_[_0x128e('0x3')](_0x1eca02,require(_0x128e('0x2e')));_0x1eca02=_[_0x128e('0x3')](_0x1eca02,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x1eca02=_[_0x128e('0x3')](_0x1eca02,require(_0x128e('0x2f')));_0x1eca02=_[_0x128e('0x3')](_0x1eca02,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x1eca02=_[_0x128e('0x3')](_0x1eca02,require(_0x128e('0x30')));_0x1eca02=_[_0x128e('0x3')](_0x1eca02,require(_0x128e('0x31')));_0x1eca02=_['merge'](_0x1eca02,require(_0x128e('0x32')));_0x1eca02=_['merge'](_0x1eca02,require('../api/squareReport/squareReport.rpc'));_0x1eca02=_['merge'](_0x1eca02,require(_0x128e('0x33')));_0x1eca02=_[_0x128e('0x3')](_0x1eca02,require(_0x128e('0x34')));_0x1eca02=_[_0x128e('0x3')](_0x1eca02,require(_0x128e('0x35')));_0x1eca02=_['merge'](_0x1eca02,require('../api/squareProject/squareProject.rpc'));_0x1eca02=_['merge'](_0x1eca02,require(_0x128e('0x36')));_0x1eca02=_['merge'](_0x1eca02,require(_0x128e('0x37')));_0x1eca02=_[_0x128e('0x3')](_0x1eca02,require(_0x128e('0x38')));_0x1eca02=_[_0x128e('0x3')](_0x1eca02,require(_0x128e('0x39')));_0x1eca02=_[_0x128e('0x3')](_0x1eca02,require(_0x128e('0x3a')));_0x1eca02=_[_0x128e('0x3')](_0x1eca02,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x1eca02=_[_0x128e('0x3')](_0x1eca02,require(_0x128e('0x3b')));_0x1eca02=_['merge'](_0x1eca02,require(_0x128e('0x3c')));_0x1eca02=_[_0x128e('0x3')](_0x1eca02,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x1eca02=_['merge'](_0x1eca02,require(_0x128e('0x3d')));var _0xb5c00e=jayson['server'](_0x1eca02)['http']();var _0x5a733=config['rpc'][_0x128e('0x3e')]||config['port']+0x1;var _0x5f66ba=config[_0x128e('0x3f')]['ip']||'localhost';_0xb5c00e['on'](_0x128e('0x40'),function(_0x2d75f1){return _0x454b7e(_0x2d75f1);});_0xb5c00e[_0x128e('0x2')](_0x5a733,_0x5f66ba,function(){console[_0x128e('0x41')](_0x128e('0x42'),_0x5f66ba,_0x5a733);require(_0x128e('0x43'))[_0x128e('0x44')]();return _0x2ef7c1(_0x128e('0x45')+_0x5f66ba+':'+_0x5a733);});});}; \ No newline at end of file +var _0xc45f=['../api/trigger/trigger.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','localhost','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','RPC\x20listening\x20on\x20','jayson/promise','lodash','listen','merge','../api/user/user.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/cmContact/cmContact.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc'];(function(_0x53c2e3,_0x486f96){var _0x28bfd5=function(_0x4af9f2){while(--_0x4af9f2){_0x53c2e3['push'](_0x53c2e3['shift']());}};_0x28bfd5(++_0x486f96);}(_0xc45f,0xfb));var _0xfc45=function(_0x5958a6,_0x5afa96){_0x5958a6=_0x5958a6-0x0;var _0x1d682b=_0xc45f[_0x5958a6];return _0x1d682b;};'use strict';var jayson=require(_0xfc45('0x0'));var _=require(_0xfc45('0x1'));var config=require('../config/environment');exports[_0xfc45('0x2')]=function(){return new Promise(function(_0x30d5eb,_0x266e04){var _0x5c60da={};_0x5c60da=_[_0xfc45('0x3')](_0x5c60da,require(_0xfc45('0x4')));_0x5c60da=_[_0xfc45('0x3')](_0x5c60da,require('../api/voiceExtension/voiceExtension.rpc'));_0x5c60da=_[_0xfc45('0x3')](_0x5c60da,require(_0xfc45('0x5')));_0x5c60da=_[_0xfc45('0x3')](_0x5c60da,require(_0xfc45('0x6')));_0x5c60da=_[_0xfc45('0x3')](_0x5c60da,require(_0xfc45('0x7')));_0x5c60da=_[_0xfc45('0x3')](_0x5c60da,require(_0xfc45('0x8')));_0x5c60da=_[_0xfc45('0x3')](_0x5c60da,require(_0xfc45('0x9')));_0x5c60da=_[_0xfc45('0x3')](_0x5c60da,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x5c60da=_[_0xfc45('0x3')](_0x5c60da,require('../api/memberReport/memberReport.rpc'));_0x5c60da=_['merge'](_0x5c60da,require('../api/trunk/trunk.rpc'));_0x5c60da=_[_0xfc45('0x3')](_0x5c60da,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x5c60da=_[_0xfc45('0x3')](_0x5c60da,require(_0xfc45('0xa')));_0x5c60da=_['merge'](_0x5c60da,require(_0xfc45('0xb')));_0x5c60da=_[_0xfc45('0x3')](_0x5c60da,require('../api/mailAccount/mailAccount.rpc'));_0x5c60da=_['merge'](_0x5c60da,require(_0xfc45('0xc')));_0x5c60da=_[_0xfc45('0x3')](_0x5c60da,require(_0xfc45('0xd')));_0x5c60da=_[_0xfc45('0x3')](_0x5c60da,require(_0xfc45('0xe')));_0x5c60da=_[_0xfc45('0x3')](_0x5c60da,require(_0xfc45('0xf')));_0x5c60da=_[_0xfc45('0x3')](_0x5c60da,require(_0xfc45('0x10')));_0x5c60da=_[_0xfc45('0x3')](_0x5c60da,require(_0xfc45('0x11')));_0x5c60da=_[_0xfc45('0x3')](_0x5c60da,require(_0xfc45('0x12')));_0x5c60da=_[_0xfc45('0x3')](_0x5c60da,require(_0xfc45('0x13')));_0x5c60da=_[_0xfc45('0x3')](_0x5c60da,require('../api/faxMessage/faxMessage.rpc'));_0x5c60da=_[_0xfc45('0x3')](_0x5c60da,require(_0xfc45('0x14')));_0x5c60da=_[_0xfc45('0x3')](_0x5c60da,require(_0xfc45('0x15')));_0x5c60da=_[_0xfc45('0x3')](_0x5c60da,require(_0xfc45('0x16')));_0x5c60da=_[_0xfc45('0x3')](_0x5c60da,require(_0xfc45('0x17')));_0x5c60da=_[_0xfc45('0x3')](_0x5c60da,require('../api/smsMessage/smsMessage.rpc'));_0x5c60da=_[_0xfc45('0x3')](_0x5c60da,require(_0xfc45('0x18')));_0x5c60da=_[_0xfc45('0x3')](_0x5c60da,require(_0xfc45('0x19')));_0x5c60da=_[_0xfc45('0x3')](_0x5c60da,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x5c60da=_[_0xfc45('0x3')](_0x5c60da,require(_0xfc45('0x1a')));_0x5c60da=_[_0xfc45('0x3')](_0x5c60da,require(_0xfc45('0x1b')));_0x5c60da=_['merge'](_0x5c60da,require(_0xfc45('0x1c')));_0x5c60da=_[_0xfc45('0x3')](_0x5c60da,require(_0xfc45('0x1d')));_0x5c60da=_[_0xfc45('0x3')](_0x5c60da,require(_0xfc45('0x1e')));_0x5c60da=_[_0xfc45('0x3')](_0x5c60da,require('../api/chatQueue/chatQueue.rpc'));_0x5c60da=_[_0xfc45('0x3')](_0x5c60da,require(_0xfc45('0x1f')));_0x5c60da=_['merge'](_0x5c60da,require('../api/cmHopper/cmHopper.rpc'));_0x5c60da=_['merge'](_0x5c60da,require(_0xfc45('0x20')));_0x5c60da=_['merge'](_0x5c60da,require(_0xfc45('0x21')));_0x5c60da=_[_0xfc45('0x3')](_0x5c60da,require(_0xfc45('0x22')));_0x5c60da=_['merge'](_0x5c60da,require(_0xfc45('0x23')));_0x5c60da=_[_0xfc45('0x3')](_0x5c60da,require(_0xfc45('0x24')));_0x5c60da=_['merge'](_0x5c60da,require(_0xfc45('0x25')));_0x5c60da=_[_0xfc45('0x3')](_0x5c60da,require(_0xfc45('0x26')));_0x5c60da=_[_0xfc45('0x3')](_0x5c60da,require(_0xfc45('0x27')));_0x5c60da=_[_0xfc45('0x3')](_0x5c60da,require(_0xfc45('0x28')));_0x5c60da=_[_0xfc45('0x3')](_0x5c60da,require(_0xfc45('0x29')));_0x5c60da=_[_0xfc45('0x3')](_0x5c60da,require('../api/variable/variable.rpc'));_0x5c60da=_[_0xfc45('0x3')](_0x5c60da,require(_0xfc45('0x2a')));_0x5c60da=_[_0xfc45('0x3')](_0x5c60da,require(_0xfc45('0x2b')));_0x5c60da=_['merge'](_0x5c60da,require(_0xfc45('0x2c')));_0x5c60da=_['merge'](_0x5c60da,require(_0xfc45('0x2d')));_0x5c60da=_[_0xfc45('0x3')](_0x5c60da,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x5c60da=_[_0xfc45('0x3')](_0x5c60da,require(_0xfc45('0x2e')));_0x5c60da=_[_0xfc45('0x3')](_0x5c60da,require(_0xfc45('0x2f')));_0x5c60da=_['merge'](_0x5c60da,require(_0xfc45('0x30')));_0x5c60da=_['merge'](_0x5c60da,require(_0xfc45('0x31')));_0x5c60da=_['merge'](_0x5c60da,require(_0xfc45('0x32')));_0x5c60da=_[_0xfc45('0x3')](_0x5c60da,require(_0xfc45('0x33')));_0x5c60da=_[_0xfc45('0x3')](_0x5c60da,require(_0xfc45('0x34')));_0x5c60da=_['merge'](_0x5c60da,require(_0xfc45('0x35')));_0x5c60da=_[_0xfc45('0x3')](_0x5c60da,require(_0xfc45('0x36')));_0x5c60da=_[_0xfc45('0x3')](_0x5c60da,require(_0xfc45('0x37')));_0x5c60da=_['merge'](_0x5c60da,require(_0xfc45('0x38')));_0x5c60da=_[_0xfc45('0x3')](_0x5c60da,require(_0xfc45('0x39')));_0x5c60da=_[_0xfc45('0x3')](_0x5c60da,require(_0xfc45('0x3a')));_0x5c60da=_[_0xfc45('0x3')](_0x5c60da,require(_0xfc45('0x3b')));_0x5c60da=_[_0xfc45('0x3')](_0x5c60da,require('../api/campaign/campaign.rpc'));_0x5c60da=_['merge'](_0x5c60da,require('../api/attachment/attachment.rpc'));_0x5c60da=_[_0xfc45('0x3')](_0x5c60da,require(_0xfc45('0x3c')));_0x5c60da=_[_0xfc45('0x3')](_0x5c60da,require(_0xfc45('0x3d')));_0x5c60da=_[_0xfc45('0x3')](_0x5c60da,require(_0xfc45('0x3e')));_0x5c60da=_[_0xfc45('0x3')](_0x5c60da,require(_0xfc45('0x3f')));_0x5c60da=_['merge'](_0x5c60da,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x5c60da=_[_0xfc45('0x3')](_0x5c60da,require(_0xfc45('0x40')));var _0x952332=jayson[_0xfc45('0x41')](_0x5c60da)[_0xfc45('0x42')]();var _0x126cb3=config[_0xfc45('0x43')]['port']||config[_0xfc45('0x44')]+0x1;var _0x341b7d=config[_0xfc45('0x43')]['ip']||_0xfc45('0x45');_0x952332['on']('error',function(_0x8b08d5){return _0x266e04(_0x8b08d5);});_0x952332[_0xfc45('0x2')](_0x126cb3,_0x341b7d,function(){console[_0xfc45('0x46')](_0xfc45('0x47'),_0x341b7d,_0x126cb3);require('../config/triggers')['default']();return _0x30d5eb(_0xfc45('0x48')+_0x341b7d+':'+_0x126cb3);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 1c29af9..fe878c9 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 _0xe83e=['sync','prototype','answer','sendRequest','ANSWER','getData','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','SAY\x20NUMBER\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','GOTO\x20%s\x20%s\x20%s','GET\x20VARIABLE\x20\x22%s\x22','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','exports','util','lodash','events','EventEmitter','./reply','./error','call','setEncoding','utf8','setTimeout','headers','emit','line','toLowerCase','hangup','substring','520-Invalid','search','no\x20code','replace','result=','indexOf','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','function','write','inherits'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0xe83e,0x7a));var _0xee83=function(_0x236ba9,_0x3f9a71){_0x236ba9=_0x236ba9-0x0;var _0x16b8a6=_0xe83e[_0x236ba9];return _0x16b8a6;};'use strict';var util=require(_0xee83('0x0'));var _=require(_0xee83('0x1'));var EventEmitter=require(_0xee83('0x2'))[_0xee83('0x3')];var AGIReply=require(_0xee83('0x4'));var AGIError=require(_0xee83('0x5'));function AGIChannel(_0x5a510f){var _0x55b088=this,_0x306ef5=new AGIReply(),_0x3ddd32=![],_0x21ad81={};EventEmitter[_0xee83('0x6')](_0x55b088);_0x5a510f[_0xee83('0x7')](_0xee83('0x8'));_0x5a510f[_0xee83('0x9')](0x8*0x3c*0x3c*0x3e8);_0x306ef5['setEncoding'](_0xee83('0x8'));_0x306ef5['on'](_0xee83('0xa'),function(_0x4098f3){for(var _0x1ae420 in _0x4098f3){_0x55b088[_0x1ae420]=_0x4098f3[_0x1ae420];}_0x55b088[_0xee83('0xb')]('ready');});_0x306ef5['on'](_0xee83('0xc'),function(_0x2c9e7b){if(_0x2c9e7b[_0xee83('0xd')]()==_0xee83('0xe')){_0x55b088[_0xee83('0xb')](_0xee83('0xe'));return;}if(_0x2c9e7b[_0xee83('0xf')](0x0,0xb)==_0xee83('0x10')){_0x3ddd32=!![];}if(_0x3ddd32){_0x21ad81['rx']+=_0x2c9e7b+'\x0a';if(_0x2c9e7b[_0xee83('0x11')]('520\x20End\x20of\x20proper')!=-0x1){_0x3ddd32=![];}}else{_0x21ad81['rx']=_0x2c9e7b;}if(_0x3ddd32){return;}if(typeof _0x21ad81['cb']=='function'){var _0x370cbe=_0x21ad81['rx'][_0xee83('0xf')](0x0,0x3),_0x3e780e=null,_0x2190c8=null;_0x370cbe=parseInt(_0x370cbe);if(isNaN(_0x370cbe)){_0x21ad81['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xee83('0x12')});return;}if(_0x370cbe!=0xc8){_0x21ad81['cb'](null,{'code':_0x370cbe,'result':-0x1,'extra':'KO'});return;}_0x3e780e=_0x21ad81['rx'][_0xee83('0xf')](0x4)[_0xee83('0x13')](_0xee83('0x14'),'');if(_0x3e780e['indexOf']('\x20')!=-0x1){_0x3e780e=_0x3e780e['substr'](0x0,_0x3e780e[_0xee83('0x15')]('\x20'));}if(_[_0xee83('0x16')](_0x3e780e,'-1')){_0x3e780e=parseInt(_0x3e780e);}_0x2190c8=_0x21ad81['rx'][_0xee83('0x17')]('\x20');if(_0x2190c8[_0xee83('0x18')]==0x3){_0x2190c8=_0x2190c8[0x2][_0xee83('0xf')](0x1,_0x2190c8[0x2][_0xee83('0x18')]-0x1);}else if(_0x2190c8[_0xee83('0x18')]>0x3){var _0x2443dd=/\((.+)\)/;var _0x4126b7=_0x21ad81['rx'][_0xee83('0x19')](_0x2443dd);if(_0x4126b7){_0x2190c8=_0x4126b7[0x1];}else{_0x2190c8=null;}}else{_0x2190c8=null;}_0x21ad81['cb'](null,{'code':_0x370cbe,'result':_0x3e780e,'extra':_0x2190c8});}});_0x5a510f['on'](_0xee83('0x1a'),function(_0x1dcb66){_0x55b088[_0xee83('0xb')]('error',new AGIError(_0xee83('0x1b'),_0x1dcb66['code']));});_0x5a510f['on'](_0xee83('0x1c'),function(){_0x55b088[_0xee83('0xb')](_0xee83('0x1c'),new AGIError(_0xee83('0x1d')));});_0x5a510f['on'](_0xee83('0x1e'),function(){_0x55b088[_0xee83('0xb')](_0xee83('0x1e'),new AGIError(_0xee83('0x1f')));_0x5a510f[_0xee83('0x20')]();});_0x5a510f[_0xee83('0x21')](_0x306ef5);this[_0xee83('0x22')]=function(_0x11724e,_0x226746){var _0x11724e=_0x11724e||'',_0x226746=typeof _0x226746==_0xee83('0x23')?_0x226746:new Function();_0x21ad81={'tx':_0x11724e,'rx':'','cb':_0x226746};_0x5a510f[_0xee83('0x24')](_0x11724e+'\x0a');},this[_0xee83('0x1c')]=function(){_0x5a510f[_0xee83('0x20')]();};}util[_0xee83('0x25')](AGIChannel,EventEmitter);AGIChannel['prototype']['sendRequest']=function(_0x2a46db){return this['command'][_0xee83('0x26')](this,_0x2a46db);};AGIChannel[_0xee83('0x27')][_0xee83('0x28')]=function(){return this[_0xee83('0x29')](_0xee83('0x2a'));};AGIChannel[_0xee83('0x27')][_0xee83('0x2b')]=function(_0x3ff1e9,_0x12afcc,_0x3e6ba8){_0x3ff1e9=_0x3ff1e9===undefined?'beep':_0x3ff1e9;_0x12afcc=_0x12afcc===undefined?'5':_0x12afcc;_0x3e6ba8=_0x3e6ba8===undefined?'1':_0x3e6ba8;return this['sendRequest'](util[_0xee83('0x2c')](_0xee83('0x2d'),_0x3ff1e9,_0x12afcc*0x3e8,_0x3e6ba8));};AGIChannel[_0xee83('0x27')][_0xee83('0x2e')]=function(_0x58654f){_0x58654f=_0x58654f||_0xee83('0x2f');return this[_0xee83('0x29')](util[_0xee83('0x2c')](_0xee83('0x30'),_0x58654f));};AGIChannel[_0xee83('0x27')][_0xee83('0x31')]=function(_0x3af483,_0x28e72b){if(_[_0xee83('0x32')](_0x28e72b)){return this[_0xee83('0x29')](util['format'](_0xee83('0x33'),_0x3af483,_0x28e72b['join'](',')));}return this[_0xee83('0x29')](util[_0xee83('0x2c')](_0xee83('0x33'),_0x3af483,_0x28e72b));};AGIChannel['prototype'][_0xee83('0x34')]=function(_0x25ae75){return this[_0xee83('0x29')](util['format'](_0xee83('0x35'),_0x25ae75));};AGIChannel[_0xee83('0x27')][_0xee83('0x36')]=function(_0xfc9d93){return this[_0xee83('0x29')](util[_0xee83('0x2c')](_0xee83('0x37'),_0xfc9d93));};AGIChannel['prototype'][_0xee83('0x38')]=function(_0x540bf3){return this[_0xee83('0x29')](util[_0xee83('0x2c')](_0xee83('0x39'),_0x540bf3));};AGIChannel['prototype'][_0xee83('0xe')]=function(){return this[_0xee83('0x29')](_0xee83('0x3a'));};AGIChannel[_0xee83('0x27')][_0xee83('0x3b')]=function(_0x52da0d,_0x34d5b2){var _0x5e462=_[_0xee83('0x3c')](_0x34d5b2)||_[_0xee83('0x3d')](_0x34d5b2)?_0x34d5b2[_0xee83('0x3e')]():_0x34d5b2;return this[_0xee83('0x29')](util[_0xee83('0x2c')](_0xee83('0x3f'),_0x52da0d,_0x5e462?_0x5e462[_0xee83('0x3e')]()[_0xee83('0x13')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xee83('0x27')]['sayNumber']=function(_0x50eca0,_0x3fc261){return this[_0xee83('0x29')](util['format'](_0xee83('0x40'),_0x50eca0,_0x3fc261));};AGIChannel[_0xee83('0x27')]['sayDigits']=function(_0x256c9d,_0x4a4999){return this[_0xee83('0x29')](util[_0xee83('0x2c')]('SAY\x20DIGITS\x20%s\x20%s',_0x256c9d,_0x4a4999));};AGIChannel[_0xee83('0x27')][_0xee83('0x41')]=function(_0x4e051a,_0x46925e){return this['sendRequest'](util[_0xee83('0x2c')](_0xee83('0x42'),_0x4e051a,_0x46925e));};AGIChannel[_0xee83('0x27')][_0xee83('0x43')]=function(_0x1f5c53,_0x466b4c,_0x50cbf7){_0x466b4c=_0x466b4c||this['extension'];_0x50cbf7=_0x50cbf7||0x1;this[_0xee83('0x34')](_0x1f5c53);this[_0xee83('0x36')](_0x466b4c);this['setPriority'](_0x50cbf7);return this[_0xee83('0x2e')](util[_0xee83('0x2c')](_0xee83('0x44'),_0x1f5c53,_0x466b4c,_0x50cbf7));};AGIChannel[_0xee83('0x27')]['getVariable']=function(_0x4eafc6){return this['sendRequest'](util[_0xee83('0x2c')](_0xee83('0x45'),_0x4eafc6));};AGIChannel[_0xee83('0x27')]['recordFile']=function(_0x2709cd,_0x491c5a,_0x523c66,_0x1915b2,_0x19844e,_0x52a5fb){_0x491c5a=_0x491c5a||_0xee83('0x46');_0x523c66=_0x523c66||'';_0x1915b2=_0x1915b2===undefined?-0x1:_0x1915b2==='-1'?-0x1:_0x1915b2*0x3e8;_0x19844e=_0x19844e===undefined?'':'s='+_0x19844e;_0x52a5fb=_0x52a5fb?_0xee83('0x47'):'';return this[_0xee83('0x29')](util['format'](_0xee83('0x48'),_0x2709cd,_0x491c5a,_0x523c66,_0x1915b2,_0x52a5fb,_0x19844e));};AGIChannel[_0xee83('0x27')][_0xee83('0x49')]=function(_0x151861,_0x2a4def){_0x2a4def=_0x2a4def||'';return this[_0xee83('0x29')](util[_0xee83('0x2c')](_0xee83('0x4a'),_0x151861,_0x2a4def));};AGIChannel[_0xee83('0x27')]['agi']=function(_0x4830d6){return this[_0xee83('0x31')](_0xee83('0x4b'),_0x4830d6);};AGIChannel['prototype'][_0xee83('0x4c')]=function(_0x4856b9){return this['exec'](_0xee83('0x4d'),_0x4856b9);};AGIChannel[_0xee83('0x27')][_0xee83('0x1a')]=function(_0x4a7c44,_0x1768ed){this['noop'](util[_0xee83('0x2c')](_0xee83('0x4e'),_0x4a7c44['id'],_0x4a7c44['label'],_0x1768ed));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xee83('0x4f')]=AGIChannel; \ No newline at end of file +var _0xa729=['substring','520-Invalid','520\x20End\x20of\x20proper','function','no\x20code','result=','indexOf','startsWith','split','length','match','error','code','close','timeout','E_AGI_SOCKET_TIMEOUT','destroy','inherits','prototype','sendRequest','sync','answer','ANSWER','beep','format','noop','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20EXTENSION\x20%s','setPriority','setVariable','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','replace','sayNumber','SAY\x20NUMBER\x20%s\x20%s','SAY\x20DIGITS\x20%s\x20%s','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','setExtension','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','WAIT','label','exports','util','lodash','events','./reply','call','setEncoding','utf8','setTimeout','emit','ready','line','toLowerCase','hangup'];(function(_0x16a57b,_0x56c999){var _0x7b3755=function(_0x4a78f9){while(--_0x4a78f9){_0x16a57b['push'](_0x16a57b['shift']());}};_0x7b3755(++_0x56c999);}(_0xa729,0x160));var _0x9a72=function(_0x204cff,_0x53712d){_0x204cff=_0x204cff-0x0;var _0xdcaf67=_0xa729[_0x204cff];return _0xdcaf67;};'use strict';var util=require(_0x9a72('0x0'));var _=require(_0x9a72('0x1'));var EventEmitter=require(_0x9a72('0x2'))['EventEmitter'];var AGIReply=require(_0x9a72('0x3'));var AGIError=require('./error');function AGIChannel(_0x4ce14e){var _0x2e0f7d=this,_0xbeada6=new AGIReply(),_0x143999=![],_0x30e6ef={};EventEmitter[_0x9a72('0x4')](_0x2e0f7d);_0x4ce14e[_0x9a72('0x5')](_0x9a72('0x6'));_0x4ce14e[_0x9a72('0x7')](0x8*0x3c*0x3c*0x3e8);_0xbeada6[_0x9a72('0x5')]('utf8');_0xbeada6['on']('headers',function(_0x5f388c){for(var _0x38e204 in _0x5f388c){_0x2e0f7d[_0x38e204]=_0x5f388c[_0x38e204];}_0x2e0f7d[_0x9a72('0x8')](_0x9a72('0x9'));});_0xbeada6['on'](_0x9a72('0xa'),function(_0x181488){if(_0x181488[_0x9a72('0xb')]()==_0x9a72('0xc')){_0x2e0f7d[_0x9a72('0x8')](_0x9a72('0xc'));return;}if(_0x181488[_0x9a72('0xd')](0x0,0xb)==_0x9a72('0xe')){_0x143999=!![];}if(_0x143999){_0x30e6ef['rx']+=_0x181488+'\x0a';if(_0x181488['search'](_0x9a72('0xf'))!=-0x1){_0x143999=![];}}else{_0x30e6ef['rx']=_0x181488;}if(_0x143999){return;}if(typeof _0x30e6ef['cb']==_0x9a72('0x10')){var _0x15d801=_0x30e6ef['rx']['substring'](0x0,0x3),_0x521d48=null,_0x203e4a=null;_0x15d801=parseInt(_0x15d801);if(isNaN(_0x15d801)){_0x30e6ef['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x9a72('0x11')});return;}if(_0x15d801!=0xc8){_0x30e6ef['cb'](null,{'code':_0x15d801,'result':-0x1,'extra':'KO'});return;}_0x521d48=_0x30e6ef['rx'][_0x9a72('0xd')](0x4)['replace'](_0x9a72('0x12'),'');if(_0x521d48['indexOf']('\x20')!=-0x1){_0x521d48=_0x521d48['substr'](0x0,_0x521d48[_0x9a72('0x13')]('\x20'));}if(_[_0x9a72('0x14')](_0x521d48,'-1')){_0x521d48=parseInt(_0x521d48);}_0x203e4a=_0x30e6ef['rx'][_0x9a72('0x15')]('\x20');if(_0x203e4a[_0x9a72('0x16')]==0x3){_0x203e4a=_0x203e4a[0x2][_0x9a72('0xd')](0x1,_0x203e4a[0x2][_0x9a72('0x16')]-0x1);}else if(_0x203e4a[_0x9a72('0x16')]>0x3){var _0xce750=/\((.+)\)/;var _0x51fabd=_0x30e6ef['rx'][_0x9a72('0x17')](_0xce750);if(_0x51fabd){_0x203e4a=_0x51fabd[0x1];}else{_0x203e4a=null;}}else{_0x203e4a=null;}_0x30e6ef['cb'](null,{'code':_0x15d801,'result':_0x521d48,'extra':_0x203e4a});}});_0x4ce14e['on']('error',function(_0x128af9){_0x2e0f7d[_0x9a72('0x8')](_0x9a72('0x18'),new AGIError('E_AGI_SOCKET_ERROR',_0x128af9[_0x9a72('0x19')]));});_0x4ce14e['on'](_0x9a72('0x1a'),function(){_0x2e0f7d[_0x9a72('0x8')](_0x9a72('0x1a'),new AGIError('E_AGI_SOCKET_CLOSE'));});_0x4ce14e['on']('timeout',function(){_0x2e0f7d[_0x9a72('0x8')](_0x9a72('0x1b'),new AGIError(_0x9a72('0x1c')));_0x4ce14e[_0x9a72('0x1d')]();});_0x4ce14e['pipe'](_0xbeada6);this['command']=function(_0x253c6c,_0x16ed4b){var _0x253c6c=_0x253c6c||'',_0x16ed4b=typeof _0x16ed4b==_0x9a72('0x10')?_0x16ed4b:new Function();_0x30e6ef={'tx':_0x253c6c,'rx':'','cb':_0x16ed4b};_0x4ce14e['write'](_0x253c6c+'\x0a');},this[_0x9a72('0x1a')]=function(){_0x4ce14e[_0x9a72('0x1d')]();};}util[_0x9a72('0x1e')](AGIChannel,EventEmitter);AGIChannel[_0x9a72('0x1f')][_0x9a72('0x20')]=function(_0x55725b){return this['command'][_0x9a72('0x21')](this,_0x55725b);};AGIChannel[_0x9a72('0x1f')][_0x9a72('0x22')]=function(){return this[_0x9a72('0x20')](_0x9a72('0x23'));};AGIChannel['prototype']['getData']=function(_0x4b865a,_0x4db995,_0x174ced){_0x4b865a=_0x4b865a===undefined?_0x9a72('0x24'):_0x4b865a;_0x4db995=_0x4db995===undefined?'5':_0x4db995;_0x174ced=_0x174ced===undefined?'1':_0x174ced;return this[_0x9a72('0x20')](util[_0x9a72('0x25')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x4b865a,_0x4db995*0x3e8,_0x174ced));};AGIChannel[_0x9a72('0x1f')][_0x9a72('0x26')]=function(_0x26b3d6){_0x26b3d6=_0x26b3d6||'NO\x20MESSAGE';return this[_0x9a72('0x20')](util[_0x9a72('0x25')]('VERBOSE\x20\x22%s\x22',_0x26b3d6));};AGIChannel[_0x9a72('0x1f')][_0x9a72('0x27')]=function(_0x42301f,_0x4eb148){if(_[_0x9a72('0x28')](_0x4eb148)){return this[_0x9a72('0x20')](util['format'](_0x9a72('0x29'),_0x42301f,_0x4eb148[_0x9a72('0x2a')](',')));}return this[_0x9a72('0x20')](util[_0x9a72('0x25')](_0x9a72('0x29'),_0x42301f,_0x4eb148));};AGIChannel[_0x9a72('0x1f')][_0x9a72('0x2b')]=function(_0x34a77a){return this['sendRequest'](util[_0x9a72('0x25')]('SET\x20CONTEXT\x20%s',_0x34a77a));};AGIChannel['prototype']['setExtension']=function(_0xe09de){return this[_0x9a72('0x20')](util[_0x9a72('0x25')](_0x9a72('0x2c'),_0xe09de));};AGIChannel[_0x9a72('0x1f')][_0x9a72('0x2d')]=function(_0x5b8509){return this[_0x9a72('0x20')](util[_0x9a72('0x25')]('SET\x20PRIORITY\x20%s',_0x5b8509));};AGIChannel[_0x9a72('0x1f')][_0x9a72('0xc')]=function(){return this[_0x9a72('0x20')]('HANGUP');};AGIChannel[_0x9a72('0x1f')][_0x9a72('0x2e')]=function(_0x3244d8,_0x12ce43){var _0x5e07c7=_[_0x9a72('0x2f')](_0x12ce43)||_[_0x9a72('0x30')](_0x12ce43)?_0x12ce43[_0x9a72('0x31')]():_0x12ce43;return this['sendRequest'](util[_0x9a72('0x25')](_0x9a72('0x32'),_0x3244d8,_0x5e07c7?_0x5e07c7['toString']()[_0x9a72('0x33')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x9a72('0x1f')][_0x9a72('0x34')]=function(_0x46ddb2,_0x45c98b){return this['sendRequest'](util[_0x9a72('0x25')](_0x9a72('0x35'),_0x46ddb2,_0x45c98b));};AGIChannel['prototype']['sayDigits']=function(_0xc29c42,_0x2ec5ba){return this[_0x9a72('0x20')](util[_0x9a72('0x25')](_0x9a72('0x36'),_0xc29c42,_0x2ec5ba));};AGIChannel['prototype']['sayPhonetic']=function(_0x59d9f4,_0x11b475){return this[_0x9a72('0x20')](util[_0x9a72('0x25')](_0x9a72('0x37'),_0x59d9f4,_0x11b475));};AGIChannel[_0x9a72('0x1f')][_0x9a72('0x38')]=function(_0x1f504a,_0x457e35,_0x57d12f){_0x457e35=_0x457e35||this['extension'];_0x57d12f=_0x57d12f||0x1;this['setContext'](_0x1f504a);this[_0x9a72('0x39')](_0x457e35);this[_0x9a72('0x2d')](_0x57d12f);return this[_0x9a72('0x26')](util['format'](_0x9a72('0x3a'),_0x1f504a,_0x457e35,_0x57d12f));};AGIChannel[_0x9a72('0x1f')][_0x9a72('0x3b')]=function(_0x2271b0){return this[_0x9a72('0x20')](util[_0x9a72('0x25')](_0x9a72('0x3c'),_0x2271b0));};AGIChannel[_0x9a72('0x1f')][_0x9a72('0x3d')]=function(_0x114cb2,_0x490f32,_0x2fa4c7,_0x5e9879,_0x37cc34,_0x225fc3){_0x490f32=_0x490f32||_0x9a72('0x3e');_0x2fa4c7=_0x2fa4c7||'';_0x5e9879=_0x5e9879===undefined?-0x1:_0x5e9879==='-1'?-0x1:_0x5e9879*0x3e8;_0x37cc34=_0x37cc34===undefined?'':'s='+_0x37cc34;_0x225fc3=_0x225fc3?_0x9a72('0x3f'):'';return this['sendRequest'](util[_0x9a72('0x25')](_0x9a72('0x40'),_0x114cb2,_0x490f32,_0x2fa4c7,_0x5e9879,_0x225fc3,_0x37cc34));};AGIChannel[_0x9a72('0x1f')][_0x9a72('0x41')]=function(_0x1708a6,_0x188d69){_0x188d69=_0x188d69||'';return this[_0x9a72('0x20')](util['format'](_0x9a72('0x42'),_0x1708a6,_0x188d69));};AGIChannel[_0x9a72('0x1f')][_0x9a72('0x43')]=function(_0x5975dc){return this['exec'](_0x9a72('0x44'),_0x5975dc);};AGIChannel[_0x9a72('0x1f')][_0x9a72('0x45')]=function(_0x5c1346){return this[_0x9a72('0x27')](_0x9a72('0x46'),_0x5c1346);};AGIChannel[_0x9a72('0x1f')][_0x9a72('0x18')]=function(_0x10e4ac,_0x597112){this['noop'](util[_0x9a72('0x25')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x10e4ac['id'],_0x10e4ac[_0x9a72('0x47')],_0x597112));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x9a72('0x48')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 8935d45..1a2923e 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 _0x0a8a=['Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','apply','message','name','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.'];(function(_0x4d7f3f,_0x4d2803){var _0x5d67cc=function(_0x2c37f4){while(--_0x2c37f4){_0x4d7f3f['push'](_0x4d7f3f['shift']());}};_0x5d67cc(++_0x4d2803);}(_0x0a8a,0x193));var _0xa0a8=function(_0xeb6bb1,_0xc83c4c){_0xeb6bb1=_0xeb6bb1-0x0;var _0x387e00=_0x0a8a[_0xeb6bb1];return _0x387e00;};'use strict';var util=require(_0xa0a8('0x0'));var error={'E_AGI_UNDEFINED':_0xa0a8('0x1'),'E_AGI_ARGUMENT_PORT':_0xa0a8('0x2'),'E_AGI_SERVER_ERROR':_0xa0a8('0x3'),'E_AGI_SERVER_CLOSE':_0xa0a8('0x4'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0xa0a8('0x5'),'E_AGI_SOCKET_ERROR':_0xa0a8('0x6'),'E_AGI_SOCKET_CLOSE':_0xa0a8('0x7'),'E_AGI_SOCKET_TIMEOUT':_0xa0a8('0x8'),'E_AGI_COMMAND_EMPTY':_0xa0a8('0x9'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xa0a8('0xa'),'E_AGI_IVR_ENTRY':_0xa0a8('0xb')};function AGIError(_0x4ea641){var _0x4ea641=_0x4ea641||null,_0x660cc9=_0x660cc9||[],_0x3f89f0=0x1,_0x191515='';if(!error[_0x4ea641]){_0x4ea641=_0xa0a8('0xc');}_0x660cc9[_0xa0a8('0xd')](error[_0x4ea641]);while(arguments[_0x3f89f0]){_0x660cc9['push'](arguments[_0x3f89f0]);_0x3f89f0++;}_0x191515=util[_0xa0a8('0xe')][_0xa0a8('0xf')](util,_0x660cc9);this[_0xa0a8('0x10')]=_0x191515;this[_0xa0a8('0x11')]=_0x4ea641;}module['exports']=AGIError; \ No newline at end of file +var _0xc8bf=['Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','apply','message','name','Undefined\x20error.'];(function(_0x5d93a8,_0x1ca212){var _0x3fe778=function(_0x1cc8cf){while(--_0x1cc8cf){_0x5d93a8['push'](_0x5d93a8['shift']());}};_0x3fe778(++_0x1ca212);}(_0xc8bf,0x17f));var _0xfc8b=function(_0x5eec50,_0x3ab58d){_0x5eec50=_0x5eec50-0x0;var _0x3278ec=_0xc8bf[_0x5eec50];return _0x3278ec;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0xfc8b('0x0'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0xfc8b('0x1'),'E_AGI_SERVER_MAXCONNECTION':_0xfc8b('0x2'),'E_AGI_SERVER_VOICE_DISABLED':_0xfc8b('0x3'),'E_AGI_SOCKET_ERROR':_0xfc8b('0x4'),'E_AGI_SOCKET_CLOSE':_0xfc8b('0x5'),'E_AGI_SOCKET_TIMEOUT':_0xfc8b('0x6'),'E_AGI_COMMAND_EMPTY':_0xfc8b('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xfc8b('0x8'),'E_AGI_IVR_ENTRY':_0xfc8b('0x9')};function AGIError(_0x536556){var _0x536556=_0x536556||null,_0xefc7f=_0xefc7f||[],_0x34964b=0x1,_0x59382f='';if(!error[_0x536556]){_0x536556=_0xfc8b('0xa');}_0xefc7f[_0xfc8b('0xb')](error[_0x536556]);while(arguments[_0x34964b]){_0xefc7f[_0xfc8b('0xb')](arguments[_0x34964b]);_0x34964b++;}_0x59382f=util[_0xfc8b('0xc')][_0xfc8b('0xd')](util,_0xefc7f);this[_0xfc8b('0xe')]=_0x59382f;this[_0xfc8b('0xf')]=_0x536556;}module['exports']=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index 3d846ce..46064d9 100644 --- a/server/services/agi/events.js +++ b/server/services/agi/events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd2a2=['projectUpdate','E_AGI_SERVER_ERROR','exports','lodash','events','ioredis','../../config/environment','defaults','redis','localhost','subscribe','agi','emit','error','parse'];(function(_0x4a9741,_0x876337){var _0x1c2f25=function(_0x1de9aa){while(--_0x1de9aa){_0x4a9741['push'](_0x4a9741['shift']());}};_0x1c2f25(++_0x876337);}(_0xd2a2,0x14d));var _0x2d2a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd2a2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2d2a('0x0'));var EventEmitter=require(_0x2d2a('0x1'))['EventEmitter'];var Redis=require(_0x2d2a('0x2'));var AGIError=require('./error');var config=require(_0x2d2a('0x3'));config['redis']=_[_0x2d2a('0x4')](config[_0x2d2a('0x5')],{'host':_0x2d2a('0x6'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0x2d2a('0x5')]);sub[_0x2d2a('0x7')](_0x2d2a('0x8'),function(_0x430ff1){if(_0x430ff1)return eventEmitter[_0x2d2a('0x9')](_0x2d2a('0xa'),new AGIError('E_AGI_SERVER_ERROR',_0x430ff1));});sub['on']('message',function(_0x3acbf7,_0x1b9035){if(_0x3acbf7!=='agi')return;try{var _0x2e4d89=JSON[_0x2d2a('0xb')](_0x1b9035);eventEmitter[_0x2d2a('0x9')](_0x2d2a('0xc'),_0x2e4d89);}catch(_0x19c788){eventEmitter['emit']('error',new AGIError(_0x2d2a('0xd'),_0x19c788));}});module[_0x2d2a('0xe')]={'EventEmitter':eventEmitter}; \ No newline at end of file +var _0x7ea3=['agi','error','message','emit','projectUpdate','E_AGI_SERVER_ERROR','exports','lodash','events','ioredis','./error','redis','localhost','subscribe'];(function(_0x34c266,_0x1ecd3d){var _0x46da9e=function(_0x10bcd0){while(--_0x10bcd0){_0x34c266['push'](_0x34c266['shift']());}};_0x46da9e(++_0x1ecd3d);}(_0x7ea3,0xcb));var _0x37ea=function(_0x2ff28d,_0x5d4d8a){_0x2ff28d=_0x2ff28d-0x0;var _0x5efbd9=_0x7ea3[_0x2ff28d];return _0x5efbd9;};'use strict';var _=require(_0x37ea('0x0'));var EventEmitter=require(_0x37ea('0x1'))['EventEmitter'];var Redis=require(_0x37ea('0x2'));var AGIError=require(_0x37ea('0x3'));var config=require('../../config/environment');config[_0x37ea('0x4')]=_['defaults'](config['redis'],{'host':_0x37ea('0x5'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0x37ea('0x4')]);sub[_0x37ea('0x6')](_0x37ea('0x7'),function(_0x3f138c){if(_0x3f138c)return eventEmitter['emit'](_0x37ea('0x8'),new AGIError('E_AGI_SERVER_ERROR',_0x3f138c));});sub['on'](_0x37ea('0x9'),function(_0x24f1e3,_0x265251){if(_0x24f1e3!=='agi')return;try{var _0xb92321=JSON['parse'](_0x265251);eventEmitter[_0x37ea('0xa')](_0x37ea('0xb'),_0xb92321);}catch(_0x4652aa){eventEmitter[_0x37ea('0xa')](_0x37ea('0x8'),new AGIError(_0x37ea('0xc'),_0x4652aa));}});module[_0x37ea('0xd')]={'EventEmitter':eventEmitter}; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 1f97a7d..b01adf1 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 _0x0d63=['agi','getdigits','getsecretdigits','vertices','edges','prototype','addVertex','addEdge','push','numberOfEdges','size','relations','traverseBFS','info','no\x20vertex\x20found','length','no\x20edge/s\x20available','condition','split','agicommand','vswitch','target','default','menu','invalid','default\x20on\x20switch\x20not\x20found','exports','lodash','../../../config/logger'];(function(_0x341336,_0x5b9e89){var _0x2a3e82=function(_0x2518a1){while(--_0x2518a1){_0x341336['push'](_0x341336['shift']());}};_0x2a3e82(++_0x5b9e89);}(_0x0d63,0x1b1));var _0x30d6=function(_0x52ded2,_0x12f434){_0x52ded2=_0x52ded2-0x0;var _0x2675fc=_0x0d63[_0x52ded2];return _0x2675fc;};'use strict';var _=require(_0x30d6('0x0'));var logger=require(_0x30d6('0x1'))(_0x30d6('0x2'));var verticesWithRetry=['menu',_0x30d6('0x3'),_0x30d6('0x4')];var Graph=function(){this[_0x30d6('0x5')]={};this[_0x30d6('0x6')]={};this['numberOfEdges']=0x0;};Graph[_0x30d6('0x7')][_0x30d6('0x8')]=function(_0x1d0475){this[_0x30d6('0x5')][_0x1d0475['id']]=_0x1d0475;this['edges'][_0x1d0475['id']]=[];};Graph[_0x30d6('0x7')][_0x30d6('0x9')]=function(_0x2f7b40,_0x3516ba,_0x2e800e){this[_0x30d6('0x6')][_0x2f7b40][_0x30d6('0xa')]({'target':_0x3516ba,'condition':_0x2e800e});this[_0x30d6('0xb')]+=0x1;};Graph['prototype'][_0x30d6('0xc')]=function(){return _[_0x30d6('0xc')](this[_0x30d6('0x5')]);};Graph[_0x30d6('0x7')][_0x30d6('0xd')]=function(){return this[_0x30d6('0xb')];};Graph[_0x30d6('0x7')]['getVertex']=function(_0x1347b6){return this[_0x30d6('0x5')][_0x1347b6];};Graph['prototype'][_0x30d6('0xe')]=function(_0xf89d23,_0x3ee92c){if(!this[_0x30d6('0x5')][_0xf89d23]){return logger[_0x30d6('0xf')](_0x30d6('0x10'));}var _0x5891ef=_0x3ee92c(this[_0x30d6('0x5')][_0xf89d23]);if(!_0x5891ef){return logger['info']('stop\x20traverse');}if(this[_0x30d6('0x6')][_0xf89d23][_0x30d6('0x11')]===0x0){return logger['info'](_0x30d6('0x12'));}for(var _0x236ed8=0x0,_0x21b388=[],_0x4327a8=![];_0x236ed8\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','then','hasOwnProperty','indexOf','agi_','substring','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','hangup','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','catch','./server','listening','connection','lodash'];(function(_0x4c6aac,_0x5b2540){var _0x54dfc7=function(_0x4c6cde){while(--_0x4c6cde){_0x4c6aac['push'](_0x4c6aac['shift']());}};_0x54dfc7(++_0x5b2540);}(_0x1be0,0x1e5));var _0x01be=function(_0x1308f8,_0x270983){_0x1308f8=_0x1308f8-0x0;var _0x2b5b70=_0x1be0[_0x1308f8];return _0x2b5b70;};'use strict';var _=require(_0x01be('0x0'));var syncho=require('syncho');var util=require('util');var config=require(_0x01be('0x1'));var logger=require('../../config/logger')(_0x01be('0x2'));var utilLicense=require(_0x01be('0x3'));var rpc=require(_0x01be('0x4'));var Project=require('./project');var AGIEmitter=require(_0x01be('0x5'))[_0x01be('0x6')];var projects=[];config[_0x01be('0x2')]=_[_0x01be('0x7')](config['agi'],{'ip':'127.0.0.1','port':0x11dd});AGIEmitter['on'](_0x01be('0x8'),projectUpdateHandler);function connectionHandler(_0x2e8a53){process[_0x01be('0x9')](function(){syncho(function(){try{setChannelVariables(_0x2e8a53);agiHandler(_0x2e8a53);}catch(_0x1274f0){logger['error'](_0x1274f0['stack']);}});});}function projectUpdateHandler(_0x12e430){try{var _0x5f06ae=_[_0x01be('0xa')](projects,['id',_0x12e430['id']]);if(_0x5f06ae>-0x1){if(_0x12e430[_0x01be('0xb')]===!![]){projects['splice'](_0x5f06ae,0x1);}else{projects[_0x5f06ae]=_0x12e430;}}else{projects[_0x01be('0xc')](_0x12e430);}}catch(_0x59800d){logger['error'](_0x59800d[_0x01be('0xd')]);}}function listeningHandler(){console[_0x01be('0xe')](_0x01be('0xf'),config[_0x01be('0x2')][_0x01be('0x10')]);logger[_0x01be('0x11')](util[_0x01be('0x12')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0x01be('0x2')]['ip'],config[_0x01be('0x2')][_0x01be('0x10')]));}function errorHandler(_0x45ceca){if(_0x45ceca&&_0x45ceca[_0x01be('0x13')]&&_0x45ceca[_0x01be('0x14')]){logger['error'](util[_0x01be('0x12')](_0x01be('0x15'),_0x45ceca[_0x01be('0x13')],_0x45ceca['message']));}else{logger[_0x01be('0x16')](util['format'](_0x01be('0x17'),_0x45ceca[_0x01be('0xd')]));}}function closeHandler(){logger[_0x01be('0x11')](util[_0x01be('0x12')](_0x01be('0x18'),this[_0x01be('0x19')],this[_0x01be('0x1a')],this[_0x01be('0x1b')],this[_0x01be('0x1c')],this[_0x01be('0x1d')]));try{createSquareReport(this);}catch(_0x1f75d5){logger[_0x01be('0x16')](_0x1f75d5['stack']);}}function timeoutHandler(){logger['info'](util['format'](_0x01be('0x1e'),this['arg_1'],this[_0x01be('0x1a')],this[_0x01be('0x1b')],this[_0x01be('0x1c')],this[_0x01be('0x1d')]));}function hangupHandler(){logger[_0x01be('0x11')](util[_0x01be('0x12')](_0x01be('0x1f'),this[_0x01be('0x19')],this[_0x01be('0x1a')],this[_0x01be('0x1b')],this['dnid'],this[_0x01be('0x1d')]));this[_0x01be('0x20')]=!![];}function createSquareReport(_0x38078d,_0x1bfa6f){rpc['createSquareReport'](_0x38078d)[_0x01be('0x21')](function(_0x3a647e){if(_0x1bfa6f){_0x1bfa6f(null,_0x3a647e);}})['catch'](function(_0x51a013){if(_0x1bfa6f){_0x1bfa6f(null,_0x51a013);}});}function setChannelVariables(_0x1f6799){for(var _0x3f0eb0 in _0x1f6799){if(_0x1f6799[_0x01be('0x22')](_0x3f0eb0)){if(_0x3f0eb0[_0x01be('0x23')](_0x01be('0x24'))===0x0){_0x1f6799[_0x3f0eb0[_0x01be('0x25')](0x4)]=_0x1f6799[_0x3f0eb0];delete _0x1f6799[_0x3f0eb0];}}}}function agiHandler(_0xfe3bd2){logger[_0x01be('0x26')](_0x01be('0x27'),JSON[_0x01be('0x28')](_0xfe3bd2,null,0x2));logger['info'](util['format'](_0x01be('0x29'),_0xfe3bd2[_0x01be('0x19')],_0xfe3bd2[_0x01be('0x1a')],_0xfe3bd2[_0x01be('0x1b')],_0xfe3bd2[_0x01be('0x1c')],_0xfe3bd2[_0x01be('0x1d')]));_0xfe3bd2['on'](_0x01be('0x16'),errorHandler);_0xfe3bd2['on'](_0x01be('0x2a'),closeHandler);_0xfe3bd2['on']('timeout',timeoutHandler);_0xfe3bd2[_0x01be('0x20')]=![];_0xfe3bd2['on'](_0x01be('0x2b'),hangupHandler);var _0x395b2b=_['find'](projects,[_0x01be('0x13'),_0xfe3bd2[_0x01be('0x19')]]);if(!_0x395b2b)return Project['handleNotFound'](_0xfe3bd2);if(!_0x395b2b['production'])return Project['handleUnpublished'](_0xfe3bd2);return Project['initialize'](_0x395b2b,_0xfe3bd2);}function main(){var _0x4a12ec;return utilLicense['getLicense']()[_0x01be('0x21')](function(_0x58a9c0){if(!_0x58a9c0)return;if(_0x58a9c0[_0x01be('0x2c')]){if(_0x58a9c0[_0x01be('0x2d')]&&_0x58a9c0[_0x01be('0x2d')]>0x0){logger[_0x01be('0x11')](util['format'](_0x01be('0x2e'),_0x58a9c0[_0x01be('0x2d')]));_0x4a12ec=_0x58a9c0[_0x01be('0x2d')];}else{logger[_0x01be('0x11')](_0x01be('0x2f'));}}else{logger[_0x01be('0x11')](_0x01be('0x30'));_0x4a12ec=-0x1;}})[_0x01be('0x21')](function(){return Project[_0x01be('0x31')]();})[_0x01be('0x21')](function(_0x1e4072){projects=_0x1e4072;return;})[_0x01be('0x32')](function(_0x29de62){logger['error']('[LICENSE]',_0x29de62[_0x01be('0xd')]);})['finally'](function(){var _0x118922=require(_0x01be('0x33'))(config['agi']['port'],config[_0x01be('0x2')]['ip'],_0x4a12ec);_0x118922['on'](_0x01be('0x16'),errorHandler);_0x118922['on'](_0x01be('0x34'),listeningHandler);_0x118922['on'](_0x01be('0x35'),connectionHandler);_0x118922['on'](_0x01be('0x2a'),closeHandler);});}main(); \ No newline at end of file +var _0x226b=['stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','format','[%s]\x20%s','message','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','uniqueid','createSquareReport','then','catch','hasOwnProperty','indexOf','substring','variables','evtHangup','hangup','find','handleNotFound','handleUnpublished','initialize','voice','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','[LICENSE]','./server','listening','close','lodash','syncho','util','agi','../../config/license/util','./project','EventEmitter','defaults','nextTick','findIndex','splice','push','error'];(function(_0x2d2e4d,_0x11a5ab){var _0x24f218=function(_0x38fc92){while(--_0x38fc92){_0x2d2e4d['push'](_0x2d2e4d['shift']());}};_0x24f218(++_0x11a5ab);}(_0x226b,0x19b));var _0xb226=function(_0x258196,_0x235f4e){_0x258196=_0x258196-0x0;var _0x3df790=_0x226b[_0x258196];return _0x3df790;};'use strict';var _=require(_0xb226('0x0'));var syncho=require(_0xb226('0x1'));var util=require(_0xb226('0x2'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0xb226('0x3'));var utilLicense=require(_0xb226('0x4'));var rpc=require('./rpc');var Project=require(_0xb226('0x5'));var AGIEmitter=require('./events')[_0xb226('0x6')];var projects=[];config[_0xb226('0x3')]=_[_0xb226('0x7')](config['agi'],{'ip':'127.0.0.1','port':0x11dd});AGIEmitter['on']('projectUpdate',projectUpdateHandler);function connectionHandler(_0x37d251){process[_0xb226('0x8')](function(){syncho(function(){try{setChannelVariables(_0x37d251);agiHandler(_0x37d251);}catch(_0x201f63){logger['error'](_0x201f63['stack']);}});});}function projectUpdateHandler(_0x49394a){try{var _0x4dd69c=_[_0xb226('0x9')](projects,['id',_0x49394a['id']]);if(_0x4dd69c>-0x1){if(_0x49394a['deleted']===!![]){projects[_0xb226('0xa')](_0x4dd69c,0x1);}else{projects[_0x4dd69c]=_0x49394a;}}else{projects[_0xb226('0xb')](_0x49394a);}}catch(_0x18907e){logger[_0xb226('0xc')](_0x18907e[_0xb226('0xd')]);}}function listeningHandler(){console[_0xb226('0xe')](_0xb226('0xf'),config[_0xb226('0x3')][_0xb226('0x10')]);logger[_0xb226('0x11')](util['format'](_0xb226('0x12'),config[_0xb226('0x3')]['ip'],config[_0xb226('0x3')][_0xb226('0x10')]));}function errorHandler(_0xbce287){if(_0xbce287&&_0xbce287[_0xb226('0x13')]&&_0xbce287['message']){logger[_0xb226('0xc')](util[_0xb226('0x14')](_0xb226('0x15'),_0xbce287[_0xb226('0x13')],_0xbce287[_0xb226('0x16')]));}else{logger[_0xb226('0xc')](util[_0xb226('0x14')](_0xb226('0x17'),_0xbce287[_0xb226('0xd')]));}}function closeHandler(){logger[_0xb226('0x11')](util[_0xb226('0x14')](_0xb226('0x18'),this[_0xb226('0x19')],this[_0xb226('0x1a')],this[_0xb226('0x1b')],this[_0xb226('0x1c')],this['uniqueid']));try{createSquareReport(this);}catch(_0x28de81){logger['error'](_0x28de81['stack']);}}function timeoutHandler(){logger['info'](util[_0xb226('0x14')](_0xb226('0x1d'),this['arg_1'],this[_0xb226('0x1a')],this['callerid'],this['dnid'],this[_0xb226('0x1e')]));}function hangupHandler(){logger[_0xb226('0x11')](util['format']('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0xb226('0x19')],this[_0xb226('0x1a')],this['callerid'],this[_0xb226('0x1c')],this['uniqueid']));this['evtHangup']=!![];}function createSquareReport(_0x195d5d,_0x5b5f3f){rpc[_0xb226('0x1f')](_0x195d5d)[_0xb226('0x20')](function(_0x61e55e){if(_0x5b5f3f){_0x5b5f3f(null,_0x61e55e);}})[_0xb226('0x21')](function(_0x1016e0){if(_0x5b5f3f){_0x5b5f3f(null,_0x1016e0);}});}function setChannelVariables(_0x134afb){for(var _0xe6bd3b in _0x134afb){if(_0x134afb[_0xb226('0x22')](_0xe6bd3b)){if(_0xe6bd3b[_0xb226('0x23')]('agi_')===0x0){_0x134afb[_0xe6bd3b[_0xb226('0x24')](0x4)]=_0x134afb[_0xe6bd3b];delete _0x134afb[_0xe6bd3b];}}}}function agiHandler(_0x570216){logger['debug'](_0xb226('0x25'),JSON['stringify'](_0x570216,null,0x2));logger[_0xb226('0x11')](util[_0xb226('0x14')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x570216[_0xb226('0x19')],_0x570216[_0xb226('0x1a')],_0x570216['callerid'],_0x570216['dnid'],_0x570216['uniqueid']));_0x570216['on'](_0xb226('0xc'),errorHandler);_0x570216['on']('close',closeHandler);_0x570216['on']('timeout',timeoutHandler);_0x570216[_0xb226('0x26')]=![];_0x570216['on'](_0xb226('0x27'),hangupHandler);var _0x27f16c=_[_0xb226('0x28')](projects,[_0xb226('0x13'),_0x570216[_0xb226('0x19')]]);if(!_0x27f16c)return Project[_0xb226('0x29')](_0x570216);if(!_0x27f16c['production'])return Project[_0xb226('0x2a')](_0x570216);return Project[_0xb226('0x2b')](_0x27f16c,_0x570216);}function main(){var _0x195b51;return utilLicense['getLicense']()['then'](function(_0x4252ed){if(!_0x4252ed)return;if(_0x4252ed[_0xb226('0x2c')]){if(_0x4252ed[_0xb226('0x2d')]&&_0x4252ed[_0xb226('0x2d')]>0x0){logger['info'](util[_0xb226('0x14')]('[LICENSE]\x20CHANNELS:\x20%s',_0x4252ed[_0xb226('0x2d')]));_0x195b51=_0x4252ed[_0xb226('0x2d')];}else{logger[_0xb226('0x11')](_0xb226('0x2e'));}}else{logger[_0xb226('0x11')](_0xb226('0x2f'));_0x195b51=-0x1;}})[_0xb226('0x20')](function(){return Project[_0xb226('0x30')]();})[_0xb226('0x20')](function(_0x3a797a){projects=_0x3a797a;return;})[_0xb226('0x21')](function(_0x2655ab){logger['error'](_0xb226('0x31'),_0x2655ab[_0xb226('0xd')]);})['finally'](function(){var _0x28721e=require(_0xb226('0x32'))(config['agi'][_0xb226('0x10')],config[_0xb226('0x3')]['ip'],_0x195b51);_0x28721e['on'](_0xb226('0xc'),errorHandler);_0x28721e['on'](_0xb226('0x33'),listeningHandler);_0x28721e['on']('connection',connectionHandler);_0x28721e['on'](_0xb226('0x34'),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 76c37ea..94e06b0 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 _0xf746=['http','request','error','message','result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0xf746,0x11b));var _0x6f74=function(_0x166742,_0x55520c){_0x166742=_0x166742-0x0;var _0xb7814a=_0xf746[_0x166742];return _0xb7814a;};'use strict';var BPromise=require(_0x6f74('0x0'));var jayson=require(_0x6f74('0x1'));var client=jayson[_0x6f74('0x2')][_0x6f74('0x3')]({'port':0x232b});function request(_0x498d7e,_0x47f182){return new BPromise(function(_0x374f70,_0x2c3ab0){return client[_0x6f74('0x4')](_0x498d7e,_0x47f182)['then'](function(_0x2c5953){if(_0x2c5953[_0x6f74('0x5')]){return _0x2c3ab0(_0x2c5953[_0x6f74('0x5')][_0x6f74('0x6')]);}else{return _0x374f70(_0x2c5953[_0x6f74('0x7')]);}})[_0x6f74('0x8')](function(_0xd55e79){return _0x2c3ab0(_0xd55e79);});});}exports[_0x6f74('0x9')]=function(_0x4324bb,_0x2ea7b2){return request(_0x6f74('0xa'),{'account':_0x4324bb,'message':_0x2ea7b2});}; \ No newline at end of file +var _0xb09b=['bluebird','request','error','message','result','catch','sendMailMessage','SendMail'];(function(_0x43b495,_0xb57a7c){var _0x3532e7=function(_0x55645f){while(--_0x55645f){_0x43b495['push'](_0x43b495['shift']());}};_0x3532e7(++_0xb57a7c);}(_0xb09b,0x158));var _0xbb09=function(_0x29e871,_0x330b98){_0x29e871=_0x29e871-0x0;var _0x3380e3=_0xb09b[_0x29e871];return _0x3380e3;};'use strict';var BPromise=require(_0xbb09('0x0'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232b});function request(_0x307a8f,_0x4e000c){return new BPromise(function(_0x50553b,_0x17e846){return client[_0xbb09('0x1')](_0x307a8f,_0x4e000c)['then'](function(_0x160ba9){if(_0x160ba9[_0xbb09('0x2')]){return _0x17e846(_0x160ba9[_0xbb09('0x2')][_0xbb09('0x3')]);}else{return _0x50553b(_0x160ba9[_0xbb09('0x4')]);}})[_0xbb09('0x5')](function(_0x12b75b){return _0x17e846(_0x12b75b);});});}exports[_0xbb09('0x6')]=function(_0x68a42f,_0x4f3063){return request(_0xbb09('0x7'),{'account':_0x68a42f,'message':_0x4f3063});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index 53c071d..f0b3df3 100644 --- a/server/services/agi/project.js +++ b/server/services/agi/project.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xccde=['Unable\x20to\x20download\x20CallySquare\x20projects','stack','hasOwnProperty','maxRetry','retry','addVertex','omit','mxCell','isArray','length','source','target','addEdge','mxGraphModel','root','inspect','production','debug','stringify','joinAt','format','YYYY-MM-DD\x20HH:mm:ss','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','traverseBFS','clear','info','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','agicommand','response','code','result','evtHangup','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','vertex','isUndefined','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20found','close','Project\x20%s\x20not\x20published','exports','lodash','moment','xml2json','util','../../config/logger','agi','./rpc','./mailRpc','./graph','./vertices','getSquareProjects','catch','error'];(function(_0x5813eb,_0x157c17){var _0x314c58=function(_0x45dcec){while(--_0x45dcec){_0x5813eb['push'](_0x5813eb['shift']());}};_0x314c58(++_0x157c17);}(_0xccde,0x77));var _0xeccd=function(_0x4ea955,_0x1eda76){_0x4ea955=_0x4ea955-0x0;var _0x558561=_0xccde[_0x4ea955];return _0x558561;};'use strict';var _=require(_0xeccd('0x0'));var moment=require(_0xeccd('0x1'));var parser=require(_0xeccd('0x2'));var util=require(_0xeccd('0x3'));var logger=require(_0xeccd('0x4'))(_0xeccd('0x5'));var rpc=require(_0xeccd('0x6'));var mailRpc=require(_0xeccd('0x7'));var Graph=require(_0xeccd('0x8'));var Vertices=require(_0xeccd('0x9'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0xeccd('0xa')]()[_0xeccd('0xb')](function(_0x53e6ca){logger[_0xeccd('0xc')](_0xeccd('0xd'),_0x53e6ca[_0xeccd('0xe')]);return[];});}function addVertex(_0x58a08f,_0x3a69f8,_0x5242ce){_0x3a69f8['agicommand']=_0x5242ce;if(_0x3a69f8[_0xeccd('0xf')]('retry')){_0x3a69f8[_0xeccd('0x10')]=parseInt(_0x3a69f8[_0xeccd('0x11')],0xa);}_0x58a08f[_0xeccd('0x12')](_[_0xeccd('0x13')](_0x3a69f8,_0xeccd('0x14')));}function initGraph(_0xa99dff,_0x4304db){var _0xc8389=new Graph();for(var _0x30dfa9 in _0xa99dff){if(_0xa99dff[_0xeccd('0xf')](_0x30dfa9)){if(_[_0xeccd('0x15')](_0xa99dff[_0x30dfa9])){for(var _0x43fbfa=0x0;_0x43fbfa<_0xa99dff[_0x30dfa9][_0xeccd('0x16')];_0x43fbfa+=0x1){addVertex(_0xc8389,_0xa99dff[_0x30dfa9][_0x43fbfa],_0x30dfa9);}}else{addVertex(_0xc8389,_0xa99dff[_0x30dfa9],_0x30dfa9);}}}for(var _0x26b729=0x0;_0x26b729<_0x4304db[_0xeccd('0x16')];_0x26b729+=0x1){if(_0x4304db[_0x26b729][_0xeccd('0x17')]&&_0x4304db[_0x26b729][_0xeccd('0x18')]){_0xc8389[_0xeccd('0x19')](_0x4304db[_0x26b729][_0xeccd('0x17')],_0x4304db[_0x26b729][_0xeccd('0x18')],_0x4304db[_0x26b729]['value']);}}return _0xc8389;}function getRoot(_0x132f1e){return parser['toJson'](_0x132f1e,{'object':!![]})[_0xeccd('0x1a')][_0xeccd('0x1b')];}function inspect(_0x1b7ada){return util[_0xeccd('0x1c')](_0x1b7ada,{'showHidden':![],'depth':null});}function initialize(_0xb08151,_0x540b3d){var _0x42d966=getRoot(_0xb08151[_0xeccd('0x1d')]);if(!_0x42d966||!_0x42d966['start'])return;var _0x11b2d7,_0x32d148,_0x3f4a03;logger[_0xeccd('0x1e')](_0xeccd('0x1b'),JSON[_0xeccd('0x1f')](_0x42d966,null,0x2));_0x540b3d[_0xeccd('0x20')]=moment()[_0xeccd('0x21')](_0xeccd('0x22'));_0x11b2d7=initGraph(_[_0xeccd('0x13')](_0x42d966,'mxCell'),_0x42d966[_0xeccd('0x14')]);_0x32d148=new Vertices(_0x540b3d,rpc,mailRpc);logger['info'](util['format'](_0xeccd('0x23'),_0x540b3d[_0xeccd('0x24')],_0x540b3d[_0xeccd('0x25')],_0x540b3d[_0xeccd('0x26')],_0x540b3d[_0xeccd('0x27')],_0x540b3d[_0xeccd('0x28')]));_0x11b2d7[_0xeccd('0x29')](_0x42d966['start']['id'],function(_0x2346da){try{_0x2346da=_0x32d148[_0xeccd('0x2a')](_0x2346da);logger[_0xeccd('0x1e')]('vertex',JSON[_0xeccd('0x1f')](_0x2346da,null,0x2));if(_0x2346da['agicommand']==='gotoc'){logger[_0xeccd('0x2b')](_0xeccd('0x2c'));_0x540b3d[_0xeccd('0x2d')]=_0x2346da['context']||_0x540b3d[_0xeccd('0x2d')];_0x540b3d['extension']=_0x2346da[_0xeccd('0x2e')];_0x540b3d[_0xeccd('0x2f')]=_0x2346da[_0xeccd('0x2f')]?_0x2346da['priority']-0x1:0x1;return null;}else if(_0x2346da&&_0x32d148[_0x2346da[_0xeccd('0x30')]]){_0x3f4a03=_0x32d148[_0x2346da[_0xeccd('0x30')]](_0x2346da);logger[_0xeccd('0x2b')](_0xeccd('0x31'),JSON[_0xeccd('0x1f')](_0x3f4a03,null,0x2));if(_0x3f4a03&&_0x3f4a03[_0xeccd('0x32')]===AGI_CODE_SUCCESS&&_0x3f4a03[_0xeccd('0x33')]!==AGI_RESULT_ERROR&&!_0x540b3d[_0xeccd('0x34')]){logger[_0xeccd('0x1e')](_0xeccd('0x31'),inspect(_0x3f4a03));return _['isUndefined'](_0x3f4a03['result'])?null:_0x3f4a03[_0xeccd('0x33')][_0xeccd('0x35')]();}else{logger[_0xeccd('0xc')](_0xeccd('0x31'),inspect(_0x3f4a03));return null;}}else{logger['error'](_0xeccd('0x36'));return null;}}catch(_0x1e00bf){logger[_0xeccd('0xc')](_0x1e00bf[_0xeccd('0xe')]);return null;}});if(_0x42d966[_0xeccd('0x37')]){logger[_0xeccd('0x2b')](util[_0xeccd('0x21')](_0xeccd('0x38'),_0x540b3d[_0xeccd('0x24')],_0x540b3d[_0xeccd('0x25')],_0x540b3d[_0xeccd('0x26')],_0x540b3d[_0xeccd('0x27')],_0x540b3d[_0xeccd('0x28')]));_0x11b2d7['traverseBFS'](_0x42d966['finally']['id'],function(_0x1cabc5){try{_0x1cabc5=_0x32d148[_0xeccd('0x2a')](_0x1cabc5);logger[_0xeccd('0x1e')](_0xeccd('0x39'),JSON[_0xeccd('0x1f')](_0x1cabc5,null,0x2));if(_0x1cabc5&&_0x32d148[_0x1cabc5[_0xeccd('0x30')]]){_0x3f4a03=_0x32d148[_0x1cabc5[_0xeccd('0x30')]](_0x1cabc5);if(_0x3f4a03){logger[_0xeccd('0x1e')](_0xeccd('0x31'),inspect(_0x3f4a03));return _[_0xeccd('0x3a')](_0x3f4a03['result'])?null:_0x3f4a03['result'][_0xeccd('0x35')]();}else{logger['error'](_0xeccd('0x31'),inspect(_0x3f4a03));return null;}}else{logger[_0xeccd('0xc')](_0xeccd('0x36'));return null;}}catch(_0x47c8cd){logger[_0xeccd('0xc')](_0x47c8cd[_0xeccd('0xe')]);return null;}});}logger['info'](util[_0xeccd('0x21')](_0xeccd('0x3b'),_0x540b3d[_0xeccd('0x24')],_0x540b3d[_0xeccd('0x25')],_0x540b3d[_0xeccd('0x26')],_0x540b3d[_0xeccd('0x27')],_0x540b3d[_0xeccd('0x28')]));logger[_0xeccd('0x2b')](util[_0xeccd('0x21')](_0xeccd('0x3c'),_0x540b3d[_0xeccd('0x2d')],_0x540b3d['extension'],parseInt(_0x540b3d['priority'],0xa)+0x1));_0x540b3d[_0xeccd('0x3d')](_0x540b3d['context'],_0x540b3d[_0xeccd('0x2e')],parseInt(_0x540b3d[_0xeccd('0x2f')],0xa)+0x1);_0x540b3d['close']();}function handleNotFound(_0xc2c82b){logger[_0xeccd('0xc')](util[_0xeccd('0x21')](_0xeccd('0x3e'),_0xc2c82b[_0xeccd('0x24')]));_0xc2c82b[_0xeccd('0x3d')](_0xc2c82b['context'],_0xc2c82b[_0xeccd('0x2e')],parseInt(_0xc2c82b[_0xeccd('0x2f')],0xa)+0x1);_0xc2c82b[_0xeccd('0x3f')]();}function handleUnpublished(_0x527919){logger[_0xeccd('0xc')](util[_0xeccd('0x21')](_0xeccd('0x40'),_0x527919[_0xeccd('0x24')]));_0x527919[_0xeccd('0x3d')](_0x527919['context'],_0x527919[_0xeccd('0x2e')],parseInt(_0x527919[_0xeccd('0x2f')],0xa)+0x1);_0x527919[_0xeccd('0x3f')]();}module[_0xeccd('0x41')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0x216e=['extension','priority','response','code','isUndefined','result','toString','error','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','Project\x20%s\x20not\x20published','lodash','moment','util','../../config/logger','agi','./rpc','./graph','Unable\x20to\x20download\x20CallySquare\x20projects','stack','agicommand','retry','maxRetry','addVertex','omit','mxCell','isArray','length','source','target','addEdge','value','toJson','mxGraphModel','root','inspect','production','debug','stringify','joinAt','format','YYYY-MM-DD\x20HH:mm:ss','arg_1','calleridname','callerid','dnid','uniqueid','traverseBFS','clear','vertex','gotoc','info','gotoc\x20block\x20stop\x20traverse\x20BFS','context'];(function(_0xba444c,_0x104d11){var _0x48c95d=function(_0x5b6906){while(--_0x5b6906){_0xba444c['push'](_0xba444c['shift']());}};_0x48c95d(++_0x104d11);}(_0x216e,0xf2));var _0xe216=function(_0x5d8d7f,_0x5cdf08){_0x5d8d7f=_0x5d8d7f-0x0;var _0x29d1bc=_0x216e[_0x5d8d7f];return _0x29d1bc;};'use strict';var _=require(_0xe216('0x0'));var moment=require(_0xe216('0x1'));var parser=require('xml2json');var util=require(_0xe216('0x2'));var logger=require(_0xe216('0x3'))(_0xe216('0x4'));var rpc=require(_0xe216('0x5'));var mailRpc=require('./mailRpc');var Graph=require(_0xe216('0x6'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc['getSquareProjects']()['catch'](function(_0x512857){logger['error'](_0xe216('0x7'),_0x512857[_0xe216('0x8')]);return[];});}function addVertex(_0x30b592,_0x122bf3,_0x550218){_0x122bf3[_0xe216('0x9')]=_0x550218;if(_0x122bf3['hasOwnProperty'](_0xe216('0xa'))){_0x122bf3[_0xe216('0xb')]=parseInt(_0x122bf3[_0xe216('0xa')],0xa);}_0x30b592[_0xe216('0xc')](_[_0xe216('0xd')](_0x122bf3,_0xe216('0xe')));}function initGraph(_0x3342aa,_0x5d4b81){var _0x5cb199=new Graph();for(var _0x27392e in _0x3342aa){if(_0x3342aa['hasOwnProperty'](_0x27392e)){if(_[_0xe216('0xf')](_0x3342aa[_0x27392e])){for(var _0x1abcb1=0x0;_0x1abcb1<_0x3342aa[_0x27392e]['length'];_0x1abcb1+=0x1){addVertex(_0x5cb199,_0x3342aa[_0x27392e][_0x1abcb1],_0x27392e);}}else{addVertex(_0x5cb199,_0x3342aa[_0x27392e],_0x27392e);}}}for(var _0x1bce62=0x0;_0x1bce62<_0x5d4b81[_0xe216('0x10')];_0x1bce62+=0x1){if(_0x5d4b81[_0x1bce62][_0xe216('0x11')]&&_0x5d4b81[_0x1bce62][_0xe216('0x12')]){_0x5cb199[_0xe216('0x13')](_0x5d4b81[_0x1bce62][_0xe216('0x11')],_0x5d4b81[_0x1bce62]['target'],_0x5d4b81[_0x1bce62][_0xe216('0x14')]);}}return _0x5cb199;}function getRoot(_0x5ec2ba){return parser[_0xe216('0x15')](_0x5ec2ba,{'object':!![]})[_0xe216('0x16')][_0xe216('0x17')];}function inspect(_0x2d3d8a){return util[_0xe216('0x18')](_0x2d3d8a,{'showHidden':![],'depth':null});}function initialize(_0x262199,_0x4ec045){var _0x3fd642=getRoot(_0x262199[_0xe216('0x19')]);if(!_0x3fd642||!_0x3fd642['start'])return;var _0x2983db,_0x3552cf,_0x5894b1;logger[_0xe216('0x1a')]('root',JSON[_0xe216('0x1b')](_0x3fd642,null,0x2));_0x4ec045[_0xe216('0x1c')]=moment()[_0xe216('0x1d')](_0xe216('0x1e'));_0x2983db=initGraph(_[_0xe216('0xd')](_0x3fd642,_0xe216('0xe')),_0x3fd642[_0xe216('0xe')]);_0x3552cf=new Vertices(_0x4ec045,rpc,mailRpc);logger['info'](util[_0xe216('0x1d')]('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x4ec045[_0xe216('0x1f')],_0x4ec045[_0xe216('0x20')],_0x4ec045[_0xe216('0x21')],_0x4ec045[_0xe216('0x22')],_0x4ec045[_0xe216('0x23')]));_0x2983db[_0xe216('0x24')](_0x3fd642['start']['id'],function(_0x16964e){try{_0x16964e=_0x3552cf[_0xe216('0x25')](_0x16964e);logger[_0xe216('0x1a')](_0xe216('0x26'),JSON[_0xe216('0x1b')](_0x16964e,null,0x2));if(_0x16964e['agicommand']===_0xe216('0x27')){logger[_0xe216('0x28')](_0xe216('0x29'));_0x4ec045[_0xe216('0x2a')]=_0x16964e['context']||_0x4ec045[_0xe216('0x2a')];_0x4ec045[_0xe216('0x2b')]=_0x16964e['extension'];_0x4ec045[_0xe216('0x2c')]=_0x16964e[_0xe216('0x2c')]?_0x16964e[_0xe216('0x2c')]-0x1:0x1;return null;}else if(_0x16964e&&_0x3552cf[_0x16964e[_0xe216('0x9')]]){_0x5894b1=_0x3552cf[_0x16964e[_0xe216('0x9')]](_0x16964e);logger[_0xe216('0x28')](_0xe216('0x2d'),JSON[_0xe216('0x1b')](_0x5894b1,null,0x2));if(_0x5894b1&&_0x5894b1[_0xe216('0x2e')]===AGI_CODE_SUCCESS&&_0x5894b1['result']!==AGI_RESULT_ERROR&&!_0x4ec045['evtHangup']){logger[_0xe216('0x1a')](_0xe216('0x2d'),inspect(_0x5894b1));return _[_0xe216('0x2f')](_0x5894b1[_0xe216('0x30')])?null:_0x5894b1[_0xe216('0x30')][_0xe216('0x31')]();}else{logger[_0xe216('0x32')](_0xe216('0x2d'),inspect(_0x5894b1));return null;}}else{logger[_0xe216('0x32')]('agicommand\x20not\x20found');return null;}}catch(_0x4321e4){logger[_0xe216('0x32')](_0x4321e4[_0xe216('0x8')]);return null;}});if(_0x3fd642[_0xe216('0x33')]){logger[_0xe216('0x28')](util[_0xe216('0x1d')](_0xe216('0x34'),_0x4ec045[_0xe216('0x1f')],_0x4ec045[_0xe216('0x20')],_0x4ec045[_0xe216('0x21')],_0x4ec045[_0xe216('0x22')],_0x4ec045[_0xe216('0x23')]));_0x2983db[_0xe216('0x24')](_0x3fd642[_0xe216('0x33')]['id'],function(_0x448999){try{_0x448999=_0x3552cf[_0xe216('0x25')](_0x448999);logger[_0xe216('0x1a')](_0xe216('0x26'),JSON['stringify'](_0x448999,null,0x2));if(_0x448999&&_0x3552cf[_0x448999['agicommand']]){_0x5894b1=_0x3552cf[_0x448999[_0xe216('0x9')]](_0x448999);if(_0x5894b1){logger['debug'](_0xe216('0x2d'),inspect(_0x5894b1));return _[_0xe216('0x2f')](_0x5894b1['result'])?null:_0x5894b1[_0xe216('0x30')][_0xe216('0x31')]();}else{logger[_0xe216('0x32')](_0xe216('0x2d'),inspect(_0x5894b1));return null;}}else{logger[_0xe216('0x32')]('agicommand\x20not\x20found');return null;}}catch(_0x5421f7){logger[_0xe216('0x32')](_0x5421f7[_0xe216('0x8')]);return null;}});}logger['info'](util[_0xe216('0x1d')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x4ec045[_0xe216('0x1f')],_0x4ec045[_0xe216('0x20')],_0x4ec045[_0xe216('0x21')],_0x4ec045['dnid'],_0x4ec045[_0xe216('0x23')]));logger[_0xe216('0x28')](util[_0xe216('0x1d')](_0xe216('0x35'),_0x4ec045[_0xe216('0x2a')],_0x4ec045['extension'],parseInt(_0x4ec045['priority'],0xa)+0x1));_0x4ec045[_0xe216('0x36')](_0x4ec045[_0xe216('0x2a')],_0x4ec045[_0xe216('0x2b')],parseInt(_0x4ec045[_0xe216('0x2c')],0xa)+0x1);_0x4ec045[_0xe216('0x37')]();}function handleNotFound(_0x36de40){logger['error'](util['format']('Project\x20%s\x20not\x20found',_0x36de40['arg_1']));_0x36de40['continueAt'](_0x36de40['context'],_0x36de40[_0xe216('0x2b')],parseInt(_0x36de40['priority'],0xa)+0x1);_0x36de40['close']();}function handleUnpublished(_0x2aa678){logger[_0xe216('0x32')](util[_0xe216('0x1d')](_0xe216('0x38'),_0x2aa678['arg_1']));_0x2aa678[_0xe216('0x36')](_0x2aa678[_0xe216('0x2a')],_0x2aa678[_0xe216('0x2b')],parseInt(_0x2aa678[_0xe216('0x2c')],0xa)+0x1);_0x2aa678['close']();}module['exports']={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index 522a2b6..22a9145 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 _0x2ab5=['Transform','call','_localBuffer','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','indexOf','length','slice','trim','headers','substring','emit','exports','util','stream'];(function(_0x29a29f,_0x155ce7){var _0x443ea3=function(_0xe0dd24){while(--_0xe0dd24){_0x29a29f['push'](_0x29a29f['shift']());}};_0x443ea3(++_0x155ce7);}(_0x2ab5,0x8e));var _0x52ab=function(_0x392d6d,_0x2e3c68){_0x392d6d=_0x392d6d-0x0;var _0x1dfae5=_0x2ab5[_0x392d6d];return _0x1dfae5;};'use strict';var util=require(_0x52ab('0x0'));var Transform=require(_0x52ab('0x1'))[_0x52ab('0x2')];function AGIReply(_0x148bf0){Transform[_0x52ab('0x3')](this,_0x148bf0);this[_0x52ab('0x4')]='';this[_0x52ab('0x5')]=![];}util[_0x52ab('0x6')](AGIReply,Transform);AGIReply[_0x52ab('0x7')][_0x52ab('0x8')]=function(_0x39d3a9,_0x16c15e,_0x163c95){var _0x2acf8d='\x0a',_0x4ee435=['\x0a\x0a',_0x52ab('0x9')],_0x26a485=-0x1,_0x1c8e27=-0x1,_0x1f6a68='',_0x2a23ab=0x0,_0x32516a='',_0x408280='';this[_0x52ab('0x4')]+=_0x39d3a9['toString']();_0x32516a=this[_0x52ab('0x4')];if(!this[_0x52ab('0x5')]){_0x2a23ab=0x0;while(_0x4ee435[_0x2a23ab]){while((_0x1c8e27=_0x32516a[_0x52ab('0xa')](_0x4ee435[_0x2a23ab]))!=-0x1){_0x1f6a68=_0x4ee435[_0x2a23ab];_0x408280=_0x32516a['substring'](0x0,_0x1c8e27);_0x32516a=_0x32516a['substring'](_0x1c8e27+_0x1f6a68[_0x52ab('0xb')]);var _0x18e549=_0x408280['split'](_0x2acf8d),_0x3f2c75=0x0,_0xfb0a89={},_0x278c5e='',_0x13bcce='',_0x3bdbaf=-0x1;while(_0x18e549[_0x3f2c75]){_0x3bdbaf=_0x18e549[_0x3f2c75][_0x52ab('0xa')](':');if(_0x3bdbaf!=-0x1){_0x278c5e=_0x18e549[_0x3f2c75][_0x52ab('0xc')](0x0,_0x3bdbaf)[_0x52ab('0xd')]();_0x13bcce=_0x18e549[_0x3f2c75][_0x52ab('0xc')](_0x3bdbaf+0x1)[_0x52ab('0xd')]();if(_0x278c5e[_0x52ab('0xb')]>0x0){_0xfb0a89[_0x278c5e]=_0x13bcce;}}else{}_0x3f2c75++;}this['emit'](_0x52ab('0xe'),_0xfb0a89);this['_inBody']=!![];}_0x2a23ab++;}this['_localBuffer']=_0x32516a;}else{while((_0x26a485=_0x32516a['indexOf'](_0x2acf8d))!=-0x1){_0x408280=_0x32516a[_0x52ab('0xf')](0x0,_0x26a485);this[_0x52ab('0x10')]('line',_0x408280);_0x32516a=_0x32516a['substring'](_0x26a485+_0x2acf8d['length']);}this[_0x52ab('0x4')]=_0x32516a;}_0x163c95();};module[_0x52ab('0x11')]=AGIReply; \ No newline at end of file +var _0xcad3=['toString','indexOf','length','split','slice','trim','headers','substring','emit','line','exports','stream','Transform','call','_localBuffer','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a'];(function(_0x867b0a,_0x587ccf){var _0x137438=function(_0xbeafa6){while(--_0xbeafa6){_0x867b0a['push'](_0x867b0a['shift']());}};_0x137438(++_0x587ccf);}(_0xcad3,0xd3));var _0x3cad=function(_0x4471ff,_0x4bb7de){_0x4471ff=_0x4471ff-0x0;var _0xe723ca=_0xcad3[_0x4471ff];return _0xe723ca;};'use strict';var util=require('util');var Transform=require(_0x3cad('0x0'))[_0x3cad('0x1')];function AGIReply(_0x3a6c56){Transform[_0x3cad('0x2')](this,_0x3a6c56);this[_0x3cad('0x3')]='';this[_0x3cad('0x4')]=![];}util[_0x3cad('0x5')](AGIReply,Transform);AGIReply[_0x3cad('0x6')][_0x3cad('0x7')]=function(_0x24a153,_0x5dd5db,_0x39463a){var _0x15095e='\x0a',_0x230adc=['\x0a\x0a',_0x3cad('0x8')],_0x294623=-0x1,_0xcb9ce5=-0x1,_0xbc6ac9='',_0x55524d=0x0,_0x325180='',_0x1f6767='';this[_0x3cad('0x3')]+=_0x24a153[_0x3cad('0x9')]();_0x325180=this[_0x3cad('0x3')];if(!this[_0x3cad('0x4')]){_0x55524d=0x0;while(_0x230adc[_0x55524d]){while((_0xcb9ce5=_0x325180[_0x3cad('0xa')](_0x230adc[_0x55524d]))!=-0x1){_0xbc6ac9=_0x230adc[_0x55524d];_0x1f6767=_0x325180['substring'](0x0,_0xcb9ce5);_0x325180=_0x325180['substring'](_0xcb9ce5+_0xbc6ac9[_0x3cad('0xb')]);var _0x5a2171=_0x1f6767[_0x3cad('0xc')](_0x15095e),_0x42c252=0x0,_0x1af251={},_0x1fa20d='',_0x407e1a='',_0x50a681=-0x1;while(_0x5a2171[_0x42c252]){_0x50a681=_0x5a2171[_0x42c252]['indexOf'](':');if(_0x50a681!=-0x1){_0x1fa20d=_0x5a2171[_0x42c252][_0x3cad('0xd')](0x0,_0x50a681)[_0x3cad('0xe')]();_0x407e1a=_0x5a2171[_0x42c252][_0x3cad('0xd')](_0x50a681+0x1)[_0x3cad('0xe')]();if(_0x1fa20d[_0x3cad('0xb')]>0x0){_0x1af251[_0x1fa20d]=_0x407e1a;}}else{}_0x42c252++;}this['emit'](_0x3cad('0xf'),_0x1af251);this[_0x3cad('0x4')]=!![];}_0x55524d++;}this[_0x3cad('0x3')]=_0x325180;}else{while((_0x294623=_0x325180[_0x3cad('0xa')](_0x15095e))!=-0x1){_0x1f6767=_0x325180[_0x3cad('0x10')](0x0,_0x294623);this[_0x3cad('0x11')](_0x3cad('0x12'),_0x1f6767);_0x325180=_0x325180['substring'](_0x294623+_0x15095e[_0x3cad('0xb')]);}this[_0x3cad('0x3')]=_0x325180;}_0x39463a();};module[_0x3cad('0x13')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 4d74157..227438c 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 _0x8c32=['ShowSmsAccount','createSmsMessage','CreateSmsMessage','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','arg_1','format','createSquareRecording','CreateSquareRecording','CreateSquareMessage','createCmContact','ListId','CreateCmContact','ShowPause','agentLogin','LoginUser','agentLogout','LogoutUser','lodash','moment','jayson/promise','client','http','request','then','error','message','result','catch','getSquareProjects','name','production','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','CloudProvider','email','getSquareProjectById','ShowVariable','getSquareOdbcById','getUserById','ShowUser','getContactByPhone','GetContactByPhone','phone','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x8c32,0x130));var _0x28c3=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x8c32[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0x28c3('0x0'));var moment=require(_0x28c3('0x1'));var jayson=require(_0x28c3('0x2'));var client=jayson[_0x28c3('0x3')][_0x28c3('0x4')]({'port':0x2329});function request(_0xc522d5,_0x36d4ad){return new Promise(function(_0x14a446,_0x2f94e0){return client[_0x28c3('0x5')](_0xc522d5,_0x36d4ad)[_0x28c3('0x6')](function(_0x1c6a52){if(_0x1c6a52['error']){return _0x2f94e0(_0x1c6a52[_0x28c3('0x7')][_0x28c3('0x8')]);}else{return _0x14a446(_0x1c6a52[_0x28c3('0x9')]);}})[_0x28c3('0xa')](function(_0xbaee6f){return _0x2f94e0(_0xbaee6f);});});}exports[_0x28c3('0xb')]=function(){return request('GetSquareProjects',{'options':{'raw':![],'attributes':['id',_0x28c3('0xc'),_0x28c3('0xd')]}});};exports['getSquareProject']=function(_0x509390){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x509390},'attributes':[_0x28c3('0xd')]}});};exports[_0x28c3('0xe')]=function(_0x58e49a){return request(_0x28c3('0xf'),{'options':{'raw':![],'where':{'id':_0x58e49a},'include':[{'model':_0x28c3('0x10'),'as':_0x28c3('0x11'),'include':[{'model':'CloudProvider','as':_0x28c3('0x12')}]}],'attributes':['id',_0x28c3('0xc'),_0x28c3('0x13')],'smtp':!![]}});};exports[_0x28c3('0x14')]=function(_0x41cd05){return request('ShowSquareProject',{'options':{'where':{'id':_0x41cd05},'attributes':[_0x28c3('0xc')]}});};exports['getVoiceQueueById']=function(_0x39dcd7){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x39dcd7},'attributes':[_0x28c3('0xc')]}});};exports['getVariableById']=function(_0x902890){return request(_0x28c3('0x15'),{'options':{'where':{'id':_0x902890},'attributes':['name']}});};exports[_0x28c3('0x16')]=function(_0x5d3664){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x5d3664},'attributes':['dsn']}});};exports[_0x28c3('0x17')]=function(_0xbbff75){return request(_0x28c3('0x18'),{'options':{'where':{'id':_0xbbff75},'attributes':['name']}});};exports[_0x28c3('0x19')]=function(_0x10b4d9){return request(_0x28c3('0x1a'),{'options':{'where':{'phone':_0x10b4d9[_0x28c3('0x1b')]},'attributes':['id']}});};exports[_0x28c3('0x1c')]=function(_0xdf3376){return request(_0x28c3('0x1d'),{'options':{'where':{'id':_0xdf3376},'attributes':[_0x28c3('0xc')]}});};exports[_0x28c3('0x1e')]=function(_0x1ec227){return request(_0x28c3('0x1f'),{'options':{'where':{'id':_0x1ec227},'attributes':[_0x28c3('0x20')]}});};exports[_0x28c3('0x21')]=function(_0xf1bc04){return request(_0x28c3('0x22'),{'options':{'raw':![],'where':{'id':_0xf1bc04},'include':[{'model':_0x28c3('0x23'),'as':_0x28c3('0x24')}]}});};exports[_0x28c3('0x25')]=function(_0x864cc0){return request(_0x28c3('0x26'),{'options':{'where':{'id':_0x864cc0},'attributes':['id',_0x28c3('0xc')]}});};exports[_0x28c3('0x27')]=function(_0x2862d4){return request(_0x28c3('0x28'),{'body':_0x2862d4});};exports['createSquareDetailsReport']=function(_0x312f25){return request(_0x28c3('0x29'),{'body':_0x312f25});};exports[_0x28c3('0x2a')]=function(_0x43409c){return request(_0x28c3('0x2b'),{'body':_['merge'](_0x43409c,{'project_name':_0x43409c[_0x28c3('0x2c')],'prev_project_name':_0x43409c['arg_2']||'','is_subproject':_0x43409c['arg_2']?!![]:![],'leaveAt':moment()[_0x28c3('0x2d')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0x28c3('0x2e')]=function(_0xd494f6){return request(_0x28c3('0x2f'),{'body':_0xd494f6});};exports['createSquareMessage']=function(_0x4077b0){return request(_0x28c3('0x30'),{'body':_0x4077b0});};exports[_0x28c3('0x31')]=function(_0x386fb2){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x386fb2[_0x28c3('0x1b')],'ListId':_0x386fb2[_0x28c3('0x32')]}}})[_0x28c3('0x6')](function(_0x5ed06b){if(_0x5ed06b){return _0x5ed06b;}return request(_0x28c3('0x33'),{'body':_0x386fb2});});};exports['getPauseById']=function(_0x246635){return request(_0x28c3('0x34'),{'options':{'where':{'id':_0x246635},'attributes':[_0x28c3('0xc')]}});};exports[_0x28c3('0x35')]=function(_0x5528b0,_0xd89a79){return request(_0x28c3('0x36'),{'body':{'interface':_0xd89a79},'options':{'where':_0x5528b0}});};exports['agentPause']=function(_0x257be8,_0x13752e,_0xf450ac){return request('PauseUser',{'body':{'type':_0x13752e,'uniqueid':_0xf450ac},'options':{'where':_0x257be8}});};exports['agentUnpause']=function(_0x5d2b27){return request('UnpauseUser',{'body':{},'options':{'where':_0x5d2b27}});};exports[_0x28c3('0x37')]=function(_0x2a60b2){return request(_0x28c3('0x38'),{'body':{},'options':{'where':_0x2a60b2}});}; \ No newline at end of file +var _0xca9e=['getVariableById','ShowVariable','ShowSquareOdbc','getUserById','GetContactByPhone','phone','getSoundById','ShowSound','save_name','ShowInterval','Intervals','ShowSmsAccount','CreateSmsMessage','CreateSquareDetailsReport','createSquareReport','merge','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','getPauseById','ShowPause','agentLogin','LoginUser','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','lodash','moment','jayson/promise','client','http','request','then','error','result','catch','GetSquareProjects','name','production','ShowSquareProject','getMailAccountById','ShowMailAccount','Smtp','CloudProvider','getSquareProjectById','getVoiceQueueById'];(function(_0x2fe7f8,_0x36fdd1){var _0x5bf6d6=function(_0x4d836d){while(--_0x4d836d){_0x2fe7f8['push'](_0x2fe7f8['shift']());}};_0x5bf6d6(++_0x36fdd1);}(_0xca9e,0x136));var _0xeca9=function(_0x20946b,_0x738b4d){_0x20946b=_0x20946b-0x0;var _0x41ed50=_0xca9e[_0x20946b];return _0x41ed50;};'use strict';var _=require(_0xeca9('0x0'));var moment=require(_0xeca9('0x1'));var jayson=require(_0xeca9('0x2'));var client=jayson[_0xeca9('0x3')][_0xeca9('0x4')]({'port':0x2329});function request(_0x1443e3,_0x8dbabb){return new Promise(function(_0x2c6185,_0x1b2864){return client[_0xeca9('0x5')](_0x1443e3,_0x8dbabb)[_0xeca9('0x6')](function(_0x1c4ce6){if(_0x1c4ce6[_0xeca9('0x7')]){return _0x1b2864(_0x1c4ce6[_0xeca9('0x7')]['message']);}else{return _0x2c6185(_0x1c4ce6[_0xeca9('0x8')]);}})[_0xeca9('0x9')](function(_0x4d57ee){return _0x1b2864(_0x4d57ee);});});}exports['getSquareProjects']=function(){return request(_0xeca9('0xa'),{'options':{'raw':![],'attributes':['id',_0xeca9('0xb'),_0xeca9('0xc')]}});};exports['getSquareProject']=function(_0x2dba50){return request(_0xeca9('0xd'),{'options':{'raw':![],'where':{'name':_0x2dba50},'attributes':[_0xeca9('0xc')]}});};exports[_0xeca9('0xe')]=function(_0x19584d){return request(_0xeca9('0xf'),{'options':{'raw':![],'where':{'id':_0x19584d},'include':[{'model':'MailServerOut','as':_0xeca9('0x10'),'include':[{'model':_0xeca9('0x11'),'as':'CloudProvider'}]}],'attributes':['id',_0xeca9('0xb'),'email'],'smtp':!![]}});};exports[_0xeca9('0x12')]=function(_0x5e7e73){return request('ShowSquareProject',{'options':{'where':{'id':_0x5e7e73},'attributes':[_0xeca9('0xb')]}});};exports[_0xeca9('0x13')]=function(_0x1ba9e9){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x1ba9e9},'attributes':[_0xeca9('0xb')]}});};exports[_0xeca9('0x14')]=function(_0x910814){return request(_0xeca9('0x15'),{'options':{'where':{'id':_0x910814},'attributes':['name']}});};exports['getSquareOdbcById']=function(_0x964e05){return request(_0xeca9('0x16'),{'options':{'where':{'id':_0x964e05},'attributes':['dsn']}});};exports[_0xeca9('0x17')]=function(_0x11bf78){return request('ShowUser',{'options':{'where':{'id':_0x11bf78},'attributes':['name']}});};exports['getContactByPhone']=function(_0x132008){return request(_0xeca9('0x18'),{'options':{'where':{'phone':_0x132008[_0xeca9('0x19')]},'attributes':['id']}});};exports['getTrunkById']=function(_0xf1ef9f){return request('ShowTrunk',{'options':{'where':{'id':_0xf1ef9f},'attributes':['name']}});};exports[_0xeca9('0x1a')]=function(_0x5df8e9){return request(_0xeca9('0x1b'),{'options':{'where':{'id':_0x5df8e9},'attributes':[_0xeca9('0x1c')]}});};exports['getIntervalById']=function(_0x5a2cca){return request(_0xeca9('0x1d'),{'options':{'raw':![],'where':{'id':_0x5a2cca},'include':[{'model':'Interval','as':_0xeca9('0x1e')}]}});};exports['getSmsAccountById']=function(_0x3a3608){return request(_0xeca9('0x1f'),{'options':{'where':{'id':_0x3a3608},'attributes':['id',_0xeca9('0xb')]}});};exports['createSmsMessage']=function(_0x3fcfb8){return request(_0xeca9('0x20'),{'body':_0x3fcfb8});};exports['createSquareDetailsReport']=function(_0x4593b5){return request(_0xeca9('0x21'),{'body':_0x4593b5});};exports[_0xeca9('0x22')]=function(_0x26bb0c){return request('CreateSquareReport',{'body':_[_0xeca9('0x23')](_0x26bb0c,{'project_name':_0x26bb0c['arg_1'],'prev_project_name':_0x26bb0c[_0xeca9('0x24')]||'','is_subproject':_0x26bb0c[_0xeca9('0x24')]?!![]:![],'leaveAt':moment()[_0xeca9('0x25')](_0xeca9('0x26'))})});};exports[_0xeca9('0x27')]=function(_0x2f63dc){return request(_0xeca9('0x28'),{'body':_0x2f63dc});};exports[_0xeca9('0x29')]=function(_0x467979){return request(_0xeca9('0x2a'),{'body':_0x467979});};exports[_0xeca9('0x2b')]=function(_0x3b0aab){return request(_0xeca9('0x2c'),{'options':{'raw':![],'where':{'phone':_0x3b0aab[_0xeca9('0x19')],'ListId':_0x3b0aab[_0xeca9('0x2d')]}}})['then'](function(_0x4db3e2){if(_0x4db3e2){return _0x4db3e2;}return request('CreateCmContact',{'body':_0x3b0aab});});};exports[_0xeca9('0x2e')]=function(_0x4ffb8a){return request(_0xeca9('0x2f'),{'options':{'where':{'id':_0x4ffb8a},'attributes':[_0xeca9('0xb')]}});};exports[_0xeca9('0x30')]=function(_0x36e75e,_0x24e96e){return request(_0xeca9('0x31'),{'body':{'interface':_0x24e96e},'options':{'where':_0x36e75e}});};exports['agentPause']=function(_0x3b60c3,_0x5d2451,_0x43fbff){return request(_0xeca9('0x32'),{'body':{'type':_0x5d2451,'uniqueid':_0x43fbff},'options':{'where':_0x3b60c3}});};exports[_0xeca9('0x33')]=function(_0x5ee4a6){return request(_0xeca9('0x34'),{'body':{},'options':{'where':_0x5ee4a6}});};exports[_0xeca9('0x35')]=function(_0x20cd78){return request(_0xeca9('0x36'),{'body':{},'options':{'where':_0x20cd78}});}; \ 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 4376d29..2981351 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 _0xcde7=['exports'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xcde7,0x65));var _0x7cde=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xcde7[_0x178e48];return _0x440d7e;};var polly=require('./polly');var lex=require('./lex');module[_0x7cde('0x0')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x38e4=['./polly','./lex'];(function(_0x45fbef,_0x2414f3){var _0x29ea64=function(_0x54f1e1){while(--_0x54f1e1){_0x45fbef['push'](_0x45fbef['shift']());}};_0x29ea64(++_0x2414f3);}(_0x38e4,0x9e));var _0x438e=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x38e4[_0x2d7f0e];return _0x110b07;};var polly=require(_0x438e('0x0'));var lex=require(_0x438e('0x1'));module['exports']={'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 d8dfdaf..a8a4785 100644 --- a/server/services/agi/scripts/aws/lex/index.js +++ b/server/services/agi/scripts/aws/lex/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['exports','./lib/api'];(function(_0x5ca6b7,_0x1a4f32){var _0x2d7743=function(_0x569d42){while(--_0x569d42){_0x5ca6b7['push'](_0x5ca6b7['shift']());}};_0x2d7743(++_0x1a4f32);}(_0x70e0,0x17b));var _0x070e=function(_0x199e17,_0x7c245e){_0x199e17=_0x199e17-0x0;var _0x2fc68d=_0x70e0[_0x199e17];return _0x2fc68d;};'use strict';var lex=require(_0x070e('0x0'));module[_0x070e('0x1')]=function(_0x198c2e,_0x4d95bb,_0x579b83,_0x16e651,_0xee173,_0x277d32){return lex(_0x198c2e,_0x4d95bb,_0x579b83,_0x16e651,_0xee173,_0x277d32);}; \ No newline at end of file +var _0xee5b=['./lib/api'];(function(_0x2b9371,_0x38baa0){var _0x363feb=function(_0x405f81){while(--_0x405f81){_0x2b9371['push'](_0x2b9371['shift']());}};_0x363feb(++_0x38baa0);}(_0xee5b,0x1f4));var _0xbee5=function(_0x47e319,_0x2187f8){_0x47e319=_0x47e319-0x0;var _0x343fde=_0xee5b[_0x47e319];return _0x343fde;};'use strict';var lex=require(_0xbee5('0x0'));module['exports']=function(_0x7b2344,_0x203bba,_0x4f850a,_0x1893e4,_0x2b93c2,_0x2eb857){return lex(_0x7b2344,_0x203bba,_0x4f850a,_0x1893e4,_0x2b93c2,_0x2eb857);}; \ 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 dc35f29..677c308 100644 --- a/server/services/agi/scripts/aws/lex/lib/api.js +++ b/server/services/agi/scripts/aws/lex/lib/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['LexRuntime','bluebird','aws-sdk','slots','hasOwnProperty'];(function(_0x3a22d4,_0x32437b){var _0x3b86d5=function(_0xa2eade){while(--_0xa2eade){_0x3a22d4['push'](_0x3a22d4['shift']());}};_0x3b86d5(++_0x32437b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'use strict';var BPromise=require(_0x0a9e('0x0'));var AWS=require(_0x0a9e('0x1'));function lexResult(_0x29929c,_0x5dd881){return new BPromise(function(_0x550fbc,_0x18d5c9){_0x29929c['postText'](_0x5dd881,function(_0x333808,_0x432180){if(_0x333808){_0x18d5c9(_0x333808);}if(_0x432180[_0x0a9e('0x2')]){for(const _0x991246 in _0x432180[_0x0a9e('0x2')]){if(_0x432180['slots'][_0x0a9e('0x3')](_0x991246)){var _0x441e3a=_0x432180[_0x0a9e('0x2')][_0x991246];_0x432180['slot_'+_0x991246]=_0x441e3a;}}}_0x550fbc(_0x432180);});});}module['exports']=function(_0xe42b77,_0x56465b,_0x52cace,_0x39753a,_0xf81284,_0x307b3e){var _0x3ab53f=new AWS[(_0x0a9e('0x4'))]({'accessKeyId':_0x56465b,'secretAccessKey':_0x52cace,'region':_0x39753a});var _0xbd1168={'botAlias':'$LATEST','botName':_0x307b3e,'inputText':_0xf81284,'userId':_0xe42b77};return lexResult(_0x3ab53f,_0xbd1168);}; \ No newline at end of file +var _0xa9e0=['LexRuntime','bluebird','aws-sdk','slots','hasOwnProperty'];(function(_0xd05671,_0x48cfa0){var _0x42dad4=function(_0x2a314a){while(--_0x2a314a){_0xd05671['push'](_0xd05671['shift']());}};_0x42dad4(++_0x48cfa0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'use strict';var BPromise=require(_0x0a9e('0x0'));var AWS=require(_0x0a9e('0x1'));function lexResult(_0x29929c,_0x5dd881){return new BPromise(function(_0x550fbc,_0x18d5c9){_0x29929c['postText'](_0x5dd881,function(_0x333808,_0x432180){if(_0x333808){_0x18d5c9(_0x333808);}if(_0x432180[_0x0a9e('0x2')]){for(const _0x991246 in _0x432180[_0x0a9e('0x2')]){if(_0x432180['slots'][_0x0a9e('0x3')](_0x991246)){var _0x441e3a=_0x432180[_0x0a9e('0x2')][_0x991246];_0x432180['slot_'+_0x991246]=_0x441e3a;}}}_0x550fbc(_0x432180);});});}module['exports']=function(_0xe42b77,_0x56465b,_0x52cace,_0x39753a,_0xf81284,_0x307b3e){var _0x3ab53f=new AWS[(_0x0a9e('0x4'))]({'accessKeyId':_0x56465b,'secretAccessKey':_0x52cace,'region':_0x39753a});var _0xbd1168={'botAlias':'$LATEST','botName':_0x307b3e,'inputText':_0xf81284,'userId':_0xe42b77};return lexResult(_0x3ab53f,_0xbd1168);}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/polly/index.js b/server/services/agi/scripts/aws/polly/index.js index 1a3115d..b746a85 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 _0x4a8f=['./lib/api','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4a8f,0x1b6));var _0xf4a8=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0x4a8f[_0x1203f];return _0x365f0a;};'use strict';var polly=require(_0xf4a8('0x0'));module[_0xf4a8('0x1')]=function(_0x1cf2e0,_0x5322d5,_0x470d9f,_0x2097e7,_0x51634c,_0x4fe8fe,_0x4baecb){return polly(_0x1cf2e0,_0x5322d5,_0x470d9f,_0x2097e7,_0x51634c,_0x4fe8fe,_0x4baecb);}; \ No newline at end of file +var _0x24d1=['./lib/api','exports'];(function(_0x1e7ef8,_0x35566a){var _0x5d2873=function(_0x2eb06c){while(--_0x2eb06c){_0x1e7ef8['push'](_0x1e7ef8['shift']());}};_0x5d2873(++_0x35566a);}(_0x24d1,0x10e));var _0x124d=function(_0x1e5023,_0x484b4a){_0x1e5023=_0x1e5023-0x0;var _0x1f4f3e=_0x24d1[_0x1e5023];return _0x1f4f3e;};'use strict';var polly=require(_0x124d('0x0'));module[_0x124d('0x1')]=function(_0x312a1e,_0x26b230,_0x35b88f,_0x4d20d3,_0xc6a01b,_0x3b73fe,_0x1e8342){return polly(_0x312a1e,_0x26b230,_0x35b88f,_0x4d20d3,_0xc6a01b,_0x3b73fe,_0x1e8342);}; \ 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 e181bca..df7696d 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 _0x055e=['exports','Polly','text','mp3','path','bluebird','aws-sdk','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!'];(function(_0x1e2bf4,_0x253c2a){var _0x55d222=function(_0x26839b){while(--_0x26839b){_0x1e2bf4['push'](_0x1e2bf4['shift']());}};_0x55d222(++_0x253c2a);}(_0x055e,0xa9));var _0xe055=function(_0xfa362a,_0x375b88){_0xfa362a=_0xfa362a-0x0;var _0x4e65d0=_0x055e[_0xfa362a];return _0x4e65d0;};'use strict';var fs=require('fs');var path=require(_0xe055('0x0'));var BPromise=require(_0xe055('0x1'));var rs=require('randomstring');var AWS=require(_0xe055('0x2'));function pollyResult(_0x19f605,_0x1f6b9e,_0x6fb41e){return new BPromise(function(_0x2c6b39,_0x5128dc){_0x19f605['synthesizeSpeech'](_0x1f6b9e,function(_0x3fcce0,_0x2e763d){if(_0x3fcce0){_0x5128dc(_0x3fcce0);}else if(_0x2e763d){if(_0x2e763d[_0xe055('0x3')]instanceof Buffer){fs[_0xe055('0x4')](_0x6fb41e,_0x2e763d[_0xe055('0x3')],function(_0x1dfa0d){if(_0x1dfa0d){_0x5128dc(_0x1dfa0d);}else{_0x2c6b39();}});}else{_0x5128dc(new Error(_0xe055('0x5')));}}else{_0x5128dc(new Error(_0xe055('0x6')));}});});}module[_0xe055('0x7')]=function(_0x396b14,_0x51d954,_0x15f9d2,_0x182b34,_0x1545c2,_0x1f7a5c,_0xbcd0d1){var _0xe6d765=new AWS[(_0xe055('0x8'))]({'accessKeyId':_0x396b14,'secretAccessKey':_0x51d954,'region':_0x15f9d2});var _0x34f16a={'Text':_0x1545c2,'TextType':_0x1f7a5c||_0xe055('0x9'),'OutputFormat':_0xe055('0xa'),'VoiceId':_0x182b34};return pollyResult(_0xe6d765,_0x34f16a,_0xbcd0d1);}; \ No newline at end of file +var _0x21cb=['mp3','path','bluebird','randomstring','synthesizeSpeech','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','text'];(function(_0xbfad86,_0x2dba23){var _0x3f1b14=function(_0x232a72){while(--_0x232a72){_0xbfad86['push'](_0xbfad86['shift']());}};_0x3f1b14(++_0x2dba23);}(_0x21cb,0x17d));var _0xb21c=function(_0x158e7d,_0x42bda8){_0x158e7d=_0x158e7d-0x0;var _0x56378f=_0x21cb[_0x158e7d];return _0x56378f;};'use strict';var fs=require('fs');var path=require(_0xb21c('0x0'));var BPromise=require(_0xb21c('0x1'));var rs=require(_0xb21c('0x2'));var AWS=require('aws-sdk');function pollyResult(_0x370eb3,_0x2aeae1,_0x2693e7){return new BPromise(function(_0xa1bfb2,_0x4c802f){_0x370eb3[_0xb21c('0x3')](_0x2aeae1,function(_0x5bcc6c,_0x29ebdb){if(_0x5bcc6c){_0x4c802f(_0x5bcc6c);}else if(_0x29ebdb){if(_0x29ebdb['AudioStream']instanceof Buffer){fs[_0xb21c('0x4')](_0x2693e7,_0x29ebdb['AudioStream'],function(_0x4bba07){if(_0x4bba07){_0x4c802f(_0x4bba07);}else{_0xa1bfb2();}});}else{_0x4c802f(new Error(_0xb21c('0x5')));}}else{_0x4c802f(new Error(_0xb21c('0x6')));}});});}module[_0xb21c('0x7')]=function(_0x2c51b6,_0x4d2625,_0x10a1b3,_0x356af4,_0x59b135,_0x55e7b4,_0x57b6e3){var _0x26c015=new AWS['Polly']({'accessKeyId':_0x2c51b6,'secretAccessKey':_0x4d2625,'region':_0x10a1b3});var _0x1112d2={'Text':_0x59b135,'TextType':_0x55e7b4||_0xb21c('0x8'),'OutputFormat':_0xb21c('0x9'),'VoiceId':_0x356af4};return pollyResult(_0x26c015,_0x1112d2,_0x57b6e3);}; \ 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 c2e3881..7b313a7 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 _0x9ba7=['./lib/api','exports'];(function(_0x153cc1,_0x5db12c){var _0x379189=function(_0x16121e){while(--_0x16121e){_0x153cc1['push'](_0x153cc1['shift']());}};_0x379189(++_0x5db12c);}(_0x9ba7,0x19c));var _0x79ba=function(_0x10dc64,_0x11bb29){_0x10dc64=_0x10dc64-0x0;var _0x9cf98d=_0x9ba7[_0x10dc64];return _0x9cf98d;};'use strict';var asr=require(_0x79ba('0x0'));module[_0x79ba('0x1')]=function(_0xdabc50,_0x5b9839,_0x15b6e6,_0x11f394){return asr(_0xdabc50,_0x5b9839,_0x15b6e6);}; \ No newline at end of file +var _0x9f55=['exports','./lib/api'];(function(_0x49c2be,_0x273b97){var _0x29dc2b=function(_0x28785d){while(--_0x28785d){_0x49c2be['push'](_0x49c2be['shift']());}};_0x29dc2b(++_0x273b97);}(_0x9f55,0x18b));var _0x59f5=function(_0x449c0b,_0x4ae513){_0x449c0b=_0x449c0b-0x0;var _0x528065=_0x9f55[_0x449c0b];return _0x528065;};'use strict';var asr=require(_0x59f5('0x0'));module[_0x59f5('0x1')]=function(_0x43ad21,_0x42da2b,_0x4aec1b,_0x3c91c8){return asr(_0x43ad21,_0x42da2b,_0x4aec1b);}; \ 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 82d838b..0d1e8a3 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 _0xf9f7=['bluebird','https://speech.googleapis.com','exports','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','toString','base64','POST','/v1/speech:recognize?key=','LINEAR16','8000','url'];(function(_0x1272d7,_0x4a893c){var _0x4dd475=function(_0xea8b7e){while(--_0xea8b7e){_0x1272d7['push'](_0x1272d7['shift']());}};_0x4dd475(++_0x4a893c);}(_0xf9f7,0xdf));var _0x7f9f=function(_0x2a4cc6,_0x3ed438){_0x2a4cc6=_0x2a4cc6-0x0;var _0x381547=_0xf9f7[_0x2a4cc6];return _0x381547;};'use strict';var url=require(_0x7f9f('0x0'));var BPromise=require(_0x7f9f('0x1'));var fs=require('fs');var host=_0x7f9f('0x2');module[_0x7f9f('0x3')]=function(_0x37f0ee,_0x9aac07,_0x47f4a7){return new BPromise(function(_0x5c456a,_0x440672){var _0x439585;if(typeof _0x37f0ee!==_0x7f9f('0x4')||_0x37f0ee[_0x7f9f('0x5')]===0x0){return _0x440672(_0x7f9f('0x6'));}if(typeof _0x9aac07!==_0x7f9f('0x4')||_0x9aac07['length']===0x0){return _0x440672(_0x7f9f('0x7'));}if(typeof _0x47f4a7!==_0x7f9f('0x8')&&(typeof _0x47f4a7!==_0x7f9f('0x4')||_0x47f4a7[_0x7f9f('0x5')]===0x0)){return _0x440672(_0x7f9f('0x9'));}try{_0x439585=fs['readFileSync'](_0x37f0ee)[_0x7f9f('0xa')](_0x7f9f('0xb'));}catch(_0x39d8a2){return _0x440672(_0x39d8a2);}return _0x5c456a({'method':_0x7f9f('0xc'),'uri':host+_0x7f9f('0xd')+_0x9aac07,'body':{'config':{'encoding':_0x7f9f('0xe'),'sampleRateHertz':_0x7f9f('0xf'),'languageCode':_0x47f4a7},'audio':{'content':_0x439585}},'json':!![]});});}; \ No newline at end of file +var _0x76dc=['base64','POST','LINEAR16','8000','url','bluebird','https://speech.googleapis.com','exports','length','filepath\x20should\x20be\x20a\x20string','string','undefined','toString'];(function(_0xfb56fb,_0x571dc6){var _0x456697=function(_0x529fda){while(--_0x529fda){_0xfb56fb['push'](_0xfb56fb['shift']());}};_0x456697(++_0x571dc6);}(_0x76dc,0x1f2));var _0xc76d=function(_0x4439ac,_0x20d846){_0x4439ac=_0x4439ac-0x0;var _0x233c3e=_0x76dc[_0x4439ac];return _0x233c3e;};'use strict';var url=require(_0xc76d('0x0'));var BPromise=require(_0xc76d('0x1'));var fs=require('fs');var host=_0xc76d('0x2');module[_0xc76d('0x3')]=function(_0x49c651,_0x2a8b7d,_0x1ba6a1){return new BPromise(function(_0x5cff74,_0x300f11){var _0x50ed3a;if(typeof _0x49c651!=='string'||_0x49c651[_0xc76d('0x4')]===0x0){return _0x300f11(_0xc76d('0x5'));}if(typeof _0x2a8b7d!==_0xc76d('0x6')||_0x2a8b7d['length']===0x0){return _0x300f11('key\x20should\x20be\x20a\x20string');}if(typeof _0x1ba6a1!==_0xc76d('0x7')&&(typeof _0x1ba6a1!==_0xc76d('0x6')||_0x1ba6a1[_0xc76d('0x4')]===0x0)){return _0x300f11('lang\x20should\x20be\x20a\x20string');}try{_0x50ed3a=fs['readFileSync'](_0x49c651)[_0xc76d('0x8')](_0xc76d('0x9'));}catch(_0x4d625c){return _0x300f11(_0x4d625c);}return _0x5cff74({'method':_0xc76d('0xa'),'uri':host+'/v1/speech:recognize?key='+_0x2a8b7d,'body':{'config':{'encoding':_0xc76d('0xb'),'sampleRateHertz':_0xc76d('0xc'),'languageCode':_0x1ba6a1},'audio':{'content':_0x50ed3a}},'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 06c26a6..85560a2 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 _0x89a2=['./asr'];(function(_0x35ba3a,_0x311214){var _0x5a719b=function(_0xc1f2dd){while(--_0xc1f2dd){_0x35ba3a['push'](_0x35ba3a['shift']());}};_0x5a719b(++_0x311214);}(_0x89a2,0x69));var _0x289a=function(_0x4b4b0e,_0x6c674){_0x4b4b0e=_0x4b4b0e-0x0;var _0x4c2d91=_0x89a2[_0x4b4b0e];return _0x4c2d91;};var asr=require(_0x289a('0x0'));module['exports']={'asr':asr}; \ No newline at end of file +var _0x1841=['exports','./asr'];(function(_0xa5dbba,_0x26c6d5){var _0x5f3c63=function(_0x5d49ab){while(--_0x5d49ab){_0xa5dbba['push'](_0xa5dbba['shift']());}};_0x5f3c63(++_0x26c6d5);}(_0x1841,0x113));var _0x1184=function(_0x3257d3,_0x11b2ad){_0x3257d3=_0x3257d3-0x0;var _0x518909=_0x1841[_0x3257d3];return _0x518909;};var asr=require(_0x1184('0x0'));module[_0x1184('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index c79af09..f69a831 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 _0x7e3e=['%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','dirName','bluebird','dialogflow','http','md5','path','querystring','request-promise','randomstring','sox','util','./google','./tilde','../../../config/logger','agi','protocol','https:','host','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','finish','info','close','unlink','download\x20error','pipe','end','WHAT_EVER','data','transcode','wav','error\x20convert','finish\x20to\x20convert','tmp','generate','.wav','writeFileSync','base64','then','chmodSync','777','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','voice','audioConfig','MP3','POST','resolve','.mp3','audioContent','writeFile','googleCloudTTS\x20path','split','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','null','generic','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','goggleTTS\x20path','uri','map','alternatives','transcript','join','results','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','message','googleDialogflow','textRequest','source','resolvedQuery','result','action','actionIncomplete','fulfillment','speech','score','code','metadata','isFallbackIntent','SessionsClient','sessionPath','detectIntent','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','name','intent','displayName','languageCode','queryText','responseId','asr','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR'];(function(_0x1d6b55,_0x43ab65){var _0x1751f9=function(_0x22cc1b){while(--_0x22cc1b){_0x1d6b55['push'](_0x1d6b55['shift']());}};_0x1751f9(++_0x43ab65);}(_0x7e3e,0x8e));var _0xe7e3=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x7e3e[_0x126558];return _0x1f6d14;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0xe7e3('0x0'));var dialogflow=require(_0xe7e3('0x1'));var fs=require('fs');var http=require(_0xe7e3('0x2'));var https=require('https');var md5=require(_0xe7e3('0x3'));var path=require(_0xe7e3('0x4'));var querystring=require(_0xe7e3('0x5'));var rp=require(_0xe7e3('0x6'));var rs=require(_0xe7e3('0x7'));var sox=require(_0xe7e3('0x8'));var tts=require('google-tts-api');var urlParse=require('url')['parse'];var util=require(_0xe7e3('0x9'));var aws=require('./aws');var google=require(_0xe7e3('0xa'));var sestek=require('./sestek');var tilde=require(_0xe7e3('0xb'));var logger=require(_0xe7e3('0xc'))(_0xe7e3('0xd'));var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x52ec57,_0x7cc11b){return new BPromise(function(_0x1d2e88,_0x49cfce){var _0xe70ae7=urlParse(_0x52ec57);var _0x30ab2d=_0xe70ae7[_0xe7e3('0xe')]===_0xe7e3('0xf')?https:http;var _0x51b356={'host':_0xe70ae7[_0xe7e3('0x10')],'path':_0xe70ae7[_0xe7e3('0x4')],'headers':{'user-agent':'WHAT_EVER'}};_0x30ab2d[_0xe7e3('0x11')](_0x51b356,function(_0x2d98eb){if(_0x2d98eb[_0xe7e3('0x12')]!==0xc8){logger[_0xe7e3('0x13')](_0xe7e3('0x14')+_0x52ec57+_0xe7e3('0x15')+_0x2d98eb[_0xe7e3('0x12')]+'\x20('+_0x2d98eb[_0xe7e3('0x16')]+')');_0x49cfce(new Error(_0xe7e3('0x14')+_0x52ec57+_0xe7e3('0x15')+_0x2d98eb[_0xe7e3('0x12')]+'\x20('+_0x2d98eb['statusMessage']+')'));return;}var _0x370311=fs['createWriteStream'](_0x7cc11b);_0x370311['on'](_0xe7e3('0x17'),function(){logger[_0xe7e3('0x18')]('finish\x20download\x20file');_0x370311[_0xe7e3('0x19')](_0x1d2e88);});_0x370311['on'](_0xe7e3('0x13'),function(_0x454487){fs[_0xe7e3('0x1a')](_0x7cc11b);logger[_0xe7e3('0x13')](_0xe7e3('0x1b'),_0x454487);_0x49cfce(_0x454487);});_0x2d98eb[_0xe7e3('0x1c')](_0x370311);})['on'](_0xe7e3('0x13'),function(_0x3e37b6){logger[_0xe7e3('0x13')](_0x3e37b6);_0x49cfce(_0x3e37b6);})[_0xe7e3('0x1d')]();});}function uploadFile(_0xfcf528){return new BPromise(function(_0x4107e4,_0x33e2a2){var _0x381279=urlParse(_0xfcf528);var _0x1b1a76=_0x381279['protocol']===_0xe7e3('0xf')?https:http;var _0x2e87a3={'host':_0x381279['host'],'path':_0x381279[_0xe7e3('0x4')],'headers':{'user-agent':_0xe7e3('0x1e')}};_0x1b1a76['get'](_0x2e87a3,function(_0x442b12){if(_0x442b12[_0xe7e3('0x12')]!==0xc8){_0x33e2a2(new Error('request\x20to\x20'+_0xfcf528+_0xe7e3('0x15')+_0x442b12[_0xe7e3('0x12')]+'\x20('+_0x442b12[_0xe7e3('0x16')]+')'));return;}var _0x148000='';_0x442b12['on'](_0xe7e3('0x1f'),function(_0x3446d6){_0x148000+=_0x3446d6;});_0x442b12['on'](_0xe7e3('0x1d'),function(){_0x4107e4(_0x148000);});})['on'](_0xe7e3('0x13'),function(_0x4013bc){_0x33e2a2(_0x4013bc);})[_0xe7e3('0x1d')]();});}function convertFile(_0x22e2a8,_0x35a1be){return new BPromise(function(_0x1d1c5f,_0x3725b3){var _0x434acf=sox[_0xe7e3('0x20')](_0x22e2a8,_0x35a1be,{'sampleRate':0x1f40,'format':_0xe7e3('0x21'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x434acf['on'](_0xe7e3('0x13'),function(_0x387d9e){logger['error'](_0xe7e3('0x22'),_0x387d9e);_0x3725b3(_0x387d9e);});_0x434acf['on'](_0xe7e3('0x1d'),function(){logger['info'](_0xe7e3('0x23'));_0x1d1c5f();});_0x434acf['start']();});}function base64Decode(_0x158a8c,_0x3e7243){var _0x5e11f2=path['resolve'](__dirname,_0xe7e3('0x24'),rs[_0xe7e3('0x25')](0x4)+_0xe7e3('0x26'));fs[_0xe7e3('0x27')](_0x5e11f2,_0x158a8c,_0xe7e3('0x28'));return convertFile(_0x5e11f2,_0x3e7243)[_0xe7e3('0x29')](function(){try{fs['unlink'](_0x5e11f2);fs[_0xe7e3('0x2a')](_0x3e7243,_0xe7e3('0x2b'));}catch(_0x23d2b3){logger[_0xe7e3('0x13')](_0x23d2b3);}return _0x3e7243['split']('.')[0x0];});}function base64Encode(_0x4ede4d){var _0x306081=fs[_0xe7e3('0x2c')](_0x4ede4d);return new Buffer(_0x306081)[_0xe7e3('0x2d')](_0xe7e3('0x28'));}exports[_0xe7e3('0x2e')]=function(_0x178198,_0x59b218,_0x1a561f,_0x579ca5,_0x4b0088,_0x2bc36d){var _0x1325aa,_0x2d9167;var _0x601720=_0xe7e3('0x2f');var _0x27132c='?key='+_0x178198;var _0x5da196={};if(_0x59b218==='ssml'){_0x5da196['input']={'ssml':_0x1a561f};}else{_0x5da196['input']={'text':_0x1a561f};};_0x5da196[_0xe7e3('0x30')]={'languageCode':_0x579ca5,'ssmlGender':_0x4b0088};_0x5da196[_0xe7e3('0x31')]={'audioEncoding':_0xe7e3('0x32'),'sampleRateHertz':0x1f40};var _0x3b00a1={'url':_0x601720+'text:synthesize'+_0x27132c,'method':_0xe7e3('0x33'),'json':!![],'body':_0x5da196};return rp(_0x3b00a1)[_0xe7e3('0x29')](function(_0x269ed9){return new BPromise(function(_0x12e304,_0x162a5d){_0x1325aa=path[_0xe7e3('0x34')](__dirname,'tmp',rs[_0xe7e3('0x25')](0x4)+_0xe7e3('0x35'));var _0x3bc7c5=Buffer['from'](_0x269ed9[_0xe7e3('0x36')],'base64');return fs[_0xe7e3('0x37')](_0x1325aa,_0x3bc7c5,function(_0x17c548){_0x162a5d(_0x17c548);},function(_0x5e7751){fs[_0xe7e3('0x2a')](_0x1325aa,_0xe7e3('0x2b'));_0x12e304(_0x5e7751);});});})[_0xe7e3('0x29')](function(_0x445ba0){_0x2d9167=path[_0xe7e3('0x34')](__dirname,_0xe7e3('0x24'),rs[_0xe7e3('0x25')](0x4)+'.wav');return convertFile(_0x1325aa,_0x2d9167);})[_0xe7e3('0x29')](function(){try{fs[_0xe7e3('0x1a')](_0x1325aa);fs[_0xe7e3('0x2a')](_0x2d9167,_0xe7e3('0x2b'));}catch(_0x2e6133){logger[_0xe7e3('0x13')](_0x2e6133);}logger[_0xe7e3('0x18')](_0xe7e3('0x38'),_0x2d9167[_0xe7e3('0x39')]('.')[0x0]);return _0x2d9167[_0xe7e3('0x39')]('.')[0x0];});};exports['googleTTS']=function(_0x905888,_0x4cb86b){var _0x323a19=_0xe7e3('0x3a');var _0x2b78c0,_0x1c0299;var _0x1aa43a;var _0x243b10={'encoding':_0xe7e3('0x3b'),'method':_0xe7e3('0x33'),'timeout':0x2710,'url':_0x323a19,'headers':{'Content-Type':_0xe7e3('0x3c')},'body':_0xe7e3('0x3d')+encodeURIComponent(JSON[_0xe7e3('0x3e')]([[[_0xe7e3('0x3f'),JSON[_0xe7e3('0x3e')]([_0x905888,_0x4cb86b||'en',![],_0xe7e3('0x40')]),null,_0xe7e3('0x41')]]]))};return rp(_0x243b10)[_0xe7e3('0x29')](function(_0x33ece4){try{_0x1aa43a=eval(_0x33ece4['slice'](0x5))[0x0][0x2];}catch(_0x7b5b73){throw new Error(_0xe7e3('0x42')+_0x33ece4[_0xe7e3('0x1f')]);}if(!_0x1aa43a){if(_0x905888[_0xe7e3('0x43')]>0xc8){throw new Error(_0xe7e3('0x44'));}else{throw new Error(_0xe7e3('0x45')+_0x4cb86b+_0xe7e3('0x46'));}}try{_0x1aa43a=eval(_0x1aa43a)[0x0];}catch(_0x17c998){throw new Error(_0xe7e3('0x42')+res[_0xe7e3('0x1f')]);}const _0x103f55=_0x1aa43a;_0x2b78c0=path[_0xe7e3('0x34')](__dirname,_0xe7e3('0x24'),rs[_0xe7e3('0x25')](0x4)+'.mp3');fs[_0xe7e3('0x27')](_0x2b78c0,_0x1aa43a,{'encoding':_0xe7e3('0x28')});_0x1c0299=path[_0xe7e3('0x34')](__dirname,'tmp',rs[_0xe7e3('0x25')](0x4)+'.wav');return convertFile(_0x2b78c0,_0x1c0299);})[_0xe7e3('0x29')](function(){try{fs[_0xe7e3('0x1a')](_0x2b78c0);fs[_0xe7e3('0x2a')](_0x1c0299,_0xe7e3('0x2b'));}catch(_0x20344e){logger['error'](_0x20344e);}logger[_0xe7e3('0x18')](_0xe7e3('0x47'),_0x1c0299['split']('.')[0x0]);return _0x1c0299[_0xe7e3('0x39')]('.')[0x0];});};exports['googleASR']=function(_0x58b664,_0x456bf5,_0x5a93cb){return google['asr'](_0x58b664,_0x456bf5,_0x5a93cb)[_0xe7e3('0x29')](function(_0x29e21c){logger[_0xe7e3('0x18')](_0x29e21c[_0xe7e3('0x48')]);return rp(_0x29e21c);})[_0xe7e3('0x29')](function(_0x232a5f){var _0x19f3df='';var _0x1835e4=0x0;try{fs[_0xe7e3('0x1a')](_0x58b664);}catch(_0x4ec6bc){logger[_0xe7e3('0x13')](_0x4ec6bc);}if(_0x232a5f&&_0x232a5f['results']){_0x19f3df=_0x232a5f['results'][_0xe7e3('0x49')](function(_0x3db9d8){return _0x3db9d8&&_0x3db9d8['alternatives'][0x0]&&_0x3db9d8[_0xe7e3('0x4a')][0x0][_0xe7e3('0x4b')]?_0x3db9d8[_0xe7e3('0x4a')][0x0][_0xe7e3('0x4b')]:'';})[_0xe7e3('0x4c')]('\x0a');_0x1835e4=_0x232a5f[_0xe7e3('0x4d')][_0xe7e3('0x49')](function(_0x50c135){return _0x50c135&&_0x50c135[_0xe7e3('0x4a')][0x0]&&_0x50c135[_0xe7e3('0x4a')][0x0][_0xe7e3('0x4e')]?_0x50c135[_0xe7e3('0x4a')][0x0][_0xe7e3('0x4e')]:0x0;})[_0xe7e3('0x4c')]('\x0a');}logger['info'](_0xe7e3('0x4f'),_0x19f3df);logger[_0xe7e3('0x18')](_0xe7e3('0x50'),_0x1835e4);return{'transcript':_0x19f3df,'confidence':_0x1835e4};})[_0xe7e3('0x51')](function(_0x25c4c1){logger['error'](_0xe7e3('0x52'),_0x25c4c1[_0xe7e3('0x12')],_0x25c4c1['name'],_0x25c4c1[_0xe7e3('0x53')]);});};exports[_0xe7e3('0x54')]=function(_0x44a148,_0x507b16,_0x1fbe3d,_0x5db1a9){var _0x5b35f4=apiai(_0x507b16,{'language':_0x5db1a9||'en'});return _0x5b35f4[_0xe7e3('0x55')](_0x1fbe3d,{'sessionId':md5(_0x44a148)})[_0xe7e3('0x29')](function(_0x5d29eb){logger[_0xe7e3('0x18')](JSON[_0xe7e3('0x3e')](_0x5d29eb));return{'source':_0x5d29eb['result'][_0xe7e3('0x56')],'resolvedQuery':_0x5d29eb['result'][_0xe7e3('0x57')],'action':_0x5d29eb[_0xe7e3('0x58')][_0xe7e3('0x59')],'actionIncomplete':_0x5d29eb[_0xe7e3('0x58')][_0xe7e3('0x5a')],'speech':_0x5d29eb['result'][_0xe7e3('0x5b')][_0xe7e3('0x5c')],'score':_0x5d29eb[_0xe7e3('0x58')][_0xe7e3('0x5d')],'statusCode':_0x5d29eb['status'][_0xe7e3('0x5e')],'endConversation':_0x5d29eb[_0xe7e3('0x58')][_0xe7e3('0x5f')]['endConversation']||![],'isFallbackIntent':_0x5d29eb[_0xe7e3('0x58')][_0xe7e3('0x5f')][_0xe7e3('0x60')]};});};exports['googleDialogflowV2']=function(_0x20a940,_0x1ea6ff,_0x3262a9,_0x44059f,_0x52daea,_0x5baf53){var _0x37c0e5=_0x44059f['replace'](/\\n/g,'\x0a');var _0x31b701={'credentials':{'private_key':_0x37c0e5,'client_email':_0x3262a9}};var _0x426a49=new dialogflow[(_0xe7e3('0x61'))](_0x31b701);var _0x43d8c1=_0x426a49[_0xe7e3('0x62')](_0x1ea6ff,md5(_0x20a940));var _0x565705={'session':_0x43d8c1,'queryInput':{'text':{'text':_0x52daea,'languageCode':_0x5baf53}}};return _0x426a49[_0xe7e3('0x63')](_0x565705)['then'](function(_0x110145){if(_0x110145&&_0x110145[_0xe7e3('0x43')]){logger[_0xe7e3('0x18')]('Dialogflow\x20V2\x20response:',JSON[_0xe7e3('0x3e')](_0x110145));var _0x1fbed8=_0x110145[0x0];if(_0x1fbed8){var _0x26d2d4={'action':_0x1fbed8[_0xe7e3('0x64')][_0xe7e3('0x59')],'allRequiredParamsPresent':_0x1fbed8[_0xe7e3('0x64')][_0xe7e3('0x65')],'endConversation':_0x1fbed8['queryResult'][_0xe7e3('0x66')]&&_0x1fbed8[_0xe7e3('0x64')][_0xe7e3('0x66')][_0xe7e3('0x67')]?_0x1fbed8[_0xe7e3('0x64')]['diagnosticInfo'][_0xe7e3('0x67')][_0xe7e3('0x68')][_0xe7e3('0x69')]:![],'fulfillmentText':_0x1fbed8[_0xe7e3('0x64')][_0xe7e3('0x6a')],'intentName':_0x1fbed8['queryResult']['intent'][_0xe7e3('0x6b')],'intentDisplayName':_0x1fbed8['queryResult'][_0xe7e3('0x6c')][_0xe7e3('0x6d')],'isFallbackIntent':_0x1fbed8['queryResult']['intent']['isFallback'],'languageCode':_0x1fbed8['queryResult'][_0xe7e3('0x6e')],'queryText':_0x1fbed8[_0xe7e3('0x64')][_0xe7e3('0x6f')],'responseId':_0x1fbed8[_0xe7e3('0x70')],'score':_0x1fbed8[_0xe7e3('0x64')]['intentDetectionConfidence'],'speech':_0x1fbed8[_0xe7e3('0x64')]['fulfillmentText'],'providerResponse':JSON[_0xe7e3('0x3e')](_0x110145)};return _0x26d2d4;}}});};exports['tildeASR']=function(_0x1536b6,_0x887cbe,_0x288e10,_0xecea62){return tilde[_0xe7e3('0x71')](_0x1536b6,_0x887cbe,_0x288e10,_0xecea62)[_0xe7e3('0x29')](function(_0x7f3542){try{fs[_0xe7e3('0x1a')](_0x1536b6);}catch(_0x218a84){logger[_0xe7e3('0x13')](_0x218a84);}logger[_0xe7e3('0x18')]('Tilde\x20ASR\x20transcription',_0x7f3542[_0xe7e3('0x4b')]);logger['info'](_0xe7e3('0x72'),_0x7f3542[_0xe7e3('0x4e')]);return _0x7f3542;});};exports[_0xe7e3('0x73')]=function(_0x184926,_0x34eff1,_0x3c2c79,_0x109f72,_0x18673b,_0x3d1994){var _0x1a7cdd=path[_0xe7e3('0x34')](__dirname,'tmp',rs['generate'](0x4)+_0xe7e3('0x35'));var _0x5d1973;return aws[_0xe7e3('0x74')](_0x184926,_0x34eff1,_0x3c2c79,_0x109f72,_0x18673b,_0x3d1994,_0x1a7cdd)[_0xe7e3('0x29')](function(){_0x5d1973=path['resolve'](__dirname,_0xe7e3('0x24'),rs[_0xe7e3('0x25')](0x4)+'.wav');return convertFile(_0x1a7cdd,_0x5d1973);})['then'](function(){try{fs[_0xe7e3('0x1a')](_0x1a7cdd);fs[_0xe7e3('0x2a')](_0x5d1973,_0xe7e3('0x2b'));}catch(_0x3be044){logger[_0xe7e3('0x13')](_0x3be044);}return _0x5d1973[_0xe7e3('0x39')]('.')[0x0];});};exports[_0xe7e3('0x75')]=function(_0x4aee36,_0x30c542,_0x351c63,_0x4125d1,_0x199a53,_0x57145a){return aws['lex'](_0x4aee36,_0x30c542,_0x351c63,_0x4125d1,_0x199a53,_0x57145a)[_0xe7e3('0x29')](function(_0xee8b7){logger['info'](JSON[_0xe7e3('0x3e')](_0xee8b7));return _0xee8b7;});};exports[_0xe7e3('0x76')]=function(_0xb3b447,_0xd0775d,_0x74d744,_0x303988){var _0x4c01ae=util[_0xe7e3('0x77')](_0xe7e3('0x78'),ISPEECH_API,_0xb3b447,encodeURIComponent(_0xd0775d),_0x74d744,_0x303988);var _0x45af72=path[_0xe7e3('0x34')](__dirname,_0xe7e3('0x24'),rs['generate'](0x4)+'.mp3');var _0x130b90;return downloadFile(_0x4c01ae,_0x45af72)[_0xe7e3('0x29')](function(){_0x130b90=path['resolve'](__dirname,_0xe7e3('0x24'),rs[_0xe7e3('0x25')](0x4)+'.wav');return convertFile(_0x45af72,_0x130b90);})[_0xe7e3('0x29')](function(){try{fs[_0xe7e3('0x1a')](_0x45af72);fs[_0xe7e3('0x2a')](_0x130b90,'777');}catch(_0x2129e1){logger['error'](_0x2129e1);}return _0x130b90[_0xe7e3('0x39')]('.')[0x0];});};exports[_0xe7e3('0x79')]=function(_0x4251db,_0x55b1a9,_0x2c9715,_0x3ecab2){var _0x50adff=util[_0xe7e3('0x77')](_0xe7e3('0x7a'),ISPEECH_API,_0x55b1a9,_0x2c9715,base64Encode(_0x4251db),_0x3ecab2?util['format'](_0xe7e3('0x7b'),encodeURIComponent(_0x3ecab2)):_0xe7e3('0x7c'));return uploadFile(_0x50adff)[_0xe7e3('0x29')](function(_0x4f0e87){return querystring['parse'](_0x4f0e87);});};exports[_0xe7e3('0x7d')]=function(_0x4441ad,_0x148bd6){return sestek['nda'](_0x4441ad,_0x148bd6)[_0xe7e3('0x29')](function(_0x48def6){logger[_0xe7e3('0x18')](JSON[_0xe7e3('0x3e')](_0x48def6));var _0x28fe21={'speech':_0x48def6[_0xe7e3('0x7e')],'action':_0x48def6[_0xe7e3('0x7f')]?_0x48def6[_0xe7e3('0x7f')][_0xe7e3('0x80')]:undefined,'actiondata':_0x48def6['channelData']?_0x48def6[_0xe7e3('0x7f')][_0xe7e3('0x81')]:undefined};if(_0x48def6[_0xe7e3('0x7f')]&&_0x48def6[_0xe7e3('0x7f')][_0xe7e3('0x82')]){return base64Decode(_0x48def6[_0xe7e3('0x7f')]['AudioFromTts']['Data'],path['resolve'](__dirname,_0xe7e3('0x24'),rs[_0xe7e3('0x25')](0x4)+_0xe7e3('0x26')))[_0xe7e3('0x29')](function(_0x3cd2a8){_0x28fe21['audiofile']=_0x3cd2a8;return _0x28fe21;});}return _0x28fe21;});};exports[_0xe7e3('0x83')]=function(){return __dirname;}; \ No newline at end of file +var _0xb717=['./aws','./google','./sestek','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','host','WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','unlink','pipe','end','transcode','wav','error\x20convert','start','resolve','tmp','generate','writeFileSync','base64','then','chmodSync','777','split','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','input','voice','MP3','text:synthesize','POST','.mp3','audioContent','.wav','googleCloudTTS\x20path','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','null','slice','parse\x20response\x20failed:\x0a','data','length','\x22\x20might\x20not\x20exist','goggleTTS\x20path','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','name','message','googleDialogflow','result','source','resolvedQuery','actionIncomplete','fulfillment','code','metadata','endConversation','googleDialogflowV2','SessionsClient','sessionPath','Dialogflow\x20V2\x20response:','queryResult','action','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','isFallback','queryText','responseId','intentDetectionConfidence','tildeASR','awsPolly','polly','awsLex','lex','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','format','freeform=3','sestekNDA','nda','text','CustomAction','channelData','AudioFromTts','Data','audiofile','dirName','apiai-promise','bluebird','dialogflow','http','https','path','querystring','randomstring','sox','google-tts-api','url','parse','util'];(function(_0x1d87fc,_0x1e5321){var _0x492b56=function(_0x4c6b16){while(--_0x4c6b16){_0x1d87fc['push'](_0x1d87fc['shift']());}};_0x492b56(++_0x1e5321);}(_0xb717,0x17c));var _0x7b71=function(_0xcf1fa9,_0x55b48d){_0xcf1fa9=_0xcf1fa9-0x0;var _0x511c10=_0xb717[_0xcf1fa9];return _0x511c10;};'use strict';var apiai=require(_0x7b71('0x0'));var BPromise=require(_0x7b71('0x1'));var dialogflow=require(_0x7b71('0x2'));var fs=require('fs');var http=require(_0x7b71('0x3'));var https=require(_0x7b71('0x4'));var md5=require('md5');var path=require(_0x7b71('0x5'));var querystring=require(_0x7b71('0x6'));var rp=require('request-promise');var rs=require(_0x7b71('0x7'));var sox=require(_0x7b71('0x8'));var tts=require(_0x7b71('0x9'));var urlParse=require(_0x7b71('0xa'))[_0x7b71('0xb')];var util=require(_0x7b71('0xc'));var aws=require(_0x7b71('0xd'));var google=require(_0x7b71('0xe'));var sestek=require(_0x7b71('0xf'));var tilde=require(_0x7b71('0x10'));var logger=require(_0x7b71('0x11'))(_0x7b71('0x12'));var ISPEECH_API=_0x7b71('0x13');function downloadFile(_0x403024,_0x207084){return new BPromise(function(_0x4cc14d,_0x1ad5c4){var _0x387716=urlParse(_0x403024);var _0x4085a1=_0x387716[_0x7b71('0x14')]===_0x7b71('0x15')?https:http;var _0x3fe2d6={'host':_0x387716[_0x7b71('0x16')],'path':_0x387716['path'],'headers':{'user-agent':_0x7b71('0x17')}};_0x4085a1[_0x7b71('0x18')](_0x3fe2d6,function(_0x3c1cbf){if(_0x3c1cbf[_0x7b71('0x19')]!==0xc8){logger[_0x7b71('0x1a')](_0x7b71('0x1b')+_0x403024+_0x7b71('0x1c')+_0x3c1cbf[_0x7b71('0x19')]+'\x20('+_0x3c1cbf[_0x7b71('0x1d')]+')');_0x1ad5c4(new Error(_0x7b71('0x1b')+_0x403024+'\x20failed,\x20status\x20code\x20=\x20'+_0x3c1cbf['statusCode']+'\x20('+_0x3c1cbf['statusMessage']+')'));return;}var _0x547b1f=fs[_0x7b71('0x1e')](_0x207084);_0x547b1f['on'](_0x7b71('0x1f'),function(){logger[_0x7b71('0x20')](_0x7b71('0x21'));_0x547b1f['close'](_0x4cc14d);});_0x547b1f['on'](_0x7b71('0x1a'),function(_0x2acf5a){fs[_0x7b71('0x22')](_0x207084);logger[_0x7b71('0x1a')]('download\x20error',_0x2acf5a);_0x1ad5c4(_0x2acf5a);});_0x3c1cbf[_0x7b71('0x23')](_0x547b1f);})['on'](_0x7b71('0x1a'),function(_0x2058b4){logger[_0x7b71('0x1a')](_0x2058b4);_0x1ad5c4(_0x2058b4);})[_0x7b71('0x24')]();});}function uploadFile(_0x252f7d){return new BPromise(function(_0x30ba8b,_0x87edd6){var _0x1cfc26=urlParse(_0x252f7d);var _0x43026c=_0x1cfc26['protocol']===_0x7b71('0x15')?https:http;var _0xe16536={'host':_0x1cfc26[_0x7b71('0x16')],'path':_0x1cfc26[_0x7b71('0x5')],'headers':{'user-agent':_0x7b71('0x17')}};_0x43026c['get'](_0xe16536,function(_0x1c6eeb){if(_0x1c6eeb[_0x7b71('0x19')]!==0xc8){_0x87edd6(new Error(_0x7b71('0x1b')+_0x252f7d+_0x7b71('0x1c')+_0x1c6eeb[_0x7b71('0x19')]+'\x20('+_0x1c6eeb['statusMessage']+')'));return;}var _0x163484='';_0x1c6eeb['on']('data',function(_0xb7f3ab){_0x163484+=_0xb7f3ab;});_0x1c6eeb['on'](_0x7b71('0x24'),function(){_0x30ba8b(_0x163484);});})['on'](_0x7b71('0x1a'),function(_0xb6b5a8){_0x87edd6(_0xb6b5a8);})[_0x7b71('0x24')]();});}function convertFile(_0x67311e,_0x5f5995){return new BPromise(function(_0x35873b,_0x425863){var _0x1df13b=sox[_0x7b71('0x25')](_0x67311e,_0x5f5995,{'sampleRate':0x1f40,'format':_0x7b71('0x26'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x1df13b['on'](_0x7b71('0x1a'),function(_0x50af72){logger[_0x7b71('0x1a')](_0x7b71('0x27'),_0x50af72);_0x425863(_0x50af72);});_0x1df13b['on']('end',function(){logger[_0x7b71('0x20')]('finish\x20to\x20convert');_0x35873b();});_0x1df13b[_0x7b71('0x28')]();});}function base64Decode(_0x3cc924,_0x23fa67){var _0x3d274d=path[_0x7b71('0x29')](__dirname,_0x7b71('0x2a'),rs[_0x7b71('0x2b')](0x4)+'.wav');fs[_0x7b71('0x2c')](_0x3d274d,_0x3cc924,_0x7b71('0x2d'));return convertFile(_0x3d274d,_0x23fa67)[_0x7b71('0x2e')](function(){try{fs[_0x7b71('0x22')](_0x3d274d);fs[_0x7b71('0x2f')](_0x23fa67,_0x7b71('0x30'));}catch(_0xccfb86){logger[_0x7b71('0x1a')](_0xccfb86);}return _0x23fa67[_0x7b71('0x31')]('.')[0x0];});}function base64Encode(_0x1ca6cb){var _0x4ac2c3=fs['readFileSync'](_0x1ca6cb);return new Buffer(_0x4ac2c3)[_0x7b71('0x32')](_0x7b71('0x2d'));}exports[_0x7b71('0x33')]=function(_0x2c94fb,_0x1f68c9,_0x1b8e31,_0x492fd7,_0x44e23f,_0x214f94){var _0x4c1c56,_0x4c6b14;var _0x21d8f3=_0x7b71('0x34');var _0x293851=_0x7b71('0x35')+_0x2c94fb;var _0x13bd89={};if(_0x1f68c9==='ssml'){_0x13bd89[_0x7b71('0x36')]={'ssml':_0x1b8e31};}else{_0x13bd89[_0x7b71('0x36')]={'text':_0x1b8e31};};_0x13bd89[_0x7b71('0x37')]={'languageCode':_0x492fd7,'ssmlGender':_0x44e23f};_0x13bd89['audioConfig']={'audioEncoding':_0x7b71('0x38'),'sampleRateHertz':0x1f40};var _0x12a455={'url':_0x21d8f3+_0x7b71('0x39')+_0x293851,'method':_0x7b71('0x3a'),'json':!![],'body':_0x13bd89};return rp(_0x12a455)[_0x7b71('0x2e')](function(_0x1e4c04){return new BPromise(function(_0x3666e1,_0x51b4a2){_0x4c1c56=path[_0x7b71('0x29')](__dirname,_0x7b71('0x2a'),rs['generate'](0x4)+_0x7b71('0x3b'));var _0x371474=Buffer['from'](_0x1e4c04[_0x7b71('0x3c')],_0x7b71('0x2d'));return fs['writeFile'](_0x4c1c56,_0x371474,function(_0x30e4c4){_0x51b4a2(_0x30e4c4);},function(_0x32bbc7){fs[_0x7b71('0x2f')](_0x4c1c56,_0x7b71('0x30'));_0x3666e1(_0x32bbc7);});});})[_0x7b71('0x2e')](function(_0x787b06){_0x4c6b14=path[_0x7b71('0x29')](__dirname,_0x7b71('0x2a'),rs[_0x7b71('0x2b')](0x4)+_0x7b71('0x3d'));return convertFile(_0x4c1c56,_0x4c6b14);})[_0x7b71('0x2e')](function(){try{fs[_0x7b71('0x22')](_0x4c1c56);fs[_0x7b71('0x2f')](_0x4c6b14,_0x7b71('0x30'));}catch(_0x21bdd8){logger[_0x7b71('0x1a')](_0x21bdd8);}logger[_0x7b71('0x20')](_0x7b71('0x3e'),_0x4c6b14[_0x7b71('0x31')]('.')[0x0]);return _0x4c6b14[_0x7b71('0x31')]('.')[0x0];});};exports['googleTTS']=function(_0x39058c,_0x542410){var _0x3bb61c=_0x7b71('0x3f');var _0x2abee9,_0x202e71;var _0x19ef49;var _0x3bb8ce={'encoding':'utf8','method':_0x7b71('0x3a'),'timeout':0x2710,'url':_0x3bb61c,'headers':{'Content-Type':_0x7b71('0x40')},'body':_0x7b71('0x41')+encodeURIComponent(JSON[_0x7b71('0x42')]([[[_0x7b71('0x43'),JSON[_0x7b71('0x42')]([_0x39058c,_0x542410||'en',![],_0x7b71('0x44')]),null,'generic']]]))};return rp(_0x3bb8ce)[_0x7b71('0x2e')](function(_0x9fc2c7){try{_0x19ef49=eval(_0x9fc2c7[_0x7b71('0x45')](0x5))[0x0][0x2];}catch(_0x1f3c3c){throw new Error(_0x7b71('0x46')+_0x9fc2c7[_0x7b71('0x47')]);}if(!_0x19ef49){if(_0x39058c[_0x7b71('0x48')]>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error('lang\x20\x22'+_0x542410+_0x7b71('0x49'));}}try{_0x19ef49=eval(_0x19ef49)[0x0];}catch(_0x131aca){throw new Error(_0x7b71('0x46')+res[_0x7b71('0x47')]);}const _0x11d8f8=_0x19ef49;_0x2abee9=path[_0x7b71('0x29')](__dirname,_0x7b71('0x2a'),rs[_0x7b71('0x2b')](0x4)+_0x7b71('0x3b'));fs[_0x7b71('0x2c')](_0x2abee9,_0x19ef49,{'encoding':'base64'});_0x202e71=path['resolve'](__dirname,'tmp',rs[_0x7b71('0x2b')](0x4)+_0x7b71('0x3d'));return convertFile(_0x2abee9,_0x202e71);})[_0x7b71('0x2e')](function(){try{fs[_0x7b71('0x22')](_0x2abee9);fs['chmodSync'](_0x202e71,_0x7b71('0x30'));}catch(_0x2179b6){logger['error'](_0x2179b6);}logger[_0x7b71('0x20')](_0x7b71('0x4a'),_0x202e71[_0x7b71('0x31')]('.')[0x0]);return _0x202e71[_0x7b71('0x31')]('.')[0x0];});};exports['googleASR']=function(_0x397a62,_0x37db81,_0x4a76db){return google[_0x7b71('0x4b')](_0x397a62,_0x37db81,_0x4a76db)['then'](function(_0xfc3a12){logger[_0x7b71('0x20')](_0xfc3a12[_0x7b71('0x4c')]);return rp(_0xfc3a12);})[_0x7b71('0x2e')](function(_0x26085){var _0x3f96fb='';var _0x1efbfa=0x0;try{fs[_0x7b71('0x22')](_0x397a62);}catch(_0x296633){logger[_0x7b71('0x1a')](_0x296633);}if(_0x26085&&_0x26085[_0x7b71('0x4d')]){_0x3f96fb=_0x26085[_0x7b71('0x4d')][_0x7b71('0x4e')](function(_0x5a3f65){return _0x5a3f65&&_0x5a3f65[_0x7b71('0x4f')][0x0]&&_0x5a3f65[_0x7b71('0x4f')][0x0][_0x7b71('0x50')]?_0x5a3f65[_0x7b71('0x4f')][0x0][_0x7b71('0x50')]:'';})[_0x7b71('0x51')]('\x0a');_0x1efbfa=_0x26085[_0x7b71('0x4d')][_0x7b71('0x4e')](function(_0x141f5d){return _0x141f5d&&_0x141f5d[_0x7b71('0x4f')][0x0]&&_0x141f5d[_0x7b71('0x4f')][0x0][_0x7b71('0x52')]?_0x141f5d['alternatives'][0x0]['confidence']:0x0;})['join']('\x0a');}logger[_0x7b71('0x20')](_0x7b71('0x53'),_0x3f96fb);logger['info'](_0x7b71('0x54'),_0x1efbfa);return{'transcript':_0x3f96fb,'confidence':_0x1efbfa};})[_0x7b71('0x55')](function(_0x23b4af){logger[_0x7b71('0x1a')]('[%s]\x20%s:%s',_0x23b4af['statusCode'],_0x23b4af[_0x7b71('0x56')],_0x23b4af[_0x7b71('0x57')]);});};exports[_0x7b71('0x58')]=function(_0x21b6dd,_0x3c79d0,_0x1d81dd,_0x44f9f6){var _0x5d39c5=apiai(_0x3c79d0,{'language':_0x44f9f6||'en'});return _0x5d39c5['textRequest'](_0x1d81dd,{'sessionId':md5(_0x21b6dd)})[_0x7b71('0x2e')](function(_0x4dddd2){logger[_0x7b71('0x20')](JSON[_0x7b71('0x42')](_0x4dddd2));return{'source':_0x4dddd2[_0x7b71('0x59')][_0x7b71('0x5a')],'resolvedQuery':_0x4dddd2[_0x7b71('0x59')][_0x7b71('0x5b')],'action':_0x4dddd2[_0x7b71('0x59')]['action'],'actionIncomplete':_0x4dddd2[_0x7b71('0x59')][_0x7b71('0x5c')],'speech':_0x4dddd2['result'][_0x7b71('0x5d')]['speech'],'score':_0x4dddd2[_0x7b71('0x59')]['score'],'statusCode':_0x4dddd2['status'][_0x7b71('0x5e')],'endConversation':_0x4dddd2['result'][_0x7b71('0x5f')][_0x7b71('0x60')]||![],'isFallbackIntent':_0x4dddd2[_0x7b71('0x59')][_0x7b71('0x5f')]['isFallbackIntent']};});};exports[_0x7b71('0x61')]=function(_0x5b7fa8,_0x3c51da,_0x1d7eb7,_0x30463f,_0x178c44,_0xf083bf){var _0x48553f=_0x30463f['replace'](/\\n/g,'\x0a');var _0x15ab86={'credentials':{'private_key':_0x48553f,'client_email':_0x1d7eb7}};var _0x50d197=new dialogflow[(_0x7b71('0x62'))](_0x15ab86);var _0xdc2716=_0x50d197[_0x7b71('0x63')](_0x3c51da,md5(_0x5b7fa8));var _0x28d261={'session':_0xdc2716,'queryInput':{'text':{'text':_0x178c44,'languageCode':_0xf083bf}}};return _0x50d197['detectIntent'](_0x28d261)[_0x7b71('0x2e')](function(_0x4232d3){if(_0x4232d3&&_0x4232d3[_0x7b71('0x48')]){logger['info'](_0x7b71('0x64'),JSON[_0x7b71('0x42')](_0x4232d3));var _0xa92bd1=_0x4232d3[0x0];if(_0xa92bd1){var _0x19ca05={'action':_0xa92bd1[_0x7b71('0x65')][_0x7b71('0x66')],'allRequiredParamsPresent':_0xa92bd1['queryResult'][_0x7b71('0x67')],'endConversation':_0xa92bd1[_0x7b71('0x65')][_0x7b71('0x68')]&&_0xa92bd1[_0x7b71('0x65')]['diagnosticInfo'][_0x7b71('0x69')]?_0xa92bd1[_0x7b71('0x65')][_0x7b71('0x68')][_0x7b71('0x69')][_0x7b71('0x6a')][_0x7b71('0x6b')]:![],'fulfillmentText':_0xa92bd1['queryResult'][_0x7b71('0x6c')],'intentName':_0xa92bd1[_0x7b71('0x65')][_0x7b71('0x6d')]['name'],'intentDisplayName':_0xa92bd1['queryResult'][_0x7b71('0x6d')]['displayName'],'isFallbackIntent':_0xa92bd1[_0x7b71('0x65')][_0x7b71('0x6d')][_0x7b71('0x6e')],'languageCode':_0xa92bd1[_0x7b71('0x65')]['languageCode'],'queryText':_0xa92bd1[_0x7b71('0x65')][_0x7b71('0x6f')],'responseId':_0xa92bd1[_0x7b71('0x70')],'score':_0xa92bd1[_0x7b71('0x65')][_0x7b71('0x71')],'speech':_0xa92bd1[_0x7b71('0x65')][_0x7b71('0x6c')],'providerResponse':JSON[_0x7b71('0x42')](_0x4232d3)};return _0x19ca05;}}});};exports[_0x7b71('0x72')]=function(_0x5dbd69,_0x55f55d,_0x554bb4,_0x273206){return tilde['asr'](_0x5dbd69,_0x55f55d,_0x554bb4,_0x273206)[_0x7b71('0x2e')](function(_0x5a585b){try{fs[_0x7b71('0x22')](_0x5dbd69);}catch(_0x566b3a){logger['error'](_0x566b3a);}logger['info']('Tilde\x20ASR\x20transcription',_0x5a585b[_0x7b71('0x50')]);logger[_0x7b71('0x20')]('Tilde\x20ASR\x20confidence',_0x5a585b['confidence']);return _0x5a585b;});};exports[_0x7b71('0x73')]=function(_0x4325d7,_0x55af8e,_0x4c9c68,_0x3d2b78,_0x29ff89,_0x526c20){var _0x167918=path[_0x7b71('0x29')](__dirname,_0x7b71('0x2a'),rs[_0x7b71('0x2b')](0x4)+'.mp3');var _0x2c508d;return aws[_0x7b71('0x74')](_0x4325d7,_0x55af8e,_0x4c9c68,_0x3d2b78,_0x29ff89,_0x526c20,_0x167918)[_0x7b71('0x2e')](function(){_0x2c508d=path[_0x7b71('0x29')](__dirname,_0x7b71('0x2a'),rs[_0x7b71('0x2b')](0x4)+_0x7b71('0x3d'));return convertFile(_0x167918,_0x2c508d);})['then'](function(){try{fs['unlink'](_0x167918);fs[_0x7b71('0x2f')](_0x2c508d,_0x7b71('0x30'));}catch(_0x48a669){logger[_0x7b71('0x1a')](_0x48a669);}return _0x2c508d[_0x7b71('0x31')]('.')[0x0];});};exports[_0x7b71('0x75')]=function(_0x55354f,_0x57390e,_0x3026ba,_0x29003c,_0x3961b2,_0x13de93){return aws[_0x7b71('0x76')](_0x55354f,_0x57390e,_0x3026ba,_0x29003c,_0x3961b2,_0x13de93)[_0x7b71('0x2e')](function(_0xee35f3){logger['info'](JSON['stringify'](_0xee35f3));return _0xee35f3;});};exports['ispeechTTS']=function(_0x3c558c,_0x1b8af4,_0x119740,_0x9cc079){var _0x3d7cf4=util['format'](_0x7b71('0x77'),ISPEECH_API,_0x3c558c,encodeURIComponent(_0x1b8af4),_0x119740,_0x9cc079);var _0x18daeb=path[_0x7b71('0x29')](__dirname,_0x7b71('0x2a'),rs['generate'](0x4)+_0x7b71('0x3b'));var _0x4246b1;return downloadFile(_0x3d7cf4,_0x18daeb)[_0x7b71('0x2e')](function(){_0x4246b1=path['resolve'](__dirname,_0x7b71('0x2a'),rs[_0x7b71('0x2b')](0x4)+_0x7b71('0x3d'));return convertFile(_0x18daeb,_0x4246b1);})[_0x7b71('0x2e')](function(){try{fs[_0x7b71('0x22')](_0x18daeb);fs[_0x7b71('0x2f')](_0x4246b1,_0x7b71('0x30'));}catch(_0x3f3ded){logger[_0x7b71('0x1a')](_0x3f3ded);}return _0x4246b1[_0x7b71('0x31')]('.')[0x0];});};exports['ispeechASR']=function(_0xb5d810,_0x45fe11,_0x41c610,_0x2d8314){var _0x10a7a2=util[_0x7b71('0x78')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x45fe11,_0x41c610,base64Encode(_0xb5d810),_0x2d8314?util[_0x7b71('0x78')]('model=%s',encodeURIComponent(_0x2d8314)):_0x7b71('0x79'));return uploadFile(_0x10a7a2)[_0x7b71('0x2e')](function(_0x3b6bc2){return querystring[_0x7b71('0xb')](_0x3b6bc2);});};exports[_0x7b71('0x7a')]=function(_0x4179f,_0x44cf46){return sestek[_0x7b71('0x7b')](_0x4179f,_0x44cf46)[_0x7b71('0x2e')](function(_0x548105){logger[_0x7b71('0x20')](JSON[_0x7b71('0x42')](_0x548105));var _0x5d5dca={'speech':_0x548105[_0x7b71('0x7c')],'action':_0x548105['channelData']?_0x548105['channelData'][_0x7b71('0x7d')]:undefined,'actiondata':_0x548105['channelData']?_0x548105[_0x7b71('0x7e')]['CustomActionData']:undefined};if(_0x548105[_0x7b71('0x7e')]&&_0x548105[_0x7b71('0x7e')][_0x7b71('0x7f')]){return base64Decode(_0x548105[_0x7b71('0x7e')][_0x7b71('0x7f')][_0x7b71('0x80')],path[_0x7b71('0x29')](__dirname,_0x7b71('0x2a'),rs[_0x7b71('0x2b')](0x4)+_0x7b71('0x3d')))['then'](function(_0x56c07d){_0x5d5dca[_0x7b71('0x81')]=_0x56c07d;return _0x5d5dca;});}return _0x5d5dca;});};exports[_0x7b71('0x82')]=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 e8f7711..25c5eeb 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 _0xa4d0=['exports','./nda'];(function(_0x5d04ee,_0x2a38ca){var _0x4a666a=function(_0x1883e4){while(--_0x1883e4){_0x5d04ee['push'](_0x5d04ee['shift']());}};_0x4a666a(++_0x2a38ca);}(_0xa4d0,0x17f));var _0x0a4d=function(_0x3bbd45,_0xf6a7fd){_0x3bbd45=_0x3bbd45-0x0;var _0x515356=_0xa4d0[_0x3bbd45];return _0x515356;};var nda=require(_0x0a4d('0x0'));module[_0x0a4d('0x1')]={'nda':nda}; \ No newline at end of file +var _0x89bf=['./nda'];(function(_0x32a767,_0x5858e1){var _0x2af05c=function(_0x3ddc86){while(--_0x3ddc86){_0x32a767['push'](_0x32a767['shift']());}};_0x2af05c(++_0x5858e1);}(_0x89bf,0x9d));var _0xf89b=function(_0x5b8d5c,_0x1b02f9){_0x5b8d5c=_0x5b8d5c-0x0;var _0x254836=_0x89bf[_0x5b8d5c];return _0x254836;};var nda=require(_0xf89b('0x0'));module['exports']={'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 ab9ee63..3dd9fa3 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 _0x9780=['custom_action_data','CustomActionData','stringify','../../../../../config/logger','agi','exports','POST','resolve','ndauth_url','/token','password','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','callerid','dnid','extension','text','Bearer\x20','project','channelData','ProjectName','ndagenerate_audio','body','AudioOutputSettings','audio/wav','CustomAction','custom_action'];(function(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0x9780,0x1d4));var _0x0978=function(_0x450bf9,_0x1895de){_0x450bf9=_0x450bf9-0x0;var _0x268350=_0x9780[_0x450bf9];return _0x268350;};'use strict';var rp=require('request-promise');var url=require('url');var logger=require(_0x0978('0x0'))(_0x0978('0x1'));module[_0x0978('0x2')]=function(_0x40b85f,_0x30a2b7){var _0x3e5b70={'method':_0x0978('0x3'),'uri':url[_0x0978('0x4')](_0x30a2b7[_0x0978('0x5')],_0x0978('0x6')),'form':{'grant_type':_0x0978('0x7'),'username':_0x30a2b7['username'],'password':_0x30a2b7[_0x0978('0x7')]},'json':!![]};return rp(_0x3e5b70)[_0x0978('0x8')](function(_0x3e4d16){var _0xefd03b={'method':_0x0978('0x3'),'uri':url[_0x0978('0x4')](_0x30a2b7[_0x0978('0x9')],_0x0978('0xa')),'body':{'type':_0x30a2b7[_0x0978('0xb')]||_0x0978('0xc'),'channelId':_0x0978('0xd'),'conversation':{'id':_0x40b85f['uniqueid']},'from':{'id':_0x40b85f[_0x0978('0xe')],'name':_0x40b85f['calleridname']},'recipient':{'id':_0x40b85f[_0x0978('0xf')],'name':_0x40b85f[_0x0978('0x10')]},'text':_0x30a2b7[_0x0978('0x11')],'channelData':{}},'headers':{'Authorization':_0x0978('0x12')+_0x3e4d16['access_token']},'json':!![]};if(_0x30a2b7[_0x0978('0x13')]){_0xefd03b['body'][_0x0978('0x14')][_0x0978('0x15')]=_0x30a2b7[_0x0978('0x13')];}if(_0x30a2b7[_0x0978('0x16')]=='1'){_0xefd03b[_0x0978('0x17')][_0x0978('0x14')][_0x0978('0x18')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x0978('0x19')};}if(_0x30a2b7['custom_action']){_0xefd03b[_0x0978('0x17')][_0x0978('0x14')][_0x0978('0x1a')]=_0x30a2b7[_0x0978('0x1b')];if(_0x30a2b7[_0x0978('0x1c')]){_0xefd03b[_0x0978('0x17')][_0x0978('0x14')][_0x0978('0x1d')]=_0x30a2b7[_0x0978('0x1c')];}}logger['info'](JSON[_0x0978('0x1e')](_0xefd03b));return rp(_0xefd03b);});}; \ No newline at end of file +var _0x8c38=['custom_action_data','CustomActionData','stringify','request-promise','url','agi','exports','POST','resolve','ndauth_url','/token','password','username','then','/api/NaturalDialogAssistant/v1/Run','message','Nda','uniqueid','callerid','dnid','extension','text','access_token','channelData','ProjectName','project','ndagenerate_audio','body','AudioOutputSettings','audio/wav','custom_action','CustomAction'];(function(_0x398e1b,_0xea0d0a){var _0x253a48=function(_0x11cc86){while(--_0x11cc86){_0x398e1b['push'](_0x398e1b['shift']());}};_0x253a48(++_0xea0d0a);}(_0x8c38,0x83));var _0x88c3=function(_0x4b92d9,_0x2f2ca4){_0x4b92d9=_0x4b92d9-0x0;var _0x6f7c9=_0x8c38[_0x4b92d9];return _0x6f7c9;};'use strict';var rp=require(_0x88c3('0x0'));var url=require(_0x88c3('0x1'));var logger=require('../../../../../config/logger')(_0x88c3('0x2'));module[_0x88c3('0x3')]=function(_0x2fd347,_0x2ac453){var _0x4ac99a={'method':_0x88c3('0x4'),'uri':url[_0x88c3('0x5')](_0x2ac453[_0x88c3('0x6')],_0x88c3('0x7')),'form':{'grant_type':_0x88c3('0x8'),'username':_0x2ac453[_0x88c3('0x9')],'password':_0x2ac453[_0x88c3('0x8')]},'json':!![]};return rp(_0x4ac99a)[_0x88c3('0xa')](function(_0x5020c9){var _0x350a11={'method':'POST','uri':url[_0x88c3('0x5')](_0x2ac453['ndassistant_url'],_0x88c3('0xb')),'body':{'type':_0x2ac453['ndaactivity_type']||_0x88c3('0xc'),'channelId':_0x88c3('0xd'),'conversation':{'id':_0x2fd347[_0x88c3('0xe')]},'from':{'id':_0x2fd347[_0x88c3('0xf')],'name':_0x2fd347['calleridname']},'recipient':{'id':_0x2fd347[_0x88c3('0x10')],'name':_0x2fd347[_0x88c3('0x11')]},'text':_0x2ac453[_0x88c3('0x12')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x5020c9[_0x88c3('0x13')]},'json':!![]};if(_0x2ac453['project']){_0x350a11['body'][_0x88c3('0x14')][_0x88c3('0x15')]=_0x2ac453[_0x88c3('0x16')];}if(_0x2ac453[_0x88c3('0x17')]=='1'){_0x350a11[_0x88c3('0x18')]['channelData'][_0x88c3('0x19')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x88c3('0x1a')};}if(_0x2ac453[_0x88c3('0x1b')]){_0x350a11[_0x88c3('0x18')]['channelData'][_0x88c3('0x1c')]=_0x2ac453['custom_action'];if(_0x2ac453[_0x88c3('0x1d')]){_0x350a11[_0x88c3('0x18')][_0x88c3('0x14')][_0x88c3('0x1e')]=_0x2ac453['custom_action_data'];}}logger['info'](JSON[_0x88c3('0x1f')](_0x350a11));return rp(_0x350a11);});}; \ 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 2b35cb8..ca330e0 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 _0x0f30=['./lib/api','exports'];(function(_0x2aa659,_0xc107f2){var _0x359d10=function(_0x344e10){while(--_0x344e10){_0x2aa659['push'](_0x2aa659['shift']());}};_0x359d10(++_0xc107f2);}(_0x0f30,0xda));var _0x00f3=function(_0x44e50a,_0x1cc4a2){_0x44e50a=_0x44e50a-0x0;var _0x1b5994=_0x0f30[_0x44e50a];return _0x1b5994;};'use strict';var asr=require(_0x00f3('0x0'));module[_0x00f3('0x1')]=function(_0x2c4d67,_0x3b1a84,_0x234d11,_0x59dd24){return asr(_0x2c4d67,_0x3b1a84,_0x234d11,_0x59dd24);}; \ No newline at end of file +var _0x16c4=['./lib/api','exports'];(function(_0x47ff96,_0x186b9d){var _0x43aa66=function(_0x288d37){while(--_0x288d37){_0x47ff96['push'](_0x47ff96['shift']());}};_0x43aa66(++_0x186b9d);}(_0x16c4,0x100));var _0x416c=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0x16c4[_0x4bfac3];return _0x15f0f2;};'use strict';var asr=require(_0x416c('0x0'));module[_0x416c('0x1')]=function(_0x38b341,_0x15f3f4,_0x21d294,_0x484d16){return asr(_0x38b341,_0x15f3f4,_0x21d294,_0x484d16);}; \ 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 bc1d66d..37f6841 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 _0xa05f=['No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','moment','crypto','../../../../../../config/logger','agi','info','Tilde\x20URI','sha1','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','close','error','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','likelihood','Success.'];(function(_0x5e1108,_0x55f3c3){var _0x4b6e97=function(_0x2955c8){while(--_0x2955c8){_0x5e1108['push'](_0x5e1108['shift']());}};_0x4b6e97(++_0x55f3c3);}(_0xa05f,0xbf));var _0xfa05=function(_0x459573,_0x35679e){_0x459573=_0x459573-0x0;var _0x51ffcd=_0xa05f[_0x459573];return _0x51ffcd;};'use strict';var BPromise=require('bluebird');var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xfa05('0x0'));var crypto=require(_0xfa05('0x1'));var logger=require(_0xfa05('0x2'))(_0xfa05('0x3'));module['exports']=function(_0x39af05,_0x4f8bb8,_0x2c036f,_0x1c2d34){return new BPromise(function(_0xc6d028,_0x1a2cb8){logger[_0xfa05('0x4')](_0xfa05('0x5'),_0x1c2d34||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x545417=new WebSocket(_0x1c2d34||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x36d316='';var _0x299b44='0';var _0x1cbfc5='1';var _0x14aff9='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x545622(_0x364dbe){var _0x41e4c6=crypto['createHash'](_0xfa05('0x6'));_0x41e4c6['update'](_0x364dbe);return _0x41e4c6[_0xfa05('0x7')](_0xfa05('0x8'));}function _0x3fba38(){try{logger[_0xfa05('0x4')](_0xfa05('0x9'));var _0x54d426=moment()[_0xfa05('0xa')]();var _0x51fa16=_0x545622(_0x54d426+_0x4f8bb8+_0x2c036f);_0x545417[_0xfa05('0xb')](JSON[_0xfa05('0xc')]({'appID':_0x4f8bb8,'timestamp':_0x54d426,'appKey':_0x51fa16}));var _0x5a543e=fs[_0xfa05('0xd')](_0x39af05);_0x5a543e['on']('data',function(_0x3b6ed9){_0x545417['send'](_0x3b6ed9);});_0x5a543e['on'](_0xfa05('0xe'),function(){_0x545417[_0xfa05('0xb')]('EOS');});}catch(_0x8bae5){logger[_0xfa05('0xf')]('Tilde\x20ASR\x20send\x20error',JSON[_0xfa05('0xc')](_0x8bae5));_0x545417[_0xfa05('0x10')]();}}function _0x30d390(_0x45ef01){try{if(_0x45ef01){var _0x3ebcb6=JSON[_0xfa05('0x11')](_0x45ef01);switch(_0x3ebcb6[_0xfa05('0x12')]){case 0x0:if(_0x3ebcb6[_0xfa05('0x13')]){if(_0x3ebcb6[_0xfa05('0x13')][_0xfa05('0x14')]){logger[_0xfa05('0x4')](_0xfa05('0x15'),JSON[_0xfa05('0xc')](_0x3ebcb6['result'][_0xfa05('0x16')]));_0x36d316=_0x3ebcb6[_0xfa05('0x13')][_0xfa05('0x16')][0x0]['transcript'];_0x299b44=_0x3ebcb6[_0xfa05('0x13')][_0xfa05('0x16')][0x0][_0xfa05('0x17')];_0x1cbfc5='0';_0x14aff9=_0xfa05('0x18');_0x545417[_0xfa05('0x10')]();}}break;case 0x1:logger[_0xfa05('0x4')](_0xfa05('0x19'));_0x1cbfc5='1';_0x14aff9='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0xfa05('0x4')](_0xfa05('0x1a'));_0x1cbfc5='2';_0x14aff9='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger['info'](_0xfa05('0x1b'));_0x1cbfc5='9';_0x14aff9=_0xfa05('0x1b');break;case 0xa:logger[_0xfa05('0x4')](_0xfa05('0x1c'));_0x1cbfc5='10';_0x14aff9=_0xfa05('0x1c');break;case 0xb:logger[_0xfa05('0x4')](_0xfa05('0x1d'));_0x1cbfc5='11';_0x14aff9='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x24ecf5){logger['error'](_0xfa05('0x1e'),JSON[_0xfa05('0xc')](_0x24ecf5));_0x545417['terminate']();}}function _0x1364a1(){logger[_0xfa05('0x4')](_0xfa05('0x1f'));_0xc6d028({'transcript':_0x36d316,'confidence':_0x299b44,'status':_0x1cbfc5,'status_message':_0x14aff9});}function _0x52d952(_0x69f8a4){logger[_0xfa05('0xf')](_0xfa05('0x20'));if(!_[_0xfa05('0x21')](_0x69f8a4)){logger[_0xfa05('0xf')](_[_0xfa05('0x22')](_0x69f8a4)?JSON[_0xfa05('0xc')](_0x69f8a4):_0x69f8a4);}}_0x545417['on'](_0xfa05('0x23'),_0x3fba38);_0x545417['on']('message',_0x30d390);_0x545417['on'](_0xfa05('0xe'),_0x1364a1);_0x545417['on']('error',_0x52d952);});}; \ No newline at end of file +var _0x0b93=['createHash','sha1','update','hex','Open\x20Tilde\x20ASR\x20socket','send','createReadStream','close','EOS','error','Tilde\x20ASR\x20send\x20error','stringify','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isObject','open','bluebird','lodash','moment','../../../../../../config/logger','agi','exports','info','Tilde\x20URI','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0b93,0x108));var _0x30b9=function(_0x36d9d3,_0xaab978){_0x36d9d3=_0x36d9d3-0x0;var _0x121412=_0x0b93[_0x36d9d3];return _0x121412;};'use strict';var BPromise=require(_0x30b9('0x0'));var _=require(_0x30b9('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x30b9('0x2'));var crypto=require('crypto');var logger=require(_0x30b9('0x3'))(_0x30b9('0x4'));module[_0x30b9('0x5')]=function(_0x288197,_0x3c9230,_0x2aaf7b,_0x54a5c6){return new BPromise(function(_0x565de0,_0x43ed9d){logger[_0x30b9('0x6')](_0x30b9('0x7'),_0x54a5c6||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x2878a7=new WebSocket(_0x54a5c6||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x1f8b87='';var _0x28a17e='0';var _0x3baff6='1';var _0x456c2c=_0x30b9('0x8');function _0x90ca8(_0x24be75){var _0x529ba4=crypto[_0x30b9('0x9')](_0x30b9('0xa'));_0x529ba4[_0x30b9('0xb')](_0x24be75);return _0x529ba4['digest'](_0x30b9('0xc'));}function _0x2631dd(){try{logger[_0x30b9('0x6')](_0x30b9('0xd'));var _0x6e2723=moment()['unix']();var _0x816ba6=_0x90ca8(_0x6e2723+_0x3c9230+_0x2aaf7b);_0x2878a7[_0x30b9('0xe')](JSON['stringify']({'appID':_0x3c9230,'timestamp':_0x6e2723,'appKey':_0x816ba6}));var _0x19c06=fs[_0x30b9('0xf')](_0x288197);_0x19c06['on']('data',function(_0x57a12a){_0x2878a7['send'](_0x57a12a);});_0x19c06['on'](_0x30b9('0x10'),function(){_0x2878a7[_0x30b9('0xe')](_0x30b9('0x11'));});}catch(_0x46e875){logger[_0x30b9('0x12')](_0x30b9('0x13'),JSON[_0x30b9('0x14')](_0x46e875));_0x2878a7[_0x30b9('0x15')]();}}function _0x304836(_0xd3666d){try{if(_0xd3666d){var _0x4220f1=JSON[_0x30b9('0x16')](_0xd3666d);switch(_0x4220f1[_0x30b9('0x17')]){case 0x0:if(_0x4220f1[_0x30b9('0x18')]){if(_0x4220f1[_0x30b9('0x18')][_0x30b9('0x19')]){logger['info'](_0x30b9('0x1a'),JSON['stringify'](_0x4220f1[_0x30b9('0x18')][_0x30b9('0x1b')]));_0x1f8b87=_0x4220f1[_0x30b9('0x18')][_0x30b9('0x1b')][0x0]['transcript'];_0x28a17e=_0x4220f1[_0x30b9('0x18')][_0x30b9('0x1b')][0x0][_0x30b9('0x1c')];_0x3baff6='0';_0x456c2c=_0x30b9('0x1d');_0x2878a7[_0x30b9('0x15')]();}}break;case 0x1:logger[_0x30b9('0x6')]('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x3baff6='1';_0x456c2c=_0x30b9('0x8');break;case 0x2:logger[_0x30b9('0x6')](_0x30b9('0x1e'));_0x3baff6='2';_0x456c2c=_0x30b9('0x1e');break;case 0x9:logger[_0x30b9('0x6')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x3baff6='9';_0x456c2c=_0x30b9('0x1f');break;case 0xa:logger[_0x30b9('0x6')](_0x30b9('0x20'));_0x3baff6='10';_0x456c2c='Authentication\x20failed.';break;case 0xb:logger['info']('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x3baff6='11';_0x456c2c=_0x30b9('0x21');}}}catch(_0x6b7484){logger[_0x30b9('0x12')](_0x30b9('0x22'),JSON[_0x30b9('0x14')](_0x6b7484));_0x2878a7[_0x30b9('0x15')]();}}function _0x4cb80b(){logger['info'](_0x30b9('0x23'));_0x565de0({'transcript':_0x1f8b87,'confidence':_0x28a17e,'status':_0x3baff6,'status_message':_0x456c2c});}function _0x482cf0(_0x30e0e2){logger[_0x30b9('0x12')](_0x30b9('0x24'));if(!_['isNil'](_0x30e0e2)){logger[_0x30b9('0x12')](_[_0x30b9('0x25')](_0x30e0e2)?JSON[_0x30b9('0x14')](_0x30e0e2):_0x30e0e2);}}_0x2878a7['on'](_0x30b9('0x26'),_0x2631dd);_0x2878a7['on']('message',_0x304836);_0x2878a7['on'](_0x30b9('0x10'),_0x4cb80b);_0x2878a7['on'](_0x30b9('0x12'),_0x482cf0);});}; \ 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 1a14df9..cf9e5ce 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 _0x1720=['exports'];(function(_0x37f47a,_0x5c2c57){var _0xf6b7c4=function(_0x482763){while(--_0x482763){_0x37f47a['push'](_0x37f47a['shift']());}};_0xf6b7c4(++_0x5c2c57);}(_0x1720,0xaa));var _0x0172=function(_0x181152,_0x3ae9c0){_0x181152=_0x181152-0x0;var _0x112685=_0x1720[_0x181152];return _0x112685;};var asr=require('./asr');module[_0x0172('0x0')]={'asr':asr}; \ No newline at end of file +var _0xe48a=['exports','./asr'];(function(_0x283514,_0x47dad8){var _0x48dad3=function(_0xec187d){while(--_0xec187d){_0x283514['push'](_0x283514['shift']());}};_0x48dad3(++_0x47dad8);}(_0xe48a,0xc1));var _0xae48=function(_0xc02211,_0x39040b){_0xc02211=_0xc02211-0x0;var _0x2f4910=_0xe48a[_0xc02211];return _0x2f4910;};var asr=require(_0xae48('0x0'));module[_0xae48('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 4751ad9..abec91f 100644 --- a/server/services/agi/server.js +++ b/server/services/agi/server.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','close','nextTick','exports','util','net','events','./error','./channel','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening'];(function(_0x170bba,_0x2be92f){var _0xa7c249=function(_0x2b6505){while(--_0x2b6505){_0x170bba['push'](_0x170bba['shift']());}};_0xa7c249(++_0x2be92f);}(_0xe706,0xa3));var _0x6e70=function(_0x3da832,_0x2133f1){_0x3da832=_0x3da832-0x0;var _0xe602f2=_0xe706[_0x3da832];return _0xe602f2;};'use strict';var util=require(_0x6e70('0x0'));var net=require(_0x6e70('0x1'));var EventEmitter=require(_0x6e70('0x2'))['EventEmitter'];var AGIError=require(_0x6e70('0x3'));var AGIChannel=require(_0x6e70('0x4'));var AGIServer=function(_0x2ca810,_0x7dfbc3,_0x142c27){var _0x2164a4=this;var _0x376a8d=null;var _0x506db9=0x0;if(!_0x2ca810)_0x2ca810=0x11dd;if(!_0x7dfbc3)_0x7dfbc3=_0x6e70('0x5');EventEmitter[_0x6e70('0x6')](_0x2164a4);function _0x36357b(){if(!_0x2ca810){_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x9')));return![];}_0x376a8d=net[_0x6e70('0xa')]();_0x376a8d[_0x6e70('0xb')](_0x2ca810,_0x7dfbc3);_0x376a8d['on'](_0x6e70('0xc'),function(){_0x2164a4[_0x6e70('0x7')](_0x6e70('0xc'));});_0x376a8d['on'](_0x6e70('0xd'),function(_0x743eb5){_0x376a8d[_0x6e70('0xe')](function(_0x37b3e0,_0x4600f9){if(_0x37b3e0){_0x2164a4['emit']('error',new AGIError(_0x6e70('0xf'),_0x37b3e0));}else if(_0x142c27&&_0x142c27<0x0){_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x10')));_0x743eb5[_0x6e70('0x11')]();}else if(_0x142c27&&_0x142c27>0x0&&_0x142c27<_0x4600f9){_0x506db9+=0x1;_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x12'),_0x506db9));_0x743eb5['destroy']();}else{var _0x52737e=new AGIChannel(_0x743eb5);_0x52737e['on']('ready',function(){_0x2164a4[_0x6e70('0x7')]('connection',_0x52737e);});}});});_0x376a8d['on']('error',function(_0x304716){_0x2164a4[_0x6e70('0x7')]('error',new AGIError(_0x6e70('0xf'),_0x304716['code']));});_0x376a8d['on'](_0x6e70('0x13'),function(){_0x2164a4[_0x6e70('0x7')]('close',new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x6e70('0x14')](function(){_0x36357b();});};util['inherits'](AGIServer,EventEmitter);module[_0x6e70('0x15')]=function(_0x173afe,_0x53acdc,_0x497d61){return new AGIServer(_0x173afe,_0x53acdc,_0x497d61);}; \ No newline at end of file +var _0xa9e0=['ready','E_AGI_SERVER_ERROR','close','E_AGI_SERVER_CLOSE','inherits','exports','util','net','events','./channel','call','emit','createServer','listening','connection','getConnections','error','E_AGI_SERVER_VOICE_DISABLED','destroy'];(function(_0x2d3d0d,_0x67ac82){var _0xca35b6=function(_0x483979){while(--_0x483979){_0x2d3d0d['push'](_0x2d3d0d['shift']());}};_0xca35b6(++_0x67ac82);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'use strict';var util=require(_0x0a9e('0x0'));var net=require(_0x0a9e('0x1'));var EventEmitter=require(_0x0a9e('0x2'))['EventEmitter'];var AGIError=require('./error');var AGIChannel=require(_0x0a9e('0x3'));var AGIServer=function(_0x4ce2f1,_0x333808,_0x432180){var _0x2ab90b=this;var _0x991246=null;var _0x981158=0x0;if(!_0x4ce2f1)_0x4ce2f1=0x11dd;if(!_0x333808)_0x333808='127.0.0.1';EventEmitter[_0x0a9e('0x4')](_0x2ab90b);function _0x441e3a(){if(!_0x4ce2f1){_0x2ab90b[_0x0a9e('0x5')]('error',new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x991246=net[_0x0a9e('0x6')]();_0x991246['listen'](_0x4ce2f1,_0x333808);_0x991246['on']('listening',function(){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0x7'));});_0x991246['on'](_0x0a9e('0x8'),function(_0x3ab53f){_0x991246[_0x0a9e('0x9')](function(_0xbd1168,_0x4a4c56){if(_0xbd1168){_0x2ab90b['emit']('error',new AGIError('E_AGI_SERVER_ERROR',_0xbd1168));}else if(_0x432180&&_0x432180<0x0){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0xa'),new AGIError(_0x0a9e('0xb')));_0x3ab53f[_0x0a9e('0xc')]();}else if(_0x432180&&_0x432180>0x0&&_0x432180<_0x4a4c56){_0x981158+=0x1;_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0xa'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x981158));_0x3ab53f[_0x0a9e('0xc')]();}else{var _0x239b12=new AGIChannel(_0x3ab53f);_0x239b12['on'](_0x0a9e('0xd'),function(){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0x8'),_0x239b12);});}});});_0x991246['on'](_0x0a9e('0xa'),function(_0x52a03d){_0x2ab90b[_0x0a9e('0x5')]('error',new AGIError(_0x0a9e('0xe'),_0x52a03d['code']));});_0x991246['on'](_0x0a9e('0xf'),function(){_0x2ab90b[_0x0a9e('0x5')]('close',new AGIError(_0x0a9e('0x10')));});}process['nextTick'](function(){_0x441e3a();});};util[_0x0a9e('0x11')](AGIServer,EventEmitter);module[_0x0a9e('0x12')]=function(_0x106033,_0x205fd6,_0x31b1ca){return new AGIServer(_0x106033,_0x205fd6,_0x31b1ca);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 0110485..21a4c1b 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 _0xb688=['no\x20password\x20configured','ndassistant_url','SESTEK_NDA_%s','sesteknda','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','.wav','SestekNDA\x20Result\x20%s','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20found','trunk_name','no\x20trunk\x20selected','SIP/%s/%s','Enter\x20in\x20FINALLY\x20(%s)\x20block','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','retry','file_id','no\x20file\x20audio\x20selected','getSound','no\x20file\x20audio\x20found','response','maxdigit','test','mindigit','no\x20variable\x20found','generate','hiddendigitspos','substr','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','recordFile','intKey','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','appid','no\x20appsecret\x20configured','%s/recordings/%s','beep','NOBEEP','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','extension','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20%s\x20file\x20created','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','Enter\x20in\x20MATH\x20(%s)\x20block','no\x20operation\x20configured','math\x20%s','operation','no\x20variable\x20selected\x20for\x20the\x20result','variable\x20%s[key]\x20set','maxRetry','getData','digit','output','pause_id','PLAYBACK','Executed\x20command\x20%s\x20%s','queue','no\x20queue\x20selected','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','QUEUE','macro','position','record','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','Enter\x20in\x20RESTAPI\x20(%s)\x20block','restAPI','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','%s_STATUS_MESSAGE','variable\x20%s\x20set','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','escape_digits','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','bcc','subject','template_id','debug','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sms_account_id','no\x20sms\x20account\x20configured','sms_text','sendSMS\x20message','createSmsMessage','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','variable_value','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','getSquareProject','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','agi://%s/square,\x22%s\x22,\x22%s\x22','host','127.0.0.1','Enter\x20in\x20SYSTEM\x20(%s)\x20block','command','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','unlink','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','lodash','shelljs','odbc','randomstring','moment','mustache','../../config/logger','agi','../../config/environment','../../config/environment/shared','/var/opt/motion2/server/files','rawBody','menu','getdigits','getsecretdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','then','name','catch','getVoiceQueue','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUserById','getTrunk','getTrunkById','getMailAccount','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','getSoundPath','getQueryOdbc','open','error','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSquareDetailsReport','uniqueid','agicommand','arg_1','createSquareRecording','callerid','calleridname','context','priority','accountcode','file','createSquareMessage','createCmContact','isEmpty','callback_','random','lastName','isNil','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','internal','format','%s/%s@from-sip/n','agentLogin','shellCommand','exec','trim','replace','googleCloudTTS','google_cloud_tts_text_type','text','languageCode','ssmlGender','MP3','googleTTS','google_tts_language','url','method','timeout','number','POST','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','rawHeaders','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','ispeechASR','ispeech_asr_language','en-US','isConfigured','model','awsPolly','aws_access_key_id','aws_polly_region','Amy','aws_text_type','awsLex','aws_secret_access_key','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appsecret','clear','includes','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','saveRestApiResult','%s.%s','split','replaceAll','extra','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','MRCPSynth','noop','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','label','grammar','MRCPRecog','getAndSetVariable','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','no\x20list\x20selected','delay','minutes','callback_priority','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','phone','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','no\x20text\x20configured','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','no\x20grammar\x20configured','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','query:\x20%s','variable_id','forEach','keys','setVariable','%s[%s][%s]','%s_ROWS_COUNT','dial','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','opts','Executed\x20command\x20%s','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','dialogflow','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20anguage\x20configured','providerResponse','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','no\x20username\x20configured','password'];(function(_0x455c6c,_0x1e78b7){var _0x488242=function(_0x3e8fb0){while(--_0x3e8fb0){_0x455c6c['push'](_0x455c6c['shift']());}};_0x488242(++_0x1e78b7);}(_0xb688,0xcf));var _0x8b68=function(_0x47f2e6,_0x40ad9f){_0x47f2e6=_0x47f2e6-0x0;var _0x3ac807=_0xb688[_0x47f2e6];return _0x3ac807;};'use strict';var fs=require('fs');var util=require('util');var _=require(_0x8b68('0x0'));var sh=require(_0x8b68('0x1'));var odbc=require(_0x8b68('0x2'))();var rs=require(_0x8b68('0x3'));var moment=require(_0x8b68('0x4'));var Mustache=require(_0x8b68('0x5'));var rp=require('request-promise');var logger=require(_0x8b68('0x6'))(_0x8b68('0x7'));var config=require(_0x8b68('0x8'));var shared=require(_0x8b68('0x9'));var scripts=require('./scripts');var FILES_PATH=_0x8b68('0xa');var recursiveMapAttributes=['rawHeaders',_0x8b68('0xb')];var verticesWithRetry=[_0x8b68('0xc'),_0x8b68('0xd'),_0x8b68('0xe')];var AGIVertices=function(_0x132617,_0x3f9685,_0x261753){this[_0x8b68('0xf')]=_0x132617;this[_0x8b68('0x10')]=_0x3f9685;this[_0x8b68('0x11')]=_0x261753;};AGIVertices[_0x8b68('0x12')][_0x8b68('0x13')]=function(_0x2a852a,_0x502727){this[_0x8b68('0x10')][_0x8b68('0x14')](_0x2a852a)[_0x8b68('0x15')](function(_0x2d8472){_0x502727(null,_0x2d8472?_0x2d8472[_0x8b68('0x16')]:![]);})[_0x8b68('0x17')](function(_0xaa8725){_0x502727(_0xaa8725);});};AGIVertices[_0x8b68('0x12')][_0x8b68('0x18')]=function(_0x5b4364,_0xb2df35){this['rpc']['getVoiceQueueById'](_0x5b4364)[_0x8b68('0x15')](function(_0x1554d6){_0xb2df35(null,_0x1554d6?_0x1554d6[_0x8b68('0x16')]:![]);})['catch'](function(_0x5c8d0e){_0xb2df35(_0x5c8d0e);});};AGIVertices[_0x8b68('0x12')]['getSquareProject']=function(_0x136f1b,_0xb44923){this[_0x8b68('0x10')][_0x8b68('0x19')](_0x136f1b)['then'](function(_0xd17693){_0xb44923(null,_0xd17693?_0xd17693[_0x8b68('0x16')]:![]);})['catch'](function(_0x42b3bd){_0xb44923(_0x42b3bd);});};AGIVertices[_0x8b68('0x12')][_0x8b68('0x1a')]=function(_0x17f321,_0x38b7a7){this['rpc'][_0x8b68('0x1b')](_0x17f321)[_0x8b68('0x15')](function(_0x59e9b1){_0x38b7a7(null,_0x59e9b1?_0x59e9b1[_0x8b68('0x1c')]:![]);})[_0x8b68('0x17')](function(_0x1dbc1d){_0x38b7a7(_0x1dbc1d);});};AGIVertices['prototype']['getUser']=function(_0x23edc1,_0x59cb26){this[_0x8b68('0x10')][_0x8b68('0x1d')](_0x23edc1)[_0x8b68('0x15')](function(_0x21ecca){_0x59cb26(null,_0x21ecca?_0x21ecca[_0x8b68('0x16')]:![]);})[_0x8b68('0x17')](function(_0x59bb8a){_0x59cb26(_0x59bb8a);});};AGIVertices[_0x8b68('0x12')][_0x8b68('0x1e')]=function(_0x4ca77d,_0x1c5808){this[_0x8b68('0x10')][_0x8b68('0x1f')](_0x4ca77d)['then'](function(_0x511ccf){_0x1c5808(null,_0x511ccf?_0x511ccf['name']:![]);})[_0x8b68('0x17')](function(_0x448e43){_0x1c5808(_0x448e43);});};AGIVertices[_0x8b68('0x12')]['getSound']=function(_0x3311c7,_0x53aaa2){var _0x4cf89d=this;this[_0x8b68('0x10')]['getSoundById'](_0x3311c7)[_0x8b68('0x15')](function(_0x3ac356){_0x53aaa2(null,_0x3ac356?_0x4cf89d['getSoundPath'](_0x3ac356['save_name']):![]);})[_0x8b68('0x17')](function(_0x1cd230){_0x53aaa2(_0x1cd230);});};AGIVertices[_0x8b68('0x12')][_0x8b68('0x20')]=function(_0x210926,_0x2ad2df){this[_0x8b68('0x10')]['getMailAccountById'](_0x210926)[_0x8b68('0x15')](function(_0x50a1e9){_0x2ad2df(null,_0x50a1e9?_0x50a1e9:![]);})[_0x8b68('0x17')](function(_0x133b75){_0x2ad2df(_0x133b75);});};AGIVertices['prototype'][_0x8b68('0x21')]=function(_0x93daf7,_0x26fe0e,_0x49ce2d){this['mailRpc'][_0x8b68('0x21')](_0x93daf7,_0x26fe0e)[_0x8b68('0x15')](function(){_0x49ce2d(null);})[_0x8b68('0x17')](function(_0x394cca){_0x49ce2d(_0x394cca);});};AGIVertices[_0x8b68('0x12')][_0x8b68('0x22')]=function(_0x29449b,_0x3e646e){this[_0x8b68('0x10')][_0x8b68('0x23')](_0x29449b)[_0x8b68('0x15')](function(_0x15027a){if(_0x15027a){if(_0x15027a[_0x8b68('0x24')]){_0x3e646e(null,[_0x15027a[_0x8b68('0x25')]]);}else{_0x3e646e(null,_[_0x8b68('0x26')](_0x15027a[_0x8b68('0x27')],_0x8b68('0x25')));}}else{_0x3e646e(null,![]);}})[_0x8b68('0x17')](function(_0x120b34){_0x3e646e(_0x120b34);});};AGIVertices[_0x8b68('0x12')][_0x8b68('0x28')]=function(_0x43b971){return util['format']('%s/sounds/converted/%s',FILES_PATH,_0x43b971);};AGIVertices[_0x8b68('0x12')][_0x8b68('0x29')]=function(_0x23554d,_0xb9b5b1,_0xf2154f){odbc[_0x8b68('0x2a')](_0x23554d,function(_0x75a62f){if(_0x75a62f){logger[_0x8b68('0x2b')]('Error\x20getting\x20ODBC\x20connection\x20%s',_0x75a62f);_0xf2154f(_0x75a62f);}else{logger[_0x8b68('0x2c')](_0x8b68('0x2d'));odbc[_0x8b68('0x2e')](_0xb9b5b1,function(_0x13cf49,_0x1434b9){if(_0x13cf49){logger[_0x8b68('0x2c')](_0x8b68('0x2f'),_0xb9b5b1);_0xf2154f(_0x13cf49);}else{logger[_0x8b68('0x2c')]('Query\x20executed\x20correctly\x20%s',_0xb9b5b1);odbc[_0x8b68('0x30')](function(_0x42cc82){if(_0x42cc82){logger[_0x8b68('0x2b')](_0x8b68('0x31'),_0x42cc82);}_0xf2154f(null,_0x1434b9);});}});}});};AGIVertices[_0x8b68('0x12')][_0x8b68('0x32')]=function(_0xa748c2,_0x50a9c6){this[_0x8b68('0x10')][_0x8b68('0x33')](_0xa748c2)['then'](function(_0x14ec40){_0x50a9c6(null,_0x14ec40?_0x14ec40:![]);})[_0x8b68('0x17')](function(_0x50b2f1){_0x50a9c6(_0x50b2f1);});};AGIVertices['prototype']['createSmsMessage']=function(_0x4a093e,_0x423194){this[_0x8b68('0x10')]['createSmsMessage'](_0x4a093e)[_0x8b68('0x15')](function(_0x5960fc){_0x423194(null,_0x5960fc);})[_0x8b68('0x17')](function(_0x3841d2){_0x423194(_0x3841d2);});};AGIVertices['prototype'][_0x8b68('0x34')]=function(_0x5ae345,_0x4a718c,_0x537f6f){this[_0x8b68('0x10')][_0x8b68('0x34')]({'uniqueid':this[_0x8b68('0xf')][_0x8b68('0x35')],'node':_0x5ae345['label'],'application':_0x5ae345[_0x8b68('0x36')],'data':_0x4a718c||null,'project_name':this['channel'][_0x8b68('0x37')],'callerid':this[_0x8b68('0xf')]['callerid']})[_0x8b68('0x15')](function(_0x98e5ae){if(_0x537f6f){_0x537f6f(null,_0x98e5ae);}})[_0x8b68('0x17')](function(_0x225d67){if(_0x537f6f){_0x537f6f(_0x225d67);}});};AGIVertices['prototype'][_0x8b68('0x38')]=function(_0x478527,_0xd2b889,_0x44b070,_0xae2c2a){this[_0x8b68('0x10')][_0x8b68('0x38')]({'uniqueid':this[_0x8b68('0xf')][_0x8b68('0x35')],'callerid':this[_0x8b68('0xf')][_0x8b68('0x39')],'calleridname':this[_0x8b68('0xf')][_0x8b68('0x3a')],'context':this[_0x8b68('0xf')][_0x8b68('0x3b')],'extension':this[_0x8b68('0xf')]['extension'],'priority':this[_0x8b68('0xf')][_0x8b68('0x3c')],'accountcode':this['channel'][_0x8b68('0x3d')],'dnid':this['channel']['dnid'],'projectName':this['channel'][_0x8b68('0x37')],'saveName':_0xd2b889,'filename':_0x478527[_0x8b68('0x3e')]||_0xd2b889,'savePath':_0x44b070})[_0x8b68('0x15')](function(_0x6da48b){_0xae2c2a(null,_0x6da48b);})['catch'](function(_0x522f47){_0xae2c2a(_0x522f47);});};AGIVertices[_0x8b68('0x12')][_0x8b68('0x3f')]=function(_0x1e900f,_0x5d08c4,_0x3f6e21,_0x431a75,_0x596f64){this[_0x8b68('0x10')][_0x8b68('0x3f')]({'uniqueid':this['channel'][_0x8b68('0x35')],'body':_0x1e900f,'direction':_0x5d08c4,'providerName':_0x3f6e21,'providerResponse':_0x431a75})[_0x8b68('0x15')](function(_0x51bf1b){if(_0x596f64){_0x596f64(null,_0x51bf1b);}})[_0x8b68('0x17')](function(_0x735e17){if(_0x596f64){_0x596f64(_0x735e17);}});};AGIVertices['prototype']['createCmContact']=function(_0x5e3e99,_0x28f82d){this[_0x8b68('0x10')][_0x8b68('0x40')]({'firstName':_[_0x8b68('0x41')](_0x5e3e99['name'])||_['isNil'](_0x5e3e99[_0x8b68('0x16')])?_0x8b68('0x42')+Math[_0x8b68('0x43')]():_0x5e3e99['name'],'lastName':_[_0x8b68('0x41')](_0x5e3e99[_0x8b68('0x44')])||_[_0x8b68('0x45')](_0x5e3e99['lastName'])?null:_0x5e3e99[_0x8b68('0x44')],'phone':_0x5e3e99['phone'],'ListId':_0x5e3e99[_0x8b68('0x46')],'scheduledat':_0x5e3e99[_0x8b68('0x47')],'callbackUniqueid':this['channel'][_0x8b68('0x35')],'tags':_0x8b68('0x48'),'description':_0x8b68('0x49')+_0x5e3e99[_0x8b68('0x47')][_0x8b68('0x4a')](),'priority':_0x5e3e99['callback_priority']})[_0x8b68('0x15')](function(_0x3f3e43){_0x28f82d(null,_0x3f3e43);})[_0x8b68('0x17')](function(_0x31a090){_0x28f82d(_0x31a090);});};AGIVertices[_0x8b68('0x12')][_0x8b68('0x4b')]=function(_0x246077,_0x3096b3){this['rpc'][_0x8b68('0x4c')](_0x246077)[_0x8b68('0x15')](function(_0x1e8694){_0x3096b3(null,_0x1e8694?_0x1e8694[_0x8b68('0x16')]:![]);})[_0x8b68('0x17')](function(_0x4677b6){_0x3096b3(_0x4677b6);});};AGIVertices[_0x8b68('0x12')][_0x8b68('0x4d')]=function(_0x6d63cb,_0x271dbe,_0x368c86){var _0x42871e={'role':_0x8b68('0x4e')};_0x42871e[_0x6d63cb]=this[_0x8b68('0xf')][_0x8b68('0x39')];this[_0x8b68('0x10')][_0x8b68('0x4d')](_0x42871e,_0x271dbe,this[_0x8b68('0xf')][_0x8b68('0x35')])[_0x8b68('0x15')](function(_0x4a965c){_0x368c86(null,_[_0x8b68('0x45')](_0x4a965c)?![]:!![]);})['catch'](function(_0x592993){logger[_0x8b68('0x2b')](_0x592993);_0x368c86(null,![]);});};AGIVertices['prototype'][_0x8b68('0x4f')]=function(_0x61dac8,_0x44287f){var _0x4e2980={'role':_0x8b68('0x4e')};_0x4e2980[_0x61dac8]=this[_0x8b68('0xf')][_0x8b68('0x39')];this[_0x8b68('0x10')][_0x8b68('0x4f')](_0x4e2980)[_0x8b68('0x15')](function(_0x368025){_0x44287f(null,_['isNil'](_0x368025)?![]:!![]);})['catch'](function(_0x20aac1){logger[_0x8b68('0x2b')](_0x20aac1);_0x44287f(null,![]);});};AGIVertices[_0x8b68('0x12')][_0x8b68('0x50')]=function(_0x3c930d,_0x37da34){var _0x2d1519={'role':_0x8b68('0x4e')};_0x2d1519[_0x3c930d]=this[_0x8b68('0xf')][_0x8b68('0x39')];this[_0x8b68('0x10')][_0x8b68('0x50')](_0x2d1519)[_0x8b68('0x15')](function(_0x195f82){_0x37da34(null,_[_0x8b68('0x45')](_0x195f82)?![]:!![]);})[_0x8b68('0x17')](function(_0x3f1b87){logger[_0x8b68('0x2b')](_0x3f1b87);_0x37da34(null,![]);});};AGIVertices['prototype']['agentLogin']=function(_0xdc096c,_0x23e01a){var _0x5bd581={'role':'agent'};_0x5bd581[_0xdc096c]=this['channel'][_0x8b68('0x39')];var _0x3d6c17=_0xdc096c!=_0x8b68('0x51')?util[_0x8b68('0x52')](_0x8b68('0x53'),'LOCAL',this[_0x8b68('0xf')][_0x8b68('0x39')]):undefined;this['rpc'][_0x8b68('0x54')](_0x5bd581,_0x3d6c17)['then'](function(_0x491f6d){_0x23e01a(null,_['isNil'](_0x491f6d)?![]:!![]);})[_0x8b68('0x17')](function(_0x2cb665){logger[_0x8b68('0x2b')](_0x2cb665);_0x23e01a(null,![]);});};AGIVertices[_0x8b68('0x12')][_0x8b68('0x55')]=function(_0x1fc24c,_0x35b22b){sh[_0x8b68('0x56')](_[_0x8b68('0x57')](_0x1fc24c),function(_0x20a556,_0x55e04f){var _0x3a8d15=_0x55e04f[_0x8b68('0x58')](/(\r\n|\n|\r)/gm,'');_0x35b22b(null,_0x3a8d15);});};AGIVertices[_0x8b68('0x12')]['googleCloudTTS']=function(_0x5deaba,_0x1854a9){scripts[_0x8b68('0x59')](_0x5deaba['apiKey'],_0x5deaba[_0x8b68('0x5a')]||_0x8b68('0x5b'),_0x5deaba[_0x8b68('0x5b')],_0x5deaba[_0x8b68('0x5c')]||'en-US',_0x5deaba[_0x8b68('0x5d')]||'MALE',_0x5deaba['audioEncoding']||_0x8b68('0x5e'))['then'](function(_0xe9550){_0x1854a9(null,_0xe9550);})[_0x8b68('0x17')](function(_0x5e40f4){_0x1854a9(_0x5e40f4);});};AGIVertices[_0x8b68('0x12')][_0x8b68('0x5f')]=function(_0x1525da,_0x236fa2){scripts[_0x8b68('0x5f')](_0x1525da['text'],_0x1525da[_0x8b68('0x60')]||'en',0x1)[_0x8b68('0x15')](function(_0xa0ed41){_0x236fa2(null,_0xa0ed41);})[_0x8b68('0x17')](function(_0x34c7d8){_0x236fa2(_0x34c7d8);});};AGIVertices['prototype']['restAPI']=function(_0x44af14,_0x47c10f){var _0x2d442a={'uri':_0x44af14[_0x8b68('0x61')],'method':_0x44af14[_0x8b68('0x62')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x44af14[_0x8b68('0x63')])===_0x8b68('0x64')&&parseInt(_0x44af14[_0x8b68('0x63')])>=0x1?parseInt(_0x44af14[_0x8b68('0x63')])*0x3e8:0x5*0x3e8};if(_['includes']([_0x8b68('0x65'),'PUT'],_0x2d442a[_0x8b68('0x62')][_0x8b68('0x66')]())){try{_0x2d442a[_0x8b68('0x67')]=_0x44af14['rawBody']?JSON[_0x8b68('0x68')](_0x44af14['rawBody']):{};}catch(_0x104a9d){logger['error'](_0x8b68('0x69'),_0x104a9d);}}try{_0x2d442a[_0x8b68('0x6a')]=_0x44af14[_0x8b68('0x6b')]?JSON['parse'](_0x44af14[_0x8b68('0x6b')]):{};}catch(_0x1fc6dc){logger[_0x8b68('0x2b')](_0x8b68('0x6c'),_0x1fc6dc);}if(_0x44af14[_0x8b68('0x6d')]){try{var _0xc7cc47=require(_0x44af14[_0x8b68('0x6d')])[_0x8b68('0x6e')](this,_0x2d442a);_0x2d442a[_0x8b68('0x6f')]=Mustache['render'](_0x44af14[_0x8b68('0x61')],_0xc7cc47,{},['$$','$$']);if(_0x2d442a[_0x8b68('0x6a')]){_0x2d442a[_0x8b68('0x6a')]=JSON[_0x8b68('0x68')](Mustache[_0x8b68('0x70')](JSON['stringify'](_0x2d442a[_0x8b68('0x6a')]),_0xc7cc47,{},['$$','$$']));}if(_0x2d442a['body']){_0x2d442a[_0x8b68('0x67')]=JSON[_0x8b68('0x68')](Mustache['render'](JSON[_0x8b68('0x71')](_0x2d442a[_0x8b68('0x67')]),_0xc7cc47,{},['$$','$$']));}}catch(_0xa7890f){logger['error'](_0x8b68('0x72'),_0xa7890f);}}rp(_0x2d442a)[_0x8b68('0x15')](function(_0x43a874){var _0x3b260a={'statusCode':_0x43a874[_0x8b68('0x73')]||0xc8,'statusMessage':_0x43a874[_0x8b68('0x74')]||'OK','headers':_0x43a874['headers']||{},'body':_0x43a874[_0x8b68('0x67')]||{}};_0x47c10f(null,_0x3b260a);})[_0x8b68('0x17')](function(_0x3d38eb){var _0x4e5d13={'statusCode':_0x3d38eb[_0x8b68('0x73')]||0x1f4,'statusMessage':_0x3d38eb[_0x8b68('0x75')]||_0x8b68('0x76'),'headers':_0x3d38eb[_0x8b68('0x77')][_0x8b68('0x6a')]||{},'body':_0x3d38eb[_0x8b68('0x77')][_0x8b68('0x67')]||{}};_0x47c10f(null,_0x4e5d13);});};AGIVertices[_0x8b68('0x12')][_0x8b68('0x78')]=function(_0x37f78d,_0x44bb3a){scripts['googleDialogflow'](this['channel'][_0x8b68('0x35')],_0x37f78d[_0x8b68('0x79')],_0x37f78d[_0x8b68('0x5b')],_0x37f78d[_0x8b68('0x7a')]||'en')[_0x8b68('0x15')](function(_0x5e6c85){_0x44bb3a(null,_0x5e6c85);})[_0x8b68('0x17')](function(_0x1807bb){_0x44bb3a(_0x1807bb);});};AGIVertices[_0x8b68('0x12')][_0x8b68('0x7b')]=function(_0x48f60a,_0x52aa06){scripts[_0x8b68('0x7b')](this[_0x8b68('0xf')][_0x8b68('0x35')],_0x48f60a[_0x8b68('0x7c')],_0x48f60a[_0x8b68('0x7d')],_0x48f60a[_0x8b68('0x7e')],_0x48f60a[_0x8b68('0x5b')],_0x48f60a[_0x8b68('0x7f')]||'en')['then'](function(_0x7864cf){_0x52aa06(null,_0x7864cf);})[_0x8b68('0x17')](function(_0x2b03b8){_0x52aa06(_0x2b03b8);});};AGIVertices[_0x8b68('0x12')][_0x8b68('0x80')]=function(_0x27980a,_0x5d719f){scripts[_0x8b68('0x80')](this[_0x8b68('0xf')],_0x27980a)[_0x8b68('0x15')](function(_0x583ff3){_0x5d719f(null,_0x583ff3);})[_0x8b68('0x17')](function(_0x5c9508){_0x5d719f(_0x5c9508);});};AGIVertices[_0x8b68('0x12')]['ispeechTTS']=function(_0x21399f,_0x382d99){scripts[_0x8b68('0x81')](_0x21399f[_0x8b68('0x79')],_0x21399f[_0x8b68('0x5b')],_0x21399f[_0x8b68('0x82')]||'en-US',_0x21399f['speed'])['then'](function(_0xa20bfd){_0x382d99(null,_0xa20bfd);})[_0x8b68('0x17')](function(_0x160cab){_0x382d99(_0x160cab);});};AGIVertices[_0x8b68('0x12')][_0x8b68('0x83')]=function(_0x401229,_0x3cbd15,_0x3b1644){scripts[_0x8b68('0x83')](_0x3cbd15,_0x401229[_0x8b68('0x79')],_0x401229[_0x8b68('0x84')]||_0x8b68('0x85'),this[_0x8b68('0x86')](_0x401229[_0x8b68('0x87')])?_0x401229[_0x8b68('0x87')]:undefined)['then'](function(_0x4b5045){_0x3b1644(null,_0x4b5045);})['catch'](function(_0x5b1885){_0x3b1644(_0x5b1885);});};AGIVertices[_0x8b68('0x12')][_0x8b68('0x88')]=function(_0x10e9d3,_0xb43aa0){scripts['awsPolly'](_0x10e9d3[_0x8b68('0x89')],_0x10e9d3['aws_secret_access_key'],_0x10e9d3[_0x8b68('0x8a')],_0x10e9d3['aws_polly_voice']||_0x8b68('0x8b'),_0x10e9d3['text'],_0x10e9d3[_0x8b68('0x8c')]||'text')[_0x8b68('0x15')](function(_0x182e5c){_0xb43aa0(null,_0x182e5c);})['catch'](function(_0xeb8fba){_0xb43aa0(_0xeb8fba);});};AGIVertices[_0x8b68('0x12')]['awsLex']=function(_0x3d8d42,_0x5b0be5){scripts[_0x8b68('0x8d')](this['channel'][_0x8b68('0x35')],_0x3d8d42[_0x8b68('0x89')],_0x3d8d42[_0x8b68('0x8e')],_0x3d8d42[_0x8b68('0x8f')],_0x3d8d42[_0x8b68('0x5b')],_0x3d8d42[_0x8b68('0x90')])[_0x8b68('0x15')](function(_0x4bb3c3){_0x5b0be5(null,_0x4bb3c3);})[_0x8b68('0x17')](function(_0x2ecedc){_0x5b0be5(_0x2ecedc);});};AGIVertices[_0x8b68('0x12')][_0x8b68('0x91')]=function(_0x333f4f,_0x36335f,_0x432547){scripts[_0x8b68('0x91')](_0x36335f,_0x333f4f[_0x8b68('0x79')],_0x333f4f[_0x8b68('0x92')]||_0x8b68('0x85'))[_0x8b68('0x15')](function(_0x255f24){_0x432547(null,_0x255f24);})[_0x8b68('0x17')](function(_0x4bf798){_0x432547(_0x4bf798);});};AGIVertices[_0x8b68('0x12')][_0x8b68('0x93')]=function(_0x17bea5,_0x2e690b,_0x475bf7){scripts[_0x8b68('0x93')](_0x2e690b,_0x17bea5['appid'],_0x17bea5[_0x8b68('0x94')],_0x17bea5[_0x8b68('0x6f')])[_0x8b68('0x15')](function(_0x10dc48){_0x475bf7(null,_0x10dc48);})[_0x8b68('0x17')](function(_0x5e2270){_0x475bf7(_0x5e2270);});};AGIVertices[_0x8b68('0x12')][_0x8b68('0x95')]=function(_0x43f916){var _0x5731ee=_[_0x8b68('0x96')](verticesWithRetry,_0x43f916['agicommand'])?_0x43f916:_['clone'](_0x43f916);for(var _0x4cba2d in _0x5731ee){if(_0x5731ee[_0x8b68('0x97')](_0x4cba2d)){if(_0x5731ee[_0x4cba2d]&&_[_0x8b68('0x98')](_0x5731ee[_0x4cba2d])){if(_['includes'](recursiveMapAttributes,_0x4cba2d)){_0x5731ee[_0x4cba2d]=this[_0x8b68('0x99')](_0x5731ee[_0x4cba2d]);}else{_0x5731ee[_0x4cba2d]=this[_0x8b68('0x9a')](_0x5731ee[_0x4cba2d]);}}}}return _0x5731ee;};AGIVertices[_0x8b68('0x12')][_0x8b68('0x9b')]=function(_0x295af3){for(var _0x14d553 in _0x295af3){if(_0x295af3[_0x8b68('0x97')](_0x14d553)){if(_[_0x8b68('0x9c')](_0x295af3[_0x14d553])){this[_0x8b68('0x9b')](_0x295af3[_0x14d553]);}else if(_[_0x8b68('0x9d')](_0x295af3[_0x14d553])){for(var _0x4ded6c=0x0;_0x4ded6c<_0x295af3[_0x14d553][_0x8b68('0x9e')];_0x4ded6c++){this[_0x8b68('0x9b')](_0x295af3[_0x14d553][_0x4ded6c]);}}else if(_['isString'](_0x295af3[_0x14d553])){_0x295af3[_0x14d553]=this[_0x8b68('0x9a')](_0x295af3[_0x14d553]);}}}};AGIVertices[_0x8b68('0x12')]['saveRestApiResult']=function(_0x4d2658,_0x798a24){for(var _0xed7a85 in _0x4d2658){if(_0x4d2658[_0x8b68('0x97')](_0xed7a85)){if(_[_0x8b68('0x9c')](_0x4d2658[_0xed7a85])){if(!_[_0x8b68('0x41')](_0x4d2658[_0xed7a85])){this[_0x8b68('0x9f')](_0x4d2658[_0xed7a85],util[_0x8b68('0x52')](_0x8b68('0xa0'),_0x798a24,_0xed7a85));}}else if(_['isArray'](_0x4d2658[_0xed7a85])){for(var _0x21c83f=0x0;_0x21c83f<_0x4d2658[_0xed7a85]['length'];_0x21c83f++){this['saveRestApiResult'](_0x4d2658[_0xed7a85][_0x21c83f],util[_0x8b68('0x52')](_0x8b68('0xa0'),_0x798a24,_0xed7a85+'['+_0x21c83f+']'));}}else{if(!_['isNil'](_0x4d2658[_0xed7a85])){this[_0x8b68('0xf')]['setVariable'](util[_0x8b68('0x52')](_0x8b68('0xa0'),_0x798a24,_0xed7a85),_0x4d2658[_0xed7a85]);}}}}};AGIVertices[_0x8b68('0x12')]['replaceObjectAllVariables']=function(_0x133557){try{var _0x4fea56=JSON['parse'](_0x133557);this[_0x8b68('0x9b')](_0x4fea56);return JSON[_0x8b68('0x71')](_0x4fea56);}catch(_0xd27126){return this[_0x8b68('0x9a')](_0x133557);}};AGIVertices[_0x8b68('0x12')][_0x8b68('0x9a')]=function(_0x2d0613){var _0x489c59=_0x2d0613[_0x8b68('0xa1')]('{');for(var _0x114f5=0x1;_0x114f5<_0x489c59[_0x8b68('0x9e')];_0x114f5+=0x1){var _0x1438e2=_0x489c59[_0x114f5][_0x8b68('0xa1')]('}');if(_0x1438e2[_0x8b68('0x9e')]>0x1){_0x2d0613=_0x2d0613[_0x8b68('0xa2')]('{'+_0x1438e2[0x0]+'}',this['channel'][_0x8b68('0x13')](_0x1438e2[0x0])[_0x8b68('0xa3')]||_0x1438e2[0x0]);}}if(_0x489c59['length']===0x1){return _0x2d0613['toString']();}return this[_0x8b68('0x9a')](_0x2d0613);};AGIVertices[_0x8b68('0x12')]['getAndSetVariable']=function(_0x335b0e,_0x3fdb7b){var _0x101da1=this[_0x8b68('0xf')][_0x8b68('0x13')](_0x335b0e);if(_0x101da1[_0x8b68('0xa4')]===-0x1){return _0x101da1;}logger[_0x8b68('0x2c')](util['format'](_0x8b68('0xa5'),_0x3fdb7b,_0x101da1[_0x8b68('0xa3')]));return this[_0x8b68('0xf')]['setVariable'](_0x3fdb7b,_0x101da1['extra']);};AGIVertices[_0x8b68('0x12')][_0x8b68('0x86')]=function(_0xe52af2){return _0xe52af2&&_0xe52af2!=='0'&&_0xe52af2!=='-1'&&_0xe52af2!=='';};AGIVertices['prototype']['maxRetry']=function(_0x5fbaa7){this[_0x8b68('0x34')][_0x8b68('0x6e')](this,_0x5fbaa7,'-');_0x5fbaa7['retry']=_0x5fbaa7['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0x8b68('0xa6')]=function(_0x3e7544){logger[_0x8b68('0x2c')](util[_0x8b68('0x52')](_0x8b68('0xa7'),_0x3e7544['label']));if(!this['isConfigured'](_0x3e7544[_0x8b68('0x5b')])){return this['channel']['noop']('no\x20text\x20configured');}var _0x3a6f12='\x22'+_0x3e7544[_0x8b68('0x5b')]+'\x22';if(this[_0x8b68('0x86')](_0x3e7544['options'])){_0x3a6f12+=','+_0x3e7544[_0x8b68('0x77')];}var _0x4af5bb=this[_0x8b68('0xf')][_0x8b68('0x56')](_0x8b68('0xa8'),_0x3a6f12);if(_0x4af5bb[_0x8b68('0xa4')]===-0x1){return _0x4af5bb;}return this[_0x8b68('0xf')][_0x8b68('0xa9')](util[_0x8b68('0x52')](_0x8b68('0xaa'),_0x3a6f12));};AGIVertices[_0x8b68('0x12')][_0x8b68('0xab')]=function(_0x25e8cd){logger[_0x8b68('0x2c')](util[_0x8b68('0x52')](_0x8b68('0xac'),_0x25e8cd[_0x8b68('0xad')]));if(!this[_0x8b68('0x86')](_0x25e8cd[_0x8b68('0xae')])){return this[_0x8b68('0xf')][_0x8b68('0xa9')]('no\x20grammar\x20configured');}var _0x1012e6=_0x25e8cd['grammar'];if(this[_0x8b68('0x86')](_0x25e8cd[_0x8b68('0x77')])){_0x1012e6+=','+_0x25e8cd[_0x8b68('0x77')];}var _0xca2bc4=this[_0x8b68('0xf')][_0x8b68('0x56')](_0x8b68('0xaf'),_0x1012e6);if(_0xca2bc4[_0x8b68('0xa4')]===-0x1){return _0xca2bc4;}var _0xf0c45d=this[_0x8b68('0xb0')](_0x8b68('0xb1'),_0x8b68('0xb2'));if(_0xf0c45d['result']===-0x1){return _0xf0c45d;}var _0x2d559c=this[_0x8b68('0xb0')](_0x8b68('0xb3'),_0x8b68('0xb4'));if(_0x2d559c[_0x8b68('0xa4')]===-0x1){return _0x2d559c;}var _0x409561=this[_0x8b68('0xb0')](_0x8b68('0xb5'),_0x8b68('0xb6'));if(_0x409561[_0x8b68('0xa4')]===-0x1){return _0x409561;}return this[_0x8b68('0xf')]['noop'](util[_0x8b68('0x52')](_0x8b68('0xb7'),_0x1012e6));};AGIVertices[_0x8b68('0x12')][_0x8b68('0x7')]=function(_0x1774bb){logger['info'](util[_0x8b68('0x52')](_0x8b68('0xb8'),_0x1774bb['label']));return this[_0x8b68('0xf')][_0x8b68('0x7')]([_0x1774bb['command'],_0x1774bb['args']]);};AGIVertices[_0x8b68('0x12')][_0x8b68('0xb9')]=function(_0x2b4173){logger[_0x8b68('0x2c')](util[_0x8b68('0x52')](_0x8b68('0xba'),_0x2b4173[_0x8b68('0xad')]));if(this[_0x8b68('0x86')](_0x2b4173['timeout'])){logger[_0x8b68('0x2c')](util[_0x8b68('0x52')](_0x8b68('0xbb'),_0x2b4173[_0x8b68('0x63')]));var _0x5124b2=this[_0x8b68('0xf')]['wait'](_0x2b4173[_0x8b68('0x63')]);if(_0x5124b2[_0x8b68('0xa4')]===-0x1){return _0x5124b2;}}return this[_0x8b68('0xf')][_0x8b68('0xb9')]();};AGIVertices[_0x8b68('0x12')][_0x8b68('0x48')]=function(_0x525020){logger['info'](util['format']('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x525020['label']));if(!this[_0x8b68('0x86')](_0x525020[_0x8b68('0x46')])){return this['channel']['error'](_0x525020,_0x8b68('0xbc'));}_0x525020[_0x8b68('0x47')]=moment();if(this['isConfigured'](_0x525020[_0x8b68('0xbd')])){_0x525020[_0x8b68('0x47')]=moment()['add'](_0x525020['delay'],_0x8b68('0xbe'));}if(!this[_0x8b68('0x86')](_0x525020[_0x8b68('0xbf')])){_0x525020[_0x8b68('0xbf')]=0x2;}this[_0x8b68('0x40')][_0x8b68('0x6e')](this,_0x525020);return this[_0x8b68('0xf')][_0x8b68('0xa9')](util['format'](_0x8b68('0xc0'),_0x525020[_0x8b68('0xc1')],_0x525020[_0x8b68('0x46')],_0x525020[_0x8b68('0x47')]));};AGIVertices[_0x8b68('0x12')]['custom_app']=function(_0x4442a9){logger['info'](util[_0x8b68('0x52')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x4442a9[_0x8b68('0xad')]));var _0x2afa34=this[_0x8b68('0xf')]['exec'](_0x4442a9[_0x8b68('0xc2')],_0x4442a9['options']);if(_0x2afa34[_0x8b68('0xa4')]===-0x1){return _0x2afa34;}return this[_0x8b68('0xf')][_0x8b68('0xa9')](util[_0x8b68('0x52')]('Executed\x20command\x20%s\x20%s',_0x4442a9[_0x8b68('0xc2')],_0x4442a9[_0x8b68('0x77')]));};AGIVertices[_0x8b68('0x12')][_0x8b68('0xc3')]=function(_0x36711d){logger[_0x8b68('0x2c')](util[_0x8b68('0x52')](_0x8b68('0xc4'),_0x36711d[_0x8b68('0xad')]));if(!this[_0x8b68('0x86')](_0x36711d[_0x8b68('0x5b')])){return this[_0x8b68('0xf')][_0x8b68('0xa9')](_0x8b68('0xc5'));}var _0x118f5e='\x22'+_0x36711d[_0x8b68('0x5b')]+'\x22';if(this['isConfigured'](_0x36711d[_0x8b68('0x77')])){_0x118f5e+=','+_0x36711d['options'];}var _0x43cf3b=this[_0x8b68('0xf')][_0x8b68('0x56')](_0x8b68('0xa8'),_0x118f5e);if(_0x43cf3b[_0x8b68('0xa4')]===-0x1){return _0x43cf3b;}return this[_0x8b68('0xf')]['noop'](util['format']('Executed\x20command\x20MRCPSynth\x20%s',_0x118f5e));};AGIVertices[_0x8b68('0x12')][_0x8b68('0xc6')]=function(_0x327581){logger[_0x8b68('0x2c')](util[_0x8b68('0x52')](_0x8b68('0xc7'),_0x327581[_0x8b68('0xad')]));if(!this[_0x8b68('0x86')](_0x327581[_0x8b68('0x5b')])){return this[_0x8b68('0xf')]['noop']('no\x20text\x20configured');}var _0x241846='\x22'+_0x327581['text']+'\x22';if(this[_0x8b68('0x86')](_0x327581[_0x8b68('0x77')])){_0x241846+=','+_0x327581[_0x8b68('0x77')];}var _0x24c182=this[_0x8b68('0xf')][_0x8b68('0x56')](_0x8b68('0xa8'),_0x241846);if(_0x24c182['result']===-0x1){return _0x24c182;}return this['channel'][_0x8b68('0xa9')](util[_0x8b68('0x52')](_0x8b68('0xaa'),_0x241846));};AGIVertices[_0x8b68('0x12')][_0x8b68('0xc8')]=function(_0x48282a){logger[_0x8b68('0x2c')](util[_0x8b68('0x52')](_0x8b68('0xc9'),_0x48282a[_0x8b68('0xad')]));if(!this[_0x8b68('0x86')](_0x48282a['grammar'])){return this[_0x8b68('0xf')][_0x8b68('0xa9')](_0x8b68('0xca'));}var _0x3dae61=_0x48282a[_0x8b68('0xae')];if(this['isConfigured'](_0x48282a[_0x8b68('0x77')])){_0x3dae61+=','+_0x48282a['options'];}var _0x40f89c=this[_0x8b68('0xf')]['exec'](_0x8b68('0xaf'),_0x3dae61);if(_0x40f89c[_0x8b68('0xa4')]===-0x1){return _0x40f89c;}var _0x3001e2=this['getAndSetVariable'](_0x8b68('0xb1'),_0x8b68('0xcb'));if(_0x3001e2['result']===-0x1){return _0x3001e2;}var _0x2603b4=this['getAndSetVariable'](_0x8b68('0xb3'),_0x8b68('0xcc'));if(_0x2603b4[_0x8b68('0xa4')]===-0x1){return _0x2603b4;}var _0x19e81f=this[_0x8b68('0xb0')](_0x8b68('0xb5'),_0x8b68('0xcd'));if(_0x19e81f[_0x8b68('0xa4')]===-0x1){return _0x19e81f;}return this[_0x8b68('0xf')][_0x8b68('0xa9')](util[_0x8b68('0x52')]('Executed\x20command\x20MRCPRecog\x20%s',_0x3dae61));};AGIVertices[_0x8b68('0x12')]['sestekasr']=function(_0xc7d251){logger[_0x8b68('0x2c')](util[_0x8b68('0x52')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0xc7d251[_0x8b68('0xad')]));if(!this['isConfigured'](_0xc7d251[_0x8b68('0xae')])){return this[_0x8b68('0xf')]['noop'](_0x8b68('0xca'));}var _0x4e4c0f=_0xc7d251[_0x8b68('0xae')];if(this['isConfigured'](_0xc7d251[_0x8b68('0x77')])){_0x4e4c0f+=','+_0xc7d251[_0x8b68('0x77')];}var _0x499d27=this[_0x8b68('0xf')][_0x8b68('0x56')]('MRCPRecog',_0x4e4c0f);if(_0x499d27['result']===-0x1){return _0x499d27;}var _0x5a19cb=this[_0x8b68('0xb0')](_0x8b68('0xb1'),_0x8b68('0xce'));if(_0x5a19cb[_0x8b68('0xa4')]===-0x1){return _0x5a19cb;}var _0x54419f=this[_0x8b68('0xb0')](_0x8b68('0xb3'),_0x8b68('0xcf'));if(_0x54419f[_0x8b68('0xa4')]===-0x1){return _0x54419f;}var _0x39598d=this[_0x8b68('0xb0')](_0x8b68('0xb5'),_0x8b68('0xd0'));if(_0x39598d[_0x8b68('0xa4')]===-0x1){return _0x39598d;}return this['channel'][_0x8b68('0xa9')](util['format']('Executed\x20command\x20MRCPRecog\x20%s',_0x4e4c0f));};AGIVertices['prototype'][_0x8b68('0xd1')]=function(_0x3a2e90){logger[_0x8b68('0x2c')](util[_0x8b68('0x52')](_0x8b68('0xd2'),_0x3a2e90[_0x8b68('0xad')]));if(!this[_0x8b68('0x86')](_0x3a2e90[_0x8b68('0xd3')])){return this[_0x8b68('0xf')][_0x8b68('0x2b')](_0x3a2e90,_0x8b68('0xd4'));}var _0x41e8cb=this[_0x8b68('0x1a')][_0x8b68('0x6e')](this,_0x3a2e90[_0x8b68('0xd3')]);if(!_0x41e8cb){return this[_0x8b68('0xf')]['error'](_0x3a2e90,_0x8b68('0xd5'));}if(!this[_0x8b68('0x86')](_0x3a2e90[_0x8b68('0x2e')])){return this[_0x8b68('0xf')][_0x8b68('0x2b')](_0x3a2e90,'no\x20query\x20configured');}var _0x1530fc=_0x3a2e90[_0x8b68('0x2e')][_0x8b68('0x58')](/(\r\n|\n|\r)/gm,'\x20');this[_0x8b68('0xf')][_0x8b68('0xa9')](util[_0x8b68('0x52')](_0x8b68('0xd6'),_0x1530fc));var _0x11b4a6=this[_0x8b68('0x29')][_0x8b68('0x6e')](this,_0x41e8cb,_0x1530fc);this[_0x8b68('0x34')][_0x8b68('0x6e')](this,_0x3a2e90,_0x1530fc);if(!this['isConfigured'](_0x3a2e90['variable_id'])){return this[_0x8b68('0xf')][_0x8b68('0xa9')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x2bb536=this[_0x8b68('0x13')][_0x8b68('0x6e')](this,_0x3a2e90[_0x8b68('0xd7')]);if(!_0x2bb536){return this[_0x8b68('0xf')]['error'](_0x3a2e90,'no\x20variable\x20found');}var _0x400c01=this;_0x11b4a6[_0x8b68('0xd8')](function(_0x5470d8,_0xad5f7a){Object[_0x8b68('0xd9')](_0x5470d8)['forEach'](function(_0x3791e0){_0x400c01['channel'][_0x8b68('0xda')](util[_0x8b68('0x52')](_0x8b68('0xdb'),_0x2bb536,_0xad5f7a,_0x3791e0),_0x5470d8[_0x3791e0]);});});this[_0x8b68('0xf')][_0x8b68('0xda')](util[_0x8b68('0x52')](_0x8b68('0xdc'),_0x2bb536),_0x11b4a6[_0x8b68('0x9e')]);return this['channel'][_0x8b68('0xa9')](util['format']('variable\x20%s\x20set',_0x2bb536));};AGIVertices[_0x8b68('0x12')][_0x8b68('0xdd')]=function(_0x100e77){logger['debug'](util['format'](_0x8b68('0xde'),_0x100e77['label']));if(!this[_0x8b68('0x86')](_0x100e77[_0x8b68('0xdf')])){return this[_0x8b68('0xf')]['error'](_0x100e77,_0x8b68('0xe0'));}var _0x4fb7f2=this['getUser'][_0x8b68('0x6e')](this,_0x100e77['sip_id']);if(!_0x4fb7f2){return this[_0x8b68('0xf')][_0x8b68('0x2b')](_0x100e77,_0x8b68('0xe1'));}var _0x1170b7=this[_0x8b68('0xf')][_0x8b68('0x56')](_0x8b68('0xe2'),[util[_0x8b68('0x52')](_0x8b68('0xe3'),_0x4fb7f2),_0x100e77[_0x8b68('0x63')],_0x100e77[_0x8b68('0xe4')],_0x100e77[_0x8b68('0x61')]]);if(_0x1170b7['result']===-0x1){return _0x1170b7;}return this[_0x8b68('0xf')][_0x8b68('0xa9')](util[_0x8b68('0x52')](_0x8b68('0xe5'),_0x8b68('0xe2')));};AGIVertices[_0x8b68('0x12')]['dialogflow']=function(_0x378ed8){logger[_0x8b68('0x2c')](util[_0x8b68('0x52')](_0x8b68('0xe6'),_0x378ed8[_0x8b68('0xad')]));if(!this[_0x8b68('0x86')](_0x378ed8[_0x8b68('0x79')])){return this[_0x8b68('0xf')][_0x8b68('0xa9')](_0x8b68('0xe7'));}if(!this[_0x8b68('0x86')](_0x378ed8[_0x8b68('0x5b')])){return this[_0x8b68('0xf')]['noop']('no\x20text\x20configured');}this[_0x8b68('0xf')][_0x8b68('0xe8')]=!![];this[_0x8b68('0x34')](_0x378ed8);this[_0x8b68('0x3f')](_0x378ed8[_0x8b68('0x5b')],'in','','');this[_0x8b68('0xf')][_0x8b68('0xa9')](util[_0x8b68('0x52')](_0x8b68('0xe9'),_0x378ed8['text']));var _0x5406f6=this[_0x8b68('0x78')]['sync'](this,_0x378ed8);if(_0x5406f6){for(var _0xbbe095 in _0x5406f6){if(_0x5406f6[_0x8b68('0x97')](_0xbbe095)){this[_0x8b68('0xf')][_0x8b68('0xda')](util[_0x8b68('0x52')](_0x8b68('0xea'),_0xbbe095[_0x8b68('0x66')]()),_0x5406f6[_0xbbe095]);}}this['createSquareMessage'](_0x5406f6[_0x8b68('0xeb')],_0x8b68('0xec'),_0x8b68('0xed'),'');return this['channel'][_0x8b68('0xa9')](util[_0x8b68('0x52')](_0x8b68('0xee'),_0x5406f6[_0x8b68('0xeb')]));}return this[_0x8b68('0xf')][_0x8b68('0x2b')](_0x378ed8,_0x8b68('0xef'));};AGIVertices[_0x8b68('0x12')][_0x8b68('0xf0')]=function(_0x52c03d){logger[_0x8b68('0x2c')](util[_0x8b68('0x52')](_0x8b68('0xf1'),_0x52c03d[_0x8b68('0xad')]));if(!this[_0x8b68('0x86')](_0x52c03d[_0x8b68('0x7c')])){return this['channel'][_0x8b68('0xa9')](_0x8b68('0xf2'));}if(!this[_0x8b68('0x86')](_0x52c03d[_0x8b68('0x7d')])){return this[_0x8b68('0xf')][_0x8b68('0xa9')](_0x8b68('0xf3'));}if(!this[_0x8b68('0x86')](_0x52c03d[_0x8b68('0x7e')])){return this[_0x8b68('0xf')][_0x8b68('0xa9')]('no\x20private_key\x20configured');}if(!this[_0x8b68('0x86')](_0x52c03d['dialogflowV2_language'])){return this[_0x8b68('0xf')][_0x8b68('0xa9')](_0x8b68('0xf4'));}if(!this[_0x8b68('0x86')](_0x52c03d[_0x8b68('0x5b')])){return this[_0x8b68('0xf')][_0x8b68('0xa9')](_0x8b68('0xc5'));}this[_0x8b68('0xf')][_0x8b68('0xe8')]=!![];this[_0x8b68('0x34')](_0x52c03d);this[_0x8b68('0x3f')](_0x52c03d[_0x8b68('0x5b')],'in','','');this[_0x8b68('0xf')][_0x8b68('0xa9')](util[_0x8b68('0x52')]('Trying\x20DialogflowV2:\x20%s',_0x52c03d['text']));var _0x61cf2d=this[_0x8b68('0x7b')][_0x8b68('0x6e')](this,_0x52c03d);if(_0x61cf2d){for(var _0x12524f in _0x61cf2d){if(_0x61cf2d[_0x8b68('0x97')](_0x12524f)){if(_0x12524f!==_0x8b68('0xf5')){this[_0x8b68('0xf')]['setVariable'](util[_0x8b68('0x52')](_0x8b68('0xea'),_0x12524f[_0x8b68('0x66')]()),_0x61cf2d[_0x12524f]);}}}this[_0x8b68('0x3f')](_0x61cf2d['speech'],'out',_0x8b68('0xf0'),_0x61cf2d[_0x8b68('0xf5')]);return this[_0x8b68('0xf')]['noop'](util['format']('DialogflowV2\x20Result\x20%s',_0x61cf2d[_0x8b68('0xeb')]));}return this[_0x8b68('0xf')][_0x8b68('0x2b')](_0x52c03d,'DialogflowV2\x20is\x20unreachable');};AGIVertices['prototype']['sesteknda']=function(_0x37d873){logger['info'](util[_0x8b68('0x52')](_0x8b68('0xf6'),_0x37d873[_0x8b68('0xad')]));if(!this[_0x8b68('0x86')](_0x37d873[_0x8b68('0xf7')])){return this['channel']['noop'](_0x8b68('0xf8'));}if(!this[_0x8b68('0x86')](_0x37d873['username'])){return this[_0x8b68('0xf')]['noop'](_0x8b68('0xf9'));}if(!this[_0x8b68('0x86')](_0x37d873[_0x8b68('0xfa')])){return this[_0x8b68('0xf')][_0x8b68('0xa9')](_0x8b68('0xfb'));}if(!this[_0x8b68('0x86')](_0x37d873[_0x8b68('0xfc')])){return this[_0x8b68('0xf')][_0x8b68('0xa9')](_0x8b68('0xc5'));}this[_0x8b68('0xf')][_0x8b68('0xe8')]=!![];this[_0x8b68('0x34')](_0x37d873);this[_0x8b68('0x3f')](_0x37d873['text'],'in','','');this[_0x8b68('0xf')]['noop'](util[_0x8b68('0x52')]('Trying\x20SestekNDA:\x20%s',_0x37d873[_0x8b68('0x5b')]));var _0x4b86d6=this[_0x8b68('0x80')][_0x8b68('0x6e')](this,_0x37d873);if(_0x4b86d6){for(var _0x3aad4c in _0x4b86d6){if(_0x4b86d6[_0x8b68('0x97')](_0x3aad4c)){this['channel'][_0x8b68('0xda')](util[_0x8b68('0x52')](_0x8b68('0xfd'),_0x3aad4c[_0x8b68('0x66')]()),_0x4b86d6[_0x3aad4c]);}}this[_0x8b68('0x3f')](_0x4b86d6['speech'],'out',_0x8b68('0xfe'),'');if(_0x4b86d6[_0x8b68('0xff')]){this[_0x8b68('0xf')][_0x8b68('0xa9')](util[_0x8b68('0x52')](_0x8b68('0x100'),_0x4b86d6[_0x8b68('0xff')]));var _0x1ee81b=this['channel'][_0x8b68('0x101')](_0x4b86d6[_0x8b68('0xff')]);try{fs['unlink'](_0x4b86d6[_0x8b68('0xff')]+_0x8b68('0x102'));}catch(_0x213a5e){logger['error'](_0x213a5e);}return _0x1ee81b;}else{return this[_0x8b68('0xf')][_0x8b68('0xa9')](util[_0x8b68('0x52')](_0x8b68('0x103'),_0x4b86d6[_0x8b68('0xeb')]));}}return this[_0x8b68('0xf')][_0x8b68('0x2b')](_0x37d873,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0x8b68('0x12')][_0x8b68('0x104')]=function(_0x44b2d6){logger['info'](util[_0x8b68('0x52')](_0x8b68('0x105'),_0x44b2d6[_0x8b68('0xad')]));return this[_0x8b68('0xf')][_0x8b68('0xa9')]('end');};AGIVertices['prototype'][_0x8b68('0x106')]=function(_0x1a75dc){logger[_0x8b68('0x2c')](util[_0x8b68('0x52')](_0x8b68('0x107'),_0x1a75dc[_0x8b68('0xad')]));var _0x5dceee='';if(_0x1a75dc['trunk_id']){if(!this[_0x8b68('0x86')](_0x1a75dc[_0x8b68('0x108')])){return this[_0x8b68('0xf')]['error'](_0x1a75dc,'no\x20trunk\x20selected');}else{var _0x2bffc3=parseInt(_0x1a75dc[_0x8b68('0x108')],0xa);if(isNaN(_0x2bffc3)){_0x5dceee=_0x1a75dc[_0x8b68('0x108')];}else{_0x5dceee=this[_0x8b68('0x1e')][_0x8b68('0x6e')](this,_0x1a75dc[_0x8b68('0x108')]);if(!_0x5dceee){return this['channel'][_0x8b68('0x2b')](_0x1a75dc,_0x8b68('0x109'));}}}}else if(_0x1a75dc['trunk_name']){_0x5dceee=_0x1a75dc[_0x8b68('0x10a')];}else{return this[_0x8b68('0xf')][_0x8b68('0x2b')](_0x1a75dc,_0x8b68('0x10b'));}var _0x3455f3=this[_0x8b68('0xf')][_0x8b68('0x56')](_0x8b68('0xe2'),[util[_0x8b68('0x52')](_0x8b68('0x10c'),_0x5dceee,_0x1a75dc[_0x8b68('0xc1')]),_0x1a75dc[_0x8b68('0x63')],_0x1a75dc[_0x8b68('0xe4')],_0x1a75dc[_0x8b68('0x61')]]);if(_0x3455f3[_0x8b68('0xa4')]===-0x1){return _0x3455f3;}return this['channel'][_0x8b68('0xa9')](util[_0x8b68('0x52')]('Executed\x20command\x20%s',_0x8b68('0xe2')));};AGIVertices[_0x8b68('0x12')]['finally']=function(_0x258609){logger[_0x8b68('0x2c')](util['format'](_0x8b68('0x10d'),_0x258609[_0x8b68('0xad')]));return this[_0x8b68('0xf')][_0x8b68('0xa9')](_0x8b68('0x10e'));};AGIVertices[_0x8b68('0x12')][_0x8b68('0xd')]=function(_0x33fa69){logger[_0x8b68('0x2c')](util[_0x8b68('0x52')](_0x8b68('0x10f'),_0x33fa69[_0x8b68('0xad')]));if(_0x33fa69['retry']===0x0){return this['maxRetry'](_0x33fa69);}_0x33fa69[_0x8b68('0x110')]-=0x1;if(!this['isConfigured'](_0x33fa69[_0x8b68('0x111')])){return this[_0x8b68('0xf')][_0x8b68('0x2b')](_0x33fa69,_0x8b68('0x112'));}var _0x344337=this[_0x8b68('0x113')]['sync'](this,_0x33fa69[_0x8b68('0x111')]);if(!_0x344337){return this[_0x8b68('0xf')]['error'](_0x33fa69,_0x8b68('0x114'));}if(!this[_0x8b68('0x86')](_0x33fa69[_0x8b68('0xd7')])){return this[_0x8b68('0xf')][_0x8b68('0x2b')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x2ff63f=this[_0x8b68('0xf')]['getData'](_0x344337,_0x33fa69[_0x8b68('0x115')],_0x33fa69[_0x8b68('0x116')]);var _0x270d19=_0x2ff63f[_0x8b68('0xa4')]?_0x2ff63f[_0x8b68('0xa4')]['toString']():'';logger[_0x8b68('0x2c')](_0x8b68('0x117'),JSON[_0x8b68('0x71')](_0x2ff63f));if(_0x2ff63f[_0x8b68('0xa4')]===-0x1){this['createSquareDetailsReport'][_0x8b68('0x6e')](this,_0x33fa69,_0x270d19);return _0x2ff63f;}else if(_0x2ff63f[_0x8b68('0xa3')]===_0x8b68('0x63')){_0x2ff63f[_0x8b68('0xa4')]=_0x270d19[_0x8b68('0x9e')]>=parseInt(_0x33fa69[_0x8b68('0x118')])?'x':'i';}else{_0x2ff63f[_0x8b68('0xa4')]=_0x270d19['length']>=parseInt(_0x33fa69[_0x8b68('0x118')])&&_0x270d19[_0x8b68('0x9e')]<=parseInt(_0x33fa69[_0x8b68('0x116')])?'x':'i';}var _0x4fd5d3=this['getVariable'][_0x8b68('0x6e')](this,_0x33fa69[_0x8b68('0xd7')]);if(!_0x4fd5d3){return this[_0x8b68('0xf')]['error'](_0x33fa69,_0x8b68('0x119'));}this['channel'][_0x8b68('0xda')](_0x4fd5d3,_0x270d19);if(this['isConfigured'](_0x33fa69['hiddendigitsnum'])){var _0x387ba0=parseInt(_0x33fa69['hiddendigitsnum'],0xa);var _0x302f73=rs[_0x8b68('0x11a')]({'charset':'*','length':_0x387ba0});var _0x299d83=_0x270d19['length'];if(_0x299d83>0x0){if(_0x299d83>_0x387ba0){this[_0x8b68('0x34')][_0x8b68('0x6e')](this,_0x33fa69,_0x33fa69[_0x8b68('0x11b')]==='first'?_0x302f73+_0x270d19[_0x8b68('0x11c')](_0x387ba0):_0x270d19['substr'](0x0,_0x299d83-_0x387ba0)+_0x302f73);}else{this['createSquareDetailsReport'][_0x8b68('0x6e')](this,_0x33fa69,rs[_0x8b68('0x11a')]({'charset':'*','length':_0x299d83}));}}else{this[_0x8b68('0x34')][_0x8b68('0x6e')](this,_0x33fa69,'');}}else{this[_0x8b68('0x34')][_0x8b68('0x6e')](this,_0x33fa69,_0x270d19);}return _0x2ff63f;};AGIVertices[_0x8b68('0x12')][_0x8b68('0xe')]=function(_0x122fb7){logger[_0x8b68('0x2c')](util[_0x8b68('0x52')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x122fb7[_0x8b68('0xad')]));return this[_0x8b68('0xd')](_0x122fb7);};AGIVertices['prototype'][_0x8b68('0x11d')]=function(_0x16629f){logger[_0x8b68('0x2c')](util['format'](_0x8b68('0x11e'),_0x16629f[_0x8b68('0xad')]));this[_0x8b68('0x34')][_0x8b68('0x6e')](this,_0x16629f,_0x16629f[_0x8b68('0x11f')]);return this['channel'][_0x8b68('0xa9')](util[_0x8b68('0x52')](_0x8b68('0x120'),_0x16629f[_0x8b68('0x11f')]));};AGIVertices[_0x8b68('0x12')][_0x8b68('0x121')]=function(_0x20adda){logger[_0x8b68('0x2c')](util[_0x8b68('0x52')](_0x8b68('0x122'),_0x20adda['label']));if(!this[_0x8b68('0x86')](_0x20adda['aws_access_key_id'])||!this[_0x8b68('0x86')](_0x20adda[_0x8b68('0x8e')])){return this[_0x8b68('0xf')][_0x8b68('0xa9')](_0x8b68('0x123'));}if(!this[_0x8b68('0x86')](_0x20adda[_0x8b68('0x5b')])){return this[_0x8b68('0xf')][_0x8b68('0xa9')](_0x8b68('0xc5'));}this[_0x8b68('0xf')][_0x8b68('0xa9')](util[_0x8b68('0x52')](_0x8b68('0x124'),_0x20adda[_0x8b68('0x5b')]));var _0x283543=this[_0x8b68('0x88')][_0x8b68('0x6e')](this,_0x20adda);if(_0x283543){this[_0x8b68('0xf')][_0x8b68('0xa9')](util[_0x8b68('0x52')](_0x8b68('0x125'),_0x283543));var _0x23ae91=this[_0x8b68('0xf')]['streamFile'](_0x283543);try{fs['unlink'](_0x283543+_0x8b68('0x102'));}catch(_0x514a34){logger[_0x8b68('0x2b')](_0x514a34);}return _0x23ae91;}return this[_0x8b68('0xf')][_0x8b68('0x2b')](_0x20adda,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0x8b68('0x12')]['awslex']=function(_0x2ef65d){logger['info'](util[_0x8b68('0x52')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x2ef65d[_0x8b68('0xad')]));if(!this[_0x8b68('0x86')](_0x2ef65d[_0x8b68('0x89')])||!this[_0x8b68('0x86')](_0x2ef65d['aws_secret_access_key'])){return this[_0x8b68('0xf')][_0x8b68('0xa9')](_0x8b68('0x123'));}if(!this[_0x8b68('0x86')](_0x2ef65d[_0x8b68('0x90')])){return this[_0x8b68('0xf')][_0x8b68('0xa9')](_0x8b68('0x126'));}if(!this['isConfigured'](_0x2ef65d[_0x8b68('0x5b')])){return this[_0x8b68('0xf')]['noop'](_0x8b68('0xc5'));}this[_0x8b68('0xf')][_0x8b68('0xe8')]=!![];this[_0x8b68('0x34')](_0x2ef65d);this[_0x8b68('0x3f')](_0x2ef65d[_0x8b68('0x5b')],'in','','');this['channel'][_0x8b68('0xa9')](util[_0x8b68('0x52')](_0x8b68('0x127'),_0x2ef65d[_0x8b68('0x5b')]));var _0x124cf0=this[_0x8b68('0x8d')][_0x8b68('0x6e')](this,_0x2ef65d);if(_0x124cf0){for(var _0x35bceb in _0x124cf0){if(_0x124cf0[_0x8b68('0x97')](_0x35bceb)&&_[_0x8b68('0x98')](_0x124cf0[_0x35bceb])){this['channel'][_0x8b68('0xda')](util[_0x8b68('0x52')](_0x8b68('0x128'),_0x35bceb[_0x8b68('0x66')]()),_0x124cf0[_0x35bceb]);}}if(_['isNil'](_0x124cf0[_0x8b68('0x75')])){return this[_0x8b68('0xf')]['noop'](_0x8b68('0x129'));}else{this[_0x8b68('0x3f')](_0x124cf0[_0x8b68('0x75')],_0x8b68('0xec'),'amazonlex','');return this[_0x8b68('0xf')][_0x8b68('0xa9')](util[_0x8b68('0x52')](_0x8b68('0x12a'),_0x124cf0[_0x8b68('0x75')]));}}return this[_0x8b68('0xf')][_0x8b68('0x2b')](_0x2ef65d,_0x8b68('0x12b'));};AGIVertices[_0x8b68('0x12')][_0x8b68('0x12c')]=function(_0x20e84e){logger[_0x8b68('0x2c')](util[_0x8b68('0x52')](_0x8b68('0x12d'),_0x20e84e[_0x8b68('0xad')],_0x20e84e['timeout']));if(!this[_0x8b68('0x86')](_0x20e84e[_0x8b68('0x79')])){return this[_0x8b68('0xf')][_0x8b68('0xa9')](_0x8b68('0xe7'));}var _0x3544cb=_0x8b68('0x12e');var _0xf45a48=util['format']('%s/recordings/%s',FILES_PATH,rs['generate'](0x4));var _0x304738=util[_0x8b68('0x52')](_0x8b68('0xa0'),_0xf45a48,_0x3544cb);var _0x104a4f=!![];if(_0x20e84e['beep']==='NOBEEP'){_0x104a4f=![];}var _0x5bd77d=this[_0x8b68('0xf')][_0x8b68('0x12f')](_0xf45a48,_0x3544cb,_0x20e84e[_0x8b68('0x130')],_0x20e84e[_0x8b68('0x63')],undefined,_0x104a4f);if(_0x5bd77d['result']!==-0x1){this[_0x8b68('0xf')][_0x8b68('0xa9')](util[_0x8b68('0x52')]('google\x20%s\x20file\x20created',_0x304738));var _0x528900=this['googleASR'][_0x8b68('0x6e')](this,_0x20e84e,_0x304738);if(_0x528900){for(var _0x554d3c in _0x528900){if(_0x528900[_0x8b68('0x97')](_0x554d3c)){this[_0x8b68('0xf')][_0x8b68('0xda')](util['format']('GOOGLE_ASR_%s',_0x554d3c['toUpperCase']()),_0x528900[_0x554d3c]);}}return this['channel'][_0x8b68('0xa9')](util['format'](_0x8b68('0x131'),JSON[_0x8b68('0x71')](_0x528900)));}}return _0x5bd77d;};AGIVertices[_0x8b68('0x12')][_0x8b68('0x132')]=function(_0xa059b6){logger[_0x8b68('0x2c')](util[_0x8b68('0x52')](_0x8b68('0x133'),_0xa059b6[_0x8b68('0xad')]));if(!this['isConfigured'](_0xa059b6[_0x8b68('0x134')])){return this[_0x8b68('0xf')]['noop']('no\x20appid\x20configured');}if(!this['isConfigured'](_0xa059b6['appsecret'])){return this[_0x8b68('0xf')][_0x8b68('0xa9')](_0x8b68('0x135'));}var _0x2f0c4a=_0x8b68('0x12e');var _0x13d35=util[_0x8b68('0x52')](_0x8b68('0x136'),FILES_PATH,rs[_0x8b68('0x11a')](0x4));var _0x53d856=util[_0x8b68('0x52')]('%s.%s',_0x13d35,_0x2f0c4a);var _0x4c5b31=!![];if(_0xa059b6[_0x8b68('0x137')]===_0x8b68('0x138')){_0x4c5b31=![];}var _0x31eba8=this[_0x8b68('0xf')][_0x8b68('0x12f')](_0x13d35,_0x2f0c4a,_0xa059b6[_0x8b68('0x130')],_0xa059b6[_0x8b68('0x63')],undefined,_0x4c5b31);if(_0x31eba8[_0x8b68('0xa4')]!==-0x1){this[_0x8b68('0xf')][_0x8b68('0xa9')](util['format'](_0x8b68('0x139'),_0x53d856));var _0x4b922a=this['tildeASR'][_0x8b68('0x6e')](this,_0xa059b6,_0x53d856);if(_0x4b922a){for(var _0x19af01 in _0x4b922a){if(_0x4b922a['hasOwnProperty'](_0x19af01)){this[_0x8b68('0xf')]['setVariable'](util[_0x8b68('0x52')](_0x8b68('0x13a'),_0x19af01[_0x8b68('0x66')]()),_0x4b922a[_0x19af01]);}}return this[_0x8b68('0xf')]['noop'](util['format']('TildeASR\x20Result\x20%s',JSON[_0x8b68('0x71')](_0x4b922a)));}}return _0x31eba8;};AGIVertices[_0x8b68('0x12')][_0x8b68('0x13b')]=function(_0x2f31d3){logger[_0x8b68('0x2c')](util[_0x8b68('0x52')](_0x8b68('0x13c'),_0x2f31d3[_0x8b68('0xad')]));return this[_0x8b68('0xf')][_0x8b68('0x13d')](_0x2f31d3['context'],_0x2f31d3[_0x8b68('0x13e')],_0x2f31d3[_0x8b68('0x3c')]);};AGIVertices['prototype'][_0x8b68('0x13f')]=function(_0x836f76){logger[_0x8b68('0x2c')](util['format'](_0x8b68('0x140'),_0x836f76[_0x8b68('0xad')]));if(!this[_0x8b68('0x86')](_0x836f76[_0x8b68('0x141')])){return this['channel'][_0x8b68('0x2b')](_0x836f76,'no\x20condition\x20configured');}try{var _0xc52ca3=eval(_0x836f76[_0x8b68('0x141')])?_0x8b68('0x142'):_0x8b68('0x143');this['channel'][_0x8b68('0xa9')](util[_0x8b68('0x52')](_0x8b68('0x144'),_0x836f76['condition'],_0xc52ca3));return{'code':0xc8,'result':_0xc52ca3};}catch(_0x469635){return{'code':0xc8,'result':_0x8b68('0x143')};}};AGIVertices['prototype'][_0x8b68('0x145')]=function(_0x4e1918){logger['info'](util['format'](_0x8b68('0x146'),_0x4e1918[_0x8b68('0xad')]));if(!this['isConfigured'](_0x4e1918[_0x8b68('0x147')])){return this['channel'][_0x8b68('0x2b')](_0x4e1918,_0x8b68('0x148'));}var _0x3ad8f2=this[_0x8b68('0x22')][_0x8b68('0x6e')](this,_0x4e1918[_0x8b68('0x147')]);if(!_0x3ad8f2){return this[_0x8b68('0xf')]['error'](_0x4e1918,'no\x20intervals\x20found');}for(var _0x4d614e=0x0;_0x4d614e<_0x3ad8f2[_0x8b68('0x9e')];_0x4d614e+=0x1){var _0x541528=this[_0x8b68('0xf')][_0x8b68('0x13')](util[_0x8b68('0x52')](_0x8b68('0x149'),_0x3ad8f2[_0x4d614e]));if(_0x541528[_0x8b68('0xa4')]===-0x1){return _0x541528;}logger[_0x8b68('0x2c')](util[_0x8b68('0x52')](_0x8b68('0x14a'),_0x3ad8f2[_0x4d614e],_0x541528['extra']));if(_0x541528[_0x8b68('0xa3')]==='true'){logger['info'](util['format']('IFTIME\x20%s\x20%s',_0x3ad8f2[_0x4d614e],_0x8b68('0x142')));this[_0x8b68('0xf')][_0x8b68('0xa9')](util[_0x8b68('0x52')](_0x8b68('0x14a'),_0x3ad8f2[_0x4d614e],_0x8b68('0x142')));return{'code':0xc8,'result':_0x8b68('0x142')};}else{logger[_0x8b68('0x2c')](util[_0x8b68('0x52')](_0x8b68('0x14a'),_0x3ad8f2[_0x4d614e],_0x8b68('0x143')));this[_0x8b68('0xf')]['noop'](util[_0x8b68('0x52')](_0x8b68('0x14a'),_0x3ad8f2[_0x4d614e],_0x8b68('0x143')));}}return{'code':0xc8,'result':_0x8b68('0x143')};};AGIVertices['prototype'][_0x8b68('0x14b')]=function(_0x43c466){logger['info'](util[_0x8b68('0x52')](_0x8b68('0x14c'),_0x43c466[_0x8b68('0xad')]));return this[_0x8b68('0xf')][_0x8b68('0x14b')]();};AGIVertices[_0x8b68('0x12')][_0x8b68('0x14d')]=function(_0x138240){logger[_0x8b68('0x2c')](util[_0x8b68('0x52')]('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x138240[_0x8b68('0xad')]));if(!this['isConfigured'](_0x138240[_0x8b68('0x79')])){return this[_0x8b68('0xf')][_0x8b68('0xa9')](_0x8b68('0xe7'));}var _0x2f1d6a='wav';var _0x209024=util['format']('%s/recordings/%s',FILES_PATH,rs[_0x8b68('0x11a')](0x4));var _0x106f71=util[_0x8b68('0x52')]('%s.%s',_0x209024,_0x2f1d6a);var _0x37e51a=!![];if(_0x138240['beep']===_0x8b68('0x138')){_0x37e51a=![];}var _0x5e9f35=this[_0x8b68('0xf')][_0x8b68('0x12f')](_0x209024,_0x2f1d6a,_0x138240['intKey'],_0x138240[_0x8b68('0x63')],undefined,_0x37e51a);if(_0x5e9f35[_0x8b68('0xa4')]!==-0x1){this[_0x8b68('0xf')][_0x8b68('0xa9')](util[_0x8b68('0x52')]('ispeech\x20%s\x20file\x20created',_0x106f71));var _0x5e4135=this[_0x8b68('0x83')][_0x8b68('0x6e')](this,_0x138240,_0x106f71);if(_0x5e4135){for(var _0x4c4931 in _0x5e4135){if(_0x5e4135['hasOwnProperty'](_0x4c4931)){this[_0x8b68('0xf')][_0x8b68('0xda')](util[_0x8b68('0x52')]('ISPEECH_ASR_%s',_0x4c4931['toUpperCase']()),_0x5e4135[_0x4c4931]);}}return this[_0x8b68('0xf')][_0x8b68('0xa9')](util[_0x8b68('0x52')]('IspeechASR\x20Result\x20%s',JSON[_0x8b68('0x71')](_0x5e4135)));}}return _0x5e9f35;};AGIVertices['prototype'][_0x8b68('0x14e')]=function(_0x566871){logger[_0x8b68('0x2c')](util['format'](_0x8b68('0x14f'),_0x566871[_0x8b68('0xad')]));if(!this[_0x8b68('0x86')](_0x566871[_0x8b68('0x79')])){return this[_0x8b68('0xf')]['noop'](_0x8b68('0xe7'));}if(!this['isConfigured'](_0x566871[_0x8b68('0x5b')])){return this[_0x8b68('0xf')][_0x8b68('0xa9')](_0x8b68('0xc5'));}this['channel'][_0x8b68('0xa9')](util[_0x8b68('0x52')](_0x8b68('0x150'),_0x566871[_0x8b68('0x5b')]));var _0xa5c9f0=this[_0x8b68('0x81')]['sync'](this,_0x566871);if(_0xa5c9f0){this[_0x8b68('0xf')][_0x8b68('0xa9')](util[_0x8b68('0x52')](_0x8b68('0x151'),_0xa5c9f0));var _0x594097=this[_0x8b68('0xf')]['streamFile'](_0xa5c9f0,_0x566871[_0x8b68('0x130')]);try{fs['unlink'](_0xa5c9f0+_0x8b68('0x102'));}catch(_0x3823ac){logger['error'](_0x3823ac);}return _0x594097;}return this['channel'][_0x8b68('0x2b')](_0x566871,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0x8b68('0x12')]['login']=function(_0x34e378){logger[_0x8b68('0x2c')](util[_0x8b68('0x52')](_0x8b68('0x152'),_0x34e378['label']));if(!this[_0x8b68('0x86')](_0x34e378[_0x8b68('0x153')])){return this['channel'][_0x8b68('0x2b')](_0x34e378,_0x8b68('0x154'));}logger['info'](util[_0x8b68('0x52')](_0x8b68('0x155'),this[_0x8b68('0xf')][_0x8b68('0x39')],_0x34e378[_0x8b68('0x153')]));var _0x4527cb=this['agentLogin'][_0x8b68('0x6e')](this,_0x34e378[_0x8b68('0x153')]);if(_0x4527cb){logger[_0x8b68('0x2c')](util[_0x8b68('0x52')](_0x8b68('0x156'),this[_0x8b68('0xf')]['callerid'],_0x34e378[_0x8b68('0x153')]));this['channel'][_0x8b68('0xa9')](util[_0x8b68('0x52')](_0x8b68('0x156'),this[_0x8b68('0xf')][_0x8b68('0x39')],_0x34e378['findBy']));return{'code':0xc8,'result':_0x8b68('0x157')};}else{logger['info'](util[_0x8b68('0x52')](_0x8b68('0x158'),this[_0x8b68('0xf')][_0x8b68('0x39')],_0x34e378[_0x8b68('0x153')]));this[_0x8b68('0xf')][_0x8b68('0xa9')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x8b68('0xf')]['callerid'],_0x34e378[_0x8b68('0x153')]));return{'code':0xc8,'result':_0x8b68('0x159')};}};AGIVertices[_0x8b68('0x12')][_0x8b68('0x15a')]=function(_0x261438){logger[_0x8b68('0x2c')](util['format'](_0x8b68('0x15b'),_0x261438['label']));if(!this[_0x8b68('0x86')](_0x261438['findBy'])){return this['channel']['error'](_0x261438,'no\x20find\x20by\x20configured');}logger['info'](util[_0x8b68('0x52')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x8b68('0xf')]['callerid'],_0x261438[_0x8b68('0x153')]));var _0x3564ef=this[_0x8b68('0x50')][_0x8b68('0x6e')](this,_0x261438['findBy']);if(_0x3564ef){logger[_0x8b68('0x2c')](util['format'](_0x8b68('0x156'),this[_0x8b68('0xf')]['callerid'],_0x261438[_0x8b68('0x153')]));this[_0x8b68('0xf')][_0x8b68('0xa9')](util[_0x8b68('0x52')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x8b68('0xf')]['callerid'],_0x261438[_0x8b68('0x153')]));return{'code':0xc8,'result':'success'};}else{logger['info'](util[_0x8b68('0x52')](_0x8b68('0x158'),this[_0x8b68('0xf')][_0x8b68('0x39')],_0x261438['findBy']));this[_0x8b68('0xf')][_0x8b68('0xa9')](util['format'](_0x8b68('0x158'),this[_0x8b68('0xf')][_0x8b68('0x39')],_0x261438['findBy']));return{'code':0xc8,'result':_0x8b68('0x159')};}};AGIVertices[_0x8b68('0x12')][_0x8b68('0x15c')]=function(_0x5cdb95){logger[_0x8b68('0x2c')](util['format'](_0x8b68('0x15d'),_0x5cdb95['label']));if(!this[_0x8b68('0x86')](_0x5cdb95['operation'])){return this[_0x8b68('0xf')][_0x8b68('0x2b')](_0x5cdb95,_0x8b68('0x15e'));}this[_0x8b68('0xf')][_0x8b68('0xa9')](util['format'](_0x8b68('0x15f'),_0x5cdb95['operation']));var _0x3018a6=eval(_0x5cdb95[_0x8b68('0x160')]);if(!this['isConfigured'](_0x5cdb95['variable_id'])){return this[_0x8b68('0xf')][_0x8b68('0xa9')](_0x8b68('0x161'));}var _0x2a1c49=this[_0x8b68('0x13')][_0x8b68('0x6e')](this,_0x5cdb95['variable_id']);if(!_0x2a1c49){return this['channel'][_0x8b68('0x2b')](_0x5cdb95,_0x8b68('0x119'));}if(_['isArray'](_0x3018a6)){var _0x1d73c7=this;_0x3018a6[_0x8b68('0xd8')](function(_0x3f29fe,_0x200fd4){_0x1d73c7[_0x8b68('0xf')][_0x8b68('0xda')](util[_0x8b68('0x52')]('%s[%s]',_0x2a1c49,_0x200fd4),_0x3f29fe);});return this[_0x8b68('0xf')]['noop'](util['format'](_0x8b68('0x162'),_0x2a1c49));}else{return this['channel'][_0x8b68('0xda')](_0x2a1c49,_0x3018a6);}};AGIVertices['prototype'][_0x8b68('0xc')]=function(_0x4d24de){logger[_0x8b68('0x2c')](util[_0x8b68('0x52')]('Enter\x20in\x20MENU\x20(%s)\x20block',_0x4d24de[_0x8b68('0xad')]));if(_0x4d24de[_0x8b68('0x110')]===0x0){return this[_0x8b68('0x163')](_0x4d24de);}_0x4d24de[_0x8b68('0x110')]-=0x1;if(!this['isConfigured'](_0x4d24de[_0x8b68('0x111')])){return this[_0x8b68('0xf')][_0x8b68('0x2b')](_0x4d24de,_0x8b68('0x112'));}var _0x20a933=this[_0x8b68('0x113')][_0x8b68('0x6e')](this,_0x4d24de['file_id']);if(!_0x20a933){return this[_0x8b68('0xf')][_0x8b68('0x2b')](_0x4d24de,'no\x20file\x20audio\x20found');}var _0x14490a=this['channel'][_0x8b68('0x164')](_0x20a933,_0x4d24de[_0x8b68('0x115')],_0x4d24de[_0x8b68('0x165')]);var _0x1f9010=_0x14490a[_0x8b68('0xa4')];if(_0x14490a[_0x8b68('0xa4')]===-0x1){this['createSquareDetailsReport'][_0x8b68('0x6e')](this,_0x4d24de,'-1');return _0x14490a;}else if(_0x14490a[_0x8b68('0xa3')]===_0x8b68('0x63')){_0x14490a[_0x8b68('0xa4')]=_0x14490a[_0x8b68('0xa4')][_0x8b68('0x9e')]>0x0?_0x14490a[_0x8b68('0xa4')]:'t';}else if(_[_0x8b68('0x41')](_0x14490a[_0x8b68('0xa4')])){_0x14490a['result']='#';_0x1f9010='#';}if(!this['isConfigured'](_0x4d24de[_0x8b68('0xd7')])){this[_0x8b68('0xf')][_0x8b68('0xa9')](_0x8b68('0x161'));}else{var _0x35feb9=this[_0x8b68('0x13')][_0x8b68('0x6e')](this,_0x4d24de[_0x8b68('0xd7')]);if(!_0x35feb9){return this['channel']['error'](_0x4d24de,_0x8b68('0x119'));}this['channel'][_0x8b68('0xda')](_0x35feb9,_0x1f9010);}this[_0x8b68('0x34')][_0x8b68('0x6e')](this,_0x4d24de,_0x1f9010);return _0x14490a;};AGIVertices['prototype']['noop']=function(_0x2e9f61){logger[_0x8b68('0x2c')](util[_0x8b68('0x52')]('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x2e9f61[_0x8b68('0xad')]));return this[_0x8b68('0xf')][_0x8b68('0xa9')](_0x2e9f61[_0x8b68('0x166')]||_0x2e9f61[_0x8b68('0xad')]);};AGIVertices[_0x8b68('0x12')]['pause']=function(_0x2bd8f8){logger[_0x8b68('0x2c')](util[_0x8b68('0x52')]('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x2bd8f8[_0x8b68('0xad')]));if(!this[_0x8b68('0x86')](_0x2bd8f8['findBy'])){return this[_0x8b68('0xf')][_0x8b68('0x2b')](_0x2bd8f8,_0x8b68('0x154'));}logger['info'](util[_0x8b68('0x52')](_0x8b68('0x155'),this[_0x8b68('0xf')][_0x8b68('0x39')],_0x2bd8f8[_0x8b68('0x153')]));var _0x72b480=this['getPause']['sync'](this,_0x2bd8f8[_0x8b68('0x167')]);var _0x577ae8=this[_0x8b68('0x4d')]['sync'](this,_0x2bd8f8[_0x8b68('0x153')],_0x72b480);if(_0x577ae8){logger['info'](util['format'](_0x8b68('0x156'),this[_0x8b68('0xf')][_0x8b68('0x39')],_0x2bd8f8[_0x8b68('0x153')]));this[_0x8b68('0xf')][_0x8b68('0xa9')](util['format'](_0x8b68('0x156'),this[_0x8b68('0xf')][_0x8b68('0x39')],_0x2bd8f8[_0x8b68('0x153')]));return{'code':0xc8,'result':_0x8b68('0x157')};}else{logger[_0x8b68('0x2c')](util[_0x8b68('0x52')](_0x8b68('0x158'),this[_0x8b68('0xf')][_0x8b68('0x39')],_0x2bd8f8['findBy']));this[_0x8b68('0xf')]['noop'](util[_0x8b68('0x52')](_0x8b68('0x156'),this[_0x8b68('0xf')][_0x8b68('0x39')],_0x2bd8f8[_0x8b68('0x153')]));return{'code':0xc8,'result':_0x8b68('0x159')};}};AGIVertices['prototype']['playback']=function(_0x402748){logger[_0x8b68('0x2c')](util['format']('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x402748['label']));if(!this[_0x8b68('0x86')](_0x402748[_0x8b68('0x111')])){return this[_0x8b68('0xf')][_0x8b68('0x2b')](_0x402748,'no\x20file\x20audio\x20selected');}var _0x162f86=this[_0x8b68('0x113')]['sync'](this,_0x402748[_0x8b68('0x111')]);if(!_0x162f86){return this['channel'][_0x8b68('0x2b')](_0x402748,'no\x20file\x20audio\x20found');}var _0x444e3b=this[_0x8b68('0xf')][_0x8b68('0x56')](_0x8b68('0x168'),[_0x162f86,_0x402748[_0x8b68('0xe4')]]);if(_0x444e3b[_0x8b68('0xa4')]===-0x1){return _0x444e3b;}return this[_0x8b68('0xf')][_0x8b68('0xa9')](util[_0x8b68('0x52')](_0x8b68('0x169'),_0x8b68('0x168'),_0x162f86));};AGIVertices[_0x8b68('0x12')][_0x8b68('0x16a')]=function(_0x4444cb){logger['info'](util[_0x8b68('0x52')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x4444cb[_0x8b68('0xad')]));if(!this['isConfigured'](_0x4444cb['queue_id'])){return this[_0x8b68('0xf')][_0x8b68('0x2b')](_0x4444cb,_0x8b68('0x16b'));}var _0x498346='';var _0x42ed2e=parseInt(_0x4444cb['queue_id'],0xa);if(isNaN(_0x42ed2e)){_0x498346=_0x4444cb['queue_id'];}else{_0x498346=this[_0x8b68('0x18')]['sync'](this,_0x4444cb[_0x8b68('0x16c')]);if(!_0x498346){return this[_0x8b68('0xf')]['error'](_0x4444cb,_0x8b68('0x16d'));}}var _0x72369a='';if(this[_0x8b68('0x86')](_0x4444cb['file_id'])){var _0x21edf0=this['getSound'][_0x8b68('0x6e')](this,_0x4444cb[_0x8b68('0x111')]);if(_0x21edf0){_0x72369a=_0x21edf0;}}this[_0x8b68('0x34')][_0x8b68('0x6e')](this,_0x4444cb,_0x498346);if(_0x4444cb[_0x8b68('0xe4')]['indexOf']('x')<0x0){_0x4444cb[_0x8b68('0xe4')]+='x';}if(_0x4444cb['opts'][_0x8b68('0x16e')]('X')<0x0){_0x4444cb[_0x8b68('0xe4')]+='X';}this[_0x8b68('0xf')][_0x8b68('0xda')](_0x8b68('0x16f'),_0x498346?_0x498346['toLowerCase']():'');var _0x23a5f7=this[_0x8b68('0xf')][_0x8b68('0x56')](_0x8b68('0x170'),[_0x498346,_0x4444cb['opts'],_0x4444cb[_0x8b68('0x61')],_0x72369a,_0x4444cb[_0x8b68('0x63')],_0x4444cb['agi'],_0x4444cb[_0x8b68('0x171')],_0x4444cb['gosub'],'',_0x4444cb[_0x8b68('0x172')]]);if(_0x23a5f7[_0x8b68('0xa4')]===-0x1){return _0x23a5f7;}return this[_0x8b68('0xf')][_0x8b68('0xa9')](util[_0x8b68('0x52')](_0x8b68('0x169'),_0x8b68('0x170'),_0x498346));};AGIVertices[_0x8b68('0x12')][_0x8b68('0x173')]=function(_0x50da9e){logger[_0x8b68('0x2c')](util['format']('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x50da9e['label']));var _0x54d9a7=_0x50da9e['recordingFormat']||'wav';var _0x3bad39=util[_0x8b68('0x52')](_0x8b68('0x174'),this[_0x8b68('0xf')][_0x8b68('0x35')],rs[_0x8b68('0x11a')](0x5));var _0x4953da=util[_0x8b68('0x52')](_0x8b68('0x175'),FILES_PATH,_0x3bad39,_0x54d9a7);var _0x411072=util[_0x8b68('0x52')](_0x8b68('0x136'),FILES_PATH,_0x3bad39);this[_0x8b68('0x38')][_0x8b68('0x6e')](this,_0x50da9e,_0x3bad39,_0x4953da);this['channel'][_0x8b68('0xda')](_0x8b68('0x176'),_0x3bad39);logger[_0x8b68('0x2c')](_0x8b68('0x177'),_0x411072,_0x54d9a7,_0x50da9e['escape_digits'],_0x50da9e[_0x8b68('0x63')]);return this[_0x8b68('0xf')][_0x8b68('0x12f')](_0x411072,_0x54d9a7,_0x50da9e['escape_digits'],_0x50da9e[_0x8b68('0x63')],undefined,!![]);};AGIVertices['prototype']['restapi']=function(_0x40dfb4){logger[_0x8b68('0x2c')](util[_0x8b68('0x52')](_0x8b68('0x178'),_0x40dfb4[_0x8b68('0xad')]));if(!this[_0x8b68('0x86')](_0x40dfb4['url'])){return this['channel']['noop']('no\x20url\x20configured');}var _0xa0b965=this[_0x8b68('0x179')]['sync'](this,_0x40dfb4);logger['info'](util[_0x8b68('0x52')](_0x8b68('0x17a'),util[_0x8b68('0x17b')](_0xa0b965,{'showHidden':![],'depth':null})));if(!this[_0x8b68('0x86')](_0x40dfb4[_0x8b68('0xd7')])){return this[_0x8b68('0xf')][_0x8b68('0xa9')](_0x8b68('0x17c'));}var _0xbc29cb=this[_0x8b68('0x13')][_0x8b68('0x6e')](this,_0x40dfb4[_0x8b68('0xd7')]);if(!_0xbc29cb){return this[_0x8b68('0xf')][_0x8b68('0x2b')](_0x40dfb4,_0x8b68('0x119'));}this['channel'][_0x8b68('0xda')](util[_0x8b68('0x52')](_0x8b68('0x17d'),_0xbc29cb),_0xa0b965[_0x8b68('0x73')]?_0xa0b965[_0x8b68('0x73')]:'200');this[_0x8b68('0xf')]['setVariable'](util[_0x8b68('0x52')](_0x8b68('0x17e'),_0xbc29cb),_0xa0b965[_0x8b68('0x74')]?_0xa0b965[_0x8b68('0x74')]:'OK');if(_0xa0b965['body']){try{this[_0x8b68('0x9f')](_0xa0b965[_0x8b68('0x67')],_0xbc29cb);}catch(_0x32adc2){logger[_0x8b68('0x2b')](util['format']('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0xbc29cb));}}return this[_0x8b68('0xf')][_0x8b68('0xa9')](util[_0x8b68('0x52')](_0x8b68('0x17f'),_0xbc29cb));};AGIVertices['prototype'][_0x8b68('0x180')]=function(_0x3cf66e){logger[_0x8b68('0x2c')](util[_0x8b68('0x52')](_0x8b68('0x181'),_0x3cf66e[_0x8b68('0xad')]));return this['channel'][_0x8b68('0x182')](_0x3cf66e[_0x8b68('0x183')]['replace'](/\s+/g,''),_0x3cf66e['escape_digits']);};AGIVertices[_0x8b68('0x12')][_0x8b68('0x184')]=function(_0x8d51fc){logger[_0x8b68('0x2c')](util[_0x8b68('0x52')](_0x8b68('0x185'),_0x8d51fc[_0x8b68('0xad')]));return this[_0x8b68('0xf')][_0x8b68('0x186')](_0x8d51fc[_0x8b68('0x64')]['replace'](/\s+/g,''),_0x8d51fc[_0x8b68('0x187')]);};AGIVertices[_0x8b68('0x12')][_0x8b68('0x188')]=function(_0x5c93e9){logger['info'](util[_0x8b68('0x52')](_0x8b68('0x189'),_0x5c93e9['label']));return this['channel'][_0x8b68('0x18a')](_0x5c93e9[_0x8b68('0x5b')],_0x5c93e9['escape_digits']);};AGIVertices[_0x8b68('0x12')][_0x8b68('0x18b')]=function(_0x2d4e64){logger[_0x8b68('0x2c')](util[_0x8b68('0x52')](_0x8b68('0x18c'),_0x2d4e64['label']));if(!this[_0x8b68('0x86')](_0x2d4e64[_0x8b68('0x18d')])){return this['channel']['noop']('no\x20mail\x20account\x20configured');}var _0x16d6f6=this['getMailAccount']['sync'](this,_0x2d4e64['account_id']);if(!_0x16d6f6||!_0x16d6f6[_0x8b68('0x18e')]){return this[_0x8b68('0xf')][_0x8b68('0x2b')](_0x2d4e64,_0x8b68('0x18f'));}var _0x4238e1={'from':util[_0x8b68('0x52')](_0x8b68('0x190'),_0x16d6f6[_0x8b68('0x16')],_0x16d6f6[_0x8b68('0x191')]||_0x16d6f6[_0x8b68('0x18e')]['user']),'to':_0x2d4e64['to']||'','cc':_0x2d4e64['cc']||'','bcc':_0x2d4e64[_0x8b68('0x192')]||'','subject':_0x2d4e64[_0x8b68('0x193')],'html':_0x2d4e64[_0x8b68('0x5b')],'text':_0x2d4e64[_0x8b68('0x5b')]};if(this[_0x8b68('0x86')](_0x2d4e64[_0x8b68('0x194')])){}logger[_0x8b68('0x195')](_0x8b68('0x196'),JSON[_0x8b68('0x71')](_0x4238e1));this['createSquareDetailsReport']['sync'](this,_0x2d4e64,_0x2d4e64[_0x8b68('0x18d')]);this[_0x8b68('0xf')][_0x8b68('0xa9')](util[_0x8b68('0x52')](_0x8b68('0x197'),_0x16d6f6[_0x8b68('0x16')]));this[_0x8b68('0x21')][_0x8b68('0x6e')](this,_0x16d6f6[_0x8b68('0x198')],_0x4238e1);return this[_0x8b68('0xf')][_0x8b68('0xa9')](_0x8b68('0x199'));};AGIVertices['prototype'][_0x8b68('0x19a')]=function(_0x1f9b83){logger[_0x8b68('0x2c')](util[_0x8b68('0x52')](_0x8b68('0x19b'),_0x1f9b83['label']));return this[_0x8b68('0xf')][_0x8b68('0xa9')](_0x8b68('0x19c'));};AGIVertices[_0x8b68('0x12')]['sendSMS']=function(_0x36c56b){logger[_0x8b68('0x2c')](util[_0x8b68('0x52')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x36c56b[_0x8b68('0xad')]));if(!this['isConfigured'](_0x36c56b[_0x8b68('0x19d')])){return this[_0x8b68('0xf')][_0x8b68('0xa9')](_0x8b68('0x19e'));}var _0xd43006=this['getSmsAccount'][_0x8b68('0x6e')](this,_0x36c56b[_0x8b68('0x19d')]);if(!_0xd43006){return this[_0x8b68('0xf')]['error'](_0x36c56b,'no\x20sms\x20account\x20found');}var _0xfe14cd={'body':_0x36c56b[_0x8b68('0x19f')],'phone':_0x36c56b['to']||'','SmsAccountId':_0xd43006['id']};logger['debug'](_0x8b68('0x1a0'),JSON['stringify'](_0xfe14cd));this['createSquareDetailsReport'][_0x8b68('0x6e')](this,_0x36c56b,_0x36c56b[_0x8b68('0x19d')]);this[_0x8b68('0xf')][_0x8b68('0xa9')](util[_0x8b68('0x52')]('Trying\x20SendSMS\x20with\x20account\x20%s',_0xd43006[_0x8b68('0x16')]));this[_0x8b68('0x1a1')][_0x8b68('0x6e')](this,_0xfe14cd);return this['channel'][_0x8b68('0xa9')](_0x8b68('0x1a2'));};AGIVertices[_0x8b68('0x12')][_0x8b68('0x1a3')]=function(_0x3de1b3){logger[_0x8b68('0x2c')](util[_0x8b68('0x52')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x3de1b3['label']));if(!this[_0x8b68('0x86')](_0x3de1b3[_0x8b68('0xd7')])){return this[_0x8b68('0xf')][_0x8b68('0x2b')](_0x3de1b3,'no\x20variable\x20selected');}var _0x3aaee5=this[_0x8b68('0x13')][_0x8b68('0x6e')](this,_0x3de1b3['variable_id']);if(!_0x3aaee5){return this['channel'][_0x8b68('0x2b')](_0x3de1b3,_0x8b68('0x119'));}return this['channel'][_0x8b68('0xda')](_0x3aaee5,_0x3de1b3[_0x8b68('0x1a4')]);};AGIVertices[_0x8b68('0x12')]['start']=function(_0x18f5a2){logger['info'](util[_0x8b68('0x52')]('Enter\x20in\x20START\x20(%s)\x20block',_0x18f5a2[_0x8b68('0xad')]));this[_0x8b68('0xf')][_0x8b68('0xa9')](_0x8b68('0x1a5'));if(_0x18f5a2['answer']===_0x8b68('0x1a6')){this[_0x8b68('0xf')][_0x8b68('0xa9')](_0x8b68('0x1a7'));return this[_0x8b68('0xf')][_0x8b68('0xb9')]();}return this[_0x8b68('0xf')]['noop'](_0x8b68('0x1a8'));};AGIVertices['prototype'][_0x8b68('0x1a9')]=function(_0x32024e){logger[_0x8b68('0x2c')](util[_0x8b68('0x52')](_0x8b68('0x1aa'),_0x32024e[_0x8b68('0xad')]));if(!this[_0x8b68('0x86')](_0x32024e[_0x8b68('0x1ab')])){return this[_0x8b68('0xf')][_0x8b68('0x2b')](_0x32024e,_0x8b68('0x1ac'));}var _0x4dcf3a=this[_0x8b68('0x1ad')][_0x8b68('0x6e')](this,_0x32024e['project_id']);if(!this[_0x8b68('0x86')](_0x4dcf3a)){return this[_0x8b68('0xf')][_0x8b68('0x2b')](_0x32024e,util[_0x8b68('0x52')](_0x8b68('0x1ae'),_0x32024e[_0x8b68('0x1ab')]));}if(_0x4dcf3a===this[_0x8b68('0xf')][_0x8b68('0x37')]){return this[_0x8b68('0xf')]['error'](_0x32024e,_0x8b68('0x1af'));}this[_0x8b68('0x34')][_0x8b68('0x6e')](this,_0x32024e,_0x4dcf3a);var _0x49580f=this[_0x8b68('0xf')][_0x8b68('0x56')]('AGI',util['format'](_0x8b68('0x1b0'),config[_0x8b68('0x7')][_0x8b68('0x1b1')]||_0x8b68('0x1b2'),_0x4dcf3a,this['channel']['arg_1']));if(_0x49580f[_0x8b68('0xa4')]===-0x1){return _0x49580f;}return this[_0x8b68('0xf')][_0x8b68('0xa9')](util[_0x8b68('0x52')](_0x8b68('0x169'),'AGI',_0x4dcf3a));};AGIVertices[_0x8b68('0x12')]['system']=function(_0x36ff8b){logger[_0x8b68('0x2c')](util[_0x8b68('0x52')](_0x8b68('0x1b3'),_0x36ff8b[_0x8b68('0xad')]));var _0x3d6399=this[_0x8b68('0x55')][_0x8b68('0x6e')](this,_0x36ff8b[_0x8b68('0x1b4')]);this['createSquareDetailsReport'][_0x8b68('0x6e')](this,_0x36ff8b,_0x36ff8b[_0x8b68('0x1b4')]);if(this['isConfigured'](_0x36ff8b['variable_id'])){var _0x5cf816=this[_0x8b68('0x13')]['sync'](this,_0x36ff8b[_0x8b68('0xd7')]);if(_0x5cf816){this[_0x8b68('0xf')]['setVariable'](_0x5cf816,_0x3d6399);return this[_0x8b68('0xf')][_0x8b68('0xa9')](util[_0x8b68('0x52')](_0x8b68('0x1b5'),_0x36ff8b[_0x8b68('0x1b4')],_0x5cf816));}}return this['channel'][_0x8b68('0xa9')](util[_0x8b68('0x52')](_0x8b68('0x1b6'),_0x36ff8b['command']));};AGIVertices['prototype'][_0x8b68('0x1b7')]=function(_0x41f9cf){logger[_0x8b68('0x2c')](util[_0x8b68('0x52')](_0x8b68('0x1b8'),_0x41f9cf['label']));_0x41f9cf['text']=_0x41f9cf[_0x8b68('0x5b')][_0x8b68('0x58')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x41f9cf['apiKey'])){return this[_0x8b68('0xf')][_0x8b68('0xa9')](_0x8b68('0x1b9'));}if(!this['isConfigured'](_0x41f9cf[_0x8b68('0x5b')])){return this['channel'][_0x8b68('0xa9')](_0x8b68('0xc5'));}this[_0x8b68('0xf')][_0x8b68('0xa9')](util[_0x8b68('0x52')](_0x8b68('0x1ba'),_0x41f9cf[_0x8b68('0x5b')]));var _0x116ff3=this['googleCloudTTS'][_0x8b68('0x6e')](this,_0x41f9cf);if(_0x116ff3){this[_0x8b68('0xf')][_0x8b68('0xa9')](util[_0x8b68('0x52')](_0x8b68('0x1bb'),_0x116ff3));var _0x1abd0d=this['channel'][_0x8b68('0x101')](_0x116ff3);try{fs[_0x8b68('0x1bc')](_0x116ff3+_0x8b68('0x102'));}catch(_0x23b88c){logger[_0x8b68('0x2b')](_0x23b88c);}return _0x1abd0d;}return this['channel'][_0x8b68('0x2b')](_0x41f9cf,_0x8b68('0x1bd'));};AGIVertices[_0x8b68('0x12')][_0x8b68('0x1be')]=function(_0x191ddd){logger[_0x8b68('0x2c')](util[_0x8b68('0x52')](_0x8b68('0x1bf'),_0x191ddd['label']));_0x191ddd[_0x8b68('0x5b')]=_0x191ddd['text'][_0x8b68('0x58')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x191ddd[_0x8b68('0x5b')])){return this['channel'][_0x8b68('0xa9')](_0x8b68('0xc5'));}this[_0x8b68('0xf')][_0x8b68('0xa9')](util['format']('Trying\x20Google\x20TTS\x20%s',_0x191ddd[_0x8b68('0x5b')]));var _0x334883=this[_0x8b68('0x5f')]['sync'](this,_0x191ddd);if(_0x334883){this[_0x8b68('0xf')]['noop'](util['format'](_0x8b68('0x1c0'),_0x334883));var _0x4925a9=this[_0x8b68('0xf')][_0x8b68('0x101')](_0x334883);try{fs[_0x8b68('0x1bc')](_0x334883+_0x8b68('0x102'));}catch(_0x412d0f){logger[_0x8b68('0x2b')](_0x412d0f);}return _0x4925a9;}return this[_0x8b68('0xf')][_0x8b68('0x2b')](_0x191ddd,_0x8b68('0x1c1'));};AGIVertices['prototype'][_0x8b68('0x1c2')]=function(_0x96411f){logger['info'](util[_0x8b68('0x52')](_0x8b68('0x1c3'),_0x96411f['label']));if(!this[_0x8b68('0x86')](_0x96411f[_0x8b68('0x153')])){return this[_0x8b68('0xf')]['error'](_0x96411f,'no\x20find\x20by\x20configured');}logger['info'](util[_0x8b68('0x52')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x8b68('0xf')][_0x8b68('0x39')],_0x96411f[_0x8b68('0x153')]));var _0x47641f=this[_0x8b68('0x4f')]['sync'](this,_0x96411f[_0x8b68('0x153')]);if(_0x47641f){logger[_0x8b68('0x2c')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x8b68('0xf')][_0x8b68('0x39')],_0x96411f['findBy']));this[_0x8b68('0xf')][_0x8b68('0xa9')](util[_0x8b68('0x52')](_0x8b68('0x156'),this[_0x8b68('0xf')][_0x8b68('0x39')],_0x96411f['findBy']));return{'code':0xc8,'result':_0x8b68('0x157')};}else{logger[_0x8b68('0x2c')](util[_0x8b68('0x52')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x8b68('0xf')][_0x8b68('0x39')],_0x96411f[_0x8b68('0x153')]));this[_0x8b68('0xf')][_0x8b68('0xa9')](util[_0x8b68('0x52')](_0x8b68('0x158'),this[_0x8b68('0xf')]['callerid'],_0x96411f[_0x8b68('0x153')]));return{'code':0xc8,'result':_0x8b68('0x159')};}};AGIVertices[_0x8b68('0x12')][_0x8b68('0x1c4')]=function(_0xe7a77e){logger[_0x8b68('0x2c')](util['format']('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0xe7a77e['label']));var _0x4a14a9=this[_0x8b68('0xf')]['exec'](_0x8b68('0x1c5'),[_0xe7a77e[_0x8b68('0x1c6')],_0xe7a77e['options']]);if(_0x4a14a9['result']===-0x1){return _0x4a14a9;}return this[_0x8b68('0xf')][_0x8b68('0xa9')](util[_0x8b68('0x52')]('Executed\x20command\x20%s\x20%s',_0x8b68('0x1c5'),_0xe7a77e[_0x8b68('0x1c6')]));};AGIVertices[_0x8b68('0x12')][_0x8b68('0x1c7')]=function(_0x1956cd){logger[_0x8b68('0x2c')](util[_0x8b68('0x52')](_0x8b68('0x1c8'),_0x1956cd['label']));if(!this[_0x8b68('0x86')](_0x1956cd['variable_id'])){return this[_0x8b68('0xf')][_0x8b68('0x2b')](_0x1956cd,'no\x20variable\x20selected');}var _0x5835c8=this[_0x8b68('0x13')][_0x8b68('0x6e')](this,_0x1956cd[_0x8b68('0xd7')]);if(!_0x5835c8){return this['channel'][_0x8b68('0x2b')](_0x1956cd,_0x8b68('0x119'));}var _0x2fc03b=this['channel'][_0x8b68('0x13')](_0x5835c8);return{'code':0xc8,'result':_0x2fc03b[_0x8b68('0xa3')]?_0x2fc03b[_0x8b68('0xa3')]:'-'};};String[_0x8b68('0x12')]['replaceAll']=function(_0x682fea,_0xef9132){return this[_0x8b68('0xa1')](_0x682fea)[_0x8b68('0x1c9')](_0xef9132);};module['exports']=AGIVertices; \ No newline at end of file +var _0x00bb=['tts','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','unpause','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','mailbox','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','util','lodash','shelljs','randomstring','mustache','request-promise','agi','../../config/environment','rawBody','menu','getdigits','getsecretdigits','rpc','mailRpc','prototype','getVariable','name','catch','getVoiceQueue','getVoiceQueueById','getSquareProjectById','then','getSquareOdbc','getUser','getUserById','getTrunk','getTrunkById','getSoundById','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','Intervals','interval','getSoundPath','format','%s/sounds/converted/%s','getQueryOdbc','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Query\x20executed\x20correctly\x20%s','close','error','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','channel','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','extension','priority','dnid','file','createSquareMessage','createCmContact','isNil','callback_','random','isEmpty','lastName','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','getPause','getPauseById','agent','agentPause','agentUnpause','agentLogout','agentLogin','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','method','timeout','number','includes','POST','PUT','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','rawHeaders','computedVariables','sync','render','url','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','googleDialogflowV2','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','key','isConfigured','model','awsPolly','aws_secret_access_key','aws_polly_voice','aws_text_type','awsLex','aws_access_key_id','aws_lex_region','aws_bot_name','googleASR','google_asr_language','appid','appsecret','uri','clear','clone','hasOwnProperty','replaceObjectAllVariables','isPlainObject','recursiveNodeIndex','isArray','length','replaceAllVariables','saveRestApiResult','%s.%s','setVariable','split','replaceAll','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','answer','no\x20list\x20selected','delay','add','callback_priority','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','phone','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','grammar','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','no\x20grammar\x20configured','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','no\x20variable\x20selected\x20for\x20the\x20result','variable_id','no\x20variable\x20found','keys','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','DIAL','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','bot','Trying\x20Dialogflow:\x20%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DIALOGFLOW_%s','DialogflowV2\x20is\x20unreachable','sesteknda','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','Enter\x20in\x20END\x20(%s)\x20block','end','trunk_id','no\x20trunk\x20selected','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','no\x20file\x20audio\x20selected','file_id','no\x20file\x20audio\x20found','getData','response','maxdigit','test','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','streamFile','aws\x20Polly\x20is\x20unreachable','awslex','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','isString','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','no\x20key\x20configured','wav','%s/recordings/%s','beep','NOBEEP','recordFile','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','intKey','tilde\x20%s\x20file\x20created','tildeASR','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','context','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','true','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','math\x20%s','forEach','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','retry','getSound','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','Executed\x20command\x20%s\x20%s','queue','no\x20queue\x20selected','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','restAPI','Response:','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','Smtp','user','bcc','subject','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','sms_account_id','no\x20sms\x20account\x20configured','sms_text','Trying\x20SendSMS\x20with\x20account\x20%s','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','Enter\x20in\x20START\x20(%s)\x20block','XMCS-UNIQUEID','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','getSquareProject','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','host','127.0.0.1','system','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x00bb,0x1d8));var _0xb00b=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x00bb[_0xbca1b1];return _0x4e1686;};'use strict';var fs=require('fs');var util=require(_0xb00b('0x0'));var _=require(_0xb00b('0x1'));var sh=require(_0xb00b('0x2'));var odbc=require('odbc')();var rs=require(_0xb00b('0x3'));var moment=require('moment');var Mustache=require(_0xb00b('0x4'));var rp=require(_0xb00b('0x5'));var logger=require('../../config/logger')(_0xb00b('0x6'));var config=require(_0xb00b('0x7'));var scripts=require('./scripts');var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=['rawHeaders',_0xb00b('0x8')];var verticesWithRetry=[_0xb00b('0x9'),_0xb00b('0xa'),_0xb00b('0xb')];var AGIVertices=function(_0xfa4181,_0x3c36c5,_0x5b0c03){this['channel']=_0xfa4181;this[_0xb00b('0xc')]=_0x3c36c5;this[_0xb00b('0xd')]=_0x5b0c03;};AGIVertices[_0xb00b('0xe')][_0xb00b('0xf')]=function(_0x28d3cc,_0x48e125){this[_0xb00b('0xc')]['getVariableById'](_0x28d3cc)['then'](function(_0x594075){_0x48e125(null,_0x594075?_0x594075[_0xb00b('0x10')]:![]);})[_0xb00b('0x11')](function(_0x1be8aa){_0x48e125(_0x1be8aa);});};AGIVertices[_0xb00b('0xe')][_0xb00b('0x12')]=function(_0x1f1c1d,_0x4ada81){this[_0xb00b('0xc')][_0xb00b('0x13')](_0x1f1c1d)['then'](function(_0x88d95e){_0x4ada81(null,_0x88d95e?_0x88d95e[_0xb00b('0x10')]:![]);})['catch'](function(_0x5da36b){_0x4ada81(_0x5da36b);});};AGIVertices[_0xb00b('0xe')]['getSquareProject']=function(_0x51d136,_0x1f9c78){this[_0xb00b('0xc')][_0xb00b('0x14')](_0x51d136)[_0xb00b('0x15')](function(_0x58d65f){_0x1f9c78(null,_0x58d65f?_0x58d65f[_0xb00b('0x10')]:![]);})['catch'](function(_0x415f91){_0x1f9c78(_0x415f91);});};AGIVertices['prototype'][_0xb00b('0x16')]=function(_0x5e8d7b,_0xb26ebb){this[_0xb00b('0xc')]['getSquareOdbcById'](_0x5e8d7b)['then'](function(_0x2b0da1){_0xb26ebb(null,_0x2b0da1?_0x2b0da1['dsn']:![]);})[_0xb00b('0x11')](function(_0x43da66){_0xb26ebb(_0x43da66);});};AGIVertices[_0xb00b('0xe')][_0xb00b('0x17')]=function(_0x56c189,_0x362ee0){this['rpc'][_0xb00b('0x18')](_0x56c189)[_0xb00b('0x15')](function(_0x51b841){_0x362ee0(null,_0x51b841?_0x51b841[_0xb00b('0x10')]:![]);})[_0xb00b('0x11')](function(_0x520444){_0x362ee0(_0x520444);});};AGIVertices[_0xb00b('0xe')][_0xb00b('0x19')]=function(_0x5568bb,_0x44efe5){this[_0xb00b('0xc')][_0xb00b('0x1a')](_0x5568bb)[_0xb00b('0x15')](function(_0x520e55){_0x44efe5(null,_0x520e55?_0x520e55['name']:![]);})[_0xb00b('0x11')](function(_0x490380){_0x44efe5(_0x490380);});};AGIVertices['prototype']['getSound']=function(_0x16ac55,_0x73b6b0){var _0x2592cf=this;this[_0xb00b('0xc')][_0xb00b('0x1b')](_0x16ac55)[_0xb00b('0x15')](function(_0x15d3b9){_0x73b6b0(null,_0x15d3b9?_0x2592cf['getSoundPath'](_0x15d3b9[_0xb00b('0x1c')]):![]);})['catch'](function(_0x450129){_0x73b6b0(_0x450129);});};AGIVertices[_0xb00b('0xe')][_0xb00b('0x1d')]=function(_0x5b987e,_0x2fc11a){this[_0xb00b('0xc')][_0xb00b('0x1e')](_0x5b987e)[_0xb00b('0x15')](function(_0x303625){_0x2fc11a(null,_0x303625?_0x303625:![]);})[_0xb00b('0x11')](function(_0x2e160a){_0x2fc11a(_0x2e160a);});};AGIVertices[_0xb00b('0xe')][_0xb00b('0x1f')]=function(_0x54e247,_0x2b5f41,_0x44918d){this['mailRpc'][_0xb00b('0x1f')](_0x54e247,_0x2b5f41)[_0xb00b('0x15')](function(){_0x44918d(null);})['catch'](function(_0x456241){_0x44918d(_0x456241);});};AGIVertices['prototype'][_0xb00b('0x20')]=function(_0x4117f2,_0x322879){this[_0xb00b('0xc')][_0xb00b('0x21')](_0x4117f2)[_0xb00b('0x15')](function(_0x17f613){if(_0x17f613){if(_0x17f613['IntervalId']){_0x322879(null,[_0x17f613['interval']]);}else{_0x322879(null,_['map'](_0x17f613[_0xb00b('0x22')],_0xb00b('0x23')));}}else{_0x322879(null,![]);}})[_0xb00b('0x11')](function(_0x2589cb){_0x322879(_0x2589cb);});};AGIVertices['prototype'][_0xb00b('0x24')]=function(_0x266f8e){return util[_0xb00b('0x25')](_0xb00b('0x26'),FILES_PATH,_0x266f8e);};AGIVertices[_0xb00b('0xe')][_0xb00b('0x27')]=function(_0x8785ec,_0x3302ac,_0x5efc18){odbc['open'](_0x8785ec,function(_0x2ea41d){if(_0x2ea41d){logger['error'](_0xb00b('0x28'),_0x2ea41d);_0x5efc18(_0x2ea41d);}else{logger[_0xb00b('0x29')](_0xb00b('0x2a'));odbc[_0xb00b('0x2b')](_0x3302ac,function(_0x37c017,_0x142cdd){if(_0x37c017){logger[_0xb00b('0x29')]('Error\x20executing\x20query\x20%s',_0x3302ac);_0x5efc18(_0x37c017);}else{logger[_0xb00b('0x29')](_0xb00b('0x2c'),_0x3302ac);odbc[_0xb00b('0x2d')](function(_0xd9c03f){if(_0xd9c03f){logger[_0xb00b('0x2e')](_0xb00b('0x2f'),_0xd9c03f);}_0x5efc18(null,_0x142cdd);});}});}});};AGIVertices['prototype'][_0xb00b('0x30')]=function(_0x3beb8f,_0x4801e7){this[_0xb00b('0xc')][_0xb00b('0x31')](_0x3beb8f)[_0xb00b('0x15')](function(_0x2d8620){_0x4801e7(null,_0x2d8620?_0x2d8620:![]);})[_0xb00b('0x11')](function(_0x5636b1){_0x4801e7(_0x5636b1);});};AGIVertices[_0xb00b('0xe')][_0xb00b('0x32')]=function(_0xb76ede,_0xa262a3){this['rpc']['createSmsMessage'](_0xb76ede)[_0xb00b('0x15')](function(_0xf6ae0c){_0xa262a3(null,_0xf6ae0c);})[_0xb00b('0x11')](function(_0x152437){_0xa262a3(_0x152437);});};AGIVertices[_0xb00b('0xe')][_0xb00b('0x33')]=function(_0x275664,_0x493841,_0x36200d){this[_0xb00b('0xc')][_0xb00b('0x33')]({'uniqueid':this[_0xb00b('0x34')][_0xb00b('0x35')],'node':_0x275664[_0xb00b('0x36')],'application':_0x275664[_0xb00b('0x37')],'data':_0x493841||null,'project_name':this[_0xb00b('0x34')][_0xb00b('0x38')],'callerid':this[_0xb00b('0x34')][_0xb00b('0x39')]})[_0xb00b('0x15')](function(_0x577bad){if(_0x36200d){_0x36200d(null,_0x577bad);}})[_0xb00b('0x11')](function(_0x35a0ba){if(_0x36200d){_0x36200d(_0x35a0ba);}});};AGIVertices[_0xb00b('0xe')][_0xb00b('0x3a')]=function(_0x10b136,_0x2d9174,_0xd97f49,_0x1b4f09){this[_0xb00b('0xc')][_0xb00b('0x3a')]({'uniqueid':this[_0xb00b('0x34')][_0xb00b('0x35')],'callerid':this['channel']['callerid'],'calleridname':this['channel'][_0xb00b('0x3b')],'context':this[_0xb00b('0x34')]['context'],'extension':this[_0xb00b('0x34')][_0xb00b('0x3c')],'priority':this[_0xb00b('0x34')][_0xb00b('0x3d')],'accountcode':this['channel']['accountcode'],'dnid':this[_0xb00b('0x34')][_0xb00b('0x3e')],'projectName':this['channel']['arg_1'],'saveName':_0x2d9174,'filename':_0x10b136[_0xb00b('0x3f')]||_0x2d9174,'savePath':_0xd97f49})[_0xb00b('0x15')](function(_0x4e0be4){_0x1b4f09(null,_0x4e0be4);})[_0xb00b('0x11')](function(_0x47a814){_0x1b4f09(_0x47a814);});};AGIVertices['prototype']['createSquareMessage']=function(_0x465d90,_0x481515,_0x1f7b86,_0x3178aa,_0x4b6482){this[_0xb00b('0xc')][_0xb00b('0x40')]({'uniqueid':this[_0xb00b('0x34')]['uniqueid'],'body':_0x465d90,'direction':_0x481515,'providerName':_0x1f7b86,'providerResponse':_0x3178aa})['then'](function(_0x1d2a0d){if(_0x4b6482){_0x4b6482(null,_0x1d2a0d);}})[_0xb00b('0x11')](function(_0x559357){if(_0x4b6482){_0x4b6482(_0x559357);}});};AGIVertices[_0xb00b('0xe')][_0xb00b('0x41')]=function(_0x57f6ab,_0x15dcbf){this[_0xb00b('0xc')][_0xb00b('0x41')]({'firstName':_['isEmpty'](_0x57f6ab['name'])||_[_0xb00b('0x42')](_0x57f6ab[_0xb00b('0x10')])?_0xb00b('0x43')+Math[_0xb00b('0x44')]():_0x57f6ab['name'],'lastName':_[_0xb00b('0x45')](_0x57f6ab[_0xb00b('0x46')])||_['isNil'](_0x57f6ab['lastName'])?null:_0x57f6ab[_0xb00b('0x46')],'phone':_0x57f6ab['phone'],'ListId':_0x57f6ab[_0xb00b('0x47')],'scheduledat':_0x57f6ab[_0xb00b('0x48')],'callbackUniqueid':this[_0xb00b('0x34')][_0xb00b('0x35')],'tags':_0xb00b('0x49'),'description':_0xb00b('0x4a')+_0x57f6ab['scheduledAt'][_0xb00b('0x4b')](),'priority':_0x57f6ab['callback_priority']})[_0xb00b('0x15')](function(_0x98caa9){_0x15dcbf(null,_0x98caa9);})[_0xb00b('0x11')](function(_0x5ac79e){_0x15dcbf(_0x5ac79e);});};AGIVertices[_0xb00b('0xe')][_0xb00b('0x4c')]=function(_0x4ba53a,_0x598a55){this[_0xb00b('0xc')][_0xb00b('0x4d')](_0x4ba53a)[_0xb00b('0x15')](function(_0x385029){_0x598a55(null,_0x385029?_0x385029[_0xb00b('0x10')]:![]);})[_0xb00b('0x11')](function(_0x347949){_0x598a55(_0x347949);});};AGIVertices[_0xb00b('0xe')]['agentPause']=function(_0x153551,_0x2cbe80,_0x1b4860){var _0x4a22dd={'role':_0xb00b('0x4e')};_0x4a22dd[_0x153551]=this[_0xb00b('0x34')][_0xb00b('0x39')];this[_0xb00b('0xc')][_0xb00b('0x4f')](_0x4a22dd,_0x2cbe80,this['channel'][_0xb00b('0x35')])[_0xb00b('0x15')](function(_0x2e3c56){_0x1b4860(null,_[_0xb00b('0x42')](_0x2e3c56)?![]:!![]);})['catch'](function(_0x32b9fe){logger[_0xb00b('0x2e')](_0x32b9fe);_0x1b4860(null,![]);});};AGIVertices[_0xb00b('0xe')][_0xb00b('0x50')]=function(_0x161216,_0x1e5ed8){var _0x2f2032={'role':'agent'};_0x2f2032[_0x161216]=this[_0xb00b('0x34')]['callerid'];this[_0xb00b('0xc')]['agentUnpause'](_0x2f2032)[_0xb00b('0x15')](function(_0x530d4a){_0x1e5ed8(null,_[_0xb00b('0x42')](_0x530d4a)?![]:!![]);})['catch'](function(_0x3dffaf){logger[_0xb00b('0x2e')](_0x3dffaf);_0x1e5ed8(null,![]);});};AGIVertices[_0xb00b('0xe')]['agentLogout']=function(_0x51fbe2,_0x4f7a59){var _0x21a53d={'role':_0xb00b('0x4e')};_0x21a53d[_0x51fbe2]=this[_0xb00b('0x34')]['callerid'];this[_0xb00b('0xc')][_0xb00b('0x51')](_0x21a53d)[_0xb00b('0x15')](function(_0x2ddba4){_0x4f7a59(null,_[_0xb00b('0x42')](_0x2ddba4)?![]:!![]);})['catch'](function(_0x32f924){logger[_0xb00b('0x2e')](_0x32f924);_0x4f7a59(null,![]);});};AGIVertices['prototype'][_0xb00b('0x52')]=function(_0x36ac5a,_0xa6951f){var _0x55abaa={'role':'agent'};_0x55abaa[_0x36ac5a]=this[_0xb00b('0x34')][_0xb00b('0x39')];var _0x23762e=_0x36ac5a!='internal'?util['format']('%s/%s@from-sip/n','LOCAL',this[_0xb00b('0x34')]['callerid']):undefined;this[_0xb00b('0xc')][_0xb00b('0x52')](_0x55abaa,_0x23762e)['then'](function(_0x7523d5){_0xa6951f(null,_[_0xb00b('0x42')](_0x7523d5)?![]:!![]);})[_0xb00b('0x11')](function(_0x204f40){logger[_0xb00b('0x2e')](_0x204f40);_0xa6951f(null,![]);});};AGIVertices['prototype'][_0xb00b('0x53')]=function(_0x851800,_0x3d4482){sh[_0xb00b('0x54')](_[_0xb00b('0x55')](_0x851800),function(_0x404fbd,_0xda553a){var _0x550473=_0xda553a[_0xb00b('0x56')](/(\r\n|\n|\r)/gm,'');_0x3d4482(null,_0x550473);});};AGIVertices[_0xb00b('0xe')][_0xb00b('0x57')]=function(_0x328f72,_0x109f56){scripts[_0xb00b('0x57')](_0x328f72[_0xb00b('0x58')],_0x328f72[_0xb00b('0x59')]||'text',_0x328f72[_0xb00b('0x5a')],_0x328f72[_0xb00b('0x5b')]||_0xb00b('0x5c'),_0x328f72[_0xb00b('0x5d')]||_0xb00b('0x5e'),_0x328f72[_0xb00b('0x5f')]||_0xb00b('0x60'))[_0xb00b('0x15')](function(_0x5625a4){_0x109f56(null,_0x5625a4);})[_0xb00b('0x11')](function(_0x3077f5){_0x109f56(_0x3077f5);});};AGIVertices[_0xb00b('0xe')][_0xb00b('0x61')]=function(_0x227949,_0x376adc){scripts[_0xb00b('0x61')](_0x227949['text'],_0x227949[_0xb00b('0x62')]||'en',0x1)[_0xb00b('0x15')](function(_0x28ecf8){_0x376adc(null,_0x28ecf8);})[_0xb00b('0x11')](function(_0x16e8ff){_0x376adc(_0x16e8ff);});};AGIVertices[_0xb00b('0xe')]['restAPI']=function(_0x39bb6c,_0x4e95c7){var _0x135cbf={'uri':_0x39bb6c['url'],'method':_0x39bb6c[_0xb00b('0x63')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x39bb6c[_0xb00b('0x64')])===_0xb00b('0x65')&&parseInt(_0x39bb6c['timeout'])>=0x1?parseInt(_0x39bb6c['timeout'])*0x3e8:0x5*0x3e8};if(_[_0xb00b('0x66')]([_0xb00b('0x67'),_0xb00b('0x68')],_0x135cbf[_0xb00b('0x63')][_0xb00b('0x69')]())){try{_0x135cbf[_0xb00b('0x6a')]=_0x39bb6c[_0xb00b('0x8')]?JSON[_0xb00b('0x6b')](_0x39bb6c[_0xb00b('0x8')]):{};}catch(_0x25bef6){logger[_0xb00b('0x2e')](_0xb00b('0x6c'),_0x25bef6);}}try{_0x135cbf[_0xb00b('0x6d')]=_0x39bb6c[_0xb00b('0x6e')]?JSON['parse'](_0x39bb6c['rawHeaders']):{};}catch(_0xe93a42){logger[_0xb00b('0x2e')]('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0xe93a42);}if(_0x39bb6c['computedVariables']){try{var _0x13df84=require(_0x39bb6c[_0xb00b('0x6f')])[_0xb00b('0x70')](this,_0x135cbf);_0x135cbf['uri']=Mustache[_0xb00b('0x71')](_0x39bb6c[_0xb00b('0x72')],_0x13df84,{},['$$','$$']);if(_0x135cbf[_0xb00b('0x6d')]){_0x135cbf[_0xb00b('0x6d')]=JSON[_0xb00b('0x6b')](Mustache[_0xb00b('0x71')](JSON[_0xb00b('0x73')](_0x135cbf['headers']),_0x13df84,{},['$$','$$']));}if(_0x135cbf[_0xb00b('0x6a')]){_0x135cbf['body']=JSON[_0xb00b('0x6b')](Mustache[_0xb00b('0x71')](JSON['stringify'](_0x135cbf[_0xb00b('0x6a')]),_0x13df84,{},['$$','$$']));}}catch(_0x1099cb){logger[_0xb00b('0x2e')](_0xb00b('0x74'),_0x1099cb);}}rp(_0x135cbf)[_0xb00b('0x15')](function(_0x4434fa){var _0xc41c1f={'statusCode':_0x4434fa[_0xb00b('0x75')]||0xc8,'statusMessage':_0x4434fa[_0xb00b('0x76')]||'OK','headers':_0x4434fa[_0xb00b('0x6d')]||{},'body':_0x4434fa[_0xb00b('0x6a')]||{}};_0x4e95c7(null,_0xc41c1f);})[_0xb00b('0x11')](function(_0x5007f6){var _0x31449c={'statusCode':_0x5007f6[_0xb00b('0x75')]||0x1f4,'statusMessage':_0x5007f6[_0xb00b('0x77')]||_0xb00b('0x78'),'headers':_0x5007f6['options'][_0xb00b('0x6d')]||{},'body':_0x5007f6[_0xb00b('0x79')][_0xb00b('0x6a')]||{}};_0x4e95c7(null,_0x31449c);});};AGIVertices[_0xb00b('0xe')][_0xb00b('0x7a')]=function(_0x5b4d38,_0x2f1096){scripts[_0xb00b('0x7a')](this[_0xb00b('0x34')][_0xb00b('0x35')],_0x5b4d38['key'],_0x5b4d38[_0xb00b('0x5a')],_0x5b4d38['dialogflow_language']||'en')[_0xb00b('0x15')](function(_0x202d5f){_0x2f1096(null,_0x202d5f);})[_0xb00b('0x11')](function(_0x165442){_0x2f1096(_0x165442);});};AGIVertices[_0xb00b('0xe')][_0xb00b('0x7b')]=function(_0x430e8a,_0x319977){scripts[_0xb00b('0x7b')](this[_0xb00b('0x34')][_0xb00b('0x35')],_0x430e8a['dialogflowV2_project_id'],_0x430e8a[_0xb00b('0x7c')],_0x430e8a[_0xb00b('0x7d')],_0x430e8a[_0xb00b('0x5a')],_0x430e8a[_0xb00b('0x7e')]||'en')['then'](function(_0x136ca4){_0x319977(null,_0x136ca4);})[_0xb00b('0x11')](function(_0x4b5508){_0x319977(_0x4b5508);});};AGIVertices[_0xb00b('0xe')]['sestekNDA']=function(_0x3caf51,_0x43377c){scripts[_0xb00b('0x7f')](this['channel'],_0x3caf51)[_0xb00b('0x15')](function(_0x296be0){_0x43377c(null,_0x296be0);})[_0xb00b('0x11')](function(_0x1d250b){_0x43377c(_0x1d250b);});};AGIVertices[_0xb00b('0xe')][_0xb00b('0x80')]=function(_0x9f9d6c,_0x204030){scripts[_0xb00b('0x80')](_0x9f9d6c['key'],_0x9f9d6c['text'],_0x9f9d6c[_0xb00b('0x81')]||_0xb00b('0x5c'),_0x9f9d6c[_0xb00b('0x82')])[_0xb00b('0x15')](function(_0x4a7f8c){_0x204030(null,_0x4a7f8c);})[_0xb00b('0x11')](function(_0x3ac189){_0x204030(_0x3ac189);});};AGIVertices['prototype'][_0xb00b('0x83')]=function(_0x21cdbe,_0x2762fb,_0x54244b){scripts[_0xb00b('0x83')](_0x2762fb,_0x21cdbe[_0xb00b('0x84')],_0x21cdbe['ispeech_asr_language']||_0xb00b('0x5c'),this[_0xb00b('0x85')](_0x21cdbe[_0xb00b('0x86')])?_0x21cdbe[_0xb00b('0x86')]:undefined)[_0xb00b('0x15')](function(_0x294f38){_0x54244b(null,_0x294f38);})[_0xb00b('0x11')](function(_0x183341){_0x54244b(_0x183341);});};AGIVertices['prototype'][_0xb00b('0x87')]=function(_0x5bfde,_0x320542){scripts[_0xb00b('0x87')](_0x5bfde['aws_access_key_id'],_0x5bfde[_0xb00b('0x88')],_0x5bfde['aws_polly_region'],_0x5bfde[_0xb00b('0x89')]||'Amy',_0x5bfde[_0xb00b('0x5a')],_0x5bfde[_0xb00b('0x8a')]||_0xb00b('0x5a'))[_0xb00b('0x15')](function(_0x43daec){_0x320542(null,_0x43daec);})['catch'](function(_0x3ee641){_0x320542(_0x3ee641);});};AGIVertices[_0xb00b('0xe')]['awsLex']=function(_0x44c086,_0x494728){scripts[_0xb00b('0x8b')](this[_0xb00b('0x34')][_0xb00b('0x35')],_0x44c086[_0xb00b('0x8c')],_0x44c086['aws_secret_access_key'],_0x44c086[_0xb00b('0x8d')],_0x44c086[_0xb00b('0x5a')],_0x44c086[_0xb00b('0x8e')])[_0xb00b('0x15')](function(_0x11172e){_0x494728(null,_0x11172e);})['catch'](function(_0x5e2785){_0x494728(_0x5e2785);});};AGIVertices[_0xb00b('0xe')][_0xb00b('0x8f')]=function(_0xa0ff5e,_0x2d5652,_0x35ad28){scripts['googleASR'](_0x2d5652,_0xa0ff5e['key'],_0xa0ff5e[_0xb00b('0x90')]||_0xb00b('0x5c'))[_0xb00b('0x15')](function(_0x265817){_0x35ad28(null,_0x265817);})[_0xb00b('0x11')](function(_0x38b718){_0x35ad28(_0x38b718);});};AGIVertices[_0xb00b('0xe')]['tildeASR']=function(_0xfe3794,_0x54b972,_0x128a41){scripts['tildeASR'](_0x54b972,_0xfe3794[_0xb00b('0x91')],_0xfe3794[_0xb00b('0x92')],_0xfe3794[_0xb00b('0x93')])[_0xb00b('0x15')](function(_0x31c7dd){_0x128a41(null,_0x31c7dd);})[_0xb00b('0x11')](function(_0x210fc6){_0x128a41(_0x210fc6);});};AGIVertices[_0xb00b('0xe')][_0xb00b('0x94')]=function(_0x63b8e7){var _0x1d15dd=_['includes'](verticesWithRetry,_0x63b8e7[_0xb00b('0x37')])?_0x63b8e7:_[_0xb00b('0x95')](_0x63b8e7);for(var _0x29742c in _0x1d15dd){if(_0x1d15dd[_0xb00b('0x96')](_0x29742c)){if(_0x1d15dd[_0x29742c]&&_['isString'](_0x1d15dd[_0x29742c])){if(_[_0xb00b('0x66')](recursiveMapAttributes,_0x29742c)){_0x1d15dd[_0x29742c]=this[_0xb00b('0x97')](_0x1d15dd[_0x29742c]);}else{_0x1d15dd[_0x29742c]=this['replaceAllVariables'](_0x1d15dd[_0x29742c]);}}}}return _0x1d15dd;};AGIVertices[_0xb00b('0xe')]['recursiveNodeIndex']=function(_0x22d726){for(var _0x1ec96d in _0x22d726){if(_0x22d726['hasOwnProperty'](_0x1ec96d)){if(_[_0xb00b('0x98')](_0x22d726[_0x1ec96d])){this[_0xb00b('0x99')](_0x22d726[_0x1ec96d]);}else if(_[_0xb00b('0x9a')](_0x22d726[_0x1ec96d])){for(var _0x20ca7b=0x0;_0x20ca7b<_0x22d726[_0x1ec96d][_0xb00b('0x9b')];_0x20ca7b++){this[_0xb00b('0x99')](_0x22d726[_0x1ec96d][_0x20ca7b]);}}else if(_['isString'](_0x22d726[_0x1ec96d])){_0x22d726[_0x1ec96d]=this[_0xb00b('0x9c')](_0x22d726[_0x1ec96d]);}}}};AGIVertices['prototype'][_0xb00b('0x9d')]=function(_0x44cd92,_0x140bfd){for(var _0x43fbc5 in _0x44cd92){if(_0x44cd92['hasOwnProperty'](_0x43fbc5)){if(_[_0xb00b('0x98')](_0x44cd92[_0x43fbc5])){if(!_[_0xb00b('0x45')](_0x44cd92[_0x43fbc5])){this[_0xb00b('0x9d')](_0x44cd92[_0x43fbc5],util['format'](_0xb00b('0x9e'),_0x140bfd,_0x43fbc5));}}else if(_[_0xb00b('0x9a')](_0x44cd92[_0x43fbc5])){for(var _0x2a91a6=0x0;_0x2a91a6<_0x44cd92[_0x43fbc5][_0xb00b('0x9b')];_0x2a91a6++){this['saveRestApiResult'](_0x44cd92[_0x43fbc5][_0x2a91a6],util[_0xb00b('0x25')](_0xb00b('0x9e'),_0x140bfd,_0x43fbc5+'['+_0x2a91a6+']'));}}else{if(!_[_0xb00b('0x42')](_0x44cd92[_0x43fbc5])){this[_0xb00b('0x34')][_0xb00b('0x9f')](util[_0xb00b('0x25')]('%s.%s',_0x140bfd,_0x43fbc5),_0x44cd92[_0x43fbc5]);}}}}};AGIVertices['prototype'][_0xb00b('0x97')]=function(_0x23d306){try{var _0x206686=JSON[_0xb00b('0x6b')](_0x23d306);this[_0xb00b('0x99')](_0x206686);return JSON['stringify'](_0x206686);}catch(_0x3d80e7){return this[_0xb00b('0x9c')](_0x23d306);}};AGIVertices[_0xb00b('0xe')][_0xb00b('0x9c')]=function(_0x21d237){var _0x399bf6=_0x21d237['split']('{');for(var _0x119e68=0x1;_0x119e68<_0x399bf6[_0xb00b('0x9b')];_0x119e68+=0x1){var _0x344e0e=_0x399bf6[_0x119e68][_0xb00b('0xa0')]('}');if(_0x344e0e[_0xb00b('0x9b')]>0x1){_0x21d237=_0x21d237[_0xb00b('0xa1')]('{'+_0x344e0e[0x0]+'}',this[_0xb00b('0x34')][_0xb00b('0xf')](_0x344e0e[0x0])[_0xb00b('0xa2')]||_0x344e0e[0x0]);}}if(_0x399bf6[_0xb00b('0x9b')]===0x1){return _0x21d237['toString']();}return this['replaceAllVariables'](_0x21d237);};AGIVertices[_0xb00b('0xe')][_0xb00b('0xa3')]=function(_0x23eaff,_0x55b3fd){var _0x4e0a24=this['channel'][_0xb00b('0xf')](_0x23eaff);if(_0x4e0a24[_0xb00b('0xa4')]===-0x1){return _0x4e0a24;}logger[_0xb00b('0x29')](util['format'](_0xb00b('0xa5'),_0x55b3fd,_0x4e0a24[_0xb00b('0xa2')]));return this[_0xb00b('0x34')][_0xb00b('0x9f')](_0x55b3fd,_0x4e0a24['extra']);};AGIVertices[_0xb00b('0xe')][_0xb00b('0x85')]=function(_0x3dc1f5){return _0x3dc1f5&&_0x3dc1f5!=='0'&&_0x3dc1f5!=='-1'&&_0x3dc1f5!=='';};AGIVertices[_0xb00b('0xe')][_0xb00b('0xa6')]=function(_0x13e281){this[_0xb00b('0x33')][_0xb00b('0x70')](this,_0x13e281,'-');_0x13e281['retry']=_0x13e281[_0xb00b('0xa6')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xb00b('0xe')][_0xb00b('0xa7')]=function(_0x40fd9c){logger[_0xb00b('0x29')](util[_0xb00b('0x25')](_0xb00b('0xa8'),_0x40fd9c[_0xb00b('0x36')]));if(!this['isConfigured'](_0x40fd9c[_0xb00b('0x5a')])){return this[_0xb00b('0x34')][_0xb00b('0xa9')](_0xb00b('0xaa'));}var _0x4fd392='\x22'+_0x40fd9c[_0xb00b('0x5a')]+'\x22';if(this[_0xb00b('0x85')](_0x40fd9c[_0xb00b('0x79')])){_0x4fd392+=','+_0x40fd9c[_0xb00b('0x79')];}var _0x40885e=this[_0xb00b('0x34')][_0xb00b('0x54')](_0xb00b('0xab'),_0x4fd392);if(_0x40885e['result']===-0x1){return _0x40885e;}return this['channel'][_0xb00b('0xa9')](util[_0xb00b('0x25')](_0xb00b('0xac'),_0x4fd392));};AGIVertices['prototype'][_0xb00b('0xad')]=function(_0xdf20d6){logger[_0xb00b('0x29')](util['format'](_0xb00b('0xae'),_0xdf20d6[_0xb00b('0x36')]));if(!this[_0xb00b('0x85')](_0xdf20d6['grammar'])){return this['channel'][_0xb00b('0xa9')]('no\x20grammar\x20configured');}var _0x348a39=_0xdf20d6['grammar'];if(this['isConfigured'](_0xdf20d6[_0xb00b('0x79')])){_0x348a39+=','+_0xdf20d6[_0xb00b('0x79')];}var _0x49a23f=this[_0xb00b('0x34')][_0xb00b('0x54')]('MRCPRecog',_0x348a39);if(_0x49a23f[_0xb00b('0xa4')]===-0x1){return _0x49a23f;}var _0x54ebe1=this['getAndSetVariable'](_0xb00b('0xaf'),_0xb00b('0xb0'));if(_0x54ebe1[_0xb00b('0xa4')]===-0x1){return _0x54ebe1;}var _0x40d07f=this[_0xb00b('0xa3')](_0xb00b('0xb1'),'MRCP_RECOG_TRANSCRIPT');if(_0x40d07f[_0xb00b('0xa4')]===-0x1){return _0x40d07f;}var _0x5557d7=this[_0xb00b('0xa3')](_0xb00b('0xb2'),_0xb00b('0xb3'));if(_0x5557d7['result']===-0x1){return _0x5557d7;}return this[_0xb00b('0x34')][_0xb00b('0xa9')](util[_0xb00b('0x25')](_0xb00b('0xb4'),_0x348a39));};AGIVertices['prototype']['agi']=function(_0x3f3f5c){logger['info'](util['format'](_0xb00b('0xb5'),_0x3f3f5c['label']));return this['channel'][_0xb00b('0x6')]([_0x3f3f5c[_0xb00b('0xb6')],_0x3f3f5c[_0xb00b('0xb7')]]);};AGIVertices[_0xb00b('0xe')]['answer']=function(_0x4c3140){logger[_0xb00b('0x29')](util[_0xb00b('0x25')](_0xb00b('0xb8'),_0x4c3140['label']));if(this['isConfigured'](_0x4c3140[_0xb00b('0x64')])){logger['info'](util['format'](_0xb00b('0xb9'),_0x4c3140['timeout']));var _0x291010=this['channel'][_0xb00b('0xba')](_0x4c3140['timeout']);if(_0x291010[_0xb00b('0xa4')]===-0x1){return _0x291010;}}return this[_0xb00b('0x34')][_0xb00b('0xbb')]();};AGIVertices['prototype'][_0xb00b('0x49')]=function(_0x596092){logger[_0xb00b('0x29')](util[_0xb00b('0x25')]('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x596092['label']));if(!this['isConfigured'](_0x596092['list_id'])){return this[_0xb00b('0x34')]['error'](_0x596092,_0xb00b('0xbc'));}_0x596092['scheduledAt']=moment();if(this[_0xb00b('0x85')](_0x596092[_0xb00b('0xbd')])){_0x596092[_0xb00b('0x48')]=moment()[_0xb00b('0xbe')](_0x596092[_0xb00b('0xbd')],'minutes');}if(!this[_0xb00b('0x85')](_0x596092[_0xb00b('0xbf')])){_0x596092[_0xb00b('0xbf')]=0x2;}this[_0xb00b('0x41')]['sync'](this,_0x596092);return this['channel'][_0xb00b('0xa9')](util[_0xb00b('0x25')](_0xb00b('0xc0'),_0x596092[_0xb00b('0xc1')],_0x596092[_0xb00b('0x47')],_0x596092[_0xb00b('0x48')]));};AGIVertices[_0xb00b('0xe')][_0xb00b('0xc2')]=function(_0x413a68){logger['info'](util[_0xb00b('0x25')](_0xb00b('0xc3'),_0x413a68['label']));var _0x475ebb=this['channel'][_0xb00b('0x54')](_0x413a68[_0xb00b('0xc4')],_0x413a68['options']);if(_0x475ebb['result']===-0x1){return _0x475ebb;}return this[_0xb00b('0x34')][_0xb00b('0xa9')](util[_0xb00b('0x25')]('Executed\x20command\x20%s\x20%s',_0x413a68[_0xb00b('0xc4')],_0x413a68[_0xb00b('0x79')]));};AGIVertices[_0xb00b('0xe')]['lumenvoxtts']=function(_0x30cece){logger['info'](util['format']('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x30cece[_0xb00b('0x36')]));if(!this['isConfigured'](_0x30cece[_0xb00b('0x5a')])){return this[_0xb00b('0x34')]['noop']('no\x20text\x20configured');}var _0x1d3862='\x22'+_0x30cece[_0xb00b('0x5a')]+'\x22';if(this['isConfigured'](_0x30cece[_0xb00b('0x79')])){_0x1d3862+=','+_0x30cece[_0xb00b('0x79')];}var _0x434d17=this[_0xb00b('0x34')][_0xb00b('0x54')](_0xb00b('0xab'),_0x1d3862);if(_0x434d17['result']===-0x1){return _0x434d17;}return this[_0xb00b('0x34')][_0xb00b('0xa9')](util['format'](_0xb00b('0xac'),_0x1d3862));};AGIVertices['prototype']['sestektts']=function(_0x3ff801){logger['info'](util[_0xb00b('0x25')](_0xb00b('0xc5'),_0x3ff801[_0xb00b('0x36')]));if(!this['isConfigured'](_0x3ff801['text'])){return this['channel'][_0xb00b('0xa9')](_0xb00b('0xaa'));}var _0x4cb653='\x22'+_0x3ff801[_0xb00b('0x5a')]+'\x22';if(this[_0xb00b('0x85')](_0x3ff801[_0xb00b('0x79')])){_0x4cb653+=','+_0x3ff801[_0xb00b('0x79')];}var _0xa39d1d=this[_0xb00b('0x34')][_0xb00b('0x54')](_0xb00b('0xab'),_0x4cb653);if(_0xa39d1d['result']===-0x1){return _0xa39d1d;}return this[_0xb00b('0x34')][_0xb00b('0xa9')](util[_0xb00b('0x25')]('Executed\x20command\x20MRCPSynth\x20%s',_0x4cb653));};AGIVertices['prototype']['lumenvoxasr']=function(_0x1e66eb){logger[_0xb00b('0x29')](util[_0xb00b('0x25')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x1e66eb[_0xb00b('0x36')]));if(!this[_0xb00b('0x85')](_0x1e66eb[_0xb00b('0xc6')])){return this[_0xb00b('0x34')][_0xb00b('0xa9')]('no\x20grammar\x20configured');}var _0x1674ab=_0x1e66eb['grammar'];if(this[_0xb00b('0x85')](_0x1e66eb[_0xb00b('0x79')])){_0x1674ab+=','+_0x1e66eb[_0xb00b('0x79')];}var _0x2ad1e2=this[_0xb00b('0x34')][_0xb00b('0x54')]('MRCPRecog',_0x1674ab);if(_0x2ad1e2[_0xb00b('0xa4')]===-0x1){return _0x2ad1e2;}var _0x437246=this[_0xb00b('0xa3')](_0xb00b('0xaf'),_0xb00b('0xc7'));if(_0x437246[_0xb00b('0xa4')]===-0x1){return _0x437246;}var _0x26cd15=this[_0xb00b('0xa3')](_0xb00b('0xb1'),_0xb00b('0xc8'));if(_0x26cd15['result']===-0x1){return _0x26cd15;}var _0x27ad72=this[_0xb00b('0xa3')]('RECOG_INSTANCE()',_0xb00b('0xc9'));if(_0x27ad72['result']===-0x1){return _0x27ad72;}return this['channel']['noop'](util[_0xb00b('0x25')]('Executed\x20command\x20MRCPRecog\x20%s',_0x1674ab));};AGIVertices[_0xb00b('0xe')][_0xb00b('0xca')]=function(_0x237afa){logger[_0xb00b('0x29')](util[_0xb00b('0x25')](_0xb00b('0xcb'),_0x237afa[_0xb00b('0x36')]));if(!this[_0xb00b('0x85')](_0x237afa[_0xb00b('0xc6')])){return this[_0xb00b('0x34')][_0xb00b('0xa9')](_0xb00b('0xcc'));}var _0xada805=_0x237afa[_0xb00b('0xc6')];if(this['isConfigured'](_0x237afa[_0xb00b('0x79')])){_0xada805+=','+_0x237afa[_0xb00b('0x79')];}var _0xbe882e=this[_0xb00b('0x34')][_0xb00b('0x54')]('MRCPRecog',_0xada805);if(_0xbe882e[_0xb00b('0xa4')]===-0x1){return _0xbe882e;}var _0x387744=this['getAndSetVariable']('RECOG_CONFIDENCE()',_0xb00b('0xcd'));if(_0x387744[_0xb00b('0xa4')]===-0x1){return _0x387744;}var _0x2cb311=this[_0xb00b('0xa3')](_0xb00b('0xb1'),_0xb00b('0xce'));if(_0x2cb311[_0xb00b('0xa4')]===-0x1){return _0x2cb311;}var _0x13a7f1=this[_0xb00b('0xa3')](_0xb00b('0xb2'),_0xb00b('0xcf'));if(_0x13a7f1['result']===-0x1){return _0x13a7f1;}return this[_0xb00b('0x34')]['noop'](util[_0xb00b('0x25')](_0xb00b('0xb4'),_0xada805));};AGIVertices[_0xb00b('0xe')][_0xb00b('0xd0')]=function(_0x26afd5){logger[_0xb00b('0x29')](util['format'](_0xb00b('0xd1'),_0x26afd5[_0xb00b('0x36')]));if(!this[_0xb00b('0x85')](_0x26afd5[_0xb00b('0xd2')])){return this['channel'][_0xb00b('0x2e')](_0x26afd5,_0xb00b('0xd3'));}var _0x58dbf6=this[_0xb00b('0x16')][_0xb00b('0x70')](this,_0x26afd5[_0xb00b('0xd2')]);if(!_0x58dbf6){return this[_0xb00b('0x34')][_0xb00b('0x2e')](_0x26afd5,_0xb00b('0xd4'));}if(!this[_0xb00b('0x85')](_0x26afd5[_0xb00b('0x2b')])){return this[_0xb00b('0x34')]['error'](_0x26afd5,_0xb00b('0xd5'));}var _0x40869b=_0x26afd5['query'][_0xb00b('0x56')](/(\r\n|\n|\r)/gm,'\x20');this[_0xb00b('0x34')][_0xb00b('0xa9')](util[_0xb00b('0x25')](_0xb00b('0xd6'),_0x40869b));var _0x3960be=this[_0xb00b('0x27')][_0xb00b('0x70')](this,_0x58dbf6,_0x40869b);this[_0xb00b('0x33')][_0xb00b('0x70')](this,_0x26afd5,_0x40869b);if(!this[_0xb00b('0x85')](_0x26afd5['variable_id'])){return this[_0xb00b('0x34')][_0xb00b('0xa9')](_0xb00b('0xd7'));}var _0x553651=this[_0xb00b('0xf')][_0xb00b('0x70')](this,_0x26afd5[_0xb00b('0xd8')]);if(!_0x553651){return this[_0xb00b('0x34')]['error'](_0x26afd5,_0xb00b('0xd9'));}var _0xf351=this;_0x3960be['forEach'](function(_0x4a3453,_0x249455){Object[_0xb00b('0xda')](_0x4a3453)['forEach'](function(_0x1256a8){_0xf351['channel']['setVariable'](util[_0xb00b('0x25')]('%s[%s][%s]',_0x553651,_0x249455,_0x1256a8),_0x4a3453[_0x1256a8]);});});this['channel'][_0xb00b('0x9f')](util[_0xb00b('0x25')](_0xb00b('0xdb'),_0x553651),_0x3960be[_0xb00b('0x9b')]);return this[_0xb00b('0x34')][_0xb00b('0xa9')](util[_0xb00b('0x25')](_0xb00b('0xdc'),_0x553651));};AGIVertices[_0xb00b('0xe')][_0xb00b('0xdd')]=function(_0x22e944){logger[_0xb00b('0xde')](util[_0xb00b('0x25')](_0xb00b('0xdf'),_0x22e944['label']));if(!this[_0xb00b('0x85')](_0x22e944[_0xb00b('0xe0')])){return this['channel'][_0xb00b('0x2e')](_0x22e944,'no\x20user\x20selected');}var _0xb7b4af=this[_0xb00b('0x17')][_0xb00b('0x70')](this,_0x22e944['sip_id']);if(!_0xb7b4af){return this[_0xb00b('0x34')][_0xb00b('0x2e')](_0x22e944,'no\x20user\x20found');}var _0x8478c8=this[_0xb00b('0x34')][_0xb00b('0x54')](_0xb00b('0xe1'),[util['format'](_0xb00b('0xe2'),_0xb7b4af),_0x22e944[_0xb00b('0x64')],_0x22e944[_0xb00b('0xe3')],_0x22e944['url']]);if(_0x8478c8['result']===-0x1){return _0x8478c8;}return this['channel'][_0xb00b('0xa9')](util[_0xb00b('0x25')](_0xb00b('0xe4'),_0xb00b('0xe1')));};AGIVertices[_0xb00b('0xe')][_0xb00b('0xe5')]=function(_0x33adbf){logger[_0xb00b('0x29')](util[_0xb00b('0x25')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x33adbf['label']));if(!this[_0xb00b('0x85')](_0x33adbf[_0xb00b('0x84')])){return this['channel'][_0xb00b('0xa9')]('no\x20key\x20configured');}if(!this[_0xb00b('0x85')](_0x33adbf['text'])){return this[_0xb00b('0x34')][_0xb00b('0xa9')]('no\x20text\x20configured');}this[_0xb00b('0x34')][_0xb00b('0xe6')]=!![];this['createSquareDetailsReport'](_0x33adbf);this[_0xb00b('0x40')](_0x33adbf['text'],'in','','');this[_0xb00b('0x34')][_0xb00b('0xa9')](util[_0xb00b('0x25')](_0xb00b('0xe7'),_0x33adbf[_0xb00b('0x5a')]));var _0x1fd905=this[_0xb00b('0x7a')][_0xb00b('0x70')](this,_0x33adbf);if(_0x1fd905){for(var _0x437d50 in _0x1fd905){if(_0x1fd905[_0xb00b('0x96')](_0x437d50)){this['channel']['setVariable'](util[_0xb00b('0x25')]('DIALOGFLOW_%s',_0x437d50[_0xb00b('0x69')]()),_0x1fd905[_0x437d50]);}}this['createSquareMessage'](_0x1fd905[_0xb00b('0xe8')],_0xb00b('0xe9'),'dialogflow','');return this[_0xb00b('0x34')]['noop'](util[_0xb00b('0x25')](_0xb00b('0xea'),_0x1fd905['speech']));}return this[_0xb00b('0x34')][_0xb00b('0x2e')](_0x33adbf,_0xb00b('0xeb'));};AGIVertices[_0xb00b('0xe')][_0xb00b('0xec')]=function(_0x58df43){logger[_0xb00b('0x29')](util[_0xb00b('0x25')]('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x58df43['label']));if(!this[_0xb00b('0x85')](_0x58df43['dialogflowV2_project_id'])){return this['channel']['noop'](_0xb00b('0xed'));}if(!this[_0xb00b('0x85')](_0x58df43[_0xb00b('0x7c')])){return this[_0xb00b('0x34')]['noop'](_0xb00b('0xee'));}if(!this['isConfigured'](_0x58df43[_0xb00b('0x7d')])){return this[_0xb00b('0x34')][_0xb00b('0xa9')](_0xb00b('0xef'));}if(!this['isConfigured'](_0x58df43[_0xb00b('0x7e')])){return this[_0xb00b('0x34')]['noop'](_0xb00b('0xf0'));}if(!this[_0xb00b('0x85')](_0x58df43[_0xb00b('0x5a')])){return this['channel']['noop'](_0xb00b('0xaa'));}this[_0xb00b('0x34')][_0xb00b('0xe6')]=!![];this[_0xb00b('0x33')](_0x58df43);this[_0xb00b('0x40')](_0x58df43[_0xb00b('0x5a')],'in','','');this[_0xb00b('0x34')]['noop'](util['format'](_0xb00b('0xf1'),_0x58df43['text']));var _0x50b0ae=this[_0xb00b('0x7b')][_0xb00b('0x70')](this,_0x58df43);if(_0x50b0ae){for(var _0x5d34ee in _0x50b0ae){if(_0x50b0ae[_0xb00b('0x96')](_0x5d34ee)){if(_0x5d34ee!==_0xb00b('0xf2')){this[_0xb00b('0x34')]['setVariable'](util[_0xb00b('0x25')](_0xb00b('0xf3'),_0x5d34ee[_0xb00b('0x69')]()),_0x50b0ae[_0x5d34ee]);}}}this[_0xb00b('0x40')](_0x50b0ae[_0xb00b('0xe8')],_0xb00b('0xe9'),_0xb00b('0xec'),_0x50b0ae['providerResponse']);return this[_0xb00b('0x34')][_0xb00b('0xa9')](util['format']('DialogflowV2\x20Result\x20%s',_0x50b0ae['speech']));}return this[_0xb00b('0x34')][_0xb00b('0x2e')](_0x58df43,_0xb00b('0xf4'));};AGIVertices[_0xb00b('0xe')][_0xb00b('0xf5')]=function(_0x1901d1){logger[_0xb00b('0x29')](util['format']('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x1901d1[_0xb00b('0x36')]));if(!this[_0xb00b('0x85')](_0x1901d1['ndauth_url'])){return this[_0xb00b('0x34')][_0xb00b('0xa9')]('no\x20ndauth\x20url\x20configured');}if(!this[_0xb00b('0x85')](_0x1901d1['username'])){return this[_0xb00b('0x34')]['noop']('no\x20username\x20configured');}if(!this['isConfigured'](_0x1901d1[_0xb00b('0xf6')])){return this[_0xb00b('0x34')][_0xb00b('0xa9')](_0xb00b('0xf7'));}if(!this['isConfigured'](_0x1901d1[_0xb00b('0xf8')])){return this[_0xb00b('0x34')][_0xb00b('0xa9')](_0xb00b('0xaa'));}this[_0xb00b('0x34')][_0xb00b('0xe6')]=!![];this[_0xb00b('0x33')](_0x1901d1);this[_0xb00b('0x40')](_0x1901d1[_0xb00b('0x5a')],'in','','');this[_0xb00b('0x34')]['noop'](util['format'](_0xb00b('0xf9'),_0x1901d1[_0xb00b('0x5a')]));var _0x2ca9e2=this[_0xb00b('0x7f')][_0xb00b('0x70')](this,_0x1901d1);if(_0x2ca9e2){for(var _0x1e0206 in _0x2ca9e2){if(_0x2ca9e2[_0xb00b('0x96')](_0x1e0206)){this[_0xb00b('0x34')][_0xb00b('0x9f')](util['format'](_0xb00b('0xfa'),_0x1e0206[_0xb00b('0x69')]()),_0x2ca9e2[_0x1e0206]);}}this[_0xb00b('0x40')](_0x2ca9e2[_0xb00b('0xe8')],'out',_0xb00b('0xf5'),'');if(_0x2ca9e2[_0xb00b('0xfb')]){this[_0xb00b('0x34')][_0xb00b('0xa9')](util[_0xb00b('0x25')](_0xb00b('0xfc'),_0x2ca9e2[_0xb00b('0xfb')]));var _0x4768a0=this[_0xb00b('0x34')]['streamFile'](_0x2ca9e2['audiofile']);try{fs[_0xb00b('0xfd')](_0x2ca9e2[_0xb00b('0xfb')]+_0xb00b('0xfe'));}catch(_0x121451){logger[_0xb00b('0x2e')](_0x121451);}return _0x4768a0;}else{return this[_0xb00b('0x34')][_0xb00b('0xa9')](util['format'](_0xb00b('0xff'),_0x2ca9e2[_0xb00b('0xe8')]));}}return this[_0xb00b('0x34')][_0xb00b('0x2e')](_0x1901d1,_0xb00b('0x100'));};AGIVertices[_0xb00b('0xe')]['end']=function(_0xbea4c9){logger[_0xb00b('0x29')](util['format'](_0xb00b('0x101'),_0xbea4c9[_0xb00b('0x36')]));return this[_0xb00b('0x34')][_0xb00b('0xa9')](_0xb00b('0x102'));};AGIVertices[_0xb00b('0xe')]['ext_dial']=function(_0x4aede6){logger[_0xb00b('0x29')](util['format']('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x4aede6['label']));var _0x18f85f='';if(_0x4aede6[_0xb00b('0x103')]){if(!this['isConfigured'](_0x4aede6['trunk_id'])){return this[_0xb00b('0x34')][_0xb00b('0x2e')](_0x4aede6,_0xb00b('0x104'));}else{var _0x12b38a=parseInt(_0x4aede6[_0xb00b('0x103')],0xa);if(isNaN(_0x12b38a)){_0x18f85f=_0x4aede6[_0xb00b('0x103')];}else{_0x18f85f=this[_0xb00b('0x19')][_0xb00b('0x70')](this,_0x4aede6[_0xb00b('0x103')]);if(!_0x18f85f){return this[_0xb00b('0x34')][_0xb00b('0x2e')](_0x4aede6,'no\x20trunk\x20found');}}}}else if(_0x4aede6[_0xb00b('0x105')]){_0x18f85f=_0x4aede6[_0xb00b('0x105')];}else{return this[_0xb00b('0x34')][_0xb00b('0x2e')](_0x4aede6,_0xb00b('0x104'));}var _0x21dc1a=this['channel'][_0xb00b('0x54')](_0xb00b('0xe1'),[util[_0xb00b('0x25')](_0xb00b('0x106'),_0x18f85f,_0x4aede6['phone']),_0x4aede6['timeout'],_0x4aede6[_0xb00b('0xe3')],_0x4aede6[_0xb00b('0x72')]]);if(_0x21dc1a[_0xb00b('0xa4')]===-0x1){return _0x21dc1a;}return this[_0xb00b('0x34')][_0xb00b('0xa9')](util[_0xb00b('0x25')](_0xb00b('0xe4'),_0xb00b('0xe1')));};AGIVertices[_0xb00b('0xe')][_0xb00b('0x107')]=function(_0x41550f){logger['info'](util[_0xb00b('0x25')](_0xb00b('0x108'),_0x41550f[_0xb00b('0x36')]));return this[_0xb00b('0x34')][_0xb00b('0xa9')](_0xb00b('0x107'));};AGIVertices[_0xb00b('0xe')][_0xb00b('0xa')]=function(_0x56b9a6){logger[_0xb00b('0x29')](util[_0xb00b('0x25')](_0xb00b('0x109'),_0x56b9a6[_0xb00b('0x36')]));if(_0x56b9a6['retry']===0x0){return this['maxRetry'](_0x56b9a6);}_0x56b9a6['retry']-=0x1;if(!this[_0xb00b('0x85')](_0x56b9a6['file_id'])){return this[_0xb00b('0x34')][_0xb00b('0x2e')](_0x56b9a6,_0xb00b('0x10a'));}var _0x228fdc=this['getSound']['sync'](this,_0x56b9a6[_0xb00b('0x10b')]);if(!_0x228fdc){return this['channel']['error'](_0x56b9a6,_0xb00b('0x10c'));}if(!this['isConfigured'](_0x56b9a6[_0xb00b('0xd8')])){return this[_0xb00b('0x34')][_0xb00b('0x2e')](_0xb00b('0xd7'));}var _0x52d0ce=this[_0xb00b('0x34')][_0xb00b('0x10d')](_0x228fdc,_0x56b9a6[_0xb00b('0x10e')],_0x56b9a6[_0xb00b('0x10f')]);var _0x4022cb=_0x52d0ce['result']?_0x52d0ce['result']['toString']():'';logger[_0xb00b('0x29')](_0xb00b('0x110'),JSON['stringify'](_0x52d0ce));if(_0x52d0ce[_0xb00b('0xa4')]===-0x1){this[_0xb00b('0x33')][_0xb00b('0x70')](this,_0x56b9a6,_0x4022cb);return _0x52d0ce;}else if(_0x52d0ce[_0xb00b('0xa2')]==='timeout'){_0x52d0ce[_0xb00b('0xa4')]=_0x4022cb[_0xb00b('0x9b')]>=parseInt(_0x56b9a6[_0xb00b('0x111')])?'x':'i';}else{_0x52d0ce[_0xb00b('0xa4')]=_0x4022cb['length']>=parseInt(_0x56b9a6[_0xb00b('0x111')])&&_0x4022cb['length']<=parseInt(_0x56b9a6[_0xb00b('0x10f')])?'x':'i';}var _0x468dd4=this[_0xb00b('0xf')][_0xb00b('0x70')](this,_0x56b9a6[_0xb00b('0xd8')]);if(!_0x468dd4){return this[_0xb00b('0x34')][_0xb00b('0x2e')](_0x56b9a6,_0xb00b('0xd9'));}this[_0xb00b('0x34')][_0xb00b('0x9f')](_0x468dd4,_0x4022cb);if(this[_0xb00b('0x85')](_0x56b9a6[_0xb00b('0x112')])){var _0x404e4b=parseInt(_0x56b9a6[_0xb00b('0x112')],0xa);var _0x3f5a72=rs[_0xb00b('0x113')]({'charset':'*','length':_0x404e4b});var _0x4081d8=_0x4022cb['length'];if(_0x4081d8>0x0){if(_0x4081d8>_0x404e4b){this[_0xb00b('0x33')][_0xb00b('0x70')](this,_0x56b9a6,_0x56b9a6[_0xb00b('0x114')]===_0xb00b('0x115')?_0x3f5a72+_0x4022cb[_0xb00b('0x116')](_0x404e4b):_0x4022cb['substr'](0x0,_0x4081d8-_0x404e4b)+_0x3f5a72);}else{this[_0xb00b('0x33')][_0xb00b('0x70')](this,_0x56b9a6,rs[_0xb00b('0x113')]({'charset':'*','length':_0x4081d8}));}}else{this[_0xb00b('0x33')][_0xb00b('0x70')](this,_0x56b9a6,'');}}else{this[_0xb00b('0x33')][_0xb00b('0x70')](this,_0x56b9a6,_0x4022cb);}return _0x52d0ce;};AGIVertices['prototype'][_0xb00b('0xb')]=function(_0x4f9fea){logger[_0xb00b('0x29')](util[_0xb00b('0x25')](_0xb00b('0x117'),_0x4f9fea['label']));return this[_0xb00b('0xa')](_0x4f9fea);};AGIVertices[_0xb00b('0xe')][_0xb00b('0x118')]=function(_0x181f39){logger['info'](util['format'](_0xb00b('0x119'),_0x181f39[_0xb00b('0x36')]));this['createSquareDetailsReport'][_0xb00b('0x70')](this,_0x181f39,_0x181f39[_0xb00b('0x11a')]);return this[_0xb00b('0x34')][_0xb00b('0xa9')](util['format']('GOAL\x20%s',_0x181f39[_0xb00b('0x11a')]));};AGIVertices[_0xb00b('0xe')][_0xb00b('0x11b')]=function(_0x469af8){logger[_0xb00b('0x29')](util[_0xb00b('0x25')](_0xb00b('0x11c'),_0x469af8[_0xb00b('0x36')]));if(!this['isConfigured'](_0x469af8[_0xb00b('0x8c')])||!this[_0xb00b('0x85')](_0x469af8[_0xb00b('0x88')])){return this[_0xb00b('0x34')][_0xb00b('0xa9')](_0xb00b('0x11d'));}if(!this[_0xb00b('0x85')](_0x469af8['text'])){return this[_0xb00b('0x34')][_0xb00b('0xa9')](_0xb00b('0xaa'));}this[_0xb00b('0x34')][_0xb00b('0xa9')](util[_0xb00b('0x25')](_0xb00b('0x11e'),_0x469af8[_0xb00b('0x5a')]));var _0xddea8c=this[_0xb00b('0x87')][_0xb00b('0x70')](this,_0x469af8);if(_0xddea8c){this['channel'][_0xb00b('0xa9')](util[_0xb00b('0x25')](_0xb00b('0x11f'),_0xddea8c));var _0x274e24=this[_0xb00b('0x34')][_0xb00b('0x120')](_0xddea8c);try{fs['unlink'](_0xddea8c+_0xb00b('0xfe'));}catch(_0x165b19){logger[_0xb00b('0x2e')](_0x165b19);}return _0x274e24;}return this['channel']['error'](_0x469af8,_0xb00b('0x121'));};AGIVertices['prototype'][_0xb00b('0x122')]=function(_0x33f059){logger['info'](util[_0xb00b('0x25')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x33f059['label']));if(!this[_0xb00b('0x85')](_0x33f059['aws_access_key_id'])||!this[_0xb00b('0x85')](_0x33f059[_0xb00b('0x88')])){return this[_0xb00b('0x34')]['noop'](_0xb00b('0x11d'));}if(!this[_0xb00b('0x85')](_0x33f059[_0xb00b('0x8e')])){return this[_0xb00b('0x34')][_0xb00b('0xa9')](_0xb00b('0x123'));}if(!this[_0xb00b('0x85')](_0x33f059['text'])){return this[_0xb00b('0x34')]['noop'](_0xb00b('0xaa'));}this[_0xb00b('0x34')][_0xb00b('0xe6')]=!![];this[_0xb00b('0x33')](_0x33f059);this['createSquareMessage'](_0x33f059[_0xb00b('0x5a')],'in','','');this[_0xb00b('0x34')][_0xb00b('0xa9')](util[_0xb00b('0x25')](_0xb00b('0x124'),_0x33f059[_0xb00b('0x5a')]));var _0x5ed8a8=this[_0xb00b('0x8b')][_0xb00b('0x70')](this,_0x33f059);if(_0x5ed8a8){for(var _0x47ac50 in _0x5ed8a8){if(_0x5ed8a8[_0xb00b('0x96')](_0x47ac50)&&_[_0xb00b('0x125')](_0x5ed8a8[_0x47ac50])){this[_0xb00b('0x34')][_0xb00b('0x9f')](util[_0xb00b('0x25')](_0xb00b('0x126'),_0x47ac50[_0xb00b('0x69')]()),_0x5ed8a8[_0x47ac50]);}}if(_[_0xb00b('0x42')](_0x5ed8a8[_0xb00b('0x77')])){return this[_0xb00b('0x34')][_0xb00b('0xa9')](_0xb00b('0x127'));}else{this[_0xb00b('0x40')](_0x5ed8a8[_0xb00b('0x77')],'out','amazonlex','');return this['channel'][_0xb00b('0xa9')](util[_0xb00b('0x25')](_0xb00b('0x128'),_0x5ed8a8['message']));}}return this[_0xb00b('0x34')][_0xb00b('0x2e')](_0x33f059,_0xb00b('0x129'));};AGIVertices[_0xb00b('0xe')][_0xb00b('0x12a')]=function(_0x5856e6){logger[_0xb00b('0x29')](util['format']('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x5856e6['label'],_0x5856e6[_0xb00b('0x64')]));if(!this[_0xb00b('0x85')](_0x5856e6['key'])){return this[_0xb00b('0x34')][_0xb00b('0xa9')](_0xb00b('0x12b'));}var _0x479bb4=_0xb00b('0x12c');var _0x4e0ae0=util[_0xb00b('0x25')](_0xb00b('0x12d'),FILES_PATH,rs[_0xb00b('0x113')](0x4));var _0x44d055=util['format']('%s.%s',_0x4e0ae0,_0x479bb4);var _0x470c4a=!![];if(_0x5856e6[_0xb00b('0x12e')]===_0xb00b('0x12f')){_0x470c4a=![];}var _0x86fa65=this[_0xb00b('0x34')][_0xb00b('0x130')](_0x4e0ae0,_0x479bb4,_0x5856e6['intKey'],_0x5856e6[_0xb00b('0x64')],undefined,_0x470c4a);if(_0x86fa65[_0xb00b('0xa4')]!==-0x1){this[_0xb00b('0x34')][_0xb00b('0xa9')](util['format'](_0xb00b('0x131'),_0x44d055));var _0x2d42a0=this[_0xb00b('0x8f')][_0xb00b('0x70')](this,_0x5856e6,_0x44d055);if(_0x2d42a0){for(var _0x379b81 in _0x2d42a0){if(_0x2d42a0[_0xb00b('0x96')](_0x379b81)){this[_0xb00b('0x34')][_0xb00b('0x9f')](util['format'](_0xb00b('0x132'),_0x379b81[_0xb00b('0x69')]()),_0x2d42a0[_0x379b81]);}}return this[_0xb00b('0x34')]['noop'](util[_0xb00b('0x25')](_0xb00b('0x133'),JSON[_0xb00b('0x73')](_0x2d42a0)));}}return _0x86fa65;};AGIVertices['prototype'][_0xb00b('0x134')]=function(_0x762c9f){logger[_0xb00b('0x29')](util[_0xb00b('0x25')](_0xb00b('0x135'),_0x762c9f[_0xb00b('0x36')]));if(!this[_0xb00b('0x85')](_0x762c9f['appid'])){return this[_0xb00b('0x34')][_0xb00b('0xa9')](_0xb00b('0x136'));}if(!this['isConfigured'](_0x762c9f[_0xb00b('0x92')])){return this[_0xb00b('0x34')][_0xb00b('0xa9')](_0xb00b('0x137'));}var _0x5cf39f=_0xb00b('0x12c');var _0x505678=util[_0xb00b('0x25')](_0xb00b('0x12d'),FILES_PATH,rs['generate'](0x4));var _0x17ba28=util[_0xb00b('0x25')](_0xb00b('0x9e'),_0x505678,_0x5cf39f);var _0x218fac=!![];if(_0x762c9f[_0xb00b('0x12e')]==='NOBEEP'){_0x218fac=![];}var _0x4fe25f=this[_0xb00b('0x34')][_0xb00b('0x130')](_0x505678,_0x5cf39f,_0x762c9f[_0xb00b('0x138')],_0x762c9f['timeout'],undefined,_0x218fac);if(_0x4fe25f[_0xb00b('0xa4')]!==-0x1){this[_0xb00b('0x34')][_0xb00b('0xa9')](util['format'](_0xb00b('0x139'),_0x17ba28));var _0x1b7517=this[_0xb00b('0x13a')]['sync'](this,_0x762c9f,_0x17ba28);if(_0x1b7517){for(var _0x443d02 in _0x1b7517){if(_0x1b7517[_0xb00b('0x96')](_0x443d02)){this['channel']['setVariable'](util[_0xb00b('0x25')](_0xb00b('0x13b'),_0x443d02[_0xb00b('0x69')]()),_0x1b7517[_0x443d02]);}}return this[_0xb00b('0x34')]['noop'](util[_0xb00b('0x25')](_0xb00b('0x13c'),JSON[_0xb00b('0x73')](_0x1b7517)));}}return _0x4fe25f;};AGIVertices[_0xb00b('0xe')][_0xb00b('0x13d')]=function(_0x5e12dc){logger[_0xb00b('0x29')](util[_0xb00b('0x25')](_0xb00b('0x13e'),_0x5e12dc[_0xb00b('0x36')]));return this[_0xb00b('0x34')][_0xb00b('0x13f')](_0x5e12dc[_0xb00b('0x140')],_0x5e12dc[_0xb00b('0x3c')],_0x5e12dc['priority']);};AGIVertices['prototype'][_0xb00b('0x141')]=function(_0x3bda90){logger[_0xb00b('0x29')](util['format'](_0xb00b('0x142'),_0x3bda90['label']));if(!this['isConfigured'](_0x3bda90[_0xb00b('0x143')])){return this[_0xb00b('0x34')][_0xb00b('0x2e')](_0x3bda90,'no\x20condition\x20configured');}try{var _0x4c6555=eval(_0x3bda90['condition'])?_0xb00b('0x144'):'false';this[_0xb00b('0x34')][_0xb00b('0xa9')](util[_0xb00b('0x25')]('EVAL\x20CONDITION\x20%s\x20%s',_0x3bda90[_0xb00b('0x143')],_0x4c6555));return{'code':0xc8,'result':_0x4c6555};}catch(_0xef8362){return{'code':0xc8,'result':_0xb00b('0x145')};}};AGIVertices[_0xb00b('0xe')][_0xb00b('0x146')]=function(_0x4ef538){logger[_0xb00b('0x29')](util['format'](_0xb00b('0x147'),_0x4ef538[_0xb00b('0x36')]));if(!this[_0xb00b('0x85')](_0x4ef538[_0xb00b('0x148')])){return this[_0xb00b('0x34')][_0xb00b('0x2e')](_0x4ef538,'no\x20interval\x20configured');}var _0x13d0dd=this['getIntervals'][_0xb00b('0x70')](this,_0x4ef538['interval_id']);if(!_0x13d0dd){return this[_0xb00b('0x34')][_0xb00b('0x2e')](_0x4ef538,_0xb00b('0x149'));}for(var _0x1bca73=0x0;_0x1bca73<_0x13d0dd['length'];_0x1bca73+=0x1){var _0x2c958a=this['channel'][_0xb00b('0xf')](util[_0xb00b('0x25')](_0xb00b('0x14a'),_0x13d0dd[_0x1bca73]));if(_0x2c958a['result']===-0x1){return _0x2c958a;}logger['info'](util[_0xb00b('0x25')](_0xb00b('0x14b'),_0x13d0dd[_0x1bca73],_0x2c958a['extra']));if(_0x2c958a[_0xb00b('0xa2')]===_0xb00b('0x144')){logger['info'](util['format'](_0xb00b('0x14b'),_0x13d0dd[_0x1bca73],'true'));this[_0xb00b('0x34')][_0xb00b('0xa9')](util[_0xb00b('0x25')](_0xb00b('0x14b'),_0x13d0dd[_0x1bca73],_0xb00b('0x144')));return{'code':0xc8,'result':'true'};}else{logger[_0xb00b('0x29')](util['format']('IFTIME\x20%s\x20%s',_0x13d0dd[_0x1bca73],_0xb00b('0x145')));this['channel']['noop'](util['format']('IFTIME\x20%s\x20%s',_0x13d0dd[_0x1bca73],_0xb00b('0x145')));}}return{'code':0xc8,'result':_0xb00b('0x145')};};AGIVertices['prototype'][_0xb00b('0x14c')]=function(_0x1d4b6c){logger['info'](util[_0xb00b('0x25')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x1d4b6c[_0xb00b('0x36')]));return this['channel'][_0xb00b('0x14c')]();};AGIVertices[_0xb00b('0xe')][_0xb00b('0x14d')]=function(_0x5a6955){logger[_0xb00b('0x29')](util['format'](_0xb00b('0x14e'),_0x5a6955[_0xb00b('0x36')]));if(!this[_0xb00b('0x85')](_0x5a6955[_0xb00b('0x84')])){return this[_0xb00b('0x34')][_0xb00b('0xa9')]('no\x20key\x20configured');}var _0x4e5773='wav';var _0x4195ab=util[_0xb00b('0x25')](_0xb00b('0x12d'),FILES_PATH,rs[_0xb00b('0x113')](0x4));var _0x421baa=util[_0xb00b('0x25')](_0xb00b('0x9e'),_0x4195ab,_0x4e5773);var _0x11704f=!![];if(_0x5a6955[_0xb00b('0x12e')]===_0xb00b('0x12f')){_0x11704f=![];}var _0x3098ad=this[_0xb00b('0x34')][_0xb00b('0x130')](_0x4195ab,_0x4e5773,_0x5a6955['intKey'],_0x5a6955[_0xb00b('0x64')],undefined,_0x11704f);if(_0x3098ad['result']!==-0x1){this[_0xb00b('0x34')][_0xb00b('0xa9')](util[_0xb00b('0x25')](_0xb00b('0x14f'),_0x421baa));var _0x1385f5=this['ispeechASR'][_0xb00b('0x70')](this,_0x5a6955,_0x421baa);if(_0x1385f5){for(var _0x1ea341 in _0x1385f5){if(_0x1385f5['hasOwnProperty'](_0x1ea341)){this['channel'][_0xb00b('0x9f')](util['format'](_0xb00b('0x150'),_0x1ea341[_0xb00b('0x69')]()),_0x1385f5[_0x1ea341]);}}return this['channel'][_0xb00b('0xa9')](util[_0xb00b('0x25')](_0xb00b('0x151'),JSON[_0xb00b('0x73')](_0x1385f5)));}}return _0x3098ad;};AGIVertices[_0xb00b('0xe')][_0xb00b('0x152')]=function(_0x3d3641){logger[_0xb00b('0x29')](util['format'](_0xb00b('0x153'),_0x3d3641[_0xb00b('0x36')]));if(!this['isConfigured'](_0x3d3641[_0xb00b('0x84')])){return this[_0xb00b('0x34')][_0xb00b('0xa9')]('no\x20key\x20configured');}if(!this[_0xb00b('0x85')](_0x3d3641['text'])){return this[_0xb00b('0x34')][_0xb00b('0xa9')](_0xb00b('0xaa'));}this[_0xb00b('0x34')][_0xb00b('0xa9')](util[_0xb00b('0x25')](_0xb00b('0x154'),_0x3d3641['text']));var _0x5b5021=this[_0xb00b('0x80')][_0xb00b('0x70')](this,_0x3d3641);if(_0x5b5021){this[_0xb00b('0x34')][_0xb00b('0xa9')](util[_0xb00b('0x25')](_0xb00b('0x14f'),_0x5b5021));var _0x49dd39=this[_0xb00b('0x34')][_0xb00b('0x120')](_0x5b5021,_0x3d3641[_0xb00b('0x138')]);try{fs[_0xb00b('0xfd')](_0x5b5021+'.wav');}catch(_0x4e5d69){logger[_0xb00b('0x2e')](_0x4e5d69);}return _0x49dd39;}return this[_0xb00b('0x34')]['error'](_0x3d3641,_0xb00b('0x155'));};AGIVertices['prototype'][_0xb00b('0x156')]=function(_0x28d6d9){logger[_0xb00b('0x29')](util['format'](_0xb00b('0x157'),_0x28d6d9[_0xb00b('0x36')]));if(!this[_0xb00b('0x85')](_0x28d6d9[_0xb00b('0x158')])){return this[_0xb00b('0x34')][_0xb00b('0x2e')](_0x28d6d9,_0xb00b('0x159'));}logger[_0xb00b('0x29')](util[_0xb00b('0x25')](_0xb00b('0x15a'),this[_0xb00b('0x34')][_0xb00b('0x39')],_0x28d6d9[_0xb00b('0x158')]));var _0x5efdfe=this['agentLogin'][_0xb00b('0x70')](this,_0x28d6d9['findBy']);if(_0x5efdfe){logger['info'](util[_0xb00b('0x25')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xb00b('0x34')]['callerid'],_0x28d6d9[_0xb00b('0x158')]));this[_0xb00b('0x34')][_0xb00b('0xa9')](util['format'](_0xb00b('0x15b'),this['channel'][_0xb00b('0x39')],_0x28d6d9[_0xb00b('0x158')]));return{'code':0xc8,'result':_0xb00b('0x15c')};}else{logger[_0xb00b('0x29')](util[_0xb00b('0x25')](_0xb00b('0x15d'),this[_0xb00b('0x34')][_0xb00b('0x39')],_0x28d6d9[_0xb00b('0x158')]));this[_0xb00b('0x34')][_0xb00b('0xa9')](util[_0xb00b('0x25')](_0xb00b('0x15d'),this[_0xb00b('0x34')][_0xb00b('0x39')],_0x28d6d9['findBy']));return{'code':0xc8,'result':_0xb00b('0x15e')};}};AGIVertices['prototype'][_0xb00b('0x15f')]=function(_0x266b5b){logger[_0xb00b('0x29')](util[_0xb00b('0x25')](_0xb00b('0x160'),_0x266b5b[_0xb00b('0x36')]));if(!this[_0xb00b('0x85')](_0x266b5b[_0xb00b('0x158')])){return this['channel'][_0xb00b('0x2e')](_0x266b5b,_0xb00b('0x159'));}logger[_0xb00b('0x29')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xb00b('0x34')][_0xb00b('0x39')],_0x266b5b[_0xb00b('0x158')]));var _0x33c473=this[_0xb00b('0x51')][_0xb00b('0x70')](this,_0x266b5b['findBy']);if(_0x33c473){logger[_0xb00b('0x29')](util[_0xb00b('0x25')](_0xb00b('0x15b'),this[_0xb00b('0x34')][_0xb00b('0x39')],_0x266b5b[_0xb00b('0x158')]));this[_0xb00b('0x34')][_0xb00b('0xa9')](util[_0xb00b('0x25')](_0xb00b('0x15b'),this[_0xb00b('0x34')][_0xb00b('0x39')],_0x266b5b[_0xb00b('0x158')]));return{'code':0xc8,'result':_0xb00b('0x15c')};}else{logger[_0xb00b('0x29')](util[_0xb00b('0x25')](_0xb00b('0x15d'),this[_0xb00b('0x34')]['callerid'],_0x266b5b[_0xb00b('0x158')]));this[_0xb00b('0x34')]['noop'](util['format'](_0xb00b('0x15d'),this[_0xb00b('0x34')][_0xb00b('0x39')],_0x266b5b['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0xb00b('0x161')]=function(_0x551d40){logger[_0xb00b('0x29')](util[_0xb00b('0x25')](_0xb00b('0x162'),_0x551d40[_0xb00b('0x36')]));if(!this['isConfigured'](_0x551d40[_0xb00b('0x163')])){return this[_0xb00b('0x34')]['error'](_0x551d40,'no\x20operation\x20configured');}this[_0xb00b('0x34')][_0xb00b('0xa9')](util['format'](_0xb00b('0x164'),_0x551d40[_0xb00b('0x163')]));var _0x3e22b5=eval(_0x551d40[_0xb00b('0x163')]);if(!this[_0xb00b('0x85')](_0x551d40[_0xb00b('0xd8')])){return this[_0xb00b('0x34')][_0xb00b('0xa9')](_0xb00b('0xd7'));}var _0x8b2d89=this[_0xb00b('0xf')][_0xb00b('0x70')](this,_0x551d40['variable_id']);if(!_0x8b2d89){return this['channel'][_0xb00b('0x2e')](_0x551d40,_0xb00b('0xd9'));}if(_[_0xb00b('0x9a')](_0x3e22b5)){var _0x5c40c3=this;_0x3e22b5[_0xb00b('0x165')](function(_0x43f06f,_0x40a68f){_0x5c40c3[_0xb00b('0x34')][_0xb00b('0x9f')](util[_0xb00b('0x25')](_0xb00b('0x166'),_0x8b2d89,_0x40a68f),_0x43f06f);});return this[_0xb00b('0x34')][_0xb00b('0xa9')](util[_0xb00b('0x25')](_0xb00b('0x167'),_0x8b2d89));}else{return this[_0xb00b('0x34')][_0xb00b('0x9f')](_0x8b2d89,_0x3e22b5);}};AGIVertices[_0xb00b('0xe')][_0xb00b('0x9')]=function(_0x2aad7b){logger[_0xb00b('0x29')](util[_0xb00b('0x25')](_0xb00b('0x168'),_0x2aad7b[_0xb00b('0x36')]));if(_0x2aad7b['retry']===0x0){return this[_0xb00b('0xa6')](_0x2aad7b);}_0x2aad7b[_0xb00b('0x169')]-=0x1;if(!this[_0xb00b('0x85')](_0x2aad7b[_0xb00b('0x10b')])){return this[_0xb00b('0x34')][_0xb00b('0x2e')](_0x2aad7b,_0xb00b('0x10a'));}var _0x2dc0c9=this[_0xb00b('0x16a')][_0xb00b('0x70')](this,_0x2aad7b[_0xb00b('0x10b')]);if(!_0x2dc0c9){return this[_0xb00b('0x34')][_0xb00b('0x2e')](_0x2aad7b,'no\x20file\x20audio\x20found');}var _0x472905=this[_0xb00b('0x34')][_0xb00b('0x10d')](_0x2dc0c9,_0x2aad7b[_0xb00b('0x10e')],_0x2aad7b['digit']);var _0x31e6c2=_0x472905[_0xb00b('0xa4')];if(_0x472905[_0xb00b('0xa4')]===-0x1){this[_0xb00b('0x33')]['sync'](this,_0x2aad7b,'-1');return _0x472905;}else if(_0x472905[_0xb00b('0xa2')]===_0xb00b('0x64')){_0x472905[_0xb00b('0xa4')]=_0x472905['result'][_0xb00b('0x9b')]>0x0?_0x472905[_0xb00b('0xa4')]:'t';}else if(_[_0xb00b('0x45')](_0x472905[_0xb00b('0xa4')])){_0x472905[_0xb00b('0xa4')]='#';_0x31e6c2='#';}if(!this['isConfigured'](_0x2aad7b['variable_id'])){this['channel'][_0xb00b('0xa9')](_0xb00b('0xd7'));}else{var _0x918555=this[_0xb00b('0xf')][_0xb00b('0x70')](this,_0x2aad7b[_0xb00b('0xd8')]);if(!_0x918555){return this['channel']['error'](_0x2aad7b,_0xb00b('0xd9'));}this['channel'][_0xb00b('0x9f')](_0x918555,_0x31e6c2);}this[_0xb00b('0x33')][_0xb00b('0x70')](this,_0x2aad7b,_0x31e6c2);return _0x472905;};AGIVertices['prototype']['noop']=function(_0x35d7a6){logger[_0xb00b('0x29')](util[_0xb00b('0x25')]('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x35d7a6[_0xb00b('0x36')]));return this[_0xb00b('0x34')][_0xb00b('0xa9')](_0x35d7a6[_0xb00b('0x16b')]||_0x35d7a6[_0xb00b('0x36')]);};AGIVertices[_0xb00b('0xe')][_0xb00b('0x16c')]=function(_0x341ef0){logger['info'](util['format'](_0xb00b('0x16d'),_0x341ef0[_0xb00b('0x36')]));if(!this[_0xb00b('0x85')](_0x341ef0['findBy'])){return this['channel'][_0xb00b('0x2e')](_0x341ef0,_0xb00b('0x159'));}logger['info'](util[_0xb00b('0x25')](_0xb00b('0x15a'),this[_0xb00b('0x34')][_0xb00b('0x39')],_0x341ef0[_0xb00b('0x158')]));var _0x3b6211=this[_0xb00b('0x4c')][_0xb00b('0x70')](this,_0x341ef0['pause_id']);var _0x2733ec=this[_0xb00b('0x4f')][_0xb00b('0x70')](this,_0x341ef0['findBy'],_0x3b6211);if(_0x2733ec){logger['info'](util['format'](_0xb00b('0x15b'),this[_0xb00b('0x34')][_0xb00b('0x39')],_0x341ef0[_0xb00b('0x158')]));this[_0xb00b('0x34')][_0xb00b('0xa9')](util[_0xb00b('0x25')](_0xb00b('0x15b'),this[_0xb00b('0x34')][_0xb00b('0x39')],_0x341ef0[_0xb00b('0x158')]));return{'code':0xc8,'result':_0xb00b('0x15c')};}else{logger[_0xb00b('0x29')](util[_0xb00b('0x25')](_0xb00b('0x15d'),this[_0xb00b('0x34')][_0xb00b('0x39')],_0x341ef0[_0xb00b('0x158')]));this['channel'][_0xb00b('0xa9')](util[_0xb00b('0x25')](_0xb00b('0x15b'),this[_0xb00b('0x34')][_0xb00b('0x39')],_0x341ef0['findBy']));return{'code':0xc8,'result':_0xb00b('0x15e')};}};AGIVertices[_0xb00b('0xe')]['playback']=function(_0x14dc20){logger[_0xb00b('0x29')](util[_0xb00b('0x25')](_0xb00b('0x16e'),_0x14dc20[_0xb00b('0x36')]));if(!this['isConfigured'](_0x14dc20[_0xb00b('0x10b')])){return this[_0xb00b('0x34')][_0xb00b('0x2e')](_0x14dc20,_0xb00b('0x10a'));}var _0x46b6cb=this[_0xb00b('0x16a')][_0xb00b('0x70')](this,_0x14dc20[_0xb00b('0x10b')]);if(!_0x46b6cb){return this[_0xb00b('0x34')]['error'](_0x14dc20,_0xb00b('0x10c'));}var _0x1ddc91=this[_0xb00b('0x34')][_0xb00b('0x54')](_0xb00b('0x16f'),[_0x46b6cb,_0x14dc20[_0xb00b('0xe3')]]);if(_0x1ddc91[_0xb00b('0xa4')]===-0x1){return _0x1ddc91;}return this[_0xb00b('0x34')][_0xb00b('0xa9')](util[_0xb00b('0x25')](_0xb00b('0x170'),_0xb00b('0x16f'),_0x46b6cb));};AGIVertices[_0xb00b('0xe')][_0xb00b('0x171')]=function(_0x4368f4){logger['info'](util['format']('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x4368f4[_0xb00b('0x36')]));if(!this[_0xb00b('0x85')](_0x4368f4['queue_id'])){return this[_0xb00b('0x34')][_0xb00b('0x2e')](_0x4368f4,_0xb00b('0x172'));}var _0x30075e='';var _0x215d7d=parseInt(_0x4368f4[_0xb00b('0x173')],0xa);if(isNaN(_0x215d7d)){_0x30075e=_0x4368f4['queue_id'];}else{_0x30075e=this[_0xb00b('0x12')][_0xb00b('0x70')](this,_0x4368f4[_0xb00b('0x173')]);if(!_0x30075e){return this[_0xb00b('0x34')]['error'](_0x4368f4,_0xb00b('0x174'));}}var _0x248a3f='';if(this[_0xb00b('0x85')](_0x4368f4[_0xb00b('0x10b')])){var _0x3ca618=this[_0xb00b('0x16a')][_0xb00b('0x70')](this,_0x4368f4[_0xb00b('0x10b')]);if(_0x3ca618){_0x248a3f=_0x3ca618;}}this['createSquareDetailsReport']['sync'](this,_0x4368f4,_0x30075e);if(_0x4368f4[_0xb00b('0xe3')]['indexOf']('x')<0x0){_0x4368f4[_0xb00b('0xe3')]+='x';}if(_0x4368f4[_0xb00b('0xe3')][_0xb00b('0x175')]('X')<0x0){_0x4368f4['opts']+='X';}this[_0xb00b('0x34')][_0xb00b('0x9f')](_0xb00b('0x176'),_0x30075e?_0x30075e[_0xb00b('0x177')]():'');var _0x335a69=this[_0xb00b('0x34')][_0xb00b('0x54')](_0xb00b('0x178'),[_0x30075e,_0x4368f4[_0xb00b('0xe3')],_0x4368f4['url'],_0x248a3f,_0x4368f4[_0xb00b('0x64')],_0x4368f4['agi'],_0x4368f4[_0xb00b('0x179')],_0x4368f4['gosub'],'',_0x4368f4[_0xb00b('0x17a')]]);if(_0x335a69[_0xb00b('0xa4')]===-0x1){return _0x335a69;}return this[_0xb00b('0x34')][_0xb00b('0xa9')](util[_0xb00b('0x25')](_0xb00b('0x170'),'QUEUE',_0x30075e));};AGIVertices[_0xb00b('0xe')][_0xb00b('0x17b')]=function(_0x56d809){logger[_0xb00b('0x29')](util[_0xb00b('0x25')](_0xb00b('0x17c'),_0x56d809[_0xb00b('0x36')]));var _0x5d1159=_0x56d809[_0xb00b('0x17d')]||_0xb00b('0x12c');var _0x4b86f5=util[_0xb00b('0x25')](_0xb00b('0x17e'),this[_0xb00b('0x34')][_0xb00b('0x35')],rs['generate'](0x5));var _0x481fc1=util[_0xb00b('0x25')](_0xb00b('0x17f'),FILES_PATH,_0x4b86f5,_0x5d1159);var _0x389d59=util[_0xb00b('0x25')](_0xb00b('0x12d'),FILES_PATH,_0x4b86f5);this['createSquareRecording'][_0xb00b('0x70')](this,_0x56d809,_0x4b86f5,_0x481fc1);this[_0xb00b('0x34')]['setVariable'](_0xb00b('0x180'),_0x4b86f5);logger['info'](_0xb00b('0x181'),_0x389d59,_0x5d1159,_0x56d809[_0xb00b('0x182')],_0x56d809[_0xb00b('0x64')]);return this[_0xb00b('0x34')][_0xb00b('0x130')](_0x389d59,_0x5d1159,_0x56d809['escape_digits'],_0x56d809[_0xb00b('0x64')],undefined,!![]);};AGIVertices['prototype'][_0xb00b('0x183')]=function(_0x964663){logger['info'](util[_0xb00b('0x25')](_0xb00b('0x184'),_0x964663['label']));if(!this[_0xb00b('0x85')](_0x964663[_0xb00b('0x72')])){return this['channel'][_0xb00b('0xa9')](_0xb00b('0x185'));}var _0x1a86fe=this[_0xb00b('0x186')]['sync'](this,_0x964663);logger[_0xb00b('0x29')](util[_0xb00b('0x25')](_0xb00b('0x187'),util['inspect'](_0x1a86fe,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x964663[_0xb00b('0xd8')])){return this[_0xb00b('0x34')][_0xb00b('0xa9')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x2ebf10=this[_0xb00b('0xf')]['sync'](this,_0x964663['variable_id']);if(!_0x2ebf10){return this[_0xb00b('0x34')]['error'](_0x964663,_0xb00b('0xd9'));}this[_0xb00b('0x34')][_0xb00b('0x9f')](util[_0xb00b('0x25')](_0xb00b('0x188'),_0x2ebf10),_0x1a86fe[_0xb00b('0x75')]?_0x1a86fe[_0xb00b('0x75')]:_0xb00b('0x189'));this[_0xb00b('0x34')]['setVariable'](util[_0xb00b('0x25')](_0xb00b('0x18a'),_0x2ebf10),_0x1a86fe[_0xb00b('0x76')]?_0x1a86fe[_0xb00b('0x76')]:'OK');if(_0x1a86fe['body']){try{this[_0xb00b('0x9d')](_0x1a86fe['body'],_0x2ebf10);}catch(_0x3ce388){logger[_0xb00b('0x2e')](util[_0xb00b('0x25')](_0xb00b('0x18b'),_0x2ebf10));}}return this[_0xb00b('0x34')][_0xb00b('0xa9')](util[_0xb00b('0x25')](_0xb00b('0xdc'),_0x2ebf10));};AGIVertices[_0xb00b('0xe')][_0xb00b('0x18c')]=function(_0x26d162){logger[_0xb00b('0x29')](util[_0xb00b('0x25')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x26d162[_0xb00b('0x36')]));return this[_0xb00b('0x34')]['sayDigits'](_0x26d162['digits'][_0xb00b('0x56')](/\s+/g,''),_0x26d162[_0xb00b('0x182')]);};AGIVertices['prototype'][_0xb00b('0x18d')]=function(_0x475b86){logger[_0xb00b('0x29')](util[_0xb00b('0x25')](_0xb00b('0x18e'),_0x475b86[_0xb00b('0x36')]));return this[_0xb00b('0x34')][_0xb00b('0x18f')](_0x475b86[_0xb00b('0x65')][_0xb00b('0x56')](/\s+/g,''),_0x475b86['escape_digits']);};AGIVertices[_0xb00b('0xe')][_0xb00b('0x190')]=function(_0x3dd12c){logger[_0xb00b('0x29')](util[_0xb00b('0x25')](_0xb00b('0x191'),_0x3dd12c[_0xb00b('0x36')]));return this['channel']['sayPhonetic'](_0x3dd12c[_0xb00b('0x5a')],_0x3dd12c[_0xb00b('0x182')]);};AGIVertices[_0xb00b('0xe')][_0xb00b('0x192')]=function(_0x111f3b){logger['info'](util[_0xb00b('0x25')](_0xb00b('0x193'),_0x111f3b[_0xb00b('0x36')]));if(!this[_0xb00b('0x85')](_0x111f3b[_0xb00b('0x194')])){return this[_0xb00b('0x34')][_0xb00b('0xa9')]('no\x20mail\x20account\x20configured');}var _0x522552=this[_0xb00b('0x1d')][_0xb00b('0x70')](this,_0x111f3b['account_id']);if(!_0x522552||!_0x522552['Smtp']){return this[_0xb00b('0x34')][_0xb00b('0x2e')](_0x111f3b,_0xb00b('0x195'));}var _0x299ec3={'from':util['format'](_0xb00b('0x196'),_0x522552[_0xb00b('0x10')],_0x522552[_0xb00b('0x197')]||_0x522552[_0xb00b('0x198')][_0xb00b('0x199')]),'to':_0x111f3b['to']||'','cc':_0x111f3b['cc']||'','bcc':_0x111f3b[_0xb00b('0x19a')]||'','subject':_0x111f3b[_0xb00b('0x19b')],'html':_0x111f3b[_0xb00b('0x5a')],'text':_0x111f3b['text']};if(this['isConfigured'](_0x111f3b[_0xb00b('0x19c')])){}logger['debug'](_0xb00b('0x19d'),JSON[_0xb00b('0x73')](_0x299ec3));this['createSquareDetailsReport']['sync'](this,_0x111f3b,_0x111f3b[_0xb00b('0x194')]);this[_0xb00b('0x34')][_0xb00b('0xa9')](util['format'](_0xb00b('0x19e'),_0x522552[_0xb00b('0x10')]));this['sendMailMessage'][_0xb00b('0x70')](this,_0x522552[_0xb00b('0x19f')],_0x299ec3);return this[_0xb00b('0x34')]['noop'](_0xb00b('0x1a0'));};AGIVertices[_0xb00b('0xe')]['sendFax']=function(_0x14b628){logger[_0xb00b('0x29')](util[_0xb00b('0x25')](_0xb00b('0x1a1'),_0x14b628[_0xb00b('0x36')]));return this[_0xb00b('0x34')][_0xb00b('0xa9')](_0xb00b('0x1a2'));};AGIVertices[_0xb00b('0xe')][_0xb00b('0x1a3')]=function(_0x4cbb1e){logger[_0xb00b('0x29')](util[_0xb00b('0x25')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x4cbb1e[_0xb00b('0x36')]));if(!this[_0xb00b('0x85')](_0x4cbb1e[_0xb00b('0x1a4')])){return this[_0xb00b('0x34')][_0xb00b('0xa9')](_0xb00b('0x1a5'));}var _0x4a9909=this[_0xb00b('0x30')][_0xb00b('0x70')](this,_0x4cbb1e[_0xb00b('0x1a4')]);if(!_0x4a9909){return this['channel'][_0xb00b('0x2e')](_0x4cbb1e,'no\x20sms\x20account\x20found');}var _0x4c8dd0={'body':_0x4cbb1e[_0xb00b('0x1a6')],'phone':_0x4cbb1e['to']||'','SmsAccountId':_0x4a9909['id']};logger['debug']('sendSMS\x20message',JSON[_0xb00b('0x73')](_0x4c8dd0));this['createSquareDetailsReport'][_0xb00b('0x70')](this,_0x4cbb1e,_0x4cbb1e[_0xb00b('0x1a4')]);this[_0xb00b('0x34')][_0xb00b('0xa9')](util[_0xb00b('0x25')](_0xb00b('0x1a7'),_0x4a9909['name']));this[_0xb00b('0x32')]['sync'](this,_0x4c8dd0);return this['channel'][_0xb00b('0xa9')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0xb00b('0xe')][_0xb00b('0x1a8')]=function(_0x57f9c1){logger[_0xb00b('0x29')](util['format'](_0xb00b('0x1a9'),_0x57f9c1[_0xb00b('0x36')]));if(!this[_0xb00b('0x85')](_0x57f9c1['variable_id'])){return this[_0xb00b('0x34')][_0xb00b('0x2e')](_0x57f9c1,_0xb00b('0x1aa'));}var _0x55b259=this[_0xb00b('0xf')]['sync'](this,_0x57f9c1['variable_id']);if(!_0x55b259){return this['channel'][_0xb00b('0x2e')](_0x57f9c1,_0xb00b('0xd9'));}return this[_0xb00b('0x34')]['setVariable'](_0x55b259,_0x57f9c1[_0xb00b('0x1ab')]);};AGIVertices[_0xb00b('0xe')]['start']=function(_0x2869d0){logger[_0xb00b('0x29')](util[_0xb00b('0x25')](_0xb00b('0x1ac'),_0x2869d0[_0xb00b('0x36')]));this['channel']['noop']('START\x20CALLY\x20SQUARE');var _0x1155f1=this[_0xb00b('0x34')][_0xb00b('0xf')](_0xb00b('0x1ad'));if(!_['isEmpty'](_0x1155f1[_0xb00b('0xa2')])){this[_0xb00b('0x34')][_0xb00b('0x35')]=_0x1155f1['extra'];}if(_0x2869d0[_0xb00b('0xbb')]==='yes'){this[_0xb00b('0x34')]['noop'](_0xb00b('0x1ae'));return this[_0xb00b('0x34')][_0xb00b('0xbb')]();}return this['channel']['noop'](_0xb00b('0x1af'));};AGIVertices[_0xb00b('0xe')][_0xb00b('0x1b0')]=function(_0x58022f){logger[_0xb00b('0x29')](util[_0xb00b('0x25')](_0xb00b('0x1b1'),_0x58022f[_0xb00b('0x36')]));if(!this[_0xb00b('0x85')](_0x58022f[_0xb00b('0x1b2')])){return this['channel'][_0xb00b('0x2e')](_0x58022f,_0xb00b('0x1b3'));}var _0xb9ad7a=this[_0xb00b('0x1b4')][_0xb00b('0x70')](this,_0x58022f['project_id']);if(!this[_0xb00b('0x85')](_0xb9ad7a)){return this[_0xb00b('0x34')][_0xb00b('0x2e')](_0x58022f,util[_0xb00b('0x25')](_0xb00b('0x1b5'),_0x58022f[_0xb00b('0x1b2')]));}if(_0xb9ad7a===this[_0xb00b('0x34')]['arg_1']){return this['channel'][_0xb00b('0x2e')](_0x58022f,_0xb00b('0x1b6'));}this[_0xb00b('0x33')]['sync'](this,_0x58022f,_0xb9ad7a);var _0xc93adb=this[_0xb00b('0x34')]['exec'](_0xb00b('0x1b7'),util[_0xb00b('0x25')](_0xb00b('0x1b8'),config['agi'][_0xb00b('0x1b9')]||_0xb00b('0x1ba'),_0xb9ad7a,this['channel']['arg_1']));if(_0xc93adb[_0xb00b('0xa4')]===-0x1){return _0xc93adb;}return this[_0xb00b('0x34')][_0xb00b('0xa9')](util[_0xb00b('0x25')](_0xb00b('0x170'),_0xb00b('0x1b7'),_0xb9ad7a));};AGIVertices[_0xb00b('0xe')][_0xb00b('0x1bb')]=function(_0x1a2001){logger['info'](util[_0xb00b('0x25')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x1a2001[_0xb00b('0x36')]));var _0x5d4511=this[_0xb00b('0x53')][_0xb00b('0x70')](this,_0x1a2001['command']);this[_0xb00b('0x33')][_0xb00b('0x70')](this,_0x1a2001,_0x1a2001[_0xb00b('0xb6')]);if(this[_0xb00b('0x85')](_0x1a2001[_0xb00b('0xd8')])){var _0x231b97=this[_0xb00b('0xf')][_0xb00b('0x70')](this,_0x1a2001[_0xb00b('0xd8')]);if(_0x231b97){this['channel']['setVariable'](_0x231b97,_0x5d4511);return this[_0xb00b('0x34')][_0xb00b('0xa9')](util[_0xb00b('0x25')](_0xb00b('0x1bc'),_0x1a2001['command'],_0x231b97));}}return this[_0xb00b('0x34')][_0xb00b('0xa9')](util[_0xb00b('0x25')](_0xb00b('0x1bd'),_0x1a2001[_0xb00b('0xb6')]));};AGIVertices['prototype'][_0xb00b('0x1be')]=function(_0x23538a){logger['info'](util[_0xb00b('0x25')](_0xb00b('0x1bf'),_0x23538a['label']));_0x23538a[_0xb00b('0x5a')]=_0x23538a['text']['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xb00b('0x85')](_0x23538a[_0xb00b('0x58')])){return this[_0xb00b('0x34')]['noop'](_0xb00b('0x1c0'));}if(!this[_0xb00b('0x85')](_0x23538a[_0xb00b('0x5a')])){return this[_0xb00b('0x34')][_0xb00b('0xa9')]('no\x20text\x20configured');}this[_0xb00b('0x34')]['noop'](util['format'](_0xb00b('0x1c1'),_0x23538a[_0xb00b('0x5a')]));var _0x31bf70=this[_0xb00b('0x57')][_0xb00b('0x70')](this,_0x23538a);if(_0x31bf70){this[_0xb00b('0x34')][_0xb00b('0xa9')](util[_0xb00b('0x25')](_0xb00b('0x1c2'),_0x31bf70));var _0x19ac95=this[_0xb00b('0x34')][_0xb00b('0x120')](_0x31bf70);try{fs['unlink'](_0x31bf70+_0xb00b('0xfe'));}catch(_0xb6f095){logger[_0xb00b('0x2e')](_0xb6f095);}return _0x19ac95;}return this['channel']['error'](_0x23538a,_0xb00b('0x1c3'));};AGIVertices['prototype'][_0xb00b('0x1c4')]=function(_0x3e63f5){logger[_0xb00b('0x29')](util['format']('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x3e63f5[_0xb00b('0x36')]));_0x3e63f5['text']=_0x3e63f5[_0xb00b('0x5a')][_0xb00b('0x56')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xb00b('0x85')](_0x3e63f5[_0xb00b('0x5a')])){return this[_0xb00b('0x34')][_0xb00b('0xa9')](_0xb00b('0xaa'));}this[_0xb00b('0x34')]['noop'](util['format'](_0xb00b('0x1c5'),_0x3e63f5[_0xb00b('0x5a')]));var _0x120f09=this[_0xb00b('0x61')][_0xb00b('0x70')](this,_0x3e63f5);if(_0x120f09){this['channel'][_0xb00b('0xa9')](util['format'](_0xb00b('0x1c6'),_0x120f09));var _0x2aa1c7=this['channel'][_0xb00b('0x120')](_0x120f09);try{fs[_0xb00b('0xfd')](_0x120f09+_0xb00b('0xfe'));}catch(_0x17d34a){logger[_0xb00b('0x2e')](_0x17d34a);}return _0x2aa1c7;}return this[_0xb00b('0x34')][_0xb00b('0x2e')](_0x3e63f5,'Google\x20TTS\x20is\x20unreachable');};AGIVertices[_0xb00b('0xe')][_0xb00b('0x1c7')]=function(_0x34d84b){logger[_0xb00b('0x29')](util[_0xb00b('0x25')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x34d84b[_0xb00b('0x36')]));if(!this[_0xb00b('0x85')](_0x34d84b[_0xb00b('0x158')])){return this[_0xb00b('0x34')]['error'](_0x34d84b,_0xb00b('0x159'));}logger[_0xb00b('0x29')](util[_0xb00b('0x25')](_0xb00b('0x15a'),this[_0xb00b('0x34')]['callerid'],_0x34d84b[_0xb00b('0x158')]));var _0x1963cc=this[_0xb00b('0x50')][_0xb00b('0x70')](this,_0x34d84b[_0xb00b('0x158')]);if(_0x1963cc){logger[_0xb00b('0x29')](util[_0xb00b('0x25')](_0xb00b('0x15b'),this[_0xb00b('0x34')][_0xb00b('0x39')],_0x34d84b['findBy']));this[_0xb00b('0x34')][_0xb00b('0xa9')](util[_0xb00b('0x25')](_0xb00b('0x15b'),this['channel'][_0xb00b('0x39')],_0x34d84b[_0xb00b('0x158')]));return{'code':0xc8,'result':'success'};}else{logger[_0xb00b('0x29')](util[_0xb00b('0x25')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xb00b('0x34')][_0xb00b('0x39')],_0x34d84b['findBy']));this[_0xb00b('0x34')][_0xb00b('0xa9')](util['format'](_0xb00b('0x15d'),this[_0xb00b('0x34')]['callerid'],_0x34d84b['findBy']));return{'code':0xc8,'result':_0xb00b('0x15e')};}};AGIVertices[_0xb00b('0xe')][_0xb00b('0x1c8')]=function(_0x5e9a2e){logger[_0xb00b('0x29')](util[_0xb00b('0x25')](_0xb00b('0x1c9'),_0x5e9a2e[_0xb00b('0x36')]));var _0x3f914e=this[_0xb00b('0x34')]['exec']('VOICEMAIL',[_0x5e9a2e[_0xb00b('0x1ca')],_0x5e9a2e[_0xb00b('0x79')]]);if(_0x3f914e['result']===-0x1){return _0x3f914e;}return this[_0xb00b('0x34')][_0xb00b('0xa9')](util['format'](_0xb00b('0x170'),'VOICEMAIL',_0x5e9a2e['mailbox']));};AGIVertices['prototype']['vswitch']=function(_0x3379b3){logger[_0xb00b('0x29')](util[_0xb00b('0x25')](_0xb00b('0x1cb'),_0x3379b3['label']));if(!this[_0xb00b('0x85')](_0x3379b3[_0xb00b('0xd8')])){return this[_0xb00b('0x34')][_0xb00b('0x2e')](_0x3379b3,_0xb00b('0x1aa'));}var _0x2f8132=this['getVariable'][_0xb00b('0x70')](this,_0x3379b3[_0xb00b('0xd8')]);if(!_0x2f8132){return this[_0xb00b('0x34')][_0xb00b('0x2e')](_0x3379b3,_0xb00b('0xd9'));}var _0x5608c9=this['channel']['getVariable'](_0x2f8132);return{'code':0xc8,'result':_0x5608c9['extra']?_0x5608c9[_0xb00b('0xa2')]:'-'};};String['prototype'][_0xb00b('0xa1')]=function(_0x205caa,_0x27ac28){return this[_0xb00b('0xa0')](_0x205caa)[_0xb00b('0x1cc')](_0x27ac28);};module[_0xb00b('0x1cd')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 95fb56a..610356b 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 _0xdf55=['[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','startAcw','interface','queue','name','mandatoryDispositionPause','resolve','getAgent','then','voicePause','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','info','attended','destlinkedid','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','format','YYYY-MM-DD\x20HH:mm:ss','[ACW][START]\x20%s','uniqueid','[%s][TIMER][STOP][AGENT:%s]','stringify','[ACW][STOP]\x20%s','message','[ACW][syncAgentConnect]\x20%s','mandatoryDisposition','[%s][HANGUP:UNIQUEID]','linkedid','isUndefined','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','syncHangup','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','lodash','moment','../../../config/logger','acw','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','syncHangupRequest','hangup','agentringnoanswer','attendedtransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','prototype','updateAcw','lastPauseAt','timer','update'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0xdf55,0x83));var _0x5df5=function(_0x3c86b4,_0x431782){_0x3c86b4=_0x3c86b4-0x0;var _0x268334=_0xdf55[_0x3c86b4];return _0x268334;};'use strict';var _=require(_0x5df5('0x0'));var moment=require(_0x5df5('0x1'));var ami=require('../ami');var logger=require(_0x5df5('0x2'))(_0x5df5('0x3'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0x5df5('0x4'));function Acw(_0x773e15){this[_0x5df5('0x5')]=_0x773e15['voiceQueues'];this[_0x5df5('0x6')]=_0x773e15[_0x5df5('0x6')];this[_0x5df5('0x7')]=_0x773e15[_0x5df5('0x7')];this[_0x5df5('0x8')]={};ami['on'](_0x5df5('0x9'),this[_0x5df5('0xa')][_0x5df5('0xb')](this));ami['on']('hanguprequest',this[_0x5df5('0xc')][_0x5df5('0xb')](this));ami['on'](_0x5df5('0xd'),this['syncHangup']['bind'](this));ami['on'](_0x5df5('0xe'),this['syncAgentRingNoAnswer'][_0x5df5('0xb')](this));ami['on'](_0x5df5('0xf'),this['syncAttendedTransfer']['bind'](this));ami['on'](_0x5df5('0x10'),this[_0x5df5('0x11')][_0x5df5('0xb')](this));ami['on'](_0x5df5('0x12'),this[_0x5df5('0x13')][_0x5df5('0xb')](this));}function getDiff(_0x37a747){var _0x463990=moment()[_0x5df5('0x14')](0x0);var _0x956317=moment(_0x37a747)['milliseconds'](0x0);return _0x463990[_0x5df5('0x15')](_0x956317,'seconds');}Acw[_0x5df5('0x16')][_0x5df5('0x17')]=function(_0x5b0ad9,_0x3657c8){var _0x282d53=this;var _0x4e74c4=getDiff(_0x282d53[_0x5df5('0x7')][_0x5b0ad9][_0x5df5('0x18')]);clearTimeout(_0x282d53['timers'][_0x5b0ad9][_0x5df5('0x19')]);_0x282d53[_0x5df5('0x7')][_0x5b0ad9][_0x5df5('0x19')]=![];return RpcVoiceAgentReport[_0x5df5('0x1a')]({'acwtime':_0x4e74c4},_0x282d53[_0x5df5('0x7')][_0x5b0ad9]['uniqueid'],_0x5b0ad9)['then'](function(_0x48c824){logger['info'](_0x5df5('0x1b'),_0x3657c8,_0x4e74c4,_0x48c824);})[_0x5df5('0x1c')](function(_0xa939e4){logger[_0x5df5('0x1d')](_0x5df5('0x1e'),_0x3657c8,_0xa939e4);})['finally'](function(){delete _0x282d53[_0x5df5('0x7')][_0x5b0ad9];});};Acw[_0x5df5('0x16')][_0x5df5('0x1f')]=function(_0x34af1d){try{var _0x28efc8=this;var _0x382999=this['channels'][_0x34af1d][_0x5df5('0x20')];var _0x2e862d=this[_0x5df5('0x8')][_0x34af1d][_0x5df5('0x21')];var _0x5ca542=this[_0x5df5('0x5')][_0x2e862d];var _0x13369c=![];var _0x395f3e='ACW';if(_0x5ca542['mandatoryDisposition']&&_0x5ca542['mandatoryDispositionPause'][_0x5df5('0x22')]){_0x13369c=!![];_0x395f3e=_0x5ca542[_0x5df5('0x23')][_0x5df5('0x22')];}if(!_0x28efc8[_0x5df5('0x6')][_0x382999]){return Promise[_0x5df5('0x24')]();}return RpcUser[_0x5df5('0x25')](_0x28efc8[_0x5df5('0x6')][_0x382999]['id'])[_0x5df5('0x26')](function(_0x52fbe3){if(!_0x52fbe3||_0x52fbe3[_0x5df5('0x27')]){logger['info'](_0x5df5('0x28'),_0x34af1d,_0x382999,_0x2e862d);return;}logger[_0x5df5('0x29')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x34af1d,_0x382999,_0x2e862d);var _0x3854d0=_0x28efc8['channels'][_0x34af1d][_0x5df5('0x2a')]&&_0x28efc8['channels'][_0x34af1d][_0x5df5('0x2b')]?_0x28efc8['channels'][_0x34af1d][_0x5df5('0x2b')]:_0x34af1d;return RpcUser['savePause'](_0x28efc8[_0x5df5('0x6')][_0x382999],_0x395f3e,_0x3854d0);})[_0x5df5('0x26')](function(_0x4784ca){if(_0x13369c||!_0x4784ca){return;}_0x28efc8['timers'][_0x382999]={};logger[_0x5df5('0x29')](_0x5df5('0x2c'),_0x34af1d,_0x28efc8[_0x5df5('0x5')][_0x2e862d][_0x5df5('0x2d')],_0x382999,_0x2e862d);_0x28efc8[_0x5df5('0x7')][_0x382999][_0x5df5('0x19')]=setTimeout(_0x28efc8[_0x5df5('0x2e')]['bind'](_0x28efc8,_0x382999),_0x28efc8['voiceQueues'][_0x2e862d][_0x5df5('0x2d')]*0x3e8);_0x28efc8[_0x5df5('0x7')][_0x382999][_0x5df5('0x18')]=moment()[_0x5df5('0x2f')](_0x5df5('0x30'));_0x28efc8[_0x5df5('0x7')][_0x382999]['uniqueid']=_0x34af1d;_0x28efc8[_0x5df5('0x7')][_0x382999][_0x5df5('0x21')]=_0x2e862d;_0x28efc8[_0x5df5('0x7')][_0x382999][_0x5df5('0x17')]=_0x28efc8['updateAcw'][_0x5df5('0xb')](_0x28efc8,_0x382999,_0x34af1d);})['catch'](function(){logger[_0x5df5('0x1d')](_0x5df5('0x2c'),_0x34af1d,_0x28efc8['voiceQueues'][_0x2e862d][_0x5df5('0x2d')],_0x382999,_0x2e862d);})['finally'](function(){delete _0x28efc8[_0x5df5('0x8')][_0x34af1d];});}catch(_0x44a6d9){logger[_0x5df5('0x1d')](_0x5df5('0x31'),_0x44a6d9['message']);}};Acw[_0x5df5('0x16')][_0x5df5('0x2e')]=function(_0x28459a){try{var _0x25b6ad=this;if(_0x25b6ad['timers'][_0x28459a]){_0x25b6ad[_0x5df5('0x7')][_0x28459a][_0x5df5('0x19')]=![];var _0x4323f8=_0x25b6ad[_0x5df5('0x7')][_0x28459a][_0x5df5('0x32')];var _0x47f34f=_0x25b6ad[_0x5df5('0x7')][_0x28459a]['queue'];var _0x33da21=_0x25b6ad[_0x5df5('0x5')][_0x47f34f]['acwTimeout'];logger[_0x5df5('0x29')](_0x5df5('0x33'),_0x4323f8,_0x28459a);RpcUser['saveUnpause'](this[_0x5df5('0x6')][_0x28459a]);RpcVoiceAgentReport[_0x5df5('0x1a')]({'acwtime':_0x33da21,'agentacw':!![]},_0x4323f8,_0x28459a)[_0x5df5('0x26')](function(_0x3a7f40){logger[_0x5df5('0x29')](_0x5df5('0x1b'),_0x4323f8,_0x33da21,_0x3a7f40);})[_0x5df5('0x1c')](function(_0x306218){logger['error']('[%s][UPDATE][ERRORS:%s]',_0x4323f8,_0x306218);});}else{logger[_0x5df5('0x1d')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x28459a);if(_0x25b6ad[_0x5df5('0x7')]){logger[_0x5df5('0x29')]('[ACW][TIMERS]',JSON[_0x5df5('0x34')](_0x25b6ad[_0x5df5('0x7')]));}}}catch(_0x23e592){logger[_0x5df5('0x1d')](_0x5df5('0x35'),_0x23e592[_0x5df5('0x36')]);}};Acw[_0x5df5('0x16')][_0x5df5('0xa')]=function(_0x5824c3){try{if(this[_0x5df5('0x5')][_0x5824c3['queue']]&&(this[_0x5df5('0x5')][_0x5824c3[_0x5df5('0x21')]][_0x5df5('0x3')]||this[_0x5df5('0x5')][_0x5824c3[_0x5df5('0x21')]]['mandatoryDisposition'])){if(this[_0x5df5('0x6')][_0x5824c3[_0x5df5('0x20')]]){this[_0x5df5('0x8')][_0x5824c3['uniqueid']]={'queue':_0x5824c3[_0x5df5('0x21')],'interface':_0x5824c3[_0x5df5('0x20')],'destlinkedid':_0x5824c3['destlinkedid']};}}}catch(_0xe4deee){logger[_0x5df5('0x1d')](_0x5df5('0x37'),_0xe4deee[_0x5df5('0x36')]);}};Acw['prototype'][_0x5df5('0x13')]=function(_0x337e20){try{if(this['voiceQueues'][_0x337e20[_0x5df5('0x21')]]&&(this[_0x5df5('0x5')][_0x337e20[_0x5df5('0x21')]]['acw']||this[_0x5df5('0x5')][_0x337e20[_0x5df5('0x21')]][_0x5df5('0x38')])){if(this[_0x5df5('0x6')][_0x337e20['interface']]){this[_0x5df5('0x8')][_0x337e20[_0x5df5('0x32')]]={'queue':_0x337e20[_0x5df5('0x21')],'interface':_0x337e20[_0x5df5('0x20')]};}}}catch(_0x14f9ca){logger['error']('[ACW][syncAgentConnectPreview]\x20%s',_0x14f9ca[_0x5df5('0x36')]);}};Acw['prototype'][_0x5df5('0xc')]=function(_0x207498){try{if(this[_0x5df5('0x8')][_0x207498[_0x5df5('0x32')]]&&_['isUndefined'](this[_0x5df5('0x8')][_0x207498[_0x5df5('0x32')]][_0x5df5('0x2a')])){logger[_0x5df5('0x29')](_0x5df5('0x39'),_0x207498[_0x5df5('0x32')]);this['startAcw'](_0x207498[_0x5df5('0x32')]);}else if(this['channels'][_0x207498[_0x5df5('0x3a')]]&&_[_0x5df5('0x3b')](this[_0x5df5('0x8')][_0x207498['linkedid']][_0x5df5('0x2a')])){logger['info'](_0x5df5('0x3c'),_0x207498['linkedid']);this[_0x5df5('0x1f')](_0x207498[_0x5df5('0x3a')]);}}catch(_0x34e4cc){logger['error'](_0x5df5('0x3d'),_0x34e4cc[_0x5df5('0x36')]);}};Acw['prototype'][_0x5df5('0x3e')]=function(_0x257834){try{if(this[_0x5df5('0x8')][_0x257834[_0x5df5('0x32')]]&&this[_0x5df5('0x8')][_0x257834[_0x5df5('0x32')]][_0x5df5('0x2a')]){logger['info'](_0x5df5('0x3f'),_0x257834['uniqueid']);this[_0x5df5('0x1f')](_0x257834[_0x5df5('0x32')]);}else if(this[_0x5df5('0x8')][_0x257834[_0x5df5('0x3a')]]&&this[_0x5df5('0x8')][_0x257834[_0x5df5('0x3a')]][_0x5df5('0x2a')]){logger[_0x5df5('0x29')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x257834[_0x5df5('0x3a')]);this[_0x5df5('0x1f')](_0x257834[_0x5df5('0x3a')]);}}catch(_0x134a28){logger[_0x5df5('0x1d')]('[ACW][syncHangup]\x20%s',_0x134a28[_0x5df5('0x36')]);}};Acw['prototype']['syncAttendedTransfer']=function(_0x3c05b2){try{if(!_[_0x5df5('0x40')](this[_0x5df5('0x8')][_0x3c05b2[_0x5df5('0x41')]])){this[_0x5df5('0x1f')](_0x3c05b2[_0x5df5('0x41')]);if(this['channels'][_0x3c05b2[_0x5df5('0x42')]]){this[_0x5df5('0x8')][_0x3c05b2['secondtransfereruniqueid']]['attended']=!![];this[_0x5df5('0x8')][_0x3c05b2[_0x5df5('0x43')]]=this[_0x5df5('0x8')][_0x3c05b2[_0x5df5('0x42')]];delete this[_0x5df5('0x8')][_0x3c05b2[_0x5df5('0x42')]];}}else if(!_['isNil'](this['channels'][_0x3c05b2['transfertargetuniqueid']])){this[_0x5df5('0x1f')](_0x3c05b2[_0x5df5('0x43')]);if(this['channels'][_0x3c05b2[_0x5df5('0x44')]]){this[_0x5df5('0x8')][_0x3c05b2[_0x5df5('0x44')]][_0x5df5('0x2a')]=!![];this[_0x5df5('0x8')][_0x3c05b2[_0x5df5('0x41')]]=this[_0x5df5('0x8')][_0x3c05b2[_0x5df5('0x44')]];delete this[_0x5df5('0x8')][_0x3c05b2['origtransfereruniqueid']];}}}catch(_0x302792){logger[_0x5df5('0x1d')](_0x5df5('0x45'),_0x302792[_0x5df5('0x36')]);}};Acw[_0x5df5('0x16')][_0x5df5('0x11')]=function(_0xc93fa3){try{if(this[_0x5df5('0x8')][_0xc93fa3[_0x5df5('0x46')]]){logger[_0x5df5('0x29')](_0x5df5('0x47'),JSON[_0x5df5('0x34')](_0xc93fa3['transfereruniqueid']));this[_0x5df5('0x1f')](_0xc93fa3[_0x5df5('0x46')]);}else if(this['channels'][_0xc93fa3[_0x5df5('0x48')]]){logger[_0x5df5('0x29')](_0x5df5('0x49'),JSON[_0x5df5('0x34')](_0xc93fa3['transfererlinkedid']));this[_0x5df5('0x1f')](_0xc93fa3[_0x5df5('0x48')]);}}catch(_0x5e73ee){logger['error'](_0x5df5('0x4a'),_0x5e73ee[_0x5df5('0x36')]);}};Acw[_0x5df5('0x16')]['syncAgentRingNoAnswer']=function(_0x4edb86){try{if(this[_0x5df5('0x5')][_0x4edb86[_0x5df5('0x21')]]&&this['voiceQueues'][_0x4edb86[_0x5df5('0x21')]][_0x5df5('0x4b')]===_0x5df5('0x4c')){if(this[_0x5df5('0x6')][_0x4edb86[_0x5df5('0x20')]]){logger['info'](_0x5df5('0x4d'),_0x4edb86[_0x5df5('0x32')],_0x4edb86[_0x5df5('0x20')],_0x4edb86[_0x5df5('0x21')]);return RpcUser['savePause'](this[_0x5df5('0x6')][_0x4edb86['interface']],_0x5df5('0x4e'),_0x4edb86[_0x5df5('0x32')]);}}}catch(_0x50a296){logger[_0x5df5('0x1d')]('[ACW][syncAgentRingNoAnswer]\x20%s',_0x50a296[_0x5df5('0x36')]);}};module['exports']=Acw; \ No newline at end of file +var _0xeda8=['moment','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','syncAgentConnect','bind','hanguprequest','syncHangupRequest','agentringnoanswer','syncAgentRingNoAnswer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','prototype','updateAcw','timer','uniqueid','then','info','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','finally','startAcw','interface','ACW','mandatoryDispositionPause','name','getAgent','voicePause','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','queue','acwTimeout','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','update','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','[ACW][STOP]\x20%s','mandatoryDisposition','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','stringify','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','autopause','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','lodash'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0xeda8,0x104));var _0x8eda=function(_0x365110,_0x918c39){_0x365110=_0x365110-0x0;var _0x20d16e=_0xeda8[_0x365110];return _0x20d16e;};'use strict';var _=require(_0x8eda('0x0'));var moment=require(_0x8eda('0x1'));var ami=require('../ami');var logger=require(_0x8eda('0x2'))(_0x8eda('0x3'));var RpcUser=require(_0x8eda('0x4'));var RpcVoiceAgentReport=require(_0x8eda('0x5'));function Acw(_0x37ab2c){this[_0x8eda('0x6')]=_0x37ab2c[_0x8eda('0x6')];this[_0x8eda('0x7')]=_0x37ab2c[_0x8eda('0x7')];this[_0x8eda('0x8')]=_0x37ab2c[_0x8eda('0x8')];this[_0x8eda('0x9')]={};ami['on']('agentconnect',this[_0x8eda('0xa')][_0x8eda('0xb')](this));ami['on'](_0x8eda('0xc'),this[_0x8eda('0xd')]['bind'](this));ami['on']('hangup',this['syncHangup']['bind'](this));ami['on'](_0x8eda('0xe'),this[_0x8eda('0xf')][_0x8eda('0xb')](this));ami['on']('attendedtransfer',this[_0x8eda('0x10')]['bind'](this));ami['on'](_0x8eda('0x11'),this[_0x8eda('0x12')][_0x8eda('0xb')](this));ami['on'](_0x8eda('0x13'),this[_0x8eda('0x14')][_0x8eda('0xb')](this));}function getDiff(_0x2baf06){var _0x24ea76=moment()['milliseconds'](0x0);var _0x500bd4=moment(_0x2baf06)[_0x8eda('0x15')](0x0);return _0x24ea76[_0x8eda('0x16')](_0x500bd4,'seconds');}Acw[_0x8eda('0x17')][_0x8eda('0x18')]=function(_0x123905,_0x56ff8a){var _0x3f2925=this;var _0x5594ad=getDiff(_0x3f2925[_0x8eda('0x8')][_0x123905]['lastPauseAt']);clearTimeout(_0x3f2925[_0x8eda('0x8')][_0x123905]['timer']);_0x3f2925[_0x8eda('0x8')][_0x123905][_0x8eda('0x19')]=![];return RpcVoiceAgentReport['update']({'acwtime':_0x5594ad},_0x3f2925['timers'][_0x123905][_0x8eda('0x1a')],_0x123905)[_0x8eda('0x1b')](function(_0x1b089d){logger[_0x8eda('0x1c')](_0x8eda('0x1d'),_0x56ff8a,_0x5594ad,_0x1b089d);})[_0x8eda('0x1e')](function(_0x4fb4ee){logger[_0x8eda('0x1f')](_0x8eda('0x20'),_0x56ff8a,_0x4fb4ee);})[_0x8eda('0x21')](function(){delete _0x3f2925[_0x8eda('0x8')][_0x123905];});};Acw['prototype'][_0x8eda('0x22')]=function(_0x4f8483){try{var _0x45517e=this;var _0x5183bc=this[_0x8eda('0x9')][_0x4f8483][_0x8eda('0x23')];var _0x4f3e0a=this['channels'][_0x4f8483]['queue'];var _0x2a4c99=this[_0x8eda('0x6')][_0x4f3e0a];var _0x5be84f=![];var _0x978502=_0x8eda('0x24');if(_0x2a4c99['mandatoryDisposition']&&_0x2a4c99[_0x8eda('0x25')][_0x8eda('0x26')]){_0x5be84f=!![];_0x978502=_0x2a4c99[_0x8eda('0x25')][_0x8eda('0x26')];}if(!_0x45517e[_0x8eda('0x7')][_0x5183bc]){return Promise['resolve']();}return RpcUser[_0x8eda('0x27')](_0x45517e['agents'][_0x5183bc]['id'])[_0x8eda('0x1b')](function(_0x2e8b2b){if(!_0x2e8b2b||_0x2e8b2b[_0x8eda('0x28')]){logger['info'](_0x8eda('0x29'),_0x4f8483,_0x5183bc,_0x4f3e0a);return;}logger[_0x8eda('0x1c')](_0x8eda('0x2a'),_0x4f8483,_0x5183bc,_0x4f3e0a);var _0x4cdd2e=_0x45517e[_0x8eda('0x9')][_0x4f8483][_0x8eda('0x2b')]&&_0x45517e['channels'][_0x4f8483][_0x8eda('0x2c')]?_0x45517e[_0x8eda('0x9')][_0x4f8483][_0x8eda('0x2c')]:_0x4f8483;return RpcUser[_0x8eda('0x2d')](_0x45517e['agents'][_0x5183bc],_0x978502,_0x4cdd2e);})['then'](function(_0x54513c){if(_0x5be84f||!_0x54513c){return;}_0x45517e[_0x8eda('0x8')][_0x5183bc]={};logger[_0x8eda('0x1c')](_0x8eda('0x2e'),_0x4f8483,_0x45517e['voiceQueues'][_0x4f3e0a]['acwTimeout'],_0x5183bc,_0x4f3e0a);_0x45517e['timers'][_0x5183bc][_0x8eda('0x19')]=setTimeout(_0x45517e[_0x8eda('0x2f')][_0x8eda('0xb')](_0x45517e,_0x5183bc),_0x45517e['voiceQueues'][_0x4f3e0a]['acwTimeout']*0x3e8);_0x45517e['timers'][_0x5183bc][_0x8eda('0x30')]=moment()[_0x8eda('0x31')](_0x8eda('0x32'));_0x45517e[_0x8eda('0x8')][_0x5183bc][_0x8eda('0x1a')]=_0x4f8483;_0x45517e[_0x8eda('0x8')][_0x5183bc][_0x8eda('0x33')]=_0x4f3e0a;_0x45517e[_0x8eda('0x8')][_0x5183bc][_0x8eda('0x18')]=_0x45517e[_0x8eda('0x18')][_0x8eda('0xb')](_0x45517e,_0x5183bc,_0x4f8483);})[_0x8eda('0x1e')](function(){logger[_0x8eda('0x1f')](_0x8eda('0x2e'),_0x4f8483,_0x45517e['voiceQueues'][_0x4f3e0a][_0x8eda('0x34')],_0x5183bc,_0x4f3e0a);})[_0x8eda('0x21')](function(){delete _0x45517e[_0x8eda('0x9')][_0x4f8483];});}catch(_0x4e3b81){logger['error'](_0x8eda('0x35'),_0x4e3b81[_0x8eda('0x36')]);}};Acw[_0x8eda('0x17')][_0x8eda('0x2f')]=function(_0x5709a2){try{var _0x443058=this;if(_0x443058[_0x8eda('0x8')][_0x5709a2]){_0x443058[_0x8eda('0x8')][_0x5709a2][_0x8eda('0x19')]=![];var _0x567aa6=_0x443058[_0x8eda('0x8')][_0x5709a2]['uniqueid'];var _0x331d95=_0x443058[_0x8eda('0x8')][_0x5709a2][_0x8eda('0x33')];var _0x3b6585=_0x443058[_0x8eda('0x6')][_0x331d95][_0x8eda('0x34')];logger['info'](_0x8eda('0x37'),_0x567aa6,_0x5709a2);RpcUser[_0x8eda('0x38')](this[_0x8eda('0x7')][_0x5709a2]);RpcVoiceAgentReport[_0x8eda('0x39')]({'acwtime':_0x3b6585,'agentacw':!![]},_0x567aa6,_0x5709a2)[_0x8eda('0x1b')](function(_0x5cf565){logger[_0x8eda('0x1c')](_0x8eda('0x1d'),_0x567aa6,_0x3b6585,_0x5cf565);})[_0x8eda('0x1e')](function(_0x48f636){logger[_0x8eda('0x1f')]('[%s][UPDATE][ERRORS:%s]',_0x567aa6,_0x48f636);});}else{logger[_0x8eda('0x1f')](_0x8eda('0x3a'),_0x5709a2);if(_0x443058[_0x8eda('0x8')]){logger[_0x8eda('0x1c')](_0x8eda('0x3b'),JSON['stringify'](_0x443058['timers']));}}}catch(_0xbf14a1){logger[_0x8eda('0x1f')](_0x8eda('0x3c'),_0xbf14a1[_0x8eda('0x36')]);}};Acw[_0x8eda('0x17')][_0x8eda('0xa')]=function(_0x18b043){try{if(this[_0x8eda('0x6')][_0x18b043[_0x8eda('0x33')]]&&(this[_0x8eda('0x6')][_0x18b043[_0x8eda('0x33')]][_0x8eda('0x3')]||this[_0x8eda('0x6')][_0x18b043[_0x8eda('0x33')]][_0x8eda('0x3d')])){if(this[_0x8eda('0x7')][_0x18b043[_0x8eda('0x23')]]){this[_0x8eda('0x9')][_0x18b043[_0x8eda('0x1a')]]={'queue':_0x18b043['queue'],'interface':_0x18b043[_0x8eda('0x23')],'destlinkedid':_0x18b043[_0x8eda('0x2c')]};}}}catch(_0x5504ac){logger[_0x8eda('0x1f')](_0x8eda('0x3e'),_0x5504ac['message']);}};Acw[_0x8eda('0x17')][_0x8eda('0x14')]=function(_0x51f2a3){try{if(this[_0x8eda('0x6')][_0x51f2a3[_0x8eda('0x33')]]&&(this[_0x8eda('0x6')][_0x51f2a3['queue']][_0x8eda('0x3')]||this[_0x8eda('0x6')][_0x51f2a3[_0x8eda('0x33')]][_0x8eda('0x3d')])){if(this[_0x8eda('0x7')][_0x51f2a3[_0x8eda('0x23')]]){this[_0x8eda('0x9')][_0x51f2a3['uniqueid']]={'queue':_0x51f2a3[_0x8eda('0x33')],'interface':_0x51f2a3['interface']};}}}catch(_0xcde3e){logger['error'](_0x8eda('0x3f'),_0xcde3e['message']);}};Acw[_0x8eda('0x17')]['syncHangupRequest']=function(_0x32461a){try{if(this[_0x8eda('0x9')][_0x32461a[_0x8eda('0x1a')]]&&_[_0x8eda('0x40')](this[_0x8eda('0x9')][_0x32461a[_0x8eda('0x1a')]][_0x8eda('0x2b')])){logger[_0x8eda('0x1c')](_0x8eda('0x41'),_0x32461a[_0x8eda('0x1a')]);this[_0x8eda('0x22')](_0x32461a[_0x8eda('0x1a')]);}else if(this['channels'][_0x32461a[_0x8eda('0x42')]]&&_[_0x8eda('0x40')](this[_0x8eda('0x9')][_0x32461a[_0x8eda('0x42')]][_0x8eda('0x2b')])){logger[_0x8eda('0x1c')](_0x8eda('0x43'),_0x32461a[_0x8eda('0x42')]);this[_0x8eda('0x22')](_0x32461a[_0x8eda('0x42')]);}}catch(_0x3e4242){logger[_0x8eda('0x1f')](_0x8eda('0x44'),_0x3e4242[_0x8eda('0x36')]);}};Acw[_0x8eda('0x17')]['syncHangup']=function(_0x1b69ae){try{if(this[_0x8eda('0x9')][_0x1b69ae[_0x8eda('0x1a')]]&&this[_0x8eda('0x9')][_0x1b69ae[_0x8eda('0x1a')]][_0x8eda('0x2b')]){logger['info'](_0x8eda('0x45'),_0x1b69ae[_0x8eda('0x1a')]);this[_0x8eda('0x22')](_0x1b69ae['uniqueid']);}else if(this[_0x8eda('0x9')][_0x1b69ae['linkedid']]&&this[_0x8eda('0x9')][_0x1b69ae[_0x8eda('0x42')]][_0x8eda('0x2b')]){logger['info'](_0x8eda('0x46'),_0x1b69ae[_0x8eda('0x42')]);this[_0x8eda('0x22')](_0x1b69ae['linkedid']);}}catch(_0x3d6378){logger[_0x8eda('0x1f')](_0x8eda('0x47'),_0x3d6378[_0x8eda('0x36')]);}};Acw[_0x8eda('0x17')][_0x8eda('0x10')]=function(_0x3e89ea){try{if(!_[_0x8eda('0x48')](this[_0x8eda('0x9')][_0x3e89ea[_0x8eda('0x49')]])){this['startAcw'](_0x3e89ea[_0x8eda('0x49')]);if(this[_0x8eda('0x9')][_0x3e89ea['secondtransfereruniqueid']]){this[_0x8eda('0x9')][_0x3e89ea['secondtransfereruniqueid']]['attended']=!![];this['channels'][_0x3e89ea['transfertargetuniqueid']]=this['channels'][_0x3e89ea[_0x8eda('0x4a')]];delete this['channels'][_0x3e89ea[_0x8eda('0x4a')]];}}else if(!_[_0x8eda('0x48')](this[_0x8eda('0x9')][_0x3e89ea[_0x8eda('0x4b')]])){this[_0x8eda('0x22')](_0x3e89ea[_0x8eda('0x4b')]);if(this[_0x8eda('0x9')][_0x3e89ea['origtransfereruniqueid']]){this[_0x8eda('0x9')][_0x3e89ea['origtransfereruniqueid']][_0x8eda('0x2b')]=!![];this['channels'][_0x3e89ea[_0x8eda('0x49')]]=this['channels'][_0x3e89ea[_0x8eda('0x4c')]];delete this[_0x8eda('0x9')][_0x3e89ea[_0x8eda('0x4c')]];}}}catch(_0x48a66d){logger['error']('[ACW][syncAttendedTransfer]\x20%s',_0x48a66d[_0x8eda('0x36')]);}};Acw[_0x8eda('0x17')]['syncBlindTransfer']=function(_0x111855){try{if(this['channels'][_0x111855['transfereruniqueid']]){logger[_0x8eda('0x1c')](_0x8eda('0x4d'),JSON[_0x8eda('0x4e')](_0x111855[_0x8eda('0x4f')]));this['startAcw'](_0x111855['transfereruniqueid']);}else if(this[_0x8eda('0x9')][_0x111855[_0x8eda('0x50')]]){logger[_0x8eda('0x1c')](_0x8eda('0x51'),JSON['stringify'](_0x111855[_0x8eda('0x50')]));this['startAcw'](_0x111855[_0x8eda('0x50')]);}}catch(_0x5d198f){logger[_0x8eda('0x1f')]('[ACW][syncBlindTransfer]\x20%s',_0x5d198f[_0x8eda('0x36')]);}};Acw[_0x8eda('0x17')][_0x8eda('0xf')]=function(_0x3e46d1){try{if(this[_0x8eda('0x6')][_0x3e46d1[_0x8eda('0x33')]]&&this[_0x8eda('0x6')][_0x3e46d1[_0x8eda('0x33')]][_0x8eda('0x52')]==='all'){if(this['agents'][_0x3e46d1[_0x8eda('0x23')]]){logger['info'](_0x8eda('0x53'),_0x3e46d1[_0x8eda('0x1a')],_0x3e46d1[_0x8eda('0x23')],_0x3e46d1[_0x8eda('0x33')]);return RpcUser[_0x8eda('0x2d')](this['agents'][_0x3e46d1['interface']],_0x8eda('0x54'),_0x3e46d1[_0x8eda('0x1a')]);}}}catch(_0x423df5){logger[_0x8eda('0x1f')](_0x8eda('0x55'),_0x423df5[_0x8eda('0x36')]);}};module[_0x8eda('0x56')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index a2e8bfa..e272b2a 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 _0x47ab=['close','connect','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionQueueSummary','catch','[ami.js][fullybooted]','asterisk-manager','bluebird','util','../../config/logger','ami','../../config/environment','asterisk','port','password','keepConnected','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','username','inspect','actionSipShowRegistry','Action','sipshowregistry','actionDeviceStateList','actionSipPeerStatus','sippeerstatus','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once'];(function(_0x587ba2,_0x42eb40){var _0x50ec73=function(_0x2f32e3){while(--_0x2f32e3){_0x587ba2['push'](_0x587ba2['shift']());}};_0x50ec73(++_0x42eb40);}(_0x47ab,0x7c));var _0xb47a=function(_0x19f5b1,_0x5bf23f){_0x19f5b1=_0x19f5b1-0x0;var _0x47f988=_0x47ab[_0x19f5b1];return _0x47f988;};'use strict';var Manager=require(_0xb47a('0x0'));var BPromise=require(_0xb47a('0x1'));var util=require(_0xb47a('0x2'));var logger=require(_0xb47a('0x3'))(_0xb47a('0x4'));var config=require(_0xb47a('0x5'));var ami=new Manager(config[_0xb47a('0x6')][_0xb47a('0x7')],config[_0xb47a('0x6')]['ip'],config[_0xb47a('0x6')]['username'],config[_0xb47a('0x6')][_0xb47a('0x8')],!![]);ami[_0xb47a('0x9')]();ami['Action']=BPromise['promisify'](ami[_0xb47a('0xa')]);function error(_0x2666af){logger[_0xb47a('0xb')](util[_0xb47a('0xc')](_0xb47a('0xd'),config[_0xb47a('0x6')][_0xb47a('0xe')],config[_0xb47a('0x6')]['ip'],config[_0xb47a('0x6')][_0xb47a('0x7')],util[_0xb47a('0xf')](_0x2666af,![],null)));}function close(){logger[_0xb47a('0xb')](util[_0xb47a('0xc')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0xb47a('0x6')]['username'],config[_0xb47a('0x6')]['ip'],config['asterisk'][_0xb47a('0x7')]));}ami[_0xb47a('0x10')]=function(){return function(){return ami[_0xb47a('0x11')]({'action':_0xb47a('0x12')});};};ami[_0xb47a('0x13')]=function(){return function(){return ami['Action']({'action':'devicestatelist'});};};ami[_0xb47a('0x14')]=function(){return function(){return ami[_0xb47a('0x11')]({'action':_0xb47a('0x15')});};};ami['actionQueueSummary']=function(){return function(){return ami[_0xb47a('0x11')]({'action':_0xb47a('0x16')});};};ami[_0xb47a('0x17')]=function(){return function(){return ami['Action']({'action':_0xb47a('0x18')});};};function connect(){logger[_0xb47a('0x19')](util['format'](_0xb47a('0x1a'),config[_0xb47a('0x6')]['username'],config['asterisk']['ip'],config['asterisk'][_0xb47a('0x7')]));ami[_0xb47a('0x1b')](_0xb47a('0xb'),error);ami[_0xb47a('0x1b')](_0xb47a('0x1c'),close);}ami['on'](_0xb47a('0x1d'),connect);ami['on']('shutdown',function(_0x2e82ce){logger[_0xb47a('0x19')](util[_0xb47a('0xc')](_0xb47a('0x1e'),config['asterisk'][_0xb47a('0xe')],config[_0xb47a('0x6')]['ip'],config[_0xb47a('0x6')]['port'],util[_0xb47a('0xf')](_0x2e82ce,![],null)));});ami['on'](_0xb47a('0x1f'),function(){logger['info'](util[_0xb47a('0xc')](_0xb47a('0x20'),config[_0xb47a('0x6')][_0xb47a('0xe')],config[_0xb47a('0x6')]['ip'],config[_0xb47a('0x6')][_0xb47a('0x7')]));return Promise[_0xb47a('0x21')]()[_0xb47a('0x22')](ami['actionSipShowRegistry']())[_0xb47a('0x22')](ami[_0xb47a('0x13')]())[_0xb47a('0x22')](ami[_0xb47a('0x14')]())[_0xb47a('0x22')](ami[_0xb47a('0x23')]())['then'](ami[_0xb47a('0x17')]())[_0xb47a('0x24')](function(_0x3c1af0){logger[_0xb47a('0xb')](_0xb47a('0x25'),util[_0xb47a('0xf')](_0x3c1af0,{'showHidden':![],'depth':null}));});});ami[_0xb47a('0x1b')](_0xb47a('0xb'),error);ami[_0xb47a('0x1b')](_0xb47a('0x1c'),close);module['exports']=ami; \ No newline at end of file +var _0x4417=['actionQueueSummary','catch','[ami.js][fullybooted]','exports','asterisk-manager','../../config/logger','../../config/environment','port','asterisk','username','keepConnected','Action','promisify','action','format','inspect','error','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','devicestatelist','actionSipPeerStatus','queuesummary','actionCoreShowChannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionDeviceStateList'];(function(_0x5acf5d,_0x6b1637){var _0x27975c=function(_0x4bb4c2){while(--_0x4bb4c2){_0x5acf5d['push'](_0x5acf5d['shift']());}};_0x27975c(++_0x6b1637);}(_0x4417,0x1f3));var _0x7441=function(_0x25f256,_0x2cb5bb){_0x25f256=_0x25f256-0x0;var _0x1196dd=_0x4417[_0x25f256];return _0x1196dd;};'use strict';var Manager=require(_0x7441('0x0'));var BPromise=require('bluebird');var util=require('util');var logger=require(_0x7441('0x1'))('ami');var config=require(_0x7441('0x2'));var ami=new Manager(config['asterisk'][_0x7441('0x3')],config[_0x7441('0x4')]['ip'],config[_0x7441('0x4')][_0x7441('0x5')],config[_0x7441('0x4')]['password'],!![]);ami[_0x7441('0x6')]();ami[_0x7441('0x7')]=BPromise[_0x7441('0x8')](ami[_0x7441('0x9')]);function error(_0x2ca8c3){logger['error'](util[_0x7441('0xa')]('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config['asterisk']['username'],config[_0x7441('0x4')]['ip'],config[_0x7441('0x4')][_0x7441('0x3')],util[_0x7441('0xb')](_0x2ca8c3,![],null)));}function close(){logger[_0x7441('0xc')](util[_0x7441('0xa')](_0x7441('0xd'),config[_0x7441('0x4')][_0x7441('0x5')],config[_0x7441('0x4')]['ip'],config[_0x7441('0x4')][_0x7441('0x3')]));}ami[_0x7441('0xe')]=function(){return function(){return ami[_0x7441('0x7')]({'action':_0x7441('0xf')});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x7441('0x7')]({'action':_0x7441('0x10')});};};ami[_0x7441('0x11')]=function(){return function(){return ami['Action']({'action':'sippeerstatus'});};};ami['actionQueueSummary']=function(){return function(){return ami[_0x7441('0x7')]({'action':_0x7441('0x12')});};};ami[_0x7441('0x13')]=function(){return function(){return ami[_0x7441('0x7')]({'action':'coreshowchannels'});};};function connect(){logger[_0x7441('0x14')](util['format'](_0x7441('0x15'),config[_0x7441('0x4')][_0x7441('0x5')],config[_0x7441('0x4')]['ip'],config[_0x7441('0x4')][_0x7441('0x3')]));ami['once'](_0x7441('0xc'),error);ami[_0x7441('0x16')](_0x7441('0x17'),close);}ami['on']('connect',connect);ami['on']('shutdown',function(_0x31d936){logger[_0x7441('0x14')](util[_0x7441('0xa')]('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config[_0x7441('0x4')]['username'],config[_0x7441('0x4')]['ip'],config[_0x7441('0x4')][_0x7441('0x3')],util['inspect'](_0x31d936,![],null)));});ami['on'](_0x7441('0x18'),function(){logger[_0x7441('0x14')](util[_0x7441('0xa')](_0x7441('0x19'),config[_0x7441('0x4')]['username'],config[_0x7441('0x4')]['ip'],config[_0x7441('0x4')][_0x7441('0x3')]));return Promise[_0x7441('0x1a')]()['then'](ami[_0x7441('0xe')]())[_0x7441('0x1b')](ami[_0x7441('0x1c')]())[_0x7441('0x1b')](ami['actionSipPeerStatus']())[_0x7441('0x1b')](ami[_0x7441('0x1d')]())[_0x7441('0x1b')](ami[_0x7441('0x13')]())[_0x7441('0x1e')](function(_0x4d4992){logger[_0x7441('0xc')](_0x7441('0x1f'),util[_0x7441('0xb')](_0x4d4992,{'showHidden':![],'depth':null}));});});ami[_0x7441('0x16')]('error',error);ami['once'](_0x7441('0x17'),close);module[_0x7441('0x20')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 9de3bf2..5943433 100644 --- a/server/services/ami/client.js +++ b/server/services/ami/client.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb43b=['catch','exports','jayson/promise','bluebird','ami','client','http','rpc','memberReport','error','message','result'];(function(_0x38edc7,_0x5d0576){var _0x3eb41e=function(_0x2c0917){while(--_0x2c0917){_0x38edc7['push'](_0x38edc7['shift']());}};_0x3eb41e(++_0x5d0576);}(_0xb43b,0x1b2));var _0xbb43=function(_0x298122,_0x3be04b){_0x298122=_0x298122-0x0;var _0x46164f=_0xb43b[_0x298122];return _0x46164f;};'use strict';var jayson=require(_0xbb43('0x0'));var BPromise=require(_0xbb43('0x1'));var logger=require('../../config/logger')(_0xbb43('0x2'));var client=jayson[_0xbb43('0x3')][_0xbb43('0x4')]({'port':0x2329});client['Request']=function(_0x131e9e,_0x41aff6){return new BPromise(function(_0x351254,_0x16432a){return client['request'](_0x131e9e,_0x41aff6)['then'](function(_0x378df5){logger['debug'](_0xbb43('0x5'),_0xbb43('0x6'),_0x131e9e,_0x41aff6,_0x378df5);if(_0x378df5[_0xbb43('0x7')]){logger[_0xbb43('0x7')](_0xbb43('0x5'),'memberReport',_0x131e9e,_0x378df5[_0xbb43('0x7')][_0xbb43('0x8')],_0x41aff6);return _0x16432a(_0x378df5['error'][_0xbb43('0x8')]);}else{return _0x351254(_0x378df5[_0xbb43('0x9')]);}})[_0xbb43('0xa')](function(_0x5e3611){logger[_0xbb43('0x7')](_0xbb43('0x5'),'memberReport',_0x131e9e,_0x5e3611,_0x41aff6);return _0x16432a(_0x5e3611);});});};module[_0xbb43('0xb')]=client; \ No newline at end of file +var _0x70e0=['catch','exports','jayson/promise','bluebird','../../config/logger','http','Request','then','memberReport','error','rpc','message','result'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x70e0,0x17b));var _0x070e=function(_0x4d8eb1,_0x1c55fe){_0x4d8eb1=_0x4d8eb1-0x0;var _0x13fb98=_0x70e0[_0x4d8eb1];return _0x13fb98;};'use strict';var jayson=require(_0x070e('0x0'));var BPromise=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('ami');var client=jayson['client'][_0x070e('0x3')]({'port':0x2329});client[_0x070e('0x4')]=function(_0x277d32,_0x2593e5){return new BPromise(function(_0x5c90fc,_0x7bce9b){return client['request'](_0x277d32,_0x2593e5)[_0x070e('0x5')](function(_0x4b041d){logger['debug']('rpc',_0x070e('0x6'),_0x277d32,_0x2593e5,_0x4b041d);if(_0x4b041d[_0x070e('0x7')]){logger[_0x070e('0x7')](_0x070e('0x8'),_0x070e('0x6'),_0x277d32,_0x4b041d[_0x070e('0x7')][_0x070e('0x9')],_0x2593e5);return _0x7bce9b(_0x4b041d['error']['message']);}else{return _0x5c90fc(_0x4b041d[_0x070e('0xa')]);}})[_0x070e('0xb')](function(_0x12bb37){logger[_0x070e('0x7')](_0x070e('0x8'),_0x070e('0x6'),_0x277d32,_0x12bb37,_0x2593e5);return _0x7bce9b(_0x12bb37);});});};module[_0x070e('0xc')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 6adc744..2ded15a 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 _0xe976=['NONE','isOutboundQueue','dialQueueOptions','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','Contact','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','extractCalleridName','XMD-ORIGINATECALLERIDNUM','variables','SIP/%s/%s%s','dialPrefix','trim','substring','dialCutDigit','from-sip','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','originate','originate\x20action\x20Error','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','[syncAgentComplete][createHistory][8]','dialCongestionMaxRetry','reason\x208\x20congestion','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','Global','Success','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','available','floor','predictiveIntervalHitRate','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dialPredictiveOptimization','dropRate','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','avgHandleTime','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(','predictiveIntervalDroppedCallsCallersExit','abandonmentRate','busyFactor','[getDataPredictive]','check\x20failure','getDataPredictiveOld','loggedIn','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','agentBusyFactor','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','voicePause','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALL_TIMEOUT','outboundBlacklistCallsDay','Blacklist','[Originate][historyBlacklist]','inBlackList','limitCalls','temp','checkContactEmpty','RUNNING','ivrTotalCallsDays','emptyContact','[actionOriginate]\x20','checkIsBlackListIvr','loggerHandler','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','[countReScheduled]\x20','checkIsBlackList','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','countReScheduled','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','Amax\x20=\x20','erlangb','----\x20Agent\x20Busy\x20Factor\x20----','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','p\x20=\x20','interval\x20=\x20','Umin\x20=\x20','exports','util','lodash','ioredis','./utils','./utils/hopper','../preview/util/util','../../../config/logger','dialer','booked','predictive','syncQueueSummary','../ami','defaults','redis','socket.io-emitter','../rpc/cmHopper','../rpc/voiceQueueRt','../rpc/setting','../rpc/interval','./models/action','./models/history','./models/final','./models/agentComplete','./models/queueCallerAbandon','env','XCALLY_IP_AGI','127.0.0.1','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','uniqueId','optionPredictive','startPredictive','queueBooked','queueBookedRR','queuesSummary','agentconnect','syncAgentConnect','bind','queuecallerabandon','originateresponse','syncOriginateResponse','custom:queuesummary','custom:queuesummarycomplete','syncQueueSummaryComplete','hangup','syncHangup','syncNewExten','varset','syncVarSet','syncQueueMember','syncQueueStatusComplete','getSettings','then','previewRecallmeReminderInterval','emit','outbound','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','format','voice:queue:%s','voice_queue:save','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','---------------------------','predictiveIntervalTotalCalls','isUndefined','predictiveIntervalAvgTalktime','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','erlangBusyFactor','getSeconds','startProgressive','name','startProgressive\x20value\x20cleared','startPredictive\x20value\x20cleared','handlePredictive','error','stack','checkContactLowerLimitOriginate','inspect','contactsRescheduled','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','message','NO_AVAILABLE_CONTACTS','statedesc','endtime','starttime','queueStatusComplete','[unlockQueueStatus][undefined]','stringify','pick','Interval','NULL_INTERVAL','\x20INTERVAL_IS_NULL','Intervals','isIVRCampaignActive','INACTIVE','sendMessageOneNotActive','originated','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','DISACTIVED','is\x20disactive','[ifTime][Action]','Error','isTrunkReachable','active','SIP/%s','status','reachable','unmonitored','Trunk','TrunkBackup','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','checkIfTimeIntervals','ifTimeIvr','ifTime','isEmpty','EMPTY_INTERVAL','Failure','\x20Intervals\x20is\x20empty\x20','timezones','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','isArray','length','push','command','iftime\x20%s,%s','content','indexOf','true','catch','Action','all','some','OVERTIME_INTERVAL','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','loopCampaigns','resetActiveCalls','syncCampaigns','undefined','isIVRCampaign','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','[syncCampaigns]','checkDialMethod','dialMethod','progressive','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','silly','Dialer::ifTime()','intervalIftime','OVERTIME_GLOBAL_INTERVAL','Timezone:\x20','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','AMI\x20IfTime','uniqueid','type','ivr','queue','answertime','YYYY-MM-DD\x20HH:mm:ss','syncAgentComplete','reason','agent','dialQueueProject2','dialAgiAfterHangupAgent','createHistory','[syncAgentComplete][createHistory]','moveContactManagedDialer','[syncAgentComplete]','syncQueueCallerAbandon','droptime','responsetime','dialQueueTimeout','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','dropreason','TIMEOUT','agiafterat','countdropretry','countglobal','dialDropRetryFrequency','callAdditionalPhoneAfterMin','verifyAdditionalPhones','voiceQueue','additional','dialDropMaxRetry','rescheduleContact','add','minutes','ContactId','ListId','VoiceQueueId','[rescheduleContact][Drop]','state','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','outboundDropCallsDayCallersExit','Abandoned','dialAbandonedRetryFrequency','dialAbandonedMaxRetry','queueCallerAbandonCreateState','countabandonedretry','[syncAgentComplete][createHistory][11]','swapAdditionalPhones','channel','actionid','rrmemory','roundrobin','isNil','locked','paused','stateinterface','merge','idHopper','strategy','run','[Catch][Preview][syncQueueStatusComplete]','updateOriginated','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','contactAgent-idHopper:\x20','[booked][unlock]','CampaignId','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','response','callProgressDetecting','[callProgressDetecting]\x20','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','outboundAnswerCallsDay','HangupInAMD','membername','AMD','custom:amd','amd','saveInDb','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','Machine','countmachineretry','buildObj','[syncAgentComplete][createHistory][0]','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countagentrejectretry','stateGlobal','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','outboundAnswerAgiCallsDay','countbusyretry','dialGlobalMaxRetry','dialMachineRetryFrequency','[rescheduleContact][Machine]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','AnswerAGI','AGI','dialQueueProject','outboundUnknownCallsDay','cause-txt','Unknow','running','isPreviewCampaign','statusMessage','getQueueCampaignStatusMessage','resolve','inUse','talking','pTalking','compareToOutboundQueue','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','[syncQueueSummary]','throttle','dialPreviewRecallmeReminder','filter','online','handlePreviewRecallNotifications','map','Agent','user:%s','user:dialPreviewRecallReminder','checkPreviewRecallReminder','clearZombieChannels','[uniqueid]','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','[updateOriginated]\x20is\x20null\x20or\x20undefined','UserId','[emptyContact][createHistory]','handleIvr','actionOriginate','object','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22'];(function(_0xe60410,_0x301bf2){var _0x43a448=function(_0x549387){while(--_0x549387){_0xe60410['push'](_0xe60410['shift']());}};_0x43a448(++_0x301bf2);}(_0xe976,0xb7));var _0x6e97=function(_0x1c5950,_0x49e128){_0x1c5950=_0x1c5950-0x0;var _0x2b720a=_0xe976[_0x1c5950];return _0x2b720a;};'use strict';var util=require(_0x6e97('0x0'));var _=require(_0x6e97('0x1'));var uuid=require('uuid');var moment=require('moment');var rr=require('rr');var Redis=require(_0x6e97('0x2'));var utils=require(_0x6e97('0x3'));var hopperUtils=require(_0x6e97('0x4'));var ut=require(_0x6e97('0x5'));var config=require('../../../config/environment/');var logger=require(_0x6e97('0x6'))(_0x6e97('0x7'));var loggerBooked=require(_0x6e97('0x6'))(_0x6e97('0x8'));var loggerPredictive=require(_0x6e97('0x6'))(_0x6e97('0x9'));var loggerPredictiveCalls=require(_0x6e97('0x6'))('predictiveCalls');var loggerSyncQueueSummary=require(_0x6e97('0x6'))(_0x6e97('0xa'));var ami=require(_0x6e97('0xb'));config['redis']=_[_0x6e97('0xc')](config[_0x6e97('0xd')],{'host':'localhost','port':0x18eb});var io=require(_0x6e97('0xe'))(new Redis(config['redis']));var cmHopper=require(_0x6e97('0xf'));var voiceQueueRt=require(_0x6e97('0x10'));var RpcSetting=require(_0x6e97('0x11'));var Interval=require(_0x6e97('0x12'));var Action=require(_0x6e97('0x13'));var History=require(_0x6e97('0x14'));var Final=require(_0x6e97('0x15'));var AgentComplete=require(_0x6e97('0x16'));var QueueCallerAbandon=require(_0x6e97('0x17'));var Hangup=require('./models/hangup');var ipAgi=process[_0x6e97('0x18')][_0x6e97('0x19')]||_0x6e97('0x1a');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x6e97('0x1b')][_0x6e97('0x1c')]=function(_0x34afad){this[_0x6e97('0x1d')]=this[_0x6e97('0x1d')]?this[_0x6e97('0x1d')][_0x6e97('0x1e')](_0x34afad):_0x34afad();};function Dialer(_0x145028,_0x1387f9){this[_0x6e97('0x1f')]=new Sequence();this[_0x6e97('0x20')]=_0x1387f9;this[_0x6e97('0x21')]=_0x145028[_0x6e97('0x21')];this[_0x6e97('0x22')]=_0x145028[_0x6e97('0x22')];this[_0x6e97('0x23')]=_0x145028[_0x6e97('0x23')];this[_0x6e97('0x24')]=_0x145028[_0x6e97('0x24')];this[_0x6e97('0x25')]=config[_0x6e97('0x25')]||0x2;this[_0x6e97('0x26')]={};this[_0x6e97('0x27')]={};this['contactsId']={};this[_0x6e97('0x28')]={};this[_0x6e97('0x29')]={};this[_0x6e97('0x2a')]={};this['startProgressive']={};this['ivrOriginated']={};this[_0x6e97('0x2b')]={};this[_0x6e97('0x2c')]={};this[_0x6e97('0x2d')]={};ami['on'](_0x6e97('0x2e'),this[_0x6e97('0x2f')][_0x6e97('0x30')](this));ami['on'](_0x6e97('0x31'),this['syncQueueCallerAbandon'][_0x6e97('0x30')](this));ami['on'](_0x6e97('0x32'),this[_0x6e97('0x33')]['bind'](this));ami['on']('agentcomplete',this['syncAgentComplete'][_0x6e97('0x30')](this));ami['on'](_0x6e97('0x34'),this[_0x6e97('0xa')][_0x6e97('0x30')](this));ami['on'](_0x6e97('0x35'),this[_0x6e97('0x36')][_0x6e97('0x30')](this));ami['on'](_0x6e97('0x37'),this[_0x6e97('0x38')][_0x6e97('0x30')](this));ami['on']('newexten',this[_0x6e97('0x39')][_0x6e97('0x30')](this));ami['on'](_0x6e97('0x3a'),this[_0x6e97('0x3b')][_0x6e97('0x30')](this));ami['on']('queuemember',this[_0x6e97('0x3c')][_0x6e97('0x30')](this));ami['on']('queuestatuscomplete',this[_0x6e97('0x3d')][_0x6e97('0x30')](this));this['loopCampaigns']();this['loopClearZombieChannels']();RpcSetting[_0x6e97('0x3e')]()[_0x6e97('0x3f')](function(_0x24887e){previewRecallmeReminderInterval=_0x24887e[_0x6e97('0x40')];});}function isNotNull(_0x17417a){return _0x17417a!==null&&!_['isUndefined'](_0x17417a);}function msgResponse(_0x21ea2d,_0x916157,_0x15e7fe){return{'action':_0x21ea2d,'response':_0x916157,'message':_0x15e7fe,'stack':_0x15e7fe};}function emit(_0x1ccefa,_0x4cbbca,_0x117e2d){io['to'](_0x1ccefa)[_0x6e97('0x41')](_0x4cbbca,_0x117e2d);}function emitOutboundVoiceQueueSummary(_0x30b1f7){if(_0x30b1f7['type']===_0x6e97('0x42')){logger[_0x6e97('0x43')](_0x6e97('0x44'),util['inspect'](_0x30b1f7,{'showHidden':![],'depth':null}));emit(util[_0x6e97('0x45')](_0x6e97('0x46'),_0x30b1f7['name']),_0x6e97('0x47'),_0x30b1f7);}}function checkGetDataPredictive(_0x52ce66){if(isNotNull(_0x52ce66)&&!_['isEmpty'](_0x52ce66)){loggerPredictive[_0x6e97('0x48')](_0x6e97('0x49'));loggerPredictive[_0x6e97('0x48')](_0x6e97('0x4a'),_0x52ce66['predictiveIntervalTotalCalls']);loggerPredictive[_0x6e97('0x48')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x52ce66[_0x6e97('0x4b')]);loggerPredictive[_0x6e97('0x48')](_0x6e97('0x4c'),_0x52ce66[_0x6e97('0x4d')]);loggerPredictive[_0x6e97('0x48')](_0x6e97('0x4e'),_0x52ce66['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0x6e97('0x48')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x52ce66[_0x6e97('0x4f')]);loggerPredictive[_0x6e97('0x48')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x52ce66['predictiveIntervalAvgTalktime']);loggerPredictive[_0x6e97('0x48')](_0x6e97('0x50'));if(_0x52ce66[_0x6e97('0x51')]>0x0){if(!_[_0x6e97('0x52')](_0x52ce66['predictiveIntervalAvgTalktime'])&&_0x52ce66[_0x6e97('0x53')]>0x0){return!![];}loggerPredictive[_0x6e97('0x48')](_0x6e97('0x54'));if(!_['isUndefined'](_0x52ce66[_0x6e97('0x4f')])&&_0x52ce66[_0x6e97('0x4f')]>0x0){return!![];}loggerPredictive[_0x6e97('0x48')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0x6e97('0x48')](_0x6e97('0x55'));}}else{loggerPredictive[_0x6e97('0x48')](_0x6e97('0x56'));}return![];}function mergeDataErlangB(_0x14f565){return function(_0x36418b){loggerPredictive[_0x6e97('0x48')](_0x6e97('0x57'));loggerPredictive[_0x6e97('0x48')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x36418b[_0x6e97('0x58')]);loggerPredictive[_0x6e97('0x48')](_0x6e97('0x59'),_0x36418b[_0x6e97('0x5a')]);loggerPredictive['info'](_0x6e97('0x5b'),_0x36418b[_0x6e97('0x5c')]);loggerPredictive[_0x6e97('0x48')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x36418b[_0x6e97('0x5d')]);loggerPredictive[_0x6e97('0x48')](_0x6e97('0x5b'),_0x36418b['erlangAbandonmentRate']);loggerPredictive[_0x6e97('0x48')]('---------------------------');_['merge'](_0x14f565,_0x36418b);};}function ifInterval(_0x3e94c6,_0x310e09){if(_[_0x6e97('0x52')](_0x310e09)){return![];}return utils[_0x6e97('0x5e')](undefined,_0x310e09)<_0x3e94c6*0x3c;}function clearPredictiveAttributes(_0x5765f9){if(_0x5765f9[_0x6e97('0x5f')]){_0x5765f9[_0x6e97('0x5f')]=undefined;loggerPredictive[_0x6e97('0x43')](_0x5765f9[_0x6e97('0x60')],_0x6e97('0x61'));}if(_0x5765f9[_0x6e97('0x2a')]){_0x5765f9[_0x6e97('0x2a')]=undefined;loggerPredictive[_0x6e97('0x43')](_0x5765f9[_0x6e97('0x60')],_0x6e97('0x62'));}if(_0x5765f9['handlePredictive']){clearInterval(_0x5765f9[_0x6e97('0x63')]);_0x5765f9[_0x6e97('0x63')]=undefined;loggerPredictive[_0x6e97('0x43')](_0x5765f9[_0x6e97('0x60')],'handlePredictive\x20interval\x20cleared');}}function loggerCatchPredictive(_0x399360,_0x59e0ba){return function(_0x59f49c){loggerPredictive['error'](_0x59e0ba[_0x6e97('0x60')],_0x399360);loggerPredictive[_0x6e97('0x64')](_0x59f49c[_0x6e97('0x65')]);clearPredictiveAttributes(_0x59e0ba);};}function loggerCatch(_0x9642ad){return function(_0x558941){logger['error'](_0x9642ad,util['inspect'](_0x558941,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x51cd25,_0x1643f2,_0x411407){return function(_0x1f595a){utils[_0x6e97('0x66')](_0x1643f2,_0x411407,0x0);logger[_0x6e97('0x64')](_0x51cd25,util[_0x6e97('0x67')](_0x1f595a,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x306fcf){return function(_0x508d94){if(isNotNull(_0x508d94)&&isNotNull(_0x508d94[0x0])){if(_0x508d94[0x0][_0x6e97('0x68')]>0x0){_0x306fcf['message']=utils[_0x6e97('0x69')][_0x6e97('0x6a')];logger[_0x6e97('0x48')]('[getContactDialer2][ReScheduled]'+_0x306fcf[_0x6e97('0x60')],_0x508d94[0x0][_0x6e97('0x68')],'contacts');}else{_0x306fcf[_0x6e97('0x6b')]=utils[_0x6e97('0x69')][_0x6e97('0x6c')];logger[_0x6e97('0x48')]('[getContactDialer2][Empty]'+_0x306fcf[_0x6e97('0x60')]);}}};}function createObjHistory(_0x34c220,_0x2f4463,_0x5c9e9a,_0x219cfd,_0x1c33a9){_0x34c220['message']=_0x5c9e9a;var _0x241390=new Action(_0x34c220,_0x2f4463);var _0x27d22b=new History(_0x241390);_0x27d22b['state']=_0x219cfd;_0x27d22b[_0x6e97('0x6d')]=_0x1c33a9;_0x27d22b[_0x6e97('0x6e')]=_0x241390[_0x6e97('0x6f')];return _0x27d22b;}function unlockQueueStatus(_0x17cfb2,_0x15b772){setTimeout(function(){if(_[_0x6e97('0x52')](_0x17cfb2[_0x6e97('0x70')])){loggerBooked[_0x6e97('0x64')](_0x6e97('0x71'),_0x15b772);}_0x17cfb2[_0x6e97('0x70')]=!![];loggerBooked[_0x6e97('0x48')]('[booked][unlockQueueStatus]',_0x15b772,JSON[_0x6e97('0x72')](_[_0x6e97('0x73')](_0x17cfb2,['name',_0x6e97('0x70')])));},0x1f3);}function checkInterval(_0x224719){return function(){if(!isNotNull(_0x224719[_0x6e97('0x74')])){_0x224719[_0x6e97('0x6b')]=utils['CAMPAIGN_STATUS'][_0x6e97('0x75')];throw _0x224719[_0x6e97('0x60')]+_0x6e97('0x76');}if(!isNotNull(_0x224719['Interval']['Intervals'])){_0x224719[_0x6e97('0x6b')]=utils[_0x6e97('0x69')]['NULL_INTERVAL'];throw _0x224719['name']+_0x6e97('0x76');}if(!isNotNull(_['isEmpty'](_0x224719[_0x6e97('0x74')][_0x6e97('0x77')]))){_0x224719[_0x6e97('0x6b')]=utils[_0x6e97('0x69')][_0x6e97('0x75')];throw _0x224719['name']+_0x6e97('0x76');}};}function checkIsIVRCampaignActive(_0x56e8fe){return function(){if(!utils[_0x6e97('0x78')](_0x56e8fe)){_0x56e8fe[_0x6e97('0x6b')]=utils[_0x6e97('0x69')][_0x6e97('0x79')];throw _0x56e8fe[_0x6e97('0x60')]+'\x20NOT\x20Active';}};}function emitCampaignSummary(_0x42be62){if(utils['isIVRCampaign'](_0x42be62)){emit(util['format']('campaign:ivr:%s',_0x42be62[_0x6e97('0x60')]),'campaign:save',_0x42be62);}}function loggerCatchQueueSummary(_0x5dab5c,_0x1691d8){return function(_0x58aa11){clearPredictiveAttributes(_0x1691d8);emitCampaignSummary(_0x1691d8);loggerSyncQueueSummary[_0x6e97('0x43')](_0x5dab5c,util[_0x6e97('0x67')](_0x58aa11,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x2bb214){if(_0x2bb214[_0x6e97('0x7a')]){if(_0x2bb214[_0x6e97('0x7b')]===0x0){_0x2bb214[_0x6e97('0x7a')]=![];_0x2bb214[_0x6e97('0x6b')]=utils[_0x6e97('0x69')][_0x6e97('0x79')];loggerSyncQueueSummary[_0x6e97('0x43')](_0x6e97('0x7c'),_0x2bb214['name'],_0x6e97('0x7d'));}else{_0x2bb214[_0x6e97('0x6b')]=utils[_0x6e97('0x69')][_0x6e97('0x7e')];loggerSyncQueueSummary[_0x6e97('0x43')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x2bb214[_0x6e97('0x60')],_0x6e97('0x7f'));}emitCampaignSummary(_0x2bb214);}}function myreject(_0x3a2330){return function(_0x26ec12){return _0x3a2330(msgResponse(_0x6e97('0x80'),_0x6e97('0x81'),JSON[_0x6e97('0x72')](_0x26ec12)));};}Dialer[_0x6e97('0x1b')][_0x6e97('0x82')]=function(_0x43ffdf){return!_[_0x6e97('0x52')](_0x43ffdf)&&_0x43ffdf&&!_['isUndefined'](_0x43ffdf[_0x6e97('0x60')])&&!_[_0x6e97('0x52')](_0x43ffdf[_0x6e97('0x83')])&&_0x43ffdf[_0x6e97('0x83')]&&(this[_0x6e97('0x24')][util[_0x6e97('0x45')](_0x6e97('0x84'),_0x43ffdf[_0x6e97('0x60')])][_0x6e97('0x85')]===_0x6e97('0x86')||this[_0x6e97('0x24')][util[_0x6e97('0x45')](_0x6e97('0x84'),_0x43ffdf[_0x6e97('0x60')])][_0x6e97('0x85')]===_0x6e97('0x87'));};Dialer[_0x6e97('0x1b')]['checkIsTrunkReachable']=function(_0x17a7a3){var _0x951cc1=this;return function(){if(!_0x951cc1[_0x6e97('0x82')](_0x17a7a3[_0x6e97('0x88')])){if(!_0x951cc1[_0x6e97('0x82')](_0x17a7a3[_0x6e97('0x89')])){_0x17a7a3[_0x6e97('0x6b')]=utils[_0x6e97('0x69')][_0x6e97('0x8a')];throw _0x17a7a3[_0x6e97('0x60')]+_0x6e97('0x8b');}}};};Dialer[_0x6e97('0x1b')][_0x6e97('0x8c')]=function(_0x3f35b1,_0x41ba71,_0x2097a8,_0x17309c){var _0x2b1b65=this;return function(){var _0x1c9c3d=!![];return _0x2b1b65['ifTimeIvr'](_0x3f35b1,_0x41ba71,_0x2097a8,_0x17309c,_0x1c9c3d);};};Dialer[_0x6e97('0x1b')][_0x6e97('0x8d')]=function(_0x34835b,_0x3bcca8,_0x318170,_0xe9f332){var _0x2e66ae=this;return function(){var _0x1a7ac2=![];return _0x2e66ae[_0x6e97('0x8e')](_0x34835b[_0x6e97('0x77')],_0x3bcca8,_0x318170,_0xe9f332,_0x1a7ac2);};};Dialer['prototype'][_0x6e97('0x8e')]=function(_0x148e88,_0x486eac,_0x2bb9d1,_0x37889a,_0x515e1c){var _0x4e0e61=[];return new Promise(function(_0x497ee7,_0x11ae65){if(!isNotNull(_0x148e88)){_0x37889a['message']=utils[_0x6e97('0x69')]['NULL_INTERVAL'];return _0x11ae65(msgResponse(_0x6e97('0x8f'),'Failure',_0x2bb9d1+'\x20Intervals\x20is\x20null\x20'));}if(_[_0x6e97('0x90')](_0x148e88)){_0x37889a[_0x6e97('0x6b')]=utils[_0x6e97('0x69')][_0x6e97('0x91')];return _0x11ae65(msgResponse(_0x6e97('0x8f'),_0x6e97('0x92'),_0x2bb9d1+_0x6e97('0x93')));}if(_0x486eac&&_[_0x6e97('0x52')](config[_0x6e97('0x94')][_0x486eac])){_0x37889a[_0x6e97('0x6b')]=utils[_0x6e97('0x69')][_0x6e97('0x95')];return _0x11ae65(msgResponse(_0x6e97('0x8f'),'Failure',_0x2bb9d1+_0x6e97('0x96')+_0x486eac));}if(_[_0x6e97('0x97')](_0x148e88)){for(var _0x5265db=0x0;_0x5265db<_0x148e88[_0x6e97('0x98')];_0x5265db+=0x1){_0x4e0e61[_0x6e97('0x99')](ami['Action']({'action':_0x6e97('0x9a'),'command':util[_0x6e97('0x45')](_0x6e97('0x9b'),_0x148e88[_0x5265db]['interval'],!_[_0x6e97('0x52')](config[_0x6e97('0x94')][_0x486eac])?_0x486eac:'')})[_0x6e97('0x3f')](function(_0x40f5ad){return _0x40f5ad[_0x6e97('0x9c')][_0x6e97('0x9d')](_0x6e97('0x9e'))>=0x0;})[_0x6e97('0x9f')](myreject(_0x11ae65)));}}else{_0x4e0e61[_0x6e97('0x99')](ami[_0x6e97('0xa0')]({'action':_0x6e97('0x9a'),'command':util[_0x6e97('0x45')](_0x6e97('0x9b'),_0x148e88,!_[_0x6e97('0x52')](config['timezones'][_0x486eac])?_0x486eac:'')})[_0x6e97('0x3f')](function(_0x2ad12f){return _0x2ad12f[_0x6e97('0x9c')]['indexOf'](_0x6e97('0x9e'))>=0x0;})[_0x6e97('0x9f')](myreject(_0x11ae65)));}Promise[_0x6e97('0xa1')](_0x4e0e61)[_0x6e97('0x3f')](function(_0x28f19f){var _0x2838cb=_[_0x6e97('0xa2')](_0x28f19f);if(_0x2838cb){return _0x497ee7(_0x2838cb);}else{_0x37889a[_0x6e97('0x6b')]=_0x515e1c?utils[_0x6e97('0x69')]['OVERTIME_GLOBAL_INTERVAL']:utils[_0x6e97('0x69')][_0x6e97('0xa3')];return _0x11ae65(msgResponse(_0x6e97('0xa4'),'Failure',_0x6e97('0xa5')+_0x515e1c+'\x20'+_0x2bb9d1+_0x6e97('0xa6')+util[_0x6e97('0x67')](_0x148e88,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x486eac));}})['catch'](function(_0x1ff5ef){return _0x11ae65(msgResponse(_0x6e97('0x8f'),_0x6e97('0x92'),JSON[_0x6e97('0x72')](_0x1ff5ef)));});});};Dialer[_0x6e97('0x1b')][_0x6e97('0xa7')]=function(){var _0x5ad989=this;return cmHopper[_0x6e97('0xa8')]({'active':![]},{'where':{'active':!![]}})[_0x6e97('0x3f')](function(){setInterval(function(){_0x5ad989[_0x6e97('0xa9')]();},0x3e8);});};Dialer[_0x6e97('0x1b')][_0x6e97('0xa9')]=function(){var _0x37b384=this;var _0xef80e4;for(var _0x10bee1 in this[_0x6e97('0x22')]){if(typeof this['campaigns'][_0x10bee1]!==_0x6e97('0xaa')){_0xef80e4=this[_0x6e97('0x22')][_0x10bee1];if(utils[_0x6e97('0xab')](_0xef80e4)&&utils['isIVRCampaignActive'](_0xef80e4)){_0xef80e4[_0x6e97('0x7a')]=!![];Promise['resolve']()[_0x6e97('0x3f')](checkIsIVRCampaignActive(_0xef80e4))[_0x6e97('0x3f')](checkInterval(_0xef80e4))['then'](_0x37b384[_0x6e97('0xac')](_0xef80e4))['then'](_0x37b384[_0x6e97('0x8c')](_0xef80e4[_0x6e97('0xad')],_0xef80e4[_0x6e97('0xae')],_0xef80e4['name'],_0xef80e4))[_0x6e97('0x3f')](_0x37b384[_0x6e97('0x8d')](_0xef80e4['Interval'],_0xef80e4['dialTimezone'],_0xef80e4[_0x6e97('0x60')],_0xef80e4))[_0x6e97('0x3f')](_0x37b384['launchHandleIvr'](_0xef80e4))['catch'](loggerCatchQueueSummary(_0x6e97('0xaf'),_0xef80e4));}else{notSendMessagesCampaign(_0xef80e4);}}}};Dialer['prototype'][_0x6e97('0xb0')]=function(_0x4a69df){if(_0x4a69df[_0x6e97('0xb1')]!==_0x6e97('0x9')){clearPredictiveAttributes(_0x4a69df);}switch(_0x4a69df[_0x6e97('0xb1')]){case _0x6e97('0xb2'):this[_0x6e97('0xb3')](_0x4a69df,0x1);break;case _0x6e97('0xb4'):this[_0x6e97('0xb3')](_0x4a69df,_0x4a69df[_0x6e97('0xb5')]);break;case _0x6e97('0x9'):this['predictive'](_0x4a69df);break;case _0x6e97('0x8'):this[_0x6e97('0xb3')](_0x4a69df,0x1);break;default:logger[_0x6e97('0x64')](_0x6e97('0xb6'),_0x4a69df[_0x6e97('0x60')],_0x6e97('0xb7'));}};Dialer['prototype'][_0x6e97('0x8f')]=function(_0x581365,_0x3ba590){var _0x38baca=_0x581365['dialTimezone'];var _0x4ed566=_0x3ba590?_0x581365[_0x6e97('0xad')]:_0x581365[_0x6e97('0x74')][_0x6e97('0x77')];logger[_0x6e97('0xb8')](_0x6e97('0xb9'),_0x4ed566,_0x38baca,_0x581365[_0x6e97('0x60')],util['format']('Voice\x20Queue\x20%s\x20$s',_0x581365[_0x6e97('0x60')],_0x581365['id']));var _0x1bb897=null;return Interval[_0x6e97('0xba')](_0x4ed566,_0x38baca)['then'](function(_0x4eb19e){if(_0x4eb19e===!![]){return _0x4eb19e;}else{_0x581365[_0x6e97('0x6b')]=_0x3ba590?utils['CAMPAIGN_STATUS'][_0x6e97('0xbb')]:utils[_0x6e97('0x69')][_0x6e97('0xa3')];_0x1bb897=msgResponse(_0x6e97('0xa4'),_0x6e97('0x92'),_0x6e97('0xa5')+_0x3ba590+'\x20'+_0x581365[_0x6e97('0x60')]+_0x6e97('0xa6')+util[_0x6e97('0x67')](_0x4ed566,{'showHidden':![],'depth':null})+_0x6e97('0xbc')+_0x38baca);}if(_0x1bb897!==null){logger['silly'](_0x6e97('0xbd'),_0x1bb897);_0x1bb897[_0x6e97('0xbe')]=_0x3ba590;throw _0x1bb897;}})[_0x6e97('0x9f')](function(_0x14edc9){logger[_0x6e97('0x64')](_0x6e97('0xbf'),_0x14edc9);throw msgResponse(_0x6e97('0x80'),'Error',util[_0x6e97('0x67')](_0x14edc9,{'showHidden':![],'depth':null}));});};Dialer['prototype']['syncAgentConnect']=function(_0x2743ab){if(this[_0x6e97('0x21')][_0x2743ab['queue']]){if(this['uniqueId'][_0x2743ab[_0x6e97('0xc0')]]&&this[_0x6e97('0x28')][_0x2743ab[_0x6e97('0xc0')]][_0x6e97('0xc1')]!==_0x6e97('0xc2')){this['updateOriginated'](this[_0x6e97('0x21')][_0x2743ab[_0x6e97('0xc3')]]);this[_0x6e97('0x28')][_0x2743ab[_0x6e97('0xc0')]][_0x6e97('0xc4')]=moment()[_0x6e97('0x45')](_0x6e97('0xc5'));}}};Dialer[_0x6e97('0x1b')][_0x6e97('0xc6')]=function(_0x4abea6){var _0x1b03bc=this[_0x6e97('0x28')][_0x4abea6['uniqueid']];if(this['voiceQueues'][_0x4abea6[_0x6e97('0xc3')]]){if(_0x1b03bc&&_0x1b03bc[_0x6e97('0xc1')]!==_0x6e97('0xc2')){delete this[_0x6e97('0x28')][_0x4abea6[_0x6e97('0xc0')]];this[_0x6e97('0x21')][_0x4abea6[_0x6e97('0xc3')]]['outboundAnswerCallsDay']+=0x1;var _0x1cec84=new AgentComplete(_0x1b03bc,_0x4abea6);if(_0x4abea6[_0x6e97('0xc7')]===_0x6e97('0xc8')){_0x1cec84['agiafterat']=this[_0x6e97('0x21')][_0x4abea6['queue']][_0x6e97('0xc9')]&&this[_0x6e97('0x21')][_0x4abea6[_0x6e97('0xc3')]][_0x6e97('0xca')]?moment()[_0x6e97('0x45')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}hopperUtils[_0x6e97('0xcb')](_0x1cec84)['catch'](loggerCatch(_0x6e97('0xcc')));hopperUtils[_0x6e97('0xcd')](_0x1cec84)['catch'](loggerCatch(_0x6e97('0xce')));}}};Dialer[_0x6e97('0x1b')][_0x6e97('0xcf')]=function(_0x451258){var _0x2a018a=this[_0x6e97('0x28')][_0x451258['uniqueid']];var _0x5afdeb=this;var _0x113bc8=![];var _0x485804;var _0xe8c7f0;if(this[_0x6e97('0x21')][_0x451258[_0x6e97('0xc3')]]){if(_0x2a018a&&_0x2a018a[_0x6e97('0xc1')]!==_0x6e97('0xc2')){delete this[_0x6e97('0x28')][_0x451258['uniqueid']];this['updateOriginated'](this[_0x6e97('0x21')][_0x451258[_0x6e97('0xc3')]]);_0x2a018a[_0x6e97('0xd0')]=moment()['format'](_0x6e97('0xc5'));var _0x205f55=new QueueCallerAbandon(_0x2a018a,_0x451258);if(utils[_0x6e97('0x5e')](_0x2a018a['droptime'],_0x2a018a[_0x6e97('0xd1')])>=_0x2a018a[_0x6e97('0xd2')]){this[_0x6e97('0x21')][_0x451258['queue']][_0x6e97('0x4d')]+=0x1;this[_0x6e97('0x21')][_0x451258[_0x6e97('0xc3')]][_0x6e97('0xd3')]+=0x1;this[_0x6e97('0x21')][_0x451258[_0x6e97('0xc3')]][_0x6e97('0xd4')]+=0x1;_0x205f55['state']=0xa;_0x205f55[_0x6e97('0x6d')]=_0x6e97('0xd5');_0x205f55[_0x6e97('0xd6')]=_0x6e97('0xd7');_0x205f55[_0x6e97('0xd8')]=this[_0x6e97('0x21')][_0x451258[_0x6e97('0xc3')]][_0x6e97('0xc9')]?moment()[_0x6e97('0x45')](_0x6e97('0xc5')):undefined;_0x205f55[_0x6e97('0xd9')]+=0x1;_0x205f55[_0x6e97('0xda')]+=0x1;_0x485804=this['voiceQueues'][_0x451258[_0x6e97('0xc3')]][_0x6e97('0xdb')];_0xe8c7f0=this['voiceQueues'][_0x451258['queue']][_0x6e97('0xdc')];hopperUtils[_0x6e97('0xdd')](_0x205f55,_0x205f55['state'],_0x2a018a[_0x6e97('0xde')])[_0x6e97('0x3f')](function(_0x40d7cd){_0x113bc8=_0x40d7cd[_0x6e97('0xdf')]==0x1;if(_0x205f55['countdropretry']>=_0x5afdeb[_0x6e97('0x21')][_0x451258['queue']][_0x6e97('0xe0')]){_0x5afdeb['queueCallerAbandonCreateState'](_0x205f55,_0x40d7cd[_0x6e97('0xdf')]);}else{hopperUtils[_0x6e97('0xe1')]({'active':![],'countdropretry':_0x205f55['countdropretry'],'scheduledat':moment()[_0x6e97('0xe2')](_0x5afdeb[_0x6e97('0x21')][_0x451258[_0x6e97('0xc3')]][_0x6e97('0xdb')],_0x6e97('0xe3'))[_0x6e97('0x45')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2a018a[_0x6e97('0xe4')],'ListId':_0x2a018a[_0x6e97('0xe5')],'VoiceQueueId':_0x2a018a[_0x6e97('0xe6')]||undefined,'CampaignId':_0x2a018a['CampaignId']||undefined})['catch'](loggerCatch(_0x6e97('0xe7')));var _0x4023a3=new History(_0x205f55);_0x4023a3[_0x6e97('0xe8')]=0xa;_0x4023a3['statedesc']=_0x6e97('0xd5');_0x4023a3[_0x6e97('0x6f')]=moment()[_0x6e97('0x45')](_0x6e97('0xc5'));_0x4023a3[_0x6e97('0x6e')]=_0x4023a3[_0x6e97('0x6f')];_0x4023a3[_0x6e97('0xe9')]=_0x205f55['calleridname'];_0x4023a3['calleridnum']=_0x205f55[_0x6e97('0xea')];hopperUtils[_0x6e97('0xcb')](_0x4023a3)['catch'](loggerCatch(_0x6e97('0xeb')));}})[_0x6e97('0x3f')](function(){if(_0x113bc8)hopperUtils['swapAdditionalPhones'](_0x205f55,_0x485804,_0xe8c7f0)[_0x6e97('0x3f')](function(){return 0x1;});});}else{this[_0x6e97('0x21')][_0x451258[_0x6e97('0xc3')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this['voiceQueues'][_0x451258[_0x6e97('0xc3')]][_0x6e97('0xec')]+=0x1;_0x205f55[_0x6e97('0xe8')]=0xb;_0x205f55[_0x6e97('0x6d')]=_0x6e97('0xed');_0x205f55[_0x6e97('0xd6')]='CALLEREXIT';_0x205f55['countabandonedretry']+=0x1;_0x205f55[_0x6e97('0xda')]+=0x1;_0x485804=this[_0x6e97('0x21')][_0x451258[_0x6e97('0xc3')]][_0x6e97('0xee')];_0xe8c7f0=this[_0x6e97('0x21')][_0x451258[_0x6e97('0xc3')]][_0x6e97('0xdc')];hopperUtils[_0x6e97('0xdd')](_0x205f55,_0x205f55['state'],_0x2a018a[_0x6e97('0xde')])[_0x6e97('0x3f')](function(_0x36b1a5){if(_0x205f55['countabandonedretry']>=_0x5afdeb[_0x6e97('0x21')][_0x451258[_0x6e97('0xc3')]][_0x6e97('0xef')]){_0x5afdeb[_0x6e97('0xf0')](_0x205f55,_0x36b1a5[_0x6e97('0xdf')]);}else{hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0x205f55[_0x6e97('0xf1')],'scheduledat':moment()['add'](_0x5afdeb['voiceQueues'][_0x451258[_0x6e97('0xc3')]][_0x6e97('0xee')],_0x6e97('0xe3'))['format'](_0x6e97('0xc5')),'ContactId':_0x2a018a[_0x6e97('0xe4')],'ListId':_0x2a018a['ListId'],'VoiceQueueId':_0x2a018a[_0x6e97('0xe6')]||undefined,'CampaignId':_0x2a018a['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact][Abandoned]'));var _0x10414b=new History(_0x205f55);_0x10414b[_0x6e97('0xe8')]=0xb;_0x10414b[_0x6e97('0x6d')]=_0x6e97('0xed');_0x10414b[_0x6e97('0x6f')]=moment()[_0x6e97('0x45')](_0x6e97('0xc5'));_0x10414b[_0x6e97('0x6e')]=_0x10414b[_0x6e97('0x6f')];_0x10414b[_0x6e97('0xe9')]=_0x205f55[_0x6e97('0xe9')];_0x10414b[_0x6e97('0xea')]=_0x205f55[_0x6e97('0xea')];hopperUtils[_0x6e97('0xcb')](_0x10414b)[_0x6e97('0x9f')](loggerCatch(_0x6e97('0xf2')));}})[_0x6e97('0x3f')](function(){if(_0x113bc8)hopperUtils[_0x6e97('0xf3')](_0x205f55,_0x485804,_0xe8c7f0)[_0x6e97('0x3f')](function(){return 0x1;});});}}}};Dialer[_0x6e97('0x1b')][_0x6e97('0x39')]=function(_0x55bf82){if(this[_0x6e97('0x27')][_0x55bf82[_0x6e97('0xc0')]]){this[_0x6e97('0x27')][_0x55bf82['uniqueid']][_0x6e97('0xf4')]=_0x55bf82[_0x6e97('0xf4')];}if(this[_0x6e97('0x28')][_0x55bf82[_0x6e97('0xc0')]]){this[_0x6e97('0x28')][_0x55bf82['uniqueid']][_0x6e97('0xf4')]=_0x55bf82[_0x6e97('0xf4')];}};Dialer[_0x6e97('0x1b')][_0x6e97('0x3c')]=function(_0x38e0dc){if(!this['actions'][_0x38e0dc[_0x6e97('0xf5')]]){return;}var _0xc99b53=this['voiceQueues'][this[_0x6e97('0x27')][_0x38e0dc[_0x6e97('0xf5')]][_0x6e97('0xc3')]]['strategy']||_0x6e97('0xf6');if(_0xc99b53===_0x6e97('0xf7')){if(this[_0x6e97('0x27')][_0x38e0dc[_0x6e97('0xf5')]]&&_[_0x6e97('0xf8')](this['actions'][_0x38e0dc[_0x6e97('0xf5')]][_0x6e97('0xf9')])&&_0x38e0dc['status']==='1'&&_0x38e0dc[_0x6e97('0xfa')]==='0'){if(this[_0x6e97('0x23')][_0x38e0dc['stateinterface']]){if(!this[_0x6e97('0x23')][_0x38e0dc[_0x6e97('0xfb')]][_0x6e97('0xf9')]){this[_0x6e97('0x23')][_0x38e0dc['stateinterface']][_0x6e97('0xf9')]=!![];this['actions'][_0x38e0dc[_0x6e97('0xf5')]][_0x6e97('0xf9')]=!![];this['actions'][_0x38e0dc[_0x6e97('0xf5')]]['stateinterface']=_0x38e0dc[_0x6e97('0xfb')];}}}}else if(_0xc99b53===_0x6e97('0xf6')){if(this[_0x6e97('0x27')][_0x38e0dc['actionid']]){if(this[_0x6e97('0x23')][_0x38e0dc[_0x6e97('0xfb')]]){this['actions'][_0x38e0dc[_0x6e97('0xf5')]]['stateinterface']=_0x38e0dc[_0x6e97('0xfb')];if(_[_0x6e97('0xf8')](this[_0x6e97('0x2b')][this[_0x6e97('0x27')][_0x38e0dc[_0x6e97('0xf5')]][_0x6e97('0xc3')]])){this['queueBooked'][this[_0x6e97('0x27')][_0x38e0dc['actionid']][_0x6e97('0xc3')]]=[];}this[_0x6e97('0x2b')][this[_0x6e97('0x27')][_0x38e0dc[_0x6e97('0xf5')]]['queue']][_0x6e97('0x99')](_[_0x6e97('0xfc')](_[_0x6e97('0x73')](this[_0x6e97('0x27')][_0x38e0dc[_0x6e97('0xf5')]],[_0x6e97('0xfd'),_0x6e97('0xfb')]),{'status':_0x38e0dc['status'],'paused':_0x38e0dc[_0x6e97('0xfa')]}));}}}};Dialer[_0x6e97('0x1b')]['syncQueueStatusComplete']=function(_0xb2a9c3){if(!this[_0x6e97('0x27')][_0xb2a9c3[_0x6e97('0xf5')]]){return;}var _0x5407c4=this;var _0x5a9c3a=this[_0x6e97('0x21')][this[_0x6e97('0x27')][_0xb2a9c3[_0x6e97('0xf5')]][_0x6e97('0xc3')]];var _0x1d35c7=_0x5a9c3a[_0x6e97('0xfe')]||_0x6e97('0xf6');if(_0x1d35c7==='roundrobin'){if(this[_0x6e97('0x27')][_0xb2a9c3['actionid']]&&this[_0x6e97('0x27')][_0xb2a9c3[_0x6e97('0xf5')]][_0x6e97('0xfb')]){this[_0x6e97('0x20')][_0x6e97('0xff')](this[_0x6e97('0x27')][_0xb2a9c3[_0x6e97('0xf5')]][_0x6e97('0xfd')],this[_0x6e97('0x27')][_0xb2a9c3[_0x6e97('0xf5')]][_0x6e97('0xfb')])[_0x6e97('0x9f')](function(_0x12c146){logger[_0x6e97('0x64')](_0x6e97('0x100'),util[_0x6e97('0x67')](_0x12c146,{'showHidden':![],'depth':null}));})[_0x6e97('0x1e')](function(){_0x5407c4[_0x6e97('0x101')](_0x5407c4[_0x6e97('0x21')][_0x5407c4[_0x6e97('0x27')][_0xb2a9c3['actionid']][_0x6e97('0xc3')]]);_0x5407c4[_0x6e97('0x23')][_0x5407c4[_0x6e97('0x27')][_0xb2a9c3[_0x6e97('0xf5')]]['stateinterface']][_0x6e97('0xf9')]=![];delete _0x5407c4[_0x6e97('0x27')][_0xb2a9c3[_0x6e97('0xf5')]];unlockQueueStatus(_0x5a9c3a);});}else{this[_0x6e97('0x101')](this[_0x6e97('0x21')][this[_0x6e97('0x27')][_0xb2a9c3['actionid']][_0x6e97('0xc3')]]);hopperUtils[_0x6e97('0xe1')]({'active':![],'ContactId':this['actions'][_0xb2a9c3[_0x6e97('0xf5')]]['ContactId'],'ListId':this[_0x6e97('0x27')][_0xb2a9c3[_0x6e97('0xf5')]]['ListId'],'VoiceQueueId':this['actions'][_0xb2a9c3['actionid']][_0x6e97('0xe6')]||undefined,'CampaignId':this[_0x6e97('0x27')][_0xb2a9c3[_0x6e97('0xf5')]]['CampaignId']||undefined})[_0x6e97('0x9f')](loggerCatch(_0x6e97('0x102')));delete this['actions'][_0xb2a9c3['actionid']];unlockQueueStatus(_0x5a9c3a);}}else if(_0x1d35c7===_0x6e97('0xf6')){var _0x1bf8b8;if(this['actions'][_0xb2a9c3[_0x6e97('0xf5')]]&&!_[_0x6e97('0x90')](this[_0x6e97('0x2b')][this[_0x6e97('0x27')][_0xb2a9c3[_0x6e97('0xf5')]][_0x6e97('0xc3')]])){if(this[_0x6e97('0x2c')][_0x5407c4['actions'][_0xb2a9c3[_0x6e97('0xf5')]][_0x6e97('0xc3')]]){this[_0x6e97('0x2c')][_0x5407c4[_0x6e97('0x27')][_0xb2a9c3[_0x6e97('0xf5')]][_0x6e97('0xc3')]]=this[_0x6e97('0x2c')][this[_0x6e97('0x27')][_0xb2a9c3[_0x6e97('0xf5')]][_0x6e97('0xc3')]]?this[_0x6e97('0x2c')][this[_0x6e97('0x27')][_0xb2a9c3['actionid']][_0x6e97('0xc3')]]:this[_0x6e97('0x2b')][this[_0x6e97('0x27')][_0xb2a9c3[_0x6e97('0xf5')]][_0x6e97('0xc3')]]?this[_0x6e97('0x2b')][this[_0x6e97('0x27')][_0xb2a9c3[_0x6e97('0xf5')]]['queue']]['_rr']||0x0:0x0;}this[_0x6e97('0x2b')][this[_0x6e97('0x27')][_0xb2a9c3[_0x6e97('0xf5')]][_0x6e97('0xc3')]][_0x6e97('0x103')]=this[_0x6e97('0x2c')][this[_0x6e97('0x27')][_0xb2a9c3[_0x6e97('0xf5')]]['queue']];for(var _0x5a52a1=0x0;_0x5a52a1=_0x3360cc['dialGlobalMaxRetry']){_0x4812a5[_0x6e97('0x129')](_0x2543be,_0x5884b8,_0x120148,'reason19\x20machine....');}else{if(_0x2543be[_0x6e97('0x122')]>=_0x3360cc[_0x6e97('0x12a')]){_0x4812a5[_0x6e97('0x12b')](_0x2543be,_0x5884b8,_0x120148,_0x6e97('0x12c'));}else{hopperUtils[_0x6e97('0xe1')]({'active':![],'countmachineretry':_0x2543be[_0x6e97('0x122')],'scheduledat':moment()[_0x6e97('0xe2')](_0x3360cc['dialMachineRetryFrequency'],_0x6e97('0xe3'))[_0x6e97('0x45')](_0x6e97('0xc5')),'ContactId':_0x2543be[_0x6e97('0xe4')],'ListId':_0x2543be[_0x6e97('0xe5')],'VoiceQueueId':_0x2543be[_0x6e97('0xe6')]||undefined,'CampaignId':_0x2543be[_0x6e97('0x108')]||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));_0x5884b8({'reschedule':0x1});}}});}if(_0x3ae346[_0x6e97('0xc1')]===_0x6e97('0xc2')&&this[_0x6e97('0x22')][_0x3ae346[_0x6e97('0xc3')]]['dialAMDActive']&&_0x6144[_0x6e97('0x115')]===_0x6e97('0x116')){delete this[_0x6e97('0x28')][_0x6144[_0x6e97('0xc0')]];this['updateOriginated'](this[_0x6e97('0x22')][_0x3ae346[_0x6e97('0xc3')]]);_0x53a909=new Hangup(_0x3ae346,_0x6144);_0x53a909[_0x6e97('0xe8')]=0x12;_0x53a909[_0x6e97('0x6d')]='HangupInAMD';_0x53a909[_0x6e97('0x119')]=_0x6e97('0x11a');ami['emit'](_0x6e97('0x11b'),ut[_0x6e97('0x123')](_0x53a909,'amd'));this[_0x6e97('0x11d')](_0x53a909,_0x6e97('0x12d'),_0x6e97('0x12e'));}if(_0x3ae346[_0x6e97('0xc1')]===_0x6e97('0xc2')&&this['campaigns'][_0x3ae346[_0x6e97('0xc3')]][_0x6e97('0x114')]&&_0x6144[_0x6e97('0x115')]===_0x6e97('0x120')){return new Promise(function(_0x2b2054,_0x2cf263){delete _0x4812a5[_0x6e97('0x28')][_0x6144['uniqueid']];_0x4812a5[_0x6e97('0x101')](_0x4812a5['campaigns'][_0x3ae346[_0x6e97('0xc3')]]);_0x4812a5[_0x6e97('0x22')][_0x3ae346['queue']]['outboundAnswerCallsDay']+=0x1;_0x4812a5[_0x6e97('0x22')][_0x3ae346['queue']][_0x6e97('0x12f')]+=0x1;var _0x241171=_0x4812a5['campaigns'][_0x3ae346['queue']];var _0x1ed7eb=new Hangup(_0x3ae346,_0x6144);_0x1ed7eb[_0x6e97('0xe8')]=0x13;_0x1ed7eb['statedesc']=_0x6e97('0x121');_0x1ed7eb[_0x6e97('0x119')]=_0x6e97('0x11a');_0x1ed7eb[_0x6e97('0x122')]+=0x1;_0x1ed7eb[_0x6e97('0xda')]+=0x1;_0x1ed7eb[_0x6e97('0x11c')]=!![];ami[_0x6e97('0x41')](_0x6e97('0x11b'),ut[_0x6e97('0x123')](_0x1ed7eb,_0x6e97('0x11c')));hopperUtils[_0x6e97('0xcb')](_0x1ed7eb)[_0x6e97('0x9f')](loggerCatch(_0x6e97('0x124')));if(_0x1ed7eb[_0x6e97('0x130')]+_0x1ed7eb['countcongestionretry']+_0x1ed7eb[_0x6e97('0x126')]+_0x1ed7eb['countnosuchnumberretry']+_0x1ed7eb[_0x6e97('0xd9')]+_0x1ed7eb['countabandonedretry']+_0x1ed7eb[_0x6e97('0x122')]+_0x1ed7eb[_0x6e97('0x128')]>=_0x241171[_0x6e97('0x131')]){_0x4812a5[_0x6e97('0x129')](_0x1ed7eb,_0x2b2054,_0x2cf263,'reason19\x20machine....');}else{if(_0x1ed7eb[_0x6e97('0x122')]>=_0x241171[_0x6e97('0x12a')]){_0x4812a5[_0x6e97('0x12b')](_0x1ed7eb,_0x2b2054,_0x2cf263,_0x6e97('0x12c'));}else{hopperUtils[_0x6e97('0xe1')]({'active':![],'countmachineretry':_0x1ed7eb[_0x6e97('0x122')],'scheduledat':moment()[_0x6e97('0xe2')](_0x241171[_0x6e97('0x132')],'minutes')[_0x6e97('0x45')](_0x6e97('0xc5')),'ContactId':_0x1ed7eb[_0x6e97('0xe4')],'ListId':_0x1ed7eb['ListId'],'VoiceQueueId':_0x1ed7eb[_0x6e97('0xe6')]||undefined,'CampaignId':_0x1ed7eb[_0x6e97('0x108')]||undefined})[_0x6e97('0x9f')](loggerCatch(_0x6e97('0x133')));_0x2b2054({'reschedule':0x1});}}});}}};Dialer['prototype']['syncHangup']=function(_0x1a105a){var _0x476713=this[_0x6e97('0x28')][_0x1a105a[_0x6e97('0xc0')]];var _0xd8ae91;if(_0x476713&&_0x476713['type']===_0x6e97('0xc2')){delete this['uniqueId'][_0x1a105a[_0x6e97('0xc0')]];this['updateOriginated'](this[_0x6e97('0x22')][_0x476713[_0x6e97('0xc3')]]);this[_0x6e97('0x22')][_0x476713[_0x6e97('0xc3')]][_0x6e97('0x134')]+=0x1;_0xd8ae91=new Hangup(_0x476713,_0x1a105a);hopperUtils['createHistory'](_0xd8ae91)[_0x6e97('0x9f')](loggerCatch(_0x6e97('0x135')));hopperUtils[_0x6e97('0xcd')](_0xd8ae91)[_0x6e97('0x9f')](loggerCatch(_0x6e97('0x136')));}if(_0x476713&&_0x476713['type']!=='ivr'&&isNotNull(this[_0x6e97('0x21')][_0x476713[_0x6e97('0xc3')]]['dialQueueProject'])){delete this['uniqueId'][_0x1a105a[_0x6e97('0xc0')]];this['updateOriginated'](this[_0x6e97('0x21')][_0x476713['queue']]);this[_0x6e97('0x21')][_0x476713[_0x6e97('0xc3')]][_0x6e97('0x117')]+=0x1;this[_0x6e97('0x21')][_0x476713[_0x6e97('0xc3')]][_0x6e97('0x12f')]+=0x1;_0xd8ae91=new Hangup(_0x476713,_0x1a105a);_0xd8ae91[_0x6e97('0xe8')]=0x10;_0xd8ae91[_0x6e97('0x6d')]=_0x6e97('0x137');_0xd8ae91[_0x6e97('0x119')]=_0x6e97('0x138');hopperUtils['createHistory'](_0xd8ae91)[_0x6e97('0x9f')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils[_0x6e97('0xcd')](_0xd8ae91)['catch'](loggerCatch(_0x6e97('0x136')));}if(_0x476713&&_0x476713[_0x6e97('0xc1')]!==_0x6e97('0xc2')&&!isNotNull(this[_0x6e97('0x21')][_0x476713[_0x6e97('0xc3')]][_0x6e97('0x139')])){delete this['uniqueId'][_0x1a105a[_0x6e97('0xc0')]];this[_0x6e97('0x101')](this[_0x6e97('0x21')][_0x476713[_0x6e97('0xc3')]]);this[_0x6e97('0x21')][_0x476713['queue']][_0x6e97('0x13a')]+=0x1;_0xd8ae91=new Hangup(_0x476713,_0x1a105a);_0xd8ae91[_0x6e97('0xe8')]=0xc;_0xd8ae91[_0x6e97('0x6d')]=_0x1a105a[_0x6e97('0x13b')];_0xd8ae91[_0x6e97('0x119')]=_0x6e97('0x13c');hopperUtils[_0x6e97('0xcb')](_0xd8ae91)['catch'](loggerCatch(_0x6e97('0x135')));hopperUtils[_0x6e97('0xcd')](_0xd8ae91)['catch'](loggerCatch(_0x6e97('0x136')));}};Dialer[_0x6e97('0x1b')][_0x6e97('0xa')]=function(_0xc9236){var _0x2173b1=this;if(!_0x2173b1[_0x6e97('0x2d')][_0xc9236[_0x6e97('0x60')]]){_0x2173b1[_0x6e97('0x2d')][_0xc9236[_0x6e97('0x60')]]={'running':![]};}else if(_0x2173b1[_0x6e97('0x2d')][_0xc9236[_0x6e97('0x60')]][_0x6e97('0x13d')]===!![]){return;}else if(_0x2173b1['queuesSummary'][_0xc9236[_0x6e97('0x60')]][_0x6e97('0x13d')]===![]){_0x2173b1[_0x6e97('0x2d')][_0xc9236[_0x6e97('0x60')]][_0x6e97('0x13d')]=!![];}var _0x1823ec=_0x2173b1[_0x6e97('0x21')][_0xc9236[_0x6e97('0x60')]];var _0x302153=_0x1823ec['message']!==utils['CAMPAIGN_STATUS']['INACTIVE'];var _0x198246=utils[_0x6e97('0x13e')](_0x1823ec);_0x1823ec[_0x6e97('0x13f')]=utils[_0x6e97('0x140')](_0x1823ec,_0x2173b1[_0x6e97('0x24')]);Promise[_0x6e97('0x141')]()[_0x6e97('0x3f')](function(){if(_0x1823ec[_0x6e97('0x13f')]===utils[_0x6e97('0x69')]['INACTIVE']){if(_0x302153){clearPredictiveAttributes(_0x1823ec);_0xc9236[_0x6e97('0x2a')]=undefined;_0xc9236[_0x6e97('0x5f')]=undefined;}if(_0x1823ec['statusMessage']===utils[_0x6e97('0x69')][_0x6e97('0x79')]){_0xc9236['available']=0x0;_0xc9236[_0x6e97('0xfa')]=0x0;_0xc9236[_0x6e97('0x142')]=0x0;_0xc9236[_0x6e97('0x143')]=0x0;_0xc9236[_0x6e97('0x144')]=0x0;}}else if(_0x1823ec[_0x6e97('0x13f')]===utils[_0x6e97('0x69')]['ACTIVE']&&!_0x198246){return _0x2173b1[_0x6e97('0x8f')](_0x1823ec,!![])['then'](function(){return _0x2173b1[_0x6e97('0x8f')](_0x1823ec,![]);})[_0x6e97('0x3f')](function(){return _0x2173b1[_0x6e97('0xb0')](_0x1823ec);})[_0x6e97('0x9f')](function(_0x52949b){loggerSyncQueueSummary[_0x6e97('0x43')]('[syncQueueSummary]',util[_0x6e97('0x67')](_0x52949b,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x1823ec);});}else{clearPredictiveAttributes(_0x1823ec);}})['then'](function(){var _0x5eaa70=_0xc9236[_0x6e97('0x145')](_0x1823ec);if(_0x5eaa70||_0x1823ec['queueSummaryCountersUpdated']){_0x1823ec[_0x6e97('0x146')]=![];_0xc9236[_0x6e97('0x147')](_0x1823ec);Object[_0x6e97('0x148')](_0x1823ec,_0xc9236);emitOutboundVoiceQueueSummary(_0xc9236);}_0x2173b1[_0x6e97('0x2d')][_0x1823ec['name']][_0x6e97('0x13d')]=![];})[_0x6e97('0x9f')](function(_0x3b84ef){logger[_0x6e97('0x64')](_0x6e97('0x149'),util[_0x6e97('0x67')](_0x3b84ef,{'showHidden':![],'depth':null}));_0x2173b1[_0x6e97('0x2d')][_0x1823ec[_0x6e97('0x60')]]['running']=![];});};Dialer[_0x6e97('0x1b')]['syncQueueSummaryComplete']=_[_0x6e97('0x14a')](function(){var _0x454326=_['filter'](this['voiceQueues'],function(_0xa45588){return _0xa45588[_0x6e97('0x14b')];});var _0x55c38f=_[_0x6e97('0x14c')](this[_0x6e97('0x23')],function(_0x18c8c8){return _0x18c8c8[_0x6e97('0x14d')]&&_0x18c8c8[_0x6e97('0x85')]===_0x6e97('0x86');});if(_0x454326[_0x6e97('0x98')]>0x0&&_0x55c38f[_0x6e97('0x98')]>0x0){return Promise[_0x6e97('0x141')]()[_0x6e97('0x3f')](cmHopper[_0x6e97('0x14e')](_[_0x6e97('0x14f')](_0x454326,'id'),previewRecallmeReminderInterval,_[_0x6e97('0x14f')](_0x55c38f,'id')))[_0x6e97('0x3f')](function(_0x5d5447){for(var _0x1cc89c=0x0;_0x1cc89c<_0x5d5447[_0x6e97('0x98')];_0x1cc89c++){var _0x2ab964=_0x5d5447[_0x1cc89c][_0x6e97('0x150')]['name'];if(_0x2ab964)io['to'](util['format'](_0x6e97('0x151'),_0x2ab964))[_0x6e97('0x41')](_0x6e97('0x152'),{'hopper':_0x5d5447[_0x1cc89c]});}})[_0x6e97('0x9f')](function(_0x33bb4a){logger['error'](_0x6e97('0x153'),_0x33bb4a);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x6e97('0x1b')]['loopClearZombieChannels']=function(){var _0x811152=this;setInterval(function(){_0x811152[_0x6e97('0x154')](_0x811152[_0x6e97('0x28')],_0x6e97('0x155'));_0x811152[_0x6e97('0x154')](_0x811152[_0x6e97('0x27')],'[actions]');},0x32c8);};Dialer[_0x6e97('0x1b')][_0x6e97('0x154')]=function(_0x222335,_0x240375){var _0x51e296=this;for(var _0x49581b in _0x222335){if(typeof _0x222335[_0x49581b]!=='undefined'){this[_0x6e97('0x1f')]['enqueue'](function(){if(!_['isNil'](_0x222335[_0x49581b])){return ami[_0x6e97('0xa0')]({'action':'status','channel':_0x222335[_0x49581b][_0x6e97('0xf4')]})['catch'](function(_0x53345e){if(_0x53345e['message']==='No\x20such\x20channel'){setTimeout(function(){if(_0x222335[_0x49581b]&&_0x222335[_0x49581b]['type']!==_0x6e97('0xc2')){_0x51e296[_0x6e97('0x101')](_0x51e296['voiceQueues'][_0x222335[_0x49581b][_0x6e97('0xc3')]]);logger[_0x6e97('0x64')](_0x6e97('0x156'),_0x240375,_0x49581b,_0x222335[_0x49581b][_0x6e97('0xc3')]);delete _0x222335[_0x49581b];}if(_0x222335[_0x49581b]&&_0x222335[_0x49581b][_0x6e97('0xc1')]==='ivr'){_0x51e296[_0x6e97('0x101')](_0x51e296[_0x6e97('0x22')][_0x222335[_0x49581b][_0x6e97('0xc3')]]);logger[_0x6e97('0x64')](_0x6e97('0x157'),_0x240375,_0x49581b,_0x222335[_0x49581b][_0x6e97('0xc3')]);delete _0x222335[_0x49581b];}},0x2328);}});}});}}};Dialer['prototype'][_0x6e97('0x158')]=function(_0x5df532){return Promise[_0x6e97('0x141')]()[_0x6e97('0x3f')](voiceQueueRt[_0x6e97('0x158')](_0x5df532))[_0x6e97('0x9f')](loggerCatch(_0x6e97('0x159')));};Dialer[_0x6e97('0x1b')]['updateOriginated']=function(_0x51b193){if(!_[_0x6e97('0x52')](_0x51b193)&&_0x51b193!==null){if(typeof _0x51b193[_0x6e97('0x7b')]!=='undefined'){if(_0x51b193['originated']>0x0){_0x51b193[_0x6e97('0x7b')]-=0x1;}else{logger['error']('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x6e97('0x64')](_0x6e97('0x15a'));}};Dialer[_0x6e97('0x1b')]['loggerHandler']=function(_0x4dc2dd,_0x25a652){var _0x5e92ed=this;return function(_0x59137f){_0x5e92ed[_0x6e97('0x101')](_0x25a652);logger[_0x6e97('0x64')](_0x4dc2dd,util['inspect'](_0x59137f,{'showHidden':![],'depth':null}));};};Dialer[_0x6e97('0x1b')]['emptyContact']=function(_0x36fa79,_0x4045bc,_0x15a4c1){var _0x5d9c32={'state':0x19,'statedesc':'notFound'};this[_0x6e97('0x101')](_0x4045bc);this[_0x6e97('0x11d')](_['merge'](_0x5d9c32,_[_0x6e97('0x73')](_0x15a4c1,[_0x6e97('0xe4'),_0x6e97('0xe5'),_0x6e97('0x15b'),'VoiceQueueId','CampaignId'])),_0x6e97('0x15c'),'[emptyContact]');logger[_0x6e97('0x64')](_0x36fa79);};Dialer[_0x6e97('0x1b')][_0x6e97('0x11d')]=function(_0x580170,_0x47efde,_0x521ad4){hopperUtils[_0x6e97('0xcb')](_0x580170)[_0x6e97('0x9f')](loggerCatch(_0x47efde));hopperUtils['moveContactManagedDialer'](_0x580170)[_0x6e97('0x9f')](loggerCatch(_0x521ad4));};Dialer[_0x6e97('0x1b')][_0x6e97('0xf0')]=function(_0xc28774,_0x365a2d){hopperUtils[_0x6e97('0xcb')](_0xc28774)[_0x6e97('0x9f')](loggerCatch(_0x6e97('0xcc')));if(_0x365a2d==0x0){hopperUtils[_0x6e97('0xcd')](_0xc28774)[_0x6e97('0x9f')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));}};Dialer['prototype'][_0x6e97('0x153')]=function(_0x5bb913){return Promise[_0x6e97('0x141')]()[_0x6e97('0x3f')](cmHopper['handlePreviewRecallNotifications'](_0x5bb913['id'],previewRecallmeReminderInterval))['then'](function(_0x7ed534){for(var _0xb97a23=0x0;_0xb97a23<_0x7ed534[_0x6e97('0x98')];_0xb97a23++){var _0x61db8=_0x7ed534[_0xb97a23]['Agent'][_0x6e97('0x60')];if(_0x61db8)io['to'](util[_0x6e97('0x45')](_0x6e97('0x151'),_0x61db8))[_0x6e97('0x41')](_0x6e97('0x152'),{'hopper':_0x7ed534[_0xb97a23]});}})['catch'](function(){});};Dialer[_0x6e97('0x1b')]['launchHandleIvr']=function(_0xb6cb37){var _0x45b720=this;return function(){_0x45b720[_0x6e97('0x15d')](_0xb6cb37);};};Dialer[_0x6e97('0x1b')][_0x6e97('0x15e')]=function(_0x4d4a56,_0x1dabf3){var _0x46e190=this;var _0x1be21b=uuid['v4']();this[_0x6e97('0x27')][_0x1be21b]=new Action(_0x4d4a56,_0x1dabf3,_0x1be21b);return new Promise(function(_0x161970,_0x27953a){if(_[_0x6e97('0x52')](_0x4d4a56)&&typeof _0x4d4a56!==_0x6e97('0x15f')){return _0x27953a(msgResponse('originate',_0x6e97('0x92'),_0x6e97('0x160')));}if(_[_0x6e97('0x52')](_0x1dabf3[_0x6e97('0x161')])||_0x1dabf3[_0x6e97('0x161')]===null){return _0x27953a(msgResponse('originate',_0x6e97('0x92'),_0x6e97('0x162')));}var _0xa938d6={'XMD-CALLERID':_0x46e190[_0x6e97('0x27')][_0x1be21b][_0x6e97('0x163')](),'XMD-AGI':_0x4d4a56[_0x6e97('0x139')]?util['format'](_0x6e97('0x164'),ipAgi,_0x4d4a56['dialQueueProject']):_0x6e97('0x165'),'XMD-AGIAFTER':_0x4d4a56[_0x6e97('0xc9')]?util['format'](_0x6e97('0x164'),ipAgi,_0x4d4a56[_0x6e97('0xc9')]):_0x6e97('0x165'),'XMD-QUEUE':utils[_0x6e97('0x166')](_0x4d4a56)?util[_0x6e97('0x45')]('\x22%s,%s%s,,,%s\x22',_0x4d4a56[_0x6e97('0x60')],_0x4d4a56[_0x6e97('0x167')]||'',_0x4d4a56['dialAgiAfterHangupAgent']?'c':'',_0x4d4a56[_0x6e97('0xd2')]||0x3):_0x6e97('0x165'),'XMD-CONTACTID':_0x1dabf3[_0x6e97('0xe4')],'XMD-CDRTYPE':_0x6e97('0x7'),'CALLERID(all)':_0x46e190[_0x6e97('0x27')][_0x1be21b][_0x6e97('0x163')](),'XMD-AMD':_0x4d4a56['dialAMDActive']?_0x6e97('0x168'):_0x6e97('0x165'),'XMD-DESTINATION':_0x6e97('0x113')};if(_0x4d4a56[_0x6e97('0x114')]){_0xa938d6[_0x6e97('0x169')]=_0x4d4a56[_0x6e97('0x16a')]||0x9c4;_0xa938d6[_0x6e97('0x16b')]=_0x4d4a56[_0x6e97('0x16c')]||0x5dc;_0xa938d6[_0x6e97('0x16d')]=_0x4d4a56[_0x6e97('0x16e')]||0x320;_0xa938d6['XMD-AMDTOTALANALYSISTIME']=_0x4d4a56[_0x6e97('0x16f')]||0x1388;_0xa938d6[_0x6e97('0x170')]=_0x4d4a56[_0x6e97('0x171')]||0x64;_0xa938d6[_0x6e97('0x172')]=_0x4d4a56['dialAMDBetweenWordsSilence']||0x32;_0xa938d6[_0x6e97('0x173')]=_0x4d4a56[_0x6e97('0x174')]||0x3;_0xa938d6['XMD-AMDSILENCETHRESHOLD']=_0x4d4a56[_0x6e97('0x175')]||0x100;_0xa938d6[_0x6e97('0x176')]=_0x4d4a56[_0x6e97('0x177')]||0x1388;}if(utils[_0x6e97('0x166')](_0x4d4a56)){_0xa938d6[_0x6e97('0x178')]=_0x1dabf3[_0x6e97('0xe6')];}else{_0xa938d6[_0x6e97('0x179')]=_0x1dabf3[_0x6e97('0x108')];}var _0x3ed812=utils['setXMDContactVariables'](_0x1dabf3[_0x6e97('0x17a')]);Object['assign'](_0xa938d6,_0x3ed812);var _0x360141=_0x46e190[_0x6e97('0x82')](_0x4d4a56['Trunk'])?utils[_0x6e97('0x17b')](_0x4d4a56['Trunk'][_0x6e97('0x17c')],_0x4d4a56[_0x6e97('0x17d')],_0x4d4a56[_0x6e97('0x17e')]>0x0?utils[_0x6e97('0x17f')](_0x4d4a56[_0x6e97('0x180')],_0x4d4a56['dialRandomLastDigitCallerIdNumber']):_0x4d4a56[_0x6e97('0x180')]):utils['getCallerId'](_['isNil'](_0x4d4a56[_0x6e97('0x89')])?_0x4d4a56['Trunk'][_0x6e97('0x17c')]:_0x4d4a56[_0x6e97('0x89')]['callerid'],_0x4d4a56[_0x6e97('0x17d')],_0x4d4a56['dialRandomLastDigitCallerIdNumber']>0x0?utils[_0x6e97('0x17f')](_0x4d4a56[_0x6e97('0x180')],_0x4d4a56[_0x6e97('0x17e')]):_0x4d4a56[_0x6e97('0x180')]);if(_0x360141){_0xa938d6[_0x6e97('0x181')]=_0x46e190[_0x6e97('0x27')][_0x1be21b][_0x6e97('0x182')]=utils[_0x6e97('0x183')](_0x360141);_0xa938d6[_0x6e97('0x184')]=_0x1dabf3['phone'];}_0x4d4a56[_0x6e97('0x185')]=_0xa938d6;return ami[_0x6e97('0xa0')]({'actionid':_0x1be21b,'action':'originate','channel':_0x46e190[_0x6e97('0x82')](_0x4d4a56[_0x6e97('0x88')])?util['format'](_0x6e97('0x186'),_0x4d4a56[_0x6e97('0x88')]['name'],isNotNull(_0x4d4a56[_0x6e97('0x187')])?_0x4d4a56[_0x6e97('0x187')][_0x6e97('0x188')]()||'':'',_0x4d4a56['dialCutDigit']>0x0?_0x1dabf3[_0x6e97('0x161')][_0x6e97('0x189')](_0x4d4a56['dialCutDigit']):_0x1dabf3[_0x6e97('0x161')]):util[_0x6e97('0x45')](_0x6e97('0x186'),_[_0x6e97('0xf8')](_0x4d4a56[_0x6e97('0x89')])?_0x4d4a56['Trunk'][_0x6e97('0x60')]:_0x4d4a56[_0x6e97('0x89')][_0x6e97('0x60')],isNotNull(_0x4d4a56[_0x6e97('0x187')])?_0x4d4a56['dialPrefix'][_0x6e97('0x188')]()||'':'',_0x4d4a56[_0x6e97('0x18a')]>0x0?_0x1dabf3[_0x6e97('0x161')][_0x6e97('0x189')](_0x4d4a56[_0x6e97('0x18a')]):_0x1dabf3[_0x6e97('0x161')]),'callerid':_0x360141,'Exten':_0x6e97('0x113'),'Context':_0x6e97('0x18b'),'Priority':'1','variable':_0xa938d6,'timeout':(_0x4d4a56['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x1be21b})['then'](function(_0x408c9c){return _0x161970(_0x408c9c);})[_0x6e97('0x9f')](function(_0x30ef9e){_0x4d4a56[_0x6e97('0x18c')]+=0x1;var _0x5a3b33=new History(_0x46e190[_0x6e97('0x27')][_0x1be21b]);logger[_0x6e97('0x64')](util[_0x6e97('0x45')](_0x6e97('0x18d'),JSON[_0x6e97('0x72')](_0x30ef9e)));_0x5a3b33['state']=0xe;_0x5a3b33['statedesc']=_0x6e97('0x18e');_0x5a3b33[_0x6e97('0x6f')]=moment()[_0x6e97('0x45')]('YYYY-MM-DD\x20HH:mm:ss');_0x5a3b33[_0x6e97('0x6e')]=_0x5a3b33[_0x6e97('0x6f')];hopperUtils[_0x6e97('0xcb')](_0x5a3b33)[_0x6e97('0x9f')](loggerCatch(_0x6e97('0x18f')));_0x46e190[_0x6e97('0xcd')](_0x5a3b33)['catch'](loggerCatch(_0x6e97('0x18f')))[_0x6e97('0x1e')](function(){delete _0x46e190[_0x6e97('0x27')][_0x1be21b];return _0x27953a(msgResponse(_0x6e97('0x190'),_0x6e97('0x81'),_0x6e97('0x191')));});});});};Dialer[_0x6e97('0x1b')][_0x6e97('0x192')]=function(_0x48a177,_0x9301a9,_0x17ea71){var _0x5519c1=new History(_0x9301a9);if(_0x5519c1[_0x6e97('0x130')]+_0x5519c1[_0x6e97('0x125')]+_0x5519c1[_0x6e97('0x126')]+_0x5519c1[_0x6e97('0x127')]+_0x5519c1['countdropretry']+_0x5519c1['countabandonedretry']+_0x5519c1[_0x6e97('0x122')]+_0x5519c1[_0x6e97('0x128')]>=_0x17ea71[_0x6e97('0x131')]-0x1){return!![];}switch(_0x48a177){case 0x3:if(_0x5519c1[_0x6e97('0x126')]>=_0x17ea71[_0x6e97('0x193')]-0x1){return!![];}hopperUtils[_0x6e97('0xe1')]({'active':![],'countnoanswerretry':_0x5519c1[_0x6e97('0x126')]+=0x1,'scheduledat':moment()[_0x6e97('0xe2')](_0x17ea71[_0x6e97('0x194')],_0x6e97('0xe3'))[_0x6e97('0x45')](_0x6e97('0xc5')),'ContactId':_0x5519c1['ContactId'],'ListId':_0x5519c1['ListId'],'VoiceQueueId':_0x5519c1[_0x6e97('0xe6')]||undefined,'CampaignId':_0x5519c1[_0x6e97('0x108')]||undefined})[_0x6e97('0x9f')](loggerCatch(_0x6e97('0x195')));break;case 0x5:if(_0x5519c1[_0x6e97('0x130')]>=_0x17ea71[_0x6e97('0x196')]-0x1){return!![];}hopperUtils[_0x6e97('0xe1')]({'active':![],'countbusyretry':_0x5519c1[_0x6e97('0x130')]+=0x1,'scheduledat':moment()['add'](_0x17ea71[_0x6e97('0x197')],_0x6e97('0xe3'))['format'](_0x6e97('0xc5')),'ContactId':_0x5519c1[_0x6e97('0xe4')],'ListId':_0x5519c1[_0x6e97('0xe5')],'VoiceQueueId':_0x5519c1[_0x6e97('0xe6')]||undefined,'CampaignId':_0x5519c1[_0x6e97('0x108')]||undefined})[_0x6e97('0x9f')](loggerCatch(_0x6e97('0x198')));break;case 0x8:if(_0x5519c1[_0x6e97('0x125')]>=_0x17ea71['dialCongestionMaxRetry']-0x1){return!![];}hopperUtils[_0x6e97('0xe1')]({'active':![],'countcongestionretry':_0x5519c1[_0x6e97('0x125')]+=0x1,'scheduledat':moment()['add'](_0x17ea71['dialCongestionRetryFrequency'],'minutes')[_0x6e97('0x45')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5519c1['ContactId'],'ListId':_0x5519c1[_0x6e97('0xe5')],'VoiceQueueId':_0x5519c1[_0x6e97('0xe6')]||undefined,'CampaignId':_0x5519c1[_0x6e97('0x108')]||undefined})[_0x6e97('0x9f')](loggerCatch(_0x6e97('0x199')));break;case 0x0:if(_0x5519c1[_0x6e97('0x127')]>=_0x17ea71['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{hopperUtils['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x5519c1[_0x6e97('0x127')]+=0x1,'scheduledat':moment()[_0x6e97('0xe2')](_0x17ea71[_0x6e97('0x19a')],'minutes')[_0x6e97('0x45')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5519c1[_0x6e97('0xe4')],'ListId':_0x5519c1[_0x6e97('0xe5')],'VoiceQueueId':_0x5519c1[_0x6e97('0xe6')]||undefined,'CampaignId':_0x5519c1[_0x6e97('0x108')]||undefined})['catch'](loggerCatch(_0x6e97('0x19b')));}break;case 0xa:if(_0x5519c1[_0x6e97('0xd9')]>=_0x17ea71[_0x6e97('0xe0')]-0x1){return!![];}hopperUtils[_0x6e97('0xe1')]({'active':![],'countdropretry':_0x5519c1[_0x6e97('0xd9')]+=0x1,'scheduledat':moment()[_0x6e97('0xe2')](_0x17ea71['dialDropRetryFrequency'],'minutes')[_0x6e97('0x45')](_0x6e97('0xc5')),'ContactId':_0x5519c1[_0x6e97('0xe4')],'ListId':_0x5519c1[_0x6e97('0xe5')],'VoiceQueueId':_0x5519c1[_0x6e97('0xe6')]||undefined,'CampaignId':_0x5519c1[_0x6e97('0x108')]||undefined})[_0x6e97('0x9f')](loggerCatch(_0x6e97('0xe7')));break;case 0xb:if(_0x5519c1[_0x6e97('0xf1')]>=_0x17ea71['dialAbandonedMaxRetry']-0x1){return!![];}hopperUtils[_0x6e97('0xe1')]({'active':![],'countabandonedretry':_0x5519c1[_0x6e97('0xf1')]+=0x1,'scheduledat':moment()[_0x6e97('0xe2')](_0x17ea71[_0x6e97('0xee')],'minutes')['format'](_0x6e97('0xc5')),'ContactId':_0x5519c1['ContactId'],'ListId':_0x5519c1[_0x6e97('0xe5')],'VoiceQueueId':_0x5519c1[_0x6e97('0xe6')]||undefined,'CampaignId':_0x5519c1[_0x6e97('0x108')]||undefined})[_0x6e97('0x9f')](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x5519c1[_0x6e97('0x122')]>=_0x17ea71[_0x6e97('0x12a')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x5519c1[_0x6e97('0x122')]+=0x1,'scheduledat':moment()['add'](_0x17ea71[_0x6e97('0x132')],_0x6e97('0xe3'))['format'](_0x6e97('0xc5')),'ContactId':_0x5519c1[_0x6e97('0xe4')],'ListId':_0x5519c1[_0x6e97('0xe5')],'VoiceQueueId':_0x5519c1[_0x6e97('0xe6')]||undefined,'CampaignId':_0x5519c1[_0x6e97('0x108')]||undefined})[_0x6e97('0x9f')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x5519c1[_0x6e97('0x128')]>=_0x17ea71[_0x6e97('0x19c')]-0x1){return!![];}hopperUtils[_0x6e97('0xe1')]({'active':![],'countagentrejectretry':_0x5519c1[_0x6e97('0x128')]+=0x1,'scheduledat':moment()[_0x6e97('0xe2')](_0x17ea71[_0x6e97('0x19d')],'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5519c1['ContactId'],'ListId':_0x5519c1[_0x6e97('0xe5')],'VoiceQueueId':_0x5519c1['VoiceQueueId']||undefined,'CampaignId':_0x5519c1[_0x6e97('0x108')]||undefined})['catch'](loggerCatch(_0x6e97('0x19e')));break;default:return!![];}};Dialer[_0x6e97('0x1b')][_0x6e97('0x10e')]=function(_0x87dacc,_0x314baa,_0x31a39c){var _0x354342=this;var _0x3e3155=new History(_0x87dacc);var _0x45182b=![];var _0x505412;var _0x4e4ce5;return new Promise(function(_0xf37948,_0x4d6c58){if(_['isUndefined'](_0x314baa)&&typeof _0x314baa!==_0x6e97('0x15f')){return _0x4d6c58(msgResponse(_0x6e97('0x19f'),_0x6e97('0x92'),_0x6e97('0x1a0')));}if(_[_0x6e97('0x52')](_0x31a39c)&&typeof _0x31a39c!==_0x6e97('0x15f')){return _0x4d6c58(msgResponse(_0x6e97('0x19f'),_0x6e97('0x92'),'evt\x20is\x20undefine'));}hopperUtils[_0x6e97('0xdd')](_0x3e3155,_0x31a39c[_0x6e97('0xc7')],_0x314baa)[_0x6e97('0x3f')](function(_0x3a9c74){if(_0x3a9c74[_0x6e97('0xdf')]==0x1)_0x45182b=!![];switch(_0x31a39c[_0x6e97('0xc7')]){case'0':_0x314baa[_0x6e97('0x1a1')]+=0x1;_0x3e3155[_0x6e97('0xe8')]=0x0;_0x3e3155[_0x6e97('0x6d')]=_0x6e97('0x1a2');_0x3e3155[_0x6e97('0x127')]+=0x1;_0x3e3155[_0x6e97('0xda')]+=0x1;ami[_0x6e97('0x41')](_0x6e97('0x1a3'),ut['buildObj'](_0x87dacc,_0x6e97('0x1a4')));_0x505412=_0x314baa[_0x6e97('0x19a')];_0x4e4ce5=_0x314baa['callAdditionalPhoneAfterMin'];hopperUtils['createHistory'](_0x3e3155)[_0x6e97('0x9f')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x354342['checkRetriveMax'](0x0,_0x87dacc,_0x314baa)&&!_0x45182b){if(_0x3e3155['countnosuchnumberretry']>=_0x314baa['dialNoSuchNumberMaxRetry']){_0x354342[_0x6e97('0x12b')](_0x3e3155,_0xf37948,_0x4d6c58,_0x6e97('0x1a5'));}else{_0x354342['stateGlobal'](_0x3e3155,_0xf37948,_0x4d6c58,_0x6e97('0x1a5'));}}break;case'3':_0x314baa['outboundNoAnswerCallsDay']+=0x1;_0x3e3155[_0x6e97('0xe8')]=0x3;_0x3e3155[_0x6e97('0x6d')]=_0x6e97('0x1a6');_0x3e3155[_0x6e97('0x126')]+=0x1;_0x3e3155[_0x6e97('0xda')]+=0x1;var _0x4034fb=ut[_0x6e97('0x1a7')](_0x87dacc,_0x314baa);ami[_0x6e97('0x41')](_0x6e97('0x1a8'),_0x4034fb);_0x505412=_0x314baa['dialNoAnswerRetryFrequency'];_0x4e4ce5=_0x314baa['callAdditionalPhoneAfterMin'];hopperUtils[_0x6e97('0xcb')](_0x3e3155)[_0x6e97('0x9f')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x354342['checkRetriveMax'](0x3,_0x87dacc,_0x314baa)&&!_0x45182b){if(_0x3e3155[_0x6e97('0x126')]>=_0x314baa[_0x6e97('0x193')]){_0x354342[_0x6e97('0x12b')](_0x3e3155,_0xf37948,_0x4d6c58,_0x6e97('0x1a9'));}else{_0x354342[_0x6e97('0x129')](_0x3e3155,_0xf37948,_0x4d6c58,_0x6e97('0x1a9'));}}break;case'5':_0x314baa[_0x6e97('0x1aa')]+=0x1;_0x3e3155[_0x6e97('0xe8')]=0x5;_0x3e3155[_0x6e97('0x6d')]='Busy';_0x3e3155[_0x6e97('0x130')]+=0x1;_0x3e3155[_0x6e97('0xda')]+=0x1;ami[_0x6e97('0x41')](_0x6e97('0x1ab'),ut[_0x6e97('0x123')](_0x87dacc,_0x6e97('0x1ac')));_0x505412=_0x314baa[_0x6e97('0x197')];_0x4e4ce5=_0x314baa[_0x6e97('0xdc')];hopperUtils[_0x6e97('0xcb')](_0x3e3155)[_0x6e97('0x9f')](loggerCatch(_0x6e97('0x1ad')));if(_0x354342[_0x6e97('0x192')](0x5,_0x87dacc,_0x314baa)&&!_0x45182b){if(_0x3e3155[_0x6e97('0x130')]>=_0x314baa[_0x6e97('0x196')]){_0x354342[_0x6e97('0x12b')](_0x3e3155,_0xf37948,_0x4d6c58,_0x6e97('0x1ae'));}else{_0x354342['stateGlobal'](_0x3e3155,_0xf37948,_0x4d6c58,_0x6e97('0x1ae'));}}break;case'8':_0x314baa[_0x6e97('0x1af')]+=0x1;_0x3e3155['state']=0x8;_0x3e3155[_0x6e97('0x6d')]=_0x6e97('0x1b0');_0x3e3155[_0x6e97('0x125')]+=0x1;_0x3e3155[_0x6e97('0xda')]+=0x1;_0x505412=_0x314baa[_0x6e97('0x1b1')];_0x4e4ce5=_0x314baa[_0x6e97('0xdc')];ami[_0x6e97('0x41')](_0x6e97('0x1b2'),ut[_0x6e97('0x123')](_0x87dacc,'congestion'));hopperUtils[_0x6e97('0xcb')](_0x3e3155)[_0x6e97('0x9f')](loggerCatch(_0x6e97('0x1b3')));if(_0x354342['checkRetriveMax'](0x8,_0x87dacc,_0x314baa)&&!_0x45182b){if(_0x3e3155[_0x6e97('0x125')]>=_0x314baa[_0x6e97('0x1b4')]){_0x354342[_0x6e97('0x12b')](_0x3e3155,_0xf37948,_0x4d6c58,'reason\x208\x20congestion');}else{_0x354342[_0x6e97('0x129')](_0x3e3155,_0xf37948,_0x4d6c58,_0x6e97('0x1b5'));}}break;case'11':_0x314baa['outboundAbandonedCallsDay']+=0x1;_0x3e3155['state']=0xb;_0x3e3155[_0x6e97('0x6d')]=_0x6e97('0xed');_0x3e3155[_0x6e97('0xf1')]+=0x1;_0x3e3155[_0x6e97('0xda')]+=0x1;_0x505412=_0x314baa[_0x6e97('0xee')];_0x4e4ce5=_0x314baa['callAdditionalPhoneAfterMin'];hopperUtils[_0x6e97('0xcb')](_0x3e3155)['catch'](loggerCatch(_0x6e97('0xf2')));if(_0x354342['checkRetriveMax'](0xb,_0x87dacc,_0x314baa)&&!_0x45182b){if(_0x3e3155[_0x6e97('0xf1')]>=_0x314baa[_0x6e97('0xef')]){_0x354342[_0x6e97('0x12b')](_0x3e3155,_0xf37948,_0x4d6c58,_0x6e97('0x1b6'));}else{_0x354342[_0x6e97('0x129')](_0x3e3155,_0xf37948,_0x4d6c58,_0x6e97('0x1b6'));}}break;case'20':_0x314baa['outboundRejectCallsDay']+=0x1;_0x3e3155[_0x6e97('0xe8')]=0x14;_0x3e3155[_0x6e97('0x6d')]=_0x6e97('0x1b7');_0x3e3155[_0x6e97('0x128')]+=0x1;_0x3e3155[_0x6e97('0xda')]+=0x1;_0x505412=_0x314baa['dialAgentRejectRetryFrequency'];_0x4e4ce5=_0x314baa[_0x6e97('0xdc')];ami[_0x6e97('0x41')](_0x6e97('0x1b8'),ut['buildObj'](_0x87dacc,_0x6e97('0x1b9')));hopperUtils['createHistory'](_0x3e3155)[_0x6e97('0x9f')](loggerCatch(_0x6e97('0x1ba')));if(_0x354342[_0x6e97('0x192')](0x14,_0x87dacc,_0x314baa)&&!_0x45182b){if(_0x3e3155['countagentrejectretry']>=_0x314baa['dialAgentRejectMaxRetry']){_0x354342[_0x6e97('0x12b')](_0x3e3155,_0xf37948,_0x4d6c58,_0x6e97('0x1bb'));}else{_0x354342[_0x6e97('0x129')](_0x3e3155,_0xf37948,_0x4d6c58,_0x6e97('0x1bb'));}}break;default:_0x314baa[_0x6e97('0x13a')]+=0x1;_0x3e3155[_0x6e97('0xe8')]=0xc;_0x3e3155[_0x6e97('0x6d')]=_0x31a39c[_0x6e97('0xc7')];_0x505412=_0x314baa[_0x6e97('0x19d')];_0x4e4ce5=_0x314baa['callAdditionalPhoneAfterMin'];hopperUtils[_0x6e97('0xcb')](_0x3e3155)[_0x6e97('0x9f')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x354342['checkRetriveMax'](_0x31a39c[_0x6e97('0xc7')],_0x87dacc,_0x314baa)&&!_0x45182b){if(_0x3e3155['countbusyretry']+_0x3e3155[_0x6e97('0x125')]+_0x3e3155[_0x6e97('0x126')]+_0x3e3155[_0x6e97('0x127')]+_0x3e3155[_0x6e97('0xd9')]+_0x3e3155[_0x6e97('0xf1')]+_0x3e3155[_0x6e97('0x122')]+_0x3e3155[_0x6e97('0x128')]>=_0x314baa['dialGlobalMaxRetry']){_0x354342[_0x6e97('0x129')](_0x3e3155,_0xf37948,_0x4d6c58,_0x31a39c['reason']);}else{_0x354342[_0x6e97('0x12b')](_0x3e3155,_0xf37948,_0x4d6c58,_0x31a39c['reason']);}}}})['then'](function(){if(_0x45182b){hopperUtils[_0x6e97('0xf3')](_0x3e3155,_0x505412,_0x4e4ce5)[_0x6e97('0x3f')](function(){return _0xf37948(0x1);});}});});};Dialer[_0x6e97('0x1b')]['stateGlobal']=function(_0x59205b,_0x476976,_0xb4111f,_0x1f0072){var _0x5d1412=new Final(_0x59205b);_0x5d1412[_0x6e97('0xe8')]=0xf;_0x5d1412[_0x6e97('0x6d')]=_0x6e97('0x1bc');this['createStateFinal'](_0x5d1412,_0x476976,_0xb4111f,_0x1f0072);};Dialer[_0x6e97('0x1b')][_0x6e97('0x12b')]=function(_0x2e3665,_0x18322a,_0xc610f6,_0x24a378){hopperUtils[_0x6e97('0xcd')](_0x2e3665)[_0x6e97('0x3f')](function(){return _0x18322a(msgResponse(_0x6e97('0x19f'),_0x6e97('0x1bd'),_0x24a378));})[_0x6e97('0x9f')](function(){return _0xc610f6(msgResponse('[moveContactManagedDialer][0]','Failure',_0x6e97('0x1be')));});};Dialer[_0x6e97('0x1b')][_0x6e97('0x9')]=function(_0x26b4d1){var _0x5d3a70=_0x26b4d1[_0x6e97('0x1bf')]/0x64;var _0x4dc5ff=_0x26b4d1[_0x6e97('0xd3')]/(_0x26b4d1['outboundDropCallsDayTimeout']+_0x26b4d1[_0x6e97('0x117')]);var _0x1705e6=Math[_0x6e97('0x1c0')](_0x26b4d1[_0x6e97('0x1c1')]*(_0x26b4d1[_0x6e97('0x1c2')]/0x64));var _0x44e73b=Math[_0x6e97('0x1c0')](_0x26b4d1['predictiveIntervalAvailable']*(_0x26b4d1[_0x6e97('0x1c3')]/0x64));var _0x31e5bf=_0x26b4d1[_0x6e97('0x1c4')]+_0x26b4d1[_0x6e97('0x143')];var _0x38f58b=Math[_0x6e97('0x1c5')](_0x26b4d1[_0x6e97('0x58')]*_0x26b4d1[_0x6e97('0x5c')]*_0x26b4d1[_0x6e97('0x1c6')]*_0x26b4d1['predictiveIntervalMultiplicativeFactor']);if(_['isUndefined'](_0x26b4d1['startProgressive'])){if(!_[_0x6e97('0x52')](_0x26b4d1[_0x6e97('0x2a')])){_0x26b4d1[_0x6e97('0x2a')]=undefined;loggerPredictive[_0x6e97('0x64')](_0x6e97('0x1c7'),_0x6e97('0x1c8'));}if(!_[_0x6e97('0x52')](_0x26b4d1['handlePredictive'])){loggerPredictive[_0x6e97('0x64')]('[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x26b4d1[_0x6e97('0x63')]);_0x26b4d1[_0x6e97('0x63')]=undefined;}_0x26b4d1[_0x6e97('0x5f')]=moment()['format'](_0x6e97('0xc5'));loggerPredictive[_0x6e97('0x48')](_0x26b4d1['name'],_0x6e97('0x1c9'),_0x26b4d1[_0x6e97('0x5f')]);this[_0x6e97('0xb3')](_0x26b4d1,0x1);}else if(ifInterval(_0x26b4d1[_0x6e97('0x1ca')],_0x26b4d1[_0x6e97('0x5f')])){this[_0x6e97('0xb3')](_0x26b4d1,0x1);loggerPredictiveCalls[_0x6e97('0x48')]('[startMethodPredictive][StartProgressive][Loop]',_0x26b4d1[_0x6e97('0x5f')],_0x26b4d1[_0x6e97('0x60')]);_0x26b4d1['erlangCalls']=0x0;_0x26b4d1[_0x6e97('0xd4')]=0x0;}else if(_0x5d3a70<_0x4dc5ff&&_0x26b4d1['dialPredictiveOptimization']==='dropRate'){clearPredictiveAttributes(_0x26b4d1);loggerPredictive[_0x6e97('0x48')](_0x6e97('0x1cb'),_0x6e97('0x1cc'),_0x4dc5ff,_0x6e97('0x5f'),_0x26b4d1[_0x6e97('0x60')]);}else if(_0x38f58b<_0x26b4d1[_0x6e97('0xd4')]&&_0x26b4d1[_0x6e97('0x1cd')]===_0x6e97('0x1ce')){clearPredictiveAttributes(_0x26b4d1);loggerPredictive[_0x6e97('0x48')]('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20',_0x38f58b,_0x6e97('0x1cf'),_0x26b4d1[_0x6e97('0xd4')],_0x6e97('0x5f'),_0x26b4d1[_0x6e97('0x60')]);}else if(!ifInterval(_0x26b4d1[_0x6e97('0x1ca')],_0x26b4d1[_0x6e97('0x5f')])&&_[_0x6e97('0x52')](_0x26b4d1[_0x6e97('0x2a')])&&!_[_0x6e97('0x52')](_0x26b4d1[_0x6e97('0x5f')])){_0x26b4d1[_0x6e97('0x2a')]=moment()['format'](_0x6e97('0xc5'));loggerPredictive[_0x6e97('0x48')](_0x26b4d1['name'],_0x6e97('0x1d0'),_0x26b4d1[_0x6e97('0x2a')]);hopperUtils['avgHandleTime'](_0x26b4d1[_0x6e97('0x1ca')])[_0x6e97('0x3f')](this[_0x6e97('0x1d1')](_0x26b4d1))['then'](mergeDataErlangB(_0x26b4d1))[_0x6e97('0x3f')](this[_0x6e97('0x1d2')](_0x26b4d1))[_0x6e97('0x9f')](loggerCatchPredictive(_0x6e97('0x1d3'),_0x26b4d1));}else if(!ifInterval(_0x26b4d1[_0x6e97('0x1ca')],_0x26b4d1[_0x6e97('0x2a')])){_0x26b4d1['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x26b4d1[_0x6e97('0x2a')]=moment()[_0x6e97('0x45')](_0x6e97('0xc5'));loggerPredictive[_0x6e97('0x48')](_0x26b4d1['name'],'recalculate\x20predictive\x20at',_0x26b4d1['startPredictive']);clearInterval(_0x26b4d1[_0x6e97('0x63')]);_0x26b4d1[_0x6e97('0x63')]=undefined;hopperUtils[_0x6e97('0x1d4')](_0x26b4d1[_0x6e97('0x1ca')])[_0x6e97('0x3f')](this[_0x6e97('0x1d1')](_0x26b4d1))['then'](mergeDataErlangB(_0x26b4d1))[_0x6e97('0x3f')](this[_0x6e97('0x1d2')](_0x26b4d1))[_0x6e97('0x9f')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x26b4d1));}else if(_0x26b4d1[_0x6e97('0x1c1')]&&_0x31e5bf<_0x26b4d1[_0x6e97('0x1c1')]-_0x44e73b){clearPredictiveAttributes(_0x26b4d1);loggerPredictive[_0x6e97('0x48')](_0x26b4d1[_0x6e97('0x60')],_0x6e97('0x1d5'),_0x31e5bf,_0x6e97('0x1d6'),_0x26b4d1[_0x6e97('0x1c1')],'-',_0x44e73b,'=',_0x26b4d1[_0x6e97('0x1c1')]-_0x44e73b,')');}else if(_0x26b4d1[_0x6e97('0x1c1')]&&_0x31e5bf>_0x26b4d1[_0x6e97('0x1c1')]+_0x1705e6){clearPredictiveAttributes(_0x26b4d1);loggerPredictive[_0x6e97('0x48')](_0x26b4d1['name'],_0x6e97('0x1d5'),_0x31e5bf,')\x20are\x20more\x20than\x20threshold\x20(',_0x26b4d1['predictiveIntervalAvailable'],'+',_0x1705e6,'=',_0x26b4d1['predictiveIntervalAvailable']+_0x1705e6,')');}};Dialer[_0x6e97('0x1b')][_0x6e97('0x1d1')]=function(_0x2a9405){var _0x92934c=this;return function(_0x32eb2f){return new Promise(function(_0x35c804,_0x17f0d9){_[_0x6e97('0xfc')](_0x2a9405,_0x32eb2f[0x0]);if(checkGetDataPredictive(_0x32eb2f[0x0])){var _0x3b9fea=_0x2a9405[_0x6e97('0x1c1')]=_0x2a9405[_0x6e97('0x143')]+_0x2a9405[_0x6e97('0x1c4')];var _0x143827=_0x2a9405[_0x6e97('0x1ca')]*0x3c;var _0x44edda=_0x32eb2f[0x0]['predictiveIntervalAvgTalktime']+_0x32eb2f[0x0][_0x6e97('0x4f')];var _0x1c8632=(_0x32eb2f[0x0][_0x6e97('0x4b')]+_0x32eb2f[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x32eb2f[0x0][_0x6e97('0x1d7')])/_0x32eb2f[0x0]['predictiveIntervalTotalCalls'];_0x2a9405['predictiveIntervalHitRate']=_0x1c8632>0x0?_0x1c8632:0x1;switch(_0x2a9405['dialPredictiveOptimization']){case _0x6e97('0x1ce'):var _0x3c8394=_0x2a9405[_0x6e97('0x1bf')]/0x64;return _0x92934c[_0x6e97('0x1d8')](_0x3b9fea,_0x143827,_0x44edda,_0x1c8632,_0x3c8394)[_0x6e97('0x3f')](function(_0x4590f7){return _0x35c804(_0x4590f7);});case'agentBusyFactor':var _0x54d0fc=_0x2a9405[_0x6e97('0x1bf')]/0x64;return _0x92934c[_0x6e97('0x1d9')](_0x3b9fea,_0x143827,_0x44edda,_0x1c8632,_0x54d0fc)[_0x6e97('0x3f')](function(_0x1f20ae){return _0x35c804(_0x1f20ae);});default:return _0x17f0d9(msgResponse(_0x6e97('0x1da'),'Failure','Unknown\x20Predictive'));}}else{return _0x17f0d9(msgResponse(_0x6e97('0x1da'),_0x6e97('0x92'),_0x6e97('0x1db')));}});};};Dialer[_0x6e97('0x1b')][_0x6e97('0x1dc')]=function(_0x625c86){var _0x261c77=this;return function(_0x2b21d1){return new Promise(function(_0x3394b9,_0xef3d3){_['merge'](_0x625c86,_0x2b21d1[0x0]);if(checkGetDataPredictive(_0x2b21d1[0x0])){loggerPredictive[_0x6e97('0x48')](JSON['stringify'](_0x2b21d1[0x0]));if(_0x625c86['dialPredictiveOptimization']==='dropRate'){return _0x261c77[_0x6e97('0x158')](_0x625c86['id'])[_0x6e97('0x3f')](function(_0x107f8d){var _0x2264cf=_0x625c86[_0x6e97('0x1dd')]-_0x107f8d[0x0][_0x6e97('0x1de')];var _0x1517a4=_0x625c86[_0x6e97('0x1ca')]*0x3c;var _0x5b3537=_0x2b21d1[0x0][_0x6e97('0x53')]+_0x2b21d1[0x0][_0x6e97('0x4f')];var _0x4b564f=(_0x2b21d1[0x0][_0x6e97('0x4b')]+_0x2b21d1[0x0][_0x6e97('0x4d')]+_0x2b21d1[0x0][_0x6e97('0x1d7')])/_0x2b21d1[0x0]['predictiveIntervalTotalCalls'];var _0x285a63=_0x625c86['dialPredictiveOptimizationPercentage']/0x64;_0x625c86[_0x6e97('0x1df')]=_0x107f8d[0x0][_0x6e97('0x1de')]||0x0;_0x625c86[_0x6e97('0x1c6')]=_0x4b564f>0x0?_0x4b564f:0x1;return _0x261c77[_0x6e97('0x1d8')](_0x2264cf,_0x1517a4,_0x5b3537,_0x4b564f,_0x285a63);})['then'](function(_0x4ac8f3){return _0x3394b9(_0x4ac8f3);})[_0x6e97('0x9f')](function(_0x58ebe7){return _0xef3d3(msgResponse(_0x6e97('0x1e0'),_0x6e97('0x92'),JSON['stringify'](_0x58ebe7)));});}if(_0x625c86[_0x6e97('0x1cd')]===_0x6e97('0x1e1')){return _0x261c77[_0x6e97('0x158')](_0x625c86['id'])[_0x6e97('0x3f')](function(_0x259f8c){var _0x47f739=_0x625c86[_0x6e97('0x1dd')]-_0x259f8c[0x0]['outboundQueuePauses'];var _0x51566b=_0x625c86[_0x6e97('0x1ca')]*0x3c;var _0x3deec8=_0x2b21d1[0x0][_0x6e97('0x53')]+_0x2b21d1[0x0][_0x6e97('0x4f')];var _0xe7a57d=(_0x2b21d1[0x0][_0x6e97('0x4b')]+_0x2b21d1[0x0][_0x6e97('0x4d')]+_0x2b21d1[0x0][_0x6e97('0x1d7')])/_0x2b21d1[0x0][_0x6e97('0x51')];var _0x369496=_0x625c86[_0x6e97('0x1bf')]/0x64;_0x625c86[_0x6e97('0x1df')]=_0x259f8c[0x0]['outboundQueuePauses']||0x0;_0x625c86['predictiveIntervalHitRate']=_0xe7a57d>0x0?_0xe7a57d:0x1;return _0x261c77[_0x6e97('0x1d9')](_0x47f739,_0x51566b,_0x3deec8,_0xe7a57d,_0x369496);})['then'](function(_0x18b356){return _0x3394b9(_0x18b356);})[_0x6e97('0x9f')](function(_0x17fa57){return _0xef3d3(msgResponse('[CatchErlangB]',_0x6e97('0x92'),JSON[_0x6e97('0x72')](_0x17fa57)));});}}else{return _0xef3d3(msgResponse(_0x6e97('0x1da'),_0x6e97('0x92'),_0x6e97('0x1db')));}});};};Dialer[_0x6e97('0x1b')][_0x6e97('0x1d2')]=function(_0x426b29){var _0x5517dd=this;return function(){var _0x4688b4=0x0;var _0x1640be=Math[_0x6e97('0x1c5')](_0x426b29[_0x6e97('0x5a')]*0x3e8);if(_0x1640be>0x0){_0x1640be=_0x1640be<0x64?0x64:_0x1640be;loggerPredictive[_0x6e97('0x48')](_0x426b29[_0x6e97('0x60')],_0x6e97('0x1e2'),_0x1640be,'milliseconds');_0x426b29['handlePredictive']=setInterval(function(){_0x5517dd[_0x6e97('0x63')](_0x426b29);loggerPredictiveCalls[_0x6e97('0x48')](_0x6e97('0x1e3'),_0x4688b4+=0x1);},_0x1640be);}else{loggerPredictive[_0x6e97('0x48')](_0x426b29[_0x6e97('0x60')],_0x6e97('0x1e4'));}};};Dialer['prototype'][_0x6e97('0x1e5')]=function(_0xb6bda0,_0x561cc7){var _0x122132=this;return function(_0x59a69a){if(_[_0x6e97('0x90')](_0x59a69a)){if(_[_0x6e97('0xf8')](_0x561cc7[_0x6e97('0x15b')])||!_0x561cc7['recallme']){if(_0xb6bda0[_0x6e97('0xb1')]==='booked'){_0xb6bda0[_0x6e97('0x70')]=_[_0x6e97('0x52')](_0xb6bda0[_0x6e97('0x70')])?!![]:_0xb6bda0['queueStatusComplete'];var _0x345dc1=uuid['v4']();_0x122132['actions'][_0x345dc1]=new Action(_0xb6bda0,_0x561cc7,_0x345dc1);loggerBooked[_0x6e97('0x48')](_0x6e97('0x1e6'),_0x345dc1,_0x6e97('0x1e7'),JSON[_0x6e97('0x72')](_0xb6bda0[_0x6e97('0x70')]),_0x6e97('0x1e8'),_0xb6bda0['name']);if(_0xb6bda0[_0x6e97('0x70')]){_0xb6bda0[_0x6e97('0x70')]=![];_0x122132[_0x6e97('0x2b')][_0x122132['actions'][_0x345dc1][_0x6e97('0xc3')]]=[];ami[_0x6e97('0xa0')]({'actionid':_0x345dc1,'action':_0x6e97('0x1e9'),'queue':_0xb6bda0[_0x6e97('0x60')]})[_0x6e97('0x9f')](function(){_0x122132[_0x6e97('0x101')](_0xb6bda0);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x122132[_0x6e97('0x27')][_0x345dc1][_0x6e97('0xe4')],'ListId':_0x122132[_0x6e97('0x27')][_0x345dc1]['ListId'],'VoiceQueueId':_0x122132[_0x6e97('0x27')][_0x345dc1]['VoiceQueueId']||undefined,'CampaignId':_0x122132['actions'][_0x345dc1][_0x6e97('0x108')]||undefined})[_0x6e97('0x9f')](loggerCatch(_0x6e97('0x1ea')));delete _0x122132['actions'][_0x345dc1];});}else{loggerBooked['info'](_0x6e97('0x1eb'),JSON['stringify'](_0xb6bda0[_0x6e97('0x70')]),_0x6e97('0x1e8'),_0xb6bda0[_0x6e97('0x60')]);_0x122132['updateOriginated'](_0xb6bda0);hopperUtils[_0x6e97('0xe1')]({'active':![],'ContactId':_0x122132[_0x6e97('0x27')][_0x345dc1]['ContactId'],'ListId':_0x122132[_0x6e97('0x27')][_0x345dc1][_0x6e97('0xe5')],'VoiceQueueId':_0x122132['actions'][_0x345dc1][_0x6e97('0xe6')]||undefined,'CampaignId':_0x122132[_0x6e97('0x27')][_0x345dc1][_0x6e97('0x108')]||undefined})[_0x6e97('0x9f')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x122132[_0x6e97('0x27')][_0x345dc1];}}else{return _0x122132[_0x6e97('0x15e')](_0xb6bda0,_0x561cc7);}}else{if(utils[_0x6e97('0x5e')](undefined,_0x561cc7['scheduledat'])<_0xb6bda0['dialRecallMeTimeout']*0x3c){if(_0x561cc7[_0x6e97('0x150')]&&!_0x561cc7[_0x6e97('0x150')][_0x6e97('0x1ec')]){_0x122132['preview'][_0x6e97('0xff')](_0x561cc7['id'])['finally'](function(){_0x122132[_0x6e97('0x101')](_0xb6bda0);});}else{hopperUtils['unlockContact']({'active':![]},_0x561cc7['id'],0x1)[_0x6e97('0x1e')](function(){_0x122132[_0x6e97('0x101')](_0xb6bda0);});}}else{_0xb6bda0['outboundReCallsDay']+=0x1;_0x122132[_0x6e97('0x101')](_0xb6bda0);if(_0xb6bda0[_0x6e97('0x1ed')]){hopperUtils[_0x6e97('0xe1')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x561cc7['ContactId'],'ListId':_0x561cc7[_0x6e97('0xe5')],'VoiceQueueId':_0x561cc7['VoiceQueueId']||undefined,'CampaignId':_0x561cc7[_0x6e97('0x108')]||undefined})[_0x6e97('0x9f')](loggerCatch(_0x6e97('0x1ee')));hopperUtils[_0x6e97('0xcb')](createObjHistory(_0xb6bda0,_0x561cc7,utils[_0x6e97('0x69')]['QUEUE_RECALL'],0x17,_0x6e97('0x1ef')))[_0x6e97('0x9f')](loggerCatch(_0x6e97('0x1f0')));}else{_0x122132[_0x6e97('0x11d')](createObjHistory(_0xb6bda0,_0x561cc7,utils[_0x6e97('0x69')][_0x6e97('0x1f1')],0x16,'RecallFailedTimeout'),'[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]');}}}}else{_0xb6bda0[_0x6e97('0x1f2')]+=0x1;_0x122132[_0x6e97('0x11d')](createObjHistory(_0xb6bda0,_0x561cc7,utils[_0x6e97('0x69')]['BLACKLIST'],0xd,_0x6e97('0x1f3')),_0x6e97('0x1f4'),'[Originate][MoveBlacklist]');throw _0x6e97('0x1f5');}};};Dialer[_0x6e97('0x1b')][_0x6e97('0x15d')]=function(_0x9c3827){var _0x2cd3a9=this;var _0x82f3ba=_0x9c3827[_0x6e97('0x1f6')]-_0x9c3827[_0x6e97('0x7b')];emitCampaignSummary(_0x9c3827);if(_0x82f3ba>0x0&&_0x9c3827['temp']==0x0){if(_0x82f3ba>this[_0x6e97('0x25')]){_0x82f3ba=this[_0x6e97('0x25')];}_0x9c3827[_0x6e97('0x1f7')]=0x1;hopperUtils['getContactDialerIvr'](_0x9c3827,_0x82f3ba)[_0x6e97('0x3f')](function(_0x225402){_0x9c3827['temp']=0x0;if(_0x225402){if(!utils[_0x6e97('0x1f8')](_0x225402)){_0x9c3827['message']=utils[_0x6e97('0x69')][_0x6e97('0x6c')];logger[_0x6e97('0x48')]('[getContactCampaign2][Empty]'+_0x9c3827[_0x6e97('0x60')]);}else{_0x9c3827[_0x6e97('0x7b')]+=_0x225402[_0x6e97('0x98')];_0x9c3827[_0x6e97('0x6b')]=utils[_0x6e97('0x69')][_0x6e97('0x1f9')];for(var _0x3b0d58=0x0;_0x3b0d58<_0x225402[_0x6e97('0x98')];_0x3b0d58+=0x1){_0x9c3827[_0x6e97('0x1fa')]+=0x1;if(_[_0x6e97('0xf8')](_0x225402[_0x3b0d58])||_[_0x6e97('0xf8')](_0x225402[_0x3b0d58][_0x6e97('0x17a')])||_[_0x6e97('0xf8')](_0x225402[_0x3b0d58][_0x6e97('0x161')])){_0x2cd3a9[_0x6e97('0x1fb')](_0x6e97('0x1fc'),_0x9c3827,_0x225402[_0x3b0d58]);}else{hopperUtils[_0x6e97('0x1fd')](_[_0x6e97('0x73')](_0x225402[_0x3b0d58],[_0x6e97('0x108'),_0x6e97('0x161')]))['then'](_0x2cd3a9[_0x6e97('0x1e5')](_0x9c3827,_0x225402[_0x3b0d58]))['catch'](_0x2cd3a9[_0x6e97('0x1fe')](_0x6e97('0x1ff'),_0x9c3827));}}}}})['catch'](loggerGetContactDialer(_0x6e97('0x200'),_0x9c3827,_0x82f3ba));}};Dialer[_0x6e97('0x1b')][_0x6e97('0xb3')]=function(_0x19d67e,_0x48b5cb){var _0x380c1c=this;var _0x460c72=[];if(_0x48b5cb<0x1||_0x19d67e[_0x6e97('0xb1')]===_0x6e97('0x8')){_0x48b5cb=0x1;}var _0x5f4da9=Math[_0x6e97('0x1c5')](_0x19d67e['available']*_0x48b5cb)-_0x19d67e[_0x6e97('0x7b')];if(_0x19d67e[_0x6e97('0x201')]>0x0){var _0x1aa7d7=_0x19d67e[_0x6e97('0x201')]-_0x19d67e[_0x6e97('0x7b')]-_0x19d67e[_0x6e97('0x143')]-_0x19d67e[_0x6e97('0x144')];if(_0x5f4da9>_0x1aa7d7){_0x5f4da9=_0x1aa7d7;}}if(_0x5f4da9>0x0&&_0x19d67e[_0x6e97('0x1f7')]==0x0){if(_0x19d67e['dialMethod']===_0x6e97('0x8')){_0x5f4da9=0x1;}if(_0x5f4da9>this[_0x6e97('0x25')]){_0x5f4da9=this[_0x6e97('0x25')];}for(var _0x5de55b in this[_0x6e97('0x23')]){if(typeof this[_0x6e97('0x23')][_0x5de55b]!==_0x6e97('0xaa')){if(this[_0x6e97('0x23')][_0x5de55b][_0x6e97('0xe8')]===_0x6e97('0x202')&&this[_0x6e97('0x23')][_0x5de55b][_0x6e97('0x85')]===_0x6e97('0x86')){_0x460c72[_0x6e97('0x99')](this[_0x6e97('0x23')][_0x5de55b]['id']);}}}_0x19d67e[_0x6e97('0x1f7')]=0x1;hopperUtils['getContactDialer'](_0x19d67e,_0x460c72,_0x5f4da9)[_0x6e97('0x3f')](function(_0x5779bc){_0x19d67e[_0x6e97('0x1f7')]=0x0;if(_0x5779bc){if(!utils[_0x6e97('0x1f8')](_0x5779bc)){hopperUtils['countReScheduled'](_0x19d67e)[_0x6e97('0x3f')](sendMessageReschedule(_0x19d67e))[_0x6e97('0x9f')](loggerCatch(_0x6e97('0x203')));}else{_0x19d67e[_0x6e97('0x7b')]+=_0x5779bc[_0x6e97('0x98')];_0x19d67e[_0x6e97('0x6b')]=_0x19d67e[_0x6e97('0xb1')]===_0x6e97('0x8')?utils[_0x6e97('0x69')][_0x6e97('0x168')]:utils[_0x6e97('0x69')][_0x6e97('0x1f9')];for(var _0x1524b0=0x0;_0x1524b0<_0x5779bc[_0x6e97('0x98')];_0x1524b0+=0x1){if(_[_0x6e97('0xf8')](_0x5779bc[_0x1524b0])||_['isNil'](_0x5779bc[_0x1524b0][_0x6e97('0x17a')])||_['isNil'](_0x5779bc[_0x1524b0][_0x6e97('0x161')])){_0x380c1c['emptyContact'](_0x6e97('0x1fc'),_0x19d67e,_0x5779bc[_0x1524b0]);}else{hopperUtils[_0x6e97('0x204')](_[_0x6e97('0x73')](_0x5779bc[_0x1524b0],[_0x6e97('0xe6'),'phone']))[_0x6e97('0x3f')](_0x380c1c[_0x6e97('0x1e5')](_0x19d67e,_0x5779bc[_0x1524b0]))[_0x6e97('0x9f')](_0x380c1c[_0x6e97('0x1fe')]('[actionOriginate]\x20',_0x19d67e));}}}}})[_0x6e97('0x9f')](loggerGetContactDialer(_0x6e97('0x205'),_0x19d67e,_0x5f4da9));}};Dialer[_0x6e97('0x1b')][_0x6e97('0x63')]=function(_0x42da4f){if(_0x42da4f[_0x6e97('0x201')]>0x0){var _0x287370=_0x42da4f[_0x6e97('0x201')]-_0x42da4f[_0x6e97('0x7b')]-_0x42da4f[_0x6e97('0x143')];if(_0x287370>0x0&&_0x42da4f[_0x6e97('0x1f7')]==0x0){this[_0x6e97('0x206')](_0x42da4f);}else{loggerPredictiveCalls[_0x6e97('0x48')](_0x6e97('0x207'));}}else{this[_0x6e97('0x206')](_0x42da4f);}};Dialer[_0x6e97('0x1b')][_0x6e97('0x206')]=function(_0x1bf069){var _0x19c575=this;var _0x6251d5=[];_0x1bf069['originated']+=0x1;for(var _0x1b2528 in this[_0x6e97('0x23')]){if(typeof this[_0x6e97('0x23')][_0x1b2528]!==_0x6e97('0xaa')){if(this[_0x6e97('0x23')][_0x1b2528]['state']===_0x6e97('0x202')&&this[_0x6e97('0x23')][_0x1b2528][_0x6e97('0x85')]===_0x6e97('0x86')){_0x6251d5[_0x6e97('0x99')](this['agents'][_0x1b2528]['id']);}}}_0x1bf069['temp']=0x1;return this['getContactDialer'](_0x1bf069['id'],_0x6251d5,0x1,_0x1bf069['dialOrderByScheduledAt'],_0x1bf069)[_0x6e97('0x3f')](function(_0x1b0377){_0x1bf069[_0x6e97('0x1f7')]=0x1;if(_0x1b0377){if(!utils[_0x6e97('0x1f8')](_0x1b0377)){utils[_0x6e97('0x66')](_0x1bf069,0x1,0x0);return hopperUtils[_0x6e97('0x208')](_0x1bf069)['then'](sendMessageReschedule(_0x1bf069))[_0x6e97('0x9f')](loggerCatch('[countReScheduled]\x20'));}else{_0x1bf069[_0x6e97('0x6b')]=utils['CAMPAIGN_STATUS'][_0x6e97('0x1f9')];if(_[_0x6e97('0xf8')](_0x1b0377[0x0])||_[_0x6e97('0xf8')](_0x1b0377[0x0][_0x6e97('0x17a')])||_[_0x6e97('0xf8')](_0x1b0377[0x0][_0x6e97('0x161')])){_0x19c575[_0x6e97('0x1fb')](_0x6e97('0x1fc'),_0x1bf069,_0x1b0377[0x0]);}else{return hopperUtils['checkIsBlackList'](_[_0x6e97('0x73')](_0x1b0377[0x0],['VoiceQueueId','phone']))[_0x6e97('0x3f')](_0x19c575[_0x6e97('0x1e5')](_0x1bf069,_0x1b0377[0x0]))['catch'](_0x19c575[_0x6e97('0x1fe')](_0x6e97('0x209'),_0x1bf069));}}}})[_0x6e97('0x9f')](loggerGetContactDialer(_0x6e97('0x20a'),_0x1bf069,0x1));};Dialer[_0x6e97('0x1b')]['abandonmentRate']=function(_0x235f6c,_0x28f015,_0x5062d9,_0x5ddbd8,_0x172cb8,_0x5afa3c){loggerPredictive[_0x6e97('0x48')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive['info'](_0x6e97('0x20b'),_0x235f6c);loggerPredictive[_0x6e97('0x48')](_0x6e97('0x20c'),_0x28f015);loggerPredictive[_0x6e97('0x48')](_0x6e97('0x20d'),_0x5062d9);loggerPredictive[_0x6e97('0x48')](_0x6e97('0x20e'),_0x5ddbd8);loggerPredictive[_0x6e97('0x48')](_0x6e97('0x20f'),_0x172cb8);loggerPredictive['info'](_0x6e97('0x50'));return new Promise(function(_0x5455c8,_0x2383be){if(_0x235f6c<=0x0||isNaN(_0x235f6c)){return _0x2383be(msgResponse('[abandonmentRate]',_0x6e97('0x81'),_0x6e97('0x210')+_0x235f6c));}if(_0x5062d9<=0x0||isNaN(_0x5062d9)){return _0x2383be(msgResponse(_0x6e97('0x211'),'Error',_0x6e97('0x212')+_0x5062d9));}if(_0x5ddbd8<=0x0||isNaN(_0x5ddbd8)){return _0x2383be(msgResponse(_0x6e97('0x211'),_0x6e97('0x81'),'p\x20=\x20'+_0x5ddbd8));}if(_0x28f015<=0x0||isNaN(_0x28f015)){return _0x2383be(msgResponse(_0x6e97('0x211'),_0x6e97('0x81'),'interval\x20=\x20'+_0x28f015));}if(_0x172cb8<=0x0||isNaN(_0x172cb8)){return _0x2383be(msgResponse('[abandonmentRate]',_0x6e97('0x81'),_0x6e97('0x213')+_0x172cb8));}_0x5afa3c=_0x5afa3c||0x0;var _0x28e051=0x1/_0x5062d9;var _0x1e2c0d=0x0;var _0x2a1b6c=0x0;var _0x488bd0=0x0;var _0x405d40=0x0;for(var _0x52a9dc=0x0;_0x488bd0<_0x172cb8;_0x52a9dc+=0x1){_0x2a1b6c=_0x52a9dc/_0x28f015;_0x1e2c0d=(_0x5ddbd8*_0x2a1b6c+_0x5afa3c)/_0x28e051;_0x488bd0=utils[_0x6e97('0x214')](_0x1e2c0d,_0x235f6c);_0x405d40=_0x1e2c0d/_0x235f6c*(0x1-utils[_0x6e97('0x214')](_0x1e2c0d,_0x235f6c));}return _0x5455c8({'erlangCalls':_0x52a9dc,'erlangCallToSecond':_0x28f015/_0x52a9dc,'erlangAbandonmentRate':_0x488bd0,'erlangBusyFactor':_0x405d40});});};Dialer[_0x6e97('0x1b')]['busyFactor']=function(_0xca56cd,_0x3574f5,_0x10e78c,_0x3b0785,_0x2ad90a,_0x3d902a){loggerPredictive['info'](_0x6e97('0x215'));loggerPredictive['info']('M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xca56cd);loggerPredictive[_0x6e97('0x48')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3574f5);loggerPredictive[_0x6e97('0x48')](_0x6e97('0x20d'),_0x10e78c);loggerPredictive['info'](_0x6e97('0x20e'),_0x3b0785);loggerPredictive[_0x6e97('0x48')](_0x6e97('0x216'),_0x2ad90a);loggerPredictive[_0x6e97('0x48')]('---------------------------');return new Promise(function(_0x28dd82,_0x2a7346){if(_0xca56cd<=0x0||isNaN(_0xca56cd)){return _0x2a7346(msgResponse('[busyFactor]','Error','m\x20=\x20'+_0xca56cd));}if(_0x10e78c<=0x0||isNaN(_0x10e78c)){return _0x2a7346(msgResponse('[busyFactor]','Error',_0x6e97('0x212')+_0x10e78c));}if(_0x3b0785<=0x0||isNaN(_0x3b0785)){return _0x2a7346(msgResponse(_0x6e97('0x217'),_0x6e97('0x81'),_0x6e97('0x218')+_0x3b0785));}if(_0x3574f5<=0x0||isNaN(_0x3574f5)){return _0x2a7346(msgResponse(_0x6e97('0x217'),'Error',_0x6e97('0x219')+_0x3574f5));}if(_0x2ad90a<=0x0||isNaN(_0x2ad90a)){return _0x2a7346(msgResponse(_0x6e97('0x217'),'Error',_0x6e97('0x21a')+_0x2ad90a));}_0x3d902a=_0x3d902a||0x0;var _0xe410b2=0x1/_0x10e78c;var _0xa70aae=0x0;var _0x5f5a36=0x0;var _0xb4fd01=0x0;var _0x33fb0a=0x0;for(var _0x5e3e8d=0x0;_0x33fb0a<_0x2ad90a;_0x5e3e8d+=0x1){_0x5f5a36=_0x5e3e8d/_0x3574f5;_0xa70aae=(_0x3b0785*_0x5f5a36+_0x3d902a)/_0xe410b2;_0xb4fd01=utils[_0x6e97('0x214')](_0xa70aae,_0xca56cd);_0x33fb0a=_0xa70aae/_0xca56cd*(0x1-utils['erlangb'](_0xa70aae,_0xca56cd));}return _0x28dd82({'erlangCalls':_0x5e3e8d,'erlangCallToSecond':_0x3574f5/_0x5e3e8d,'erlangAbandonmentRate':_0xb4fd01,'erlangBusyFactor':_0x33fb0a});});};module[_0x6e97('0x21b')]=Dialer; \ No newline at end of file +var _0x0b35=['predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','dialPredictiveInterval','started\x20in\x20predictive\x20at','avgHandleTime','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','busyFactor','Unknown\x20Predictive','[getDataPredictive]','check\x20failure','getDataPredictiveOld','loggedIn','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','agentBusyFactor','one\x20call\x20every:','checkContactBlack','UserId','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','voicePause','unlockContact','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','QUEUE_RECALL','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALL_TIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','handleIvr','limitCalls','temp','getContactDialerIvr','checkContactEmpty','RUNNING','ivrTotalCallsDays','loggerHandler','[actionOriginateIvr]\x20','[getContactCampaign2]','pTalking','not_inuse','getContactDialer','countReScheduled','[actionOriginate]\x20','checkIsBlackList','[getContactDialer2]','dialLimitQueue','tryOriginatePredictive','[handlePredictive][limitChannel]','checkContactLowerLimitOriginate','[countReScheduled]\x20','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','erlangb','----\x20Agent\x20Busy\x20Factor\x20----','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Umin\x20=\x20','exports','util','lodash','moment','ioredis','./utils/hopper','../preview/util/util','../../../config/environment/','dialer','../../../config/logger','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/voiceQueueRt','../rpc/setting','../rpc/interval','./models/action','./models/history','./models/final','./models/agentComplete','./models/queueCallerAbandon','./models/hangup','env','127.0.0.1','prototype','enqueue','tail','preview','voiceQueues','campaigns','agents','maxNumberOriginate','channels','contactsId','startProgressive','ivrOriginated','queueBooked','queueBookedRR','queuesSummary','agentconnect','syncAgentConnect','bind','queuecallerabandon','originateresponse','syncAgentComplete','custom:queuesummary','custom:queuesummarycomplete','syncQueueSummaryComplete','hangup','syncHangup','newexten','syncNewExten','queuemember','syncQueueMember','queuestatuscomplete','loopCampaigns','getSettings','previewRecallmeReminderInterval','type','outbound','inspect','format','voice:queue:%s','name','voice_queue:save','isEmpty','info','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','predictiveIntervalTotalCalls','isUndefined','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','erlangAbandonmentRate','merge','getSeconds','startPredictive','startPredictive\x20value\x20cleared','handlePredictive','error','stack','message','CAMPAIGN_STATUS','[getContactDialer2][ReScheduled]','contacts','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','statedesc','endtime','queueStatusComplete','[booked][unlockQueueStatus]','stringify','pick','Interval','NULL_INTERVAL','\x20INTERVAL_IS_NULL','Intervals','isIVRCampaignActive','\x20NOT\x20Active','isIVRCampaign','campaign:ivr:%s','debug','originated','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','DISACTIVED','is\x20disactive','[ifTime][Action]','Error','isTrunkReachable','active','trunks','SIP/%s','status','checkIsTrunkReachable','TrunkBackup','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','ifTimeIvr','checkIfTimeIntervals','ifTime','Failure','\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL','timezones','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','isArray','length','Action','command','iftime\x20%s,%s','interval','then','content','indexOf','true','catch','push','all','some','OVERTIME_INTERVAL','[ifTime][promiseAll]','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','syncCampaigns','undefined','checkIfTime','dialTimezone','launchHandleIvr','checkDialMethod','dialMethod','progressive','handlePower','dialPowerLevel','method\x20not\x20recognized','silly','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','intervalIftime','Global:\x20','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','AMI\x20IfTime','queue','uniqueid','ivr','updateOriginated','uniqueId','outboundAnswerCallsDay','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','YYYY-MM-DD\x20HH:mm:ss','[syncAgentComplete][createHistory]','[syncAgentComplete]','droptime','responsetime','dialQueueTimeout','predictiveIntervalDroppedCallsTimeout','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','state','Drop','TIMEOUT','dialDropRetryFrequency','callAdditionalPhoneAfterMin','voiceQueue','countdropretry','dialDropMaxRetry','additional','rescheduleContact','minutes','ContactId','ListId','VoiceQueueId','starttime','calleridname','calleridnum','createHistory','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','Abandoned','dropreason','countabandonedretry','countglobal','verifyAdditionalPhones','dialAbandonedMaxRetry','queueCallerAbandonCreateState','add','dialAbandonedRetryFrequency','CampaignId','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','actions','channel','actionid','strategy','rrmemory','roundrobin','isNil','paused','stateinterface','locked','syncQueueStatusComplete','run','idHopper','finally','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','[booked][RR][finaly]','Agent:\x20','contactAgent-idHopper:\x20','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[unlock3][syncQueueStatusComplete]','syncOriginateResponse','getQueue','callProgressDetecting','[callProgressDetecting]\x20','syncVarSet','variable','amdstatus','exten','dialAMDActive','HANGUP','HangupInAMD','membername','AMD','emit','custom:amd','amd','saveInDb','[syncHangupInAMD][createHistory]','value','MACHINE','outboundAnswerAgiCallsDay','Machine','buildObj','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countmachineretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','dialMachineRetryFrequency','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','[syncAgentComplete][createHistory][0]','countagentrejectretry','createStateFinal','reason\x2019\x20machine....','[rescheduleContact][Machine]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','moveContactManagedDialer','[syncHangupIvr]','dialQueueProject','AnswerAGI','outboundUnknownCallsDay','cause-txt','Unknow','running','isPreviewCampaign','statusMessage','getQueueCampaignStatusMessage','resolve','INACTIVE','available','inUse','talking','compareToOutboundQueue','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','[syncQueueSummary]','throttle','filter','online','reachable','map','Agent','user:dialPreviewRecallReminder','checkPreviewRecallReminder','loopClearZombieChannels','clearZombieChannels','[uniqueid]','[actions]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','emptyContact','notFound','[emptyContact]','user:%s','actionOriginate','voiceQueue\x20is\x20undefine','phone','originate','contact\x20is\x20undefine','NONE','\x22agi://%s/square,%s\x22','\x22%s,%s%s,,,%s\x22','dialQueueOptions','getCaller','ACTIVE','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','dialAMDMaximumWordLength','isOutboundQueue','XMD-CAMPAIGNID','Contact','Trunk','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','getCallerId','XMD-ORIGINATECALLERIDNAME','originatecalleridname','extractCalleridName','XMD-ORIGINATECALLERIDNUM','variables','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','xcally-motion-dialer','from-sip','dialOriginateTimeout','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','object','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','dialCongestionRetryFrequency','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','Global','Success','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','floor','predictiveIntervalHitRate'];(function(_0x438685,_0x4ec0c0){var _0x41cca2=function(_0x532003){while(--_0x532003){_0x438685['push'](_0x438685['shift']());}};_0x41cca2(++_0x4ec0c0);}(_0x0b35,0x66));var _0x50b3=function(_0x3e32a8,_0x255953){_0x3e32a8=_0x3e32a8-0x0;var _0x2997b0=_0x0b35[_0x3e32a8];return _0x2997b0;};'use strict';var util=require(_0x50b3('0x0'));var _=require(_0x50b3('0x1'));var uuid=require('uuid');var moment=require(_0x50b3('0x2'));var rr=require('rr');var Redis=require(_0x50b3('0x3'));var utils=require('./utils');var hopperUtils=require(_0x50b3('0x4'));var ut=require(_0x50b3('0x5'));var config=require(_0x50b3('0x6'));var logger=require('../../../config/logger')(_0x50b3('0x7'));var loggerBooked=require(_0x50b3('0x8'))(_0x50b3('0x9'));var loggerPredictive=require('../../../config/logger')(_0x50b3('0xa'));var loggerPredictiveCalls=require(_0x50b3('0x8'))(_0x50b3('0xb'));var loggerSyncQueueSummary=require(_0x50b3('0x8'))(_0x50b3('0xc'));var ami=require(_0x50b3('0xd'));config[_0x50b3('0xe')]=_[_0x50b3('0xf')](config[_0x50b3('0xe')],{'host':_0x50b3('0x10'),'port':0x18eb});var io=require(_0x50b3('0x11'))(new Redis(config['redis']));var cmHopper=require('../rpc/cmHopper');var voiceQueueRt=require(_0x50b3('0x12'));var RpcSetting=require(_0x50b3('0x13'));var Interval=require(_0x50b3('0x14'));var Action=require(_0x50b3('0x15'));var History=require(_0x50b3('0x16'));var Final=require(_0x50b3('0x17'));var AgentComplete=require(_0x50b3('0x18'));var QueueCallerAbandon=require(_0x50b3('0x19'));var Hangup=require(_0x50b3('0x1a'));var ipAgi=process[_0x50b3('0x1b')]['XCALLY_IP_AGI']||_0x50b3('0x1c');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x50b3('0x1d')][_0x50b3('0x1e')]=function(_0x18077d){this[_0x50b3('0x1f')]=this[_0x50b3('0x1f')]?this[_0x50b3('0x1f')]['finally'](_0x18077d):_0x18077d();};function Dialer(_0x33c5d1,_0x239318){this['sequence']=new Sequence();this[_0x50b3('0x20')]=_0x239318;this[_0x50b3('0x21')]=_0x33c5d1[_0x50b3('0x21')];this[_0x50b3('0x22')]=_0x33c5d1['campaigns'];this[_0x50b3('0x23')]=_0x33c5d1['agents'];this['trunks']=_0x33c5d1['trunks'];this[_0x50b3('0x24')]=config[_0x50b3('0x24')]||0x2;this[_0x50b3('0x25')]={};this['actions']={};this[_0x50b3('0x26')]={};this['uniqueId']={};this['optionPredictive']={};this['startPredictive']={};this[_0x50b3('0x27')]={};this[_0x50b3('0x28')]={};this[_0x50b3('0x29')]={};this[_0x50b3('0x2a')]={};this[_0x50b3('0x2b')]={};ami['on'](_0x50b3('0x2c'),this[_0x50b3('0x2d')][_0x50b3('0x2e')](this));ami['on'](_0x50b3('0x2f'),this['syncQueueCallerAbandon'][_0x50b3('0x2e')](this));ami['on'](_0x50b3('0x30'),this['syncOriginateResponse']['bind'](this));ami['on']('agentcomplete',this[_0x50b3('0x31')][_0x50b3('0x2e')](this));ami['on'](_0x50b3('0x32'),this[_0x50b3('0xc')]['bind'](this));ami['on'](_0x50b3('0x33'),this[_0x50b3('0x34')][_0x50b3('0x2e')](this));ami['on'](_0x50b3('0x35'),this[_0x50b3('0x36')][_0x50b3('0x2e')](this));ami['on'](_0x50b3('0x37'),this[_0x50b3('0x38')][_0x50b3('0x2e')](this));ami['on']('varset',this['syncVarSet']['bind'](this));ami['on'](_0x50b3('0x39'),this[_0x50b3('0x3a')][_0x50b3('0x2e')](this));ami['on'](_0x50b3('0x3b'),this['syncQueueStatusComplete'][_0x50b3('0x2e')](this));this[_0x50b3('0x3c')]();this['loopClearZombieChannels']();RpcSetting[_0x50b3('0x3d')]()['then'](function(_0x504e9c){previewRecallmeReminderInterval=_0x504e9c[_0x50b3('0x3e')];});}function isNotNull(_0x21f85f){return _0x21f85f!==null&&!_['isUndefined'](_0x21f85f);}function msgResponse(_0x2cbbee,_0x2cad88,_0x370096){return{'action':_0x2cbbee,'response':_0x2cad88,'message':_0x370096,'stack':_0x370096};}function emit(_0x2efddd,_0xd20270,_0xa62876){io['to'](_0x2efddd)['emit'](_0xd20270,_0xa62876);}function emitOutboundVoiceQueueSummary(_0x1376cc){if(_0x1376cc[_0x50b3('0x3f')]===_0x50b3('0x40')){logger['debug']('[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:',util[_0x50b3('0x41')](_0x1376cc,{'showHidden':![],'depth':null}));emit(util[_0x50b3('0x42')](_0x50b3('0x43'),_0x1376cc[_0x50b3('0x44')]),_0x50b3('0x45'),_0x1376cc);}}function checkGetDataPredictive(_0x4bb36b){if(isNotNull(_0x4bb36b)&&!_[_0x50b3('0x46')](_0x4bb36b)){loggerPredictive['info']('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0x50b3('0x47')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4bb36b['predictiveIntervalTotalCalls']);loggerPredictive[_0x50b3('0x47')](_0x50b3('0x48'),_0x4bb36b[_0x50b3('0x49')]);loggerPredictive[_0x50b3('0x47')](_0x50b3('0x4a'),_0x4bb36b['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0x50b3('0x47')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4bb36b[_0x50b3('0x4b')]);loggerPredictive[_0x50b3('0x47')](_0x50b3('0x4c'),_0x4bb36b[_0x50b3('0x4d')]);loggerPredictive[_0x50b3('0x47')](_0x50b3('0x4e'),_0x4bb36b[_0x50b3('0x4f')]);loggerPredictive[_0x50b3('0x47')]('---------------------------');if(_0x4bb36b[_0x50b3('0x50')]>0x0){if(!_[_0x50b3('0x51')](_0x4bb36b[_0x50b3('0x4f')])&&_0x4bb36b[_0x50b3('0x4f')]>0x0){return!![];}loggerPredictive['info']('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_['isUndefined'](_0x4bb36b['predictiveIntervalAvgHoldtime'])&&_0x4bb36b['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive[_0x50b3('0x47')](_0x50b3('0x52'));}else{loggerPredictive[_0x50b3('0x47')](_0x50b3('0x53'));}}else{loggerPredictive[_0x50b3('0x47')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x5b742e){return function(_0x30e17d){loggerPredictive[_0x50b3('0x47')](_0x50b3('0x54'));loggerPredictive[_0x50b3('0x47')](_0x50b3('0x55'),_0x30e17d[_0x50b3('0x56')]);loggerPredictive[_0x50b3('0x47')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x30e17d[_0x50b3('0x57')]);loggerPredictive[_0x50b3('0x47')](_0x50b3('0x58'),_0x30e17d['erlangAbandonmentRate']);loggerPredictive[_0x50b3('0x47')](_0x50b3('0x59'),_0x30e17d[_0x50b3('0x5a')]);loggerPredictive[_0x50b3('0x47')](_0x50b3('0x58'),_0x30e17d[_0x50b3('0x5b')]);loggerPredictive[_0x50b3('0x47')]('---------------------------');_[_0x50b3('0x5c')](_0x5b742e,_0x30e17d);};}function ifInterval(_0x33b2b6,_0x10ec1e){if(_[_0x50b3('0x51')](_0x10ec1e)){return![];}return utils[_0x50b3('0x5d')](undefined,_0x10ec1e)<_0x33b2b6*0x3c;}function clearPredictiveAttributes(_0x5b4a3c){if(_0x5b4a3c['startProgressive']){_0x5b4a3c[_0x50b3('0x27')]=undefined;loggerPredictive['debug'](_0x5b4a3c[_0x50b3('0x44')],'startProgressive\x20value\x20cleared');}if(_0x5b4a3c[_0x50b3('0x5e')]){_0x5b4a3c[_0x50b3('0x5e')]=undefined;loggerPredictive['debug'](_0x5b4a3c[_0x50b3('0x44')],_0x50b3('0x5f'));}if(_0x5b4a3c[_0x50b3('0x60')]){clearInterval(_0x5b4a3c['handlePredictive']);_0x5b4a3c[_0x50b3('0x60')]=undefined;loggerPredictive['debug'](_0x5b4a3c[_0x50b3('0x44')],'handlePredictive\x20interval\x20cleared');}}function loggerCatchPredictive(_0x5966d2,_0x524cce){return function(_0x45e76b){loggerPredictive[_0x50b3('0x61')](_0x524cce[_0x50b3('0x44')],_0x5966d2);loggerPredictive[_0x50b3('0x61')](_0x45e76b[_0x50b3('0x62')]);clearPredictiveAttributes(_0x524cce);};}function loggerCatch(_0x438e60){return function(_0x5d05c2){logger['error'](_0x438e60,util[_0x50b3('0x41')](_0x5d05c2,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x6f79a5,_0x28375f,_0x4a4dba){return function(_0x35c488){utils['checkContactLowerLimitOriginate'](_0x28375f,_0x4a4dba,0x0);logger['error'](_0x6f79a5,util[_0x50b3('0x41')](_0x35c488,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x5f272d){return function(_0x7876a5){if(isNotNull(_0x7876a5)&&isNotNull(_0x7876a5[0x0])){if(_0x7876a5[0x0]['contactsRescheduled']>0x0){_0x5f272d[_0x50b3('0x63')]=utils[_0x50b3('0x64')]['CONTACTS_RESCHEDULED'];logger[_0x50b3('0x47')](_0x50b3('0x65')+_0x5f272d[_0x50b3('0x44')],_0x7876a5[0x0]['contactsRescheduled'],_0x50b3('0x66'));}else{_0x5f272d[_0x50b3('0x63')]=utils[_0x50b3('0x64')][_0x50b3('0x67')];logger[_0x50b3('0x47')](_0x50b3('0x68')+_0x5f272d[_0x50b3('0x44')]);}}};}function createObjHistory(_0x1432f3,_0x1a9b21,_0x4d3bd4,_0x387c21,_0x36283c){_0x1432f3[_0x50b3('0x63')]=_0x4d3bd4;var _0x5eda11=new Action(_0x1432f3,_0x1a9b21);var _0x120ccf=new History(_0x5eda11);_0x120ccf['state']=_0x387c21;_0x120ccf[_0x50b3('0x69')]=_0x36283c;_0x120ccf[_0x50b3('0x6a')]=_0x5eda11['starttime'];return _0x120ccf;}function unlockQueueStatus(_0x3bed16,_0xdbf2a4){setTimeout(function(){if(_[_0x50b3('0x51')](_0x3bed16[_0x50b3('0x6b')])){loggerBooked['error']('[unlockQueueStatus][undefined]',_0xdbf2a4);}_0x3bed16[_0x50b3('0x6b')]=!![];loggerBooked[_0x50b3('0x47')](_0x50b3('0x6c'),_0xdbf2a4,JSON[_0x50b3('0x6d')](_[_0x50b3('0x6e')](_0x3bed16,[_0x50b3('0x44'),_0x50b3('0x6b')])));},0x1f3);}function checkInterval(_0x468c1e){return function(){if(!isNotNull(_0x468c1e[_0x50b3('0x6f')])){_0x468c1e[_0x50b3('0x63')]=utils[_0x50b3('0x64')][_0x50b3('0x70')];throw _0x468c1e[_0x50b3('0x44')]+_0x50b3('0x71');}if(!isNotNull(_0x468c1e[_0x50b3('0x6f')][_0x50b3('0x72')])){_0x468c1e['message']=utils[_0x50b3('0x64')][_0x50b3('0x70')];throw _0x468c1e[_0x50b3('0x44')]+_0x50b3('0x71');}if(!isNotNull(_[_0x50b3('0x46')](_0x468c1e[_0x50b3('0x6f')][_0x50b3('0x72')]))){_0x468c1e[_0x50b3('0x63')]=utils['CAMPAIGN_STATUS']['NULL_INTERVAL'];throw _0x468c1e[_0x50b3('0x44')]+_0x50b3('0x71');}};}function checkIsIVRCampaignActive(_0x957a66){return function(){if(!utils[_0x50b3('0x73')](_0x957a66)){_0x957a66[_0x50b3('0x63')]=utils['CAMPAIGN_STATUS']['INACTIVE'];throw _0x957a66[_0x50b3('0x44')]+_0x50b3('0x74');}};}function emitCampaignSummary(_0x305871){if(utils[_0x50b3('0x75')](_0x305871)){emit(util[_0x50b3('0x42')](_0x50b3('0x76'),_0x305871[_0x50b3('0x44')]),'campaign:save',_0x305871);}}function loggerCatchQueueSummary(_0x17b54e,_0x54e3bc){return function(_0x474a40){clearPredictiveAttributes(_0x54e3bc);emitCampaignSummary(_0x54e3bc);loggerSyncQueueSummary[_0x50b3('0x77')](_0x17b54e,util['inspect'](_0x474a40,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x4304d5){if(_0x4304d5['sendMessageOneNotActive']){if(_0x4304d5[_0x50b3('0x78')]===0x0){_0x4304d5[_0x50b3('0x79')]=![];_0x4304d5[_0x50b3('0x63')]=utils[_0x50b3('0x64')]['INACTIVE'];loggerSyncQueueSummary[_0x50b3('0x77')](_0x50b3('0x7a'),_0x4304d5['name'],'is\x20not\x20active');}else{_0x4304d5[_0x50b3('0x63')]=utils[_0x50b3('0x64')][_0x50b3('0x7b')];loggerSyncQueueSummary['debug']('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x4304d5[_0x50b3('0x44')],_0x50b3('0x7c'));}emitCampaignSummary(_0x4304d5);}}function myreject(_0xfe43b3){return function(_0x3b63c8){return _0xfe43b3(msgResponse(_0x50b3('0x7d'),_0x50b3('0x7e'),JSON[_0x50b3('0x6d')](_0x3b63c8)));};}Dialer[_0x50b3('0x1d')][_0x50b3('0x7f')]=function(_0x1f0555){return!_[_0x50b3('0x51')](_0x1f0555)&&_0x1f0555&&!_[_0x50b3('0x51')](_0x1f0555[_0x50b3('0x44')])&&!_[_0x50b3('0x51')](_0x1f0555['active'])&&_0x1f0555[_0x50b3('0x80')]&&(this[_0x50b3('0x81')][util[_0x50b3('0x42')](_0x50b3('0x82'),_0x1f0555['name'])][_0x50b3('0x83')]==='reachable'||this[_0x50b3('0x81')][util[_0x50b3('0x42')](_0x50b3('0x82'),_0x1f0555['name'])][_0x50b3('0x83')]==='unmonitored');};Dialer[_0x50b3('0x1d')][_0x50b3('0x84')]=function(_0x419bfb){var _0xa6e5d8=this;return function(){if(!_0xa6e5d8[_0x50b3('0x7f')](_0x419bfb['Trunk'])){if(!_0xa6e5d8[_0x50b3('0x7f')](_0x419bfb[_0x50b3('0x85')])){_0x419bfb['message']=utils['CAMPAIGN_STATUS'][_0x50b3('0x86')];throw _0x419bfb[_0x50b3('0x44')]+_0x50b3('0x87');}}};};Dialer[_0x50b3('0x1d')]['checkIfTime']=function(_0x3c3c54,_0x2a81b9,_0x58aab6,_0x3384e8){var _0x3926c5=this;return function(){var _0xdd0859=!![];return _0x3926c5[_0x50b3('0x88')](_0x3c3c54,_0x2a81b9,_0x58aab6,_0x3384e8,_0xdd0859);};};Dialer[_0x50b3('0x1d')][_0x50b3('0x89')]=function(_0xb065a,_0x40e52e,_0x388ef1,_0x36b261){var _0x371ca1=this;return function(){var _0x13b7f3=![];return _0x371ca1['ifTimeIvr'](_0xb065a[_0x50b3('0x72')],_0x40e52e,_0x388ef1,_0x36b261,_0x13b7f3);};};Dialer[_0x50b3('0x1d')]['ifTimeIvr']=function(_0x56c9a8,_0x249526,_0x45c6e4,_0x4bc19e,_0x4bf4bd){var _0x20e20d=[];return new Promise(function(_0x5e25e9,_0x41523d){if(!isNotNull(_0x56c9a8)){_0x4bc19e['message']=utils[_0x50b3('0x64')][_0x50b3('0x70')];return _0x41523d(msgResponse(_0x50b3('0x8a'),_0x50b3('0x8b'),_0x45c6e4+_0x50b3('0x8c')));}if(_[_0x50b3('0x46')](_0x56c9a8)){_0x4bc19e[_0x50b3('0x63')]=utils['CAMPAIGN_STATUS'][_0x50b3('0x8d')];return _0x41523d(msgResponse(_0x50b3('0x8a'),_0x50b3('0x8b'),_0x45c6e4+'\x20Intervals\x20is\x20empty\x20'));}if(_0x249526&&_['isUndefined'](config[_0x50b3('0x8e')][_0x249526])){_0x4bc19e[_0x50b3('0x63')]=utils[_0x50b3('0x64')][_0x50b3('0x8f')];return _0x41523d(msgResponse(_0x50b3('0x8a'),_0x50b3('0x8b'),_0x45c6e4+_0x50b3('0x90')+_0x249526));}if(_[_0x50b3('0x91')](_0x56c9a8)){for(var _0x143fb1=0x0;_0x143fb1<_0x56c9a8[_0x50b3('0x92')];_0x143fb1+=0x1){_0x20e20d['push'](ami[_0x50b3('0x93')]({'action':_0x50b3('0x94'),'command':util[_0x50b3('0x42')](_0x50b3('0x95'),_0x56c9a8[_0x143fb1][_0x50b3('0x96')],!_['isUndefined'](config[_0x50b3('0x8e')][_0x249526])?_0x249526:'')})[_0x50b3('0x97')](function(_0x56c565){return _0x56c565[_0x50b3('0x98')][_0x50b3('0x99')](_0x50b3('0x9a'))>=0x0;})[_0x50b3('0x9b')](myreject(_0x41523d)));}}else{_0x20e20d[_0x50b3('0x9c')](ami['Action']({'action':_0x50b3('0x94'),'command':util[_0x50b3('0x42')](_0x50b3('0x95'),_0x56c9a8,!_['isUndefined'](config['timezones'][_0x249526])?_0x249526:'')})[_0x50b3('0x97')](function(_0x159e3b){return _0x159e3b[_0x50b3('0x98')][_0x50b3('0x99')]('true')>=0x0;})[_0x50b3('0x9b')](myreject(_0x41523d)));}Promise[_0x50b3('0x9d')](_0x20e20d)['then'](function(_0x2d8760){var _0x1d2fb2=_[_0x50b3('0x9e')](_0x2d8760);if(_0x1d2fb2){return _0x5e25e9(_0x1d2fb2);}else{_0x4bc19e[_0x50b3('0x63')]=_0x4bf4bd?utils[_0x50b3('0x64')]['OVERTIME_GLOBAL_INTERVAL']:utils[_0x50b3('0x64')][_0x50b3('0x9f')];return _0x41523d(msgResponse(_0x50b3('0xa0'),_0x50b3('0x8b'),'Global:\x20'+_0x4bf4bd+'\x20'+_0x45c6e4+_0x50b3('0xa1')+util['inspect'](_0x56c9a8,{'showHidden':![],'depth':null})+_0x50b3('0xa2')+_0x249526));}})[_0x50b3('0x9b')](function(_0x47e775){return _0x41523d(msgResponse(_0x50b3('0x8a'),_0x50b3('0x8b'),JSON[_0x50b3('0x6d')](_0x47e775)));});});};Dialer[_0x50b3('0x1d')][_0x50b3('0x3c')]=function(){var _0x4caa59=this;return cmHopper['resetActiveCalls']({'active':![]},{'where':{'active':!![]}})[_0x50b3('0x97')](function(){setInterval(function(){_0x4caa59[_0x50b3('0xa3')]();},0x3e8);});};Dialer['prototype'][_0x50b3('0xa3')]=function(){var _0x586c08=this;var _0x34cdd1;for(var _0x197432 in this[_0x50b3('0x22')]){if(typeof this[_0x50b3('0x22')][_0x197432]!==_0x50b3('0xa4')){_0x34cdd1=this[_0x50b3('0x22')][_0x197432];if(utils[_0x50b3('0x75')](_0x34cdd1)&&utils['isIVRCampaignActive'](_0x34cdd1)){_0x34cdd1[_0x50b3('0x79')]=!![];Promise['resolve']()[_0x50b3('0x97')](checkIsIVRCampaignActive(_0x34cdd1))['then'](checkInterval(_0x34cdd1))['then'](_0x586c08[_0x50b3('0x84')](_0x34cdd1))[_0x50b3('0x97')](_0x586c08[_0x50b3('0xa5')](_0x34cdd1['dialGlobalInterval'],_0x34cdd1['dialTimezone'],_0x34cdd1[_0x50b3('0x44')],_0x34cdd1))['then'](_0x586c08['checkIfTimeIntervals'](_0x34cdd1[_0x50b3('0x6f')],_0x34cdd1[_0x50b3('0xa6')],_0x34cdd1['name'],_0x34cdd1))['then'](_0x586c08[_0x50b3('0xa7')](_0x34cdd1))[_0x50b3('0x9b')](loggerCatchQueueSummary('[syncCampaigns]',_0x34cdd1));}else{notSendMessagesCampaign(_0x34cdd1);}}}};Dialer[_0x50b3('0x1d')][_0x50b3('0xa8')]=function(_0x18694b){if(_0x18694b[_0x50b3('0xa9')]!==_0x50b3('0xa')){clearPredictiveAttributes(_0x18694b);}switch(_0x18694b[_0x50b3('0xa9')]){case _0x50b3('0xaa'):this[_0x50b3('0xab')](_0x18694b,0x1);break;case'power':this['handlePower'](_0x18694b,_0x18694b[_0x50b3('0xac')]);break;case'predictive':this[_0x50b3('0xa')](_0x18694b);break;case _0x50b3('0x9'):this[_0x50b3('0xab')](_0x18694b,0x1);break;default:logger[_0x50b3('0x61')]('Queue',_0x18694b[_0x50b3('0x44')],_0x50b3('0xad'));}};Dialer[_0x50b3('0x1d')]['ifTime']=function(_0x43ce07,_0x28a847){var _0x4794b6=_0x43ce07[_0x50b3('0xa6')];var _0x4c76e1=_0x28a847?_0x43ce07['dialGlobalInterval']:_0x43ce07['Interval'][_0x50b3('0x72')];logger[_0x50b3('0xae')](_0x50b3('0xaf'),_0x4c76e1,_0x4794b6,_0x43ce07[_0x50b3('0x44')],util[_0x50b3('0x42')](_0x50b3('0xb0'),_0x43ce07['name'],_0x43ce07['id']));var _0xede639=null;return Interval[_0x50b3('0xb1')](_0x4c76e1,_0x4794b6)[_0x50b3('0x97')](function(_0x185c47){if(_0x185c47===!![]){return _0x185c47;}else{_0x43ce07[_0x50b3('0x63')]=_0x28a847?utils[_0x50b3('0x64')]['OVERTIME_GLOBAL_INTERVAL']:utils[_0x50b3('0x64')][_0x50b3('0x9f')];_0xede639=msgResponse(_0x50b3('0xa0'),'Failure',_0x50b3('0xb2')+_0x28a847+'\x20'+_0x43ce07[_0x50b3('0x44')]+'\x20Interval\x20is\x20overtime:\x20'+util[_0x50b3('0x41')](_0x4c76e1,{'showHidden':![],'depth':null})+_0x50b3('0xa2')+_0x4794b6);}if(_0xede639!==null){logger['silly'](_0x50b3('0xb3'),_0xede639);_0xede639[_0x50b3('0xb4')]=_0x28a847;throw _0xede639;}})[_0x50b3('0x9b')](function(_0x10654e){logger[_0x50b3('0x61')](_0x50b3('0xb5'),_0x10654e);throw msgResponse(_0x50b3('0x7d'),_0x50b3('0x7e'),util[_0x50b3('0x41')](_0x10654e,{'showHidden':![],'depth':null}));});};Dialer[_0x50b3('0x1d')]['syncAgentConnect']=function(_0x162a8){if(this[_0x50b3('0x21')][_0x162a8[_0x50b3('0xb6')]]){if(this['uniqueId'][_0x162a8['uniqueid']]&&this['uniqueId'][_0x162a8[_0x50b3('0xb7')]]['type']!==_0x50b3('0xb8')){this[_0x50b3('0xb9')](this[_0x50b3('0x21')][_0x162a8[_0x50b3('0xb6')]]);this[_0x50b3('0xba')][_0x162a8[_0x50b3('0xb7')]]['answertime']=moment()[_0x50b3('0x42')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer['prototype'][_0x50b3('0x31')]=function(_0x69d261){var _0x1b0fb0=this['uniqueId'][_0x69d261[_0x50b3('0xb7')]];if(this['voiceQueues'][_0x69d261[_0x50b3('0xb6')]]){if(_0x1b0fb0&&_0x1b0fb0[_0x50b3('0x3f')]!==_0x50b3('0xb8')){delete this['uniqueId'][_0x69d261[_0x50b3('0xb7')]];this[_0x50b3('0x21')][_0x69d261[_0x50b3('0xb6')]][_0x50b3('0xbb')]+=0x1;var _0x8b338=new AgentComplete(_0x1b0fb0,_0x69d261);if(_0x69d261[_0x50b3('0xbc')]===_0x50b3('0xbd')){_0x8b338[_0x50b3('0xbe')]=this['voiceQueues'][_0x69d261[_0x50b3('0xb6')]][_0x50b3('0xbf')]&&this['voiceQueues'][_0x69d261['queue']][_0x50b3('0xc0')]?moment()[_0x50b3('0x42')](_0x50b3('0xc1')):undefined;}hopperUtils['createHistory'](_0x8b338)[_0x50b3('0x9b')](loggerCatch(_0x50b3('0xc2')));hopperUtils['moveContactManagedDialer'](_0x8b338)[_0x50b3('0x9b')](loggerCatch(_0x50b3('0xc3')));}}};Dialer[_0x50b3('0x1d')]['syncQueueCallerAbandon']=function(_0x5a7dae){var _0x51ddc7=this['uniqueId'][_0x5a7dae['uniqueid']];var _0x1f362a=this;var _0x58262c=![];var _0x537b83;var _0x1cd31d;if(this[_0x50b3('0x21')][_0x5a7dae[_0x50b3('0xb6')]]){if(_0x51ddc7&&_0x51ddc7[_0x50b3('0x3f')]!==_0x50b3('0xb8')){delete this[_0x50b3('0xba')][_0x5a7dae[_0x50b3('0xb7')]];this[_0x50b3('0xb9')](this[_0x50b3('0x21')][_0x5a7dae[_0x50b3('0xb6')]]);_0x51ddc7[_0x50b3('0xc4')]=moment()[_0x50b3('0x42')](_0x50b3('0xc1'));var _0x334c03=new QueueCallerAbandon(_0x51ddc7,_0x5a7dae);if(utils['getSeconds'](_0x51ddc7['droptime'],_0x51ddc7[_0x50b3('0xc5')])>=_0x51ddc7[_0x50b3('0xc6')]){this['voiceQueues'][_0x5a7dae['queue']][_0x50b3('0xc7')]+=0x1;this[_0x50b3('0x21')][_0x5a7dae[_0x50b3('0xb6')]][_0x50b3('0xc8')]+=0x1;this['voiceQueues'][_0x5a7dae[_0x50b3('0xb6')]][_0x50b3('0xc9')]+=0x1;_0x334c03[_0x50b3('0xca')]=0xa;_0x334c03[_0x50b3('0x69')]=_0x50b3('0xcb');_0x334c03['dropreason']=_0x50b3('0xcc');_0x334c03['agiafterat']=this[_0x50b3('0x21')][_0x5a7dae['queue']]['dialQueueProject2']?moment()[_0x50b3('0x42')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x334c03['countdropretry']+=0x1;_0x334c03['countglobal']+=0x1;_0x537b83=this[_0x50b3('0x21')][_0x5a7dae['queue']][_0x50b3('0xcd')];_0x1cd31d=this[_0x50b3('0x21')][_0x5a7dae[_0x50b3('0xb6')]][_0x50b3('0xce')];hopperUtils['verifyAdditionalPhones'](_0x334c03,_0x334c03[_0x50b3('0xca')],_0x51ddc7[_0x50b3('0xcf')])['then'](function(_0x208fab){_0x58262c=_0x208fab['additional']==0x1;if(_0x334c03[_0x50b3('0xd0')]>=_0x1f362a[_0x50b3('0x21')][_0x5a7dae[_0x50b3('0xb6')]][_0x50b3('0xd1')]){_0x1f362a['queueCallerAbandonCreateState'](_0x334c03,_0x208fab[_0x50b3('0xd2')]);}else{hopperUtils[_0x50b3('0xd3')]({'active':![],'countdropretry':_0x334c03[_0x50b3('0xd0')],'scheduledat':moment()['add'](_0x1f362a[_0x50b3('0x21')][_0x5a7dae[_0x50b3('0xb6')]]['dialDropRetryFrequency'],_0x50b3('0xd4'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x51ddc7[_0x50b3('0xd5')],'ListId':_0x51ddc7[_0x50b3('0xd6')],'VoiceQueueId':_0x51ddc7[_0x50b3('0xd7')]||undefined,'CampaignId':_0x51ddc7['CampaignId']||undefined})[_0x50b3('0x9b')](loggerCatch('[rescheduleContact][Drop]'));var _0xcb7235=new History(_0x334c03);_0xcb7235[_0x50b3('0xca')]=0xa;_0xcb7235['statedesc']=_0x50b3('0xcb');_0xcb7235[_0x50b3('0xd8')]=moment()[_0x50b3('0x42')](_0x50b3('0xc1'));_0xcb7235[_0x50b3('0x6a')]=_0xcb7235[_0x50b3('0xd8')];_0xcb7235['calleridname']=_0x334c03[_0x50b3('0xd9')];_0xcb7235[_0x50b3('0xda')]=_0x334c03[_0x50b3('0xda')];hopperUtils[_0x50b3('0xdb')](_0xcb7235)['catch'](loggerCatch(_0x50b3('0xdc')));}})[_0x50b3('0x97')](function(){if(_0x58262c)hopperUtils[_0x50b3('0xdd')](_0x334c03,_0x537b83,_0x1cd31d)[_0x50b3('0x97')](function(){return 0x1;});});}else{this[_0x50b3('0x21')][_0x5a7dae[_0x50b3('0xb6')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0x50b3('0x21')][_0x5a7dae[_0x50b3('0xb6')]]['outboundDropCallsDayCallersExit']+=0x1;_0x334c03[_0x50b3('0xca')]=0xb;_0x334c03[_0x50b3('0x69')]=_0x50b3('0xde');_0x334c03[_0x50b3('0xdf')]='CALLEREXIT';_0x334c03[_0x50b3('0xe0')]+=0x1;_0x334c03[_0x50b3('0xe1')]+=0x1;_0x537b83=this[_0x50b3('0x21')][_0x5a7dae['queue']]['dialAbandonedRetryFrequency'];_0x1cd31d=this[_0x50b3('0x21')][_0x5a7dae[_0x50b3('0xb6')]][_0x50b3('0xce')];hopperUtils[_0x50b3('0xe2')](_0x334c03,_0x334c03[_0x50b3('0xca')],_0x51ddc7[_0x50b3('0xcf')])[_0x50b3('0x97')](function(_0x2d7413){if(_0x334c03[_0x50b3('0xe0')]>=_0x1f362a['voiceQueues'][_0x5a7dae[_0x50b3('0xb6')]][_0x50b3('0xe3')]){_0x1f362a[_0x50b3('0xe4')](_0x334c03,_0x2d7413['additional']);}else{hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0x334c03[_0x50b3('0xe0')],'scheduledat':moment()[_0x50b3('0xe5')](_0x1f362a[_0x50b3('0x21')][_0x5a7dae[_0x50b3('0xb6')]][_0x50b3('0xe6')],_0x50b3('0xd4'))[_0x50b3('0x42')](_0x50b3('0xc1')),'ContactId':_0x51ddc7[_0x50b3('0xd5')],'ListId':_0x51ddc7[_0x50b3('0xd6')],'VoiceQueueId':_0x51ddc7[_0x50b3('0xd7')]||undefined,'CampaignId':_0x51ddc7[_0x50b3('0xe7')]||undefined})['catch'](loggerCatch(_0x50b3('0xe8')));var _0x2b195d=new History(_0x334c03);_0x2b195d['state']=0xb;_0x2b195d[_0x50b3('0x69')]=_0x50b3('0xde');_0x2b195d['starttime']=moment()['format'](_0x50b3('0xc1'));_0x2b195d['endtime']=_0x2b195d[_0x50b3('0xd8')];_0x2b195d[_0x50b3('0xd9')]=_0x334c03[_0x50b3('0xd9')];_0x2b195d['calleridnum']=_0x334c03[_0x50b3('0xda')];hopperUtils['createHistory'](_0x2b195d)[_0x50b3('0x9b')](loggerCatch(_0x50b3('0xe9')));}})['then'](function(){if(_0x58262c)hopperUtils[_0x50b3('0xdd')](_0x334c03,_0x537b83,_0x1cd31d)[_0x50b3('0x97')](function(){return 0x1;});});}}}};Dialer[_0x50b3('0x1d')]['syncNewExten']=function(_0x45dde3){if(this[_0x50b3('0xea')][_0x45dde3['uniqueid']]){this[_0x50b3('0xea')][_0x45dde3[_0x50b3('0xb7')]][_0x50b3('0xeb')]=_0x45dde3[_0x50b3('0xeb')];}if(this[_0x50b3('0xba')][_0x45dde3[_0x50b3('0xb7')]]){this['uniqueId'][_0x45dde3[_0x50b3('0xb7')]]['channel']=_0x45dde3['channel'];}};Dialer['prototype']['syncQueueMember']=function(_0x578def){if(!this[_0x50b3('0xea')][_0x578def[_0x50b3('0xec')]]){return;}var _0x5aebf6=this[_0x50b3('0x21')][this[_0x50b3('0xea')][_0x578def['actionid']]['queue']][_0x50b3('0xed')]||_0x50b3('0xee');if(_0x5aebf6===_0x50b3('0xef')){if(this[_0x50b3('0xea')][_0x578def['actionid']]&&_[_0x50b3('0xf0')](this[_0x50b3('0xea')][_0x578def[_0x50b3('0xec')]]['locked'])&&_0x578def[_0x50b3('0x83')]==='1'&&_0x578def[_0x50b3('0xf1')]==='0'){if(this[_0x50b3('0x23')][_0x578def[_0x50b3('0xf2')]]){if(!this[_0x50b3('0x23')][_0x578def[_0x50b3('0xf2')]][_0x50b3('0xf3')]){this['agents'][_0x578def[_0x50b3('0xf2')]][_0x50b3('0xf3')]=!![];this[_0x50b3('0xea')][_0x578def[_0x50b3('0xec')]][_0x50b3('0xf3')]=!![];this[_0x50b3('0xea')][_0x578def[_0x50b3('0xec')]][_0x50b3('0xf2')]=_0x578def[_0x50b3('0xf2')];}}}}else if(_0x5aebf6===_0x50b3('0xee')){if(this[_0x50b3('0xea')][_0x578def[_0x50b3('0xec')]]){if(this[_0x50b3('0x23')][_0x578def['stateinterface']]){this[_0x50b3('0xea')][_0x578def[_0x50b3('0xec')]][_0x50b3('0xf2')]=_0x578def['stateinterface'];if(_[_0x50b3('0xf0')](this[_0x50b3('0x29')][this[_0x50b3('0xea')][_0x578def[_0x50b3('0xec')]][_0x50b3('0xb6')]])){this[_0x50b3('0x29')][this['actions'][_0x578def[_0x50b3('0xec')]][_0x50b3('0xb6')]]=[];}this[_0x50b3('0x29')][this[_0x50b3('0xea')][_0x578def['actionid']]['queue']][_0x50b3('0x9c')](_[_0x50b3('0x5c')](_['pick'](this[_0x50b3('0xea')][_0x578def[_0x50b3('0xec')]],['idHopper','stateinterface']),{'status':_0x578def[_0x50b3('0x83')],'paused':_0x578def[_0x50b3('0xf1')]}));}}}};Dialer[_0x50b3('0x1d')][_0x50b3('0xf4')]=function(_0x29c16c){if(!this['actions'][_0x29c16c[_0x50b3('0xec')]]){return;}var _0x482bd1=this;var _0x14f07d=this[_0x50b3('0x21')][this['actions'][_0x29c16c[_0x50b3('0xec')]][_0x50b3('0xb6')]];var _0x45c507=_0x14f07d[_0x50b3('0xed')]||_0x50b3('0xee');if(_0x45c507===_0x50b3('0xef')){if(this[_0x50b3('0xea')][_0x29c16c['actionid']]&&this[_0x50b3('0xea')][_0x29c16c[_0x50b3('0xec')]][_0x50b3('0xf2')]){this['preview'][_0x50b3('0xf5')](this[_0x50b3('0xea')][_0x29c16c[_0x50b3('0xec')]][_0x50b3('0xf6')],this[_0x50b3('0xea')][_0x29c16c['actionid']]['stateinterface'])[_0x50b3('0x9b')](function(_0x3af91e){logger[_0x50b3('0x61')]('[Catch][Preview][syncQueueStatusComplete]',util[_0x50b3('0x41')](_0x3af91e,{'showHidden':![],'depth':null}));})[_0x50b3('0xf7')](function(){_0x482bd1[_0x50b3('0xb9')](_0x482bd1[_0x50b3('0x21')][_0x482bd1[_0x50b3('0xea')][_0x29c16c['actionid']][_0x50b3('0xb6')]]);_0x482bd1[_0x50b3('0x23')][_0x482bd1[_0x50b3('0xea')][_0x29c16c[_0x50b3('0xec')]][_0x50b3('0xf2')]][_0x50b3('0xf3')]=![];delete _0x482bd1[_0x50b3('0xea')][_0x29c16c['actionid']];unlockQueueStatus(_0x14f07d);});}else{this[_0x50b3('0xb9')](this[_0x50b3('0x21')][this['actions'][_0x29c16c[_0x50b3('0xec')]][_0x50b3('0xb6')]]);hopperUtils[_0x50b3('0xd3')]({'active':![],'ContactId':this[_0x50b3('0xea')][_0x29c16c[_0x50b3('0xec')]][_0x50b3('0xd5')],'ListId':this[_0x50b3('0xea')][_0x29c16c[_0x50b3('0xec')]]['ListId'],'VoiceQueueId':this['actions'][_0x29c16c[_0x50b3('0xec')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x50b3('0xea')][_0x29c16c[_0x50b3('0xec')]][_0x50b3('0xe7')]||undefined})['catch'](loggerCatch(_0x50b3('0xf8')));delete this[_0x50b3('0xea')][_0x29c16c['actionid']];unlockQueueStatus(_0x14f07d);}}else if(_0x45c507===_0x50b3('0xee')){var _0xc403e0;if(this[_0x50b3('0xea')][_0x29c16c['actionid']]&&!_['isEmpty'](this[_0x50b3('0x29')][this['actions'][_0x29c16c[_0x50b3('0xec')]][_0x50b3('0xb6')]])){if(this[_0x50b3('0x2a')][_0x482bd1[_0x50b3('0xea')][_0x29c16c['actionid']][_0x50b3('0xb6')]]){this[_0x50b3('0x2a')][_0x482bd1['actions'][_0x29c16c['actionid']][_0x50b3('0xb6')]]=this['queueBookedRR'][this[_0x50b3('0xea')][_0x29c16c[_0x50b3('0xec')]][_0x50b3('0xb6')]]?this[_0x50b3('0x2a')][this[_0x50b3('0xea')][_0x29c16c[_0x50b3('0xec')]]['queue']]:this[_0x50b3('0x29')][this[_0x50b3('0xea')][_0x29c16c[_0x50b3('0xec')]][_0x50b3('0xb6')]]?this[_0x50b3('0x29')][this[_0x50b3('0xea')][_0x29c16c[_0x50b3('0xec')]][_0x50b3('0xb6')]][_0x50b3('0xf9')]||0x0:0x0;}this[_0x50b3('0x29')][this[_0x50b3('0xea')][_0x29c16c['actionid']][_0x50b3('0xb6')]]['_rr']=this[_0x50b3('0x2a')][this[_0x50b3('0xea')][_0x29c16c['actionid']][_0x50b3('0xb6')]];for(var _0x1c95b4=0x0;_0x1c95b4=_0x87fe71[_0x50b3('0x11f')]){_0x4bd18a[_0x50b3('0x120')](_0x1e9890,_0x41d20f,_0x2ac481,_0x50b3('0x121'));}else{if(_0x1e9890[_0x50b3('0x11e')]>=_0x87fe71[_0x50b3('0x122')]){_0x4bd18a['createStateFinal'](_0x1e9890,_0x41d20f,_0x2ac481,'reason\x2019\x20machine....');}else{hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x1e9890['countmachineretry'],'scheduledat':moment()[_0x50b3('0xe5')](_0x87fe71[_0x50b3('0x123')],_0x50b3('0xd4'))[_0x50b3('0x42')](_0x50b3('0xc1')),'ContactId':_0x1e9890[_0x50b3('0xd5')],'ListId':_0x1e9890[_0x50b3('0xd6')],'VoiceQueueId':_0x1e9890[_0x50b3('0xd7')]||undefined,'CampaignId':_0x1e9890['CampaignId']||undefined})[_0x50b3('0x9b')](loggerCatch('[rescheduleContact][Machine]'));_0x41d20f({'reschedule':0x1});}}});}if(_0x101bf[_0x50b3('0x3f')]===_0x50b3('0xb8')&&this[_0x50b3('0x22')][_0x101bf[_0x50b3('0xb6')]][_0x50b3('0x10b')]&&_0x3c0867['value']===_0x50b3('0x10c')){delete this[_0x50b3('0xba')][_0x3c0867[_0x50b3('0xb7')]];this['updateOriginated'](this[_0x50b3('0x22')][_0x101bf[_0x50b3('0xb6')]]);_0x389b2b=new Hangup(_0x101bf,_0x3c0867);_0x389b2b['state']=0x12;_0x389b2b[_0x50b3('0x69')]=_0x50b3('0x10d');_0x389b2b[_0x50b3('0x10e')]=_0x50b3('0x10f');ami[_0x50b3('0x110')]('custom:amd',ut[_0x50b3('0x119')](_0x389b2b,_0x50b3('0x112')));this[_0x50b3('0x113')](_0x389b2b,_0x50b3('0x124'),_0x50b3('0x125'));}if(_0x101bf['type']===_0x50b3('0xb8')&&this['campaigns'][_0x101bf[_0x50b3('0xb6')]][_0x50b3('0x10b')]&&_0x3c0867[_0x50b3('0x115')]===_0x50b3('0x116')){return new Promise(function(_0x2811b4,_0x269537){delete _0x4bd18a['uniqueId'][_0x3c0867[_0x50b3('0xb7')]];_0x4bd18a[_0x50b3('0xb9')](_0x4bd18a[_0x50b3('0x22')][_0x101bf[_0x50b3('0xb6')]]);_0x4bd18a[_0x50b3('0x22')][_0x101bf[_0x50b3('0xb6')]][_0x50b3('0xbb')]+=0x1;_0x4bd18a[_0x50b3('0x22')][_0x101bf['queue']][_0x50b3('0x117')]+=0x1;var _0x4dd09d=_0x4bd18a[_0x50b3('0x22')][_0x101bf['queue']];var _0x4cc2ca=new Hangup(_0x101bf,_0x3c0867);_0x4cc2ca[_0x50b3('0xca')]=0x13;_0x4cc2ca[_0x50b3('0x69')]=_0x50b3('0x118');_0x4cc2ca['membername']=_0x50b3('0x10f');_0x4cc2ca[_0x50b3('0x11e')]+=0x1;_0x4cc2ca[_0x50b3('0xe1')]+=0x1;_0x4cc2ca['amd']=!![];ami[_0x50b3('0x110')](_0x50b3('0x111'),ut[_0x50b3('0x119')](_0x4cc2ca,'amd'));hopperUtils[_0x50b3('0xdb')](_0x4cc2ca)[_0x50b3('0x9b')](loggerCatch(_0x50b3('0x126')));if(_0x4cc2ca[_0x50b3('0x11a')]+_0x4cc2ca[_0x50b3('0x11b')]+_0x4cc2ca['countnoanswerretry']+_0x4cc2ca[_0x50b3('0x11d')]+_0x4cc2ca['countdropretry']+_0x4cc2ca['countabandonedretry']+_0x4cc2ca[_0x50b3('0x11e')]+_0x4cc2ca[_0x50b3('0x127')]>=_0x4dd09d[_0x50b3('0x11f')]){_0x4bd18a[_0x50b3('0x120')](_0x4cc2ca,_0x2811b4,_0x269537,_0x50b3('0x121'));}else{if(_0x4cc2ca[_0x50b3('0x11e')]>=_0x4dd09d[_0x50b3('0x122')]){_0x4bd18a[_0x50b3('0x128')](_0x4cc2ca,_0x2811b4,_0x269537,_0x50b3('0x129'));}else{hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x4cc2ca[_0x50b3('0x11e')],'scheduledat':moment()[_0x50b3('0xe5')](_0x4dd09d[_0x50b3('0x123')],_0x50b3('0xd4'))[_0x50b3('0x42')](_0x50b3('0xc1')),'ContactId':_0x4cc2ca['ContactId'],'ListId':_0x4cc2ca['ListId'],'VoiceQueueId':_0x4cc2ca[_0x50b3('0xd7')]||undefined,'CampaignId':_0x4cc2ca[_0x50b3('0xe7')]||undefined})[_0x50b3('0x9b')](loggerCatch(_0x50b3('0x12a')));_0x2811b4({'reschedule':0x1});}}});}}};Dialer['prototype']['syncHangup']=function(_0x2b84e1){var _0x1927ff=this['uniqueId'][_0x2b84e1['uniqueid']];var _0xfcf482;if(_0x1927ff&&_0x1927ff[_0x50b3('0x3f')]===_0x50b3('0xb8')){delete this[_0x50b3('0xba')][_0x2b84e1[_0x50b3('0xb7')]];this['updateOriginated'](this[_0x50b3('0x22')][_0x1927ff[_0x50b3('0xb6')]]);this[_0x50b3('0x22')][_0x1927ff['queue']][_0x50b3('0x12b')]+=0x1;_0xfcf482=new Hangup(_0x1927ff,_0x2b84e1);hopperUtils['createHistory'](_0xfcf482)[_0x50b3('0x9b')](loggerCatch(_0x50b3('0x12c')));hopperUtils[_0x50b3('0x12d')](_0xfcf482)[_0x50b3('0x9b')](loggerCatch(_0x50b3('0x12e')));}if(_0x1927ff&&_0x1927ff[_0x50b3('0x3f')]!==_0x50b3('0xb8')&&isNotNull(this['voiceQueues'][_0x1927ff[_0x50b3('0xb6')]][_0x50b3('0x12f')])){delete this['uniqueId'][_0x2b84e1[_0x50b3('0xb7')]];this['updateOriginated'](this[_0x50b3('0x21')][_0x1927ff[_0x50b3('0xb6')]]);this[_0x50b3('0x21')][_0x1927ff['queue']][_0x50b3('0xbb')]+=0x1;this['voiceQueues'][_0x1927ff[_0x50b3('0xb6')]][_0x50b3('0x117')]+=0x1;_0xfcf482=new Hangup(_0x1927ff,_0x2b84e1);_0xfcf482[_0x50b3('0xca')]=0x10;_0xfcf482[_0x50b3('0x69')]=_0x50b3('0x130');_0xfcf482[_0x50b3('0x10e')]='AGI';hopperUtils['createHistory'](_0xfcf482)[_0x50b3('0x9b')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils[_0x50b3('0x12d')](_0xfcf482)[_0x50b3('0x9b')](loggerCatch('[syncHangupIvr]'));}if(_0x1927ff&&_0x1927ff['type']!==_0x50b3('0xb8')&&!isNotNull(this[_0x50b3('0x21')][_0x1927ff[_0x50b3('0xb6')]][_0x50b3('0x12f')])){delete this[_0x50b3('0xba')][_0x2b84e1[_0x50b3('0xb7')]];this[_0x50b3('0xb9')](this[_0x50b3('0x21')][_0x1927ff[_0x50b3('0xb6')]]);this[_0x50b3('0x21')][_0x1927ff[_0x50b3('0xb6')]][_0x50b3('0x131')]+=0x1;_0xfcf482=new Hangup(_0x1927ff,_0x2b84e1);_0xfcf482[_0x50b3('0xca')]=0xc;_0xfcf482[_0x50b3('0x69')]=_0x2b84e1[_0x50b3('0x132')];_0xfcf482[_0x50b3('0x10e')]=_0x50b3('0x133');hopperUtils[_0x50b3('0xdb')](_0xfcf482)[_0x50b3('0x9b')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils[_0x50b3('0x12d')](_0xfcf482)[_0x50b3('0x9b')](loggerCatch(_0x50b3('0x12e')));}};Dialer[_0x50b3('0x1d')][_0x50b3('0xc')]=function(_0x24a922){var _0x1a41d8=this;if(!_0x1a41d8['queuesSummary'][_0x24a922[_0x50b3('0x44')]]){_0x1a41d8[_0x50b3('0x2b')][_0x24a922['name']]={'running':![]};}else if(_0x1a41d8['queuesSummary'][_0x24a922['name']][_0x50b3('0x134')]===!![]){return;}else if(_0x1a41d8[_0x50b3('0x2b')][_0x24a922[_0x50b3('0x44')]][_0x50b3('0x134')]===![]){_0x1a41d8[_0x50b3('0x2b')][_0x24a922[_0x50b3('0x44')]][_0x50b3('0x134')]=!![];}var _0xf2d8c8=_0x1a41d8[_0x50b3('0x21')][_0x24a922['name']];var _0x30b508=_0xf2d8c8[_0x50b3('0x63')]!==utils[_0x50b3('0x64')]['INACTIVE'];var _0x1e67c8=utils[_0x50b3('0x135')](_0xf2d8c8);_0xf2d8c8[_0x50b3('0x136')]=utils[_0x50b3('0x137')](_0xf2d8c8,_0x1a41d8[_0x50b3('0x81')]);Promise[_0x50b3('0x138')]()[_0x50b3('0x97')](function(){if(_0xf2d8c8[_0x50b3('0x136')]===utils[_0x50b3('0x64')][_0x50b3('0x139')]){if(_0x30b508){clearPredictiveAttributes(_0xf2d8c8);_0x24a922[_0x50b3('0x5e')]=undefined;_0x24a922[_0x50b3('0x27')]=undefined;}if(_0xf2d8c8[_0x50b3('0x136')]===utils[_0x50b3('0x64')][_0x50b3('0x139')]){_0x24a922[_0x50b3('0x13a')]=0x0;_0x24a922[_0x50b3('0xf1')]=0x0;_0x24a922[_0x50b3('0x13b')]=0x0;_0x24a922[_0x50b3('0x13c')]=0x0;_0x24a922['pTalking']=0x0;}}else if(_0xf2d8c8[_0x50b3('0x136')]===utils[_0x50b3('0x64')]['ACTIVE']&&!_0x1e67c8){return _0x1a41d8[_0x50b3('0x8a')](_0xf2d8c8,!![])[_0x50b3('0x97')](function(){return _0x1a41d8['ifTime'](_0xf2d8c8,![]);})[_0x50b3('0x97')](function(){return _0x1a41d8['checkDialMethod'](_0xf2d8c8);})[_0x50b3('0x9b')](function(_0x371c2e){loggerSyncQueueSummary[_0x50b3('0x77')]('[syncQueueSummary]',util['inspect'](_0x371c2e,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0xf2d8c8);});}else{clearPredictiveAttributes(_0xf2d8c8);}})[_0x50b3('0x97')](function(){var _0x2817cc=_0x24a922[_0x50b3('0x13d')](_0xf2d8c8);if(_0x2817cc||_0xf2d8c8[_0x50b3('0x13e')]){_0xf2d8c8[_0x50b3('0x13e')]=![];_0x24a922[_0x50b3('0x13f')](_0xf2d8c8);Object[_0x50b3('0x140')](_0xf2d8c8,_0x24a922);emitOutboundVoiceQueueSummary(_0x24a922);}_0x1a41d8['queuesSummary'][_0xf2d8c8[_0x50b3('0x44')]][_0x50b3('0x134')]=![];})[_0x50b3('0x9b')](function(_0xfe81a6){logger[_0x50b3('0x61')](_0x50b3('0x141'),util[_0x50b3('0x41')](_0xfe81a6,{'showHidden':![],'depth':null}));_0x1a41d8[_0x50b3('0x2b')][_0xf2d8c8[_0x50b3('0x44')]][_0x50b3('0x134')]=![];});};Dialer[_0x50b3('0x1d')][_0x50b3('0x34')]=_[_0x50b3('0x142')](function(){var _0x42f627=_['filter'](this[_0x50b3('0x21')],function(_0x587223){return _0x587223['dialPreviewRecallmeReminder'];});var _0x5817c3=_[_0x50b3('0x143')](this[_0x50b3('0x23')],function(_0x5d2484){return _0x5d2484[_0x50b3('0x144')]&&_0x5d2484[_0x50b3('0x83')]===_0x50b3('0x145');});if(_0x42f627[_0x50b3('0x92')]>0x0&&_0x5817c3['length']>0x0){return Promise['resolve']()[_0x50b3('0x97')](cmHopper['handlePreviewRecallNotifications'](_['map'](_0x42f627,'id'),previewRecallmeReminderInterval,_[_0x50b3('0x146')](_0x5817c3,'id')))['then'](function(_0x5efbee){for(var _0x35c5af=0x0;_0x35c5af<_0x5efbee[_0x50b3('0x92')];_0x35c5af++){var _0x4ee5fa=_0x5efbee[_0x35c5af][_0x50b3('0x147')]['name'];if(_0x4ee5fa)io['to'](util[_0x50b3('0x42')]('user:%s',_0x4ee5fa))[_0x50b3('0x110')](_0x50b3('0x148'),{'hopper':_0x5efbee[_0x35c5af]});}})['catch'](function(_0x2bb390){logger[_0x50b3('0x61')](_0x50b3('0x149'),_0x2bb390);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x50b3('0x1d')][_0x50b3('0x14a')]=function(){var _0x2fa170=this;setInterval(function(){_0x2fa170[_0x50b3('0x14b')](_0x2fa170['uniqueId'],_0x50b3('0x14c'));_0x2fa170[_0x50b3('0x14b')](_0x2fa170[_0x50b3('0xea')],_0x50b3('0x14d'));},0x32c8);};Dialer['prototype'][_0x50b3('0x14b')]=function(_0x38aa2b,_0x2f0b8a){var _0x1cb0c9=this;for(var _0x3482f1 in _0x38aa2b){if(typeof _0x38aa2b[_0x3482f1]!==_0x50b3('0xa4')){this['sequence'][_0x50b3('0x1e')](function(){if(!_[_0x50b3('0xf0')](_0x38aa2b[_0x3482f1])){return ami[_0x50b3('0x93')]({'action':_0x50b3('0x83'),'channel':_0x38aa2b[_0x3482f1]['channel']})[_0x50b3('0x9b')](function(_0xb67a56){if(_0xb67a56['message']==='No\x20such\x20channel'){setTimeout(function(){if(_0x38aa2b[_0x3482f1]&&_0x38aa2b[_0x3482f1][_0x50b3('0x3f')]!==_0x50b3('0xb8')){_0x1cb0c9[_0x50b3('0xb9')](_0x1cb0c9[_0x50b3('0x21')][_0x38aa2b[_0x3482f1][_0x50b3('0xb6')]]);logger['error']('[Dialer][checkChannel]',_0x2f0b8a,_0x3482f1,_0x38aa2b[_0x3482f1][_0x50b3('0xb6')]);delete _0x38aa2b[_0x3482f1];}if(_0x38aa2b[_0x3482f1]&&_0x38aa2b[_0x3482f1][_0x50b3('0x3f')]===_0x50b3('0xb8')){_0x1cb0c9[_0x50b3('0xb9')](_0x1cb0c9[_0x50b3('0x22')][_0x38aa2b[_0x3482f1][_0x50b3('0xb6')]]);logger[_0x50b3('0x61')](_0x50b3('0x14e'),_0x2f0b8a,_0x3482f1,_0x38aa2b[_0x3482f1][_0x50b3('0xb6')]);delete _0x38aa2b[_0x3482f1];}},0x2328);}});}});}}};Dialer['prototype'][_0x50b3('0x14f')]=function(_0x5f2fd3){return Promise[_0x50b3('0x138')]()[_0x50b3('0x97')](voiceQueueRt[_0x50b3('0x14f')](_0x5f2fd3))[_0x50b3('0x9b')](loggerCatch(_0x50b3('0x150')));};Dialer['prototype'][_0x50b3('0xb9')]=function(_0x5a86a7){if(!_[_0x50b3('0x51')](_0x5a86a7)&&_0x5a86a7!==null){if(typeof _0x5a86a7[_0x50b3('0x78')]!==_0x50b3('0xa4')){if(_0x5a86a7[_0x50b3('0x78')]>0x0){_0x5a86a7[_0x50b3('0x78')]-=0x1;}else{logger[_0x50b3('0x61')](_0x50b3('0x151'));}}}else{logger[_0x50b3('0x61')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0x50b3('0x1d')]['loggerHandler']=function(_0x46c1f6,_0x50bc9e){var _0x182304=this;return function(_0x47a55e){_0x182304[_0x50b3('0xb9')](_0x50bc9e);logger[_0x50b3('0x61')](_0x46c1f6,util[_0x50b3('0x41')](_0x47a55e,{'showHidden':![],'depth':null}));};};Dialer[_0x50b3('0x1d')][_0x50b3('0x152')]=function(_0x271b3c,_0x151082,_0x377b4f){var _0x1be8ff={'state':0x19,'statedesc':_0x50b3('0x153')};this[_0x50b3('0xb9')](_0x151082);this[_0x50b3('0x113')](_['merge'](_0x1be8ff,_[_0x50b3('0x6e')](_0x377b4f,[_0x50b3('0xd5'),_0x50b3('0xd6'),'UserId',_0x50b3('0xd7'),_0x50b3('0xe7')])),'[emptyContact][createHistory]',_0x50b3('0x154'));logger['error'](_0x271b3c);};Dialer[_0x50b3('0x1d')][_0x50b3('0x113')]=function(_0x19fb76,_0x37a6b9,_0x2c981a){hopperUtils[_0x50b3('0xdb')](_0x19fb76)[_0x50b3('0x9b')](loggerCatch(_0x37a6b9));hopperUtils['moveContactManagedDialer'](_0x19fb76)[_0x50b3('0x9b')](loggerCatch(_0x2c981a));};Dialer[_0x50b3('0x1d')][_0x50b3('0xe4')]=function(_0x8b544e,_0x5caaa7){hopperUtils[_0x50b3('0xdb')](_0x8b544e)[_0x50b3('0x9b')](loggerCatch('[syncAgentComplete][createHistory]'));if(_0x5caaa7==0x0){hopperUtils[_0x50b3('0x12d')](_0x8b544e)[_0x50b3('0x9b')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));}};Dialer[_0x50b3('0x1d')]['checkPreviewRecallReminder']=function(_0x4a8fb9){return Promise[_0x50b3('0x138')]()['then'](cmHopper['handlePreviewRecallNotifications'](_0x4a8fb9['id'],previewRecallmeReminderInterval))[_0x50b3('0x97')](function(_0x1e4137){for(var _0x1f2b3e=0x0;_0x1f2b3e<_0x1e4137[_0x50b3('0x92')];_0x1f2b3e++){var _0x43e92b=_0x1e4137[_0x1f2b3e][_0x50b3('0x147')][_0x50b3('0x44')];if(_0x43e92b)io['to'](util[_0x50b3('0x42')](_0x50b3('0x155'),_0x43e92b))[_0x50b3('0x110')](_0x50b3('0x148'),{'hopper':_0x1e4137[_0x1f2b3e]});}})[_0x50b3('0x9b')](function(){});};Dialer['prototype'][_0x50b3('0xa7')]=function(_0x2e01a2){var _0x1096f0=this;return function(){_0x1096f0['handleIvr'](_0x2e01a2);};};Dialer[_0x50b3('0x1d')][_0x50b3('0x156')]=function(_0x1eeef6,_0x5237d0){var _0x4cb0c7=this;var _0x2ac699=uuid['v4']();this[_0x50b3('0xea')][_0x2ac699]=new Action(_0x1eeef6,_0x5237d0,_0x2ac699);return new Promise(function(_0x54944a,_0xd7591f){if(_[_0x50b3('0x51')](_0x1eeef6)&&typeof _0x1eeef6!=='object'){return _0xd7591f(msgResponse('originate',_0x50b3('0x8b'),_0x50b3('0x157')));}if(_[_0x50b3('0x51')](_0x5237d0[_0x50b3('0x158')])||_0x5237d0[_0x50b3('0x158')]===null){return _0xd7591f(msgResponse(_0x50b3('0x159'),'Failure',_0x50b3('0x15a')));}var _0x471ae0={'XMD-CALLERID':_0x4cb0c7[_0x50b3('0xea')][_0x2ac699]['getCaller'](),'XMD-AGI':_0x1eeef6['dialQueueProject']?util[_0x50b3('0x42')]('\x22agi://%s/square,%s\x22',ipAgi,_0x1eeef6[_0x50b3('0x12f')]):_0x50b3('0x15b'),'XMD-AGIAFTER':_0x1eeef6['dialQueueProject2']?util[_0x50b3('0x42')](_0x50b3('0x15c'),ipAgi,_0x1eeef6[_0x50b3('0xbf')]):_0x50b3('0x15b'),'XMD-QUEUE':utils['isOutboundQueue'](_0x1eeef6)?util['format'](_0x50b3('0x15d'),_0x1eeef6[_0x50b3('0x44')],_0x1eeef6[_0x50b3('0x15e')]||'',_0x1eeef6[_0x50b3('0xc0')]?'c':'',_0x1eeef6[_0x50b3('0xc6')]||0x3):_0x50b3('0x15b'),'XMD-CONTACTID':_0x5237d0[_0x50b3('0xd5')],'XMD-CDRTYPE':_0x50b3('0x7'),'CALLERID(all)':_0x4cb0c7[_0x50b3('0xea')][_0x2ac699][_0x50b3('0x15f')](),'XMD-AMD':_0x1eeef6[_0x50b3('0x10b')]?_0x50b3('0x160'):_0x50b3('0x15b'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x1eeef6[_0x50b3('0x10b')]){_0x471ae0['XMD-AMDINITIALSILENCE']=_0x1eeef6['dialAMDInitialSilence']||0x9c4;_0x471ae0[_0x50b3('0x161')]=_0x1eeef6[_0x50b3('0x162')]||0x5dc;_0x471ae0[_0x50b3('0x163')]=_0x1eeef6[_0x50b3('0x164')]||0x320;_0x471ae0['XMD-AMDTOTALANALYSISTIME']=_0x1eeef6[_0x50b3('0x165')]||0x1388;_0x471ae0[_0x50b3('0x166')]=_0x1eeef6[_0x50b3('0x167')]||0x64;_0x471ae0[_0x50b3('0x168')]=_0x1eeef6['dialAMDBetweenWordsSilence']||0x32;_0x471ae0[_0x50b3('0x169')]=_0x1eeef6[_0x50b3('0x16a')]||0x3;_0x471ae0[_0x50b3('0x16b')]=_0x1eeef6[_0x50b3('0x16c')]||0x100;_0x471ae0['XMD-AMDMAXIMUMWORDLENGTH']=_0x1eeef6[_0x50b3('0x16d')]||0x1388;}if(utils[_0x50b3('0x16e')](_0x1eeef6)){_0x471ae0['XMD-VOICEQUEUEID']=_0x5237d0[_0x50b3('0xd7')];}else{_0x471ae0[_0x50b3('0x16f')]=_0x5237d0['CampaignId'];}var _0xc07a0=utils['setXMDContactVariables'](_0x5237d0[_0x50b3('0x170')]);Object[_0x50b3('0x140')](_0x471ae0,_0xc07a0);var _0x24e32d=_0x4cb0c7[_0x50b3('0x7f')](_0x1eeef6[_0x50b3('0x171')])?utils['getCallerId'](_0x1eeef6[_0x50b3('0x171')][_0x50b3('0x172')],_0x1eeef6[_0x50b3('0x173')],_0x1eeef6[_0x50b3('0x174')]>0x0?utils[_0x50b3('0x175')](_0x1eeef6[_0x50b3('0x176')],_0x1eeef6['dialRandomLastDigitCallerIdNumber']):_0x1eeef6[_0x50b3('0x176')]):utils[_0x50b3('0x177')](_[_0x50b3('0xf0')](_0x1eeef6[_0x50b3('0x85')])?_0x1eeef6[_0x50b3('0x171')][_0x50b3('0x172')]:_0x1eeef6[_0x50b3('0x85')]['callerid'],_0x1eeef6[_0x50b3('0x173')],_0x1eeef6[_0x50b3('0x174')]>0x0?utils[_0x50b3('0x175')](_0x1eeef6[_0x50b3('0x176')],_0x1eeef6[_0x50b3('0x174')]):_0x1eeef6[_0x50b3('0x176')]);if(_0x24e32d){_0x471ae0[_0x50b3('0x178')]=_0x4cb0c7[_0x50b3('0xea')][_0x2ac699][_0x50b3('0x179')]=utils[_0x50b3('0x17a')](_0x24e32d);_0x471ae0[_0x50b3('0x17b')]=_0x5237d0[_0x50b3('0x158')];}_0x1eeef6[_0x50b3('0x17c')]=_0x471ae0;return ami[_0x50b3('0x93')]({'actionid':_0x2ac699,'action':_0x50b3('0x159'),'channel':_0x4cb0c7[_0x50b3('0x7f')](_0x1eeef6[_0x50b3('0x171')])?util[_0x50b3('0x42')](_0x50b3('0x17d'),_0x1eeef6['Trunk'][_0x50b3('0x44')],isNotNull(_0x1eeef6['dialPrefix'])?_0x1eeef6[_0x50b3('0x17e')][_0x50b3('0x17f')]()||'':'',_0x1eeef6[_0x50b3('0x180')]>0x0?_0x5237d0['phone'][_0x50b3('0x181')](_0x1eeef6[_0x50b3('0x180')]):_0x5237d0[_0x50b3('0x158')]):util['format'](_0x50b3('0x17d'),_[_0x50b3('0xf0')](_0x1eeef6[_0x50b3('0x85')])?_0x1eeef6['Trunk']['name']:_0x1eeef6[_0x50b3('0x85')][_0x50b3('0x44')],isNotNull(_0x1eeef6['dialPrefix'])?_0x1eeef6[_0x50b3('0x17e')]['trim']()||'':'',_0x1eeef6['dialCutDigit']>0x0?_0x5237d0[_0x50b3('0x158')][_0x50b3('0x181')](_0x1eeef6[_0x50b3('0x180')]):_0x5237d0[_0x50b3('0x158')]),'callerid':_0x24e32d,'Exten':_0x50b3('0x182'),'Context':_0x50b3('0x183'),'Priority':'1','variable':_0x471ae0,'timeout':(_0x1eeef6[_0x50b3('0x184')]||0x1e)*0x3e8,'async':!![],'channelid':_0x2ac699})[_0x50b3('0x97')](function(_0xabcee9){return _0x54944a(_0xabcee9);})[_0x50b3('0x9b')](function(_0x4e5222){_0x1eeef6['outboundOriginateFailureCallsDay']+=0x1;var _0x1958a9=new History(_0x4cb0c7['actions'][_0x2ac699]);logger[_0x50b3('0x61')](util[_0x50b3('0x42')](_0x50b3('0x185'),JSON[_0x50b3('0x6d')](_0x4e5222)));_0x1958a9[_0x50b3('0xca')]=0xe;_0x1958a9[_0x50b3('0x69')]=_0x50b3('0x186');_0x1958a9['starttime']=moment()[_0x50b3('0x42')](_0x50b3('0xc1'));_0x1958a9[_0x50b3('0x6a')]=_0x1958a9[_0x50b3('0xd8')];hopperUtils[_0x50b3('0xdb')](_0x1958a9)[_0x50b3('0x9b')](loggerCatch(_0x50b3('0x187')));_0x4cb0c7[_0x50b3('0x12d')](_0x1958a9)[_0x50b3('0x9b')](loggerCatch('[originate][error]'))['finally'](function(){delete _0x4cb0c7[_0x50b3('0xea')][_0x2ac699];return _0xd7591f(msgResponse(_0x50b3('0x159'),_0x50b3('0x7e'),_0x50b3('0x188')));});});});};Dialer[_0x50b3('0x1d')][_0x50b3('0x189')]=function(_0x395f0e,_0x165cac,_0x2a1021){var _0x1418ed=new History(_0x165cac);if(_0x1418ed[_0x50b3('0x11a')]+_0x1418ed[_0x50b3('0x11b')]+_0x1418ed[_0x50b3('0x11c')]+_0x1418ed[_0x50b3('0x11d')]+_0x1418ed[_0x50b3('0xd0')]+_0x1418ed[_0x50b3('0xe0')]+_0x1418ed[_0x50b3('0x11e')]+_0x1418ed[_0x50b3('0x127')]>=_0x2a1021[_0x50b3('0x11f')]-0x1){return!![];}switch(_0x395f0e){case 0x3:if(_0x1418ed[_0x50b3('0x11c')]>=_0x2a1021[_0x50b3('0x18a')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countnoanswerretry':_0x1418ed['countnoanswerretry']+=0x1,'scheduledat':moment()['add'](_0x2a1021[_0x50b3('0x18b')],_0x50b3('0xd4'))[_0x50b3('0x42')](_0x50b3('0xc1')),'ContactId':_0x1418ed[_0x50b3('0xd5')],'ListId':_0x1418ed[_0x50b3('0xd6')],'VoiceQueueId':_0x1418ed[_0x50b3('0xd7')]||undefined,'CampaignId':_0x1418ed[_0x50b3('0xe7')]||undefined})[_0x50b3('0x9b')](loggerCatch(_0x50b3('0x18c')));break;case 0x5:if(_0x1418ed[_0x50b3('0x11a')]>=_0x2a1021['dialBusyMaxRetry']-0x1){return!![];}hopperUtils[_0x50b3('0xd3')]({'active':![],'countbusyretry':_0x1418ed[_0x50b3('0x11a')]+=0x1,'scheduledat':moment()[_0x50b3('0xe5')](_0x2a1021[_0x50b3('0x18d')],_0x50b3('0xd4'))[_0x50b3('0x42')](_0x50b3('0xc1')),'ContactId':_0x1418ed[_0x50b3('0xd5')],'ListId':_0x1418ed[_0x50b3('0xd6')],'VoiceQueueId':_0x1418ed[_0x50b3('0xd7')]||undefined,'CampaignId':_0x1418ed['CampaignId']||undefined})[_0x50b3('0x9b')](loggerCatch(_0x50b3('0x18e')));break;case 0x8:if(_0x1418ed['countcongestionretry']>=_0x2a1021[_0x50b3('0x18f')]-0x1){return!![];}hopperUtils[_0x50b3('0xd3')]({'active':![],'countcongestionretry':_0x1418ed[_0x50b3('0x11b')]+=0x1,'scheduledat':moment()['add'](_0x2a1021['dialCongestionRetryFrequency'],'minutes')[_0x50b3('0x42')](_0x50b3('0xc1')),'ContactId':_0x1418ed['ContactId'],'ListId':_0x1418ed[_0x50b3('0xd6')],'VoiceQueueId':_0x1418ed[_0x50b3('0xd7')]||undefined,'CampaignId':_0x1418ed['CampaignId']||undefined})[_0x50b3('0x9b')](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x1418ed[_0x50b3('0x11d')]>=_0x2a1021[_0x50b3('0x190')]-0x1){return!![];}else{hopperUtils['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x1418ed[_0x50b3('0x11d')]+=0x1,'scheduledat':moment()[_0x50b3('0xe5')](_0x2a1021[_0x50b3('0x191')],_0x50b3('0xd4'))['format'](_0x50b3('0xc1')),'ContactId':_0x1418ed[_0x50b3('0xd5')],'ListId':_0x1418ed[_0x50b3('0xd6')],'VoiceQueueId':_0x1418ed[_0x50b3('0xd7')]||undefined,'CampaignId':_0x1418ed[_0x50b3('0xe7')]||undefined})['catch'](loggerCatch(_0x50b3('0x192')));}break;case 0xa:if(_0x1418ed['countdropretry']>=_0x2a1021[_0x50b3('0xd1')]-0x1){return!![];}hopperUtils[_0x50b3('0xd3')]({'active':![],'countdropretry':_0x1418ed['countdropretry']+=0x1,'scheduledat':moment()[_0x50b3('0xe5')](_0x2a1021[_0x50b3('0xcd')],'minutes')[_0x50b3('0x42')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1418ed[_0x50b3('0xd5')],'ListId':_0x1418ed['ListId'],'VoiceQueueId':_0x1418ed[_0x50b3('0xd7')]||undefined,'CampaignId':_0x1418ed[_0x50b3('0xe7')]||undefined})['catch'](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0x1418ed[_0x50b3('0xe0')]>=_0x2a1021[_0x50b3('0xe3')]-0x1){return!![];}hopperUtils[_0x50b3('0xd3')]({'active':![],'countabandonedretry':_0x1418ed['countabandonedretry']+=0x1,'scheduledat':moment()[_0x50b3('0xe5')](_0x2a1021[_0x50b3('0xe6')],'minutes')['format'](_0x50b3('0xc1')),'ContactId':_0x1418ed['ContactId'],'ListId':_0x1418ed[_0x50b3('0xd6')],'VoiceQueueId':_0x1418ed[_0x50b3('0xd7')]||undefined,'CampaignId':_0x1418ed['CampaignId']||undefined})[_0x50b3('0x9b')](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x1418ed['countmachineretry']>=_0x2a1021[_0x50b3('0x122')]-0x1){return!![];}hopperUtils[_0x50b3('0xd3')]({'active':![],'countmachineretry':_0x1418ed[_0x50b3('0x11e')]+=0x1,'scheduledat':moment()[_0x50b3('0xe5')](_0x2a1021[_0x50b3('0x123')],_0x50b3('0xd4'))[_0x50b3('0x42')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1418ed[_0x50b3('0xd5')],'ListId':_0x1418ed['ListId'],'VoiceQueueId':_0x1418ed[_0x50b3('0xd7')]||undefined,'CampaignId':_0x1418ed['CampaignId']||undefined})[_0x50b3('0x9b')](loggerCatch(_0x50b3('0x12a')));break;case 0x14:if(_0x1418ed[_0x50b3('0x127')]>=_0x2a1021[_0x50b3('0x193')]-0x1){return!![];}hopperUtils[_0x50b3('0xd3')]({'active':![],'countagentrejectretry':_0x1418ed[_0x50b3('0x127')]+=0x1,'scheduledat':moment()[_0x50b3('0xe5')](_0x2a1021['dialAgentRejectRetryFrequency'],_0x50b3('0xd4'))[_0x50b3('0x42')](_0x50b3('0xc1')),'ContactId':_0x1418ed[_0x50b3('0xd5')],'ListId':_0x1418ed[_0x50b3('0xd6')],'VoiceQueueId':_0x1418ed[_0x50b3('0xd7')]||undefined,'CampaignId':_0x1418ed['CampaignId']||undefined})[_0x50b3('0x9b')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0x50b3('0x1d')][_0x50b3('0x105')]=function(_0x3a8188,_0x49b7e5,_0x288eed){var _0x1c64cb=this;var _0x2173f6=new History(_0x3a8188);var _0x4060fb=![];var _0x46516b;var _0x6873d;return new Promise(function(_0x4eea48,_0x5db465){if(_[_0x50b3('0x51')](_0x49b7e5)&&typeof _0x49b7e5!==_0x50b3('0x194')){return _0x5db465(msgResponse(_0x50b3('0x195'),_0x50b3('0x8b'),_0x50b3('0x196')));}if(_[_0x50b3('0x51')](_0x288eed)&&typeof _0x288eed!==_0x50b3('0x194')){return _0x5db465(msgResponse('[callProgressDetecting]','Failure',_0x50b3('0x197')));}hopperUtils[_0x50b3('0xe2')](_0x2173f6,_0x288eed[_0x50b3('0xbc')],_0x49b7e5)[_0x50b3('0x97')](function(_0x3f3087){if(_0x3f3087[_0x50b3('0xd2')]==0x1)_0x4060fb=!![];switch(_0x288eed[_0x50b3('0xbc')]){case'0':_0x49b7e5[_0x50b3('0x198')]+=0x1;_0x2173f6[_0x50b3('0xca')]=0x0;_0x2173f6[_0x50b3('0x69')]=_0x50b3('0x199');_0x2173f6[_0x50b3('0x11d')]+=0x1;_0x2173f6['countglobal']+=0x1;ami[_0x50b3('0x110')](_0x50b3('0x19a'),ut[_0x50b3('0x119')](_0x3a8188,_0x50b3('0x19b')));_0x46516b=_0x49b7e5['dialNoSuchNumberRetryFrequency'];_0x6873d=_0x49b7e5[_0x50b3('0xce')];hopperUtils['createHistory'](_0x2173f6)[_0x50b3('0x9b')](loggerCatch(_0x50b3('0x126')));if(_0x1c64cb[_0x50b3('0x189')](0x0,_0x3a8188,_0x49b7e5)&&!_0x4060fb){if(_0x2173f6[_0x50b3('0x11d')]>=_0x49b7e5[_0x50b3('0x190')]){_0x1c64cb[_0x50b3('0x128')](_0x2173f6,_0x4eea48,_0x5db465,_0x50b3('0x19c'));}else{_0x1c64cb[_0x50b3('0x120')](_0x2173f6,_0x4eea48,_0x5db465,_0x50b3('0x19c'));}}break;case'3':_0x49b7e5[_0x50b3('0x19d')]+=0x1;_0x2173f6[_0x50b3('0xca')]=0x3;_0x2173f6[_0x50b3('0x69')]=_0x50b3('0x19e');_0x2173f6[_0x50b3('0x11c')]+=0x1;_0x2173f6[_0x50b3('0xe1')]+=0x1;var _0x50a893=ut[_0x50b3('0x19f')](_0x3a8188,_0x49b7e5);ami['emit'](_0x50b3('0x1a0'),_0x50a893);_0x46516b=_0x49b7e5['dialNoAnswerRetryFrequency'];_0x6873d=_0x49b7e5[_0x50b3('0xce')];hopperUtils[_0x50b3('0xdb')](_0x2173f6)[_0x50b3('0x9b')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x1c64cb[_0x50b3('0x189')](0x3,_0x3a8188,_0x49b7e5)&&!_0x4060fb){if(_0x2173f6['countnoanswerretry']>=_0x49b7e5[_0x50b3('0x18a')]){_0x1c64cb[_0x50b3('0x128')](_0x2173f6,_0x4eea48,_0x5db465,_0x50b3('0x1a1'));}else{_0x1c64cb['stateGlobal'](_0x2173f6,_0x4eea48,_0x5db465,_0x50b3('0x1a1'));}}break;case'5':_0x49b7e5[_0x50b3('0x1a2')]+=0x1;_0x2173f6['state']=0x5;_0x2173f6[_0x50b3('0x69')]=_0x50b3('0x1a3');_0x2173f6[_0x50b3('0x11a')]+=0x1;_0x2173f6[_0x50b3('0xe1')]+=0x1;ami[_0x50b3('0x110')](_0x50b3('0x1a4'),ut[_0x50b3('0x119')](_0x3a8188,_0x50b3('0x1a5')));_0x46516b=_0x49b7e5[_0x50b3('0x18d')];_0x6873d=_0x49b7e5[_0x50b3('0xce')];hopperUtils[_0x50b3('0xdb')](_0x2173f6)[_0x50b3('0x9b')](loggerCatch(_0x50b3('0x1a6')));if(_0x1c64cb[_0x50b3('0x189')](0x5,_0x3a8188,_0x49b7e5)&&!_0x4060fb){if(_0x2173f6[_0x50b3('0x11a')]>=_0x49b7e5['dialBusyMaxRetry']){_0x1c64cb[_0x50b3('0x128')](_0x2173f6,_0x4eea48,_0x5db465,_0x50b3('0x1a7'));}else{_0x1c64cb[_0x50b3('0x120')](_0x2173f6,_0x4eea48,_0x5db465,_0x50b3('0x1a7'));}}break;case'8':_0x49b7e5[_0x50b3('0x1a8')]+=0x1;_0x2173f6[_0x50b3('0xca')]=0x8;_0x2173f6[_0x50b3('0x69')]=_0x50b3('0x1a9');_0x2173f6[_0x50b3('0x11b')]+=0x1;_0x2173f6['countglobal']+=0x1;_0x46516b=_0x49b7e5[_0x50b3('0x1aa')];_0x6873d=_0x49b7e5['callAdditionalPhoneAfterMin'];ami[_0x50b3('0x110')]('custom:agentcongestion',ut[_0x50b3('0x119')](_0x3a8188,_0x50b3('0x1ab')));hopperUtils[_0x50b3('0xdb')](_0x2173f6)[_0x50b3('0x9b')](loggerCatch(_0x50b3('0x1ac')));if(_0x1c64cb['checkRetriveMax'](0x8,_0x3a8188,_0x49b7e5)&&!_0x4060fb){if(_0x2173f6[_0x50b3('0x11b')]>=_0x49b7e5['dialCongestionMaxRetry']){_0x1c64cb[_0x50b3('0x128')](_0x2173f6,_0x4eea48,_0x5db465,_0x50b3('0x1ad'));}else{_0x1c64cb['stateGlobal'](_0x2173f6,_0x4eea48,_0x5db465,_0x50b3('0x1ad'));}}break;case'11':_0x49b7e5[_0x50b3('0x1ae')]+=0x1;_0x2173f6[_0x50b3('0xca')]=0xb;_0x2173f6[_0x50b3('0x69')]=_0x50b3('0xde');_0x2173f6[_0x50b3('0xe0')]+=0x1;_0x2173f6[_0x50b3('0xe1')]+=0x1;_0x46516b=_0x49b7e5['dialAbandonedRetryFrequency'];_0x6873d=_0x49b7e5[_0x50b3('0xce')];hopperUtils[_0x50b3('0xdb')](_0x2173f6)[_0x50b3('0x9b')](loggerCatch(_0x50b3('0xe9')));if(_0x1c64cb['checkRetriveMax'](0xb,_0x3a8188,_0x49b7e5)&&!_0x4060fb){if(_0x2173f6[_0x50b3('0xe0')]>=_0x49b7e5['dialAbandonedMaxRetry']){_0x1c64cb[_0x50b3('0x128')](_0x2173f6,_0x4eea48,_0x5db465,_0x50b3('0x1af'));}else{_0x1c64cb[_0x50b3('0x120')](_0x2173f6,_0x4eea48,_0x5db465,_0x50b3('0x1af'));}}break;case'20':_0x49b7e5[_0x50b3('0x1b0')]+=0x1;_0x2173f6[_0x50b3('0xca')]=0x14;_0x2173f6[_0x50b3('0x69')]=_0x50b3('0x1b1');_0x2173f6[_0x50b3('0x127')]+=0x1;_0x2173f6[_0x50b3('0xe1')]+=0x1;_0x46516b=_0x49b7e5[_0x50b3('0x1b2')];_0x6873d=_0x49b7e5[_0x50b3('0xce')];ami['emit'](_0x50b3('0x1b3'),ut[_0x50b3('0x119')](_0x3a8188,_0x50b3('0x1b4')));hopperUtils['createHistory'](_0x2173f6)[_0x50b3('0x9b')](loggerCatch(_0x50b3('0x1b5')));if(_0x1c64cb['checkRetriveMax'](0x14,_0x3a8188,_0x49b7e5)&&!_0x4060fb){if(_0x2173f6[_0x50b3('0x127')]>=_0x49b7e5[_0x50b3('0x193')]){_0x1c64cb[_0x50b3('0x128')](_0x2173f6,_0x4eea48,_0x5db465,_0x50b3('0x1b6'));}else{_0x1c64cb[_0x50b3('0x120')](_0x2173f6,_0x4eea48,_0x5db465,_0x50b3('0x1b6'));}}break;default:_0x49b7e5[_0x50b3('0x131')]+=0x1;_0x2173f6[_0x50b3('0xca')]=0xc;_0x2173f6['statedesc']=_0x288eed[_0x50b3('0xbc')];_0x46516b=_0x49b7e5[_0x50b3('0x1b2')];_0x6873d=_0x49b7e5[_0x50b3('0xce')];hopperUtils[_0x50b3('0xdb')](_0x2173f6)[_0x50b3('0x9b')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x1c64cb[_0x50b3('0x189')](_0x288eed[_0x50b3('0xbc')],_0x3a8188,_0x49b7e5)&&!_0x4060fb){if(_0x2173f6[_0x50b3('0x11a')]+_0x2173f6[_0x50b3('0x11b')]+_0x2173f6[_0x50b3('0x11c')]+_0x2173f6['countnosuchnumberretry']+_0x2173f6[_0x50b3('0xd0')]+_0x2173f6[_0x50b3('0xe0')]+_0x2173f6['countmachineretry']+_0x2173f6['countagentrejectretry']>=_0x49b7e5[_0x50b3('0x11f')]){_0x1c64cb[_0x50b3('0x120')](_0x2173f6,_0x4eea48,_0x5db465,_0x288eed[_0x50b3('0xbc')]);}else{_0x1c64cb[_0x50b3('0x128')](_0x2173f6,_0x4eea48,_0x5db465,_0x288eed[_0x50b3('0xbc')]);}}}})['then'](function(){if(_0x4060fb){hopperUtils[_0x50b3('0xdd')](_0x2173f6,_0x46516b,_0x6873d)[_0x50b3('0x97')](function(){return _0x4eea48(0x1);});}});});};Dialer[_0x50b3('0x1d')][_0x50b3('0x120')]=function(_0x17d144,_0x134f2e,_0x4fc92d,_0x1a2499){var _0x270eae=new Final(_0x17d144);_0x270eae['state']=0xf;_0x270eae[_0x50b3('0x69')]=_0x50b3('0x1b7');this[_0x50b3('0x128')](_0x270eae,_0x134f2e,_0x4fc92d,_0x1a2499);};Dialer[_0x50b3('0x1d')][_0x50b3('0x128')]=function(_0x5813c4,_0x4f7c0d,_0x12e788,_0x3764b4){hopperUtils[_0x50b3('0x12d')](_0x5813c4)['then'](function(){return _0x4f7c0d(msgResponse(_0x50b3('0x195'),_0x50b3('0x1b8'),_0x3764b4));})['catch'](function(){return _0x12e788(msgResponse('[moveContactManagedDialer][0]','Failure','contact\x20not\x20moved'));});};Dialer['prototype'][_0x50b3('0xa')]=function(_0x33c29a){var _0x51d3af=_0x33c29a[_0x50b3('0x1b9')]/0x64;var _0x2dbf81=_0x33c29a['outboundDropCallsDayTimeout']/(_0x33c29a[_0x50b3('0xc8')]+_0x33c29a['outboundAnswerCallsDay']);var _0x3c4dff=Math[_0x50b3('0x1ba')](_0x33c29a[_0x50b3('0x1bb')]*(_0x33c29a['predictiveIntervalMaxThreshold']/0x64));var _0x11b7eb=Math[_0x50b3('0x1ba')](_0x33c29a[_0x50b3('0x1bb')]*(_0x33c29a['predictiveIntervalMinThreshold']/0x64));var _0x223970=_0x33c29a['available']+_0x33c29a[_0x50b3('0x13c')];var _0x57b600=Math[_0x50b3('0x1bc')](_0x33c29a[_0x50b3('0x56')]*_0x33c29a[_0x50b3('0x5b')]*_0x33c29a[_0x50b3('0x1bd')]*_0x33c29a[_0x50b3('0x1be')]);if(_[_0x50b3('0x51')](_0x33c29a['startProgressive'])){if(!_[_0x50b3('0x51')](_0x33c29a[_0x50b3('0x5e')])){_0x33c29a[_0x50b3('0x5e')]=undefined;loggerPredictive[_0x50b3('0x61')](_0x50b3('0x1bf'),_0x50b3('0x1c0'));}if(!_[_0x50b3('0x51')](_0x33c29a[_0x50b3('0x60')])){loggerPredictive[_0x50b3('0x61')](_0x50b3('0x1bf'),_0x50b3('0x1c1'));clearInterval(_0x33c29a[_0x50b3('0x60')]);_0x33c29a[_0x50b3('0x60')]=undefined;}_0x33c29a[_0x50b3('0x27')]=moment()['format'](_0x50b3('0xc1'));loggerPredictive[_0x50b3('0x47')](_0x33c29a[_0x50b3('0x44')],_0x50b3('0x1c2'),_0x33c29a[_0x50b3('0x27')]);this[_0x50b3('0xab')](_0x33c29a,0x1);}else if(ifInterval(_0x33c29a['dialPredictiveInterval'],_0x33c29a[_0x50b3('0x27')])){this[_0x50b3('0xab')](_0x33c29a,0x1);loggerPredictiveCalls['info'](_0x50b3('0x1c3'),_0x33c29a[_0x50b3('0x27')],_0x33c29a[_0x50b3('0x44')]);_0x33c29a[_0x50b3('0x56')]=0x0;_0x33c29a[_0x50b3('0xc9')]=0x0;}else if(_0x51d3af<_0x2dbf81&&_0x33c29a[_0x50b3('0x1c4')]===_0x50b3('0x1c5')){clearPredictiveAttributes(_0x33c29a);loggerPredictive['info'](_0x50b3('0x1c6'),_0x50b3('0x1c7'),_0x2dbf81,'startProgressive',_0x33c29a[_0x50b3('0x44')]);}else if(_0x57b600<_0x33c29a[_0x50b3('0xc9')]&&_0x33c29a['dialPredictiveOptimization']==='dropRate'){clearPredictiveAttributes(_0x33c29a);loggerPredictive[_0x50b3('0x47')](_0x50b3('0x1c8'),_0x50b3('0x1c9'),_0x57b600,_0x50b3('0x1ca'),_0x33c29a[_0x50b3('0xc9')],_0x50b3('0x27'),_0x33c29a[_0x50b3('0x44')]);}else if(!ifInterval(_0x33c29a[_0x50b3('0x1cb')],_0x33c29a[_0x50b3('0x27')])&&_[_0x50b3('0x51')](_0x33c29a['startPredictive'])&&!_[_0x50b3('0x51')](_0x33c29a['startProgressive'])){_0x33c29a['startPredictive']=moment()[_0x50b3('0x42')](_0x50b3('0xc1'));loggerPredictive[_0x50b3('0x47')](_0x33c29a[_0x50b3('0x44')],_0x50b3('0x1cc'),_0x33c29a[_0x50b3('0x5e')]);hopperUtils[_0x50b3('0x1cd')](_0x33c29a[_0x50b3('0x1cb')])[_0x50b3('0x97')](this[_0x50b3('0x1ce')](_0x33c29a))['then'](mergeDataErlangB(_0x33c29a))[_0x50b3('0x97')](this[_0x50b3('0x1cf')](_0x33c29a))['catch'](loggerCatchPredictive(_0x50b3('0x1d0'),_0x33c29a));}else if(!ifInterval(_0x33c29a[_0x50b3('0x1cb')],_0x33c29a['startPredictive'])){_0x33c29a[_0x50b3('0xc9')]=0x0;_0x33c29a[_0x50b3('0x5e')]=moment()[_0x50b3('0x42')](_0x50b3('0xc1'));loggerPredictive[_0x50b3('0x47')](_0x33c29a[_0x50b3('0x44')],_0x50b3('0x1d1'),_0x33c29a['startPredictive']);clearInterval(_0x33c29a[_0x50b3('0x60')]);_0x33c29a['handlePredictive']=undefined;hopperUtils['avgHandleTime'](_0x33c29a[_0x50b3('0x1cb')])['then'](this[_0x50b3('0x1ce')](_0x33c29a))[_0x50b3('0x97')](mergeDataErlangB(_0x33c29a))[_0x50b3('0x97')](this[_0x50b3('0x1cf')](_0x33c29a))[_0x50b3('0x9b')](loggerCatchPredictive(_0x50b3('0x1d2'),_0x33c29a));}else if(_0x33c29a[_0x50b3('0x1bb')]&&_0x223970<_0x33c29a['predictiveIntervalAvailable']-_0x11b7eb){clearPredictiveAttributes(_0x33c29a);loggerPredictive['info'](_0x33c29a[_0x50b3('0x44')],_0x50b3('0x1d3'),_0x223970,')\x20are\x20less\x20than\x20threshold\x20(',_0x33c29a[_0x50b3('0x1bb')],'-',_0x11b7eb,'=',_0x33c29a['predictiveIntervalAvailable']-_0x11b7eb,')');}else if(_0x33c29a['predictiveIntervalAvailable']&&_0x223970>_0x33c29a['predictiveIntervalAvailable']+_0x3c4dff){clearPredictiveAttributes(_0x33c29a);loggerPredictive[_0x50b3('0x47')](_0x33c29a['name'],_0x50b3('0x1d3'),_0x223970,_0x50b3('0x1d4'),_0x33c29a[_0x50b3('0x1bb')],'+',_0x3c4dff,'=',_0x33c29a[_0x50b3('0x1bb')]+_0x3c4dff,')');}};Dialer[_0x50b3('0x1d')][_0x50b3('0x1ce')]=function(_0x380ecf){var _0x4ebb5b=this;return function(_0x5db1a){return new Promise(function(_0x2172d8,_0x59e0bf){_[_0x50b3('0x5c')](_0x380ecf,_0x5db1a[0x0]);if(checkGetDataPredictive(_0x5db1a[0x0])){var _0x3aafe7=_0x380ecf[_0x50b3('0x1bb')]=_0x380ecf[_0x50b3('0x13c')]+_0x380ecf['available'];var _0x3bd76e=_0x380ecf['dialPredictiveInterval']*0x3c;var _0x37f3ec=_0x5db1a[0x0][_0x50b3('0x4f')]+_0x5db1a[0x0][_0x50b3('0x4d')];var _0x23649c=(_0x5db1a[0x0]['predictiveIntervalAnsweredCalls']+_0x5db1a[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x5db1a[0x0][_0x50b3('0x4b')])/_0x5db1a[0x0]['predictiveIntervalTotalCalls'];_0x380ecf[_0x50b3('0x1bd')]=_0x23649c>0x0?_0x23649c:0x1;switch(_0x380ecf['dialPredictiveOptimization']){case _0x50b3('0x1c5'):var _0x3f1210=_0x380ecf[_0x50b3('0x1b9')]/0x64;return _0x4ebb5b[_0x50b3('0x1d5')](_0x3aafe7,_0x3bd76e,_0x37f3ec,_0x23649c,_0x3f1210)[_0x50b3('0x97')](function(_0x480c64){return _0x2172d8(_0x480c64);});case'agentBusyFactor':var _0xcad051=_0x380ecf[_0x50b3('0x1b9')]/0x64;return _0x4ebb5b[_0x50b3('0x1d6')](_0x3aafe7,_0x3bd76e,_0x37f3ec,_0x23649c,_0xcad051)[_0x50b3('0x97')](function(_0xf5696d){return _0x2172d8(_0xf5696d);});default:return _0x59e0bf(msgResponse('[getDataPredictive]',_0x50b3('0x8b'),_0x50b3('0x1d7')));}}else{return _0x59e0bf(msgResponse(_0x50b3('0x1d8'),_0x50b3('0x8b'),_0x50b3('0x1d9')));}});};};Dialer[_0x50b3('0x1d')][_0x50b3('0x1da')]=function(_0x3d4688){var _0x2169c2=this;return function(_0x1fee0f){return new Promise(function(_0x2fd310,_0x500d45){_[_0x50b3('0x5c')](_0x3d4688,_0x1fee0f[0x0]);if(checkGetDataPredictive(_0x1fee0f[0x0])){loggerPredictive[_0x50b3('0x47')](JSON[_0x50b3('0x6d')](_0x1fee0f[0x0]));if(_0x3d4688[_0x50b3('0x1c4')]===_0x50b3('0x1c5')){return _0x2169c2['getVoiceQueueRtPauses'](_0x3d4688['id'])['then'](function(_0x27e0f9){var _0x24cc04=_0x3d4688[_0x50b3('0x1db')]-_0x27e0f9[0x0][_0x50b3('0x1dc')];var _0x4b15e7=_0x3d4688[_0x50b3('0x1cb')]*0x3c;var _0xe2edfc=_0x1fee0f[0x0][_0x50b3('0x4f')]+_0x1fee0f[0x0][_0x50b3('0x4d')];var _0x85c198=(_0x1fee0f[0x0]['predictiveIntervalAnsweredCalls']+_0x1fee0f[0x0][_0x50b3('0xc7')]+_0x1fee0f[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x1fee0f[0x0][_0x50b3('0x50')];var _0x178f14=_0x3d4688['dialPredictiveOptimizationPercentage']/0x64;_0x3d4688[_0x50b3('0x1dd')]=_0x27e0f9[0x0]['outboundQueuePauses']||0x0;_0x3d4688[_0x50b3('0x1bd')]=_0x85c198>0x0?_0x85c198:0x1;return _0x2169c2[_0x50b3('0x1d5')](_0x24cc04,_0x4b15e7,_0xe2edfc,_0x85c198,_0x178f14);})[_0x50b3('0x97')](function(_0x50f733){return _0x2fd310(_0x50f733);})[_0x50b3('0x9b')](function(_0x3675b7){return _0x500d45(msgResponse(_0x50b3('0x1de'),_0x50b3('0x8b'),JSON[_0x50b3('0x6d')](_0x3675b7)));});}if(_0x3d4688[_0x50b3('0x1c4')]===_0x50b3('0x1df')){return _0x2169c2[_0x50b3('0x14f')](_0x3d4688['id'])['then'](function(_0x57c8a6){var _0x2dda05=_0x3d4688[_0x50b3('0x1db')]-_0x57c8a6[0x0][_0x50b3('0x1dc')];var _0x1aecbd=_0x3d4688[_0x50b3('0x1cb')]*0x3c;var _0x110b76=_0x1fee0f[0x0][_0x50b3('0x4f')]+_0x1fee0f[0x0]['predictiveIntervalAvgHoldtime'];var _0x51c4e4=(_0x1fee0f[0x0][_0x50b3('0x49')]+_0x1fee0f[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x1fee0f[0x0][_0x50b3('0x4b')])/_0x1fee0f[0x0][_0x50b3('0x50')];var _0x24f7c5=_0x3d4688[_0x50b3('0x1b9')]/0x64;_0x3d4688['predictiveIntervalPauses']=_0x57c8a6[0x0][_0x50b3('0x1dc')]||0x0;_0x3d4688[_0x50b3('0x1bd')]=_0x51c4e4>0x0?_0x51c4e4:0x1;return _0x2169c2[_0x50b3('0x1d6')](_0x2dda05,_0x1aecbd,_0x110b76,_0x51c4e4,_0x24f7c5);})['then'](function(_0x505664){return _0x2fd310(_0x505664);})[_0x50b3('0x9b')](function(_0x4e3e23){return _0x500d45(msgResponse(_0x50b3('0x1de'),'Failure',JSON[_0x50b3('0x6d')](_0x4e3e23)));});}}else{return _0x500d45(msgResponse('[getDataPredictive]',_0x50b3('0x8b'),_0x50b3('0x1d9')));}});};};Dialer['prototype'][_0x50b3('0x1cf')]=function(_0x173bfb){var _0x3d32a6=this;return function(){var _0x10cb36=0x0;var _0x5447a0=Math['floor'](_0x173bfb[_0x50b3('0x57')]*0x3e8);if(_0x5447a0>0x0){_0x5447a0=_0x5447a0<0x64?0x64:_0x5447a0;loggerPredictive[_0x50b3('0x47')](_0x173bfb[_0x50b3('0x44')],_0x50b3('0x1e0'),_0x5447a0,'milliseconds');_0x173bfb['handlePredictive']=setInterval(function(){_0x3d32a6[_0x50b3('0x60')](_0x173bfb);loggerPredictiveCalls[_0x50b3('0x47')]('[handlePredictive]',_0x10cb36+=0x1);},_0x5447a0);}else{loggerPredictive[_0x50b3('0x47')](_0x173bfb[_0x50b3('0x44')],'fail\x20to\x20scheduled\x20calls');}};};Dialer['prototype'][_0x50b3('0x1e1')]=function(_0x536fd3,_0x4da938){var _0x491c0e=this;return function(_0x530dbc){if(_[_0x50b3('0x46')](_0x530dbc)){if(_[_0x50b3('0xf0')](_0x4da938[_0x50b3('0x1e2')])||!_0x4da938[_0x50b3('0x1e3')]){if(_0x536fd3[_0x50b3('0xa9')]===_0x50b3('0x9')){_0x536fd3['queueStatusComplete']=_['isUndefined'](_0x536fd3[_0x50b3('0x6b')])?!![]:_0x536fd3[_0x50b3('0x6b')];var _0x4855ef=uuid['v4']();_0x491c0e[_0x50b3('0xea')][_0x4855ef]=new Action(_0x536fd3,_0x4da938,_0x4855ef);loggerBooked[_0x50b3('0x47')](_0x50b3('0x1e4'),_0x4855ef,_0x50b3('0x1e5'),JSON[_0x50b3('0x6d')](_0x536fd3[_0x50b3('0x6b')]),_0x50b3('0x1e6'),_0x536fd3[_0x50b3('0x44')]);if(_0x536fd3[_0x50b3('0x6b')]){_0x536fd3[_0x50b3('0x6b')]=![];_0x491c0e[_0x50b3('0x29')][_0x491c0e[_0x50b3('0xea')][_0x4855ef][_0x50b3('0xb6')]]=[];ami[_0x50b3('0x93')]({'actionid':_0x4855ef,'action':_0x50b3('0x1e7'),'queue':_0x536fd3[_0x50b3('0x44')]})['catch'](function(){_0x491c0e[_0x50b3('0xb9')](_0x536fd3);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x491c0e[_0x50b3('0xea')][_0x4855ef][_0x50b3('0xd5')],'ListId':_0x491c0e[_0x50b3('0xea')][_0x4855ef][_0x50b3('0xd6')],'VoiceQueueId':_0x491c0e[_0x50b3('0xea')][_0x4855ef][_0x50b3('0xd7')]||undefined,'CampaignId':_0x491c0e[_0x50b3('0xea')][_0x4855ef][_0x50b3('0xe7')]||undefined})[_0x50b3('0x9b')](loggerCatch(_0x50b3('0x1e8')));delete _0x491c0e[_0x50b3('0xea')][_0x4855ef];});}else{loggerBooked[_0x50b3('0x47')](_0x50b3('0x1e9'),JSON[_0x50b3('0x6d')](_0x536fd3[_0x50b3('0x6b')]),_0x50b3('0x1e6'),_0x536fd3[_0x50b3('0x44')]);_0x491c0e['updateOriginated'](_0x536fd3);hopperUtils[_0x50b3('0xd3')]({'active':![],'ContactId':_0x491c0e[_0x50b3('0xea')][_0x4855ef][_0x50b3('0xd5')],'ListId':_0x491c0e[_0x50b3('0xea')][_0x4855ef][_0x50b3('0xd6')],'VoiceQueueId':_0x491c0e[_0x50b3('0xea')][_0x4855ef]['VoiceQueueId']||undefined,'CampaignId':_0x491c0e['actions'][_0x4855ef][_0x50b3('0xe7')]||undefined})['catch'](loggerCatch(_0x50b3('0x1e8')));delete _0x491c0e[_0x50b3('0xea')][_0x4855ef];}}else{return _0x491c0e['actionOriginate'](_0x536fd3,_0x4da938);}}else{if(utils[_0x50b3('0x5d')](undefined,_0x4da938['scheduledat'])<_0x536fd3['dialRecallMeTimeout']*0x3c){if(_0x4da938[_0x50b3('0x147')]&&!_0x4da938[_0x50b3('0x147')][_0x50b3('0x1ea')]){_0x491c0e[_0x50b3('0x20')][_0x50b3('0xf5')](_0x4da938['id'])[_0x50b3('0xf7')](function(){_0x491c0e[_0x50b3('0xb9')](_0x536fd3);});}else{hopperUtils[_0x50b3('0x1eb')]({'active':![]},_0x4da938['id'],0x1)[_0x50b3('0xf7')](function(){_0x491c0e[_0x50b3('0xb9')](_0x536fd3);});}}else{_0x536fd3[_0x50b3('0x1ec')]+=0x1;_0x491c0e[_0x50b3('0xb9')](_0x536fd3);if(_0x536fd3[_0x50b3('0x1ed')]){hopperUtils[_0x50b3('0xd3')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x4da938[_0x50b3('0xd5')],'ListId':_0x4da938[_0x50b3('0xd6')],'VoiceQueueId':_0x4da938[_0x50b3('0xd7')]||undefined,'CampaignId':_0x4da938['CampaignId']||undefined})[_0x50b3('0x9b')](loggerCatch(_0x50b3('0x1ee')));hopperUtils[_0x50b3('0xdb')](createObjHistory(_0x536fd3,_0x4da938,utils[_0x50b3('0x64')][_0x50b3('0x1ef')],0x17,_0x50b3('0x1f0')))[_0x50b3('0x9b')](loggerCatch(_0x50b3('0x1f1')));}else{_0x491c0e[_0x50b3('0x113')](createObjHistory(_0x536fd3,_0x4da938,utils[_0x50b3('0x64')][_0x50b3('0x1f2')],0x16,_0x50b3('0x1f3')),_0x50b3('0x1f4'),_0x50b3('0x1f5'));}}}}else{_0x536fd3[_0x50b3('0x1f6')]+=0x1;_0x491c0e[_0x50b3('0x113')](createObjHistory(_0x536fd3,_0x4da938,utils['CAMPAIGN_STATUS'][_0x50b3('0x1f7')],0xd,_0x50b3('0x1f8')),_0x50b3('0x1f9'),_0x50b3('0x1fa'));throw _0x50b3('0x1fb');}};};Dialer['prototype'][_0x50b3('0x1fc')]=function(_0x1d1816){var _0x19628c=this;var _0x2fbda4=_0x1d1816[_0x50b3('0x1fd')]-_0x1d1816[_0x50b3('0x78')];emitCampaignSummary(_0x1d1816);if(_0x2fbda4>0x0&&_0x1d1816[_0x50b3('0x1fe')]==0x0){if(_0x2fbda4>this[_0x50b3('0x24')]){_0x2fbda4=this[_0x50b3('0x24')];}_0x1d1816[_0x50b3('0x1fe')]=0x1;hopperUtils[_0x50b3('0x1ff')](_0x1d1816,_0x2fbda4)[_0x50b3('0x97')](function(_0x396de1){_0x1d1816['temp']=0x0;if(_0x396de1){if(!utils[_0x50b3('0x200')](_0x396de1)){_0x1d1816['message']=utils[_0x50b3('0x64')][_0x50b3('0x67')];logger[_0x50b3('0x47')]('[getContactCampaign2][Empty]'+_0x1d1816['name']);}else{_0x1d1816[_0x50b3('0x78')]+=_0x396de1[_0x50b3('0x92')];_0x1d1816[_0x50b3('0x63')]=utils[_0x50b3('0x64')][_0x50b3('0x201')];for(var _0x2f1c57=0x0;_0x2f1c57<_0x396de1[_0x50b3('0x92')];_0x2f1c57+=0x1){_0x1d1816[_0x50b3('0x202')]+=0x1;if(_['isNil'](_0x396de1[_0x2f1c57])||_[_0x50b3('0xf0')](_0x396de1[_0x2f1c57][_0x50b3('0x170')])||_[_0x50b3('0xf0')](_0x396de1[_0x2f1c57][_0x50b3('0x158')])){_0x19628c[_0x50b3('0x152')]('[actionOriginate]\x20',_0x1d1816,_0x396de1[_0x2f1c57]);}else{hopperUtils['checkIsBlackListIvr'](_[_0x50b3('0x6e')](_0x396de1[_0x2f1c57],['CampaignId','phone']))['then'](_0x19628c[_0x50b3('0x1e1')](_0x1d1816,_0x396de1[_0x2f1c57]))[_0x50b3('0x9b')](_0x19628c[_0x50b3('0x203')](_0x50b3('0x204'),_0x1d1816));}}}}})[_0x50b3('0x9b')](loggerGetContactDialer(_0x50b3('0x205'),_0x1d1816,_0x2fbda4));}};Dialer[_0x50b3('0x1d')][_0x50b3('0xab')]=function(_0x48ce2d,_0x1d2e70){var _0x2f84b2=this;var _0x6e1dcb=[];if(_0x1d2e70<0x1||_0x48ce2d[_0x50b3('0xa9')]===_0x50b3('0x9')){_0x1d2e70=0x1;}var _0x5112bd=Math[_0x50b3('0x1bc')](_0x48ce2d[_0x50b3('0x13a')]*_0x1d2e70)-_0x48ce2d['originated'];if(_0x48ce2d['dialLimitQueue']>0x0){var _0x18b75f=_0x48ce2d['dialLimitQueue']-_0x48ce2d[_0x50b3('0x78')]-_0x48ce2d[_0x50b3('0x13c')]-_0x48ce2d[_0x50b3('0x206')];if(_0x5112bd>_0x18b75f){_0x5112bd=_0x18b75f;}}if(_0x5112bd>0x0&&_0x48ce2d['temp']==0x0){if(_0x48ce2d[_0x50b3('0xa9')]===_0x50b3('0x9')){_0x5112bd=0x1;}if(_0x5112bd>this[_0x50b3('0x24')]){_0x5112bd=this[_0x50b3('0x24')];}for(var _0x357573 in this[_0x50b3('0x23')]){if(typeof this[_0x50b3('0x23')][_0x357573]!==_0x50b3('0xa4')){if(this[_0x50b3('0x23')][_0x357573][_0x50b3('0xca')]===_0x50b3('0x207')&&this[_0x50b3('0x23')][_0x357573][_0x50b3('0x83')]===_0x50b3('0x145')){_0x6e1dcb[_0x50b3('0x9c')](this[_0x50b3('0x23')][_0x357573]['id']);}}}_0x48ce2d[_0x50b3('0x1fe')]=0x1;hopperUtils[_0x50b3('0x208')](_0x48ce2d,_0x6e1dcb,_0x5112bd)[_0x50b3('0x97')](function(_0x5b8701){_0x48ce2d['temp']=0x0;if(_0x5b8701){if(!utils[_0x50b3('0x200')](_0x5b8701)){hopperUtils[_0x50b3('0x209')](_0x48ce2d)[_0x50b3('0x97')](sendMessageReschedule(_0x48ce2d))[_0x50b3('0x9b')](loggerCatch('[countReScheduled]\x20'));}else{_0x48ce2d[_0x50b3('0x78')]+=_0x5b8701[_0x50b3('0x92')];_0x48ce2d[_0x50b3('0x63')]=_0x48ce2d[_0x50b3('0xa9')]==='booked'?utils[_0x50b3('0x64')][_0x50b3('0x160')]:utils[_0x50b3('0x64')][_0x50b3('0x201')];for(var _0x208ab5=0x0;_0x208ab5<_0x5b8701[_0x50b3('0x92')];_0x208ab5+=0x1){if(_[_0x50b3('0xf0')](_0x5b8701[_0x208ab5])||_[_0x50b3('0xf0')](_0x5b8701[_0x208ab5][_0x50b3('0x170')])||_[_0x50b3('0xf0')](_0x5b8701[_0x208ab5][_0x50b3('0x158')])){_0x2f84b2['emptyContact'](_0x50b3('0x20a'),_0x48ce2d,_0x5b8701[_0x208ab5]);}else{hopperUtils[_0x50b3('0x20b')](_[_0x50b3('0x6e')](_0x5b8701[_0x208ab5],[_0x50b3('0xd7'),_0x50b3('0x158')]))[_0x50b3('0x97')](_0x2f84b2[_0x50b3('0x1e1')](_0x48ce2d,_0x5b8701[_0x208ab5]))[_0x50b3('0x9b')](_0x2f84b2[_0x50b3('0x203')](_0x50b3('0x20a'),_0x48ce2d));}}}}})[_0x50b3('0x9b')](loggerGetContactDialer(_0x50b3('0x20c'),_0x48ce2d,_0x5112bd));}};Dialer[_0x50b3('0x1d')]['handlePredictive']=function(_0x15547b){if(_0x15547b[_0x50b3('0x20d')]>0x0){var _0x565b8a=_0x15547b[_0x50b3('0x20d')]-_0x15547b[_0x50b3('0x78')]-_0x15547b['talking'];if(_0x565b8a>0x0&&_0x15547b[_0x50b3('0x1fe')]==0x0){this[_0x50b3('0x20e')](_0x15547b);}else{loggerPredictiveCalls['info'](_0x50b3('0x20f'));}}else{this[_0x50b3('0x20e')](_0x15547b);}};Dialer[_0x50b3('0x1d')]['tryOriginatePredictive']=function(_0x2940c9){var _0x282270=this;var _0x3e7aed=[];_0x2940c9[_0x50b3('0x78')]+=0x1;for(var _0xc11463 in this['agents']){if(typeof this[_0x50b3('0x23')][_0xc11463]!==_0x50b3('0xa4')){if(this[_0x50b3('0x23')][_0xc11463][_0x50b3('0xca')]==='not_inuse'&&this[_0x50b3('0x23')][_0xc11463][_0x50b3('0x83')]==='reachable'){_0x3e7aed[_0x50b3('0x9c')](this[_0x50b3('0x23')][_0xc11463]['id']);}}}_0x2940c9['temp']=0x1;return this[_0x50b3('0x208')](_0x2940c9['id'],_0x3e7aed,0x1,_0x2940c9['dialOrderByScheduledAt'],_0x2940c9)[_0x50b3('0x97')](function(_0x1cb517){_0x2940c9['temp']=0x1;if(_0x1cb517){if(!utils[_0x50b3('0x200')](_0x1cb517)){utils[_0x50b3('0x210')](_0x2940c9,0x1,0x0);return hopperUtils[_0x50b3('0x209')](_0x2940c9)['then'](sendMessageReschedule(_0x2940c9))[_0x50b3('0x9b')](loggerCatch(_0x50b3('0x211')));}else{_0x2940c9['message']=utils['CAMPAIGN_STATUS'][_0x50b3('0x201')];if(_['isNil'](_0x1cb517[0x0])||_[_0x50b3('0xf0')](_0x1cb517[0x0]['Contact'])||_[_0x50b3('0xf0')](_0x1cb517[0x0][_0x50b3('0x158')])){_0x282270[_0x50b3('0x152')](_0x50b3('0x20a'),_0x2940c9,_0x1cb517[0x0]);}else{return hopperUtils['checkIsBlackList'](_['pick'](_0x1cb517[0x0],['VoiceQueueId',_0x50b3('0x158')]))[_0x50b3('0x97')](_0x282270['checkContactBlack'](_0x2940c9,_0x1cb517[0x0]))[_0x50b3('0x9b')](_0x282270[_0x50b3('0x203')](_0x50b3('0x212'),_0x2940c9));}}}})['catch'](loggerGetContactDialer(_0x50b3('0x213'),_0x2940c9,0x1));};Dialer[_0x50b3('0x1d')][_0x50b3('0x1d5')]=function(_0x6a831,_0x5183f1,_0x26c639,_0x472211,_0x2a3109,_0x336774){loggerPredictive['info']('--------\x20Drop\x20Rate\x20--------');loggerPredictive['info'](_0x50b3('0x214'),_0x6a831);loggerPredictive[_0x50b3('0x47')](_0x50b3('0x215'),_0x5183f1);loggerPredictive[_0x50b3('0x47')](_0x50b3('0x216'),_0x26c639);loggerPredictive[_0x50b3('0x47')](_0x50b3('0x217'),_0x472211);loggerPredictive[_0x50b3('0x47')](_0x50b3('0x218'),_0x2a3109);loggerPredictive['info'](_0x50b3('0x219'));return new Promise(function(_0x192a7a,_0x2f13c3){if(_0x6a831<=0x0||isNaN(_0x6a831)){return _0x2f13c3(msgResponse('[abandonmentRate]',_0x50b3('0x7e'),_0x50b3('0x21a')+_0x6a831));}if(_0x26c639<=0x0||isNaN(_0x26c639)){return _0x2f13c3(msgResponse(_0x50b3('0x21b'),_0x50b3('0x7e'),_0x50b3('0x21c')+_0x26c639));}if(_0x472211<=0x0||isNaN(_0x472211)){return _0x2f13c3(msgResponse(_0x50b3('0x21b'),'Error',_0x50b3('0x21d')+_0x472211));}if(_0x5183f1<=0x0||isNaN(_0x5183f1)){return _0x2f13c3(msgResponse(_0x50b3('0x21b'),'Error','interval\x20=\x20'+_0x5183f1));}if(_0x2a3109<=0x0||isNaN(_0x2a3109)){return _0x2f13c3(msgResponse('[abandonmentRate]',_0x50b3('0x7e'),'Amax\x20=\x20'+_0x2a3109));}_0x336774=_0x336774||0x0;var _0x190c10=0x1/_0x26c639;var _0x59496f=0x0;var _0x3c2630=0x0;var _0x19d680=0x0;var _0x4a3e90=0x0;for(var _0x4c93a7=0x0;_0x19d680<_0x2a3109;_0x4c93a7+=0x1){_0x3c2630=_0x4c93a7/_0x5183f1;_0x59496f=(_0x472211*_0x3c2630+_0x336774)/_0x190c10;_0x19d680=utils['erlangb'](_0x59496f,_0x6a831);_0x4a3e90=_0x59496f/_0x6a831*(0x1-utils[_0x50b3('0x21e')](_0x59496f,_0x6a831));}return _0x192a7a({'erlangCalls':_0x4c93a7,'erlangCallToSecond':_0x5183f1/_0x4c93a7,'erlangAbandonmentRate':_0x19d680,'erlangBusyFactor':_0x4a3e90});});};Dialer['prototype'][_0x50b3('0x1d6')]=function(_0x59ed8f,_0x14a94a,_0x50449e,_0x596a84,_0x1f61be,_0x50d141){loggerPredictive[_0x50b3('0x47')](_0x50b3('0x21f'));loggerPredictive[_0x50b3('0x47')](_0x50b3('0x214'),_0x59ed8f);loggerPredictive[_0x50b3('0x47')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x14a94a);loggerPredictive[_0x50b3('0x47')]('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',_0x50449e);loggerPredictive[_0x50b3('0x47')](_0x50b3('0x217'),_0x596a84);loggerPredictive[_0x50b3('0x47')](_0x50b3('0x220'),_0x1f61be);loggerPredictive['info']('---------------------------');return new Promise(function(_0x4ad2b4,_0x557cde){if(_0x59ed8f<=0x0||isNaN(_0x59ed8f)){return _0x557cde(msgResponse('[busyFactor]','Error',_0x50b3('0x21a')+_0x59ed8f));}if(_0x50449e<=0x0||isNaN(_0x50449e)){return _0x557cde(msgResponse(_0x50b3('0x221'),'Error','Ts\x20=\x20'+_0x50449e));}if(_0x596a84<=0x0||isNaN(_0x596a84)){return _0x557cde(msgResponse(_0x50b3('0x221'),'Error',_0x50b3('0x21d')+_0x596a84));}if(_0x14a94a<=0x0||isNaN(_0x14a94a)){return _0x557cde(msgResponse('[busyFactor]',_0x50b3('0x7e'),'interval\x20=\x20'+_0x14a94a));}if(_0x1f61be<=0x0||isNaN(_0x1f61be)){return _0x557cde(msgResponse('[busyFactor]',_0x50b3('0x7e'),_0x50b3('0x222')+_0x1f61be));}_0x50d141=_0x50d141||0x0;var _0x582a27=0x1/_0x50449e;var _0x4b35dc=0x0;var _0x1d497e=0x0;var _0x455241=0x0;var _0x250196=0x0;for(var _0x218501=0x0;_0x250196<_0x1f61be;_0x218501+=0x1){_0x1d497e=_0x218501/_0x14a94a;_0x4b35dc=(_0x596a84*_0x1d497e+_0x50d141)/_0x582a27;_0x455241=utils['erlangb'](_0x4b35dc,_0x59ed8f);_0x250196=_0x4b35dc/_0x59ed8f*(0x1-utils[_0x50b3('0x21e')](_0x4b35dc,_0x59ed8f));}return _0x4ad2b4({'erlangCalls':_0x218501,'erlangCallToSecond':_0x14a94a/_0x218501,'erlangAbandonmentRate':_0x455241,'erlangBusyFactor':_0x250196});});};module[_0x50b3('0x223')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/models/action.js b/server/services/ami/dialer/models/action.js index 8c9a68b..579a15d 100644 --- a/server/services/ami/dialer/models/action.js +++ b/server/services/ami/dialer/models/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa585=['lastName','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','starttime','format','callback','callbackuniqueid','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','voiceQueue','number','substring','exports','util','lodash','moment','string','isNil','name','Contact','phone','firstName'];(function(_0x4c0e59,_0x9b6e1){var _0x5b4535=function(_0x594703){while(--_0x594703){_0x4c0e59['push'](_0x4c0e59['shift']());}};_0x5b4535(++_0x9b6e1);}(_0xa585,0x116));var _0x5a58=function(_0x10b4b8,_0x450fea){_0x10b4b8=_0x10b4b8-0x0;var _0x424293=_0xa585[_0x10b4b8];return _0x424293;};'use strict';var util=require(_0x5a58('0x0'));var _=require(_0x5a58('0x1'));var moment=require(_0x5a58('0x2'));function checkNameSurname(_0x11bd0c,_0x328044,_0x6c8e2d){var _0x4f4429='';if(!_['isNil'](_0x328044)&&_0x5a58('0x3')===typeof _0x328044){_0x4f4429+=_0x328044;}if(!_[_0x5a58('0x4')](_0x6c8e2d)&&_0x5a58('0x3')===typeof _0x6c8e2d){_0x4f4429+='\x20'+_0x6c8e2d;}if(_0x4f4429!==''){return _0x4f4429;}return _0x11bd0c;}function Action(_0x3ce2ec,_0x2246af,_0x188e0f){this['voiceQueue']=_0x3ce2ec;this['uniqueid']=_0x188e0f||undefined;this[_0x5a58('0x5')]=checkNameSurname(_0x2246af[_0x5a58('0x6')][_0x5a58('0x7')],_0x2246af[_0x5a58('0x6')][_0x5a58('0x8')],_0x2246af['Contact'][_0x5a58('0x9')]);this['number']=_0x2246af[_0x5a58('0x7')];this[_0x5a58('0xa')]=_0x3ce2ec[_0x5a58('0x5')];this[_0x5a58('0xb')]=_0x2246af['active']||![];this[_0x5a58('0xc')]=_0x3ce2ec[_0x5a58('0xc')];this[_0x5a58('0xd')]=_0x3ce2ec[_0x5a58('0xd')]||0x3;this[_0x5a58('0xe')]=_0x2246af[_0x5a58('0xe')];this[_0x5a58('0xf')]=_0x2246af[_0x5a58('0xf')];this[_0x5a58('0x10')]=_0x2246af[_0x5a58('0x10')];this[_0x5a58('0x11')]=_0x2246af[_0x5a58('0x11')];this['countnosuchnumberretry']=_0x2246af[_0x5a58('0x12')];this[_0x5a58('0x13')]=_0x2246af[_0x5a58('0x13')];this[_0x5a58('0x14')]=_0x2246af[_0x5a58('0x14')];this['countmachineretry']=_0x2246af['countmachineretry'];this[_0x5a58('0x15')]=_0x2246af[_0x5a58('0x15')];this[_0x5a58('0x16')]=_0x2246af[_0x5a58('0x16')];this[_0x5a58('0x17')]=_0x2246af[_0x5a58('0x17')];this[_0x5a58('0x18')]=_0x2246af[_0x5a58('0x18')];this[_0x5a58('0x19')]=_0x2246af[_0x5a58('0x19')];this[_0x5a58('0x1a')]=_0x2246af[_0x5a58('0x1a')];this[_0x5a58('0x1b')]=_0x2246af['id'];this['ContactFirstName']=_0x2246af[_0x5a58('0x6')][_0x5a58('0x8')]||'';this[_0x5a58('0x1c')]=moment()[_0x5a58('0x1d')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x5a58('0x1e')]=_0x2246af[_0x5a58('0x1e')];this[_0x5a58('0x1f')]=_0x2246af['callbackuniqueid'];this['callbackat']=_0x2246af['callbackat'];this[_0x5a58('0x20')]=_0x2246af[_0x5a58('0x20')];this[_0x5a58('0x21')]='';this[_0x5a58('0x22')]='';}Action[_0x5a58('0x23')][_0x5a58('0x24')]=function(){return util[_0x5a58('0x1d')]('\x22%s\x22\x20<%s>',this['name'],this[_0x5a58('0x25')]['dialCutDigit']>0x0?this[_0x5a58('0x26')][_0x5a58('0x27')](this[_0x5a58('0x25')]['dialCutDigit']):this['number']);};Action['prototype']['getQueue']=function(){return this['queue'];};module[_0x5a58('0x28')]=Action; \ No newline at end of file +var _0x5c34=['firstName','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','UserId','VoiceQueueId','CampaignId','idHopper','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','substring','exports','util','lodash','moment','isNil','voiceQueue','uniqueid','name','phone','Contact'];(function(_0x2b7837,_0x118d69){var _0x584ff4=function(_0x17ecb0){while(--_0x17ecb0){_0x2b7837['push'](_0x2b7837['shift']());}};_0x584ff4(++_0x118d69);}(_0x5c34,0x7b));var _0x45c3=function(_0x59927a,_0x44e08b){_0x59927a=_0x59927a-0x0;var _0x35834b=_0x5c34[_0x59927a];return _0x35834b;};'use strict';var util=require(_0x45c3('0x0'));var _=require(_0x45c3('0x1'));var moment=require(_0x45c3('0x2'));function checkNameSurname(_0x463b25,_0x32728,_0x5f080f){var _0x459b3d='';if(!_[_0x45c3('0x3')](_0x32728)&&'string'===typeof _0x32728){_0x459b3d+=_0x32728;}if(!_[_0x45c3('0x3')](_0x5f080f)&&'string'===typeof _0x5f080f){_0x459b3d+='\x20'+_0x5f080f;}if(_0x459b3d!==''){return _0x459b3d;}return _0x463b25;}function Action(_0x1e52c3,_0xb46f48,_0x3bb3f3){this[_0x45c3('0x4')]=_0x1e52c3;this[_0x45c3('0x5')]=_0x3bb3f3||undefined;this[_0x45c3('0x6')]=checkNameSurname(_0xb46f48['Contact'][_0x45c3('0x7')],_0xb46f48[_0x45c3('0x8')][_0x45c3('0x9')],_0xb46f48['Contact'][_0x45c3('0xa')]);this[_0x45c3('0xb')]=_0xb46f48[_0x45c3('0x7')];this[_0x45c3('0xc')]=_0x1e52c3[_0x45c3('0x6')];this[_0x45c3('0xd')]=_0xb46f48['active']||![];this['type']=_0x1e52c3[_0x45c3('0xe')];this[_0x45c3('0xf')]=_0x1e52c3[_0x45c3('0xf')]||0x3;this[_0x45c3('0x10')]=_0xb46f48['scheduledat'];this['countbusyretry']=_0xb46f48['countbusyretry'];this[_0x45c3('0x11')]=_0xb46f48[_0x45c3('0x11')];this['countnoanswerretry']=_0xb46f48[_0x45c3('0x12')];this[_0x45c3('0x13')]=_0xb46f48['countnosuchnumberretry'];this[_0x45c3('0x14')]=_0xb46f48['countdropretry'];this[_0x45c3('0x15')]=_0xb46f48[_0x45c3('0x15')];this[_0x45c3('0x16')]=_0xb46f48[_0x45c3('0x16')];this['countagentrejectretry']=_0xb46f48[_0x45c3('0x17')];this[_0x45c3('0x18')]=_0xb46f48['ContactId'];this['ListId']=_0xb46f48['ListId'];this[_0x45c3('0x19')]=_0xb46f48['UserId'];this[_0x45c3('0x1a')]=_0xb46f48[_0x45c3('0x1a')];this[_0x45c3('0x1b')]=_0xb46f48[_0x45c3('0x1b')];this[_0x45c3('0x1c')]=_0xb46f48['id'];this['ContactFirstName']=_0xb46f48[_0x45c3('0x8')][_0x45c3('0x9')]||'';this[_0x45c3('0x1d')]=moment()[_0x45c3('0x1e')](_0x45c3('0x1f'));this[_0x45c3('0x20')]=_0xb46f48[_0x45c3('0x20')];this[_0x45c3('0x21')]=_0xb46f48['callbackuniqueid'];this[_0x45c3('0x22')]=_0xb46f48[_0x45c3('0x22')];this[_0x45c3('0x23')]=_0xb46f48['recallme'];this[_0x45c3('0x24')]='';this[_0x45c3('0x25')]='';}Action[_0x45c3('0x26')][_0x45c3('0x27')]=function(){return util[_0x45c3('0x1e')](_0x45c3('0x28'),this[_0x45c3('0x6')],this[_0x45c3('0x4')][_0x45c3('0x29')]>0x0?this[_0x45c3('0xb')][_0x45c3('0x2a')](this[_0x45c3('0x4')]['dialCutDigit']):this['number']);};Action[_0x45c3('0x26')]['getQueue']=function(){return this[_0x45c3('0xc')];};module[_0x45c3('0x2b')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/models/agentComplete.js b/server/services/ami/dialer/models/agentComplete.js index 9b7d6f3..b1e6824 100644 --- a/server/services/ami/dialer/models/agentComplete.js +++ b/server/services/ami/dialer/models/agentComplete.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4f96=['callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','exports','moment','state','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','ringtime','getSeconds','talktime','endtime','membername','reason','callback','callbackuniqueid'];(function(_0xdc0c40,_0x18a854){var _0x12e045=function(_0x5dba33){while(--_0x5dba33){_0xdc0c40['push'](_0xdc0c40['shift']());}};_0x12e045(++_0x18a854);}(_0x4f96,0x10d));var _0x64f9=function(_0x14b879,_0x589bd9){_0x14b879=_0x14b879-0x0;var _0xb677c3=_0x4f96[_0x14b879];return _0xb677c3;};'use strict';var moment=require(_0x64f9('0x0'));var utils=require('../utils');function AgentComplete(_0x4b9155,_0x2a9547){this[_0x64f9('0x1')]=0x4;this['statedesc']=_0x64f9('0x2');this[_0x64f9('0x3')]=_0x4b9155[_0x64f9('0x3')];this[_0x64f9('0x4')]=_0x4b9155[_0x64f9('0x4')];this[_0x64f9('0x5')]=_0x4b9155[_0x64f9('0x4')]===_0x64f9('0x6')?_0x64f9('0x7'):_0x4b9155[_0x64f9('0x4')];this[_0x64f9('0x8')]=_0x4b9155['countbusyretry'];this[_0x64f9('0x9')]=_0x4b9155[_0x64f9('0x9')];this['countnoanswerretry']=_0x4b9155[_0x64f9('0xa')];this['countglobal']=_0x4b9155[_0x64f9('0x8')]+_0x4b9155['countcongestionretry']+_0x4b9155[_0x64f9('0xa')]+_0x4b9155[_0x64f9('0xb')]+_0x4b9155[_0x64f9('0xc')]+_0x4b9155[_0x64f9('0xd')]+_0x4b9155[_0x64f9('0xe')]+_0x4b9155['countagentrejectretry'];this[_0x64f9('0xb')]=_0x4b9155[_0x64f9('0xb')];this[_0x64f9('0xc')]=_0x4b9155[_0x64f9('0xc')];this[_0x64f9('0xd')]=_0x4b9155[_0x64f9('0xd')];this[_0x64f9('0xe')]=_0x4b9155[_0x64f9('0xe')];this[_0x64f9('0xf')]=_0x4b9155['countagentrejectretry'];this[_0x64f9('0x10')]=_0x2a9547[_0x64f9('0x10')];this[_0x64f9('0x11')]=_0x4b9155[_0x64f9('0x12')];this[_0x64f9('0x13')]=_0x4b9155[_0x64f9('0x14')];this[_0x64f9('0x15')]=_0x4b9155[_0x64f9('0x15')];this['responsetime']=_0x4b9155[_0x64f9('0x16')];this[_0x64f9('0x17')]=_0x4b9155['answertime'];this['endtime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x64f9('0x18')]=utils[_0x64f9('0x19')](_0x4b9155[_0x64f9('0x16')],_0x4b9155[_0x64f9('0x15')]);this['holdtime']=utils[_0x64f9('0x19')](_0x4b9155[_0x64f9('0x17')],_0x4b9155[_0x64f9('0x16')]);this[_0x64f9('0x1a')]=utils[_0x64f9('0x19')](this[_0x64f9('0x1b')],_0x4b9155[_0x64f9('0x17')]);this[_0x64f9('0x7')]=_0x2a9547[_0x64f9('0x7')];this[_0x64f9('0x1c')]=_0x2a9547['membername'];this[_0x64f9('0x1d')]=_0x2a9547[_0x64f9('0x1d')];this[_0x64f9('0x1e')]=_0x4b9155[_0x64f9('0x1e')];this[_0x64f9('0x1f')]=_0x4b9155[_0x64f9('0x1f')];this['callbackat']=_0x4b9155[_0x64f9('0x20')];this[_0x64f9('0x21')]=_0x4b9155[_0x64f9('0x21')];this[_0x64f9('0x22')]=_0x4b9155[_0x64f9('0x22')];this[_0x64f9('0x23')]=_0x4b9155[_0x64f9('0x23')];this[_0x64f9('0x24')]=_0x4b9155[_0x64f9('0x24')];this[_0x64f9('0x25')]=_0x4b9155['VoiceQueueId'];this['CampaignId']=_0x4b9155[_0x64f9('0x26')];this['originatecalleridnum']=_0x4b9155[_0x64f9('0x27')]||'';this['originatecalleridname']=_0x4b9155[_0x64f9('0x28')]||'';this[_0x64f9('0x29')]=_0x4b9155['agiafterat'];}module[_0x64f9('0x2a')]=AgentComplete; \ No newline at end of file +var _0x58fb=['campaigntype','outbound','queue','countcongestionretry','countnoanswerretry','countbusyretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','exports','statedesc','Answer','scheduledat','type'];(function(_0x1709e8,_0x33a489){var _0x2521ca=function(_0x139d16){while(--_0x139d16){_0x1709e8['push'](_0x1709e8['shift']());}};_0x2521ca(++_0x33a489);}(_0x58fb,0x17f));var _0xb58f=function(_0x4649df,_0x14cfdd){_0x4649df=_0x4649df-0x0;var _0x5ad9ae=_0x58fb[_0x4649df];return _0x5ad9ae;};'use strict';var moment=require('moment');var utils=require('../utils');function AgentComplete(_0xacdfe0,_0x2de407){this['state']=0x4;this[_0xb58f('0x0')]=_0xb58f('0x1');this[_0xb58f('0x2')]=_0xacdfe0[_0xb58f('0x2')];this[_0xb58f('0x3')]=_0xacdfe0[_0xb58f('0x3')];this[_0xb58f('0x4')]=_0xacdfe0[_0xb58f('0x3')]===_0xb58f('0x5')?_0xb58f('0x6'):_0xacdfe0[_0xb58f('0x3')];this['countbusyretry']=_0xacdfe0['countbusyretry'];this[_0xb58f('0x7')]=_0xacdfe0[_0xb58f('0x7')];this[_0xb58f('0x8')]=_0xacdfe0[_0xb58f('0x8')];this['countglobal']=_0xacdfe0[_0xb58f('0x9')]+_0xacdfe0[_0xb58f('0x7')]+_0xacdfe0['countnoanswerretry']+_0xacdfe0[_0xb58f('0xa')]+_0xacdfe0[_0xb58f('0xb')]+_0xacdfe0['countabandonedretry']+_0xacdfe0[_0xb58f('0xc')]+_0xacdfe0[_0xb58f('0xd')];this['countnosuchnumberretry']=_0xacdfe0[_0xb58f('0xa')];this[_0xb58f('0xb')]=_0xacdfe0['countdropretry'];this['countabandonedretry']=_0xacdfe0['countabandonedretry'];this[_0xb58f('0xc')]=_0xacdfe0['countmachineretry'];this[_0xb58f('0xd')]=_0xacdfe0[_0xb58f('0xd')];this[_0xb58f('0xe')]=_0x2de407[_0xb58f('0xe')];this[_0xb58f('0xf')]=_0xacdfe0[_0xb58f('0x10')];this[_0xb58f('0x11')]=_0xacdfe0[_0xb58f('0x12')];this[_0xb58f('0x13')]=_0xacdfe0['starttime'];this[_0xb58f('0x14')]=_0xacdfe0[_0xb58f('0x14')];this[_0xb58f('0x15')]=_0xacdfe0[_0xb58f('0x15')];this[_0xb58f('0x16')]=moment()[_0xb58f('0x17')](_0xb58f('0x18'));this[_0xb58f('0x19')]=utils[_0xb58f('0x1a')](_0xacdfe0[_0xb58f('0x14')],_0xacdfe0['starttime']);this['holdtime']=utils[_0xb58f('0x1a')](_0xacdfe0[_0xb58f('0x15')],_0xacdfe0[_0xb58f('0x14')]);this[_0xb58f('0x1b')]=utils[_0xb58f('0x1a')](this[_0xb58f('0x16')],_0xacdfe0[_0xb58f('0x15')]);this[_0xb58f('0x6')]=_0x2de407[_0xb58f('0x6')];this[_0xb58f('0x1c')]=_0x2de407[_0xb58f('0x1c')];this[_0xb58f('0x1d')]=_0x2de407[_0xb58f('0x1d')];this['callback']=_0xacdfe0[_0xb58f('0x1e')];this[_0xb58f('0x1f')]=_0xacdfe0[_0xb58f('0x1f')];this[_0xb58f('0x20')]=_0xacdfe0[_0xb58f('0x20')];this[_0xb58f('0x21')]=_0xacdfe0[_0xb58f('0x21')];this[_0xb58f('0x22')]=_0xacdfe0[_0xb58f('0x22')];this[_0xb58f('0x23')]=_0xacdfe0[_0xb58f('0x23')];this[_0xb58f('0x24')]=_0xacdfe0['UserId'];this[_0xb58f('0x25')]=_0xacdfe0[_0xb58f('0x25')];this[_0xb58f('0x26')]=_0xacdfe0['CampaignId'];this[_0xb58f('0x27')]=_0xacdfe0[_0xb58f('0x27')]||'';this[_0xb58f('0x28')]=_0xacdfe0[_0xb58f('0x28')]||'';this[_0xb58f('0x29')]=_0xacdfe0[_0xb58f('0x29')];}module[_0xb58f('0x2a')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/models/final.js b/server/services/ami/dialer/models/final.js index 30b9135..0059b73 100644 --- a/server/services/ami/dialer/models/final.js +++ b/server/services/ami/dialer/models/final.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8245=['UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','state','statedesc','exports','uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','queue','calleridname','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8245,0x17d));var _0x5824=function(_0x15077f,_0x42ac06){_0x15077f=_0x15077f-0x0;var _0x3895ea=_0x8245[_0x15077f];return _0x3895ea;};'use strict';function Final(_0x14532b){this[_0x5824('0x0')]=_0x14532b[_0x5824('0x0')];this[_0x5824('0x1')]=_0x14532b[_0x5824('0x1')];this[_0x5824('0x2')]=_0x14532b['type'];this[_0x5824('0x3')]=_0x14532b[_0x5824('0x2')]===_0x5824('0x4')?'queue':_0x14532b[_0x5824('0x2')];this['countbusyretry']=_0x14532b[_0x5824('0x5')];this[_0x5824('0x6')]=_0x14532b[_0x5824('0x6')];this['countnoanswerretry']=_0x14532b[_0x5824('0x7')];this[_0x5824('0x8')]=_0x14532b[_0x5824('0x5')]+_0x14532b[_0x5824('0x6')]+_0x14532b['countnoanswerretry']+_0x14532b['countnosuchnumberretry']+_0x14532b[_0x5824('0x9')]+_0x14532b[_0x5824('0xa')]+_0x14532b[_0x5824('0xb')]+_0x14532b[_0x5824('0xc')];this['countnosuchnumberretry']=_0x14532b['countnosuchnumberretry'];this[_0x5824('0x9')]=_0x14532b[_0x5824('0x9')];this[_0x5824('0xa')]=_0x14532b[_0x5824('0xa')];this[_0x5824('0xb')]=_0x14532b[_0x5824('0xb')];this[_0x5824('0xc')]=_0x14532b[_0x5824('0xc')];this[_0x5824('0xd')]=_0x14532b[_0x5824('0xd')];this[_0x5824('0xe')]=_0x14532b['calleridname'];this['calleridnum']=_0x14532b['calleridnum'];this[_0x5824('0xf')]=_0x14532b[_0x5824('0xf')];this[_0x5824('0x10')]=_0x14532b[_0x5824('0x10')];this[_0x5824('0x11')]=_0x14532b[_0x5824('0x10')];this['ringtime']=_0x14532b[_0x5824('0x12')]||0x0;this[_0x5824('0x13')]=_0x14532b[_0x5824('0x13')]||0x0;this[_0x5824('0x14')]=_0x14532b[_0x5824('0x14')]||0x0;this[_0x5824('0x15')]=_0x14532b[_0x5824('0x15')];this['callbackuniqueid']=_0x14532b[_0x5824('0x16')];this[_0x5824('0x17')]=_0x14532b[_0x5824('0x17')];this[_0x5824('0x18')]=_0x14532b[_0x5824('0x18')];this[_0x5824('0x19')]=_0x14532b[_0x5824('0x19')];this[_0x5824('0x1a')]=_0x14532b[_0x5824('0x1a')];this[_0x5824('0x1b')]=_0x14532b['UserId'];this[_0x5824('0x1c')]=_0x14532b[_0x5824('0x1c')];this['CampaignId']=_0x14532b['CampaignId'];this[_0x5824('0x1d')]=_0x14532b[_0x5824('0x1d')]||'';this[_0x5824('0x1e')]=_0x14532b['originatecalleridname']||'';this[_0x5824('0x1f')]=_0x14532b[_0x5824('0x1f')];this['statedesc']=_0x14532b[_0x5824('0x20')];}module[_0x5824('0x21')]=Final; \ No newline at end of file +var _0x3903=['ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','statedesc','exports','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','calleridname','calleridnum','starttime','responsetime','endtime'];(function(_0x3fcd45,_0x4a0103){var _0x812fef=function(_0x1e91f5){while(--_0x1e91f5){_0x3fcd45['push'](_0x3fcd45['shift']());}};_0x812fef(++_0x4a0103);}(_0x3903,0x19c));var _0x3390=function(_0x4cc24b,_0x5c8d18){_0x4cc24b=_0x4cc24b-0x0;var _0x369650=_0x3903[_0x4cc24b];return _0x369650;};'use strict';function Final(_0x46c706){this[_0x3390('0x0')]=_0x46c706[_0x3390('0x0')];this[_0x3390('0x1')]=_0x46c706[_0x3390('0x1')];this[_0x3390('0x2')]=_0x46c706['type'];this[_0x3390('0x3')]=_0x46c706[_0x3390('0x2')]===_0x3390('0x4')?_0x3390('0x5'):_0x46c706[_0x3390('0x2')];this[_0x3390('0x6')]=_0x46c706[_0x3390('0x6')];this[_0x3390('0x7')]=_0x46c706[_0x3390('0x7')];this[_0x3390('0x8')]=_0x46c706[_0x3390('0x8')];this[_0x3390('0x9')]=_0x46c706[_0x3390('0x6')]+_0x46c706[_0x3390('0x7')]+_0x46c706[_0x3390('0x8')]+_0x46c706[_0x3390('0xa')]+_0x46c706[_0x3390('0xb')]+_0x46c706['countabandonedretry']+_0x46c706[_0x3390('0xc')]+_0x46c706[_0x3390('0xd')];this['countnosuchnumberretry']=_0x46c706[_0x3390('0xa')];this['countdropretry']=_0x46c706['countdropretry'];this[_0x3390('0xe')]=_0x46c706[_0x3390('0xe')];this[_0x3390('0xc')]=_0x46c706[_0x3390('0xc')];this[_0x3390('0xd')]=_0x46c706[_0x3390('0xd')];this[_0x3390('0x5')]=_0x46c706['queue'];this[_0x3390('0xf')]=_0x46c706[_0x3390('0xf')];this[_0x3390('0x10')]=_0x46c706[_0x3390('0x10')];this[_0x3390('0x11')]=_0x46c706[_0x3390('0x11')];this[_0x3390('0x12')]=_0x46c706[_0x3390('0x12')];this[_0x3390('0x13')]=_0x46c706[_0x3390('0x12')];this[_0x3390('0x14')]=_0x46c706[_0x3390('0x14')]||0x0;this[_0x3390('0x15')]=_0x46c706[_0x3390('0x15')]||0x0;this[_0x3390('0x16')]=_0x46c706[_0x3390('0x16')]||0x0;this[_0x3390('0x17')]=_0x46c706['callback'];this[_0x3390('0x18')]=_0x46c706[_0x3390('0x18')];this[_0x3390('0x19')]=_0x46c706[_0x3390('0x19')];this['recallme']=_0x46c706[_0x3390('0x1a')];this[_0x3390('0x1b')]=_0x46c706[_0x3390('0x1b')];this[_0x3390('0x1c')]=_0x46c706['ListId'];this[_0x3390('0x1d')]=_0x46c706['UserId'];this[_0x3390('0x1e')]=_0x46c706[_0x3390('0x1e')];this[_0x3390('0x1f')]=_0x46c706[_0x3390('0x1f')];this['originatecalleridnum']=_0x46c706[_0x3390('0x20')]||'';this[_0x3390('0x21')]=_0x46c706[_0x3390('0x21')]||'';this['state']=_0x46c706['state'];this[_0x3390('0x22')]=_0x46c706[_0x3390('0x22')];}module[_0x3390('0x23')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/models/hangup.js b/server/services/ami/dialer/models/hangup.js index a922cd0..7807bfe 100644 --- a/server/services/ami/dialer/models/hangup.js +++ b/server/services/ami/dialer/models/hangup.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7ccd=['countnosuchnumberretry','countmachineretry','countagentrejectretry','countdropretry','countabandonedretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','moment','../utils','state','Answer','scheduledat','type','campaigntype','outbound','queue','amd','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x3bc7dd,_0x52b090){var _0x746f74=function(_0x47ea6f){while(--_0x47ea6f){_0x3bc7dd['push'](_0x3bc7dd['shift']());}};_0x746f74(++_0x52b090);}(_0x7ccd,0x152));var _0xd7cc=function(_0x5c6f82,_0x418c60){_0x5c6f82=_0x5c6f82-0x0;var _0xbe0cd0=_0x7ccd[_0x5c6f82];return _0xbe0cd0;};'use strict';var moment=require(_0xd7cc('0x0'));var utils=require(_0xd7cc('0x1'));function Hangup(_0x1fcbd7,_0x3e6f79){this[_0xd7cc('0x2')]=0x4;this['statedesc']=_0xd7cc('0x3');this[_0xd7cc('0x4')]=_0x1fcbd7[_0xd7cc('0x4')];this[_0xd7cc('0x5')]=_0x1fcbd7['type'];this[_0xd7cc('0x6')]=_0x1fcbd7[_0xd7cc('0x5')]===_0xd7cc('0x7')?_0xd7cc('0x8'):_0x1fcbd7[_0xd7cc('0x5')];this[_0xd7cc('0x9')]=_0x1fcbd7[_0xd7cc('0x9')]||![];this[_0xd7cc('0xa')]=_0x1fcbd7[_0xd7cc('0xa')];this[_0xd7cc('0xb')]=_0x1fcbd7['countcongestionretry'];this[_0xd7cc('0xc')]=_0x1fcbd7[_0xd7cc('0xc')];this['countglobal']=_0x1fcbd7[_0xd7cc('0xa')]+_0x1fcbd7[_0xd7cc('0xb')]+_0x1fcbd7[_0xd7cc('0xc')]+_0x1fcbd7[_0xd7cc('0xd')]+_0x1fcbd7['countdropretry']+_0x1fcbd7['countabandonedretry']+_0x1fcbd7[_0xd7cc('0xe')]+_0x1fcbd7[_0xd7cc('0xf')];this['countnosuchnumberretry']=_0x1fcbd7[_0xd7cc('0xd')];this[_0xd7cc('0x10')]=_0x1fcbd7[_0xd7cc('0x10')];this[_0xd7cc('0x11')]=_0x1fcbd7['countabandonedretry'];this[_0xd7cc('0xe')]=_0x1fcbd7[_0xd7cc('0xe')];this[_0xd7cc('0xf')]=_0x1fcbd7[_0xd7cc('0xf')];this[_0xd7cc('0x12')]=_0x3e6f79[_0xd7cc('0x12')];this[_0xd7cc('0x13')]=_0x1fcbd7[_0xd7cc('0x14')];this[_0xd7cc('0x15')]=_0x1fcbd7['number'];this[_0xd7cc('0x16')]=_0x1fcbd7[_0xd7cc('0x16')];this[_0xd7cc('0x17')]=_0x1fcbd7[_0xd7cc('0x17')];this[_0xd7cc('0x18')]=moment()[_0xd7cc('0x19')](_0xd7cc('0x1a'));this[_0xd7cc('0x1b')]=utils['getSeconds'](_0x1fcbd7[_0xd7cc('0x17')],_0x1fcbd7[_0xd7cc('0x16')]);this['holdtime']=0x0;this['talktime']=utils['getSeconds'](this[_0xd7cc('0x18')],_0x1fcbd7[_0xd7cc('0x17')]);this[_0xd7cc('0x8')]=_0x1fcbd7[_0xd7cc('0x8')];this[_0xd7cc('0x1c')]=_0xd7cc('0x1d');this[_0xd7cc('0x1e')]=_0x3e6f79[_0xd7cc('0x1f')];this[_0xd7cc('0x20')]=_0x1fcbd7[_0xd7cc('0x20')];this[_0xd7cc('0x21')]=_0x1fcbd7[_0xd7cc('0x21')];this['callbackat']=_0x1fcbd7['callbackat'];this['recallme']=_0x1fcbd7[_0xd7cc('0x22')];this[_0xd7cc('0x23')]=_0x1fcbd7[_0xd7cc('0x23')];this[_0xd7cc('0x24')]=_0x1fcbd7[_0xd7cc('0x24')];this['UserId']=_0x1fcbd7[_0xd7cc('0x25')];this[_0xd7cc('0x26')]=_0x1fcbd7['VoiceQueueId'];this['CampaignId']=_0x1fcbd7['CampaignId'];}module['exports']=Hangup; \ No newline at end of file +var _0x0c94=['campaigntype','outbound','queue','amd','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','talktime','getSeconds','membername','IVR','reason','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','moment','../utils','state','statedesc','Answer','scheduledat','type'];(function(_0x215863,_0x44609a){var _0x4d5f5c=function(_0x3a18dc){while(--_0x3a18dc){_0x215863['push'](_0x215863['shift']());}};_0x4d5f5c(++_0x44609a);}(_0x0c94,0x7a));var _0x40c9=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0x0c94[_0x1beef3];return _0x5af964;};'use strict';var moment=require(_0x40c9('0x0'));var utils=require(_0x40c9('0x1'));function Hangup(_0x3cdbd3,_0x421fd4){this[_0x40c9('0x2')]=0x4;this[_0x40c9('0x3')]=_0x40c9('0x4');this[_0x40c9('0x5')]=_0x3cdbd3[_0x40c9('0x5')];this['type']=_0x3cdbd3[_0x40c9('0x6')];this[_0x40c9('0x7')]=_0x3cdbd3['type']===_0x40c9('0x8')?_0x40c9('0x9'):_0x3cdbd3[_0x40c9('0x6')];this[_0x40c9('0xa')]=_0x3cdbd3[_0x40c9('0xa')]||![];this[_0x40c9('0xb')]=_0x3cdbd3['countbusyretry'];this[_0x40c9('0xc')]=_0x3cdbd3['countcongestionretry'];this['countnoanswerretry']=_0x3cdbd3[_0x40c9('0xd')];this['countglobal']=_0x3cdbd3['countbusyretry']+_0x3cdbd3[_0x40c9('0xc')]+_0x3cdbd3[_0x40c9('0xd')]+_0x3cdbd3['countnosuchnumberretry']+_0x3cdbd3[_0x40c9('0xe')]+_0x3cdbd3[_0x40c9('0xf')]+_0x3cdbd3[_0x40c9('0x10')]+_0x3cdbd3[_0x40c9('0x11')];this[_0x40c9('0x12')]=_0x3cdbd3[_0x40c9('0x12')];this[_0x40c9('0xe')]=_0x3cdbd3[_0x40c9('0xe')];this[_0x40c9('0xf')]=_0x3cdbd3[_0x40c9('0xf')];this[_0x40c9('0x10')]=_0x3cdbd3['countmachineretry'];this[_0x40c9('0x11')]=_0x3cdbd3[_0x40c9('0x11')];this[_0x40c9('0x13')]=_0x421fd4[_0x40c9('0x13')];this[_0x40c9('0x14')]=_0x3cdbd3['name'];this[_0x40c9('0x15')]=_0x3cdbd3[_0x40c9('0x16')];this[_0x40c9('0x17')]=_0x3cdbd3[_0x40c9('0x17')];this['responsetime']=_0x3cdbd3[_0x40c9('0x18')];this[_0x40c9('0x19')]=moment()[_0x40c9('0x1a')](_0x40c9('0x1b'));this[_0x40c9('0x1c')]=utils['getSeconds'](_0x3cdbd3[_0x40c9('0x18')],_0x3cdbd3[_0x40c9('0x17')]);this['holdtime']=0x0;this[_0x40c9('0x1d')]=utils[_0x40c9('0x1e')](this[_0x40c9('0x19')],_0x3cdbd3[_0x40c9('0x18')]);this[_0x40c9('0x9')]=_0x3cdbd3[_0x40c9('0x9')];this[_0x40c9('0x1f')]=_0x40c9('0x20');this[_0x40c9('0x21')]=_0x421fd4['cause-txt'];this['callback']=_0x3cdbd3['callback'];this[_0x40c9('0x22')]=_0x3cdbd3['callbackuniqueid'];this['callbackat']=_0x3cdbd3[_0x40c9('0x23')];this[_0x40c9('0x24')]=_0x3cdbd3[_0x40c9('0x24')];this['ContactId']=_0x3cdbd3[_0x40c9('0x25')];this[_0x40c9('0x26')]=_0x3cdbd3[_0x40c9('0x26')];this[_0x40c9('0x27')]=_0x3cdbd3['UserId'];this['VoiceQueueId']=_0x3cdbd3[_0x40c9('0x28')];this[_0x40c9('0x29')]=_0x3cdbd3[_0x40c9('0x29')];}module[_0x40c9('0x2a')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/models/history.js b/server/services/ami/dialer/models/history.js index 76f7eca..6b619a2 100644 --- a/server/services/ami/dialer/models/history.js +++ b/server/services/ami/dialer/models/history.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x59e5=['callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','uniqueid','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','calleridname','name','calleridnum','responsetime','endtime','ringtime','getSeconds','holdtime','callback'];(function(_0x28b20a,_0x1c87ed){var _0x5c3b50=function(_0x4ad21e){while(--_0x4ad21e){_0x28b20a['push'](_0x28b20a['shift']());}};_0x5c3b50(++_0x1c87ed);}(_0x59e5,0x147));var _0x559e=function(_0x50f2a1,_0x231aa6){_0x50f2a1=_0x50f2a1-0x0;var _0x42206a=_0x59e5[_0x50f2a1];return _0x42206a;};'use strict';var utils=require('../utils');function History(_0x2e595f){this[_0x559e('0x0')]=_0x2e595f[_0x559e('0x0')];this[_0x559e('0x1')]=_0x2e595f['scheduledat']||undefined;this[_0x559e('0x2')]=_0x2e595f[_0x559e('0x2')];this[_0x559e('0x3')]=_0x2e595f[_0x559e('0x2')]==='outbound'?_0x559e('0x4'):_0x2e595f[_0x559e('0x2')];this['countbusyretry']=_0x2e595f[_0x559e('0x5')];this[_0x559e('0x6')]=_0x2e595f['countcongestionretry'];this['countnoanswerretry']=_0x2e595f[_0x559e('0x7')];this[_0x559e('0x8')]=_0x2e595f['countbusyretry']+_0x2e595f[_0x559e('0x6')]+_0x2e595f[_0x559e('0x7')]+_0x2e595f['countnosuchnumberretry']+_0x2e595f[_0x559e('0x9')]+_0x2e595f[_0x559e('0xa')]+_0x2e595f[_0x559e('0xb')]+_0x2e595f[_0x559e('0xc')];this[_0x559e('0xd')]=_0x2e595f[_0x559e('0xd')];this[_0x559e('0x9')]=_0x2e595f[_0x559e('0x9')];this[_0x559e('0xa')]=_0x2e595f[_0x559e('0xa')];this[_0x559e('0xb')]=_0x2e595f[_0x559e('0xb')];this['countagentrejectretry']=_0x2e595f['countagentrejectretry'];this['queue']=_0x2e595f[_0x559e('0x4')];this[_0x559e('0xe')]=_0x2e595f[_0x559e('0xf')];this[_0x559e('0x10')]=_0x2e595f['number'];this['starttime']=_0x2e595f['starttime'];this[_0x559e('0x11')]=_0x2e595f[_0x559e('0x11')];this[_0x559e('0x12')]=_0x2e595f[_0x559e('0x11')];this[_0x559e('0x13')]=utils[_0x559e('0x14')](_0x2e595f[_0x559e('0x11')],_0x2e595f['starttime']);this[_0x559e('0x15')]=0x0;this['talktime']=0x0;this[_0x559e('0x16')]=_0x2e595f[_0x559e('0x16')];this[_0x559e('0x17')]=_0x2e595f[_0x559e('0x17')];this[_0x559e('0x18')]=_0x2e595f[_0x559e('0x18')];this[_0x559e('0x19')]=_0x2e595f[_0x559e('0x19')];this[_0x559e('0x1a')]=_0x2e595f[_0x559e('0x1a')];this[_0x559e('0x1b')]=_0x2e595f['ListId'];this['UserId']=_0x2e595f[_0x559e('0x1c')];this['VoiceQueueId']=_0x2e595f[_0x559e('0x1d')];this[_0x559e('0x1e')]=_0x2e595f[_0x559e('0x1e')];this[_0x559e('0x1f')]=_0x2e595f['originatecalleridnum']||'';this[_0x559e('0x20')]=_0x2e595f[_0x559e('0x20')]||'';this[_0x559e('0x21')]=_0x2e595f[_0x559e('0x21')];this[_0x559e('0x22')]=_0x2e595f[_0x559e('0x22')];}module['exports']=History; \ No newline at end of file +var _0x7b33=['type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','calleridname','name','number','starttime','responsetime','endtime','ringtime','getSeconds','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','../utils','uniqueid','scheduledat'];(function(_0x2455fa,_0x53083d){var _0x4a532e=function(_0x210e90){while(--_0x210e90){_0x2455fa['push'](_0x2455fa['shift']());}};_0x4a532e(++_0x53083d);}(_0x7b33,0xe1));var _0x37b3=function(_0x5d9865,_0x47738e){_0x5d9865=_0x5d9865-0x0;var _0x2ea2c2=_0x7b33[_0x5d9865];return _0x2ea2c2;};'use strict';var utils=require(_0x37b3('0x0'));function History(_0x78316a){this[_0x37b3('0x1')]=_0x78316a['uniqueid'];this[_0x37b3('0x2')]=_0x78316a['scheduledat']||undefined;this[_0x37b3('0x3')]=_0x78316a[_0x37b3('0x3')];this['campaigntype']=_0x78316a[_0x37b3('0x3')]===_0x37b3('0x4')?_0x37b3('0x5'):_0x78316a['type'];this[_0x37b3('0x6')]=_0x78316a[_0x37b3('0x6')];this[_0x37b3('0x7')]=_0x78316a[_0x37b3('0x7')];this[_0x37b3('0x8')]=_0x78316a[_0x37b3('0x8')];this[_0x37b3('0x9')]=_0x78316a[_0x37b3('0x6')]+_0x78316a['countcongestionretry']+_0x78316a['countnoanswerretry']+_0x78316a[_0x37b3('0xa')]+_0x78316a['countdropretry']+_0x78316a[_0x37b3('0xb')]+_0x78316a[_0x37b3('0xc')]+_0x78316a[_0x37b3('0xd')];this[_0x37b3('0xa')]=_0x78316a[_0x37b3('0xa')];this[_0x37b3('0xe')]=_0x78316a[_0x37b3('0xe')];this[_0x37b3('0xb')]=_0x78316a[_0x37b3('0xb')];this['countmachineretry']=_0x78316a[_0x37b3('0xc')];this[_0x37b3('0xd')]=_0x78316a[_0x37b3('0xd')];this[_0x37b3('0x5')]=_0x78316a[_0x37b3('0x5')];this[_0x37b3('0xf')]=_0x78316a[_0x37b3('0x10')];this['calleridnum']=_0x78316a[_0x37b3('0x11')];this[_0x37b3('0x12')]=_0x78316a['starttime'];this[_0x37b3('0x13')]=_0x78316a[_0x37b3('0x13')];this[_0x37b3('0x14')]=_0x78316a[_0x37b3('0x13')];this[_0x37b3('0x15')]=utils[_0x37b3('0x16')](_0x78316a[_0x37b3('0x13')],_0x78316a[_0x37b3('0x12')]);this[_0x37b3('0x17')]=0x0;this[_0x37b3('0x18')]=0x0;this['callback']=_0x78316a[_0x37b3('0x19')];this[_0x37b3('0x1a')]=_0x78316a[_0x37b3('0x1a')];this['callbackat']=_0x78316a[_0x37b3('0x1b')];this[_0x37b3('0x1c')]=_0x78316a['recallme'];this[_0x37b3('0x1d')]=_0x78316a['ContactId'];this[_0x37b3('0x1e')]=_0x78316a[_0x37b3('0x1e')];this[_0x37b3('0x1f')]=_0x78316a[_0x37b3('0x1f')];this[_0x37b3('0x20')]=_0x78316a[_0x37b3('0x20')];this['CampaignId']=_0x78316a[_0x37b3('0x21')];this[_0x37b3('0x22')]=_0x78316a[_0x37b3('0x22')]||'';this[_0x37b3('0x23')]=_0x78316a[_0x37b3('0x23')]||'';this[_0x37b3('0x24')]=_0x78316a[_0x37b3('0x24')];this[_0x37b3('0x25')]=_0x78316a['statedesc'];}module['exports']=History; \ No newline at end of file diff --git a/server/services/ami/dialer/models/queueCallerAbandon.js b/server/services/ami/dialer/models/queueCallerAbandon.js index 4fc8521..99e55df 100644 --- a/server/services/ami/dialer/models/queueCallerAbandon.js +++ b/server/services/ami/dialer/models/queueCallerAbandon.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1afc=['countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','name','calleridnum','number','responsetime','droptime','dropreason','endtime','ringtime','getSeconds','starttime','holdtime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','exports','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry'];(function(_0x35919c,_0x49e103){var _0x32b0a3=function(_0x308fc8){while(--_0x308fc8){_0x35919c['push'](_0x35919c['shift']());}};_0x32b0a3(++_0x49e103);}(_0x1afc,0xce));var _0xc1af=function(_0x3b5017,_0xda1425){_0x3b5017=_0x3b5017-0x0;var _0x582b90=_0x1afc[_0x3b5017];return _0x582b90;};'use strict';var utils=require('../utils');function QueueCallerAbandon(_0x148641,_0x4b1267){this[_0xc1af('0x0')]=_0x148641[_0xc1af('0x0')];this[_0xc1af('0x1')]=_0x148641[_0xc1af('0x1')];this['campaigntype']=_0x148641[_0xc1af('0x1')]===_0xc1af('0x2')?_0xc1af('0x3'):_0x148641[_0xc1af('0x1')];this[_0xc1af('0x4')]=_0x148641[_0xc1af('0x4')];this[_0xc1af('0x5')]=_0x148641[_0xc1af('0x5')];this[_0xc1af('0x6')]=_0x148641[_0xc1af('0x6')];this[_0xc1af('0x7')]=_0x148641['countbusyretry']+_0x148641[_0xc1af('0x5')]+_0x148641['countnoanswerretry']+_0x148641[_0xc1af('0x8')]+_0x148641[_0xc1af('0x9')]+_0x148641[_0xc1af('0xa')]+_0x148641['countmachineretry']+_0x148641[_0xc1af('0xb')];this[_0xc1af('0x8')]=_0x148641[_0xc1af('0x8')];this[_0xc1af('0x9')]=_0x148641[_0xc1af('0x9')];this['countabandonedretry']=_0x148641[_0xc1af('0xa')];this[_0xc1af('0xc')]=_0x148641['countmachineretry'];this[_0xc1af('0xb')]=_0x148641[_0xc1af('0xb')];this[_0xc1af('0xd')]=_0x4b1267['uniqueid'];this['calleridname']=_0x148641[_0xc1af('0xe')];this[_0xc1af('0xf')]=_0x148641[_0xc1af('0x10')];this['starttime']=_0x148641['starttime'];this[_0xc1af('0x11')]=_0x148641[_0xc1af('0x11')];this[_0xc1af('0x12')]=_0x148641['droptime'];this[_0xc1af('0x13')]=_0x148641[_0xc1af('0x13')];this[_0xc1af('0x14')]=this[_0xc1af('0x12')];this[_0xc1af('0x15')]=utils[_0xc1af('0x16')](_0x148641[_0xc1af('0x11')],_0x148641[_0xc1af('0x17')]);this[_0xc1af('0x18')]=utils[_0xc1af('0x16')](this[_0xc1af('0x12')],_0x148641[_0xc1af('0x11')]);this[_0xc1af('0x19')]=0x0;this[_0xc1af('0x3')]=_0x4b1267[_0xc1af('0x3')];this[_0xc1af('0x1a')]=_0x4b1267[_0xc1af('0x1b')];this['reason']=_0x4b1267[_0xc1af('0x1c')];this['callback']=_0x148641[_0xc1af('0x1d')];this[_0xc1af('0x1e')]=_0x148641[_0xc1af('0x1e')];this['callbackat']=_0x148641['callbackat'];this[_0xc1af('0x1f')]=_0x148641[_0xc1af('0x1f')];this[_0xc1af('0x20')]=_0x148641['ContactId'];this[_0xc1af('0x21')]=_0x148641[_0xc1af('0x21')];this[_0xc1af('0x22')]=_0x148641[_0xc1af('0x22')];this[_0xc1af('0x23')]=_0x148641[_0xc1af('0x23')];this[_0xc1af('0x24')]=_0x148641['CampaignId'];this[_0xc1af('0x25')]=_0x148641[_0xc1af('0x25')]||'';this[_0xc1af('0x26')]=_0x148641[_0xc1af('0x26')]||'';this['agiafterat']=_0x148641[_0xc1af('0x27')];this[_0xc1af('0x28')]=_0x148641['state'];this['statedesc']=_0x148641[_0xc1af('0x29')];}module[_0xc1af('0x2a')]=QueueCallerAbandon; \ No newline at end of file +var _0xd03f=['agiafterat','state','statedesc','exports','../utils','scheduledat','type','queue','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countabandonedretry','uniqueid','calleridname','number','starttime','responsetime','droptime','dropreason','endtime','getSeconds','holdtime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname'];(function(_0x102268,_0x2fe979){var _0x267e8e=function(_0x5e6fc6){while(--_0x5e6fc6){_0x102268['push'](_0x102268['shift']());}};_0x267e8e(++_0x2fe979);}(_0xd03f,0x1d8));var _0xfd03=function(_0x34fb62,_0x5322cc){_0x34fb62=_0x34fb62-0x0;var _0xec5da=_0xd03f[_0x34fb62];return _0xec5da;};'use strict';var utils=require(_0xfd03('0x0'));function QueueCallerAbandon(_0x2f104c,_0x585985){this[_0xfd03('0x1')]=_0x2f104c[_0xfd03('0x1')];this['type']=_0x2f104c['type'];this['campaigntype']=_0x2f104c[_0xfd03('0x2')]==='outbound'?_0xfd03('0x3'):_0x2f104c['type'];this['countbusyretry']=_0x2f104c[_0xfd03('0x4')];this[_0xfd03('0x5')]=_0x2f104c[_0xfd03('0x5')];this[_0xfd03('0x6')]=_0x2f104c[_0xfd03('0x6')];this['countglobal']=_0x2f104c[_0xfd03('0x4')]+_0x2f104c[_0xfd03('0x5')]+_0x2f104c[_0xfd03('0x6')]+_0x2f104c['countnosuchnumberretry']+_0x2f104c[_0xfd03('0x7')]+_0x2f104c['countabandonedretry']+_0x2f104c[_0xfd03('0x8')]+_0x2f104c[_0xfd03('0x9')];this[_0xfd03('0xa')]=_0x2f104c[_0xfd03('0xa')];this[_0xfd03('0x7')]=_0x2f104c['countdropretry'];this[_0xfd03('0xb')]=_0x2f104c[_0xfd03('0xb')];this[_0xfd03('0x8')]=_0x2f104c['countmachineretry'];this[_0xfd03('0x9')]=_0x2f104c['countagentrejectretry'];this[_0xfd03('0xc')]=_0x585985[_0xfd03('0xc')];this[_0xfd03('0xd')]=_0x2f104c['name'];this['calleridnum']=_0x2f104c[_0xfd03('0xe')];this[_0xfd03('0xf')]=_0x2f104c[_0xfd03('0xf')];this[_0xfd03('0x10')]=_0x2f104c[_0xfd03('0x10')];this[_0xfd03('0x11')]=_0x2f104c[_0xfd03('0x11')];this[_0xfd03('0x12')]=_0x2f104c[_0xfd03('0x12')];this[_0xfd03('0x13')]=this['droptime'];this['ringtime']=utils[_0xfd03('0x14')](_0x2f104c[_0xfd03('0x10')],_0x2f104c[_0xfd03('0xf')]);this[_0xfd03('0x15')]=utils[_0xfd03('0x14')](this[_0xfd03('0x11')],_0x2f104c['responsetime']);this['talktime']=0x0;this[_0xfd03('0x3')]=_0x585985[_0xfd03('0x3')];this[_0xfd03('0x16')]=_0x585985[_0xfd03('0x17')];this[_0xfd03('0x18')]=_0x585985['reason'];this[_0xfd03('0x19')]=_0x2f104c['callback'];this[_0xfd03('0x1a')]=_0x2f104c['callbackuniqueid'];this[_0xfd03('0x1b')]=_0x2f104c['callbackat'];this['recallme']=_0x2f104c[_0xfd03('0x1c')];this[_0xfd03('0x1d')]=_0x2f104c['ContactId'];this[_0xfd03('0x1e')]=_0x2f104c['ListId'];this['UserId']=_0x2f104c[_0xfd03('0x1f')];this['VoiceQueueId']=_0x2f104c['VoiceQueueId'];this[_0xfd03('0x20')]=_0x2f104c[_0xfd03('0x20')];this[_0xfd03('0x21')]=_0x2f104c[_0xfd03('0x21')]||'';this[_0xfd03('0x22')]=_0x2f104c[_0xfd03('0x22')]||'';this[_0xfd03('0x23')]=_0x2f104c[_0xfd03('0x23')];this[_0xfd03('0x24')]=_0x2f104c[_0xfd03('0x24')];this[_0xfd03('0x25')]=_0x2f104c[_0xfd03('0x25')];}module[_0xfd03('0x26')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/hopper.js b/server/services/ami/dialer/utils/hopper.js index 01abd1d..777420c 100644 --- a/server/services/ami/dialer/utils/hopper.js +++ b/server/services/ami/dialer/utils/hopper.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1967=['dialer','../../rpc/cmHopper','../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperBlack','../../rpc/cmHopperHistory','inspect','getContactDialer','dialOrderByScheduledAt','catch','temp','error','getContactDialerIvr','[getContactDialerIvr]','countReScheduled','[countReScheduled]','rescheduleContact','unlockContact','[unlockContact]','moveContactManagedDialer','[moveContactManagedDialer]','[checkIsBlackList]','checkIsBlackList','checkIsBlackListIvr','verifyAdditionalPhones','[verifyAdditionalPhone]','swapAdditionalPhones','[swapAdditionalPhone]','avgHandleTime','createHistory','[createHistory]','../../../../config/logger'];(function(_0x534e9a,_0x5bd217){var _0x4628fc=function(_0x21f5f3){while(--_0x21f5f3){_0x534e9a['push'](_0x534e9a['shift']());}};_0x4628fc(++_0x5bd217);}(_0x1967,0x173));var _0x7196=function(_0x402bcb,_0xf994bf){_0x402bcb=_0x402bcb-0x0;var _0x346723=_0x1967[_0x402bcb];return _0x346723;};'use strict';var util=require('util');var logger=require(_0x7196('0x0'))(_0x7196('0x1'));var cmHopper=require(_0x7196('0x2'));var cmHopperAdditionalPhone=require(_0x7196('0x3'));var cmHopperBlack=require(_0x7196('0x4'));var cmHopperHistory=require(_0x7196('0x5'));function inspectError(_0x302f34){return util[_0x7196('0x6')](_0x302f34,{'showHidden':![],'depth':null});}function getContactDialer(_0x458ae8,_0x3ae43f,_0x5c128f){return cmHopper[_0x7196('0x7')](_0x458ae8['id'],_0x3ae43f,_0x5c128f,_0x458ae8[_0x7196('0x8')])[_0x7196('0x9')](function(_0x40e0af){_0x458ae8[_0x7196('0xa')]=0x0;logger[_0x7196('0xb')]('[getContactDialer]',inspectError(_0x40e0af));});}exports[_0x7196('0x7')]=getContactDialer;function getContactDialerIvr(_0xc6366f,_0x3f846e){return cmHopper[_0x7196('0xc')](_0xc6366f['id'],_0x3f846e,_0xc6366f[_0x7196('0x8')])['catch'](function(_0x49e5fb){_0xc6366f[_0x7196('0xa')]=0x0;logger[_0x7196('0xb')](_0x7196('0xd'),inspectError(_0x49e5fb));});}exports[_0x7196('0xc')]=getContactDialerIvr;function countReScheduled(_0x25b780){return cmHopper[_0x7196('0xe')](_0x25b780)[_0x7196('0x9')](function(_0x325641){logger[_0x7196('0xb')](_0x7196('0xf'),inspectError(_0x325641));});}exports[_0x7196('0xe')]=countReScheduled;function rescheduleContact(_0x4e8c4c){return cmHopper[_0x7196('0x10')](_0x4e8c4c)[_0x7196('0x9')](function(_0x3545aa){logger[_0x7196('0xb')]('[rescheduleContact]',inspectError(_0x3545aa));});}exports[_0x7196('0x10')]=rescheduleContact;function unlockContact(_0x539414,_0xe32933,_0x2590a6){return cmHopper[_0x7196('0x11')](_0x539414,_0xe32933,_0x2590a6)[_0x7196('0x9')](function(_0x12dce7){logger[_0x7196('0xb')](_0x7196('0x12'),inspectError(_0x12dce7));});}exports[_0x7196('0x11')]=unlockContact;function moveContactManagedDialer(_0x3e4e69){return cmHopper[_0x7196('0x13')](_0x3e4e69)[_0x7196('0x9')](function(_0x5b716a){logger['error'](_0x7196('0x14'),inspectError(_0x5b716a));});}exports[_0x7196('0x13')]=moveContactManagedDialer;function checkIsBlackList(_0x40418d){return cmHopperBlack['checkIsBlackList'](_0x40418d)[_0x7196('0x9')](function(_0x539d8b){logger['error'](_0x7196('0x15'),inspectError(_0x539d8b));});}exports[_0x7196('0x16')]=checkIsBlackList;function checkIsBlackListIvr(_0x8dee9d){return cmHopperBlack['checkIsBlackListIvr'](_0x8dee9d)['catch'](function(_0x38d291){logger[_0x7196('0xb')]('[checkIsBlackListIvr]',inspectError(_0x38d291));});}exports[_0x7196('0x17')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x27ff84,_0x6e22e5,_0x18d389){return cmHopperAdditionalPhone[_0x7196('0x18')](_0x27ff84,_0x6e22e5,_0x18d389)['catch'](function(_0x3f8178){logger['error'](_0x7196('0x19'),inspectError(_0x3f8178));});}exports[_0x7196('0x18')]=verifyAdditionalPhones;function swapAdditionalPhones(_0x2e15c7,_0xa69810,_0x70aa65){return cmHopperAdditionalPhone[_0x7196('0x1a')](_0x2e15c7,_0xa69810,_0x70aa65)['catch'](function(_0x57c404){logger[_0x7196('0xb')](_0x7196('0x1b'),inspectError(_0x57c404));});}exports[_0x7196('0x1a')]=swapAdditionalPhones;function avgHandleTime(_0x4e878f){return cmHopperHistory['avgHandleTime'](_0x4e878f)[_0x7196('0x9')](function(_0x162cfc){logger[_0x7196('0xb')]('[avgHandleTime]',inspectError(_0x162cfc));});}exports[_0x7196('0x1c')]=avgHandleTime;function createHistory(_0x4ecea1){return cmHopperHistory[_0x7196('0x1d')](_0x4ecea1)['catch'](function(_0x30151f){logger[_0x7196('0xb')](_0x7196('0x1e'),inspectError(_0x30151f));});}exports['createHistory']=createHistory; \ No newline at end of file +var _0xf2e3=['../../rpc/cmHopperHistory','inspect','getContactDialer','dialOrderByScheduledAt','catch','temp','error','[getContactDialer]','getContactDialerIvr','[getContactDialerIvr]','[countReScheduled]','countReScheduled','rescheduleContact','[rescheduleContact]','unlockContact','[unlockContact]','moveContactManagedDialer','[moveContactManagedDialer]','checkIsBlackList','[checkIsBlackList]','checkIsBlackListIvr','[checkIsBlackListIvr]','swapAdditionalPhones','[swapAdditionalPhone]','avgHandleTime','[avgHandleTime]','createHistory','util','dialer','../../rpc/cmHopper','../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperBlack'];(function(_0x5aa141,_0x2d6e3a){var _0x446d2f=function(_0x11bb05){while(--_0x11bb05){_0x5aa141['push'](_0x5aa141['shift']());}};_0x446d2f(++_0x2d6e3a);}(_0xf2e3,0x9b));var _0x3f2e=function(_0xe73080,_0x24c56d){_0xe73080=_0xe73080-0x0;var _0x12cbc4=_0xf2e3[_0xe73080];return _0x12cbc4;};'use strict';var util=require(_0x3f2e('0x0'));var logger=require('../../../../config/logger')(_0x3f2e('0x1'));var cmHopper=require(_0x3f2e('0x2'));var cmHopperAdditionalPhone=require(_0x3f2e('0x3'));var cmHopperBlack=require(_0x3f2e('0x4'));var cmHopperHistory=require(_0x3f2e('0x5'));function inspectError(_0x1634cd){return util[_0x3f2e('0x6')](_0x1634cd,{'showHidden':![],'depth':null});}function getContactDialer(_0xabcf5c,_0x216b26,_0x5f254a){return cmHopper[_0x3f2e('0x7')](_0xabcf5c['id'],_0x216b26,_0x5f254a,_0xabcf5c[_0x3f2e('0x8')])[_0x3f2e('0x9')](function(_0xdf499f){_0xabcf5c[_0x3f2e('0xa')]=0x0;logger[_0x3f2e('0xb')](_0x3f2e('0xc'),inspectError(_0xdf499f));});}exports[_0x3f2e('0x7')]=getContactDialer;function getContactDialerIvr(_0x2676a7,_0x29a6cc){return cmHopper[_0x3f2e('0xd')](_0x2676a7['id'],_0x29a6cc,_0x2676a7[_0x3f2e('0x8')])[_0x3f2e('0x9')](function(_0x10a392){_0x2676a7[_0x3f2e('0xa')]=0x0;logger[_0x3f2e('0xb')](_0x3f2e('0xe'),inspectError(_0x10a392));});}exports[_0x3f2e('0xd')]=getContactDialerIvr;function countReScheduled(_0x39b819){return cmHopper['countReScheduled'](_0x39b819)[_0x3f2e('0x9')](function(_0xaa6ef5){logger['error'](_0x3f2e('0xf'),inspectError(_0xaa6ef5));});}exports[_0x3f2e('0x10')]=countReScheduled;function rescheduleContact(_0x9dd50b){return cmHopper[_0x3f2e('0x11')](_0x9dd50b)[_0x3f2e('0x9')](function(_0x57cba7){logger[_0x3f2e('0xb')](_0x3f2e('0x12'),inspectError(_0x57cba7));});}exports[_0x3f2e('0x11')]=rescheduleContact;function unlockContact(_0x4f2e38,_0x43f69e,_0x218b44){return cmHopper[_0x3f2e('0x13')](_0x4f2e38,_0x43f69e,_0x218b44)[_0x3f2e('0x9')](function(_0x1dc5d0){logger[_0x3f2e('0xb')](_0x3f2e('0x14'),inspectError(_0x1dc5d0));});}exports[_0x3f2e('0x13')]=unlockContact;function moveContactManagedDialer(_0x178283){return cmHopper[_0x3f2e('0x15')](_0x178283)[_0x3f2e('0x9')](function(_0x5b9989){logger[_0x3f2e('0xb')](_0x3f2e('0x16'),inspectError(_0x5b9989));});}exports[_0x3f2e('0x15')]=moveContactManagedDialer;function checkIsBlackList(_0xbe899c){return cmHopperBlack[_0x3f2e('0x17')](_0xbe899c)['catch'](function(_0x4ba868){logger[_0x3f2e('0xb')](_0x3f2e('0x18'),inspectError(_0x4ba868));});}exports[_0x3f2e('0x17')]=checkIsBlackList;function checkIsBlackListIvr(_0x2ac500){return cmHopperBlack[_0x3f2e('0x19')](_0x2ac500)[_0x3f2e('0x9')](function(_0x552443){logger['error'](_0x3f2e('0x1a'),inspectError(_0x552443));});}exports[_0x3f2e('0x19')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x5a66d6,_0x541292,_0x46bb1c){return cmHopperAdditionalPhone['verifyAdditionalPhones'](_0x5a66d6,_0x541292,_0x46bb1c)[_0x3f2e('0x9')](function(_0x401ed9){logger['error']('[verifyAdditionalPhone]',inspectError(_0x401ed9));});}exports['verifyAdditionalPhones']=verifyAdditionalPhones;function swapAdditionalPhones(_0x265bf1,_0x3d7631,_0x4c61d9){return cmHopperAdditionalPhone[_0x3f2e('0x1b')](_0x265bf1,_0x3d7631,_0x4c61d9)['catch'](function(_0x1ad875){logger['error'](_0x3f2e('0x1c'),inspectError(_0x1ad875));});}exports[_0x3f2e('0x1b')]=swapAdditionalPhones;function avgHandleTime(_0x12926e){return cmHopperHistory[_0x3f2e('0x1d')](_0x12926e)[_0x3f2e('0x9')](function(_0x4799d3){logger[_0x3f2e('0xb')](_0x3f2e('0x1e'),inspectError(_0x4799d3));});}exports['avgHandleTime']=avgHandleTime;function createHistory(_0x528063){return cmHopperHistory[_0x3f2e('0x1f')](_0x528063)[_0x3f2e('0x9')](function(_0x35f421){logger[_0x3f2e('0xb')]('[createHistory]',inspectError(_0x35f421));});}exports[_0x3f2e('0x1f')]=createHistory; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/index.js b/server/services/ami/dialer/utils/index.js index 4430728..0088e5a 100644 --- a/server/services/ami/dialer/utils/index.js +++ b/server/services/ami/dialer/utils/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8fe8=['%s%s','XMD-','setXMDContactVariables','lodash','moment','util','../../../../config/logger','dialer','../../../../config/environment/shared','timezones','RESCHEDULED_CONTACTS','IS_DISACTIVED','NOT_ACTIVE','AGENTS_NOT_LOGGED','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','INTERVAL_IS_OVERTIME','GLOBAL_INTERVAL_IS_OVERTIME','RECALLFAILEDTIMEOUT','RUNNING','TIMEZONE_UNKNOW','TRUNK_IS_NOT_REACHABLE','CAMPAIGN_STATUS','dialMethod','preview','isPreviewCampaign','type','ivr','isIVRCampaign','isOutboundQueue','dialActive','isQueueCampaignActive','isIVRCampaignActive','milliseconds','getSeconds','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','active','hasQueueCampaignDataChanged','dialTimezone','isNil','dialGlobalInterval','Interval','Intervals','isEmpty','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','reachable','unmonitored','includes','status','TrunkBackup','ACTIVE','INACTIVE','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','getQueueCampaignStatusMessage','DISACTIVED','getQueueCampaignActiveStatusMessage','string','isUndefined','\x22%s\x22\x20<%s>','format','\x22\x22\x20<>','getCallerId','pow','replace','random','getCallerIdRandom','error','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate','length','checkContactEmpty','erlangb','checkContactLowerLimitOriginate','createdAt','description','undefined'];(function(_0x33b138,_0x1d6ba0){var _0x907024=function(_0x3c5a69){while(--_0x3c5a69){_0x33b138['push'](_0x33b138['shift']());}};_0x907024(++_0x1d6ba0);}(_0x8fe8,0x10e));var _0x88fe=function(_0x453941,_0x105f24){_0x453941=_0x453941-0x0;var _0x25be65=_0x8fe8[_0x453941];return _0x25be65;};'use strict';var _=require(_0x88fe('0x0'));var moment=require(_0x88fe('0x1'));var util=require(_0x88fe('0x2'));var logger=require(_0x88fe('0x3'))(_0x88fe('0x4'));var timezones=require(_0x88fe('0x5'))[_0x88fe('0x6')];var CAMPAIGN_STATUS={'ACTIVE':'ACTIVE','BLACKLIST':'BLACKLIST','CONTACTS_RESCHEDULED':_0x88fe('0x7'),'DEACTIVATED':'DEACTIVATED','DISACTIVED':_0x88fe('0x8'),'EMPTY_INTERVAL':'INTERVAL_IS_EMPTY','INACTIVE':_0x88fe('0x9'),'NO_AGENTS_LOGGED':_0x88fe('0xa'),'NO_AVAILABLE_CONTACTS':_0x88fe('0xb'),'NULL_INTERVAL':_0x88fe('0xc'),'OVERTIME_INTERVAL':_0x88fe('0xd'),'OVERTIME_GLOBAL_INTERVAL':_0x88fe('0xe'),'QUEUE_RECALL':'RECALLINQUEUE','RECALL_TIMEOUT':_0x88fe('0xf'),'RUNNING':_0x88fe('0x10'),'UNKNOWN_TIMEZONE':_0x88fe('0x11'),'UNREACHABLE_TRUNK':_0x88fe('0x12')};exports[_0x88fe('0x13')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x2fa56b){return _0x2fa56b[_0x88fe('0x14')]===_0x88fe('0x15');}exports[_0x88fe('0x16')]=isPreviewCampaign;function isIVRCampaign(_0xc528eb){return _0xc528eb[_0x88fe('0x17')]===_0x88fe('0x18');}exports[_0x88fe('0x19')]=isIVRCampaign;function isOutboundQueue(_0x1fa3d4){return _0x1fa3d4[_0x88fe('0x17')]==='outbound';}exports[_0x88fe('0x1a')]=isOutboundQueue;function isQueueCampaignActive(_0x2e8fef){return _0x2e8fef[_0x88fe('0x1b')];}exports[_0x88fe('0x1c')]=isQueueCampaignActive;function isIVRCampaignActive(_0x48ee03){return _0x48ee03['active'];}exports[_0x88fe('0x1d')]=isIVRCampaignActive;function getSeconds(_0x3c0c1e,_0x40a6ff){var _0x29e081=moment(_0x3c0c1e)[_0x88fe('0x1e')](0x0);var _0xa63fcd=moment(_0x40a6ff)[_0x88fe('0x1e')](0x0);return _0x29e081['diff'](_0xa63fcd,'seconds');}exports[_0x88fe('0x1f')]=getSeconds;function hasQueueCampaignDataChanged(_0x1174d5,_0x2bb934){var _0x264173=![];var _0x5efddb=_0x1174d5[_0x88fe('0x14')]!==_0x2bb934[_0x88fe('0x14')]||_0x1174d5['dialActive']!==_0x2bb934['dialActive']||_0x1174d5[_0x88fe('0x20')]!==_0x2bb934['message'];var _0x2a291a=_0x1174d5[_0x88fe('0x21')]!==_0x2bb934[_0x88fe('0x21')]||_0x1174d5['loggedIn']!==_0x2bb934[_0x88fe('0x22')]||_0x1174d5['loggedInDb']!==_0x2bb934[_0x88fe('0x23')]||_0x1174d5[_0x88fe('0x24')]!==_0x2bb934[_0x88fe('0x24')]||_0x1174d5['talking']!==_0x2bb934[_0x88fe('0x25')]||_0x1174d5['pTalking']!==_0x2bb934[_0x88fe('0x26')]||_0x1174d5[_0x88fe('0x27')]!==_0x2bb934[_0x88fe('0x27')]||_0x1174d5[_0x88fe('0x28')]!==_0x2bb934['inUse']||_0x1174d5[_0x88fe('0x29')]!==_0x2bb934[_0x88fe('0x29')];if(_0x1174d5[_0x88fe('0x2a')]&&_0x2bb934['Trunk']){_0x264173=_0x1174d5[_0x88fe('0x2a')][_0x88fe('0x2b')]!==_0x2bb934[_0x88fe('0x2a')][_0x88fe('0x2b')]||_0x1174d5['Trunk'][_0x88fe('0x2c')]!==_0x2bb934[_0x88fe('0x2a')][_0x88fe('0x2c')];}return _0x5efddb||_0x2a291a||_0x264173;}exports[_0x88fe('0x2d')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x220a60){var _0x34ff0f=null;var _0x4bfbb2=_0x220a60[_0x88fe('0x2e')];if(_[_0x88fe('0x2f')](_0x220a60[_0x88fe('0x30')])||_['isNil'](_0x220a60[_0x88fe('0x31')])||_['isNil'](_0x220a60[_0x88fe('0x31')][_0x88fe('0x32')])){_0x34ff0f=CAMPAIGN_STATUS['NULL_INTERVAL'];}else if(_[_0x88fe('0x33')](_0x220a60['dialGlobalInterval'])||_[_0x88fe('0x33')](_0x220a60['Interval'][_0x88fe('0x32')])){_0x34ff0f=CAMPAIGN_STATUS[_0x88fe('0x34')];}else if(_0x4bfbb2&&!timezones[_0x4bfbb2]){_0x34ff0f=CAMPAIGN_STATUS[_0x88fe('0x35')];}return _0x34ff0f;}function checkAnyValidTrunk(_0x4361f7,_0x25eeb3){var _0x496936=null;var _0x2988e4='SIP/';var _0x32448f=[_0x88fe('0x36'),_0x88fe('0x37')];var _0x1c94fe=!![];if(_0x4361f7[_0x88fe('0x2a')]&&_0x4361f7[_0x88fe('0x2a')][_0x88fe('0x2c')]){_0x2988e4+=_0x4361f7[_0x88fe('0x2a')][_0x88fe('0x2b')];_0x496936=_0x25eeb3[_0x2988e4];_0x1c94fe=_0x32448f[_0x88fe('0x38')](_0x496936[_0x88fe('0x39')]);}else if(_0x4361f7['TrunkBackup']&&_0x4361f7[_0x88fe('0x3a')][_0x88fe('0x2c')]){_0x2988e4+=_0x4361f7[_0x88fe('0x3a')][_0x88fe('0x2b')];_0x496936=_0x25eeb3[_0x2988e4];_0x1c94fe=_0x32448f[_0x88fe('0x38')](_0x496936[_0x88fe('0x39')]);}return _0x1c94fe;}function getQueueCampaignStatusMessage(_0x21f98f,_0x24eca0){var _0x3ca2f3=CAMPAIGN_STATUS[_0x88fe('0x3b')];var _0x3e9d84=isPreviewCampaign(_0x21f98f);if(!isQueueCampaignActive(_0x21f98f)){if(_0x3e9d84){_0x3ca2f3=CAMPAIGN_STATUS[_0x88fe('0x3c')];}else{if(_0x21f98f[_0x88fe('0x29')]===0x0&&_0x21f98f[_0x88fe('0x25')]===0x0&&_0x21f98f[_0x88fe('0x27')]===0x0&&(_0x21f98f[_0x88fe('0x26')]||0x0)===0x0){_0x3ca2f3=CAMPAIGN_STATUS[_0x88fe('0x3c')];}else{_0x3ca2f3=CAMPAIGN_STATUS['DISACTIVED'];}}}else if(_0x21f98f[_0x88fe('0x22')]===0x0){_0x3ca2f3=CAMPAIGN_STATUS[_0x88fe('0x3d')];}else if(!checkAnyValidTrunk(_0x21f98f,_0x24eca0)){_0x3ca2f3=CAMPAIGN_STATUS[_0x88fe('0x3e')];}else if(!isPreviewCampaign(_0x21f98f)){var _0x14adba=checkAnyValidQueueCampaignInterval(_0x21f98f);if(_0x14adba){_0x3ca2f3=_0x14adba;}}return _0x3ca2f3;}exports[_0x88fe('0x3f')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x5ab958){var _0x5270d1=CAMPAIGN_STATUS[_0x88fe('0x40')];if(_0x5ab958['originated']===0x0&&_0x5ab958['talking']===0x0&&_0x5ab958[_0x88fe('0x27')]===0x0&&(_0x5ab958[_0x88fe('0x26')]||0x0)===0x0){_0x5270d1=CAMPAIGN_STATUS[_0x88fe('0x3c')];}return _0x5270d1;}exports[_0x88fe('0x41')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x38d302){var _0x4daff3=_0x38d302['match'](/"(.*?)"/);return _0x4daff3?_0x4daff3[0x1]:_0x38d302;}exports['extractCalleridName']=extractCalleridName;function getCallerId(_0x2f0a1d,_0x15cd85,_0x314752){if(!_['isUndefined'](_0x314752)&&typeof _0x314752===_0x88fe('0x42')&&!_[_0x88fe('0x33')](_0x314752)){if(!_[_0x88fe('0x43')](_0x15cd85)&&typeof _0x15cd85===_0x88fe('0x42')&&!_[_0x88fe('0x33')](_0x15cd85)){return util['format'](_0x88fe('0x44'),_0x15cd85,_0x314752);}return util[_0x88fe('0x45')](_0x88fe('0x44'),_0x314752,_0x314752);}if(!_['isUndefined'](_0x2f0a1d)&&typeof _0x2f0a1d===_0x88fe('0x42')&&!_[_0x88fe('0x33')](_0x2f0a1d)){return _0x2f0a1d;}return _0x88fe('0x46');}exports[_0x88fe('0x47')]=getCallerId;function getCallerIdRandom(_0x504c49,_0x5c28ba){var _0x29495b;var _0x351cbf;var _0x161bf4;if(_0x5c28ba<=0x0){_0x5c28ba=0x1;}_0x29495b=new RegExp('\x5cw{0,'+_0x5c28ba+'}$');_0x351cbf=Math['pow'](0xa,_0x5c28ba-0x1);_0x161bf4=Math[_0x88fe('0x48')](0xa,_0x5c28ba)-0x1;return util[_0x88fe('0x45')]('%s',_[_0x88fe('0x49')](_0x504c49,_0x29495b,_[_0x88fe('0x4a')](_0x351cbf,_0x161bf4)['toString']()));}exports[_0x88fe('0x4b')]=getCallerIdRandom;function decrementOriginate(_0x3f8601){if(_0x3f8601[_0x88fe('0x29')]&&_0x3f8601['originated']>0x0){_0x3f8601['originated']-=0x1;}else{logger[_0x88fe('0x4c')](_0x88fe('0x4d'));}}exports[_0x88fe('0x4e')]=decrementOriginate;function checkContactEmpty(_0x2b3623){return _0x2b3623&&_0x2b3623[_0x88fe('0x4f')]>0x0;}exports[_0x88fe('0x50')]=checkContactEmpty;function erlangb(_0x2c8ca1,_0x7895ce){if(_0x7895ce===0x0){return 0x0;}var _0x44355f=0x1;for(var _0x31963c=0x1;_0x31963c<=_0x7895ce;_0x31963c+=0x1){_0x44355f=0x1+_0x44355f*_0x31963c/_0x2c8ca1;}return 0x1/_0x44355f;}exports[_0x88fe('0x51')]=erlangb;function checkContactLowerLimitOriginate(_0x62d2d3,_0x97fb97,_0x190fe4){if(_0x97fb97>_0x190fe4){for(var _0x714854=0x0;_0x714854<_0x97fb97-_0x190fe4;_0x714854+=0x1){decrementOriginate(_0x62d2d3);}}}exports[_0x88fe('0x52')]=checkContactLowerLimitOriginate;function setXMDContactVariables(_0xf83411){var _0x69b5ce={};var _0x15b050=['id',_0x88fe('0x53'),_0x88fe('0x54'),'tags','updatedAt'];if(_0xf83411){for(var _0x385e70 in _0xf83411){if(typeof _0xf83411[_0x385e70]!==_0x88fe('0x55')){if(!_['isNil'](_0xf83411[_0x385e70])&&!_0x15b050['includes'](_0x385e70)){_0x69b5ce[util[_0x88fe('0x45')](_0x88fe('0x56'),_0x88fe('0x57'),_0x385e70['toUpperCase']())]=_0xf83411[_0x385e70];}}}}return _0x69b5ce;}exports[_0x88fe('0x58')]=setXMDContactVariables; \ No newline at end of file +var _0xcee2=['DISACTIVED','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','getQueueCampaignStatusMessage','getQueueCampaignActiveStatusMessage','match','extractCalleridName','isUndefined','string','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','getCallerId','pow','replace','getCallerIdRandom','error','decrementOriginate','length','checkContactEmpty','erlangb','checkContactLowerLimitOriginate','tags','undefined','XMD-','lodash','moment','util','../../../../config/logger','dialer','timezones','ACTIVE','BLACKLIST','RESCHEDULED_CONTACTS','DEACTIVATED','IS_DISACTIVED','INTERVAL_IS_EMPTY','NOT_ACTIVE','AGENTS_NOT_LOGGED','INTERVAL_IS_OVERTIME','RECALLINQUEUE','RECALLFAILEDTIMEOUT','RUNNING','TIMEZONE_UNKNOW','TRUNK_IS_NOT_REACHABLE','dialMethod','preview','type','ivr','isIVRCampaign','isOutboundQueue','dialActive','isQueueCampaignActive','active','isIVRCampaignActive','milliseconds','diff','seconds','getSeconds','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','dialTimezone','isNil','dialGlobalInterval','Interval','Intervals','NULL_INTERVAL','isEmpty','UNKNOWN_TIMEZONE','SIP/','reachable','includes','status','TrunkBackup','INACTIVE'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xcee2,0x6e));var _0x2cee=function(_0x23fe23,_0x3fdc1d){_0x23fe23=_0x23fe23-0x0;var _0x5ec7a6=_0xcee2[_0x23fe23];return _0x5ec7a6;};'use strict';var _=require(_0x2cee('0x0'));var moment=require(_0x2cee('0x1'));var util=require(_0x2cee('0x2'));var logger=require(_0x2cee('0x3'))(_0x2cee('0x4'));var timezones=require('../../../../config/environment/shared')[_0x2cee('0x5')];var CAMPAIGN_STATUS={'ACTIVE':_0x2cee('0x6'),'BLACKLIST':_0x2cee('0x7'),'CONTACTS_RESCHEDULED':_0x2cee('0x8'),'DEACTIVATED':_0x2cee('0x9'),'DISACTIVED':_0x2cee('0xa'),'EMPTY_INTERVAL':_0x2cee('0xb'),'INACTIVE':_0x2cee('0xc'),'NO_AGENTS_LOGGED':_0x2cee('0xd'),'NO_AVAILABLE_CONTACTS':'AVAILABLE_CONTACTS_FINISHED','NULL_INTERVAL':'INTERVAL_IS_NULL','OVERTIME_INTERVAL':_0x2cee('0xe'),'OVERTIME_GLOBAL_INTERVAL':'GLOBAL_INTERVAL_IS_OVERTIME','QUEUE_RECALL':_0x2cee('0xf'),'RECALL_TIMEOUT':_0x2cee('0x10'),'RUNNING':_0x2cee('0x11'),'UNKNOWN_TIMEZONE':_0x2cee('0x12'),'UNREACHABLE_TRUNK':_0x2cee('0x13')};exports['CAMPAIGN_STATUS']=CAMPAIGN_STATUS;function isPreviewCampaign(_0x4a0b52){return _0x4a0b52[_0x2cee('0x14')]===_0x2cee('0x15');}exports['isPreviewCampaign']=isPreviewCampaign;function isIVRCampaign(_0x2a1f1e){return _0x2a1f1e[_0x2cee('0x16')]===_0x2cee('0x17');}exports[_0x2cee('0x18')]=isIVRCampaign;function isOutboundQueue(_0x2b7849){return _0x2b7849['type']==='outbound';}exports[_0x2cee('0x19')]=isOutboundQueue;function isQueueCampaignActive(_0x26a6f9){return _0x26a6f9[_0x2cee('0x1a')];}exports[_0x2cee('0x1b')]=isQueueCampaignActive;function isIVRCampaignActive(_0xbaddb7){return _0xbaddb7[_0x2cee('0x1c')];}exports[_0x2cee('0x1d')]=isIVRCampaignActive;function getSeconds(_0x27be5e,_0x17b521){var _0x2fcd05=moment(_0x27be5e)[_0x2cee('0x1e')](0x0);var _0x5c47de=moment(_0x17b521)[_0x2cee('0x1e')](0x0);return _0x2fcd05[_0x2cee('0x1f')](_0x5c47de,_0x2cee('0x20'));}exports[_0x2cee('0x21')]=getSeconds;function hasQueueCampaignDataChanged(_0x1f7959,_0x2d7a16){var _0x190e3e=![];var _0x28d68a=_0x1f7959[_0x2cee('0x14')]!==_0x2d7a16['dialMethod']||_0x1f7959[_0x2cee('0x1a')]!==_0x2d7a16['dialActive']||_0x1f7959[_0x2cee('0x22')]!==_0x2d7a16[_0x2cee('0x22')];var _0x1338d6=_0x1f7959[_0x2cee('0x23')]!==_0x2d7a16[_0x2cee('0x23')]||_0x1f7959['loggedIn']!==_0x2d7a16[_0x2cee('0x24')]||_0x1f7959[_0x2cee('0x25')]!==_0x2d7a16[_0x2cee('0x25')]||_0x1f7959['paused']!==_0x2d7a16[_0x2cee('0x26')]||_0x1f7959[_0x2cee('0x27')]!==_0x2d7a16['talking']||_0x1f7959[_0x2cee('0x28')]!==_0x2d7a16[_0x2cee('0x28')]||_0x1f7959[_0x2cee('0x29')]!==_0x2d7a16['waiting']||_0x1f7959[_0x2cee('0x2a')]!==_0x2d7a16['inUse']||_0x1f7959[_0x2cee('0x2b')]!==_0x2d7a16[_0x2cee('0x2b')];if(_0x1f7959[_0x2cee('0x2c')]&&_0x2d7a16['Trunk']){_0x190e3e=_0x1f7959[_0x2cee('0x2c')][_0x2cee('0x2d')]!==_0x2d7a16[_0x2cee('0x2c')][_0x2cee('0x2d')]||_0x1f7959[_0x2cee('0x2c')][_0x2cee('0x1c')]!==_0x2d7a16['Trunk'][_0x2cee('0x1c')];}return _0x28d68a||_0x1338d6||_0x190e3e;}exports['hasQueueCampaignDataChanged']=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x20404d){var _0x378f63=null;var _0xb38888=_0x20404d[_0x2cee('0x2e')];if(_[_0x2cee('0x2f')](_0x20404d[_0x2cee('0x30')])||_[_0x2cee('0x2f')](_0x20404d[_0x2cee('0x31')])||_[_0x2cee('0x2f')](_0x20404d['Interval'][_0x2cee('0x32')])){_0x378f63=CAMPAIGN_STATUS[_0x2cee('0x33')];}else if(_[_0x2cee('0x34')](_0x20404d[_0x2cee('0x30')])||_['isEmpty'](_0x20404d[_0x2cee('0x31')][_0x2cee('0x32')])){_0x378f63=CAMPAIGN_STATUS['EMPTY_INTERVAL'];}else if(_0xb38888&&!timezones[_0xb38888]){_0x378f63=CAMPAIGN_STATUS[_0x2cee('0x35')];}return _0x378f63;}function checkAnyValidTrunk(_0x229332,_0x120e03){var _0x5aed86=null;var _0x75a6f4=_0x2cee('0x36');var _0x1f9698=[_0x2cee('0x37'),'unmonitored'];var _0x523eec=!![];if(_0x229332['Trunk']&&_0x229332[_0x2cee('0x2c')][_0x2cee('0x1c')]){_0x75a6f4+=_0x229332[_0x2cee('0x2c')][_0x2cee('0x2d')];_0x5aed86=_0x120e03[_0x75a6f4];_0x523eec=_0x1f9698[_0x2cee('0x38')](_0x5aed86[_0x2cee('0x39')]);}else if(_0x229332[_0x2cee('0x3a')]&&_0x229332[_0x2cee('0x3a')][_0x2cee('0x1c')]){_0x75a6f4+=_0x229332[_0x2cee('0x3a')][_0x2cee('0x2d')];_0x5aed86=_0x120e03[_0x75a6f4];_0x523eec=_0x1f9698[_0x2cee('0x38')](_0x5aed86['status']);}return _0x523eec;}function getQueueCampaignStatusMessage(_0x496b1a,_0x457b54){var _0x551682=CAMPAIGN_STATUS[_0x2cee('0x6')];var _0x2d1f1b=isPreviewCampaign(_0x496b1a);if(!isQueueCampaignActive(_0x496b1a)){if(_0x2d1f1b){_0x551682=CAMPAIGN_STATUS[_0x2cee('0x3b')];}else{if(_0x496b1a[_0x2cee('0x2b')]===0x0&&_0x496b1a[_0x2cee('0x27')]===0x0&&_0x496b1a[_0x2cee('0x29')]===0x0&&(_0x496b1a[_0x2cee('0x28')]||0x0)===0x0){_0x551682=CAMPAIGN_STATUS[_0x2cee('0x3b')];}else{_0x551682=CAMPAIGN_STATUS[_0x2cee('0x3c')];}}}else if(_0x496b1a[_0x2cee('0x24')]===0x0){_0x551682=CAMPAIGN_STATUS[_0x2cee('0x3d')];}else if(!checkAnyValidTrunk(_0x496b1a,_0x457b54)){_0x551682=CAMPAIGN_STATUS[_0x2cee('0x3e')];}else if(!isPreviewCampaign(_0x496b1a)){var _0x28ad3b=checkAnyValidQueueCampaignInterval(_0x496b1a);if(_0x28ad3b){_0x551682=_0x28ad3b;}}return _0x551682;}exports[_0x2cee('0x3f')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x25fc5d){var _0xd707e1=CAMPAIGN_STATUS['DISACTIVED'];if(_0x25fc5d[_0x2cee('0x2b')]===0x0&&_0x25fc5d['talking']===0x0&&_0x25fc5d[_0x2cee('0x29')]===0x0&&(_0x25fc5d[_0x2cee('0x28')]||0x0)===0x0){_0xd707e1=CAMPAIGN_STATUS[_0x2cee('0x3b')];}return _0xd707e1;}exports[_0x2cee('0x40')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x5484a2){var _0x521023=_0x5484a2[_0x2cee('0x41')](/"(.*?)"/);return _0x521023?_0x521023[0x1]:_0x5484a2;}exports[_0x2cee('0x42')]=extractCalleridName;function getCallerId(_0x61d471,_0x278342,_0x8347f8){if(!_[_0x2cee('0x43')](_0x8347f8)&&typeof _0x8347f8===_0x2cee('0x44')&&!_[_0x2cee('0x34')](_0x8347f8)){if(!_[_0x2cee('0x43')](_0x278342)&&typeof _0x278342===_0x2cee('0x44')&&!_[_0x2cee('0x34')](_0x278342)){return util[_0x2cee('0x45')](_0x2cee('0x46'),_0x278342,_0x8347f8);}return util['format'](_0x2cee('0x46'),_0x8347f8,_0x8347f8);}if(!_[_0x2cee('0x43')](_0x61d471)&&typeof _0x61d471===_0x2cee('0x44')&&!_[_0x2cee('0x34')](_0x61d471)){return _0x61d471;}return _0x2cee('0x47');}exports[_0x2cee('0x48')]=getCallerId;function getCallerIdRandom(_0x2185b1,_0x174efd){var _0x21f7e5;var _0x462b7b;var _0x1dccdd;if(_0x174efd<=0x0){_0x174efd=0x1;}_0x21f7e5=new RegExp('\x5cw{0,'+_0x174efd+'}$');_0x462b7b=Math[_0x2cee('0x49')](0xa,_0x174efd-0x1);_0x1dccdd=Math[_0x2cee('0x49')](0xa,_0x174efd)-0x1;return util[_0x2cee('0x45')]('%s',_[_0x2cee('0x4a')](_0x2185b1,_0x21f7e5,_['random'](_0x462b7b,_0x1dccdd)['toString']()));}exports[_0x2cee('0x4b')]=getCallerIdRandom;function decrementOriginate(_0xfc8d45){if(_0xfc8d45['originated']&&_0xfc8d45[_0x2cee('0x2b')]>0x0){_0xfc8d45[_0x2cee('0x2b')]-=0x1;}else{logger[_0x2cee('0x4c')]('[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative');}}exports[_0x2cee('0x4d')]=decrementOriginate;function checkContactEmpty(_0x3acda7){return _0x3acda7&&_0x3acda7[_0x2cee('0x4e')]>0x0;}exports[_0x2cee('0x4f')]=checkContactEmpty;function erlangb(_0xa988d1,_0x4599c4){if(_0x4599c4===0x0){return 0x0;}var _0x10592c=0x1;for(var _0x38f398=0x1;_0x38f398<=_0x4599c4;_0x38f398+=0x1){_0x10592c=0x1+_0x10592c*_0x38f398/_0xa988d1;}return 0x1/_0x10592c;}exports[_0x2cee('0x50')]=erlangb;function checkContactLowerLimitOriginate(_0x2fab85,_0x1b1b6a,_0x1d4f01){if(_0x1b1b6a>_0x1d4f01){for(var _0x2e532e=0x0;_0x2e532e<_0x1b1b6a-_0x1d4f01;_0x2e532e+=0x1){decrementOriginate(_0x2fab85);}}}exports[_0x2cee('0x51')]=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x2e107b){var _0x1c3a53={};var _0x2dbdbc=['id','createdAt','description',_0x2cee('0x52'),'updatedAt'];if(_0x2e107b){for(var _0x377472 in _0x2e107b){if(typeof _0x2e107b[_0x377472]!==_0x2cee('0x53')){if(!_[_0x2cee('0x2f')](_0x2e107b[_0x377472])&&!_0x2dbdbc[_0x2cee('0x38')](_0x377472)){_0x1c3a53[util[_0x2cee('0x45')]('%s%s',_0x2cee('0x54'),_0x377472['toUpperCase']())]=_0x2e107b[_0x377472];}}}}return _0x1c3a53;}exports['setXMDContactVariables']=setXMDContactVariables; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index c4414b5..c0676fc 100644 --- a/server/services/ami/fax/action.js +++ b/server/services/ami/fax/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['fax','localstationid','path','AttachmentId','exports','util','lodash','moment','channel','format','%s/%s/%s','tech','Trunk'];(function(_0x3515ef,_0x492932){var _0x213cd5=function(_0x11d1e6){while(--_0x11d1e6){_0x3515ef['push'](_0x3515ef['shift']());}};_0x213cd5(++_0x492932);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function Action(_0x5dd881,_0x550fbc,_0x18d5c9){this['uniqueid']=_0x5dd881||undefined;this[_0x0a9e('0x3')]=util[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x550fbc[_0x0a9e('0x6')],_0x550fbc[_0x0a9e('0x7')]['name'],_0x18d5c9[_0x0a9e('0x8')]);this[_0x0a9e('0x9')]=_0x550fbc[_0x0a9e('0x9')];this['headerinfo']=_0x550fbc['headerinfo'];this[_0x0a9e('0xa')]=_0x18d5c9['path'];this['AttachmentId']=_0x18d5c9[_0x0a9e('0xb')];}module[_0x0a9e('0xc')]=Action; \ No newline at end of file +var _0xa9e0=['fax','localstationid','path','AttachmentId','exports','util','lodash','moment','channel','format','%s/%s/%s','tech','Trunk'];(function(_0x3c84c2,_0x43519a){var _0x3ffb36=function(_0x3bce1c){while(--_0x3bce1c){_0x3c84c2['push'](_0x3c84c2['shift']());}};_0x3ffb36(++_0x43519a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function Action(_0x5dd881,_0x550fbc,_0x18d5c9){this['uniqueid']=_0x5dd881||undefined;this[_0x0a9e('0x3')]=util[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x550fbc[_0x0a9e('0x6')],_0x550fbc[_0x0a9e('0x7')]['name'],_0x18d5c9[_0x0a9e('0x8')]);this[_0x0a9e('0x9')]=_0x550fbc[_0x0a9e('0x9')];this['headerinfo']=_0x550fbc['headerinfo'];this[_0x0a9e('0xa')]=_0x18d5c9['path'];this['AttachmentId']=_0x18d5c9[_0x0a9e('0xb')];}module[_0x0a9e('0xc')]=Action; \ No newline at end of file diff --git a/server/services/ami/fax/index.js b/server/services/ami/fax/index.js index 13d5462..af089d8 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 _0xa46a=['Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','Convert\x20pdf\x20to\x20tif','Action','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','Is\x20Valid','exports','util','lodash','bluebird','uuid','moment','path','tiff2pdf','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','bind','varset','syncVarSet','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','syncReceiveFax','syncHangup','originateresponse','syncOriginateResponse','prototype','syncNewchannel','context','from-voip-provider','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','hasOwnProperty','channelstate','channelstatedesc','value','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','then','notify','catch','\x20notify\x20','stringify','error','\x20receiveFax\x20','merge','pick','response','reason','update','AttachmentId','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]'];(function(_0x482f3b,_0x2e1752){var _0x283310=function(_0x1c073f){while(--_0x1c073f){_0x482f3b['push'](_0x482f3b['shift']());}};_0x283310(++_0x2e1752);}(_0xa46a,0x113));var _0xaa46=function(_0x498c78,_0x2eab48){_0x498c78=_0x498c78-0x0;var _0xb7697f=_0xa46a[_0x498c78];return _0xb7697f;};'use strict';var util=require(_0xaa46('0x0'));var _=require(_0xaa46('0x1'));var BPromise=require(_0xaa46('0x2'));var uuid=require(_0xaa46('0x3'));var moment=require(_0xaa46('0x4'));var path=require(_0xaa46('0x5'));var tiff2pdf=require(_0xaa46('0x6'));var gs=require('./util/gs');var logger=require(_0xaa46('0x7'))(_0xaa46('0x8'));var ami=require(_0xaa46('0x9'));var rpcDb=require(_0xaa46('0xa'));var Channel=require(_0xaa46('0xb'));var ut=require(_0xaa46('0xc'));var Action=require(_0xaa46('0xd'));var faxAccount=require('../rpc/faxAccount');var attachment=require(_0xaa46('0xe'));var faxMessage=require(_0xaa46('0xf'));function Fax(_0x95d0a3){this[_0xaa46('0x10')]={};this[_0xaa46('0x11')]=_0x95d0a3['faxAccounts'];this['trunks']=_0x95d0a3[_0xaa46('0x12')];this[_0xaa46('0x13')]={};ami['on'](_0xaa46('0x14'),this['syncNewchannel'][_0xaa46('0x15')](this));ami['on'](_0xaa46('0x16'),this[_0xaa46('0x17')][_0xaa46('0x15')](this));ami['on'](_0xaa46('0x18'),this[_0xaa46('0x19')][_0xaa46('0x15')](this));ami['on'](_0xaa46('0x1a'),this[_0xaa46('0x1b')][_0xaa46('0x15')](this));ami['on'](_0xaa46('0x1c'),this[_0xaa46('0x1d')]['bind'](this));ami['on']('receivefax',this[_0xaa46('0x1e')][_0xaa46('0x15')](this));ami['on']('hangup',this[_0xaa46('0x1f')][_0xaa46('0x15')](this));ami['on'](_0xaa46('0x20'),this[_0xaa46('0x21')]['bind'](this));}Fax[_0xaa46('0x22')][_0xaa46('0x23')]=function(_0x10c82f){if(_0x10c82f[_0xaa46('0x24')]===_0xaa46('0x25')){for(var _0x35af5b in this[_0xaa46('0x11')]){if(this[_0xaa46('0x11')]['hasOwnProperty'](_0x35af5b)){if(_0x10c82f[_0xaa46('0x26')]===this['faxAccounts'][_0x35af5b][_0xaa46('0x27')]){this['channels'][_0x10c82f['uniqueid']]={};this[_0xaa46('0x10')][_0x10c82f[_0xaa46('0x28')]][_0xaa46('0x29')]=_0x10c82f[_0xaa46('0x29')];this[_0xaa46('0x10')][_0x10c82f[_0xaa46('0x28')]]['id']=this[_0xaa46('0x11')][_0x35af5b]['id'];this['channels'][_0x10c82f[_0xaa46('0x28')]]['name']=this[_0xaa46('0x11')][_0x35af5b][_0xaa46('0x2a')];logger[_0xaa46('0x2b')](_0x10c82f[_0xaa46('0x28')],_0xaa46('0x2c'));}}}}if(this[_0xaa46('0x13')][_0x10c82f[_0xaa46('0x28')]]){this[_0xaa46('0x10')][_0x10c82f[_0xaa46('0x28')]]={};this[_0xaa46('0x10')][_0x10c82f[_0xaa46('0x28')]][_0xaa46('0x29')]=_0x10c82f['channel'];logger['info'](_0x10c82f[_0xaa46('0x28')],_0xaa46('0x2c'));}};Fax[_0xaa46('0x22')][_0xaa46('0x17')]=function(_0x12d75b){if(this[_0xaa46('0x10')][_0x12d75b[_0xaa46('0x28')]]){for(var _0x145452 in _0x12d75b[_0xaa46('0x2d')]){if(_0x12d75b[_0xaa46('0x2d')][_0xaa46('0x2e')](_0x145452)){this[_0xaa46('0x10')][_0x12d75b[_0xaa46('0x28')]][_0x145452]=_0x12d75b['value'];}}}};Fax['prototype'][_0xaa46('0x19')]=function(_0x3a742b){if(this[_0xaa46('0x10')][_0x3a742b[_0xaa46('0x28')]]){this['channels'][_0x3a742b['uniqueid']][_0xaa46('0x2f')]=_0x3a742b[_0xaa46('0x2f')];this['channels'][_0x3a742b[_0xaa46('0x28')]][_0xaa46('0x30')]=_0x3a742b['channelstatedesc'];}};Fax[_0xaa46('0x22')][_0xaa46('0x1b')]=function(_0x217a69){if(this[_0xaa46('0x10')][_0x217a69[_0xaa46('0x28')]]){for(var _0x1d07fd in _0x217a69[_0xaa46('0x2d')]){if(_0x217a69[_0xaa46('0x2d')][_0xaa46('0x2e')](_0x1d07fd)){this[_0xaa46('0x10')][_0x217a69[_0xaa46('0x28')]][_0x1d07fd]=_0x217a69[_0xaa46('0x31')];}}}};Fax[_0xaa46('0x22')][_0xaa46('0x1d')]=function(_0x401d2d){if(this['channels'][_0x401d2d[_0xaa46('0x28')]]){this[_0xaa46('0x10')][_0x401d2d['uniqueid']]['operation']=_0x401d2d[_0xaa46('0x32')];this[_0xaa46('0x10')][_0x401d2d['uniqueid']][_0xaa46('0x33')]=_0x401d2d['status'];this[_0xaa46('0x10')][_0x401d2d[_0xaa46('0x28')]][_0xaa46('0x27')]=_0x401d2d[_0xaa46('0x27')];this[_0xaa46('0x10')][_0x401d2d[_0xaa46('0x28')]][_0xaa46('0x34')]=_0x401d2d[_0xaa46('0x34')];logger[_0xaa46('0x2b')](_0x401d2d[_0xaa46('0x28')],_0xaa46('0x35'));}};Fax[_0xaa46('0x22')][_0xaa46('0x1e')]=function(_0x26126d){var _0x6e60b3=this;if(this[_0xaa46('0x10')][_0x26126d[_0xaa46('0x28')]]){var _0x22d321=this['channels'][_0x26126d[_0xaa46('0x28')]]['id'];this[_0xaa46('0x10')][_0x26126d['uniqueid']][_0xaa46('0x36')]=_0x26126d['remotestationid'];this[_0xaa46('0x10')][_0x26126d[_0xaa46('0x28')]]['pagestransferred']=_0x26126d[_0xaa46('0x37')];this[_0xaa46('0x10')][_0x26126d[_0xaa46('0x28')]][_0xaa46('0x27')]=_0x26126d['localstationid'];this[_0xaa46('0x10')][_0x26126d[_0xaa46('0x28')]]['resolution']=_0x26126d[_0xaa46('0x38')];this['channels'][_0x26126d['uniqueid']][_0xaa46('0x39')]=_0x26126d[_0xaa46('0x39')];this['channels'][_0x26126d[_0xaa46('0x28')]][_0xaa46('0x34')]=_0x26126d[_0xaa46('0x34')];this[_0xaa46('0x10')][_0x26126d[_0xaa46('0x28')]][_0xaa46('0x3a')]=_0x26126d[_0xaa46('0x3a')];if(this[_0xaa46('0x10')][_0x26126d[_0xaa46('0x28')]]['pagestransferred']>0x0){tiff2pdf(_0x26126d[_0xaa46('0x34')],'/var/opt/motion2/server/files/attachments/',function(_0x5d06bb){logger['info'](_0x26126d['uniqueid'],_0xaa46('0x3b'),_0x5d06bb[_0xaa46('0x3c')]);attachment[_0xaa46('0x3d')]({'name':path[_0xaa46('0x3e')](_0x26126d['filename'])[_0xaa46('0x2a')],'basename':path[_0xaa46('0x3e')](_0x26126d['filename'])['name']+_0xaa46('0x3f'),'type':_0xaa46('0x40')})[_0xaa46('0x41')](function(_0x3bca5d){faxAccount[_0xaa46('0x42')](_0x22d321,{'from':_0x26126d[_0xaa46('0x3a')],'mapKey':_0xaa46('0x8'),'body':path[_0xaa46('0x3e')](_0x26126d['filename'])[_0xaa46('0x2a')]+'.pdf','AttachmentId':_0x3bca5d['id']})[_0xaa46('0x43')](function(_0x49ba3c){logger['error'](_0x26126d[_0xaa46('0x28')],_0xaa46('0x44'),JSON[_0xaa46('0x45')](_0x49ba3c));});})[_0xaa46('0x43')](function(_0x3eaaba){logger[_0xaa46('0x46')](_0x26126d['uniqueid'],_0xaa46('0x47'),JSON[_0xaa46('0x45')](_0x3eaaba));});});}logger['info'](_0x26126d[_0xaa46('0x28')],_0xaa46('0x47'));}};Fax[_0xaa46('0x22')][_0xaa46('0x21')]=function(_0xbac6a0){if(this['actions'][_0xbac6a0['uniqueid']]){_[_0xaa46('0x48')](this['channels'][_0xbac6a0[_0xaa46('0x28')]],_[_0xaa46('0x49')](_0xbac6a0,[_0xaa46('0x4a'),_0xaa46('0x4b')]));}};function updateStatus(_0xa9e0b6){if(_0xa9e0b6['AttachmentId']){faxMessage[_0xaa46('0x4c')](_0xa9e0b6[_0xaa46('0x4d')],{'failMessage':'SENDING\x20FAILED\x20'})[_0xaa46('0x41')](function(_0x22cc7e){ut[_0xaa46('0x4e')](_0xaa46('0x4f'),_0x22cc7e);})['catch'](function(_0x19febf){ut['logger'](_0xaa46('0x50'),_0x19febf);});}else{ut[_0xaa46('0x4e')](_0xaa46('0x51'));}}Fax[_0xaa46('0x22')][_0xaa46('0x52')]=function(_0x2ebd41,_0x2fdbe7,_0x314373){var _0x245d31=this;var _0xc63199={};if(_0x2fdbe7){_0xc63199={'read':_0x2fdbe7};}else{_0xc63199={'failMessage':_0x314373};}if(this[_0xaa46('0x13')][_0x2ebd41][_0xaa46('0x4d')]){faxMessage[_0xaa46('0x4c')](this['actions'][_0x2ebd41]['AttachmentId'],_0xc63199)[_0xaa46('0x41')](function(_0x3e2c1d){ut[_0xaa46('0x4e')](_0xaa46('0x53'),_0x3e2c1d);})[_0xaa46('0x43')](function(_0x1aee70){ut[_0xaa46('0x4e')](_0xaa46('0x54'),_0x1aee70);})[_0xaa46('0x55')](function(){delete _0x245d31[_0xaa46('0x10')][_0x2ebd41];delete _0x245d31['actions'][_0x2ebd41];});}else{ut['logger'](_0xaa46('0x56'));delete this[_0xaa46('0x10')][_0x2ebd41];delete this[_0xaa46('0x13')][_0x2ebd41];}};Fax[_0xaa46('0x22')][_0xaa46('0x1f')]=function(_0x4b2efb){var _0x412201=this;if(this[_0xaa46('0x10')][_0x4b2efb[_0xaa46('0x28')]]){if(this[_0xaa46('0x13')][_0x4b2efb[_0xaa46('0x28')]]){this[_0xaa46('0x10')][_0x4b2efb['uniqueid']]['id']=this[_0xaa46('0x13')][_0x4b2efb[_0xaa46('0x28')]]['id'];this['channels'][_0x4b2efb['uniqueid']]['name']=this[_0xaa46('0x13')][_0x4b2efb['uniqueid']][_0xaa46('0x2a')];}logger[_0xaa46('0x2b')](_0x4b2efb[_0xaa46('0x28')],this[_0xaa46('0x13')][_0x4b2efb['uniqueid']]?_0xaa46('0x57'):_0xaa46('0x58'),JSON['stringify'](this['channels'][_0x4b2efb[_0xaa46('0x28')]]));if(this[_0xaa46('0x13')][_0x4b2efb['uniqueid']]){if(this[_0xaa46('0x10')][_0x4b2efb[_0xaa46('0x28')]][_0xaa46('0x59')]>0x0&&this[_0xaa46('0x10')][_0x4b2efb[_0xaa46('0x28')]][_0xaa46('0x1c')]===_0xaa46('0x5a')){this['updateStatus'](_0x4b2efb[_0xaa46('0x28')],!![]);}else{this['updateStatus'](_0x4b2efb[_0xaa46('0x28')],![],this['channels'][_0x4b2efb[_0xaa46('0x28')]][_0xaa46('0x5b')]?'SENDING\x20FAILED:\x20'+this[_0xaa46('0x10')][_0x4b2efb['uniqueid']][_0xaa46('0x5b')]:_0xaa46('0x5c'));}}}};Fax[_0xaa46('0x22')][_0xaa46('0x5d')]=function(_0x33819e){var _0x25abc8=this;return new BPromise(function(_0x3b8217,_0xb50036){_0x25abc8[_0xaa46('0x5e')](_0x33819e,_0x25abc8[_0xaa46('0x11')][_0x33819e[_0xaa46('0x5f')]])[_0xaa46('0x41')](function(_0x12c3f5){ut[_0xaa46('0x4e')](_0xaa46('0x60'),_0x12c3f5);_0x3b8217(ut[_0xaa46('0x3c')](_0xaa46('0x61')));})[_0xaa46('0x43')](function(_0x4ea003){ut['logger'](_0xaa46('0x62'),_0x4ea003);updateStatus(_0x33819e);_0xb50036(ut[_0xaa46('0x3c')](_0xaa46('0x63')));});});};Fax['prototype'][_0xaa46('0x64')]=function(_0x62805c){var _0x29b91=this;return new BPromise(function(_0x1284c5,_0x45e6e1){var _0x4acc30=_0x29b91[_0xaa46('0x65')](_0x29b91[_0xaa46('0x11')][_0x62805c[_0xaa46('0x5f')]][_0xaa46('0x66')],_0x62805c);if(_0x4acc30[_0xaa46('0x67')]){_0x1284c5(ut['message'](_0xaa46('0x68')));}else{_0x45e6e1(ut[_0xaa46('0x3c')](_0x4acc30[_0xaa46('0x3c')]));}});};function originate(_0x114c0b,_0x4551b9,_0x34735){return new BPromise(function(_0x336ca1,_0xa5f092){if(_0x34735){var _0x3d696f=util[_0xaa46('0x69')](_0xaa46('0x6a'),path['parse'](_0x114c0b[_0xaa46('0x5')])['name'],_0x114c0b[_0xaa46('0x5')]);gs[_0xaa46('0x6b')](_0x3d696f)[_0xaa46('0x41')](function(){_0x114c0b['path']=util['format'](_0xaa46('0x6c'),path['parse'](_0x114c0b[_0xaa46('0x5')])[_0xaa46('0x6d')],path['parse'](_0x114c0b[_0xaa46('0x5')])[_0xaa46('0x2a')]);_0x4551b9['XMF-PATH']=_0x114c0b[_0xaa46('0x5')];ut[_0xaa46('0x4e')](_0xaa46('0x6e'),'');ami[_0xaa46('0x6f')](ut['variablesAction'](_0x114c0b,_0x4551b9))[_0xaa46('0x41')](function(_0x3ed371){_0x336ca1(_0x3ed371);})[_0xaa46('0x43')](function(_0x593193){_0xa5f092(_0x593193);});})[_0xaa46('0x43')](function(_0x3dd6dd){_0xa5f092(_0x3dd6dd);});}else{ami[_0xaa46('0x6f')](ut['variablesAction'](_0x114c0b,_0x4551b9))['then'](function(_0x3686c1){_0x336ca1(_0x3686c1);})[_0xaa46('0x43')](function(_0xcffb10){_0xa5f092(_0xcffb10);});}});}Fax[_0xaa46('0x22')][_0xaa46('0x5e')]=function(_0x49d7c2,_0x475eda){var _0x245b98=this;return new BPromise(function(_0x448998,_0x513ca8){var _0xad92cc=uuid['v4']();var _0x35fffc=ut[_0xaa46('0x70')](_0x49d7c2,_0x475eda);_0x245b98[_0xaa46('0x13')][_0xad92cc]=new Action(_0xad92cc,_0x475eda,_0x49d7c2);var _0x5a715f=_0x245b98[_0xaa46('0x13')][_0xad92cc];if(path[_0xaa46('0x3e')](_0x49d7c2[_0xaa46('0x5')])[_0xaa46('0x71')]==='.pdf'){originate(_0x5a715f,_0x35fffc,!![])[_0xaa46('0x41')](function(_0x2cb716){_0x448998(_0x2cb716);})[_0xaa46('0x43')](function(_0x481d52){_0x513ca8(_0x481d52);});}else{originate(_0x5a715f,_0x35fffc,![])[_0xaa46('0x41')](function(_0x1d04d4){_0x448998(_0x1d04d4);})[_0xaa46('0x43')](function(_0x47ec08){_0x513ca8(_0x47ec08);});}});};Fax[_0xaa46('0x22')][_0xaa46('0x72')]=function(_0x32daec){return!_[_0xaa46('0x73')](_0x32daec)&&!_['isNil'](_0x32daec[_0xaa46('0x2a')])&&!_['isNil'](_0x32daec[_0xaa46('0x74')])&&_0x32daec[_0xaa46('0x74')]&&!_[_0xaa46('0x73')](this['trunks'][util[_0xaa46('0x69')](_0xaa46('0x75'),_0x32daec[_0xaa46('0x2a')])])&&!_[_0xaa46('0x73')](this[_0xaa46('0x12')][util[_0xaa46('0x69')](_0xaa46('0x75'),_0x32daec[_0xaa46('0x2a')])][_0xaa46('0x33')])&&(this['trunks'][util[_0xaa46('0x69')](_0xaa46('0x75'),_0x32daec[_0xaa46('0x2a')])][_0xaa46('0x33')]===_0xaa46('0x76')||this['trunks'][util[_0xaa46('0x69')](_0xaa46('0x75'),_0x32daec[_0xaa46('0x2a')])][_0xaa46('0x33')]==='unmonitored');};Fax[_0xaa46('0x22')][_0xaa46('0x65')]=function(_0x4d5d3f,_0x12f073){if(!this['isTrunkReachable'](_0x4d5d3f)){ut[_0xaa46('0x4e')](_0xaa46('0x77'),_[_0xaa46('0x73')](_0x4d5d3f)?'':_0x4d5d3f[_0xaa46('0x2a')]+_0xaa46('0x78'));return{'isValid':![],'message':_0xaa46('0x79')};}if(_[_0xaa46('0x73')](_0x12f073[_0xaa46('0x8')])){ut[_0xaa46('0x4e')]('[Fax][checkTrunk][Empty\x20Fax]',JSON[_0xaa46('0x45')](_0x12f073));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0xaa46('0x73')](_0x12f073[_0xaa46('0x5')])){ut[_0xaa46('0x4e')]('[Fax][checkTrunk][Empty\x20path]',JSON[_0xaa46('0x45')](_0x12f073));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0xaa46('0x7a')};};module[_0xaa46('0x7b')]=Fax; \ No newline at end of file +var _0x9306=['exports','util','lodash','uuid','moment','path','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','syncVarSet','syncNewState','newexten','syncNewExten','faxstatus','receivefax','syncReceiveFax','hangup','syncHangup','syncOriginateResponse','prototype','context','exten','uniqueid','channel','name','\x20syncNewchannel\x20','variable','hasOwnProperty','channelstate','channelstatedesc','syncFaxStatus','operation','status','localstationid','filename','info','\x20syncFaxStatus\x20','remotestationid','resolution','transferrate','calleridnum','pagestransferred','/var/opt/motion2/server/files/attachments/','message','create','parse','.pdf','application/pdf','then','notify','catch','\x20notify\x20','stringify','\x20receiveFax\x20','merge','pick','response','AttachmentId','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','update','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','execOriginate','FaxAccountId','[Fax][execOriginate][success]','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','Trunk\x20Reachable','format','execute','%s/%s.tif','dir','XMF-PATH','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','Trunk\x20not\x20working\x20correctly','Empty\x20Fax','Empty\x20path','Is\x20Valid'];(function(_0x4562d8,_0x2b575f){var _0x32fdba=function(_0x438946){while(--_0x438946){_0x4562d8['push'](_0x4562d8['shift']());}};_0x32fdba(++_0x2b575f);}(_0x9306,0xf1));var _0x6930=function(_0x4d4fbe,_0x55c8a5){_0x4d4fbe=_0x4d4fbe-0x0;var _0x39f5b0=_0x9306[_0x4d4fbe];return _0x39f5b0;};'use strict';var util=require(_0x6930('0x0'));var _=require(_0x6930('0x1'));var BPromise=require('bluebird');var uuid=require(_0x6930('0x2'));var moment=require(_0x6930('0x3'));var path=require(_0x6930('0x4'));var tiff2pdf=require(_0x6930('0x5'));var gs=require(_0x6930('0x6'));var logger=require(_0x6930('0x7'))(_0x6930('0x8'));var ami=require(_0x6930('0x9'));var rpcDb=require(_0x6930('0xa'));var Channel=require(_0x6930('0xb'));var ut=require(_0x6930('0xc'));var Action=require(_0x6930('0xd'));var faxAccount=require('../rpc/faxAccount');var attachment=require(_0x6930('0xe'));var faxMessage=require(_0x6930('0xf'));function Fax(_0x108fbc){this[_0x6930('0x10')]={};this[_0x6930('0x11')]=_0x108fbc[_0x6930('0x11')];this[_0x6930('0x12')]=_0x108fbc[_0x6930('0x12')];this[_0x6930('0x13')]={};ami['on'](_0x6930('0x14'),this[_0x6930('0x15')][_0x6930('0x16')](this));ami['on'](_0x6930('0x17'),this[_0x6930('0x18')][_0x6930('0x16')](this));ami['on']('newstate',this[_0x6930('0x19')][_0x6930('0x16')](this));ami['on'](_0x6930('0x1a'),this[_0x6930('0x1b')]['bind'](this));ami['on'](_0x6930('0x1c'),this['syncFaxStatus'][_0x6930('0x16')](this));ami['on'](_0x6930('0x1d'),this[_0x6930('0x1e')][_0x6930('0x16')](this));ami['on'](_0x6930('0x1f'),this[_0x6930('0x20')]['bind'](this));ami['on']('originateresponse',this[_0x6930('0x21')][_0x6930('0x16')](this));}Fax[_0x6930('0x22')][_0x6930('0x15')]=function(_0x424909){if(_0x424909[_0x6930('0x23')]==='from-voip-provider'){for(var _0xc78d34 in this['faxAccounts']){if(this[_0x6930('0x11')]['hasOwnProperty'](_0xc78d34)){if(_0x424909[_0x6930('0x24')]===this[_0x6930('0x11')][_0xc78d34]['localstationid']){this[_0x6930('0x10')][_0x424909[_0x6930('0x25')]]={};this['channels'][_0x424909['uniqueid']][_0x6930('0x26')]=_0x424909['channel'];this[_0x6930('0x10')][_0x424909[_0x6930('0x25')]]['id']=this['faxAccounts'][_0xc78d34]['id'];this['channels'][_0x424909[_0x6930('0x25')]][_0x6930('0x27')]=this[_0x6930('0x11')][_0xc78d34][_0x6930('0x27')];logger['info'](_0x424909[_0x6930('0x25')],_0x6930('0x28'));}}}}if(this[_0x6930('0x13')][_0x424909[_0x6930('0x25')]]){this[_0x6930('0x10')][_0x424909[_0x6930('0x25')]]={};this['channels'][_0x424909['uniqueid']][_0x6930('0x26')]=_0x424909[_0x6930('0x26')];logger['info'](_0x424909[_0x6930('0x25')],_0x6930('0x28'));}};Fax[_0x6930('0x22')][_0x6930('0x18')]=function(_0x1a5df9){if(this[_0x6930('0x10')][_0x1a5df9['uniqueid']]){for(var _0x5307d2 in _0x1a5df9[_0x6930('0x29')]){if(_0x1a5df9['variable'][_0x6930('0x2a')](_0x5307d2)){this[_0x6930('0x10')][_0x1a5df9['uniqueid']][_0x5307d2]=_0x1a5df9['value'];}}}};Fax[_0x6930('0x22')]['syncNewState']=function(_0x5ed661){if(this[_0x6930('0x10')][_0x5ed661[_0x6930('0x25')]]){this[_0x6930('0x10')][_0x5ed661[_0x6930('0x25')]][_0x6930('0x2b')]=_0x5ed661[_0x6930('0x2b')];this['channels'][_0x5ed661['uniqueid']][_0x6930('0x2c')]=_0x5ed661[_0x6930('0x2c')];}};Fax[_0x6930('0x22')][_0x6930('0x1b')]=function(_0x1d78f1){if(this[_0x6930('0x10')][_0x1d78f1['uniqueid']]){for(var _0xe06a3d in _0x1d78f1[_0x6930('0x29')]){if(_0x1d78f1[_0x6930('0x29')][_0x6930('0x2a')](_0xe06a3d)){this[_0x6930('0x10')][_0x1d78f1[_0x6930('0x25')]][_0xe06a3d]=_0x1d78f1['value'];}}}};Fax['prototype'][_0x6930('0x2d')]=function(_0x558ea8){if(this['channels'][_0x558ea8[_0x6930('0x25')]]){this['channels'][_0x558ea8[_0x6930('0x25')]][_0x6930('0x2e')]=_0x558ea8[_0x6930('0x2e')];this[_0x6930('0x10')][_0x558ea8['uniqueid']][_0x6930('0x2f')]=_0x558ea8[_0x6930('0x2f')];this[_0x6930('0x10')][_0x558ea8[_0x6930('0x25')]][_0x6930('0x30')]=_0x558ea8[_0x6930('0x30')];this[_0x6930('0x10')][_0x558ea8['uniqueid']]['filename']=_0x558ea8[_0x6930('0x31')];logger[_0x6930('0x32')](_0x558ea8[_0x6930('0x25')],_0x6930('0x33'));}};Fax[_0x6930('0x22')][_0x6930('0x1e')]=function(_0x284fd3){var _0x53aaa9=this;if(this[_0x6930('0x10')][_0x284fd3['uniqueid']]){var _0x2bf669=this[_0x6930('0x10')][_0x284fd3['uniqueid']]['id'];this[_0x6930('0x10')][_0x284fd3['uniqueid']]['remotestationid']=_0x284fd3[_0x6930('0x34')];this[_0x6930('0x10')][_0x284fd3[_0x6930('0x25')]]['pagestransferred']=_0x284fd3['pagestransferred'];this[_0x6930('0x10')][_0x284fd3['uniqueid']][_0x6930('0x30')]=_0x284fd3[_0x6930('0x30')];this['channels'][_0x284fd3[_0x6930('0x25')]]['resolution']=_0x284fd3[_0x6930('0x35')];this[_0x6930('0x10')][_0x284fd3[_0x6930('0x25')]]['transferrate']=_0x284fd3[_0x6930('0x36')];this[_0x6930('0x10')][_0x284fd3['uniqueid']][_0x6930('0x31')]=_0x284fd3[_0x6930('0x31')];this[_0x6930('0x10')][_0x284fd3['uniqueid']][_0x6930('0x37')]=_0x284fd3[_0x6930('0x37')];if(this[_0x6930('0x10')][_0x284fd3[_0x6930('0x25')]][_0x6930('0x38')]>0x0){tiff2pdf(_0x284fd3[_0x6930('0x31')],_0x6930('0x39'),function(_0x470807){logger[_0x6930('0x32')](_0x284fd3[_0x6930('0x25')],'\x20result\x20conversion\x20file\x20',_0x470807[_0x6930('0x3a')]);attachment[_0x6930('0x3b')]({'name':path[_0x6930('0x3c')](_0x284fd3['filename'])['name'],'basename':path[_0x6930('0x3c')](_0x284fd3[_0x6930('0x31')])['name']+_0x6930('0x3d'),'type':_0x6930('0x3e')})[_0x6930('0x3f')](function(_0x4c98d){faxAccount[_0x6930('0x40')](_0x2bf669,{'from':_0x284fd3['calleridnum'],'mapKey':_0x6930('0x8'),'body':path[_0x6930('0x3c')](_0x284fd3['filename'])[_0x6930('0x27')]+_0x6930('0x3d'),'AttachmentId':_0x4c98d['id']})[_0x6930('0x41')](function(_0x140c3a){logger['error'](_0x284fd3['uniqueid'],_0x6930('0x42'),JSON[_0x6930('0x43')](_0x140c3a));});})['catch'](function(_0x497eae){logger['error'](_0x284fd3[_0x6930('0x25')],'\x20receiveFax\x20',JSON[_0x6930('0x43')](_0x497eae));});});}logger[_0x6930('0x32')](_0x284fd3['uniqueid'],_0x6930('0x44'));}};Fax[_0x6930('0x22')][_0x6930('0x21')]=function(_0x2c0b42){if(this[_0x6930('0x13')][_0x2c0b42[_0x6930('0x25')]]){_[_0x6930('0x45')](this[_0x6930('0x10')][_0x2c0b42[_0x6930('0x25')]],_[_0x6930('0x46')](_0x2c0b42,[_0x6930('0x47'),'reason']));}};function updateStatus(_0x11d369){if(_0x11d369[_0x6930('0x48')]){faxMessage['update'](_0x11d369[_0x6930('0x48')],{'failMessage':_0x6930('0x49')})[_0x6930('0x3f')](function(_0x1a5b4c){ut[_0x6930('0x4a')](_0x6930('0x4b'),_0x1a5b4c);})[_0x6930('0x41')](function(_0x46be73){ut[_0x6930('0x4a')](_0x6930('0x4c'),_0x46be73);});}else{ut[_0x6930('0x4a')](_0x6930('0x4d'));}}Fax[_0x6930('0x22')][_0x6930('0x4e')]=function(_0x1a6f50,_0x308176,_0x2ae1f9){var _0x921497=this;var _0x3bd59f={};if(_0x308176){_0x3bd59f={'read':_0x308176};}else{_0x3bd59f={'failMessage':_0x2ae1f9};}if(this[_0x6930('0x13')][_0x1a6f50][_0x6930('0x48')]){faxMessage[_0x6930('0x4f')](this['actions'][_0x1a6f50][_0x6930('0x48')],_0x3bd59f)['then'](function(_0x41db7b){ut[_0x6930('0x4a')](_0x6930('0x50'),_0x41db7b);})[_0x6930('0x41')](function(_0x1dddfd){ut['logger'](_0x6930('0x51'),_0x1dddfd);})[_0x6930('0x52')](function(){delete _0x921497[_0x6930('0x10')][_0x1a6f50];delete _0x921497[_0x6930('0x13')][_0x1a6f50];});}else{ut[_0x6930('0x4a')]('[Fax][Message][NoUpdate2]');delete this[_0x6930('0x10')][_0x1a6f50];delete this[_0x6930('0x13')][_0x1a6f50];}};Fax[_0x6930('0x22')]['syncHangup']=function(_0x32e089){var _0x28feba=this;if(this[_0x6930('0x10')][_0x32e089[_0x6930('0x25')]]){if(this[_0x6930('0x13')][_0x32e089[_0x6930('0x25')]]){this[_0x6930('0x10')][_0x32e089[_0x6930('0x25')]]['id']=this[_0x6930('0x13')][_0x32e089['uniqueid']]['id'];this['channels'][_0x32e089['uniqueid']][_0x6930('0x27')]=this[_0x6930('0x13')][_0x32e089[_0x6930('0x25')]][_0x6930('0x27')];}logger[_0x6930('0x32')](_0x32e089[_0x6930('0x25')],this[_0x6930('0x13')][_0x32e089[_0x6930('0x25')]]?_0x6930('0x53'):_0x6930('0x54'),JSON[_0x6930('0x43')](this[_0x6930('0x10')][_0x32e089[_0x6930('0x25')]]));if(this['actions'][_0x32e089[_0x6930('0x25')]]){if(this[_0x6930('0x10')][_0x32e089[_0x6930('0x25')]][_0x6930('0x55')]>0x0&&this['channels'][_0x32e089[_0x6930('0x25')]][_0x6930('0x1c')]==='SUCCESS'){this[_0x6930('0x4e')](_0x32e089['uniqueid'],!![]);}else{this[_0x6930('0x4e')](_0x32e089[_0x6930('0x25')],![],this[_0x6930('0x10')][_0x32e089[_0x6930('0x25')]][_0x6930('0x56')]?_0x6930('0x57')+this[_0x6930('0x10')][_0x32e089['uniqueid']][_0x6930('0x56')]:_0x6930('0x58'));}}}};Fax[_0x6930('0x22')]['send']=function(_0x500449){var _0x4ed42a=this;return new BPromise(function(_0x26c07a,_0x54b710){_0x4ed42a[_0x6930('0x59')](_0x500449,_0x4ed42a[_0x6930('0x11')][_0x500449[_0x6930('0x5a')]])['then'](function(_0x5cf0e0){ut[_0x6930('0x4a')](_0x6930('0x5b'),_0x5cf0e0);_0x26c07a(ut[_0x6930('0x3a')]('Fax\x20received'));})[_0x6930('0x41')](function(_0x16db03){ut[_0x6930('0x4a')](_0x6930('0x5c'),_0x16db03);updateStatus(_0x500449);_0x54b710(ut[_0x6930('0x3a')](_0x6930('0x5d')));});});};Fax['prototype'][_0x6930('0x5e')]=function(_0x3cdf6c){var _0x1f6143=this;return new BPromise(function(_0x341a58,_0x2a4411){var _0x2a34fd=_0x1f6143[_0x6930('0x5f')](_0x1f6143['faxAccounts'][_0x3cdf6c[_0x6930('0x5a')]][_0x6930('0x60')],_0x3cdf6c);if(_0x2a34fd[_0x6930('0x61')]){_0x341a58(ut['message'](_0x6930('0x62')));}else{_0x2a4411(ut[_0x6930('0x3a')](_0x2a34fd[_0x6930('0x3a')]));}});};function originate(_0x4b0253,_0x2398bb,_0x458855){return new BPromise(function(_0x541668,_0x109f2f){if(_0x458855){var _0x5a0278=util[_0x6930('0x63')]('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'](_0x4b0253[_0x6930('0x4')])[_0x6930('0x27')],_0x4b0253[_0x6930('0x4')]);gs[_0x6930('0x64')](_0x5a0278)[_0x6930('0x3f')](function(){_0x4b0253['path']=util['format'](_0x6930('0x65'),path[_0x6930('0x3c')](_0x4b0253[_0x6930('0x4')])[_0x6930('0x66')],path['parse'](_0x4b0253['path'])['name']);_0x2398bb[_0x6930('0x67')]=_0x4b0253[_0x6930('0x4')];ut[_0x6930('0x4a')]('Convert\x20pdf\x20to\x20tif','');ami[_0x6930('0x68')](ut[_0x6930('0x69')](_0x4b0253,_0x2398bb))[_0x6930('0x3f')](function(_0x413a23){_0x541668(_0x413a23);})['catch'](function(_0x59a3ca){_0x109f2f(_0x59a3ca);});})[_0x6930('0x41')](function(_0x514a0d){_0x109f2f(_0x514a0d);});}else{ami[_0x6930('0x68')](ut[_0x6930('0x69')](_0x4b0253,_0x2398bb))[_0x6930('0x3f')](function(_0x2a3a9b){_0x541668(_0x2a3a9b);})[_0x6930('0x41')](function(_0x2c01db){_0x109f2f(_0x2c01db);});}});}Fax[_0x6930('0x22')][_0x6930('0x59')]=function(_0x4319f1,_0x4534d5){var _0x154812=this;return new BPromise(function(_0x4126bf,_0x3861ea){var _0x50f270=uuid['v4']();var _0x46c264=ut[_0x6930('0x6a')](_0x4319f1,_0x4534d5);_0x154812[_0x6930('0x13')][_0x50f270]=new Action(_0x50f270,_0x4534d5,_0x4319f1);var _0x124e5d=_0x154812[_0x6930('0x13')][_0x50f270];if(path[_0x6930('0x3c')](_0x4319f1[_0x6930('0x4')])[_0x6930('0x6b')]===_0x6930('0x3d')){originate(_0x124e5d,_0x46c264,!![])[_0x6930('0x3f')](function(_0x32365a){_0x4126bf(_0x32365a);})[_0x6930('0x41')](function(_0x3168f4){_0x3861ea(_0x3168f4);});}else{originate(_0x124e5d,_0x46c264,![])[_0x6930('0x3f')](function(_0xc97d6a){_0x4126bf(_0xc97d6a);})[_0x6930('0x41')](function(_0x968cd7){_0x3861ea(_0x968cd7);});}});};Fax[_0x6930('0x22')][_0x6930('0x6c')]=function(_0x5a5a51){return!_[_0x6930('0x6d')](_0x5a5a51)&&!_[_0x6930('0x6d')](_0x5a5a51[_0x6930('0x27')])&&!_['isNil'](_0x5a5a51[_0x6930('0x6e')])&&_0x5a5a51[_0x6930('0x6e')]&&!_['isNil'](this[_0x6930('0x12')][util[_0x6930('0x63')](_0x6930('0x6f'),_0x5a5a51[_0x6930('0x27')])])&&!_[_0x6930('0x6d')](this[_0x6930('0x12')][util[_0x6930('0x63')]('SIP/%s',_0x5a5a51['name'])][_0x6930('0x2f')])&&(this[_0x6930('0x12')][util[_0x6930('0x63')](_0x6930('0x6f'),_0x5a5a51[_0x6930('0x27')])][_0x6930('0x2f')]===_0x6930('0x70')||this[_0x6930('0x12')][util[_0x6930('0x63')]('SIP/%s',_0x5a5a51[_0x6930('0x27')])][_0x6930('0x2f')]===_0x6930('0x71'));};Fax[_0x6930('0x22')][_0x6930('0x5f')]=function(_0x49ff83,_0x52b85d){if(!this[_0x6930('0x6c')](_0x49ff83)){ut[_0x6930('0x4a')](_0x6930('0x72'),_[_0x6930('0x6d')](_0x49ff83)?'':_0x49ff83[_0x6930('0x27')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0x6930('0x73')};}if(_[_0x6930('0x6d')](_0x52b85d[_0x6930('0x8')])){ut[_0x6930('0x4a')]('[Fax][checkTrunk][Empty\x20Fax]',JSON[_0x6930('0x43')](_0x52b85d));return{'isValid':![],'message':_0x6930('0x74')};}if(_['isNil'](_0x52b85d['path'])){ut[_0x6930('0x4a')]('[Fax][checkTrunk][Empty\x20path]',JSON['stringify'](_0x52b85d));return{'isValid':![],'message':_0x6930('0x75')};}return{'isValid':!![],'message':_0x6930('0x76')};};module[_0x6930('0x77')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 157739b..fd567d8 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 _0x631c=['../../../config/logger','preview','lodash','notify','catch','[Notify]\x20','util','bluebird'];(function(_0x2e2515,_0x4611fd){var _0x1d9dc9=function(_0x18b7bc){while(--_0x18b7bc){_0x2e2515['push'](_0x2e2515['shift']());}};_0x1d9dc9(++_0x4611fd);}(_0x631c,0xa6));var _0xc631=function(_0x488006,_0x50a9df){_0x488006=_0x488006-0x0;var _0x186824=_0x631c[_0x488006];return _0x186824;};'use strict';var util=require(_0xc631('0x0'));var BPromise=require(_0xc631('0x1'));var logger=require(_0xc631('0x2'))(_0xc631('0x3'));var _=require(_0xc631('0x4'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x56be8b){return function(_0x4fc4ef){logger['error'](_0x56be8b,util['inspect'](_0x4fc4ef,{'showHidden':![],'depth':null}));};}exports[_0xc631('0x5')]=function(_0x43888b,_0x5c4c5f){return BPromise['resolve']()['then'](faxAccount[_0xc631('0x5')](_0x43888b,_0x5c4c5f))[_0xc631('0x6')](loggerCatch(_0xc631('0x7')));}; \ No newline at end of file +var _0x95fb=['error','inspect','notify','resolve','then','catch','[Notify]\x20','bluebird','../../../config/logger','preview'];(function(_0x34c0de,_0x39543c){var _0x485498=function(_0x4e302b){while(--_0x4e302b){_0x34c0de['push'](_0x34c0de['shift']());}};_0x485498(++_0x39543c);}(_0x95fb,0x13d));var _0xb95f=function(_0x53f010,_0x4bda85){_0x53f010=_0x53f010-0x0;var _0x3092fd=_0x95fb[_0x53f010];return _0x3092fd;};'use strict';var util=require('util');var BPromise=require(_0xb95f('0x0'));var logger=require(_0xb95f('0x1'))(_0xb95f('0x2'));var _=require('lodash');var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x5be739){return function(_0x3fdf40){logger[_0xb95f('0x3')](_0x5be739,util[_0xb95f('0x4')](_0x3fdf40,{'showHidden':![],'depth':null}));};}exports[_0xb95f('0x5')]=function(_0x1ee8cb,_0x3cd8df){return BPromise[_0xb95f('0x6')]()[_0xb95f('0x7')](faxAccount[_0xb95f('0x5')](_0x1ee8cb,_0x3cd8df))[_0xb95f('0x8')](loggerCatch(_0xb95f('0x9')));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index b01b075..ff85d9c 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 _0xfc4a=['info','Exec\x20gs','\x20Error\x20:','inspect','../../../../config/logger','fax','bluebird','child_process','exec','execute'];(function(_0x22eed1,_0x13981b){var _0x4db065=function(_0x5533d6){while(--_0x5533d6){_0x22eed1['push'](_0x22eed1['shift']());}};_0x4db065(++_0x13981b);}(_0xfc4a,0x1b2));var _0xafc4=function(_0x3d71e1,_0x13fa09){_0x3d71e1=_0x3d71e1-0x0;var _0x6131b4=_0xfc4a[_0x3d71e1];return _0x6131b4;};'use strict';var util=require('util');var logger=require(_0xafc4('0x0'))(_0xafc4('0x1'));var BPromise=require(_0xafc4('0x2'));var exec=require(_0xafc4('0x3'))[_0xafc4('0x4')];exports[_0xafc4('0x5')]=function(_0x1c70ea){return new BPromise(function(_0x3e983e,_0x25a5da){exec(_0x1c70ea,function(_0x203474,_0x32da9f,_0x59bb45){logger[_0xafc4('0x6')](_0xafc4('0x7'),_0x32da9f);if(_0x203474){logger[_0xafc4('0x6')](_0xafc4('0x7'),_0xafc4('0x8'),util[_0xafc4('0x9')](_0x203474,{'showHidden':![],'depth':null}),_0x32da9f,_0x59bb45);_0x25a5da(_0x203474);}_0x3e983e(_0x32da9f);});});}; \ No newline at end of file +var _0x1c07=['bluebird','exec','execute','info','Exec\x20gs','\x20Error\x20:','inspect','util','../../../../config/logger','fax'];(function(_0x2d579f,_0x370e5d){var _0x1145da=function(_0x49376f){while(--_0x49376f){_0x2d579f['push'](_0x2d579f['shift']());}};_0x1145da(++_0x370e5d);}(_0x1c07,0x15b));var _0x71c0=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x1c07[_0x199572];return _0x13cfa3;};'use strict';var util=require(_0x71c0('0x0'));var logger=require(_0x71c0('0x1'))(_0x71c0('0x2'));var BPromise=require(_0x71c0('0x3'));var exec=require('child_process')[_0x71c0('0x4')];exports[_0x71c0('0x5')]=function(_0x15e90c){return new BPromise(function(_0x3a8747,_0x3ce10c){exec(_0x15e90c,function(_0x19751c,_0x37c3a5,_0x43369c){logger[_0x71c0('0x6')]('Exec\x20gs',_0x37c3a5);if(_0x19751c){logger['info'](_0x71c0('0x7'),_0x71c0('0x8'),util[_0x71c0('0x9')](_0x19751c,{'showHidden':![],'depth':null}),_0x37c3a5,_0x43369c);_0x3ce10c(_0x19751c);}_0x3a8747(_0x37c3a5);});});}; \ 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 4b4b210..36067a0 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 _0x38c6=['\x22%s\x22\x20<%s>','headerinfo','localstationid','lodash','../../../../config/logger','fax','message','logger','info','inspect','ecm','minrate','maxrate','format','\x22%s\x22','modem','gateway','t38timeout','variablesAction','uniqueid','originate','channel','xcally-motion-fax','from-sip'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x38c6,0x16b));var _0x638c=function(_0x154a2b,_0x253064){_0x154a2b=_0x154a2b-0x0;var _0x3bdb5f=_0x38c6[_0x154a2b];return _0x3bdb5f;};'use strict';var util=require('util');var _=require(_0x638c('0x0'));var moment=require('moment');var logger=require(_0x638c('0x1'))(_0x638c('0x2'));exports[_0x638c('0x3')]=function(_0x69b19f){return{'message':_0x69b19f};};exports[_0x638c('0x4')]=function(_0x3e1682,_0x5da0bd){logger[_0x638c('0x5')](_0x3e1682,util[_0x638c('0x6')](_0x5da0bd,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x4eeb00,_0x3102aa){var _0x2d3aa8={'XMF-ECM':_0x3102aa[_0x638c('0x7')],'XMF-HEADERINFO':_0x3102aa['headerinfo'],'XMF-MINRATE':_0x3102aa[_0x638c('0x8')],'XMF-MAXRATE':_0x3102aa[_0x638c('0x9')],'XMF-MODEM':util[_0x638c('0xa')](_0x638c('0xb'),_0x3102aa[_0x638c('0xc')]),'XMF-GATEWAY':_0x3102aa[_0x638c('0xd')],'XMF-FAXDETECT':_0x3102aa['faxdetect'],'XMF-T38TIMEOUT':_0x3102aa[_0x638c('0xe')],'XMF-LOCALSTATIONID':_0x3102aa['localstationid'],'XMF-PATH':_0x4eeb00['path']};return _0x2d3aa8;};exports[_0x638c('0xf')]=function(_0x402c6b,_0x3324da){return{'actionid':_0x402c6b[_0x638c('0x10')],'action':_0x638c('0x11'),'channel':_0x402c6b[_0x638c('0x12')],'Exten':_0x638c('0x13'),'Context':_0x638c('0x14'),'Priority':'1','callerid':util[_0x638c('0xa')](_0x638c('0x15'),_0x402c6b[_0x638c('0x16')]?_0x402c6b[_0x638c('0x16')]:'',_0x402c6b[_0x638c('0x17')]),'variable':_0x3324da,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x402c6b[_0x638c('0x10')]};}; \ No newline at end of file +var _0x8ab0=['xcally-motion-fax','from-sip','format','\x22%s\x22\x20<%s>','headerinfo','util','moment','../../../../config/logger','fax','message','logger','info','inspect','addVariables','ecm','minrate','\x22%s\x22','modem','gateway','faxdetect','t38timeout','path','variablesAction','uniqueid','originate','channel'];(function(_0x3cba1d,_0x2825ae){var _0x5f192b=function(_0x32ff5d){while(--_0x32ff5d){_0x3cba1d['push'](_0x3cba1d['shift']());}};_0x5f192b(++_0x2825ae);}(_0x8ab0,0x18b));var _0x08ab=function(_0x509cf7,_0x3b7a8f){_0x509cf7=_0x509cf7-0x0;var _0xab8de5=_0x8ab0[_0x509cf7];return _0xab8de5;};'use strict';var util=require(_0x08ab('0x0'));var _=require('lodash');var moment=require(_0x08ab('0x1'));var logger=require(_0x08ab('0x2'))(_0x08ab('0x3'));exports[_0x08ab('0x4')]=function(_0x2bee46){return{'message':_0x2bee46};};exports[_0x08ab('0x5')]=function(_0x55a817,_0x1fb1c2){logger[_0x08ab('0x6')](_0x55a817,util[_0x08ab('0x7')](_0x1fb1c2,{'showHidden':![],'depth':null}));};exports[_0x08ab('0x8')]=function(_0x101e34,_0x5926fe){var _0x243bdf={'XMF-ECM':_0x5926fe[_0x08ab('0x9')],'XMF-HEADERINFO':_0x5926fe['headerinfo'],'XMF-MINRATE':_0x5926fe[_0x08ab('0xa')],'XMF-MAXRATE':_0x5926fe['maxrate'],'XMF-MODEM':util['format'](_0x08ab('0xb'),_0x5926fe[_0x08ab('0xc')]),'XMF-GATEWAY':_0x5926fe[_0x08ab('0xd')],'XMF-FAXDETECT':_0x5926fe[_0x08ab('0xe')],'XMF-T38TIMEOUT':_0x5926fe[_0x08ab('0xf')],'XMF-LOCALSTATIONID':_0x5926fe['localstationid'],'XMF-PATH':_0x101e34[_0x08ab('0x10')]};return _0x243bdf;};exports[_0x08ab('0x11')]=function(_0x4bea4f,_0x2fbe41){return{'actionid':_0x4bea4f[_0x08ab('0x12')],'action':_0x08ab('0x13'),'channel':_0x4bea4f[_0x08ab('0x14')],'Exten':_0x08ab('0x15'),'Context':_0x08ab('0x16'),'Priority':'1','callerid':util[_0x08ab('0x17')](_0x08ab('0x18'),_0x4bea4f[_0x08ab('0x19')]?_0x4bea4f[_0x08ab('0x19')]:'',_0x4bea4f['localstationid']),'variable':_0x2fbe41,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x4bea4f[_0x08ab('0x12')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 2cab6e9..f8fdb07 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 _0x98ee=['ami','get','resolve','then','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','initTriggers','initTemplates','getZendeskAccounts','getSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','getDeskAccounts','getZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','initDynamics365Accounts','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','[index.js][initParams]','[index.js][main]','inspect','util','moment','./realtime','./report','./trigger','./fax','./rpc/user','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger'];(function(_0x1fafb1,_0x2ba4ff){var _0x9a1569=function(_0x1fddc8){while(--_0x1fddc8){_0x1fafb1['push'](_0x1fafb1['shift']());}};_0x9a1569(++_0x2ba4ff);}(_0x98ee,0x69));var _0xe98e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x98ee[_0x19e35c];return _0x3e1fe8;};'use strict';var util=require(_0xe98e('0x0'));var moment=require(_0xe98e('0x1'));var server=require('./server');var Realtime=require(_0xe98e('0x2'));var Report=require(_0xe98e('0x3'));var Acw=require('./acw');var Trigger=require(_0xe98e('0x4'));var Dialer=require('./dialer');var Preview=require('./preview');var Fax=require(_0xe98e('0x5'));var user=require(_0xe98e('0x6'));var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require(_0xe98e('0x7'));var trunk=require(_0xe98e('0x8'));var trigger=require(_0xe98e('0x9'));var template=require('./rpc/template');var cmHopperHistory=require(_0xe98e('0xa'));var campaign=require(_0xe98e('0xb'));var voiceExtension=require(_0xe98e('0xc'));var faxAccount=require(_0xe98e('0xd'));var zendesk=require(_0xe98e('0xe'));var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0xe98e('0xf'));var freshdesk=require(_0xe98e('0x10'));var desk=require(_0xe98e('0x11'));var zoho=require(_0xe98e('0x12'));var vtiger=require('./rpc/integrations/vtiger');var freshsales=require(_0xe98e('0x13'));var servicenow=require(_0xe98e('0x14'));var dynamics365=require(_0xe98e('0x15'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0xe98e('0x16'))(_0xe98e('0x17'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xe98e('0x18')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xe98e('0x18')]('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0xe98e('0x19')]()[_0xe98e('0x1a')](user['getAgents']())[_0xe98e('0x1a')](realtime[_0xe98e('0x1b')]())[_0xe98e('0x1a')](user[_0xe98e('0x1c')]())[_0xe98e('0x1a')](realtime[_0xe98e('0x1d')]())[_0xe98e('0x1a')](trunk[_0xe98e('0x1e')]())[_0xe98e('0x1a')](realtime[_0xe98e('0x1f')]())[_0xe98e('0x1a')](voiceQueue[_0xe98e('0x20')]())[_0xe98e('0x1a')](realtime[_0xe98e('0x21')]())[_0xe98e('0x1a')](trigger['getTriggers']())[_0xe98e('0x1a')](realtime[_0xe98e('0x22')]())[_0xe98e('0x1a')](template['getTemplates']())[_0xe98e('0x1a')](realtime[_0xe98e('0x23')]())[_0xe98e('0x1a')](zendesk[_0xe98e('0x24')]())[_0xe98e('0x1a')](realtime['initZendeskAccounts']())[_0xe98e('0x1a')](salesforce[_0xe98e('0x25')]())[_0xe98e('0x1a')](realtime['initSalesforceAccounts']())['then'](sugarcrm[_0xe98e('0x26')]())[_0xe98e('0x1a')](realtime[_0xe98e('0x27')]())[_0xe98e('0x1a')](freshdesk[_0xe98e('0x28')]())[_0xe98e('0x1a')](realtime['initFreshdeskAccounts']())[_0xe98e('0x1a')](desk[_0xe98e('0x29')]())[_0xe98e('0x1a')](realtime['initDeskAccounts']())['then'](zoho[_0xe98e('0x2a')]())[_0xe98e('0x1a')](realtime['initZohoAccounts']())[_0xe98e('0x1a')](vtiger[_0xe98e('0x2b')]())[_0xe98e('0x1a')](realtime[_0xe98e('0x2c')]())[_0xe98e('0x1a')](freshsales[_0xe98e('0x2d')]())[_0xe98e('0x1a')](realtime[_0xe98e('0x2e')]())[_0xe98e('0x1a')](servicenow[_0xe98e('0x2f')]())[_0xe98e('0x1a')](realtime[_0xe98e('0x30')]())['then'](dynamics365['getDynamics365Accounts']())[_0xe98e('0x1a')](realtime[_0xe98e('0x31')]())[_0xe98e('0x1a')](campaign['getCampaigns']())[_0xe98e('0x1a')](realtime[_0xe98e('0x32')]())['then'](voiceExtension[_0xe98e('0x33')]())[_0xe98e('0x1a')](realtime[_0xe98e('0x34')]())[_0xe98e('0x1a')](faxAccount[_0xe98e('0x35')]())['then'](realtime[_0xe98e('0x36')]())[_0xe98e('0x1a')](function(){return realtime;});}function initParams(){return Promise[_0xe98e('0x19')]()['then'](voiceQueueReport['getVoiceQueueReports']())['then'](realtime['initVoiceQueueReports']())[_0xe98e('0x1a')](cmHopperHistory['getVoiceQueueHopperHistory']())['then'](realtime[_0xe98e('0x37')]())[_0xe98e('0x1a')](cmHopperHistory[_0xe98e('0x38')]())[_0xe98e('0x1a')](realtime[_0xe98e('0x39')]())[_0xe98e('0x1a')](voiceCallReport[_0xe98e('0x3a')]())[_0xe98e('0x1a')](realtime[_0xe98e('0x3b')]())[_0xe98e('0x3c')](function(_0x341896){logger['error'](_0xe98e('0x3d'),util['inspect'](_0x341896,{'showHidden':![],'depth':null}));});}function main(){return server['listen'](realtime,preview,fax)[_0xe98e('0x1a')](function(){return initRealtime();})['then'](function(){return initParams();})['then'](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0xe98e('0x3c')](function(_0x187423){logger['error'](_0xe98e('0x3e'),util[_0xe98e('0x3f')](_0x187423,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0x9674=['initTrunks','getVoiceQueues','initVoiceQueues','initTriggers','getTemplates','initTemplates','getSalesforceAccounts','initSalesforceAccounts','initSugarcrmAccounts','getFreshdeskAccounts','getDeskAccounts','initDeskAccounts','initZohoAccounts','getFreshsalesAccounts','initFreshsalesAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','catch','error','[index.js][initParams]','inspect','listen','[index.js][main]','util','moment','./server','./realtime','./report','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','ami','get','hour','resolve','getAgents','initAgents','getTelephones','then'];(function(_0x385dc2,_0x1008b3){var _0x53b4d4=function(_0xb837d1){while(--_0xb837d1){_0x385dc2['push'](_0x385dc2['shift']());}};_0x53b4d4(++_0x1008b3);}(_0x9674,0x135));var _0x4967=function(_0x1c4006,_0x2524d4){_0x1c4006=_0x1c4006-0x0;var _0x19586e=_0x9674[_0x1c4006];return _0x19586e;};'use strict';var util=require(_0x4967('0x0'));var moment=require(_0x4967('0x1'));var server=require(_0x4967('0x2'));var Realtime=require(_0x4967('0x3'));var Report=require(_0x4967('0x4'));var Acw=require('./acw');var Trigger=require(_0x4967('0x5'));var Dialer=require(_0x4967('0x6'));var Preview=require(_0x4967('0x7'));var Fax=require(_0x4967('0x8'));var user=require(_0x4967('0x9'));var voiceQueue=require(_0x4967('0xa'));var voiceQueueReport=require(_0x4967('0xb'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require('./rpc/trunk');var trigger=require(_0x4967('0xc'));var template=require(_0x4967('0xd'));var cmHopperHistory=require(_0x4967('0xe'));var campaign=require('./rpc/campaign');var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0x4967('0xf'));var zendesk=require(_0x4967('0x10'));var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0x4967('0x11'));var freshdesk=require(_0x4967('0x12'));var desk=require(_0x4967('0x13'));var zoho=require('./rpc/integrations/zoho');var vtiger=require('./rpc/integrations/vtiger');var freshsales=require(_0x4967('0x14'));var servicenow=require(_0x4967('0x15'));var dynamics365=require(_0x4967('0x16'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require('../../config/logger')(_0x4967('0x17'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x4967('0x18')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x4967('0x18')](_0x4967('0x19'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0x4967('0x1a')]()['then'](user[_0x4967('0x1b')]())['then'](realtime[_0x4967('0x1c')]())['then'](user[_0x4967('0x1d')]())[_0x4967('0x1e')](realtime['initTelephones']())[_0x4967('0x1e')](trunk['getTrunks']())['then'](realtime[_0x4967('0x1f')]())[_0x4967('0x1e')](voiceQueue[_0x4967('0x20')]())[_0x4967('0x1e')](realtime[_0x4967('0x21')]())[_0x4967('0x1e')](trigger['getTriggers']())[_0x4967('0x1e')](realtime[_0x4967('0x22')]())['then'](template[_0x4967('0x23')]())[_0x4967('0x1e')](realtime[_0x4967('0x24')]())['then'](zendesk['getZendeskAccounts']())[_0x4967('0x1e')](realtime['initZendeskAccounts']())[_0x4967('0x1e')](salesforce[_0x4967('0x25')]())[_0x4967('0x1e')](realtime[_0x4967('0x26')]())[_0x4967('0x1e')](sugarcrm['getSugarcrmAccounts']())[_0x4967('0x1e')](realtime[_0x4967('0x27')]())[_0x4967('0x1e')](freshdesk[_0x4967('0x28')]())['then'](realtime['initFreshdeskAccounts']())[_0x4967('0x1e')](desk[_0x4967('0x29')]())[_0x4967('0x1e')](realtime[_0x4967('0x2a')]())[_0x4967('0x1e')](zoho['getZohoAccounts']())[_0x4967('0x1e')](realtime[_0x4967('0x2b')]())[_0x4967('0x1e')](vtiger['getVtigerAccounts']())[_0x4967('0x1e')](realtime['initVtigerAccounts']())[_0x4967('0x1e')](freshsales[_0x4967('0x2c')]())[_0x4967('0x1e')](realtime[_0x4967('0x2d')]())[_0x4967('0x1e')](servicenow['getServicenowAccounts']())[_0x4967('0x1e')](realtime[_0x4967('0x2e')]())['then'](dynamics365[_0x4967('0x2f')]())[_0x4967('0x1e')](realtime[_0x4967('0x30')]())['then'](campaign[_0x4967('0x31')]())[_0x4967('0x1e')](realtime[_0x4967('0x32')]())[_0x4967('0x1e')](voiceExtension[_0x4967('0x33')]())['then'](realtime[_0x4967('0x34')]())[_0x4967('0x1e')](faxAccount[_0x4967('0x35')]())[_0x4967('0x1e')](realtime[_0x4967('0x36')]())[_0x4967('0x1e')](function(){return realtime;});}function initParams(){return Promise[_0x4967('0x1a')]()[_0x4967('0x1e')](voiceQueueReport[_0x4967('0x37')]())['then'](realtime[_0x4967('0x38')]())[_0x4967('0x1e')](cmHopperHistory[_0x4967('0x39')]())[_0x4967('0x1e')](realtime[_0x4967('0x3a')]())[_0x4967('0x1e')](cmHopperHistory[_0x4967('0x3b')]())['then'](realtime[_0x4967('0x3c')]())[_0x4967('0x1e')](voiceCallReport[_0x4967('0x3d')]())['then'](realtime['initVoiceCallReports']())[_0x4967('0x3e')](function(_0x4775b1){logger[_0x4967('0x3f')](_0x4967('0x40'),util[_0x4967('0x41')](_0x4775b1,{'showHidden':![],'depth':null}));});}function main(){return server[_0x4967('0x42')](realtime,preview,fax)['then'](function(){return initRealtime();})[_0x4967('0x1e')](function(){return initParams();})['then'](function(){report['sync']();setInterval(initRealtime,0x1388);})['catch'](function(_0x3fd7e0){logger[_0x4967('0x3f')](_0x4967('0x43'),util['inspect'](_0x3fd7e0,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index 018bb8a..f661050 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 _0x13ea=['status','address','phone','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','onhold','local','updateStatusRealtime','toLowerCase','not_inuse','idle','inuse','statePause','format','name','voiceStatusQueue','stringify','user:%s','user:save','emit','exports','moment','md5','ioredis','redis','socket.io-emitter','email','accountcode','fullname','state','unknown','stateTime'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x13ea,0xa9));var _0xa13e=function(_0x5bfa44,_0x76dacc){_0x5bfa44=_0x5bfa44-0x0;var _0x43815f=_0x13ea[_0x5bfa44];return _0x43815f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa13e('0x0'));var md5=require(_0xa13e('0x1'));var Redis=require(_0xa13e('0x2'));var config=require('../../../config/environment');config[_0xa13e('0x3')]=_['defaults'](config[_0xa13e('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0xa13e('0x4'))(new Redis(config[_0xa13e('0x3')]));function Agent(_0x483168){this['id']=_0x483168['id']||0x0;this['name']=_0x483168['name']||'';this['email']=_0x483168[_0xa13e('0x5')]||'';this[_0xa13e('0x6')]=_0x483168[_0xa13e('0x6')]||'';this['fullname']=_0x483168[_0xa13e('0x7')]||'';this[_0xa13e('0x8')]=_0xa13e('0x9');this[_0xa13e('0xa')]=0x0;this[_0xa13e('0xb')]='unknown';this[_0xa13e('0xc')]='';this[_0xa13e('0xd')]='';this[_0xa13e('0xe')]='';this[_0xa13e('0xf')]='';this['online']=_0x483168[_0xa13e('0x10')]||![];this[_0xa13e('0x11')]=_0xa13e('0x9');this[_0xa13e('0x12')]=0x0;this[_0xa13e('0x13')]='';this['voiceStatusQueue']='';this[_0xa13e('0x14')]=![];this[_0xa13e('0x15')]=![];this['md5']='';}Agent['prototype'][_0xa13e('0x16')]=function(_0x5e7574){var _0xc9bfdc;if(_0x5e7574&&_0x5e7574['state']){_0xc9bfdc=_0x5e7574[_0xa13e('0x8')][_0xa13e('0x17')]();switch(_0xc9bfdc){case _0xa13e('0x18'):_0xc9bfdc=_0xa13e('0x19');break;case _0xa13e('0x1a'):_0xc9bfdc='talking';break;}}if(_0xc9bfdc&&this[_0xa13e('0x11')]!==_0xc9bfdc||_0x5e7574[_0xa13e('0x1b')]){this[_0xa13e('0x12')]=_['toNumber'](moment()[_0xa13e('0x1c')]('x'));}if(_0xc9bfdc){this[_0xa13e('0x11')]=_0xc9bfdc;}var _0x5cd980={'id':this['id'],'name':this[_0xa13e('0x1d')],'email':this[_0xa13e('0x5')],'accountcode':this[_0xa13e('0x6')],'fullname':this[_0xa13e('0x7')],'state':this['state'],'stateTime':this[_0xa13e('0xa')],'status':this[_0xa13e('0xb')],'address':this[_0xa13e('0xc')],'online':this[_0xa13e('0x10')],'voiceStatus':this[_0xa13e('0x11')],'voiceStatusTime':this[_0xa13e('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0xa13e('0x1e')],'interface':this[_0xa13e('0xf')],'onhold':this['onhold']};var _0x5136be=md5(JSON[_0xa13e('0x1f')](_0x5cd980));if(this[_0xa13e('0x1')]!==_0x5136be){this[_0xa13e('0x1')]=_0x5136be;io['to'](util[_0xa13e('0x1c')](_0xa13e('0x20'),_0x5cd980[_0xa13e('0x1d')]))['emit'](_0xa13e('0x21'),_0x5cd980);io[_0xa13e('0x22')]('user:presence',_0x5cd980);}};module[_0xa13e('0x23')]=Agent; \ No newline at end of file +var _0x9f6d=['socket.io-emitter','name','email','fullname','unknown','stateTime','status','address','phone','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','local','prototype','updateStatusRealtime','state','toLowerCase','not_inuse','idle','inuse','talking','toNumber','format','accountcode','user:%s','emit','user:save','exports','lodash','util','moment','md5','ioredis','../../../config/environment','redis','localhost'];(function(_0x10f6e8,_0x351db6){var _0x35bb3c=function(_0x30a39b){while(--_0x30a39b){_0x10f6e8['push'](_0x10f6e8['shift']());}};_0x35bb3c(++_0x351db6);}(_0x9f6d,0x140));var _0xd9f6=function(_0x4fc930,_0x365a21){_0x4fc930=_0x4fc930-0x0;var _0xf4f4b4=_0x9f6d[_0x4fc930];return _0xf4f4b4;};'use strict';var _=require(_0xd9f6('0x0'));var util=require(_0xd9f6('0x1'));var moment=require(_0xd9f6('0x2'));var md5=require(_0xd9f6('0x3'));var Redis=require(_0xd9f6('0x4'));var config=require(_0xd9f6('0x5'));config[_0xd9f6('0x6')]=_['defaults'](config['redis'],{'host':_0xd9f6('0x7'),'port':0x18eb});var io=require(_0xd9f6('0x8'))(new Redis(config[_0xd9f6('0x6')]));function Agent(_0x21e231){this['id']=_0x21e231['id']||0x0;this[_0xd9f6('0x9')]=_0x21e231[_0xd9f6('0x9')]||'';this['email']=_0x21e231[_0xd9f6('0xa')]||'';this['accountcode']=_0x21e231['accountcode']||'';this[_0xd9f6('0xb')]=_0x21e231['fullname']||'';this['state']=_0xd9f6('0xc');this[_0xd9f6('0xd')]=0x0;this[_0xd9f6('0xe')]=_0xd9f6('0xc');this[_0xd9f6('0xf')]='';this[_0xd9f6('0x10')]='';this[_0xd9f6('0x11')]='';this[_0xd9f6('0x12')]='';this['online']=_0x21e231[_0xd9f6('0x13')]||![];this[_0xd9f6('0x14')]='unknown';this[_0xd9f6('0x15')]=0x0;this[_0xd9f6('0x16')]='';this[_0xd9f6('0x17')]='';this[_0xd9f6('0x18')]=![];this[_0xd9f6('0x19')]=![];this[_0xd9f6('0x3')]='';}Agent[_0xd9f6('0x1a')][_0xd9f6('0x1b')]=function(_0x24f038){var _0x36437a;if(_0x24f038&&_0x24f038[_0xd9f6('0x1c')]){_0x36437a=_0x24f038[_0xd9f6('0x1c')][_0xd9f6('0x1d')]();switch(_0x36437a){case _0xd9f6('0x1e'):_0x36437a=_0xd9f6('0x1f');break;case _0xd9f6('0x20'):_0x36437a=_0xd9f6('0x21');break;}}if(_0x36437a&&this['voiceStatus']!==_0x36437a||_0x24f038['statePause']){this[_0xd9f6('0x15')]=_[_0xd9f6('0x22')](moment()[_0xd9f6('0x23')]('x'));}if(_0x36437a){this[_0xd9f6('0x14')]=_0x36437a;}var _0x59600f={'id':this['id'],'name':this[_0xd9f6('0x9')],'email':this[_0xd9f6('0xa')],'accountcode':this[_0xd9f6('0x24')],'fullname':this['fullname'],'state':this['state'],'stateTime':this[_0xd9f6('0xd')],'status':this[_0xd9f6('0xe')],'address':this[_0xd9f6('0xf')],'online':this[_0xd9f6('0x13')],'voiceStatus':this[_0xd9f6('0x14')],'voiceStatusTime':this['voiceStatusTime'],'voiceStatusCallerIdNumber':this[_0xd9f6('0x16')],'voiceStatusQueue':this[_0xd9f6('0x17')],'interface':this[_0xd9f6('0x12')],'onhold':this[_0xd9f6('0x18')]};var _0x5b1698=md5(JSON['stringify'](_0x59600f));if(this[_0xd9f6('0x3')]!==_0x5b1698){this['md5']=_0x5b1698;io['to'](util[_0xd9f6('0x23')](_0xd9f6('0x25'),_0x59600f[_0xd9f6('0x9')]))[_0xd9f6('0x26')](_0xd9f6('0x27'),_0x59600f);io[_0xd9f6('0x26')]('user:presence',_0x59600f);}};module[_0xd9f6('0x28')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index bc8ebba..d90753e 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 _0x119b=['type','campaign','originated','ivrAnswerCallsDay','ivrTotalCallsDays','message','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name'];(function(_0x1156ce,_0x50f233){var _0x2b6d72=function(_0x36a033){while(--_0x36a033){_0x1156ce['push'](_0x1156ce['shift']());}};_0x2b6d72(++_0x50f233);}(_0x119b,0xef));var _0xb119=function(_0x22b39b,_0x2b7d63){_0x22b39b=_0x22b39b-0x0;var _0x280e1d=_0x119b[_0x22b39b];return _0x280e1d;};'use strict';function Campaign(_0x343fba){this['id']=_0x343fba['id']||0x0;this[_0xb119('0x0')]=_0x343fba['name']||'';this[_0xb119('0x1')]=_0x343fba['type']||_0xb119('0x2');this[_0xb119('0x3')]=0x0;this['temp']=0x0;this[_0xb119('0x4')]=0x0;this[_0xb119('0x5')]=0x0;this[_0xb119('0x6')]='';this['sendMessageOneNotActive']=!![];this[_0xb119('0x7')]=_0x343fba[_0xb119('0x7')];this[_0xb119('0x8')]=_0x343fba['limitCalls'];this[_0xb119('0x9')]=_0x343fba[_0xb119('0x9')]||null;this[_0xb119('0xa')]=_0x343fba[_0xb119('0xa')]?_0x343fba['dialGlobalInterval']:null;this[_0xb119('0xb')]=_0x343fba[_0xb119('0xb')];this[_0xb119('0xc')]=_0x343fba['dialOriginateCallerIdNumber'];this[_0xb119('0xd')]=_0x343fba[_0xb119('0xd')]||0x1e;this[_0xb119('0xe')]=_0x343fba[_0xb119('0xe')];this[_0xb119('0xf')]=_0x343fba[_0xb119('0xf')];this[_0xb119('0x10')]=_0x343fba[_0xb119('0x10')];this[_0xb119('0x11')]=_0x343fba['dialBusyRetryFrequency'];this[_0xb119('0x12')]=_0x343fba[_0xb119('0x12')];this[_0xb119('0x13')]=_0x343fba[_0xb119('0x13')];this[_0xb119('0x14')]=_0x343fba['dialGlobalMaxRetry'];this[_0xb119('0x15')]=_0x343fba[_0xb119('0x15')]||0x3;this[_0xb119('0x16')]=_0x343fba['dialNoSuchNumberRetryFrequency']||0x96;this[_0xb119('0x17')]=_0x343fba[_0xb119('0x17')]||0x3;this[_0xb119('0x18')]=_0x343fba['dialDropRetryFrequency']||0x96;this['dialAbandonedMaxRetry']=_0x343fba['dialAbandonedMaxRetry']||0x3;this[_0xb119('0x19')]=_0x343fba['dialAbandonedRetryFrequency']||0x96;this[_0xb119('0x1a')]=_0x343fba[_0xb119('0x1a')]||0x3;this[_0xb119('0x1b')]=_0x343fba[_0xb119('0x1b')]||0x96;this[_0xb119('0x1c')]=_0x343fba[_0xb119('0x1c')]||0x3;this[_0xb119('0x1d')]=_0x343fba[_0xb119('0x1d')]||0x96;this[_0xb119('0x1e')]=_0x343fba[_0xb119('0x1e')]||_0xb119('0x1f');this[_0xb119('0x20')]=_0x343fba['dialPrefix']||undefined;this[_0xb119('0x21')]=_0x343fba[_0xb119('0x21')]||undefined;this['dialCutDigit']=_0x343fba['dialCutDigit']||undefined;this[_0xb119('0x22')]=_0x343fba[_0xb119('0x22')]?_0x343fba['TrunkBackup']:undefined;this['Trunk']=_0x343fba['Trunk']?_0x343fba[_0xb119('0x23')]:undefined;this[_0xb119('0x24')]=_0x343fba[_0xb119('0x24')]?_0x343fba[_0xb119('0x24')]:undefined;this[_0xb119('0x25')]=_0x343fba[_0xb119('0x25')]?_0x343fba[_0xb119('0x25')]:undefined;this['dialQueueProject']=_0x343fba[_0xb119('0x25')]?_0x343fba[_0xb119('0x25')]['name']:undefined;this[_0xb119('0x26')]=_0x343fba[_0xb119('0x26')]||![];this[_0xb119('0x27')]=_0x343fba['dialAMDInitialSilence'];this[_0xb119('0x28')]=_0x343fba[_0xb119('0x28')];this['dialAMDAfterGreetingSilence']=_0x343fba['dialAMDAfterGreetingSilence'];this[_0xb119('0x29')]=_0x343fba[_0xb119('0x29')];this[_0xb119('0x2a')]=_0x343fba[_0xb119('0x2a')];this[_0xb119('0x2b')]=_0x343fba[_0xb119('0x2b')];this[_0xb119('0x2c')]=_0x343fba[_0xb119('0x2c')];this[_0xb119('0x2d')]=_0x343fba[_0xb119('0x2d')];this[_0xb119('0x2e')]=_0x343fba[_0xb119('0x2e')];}module[_0xb119('0x2f')]=Campaign; \ No newline at end of file +var _0xaf91=['dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','originated','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry'];(function(_0x78029b,_0x19ce64){var _0x2c1b66=function(_0x3d1543){while(--_0x3d1543){_0x78029b['push'](_0x78029b['shift']());}};_0x2c1b66(++_0x19ce64);}(_0xaf91,0x154));var _0x1af9=function(_0x4c70c4,_0x963969){_0x4c70c4=_0x4c70c4-0x0;var _0x437865=_0xaf91[_0x4c70c4];return _0x437865;};'use strict';function Campaign(_0x39d8bd){this['id']=_0x39d8bd['id']||0x0;this[_0x1af9('0x0')]=_0x39d8bd['name']||'';this[_0x1af9('0x1')]=_0x39d8bd[_0x1af9('0x1')]||'campaign';this[_0x1af9('0x2')]=0x0;this['temp']=0x0;this[_0x1af9('0x3')]=0x0;this[_0x1af9('0x4')]=0x0;this[_0x1af9('0x5')]='';this[_0x1af9('0x6')]=!![];this['active']=_0x39d8bd[_0x1af9('0x7')];this[_0x1af9('0x8')]=_0x39d8bd[_0x1af9('0x8')];this['dialTimezone']=_0x39d8bd[_0x1af9('0x9')]||null;this[_0x1af9('0xa')]=_0x39d8bd[_0x1af9('0xa')]?_0x39d8bd['dialGlobalInterval']:null;this[_0x1af9('0xb')]=_0x39d8bd[_0x1af9('0xb')];this['dialOriginateCallerIdNumber']=_0x39d8bd[_0x1af9('0xc')];this[_0x1af9('0xd')]=_0x39d8bd[_0x1af9('0xd')]||0x1e;this[_0x1af9('0xe')]=_0x39d8bd['dialCongestionMaxRetry'];this['dialCongestionRetryFrequency']=_0x39d8bd[_0x1af9('0xf')];this['dialBusyMaxRetry']=_0x39d8bd[_0x1af9('0x10')];this['dialBusyRetryFrequency']=_0x39d8bd[_0x1af9('0x11')];this[_0x1af9('0x12')]=_0x39d8bd[_0x1af9('0x12')];this[_0x1af9('0x13')]=_0x39d8bd['dialNoAnswerRetryFrequency'];this[_0x1af9('0x14')]=_0x39d8bd['dialGlobalMaxRetry'];this[_0x1af9('0x15')]=_0x39d8bd[_0x1af9('0x15')]||0x3;this[_0x1af9('0x16')]=_0x39d8bd[_0x1af9('0x16')]||0x96;this[_0x1af9('0x17')]=_0x39d8bd['dialDropMaxRetry']||0x3;this['dialDropRetryFrequency']=_0x39d8bd[_0x1af9('0x18')]||0x96;this[_0x1af9('0x19')]=_0x39d8bd[_0x1af9('0x19')]||0x3;this['dialAbandonedRetryFrequency']=_0x39d8bd[_0x1af9('0x1a')]||0x96;this[_0x1af9('0x1b')]=_0x39d8bd['dialMachineMaxRetry']||0x3;this[_0x1af9('0x1c')]=_0x39d8bd[_0x1af9('0x1c')]||0x96;this[_0x1af9('0x1d')]=_0x39d8bd[_0x1af9('0x1d')]||0x3;this[_0x1af9('0x1e')]=_0x39d8bd[_0x1af9('0x1e')]||0x96;this[_0x1af9('0x1f')]=_0x39d8bd[_0x1af9('0x1f')]||_0x1af9('0x20');this[_0x1af9('0x21')]=_0x39d8bd[_0x1af9('0x21')]||undefined;this[_0x1af9('0x22')]=_0x39d8bd[_0x1af9('0x22')]||undefined;this['dialCutDigit']=_0x39d8bd['dialCutDigit']||undefined;this[_0x1af9('0x23')]=_0x39d8bd[_0x1af9('0x23')]?_0x39d8bd[_0x1af9('0x23')]:undefined;this[_0x1af9('0x24')]=_0x39d8bd[_0x1af9('0x24')]?_0x39d8bd[_0x1af9('0x24')]:undefined;this[_0x1af9('0x25')]=_0x39d8bd['Interval']?_0x39d8bd[_0x1af9('0x25')]:undefined;this['SquareProject']=_0x39d8bd[_0x1af9('0x26')]?_0x39d8bd['SquareProject']:undefined;this[_0x1af9('0x27')]=_0x39d8bd[_0x1af9('0x26')]?_0x39d8bd[_0x1af9('0x26')]['name']:undefined;this[_0x1af9('0x28')]=_0x39d8bd[_0x1af9('0x28')]||![];this['dialAMDInitialSilence']=_0x39d8bd[_0x1af9('0x29')];this[_0x1af9('0x2a')]=_0x39d8bd[_0x1af9('0x2a')];this[_0x1af9('0x2b')]=_0x39d8bd[_0x1af9('0x2b')];this[_0x1af9('0x2c')]=_0x39d8bd[_0x1af9('0x2c')];this[_0x1af9('0x2d')]=_0x39d8bd['dialAMDMinWordLength'];this['dialAMDBetweenWordsSilence']=_0x39d8bd[_0x1af9('0x2e')];this[_0x1af9('0x2f')]=_0x39d8bd[_0x1af9('0x2f')];this['dialAMDSilenceThreshold']=_0x39d8bd[_0x1af9('0x30')];this['dialAMDMaximumWordLength']=_0x39d8bd[_0x1af9('0x31')];}module[_0x1af9('0x32')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 19e87da..cb9877c 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 _0x86be=['connectedlinenum','connectedlinename','accountcode','context','uniqueid','answertime','endtime','unmanaged','abandoned','lastdata','duration','billableseconds','type','tag','disposition','monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','transferType','mohtime','exports','starttime','destinationchannel','calleridnum','calleridname'];(function(_0x1b5d00,_0x29758c){var _0x32ef09=function(_0x454119){while(--_0x454119){_0x1b5d00['push'](_0x1b5d00['shift']());}};_0x32ef09(++_0x29758c);}(_0x86be,0x176));var _0xe86b=function(_0x1f13e5,_0x528c39){_0x1f13e5=_0x1f13e5-0x0;var _0x144e51=_0x86be[_0x1f13e5];return _0x144e51;};'use strict';function Channel(){this[_0xe86b('0x0')]=null;this['channel']='';this[_0xe86b('0x1')]='';this[_0xe86b('0x2')]=0x0;this[_0xe86b('0x3')]='';this[_0xe86b('0x4')]=undefined;this[_0xe86b('0x5')]=undefined;this[_0xe86b('0x6')]=0x0;this[_0xe86b('0x7')]='';this[_0xe86b('0x8')]=0x0;this['linkedid']=0x0;this['exten']=0x0;this['answered']=![];this[_0xe86b('0x9')]=null;this[_0xe86b('0xa')]=null;this[_0xe86b('0xb')]=![];this[_0xe86b('0xc')]=![];this['lastapplication']='';this[_0xe86b('0xd')]='';this[_0xe86b('0xe')]=0x0;this[_0xe86b('0xf')]=0x0;this['holdtime']=0x0;this[_0xe86b('0x10')]=null;this[_0xe86b('0x11')]=null;this[_0xe86b('0x12')]=null;this['monitor']=![];this[_0xe86b('0x13')]=null;this[_0xe86b('0x14')]=null;this[_0xe86b('0x15')]=[];this[_0xe86b('0x16')]=undefined;this[_0xe86b('0x17')]=undefined;this[_0xe86b('0x18')]=undefined;this[_0xe86b('0x19')]=0x0;}module[_0xe86b('0x1a')]=Channel; \ No newline at end of file +var _0x9a2d=['uniqueid','linkedid','exten','answered','answertime','endtime','unmanaged','abandoned','lastapplication','lastdata','duration','billableseconds','holdtime','type','tag','monitorFilename','monitors','transferconnectedlinenum','transferType','mohtime','exports','destinationchannel','calleridname','connectedlinenum','connectedlinename','accountcode','context'];(function(_0x21c8a9,_0x5687f4){var _0x1f8a72=function(_0x54f365){while(--_0x54f365){_0x21c8a9['push'](_0x21c8a9['shift']());}};_0x1f8a72(++_0x5687f4);}(_0x9a2d,0x123));var _0xd9a2=function(_0x1e2c7c,_0x5c5f4f){_0x1e2c7c=_0x1e2c7c-0x0;var _0x4a94b6=_0x9a2d[_0x1e2c7c];return _0x4a94b6;};'use strict';function Channel(){this['starttime']=null;this['channel']='';this[_0xd9a2('0x0')]='';this['calleridnum']=0x0;this[_0xd9a2('0x1')]='';this[_0xd9a2('0x2')]=undefined;this[_0xd9a2('0x3')]=undefined;this[_0xd9a2('0x4')]=0x0;this[_0xd9a2('0x5')]='';this[_0xd9a2('0x6')]=0x0;this[_0xd9a2('0x7')]=0x0;this[_0xd9a2('0x8')]=0x0;this[_0xd9a2('0x9')]=![];this[_0xd9a2('0xa')]=null;this[_0xd9a2('0xb')]=null;this[_0xd9a2('0xc')]=![];this[_0xd9a2('0xd')]=![];this[_0xd9a2('0xe')]='';this[_0xd9a2('0xf')]='';this[_0xd9a2('0x10')]=0x0;this[_0xd9a2('0x11')]=0x0;this[_0xd9a2('0x12')]=0x0;this[_0xd9a2('0x13')]=null;this[_0xd9a2('0x14')]=null;this['disposition']=null;this['monitor']=![];this[_0xd9a2('0x15')]=null;this['queue']=null;this[_0xd9a2('0x16')]=[];this['transfercalleridnum']=undefined;this[_0xd9a2('0x17')]=undefined;this[_0xd9a2('0x18')]=undefined;this[_0xd9a2('0x19')]=0x0;}module[_0xd9a2('0x1a')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 01daa42..4959ea8 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 _0x43b5=['type','Configurations','exports','name','username','remoteUri','authType','consumerKey','consumerSecret','token','tokenSecret'];(function(_0x14d4b1,_0x2256aa){var _0xd91493=function(_0x3df898){while(--_0x3df898){_0x14d4b1['push'](_0x14d4b1['shift']());}};_0xd91493(++_0x2256aa);}(_0x43b5,0x7c));var _0x543b=function(_0x43e35a,_0x2479a4){_0x43e35a=_0x43e35a-0x0;var _0x32ef0b=_0x43b5[_0x43e35a];return _0x32ef0b;};'use strict';function DeskAccount(_0x4f785f){this['id']=_0x4f785f['id']||0x0;this['name']=_0x4f785f[_0x543b('0x0')]||'';this[_0x543b('0x1')]=_0x4f785f[_0x543b('0x1')]||'';this[_0x543b('0x2')]=_0x4f785f[_0x543b('0x2')]||'';this['authType']=_0x4f785f[_0x543b('0x3')]||'';this['password']=_0x4f785f['password']||'';this[_0x543b('0x4')]=_0x4f785f['consumerKey']||'';this[_0x543b('0x5')]=_0x4f785f[_0x543b('0x5')]||'';this[_0x543b('0x6')]=_0x4f785f[_0x543b('0x6')]||'';this[_0x543b('0x7')]=_0x4f785f['tokenSecret']||'';this[_0x543b('0x8')]=_0x4f785f['type']||'';this['serverUrl']=_0x4f785f['serverUrl']||'';this[_0x543b('0x9')]=_0x4f785f['Configurations']||{};}module[_0x543b('0xa')]=DeskAccount; \ No newline at end of file +var _0x33ee=['remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name','username'];(function(_0x1bda95,_0x3e0456){var _0x48461c=function(_0x3f2c93){while(--_0x3f2c93){_0x1bda95['push'](_0x1bda95['shift']());}};_0x48461c(++_0x3e0456);}(_0x33ee,0x73));var _0xe33e=function(_0x4ed4d2,_0x47acf7){_0x4ed4d2=_0x4ed4d2-0x0;var _0x15ae2e=_0x33ee[_0x4ed4d2];return _0x15ae2e;};'use strict';function DeskAccount(_0x4fb574){this['id']=_0x4fb574['id']||0x0;this[_0xe33e('0x0')]=_0x4fb574['name']||'';this[_0xe33e('0x1')]=_0x4fb574[_0xe33e('0x1')]||'';this[_0xe33e('0x2')]=_0x4fb574[_0xe33e('0x2')]||'';this[_0xe33e('0x3')]=_0x4fb574['authType']||'';this['password']=_0x4fb574[_0xe33e('0x4')]||'';this['consumerKey']=_0x4fb574[_0xe33e('0x5')]||'';this['consumerSecret']=_0x4fb574[_0xe33e('0x6')]||'';this[_0xe33e('0x7')]=_0x4fb574[_0xe33e('0x7')]||'';this[_0xe33e('0x8')]=_0x4fb574[_0xe33e('0x8')]||'';this['type']=_0x4fb574[_0xe33e('0x9')]||'';this[_0xe33e('0xa')]=_0x4fb574['serverUrl']||'';this[_0xe33e('0xb')]=_0x4fb574[_0xe33e('0xb')]||{};}module[_0xe33e('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 c523248..ddc0e28 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 _0x2688=['exports','name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider'];(function(_0x1bd323,_0x1c16ab){var _0x13097b=function(_0x4cc5de){while(--_0x4cc5de){_0x1bd323['push'](_0x1bd323['shift']());}};_0x13097b(++_0x1c16ab);}(_0x2688,0x9d));var _0x8268=function(_0x403cff,_0x1cf463){_0x403cff=_0x403cff-0x0;var _0x5a7c56=_0x2688[_0x403cff];return _0x5a7c56;};'use strict';function Dynamics365Account(_0x2d9f66){this['id']=_0x2d9f66['id']||0x0;this[_0x8268('0x0')]=_0x2d9f66['name']||'';this[_0x8268('0x1')]=_0x2d9f66[_0x8268('0x1')]||'';this[_0x8268('0x2')]=_0x2d9f66['password']||'';this[_0x8268('0x3')]=_0x2d9f66[_0x8268('0x3')]||'';this[_0x8268('0x4')]=_0x2d9f66['tenantId']||'';this['clientId']=_0x2d9f66[_0x8268('0x5')]||'';this[_0x8268('0x6')]=_0x2d9f66[_0x8268('0x6')]||{};this[_0x8268('0x7')]=_0x2d9f66[_0x8268('0x7')]||'';this[_0x8268('0x8')]=_0x2d9f66[_0x8268('0x8')]||![];this[_0x8268('0x9')]=_0x2d9f66[_0x8268('0x9')]||{};this[_0x8268('0xa')]=_0x2d9f66[_0x8268('0xa')]||{};}module[_0x8268('0xb')]=Dynamics365Account; \ No newline at end of file +var _0x9a8c=['remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','exports','name','username','password'];(function(_0x44a573,_0x1e6efc){var _0x4babc6=function(_0x5495aa){while(--_0x5495aa){_0x44a573['push'](_0x44a573['shift']());}};_0x4babc6(++_0x1e6efc);}(_0x9a8c,0x159));var _0xc9a8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9a8c[_0x3dd15e];return _0x231fd0;};'use strict';function Dynamics365Account(_0x6bfb6b){this['id']=_0x6bfb6b['id']||0x0;this[_0xc9a8('0x0')]=_0x6bfb6b['name']||'';this['username']=_0x6bfb6b[_0xc9a8('0x1')]||'';this[_0xc9a8('0x2')]=_0x6bfb6b[_0xc9a8('0x2')]||'';this[_0xc9a8('0x3')]=_0x6bfb6b['remoteUri']||'';this['tenantId']=_0x6bfb6b[_0xc9a8('0x4')]||'';this[_0xc9a8('0x5')]=_0x6bfb6b[_0xc9a8('0x5')]||'';this['clientSecret']=_0x6bfb6b[_0xc9a8('0x6')]||{};this[_0xc9a8('0x7')]=_0x6bfb6b[_0xc9a8('0x7')]||'';this[_0xc9a8('0x8')]=_0x6bfb6b[_0xc9a8('0x8')]||![];this[_0xc9a8('0x9')]=_0x6bfb6b['Configurations']||{};this[_0xc9a8('0xa')]=_0x6bfb6b[_0xc9a8('0xa')]||{};}module[_0xc9a8('0xb')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 0b12d94..337c597 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 _0x228d=['description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','Trunk','ListId','key','exports','name'];(function(_0xdceb45,_0x448005){var _0x2d6e0b=function(_0x36310d){while(--_0x36310d){_0xdceb45['push'](_0xdceb45['shift']());}};_0x2d6e0b(++_0x448005);}(_0x228d,0xfe));var _0xd228=function(_0x490be3,_0xf0fca3){_0x490be3=_0x490be3-0x0;var _0x3f5140=_0x228d[_0x490be3];return _0x3f5140;};'use strict';function FaxAccount(_0x259c93){this['id']=_0x259c93['id']||0x0;this[_0xd228('0x0')]=_0x259c93[_0xd228('0x0')]||'';this[_0xd228('0x1')]=_0x259c93['description'];this[_0xd228('0x2')]=_0x259c93[_0xd228('0x2')];this[_0xd228('0x3')]=_0x259c93['headerinfo'];this[_0xd228('0x4')]=_0x259c93[_0xd228('0x4')];this[_0xd228('0x5')]=_0x259c93[_0xd228('0x5')]||0x960;this[_0xd228('0x6')]=_0x259c93[_0xd228('0x6')]||0x3840;this[_0xd228('0x7')]=_0x259c93[_0xd228('0x7')]||_0xd228('0x8');this['gateway']=_0x259c93[_0xd228('0x9')]||'no';this[_0xd228('0xa')]=_0x259c93['faxdetect']||'no';this[_0xd228('0xb')]=_0x259c93['t38timeout']||0x1388;this['tech']=_0x259c93[_0xd228('0xc')]||'SIP';this['Trunk']=_0x259c93[_0xd228('0xd')]?_0x259c93[_0xd228('0xd')]:undefined;this[_0xd228('0xe')]=_0x259c93[_0xd228('0xe')];this[_0xd228('0xf')]=_0x259c93[_0xd228('0xf')];}module[_0xd228('0x10')]=FaxAccount; \ No newline at end of file +var _0x430f=['SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout'];(function(_0xa92559,_0x1d2e45){var _0x502df8=function(_0x3321db){while(--_0x3321db){_0xa92559['push'](_0xa92559['shift']());}};_0x502df8(++_0x1d2e45);}(_0x430f,0xc0));var _0xf430=function(_0x1cbd97,_0xeaccbd){_0x1cbd97=_0x1cbd97-0x0;var _0x96de41=_0x430f[_0x1cbd97];return _0x96de41;};'use strict';function FaxAccount(_0x40376e){this['id']=_0x40376e['id']||0x0;this[_0xf430('0x0')]=_0x40376e[_0xf430('0x0')]||'';this[_0xf430('0x1')]=_0x40376e[_0xf430('0x1')];this[_0xf430('0x2')]=_0x40376e[_0xf430('0x2')];this[_0xf430('0x3')]=_0x40376e[_0xf430('0x3')];this[_0xf430('0x4')]=_0x40376e[_0xf430('0x4')];this[_0xf430('0x5')]=_0x40376e[_0xf430('0x5')]||0x960;this['maxrate']=_0x40376e[_0xf430('0x6')]||0x3840;this[_0xf430('0x7')]=_0x40376e[_0xf430('0x7')]||_0xf430('0x8');this[_0xf430('0x9')]=_0x40376e[_0xf430('0x9')]||'no';this[_0xf430('0xa')]=_0x40376e['faxdetect']||'no';this[_0xf430('0xb')]=_0x40376e[_0xf430('0xb')]||0x1388;this['tech']=_0x40376e['tech']||_0xf430('0xc');this[_0xf430('0xd')]=_0x40376e['Trunk']?_0x40376e[_0xf430('0xd')]:undefined;this[_0xf430('0xe')]=_0x40376e[_0xf430('0xe')];this[_0xf430('0xf')]=_0x40376e[_0xf430('0xf')];}module[_0xf430('0x10')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 8e30401..8072f7f 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 _0x4a59=['username','token','remoteUri','serverUrl','Configurations','name'];(function(_0x344cca,_0x4c2aeb){var _0x279da4=function(_0x153d0d){while(--_0x153d0d){_0x344cca['push'](_0x344cca['shift']());}};_0x279da4(++_0x4c2aeb);}(_0x4a59,0x101));var _0x94a5=function(_0x295c2f,_0x318d48){_0x295c2f=_0x295c2f-0x0;var _0x51a1bb=_0x4a59[_0x295c2f];return _0x51a1bb;};'use strict';function FreshdeskAccount(_0x5713f2){this['id']=_0x5713f2['id']||0x0;this[_0x94a5('0x0')]=_0x5713f2[_0x94a5('0x0')]||'';this[_0x94a5('0x1')]=_0x5713f2['username']||'';this['apiKey']=_0x5713f2[_0x94a5('0x2')]||'';this[_0x94a5('0x3')]=_0x5713f2['remoteUri']||'';this[_0x94a5('0x4')]=_0x5713f2['serverUrl']||'';this[_0x94a5('0x5')]=_0x5713f2[_0x94a5('0x5')]||{};}module['exports']=FreshdeskAccount; \ No newline at end of file +var _0x6a52=['Configurations','exports','name','username','token','remoteUri','serverUrl'];(function(_0x369d88,_0x59fb5b){var _0x2cdc2b=function(_0x434a73){while(--_0x434a73){_0x369d88['push'](_0x369d88['shift']());}};_0x2cdc2b(++_0x59fb5b);}(_0x6a52,0x1d7));var _0x26a5=function(_0x342700,_0x569f75){_0x342700=_0x342700-0x0;var _0x53406f=_0x6a52[_0x342700];return _0x53406f;};'use strict';function FreshdeskAccount(_0x205335){this['id']=_0x205335['id']||0x0;this[_0x26a5('0x0')]=_0x205335[_0x26a5('0x0')]||'';this[_0x26a5('0x1')]=_0x205335[_0x26a5('0x1')]||'';this['apiKey']=_0x205335[_0x26a5('0x2')]||'';this[_0x26a5('0x3')]=_0x205335[_0x26a5('0x3')]||'';this[_0x26a5('0x4')]=_0x205335[_0x26a5('0x4')]||'';this[_0x26a5('0x5')]=_0x205335[_0x26a5('0x5')]||{};}module[_0x26a5('0x6')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 6e62dd3..8121b2a 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 _0x0967=['name','username','apiKey','token','remoteUri','serverUrl','Configurations','exports'];(function(_0x2ed39c,_0x11b4ec){var _0xe23c5c=function(_0x703620){while(--_0x703620){_0x2ed39c['push'](_0x2ed39c['shift']());}};_0xe23c5c(++_0x11b4ec);}(_0x0967,0x100));var _0x7096=function(_0x55165a,_0x1cd33b){_0x55165a=_0x55165a-0x0;var _0x2b364d=_0x0967[_0x55165a];return _0x2b364d;};'use strict';function FreshsalesAccount(_0x448ba5){this['id']=_0x448ba5['id']||0x0;this['name']=_0x448ba5[_0x7096('0x0')]||'';this[_0x7096('0x1')]=_0x448ba5[_0x7096('0x1')]||'';this[_0x7096('0x2')]=_0x448ba5[_0x7096('0x3')]||'';this[_0x7096('0x4')]=_0x448ba5[_0x7096('0x4')]||'';this[_0x7096('0x5')]=_0x448ba5['serverUrl']||'';this[_0x7096('0x6')]=_0x448ba5[_0x7096('0x6')]||{};}module[_0x7096('0x7')]=FreshsalesAccount; \ No newline at end of file +var _0xa992=['remoteUri','serverUrl','Configurations','exports','name','username','apiKey','token'];(function(_0x1e3a61,_0x4e41a9){var _0x1e9103=function(_0x16e32d){while(--_0x16e32d){_0x1e3a61['push'](_0x1e3a61['shift']());}};_0x1e9103(++_0x4e41a9);}(_0xa992,0x18c));var _0x2a99=function(_0x196bdb,_0x517baf){_0x196bdb=_0x196bdb-0x0;var _0x5b6fbf=_0xa992[_0x196bdb];return _0x5b6fbf;};'use strict';function FreshsalesAccount(_0x90172){this['id']=_0x90172['id']||0x0;this[_0x2a99('0x0')]=_0x90172[_0x2a99('0x0')]||'';this[_0x2a99('0x1')]=_0x90172['username']||'';this[_0x2a99('0x2')]=_0x90172[_0x2a99('0x3')]||'';this[_0x2a99('0x4')]=_0x90172[_0x2a99('0x4')]||'';this[_0x2a99('0x5')]=_0x90172[_0x2a99('0x5')]||'';this[_0x2a99('0x6')]=_0x90172[_0x2a99('0x6')]||{};}module[_0x2a99('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 1e380f6..20933da 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 _0x8b4c=['queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallerexitAt','originalposition','channel','connectedlinenum','accountcode','context','priority','assigned','lastAssignedTo','motionChannel','voice','mohtime','variables','exports','type','uniqueid','calleridname','queue'];(function(_0x2ab365,_0xa3812e){var _0x49fef3=function(_0x29b883){while(--_0x29b883){_0x2ab365['push'](_0x2ab365['shift']());}};_0x49fef3(++_0xa3812e);}(_0x8b4c,0x1a5));var _0xc8b4=function(_0xaf9da5,_0x1151cf){_0xaf9da5=_0xaf9da5-0x0;var _0x44b851=_0x8b4c[_0xaf9da5];return _0x44b851;};'use strict';function QueueReport(){this[_0xc8b4('0x0')]='inbound';this[_0xc8b4('0x1')]='';this['calleridnum']='';this[_0xc8b4('0x2')]='';this[_0xc8b4('0x3')]='';this[_0xc8b4('0x4')]=null;this[_0xc8b4('0x5')]=null;this[_0xc8b4('0x6')]=0x1;this[_0xc8b4('0x7')]=0x1;this[_0xc8b4('0x8')]=![];this[_0xc8b4('0x9')]=null;this[_0xc8b4('0xa')]=![];this['queuecallercompleteAt']=null;this['queuecallerexit']=![];this[_0xc8b4('0xb')]=null;this[_0xc8b4('0xc')]=0x1;this[_0xc8b4('0xd')]='';this[_0xc8b4('0xe')]='';this['connectedlinename']='';this[_0xc8b4('0xf')]='';this[_0xc8b4('0x10')]='';this['exten']='';this[_0xc8b4('0x11')]='';this['holdtime']=0x0;this[_0xc8b4('0x12')]=![];this[_0xc8b4('0x13')]='';this[_0xc8b4('0x14')]=_0xc8b4('0x15');this['routealias']=null;this[_0xc8b4('0x16')]=0x0;this[_0xc8b4('0x17')]={};}module[_0xc8b4('0x18')]=QueueReport; \ No newline at end of file +var _0x2412=['variables','exports','inbound','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexitAt','connectedlinename','accountcode','exten','assigned','lastAssignedTo','motionChannel','routealias','mohtime'];(function(_0x556bb1,_0x34830d){var _0x45455f=function(_0x13c6ba){while(--_0x13c6ba){_0x556bb1['push'](_0x556bb1['shift']());}};_0x45455f(++_0x34830d);}(_0x2412,0x113));var _0x2241=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2412[_0x3dd15e];return _0x231fd0;};'use strict';function QueueReport(){this['type']=_0x2241('0x0');this['uniqueid']='';this['calleridnum']='';this[_0x2241('0x1')]='';this[_0x2241('0x2')]='';this[_0x2241('0x3')]=null;this[_0x2241('0x4')]=null;this['position']=0x1;this[_0x2241('0x5')]=0x1;this[_0x2241('0x6')]=![];this[_0x2241('0x7')]=null;this[_0x2241('0x8')]=![];this[_0x2241('0x9')]=null;this['queuecallerexit']=![];this[_0x2241('0xa')]=null;this['originalposition']=0x1;this['channel']='';this['connectedlinenum']='';this[_0x2241('0xb')]='';this[_0x2241('0xc')]='';this['context']='';this[_0x2241('0xd')]='';this['priority']='';this['holdtime']=0x0;this[_0x2241('0xe')]=![];this[_0x2241('0xf')]='';this[_0x2241('0x10')]='voice';this[_0x2241('0x11')]=null;this[_0x2241('0x12')]=0x0;this[_0x2241('0x13')]={};}module[_0x2241('0x14')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index f9c3852..2f30194 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 _0x99b3=['username','remoteUri','password','clientId','clientSecret','securityToken','type','serverUrl','Configurations','exports','name'];(function(_0x163a40,_0x553355){var _0x1f81db=function(_0x3c962b){while(--_0x3c962b){_0x163a40['push'](_0x163a40['shift']());}};_0x1f81db(++_0x553355);}(_0x99b3,0xe6));var _0x399b=function(_0x1ce3cc,_0x4f0bfa){_0x1ce3cc=_0x1ce3cc-0x0;var _0x1de825=_0x99b3[_0x1ce3cc];return _0x1de825;};'use strict';function SalesforceAccount(_0x2143bb){this['id']=_0x2143bb['id']||0x0;this[_0x399b('0x0')]=_0x2143bb[_0x399b('0x0')]||'';this[_0x399b('0x1')]=_0x2143bb[_0x399b('0x1')]||'';this[_0x399b('0x2')]=_0x2143bb['remoteUri']||'';this[_0x399b('0x3')]=_0x2143bb[_0x399b('0x3')]||'';this[_0x399b('0x4')]=_0x2143bb[_0x399b('0x4')]||'';this[_0x399b('0x5')]=_0x2143bb['clientSecret']||'';this[_0x399b('0x6')]=_0x2143bb[_0x399b('0x6')]||'';this[_0x399b('0x7')]=_0x2143bb[_0x399b('0x7')]||'integrationTab';this[_0x399b('0x8')]=_0x2143bb['serverUrl']||'';this[_0x399b('0x9')]=_0x2143bb[_0x399b('0x9')]||{};}module[_0x399b('0xa')]=SalesforceAccount; \ No newline at end of file +var _0x4f00=['clientSecret','securityToken','type','serverUrl','Configurations','exports','name','username','remoteUri','password','clientId'];(function(_0x47c63d,_0x190ff9){var _0x33d744=function(_0x48716a){while(--_0x48716a){_0x47c63d['push'](_0x47c63d['shift']());}};_0x33d744(++_0x190ff9);}(_0x4f00,0x1ea));var _0x04f0=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0x4f00[_0x4fc9e6];return _0x551d28;};'use strict';function SalesforceAccount(_0x2249c6){this['id']=_0x2249c6['id']||0x0;this[_0x04f0('0x0')]=_0x2249c6[_0x04f0('0x0')]||'';this[_0x04f0('0x1')]=_0x2249c6[_0x04f0('0x1')]||'';this['remoteUri']=_0x2249c6[_0x04f0('0x2')]||'';this[_0x04f0('0x3')]=_0x2249c6['password']||'';this['clientId']=_0x2249c6[_0x04f0('0x4')]||'';this['clientSecret']=_0x2249c6[_0x04f0('0x5')]||'';this[_0x04f0('0x6')]=_0x2249c6['securityToken']||'';this[_0x04f0('0x7')]=_0x2249c6[_0x04f0('0x7')]||'integrationTab';this[_0x04f0('0x8')]=_0x2249c6['serverUrl']||'';this[_0x04f0('0x9')]=_0x2249c6[_0x04f0('0x9')]||{};}module[_0x04f0('0xa')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 4fbcfe7..f4eebf4 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 _0x89fb=['name','username','password','remoteUri','serverUrl','Configurations','exports'];(function(_0x37bf43,_0x5b2339){var _0x4101c5=function(_0x382432){while(--_0x382432){_0x37bf43['push'](_0x37bf43['shift']());}};_0x4101c5(++_0x5b2339);}(_0x89fb,0x12d));var _0xb89f=function(_0x59ef22,_0x4cb5d8){_0x59ef22=_0x59ef22-0x0;var _0x51eaf2=_0x89fb[_0x59ef22];return _0x51eaf2;};'use strict';function ServicenowAccount(_0x15cd92){this['id']=_0x15cd92['id']||0x0;this[_0xb89f('0x0')]=_0x15cd92[_0xb89f('0x0')]||'';this[_0xb89f('0x1')]=_0x15cd92[_0xb89f('0x1')]||'';this[_0xb89f('0x2')]=_0x15cd92[_0xb89f('0x2')]||'';this[_0xb89f('0x3')]=_0x15cd92[_0xb89f('0x3')]||'';this[_0xb89f('0x4')]=_0x15cd92[_0xb89f('0x4')]||'';this[_0xb89f('0x5')]=_0x15cd92[_0xb89f('0x5')]||{};}module[_0xb89f('0x6')]=ServicenowAccount; \ No newline at end of file +var _0x777b=['exports','name','username','password','remoteUri','serverUrl','Configurations'];(function(_0x2ccd3b,_0x2adf19){var _0x268d18=function(_0x3d2f34){while(--_0x3d2f34){_0x2ccd3b['push'](_0x2ccd3b['shift']());}};_0x268d18(++_0x2adf19);}(_0x777b,0x174));var _0xb777=function(_0x32c3d1,_0x119349){_0x32c3d1=_0x32c3d1-0x0;var _0x4142a3=_0x777b[_0x32c3d1];return _0x4142a3;};'use strict';function ServicenowAccount(_0x11c9f){this['id']=_0x11c9f['id']||0x0;this[_0xb777('0x0')]=_0x11c9f[_0xb777('0x0')]||'';this[_0xb777('0x1')]=_0x11c9f['username']||'';this[_0xb777('0x2')]=_0x11c9f[_0xb777('0x2')]||'';this[_0xb777('0x3')]=_0x11c9f[_0xb777('0x3')]||'';this[_0xb777('0x4')]=_0x11c9f[_0xb777('0x4')]||'';this[_0xb777('0x5')]=_0x11c9f[_0xb777('0x5')]||{};}module[_0xb777('0x6')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 87ded4f..8c9b702 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 _0x3231=['name','username','password','remoteUri','Configurations','exports'];(function(_0x10a143,_0x3b7828){var _0x3773c1=function(_0x2d4d07){while(--_0x2d4d07){_0x10a143['push'](_0x10a143['shift']());}};_0x3773c1(++_0x3b7828);}(_0x3231,0x198));var _0x1323=function(_0x2ae7bd,_0x555795){_0x2ae7bd=_0x2ae7bd-0x0;var _0x2d65c5=_0x3231[_0x2ae7bd];return _0x2d65c5;};'use strict';function SugarcrmAccount(_0x2aefa2){this['id']=_0x2aefa2['id']||0x0;this['name']=_0x2aefa2[_0x1323('0x0')]||'';this[_0x1323('0x1')]=_0x2aefa2['username']||'';this['password']=_0x2aefa2[_0x1323('0x2')]||'';this['remoteUri']=_0x2aefa2[_0x1323('0x3')]||'';this['serverUrl']=_0x2aefa2['serverUrl']||'';this[_0x1323('0x4')]=_0x2aefa2[_0x1323('0x4')]||{};}module[_0x1323('0x5')]=SugarcrmAccount; \ No newline at end of file +var _0xd1ca=['remoteUri','serverUrl','Configurations','exports','name','username','password'];(function(_0x1773f8,_0x409491){var _0x438134=function(_0x23f1ee){while(--_0x23f1ee){_0x1773f8['push'](_0x1773f8['shift']());}};_0x438134(++_0x409491);}(_0xd1ca,0xc8));var _0xad1c=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0xd1ca[_0xaa1b3e];return _0x454d7d;};'use strict';function SugarcrmAccount(_0x1e8fd8){this['id']=_0x1e8fd8['id']||0x0;this[_0xad1c('0x0')]=_0x1e8fd8[_0xad1c('0x0')]||'';this['username']=_0x1e8fd8[_0xad1c('0x1')]||'';this[_0xad1c('0x2')]=_0x1e8fd8[_0xad1c('0x2')]||'';this[_0xad1c('0x3')]=_0x1e8fd8[_0xad1c('0x3')]||'';this[_0xad1c('0x4')]=_0x1e8fd8[_0xad1c('0x4')]||'';this[_0xad1c('0x5')]=_0x1e8fd8[_0xad1c('0x5')]||{};}module[_0xad1c('0x6')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index a4468f3..ed58f74 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 _0xe0c0=['accountcode','state','stateTime','status','unknown','exports','name'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0xe0c0,0xa7));var _0x0e0c=function(_0x10c443,_0x5062e1){_0x10c443=_0x10c443-0x0;var _0x50fb5c=_0xe0c0[_0x10c443];return _0x50fb5c;};'use strict';function Telephone(_0x47f2e2){this['id']=_0x47f2e2['id']||0x0;this['name']=_0x47f2e2[_0x0e0c('0x0')]||'';this[_0x0e0c('0x1')]=_0x47f2e2[_0x0e0c('0x1')]||'';this[_0x0e0c('0x2')]='unknown';this[_0x0e0c('0x3')]=0x0;this[_0x0e0c('0x4')]=_0x0e0c('0x5');this['address']='';}module[_0x0e0c('0x6')]=Telephone; \ No newline at end of file +var _0xbdd4=['unknown','stateTime','address','exports','name','accountcode'];(function(_0x1b708e,_0x2fdfd9){var _0x16c16d=function(_0x2bdc69){while(--_0x2bdc69){_0x1b708e['push'](_0x1b708e['shift']());}};_0x16c16d(++_0x2fdfd9);}(_0xbdd4,0x14e));var _0x4bdd=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xbdd4[_0x618414];return _0x21c19a;};'use strict';function Telephone(_0x559ebb){this['id']=_0x559ebb['id']||0x0;this['name']=_0x559ebb[_0x4bdd('0x0')]||'';this[_0x4bdd('0x1')]=_0x559ebb['accountcode']||'';this['state']=_0x4bdd('0x2');this[_0x4bdd('0x3')]=0x0;this['status']=_0x4bdd('0x2');this[_0x4bdd('0x4')]='';}module[_0x4bdd('0x5')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index ac531b9..165cbb7 100644 --- a/server/services/ami/model/template.js +++ b/server/services/ami/model/template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['name','html'];(function(_0x342023,_0x1a06c0){var _0x440456=function(_0x19fa7c){while(--_0x19fa7c){_0x342023['push'](_0x342023['shift']());}};_0x440456(++_0x1a06c0);}(_0xb10b,0x12a));var _0xbb10=function(_0x382a62,_0x1baa5e){_0x382a62=_0x382a62-0x0;var _0x490a25=_0xb10b[_0x382a62];return _0x490a25;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template; \ No newline at end of file +var _0xa9e0=['exports','name'];(function(_0x1b151a,_0x3f03d7){var _0x1e560d=function(_0x366146){while(--_0x366146){_0x1b151a['push'](_0x1b151a['shift']());}};_0x1e560d(++_0x3f03d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index bcf6f1e..42678b3 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 _0x9ffd=['Actions','exports','name','channel','voice','status','AllConditions','AnyConditions'];(function(_0x39d615,_0x2b289e){var _0x4999e6=function(_0x8a5a65){while(--_0x8a5a65){_0x39d615['push'](_0x39d615['shift']());}};_0x4999e6(++_0x2b289e);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x30f2f9,_0x3f4767){_0x30f2f9=_0x30f2f9-0x0;var _0x2650bb=_0x9ffd[_0x30f2f9];return _0x2650bb;};'use strict';function Trigger(_0x4c26a1){this['id']=_0x4c26a1['id']||0x0;this[_0xd9ff('0x0')]=_0x4c26a1[_0xd9ff('0x0')]||'';this['channel']=_0x4c26a1[_0xd9ff('0x1')]||_0xd9ff('0x2');this[_0xd9ff('0x3')]=_0x4c26a1[_0xd9ff('0x3')]||![];this['AllConditions']=_0x4c26a1[_0xd9ff('0x4')]||[];this[_0xd9ff('0x5')]=_0x4c26a1['AnyConditions']||[];this[_0xd9ff('0x6')]=_0x4c26a1[_0xd9ff('0x6')]||[];}module[_0xd9ff('0x7')]=Trigger; \ No newline at end of file +var _0xbaf0=['Actions','exports','name','channel','voice','status','AllConditions','AnyConditions'];(function(_0x296923,_0x4adaed){var _0x29af70=function(_0x4eeedb){while(--_0x4eeedb){_0x296923['push'](_0x296923['shift']());}};_0x29af70(++_0x4adaed);}(_0xbaf0,0x12a));var _0x0baf=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xbaf0[_0xa464c9];return _0x3d73c4;};'use strict';function Trigger(_0x61caa9){this['id']=_0x61caa9['id']||0x0;this[_0x0baf('0x0')]=_0x61caa9[_0x0baf('0x0')]||'';this[_0x0baf('0x1')]=_0x61caa9[_0x0baf('0x1')]||_0x0baf('0x2');this[_0x0baf('0x3')]=_0x61caa9['status']||![];this[_0x0baf('0x4')]=_0x61caa9[_0x0baf('0x4')]||[];this[_0x0baf('0x5')]=_0x61caa9[_0x0baf('0x5')]||[];this[_0x0baf('0x6')]=_0x61caa9[_0x0baf('0x6')]||[];}module[_0x0baf('0x7')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 594df1e..6e58b7d 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 _0xf006=['address','defaultuser','exports','active','name','state','unknown','stateTime','status','registry','indexOf','host','port','domain','stateRegistry','registrationtime'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xf006,0x1a3));var _0x6f00=function(_0x8139d1,_0x13b26d){_0x8139d1=_0x8139d1-0x0;var _0x5e94d6=_0xf006[_0x8139d1];return _0x5e94d6;};'use strict';function Trunk(_0xfda141){this['id']=_0xfda141['id']||0x0;this['active']=_0xfda141[_0x6f00('0x0')]||![];this[_0x6f00('0x1')]=_0xfda141[_0x6f00('0x1')]||'';this[_0x6f00('0x2')]=_0x6f00('0x3');this[_0x6f00('0x4')]=0x0;this[_0x6f00('0x5')]='unknown';this['registry']=_0xfda141[_0x6f00('0x6')]&&_0xfda141[_0x6f00('0x6')][_0x6f00('0x7')](':')?_0xfda141['registry']['split'](':')[0x0]:'';this[_0x6f00('0x8')]='';this[_0x6f00('0x9')]='';this[_0x6f00('0xa')]='';this['domainport']='';this['refresh']='';this[_0x6f00('0xb')]='unknown';this[_0x6f00('0xc')]='';this[_0x6f00('0xd')]='';this[_0x6f00('0xe')]=_0xfda141[_0x6f00('0xe')]||'';}module[_0x6f00('0xf')]=Trunk; \ No newline at end of file +var _0x7fb2=['state','stateTime','status','unknown','registry','host','port','domain','domainport','refresh','stateRegistry','registrationtime','address','defaultuser','exports','active','name'];(function(_0x421196,_0x1cbd94){var _0x2738af=function(_0xc956ff){while(--_0xc956ff){_0x421196['push'](_0x421196['shift']());}};_0x2738af(++_0x1cbd94);}(_0x7fb2,0x1b8));var _0x27fb=function(_0x169e60,_0x38c51b){_0x169e60=_0x169e60-0x0;var _0x4e62e8=_0x7fb2[_0x169e60];return _0x4e62e8;};'use strict';function Trunk(_0x2eb0f2){this['id']=_0x2eb0f2['id']||0x0;this[_0x27fb('0x0')]=_0x2eb0f2[_0x27fb('0x0')]||![];this[_0x27fb('0x1')]=_0x2eb0f2[_0x27fb('0x1')]||'';this[_0x27fb('0x2')]='unknown';this[_0x27fb('0x3')]=0x0;this[_0x27fb('0x4')]=_0x27fb('0x5');this['registry']=_0x2eb0f2[_0x27fb('0x6')]&&_0x2eb0f2[_0x27fb('0x6')]['indexOf'](':')?_0x2eb0f2[_0x27fb('0x6')]['split'](':')[0x0]:'';this[_0x27fb('0x7')]='';this[_0x27fb('0x8')]='';this[_0x27fb('0x9')]='';this[_0x27fb('0xa')]='';this[_0x27fb('0xb')]='';this[_0x27fb('0xc')]=_0x27fb('0x5');this[_0x27fb('0xd')]='';this[_0x27fb('0xe')]='';this[_0x27fb('0xf')]=_0x2eb0f2[_0x27fb('0xf')]||'';}module[_0x27fb('0x10')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index b7e3b94..bffdd50 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 _0xf944=['exports','exten','mandatoryDisposition'];(function(_0x2ade6c,_0x2d42f2){var _0x2cb372=function(_0x477d8a){while(--_0x477d8a){_0x2ade6c['push'](_0x2ade6c['shift']());}};_0x2cb372(++_0x2d42f2);}(_0xf944,0x124));var _0x4f94=function(_0x508481,_0x5729b1){_0x508481=_0x508481-0x0;var _0x45c16e=_0xf944[_0x508481];return _0x45c16e;};'use strict';function voiceExtension(_0x23a286){this['id']=_0x23a286['id']||0x0;this['exten']=_0x23a286[_0x4f94('0x0')]||'';this['recordingFormat']=_0x23a286['recordingFormat']||'none';this[_0x4f94('0x1')]=_0x23a286['mandatoryDisposition']||![];}module[_0x4f94('0x2')]=voiceExtension; \ No newline at end of file +var _0x8c85=['exten','recordingFormat','none','mandatoryDisposition','exports'];(function(_0x49d19d,_0x245cf5){var _0x4ebef1=function(_0xf0a4e6){while(--_0xf0a4e6){_0x49d19d['push'](_0x49d19d['shift']());}};_0x4ebef1(++_0x245cf5);}(_0x8c85,0xa5));var _0x58c8=function(_0x108112,_0x52bf4c){_0x108112=_0x108112-0x0;var _0x3ecea8=_0x8c85[_0x108112];return _0x3ecea8;};'use strict';function voiceExtension(_0x392794){this['id']=_0x392794['id']||0x0;this[_0x58c8('0x0')]=_0x392794[_0x58c8('0x0')]||'';this[_0x58c8('0x1')]=_0x392794['recordingFormat']||_0x58c8('0x2');this[_0x58c8('0x3')]=_0x392794[_0x58c8('0x3')]||![];}module[_0x58c8('0x4')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index f45f4c5..09e874a 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 _0xdfae=['predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','wav49','fewestcalls','leastrecent','roundrobin','rrmemory','rrordered','wrandom','name','monitor_format','type','inbound','waiting','total','answered','sumBillable','unmanaged','inUse','invalid','loggedIn','notInUse','onHold','paused','ringing','ringInUse','talking','unavailable','unknown','acw','acwTimeout','autopause','statusMessage','originated','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','handlePredictive','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses'];(function(_0x4b4277,_0x22676f){var _0x1ff405=function(_0x2fa9e2){while(--_0x2fa9e2){_0x4b4277['push'](_0x4b4277['shift']());}};_0x1ff405(++_0x22676f);}(_0xdfae,0x18d));var _0xedfa=function(_0x569fef,_0x49c37a){_0x569fef=_0x569fef-0x0;var _0x11f20b=_0xdfae[_0x569fef];return _0x11f20b;};'use strict';var monitorFormat={'wav':'wav','wav49':_0xedfa('0x0'),'gsm':'gsm'};var strategy={'fewestcalls':_0xedfa('0x1'),'leastrecent':_0xedfa('0x2'),'linear':'linear','random':'random','ringall':'ringall','rr':_0xedfa('0x3'),'rrmemory':_0xedfa('0x4'),'rrordered':_0xedfa('0x5'),'wrandom':_0xedfa('0x6')};function VoiceQueue(_0x28ff52){this['id']=_0x28ff52['id']||0x0;this[_0xedfa('0x7')]=_0x28ff52[_0xedfa('0x7')]||'';this[_0xedfa('0x8')]=_0x28ff52[_0xedfa('0x8')]||'';this[_0xedfa('0x9')]=_0x28ff52[_0xedfa('0x9')]||_0xedfa('0xa');this[_0xedfa('0xb')]=0x0;this[_0xedfa('0xc')]=0x0;this[_0xedfa('0xd')]=0x0;this['sumDuration']=0x0;this['sumHoldTime']=0x0;this[_0xedfa('0xe')]=0x0;this[_0xedfa('0xf')]=0x0;this['abandoned']=0x0;this['available']=0x0;this['busy']=0x0;this[_0xedfa('0x10')]=0x0;this[_0xedfa('0x11')]=0x0;this[_0xedfa('0x12')]=0x0;this[_0xedfa('0x13')]=0x0;this[_0xedfa('0x14')]=0x0;this[_0xedfa('0x15')]=0x0;this[_0xedfa('0x16')]=0x0;this[_0xedfa('0x17')]=0x0;this[_0xedfa('0x18')]=0x0;this[_0xedfa('0x19')]=0x0;this[_0xedfa('0x1a')]=0x0;this[_0xedfa('0x1b')]=_0x28ff52[_0xedfa('0x1b')]||![];this[_0xedfa('0x1c')]=_0x28ff52[_0xedfa('0x1c')]||0xa;this['autopause']=_0x28ff52[_0xedfa('0x1d')]||'no';this['sendMessageOneNotActive']=!![];this['message']='';this[_0xedfa('0x1e')]='';this[_0xedfa('0x1f')]=0x0;this['temp']=0x0;this[_0xedfa('0x20')]=_0x28ff52[_0xedfa('0x20')]||null;this['dialGlobalInterval']=_0x28ff52[_0xedfa('0x21')]?_0x28ff52[_0xedfa('0x21')]:null;this[_0xedfa('0x22')]=_0x28ff52[_0xedfa('0x22')];this[_0xedfa('0x23')]=_0x28ff52[_0xedfa('0x23')]||_0xedfa('0x24');this[_0xedfa('0x25')]=_0x28ff52['dialLimitChannel']||0x0;this[_0xedfa('0x26')]=_0x28ff52[_0xedfa('0x26')]||0x0;this[_0xedfa('0x27')]=_0x28ff52[_0xedfa('0x27')]||0x1;this[_0xedfa('0x28')]=_0x28ff52['dialPredictiveOptimization']||_0xedfa('0x29');this[_0xedfa('0x2a')]=_0x28ff52[_0xedfa('0x2a')]||0.03;this[_0xedfa('0x2b')]=_0x28ff52[_0xedfa('0x2b')]||0x258;this[_0xedfa('0x2c')]=_0x28ff52[_0xedfa('0x2c')]||'anonymous';this[_0xedfa('0x2d')]=_0x28ff52[_0xedfa('0x2d')]||_0xedfa('0x2e');this[_0xedfa('0x2f')]=_0x28ff52['dialOriginateTimeout']||0x1e;this[_0xedfa('0x30')]=_0x28ff52[_0xedfa('0x30')]||'tTxX';this[_0xedfa('0x31')]=_0x28ff52[_0xedfa('0x31')]||0x3;this[_0xedfa('0x32')]=_0x28ff52[_0xedfa('0x32')]||undefined;this[_0xedfa('0x33')]=_0x28ff52['dialCongestionMaxRetry']||0x3;this['dialCongestionRetryFrequency']=_0x28ff52['dialCongestionRetryFrequency']||0x96;this[_0xedfa('0x34')]=_0x28ff52['dialBusyMaxRetry']||0x3;this[_0xedfa('0x35')]=_0x28ff52[_0xedfa('0x35')]||0x96;this[_0xedfa('0x36')]=_0x28ff52['dialNoAnswerMaxRetry']||0x3;this[_0xedfa('0x37')]=_0x28ff52[_0xedfa('0x37')]||0x96;this[_0xedfa('0x38')]=_0x28ff52['dialNoSuchNumberMaxRetry']||0x3;this[_0xedfa('0x39')]=_0x28ff52['dialNoSuchNumberRetryFrequency']||0x96;this[_0xedfa('0x3a')]=_0x28ff52[_0xedfa('0x3a')]||0x3;this['dialDropRetryFrequency']=_0x28ff52[_0xedfa('0x3b')]||0x96;this[_0xedfa('0x3c')]=_0x28ff52[_0xedfa('0x3c')]||0x3;this[_0xedfa('0x3d')]=_0x28ff52[_0xedfa('0x3d')]||0x96;this['dialMachineMaxRetry']=_0x28ff52[_0xedfa('0x3e')]||0x3;this['dialMachineRetryFrequency']=_0x28ff52[_0xedfa('0x3f')]||0x96;this[_0xedfa('0x40')]=_0x28ff52[_0xedfa('0x40')]||0x3;this[_0xedfa('0x41')]=_0x28ff52['dialAgentRejectRetryFrequency']||0x96;this['callAdditionalPhoneAfterMin']=_0x28ff52[_0xedfa('0x42')]||0x3;this[_0xedfa('0x43')]=_0x28ff52[_0xedfa('0x43')]||0x4;this[_0xedfa('0x44')]=_0x28ff52['Trunk']?_0x28ff52[_0xedfa('0x44')]:undefined;this[_0xedfa('0x45')]=_0x28ff52['TrunkBackup']?_0x28ff52[_0xedfa('0x45')]:undefined;this['dialPrefix']=_0x28ff52[_0xedfa('0x46')]||undefined;this['Interval']=_0x28ff52['Interval']?_0x28ff52[_0xedfa('0x47')]:undefined;this[_0xedfa('0x48')]=_0x28ff52[_0xedfa('0x48')]||'DESC';this['dialRandomLastDigitCallerIdNumber']=_0x28ff52[_0xedfa('0x49')]||undefined;this['dialCutDigit']=_0x28ff52[_0xedfa('0x4a')]||undefined;this[_0xedfa('0x4b')]=strategy[_0x28ff52[_0xedfa('0x4b')]];this[_0xedfa('0x4c')]=!![];this[_0xedfa('0x4d')]=_0x28ff52[_0xedfa('0x4d')]||![];this[_0xedfa('0x4e')]=_0x28ff52[_0xedfa('0x4e')];this['dialAMDGreeting']=_0x28ff52['dialAMDGreeting'];this['dialAMDAfterGreetingSilence']=_0x28ff52['dialAMDAfterGreetingSilence'];this[_0xedfa('0x4f')]=_0x28ff52[_0xedfa('0x4f')];this[_0xedfa('0x50')]=_0x28ff52['dialAMDMinWordLength'];this['dialAMDBetweenWordsSilence']=_0x28ff52['dialAMDBetweenWordsSilence'];this[_0xedfa('0x51')]=_0x28ff52['dialAMDMaximumNumberOfWords'];this[_0xedfa('0x52')]=_0x28ff52[_0xedfa('0x52')];this[_0xedfa('0x53')]=_0x28ff52[_0xedfa('0x53')];this[_0xedfa('0x54')]=0x0;this[_0xedfa('0x55')]=0x0;this[_0xedfa('0x56')]=_0x28ff52['timeout'];this[_0xedfa('0x57')]=0x0;this[_0xedfa('0x58')]=0x0;this[_0xedfa('0x59')]=0x0;this[_0xedfa('0x5a')]=0x0;this[_0xedfa('0x5b')]=0x0;this[_0xedfa('0x5c')]=0x0;this[_0xedfa('0x5d')]=0x0;this['outboundBlacklistCallsDay']=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0xedfa('0x5e')]=0x0;this[_0xedfa('0x5f')]=0x0;this[_0xedfa('0x60')]=0x0;this[_0xedfa('0x61')]=0x0;this[_0xedfa('0x62')]=0x0;this[_0xedfa('0x63')]=undefined;this['startPredictive']=undefined;this[_0xedfa('0x64')]=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0xedfa('0x65')]=0x0;this[_0xedfa('0x66')]=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0xedfa('0x67')]=0x0;this[_0xedfa('0x68')]=0x0;this[_0xedfa('0x69')]=0x0;this[_0xedfa('0x6a')]=0x0;this[_0xedfa('0x6b')]=0x0;this[_0xedfa('0x6c')]=_0x28ff52['dialPredictiveIntervalMaxThreshold']||0x14;this['predictiveIntervalMinThreshold']=_0x28ff52[_0xedfa('0x6d')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this[_0xedfa('0x6e')]=0x1;this[_0xedfa('0x6f')]=0x0;this[_0xedfa('0x70')]=0x0;this[_0xedfa('0x71')]=0x0;this[_0xedfa('0x72')]=0x0;this[_0xedfa('0x73')]=_0x28ff52['dialRecallMeTimeout']||0x1e;this[_0xedfa('0x74')]=_0x28ff52[_0xedfa('0x74')]||![];this[_0xedfa('0x75')]=!!_0x28ff52['dialPreviewAutoRecallMe']||![];this[_0xedfa('0x76')]=!!_0x28ff52[_0xedfa('0x76')]||![];this[_0xedfa('0x77')]=_0x28ff52[_0xedfa('0x77')]||undefined;this[_0xedfa('0x78')]=_0x28ff52[_0xedfa('0x78')]||![];this['dialAgiAfterHangupAgent']=_0x28ff52[_0xedfa('0x79')]||![];this['monitor_format']=monitorFormat[_0x28ff52[_0xedfa('0x8')]]?monitorFormat[_0x28ff52[_0xedfa('0x8')]]:undefined;this['mandatoryDisposition']=_0x28ff52[_0xedfa('0x7a')]||![];this[_0xedfa('0x7b')]=_0x28ff52[_0xedfa('0x7b')]?_0x28ff52[_0xedfa('0x7b')]:undefined;this[_0xedfa('0x7c')]=![];}module[_0xedfa('0x7d')]=VoiceQueue; \ No newline at end of file +var _0xc765=['notInUse','onHold','paused','ringing','unavailable','unknown','acw','acwTimeout','sendMessageOneNotActive','statusMessage','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalPauses','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','wav','wav49','gsm','fewestcalls','leastrecent','linear','random','ringall','rrmemory','rrordered','wrandom','name','monitor_format','type','inbound','sumHoldTime','unmanaged','abandoned','available','busy','inUse','invalid','loggedIn'];(function(_0x9cb284,_0x44fa6c){var _0x33b219=function(_0x1d3a0d){while(--_0x1d3a0d){_0x9cb284['push'](_0x9cb284['shift']());}};_0x33b219(++_0x44fa6c);}(_0xc765,0xf5));var _0x5c76=function(_0x57de17,_0x59767e){_0x57de17=_0x57de17-0x0;var _0xf7a636=_0xc765[_0x57de17];return _0xf7a636;};'use strict';var monitorFormat={'wav':_0x5c76('0x0'),'wav49':_0x5c76('0x1'),'gsm':_0x5c76('0x2')};var strategy={'fewestcalls':_0x5c76('0x3'),'leastrecent':_0x5c76('0x4'),'linear':_0x5c76('0x5'),'random':_0x5c76('0x6'),'ringall':_0x5c76('0x7'),'rr':'roundrobin','rrmemory':_0x5c76('0x8'),'rrordered':_0x5c76('0x9'),'wrandom':_0x5c76('0xa')};function VoiceQueue(_0x7ae090){this['id']=_0x7ae090['id']||0x0;this[_0x5c76('0xb')]=_0x7ae090[_0x5c76('0xb')]||'';this[_0x5c76('0xc')]=_0x7ae090[_0x5c76('0xc')]||'';this['type']=_0x7ae090[_0x5c76('0xd')]||_0x5c76('0xe');this['waiting']=0x0;this['total']=0x0;this['answered']=0x0;this['sumDuration']=0x0;this[_0x5c76('0xf')]=0x0;this['sumBillable']=0x0;this[_0x5c76('0x10')]=0x0;this[_0x5c76('0x11')]=0x0;this[_0x5c76('0x12')]=0x0;this[_0x5c76('0x13')]=0x0;this[_0x5c76('0x14')]=0x0;this[_0x5c76('0x15')]=0x0;this[_0x5c76('0x16')]=0x0;this[_0x5c76('0x17')]=0x0;this[_0x5c76('0x18')]=0x0;this[_0x5c76('0x19')]=0x0;this[_0x5c76('0x1a')]=0x0;this['ringInUse']=0x0;this['talking']=0x0;this[_0x5c76('0x1b')]=0x0;this[_0x5c76('0x1c')]=0x0;this[_0x5c76('0x1d')]=_0x7ae090[_0x5c76('0x1d')]||![];this['acwTimeout']=_0x7ae090[_0x5c76('0x1e')]||0xa;this['autopause']=_0x7ae090['autopause']||'no';this[_0x5c76('0x1f')]=!![];this['message']='';this[_0x5c76('0x20')]='';this[_0x5c76('0x21')]=0x0;this[_0x5c76('0x22')]=0x0;this['dialTimezone']=_0x7ae090[_0x5c76('0x23')]||null;this[_0x5c76('0x24')]=_0x7ae090[_0x5c76('0x24')]?_0x7ae090[_0x5c76('0x24')]:null;this[_0x5c76('0x25')]=_0x7ae090[_0x5c76('0x25')];this[_0x5c76('0x26')]=_0x7ae090[_0x5c76('0x26')]||_0x5c76('0x27');this[_0x5c76('0x28')]=_0x7ae090[_0x5c76('0x28')]||0x0;this[_0x5c76('0x29')]=_0x7ae090[_0x5c76('0x29')]||0x0;this[_0x5c76('0x2a')]=_0x7ae090[_0x5c76('0x2a')]||0x1;this[_0x5c76('0x2b')]=_0x7ae090['dialPredictiveOptimization']||_0x5c76('0x2c');this['dialPredictiveOptimizationPercentage']=_0x7ae090[_0x5c76('0x2d')]||0.03;this[_0x5c76('0x2e')]=_0x7ae090[_0x5c76('0x2e')]||0x258;this[_0x5c76('0x2f')]=_0x7ae090[_0x5c76('0x2f')]||'anonymous';this['dialOriginateCallerIdNumber']=_0x7ae090[_0x5c76('0x30')]||_0x5c76('0x31');this[_0x5c76('0x32')]=_0x7ae090['dialOriginateTimeout']||0x1e;this[_0x5c76('0x33')]=_0x7ae090[_0x5c76('0x33')]||_0x5c76('0x34');this[_0x5c76('0x35')]=_0x7ae090['dialQueueTimeout']||0x3;this[_0x5c76('0x36')]=_0x7ae090['dialQueueProject']||undefined;this[_0x5c76('0x37')]=_0x7ae090['dialCongestionMaxRetry']||0x3;this[_0x5c76('0x38')]=_0x7ae090[_0x5c76('0x38')]||0x96;this['dialBusyMaxRetry']=_0x7ae090[_0x5c76('0x39')]||0x3;this['dialBusyRetryFrequency']=_0x7ae090['dialBusyRetryFrequency']||0x96;this[_0x5c76('0x3a')]=_0x7ae090['dialNoAnswerMaxRetry']||0x3;this['dialNoAnswerRetryFrequency']=_0x7ae090[_0x5c76('0x3b')]||0x96;this['dialNoSuchNumberMaxRetry']=_0x7ae090[_0x5c76('0x3c')]||0x3;this[_0x5c76('0x3d')]=_0x7ae090[_0x5c76('0x3d')]||0x96;this[_0x5c76('0x3e')]=_0x7ae090['dialDropMaxRetry']||0x3;this[_0x5c76('0x3f')]=_0x7ae090[_0x5c76('0x3f')]||0x96;this[_0x5c76('0x40')]=_0x7ae090['dialAbandonedMaxRetry']||0x3;this['dialAbandonedRetryFrequency']=_0x7ae090[_0x5c76('0x41')]||0x96;this[_0x5c76('0x42')]=_0x7ae090[_0x5c76('0x42')]||0x3;this[_0x5c76('0x43')]=_0x7ae090[_0x5c76('0x43')]||0x96;this[_0x5c76('0x44')]=_0x7ae090[_0x5c76('0x44')]||0x3;this['dialAgentRejectRetryFrequency']=_0x7ae090[_0x5c76('0x45')]||0x96;this[_0x5c76('0x46')]=_0x7ae090[_0x5c76('0x46')]||0x3;this[_0x5c76('0x47')]=_0x7ae090['dialGlobalMaxRetry']||0x4;this['Trunk']=_0x7ae090[_0x5c76('0x48')]?_0x7ae090['Trunk']:undefined;this[_0x5c76('0x49')]=_0x7ae090[_0x5c76('0x49')]?_0x7ae090[_0x5c76('0x49')]:undefined;this['dialPrefix']=_0x7ae090[_0x5c76('0x4a')]||undefined;this['Interval']=_0x7ae090[_0x5c76('0x4b')]?_0x7ae090[_0x5c76('0x4b')]:undefined;this[_0x5c76('0x4c')]=_0x7ae090[_0x5c76('0x4c')]||_0x5c76('0x4d');this[_0x5c76('0x4e')]=_0x7ae090[_0x5c76('0x4e')]||undefined;this[_0x5c76('0x4f')]=_0x7ae090[_0x5c76('0x4f')]||undefined;this[_0x5c76('0x50')]=strategy[_0x7ae090[_0x5c76('0x50')]];this[_0x5c76('0x51')]=!![];this[_0x5c76('0x52')]=_0x7ae090[_0x5c76('0x52')]||![];this['dialAMDInitialSilence']=_0x7ae090['dialAMDInitialSilence'];this[_0x5c76('0x53')]=_0x7ae090[_0x5c76('0x53')];this[_0x5c76('0x54')]=_0x7ae090[_0x5c76('0x54')];this[_0x5c76('0x55')]=_0x7ae090[_0x5c76('0x55')];this[_0x5c76('0x56')]=_0x7ae090[_0x5c76('0x56')];this[_0x5c76('0x57')]=_0x7ae090[_0x5c76('0x57')];this[_0x5c76('0x58')]=_0x7ae090[_0x5c76('0x58')];this[_0x5c76('0x59')]=_0x7ae090[_0x5c76('0x59')];this[_0x5c76('0x5a')]=_0x7ae090[_0x5c76('0x5a')];this[_0x5c76('0x5b')]=0x0;this[_0x5c76('0x5c')]=0x0;this[_0x5c76('0x5d')]=_0x7ae090[_0x5c76('0x5d')];this[_0x5c76('0x5e')]=0x0;this[_0x5c76('0x5f')]=0x0;this[_0x5c76('0x60')]=0x0;this[_0x5c76('0x61')]=0x0;this[_0x5c76('0x62')]=0x0;this[_0x5c76('0x63')]=0x0;this[_0x5c76('0x64')]=0x0;this[_0x5c76('0x65')]=0x0;this[_0x5c76('0x66')]=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0x5c76('0x67')]=0x0;this[_0x5c76('0x68')]=0x0;this[_0x5c76('0x69')]=0x0;this[_0x5c76('0x6a')]=0x0;this[_0x5c76('0x6b')]=undefined;this[_0x5c76('0x6c')]=undefined;this[_0x5c76('0x6d')]=undefined;this[_0x5c76('0x6e')]=1.05;this[_0x5c76('0x6f')]=0x0;this[_0x5c76('0x70')]=0x0;this[_0x5c76('0x71')]=0x0;this[_0x5c76('0x72')]=0x0;this[_0x5c76('0x73')]=0x0;this['predictiveIntervalAvgTalktime']=0x0;this[_0x5c76('0x74')]=0x0;this['predictiveIntervalAvailable']=0x0;this[_0x5c76('0x75')]=_0x7ae090[_0x5c76('0x76')]||0x14;this[_0x5c76('0x77')]=_0x7ae090[_0x5c76('0x76')]||0xa;this[_0x5c76('0x78')]=0x0;this[_0x5c76('0x79')]=0x0;this[_0x5c76('0x7a')]=0x1;this[_0x5c76('0x7b')]=0x0;this[_0x5c76('0x7c')]=0x0;this[_0x5c76('0x7d')]=0x0;this['erlangBusyFactor']=0x0;this['dialRecallMeTimeout']=_0x7ae090['dialRecallMeTimeout']||0x1e;this[_0x5c76('0x7e')]=_0x7ae090['dialRecallInQueue']||![];this[_0x5c76('0x7f')]=!!_0x7ae090[_0x5c76('0x7f')]||![];this[_0x5c76('0x80')]=!!_0x7ae090['dialPreviewRecallmeReminder']||![];this[_0x5c76('0x81')]=_0x7ae090[_0x5c76('0x81')]||undefined;this['dialAgiAfterHangupClient']=_0x7ae090['dialAgiAfterHangupClient']||![];this[_0x5c76('0x82')]=_0x7ae090[_0x5c76('0x82')]||![];this[_0x5c76('0xc')]=monitorFormat[_0x7ae090['monitor_format']]?monitorFormat[_0x7ae090[_0x5c76('0xc')]]:undefined;this['mandatoryDisposition']=_0x7ae090[_0x5c76('0x83')]||![];this[_0x5c76('0x84')]=_0x7ae090[_0x5c76('0x84')]?_0x7ae090[_0x5c76('0x84')]:undefined;this['queueSummaryCountersUpdated']=![];}module[_0x5c76('0x85')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueueSummary.js b/server/services/ami/model/voiceQueueSummary.js index c728f07..47245fa 100644 --- a/server/services/ami/model/voiceQueueSummary.js +++ b/server/services/ami/model/voiceQueueSummary.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa7e6=['erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','callerid','createReport','loggedin','callers','length','SIP/','incall','includes','status','booked','keys','dialer','exten','xcally-motion-preview','some','prototype','active','updateReportFromOutboundQueue','preview','exports','available','loggedIn','loggedInDb','paused','ringing','talking','answered','inUse','outboundAbandonedCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','sumBillable','sumDuration','total','waiting','name','strategy','abandoned','busy','invalid','onHold','notInUse','ringInUse','sumHoldTime','type','unavailable','unknown','unmanaged','outbound','pTalking','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','originated'];(function(_0x17bb31,_0x2fc6f8){var _0x505c71=function(_0x5013cf){while(--_0x5013cf){_0x17bb31['push'](_0x17bb31['shift']());}};_0x505c71(++_0x2fc6f8);}(_0xa7e6,0x74));var _0x6a7e=function(_0x4d554d,_0x4e7503){_0x4d554d=_0x4d554d-0x0;var _0x3cf518=_0xa7e6[_0x4d554d];return _0x3cf518;};'use strict';var INBOUND_COUNTERS=[_0x6a7e('0x0'),_0x6a7e('0x1'),_0x6a7e('0x2'),_0x6a7e('0x3'),_0x6a7e('0x4'),_0x6a7e('0x5'),'waiting'];var OUTBOUND_COUNTERS=[_0x6a7e('0x0'),_0x6a7e('0x6'),_0x6a7e('0x7'),_0x6a7e('0x1'),_0x6a7e('0x2'),'originated',_0x6a7e('0x8'),_0x6a7e('0x9'),_0x6a7e('0xa'),_0x6a7e('0xb'),_0x6a7e('0xc'),_0x6a7e('0xd'),_0x6a7e('0xe'),_0x6a7e('0xf'),_0x6a7e('0x10'),'outboundUnknownCallsDay','paused','pTalking','talking',_0x6a7e('0x11'),_0x6a7e('0x12'),_0x6a7e('0x13'),_0x6a7e('0x14')];function VoiceQueueSummary(_0x76015b){this['id']=_0x76015b['id'];this['name']=_0x76015b[_0x6a7e('0x15')];this[_0x6a7e('0x16')]=_0x76015b['strategy'];this['abandoned']=_0x76015b[_0x6a7e('0x17')]||0x0;this[_0x6a7e('0x6')]=_0x76015b[_0x6a7e('0x6')]||0x0;this[_0x6a7e('0x0')]=_0x76015b['available']||0x0;this[_0x6a7e('0x18')]=_0x76015b[_0x6a7e('0x18')]||0x0;this[_0x6a7e('0x7')]=_0x76015b[_0x6a7e('0x7')]||0x0;this[_0x6a7e('0x19')]=_0x76015b['invalid']||0x0;this[_0x6a7e('0x1')]=_0x76015b['loggedIn']||0x0;this['loggedInDb']=_0x76015b[_0x6a7e('0x2')]||0x0;this['onHold']=_0x76015b[_0x6a7e('0x1a')]||0x0;this[_0x6a7e('0x1b')]=_0x76015b[_0x6a7e('0x1b')]||0x0;this[_0x6a7e('0x3')]=_0x76015b[_0x6a7e('0x3')]||0x0;this['ringing']=_0x76015b['ringing']||0x0;this['ringInUse']=_0x76015b[_0x6a7e('0x1c')];this[_0x6a7e('0x11')]=_0x76015b[_0x6a7e('0x11')];this[_0x6a7e('0x12')]=_0x76015b[_0x6a7e('0x12')];this[_0x6a7e('0x1d')]=_0x76015b[_0x6a7e('0x1d')]||0x0;this[_0x6a7e('0x5')]=_0x76015b['talking']||0x0;this[_0x6a7e('0x13')]=_0x76015b[_0x6a7e('0x13')]||0x0;this['type']=_0x76015b[_0x6a7e('0x1e')];this[_0x6a7e('0x1f')]=_0x76015b[_0x6a7e('0x1f')]||0x0;this['unknown']=_0x76015b[_0x6a7e('0x20')]||0x0;this[_0x6a7e('0x21')]=_0x76015b['unmanaged']||0x0;this[_0x6a7e('0x14')]=_0x76015b['waiting']||0x0;if(_0x76015b[_0x6a7e('0x1e')]===_0x6a7e('0x22')){this['pTalking']=_0x76015b[_0x6a7e('0x23')]||0x0;this[_0x6a7e('0x24')]=_0x76015b[_0x6a7e('0x24')];this[_0x6a7e('0x25')]=_0x76015b[_0x6a7e('0x25')];this[_0x6a7e('0x26')]=_0x76015b['dialOriginateCallerIdName'];this[_0x6a7e('0x27')]=_0x76015b[_0x6a7e('0x27')];this[_0x6a7e('0x28')]=_0x76015b[_0x6a7e('0x28')];this[_0x6a7e('0x29')]=_0x76015b['dialPrefix'];this['temp']=_0x76015b[_0x6a7e('0x2a')];this[_0x6a7e('0x2b')]=_0x76015b[_0x6a7e('0x2b')];this['outboundAnswerCallsDay']=_0x76015b[_0x6a7e('0x9')];this['outboundBlacklistCallsDay']=_0x76015b[_0x6a7e('0xa')];this['outboundBusyCallsDay']=_0x76015b['outboundBusyCallsDay'];this[_0x6a7e('0xc')]=_0x76015b['outboundCongestionCallsDay'];this[_0x6a7e('0x2c')]=_0x76015b['outboundDropCallsDayACS'];this['outboundDropCallsDayCallersExit']=_0x76015b[_0x6a7e('0x2d')];this[_0x6a7e('0x2e')]=_0x76015b[_0x6a7e('0x2e')];this[_0x6a7e('0xd')]=_0x76015b[_0x6a7e('0xd')];this[_0x6a7e('0xe')]=_0x76015b[_0x6a7e('0xe')];this[_0x6a7e('0x2f')]=_0x76015b[_0x6a7e('0x2f')];this[_0x6a7e('0xf')]=_0x76015b[_0x6a7e('0xf')];this[_0x6a7e('0x10')]=_0x76015b['outboundRejectCallsDay'];this[_0x6a7e('0x30')]=_0x76015b[_0x6a7e('0x30')];this[_0x6a7e('0x31')]=_0x76015b['predictiveIntervalAnsweredCalls'];this[_0x6a7e('0x32')]=_0x76015b[_0x6a7e('0x32')];this[_0x6a7e('0x33')]=_0x76015b[_0x6a7e('0x33')];this[_0x6a7e('0x34')]=_0x76015b[_0x6a7e('0x34')];this['predictiveIntervalDroppedCallsTimeout']=_0x76015b['predictiveIntervalDroppedCallsTimeout'];this[_0x6a7e('0x35')]=_0x76015b['predictiveIntervalErlangCalls'];this[_0x6a7e('0x36')]=_0x76015b[_0x6a7e('0x36')];this['predictiveIntervalHitRate']=_0x76015b['predictiveIntervalHitRate'];this['predictiveIntervalMultiplicativeFactor']=_0x76015b[_0x6a7e('0x37')];this['predictiveIntervalPauses']=_0x76015b['predictiveIntervalPauses'];this['predictiveIntervalAvailable']=_0x76015b['predictiveIntervalAvailable'];this[_0x6a7e('0x38')]=_0x76015b['predictiveIntervalTotalCalls'];this[_0x6a7e('0x39')]=_0x76015b[_0x6a7e('0x39')];this[_0x6a7e('0x3a')]=_0x76015b[_0x6a7e('0x3a')];this[_0x6a7e('0x3b')]=_0x76015b['erlangCallToSecond'];this[_0x6a7e('0x3c')]=_0x76015b[_0x6a7e('0x3c')];this['erlangBusyFactor']=_0x76015b[_0x6a7e('0x3d')];this[_0x6a7e('0x3e')]=_0x76015b['startPredictive'];this[_0x6a7e('0x3f')]=_0x76015b[_0x6a7e('0x3f')];this[_0x6a7e('0x40')]=_0x76015b[_0x6a7e('0x40')];this[_0x6a7e('0x41')]=_0x76015b[_0x6a7e('0x41')];}if(_0x76015b[_0x6a7e('0x42')]){this[_0x6a7e('0x42')]={'id':_0x76015b[_0x6a7e('0x42')]['id'],'name':_0x76015b[_0x6a7e('0x42')][_0x6a7e('0x15')],'active':_0x76015b['Trunk']['active'],'callerid':_0x76015b[_0x6a7e('0x42')][_0x6a7e('0x43')]};}}VoiceQueueSummary['prototype'][_0x6a7e('0x44')]=function(_0x46799d,_0x96ec4b,_0x361c9e,_0x3219ca){this[_0x6a7e('0x2')]=0x0;this[_0x6a7e('0x5')]=0x0;this[_0x6a7e('0x3')]=0x0;this[_0x6a7e('0x20')]=0x0;this[_0x6a7e('0x1b')]=0x0;this[_0x6a7e('0x7')]=0x0;this[_0x6a7e('0x18')]=0x0;this[_0x6a7e('0x19')]=0x0;this[_0x6a7e('0x1f')]=0x0;this['ringing']=0x0;this['ringInUse']=0x0;this[_0x6a7e('0x1a')]=0x0;if(_0x361c9e){if(_0x361c9e[_0x6a7e('0x0')]){this[_0x6a7e('0x0')]=Number(_0x361c9e[_0x6a7e('0x0')]);}if(_0x361c9e[_0x6a7e('0x45')]){this[_0x6a7e('0x1')]=Number(_0x361c9e[_0x6a7e('0x45')]);}if(_0x361c9e[_0x6a7e('0x46')]){this['waiting']=Number(_0x361c9e[_0x6a7e('0x46')]);}}for(var _0x479680=0x0;_0x479680<_0x46799d[_0x6a7e('0x47')];_0x479680++){var _0x2f87ea=_0x96ec4b[_0x6a7e('0x48')+_0x46799d[_0x479680][_0x6a7e('0x15')]];if(_0x2f87ea&&_0x2f87ea['online']){this[_0x6a7e('0x2')]+=0x1;}if(_0x46799d[_0x479680][_0x6a7e('0x49')]==='1'){this[_0x6a7e('0x5')]+=0x1;}if(_0x46799d[_0x479680]['paused']==='1'&&!['2','7','8'][_0x6a7e('0x4a')](_0x46799d[_0x479680]['status'])){this[_0x6a7e('0x3')]+=0x1;}switch(_0x46799d[_0x479680][_0x6a7e('0x4b')]){case'0':this[_0x6a7e('0x20')]+=0x1;break;case'1':this[_0x6a7e('0x1b')]+=0x1;break;case'2':this['inUse']+=0x1;break;case'3':this[_0x6a7e('0x18')]+=0x1;break;case'4':this[_0x6a7e('0x19')]+=0x1;break;case'5':this[_0x6a7e('0x1f')]+=0x1;break;case'6':this[_0x6a7e('0x4')]+=0x1;break;case'7':this['ringInUse']+=0x1;break;case'8':this[_0x6a7e('0x1a')]+=0x1;break;}}if(this['dialMethod']===_0x6a7e('0x4c')){var _0xdc536a=Object[_0x6a7e('0x4d')](_0x3219ca);for(var _0x4a7465=0x0;_0x4a7465<_0xdc536a[_0x6a7e('0x47')];_0x4a7465++){var _0x58f58b=_0xdc536a[_0x4a7465];var _0x5ba1bd=_0x3219ca[_0x58f58b];if(_0x5ba1bd['queue']===this[_0x6a7e('0x15')]&&_0x5ba1bd[_0x6a7e('0x1e')]===_0x6a7e('0x4e')&&_0x5ba1bd[_0x6a7e('0x4f')]===_0x6a7e('0x50')){this[_0x6a7e('0x5')]+=0x1;}}if(this['talking']>this[_0x6a7e('0x7')]){this[_0x6a7e('0x5')]=this[_0x6a7e('0x7')];}this[_0x6a7e('0x23')]=0x0;}return this;};VoiceQueueSummary['prototype']['compareToInboundQueue']=function(_0x2d72f5){var _0x2b0890=![];if(_0x2d72f5){_0x2b0890=INBOUND_COUNTERS[_0x6a7e('0x51')](function(_0x251076){return this[_0x251076]!==_0x2d72f5[_0x251076];},this);}return _0x2b0890;};VoiceQueueSummary[_0x6a7e('0x52')]['compareToOutboundQueue']=function(_0x121007){var _0x9c42af=![];var _0xe1b38e=![];var _0x367b8b=![];if(_0x121007){_0x9c42af=this['dialMethod']!==_0x121007['dialMethod']||this[_0x6a7e('0x24')]!==_0x121007[_0x6a7e('0x24')]||this['message']!==_0x121007[_0x6a7e('0x40')]||this[_0x6a7e('0x41')]!==_0x121007[_0x6a7e('0x41')];_0xe1b38e=OUTBOUND_COUNTERS[_0x6a7e('0x51')](function(_0x653f76){return this[_0x653f76]!==_0x121007[_0x653f76];},this);if(this[_0x6a7e('0x42')]&&_0x121007[_0x6a7e('0x42')]){_0x367b8b=this[_0x6a7e('0x42')]['name']!==_0x121007[_0x6a7e('0x42')][_0x6a7e('0x15')]||this[_0x6a7e('0x42')][_0x6a7e('0x53')]!==_0x121007[_0x6a7e('0x42')]['active'];}}return _0x9c42af||_0xe1b38e||_0x367b8b;};VoiceQueueSummary[_0x6a7e('0x52')][_0x6a7e('0x54')]=function(_0xfbb2ae){this[_0x6a7e('0x6')]=_0xfbb2ae[_0x6a7e('0x6')];this['message']=_0xfbb2ae[_0x6a7e('0x40')];this[_0x6a7e('0x41')]=_0xfbb2ae[_0x6a7e('0x41')];this[_0x6a7e('0x39')]=_0xfbb2ae['originated'];this[_0x6a7e('0x8')]=_0xfbb2ae[_0x6a7e('0x8')];this[_0x6a7e('0x9')]=_0xfbb2ae[_0x6a7e('0x9')];this[_0x6a7e('0xa')]=_0xfbb2ae[_0x6a7e('0xa')];this['outboundBusyCallsDay']=_0xfbb2ae[_0x6a7e('0xb')];this[_0x6a7e('0xc')]=_0xfbb2ae[_0x6a7e('0xc')];this[_0x6a7e('0xd')]=_0xfbb2ae[_0x6a7e('0xd')];this['outboundNoSuchCallsDay']=_0xfbb2ae[_0x6a7e('0xe')];this[_0x6a7e('0xf')]=_0xfbb2ae[_0x6a7e('0xf')];this[_0x6a7e('0x10')]=_0xfbb2ae['outboundRejectCallsDay'];this[_0x6a7e('0x30')]=_0xfbb2ae['outboundUnknownCallsDay'];this['sumBillable']=_0xfbb2ae['sumBillable'];this[_0x6a7e('0x12')]=_0xfbb2ae[_0x6a7e('0x12')];this['total']=_0xfbb2ae[_0x6a7e('0x13')];if(this[_0x6a7e('0x25')]===_0x6a7e('0x55')){this['pTalking']=_0xfbb2ae[_0x6a7e('0x23')];}};module[_0x6a7e('0x56')]=VoiceQueueSummary; \ No newline at end of file +var _0x15b2=['outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoAnswerCallsDay','outboundReCallsDay','outboundRejectCallsDay','pTalking','sumDuration','name','abandoned','busy','invalid','onHold','notInUse','ringInUse','sumHoldTime','talking','total','type','unknown','unmanaged','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','statusMessage','Trunk','active','prototype','unavailable','loggedin','callers','online','incall','includes','status','booked','length','queue','dialer','xcally-motion-preview','some','compareToOutboundQueue','message','updateReportFromOutboundQueue','sumBillable','preview','exports','loggedIn','paused','ringing','waiting','available','answered','inUse','loggedInDb','outboundAbandonedCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay'];(function(_0x51b95c,_0xb9d6e1){var _0x3bcf1d=function(_0x2ee790){while(--_0x2ee790){_0x51b95c['push'](_0x51b95c['shift']());}};_0x3bcf1d(++_0xb9d6e1);}(_0x15b2,0x145));var _0x215b=function(_0xd89bb6,_0x296bc9){_0xd89bb6=_0xd89bb6-0x0;var _0x15b345=_0x15b2[_0xd89bb6];return _0x15b345;};'use strict';var INBOUND_COUNTERS=['available',_0x215b('0x0'),'loggedInDb',_0x215b('0x1'),_0x215b('0x2'),'talking',_0x215b('0x3')];var OUTBOUND_COUNTERS=[_0x215b('0x4'),_0x215b('0x5'),_0x215b('0x6'),'loggedIn',_0x215b('0x7'),'originated',_0x215b('0x8'),_0x215b('0x9'),_0x215b('0xa'),_0x215b('0xb'),_0x215b('0xc'),_0x215b('0xd'),'outboundNoSuchCallsDay',_0x215b('0xe'),_0x215b('0xf'),'outboundUnknownCallsDay',_0x215b('0x1'),_0x215b('0x10'),'talking','sumBillable',_0x215b('0x11'),'total',_0x215b('0x3')];function VoiceQueueSummary(_0x1f217a){this['id']=_0x1f217a['id'];this['name']=_0x1f217a[_0x215b('0x12')];this['strategy']=_0x1f217a['strategy'];this[_0x215b('0x13')]=_0x1f217a['abandoned']||0x0;this[_0x215b('0x5')]=_0x1f217a['answered']||0x0;this[_0x215b('0x4')]=_0x1f217a[_0x215b('0x4')]||0x0;this[_0x215b('0x14')]=_0x1f217a['busy']||0x0;this['inUse']=_0x1f217a['inUse']||0x0;this[_0x215b('0x15')]=_0x1f217a[_0x215b('0x15')]||0x0;this[_0x215b('0x0')]=_0x1f217a[_0x215b('0x0')]||0x0;this[_0x215b('0x7')]=_0x1f217a[_0x215b('0x7')]||0x0;this[_0x215b('0x16')]=_0x1f217a['onHold']||0x0;this[_0x215b('0x17')]=_0x1f217a[_0x215b('0x17')]||0x0;this[_0x215b('0x1')]=_0x1f217a[_0x215b('0x1')]||0x0;this[_0x215b('0x2')]=_0x1f217a[_0x215b('0x2')]||0x0;this[_0x215b('0x18')]=_0x1f217a[_0x215b('0x18')];this['sumBillable']=_0x1f217a['sumBillable'];this[_0x215b('0x11')]=_0x1f217a['sumDuration'];this[_0x215b('0x19')]=_0x1f217a[_0x215b('0x19')]||0x0;this[_0x215b('0x1a')]=_0x1f217a[_0x215b('0x1a')]||0x0;this[_0x215b('0x1b')]=_0x1f217a[_0x215b('0x1b')]||0x0;this[_0x215b('0x1c')]=_0x1f217a[_0x215b('0x1c')];this['unavailable']=_0x1f217a['unavailable']||0x0;this[_0x215b('0x1d')]=_0x1f217a['unknown']||0x0;this[_0x215b('0x1e')]=_0x1f217a[_0x215b('0x1e')]||0x0;this['waiting']=_0x1f217a[_0x215b('0x3')]||0x0;if(_0x1f217a['type']===_0x215b('0x1f')){this[_0x215b('0x10')]=_0x1f217a[_0x215b('0x10')]||0x0;this[_0x215b('0x20')]=_0x1f217a[_0x215b('0x20')];this[_0x215b('0x21')]=_0x1f217a[_0x215b('0x21')];this[_0x215b('0x22')]=_0x1f217a['dialOriginateCallerIdName'];this[_0x215b('0x23')]=_0x1f217a[_0x215b('0x23')];this['dialOriginateTimeout']=_0x1f217a[_0x215b('0x24')];this[_0x215b('0x25')]=_0x1f217a[_0x215b('0x25')];this['temp']=_0x1f217a[_0x215b('0x26')];this[_0x215b('0x27')]=_0x1f217a[_0x215b('0x27')];this[_0x215b('0x9')]=_0x1f217a[_0x215b('0x9')];this[_0x215b('0xa')]=_0x1f217a['outboundBlacklistCallsDay'];this[_0x215b('0xb')]=_0x1f217a[_0x215b('0xb')];this[_0x215b('0xc')]=_0x1f217a[_0x215b('0xc')];this['outboundDropCallsDayACS']=_0x1f217a['outboundDropCallsDayACS'];this['outboundDropCallsDayCallersExit']=_0x1f217a['outboundDropCallsDayCallersExit'];this['outboundDropCallsDayTimeout']=_0x1f217a[_0x215b('0x28')];this[_0x215b('0xd')]=_0x1f217a[_0x215b('0xd')];this[_0x215b('0x29')]=_0x1f217a['outboundNoSuchCallsDay'];this['outboundOriginateFailureCallsDay']=_0x1f217a['outboundOriginateFailureCallsDay'];this[_0x215b('0xe')]=_0x1f217a['outboundReCallsDay'];this['outboundRejectCallsDay']=_0x1f217a[_0x215b('0xf')];this[_0x215b('0x2a')]=_0x1f217a[_0x215b('0x2a')];this['predictiveIntervalAnsweredCalls']=_0x1f217a[_0x215b('0x2b')];this[_0x215b('0x2c')]=_0x1f217a['predictiveIntervalAvgHoldtime'];this['predictiveIntervalAvgTalktime']=_0x1f217a[_0x215b('0x2d')];this['predictiveIntervalDroppedCallsCallersExit']=_0x1f217a[_0x215b('0x2e')];this['predictiveIntervalDroppedCallsTimeout']=_0x1f217a['predictiveIntervalDroppedCallsTimeout'];this[_0x215b('0x2f')]=_0x1f217a[_0x215b('0x2f')];this[_0x215b('0x30')]=_0x1f217a['predictiveIntervalErlangCallsDroppedCalls'];this[_0x215b('0x31')]=_0x1f217a['predictiveIntervalHitRate'];this['predictiveIntervalMultiplicativeFactor']=_0x1f217a[_0x215b('0x32')];this[_0x215b('0x33')]=_0x1f217a[_0x215b('0x33')];this[_0x215b('0x34')]=_0x1f217a[_0x215b('0x34')];this[_0x215b('0x35')]=_0x1f217a['predictiveIntervalTotalCalls'];this[_0x215b('0x36')]=_0x1f217a[_0x215b('0x36')];this['erlangCalls']=_0x1f217a[_0x215b('0x37')];this[_0x215b('0x38')]=_0x1f217a[_0x215b('0x38')];this[_0x215b('0x39')]=_0x1f217a['erlangAbandonmentRate'];this[_0x215b('0x3a')]=_0x1f217a[_0x215b('0x3a')];this[_0x215b('0x3b')]=_0x1f217a[_0x215b('0x3b')];this[_0x215b('0x3c')]=_0x1f217a[_0x215b('0x3c')];this['message']=_0x1f217a['message'];this[_0x215b('0x3d')]=_0x1f217a[_0x215b('0x3d')];}if(_0x1f217a['Trunk']){this[_0x215b('0x3e')]={'id':_0x1f217a[_0x215b('0x3e')]['id'],'name':_0x1f217a[_0x215b('0x3e')]['name'],'active':_0x1f217a[_0x215b('0x3e')][_0x215b('0x3f')],'callerid':_0x1f217a[_0x215b('0x3e')]['callerid']};}}VoiceQueueSummary[_0x215b('0x40')]['createReport']=function(_0x5b366d,_0x3f49b8,_0x44e38d,_0x2ef64a){this['loggedInDb']=0x0;this[_0x215b('0x1a')]=0x0;this[_0x215b('0x1')]=0x0;this[_0x215b('0x1d')]=0x0;this[_0x215b('0x17')]=0x0;this['inUse']=0x0;this[_0x215b('0x14')]=0x0;this[_0x215b('0x15')]=0x0;this[_0x215b('0x41')]=0x0;this[_0x215b('0x2')]=0x0;this[_0x215b('0x18')]=0x0;this['onHold']=0x0;if(_0x44e38d){if(_0x44e38d[_0x215b('0x4')]){this['available']=Number(_0x44e38d[_0x215b('0x4')]);}if(_0x44e38d['loggedin']){this[_0x215b('0x0')]=Number(_0x44e38d[_0x215b('0x42')]);}if(_0x44e38d[_0x215b('0x43')]){this[_0x215b('0x3')]=Number(_0x44e38d[_0x215b('0x43')]);}}for(var _0x4ca7c4=0x0;_0x4ca7c4<_0x5b366d['length'];_0x4ca7c4++){var _0x35769e=_0x3f49b8['SIP/'+_0x5b366d[_0x4ca7c4][_0x215b('0x12')]];if(_0x35769e&&_0x35769e[_0x215b('0x44')]){this[_0x215b('0x7')]+=0x1;}if(_0x5b366d[_0x4ca7c4][_0x215b('0x45')]==='1'){this['talking']+=0x1;}if(_0x5b366d[_0x4ca7c4][_0x215b('0x1')]==='1'&&!['2','7','8'][_0x215b('0x46')](_0x5b366d[_0x4ca7c4][_0x215b('0x47')])){this['paused']+=0x1;}switch(_0x5b366d[_0x4ca7c4][_0x215b('0x47')]){case'0':this[_0x215b('0x1d')]+=0x1;break;case'1':this[_0x215b('0x17')]+=0x1;break;case'2':this[_0x215b('0x6')]+=0x1;break;case'3':this['busy']+=0x1;break;case'4':this[_0x215b('0x15')]+=0x1;break;case'5':this['unavailable']+=0x1;break;case'6':this[_0x215b('0x2')]+=0x1;break;case'7':this[_0x215b('0x18')]+=0x1;break;case'8':this['onHold']+=0x1;break;}}if(this[_0x215b('0x21')]===_0x215b('0x48')){var _0x4c0907=Object['keys'](_0x2ef64a);for(var _0x3ee566=0x0;_0x3ee566<_0x4c0907[_0x215b('0x49')];_0x3ee566++){var _0x33a520=_0x4c0907[_0x3ee566];var _0x56caac=_0x2ef64a[_0x33a520];if(_0x56caac[_0x215b('0x4a')]===this[_0x215b('0x12')]&&_0x56caac[_0x215b('0x1c')]===_0x215b('0x4b')&&_0x56caac['exten']===_0x215b('0x4c')){this['talking']+=0x1;}}if(this[_0x215b('0x1a')]>this[_0x215b('0x6')]){this[_0x215b('0x1a')]=this['inUse'];}this[_0x215b('0x10')]=0x0;}return this;};VoiceQueueSummary[_0x215b('0x40')]['compareToInboundQueue']=function(_0x535f37){var _0x2f93f9=![];if(_0x535f37){_0x2f93f9=INBOUND_COUNTERS[_0x215b('0x4d')](function(_0x4fb7f7){return this[_0x4fb7f7]!==_0x535f37[_0x4fb7f7];},this);}return _0x2f93f9;};VoiceQueueSummary[_0x215b('0x40')][_0x215b('0x4e')]=function(_0x3504e5){var _0x30ea6a=![];var _0x428215=![];var _0x2bcbd3=![];if(_0x3504e5){_0x30ea6a=this[_0x215b('0x21')]!==_0x3504e5['dialMethod']||this['dialActive']!==_0x3504e5[_0x215b('0x20')]||this[_0x215b('0x4f')]!==_0x3504e5['message']||this[_0x215b('0x3d')]!==_0x3504e5[_0x215b('0x3d')];_0x428215=OUTBOUND_COUNTERS[_0x215b('0x4d')](function(_0x2aab55){return this[_0x2aab55]!==_0x3504e5[_0x2aab55];},this);if(this[_0x215b('0x3e')]&&_0x3504e5['Trunk']){_0x2bcbd3=this[_0x215b('0x3e')][_0x215b('0x12')]!==_0x3504e5[_0x215b('0x3e')]['name']||this[_0x215b('0x3e')][_0x215b('0x3f')]!==_0x3504e5[_0x215b('0x3e')]['active'];}}return _0x30ea6a||_0x428215||_0x2bcbd3;};VoiceQueueSummary['prototype'][_0x215b('0x50')]=function(_0x57df0e){this[_0x215b('0x5')]=_0x57df0e['answered'];this[_0x215b('0x4f')]=_0x57df0e['message'];this[_0x215b('0x3d')]=_0x57df0e[_0x215b('0x3d')];this['originated']=_0x57df0e[_0x215b('0x36')];this['outboundAbandonedCallsDay']=_0x57df0e[_0x215b('0x8')];this[_0x215b('0x9')]=_0x57df0e[_0x215b('0x9')];this[_0x215b('0xa')]=_0x57df0e['outboundBlacklistCallsDay'];this[_0x215b('0xb')]=_0x57df0e['outboundBusyCallsDay'];this[_0x215b('0xc')]=_0x57df0e[_0x215b('0xc')];this[_0x215b('0xd')]=_0x57df0e[_0x215b('0xd')];this['outboundNoSuchCallsDay']=_0x57df0e['outboundNoSuchCallsDay'];this[_0x215b('0xe')]=_0x57df0e[_0x215b('0xe')];this[_0x215b('0xf')]=_0x57df0e[_0x215b('0xf')];this[_0x215b('0x2a')]=_0x57df0e[_0x215b('0x2a')];this[_0x215b('0x51')]=_0x57df0e[_0x215b('0x51')];this[_0x215b('0x11')]=_0x57df0e['sumDuration'];this[_0x215b('0x1b')]=_0x57df0e[_0x215b('0x1b')];if(this[_0x215b('0x21')]===_0x215b('0x52')){this[_0x215b('0x10')]=_0x57df0e[_0x215b('0x10')];}};module[_0x215b('0x53')]=VoiceQueueSummary; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index b41a45b..919b530 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 _0xef26=['username','accessKey','remoteUri','serverUrl','Configurations','name'];(function(_0x5c5dc2,_0x3e4860){var _0x52a6bb=function(_0x58f756){while(--_0x58f756){_0x5c5dc2['push'](_0x5c5dc2['shift']());}};_0x52a6bb(++_0x3e4860);}(_0xef26,0x71));var _0x6ef2=function(_0x50528e,_0xf5c1b9){_0x50528e=_0x50528e-0x0;var _0xcd5e4=_0xef26[_0x50528e];return _0xcd5e4;};'use strict';function VtigerAccount(_0x3a3c19){this['id']=_0x3a3c19['id']||0x0;this[_0x6ef2('0x0')]=_0x3a3c19[_0x6ef2('0x0')]||'';this[_0x6ef2('0x1')]=_0x3a3c19[_0x6ef2('0x1')]||'';this[_0x6ef2('0x2')]=_0x3a3c19[_0x6ef2('0x2')]||'';this['remoteUri']=_0x3a3c19[_0x6ef2('0x3')]||'';this[_0x6ef2('0x4')]=_0x3a3c19[_0x6ef2('0x4')]||'';this[_0x6ef2('0x5')]=_0x3a3c19[_0x6ef2('0x5')]||{};}module['exports']=VtigerAccount; \ No newline at end of file +var _0xf132=['remoteUri','Configurations','exports','name','username'];(function(_0x425a1d,_0x3ba6b1){var _0x3cacfc=function(_0x352a88){while(--_0x352a88){_0x425a1d['push'](_0x425a1d['shift']());}};_0x3cacfc(++_0x3ba6b1);}(_0xf132,0x6c));var _0x2f13=function(_0x2c4b51,_0x8be966){_0x2c4b51=_0x2c4b51-0x0;var _0x5769ab=_0xf132[_0x2c4b51];return _0x5769ab;};'use strict';function VtigerAccount(_0x40deb5){this['id']=_0x40deb5['id']||0x0;this[_0x2f13('0x0')]=_0x40deb5[_0x2f13('0x0')]||'';this[_0x2f13('0x1')]=_0x40deb5[_0x2f13('0x1')]||'';this['accessKey']=_0x40deb5['accessKey']||'';this['remoteUri']=_0x40deb5[_0x2f13('0x2')]||'';this['serverUrl']=_0x40deb5['serverUrl']||'';this[_0x2f13('0x3')]=_0x40deb5[_0x2f13('0x3')]||{};}module[_0x2f13('0x4')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index dd8b0ec..4ce0e08 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 _0x004a=['token','remoteUri','authType','type','integrationTab','serverUrl','Configurations','exports','name','username','password'];(function(_0x1da04e,_0x31024b){var _0xdd8c41=function(_0x2036f9){while(--_0x2036f9){_0x1da04e['push'](_0x1da04e['shift']());}};_0xdd8c41(++_0x31024b);}(_0x004a,0x6b));var _0xa004=function(_0x53aed8,_0x2c8771){_0x53aed8=_0x53aed8-0x0;var _0x54637d=_0x004a[_0x53aed8];return _0x54637d;};'use strict';function ZendeskAccount(_0x51d046){this['id']=_0x51d046['id']||0x0;this[_0xa004('0x0')]=_0x51d046[_0xa004('0x0')]||'';this[_0xa004('0x1')]=_0x51d046[_0xa004('0x1')]||'';this[_0xa004('0x2')]=_0x51d046[_0xa004('0x2')]||'';this[_0xa004('0x3')]=_0x51d046[_0xa004('0x3')]||'';this[_0xa004('0x4')]=_0x51d046['remoteUri']||'';this[_0xa004('0x5')]=_0x51d046[_0xa004('0x5')]||'';this[_0xa004('0x6')]=_0x51d046[_0xa004('0x6')]||_0xa004('0x7');this[_0xa004('0x8')]=_0x51d046[_0xa004('0x8')]||'';this[_0xa004('0x9')]=_0x51d046[_0xa004('0x9')]||{};}module[_0xa004('0xa')]=ZendeskAccount; \ No newline at end of file +var _0x265e=['username','password','token','remoteUri','authType','type','integrationTab','serverUrl','Configurations','exports','name'];(function(_0x304d59,_0x370440){var _0x30b353=function(_0x26035c){while(--_0x26035c){_0x304d59['push'](_0x304d59['shift']());}};_0x30b353(++_0x370440);}(_0x265e,0x180));var _0xe265=function(_0x1ec08a,_0x7306a2){_0x1ec08a=_0x1ec08a-0x0;var _0x13aebb=_0x265e[_0x1ec08a];return _0x13aebb;};'use strict';function ZendeskAccount(_0xf219dd){this['id']=_0xf219dd['id']||0x0;this[_0xe265('0x0')]=_0xf219dd['name']||'';this['username']=_0xf219dd[_0xe265('0x1')]||'';this[_0xe265('0x2')]=_0xf219dd[_0xe265('0x2')]||'';this[_0xe265('0x3')]=_0xf219dd[_0xe265('0x3')]||'';this[_0xe265('0x4')]=_0xf219dd[_0xe265('0x4')]||'';this['authType']=_0xf219dd[_0xe265('0x5')]||'';this[_0xe265('0x6')]=_0xf219dd['type']||_0xe265('0x7');this['serverUrl']=_0xf219dd[_0xe265('0x8')]||'';this[_0xe265('0x9')]=_0xf219dd['Configurations']||{};}module[_0xe265('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 2ab001a..e890e03 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 _0x2b93=['code','refreshToken','Configurations','exports','name','description','host','zone','clientSecret','serverUrl'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2b93,0x144));var _0x32b9=function(_0x43d701,_0x4bb2e9){_0x43d701=_0x43d701-0x0;var _0x2ec4c6=_0x2b93[_0x43d701];return _0x2ec4c6;};'use strict';function ZohoAccount(_0x4996a4){this['id']=_0x4996a4['id']||0x0;this[_0x32b9('0x0')]=_0x4996a4[_0x32b9('0x0')]||'';this['description']=_0x4996a4[_0x32b9('0x1')]||'';this['host']=_0x4996a4[_0x32b9('0x2')]||'';this['zone']=_0x4996a4[_0x32b9('0x3')]||'';this['clientId']=_0x4996a4['clientId']||'';this[_0x32b9('0x4')]=_0x4996a4['clientSecret']||'';this[_0x32b9('0x5')]=_0x4996a4[_0x32b9('0x5')]||'';this['code']=_0x4996a4[_0x32b9('0x6')]||'';this[_0x32b9('0x7')]=_0x4996a4[_0x32b9('0x7')]||'';this['Configurations']=_0x4996a4[_0x32b9('0x8')]||{};}module[_0x32b9('0x9')]=ZohoAccount; \ No newline at end of file +var _0xde5a=['clientId','clientSecret','serverUrl','code','refreshToken','Configurations','name','description','host','zone'];(function(_0xef29e2,_0x244c37){var _0x4b97e4=function(_0x3b58af){while(--_0x3b58af){_0xef29e2['push'](_0xef29e2['shift']());}};_0x4b97e4(++_0x244c37);}(_0xde5a,0x132));var _0xade5=function(_0x510345,_0x569a06){_0x510345=_0x510345-0x0;var _0xa59f9a=_0xde5a[_0x510345];return _0xa59f9a;};'use strict';function ZohoAccount(_0xb7ed){this['id']=_0xb7ed['id']||0x0;this[_0xade5('0x0')]=_0xb7ed['name']||'';this[_0xade5('0x1')]=_0xb7ed['description']||'';this['host']=_0xb7ed[_0xade5('0x2')]||'';this[_0xade5('0x3')]=_0xb7ed['zone']||'';this[_0xade5('0x4')]=_0xb7ed[_0xade5('0x4')]||'';this[_0xade5('0x5')]=_0xb7ed[_0xade5('0x5')]||'';this[_0xade5('0x6')]=_0xb7ed['serverUrl']||'';this[_0xade5('0x7')]=_0xb7ed[_0xade5('0x7')]||'';this[_0xade5('0x8')]=_0xb7ed[_0xade5('0x8')]||'';this[_0xade5('0x9')]=_0xb7ed[_0xade5('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 ffb1b92..ae688ae 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 _0x3d04=['callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','prototype','getCaller','\x22%s\x22\x20<%s>','number','exports','util','lodash','moment','isNil','string','idContact','queue','name','type','dialAnswer','Agent','channelAgent','format','SIP/%s','calleridname','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countdropretry','countagentrejectretry'];(function(_0x20e439,_0x57a270){var _0x449c97=function(_0x308927){while(--_0x308927){_0x20e439['push'](_0x20e439['shift']());}};_0x449c97(++_0x57a270);}(_0x3d04,0xbe));var _0x43d0=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x3d04[_0x501510];return _0x1e6ee5;};'use strict';var util=require(_0x43d0('0x0'));var _=require(_0x43d0('0x1'));var moment=require(_0x43d0('0x2'));function checkNameSurname(_0x105c73,_0x191de5,_0x143fea){var _0x3d6e62='';if(!_[_0x43d0('0x3')](_0x191de5)&&'string'===typeof _0x191de5){_0x3d6e62+=_0x191de5;}if(!_[_0x43d0('0x3')](_0x143fea)&&_0x43d0('0x4')===typeof _0x143fea){_0x3d6e62+='\x20'+_0x143fea;}if(_0x3d6e62!==''){return _0x3d6e62;}return _0x105c73;}function Action(_0x746f5e,_0x617bf,_0x5e284f,_0x484271,_0x50919e){this['uniqueid']=_0x5e284f||undefined;this[_0x43d0('0x5')]=_0x746f5e['id'];this[_0x43d0('0x6')]=_0x617bf[_0x43d0('0x7')];this[_0x43d0('0x8')]=_0x617bf[_0x43d0('0x8')];this['campaigntype']='queue';this[_0x43d0('0x9')]=![];this['membername']=_['isNil'](_0x746f5e[_0x43d0('0xa')])?undefined:_0x746f5e[_0x43d0('0xa')][_0x43d0('0x7')];this[_0x43d0('0xb')]=this['membername']?util[_0x43d0('0xc')](_0x43d0('0xd'),this['membername']):_0x484271||undefined;this[_0x43d0('0xe')]=checkNameSurname(_0x746f5e[_0x43d0('0xf')][_0x43d0('0x10')],_0x746f5e['Contact'][_0x43d0('0x11')],_0x746f5e[_0x43d0('0xf')][_0x43d0('0x12')]);this['active']=_0x746f5e[_0x43d0('0x13')]||![];this[_0x43d0('0x14')]=_0x746f5e[_0x43d0('0x10')];this[_0x43d0('0x15')]=_0x746f5e[_0x43d0('0x15')];this['countbusyretry']=_0x746f5e['countbusyretry']||0x0;this[_0x43d0('0x16')]=_0x746f5e[_0x43d0('0x16')]||0x0;this[_0x43d0('0x17')]=_0x746f5e['countnoanswerretry']||0x0;this[_0x43d0('0x18')]=(_0x746f5e['countbusyretry']||0x0)+(_0x746f5e[_0x43d0('0x16')]||0x0)+(_0x746f5e[_0x43d0('0x17')]||0x0)+(_0x746f5e[_0x43d0('0x19')]||0x0)+(_0x746f5e['countdropretry']||0x0)+(_0x746f5e[_0x43d0('0x1a')]||0x0)+(_0x746f5e[_0x43d0('0x1b')]||0x0)+(_0x746f5e['countagentrejectretry']||0x0);this[_0x43d0('0x19')]=_0x746f5e[_0x43d0('0x19')]||0x0;this[_0x43d0('0x1c')]=_0x746f5e[_0x43d0('0x1c')]||0x0;this[_0x43d0('0x1a')]=_0x746f5e[_0x43d0('0x1a')]||0x0;this[_0x43d0('0x1b')]=_0x746f5e[_0x43d0('0x1b')]||0x0;this[_0x43d0('0x1d')]=_0x746f5e[_0x43d0('0x1d')]||0x0;this[_0x43d0('0x1e')]=_0x746f5e[_0x43d0('0x1e')];this[_0x43d0('0x1f')]=_0x746f5e[_0x43d0('0x1f')];this[_0x43d0('0x20')]=_0x746f5e['callbackat'];this[_0x43d0('0x21')]=_0x746f5e[_0x43d0('0x21')];this['ContactId']=_0x746f5e[_0x43d0('0x22')];this['ListId']=_0x746f5e[_0x43d0('0x23')];this[_0x43d0('0x24')]=_['isNil'](_0x746f5e[_0x43d0('0xa')])?_0x746f5e[_0x43d0('0x24')]:_0x746f5e['Agent']['id'];this[_0x43d0('0x25')]=_0x746f5e[_0x43d0('0x25')];this[_0x43d0('0x26')]='';this['originatecalleridname']='';}Action[_0x43d0('0x27')][_0x43d0('0x28')]=function(){return util[_0x43d0('0xc')](_0x43d0('0x29'),this[_0x43d0('0xe')],this[_0x43d0('0x2a')]);};module[_0x43d0('0x2b')]=Action; \ No newline at end of file +var _0xd943=['countglobal','countnosuchnumberretry','countabandonedretry','countagentrejectretry','countdropretry','countmachineretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','exports','util','lodash','moment','isNil','string','uniqueid','idContact','type','campaigntype','dialAnswer','Agent','name','channelAgent','membername','format','SIP/%s','calleridname','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0xd943,0x15d));var _0x3d94=function(_0x4de5b2,_0x10faf7){_0x4de5b2=_0x4de5b2-0x0;var _0x41ce08=_0xd943[_0x4de5b2];return _0x41ce08;};'use strict';var util=require(_0x3d94('0x0'));var _=require(_0x3d94('0x1'));var moment=require(_0x3d94('0x2'));function checkNameSurname(_0x440dd8,_0x5495df,_0x691e28){var _0x3edd1b='';if(!_[_0x3d94('0x3')](_0x5495df)&&_0x3d94('0x4')===typeof _0x5495df){_0x3edd1b+=_0x5495df;}if(!_[_0x3d94('0x3')](_0x691e28)&&'string'===typeof _0x691e28){_0x3edd1b+='\x20'+_0x691e28;}if(_0x3edd1b!==''){return _0x3edd1b;}return _0x440dd8;}function Action(_0x54e692,_0x34c9c3,_0x51cf1f,_0x54e81f,_0x4d29e7){this[_0x3d94('0x5')]=_0x51cf1f||undefined;this[_0x3d94('0x6')]=_0x54e692['id'];this['queue']=_0x34c9c3['name'];this[_0x3d94('0x7')]=_0x34c9c3[_0x3d94('0x7')];this[_0x3d94('0x8')]='queue';this[_0x3d94('0x9')]=![];this['membername']=_[_0x3d94('0x3')](_0x54e692[_0x3d94('0xa')])?undefined:_0x54e692['Agent'][_0x3d94('0xb')];this[_0x3d94('0xc')]=this[_0x3d94('0xd')]?util[_0x3d94('0xe')](_0x3d94('0xf'),this['membername']):_0x54e81f||undefined;this[_0x3d94('0x10')]=checkNameSurname(_0x54e692[_0x3d94('0x11')][_0x3d94('0x12')],_0x54e692['Contact'][_0x3d94('0x13')],_0x54e692[_0x3d94('0x11')][_0x3d94('0x14')]);this['active']=_0x54e692[_0x3d94('0x15')]||![];this[_0x3d94('0x16')]=_0x54e692[_0x3d94('0x12')];this[_0x3d94('0x17')]=_0x54e692[_0x3d94('0x17')];this[_0x3d94('0x18')]=_0x54e692[_0x3d94('0x18')]||0x0;this[_0x3d94('0x19')]=_0x54e692['countcongestionretry']||0x0;this[_0x3d94('0x1a')]=_0x54e692[_0x3d94('0x1a')]||0x0;this[_0x3d94('0x1b')]=(_0x54e692[_0x3d94('0x18')]||0x0)+(_0x54e692[_0x3d94('0x19')]||0x0)+(_0x54e692[_0x3d94('0x1a')]||0x0)+(_0x54e692[_0x3d94('0x1c')]||0x0)+(_0x54e692['countdropretry']||0x0)+(_0x54e692[_0x3d94('0x1d')]||0x0)+(_0x54e692['countmachineretry']||0x0)+(_0x54e692[_0x3d94('0x1e')]||0x0);this[_0x3d94('0x1c')]=_0x54e692[_0x3d94('0x1c')]||0x0;this[_0x3d94('0x1f')]=_0x54e692[_0x3d94('0x1f')]||0x0;this['countabandonedretry']=_0x54e692['countabandonedretry']||0x0;this[_0x3d94('0x20')]=_0x54e692[_0x3d94('0x20')]||0x0;this[_0x3d94('0x1e')]=_0x54e692['countagentrejectretry']||0x0;this[_0x3d94('0x21')]=_0x54e692[_0x3d94('0x21')];this[_0x3d94('0x22')]=_0x54e692[_0x3d94('0x22')];this[_0x3d94('0x23')]=_0x54e692[_0x3d94('0x23')];this[_0x3d94('0x24')]=_0x54e692[_0x3d94('0x24')];this[_0x3d94('0x25')]=_0x54e692[_0x3d94('0x25')];this[_0x3d94('0x26')]=_0x54e692[_0x3d94('0x26')];this[_0x3d94('0x27')]=_[_0x3d94('0x3')](_0x54e692[_0x3d94('0xa')])?_0x54e692['UserId']:_0x54e692[_0x3d94('0xa')]['id'];this['VoiceQueueId']=_0x54e692[_0x3d94('0x28')];this[_0x3d94('0x29')]='';this[_0x3d94('0x2a')]='';}Action[_0x3d94('0x2b')][_0x3d94('0x2c')]=function(){return util[_0x3d94('0xe')](_0x3d94('0x2d'),this['calleridname'],this['number']);};module[_0x3d94('0x2e')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 5e7fac2..d9c3b47 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 _0x3f7d=['uniqueid','\x20Queue','pTalking:\x20','custom:agentconnect','buildObj','acw','custom:agentcomplete','complete','outboundAnswerCallsDay','total','answered','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','[syncHangup][talking][decrement]','linkedid','outboundBusyCallsDay','countbusyretry','callAdditionalPhoneAfterMin','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','Global','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyRetryFrequency','NOANSWER','outboundNoAnswerCallsDay','countnoanswerretry','NoAnswer','dialNoAnswerRetryFrequency','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','CONGESTION','outboundCongestionCallsDay','countcongestionretry','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','congestion','dialCongestionMaxRetry','CANCEL','outboundRejectCallsDay','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','ABANDONED','outboundAbandonedCallsDay','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedRetryFrequency','outboundUnknownCallsDay','cause-txt','dialstatus','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','queueSummaryCountersUpdated','callProgressDetectingAgent','isUndefined','object','reason','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','logAgent','Busy','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','[incrementPreviewCounters]\x20','Contact','phone','Contact\x20is\x20undefined','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','Calling','[Preview][execCall][failure]','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','status','reachable','unmonitored','execRun','unlock','getContactPreview','recallme','validateContact','checkIsBlackList','checkInBlack','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','isEmpty','Empty\x20Contact','ACTIVE','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','isActive','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialPrefix','trim','substring','dialCutDigit','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridnum','extractCalleridNumber','addVariables','setXMDContactVariables','merge','toLowerVariables','starttime','Action','[originateFailure][logOriginateFailure]','syncNewExten','actionid','lookAgent','logLookAgent','clone','response','unlockContact','disableContact','custom:agentringnoanswer','rejected','YYYY-MM-DD\x20HH:mm:ss','[syncHangup][talking]','cause','[syncHangup][talking][cause]','callProgressDetectingCustomer','statedesc','dialQueueProject','channelstate','transfer','destuniqueid','addVariable','variables','filterKey','variable','keys','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','lodash','uuid','moment','ioredis','../ami','./rpcDb','../dialer/utils','defaults','redis','localhost','socket.io-emitter','enqueue','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','syncDialEnd','newexten','varset','attendedtransfer','syncAttendedTransfer','blindtransfer','loopCampaigns','emit','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','stringify','voice:queue:%s','voice_queue_channel:remove','voice_queue_presence:remove','originated','pTalking','CAMPAIGN_STATUS','INACTIVE','[CampaignPreview]\x20Campaign\x20Queue:\x20','message','logger','name','\x20is\x20deactivated','prototype','syncCampaigns','clockClearZombieChannels','dialMethod','preview','booked','outbound','clearZombieChannels','type','dialActive','setMessage','dialPreviewAutoRecallMe','recallMe','isNil','[clearZombieChannels][talking]','Queue','queue','originated:\x20','dialAnswer','pick','UserId','VoiceQueueId','ListId','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[action]','size','hasOwnProperty','clearZombieChannel','getContactRecallMe','agentReadyId','then','length','getDiff','scheduledat','Agent','voicePause','run','logger2','[RecallMe]','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','sendMessageOneNotActive','IsNotLoggedIn','loggedIn','isTrunkReachable','Trunk','TrunkBackup','UNREACHABLE_TRUNK','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialGlobalMaxRetry','cloneAction','rescheduleContact','scheduledAt','unlockAgent','activeContact','actioncountonusuch','idContact','incrementPreviewCounters','swapAdditionalPhones','ANSWER','format','responsetime','answertime','[syncHangup][talking][increment]'];(function(_0xff88c5,_0x1eec2f){var _0x3caaf5=function(_0x51e04e){while(--_0x51e04e){_0xff88c5['push'](_0xff88c5['shift']());}};_0x3caaf5(++_0x1eec2f);}(_0x3f7d,0x1f3));var _0xd3f7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3f7d[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var _=require(_0xd3f7('0x0'));var uuid=require(_0xd3f7('0x1'));var moment=require(_0xd3f7('0x2'));var Redis=require(_0xd3f7('0x3'));var config=require('../../../config/environment');var logger=require('../../../config/logger')('preview');var loggerAction=require('../../../config/logger')('actionPreview');var ami=require(_0xd3f7('0x4'));var rpcDb=require(_0xd3f7('0x5'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require('./action');var ut=require('./util/util');var utils=require(_0xd3f7('0x6'));config['redis']=_[_0xd3f7('0x7')](config[_0xd3f7('0x8')],{'host':_0xd3f7('0x9'),'port':0x18eb});var io=require(_0xd3f7('0xa'))(new Redis(config[_0xd3f7('0x8')]));var Sequence=function(){};Sequence['prototype'][_0xd3f7('0xb')]=function(_0x2d567){this[_0xd3f7('0xc')]=this['tail']?this[_0xd3f7('0xc')][_0xd3f7('0xd')](_0x2d567):_0x2d567();};function Preview(_0xe6c0a2){this[_0xd3f7('0xe')]=new Sequence();this[_0xd3f7('0xf')]=_0xe6c0a2[_0xd3f7('0x10')];this[_0xd3f7('0x11')]=_0xe6c0a2[_0xd3f7('0x11')];this[_0xd3f7('0x12')]={};this[_0xd3f7('0x13')]=_0xe6c0a2[_0xd3f7('0x13')];this['clockClearZombieChannels']=0x0;ami['on'](_0xd3f7('0x14'),this[_0xd3f7('0x15')][_0xd3f7('0x16')](this));ami['on'](_0xd3f7('0x17'),this[_0xd3f7('0x18')]['bind'](this));ami['on'](_0xd3f7('0x19'),this[_0xd3f7('0x1a')]['bind'](this));ami['on']('dialend',this[_0xd3f7('0x1b')]['bind'](this));ami['on'](_0xd3f7('0x1c'),this['syncNewExten']['bind'](this));ami['on'](_0xd3f7('0x1d'),this['syncVarSet'][_0xd3f7('0x16')](this));ami['on'](_0xd3f7('0x1e'),this[_0xd3f7('0x1f')][_0xd3f7('0x16')](this));ami['on'](_0xd3f7('0x20'),this['syncBlindTransfer'][_0xd3f7('0x16')](this));this[_0xd3f7('0x21')](this[_0xd3f7('0xf')]);}function emit(_0x1f11bf,_0x2e93a7,_0x4b5d97){io['to'](_0x1f11bf)[_0xd3f7('0x22')](_0x2e93a7,_0x4b5d97);}function emitVoiceQueueChannelRemove(_0x5891d9){logger[_0xd3f7('0x23')](_0xd3f7('0x24'),JSON[_0xd3f7('0x25')](_0x5891d9));emit(util['format'](_0xd3f7('0x26'),_0x5891d9['name']),_0xd3f7('0x27'),_0x5891d9);io['emit'](_0xd3f7('0x28'),_0x5891d9);}function notSendMessagesQueue(_0x3d0c55){if(_0x3d0c55['sendMessageOneNotActive']){if(_0x3d0c55[_0xd3f7('0x29')]===0x0&&_0x3d0c55[_0xd3f7('0x2a')]===0x0){_0x3d0c55['sendMessageOneNotActive']=![];_0x3d0c55['available']=0x0;_0x3d0c55['paused']=0x0;_0x3d0c55['message']=utils[_0xd3f7('0x2b')][_0xd3f7('0x2c')];ut['logger'](_0xd3f7('0x2d'),_0x3d0c55['name']+'\x20is\x20not\x20active');}else{_0x3d0c55[_0xd3f7('0x2e')]=utils[_0xd3f7('0x2b')]['DEACTIVATED'];ut[_0xd3f7('0x2f')](_0xd3f7('0x2d'),_0x3d0c55[_0xd3f7('0x30')]+_0xd3f7('0x31'));}}}Preview[_0xd3f7('0x32')][_0xd3f7('0x21')]=function(){var _0x26964e=this;setInterval(function(){_0x26964e[_0xd3f7('0x33')]();},0x7cf);};Preview[_0xd3f7('0x32')][_0xd3f7('0x33')]=function(){var _0x143d37=this['campaignsPreview'];this[_0xd3f7('0x34')]+=0x1;for(var _0x10e6fd in _0x143d37){if(_0x143d37['hasOwnProperty'](_0x10e6fd)&&(_0x143d37[_0x10e6fd][_0xd3f7('0x35')]===_0xd3f7('0x36')||_0x143d37[_0x10e6fd][_0xd3f7('0x35')]===_0xd3f7('0x37'))&&_0x143d37[_0x10e6fd]['type']===_0xd3f7('0x38')){if(this[_0xd3f7('0x34')]>0x7){this[_0xd3f7('0x34')]=0x0;this[_0xd3f7('0x39')]();}}if(_0x143d37['hasOwnProperty'](_0x10e6fd)&&_0x143d37[_0x10e6fd][_0xd3f7('0x35')]===_0xd3f7('0x36')&&_0x143d37[_0x10e6fd][_0xd3f7('0x3a')]===_0xd3f7('0x38')){if(_0x143d37[_0x10e6fd][_0xd3f7('0x3b')]){this[_0xd3f7('0x3c')](_0x143d37[_0x10e6fd]);if(_0x143d37[_0x10e6fd][_0xd3f7('0x3d')])this[_0xd3f7('0x3e')](_0x143d37[_0x10e6fd]);}else{notSendMessagesQueue(_0x143d37[_0x10e6fd]);}}}};Preview['prototype']['clearZombieChannel']=function(_0x292a4f){var _0x4dea6f=this;this['sequence']['enqueue'](function(){if(!_[_0xd3f7('0x3f')](_0x4dea6f[_0xd3f7('0x12')][_0x292a4f])){loggerAction[_0xd3f7('0x23')](_0xd3f7('0x40'),_0x292a4f,_0xd3f7('0x41'),_0x4dea6f[_0xd3f7('0x12')][_0x292a4f][_0xd3f7('0x42')],_0xd3f7('0x43'),JSON[_0xd3f7('0x25')](_0x4dea6f['campaignsPreview'][_0x4dea6f['actions'][_0x292a4f][_0xd3f7('0x42')]][_0xd3f7('0x29')]),'pTalking:\x20',JSON['stringify'](_0x4dea6f['campaignsPreview'][_0x4dea6f[_0xd3f7('0x12')][_0x292a4f][_0xd3f7('0x42')]][_0xd3f7('0x2a')]),JSON[_0xd3f7('0x25')](_0x4dea6f['actions'][_0x292a4f][_0xd3f7('0x44')]),JSON[_0xd3f7('0x25')](_[_0xd3f7('0x45')](_0x4dea6f[_0xd3f7('0x12')][_0x292a4f],['contactId',_0xd3f7('0x46'),_0xd3f7('0x47'),_0xd3f7('0x48')])));return ami['Action']({'action':'status','channel':_0x4dea6f['actions'][_0x292a4f][_0xd3f7('0x49')]})[_0xd3f7('0x4a')](function(_0x418710){if(_0x418710[_0xd3f7('0x2e')]===_0xd3f7('0x4b')){setTimeout(function(){if(_0x4dea6f[_0xd3f7('0x12')][_0x292a4f]){ut[_0xd3f7('0x4c')](_0x4dea6f[_0xd3f7('0xf')][_0x4dea6f[_0xd3f7('0x12')][_0x292a4f][_0xd3f7('0x42')]],_0xd3f7('0x4d'));if(_0x4dea6f['actions'][_0x292a4f][_0xd3f7('0x44')]===!![]){ut[_0xd3f7('0x4e')](_0x4dea6f[_0xd3f7('0xf')][_0x4dea6f['actions'][_0x292a4f][_0xd3f7('0x42')]],'[clearZombieChannel]');ut[_0xd3f7('0x4f')](_0xd3f7('0x50')+_0x292a4f,_0x4dea6f[_0xd3f7('0x12')][_0x292a4f]['queue']);}ut[_0xd3f7('0x4f')]('[Dialer][checkChannel][Preview]'+_0x292a4f,_0x4dea6f[_0xd3f7('0x12')][_0x292a4f]['queue']);delete _0x4dea6f[_0xd3f7('0x12')][_0x292a4f];}},0x2328);}});}});};Preview[_0xd3f7('0x32')][_0xd3f7('0x39')]=function(){var _0x368753=this;loggerAction[_0xd3f7('0x23')](_0xd3f7('0x51'),_[_0xd3f7('0x52')](this[_0xd3f7('0x12')]));for(var _0x6e3132 in this['actions']){if(_0x368753[_0xd3f7('0x12')][_0xd3f7('0x53')](_0x6e3132)){_0x368753[_0xd3f7('0x54')](_0x6e3132);}}};Preview[_0xd3f7('0x32')][_0xd3f7('0x3e')]=function(_0x283717){var _0x201ba2=this;rpcDb[_0xd3f7('0x55')](_0x283717['id'],ut[_0xd3f7('0x56')](this[_0xd3f7('0x13')]))[_0xd3f7('0x57')](function(_0x34d66e){if(!_[_0xd3f7('0x3f')](_0x34d66e)){for(var _0x125440=0x0;_0x125440<_0x34d66e[_0xd3f7('0x58')];_0x125440+=0x1){if(ut[_0xd3f7('0x59')](_0x34d66e[_0x125440][_0xd3f7('0x5a')])<_0x283717['dialRecallMeTimeout']*0x3c){if(_0x34d66e[_0x125440][_0xd3f7('0x5b')]&&!_0x34d66e[_0x125440][_0xd3f7('0x5b')][_0xd3f7('0x5c')]){_0x201ba2[_0xd3f7('0x5d')](_0x34d66e[_0x125440]['id'])['then'](ut[_0xd3f7('0x5e')](_0xd3f7('0x5f')))['catch'](ut[_0xd3f7('0x5e')](_0xd3f7('0x5f')));}else{rpcDb['disableContact'](_0x34d66e[_0x125440]['id']);}}else{var _0x2a31ad=new Action(_0x34d66e[_0x125440],_0x283717);_0x2a31ad['starttime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x283717['outboundReCallsDay']+=0x1;ut[_0xd3f7('0x60')](_0x2a31ad,0x17,_0xd3f7('0x61'));if(_0x283717[_0xd3f7('0x62')]){rpcDb[_0xd3f7('0x63')](ut[_0xd3f7('0x64')](_0x34d66e[_0x125440]));rpcDb[_0xd3f7('0x65')](_0x2a31ad,_0xd3f7('0x66'));}else{ut['logCustomer'](_0x2a31ad,0x16,_0xd3f7('0x67'));rpcDb[_0xd3f7('0x65')](_0x2a31ad,_0xd3f7('0x68'));rpcDb[_0xd3f7('0x69')](_0x2a31ad,_0xd3f7('0x68'));}}}}})[_0xd3f7('0x4a')](ut['logger2']('[getContactRecallMe]'));};Preview['prototype']['setMessage']=function(_0x684fa3){_0x684fa3[_0xd3f7('0x6a')]=!![];if(ut[_0xd3f7('0x6b')](_0x684fa3[_0xd3f7('0x6c')])){_0x684fa3[_0xd3f7('0x2e')]=utils[_0xd3f7('0x2b')]['NO_AGENTS_LOGGED'];}else if(!ut['isActive'](_0x684fa3[_0xd3f7('0x3b')])){_0x684fa3[_0xd3f7('0x2e')]=utils['CAMPAIGN_STATUS'][_0xd3f7('0x2c')];}else if(!this[_0xd3f7('0x6d')](_0x684fa3[_0xd3f7('0x6e')])){if(!this[_0xd3f7('0x6d')](_0x684fa3[_0xd3f7('0x6f')])){_0x684fa3['message']=utils[_0xd3f7('0x2b')][_0xd3f7('0x70')];}else{_0x684fa3[_0xd3f7('0x2e')]=utils[_0xd3f7('0x2b')]['ACTIVE'];}}else{_0x684fa3[_0xd3f7('0x2e')]=utils[_0xd3f7('0x2b')]['ACTIVE'];}};Preview['prototype']['callProgressDetectingCustomer']=function(_0x2f3a9b,_0x217b0e,_0x311f3d){var _0x5e6038=this;var _0x29ec72=this[_0xd3f7('0x12')][_0x217b0e];var _0x35545e=this[_0xd3f7('0xf')][_0x29ec72[_0xd3f7('0x42')]];var _0x2909b4;var _0x51af64=![];var _0x5ea73d=0x2;var _0x115cf5=0x3;if(_0x35545e){switch(_0x311f3d){case'1':_0x35545e['outboundNoSuchCallsDay']+=0x1;_0x29ec72[_0xd3f7('0x71')]+=0x1;_0x29ec72[_0xd3f7('0x72')]=ut[_0xd3f7('0x73')](_0x29ec72);ut[_0xd3f7('0x60')](_0x29ec72,0x0,_0xd3f7('0x74'));ami[_0xd3f7('0x22')](_0xd3f7('0x75'),ut['buildObj'](_0x29ec72,_0xd3f7('0x76')));rpcDb[_0xd3f7('0x65')](_0x29ec72,_0xd3f7('0x77'));_0x5e6038[_0xd3f7('0x78')](_0x29ec72,'0',_0x35545e)[_0xd3f7('0x57')](function(_0x11dee3){_0x51af64=_0x11dee3[_0xd3f7('0x79')]==0x1;_0x5ea73d=_0x35545e['dialNoSuchNumberRetryFrequency'];_0x115cf5=_0x35545e['callAdditionalPhoneAfterMin'];if(!_0x51af64){if(ut['totalGlobal'](_0x29ec72)>=_0x35545e[_0xd3f7('0x7a')]){_0x2909b4=ut[_0xd3f7('0x7b')](_0x29ec72,0xf,'Global');rpcDb['createCustomerFinal'](_0x2909b4,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x29ec72[_0xd3f7('0x71')]>=_0x35545e['dialNoSuchNumberMaxRetry']){rpcDb[_0xd3f7('0x69')](_0x29ec72,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb[_0xd3f7('0x7c')](ut[_0xd3f7('0x7d')](_0x29ec72,_0xd3f7('0x71'),_0x35545e['dialNoSuchNumberRetryFrequency']),_0x29ec72[_0xd3f7('0x7e')],_0x29ec72[_0xd3f7('0x7f')]);}}delete this[_0xd3f7('0x12')][_0x2f3a9b['linkedid']];}else{_0x29ec72[_0xd3f7('0x71')]++;logger[_0xd3f7('0x23')](_0xd3f7('0x80'),_0x29ec72[_0xd3f7('0x71')]);logger[_0xd3f7('0x23')]('id',_0x29ec72[_0xd3f7('0x81')]);_0x5e6038[_0xd3f7('0x82')]({'id':_0x29ec72[_0xd3f7('0x81')],'field':{'countnosuchnumberretry':_0x29ec72[_0xd3f7('0x71')]}})[_0xd3f7('0x57')](function(){_0x5e6038[_0xd3f7('0x83')](_0x29ec72,_0x5ea73d,_0x115cf5)[_0xd3f7('0x57')](function(){});});}});break;case _0xd3f7('0x84'):var _0x3aa46c=moment()[_0xd3f7('0x85')]('YYYY-MM-DD\x20HH:mm:ss');_0x29ec72[_0xd3f7('0x86')]=_0x3aa46c;_0x29ec72[_0xd3f7('0x87')]=_0x3aa46c;_0x29ec72[_0xd3f7('0x44')]=!![];_0x35545e[_0xd3f7('0x2a')]+=0x1;logger['info'](_0xd3f7('0x88'),_0x29ec72[_0xd3f7('0x89')],_0xd3f7('0x8a'),_0x35545e[_0xd3f7('0x30')],_0xd3f7('0x8b'),_0x35545e[_0xd3f7('0x2a')]);ami[_0xd3f7('0x22')](_0xd3f7('0x8c'),ut[_0xd3f7('0x8d')](_0x29ec72,'connect',this[_0xd3f7('0xf')][_0x29ec72[_0xd3f7('0x42')]]));if(_0x35545e[_0xd3f7('0x8e')]){ami[_0xd3f7('0x22')]('custom:agentConnectPreview',ut['buildAcw'](_0x29ec72));}break;case'16':ami[_0xd3f7('0x22')](_0xd3f7('0x8f'),ut['buildObj'](_0x29ec72,_0xd3f7('0x90'),this[_0xd3f7('0xf')][_0x29ec72[_0xd3f7('0x42')]]));emitVoiceQueueChannelRemove(ut[_0xd3f7('0x8d')](_0x29ec72,_0xd3f7('0x90')));_0x35545e[_0xd3f7('0x91')]+=0x1;_0x35545e[_0xd3f7('0x92')]+=0x1;_0x35545e[_0xd3f7('0x93')]+=0x1;ut[_0xd3f7('0x4e')](_0x35545e,_0xd3f7('0x94'));_0x29ec72['countglobal']=ut[_0xd3f7('0x73')](_0x29ec72);ut[_0xd3f7('0x60')](_0x29ec72,0x4,_0xd3f7('0x95'));rpcDb[_0xd3f7('0x65')](_0x29ec72,_0xd3f7('0x96'));rpcDb[_0xd3f7('0x69')](_0x29ec72,_0xd3f7('0x97'));rpcDb[_0xd3f7('0x98')](_0x29ec72);_0x35545e[_0xd3f7('0x99')]+=_0x29ec72[_0xd3f7('0x9a')];_0x35545e['sumBillable']+=_0x29ec72[_0xd3f7('0x9a')];logger[_0xd3f7('0x23')](_0xd3f7('0x9b'),_0x29ec72[_0xd3f7('0x89')],_0xd3f7('0x8a'),_0x35545e[_0xd3f7('0x30')],_0xd3f7('0x8b'),_0x35545e[_0xd3f7('0x2a')]);delete this[_0xd3f7('0x12')][_0x2f3a9b[_0xd3f7('0x9c')]];break;case'BUSY':_0x35545e[_0xd3f7('0x9d')]+=0x1;_0x29ec72[_0xd3f7('0x9e')]+=0x1;_0x29ec72[_0xd3f7('0x72')]=ut[_0xd3f7('0x73')](_0x29ec72);ut[_0xd3f7('0x60')](_0x29ec72,0x5,'Busy');_0x5ea73d=_0x35545e['dialBusyRetryFrequency'];_0x115cf5=_0x35545e[_0xd3f7('0x9f')];ami[_0xd3f7('0x22')](_0xd3f7('0xa0'),ut[_0xd3f7('0x8d')](_0x29ec72,_0xd3f7('0xa1')));rpcDb[_0xd3f7('0x65')](_0x29ec72,_0xd3f7('0xa2'));_0x5e6038[_0xd3f7('0x78')](_0x29ec72,'5',_0x35545e)[_0xd3f7('0x57')](function(_0x512050){_0x51af64=_0x512050['additional']==0x1;if(!_0x51af64){if(ut[_0xd3f7('0x73')](_0x29ec72)>=_0x35545e['dialGlobalMaxRetry']){_0x2909b4=ut[_0xd3f7('0x7b')](_0x29ec72,0xf,_0xd3f7('0xa3'));rpcDb['createCustomerFinal'](_0x2909b4,_0xd3f7('0xa4'));}else{if(_0x29ec72[_0xd3f7('0x9e')]>=_0x35545e['dialBusyMaxRetry']){rpcDb[_0xd3f7('0x69')](_0x29ec72,_0xd3f7('0xa2'));}else{rpcDb[_0xd3f7('0x7c')](ut[_0xd3f7('0x7d')](_0x29ec72,'countbusyretry',_0x35545e[_0xd3f7('0xa5')]),_0x29ec72[_0xd3f7('0x7e')],_0x29ec72[_0xd3f7('0x7f')]);}}}else{_0x29ec72[_0xd3f7('0x9e')]++;_0x5e6038[_0xd3f7('0x82')]({'id':_0x29ec72[_0xd3f7('0x81')],'field':{'countbusyretry':_0x29ec72[_0xd3f7('0x9e')]}})[_0xd3f7('0x57')](function(){_0x5e6038['swapAdditionalPhones'](_0x29ec72,_0x5ea73d,_0x115cf5)[_0xd3f7('0x57')](function(){});});}});break;case _0xd3f7('0xa6'):_0x35545e[_0xd3f7('0xa7')]+=0x1;_0x29ec72[_0xd3f7('0xa8')]+=0x1;_0x29ec72['countglobal']=ut[_0xd3f7('0x73')](_0x29ec72);ut[_0xd3f7('0x60')](_0x29ec72,0x3,_0xd3f7('0xa9'));_0x5ea73d=_0x35545e[_0xd3f7('0xaa')];_0x115cf5=_0x35545e[_0xd3f7('0x9f')];var _0x38f17c=ut['buildNoAnswerEventPayload'](_0x29ec72,_0x35545e);ami['emit'](_0xd3f7('0xab'),_0x38f17c);rpcDb[_0xd3f7('0x65')](_0x29ec72,_0xd3f7('0xac'));_0x5e6038['verifyAdditionalPhones'](_0x29ec72,'3',_0x35545e)[_0xd3f7('0x57')](function(_0x3b6c41){_0x51af64=_0x3b6c41[_0xd3f7('0x79')]==0x1;if(!_0x51af64){if(ut['totalGlobal'](_0x29ec72)>=_0x35545e[_0xd3f7('0x7a')]){_0x2909b4=ut[_0xd3f7('0x7b')](_0x29ec72,0xf,_0xd3f7('0xa3'));rpcDb['createCustomerFinal'](_0x2909b4,_0xd3f7('0xad'));}else{if(_0x29ec72[_0xd3f7('0xa8')]>=_0x35545e['dialNoAnswerMaxRetry']){rpcDb[_0xd3f7('0x69')](_0x29ec72,_0xd3f7('0xac'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x29ec72,_0xd3f7('0xa8'),_0x35545e['dialNoAnswerRetryFrequency']),_0x29ec72[_0xd3f7('0x7e')],_0x29ec72[_0xd3f7('0x7f')]);}}}else{_0x29ec72['countnoanswerretry']++;_0x5e6038[_0xd3f7('0x82')]({'id':_0x29ec72[_0xd3f7('0x81')],'field':{'countnoanswerretry':_0x29ec72[_0xd3f7('0xa8')]}})[_0xd3f7('0x57')](function(){_0x5e6038[_0xd3f7('0x83')](_0x29ec72,_0x5ea73d,_0x115cf5)[_0xd3f7('0x57')](function(){});});}});break;case _0xd3f7('0xae'):_0x35545e[_0xd3f7('0xaf')]+=0x1;_0x29ec72[_0xd3f7('0xb0')]+=0x1;_0x29ec72[_0xd3f7('0x72')]=ut['totalGlobal'](_0x29ec72);ut['logCustomer'](_0x29ec72,0x8,_0xd3f7('0xb1'));_0x5ea73d=_0x35545e[_0xd3f7('0xb2')];_0x115cf5=_0x35545e['callAdditionalPhoneAfterMin'];ami[_0xd3f7('0x22')](_0xd3f7('0xb3'),ut[_0xd3f7('0x8d')](_0x29ec72,_0xd3f7('0xb4')));rpcDb['createCustomerHistory'](_0x29ec72,'[callProgressDetectingCustomer][logCongestion]');_0x5e6038[_0xd3f7('0x78')](_0x29ec72,'8',_0x35545e)[_0xd3f7('0x57')](function(_0x55d1da){_0x51af64=_0x55d1da[_0xd3f7('0x79')]==0x1;if(!_0x51af64){if(ut[_0xd3f7('0x73')](_0x29ec72)>=_0x35545e[_0xd3f7('0x7a')]){_0x2909b4=ut[_0xd3f7('0x7b')](_0x29ec72,0xf,_0xd3f7('0xa3'));rpcDb[_0xd3f7('0x69')](_0x2909b4,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x29ec72[_0xd3f7('0xb0')]>=_0x35545e[_0xd3f7('0xb5')]){rpcDb[_0xd3f7('0x69')](_0x29ec72,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb[_0xd3f7('0x7c')](ut['scheduledAt'](_0x29ec72,_0xd3f7('0xb0'),_0x35545e[_0xd3f7('0xa5')]),_0x29ec72[_0xd3f7('0x7e')],_0x29ec72[_0xd3f7('0x7f')]);}}}else{_0x29ec72[_0xd3f7('0xb0')]++;_0x5e6038[_0xd3f7('0x82')]({'id':_0x29ec72['idContact'],'field':{'countcongestionretry':_0x29ec72[_0xd3f7('0xb0')]}})[_0xd3f7('0x57')](function(){_0x5e6038[_0xd3f7('0x83')](_0x29ec72,_0x5ea73d,_0x115cf5)['then'](function(){});});}});break;case _0xd3f7('0xb6'):_0x35545e[_0xd3f7('0xb7')]+=0x1;_0x29ec72[_0xd3f7('0xb8')]+=0x1;_0x29ec72[_0xd3f7('0x72')]=ut['totalGlobal'](_0x29ec72);ut[_0xd3f7('0x60')](_0x29ec72,0x14,_0xd3f7('0xb9'));_0x5ea73d=_0x35545e[_0xd3f7('0xba')];_0x115cf5=_0x35545e[_0xd3f7('0x9f')];ami[_0xd3f7('0x22')](_0xd3f7('0xbb'),ut[_0xd3f7('0x8d')](_0x29ec72,_0xd3f7('0xbc')));rpcDb['createCustomerHistory'](_0x29ec72,_0xd3f7('0xbd'));_0x5e6038[_0xd3f7('0x78')](_0x29ec72,'20',_0x35545e)[_0xd3f7('0x57')](function(_0x4c3cbc){_0x51af64=_0x4c3cbc['additional']==0x1;if(!_0x51af64){if(ut[_0xd3f7('0x73')](_0x29ec72)>=_0x35545e[_0xd3f7('0x7a')]){_0x2909b4=ut['cloneAction'](_0x29ec72,0x14,_0xd3f7('0xb9'));rpcDb[_0xd3f7('0x69')](_0x2909b4,_0xd3f7('0xbe'));}else{if(_0x29ec72[_0xd3f7('0xb8')]>=_0x35545e['dialAgentRejectMaxRetry']){rpcDb['createCustomerFinal'](_0x29ec72,_0xd3f7('0xbe'));}else{rpcDb[_0xd3f7('0x7c')](ut[_0xd3f7('0x7d')](_0x29ec72,'countagentrejectretry',_0x35545e[_0xd3f7('0xba')]),_0x29ec72[_0xd3f7('0x7e')],_0x29ec72['activeContact']);}}}else{_0x29ec72['countnoanswerretry']++;_0x5e6038['incrementPreviewCounters']({'id':_0x29ec72['idContact'],'field':{'countnoanswerretry':_0x29ec72[_0xd3f7('0xa8')]}})[_0xd3f7('0x57')](function(){_0x5e6038[_0xd3f7('0x83')](_0x29ec72,_0x5ea73d,_0x115cf5)['then'](function(){});});}});break;case _0xd3f7('0xbf'):_0x35545e[_0xd3f7('0xc0')]+=0x1;_0x29ec72[_0xd3f7('0xc1')]+=0x1;_0x29ec72[_0xd3f7('0x72')]=ut[_0xd3f7('0x73')](_0x29ec72);ut[_0xd3f7('0x60')](_0x29ec72,0xb,_0xd3f7('0xc2'));rpcDb[_0xd3f7('0x65')](_0x29ec72,_0xd3f7('0xc3'));_0x5e6038[_0xd3f7('0x78')](_0x29ec72,'11',_0x35545e)[_0xd3f7('0x57')](function(_0x5ec4b2){_0x51af64=_0x5ec4b2[_0xd3f7('0x79')]==0x1;if(!_0x51af64){if(ut[_0xd3f7('0x73')](_0x29ec72)>=_0x35545e[_0xd3f7('0x7a')]){_0x2909b4=ut[_0xd3f7('0x7b')](_0x29ec72,0xf,_0xd3f7('0xa3'));rpcDb[_0xd3f7('0x69')](_0x2909b4,_0xd3f7('0xc3'));}else{if(_0x29ec72[_0xd3f7('0xc4')]>=_0x35545e['dialAbandonedMaxRety']){rpcDb[_0xd3f7('0x69')](_0x29ec72,_0xd3f7('0xc3'));}else{rpcDb[_0xd3f7('0x7c')](ut['scheduledAt'](_0x29ec72,'countabandonedretry',_0x35545e[_0xd3f7('0xc5')]),_0x29ec72[_0xd3f7('0x7e')],_0x29ec72[_0xd3f7('0x7f')]);}}}else{_0x29ec72[_0xd3f7('0xa8')]++;_0x5e6038[_0xd3f7('0x82')]({'id':_0x29ec72[_0xd3f7('0x81')],'field':{'countnoanswerretry':_0x29ec72['countnoanswerretry']}})['then'](function(){_0x5e6038[_0xd3f7('0x83')](_0x29ec72,_0x5ea73d,_0x115cf5)[_0xd3f7('0x57')](function(){});});}});break;case'18':_0x35545e[_0xd3f7('0xc6')]+=0x1;_0x29ec72['countmachineretry']+=0x1;_0x29ec72[_0xd3f7('0x72')]=ut[_0xd3f7('0x73')](_0x29ec72);ut[_0xd3f7('0x60')](_0x29ec72,0x12,_0x2f3a9b[_0xd3f7('0xc7')]||_0x2f3a9b[_0xd3f7('0xc8')]);ami[_0xd3f7('0x22')](_0xd3f7('0xc9'),ut[_0xd3f7('0x8d')](_0x29ec72,'amd'));rpcDb['createCustomerHistory'](_0x29ec72,'[callProgressDetectingCustomer][hangupInAMD]');_0x5e6038['verifyAdditionalPhones'](_0x29ec72,'18',_0x35545e)[_0xd3f7('0x57')](function(_0x1b4add){_0x51af64=_0x1b4add[_0xd3f7('0x79')]==0x1;if(!_0x51af64){if(ut['totalGlobal'](_0x29ec72)>=_0x35545e['dialGlobalMaxRetry']){_0x2909b4=ut[_0xd3f7('0x7b')](_0x29ec72,0x12,'Global');rpcDb['createCustomerFinal'](_0x2909b4,_0xd3f7('0xca'));}else{rpcDb[_0xd3f7('0x69')](_0x29ec72,_0xd3f7('0xca'));}}else{_0x29ec72[_0xd3f7('0xa8')]++;_0x5e6038[_0xd3f7('0x82')]({'id':_0x29ec72[_0xd3f7('0x81')],'field':{'countnoanswerretry':_0x29ec72[_0xd3f7('0xa8')]}})['then'](function(){_0x5e6038[_0xd3f7('0x83')](_0x29ec72,_0x5ea73d,_0x115cf5)[_0xd3f7('0x57')](function(){});});}});delete this[_0xd3f7('0x12')][_0x2f3a9b[_0xd3f7('0x9c')]];break;case'19':_0x35545e[_0xd3f7('0xc6')]+=0x1;_0x29ec72['countglobal']=ut[_0xd3f7('0x73')](_0x29ec72);ut[_0xd3f7('0x60')](_0x29ec72,0x13,_0x2f3a9b[_0xd3f7('0xc7')]||_0x2f3a9b[_0xd3f7('0xc8')]);ami[_0xd3f7('0x22')](_0xd3f7('0xc9'),ut['buildObj'](_0x29ec72,'amd'));rpcDb[_0xd3f7('0x65')](_0x29ec72,_0xd3f7('0xcb'));_0x5e6038['verifyAdditionalPhones'](_0x29ec72,'18',_0x35545e)[_0xd3f7('0x57')](function(_0x1966a){_0x51af64=_0x1966a[_0xd3f7('0x79')]==0x1;if(!_0x51af64){if(ut[_0xd3f7('0x73')](_0x29ec72)>=_0x35545e['dialGlobalMaxRetry']){_0x2909b4=ut[_0xd3f7('0x7b')](_0x29ec72,0xf,_0xd3f7('0xa3'));rpcDb['createCustomerFinal'](_0x2909b4,_0xd3f7('0xcb'));}else{rpcDb[_0xd3f7('0x69')](_0x29ec72,_0xd3f7('0xcb'));}}else{_0x29ec72['countnoanswerretry']++;_0x5e6038[_0xd3f7('0x82')]({'id':_0x29ec72[_0xd3f7('0x81')],'field':{'countnoanswerretry':_0x29ec72[_0xd3f7('0xa8')]}})['then'](function(){_0x5e6038[_0xd3f7('0x83')](_0x29ec72,_0x5ea73d,_0x115cf5)['then'](function(){});});}});delete this['actions'][_0x2f3a9b[_0xd3f7('0x9c')]];break;default:if(_0x29ec72[_0xd3f7('0x44')]){ut[_0xd3f7('0x4e')](_0x35545e,_0xd3f7('0xcc'));ut['loggerError'](_0xd3f7('0xcd')+_0x35545e['name'],_0x2f3a9b);}_0x35545e[_0xd3f7('0xc6')]+=0x1;_0x29ec72['countglobal']=ut[_0xd3f7('0x73')](_0x29ec72);ut[_0xd3f7('0x60')](_0x29ec72,0xc,_0x2f3a9b[_0xd3f7('0xc7')]||_0x2f3a9b['dialstatus']);_0x5ea73d=_0x35545e[_0xd3f7('0xba')];_0x115cf5=_0x35545e[_0xd3f7('0x9f')];rpcDb[_0xd3f7('0x65')](_0x29ec72,_0xd3f7('0xce'));_0x5e6038[_0xd3f7('0x78')](_0x29ec72,'20',_0x35545e)['then'](function(_0x392470){_0x51af64=_0x392470[_0xd3f7('0x79')]==0x1;if(!_0x51af64){if(ut[_0xd3f7('0x73')](_0x29ec72)>=_0x35545e['dialGlobalMaxRetry']){_0x2909b4=ut[_0xd3f7('0x7b')](_0x29ec72,0xf,_0xd3f7('0xa3'));rpcDb[_0xd3f7('0x69')](_0x2909b4,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0xd3f7('0x69')](_0x29ec72,_0xd3f7('0xcf'));}delete this['actions'][_0x2f3a9b[_0xd3f7('0x9c')]];}else{_0x5e6038[_0xd3f7('0x83')](_0x29ec72,_0x5ea73d,_0x115cf5)[_0xd3f7('0x57')](function(){});}});}if(!(_0x29ec72[_0xd3f7('0x44')]&&_0x311f3d==='16')){ut[_0xd3f7('0x4c')](_0x35545e,_0xd3f7('0xd0'));logger[_0xd3f7('0x23')](_0xd3f7('0xd1'),_0x29ec72[_0xd3f7('0x89')],_0xd3f7('0x8a'),_0x35545e[_0xd3f7('0x30')],'originated:\x20',_0x35545e[_0xd3f7('0x29')]);}if(_0x311f3d!==_0xd3f7('0x84')){delete this['actions'][_0x2f3a9b[_0xd3f7('0x9c')]];delete this[_0xd3f7('0x12')][_0x2f3a9b[_0xd3f7('0xd2')]];}_0x35545e[_0xd3f7('0xd3')]=!![];}};Preview[_0xd3f7('0x32')][_0xd3f7('0xd4')]=function(_0xdebd29,_0x3a70bb,_0x10070b){if(_[_0xd3f7('0xd5')](_0x3a70bb)&&_0xd3f7('0xd6')!==typeof _0x3a70bb){return;}if(_[_0xd3f7('0xd5')](_0x10070b)&&'object'!==typeof _0x10070b){return;}switch(_0x10070b[_0xd3f7('0xd7')]){case'0':ut['logAgent'](_0xdebd29,0x0,_0xd3f7('0x74'));rpcDb[_0xd3f7('0xd8')](_0xdebd29,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut['logAgent'](_0xdebd29,0x3,_0xd3f7('0xa9'));rpcDb[_0xd3f7('0xd8')](_0xdebd29,_0xd3f7('0xd9'));break;case'5':ut[_0xd3f7('0xda')](_0xdebd29,0x5,_0xd3f7('0xdb'));rpcDb['createAgentHistory'](_0xdebd29,_0xd3f7('0xdc'));break;case'8':ut[_0xd3f7('0xda')](_0xdebd29,0x8,_0xd3f7('0xb1'));rpcDb[_0xd3f7('0xd8')](_0xdebd29,_0xd3f7('0xdd'));break;case'22':ut[_0xd3f7('0xda')](_0xdebd29,0x16,'AnswerAGI');rpcDb[_0xd3f7('0xd8')](_0xdebd29,_0xd3f7('0xde'));break;default:ut[_0xd3f7('0xda')](_0xdebd29,0xc,_0x10070b[_0xd3f7('0xd7')]);rpcDb[_0xd3f7('0xd8')](_0xdebd29,_0xd3f7('0xdd'));}ut[_0xd3f7('0x4c')](_0x3a70bb,_0xd3f7('0xdf'));logger['info']('[originated][decrement][callProgressDetectingAgent]',_0xdebd29[_0xd3f7('0x89')],_0xd3f7('0x8a'),_0x3a70bb[_0xd3f7('0x30')],_0xd3f7('0x43'),_0x3a70bb[_0xd3f7('0x29')]);delete this[_0xd3f7('0x12')][_0xdebd29[_0xd3f7('0x89')]];};Preview['prototype']['verifyAdditionalPhones']=function(_0x3e8237,_0x5a12df,_0x332f34){return cmHopperAdditionalPhone[_0xd3f7('0x78')](_0x3e8237,_0x5a12df,_0x332f34)[_0xd3f7('0x4a')](logger[_0xd3f7('0x23')](_0xd3f7('0xe0')));};Preview['prototype'][_0xd3f7('0x83')]=function(_0x2b3af8,_0x43f26e,_0x536bfc){return cmHopperAdditionalPhone[_0xd3f7('0x83')](_0x2b3af8,_0x43f26e,_0x536bfc)[_0xd3f7('0x4a')](logger[_0xd3f7('0x23')](_0xd3f7('0xe1')));};Preview[_0xd3f7('0x32')][_0xd3f7('0x82')]=function(_0x40b928){return Promise['resolve']()[_0xd3f7('0x57')](cmHopperAdditionalPhone['incrementPreviewCounters'](_0x40b928))[_0xd3f7('0x4a')](logger[_0xd3f7('0x23')](_0xd3f7('0xe2')));};Preview[_0xd3f7('0x32')]['checkInBlack']=function(_0x33da80,_0x48e840,_0x2aa21b,_0x55f923,_0x39cd3a){var _0x576b3e=this;return new Promise(function(_0xae1bdd,_0x482113){if(_[_0xd3f7('0x3f')](_0x48e840)||_[_0xd3f7('0x3f')](_0x48e840[_0xd3f7('0xe3')])||_[_0xd3f7('0x3f')](_0x48e840[_0xd3f7('0xe4')])||_[_0xd3f7('0x3f')](_0x48e840[_0xd3f7('0x47')])){_0x482113(ut[_0xd3f7('0x2e')](_0xd3f7('0xe5'),_0x55f923,_0x39cd3a));return;}var _0x1493e2=uuid['v4']();var _0x148d8e=_0x576b3e['campaignsPreview'][_0x48e840[_0xd3f7('0x41')][_0xd3f7('0x30')]];var _0x1a15a2=_0x2aa21b?_0x576b3e['agents'][_0x2aa21b]['id']:undefined;_0x576b3e[_0xd3f7('0x12')][_0x1493e2]=new Action(_0x48e840,_0x148d8e,_0x1493e2,_0x2aa21b,_0x1a15a2);var _0x44e061=_0x576b3e['actions'][_0x1493e2];_0x44e061[_0xd3f7('0x7e')]=_0x55f923;_0x44e061[_0xd3f7('0x7f')]=_0x39cd3a;_0x44e061['lookAgent']=_0x2aa21b;if(_['isEmpty'](_0x33da80)){_0x576b3e[_0xd3f7('0xe6')](_0x44e061,_0x148d8e,_0x48e840,_0x2aa21b)[_0xd3f7('0x57')](function(_0xf2de49){logger[_0xd3f7('0x23')](_0xd3f7('0xe7'),_0xd3f7('0xe8')+_0x44e061['queue']+_0xd3f7('0xe9')+_0x44e061[_0xd3f7('0x81')],JSON[_0xd3f7('0x25')](_0xf2de49));ami['emit'](_0xd3f7('0xea'),ut[_0xd3f7('0x8d')](_0x44e061,_0xd3f7('0xeb'),_0x576b3e[_0xd3f7('0xf')][_0x44e061[_0xd3f7('0x42')]]));_0xae1bdd(ut[_0xd3f7('0x2e')](_0xd3f7('0xec')));})[_0xd3f7('0x4a')](function(_0x1d6ddc){ut[_0xd3f7('0x2f')](_0xd3f7('0xed'),_0x1d6ddc);_0x482113(ut['message']('Call\x20failed',_0x55f923,_0x39cd3a));});}else{_0x148d8e['outboundBlacklistCallsDay']+=0x1;ut['logBlacklist'](_0x44e061);rpcDb['createHistory'](_0x44e061,_0xd3f7('0xee'));delete _0x576b3e[_0xd3f7('0x12')][_0x1493e2];_0x482113(ut[_0xd3f7('0x2e')](_0xd3f7('0xef'),_0x55f923,_0x39cd3a));}});};Preview[_0xd3f7('0x32')]['isTrunkReachable']=function(_0x4d91d8){return!_[_0xd3f7('0x3f')](_0x4d91d8)&&!_[_0xd3f7('0x3f')](_0x4d91d8['name'])&&!_[_0xd3f7('0x3f')](_0x4d91d8[_0xd3f7('0xf0')])&&_0x4d91d8[_0xd3f7('0xf0')]&&!_[_0xd3f7('0x3f')](this[_0xd3f7('0x11')][util[_0xd3f7('0x85')](_0xd3f7('0xf1'),_0x4d91d8[_0xd3f7('0x30')])])&&!_[_0xd3f7('0x3f')](this['trunks'][util[_0xd3f7('0x85')](_0xd3f7('0xf1'),_0x4d91d8[_0xd3f7('0x30')])]['status'])&&(this[_0xd3f7('0x11')][util[_0xd3f7('0x85')]('SIP/%s',_0x4d91d8[_0xd3f7('0x30')])][_0xd3f7('0xf2')]===_0xd3f7('0xf3')||this[_0xd3f7('0x11')][util[_0xd3f7('0x85')](_0xd3f7('0xf1'),_0x4d91d8['name'])][_0xd3f7('0xf2')]===_0xd3f7('0xf4'));};Preview['prototype']['run']=function(_0x249467,_0x5b3ffb){return this[_0xd3f7('0xf5')](_0x249467,_0x5b3ffb)[_0xd3f7('0x57')](function(_0x21803f){return _['pick'](_0x21803f,[_0xd3f7('0x2e')]);})[_0xd3f7('0x4a')](function(_0x316e7d){if(_0x316e7d[_0xd3f7('0xf6')]){rpcDb['unlockContact'](_0x249467);}if(_0x316e7d[_0xd3f7('0xf0')]){rpcDb['disableContact'](_0x249467);}throw _['pick'](_0x316e7d,[_0xd3f7('0x2e')]);});};Preview[_0xd3f7('0x32')][_0xd3f7('0xf5')]=function(_0x1024a9,_0x2c9c33){var _0x35aac1=this;var _0x5cbc2b,_0x2e42be;return rpcDb[_0xd3f7('0xf7')](_0x1024a9)[_0xd3f7('0x57')](function(_0x5c7813){if(!_[_0xd3f7('0x3f')](_0x5c7813[0x0])){_0x2e42be=_0x5c7813[0x0][_0xd3f7('0xf8')]?![]:!![];_0x5cbc2b=_0x5c7813[0x0][_0xd3f7('0xf8')]?!![]:![];_0x5cbc2b=_0x2c9c33?!![]:_0x5cbc2b;}var _0x3e77fa=_0x35aac1[_0xd3f7('0xf9')](_0x5c7813);if(_0x3e77fa['isValid']){rpcDb[_0xd3f7('0xfa')](_[_0xd3f7('0x45')](_0x5c7813[0x0],[_0xd3f7('0x47'),_0xd3f7('0xe4')]))[_0xd3f7('0x57')](function(_0x856f42){_0x35aac1[_0xd3f7('0xfb')](_0x856f42,_0x5c7813[0x0],_0x2c9c33,_0x2e42be,_0x5cbc2b)[_0xd3f7('0x57')](function(_0x44875b){return _0x44875b;})[_0xd3f7('0x4a')](function(_0x3ad559){throw _0x3ad559;});})[_0xd3f7('0x4a')](function(_0x3fcf1e){ut[_0xd3f7('0x2f')](_0xd3f7('0xfc'),_0x3fcf1e);throw ut[_0xd3f7('0x2e')](_0xd3f7('0xfd'),_0x2e42be,_0x5cbc2b);});}else{throw ut['message'](_0x3e77fa['message'],_0x2e42be,_0x5cbc2b);}})[_0xd3f7('0x4a')](function(_0x18c20a){ut['logger'](_0xd3f7('0xfe'),_0x18c20a);throw ut[_0xd3f7('0x2e')](_0xd3f7('0xfd'),![],!![]);});};Preview[_0xd3f7('0x32')][_0xd3f7('0xf9')]=function(_0x133d5c){if(_[_0xd3f7('0x3f')](_0x133d5c)||_[_0xd3f7('0xff')](_0x133d5c)||!_[_0xd3f7('0x3f')](_0x133d5c[0x0][_0xd3f7('0x5b')])&&_[_0xd3f7('0x3f')](_0x133d5c[0x0][_0xd3f7('0x5b')]['name'])){ut[_0xd3f7('0x2f')]('[Preview][validateContact][Empty\x20Contact]',_0x133d5c);return{'isValid':![],'message':_0xd3f7('0x100')};}var _0x36de06=this[_0xd3f7('0xf')][_0x133d5c[0x0][_0xd3f7('0x41')][_0xd3f7('0x30')]];_0x36de06[_0xd3f7('0x2e')]=utils[_0xd3f7('0x2b')][_0xd3f7('0x101')];if(_['isNil'](_0x36de06)){ut[_0xd3f7('0x2f')]('[Preview][validateContact][Empty\x20Campaign]',_0x36de06);return{'isValid':![],'message':_0xd3f7('0x102')};}if(!this[_0xd3f7('0x6d')](_0x36de06[_0xd3f7('0x6e')])){ut['logger'](_0xd3f7('0x103'),_0xd3f7('0x104')+_0x36de06[_0xd3f7('0x30')]+_0xd3f7('0x105'));if(!this[_0xd3f7('0x6d')](_0x36de06[_0xd3f7('0x6f')])){ut[_0xd3f7('0x2f')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x36de06[_0xd3f7('0x30')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0xd3f7('0x106')};}}if(!ut[_0xd3f7('0x107')](_0x36de06[_0xd3f7('0x3b')])){ut[_0xd3f7('0x2f')](_0xd3f7('0x108'),_0x36de06[_0xd3f7('0x30')]+_0xd3f7('0x109'));return{'isValid':![],'message':_0xd3f7('0x104')+_0x36de06[_0xd3f7('0x30')]+_0xd3f7('0x109')};}return{'isValid':!![],'message':_0xd3f7('0x10a')};};Preview[_0xd3f7('0x32')][_0xd3f7('0xe6')]=function(_0x1e8451,_0xe3da61,_0x52be21,_0x4a7083){var _0x4fa38c=this;return new Promise(function(_0x46f329,_0x2b6054){var _0x2534bd=_0x1e8451['uniqueid'];var _0x4b190e=_0x4fa38c[_0xd3f7('0x6d')](_0xe3da61['Trunk'])?util['format'](_0xd3f7('0x10b'),_0xe3da61['Trunk'][_0xd3f7('0x30')],_[_0xd3f7('0x3f')](_0xe3da61[_0xd3f7('0x10c')])?'':_0xe3da61[_0xd3f7('0x10c')][_0xd3f7('0x10d')]()||'',_0xe3da61['dialCutDigit']>0x0?_0x52be21[_0xd3f7('0xe4')][_0xd3f7('0x10e')](_0xe3da61['dialCutDigit']):_0x52be21[_0xd3f7('0xe4')]):util[_0xd3f7('0x85')](_0xd3f7('0x10b'),_[_0xd3f7('0x3f')](_0xe3da61[_0xd3f7('0x6f')])?_0xe3da61[_0xd3f7('0x6e')][_0xd3f7('0x30')]:_0xe3da61['TrunkBackup'][_0xd3f7('0x30')],_[_0xd3f7('0x3f')](_0xe3da61[_0xd3f7('0x10c')])?'':_0xe3da61[_0xd3f7('0x10c')][_0xd3f7('0x10d')]()||'',_0xe3da61[_0xd3f7('0x10f')]>0x0?_0x52be21[_0xd3f7('0xe4')]['substring'](_0xe3da61[_0xd3f7('0x10f')]):_0x52be21['phone']);var _0x3974df=_0x4fa38c[_0xd3f7('0x6d')](_0xe3da61[_0xd3f7('0x6e')])?ut[_0xd3f7('0x110')](_0xe3da61['Trunk'][_0xd3f7('0x111')],_0xe3da61[_0xd3f7('0x112')],_0xe3da61[_0xd3f7('0x113')]>0x0?ut[_0xd3f7('0x114')](_0xe3da61[_0xd3f7('0x115')],_0xe3da61[_0xd3f7('0x113')]):_0xe3da61[_0xd3f7('0x115')]):ut[_0xd3f7('0x110')](_['isNil'](_0xe3da61[_0xd3f7('0x6f')])?_0xe3da61[_0xd3f7('0x6e')][_0xd3f7('0x111')]:_0xe3da61[_0xd3f7('0x6f')][_0xd3f7('0x111')],_0xe3da61[_0xd3f7('0x112')],_0xe3da61[_0xd3f7('0x113')]>0x0?ut[_0xd3f7('0x114')](_0xe3da61[_0xd3f7('0x115')],_0xe3da61[_0xd3f7('0x113')]):_0xe3da61[_0xd3f7('0x115')]);if(_0x3974df){_0x1e8451['originatecalleridname']=ut['extractCalleridName'](_0x3974df);_0x1e8451[_0xd3f7('0x116')]=ut[_0xd3f7('0x117')](_0x3974df);}var _0x789fd5=ut[_0xd3f7('0x118')](_0xe3da61,_0x52be21,_0x4b190e,_0x3974df,_0x2534bd,_0x1e8451);var _0x386f3c=utils[_0xd3f7('0x119')](_0x52be21[_0xd3f7('0xe3')]);Object['assign'](_0x789fd5,_0x386f3c);_[_0xd3f7('0x11a')](_0x1e8451,ut[_0xd3f7('0x11b')](_0x789fd5));_0x1e8451[_0xd3f7('0x11c')]=moment()[_0xd3f7('0x85')]('YYYY-MM-DD\x20HH:mm:ss');_0xe3da61['variables']=_0x789fd5;var _0x14d298=ut['variablesAction'](_0x1e8451,_0xe3da61,_0x789fd5,_0x1e8451[_0xd3f7('0x7f')],_0x4a7083);return ami[_0xd3f7('0x11d')](_0x14d298)['then'](function(_0x14c158){_0xe3da61['originated']+=0x1;logger[_0xd3f7('0x23')]('[originated][increment]',_0x2534bd,_0xd3f7('0x8a'),_0xe3da61[_0xd3f7('0x30')],_0xd3f7('0x43'),_0xe3da61['originated']);_0x46f329(_0x14c158);})['catch'](function(_0x7dd99){ut[_0xd3f7('0xda')](_0x1e8451,0xe,'OriginateError');rpcDb[_0xd3f7('0xd8')](_0x1e8451,_0xd3f7('0x11e'));_0x2b6054(_0x7dd99);});});};Preview['prototype'][_0xd3f7('0x11f')]=function(_0x2fd47f){if(this['actions'][_0x2fd47f[_0xd3f7('0x9c')]]){this[_0xd3f7('0x12')][_0x2fd47f[_0xd3f7('0x9c')]][_0xd3f7('0x49')]=_0x2fd47f[_0xd3f7('0x49')];}};Preview[_0xd3f7('0x32')][_0xd3f7('0x15')]=function(_0x1c0f5c){var _0x191c0a=this;var _0x749a75=this[_0xd3f7('0x12')][_0x1c0f5c[_0xd3f7('0x120')]];if(_0x749a75){if(_0x749a75[_0xd3f7('0x121')]&&this[_0xd3f7('0x13')][_0x749a75['lookAgent']]){ut[_0xd3f7('0x122')](_0x749a75,this['agents'][_0x749a75['lookAgent']]['name'],this[_0xd3f7('0x13')][_0x749a75[_0xd3f7('0x121')]]['id']);}var _0x139d24=_[_0xd3f7('0x123')](_0x749a75);_0x139d24[_0xd3f7('0x86')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x386b0e=_0x191c0a['campaignsPreview'][_0x749a75['queue']];if(ut['isFailure'](_0x1c0f5c[_0xd3f7('0x124')])){if(_0x749a75[_0xd3f7('0x7e')]){rpcDb[_0xd3f7('0x125')](_0x749a75[_0xd3f7('0x81')]);}if(_0x749a75[_0xd3f7('0x7f')]){rpcDb[_0xd3f7('0x126')](_0x749a75[_0xd3f7('0x81')]);}ami[_0xd3f7('0x22')](_0xd3f7('0x127'),ut[_0xd3f7('0x8d')](_0x749a75,_0xd3f7('0x128'),this[_0xd3f7('0xf')][_0x749a75[_0xd3f7('0x42')]]));this['callProgressDetectingAgent'](_0x139d24,_0x386b0e,_0x1c0f5c);}else{_0x749a75[_0xd3f7('0x11c')]=moment()[_0xd3f7('0x85')](_0xd3f7('0x129'));ut[_0xd3f7('0xda')](_0x139d24,0x4,_0xd3f7('0x95'));rpcDb[_0xd3f7('0xd8')](_0x139d24,'[callProgressDetectingAgent][logAnswer]');}}};Preview[_0xd3f7('0x32')][_0xd3f7('0x18')]=function(_0x448bf1){var _0x442adf=this['actions'][_0x448bf1['linkedid']];var _0x3315fa;if(_0x442adf){_0x3315fa=this[_0xd3f7('0xf')][_0x442adf[_0xd3f7('0x42')]];logger[_0xd3f7('0x23')](_0xd3f7('0x12a'),_0x448bf1[_0xd3f7('0x9c')],_0xd3f7('0x8a'),_0x3315fa[_0xd3f7('0x30')],_0xd3f7('0x8b'),_0x3315fa[_0xd3f7('0x2a')]);}if(this[_0xd3f7('0x12')][_0x448bf1[_0xd3f7('0x9c')]]&&_0x448bf1[_0xd3f7('0x9c')]!==_0x448bf1['uniqueid']){if(_0x448bf1[_0xd3f7('0x12b')]==='16'&&this[_0xd3f7('0x12')][_0x448bf1[_0xd3f7('0x9c')]][_0xd3f7('0x44')]){this['callProgressDetectingCustomer'](_0x448bf1,_0x448bf1[_0xd3f7('0x9c')],_0x448bf1[_0xd3f7('0x12b')]);}else if(this[_0xd3f7('0x12')][_0x448bf1[_0xd3f7('0x9c')]][_0xd3f7('0x44')]){logger['info'](_0xd3f7('0x12c'),_0x448bf1[_0xd3f7('0x9c')],_0x448bf1[_0xd3f7('0x12b')],'\x20Queue',_0x3315fa[_0xd3f7('0x30')],'pTalking:\x20',_0x3315fa[_0xd3f7('0x2a')]);this[_0xd3f7('0x12d')](_0x448bf1,_0x448bf1['linkedid'],_0x448bf1[_0xd3f7('0x12b')]);}}else if(_0x442adf&&_[_0xd3f7('0x3f')](_0x442adf[_0xd3f7('0x12e')])&&_0x3315fa[_0xd3f7('0x12f')]&&_0x448bf1[_0xd3f7('0x9c')]===_0x448bf1[_0xd3f7('0x89')]&&_[_0xd3f7('0x3f')](_0x448bf1['reason'])&&_0x448bf1[_0xd3f7('0x12b')]==='16'&&_0x448bf1[_0xd3f7('0x130')]==='6'&&_[_0xd3f7('0xd5')](_0x442adf[_0xd3f7('0x131')])){if(_0x442adf[_0xd3f7('0x7e')]){rpcDb[_0xd3f7('0x125')](_0x442adf[_0xd3f7('0x81')]);}if(_0x442adf[_0xd3f7('0x7f')]){rpcDb[_0xd3f7('0x126')](_0x442adf[_0xd3f7('0x81')]);}_0x448bf1[_0xd3f7('0xd7')]='22';this['callProgressDetectingAgent'](_0x442adf,_0x3315fa,_0x448bf1);}else if(_0x442adf&&_0x442adf[_0xd3f7('0x131')]){if(_0x448bf1[_0xd3f7('0x12b')]==='16'&&this['actions'][_0x448bf1[_0xd3f7('0x9c')]][_0xd3f7('0x44')]){logger[_0xd3f7('0x23')]('[syncHangup][talking][transfer]',_0x448bf1[_0xd3f7('0x9c')],_0x448bf1[_0xd3f7('0x12b')],_0xd3f7('0x8a'),_0x3315fa['name'],'pTalking:\x20',_0x3315fa['pTalking']);this[_0xd3f7('0x12d')](_0x448bf1,_0x448bf1[_0xd3f7('0x9c')],_0x448bf1[_0xd3f7('0x12b')]);}else if(this['actions'][_0x448bf1[_0xd3f7('0x9c')]][_0xd3f7('0x44')]){logger[_0xd3f7('0x23')](_0xd3f7('0x12c'),_0x448bf1['linkedid'],_0x448bf1[_0xd3f7('0x12b')],_0xd3f7('0x8a'),_0x3315fa[_0xd3f7('0x30')],_0xd3f7('0x8b'),_0x3315fa[_0xd3f7('0x2a')]);this[_0xd3f7('0x12d')](_0x448bf1,_0x448bf1[_0xd3f7('0x9c')],_0x448bf1['cause']);}}};Preview[_0xd3f7('0x32')][_0xd3f7('0x1b')]=function(_0x35321b){if(this['actions'][_0x35321b[_0xd3f7('0xd2')]]&&_0x35321b[_0xd3f7('0xd2')]!==_0x35321b[_0xd3f7('0x132')]){this[_0xd3f7('0x12d')](_0x35321b,_0x35321b['destlinkedid'],_0x35321b[_0xd3f7('0xc8')]);}};Preview['prototype']['syncHangupRequest']=function(_0x384b83){if(this[_0xd3f7('0x12')][_0x384b83[_0xd3f7('0x9c')]]&&_0x384b83['linkedid']!==_0x384b83[_0xd3f7('0x89')]&&!this[_0xd3f7('0x12')][_0x384b83[_0xd3f7('0x9c')]][_0xd3f7('0x44')]){if(_0x384b83[_0xd3f7('0x12b')]==='1'){this[_0xd3f7('0x12d')](_0x384b83,_0x384b83[_0xd3f7('0x9c')],_0x384b83['cause']);}}};Preview[_0xd3f7('0x32')][_0xd3f7('0x133')]=function(_0x2d4fd3,_0x173023,_0x44e558){if(this[_0xd3f7('0x12')][_0x2d4fd3]){if(_['isNil'](this['actions'][_0x2d4fd3][_0xd3f7('0x134')])){this[_0xd3f7('0x12')][_0x2d4fd3][_0xd3f7('0x134')]={};}this[_0xd3f7('0x12')][_0x2d4fd3][_0xd3f7('0x134')][_0x173023]=_0x44e558;}};Preview[_0xd3f7('0x32')]['syncVarSet']=function(_0x252d22){try{if(!_[_0xd3f7('0x3f')](_0x252d22)){if(ut[_0xd3f7('0x135')](_['keys'](_0x252d22[_0xd3f7('0x136')])[0x0])){this['addVariable'](_0x252d22[_0xd3f7('0x89')],_[_0xd3f7('0x137')](_0x252d22[_0xd3f7('0x136')])[0x0],_0x252d22[_0xd3f7('0x138')]);}}}catch(_0x1ee3f2){logger[_0xd3f7('0x139')](_0xd3f7('0x13a'),util[_0xd3f7('0x13b')](_0x1ee3f2,{'showHidden':![],'depth':null}));}};Preview['prototype'][_0xd3f7('0x1f')]=function(_0x1107d3){if(_0x1107d3){if(this[_0xd3f7('0x12')][_0x1107d3[_0xd3f7('0x13c')]]){this[_0xd3f7('0x12')][_0x1107d3[_0xd3f7('0x13c')]]['transfer']=!![];}}};Preview[_0xd3f7('0x32')]['syncBlindTransfer']=function(_0x35b838){if(_0x35b838){if(this[_0xd3f7('0x12')][_0x35b838[_0xd3f7('0x13d')]]){this[_0xd3f7('0x12')][_0x35b838[_0xd3f7('0x13d')]][_0xd3f7('0x131')]=!![];}}};module['exports']=Preview; \ No newline at end of file +var _0x363a=['NoAnswer','dialNoAnswerRetryFrequency','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','dialNoAnswerMaxRetry','CONGESTION','outboundCongestionCallsDay','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','countcongestionretry','dialCongestionMaxRetry','CANCEL','outboundRejectCallsDay','countagentrejectretry','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','AgentReject','dialAgentRejectMaxRetry','[callProgressDetectingCustomer][logAgentReject]','countabandonedretry','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','outboundUnknownCallsDay','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','linkedid','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','queueSummaryCountersUpdated','isUndefined','object','logAgent','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','createAgentHistory','[callProgressDetectingAgent][logCongestion]','AnswerAGI','reason','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','resolve','[incrementPreviewCounters]\x20','checkInBlack','Contact','phone','VoiceQueueId','Contact\x20is\x20undefined','Queue','lookAgent','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','[Blacklist][error]','isTrunkReachable','active','SIP/%s','unmonitored','run','pick','unlock','unlockContact','execRun','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','extractCalleridName','originatecalleridnum','addVariables','merge','toLowerVariables','variables','variablesAction','[originateFailure][logOriginateFailure]','syncNewExten','logLookAgent','clone','isFailure','response','rejected','callProgressDetectingAgent','Answer','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','channelstate','transfer','[syncHangup][talking][transfer]','destuniqueid','addVariable','filterKey','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','lodash','moment','../../../config/environment','../../../config/logger','actionPreview','../ami','../rpc/cmHopperAdditionalPhone','./action','./util/util','../dialer/utils','redis','defaults','localhost','prototype','enqueue','tail','finally','sequence','campaignsPreview','trunks','actions','agents','syncOriginateResponse','bind','hangup','syncHangup','syncHangupRequest','dialend','syncDialEnd','varset','syncVarSet','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','info','format','voice_queue_channel:remove','sendMessageOneNotActive','pTalking','available','paused','message','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','name','\x20is\x20not\x20active','CAMPAIGN_STATUS','\x20is\x20deactivated','syncCampaigns','clockClearZombieChannels','preview','dialMethod','booked','type','outbound','clearZombieChannels','dialActive','setMessage','dialPreviewAutoRecallMe','clearZombieChannel','isNil','[clearZombieChannels][talking]','queue','originated:\x20','originated','pTalking:\x20','stringify','dialAnswer','ListId','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','size','hasOwnProperty','recallMe','getContactRecallMe','agentReadyId','then','length','getDiff','dialRecallMeTimeout','Agent','voicePause','[RecallMe]','logger2','disableContact','starttime','outboundReCallsDay','logCustomer','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','createCustomerFinal','[HistoryRecallClose]','[getContactRecallMe]','loggedIn','isActive','Trunk','TrunkBackup','UNREACHABLE_TRUNK','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','callAdditionalPhoneAfterMin','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','unlockAgent','actioncountonusuch','incrementPreviewCounters','idContact','ANSWER','YYYY-MM-DD\x20HH:mm:ss','responsetime','answertime','uniqueid','connect','buildAcw','custom:agentcomplete','complete','outboundAnswerCallsDay','total','answered','decrementTalkink','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','sumBillable','\x20Queue','BUSY','outboundBusyCallsDay','Busy','dialBusyRetryFrequency','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','countbusyretry','activeContact','swapAdditionalPhones','NOANSWER','outboundNoAnswerCallsDay','countnoanswerretry'];(function(_0x1e753b,_0x209149){var _0x13d34e=function(_0x338150){while(--_0x338150){_0x1e753b['push'](_0x1e753b['shift']());}};_0x13d34e(++_0x209149);}(_0x363a,0x97));var _0xa363=function(_0x2a7066,_0x279e23){_0x2a7066=_0x2a7066-0x0;var _0x21814e=_0x363a[_0x2a7066];return _0x21814e;};'use strict';var util=require('util');var _=require(_0xa363('0x0'));var uuid=require('uuid');var moment=require(_0xa363('0x1'));var Redis=require('ioredis');var config=require(_0xa363('0x2'));var logger=require(_0xa363('0x3'))('preview');var loggerAction=require(_0xa363('0x3'))(_0xa363('0x4'));var ami=require(_0xa363('0x5'));var rpcDb=require('./rpcDb');var cmHopperAdditionalPhone=require(_0xa363('0x6'));var Action=require(_0xa363('0x7'));var ut=require(_0xa363('0x8'));var utils=require(_0xa363('0x9'));config[_0xa363('0xa')]=_[_0xa363('0xb')](config[_0xa363('0xa')],{'host':_0xa363('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa363('0xa')]));var Sequence=function(){};Sequence[_0xa363('0xd')][_0xa363('0xe')]=function(_0x5efaba){this['tail']=this[_0xa363('0xf')]?this['tail'][_0xa363('0x10')](_0x5efaba):_0x5efaba();};function Preview(_0x4a9b69){this[_0xa363('0x11')]=new Sequence();this[_0xa363('0x12')]=_0x4a9b69['voiceQueues'];this[_0xa363('0x13')]=_0x4a9b69[_0xa363('0x13')];this[_0xa363('0x14')]={};this[_0xa363('0x15')]=_0x4a9b69[_0xa363('0x15')];this['clockClearZombieChannels']=0x0;ami['on']('originateresponse',this[_0xa363('0x16')][_0xa363('0x17')](this));ami['on'](_0xa363('0x18'),this[_0xa363('0x19')]['bind'](this));ami['on']('hanguprequest',this[_0xa363('0x1a')][_0xa363('0x17')](this));ami['on'](_0xa363('0x1b'),this[_0xa363('0x1c')][_0xa363('0x17')](this));ami['on']('newexten',this['syncNewExten'][_0xa363('0x17')](this));ami['on'](_0xa363('0x1d'),this[_0xa363('0x1e')]['bind'](this));ami['on']('attendedtransfer',this[_0xa363('0x1f')][_0xa363('0x17')](this));ami['on'](_0xa363('0x20'),this[_0xa363('0x21')][_0xa363('0x17')](this));this[_0xa363('0x22')](this[_0xa363('0x12')]);}function emit(_0x106670,_0x595350,_0x1d1169){io['to'](_0x106670)[_0xa363('0x23')](_0x595350,_0x1d1169);}function emitVoiceQueueChannelRemove(_0x5436b6){logger[_0xa363('0x24')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON['stringify'](_0x5436b6));emit(util[_0xa363('0x25')]('voice:queue:%s',_0x5436b6['name']),_0xa363('0x26'),_0x5436b6);io[_0xa363('0x23')]('voice_queue_presence:remove',_0x5436b6);}function notSendMessagesQueue(_0x2f1851){if(_0x2f1851[_0xa363('0x27')]){if(_0x2f1851['originated']===0x0&&_0x2f1851[_0xa363('0x28')]===0x0){_0x2f1851[_0xa363('0x27')]=![];_0x2f1851[_0xa363('0x29')]=0x0;_0x2f1851[_0xa363('0x2a')]=0x0;_0x2f1851[_0xa363('0x2b')]=utils['CAMPAIGN_STATUS']['INACTIVE'];ut[_0xa363('0x2c')](_0xa363('0x2d'),_0x2f1851[_0xa363('0x2e')]+_0xa363('0x2f'));}else{_0x2f1851[_0xa363('0x2b')]=utils[_0xa363('0x30')]['DEACTIVATED'];ut[_0xa363('0x2c')](_0xa363('0x2d'),_0x2f1851[_0xa363('0x2e')]+_0xa363('0x31'));}}}Preview[_0xa363('0xd')][_0xa363('0x22')]=function(){var _0x45a9e3=this;setInterval(function(){_0x45a9e3[_0xa363('0x32')]();},0x7cf);};Preview[_0xa363('0xd')][_0xa363('0x32')]=function(){var _0x49edad=this[_0xa363('0x12')];this[_0xa363('0x33')]+=0x1;for(var _0x457843 in _0x49edad){if(_0x49edad['hasOwnProperty'](_0x457843)&&(_0x49edad[_0x457843]['dialMethod']===_0xa363('0x34')||_0x49edad[_0x457843][_0xa363('0x35')]===_0xa363('0x36'))&&_0x49edad[_0x457843][_0xa363('0x37')]===_0xa363('0x38')){if(this[_0xa363('0x33')]>0x7){this['clockClearZombieChannels']=0x0;this[_0xa363('0x39')]();}}if(_0x49edad['hasOwnProperty'](_0x457843)&&_0x49edad[_0x457843][_0xa363('0x35')]===_0xa363('0x34')&&_0x49edad[_0x457843]['type']==='outbound'){if(_0x49edad[_0x457843][_0xa363('0x3a')]){this[_0xa363('0x3b')](_0x49edad[_0x457843]);if(_0x49edad[_0x457843][_0xa363('0x3c')])this['recallMe'](_0x49edad[_0x457843]);}else{notSendMessagesQueue(_0x49edad[_0x457843]);}}}};Preview[_0xa363('0xd')][_0xa363('0x3d')]=function(_0x3a71b1){var _0x3f0568=this;this[_0xa363('0x11')][_0xa363('0xe')](function(){if(!_[_0xa363('0x3e')](_0x3f0568[_0xa363('0x14')][_0x3a71b1])){loggerAction[_0xa363('0x24')](_0xa363('0x3f'),_0x3a71b1,'Queue',_0x3f0568[_0xa363('0x14')][_0x3a71b1][_0xa363('0x40')],_0xa363('0x41'),JSON['stringify'](_0x3f0568[_0xa363('0x12')][_0x3f0568['actions'][_0x3a71b1][_0xa363('0x40')]][_0xa363('0x42')]),_0xa363('0x43'),JSON[_0xa363('0x44')](_0x3f0568[_0xa363('0x12')][_0x3f0568[_0xa363('0x14')][_0x3a71b1][_0xa363('0x40')]][_0xa363('0x28')]),JSON[_0xa363('0x44')](_0x3f0568[_0xa363('0x14')][_0x3a71b1][_0xa363('0x45')]),JSON['stringify'](_['pick'](_0x3f0568[_0xa363('0x14')][_0x3a71b1],['contactId','UserId','VoiceQueueId',_0xa363('0x46')])));return ami[_0xa363('0x47')]({'action':_0xa363('0x48'),'channel':_0x3f0568[_0xa363('0x14')][_0x3a71b1][_0xa363('0x49')]})[_0xa363('0x4a')](function(_0x3f0de0){if(_0x3f0de0[_0xa363('0x2b')]===_0xa363('0x4b')){setTimeout(function(){if(_0x3f0568[_0xa363('0x14')][_0x3a71b1]){ut[_0xa363('0x4c')](_0x3f0568[_0xa363('0x12')][_0x3f0568[_0xa363('0x14')][_0x3a71b1][_0xa363('0x40')]],'[clearZombieChannel]');if(_0x3f0568[_0xa363('0x14')][_0x3a71b1][_0xa363('0x45')]===!![]){ut['decrementTalkink'](_0x3f0568[_0xa363('0x12')][_0x3f0568[_0xa363('0x14')][_0x3a71b1]['queue']],_0xa363('0x4d'));ut[_0xa363('0x4e')](_0xa363('0x4f')+_0x3a71b1,_0x3f0568[_0xa363('0x14')][_0x3a71b1][_0xa363('0x40')]);}ut[_0xa363('0x4e')](_0xa363('0x50')+_0x3a71b1,_0x3f0568[_0xa363('0x14')][_0x3a71b1]['queue']);delete _0x3f0568[_0xa363('0x14')][_0x3a71b1];}},0x2328);}});}});};Preview[_0xa363('0xd')]['clearZombieChannels']=function(){var _0x3e7682=this;loggerAction[_0xa363('0x24')](_0xa363('0x51'),_[_0xa363('0x52')](this[_0xa363('0x14')]));for(var _0x5c1efe in this[_0xa363('0x14')]){if(_0x3e7682[_0xa363('0x14')][_0xa363('0x53')](_0x5c1efe)){_0x3e7682['clearZombieChannel'](_0x5c1efe);}}};Preview[_0xa363('0xd')][_0xa363('0x54')]=function(_0x211a84){var _0x5c23eb=this;rpcDb[_0xa363('0x55')](_0x211a84['id'],ut[_0xa363('0x56')](this[_0xa363('0x15')]))[_0xa363('0x57')](function(_0x22f73a){if(!_[_0xa363('0x3e')](_0x22f73a)){for(var _0x3e844c=0x0;_0x3e844c<_0x22f73a[_0xa363('0x58')];_0x3e844c+=0x1){if(ut[_0xa363('0x59')](_0x22f73a[_0x3e844c]['scheduledat'])<_0x211a84[_0xa363('0x5a')]*0x3c){if(_0x22f73a[_0x3e844c][_0xa363('0x5b')]&&!_0x22f73a[_0x3e844c]['Agent'][_0xa363('0x5c')]){_0x5c23eb['run'](_0x22f73a[_0x3e844c]['id'])[_0xa363('0x57')](ut['logger2'](_0xa363('0x5d')))[_0xa363('0x4a')](ut[_0xa363('0x5e')](_0xa363('0x5d')));}else{rpcDb[_0xa363('0x5f')](_0x22f73a[_0x3e844c]['id']);}}else{var _0x58111d=new Action(_0x22f73a[_0x3e844c],_0x211a84);_0x58111d[_0xa363('0x60')]=moment()[_0xa363('0x25')]('YYYY-MM-DD\x20HH:mm:ss');_0x211a84[_0xa363('0x61')]+=0x1;ut[_0xa363('0x62')](_0x58111d,0x17,'RecallInQueue');if(_0x211a84[_0xa363('0x63')]){rpcDb[_0xa363('0x64')](ut[_0xa363('0x65')](_0x22f73a[_0x3e844c]));rpcDb[_0xa363('0x66')](_0x58111d,_0xa363('0x67'));}else{ut['logCustomer'](_0x58111d,0x16,_0xa363('0x68'));rpcDb[_0xa363('0x66')](_0x58111d,'[HistoryRecallClose]');rpcDb[_0xa363('0x69')](_0x58111d,_0xa363('0x6a'));}}}}})['catch'](ut['logger2'](_0xa363('0x6b')));};Preview[_0xa363('0xd')][_0xa363('0x3b')]=function(_0x13727c){_0x13727c[_0xa363('0x27')]=!![];if(ut['IsNotLoggedIn'](_0x13727c[_0xa363('0x6c')])){_0x13727c[_0xa363('0x2b')]=utils[_0xa363('0x30')]['NO_AGENTS_LOGGED'];}else if(!ut[_0xa363('0x6d')](_0x13727c[_0xa363('0x3a')])){_0x13727c[_0xa363('0x2b')]=utils['CAMPAIGN_STATUS']['INACTIVE'];}else if(!this['isTrunkReachable'](_0x13727c[_0xa363('0x6e')])){if(!this['isTrunkReachable'](_0x13727c[_0xa363('0x6f')])){_0x13727c[_0xa363('0x2b')]=utils['CAMPAIGN_STATUS'][_0xa363('0x70')];}else{_0x13727c[_0xa363('0x2b')]=utils['CAMPAIGN_STATUS'][_0xa363('0x71')];}}else{_0x13727c[_0xa363('0x2b')]=utils[_0xa363('0x30')][_0xa363('0x71')];}};Preview[_0xa363('0xd')][_0xa363('0x72')]=function(_0x570be0,_0x81a6e,_0x46d30d){var _0x34c686=this;var _0x1ce4e7=this[_0xa363('0x14')][_0x81a6e];var _0x400652=this[_0xa363('0x12')][_0x1ce4e7[_0xa363('0x40')]];var _0x3a8610;var _0x2d2a4f=![];var _0x3d1869=0x2;var _0x288f07=0x3;if(_0x400652){switch(_0x46d30d){case'1':_0x400652[_0xa363('0x73')]+=0x1;_0x1ce4e7[_0xa363('0x74')]+=0x1;_0x1ce4e7[_0xa363('0x75')]=ut[_0xa363('0x76')](_0x1ce4e7);ut['logCustomer'](_0x1ce4e7,0x0,'NoSuchNumber');ami[_0xa363('0x23')](_0xa363('0x77'),ut[_0xa363('0x78')](_0x1ce4e7,_0xa363('0x79')));rpcDb['createCustomerHistory'](_0x1ce4e7,_0xa363('0x7a'));_0x34c686[_0xa363('0x7b')](_0x1ce4e7,'0',_0x400652)[_0xa363('0x57')](function(_0x5779f8){_0x2d2a4f=_0x5779f8[_0xa363('0x7c')]==0x1;_0x3d1869=_0x400652[_0xa363('0x7d')];_0x288f07=_0x400652[_0xa363('0x7e')];if(!_0x2d2a4f){if(ut[_0xa363('0x76')](_0x1ce4e7)>=_0x400652['dialGlobalMaxRetry']){_0x3a8610=ut[_0xa363('0x7f')](_0x1ce4e7,0xf,_0xa363('0x80'));rpcDb[_0xa363('0x69')](_0x3a8610,_0xa363('0x81'));}else{if(_0x1ce4e7[_0xa363('0x74')]>=_0x400652['dialNoSuchNumberMaxRetry']){rpcDb['createCustomerFinal'](_0x1ce4e7,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb[_0xa363('0x82')](ut[_0xa363('0x83')](_0x1ce4e7,_0xa363('0x74'),_0x400652[_0xa363('0x7d')]),_0x1ce4e7[_0xa363('0x84')],_0x1ce4e7['activeContact']);}}delete this[_0xa363('0x14')][_0x570be0['linkedid']];}else{_0x1ce4e7[_0xa363('0x74')]++;logger[_0xa363('0x24')](_0xa363('0x85'),_0x1ce4e7[_0xa363('0x74')]);logger['info']('id',_0x1ce4e7['idContact']);_0x34c686[_0xa363('0x86')]({'id':_0x1ce4e7[_0xa363('0x87')],'field':{'countnosuchnumberretry':_0x1ce4e7[_0xa363('0x74')]}})[_0xa363('0x57')](function(){_0x34c686['swapAdditionalPhones'](_0x1ce4e7,_0x3d1869,_0x288f07)[_0xa363('0x57')](function(){});});}});break;case _0xa363('0x88'):var _0x3fe520=moment()[_0xa363('0x25')](_0xa363('0x89'));_0x1ce4e7[_0xa363('0x8a')]=_0x3fe520;_0x1ce4e7[_0xa363('0x8b')]=_0x3fe520;_0x1ce4e7[_0xa363('0x45')]=!![];_0x400652[_0xa363('0x28')]+=0x1;logger['info']('[syncHangup][talking][increment]',_0x1ce4e7[_0xa363('0x8c')],'\x20Queue',_0x400652[_0xa363('0x2e')],_0xa363('0x43'),_0x400652[_0xa363('0x28')]);ami['emit']('custom:agentconnect',ut['buildObj'](_0x1ce4e7,_0xa363('0x8d'),this['campaignsPreview'][_0x1ce4e7['queue']]));if(_0x400652['acw']){ami['emit']('custom:agentConnectPreview',ut[_0xa363('0x8e')](_0x1ce4e7));}break;case'16':ami[_0xa363('0x23')](_0xa363('0x8f'),ut[_0xa363('0x78')](_0x1ce4e7,_0xa363('0x90'),this[_0xa363('0x12')][_0x1ce4e7[_0xa363('0x40')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x1ce4e7,_0xa363('0x90')));_0x400652[_0xa363('0x91')]+=0x1;_0x400652[_0xa363('0x92')]+=0x1;_0x400652[_0xa363('0x93')]+=0x1;ut[_0xa363('0x94')](_0x400652,'[16]');_0x1ce4e7[_0xa363('0x75')]=ut[_0xa363('0x76')](_0x1ce4e7);ut[_0xa363('0x62')](_0x1ce4e7,0x4,'Answer');rpcDb[_0xa363('0x66')](_0x1ce4e7,_0xa363('0x95'));rpcDb[_0xa363('0x69')](_0x1ce4e7,_0xa363('0x96'));rpcDb[_0xa363('0x97')](_0x1ce4e7);_0x400652[_0xa363('0x98')]+=_0x1ce4e7[_0xa363('0x99')];_0x400652[_0xa363('0x9a')]+=_0x1ce4e7[_0xa363('0x99')];logger[_0xa363('0x24')]('[syncHangup][talking][decrement]',_0x1ce4e7[_0xa363('0x8c')],_0xa363('0x9b'),_0x400652[_0xa363('0x2e')],_0xa363('0x43'),_0x400652[_0xa363('0x28')]);delete this[_0xa363('0x14')][_0x570be0['linkedid']];break;case _0xa363('0x9c'):_0x400652[_0xa363('0x9d')]+=0x1;_0x1ce4e7['countbusyretry']+=0x1;_0x1ce4e7[_0xa363('0x75')]=ut[_0xa363('0x76')](_0x1ce4e7);ut[_0xa363('0x62')](_0x1ce4e7,0x5,_0xa363('0x9e'));_0x3d1869=_0x400652[_0xa363('0x9f')];_0x288f07=_0x400652['callAdditionalPhoneAfterMin'];ami[_0xa363('0x23')](_0xa363('0xa0'),ut[_0xa363('0x78')](_0x1ce4e7,_0xa363('0xa1')));rpcDb[_0xa363('0x66')](_0x1ce4e7,_0xa363('0xa2'));_0x34c686[_0xa363('0x7b')](_0x1ce4e7,'5',_0x400652)['then'](function(_0x276431){_0x2d2a4f=_0x276431[_0xa363('0x7c')]==0x1;if(!_0x2d2a4f){if(ut[_0xa363('0x76')](_0x1ce4e7)>=_0x400652[_0xa363('0xa3')]){_0x3a8610=ut[_0xa363('0x7f')](_0x1ce4e7,0xf,'Global');rpcDb[_0xa363('0x69')](_0x3a8610,_0xa363('0xa4'));}else{if(_0x1ce4e7['countbusyretry']>=_0x400652[_0xa363('0xa5')]){rpcDb[_0xa363('0x69')](_0x1ce4e7,_0xa363('0xa2'));}else{rpcDb[_0xa363('0x82')](ut[_0xa363('0x83')](_0x1ce4e7,_0xa363('0xa6'),_0x400652['dialBusyRetryFrequency']),_0x1ce4e7[_0xa363('0x84')],_0x1ce4e7[_0xa363('0xa7')]);}}}else{_0x1ce4e7[_0xa363('0xa6')]++;_0x34c686[_0xa363('0x86')]({'id':_0x1ce4e7[_0xa363('0x87')],'field':{'countbusyretry':_0x1ce4e7['countbusyretry']}})[_0xa363('0x57')](function(){_0x34c686[_0xa363('0xa8')](_0x1ce4e7,_0x3d1869,_0x288f07)[_0xa363('0x57')](function(){});});}});break;case _0xa363('0xa9'):_0x400652[_0xa363('0xaa')]+=0x1;_0x1ce4e7[_0xa363('0xab')]+=0x1;_0x1ce4e7[_0xa363('0x75')]=ut['totalGlobal'](_0x1ce4e7);ut['logCustomer'](_0x1ce4e7,0x3,_0xa363('0xac'));_0x3d1869=_0x400652[_0xa363('0xad')];_0x288f07=_0x400652[_0xa363('0x7e')];var _0x1642e9=ut['buildNoAnswerEventPayload'](_0x1ce4e7,_0x400652);ami[_0xa363('0x23')](_0xa363('0xae'),_0x1642e9);rpcDb[_0xa363('0x66')](_0x1ce4e7,_0xa363('0xaf'));_0x34c686[_0xa363('0x7b')](_0x1ce4e7,'3',_0x400652)['then'](function(_0x32e350){_0x2d2a4f=_0x32e350[_0xa363('0x7c')]==0x1;if(!_0x2d2a4f){if(ut['totalGlobal'](_0x1ce4e7)>=_0x400652['dialGlobalMaxRetry']){_0x3a8610=ut['cloneAction'](_0x1ce4e7,0xf,'Global');rpcDb[_0xa363('0x69')](_0x3a8610,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x1ce4e7['countnoanswerretry']>=_0x400652[_0xa363('0xb0')]){rpcDb[_0xa363('0x69')](_0x1ce4e7,_0xa363('0xaf'));}else{rpcDb[_0xa363('0x82')](ut[_0xa363('0x83')](_0x1ce4e7,_0xa363('0xab'),_0x400652[_0xa363('0xad')]),_0x1ce4e7[_0xa363('0x84')],_0x1ce4e7[_0xa363('0xa7')]);}}}else{_0x1ce4e7[_0xa363('0xab')]++;_0x34c686[_0xa363('0x86')]({'id':_0x1ce4e7[_0xa363('0x87')],'field':{'countnoanswerretry':_0x1ce4e7[_0xa363('0xab')]}})[_0xa363('0x57')](function(){_0x34c686['swapAdditionalPhones'](_0x1ce4e7,_0x3d1869,_0x288f07)[_0xa363('0x57')](function(){});});}});break;case _0xa363('0xb1'):_0x400652[_0xa363('0xb2')]+=0x1;_0x1ce4e7['countcongestionretry']+=0x1;_0x1ce4e7[_0xa363('0x75')]=ut[_0xa363('0x76')](_0x1ce4e7);ut['logCustomer'](_0x1ce4e7,0x8,_0xa363('0xb3'));_0x3d1869=_0x400652['dialCongestionRetryFrequency'];_0x288f07=_0x400652[_0xa363('0x7e')];ami[_0xa363('0x23')](_0xa363('0xb4'),ut[_0xa363('0x78')](_0x1ce4e7,_0xa363('0xb5')));rpcDb[_0xa363('0x66')](_0x1ce4e7,_0xa363('0xb6'));_0x34c686['verifyAdditionalPhones'](_0x1ce4e7,'8',_0x400652)[_0xa363('0x57')](function(_0x265f0e){_0x2d2a4f=_0x265f0e[_0xa363('0x7c')]==0x1;if(!_0x2d2a4f){if(ut[_0xa363('0x76')](_0x1ce4e7)>=_0x400652[_0xa363('0xa3')]){_0x3a8610=ut[_0xa363('0x7f')](_0x1ce4e7,0xf,_0xa363('0x80'));rpcDb[_0xa363('0x69')](_0x3a8610,_0xa363('0xb7'));}else{if(_0x1ce4e7[_0xa363('0xb8')]>=_0x400652[_0xa363('0xb9')]){rpcDb[_0xa363('0x69')](_0x1ce4e7,_0xa363('0xb6'));}else{rpcDb[_0xa363('0x82')](ut['scheduledAt'](_0x1ce4e7,_0xa363('0xb8'),_0x400652[_0xa363('0x9f')]),_0x1ce4e7[_0xa363('0x84')],_0x1ce4e7['activeContact']);}}}else{_0x1ce4e7['countcongestionretry']++;_0x34c686[_0xa363('0x86')]({'id':_0x1ce4e7[_0xa363('0x87')],'field':{'countcongestionretry':_0x1ce4e7[_0xa363('0xb8')]}})[_0xa363('0x57')](function(){_0x34c686[_0xa363('0xa8')](_0x1ce4e7,_0x3d1869,_0x288f07)['then'](function(){});});}});break;case _0xa363('0xba'):_0x400652[_0xa363('0xbb')]+=0x1;_0x1ce4e7[_0xa363('0xbc')]+=0x1;_0x1ce4e7[_0xa363('0x75')]=ut[_0xa363('0x76')](_0x1ce4e7);ut[_0xa363('0x62')](_0x1ce4e7,0x14,'AgentReject');_0x3d1869=_0x400652[_0xa363('0xbd')];_0x288f07=_0x400652[_0xa363('0x7e')];ami[_0xa363('0x23')](_0xa363('0xbe'),ut['buildObj'](_0x1ce4e7,_0xa363('0xbf')));rpcDb[_0xa363('0x66')](_0x1ce4e7,'[syncHangupRequest][logAgentReject]');_0x34c686[_0xa363('0x7b')](_0x1ce4e7,'20',_0x400652)['then'](function(_0x17735e){_0x2d2a4f=_0x17735e[_0xa363('0x7c')]==0x1;if(!_0x2d2a4f){if(ut[_0xa363('0x76')](_0x1ce4e7)>=_0x400652['dialGlobalMaxRetry']){_0x3a8610=ut[_0xa363('0x7f')](_0x1ce4e7,0x14,_0xa363('0xc0'));rpcDb[_0xa363('0x69')](_0x3a8610,'[callProgressDetectingCustomer][logAgentReject]');}else{if(_0x1ce4e7['countagentrejectretry']>=_0x400652[_0xa363('0xc1')]){rpcDb[_0xa363('0x69')](_0x1ce4e7,_0xa363('0xc2'));}else{rpcDb['rescheduleContact'](ut[_0xa363('0x83')](_0x1ce4e7,'countagentrejectretry',_0x400652[_0xa363('0xbd')]),_0x1ce4e7[_0xa363('0x84')],_0x1ce4e7[_0xa363('0xa7')]);}}}else{_0x1ce4e7[_0xa363('0xab')]++;_0x34c686[_0xa363('0x86')]({'id':_0x1ce4e7[_0xa363('0x87')],'field':{'countnoanswerretry':_0x1ce4e7[_0xa363('0xab')]}})['then'](function(){_0x34c686[_0xa363('0xa8')](_0x1ce4e7,_0x3d1869,_0x288f07)[_0xa363('0x57')](function(){});});}});break;case'ABANDONED':_0x400652['outboundAbandonedCallsDay']+=0x1;_0x1ce4e7[_0xa363('0xc3')]+=0x1;_0x1ce4e7[_0xa363('0x75')]=ut['totalGlobal'](_0x1ce4e7);ut['logCustomer'](_0x1ce4e7,0xb,'Abandoned');rpcDb[_0xa363('0x66')](_0x1ce4e7,_0xa363('0xc4'));_0x34c686[_0xa363('0x7b')](_0x1ce4e7,'11',_0x400652)[_0xa363('0x57')](function(_0x3a8aea){_0x2d2a4f=_0x3a8aea[_0xa363('0x7c')]==0x1;if(!_0x2d2a4f){if(ut[_0xa363('0x76')](_0x1ce4e7)>=_0x400652[_0xa363('0xa3')]){_0x3a8610=ut[_0xa363('0x7f')](_0x1ce4e7,0xf,'Global');rpcDb['createCustomerFinal'](_0x3a8610,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x1ce4e7[_0xa363('0xc5')]>=_0x400652[_0xa363('0xc6')]){rpcDb[_0xa363('0x69')](_0x1ce4e7,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb['rescheduleContact'](ut[_0xa363('0x83')](_0x1ce4e7,_0xa363('0xc3'),_0x400652['dialAbandonedRetryFrequency']),_0x1ce4e7[_0xa363('0x84')],_0x1ce4e7[_0xa363('0xa7')]);}}}else{_0x1ce4e7['countnoanswerretry']++;_0x34c686['incrementPreviewCounters']({'id':_0x1ce4e7[_0xa363('0x87')],'field':{'countnoanswerretry':_0x1ce4e7[_0xa363('0xab')]}})[_0xa363('0x57')](function(){_0x34c686[_0xa363('0xa8')](_0x1ce4e7,_0x3d1869,_0x288f07)[_0xa363('0x57')](function(){});});}});break;case'18':_0x400652[_0xa363('0xc7')]+=0x1;_0x1ce4e7[_0xa363('0xc8')]+=0x1;_0x1ce4e7[_0xa363('0x75')]=ut[_0xa363('0x76')](_0x1ce4e7);ut[_0xa363('0x62')](_0x1ce4e7,0x12,_0x570be0[_0xa363('0xc9')]||_0x570be0[_0xa363('0xca')]);ami['emit'](_0xa363('0xcb'),ut[_0xa363('0x78')](_0x1ce4e7,_0xa363('0xcc')));rpcDb[_0xa363('0x66')](_0x1ce4e7,_0xa363('0xcd'));_0x34c686[_0xa363('0x7b')](_0x1ce4e7,'18',_0x400652)['then'](function(_0x478e28){_0x2d2a4f=_0x478e28[_0xa363('0x7c')]==0x1;if(!_0x2d2a4f){if(ut['totalGlobal'](_0x1ce4e7)>=_0x400652['dialGlobalMaxRetry']){_0x3a8610=ut[_0xa363('0x7f')](_0x1ce4e7,0x12,_0xa363('0x80'));rpcDb[_0xa363('0x69')](_0x3a8610,_0xa363('0xcd'));}else{rpcDb['createCustomerFinal'](_0x1ce4e7,_0xa363('0xcd'));}}else{_0x1ce4e7[_0xa363('0xab')]++;_0x34c686[_0xa363('0x86')]({'id':_0x1ce4e7[_0xa363('0x87')],'field':{'countnoanswerretry':_0x1ce4e7[_0xa363('0xab')]}})[_0xa363('0x57')](function(){_0x34c686[_0xa363('0xa8')](_0x1ce4e7,_0x3d1869,_0x288f07)['then'](function(){});});}});delete this[_0xa363('0x14')][_0x570be0[_0xa363('0xce')]];break;case'19':_0x400652[_0xa363('0xc7')]+=0x1;_0x1ce4e7[_0xa363('0x75')]=ut[_0xa363('0x76')](_0x1ce4e7);ut[_0xa363('0x62')](_0x1ce4e7,0x13,_0x570be0['cause-txt']||_0x570be0['dialstatus']);ami[_0xa363('0x23')]('custom:amd',ut[_0xa363('0x78')](_0x1ce4e7,_0xa363('0xcc')));rpcDb[_0xa363('0x66')](_0x1ce4e7,_0xa363('0xcf'));_0x34c686[_0xa363('0x7b')](_0x1ce4e7,'18',_0x400652)[_0xa363('0x57')](function(_0x576104){_0x2d2a4f=_0x576104[_0xa363('0x7c')]==0x1;if(!_0x2d2a4f){if(ut['totalGlobal'](_0x1ce4e7)>=_0x400652[_0xa363('0xa3')]){_0x3a8610=ut[_0xa363('0x7f')](_0x1ce4e7,0xf,_0xa363('0x80'));rpcDb['createCustomerFinal'](_0x3a8610,_0xa363('0xcf'));}else{rpcDb[_0xa363('0x69')](_0x1ce4e7,_0xa363('0xcf'));}}else{_0x1ce4e7[_0xa363('0xab')]++;_0x34c686[_0xa363('0x86')]({'id':_0x1ce4e7[_0xa363('0x87')],'field':{'countnoanswerretry':_0x1ce4e7[_0xa363('0xab')]}})['then'](function(){_0x34c686['swapAdditionalPhones'](_0x1ce4e7,_0x3d1869,_0x288f07)[_0xa363('0x57')](function(){});});}});delete this['actions'][_0x570be0['linkedid']];break;default:if(_0x1ce4e7[_0xa363('0x45')]){ut['decrementTalkink'](_0x400652,_0xa363('0xd0'));ut['loggerError'](_0xa363('0xd1')+_0x400652[_0xa363('0x2e')],_0x570be0);}_0x400652[_0xa363('0xc7')]+=0x1;_0x1ce4e7['countglobal']=ut['totalGlobal'](_0x1ce4e7);ut[_0xa363('0x62')](_0x1ce4e7,0xc,_0x570be0[_0xa363('0xc9')]||_0x570be0[_0xa363('0xca')]);_0x3d1869=_0x400652[_0xa363('0xbd')];_0x288f07=_0x400652[_0xa363('0x7e')];rpcDb[_0xa363('0x66')](_0x1ce4e7,_0xa363('0xd2'));_0x34c686['verifyAdditionalPhones'](_0x1ce4e7,'20',_0x400652)[_0xa363('0x57')](function(_0x43ba06){_0x2d2a4f=_0x43ba06[_0xa363('0x7c')]==0x1;if(!_0x2d2a4f){if(ut[_0xa363('0x76')](_0x1ce4e7)>=_0x400652[_0xa363('0xa3')]){_0x3a8610=ut[_0xa363('0x7f')](_0x1ce4e7,0xf,_0xa363('0x80'));rpcDb['createCustomerFinal'](_0x3a8610,_0xa363('0xd3'));}else{rpcDb[_0xa363('0x69')](_0x1ce4e7,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this[_0xa363('0x14')][_0x570be0[_0xa363('0xce')]];}else{_0x34c686['swapAdditionalPhones'](_0x1ce4e7,_0x3d1869,_0x288f07)[_0xa363('0x57')](function(){});}});}if(!(_0x1ce4e7[_0xa363('0x45')]&&_0x46d30d==='16')){ut['updateOriginated'](_0x400652,_0xa363('0xd4'));logger['info'](_0xa363('0xd5'),_0x1ce4e7['uniqueid'],_0xa363('0x9b'),_0x400652['name'],_0xa363('0x41'),_0x400652['originated']);}if(_0x46d30d!==_0xa363('0x88')){delete this[_0xa363('0x14')][_0x570be0[_0xa363('0xce')]];delete this['actions'][_0x570be0[_0xa363('0xd6')]];}_0x400652[_0xa363('0xd7')]=!![];}};Preview[_0xa363('0xd')]['callProgressDetectingAgent']=function(_0x58b4dc,_0x4a71a7,_0xa85764){if(_[_0xa363('0xd8')](_0x4a71a7)&&_0xa363('0xd9')!==typeof _0x4a71a7){return;}if(_[_0xa363('0xd8')](_0xa85764)&&_0xa363('0xd9')!==typeof _0xa85764){return;}switch(_0xa85764['reason']){case'0':ut[_0xa363('0xda')](_0x58b4dc,0x0,'NoSuchNumber');rpcDb['createAgentHistory'](_0x58b4dc,_0xa363('0xdb'));break;case'3':ut[_0xa363('0xda')](_0x58b4dc,0x3,_0xa363('0xac'));rpcDb['createAgentHistory'](_0x58b4dc,_0xa363('0xdc'));break;case'5':ut[_0xa363('0xda')](_0x58b4dc,0x5,_0xa363('0x9e'));rpcDb[_0xa363('0xdd')](_0x58b4dc,'[callProgressDetectingAgent][logBusy]');break;case'8':ut[_0xa363('0xda')](_0x58b4dc,0x8,_0xa363('0xb3'));rpcDb[_0xa363('0xdd')](_0x58b4dc,_0xa363('0xde'));break;case'22':ut[_0xa363('0xda')](_0x58b4dc,0x16,_0xa363('0xdf'));rpcDb['createAgentHistory'](_0x58b4dc,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut[_0xa363('0xda')](_0x58b4dc,0xc,_0xa85764[_0xa363('0xe0')]);rpcDb[_0xa363('0xdd')](_0x58b4dc,'[callProgressDetectingAgent][logCongestion]');}ut['updateOriginated'](_0x4a71a7,_0xa363('0xe1'));logger[_0xa363('0x24')](_0xa363('0xe2'),_0x58b4dc['uniqueid'],_0xa363('0x9b'),_0x4a71a7['name'],_0xa363('0x41'),_0x4a71a7[_0xa363('0x42')]);delete this[_0xa363('0x14')][_0x58b4dc[_0xa363('0x8c')]];};Preview[_0xa363('0xd')][_0xa363('0x7b')]=function(_0xb5afe4,_0x5cbea9,_0x1ecd33){return cmHopperAdditionalPhone['verifyAdditionalPhones'](_0xb5afe4,_0x5cbea9,_0x1ecd33)[_0xa363('0x4a')](logger[_0xa363('0x24')](_0xa363('0xe3')));};Preview['prototype'][_0xa363('0xa8')]=function(_0x53bb80,_0x3c37b8,_0x14bf2f){return cmHopperAdditionalPhone[_0xa363('0xa8')](_0x53bb80,_0x3c37b8,_0x14bf2f)['catch'](logger[_0xa363('0x24')]('[swapAdditionalPhone]\x20'));};Preview[_0xa363('0xd')][_0xa363('0x86')]=function(_0x5dfad1){return Promise[_0xa363('0xe4')]()[_0xa363('0x57')](cmHopperAdditionalPhone['incrementPreviewCounters'](_0x5dfad1))[_0xa363('0x4a')](logger[_0xa363('0x24')](_0xa363('0xe5')));};Preview['prototype'][_0xa363('0xe6')]=function(_0x51f7de,_0x37dad3,_0x13746b,_0x5dc014,_0x1ea4c9){var _0x521e1c=this;return new Promise(function(_0x32e68f,_0x57a918){if(_[_0xa363('0x3e')](_0x37dad3)||_[_0xa363('0x3e')](_0x37dad3[_0xa363('0xe7')])||_[_0xa363('0x3e')](_0x37dad3[_0xa363('0xe8')])||_[_0xa363('0x3e')](_0x37dad3[_0xa363('0xe9')])){_0x57a918(ut[_0xa363('0x2b')](_0xa363('0xea'),_0x5dc014,_0x1ea4c9));return;}var _0x42c06b=uuid['v4']();var _0x4ef03d=_0x521e1c[_0xa363('0x12')][_0x37dad3[_0xa363('0xeb')][_0xa363('0x2e')]];var _0x1fcaab=_0x13746b?_0x521e1c[_0xa363('0x15')][_0x13746b]['id']:undefined;_0x521e1c['actions'][_0x42c06b]=new Action(_0x37dad3,_0x4ef03d,_0x42c06b,_0x13746b,_0x1fcaab);var _0x562a92=_0x521e1c['actions'][_0x42c06b];_0x562a92['unlockAgent']=_0x5dc014;_0x562a92[_0xa363('0xa7')]=_0x1ea4c9;_0x562a92[_0xa363('0xec')]=_0x13746b;if(_[_0xa363('0xed')](_0x51f7de)){_0x521e1c[_0xa363('0xee')](_0x562a92,_0x4ef03d,_0x37dad3,_0x13746b)['then'](function(_0x4780d3){logger[_0xa363('0x24')](_0xa363('0xef'),_0xa363('0xf0')+_0x562a92[_0xa363('0x40')]+_0xa363('0xf1')+_0x562a92[_0xa363('0x87')],JSON[_0xa363('0x44')](_0x4780d3));ami[_0xa363('0x23')](_0xa363('0xf2'),ut[_0xa363('0x78')](_0x562a92,_0xa363('0xf3'),_0x521e1c[_0xa363('0x12')][_0x562a92[_0xa363('0x40')]]));_0x32e68f(ut[_0xa363('0x2b')](_0xa363('0xf4')));})[_0xa363('0x4a')](function(_0x106522){ut['logger'](_0xa363('0xf5'),_0x106522);_0x57a918(ut['message'](_0xa363('0xf6'),_0x5dc014,_0x1ea4c9));});}else{_0x4ef03d['outboundBlacklistCallsDay']+=0x1;ut[_0xa363('0xf7')](_0x562a92);rpcDb['createHistory'](_0x562a92,_0xa363('0xf8'));delete _0x521e1c[_0xa363('0x14')][_0x42c06b];_0x57a918(ut[_0xa363('0x2b')]('Contact\x20in\x20black\x20List',_0x5dc014,_0x1ea4c9));}});};Preview['prototype'][_0xa363('0xf9')]=function(_0x535091){return!_['isNil'](_0x535091)&&!_[_0xa363('0x3e')](_0x535091[_0xa363('0x2e')])&&!_[_0xa363('0x3e')](_0x535091[_0xa363('0xfa')])&&_0x535091[_0xa363('0xfa')]&&!_[_0xa363('0x3e')](this[_0xa363('0x13')][util[_0xa363('0x25')](_0xa363('0xfb'),_0x535091[_0xa363('0x2e')])])&&!_[_0xa363('0x3e')](this['trunks'][util[_0xa363('0x25')](_0xa363('0xfb'),_0x535091[_0xa363('0x2e')])][_0xa363('0x48')])&&(this[_0xa363('0x13')][util[_0xa363('0x25')](_0xa363('0xfb'),_0x535091[_0xa363('0x2e')])][_0xa363('0x48')]==='reachable'||this[_0xa363('0x13')][util[_0xa363('0x25')](_0xa363('0xfb'),_0x535091[_0xa363('0x2e')])]['status']===_0xa363('0xfc'));};Preview[_0xa363('0xd')][_0xa363('0xfd')]=function(_0x154962,_0x5b06aa){return this['execRun'](_0x154962,_0x5b06aa)[_0xa363('0x57')](function(_0x598c42){return _[_0xa363('0xfe')](_0x598c42,[_0xa363('0x2b')]);})[_0xa363('0x4a')](function(_0x541cfc){if(_0x541cfc[_0xa363('0xff')]){rpcDb[_0xa363('0x100')](_0x154962);}if(_0x541cfc[_0xa363('0xfa')]){rpcDb[_0xa363('0x5f')](_0x154962);}throw _[_0xa363('0xfe')](_0x541cfc,['message']);});};Preview['prototype'][_0xa363('0x101')]=function(_0x46959c,_0x42727b){var _0x5cd199=this;var _0x3e9489,_0xb3c89d;return rpcDb[_0xa363('0x102')](_0x46959c)[_0xa363('0x57')](function(_0x36fbac){if(!_[_0xa363('0x3e')](_0x36fbac[0x0])){_0xb3c89d=_0x36fbac[0x0][_0xa363('0x103')]?![]:!![];_0x3e9489=_0x36fbac[0x0][_0xa363('0x103')]?!![]:![];_0x3e9489=_0x42727b?!![]:_0x3e9489;}var _0x580f1b=_0x5cd199[_0xa363('0x104')](_0x36fbac);if(_0x580f1b[_0xa363('0x105')]){rpcDb[_0xa363('0x106')](_[_0xa363('0xfe')](_0x36fbac[0x0],['VoiceQueueId',_0xa363('0xe8')]))[_0xa363('0x57')](function(_0x3f86a6){_0x5cd199[_0xa363('0xe6')](_0x3f86a6,_0x36fbac[0x0],_0x42727b,_0xb3c89d,_0x3e9489)['then'](function(_0x5dc886){return _0x5dc886;})[_0xa363('0x4a')](function(_0x26da27){throw _0x26da27;});})[_0xa363('0x4a')](function(_0x5e3a42){ut[_0xa363('0x2c')](_0xa363('0x107'),_0x5e3a42);throw ut[_0xa363('0x2b')](_0xa363('0x108'),_0xb3c89d,_0x3e9489);});}else{throw ut[_0xa363('0x2b')](_0x580f1b[_0xa363('0x2b')],_0xb3c89d,_0x3e9489);}})[_0xa363('0x4a')](function(_0x42898b){ut[_0xa363('0x2c')](_0xa363('0x109'),_0x42898b);throw ut[_0xa363('0x2b')](_0xa363('0x108'),![],!![]);});};Preview[_0xa363('0xd')]['validateContact']=function(_0x3767be){if(_['isNil'](_0x3767be)||_[_0xa363('0xed')](_0x3767be)||!_[_0xa363('0x3e')](_0x3767be[0x0][_0xa363('0x5b')])&&_[_0xa363('0x3e')](_0x3767be[0x0][_0xa363('0x5b')][_0xa363('0x2e')])){ut[_0xa363('0x2c')](_0xa363('0x10a'),_0x3767be);return{'isValid':![],'message':_0xa363('0x10b')};}var _0x5d9fc0=this[_0xa363('0x12')][_0x3767be[0x0]['Queue'][_0xa363('0x2e')]];_0x5d9fc0[_0xa363('0x2b')]=utils[_0xa363('0x30')][_0xa363('0x71')];if(_[_0xa363('0x3e')](_0x5d9fc0)){ut[_0xa363('0x2c')](_0xa363('0x10c'),_0x5d9fc0);return{'isValid':![],'message':_0xa363('0x10d')};}if(!this[_0xa363('0xf9')](_0x5d9fc0[_0xa363('0x6e')])){ut['logger'](_0xa363('0x10e'),_0xa363('0x10f')+_0x5d9fc0[_0xa363('0x2e')]+'\x20Trunk\x20is\x20not\x20active');if(!this[_0xa363('0xf9')](_0x5d9fc0['TrunkBackup'])){ut['logger']('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x5d9fc0['name']+_0xa363('0x110'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut[_0xa363('0x6d')](_0x5d9fc0['dialActive'])){ut[_0xa363('0x2c')](_0xa363('0x111'),_0x5d9fc0[_0xa363('0x2e')]+_0xa363('0x112'));return{'isValid':![],'message':_0xa363('0x10f')+_0x5d9fc0[_0xa363('0x2e')]+_0xa363('0x112')};}return{'isValid':!![],'message':_0xa363('0x113')};};Preview[_0xa363('0xd')][_0xa363('0xee')]=function(_0x4b15d9,_0x2f990d,_0xa303dc,_0x47478a){var _0x413177=this;return new Promise(function(_0x33a462,_0x250c14){var _0x51c215=_0x4b15d9[_0xa363('0x8c')];var _0x12d99d=_0x413177[_0xa363('0xf9')](_0x2f990d[_0xa363('0x6e')])?util[_0xa363('0x25')](_0xa363('0x114'),_0x2f990d[_0xa363('0x6e')][_0xa363('0x2e')],_['isNil'](_0x2f990d['dialPrefix'])?'':_0x2f990d[_0xa363('0x115')][_0xa363('0x116')]()||'',_0x2f990d[_0xa363('0x117')]>0x0?_0xa303dc[_0xa363('0xe8')][_0xa363('0x118')](_0x2f990d[_0xa363('0x117')]):_0xa303dc['phone']):util[_0xa363('0x25')](_0xa363('0x114'),_[_0xa363('0x3e')](_0x2f990d[_0xa363('0x6f')])?_0x2f990d[_0xa363('0x6e')]['name']:_0x2f990d['TrunkBackup']['name'],_[_0xa363('0x3e')](_0x2f990d[_0xa363('0x115')])?'':_0x2f990d[_0xa363('0x115')][_0xa363('0x116')]()||'',_0x2f990d[_0xa363('0x117')]>0x0?_0xa303dc['phone'][_0xa363('0x118')](_0x2f990d[_0xa363('0x117')]):_0xa303dc[_0xa363('0xe8')]);var _0xdbbeb5=_0x413177[_0xa363('0xf9')](_0x2f990d[_0xa363('0x6e')])?ut[_0xa363('0x119')](_0x2f990d[_0xa363('0x6e')][_0xa363('0x11a')],_0x2f990d[_0xa363('0x11b')],_0x2f990d[_0xa363('0x11c')]>0x0?ut[_0xa363('0x11d')](_0x2f990d['dialOriginateCallerIdNumber'],_0x2f990d[_0xa363('0x11c')]):_0x2f990d[_0xa363('0x11e')]):ut[_0xa363('0x119')](_['isNil'](_0x2f990d[_0xa363('0x6f')])?_0x2f990d[_0xa363('0x6e')][_0xa363('0x11a')]:_0x2f990d[_0xa363('0x6f')]['callerid'],_0x2f990d[_0xa363('0x11b')],_0x2f990d[_0xa363('0x11c')]>0x0?ut[_0xa363('0x11d')](_0x2f990d['dialOriginateCallerIdNumber'],_0x2f990d[_0xa363('0x11c')]):_0x2f990d['dialOriginateCallerIdNumber']);if(_0xdbbeb5){_0x4b15d9['originatecalleridname']=ut[_0xa363('0x11f')](_0xdbbeb5);_0x4b15d9[_0xa363('0x120')]=ut['extractCalleridNumber'](_0xdbbeb5);}var _0x3f52bd=ut[_0xa363('0x121')](_0x2f990d,_0xa303dc,_0x12d99d,_0xdbbeb5,_0x51c215,_0x4b15d9);var _0x3892df=utils['setXMDContactVariables'](_0xa303dc[_0xa363('0xe7')]);Object['assign'](_0x3f52bd,_0x3892df);_[_0xa363('0x122')](_0x4b15d9,ut[_0xa363('0x123')](_0x3f52bd));_0x4b15d9[_0xa363('0x60')]=moment()[_0xa363('0x25')](_0xa363('0x89'));_0x2f990d[_0xa363('0x124')]=_0x3f52bd;var _0x1504b3=ut[_0xa363('0x125')](_0x4b15d9,_0x2f990d,_0x3f52bd,_0x4b15d9[_0xa363('0xa7')],_0x47478a);return ami[_0xa363('0x47')](_0x1504b3)[_0xa363('0x57')](function(_0x20fc8c){_0x2f990d['originated']+=0x1;logger[_0xa363('0x24')]('[originated][increment]',_0x51c215,_0xa363('0x9b'),_0x2f990d[_0xa363('0x2e')],_0xa363('0x41'),_0x2f990d[_0xa363('0x42')]);_0x33a462(_0x20fc8c);})[_0xa363('0x4a')](function(_0x2c1745){ut['logAgent'](_0x4b15d9,0xe,'OriginateError');rpcDb[_0xa363('0xdd')](_0x4b15d9,_0xa363('0x126'));_0x250c14(_0x2c1745);});});};Preview['prototype'][_0xa363('0x127')]=function(_0x4284ee){if(this['actions'][_0x4284ee['linkedid']]){this['actions'][_0x4284ee[_0xa363('0xce')]][_0xa363('0x49')]=_0x4284ee[_0xa363('0x49')];}};Preview[_0xa363('0xd')]['syncOriginateResponse']=function(_0x5d2452){var _0x3e4cf2=this;var _0x17361c=this[_0xa363('0x14')][_0x5d2452['actionid']];if(_0x17361c){if(_0x17361c[_0xa363('0xec')]&&this[_0xa363('0x15')][_0x17361c['lookAgent']]){ut[_0xa363('0x128')](_0x17361c,this[_0xa363('0x15')][_0x17361c[_0xa363('0xec')]][_0xa363('0x2e')],this[_0xa363('0x15')][_0x17361c[_0xa363('0xec')]]['id']);}var _0x32ca60=_[_0xa363('0x129')](_0x17361c);_0x32ca60[_0xa363('0x8a')]=moment()[_0xa363('0x25')]('YYYY-MM-DD\x20HH:mm:ss');var _0x45e6ba=_0x3e4cf2[_0xa363('0x12')][_0x17361c[_0xa363('0x40')]];if(ut[_0xa363('0x12a')](_0x5d2452[_0xa363('0x12b')])){if(_0x17361c[_0xa363('0x84')]){rpcDb['unlockContact'](_0x17361c[_0xa363('0x87')]);}if(_0x17361c[_0xa363('0xa7')]){rpcDb[_0xa363('0x5f')](_0x17361c[_0xa363('0x87')]);}ami[_0xa363('0x23')]('custom:agentringnoanswer',ut[_0xa363('0x78')](_0x17361c,_0xa363('0x12c'),this[_0xa363('0x12')][_0x17361c[_0xa363('0x40')]]));this[_0xa363('0x12d')](_0x32ca60,_0x45e6ba,_0x5d2452);}else{_0x17361c['starttime']=moment()[_0xa363('0x25')](_0xa363('0x89'));ut[_0xa363('0xda')](_0x32ca60,0x4,_0xa363('0x12e'));rpcDb[_0xa363('0xdd')](_0x32ca60,_0xa363('0x12f'));}}};Preview[_0xa363('0xd')]['syncHangup']=function(_0xa4958f){var _0x4dbd5a=this[_0xa363('0x14')][_0xa4958f[_0xa363('0xce')]];var _0x13e37f;if(_0x4dbd5a){_0x13e37f=this[_0xa363('0x12')][_0x4dbd5a[_0xa363('0x40')]];logger[_0xa363('0x24')](_0xa363('0x130'),_0xa4958f[_0xa363('0xce')],'\x20Queue',_0x13e37f['name'],_0xa363('0x43'),_0x13e37f['pTalking']);}if(this['actions'][_0xa4958f['linkedid']]&&_0xa4958f[_0xa363('0xce')]!==_0xa4958f[_0xa363('0x8c')]){if(_0xa4958f[_0xa363('0x131')]==='16'&&this[_0xa363('0x14')][_0xa4958f[_0xa363('0xce')]]['dialAnswer']){this[_0xa363('0x72')](_0xa4958f,_0xa4958f[_0xa363('0xce')],_0xa4958f[_0xa363('0x131')]);}else if(this[_0xa363('0x14')][_0xa4958f['linkedid']][_0xa363('0x45')]){logger[_0xa363('0x24')](_0xa363('0x132'),_0xa4958f[_0xa363('0xce')],_0xa4958f[_0xa363('0x131')],_0xa363('0x9b'),_0x13e37f[_0xa363('0x2e')],_0xa363('0x43'),_0x13e37f[_0xa363('0x28')]);this['callProgressDetectingCustomer'](_0xa4958f,_0xa4958f[_0xa363('0xce')],_0xa4958f[_0xa363('0x131')]);}}else if(_0x4dbd5a&&_[_0xa363('0x3e')](_0x4dbd5a[_0xa363('0x133')])&&_0x13e37f['dialQueueProject']&&_0xa4958f[_0xa363('0xce')]===_0xa4958f[_0xa363('0x8c')]&&_[_0xa363('0x3e')](_0xa4958f[_0xa363('0xe0')])&&_0xa4958f['cause']==='16'&&_0xa4958f[_0xa363('0x134')]==='6'&&_['isUndefined'](_0x4dbd5a['transfer'])){if(_0x4dbd5a[_0xa363('0x84')]){rpcDb['unlockContact'](_0x4dbd5a[_0xa363('0x87')]);}if(_0x4dbd5a[_0xa363('0xa7')]){rpcDb[_0xa363('0x5f')](_0x4dbd5a[_0xa363('0x87')]);}_0xa4958f['reason']='22';this[_0xa363('0x12d')](_0x4dbd5a,_0x13e37f,_0xa4958f);}else if(_0x4dbd5a&&_0x4dbd5a[_0xa363('0x135')]){if(_0xa4958f[_0xa363('0x131')]==='16'&&this['actions'][_0xa4958f[_0xa363('0xce')]][_0xa363('0x45')]){logger[_0xa363('0x24')](_0xa363('0x136'),_0xa4958f[_0xa363('0xce')],_0xa4958f[_0xa363('0x131')],_0xa363('0x9b'),_0x13e37f[_0xa363('0x2e')],_0xa363('0x43'),_0x13e37f['pTalking']);this[_0xa363('0x72')](_0xa4958f,_0xa4958f[_0xa363('0xce')],_0xa4958f[_0xa363('0x131')]);}else if(this[_0xa363('0x14')][_0xa4958f[_0xa363('0xce')]][_0xa363('0x45')]){logger[_0xa363('0x24')](_0xa363('0x132'),_0xa4958f[_0xa363('0xce')],_0xa4958f[_0xa363('0x131')],_0xa363('0x9b'),_0x13e37f[_0xa363('0x2e')],'pTalking:\x20',_0x13e37f[_0xa363('0x28')]);this[_0xa363('0x72')](_0xa4958f,_0xa4958f[_0xa363('0xce')],_0xa4958f[_0xa363('0x131')]);}}};Preview['prototype'][_0xa363('0x1c')]=function(_0x5381bf){if(this[_0xa363('0x14')][_0x5381bf[_0xa363('0xd6')]]&&_0x5381bf[_0xa363('0xd6')]!==_0x5381bf[_0xa363('0x137')]){this[_0xa363('0x72')](_0x5381bf,_0x5381bf[_0xa363('0xd6')],_0x5381bf['dialstatus']);}};Preview[_0xa363('0xd')][_0xa363('0x1a')]=function(_0x22fa78){if(this['actions'][_0x22fa78[_0xa363('0xce')]]&&_0x22fa78[_0xa363('0xce')]!==_0x22fa78[_0xa363('0x8c')]&&!this[_0xa363('0x14')][_0x22fa78['linkedid']][_0xa363('0x45')]){if(_0x22fa78[_0xa363('0x131')]==='1'){this[_0xa363('0x72')](_0x22fa78,_0x22fa78[_0xa363('0xce')],_0x22fa78[_0xa363('0x131')]);}}};Preview[_0xa363('0xd')][_0xa363('0x138')]=function(_0x37bda8,_0xb77cbf,_0x660303){if(this[_0xa363('0x14')][_0x37bda8]){if(_[_0xa363('0x3e')](this[_0xa363('0x14')][_0x37bda8][_0xa363('0x124')])){this['actions'][_0x37bda8]['variables']={};}this['actions'][_0x37bda8][_0xa363('0x124')][_0xb77cbf]=_0x660303;}};Preview[_0xa363('0xd')][_0xa363('0x1e')]=function(_0x37ef7d){try{if(!_[_0xa363('0x3e')](_0x37ef7d)){if(ut[_0xa363('0x139')](_[_0xa363('0x13a')](_0x37ef7d[_0xa363('0x13b')])[0x0])){this[_0xa363('0x138')](_0x37ef7d[_0xa363('0x8c')],_[_0xa363('0x13a')](_0x37ef7d['variable'])[0x0],_0x37ef7d[_0xa363('0x13c')]);}}}catch(_0x4ac6f2){logger[_0xa363('0x13d')](_0xa363('0x13e'),util[_0xa363('0x13f')](_0x4ac6f2,{'showHidden':![],'depth':null}));}};Preview[_0xa363('0xd')]['syncAttendedTransfer']=function(_0x507291){if(_0x507291){if(this['actions'][_0x507291['transfertargetlinkedid']]){this['actions'][_0x507291[_0xa363('0x140')]][_0xa363('0x135')]=!![];}}};Preview[_0xa363('0xd')]['syncBlindTransfer']=function(_0x2a3be2){if(_0x2a3be2){if(this[_0xa363('0x14')][_0x2a3be2[_0xa363('0x141')]]){this[_0xa363('0x14')][_0x2a3be2['transfererlinkedid']][_0xa363('0x135')]=!![];}}};module[_0xa363('0x142')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index ee56801..a1f8399 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 _0xafac=['rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','catch','resolve','then','createHistory','[createHistory]\x20','moveContactManagedDialer','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','createAgentHistory','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','unlockContact','[unlockContact]\x20','disableContact','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercompleteAt','connectedlinename','context','exten','xcally-motion-preview','holdtime','lastAssignedTo','membername','queuecallerexitreason','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20'];(function(_0x4320c9,_0x2bc44a){var _0x1e3ff4=function(_0x59a9d4){while(--_0x59a9d4){_0x4320c9['push'](_0x4320c9['shift']());}};_0x1e3ff4(++_0x2bc44a);}(_0xafac,0xce));var _0xcafa=function(_0x319b0c,_0xbeb58a){_0x319b0c=_0x319b0c-0x0;var _0x1e9dbe=_0xafac[_0x319b0c];return _0x1e9dbe;};'use strict';var util=require(_0xcafa('0x0'));var BPromise=require(_0xcafa('0x1'));var logger=require(_0xcafa('0x2'))(_0xcafa('0x3'));var cmHopper=require(_0xcafa('0x4'));var cmHopperHistory=require(_0xcafa('0x5'));var cmHopperBlack=require(_0xcafa('0x6'));var agentReportPreview=require(_0xcafa('0x7'));var voiceQueueReport=require(_0xcafa('0x8'));function loggerCatch(_0xd1a6d9){return function(_0xa79bc6){logger[_0xcafa('0x9')](_0xd1a6d9,util[_0xcafa('0xa')](_0xa79bc6,{'showHidden':![],'depth':null}));};}function create(_0xb154dd){return cmHopperHistory['createHistory'](_0xb154dd)[_0xcafa('0xb')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x23236e){return BPromise[_0xcafa('0xc')]()[_0xcafa('0xd')](agentReportPreview[_0xcafa('0xe')](_0x23236e))[_0xcafa('0xb')](loggerCatch(_0xcafa('0xf')));}function moveContact(_0x555f2e){return cmHopper[_0xcafa('0x10')](_0x555f2e,!![])['catch'](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0xcafa('0x11')]=function(_0x5584b0){return cmHopperBlack['checkIsBlackList'](_0x5584b0)[_0xcafa('0xb')](loggerCatch(_0xcafa('0x12')));};exports[_0xcafa('0x13')]=function(_0x41ca79){return BPromise[_0xcafa('0xc')]()[_0xcafa('0xd')](cmHopper[_0xcafa('0x13')](_0x41ca79))[_0xcafa('0xb')](loggerCatch('[getContactPreview]\x20'));};exports[_0xcafa('0xe')]=function(_0x1c03bf,_0x37fc45){create(_0x1c03bf)[_0xcafa('0xb')](loggerCatch(_0x37fc45));moveContact(_0x1c03bf)[_0xcafa('0xb')](loggerCatch(_0x37fc45));};exports[_0xcafa('0x14')]=function(_0x3ca016,_0x52083a){createAgent(_0x3ca016)[_0xcafa('0xb')](loggerCatch(_0x52083a));};exports['createCustomerHistory']=function(_0x1879ec,_0x21b971){create(_0x1879ec)['catch'](loggerCatch(_0x21b971));};exports['createCustomerFinal']=function(_0x35aa5f,_0x515419){moveContact(_0x35aa5f)['catch'](loggerCatch(_0x515419));};exports[_0xcafa('0x15')]=function(_0x349a6f,_0x50df04,_0x2da846){if(_0x50df04){_0x349a6f[_0xcafa('0x16')]=null;}if(_0x2da846){_0x349a6f[_0xcafa('0x17')]=![];}return cmHopper[_0xcafa('0x15')](_0x349a6f)[_0xcafa('0xb')](loggerCatch(_0xcafa('0x18')));};exports[_0xcafa('0x19')]=function(_0x240262){return cmHopper[_0xcafa('0x19')](_0x240262)['catch'](loggerCatch('[countReScheduled]\x20'));};exports[_0xcafa('0x1a')]=function(_0x2258fb){return cmHopper['unlockContact']({'UserId':null},_0x2258fb,0x1)[_0xcafa('0xb')](loggerCatch(_0xcafa('0x1b')));};exports[_0xcafa('0x1c')]=function(_0x207635){return cmHopper['unlockContact']({'active':![]},_0x207635,0x1)[_0xcafa('0xb')](loggerCatch('[activeContact]\x20'));};exports['crateCustomerReportQueue']=function(_0x4e541f){var _0x333528={};_0x333528[_0xcafa('0x1d')]=_0x4e541f[_0xcafa('0x1d')];_0x333528[_0xcafa('0x1e')]=_0x4e541f[_0xcafa('0x1e')];_0x333528[_0xcafa('0x1f')]=_0x4e541f['calleridnum'];_0x333528[_0xcafa('0x20')]=_0x4e541f[_0xcafa('0x20')];_0x333528[_0xcafa('0x21')]=_0x4e541f[_0xcafa('0x21')];_0x333528[_0xcafa('0x22')]=_0x4e541f[_0xcafa('0x23')];_0x333528[_0xcafa('0x24')]=_0x4e541f['answertime'];_0x333528['queuecallercomplete']=0x1;_0x333528[_0xcafa('0x25')]=_0x4e541f['endtime'];_0x333528[_0xcafa('0x26')]=_0x4e541f['membername'];_0x333528[_0xcafa('0x27')]='from-sip';_0x333528[_0xcafa('0x28')]=_0xcafa('0x29');_0x333528[_0xcafa('0x2a')]=0x0;_0x333528['assigned']=0x1;_0x333528[_0xcafa('0x2b')]=_0x4e541f[_0xcafa('0x2c')];_0x333528[_0xcafa('0x2d')]='COMPLETED';return BPromise['resolve']()[_0xcafa('0xd')](voiceQueueReport['create'](_0x333528))[_0xcafa('0xb')](loggerCatch(_0xcafa('0x2e')));};exports['getContactRecallMe']=function(_0x242b58,_0x162931){return BPromise['resolve']()[_0xcafa('0xd')](cmHopper[_0xcafa('0x2f')](_0x242b58,_0x162931))[_0xcafa('0xb')](loggerCatch(_0xcafa('0x30')));};exports[_0xcafa('0x31')]=function(_0x3416a2){return cmHopper[_0xcafa('0x15')](_0x3416a2,!![],!![])[_0xcafa('0xb')](loggerCatch(_0xcafa('0x32')));}; \ No newline at end of file +var _0xd9a0=['catch','then','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','resolve','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','from-sip','holdtime','lastAssignedTo','queuecallerexitreason','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','[rescheduleContactInQueue]\x20','bluebird','preview','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/agentReportPreview','error','createHistory'];(function(_0x19db32,_0x2867d7){var _0x3608f1=function(_0x1c888d){while(--_0x1c888d){_0x19db32['push'](_0x19db32['shift']());}};_0x3608f1(++_0x2867d7);}(_0xd9a0,0x131));var _0x0d9a=function(_0x45c970,_0x1ac5fe){_0x45c970=_0x45c970-0x0;var _0x90f5db=_0xd9a0[_0x45c970];return _0x90f5db;};'use strict';var util=require('util');var BPromise=require(_0x0d9a('0x0'));var logger=require('../../../config/logger')(_0x0d9a('0x1'));var cmHopper=require(_0x0d9a('0x2'));var cmHopperHistory=require(_0x0d9a('0x3'));var cmHopperBlack=require('../rpc/cmHopperBlack');var agentReportPreview=require(_0x0d9a('0x4'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x572a81){return function(_0xeb2bd9){logger[_0x0d9a('0x5')](_0x572a81,util['inspect'](_0xeb2bd9,{'showHidden':![],'depth':null}));};}function create(_0x192214){return cmHopperHistory[_0x0d9a('0x6')](_0x192214)[_0x0d9a('0x7')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x501a0c){return BPromise['resolve']()[_0x0d9a('0x8')](agentReportPreview[_0x0d9a('0x6')](_0x501a0c))[_0x0d9a('0x7')](loggerCatch(_0x0d9a('0x9')));}function moveContact(_0x474b07){return cmHopper[_0x0d9a('0xa')](_0x474b07,!![])[_0x0d9a('0x7')](loggerCatch(_0x0d9a('0xb')));}exports[_0x0d9a('0xc')]=function(_0x281381){return cmHopperBlack[_0x0d9a('0xc')](_0x281381)['catch'](loggerCatch(_0x0d9a('0xd')));};exports[_0x0d9a('0xe')]=function(_0x26a090){return BPromise[_0x0d9a('0xf')]()[_0x0d9a('0x8')](cmHopper[_0x0d9a('0xe')](_0x26a090))[_0x0d9a('0x7')](loggerCatch(_0x0d9a('0x10')));};exports['createHistory']=function(_0x1cc9ea,_0x4f7154){create(_0x1cc9ea)[_0x0d9a('0x7')](loggerCatch(_0x4f7154));moveContact(_0x1cc9ea)['catch'](loggerCatch(_0x4f7154));};exports[_0x0d9a('0x11')]=function(_0x5f3b44,_0x352708){createAgent(_0x5f3b44)[_0x0d9a('0x7')](loggerCatch(_0x352708));};exports[_0x0d9a('0x12')]=function(_0x289633,_0x476aa7){create(_0x289633)[_0x0d9a('0x7')](loggerCatch(_0x476aa7));};exports[_0x0d9a('0x13')]=function(_0x3df8f9,_0x1a48f1){moveContact(_0x3df8f9)['catch'](loggerCatch(_0x1a48f1));};exports[_0x0d9a('0x14')]=function(_0x211532,_0x4f5317,_0x3ffb07){if(_0x4f5317){_0x211532['UserId']=null;}if(_0x3ffb07){_0x211532['active']=![];}return cmHopper[_0x0d9a('0x14')](_0x211532)[_0x0d9a('0x7')](loggerCatch(_0x0d9a('0x15')));};exports[_0x0d9a('0x16')]=function(_0x4d7766){return cmHopper['countReScheduled'](_0x4d7766)['catch'](loggerCatch(_0x0d9a('0x17')));};exports[_0x0d9a('0x18')]=function(_0x2c725e){return cmHopper['unlockContact']({'UserId':null},_0x2c725e,0x1)[_0x0d9a('0x7')](loggerCatch(_0x0d9a('0x19')));};exports[_0x0d9a('0x1a')]=function(_0x127aca){return cmHopper['unlockContact']({'active':![]},_0x127aca,0x1)[_0x0d9a('0x7')](loggerCatch(_0x0d9a('0x1b')));};exports[_0x0d9a('0x1c')]=function(_0x2e1aa7){var _0x2c7923={};_0x2c7923[_0x0d9a('0x1d')]=_0x2e1aa7[_0x0d9a('0x1d')];_0x2c7923[_0x0d9a('0x1e')]=_0x2e1aa7['uniqueid'];_0x2c7923['calleridnum']=_0x2e1aa7[_0x0d9a('0x1f')];_0x2c7923[_0x0d9a('0x20')]=_0x2e1aa7[_0x0d9a('0x20')];_0x2c7923[_0x0d9a('0x21')]=_0x2e1aa7[_0x0d9a('0x21')];_0x2c7923[_0x0d9a('0x22')]=_0x2e1aa7[_0x0d9a('0x23')];_0x2c7923[_0x0d9a('0x24')]=_0x2e1aa7[_0x0d9a('0x23')];_0x2c7923[_0x0d9a('0x25')]=0x1;_0x2c7923[_0x0d9a('0x26')]=_0x2e1aa7[_0x0d9a('0x27')];_0x2c7923[_0x0d9a('0x28')]=_0x2e1aa7[_0x0d9a('0x29')];_0x2c7923[_0x0d9a('0x2a')]=_0x0d9a('0x2b');_0x2c7923['exten']='xcally-motion-preview';_0x2c7923[_0x0d9a('0x2c')]=0x0;_0x2c7923['assigned']=0x1;_0x2c7923[_0x0d9a('0x2d')]=_0x2e1aa7['membername'];_0x2c7923[_0x0d9a('0x2e')]='COMPLETED';return BPromise['resolve']()['then'](voiceQueueReport[_0x0d9a('0x2f')](_0x2c7923))[_0x0d9a('0x7')](loggerCatch(_0x0d9a('0x30')));};exports[_0x0d9a('0x31')]=function(_0x41abcf,_0x38b4c3){return BPromise['resolve']()['then'](cmHopper['getContactRecallMe'](_0x41abcf,_0x38b4c3))[_0x0d9a('0x7')](loggerCatch(_0x0d9a('0x32')));};exports['rescheduleContactInQueue']=function(_0x6dc97d){return cmHopper[_0x0d9a('0x14')](_0x6dc97d,!![],!![])['catch'](loggerCatch(_0x0d9a('0x33')));}; \ 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 13027f5..0ffe73f 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 _0xf7ea=['env','XCALLY_IP_AGI','127.0.0.1','../../dialer/utils','loggerCatch','inspect','logger','info','loggerError','error','logger2','message','getCallerId','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','calleridname','calleridnum','dialer','VoiceQueueId','dialOriginateTimeout','dialQueueProject2','monitor_format','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridname','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','toLowerVariables','hasOwnProperty','toLower','updateOriginated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','responsetime','endtime','logAgent','ringtime','getSeconds','logLookAgent','membername','UserId','logCustomer','answertime','isFailure','variablesAction','RECALL','uniqueid','originate','from-sip','totalGlobal','countbusyretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','scheduledAt','active','scheduledat','ContactId','ListId','pTalking','lastevent','queue','interface','channelAgent','motionChannel','mandatoryDisposition','buildObj','agentReadyId','not_inuse','status','reachable','push','getDiff','milliseconds','diff','seconds','createBody','filterKey','idContact','type','dialAnswer','countcongestionretry','countnoanswerretry','countglobal','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-callerid','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqoslossbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','match','keys','variables','forEach','buildNoAnswerEventPayload','util','lodash','moment','../../../../config/logger'];(function(_0x10375a,_0x124d88){var _0x4cc057=function(_0x53d573){while(--_0x53d573){_0x10375a['push'](_0x10375a['shift']());}};_0x4cc057(++_0x124d88);}(_0xf7ea,0x114));var _0xaf7e=function(_0x3071d1,_0x35cb54){_0x3071d1=_0x3071d1-0x0;var _0x46049d=_0xf7ea[_0x3071d1];return _0x46049d;};'use strict';var util=require(_0xaf7e('0x0'));var _=require(_0xaf7e('0x1'));var moment=require(_0xaf7e('0x2'));var logger=require(_0xaf7e('0x3'))('preview');var ipAgi=process[_0xaf7e('0x4')][_0xaf7e('0x5')]||_0xaf7e('0x6');var utils=require(_0xaf7e('0x7'));exports[_0xaf7e('0x8')]=function(_0x314e19){return function(_0x1f4a6c){logger['error'](_0x314e19,util[_0xaf7e('0x9')](_0x1f4a6c,{'showHidden':![],'depth':null}));};};exports[_0xaf7e('0xa')]=function(_0x101dca,_0x56de65){logger[_0xaf7e('0xb')](_0x101dca,util[_0xaf7e('0x9')](_0x56de65,{'showHidden':![],'depth':null}));};exports[_0xaf7e('0xc')]=function(_0x5ceb92,_0x34daf9){logger[_0xaf7e('0xd')](_0x5ceb92,util[_0xaf7e('0x9')](_0x34daf9,{'showHidden':![],'depth':null}));};exports[_0xaf7e('0xe')]=function(_0x466846){return function(_0x3ccc0c){logger['info'](_0x466846,util[_0xaf7e('0x9')](_0x3ccc0c,{'showHidden':![],'depth':null}));};};exports[_0xaf7e('0xf')]=function(_0x2de88f,_0x5857fa,_0x36c76b){return{'message':_0x2de88f,'unlock':_0x5857fa,'active':_0x36c76b};};exports[_0xaf7e('0x10')]=function(_0x3001ba,_0x3efdd4,_0x30082d){if(!_['isUndefined'](_0x30082d)&&_0xaf7e('0x11')===typeof _0x30082d&&!_[_0xaf7e('0x12')](_0x30082d)){if(!_['isUndefined'](_0x3efdd4)&&_0xaf7e('0x11')===typeof _0x3efdd4&&!_[_0xaf7e('0x12')](_0x3efdd4)){return util[_0xaf7e('0x13')](_0xaf7e('0x14'),_0x3efdd4,_0x30082d);}return util[_0xaf7e('0x13')]('\x22%s\x22\x20<%s>',_0x30082d,_0x30082d);}if(!_['isUndefined'](_0x3001ba)&&_0xaf7e('0x11')===typeof _0x3001ba&&!_[_0xaf7e('0x12')](_0x3001ba)){return _0x3001ba;}return _0xaf7e('0x15');};exports[_0xaf7e('0x16')]=function(_0x1c8d6e){if(_[_0xaf7e('0x17')](_0x1c8d6e)){return![];}return _0x1c8d6e;};exports[_0xaf7e('0x18')]=function(_0x765dbc,_0x5e267b,_0x5baaf3,_0x10d0a6,_0x1dece3,_0x10cea1){var _0xfe8d4={'XMD-QUEUE':_0x5e267b[_0xaf7e('0x19')]?_0x5e267b[_0xaf7e('0x19')][_0xaf7e('0x1a')]:'','XMD-CALLERID':_0x10d0a6,'XMD-CALLERID-PREVIEW':_0x10cea1?util[_0xaf7e('0x13')](_0xaf7e('0x14'),_0x10cea1[_0xaf7e('0x1b')],_0x10cea1[_0xaf7e('0x1c')]):_0x10d0a6,'XMD-DIALID':_0x1dece3,'XMD-CONTACTID':_0x5e267b['ContactId'],'XMD-CDRTYPE':_0xaf7e('0x1d'),'CALLERID(all)':_0x10d0a6,'XMD-VOICEQUEUEID':_0x5e267b[_0xaf7e('0x1e')],'XMD-DIALCHANNEL':_0x5baaf3,'XMD-DIALTIMEOUT':_0x765dbc[_0xaf7e('0x1f')]||0x1e,'XMD-DIALOPTIONS':util[_0xaf7e('0x13')]('\x22rtTxX%s%s\x22',_0x765dbc[_0xaf7e('0x20')]?'g':'',_[_0xaf7e('0x12')](_0x765dbc[_0xaf7e('0x21')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x765dbc[_0xaf7e('0x22')]||'','XMD-AGI':_0x765dbc[_0xaf7e('0x23')]?util[_0xaf7e('0x13')](_0xaf7e('0x24'),ipAgi,_0x765dbc[_0xaf7e('0x23')]):_0xaf7e('0x25'),'XMD-AGIAFTER':_0x765dbc[_0xaf7e('0x20')]?util['format'](_0xaf7e('0x24'),ipAgi,_0x765dbc[_0xaf7e('0x20')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0x10cea1?_0x10cea1['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x10cea1?_0x10cea1[_0xaf7e('0x26')]:'','XMD-DESTINATION':'xcally-motion-preview','SIPADDHEADER':'Call-Type:\x20PREVIEW'};if(!_[_0xaf7e('0x12')](_0x765dbc['monitor_format'])){_0xfe8d4[util[_0xaf7e('0x13')]('%s',_0xaf7e('0x27'))]=_0x765dbc[_0xaf7e('0x21')];_0xfe8d4[util['format']('%s',_0xaf7e('0x28'))]=_0x1dece3;}return _0xfe8d4;};exports[_0xaf7e('0x29')]=function(_0x26cfe6){var _0x1bb561={};for(var _0x5f1469 in _0x26cfe6){if(_0x26cfe6[_0xaf7e('0x2a')](_0x5f1469)){_0x1bb561[util[_0xaf7e('0x13')]('%s',_[_0xaf7e('0x2b')](_0x5f1469))]=_0x26cfe6[_0x5f1469];}}return{'variables':_0x1bb561};};exports[_0xaf7e('0x2c')]=function(_0x30dfc3,_0x146f6c){if(!_['isNil'](_0x30dfc3)){if(_0x30dfc3[_0xaf7e('0x2a')]('originated')){if(_0x30dfc3['originated']>0x0){_0x30dfc3['originated']-=0x1;}else{logger[_0xaf7e('0xd')](_0xaf7e('0x2d'),_0x146f6c);}}}else{logger['error'](_0xaf7e('0x2e'),_0x146f6c);}};exports[_0xaf7e('0x2f')]=function(_0x451cee){var _0x31f9b1=moment()[_0xaf7e('0x13')](_0xaf7e('0x30'));_0x451cee[_0xaf7e('0x31')]=0xd;_0x451cee[_0xaf7e('0x32')]=_0xaf7e('0x33');_0x451cee['starttime']=_0x31f9b1;_0x451cee[_0xaf7e('0x34')]=_0x31f9b1;_0x451cee[_0xaf7e('0x35')]=_0x31f9b1;};exports[_0xaf7e('0x36')]=function(_0x295715,_0x2a8e8a,_0x18f482){var _0x906233=moment()[_0xaf7e('0x13')](_0xaf7e('0x30'));_0x295715[_0xaf7e('0x31')]=_0x2a8e8a;_0x295715[_0xaf7e('0x32')]=_0x18f482;_0x295715[_0xaf7e('0x34')]=_0x906233;_0x295715[_0xaf7e('0x37')]=utils[_0xaf7e('0x38')](_0x295715[_0xaf7e('0x34')],_0x295715['starttime']);};exports[_0xaf7e('0x39')]=function(_0x16f6ff,_0xb58ea7,_0x51a726){_0x16f6ff[_0xaf7e('0x3a')]=_0xb58ea7;_0x16f6ff[_0xaf7e('0x3b')]=_0x51a726;};exports[_0xaf7e('0x3c')]=function(_0x48eb8d,_0x15c3e1,_0x153f44){var _0x142776=moment()[_0xaf7e('0x13')](_0xaf7e('0x30'));_0x48eb8d[_0xaf7e('0x31')]=_0x15c3e1;_0x48eb8d['statedesc']=_0x153f44;_0x48eb8d[_0xaf7e('0x34')]=_0x48eb8d[_0xaf7e('0x34')]?_0x48eb8d[_0xaf7e('0x34')]:_0x142776;_0x48eb8d[_0xaf7e('0x35')]=_0x48eb8d[_0xaf7e('0x35')]?_0x48eb8d[_0xaf7e('0x35')]:_0x142776;_0x48eb8d[_0xaf7e('0x37')]=utils[_0xaf7e('0x38')](_0x48eb8d[_0xaf7e('0x34')]||0x0,_0x48eb8d['starttime']||0x0);_0x48eb8d['talktime']=_0x48eb8d[_0xaf7e('0x3d')]?utils[_0xaf7e('0x38')](_0x48eb8d[_0xaf7e('0x35')],_0x48eb8d[_0xaf7e('0x3d')]):0x0;};exports[_0xaf7e('0x3e')]=function(_0xe8c044){return _0xe8c044==='Failure';};exports[_0xaf7e('0x3f')]=function(_0x4b9218,_0x2f6574,_0x3cb505,_0x3e742f,_0x4fab29){var _0x4c1ac3=_0x3e742f?_0xaf7e('0x40'):_0x4b9218[_0xaf7e('0x1b')];_0x4c1ac3=_0x4fab29?'BOOKED':_0x4c1ac3;return{'actionid':_0x4b9218[_0xaf7e('0x41')],'action':_0xaf7e('0x42'),'channel':_0x4b9218['channelAgent'],'callerid':util['format'](_0xaf7e('0x14'),_0x4c1ac3,_0x4b9218[_0xaf7e('0x1c')]),'Exten':'xcally-motion-preview','Context':_0xaf7e('0x43'),'Priority':'1','variable':_0x3cb505,'timeout':(_0x2f6574['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x4b9218[_0xaf7e('0x41')]};};exports[_0xaf7e('0x44')]=function(_0x5c395a){return _0x5c395a[_0xaf7e('0x45')]+_0x5c395a['countcongestionretry']+_0x5c395a['countnoanswerretry']+_0x5c395a[_0xaf7e('0x46')]+_0x5c395a[_0xaf7e('0x47')];};exports[_0xaf7e('0x48')]=function(_0x4fb081){var _0x5189a7=_[_0xaf7e('0x49')](_0x4fb081);_0x5189a7[_0xaf7e('0x31')]=0xf;_0x5189a7['statedesc']='Global';return _0x5189a7;};exports[_0xaf7e('0x4a')]=function(_0x36609d,_0x48ffb7,_0x17f8c8){var _0xe0ff44={};_0xe0ff44[_0x48ffb7]=_0x36609d[_0x48ffb7];_0xe0ff44[_0xaf7e('0x4b')]=![];_0xe0ff44[_0xaf7e('0x4c')]=moment()['add'](_0x17f8c8,'minutes')[_0xaf7e('0x13')](_0xaf7e('0x30'));_0xe0ff44[_0xaf7e('0x4d')]=_0x36609d[_0xaf7e('0x4d')];_0xe0ff44[_0xaf7e('0x4e')]=_0x36609d[_0xaf7e('0x4e')];_0xe0ff44[_0xaf7e('0x1e')]=_0x36609d[_0xaf7e('0x1e')]||undefined;return _0xe0ff44;};exports['decrementTalkink']=function(_0x289adf,_0x123e60){if(!_[_0xaf7e('0x17')](_0x289adf)){if(_0x289adf[_0xaf7e('0x4f')]>0x0){_0x289adf['pTalking']-=0x1;}else{logger[_0xaf7e('0xd')](_0x123e60,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0xaf7e('0xd')](_0x123e60,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports['IsNotLoggedIn']=function(_0x38e066){if(_0x38e066<=0x0){return!![];}return![];};function buildObj(_0x4f524f,_0x1d01a2,_0x29bef3){_0x4f524f[_0xaf7e('0x50')]=_0x1d01a2;_0x4f524f[_0xaf7e('0x1a')]=_0x4f524f[_0xaf7e('0x51')];_0x4f524f[_0xaf7e('0x52')]=_0x4f524f[_0xaf7e('0x53')];_0x4f524f[_0xaf7e('0x54')]='voice';if(_0x29bef3){_0x4f524f[_0xaf7e('0x55')]=_0x29bef3[_0xaf7e('0x55')];}return _0x4f524f;}exports[_0xaf7e('0x56')]=buildObj;exports['buildAcw']=function(_0x248eb9){var _0x3193ee={};_0x3193ee[_0xaf7e('0x51')]=_0x248eb9[_0xaf7e('0x51')];_0x3193ee[_0xaf7e('0x52')]=_0x248eb9[_0xaf7e('0x53')];_0x3193ee[_0xaf7e('0x41')]=_0x248eb9[_0xaf7e('0x41')];return _0x3193ee;};exports[_0xaf7e('0x57')]=function(_0xf4b8d1){var _0x5de197=[];for(var _0x4cbaa2 in _0xf4b8d1){if(_0xf4b8d1['hasOwnProperty'](_0x4cbaa2)){if(!_['isNil'](_0xf4b8d1[_0x4cbaa2])&&_0xf4b8d1[_0x4cbaa2][_0xaf7e('0x31')]===_0xaf7e('0x58')&&_0xf4b8d1[_0x4cbaa2][_0xaf7e('0x59')]===_0xaf7e('0x5a')){_0x5de197[_0xaf7e('0x5b')](_0xf4b8d1[_0x4cbaa2]['id']);}}}return _0x5de197;};exports[_0xaf7e('0x5c')]=function(_0x3c4100){var _0x3ea857=moment()[_0xaf7e('0x5d')](0x0);var _0x2dcbb0=moment(_0x3c4100)[_0xaf7e('0x5d')](0x0);return _0x3ea857[_0xaf7e('0x5e')](_0x2dcbb0,_0xaf7e('0x5f'));};exports[_0xaf7e('0x60')]=function(_0x2a10c4){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x2a10c4['ContactId'],'ListId':_0x2a10c4[_0xaf7e('0x4e')],'VoiceQueueId':_0x2a10c4[_0xaf7e('0x1e')]||undefined,'CampaignId':_0x2a10c4['CampaignId']||undefined};};exports[_0xaf7e('0x61')]=function(_0x4803b7){if(_0x4803b7===_0xaf7e('0x41')||_0x4803b7===_0xaf7e('0x62')||_0x4803b7===_0xaf7e('0x51')||_0x4803b7===_0xaf7e('0x63')||_0x4803b7==='campaigntype'||_0x4803b7===_0xaf7e('0x64')||_0x4803b7===_0xaf7e('0x3a')||_0x4803b7===_0xaf7e('0x53')||_0x4803b7===_0xaf7e('0x1b')||_0x4803b7===_0xaf7e('0x4b')||_0x4803b7===_0xaf7e('0x1c')||_0x4803b7==='scheduledat'||_0x4803b7===_0xaf7e('0x45')||_0x4803b7===_0xaf7e('0x65')||_0x4803b7===_0xaf7e('0x66')||_0x4803b7===_0xaf7e('0x67')||_0x4803b7===_0xaf7e('0x68')||_0x4803b7===_0xaf7e('0x69')||_0x4803b7===_0xaf7e('0x6a')||_0x4803b7===_0xaf7e('0x6b')||_0x4803b7===_0xaf7e('0x4d')||_0x4803b7===_0xaf7e('0x4e')||_0x4803b7==='UserId'||_0x4803b7==='VoiceQueueId'||_0x4803b7===_0xaf7e('0x6c')||_0x4803b7===_0xaf7e('0x6d')||_0x4803b7===_0xaf7e('0x6e')||_0x4803b7===_0xaf7e('0x6f')||_0x4803b7===_0xaf7e('0x70')||_0x4803b7===_0xaf7e('0x71')||_0x4803b7===_0xaf7e('0x72')||_0x4803b7===_0xaf7e('0x73')||_0x4803b7===_0xaf7e('0x74')||_0x4803b7===_0xaf7e('0x75')||_0x4803b7===_0xaf7e('0x76')||_0x4803b7==='xmd-cdrtype'||_0x4803b7===_0xaf7e('0x77')||_0x4803b7==='xmd-agiafter'||_0x4803b7==='xmd-agi'||_0x4803b7===_0xaf7e('0x78')||_0x4803b7===_0xaf7e('0x79')||_0x4803b7===_0xaf7e('0x7a')||_0x4803b7===_0xaf7e('0x7b')||_0x4803b7===_0xaf7e('0x7c')||_0x4803b7==='rtpaudioqoslossbridged'||_0x4803b7===_0xaf7e('0x7d')||_0x4803b7===_0xaf7e('0x7e')||_0x4803b7==='rtpaudioqos'||_0x4803b7==='rtpaudioqosbridged'||_0x4803b7===_0xaf7e('0x7a')||_0x4803b7==='rtpaudioqosjitterbridged'||_0x4803b7===_0xaf7e('0x7c')||_0x4803b7===_0xaf7e('0x7f')||_0x4803b7===_0xaf7e('0x7d')||_0x4803b7===_0xaf7e('0x7e')||_0x4803b7===_0xaf7e('0x80')||_0x4803b7===_0xaf7e('0x81')||_0x4803b7===_0xaf7e('0x31')||_0x4803b7===_0xaf7e('0x32')){return![];}return!![];};exports[_0xaf7e('0x82')]=function(_0x1d72a4,_0x9c1609){var _0xac855e,_0x1c7c13,_0x500770;if(_0x9c1609<=0x0){_0x9c1609=0x1;}_0xac855e=new RegExp(_0xaf7e('0x83')+_0x9c1609+'}$');_0x1c7c13=Math['pow'](0xa,_0x9c1609-0x1);_0x500770=Math[_0xaf7e('0x84')](0xa,_0x9c1609)-0x1;return util['format']('%s',_[_0xaf7e('0x85')](_0x1d72a4,_0xac855e,_[_0xaf7e('0x86')](_0x1c7c13,_0x500770)));};exports['extractCalleridName']=function(_0x32153f){var _0x34589d=_0x32153f['match'](/"(.*?)"/);return _0x34589d?_0x34589d[0x1]:_0x32153f;};exports['extractCalleridNumber']=function(_0x58795e){var _0x291ed1=_0x58795e[_0xaf7e('0x87')](/<(.*?)>/);return _0x291ed1?_0x291ed1[0x1]:_0x58795e;};function buildNoAnswerEventPayload(_0x15792b,_0x22b55a){var _0x162389=buildObj(_0x15792b,'noanswer');if(!_[_0xaf7e('0x12')](_0x22b55a['variables'])){Object[_0xaf7e('0x88')](_0x22b55a[_0xaf7e('0x89')])[_0xaf7e('0x8a')](function(_0x57cd1d){_0x162389[_0x57cd1d['toLowerCase']()]=_0x22b55a[_0xaf7e('0x89')][_0x57cd1d];});}return _0x162389;}exports[_0xaf7e('0x8b')]=buildNoAnswerEventPayload; \ No newline at end of file +var _0x1871=['string','isEmpty','format','\x22%s\x22\x20<%s>','isUndefined','\x22\x22\x20<>','addVariables','Queue','name','calleridname','calleridnum','ContactId','VoiceQueueId','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','NONE','\x22agi://%s/square,%s\x22','xcally-motion-preview','_XCALLY_MIXMONITOR_UNIQUEID','toLowerVariables','hasOwnProperty','toLower','updateOriginated','isNil','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','YYYY-MM-DD\x20HH:mm:ss','state','Blacklist','starttime','responsetime','logAgent','statedesc','ringtime','getSeconds','membername','UserId','logCustomer','endtime','talktime','answertime','Failure','variablesAction','RECALL','BOOKED','channelAgent','from-sip','timeout','uniqueid','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','clone','scheduledAt','active','scheduledat','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','queue','interface','voice','mandatoryDisposition','not_inuse','status','reachable','push','getDiff','milliseconds','diff','seconds','createBody','idContact','type','dialAnswer','countglobal','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepvtcallid','\x5cw{0,','pow','random','match','noanswer','variables','keys','forEach','toLowerCase','buildNoAnswerEventPayload','util','preview','env','XCALLY_IP_AGI','../../dialer/utils','loggerCatch','error','inspect','logger','info','loggerError','logger2','getCallerId'];(function(_0x48a75b,_0x5e6e9a){var _0x43fcac=function(_0x3b2134){while(--_0x3b2134){_0x48a75b['push'](_0x48a75b['shift']());}};_0x43fcac(++_0x5e6e9a);}(_0x1871,0x185));var _0x1187=function(_0x18ddff,_0x47efdb){_0x18ddff=_0x18ddff-0x0;var _0x30ab3a=_0x1871[_0x18ddff];return _0x30ab3a;};'use strict';var util=require(_0x1187('0x0'));var _=require('lodash');var moment=require('moment');var logger=require('../../../../config/logger')(_0x1187('0x1'));var ipAgi=process[_0x1187('0x2')][_0x1187('0x3')]||'127.0.0.1';var utils=require(_0x1187('0x4'));exports[_0x1187('0x5')]=function(_0x14e8ab){return function(_0x462a33){logger[_0x1187('0x6')](_0x14e8ab,util[_0x1187('0x7')](_0x462a33,{'showHidden':![],'depth':null}));};};exports[_0x1187('0x8')]=function(_0x4aa5f5,_0x27048f){logger[_0x1187('0x9')](_0x4aa5f5,util[_0x1187('0x7')](_0x27048f,{'showHidden':![],'depth':null}));};exports[_0x1187('0xa')]=function(_0x3cf3a9,_0x394912){logger[_0x1187('0x6')](_0x3cf3a9,util[_0x1187('0x7')](_0x394912,{'showHidden':![],'depth':null}));};exports[_0x1187('0xb')]=function(_0x11087b){return function(_0x5eedf9){logger[_0x1187('0x9')](_0x11087b,util[_0x1187('0x7')](_0x5eedf9,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x11ac06,_0x2f83cb,_0x3f3b32){return{'message':_0x11ac06,'unlock':_0x2f83cb,'active':_0x3f3b32};};exports[_0x1187('0xc')]=function(_0x5b11b2,_0x1325af,_0x547251){if(!_['isUndefined'](_0x547251)&&_0x1187('0xd')===typeof _0x547251&&!_[_0x1187('0xe')](_0x547251)){if(!_['isUndefined'](_0x1325af)&&'string'===typeof _0x1325af&&!_[_0x1187('0xe')](_0x1325af)){return util[_0x1187('0xf')]('\x22%s\x22\x20<%s>',_0x1325af,_0x547251);}return util['format'](_0x1187('0x10'),_0x547251,_0x547251);}if(!_[_0x1187('0x11')](_0x5b11b2)&&_0x1187('0xd')===typeof _0x5b11b2&&!_[_0x1187('0xe')](_0x5b11b2)){return _0x5b11b2;}return _0x1187('0x12');};exports['isActive']=function(_0x5a3ff2){if(_['isNil'](_0x5a3ff2)){return![];}return _0x5a3ff2;};exports[_0x1187('0x13')]=function(_0x1585b6,_0x38c046,_0x27b6ac,_0x4d45d1,_0x4a8038,_0x5420f2){var _0x28af20={'XMD-QUEUE':_0x38c046[_0x1187('0x14')]?_0x38c046['Queue'][_0x1187('0x15')]:'','XMD-CALLERID':_0x4d45d1,'XMD-CALLERID-PREVIEW':_0x5420f2?util[_0x1187('0xf')](_0x1187('0x10'),_0x5420f2[_0x1187('0x16')],_0x5420f2[_0x1187('0x17')]):_0x4d45d1,'XMD-DIALID':_0x4a8038,'XMD-CONTACTID':_0x38c046[_0x1187('0x18')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x4d45d1,'XMD-VOICEQUEUEID':_0x38c046[_0x1187('0x19')],'XMD-DIALCHANNEL':_0x27b6ac,'XMD-DIALTIMEOUT':_0x1585b6['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util[_0x1187('0xf')]('\x22rtTxX%s%s\x22',_0x1585b6[_0x1187('0x1a')]?'g':'',_[_0x1187('0xe')](_0x1585b6[_0x1187('0x1b')])?'':_0x1187('0x1c')),'XMD-DIALURL':_0x1585b6[_0x1187('0x1d')]||'','XMD-AGI':_0x1585b6[_0x1187('0x1e')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x1585b6[_0x1187('0x1e')]):_0x1187('0x1f'),'XMD-AGIAFTER':_0x1585b6[_0x1187('0x1a')]?util['format'](_0x1187('0x20'),ipAgi,_0x1585b6[_0x1187('0x1a')]):_0x1187('0x1f'),'XMD-ORIGINATECALLERIDNUM':_0x5420f2?_0x5420f2['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x5420f2?_0x5420f2['originatecalleridname']:'','XMD-DESTINATION':_0x1187('0x21'),'SIPADDHEADER':'Call-Type:\x20PREVIEW'};if(!_[_0x1187('0xe')](_0x1585b6[_0x1187('0x1b')])){_0x28af20[util[_0x1187('0xf')]('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x1585b6[_0x1187('0x1b')];_0x28af20[util[_0x1187('0xf')]('%s',_0x1187('0x22'))]=_0x4a8038;}return _0x28af20;};exports[_0x1187('0x23')]=function(_0x399d71){var _0x23ad7b={};for(var _0x15dc0e in _0x399d71){if(_0x399d71[_0x1187('0x24')](_0x15dc0e)){_0x23ad7b[util[_0x1187('0xf')]('%s',_[_0x1187('0x25')](_0x15dc0e))]=_0x399d71[_0x15dc0e];}}return{'variables':_0x23ad7b};};exports[_0x1187('0x26')]=function(_0x13b3e1,_0x2d8461){if(!_[_0x1187('0x27')](_0x13b3e1)){if(_0x13b3e1[_0x1187('0x24')](_0x1187('0x28'))){if(_0x13b3e1[_0x1187('0x28')]>0x0){_0x13b3e1['originated']-=0x1;}else{logger[_0x1187('0x6')](_0x1187('0x29'),_0x2d8461);}}}else{logger[_0x1187('0x6')]('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x2d8461);}};exports['logBlacklist']=function(_0x143b1d){var _0x1d3bdd=moment()[_0x1187('0xf')](_0x1187('0x2a'));_0x143b1d[_0x1187('0x2b')]=0xd;_0x143b1d['statedesc']=_0x1187('0x2c');_0x143b1d[_0x1187('0x2d')]=_0x1d3bdd;_0x143b1d[_0x1187('0x2e')]=_0x1d3bdd;_0x143b1d['endtime']=_0x1d3bdd;};exports[_0x1187('0x2f')]=function(_0x309832,_0x14ae87,_0x96afe6){var _0xa691c7=moment()[_0x1187('0xf')]('YYYY-MM-DD\x20HH:mm:ss');_0x309832[_0x1187('0x2b')]=_0x14ae87;_0x309832[_0x1187('0x30')]=_0x96afe6;_0x309832[_0x1187('0x2e')]=_0xa691c7;_0x309832[_0x1187('0x31')]=utils[_0x1187('0x32')](_0x309832['responsetime'],_0x309832[_0x1187('0x2d')]);};exports['logLookAgent']=function(_0x31b247,_0x3fb019,_0x465b74){_0x31b247[_0x1187('0x33')]=_0x3fb019;_0x31b247[_0x1187('0x34')]=_0x465b74;};exports[_0x1187('0x35')]=function(_0x5b7731,_0x82a326,_0xd9030a){var _0x3da25e=moment()[_0x1187('0xf')]('YYYY-MM-DD\x20HH:mm:ss');_0x5b7731['state']=_0x82a326;_0x5b7731[_0x1187('0x30')]=_0xd9030a;_0x5b7731[_0x1187('0x2e')]=_0x5b7731[_0x1187('0x2e')]?_0x5b7731[_0x1187('0x2e')]:_0x3da25e;_0x5b7731['endtime']=_0x5b7731[_0x1187('0x36')]?_0x5b7731[_0x1187('0x36')]:_0x3da25e;_0x5b7731[_0x1187('0x31')]=utils[_0x1187('0x32')](_0x5b7731[_0x1187('0x2e')]||0x0,_0x5b7731[_0x1187('0x2d')]||0x0);_0x5b7731[_0x1187('0x37')]=_0x5b7731['answertime']?utils['getSeconds'](_0x5b7731[_0x1187('0x36')],_0x5b7731[_0x1187('0x38')]):0x0;};exports['isFailure']=function(_0x4df609){return _0x4df609===_0x1187('0x39');};exports[_0x1187('0x3a')]=function(_0x3056a8,_0x1aa43c,_0x3941ac,_0x23233b,_0x4ce711){var _0x5a1000=_0x23233b?_0x1187('0x3b'):_0x3056a8[_0x1187('0x16')];_0x5a1000=_0x4ce711?_0x1187('0x3c'):_0x5a1000;return{'actionid':_0x3056a8['uniqueid'],'action':'originate','channel':_0x3056a8[_0x1187('0x3d')],'callerid':util[_0x1187('0xf')](_0x1187('0x10'),_0x5a1000,_0x3056a8[_0x1187('0x17')]),'Exten':_0x1187('0x21'),'Context':_0x1187('0x3e'),'Priority':'1','variable':_0x3941ac,'timeout':(_0x1aa43c[_0x1187('0x3f')]||0x1e)*0x3e8,'async':!![],'channelid':_0x3056a8[_0x1187('0x40')]};};exports[_0x1187('0x41')]=function(_0x4fc736){return _0x4fc736[_0x1187('0x42')]+_0x4fc736[_0x1187('0x43')]+_0x4fc736[_0x1187('0x44')]+_0x4fc736[_0x1187('0x45')]+_0x4fc736['countnosuchnumberretry'];};exports['cloneAction']=function(_0x4bfd01){var _0x12e135=_[_0x1187('0x46')](_0x4bfd01);_0x12e135[_0x1187('0x2b')]=0xf;_0x12e135[_0x1187('0x30')]='Global';return _0x12e135;};exports[_0x1187('0x47')]=function(_0x2d50e6,_0x46b1ed,_0x1061f2){var _0x4a2936={};_0x4a2936[_0x46b1ed]=_0x2d50e6[_0x46b1ed];_0x4a2936[_0x1187('0x48')]=![];_0x4a2936[_0x1187('0x49')]=moment()['add'](_0x1061f2,_0x1187('0x4a'))['format'](_0x1187('0x2a'));_0x4a2936['ContactId']=_0x2d50e6[_0x1187('0x18')];_0x4a2936[_0x1187('0x4b')]=_0x2d50e6[_0x1187('0x4b')];_0x4a2936['VoiceQueueId']=_0x2d50e6[_0x1187('0x19')]||undefined;return _0x4a2936;};exports[_0x1187('0x4c')]=function(_0x439775,_0x455b60){if(!_[_0x1187('0x27')](_0x439775)){if(_0x439775[_0x1187('0x4d')]>0x0){_0x439775[_0x1187('0x4d')]-=0x1;}else{logger[_0x1187('0x6')](_0x455b60,_0x1187('0x4e'));}}else{logger[_0x1187('0x6')](_0x455b60,_0x1187('0x4f'));}};exports[_0x1187('0x50')]=function(_0xd3bb44){if(_0xd3bb44<=0x0){return!![];}return![];};function buildObj(_0x4f5496,_0x4657ce,_0x430ae4){_0x4f5496[_0x1187('0x51')]=_0x4657ce;_0x4f5496[_0x1187('0x15')]=_0x4f5496[_0x1187('0x52')];_0x4f5496[_0x1187('0x53')]=_0x4f5496['channelAgent'];_0x4f5496['motionChannel']=_0x1187('0x54');if(_0x430ae4){_0x4f5496[_0x1187('0x55')]=_0x430ae4[_0x1187('0x55')];}return _0x4f5496;}exports['buildObj']=buildObj;exports['buildAcw']=function(_0x264712){var _0xa51fa9={};_0xa51fa9[_0x1187('0x52')]=_0x264712['queue'];_0xa51fa9[_0x1187('0x53')]=_0x264712[_0x1187('0x3d')];_0xa51fa9['uniqueid']=_0x264712[_0x1187('0x40')];return _0xa51fa9;};exports['agentReadyId']=function(_0x56ea63){var _0x2a53b2=[];for(var _0x19d0c1 in _0x56ea63){if(_0x56ea63[_0x1187('0x24')](_0x19d0c1)){if(!_['isNil'](_0x56ea63[_0x19d0c1])&&_0x56ea63[_0x19d0c1][_0x1187('0x2b')]===_0x1187('0x56')&&_0x56ea63[_0x19d0c1][_0x1187('0x57')]===_0x1187('0x58')){_0x2a53b2[_0x1187('0x59')](_0x56ea63[_0x19d0c1]['id']);}}}return _0x2a53b2;};exports[_0x1187('0x5a')]=function(_0x18d5fb){var _0xf4ef2d=moment()[_0x1187('0x5b')](0x0);var _0x5f20ab=moment(_0x18d5fb)[_0x1187('0x5b')](0x0);return _0xf4ef2d[_0x1187('0x5c')](_0x5f20ab,_0x1187('0x5d'));};exports[_0x1187('0x5e')]=function(_0x3ee644){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x3ee644[_0x1187('0x18')],'ListId':_0x3ee644[_0x1187('0x4b')],'VoiceQueueId':_0x3ee644[_0x1187('0x19')]||undefined,'CampaignId':_0x3ee644['CampaignId']||undefined};};exports['filterKey']=function(_0x313147){if(_0x313147==='uniqueid'||_0x313147===_0x1187('0x5f')||_0x313147==='queue'||_0x313147===_0x1187('0x60')||_0x313147==='campaigntype'||_0x313147===_0x1187('0x61')||_0x313147===_0x1187('0x33')||_0x313147===_0x1187('0x3d')||_0x313147===_0x1187('0x16')||_0x313147===_0x1187('0x48')||_0x313147===_0x1187('0x17')||_0x313147==='scheduledat'||_0x313147===_0x1187('0x42')||_0x313147===_0x1187('0x43')||_0x313147===_0x1187('0x44')||_0x313147===_0x1187('0x62')||_0x313147==='callback'||_0x313147===_0x1187('0x63')||_0x313147===_0x1187('0x64')||_0x313147===_0x1187('0x65')||_0x313147===_0x1187('0x18')||_0x313147==='ListId'||_0x313147===_0x1187('0x34')||_0x313147===_0x1187('0x19')||_0x313147===_0x1187('0x66')||_0x313147===_0x1187('0x67')||_0x313147===_0x1187('0x68')||_0x313147===_0x1187('0x69')||_0x313147===_0x1187('0x6a')||_0x313147===_0x1187('0x6b')||_0x313147==='xmd-dialtimeout'||_0x313147===_0x1187('0x6c')||_0x313147===_0x1187('0x6d')||_0x313147===_0x1187('0x6e')||_0x313147===_0x1187('0x6f')||_0x313147===_0x1187('0x70')||_0x313147==='xmd-callerid'||_0x313147===_0x1187('0x71')||_0x313147===_0x1187('0x72')||_0x313147===_0x1187('0x73')||_0x313147===_0x1187('0x74')||_0x313147===_0x1187('0x75')||_0x313147===_0x1187('0x76')||_0x313147===_0x1187('0x77')||_0x313147==='rtpaudioqoslossbridged'||_0x313147==='rtpaudioqosrtt'||_0x313147==='rtpaudioqosrttbridged'||_0x313147===_0x1187('0x73')||_0x313147===_0x1187('0x74')||_0x313147===_0x1187('0x75')||_0x313147==='rtpaudioqosjitterbridged'||_0x313147===_0x1187('0x77')||_0x313147===_0x1187('0x78')||_0x313147===_0x1187('0x79')||_0x313147===_0x1187('0x7a')||_0x313147==='bridgepeer'||_0x313147===_0x1187('0x7b')||_0x313147===_0x1187('0x2b')||_0x313147===_0x1187('0x30')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x2f1790,_0x402433){var _0x68f55,_0x37993c,_0x511b37;if(_0x402433<=0x0){_0x402433=0x1;}_0x68f55=new RegExp(_0x1187('0x7c')+_0x402433+'}$');_0x37993c=Math[_0x1187('0x7d')](0xa,_0x402433-0x1);_0x511b37=Math[_0x1187('0x7d')](0xa,_0x402433)-0x1;return util[_0x1187('0xf')]('%s',_['replace'](_0x2f1790,_0x68f55,_[_0x1187('0x7e')](_0x37993c,_0x511b37)));};exports['extractCalleridName']=function(_0x28785e){var _0x495f05=_0x28785e[_0x1187('0x7f')](/"(.*?)"/);return _0x495f05?_0x495f05[0x1]:_0x28785e;};exports['extractCalleridNumber']=function(_0x10649f){var _0x1173e4=_0x10649f[_0x1187('0x7f')](/<(.*?)>/);return _0x1173e4?_0x1173e4[0x1]:_0x10649f;};function buildNoAnswerEventPayload(_0x4929c0,_0x5cb406){var _0x13a7b3=buildObj(_0x4929c0,_0x1187('0x80'));if(!_[_0x1187('0xe')](_0x5cb406[_0x1187('0x81')])){Object[_0x1187('0x82')](_0x5cb406[_0x1187('0x81')])[_0x1187('0x83')](function(_0x251978){_0x13a7b3[_0x251978[_0x1187('0x84')]()]=_0x5cb406[_0x1187('0x81')][_0x251978];});}return _0x13a7b3;}exports[_0x1187('0x85')]=buildNoAnswerEventPayload; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index f7a8e67..525dc38 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 _0x0b3e=['voicequeuechannelredirect','queueadd','string','voicechannel','voicequeuechannelhangup'];(function(_0x35a441,_0x3a2ec6){var _0x571ce3=function(_0x161827){while(--_0x161827){_0x35a441['push'](_0x35a441['shift']());}};_0x571ce3(++_0x3a2ec6);}(_0x0b3e,0x18c));var _0xe0b3=function(_0x1b2554,_0x121195){_0x1b2554=_0x1b2554-0x0;var _0x247072=_0x0b3e[_0x1b2554];return _0x247072;};'use strict';exports[_0xe0b3('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0xe0b3('0x1'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':'number','required':![]},'paused':{'type':'boolean','required':![]}};exports['queueremove']={'queue':{'type':_0xe0b3('0x1'),'required':!![]},'interface':{'type':_0xe0b3('0x1'),'required':!![]}};exports['queuepause']={'interface':{'type':_0xe0b3('0x1'),'required':!![]},'paused':{'type':'boolean'},'reason':{'type':'string','required':![]}};exports['reload']={'module':{'type':'string','required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':'string','required':!![]}};exports[_0xe0b3('0x2')]={'uniqueid':{'type':_0xe0b3('0x1'),'required':!![]},'filename':{'type':_0xe0b3('0x1')},'format':{'type':_0xe0b3('0x1')},'mixmonitorid':{'type':_0xe0b3('0x1')}};exports[_0xe0b3('0x3')]={'uniqueid':{'type':_0xe0b3('0x1'),'required':!![]}};exports[_0xe0b3('0x4')]={'uniqueid':{'type':_0xe0b3('0x1'),'required':!![]},'exten':{'type':_0xe0b3('0x1'),'required':!![]},'context':{'type':'string'}}; \ No newline at end of file +var _0x8978=['voicequeuechannel','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','boolean','queueremove','queuepause','reload'];(function(_0x51c819,_0xd812db){var _0x15c5d2=function(_0x2977f0){while(--_0x2977f0){_0x51c819['push'](_0x51c819['shift']());}};_0x15c5d2(++_0xd812db);}(_0x8978,0x86));var _0x8897=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x8978[_0x2b10c6];return _0x3789d2;};'use strict';exports[_0x8897('0x0')]={'queue':{'type':_0x8897('0x1'),'required':!![]},'interface':{'type':_0x8897('0x1'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':'number','required':![]},'paused':{'type':_0x8897('0x2'),'required':![]}};exports[_0x8897('0x3')]={'queue':{'type':_0x8897('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports[_0x8897('0x4')]={'interface':{'type':_0x8897('0x1'),'required':!![]},'paused':{'type':_0x8897('0x2')},'reason':{'type':_0x8897('0x1'),'required':![]}};exports[_0x8897('0x5')]={'module':{'type':_0x8897('0x1'),'required':![]}};exports[_0x8897('0x6')]={'uniqueid':{'type':_0x8897('0x1'),'required':!![]}};exports[_0x8897('0x7')]={'uniqueid':{'type':_0x8897('0x1'),'required':!![]},'filename':{'type':_0x8897('0x1')},'format':{'type':'string'},'mixmonitorid':{'type':_0x8897('0x1')}};exports[_0x8897('0x8')]={'uniqueid':{'type':'string','required':!![]}};exports[_0x8897('0x9')]={'uniqueid':{'type':_0x8897('0x1'),'required':!![]},'exten':{'type':_0x8897('0x1'),'required':!![]},'context':{'type':_0x8897('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index b3c9601..1011670 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 _0x2032=['voiceExtensions','initCampaignHopperHistory','merge','initFaxAccounts','exports','moment','util','../model/agent','../model/trunk','../model/voiceQueue','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/faxAccount','telephones','trunks','voiceQueues','campaigns','outbound','channels','queueChannels','sugarcrmAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','format','SIP/%s','name','hasOwnProperty','interface','total','answered','sumHoldTime','sumDuration','sumBillable','ivrTotalCallsDays','isEmpty','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundRejectCallsDay','outboundReCallsDay','queueStatusComplete','prototype','length','isNil','isUndefined','agents','initTelephones','initTrunks','mergeFromDatabase','initTriggers','triggers','initTemplates','templates','initZendeskAccounts','zendeskAccounts','initSalesforceAccounts','salesforceAccounts','initFreshdeskAccounts','freshdeskAccounts','initZohoAccounts','zohoAccounts','initDeskAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','queue','queuecallerexit','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','duration','ANSWERED','billableseconds','initCampaigns','dialQueueProject','SquareProject'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2032,0xd9));var _0x2203=function(_0x5931f1,_0x53031f){_0x5931f1=_0x5931f1-0x0;var _0x3401eb=_0x2032[_0x5931f1];return _0x3401eb;};'use strict';var _=require('lodash');var moment=require(_0x2203('0x0'));var util=require(_0x2203('0x1'));var Agent=require(_0x2203('0x2'));var Telephone=require('../model/telephone');var Trunk=require(_0x2203('0x3'));var VoiceQueue=require(_0x2203('0x4'));var Trigger=require('../model/trigger');var Template=require(_0x2203('0x5'));var Campaign=require(_0x2203('0x6'));var VoiceExtension=require(_0x2203('0x7'));var ZendeskAccount=require(_0x2203('0x8'));var SalesforceAccount=require(_0x2203('0x9'));var FreshdeskAccount=require(_0x2203('0xa'));var SugarcrmAccount=require(_0x2203('0xb'));var ZohoAccount=require(_0x2203('0xc'));var DeskAccount=require(_0x2203('0xd'));var VtigerAccount=require(_0x2203('0xe'));var ServicenowAccount=require(_0x2203('0xf'));var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0x2203('0x10'));function Realtime(){this['agents']={};this[_0x2203('0x11')]={};this[_0x2203('0x12')]={};this[_0x2203('0x13')]={};this['triggers']={};this[_0x2203('0x14')]={};this['templates']={};this[_0x2203('0x15')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x2203('0x16')]={};this[_0x2203('0x17')]={};this['outboundChannels']={};this['timers']={};this['settings']={};this['zendeskAccounts']={};this['salesforceAccounts']={};this[_0x2203('0x18')]={};this['freshdeskAccounts']={};this['zohoAccounts']={};this[_0x2203('0x19')]={};this[_0x2203('0x1a')]={};this[_0x2203('0x1b')]={};this[_0x2203('0x1c')]={};this[_0x2203('0x1d')]={};this[_0x2203('0x1e')]={};}function freeIsNotKey(_0x2c36e6,_0x2c085c,_0xdf9d0b){var _0x3053f3=_['mapKeys'](_0x2c36e6,function(_0x280eda){return _0x280eda[_0xdf9d0b];});for(var _0x2ee127 in _0x2c085c){if(_0x2c085c['hasOwnProperty'](_0x2ee127)){if(!_0x3053f3[_0x2ee127]){delete _0x2c085c[_0x2ee127];}}}}function freeIsNotKeySip(_0x3f9ef6,_0x8906e1){var _0x4aeb9f=_[_0x2203('0x1f')](_0x3f9ef6,function(_0x5ee83c){return util[_0x2203('0x20')](_0x2203('0x21'),_0x5ee83c[_0x2203('0x22')]);});for(var _0x3b4034 in _0x8906e1){if(_0x8906e1[_0x2203('0x23')](_0x3b4034)){if(!_0x4aeb9f[_0x3b4034]){delete _0x8906e1[_0x3b4034];}}}}function freeIsNotKeyAgent(_0x449039,_0x538c23){var _0x13d3f7=_['mapKeys'](_0x449039,function(_0x5ac866){var _0x15f543=_['isNil'](_0x5ac866[_0x2203('0x24')])?util[_0x2203('0x20')]('SIP/%s',_0x5ac866[_0x2203('0x22')]):_0x5ac866['interface'];return _0x15f543;});for(var _0x5c8da9 in _0x538c23){if(_0x538c23[_0x2203('0x23')](_0x5c8da9)){if(!_0x13d3f7[_0x5c8da9]){delete _0x538c23[_0x5c8da9];}}}}function clearVoiceCallReports(_0x2718f5){_0x2718f5[_0x2203('0x25')]=0x0;_0x2718f5[_0x2203('0x26')]=0x0;_0x2718f5[_0x2203('0x27')]=0x0;_0x2718f5[_0x2203('0x28')]=0x0;_0x2718f5[_0x2203('0x29')]=0x0;}function clearCampaigns(_0x250349){if(!_['isEmpty'](_0x250349)){for(var _0x143f41 in _0x250349){if(_0x250349[_0x2203('0x23')](_0x143f41)){_0x250349[_0x143f41][_0x2203('0x2a')]=0x0;_0x250349[_0x143f41]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0xb2071b){if(!_[_0x2203('0x2b')](_0xb2071b)){for(var _0x5c5fd3 in _0xb2071b){if(_0xb2071b[_0x2203('0x23')](_0x5c5fd3)){_0xb2071b[_0x5c5fd3][_0x2203('0x25')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x26')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x2c')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x2d')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x27')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x28')]=0x0;_0xb2071b[_0x5c5fd3]['sumBillable']=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x2e')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x2f')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x30')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x31')]=0x0;_0xb2071b[_0x5c5fd3]['outboundNoSuchCallsDay']=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x32')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x33')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x34')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x35')]=0x0;_0xb2071b[_0x5c5fd3]['outboundOriginateFailureCallsDay']=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x36')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x37')]=0x0;_0xb2071b[_0x5c5fd3]['outboundAnswerAgiCallsDay']=0x0;_0xb2071b[_0x5c5fd3]['outboundAnswerCallsDay']=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x38')]=!![];}}}}Realtime['prototype']['mergeFromDatabase']=function(_0x125dfc,_0x464c88){for(var _0x191894 in _0x464c88){if(_0x125dfc[_0x2203('0x23')](_0x191894)){_0x125dfc[_0x191894]=_0x464c88[_0x191894];}}};Realtime[_0x2203('0x39')]['initAgents']=function(){var _0xb22e28=this;return function(_0x2324c0){if(_0x2324c0){freeIsNotKeyAgent(_0x2324c0,_0xb22e28['agents']);for(var _0x2a2ee7=0x0,_0x20fbe1={};_0x2a2ee7<_0x2324c0[_0x2203('0x3a')];_0x2a2ee7+=0x1){_0x20fbe1=_0x2324c0[_0x2a2ee7];var _0x4187b4=_[_0x2203('0x3b')](_0x20fbe1[_0x2203('0x24')])?util[_0x2203('0x20')](_0x2203('0x21'),_0x20fbe1[_0x2203('0x22')]):_0x20fbe1['interface'];if(_[_0x2203('0x3c')](_0xb22e28[_0x2203('0x3d')][_0x4187b4])){_0xb22e28['agents'][_0x4187b4]=new Agent(_0x20fbe1);}else{_0xb22e28['mergeFromDatabase'](_0xb22e28[_0x2203('0x3d')][_0x4187b4],_0x20fbe1);}}}return _0xb22e28['agents'];};};Realtime[_0x2203('0x39')][_0x2203('0x3e')]=function(){var _0x127ee3=this;return function(_0x5221f0){if(_0x5221f0){freeIsNotKeySip(_0x5221f0,_0x127ee3['telephones']);for(var _0x34cdeb=0x0,_0x47c93a={};_0x34cdeb<_0x5221f0[_0x2203('0x3a')];_0x34cdeb+=0x1){_0x47c93a=_0x5221f0[_0x34cdeb];if(_['isUndefined'](_0x127ee3[_0x2203('0x11')][util['format'](_0x2203('0x21'),_0x47c93a[_0x2203('0x22')])])){_0x127ee3[_0x2203('0x11')][util[_0x2203('0x20')](_0x2203('0x21'),_0x47c93a['name'])]=new Telephone(_0x47c93a);}else{_0x127ee3['mergeFromDatabase'](_0x127ee3['telephones'][util[_0x2203('0x20')](_0x2203('0x21'),_0x47c93a[_0x2203('0x22')])],_0x47c93a);}}}return _0x127ee3[_0x2203('0x11')];};};Realtime[_0x2203('0x39')][_0x2203('0x3f')]=function(){var _0x1c7e3d=this;return function(_0x590b4e){if(_0x590b4e){freeIsNotKeySip(_0x590b4e,_0x1c7e3d[_0x2203('0x12')]);for(var _0x1b12c3=0x0,_0x108fde={};_0x1b12c3<_0x590b4e[_0x2203('0x3a')];_0x1b12c3+=0x1){_0x108fde=_0x590b4e[_0x1b12c3];if(_['isUndefined'](_0x1c7e3d['trunks'][util[_0x2203('0x20')]('SIP/%s',_0x108fde[_0x2203('0x22')])])){_0x1c7e3d[_0x2203('0x12')][util[_0x2203('0x20')]('SIP/%s',_0x108fde['name'])]=new Trunk(_0x108fde);}else{_0x1c7e3d[_0x2203('0x40')](_0x1c7e3d[_0x2203('0x12')][util[_0x2203('0x20')](_0x2203('0x21'),_0x108fde[_0x2203('0x22')])],_0x108fde);}}}return _0x1c7e3d[_0x2203('0x12')];};};Realtime['prototype'][_0x2203('0x41')]=function(){var _0x165a3f=this;return function(_0x3a866c){if(_0x3a866c){freeIsNotKey(_0x3a866c,_0x165a3f[_0x2203('0x42')],'id');for(var _0x16b452=0x0,_0x36b99f={};_0x16b452<_0x3a866c[_0x2203('0x3a')];_0x16b452+=0x1){_0x36b99f=_0x3a866c[_0x16b452];if(_[_0x2203('0x3c')](_0x165a3f[_0x2203('0x42')][_0x36b99f['id']])){_0x165a3f[_0x2203('0x42')][_0x36b99f['id']]=new Trigger(_0x36b99f);}else{_0x165a3f['mergeFromDatabase'](_0x165a3f[_0x2203('0x42')][_0x36b99f['id']],_0x36b99f);}}}return _0x165a3f[_0x2203('0x42')];};};Realtime[_0x2203('0x39')][_0x2203('0x43')]=function(){var _0x4c3259=this;return function(_0x58bd5c){if(_0x58bd5c){freeIsNotKey(_0x58bd5c,_0x4c3259[_0x2203('0x44')],'id');for(var _0x48129c=0x0,_0x273e5f={};_0x48129c<_0x58bd5c[_0x2203('0x3a')];_0x48129c+=0x1){_0x273e5f=_0x58bd5c[_0x48129c];if(_[_0x2203('0x3c')](_0x4c3259[_0x2203('0x44')][_0x273e5f['id']])){_0x4c3259['templates'][_0x273e5f['id']]=new Template(_0x273e5f);}else{_0x4c3259[_0x2203('0x40')](_0x4c3259[_0x2203('0x44')][_0x273e5f['id']],_0x273e5f);}}}return _0x4c3259['templates'];};};Realtime[_0x2203('0x39')][_0x2203('0x45')]=function(){var _0x35b2e9=this;return function(_0x2600a9){if(_0x2600a9){freeIsNotKey(_0x2600a9,_0x35b2e9['zendeskAccounts'],'id');for(var _0x4c1a29=0x0,_0x21b8ab={};_0x4c1a29<_0x2600a9['length'];_0x4c1a29+=0x1){_0x21b8ab=_0x2600a9[_0x4c1a29];if(_['isUndefined'](_0x35b2e9[_0x2203('0x46')][_0x21b8ab['id']])){_0x35b2e9[_0x2203('0x46')][_0x21b8ab['id']]=new ZendeskAccount(_0x21b8ab);}else{_0x35b2e9[_0x2203('0x40')](_0x35b2e9['zendeskAccounts'][_0x21b8ab['id']],_0x21b8ab);}}}return _0x35b2e9['zendeskAccounts'];};};Realtime[_0x2203('0x39')][_0x2203('0x47')]=function(){var _0x12d7fa=this;return function(_0x21d2d7){if(_0x21d2d7){freeIsNotKey(_0x21d2d7,_0x12d7fa[_0x2203('0x48')],'id');for(var _0x21fd78=0x0,_0x4a7f4e={};_0x21fd78<_0x21d2d7[_0x2203('0x3a')];_0x21fd78+=0x1){_0x4a7f4e=_0x21d2d7[_0x21fd78];if(_['isUndefined'](_0x12d7fa[_0x2203('0x48')][_0x4a7f4e['id']])){_0x12d7fa[_0x2203('0x48')][_0x4a7f4e['id']]=new SalesforceAccount(_0x4a7f4e);}else{_0x12d7fa[_0x2203('0x40')](_0x12d7fa[_0x2203('0x48')][_0x4a7f4e['id']],_0x4a7f4e);}}}return _0x12d7fa['salesforceAccounts'];};};Realtime['prototype'][_0x2203('0x49')]=function(){var _0x1f772d=this;return function(_0x126aad){if(_0x126aad){freeIsNotKey(_0x126aad,_0x1f772d[_0x2203('0x4a')],'id');for(var _0x559370=0x0,_0x4de47a={};_0x559370<_0x126aad['length'];_0x559370+=0x1){_0x4de47a=_0x126aad[_0x559370];if(_[_0x2203('0x3c')](_0x1f772d[_0x2203('0x4a')][_0x4de47a['id']])){_0x1f772d['freshdeskAccounts'][_0x4de47a['id']]=new FreshdeskAccount(_0x4de47a);}else{_0x1f772d[_0x2203('0x40')](_0x1f772d[_0x2203('0x4a')][_0x4de47a['id']],_0x4de47a);}}}return _0x1f772d['freshdeskAccounts'];};};Realtime[_0x2203('0x39')][_0x2203('0x4b')]=function(){var _0x172c6a=this;return function(_0x6a1877){if(_0x6a1877){freeIsNotKey(_0x6a1877,_0x172c6a['zohoAccounts'],'id');for(var _0x120db1=0x0,_0x5268d6={};_0x120db1<_0x6a1877[_0x2203('0x3a')];_0x120db1+=0x1){_0x5268d6=_0x6a1877[_0x120db1];if(_[_0x2203('0x3c')](_0x172c6a['zohoAccounts'][_0x5268d6['id']])){_0x172c6a[_0x2203('0x4c')][_0x5268d6['id']]=new ZohoAccount(_0x5268d6);}else{_0x172c6a[_0x2203('0x40')](_0x172c6a[_0x2203('0x4c')][_0x5268d6['id']],_0x5268d6);}}}return _0x172c6a[_0x2203('0x4c')];};};Realtime[_0x2203('0x39')][_0x2203('0x4d')]=function(){var _0x569d4a=this;return function(_0x562a3d){if(_0x562a3d){freeIsNotKey(_0x562a3d,_0x569d4a[_0x2203('0x19')],'id');for(var _0x524356=0x0,_0x56e881={};_0x524356<_0x562a3d[_0x2203('0x3a')];_0x524356+=0x1){_0x56e881=_0x562a3d[_0x524356];if(_[_0x2203('0x3c')](_0x569d4a[_0x2203('0x19')][_0x56e881['id']])){_0x569d4a['deskAccounts'][_0x56e881['id']]=new DeskAccount(_0x56e881);}else{_0x569d4a[_0x2203('0x40')](_0x569d4a['deskAccounts'][_0x56e881['id']],_0x56e881);}}}return _0x569d4a['deskAccounts'];};};Realtime[_0x2203('0x39')]['initSugarcrmAccounts']=function(){var _0x54ec71=this;return function(_0x5efc59){if(_0x5efc59){freeIsNotKey(_0x5efc59,_0x54ec71[_0x2203('0x18')],'id');for(var _0x31256b=0x0,_0x367122={};_0x31256b<_0x5efc59[_0x2203('0x3a')];_0x31256b+=0x1){_0x367122=_0x5efc59[_0x31256b];if(_[_0x2203('0x3c')](_0x54ec71[_0x2203('0x18')][_0x367122['id']])){_0x54ec71[_0x2203('0x18')][_0x367122['id']]=new SugarcrmAccount(_0x367122);}else{_0x54ec71[_0x2203('0x40')](_0x54ec71[_0x2203('0x18')][_0x367122['id']],_0x367122);}}}return _0x54ec71[_0x2203('0x18')];};};Realtime[_0x2203('0x39')][_0x2203('0x4e')]=function(){var _0x58ff57=this;return function(_0x585bde){if(_0x585bde){freeIsNotKey(_0x585bde,_0x58ff57[_0x2203('0x1a')],'id');for(var _0x43d8c0=0x0,_0x2511bd={};_0x43d8c0<_0x585bde[_0x2203('0x3a')];_0x43d8c0+=0x1){_0x2511bd=_0x585bde[_0x43d8c0];if(_[_0x2203('0x3c')](_0x58ff57[_0x2203('0x1a')][_0x2511bd['id']])){_0x58ff57['vtigerAccounts'][_0x2511bd['id']]=new VtigerAccount(_0x2511bd);}else{_0x58ff57['mergeFromDatabase'](_0x58ff57[_0x2203('0x1a')][_0x2511bd['id']],_0x2511bd);}}}return _0x58ff57[_0x2203('0x1a')];};};Realtime[_0x2203('0x39')][_0x2203('0x4f')]=function(){var _0xcab922=this;return function(_0x7b0b9c){if(_0x7b0b9c){freeIsNotKey(_0x7b0b9c,_0xcab922[_0x2203('0x1b')],'id');for(var _0x191b67=0x0,_0x2c6bcc={};_0x191b67<_0x7b0b9c[_0x2203('0x3a')];_0x191b67+=0x1){_0x2c6bcc=_0x7b0b9c[_0x191b67];if(_[_0x2203('0x3c')](_0xcab922['servicenowAccounts'][_0x2c6bcc['id']])){_0xcab922[_0x2203('0x1b')][_0x2c6bcc['id']]=new ServicenowAccount(_0x2c6bcc);}else{_0xcab922[_0x2203('0x40')](_0xcab922[_0x2203('0x1b')][_0x2c6bcc['id']],_0x2c6bcc);}}}return _0xcab922[_0x2203('0x1b')];};};Realtime[_0x2203('0x39')][_0x2203('0x50')]=function(){var _0x52c159=this;return function(_0x544756){if(_0x544756){freeIsNotKey(_0x544756,_0x52c159[_0x2203('0x1c')],'id');for(var _0x35b7b9=0x0,_0x49e795={};_0x35b7b9<_0x544756[_0x2203('0x3a')];_0x35b7b9+=0x1){_0x49e795=_0x544756[_0x35b7b9];if(_[_0x2203('0x3c')](_0x52c159[_0x2203('0x1c')][_0x49e795['id']])){_0x52c159[_0x2203('0x1c')][_0x49e795['id']]=new Dynamics365Account(_0x49e795);}else{_0x52c159[_0x2203('0x40')](_0x52c159[_0x2203('0x1c')][_0x49e795['id']],_0x49e795);}}}return _0x52c159[_0x2203('0x1c')];};};Realtime[_0x2203('0x39')][_0x2203('0x51')]=function(){var _0x519120=this;return function(_0x468619){if(_0x468619){freeIsNotKey(_0x468619,_0x519120[_0x2203('0x1d')],'id');for(var _0x465898=0x0,_0x4e461e={};_0x465898<_0x468619[_0x2203('0x3a')];_0x465898+=0x1){_0x4e461e=_0x468619[_0x465898];if(_[_0x2203('0x3c')](_0x519120[_0x2203('0x1d')][_0x4e461e['id']])){_0x519120[_0x2203('0x1d')][_0x4e461e['id']]=new FreshsalesAccount(_0x4e461e);}else{_0x519120[_0x2203('0x40')](_0x519120['freshsalesAccounts'][_0x4e461e['id']],_0x4e461e);}}}return _0x519120[_0x2203('0x1d')];};};Realtime[_0x2203('0x39')][_0x2203('0x52')]=function(){var _0x4dde80=this;return function(_0x5507b6){for(var _0x5d9ae2=0x0;_0x5d9ae2<_0x5507b6['length'];_0x5d9ae2+=0x1){_['merge'](_0x4dde80[_0x2203('0x13')][_0x5507b6[_0x5d9ae2][_0x2203('0x22')]],_0x5507b6[_0x5d9ae2]);}return _0x4dde80[_0x2203('0x13')];};};Realtime[_0x2203('0x39')][_0x2203('0x53')]=function(){var _0x169845=this;return function(_0x3f7926){clearVoiceQueues(_0x169845[_0x2203('0x13')]);if(_0x3f7926){_0x3f7926=_['groupBy'](_0x3f7926,'uniqueid');for(var _0xb54e51 in _0x3f7926){if(_0x3f7926[_0x2203('0x23')](_0xb54e51)){for(var _0xafcc82=0x0;_0xafcc82<_0x3f7926[_0xb54e51][_0x2203('0x3a')];_0xafcc82+=0x1){var _0x1bbd2d=_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x54')];if(_0x169845[_0x2203('0x13')][_0x1bbd2d]){if(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x55')]){_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x2c')]+=0x1;}if(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x56')]){_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x2d')]+=0x1;}_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x27')]+=moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x57')])[_0x2203('0x58')](moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x59')]),_0x2203('0x5a'))||0x0;if(_0xafcc82===_0x3f7926[_0xb54e51]['length']-0x1){_0x169845[_0x2203('0x13')][_0x1bbd2d]['sumDuration']+=moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x5b')]||_0x3f7926[_0xb54e51][_0xafcc82]['queuecallerabandonAt']||_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x5c')])[_0x2203('0x58')](moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x59')]),_0x2203('0x5a'))||0x0;_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x25')]+=0x1;if(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x5d')]){_0x169845[_0x2203('0x13')][_0x1bbd2d]['answered']+=0x1;_0x169845['voiceQueues'][_0x1bbd2d][_0x2203('0x29')]+=moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x5b')])[_0x2203('0x58')](moment(_0x3f7926[_0xb54e51][_0xafcc82]['queuecallerleaveAt']),'seconds')||0x0;}}else{_0x169845['voiceQueues'][_0x1bbd2d][_0x2203('0x28')]+=_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x27')]||0x0;}}}}}}return _0x169845[_0x2203('0x13')];};};Realtime['prototype'][_0x2203('0x5e')]=function(){var _0x47a2c7=this;return function(_0x48bd5){clearVoiceCallReports(_0x47a2c7[_0x2203('0x15')]);if(_0x48bd5){for(var _0xe3bee5=0x0;_0xe3bee5<_0x48bd5[_0x2203('0x3a')];_0xe3bee5+=0x1){_0x47a2c7[_0x2203('0x15')]['total']+=0x1;_0x47a2c7[_0x2203('0x15')][_0x2203('0x28')]+=_0x48bd5[_0xe3bee5][_0x2203('0x5f')];if(_0x48bd5[_0xe3bee5]['disposition']===_0x2203('0x60')){_0x47a2c7[_0x2203('0x15')][_0x2203('0x26')]+=0x1;_0x47a2c7[_0x2203('0x15')][_0x2203('0x27')]+=_0x48bd5[_0xe3bee5][_0x2203('0x5f')]-_0x48bd5[_0xe3bee5][_0x2203('0x61')]||0x0;_0x47a2c7[_0x2203('0x15')][_0x2203('0x29')]+=_0x48bd5[_0xe3bee5][_0x2203('0x61')];}}}return _0x47a2c7[_0x2203('0x15')];};};Realtime['prototype'][_0x2203('0x62')]=function(){var _0x7f71b8=this;return function(_0x21b755){if(_0x21b755){freeIsNotKey(_0x21b755,_0x7f71b8[_0x2203('0x14')],_0x2203('0x22'));for(var _0x52c35e=0x0,_0x23f7b1={};_0x52c35e<_0x21b755[_0x2203('0x3a')];_0x52c35e+=0x1){_0x23f7b1=_0x21b755[_0x52c35e];if(_[_0x2203('0x3c')](_0x7f71b8[_0x2203('0x14')][_0x23f7b1[_0x2203('0x22')]])){_0x7f71b8[_0x2203('0x14')][_0x23f7b1['name']]=new Campaign(_0x23f7b1);}else{_0x7f71b8['mergeFromDatabase'](_0x7f71b8[_0x2203('0x14')][_0x23f7b1[_0x2203('0x22')]],_0x23f7b1);_0x7f71b8[_0x2203('0x14')][_0x23f7b1[_0x2203('0x22')]][_0x2203('0x63')]=_0x23f7b1['SquareProject']?_0x23f7b1[_0x2203('0x64')][_0x2203('0x22')]:undefined;}}}return _0x7f71b8['campaigns'];};};Realtime['prototype']['initVoiceExtensions']=function(){var _0x4fc51a=this;return function(_0x5e07d7){if(_0x5e07d7){freeIsNotKey(_0x5e07d7,_0x4fc51a[_0x2203('0x65')],'id');for(var _0x6319a3=0x0,_0x437095={};_0x6319a3<_0x5e07d7['length'];_0x6319a3+=0x1){_0x437095=_0x5e07d7[_0x6319a3];if(_['isUndefined'](_0x4fc51a['voiceExtensions'][_0x437095['id']])){_0x4fc51a[_0x2203('0x65')][_0x437095['id']]=new VoiceExtension(_0x437095);}else{_0x4fc51a[_0x2203('0x40')](_0x4fc51a[_0x2203('0x65')][_0x437095['id']],_0x437095);}}}return _0x4fc51a[_0x2203('0x65')];};};Realtime[_0x2203('0x39')][_0x2203('0x66')]=function(){var _0x3d1797=this;return function(_0x52f25e){clearCampaigns(_0x3d1797[_0x2203('0x14')]);for(var _0x74843=0x0;_0x74843<_0x52f25e[_0x2203('0x3a')];_0x74843+=0x1){_[_0x2203('0x67')](_0x3d1797[_0x2203('0x14')][_0x52f25e[_0x74843][_0x2203('0x22')]],_0x52f25e[_0x74843]);}return _0x3d1797[_0x2203('0x14')];};};Realtime['prototype'][_0x2203('0x68')]=function(){var _0x51a2fe=this;return function(_0x5d0176){if(_0x5d0176){freeIsNotKey(_0x5d0176,_0x51a2fe[_0x2203('0x1e')],'id');for(var _0x5cd030=0x0,_0xb9588e={};_0x5cd030<_0x5d0176[_0x2203('0x3a')];_0x5cd030+=0x1){_0xb9588e=_0x5d0176[_0x5cd030];if(_['isUndefined'](_0x51a2fe[_0x2203('0x1e')][_0xb9588e['id']])){_0x51a2fe[_0x2203('0x1e')][_0xb9588e['id']]=new FaxAccount(_0xb9588e);}else{_0x51a2fe[_0x2203('0x40')](_0x51a2fe[_0x2203('0x1e')][_0xb9588e['id']],_0xb9588e);}}}return _0x51a2fe[_0x2203('0x1e')];};};Realtime[_0x2203('0x39')]['initVoiceQueues']=function(){var _0x215638=this;return function(_0x3541b3){if(_0x3541b3){freeIsNotKey(_0x3541b3,_0x215638['voiceQueues'],'name');for(var _0x377176=0x0,_0x3fe71b={};_0x377176<_0x3541b3[_0x2203('0x3a')];_0x377176+=0x1){_0x3fe71b=_0x3541b3[_0x377176];if(_[_0x2203('0x3c')](_0x215638[_0x2203('0x13')][_0x3fe71b[_0x2203('0x22')]])){_0x215638[_0x2203('0x13')][_0x3fe71b[_0x2203('0x22')]]=new VoiceQueue(_0x3fe71b);}else{_0x215638[_0x2203('0x40')](_0x215638[_0x2203('0x13')][_0x3fe71b[_0x2203('0x22')]],_0x3fe71b);}}}return _0x215638[_0x2203('0x13')];};};module[_0x2203('0x69')]=Realtime; \ No newline at end of file +var _0x757a=['queuecallerabandonAt','queuecallerexitAt','total','queuecallercomplete','initVoiceCallReports','outbound','duration','disposition','billableseconds','dialQueueProject','SquareProject','initVoiceExtensions','voiceExtensions','initCampaignHopperHistory','merge','initFaxAccounts','initVoiceQueues','exports','moment','util','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','agents','telephones','trunks','voiceQueues','triggers','campaigns','templates','timers','salesforceAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','format','SIP/%s','isNil','interface','name','hasOwnProperty','answered','sumDuration','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','sumHoldTime','sumBillable','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayCallersExit','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','length','isUndefined','initTelephones','initTriggers','initZendeskAccounts','zendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','freshdeskAccounts','initZohoAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','abandoned','diff','queuecallerjoinAt','seconds','queuecallercompleteAt'];(function(_0x432b8f,_0x37b790){var _0x17c29f=function(_0x98b49d){while(--_0x98b49d){_0x432b8f['push'](_0x432b8f['shift']());}};_0x17c29f(++_0x37b790);}(_0x757a,0xde));var _0xa757=function(_0x36ccbb,_0x11fa45){_0x36ccbb=_0x36ccbb-0x0;var _0x498fd3=_0x757a[_0x36ccbb];return _0x498fd3;};'use strict';var _=require('lodash');var moment=require(_0xa757('0x0'));var util=require(_0xa757('0x1'));var Agent=require('../model/agent');var Telephone=require('../model/telephone');var Trunk=require('../model/trunk');var VoiceQueue=require(_0xa757('0x2'));var Trigger=require(_0xa757('0x3'));var Template=require(_0xa757('0x4'));var Campaign=require(_0xa757('0x5'));var VoiceExtension=require(_0xa757('0x6'));var ZendeskAccount=require(_0xa757('0x7'));var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0xa757('0x8'));var SugarcrmAccount=require(_0xa757('0x9'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0xa757('0xa'));var VtigerAccount=require(_0xa757('0xb'));var ServicenowAccount=require(_0xa757('0xc'));var Dynamics365Account=require(_0xa757('0xd'));var FreshsalesAccount=require(_0xa757('0xe'));var FaxAccount=require('../model/faxAccount');function Realtime(){this[_0xa757('0xf')]={};this[_0xa757('0x10')]={};this[_0xa757('0x11')]={};this[_0xa757('0x12')]={};this[_0xa757('0x13')]={};this[_0xa757('0x14')]={};this[_0xa757('0x15')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this['channels']={};this['queueChannels']={};this['outboundChannels']={};this[_0xa757('0x16')]={};this['settings']={};this['zendeskAccounts']={};this[_0xa757('0x17')]={};this['sugarcrmAccounts']={};this['freshdeskAccounts']={};this[_0xa757('0x18')]={};this[_0xa757('0x19')]={};this[_0xa757('0x1a')]={};this[_0xa757('0x1b')]={};this[_0xa757('0x1c')]={};this[_0xa757('0x1d')]={};this[_0xa757('0x1e')]={};}function freeIsNotKey(_0x2f7947,_0x185011,_0x3df1f9){var _0x50aac1=_[_0xa757('0x1f')](_0x2f7947,function(_0x44eab8){return _0x44eab8[_0x3df1f9];});for(var _0xde8248 in _0x185011){if(_0x185011['hasOwnProperty'](_0xde8248)){if(!_0x50aac1[_0xde8248]){delete _0x185011[_0xde8248];}}}}function freeIsNotKeySip(_0x54b305,_0x151c04){var _0x468d45=_[_0xa757('0x1f')](_0x54b305,function(_0x340599){return util[_0xa757('0x20')](_0xa757('0x21'),_0x340599['name']);});for(var _0x58954 in _0x151c04){if(_0x151c04['hasOwnProperty'](_0x58954)){if(!_0x468d45[_0x58954]){delete _0x151c04[_0x58954];}}}}function freeIsNotKeyAgent(_0x32c2a1,_0x167640){var _0x14014c=_[_0xa757('0x1f')](_0x32c2a1,function(_0x4d598c){var _0x5638c7=_[_0xa757('0x22')](_0x4d598c[_0xa757('0x23')])?util[_0xa757('0x20')](_0xa757('0x21'),_0x4d598c[_0xa757('0x24')]):_0x4d598c[_0xa757('0x23')];return _0x5638c7;});for(var _0x2ca10d in _0x167640){if(_0x167640[_0xa757('0x25')](_0x2ca10d)){if(!_0x14014c[_0x2ca10d]){delete _0x167640[_0x2ca10d];}}}}function clearVoiceCallReports(_0x2bf276){_0x2bf276['total']=0x0;_0x2bf276[_0xa757('0x26')]=0x0;_0x2bf276['sumHoldTime']=0x0;_0x2bf276[_0xa757('0x27')]=0x0;_0x2bf276['sumBillable']=0x0;}function clearCampaigns(_0x40551d){if(!_[_0xa757('0x28')](_0x40551d)){for(var _0x37c7e6 in _0x40551d){if(_0x40551d['hasOwnProperty'](_0x37c7e6)){_0x40551d[_0x37c7e6][_0xa757('0x29')]=0x0;_0x40551d[_0x37c7e6][_0xa757('0x2a')]=0x0;}}}}function clearVoiceQueues(_0x471e84){if(!_[_0xa757('0x28')](_0x471e84)){for(var _0x5b4779 in _0x471e84){if(_0x471e84[_0xa757('0x25')](_0x5b4779)){_0x471e84[_0x5b4779]['total']=0x0;_0x471e84[_0x5b4779]['answered']=0x0;_0x471e84[_0x5b4779]['unmanaged']=0x0;_0x471e84[_0x5b4779]['abandoned']=0x0;_0x471e84[_0x5b4779][_0xa757('0x2b')]=0x0;_0x471e84[_0x5b4779]['sumDuration']=0x0;_0x471e84[_0x5b4779][_0xa757('0x2c')]=0x0;_0x471e84[_0x5b4779][_0xa757('0x2d')]=0x0;_0x471e84[_0x5b4779]['outboundNoAnswerCallsDay']=0x0;_0x471e84[_0x5b4779][_0xa757('0x2e')]=0x0;_0x471e84[_0x5b4779]['outboundCongestionCallsDay']=0x0;_0x471e84[_0x5b4779][_0xa757('0x2f')]=0x0;_0x471e84[_0x5b4779][_0xa757('0x30')]=0x0;_0x471e84[_0x5b4779]['outboundDropCallsDayTimeout']=0x0;_0x471e84[_0x5b4779][_0xa757('0x31')]=0x0;_0x471e84[_0x5b4779]['outboundBlacklistCallsDay']=0x0;_0x471e84[_0x5b4779][_0xa757('0x32')]=0x0;_0x471e84[_0x5b4779][_0xa757('0x33')]=0x0;_0x471e84[_0x5b4779][_0xa757('0x34')]=0x0;_0x471e84[_0x5b4779][_0xa757('0x2d')]=0x0;_0x471e84[_0x5b4779][_0xa757('0x35')]=0x0;_0x471e84[_0x5b4779][_0xa757('0x36')]=!![];}}}}Realtime[_0xa757('0x37')][_0xa757('0x38')]=function(_0x112282,_0x384424){for(var _0x1f5d5a in _0x384424){if(_0x112282[_0xa757('0x25')](_0x1f5d5a)){_0x112282[_0x1f5d5a]=_0x384424[_0x1f5d5a];}}};Realtime[_0xa757('0x37')][_0xa757('0x39')]=function(){var _0x27be88=this;return function(_0xc1cc20){if(_0xc1cc20){freeIsNotKeyAgent(_0xc1cc20,_0x27be88[_0xa757('0xf')]);for(var _0x1ad384=0x0,_0x1eacde={};_0x1ad384<_0xc1cc20[_0xa757('0x3a')];_0x1ad384+=0x1){_0x1eacde=_0xc1cc20[_0x1ad384];var _0x3de18f=_[_0xa757('0x22')](_0x1eacde[_0xa757('0x23')])?util[_0xa757('0x20')]('SIP/%s',_0x1eacde[_0xa757('0x24')]):_0x1eacde[_0xa757('0x23')];if(_[_0xa757('0x3b')](_0x27be88[_0xa757('0xf')][_0x3de18f])){_0x27be88[_0xa757('0xf')][_0x3de18f]=new Agent(_0x1eacde);}else{_0x27be88['mergeFromDatabase'](_0x27be88[_0xa757('0xf')][_0x3de18f],_0x1eacde);}}}return _0x27be88[_0xa757('0xf')];};};Realtime[_0xa757('0x37')][_0xa757('0x3c')]=function(){var _0xd54446=this;return function(_0xc97cb8){if(_0xc97cb8){freeIsNotKeySip(_0xc97cb8,_0xd54446['telephones']);for(var _0x1346c2=0x0,_0x444639={};_0x1346c2<_0xc97cb8[_0xa757('0x3a')];_0x1346c2+=0x1){_0x444639=_0xc97cb8[_0x1346c2];if(_[_0xa757('0x3b')](_0xd54446[_0xa757('0x10')][util[_0xa757('0x20')](_0xa757('0x21'),_0x444639[_0xa757('0x24')])])){_0xd54446[_0xa757('0x10')][util['format'](_0xa757('0x21'),_0x444639[_0xa757('0x24')])]=new Telephone(_0x444639);}else{_0xd54446[_0xa757('0x38')](_0xd54446[_0xa757('0x10')][util[_0xa757('0x20')](_0xa757('0x21'),_0x444639['name'])],_0x444639);}}}return _0xd54446[_0xa757('0x10')];};};Realtime[_0xa757('0x37')]['initTrunks']=function(){var _0x5eae0b=this;return function(_0x9607af){if(_0x9607af){freeIsNotKeySip(_0x9607af,_0x5eae0b[_0xa757('0x11')]);for(var _0x5b11fe=0x0,_0x51c3d1={};_0x5b11fe<_0x9607af[_0xa757('0x3a')];_0x5b11fe+=0x1){_0x51c3d1=_0x9607af[_0x5b11fe];if(_[_0xa757('0x3b')](_0x5eae0b[_0xa757('0x11')][util['format'](_0xa757('0x21'),_0x51c3d1[_0xa757('0x24')])])){_0x5eae0b[_0xa757('0x11')][util[_0xa757('0x20')](_0xa757('0x21'),_0x51c3d1['name'])]=new Trunk(_0x51c3d1);}else{_0x5eae0b[_0xa757('0x38')](_0x5eae0b['trunks'][util['format'](_0xa757('0x21'),_0x51c3d1[_0xa757('0x24')])],_0x51c3d1);}}}return _0x5eae0b[_0xa757('0x11')];};};Realtime[_0xa757('0x37')][_0xa757('0x3d')]=function(){var _0x5d347c=this;return function(_0x5d25bb){if(_0x5d25bb){freeIsNotKey(_0x5d25bb,_0x5d347c[_0xa757('0x13')],'id');for(var _0x129d77=0x0,_0x2b171c={};_0x129d77<_0x5d25bb[_0xa757('0x3a')];_0x129d77+=0x1){_0x2b171c=_0x5d25bb[_0x129d77];if(_[_0xa757('0x3b')](_0x5d347c[_0xa757('0x13')][_0x2b171c['id']])){_0x5d347c['triggers'][_0x2b171c['id']]=new Trigger(_0x2b171c);}else{_0x5d347c[_0xa757('0x38')](_0x5d347c[_0xa757('0x13')][_0x2b171c['id']],_0x2b171c);}}}return _0x5d347c['triggers'];};};Realtime[_0xa757('0x37')]['initTemplates']=function(){var _0x2d111e=this;return function(_0x4518dc){if(_0x4518dc){freeIsNotKey(_0x4518dc,_0x2d111e['templates'],'id');for(var _0x267d68=0x0,_0x23efad={};_0x267d68<_0x4518dc['length'];_0x267d68+=0x1){_0x23efad=_0x4518dc[_0x267d68];if(_[_0xa757('0x3b')](_0x2d111e[_0xa757('0x15')][_0x23efad['id']])){_0x2d111e[_0xa757('0x15')][_0x23efad['id']]=new Template(_0x23efad);}else{_0x2d111e[_0xa757('0x38')](_0x2d111e['templates'][_0x23efad['id']],_0x23efad);}}}return _0x2d111e[_0xa757('0x15')];};};Realtime[_0xa757('0x37')][_0xa757('0x3e')]=function(){var _0xec4610=this;return function(_0x4d7493){if(_0x4d7493){freeIsNotKey(_0x4d7493,_0xec4610[_0xa757('0x3f')],'id');for(var _0x5b6017=0x0,_0x50c131={};_0x5b6017<_0x4d7493[_0xa757('0x3a')];_0x5b6017+=0x1){_0x50c131=_0x4d7493[_0x5b6017];if(_[_0xa757('0x3b')](_0xec4610[_0xa757('0x3f')][_0x50c131['id']])){_0xec4610['zendeskAccounts'][_0x50c131['id']]=new ZendeskAccount(_0x50c131);}else{_0xec4610[_0xa757('0x38')](_0xec4610['zendeskAccounts'][_0x50c131['id']],_0x50c131);}}}return _0xec4610[_0xa757('0x3f')];};};Realtime[_0xa757('0x37')][_0xa757('0x40')]=function(){var _0xbef575=this;return function(_0x18b0ca){if(_0x18b0ca){freeIsNotKey(_0x18b0ca,_0xbef575[_0xa757('0x17')],'id');for(var _0x57bf73=0x0,_0x505cd={};_0x57bf73<_0x18b0ca['length'];_0x57bf73+=0x1){_0x505cd=_0x18b0ca[_0x57bf73];if(_[_0xa757('0x3b')](_0xbef575[_0xa757('0x17')][_0x505cd['id']])){_0xbef575[_0xa757('0x17')][_0x505cd['id']]=new SalesforceAccount(_0x505cd);}else{_0xbef575[_0xa757('0x38')](_0xbef575[_0xa757('0x17')][_0x505cd['id']],_0x505cd);}}}return _0xbef575[_0xa757('0x17')];};};Realtime[_0xa757('0x37')][_0xa757('0x41')]=function(){var _0x405397=this;return function(_0x1d05d7){if(_0x1d05d7){freeIsNotKey(_0x1d05d7,_0x405397[_0xa757('0x42')],'id');for(var _0x19ceef=0x0,_0x2367c7={};_0x19ceef<_0x1d05d7[_0xa757('0x3a')];_0x19ceef+=0x1){_0x2367c7=_0x1d05d7[_0x19ceef];if(_[_0xa757('0x3b')](_0x405397[_0xa757('0x42')][_0x2367c7['id']])){_0x405397['freshdeskAccounts'][_0x2367c7['id']]=new FreshdeskAccount(_0x2367c7);}else{_0x405397[_0xa757('0x38')](_0x405397['freshdeskAccounts'][_0x2367c7['id']],_0x2367c7);}}}return _0x405397[_0xa757('0x42')];};};Realtime[_0xa757('0x37')][_0xa757('0x43')]=function(){var _0x24c0ad=this;return function(_0x4cb461){if(_0x4cb461){freeIsNotKey(_0x4cb461,_0x24c0ad[_0xa757('0x18')],'id');for(var _0x1ee01e=0x0,_0x8614f9={};_0x1ee01e<_0x4cb461[_0xa757('0x3a')];_0x1ee01e+=0x1){_0x8614f9=_0x4cb461[_0x1ee01e];if(_['isUndefined'](_0x24c0ad[_0xa757('0x18')][_0x8614f9['id']])){_0x24c0ad[_0xa757('0x18')][_0x8614f9['id']]=new ZohoAccount(_0x8614f9);}else{_0x24c0ad[_0xa757('0x38')](_0x24c0ad[_0xa757('0x18')][_0x8614f9['id']],_0x8614f9);}}}return _0x24c0ad[_0xa757('0x18')];};};Realtime[_0xa757('0x37')]['initDeskAccounts']=function(){var _0x485100=this;return function(_0x5d21c1){if(_0x5d21c1){freeIsNotKey(_0x5d21c1,_0x485100['deskAccounts'],'id');for(var _0x1d8742=0x0,_0x9b3779={};_0x1d8742<_0x5d21c1[_0xa757('0x3a')];_0x1d8742+=0x1){_0x9b3779=_0x5d21c1[_0x1d8742];if(_[_0xa757('0x3b')](_0x485100[_0xa757('0x19')][_0x9b3779['id']])){_0x485100[_0xa757('0x19')][_0x9b3779['id']]=new DeskAccount(_0x9b3779);}else{_0x485100['mergeFromDatabase'](_0x485100[_0xa757('0x19')][_0x9b3779['id']],_0x9b3779);}}}return _0x485100[_0xa757('0x19')];};};Realtime[_0xa757('0x37')][_0xa757('0x44')]=function(){var _0x48b578=this;return function(_0x26c74e){if(_0x26c74e){freeIsNotKey(_0x26c74e,_0x48b578[_0xa757('0x45')],'id');for(var _0x4af840=0x0,_0x39699d={};_0x4af840<_0x26c74e['length'];_0x4af840+=0x1){_0x39699d=_0x26c74e[_0x4af840];if(_[_0xa757('0x3b')](_0x48b578['sugarcrmAccounts'][_0x39699d['id']])){_0x48b578[_0xa757('0x45')][_0x39699d['id']]=new SugarcrmAccount(_0x39699d);}else{_0x48b578['mergeFromDatabase'](_0x48b578['sugarcrmAccounts'][_0x39699d['id']],_0x39699d);}}}return _0x48b578[_0xa757('0x45')];};};Realtime[_0xa757('0x37')][_0xa757('0x46')]=function(){var _0x1b5db5=this;return function(_0x14e226){if(_0x14e226){freeIsNotKey(_0x14e226,_0x1b5db5[_0xa757('0x1a')],'id');for(var _0x4c19a6=0x0,_0x4f0d7b={};_0x4c19a6<_0x14e226[_0xa757('0x3a')];_0x4c19a6+=0x1){_0x4f0d7b=_0x14e226[_0x4c19a6];if(_[_0xa757('0x3b')](_0x1b5db5[_0xa757('0x1a')][_0x4f0d7b['id']])){_0x1b5db5['vtigerAccounts'][_0x4f0d7b['id']]=new VtigerAccount(_0x4f0d7b);}else{_0x1b5db5['mergeFromDatabase'](_0x1b5db5[_0xa757('0x1a')][_0x4f0d7b['id']],_0x4f0d7b);}}}return _0x1b5db5[_0xa757('0x1a')];};};Realtime[_0xa757('0x37')][_0xa757('0x47')]=function(){var _0x12b802=this;return function(_0x3e6d40){if(_0x3e6d40){freeIsNotKey(_0x3e6d40,_0x12b802['servicenowAccounts'],'id');for(var _0x466728=0x0,_0x45f2a4={};_0x466728<_0x3e6d40[_0xa757('0x3a')];_0x466728+=0x1){_0x45f2a4=_0x3e6d40[_0x466728];if(_[_0xa757('0x3b')](_0x12b802[_0xa757('0x1b')][_0x45f2a4['id']])){_0x12b802[_0xa757('0x1b')][_0x45f2a4['id']]=new ServicenowAccount(_0x45f2a4);}else{_0x12b802[_0xa757('0x38')](_0x12b802[_0xa757('0x1b')][_0x45f2a4['id']],_0x45f2a4);}}}return _0x12b802[_0xa757('0x1b')];};};Realtime[_0xa757('0x37')]['initDynamics365Accounts']=function(){var _0x9e96e6=this;return function(_0x5c803a){if(_0x5c803a){freeIsNotKey(_0x5c803a,_0x9e96e6['dynamics365Accounts'],'id');for(var _0x40ce42=0x0,_0x3da8c1={};_0x40ce42<_0x5c803a[_0xa757('0x3a')];_0x40ce42+=0x1){_0x3da8c1=_0x5c803a[_0x40ce42];if(_[_0xa757('0x3b')](_0x9e96e6[_0xa757('0x1c')][_0x3da8c1['id']])){_0x9e96e6[_0xa757('0x1c')][_0x3da8c1['id']]=new Dynamics365Account(_0x3da8c1);}else{_0x9e96e6[_0xa757('0x38')](_0x9e96e6[_0xa757('0x1c')][_0x3da8c1['id']],_0x3da8c1);}}}return _0x9e96e6[_0xa757('0x1c')];};};Realtime[_0xa757('0x37')][_0xa757('0x48')]=function(){var _0x4fc507=this;return function(_0x3f8c5c){if(_0x3f8c5c){freeIsNotKey(_0x3f8c5c,_0x4fc507[_0xa757('0x1d')],'id');for(var _0x5f0b71=0x0,_0x11ebb3={};_0x5f0b71<_0x3f8c5c[_0xa757('0x3a')];_0x5f0b71+=0x1){_0x11ebb3=_0x3f8c5c[_0x5f0b71];if(_[_0xa757('0x3b')](_0x4fc507[_0xa757('0x1d')][_0x11ebb3['id']])){_0x4fc507[_0xa757('0x1d')][_0x11ebb3['id']]=new FreshsalesAccount(_0x11ebb3);}else{_0x4fc507[_0xa757('0x38')](_0x4fc507['freshsalesAccounts'][_0x11ebb3['id']],_0x11ebb3);}}}return _0x4fc507[_0xa757('0x1d')];};};Realtime['prototype'][_0xa757('0x49')]=function(){var _0x3250d0=this;return function(_0x2d9d97){for(var _0x3c87c0=0x0;_0x3c87c0<_0x2d9d97[_0xa757('0x3a')];_0x3c87c0+=0x1){_['merge'](_0x3250d0['voiceQueues'][_0x2d9d97[_0x3c87c0][_0xa757('0x24')]],_0x2d9d97[_0x3c87c0]);}return _0x3250d0[_0xa757('0x12')];};};Realtime[_0xa757('0x37')]['initVoiceQueueReports']=function(){var _0x115a94=this;return function(_0x55bc0f){clearVoiceQueues(_0x115a94[_0xa757('0x12')]);if(_0x55bc0f){_0x55bc0f=_[_0xa757('0x4a')](_0x55bc0f,_0xa757('0x4b'));for(var _0xbf1bbf in _0x55bc0f){if(_0x55bc0f[_0xa757('0x25')](_0xbf1bbf)){for(var _0x40a79b=0x0;_0x40a79b<_0x55bc0f[_0xbf1bbf]['length'];_0x40a79b+=0x1){var _0xa28144=_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x4c')];if(_0x115a94[_0xa757('0x12')][_0xa28144]){if(_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x4d')]){_0x115a94[_0xa757('0x12')][_0xa28144]['unmanaged']+=0x1;}if(_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x4e')]){_0x115a94[_0xa757('0x12')][_0xa28144][_0xa757('0x4f')]+=0x1;}_0x115a94[_0xa757('0x12')][_0xa28144][_0xa757('0x2b')]+=moment(_0x55bc0f[_0xbf1bbf][_0x40a79b]['queuecallerleaveAt'])[_0xa757('0x50')](moment(_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x51')]),_0xa757('0x52'))||0x0;if(_0x40a79b===_0x55bc0f[_0xbf1bbf]['length']-0x1){_0x115a94[_0xa757('0x12')][_0xa28144][_0xa757('0x27')]+=moment(_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x53')]||_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x54')]||_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x55')])[_0xa757('0x50')](moment(_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x51')]),_0xa757('0x52'))||0x0;_0x115a94[_0xa757('0x12')][_0xa28144][_0xa757('0x56')]+=0x1;if(_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x57')]){_0x115a94[_0xa757('0x12')][_0xa28144][_0xa757('0x26')]+=0x1;_0x115a94[_0xa757('0x12')][_0xa28144]['sumBillable']+=moment(_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x53')])[_0xa757('0x50')](moment(_0x55bc0f[_0xbf1bbf][_0x40a79b]['queuecallerleaveAt']),_0xa757('0x52'))||0x0;}}else{_0x115a94[_0xa757('0x12')][_0xa28144]['sumDuration']+=_0x115a94[_0xa757('0x12')][_0xa28144][_0xa757('0x2b')]||0x0;}}}}}}return _0x115a94[_0xa757('0x12')];};};Realtime[_0xa757('0x37')][_0xa757('0x58')]=function(){var _0x312542=this;return function(_0xdb2ac6){clearVoiceCallReports(_0x312542[_0xa757('0x59')]);if(_0xdb2ac6){for(var _0x1f74af=0x0;_0x1f74af<_0xdb2ac6[_0xa757('0x3a')];_0x1f74af+=0x1){_0x312542[_0xa757('0x59')][_0xa757('0x56')]+=0x1;_0x312542[_0xa757('0x59')][_0xa757('0x27')]+=_0xdb2ac6[_0x1f74af][_0xa757('0x5a')];if(_0xdb2ac6[_0x1f74af][_0xa757('0x5b')]==='ANSWERED'){_0x312542[_0xa757('0x59')]['answered']+=0x1;_0x312542[_0xa757('0x59')][_0xa757('0x2b')]+=_0xdb2ac6[_0x1f74af][_0xa757('0x5a')]-_0xdb2ac6[_0x1f74af][_0xa757('0x5c')]||0x0;_0x312542[_0xa757('0x59')]['sumBillable']+=_0xdb2ac6[_0x1f74af][_0xa757('0x5c')];}}}return _0x312542[_0xa757('0x59')];};};Realtime[_0xa757('0x37')]['initCampaigns']=function(){var _0x3317d8=this;return function(_0x3619ec){if(_0x3619ec){freeIsNotKey(_0x3619ec,_0x3317d8[_0xa757('0x14')],'name');for(var _0x501134=0x0,_0x1f437d={};_0x501134<_0x3619ec[_0xa757('0x3a')];_0x501134+=0x1){_0x1f437d=_0x3619ec[_0x501134];if(_[_0xa757('0x3b')](_0x3317d8['campaigns'][_0x1f437d[_0xa757('0x24')]])){_0x3317d8['campaigns'][_0x1f437d['name']]=new Campaign(_0x1f437d);}else{_0x3317d8[_0xa757('0x38')](_0x3317d8[_0xa757('0x14')][_0x1f437d[_0xa757('0x24')]],_0x1f437d);_0x3317d8['campaigns'][_0x1f437d[_0xa757('0x24')]][_0xa757('0x5d')]=_0x1f437d[_0xa757('0x5e')]?_0x1f437d[_0xa757('0x5e')][_0xa757('0x24')]:undefined;}}}return _0x3317d8[_0xa757('0x14')];};};Realtime[_0xa757('0x37')][_0xa757('0x5f')]=function(){var _0xe38e76=this;return function(_0x35c1aa){if(_0x35c1aa){freeIsNotKey(_0x35c1aa,_0xe38e76[_0xa757('0x60')],'id');for(var _0xafcf19=0x0,_0x5a7042={};_0xafcf19<_0x35c1aa[_0xa757('0x3a')];_0xafcf19+=0x1){_0x5a7042=_0x35c1aa[_0xafcf19];if(_[_0xa757('0x3b')](_0xe38e76[_0xa757('0x60')][_0x5a7042['id']])){_0xe38e76[_0xa757('0x60')][_0x5a7042['id']]=new VoiceExtension(_0x5a7042);}else{_0xe38e76[_0xa757('0x38')](_0xe38e76[_0xa757('0x60')][_0x5a7042['id']],_0x5a7042);}}}return _0xe38e76[_0xa757('0x60')];};};Realtime[_0xa757('0x37')][_0xa757('0x61')]=function(){var _0x2d34b7=this;return function(_0x3997f8){clearCampaigns(_0x2d34b7[_0xa757('0x14')]);for(var _0x132033=0x0;_0x132033<_0x3997f8[_0xa757('0x3a')];_0x132033+=0x1){_[_0xa757('0x62')](_0x2d34b7[_0xa757('0x14')][_0x3997f8[_0x132033][_0xa757('0x24')]],_0x3997f8[_0x132033]);}return _0x2d34b7[_0xa757('0x14')];};};Realtime[_0xa757('0x37')][_0xa757('0x63')]=function(){var _0x1bcb2e=this;return function(_0x20ea21){if(_0x20ea21){freeIsNotKey(_0x20ea21,_0x1bcb2e['faxAccounts'],'id');for(var _0x768a79=0x0,_0x39c52a={};_0x768a79<_0x20ea21['length'];_0x768a79+=0x1){_0x39c52a=_0x20ea21[_0x768a79];if(_[_0xa757('0x3b')](_0x1bcb2e['faxAccounts'][_0x39c52a['id']])){_0x1bcb2e[_0xa757('0x1e')][_0x39c52a['id']]=new FaxAccount(_0x39c52a);}else{_0x1bcb2e[_0xa757('0x38')](_0x1bcb2e['faxAccounts'][_0x39c52a['id']],_0x39c52a);}}}return _0x1bcb2e[_0xa757('0x1e')];};};Realtime[_0xa757('0x37')][_0xa757('0x64')]=function(){var _0x7ba6b3=this;return function(_0x535ff7){if(_0x535ff7){freeIsNotKey(_0x535ff7,_0x7ba6b3[_0xa757('0x12')],_0xa757('0x24'));for(var _0x4bf5c2=0x0,_0x30716a={};_0x4bf5c2<_0x535ff7[_0xa757('0x3a')];_0x4bf5c2+=0x1){_0x30716a=_0x535ff7[_0x4bf5c2];if(_['isUndefined'](_0x7ba6b3[_0xa757('0x12')][_0x30716a[_0xa757('0x24')]])){_0x7ba6b3[_0xa757('0x12')][_0x30716a[_0xa757('0x24')]]=new VoiceQueue(_0x30716a);}else{_0x7ba6b3[_0xa757('0x38')](_0x7ba6b3[_0xa757('0x12')][_0x30716a[_0xa757('0x24')]],_0x30716a);}}}return _0x7ba6b3[_0xa757('0x12')];};};module[_0xa757('0x65')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/realtime/utils.js b/server/services/ami/realtime/utils.js index 0c84067..b46aca9 100644 --- a/server/services/ami/realtime/utils.js +++ b/server/services/ami/realtime/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc2bd=['assign','hasOwnProperty','mergeDBDataToRealtime'];(function(_0x4005e8,_0x52a3b5){var _0x2d2903=function(_0x21bac7){while(--_0x21bac7){_0x4005e8['push'](_0x4005e8['shift']());}};_0x2d2903(++_0x52a3b5);}(_0xc2bd,0x1ad));var _0xdc2b=function(_0x2b49c7,_0xccca2a){_0x2b49c7=_0x2b49c7-0x0;var _0x2ecef8=_0xc2bd[_0x2b49c7];return _0x2ecef8;};'use strict';function mergeDBDataToRealtime(_0x16f5d9,_0x162531){var _0x55c802=Object[_0xdc2b('0x0')]({},_0x16f5d9);for(var _0x136e52 in _0x162531){if(_0x55c802[_0xdc2b('0x1')](_0x136e52)){_0x55c802[_0x136e52]=_0x162531[_0x136e52];}}return _0x55c802;}exports[_0xdc2b('0x2')]=mergeDBDataToRealtime; \ No newline at end of file +var _0xe8cb=['assign','hasOwnProperty'];(function(_0x249135,_0x46b414){var _0x278e12=function(_0x38e4d3){while(--_0x38e4d3){_0x249135['push'](_0x249135['shift']());}};_0x278e12(++_0x46b414);}(_0xe8cb,0x1ae));var _0xbe8c=function(_0x131f50,_0x2b9bca){_0x131f50=_0x131f50-0x0;var _0x24ccf5=_0xe8cb[_0x131f50];return _0x24ccf5;};'use strict';function mergeDBDataToRealtime(_0x41664a,_0x1cc8ef){var _0x2da775=Object[_0xbe8c('0x0')]({},_0x41664a);for(var _0x3c8210 in _0x1cc8ef){if(_0x2da775[_0xbe8c('0x1')](_0x3c8210)){_0x2da775[_0x3c8210]=_0x1cc8ef[_0x3c8210];}}return _0x2da775;}exports['mergeDBDataToRealtime']=mergeDBDataToRealtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 5cb0d92..b6502c5 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 _0x6aac=['substring','indexOf','phone','lastIndexOf','transfererlinkedid','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','sync','xdr','disabled','custom:voiceCallReport','voiceCallReport','bind','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedTransfer','findAgent','accountcode','name','find','interface','prototype','voiceQueueReport','length','connectedlinenum','assigned','lastAssignedTo','isNil','format','SIP/%s','queuecallercomplete','queuecallercompleteAt','queuecallerexitAt','YYYY-MM-DD\x20HH:mm:ss','create','match','getAgentByInternal','keys','channel','outbound','internal','destination','dialer','lastapplication','queue','context','from-voip-provider','callerid','from-sip','calleridnum','originatecalleridnum','destinationchannel','calleridpreview','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','type','getCallType','UserId','split','membername','monitor','monitorFilename','monitors','filename','createdAt','connectedlinename','exten','xcally-motion-dialer','forEach','startsWith'];(function(_0x229446,_0x323f71){var _0x5b6250=function(_0x22608c){while(--_0x22608c){_0x229446['push'](_0x229446['shift']());}};_0x5b6250(++_0x323f71);}(_0x6aac,0x1d1));var _0xc6aa=function(_0x5f598b,_0x556a1b){_0x5f598b=_0x5f598b-0x0;var _0x47efae=_0x6aac[_0x5f598b];return _0x47efae;};'use strict';var _=require(_0xc6aa('0x0'));var moment=require(_0xc6aa('0x1'));var util=require(_0xc6aa('0x2'));var config=require(_0xc6aa('0x3'));var ami=require(_0xc6aa('0x4'));var RpcVoiceAgentReport=require(_0xc6aa('0x5'));var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0xc6aa('0x6'));var RpcVoiceQueueReport=require(_0xc6aa('0x7'));var RpcVoiceRecording=require(_0xc6aa('0x8'));var RpcVoiceTransferReport=require(_0xc6aa('0x9'));var VoiceQueueReport=require(_0xc6aa('0xa'));var VoiceCallReport=require(_0xc6aa('0xb'));var VoiceAgentReport=require(_0xc6aa('0xc'));var VoiceDialReport=require(_0xc6aa('0xd'));var UserReport=require(_0xc6aa('0xe'));function Report(_0x1277f5){this[_0xc6aa('0xf')]=_0x1277f5;this[_0xc6aa('0x10')]=_0x1277f5['agents'];this['telephones']=_0x1277f5['telephones'];}Report['prototype'][_0xc6aa('0x11')]=function(_0x29d411){var _0xc5b35c=new VoiceQueueReport(this[_0xc6aa('0xf')]);var _0x357ce6=new VoiceAgentReport(this[_0xc6aa('0xf')]);var _0x193f94=new VoiceDialReport(this[_0xc6aa('0xf')]);var _0x1377be=new VoiceCallReport(this[_0xc6aa('0xf')]);var _0x19f1a4=new UserReport(this[_0xc6aa('0xf')]);if(config[_0xc6aa('0x12')]&&config[_0xc6aa('0x12')][_0xc6aa('0x13')]){ami['on']('custom:voiceQueueReport',this['voiceQueueReport']['bind'](this));ami['on'](_0xc6aa('0x14'),this[_0xc6aa('0x15')][_0xc6aa('0x16')](this));ami['on'](_0xc6aa('0x17'),this[_0xc6aa('0x18')]['bind'](this));ami['on'](_0xc6aa('0x19'),this[_0xc6aa('0x1a')][_0xc6aa('0x16')](this));ami['on'](_0xc6aa('0x1b'),this[_0xc6aa('0x1c')][_0xc6aa('0x16')](this));ami['on']('attendedtransfer',this[_0xc6aa('0x1d')]['bind'](this));}};Report['prototype'][_0xc6aa('0x1e')]=function(_0x1c9bcf){var _0x228833;_0x228833=_['find'](this[_0xc6aa('0x10')],function(_0x299e9e){return _0x299e9e[_0xc6aa('0x1f')]==_0x1c9bcf||_0x299e9e[_0xc6aa('0x20')]==_0x1c9bcf;});if(_['isNil'](_0x228833)){var _0x5b57a3=_[_0xc6aa('0x21')](this['telephones'],function(_0x5006ca){return _0x5006ca[_0xc6aa('0x1f')]==_0x1c9bcf||_0x5006ca[_0xc6aa('0x20')]==_0x1c9bcf;});if(_0x5b57a3){_0x228833=_[_0xc6aa('0x21')](this[_0xc6aa('0x10')],function(_0x3b8f7b){return _0x3b8f7b[_0xc6aa('0x22')]==util['format']('SIP/%s',_0x5b57a3[_0xc6aa('0x20')]);});}}return _0x228833;};Report[_0xc6aa('0x23')][_0xc6aa('0x24')]=function(_0x34ceb0){for(var _0x5adabb=0x0;_0x5adabb<_0x34ceb0[_0xc6aa('0x25')];_0x5adabb+=0x1){var _0x407360=this[_0xc6aa('0x1e')](_0x34ceb0[_0x5adabb][_0xc6aa('0x26')]);if(_0x407360){_0x34ceb0[_0x5adabb]['accountcode']=_0x407360[_0xc6aa('0x1f')];_0x34ceb0[_0x5adabb][_0xc6aa('0x27')]=!![];_0x34ceb0[_0x5adabb][_0xc6aa('0x28')]=_0x407360[_0xc6aa('0x20')];_0x34ceb0[_0x5adabb][_0xc6aa('0x22')]=_[_0xc6aa('0x29')](_0x407360['interface'])?util[_0xc6aa('0x2a')](_0xc6aa('0x2b'),_0x407360['name']):_0x407360[_0xc6aa('0x22')];if(_0x34ceb0[_0x5adabb][_0xc6aa('0x2c')]){_0x34ceb0[_0x5adabb][_0xc6aa('0x2d')]=moment()[_0xc6aa('0x2a')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x34ceb0[_0x5adabb]['queuecallerexit']){_0x34ceb0[_0x5adabb][_0xc6aa('0x2e')]=moment()[_0xc6aa('0x2a')](_0xc6aa('0x2f'));}RpcMemberReport[_0xc6aa('0x24')](_0x34ceb0[_0x5adabb]);}RpcVoiceQueueReport[_0xc6aa('0x30')](_0x34ceb0[_0x5adabb]);}};function extractCalleridNumber(_0x1950f3){var _0x147239=_0x1950f3[_0xc6aa('0x31')](/<(.*?)>/);return _0x147239?_0x147239[0x1]:_0x1950f3;}Report['prototype'][_0xc6aa('0x32')]=function(_0x56f2a7){for(var _0x554109=0x0;_0x554109',_0x3bdcd4[_0xc6aa('0x43')],_0x3bdcd4[_0xc6aa('0x3f')]);}if(RpcVoiceTransferReport[_0xc6aa('0x44')][_0x3bdcd4[_0xc6aa('0x45')]]){var _0x1adc66=RpcVoiceTransferReport[_0xc6aa('0x44')][_0x3bdcd4[_0xc6aa('0x45')]];_0x1adc66[_0xc6aa('0x46')]=_0x3bdcd4[_0xc6aa('0x47')];RpcVoiceTransferReport[_0xc6aa('0x1c')](_0x1adc66);delete RpcVoiceTransferReport['transfers'][_0x3bdcd4['linkedid']];}if(_[_0xc6aa('0x29')](_0x3bdcd4[_0xc6aa('0x48')])){_0x3bdcd4['type']=this[_0xc6aa('0x49')](_0x3bdcd4);}if(_[_0xc6aa('0x29')](_0x3bdcd4[_0xc6aa('0x4a')])){var _0xe3c42=_0x3bdcd4[_0xc6aa('0x34')][_0xc6aa('0x4b')]('-')[0x0];var _0x15915d=this[_0xc6aa('0x10')][_0xe3c42];if(!_0x15915d)_0x15915d=this[_0xc6aa('0x32')](_0x3bdcd4[_0xc6aa('0x1f')]);if(_0x15915d){_0x3bdcd4[_0xc6aa('0x4a')]=_0x15915d['id'];_0x3bdcd4[_0xc6aa('0x4c')]=_0x15915d['name'];}}RpcVoiceCallReport[_0xc6aa('0x30')](_0x3bdcd4);if(_0x3bdcd4[_0xc6aa('0x4d')]){for(var _0x18616b=0x0;_0x18616b<_0x3bdcd4['monitors']['length'];_0x18616b+=0x1){_0x3bdcd4[_0xc6aa('0x4e')]=_0x3bdcd4[_0xc6aa('0x4f')][_0x18616b][_0xc6aa('0x50')];_0x3bdcd4[_0xc6aa('0x51')]=_0x3bdcd4[_0xc6aa('0x4f')][_0x18616b][_0xc6aa('0x51')];if(_0x3bdcd4['exten']=='xcally-motion-preview'){_0x3bdcd4[_0xc6aa('0x3f')]=_0x3bdcd4[_0xc6aa('0x26')];_0x3bdcd4[_0xc6aa('0x43')]=_0x3bdcd4[_0xc6aa('0x52')];_0x3bdcd4['connectedlinenum']=_0x3bdcd4[_0xc6aa('0x1f')];_0x3bdcd4['connectedlinename']=_0x3bdcd4['membername'];_0x3bdcd4[_0xc6aa('0x53')]=_0x3bdcd4[_0xc6aa('0x40')];}else if(_0x3bdcd4['exten']==_0xc6aa('0x54')){_0x3bdcd4[_0xc6aa('0x3f')]=_0x3bdcd4[_0xc6aa('0x37')];_0x3bdcd4[_0xc6aa('0x53')]=_0x3bdcd4[_0xc6aa('0x40')];}RpcVoiceRecording['create'](_0x3bdcd4);}}};Report[_0xc6aa('0x23')][_0xc6aa('0x18')]=function(_0x4d09fd){if(_['isArray'](_0x4d09fd)){_0x4d09fd[_0xc6aa('0x55')](function(_0x2e0a70){RpcVoiceAgentReport['create'](_0x2e0a70);});}else{RpcVoiceAgentReport[_0xc6aa('0x30')](_0x4d09fd);}};Report[_0xc6aa('0x23')][_0xc6aa('0x1a')]=function(_0x3b07f0){RpcVoiceDialReport['create'](_0x3b07f0);var _0x36f9db;var _0x22fa00;var _0x3f9242=_0x3b07f0[_0xc6aa('0x34')];if(_[_0xc6aa('0x56')](_0x3f9242,'Local')){_0x22fa00=_0x3f9242[_0xc6aa('0x57')](_0x3f9242[_0xc6aa('0x58')]('/')+0x1,_0x3f9242[_0xc6aa('0x58')]('@'));_0x36f9db=_[_0xc6aa('0x21')](this[_0xc6aa('0x10')],function(_0x566524){return _0x566524['mobile']==_0x22fa00||_0x566524[_0xc6aa('0x59')]==_0x22fa00||_0x566524['accountcode']==_0x22fa00;});}else{_0x22fa00=_0x3f9242[_0xc6aa('0x57')](_0x3f9242['indexOf']('/')+0x1,_0x3f9242[_0xc6aa('0x5a')]('-'));_0x36f9db=this[_0xc6aa('0x1e')](_0x22fa00);}if(_0x36f9db){_0x3b07f0['interface']=_[_0xc6aa('0x29')](_0x36f9db['interface'])?util[_0xc6aa('0x2a')]('SIP/%s',_0x36f9db['name']):_0x36f9db[_0xc6aa('0x22')];_0x3b07f0[_0xc6aa('0x4c')]=_0x36f9db['name'];_0x3b07f0[_0xc6aa('0x1f')]=_0x36f9db[_0xc6aa('0x1f')];RpcMemberReport['voiceDialReport'](_0x3b07f0);}};Report['prototype']['blindTransfer']=function(_0x285d40){RpcVoiceTransferReport['transfers'][_0x285d40[_0xc6aa('0x5b')]]=_0x285d40;};Report[_0xc6aa('0x23')][_0xc6aa('0x1d')]=function(_0x499f12){RpcVoiceTransferReport[_0xc6aa('0x1d')](_0x499f12);};module['exports']=Report; \ No newline at end of file +var _0x34c2=['queue','lastdata','from-voip-provider','callerid','originatecalleridnum','destinationchannel','calleridpreview','disposition','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','UserId','membername','create','monitor','monitors','createdAt','connectedlinename','xcally-motion-dialer','voiceAgentReport','isArray','forEach','startsWith','Local','substring','indexOf','mobile','phone','lastIndexOf','attendedTransfer','exports','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','agents','telephones','prototype','sync','realtime','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','findAgent','accountcode','name','isNil','find','interface','format','length','connectedlinenum','lastAssignedTo','SIP/%s','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','YYYY-MM-DD\x20HH:mm:ss','match','keys','getCallType','channel','split','getAgentByInternal','calleridnum','outbound','internal','destination','exten','type','dialer','lastapplication'];(function(_0x1a9956,_0x162589){var _0x28baf1=function(_0x3722c2){while(--_0x3722c2){_0x1a9956['push'](_0x1a9956['shift']());}};_0x28baf1(++_0x162589);}(_0x34c2,0xe4));var _0x234c=function(_0x23196c,_0x1f8908){_0x23196c=_0x23196c-0x0;var _0x440bef=_0x34c2[_0x23196c];return _0x440bef;};'use strict';var _=require(_0x234c('0x0'));var moment=require(_0x234c('0x1'));var util=require(_0x234c('0x2'));var config=require(_0x234c('0x3'));var ami=require(_0x234c('0x4'));var RpcVoiceAgentReport=require(_0x234c('0x5'));var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0x234c('0x6'));var RpcMemberReport=require(_0x234c('0x7'));var RpcVoiceQueueReport=require(_0x234c('0x8'));var RpcVoiceRecording=require(_0x234c('0x9'));var RpcVoiceTransferReport=require(_0x234c('0xa'));var VoiceQueueReport=require(_0x234c('0xb'));var VoiceCallReport=require(_0x234c('0xc'));var VoiceAgentReport=require(_0x234c('0xd'));var VoiceDialReport=require(_0x234c('0xe'));var UserReport=require(_0x234c('0xf'));function Report(_0x10d8c6){this['realtime']=_0x10d8c6;this[_0x234c('0x10')]=_0x10d8c6[_0x234c('0x10')];this['telephones']=_0x10d8c6[_0x234c('0x11')];}Report[_0x234c('0x12')][_0x234c('0x13')]=function(_0x2e093a){var _0xe2620f=new VoiceQueueReport(this[_0x234c('0x14')]);var _0x442c47=new VoiceAgentReport(this[_0x234c('0x14')]);var _0x3b5545=new VoiceDialReport(this[_0x234c('0x14')]);var _0x1ed711=new VoiceCallReport(this['realtime']);var _0x523569=new UserReport(this[_0x234c('0x14')]);if(config[_0x234c('0x15')]&&config[_0x234c('0x15')][_0x234c('0x16')]){ami['on'](_0x234c('0x17'),this[_0x234c('0x18')][_0x234c('0x19')](this));ami['on'](_0x234c('0x1a'),this[_0x234c('0x1b')]['bind'](this));ami['on'](_0x234c('0x1c'),this['voiceAgentReport'][_0x234c('0x19')](this));ami['on'](_0x234c('0x1d'),this[_0x234c('0x1e')]['bind'](this));ami['on'](_0x234c('0x1f'),this[_0x234c('0x20')]['bind'](this));ami['on']('attendedtransfer',this['attendedTransfer'][_0x234c('0x19')](this));}};Report[_0x234c('0x12')][_0x234c('0x21')]=function(_0x4b402c){var _0x3e39fd;_0x3e39fd=_['find'](this[_0x234c('0x10')],function(_0x35a77b){return _0x35a77b[_0x234c('0x22')]==_0x4b402c||_0x35a77b[_0x234c('0x23')]==_0x4b402c;});if(_[_0x234c('0x24')](_0x3e39fd)){var _0x470428=_['find'](this[_0x234c('0x11')],function(_0x2bb7e0){return _0x2bb7e0['accountcode']==_0x4b402c||_0x2bb7e0[_0x234c('0x23')]==_0x4b402c;});if(_0x470428){_0x3e39fd=_[_0x234c('0x25')](this[_0x234c('0x10')],function(_0x519934){return _0x519934[_0x234c('0x26')]==util[_0x234c('0x27')]('SIP/%s',_0x470428[_0x234c('0x23')]);});}}return _0x3e39fd;};Report[_0x234c('0x12')]['voiceQueueReport']=function(_0x4b9b12){for(var _0x41c146=0x0;_0x41c146<_0x4b9b12[_0x234c('0x28')];_0x41c146+=0x1){var _0x1f52ba=this[_0x234c('0x21')](_0x4b9b12[_0x41c146][_0x234c('0x29')]);if(_0x1f52ba){_0x4b9b12[_0x41c146][_0x234c('0x22')]=_0x1f52ba[_0x234c('0x22')];_0x4b9b12[_0x41c146]['assigned']=!![];_0x4b9b12[_0x41c146][_0x234c('0x2a')]=_0x1f52ba[_0x234c('0x23')];_0x4b9b12[_0x41c146][_0x234c('0x26')]=_[_0x234c('0x24')](_0x1f52ba[_0x234c('0x26')])?util[_0x234c('0x27')](_0x234c('0x2b'),_0x1f52ba[_0x234c('0x23')]):_0x1f52ba[_0x234c('0x26')];if(_0x4b9b12[_0x41c146][_0x234c('0x2c')]){_0x4b9b12[_0x41c146][_0x234c('0x2d')]=moment()[_0x234c('0x27')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x4b9b12[_0x41c146][_0x234c('0x2e')]){_0x4b9b12[_0x41c146][_0x234c('0x2f')]=moment()['format'](_0x234c('0x30'));}RpcMemberReport[_0x234c('0x18')](_0x4b9b12[_0x41c146]);}RpcVoiceQueueReport['create'](_0x4b9b12[_0x41c146]);}};function extractCalleridNumber(_0x48f232){var _0x524b41=_0x48f232[_0x234c('0x31')](/<(.*?)>/);return _0x524b41?_0x524b41[0x1]:_0x48f232;}Report[_0x234c('0x12')]['getAgentByInternal']=function(_0x2ad4ec){for(var _0x2aa70e=0x0;_0x2aa70e0x0?!![]:![];if(!_0x4c4a69){return this[_0x917b('0x67')](this[_0x917b('0x15')][_0x917b('0x68')]);}};VoiceQueueReport[_0x917b('0xb')][_0x917b('0x1b')]=function(_0x3e9692){var _0x1654f8=this[_0x917b('0x15')]['id'];if(this['summary'][_0x917b('0x5b')][_0x1654f8]&&this[_0x917b('0x15')][_0x917b('0x5b')][_0x1654f8][_0x3e9692[_0x917b('0x5c')]]){this[_0x917b('0x15')][_0x917b('0x5b')][_0x1654f8][_0x3e9692[_0x917b('0x5c')]][_0x917b('0x11')][_0x917b('0x69')](_0x3e9692);}};VoiceQueueReport['prototype'][_0x917b('0x18')]=function(_0x4db6cd){var _0x292e06=this;try{if(this['isNotNull'](_0x4db6cd)&&this['isNotNull'](_0x4db6cd[_0x917b('0x4c')])){logger['debug'](_0x917b('0x6a'),util[_0x917b('0x40')](_0x4db6cd,{'showHidden':![],'depth':null}));var _0x1ab9d8=this[_0x917b('0x13')][_0x4db6cd[_0x917b('0x4c')]];if(_0x1ab9d8){logger[_0x917b('0x46')]('[voiceQueueReport][queuesummary]\x20name:%s',_0x1ab9d8[_0x917b('0x54')]);this[_0x917b('0x15')][_0x917b('0x5f')][_0x1ab9d8['name']]={'summaryEvent':_0x4db6cd};this[_0x917b('0x15')][_0x917b('0x66')]+=0x1;return ami[_0x917b('0x3b')]({'action':_0x917b('0x5b'),'queue':_0x1ab9d8[_0x917b('0x54')]})[_0x917b('0x5a')](function(_0x3f8835){if(!_0x292e06['summary'][_0x917b('0x5b')][_0x4db6cd[_0x917b('0x5c')]]){_0x292e06[_0x917b('0x15')][_0x917b('0x5b')][_0x4db6cd['actionid']]={};}_0x292e06['summary'][_0x917b('0x5b')][_0x4db6cd['actionid']][_0x3f8835[_0x917b('0x5c')]]={'queue':_0x1ab9d8[_0x917b('0x54')],'agents':[]};})[_0x917b('0x57')](function(_0x14ad9d){throw _0x14ad9d;});}}}catch(_0x4ec99d){logger[_0x917b('0x3e')](_0x917b('0x5d'),util[_0x917b('0x40')](_0x4ec99d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x917b('0xb')][_0x917b('0x67')]=function(_0x4be85a){if(this[_0x917b('0x15')]['statusRequests']>0x0){this['summary']['completeEvent']=_0x4be85a;return;}logger[_0x917b('0x46')](_0x917b('0x6b'),util[_0x917b('0x40')](_0x4be85a,{'showHidden':![],'depth':null}));this[_0x917b('0x15')]=initializeSummary();ami[_0x917b('0x45')](_0x917b('0x6c'),{});};VoiceQueueReport['prototype'][_0x917b('0x1e')]=function(_0x26afbf){try{if(this[_0x917b('0x56')](_0x26afbf)){logger[_0x917b('0x46')]('[%s][voiceQueueReport][queuecallerjoin]',_0x26afbf[_0x917b('0x49')],util[_0x917b('0x40')](_0x26afbf,{'showHidden':![],'depth':null}));if(_[_0x917b('0x6d')](this['queueReports'][_0x26afbf['uniqueid']])){this[_0x917b('0xf')][_0x26afbf[_0x917b('0x49')]]=[];}if(_[_0x917b('0x6d')](this['channels'][_0x26afbf[_0x917b('0x49')]])){this['channels'][_0x26afbf['uniqueid']]={};}var _0x11f316=new QueueReport();_0x11f316[_0x917b('0x4c')]=_0x26afbf[_0x917b('0x4c')];_0x11f316[_0x917b('0x52')]=this[_0x917b('0x13')][_0x11f316['queue']]&&this['voiceQueues'][_0x11f316[_0x917b('0x4c')]]['type']?this[_0x917b('0x13')][_0x11f316[_0x917b('0x4c')]]['type']||_0x917b('0x63'):_0x917b('0x63');_0x11f316[_0x917b('0x6e')]=moment()['format'](_0x917b('0x6f'));_0x11f316['position']=_0x26afbf[_0x917b('0x70')];_0x11f316[_0x917b('0x71')]=_0x26afbf['count'];_0x11f316[_0x917b('0x49')]=_0x26afbf['uniqueid'];_0x11f316[_0x917b('0x72')]=this[_0x917b('0x12')][_0x26afbf['uniqueid']][_0x917b('0x72')];logger[_0x917b('0x73')](_0x917b('0x74'),_0x11f316[_0x917b('0x4c')],_0x11f316[_0x917b('0x52')]);Object[_0x917b('0x62')](_0x11f316,_['pick'](_0x26afbf,_['keys'](_0x11f316)));this[_0x917b('0xf')][_0x26afbf[_0x917b('0x49')]][_0x917b('0x69')](_0x11f316);this[_0x917b('0x12')][_0x26afbf[_0x917b('0x49')]]=_0x11f316;this[_0x917b('0x75')](_0x11f316,_0x917b('0x1d'));}}catch(_0x552987){logger[_0x917b('0x3e')](_0x917b('0x76'),_0x26afbf[_0x917b('0x49')],util['inspect'](_0x552987,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x917b('0xb')]['syncQueueCallerAbandon']=function(_0x308e7d){try{if(this['isNotNull'](_0x308e7d)){logger['debug'](_0x917b('0x77'),_0x308e7d[_0x917b('0x49')],util[_0x917b('0x40')](_0x308e7d,{'showHidden':![],'depth':null}));if(this[_0x917b('0xf')][_0x308e7d[_0x917b('0x49')]]){var _0x2438c5=_[_0x917b('0x78')](this[_0x917b('0xf')][_0x308e7d[_0x917b('0x49')]]);_0x2438c5[_0x917b('0x37')]=![];_0x2438c5[_0x917b('0x79')]=null;_0x2438c5[_0x917b('0x7a')]=_0x308e7d['holdtime'];_0x2438c5[_0x917b('0x7b')]=_0x308e7d[_0x917b('0x7b')];_0x2438c5[_0x917b('0x36')]=!![];_0x2438c5[_0x917b('0x7c')]=moment()[_0x917b('0x4a')](_0x917b('0x6f'));_0x2438c5[_0x917b('0x50')]='ABANDONED';_0x2438c5['lastAssignedTo']=null;logger[_0x917b('0x73')](_0x917b('0x7d'),_0x2438c5['queue'],_0x2438c5[_0x917b('0x52')]);this[_0x917b('0x12')][_0x308e7d[_0x917b('0x49')]]=_0x2438c5;this[_0x917b('0x4e')](_0x2438c5,_0x917b('0x36'));}}}catch(_0x7ed562){logger[_0x917b('0x3e')]('[%s][voiceQueueReport][queuecallerabandon]',_0x308e7d['uniqueid'],util['inspect'](_0x7ed562,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x917b('0xb')][_0x917b('0x7e')]=function(_0x341f63){try{if(this['isNotNull'](_0x341f63)){logger['debug'](_0x917b('0x7f'),_0x341f63[_0x917b('0x49')],util[_0x917b('0x40')](_0x341f63,{'showHidden':![],'depth':null}));if(this[_0x917b('0xf')][_0x341f63[_0x917b('0x49')]]){var _0x5734ae=_['last'](this['queueReports'][_0x341f63[_0x917b('0x49')]]);_0x5734ae['queuecallerleaveAt']=moment()[_0x917b('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');_0x5734ae[_0x917b('0x80')]=_0x341f63[_0x917b('0x80')];_0x5734ae[_0x917b('0x81')]=_0x341f63[_0x917b('0x81')];logger[_0x917b('0x73')](_0x917b('0x82'),_0x5734ae[_0x917b('0x4c')],_0x5734ae['type'],_0x341f63[_0x917b('0x80')],_0x341f63[_0x917b('0x81')]);this[_0x917b('0x12')][_0x341f63[_0x917b('0x49')]]=_0x5734ae;this[_0x917b('0x75')](_0x5734ae,_0x917b('0x20'));}}}catch(_0x46892d){logger[_0x917b('0x3e')](_0x917b('0x7f'),_0x341f63[_0x917b('0x49')],util[_0x917b('0x40')](_0x46892d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x917b('0xb')][_0x917b('0x22')]=function(_0x122cc8){try{if(this[_0x917b('0x56')](_0x122cc8)){logger[_0x917b('0x46')]('[%s][voiceQueueReport][agentconnect]',_0x122cc8['uniqueid'],util[_0x917b('0x40')](_0x122cc8,{'showHidden':![],'depth':null}));if(this[_0x917b('0xf')][_0x122cc8[_0x917b('0x49')]]){var _0x25347f=_[_0x917b('0x78')](this[_0x917b('0xf')][_0x122cc8[_0x917b('0x49')]]);_0x25347f[_0x917b('0x37')]=!![];_0x25347f['queuecallerexitreason']=_0x917b('0x83');logger[_0x917b('0x73')]('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x25347f[_0x917b('0x4c')],_0x25347f[_0x917b('0x52')]);}}}catch(_0x3e0e86){logger[_0x917b('0x3e')]('[%s][voiceQueueReport][agentconnect]',_0x122cc8[_0x917b('0x49')],util[_0x917b('0x40')](_0x3e0e86,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x917b('0xb')]['syncAgentComplete']=function(_0x1c7010){try{if(this[_0x917b('0x56')](_0x1c7010)){logger[_0x917b('0x46')](_0x917b('0x84'),_0x1c7010['uniqueid'],util[_0x917b('0x40')](_0x1c7010,{'showHidden':![],'depth':null}));if(this[_0x917b('0xf')][_0x1c7010[_0x917b('0x49')]]){var _0x29337c=_['last'](this[_0x917b('0xf')][_0x1c7010[_0x917b('0x49')]]);_0x29337c[_0x917b('0x36')]=![];_0x29337c['queuecallerabandonAt']=null;_0x29337c[_0x917b('0x85')]=!![];_0x29337c[_0x917b('0x86')]=_0x1c7010['membername'];_0x29337c[_0x917b('0x7a')]=_0x1c7010[_0x917b('0x7a')];_0x29337c['queuecallercomplete']=!![];_0x29337c['queuecallerexit']=![];_0x29337c[_0x917b('0x87')]=null;if(!_0x29337c['transfer']){if(_0x1c7010[_0x917b('0x88')]==_0x917b('0x89')){_0x29337c['queuecallerexitreason']=_0x917b('0x8a');logger[_0x917b('0x73')](_0x917b('0x8b'),_0x29337c[_0x917b('0x4c')],_0x29337c[_0x917b('0x52')]);}else{if(_['startsWith'](_0x1c7010['channel'][_0x917b('0x8c')](),_0x917b('0x8d'))){if(this['queueReports'][_0x1c7010['linkedid']]){var _0xff6e44=_[_0x917b('0x78')](this[_0x917b('0xf')][_0x1c7010[_0x917b('0x8e')]]);_0xff6e44[_0x917b('0x37')]=![];_0xff6e44[_0x917b('0x35')]=!![];_0xff6e44['queuecallerexitAt']=moment(_0x29337c[_0x917b('0x6e')])[_0x917b('0x8f')](_0x1c7010[_0x917b('0x7a')],'seconds')[_0x917b('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');_0xff6e44['queuecallerexitreason']=_0x917b('0x90');_0xff6e44[_0x917b('0x89')]=!![];_0xff6e44[_0x917b('0x91')]=_0x917b('0x92');_0xff6e44[_0x917b('0x93')]=_0x1c7010[_0x917b('0x94')];_0xff6e44['transferuniqueid']=_0x1c7010[_0x917b('0x49')];logger[_0x917b('0x73')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0xff6e44[_0x917b('0x4c')],_0xff6e44[_0x917b('0x52')]);var _0x1e88b6=this[_0x917b('0xf')][_0x1c7010['linkedid']];this[_0x917b('0xf')][_0x1c7010[_0x917b('0x8e')]]=this['queueReports'][_0x1c7010['uniqueid']];this['queueReports'][_0x1c7010[_0x917b('0x49')]]=_0x1e88b6;}}else{_0x29337c['queuecallerexitreason']=_0x917b('0x95')+_0x1c7010[_0x917b('0x88')][_0x917b('0x96')]();logger[_0x917b('0x73')](_0x917b('0x97'),_0x29337c[_0x917b('0x4c')],_0x29337c[_0x917b('0x52')],_0x29337c[_0x917b('0x50')]);}}}this[_0x917b('0x12')][_0x1c7010[_0x917b('0x49')]]=_0x29337c;}}}catch(_0x297653){logger['error'](_0x917b('0x84'),_0x1c7010[_0x917b('0x49')],util[_0x917b('0x40')](_0x297653,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x917b('0xb')][_0x917b('0x24')]=function(_0x388375){try{if(this[_0x917b('0x56')](_0x388375)){logger[_0x917b('0x46')](_0x917b('0x98'),_0x388375[_0x917b('0x49')],util[_0x917b('0x40')](_0x388375,{'showHidden':![],'depth':null}));this[_0x917b('0x99')](_0x388375[_0x917b('0x49')],_['keys'](_0x388375[_0x917b('0x9a')])[0x0],_0x388375[_0x917b('0x9b')]);if(this[_0x917b('0xf')][_0x388375['uniqueid']]){var _0x45dfd7=_[_0x917b('0x78')](this[_0x917b('0xf')][_0x388375[_0x917b('0x49')]]);if(_0x45dfd7){if(this['isNotNull'](_0x388375[_0x917b('0x9a')])&&this[_0x917b('0x56')](_0x388375['variable'][_0x917b('0x5b')])){switch(_0x388375[_0x917b('0x9b')]){case _0x917b('0x9c'):_0x45dfd7[_0x917b('0x35')]=![];_0x45dfd7['queuecallerexitAt']=null;break;case _0x917b('0x9d'):_0x45dfd7[_0x917b('0x9e')]='timeout';_0x45dfd7['queuecallerexit']=!![];_0x45dfd7[_0x917b('0x87')]=moment()['format'](_0x917b('0x6f'));_0x45dfd7[_0x917b('0x9f')]=moment()[_0x917b('0x4a')](_0x917b('0x6f'));logger[_0x917b('0x46')]('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x388375['uniqueid'],util[_0x917b('0x40')](_0x45dfd7,{'showHidden':![],'depth':null}));ami[_0x917b('0x45')](_0x917b('0xa0'),_0x45dfd7);break;default:_0x45dfd7['queuecallerexit']=!![];_0x45dfd7['queuecallerexitAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x45dfd7[_0x917b('0x9f')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x45dfd7[_0x917b('0x36')]=![];_0x45dfd7[_0x917b('0x7c')]=null;_0x45dfd7[_0x917b('0x50')]=_0x388375[_0x917b('0x9b')];this[_0x917b('0x12')][_0x388375[_0x917b('0x49')]]=_0x45dfd7;this[_0x917b('0x4e')](_0x45dfd7,_0x917b('0x23'));}else if(this[_0x917b('0x56')](_0x388375[_0x917b('0x9a')])&&this[_0x917b('0x56')](_0x388375[_0x917b('0x9a')][_0x917b('0xa1')])){if(!_0x45dfd7[_0x917b('0x36')]){_0x45dfd7['queuecallerexit']=!![];_0x45dfd7['queuecallerexitAt']=moment()['format'](_0x917b('0x6f'));_0x45dfd7[_0x917b('0x50')]='EXITWITHKEY';_0x45dfd7[_0x917b('0x9f')]=moment()[_0x917b('0x4a')](_0x917b('0x6f'));this[_0x917b('0x12')][_0x388375['uniqueid']]=_0x45dfd7;}}logger[_0x917b('0x73')](_0x917b('0xa2'),_0x388375[_0x917b('0x49')],_0x45dfd7[_0x917b('0x4c')],_0x45dfd7[_0x917b('0x52')],_[_0x917b('0xa3')](_0x388375[_0x917b('0x9a')])[0x0],_0x388375[_0x917b('0x9b')]);_0x45dfd7[_0x917b('0x16')]=this['variables'][_0x388375['uniqueid']];}}}}catch(_0x1e506e){logger[_0x917b('0x3e')](_0x917b('0x98'),_0x388375[_0x917b('0x49')],util['inspect'](_0x1e506e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x917b('0xb')]['addVariable']=function(_0x3060ce,_0x5df563,_0x1e376c){var _0x295ff8=[_0x917b('0xa4'),_0x917b('0xa5'),_0x917b('0xa6'),_0x917b('0xa7'),_0x917b('0xa8'),'rtpaudioqoslossbridged',_0x917b('0xa9'),_0x917b('0xaa'),_0x917b('0xab'),'sipuri',_0x917b('0xac'),_0x917b('0xad'),_0x917b('0xae'),_0x917b('0xaf'),_0x917b('0xb0'),'memberlastcall',_0x917b('0xb1'),'memberpenalty',_0x917b('0xb2')];if(!_[_0x917b('0x3a')](_0x5df563)&&!_[_0x917b('0xb3')](_0x295ff8,_0x5df563)){if(_[_0x917b('0x6d')](this[_0x917b('0x16')][_0x3060ce])){this['variables'][_0x3060ce]={};}this[_0x917b('0x16')][_0x3060ce][_0x5df563]=_0x1e376c;}};VoiceQueueReport[_0x917b('0xb')][_0x917b('0xb4')]=function(_0x3ff522,_0x5262bd,_0x1c3203){var _0x4daee8={};for(var _0x2f17ad=0x0;_0x2f17ad0x0?!![]:![];if(!_0x128d0a){return this[_0x086d('0x1b')](this[_0x086d('0x48')][_0x086d('0x70')]);}};VoiceQueueReport[_0x086d('0xd')]['syncQueueMember']=function(_0x2b34aa){var _0x2e121a=this[_0x086d('0x48')]['id'];if(this[_0x086d('0x48')][_0x086d('0x6c')][_0x2e121a]&&this[_0x086d('0x48')][_0x086d('0x6c')][_0x2e121a][_0x2b34aa['actionid']]){this[_0x086d('0x48')][_0x086d('0x6c')][_0x2e121a][_0x2b34aa[_0x086d('0x67')]][_0x086d('0x14')][_0x086d('0x71')](_0x2b34aa);}};VoiceQueueReport[_0x086d('0xd')][_0x086d('0x72')]=function(_0x5e4909){var _0x39793d=this;try{if(this['isNotNull'](_0x5e4909)&&this[_0x086d('0x5e')](_0x5e4909[_0x086d('0x52')])){logger[_0x086d('0x4d')](_0x086d('0x73'),util[_0x086d('0x43')](_0x5e4909,{'showHidden':![],'depth':null}));var _0x3a027b=this[_0x086d('0x16')][_0x5e4909[_0x086d('0x52')]];if(_0x3a027b){logger['debug']('[voiceQueueReport][queuesummary]\x20name:%s',_0x3a027b[_0x086d('0x5d')]);this['summary'][_0x086d('0x61')][_0x3a027b[_0x086d('0x5d')]]={'summaryEvent':_0x5e4909};this[_0x086d('0x48')][_0x086d('0x6f')]+=0x1;return ami[_0x086d('0x3d')]({'action':_0x086d('0x6c'),'queue':_0x3a027b[_0x086d('0x5d')]})[_0x086d('0x66')](function(_0x2d88eb){if(!_0x39793d[_0x086d('0x48')]['queuestatus'][_0x5e4909[_0x086d('0x67')]]){_0x39793d[_0x086d('0x48')][_0x086d('0x6c')][_0x5e4909[_0x086d('0x67')]]={};}_0x39793d[_0x086d('0x48')][_0x086d('0x6c')][_0x5e4909[_0x086d('0x67')]][_0x2d88eb[_0x086d('0x67')]]={'queue':_0x3a027b['name'],'agents':[]};})[_0x086d('0x62')](function(_0x317b06){throw _0x317b06;});}}}catch(_0x3ce117){logger['error'](_0x086d('0x74'),util['inspect'](_0x3ce117,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x086d('0xd')][_0x086d('0x1b')]=function(_0x24ac82){if(this['summary']['statusRequests']>0x0){this[_0x086d('0x48')][_0x086d('0x70')]=_0x24ac82;return;}logger[_0x086d('0x4d')]('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0x086d('0x43')](_0x24ac82,{'showHidden':![],'depth':null}));this[_0x086d('0x48')]=initializeSummary();ami[_0x086d('0x4c')](_0x086d('0x75'),{});};VoiceQueueReport['prototype'][_0x086d('0x21')]=function(_0x5551ce){try{if(this[_0x086d('0x5e')](_0x5551ce)){logger[_0x086d('0x4d')](_0x086d('0x76'),_0x5551ce[_0x086d('0x55')],util[_0x086d('0x43')](_0x5551ce,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x086d('0x12')][_0x5551ce['uniqueid']])){this['queueReports'][_0x5551ce[_0x086d('0x55')]]=[];}if(_[_0x086d('0x5f')](this['channels'][_0x5551ce['uniqueid']])){this[_0x086d('0x3a')][_0x5551ce[_0x086d('0x55')]]={};}var _0x7bb1bd=new QueueReport();_0x7bb1bd[_0x086d('0x52')]=_0x5551ce[_0x086d('0x52')];_0x7bb1bd[_0x086d('0x5b')]=this[_0x086d('0x16')][_0x7bb1bd[_0x086d('0x52')]]&&this[_0x086d('0x16')][_0x7bb1bd[_0x086d('0x52')]]['type']?this[_0x086d('0x16')][_0x7bb1bd[_0x086d('0x52')]][_0x086d('0x5b')]||'inbound':_0x086d('0x5c');_0x7bb1bd[_0x086d('0x77')]=moment()[_0x086d('0x50')]('YYYY-MM-DD\x20HH:mm:ss');_0x7bb1bd['position']=_0x5551ce[_0x086d('0x78')];_0x7bb1bd['count']=_0x5551ce[_0x086d('0x79')];_0x7bb1bd['uniqueid']=_0x5551ce[_0x086d('0x55')];_0x7bb1bd['routealias']=this[_0x086d('0x3a')][_0x5551ce[_0x086d('0x55')]]['routealias'];logger[_0x086d('0x7a')](_0x086d('0x7b'),_0x7bb1bd[_0x086d('0x52')],_0x7bb1bd[_0x086d('0x5b')]);Object[_0x086d('0x6b')](_0x7bb1bd,_['pick'](_0x5551ce,_[_0x086d('0x7c')](_0x7bb1bd)));this[_0x086d('0x12')][_0x5551ce['uniqueid']]['push'](_0x7bb1bd);this[_0x086d('0x3a')][_0x5551ce['uniqueid']]=_0x7bb1bd;this[_0x086d('0x7d')](_0x7bb1bd,_0x086d('0x20'));}}catch(_0x313fca){logger[_0x086d('0x42')]('[%s][voiceQueueReport][queuecallerjoin]',_0x5551ce[_0x086d('0x55')],util['inspect'](_0x313fca,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x086d('0xd')]['syncQueueCallerAbandon']=function(_0x3a3e29){try{if(this[_0x086d('0x5e')](_0x3a3e29)){logger[_0x086d('0x4d')](_0x086d('0x7e'),_0x3a3e29[_0x086d('0x55')],util[_0x086d('0x43')](_0x3a3e29,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x3a3e29['uniqueid']]){var _0x8e1422=_[_0x086d('0x7f')](this['queueReports'][_0x3a3e29[_0x086d('0x55')]]);_0x8e1422[_0x086d('0x38')]=![];_0x8e1422[_0x086d('0x80')]=null;_0x8e1422[_0x086d('0x81')]=_0x3a3e29[_0x086d('0x81')];_0x8e1422[_0x086d('0x82')]=_0x3a3e29['originalposition'];_0x8e1422[_0x086d('0x22')]=!![];_0x8e1422[_0x086d('0x83')]=moment()[_0x086d('0x50')](_0x086d('0x84'));_0x8e1422[_0x086d('0x56')]=_0x086d('0x85');_0x8e1422[_0x086d('0x86')]=null;logger[_0x086d('0x7a')](_0x086d('0x87'),_0x8e1422[_0x086d('0x52')],_0x8e1422[_0x086d('0x5b')]);this['channels'][_0x3a3e29['uniqueid']]=_0x8e1422;this['emitVoiceQueueChannelRemove'](_0x8e1422,'queuecallerabandon');}}}catch(_0x4355e4){logger[_0x086d('0x42')]('[%s][voiceQueueReport][queuecallerabandon]',_0x3a3e29[_0x086d('0x55')],util[_0x086d('0x43')](_0x4355e4,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueCallerLeave']=function(_0x5bef98){try{if(this['isNotNull'](_0x5bef98)){logger[_0x086d('0x4d')]('[%s][voiceQueueReport][queuecallerleave]',_0x5bef98[_0x086d('0x55')],util[_0x086d('0x43')](_0x5bef98,{'showHidden':![],'depth':null}));if(this[_0x086d('0x12')][_0x5bef98['uniqueid']]){var _0x8f5ecf=_[_0x086d('0x7f')](this[_0x086d('0x12')][_0x5bef98['uniqueid']]);_0x8f5ecf['queuecallerleaveAt']=moment()['format'](_0x086d('0x84'));_0x8f5ecf['connectedlinenum']=_0x5bef98['connectedlinenum'];_0x8f5ecf['connectedlinename']=_0x5bef98[_0x086d('0x88')];logger[_0x086d('0x7a')](_0x086d('0x89'),_0x8f5ecf[_0x086d('0x52')],_0x8f5ecf[_0x086d('0x5b')],_0x5bef98[_0x086d('0x8a')],_0x5bef98[_0x086d('0x88')]);this['channels'][_0x5bef98['uniqueid']]=_0x8f5ecf;this[_0x086d('0x7d')](_0x8f5ecf,_0x086d('0x8b'));}}}catch(_0x42dca6){logger[_0x086d('0x42')]('[%s][voiceQueueReport][queuecallerleave]',_0x5bef98[_0x086d('0x55')],util['inspect'](_0x42dca6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x086d('0xd')][_0x086d('0x26')]=function(_0x39a18e){try{if(this[_0x086d('0x5e')](_0x39a18e)){logger[_0x086d('0x4d')](_0x086d('0x8c'),_0x39a18e[_0x086d('0x55')],util[_0x086d('0x43')](_0x39a18e,{'showHidden':![],'depth':null}));if(this[_0x086d('0x12')][_0x39a18e['uniqueid']]){var _0x2b6e54=_[_0x086d('0x7f')](this[_0x086d('0x12')][_0x39a18e[_0x086d('0x55')]]);_0x2b6e54[_0x086d('0x38')]=!![];_0x2b6e54[_0x086d('0x56')]='COMPLETEDBYAGENT';logger[_0x086d('0x7a')](_0x086d('0x8d'),_0x2b6e54[_0x086d('0x52')],_0x2b6e54['type']);}}}catch(_0x5468bb){logger[_0x086d('0x42')](_0x086d('0x8c'),_0x39a18e[_0x086d('0x55')],util[_0x086d('0x43')](_0x5468bb,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x086d('0xd')][_0x086d('0x8e')]=function(_0x2aa15b){try{if(this['isNotNull'](_0x2aa15b)){logger[_0x086d('0x4d')](_0x086d('0x8f'),_0x2aa15b[_0x086d('0x55')],util[_0x086d('0x43')](_0x2aa15b,{'showHidden':![],'depth':null}));if(this[_0x086d('0x12')][_0x2aa15b[_0x086d('0x55')]]){var _0x2a1afc=_[_0x086d('0x7f')](this[_0x086d('0x12')][_0x2aa15b[_0x086d('0x55')]]);_0x2a1afc[_0x086d('0x22')]=![];_0x2a1afc[_0x086d('0x83')]=null;_0x2a1afc[_0x086d('0x90')]=!![];_0x2a1afc[_0x086d('0x86')]=_0x2aa15b[_0x086d('0x91')];_0x2a1afc[_0x086d('0x81')]=_0x2aa15b[_0x086d('0x81')];_0x2a1afc[_0x086d('0x38')]=!![];_0x2a1afc[_0x086d('0x92')]=![];_0x2a1afc[_0x086d('0x93')]=null;if(!_0x2a1afc[_0x086d('0x94')]){if(_0x2aa15b[_0x086d('0x95')]==_0x086d('0x94')){_0x2a1afc[_0x086d('0x56')]=_0x086d('0x96');logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x2a1afc[_0x086d('0x52')],_0x2a1afc[_0x086d('0x5b')]);}else{if(_['startsWith'](_0x2aa15b[_0x086d('0x3f')][_0x086d('0x97')](),_0x086d('0x98'))){if(this[_0x086d('0x12')][_0x2aa15b[_0x086d('0x99')]]){var _0x3ac5b1=_[_0x086d('0x7f')](this[_0x086d('0x12')][_0x2aa15b[_0x086d('0x99')]]);_0x3ac5b1[_0x086d('0x38')]=![];_0x3ac5b1['queuecallerexit']=!![];_0x3ac5b1[_0x086d('0x93')]=moment(_0x2a1afc['queuecallerjoinAt'])[_0x086d('0x9a')](_0x2aa15b['holdtime'],_0x086d('0x9b'))[_0x086d('0x50')](_0x086d('0x84'));_0x3ac5b1[_0x086d('0x56')]=_0x086d('0x9c');_0x3ac5b1['transfer']=!![];_0x3ac5b1[_0x086d('0x9d')]=_0x086d('0x9e');_0x3ac5b1[_0x086d('0x9f')]=_0x2aa15b[_0x086d('0xa0')];_0x3ac5b1[_0x086d('0xa1')]=_0x2aa15b[_0x086d('0x55')];logger['info'](_0x086d('0xa2'),_0x3ac5b1[_0x086d('0x52')],_0x3ac5b1[_0x086d('0x5b')]);var _0x516666=this['queueReports'][_0x2aa15b[_0x086d('0x99')]];this[_0x086d('0x12')][_0x2aa15b['linkedid']]=this[_0x086d('0x12')][_0x2aa15b[_0x086d('0x55')]];this[_0x086d('0x12')][_0x2aa15b['uniqueid']]=_0x516666;}}else{_0x2a1afc[_0x086d('0x56')]=_0x086d('0xa3')+_0x2aa15b[_0x086d('0x95')]['toUpperCase']();logger[_0x086d('0x7a')](_0x086d('0xa4'),_0x2a1afc[_0x086d('0x52')],_0x2a1afc['type'],_0x2a1afc[_0x086d('0x56')]);}}}this[_0x086d('0x3a')][_0x2aa15b[_0x086d('0x55')]]=_0x2a1afc;}}}catch(_0x5960c5){logger[_0x086d('0x42')](_0x086d('0x8f'),_0x2aa15b['uniqueid'],util[_0x086d('0x43')](_0x5960c5,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncVarSet']=function(_0x313313){try{if(this['isNotNull'](_0x313313)){logger[_0x086d('0x4d')](_0x086d('0xa5'),_0x313313[_0x086d('0x55')],util['inspect'](_0x313313,{'showHidden':![],'depth':null}));this[_0x086d('0xa6')](_0x313313['uniqueid'],_[_0x086d('0x7c')](_0x313313[_0x086d('0xa7')])[0x0],_0x313313[_0x086d('0xa8')]);if(this[_0x086d('0x12')][_0x313313[_0x086d('0x55')]]){var _0x3c56b4=_['last'](this[_0x086d('0x12')][_0x313313[_0x086d('0x55')]]);if(_0x3c56b4){if(this[_0x086d('0x5e')](_0x313313['variable'])&&this[_0x086d('0x5e')](_0x313313[_0x086d('0xa7')][_0x086d('0x6c')])){switch(_0x313313[_0x086d('0xa8')]){case _0x086d('0xa9'):_0x3c56b4[_0x086d('0x92')]=![];_0x3c56b4[_0x086d('0x93')]=null;break;case _0x086d('0xaa'):_0x3c56b4[_0x086d('0xab')]='timeout';_0x3c56b4[_0x086d('0x92')]=!![];_0x3c56b4['queuecallerexitAt']=moment()[_0x086d('0x50')](_0x086d('0x84'));_0x3c56b4['queuecallerleaveAt']=moment()[_0x086d('0x50')](_0x086d('0x84'));logger['debug']('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x313313[_0x086d('0x55')],util['inspect'](_0x3c56b4,{'showHidden':![],'depth':null}));ami[_0x086d('0x4c')]('custom:timeout',_0x3c56b4);break;default:_0x3c56b4[_0x086d('0x92')]=!![];_0x3c56b4[_0x086d('0x93')]=moment()['format'](_0x086d('0x84'));_0x3c56b4[_0x086d('0xac')]=moment()[_0x086d('0x50')](_0x086d('0x84'));}_0x3c56b4[_0x086d('0x22')]=![];_0x3c56b4[_0x086d('0x83')]=null;_0x3c56b4[_0x086d('0x56')]=_0x313313['value'];this[_0x086d('0x3a')][_0x313313[_0x086d('0x55')]]=_0x3c56b4;this[_0x086d('0x4a')](_0x3c56b4,_0x086d('0x27'));}else if(this[_0x086d('0x5e')](_0x313313[_0x086d('0xa7')])&&this[_0x086d('0x5e')](_0x313313[_0x086d('0xa7')]['queueposition'])){if(!_0x3c56b4[_0x086d('0x22')]){_0x3c56b4[_0x086d('0x92')]=!![];_0x3c56b4['queuecallerexitAt']=moment()['format'](_0x086d('0x84'));_0x3c56b4[_0x086d('0x56')]=_0x086d('0xad');_0x3c56b4[_0x086d('0xac')]=moment()[_0x086d('0x50')](_0x086d('0x84'));this[_0x086d('0x3a')][_0x313313['uniqueid']]=_0x3c56b4;}}logger[_0x086d('0x7a')](_0x086d('0xae'),_0x313313['uniqueid'],_0x3c56b4[_0x086d('0x52')],_0x3c56b4[_0x086d('0x5b')],_[_0x086d('0x7c')](_0x313313['variable'])[0x0],_0x313313[_0x086d('0xa8')]);_0x3c56b4['variables']=this['variables'][_0x313313[_0x086d('0x55')]];}}}}catch(_0x3f58fa){logger[_0x086d('0x42')](_0x086d('0xa5'),_0x313313[_0x086d('0x55')],util[_0x086d('0x43')](_0x3f58fa,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x086d('0xd')][_0x086d('0xa6')]=function(_0x36d5fa,_0x4a7015,_0x2650ae){var _0x21d9be=['rtpaudioqos',_0x086d('0xaf'),_0x086d('0xb0'),'rtpaudioqosjitterbridged','rtpaudioqosloss',_0x086d('0xb1'),_0x086d('0xb2'),'rtpaudioqosrttbridged',_0x086d('0xb3'),_0x086d('0xb4'),_0x086d('0xb5'),_0x086d('0xb6'),_0x086d('0xb7'),_0x086d('0xb8'),_0x086d('0xb9'),_0x086d('0xba'),_0x086d('0x91'),_0x086d('0xbb'),_0x086d('0xbc')];if(!_['isNil'](_0x4a7015)&&!_[_0x086d('0xbd')](_0x21d9be,_0x4a7015)){if(_[_0x086d('0x5f')](this['variables'][_0x36d5fa])){this[_0x086d('0x18')][_0x36d5fa]={};}this[_0x086d('0x18')][_0x36d5fa][_0x4a7015]=_0x2650ae;}};VoiceQueueReport[_0x086d('0xd')][_0x086d('0xbe')]=function(_0x2ff960,_0x2f83b8,_0x35ce14){var _0x48e150={};for(var _0x3c9b68=0x0;_0x3c9b68=0x0?moment(_0x540eef['endtime'])[_0x8a2d('0xe')](_0x540eef[_0x8a2d('0x19')],_0x8a2d('0xf')):null,'data1':_0x8a2d('0x1b'),'data2':_0x540eef[_0x8a2d('0x15')],'data3':_0x540eef[_0x8a2d('0x12')],'data4':_0x540eef['dialstring']||null,'role':_0x8a2d('0x13'),'internal':_0x540eef['accountcode']?_[_0x8a2d('0x14')](_0x540eef[_0x8a2d('0x15')]):undefined,'uniqueid':_0x540eef['uniqueid']},'log':_0x8a2d('0x6')});}; \ No newline at end of file +var _0x204d=['toNumber','lodash','util','../client','queuecallerexitAt','Request','CreateMemberReport','lastAssignedTo','isNil','format','SIP/%s','TALKING','queuecallerleaveAt','diff','inbound','calleridnum','exten','queue','agent','accountcode','uniqueid','voice','membername','starttime','endtime','seconds'];(function(_0x182134,_0x15289a){var _0x110626=function(_0x4605c1){while(--_0x4605c1){_0x182134['push'](_0x182134['shift']());}};_0x110626(++_0x15289a);}(_0x204d,0x9d));var _0xd204=function(_0x3da832,_0x2133f1){_0x3da832=_0x3da832-0x0;var _0xe602f2=_0x204d[_0x3da832];return _0xe602f2;};'use strict';var moment=require('moment');var _=require(_0xd204('0x0'));var util=require(_0xd204('0x1'));var client=require(_0xd204('0x2'));exports['voiceQueueReport']=function(_0x4a4b85){var _0x2bf9c4=_0x4a4b85['queuecallercompleteAt']||_0x4a4b85[_0xd204('0x3')];return client[_0xd204('0x4')](_0xd204('0x5'),{'body':{'channel':'voice','membername':_0x4a4b85[_0xd204('0x6')],'interface':_[_0xd204('0x7')](_0x4a4b85['interface'])?util[_0xd204('0x8')](_0xd204('0x9'),_0x4a4b85[_0xd204('0x6')]):_0x4a4b85['interface'],'type':_0xd204('0xa'),'enterAt':_0x4a4b85[_0xd204('0xb')],'exitAt':_0x2bf9c4,'duration':moment(_0x2bf9c4)[_0xd204('0xc')](_0x4a4b85[_0xd204('0xb')],'seconds'),'data1':_0xd204('0xd'),'data2':_0x4a4b85[_0xd204('0xe')],'data3':_0x4a4b85[_0xd204('0xf')],'data4':null,'data5':_0x4a4b85[_0xd204('0x10')],'role':_0xd204('0x11'),'internal':_0x4a4b85[_0xd204('0x12')]?_['toNumber'](_0x4a4b85[_0xd204('0x12')]):undefined,'uniqueid':_0x4a4b85[_0xd204('0x13')]},'log':_0xd204('0x5')});};exports['voiceDialReport']=function(_0x22be8a){return client[_0xd204('0x4')](_0xd204('0x5'),{'body':{'channel':_0xd204('0x14'),'membername':_0x22be8a[_0xd204('0x15')],'interface':_0x22be8a['interface'],'type':_0xd204('0xa'),'enterAt':_0x22be8a[_0xd204('0x16')],'exitAt':_0x22be8a['endtime'],'duration':moment(_0x22be8a[_0xd204('0x17')])['diff'](_0x22be8a[_0xd204('0x16')],_0xd204('0x18'))>=0x0?moment(_0x22be8a[_0xd204('0x17')])[_0xd204('0xc')](_0x22be8a[_0xd204('0x16')],_0xd204('0x18')):null,'data1':'outbound','data2':_0x22be8a[_0xd204('0x12')],'data3':_0x22be8a[_0xd204('0xf')],'data4':_0x22be8a['dialstring']||null,'role':_0xd204('0x11'),'internal':_0x22be8a['accountcode']?_[_0xd204('0x19')](_0x22be8a[_0xd204('0x12')]):undefined,'uniqueid':_0x22be8a['uniqueid']},'log':_0xd204('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index dfbbb4c..e6f372c 100644 --- a/server/services/ami/rpc/setting.js +++ b/server/services/ami/rpc/setting.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x66d4=['previewRecallmeReminderInterval','GetSettings','getSettings','ShowSetting','stopRecordingOnTransfer'];(function(_0xc8aa13,_0x467aef){var _0x20276e=function(_0x5cef3e){while(--_0x5cef3e){_0xc8aa13['push'](_0xc8aa13['shift']());}};_0x20276e(++_0x467aef);}(_0x66d4,0x10b));var _0x466d=function(_0xc0a3d3,_0x2c8d00){_0xc0a3d3=_0xc0a3d3-0x0;var _0x3386e8=_0x66d4[_0xc0a3d3];return _0x3386e8;};'use strict';var client=require('../client');exports[_0x466d('0x0')]=function(){return client['Request'](_0x466d('0x1'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x466d('0x2'),_0x466d('0x3')]},'log':_0x466d('0x4')});}; \ No newline at end of file +var _0xd5a2=['previewRecallmeReminderInterval','getSettings','Request','ShowSetting','stopRecordingOnTransfer'];(function(_0x55aa0e,_0x20f3f5){var _0x146eb6=function(_0x630381){while(--_0x630381){_0x55aa0e['push'](_0x55aa0e['shift']());}};_0x146eb6(++_0x20f3f5);}(_0xd5a2,0x1eb));var _0x2d5a=function(_0x546258,_0x4baed5){_0x546258=_0x546258-0x0;var _0x7fd23b=_0xd5a2[_0x546258];return _0x7fd23b;};'use strict';var client=require('../client');exports[_0x2d5a('0x0')]=function(){return client[_0x2d5a('0x1')](_0x2d5a('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x2d5a('0x3'),_0x2d5a('0x4')]},'log':'GetSettings'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 1d46b02..e84c8dd 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 _0x4789=['GetTemplate','name','html','../client','getTemplates','Request'];(function(_0x33616f,_0x3855c6){var _0x47221f=function(_0xe32c3a){while(--_0xe32c3a){_0x33616f['push'](_0x33616f['shift']());}};_0x47221f(++_0x3855c6);}(_0x4789,0xe1));var _0x9478=function(_0x2e04ef,_0x31a596){_0x2e04ef=_0x2e04ef-0x0;var _0x5722b0=_0x4789[_0x2e04ef];return _0x5722b0;};'use strict';var client=require(_0x9478('0x0'));exports[_0x9478('0x1')]=function(_0x42d4aa){return function(_0x454219){return client[_0x9478('0x2')](_0x9478('0x3'),{'options':{'raw':!![],'attributes':['id',_0x9478('0x4'),_0x9478('0x5')]},'log':'GetTemplate'});};}; \ No newline at end of file +var _0xdda4=['name','html','getTemplates','Request','GetTemplate'];(function(_0x3b74cc,_0xb1420){var _0x6e1aac=function(_0x3689ec){while(--_0x3689ec){_0x3b74cc['push'](_0x3b74cc['shift']());}};_0x6e1aac(++_0xb1420);}(_0xdda4,0x1a6));var _0x4dda=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xdda4[_0x2160a9];return _0xa88cf7;};'use strict';var client=require('../client');exports[_0x4dda('0x0')]=function(_0x516a88){return function(_0x30e4d9){return client[_0x4dda('0x1')](_0x4dda('0x2'),{'options':{'raw':!![],'attributes':['id',_0x4dda('0x3'),_0x4dda('0x4')]},'log':_0x4dda('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index d535d8e..f0219f9 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 _0x5c2f=['action','data1','data2','data3','data5','data6','data7','GetTrigger','../client','getTriggers','Request','name','channel','status','AllConditions','Condition','AnyConditions','field','operator','Actions'];(function(_0x2576d7,_0x167624){var _0x16a08c=function(_0x19de1e){while(--_0x19de1e){_0x2576d7['push'](_0x2576d7['shift']());}};_0x16a08c(++_0x167624);}(_0x5c2f,0x10c));var _0xf5c2=function(_0xf2628e,_0x521bf7){_0xf2628e=_0xf2628e-0x0;var _0x13863a=_0x5c2f[_0xf2628e];return _0x13863a;};'use strict';var client=require(_0xf5c2('0x0'));exports[_0xf5c2('0x1')]=function(_0x1b2616){return function(_0x3a2e31){return client[_0xf5c2('0x2')]('GetTrigger',{'options':{'raw':![],'attributes':['id',_0xf5c2('0x3'),_0xf5c2('0x4'),_0xf5c2('0x5')],'include':[{'model':'Condition','as':_0xf5c2('0x6'),'attributes':['id','field','operator','value']},{'model':_0xf5c2('0x7'),'as':_0xf5c2('0x8'),'attributes':['id',_0xf5c2('0x9'),_0xf5c2('0xa'),'value']},{'model':'Action','as':_0xf5c2('0xb'),'attributes':['id',_0xf5c2('0xc'),_0xf5c2('0xd'),_0xf5c2('0xe'),_0xf5c2('0xf'),'data4',_0xf5c2('0x10'),_0xf5c2('0x11'),_0xf5c2('0x12')]}]},'log':_0xf5c2('0x13')});};}; \ No newline at end of file +var _0xe400=['Request','GetTrigger','name','channel','status','AllConditions','field','operator','value','Condition','AnyConditions','data1','data3','data6','../client','getTriggers'];(function(_0x131e68,_0x37c341){var _0x382d23=function(_0x5bc9c5){while(--_0x5bc9c5){_0x131e68['push'](_0x131e68['shift']());}};_0x382d23(++_0x37c341);}(_0xe400,0x14e));var _0x0e40=function(_0x43795f,_0x525c02){_0x43795f=_0x43795f-0x0;var _0x18547c=_0xe400[_0x43795f];return _0x18547c;};'use strict';var client=require(_0x0e40('0x0'));exports[_0x0e40('0x1')]=function(_0x2839a3){return function(_0x396406){return client[_0x0e40('0x2')](_0x0e40('0x3'),{'options':{'raw':![],'attributes':['id',_0x0e40('0x4'),_0x0e40('0x5'),_0x0e40('0x6')],'include':[{'model':'Condition','as':_0x0e40('0x7'),'attributes':['id',_0x0e40('0x8'),_0x0e40('0x9'),_0x0e40('0xa')]},{'model':_0x0e40('0xb'),'as':_0x0e40('0xc'),'attributes':['id','field',_0x0e40('0x9'),'value']},{'model':'Action','as':'Actions','attributes':['id','action',_0x0e40('0xd'),'data2',_0x0e40('0xe'),'data4','data5',_0x0e40('0xf'),'data7']}]},'log':_0x0e40('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index a5b50ea..68765a6 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 _0x323b=['registry','defaultuser','GetTrunk','../client','Request','name'];(function(_0x1089a3,_0x5ba77f){var _0x1acaa0=function(_0x31ed42){while(--_0x31ed42){_0x1089a3['push'](_0x1089a3['shift']());}};_0x1acaa0(++_0x5ba77f);}(_0x323b,0x1ad));var _0xb323=function(_0x55ff88,_0x2484bd){_0x55ff88=_0x55ff88-0x0;var _0x5e6c5a=_0x323b[_0x55ff88];return _0x5e6c5a;};'use strict';var client=require(_0xb323('0x0'));exports['getTrunks']=function(_0x124e69){return function(_0x3fbfb2){return client[_0xb323('0x1')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xb323('0x2'),_0xb323('0x3'),_0xb323('0x4')]},'log':_0xb323('0x5')});};}; \ No newline at end of file +var _0xd0ba=['registry','defaultuser','getTrunks','Request','GetTrunk','name'];(function(_0x5a0f8a,_0x374487){var _0x1a9380=function(_0x783ef1){while(--_0x783ef1){_0x5a0f8a['push'](_0x5a0f8a['shift']());}};_0x1a9380(++_0x374487);}(_0xd0ba,0x17c));var _0xad0b=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0xd0ba[_0x2b5eae];return _0x5f3ac9;};'use strict';var client=require('../client');exports[_0xad0b('0x0')]=function(_0x13288a){return function(_0x395d5d){return client[_0xad0b('0x1')](_0xad0b('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xad0b('0x3'),_0xad0b('0x4'),_0xad0b('0x5')]},'log':_0xad0b('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index b36df4c..5be81af 100644 --- a/server/services/ami/rpc/user.js +++ b/server/services/ami/rpc/user.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['getAgents','Request','name','email','accountcode','fullname','lastLoginAt','lastPauseAt','interface','getTelephones','GetUser','telephone','savePause','PauseUser','saveUnpause','getAgent','agent','online','pauseType','../client'];(function(_0x275586,_0x15e1d2){var _0x450233=function(_0x37948a){while(--_0x37948a){_0x275586['push'](_0x275586['shift']());}};_0x450233(++_0x15e1d2);}(_0x70e0,0x17b));var _0x070e=function(_0x1467f6,_0x2f4765){_0x1467f6=_0x1467f6-0x0;var _0x3ec173=_0x70e0[_0x1467f6];return _0x3ec173;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(){return function(){return client[_0x070e('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5'),_0x070e('0x6'),'online',_0x070e('0x7'),'pauseType',_0x070e('0x8'),'voicePause','phone','mobile',_0x070e('0x9')]},'log':_0x070e('0x1')});};};exports[_0x070e('0xa')]=function(){return function(){return client[_0x070e('0x2')](_0x070e('0xb'),{'options':{'raw':!![],'where':{'role':_0x070e('0xc')},'attributes':['id',_0x070e('0x3'),'accountcode','internal']},'log':_0x070e('0xa')});};};exports[_0x070e('0xd')]=function(_0x12bb37,_0xb8d819,_0xa927a2){return client[_0x070e('0x2')](_0x070e('0xe'),{'body':{'type':_0xb8d819,'uniqueid':_0xa927a2},'options':{'where':{'id':_0x12bb37['id']}},'log':_0x070e('0xd')});};exports[_0x070e('0xf')]=function(_0x5bf079){return client[_0x070e('0x2')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x5bf079['id']}},'log':'savePause'});};exports[_0x070e('0x10')]=function(_0x56c7ba){return client['Request']('ShowUser',{'options':{'raw':![],'where':{'role':_0x070e('0x11'),'id':_0x56c7ba},'attributes':['id',_0x070e('0x3'),'email','accountcode',_0x070e('0x6'),_0x070e('0x12'),_0x070e('0x7'),_0x070e('0x13'),'lastPauseAt','voicePause',_0x070e('0x9')]},'log':_0x070e('0x10')});}; \ No newline at end of file +var _0xa9e0=['agent','lastPauseAt','interface','../client','getAgents','Request','name','accountcode','fullname','online','lastLoginAt','pauseType','voicePause','phone','mobile','getTelephones','telephone','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'lastPauseAt',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'interface']},'log':'getAgents'});};};exports[_0x0a9e('0xc')]=function(){return function(){return client['Request']('GetUser',{'options':{'raw':!![],'where':{'role':_0x0a9e('0xd')},'attributes':['id',_0x0a9e('0x3'),_0x0a9e('0x4'),_0x0a9e('0xe')]},'log':_0x0a9e('0xc')});};};exports[_0x0a9e('0xf')]=function(_0x4a4c56,_0x50dfb2,_0x527cdd){return client['Request'](_0x0a9e('0x10'),{'body':{'type':_0x50dfb2,'uniqueid':_0x527cdd},'options':{'where':{'id':_0x4a4c56['id']}},'log':_0x0a9e('0xf')});};exports[_0x0a9e('0x11')]=function(_0x26d672){return client[_0x0a9e('0x2')](_0x0a9e('0x12'),{'body':{},'options':{'where':{'id':_0x26d672['id']}},'log':'savePause'});};exports[_0x0a9e('0x13')]=function(_0x239b12){return client[_0x0a9e('0x2')](_0x0a9e('0x14'),{'options':{'raw':![],'where':{'role':_0x0a9e('0x15'),'id':_0x239b12},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),'fullname',_0x0a9e('0x6'),'lastLoginAt',_0x0a9e('0x8'),_0x0a9e('0x16'),'voicePause',_0x0a9e('0x17')]},'log':'getAgent'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index d8bb85c..a0d024a 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 _0x050b=['create','CreateVoiceAgentReport','Request'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x050b,0xa8));var _0xb050=function(_0x5bf348,_0xd9e532){_0x5bf348=_0x5bf348-0x0;var _0x558435=_0x050b[_0x5bf348];return _0x558435;};'use strict';var client=require('../client');exports[_0xb050('0x0')]=function(_0x3ca3fd){return client['Request']('CreateVoiceAgentReport',{'body':_0x3ca3fd,'log':_0xb050('0x1')});};exports['update']=function(_0x39414d,_0x58fa15,_0x5dd889){return client[_0xb050('0x2')]('UpdateVoiceAgentReport',{'body':_0x39414d,'options':{'where':{'uniqueid':_0x58fa15,'interface':_0x5dd889,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file +var _0x3752=['update','Request','UpdateVoiceAgentReport','../client','create','CreateVoiceAgentReport'];(function(_0xb2dbad,_0x5021ef){var _0x34f359=function(_0x5dbe88){while(--_0x5dbe88){_0xb2dbad['push'](_0xb2dbad['shift']());}};_0x34f359(++_0x5021ef);}(_0x3752,0x177));var _0x2375=function(_0x54b9c6,_0x2c697e){_0x54b9c6=_0x54b9c6-0x0;var _0x251824=_0x3752[_0x54b9c6];return _0x251824;};'use strict';var client=require(_0x2375('0x0'));exports[_0x2375('0x1')]=function(_0x3598ca){return client['Request'](_0x2375('0x2'),{'body':_0x3598ca,'log':'CreateVoiceAgentReport'});};exports[_0x2375('0x3')]=function(_0x2f6dea,_0x40d1f2,_0x756704){return client[_0x2375('0x4')](_0x2375('0x5'),{'body':_0x2f6dea,'options':{'where':{'uniqueid':_0x40d1f2,'interface':_0x756704,'agentcomplete':!![]}},'log':_0x2375('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 5c9bf4c..572b6c8 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 _0xbd41=['day','format','endOf','YYYY-MM-DD\x20HH:mm:ss','type','billableseconds','GetVoiceCallReports','moment','util','../client','create','Request','merge','calleridnum','context','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','startOf'];(function(_0x11caf3,_0x2e847d){var _0x1923ee=function(_0x40ee4d){while(--_0x40ee4d){_0x11caf3['push'](_0x11caf3['shift']());}};_0x1923ee(++_0x2e847d);}(_0xbd41,0x70));var _0x1bd4=function(_0x565fed,_0xb85768){_0x565fed=_0x565fed-0x0;var _0x3e018f=_0xbd41[_0x565fed];return _0x3e018f;};'use strict';var moment=require(_0x1bd4('0x0'));var util=require(_0x1bd4('0x1'));var _=require('lodash');var client=require(_0x1bd4('0x2'));exports[_0x1bd4('0x3')]=function(_0x4430bc){return client[_0x1bd4('0x4')]('CreateVoiceCallReport',{'body':_[_0x1bd4('0x5')](_0x4430bc,{'source':_0x4430bc[_0x1bd4('0x6')],'destinationcontext':_0x4430bc[_0x1bd4('0x7')],'callerid':_0x4430bc[_0x1bd4('0x8')],'amaflags':_0x1bd4('0x9')}),'log':'CreateVoiceCallReport'});};exports[_0x1bd4('0xa')]=function(){return function(){return client['Request'](_0x1bd4('0xb'),{'options':{'where':{'type':[_0x1bd4('0xc')],'createdAt':{'$between':[moment()[_0x1bd4('0xd')](_0x1bd4('0xe'))[_0x1bd4('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x1bd4('0x10')](_0x1bd4('0xe'))['format'](_0x1bd4('0x11'))]}},'attributes':[_0x1bd4('0x12'),'disposition','duration',_0x1bd4('0x13')]},'log':_0x1bd4('0x14')});};}; \ No newline at end of file +var _0xa2e7=['moment','util','lodash','create','Request','CreateVoiceCallReport','merge','calleridnum','context','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','disposition','duration','GetVoiceCallReports'];(function(_0x156dd4,_0x26d407){var _0x32fe4d=function(_0x21c4f4){while(--_0x21c4f4){_0x156dd4['push'](_0x156dd4['shift']());}};_0x32fe4d(++_0x26d407);}(_0xa2e7,0x1a2));var _0x7a2e=function(_0x3389b0,_0x508ec4){_0x3389b0=_0x3389b0-0x0;var _0x371308=_0xa2e7[_0x3389b0];return _0x371308;};'use strict';var moment=require(_0x7a2e('0x0'));var util=require(_0x7a2e('0x1'));var _=require(_0x7a2e('0x2'));var client=require('../client');exports[_0x7a2e('0x3')]=function(_0x217018){return client[_0x7a2e('0x4')](_0x7a2e('0x5'),{'body':_[_0x7a2e('0x6')](_0x217018,{'source':_0x217018[_0x7a2e('0x7')],'destinationcontext':_0x217018[_0x7a2e('0x8')],'callerid':_0x217018[_0x7a2e('0x9')],'amaflags':_0x7a2e('0xa')}),'log':_0x7a2e('0x5')});};exports[_0x7a2e('0xb')]=function(){return function(){return client[_0x7a2e('0x4')](_0x7a2e('0xc'),{'options':{'where':{'type':[_0x7a2e('0xd')],'createdAt':{'$between':[moment()[_0x7a2e('0xe')]('day')[_0x7a2e('0xf')](_0x7a2e('0x10')),moment()[_0x7a2e('0x11')]('day')['format'](_0x7a2e('0x10'))]}},'attributes':[_0x7a2e('0x12'),_0x7a2e('0x13'),_0x7a2e('0x14'),'billableseconds']},'log':_0x7a2e('0x15')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index c34e68f..a18ea52 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 _0x43d8=['create','CreateVoiceDialReport','../client'];(function(_0x8f0cac,_0x30ecab){var _0x243a6d=function(_0x2823f6){while(--_0x2823f6){_0x8f0cac['push'](_0x8f0cac['shift']());}};_0x243a6d(++_0x30ecab);}(_0x43d8,0x1af));var _0x843d=function(_0x246e1a,_0x30ee98){_0x246e1a=_0x246e1a-0x0;var _0x19a13c=_0x43d8[_0x246e1a];return _0x19a13c;};'use strict';var client=require(_0x843d('0x0'));exports[_0x843d('0x1')]=function(_0x38ffef){return client['Request']('CreateVoiceDialReport',{'body':_0x38ffef,'log':_0x843d('0x2')});}; \ No newline at end of file +var _0x8491=['create','CreateVoiceDialReport','../client'];(function(_0x1f5a63,_0x511504){var _0x30bb7a=function(_0x476310){while(--_0x476310){_0x1f5a63['push'](_0x1f5a63['shift']());}};_0x30bb7a(++_0x511504);}(_0x8491,0x1af));var _0x1849=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0x8491[_0x45d3f0];return _0x314b79;};'use strict';var client=require(_0x1849('0x0'));exports[_0x1849('0x1')]=function(_0x13c03a){return client['Request'](_0x1849('0x2'),{'body':_0x13c03a,'log':_0x1849('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 1cd4e71..3dd674a 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 _0x98e5=['GetVoiceExtension','exten','getVoiceExtensions'];(function(_0x16ed99,_0x40cd8f){var _0x3951be=function(_0x2bdcae){while(--_0x2bdcae){_0x16ed99['push'](_0x16ed99['shift']());}};_0x3951be(++_0x40cd8f);}(_0x98e5,0x8a));var _0x598e=function(_0x572499,_0x37619d){_0x572499=_0x572499-0x0;var _0x5466e3=_0x98e5[_0x572499];return _0x5466e3;};'use strict';var client=require('../client');exports['getVoiceExtensions']=function(){return function(){return client['Request'](_0x598e('0x0'),{'options':{'raw':!![],'attributes':['id',_0x598e('0x1'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0x598e('0x2')});};}; \ No newline at end of file +var _0x559a=['getVoiceExtensions','GetVoiceExtension','exten','recordingFormat','../client'];(function(_0x1b1668,_0x117297){var _0x220973=function(_0x32ac6b){while(--_0x32ac6b){_0x1b1668['push'](_0x1b1668['shift']());}};_0x220973(++_0x117297);}(_0x559a,0xb3));var _0xa559=function(_0x20f007,_0x1df8a9){_0x20f007=_0x20f007-0x0;var _0x222873=_0x559a[_0x20f007];return _0x222873;};'use strict';var client=require(_0xa559('0x0'));exports[_0xa559('0x1')]=function(){return function(){return client['Request'](_0xa559('0x2'),{'options':{'raw':!![],'attributes':['id',_0xa559('0x3'),_0xa559('0x4')],'where':{'VoiceExtensionId':null}},'log':_0xa559('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 0a7ab0b..fe3502d 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 _0xcbe6=['dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','monitor_format','strategy','dialRandomLastDigitCallerIdNumber','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','active','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','../client','getVoiceQueues','Request','name','acw','acwTimeout','autopause','type','dialMethod','dialLimitChannel','dialLimitQueue'];(function(_0x2b5513,_0x3fe5cd){var _0x578fd2=function(_0x7a9106){while(--_0x7a9106){_0x2b5513['push'](_0x2b5513['shift']());}};_0x578fd2(++_0x3fe5cd);}(_0xcbe6,0xa0));var _0x6cbe=function(_0x2311d1,_0x1fba61){_0x2311d1=_0x2311d1-0x0;var _0x34d612=_0xcbe6[_0x2311d1];return _0x34d612;};'use strict';var client=require(_0x6cbe('0x0'));exports[_0x6cbe('0x1')]=function(){return function(){return client[_0x6cbe('0x2')]('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0x6cbe('0x3'),_0x6cbe('0x4'),_0x6cbe('0x5'),_0x6cbe('0x6'),'monitor_format',_0x6cbe('0x7'),'dialActive',_0x6cbe('0x8'),_0x6cbe('0x9'),_0x6cbe('0xa'),_0x6cbe('0xb'),_0x6cbe('0xc'),_0x6cbe('0xd'),'dialPredictiveInterval','dialOriginateCallerIdName',_0x6cbe('0xe'),_0x6cbe('0xf'),_0x6cbe('0x10'),_0x6cbe('0x11'),'dialQueueProject',_0x6cbe('0x12'),_0x6cbe('0x13'),_0x6cbe('0x14'),'dialBusyRetryFrequency','dialNoAnswerMaxRetry',_0x6cbe('0x15'),_0x6cbe('0x16'),_0x6cbe('0x17'),'dialGlobalInterval','dialPrefix','dialCheckDuplicateType',_0x6cbe('0x18'),_0x6cbe('0x19'),_0x6cbe('0x1a'),_0x6cbe('0x1b'),_0x6cbe('0x1c'),_0x6cbe('0x1d'),_0x6cbe('0x1e'),'dialAMDMaximumNumberOfWords',_0x6cbe('0x1f'),_0x6cbe('0x20'),_0x6cbe('0x21'),_0x6cbe('0x22'),_0x6cbe('0x23'),_0x6cbe('0x24'),_0x6cbe('0x25'),'dialAgiAfterHangupClient','dialQueueProject2',_0x6cbe('0x26'),_0x6cbe('0x27'),_0x6cbe('0x28'),'dialCutDigit',_0x6cbe('0x29'),_0x6cbe('0x2a'),_0x6cbe('0x2b'),_0x6cbe('0x2c'),'dialAbandonedMaxRetry',_0x6cbe('0x2d'),'dialMachineMaxRetry',_0x6cbe('0x2e'),_0x6cbe('0x2f'),'dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold',_0x6cbe('0x30'),_0x6cbe('0x31'),_0x6cbe('0x32')],'include':[{'model':_0x6cbe('0x33'),'as':_0x6cbe('0x33'),'attributes':['id',_0x6cbe('0x3'),'callerid',_0x6cbe('0x34')]},{'model':'Pause','as':_0x6cbe('0x35'),'attributes':['id',_0x6cbe('0x3')]},{'model':'Trunk','as':_0x6cbe('0x36'),'attributes':['id',_0x6cbe('0x3'),'callerid',_0x6cbe('0x34')]},{'model':_0x6cbe('0x37'),'as':_0x6cbe('0x37'),'attributes':['id',_0x6cbe('0x3')],'include':[{'model':_0x6cbe('0x37'),'as':_0x6cbe('0x38'),'attributes':['id',_0x6cbe('0x3'),'interval']}]}]},'log':_0x6cbe('0x1')});};}; \ No newline at end of file +var _0x5fbd=['dialPredictiveIntervalMinThreshold','dialPreviewRecallmeReminder','Trunk','active','mandatoryDispositionPause','TrunkBackup','callerid','Interval','Intervals','interval','../client','getVoiceQueues','Request','GetVoiceQueue','name','acw','acwTimeout','autopause','monitor_format','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','dialQueueTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDMaximumWordLength','dialRecallMeTimeout','dialRecallInQueue','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','dialCutDigit','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialPredictiveIntervalMaxThreshold'];(function(_0x24e23d,_0x26684a){var _0x14db43=function(_0x23ff5a){while(--_0x23ff5a){_0x24e23d['push'](_0x24e23d['shift']());}};_0x14db43(++_0x26684a);}(_0x5fbd,0xea));var _0xd5fb=function(_0x36d9c2,_0x5b519b){_0x36d9c2=_0x36d9c2-0x0;var _0x62e4a0=_0x5fbd[_0x36d9c2];return _0x62e4a0;};'use strict';var client=require(_0xd5fb('0x0'));exports[_0xd5fb('0x1')]=function(){return function(){return client[_0xd5fb('0x2')](_0xd5fb('0x3'),{'options':{'raw':![],'attributes':['id',_0xd5fb('0x4'),_0xd5fb('0x5'),_0xd5fb('0x6'),_0xd5fb('0x7'),_0xd5fb('0x8'),'type',_0xd5fb('0x9'),_0xd5fb('0xa'),_0xd5fb('0xb'),_0xd5fb('0xc'),_0xd5fb('0xd'),_0xd5fb('0xe'),_0xd5fb('0xf'),'dialPredictiveInterval',_0xd5fb('0x10'),'dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions',_0xd5fb('0x11'),'dialQueueProject',_0xd5fb('0x12'),_0xd5fb('0x13'),_0xd5fb('0x14'),_0xd5fb('0x15'),_0xd5fb('0x16'),_0xd5fb('0x17'),'dialGlobalMaxRetry','dialTimezone',_0xd5fb('0x18'),_0xd5fb('0x19'),_0xd5fb('0x1a'),'dialAMDActive',_0xd5fb('0x1b'),_0xd5fb('0x1c'),_0xd5fb('0x1d'),'dialAMDTotalAnalysisTime',_0xd5fb('0x1e'),'dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold',_0xd5fb('0x1f'),'timeout',_0xd5fb('0x20'),_0xd5fb('0x21'),'dialOrderByScheduledAt',_0xd5fb('0x22'),_0xd5fb('0x23'),_0xd5fb('0x24'),_0xd5fb('0x8'),'strategy','dialRandomLastDigitCallerIdNumber',_0xd5fb('0x25'),_0xd5fb('0x26'),'dialNoSuchNumberRetryFrequency',_0xd5fb('0x27'),_0xd5fb('0x28'),'dialAbandonedMaxRetry',_0xd5fb('0x29'),_0xd5fb('0x2a'),'dialMachineRetryFrequency',_0xd5fb('0x2b'),_0xd5fb('0x2c'),'mandatoryDisposition',_0xd5fb('0x2d'),_0xd5fb('0x2e'),'dialPreviewAutoRecallMe',_0xd5fb('0x2f')],'include':[{'model':_0xd5fb('0x30'),'as':'Trunk','attributes':['id',_0xd5fb('0x4'),'callerid',_0xd5fb('0x31')]},{'model':'Pause','as':_0xd5fb('0x32'),'attributes':['id',_0xd5fb('0x4')]},{'model':_0xd5fb('0x30'),'as':_0xd5fb('0x33'),'attributes':['id',_0xd5fb('0x4'),_0xd5fb('0x34'),_0xd5fb('0x31')]},{'model':_0xd5fb('0x35'),'as':_0xd5fb('0x35'),'attributes':['id',_0xd5fb('0x4')],'include':[{'model':'Interval','as':_0xd5fb('0x36'),'attributes':['id','name',_0xd5fb('0x37')]}]}]},'log':'getVoiceQueues'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 034cb72..d821618 100644 --- a/server/services/ami/rpc/voiceQueueReport.js +++ b/server/services/ami/rpc/voiceQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['queuecallerexit','queuecallerexitAt','moment','lodash','../client','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt'];(function(_0x5646d2,_0x2c8547){var _0x2e7f3c=function(_0x49ab9a){while(--_0x49ab9a){_0x5646d2['push'](_0x5646d2['shift']());}};_0x2e7f3c(++_0x2c8547);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'use strict';var moment=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var client=require(_0x0a9e('0x2'));exports['create']=function(_0x550fbc){return client[_0x0a9e('0x3')]('CreateVoiceQueueReport',{'body':_0x550fbc,'log':_0x0a9e('0x4')});};exports[_0x0a9e('0x5')]=function(){return function(){return client[_0x0a9e('0x3')](_0x0a9e('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x0a9e('0x7')]('day')[_0x0a9e('0x8')](_0x0a9e('0x9')),moment()[_0x0a9e('0xa')]('day')['format'](_0x0a9e('0x9'))]}},'attributes':['uniqueid','queue',_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),_0x0a9e('0x10'),'queuecallerabandon','queuecallerabandonAt']},'log':'GetVoiceQueueReports'});};}; \ No newline at end of file +var _0xa9e0=['queuecallerexit','queuecallerexitAt','moment','lodash','../client','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt'];(function(_0x5efb21,_0x2737dd){var _0x3b743e=function(_0x595f42){while(--_0x595f42){_0x5efb21['push'](_0x5efb21['shift']());}};_0x3b743e(++_0x2737dd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'use strict';var moment=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var client=require(_0x0a9e('0x2'));exports['create']=function(_0x550fbc){return client[_0x0a9e('0x3')]('CreateVoiceQueueReport',{'body':_0x550fbc,'log':_0x0a9e('0x4')});};exports[_0x0a9e('0x5')]=function(){return function(){return client[_0x0a9e('0x3')](_0x0a9e('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x0a9e('0x7')]('day')[_0x0a9e('0x8')](_0x0a9e('0x9')),moment()[_0x0a9e('0xa')]('day')['format'](_0x0a9e('0x9'))]}},'attributes':['uniqueid','queue',_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),_0x0a9e('0x10'),'queuecallerabandon','queuecallerabandonAt']},'log':'GetVoiceQueueReports'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueRt.js b/server/services/ami/rpc/voiceQueueRt.js index f639754..ad159f2 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 _0x902e=['Request','getVoiceQueueRtPauses'];(function(_0x3c7e60,_0x385db7){var _0x2917f5=function(_0x75252a){while(--_0x75252a){_0x3c7e60['push'](_0x3c7e60['shift']());}};_0x2917f5(++_0x385db7);}(_0x902e,0xc1));var _0xe902=function(_0x1a1d96,_0x25de12){_0x1a1d96=_0x1a1d96-0x0;var _0x2d846c=_0x902e[_0x1a1d96];return _0x2d846c;};'use strict';var client=require('../client');exports[_0xe902('0x0')]=function(_0x97f717){return function(){return client[_0xe902('0x1')]('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x97f717,'paused':!![]},'raw':!![]},'log':_0xe902('0x0')});};}; \ No newline at end of file +var _0x3828=['../client','getVoiceQueueRtPauses','Request'];(function(_0x26b8b5,_0xf5c2c1){var _0x2150a9=function(_0x1ca1be){while(--_0x1ca1be){_0x26b8b5['push'](_0x26b8b5['shift']());}};_0x2150a9(++_0xf5c2c1);}(_0x3828,0x9c));var _0x8382=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x3828[_0x18ab2a];return _0x16dcee;};'use strict';var client=require(_0x8382('0x0'));exports[_0x8382('0x1')]=function(_0xad5bfd){return function(){return client[_0x8382('0x2')]('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0xad5bfd,'paused':!![]},'raw':!![]},'log':_0x8382('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 137a647..2c6ae02 100644 --- a/server/services/ami/rpc/voiceRecording.js +++ b/server/services/ami/rpc/voiceRecording.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x3a3640,_0xc55a8b){var _0x291ea3=function(_0x2ee2a8){while(--_0x2ee2a8){_0x3a3640['push'](_0x3a3640['shift']());}};_0x291ea3(++_0xc55a8b);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file +var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x39b910,_0x37d405){var _0x5e26d4=function(_0x1a8e7f){while(--_0x1a8e7f){_0x39b910['push'](_0x39b910['shift']());}};_0x5e26d4(++_0x37d405);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index e9dd978..5b86f31 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 _0xc82d=['transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','extension','attendedTransfer','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','transfers','Request','CreateVoiceTransferReport','transfererchannel','transferercalleridnum','transfererconnectedlinenum','transfererconnectedlinename','transferercontext','transfererexten','transfereecalleridnum'];(function(_0x27dc8d,_0x1f0639){var _0x3f7fd4=function(_0x3ca25d){while(--_0x3ca25d){_0x27dc8d['push'](_0x27dc8d['shift']());}};_0x3f7fd4(++_0x1f0639);}(_0xc82d,0xb4));var _0xdc82=function(_0x5c8edb,_0x105253){_0x5c8edb=_0x5c8edb-0x0;var _0x5a1451=_0xc82d[_0x5c8edb];return _0x5a1451;};'use strict';var client=require('../client');exports[_0xdc82('0x0')]={};exports['blindTransfer']=function(_0xa0f67){return client[_0xdc82('0x1')](_0xdc82('0x2'),{'body':{'result':_0xa0f67['result'],'transfererchannel':_0xa0f67[_0xdc82('0x3')],'transferercalleridnum':_0xa0f67[_0xdc82('0x4')],'transferercalleridname':_0xa0f67['transferercalleridname'],'transfererconnectedlinenum':_0xa0f67[_0xdc82('0x5')],'transfererconnectedlinename':_0xa0f67[_0xdc82('0x6')],'transfereraccountcode':_0xa0f67['transfereraccountcode'],'transferercontext':_0xa0f67[_0xdc82('0x7')],'transfererexten':_0xa0f67[_0xdc82('0x8')],'transfererlinkedid':_0xa0f67['transfererlinkedid'],'transfereechannel':_0xa0f67['transfereechannel'],'transfereecalleridnum':_0xa0f67[_0xdc82('0x9')],'transfereecalleridname':_0xa0f67[_0xdc82('0xa')],'transfereeconnectedlinenum':_0xa0f67[_0xdc82('0xb')],'transfereeconnectedlinename':_0xa0f67[_0xdc82('0xc')],'transfereeaccountcode':_0xa0f67[_0xdc82('0xd')],'transfereecontext':_0xa0f67[_0xdc82('0xe')],'transfereeexten':_0xa0f67[_0xdc82('0xf')],'transfereelinkedid':_0xa0f67[_0xdc82('0x10')],'isexternal':_0xa0f67[_0xdc82('0x11')],'context':_0xa0f67[_0xdc82('0x12')],'extension':_0xa0f67[_0xdc82('0x13')],'type':'blind'},'log':_0xdc82('0x2')});};exports[_0xdc82('0x14')]=function(_0x67fcc9){return client[_0xdc82('0x1')](_0xdc82('0x2'),{'body':{'result':_0x67fcc9['result'],'transfererchannel':_0x67fcc9[_0xdc82('0x15')],'transferercalleridnum':_0x67fcc9['origtransferercalleridnum'],'transferercalleridname':_0x67fcc9[_0xdc82('0x16')],'transfererconnectedlinenum':_0x67fcc9[_0xdc82('0x17')],'transfererconnectedlinename':_0x67fcc9[_0xdc82('0x18')],'transfereraccountcode':_0x67fcc9[_0xdc82('0x19')],'transferercontext':_0x67fcc9[_0xdc82('0x1a')],'transfererexten':_0x67fcc9['secondtransfererexten'],'transfererlinkedid':_0x67fcc9[_0xdc82('0x1b')],'transfereechannel':_0x67fcc9['transfertargetchannel'],'transfereecalleridnum':_0x67fcc9[_0xdc82('0x1c')],'transfereecalleridname':_0x67fcc9[_0xdc82('0x1d')],'transfereeconnectedlinenum':_0x67fcc9['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x67fcc9[_0xdc82('0x1e')],'transfereeaccountcode':_0x67fcc9[_0xdc82('0x1f')],'transfereecontext':_0x67fcc9[_0xdc82('0x20')],'transfereeexten':_0x67fcc9[_0xdc82('0x21')],'transfereelinkedid':_0x67fcc9[_0xdc82('0x22')],'isexternal':_0x67fcc9[_0xdc82('0x11')],'context':_0x67fcc9[_0xdc82('0x23')],'extension':_0x67fcc9[_0xdc82('0x24')],'type':_0xdc82('0x25')},'log':_0xdc82('0x2')});}; \ No newline at end of file +var _0xa0e5=['transfereecalleridnum','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereelinkedid','isexternal','extension','blind','attendedTransfer','Request','CreateVoiceTransferReport','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','transfers','blindTransfer','result','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel'];(function(_0x427352,_0x1bce61){var _0x23e0e6=function(_0x2a42a9){while(--_0x2a42a9){_0x427352['push'](_0x427352['shift']());}};_0x23e0e6(++_0x1bce61);}(_0xa0e5,0xc7));var _0x5a0e=function(_0x48810e,_0x58493b){_0x48810e=_0x48810e-0x0;var _0x45a3db=_0xa0e5[_0x48810e];return _0x45a3db;};'use strict';var client=require('../client');exports[_0x5a0e('0x0')]={};exports[_0x5a0e('0x1')]=function(_0xbf51ab){return client['Request']('CreateVoiceTransferReport',{'body':{'result':_0xbf51ab[_0x5a0e('0x2')],'transfererchannel':_0xbf51ab['transfererchannel'],'transferercalleridnum':_0xbf51ab[_0x5a0e('0x3')],'transferercalleridname':_0xbf51ab[_0x5a0e('0x4')],'transfererconnectedlinenum':_0xbf51ab[_0x5a0e('0x5')],'transfererconnectedlinename':_0xbf51ab['transfererconnectedlinename'],'transfereraccountcode':_0xbf51ab[_0x5a0e('0x6')],'transferercontext':_0xbf51ab[_0x5a0e('0x7')],'transfererexten':_0xbf51ab[_0x5a0e('0x8')],'transfererlinkedid':_0xbf51ab[_0x5a0e('0x9')],'transfereechannel':_0xbf51ab[_0x5a0e('0xa')],'transfereecalleridnum':_0xbf51ab[_0x5a0e('0xb')],'transfereecalleridname':_0xbf51ab['transfereecalleridname'],'transfereeconnectedlinenum':_0xbf51ab[_0x5a0e('0xc')],'transfereeconnectedlinename':_0xbf51ab[_0x5a0e('0xd')],'transfereeaccountcode':_0xbf51ab[_0x5a0e('0xe')],'transfereecontext':_0xbf51ab[_0x5a0e('0xf')],'transfereeexten':_0xbf51ab['transfereeexten'],'transfereelinkedid':_0xbf51ab[_0x5a0e('0x10')],'isexternal':_0xbf51ab[_0x5a0e('0x11')],'context':_0xbf51ab['context'],'extension':_0xbf51ab[_0x5a0e('0x12')],'type':_0x5a0e('0x13')},'log':'CreateVoiceTransferReport'});};exports[_0x5a0e('0x14')]=function(_0xc69de4){return client[_0x5a0e('0x15')](_0x5a0e('0x16'),{'body':{'result':_0xc69de4[_0x5a0e('0x2')],'transfererchannel':_0xc69de4[_0x5a0e('0x17')],'transferercalleridnum':_0xc69de4[_0x5a0e('0x18')],'transferercalleridname':_0xc69de4[_0x5a0e('0x19')],'transfererconnectedlinenum':_0xc69de4['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0xc69de4[_0x5a0e('0x1a')],'transfereraccountcode':_0xc69de4[_0x5a0e('0x1b')],'transferercontext':_0xc69de4[_0x5a0e('0x1c')],'transfererexten':_0xc69de4['secondtransfererexten'],'transfererlinkedid':_0xc69de4[_0x5a0e('0x1d')],'transfereechannel':_0xc69de4[_0x5a0e('0x1e')],'transfereecalleridnum':_0xc69de4[_0x5a0e('0x1f')],'transfereecalleridname':_0xc69de4[_0x5a0e('0x20')],'transfereeconnectedlinenum':_0xc69de4[_0x5a0e('0x21')],'transfereeconnectedlinename':_0xc69de4[_0x5a0e('0x22')],'transfereeaccountcode':_0xc69de4[_0x5a0e('0x23')],'transfereecontext':_0xc69de4[_0x5a0e('0x24')],'transfereeexten':_0xc69de4[_0x5a0e('0x25')],'transfereelinkedid':_0xc69de4[_0x5a0e('0x26')],'isexternal':_0xc69de4['isexternal'],'context':_0xc69de4[_0x5a0e('0x27')],'extension':_0xc69de4[_0x5a0e('0x28')],'type':_0x5a0e('0x29')},'log':_0x5a0e('0x16')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index b27dded..c4c8b55 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 _0x3e74=['omit','undefined','values','channels','length','voicechannel','uniqueid','channel','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','push','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','map','resolve','destinationchannel','stop','filename','wav','StopMixMonitor\x20Success','queueChannels','type','inbound','includes','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','rows','voicequeuechannel','voicequeuechannelhangup','context','telephones','trunks','campaigns','run','emit','custom:','checkAfterSend','server','http','log','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','validate','moment','../ami','listen','format','SIP','timers','agents','pause','QueuePause','isConnected','error','asterisk','ami\x20disconnected','join','pick','keys','action','Reload','Action','message','catch','username','command','Command','then','content','voiceQueues','hasOwnProperty','find'];(function(_0x4c3527,_0xfc29f7){var _0x2de12a=function(_0x553d2c){while(--_0x553d2c){_0x4c3527['push'](_0x4c3527['shift']());}};_0x2de12a(++_0xfc29f7);}(_0x3e74,0x175));var _0x43e7=function(_0x2ccdd0,_0x10aaf9){_0x2ccdd0=_0x2ccdd0-0x0;var _0x51677c=_0x3e74[_0x2ccdd0];return _0x51677c;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var jayson=require(_0x43e7('0x1'));var schema=require(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var config=require('../../../config/environment');var properties=require('../properties');var ami=require(_0x43e7('0x4'));var VoiceQueueSummary=require('../model/voiceQueueSummary');exports[_0x43e7('0x5')]=function(_0xe838b4,_0xe78cb7,_0x1c503b){return new Promise(function(_0xc98b9c,_0x503698){var _0x45a0d1={'QueuePause':function(_0x3491d6){return new Promise(function(_0x2ede2d){var _0x8528fc=util[_0x43e7('0x6')]('%s/%s',_0x43e7('0x7'),_0x3491d6['name']);if(_0xe838b4['timers']&&_0xe838b4[_0x43e7('0x8')][_0x8528fc]&&_0xe838b4[_0x43e7('0x8')][_0x8528fc]['timer']){_0xe838b4[_0x43e7('0x8')][_0x8528fc]['updateAcw']();}if(_0xe838b4[_0x43e7('0x9')][_0x8528fc]){_0xe838b4[_0x43e7('0x9')][_0x8528fc]['updateStatusRealtime']({'statePause':_0x3491d6[_0x43e7('0xa')]?!![]:![]});}_0x2ede2d({'code':0xc8,'message':_0x43e7('0xb')});});},'Reload':function(_0x2718d3){var _0x3bb83f=this;return new Promise(function(_0x4e008c,_0x583d85){if(ami[_0x43e7('0xc')]()==![]){return _0x583d85(_0x3bb83f[_0x43e7('0xd')](0x1f4,[config[_0x43e7('0xe')]['ip'],config['asterisk']['username'],_0x43e7('0xf')][_0x43e7('0x10')]('\x20')));}_0x2718d3=_[_0x43e7('0x11')](_0x2718d3,_[_0x43e7('0x12')](properties['reload']['module']));_0x2718d3[_0x43e7('0x13')]=_0x43e7('0x14');return ami[_0x43e7('0x15')](_0x2718d3)['then'](function(_0x4b5a6b){_0x4e008c({'code':0xc8,'message':_0x4b5a6b[_0x43e7('0x16')]});})[_0x43e7('0x17')](function(_0x9037d3){_0x583d85(_0x3bb83f[_0x43e7('0xd')](0x1f5,_0x9037d3[_0x43e7('0x16')]));});});},'Command':function(_0x1f24fb){var _0x619236=this;return new Promise(function(_0x1441ef,_0x2377a3){if(ami[_0x43e7('0xc')]()==![]){return _0x2377a3(_0x619236[_0x43e7('0xd')](0x1f4,[config[_0x43e7('0xe')]['ip'],config['asterisk'][_0x43e7('0x18')],_0x43e7('0xf')]['join']('\x20')));}_0x1f24fb=_[_0x43e7('0x11')](_0x1f24fb,_0x43e7('0x19'));_0x1f24fb[_0x43e7('0x13')]=_0x43e7('0x1a');return ami[_0x43e7('0x15')](_0x1f24fb)[_0x43e7('0x1b')](function(_0x54a9e7){_0x1441ef({'code':0xc8,'message':_0x54a9e7[_0x43e7('0x1c')]});})['catch'](function(_0x4c9df3){_0x2377a3(_0x619236[_0x43e7('0xd')](0x1f5,_0x4c9df3[_0x43e7('0x16')]));});});},'VoiceQueues':function(){return new Promise(function(_0x4b2b9f){var _0x1f0673=[];for(var _0x4ca5cf in _0xe838b4[_0x43e7('0x1d')]){if(_0xe838b4['voiceQueues'][_0x43e7('0x1e')](_0x4ca5cf)){var _0x1b5f50=_0xe838b4[_0x43e7('0x1d')][_0x4ca5cf];var _0x405f85=new VoiceQueueSummary(_0x1b5f50);_0x1f0673['push'](_0x405f85);}}_0x4b2b9f({'count':_0x1f0673['length'],'rows':_0x1f0673});});},'UpdateVoiceQueue':function(_0x805b54){return new Promise(function(_0x501551,_0x2dd5f){var _0x40dc8f=_[_0x43e7('0x1f')](_0xe838b4[_0x43e7('0x1d')],{'id':parseInt(_0x805b54['id'])});var _0x5087d7=_[_0x43e7('0x20')](_0x805b54,['id']);if(_0x40dc8f){for(var _0x4690a6 in _0x5087d7){if(typeof _0x5087d7[_0x4690a6]!==_0x43e7('0x21')&&typeof _0x40dc8f[_0x4690a6]!==_0x43e7('0x21')){_0x40dc8f[_0x4690a6]=_0x5087d7[_0x4690a6];}}_0x501551(_0x40dc8f);}else{_0x2dd5f();}});},'VoiceChannels':function(){return new Promise(function(_0x442c3b){var _0x84dd4d=_[_0x43e7('0x22')](_0xe838b4[_0x43e7('0x23')]);_0x442c3b({'count':_0x84dd4d[_0x43e7('0x24')],'rows':_0x84dd4d});});},'VoiceChannelMixMonitor':function(_0x35dbcd){var _0x17df44=this;return new Promise(function(_0x19725a,_0x2bde44){if(ami[_0x43e7('0xc')]()==![]){return _0x2bde44(_0x17df44['error'](0x1f4,[config[_0x43e7('0xe')]['ip'],config[_0x43e7('0xe')][_0x43e7('0x18')],_0x43e7('0xf')][_0x43e7('0x10')]('\x20')));}var _0x4c8650=schema(properties[_0x43e7('0x25')])[_0x43e7('0x2')](_0x35dbcd);if(_0x4c8650[_0x43e7('0x24')]>0x0){return _0x2bde44(_0x17df44[_0x43e7('0xd')](0x1f4,_['map'](_0x4c8650,'message')['join'](',\x20')));}var _0xf8320=_[_0x43e7('0x1f')](_0xe838b4[_0x43e7('0x23')],{'uniqueid':_0x35dbcd[_0x43e7('0x26')]});if(_0xf8320&&_0xf8320[_0x43e7('0x27')]){var _0xde7ed=util['format']('%s.%s',_0x35dbcd['filename']||_0x35dbcd['uniqueid'],_0x35dbcd['format']||'wav');return ami['Action']({'action':_0x43e7('0x28'),'channel':_0xf8320['channel'],'file':_0xde7ed,'options':_0x43e7('0x29')})[_0x43e7('0x1b')](function(_0x31bc78){var _0x50a2d0=_[_0x43e7('0x1f')](_0xf8320[_0x43e7('0x2a')],{'filename':_0x43e7('0x2b')+_0xde7ed['toLowerCase']()});if(_['isNil'](_0x50a2d0)){_0xf8320['monitors'][_0x43e7('0x2c')]({'filename':_0x43e7('0x2b')+_0xde7ed[_0x43e7('0x2d')](),'createdAt':moment()[_0x43e7('0x6')](_0x43e7('0x2e')),'mixmonitorid':_0x31bc78[_0x43e7('0x2f')],'status':_0x43e7('0x30')});}else{_0x50a2d0[_0x43e7('0x2f')]=_0x31bc78['mixmonitorid'];_0x50a2d0[_0x43e7('0x31')]=_0x43e7('0x30');}_0x19725a({'code':0xc8,'message':[_0x35dbcd['uniqueid'],_0x43e7('0x32'),_0x31bc78['mixmonitorid']][_0x43e7('0x10')]('\x20'),'mixmonitorid':_0x31bc78[_0x43e7('0x2f')]});})[_0x43e7('0x17')](function(_0x353852){_0x2bde44(_0x17df44[_0x43e7('0xd')](0x1f5,[_0x35dbcd[_0x43e7('0x26')],_0x353852['message']['toLowerCase']()][_0x43e7('0x10')]('\x20')));});}else{return _0x2bde44(_0x17df44[_0x43e7('0xd')](0x1f5,_0x43e7('0x33')));}});},'VoiceChannelStopMixMonitor':function(_0xc8ffa5){var _0x127d77=this;return new Promise(function(_0x4a4a85,_0x32a451){if(ami[_0x43e7('0xc')]()==![]){return _0x32a451(_0x127d77['error'](0x1f4,[config[_0x43e7('0xe')]['ip'],config['asterisk'][_0x43e7('0x18')],'ami\x20disconnected'][_0x43e7('0x10')]('\x20')));}var _0x3b4235=schema(properties[_0x43e7('0x25')])[_0x43e7('0x2')](_0xc8ffa5);if(_0x3b4235['length']>0x0){return _0x32a451(_0x127d77['error'](0x1f4,_[_0x43e7('0x34')](_0x3b4235,_0x43e7('0x16'))[_0x43e7('0x10')](',\x20')));}var _0x36b770=_['find'](_0xe838b4['channels'],{'uniqueid':_0xc8ffa5['uniqueid']});if(_0x36b770){return Promise[_0x43e7('0x35')]()['then'](function(){if(_0x36b770[_0x43e7('0x27')]){return ami['Action']({'action':'StopMixMonitor','channel':_0x36b770[_0x43e7('0x27')],'mixmonitorid':_0xc8ffa5['mixmonitorid']})[_0x43e7('0x17')](function(){});}})[_0x43e7('0x1b')](function(){if(_0x36b770[_0x43e7('0x36')]){return ami[_0x43e7('0x15')]({'action':'StopMixMonitor','channel':_0x36b770[_0x43e7('0x36')],'mixmonitorid':_0xc8ffa5[_0x43e7('0x2f')]})[_0x43e7('0x17')](function(){});}})[_0x43e7('0x1b')](function(){var _0x296dc8=_[_0x43e7('0x1f')](_0x36b770['monitors'],{'mixmonitorid':_0xc8ffa5['mixmonitorid']});if(_0x296dc8){_0x296dc8[_0x43e7('0x31')]=_0x43e7('0x37');}})[_0x43e7('0x1b')](function(){var _0x4c00a8=util['format']('%s.%s',_0xc8ffa5[_0x43e7('0x38')]||_0xc8ffa5[_0x43e7('0x26')],_0xc8ffa5['format']||_0x43e7('0x39'));var _0x47686e=_[_0x43e7('0x1f')](_0x36b770['monitors'],{'filename':'/var/spool/asterisk/monitor/'+_0x4c00a8['toLowerCase']()});if(_0x47686e){_0x47686e['status']=_0x43e7('0x37');}})[_0x43e7('0x1b')](function(){_0x4a4a85({'code':0xc8,'message':[_0xc8ffa5['uniqueid'],_0x43e7('0x3a')][_0x43e7('0x10')]('\x20')});})[_0x43e7('0x17')](function(_0x895f41){_0x32a451(_0x127d77['error'](0x1f5,[_0xc8ffa5[_0x43e7('0x26')],_0x895f41['message']['toLowerCase']()][_0x43e7('0x10')]('\x20')));});}else{return _0x32a451(_0x127d77[_0x43e7('0xd')](0x1f5,_0x43e7('0x33')));}});},'VoiceQueuesChannels':function(_0x45e4e7){var _0x13503c=this;return new Promise(function(_0x2351cf){var _0x1cd87c=_[_0x43e7('0x22')](_0xe838b4[_0x43e7('0x3b')]);var _0x2b5515={'count':_0x1cd87c['length'],'rows':_0x1cd87c};if(_0x45e4e7&&_0x45e4e7[_0x43e7('0x3c')]){if(![_0x43e7('0x3d'),'outbound'][_0x43e7('0x3e')](_0x45e4e7['type'])){return _0x503698(_0x13503c[_0x43e7('0xd')](0x190,_0x43e7('0x3f')));}var _0x34e2ec=_[_0x43e7('0x40')](_0x1cd87c,function(_0xfe13fa){return _0xfe13fa['type']===_0x45e4e7['type'];});_0x2b5515[_0x43e7('0x41')]=_0x34e2ec[_0x43e7('0x24')];_0x2b5515[_0x43e7('0x42')]=_0x34e2ec;}_0x2351cf(_0x2b5515);});},'VoiceQueuesChannel':function(_0x29c53d){var _0x23d835=this;return new Promise(function(_0x25bb44,_0xa47464){var _0x44f8a0=schema(properties[_0x43e7('0x43')])[_0x43e7('0x2')](_0x29c53d);if(_0x44f8a0[_0x43e7('0x24')]>0x0){return _0xa47464(_0x23d835['error'](0x1f4,_[_0x43e7('0x34')](_0x44f8a0,_0x43e7('0x16'))['join'](',\x20')));}var _0x4314d8=_[_0x43e7('0x1f')](_0xe838b4[_0x43e7('0x3b')],{'uniqueid':_0x29c53d['uniqueid']});if(_0x4314d8){_0x25bb44(_0x4314d8);}else{return _0xa47464(_0x23d835['error'](0x1f5,_0x43e7('0x33')));}});},'VoiceQueuesChannelHangup':function(_0x3d9a29){var _0x4ebdde=this;return new Promise(function(_0x283dd8,_0x54506d){if(ami['isConnected']()==![]){return _0x54506d(_0x4ebdde[_0x43e7('0xd')](0x1f4,[config[_0x43e7('0xe')]['ip'],config[_0x43e7('0xe')][_0x43e7('0x18')],_0x43e7('0xf')]['join']('\x20')));}var _0xc3976=schema(properties[_0x43e7('0x44')])['validate'](_0x3d9a29);if(_0xc3976[_0x43e7('0x24')]>0x0){return _0x54506d(_0x4ebdde[_0x43e7('0xd')](0x1f4,_[_0x43e7('0x34')](_0xc3976,'message')['join'](',\x20')));}var _0x557a47=_[_0x43e7('0x1f')](_0xe838b4[_0x43e7('0x3b')],{'uniqueid':_0x3d9a29[_0x43e7('0x26')]});if(_0x557a47&&_0x557a47[_0x43e7('0x27')]){return ami['Action']({'action':'Hangup','channel':_0x557a47[_0x43e7('0x27')]})[_0x43e7('0x1b')](function(_0x140438){_0x283dd8({'code':0xc8,'message':[_0x3d9a29[_0x43e7('0x26')],_0x140438['message'][_0x43e7('0x2d')]()][_0x43e7('0x10')]('\x20')});})[_0x43e7('0x17')](function(_0x2a194d){_0x54506d(_0x4ebdde[_0x43e7('0xd')](0x1f5,[_0x3d9a29[_0x43e7('0x26')],_0x2a194d[_0x43e7('0x16')][_0x43e7('0x2d')]()][_0x43e7('0x10')]('\x20')));});}else{return _0x54506d(_0x4ebdde[_0x43e7('0xd')](0x1f5,_0x43e7('0x33')));}});},'VoiceQueuesChannelRedirect':function(_0x57fdfe){var _0x5f3824=this;return new Promise(function(_0x2b0711,_0x58a3a8){if(ami['isConnected']()==![]){return _0x58a3a8(_0x5f3824['error'](0x1f4,[config[_0x43e7('0xe')]['ip'],config[_0x43e7('0xe')]['username'],_0x43e7('0xf')][_0x43e7('0x10')]('\x20')));}var _0x1d8438=schema(properties['voicequeuechannelredirect'])[_0x43e7('0x2')](_0x57fdfe);if(_0x1d8438[_0x43e7('0x24')]>0x0){return _0x58a3a8(_0x5f3824[_0x43e7('0xd')](0x1f4,_[_0x43e7('0x34')](_0x1d8438,_0x43e7('0x16'))[_0x43e7('0x10')](',\x20')));}var _0x1e02fa=_['find'](_0xe838b4[_0x43e7('0x3b')],{'uniqueid':_0x57fdfe[_0x43e7('0x26')]});if(_0x1e02fa&&_0x1e02fa[_0x43e7('0x27')]){return ami['Action']({'action':'Redirect','channel':_0x1e02fa[_0x43e7('0x27')],'exten':_0x57fdfe['exten'],'context':_0x57fdfe['context']||_0x1e02fa[_0x43e7('0x45')],'priority':0x1})[_0x43e7('0x1b')](function(_0x5b5833){_0x2b0711({'code':0xc8,'message':[_0x57fdfe[_0x43e7('0x26')],_0x5b5833[_0x43e7('0x16')][_0x43e7('0x2d')]()][_0x43e7('0x10')]('\x20')});})[_0x43e7('0x17')](function(_0x13ef5c){_0x58a3a8(_0x5f3824[_0x43e7('0xd')](0x1f5,[_0x57fdfe['uniqueid'],_0x13ef5c[_0x43e7('0x16')][_0x43e7('0x2d')]()]['join']('\x20')));});}else{return _0x58a3a8(_0x5f3824[_0x43e7('0xd')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x26ee52){return new Promise(function(_0x248936){var _0x37301b=_[_0x43e7('0x22')](_0xe838b4['agents']);if(_0x26ee52&&_0x26ee52['id']){var _0x2d25b5=_[_0x43e7('0x1f')](_0x37301b,function(_0xf929a5){return _0xf929a5['id']===_0x26ee52['id'];});_0x248936(_0x2d25b5);}else{_0x248936({'count':_0x37301b['length'],'rows':_0x37301b});}});},'Telephones':function(){return new Promise(function(_0x17889c){var _0x38fa5b=_[_0x43e7('0x22')](_0xe838b4[_0x43e7('0x46')]);_0x17889c({'count':_0x38fa5b[_0x43e7('0x24')],'rows':_0x38fa5b});});},'Trunks':function(){return new Promise(function(_0x5f50d6){var _0xb51897=_[_0x43e7('0x22')](_0xe838b4[_0x43e7('0x47')]);_0x5f50d6({'count':_0xb51897[_0x43e7('0x24')],'rows':_0xb51897});});},'OutboundChannels':function(){return new Promise(function(_0x433d3c){var _0x8122f4=_[_0x43e7('0x22')](_0xe838b4['outboundChannels']);_0x433d3c({'count':_0x8122f4['length'],'rows':_0x8122f4});});},'Outbound':function(){return new Promise(function(_0x405faa){_0x405faa(_0xe838b4['outbound']);});},'Campaigns':function(){return new Promise(function(_0x550036){var _0x5b98bf=_[_0x43e7('0x22')](_0xe838b4[_0x43e7('0x48')]);_0x550036({'count':_0x5b98bf[_0x43e7('0x24')],'rows':_0x5b98bf});});},'VoiceQueuesPreview':function(_0x3041c3){var _0x18713b=this;return new Promise(function(_0x1ae0c8,_0x594315){_0xe78cb7[_0x43e7('0x49')](_0x3041c3['id'])[_0x43e7('0x1b')](function(_0x2cd420){_0x1ae0c8({'code':0xc8,'message':_0x2cd420['message']});})[_0x43e7('0x17')](function(_0xea84ec){_0x594315(_0x18713b[_0x43e7('0xd')](0x1f4,_0xea84ec[_0x43e7('0x16')]));});});},'EventManager':function(_0x1afea6){var _0xeb6340=this;return new Promise(function(_0x1d4a29,_0x819686){if(!_0x1afea6['event']){return _0x819686(_0xeb6340['error'](0x1f4,'Event\x20name\x20mandatory'));}ami[_0x43e7('0x4a')](_0x43e7('0x4b')+_0x1afea6['event'],_0x1afea6[_0x43e7('0x16')]);_0x1d4a29({'code':0xc8,'message':_0x1afea6});});},'FaxAccounts':function(){return new Promise(function(_0x39a787){var _0x41a18f=_[_0x43e7('0x22')](_0xe838b4['faxAccounts']);_0x39a787({'count':_0x41a18f['length'],'rows':_0x41a18f});});},'SendFax':function(_0x5f5ac9){var _0x177a7a=this;return new Promise(function(_0x2314a3,_0x508566){_0x1c503b['send'](_0x5f5ac9)[_0x43e7('0x1b')](function(_0x190125){_0x2314a3({'code':0xc8,'message':_0x190125[_0x43e7('0x16')]});})['catch'](function(_0x80334){_0x508566(_0x177a7a[_0x43e7('0xd')](0x1f4,_0x80334[_0x43e7('0x16')]));});});},'CheckAfterSend':function(_0xb04082){var _0x48f1dc=this;return new Promise(function(_0x1d7048,_0x520943){_0x1c503b[_0x43e7('0x4c')](_0xb04082)[_0x43e7('0x1b')](function(_0x24a168){_0x1d7048({'code':0xc8,'message':_0x24a168[_0x43e7('0x16')]});})[_0x43e7('0x17')](function(_0x45adef){_0x520943(_0x48f1dc[_0x43e7('0xd')](0x1f4,_0x45adef['message']));});});}};var _0x109c86=jayson[_0x43e7('0x4d')](_0x45a0d1)[_0x43e7('0x4e')]();_0x109c86['on'](_0x43e7('0xd'),function(_0x550960){return _0x503698(_0x550960);});_0x109c86['listen'](0x232a,'127.0.0.1',function(){console[_0x43e7('0x4f')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0xc98b9c(_0x43e7('0x50')+0x232a);});});}; \ No newline at end of file +var _0xb66c=['asterisk','ami\x20disconnected','pick','module','action','Reload','Action','message','catch','join','command','Command','then','content','voiceQueues','hasOwnProperty','push','length','find','omit','undefined','values','username','voicechannel','map','uniqueid','channel','format','filename','wav','MixMonitor','ai(mixmonitorid)','isNil','monitors','/var/spool/asterisk/monitor/','toLowerCase','mixmonitorid','status','rec','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','validate','channels','resolve','destinationchannel','StopMixMonitor','stop','%s.%s','StopMixMonitor\x20Success','queueChannels','inbound','outbound','includes','type','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','rows','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outboundChannels','campaigns','run','event','Event\x20name\x20mandatory','custom:','server','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','moment','../../../config/environment','../properties','../model/voiceQueueSummary','listen','%s/%s','SIP','name','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','isConnected','error'];(function(_0x494d1f,_0x3f72ff){var _0x457b6e=function(_0x38cb16){while(--_0x38cb16){_0x494d1f['push'](_0x494d1f['shift']());}};_0x457b6e(++_0x3f72ff);}(_0xb66c,0x175));var _0xcb66=function(_0xe384c5,_0x32fe8a){_0xe384c5=_0xe384c5-0x0;var _0x1ba1eb=_0xb66c[_0xe384c5];return _0x1ba1eb;};'use strict';var _=require(_0xcb66('0x0'));var util=require('util');var jayson=require(_0xcb66('0x1'));var schema=require('validate');var moment=require(_0xcb66('0x2'));var config=require(_0xcb66('0x3'));var properties=require(_0xcb66('0x4'));var ami=require('../ami');var VoiceQueueSummary=require(_0xcb66('0x5'));exports[_0xcb66('0x6')]=function(_0x3f7cc7,_0x21be55,_0x5d766d){return new Promise(function(_0x518163,_0x19adf5){var _0x1b6852={'QueuePause':function(_0xa3993){return new Promise(function(_0x439f3d){var _0xf7bc39=util['format'](_0xcb66('0x7'),_0xcb66('0x8'),_0xa3993[_0xcb66('0x9')]);if(_0x3f7cc7[_0xcb66('0xa')]&&_0x3f7cc7[_0xcb66('0xa')][_0xf7bc39]&&_0x3f7cc7['timers'][_0xf7bc39][_0xcb66('0xb')]){_0x3f7cc7[_0xcb66('0xa')][_0xf7bc39][_0xcb66('0xc')]();}if(_0x3f7cc7[_0xcb66('0xd')][_0xf7bc39]){_0x3f7cc7['agents'][_0xf7bc39][_0xcb66('0xe')]({'statePause':_0xa3993[_0xcb66('0xf')]?!![]:![]});}_0x439f3d({'code':0xc8,'message':_0xcb66('0x10')});});},'Reload':function(_0x2339bb){var _0x582523=this;return new Promise(function(_0x4079ae,_0x40c810){if(ami[_0xcb66('0x11')]()==![]){return _0x40c810(_0x582523[_0xcb66('0x12')](0x1f4,[config['asterisk']['ip'],config[_0xcb66('0x13')]['username'],_0xcb66('0x14')]['join']('\x20')));}_0x2339bb=_[_0xcb66('0x15')](_0x2339bb,_['keys'](properties['reload'][_0xcb66('0x16')]));_0x2339bb[_0xcb66('0x17')]=_0xcb66('0x18');return ami[_0xcb66('0x19')](_0x2339bb)['then'](function(_0x3a6e26){_0x4079ae({'code':0xc8,'message':_0x3a6e26[_0xcb66('0x1a')]});})[_0xcb66('0x1b')](function(_0x58bca0){_0x40c810(_0x582523[_0xcb66('0x12')](0x1f5,_0x58bca0['message']));});});},'Command':function(_0x4165ea){var _0x41edae=this;return new Promise(function(_0xdf0ba0,_0x1ccb71){if(ami['isConnected']()==![]){return _0x1ccb71(_0x41edae['error'](0x1f4,[config['asterisk']['ip'],config[_0xcb66('0x13')]['username'],'ami\x20disconnected'][_0xcb66('0x1c')]('\x20')));}_0x4165ea=_['pick'](_0x4165ea,_0xcb66('0x1d'));_0x4165ea[_0xcb66('0x17')]=_0xcb66('0x1e');return ami[_0xcb66('0x19')](_0x4165ea)[_0xcb66('0x1f')](function(_0x204f15){_0xdf0ba0({'code':0xc8,'message':_0x204f15[_0xcb66('0x20')]});})['catch'](function(_0x36faba){_0x1ccb71(_0x41edae['error'](0x1f5,_0x36faba['message']));});});},'VoiceQueues':function(){return new Promise(function(_0xf89c0e){var _0x37e4c8=[];for(var _0x19da3b in _0x3f7cc7['voiceQueues']){if(_0x3f7cc7[_0xcb66('0x21')][_0xcb66('0x22')](_0x19da3b)){var _0x43cd8f=_0x3f7cc7[_0xcb66('0x21')][_0x19da3b];var _0x5affdb=new VoiceQueueSummary(_0x43cd8f);_0x37e4c8[_0xcb66('0x23')](_0x5affdb);}}_0xf89c0e({'count':_0x37e4c8[_0xcb66('0x24')],'rows':_0x37e4c8});});},'UpdateVoiceQueue':function(_0x134987){return new Promise(function(_0x293711,_0x37a676){var _0x22527e=_[_0xcb66('0x25')](_0x3f7cc7[_0xcb66('0x21')],{'id':parseInt(_0x134987['id'])});var _0x28fc0b=_[_0xcb66('0x26')](_0x134987,['id']);if(_0x22527e){for(var _0x516194 in _0x28fc0b){if(typeof _0x28fc0b[_0x516194]!==_0xcb66('0x27')&&typeof _0x22527e[_0x516194]!=='undefined'){_0x22527e[_0x516194]=_0x28fc0b[_0x516194];}}_0x293711(_0x22527e);}else{_0x37a676();}});},'VoiceChannels':function(){return new Promise(function(_0x4dbb7f){var _0x58cd2b=_[_0xcb66('0x28')](_0x3f7cc7['channels']);_0x4dbb7f({'count':_0x58cd2b[_0xcb66('0x24')],'rows':_0x58cd2b});});},'VoiceChannelMixMonitor':function(_0x228b0c){var _0x1b8a79=this;return new Promise(function(_0x5d3fb5,_0x123787){if(ami[_0xcb66('0x11')]()==![]){return _0x123787(_0x1b8a79[_0xcb66('0x12')](0x1f4,[config[_0xcb66('0x13')]['ip'],config[_0xcb66('0x13')][_0xcb66('0x29')],_0xcb66('0x14')][_0xcb66('0x1c')]('\x20')));}var _0x2d27f7=schema(properties[_0xcb66('0x2a')])['validate'](_0x228b0c);if(_0x2d27f7[_0xcb66('0x24')]>0x0){return _0x123787(_0x1b8a79[_0xcb66('0x12')](0x1f4,_[_0xcb66('0x2b')](_0x2d27f7,_0xcb66('0x1a'))[_0xcb66('0x1c')](',\x20')));}var _0x128256=_[_0xcb66('0x25')](_0x3f7cc7['channels'],{'uniqueid':_0x228b0c[_0xcb66('0x2c')]});if(_0x128256&&_0x128256[_0xcb66('0x2d')]){var _0x216072=util[_0xcb66('0x2e')]('%s.%s',_0x228b0c[_0xcb66('0x2f')]||_0x228b0c[_0xcb66('0x2c')],_0x228b0c[_0xcb66('0x2e')]||_0xcb66('0x30'));return ami[_0xcb66('0x19')]({'action':_0xcb66('0x31'),'channel':_0x128256[_0xcb66('0x2d')],'file':_0x216072,'options':_0xcb66('0x32')})[_0xcb66('0x1f')](function(_0x299156){var _0x3dc592=_[_0xcb66('0x25')](_0x128256['monitors'],{'filename':'/var/spool/asterisk/monitor/'+_0x216072['toLowerCase']()});if(_[_0xcb66('0x33')](_0x3dc592)){_0x128256[_0xcb66('0x34')][_0xcb66('0x23')]({'filename':_0xcb66('0x35')+_0x216072[_0xcb66('0x36')](),'createdAt':moment()[_0xcb66('0x2e')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x299156[_0xcb66('0x37')],'status':'rec'});}else{_0x3dc592['mixmonitorid']=_0x299156['mixmonitorid'];_0x3dc592[_0xcb66('0x38')]=_0xcb66('0x39');}_0x5d3fb5({'code':0xc8,'message':[_0x228b0c[_0xcb66('0x2c')],_0xcb66('0x3a'),_0x299156[_0xcb66('0x37')]][_0xcb66('0x1c')]('\x20'),'mixmonitorid':_0x299156[_0xcb66('0x37')]});})[_0xcb66('0x1b')](function(_0x81fdc4){_0x123787(_0x1b8a79['error'](0x1f5,[_0x228b0c[_0xcb66('0x2c')],_0x81fdc4[_0xcb66('0x1a')][_0xcb66('0x36')]()]['join']('\x20')));});}else{return _0x123787(_0x1b8a79[_0xcb66('0x12')](0x1f5,_0xcb66('0x3b')));}});},'VoiceChannelStopMixMonitor':function(_0x4a5934){var _0x56b025=this;return new Promise(function(_0x277838,_0x54ea61){if(ami['isConnected']()==![]){return _0x54ea61(_0x56b025[_0xcb66('0x12')](0x1f4,[config[_0xcb66('0x13')]['ip'],config[_0xcb66('0x13')][_0xcb66('0x29')],_0xcb66('0x14')][_0xcb66('0x1c')]('\x20')));}var _0x3323ee=schema(properties[_0xcb66('0x2a')])[_0xcb66('0x3c')](_0x4a5934);if(_0x3323ee['length']>0x0){return _0x54ea61(_0x56b025['error'](0x1f4,_['map'](_0x3323ee,_0xcb66('0x1a'))['join'](',\x20')));}var _0x8736aa=_['find'](_0x3f7cc7[_0xcb66('0x3d')],{'uniqueid':_0x4a5934[_0xcb66('0x2c')]});if(_0x8736aa){return Promise[_0xcb66('0x3e')]()[_0xcb66('0x1f')](function(){if(_0x8736aa[_0xcb66('0x2d')]){return ami[_0xcb66('0x19')]({'action':'StopMixMonitor','channel':_0x8736aa['channel'],'mixmonitorid':_0x4a5934[_0xcb66('0x37')]})[_0xcb66('0x1b')](function(){});}})[_0xcb66('0x1f')](function(){if(_0x8736aa[_0xcb66('0x3f')]){return ami[_0xcb66('0x19')]({'action':_0xcb66('0x40'),'channel':_0x8736aa[_0xcb66('0x3f')],'mixmonitorid':_0x4a5934[_0xcb66('0x37')]})[_0xcb66('0x1b')](function(){});}})['then'](function(){var _0x3f2efd=_[_0xcb66('0x25')](_0x8736aa[_0xcb66('0x34')],{'mixmonitorid':_0x4a5934[_0xcb66('0x37')]});if(_0x3f2efd){_0x3f2efd['status']=_0xcb66('0x41');}})[_0xcb66('0x1f')](function(){var _0x1aab4e=util['format'](_0xcb66('0x42'),_0x4a5934[_0xcb66('0x2f')]||_0x4a5934[_0xcb66('0x2c')],_0x4a5934[_0xcb66('0x2e')]||'wav');var _0x43e0e0=_[_0xcb66('0x25')](_0x8736aa[_0xcb66('0x34')],{'filename':'/var/spool/asterisk/monitor/'+_0x1aab4e['toLowerCase']()});if(_0x43e0e0){_0x43e0e0[_0xcb66('0x38')]='stop';}})[_0xcb66('0x1f')](function(){_0x277838({'code':0xc8,'message':[_0x4a5934['uniqueid'],_0xcb66('0x43')][_0xcb66('0x1c')]('\x20')});})[_0xcb66('0x1b')](function(_0x5c07c3){_0x54ea61(_0x56b025[_0xcb66('0x12')](0x1f5,[_0x4a5934['uniqueid'],_0x5c07c3[_0xcb66('0x1a')][_0xcb66('0x36')]()][_0xcb66('0x1c')]('\x20')));});}else{return _0x54ea61(_0x56b025[_0xcb66('0x12')](0x1f5,_0xcb66('0x3b')));}});},'VoiceQueuesChannels':function(_0x5369f8){var _0x9017f4=this;return new Promise(function(_0x5b04ad){var _0xd68e76=_[_0xcb66('0x28')](_0x3f7cc7[_0xcb66('0x44')]);var _0x5367a1={'count':_0xd68e76['length'],'rows':_0xd68e76};if(_0x5369f8&&_0x5369f8['type']){if(![_0xcb66('0x45'),_0xcb66('0x46')][_0xcb66('0x47')](_0x5369f8[_0xcb66('0x48')])){return _0x19adf5(_0x9017f4[_0xcb66('0x12')](0x190,_0xcb66('0x49')));}var _0x26ec7b=_[_0xcb66('0x4a')](_0xd68e76,function(_0x1f17b1){return _0x1f17b1[_0xcb66('0x48')]===_0x5369f8['type'];});_0x5367a1[_0xcb66('0x4b')]=_0x26ec7b[_0xcb66('0x24')];_0x5367a1[_0xcb66('0x4c')]=_0x26ec7b;}_0x5b04ad(_0x5367a1);});},'VoiceQueuesChannel':function(_0x372b59){var _0x4efb2b=this;return new Promise(function(_0x50a4e5,_0x3b2e05){var _0x476c9a=schema(properties[_0xcb66('0x4d')])[_0xcb66('0x3c')](_0x372b59);if(_0x476c9a[_0xcb66('0x24')]>0x0){return _0x3b2e05(_0x4efb2b[_0xcb66('0x12')](0x1f4,_['map'](_0x476c9a,_0xcb66('0x1a'))[_0xcb66('0x1c')](',\x20')));}var _0x83b627=_[_0xcb66('0x25')](_0x3f7cc7['queueChannels'],{'uniqueid':_0x372b59[_0xcb66('0x2c')]});if(_0x83b627){_0x50a4e5(_0x83b627);}else{return _0x3b2e05(_0x4efb2b['error'](0x1f5,_0xcb66('0x3b')));}});},'VoiceQueuesChannelHangup':function(_0x4b2110){var _0x11e42d=this;return new Promise(function(_0x274949,_0x146a06){if(ami['isConnected']()==![]){return _0x146a06(_0x11e42d['error'](0x1f4,[config[_0xcb66('0x13')]['ip'],config[_0xcb66('0x13')]['username'],'ami\x20disconnected'][_0xcb66('0x1c')]('\x20')));}var _0x4f95c6=schema(properties[_0xcb66('0x4e')])['validate'](_0x4b2110);if(_0x4f95c6[_0xcb66('0x24')]>0x0){return _0x146a06(_0x11e42d[_0xcb66('0x12')](0x1f4,_[_0xcb66('0x2b')](_0x4f95c6,'message')[_0xcb66('0x1c')](',\x20')));}var _0x3b68c9=_['find'](_0x3f7cc7[_0xcb66('0x44')],{'uniqueid':_0x4b2110[_0xcb66('0x2c')]});if(_0x3b68c9&&_0x3b68c9[_0xcb66('0x2d')]){return ami[_0xcb66('0x19')]({'action':_0xcb66('0x4f'),'channel':_0x3b68c9[_0xcb66('0x2d')]})['then'](function(_0x52e6f){_0x274949({'code':0xc8,'message':[_0x4b2110[_0xcb66('0x2c')],_0x52e6f[_0xcb66('0x1a')][_0xcb66('0x36')]()][_0xcb66('0x1c')]('\x20')});})[_0xcb66('0x1b')](function(_0x8913b0){_0x146a06(_0x11e42d[_0xcb66('0x12')](0x1f5,[_0x4b2110[_0xcb66('0x2c')],_0x8913b0['message'][_0xcb66('0x36')]()][_0xcb66('0x1c')]('\x20')));});}else{return _0x146a06(_0x11e42d[_0xcb66('0x12')](0x1f5,_0xcb66('0x3b')));}});},'VoiceQueuesChannelRedirect':function(_0x19c93f){var _0x252b89=this;return new Promise(function(_0x52e27d,_0x475b3d){if(ami[_0xcb66('0x11')]()==![]){return _0x475b3d(_0x252b89['error'](0x1f4,[config[_0xcb66('0x13')]['ip'],config[_0xcb66('0x13')][_0xcb66('0x29')],_0xcb66('0x14')]['join']('\x20')));}var _0x3dbc42=schema(properties[_0xcb66('0x50')])[_0xcb66('0x3c')](_0x19c93f);if(_0x3dbc42[_0xcb66('0x24')]>0x0){return _0x475b3d(_0x252b89[_0xcb66('0x12')](0x1f4,_[_0xcb66('0x2b')](_0x3dbc42,_0xcb66('0x1a'))[_0xcb66('0x1c')](',\x20')));}var _0x275dfd=_[_0xcb66('0x25')](_0x3f7cc7['queueChannels'],{'uniqueid':_0x19c93f[_0xcb66('0x2c')]});if(_0x275dfd&&_0x275dfd[_0xcb66('0x2d')]){return ami[_0xcb66('0x19')]({'action':_0xcb66('0x51'),'channel':_0x275dfd['channel'],'exten':_0x19c93f[_0xcb66('0x52')],'context':_0x19c93f[_0xcb66('0x53')]||_0x275dfd[_0xcb66('0x53')],'priority':0x1})[_0xcb66('0x1f')](function(_0x183381){_0x52e27d({'code':0xc8,'message':[_0x19c93f[_0xcb66('0x2c')],_0x183381[_0xcb66('0x1a')]['toLowerCase']()]['join']('\x20')});})[_0xcb66('0x1b')](function(_0x42a6d0){_0x475b3d(_0x252b89[_0xcb66('0x12')](0x1f5,[_0x19c93f[_0xcb66('0x2c')],_0x42a6d0[_0xcb66('0x1a')][_0xcb66('0x36')]()]['join']('\x20')));});}else{return _0x475b3d(_0x252b89[_0xcb66('0x12')](0x1f5,_0xcb66('0x3b')));}});},'Agents':function(_0x19da1c){return new Promise(function(_0x534cf4){var _0x31036f=_[_0xcb66('0x28')](_0x3f7cc7['agents']);if(_0x19da1c&&_0x19da1c['id']){var _0x3bf094=_[_0xcb66('0x25')](_0x31036f,function(_0x28ad40){return _0x28ad40['id']===_0x19da1c['id'];});_0x534cf4(_0x3bf094);}else{_0x534cf4({'count':_0x31036f[_0xcb66('0x24')],'rows':_0x31036f});}});},'Telephones':function(){return new Promise(function(_0xfddd73){var _0x37051c=_[_0xcb66('0x28')](_0x3f7cc7[_0xcb66('0x54')]);_0xfddd73({'count':_0x37051c[_0xcb66('0x24')],'rows':_0x37051c});});},'Trunks':function(){return new Promise(function(_0x4277e1){var _0x31387c=_[_0xcb66('0x28')](_0x3f7cc7[_0xcb66('0x55')]);_0x4277e1({'count':_0x31387c[_0xcb66('0x24')],'rows':_0x31387c});});},'OutboundChannels':function(){return new Promise(function(_0x4332f4){var _0x39e86a=_[_0xcb66('0x28')](_0x3f7cc7[_0xcb66('0x56')]);_0x4332f4({'count':_0x39e86a[_0xcb66('0x24')],'rows':_0x39e86a});});},'Outbound':function(){return new Promise(function(_0x579565){_0x579565(_0x3f7cc7[_0xcb66('0x46')]);});},'Campaigns':function(){return new Promise(function(_0x59adb7){var _0x14eada=_['values'](_0x3f7cc7[_0xcb66('0x57')]);_0x59adb7({'count':_0x14eada[_0xcb66('0x24')],'rows':_0x14eada});});},'VoiceQueuesPreview':function(_0x42a71a){var _0x1a4cdb=this;return new Promise(function(_0x1e13f0,_0x283600){_0x21be55[_0xcb66('0x58')](_0x42a71a['id'])[_0xcb66('0x1f')](function(_0x2de513){_0x1e13f0({'code':0xc8,'message':_0x2de513[_0xcb66('0x1a')]});})[_0xcb66('0x1b')](function(_0x309b72){_0x283600(_0x1a4cdb[_0xcb66('0x12')](0x1f4,_0x309b72['message']));});});},'EventManager':function(_0x91725a){var _0x45b25e=this;return new Promise(function(_0x173848,_0x519b2b){if(!_0x91725a[_0xcb66('0x59')]){return _0x519b2b(_0x45b25e[_0xcb66('0x12')](0x1f4,_0xcb66('0x5a')));}ami['emit'](_0xcb66('0x5b')+_0x91725a[_0xcb66('0x59')],_0x91725a[_0xcb66('0x1a')]);_0x173848({'code':0xc8,'message':_0x91725a});});},'FaxAccounts':function(){return new Promise(function(_0x28fce3){var _0x38a3c0=_[_0xcb66('0x28')](_0x3f7cc7['faxAccounts']);_0x28fce3({'count':_0x38a3c0[_0xcb66('0x24')],'rows':_0x38a3c0});});},'SendFax':function(_0x536ecf){var _0x446312=this;return new Promise(function(_0x491be1,_0x3a7c92){_0x5d766d['send'](_0x536ecf)[_0xcb66('0x1f')](function(_0x20fb30){_0x491be1({'code':0xc8,'message':_0x20fb30[_0xcb66('0x1a')]});})['catch'](function(_0x2bf869){_0x3a7c92(_0x446312['error'](0x1f4,_0x2bf869[_0xcb66('0x1a')]));});});},'CheckAfterSend':function(_0x21d871){var _0x3c7b5e=this;return new Promise(function(_0x1a18f0,_0xf6866){_0x5d766d['checkAfterSend'](_0x21d871)[_0xcb66('0x1f')](function(_0xfa72ee){_0x1a18f0({'code':0xc8,'message':_0xfa72ee[_0xcb66('0x1a')]});})[_0xcb66('0x1b')](function(_0x5a58c5){_0xf6866(_0x3c7b5e[_0xcb66('0x12')](0x1f4,_0x5a58c5[_0xcb66('0x1a')]));});});}};var _0x5c1def=jayson[_0xcb66('0x5c')](_0x1b6852)[_0xcb66('0x5d')]();_0x5c1def['on'](_0xcb66('0x12'),function(_0x25afb7){return _0x19adf5(_0x25afb7);});_0x5c1def['listen'](0x232a,_0xcb66('0x5e'),function(){console[_0xcb66('0x5f')](_0xcb66('0x60'),0x232a);return _0x518163(_0xcb66('0x61')+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 3bc2b81..42f83a4 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 _0x1658=['../../../../config/logger','trigger','../../rpc/cmContact','redis','localhost','socket.io-emitter','info','[CM][%s][%s]','stringify','emit','exec','data1','data2','isNil','data5','xmd-contactid','ListId','data3','map','calleridnum','routeId','firstName','phone','fax','scheduledAt','updatedAt','union','resolve','then','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','Unknown','destcalleridname','','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','trigger:%s','action','toLowerCase','lodash','util'];(function(_0x4f4150,_0x1e687f){var _0x23c0e0=function(_0x4bcbcf){while(--_0x4bcbcf){_0x4f4150['push'](_0x4f4150['shift']());}};_0x23c0e0(++_0x1e687f);}(_0x1658,0x163));var _0x8165=function(_0xb23b17,_0xfe48ae){_0xb23b17=_0xb23b17-0x0;var _0x11e3af=_0x1658[_0xb23b17];return _0x11e3af;};'use strict';var _=require(_0x8165('0x0'));var BPromise=require('bluebird');var Redis=require('ioredis');var util=require(_0x8165('0x1'));var config=require('../../../../config/environment');var logger=require(_0x8165('0x2'))(_0x8165('0x3'));var cmContactRpc=require(_0x8165('0x4'));config[_0x8165('0x5')]=_['defaults'](config['redis'],{'host':_0x8165('0x6'),'port':0x18eb});var io=require(_0x8165('0x7'))(new Redis(config[_0x8165('0x5')]));function emit(_0x41ec80,_0xad364a,_0x18b797,_0xff60c1,_0x4ccff2){logger[_0x8165('0x8')](_0x8165('0x9'),_0x41ec80,_0xad364a['id'],_0x18b797,_0xff60c1,JSON[_0x8165('0xa')](_0x4ccff2));io['to'](_0x18b797)[_0x8165('0xb')](_0xff60c1,_0x4ccff2);}exports[_0x8165('0xc')]=function(_0x523a52,_0x3fbd1c,_0x101be3,_0xf9731e){var _0x420b2e,_0x4325df;var _0x469752={};var _0x1aa1b3;var _0x530b87=Number(_0x101be3[_0x8165('0xd')]);var _0x459516=_0x101be3[_0x8165('0xe')]?Boolean(Number(_0x101be3[_0x8165('0xe')])):![];var _0x43dc82;var _0x2a96ca=![];if(!_[_0x8165('0xf')](_0x101be3['data5'])){if(_0x101be3[_0x8165('0x10')]=='1')_0x2a96ca=!![];}if(!_0x2a96ca){if(_0xf9731e[_0x8165('0x11')]){_0x469752['id']=_0xf9731e[_0x8165('0x11')];}}if(!_0x469752['id']){_0x469752[_0x8165('0x12')]=_0x530b87;_0x43dc82=_0x101be3[_0x8165('0x13')]&&_0x101be3[_0x8165('0x13')]!=='0'?_0x101be3[_0x8165('0x13')]['split'](','):['phone'];_0x469752['$or']=_[_0x8165('0x14')](_0x43dc82,function(_0x2ad382){var _0x3b7be2={};_0x3b7be2[_0x2ad382]=_0xf9731e['routeId']?_0xf9731e['destcalleridnum']:_0xf9731e[_0x8165('0x15')];return _0x3b7be2;});_0x1aa1b3=_0xf9731e[_0x8165('0x16')]?_0xf9731e['destcalleridnum']:_0xf9731e[_0x8165('0x15')];}var _0x15caf4=['id',_0x8165('0x17'),'lastName',_0x8165('0x18'),'mobile',_0x8165('0x19'),_0x8165('0x12'),'createdAt',_0x8165('0x1a'),_0x8165('0x1b')];var _0x3a7fcf=_[_0x8165('0x1c')](_0x15caf4,_0x43dc82);BPromise[_0x8165('0x1d')]()[_0x8165('0x1e')](cmContactRpc['getContacts']({'attributes':_0x3a7fcf,'where':_0x469752,'phone':_0x1aa1b3}))[_0x8165('0x1e')](function(_0x542804){_0x4325df=_0x542804;if(!_[_0x8165('0x1f')](_0x4325df)){if(_0x4325df[_0x8165('0x20')]===0x1){_0x420b2e=_0x4325df[0x0];logger[_0x8165('0x8')](_0x8165('0x21'),_0xf9731e[_0x8165('0x22')],_0x3fbd1c['id'],_0x420b2e['id']);}else{logger[_0x8165('0x8')]('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0xf9731e['uniqueid'],_0x3fbd1c['id'],_[_0x8165('0x14')](_0x4325df,'id')['join'](','));}return;}else{logger['info'](_0x8165('0x23'),_0xf9731e[_0x8165('0x22')],_0x3fbd1c['id']);var _0x155ed0={'ListId':_0x530b87};var _0x3c67cf=_0x101be3[_0x8165('0x24')]&&_0x101be3[_0x8165('0x24')]!=='0'?_0x101be3[_0x8165('0x24')]:_0x8165('0x18');if(_0x459516){logger[_0x8165('0x8')](_0x8165('0x25'),_0xf9731e[_0x8165('0x22')],_0x3fbd1c['id']);_0x155ed0[_0x3c67cf]=_[_0x8165('0xf')](_0xf9731e[_0x8165('0x16')])?_0xf9731e['calleridnum']:_0xf9731e['destcalleridnum'];if(_[_0x8165('0xf')](_0xf9731e[_0x8165('0x16')])){_0x155ed0[_0x8165('0x17')]=_0xf9731e[_0x8165('0x26')]&&_0xf9731e[_0x8165('0x26')]!==''?_0xf9731e[_0x8165('0x26')]:_0x8165('0x27');}else{_0x155ed0[_0x8165('0x17')]=_0xf9731e[_0x8165('0x28')]&&_0xf9731e[_0x8165('0x28')]!==_0x8165('0x29')?_0xf9731e['destcalleridname']:_0x8165('0x27');}return BPromise[_0x8165('0x1d')]()[_0x8165('0x1e')](cmContactRpc[_0x8165('0x2a')](_0x155ed0))[_0x8165('0x1e')](function(_0x4f4982){_0x420b2e=_0x4f4982;_0x4325df[_0x8165('0x2b')](_0x4f4982);if(_0x420b2e){logger[_0x8165('0x8')](_0x8165('0x2c'),_0xf9731e['uniqueid'],_0x3fbd1c['id'],_0x420b2e['id']);}return;});}else{logger[_0x8165('0x8')](_0x8165('0x2d'),_0xf9731e[_0x8165('0x22')],_0x3fbd1c['id']);_0x155ed0[_0x3c67cf]=_['isNil'](_0xf9731e[_0x8165('0x16')])?_0xf9731e[_0x8165('0x15')]:_0xf9731e['destcalleridnum'];if(_['isNil'](_0xf9731e['routeId'])){_0x155ed0[_0x8165('0x17')]=_0xf9731e[_0x8165('0x26')]&&_0xf9731e['calleridname']!==_0x8165('0x29')?_0xf9731e[_0x8165('0x26')]:_0x8165('0x27');}else{_0x155ed0[_0x8165('0x17')]=_0xf9731e[_0x8165('0x28')]&&_0xf9731e['destcalleridname']!==''?_0xf9731e['destcalleridname']:_0x8165('0x27');}_0x420b2e=_0x155ed0;_0x4325df[_0x8165('0x2b')](_0x155ed0);return;}}})['then'](function(){if(_0x523a52){emit(_0xf9731e[_0x8165('0x22')],_0x3fbd1c,util[_0x8165('0x2e')](_0x8165('0x2f'),_0x523a52['name']),util[_0x8165('0x2e')](_0x8165('0x30'),_0x101be3[_0x8165('0x31')][_0x8165('0x32')]()),{'evt':_['merge'](_0xf9731e,{'autoCreate':_0x459516}),'contact':_0x420b2e===undefined?{}:_0x420b2e,'contacts':_0x4325df['length']===0x0?undefined:_0x4325df});}});}; \ No newline at end of file +var _0xec7d=['fax','ListId','createdAt','scheduledAt','updatedAt','union','resolve','then','getContacts','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','','destcalleridname','Unknown','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','name','trigger:%s','action','toLowerCase','merge','bluebird','ioredis','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','info','[CM][%s][%s]','stringify','emit','exec','data1','data2','isNil','data5','xmd-contactid','data3','split','phone','map','routeId','calleridnum','destcalleridnum','firstName','lastName','mobile'];(function(_0x2b8938,_0x2fc12a){var _0x54e5ed=function(_0x46b4d1){while(--_0x46b4d1){_0x2b8938['push'](_0x2b8938['shift']());}};_0x54e5ed(++_0x2fc12a);}(_0xec7d,0x99));var _0xdec7=function(_0x5b328a,_0x5c48bc){_0x5b328a=_0x5b328a-0x0;var _0xfcf474=_0xec7d[_0x5b328a];return _0xfcf474;};'use strict';var _=require('lodash');var BPromise=require(_0xdec7('0x0'));var Redis=require(_0xdec7('0x1'));var util=require('util');var config=require(_0xdec7('0x2'));var logger=require(_0xdec7('0x3'))(_0xdec7('0x4'));var cmContactRpc=require(_0xdec7('0x5'));config[_0xdec7('0x6')]=_[_0xdec7('0x7')](config[_0xdec7('0x6')],{'host':_0xdec7('0x8'),'port':0x18eb});var io=require(_0xdec7('0x9'))(new Redis(config[_0xdec7('0x6')]));function emit(_0x378c4f,_0x1e7d7b,_0x32e9f9,_0x5a1c10,_0x58652e){logger[_0xdec7('0xa')](_0xdec7('0xb'),_0x378c4f,_0x1e7d7b['id'],_0x32e9f9,_0x5a1c10,JSON[_0xdec7('0xc')](_0x58652e));io['to'](_0x32e9f9)[_0xdec7('0xd')](_0x5a1c10,_0x58652e);}exports[_0xdec7('0xe')]=function(_0x2693b3,_0x595c1f,_0x20ec3c,_0x2541cb){var _0x102da1,_0x13e8b5;var _0x115e95={};var _0x299bc6;var _0x31e4e8=Number(_0x20ec3c[_0xdec7('0xf')]);var _0x2548e9=_0x20ec3c[_0xdec7('0x10')]?Boolean(Number(_0x20ec3c['data2'])):![];var _0xd7b0d6;var _0x247703=![];if(!_[_0xdec7('0x11')](_0x20ec3c['data5'])){if(_0x20ec3c[_0xdec7('0x12')]=='1')_0x247703=!![];}if(!_0x247703){if(_0x2541cb[_0xdec7('0x13')]){_0x115e95['id']=_0x2541cb[_0xdec7('0x13')];}}if(!_0x115e95['id']){_0x115e95['ListId']=_0x31e4e8;_0xd7b0d6=_0x20ec3c[_0xdec7('0x14')]&&_0x20ec3c['data3']!=='0'?_0x20ec3c[_0xdec7('0x14')][_0xdec7('0x15')](','):[_0xdec7('0x16')];_0x115e95['$or']=_[_0xdec7('0x17')](_0xd7b0d6,function(_0x5c3679){var _0x41f8f9={};_0x41f8f9[_0x5c3679]=_0x2541cb[_0xdec7('0x18')]?_0x2541cb['destcalleridnum']:_0x2541cb[_0xdec7('0x19')];return _0x41f8f9;});_0x299bc6=_0x2541cb['routeId']?_0x2541cb[_0xdec7('0x1a')]:_0x2541cb[_0xdec7('0x19')];}var _0x33bdeb=['id',_0xdec7('0x1b'),_0xdec7('0x1c'),_0xdec7('0x16'),_0xdec7('0x1d'),_0xdec7('0x1e'),_0xdec7('0x1f'),_0xdec7('0x20'),_0xdec7('0x21'),_0xdec7('0x22')];var _0x32f00b=_[_0xdec7('0x23')](_0x33bdeb,_0xd7b0d6);BPromise[_0xdec7('0x24')]()[_0xdec7('0x25')](cmContactRpc[_0xdec7('0x26')]({'attributes':_0x32f00b,'where':_0x115e95,'phone':_0x299bc6}))[_0xdec7('0x25')](function(_0x5f4a83){_0x13e8b5=_0x5f4a83;if(!_['isEmpty'](_0x13e8b5)){if(_0x13e8b5[_0xdec7('0x27')]===0x1){_0x102da1=_0x13e8b5[0x0];logger[_0xdec7('0xa')](_0xdec7('0x28'),_0x2541cb[_0xdec7('0x29')],_0x595c1f['id'],_0x102da1['id']);}else{logger[_0xdec7('0xa')](_0xdec7('0x2a'),_0x2541cb[_0xdec7('0x29')],_0x595c1f['id'],_[_0xdec7('0x17')](_0x13e8b5,'id')[_0xdec7('0x2b')](','));}return;}else{logger[_0xdec7('0xa')](_0xdec7('0x2c'),_0x2541cb['uniqueid'],_0x595c1f['id']);var _0x685ced={'ListId':_0x31e4e8};var _0xd99be0=_0x20ec3c[_0xdec7('0x2d')]&&_0x20ec3c[_0xdec7('0x2d')]!=='0'?_0x20ec3c[_0xdec7('0x2d')]:_0xdec7('0x16');if(_0x2548e9){logger[_0xdec7('0xa')](_0xdec7('0x2e'),_0x2541cb['uniqueid'],_0x595c1f['id']);_0x685ced[_0xd99be0]=_[_0xdec7('0x11')](_0x2541cb[_0xdec7('0x18')])?_0x2541cb[_0xdec7('0x19')]:_0x2541cb[_0xdec7('0x1a')];if(_[_0xdec7('0x11')](_0x2541cb['routeId'])){_0x685ced[_0xdec7('0x1b')]=_0x2541cb['calleridname']&&_0x2541cb[_0xdec7('0x2f')]!==_0xdec7('0x30')?_0x2541cb['calleridname']:'Unknown';}else{_0x685ced[_0xdec7('0x1b')]=_0x2541cb[_0xdec7('0x31')]&&_0x2541cb[_0xdec7('0x31')]!==_0xdec7('0x30')?_0x2541cb[_0xdec7('0x31')]:_0xdec7('0x32');}return BPromise[_0xdec7('0x24')]()[_0xdec7('0x25')](cmContactRpc['createContact'](_0x685ced))[_0xdec7('0x25')](function(_0x5157f7){_0x102da1=_0x5157f7;_0x13e8b5[_0xdec7('0x33')](_0x5157f7);if(_0x102da1){logger[_0xdec7('0xa')](_0xdec7('0x34'),_0x2541cb[_0xdec7('0x29')],_0x595c1f['id'],_0x102da1['id']);}return;});}else{logger[_0xdec7('0xa')](_0xdec7('0x35'),_0x2541cb[_0xdec7('0x29')],_0x595c1f['id']);_0x685ced[_0xd99be0]=_['isNil'](_0x2541cb[_0xdec7('0x18')])?_0x2541cb['calleridnum']:_0x2541cb['destcalleridnum'];if(_[_0xdec7('0x11')](_0x2541cb['routeId'])){_0x685ced['firstName']=_0x2541cb[_0xdec7('0x2f')]&&_0x2541cb[_0xdec7('0x2f')]!==_0xdec7('0x30')?_0x2541cb[_0xdec7('0x2f')]:_0xdec7('0x32');}else{_0x685ced[_0xdec7('0x1b')]=_0x2541cb[_0xdec7('0x31')]&&_0x2541cb['destcalleridname']!==_0xdec7('0x30')?_0x2541cb[_0xdec7('0x31')]:'Unknown';}_0x102da1=_0x685ced;_0x13e8b5[_0xdec7('0x33')](_0x685ced);return;}}})[_0xdec7('0x25')](function(){if(_0x2693b3){emit(_0x2541cb[_0xdec7('0x29')],_0x595c1f,util[_0xdec7('0x36')](_0xdec7('0x37'),_0x2693b3[_0xdec7('0x38')]),util[_0xdec7('0x36')](_0xdec7('0x39'),_0x20ec3c[_0xdec7('0x3a')][_0xdec7('0x3b')]()),{'evt':_[_0xdec7('0x3c')](_0x2541cb,{'autoCreate':_0x2548e9}),'contact':_0x102da1===undefined?{}:_0x102da1,'contacts':_0x13e8b5[_0xdec7('0x27')]===0x0?undefined:_0x13e8b5});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 10a0433..13f677a 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 _0xc06e=['servicenowAccounts','freshsalesAccounts','dynamics365Accounts','custom:agentcalled','syncCustomEvent','bind','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentreject','custom:timeout','syncAgentDial','custom:dialconnect','custom:newinteraction','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','prototype','emit','stringify','clone','motionChannel','voice','debug','inspect','checkTriggers','agents','interface','triggers','checkTrigger','merge','variables','Actions','length','toLowerCase','contactmanager','motionbar','browser','data1','TemplateId','data2','html','template\x20not\x20found','buildUri','isNil','data3','data4','windowWidth','data5','800','data6','render','format','user:%s','name','trigger:%s:%s','action','jscripty','trigger:%s','exec','accounts','queue','routeId','urlforward','script','parse','query','search','replace','channel','AllConditions','every','checkConditions','some','checkTrigger:\x20trigger','evt','field','account','ChatWebsiteId','upperFirst','operator','value','AccountId','interaction','message','event','membername','lastevent','substatus','offlineMessage','created','equals','exports','lodash','url','mustache','ioredis','./integration','./cmContact','trigger','../ami','defaults','redis','localhost','socket.io-emitter','popup','winapp','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts'];(function(_0x5f12b1,_0x2c8bb4){var _0x33687c=function(_0x48f258){while(--_0x48f258){_0x5f12b1['push'](_0x5f12b1['shift']());}};_0x33687c(++_0x2c8bb4);}(_0xc06e,0x14a));var _0xec06=function(_0x11a220,_0x4e470a){_0x11a220=_0x11a220-0x0;var _0x20d8fe=_0xc06e[_0x11a220];return _0x20d8fe;};'use strict';var util=require('util');var _=require(_0xec06('0x0'));var url=require(_0xec06('0x1'));var Mustache=require(_0xec06('0x2'));var Redis=require(_0xec06('0x3'));var urlforward=require('./urlforward');var integration=require(_0xec06('0x4'));var cmContact=require(_0xec06('0x5'));var script=require('./script');var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0xec06('0x6'));var ami=require(_0xec06('0x7'));config['redis']=_[_0xec06('0x8')](config[_0xec06('0x9')],{'host':_0xec06('0xa'),'port':0x18eb});var io=require(_0xec06('0xb'))(new Redis(config[_0xec06('0x9')]));var operators={'equals':function(_0x419d9b,_0x4db3e9){return _0x419d9b==_0x4db3e9;},'not_equals':function(_0x31e59d,_0x5d1d53){return _0x31e59d!=_0x5d1d53;}};var barAndWebActions=[_0xec06('0xc'),_0xec06('0x1'),_0xec06('0xd')];function Trigger(_0x48d54e){this['triggers']=_0x48d54e['triggers'];this['agents']=_0x48d54e['agents'];this[_0xec06('0xe')]=_0x48d54e['voiceQueues'];this[_0xec06('0xf')]=_0x48d54e['templates'];this[_0xec06('0x10')]=_0x48d54e[_0xec06('0x10')];this[_0xec06('0x11')]=_0x48d54e[_0xec06('0x11')];this[_0xec06('0x12')]=_0x48d54e[_0xec06('0x12')];this['salesforceAccounts']=_0x48d54e[_0xec06('0x13')];this[_0xec06('0x14')]=_0x48d54e['sugarcrmAccounts'];this[_0xec06('0x15')]=_0x48d54e[_0xec06('0x15')];this[_0xec06('0x16')]=_0x48d54e['deskAccounts'];this[_0xec06('0x17')]=_0x48d54e[_0xec06('0x17')];this[_0xec06('0x18')]=_0x48d54e[_0xec06('0x18')];this['dynamics365Accounts']=_0x48d54e['dynamics365Accounts'];this['freshsalesAccounts']=_0x48d54e[_0xec06('0x19')];this['accounts']={'zendesk':this[_0xec06('0x11')],'salesforce':this[_0xec06('0x13')],'freshdesk':this[_0xec06('0x12')],'sugarcrm':this[_0xec06('0x14')],'zoho':this[_0xec06('0x15')],'desk':this[_0xec06('0x16')],'vtiger':this['vtigerAccounts'],'dynamics365':this[_0xec06('0x1a')],'freshsales':this[_0xec06('0x19')],'servicenow':this[_0xec06('0x18')]};ami['on'](_0xec06('0x1b'),this[_0xec06('0x1c')][_0xec06('0x1d')](this));ami['on']('custom:agentconnect',this['syncCustomEvent'][_0xec06('0x1d')](this));ami['on']('custom:agentringnoanswer',this[_0xec06('0x1c')][_0xec06('0x1d')](this));ami['on'](_0xec06('0x1e'),this[_0xec06('0x1c')][_0xec06('0x1d')](this));ami['on'](_0xec06('0x1f'),this[_0xec06('0x1c')][_0xec06('0x1d')](this));ami['on'](_0xec06('0x20'),this[_0xec06('0x1c')]['bind'](this));ami['on'](_0xec06('0x21'),this[_0xec06('0x1c')][_0xec06('0x1d')](this));ami['on']('custom:agentcongestion',this[_0xec06('0x1c')][_0xec06('0x1d')](this));ami['on'](_0xec06('0x22'),this[_0xec06('0x1c')][_0xec06('0x1d')](this));ami['on']('custom:amd',this[_0xec06('0x1c')]['bind'](this));ami['on']('custom:queuecallerabandon',this[_0xec06('0x1c')][_0xec06('0x1d')](this));ami['on'](_0xec06('0x23'),this[_0xec06('0x1c')][_0xec06('0x1d')](this));ami['on']('custom:dialbegin',this[_0xec06('0x24')][_0xec06('0x1d')](this));ami['on'](_0xec06('0x25'),this['syncAgentDial'][_0xec06('0x1d')](this));ami['on']('custom:dialend',this[_0xec06('0x24')]['bind'](this));ami['on'](_0xec06('0x26'),this[_0xec06('0x1c')][_0xec06('0x1d')](this));ami['on']('custom:closedinteraction',this[_0xec06('0x1c')]['bind'](this));ami['on']('custom:substatus',this['syncCustomEvent'][_0xec06('0x1d')](this));ami['on'](_0xec06('0x27'),this[_0xec06('0x1c')][_0xec06('0x1d')](this));ami['on'](_0xec06('0x28'),this['syncCustomEvent'][_0xec06('0x1d')](this));ami['on'](_0xec06('0x29'),this[_0xec06('0x1c')][_0xec06('0x1d')](this));ami['on']('custom:rejectmessage',this[_0xec06('0x1c')][_0xec06('0x1d')](this));ami['on']('custom:offlineMessage',this[_0xec06('0x1c')][_0xec06('0x1d')](this));}Trigger[_0xec06('0x2a')][_0xec06('0x2b')]=function(_0x3249bd,_0x4e2e18,_0x59b329){logger['info'](_0x3249bd,_0x4e2e18,JSON[_0xec06('0x2c')](_0x59b329));io['to'](_0x3249bd)[_0xec06('0x2b')](_0x4e2e18,_0x59b329);};Trigger['prototype'][_0xec06('0x1c')]=function(_0x2bf912){var _0x2fb3ac=_[_0xec06('0x2d')](_0x2bf912);if(typeof _0x2fb3ac[_0xec06('0x2e')]==='undefined'){_0x2fb3ac[_0xec06('0x2e')]=_0xec06('0x2f');}logger[_0xec06('0x30')](_0xec06('0x1c'),util[_0xec06('0x31')](_0x2fb3ac,{'showHidden':!![],'depth':null}));this[_0xec06('0x32')](_0x2fb3ac);};Trigger[_0xec06('0x2a')][_0xec06('0x24')]=function(_0x5ee600){if(this[_0xec06('0x33')][_0x5ee600[_0xec06('0x34')]]){this[_0xec06('0x1c')](_0x5ee600);}};Trigger[_0xec06('0x2a')][_0xec06('0x32')]=function(_0x55b3a8){var _0x1d8c3c;for(var _0xec35cb in this[_0xec06('0x35')]){if(this[_0xec06('0x35')]['hasOwnProperty'](_0xec35cb)){if(this[_0xec06('0x35')][_0xec35cb]['status']){_0x1d8c3c=this[_0xec06('0x36')](this[_0xec06('0x35')][_0xec35cb],_0x55b3a8);if(_0x1d8c3c){_[_0xec06('0x37')](_0x55b3a8,_0x55b3a8[_0xec06('0x38')]);for(var _0x5ed6b0=0x0,_0x4cc4a8,_0x146f34,_0x2b0e9a;_0x5ed6b00x0){_0x59bf34=_[_0xbe14('0x2b')](_0x16f884,_0x29fc64);}return _0x59bf34;}function getCustomFields(_0x1c7cc7,_0x19252f){var _0x34d648=[];var _0x36d4b2={'custom_fields':{}};if(_0x1c7cc7[_0xbe14('0x2a')]>0x0){_[_0xbe14('0x2c')](_0x1c7cc7,function(_0x4168c8){if(_[_0xbe14('0x2d')]([_0xbe14('0x2e'),_0xbe14('0x2f')],_0x4168c8[_0xbe14('0x30')])&&_0x4168c8[_0xbe14('0x31')]&&!_0x4168c8[_0xbe14('0x32')]){_0x36d4b2[_0x4168c8[_0xbe14('0x31')][_0xbe14('0x33')]()]=_0x4168c8[_0xbe14('0x34')][_0xbe14('0x35')]();}else if(_[_0xbe14('0x2d')](['string',_0xbe14('0x2f')],_0x4168c8['type'])&&_0x4168c8['idField']&&_0x4168c8[_0xbe14('0x32')]){_0x36d4b2['custom_fields'][_0x4168c8[_0xbe14('0x36')]]=_0x4168c8[_0xbe14('0x34')]['toString']();}else if(_0x4168c8['type']==='variable'&&_0x4168c8[_0xbe14('0x37')]&&_0x4168c8[_0xbe14('0x36')]&&_0x4168c8['customField']){_0x19252f[_0x4168c8[_0xbe14('0x37')]]&&(_0x36d4b2[_0xbe14('0x38')][_0x4168c8[_0xbe14('0x36')]]=_0x19252f[_0x4168c8[_0xbe14('0x37')]][_0xbe14('0x35')]());}else if(_0x4168c8['type']==='customVariable'&&_0x4168c8[_0xbe14('0x39')]&&_0x4168c8['Variable']['name']&&_0x4168c8['idField']&&_0x4168c8[_0xbe14('0x32')]){_0x19252f[_0x4168c8[_0xbe14('0x39')][_0xbe14('0x3a')][_0xbe14('0x33')]()]&&(_0x36d4b2[_0xbe14('0x38')][_0x4168c8[_0xbe14('0x36')]]=_0x19252f[_0x4168c8[_0xbe14('0x39')][_0xbe14('0x3a')][_0xbe14('0x33')]()][_0xbe14('0x35')]());}});}if(_0x36d4b2[_0xbe14('0x3b')]){_0x36d4b2[_0xbe14('0x3b')]=Number(_0x36d4b2['priority']);}return _0x36d4b2;}function getTicket(_0x4f51f8,_0x43cdaa,_0x2951e1,_0x13bfcf,_0x520e09){logger[_0xbe14('0x12')](_0xbe14('0x3c'));var _0xeda70e=_[_0xbe14('0x3d')]({'subject':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x3f')],_0x520e09,'\x20'),'type':_0xbe14('0x40'),'status':_0xbe14('0x41'),'labels':[_0xbe14('0x42'),'Motion',_0xbe14('0x43')][_0xbe14('0x44')](getTags(_0x13bfcf[_0xbe14('0x45')],_0xbe14('0x3a'))),'description':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x46')],_0x520e09,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0xbe14('0x47'),_0x43cdaa['id']),'class':_0xbe14('0x48')}},'message':{'direction':'in','body':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x46')],_0x520e09,'\x0a')}},getCustomFields(_0x13bfcf['Fields'],_0x520e09));return request({'uri':util['format'](_0xbe14('0x49'),_0x4f51f8[_0xbe14('0x28')],_0x2951e1['id']),'method':_0xbe14('0x29'),'body':_0xeda70e});}exports['queue']=function(_0x5d5318,_0x6b6aa8,_0x59ae4d,_0x5657fe,_0x3593f8,_0x1f0355){var _0x8216c3,_0x5051e4;_0x1f0355['remoteUri']=intUtil['stripTrailingSlash'](_0x1f0355[_0xbe14('0x28')]);_0x1f0355[_0xbe14('0x4a')]=intUtil[_0xbe14('0x4b')](_0x1f0355['serverUrl']);if(_0x3593f8&&_0x3593f8[_0xbe14('0x4c')]){logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x4e'));_0x6b6aa8['recordingURL']=util['format'](_0xbe14('0x4f'),_0x1f0355[_0xbe14('0x4a')],_0x6b6aa8[_0xbe14('0x50')],md5(_0x6b6aa8[_0xbe14('0x50')]));}else{_0x6b6aa8[_0xbe14('0x51')]='';}headers['Authorization']=getAuth(_0x1f0355);return getUser(_0x1f0355,_0x5657fe['email'])[_0xbe14('0xd')](function(_0x2a3623){_0x8216c3=_0x2a3623;logger[_0xbe14('0x12')](_0xbe14('0x52'),_0x8216c3['id']);return getEndUser(_0x1f0355,_0x6b6aa8['calleridname'],_0x6b6aa8[_0xbe14('0x53')]);})[_0xbe14('0xd')](function(_0x53e8ab){_0x5051e4=_0x53e8ab;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x5051e4['id']);return getTicket(_0x1f0355,_0x8216c3,_0x5051e4,_0x59ae4d,_0x6b6aa8);})[_0xbe14('0xd')](function(_0x36c20c){if(_0x36c20c){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x36c20c['id']);switch(_0x1f0355['type']){case'integrationTab':logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x56'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x5657fe[_0xbe14('0x3a')]),_0xbe14('0x58'),{'recordId':_0x36c20c['id']});break;case'newTab':logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x59'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x5657fe['name']),_0xbe14('0x5a'),{'uri':util[_0xbe14('0xb')](_0xbe14('0x5b'),_0x36c20c['id'])});break;default:logger[_0xbe14('0x5c')](_0xbe14('0x4d'),_0xbe14('0x5d'));}}})['catch'](function(_0x5aeea9){console[_0xbe14('0x5c')](_0x5aeea9);logger[_0xbe14('0x5c')](_0xbe14('0x4d'),JSON['stringify'](_0x5aeea9));});};exports['outbound']=function(_0x44fe0d,_0x134878,_0x50d78f,_0x339a86,_0x32496a,_0x50c2a0,_0x28f995){var _0x4a40d2,_0x41ba58;_0x50c2a0[_0xbe14('0x28')]=intUtil[_0xbe14('0x4b')](_0x50c2a0['remoteUri']);_0x50c2a0[_0xbe14('0x4a')]=intUtil[_0xbe14('0x4b')](_0x50c2a0['serverUrl']);if(_0x28f995&&_0x28f995[_0xbe14('0x5e')]&&_0x28f995[_0xbe14('0x5e')]!==_0xbe14('0x5f')){logger[_0xbe14('0x12')](_0xbe14('0x60'),'Recording\x20is\x20enabled!');_0x134878[_0xbe14('0x51')]=util[_0xbe14('0xb')](_0xbe14('0x4f'),_0x50c2a0[_0xbe14('0x4a')],_0x134878[_0xbe14('0x50')],md5(_0x134878[_0xbe14('0x50')]));}headers[_0xbe14('0x61')]=getAuth(_0x50c2a0);return getUser(_0x50c2a0,_0x339a86['email'])[_0xbe14('0xd')](function(_0x1b47a4){_0x4a40d2=_0x1b47a4;logger[_0xbe14('0x12')](_0xbe14('0x52'),_0x4a40d2['id']);return getEndUser(_0x50c2a0,_0x134878[_0xbe14('0x62')],_0x134878[_0xbe14('0x63')]);})[_0xbe14('0xd')](function(_0x32df3c){_0x41ba58=_0x32df3c;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x41ba58['id']);return getTicket(_0x50c2a0,_0x4a40d2,_0x41ba58,_0x50d78f,_0x134878);})[_0xbe14('0xd')](function(_0x4bccfc){if(_0x4bccfc){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x4bccfc['id']);switch(_0x50c2a0[_0xbe14('0x30')]){case _0xbe14('0x64'):logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x56'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x339a86[_0xbe14('0x3a')]),_0xbe14('0x58'),{'recordId':_0x4bccfc['id']});break;case _0xbe14('0x65'):logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x59'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x339a86[_0xbe14('0x3a')]),_0xbe14('0x5a'),{'uri':util[_0xbe14('0xb')]('%s/agent/tickets/%s',_0x50c2a0[_0xbe14('0x28')],_0x4bccfc['id'])});break;default:logger[_0xbe14('0x5c')](_0xbe14('0x60'),_0xbe14('0x5d'));}}})[_0xbe14('0x66')](function(_0x222944){logger[_0xbe14('0x5c')](_0xbe14('0x60'),JSON[_0xbe14('0x19')](_0x222944));});};exports[_0xbe14('0x67')]=function(_0x5917d5,_0x18be56,_0x442ec4,_0x2d4dd4,_0xfd32a3,_0x3ac6d8){var _0x5a1ea6,_0x42b341;_0x3ac6d8[_0xbe14('0x28')]=intUtil[_0xbe14('0x4b')](_0x3ac6d8[_0xbe14('0x28')]);_0x3ac6d8[_0xbe14('0x4a')]=intUtil['stripTrailingSlash'](_0x3ac6d8[_0xbe14('0x4a')]);if(_0xfd32a3&&_0xfd32a3[_0xbe14('0x4c')]){logger[_0xbe14('0x12')]('['+_0x18be56[_0xbe14('0x68')][_0xbe14('0x69')]()+']',_0xbe14('0x4e'));_0x18be56[_0xbe14('0x51')]=util[_0xbe14('0xb')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3ac6d8[_0xbe14('0x4a')],_0x18be56[_0xbe14('0x50')],md5(_0x18be56[_0xbe14('0x50')]));}else{_0x18be56[_0xbe14('0x51')]='';}headers[_0xbe14('0x61')]=getAuth(_0x3ac6d8);return getUser(_0x3ac6d8)[_0xbe14('0xd')](function(_0x445302){_0x5a1ea6=_0x445302;logger['info']('The\x20User\x20ID\x20is:',_0x5a1ea6['id']);return getEndUser(_0x3ac6d8,_0x18be56[_0xbe14('0x6a')],_0x18be56[_0xbe14('0x53')]);})[_0xbe14('0xd')](function(_0x2510a0){_0x42b341=_0x2510a0;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x42b341['id']);return getTicket(_0x3ac6d8,_0x5a1ea6,_0x42b341,_0x442ec4,_0x18be56);})[_0xbe14('0xd')](function(_0x43511e){if(_0x43511e){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x43511e['id']);}})[_0xbe14('0x66')](function(_0x57729f){logger[_0xbe14('0x5c')]('['+_0x18be56[_0xbe14('0x68')][_0xbe14('0x69')]()+']',JSON[_0xbe14('0x19')](_0x57729f));});}; \ No newline at end of file +var _0x55ca=['debug','[HTTP]','stringify','GET','authType','basic','%s:%s','username','token','%s/token:%s','toString','base64','Searching\x20enduser\x20with\x20phone','Enduser\x20found!','_embedded','entries','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','length','forEach','includes','picklist','type','nameField','customField','toLowerCase','content','string','idField','custom_fields','variable','variableName','customVariable','Variable','name','priority','merge','xCALLY','Motion','CTI','concat','Tags','getString','Descriptions','/api/v2/users/%d','user','Fields','stripTrailingSlash','serverUrl','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','calleridname','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','error','Desk\x20account\x20type\x20not\x20recognized','outbound','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','%s/agent/tickets/%s','catch','unmanaged','monitor_format','lastevent','toUpperCase','Recording\x20is\x20enabled!','lodash','request-promise','./util','../../../../config/environment','desk','redis','defaults','localhost','socket.io-emitter','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','%s/users','remoteUri','then','total_entries','find','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me'];(function(_0x1f3918,_0x41f602){var _0x24e395=function(_0x59c7af){while(--_0x59c7af){_0x1f3918['push'](_0x1f3918['shift']());}};_0x24e395(++_0x41f602);}(_0x55ca,0x126));var _0xa55c=function(_0x1defb2,_0x429099){_0x1defb2=_0x1defb2-0x0;var _0xad8973=_0x55ca[_0x1defb2];return _0xad8973;};'use strict';var _=require(_0xa55c('0x0'));var rp=require(_0xa55c('0x1'));var md5=require('md5');var util=require('util');var Redis=require('ioredis');var intUtil=require(_0xa55c('0x2'));var config=require(_0xa55c('0x3'));var logger=require('../../../../config/logger')(_0xa55c('0x4'));config[_0xa55c('0x5')]=_[_0xa55c('0x6')](config[_0xa55c('0x5')],{'host':_0xa55c('0x7'),'port':0x18eb});var io=require(_0xa55c('0x8'))(new Redis(config[_0xa55c('0x5')]));function emit(_0x4d0624,_0x2121fd,_0x2537f0){io['to'](_0x4d0624)['emit'](_0x2121fd,_0x2537f0);}var headers={'Content-Type':_0xa55c('0x9'),'Accept':_0xa55c('0x9')};function getUser(_0x52a3bc,_0x5849ad){if(intUtil[_0xa55c('0xa')](_0x5849ad)===!![]){logger[_0xa55c('0xb')](_0xa55c('0xc'),_0x5849ad);return request({'uri':util[_0xa55c('0xd')](_0xa55c('0xe'),_0x52a3bc[_0xa55c('0xf')])})[_0xa55c('0x10')](function(_0x70c2de){if(_0x70c2de[_0xa55c('0x11')]){return _[_0xa55c('0x12')](_0x70c2de['_embedded']['entries'],{'email':_0x5849ad});}})[_0xa55c('0x10')](function(_0x576044){if(_0x576044){logger['info']('Agent\x20found!');return _0x576044;}else{logger[_0xa55c('0xb')](_0xa55c('0x13'));return request({'uri':util[_0xa55c('0xd')](_0xa55c('0x14'),_0x52a3bc[_0xa55c('0xf')])});}});}else{logger[_0xa55c('0xb')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xa55c('0xd')](_0xa55c('0x14'),_0x52a3bc[_0xa55c('0xf')])});}}function request(_0x31e10d){logger[_0xa55c('0x15')](_0xa55c('0x16'),JSON[_0xa55c('0x17')](_0x31e10d));return rp(_[_0xa55c('0x6')](_0x31e10d,{'method':_0xa55c('0x18'),'headers':headers,'json':!![]}));}function getAuth(_0x4cee3c){var _0x3d4c9e;if(_0x4cee3c[_0xa55c('0x19')]===_0xa55c('0x1a')){_0x3d4c9e=util[_0xa55c('0xd')](_0xa55c('0x1b'),_0x4cee3c[_0xa55c('0x1c')],_0x4cee3c['password']);}else if(_0x4cee3c['authType']===_0xa55c('0x1d')){_0x3d4c9e=util[_0xa55c('0xd')](_0xa55c('0x1e'),_0x4cee3c['username'],_0x4cee3c[_0xa55c('0x1d')]);}return util[_0xa55c('0xd')]('Basic\x20%s',new Buffer(_0x3d4c9e)[_0xa55c('0x1f')](_0xa55c('0x20')));}function getEndUser(_0x940f28,_0x1965f1,_0x234372){logger['info'](_0xa55c('0x21'),_0x234372);return request({'uri':util['format']('%s/customers/search',_0x940f28['remoteUri']),'qs':{'phone':_0x234372}})[_0xa55c('0x10')](function(_0x54b038){if(_0x54b038[_0xa55c('0x11')]){logger[_0xa55c('0xb')](_0xa55c('0x22'));return _0x54b038[_0xa55c('0x23')][_0xa55c('0x24')][0x0];}else{logger[_0xa55c('0xb')](_0xa55c('0x25'));return request({'uri':util[_0xa55c('0xd')](_0xa55c('0x26'),_0x940f28[_0xa55c('0xf')]),'method':_0xa55c('0x27'),'body':{'first_name':_0x1965f1,'title':_0x1965f1,'phone_numbers':[{'type':'work','value':_0x234372}]}});}});}function getTags(_0x430d55,_0x28814f){var _0x1c9f6b=[];if(_0x430d55&&_0x430d55[_0xa55c('0x28')]>0x0){_0x1c9f6b=_['map'](_0x430d55,_0x28814f);}return _0x1c9f6b;}function getCustomFields(_0x1377b0,_0x22f6b6){var _0x1b8388=[];var _0x201941={'custom_fields':{}};if(_0x1377b0[_0xa55c('0x28')]>0x0){_[_0xa55c('0x29')](_0x1377b0,function(_0x52d37f){if(_[_0xa55c('0x2a')](['string',_0xa55c('0x2b')],_0x52d37f[_0xa55c('0x2c')])&&_0x52d37f[_0xa55c('0x2d')]&&!_0x52d37f[_0xa55c('0x2e')]){_0x201941[_0x52d37f['nameField'][_0xa55c('0x2f')]()]=_0x52d37f[_0xa55c('0x30')][_0xa55c('0x1f')]();}else if(_[_0xa55c('0x2a')]([_0xa55c('0x31'),_0xa55c('0x2b')],_0x52d37f[_0xa55c('0x2c')])&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x201941[_0xa55c('0x33')][_0x52d37f[_0xa55c('0x32')]]=_0x52d37f['content']['toString']();}else if(_0x52d37f[_0xa55c('0x2c')]===_0xa55c('0x34')&&_0x52d37f['variableName']&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x22f6b6[_0x52d37f[_0xa55c('0x35')]]&&(_0x201941[_0xa55c('0x33')][_0x52d37f[_0xa55c('0x32')]]=_0x22f6b6[_0x52d37f[_0xa55c('0x35')]][_0xa55c('0x1f')]());}else if(_0x52d37f[_0xa55c('0x2c')]===_0xa55c('0x36')&&_0x52d37f['Variable']&&_0x52d37f['Variable']['name']&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x22f6b6[_0x52d37f[_0xa55c('0x37')]['name'][_0xa55c('0x2f')]()]&&(_0x201941['custom_fields'][_0x52d37f[_0xa55c('0x32')]]=_0x22f6b6[_0x52d37f['Variable'][_0xa55c('0x38')][_0xa55c('0x2f')]()][_0xa55c('0x1f')]());}});}if(_0x201941['priority']){_0x201941[_0xa55c('0x39')]=Number(_0x201941[_0xa55c('0x39')]);}return _0x201941;}function getTicket(_0x47e93c,_0x6f9c4c,_0x194e78,_0x4d9083,_0x529ff8){logger[_0xa55c('0xb')]('Creating\x20new\x20ticket...');var _0x1e75dc=_[_0xa55c('0x3a')]({'subject':intUtil['getString'](_0x4d9083['Subjects'],_0x529ff8,'\x20'),'type':'phone','status':'new','labels':[_0xa55c('0x3b'),_0xa55c('0x3c'),_0xa55c('0x3d')][_0xa55c('0x3e')](getTags(_0x4d9083[_0xa55c('0x3f')],'name')),'description':intUtil[_0xa55c('0x40')](_0x4d9083[_0xa55c('0x41')],_0x529ff8,'\x0a'),'_links':{'assigned_user':{'href':util[_0xa55c('0xd')](_0xa55c('0x42'),_0x6f9c4c['id']),'class':_0xa55c('0x43')}},'message':{'direction':'in','body':intUtil[_0xa55c('0x40')](_0x4d9083['Descriptions'],_0x529ff8,'\x0a')}},getCustomFields(_0x4d9083[_0xa55c('0x44')],_0x529ff8));return request({'uri':util['format']('%s/customers/%d/cases',_0x47e93c[_0xa55c('0xf')],_0x194e78['id']),'method':_0xa55c('0x27'),'body':_0x1e75dc});}exports['queue']=function(_0x2bd98b,_0x508bd3,_0x5f25f7,_0x2f8449,_0x3fea03,_0x1630ac){var _0x540337,_0x1b2708;_0x1630ac[_0xa55c('0xf')]=intUtil['stripTrailingSlash'](_0x1630ac[_0xa55c('0xf')]);_0x1630ac['serverUrl']=intUtil[_0xa55c('0x45')](_0x1630ac[_0xa55c('0x46')]);if(_0x3fea03&&_0x3fea03['monitor_format']){logger[_0xa55c('0xb')](_0xa55c('0x47'),'Recording\x20is\x20enabled!');_0x508bd3[_0xa55c('0x48')]=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x1630ac['serverUrl'],_0x508bd3[_0xa55c('0x4a')],md5(_0x508bd3['uniqueid']));}else{_0x508bd3[_0xa55c('0x48')]='';}headers[_0xa55c('0x4b')]=getAuth(_0x1630ac);return getUser(_0x1630ac,_0x2f8449[_0xa55c('0x4c')])['then'](function(_0x41eab1){_0x540337=_0x41eab1;logger[_0xa55c('0xb')]('The\x20User\x20ID\x20is:',_0x540337['id']);return getEndUser(_0x1630ac,_0x508bd3[_0xa55c('0x4d')],_0x508bd3[_0xa55c('0x4e')]);})['then'](function(_0x11ff1d){_0x1b2708=_0x11ff1d;logger[_0xa55c('0xb')]('The\x20Enduser\x20ID\x20is:',_0x1b2708['id']);return getTicket(_0x1630ac,_0x540337,_0x1b2708,_0x5f25f7,_0x508bd3);})[_0xa55c('0x10')](function(_0x81cee8){if(_0x81cee8){logger[_0xa55c('0xb')](_0xa55c('0x4f'));logger['info'](_0xa55c('0x50'),_0x81cee8['id']);switch(_0x1630ac['type']){case _0xa55c('0x51'):logger[_0xa55c('0xb')](_0xa55c('0x47'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2f8449['name']),_0xa55c('0x53'),{'recordId':_0x81cee8['id']});break;case _0xa55c('0x54'):logger[_0xa55c('0xb')](_0xa55c('0x47'),_0xa55c('0x55'));emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2f8449[_0xa55c('0x38')]),_0xa55c('0x56'),{'uri':util[_0xa55c('0xd')]('https://xcally.desk.com/web/agent/case/%d',_0x81cee8['id'])});break;default:logger[_0xa55c('0x57')](_0xa55c('0x47'),_0xa55c('0x58'));}}})['catch'](function(_0x4c3095){console[_0xa55c('0x57')](_0x4c3095);logger['error'](_0xa55c('0x47'),JSON['stringify'](_0x4c3095));});};exports[_0xa55c('0x59')]=function(_0x228df4,_0x181802,_0x3f9313,_0x2ecf79,_0x5b1cf3,_0x44b7c1,_0x4607ca){var _0x4b85cc,_0x3929a6;_0x44b7c1[_0xa55c('0xf')]=intUtil[_0xa55c('0x45')](_0x44b7c1[_0xa55c('0xf')]);_0x44b7c1['serverUrl']=intUtil['stripTrailingSlash'](_0x44b7c1[_0xa55c('0x46')]);if(_0x4607ca&&_0x4607ca[_0xa55c('0x5a')]&&_0x4607ca[_0xa55c('0x5a')]!==_0xa55c('0x5b')){logger['info'](_0xa55c('0x5c'),'Recording\x20is\x20enabled!');_0x181802[_0xa55c('0x48')]=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x44b7c1[_0xa55c('0x46')],_0x181802[_0xa55c('0x4a')],md5(_0x181802['uniqueid']));}headers[_0xa55c('0x4b')]=getAuth(_0x44b7c1);return getUser(_0x44b7c1,_0x2ecf79['email'])[_0xa55c('0x10')](function(_0x157afe){_0x4b85cc=_0x157afe;logger[_0xa55c('0xb')](_0xa55c('0x5d'),_0x4b85cc['id']);return getEndUser(_0x44b7c1,_0x181802[_0xa55c('0x5e')],_0x181802[_0xa55c('0x5f')]);})[_0xa55c('0x10')](function(_0x53e2be){_0x3929a6=_0x53e2be;logger[_0xa55c('0xb')](_0xa55c('0x60'),_0x3929a6['id']);return getTicket(_0x44b7c1,_0x4b85cc,_0x3929a6,_0x3f9313,_0x181802);})[_0xa55c('0x10')](function(_0x23a30e){if(_0x23a30e){logger[_0xa55c('0xb')]('Ticket\x20created!');logger[_0xa55c('0xb')](_0xa55c('0x50'),_0x23a30e['id']);switch(_0x44b7c1[_0xa55c('0x2c')]){case _0xa55c('0x51'):logger[_0xa55c('0xb')]('[QUEUE]',_0xa55c('0x61'));emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2ecf79[_0xa55c('0x38')]),_0xa55c('0x53'),{'recordId':_0x23a30e['id']});break;case'newTab':logger[_0xa55c('0xb')]('[QUEUE]',_0xa55c('0x55'));emit(util['format'](_0xa55c('0x52'),_0x2ecf79['name']),_0xa55c('0x56'),{'uri':util[_0xa55c('0xd')](_0xa55c('0x62'),_0x44b7c1[_0xa55c('0xf')],_0x23a30e['id'])});break;default:logger[_0xa55c('0x57')](_0xa55c('0x5c'),_0xa55c('0x58'));}}})[_0xa55c('0x63')](function(_0x14b515){logger[_0xa55c('0x57')]('[OUTBOUND]',JSON[_0xa55c('0x17')](_0x14b515));});};exports[_0xa55c('0x64')]=function(_0x4ef914,_0x18b928,_0x2b8b88,_0x3e3b4b,_0x9fe234,_0x1b8b06){var _0xa38271,_0x3cef1f;_0x1b8b06[_0xa55c('0xf')]=intUtil['stripTrailingSlash'](_0x1b8b06[_0xa55c('0xf')]);_0x1b8b06[_0xa55c('0x46')]=intUtil[_0xa55c('0x45')](_0x1b8b06[_0xa55c('0x46')]);if(_0x9fe234&&_0x9fe234[_0xa55c('0x65')]){logger[_0xa55c('0xb')]('['+_0x18b928[_0xa55c('0x66')][_0xa55c('0x67')]()+']',_0xa55c('0x68'));_0x18b928['recordingURL']=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x1b8b06[_0xa55c('0x46')],_0x18b928[_0xa55c('0x4a')],md5(_0x18b928[_0xa55c('0x4a')]));}else{_0x18b928[_0xa55c('0x48')]='';}headers[_0xa55c('0x4b')]=getAuth(_0x1b8b06);return getUser(_0x1b8b06)[_0xa55c('0x10')](function(_0x2e4cf7){_0xa38271=_0x2e4cf7;logger[_0xa55c('0xb')](_0xa55c('0x5d'),_0xa38271['id']);return getEndUser(_0x1b8b06,_0x18b928['calleridname'],_0x18b928[_0xa55c('0x4e')]);})['then'](function(_0x1228a4){_0x3cef1f=_0x1228a4;logger[_0xa55c('0xb')](_0xa55c('0x60'),_0x3cef1f['id']);return getTicket(_0x1b8b06,_0xa38271,_0x3cef1f,_0x2b8b88,_0x18b928);})['then'](function(_0x4d9722){if(_0x4d9722){logger[_0xa55c('0xb')](_0xa55c('0x4f'));logger[_0xa55c('0xb')](_0xa55c('0x50'),_0x4d9722['id']);}})['catch'](function(_0x149cb9){logger[_0xa55c('0x57')]('['+_0x18b928[_0xa55c('0x66')][_0xa55c('0x67')]()+']',JSON[_0xa55c('0x17')](_0x149cb9));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index a68c1ce..e6ff92b 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 _0x1b5c=['queue','/contacts(','callDirection','phonecalls','Fields','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','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]','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','ticketId',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','error','Error\x20running\x20Dynamics365\x20integration','lodash','md5','../../../../config/environment','defaults','localhost','socket.io-emitter','redis','modernAuthentication','data7','tenantId','CloudProvider','resolve','data5','POST','clientId','remoteUri','password','clientSecret','then','access_token','catch',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','validateEmail','email','userEmail','length','isdisabled','info','toUpperCase',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','internalemailaddress','username','toLowerCase','outbound','contacts','/systemusers(','body','headers','odata-entityid','lastIndexOf','enduserId','destcalleridnum','calleridnum','telephone1','contacts?$select=','\x20eq\x20\x27','replace','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','includes','picklist','type','substring','indexOf','content','ticketType','incidents','assign','getString','Subjects','Descriptions','phonecall'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x1b5c,0xfb));var _0xc1b5=function(_0x429948,_0x1a6851){_0x429948=_0x429948-0x0;var _0x35d5d1=_0x1b5c[_0x429948];return _0x35d5d1;};'use strict';var _=require(_0xc1b5('0x0'));var rp=require('request-promise');var util=require('util');var intUtil=require('./util');var md5=require(_0xc1b5('0x1'));var Redis=require('ioredis');var logger=require('../../../../config/logger')('dynamics365');var config=require(_0xc1b5('0x2'));config['redis']=_[_0xc1b5('0x3')](config['redis'],{'host':_0xc1b5('0x4'),'port':0x18eb});var io=require(_0xc1b5('0x5'))(new Redis(config[_0xc1b5('0x6')]));function getAuthToken(_0xda14d5,_0x477190,_0x4a556d){if(_0xda14d5[_0xc1b5('0x7')]){_0xda14d5['remoteUri']=_0xda14d5['CloudProvider'][_0xc1b5('0x8')];_0xda14d5[_0xc1b5('0x9')]=_0xda14d5[_0xc1b5('0xa')]['data2'];return Promise[_0xc1b5('0xb')](_0xda14d5[_0xc1b5('0xa')][_0xc1b5('0xc')]);}var _0x19be6a={'method':_0xc1b5('0xd'),'uri':_0x477190,'form':{'client_id':_0xda14d5[_0xc1b5('0xe')],'resource':_0xda14d5[_0xc1b5('0xf')],'username':_0xda14d5['username'],'password':_0xda14d5[_0xc1b5('0x10')],'grant_type':_0xc1b5('0x10'),'client_secret':_0xda14d5[_0xc1b5('0x11')]},'json':!![]};return rp(_0x19be6a)[_0xc1b5('0x12')](function(_0x89f712){return _0x89f712[_0xc1b5('0x13')];})[_0xc1b5('0x14')](function(_0x423779){logger['error']('['+[_0x4a556d['toUpperCase']()]+_0xc1b5('0x15'));return _0x423779[_0xc1b5('0x16')];});}function getUser(_0x2a4b15,_0x1a53d9,_0x3823db,_0x40a960,_0x323f46,_0x3f78f5){return new Promise(function(_0x368262,_0x4d67c7){return getAuthToken(_0x1a53d9,_0x40a960,_0x3f78f5)[_0xc1b5('0x12')](function(_0x166a6a){var _0x7affb4={'method':_0xc1b5('0x17'),'uri':_0x323f46+_0xc1b5('0x18'),'headers':{'Authorization':_0xc1b5('0x19')+_0x166a6a,'OData-Version':_0xc1b5('0x1a')},'json':!![]};return rp(_0x7affb4);})[_0xc1b5('0x12')](function(_0x54de03){var _0x4fb860=_0x54de03[_0xc1b5('0x1b')];var _0x350ec1=![];var _0x43b1af=null;if(!_['isNil'](_0x3823db)){if(intUtil[_0xc1b5('0x1c')](_0x3823db[_0xc1b5('0x1d')])){_0x2a4b15[_0xc1b5('0x1e')]=_0x3823db[_0xc1b5('0x1d')];for(_0x43b1af=0x0;_0x43b1af<_0x4fb860[_0xc1b5('0x1f')];_0x43b1af++){if(_0x4fb860[_0x43b1af]['internalemailaddress']===_0x3823db[_0xc1b5('0x1d')]&&!_0x4fb860[_0x43b1af][_0xc1b5('0x20')]){_0x350ec1=!![];logger[_0xc1b5('0x21')]('['+[_0x3f78f5[_0xc1b5('0x22')]()]+_0xc1b5('0x23')+_0x4fb860[_0x43b1af][_0xc1b5('0x24')]+'!');_0x2a4b15[_0xc1b5('0x25')]=_0x4fb860[_0x43b1af][_0xc1b5('0x24')];}}}}if(!_0x350ec1){logger['info']('['+[_0x3f78f5[_0xc1b5('0x22')]()]+_0xc1b5('0x26'));_0x2a4b15[_0xc1b5('0x1e')]=_0x1a53d9['username'];for(_0x43b1af=0x0;_0x43b1af<_0x4fb860[_0xc1b5('0x1f')];_0x43b1af++){if(_0x4fb860[_0x43b1af][_0xc1b5('0x27')]===_0x1a53d9[_0xc1b5('0x28')]){_0x2a4b15['userId']=_0x4fb860[_0x43b1af][_0xc1b5('0x24')];}}}_0x368262(_0x2a4b15);})[_0xc1b5('0x14')](function(_0x594d9e){_0x4d67c7(_0x594d9e['message']);});});}function createEndUser(_0x2ba238,_0x2650d6,_0x2e655d,_0x588914,_0x231bce,_0x288ee7,_0x4bebcb){return new Promise(function(_0x481b1b,_0x465404){return getAuthToken(_0x2650d6,_0x2e655d,_0x288ee7)[_0xc1b5('0x12')](function(_0x206c49){var _0x2e29ae=_0x288ee7[_0xc1b5('0x29')]()===_0xc1b5('0x2a')?_0x231bce['destcalleridnum']:_0x231bce['calleridnum'];var _0x3fd537={'method':_0xc1b5('0xd'),'uri':_0x588914+_0xc1b5('0x2b'),'body':{'fullname':_0x2e29ae,'firstname':_0x2e29ae,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xc1b5('0x2c')+_0x2ba238[_0xc1b5('0x25')]+')'},'headers':{'Authorization':_0xc1b5('0x19')+_0x206c49,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};_0x3fd537[_0xc1b5('0x2d')][_0x4bebcb]=_0x2e29ae;return rp(_0x3fd537);})['then'](function(_0xfd1df0){var _0x58f331=_0xfd1df0[_0xc1b5('0x2e')][_0xc1b5('0x2f')];var _0x2525c=_0x58f331['substring'](_0x58f331[_0xc1b5('0x30')]('(')+0x1,_0x58f331['lastIndexOf'](')'));_0x2ba238[_0xc1b5('0x31')]=_0x2525c;_0x481b1b(_0x2ba238);})[_0xc1b5('0x14')](function(_0x24c828){_0x465404(_0x24c828[_0xc1b5('0x16')]);});});}function getEndUser(_0x182682,_0x233225,_0x4d710d,_0x1f5fa2,_0x4b3abe,_0x29e0c4,_0x4427cd,_0x861661){var _0x5d8dde=_0x29e0c4[_0xc1b5('0x29')]()===_0xc1b5('0x2a')?_0x4b3abe[_0xc1b5('0x32')]:_0x4b3abe[_0xc1b5('0x33')];return getAuthToken(_0x233225,_0x4d710d,_0x29e0c4)[_0xc1b5('0x12')](function(_0x142b8b){_0x861661=_0x861661?_0x861661:_0xc1b5('0x34');var _0x27e0f6={'method':'GET','uri':_0x1f5fa2+_0xc1b5('0x35')+_0x861661+'&$filter='+_0x861661+_0xc1b5('0x36')+_0x5d8dde[_0xc1b5('0x37')]('+','%2b')+'\x27','headers':{'Authorization':'Bearer\x20'+_0x142b8b,'If-None-Match':null,'OData-Version':_0xc1b5('0x1a')},'json':!![]};return rp(_0x27e0f6);})[_0xc1b5('0x12')](function(_0xbbb2ea){var _0x2d2ab3=![];if(!_0xbbb2ea)return _0x2d2ab3;var _0x39fea1=_0xbbb2ea[_0xc1b5('0x1b')];for(var _0x4b3424=0x0;_0x4b3424<_0x39fea1[_0xc1b5('0x1f')];_0x4b3424++){if(_0x39fea1[_0x4b3424][_0x861661]===_0x5d8dde){_0x2d2ab3=!![];_0x182682[_0xc1b5('0x31')]=_0x39fea1[_0x4b3424][_0xc1b5('0x38')];}}return _0x2d2ab3;})[_0xc1b5('0x12')](function(_0xae4064){if(_0xae4064)return _0x182682;if(_0x4427cd===_0xc1b5('0x39')){logger[_0xc1b5('0x21')]('['+[_0x29e0c4[_0xc1b5('0x22')]()]+_0xc1b5('0x3a'));return _0x182682;}return createEndUser(_0x182682,_0x233225,_0x4d710d,_0x1f5fa2,_0x4b3abe,_0x29e0c4,_0x861661)[_0xc1b5('0x12')](function(_0x1caeb9){logger['info']('['+[_0x29e0c4[_0xc1b5('0x22')]()]+_0xc1b5('0x3b'),_0x1caeb9[_0xc1b5('0x31')]);return _0x1caeb9;});});}function getCustomFields(_0x2a26f6,_0x4d45b2,_0x233850){var _0x3f24d8={};if(_0x2a26f6[_0xc1b5('0x1f')]>0x0){_['forEach'](_0x2a26f6,function(_0xe0db42){if(_[_0xc1b5('0x3c')](['string',_0xc1b5('0x3d')],_0xe0db42[_0xc1b5('0x3e')])&&_0xe0db42['nameField']&&!_0xe0db42['customField']){var _0x124590=_0xe0db42['idField'][_0xc1b5('0x29')]();var _0x51e121=_0x124590[_0xc1b5('0x3f')](0x0,_0x124590[_0xc1b5('0x40')]('_'));var _0x531224=_0x124590[_0xc1b5('0x3f')](_0x124590['indexOf']('_')+0x1);if(_0x51e121===_0x233850){_0x3f24d8[_0x531224]=_0xe0db42[_0xc1b5('0x41')];}}});}return _0x3f24d8;}function getTicket(_0x426b7d,_0x51084d,_0x5e88dd,_0x505d6c,_0x314bd8,_0x2a4219,_0x3293f2){return new Promise(function(_0x593545,_0x136c4c){var _0x10c05d;return getAuthToken(_0x51084d,_0x5e88dd,_0x3293f2)[_0xc1b5('0x12')](function(_0x549905){if(_0x2a4219[_0xc1b5('0x42')]==='incident'){_0x10c05d={'method':'POST','uri':_0x505d6c+_0xc1b5('0x43'),'body':Object[_0xc1b5('0x44')]({},{'title':intUtil[_0xc1b5('0x45')](_0x2a4219[_0xc1b5('0x46')],_0x314bd8,'\x20'),'description':intUtil[_0xc1b5('0x45')](_0x2a4219[_0xc1b5('0x47')],_0x314bd8,'\x0a'),'customerid_contact@odata.bind':_0x426b7d[_0xc1b5('0x31')]?'/contacts('+_0x426b7d[_0xc1b5('0x31')]+')':undefined,'ownerid@odata.bind':_0xc1b5('0x2c')+_0x426b7d[_0xc1b5('0x25')]+')','caseorigincode':'1'},getCustomFields(_0x2a4219['Fields'],_0x314bd8,_0x2a4219[_0xc1b5('0x42')])),'headers':{'Authorization':_0xc1b5('0x19')+_0x549905,'OData-Version':_0xc1b5('0x1a')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x2a4219[_0xc1b5('0x42')]===_0xc1b5('0x48')){var _0x5906d1=_0x426b7d['enduserId']?[{'partyid_systemuser@odata.bind':_0xc1b5('0x2c')+_0x426b7d[_0xc1b5('0x25')]+')','participationtypemask':_0x426b7d['callDirection']===_0xc1b5('0x49')?0x2:0x1},{'partyid_contact@odata.bind':_0xc1b5('0x4a')+_0x426b7d[_0xc1b5('0x31')]+')','participationtypemask':_0x426b7d[_0xc1b5('0x4b')]===_0xc1b5('0x49')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0xc1b5('0x2c')+_0x426b7d[_0xc1b5('0x25')]+')','participationtypemask':_0x426b7d[_0xc1b5('0x4b')]===_0xc1b5('0x49')?0x2:0x1}];_0x10c05d={'method':_0xc1b5('0xd'),'uri':_0x505d6c+_0xc1b5('0x4c'),'body':Object[_0xc1b5('0x44')]({},{'subject':intUtil['getString'](_0x2a4219[_0xc1b5('0x46')],_0x314bd8,'\x20'),'phonenumber':String(_0x314bd8[_0xc1b5('0x33')]),'description':intUtil[_0xc1b5('0x45')](_0x2a4219[_0xc1b5('0x47')],_0x314bd8,'\x0a'),'regardingobjectid_contact@odata.bind':_0x426b7d[_0xc1b5('0x31')]?'/contacts('+_0x426b7d['enduserId']+')':undefined,'ownerid@odata.bind':_0xc1b5('0x2c')+_0x426b7d[_0xc1b5('0x25')]+')','directioncode':_0x426b7d[_0xc1b5('0x4b')]===_0xc1b5('0x49')?![]:!![],'phonecall_activity_parties':_0x5906d1},getCustomFields(_0x2a4219[_0xc1b5('0x4d')],_0x314bd8,_0x2a4219[_0xc1b5('0x42')])),'headers':{'Authorization':'Bearer\x20'+_0x549905,'OData-Version':_0xc1b5('0x1a')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x10c05d);})[_0xc1b5('0x12')](function(_0x233040){var _0x346622=_0x233040['headers']['odata-entityid'];var _0x16880e=_0x346622[_0xc1b5('0x3f')](_0x346622['lastIndexOf']('(')+0x1,_0x346622['lastIndexOf'](')'));_0x426b7d['ticketId']=_0x16880e;_0x593545(_0x426b7d);})['catch'](function(_0x5474e0){_0x136c4c(_0x5474e0[_0xc1b5('0x16')]);});});}function emit(_0x9875d2,_0x1e1115,_0x419be9,_0x4a0fd3){var _0x295f0e={'uri':util[_0xc1b5('0x4e')](_0xc1b5('0x4f'),_0x9875d2,_0x419be9,_0x4a0fd3)};io['to'](util['format'](_0xc1b5('0x50'),_0x1e1115))['emit'](_0xc1b5('0x51'),_0x295f0e);}exports['cs']=function(_0x13a83d,_0x24a942,_0x5a8104,_0x3456ab,_0x3769a1,_0x13e7b3,_0x2c58f8,_0x3cd2ca){var _0x1b6c8c={};_0x13e7b3[_0xc1b5('0xf')]=_0x13e7b3[_0xc1b5('0x7')]?intUtil[_0xc1b5('0x52')](_0x13e7b3[_0xc1b5('0xa')][_0xc1b5('0x8')]):intUtil[_0xc1b5('0x52')](_0x13e7b3['remoteUri']);_0x13e7b3[_0xc1b5('0x53')]=intUtil[_0xc1b5('0x52')](_0x13e7b3[_0xc1b5('0x53')]);_0x1b6c8c[_0xc1b5('0x4b')]=_0x3cd2ca===_0xc1b5('0x49')||_0x3cd2ca===_0xc1b5('0x54')?_0xc1b5('0x49'):_0xc1b5('0x2a');var _0x95efe9=_0x13e7b3[_0xc1b5('0x7')]?util[_0xc1b5('0x4e')](_0xc1b5('0x55'),_0x13e7b3[_0xc1b5('0xa')][_0xc1b5('0x8')]):util[_0xc1b5('0x4e')](_0xc1b5('0x55'),_0x13e7b3['remoteUri']);var _0x16e477=util[_0xc1b5('0x4e')](_0xc1b5('0x56'),_0x13e7b3[_0xc1b5('0x9')]);var _0x40b9c0=util['format'](_0xc1b5('0x57'),_0x13e7b3[_0xc1b5('0x53')],_0x24a942['uniqueid'],md5(_0x24a942[_0xc1b5('0x58')]));if(_0x3769a1&&_0x3769a1[_0xc1b5('0x59')]){logger[_0xc1b5('0x21')](_0xc1b5('0x5a'),'Recording\x20is\x20enabled!');_0x24a942[_0xc1b5('0x5b')]=_0x40b9c0;}else if(_0x2c58f8&&_0x2c58f8[_0xc1b5('0x5c')]&&_0x2c58f8['recordingFormat']!==_0xc1b5('0x5d')){logger['info'](_0xc1b5('0x5e'),_0xc1b5('0x5f'));_0x24a942[_0xc1b5('0x5b')]=_0x40b9c0;}else{_0x24a942[_0xc1b5('0x5b')]='';}return getUser(_0x1b6c8c,_0x13e7b3,_0x3456ab,_0x16e477,_0x95efe9,_0x3cd2ca)[_0xc1b5('0x12')](function(_0x54d086){logger['info']('['+_0x3cd2ca[_0xc1b5('0x22')]()+']\x20The\x20User\x20ID\x20is:',_0x54d086[_0xc1b5('0x25')]);logger[_0xc1b5('0x21')]('['+_0x3cd2ca[_0xc1b5('0x22')]()+']\x20The\x20User\x20email\x20is:',_0x54d086[_0xc1b5('0x1e')]);return getEndUser(_0x54d086,_0x13e7b3,_0x16e477,_0x95efe9,_0x24a942,_0x3cd2ca,_0x5a8104[_0xc1b5('0x60')],_0x5a8104[_0xc1b5('0x61')]);})[_0xc1b5('0x12')](function(_0x37218e){logger[_0xc1b5('0x21')]('['+_0x3cd2ca[_0xc1b5('0x22')]()+_0xc1b5('0x62'),_0x37218e[_0xc1b5('0x31')]);logger[_0xc1b5('0x21')]('['+_0x3cd2ca[_0xc1b5('0x22')]()+_0xc1b5('0x63'),_0x24a942[_0xc1b5('0x33')]);return getTicket(_0x37218e,_0x13e7b3,_0x16e477,_0x95efe9,_0x24a942,_0x5a8104,_0x3cd2ca);})[_0xc1b5('0x12')](function(_0x32414a){logger[_0xc1b5('0x21')](util[_0xc1b5('0x4e')]('['+_0x3cd2ca[_0xc1b5('0x22')]()+_0xc1b5('0x64'),_0x5a8104['ticketType'],_0x32414a[_0xc1b5('0x65')]));logger[_0xc1b5('0x21')](util[_0xc1b5('0x4e')]('['+_0x3cd2ca[_0xc1b5('0x22')]()+_0xc1b5('0x66'),_0x3cd2ca));if(_0x3cd2ca!=='unmanaged'&&_0x5a8104['openNewTab']){logger[_0xc1b5('0x21')]('['+_0x3cd2ca[_0xc1b5('0x22')]()+']',_0xc1b5('0x67'));emit(_0x13e7b3[_0xc1b5('0xf')],_0x3456ab[_0xc1b5('0x68')],_0x5a8104[_0xc1b5('0x42')],_0x32414a[_0xc1b5('0x65')]);}})[_0xc1b5('0x14')](function(_0xe48689){logger['error']('['+_0x3cd2ca[_0xc1b5('0x22')]()+_0xc1b5('0x69'),_0xe48689[_0xc1b5('0x16')]);console[_0xc1b5('0x6a')](_0xc1b5('0x6b'),_0xe48689);});}; \ No newline at end of file +var _0xd1d5=['recordingURL',']\x20The\x20User\x20ID\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','redis','defaults','localhost','socket.io-emitter','modernAuthentication','tenantId','CloudProvider','data2','POST','username','password','clientSecret','then','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','value','isNil','validateEmail','email','userEmail','length','internalemailaddress','info','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','toLowerCase','destcalleridnum','calleridnum','contacts','/systemusers(','4.0','body','headers','odata-entityid','substring','lastIndexOf','outbound','telephone1','&$filter=','replace','%2b','enduserId','contactid',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','includes','picklist','idField','indexOf','content','ticketType','incidents','assign','getString','Subjects','Descriptions','/contacts(','Fields','phonecall','callDirection','queue','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','remoteUri','stripTrailingSlash','serverUrl','unmanaged','data7','%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!','recordingFormat','[OUTBOUND]'];(function(_0x48cc24,_0x277b4e){var _0x49c43d=function(_0x249418){while(--_0x249418){_0x48cc24['push'](_0x48cc24['shift']());}};_0x49c43d(++_0x277b4e);}(_0xd1d5,0xdf));var _0x5d1d=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xd1d5[_0x40ac5e];return _0x2839d6;};'use strict';var _=require(_0x5d1d('0x0'));var rp=require(_0x5d1d('0x1'));var util=require(_0x5d1d('0x2'));var intUtil=require(_0x5d1d('0x3'));var md5=require(_0x5d1d('0x4'));var Redis=require(_0x5d1d('0x5'));var logger=require(_0x5d1d('0x6'))(_0x5d1d('0x7'));var config=require('../../../../config/environment');config[_0x5d1d('0x8')]=_[_0x5d1d('0x9')](config[_0x5d1d('0x8')],{'host':_0x5d1d('0xa'),'port':0x18eb});var io=require(_0x5d1d('0xb'))(new Redis(config[_0x5d1d('0x8')]));function getAuthToken(_0x2a9c6e,_0x287e8c,_0x5531db){if(_0x2a9c6e[_0x5d1d('0xc')]){_0x2a9c6e['remoteUri']=_0x2a9c6e['CloudProvider']['data7'];_0x2a9c6e[_0x5d1d('0xd')]=_0x2a9c6e[_0x5d1d('0xe')][_0x5d1d('0xf')];return Promise['resolve'](_0x2a9c6e[_0x5d1d('0xe')]['data5']);}var _0x299ee9={'method':_0x5d1d('0x10'),'uri':_0x287e8c,'form':{'client_id':_0x2a9c6e['clientId'],'resource':_0x2a9c6e['remoteUri'],'username':_0x2a9c6e[_0x5d1d('0x11')],'password':_0x2a9c6e[_0x5d1d('0x12')],'grant_type':_0x5d1d('0x12'),'client_secret':_0x2a9c6e[_0x5d1d('0x13')]},'json':!![]};return rp(_0x299ee9)[_0x5d1d('0x14')](function(_0x1e8aa8){return _0x1e8aa8[_0x5d1d('0x15')];})[_0x5d1d('0x16')](function(_0x19fc99){logger[_0x5d1d('0x17')]('['+[_0x5531db[_0x5d1d('0x18')]()]+_0x5d1d('0x19'));return _0x19fc99[_0x5d1d('0x1a')];});}function getUser(_0x4ea263,_0x453005,_0x2a8c0c,_0x3f6153,_0x37485f,_0x267a98){return new Promise(function(_0x1a0e6c,_0x4ef95f){return getAuthToken(_0x453005,_0x3f6153,_0x267a98)[_0x5d1d('0x14')](function(_0x43e11e){var _0x2d4eda={'method':_0x5d1d('0x1b'),'uri':_0x37485f+_0x5d1d('0x1c'),'headers':{'Authorization':_0x5d1d('0x1d')+_0x43e11e,'OData-Version':'4.0'},'json':!![]};return rp(_0x2d4eda);})[_0x5d1d('0x14')](function(_0x536d20){var _0x5c1cc2=_0x536d20[_0x5d1d('0x1e')];var _0x6e1fa9=![];var _0x407e4f=null;if(!_[_0x5d1d('0x1f')](_0x2a8c0c)){if(intUtil[_0x5d1d('0x20')](_0x2a8c0c[_0x5d1d('0x21')])){_0x4ea263[_0x5d1d('0x22')]=_0x2a8c0c[_0x5d1d('0x21')];for(_0x407e4f=0x0;_0x407e4f<_0x5c1cc2[_0x5d1d('0x23')];_0x407e4f++){if(_0x5c1cc2[_0x407e4f][_0x5d1d('0x24')]===_0x2a8c0c[_0x5d1d('0x21')]&&!_0x5c1cc2[_0x407e4f]['isdisabled']){_0x6e1fa9=!![];logger[_0x5d1d('0x25')]('['+[_0x267a98[_0x5d1d('0x18')]()]+']\x20Agent\x20found\x20'+_0x5c1cc2[_0x407e4f][_0x5d1d('0x26')]+'!');_0x4ea263[_0x5d1d('0x27')]=_0x5c1cc2[_0x407e4f][_0x5d1d('0x26')];}}}}if(!_0x6e1fa9){logger[_0x5d1d('0x25')]('['+[_0x267a98[_0x5d1d('0x18')]()]+_0x5d1d('0x28'));_0x4ea263[_0x5d1d('0x22')]=_0x453005[_0x5d1d('0x11')];for(_0x407e4f=0x0;_0x407e4f<_0x5c1cc2[_0x5d1d('0x23')];_0x407e4f++){if(_0x5c1cc2[_0x407e4f][_0x5d1d('0x24')]===_0x453005[_0x5d1d('0x11')]){_0x4ea263[_0x5d1d('0x27')]=_0x5c1cc2[_0x407e4f][_0x5d1d('0x26')];}}}_0x1a0e6c(_0x4ea263);})[_0x5d1d('0x16')](function(_0x215a0b){_0x4ef95f(_0x215a0b[_0x5d1d('0x1a')]);});});}function createEndUser(_0x27a080,_0x2780b0,_0x410a68,_0xab9e76,_0x4e592f,_0x3e04f5,_0x373868){return new Promise(function(_0x6260e9,_0x374341){return getAuthToken(_0x2780b0,_0x410a68,_0x3e04f5)[_0x5d1d('0x14')](function(_0x36bc4d){var _0x30e16b=_0x3e04f5[_0x5d1d('0x29')]()==='outbound'?_0x4e592f[_0x5d1d('0x2a')]:_0x4e592f[_0x5d1d('0x2b')];var _0x434711={'method':_0x5d1d('0x10'),'uri':_0xab9e76+_0x5d1d('0x2c'),'body':{'fullname':_0x30e16b,'firstname':_0x30e16b,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x5d1d('0x2d')+_0x27a080[_0x5d1d('0x27')]+')'},'headers':{'Authorization':_0x5d1d('0x1d')+_0x36bc4d,'OData-Version':_0x5d1d('0x2e')},'json':!![],'resolveWithFullResponse':!![]};_0x434711[_0x5d1d('0x2f')][_0x373868]=_0x30e16b;return rp(_0x434711);})[_0x5d1d('0x14')](function(_0x5ab918){var _0x28087f=_0x5ab918[_0x5d1d('0x30')][_0x5d1d('0x31')];var _0x5ad320=_0x28087f[_0x5d1d('0x32')](_0x28087f['lastIndexOf']('(')+0x1,_0x28087f[_0x5d1d('0x33')](')'));_0x27a080['enduserId']=_0x5ad320;_0x6260e9(_0x27a080);})[_0x5d1d('0x16')](function(_0x1e70f2){_0x374341(_0x1e70f2[_0x5d1d('0x1a')]);});});}function getEndUser(_0x27a1ce,_0x255e06,_0x330b38,_0x533d83,_0x4c3c90,_0x1c38c7,_0x145763,_0x1b7ab7){var _0x266e82=_0x1c38c7[_0x5d1d('0x29')]()===_0x5d1d('0x34')?_0x4c3c90[_0x5d1d('0x2a')]:_0x4c3c90[_0x5d1d('0x2b')];return getAuthToken(_0x255e06,_0x330b38,_0x1c38c7)[_0x5d1d('0x14')](function(_0x5a5600){_0x1b7ab7=_0x1b7ab7?_0x1b7ab7:_0x5d1d('0x35');var _0x119883={'method':'GET','uri':_0x533d83+'contacts?$select='+_0x1b7ab7+_0x5d1d('0x36')+_0x1b7ab7+'\x20eq\x20\x27'+_0x266e82[_0x5d1d('0x37')]('+',_0x5d1d('0x38'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x5a5600,'If-None-Match':null,'OData-Version':_0x5d1d('0x2e')},'json':!![]};return rp(_0x119883);})[_0x5d1d('0x14')](function(_0xf4ff27){var _0x23d3df=![];if(!_0xf4ff27)return _0x23d3df;var _0x1a6283=_0xf4ff27[_0x5d1d('0x1e')];for(var _0x42c9b1=0x0;_0x42c9b1<_0x1a6283[_0x5d1d('0x23')];_0x42c9b1++){if(_0x1a6283[_0x42c9b1][_0x1b7ab7]===_0x266e82){_0x23d3df=!![];_0x27a1ce[_0x5d1d('0x39')]=_0x1a6283[_0x42c9b1][_0x5d1d('0x3a')];}}return _0x23d3df;})[_0x5d1d('0x14')](function(_0x7dec43){if(_0x7dec43)return _0x27a1ce;if(_0x145763==='nothing'){logger[_0x5d1d('0x25')]('['+[_0x1c38c7[_0x5d1d('0x18')]()]+_0x5d1d('0x3b'));return _0x27a1ce;}return createEndUser(_0x27a1ce,_0x255e06,_0x330b38,_0x533d83,_0x4c3c90,_0x1c38c7,_0x1b7ab7)[_0x5d1d('0x14')](function(_0x1cc374){logger[_0x5d1d('0x25')]('['+[_0x1c38c7[_0x5d1d('0x18')]()]+_0x5d1d('0x3c'),_0x1cc374['enduserId']);return _0x1cc374;});});}function getCustomFields(_0xdb1dcb,_0x3f8806,_0x1c5094){var _0x40aac4={};if(_0xdb1dcb['length']>0x0){_[_0x5d1d('0x3d')](_0xdb1dcb,function(_0x4cf603){if(_[_0x5d1d('0x3e')](['string',_0x5d1d('0x3f')],_0x4cf603['type'])&&_0x4cf603['nameField']&&!_0x4cf603['customField']){var _0x5a6790=_0x4cf603[_0x5d1d('0x40')]['toLowerCase']();var _0x29a017=_0x5a6790['substring'](0x0,_0x5a6790[_0x5d1d('0x41')]('_'));var _0x59b754=_0x5a6790['substring'](_0x5a6790[_0x5d1d('0x41')]('_')+0x1);if(_0x29a017===_0x1c5094){_0x40aac4[_0x59b754]=_0x4cf603[_0x5d1d('0x42')];}}});}return _0x40aac4;}function getTicket(_0xc4c9ee,_0x321c3a,_0x3754fc,_0xc59cf5,_0x167f44,_0x102cd,_0x4d8924){return new Promise(function(_0x2b01a6,_0xc4805c){var _0x4028cd;return getAuthToken(_0x321c3a,_0x3754fc,_0x4d8924)[_0x5d1d('0x14')](function(_0x3cf5f2){if(_0x102cd[_0x5d1d('0x43')]==='incident'){_0x4028cd={'method':'POST','uri':_0xc59cf5+_0x5d1d('0x44'),'body':Object[_0x5d1d('0x45')]({},{'title':intUtil[_0x5d1d('0x46')](_0x102cd[_0x5d1d('0x47')],_0x167f44,'\x20'),'description':intUtil['getString'](_0x102cd[_0x5d1d('0x48')],_0x167f44,'\x0a'),'customerid_contact@odata.bind':_0xc4c9ee[_0x5d1d('0x39')]?_0x5d1d('0x49')+_0xc4c9ee[_0x5d1d('0x39')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0xc4c9ee['userId']+')','caseorigincode':'1'},getCustomFields(_0x102cd[_0x5d1d('0x4a')],_0x167f44,_0x102cd['ticketType'])),'headers':{'Authorization':'Bearer\x20'+_0x3cf5f2,'OData-Version':_0x5d1d('0x2e')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x102cd['ticketType']===_0x5d1d('0x4b')){var _0x4bb2a1=_0xc4c9ee[_0x5d1d('0x39')]?[{'partyid_systemuser@odata.bind':_0x5d1d('0x2d')+_0xc4c9ee[_0x5d1d('0x27')]+')','participationtypemask':_0xc4c9ee[_0x5d1d('0x4c')]===_0x5d1d('0x4d')?0x2:0x1},{'partyid_contact@odata.bind':_0x5d1d('0x49')+_0xc4c9ee[_0x5d1d('0x39')]+')','participationtypemask':_0xc4c9ee['callDirection']==='queue'?0x1:0x2}]:[{'partyid_systemuser@odata.bind':'/systemusers('+_0xc4c9ee[_0x5d1d('0x27')]+')','participationtypemask':_0xc4c9ee[_0x5d1d('0x4c')]===_0x5d1d('0x4d')?0x2:0x1}];_0x4028cd={'method':_0x5d1d('0x10'),'uri':_0xc59cf5+'phonecalls','body':Object[_0x5d1d('0x45')]({},{'subject':intUtil[_0x5d1d('0x46')](_0x102cd['Subjects'],_0x167f44,'\x20'),'phonenumber':String(_0x167f44[_0x5d1d('0x2b')]),'description':intUtil[_0x5d1d('0x46')](_0x102cd['Descriptions'],_0x167f44,'\x0a'),'regardingobjectid_contact@odata.bind':_0xc4c9ee[_0x5d1d('0x39')]?_0x5d1d('0x49')+_0xc4c9ee[_0x5d1d('0x39')]+')':undefined,'ownerid@odata.bind':_0x5d1d('0x2d')+_0xc4c9ee[_0x5d1d('0x27')]+')','directioncode':_0xc4c9ee['callDirection']===_0x5d1d('0x4d')?![]:!![],'phonecall_activity_parties':_0x4bb2a1},getCustomFields(_0x102cd[_0x5d1d('0x4a')],_0x167f44,_0x102cd[_0x5d1d('0x43')])),'headers':{'Authorization':'Bearer\x20'+_0x3cf5f2,'OData-Version':_0x5d1d('0x2e')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x4028cd);})[_0x5d1d('0x14')](function(_0x5470e8){var _0x423672=_0x5470e8[_0x5d1d('0x30')][_0x5d1d('0x31')];var _0x5de9c1=_0x423672[_0x5d1d('0x32')](_0x423672['lastIndexOf']('(')+0x1,_0x423672['lastIndexOf'](')'));_0xc4c9ee[_0x5d1d('0x4e')]=_0x5de9c1;_0x2b01a6(_0xc4c9ee);})[_0x5d1d('0x16')](function(_0x2d0458){_0xc4805c(_0x2d0458[_0x5d1d('0x1a')]);});});}function emit(_0x3b33a3,_0x3e65ae,_0x403728,_0x18dae0){var _0x5e5251={'uri':util[_0x5d1d('0x4f')](_0x5d1d('0x50'),_0x3b33a3,_0x403728,_0x18dae0)};io['to'](util[_0x5d1d('0x4f')](_0x5d1d('0x51'),_0x3e65ae))[_0x5d1d('0x52')](_0x5d1d('0x53'),_0x5e5251);}exports['cs']=function(_0x15e91e,_0x20408d,_0x2eb8be,_0x3f4aa6,_0x19324f,_0x10e0f1,_0x8987c8,_0x1ecfc2){var _0x33e26e={};_0x10e0f1[_0x5d1d('0x54')]=_0x10e0f1[_0x5d1d('0xc')]?intUtil[_0x5d1d('0x55')](_0x10e0f1[_0x5d1d('0xe')]['data7']):intUtil[_0x5d1d('0x55')](_0x10e0f1['remoteUri']);_0x10e0f1['serverUrl']=intUtil[_0x5d1d('0x55')](_0x10e0f1[_0x5d1d('0x56')]);_0x33e26e['callDirection']=_0x1ecfc2===_0x5d1d('0x4d')||_0x1ecfc2===_0x5d1d('0x57')?_0x5d1d('0x4d'):_0x5d1d('0x34');var _0x1f6c37=_0x10e0f1[_0x5d1d('0xc')]?util[_0x5d1d('0x4f')]('%s/api/data/v9.0/',_0x10e0f1[_0x5d1d('0xe')][_0x5d1d('0x58')]):util[_0x5d1d('0x4f')](_0x5d1d('0x59'),_0x10e0f1[_0x5d1d('0x54')]);var _0x1801ab=util[_0x5d1d('0x4f')](_0x5d1d('0x5a'),_0x10e0f1[_0x5d1d('0xd')]);var _0x1ffd30=util[_0x5d1d('0x4f')](_0x5d1d('0x5b'),_0x10e0f1[_0x5d1d('0x56')],_0x20408d[_0x5d1d('0x5c')],md5(_0x20408d[_0x5d1d('0x5c')]));if(_0x19324f&&_0x19324f[_0x5d1d('0x5d')]){logger[_0x5d1d('0x25')](_0x5d1d('0x5e'),_0x5d1d('0x5f'));_0x20408d['recordingURL']=_0x1ffd30;}else if(_0x8987c8&&_0x8987c8['recordingFormat']&&_0x8987c8[_0x5d1d('0x60')]!=='none'){logger[_0x5d1d('0x25')](_0x5d1d('0x61'),_0x5d1d('0x5f'));_0x20408d[_0x5d1d('0x62')]=_0x1ffd30;}else{_0x20408d[_0x5d1d('0x62')]='';}return getUser(_0x33e26e,_0x10e0f1,_0x3f4aa6,_0x1801ab,_0x1f6c37,_0x1ecfc2)[_0x5d1d('0x14')](function(_0x2a941f){logger[_0x5d1d('0x25')]('['+_0x1ecfc2[_0x5d1d('0x18')]()+_0x5d1d('0x63'),_0x2a941f['userId']);logger[_0x5d1d('0x25')]('['+_0x1ecfc2[_0x5d1d('0x18')]()+']\x20The\x20User\x20email\x20is:',_0x2a941f['userEmail']);return getEndUser(_0x2a941f,_0x10e0f1,_0x1801ab,_0x1f6c37,_0x20408d,_0x1ecfc2,_0x2eb8be[_0x5d1d('0x64')],_0x2eb8be[_0x5d1d('0x65')]);})['then'](function(_0x54ced5){logger['info']('['+_0x1ecfc2['toUpperCase']()+']\x20The\x20Enduser\x20ID\x20is:',_0x54ced5['enduserId']);logger[_0x5d1d('0x25')]('['+_0x1ecfc2[_0x5d1d('0x18')]()+']\x20The\x20Enduser\x20phone\x20is:',_0x20408d[_0x5d1d('0x2b')]);return getTicket(_0x54ced5,_0x10e0f1,_0x1801ab,_0x1f6c37,_0x20408d,_0x2eb8be,_0x1ecfc2);})[_0x5d1d('0x14')](function(_0x592a3c){logger[_0x5d1d('0x25')](util[_0x5d1d('0x4f')]('['+_0x1ecfc2['toUpperCase']()+_0x5d1d('0x66'),_0x2eb8be[_0x5d1d('0x43')],_0x592a3c['ticketId']));logger[_0x5d1d('0x25')](util[_0x5d1d('0x4f')]('['+_0x1ecfc2[_0x5d1d('0x18')]()+_0x5d1d('0x67'),_0x1ecfc2));if(_0x1ecfc2!=='unmanaged'&&_0x2eb8be['openNewTab']){logger[_0x5d1d('0x25')]('['+_0x1ecfc2['toUpperCase']()+']',_0x5d1d('0x68'));emit(_0x10e0f1['remoteUri'],_0x3f4aa6[_0x5d1d('0x69')],_0x2eb8be[_0x5d1d('0x43')],_0x592a3c[_0x5d1d('0x4e')]);}})[_0x5d1d('0x16')](function(_0x1e526c){logger[_0x5d1d('0x17')]('['+_0x1ecfc2['toUpperCase']()+_0x5d1d('0x6a'),_0x1e526c[_0x5d1d('0x1a')]);console['error']('Error\x20running\x20Dynamics365\x20integration',_0x1e526c);});}; \ 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 eb46f8e..c08ff6d 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 _0x33c5=['serverUrl','monitor_format','recordingURL','uniqueid','The\x20User\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','[QUEUE]','user:%s','trigger:browser:url','catch','error','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Authorization','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','%s/helpdesk/tickets/%d','unmanaged','lastevent','toUpperCase','lodash','request-promise','md5','ioredis','../../../../config/environment','../../../../config/logger','freshdesk','defaults','redis','localhost','socket.io-emitter','application/json','emit','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','Tags','name','Fields','mapValues','keyBy','custom_fields','value','POST','info','Ticket\x20created!','remoteUri','length','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','then','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','apiKey','toString','debug','stringify','forEach','picklist','type','nameField','customField','toLowerCase','content','includes','idField','push','variableName','Variable','queue','stripTrailingSlash'];(function(_0x151132,_0x32026a){var _0x13c2ad=function(_0x4dcd81){while(--_0x4dcd81){_0x151132['push'](_0x151132['shift']());}};_0x13c2ad(++_0x32026a);}(_0x33c5,0x179));var _0x533c=function(_0x29fc2c,_0x4ff86a){_0x29fc2c=_0x29fc2c-0x0;var _0x1adbc8=_0x33c5[_0x29fc2c];return _0x1adbc8;};'use strict';var _=require(_0x533c('0x0'));var rp=require(_0x533c('0x1'));var md5=require(_0x533c('0x2'));var util=require('util');var Redis=require(_0x533c('0x3'));var intUtil=require('./util');var config=require(_0x533c('0x4'));var logger=require(_0x533c('0x5'))(_0x533c('0x6'));config['redis']=_[_0x533c('0x7')](config[_0x533c('0x8')],{'host':_0x533c('0x9'),'port':0x18eb});var io=require(_0x533c('0xa'))(new Redis(config[_0x533c('0x8')]));var headers={'Content-Type':'application/json','Accept':_0x533c('0xb')};function emit(_0x3fcce9,_0x350fdf,_0x50045e){io['to'](_0x3fcce9)[_0x533c('0xc')](_0x350fdf,_0x50045e);}function getTicket(_0x4a7434,_0x7424c9,_0x3ef25f,_0x5e1587,_0xafa8c){logger['info']('Creating\x20new\x20ticket...');var _0x15e885=_[_0x533c('0xd')]({'responder_id':_0x7424c9['id'],'requester_id':_0x3ef25f['id'],'name':util[_0x533c('0xe')](_0x533c('0xf'),_0xafa8c[_0x533c('0x10')]),'phone':_0xafa8c[_0x533c('0x11')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x533c('0x12')](_0x5e1587[_0x533c('0x13')],_0xafa8c,'\x20'),'description':intUtil['getString'](_0x5e1587['Descriptions'],_0xafa8c,'
'),'tags':getTags(_0x5e1587[_0x533c('0x14')],_0x533c('0x15'))},getCustomFields(_0x5e1587[_0x533c('0x16')],_0xafa8c));_0x15e885['custom_fields']=_[_0x533c('0x17')](_[_0x533c('0x18')](_0x15e885[_0x533c('0x19')],'id'),_0x533c('0x1a'));return request({'uri':util[_0x533c('0xe')]('%s/api/v2/tickets',_0x4a7434['remoteUri']),'method':_0x533c('0x1b'),'body':_0x15e885})['then'](function(_0x219aec){logger[_0x533c('0x1c')](_0x533c('0x1d'));return _0x219aec;});}function getUser(_0x5f5ddf,_0xcaec7c){if(intUtil['validateEmail'](_0xcaec7c)){return request({'uri':util[_0x533c('0xe')]('%s/api/v2/agents',_0x5f5ddf[_0x533c('0x1e')]),'qs':{'email':_0xcaec7c}})['then'](function(_0x27eec7){if(_0x27eec7[_0x533c('0x1f')]){logger['info'](_0x533c('0x20'));return _[_0x533c('0x21')](_0x27eec7,function(_0x2d2f1d){return _0x2d2f1d[_0x533c('0x22')][_0x533c('0x23')]===_0xcaec7c;});}else{logger['info'](_0x533c('0x24'));return request({'uri':util[_0x533c('0xe')](_0x533c('0x25'),_0x5f5ddf['remoteUri'])})[_0x533c('0x26')](function(_0x405419){logger['info'](_0x533c('0x27'));return _0x405419;});}});}else{logger[_0x533c('0x1c')](_0x533c('0x28'));return request({'uri':util[_0x533c('0xe')]('%s/api/v2/agents/me',_0x5f5ddf['remoteUri'])})[_0x533c('0x26')](function(_0x1836fb){logger[_0x533c('0x1c')](_0x533c('0x27'));return _0x1836fb;});}}function getEndUser(_0x3a51a0,_0xa0c0a8,_0x43ec4c){logger[_0x533c('0x1c')](_0x533c('0x29'),_0x43ec4c);return request({'uri':util['format'](_0x533c('0x2a'),_0x3a51a0[_0x533c('0x1e')]),'qs':{'phone':_0x43ec4c}})['then'](function(_0x48225a){if(_0x48225a['length']){logger[_0x533c('0x1c')](_0x533c('0x2b'));return _[_0x533c('0x21')](_0x48225a,{'phone':_0x43ec4c});}else{logger['info'](_0x533c('0x2c'));return request({'uri':util['format'](_0x533c('0x2a'),_0x3a51a0[_0x533c('0x1e')]),'method':'POST','body':{'name':_0xa0c0a8,'phone':_0x43ec4c}})[_0x533c('0x26')](function(_0x41bc7e){logger[_0x533c('0x1c')]('Enduser\x20created.');return _0x41bc7e;});}});}function getAuth(_0x2b3d91){return util['format']('Basic\x20%s',new Buffer(_0x2b3d91[_0x533c('0x2d')]+':X')[_0x533c('0x2e')]('base64'));}function request(_0x3d0ea4){logger[_0x533c('0x2f')]('[HTTP]',JSON[_0x533c('0x30')](_0x3d0ea4));return rp(_[_0x533c('0x7')](_0x3d0ea4,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x41ab30,_0x14fdd6){var _0x58406f=[];if(_0x41ab30&&_0x41ab30['length']>0x0){_0x58406f=_['map'](_0x41ab30,_0x14fdd6);}return _0x58406f;}function getCustomFields(_0x54711f,_0x317ca1){var _0x2aa3ad=[];var _0x4d23b6={'custom_fields':[]};if(_0x54711f['length']>0x0){_[_0x533c('0x31')](_0x54711f,function(_0x22912a){if(_['includes'](['string',_0x533c('0x32')],_0x22912a[_0x533c('0x33')])&&_0x22912a[_0x533c('0x34')]&&!_0x22912a[_0x533c('0x35')]){_0x4d23b6[_0x22912a[_0x533c('0x34')][_0x533c('0x36')]()]=_0x22912a[_0x533c('0x37')][_0x533c('0x2e')]();}else if(_[_0x533c('0x38')](['string',_0x533c('0x32')],_0x22912a[_0x533c('0x33')])&&_0x22912a[_0x533c('0x39')]&&_0x22912a[_0x533c('0x35')]){_0x4d23b6['custom_fields'][_0x533c('0x3a')]({'id':_0x22912a[_0x533c('0x39')],'value':_0x22912a[_0x533c('0x37')][_0x533c('0x2e')]()});}else if(_0x22912a['type']==='variable'&&_0x22912a[_0x533c('0x3b')]&&_0x22912a[_0x533c('0x39')]&&_0x22912a[_0x533c('0x35')]){_0x317ca1[_0x22912a[_0x533c('0x3b')]]&&_0x4d23b6[_0x533c('0x19')][_0x533c('0x3a')]({'id':_0x22912a[_0x533c('0x39')],'value':_0x317ca1[_0x22912a[_0x533c('0x3b')]][_0x533c('0x2e')]()});}else if(_0x22912a[_0x533c('0x33')]==='customVariable'&&_0x22912a['Variable']&&_0x22912a['Variable']['name']&&_0x22912a[_0x533c('0x39')]&&_0x22912a[_0x533c('0x35')]){_0x317ca1[_0x22912a[_0x533c('0x3c')][_0x533c('0x15')][_0x533c('0x36')]()]&&_0x4d23b6['custom_fields'][_0x533c('0x3a')]({'id':_0x22912a['idField'],'value':_0x317ca1[_0x22912a[_0x533c('0x3c')][_0x533c('0x15')][_0x533c('0x36')]()][_0x533c('0x2e')]()});}});}return _0x4d23b6;}exports[_0x533c('0x3d')]=function(_0x597582,_0x11b559,_0x43649f,_0x59c6e5,_0x2bc670,_0x5a799b){var _0x1b3f5c,_0x3ec2de;_0x5a799b[_0x533c('0x1e')]=intUtil[_0x533c('0x3e')](_0x5a799b[_0x533c('0x1e')]);_0x5a799b['serverUrl']=intUtil['stripTrailingSlash'](_0x5a799b[_0x533c('0x3f')]);if(_0x2bc670&&_0x2bc670[_0x533c('0x40')]){logger[_0x533c('0x1c')]('[QUEUE]','Recording\x20is\x20enabled!');_0x11b559[_0x533c('0x41')]=util[_0x533c('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5a799b[_0x533c('0x3f')],_0x11b559['uniqueid'],md5(_0x11b559[_0x533c('0x42')]));}else{_0x11b559[_0x533c('0x41')]='';}headers['Authorization']=getAuth(_0x5a799b);return getUser(_0x5a799b,_0x59c6e5['email'])['then'](function(_0x31b66a){_0x1b3f5c=_0x31b66a;logger['info'](_0x533c('0x43'),_0x1b3f5c['id']);return getEndUser(_0x5a799b,_0x11b559[_0x533c('0x10')],_0x11b559[_0x533c('0x11')]);})['then'](function(_0x2bbc43){_0x3ec2de=_0x2bbc43;logger['info']('The\x20Enduser\x20ID\x20is:',_0x3ec2de['id']);return getTicket(_0x5a799b,_0x1b3f5c,_0x3ec2de,_0x43649f,_0x11b559);})['then'](function(_0x1e4f76){if(_0x1e4f76&&_0x1e4f76['id']){logger['info'](_0x533c('0x1d'));logger['info'](_0x533c('0x44'),_0x1e4f76['id']);logger[_0x533c('0x1c')](_0x533c('0x45'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x533c('0xe')](_0x533c('0x46'),_0x59c6e5[_0x533c('0x15')]),_0x533c('0x47'),{'uri':util[_0x533c('0xe')]('%s/helpdesk/tickets/%d',_0x5a799b[_0x533c('0x1e')],_0x1e4f76['id'])});}})[_0x533c('0x48')](function(_0x3fa2cc){logger[_0x533c('0x49')](_0x533c('0x45'),JSON[_0x533c('0x30')](_0x3fa2cc));});};exports['outbound']=function(_0x1285c4,_0x72bab5,_0x5a5b29,_0x329284,_0x2f419d,_0x1e1f22,_0x2ef19b){var _0x3554cc,_0x2a1899;_0x1e1f22[_0x533c('0x1e')]=intUtil[_0x533c('0x3e')](_0x1e1f22['remoteUri']);_0x1e1f22[_0x533c('0x3f')]=intUtil[_0x533c('0x3e')](_0x1e1f22[_0x533c('0x3f')]);if(_0x2ef19b&&_0x2ef19b[_0x533c('0x4a')]&&_0x2ef19b[_0x533c('0x4a')]!==_0x533c('0x4b')){logger[_0x533c('0x1c')](_0x533c('0x4c'),_0x533c('0x4d'));_0x72bab5[_0x533c('0x41')]=util['format'](_0x533c('0x4e'),_0x1e1f22[_0x533c('0x3f')],_0x72bab5[_0x533c('0x42')],md5(_0x72bab5[_0x533c('0x42')]));}headers[_0x533c('0x4f')]=getAuth(_0x1e1f22);return getUser(_0x1e1f22,_0x329284[_0x533c('0x23')])[_0x533c('0x26')](function(_0x2dfd8c){_0x3554cc=_0x2dfd8c;logger[_0x533c('0x1c')]('The\x20User\x20ID\x20is:',_0x3554cc['id']);return getEndUser(_0x1e1f22,_0x72bab5[_0x533c('0x50')],_0x72bab5[_0x533c('0x51')]);})[_0x533c('0x26')](function(_0xce3ae7){_0x2a1899=_0xce3ae7;logger[_0x533c('0x1c')](_0x533c('0x52'),_0x2a1899['id']);return getTicket(_0x1e1f22,_0x3554cc,_0x2a1899,_0x5a5b29,_0x72bab5);})[_0x533c('0x26')](function(_0x2d4d35){if(_0x2d4d35&&_0x2d4d35['id']){logger[_0x533c('0x1c')](_0x533c('0x1d'));logger[_0x533c('0x1c')](_0x533c('0x44'),_0x2d4d35['id']);logger[_0x533c('0x1c')](_0x533c('0x4c'),_0x533c('0x53'));emit(util['format'](_0x533c('0x46'),_0x329284[_0x533c('0x15')]),'trigger:browser:url',{'uri':util['format'](_0x533c('0x54'),_0x1e1f22[_0x533c('0x1e')],_0x2d4d35['id'])});}})[_0x533c('0x48')](function(_0x5df33d){logger[_0x533c('0x49')](_0x533c('0x4c'),JSON['stringify'](_0x5df33d));});};exports[_0x533c('0x55')]=function(_0x4fb3df,_0x5b97d4,_0x1f2aa5,_0x533f2e,_0x21630a,_0x1d2330){var _0x4e1fe7,_0x1c3845;_0x1d2330[_0x533c('0x1e')]=intUtil[_0x533c('0x3e')](_0x1d2330[_0x533c('0x1e')]);_0x1d2330[_0x533c('0x3f')]=intUtil['stripTrailingSlash'](_0x1d2330[_0x533c('0x3f')]);if(_0x21630a&&_0x21630a[_0x533c('0x40')]){logger[_0x533c('0x1c')]('['+_0x5b97d4[_0x533c('0x56')][_0x533c('0x57')]()+']',_0x533c('0x4d'));_0x5b97d4['recordingURL']=util[_0x533c('0xe')](_0x533c('0x4e'),_0x1d2330['serverUrl'],_0x5b97d4[_0x533c('0x42')],md5(_0x5b97d4[_0x533c('0x42')]));}else{_0x5b97d4[_0x533c('0x41')]='';}headers[_0x533c('0x4f')]=getAuth(_0x1d2330);return getUser(_0x1d2330,'')[_0x533c('0x26')](function(_0x8a2436){_0x4e1fe7=_0x8a2436;logger[_0x533c('0x1c')]('The\x20User\x20ID\x20is:',_0x4e1fe7['id']);return getEndUser(_0x1d2330,_0x5b97d4[_0x533c('0x10')],_0x5b97d4[_0x533c('0x11')]);})[_0x533c('0x26')](function(_0x4ec6c1){_0x1c3845=_0x4ec6c1;logger[_0x533c('0x1c')](_0x533c('0x52'),_0x1c3845['id']);return getTicket(_0x1d2330,_0x4e1fe7,_0x1c3845,_0x1f2aa5,_0x5b97d4);})[_0x533c('0x26')](function(_0x478903){if(_0x478903){logger[_0x533c('0x1c')]('Ticket\x20created!');logger[_0x533c('0x1c')](_0x533c('0x44'),_0x478903['id']);}})[_0x533c('0x48')](function(_0x41c950){logger[_0x533c('0x49')]('['+_0x5b97d4[_0x533c('0x56')][_0x533c('0x57')]()+']',JSON[_0x533c('0x30')](_0x41c950));});}; \ No newline at end of file +var _0x3fd3=['customVariable','Variable','toLowerCase','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','outbound','recordingFormat','none','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','[OUTBOUND]','stringify','unmanaged','lastevent','toUpperCase','lodash','request-promise','md5','util','ioredis','freshdesk','redis','localhost','application/json','emit','info','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','Descriptions','
','Tags','name','custom_fields','mapValues','value','remoteUri','POST','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','length','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','find','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/api/v2/contacts','Enduser\x20created.','toString','base64','debug','[HTTP]','defaults','GET','map','string','customField','nameField','type','idField','content'];(function(_0x5edecb,_0x5172e7){var _0x33eb01=function(_0x254bab){while(--_0x254bab){_0x5edecb['push'](_0x5edecb['shift']());}};_0x33eb01(++_0x5172e7);}(_0x3fd3,0x76));var _0x33fd=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x3fd3[_0x5f09c5];return _0x426ad9;};'use strict';var _=require(_0x33fd('0x0'));var rp=require(_0x33fd('0x1'));var md5=require(_0x33fd('0x2'));var util=require(_0x33fd('0x3'));var Redis=require(_0x33fd('0x4'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x33fd('0x5'));config[_0x33fd('0x6')]=_['defaults'](config['redis'],{'host':_0x33fd('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x33fd('0x6')]));var headers={'Content-Type':'application/json','Accept':_0x33fd('0x8')};function emit(_0x4e4082,_0xacf048,_0x463c72){io['to'](_0x4e4082)[_0x33fd('0x9')](_0xacf048,_0x463c72);}function getTicket(_0x8ee1e,_0x1913b7,_0x4595ea,_0x2a5733,_0x421950){logger[_0x33fd('0xa')]('Creating\x20new\x20ticket...');var _0x332a28=_['merge']({'responder_id':_0x1913b7['id'],'requester_id':_0x4595ea['id'],'name':util[_0x33fd('0xb')](_0x33fd('0xc'),_0x421950[_0x33fd('0xd')]),'phone':_0x421950[_0x33fd('0xe')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x33fd('0xf')](_0x2a5733[_0x33fd('0x10')],_0x421950,'\x20'),'description':intUtil['getString'](_0x2a5733[_0x33fd('0x11')],_0x421950,_0x33fd('0x12')),'tags':getTags(_0x2a5733[_0x33fd('0x13')],_0x33fd('0x14'))},getCustomFields(_0x2a5733['Fields'],_0x421950));_0x332a28[_0x33fd('0x15')]=_[_0x33fd('0x16')](_['keyBy'](_0x332a28['custom_fields'],'id'),_0x33fd('0x17'));return request({'uri':util[_0x33fd('0xb')]('%s/api/v2/tickets',_0x8ee1e[_0x33fd('0x18')]),'method':_0x33fd('0x19'),'body':_0x332a28})[_0x33fd('0x1a')](function(_0x129f2d){logger[_0x33fd('0xa')](_0x33fd('0x1b'));return _0x129f2d;});}function getUser(_0x3757d3,_0x3e0904){if(intUtil[_0x33fd('0x1c')](_0x3e0904)){return request({'uri':util['format'](_0x33fd('0x1d'),_0x3757d3[_0x33fd('0x18')]),'qs':{'email':_0x3e0904}})[_0x33fd('0x1a')](function(_0x19e667){if(_0x19e667[_0x33fd('0x1e')]){logger[_0x33fd('0xa')](_0x33fd('0x1f'));return _['find'](_0x19e667,function(_0x3623b1){return _0x3623b1[_0x33fd('0x20')][_0x33fd('0x21')]===_0x3e0904;});}else{logger[_0x33fd('0xa')](_0x33fd('0x22'));return request({'uri':util[_0x33fd('0xb')](_0x33fd('0x23'),_0x3757d3[_0x33fd('0x18')])})[_0x33fd('0x1a')](function(_0xbca6a8){logger[_0x33fd('0xa')](_0x33fd('0x24'));return _0xbca6a8;});}});}else{logger['info'](_0x33fd('0x25'));return request({'uri':util['format'](_0x33fd('0x23'),_0x3757d3[_0x33fd('0x18')])})[_0x33fd('0x1a')](function(_0xbc0ba6){logger[_0x33fd('0xa')](_0x33fd('0x24'));return _0xbc0ba6;});}}function getEndUser(_0xb12e50,_0x254e7b,_0x475af4){logger[_0x33fd('0xa')](_0x33fd('0x26'),_0x475af4);return request({'uri':util[_0x33fd('0xb')]('%s/api/v2/contacts',_0xb12e50[_0x33fd('0x18')]),'qs':{'phone':_0x475af4}})[_0x33fd('0x1a')](function(_0x2d91a2){if(_0x2d91a2['length']){logger[_0x33fd('0xa')]('Enduser\x20found!');return _[_0x33fd('0x27')](_0x2d91a2,{'phone':_0x475af4});}else{logger['info'](_0x33fd('0x28'));return request({'uri':util['format'](_0x33fd('0x29'),_0xb12e50[_0x33fd('0x18')]),'method':_0x33fd('0x19'),'body':{'name':_0x254e7b,'phone':_0x475af4}})['then'](function(_0x156c0d){logger[_0x33fd('0xa')](_0x33fd('0x2a'));return _0x156c0d;});}});}function getAuth(_0x4cd3e1){return util[_0x33fd('0xb')]('Basic\x20%s',new Buffer(_0x4cd3e1['apiKey']+':X')[_0x33fd('0x2b')](_0x33fd('0x2c')));}function request(_0x5adc6a){logger[_0x33fd('0x2d')](_0x33fd('0x2e'),JSON['stringify'](_0x5adc6a));return rp(_[_0x33fd('0x2f')](_0x5adc6a,{'method':_0x33fd('0x30'),'headers':headers,'json':!![]}));}function getTags(_0x98ec54,_0x22d068){var _0x2dc52f=[];if(_0x98ec54&&_0x98ec54['length']>0x0){_0x2dc52f=_[_0x33fd('0x31')](_0x98ec54,_0x22d068);}return _0x2dc52f;}function getCustomFields(_0x90533b,_0x45764a){var _0x31d2ca=[];var _0x211977={'custom_fields':[]};if(_0x90533b[_0x33fd('0x1e')]>0x0){_['forEach'](_0x90533b,function(_0x1b8a3e){if(_['includes']([_0x33fd('0x32'),'picklist'],_0x1b8a3e['type'])&&_0x1b8a3e['nameField']&&!_0x1b8a3e[_0x33fd('0x33')]){_0x211977[_0x1b8a3e[_0x33fd('0x34')]['toLowerCase']()]=_0x1b8a3e['content'][_0x33fd('0x2b')]();}else if(_['includes'](['string','picklist'],_0x1b8a3e[_0x33fd('0x35')])&&_0x1b8a3e[_0x33fd('0x36')]&&_0x1b8a3e['customField']){_0x211977[_0x33fd('0x15')]['push']({'id':_0x1b8a3e[_0x33fd('0x36')],'value':_0x1b8a3e[_0x33fd('0x37')][_0x33fd('0x2b')]()});}else if(_0x1b8a3e[_0x33fd('0x35')]==='variable'&&_0x1b8a3e['variableName']&&_0x1b8a3e[_0x33fd('0x36')]&&_0x1b8a3e[_0x33fd('0x33')]){_0x45764a[_0x1b8a3e['variableName']]&&_0x211977['custom_fields']['push']({'id':_0x1b8a3e[_0x33fd('0x36')],'value':_0x45764a[_0x1b8a3e['variableName']][_0x33fd('0x2b')]()});}else if(_0x1b8a3e[_0x33fd('0x35')]===_0x33fd('0x38')&&_0x1b8a3e[_0x33fd('0x39')]&&_0x1b8a3e[_0x33fd('0x39')][_0x33fd('0x14')]&&_0x1b8a3e[_0x33fd('0x36')]&&_0x1b8a3e['customField']){_0x45764a[_0x1b8a3e[_0x33fd('0x39')][_0x33fd('0x14')][_0x33fd('0x3a')]()]&&_0x211977['custom_fields']['push']({'id':_0x1b8a3e[_0x33fd('0x36')],'value':_0x45764a[_0x1b8a3e[_0x33fd('0x39')][_0x33fd('0x14')]['toLowerCase']()]['toString']()});}});}return _0x211977;}exports['queue']=function(_0x191bf6,_0x170dee,_0x36a64c,_0xd8049a,_0x2b98b2,_0x16b7e2){var _0x1bb853,_0x2b8333;_0x16b7e2[_0x33fd('0x18')]=intUtil['stripTrailingSlash'](_0x16b7e2[_0x33fd('0x18')]);_0x16b7e2[_0x33fd('0x3b')]=intUtil[_0x33fd('0x3c')](_0x16b7e2['serverUrl']);if(_0x2b98b2&&_0x2b98b2[_0x33fd('0x3d')]){logger[_0x33fd('0xa')](_0x33fd('0x3e'),_0x33fd('0x3f'));_0x170dee[_0x33fd('0x40')]=util[_0x33fd('0xb')](_0x33fd('0x41'),_0x16b7e2[_0x33fd('0x3b')],_0x170dee['uniqueid'],md5(_0x170dee[_0x33fd('0x42')]));}else{_0x170dee['recordingURL']='';}headers[_0x33fd('0x43')]=getAuth(_0x16b7e2);return getUser(_0x16b7e2,_0xd8049a[_0x33fd('0x21')])[_0x33fd('0x1a')](function(_0x51e8e6){_0x1bb853=_0x51e8e6;logger['info']('The\x20User\x20ID\x20is:',_0x1bb853['id']);return getEndUser(_0x16b7e2,_0x170dee[_0x33fd('0xd')],_0x170dee[_0x33fd('0xe')]);})[_0x33fd('0x1a')](function(_0x22c12a){_0x2b8333=_0x22c12a;logger['info'](_0x33fd('0x44'),_0x2b8333['id']);return getTicket(_0x16b7e2,_0x1bb853,_0x2b8333,_0x36a64c,_0x170dee);})[_0x33fd('0x1a')](function(_0x9b0994){if(_0x9b0994&&_0x9b0994['id']){logger['info'](_0x33fd('0x1b'));logger[_0x33fd('0xa')](_0x33fd('0x45'),_0x9b0994['id']);logger['info'](_0x33fd('0x3e'),_0x33fd('0x46'));emit(util[_0x33fd('0xb')](_0x33fd('0x47'),_0xd8049a[_0x33fd('0x14')]),_0x33fd('0x48'),{'uri':util[_0x33fd('0xb')](_0x33fd('0x49'),_0x16b7e2[_0x33fd('0x18')],_0x9b0994['id'])});}})[_0x33fd('0x4a')](function(_0x20b867){logger[_0x33fd('0x4b')](_0x33fd('0x3e'),JSON['stringify'](_0x20b867));});};exports[_0x33fd('0x4c')]=function(_0x565341,_0x3d8e6c,_0xcd972e,_0x41520e,_0x56c222,_0x367607,_0x4c5aae){var _0x4951cd,_0x2b6438;_0x367607['remoteUri']=intUtil[_0x33fd('0x3c')](_0x367607[_0x33fd('0x18')]);_0x367607[_0x33fd('0x3b')]=intUtil[_0x33fd('0x3c')](_0x367607['serverUrl']);if(_0x4c5aae&&_0x4c5aae['recordingFormat']&&_0x4c5aae[_0x33fd('0x4d')]!==_0x33fd('0x4e')){logger[_0x33fd('0xa')]('[OUTBOUND]',_0x33fd('0x3f'));_0x3d8e6c[_0x33fd('0x40')]=util['format'](_0x33fd('0x41'),_0x367607[_0x33fd('0x3b')],_0x3d8e6c[_0x33fd('0x42')],md5(_0x3d8e6c[_0x33fd('0x42')]));}headers[_0x33fd('0x43')]=getAuth(_0x367607);return getUser(_0x367607,_0x41520e[_0x33fd('0x21')])['then'](function(_0x2ba8d1){_0x4951cd=_0x2ba8d1;logger['info'](_0x33fd('0x4f'),_0x4951cd['id']);return getEndUser(_0x367607,_0x3d8e6c[_0x33fd('0x50')],_0x3d8e6c[_0x33fd('0x51')]);})['then'](function(_0xf021e4){_0x2b6438=_0xf021e4;logger[_0x33fd('0xa')](_0x33fd('0x44'),_0x2b6438['id']);return getTicket(_0x367607,_0x4951cd,_0x2b6438,_0xcd972e,_0x3d8e6c);})[_0x33fd('0x1a')](function(_0x43a136){if(_0x43a136&&_0x43a136['id']){logger[_0x33fd('0xa')](_0x33fd('0x1b'));logger[_0x33fd('0xa')](_0x33fd('0x45'),_0x43a136['id']);logger['info'](_0x33fd('0x52'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x33fd('0xb')](_0x33fd('0x47'),_0x41520e[_0x33fd('0x14')]),_0x33fd('0x48'),{'uri':util['format'](_0x33fd('0x49'),_0x367607[_0x33fd('0x18')],_0x43a136['id'])});}})[_0x33fd('0x4a')](function(_0x5b1fd4){logger[_0x33fd('0x4b')](_0x33fd('0x52'),JSON[_0x33fd('0x53')](_0x5b1fd4));});};exports[_0x33fd('0x54')]=function(_0x41c9c0,_0x1a9843,_0x162e7f,_0x5c2fe6,_0x1c6cda,_0x5c456e){var _0x55e7f8,_0x289b3f;_0x5c456e[_0x33fd('0x18')]=intUtil['stripTrailingSlash'](_0x5c456e[_0x33fd('0x18')]);_0x5c456e[_0x33fd('0x3b')]=intUtil[_0x33fd('0x3c')](_0x5c456e['serverUrl']);if(_0x1c6cda&&_0x1c6cda['monitor_format']){logger[_0x33fd('0xa')]('['+_0x1a9843[_0x33fd('0x55')][_0x33fd('0x56')]()+']',_0x33fd('0x3f'));_0x1a9843['recordingURL']=util['format'](_0x33fd('0x41'),_0x5c456e[_0x33fd('0x3b')],_0x1a9843['uniqueid'],md5(_0x1a9843['uniqueid']));}else{_0x1a9843[_0x33fd('0x40')]='';}headers[_0x33fd('0x43')]=getAuth(_0x5c456e);return getUser(_0x5c456e,'')[_0x33fd('0x1a')](function(_0x3c7b79){_0x55e7f8=_0x3c7b79;logger[_0x33fd('0xa')](_0x33fd('0x4f'),_0x55e7f8['id']);return getEndUser(_0x5c456e,_0x1a9843['calleridname'],_0x1a9843[_0x33fd('0xe')]);})['then'](function(_0x51a28c){_0x289b3f=_0x51a28c;logger[_0x33fd('0xa')](_0x33fd('0x44'),_0x289b3f['id']);return getTicket(_0x5c456e,_0x55e7f8,_0x289b3f,_0x162e7f,_0x1a9843);})[_0x33fd('0x1a')](function(_0x28eef2){if(_0x28eef2){logger[_0x33fd('0xa')](_0x33fd('0x1b'));logger['info'](_0x33fd('0x45'),_0x28eef2['id']);}})['catch'](function(_0x4f1ec6){logger[_0x33fd('0x4b')]('['+_0x1a9843[_0x33fd('0x55')][_0x33fd('0x56')]()+']',JSON[_0x33fd('0x53')](_0x4f1ec6));});}; \ 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 8de8c73..2f24582 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 _0xc237=['freshsales','redis','defaults','localhost','socket.io-emitter','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','users','email','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','message','agentEmail','Getting\x20user\x20with\x20email','userEmail','length','userId','User\x20found:','Admin\x20selected','toUpperCase','&f=','&entities=contact','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','/api/tasks','Subjects','Descriptions','Contact','YYYY-MM-DDTHH:mm:ss','ticketId','task','Task\x20created:','/contacts/','user:%s','emit','Token\x20token=','stripTrailingSlash','remoteUri','serverUrl','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','md5','util','moment','bluebird','./util','../../../../config/environment','../../../../config/logger'];(function(_0x12c334,_0x6d2aef){var _0x4ce19a=function(_0x36ee7b){while(--_0x36ee7b){_0x12c334['push'](_0x12c334['shift']());}};_0x4ce19a(++_0x6d2aef);}(_0xc237,0x13f));var _0x7c23=function(_0x3a5b65,_0x645020){_0x3a5b65=_0x3a5b65-0x0;var _0x10d5b7=_0xc237[_0x3a5b65];return _0x10d5b7;};'use strict';var _=require(_0x7c23('0x0'));var rp=require(_0x7c23('0x1'));var md5=require(_0x7c23('0x2'));var util=require(_0x7c23('0x3'));var moment=require(_0x7c23('0x4'));var Promise=require(_0x7c23('0x5'));var Redis=require('ioredis');var intUtil=require(_0x7c23('0x6'));var config=require(_0x7c23('0x7'));var logger=require(_0x7c23('0x8'))(_0x7c23('0x9'));config[_0x7c23('0xa')]=_[_0x7c23('0xb')](config[_0x7c23('0xa')],{'host':_0x7c23('0xc'),'port':0x18eb});var io=require(_0x7c23('0xd'))(new Redis(config[_0x7c23('0xa')]));function getAdminId(_0x5d9296,_0x58a718,_0x226934,_0x321934){return new Promise(function(_0x4715f6,_0x328683){var _0x40ecef=![];var _0x447f06={'method':_0x7c23('0xe'),'uri':_0x321934+_0x7c23('0xf'),'json':!![]};_0x447f06[_0x7c23('0x10')]=_0x226934;logger[_0x7c23('0x11')](_0x7c23('0x12'));return rp(_0x447f06)[_0x7c23('0x13')](function(_0x34cf72){if(_0x34cf72){var _0x10737f=_0x34cf72[_0x7c23('0x14')];var _0xd04557=null;for(_0xd04557=0x0;_0xd04557<_0x10737f['length'];_0xd04557++){if(_0x10737f[_0xd04557][_0x7c23('0x15')]===_0x5d9296[_0x7c23('0x16')]){_0x5d9296[_0x7c23('0x17')]=_0x10737f[_0xd04557]['id'];_0x40ecef=!![];}}if(_0x40ecef){logger['info'](_0x7c23('0x18'),_0x5d9296[_0x7c23('0x17')]);_0x4715f6(_0x5d9296);}else{_0x328683({'statusCode':0x194,'message':_0x7c23('0x19')});}}else{_0x328683({'statusCode':0x194,'message':_0x7c23('0x19')});}})[_0x7c23('0x1a')](function(_0x452e7e){logger[_0x7c23('0x1b')]('['+[_0x58a718['toUpperCase']()]+']',_0x452e7e[_0x7c23('0x1c')]);_0x328683(_0x452e7e);});});}function getUser(_0x3e9d85,_0x454fc7,_0x540c8e){return function(_0x5912be){return new Promise(function(_0x36d924,_0x14cd99){var _0x102dbc={'method':_0x7c23('0xe'),'uri':_0x540c8e+_0x7c23('0xf'),'json':!![]};_0x102dbc[_0x7c23('0x10')]=_0x454fc7;logger['info']('Getting\x20user\x20list');return rp(_0x102dbc)[_0x7c23('0x13')](function(_0x3a7792){if(_0x3a7792){var _0x21d0bc=_0x3a7792[_0x7c23('0x14')];var _0x1eb8e7=![];var _0x2d70ad=null;if(_0x5912be[_0x7c23('0x1d')]!==null){logger[_0x7c23('0x11')](_0x7c23('0x1e'),_0x5912be['agentEmail']);_0x5912be[_0x7c23('0x1f')]=_0x5912be[_0x7c23('0x1d')];for(_0x2d70ad=0x0;_0x2d70ad<_0x21d0bc[_0x7c23('0x20')];_0x2d70ad++){if(_0x21d0bc[_0x2d70ad][_0x7c23('0x15')]===_0x5912be[_0x7c23('0x1d')]){_0x1eb8e7=!![];_0x5912be[_0x7c23('0x21')]=_0x21d0bc[_0x2d70ad]['id'];logger[_0x7c23('0x11')](_0x7c23('0x22'),_0x5912be[_0x7c23('0x21')]);}}}if(!_0x1eb8e7){logger[_0x7c23('0x11')](_0x7c23('0x23'));_0x5912be[_0x7c23('0x1f')]=_0x5912be[_0x7c23('0x16')];_0x5912be[_0x7c23('0x21')]=_0x5912be[_0x7c23('0x17')];_0x1eb8e7=!![];}if(_0x1eb8e7){_0x36d924(_0x5912be);}else{_0x14cd99({'statusCode':0x194,'message':_0x7c23('0x19')});}}else{_0x14cd99({'statusCode':0x194,'message':_0x7c23('0x19')});}})[_0x7c23('0x1a')](function(_0xdb48a){logger['error']('['+[_0x3e9d85[_0x7c23('0x24')]()]+']',_0xdb48a[_0x7c23('0x1c')]);_0x14cd99(_0xdb48a);});});};}function searchContact(_0x2b7483,_0x5e0853,_0x785f9c,_0x54c6f2){return new Promise(function(_0x5ec2cd,_0x1a25ee){var _0x5abcfc={'method':_0x7c23('0xe'),'headers':_0x5e0853,'uri':_0x2b7483+'/api/lookup?q='+_0x54c6f2+_0x7c23('0x25')+_0x785f9c+_0x7c23('0x26'),'json':!![]};rp(_0x5abcfc)[_0x7c23('0x13')](function(_0x1ea098){var _0x3b5179=_['find'](_0x1ea098['contacts']['contacts'],[_0x785f9c,_0x54c6f2]);_0x5ec2cd(_0x3b5179);})['catch'](function(_0x34fc8e){_0x1a25ee(_0x34fc8e);});});}function getEndUser(_0x3622f7,_0x7ebc84,_0x5779bc){return function(_0x12b84d){return new Promise(function(_0x349eaa,_0x4503d9){logger[_0x7c23('0x11')](util[_0x7c23('0x27')](_0x7c23('0x28'),_0x12b84d[_0x7c23('0x29')]));searchContact(_0x5779bc,_0x7ebc84,_0x7c23('0x2a'),_0x12b84d[_0x7c23('0x29')])['then'](function(_0x531b98){if(_0x531b98){_0x12b84d[_0x7c23('0x2b')]=_0x531b98['id'];logger['info'](_0x7c23('0x2c'),_0x12b84d[_0x7c23('0x2b')]);return _0x349eaa(_0x12b84d);}searchContact(_0x5779bc,_0x7ebc84,_0x7c23('0x2d'),_0x12b84d[_0x7c23('0x29')])[_0x7c23('0x13')](function(_0x15f20e){if(_0x15f20e){_0x12b84d['endUserId']=_0x15f20e['id'];logger[_0x7c23('0x11')](_0x7c23('0x2e'),_0x12b84d[_0x7c23('0x2b')]);return _0x349eaa(_0x12b84d);}createEndUser(_0x12b84d,_0x3622f7,_0x7ebc84,_0x5779bc)[_0x7c23('0x13')](function(_0x1c44f5){logger['info'](_0x7c23('0x2f'),_0x1c44f5['endUserId']);return _0x349eaa(_0x1c44f5);});});})['catch'](function(_0x784de){_0x4503d9(_0x784de);});});};}function createEndUser(_0x3ac388,_0x51d6da,_0x5e4b6c,_0x52db62){return new Promise(function(_0x2fee6f,_0x298779){var _0x24f8d6=moment();var _0x586faa={'method':_0x7c23('0x30'),'uri':_0x52db62+_0x7c23('0x31'),'body':{'contact':{'last_name':_0x3ac388[_0x7c23('0x29')],'work_number':_0x3ac388[_0x7c23('0x29')],'mobile_number':_0x3ac388[_0x7c23('0x29')],'owner_id':_0x3ac388[_0x7c23('0x21')],'created_at':_0x24f8d6[_0x7c23('0x27')]('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x586faa['headers']=_0x5e4b6c;logger[_0x7c23('0x11')](_0x7c23('0x32'));return rp(_0x586faa)[_0x7c23('0x13')](function(_0x3d319b){_0x3ac388['endUserId']=_0x3d319b[_0x7c23('0x33')]['id'];_0x2fee6f(_0x3ac388);})[_0x7c23('0x1a')](function(_0x392ba0){logger[_0x7c23('0x1b')]('['+[_0x51d6da[_0x7c23('0x24')]()]+']',_0x392ba0[_0x7c23('0x1c')]);_0x298779(_0x392ba0[_0x7c23('0x1c')]);});});}function getTicket(_0x2d1830,_0x5d85fc,_0x458cbb,_0x58484b,_0x4ecd16){return function(_0x274aa8){logger[_0x7c23('0x11')]('Creating\x20new\x20task');return new Promise(function(_0x2b1918,_0x3aa28b){var _0x334765=moment();var _0x4a2c23={'method':_0x7c23('0x30'),'uri':_0x458cbb+_0x7c23('0x34'),'body':{'title':intUtil['getString'](_0x58484b[_0x7c23('0x35')],_0x4ecd16,'\x20'),'description':intUtil['getString'](_0x58484b[_0x7c23('0x36')],_0x4ecd16,'\x0a'),'owner_id':_0x274aa8[_0x7c23('0x21')],'creater_id':_0x274aa8[_0x7c23('0x17')],'targetable_id':_0x274aa8[_0x7c23('0x2b')],'targetable_type':_0x7c23('0x37'),'created_at':_0x334765[_0x7c23('0x27')](_0x7c23('0x38')),'due_date':_0x334765['add'](0x1e,'m')['format'](_0x7c23('0x38'))},'json':!![]};_0x4a2c23['headers']=_0x5d85fc;return rp(_0x4a2c23)[_0x7c23('0x13')](function(_0x122750){_0x274aa8[_0x7c23('0x39')]=_0x122750[_0x7c23('0x3a')]['id'];logger['info'](_0x7c23('0x3b'),_0x274aa8[_0x7c23('0x39')]);_0x2b1918(_0x274aa8);})[_0x7c23('0x1a')](function(_0x283e70){logger[_0x7c23('0x1b')]('['+[_0x2d1830[_0x7c23('0x24')]()]+']',_0x283e70[_0x7c23('0x1c')]);_0x3aa28b(_0x283e70[_0x7c23('0x1c')]);});});};}function emit(_0x262b62,_0x31d3aa,_0x2c04a5){var _0x4cbf8b={'uri':_0x262b62+_0x7c23('0x3c')+_0x2c04a5};io['to'](util['format'](_0x7c23('0x3d'),_0x31d3aa))[_0x7c23('0x3e')]('trigger:browser:url',_0x4cbf8b);}exports['cs']=function(_0x3d1d39,_0x1f4bd4,_0x1a6dd8,_0x4464cc,_0x390f6c,_0x43ca1f,_0x1ad6bb,_0x4b2297){var _0x51d35f={};var _0x43d142={'Authorization':_0x7c23('0x3f')+_0x43ca1f['apiKey']};_0x43ca1f['remoteUri']=intUtil[_0x7c23('0x40')](_0x43ca1f[_0x7c23('0x41')]);_0x43ca1f[_0x7c23('0x42')]=intUtil[_0x7c23('0x40')](_0x43ca1f[_0x7c23('0x42')]);var _0x33bef8=_0x43ca1f[_0x7c23('0x41')];_0x51d35f['adminEmail']=_0x43ca1f['username'];_0x51d35f[_0x7c23('0x29')]=_0x4b2297['toLowerCase']()===_0x7c23('0x43')?_0x1f4bd4[_0x7c23('0x44')]:_0x1f4bd4[_0x7c23('0x45')];_0x51d35f[_0x7c23('0x46')]=_0x4b2297===_0x7c23('0x47')||_0x4b2297===_0x7c23('0x48')?_0x7c23('0x47'):'outbound';if(_0x4464cc){_0x51d35f[_0x7c23('0x1d')]=_0x4464cc[_0x7c23('0x15')];}var _0x4d1ab4=util[_0x7c23('0x27')](_0x7c23('0x49'),_0x43ca1f[_0x7c23('0x42')],_0x1f4bd4[_0x7c23('0x4a')],md5(_0x1f4bd4[_0x7c23('0x4a')]));if(_0x390f6c&&_0x390f6c['monitor_format']){logger[_0x7c23('0x11')](_0x7c23('0x4b'),'Recording\x20is\x20enabled!');_0x1f4bd4['recordingURL']=_0x4d1ab4;}else if(_0x1ad6bb&&_0x1ad6bb['recordingFormat']&&_0x1ad6bb['recordingFormat']!=='none'){logger['info'](_0x7c23('0x4c'),'Recording\x20is\x20enabled!');_0x1f4bd4['recordingURL']=_0x4d1ab4;}else{_0x1f4bd4[_0x7c23('0x4d')]='';}return getAdminId(_0x51d35f,_0x4b2297,_0x43d142,_0x33bef8)[_0x7c23('0x13')](getUser(_0x4b2297,_0x43d142,_0x33bef8))[_0x7c23('0x13')](getEndUser(_0x4b2297,_0x43d142,_0x33bef8))[_0x7c23('0x13')](getTicket(_0x4b2297,_0x43d142,_0x33bef8,_0x1a6dd8,_0x1f4bd4))[_0x7c23('0x13')](function(_0x26fccc){logger[_0x7c23('0x11')](util['format'](_0x7c23('0x4e'),_0x26fccc['ticketId']));if(_0x4b2297!==_0x7c23('0x48')){logger[_0x7c23('0x11')]('['+[_0x4b2297['toUpperCase']()]+']',_0x7c23('0x4f'));emit(_0x33bef8,_0x4464cc['name'],_0x26fccc[_0x7c23('0x2b')]);}})['catch'](function(_0x292171){logger[_0x7c23('0x1b')]('['+[_0x4b2297[_0x7c23('0x24')]()]+_0x7c23('0x50'),util[_0x7c23('0x51')](_0x292171,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xab6c=['toLowerCase','calleridnum','callDirection','queue','unmanaged','outbound','email','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','lodash','request-promise','util','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales','redis','localhost','socket.io-emitter','GET','/api/selector/owners','Getting\x20admin\x20information','length','adminId','info','Admin\x20found:','Requested\x20Resource\x20not\x20Found','toUpperCase','message','headers','then','users','agentEmail','userId','User\x20found:','Admin\x20selected','userEmail','adminEmail','catch','error','/api/lookup?q=','&f=','&entities=contact','find','contacts','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','POST','/api/contacts','format','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Descriptions','Contact','task','Task\x20created:','ticketId','/contacts/','emit','trigger:browser:url','remoteUri','stripTrailingSlash','serverUrl','username'];(function(_0x5d3193,_0x33cfff){var _0xeeafaa=function(_0x32e4cd){while(--_0x32e4cd){_0x5d3193['push'](_0x5d3193['shift']());}};_0xeeafaa(++_0x33cfff);}(_0xab6c,0x67));var _0xcab6=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xab6c[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0xcab6('0x0'));var rp=require(_0xcab6('0x1'));var md5=require('md5');var util=require(_0xcab6('0x2'));var moment=require('moment');var Promise=require(_0xcab6('0x3'));var Redis=require(_0xcab6('0x4'));var intUtil=require(_0xcab6('0x5'));var config=require(_0xcab6('0x6'));var logger=require(_0xcab6('0x7'))(_0xcab6('0x8'));config[_0xcab6('0x9')]=_['defaults'](config[_0xcab6('0x9')],{'host':_0xcab6('0xa'),'port':0x18eb});var io=require(_0xcab6('0xb'))(new Redis(config[_0xcab6('0x9')]));function getAdminId(_0x54f431,_0x12599e,_0x101f73,_0x5ebc12){return new Promise(function(_0x26012d,_0x43960e){var _0x1bfba4=![];var _0x1ed41e={'method':_0xcab6('0xc'),'uri':_0x5ebc12+_0xcab6('0xd'),'json':!![]};_0x1ed41e['headers']=_0x101f73;logger['info'](_0xcab6('0xe'));return rp(_0x1ed41e)['then'](function(_0x3797f2){if(_0x3797f2){var _0x179105=_0x3797f2['users'];var _0x4e52cd=null;for(_0x4e52cd=0x0;_0x4e52cd<_0x179105[_0xcab6('0xf')];_0x4e52cd++){if(_0x179105[_0x4e52cd]['email']===_0x54f431['adminEmail']){_0x54f431[_0xcab6('0x10')]=_0x179105[_0x4e52cd]['id'];_0x1bfba4=!![];}}if(_0x1bfba4){logger[_0xcab6('0x11')](_0xcab6('0x12'),_0x54f431['adminId']);_0x26012d(_0x54f431);}else{_0x43960e({'statusCode':0x194,'message':_0xcab6('0x13')});}}else{_0x43960e({'statusCode':0x194,'message':_0xcab6('0x13')});}})['catch'](function(_0x28e7f3){logger['error']('['+[_0x12599e[_0xcab6('0x14')]()]+']',_0x28e7f3[_0xcab6('0x15')]);_0x43960e(_0x28e7f3);});});}function getUser(_0x2caa46,_0x4219f9,_0x4f304a){return function(_0x1877f4){return new Promise(function(_0x369512,_0x1f8dd8){var _0x1643b6={'method':'GET','uri':_0x4f304a+_0xcab6('0xd'),'json':!![]};_0x1643b6[_0xcab6('0x16')]=_0x4219f9;logger[_0xcab6('0x11')]('Getting\x20user\x20list');return rp(_0x1643b6)[_0xcab6('0x17')](function(_0x2499ce){if(_0x2499ce){var _0x6a591a=_0x2499ce[_0xcab6('0x18')];var _0x463eee=![];var _0x29eced=null;if(_0x1877f4[_0xcab6('0x19')]!==null){logger[_0xcab6('0x11')]('Getting\x20user\x20with\x20email',_0x1877f4['agentEmail']);_0x1877f4['userEmail']=_0x1877f4[_0xcab6('0x19')];for(_0x29eced=0x0;_0x29eced<_0x6a591a[_0xcab6('0xf')];_0x29eced++){if(_0x6a591a[_0x29eced]['email']===_0x1877f4[_0xcab6('0x19')]){_0x463eee=!![];_0x1877f4[_0xcab6('0x1a')]=_0x6a591a[_0x29eced]['id'];logger[_0xcab6('0x11')](_0xcab6('0x1b'),_0x1877f4[_0xcab6('0x1a')]);}}}if(!_0x463eee){logger[_0xcab6('0x11')](_0xcab6('0x1c'));_0x1877f4[_0xcab6('0x1d')]=_0x1877f4[_0xcab6('0x1e')];_0x1877f4[_0xcab6('0x1a')]=_0x1877f4[_0xcab6('0x10')];_0x463eee=!![];}if(_0x463eee){_0x369512(_0x1877f4);}else{_0x1f8dd8({'statusCode':0x194,'message':_0xcab6('0x13')});}}else{_0x1f8dd8({'statusCode':0x194,'message':_0xcab6('0x13')});}})[_0xcab6('0x1f')](function(_0x5f4094){logger[_0xcab6('0x20')]('['+[_0x2caa46[_0xcab6('0x14')]()]+']',_0x5f4094['message']);_0x1f8dd8(_0x5f4094);});});};}function searchContact(_0x198a91,_0x431141,_0x730a6e,_0x1309f9){return new Promise(function(_0x197d2f,_0x515d07){var _0x431cb0={'method':'GET','headers':_0x431141,'uri':_0x198a91+_0xcab6('0x21')+_0x1309f9+_0xcab6('0x22')+_0x730a6e+_0xcab6('0x23'),'json':!![]};rp(_0x431cb0)[_0xcab6('0x17')](function(_0x1cf34f){var _0x459dd1=_[_0xcab6('0x24')](_0x1cf34f[_0xcab6('0x25')][_0xcab6('0x25')],[_0x730a6e,_0x1309f9]);_0x197d2f(_0x459dd1);})['catch'](function(_0x328d64){_0x515d07(_0x328d64);});});}function getEndUser(_0x34941b,_0x20e03e,_0x569a18){return function(_0x4f55d4){return new Promise(function(_0x5bac92,_0x3b809c){logger[_0xcab6('0x11')](util['format'](_0xcab6('0x26'),_0x4f55d4[_0xcab6('0x27')]));searchContact(_0x569a18,_0x20e03e,_0xcab6('0x28'),_0x4f55d4[_0xcab6('0x27')])[_0xcab6('0x17')](function(_0x2af88d){if(_0x2af88d){_0x4f55d4[_0xcab6('0x29')]=_0x2af88d['id'];logger[_0xcab6('0x11')](_0xcab6('0x2a'),_0x4f55d4[_0xcab6('0x29')]);return _0x5bac92(_0x4f55d4);}searchContact(_0x569a18,_0x20e03e,'work_number',_0x4f55d4[_0xcab6('0x27')])[_0xcab6('0x17')](function(_0x402ba7){if(_0x402ba7){_0x4f55d4['endUserId']=_0x402ba7['id'];logger[_0xcab6('0x11')]('Contact\x20found\x20work_number:',_0x4f55d4['endUserId']);return _0x5bac92(_0x4f55d4);}createEndUser(_0x4f55d4,_0x34941b,_0x20e03e,_0x569a18)[_0xcab6('0x17')](function(_0x20a05c){logger[_0xcab6('0x11')]('Contact\x20created:',_0x20a05c[_0xcab6('0x29')]);return _0x5bac92(_0x20a05c);});});})[_0xcab6('0x1f')](function(_0x1cd1c4){_0x3b809c(_0x1cd1c4);});});};}function createEndUser(_0x44aa8a,_0x36d5ea,_0x1b1b29,_0xb03d20){return new Promise(function(_0x434549,_0x3f75b5){var _0x288e4e=moment();var _0x3cb4f7={'method':_0xcab6('0x2b'),'uri':_0xb03d20+_0xcab6('0x2c'),'body':{'contact':{'last_name':_0x44aa8a[_0xcab6('0x27')],'work_number':_0x44aa8a[_0xcab6('0x27')],'mobile_number':_0x44aa8a[_0xcab6('0x27')],'owner_id':_0x44aa8a['userId'],'created_at':_0x288e4e[_0xcab6('0x2d')](_0xcab6('0x2e'))}},'json':!![]};_0x3cb4f7['headers']=_0x1b1b29;logger['info'](_0xcab6('0x2f'));return rp(_0x3cb4f7)[_0xcab6('0x17')](function(_0x2de3f1){_0x44aa8a[_0xcab6('0x29')]=_0x2de3f1[_0xcab6('0x30')]['id'];_0x434549(_0x44aa8a);})['catch'](function(_0x20940){logger[_0xcab6('0x20')]('['+[_0x36d5ea[_0xcab6('0x14')]()]+']',_0x20940[_0xcab6('0x15')]);_0x3f75b5(_0x20940[_0xcab6('0x15')]);});});}function getTicket(_0x295f35,_0x57ff73,_0x4a11d8,_0x39524f,_0xe8bce5){return function(_0x1e40e4){logger[_0xcab6('0x11')](_0xcab6('0x31'));return new Promise(function(_0x2bd734,_0x17f615){var _0x3538cb=moment();var _0x32a4fb={'method':_0xcab6('0x2b'),'uri':_0x4a11d8+_0xcab6('0x32'),'body':{'title':intUtil[_0xcab6('0x33')](_0x39524f[_0xcab6('0x34')],_0xe8bce5,'\x20'),'description':intUtil[_0xcab6('0x33')](_0x39524f[_0xcab6('0x35')],_0xe8bce5,'\x0a'),'owner_id':_0x1e40e4['userId'],'creater_id':_0x1e40e4['adminId'],'targetable_id':_0x1e40e4[_0xcab6('0x29')],'targetable_type':_0xcab6('0x36'),'created_at':_0x3538cb[_0xcab6('0x2d')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x3538cb['add'](0x1e,'m')[_0xcab6('0x2d')]('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x32a4fb[_0xcab6('0x16')]=_0x57ff73;return rp(_0x32a4fb)[_0xcab6('0x17')](function(_0x3c5368){_0x1e40e4['ticketId']=_0x3c5368[_0xcab6('0x37')]['id'];logger[_0xcab6('0x11')](_0xcab6('0x38'),_0x1e40e4[_0xcab6('0x39')]);_0x2bd734(_0x1e40e4);})[_0xcab6('0x1f')](function(_0x491b46){logger[_0xcab6('0x20')]('['+[_0x295f35[_0xcab6('0x14')]()]+']',_0x491b46['message']);_0x17f615(_0x491b46[_0xcab6('0x15')]);});});};}function emit(_0x5eece4,_0x228a47,_0xe42ec){var _0x16a6f5={'uri':_0x5eece4+_0xcab6('0x3a')+_0xe42ec};io['to'](util[_0xcab6('0x2d')]('user:%s',_0x228a47))[_0xcab6('0x3b')](_0xcab6('0x3c'),_0x16a6f5);}exports['cs']=function(_0x299d0b,_0x5a5e97,_0x5443a5,_0x468cfa,_0x3fcbab,_0x4be73c,_0x27f567,_0x64169c){var _0xd595ec={};var _0x1e0fbd={'Authorization':'Token\x20token='+_0x4be73c['apiKey']};_0x4be73c[_0xcab6('0x3d')]=intUtil[_0xcab6('0x3e')](_0x4be73c['remoteUri']);_0x4be73c[_0xcab6('0x3f')]=intUtil[_0xcab6('0x3e')](_0x4be73c[_0xcab6('0x3f')]);var _0x29f62f=_0x4be73c['remoteUri'];_0xd595ec[_0xcab6('0x1e')]=_0x4be73c[_0xcab6('0x40')];_0xd595ec[_0xcab6('0x27')]=_0x64169c[_0xcab6('0x41')]()==='outbound'?_0x5a5e97['destcalleridnum']:_0x5a5e97[_0xcab6('0x42')];_0xd595ec[_0xcab6('0x43')]=_0x64169c===_0xcab6('0x44')||_0x64169c===_0xcab6('0x45')?'queue':_0xcab6('0x46');if(_0x468cfa){_0xd595ec[_0xcab6('0x19')]=_0x468cfa[_0xcab6('0x47')];}var _0x5c88dc=util[_0xcab6('0x2d')](_0xcab6('0x48'),_0x4be73c[_0xcab6('0x3f')],_0x5a5e97[_0xcab6('0x49')],md5(_0x5a5e97['uniqueid']));if(_0x3fcbab&&_0x3fcbab[_0xcab6('0x4a')]){logger[_0xcab6('0x11')]('[QUEUE]','Recording\x20is\x20enabled!');_0x5a5e97['recordingURL']=_0x5c88dc;}else if(_0x27f567&&_0x27f567['recordingFormat']&&_0x27f567[_0xcab6('0x4b')]!==_0xcab6('0x4c')){logger[_0xcab6('0x11')](_0xcab6('0x4d'),_0xcab6('0x4e'));_0x5a5e97[_0xcab6('0x4f')]=_0x5c88dc;}else{_0x5a5e97[_0xcab6('0x4f')]='';}return getAdminId(_0xd595ec,_0x64169c,_0x1e0fbd,_0x29f62f)[_0xcab6('0x17')](getUser(_0x64169c,_0x1e0fbd,_0x29f62f))[_0xcab6('0x17')](getEndUser(_0x64169c,_0x1e0fbd,_0x29f62f))['then'](getTicket(_0x64169c,_0x1e0fbd,_0x29f62f,_0x5443a5,_0x5a5e97))[_0xcab6('0x17')](function(_0x14f473){logger['info'](util[_0xcab6('0x2d')](_0xcab6('0x50'),_0x14f473['ticketId']));if(_0x64169c!=='unmanaged'){logger[_0xcab6('0x11')]('['+[_0x64169c[_0xcab6('0x14')]()]+']',_0xcab6('0x51'));emit(_0x29f62f,_0x468cfa[_0xcab6('0x52')],_0x14f473[_0xcab6('0x29')]);}})[_0xcab6('0x1f')](function(_0x5f558e){logger['error']('['+[_0x64169c[_0xcab6('0x14')]()]+_0xcab6('0x53'),util['inspect'](_0x5f558e,{'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 3ef1b9c..0760da5 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 _0x4a22=['unknown\x20integration','error','format','data3','../../../../config/logger','%s\x20account\x20#%s\x20not\x20found','lodash','util','./salesforce','./freshdesk','./desk','./vtiger','./servicenow','./freshsales','zendesk','salesforce','freshdesk','zoho','dynamics365','freshsales','servicenow','exec','includes','data1','toLowerCase','data2','find','Configurations','queue','outbound','log','EVENT\x20UNKNOWN','unmanaged','vtiger'];(function(_0x3808cc,_0x4a1b51){var _0xc1976b=function(_0x36388b){while(--_0x36388b){_0x3808cc['push'](_0x3808cc['shift']());}};_0xc1976b(++_0x4a1b51);}(_0x4a22,0xf4));var _0x24a2=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x4a22[_0x2064e5];return _0x21a233;};'use strict';var _=require(_0x24a2('0x0'));var util=require(_0x24a2('0x1'));var zendesk=require('./zendesk');var salesforce=require(_0x24a2('0x2'));var sugarcrm=require('./sugarcrm');var freshdesk=require(_0x24a2('0x3'));var zoho=require('./zoho');var desk=require(_0x24a2('0x4'));var vtiger=require(_0x24a2('0x5'));var servicenow=require(_0x24a2('0x6'));var dynamics365=require('./dynamics365');var freshsales=require(_0x24a2('0x7'));var integrations=[_0x24a2('0x8'),_0x24a2('0x9'),'sugarcrm',_0x24a2('0xa'),_0x24a2('0xb'),'desk','vtiger',_0x24a2('0xc'),_0x24a2('0xd'),_0x24a2('0xe')];exports[_0x24a2('0xf')]=function(_0x19f906,_0x4656af,_0x3fd0d6,_0x54dc08,_0x2eb8b8,_0x2daa82){if(_0x3fd0d6){if(_[_0x24a2('0x10')](integrations,_0x19f906[_0x24a2('0x11')]['toLowerCase']())){try{var _0x2ed4cb=null;var _0x3332f6='';var _0x3a92b5=_0x3fd0d6[_0x19f906[_0x24a2('0x11')][_0x24a2('0x12')]()];if(_0x3a92b5){var _0x299421=_0x3a92b5[_0x19f906[_0x24a2('0x13')]];if(_0x299421){var _0x456cc7=_[_0x24a2('0x14')](_0x299421[_0x24a2('0x15')],{'id':parseInt(_0x19f906['data3'],0xa)});if(_0x456cc7){if(_0x54dc08){if(_0x2eb8b8&&_0x4656af[_0x24a2('0x16')]){_0x3332f6='queue';}else if(_0x4656af['routeId']){_0x3332f6=_0x24a2('0x17');}else{console[_0x24a2('0x18')](_0x24a2('0x19'),_0x4656af);}}else{_0x3332f6=_0x24a2('0x1a');}switch(_0x19f906[_0x24a2('0x11')][_0x24a2('0x12')]()){case'zendesk':zendesk[_0x3332f6](_0x19f906,_0x4656af,_0x456cc7,_0x54dc08,_0x2eb8b8,_0x299421,_0x2daa82);break;case _0x24a2('0x9'):salesforce[_0x3332f6](_0x19f906,_0x4656af,_0x456cc7,_0x54dc08,_0x2eb8b8,_0x299421,_0x2daa82);break;case'sugarcrm':sugarcrm[_0x3332f6](_0x19f906,_0x4656af,_0x456cc7,_0x54dc08,_0x2eb8b8,_0x299421,_0x2daa82);break;case _0x24a2('0xa'):freshdesk[_0x3332f6](_0x19f906,_0x4656af,_0x456cc7,_0x54dc08,_0x2eb8b8,_0x299421,_0x2daa82);break;case _0x24a2('0xb'):zoho[_0x3332f6](_0x19f906,_0x4656af,_0x456cc7,_0x54dc08,_0x2eb8b8,_0x299421,_0x2daa82);break;case'desk':desk[_0x3332f6](_0x19f906,_0x4656af,_0x456cc7,_0x54dc08,_0x2eb8b8,_0x299421,_0x2daa82);break;case _0x24a2('0x1b'):vtiger[_0x3332f6](_0x19f906,_0x4656af,_0x456cc7,_0x54dc08,_0x2eb8b8,_0x299421,_0x2daa82);break;case _0x24a2('0xd'):freshsales['cs'](_0x19f906,_0x4656af,_0x456cc7,_0x54dc08,_0x2eb8b8,_0x299421,_0x2daa82,_0x3332f6);break;case _0x24a2('0xe'):servicenow['cs'](_0x19f906,_0x4656af,_0x456cc7,_0x54dc08,_0x2eb8b8,_0x299421,_0x2daa82,_0x3332f6);break;case _0x24a2('0xc'):dynamics365['cs'](_0x19f906,_0x4656af,_0x456cc7,_0x54dc08,_0x2eb8b8,_0x299421,_0x2daa82,_0x3332f6);break;default:console[_0x24a2('0x18')](_0x24a2('0x1c'));}}else{_0x2ed4cb=require('../../../../config/logger')(_0x19f906['data1'][_0x24a2('0x12')]());_0x2ed4cb[_0x24a2('0x1d')]('[EXEC]',util[_0x24a2('0x1e')]('%s\x20configuration\x20#%s\x20not\x20found',_0x19f906[_0x24a2('0x11')][_0x24a2('0x12')](),_0x19f906[_0x24a2('0x1f')]));}}else{_0x2ed4cb=require(_0x24a2('0x20'))(_0x19f906['data1'][_0x24a2('0x12')]());_0x2ed4cb[_0x24a2('0x1d')]('[EXEC]',util['format'](_0x24a2('0x21'),_0x19f906['data1'][_0x24a2('0x12')](),_0x19f906[_0x24a2('0x13')]));}}else{}}catch(_0x478068){console[_0x24a2('0x1d')](_0x478068);}}}}; \ No newline at end of file +var _0x485f=['log','EVENT\x20UNKNOWN','unmanaged','salesforce','unknown\x20integration','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','../../../../config/logger','%s\x20account\x20#%s\x20not\x20found','data2','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','sugarcrm','freshdesk','zoho','desk','vtiger','dynamics365','freshsales','servicenow','exec','includes','data1','toLowerCase','data3','queue','routeId','outbound'];(function(_0x559923,_0x23abde){var _0x1ff9fa=function(_0x2d717b){while(--_0x2d717b){_0x559923['push'](_0x559923['shift']());}};_0x1ff9fa(++_0x23abde);}(_0x485f,0x162));var _0xf485=function(_0x544cc7,_0x5b02fb){_0x544cc7=_0x544cc7-0x0;var _0x3896d0=_0x485f[_0x544cc7];return _0x3896d0;};'use strict';var _=require('lodash');var util=require('util');var zendesk=require('./zendesk');var salesforce=require(_0xf485('0x0'));var sugarcrm=require(_0xf485('0x1'));var freshdesk=require(_0xf485('0x2'));var zoho=require(_0xf485('0x3'));var desk=require(_0xf485('0x4'));var vtiger=require(_0xf485('0x5'));var servicenow=require(_0xf485('0x6'));var dynamics365=require(_0xf485('0x7'));var freshsales=require(_0xf485('0x8'));var integrations=[_0xf485('0x9'),'salesforce',_0xf485('0xa'),_0xf485('0xb'),_0xf485('0xc'),_0xf485('0xd'),_0xf485('0xe'),_0xf485('0xf'),_0xf485('0x10'),_0xf485('0x11')];exports[_0xf485('0x12')]=function(_0x237ff2,_0x12657a,_0x1e6977,_0x1983f3,_0x40dbc3,_0x59d3bb){if(_0x1e6977){if(_[_0xf485('0x13')](integrations,_0x237ff2[_0xf485('0x14')][_0xf485('0x15')]())){try{var _0x538c23=null;var _0x3d3071='';var _0x5c1d29=_0x1e6977[_0x237ff2['data1'][_0xf485('0x15')]()];if(_0x5c1d29){var _0x555f00=_0x5c1d29[_0x237ff2['data2']];if(_0x555f00){var _0x518b81=_['find'](_0x555f00['Configurations'],{'id':parseInt(_0x237ff2[_0xf485('0x16')],0xa)});if(_0x518b81){if(_0x1983f3){if(_0x40dbc3&&_0x12657a[_0xf485('0x17')]){_0x3d3071=_0xf485('0x17');}else if(_0x12657a[_0xf485('0x18')]){_0x3d3071=_0xf485('0x19');}else{console[_0xf485('0x1a')](_0xf485('0x1b'),_0x12657a);}}else{_0x3d3071=_0xf485('0x1c');}switch(_0x237ff2[_0xf485('0x14')][_0xf485('0x15')]()){case _0xf485('0x9'):zendesk[_0x3d3071](_0x237ff2,_0x12657a,_0x518b81,_0x1983f3,_0x40dbc3,_0x555f00,_0x59d3bb);break;case _0xf485('0x1d'):salesforce[_0x3d3071](_0x237ff2,_0x12657a,_0x518b81,_0x1983f3,_0x40dbc3,_0x555f00,_0x59d3bb);break;case _0xf485('0xa'):sugarcrm[_0x3d3071](_0x237ff2,_0x12657a,_0x518b81,_0x1983f3,_0x40dbc3,_0x555f00,_0x59d3bb);break;case _0xf485('0xb'):freshdesk[_0x3d3071](_0x237ff2,_0x12657a,_0x518b81,_0x1983f3,_0x40dbc3,_0x555f00,_0x59d3bb);break;case _0xf485('0xc'):zoho[_0x3d3071](_0x237ff2,_0x12657a,_0x518b81,_0x1983f3,_0x40dbc3,_0x555f00,_0x59d3bb);break;case _0xf485('0xd'):desk[_0x3d3071](_0x237ff2,_0x12657a,_0x518b81,_0x1983f3,_0x40dbc3,_0x555f00,_0x59d3bb);break;case'vtiger':vtiger[_0x3d3071](_0x237ff2,_0x12657a,_0x518b81,_0x1983f3,_0x40dbc3,_0x555f00,_0x59d3bb);break;case _0xf485('0x10'):freshsales['cs'](_0x237ff2,_0x12657a,_0x518b81,_0x1983f3,_0x40dbc3,_0x555f00,_0x59d3bb,_0x3d3071);break;case _0xf485('0x11'):servicenow['cs'](_0x237ff2,_0x12657a,_0x518b81,_0x1983f3,_0x40dbc3,_0x555f00,_0x59d3bb,_0x3d3071);break;case _0xf485('0xf'):dynamics365['cs'](_0x237ff2,_0x12657a,_0x518b81,_0x1983f3,_0x40dbc3,_0x555f00,_0x59d3bb,_0x3d3071);break;default:console[_0xf485('0x1a')](_0xf485('0x1e'));}}else{_0x538c23=require('../../../../config/logger')(_0x237ff2['data1'][_0xf485('0x15')]());_0x538c23[_0xf485('0x1f')](_0xf485('0x20'),util[_0xf485('0x21')](_0xf485('0x22'),_0x237ff2['data1'][_0xf485('0x15')](),_0x237ff2['data3']));}}else{_0x538c23=require(_0xf485('0x23'))(_0x237ff2[_0xf485('0x14')][_0xf485('0x15')]());_0x538c23[_0xf485('0x1f')]('[EXEC]',util[_0xf485('0x21')](_0xf485('0x24'),_0x237ff2[_0xf485('0x14')][_0xf485('0x15')](),_0x237ff2[_0xf485('0x25')]));}}else{}}catch(_0x4fc81b){console[_0xf485('0x1f')](_0x4fc81b);}}}}; \ 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 6b64695..1547205 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 _0x6e74=['merge','Contact','then','additionalSearchLead','$or','Lead','additionalSearchAccount','execute','Account','first','Name','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','format','Caller\x20-\x20%s','','Company','upperFirst','forEach','includes','string','picklist','idField','toString','variable','variableName','Variable','name','concat','remoteUri','https://login.salesforce.com','clientId','login','username','Connection\x20established.','queue','serverUrl','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','stripTrailingSlash','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Salesforce\x20account\x20type\x20not\x20recognized','lastevent','toUpperCase','lodash','bluebird','jsforce','util','ioredis','../../../../config/environment','redis','defaults','localhost','emit','getString','Descriptions','Task','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','contact','lead','WhoId','account','WhatId','ticketType','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail','User','find','length','Email','Agent\x20%s\x20found.','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','resolve','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact'];(function(_0x29dd41,_0x14b2d1){var _0x5a9479=function(_0x83904d){while(--_0x83904d){_0x29dd41['push'](_0x29dd41['shift']());}};_0x5a9479(++_0x14b2d1);}(_0x6e74,0xc1));var _0x46e7=function(_0xf4ca5d,_0x19515e){_0xf4ca5d=_0xf4ca5d-0x0;var _0x275c00=_0x6e74[_0xf4ca5d];return _0x275c00;};'use strict';var _=require(_0x46e7('0x0'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x46e7('0x1'));var md5=require('md5');var jsforce=require(_0x46e7('0x2'));var util=require(_0x46e7('0x3'));var Redis=require(_0x46e7('0x4'));var intUtil=require('./util');var config=require(_0x46e7('0x5'));var logger=require('../../../../config/logger')('salesforce');config[_0x46e7('0x6')]=_[_0x46e7('0x7')](config[_0x46e7('0x6')],{'host':_0x46e7('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x46e7('0x6')]));function emit(_0x141a7b,_0x5d659f,_0x234890){io['to'](_0x141a7b)[_0x46e7('0x9')](_0x5d659f,_0x234890);}function getTicket(_0x1aa707,_0x3118d7,_0x28f89b,_0x51f436,_0xb1a94c,_0x4c7232,_0x42b992,_0x37c6b2){var _0x2e5f4a=Object['assign']({},{'OwnerId':_0x3118d7['id'],'Subject':intUtil[_0x46e7('0xa')](_0x51f436['Subjects'],_0xb1a94c,'\x20'),'Description':intUtil['getString'](_0x51f436[_0x46e7('0xb')],_0xb1a94c,'\x0a')},getCustomFields(_0x4c7232,_0xb1a94c));if(_0x28f89b){if(_0x51f436['ticketType']===_0x46e7('0xc')){_0x2e5f4a[_0x46e7('0xd')]=moment[_0x46e7('0xe')]();_0x2e5f4a[_0x46e7('0xf')]=![];_0x2e5f4a[_0x46e7('0x10')]=![];if(_0x28f89b[_0x46e7('0x11')]===_0x46e7('0x12')||_0x28f89b[_0x46e7('0x11')]===_0x46e7('0x13')){_0x2e5f4a[_0x46e7('0x14')]=_0x28f89b['id'];}else if(_0x28f89b[_0x46e7('0x11')]===_0x46e7('0x15')){_0x2e5f4a[_0x46e7('0x16')]=_0x28f89b['id'];}}else if(_0x51f436[_0x46e7('0x17')]==='Case'){if(_0x28f89b[_0x46e7('0x11')]===_0x46e7('0x12')){_0x2e5f4a['ContactId']=_0x28f89b['id'];}else if(_0x28f89b[_0x46e7('0x11')]===_0x46e7('0x15')){_0x2e5f4a[_0x46e7('0x18')]=_0x28f89b['id'];}else if(_0x28f89b['endUserType']===_0x46e7('0x13')&&_0x51f436[_0x46e7('0x19')]){_0x2e5f4a[_0x51f436[_0x46e7('0x19')]]=_0x28f89b['id'];}else{logger[_0x46e7('0x1a')](_0x46e7('0x1b'));}}}return _0x42b992[_0x46e7('0x1c')](_0x51f436['ticketType'])[_0x46e7('0x1d')](_0x2e5f4a);}function getUser(_0x4a6d8d,_0x41f7ae,_0x43571e){if(!_[_0x46e7('0x1e')](_0x41f7ae)&&intUtil[_0x46e7('0x1f')](_0x41f7ae)){var _0x423177={'Email':_0x41f7ae};var _0x493a66={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x43571e[_0x46e7('0x1c')](_0x46e7('0x20'))[_0x46e7('0x21')](_0x423177,_0x493a66)['execute']()['then'](function(_0x502e6e){if(_0x502e6e[_0x46e7('0x22')]){var _0x25fc65=_[_0x46e7('0x21')](_0x502e6e,function(_0x419d36){return _0x419d36[_0x46e7('0x23')]===_0x41f7ae;});if(_0x25fc65){logger[_0x46e7('0x1a')](_0x46e7('0x24'),_0x41f7ae);return BPromise['resolve']({'id':_0x25fc65['Id'],'name':_0x25fc65['Name']});}}else{logger['info'](_0x46e7('0x25'),_0x41f7ae);return _0x43571e[_0x46e7('0x26')]()['then'](function(_0x1e8193){return BPromise[_0x46e7('0x27')]({'id':_0x1e8193['user_id'],'name':_0x1e8193['display_name']});});}});}else{logger[_0x46e7('0x1a')](_0x46e7('0x25'),_0x41f7ae);return _0x43571e[_0x46e7('0x26')]()['then'](function(_0xd858f){return BPromise['resolve']({'id':_0xd858f[_0x46e7('0x28')],'name':_0xd858f[_0x46e7('0x29')]});});}}function getEndUser(_0x37079b,_0x56b000,_0xfa82ef,_0x95924e,_0x1a3f64){var _0x178672={'$or':{'Phone':_0x95924e}};var _0x16b92a={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x46e7('0x27')]()['then'](function(){logger['info'](_0x46e7('0x2a'),_0x95924e,_0x56b000['moduleSearch']);switch(_0x56b000[_0x46e7('0x2b')]){case _0x46e7('0x2c'):var _0x4e2ce7=_[_0x46e7('0x2d')](_0x178672);if(_0x56b000[_0x46e7('0x2e')]){var _0x53ea12={};_0x53ea12[_0x56b000[_0x46e7('0x2e')]]=_0x95924e;_[_0x46e7('0x2f')](_0x4e2ce7['$or'],_0x53ea12);}return _0x1a3f64['sobject'](_0x46e7('0x30'))['find'](_0x4e2ce7,_0x16b92a)['execute']()[_0x46e7('0x31')](function(_0x244d45){if(_0x244d45&&_0x244d45['length']){return _0x244d45;}else{var _0x10068a=_[_0x46e7('0x2d')](_0x178672);if(_0x56b000[_0x46e7('0x32')]){var _0x1be8ee={};_0x1be8ee[_0x56b000[_0x46e7('0x32')]]=_0x95924e;_['merge'](_0x10068a[_0x46e7('0x33')],_0x1be8ee);}return _0x1a3f64[_0x46e7('0x1c')](_0x46e7('0x34'))[_0x46e7('0x21')](_0x10068a,_0x16b92a);}});case'account_contact_lead':var _0x410d5a=_[_0x46e7('0x2d')](_0x178672);if(_0x56b000[_0x46e7('0x35')]){var _0x53ea12={};_0x53ea12[_0x56b000[_0x46e7('0x35')]]=_0x95924e;_[_0x46e7('0x2f')](_0x410d5a['$or'],_0x53ea12);}return _0x1a3f64['sobject']('Account')[_0x46e7('0x21')](_0x410d5a,_0x16b92a)[_0x46e7('0x36')]()[_0x46e7('0x31')](function(_0x1a784e){if(_0x1a784e&&_0x1a784e[_0x46e7('0x22')]){return _0x1a784e;}else{var _0x4bade8=_['cloneDeep'](_0x178672);if(_0x56b000['additionalSearchContact']){var _0x34b2d9={};_0x34b2d9[_0x56b000[_0x46e7('0x2e')]]=_0x95924e;_[_0x46e7('0x2f')](_0x4bade8[_0x46e7('0x33')],_0x34b2d9);}return _0x1a3f64[_0x46e7('0x1c')]('Contact')[_0x46e7('0x21')](_0x4bade8,_0x16b92a)['then'](function(_0x2e6e33){if(_0x2e6e33&&_0x2e6e33['length']){return _0x2e6e33;}else{var _0x3fbf75=_[_0x46e7('0x2d')](_0x178672);if(_0x56b000['additionalSearchLead']){var _0x234567={};_0x234567[_0x56b000[_0x46e7('0x32')]]=_0x95924e;_[_0x46e7('0x2f')](_0x3fbf75[_0x46e7('0x33')],_0x234567);}return _0x1a3f64[_0x46e7('0x1c')](_0x46e7('0x34'))['find'](_0x3fbf75,_0x16b92a);}});}});case _0x46e7('0x12'):var _0x4e2ce7=_[_0x46e7('0x2d')](_0x178672);if(_0x56b000[_0x46e7('0x2e')]){var _0x53ea12={};_0x53ea12[_0x56b000[_0x46e7('0x2e')]]=_0x95924e;_[_0x46e7('0x2f')](_0x4e2ce7[_0x46e7('0x33')],_0x53ea12);}return _0x1a3f64[_0x46e7('0x1c')](_0x46e7('0x30'))[_0x46e7('0x21')](_0x4e2ce7,_0x16b92a)[_0x46e7('0x36')]();case _0x46e7('0x13'):var _0x74a3fe=_[_0x46e7('0x2d')](_0x178672);if(_0x56b000[_0x46e7('0x32')]){var _0x53ea12={};_0x53ea12[_0x56b000['additionalSearchLead']]=_0x95924e;_[_0x46e7('0x2f')](_0x74a3fe[_0x46e7('0x33')],_0x53ea12);}return _0x1a3f64[_0x46e7('0x1c')](_0x46e7('0x34'))[_0x46e7('0x21')](_0x74a3fe,_0x16b92a);case _0x46e7('0x15'):var _0x410d5a=_[_0x46e7('0x2d')](_0x178672);if(_0x56b000['additionalSearchAccount']){var _0x53ea12={};_0x53ea12[_0x56b000[_0x46e7('0x35')]]=_0x95924e;_[_0x46e7('0x2f')](_0x410d5a[_0x46e7('0x33')],_0x53ea12);}return _0x1a3f64['sobject'](_0x46e7('0x37'))['find'](_0x410d5a,_0x16b92a);default:return null;}})[_0x46e7('0x31')](function(_0x6aee68){if(_0x6aee68&&_0x6aee68[_0x46e7('0x22')]){var _0x25655a=_[_0x46e7('0x38')](_0x6aee68);if(_0x25655a){return BPromise['resolve']({'id':_0x25655a['Id'],'name':_0x25655a[_0x46e7('0x39')],'phone':_0x25655a['Phone'],'endUserType':_0x25655a[_0x46e7('0x3a')][_0x46e7('0x3b')][_0x46e7('0x3c')]()});}}})[_0x46e7('0x31')](function(_0x18eecf){if(_0x18eecf){logger[_0x46e7('0x1a')](_0x46e7('0x3d'),_0x18eecf['endUserType'],_0x95924e);return BPromise['resolve'](_0x18eecf);}else{logger[_0x46e7('0x1a')](_0x46e7('0x3e'),_0x95924e);var _0x1697cb={'Phone':_0x95924e};if(_0x56b000[_0x46e7('0x3f')]){if(_0x56b000[_0x46e7('0x3f')]===_0x46e7('0x12')){logger[_0x46e7('0x1a')](_0x46e7('0x40'),_0x95924e,_0x56b000[_0x46e7('0x3f')]);_0x1697cb[_0x46e7('0x41')]=_0xfa82ef!==''?_0xfa82ef:util[_0x46e7('0x42')](_0x46e7('0x43'),_0x95924e);}else if(_0x56b000['moduleCreate']===_0x46e7('0x13')){logger[_0x46e7('0x1a')](_0x46e7('0x40'),_0x95924e,_0x56b000[_0x46e7('0x3f')]);_0x1697cb['LastName']=_0xfa82ef!==_0x46e7('0x44')?_0xfa82ef:util['format'](_0x46e7('0x43'),_0x95924e);_0x1697cb[_0x46e7('0x45')]='No\x20Company';}else if(_0x56b000[_0x46e7('0x3f')]===_0x46e7('0x15')){logger['info'](_0x46e7('0x40'),_0x95924e,_0x56b000[_0x46e7('0x3f')]);_0x1697cb[_0x46e7('0x39')]=_0xfa82ef!==_0x46e7('0x44')?_0xfa82ef:util[_0x46e7('0x42')](_0x46e7('0x43'),_0x95924e);}else{return null;}}return _0x1a3f64[_0x46e7('0x1c')](_[_0x46e7('0x46')](_0x56b000[_0x46e7('0x3f')]))[_0x46e7('0x1d')](_0x1697cb)[_0x46e7('0x31')](function(_0x4b1c7f){return BPromise[_0x46e7('0x27')]({'id':_0x4b1c7f['id'],'endUserType':_0x56b000[_0x46e7('0x3f')]});});}});}function getCustomFields(_0x33e147,_0x28790e){var _0x4cc253={};if(_0x33e147['length']>0x0){_[_0x46e7('0x47')](_0x33e147,function(_0x494b4a){if(_[_0x46e7('0x48')]([_0x46e7('0x49'),_0x46e7('0x4a')],_0x494b4a['type'])&&_0x494b4a['idField']){_0x4cc253[_0x494b4a[_0x46e7('0x4b')]]=_0x494b4a['content'][_0x46e7('0x4c')]();}else if(_0x494b4a[_0x46e7('0x3b')]===_0x46e7('0x4d')&&_0x494b4a[_0x46e7('0x4e')]&&_0x494b4a[_0x46e7('0x4b')]){_0x28790e[_0x494b4a[_0x46e7('0x4e')]]&&(_0x4cc253[_0x494b4a[_0x46e7('0x4b')]]=_0x28790e[_0x494b4a[_0x46e7('0x4e')]][_0x46e7('0x4c')]());}else if(_0x494b4a[_0x46e7('0x3b')]==='customVariable'&&_0x494b4a[_0x46e7('0x4f')]&&_0x494b4a[_0x46e7('0x4f')][_0x46e7('0x50')]&&_0x494b4a[_0x46e7('0x4b')]){_0x28790e[_0x494b4a[_0x46e7('0x4f')][_0x46e7('0x50')][_0x46e7('0x3c')]()]&&(_0x4cc253[_0x494b4a[_0x46e7('0x4b')]]=_0x28790e[_0x494b4a[_0x46e7('0x4f')][_0x46e7('0x50')][_0x46e7('0x3c')]()]['toString']());}});}return _0x4cc253;}function getConnection(_0x521a16){var _0x322453=_0x521a16['password'][_0x46e7('0x51')](_0x521a16['securityToken']);var _0x2685bb=new jsforce['Connection']({'oauth2':{'loginUrl':_0x521a16[_0x46e7('0x52')]||_0x46e7('0x53'),'clientId':_0x521a16[_0x46e7('0x54')],'clientSecret':_0x521a16['clientSecret']}});return _0x2685bb[_0x46e7('0x55')](_0x521a16[_0x46e7('0x56')],_0x322453)[_0x46e7('0x31')](function(){logger[_0x46e7('0x1a')](_0x46e7('0x57'));return _0x2685bb;});}exports[_0x46e7('0x58')]=function(_0x193755,_0x4674a5,_0x2e790e,_0x1df1be,_0x3114ed,_0xbc10){var _0x30092f,_0x2d3c99,_0x11c93f,_0x2445fb;_0xbc10['serverUrl']=intUtil['stripTrailingSlash'](_0xbc10[_0x46e7('0x59')]);_0xbc10[_0x46e7('0x52')]=intUtil['stripTrailingSlash'](_0xbc10[_0x46e7('0x52')]);if(_0x3114ed&&_0x3114ed[_0x46e7('0x5a')]){logger[_0x46e7('0x1a')](_0x46e7('0x5b'),'Recording\x20is\x20enabled!');_0x4674a5[_0x46e7('0x5c')]=util[_0x46e7('0x42')](_0x46e7('0x5d'),_0xbc10['serverUrl'],_0x4674a5[_0x46e7('0x5e')],md5(_0x4674a5['uniqueid']));}else{_0x4674a5[_0x46e7('0x5c')]='';}return getConnection(_0xbc10)[_0x46e7('0x31')](function(_0x116961){_0x2445fb=_0x116961;return getUser(_0xbc10,_0x1df1be[_0x46e7('0x5f')],_0x2445fb);})[_0x46e7('0x31')](function(_0x2e6dd4){_0x30092f=_0x2e6dd4;return getEndUser(_0xbc10,_0x2e790e,_0x4674a5[_0x46e7('0x60')],_0x4674a5[_0x46e7('0x61')],_0x2445fb);})[_0x46e7('0x31')](function(_0x28e1a7){_0x2d3c99=_0x28e1a7;return getTicket(_0xbc10,_0x30092f,_0x2d3c99,_0x2e790e,_0x4674a5,_0x2e790e[_0x46e7('0x62')],_0x2445fb,_0x46e7('0x58'));})[_0x46e7('0x31')](function(_0x48d9d5){_0x11c93f=_0x48d9d5;logger[_0x46e7('0x1a')](_0x46e7('0x63'),_0x11c93f['id']);logger['info']('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x11c93f['id'],_0x1df1be[_0x46e7('0x50')],_0xbc10['type']);switch(_0xbc10[_0x46e7('0x3b')]){case _0x46e7('0x64'):emit(util[_0x46e7('0x42')](_0x46e7('0x65'),_0x1df1be[_0x46e7('0x50')]),_0x46e7('0x66'),{'recordId':_0x11c93f['id']});break;case _0x46e7('0x67'):emit(util[_0x46e7('0x42')](_0x46e7('0x65'),_0x1df1be[_0x46e7('0x50')]),_0x46e7('0x68'),{'uri':util[_0x46e7('0x42')](_0x46e7('0x69'),_0x2445fb[_0x46e7('0x6a')],_0x11c93f['id'])});break;default:logger[_0x46e7('0x6b')](_0x46e7('0x6c'));}})[_0x46e7('0x6d')](function(_0x332959){logger['error'](_0x46e7('0x5b'),_0x332959);});};exports[_0x46e7('0x6e')]=function(_0x37fa1c,_0x20cab8,_0x4963a7,_0x45debd,_0x5d1e1c,_0x5c7268,_0x138085){var _0x13ec43,_0x58cfac,_0x49b2cc,_0x5ae8d0;_0x5c7268['serverUrl']=intUtil[_0x46e7('0x6f')](_0x5c7268[_0x46e7('0x59')]);_0x5c7268[_0x46e7('0x52')]=intUtil[_0x46e7('0x6f')](_0x5c7268[_0x46e7('0x52')]);if(_0x138085&&_0x138085[_0x46e7('0x70')]&&_0x138085[_0x46e7('0x70')]!=='none'){logger[_0x46e7('0x1a')](_0x46e7('0x71'),_0x46e7('0x72'));_0x20cab8[_0x46e7('0x5c')]=util[_0x46e7('0x42')](_0x46e7('0x5d'),_0x5c7268['serverUrl'],_0x20cab8[_0x46e7('0x5e')],md5(_0x20cab8[_0x46e7('0x5e')]));}return getConnection(_0x5c7268)['then'](function(_0x50ac6a){_0x5ae8d0=_0x50ac6a;return getUser(_0x5c7268,_0x45debd['email'],_0x5ae8d0);})[_0x46e7('0x31')](function(_0x5f19a6){_0x13ec43=_0x5f19a6;return getEndUser(_0x5c7268,_0x4963a7,_0x20cab8[_0x46e7('0x73')],_0x20cab8[_0x46e7('0x74')],_0x5ae8d0);})[_0x46e7('0x31')](function(_0x23bb39){_0x58cfac=_0x23bb39;return getTicket(_0x5c7268,_0x13ec43,_0x58cfac,_0x4963a7,_0x20cab8,_0x4963a7[_0x46e7('0x62')],_0x5ae8d0,'outbound');})[_0x46e7('0x31')](function(_0x532d99){_0x49b2cc=_0x532d99;logger[_0x46e7('0x1a')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x49b2cc['id']);logger[_0x46e7('0x1a')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x49b2cc['id'],_0x45debd[_0x46e7('0x50')],_0x5c7268[_0x46e7('0x3b')]);switch(_0x5c7268[_0x46e7('0x3b')]){case _0x46e7('0x64'):emit(util[_0x46e7('0x42')]('user:%s',_0x45debd[_0x46e7('0x50')]),_0x46e7('0x66'),{'recordId':_0x49b2cc['id']});break;case _0x46e7('0x67'):emit(util['format']('user:%s',_0x45debd[_0x46e7('0x50')]),_0x46e7('0x68'),{'uri':util[_0x46e7('0x42')](_0x46e7('0x69'),_0x5ae8d0[_0x46e7('0x6a')],_0x49b2cc['id'])});break;default:logger[_0x46e7('0x6b')](_0x46e7('0x71'),_0x46e7('0x75'));}})['catch'](function(_0x40cfce){logger['error']('[OUTBOUND]',_0x40cfce);});};exports['unmanaged']=function(_0xa7ab23,_0x5c3d57,_0x4fc332,_0x3d02a4,_0x2ebd1b,_0x3d54f6){var _0x402eda,_0x40ed3c,_0x4a9512,_0x5fc7a4;_0x3d54f6['serverUrl']=intUtil['stripTrailingSlash'](_0x3d54f6[_0x46e7('0x59')]);_0x3d54f6['remoteUri']=intUtil['stripTrailingSlash'](_0x3d54f6[_0x46e7('0x52')]);if(_0x2ebd1b&&_0x2ebd1b[_0x46e7('0x5a')]){logger['info']('['+_0x5c3d57[_0x46e7('0x76')][_0x46e7('0x77')]()+']',_0x46e7('0x72'));_0x5c3d57[_0x46e7('0x5c')]=util[_0x46e7('0x42')](_0x46e7('0x5d'),_0x3d54f6[_0x46e7('0x59')],_0x5c3d57[_0x46e7('0x5e')],md5(_0x5c3d57[_0x46e7('0x5e')]));}else{_0x5c3d57[_0x46e7('0x5c')]='';}return getConnection(_0x3d54f6)[_0x46e7('0x31')](function(_0x37e08e){_0x5fc7a4=_0x37e08e;if(!_[_0x46e7('0x1e')](_0x3d02a4)){return getUser(_0x3d54f6,_0x3d02a4[_0x46e7('0x50')],_0x5fc7a4);}else{return getUser(_0x3d54f6,null,_0x5fc7a4);}})[_0x46e7('0x31')](function(_0x27ed33){_0x402eda=_0x27ed33;return getEndUser(_0x3d54f6,_0x4fc332,_0x5c3d57[_0x46e7('0x60')],_0x5c3d57[_0x46e7('0x61')],_0x5fc7a4);})[_0x46e7('0x31')](function(_0x2ba295){_0x40ed3c=_0x2ba295;return getTicket(_0x3d54f6,_0x402eda,_0x40ed3c,_0x4fc332,_0x5c3d57,_0x4fc332[_0x46e7('0x62')],_0x5fc7a4);})['then'](function(_0x2e31f9){_0x4a9512=_0x2e31f9;logger[_0x46e7('0x1a')]('['+_0x5c3d57[_0x46e7('0x76')][_0x46e7('0x77')]()+']\x20Ticket\x20%s\x20created.',_0x4a9512['id']);logger[_0x46e7('0x1a')]('['+_0x5c3d57['lastevent']['toUpperCase']()+']\x20Integration\x20account\x20type\x20%s.',_0x3d54f6[_0x46e7('0x3b')]);})[_0x46e7('0x6d')](function(_0x3249ff){logger[_0x46e7('0x6b')]('['+_0x5c3d57[_0x46e7('0x76')]['toUpperCase']()+']',_0x3249ff);});}; \ No newline at end of file +var _0x1d31=['Association\x20between\x20Case\x20and\x20Lead\x20skipped','create','isNil','validateEmail','sobject','User','find','execute','length','Agent\x20%s\x20found.','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','resolve','user_id','then','display_name','moduleSearch','cloneDeep','additionalSearchContact','merge','additionalSearchLead','$or','Lead','account_contact_lead','additionalSearchAccount','Account','Contact','first','Phone','attributes','toLowerCase','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','','format','Caller\x20-\x20%s','LastName','Company','No\x20Company','upperFirst','forEach','includes','string','type','idField','content','toString','variableName','customVariable','name','Variable','password','concat','securityToken','https://login.salesforce.com','clientId','clientSecret','username','Connection\x20established.','serverUrl','remoteUri','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','Fields','queue','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','newTab','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','none','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:salesforce:display','[OUTBOUND]','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lastevent','lodash','request-promise','bluebird','md5','jsforce','util','ioredis','./util','../../../../config/environment','../../../../config/logger','defaults','socket.io-emitter','redis','emit','assign','getString','Subjects','Descriptions','ticketType','Task','ActivityDate','utc','IsReminderSet','endUserType','contact','lead','WhoId','WhatId','ContactId','account','AccountId','leadId','info'];(function(_0xe033e7,_0x561a6d){var _0x63031f=function(_0x246e1f){while(--_0x246e1f){_0xe033e7['push'](_0xe033e7['shift']());}};_0x63031f(++_0x561a6d);}(_0x1d31,0xe9));var _0x11d3=function(_0xfa634c,_0x414e0e){_0xfa634c=_0xfa634c-0x0;var _0x73e478=_0x1d31[_0xfa634c];return _0x73e478;};'use strict';var _=require(_0x11d3('0x0'));var rp=require(_0x11d3('0x1'));var moment=require('moment');var BPromise=require(_0x11d3('0x2'));var md5=require(_0x11d3('0x3'));var jsforce=require(_0x11d3('0x4'));var util=require(_0x11d3('0x5'));var Redis=require(_0x11d3('0x6'));var intUtil=require(_0x11d3('0x7'));var config=require(_0x11d3('0x8'));var logger=require(_0x11d3('0x9'))('salesforce');config['redis']=_[_0x11d3('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x11d3('0xb'))(new Redis(config[_0x11d3('0xc')]));function emit(_0x261b0d,_0x4cbd73,_0x56fa08){io['to'](_0x261b0d)[_0x11d3('0xd')](_0x4cbd73,_0x56fa08);}function getTicket(_0x3401b1,_0x5377ca,_0x55b054,_0x38de75,_0x1d1a1c,_0x2b5ce0,_0x4571dd,_0x2b44b8){var _0x30e223=Object[_0x11d3('0xe')]({},{'OwnerId':_0x5377ca['id'],'Subject':intUtil[_0x11d3('0xf')](_0x38de75[_0x11d3('0x10')],_0x1d1a1c,'\x20'),'Description':intUtil[_0x11d3('0xf')](_0x38de75[_0x11d3('0x11')],_0x1d1a1c,'\x0a')},getCustomFields(_0x2b5ce0,_0x1d1a1c));if(_0x55b054){if(_0x38de75[_0x11d3('0x12')]===_0x11d3('0x13')){_0x30e223[_0x11d3('0x14')]=moment[_0x11d3('0x15')]();_0x30e223[_0x11d3('0x16')]=![];_0x30e223['IsRecurrence']=![];if(_0x55b054[_0x11d3('0x17')]===_0x11d3('0x18')||_0x55b054[_0x11d3('0x17')]===_0x11d3('0x19')){_0x30e223[_0x11d3('0x1a')]=_0x55b054['id'];}else if(_0x55b054[_0x11d3('0x17')]==='account'){_0x30e223[_0x11d3('0x1b')]=_0x55b054['id'];}}else if(_0x38de75[_0x11d3('0x12')]==='Case'){if(_0x55b054['endUserType']===_0x11d3('0x18')){_0x30e223[_0x11d3('0x1c')]=_0x55b054['id'];}else if(_0x55b054[_0x11d3('0x17')]===_0x11d3('0x1d')){_0x30e223[_0x11d3('0x1e')]=_0x55b054['id'];}else if(_0x55b054[_0x11d3('0x17')]===_0x11d3('0x19')&&_0x38de75[_0x11d3('0x1f')]){_0x30e223[_0x38de75[_0x11d3('0x1f')]]=_0x55b054['id'];}else{logger[_0x11d3('0x20')](_0x11d3('0x21'));}}}return _0x4571dd['sobject'](_0x38de75[_0x11d3('0x12')])[_0x11d3('0x22')](_0x30e223);}function getUser(_0x39be84,_0x5c529f,_0x5f674){if(!_[_0x11d3('0x23')](_0x5c529f)&&intUtil[_0x11d3('0x24')](_0x5c529f)){var _0x20aef8={'Email':_0x5c529f};var _0x1771fe={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x5f674[_0x11d3('0x25')](_0x11d3('0x26'))[_0x11d3('0x27')](_0x20aef8,_0x1771fe)[_0x11d3('0x28')]()['then'](function(_0x103793){if(_0x103793[_0x11d3('0x29')]){var _0x1dfae5=_[_0x11d3('0x27')](_0x103793,function(_0x5b896b){return _0x5b896b['Email']===_0x5c529f;});if(_0x1dfae5){logger['info'](_0x11d3('0x2a'),_0x5c529f);return BPromise['resolve']({'id':_0x1dfae5['Id'],'name':_0x1dfae5[_0x11d3('0x2b')]});}}else{logger['info'](_0x11d3('0x2c'),_0x5c529f);return _0x5f674[_0x11d3('0x2d')]()['then'](function(_0x1d29ea){return BPromise[_0x11d3('0x2e')]({'id':_0x1d29ea[_0x11d3('0x2f')],'name':_0x1d29ea['display_name']});});}});}else{logger['info'](_0x11d3('0x2c'),_0x5c529f);return _0x5f674[_0x11d3('0x2d')]()[_0x11d3('0x30')](function(_0xc55659){return BPromise['resolve']({'id':_0xc55659['user_id'],'name':_0xc55659[_0x11d3('0x31')]});});}}function getEndUser(_0x3395b2,_0x45f413,_0x464104,_0x29e9b5,_0x22b200){var _0x3778e6={'$or':{'Phone':_0x29e9b5}};var _0x1b8157={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x11d3('0x2e')]()[_0x11d3('0x30')](function(){logger[_0x11d3('0x20')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x29e9b5,_0x45f413['moduleSearch']);switch(_0x45f413[_0x11d3('0x32')]){case'contact_lead':var _0x194eb1=_[_0x11d3('0x33')](_0x3778e6);if(_0x45f413[_0x11d3('0x34')]){var _0x33cb25={};_0x33cb25[_0x45f413[_0x11d3('0x34')]]=_0x29e9b5;_[_0x11d3('0x35')](_0x194eb1['$or'],_0x33cb25);}return _0x22b200[_0x11d3('0x25')]('Contact')['find'](_0x194eb1,_0x1b8157)[_0x11d3('0x28')]()[_0x11d3('0x30')](function(_0x5959c9){if(_0x5959c9&&_0x5959c9[_0x11d3('0x29')]){return _0x5959c9;}else{var _0x2e9f99=_[_0x11d3('0x33')](_0x3778e6);if(_0x45f413[_0x11d3('0x36')]){var _0x585e7f={};_0x585e7f[_0x45f413['additionalSearchLead']]=_0x29e9b5;_[_0x11d3('0x35')](_0x2e9f99[_0x11d3('0x37')],_0x585e7f);}return _0x22b200[_0x11d3('0x25')](_0x11d3('0x38'))[_0x11d3('0x27')](_0x2e9f99,_0x1b8157);}});case _0x11d3('0x39'):var _0x498399=_[_0x11d3('0x33')](_0x3778e6);if(_0x45f413[_0x11d3('0x3a')]){var _0x33cb25={};_0x33cb25[_0x45f413[_0x11d3('0x3a')]]=_0x29e9b5;_[_0x11d3('0x35')](_0x498399[_0x11d3('0x37')],_0x33cb25);}return _0x22b200[_0x11d3('0x25')](_0x11d3('0x3b'))[_0x11d3('0x27')](_0x498399,_0x1b8157)[_0x11d3('0x28')]()[_0x11d3('0x30')](function(_0x3edc66){if(_0x3edc66&&_0x3edc66['length']){return _0x3edc66;}else{var _0x16c746=_[_0x11d3('0x33')](_0x3778e6);if(_0x45f413[_0x11d3('0x34')]){var _0x161acd={};_0x161acd[_0x45f413[_0x11d3('0x34')]]=_0x29e9b5;_[_0x11d3('0x35')](_0x16c746['$or'],_0x161acd);}return _0x22b200['sobject'](_0x11d3('0x3c'))[_0x11d3('0x27')](_0x16c746,_0x1b8157)['then'](function(_0x5ccb5f){if(_0x5ccb5f&&_0x5ccb5f[_0x11d3('0x29')]){return _0x5ccb5f;}else{var _0x4cc86f=_[_0x11d3('0x33')](_0x3778e6);if(_0x45f413[_0x11d3('0x36')]){var _0xa788d5={};_0xa788d5[_0x45f413[_0x11d3('0x36')]]=_0x29e9b5;_['merge'](_0x4cc86f[_0x11d3('0x37')],_0xa788d5);}return _0x22b200[_0x11d3('0x25')]('Lead')[_0x11d3('0x27')](_0x4cc86f,_0x1b8157);}});}});case'contact':var _0x194eb1=_[_0x11d3('0x33')](_0x3778e6);if(_0x45f413[_0x11d3('0x34')]){var _0x33cb25={};_0x33cb25[_0x45f413['additionalSearchContact']]=_0x29e9b5;_[_0x11d3('0x35')](_0x194eb1[_0x11d3('0x37')],_0x33cb25);}return _0x22b200[_0x11d3('0x25')](_0x11d3('0x3c'))[_0x11d3('0x27')](_0x194eb1,_0x1b8157)['execute']();case _0x11d3('0x19'):var _0x80b728=_[_0x11d3('0x33')](_0x3778e6);if(_0x45f413['additionalSearchLead']){var _0x33cb25={};_0x33cb25[_0x45f413[_0x11d3('0x36')]]=_0x29e9b5;_[_0x11d3('0x35')](_0x80b728[_0x11d3('0x37')],_0x33cb25);}return _0x22b200[_0x11d3('0x25')](_0x11d3('0x38'))[_0x11d3('0x27')](_0x80b728,_0x1b8157);case _0x11d3('0x1d'):var _0x498399=_[_0x11d3('0x33')](_0x3778e6);if(_0x45f413['additionalSearchAccount']){var _0x33cb25={};_0x33cb25[_0x45f413[_0x11d3('0x3a')]]=_0x29e9b5;_[_0x11d3('0x35')](_0x498399[_0x11d3('0x37')],_0x33cb25);}return _0x22b200[_0x11d3('0x25')](_0x11d3('0x3b'))[_0x11d3('0x27')](_0x498399,_0x1b8157);default:return null;}})[_0x11d3('0x30')](function(_0x322ab0){if(_0x322ab0&&_0x322ab0[_0x11d3('0x29')]){var _0x59c13e=_[_0x11d3('0x3d')](_0x322ab0);if(_0x59c13e){return BPromise[_0x11d3('0x2e')]({'id':_0x59c13e['Id'],'name':_0x59c13e[_0x11d3('0x2b')],'phone':_0x59c13e[_0x11d3('0x3e')],'endUserType':_0x59c13e[_0x11d3('0x3f')]['type'][_0x11d3('0x40')]()});}}})['then'](function(_0x2d72cc){if(_0x2d72cc){logger[_0x11d3('0x20')]('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x2d72cc['endUserType'],_0x29e9b5);return BPromise[_0x11d3('0x2e')](_0x2d72cc);}else{logger['info'](_0x11d3('0x41'),_0x29e9b5);var _0xc6fe77={'Phone':_0x29e9b5};if(_0x45f413[_0x11d3('0x42')]){if(_0x45f413[_0x11d3('0x42')]==='contact'){logger[_0x11d3('0x20')](_0x11d3('0x43'),_0x29e9b5,_0x45f413[_0x11d3('0x42')]);_0xc6fe77['LastName']=_0x464104!==_0x11d3('0x44')?_0x464104:util[_0x11d3('0x45')](_0x11d3('0x46'),_0x29e9b5);}else if(_0x45f413[_0x11d3('0x42')]===_0x11d3('0x19')){logger['info']('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x29e9b5,_0x45f413['moduleCreate']);_0xc6fe77[_0x11d3('0x47')]=_0x464104!==_0x11d3('0x44')?_0x464104:util[_0x11d3('0x45')](_0x11d3('0x46'),_0x29e9b5);_0xc6fe77[_0x11d3('0x48')]=_0x11d3('0x49');}else if(_0x45f413[_0x11d3('0x42')]===_0x11d3('0x1d')){logger[_0x11d3('0x20')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x29e9b5,_0x45f413[_0x11d3('0x42')]);_0xc6fe77[_0x11d3('0x2b')]=_0x464104!==_0x11d3('0x44')?_0x464104:util[_0x11d3('0x45')]('Caller\x20-\x20%s',_0x29e9b5);}else{return null;}}return _0x22b200[_0x11d3('0x25')](_[_0x11d3('0x4a')](_0x45f413[_0x11d3('0x42')]))[_0x11d3('0x22')](_0xc6fe77)[_0x11d3('0x30')](function(_0x1cc159){return BPromise[_0x11d3('0x2e')]({'id':_0x1cc159['id'],'endUserType':_0x45f413[_0x11d3('0x42')]});});}});}function getCustomFields(_0xb620c2,_0x7fefd2){var _0x5f1980={};if(_0xb620c2[_0x11d3('0x29')]>0x0){_[_0x11d3('0x4b')](_0xb620c2,function(_0xc4f481){if(_[_0x11d3('0x4c')]([_0x11d3('0x4d'),'picklist'],_0xc4f481[_0x11d3('0x4e')])&&_0xc4f481[_0x11d3('0x4f')]){_0x5f1980[_0xc4f481[_0x11d3('0x4f')]]=_0xc4f481[_0x11d3('0x50')][_0x11d3('0x51')]();}else if(_0xc4f481[_0x11d3('0x4e')]==='variable'&&_0xc4f481['variableName']&&_0xc4f481[_0x11d3('0x4f')]){_0x7fefd2[_0xc4f481[_0x11d3('0x52')]]&&(_0x5f1980[_0xc4f481['idField']]=_0x7fefd2[_0xc4f481[_0x11d3('0x52')]]['toString']());}else if(_0xc4f481['type']===_0x11d3('0x53')&&_0xc4f481['Variable']&&_0xc4f481['Variable'][_0x11d3('0x54')]&&_0xc4f481[_0x11d3('0x4f')]){_0x7fefd2[_0xc4f481[_0x11d3('0x55')][_0x11d3('0x54')]['toLowerCase']()]&&(_0x5f1980[_0xc4f481[_0x11d3('0x4f')]]=_0x7fefd2[_0xc4f481[_0x11d3('0x55')]['name']['toLowerCase']()]['toString']());}});}return _0x5f1980;}function getConnection(_0x1f304b){var _0x258590=_0x1f304b[_0x11d3('0x56')][_0x11d3('0x57')](_0x1f304b[_0x11d3('0x58')]);var _0x129966=new jsforce['Connection']({'oauth2':{'loginUrl':_0x1f304b['remoteUri']||_0x11d3('0x59'),'clientId':_0x1f304b[_0x11d3('0x5a')],'clientSecret':_0x1f304b[_0x11d3('0x5b')]}});return _0x129966['login'](_0x1f304b[_0x11d3('0x5c')],_0x258590)['then'](function(){logger[_0x11d3('0x20')](_0x11d3('0x5d'));return _0x129966;});}exports['queue']=function(_0x1ffa5e,_0x38f2e5,_0x3ebcdd,_0x4e2a9e,_0x31d441,_0x2603e6){var _0x3b6de3,_0x4e15d1,_0x1a4726,_0x470ce9;_0x2603e6[_0x11d3('0x5e')]=intUtil['stripTrailingSlash'](_0x2603e6[_0x11d3('0x5e')]);_0x2603e6[_0x11d3('0x5f')]=intUtil[_0x11d3('0x60')](_0x2603e6[_0x11d3('0x5f')]);if(_0x31d441&&_0x31d441[_0x11d3('0x61')]){logger[_0x11d3('0x20')](_0x11d3('0x62'),_0x11d3('0x63'));_0x38f2e5[_0x11d3('0x64')]=util[_0x11d3('0x45')](_0x11d3('0x65'),_0x2603e6['serverUrl'],_0x38f2e5[_0x11d3('0x66')],md5(_0x38f2e5[_0x11d3('0x66')]));}else{_0x38f2e5[_0x11d3('0x64')]='';}return getConnection(_0x2603e6)[_0x11d3('0x30')](function(_0x13e4ba){_0x470ce9=_0x13e4ba;return getUser(_0x2603e6,_0x4e2a9e[_0x11d3('0x67')],_0x470ce9);})[_0x11d3('0x30')](function(_0x27a80f){_0x3b6de3=_0x27a80f;return getEndUser(_0x2603e6,_0x3ebcdd,_0x38f2e5[_0x11d3('0x68')],_0x38f2e5[_0x11d3('0x69')],_0x470ce9);})[_0x11d3('0x30')](function(_0x2ca291){_0x4e15d1=_0x2ca291;return getTicket(_0x2603e6,_0x3b6de3,_0x4e15d1,_0x3ebcdd,_0x38f2e5,_0x3ebcdd[_0x11d3('0x6a')],_0x470ce9,_0x11d3('0x6b'));})[_0x11d3('0x30')](function(_0x809ba8){_0x1a4726=_0x809ba8;logger['info'](_0x11d3('0x6c'),_0x1a4726['id']);logger[_0x11d3('0x20')](_0x11d3('0x6d'),_0x1a4726['id'],_0x4e2a9e['name'],_0x2603e6[_0x11d3('0x4e')]);switch(_0x2603e6[_0x11d3('0x4e')]){case _0x11d3('0x6e'):emit(util[_0x11d3('0x45')](_0x11d3('0x6f'),_0x4e2a9e[_0x11d3('0x54')]),'trigger:salesforce:display',{'recordId':_0x1a4726['id']});break;case _0x11d3('0x70'):emit(util[_0x11d3('0x45')](_0x11d3('0x6f'),_0x4e2a9e[_0x11d3('0x54')]),_0x11d3('0x71'),{'uri':util[_0x11d3('0x45')](_0x11d3('0x72'),_0x470ce9[_0x11d3('0x73')],_0x1a4726['id'])});break;default:logger[_0x11d3('0x74')](_0x11d3('0x75'));}})[_0x11d3('0x76')](function(_0x446db2){logger['error']('[QUEUE]',_0x446db2);});};exports[_0x11d3('0x77')]=function(_0x28c460,_0x3fe4fe,_0x4dc4ab,_0x39805c,_0x4aa19e,_0x2f899b,_0x32049a){var _0x58569e,_0x1ff3c9,_0x1dd1d5,_0x24293a;_0x2f899b[_0x11d3('0x5e')]=intUtil[_0x11d3('0x60')](_0x2f899b[_0x11d3('0x5e')]);_0x2f899b[_0x11d3('0x5f')]=intUtil[_0x11d3('0x60')](_0x2f899b['remoteUri']);if(_0x32049a&&_0x32049a[_0x11d3('0x78')]&&_0x32049a['recordingFormat']!==_0x11d3('0x79')){logger[_0x11d3('0x20')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x3fe4fe[_0x11d3('0x64')]=util[_0x11d3('0x45')](_0x11d3('0x65'),_0x2f899b[_0x11d3('0x5e')],_0x3fe4fe[_0x11d3('0x66')],md5(_0x3fe4fe[_0x11d3('0x66')]));}return getConnection(_0x2f899b)['then'](function(_0xb80ff6){_0x24293a=_0xb80ff6;return getUser(_0x2f899b,_0x39805c[_0x11d3('0x67')],_0x24293a);})[_0x11d3('0x30')](function(_0x3e7c0a){_0x58569e=_0x3e7c0a;return getEndUser(_0x2f899b,_0x4dc4ab,_0x3fe4fe['destcalleridname'],_0x3fe4fe[_0x11d3('0x7a')],_0x24293a);})[_0x11d3('0x30')](function(_0x43a41b){_0x1ff3c9=_0x43a41b;return getTicket(_0x2f899b,_0x58569e,_0x1ff3c9,_0x4dc4ab,_0x3fe4fe,_0x4dc4ab['Fields'],_0x24293a,'outbound');})[_0x11d3('0x30')](function(_0x4d34b5){_0x1dd1d5=_0x4d34b5;logger['info'](_0x11d3('0x7b'),_0x1dd1d5['id']);logger[_0x11d3('0x20')](_0x11d3('0x7c'),_0x1dd1d5['id'],_0x39805c[_0x11d3('0x54')],_0x2f899b['type']);switch(_0x2f899b[_0x11d3('0x4e')]){case _0x11d3('0x6e'):emit(util[_0x11d3('0x45')](_0x11d3('0x6f'),_0x39805c[_0x11d3('0x54')]),_0x11d3('0x7d'),{'recordId':_0x1dd1d5['id']});break;case _0x11d3('0x70'):emit(util[_0x11d3('0x45')](_0x11d3('0x6f'),_0x39805c[_0x11d3('0x54')]),_0x11d3('0x71'),{'uri':util[_0x11d3('0x45')](_0x11d3('0x72'),_0x24293a[_0x11d3('0x73')],_0x1dd1d5['id'])});break;default:logger[_0x11d3('0x74')](_0x11d3('0x7e'),_0x11d3('0x7f'));}})[_0x11d3('0x76')](function(_0x2d8e6b){logger[_0x11d3('0x74')]('[OUTBOUND]',_0x2d8e6b);});};exports[_0x11d3('0x80')]=function(_0x30ece6,_0x3714f0,_0x2d45b4,_0x2dcc46,_0x44cf2f,_0x268c47){var _0x9778ef,_0x5edbaa,_0x5b0476,_0x4dae41;_0x268c47[_0x11d3('0x5e')]=intUtil[_0x11d3('0x60')](_0x268c47[_0x11d3('0x5e')]);_0x268c47[_0x11d3('0x5f')]=intUtil[_0x11d3('0x60')](_0x268c47[_0x11d3('0x5f')]);if(_0x44cf2f&&_0x44cf2f['monitor_format']){logger['info']('['+_0x3714f0['lastevent'][_0x11d3('0x81')]()+']',_0x11d3('0x63'));_0x3714f0['recordingURL']=util[_0x11d3('0x45')](_0x11d3('0x65'),_0x268c47['serverUrl'],_0x3714f0['uniqueid'],md5(_0x3714f0[_0x11d3('0x66')]));}else{_0x3714f0[_0x11d3('0x64')]='';}return getConnection(_0x268c47)[_0x11d3('0x30')](function(_0x4993e4){_0x4dae41=_0x4993e4;if(!_[_0x11d3('0x23')](_0x2dcc46)){return getUser(_0x268c47,_0x2dcc46[_0x11d3('0x54')],_0x4dae41);}else{return getUser(_0x268c47,null,_0x4dae41);}})['then'](function(_0x28ad73){_0x9778ef=_0x28ad73;return getEndUser(_0x268c47,_0x2d45b4,_0x3714f0['calleridname'],_0x3714f0[_0x11d3('0x69')],_0x4dae41);})['then'](function(_0x19b081){_0x5edbaa=_0x19b081;return getTicket(_0x268c47,_0x9778ef,_0x5edbaa,_0x2d45b4,_0x3714f0,_0x2d45b4['Fields'],_0x4dae41);})[_0x11d3('0x30')](function(_0x319f31){_0x5b0476=_0x319f31;logger[_0x11d3('0x20')]('['+_0x3714f0['lastevent'][_0x11d3('0x81')]()+_0x11d3('0x82'),_0x5b0476['id']);logger[_0x11d3('0x20')]('['+_0x3714f0['lastevent'][_0x11d3('0x81')]()+_0x11d3('0x83'),_0x268c47[_0x11d3('0x4e')]);})[_0x11d3('0x76')](function(_0x3bf324){logger[_0x11d3('0x74')]('['+_0x3714f0[_0x11d3('0x84')][_0x11d3('0x81')]()+']',_0x3bf324);});}; \ 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 0586133..74f8e4a 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 _0x65fc=['md5','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','adminId','sys_id','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','info','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20entity','length','active','userId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','true','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','string','picklist','nameField','customField','toLowerCase','toString','includes','type','idField','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','assign','Subjects','Descriptions','Fields','ticketNumber','number','label','?sysparm_query=name%3D','label_entry','incident','Incident','Incident\x20-\x20','forEach',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','push','all','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','user:%s','emit','trigger:browser:url','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','format','%s/api/now/table/','email','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','none','[OUTBOUND]','Displaying\x20call\x20in\x20a\x20new\x20tab...','ticketId','inspect','lodash','bluebird','util'];(function(_0x16938f,_0x35e57f){var _0x5c66e9=function(_0x5167d7){while(--_0x5167d7){_0x16938f['push'](_0x16938f['shift']());}};_0x5c66e9(++_0x35e57f);}(_0x65fc,0xd9));var _0xc65f=function(_0x566550,_0x122d8f){_0x566550=_0x566550-0x0;var _0xab0833=_0x65fc[_0x566550];return _0xab0833;};'use strict';var _=require(_0xc65f('0x0'));var Promise=require(_0xc65f('0x1'));var rp=require('request-promise');var util=require(_0xc65f('0x2'));var md5=require(_0xc65f('0x3'));var Redis=require('ioredis');var intUtil=require(_0xc65f('0x4'));var config=require(_0xc65f('0x5'));var logger=require(_0xc65f('0x6'))(_0xc65f('0x7'));config[_0xc65f('0x8')]=_['defaults'](config[_0xc65f('0x8')],{'host':_0xc65f('0x9'),'port':0x18eb});var io=require(_0xc65f('0xa'))(new Redis(config['redis']));function getAdminUser(_0x40195d,_0x2d74c5,_0x5c63e0,_0xa3f3e1,_0x328a19,_0x4f5611){return new Promise(function(_0x21b7fa,_0x43a797){var _0x2dd526={'method':_0xc65f('0xb'),'uri':_0xa3f3e1+_0xc65f('0xc')+'&'+_0x328a19+'&'+_0x4f5611,'auth':_0x2d74c5,'json':!![]};return rp(_0x2dd526)[_0xc65f('0xd')](function(_0x4d0f53){if(_0x4d0f53[_0xc65f('0xe')]['length']>0x0){_0x5c63e0[_0xc65f('0xf')]=_0x4d0f53[_0xc65f('0xe')][0x0][_0xc65f('0x10')];}logger['info']('['+[_0x40195d[_0xc65f('0x11')]()]+_0xc65f('0x12'),_0x5c63e0);_0x21b7fa(_0x5c63e0);})[_0xc65f('0x13')](function(_0x165271){logger[_0xc65f('0x14')]('['+[_0x40195d['toUpperCase']()]+']',_0x165271['message']);_0x43a797(_0x165271[_0xc65f('0x15')]);});});}function getUser(_0x4b6cac,_0x3d6c40,_0x2d8604,_0x539389,_0x420a24){return function(_0x3ff763){logger[_0xc65f('0x16')]('['+[_0x4b6cac[_0xc65f('0x11')]()]+'],\x20getUser\x20input\x20crm',_0x3ff763);return new Promise(function(_0x1d87c0,_0x1b25a6){if(intUtil[_0xc65f('0x17')](_0x3ff763[_0xc65f('0x18')])){var _0x52c312={'method':_0xc65f('0xb'),'uri':_0x2d8604+_0xc65f('0x19')+_0x3ff763[_0xc65f('0x18')]+'&'+_0x539389+'&'+_0x420a24,'auth':_0x3d6c40,'json':!![]};logger['info']('['+[_0x4b6cac[_0xc65f('0x11')]()]+'],\x20getUser\x20rp\x20obj',_0x52c312);return rp(_0x52c312)[_0xc65f('0xd')](function(_0x1ac9d9){logger[_0xc65f('0x16')]('['+[_0x4b6cac[_0xc65f('0x11')]()]+_0xc65f('0x1a'),_0x1ac9d9);if(_0x1ac9d9[_0xc65f('0xe')][_0xc65f('0x1b')]>0x0&&String(_0x1ac9d9[_0xc65f('0xe')][0x0][_0xc65f('0x1c')])==='true'){_0x3ff763[_0xc65f('0x1d')]=_0x1ac9d9[_0xc65f('0xe')][0x0][_0xc65f('0x10')];}else{_0x3ff763[_0xc65f('0x1d')]=_0x3ff763['adminId'];_0x3ff763[_0xc65f('0x18')]=_0x3ff763[_0xc65f('0x1e')];}logger[_0xc65f('0x16')]('['+[_0x4b6cac[_0xc65f('0x11')]()]+_0xc65f('0x1f'),_0x3ff763);_0x1d87c0(_0x3ff763);})[_0xc65f('0x13')](function(_0x12a354){logger['error']('['+[_0x4b6cac[_0xc65f('0x11')]()]+']',_0x12a354[_0xc65f('0x15')]);_0x1b25a6(_0x12a354[_0xc65f('0x15')]);});}else{logger[_0xc65f('0x16')]('['+[_0x4b6cac[_0xc65f('0x11')]()]+_0xc65f('0x20'));_0x3ff763['userId']=_0x3ff763[_0xc65f('0xf')];_0x3ff763[_0xc65f('0x18')]=_0x3ff763[_0xc65f('0x1e')];_0x1d87c0(_0x3ff763);}});};}function createEndUser(_0x400948,_0xa99e94,_0x4109c7,_0xaa218f,_0x1e9a54){logger[_0xc65f('0x16')]('['+[_0x400948[_0xc65f('0x11')]()]+_0xc65f('0x21'),_0x4109c7);return new Promise(function(_0x497353,_0x1aa2ce){var _0x2f3baf={'method':_0xc65f('0x22'),'uri':_0xaa218f+_0xc65f('0x23')+_0x1e9a54,'body':{'user_name':_0x4109c7[_0xc65f('0x24')],'roles':'user','first_name':_0x4109c7[_0xc65f('0x24')],'active':_0xc65f('0x25'),'date_format':_0xc65f('0x26'),'phone':_0x4109c7['endUserNumber']},'auth':_0xa99e94,'json':!![]};return rp(_0x2f3baf)['then'](function(_0x2fb802){logger[_0xc65f('0x16')]('['+[_0x400948[_0xc65f('0x11')]()]+_0xc65f('0x27'),_0x2fb802['result']);_0x4109c7[_0xc65f('0x28')]=_0x2fb802[_0xc65f('0xe')][_0xc65f('0x10')];_0x497353(_0x4109c7);})[_0xc65f('0x13')](function(_0x242357){logger[_0xc65f('0x14')]('['+[_0x400948[_0xc65f('0x11')]()]+']',_0x242357['message']);_0x1aa2ce(_0x242357[_0xc65f('0x15')]);});});}function getEndUser(_0x4af409,_0x2f8928,_0x4c22e1,_0xe24f35,_0x52c077){return function(_0x2df154){logger['info']('['+[_0x4af409['toUpperCase']()]+_0xc65f('0x29'),_0x2df154);return new Promise(function(_0xed6354,_0x10a8a5){var _0x3775a7={'method':'GET','uri':_0x4c22e1+_0xc65f('0x2a')+_0x2df154['endUserNumber']+'&'+_0xe24f35+'&'+_0x52c077,'auth':_0x2f8928,'json':!![]};return rp(_0x3775a7)[_0xc65f('0xd')](function(_0x169e2a){if(_0x169e2a['result']['length']>0x0){_0x2df154[_0xc65f('0x28')]=_0x169e2a[_0xc65f('0xe')][0x0][_0xc65f('0x10')];logger[_0xc65f('0x16')]('['+[_0x4af409[_0xc65f('0x11')]()]+'],\x20getEndUser\x20crm',_0x2df154);_0xed6354(_0x2df154);}else{return createEndUser(_0x4af409,_0x2f8928,_0x2df154,_0x4c22e1,_0xe24f35)[_0xc65f('0xd')](function(_0xaab76b){logger[_0xc65f('0x16')]('['+[_0x4af409[_0xc65f('0x11')]()]+'],\x20createEndUser\x20crm',_0xaab76b);_0xed6354(_0xaab76b);});}})[_0xc65f('0x13')](function(_0x3a16eb){logger[_0xc65f('0x14')]('['+[_0x4af409['toUpperCase']()]+']',_0x3a16eb[_0xc65f('0x15')]);_0x10a8a5(_0x3a16eb[_0xc65f('0x15')]);});});};}function getCustomFields(_0x172359,_0xa14cd){var _0x471fed={};if(_0x172359['length']>0x0){_['forEach'](_0x172359,function(_0x30b420){if(_['includes']([_0xc65f('0x2b'),_0xc65f('0x2c')],_0x30b420['type'])&&_0x30b420[_0xc65f('0x2d')]&&!_0x30b420[_0xc65f('0x2e')]){_0x471fed[_0x30b420[_0xc65f('0x2d')][_0xc65f('0x2f')]()]=_0x30b420['content'][_0xc65f('0x30')]();}else if(_[_0xc65f('0x31')]([_0xc65f('0x2b'),'picklist'],_0x30b420[_0xc65f('0x32')])&&_0x30b420[_0xc65f('0x33')]&&_0x30b420[_0xc65f('0x2e')]){_0x471fed[_0x30b420['idField']['toLowerCase']()]=_0x30b420['content'][_0xc65f('0x30')]();}else if(_0x30b420[_0xc65f('0x32')]===_0xc65f('0x34')&&_0x30b420[_0xc65f('0x35')]&&_0x30b420[_0xc65f('0x33')]&&_0x30b420[_0xc65f('0x2e')]){_0x471fed[_0x30b420[_0xc65f('0x33')][_0xc65f('0x2f')]()]=_0xa14cd[_0x30b420[_0xc65f('0x35')]][_0xc65f('0x30')]();}else if(_0x30b420[_0xc65f('0x32')]===_0xc65f('0x36')&&_0x30b420['Variable']&&_0x30b420[_0xc65f('0x37')]['name']&&_0x30b420['idField']&&_0x30b420['customField']){_0x471fed[_0x30b420[_0xc65f('0x33')][_0xc65f('0x2f')]()]=_0xa14cd[_0x30b420[_0xc65f('0x37')][_0xc65f('0x38')][_0xc65f('0x2f')]()][_0xc65f('0x30')]();}});}return _0x471fed;}function getTicket(_0x9b784c,_0x2b945f,_0x510532,_0x28f044,_0x3b70f4,_0x5a1687){return function(_0x48b205){logger[_0xc65f('0x16')]('['+[_0x9b784c[_0xc65f('0x11')]()]+_0xc65f('0x39'),_0x48b205);return new Promise(function(_0xf5be17,_0x369fad){var _0x2fda9a=_0x9b784c[_0xc65f('0x2f')]()===_0xc65f('0x3a')?_0x48b205[_0xc65f('0x1d')]:_0x48b205['endUserId'];var _0x30e480={'method':_0xc65f('0x22'),'uri':_0x510532+'incident'+'?'+_0x5a1687,'body':Object[_0xc65f('0x3b')]({},{'active':'true','caller_id':_0x2fda9a,'assigned_to':_0x48b205[_0xc65f('0x1d')],'short_description':intUtil['getString'](_0x28f044[_0xc65f('0x3c')],_0x3b70f4,'\x20'),'description':intUtil['getString'](_0x28f044[_0xc65f('0x3d')],_0x3b70f4,'\x0a')},getCustomFields(_0x28f044[_0xc65f('0x3e')],_0x3b70f4)),'auth':_0x2b945f,'json':!![]};return rp(_0x30e480)[_0xc65f('0xd')](function(_0x1a2676){logger[_0xc65f('0x16')]('['+[_0x9b784c[_0xc65f('0x11')]()]+']\x20POST\x20incident\x20entity\x20schema',_0x1a2676[_0xc65f('0xe')]);_0x48b205['ticketId']=_0x1a2676[_0xc65f('0xe')]['sys_id'];_0x48b205[_0xc65f('0x3f')]=_0x1a2676[_0xc65f('0xe')][_0xc65f('0x40')];logger[_0xc65f('0x16')]('['+[_0x9b784c['toUpperCase']()]+']\x20getTicket\x20crm',_0x48b205);_0xf5be17(_0x48b205);})[_0xc65f('0x13')](function(_0x1ae764){logger[_0xc65f('0x14')]('['+[_0x9b784c[_0xc65f('0x11')]()]+']',_0x1ae764[_0xc65f('0x15')]);_0x369fad(_0x1ae764[_0xc65f('0x15')]);});});};}function createRemoteTag(_0x5774aa,_0x3cf1a3,_0x54f469,_0x1ae24d){return new Promise(function(_0x19a7ce,_0x2c93a0){var _0x32c721={'method':_0xc65f('0x22'),'uri':_0x54f469+'label'+'?'+_0x1ae24d,'body':{'short_description':_0x5774aa,'global':!![],'active':!![],'name':_0x5774aa},'auth':_0x3cf1a3,'json':!![]};return rp(_0x32c721)[_0xc65f('0xd')](function(_0x19e023){var _0x25aba1=_0x19e023[_0xc65f('0xe')]['sys_id'];_0x19a7ce(_0x25aba1);});});}function getRemoteTag(_0x2042d4,_0x134969,_0x3f30c4,_0x21678a,_0x59590d){return new Promise(function(_0x1c79c1,_0x24f89e){var _0x5ec5c8={'method':'GET','uri':_0x3f30c4+_0xc65f('0x41')+_0xc65f('0x42')+_0x2042d4+'&'+_0x21678a,'auth':_0x134969,'json':!![]};return rp(_0x5ec5c8)[_0xc65f('0xd')](function(_0x9361b1){if(_0x9361b1[_0xc65f('0xe')][_0xc65f('0x1b')]>0x0){var _0x1bf521=_0x9361b1[_0xc65f('0xe')][0x0][_0xc65f('0x10')];_0x1c79c1(_0x1bf521);}else{return createRemoteTag(_0x2042d4,_0x134969,_0x3f30c4,_0x21678a)['then'](function(_0x15cef0){_0x1c79c1(_0x15cef0);});}});});}function assignTagToIncident(_0xba290,_0x1ace04,_0x35efd1,_0x498f7a,_0x6849ca){return new Promise(function(_0x25bc84,_0x539690){var _0x2fa898={'method':_0xc65f('0x22'),'uri':_0x35efd1+_0xc65f('0x43')+'?'+_0x6849ca,'body':{'label':_0xba290,'table':_0xc65f('0x44'),'id_type':_0xc65f('0x45'),'table_key':_0x498f7a['ticketId'],'title':_0xc65f('0x46')+_0x498f7a['ticketNumber'],'id_display':_0x498f7a['ticketNumber']},'auth':_0x1ace04,'json':!![]};return rp(_0x2fa898)[_0xc65f('0xd')](function(_0x27eb62){_0x25bc84();})[_0xc65f('0x13')](function(){_0x25bc84();});});}function manageTags(_0x3bf3c6,_0x1f2d0a,_0x101e53,_0x478d2b,_0x3cb9a1,_0x595005,_0x1e1ff9){return new Promise(function(_0x101ca1,_0x29059b){var _0x2fdb2c=[];_0x1f2d0a[_0xc65f('0x47')](function(_0x96fa5e){_0x2fdb2c['push'](getRemoteTag(_0x96fa5e,_0x101e53,_0x478d2b,_0x595005,_0x1e1ff9));});return Promise['all'](_0x2fdb2c)['then'](function(_0x37dcde){if(_0x37dcde['length']){logger[_0xc65f('0x16')]('['+[_0x3bf3c6[_0xc65f('0x11')]()]+_0xc65f('0x48'),_0x37dcde);var _0x3c377f=[];_0x37dcde[_0xc65f('0x47')](function(_0x12814a){_0x3c377f[_0xc65f('0x49')](assignTagToIncident(_0x12814a,_0x101e53,_0x478d2b,_0x3cb9a1,_0x595005));});return Promise[_0xc65f('0x4a')](_0x3c377f)[_0xc65f('0xd')](function(){_0x101ca1();})[_0xc65f('0x13')](function(){_0x101ca1();});}else{_0x101ca1();}});});}function getTags(_0x5a50c1,_0xd3f6b9,_0x26ec08,_0x4c3c88,_0x2fd28b,_0x403b2b){return function(_0x4e0ee4){return new Promise(function(_0x41fc3a,_0x6df47f){var _0xe0f9eb=[];var _0x55caca=_0x4c3c88[_0xc65f('0x4b')];if(_0x55caca&&_0x55caca[_0xc65f('0x1b')]>0x0){_0xe0f9eb=_[_0xc65f('0x4c')](_0x55caca,_0xc65f('0x38'));}if(_0xe0f9eb[_0xc65f('0x1b')]>0x0){return manageTags(_0x5a50c1,_0xe0f9eb,_0xd3f6b9,_0x26ec08,_0x4e0ee4,_0x2fd28b,_0x403b2b)['then'](function(){_0x41fc3a(_0x4e0ee4);});}else{_0x41fc3a(_0x4e0ee4);}});};}function emit(_0x322791,_0x3b174f,_0x5310f0){var _0x5a740c=_0xc65f('0x4d')+_0xc65f('0x4e')+_0xc65f('0x4f')+_0xc65f('0x50');var _0x371eeb={'uri':_0x322791+_0xc65f('0x51')+_0x5310f0+_0x5a740c};io['to'](util['format'](_0xc65f('0x52'),_0x3b174f))[_0xc65f('0x53')](_0xc65f('0x54'),_0x371eeb);}exports['cs']=function(_0x98a2ed,_0x2b6f4a,_0x213cc6,_0x4a4174,_0x3d2c80,_0x55ce09,_0x2db3ca,_0x24df97){var _0x4d3e04={};var _0x4e269e={'user':_0x55ce09['username'],'pass':_0x55ce09[_0xc65f('0x55')]};var _0x1216db=_0xc65f('0x56');var _0x56d042=_0xc65f('0x57');_0x55ce09[_0xc65f('0x58')]=intUtil[_0xc65f('0x59')](_0x55ce09[_0xc65f('0x58')]);_0x55ce09[_0xc65f('0x5a')]=intUtil[_0xc65f('0x59')](_0x55ce09['serverUrl']);var _0x56586a=util[_0xc65f('0x5b')](_0xc65f('0x5c'),_0x55ce09['remoteUri']);_0x4d3e04['userEmail']=!_['isNil'](_0x4a4174)?_0x4a4174[_0xc65f('0x5d')]:null;_0x4d3e04[_0xc65f('0x1e')]=_0x55ce09['email'];_0x4d3e04[_0xc65f('0x24')]=_0x24df97['toLowerCase']()===_0xc65f('0x3a')?_0x2b6f4a[_0xc65f('0x5e')]:_0x2b6f4a[_0xc65f('0x5f')];_0x4d3e04[_0xc65f('0x60')]=_0x24df97===_0xc65f('0x61')||_0x24df97===_0xc65f('0x62')?_0xc65f('0x61'):_0xc65f('0x3a');var _0x17b105=util[_0xc65f('0x5b')](_0xc65f('0x63'),_0x55ce09[_0xc65f('0x5a')],_0x2b6f4a[_0xc65f('0x64')],md5(_0x2b6f4a[_0xc65f('0x64')]));if(_0x3d2c80&&_0x3d2c80[_0xc65f('0x65')]){logger[_0xc65f('0x16')](_0xc65f('0x66'),_0xc65f('0x67'));_0x2b6f4a[_0xc65f('0x68')]=_0x17b105;}else if(_0x2db3ca&&_0x2db3ca['recordingFormat']&&_0x2db3ca['recordingFormat']!==_0xc65f('0x69')){logger[_0xc65f('0x16')](_0xc65f('0x6a'),'Recording\x20is\x20enabled!');_0x2b6f4a[_0xc65f('0x68')]=_0x17b105;}else{_0x2b6f4a[_0xc65f('0x68')]='';}return getAdminUser(_0x24df97,_0x4e269e,_0x4d3e04,_0x56586a,_0x56d042,_0x1216db)[_0xc65f('0xd')](getUser(_0x24df97,_0x4e269e,_0x56586a,_0x56d042,_0x1216db))[_0xc65f('0xd')](getEndUser(_0x24df97,_0x4e269e,_0x56586a,_0x56d042,_0x1216db))['then'](getTicket(_0x24df97,_0x4e269e,_0x56586a,_0x213cc6,_0x2b6f4a,_0x56d042))[_0xc65f('0xd')](function(_0xde4908){logger[_0xc65f('0x16')](util[_0xc65f('0x5b')]('The\x20ticket\x20ID\x20is:\x20%s',_0xde4908['ticketId']));logger[_0xc65f('0x16')](util[_0xc65f('0x5b')]('call\x20direction:\x20%s',_0x24df97));if(_0x24df97!==_0xc65f('0x62')){logger[_0xc65f('0x16')]('['+[_0x24df97[_0xc65f('0x11')]()]+']',_0xc65f('0x6b'));emit(_0x55ce09[_0xc65f('0x58')],_0x4a4174[_0xc65f('0x38')],_0xde4908[_0xc65f('0x6c')]);}})['catch'](function(_0x47c841){logger['error']('['+[_0x24df97['toUpperCase']()]+']\x20Error\x20running\x20ServiceNow\x20integration',util[_0xc65f('0x6d')](_0x47c841,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xe288=['getString','Subjects','Descriptions',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber',']\x20getTicket\x20crm','label','Incident','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','trigger:browser:url','username','sysparm_limit=1','sysparm_display_value=true','remoteUri','serverUrl','stripTrailingSlash','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','lodash','bluebird','request-promise','util','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','defaults','redis','localhost','socket.io-emitter','GET','then','result','sys_id','info','toUpperCase','catch','error','message','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','true','userId','adminEmail','],\x20getUser\x20crm','adminId','],\x20createEndUser\x20input\x20crm','POST','endUserNumber','user','System','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','length','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','string','picklist','nameField','customField','toLowerCase','content','toString','includes','type','idField','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident'];(function(_0x4289bf,_0x36a20e){var _0x520703=function(_0x3318fc){while(--_0x3318fc){_0x4289bf['push'](_0x4289bf['shift']());}};_0x520703(++_0x36a20e);}(_0xe288,0x104));var _0x8e28=function(_0x3c6035,_0x78a470){_0x3c6035=_0x3c6035-0x0;var _0x11e875=_0xe288[_0x3c6035];return _0x11e875;};'use strict';var _=require(_0x8e28('0x0'));var Promise=require(_0x8e28('0x1'));var rp=require(_0x8e28('0x2'));var util=require(_0x8e28('0x3'));var md5=require(_0x8e28('0x4'));var Redis=require(_0x8e28('0x5'));var intUtil=require(_0x8e28('0x6'));var config=require(_0x8e28('0x7'));var logger=require(_0x8e28('0x8'))(_0x8e28('0x9'));config['redis']=_[_0x8e28('0xa')](config[_0x8e28('0xb')],{'host':_0x8e28('0xc'),'port':0x18eb});var io=require(_0x8e28('0xd'))(new Redis(config[_0x8e28('0xb')]));function getAdminUser(_0x455626,_0x59374a,_0x444f2a,_0x10a3e1,_0x31b00c,_0x255c13){return new Promise(function(_0x453e38,_0x171a63){var _0x28bf71={'method':_0x8e28('0xe'),'uri':_0x10a3e1+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0x31b00c+'&'+_0x255c13,'auth':_0x59374a,'json':!![]};return rp(_0x28bf71)[_0x8e28('0xf')](function(_0x328375){if(_0x328375[_0x8e28('0x10')]['length']>0x0){_0x444f2a['adminId']=_0x328375[_0x8e28('0x10')][0x0][_0x8e28('0x11')];}logger[_0x8e28('0x12')]('['+[_0x455626[_0x8e28('0x13')]()]+'],\x20getAdminUser\x20crm',_0x444f2a);_0x453e38(_0x444f2a);})[_0x8e28('0x14')](function(_0x5ec7df){logger[_0x8e28('0x15')]('['+[_0x455626['toUpperCase']()]+']',_0x5ec7df[_0x8e28('0x16')]);_0x171a63(_0x5ec7df['message']);});});}function getUser(_0x2229dd,_0x49c8cd,_0x129928,_0x17b726,_0x258ad9){return function(_0x3a4f0d){logger[_0x8e28('0x12')]('['+[_0x2229dd['toUpperCase']()]+'],\x20getUser\x20input\x20crm',_0x3a4f0d);return new Promise(function(_0xa54e2d,_0x747f40){if(intUtil['validateEmail'](_0x3a4f0d[_0x8e28('0x17')])){var _0x1f237b={'method':'GET','uri':_0x129928+_0x8e28('0x18')+_0x3a4f0d[_0x8e28('0x17')]+'&'+_0x17b726+'&'+_0x258ad9,'auth':_0x49c8cd,'json':!![]};logger['info']('['+[_0x2229dd[_0x8e28('0x13')]()]+_0x8e28('0x19'),_0x1f237b);return rp(_0x1f237b)[_0x8e28('0xf')](function(_0x3c0faa){logger[_0x8e28('0x12')]('['+[_0x2229dd['toUpperCase']()]+'],\x20getUser\x20entity',_0x3c0faa);if(_0x3c0faa[_0x8e28('0x10')]['length']>0x0&&String(_0x3c0faa[_0x8e28('0x10')][0x0]['active'])===_0x8e28('0x1a')){_0x3a4f0d[_0x8e28('0x1b')]=_0x3c0faa[_0x8e28('0x10')][0x0]['sys_id'];}else{_0x3a4f0d['userId']=_0x3a4f0d['adminId'];_0x3a4f0d[_0x8e28('0x17')]=_0x3a4f0d[_0x8e28('0x1c')];}logger['info']('['+[_0x2229dd[_0x8e28('0x13')]()]+_0x8e28('0x1d'),_0x3a4f0d);_0xa54e2d(_0x3a4f0d);})['catch'](function(_0x50d397){logger[_0x8e28('0x15')]('['+[_0x2229dd['toUpperCase']()]+']',_0x50d397[_0x8e28('0x16')]);_0x747f40(_0x50d397[_0x8e28('0x16')]);});}else{logger[_0x8e28('0x12')]('['+[_0x2229dd['toUpperCase']()]+']\x20using\x20admin\x20profile');_0x3a4f0d[_0x8e28('0x1b')]=_0x3a4f0d[_0x8e28('0x1e')];_0x3a4f0d[_0x8e28('0x17')]=_0x3a4f0d[_0x8e28('0x1c')];_0xa54e2d(_0x3a4f0d);}});};}function createEndUser(_0x45c644,_0x449197,_0x646e81,_0x49f009,_0x1eaae8){logger[_0x8e28('0x12')]('['+[_0x45c644[_0x8e28('0x13')]()]+_0x8e28('0x1f'),_0x646e81);return new Promise(function(_0x5653f0,_0x5ebae6){var _0x914129={'method':_0x8e28('0x20'),'uri':_0x49f009+'sys_user?'+_0x1eaae8,'body':{'user_name':_0x646e81[_0x8e28('0x21')],'roles':_0x8e28('0x22'),'first_name':_0x646e81[_0x8e28('0x21')],'active':_0x8e28('0x1a'),'date_format':_0x8e28('0x23'),'phone':_0x646e81[_0x8e28('0x21')]},'auth':_0x449197,'json':!![]};return rp(_0x914129)[_0x8e28('0xf')](function(_0xd600ee){logger[_0x8e28('0x12')]('['+[_0x45c644[_0x8e28('0x13')]()]+'],\x20EndUser\x20schema',_0xd600ee[_0x8e28('0x10')]);_0x646e81[_0x8e28('0x24')]=_0xd600ee['result'][_0x8e28('0x11')];_0x5653f0(_0x646e81);})[_0x8e28('0x14')](function(_0x1d68da){logger[_0x8e28('0x15')]('['+[_0x45c644[_0x8e28('0x13')]()]+']',_0x1d68da[_0x8e28('0x16')]);_0x5ebae6(_0x1d68da['message']);});});}function getEndUser(_0x49604c,_0x502b90,_0x198868,_0x3027b6,_0x308d29){return function(_0x25796c){logger[_0x8e28('0x12')]('['+[_0x49604c[_0x8e28('0x13')]()]+_0x8e28('0x25'),_0x25796c);return new Promise(function(_0x2da562,_0x14b17c){var _0x14316e={'method':'GET','uri':_0x198868+_0x8e28('0x26')+_0x25796c['endUserNumber']+'&'+_0x3027b6+'&'+_0x308d29,'auth':_0x502b90,'json':!![]};return rp(_0x14316e)[_0x8e28('0xf')](function(_0x4d47cb){if(_0x4d47cb[_0x8e28('0x10')][_0x8e28('0x27')]>0x0){_0x25796c[_0x8e28('0x24')]=_0x4d47cb['result'][0x0][_0x8e28('0x11')];logger['info']('['+[_0x49604c[_0x8e28('0x13')]()]+_0x8e28('0x28'),_0x25796c);_0x2da562(_0x25796c);}else{return createEndUser(_0x49604c,_0x502b90,_0x25796c,_0x198868,_0x3027b6)['then'](function(_0x24c41a){logger['info']('['+[_0x49604c[_0x8e28('0x13')]()]+_0x8e28('0x29'),_0x24c41a);_0x2da562(_0x24c41a);});}})[_0x8e28('0x14')](function(_0x4521ef){logger['error']('['+[_0x49604c[_0x8e28('0x13')]()]+']',_0x4521ef[_0x8e28('0x16')]);_0x14b17c(_0x4521ef[_0x8e28('0x16')]);});});};}function getCustomFields(_0x46b2a6,_0x5dba77){var _0xc8abaf={};if(_0x46b2a6[_0x8e28('0x27')]>0x0){_[_0x8e28('0x2a')](_0x46b2a6,function(_0x2a60e3){if(_['includes']([_0x8e28('0x2b'),_0x8e28('0x2c')],_0x2a60e3['type'])&&_0x2a60e3[_0x8e28('0x2d')]&&!_0x2a60e3[_0x8e28('0x2e')]){_0xc8abaf[_0x2a60e3[_0x8e28('0x2d')][_0x8e28('0x2f')]()]=_0x2a60e3[_0x8e28('0x30')][_0x8e28('0x31')]();}else if(_[_0x8e28('0x32')](['string',_0x8e28('0x2c')],_0x2a60e3[_0x8e28('0x33')])&&_0x2a60e3[_0x8e28('0x34')]&&_0x2a60e3['customField']){_0xc8abaf[_0x2a60e3[_0x8e28('0x34')]['toLowerCase']()]=_0x2a60e3[_0x8e28('0x30')][_0x8e28('0x31')]();}else if(_0x2a60e3[_0x8e28('0x33')]===_0x8e28('0x35')&&_0x2a60e3[_0x8e28('0x36')]&&_0x2a60e3[_0x8e28('0x34')]&&_0x2a60e3[_0x8e28('0x2e')]){_0xc8abaf[_0x2a60e3[_0x8e28('0x34')][_0x8e28('0x2f')]()]=_0x5dba77[_0x2a60e3[_0x8e28('0x36')]][_0x8e28('0x31')]();}else if(_0x2a60e3[_0x8e28('0x33')]===_0x8e28('0x37')&&_0x2a60e3['Variable']&&_0x2a60e3[_0x8e28('0x38')][_0x8e28('0x39')]&&_0x2a60e3[_0x8e28('0x34')]&&_0x2a60e3[_0x8e28('0x2e')]){_0xc8abaf[_0x2a60e3[_0x8e28('0x34')][_0x8e28('0x2f')]()]=_0x5dba77[_0x2a60e3[_0x8e28('0x38')][_0x8e28('0x39')]['toLowerCase']()][_0x8e28('0x31')]();}});}return _0xc8abaf;}function getTicket(_0x428571,_0x5b59df,_0xeafa29,_0x3498d8,_0x474a0f,_0x3bcb78){return function(_0x5190c9){logger['info']('['+[_0x428571[_0x8e28('0x13')]()]+_0x8e28('0x3a'),_0x5190c9);return new Promise(function(_0x651fc5,_0x54dd86){var _0x811b95=_0x428571[_0x8e28('0x2f')]()===_0x8e28('0x3b')?_0x5190c9[_0x8e28('0x1b')]:_0x5190c9[_0x8e28('0x24')];var _0x44281e={'method':_0x8e28('0x20'),'uri':_0xeafa29+_0x8e28('0x3c')+'?'+_0x3bcb78,'body':Object['assign']({},{'active':'true','caller_id':_0x811b95,'assigned_to':_0x5190c9[_0x8e28('0x1b')],'short_description':intUtil[_0x8e28('0x3d')](_0x3498d8[_0x8e28('0x3e')],_0x474a0f,'\x20'),'description':intUtil[_0x8e28('0x3d')](_0x3498d8[_0x8e28('0x3f')],_0x474a0f,'\x0a')},getCustomFields(_0x3498d8['Fields'],_0x474a0f)),'auth':_0x5b59df,'json':!![]};return rp(_0x44281e)[_0x8e28('0xf')](function(_0x567d5c){logger[_0x8e28('0x12')]('['+[_0x428571[_0x8e28('0x13')]()]+_0x8e28('0x40'),_0x567d5c[_0x8e28('0x10')]);_0x5190c9[_0x8e28('0x41')]=_0x567d5c[_0x8e28('0x10')]['sys_id'];_0x5190c9[_0x8e28('0x42')]=_0x567d5c[_0x8e28('0x10')]['number'];logger[_0x8e28('0x12')]('['+[_0x428571['toUpperCase']()]+_0x8e28('0x43'),_0x5190c9);_0x651fc5(_0x5190c9);})[_0x8e28('0x14')](function(_0x4ac2ff){logger[_0x8e28('0x15')]('['+[_0x428571[_0x8e28('0x13')]()]+']',_0x4ac2ff['message']);_0x54dd86(_0x4ac2ff[_0x8e28('0x16')]);});});};}function createRemoteTag(_0x32d28a,_0x3e9812,_0x2e7dc0,_0x55e7e4){return new Promise(function(_0x41a016,_0x1f9042){var _0x3afadd={'method':'POST','uri':_0x2e7dc0+'label'+'?'+_0x55e7e4,'body':{'short_description':_0x32d28a,'global':!![],'active':!![],'name':_0x32d28a},'auth':_0x3e9812,'json':!![]};return rp(_0x3afadd)[_0x8e28('0xf')](function(_0x4ef856){var _0x331e19=_0x4ef856[_0x8e28('0x10')][_0x8e28('0x11')];_0x41a016(_0x331e19);});});}function getRemoteTag(_0x3efeb5,_0x2ce3ce,_0x3c6083,_0x50f5b4,_0x46702f){return new Promise(function(_0x246c8a,_0x1c9d40){var _0x52ffde={'method':_0x8e28('0xe'),'uri':_0x3c6083+_0x8e28('0x44')+'?sysparm_query=name%3D'+_0x3efeb5+'&'+_0x50f5b4,'auth':_0x2ce3ce,'json':!![]};return rp(_0x52ffde)[_0x8e28('0xf')](function(_0x417bf9){if(_0x417bf9[_0x8e28('0x10')][_0x8e28('0x27')]>0x0){var _0x4622fa=_0x417bf9[_0x8e28('0x10')][0x0][_0x8e28('0x11')];_0x246c8a(_0x4622fa);}else{return createRemoteTag(_0x3efeb5,_0x2ce3ce,_0x3c6083,_0x50f5b4)['then'](function(_0x36b8a3){_0x246c8a(_0x36b8a3);});}});});}function assignTagToIncident(_0x5d2ced,_0x3f3555,_0x1bb3da,_0x551dfe,_0xfaafd8){return new Promise(function(_0x5172c2,_0x25eba4){var _0x10a4a0={'method':'POST','uri':_0x1bb3da+'label_entry'+'?'+_0xfaafd8,'body':{'label':_0x5d2ced,'table':_0x8e28('0x3c'),'id_type':_0x8e28('0x45'),'table_key':_0x551dfe[_0x8e28('0x41')],'title':'Incident\x20-\x20'+_0x551dfe[_0x8e28('0x42')],'id_display':_0x551dfe['ticketNumber']},'auth':_0x3f3555,'json':!![]};return rp(_0x10a4a0)[_0x8e28('0xf')](function(_0x215cec){_0x5172c2();})['catch'](function(){_0x5172c2();});});}function manageTags(_0x332a9e,_0x4387d9,_0x35baaf,_0x4b1610,_0x13e1d0,_0x475d21,_0x26b817){return new Promise(function(_0x1983e6,_0x1d1672){var _0x3f2491=[];_0x4387d9[_0x8e28('0x2a')](function(_0x46b872){_0x3f2491[_0x8e28('0x46')](getRemoteTag(_0x46b872,_0x35baaf,_0x4b1610,_0x475d21,_0x26b817));});return Promise[_0x8e28('0x47')](_0x3f2491)[_0x8e28('0xf')](function(_0x26a25e){if(_0x26a25e[_0x8e28('0x27')]){logger[_0x8e28('0x12')]('['+[_0x332a9e[_0x8e28('0x13')]()]+_0x8e28('0x48'),_0x26a25e);var _0x50c10b=[];_0x26a25e[_0x8e28('0x2a')](function(_0x490581){_0x50c10b[_0x8e28('0x46')](assignTagToIncident(_0x490581,_0x35baaf,_0x4b1610,_0x13e1d0,_0x475d21));});return Promise[_0x8e28('0x47')](_0x50c10b)[_0x8e28('0xf')](function(){_0x1983e6();})[_0x8e28('0x14')](function(){_0x1983e6();});}else{_0x1983e6();}});});}function getTags(_0x2572b8,_0x4f70bf,_0x4210b3,_0x3727f4,_0x4a8671,_0x44acab){return function(_0x34c02c){return new Promise(function(_0xff0500,_0x582732){var _0x404541=[];var _0x103811=_0x3727f4[_0x8e28('0x49')];if(_0x103811&&_0x103811[_0x8e28('0x27')]>0x0){_0x404541=_['map'](_0x103811,'name');}if(_0x404541[_0x8e28('0x27')]>0x0){return manageTags(_0x2572b8,_0x404541,_0x4f70bf,_0x4210b3,_0x34c02c,_0x4a8671,_0x44acab)[_0x8e28('0xf')](function(){_0xff0500(_0x34c02c);});}else{_0xff0500(_0x34c02c);}});};}function emit(_0x551705,_0x27f283,_0x58a992){var _0x5a9b8e=_0x8e28('0x4a')+_0x8e28('0x4b')+_0x8e28('0x4c')+_0x8e28('0x4d');var _0x17a0e1={'uri':_0x551705+_0x8e28('0x4e')+_0x58a992+_0x5a9b8e};io['to'](util[_0x8e28('0x4f')](_0x8e28('0x50'),_0x27f283))['emit'](_0x8e28('0x51'),_0x17a0e1);}exports['cs']=function(_0x2dccf9,_0x361207,_0x1f1f91,_0x338932,_0x3736ca,_0x63e939,_0x4cae39,_0x174749){var _0x396cd4={};var _0x2d0982={'user':_0x63e939[_0x8e28('0x52')],'pass':_0x63e939['password']};var _0x7dce1=_0x8e28('0x53');var _0x212ebf=_0x8e28('0x54');_0x63e939[_0x8e28('0x55')]=intUtil['stripTrailingSlash'](_0x63e939[_0x8e28('0x55')]);_0x63e939[_0x8e28('0x56')]=intUtil[_0x8e28('0x57')](_0x63e939[_0x8e28('0x56')]);var _0x3179e3=util['format'](_0x8e28('0x58'),_0x63e939[_0x8e28('0x55')]);_0x396cd4[_0x8e28('0x17')]=!_[_0x8e28('0x59')](_0x338932)?_0x338932[_0x8e28('0x5a')]:null;_0x396cd4[_0x8e28('0x1c')]=_0x63e939[_0x8e28('0x5a')];_0x396cd4['endUserNumber']=_0x174749[_0x8e28('0x2f')]()===_0x8e28('0x3b')?_0x361207[_0x8e28('0x5b')]:_0x361207[_0x8e28('0x5c')];_0x396cd4[_0x8e28('0x5d')]=_0x174749===_0x8e28('0x5e')||_0x174749===_0x8e28('0x5f')?_0x8e28('0x5e'):_0x8e28('0x3b');var _0x54a3d8=util[_0x8e28('0x4f')](_0x8e28('0x60'),_0x63e939[_0x8e28('0x56')],_0x361207[_0x8e28('0x61')],md5(_0x361207[_0x8e28('0x61')]));if(_0x3736ca&&_0x3736ca['monitor_format']){logger[_0x8e28('0x12')](_0x8e28('0x62'),'Recording\x20is\x20enabled!');_0x361207['recordingURL']=_0x54a3d8;}else if(_0x4cae39&&_0x4cae39[_0x8e28('0x63')]&&_0x4cae39[_0x8e28('0x63')]!=='none'){logger['info'](_0x8e28('0x64'),_0x8e28('0x65'));_0x361207[_0x8e28('0x66')]=_0x54a3d8;}else{_0x361207[_0x8e28('0x66')]='';}return getAdminUser(_0x174749,_0x2d0982,_0x396cd4,_0x3179e3,_0x212ebf,_0x7dce1)[_0x8e28('0xf')](getUser(_0x174749,_0x2d0982,_0x3179e3,_0x212ebf,_0x7dce1))[_0x8e28('0xf')](getEndUser(_0x174749,_0x2d0982,_0x3179e3,_0x212ebf,_0x7dce1))[_0x8e28('0xf')](getTicket(_0x174749,_0x2d0982,_0x3179e3,_0x1f1f91,_0x361207,_0x212ebf))[_0x8e28('0xf')](function(_0x529f16){logger[_0x8e28('0x12')](util['format'](_0x8e28('0x67'),_0x529f16[_0x8e28('0x41')]));logger[_0x8e28('0x12')](util[_0x8e28('0x4f')](_0x8e28('0x68'),_0x174749));if(_0x174749!==_0x8e28('0x5f')){logger['info']('['+[_0x174749['toUpperCase']()]+']',_0x8e28('0x69'));emit(_0x63e939[_0x8e28('0x55')],_0x338932[_0x8e28('0x39')],_0x529f16[_0x8e28('0x41')]);}})[_0x8e28('0x14')](function(_0x2b3940){logger[_0x8e28('0x15')]('['+[_0x174749[_0x8e28('0x13')]()]+_0x8e28('0x6a'),util['inspect'](_0x2b3940,{'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 4614b3c..6e1d5dd 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 _0x46f0=['created_by','description','date_start','toISOString','slice','replace','duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','direction','length','forEach','variableName','idField','set_entry','JSON','stringify','Calls','format','Basic\x20%s','apiKey','base64','Getting\x20agent\x20with\x20name','get_entry_list','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','name_value_list','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','find','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','type','nameField','customField','toLowerCase','content','toString','string','custom_fields','variable','Variable','push','POST','login','username','password','PLAIN','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','remoteUri','stripTrailingSlash','serverUrl','%s/service/v4_1/rest.php','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','[QUEUE]','outbound','uri','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','contacts','lastevent','toUpperCase','isNil','calleridname','lodash','md5','util','ioredis','./util','sugarcrm','redis','defaults','localhost','socket.io-emitter','emit','info','Creating\x20new\x20ticket...','name','getString','Subjects'];(function(_0x2e1e3a,_0x14f1b7){var _0x31a9c6=function(_0x504087){while(--_0x504087){_0x2e1e3a['push'](_0x2e1e3a['shift']());}};_0x31a9c6(++_0x14f1b7);}(_0x46f0,0x1dc));var _0x046f=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x46f0[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x046f('0x0'));var rp=require('request-promise');var BPromise=require('bluebird');var md5=require(_0x046f('0x1'));var util=require(_0x046f('0x2'));var Redis=require(_0x046f('0x3'));var intUtil=require(_0x046f('0x4'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x046f('0x5'));config[_0x046f('0x6')]=_[_0x046f('0x7')](config[_0x046f('0x6')],{'host':_0x046f('0x8'),'port':0x18eb});var io=require(_0x046f('0x9'))(new Redis(config['redis']));var def={'method':'POST','json':!![]};function emit(_0x27709a,_0xa2d09a,_0x96f39b){io['to'](_0x27709a)[_0x046f('0xa')](_0xa2d09a,_0x96f39b);}function getTicket(_0xf57e6d,_0x5df83c,_0x214b60,_0x8f123c,_0x320a8d,_0x32cea5,_0x4f6d5f,_0x47747c){logger[_0x046f('0xb')](_0x046f('0xc'));var _0x3859e9=new Date();var _0xc57a1=[{'name':_0x046f('0xd'),'value':intUtil[_0x046f('0xe')](_0x8f123c[_0x046f('0xf')],_0x320a8d,'\x20')},{'name':'assigned_user_id','value':_0x5df83c['id']},{'name':_0x046f('0x10'),'value':_0x5df83c['id']},{'name':_0x046f('0x11'),'value':intUtil[_0x046f('0xe')](_0x8f123c['Descriptions'],_0x320a8d,'\x0a')},{'name':_0x046f('0x12'),'value':_0x3859e9[_0x046f('0x13')]()[_0x046f('0x14')](0x0,0x13)[_0x046f('0x15')]('T','\x20')},{'name':_0x046f('0x16'),'value':'0'},{'name':_0x046f('0x17'),'value':'15'},{'name':_0x046f('0x18'),'value':_0x214b60['id']},{'name':_0x046f('0x19'),'value':_0x046f('0x1a')},{'name':_0x046f('0x1b'),'value':_0x214b60[_0x046f('0xd')]},{'name':_0x046f('0x1c'),'value':_0x47747c}];if(_0x32cea5[_0x046f('0x1d')]){_[_0x046f('0x1e')](_0x32cea5,function(_0x57b30a){if(_0x320a8d[_0x57b30a[_0x046f('0x1f')]]){_0xc57a1['push']({'name':_0x57b30a[_0x046f('0x20')],'value':_0x320a8d[_0x57b30a[_0x046f('0x1f')]]});}});}return request({'form':{'method':_0x046f('0x21'),'input_type':_0x046f('0x22'),'response_type':_0x046f('0x22'),'rest_data':JSON[_0x046f('0x23')]({'session':_0x4f6d5f['id'],'module_name':_0x046f('0x24'),'name_value_list':_0xc57a1})}});}function getAuth(_0x2c7afa){return util[_0x046f('0x25')](_0x046f('0x26'),new Buffer(_0x2c7afa[_0x046f('0x27')]+':X')['toString'](_0x046f('0x28')));}function getServerInfo(_0x25f5ca){return request({'form':{'method':'get_server_info','input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x046f('0x23')]({'session':_0x25f5ca['id']})}});}function getUser(_0xffc92c,_0x16f6d1,_0xe8521d){if(!_['isNil'](_0x16f6d1)){logger[_0x046f('0xb')](_0x046f('0x29'),_0x16f6d1);return request({'form':{'method':_0x046f('0x2a'),'input_type':_0x046f('0x22'),'response_type':_0x046f('0x22'),'rest_data':JSON[_0x046f('0x23')]({'session':_0xe8521d['id'],'module_name':'Employees','query':util[_0x046f('0x25')](_0x046f('0x2b'),_0x16f6d1),'order_by':'','offset':'0','select_fields':['id',_0x046f('0xd'),_0x046f('0x2c')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x046f('0x2d')](function(_0x14a10e){if(_0x14a10e[_0x046f('0x2e')][_0x046f('0x1d')]){var _0x4ce0ba=_['find'](_0x14a10e[_0x046f('0x2e')],function(_0x2964a5){return _0x2964a5[_0x046f('0x2f')][_0x046f('0x2c')][_0x046f('0x30')]===_0x16f6d1;});if(_0x4ce0ba){logger[_0x046f('0xb')](_0x046f('0x31'));return BPromise[_0x046f('0x32')]({'id':_0x4ce0ba[_0x046f('0x2f')]['id']['value'],'name':_0x4ce0ba[_0x046f('0x2f')]['name'][_0x046f('0x30')]});}}logger[_0x046f('0xb')](_0x046f('0x33'));return BPromise['resolve']({'id':_0xe8521d[_0x046f('0x2f')][_0x046f('0x34')][_0x046f('0x30')],'name':_0xe8521d[_0x046f('0x2f')][_0x046f('0x2c')][_0x046f('0x30')]});});}else{logger[_0x046f('0xb')](_0x046f('0x35'));return BPromise[_0x046f('0x32')]({'id':_0xe8521d['name_value_list']['user_id'][_0x046f('0x30')],'name':_0xe8521d[_0x046f('0x2f')]['user_name']['value']});}}function getEndUser(_0x4ebbb8,_0x3251fb,_0x4bcf73,_0x4ca11c){logger[_0x046f('0xb')]('Searching\x20enduser\x20with\x20phone',_0x4bcf73);return request({'form':{'method':_0x046f('0x2a'),'input_type':_0x046f('0x22'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x4ca11c['id'],'module_name':_0x046f('0x1a'),'query':util[_0x046f('0x25')](_0x046f('0x36'),_0x4bcf73),'order_by':'','offset':'0','select_fields':['id',_0x046f('0xd'),_0x046f('0x37')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x046f('0x2d')](function(_0x43fbf4){if(_0x43fbf4[_0x046f('0x2e')][_0x046f('0x1d')]){var _0x4905e7=_[_0x046f('0x38')](_0x43fbf4['entry_list'],function(_0x4a2ed0){return _0x4a2ed0[_0x046f('0x2f')][_0x046f('0x37')][_0x046f('0x30')]===_0x4bcf73;});if(_0x4905e7){logger[_0x046f('0xb')](_0x046f('0x39'));return BPromise[_0x046f('0x32')]({'id':_0x4905e7[_0x046f('0x2f')]['id'][_0x046f('0x30')],'name':_0x4905e7['name_value_list']['name'][_0x046f('0x30')],'phone':_0x4905e7[_0x046f('0x2f')][_0x046f('0x37')][_0x046f('0x30')]});}}else{logger['info'](_0x046f('0x3a'));return request({'form':{'method':_0x046f('0x21'),'input_type':_0x046f('0x22'),'response_type':'JSON','rest_data':JSON[_0x046f('0x23')]({'session':_0x4ca11c['id'],'module_name':_0x046f('0x1a'),'name_value_list':[{'name':_0x046f('0x3b'),'value':_0x3251fb!==''?_0x3251fb:util[_0x046f('0x25')](_0x046f('0x3c'),_0x4bcf73)},{'name':_0x046f('0x37'),'value':_0x4bcf73}]})}})[_0x046f('0x2d')](function(_0x27c893){logger['info'](_0x046f('0x3d'));return BPromise[_0x046f('0x32')]({'id':_0x27c893['id'],'name':_0x27c893['entry_list'][_0x046f('0x3b')]['value'],'phone':_0x27c893[_0x046f('0x2e')][_0x046f('0x37')][_0x046f('0x30')]});});}});}function request(_0xdc331d){logger[_0x046f('0x3e')](_0x046f('0x3f'),JSON[_0x046f('0x23')](_0xdc331d));return rp(_[_0x046f('0x40')](def,_0xdc331d));}function getTags(_0x1b8f62,_0x542a33){var _0x2168a9=[];if(_0x1b8f62&&_0x1b8f62['length']>0x0){_0x2168a9=_['map'](_0x1b8f62,_0x542a33);}return _0x2168a9;}function getCustomFields(_0x49a1c8,_0x18b9a5){var _0x27a7e8=[];var _0x561062={'custom_fields':[]};if(_0x49a1c8[_0x046f('0x1d')]>0x0){_[_0x046f('0x1e')](_0x49a1c8,function(_0x528761){if(_0x528761[_0x046f('0x41')]==='string'&&_0x528761[_0x046f('0x42')]&&!_0x528761[_0x046f('0x43')]){_0x561062[_0x528761[_0x046f('0x42')][_0x046f('0x44')]()]=_0x528761[_0x046f('0x45')][_0x046f('0x46')]();}else if(_0x528761[_0x046f('0x41')]===_0x046f('0x47')&&_0x528761[_0x046f('0x20')]&&_0x528761[_0x046f('0x43')]){_0x561062[_0x046f('0x48')]['push']({'id':_0x528761[_0x046f('0x20')],'value':_0x528761[_0x046f('0x45')][_0x046f('0x46')]()});}else if(_0x528761[_0x046f('0x41')]===_0x046f('0x49')&&_0x528761['variableName']&&_0x528761[_0x046f('0x20')]&&_0x528761[_0x046f('0x43')]){_0x18b9a5[_0x528761[_0x046f('0x1f')]]&&_0x561062[_0x046f('0x48')]['push']({'id':_0x528761['idField'],'value':_0x18b9a5[_0x528761[_0x046f('0x1f')]][_0x046f('0x46')]()});}else if(_0x528761[_0x046f('0x41')]==='customVariable'&&_0x528761[_0x046f('0x4a')]&&_0x528761[_0x046f('0x4a')][_0x046f('0xd')]&&_0x528761[_0x046f('0x20')]&&_0x528761['customField']){_0x18b9a5[_0x528761[_0x046f('0x4a')][_0x046f('0xd')][_0x046f('0x44')]()]&&_0x561062['custom_fields'][_0x046f('0x4b')]({'id':_0x528761[_0x046f('0x20')],'value':_0x18b9a5[_0x528761[_0x046f('0x4a')]['name'][_0x046f('0x44')]()][_0x046f('0x46')]()});}});}return _0x561062;}function getConnection(_0x22fcc9){return request({'method':_0x046f('0x4c'),'form':{'method':_0x046f('0x4d'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x046f('0x23')]({'user_auth':{'user_name':_0x22fcc9[_0x046f('0x4e')],'password':_0x22fcc9[_0x046f('0x4f')],'encryption':_0x046f('0x50')},'application':'xCALLY\x20Motion\x20integration'})}})[_0x046f('0x2d')](function(_0x657e6f){var _0x38e8fb=_0x657e6f;if(_0x38e8fb['id']){def[_0x046f('0x51')]=_0x38e8fb['id'];return BPromise['resolve'](_0x38e8fb);}else{throw new Error(util[_0x046f('0x25')](_0x046f('0x52'),_0x22fcc9['id']));}});}function setRelationship(_0x48e737,_0x491be9,_0x595677,_0x302949){return request({'form':{'method':_0x046f('0x53'),'input_type':_0x046f('0x22'),'response_type':_0x046f('0x22'),'rest_data':JSON[_0x046f('0x23')]({'session':_0x48e737['id'],'module_name':'Calls','module_id':_0x595677['id'],'link_field_name':_0x302949,'related_ids':[_0x491be9['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x5d711c,_0x3db868,_0x19e0ac,_0x5db2d7,_0x532566,_0x3793eb){var _0x3d8157,_0x568d2b,_0x105ee6,_0x2afa72;_0x3793eb[_0x046f('0x54')]=intUtil[_0x046f('0x55')](_0x3793eb[_0x046f('0x54')]);_0x3793eb[_0x046f('0x56')]=intUtil[_0x046f('0x55')](_0x3793eb[_0x046f('0x56')]);def['uri']=util[_0x046f('0x25')](_0x046f('0x57'),_0x3793eb[_0x046f('0x54')]);if(_0x532566&&_0x532566[_0x046f('0x58')]){logger[_0x046f('0xb')]('[QUEUE]',_0x046f('0x59'));_0x3db868[_0x046f('0x5a')]=util[_0x046f('0x25')](_0x046f('0x5b'),_0x3793eb['serverUrl'],_0x3db868[_0x046f('0x5c')],md5(_0x3db868[_0x046f('0x5c')]));}else{_0x3db868[_0x046f('0x5a')]='';}return getConnection(_0x3793eb)[_0x046f('0x2d')](function(_0x2ac8b0){_0x2afa72=_0x2ac8b0;return getUser(_0x3793eb,_0x5db2d7['name'],_0x2afa72);})[_0x046f('0x2d')](function(_0x4c47a3){_0x3d8157=_0x4c47a3;logger[_0x046f('0xb')]('The\x20User\x20ID\x20is:',_0x3d8157['id']);return getEndUser(_0x3793eb,_0x3db868['calleridname'],_0x3db868[_0x046f('0x5d')],_0x2afa72);})[_0x046f('0x2d')](function(_0xc655b5){_0x568d2b=_0xc655b5;logger['info'](_0x046f('0x5e'),_0x568d2b['id']);return getTicket(_0x3793eb,_0x3d8157,_0x568d2b,_0x19e0ac,_0x3db868,_0x19e0ac[_0x046f('0x5f')],_0x2afa72,_0x046f('0x60'));})[_0x046f('0x2d')](function(_0x306833){_0x105ee6=_0x306833;logger[_0x046f('0xb')](_0x046f('0x61'));logger[_0x046f('0xb')](_0x046f('0x62'),_0x105ee6['id']);return setRelationship(_0x2afa72,_0x3d8157,_0x105ee6,_0x046f('0x63'));})[_0x046f('0x2d')](function(){return setRelationship(_0x2afa72,_0x568d2b,_0x105ee6,'contacts');})[_0x046f('0x2d')](function(){return getServerInfo(_0x2afa72);})[_0x046f('0x2d')](function(_0x2a86c8){var _0x2968a7=parseInt(_0x2a86c8[_0x046f('0x64')][_0x046f('0x65')](0x0));var _0x32e791=util['format'](_0x046f('0x66'),_0x3793eb[_0x046f('0x54')],_0x105ee6['id']);if(_0x2968a7>0x6){_0x32e791=util['format'](_0x046f('0x67'),_0x3793eb[_0x046f('0x54')],_0x105ee6['id']);}logger[_0x046f('0xb')]('[QUEUE]',_0x046f('0x68'));emit(util[_0x046f('0x25')](_0x046f('0x69'),_0x5db2d7[_0x046f('0xd')]),_0x046f('0x6a'),{'uri':_0x32e791});})[_0x046f('0x6b')](function(_0x5f2a6a){logger[_0x046f('0x6c')](_0x046f('0x6d'),JSON[_0x046f('0x23')](_0x5f2a6a));});};exports[_0x046f('0x6e')]=function(_0x43e6b0,_0x7b0b0c,_0x3cbb51,_0x28ff35,_0x1995ab,_0x56459c,_0x375676){var _0x2141e6,_0x1bfee5,_0x581fb1,_0x4cd8a5;_0x56459c[_0x046f('0x54')]=intUtil[_0x046f('0x55')](_0x56459c[_0x046f('0x54')]);_0x56459c[_0x046f('0x56')]=intUtil['stripTrailingSlash'](_0x56459c[_0x046f('0x56')]);def[_0x046f('0x6f')]=util[_0x046f('0x25')]('%s/service/v4_1/rest.php',_0x56459c[_0x046f('0x54')]);if(_0x375676&&_0x375676[_0x046f('0x70')]&&_0x375676[_0x046f('0x70')]!==_0x046f('0x71')){logger['info'](_0x046f('0x72'),'Recording\x20is\x20enabled!');_0x7b0b0c[_0x046f('0x5a')]=util[_0x046f('0x25')](_0x046f('0x5b'),_0x56459c[_0x046f('0x56')],_0x7b0b0c['uniqueid'],md5(_0x7b0b0c[_0x046f('0x5c')]));}return getConnection(_0x56459c)[_0x046f('0x2d')](function(_0x3a3005){_0x4cd8a5=_0x3a3005;return getUser(_0x56459c,_0x28ff35['name'],_0x4cd8a5);})[_0x046f('0x2d')](function(_0x1865ba){_0x2141e6=_0x1865ba;logger['info'](_0x046f('0x73'),_0x2141e6['id']);return getEndUser(_0x56459c,_0x7b0b0c[_0x046f('0x74')],_0x7b0b0c[_0x046f('0x75')],_0x4cd8a5);})['then'](function(_0x390008){_0x1bfee5=_0x390008;logger['info'](_0x046f('0x5e'),_0x1bfee5['id']);return getTicket(_0x56459c,_0x2141e6,_0x1bfee5,_0x3cbb51,_0x7b0b0c,_0x3cbb51[_0x046f('0x5f')],_0x4cd8a5,'Outbound');})['then'](function(_0x134c51){_0x581fb1=_0x134c51;logger[_0x046f('0xb')](_0x046f('0x61'));logger['info'](_0x046f('0x62'),_0x581fb1['id']);return setRelationship(_0x4cd8a5,_0x2141e6,_0x581fb1,_0x046f('0x63'));})['then'](function(){return setRelationship(_0x4cd8a5,_0x1bfee5,_0x581fb1,_0x046f('0x76'));})['then'](function(){return getServerInfo(_0x4cd8a5);})[_0x046f('0x2d')](function(_0x2b1ccf){var _0xf01bce=parseInt(_0x2b1ccf['version']['charAt'](0x0));var _0x1bdce7=util['format']('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x56459c[_0x046f('0x54')],_0x581fb1['id']);if(_0xf01bce>0x6){_0x1bdce7=util[_0x046f('0x25')](_0x046f('0x67'),_0x56459c[_0x046f('0x54')],_0x581fb1['id']);}logger[_0x046f('0xb')](_0x046f('0x72'),_0x046f('0x68'));emit(util[_0x046f('0x25')](_0x046f('0x69'),_0x28ff35[_0x046f('0xd')]),'trigger:browser:url',{'uri':_0x1bdce7});})['catch'](function(_0xe82e89){logger['error'](_0x046f('0x72'),JSON[_0x046f('0x23')](_0xe82e89));});};exports['unmanaged']=function(_0x14eabe,_0x1b16b7,_0x525535,_0x237112,_0x2ca461,_0x2eed9e){var _0x11ae23,_0x1f864a,_0x13ca1f,_0x8757b5;_0x2eed9e['remoteUri']=intUtil[_0x046f('0x55')](_0x2eed9e[_0x046f('0x54')]);_0x2eed9e['serverUrl']=intUtil[_0x046f('0x55')](_0x2eed9e['serverUrl']);def[_0x046f('0x6f')]=util[_0x046f('0x25')](_0x046f('0x57'),_0x2eed9e['remoteUri']);if(_0x2ca461&&_0x2ca461[_0x046f('0x58')]){logger[_0x046f('0xb')]('['+_0x1b16b7[_0x046f('0x77')][_0x046f('0x78')]()+']',_0x046f('0x59'));_0x1b16b7[_0x046f('0x5a')]=util[_0x046f('0x25')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2eed9e[_0x046f('0x56')],_0x1b16b7[_0x046f('0x5c')],md5(_0x1b16b7['uniqueid']));}else{_0x1b16b7[_0x046f('0x5a')]='';}return getConnection(_0x2eed9e)[_0x046f('0x2d')](function(_0x4840ac){_0x8757b5=_0x4840ac;if(!_[_0x046f('0x79')](_0x237112)){return getUser(_0x2eed9e,_0x237112[_0x046f('0xd')],_0x8757b5);}else{return getUser(_0x2eed9e,null,_0x8757b5);}})[_0x046f('0x2d')](function(_0x52c5c5){_0x11ae23=_0x52c5c5;logger[_0x046f('0xb')](_0x046f('0x73'),_0x11ae23['id']);return getEndUser(_0x2eed9e,_0x1b16b7[_0x046f('0x7a')],_0x1b16b7[_0x046f('0x5d')],_0x8757b5);})[_0x046f('0x2d')](function(_0x5c26e8){_0x1f864a=_0x5c26e8;logger[_0x046f('0xb')](_0x046f('0x5e'),_0x1f864a['id']);return getTicket(_0x2eed9e,_0x11ae23,_0x1f864a,_0x525535,_0x1b16b7,_0x525535[_0x046f('0x5f')],_0x8757b5,_0x046f('0x60'));})['then'](function(_0x11dec2){_0x13ca1f=_0x11dec2;logger[_0x046f('0xb')](_0x046f('0x61'));logger[_0x046f('0xb')](_0x046f('0x62'),_0x13ca1f['id']);return setRelationship(_0x8757b5,_0x11ae23,_0x13ca1f,'users');})[_0x046f('0x2d')](function(){return setRelationship(_0x8757b5,_0x1f864a,_0x13ca1f,'contacts');})[_0x046f('0x2d')](function(){return getServerInfo(_0x8757b5);})[_0x046f('0x6b')](function(_0x5812ce){logger['error']('['+_0x1b16b7[_0x046f('0x77')]['toUpperCase']()+']',JSON[_0x046f('0x23')](_0x5812ce));});}; \ No newline at end of file +var _0x7b2f=['get_entry_list','phone_home','entry_list','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','map','length','type','string','nameField','toLowerCase','content','customField','custom_fields','toString','variable','customVariable','Variable','login','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Calls','remoteUri','stripTrailingSlash','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','calleridname','Fields','Inbound','The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','outbound','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Outbound','error','unmanaged','lastevent','toUpperCase','calleridnum','The\x20Enduser\x20ID\x20is:','lodash','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','socket.io-emitter','POST','emit','info','name','getString','Subjects','assigned_user_id','created_by','Descriptions','toISOString','slice','replace','duration_hours','duration_minutes','parent_id','Contacts','parent_name','direction','forEach','variableName','push','idField','set_entry','JSON','stringify','format','Basic\x20%s','base64','get_server_info','isNil','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','then','find','user_name','value','Agent\x20found!','resolve','name_value_list','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone'];(function(_0xc55d64,_0x133f2d){var _0x4194f6=function(_0x4a38c9){while(--_0x4a38c9){_0xc55d64['push'](_0xc55d64['shift']());}};_0x4194f6(++_0x133f2d);}(_0x7b2f,0xbf));var _0xf7b2=function(_0x5b8d6c,_0x2bfefe){_0x5b8d6c=_0x5b8d6c-0x0;var _0x3ab6d1=_0x7b2f[_0x5b8d6c];return _0x3ab6d1;};'use strict';var _=require(_0xf7b2('0x0'));var rp=require(_0xf7b2('0x1'));var BPromise=require(_0xf7b2('0x2'));var md5=require(_0xf7b2('0x3'));var util=require(_0xf7b2('0x4'));var Redis=require(_0xf7b2('0x5'));var intUtil=require(_0xf7b2('0x6'));var config=require(_0xf7b2('0x7'));var logger=require(_0xf7b2('0x8'))(_0xf7b2('0x9'));config[_0xf7b2('0xa')]=_[_0xf7b2('0xb')](config[_0xf7b2('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0xf7b2('0xc'))(new Redis(config[_0xf7b2('0xa')]));var def={'method':_0xf7b2('0xd'),'json':!![]};function emit(_0x2078cf,_0x2a76a8,_0x5cb541){io['to'](_0x2078cf)[_0xf7b2('0xe')](_0x2a76a8,_0x5cb541);}function getTicket(_0x5c5a39,_0x4059be,_0x2dadcc,_0x3804da,_0x493d54,_0x490ff4,_0x3847af,_0x2d3e96){logger[_0xf7b2('0xf')]('Creating\x20new\x20ticket...');var _0x2400f7=new Date();var _0x5edcc6=[{'name':_0xf7b2('0x10'),'value':intUtil[_0xf7b2('0x11')](_0x3804da[_0xf7b2('0x12')],_0x493d54,'\x20')},{'name':_0xf7b2('0x13'),'value':_0x4059be['id']},{'name':_0xf7b2('0x14'),'value':_0x4059be['id']},{'name':'description','value':intUtil[_0xf7b2('0x11')](_0x3804da[_0xf7b2('0x15')],_0x493d54,'\x0a')},{'name':'date_start','value':_0x2400f7[_0xf7b2('0x16')]()[_0xf7b2('0x17')](0x0,0x13)[_0xf7b2('0x18')]('T','\x20')},{'name':_0xf7b2('0x19'),'value':'0'},{'name':_0xf7b2('0x1a'),'value':'15'},{'name':_0xf7b2('0x1b'),'value':_0x2dadcc['id']},{'name':'parent_type','value':_0xf7b2('0x1c')},{'name':_0xf7b2('0x1d'),'value':_0x2dadcc[_0xf7b2('0x10')]},{'name':_0xf7b2('0x1e'),'value':_0x2d3e96}];if(_0x490ff4['length']){_[_0xf7b2('0x1f')](_0x490ff4,function(_0x542e8f){if(_0x493d54[_0x542e8f[_0xf7b2('0x20')]]){_0x5edcc6[_0xf7b2('0x21')]({'name':_0x542e8f[_0xf7b2('0x22')],'value':_0x493d54[_0x542e8f[_0xf7b2('0x20')]]});}});}return request({'form':{'method':_0xf7b2('0x23'),'input_type':_0xf7b2('0x24'),'response_type':_0xf7b2('0x24'),'rest_data':JSON[_0xf7b2('0x25')]({'session':_0x3847af['id'],'module_name':'Calls','name_value_list':_0x5edcc6})}});}function getAuth(_0x3fecb1){return util[_0xf7b2('0x26')](_0xf7b2('0x27'),new Buffer(_0x3fecb1['apiKey']+':X')['toString'](_0xf7b2('0x28')));}function getServerInfo(_0x1e5088){return request({'form':{'method':_0xf7b2('0x29'),'input_type':_0xf7b2('0x24'),'response_type':_0xf7b2('0x24'),'rest_data':JSON[_0xf7b2('0x25')]({'session':_0x1e5088['id']})}});}function getUser(_0x5f43dc,_0x524c6c,_0x1f1c42){if(!_[_0xf7b2('0x2a')](_0x524c6c)){logger['info']('Getting\x20agent\x20with\x20name',_0x524c6c);return request({'form':{'method':'get_entry_list','input_type':_0xf7b2('0x24'),'response_type':_0xf7b2('0x24'),'rest_data':JSON[_0xf7b2('0x25')]({'session':_0x1f1c42['id'],'module_name':_0xf7b2('0x2b'),'query':util[_0xf7b2('0x26')](_0xf7b2('0x2c'),_0x524c6c),'order_by':'','offset':'0','select_fields':['id',_0xf7b2('0x10'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xf7b2('0x2d')](function(_0x5a71ba){if(_0x5a71ba['entry_list']['length']){var _0x206630=_[_0xf7b2('0x2e')](_0x5a71ba['entry_list'],function(_0x3f458d){return _0x3f458d['name_value_list'][_0xf7b2('0x2f')][_0xf7b2('0x30')]===_0x524c6c;});if(_0x206630){logger[_0xf7b2('0xf')](_0xf7b2('0x31'));return BPromise[_0xf7b2('0x32')]({'id':_0x206630['name_value_list']['id'][_0xf7b2('0x30')],'name':_0x206630[_0xf7b2('0x33')][_0xf7b2('0x10')][_0xf7b2('0x30')]});}}logger[_0xf7b2('0xf')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise['resolve']({'id':_0x1f1c42[_0xf7b2('0x33')][_0xf7b2('0x34')]['value'],'name':_0x1f1c42[_0xf7b2('0x33')][_0xf7b2('0x2f')][_0xf7b2('0x30')]});});}else{logger['info'](_0xf7b2('0x35'));return BPromise[_0xf7b2('0x32')]({'id':_0x1f1c42[_0xf7b2('0x33')]['user_id'][_0xf7b2('0x30')],'name':_0x1f1c42[_0xf7b2('0x33')][_0xf7b2('0x2f')][_0xf7b2('0x30')]});}}function getEndUser(_0x5afc74,_0xcb357,_0x595e44,_0x9963fc){logger['info'](_0xf7b2('0x36'),_0x595e44);return request({'form':{'method':_0xf7b2('0x37'),'input_type':_0xf7b2('0x24'),'response_type':_0xf7b2('0x24'),'rest_data':JSON['stringify']({'session':_0x9963fc['id'],'module_name':'Contacts','query':util['format']('contacts.phone_home\x20=\x20\x22%s\x22',_0x595e44),'order_by':'','offset':'0','select_fields':['id','name',_0xf7b2('0x38')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xf7b2('0x2d')](function(_0xc6b345){if(_0xc6b345[_0xf7b2('0x39')]['length']){var _0xcf2a99=_[_0xf7b2('0x2e')](_0xc6b345[_0xf7b2('0x39')],function(_0x26d7b4){return _0x26d7b4['name_value_list']['phone_home'][_0xf7b2('0x30')]===_0x595e44;});if(_0xcf2a99){logger[_0xf7b2('0xf')]('Enduser\x20found!');return BPromise[_0xf7b2('0x32')]({'id':_0xcf2a99[_0xf7b2('0x33')]['id']['value'],'name':_0xcf2a99[_0xf7b2('0x33')][_0xf7b2('0x10')][_0xf7b2('0x30')],'phone':_0xcf2a99[_0xf7b2('0x33')][_0xf7b2('0x38')][_0xf7b2('0x30')]});}}else{logger[_0xf7b2('0xf')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':'set_entry','input_type':'JSON','response_type':_0xf7b2('0x24'),'rest_data':JSON[_0xf7b2('0x25')]({'session':_0x9963fc['id'],'module_name':'Contacts','name_value_list':[{'name':_0xf7b2('0x3a'),'value':_0xcb357!==_0xf7b2('0x3b')?_0xcb357:util[_0xf7b2('0x26')](_0xf7b2('0x3c'),_0x595e44)},{'name':'phone_home','value':_0x595e44}]})}})[_0xf7b2('0x2d')](function(_0x30c305){logger[_0xf7b2('0xf')](_0xf7b2('0x3d'));return BPromise[_0xf7b2('0x32')]({'id':_0x30c305['id'],'name':_0x30c305[_0xf7b2('0x39')]['first_name'][_0xf7b2('0x30')],'phone':_0x30c305[_0xf7b2('0x39')][_0xf7b2('0x38')][_0xf7b2('0x30')]});});}});}function request(_0x29f1c6){logger[_0xf7b2('0x3e')](_0xf7b2('0x3f'),JSON[_0xf7b2('0x25')](_0x29f1c6));return rp(_[_0xf7b2('0x40')](def,_0x29f1c6));}function getTags(_0x6133d0,_0x1ceb2d){var _0x11ac38=[];if(_0x6133d0&&_0x6133d0['length']>0x0){_0x11ac38=_[_0xf7b2('0x41')](_0x6133d0,_0x1ceb2d);}return _0x11ac38;}function getCustomFields(_0x17d05e,_0x5ae37e){var _0x3d2115=[];var _0x13a907={'custom_fields':[]};if(_0x17d05e[_0xf7b2('0x42')]>0x0){_[_0xf7b2('0x1f')](_0x17d05e,function(_0x1b72a1){if(_0x1b72a1[_0xf7b2('0x43')]===_0xf7b2('0x44')&&_0x1b72a1['nameField']&&!_0x1b72a1['customField']){_0x13a907[_0x1b72a1[_0xf7b2('0x45')][_0xf7b2('0x46')]()]=_0x1b72a1[_0xf7b2('0x47')]['toString']();}else if(_0x1b72a1[_0xf7b2('0x43')]===_0xf7b2('0x44')&&_0x1b72a1[_0xf7b2('0x22')]&&_0x1b72a1[_0xf7b2('0x48')]){_0x13a907[_0xf7b2('0x49')][_0xf7b2('0x21')]({'id':_0x1b72a1[_0xf7b2('0x22')],'value':_0x1b72a1[_0xf7b2('0x47')][_0xf7b2('0x4a')]()});}else if(_0x1b72a1['type']===_0xf7b2('0x4b')&&_0x1b72a1[_0xf7b2('0x20')]&&_0x1b72a1[_0xf7b2('0x22')]&&_0x1b72a1['customField']){_0x5ae37e[_0x1b72a1['variableName']]&&_0x13a907[_0xf7b2('0x49')][_0xf7b2('0x21')]({'id':_0x1b72a1[_0xf7b2('0x22')],'value':_0x5ae37e[_0x1b72a1[_0xf7b2('0x20')]][_0xf7b2('0x4a')]()});}else if(_0x1b72a1[_0xf7b2('0x43')]===_0xf7b2('0x4c')&&_0x1b72a1[_0xf7b2('0x4d')]&&_0x1b72a1[_0xf7b2('0x4d')][_0xf7b2('0x10')]&&_0x1b72a1[_0xf7b2('0x22')]&&_0x1b72a1['customField']){_0x5ae37e[_0x1b72a1[_0xf7b2('0x4d')]['name'][_0xf7b2('0x46')]()]&&_0x13a907[_0xf7b2('0x49')][_0xf7b2('0x21')]({'id':_0x1b72a1['idField'],'value':_0x5ae37e[_0x1b72a1[_0xf7b2('0x4d')]['name'][_0xf7b2('0x46')]()][_0xf7b2('0x4a')]()});}});}return _0x13a907;}function getConnection(_0x449aa9){return request({'method':_0xf7b2('0xd'),'form':{'method':_0xf7b2('0x4e'),'input_type':_0xf7b2('0x24'),'response_type':_0xf7b2('0x24'),'rest_data':JSON[_0xf7b2('0x25')]({'user_auth':{'user_name':_0x449aa9['username'],'password':_0x449aa9[_0xf7b2('0x4f')],'encryption':_0xf7b2('0x50')},'application':_0xf7b2('0x51')})}})[_0xf7b2('0x2d')](function(_0x34fd26){var _0x488eab=_0x34fd26;if(_0x488eab['id']){def[_0xf7b2('0x52')]=_0x488eab['id'];return BPromise[_0xf7b2('0x32')](_0x488eab);}else{throw new Error(util[_0xf7b2('0x26')]('Account\x20%d\x20is\x20not\x20valid',_0x449aa9['id']));}});}function setRelationship(_0x5f453c,_0x47996c,_0x2fb1e5,_0x939a33){return request({'form':{'method':'set_relationship','input_type':'JSON','response_type':_0xf7b2('0x24'),'rest_data':JSON['stringify']({'session':_0x5f453c['id'],'module_name':_0xf7b2('0x53'),'module_id':_0x2fb1e5['id'],'link_field_name':_0x939a33,'related_ids':[_0x47996c['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x5c8358,_0x38d6fc,_0x3103dd,_0x26a4c6,_0x722776,_0x46db21){var _0x4b1072,_0x20f0e0,_0x25c1bc,_0x2dd2b1;_0x46db21[_0xf7b2('0x54')]=intUtil['stripTrailingSlash'](_0x46db21['remoteUri']);_0x46db21['serverUrl']=intUtil[_0xf7b2('0x55')](_0x46db21[_0xf7b2('0x56')]);def[_0xf7b2('0x57')]=util[_0xf7b2('0x26')](_0xf7b2('0x58'),_0x46db21[_0xf7b2('0x54')]);if(_0x722776&&_0x722776[_0xf7b2('0x59')]){logger[_0xf7b2('0xf')](_0xf7b2('0x5a'),_0xf7b2('0x5b'));_0x38d6fc[_0xf7b2('0x5c')]=util[_0xf7b2('0x26')](_0xf7b2('0x5d'),_0x46db21[_0xf7b2('0x56')],_0x38d6fc[_0xf7b2('0x5e')],md5(_0x38d6fc[_0xf7b2('0x5e')]));}else{_0x38d6fc['recordingURL']='';}return getConnection(_0x46db21)[_0xf7b2('0x2d')](function(_0x4a2c22){_0x2dd2b1=_0x4a2c22;return getUser(_0x46db21,_0x26a4c6['name'],_0x2dd2b1);})[_0xf7b2('0x2d')](function(_0x3a9b53){_0x4b1072=_0x3a9b53;logger['info']('The\x20User\x20ID\x20is:',_0x4b1072['id']);return getEndUser(_0x46db21,_0x38d6fc[_0xf7b2('0x5f')],_0x38d6fc['calleridnum'],_0x2dd2b1);})['then'](function(_0x49f1ee){_0x20f0e0=_0x49f1ee;logger[_0xf7b2('0xf')]('The\x20Enduser\x20ID\x20is:',_0x20f0e0['id']);return getTicket(_0x46db21,_0x4b1072,_0x20f0e0,_0x3103dd,_0x38d6fc,_0x3103dd[_0xf7b2('0x60')],_0x2dd2b1,_0xf7b2('0x61'));})['then'](function(_0x432860){_0x25c1bc=_0x432860;logger['info']('Ticket\x20created!');logger[_0xf7b2('0xf')](_0xf7b2('0x62'),_0x25c1bc['id']);return setRelationship(_0x2dd2b1,_0x4b1072,_0x25c1bc,_0xf7b2('0x63'));})[_0xf7b2('0x2d')](function(){return setRelationship(_0x2dd2b1,_0x20f0e0,_0x25c1bc,_0xf7b2('0x64'));})['then'](function(){return getServerInfo(_0x2dd2b1);})[_0xf7b2('0x2d')](function(_0x1c48a6){var _0x1cea79=parseInt(_0x1c48a6[_0xf7b2('0x65')][_0xf7b2('0x66')](0x0));var _0x7dff6=util[_0xf7b2('0x26')](_0xf7b2('0x67'),_0x46db21[_0xf7b2('0x54')],_0x25c1bc['id']);if(_0x1cea79>0x6){_0x7dff6=util[_0xf7b2('0x26')](_0xf7b2('0x68'),_0x46db21[_0xf7b2('0x54')],_0x25c1bc['id']);}logger['info']('[QUEUE]',_0xf7b2('0x69'));emit(util[_0xf7b2('0x26')](_0xf7b2('0x6a'),_0x26a4c6['name']),_0xf7b2('0x6b'),{'uri':_0x7dff6});})[_0xf7b2('0x6c')](function(_0x223568){logger['error'](_0xf7b2('0x5a'),JSON[_0xf7b2('0x25')](_0x223568));});};exports[_0xf7b2('0x6d')]=function(_0x403b41,_0x57a858,_0x540e69,_0x1997a7,_0x88137f,_0x108f37,_0x554b89){var _0x2acf5d,_0x41e272,_0x2c509b,_0x475617;_0x108f37[_0xf7b2('0x54')]=intUtil[_0xf7b2('0x55')](_0x108f37['remoteUri']);_0x108f37[_0xf7b2('0x56')]=intUtil[_0xf7b2('0x55')](_0x108f37[_0xf7b2('0x56')]);def[_0xf7b2('0x57')]=util[_0xf7b2('0x26')]('%s/service/v4_1/rest.php',_0x108f37['remoteUri']);if(_0x554b89&&_0x554b89['recordingFormat']&&_0x554b89[_0xf7b2('0x6e')]!==_0xf7b2('0x6f')){logger[_0xf7b2('0xf')](_0xf7b2('0x70'),'Recording\x20is\x20enabled!');_0x57a858['recordingURL']=util['format'](_0xf7b2('0x5d'),_0x108f37[_0xf7b2('0x56')],_0x57a858[_0xf7b2('0x5e')],md5(_0x57a858['uniqueid']));}return getConnection(_0x108f37)[_0xf7b2('0x2d')](function(_0x1f8099){_0x475617=_0x1f8099;return getUser(_0x108f37,_0x1997a7[_0xf7b2('0x10')],_0x475617);})[_0xf7b2('0x2d')](function(_0x342a3c){_0x2acf5d=_0x342a3c;logger[_0xf7b2('0xf')](_0xf7b2('0x71'),_0x2acf5d['id']);return getEndUser(_0x108f37,_0x57a858[_0xf7b2('0x72')],_0x57a858[_0xf7b2('0x73')],_0x475617);})[_0xf7b2('0x2d')](function(_0x356b70){_0x41e272=_0x356b70;logger[_0xf7b2('0xf')]('The\x20Enduser\x20ID\x20is:',_0x41e272['id']);return getTicket(_0x108f37,_0x2acf5d,_0x41e272,_0x540e69,_0x57a858,_0x540e69[_0xf7b2('0x60')],_0x475617,_0xf7b2('0x74'));})[_0xf7b2('0x2d')](function(_0x1f069){_0x2c509b=_0x1f069;logger[_0xf7b2('0xf')]('Ticket\x20created!');logger[_0xf7b2('0xf')](_0xf7b2('0x62'),_0x2c509b['id']);return setRelationship(_0x475617,_0x2acf5d,_0x2c509b,'users');})[_0xf7b2('0x2d')](function(){return setRelationship(_0x475617,_0x41e272,_0x2c509b,_0xf7b2('0x64'));})[_0xf7b2('0x2d')](function(){return getServerInfo(_0x475617);})[_0xf7b2('0x2d')](function(_0x294376){var _0x5d1390=parseInt(_0x294376[_0xf7b2('0x65')][_0xf7b2('0x66')](0x0));var _0x21af5f=util['format'](_0xf7b2('0x67'),_0x108f37['remoteUri'],_0x2c509b['id']);if(_0x5d1390>0x6){_0x21af5f=util['format'](_0xf7b2('0x68'),_0x108f37[_0xf7b2('0x54')],_0x2c509b['id']);}logger[_0xf7b2('0xf')](_0xf7b2('0x70'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xf7b2('0x26')](_0xf7b2('0x6a'),_0x1997a7[_0xf7b2('0x10')]),_0xf7b2('0x6b'),{'uri':_0x21af5f});})[_0xf7b2('0x6c')](function(_0x39283f){logger[_0xf7b2('0x75')](_0xf7b2('0x70'),JSON['stringify'](_0x39283f));});};exports[_0xf7b2('0x76')]=function(_0x5961ab,_0x4847f0,_0x361305,_0x485629,_0x4a1277,_0x3c04c1){var _0x5e7ae0,_0x429f16,_0x575b0f,_0x4de41;_0x3c04c1[_0xf7b2('0x54')]=intUtil[_0xf7b2('0x55')](_0x3c04c1['remoteUri']);_0x3c04c1[_0xf7b2('0x56')]=intUtil[_0xf7b2('0x55')](_0x3c04c1[_0xf7b2('0x56')]);def[_0xf7b2('0x57')]=util['format']('%s/service/v4_1/rest.php',_0x3c04c1[_0xf7b2('0x54')]);if(_0x4a1277&&_0x4a1277[_0xf7b2('0x59')]){logger[_0xf7b2('0xf')]('['+_0x4847f0[_0xf7b2('0x77')][_0xf7b2('0x78')]()+']',_0xf7b2('0x5b'));_0x4847f0[_0xf7b2('0x5c')]=util[_0xf7b2('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3c04c1['serverUrl'],_0x4847f0[_0xf7b2('0x5e')],md5(_0x4847f0[_0xf7b2('0x5e')]));}else{_0x4847f0[_0xf7b2('0x5c')]='';}return getConnection(_0x3c04c1)[_0xf7b2('0x2d')](function(_0x11bde5){_0x4de41=_0x11bde5;if(!_[_0xf7b2('0x2a')](_0x485629)){return getUser(_0x3c04c1,_0x485629[_0xf7b2('0x10')],_0x4de41);}else{return getUser(_0x3c04c1,null,_0x4de41);}})[_0xf7b2('0x2d')](function(_0x271708){_0x5e7ae0=_0x271708;logger[_0xf7b2('0xf')](_0xf7b2('0x71'),_0x5e7ae0['id']);return getEndUser(_0x3c04c1,_0x4847f0[_0xf7b2('0x5f')],_0x4847f0[_0xf7b2('0x79')],_0x4de41);})[_0xf7b2('0x2d')](function(_0x11eb48){_0x429f16=_0x11eb48;logger[_0xf7b2('0xf')](_0xf7b2('0x7a'),_0x429f16['id']);return getTicket(_0x3c04c1,_0x5e7ae0,_0x429f16,_0x361305,_0x4847f0,_0x361305[_0xf7b2('0x60')],_0x4de41,_0xf7b2('0x61'));})['then'](function(_0x3cb475){_0x575b0f=_0x3cb475;logger['info']('Ticket\x20created!');logger['info'](_0xf7b2('0x62'),_0x575b0f['id']);return setRelationship(_0x4de41,_0x5e7ae0,_0x575b0f,_0xf7b2('0x63'));})[_0xf7b2('0x2d')](function(){return setRelationship(_0x4de41,_0x429f16,_0x575b0f,_0xf7b2('0x64'));})[_0xf7b2('0x2d')](function(){return getServerInfo(_0x4de41);})[_0xf7b2('0x6c')](function(_0x2bcd07){logger[_0xf7b2('0x75')]('['+_0x4847f0[_0xf7b2('0x77')]['toUpperCase']()+']',JSON[_0xf7b2('0x25')](_0x2bcd07));});}; \ 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 8b909c8..31aefd8 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 _0x6416=['variableName','push','customVariable','Variable','name','toLowerCase','toString','keyValue','keyType','key','format','%s:\x20%s','join','stripTrailingSlash','slice','substring','lastIndexOf','validateEmail','isNil','lodash','getString','length','string','type','variable'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6416,0x10d));var _0x6641=function(_0x49cb92,_0x3c31a6){_0x49cb92=_0x49cb92-0x0;var _0x16ee5a=_0x6416[_0x49cb92];return _0x16ee5a;};'use strict';var _=require(_0x6641('0x0'));var util=require('util');exports[_0x6641('0x1')]=function(_0x3a0ea2,_0x4b95a8,_0x1d67ef){var _0x41a8e8=[];if(_0x3a0ea2[_0x6641('0x2')]>0x0){var _0x6126b1=_['sortBy'](_0x3a0ea2,['id']);for(var _0x23f7a3=0x0;_0x23f7a3<_0x6126b1[_0x6641('0x2')];_0x23f7a3++){var _0x9e7546=_0x6126b1[_0x23f7a3];if(_0x9e7546['type']===_0x6641('0x3')){_0x41a8e8['push'](_0x9e7546['content']);}else if(_0x9e7546[_0x6641('0x4')]===_0x6641('0x5')&&_0x9e7546['variableName']){_0x4b95a8[_0x9e7546[_0x6641('0x6')]]&&_0x41a8e8[_0x6641('0x7')](_0x4b95a8[_0x9e7546[_0x6641('0x6')]]['toString']());}else if(_0x9e7546[_0x6641('0x4')]===_0x6641('0x8')&&_0x9e7546[_0x6641('0x9')]&&_0x9e7546[_0x6641('0x9')][_0x6641('0xa')]){_0x4b95a8[_0x9e7546[_0x6641('0x9')][_0x6641('0xa')][_0x6641('0xb')]()]&&_0x41a8e8[_0x6641('0x7')](_0x4b95a8[_0x9e7546[_0x6641('0x9')]['name']['toLowerCase']()][_0x6641('0xc')]());}else if(_0x9e7546[_0x6641('0x4')]===_0x6641('0xd')){if(_0x9e7546[_0x6641('0xe')]===_0x6641('0x3')&&_0x9e7546[_0x6641('0xf')]){_0x41a8e8[_0x6641('0x7')](util[_0x6641('0x10')](_0x6641('0x11'),_0x9e7546[_0x6641('0xf')],_0x9e7546['keyContent']));}else if(_0x9e7546[_0x6641('0xe')]==='variable'&&_0x9e7546[_0x6641('0x6')]&&_0x9e7546[_0x6641('0xf')]){_0x4b95a8[_0x9e7546[_0x6641('0x6')]]&&_0x41a8e8[_0x6641('0x7')](util['format'](_0x6641('0x11'),_0x9e7546[_0x6641('0xf')],_0x4b95a8[_0x9e7546[_0x6641('0x6')]]));}else if(_0x9e7546[_0x6641('0xe')]===_0x6641('0x8')&&_0x9e7546[_0x6641('0x9')]&&_0x9e7546[_0x6641('0x9')][_0x6641('0xa')]&&_0x9e7546[_0x6641('0xf')]){_0x4b95a8[_0x9e7546[_0x6641('0x9')][_0x6641('0xa')][_0x6641('0xb')]()]&&_0x41a8e8[_0x6641('0x7')](util[_0x6641('0x10')](_0x6641('0x11'),_0x9e7546['key'],_0x4b95a8[_0x9e7546[_0x6641('0x9')][_0x6641('0xa')][_0x6641('0xb')]()]));}}}}return _0x41a8e8[_0x6641('0x12')](_0x1d67ef);};exports[_0x6641('0x13')]=function(_0x25ec6a){var _0x127699=_0x25ec6a[_0x6641('0x14')](-0x1);if(_0x127699==='/'){_0x25ec6a=_0x25ec6a[_0x6641('0x15')](0x0,_0x25ec6a[_0x6641('0x16')](_0x127699));}return _0x25ec6a;};exports[_0x6641('0x17')]=function(_0x20604e){if(!_[_0x6641('0x18')](_0x20604e)&&_0x20604e!==''){var _0x3cfb99=/^(([^<>()\[\]\\.,;:\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 _0x3cfb99['test'](String(_0x20604e)[_0x6641('0xb')]());}else{return![];}}; \ No newline at end of file +var _0xea16=['key','format','keyContent','%s:\x20%s','stripTrailingSlash','slice','substring','validateEmail','isNil','test','getString','length','sortBy','string','content','type','variable','variableName','push','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType'];(function(_0x51e622,_0x9df5ee){var _0x1d2e4d=function(_0x3f8dd3){while(--_0x3f8dd3){_0x51e622['push'](_0x51e622['shift']());}};_0x1d2e4d(++_0x9df5ee);}(_0xea16,0x72));var _0x6ea1=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xea16[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require('lodash');var util=require('util');exports[_0x6ea1('0x0')]=function(_0x36337b,_0x425d69,_0x594f23){var _0x2aa8e3=[];if(_0x36337b[_0x6ea1('0x1')]>0x0){var _0x45ddaa=_[_0x6ea1('0x2')](_0x36337b,['id']);for(var _0x2e07e1=0x0;_0x2e07e1<_0x45ddaa['length'];_0x2e07e1++){var _0x3dc0d8=_0x45ddaa[_0x2e07e1];if(_0x3dc0d8['type']===_0x6ea1('0x3')){_0x2aa8e3['push'](_0x3dc0d8[_0x6ea1('0x4')]);}else if(_0x3dc0d8[_0x6ea1('0x5')]===_0x6ea1('0x6')&&_0x3dc0d8[_0x6ea1('0x7')]){_0x425d69[_0x3dc0d8[_0x6ea1('0x7')]]&&_0x2aa8e3[_0x6ea1('0x8')](_0x425d69[_0x3dc0d8[_0x6ea1('0x7')]][_0x6ea1('0x9')]());}else if(_0x3dc0d8[_0x6ea1('0x5')]===_0x6ea1('0xa')&&_0x3dc0d8[_0x6ea1('0xb')]&&_0x3dc0d8[_0x6ea1('0xb')][_0x6ea1('0xc')]){_0x425d69[_0x3dc0d8[_0x6ea1('0xb')][_0x6ea1('0xc')][_0x6ea1('0xd')]()]&&_0x2aa8e3[_0x6ea1('0x8')](_0x425d69[_0x3dc0d8[_0x6ea1('0xb')][_0x6ea1('0xc')]['toLowerCase']()][_0x6ea1('0x9')]());}else if(_0x3dc0d8[_0x6ea1('0x5')]===_0x6ea1('0xe')){if(_0x3dc0d8[_0x6ea1('0xf')]===_0x6ea1('0x3')&&_0x3dc0d8[_0x6ea1('0x10')]){_0x2aa8e3[_0x6ea1('0x8')](util[_0x6ea1('0x11')]('%s:\x20%s',_0x3dc0d8['key'],_0x3dc0d8[_0x6ea1('0x12')]));}else if(_0x3dc0d8[_0x6ea1('0xf')]===_0x6ea1('0x6')&&_0x3dc0d8[_0x6ea1('0x7')]&&_0x3dc0d8[_0x6ea1('0x10')]){_0x425d69[_0x3dc0d8[_0x6ea1('0x7')]]&&_0x2aa8e3[_0x6ea1('0x8')](util[_0x6ea1('0x11')]('%s:\x20%s',_0x3dc0d8[_0x6ea1('0x10')],_0x425d69[_0x3dc0d8['variableName']]));}else if(_0x3dc0d8[_0x6ea1('0xf')]===_0x6ea1('0xa')&&_0x3dc0d8['Variable']&&_0x3dc0d8[_0x6ea1('0xb')][_0x6ea1('0xc')]&&_0x3dc0d8['key']){_0x425d69[_0x3dc0d8['Variable'][_0x6ea1('0xc')][_0x6ea1('0xd')]()]&&_0x2aa8e3[_0x6ea1('0x8')](util[_0x6ea1('0x11')](_0x6ea1('0x13'),_0x3dc0d8['key'],_0x425d69[_0x3dc0d8[_0x6ea1('0xb')][_0x6ea1('0xc')][_0x6ea1('0xd')]()]));}}}}return _0x2aa8e3['join'](_0x594f23);};exports[_0x6ea1('0x14')]=function(_0x335b16){var _0x3ae29c=_0x335b16[_0x6ea1('0x15')](-0x1);if(_0x3ae29c==='/'){_0x335b16=_0x335b16[_0x6ea1('0x16')](0x0,_0x335b16['lastIndexOf'](_0x3ae29c));}return _0x335b16;};exports[_0x6ea1('0x17')]=function(_0x6d1c7e){if(!_[_0x6ea1('0x18')](_0x6d1c7e)&&_0x6d1c7e!==''){var _0x48ba77=/^(([^<>()\[\]\\.,;:\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 _0x48ba77[_0x6ea1('0x19')](String(_0x6d1c7e)[_0x6ea1('0xd')]());}else{return![];}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/vtiger.js b/server/services/ami/trigger/integration/vtiger.js index 395f94c..cb12bf3 100644 --- a/server/services/ami/trigger/integration/vtiger.js +++ b/server/services/ami/trigger/integration/vtiger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['stringify','validateEmail','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','length','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','getUser','admin','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','login','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridnum','lastevent','bluebird','md5','util','ioredis','./util','../../../../config/environment','redis','localhost','socket.io-emitter','emit','forEach','string','picklist','idField','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','getString','Subjects','POST','remoteUri','create','username','sessionName','then','resolve','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s'];(function(_0x444cfd,_0x1b12f4){var _0x16e6a7=function(_0x417a27){while(--_0x417a27){_0x444cfd['push'](_0x444cfd['shift']());}};_0x16e6a7(++_0x1b12f4);}(_0x9c44,0x178));var _0x49c4=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x9c44[_0x5f09c5];return _0x426ad9;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var util=require(_0x49c4('0x2'));var Redis=require(_0x49c4('0x3'));var intUtil=require(_0x49c4('0x4'));var config=require(_0x49c4('0x5'));var logger=require('../../../../config/logger')('vTiger');config[_0x49c4('0x6')]=_['defaults'](config[_0x49c4('0x6')],{'host':_0x49c4('0x7'),'port':0x18eb});var io=require(_0x49c4('0x8'))(new Redis(config[_0x49c4('0x6')]));function emit(_0x436234,_0x511d53,_0x11c586){io['to'](_0x436234)[_0x49c4('0x9')](_0x511d53,_0x11c586);}function getCustomFields(_0x1d13fb,_0x4487ca){var _0x4c7d3a={};if(_0x1d13fb['length']>0x0){_[_0x49c4('0xa')](_0x1d13fb,function(_0x313e73){if(_['includes']([_0x49c4('0xb'),_0x49c4('0xc')],_0x313e73['type'])&&_0x313e73['idField']){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x313e73[_0x49c4('0xe')]['toString']();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x10')&&_0x313e73['variableName']&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x11')]]){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x4487ca[_0x313e73[_0x49c4('0x11')]][_0x49c4('0x12')]();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x13')&&_0x313e73[_0x49c4('0x14')]&&_0x313e73['Variable'][_0x49c4('0x15')]&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')][_0x49c4('0x16')]()]){_0x4c7d3a[_0x313e73['idField']]=_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')]['toLowerCase']()]['toString']();}});}return _0x4c7d3a;}function createTicket(_0x3c782d,_0x2f82d5,_0x3addb2,_0x59f29b,_0x24856d,_0x50b151,_0x2cbd50){logger[_0x49c4('0x17')](_0x49c4('0x18'));var _0x291526=_[_0x49c4('0x19')]({'parent_id':'','assigned_user_id':_0x2f82d5['id'],'ticketpriorities':_0x49c4('0x1a'),'ticketstatus':_0x49c4('0x1b'),'ticket_title':intUtil[_0x49c4('0x1c')](_0x59f29b[_0x49c4('0x1d')],_0x24856d,'\x20'),'description':intUtil['getString'](_0x59f29b['Descriptions'],_0x24856d,'\x0a'),'contact_id':_0x3addb2['id']},getCustomFields(_0x50b151,_0x24856d));var _0x57f502={'method':_0x49c4('0x1e'),'uri':util['format']('%s/webservice.php',_0x3c782d[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x20'),'username':_0x3c782d[_0x49c4('0x21')],'sessionName':_0x2cbd50[_0x49c4('0x22')],'elementType':'HelpDesk','element':JSON['stringify'](_0x291526)},'json':!![]};return request(_0x57f502)[_0x49c4('0x23')](function(_0x9cb797){if(_0x9cb797['success']){return BPromise[_0x49c4('0x24')]({'id':_0x9cb797[_0x49c4('0x25')]['id']});}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x27'),JSON['stringify'](_0x9cb797['error'])));}})[_0x49c4('0x28')](function(_0x53c199){var _0x3800b7=_0x53c199[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'createTicket',_0x3800b7,JSON[_0x49c4('0x2c')](_0x53c199));});}function getUser(_0x2b2793,_0x46e04d,_0x4f28a2){if(intUtil[_0x49c4('0x2d')](_0x46e04d)){logger[_0x49c4('0x17')](_0x49c4('0x2e'),_0x46e04d);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2b2793[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x2b2793['username'],'sessionName':_0x4f28a2['sessionName'],'query':util[_0x49c4('0x26')](_0x49c4('0x31'),_0x46e04d)},'json':!![]})[_0x49c4('0x23')](function(_0x27e467){if(_0x27e467[_0x49c4('0x32')]&&_0x27e467['result'][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x34'));return BPromise[_0x49c4('0x24')]({'id':_0x27e467['result'][0x0]['id'],'email':_0x27e467['result'][0x0][_0x49c4('0x35')],'name':_0x27e467[_0x49c4('0x25')][0x0][_0x49c4('0x36')]+'\x20'+_0x27e467[_0x49c4('0x25')][_0x49c4('0x37')]});}else{logger['info'](_0x49c4('0x38'));return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2[_0x49c4('0x39')],'email':_0x2b2793['username'],'name':'admin'});}})[_0x49c4('0x28')](function(_0x1991e9){var _0x3bec0a=_0x1991e9[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x3a'),_0x3bec0a,JSON[_0x49c4('0x2c')](_0x1991e9));});}else{logger[_0x49c4('0x17')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2['userId'],'email':_0x2b2793[_0x49c4('0x21')],'name':_0x49c4('0x3b')})[_0x49c4('0x28')](function(_0x1c2830){var _0x4ed4f8=_0x1c2830[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'getUser',_0x4ed4f8,JSON[_0x49c4('0x2c')](_0x1c2830));});}}function getEndUser(_0x21d8c7,_0x178987,_0x5e5366,_0x1ba7a0){logger[_0x49c4('0x17')](_0x49c4('0x3c'),_0x5e5366);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x21d8c7[_0x49c4('0x21')],'sessionName':_0x1ba7a0[_0x49c4('0x22')],'query':util[_0x49c4('0x26')](_0x49c4('0x3d'),_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366)},'json':!![]})[_0x49c4('0x23')](function(_0x29dd5d){if(_0x29dd5d[_0x49c4('0x32')]&&_0x29dd5d[_0x49c4('0x25')][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x3e'));return BPromise[_0x49c4('0x24')]({'id':_0x29dd5d[_0x49c4('0x25')][0x0]['id'],'name':_0x29dd5d['result'][0x0][_0x49c4('0x3f')]+'\x20'+_0x29dd5d['result'][0x0][_0x49c4('0x40')],'phone':_0x5e5366});}else{logger[_0x49c4('0x17')](_0x49c4('0x41'));return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7['remoteUri']),'form':{'operation':'create','sessionName':_0x1ba7a0[_0x49c4('0x22')],'elementType':_0x49c4('0x42'),'element':JSON[_0x49c4('0x2c')]({'lastname':_0x178987,'phone':_0x5e5366,'assigned_user_id':'\x20'})},'json':!![]})[_0x49c4('0x23')](function(_0x490823){logger[_0x49c4('0x17')](_0x49c4('0x43'));return BPromise[_0x49c4('0x24')]({'id':_0x490823[_0x49c4('0x25')]['id'],'name':_0x490823[_0x49c4('0x25')][_0x49c4('0x40')],'phone':_0x490823[_0x49c4('0x25')][_0x49c4('0x44')]});})[_0x49c4('0x28')](function(_0x5640d3){var _0x2ad771=_0x5640d3['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x45'),_0x2ad771,JSON[_0x49c4('0x2c')](_0x5640d3));});}});}function getConnection(_0x2d93d8){var _0x5b296d=_0x2d93d8[_0x49c4('0x21')];var _0x15b674=_0x2d93d8[_0x49c4('0x46')];return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'qs':{'operation':'getchallenge','username':_0x5b296d},'json':!![]})[_0x49c4('0x23')](function(_0x5cfff9){if(_0x5cfff9[_0x49c4('0x32')]){return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x47'),'username':_0x5b296d,'accessKey':md5(_0x5cfff9[_0x49c4('0x25')]['token']+_0x15b674)},'json':!![]});}})[_0x49c4('0x23')](function(_0x3feaf0){if(_0x3feaf0['success']){return BPromise[_0x49c4('0x24')](_0x3feaf0[_0x49c4('0x25')]);}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x48'),_0x2d93d8['id']));}})['catch'](function(_0x5d8bf0){var _0x144fd2=_0x5d8bf0['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x49'),_0x144fd2,JSON[_0x49c4('0x2c')](_0x5d8bf0));});}function request(_0x240c20){logger[_0x49c4('0x17')](_0x49c4('0x4a'),JSON['stringify'](_0x240c20));return rp(_0x240c20);}exports[_0x49c4('0x4b')]=function(_0x1550ce,_0x3936d3,_0x3d944c,_0x17ef75,_0x2644c0,_0x156748){var _0x25d174,_0x1e0b4f,_0x1856be,_0x5b822f;_0x156748['remoteUri']=intUtil[_0x49c4('0x4c')](_0x156748[_0x49c4('0x1f')]);if(_0x2644c0&&_0x2644c0['monitor_format']){logger['info'](_0x49c4('0x4d'),'Recording\x20is\x20enabled!');_0x3936d3['recordingURL']=util[_0x49c4('0x26')](_0x49c4('0x4e'),_0x156748[_0x49c4('0x4f')],_0x3936d3[_0x49c4('0x50')],md5(_0x3936d3[_0x49c4('0x50')]));}else{_0x3936d3[_0x49c4('0x51')]='';}return getConnection(_0x156748)[_0x49c4('0x23')](function(_0x50798e){_0x5b822f=_0x50798e;return getUser(_0x156748,_0x17ef75[_0x49c4('0x52')],_0x5b822f);})[_0x49c4('0x23')](function(_0x207572){_0x25d174=_0x207572;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x25d174['id']);return getEndUser(_0x156748,_0x3936d3[_0x49c4('0x54')],_0x3936d3['calleridnum'],_0x5b822f);})['then'](function(_0x1ef0c1){_0x1e0b4f=_0x1ef0c1;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0x1e0b4f['id']);return createTicket(_0x156748,_0x25d174,_0x1e0b4f,_0x3d944c,_0x3936d3,_0x3d944c[_0x49c4('0x56')],_0x5b822f);})[_0x49c4('0x23')](function(_0x6b2592){_0x1856be=_0x6b2592;logger[_0x49c4('0x17')]('Ticket\x20created!');logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x1856be['id']);var _0x4ba4eb=util[_0x49c4('0x26')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x156748[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x1856be['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x4d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x17ef75[_0x49c4('0x15')]),'trigger:browser:url',{'uri':_0x4ba4eb});})[_0x49c4('0x28')](function(_0x27b9c2){logger['error'](_0x49c4('0x4d'),JSON[_0x49c4('0x2c')](_0x27b9c2));});};exports['outbound']=function(_0x39c455,_0x42e0e6,_0x4f50bf,_0x4dc54d,_0x589484,_0x513879,_0xc43386){var _0x54947d,_0xb20a5d,_0x32f344,_0x515240;_0x513879[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x513879['remoteUri']);_0x513879[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x513879[_0x49c4('0x4f')]);if(_0xc43386&&_0xc43386[_0x49c4('0x5b')]&&_0xc43386['recordingFormat']!==_0x49c4('0x5c')){logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x5e'));_0x42e0e6['recordingURL']=util[_0x49c4('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x513879['serverUrl'],_0x42e0e6['uniqueid'],md5(_0x42e0e6['uniqueid']));}return getConnection(_0x513879)[_0x49c4('0x23')](function(_0x32eaef){_0x515240=_0x32eaef;return getUser(_0x513879,_0x4dc54d[_0x49c4('0x52')],_0x515240);})[_0x49c4('0x23')](function(_0x5b056e){_0x54947d=_0x5b056e;logger['info'](_0x49c4('0x53'),_0x54947d['id']);return getEndUser(_0x513879,_0x42e0e6[_0x49c4('0x5f')],_0x42e0e6[_0x49c4('0x60')],_0x515240);})[_0x49c4('0x23')](function(_0x102c15){_0xb20a5d=_0x102c15;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0xb20a5d['id']);return createTicket(_0x513879,_0x54947d,_0xb20a5d,_0x4f50bf,_0x42e0e6,_0x4f50bf[_0x49c4('0x56')],_0x515240);})['then'](function(_0x2276db){_0x32f344=_0x2276db;logger['info'](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x32f344['id']);var _0x1ea1b4=util[_0x49c4('0x26')](_0x49c4('0x62'),_0x513879[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x32f344['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x4dc54d[_0x49c4('0x15')]),_0x49c4('0x63'),{'uri':_0x1ea1b4});})[_0x49c4('0x28')](function(_0x371e49){logger[_0x49c4('0x2a')]('[OUTBOUND]',JSON['stringify'](_0x371e49));});};exports[_0x49c4('0x64')]=function(_0x16b3e8,_0x4af680,_0x1a15f3,_0x38ad50,_0x2939fd,_0x16e7b1){var _0x4d6aaa,_0x5a14a5,_0x4a85d4,_0x2e90d8;_0x16e7b1[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x1f')]);_0x16e7b1[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x4f')]);if(_0x2939fd&&_0x2939fd[_0x49c4('0x65')]){logger[_0x49c4('0x17')]('['+_0x4af680['lastevent'][_0x49c4('0x66')]()+']',_0x49c4('0x5e'));_0x4af680[_0x49c4('0x51')]=util['format'](_0x49c4('0x4e'),_0x16e7b1[_0x49c4('0x4f')],_0x4af680[_0x49c4('0x50')],md5(_0x4af680[_0x49c4('0x50')]));}else{_0x4af680[_0x49c4('0x51')]='';}return getConnection(_0x16e7b1)[_0x49c4('0x23')](function(_0x35fa39){_0x2e90d8=_0x35fa39;return getUser(_0x16e7b1,'',_0x2e90d8);})[_0x49c4('0x23')](function(_0x4ba198){_0x4d6aaa=_0x4ba198;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x4d6aaa['id']);return getEndUser(_0x16e7b1,_0x4af680[_0x49c4('0x54')],_0x4af680[_0x49c4('0x67')],_0x2e90d8);})[_0x49c4('0x23')](function(_0x4a204d){_0x5a14a5=_0x4a204d;logger['info'](_0x49c4('0x55'),_0x5a14a5['id']);return createTicket(_0x16e7b1,_0x4d6aaa,_0x5a14a5,_0x1a15f3,_0x4af680,_0x1a15f3['Fields'],_0x2e90d8);})[_0x49c4('0x23')](function(_0x558880){_0x4a85d4=_0x558880;logger[_0x49c4('0x17')](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x4a85d4['id']);})['catch'](function(_0x123060){logger[_0x49c4('0x2a')]('['+_0x4af680[_0x49c4('0x68')][_0x49c4('0x66')]()+']',JSON[_0x49c4('0x2c')](_0x123060));});}; \ No newline at end of file +var _0xd8b0=['info','Creating\x20new\x20ticket...','merge','Normal','Subjects','POST','format','%s/webservice.php','remoteUri','create','username','sessionName','HelpDesk','stringify','success','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','error','statusCode','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','Getting\x20agent\x20with\x20email','then','Agent\x20found!','resolve','email1','first_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','admin','catch','userId','getUser','Searching\x20end\x20user\x20with\x20phone','GET','query','Enduser\x20found!','firstname','Enduser\x20created.','lastname','phone','accessKey','getchallenge','login','token','getConnection','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','recordingURL','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','uniqueid','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','lastevent','toUpperCase','lodash','request-promise','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','localhost','socket.io-emitter','emit','length','forEach','includes','picklist','idField','content','toString','type','variable','variableName','customVariable','Variable','name','toLowerCase'];(function(_0x5180c3,_0x4b35f7){var _0x55c975=function(_0x4746cb){while(--_0x4746cb){_0x5180c3['push'](_0x5180c3['shift']());}};_0x55c975(++_0x4b35f7);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var rp=require(_0x0d8b('0x1'));var BPromise=require('bluebird');var md5=require('md5');var util=require('util');var Redis=require(_0x0d8b('0x2'));var intUtil=require(_0x0d8b('0x3'));var config=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));config['redis']=_['defaults'](config[_0x0d8b('0x7')],{'host':_0x0d8b('0x8'),'port':0x18eb});var io=require(_0x0d8b('0x9'))(new Redis(config['redis']));function emit(_0x413284,_0x284169,_0x58e4e2){io['to'](_0x413284)[_0x0d8b('0xa')](_0x284169,_0x58e4e2);}function getCustomFields(_0x348e65,_0x3b027f){var _0x1f4800={};if(_0x348e65[_0x0d8b('0xb')]>0x0){_[_0x0d8b('0xc')](_0x348e65,function(_0x2c5e9e){if(_[_0x0d8b('0xd')](['string',_0x0d8b('0xe')],_0x2c5e9e['type'])&&_0x2c5e9e[_0x0d8b('0xf')]){_0x1f4800[_0x2c5e9e[_0x0d8b('0xf')]]=_0x2c5e9e[_0x0d8b('0x10')][_0x0d8b('0x11')]();}else if(_0x2c5e9e[_0x0d8b('0x12')]===_0x0d8b('0x13')&&_0x2c5e9e[_0x0d8b('0x14')]&&_0x2c5e9e[_0x0d8b('0xf')]&&_0x3b027f[_0x2c5e9e[_0x0d8b('0x14')]]){_0x1f4800[_0x2c5e9e[_0x0d8b('0xf')]]=_0x3b027f[_0x2c5e9e[_0x0d8b('0x14')]][_0x0d8b('0x11')]();}else if(_0x2c5e9e[_0x0d8b('0x12')]===_0x0d8b('0x15')&&_0x2c5e9e['Variable']&&_0x2c5e9e[_0x0d8b('0x16')][_0x0d8b('0x17')]&&_0x2c5e9e[_0x0d8b('0xf')]&&_0x3b027f[_0x2c5e9e[_0x0d8b('0x16')][_0x0d8b('0x17')]['toLowerCase']()]){_0x1f4800[_0x2c5e9e[_0x0d8b('0xf')]]=_0x3b027f[_0x2c5e9e[_0x0d8b('0x16')][_0x0d8b('0x17')][_0x0d8b('0x18')]()][_0x0d8b('0x11')]();}});}return _0x1f4800;}function createTicket(_0x18dd2d,_0x264b39,_0xa3612a,_0x4a15bf,_0x27512e,_0x23d58f,_0x196c0a){logger[_0x0d8b('0x19')](_0x0d8b('0x1a'));var _0x5b709c=_[_0x0d8b('0x1b')]({'parent_id':'','assigned_user_id':_0x264b39['id'],'ticketpriorities':_0x0d8b('0x1c'),'ticketstatus':'Open','ticket_title':intUtil['getString'](_0x4a15bf[_0x0d8b('0x1d')],_0x27512e,'\x20'),'description':intUtil['getString'](_0x4a15bf['Descriptions'],_0x27512e,'\x0a'),'contact_id':_0xa3612a['id']},getCustomFields(_0x23d58f,_0x27512e));var _0x5527d8={'method':_0x0d8b('0x1e'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x18dd2d[_0x0d8b('0x21')]),'form':{'operation':_0x0d8b('0x22'),'username':_0x18dd2d[_0x0d8b('0x23')],'sessionName':_0x196c0a[_0x0d8b('0x24')],'elementType':_0x0d8b('0x25'),'element':JSON[_0x0d8b('0x26')](_0x5b709c)},'json':!![]};return request(_0x5527d8)['then'](function(_0xe8bbee){if(_0xe8bbee[_0x0d8b('0x27')]){return BPromise['resolve']({'id':_0xe8bbee[_0x0d8b('0x28')]['id']});}else{throw new Error(util['format'](_0x0d8b('0x29'),JSON[_0x0d8b('0x26')](_0xe8bbee[_0x0d8b('0x2a')])));}})['catch'](function(_0x59a905){var _0x28f639=_0x59a905[_0x0d8b('0x2b')]||0x1f4;logger['error'](_0x0d8b('0x2c'),'createTicket',_0x28f639,JSON[_0x0d8b('0x26')](_0x59a905));});}function getUser(_0x4b59e5,_0x97050a,_0x48f24f){if(intUtil[_0x0d8b('0x2d')](_0x97050a)){logger['info'](_0x0d8b('0x2e'),_0x97050a);return request({'method':'GET','uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x4b59e5[_0x0d8b('0x21')]),'qs':{'operation':'query','username':_0x4b59e5['username'],'sessionName':_0x48f24f['sessionName'],'query':util[_0x0d8b('0x1f')]('SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;',_0x97050a)},'json':!![]})[_0x0d8b('0x2f')](function(_0x54f6f3){if(_0x54f6f3['success']&&_0x54f6f3[_0x0d8b('0x28')][_0x0d8b('0xb')]){logger[_0x0d8b('0x19')](_0x0d8b('0x30'));return BPromise[_0x0d8b('0x31')]({'id':_0x54f6f3[_0x0d8b('0x28')][0x0]['id'],'email':_0x54f6f3[_0x0d8b('0x28')][0x0][_0x0d8b('0x32')],'name':_0x54f6f3['result'][0x0][_0x0d8b('0x33')]+'\x20'+_0x54f6f3[_0x0d8b('0x28')]['last_name']});}else{logger[_0x0d8b('0x19')](_0x0d8b('0x34'));return BPromise[_0x0d8b('0x31')]({'id':_0x48f24f['userId'],'email':_0x4b59e5[_0x0d8b('0x23')],'name':_0x0d8b('0x35')});}})[_0x0d8b('0x36')](function(_0x31ceba){var _0x933e01=_0x31ceba['statusCode']||0x1f4;logger[_0x0d8b('0x2a')](_0x0d8b('0x2c'),'getUser',_0x933e01,JSON[_0x0d8b('0x26')](_0x31ceba));});}else{logger[_0x0d8b('0x19')](_0x0d8b('0x34'));return BPromise[_0x0d8b('0x31')]({'id':_0x48f24f[_0x0d8b('0x37')],'email':_0x4b59e5['username'],'name':'admin'})[_0x0d8b('0x36')](function(_0x5c2c04){var _0x531c55=_0x5c2c04[_0x0d8b('0x2b')]||0x1f4;logger[_0x0d8b('0x2a')](_0x0d8b('0x2c'),_0x0d8b('0x38'),_0x531c55,JSON[_0x0d8b('0x26')](_0x5c2c04));});}}function getEndUser(_0x24c789,_0x579324,_0x6e5bab,_0x6a02ad){logger[_0x0d8b('0x19')](_0x0d8b('0x39'),_0x6e5bab);return request({'method':_0x0d8b('0x3a'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x24c789['remoteUri']),'qs':{'operation':_0x0d8b('0x3b'),'username':_0x24c789[_0x0d8b('0x23')],'sessionName':_0x6a02ad[_0x0d8b('0x24')],'query':util[_0x0d8b('0x1f')]('SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;',_0x6e5bab,_0x6e5bab,_0x6e5bab,_0x6e5bab,_0x6e5bab)},'json':!![]})[_0x0d8b('0x2f')](function(_0x4b4bde){if(_0x4b4bde[_0x0d8b('0x27')]&&_0x4b4bde[_0x0d8b('0x28')][_0x0d8b('0xb')]){logger[_0x0d8b('0x19')](_0x0d8b('0x3c'));return BPromise[_0x0d8b('0x31')]({'id':_0x4b4bde[_0x0d8b('0x28')][0x0]['id'],'name':_0x4b4bde[_0x0d8b('0x28')][0x0][_0x0d8b('0x3d')]+'\x20'+_0x4b4bde[_0x0d8b('0x28')][0x0]['lastname'],'phone':_0x6e5bab});}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'method':'POST','uri':util['format'](_0x0d8b('0x20'),_0x24c789[_0x0d8b('0x21')]),'form':{'operation':_0x0d8b('0x22'),'sessionName':_0x6a02ad['sessionName'],'elementType':'Contacts','element':JSON[_0x0d8b('0x26')]({'lastname':_0x579324,'phone':_0x6e5bab,'assigned_user_id':'\x20'})},'json':!![]})[_0x0d8b('0x2f')](function(_0x344278){logger['info'](_0x0d8b('0x3e'));return BPromise[_0x0d8b('0x31')]({'id':_0x344278['result']['id'],'name':_0x344278['result'][_0x0d8b('0x3f')],'phone':_0x344278['result'][_0x0d8b('0x40')]});})['catch'](function(_0x53f643){var _0x30ccee=_0x53f643[_0x0d8b('0x2b')]||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s','getEndUser',_0x30ccee,JSON['stringify'](_0x53f643));});}});}function getConnection(_0x374d40){var _0x1e0498=_0x374d40[_0x0d8b('0x23')];var _0x490eda=_0x374d40[_0x0d8b('0x41')];return request({'method':_0x0d8b('0x3a'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x374d40[_0x0d8b('0x21')]),'qs':{'operation':_0x0d8b('0x42'),'username':_0x1e0498},'json':!![]})[_0x0d8b('0x2f')](function(_0x1d5067){if(_0x1d5067[_0x0d8b('0x27')]){return request({'method':_0x0d8b('0x1e'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x374d40[_0x0d8b('0x21')]),'form':{'operation':_0x0d8b('0x43'),'username':_0x1e0498,'accessKey':md5(_0x1d5067[_0x0d8b('0x28')][_0x0d8b('0x44')]+_0x490eda)},'json':!![]});}})[_0x0d8b('0x2f')](function(_0x1e162c){if(_0x1e162c[_0x0d8b('0x27')]){return BPromise['resolve'](_0x1e162c[_0x0d8b('0x28')]);}else{throw new Error(util['format']('Account\x20%d\x20is\x20not\x20valid',_0x374d40['id']));}})[_0x0d8b('0x36')](function(_0x113fb7){var _0x3f943a=_0x113fb7[_0x0d8b('0x2b')]||0x1f4;logger['error'](_0x0d8b('0x2c'),_0x0d8b('0x45'),_0x3f943a,JSON[_0x0d8b('0x26')](_0x113fb7));});}function request(_0x241587){logger[_0x0d8b('0x19')]('[HTTP]',JSON['stringify'](_0x241587));return rp(_0x241587);}exports['queue']=function(_0x573f4f,_0x368ede,_0xf22c3c,_0x5e3bb4,_0x4950a8,_0x44c5c1){var _0x3d3cb6,_0x5c5bd7,_0x5ef6c3,_0x900906;_0x44c5c1[_0x0d8b('0x21')]=intUtil[_0x0d8b('0x46')](_0x44c5c1[_0x0d8b('0x21')]);if(_0x4950a8&&_0x4950a8[_0x0d8b('0x47')]){logger['info'](_0x0d8b('0x48'),_0x0d8b('0x49'));_0x368ede['recordingURL']=util['format'](_0x0d8b('0x4a'),_0x44c5c1[_0x0d8b('0x4b')],_0x368ede['uniqueid'],md5(_0x368ede['uniqueid']));}else{_0x368ede[_0x0d8b('0x4c')]='';}return getConnection(_0x44c5c1)[_0x0d8b('0x2f')](function(_0x377027){_0x900906=_0x377027;return getUser(_0x44c5c1,_0x5e3bb4[_0x0d8b('0x4d')],_0x900906);})['then'](function(_0x356b3d){_0x3d3cb6=_0x356b3d;logger['info']('The\x20User\x20ID\x20is:',_0x3d3cb6['id']);return getEndUser(_0x44c5c1,_0x368ede[_0x0d8b('0x4e')],_0x368ede[_0x0d8b('0x4f')],_0x900906);})['then'](function(_0x4a8f33){_0x5c5bd7=_0x4a8f33;logger[_0x0d8b('0x19')](_0x0d8b('0x50'),_0x5c5bd7['id']);return createTicket(_0x44c5c1,_0x3d3cb6,_0x5c5bd7,_0xf22c3c,_0x368ede,_0xf22c3c[_0x0d8b('0x51')],_0x900906);})[_0x0d8b('0x2f')](function(_0x3afc3a){_0x5ef6c3=_0x3afc3a;logger[_0x0d8b('0x19')](_0x0d8b('0x52'));logger[_0x0d8b('0x19')]('The\x20Ticket\x20ID\x20is:',_0x5ef6c3['id']);var _0x24a859=util[_0x0d8b('0x1f')](_0x0d8b('0x53'),_0x44c5c1[_0x0d8b('0x21')],_[_0x0d8b('0x54')](_0x5ef6c3['id'],'x')[0x1]);logger[_0x0d8b('0x19')](_0x0d8b('0x48'),_0x0d8b('0x55'));emit(util[_0x0d8b('0x1f')]('user:%s',_0x5e3bb4[_0x0d8b('0x17')]),_0x0d8b('0x56'),{'uri':_0x24a859});})[_0x0d8b('0x36')](function(_0x23de9e){logger[_0x0d8b('0x2a')]('[QUEUE]',JSON[_0x0d8b('0x26')](_0x23de9e));});};exports[_0x0d8b('0x57')]=function(_0x181d49,_0x17a87f,_0x1d6cd4,_0x59ada2,_0x4d0e7c,_0x3b1166,_0x291b83){var _0x3e4a41,_0xbbb520,_0x5a70bd,_0x199122;_0x3b1166[_0x0d8b('0x21')]=intUtil[_0x0d8b('0x46')](_0x3b1166['remoteUri']);_0x3b1166[_0x0d8b('0x4b')]=intUtil['stripTrailingSlash'](_0x3b1166[_0x0d8b('0x4b')]);if(_0x291b83&&_0x291b83[_0x0d8b('0x58')]&&_0x291b83[_0x0d8b('0x58')]!==_0x0d8b('0x59')){logger[_0x0d8b('0x19')](_0x0d8b('0x5a'),'Recording\x20is\x20enabled!');_0x17a87f[_0x0d8b('0x4c')]=util['format'](_0x0d8b('0x4a'),_0x3b1166[_0x0d8b('0x4b')],_0x17a87f[_0x0d8b('0x5b')],md5(_0x17a87f[_0x0d8b('0x5b')]));}return getConnection(_0x3b1166)['then'](function(_0x19e097){_0x199122=_0x19e097;return getUser(_0x3b1166,_0x59ada2[_0x0d8b('0x4d')],_0x199122);})[_0x0d8b('0x2f')](function(_0x2332fc){_0x3e4a41=_0x2332fc;logger[_0x0d8b('0x19')](_0x0d8b('0x5c'),_0x3e4a41['id']);return getEndUser(_0x3b1166,_0x17a87f[_0x0d8b('0x5d')],_0x17a87f[_0x0d8b('0x5e')],_0x199122);})[_0x0d8b('0x2f')](function(_0x34affb){_0xbbb520=_0x34affb;logger['info']('The\x20Enduser\x20ID\x20is:',_0xbbb520['id']);return createTicket(_0x3b1166,_0x3e4a41,_0xbbb520,_0x1d6cd4,_0x17a87f,_0x1d6cd4[_0x0d8b('0x51')],_0x199122);})[_0x0d8b('0x2f')](function(_0x53e399){_0x5a70bd=_0x53e399;logger[_0x0d8b('0x19')]('Ticket\x20created!');logger['info'](_0x0d8b('0x5f'),_0x5a70bd['id']);var _0x1c4e96=util['format']('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x3b1166[_0x0d8b('0x21')],_[_0x0d8b('0x54')](_0x5a70bd['id'],'x')[0x1]);logger[_0x0d8b('0x19')](_0x0d8b('0x5a'),_0x0d8b('0x55'));emit(util[_0x0d8b('0x1f')](_0x0d8b('0x60'),_0x59ada2['name']),_0x0d8b('0x56'),{'uri':_0x1c4e96});})['catch'](function(_0x1a203e){logger[_0x0d8b('0x2a')](_0x0d8b('0x5a'),JSON[_0x0d8b('0x26')](_0x1a203e));});};exports['unmanaged']=function(_0x3fe47d,_0x4a1c4a,_0x3a356b,_0x2c6c5f,_0x1c5fe2,_0x2ebea3){var _0xc5c35f,_0x2b44e5,_0x3e927c,_0x91aa89;_0x2ebea3[_0x0d8b('0x21')]=intUtil[_0x0d8b('0x46')](_0x2ebea3['remoteUri']);_0x2ebea3[_0x0d8b('0x4b')]=intUtil['stripTrailingSlash'](_0x2ebea3[_0x0d8b('0x4b')]);if(_0x1c5fe2&&_0x1c5fe2[_0x0d8b('0x47')]){logger['info']('['+_0x4a1c4a[_0x0d8b('0x61')]['toUpperCase']()+']',_0x0d8b('0x49'));_0x4a1c4a[_0x0d8b('0x4c')]=util[_0x0d8b('0x1f')](_0x0d8b('0x4a'),_0x2ebea3[_0x0d8b('0x4b')],_0x4a1c4a[_0x0d8b('0x5b')],md5(_0x4a1c4a[_0x0d8b('0x5b')]));}else{_0x4a1c4a[_0x0d8b('0x4c')]='';}return getConnection(_0x2ebea3)['then'](function(_0x10eca6){_0x91aa89=_0x10eca6;return getUser(_0x2ebea3,'',_0x91aa89);})[_0x0d8b('0x2f')](function(_0x5b2916){_0xc5c35f=_0x5b2916;logger[_0x0d8b('0x19')](_0x0d8b('0x5c'),_0xc5c35f['id']);return getEndUser(_0x2ebea3,_0x4a1c4a[_0x0d8b('0x4e')],_0x4a1c4a[_0x0d8b('0x4f')],_0x91aa89);})[_0x0d8b('0x2f')](function(_0x9e44b4){_0x2b44e5=_0x9e44b4;logger[_0x0d8b('0x19')](_0x0d8b('0x50'),_0x2b44e5['id']);return createTicket(_0x2ebea3,_0xc5c35f,_0x2b44e5,_0x3a356b,_0x4a1c4a,_0x3a356b[_0x0d8b('0x51')],_0x91aa89);})[_0x0d8b('0x2f')](function(_0xe35028){_0x3e927c=_0xe35028;logger[_0x0d8b('0x19')]('Ticket\x20created!');logger[_0x0d8b('0x19')](_0x0d8b('0x5f'),_0x3e927c['id']);})[_0x0d8b('0x36')](function(_0x58525c){logger['error']('['+_0x4a1c4a[_0x0d8b('0x61')][_0x0d8b('0x62')]()+']',JSON[_0x0d8b('0x26')](_0x58525c));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index 1d6f0f3..496c038 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 _0x0eb3=['%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','username','token','%s/token:%s','Basic\x20%s','toString','base64','debug','[HTTP]','GET','includes','string','type','nameField','toLowerCase','picklist','customField','push','idField','content','variableName','custom_fields','customVariable','Variable','name','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridnum','error','unmanaged','monitor_format','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','util','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','socket.io-emitter','emit','application/json','Creating\x20new\x20ticket...','%s/tickets.json','remoteUri','POST','merge','Tags','getString','Subjects','Descriptions','Fields','then','info','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','format','%s/search.json','type:user\x20role:agent\x20email:%s','Agent\x20found!','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!'];(function(_0x2ca447,_0x99e3db){var _0x2b3dc8=function(_0x5270e1){while(--_0x5270e1){_0x2ca447['push'](_0x2ca447['shift']());}};_0x2b3dc8(++_0x99e3db);}(_0x0eb3,0x1ed));var _0x30eb=function(_0x38b364,_0x58ce99){_0x38b364=_0x38b364-0x0;var _0x367713=_0x0eb3[_0x38b364];return _0x367713;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require('md5');var util=require(_0x30eb('0x0'));var Redis=require('ioredis');var intUtil=require(_0x30eb('0x1'));var config=require(_0x30eb('0x2'));var logger=require(_0x30eb('0x3'))(_0x30eb('0x4'));config[_0x30eb('0x5')]=_[_0x30eb('0x6')](config[_0x30eb('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x30eb('0x7'))(new Redis(config[_0x30eb('0x5')]));function emit(_0xf9f9c,_0x32ae7e,_0x49cde9){io['to'](_0xf9f9c)[_0x30eb('0x8')](_0x32ae7e,_0x49cde9);}var headers={'Content-Type':'application/json','Accept':_0x30eb('0x9')};function getTicket(_0x5e913b,_0x269f50,_0x41bba3,_0x2b7952,_0x452282){logger['info'](_0x30eb('0xa'));return request({'uri':util['format'](_0x30eb('0xb'),_0x5e913b[_0x30eb('0xc')]),'method':_0x30eb('0xd'),'body':{'ticket':_[_0x30eb('0xe')]({'requester_id':_0x41bba3['id'],'submitter_id':_0x269f50?_0x269f50['id']:undefined,'assignee_id':_0x269f50?_0x269f50['id']:undefined,'tags':getTags(_0x2b7952[_0x30eb('0xf')],'name'),'subject':intUtil[_0x30eb('0x10')](_0x2b7952[_0x30eb('0x11')],_0x452282,'\x20'),'description':intUtil[_0x30eb('0x10')](_0x2b7952['Descriptions'],_0x452282,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x2b7952[_0x30eb('0x12')],_0x452282,'\x0a')}},getCustomFields(_0x2b7952[_0x30eb('0x13')],_0x452282))}})[_0x30eb('0x14')](function(_0x46e4fc){logger[_0x30eb('0x15')](_0x30eb('0x16'));return _0x46e4fc[_0x30eb('0x17')];});}function getUser(_0x2a420d,_0xde6e23){if(intUtil[_0x30eb('0x18')](_0xde6e23)){logger[_0x30eb('0x15')](_0x30eb('0x19'),_0xde6e23);return request({'uri':util[_0x30eb('0x1a')](_0x30eb('0x1b'),_0x2a420d[_0x30eb('0xc')]),'qs':{'query':util[_0x30eb('0x1a')](_0x30eb('0x1c'),_0xde6e23)}})[_0x30eb('0x14')](function(_0x4ae93f){if(_0x4ae93f['count']){logger['info'](_0x30eb('0x1d'));return _['find'](_0x4ae93f[_0x30eb('0x1e')],{'email':_0xde6e23,'role':_0x30eb('0x1f')});}else{logger['info'](_0x30eb('0x20'));return request({'uri':util['format']('%s/users/me.json',_0x2a420d[_0x30eb('0xc')])})[_0x30eb('0x14')](function(_0x69f9a3){logger[_0x30eb('0x15')]('Admin\x20account\x20selected.');return _0x69f9a3['user'];});}});}else{logger['info'](_0x30eb('0x20'));return request({'uri':util[_0x30eb('0x1a')]('%s/users/me.json',_0x2a420d[_0x30eb('0xc')])})[_0x30eb('0x14')](function(_0x366a57){logger['info'](_0x30eb('0x21'));return _0x366a57[_0x30eb('0x22')];});}}function getEndUser(_0x5d0bd5,_0x420563,_0x2b2d9f){logger[_0x30eb('0x15')](_0x30eb('0x23'),_0x2b2d9f);return request({'uri':util[_0x30eb('0x1a')](_0x30eb('0x1b'),_0x5d0bd5[_0x30eb('0xc')]),'qs':{'query':util['format'](_0x30eb('0x24'),_0x2b2d9f)}})[_0x30eb('0x14')](function(_0x11ae54){var _0x197595;if(_0x11ae54['results'][_0x30eb('0x25')]){_0x11ae54[_0x30eb('0x1e')]=_['filter'](_0x11ae54[_0x30eb('0x1e')],{'suspended':![],'role':_0x30eb('0x26')});if(_0x11ae54['results']['length']){_0x197595=_[_0x30eb('0x27')](_0x11ae54[_0x30eb('0x1e')]);}}if(_0x197595){logger['info'](_0x30eb('0x28'));return _0x197595;}else{logger[_0x30eb('0x15')](_0x30eb('0x29'));return request({'uri':util['format'](_0x30eb('0x2a'),_0x5d0bd5[_0x30eb('0xc')]),'method':_0x30eb('0xd'),'body':{'user':{'role':_0x30eb('0x26'),'name':util[_0x30eb('0x1a')](_0x30eb('0x2b'),_0x420563||_0x2b2d9f),'phone':_0x2b2d9f}}})['then'](function(_0x2d1988){logger[_0x30eb('0x15')](_0x30eb('0x2c'));return _0x2d1988[_0x30eb('0x22')];});}});}function getAuth(_0x3e58a5){var _0x2ea7de;if(_0x3e58a5[_0x30eb('0x2d')]===_0x30eb('0x2e')){_0x2ea7de=util[_0x30eb('0x1a')](_0x30eb('0x2f'),_0x3e58a5[_0x30eb('0x30')],_0x3e58a5[_0x30eb('0x2e')]);}else if(_0x3e58a5['authType']===_0x30eb('0x31')){_0x2ea7de=util[_0x30eb('0x1a')](_0x30eb('0x32'),_0x3e58a5[_0x30eb('0x30')],_0x3e58a5[_0x30eb('0x31')]);}return util[_0x30eb('0x1a')](_0x30eb('0x33'),new Buffer(_0x2ea7de)[_0x30eb('0x34')](_0x30eb('0x35')));}function request(_0x30786b){logger[_0x30eb('0x36')](_0x30eb('0x37'),JSON['stringify'](_0x30786b));return rp(_['defaults'](_0x30786b,{'method':_0x30eb('0x38'),'headers':headers,'json':!![]}));}function getTags(_0x238b84,_0x119ac8){var _0xbc06b1=[];if(_0x238b84&&_0x238b84[_0x30eb('0x25')]>0x0){_0xbc06b1=_['map'](_0x238b84,_0x119ac8);}return _0xbc06b1;}function getCustomFields(_0x308e0a,_0xd28c3f){var _0x4ea318=[];var _0x428463={'custom_fields':[]};if(_0x308e0a[_0x30eb('0x25')]>0x0){_['forEach'](_0x308e0a,function(_0x3da9f6){if(_[_0x30eb('0x39')]([_0x30eb('0x3a'),'picklist'],_0x3da9f6[_0x30eb('0x3b')])&&_0x3da9f6[_0x30eb('0x3c')]&&!_0x3da9f6['customField']){_0x428463[_0x3da9f6[_0x30eb('0x3c')][_0x30eb('0x3d')]()]=_0x3da9f6['content']['toString']();}else if(_[_0x30eb('0x39')](['string',_0x30eb('0x3e')],_0x3da9f6[_0x30eb('0x3b')])&&_0x3da9f6['idField']&&_0x3da9f6[_0x30eb('0x3f')]){_0x428463['custom_fields'][_0x30eb('0x40')]({'id':_0x3da9f6[_0x30eb('0x41')],'value':_0x3da9f6[_0x30eb('0x42')][_0x30eb('0x34')]()});}else if(_0x3da9f6[_0x30eb('0x3b')]==='variable'&&_0x3da9f6[_0x30eb('0x43')]&&_0x3da9f6[_0x30eb('0x41')]&&_0x3da9f6[_0x30eb('0x3f')]){_0xd28c3f[_0x3da9f6[_0x30eb('0x43')]]&&_0x428463[_0x30eb('0x44')]['push']({'id':_0x3da9f6[_0x30eb('0x41')],'value':_0xd28c3f[_0x3da9f6[_0x30eb('0x43')]][_0x30eb('0x34')]()});}else if(_0x3da9f6[_0x30eb('0x3b')]===_0x30eb('0x45')&&_0x3da9f6[_0x30eb('0x46')]&&_0x3da9f6[_0x30eb('0x46')]['name']&&_0x3da9f6[_0x30eb('0x41')]&&_0x3da9f6[_0x30eb('0x3f')]){_0xd28c3f[_0x3da9f6[_0x30eb('0x46')]['name'][_0x30eb('0x3d')]()]&&_0x428463[_0x30eb('0x44')]['push']({'id':_0x3da9f6['idField'],'value':_0xd28c3f[_0x3da9f6[_0x30eb('0x46')][_0x30eb('0x47')][_0x30eb('0x3d')]()]['toString']()});}});}return _0x428463;}exports['queue']=function(_0x514e13,_0x243b32,_0x5e5bd0,_0x53c805,_0x4cbf3d,_0x105eb9){var _0x3dc1f7,_0x5978fd;_0x105eb9[_0x30eb('0xc')]=intUtil[_0x30eb('0x48')](_0x105eb9[_0x30eb('0xc')]);_0x105eb9[_0x30eb('0x49')]=intUtil[_0x30eb('0x48')](_0x105eb9[_0x30eb('0x49')]);if(_0x4cbf3d&&_0x4cbf3d['monitor_format']){logger['info'](_0x30eb('0x4a'),_0x30eb('0x4b'));_0x243b32[_0x30eb('0x4c')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x105eb9[_0x30eb('0x49')],_0x243b32[_0x30eb('0x4d')],md5(_0x243b32[_0x30eb('0x4d')]));}else{_0x243b32[_0x30eb('0x4c')]='';}headers[_0x30eb('0x4e')]=getAuth(_0x105eb9);return getUser(_0x105eb9,_0x53c805['email'])[_0x30eb('0x14')](function(_0x4a6b9f){_0x3dc1f7=_0x4a6b9f;logger[_0x30eb('0x15')](_0x30eb('0x4f'),_0x3dc1f7['id']);return getEndUser(_0x105eb9,_0x243b32[_0x30eb('0x50')],_0x243b32[_0x30eb('0x51')]);})[_0x30eb('0x14')](function(_0x354604){_0x5978fd=_0x354604;logger[_0x30eb('0x15')](_0x30eb('0x52'),_0x5978fd['id']);return getTicket(_0x105eb9,_0x3dc1f7,_0x5978fd,_0x5e5bd0,_0x243b32);})[_0x30eb('0x14')](function(_0x30fbd7){if(_0x30fbd7){logger[_0x30eb('0x15')](_0x30eb('0x53'),_0x30fbd7['id']);switch(_0x105eb9[_0x30eb('0x3b')]){case'integrationTab':logger['info'](_0x30eb('0x4a'),_0x30eb('0x54'));return request({'uri':util[_0x30eb('0x1a')](_0x30eb('0x55'),_0x105eb9['remoteUri'],_0x3dc1f7['id'],_0x30fbd7['id']),'method':_0x30eb('0xd')});case'newTab':logger[_0x30eb('0x15')](_0x30eb('0x4a'),_0x30eb('0x56'));emit(util[_0x30eb('0x1a')](_0x30eb('0x57'),_0x53c805[_0x30eb('0x47')]),_0x30eb('0x58'),{'uri':util[_0x30eb('0x1a')](_0x30eb('0x59'),_0x105eb9[_0x30eb('0xc')][_0x30eb('0x5a')](_0x30eb('0x5b'),''),_0x30fbd7['id'])});break;default:logger['error'](_0x30eb('0x4a'),_0x30eb('0x5c'));}}})[_0x30eb('0x5d')](function(_0x399a60){logger['error'](_0x30eb('0x5e'),util[_0x30eb('0x5f')](_0x399a60,{'showHidden':!![],'depth':null}));});};exports[_0x30eb('0x60')]=function(_0x5eb08e,_0x343c81,_0x2f7d8f,_0x3828c3,_0x2a4d2e,_0x352068,_0x7e7221){var _0x4b7510,_0x3a45d8;_0x352068[_0x30eb('0xc')]=intUtil[_0x30eb('0x48')](_0x352068['remoteUri']);_0x352068['serverUrl']=intUtil[_0x30eb('0x48')](_0x352068[_0x30eb('0x49')]);if(_0x7e7221&&_0x7e7221[_0x30eb('0x61')]&&_0x7e7221[_0x30eb('0x61')]!=='none'){logger[_0x30eb('0x15')](_0x30eb('0x62'),_0x30eb('0x4b'));_0x343c81['recordingURL']=util['format'](_0x30eb('0x63'),_0x352068['serverUrl'],_0x343c81['uniqueid'],md5(_0x343c81[_0x30eb('0x4d')]));}headers[_0x30eb('0x4e')]=getAuth(_0x352068);return getUser(_0x352068,_0x3828c3['email'])[_0x30eb('0x14')](function(_0x491d63){_0x4b7510=_0x491d63;logger[_0x30eb('0x15')](_0x30eb('0x4f'),_0x4b7510['id']);return getEndUser(_0x352068,_0x343c81['destcalleridname'],_0x343c81[_0x30eb('0x64')]);})[_0x30eb('0x14')](function(_0x1866a7){_0x3a45d8=_0x1866a7;logger[_0x30eb('0x15')](_0x30eb('0x52'),_0x3a45d8['id']);return getTicket(_0x352068,_0x4b7510,_0x3a45d8,_0x2f7d8f,_0x343c81);})[_0x30eb('0x14')](function(_0x2c36b6){if(_0x2c36b6){logger['info'](_0x30eb('0x53'),_0x2c36b6['id']);switch(_0x352068[_0x30eb('0x3b')]){case'integrationTab':logger['info'](_0x30eb('0x62'),_0x30eb('0x54'));return request({'uri':util['format'](_0x30eb('0x55'),_0x352068[_0x30eb('0xc')],_0x4b7510['id'],_0x2c36b6['id']),'method':_0x30eb('0xd')});case'newTab':logger[_0x30eb('0x15')](_0x30eb('0x62'),_0x30eb('0x56'));emit(util[_0x30eb('0x1a')](_0x30eb('0x57'),_0x3828c3[_0x30eb('0x47')]),_0x30eb('0x58'),{'uri':util[_0x30eb('0x1a')](_0x30eb('0x59'),_0x352068['remoteUri'][_0x30eb('0x5a')](_0x30eb('0x5b'),''),_0x2c36b6['id'])});break;default:logger['error'](_0x30eb('0x62'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x30eb('0x5d')](function(_0x5012de){logger[_0x30eb('0x65')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x5012de,{'showHidden':!![],'depth':null}));});};exports[_0x30eb('0x66')]=function(_0x2c9091,_0x3e0f74,_0x276943,_0x2091f2,_0x50970e,_0x425f86){var _0x5931cd,_0x1c90f5;_0x425f86[_0x30eb('0xc')]=intUtil[_0x30eb('0x48')](_0x425f86['remoteUri']);_0x425f86[_0x30eb('0x49')]=intUtil[_0x30eb('0x48')](_0x425f86[_0x30eb('0x49')]);if(_0x50970e&&_0x50970e[_0x30eb('0x67')]){logger[_0x30eb('0x15')]('['+_0x3e0f74[_0x30eb('0x68')][_0x30eb('0x69')]()+']','Recording\x20is\x20enabled!');_0x3e0f74['recordingURL']=util['format'](_0x30eb('0x63'),_0x425f86[_0x30eb('0x49')],_0x3e0f74[_0x30eb('0x4d')],md5(_0x3e0f74[_0x30eb('0x4d')]));}else{_0x3e0f74[_0x30eb('0x4c')]='';}headers['Authorization']=getAuth(_0x425f86);return getUser(_0x425f86)[_0x30eb('0x14')](function(_0xcab63d){_0x5931cd=_0xcab63d;logger[_0x30eb('0x15')](_0x30eb('0x4f'),_0x5931cd['id']);return getEndUser(_0x425f86,_0x3e0f74['calleridname'],_0x3e0f74['calleridnum']);})[_0x30eb('0x14')](function(_0x5ba370){_0x1c90f5=_0x5ba370;logger['info'](_0x30eb('0x52'),_0x1c90f5['id']);return getTicket(_0x425f86,_0x5931cd,_0x1c90f5,_0x276943,_0x3e0f74);})[_0x30eb('0x14')](function(_0x392e90){if(_0x392e90){logger[_0x30eb('0x15')](_0x30eb('0x53'),_0x392e90['id']);}})['catch'](function(_0x55bda5){logger[_0x30eb('0x65')]('['+_0x3e0f74[_0x30eb('0x68')][_0x30eb('0x69')]()+']'+_0x30eb('0x6a'),util[_0x30eb('0x5f')](_0x55bda5,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xa6f9=['user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','md5','util','ioredis','./util','../../../../config/environment','zendesk','defaults','redis','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','remoteUri','POST','merge','Tags','name','Subjects','getString','Descriptions','then','Ticket\x20created!','ticket','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','Agent\x20found!','results','agent','%s/users/me.json','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Caller\x20-\x20%s','Enduser\x20created.','password','%s:%s','authType','token','%s/token:%s','Basic\x20%s','toString','debug','[HTTP]','stringify','GET','map','forEach','string','picklist','type','nameField','toLowerCase','includes','idField','customField','push','content','variable','variableName','custom_fields','customVariable','Variable','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','email','calleridname','calleridnum','The\x20Ticket\x20ID\x20is:','integrationTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...'];(function(_0x7dbd65,_0x18da49){var _0x33d551=function(_0x7ce789){while(--_0x7ce789){_0x7dbd65['push'](_0x7dbd65['shift']());}};_0x33d551(++_0x18da49);}(_0xa6f9,0x1db));var _0x9a6f=function(_0x51c520,_0x1f80bf){_0x51c520=_0x51c520-0x0;var _0x4a55eb=_0xa6f9[_0x51c520];return _0x4a55eb;};'use strict';var _=require(_0x9a6f('0x0'));var rp=require('request-promise');var md5=require(_0x9a6f('0x1'));var util=require(_0x9a6f('0x2'));var Redis=require(_0x9a6f('0x3'));var intUtil=require(_0x9a6f('0x4'));var config=require(_0x9a6f('0x5'));var logger=require('../../../../config/logger')(_0x9a6f('0x6'));config['redis']=_[_0x9a6f('0x7')](config[_0x9a6f('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x9a6f('0x9'))(new Redis(config[_0x9a6f('0x8')]));function emit(_0x463401,_0x486828,_0x34cc4e){io['to'](_0x463401)[_0x9a6f('0xa')](_0x486828,_0x34cc4e);}var headers={'Content-Type':'application/json','Accept':_0x9a6f('0xb')};function getTicket(_0x2cfbf8,_0x444701,_0x3e6200,_0x3885aa,_0x3e3cf3){logger[_0x9a6f('0xc')](_0x9a6f('0xd'));return request({'uri':util[_0x9a6f('0xe')]('%s/tickets.json',_0x2cfbf8[_0x9a6f('0xf')]),'method':_0x9a6f('0x10'),'body':{'ticket':_[_0x9a6f('0x11')]({'requester_id':_0x3e6200['id'],'submitter_id':_0x444701?_0x444701['id']:undefined,'assignee_id':_0x444701?_0x444701['id']:undefined,'tags':getTags(_0x3885aa[_0x9a6f('0x12')],_0x9a6f('0x13')),'subject':intUtil['getString'](_0x3885aa[_0x9a6f('0x14')],_0x3e3cf3,'\x20'),'description':intUtil[_0x9a6f('0x15')](_0x3885aa[_0x9a6f('0x16')],_0x3e3cf3,'\x0a'),'comment':{'public':![],'body':intUtil[_0x9a6f('0x15')](_0x3885aa[_0x9a6f('0x16')],_0x3e3cf3,'\x0a')}},getCustomFields(_0x3885aa['Fields'],_0x3e3cf3))}})[_0x9a6f('0x17')](function(_0x15570a){logger[_0x9a6f('0xc')](_0x9a6f('0x18'));return _0x15570a[_0x9a6f('0x19')];});}function getUser(_0x49b7f6,_0x1574f9){if(intUtil['validateEmail'](_0x1574f9)){logger[_0x9a6f('0xc')](_0x9a6f('0x1a'),_0x1574f9);return request({'uri':util[_0x9a6f('0xe')](_0x9a6f('0x1b'),_0x49b7f6[_0x9a6f('0xf')]),'qs':{'query':util['format'](_0x9a6f('0x1c'),_0x1574f9)}})[_0x9a6f('0x17')](function(_0x4e8e74){if(_0x4e8e74['count']){logger[_0x9a6f('0xc')](_0x9a6f('0x1d'));return _['find'](_0x4e8e74[_0x9a6f('0x1e')],{'email':_0x1574f9,'role':_0x9a6f('0x1f')});}else{logger[_0x9a6f('0xc')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x9a6f('0xe')](_0x9a6f('0x20'),_0x49b7f6['remoteUri'])})[_0x9a6f('0x17')](function(_0x457679){logger[_0x9a6f('0xc')]('Admin\x20account\x20selected.');return _0x457679[_0x9a6f('0x21')];});}});}else{logger[_0x9a6f('0xc')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0x9a6f('0x20'),_0x49b7f6[_0x9a6f('0xf')])})[_0x9a6f('0x17')](function(_0x819654){logger['info']('Admin\x20account\x20selected.');return _0x819654[_0x9a6f('0x21')];});}}function getEndUser(_0x4a4406,_0xdf24e4,_0x329cb4){logger['info'](_0x9a6f('0x22'),_0x329cb4);return request({'uri':util[_0x9a6f('0xe')]('%s/search.json',_0x4a4406[_0x9a6f('0xf')]),'qs':{'query':util[_0x9a6f('0xe')](_0x9a6f('0x23'),_0x329cb4)}})[_0x9a6f('0x17')](function(_0x3af296){var _0x3da8de;if(_0x3af296[_0x9a6f('0x1e')][_0x9a6f('0x24')]){_0x3af296[_0x9a6f('0x1e')]=_[_0x9a6f('0x25')](_0x3af296[_0x9a6f('0x1e')],{'suspended':![],'role':_0x9a6f('0x26')});if(_0x3af296['results']['length']){_0x3da8de=_[_0x9a6f('0x27')](_0x3af296[_0x9a6f('0x1e')]);}}if(_0x3da8de){logger[_0x9a6f('0xc')](_0x9a6f('0x28'));return _0x3da8de;}else{logger[_0x9a6f('0xc')](_0x9a6f('0x29'));return request({'uri':util[_0x9a6f('0xe')]('%s/users.json',_0x4a4406[_0x9a6f('0xf')]),'method':_0x9a6f('0x10'),'body':{'user':{'role':_0x9a6f('0x26'),'name':util[_0x9a6f('0xe')](_0x9a6f('0x2a'),_0xdf24e4||_0x329cb4),'phone':_0x329cb4}}})[_0x9a6f('0x17')](function(_0x339296){logger[_0x9a6f('0xc')](_0x9a6f('0x2b'));return _0x339296['user'];});}});}function getAuth(_0x329bc5){var _0xec82c4;if(_0x329bc5['authType']===_0x9a6f('0x2c')){_0xec82c4=util['format'](_0x9a6f('0x2d'),_0x329bc5['username'],_0x329bc5['password']);}else if(_0x329bc5[_0x9a6f('0x2e')]===_0x9a6f('0x2f')){_0xec82c4=util[_0x9a6f('0xe')](_0x9a6f('0x30'),_0x329bc5['username'],_0x329bc5['token']);}return util['format'](_0x9a6f('0x31'),new Buffer(_0xec82c4)[_0x9a6f('0x32')]('base64'));}function request(_0x43b0ba){logger[_0x9a6f('0x33')](_0x9a6f('0x34'),JSON[_0x9a6f('0x35')](_0x43b0ba));return rp(_[_0x9a6f('0x7')](_0x43b0ba,{'method':_0x9a6f('0x36'),'headers':headers,'json':!![]}));}function getTags(_0x56fe4b,_0x5cdd63){var _0x5a0bd6=[];if(_0x56fe4b&&_0x56fe4b[_0x9a6f('0x24')]>0x0){_0x5a0bd6=_[_0x9a6f('0x37')](_0x56fe4b,_0x5cdd63);}return _0x5a0bd6;}function getCustomFields(_0x537ac5,_0x32d639){var _0x1508c9=[];var _0x43b6d4={'custom_fields':[]};if(_0x537ac5['length']>0x0){_[_0x9a6f('0x38')](_0x537ac5,function(_0x40317c){if(_['includes']([_0x9a6f('0x39'),_0x9a6f('0x3a')],_0x40317c[_0x9a6f('0x3b')])&&_0x40317c['nameField']&&!_0x40317c['customField']){_0x43b6d4[_0x40317c[_0x9a6f('0x3c')][_0x9a6f('0x3d')]()]=_0x40317c['content'][_0x9a6f('0x32')]();}else if(_[_0x9a6f('0x3e')]([_0x9a6f('0x39'),_0x9a6f('0x3a')],_0x40317c['type'])&&_0x40317c[_0x9a6f('0x3f')]&&_0x40317c[_0x9a6f('0x40')]){_0x43b6d4['custom_fields'][_0x9a6f('0x41')]({'id':_0x40317c[_0x9a6f('0x3f')],'value':_0x40317c[_0x9a6f('0x42')][_0x9a6f('0x32')]()});}else if(_0x40317c[_0x9a6f('0x3b')]===_0x9a6f('0x43')&&_0x40317c[_0x9a6f('0x44')]&&_0x40317c[_0x9a6f('0x3f')]&&_0x40317c[_0x9a6f('0x40')]){_0x32d639[_0x40317c['variableName']]&&_0x43b6d4[_0x9a6f('0x45')][_0x9a6f('0x41')]({'id':_0x40317c[_0x9a6f('0x3f')],'value':_0x32d639[_0x40317c[_0x9a6f('0x44')]][_0x9a6f('0x32')]()});}else if(_0x40317c[_0x9a6f('0x3b')]===_0x9a6f('0x46')&&_0x40317c[_0x9a6f('0x47')]&&_0x40317c[_0x9a6f('0x47')]['name']&&_0x40317c[_0x9a6f('0x3f')]&&_0x40317c['customField']){_0x32d639[_0x40317c[_0x9a6f('0x47')][_0x9a6f('0x13')][_0x9a6f('0x3d')]()]&&_0x43b6d4[_0x9a6f('0x45')][_0x9a6f('0x41')]({'id':_0x40317c[_0x9a6f('0x3f')],'value':_0x32d639[_0x40317c[_0x9a6f('0x47')]['name']['toLowerCase']()][_0x9a6f('0x32')]()});}});}return _0x43b6d4;}exports['queue']=function(_0x375275,_0x2ed4e0,_0x24f7fa,_0x2a519b,_0x5ea5ad,_0x24dd35){var _0x5c2a05,_0x5b2ca6;_0x24dd35[_0x9a6f('0xf')]=intUtil[_0x9a6f('0x48')](_0x24dd35[_0x9a6f('0xf')]);_0x24dd35[_0x9a6f('0x49')]=intUtil[_0x9a6f('0x48')](_0x24dd35[_0x9a6f('0x49')]);if(_0x5ea5ad&&_0x5ea5ad[_0x9a6f('0x4a')]){logger[_0x9a6f('0xc')]('[QUEUE]',_0x9a6f('0x4b'));_0x2ed4e0['recordingURL']=util['format'](_0x9a6f('0x4c'),_0x24dd35[_0x9a6f('0x49')],_0x2ed4e0[_0x9a6f('0x4d')],md5(_0x2ed4e0[_0x9a6f('0x4d')]));}else{_0x2ed4e0[_0x9a6f('0x4e')]='';}headers[_0x9a6f('0x4f')]=getAuth(_0x24dd35);return getUser(_0x24dd35,_0x2a519b[_0x9a6f('0x50')])['then'](function(_0x333de3){_0x5c2a05=_0x333de3;logger[_0x9a6f('0xc')]('The\x20User\x20ID\x20is:',_0x5c2a05['id']);return getEndUser(_0x24dd35,_0x2ed4e0[_0x9a6f('0x51')],_0x2ed4e0[_0x9a6f('0x52')]);})['then'](function(_0x5849d6){_0x5b2ca6=_0x5849d6;logger['info']('The\x20Enduser\x20ID\x20is:',_0x5b2ca6['id']);return getTicket(_0x24dd35,_0x5c2a05,_0x5b2ca6,_0x24f7fa,_0x2ed4e0);})['then'](function(_0x395b98){if(_0x395b98){logger[_0x9a6f('0xc')](_0x9a6f('0x53'),_0x395b98['id']);switch(_0x24dd35[_0x9a6f('0x3b')]){case _0x9a6f('0x54'):logger[_0x9a6f('0xc')](_0x9a6f('0x55'),_0x9a6f('0x56'));return request({'uri':util[_0x9a6f('0xe')](_0x9a6f('0x57'),_0x24dd35[_0x9a6f('0xf')],_0x5c2a05['id'],_0x395b98['id']),'method':_0x9a6f('0x10')});case _0x9a6f('0x58'):logger['info']('[QUEUE]',_0x9a6f('0x59'));emit(util[_0x9a6f('0xe')](_0x9a6f('0x5a'),_0x2a519b[_0x9a6f('0x13')]),_0x9a6f('0x5b'),{'uri':util[_0x9a6f('0xe')](_0x9a6f('0x5c'),_0x24dd35[_0x9a6f('0xf')][_0x9a6f('0x5d')](_0x9a6f('0x5e'),''),_0x395b98['id'])});break;default:logger[_0x9a6f('0x5f')](_0x9a6f('0x55'),_0x9a6f('0x60'));}}})[_0x9a6f('0x61')](function(_0x5c1f16){logger[_0x9a6f('0x5f')](_0x9a6f('0x62'),util[_0x9a6f('0x63')](_0x5c1f16,{'showHidden':!![],'depth':null}));});};exports[_0x9a6f('0x64')]=function(_0x1318c0,_0x4f4508,_0x4607c2,_0x6ec4e4,_0x562581,_0x514dca,_0x1de90c){var _0x4a0704,_0x4cf6bc;_0x514dca['remoteUri']=intUtil[_0x9a6f('0x48')](_0x514dca['remoteUri']);_0x514dca[_0x9a6f('0x49')]=intUtil[_0x9a6f('0x48')](_0x514dca[_0x9a6f('0x49')]);if(_0x1de90c&&_0x1de90c[_0x9a6f('0x65')]&&_0x1de90c[_0x9a6f('0x65')]!==_0x9a6f('0x66')){logger[_0x9a6f('0xc')](_0x9a6f('0x67'),_0x9a6f('0x4b'));_0x4f4508[_0x9a6f('0x4e')]=util[_0x9a6f('0xe')](_0x9a6f('0x4c'),_0x514dca[_0x9a6f('0x49')],_0x4f4508['uniqueid'],md5(_0x4f4508[_0x9a6f('0x4d')]));}headers[_0x9a6f('0x4f')]=getAuth(_0x514dca);return getUser(_0x514dca,_0x6ec4e4['email'])[_0x9a6f('0x17')](function(_0x1e7109){_0x4a0704=_0x1e7109;logger[_0x9a6f('0xc')](_0x9a6f('0x68'),_0x4a0704['id']);return getEndUser(_0x514dca,_0x4f4508[_0x9a6f('0x69')],_0x4f4508[_0x9a6f('0x6a')]);})[_0x9a6f('0x17')](function(_0x48c5c4){_0x4cf6bc=_0x48c5c4;logger[_0x9a6f('0xc')](_0x9a6f('0x6b'),_0x4cf6bc['id']);return getTicket(_0x514dca,_0x4a0704,_0x4cf6bc,_0x4607c2,_0x4f4508);})[_0x9a6f('0x17')](function(_0x35e10c){if(_0x35e10c){logger[_0x9a6f('0xc')](_0x9a6f('0x53'),_0x35e10c['id']);switch(_0x514dca['type']){case _0x9a6f('0x54'):logger[_0x9a6f('0xc')](_0x9a6f('0x67'),_0x9a6f('0x56'));return request({'uri':util[_0x9a6f('0xe')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x514dca[_0x9a6f('0xf')],_0x4a0704['id'],_0x35e10c['id']),'method':'POST'});case _0x9a6f('0x58'):logger[_0x9a6f('0xc')](_0x9a6f('0x67'),_0x9a6f('0x59'));emit(util[_0x9a6f('0xe')]('user:%s',_0x6ec4e4['name']),_0x9a6f('0x5b'),{'uri':util['format'](_0x9a6f('0x5c'),_0x514dca[_0x9a6f('0xf')]['replace'](_0x9a6f('0x5e'),''),_0x35e10c['id'])});break;default:logger[_0x9a6f('0x5f')]('[OUTBOUND]',_0x9a6f('0x60'));}}})['catch'](function(_0x12b7f1){logger[_0x9a6f('0x5f')](_0x9a6f('0x6c'),util[_0x9a6f('0x63')](_0x12b7f1,{'showHidden':!![],'depth':null}));});};exports[_0x9a6f('0x6d')]=function(_0x48a189,_0x4670ea,_0x4a1624,_0x4f4cd8,_0x4083ad,_0x565929){var _0x49ebaf,_0x2080ab;_0x565929[_0x9a6f('0xf')]=intUtil[_0x9a6f('0x48')](_0x565929['remoteUri']);_0x565929[_0x9a6f('0x49')]=intUtil[_0x9a6f('0x48')](_0x565929[_0x9a6f('0x49')]);if(_0x4083ad&&_0x4083ad['monitor_format']){logger[_0x9a6f('0xc')]('['+_0x4670ea[_0x9a6f('0x6e')][_0x9a6f('0x6f')]()+']',_0x9a6f('0x4b'));_0x4670ea[_0x9a6f('0x4e')]=util[_0x9a6f('0xe')](_0x9a6f('0x4c'),_0x565929[_0x9a6f('0x49')],_0x4670ea[_0x9a6f('0x4d')],md5(_0x4670ea[_0x9a6f('0x4d')]));}else{_0x4670ea[_0x9a6f('0x4e')]='';}headers[_0x9a6f('0x4f')]=getAuth(_0x565929);return getUser(_0x565929)[_0x9a6f('0x17')](function(_0x2f1e04){_0x49ebaf=_0x2f1e04;logger[_0x9a6f('0xc')]('The\x20User\x20ID\x20is:',_0x49ebaf['id']);return getEndUser(_0x565929,_0x4670ea[_0x9a6f('0x51')],_0x4670ea['calleridnum']);})['then'](function(_0x386e36){_0x2080ab=_0x386e36;logger['info'](_0x9a6f('0x6b'),_0x2080ab['id']);return getTicket(_0x565929,_0x49ebaf,_0x2080ab,_0x4a1624,_0x4670ea);})[_0x9a6f('0x17')](function(_0x4509f6){if(_0x4509f6){logger[_0x9a6f('0xc')](_0x9a6f('0x53'),_0x4509f6['id']);}})[_0x9a6f('0x61')](function(_0x267f0d){logger[_0x9a6f('0x5f')]('['+_0x4670ea[_0x9a6f('0x6e')][_0x9a6f('0x6f')]()+']'+_0x9a6f('0x70'),util['inspect'](_0x267f0d,{'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 c86496f..badad0b 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 _0x96eb=['Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','user','The\x20failing\x20result\x20is','stringify','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','/crm/v2/','moduleCreate','role','first_name','last_name','code','details','startCase','Error:\x20','log','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','/crm/v2/Leads/search?criteria=((Phone:equals:','nothing','contact','Contacts','lead','Leads','Creating\x20new\x20call...','Owner','administrator','Subjects','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','talktime','Call_Duration','utc','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','starttime','Call_Result','Called','connect','Answered','rejected','Rejected','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','outbound','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','Call\x20created!','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','recordingURL','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','https://crm.','/crm/EntityInfo.do?module=Calls&id=','unmanaged','lastevent','toUpperCase','lodash','request-promise','md5','util','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','socket.io-emitter','emit','debug','[HTTP]','length','forEach','includes','string','picklist','type','idField','content','variable','variableName','toString','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','clientSecret','refresh_token','then','seconds','catch','error'];(function(_0x149c2f,_0x53f51e){var _0x2985ae=function(_0x3a0377){while(--_0x3a0377){_0x149c2f['push'](_0x149c2f['shift']());}};_0x2985ae(++_0x53f51e);}(_0x96eb,0x113));var _0xb96e=function(_0x4e1dfd,_0x235f6a){_0x4e1dfd=_0x4e1dfd-0x0;var _0x49fee7=_0x96eb[_0x4e1dfd];return _0x49fee7;};'use strict';var _=require(_0xb96e('0x0'));var rp=require(_0xb96e('0x1'));var md5=require(_0xb96e('0x2'));var util=require(_0xb96e('0x3'));var intUtil=require(_0xb96e('0x4'));var moment=require(_0xb96e('0x5'));var Redis=require(_0xb96e('0x6'));var BPromise=require(_0xb96e('0x7'));var config=require(_0xb96e('0x8'));var logger=require(_0xb96e('0x9'))(_0xb96e('0xa'));config[_0xb96e('0xb')]=_[_0xb96e('0xc')](config[_0xb96e('0xb')],{'host':'localhost','port':0x18eb});var io=require(_0xb96e('0xd'))(new Redis(config[_0xb96e('0xb')]));function emit(_0x335e28,_0x331f86,_0x48d5f3){io['to'](_0x335e28)[_0xb96e('0xe')](_0x331f86,_0x48d5f3);}function request(_0x2d59c4){logger[_0xb96e('0xf')](_0xb96e('0x10'),JSON['stringify'](_0x2d59c4));return rp(_0x2d59c4);}function getCustomFields(_0x3e8c80,_0x42ab7e){var _0x25abe3={};if(_0x3e8c80[_0xb96e('0x11')]>0x0){_[_0xb96e('0x12')](_0x3e8c80,function(_0x504461){if(_[_0xb96e('0x13')]([_0xb96e('0x14'),_0xb96e('0x15')],_0x504461[_0xb96e('0x16')])&&_0x504461[_0xb96e('0x17')]){_0x25abe3[_0x504461[_0xb96e('0x17')]]=_0x504461[_0xb96e('0x18')]['toString']();}else if(_0x504461['type']===_0xb96e('0x19')&&_0x504461['variableName']&&_0x504461['idField']&&_0x42ab7e[_0x504461[_0xb96e('0x1a')]]){_0x25abe3[_0x504461[_0xb96e('0x17')]]=_0x42ab7e[_0x504461[_0xb96e('0x1a')]][_0xb96e('0x1b')]();}else if(_0x504461[_0xb96e('0x16')]===_0xb96e('0x1c')&&_0x504461[_0xb96e('0x1d')]&&_0x504461[_0xb96e('0x1d')][_0xb96e('0x1e')]&&_0x504461['idField']&&_0x42ab7e[_0x504461[_0xb96e('0x1d')][_0xb96e('0x1e')][_0xb96e('0x1f')]()]){_0x25abe3[_0x504461[_0xb96e('0x17')]]=_0x42ab7e[_0x504461[_0xb96e('0x1d')][_0xb96e('0x1e')][_0xb96e('0x1f')]()][_0xb96e('0x1b')]();}});}return _0x25abe3;}function getName(_0x2fa779){if(_0x2fa779[_0xb96e('0x20')]('\x20')>0x0){var _0x133d14=_0x2fa779[_0xb96e('0x21')](/ (.+)/);if(_0x133d14[0x1]){return _0x133d14;}}return[_0x2fa779,_0x2fa779];}var accountsTokens={};function getAccessToken(_0x16e151){return new Promise(function(_0x110468,_0x570301){if(!_[_0xb96e('0x22')](accountsTokens[_0x16e151['id']])&&!_['isNil'](accountsTokens[_0x16e151['id']][_0xb96e('0x23')])){if(moment()[_0xb96e('0x24')](accountsTokens[_0x16e151['id']][_0xb96e('0x25')])){_0x110468(accountsTokens[_0x16e151['id']][_0xb96e('0x23')]);}}var _0x358d07;switch(_0x16e151['zone']){case'US':_0x358d07=_0xb96e('0x26');break;case'AU':_0x358d07=_0xb96e('0x27');break;case'EU':_0x358d07=_0xb96e('0x28');break;case'IN':_0x358d07=_0xb96e('0x29');break;case'CN':_0x358d07=_0xb96e('0x2a');break;default:_0x358d07=_0xb96e('0x28');break;}var _0x1eaf4c={'method':_0xb96e('0x2b'),'uri':_0x358d07+_0xb96e('0x2c'),'qs':{'refresh_token':_0x16e151['refreshToken'],'client_id':_0x16e151['clientId'],'client_secret':_0x16e151[_0xb96e('0x2d')],'grant_type':_0xb96e('0x2e')},'json':!![]};return rp(_0x1eaf4c)[_0xb96e('0x2f')](function(_0x1be0c4){accountsTokens[_0x16e151['id']]={'access_token':_0x1be0c4[_0xb96e('0x23')],'expires_in':moment()['add'](_0x1be0c4[_0xb96e('0x25')],_0xb96e('0x30'))};_0x110468(_0x1be0c4['access_token']);})[_0xb96e('0x31')](function(_0x84c376){logger[_0xb96e('0x32')](_0xb96e('0x33'),_0x84c376[_0xb96e('0x34')]);_0x570301(_0x84c376);});});}function getUser(_0x29cfd6,_0x4fca5f,_0x2a9831,_0x130de4){logger[_0xb96e('0x35')](_0xb96e('0x36'));return request({'method':_0xb96e('0x37'),'uri':util[_0xb96e('0x38')](_0xb96e('0x39'),_0x4fca5f),'qs':{'type':_0xb96e('0x3a')},'headers':{'Authorization':_0xb96e('0x3b')+_0x29cfd6},'json':!![]})['then'](function(_0x537f2f){if(_0x537f2f[_0xb96e('0x3c')]){var _0x25e264=-0x1;if(_['isArrayLikeObject'](_0x537f2f[_0xb96e('0x3c')])){if(!_[_0xb96e('0x22')](_0x130de4)){_0x25e264=_[_0xb96e('0x3d')](_0x537f2f[_0xb96e('0x3c')],function(_0x12650d){return _0x12650d[_0xb96e('0x3e')]===_0x130de4;});}if(_0x25e264>=0x0){logger[_0xb96e('0x35')](_0xb96e('0x3f'));}else{logger['info'](_0xb96e('0x40'));_0x25e264=_[_0xb96e('0x3d')](_0x537f2f[_0xb96e('0x3c')],function(_0x2afabb){return _0x2afabb[_0xb96e('0x41')][_0xb96e('0x1e')]===_0xb96e('0x42');});}return _0x537f2f[_0xb96e('0x3c')][_0x25e264];}else{if(_0x537f2f[_0xb96e('0x43')][_0xb96e('0x41')][_0xb96e('0x1e')]===_0xb96e('0x42')){logger['info']('Using\x20the\x20admin\x20account!');user=_0x537f2f['user'];return user;}else{logger[_0xb96e('0x32')](_0xb96e('0x44'),JSON[_0xb96e('0x45')](_0x537f2f));throw new Error(_0xb96e('0x46')+JSON['stringify'](_0x537f2f));}}}else{logger['error'](_0xb96e('0x44'),JSON[_0xb96e('0x45')](_0x537f2f));throw new Error(_0xb96e('0x46')+JSON[_0xb96e('0x45')](_0x537f2f));}})['catch'](function(_0x4311fb){console[_0xb96e('0x32')](_0x4311fb);});}function getZohoUser(_0x586e21,_0x15b6f7){return new BPromise(function(_0x56e88b,_0x46bcd8){request(_0x586e21)[_0xb96e('0x2f')](function(_0x16e19e){var _0x79af5c=null;if(_0x16e19e){_0x79af5c=_0x16e19e[_0xb96e('0x47')][0x0];_0x79af5c[_0xb96e('0x48')]=_0x15b6f7;}_0x56e88b(_0x79af5c);})['catch'](function(_0x55fe94){_0x46bcd8(_0x55fe94);});});}function createEndUser(_0x21532d,_0x32ccab,_0x4e5171,_0x66004,_0x3de856,_0x5bc9a4){var _0x4e5171=getName(_0x4e5171);return request({'method':_0xb96e('0x2b'),'uri':_0xb96e('0x49')+_0x32ccab+_0xb96e('0x4a')+_['startCase'](_0x5bc9a4[_0xb96e('0x4b')])+'s','body':{'data':[{'Last_Name':_0x4e5171[0x1],'First_Name':_0x4e5171[0x0],'Phone':_0x66004,'Owner':{'name':!_[_0xb96e('0x22')](_0x3de856[_0xb96e('0x4c')][_0xb96e('0x1e')])?_0x3de856[_0xb96e('0x4c')]['name']:!_['isNil'](_0x3de856[_0xb96e('0x4d')])?_0x3de856[_0xb96e('0x4d')]+'\x20'+_0x3de856['last_name']:_0x3de856[_0xb96e('0x4e')],'id':_0x3de856['id']}}]},'headers':{'Authorization':_0xb96e('0x3b')+_0x21532d},'json':!![]})[_0xb96e('0x2f')](function(_0x534651){if(_0x534651&&_0x534651[_0xb96e('0x47')][0x0][_0xb96e('0x4f')]==='SUCCESS'){var _0x1d5f84=_0x534651[_0xb96e('0x47')][0x0][_0xb96e('0x50')];_0x1d5f84[_0xb96e('0x48')]=_[_0xb96e('0x51')](_0x5bc9a4[_0xb96e('0x4b')])+'s';return _0x1d5f84;}logger[_0xb96e('0x32')](_0xb96e('0x44'),JSON[_0xb96e('0x45')](data));throw new Error(_0xb96e('0x52')+JSON[_0xb96e('0x45')](data));})[_0xb96e('0x31')](function(_0x569bc5){console[_0xb96e('0x53')]('CREATE\x20ERROR',_0x569bc5);});}function getEndUser(_0x284e08,_0x3b5133,_0x1d43a5,_0xddfb3a,_0x540857,_0x3ba420,_0x5b67df){var _0xb990dc={'method':_0xb96e('0x37'),'uri':'','headers':{'Authorization':_0xb96e('0x3b')+_0x284e08},'json':!![]};switch(_0x5b67df[_0xb96e('0x54')]){case _0xb96e('0x55'):_0xb990dc[_0xb96e('0x56')]=_0xb96e('0x49')+_0x3b5133+_0xb96e('0x57')+_0x540857+'))';return getZohoUser(_0xb990dc,'Contacts')[_0xb96e('0x2f')](function(_0x17e694){if(_0x17e694)return _0x17e694;_0xb990dc[_0xb96e('0x56')]=_0xb96e('0x49')+_0x3b5133+_0xb96e('0x58')+_0x540857+'))';return getZohoUser(_0xb990dc,'Leads')[_0xb96e('0x2f')](function(_0x3928ab){if(_0x3928ab)return _0x3928ab;if(_0x5b67df['moduleCreate']!=_0xb96e('0x59')){return createEndUser(_0x284e08,_0x3b5133,_0xddfb3a,_0x540857,_0x3ba420,_0x5b67df);}else{return{};}});});break;case _0xb96e('0x5a'):_0xb990dc[_0xb96e('0x56')]=_0xb96e('0x49')+_0x3b5133+_0xb96e('0x57')+_0x540857+'))';return getZohoUser(_0xb990dc,_0xb96e('0x5b'))['then'](function(_0x2aeee1){if(_0x2aeee1)return _0x2aeee1;if(_0x5b67df['moduleCreate']!='nothing'){return createEndUser(_0x284e08,_0x3b5133,_0xddfb3a,_0x540857,_0x3ba420,_0x5b67df);}else{return{};}});break;case _0xb96e('0x5c'):_0xb990dc[_0xb96e('0x56')]=_0xb96e('0x49')+_0x3b5133+_0xb96e('0x58')+_0x540857+'))';return getZohoUser(_0xb990dc,_0xb96e('0x5d'))[_0xb96e('0x2f')](function(_0x2742f0){if(_0x2742f0)return _0x2742f0;if(_0x5b67df['moduleCreate']!=_0xb96e('0x59')){return createEndUser(_0x284e08,_0x3b5133,_0xddfb3a,_0x540857,_0x3ba420,_0x5b67df);}else{return{};}});break;}}function getCall(_0xc820ef,_0x1e41c1,_0xa5f580,_0x59650b,_0x417973,_0x271b34,_0x59d960,_0x152905){logger[_0xb96e('0x35')](_0xb96e('0x5e'));var _0x36acbe={};_0x36acbe[_0xb96e('0x5f')]={'name':!_[_0xb96e('0x22')](_0x59650b[_0xb96e('0x4c')]['name'])&&!_['isNil'](_0x59650b[_0xb96e('0x41')]['name'])&&_0x59650b[_0xb96e('0x41')][_0xb96e('0x1e')]===_0xb96e('0x60')?_0x59650b[_0xb96e('0x4c')][_0xb96e('0x1e')]:!_[_0xb96e('0x22')](_0x59650b[_0xb96e('0x4d')])?_0x59650b[_0xb96e('0x4d')]+'\x20'+_0x59650b[_0xb96e('0x4e')]:_0x59650b[_0xb96e('0x4e')],'id':_0x59650b['id']};_0x36acbe['Subject']=intUtil['getString'](_0x271b34[_0xb96e('0x61')],_0x59d960,'\x20');_0x36acbe[_0xb96e('0x62')]=intUtil['getString'](_0x271b34[_0xb96e('0x63')],_0x59d960,'\x0a');if(_0x417973[_0xb96e('0x48')]===_0xb96e('0x5b')){_0x36acbe[_0xb96e('0x64')]={'name':!_[_0xb96e('0x22')](_0x417973[_0xb96e('0x65')])?_0x417973['Full_Name']:!_[_0xb96e('0x22')](_0x417973[_0xb96e('0x66')])?_0x417973['First_Name']+'\x20'+_0x417973[_0xb96e('0x67')]:_0x417973[_0xb96e('0x67')],'id':_0x417973['id']};}if(_0x417973[_0xb96e('0x48')]==='Leads'){_0x36acbe[_0xb96e('0x68')]={'name':!_['isNil'](_0x417973[_0xb96e('0x65')])?_0x417973[_0xb96e('0x65')]:!_[_0xb96e('0x22')](_0x417973['First_Name'])?_0x417973[_0xb96e('0x66')]+'\x20'+_0x417973['Last_Name']:_0x417973[_0xb96e('0x67')],'id':_0x417973['id']};_0x36acbe['$se_module']=_[_0xb96e('0x51')](_0x417973[_0xb96e('0x48')]);}if(_0x59d960[_0xb96e('0x69')]){_0x36acbe[_0xb96e('0x6a')]=moment[_0xb96e('0x6b')](parseInt(_0x59d960['talktime'])*0x3e8)[_0xb96e('0x38')](_0xb96e('0x6c'));}else if(_0x59d960[_0xb96e('0x6d')]&&_0x59d960[_0xb96e('0x6e')]){_0x36acbe[_0xb96e('0x6a')]=moment[_0xb96e('0x6b')](moment(_0x59d960[_0xb96e('0x6e')],_0xb96e('0x6f'))['diff'](moment(_0x59d960[_0xb96e('0x70')],_0xb96e('0x6f'))))['format']('mm:ss');}switch(_0x59d960['lastevent']){case'called':_0x36acbe[_0xb96e('0x71')]=_0xb96e('0x72');break;case'complete':case _0xb96e('0x73'):_0x36acbe[_0xb96e('0x71')]=_0xb96e('0x74');break;case _0xb96e('0x75'):_0x36acbe['Call_Result']=_0xb96e('0x76');break;case _0xb96e('0x77'):_0x36acbe['Call_Result']=_0xb96e('0x78');break;case _0xb96e('0x79'):_0x36acbe[_0xb96e('0x71')]=_0xb96e('0x7a');default:}_0x36acbe[_0xb96e('0x7b')]=(_0x152905===_0xb96e('0x7c')?moment(_0x59d960[_0xb96e('0x70')])['format'](_0xb96e('0x6f')):moment(_0x59d960['agentcalledAt'])[_0xb96e('0x38')](_0xb96e('0x6f')))||moment()['format'](_0xb96e('0x6f'));_0x36acbe[_0xb96e('0x7d')]=_0x152905||_0xb96e('0x7e');_0x36acbe=_[_0xb96e('0x7f')](_0x36acbe,getCustomFields(_0x271b34[_0xb96e('0x80')],_0x59d960));return request({'method':_0xb96e('0x2b'),'uri':'https://www.zohoapis.'+_0x1e41c1+_0xb96e('0x81'),'headers':{'Authorization':_0xb96e('0x3b')+_0xc820ef},'body':{'data':[_0x36acbe]},'json':!![]})['then'](function(_0x48a772){if(_0x48a772&&_0x48a772[_0xb96e('0x47')][0x0][_0xb96e('0x4f')]==='SUCCESS'){logger['info'](_0xb96e('0x82'));return{'id':_0x48a772['data'][0x0][_0xb96e('0x50')]['id']};}})[_0xb96e('0x31')](function(_0x1b70bc){logger[_0xb96e('0x35')]('err',_0x1b70bc['stack']);console[_0xb96e('0x53')](_0xb96e('0x83'),_0x1b70bc);});}exports[_0xb96e('0x84')]=function(_0x525cb8,_0x1f3332,_0x5f462b,_0x5e3de6,_0x261af9,_0x2b21da){var _0x506265,_0x521e9e,_0x1645c3;_0x2b21da[_0xb96e('0x85')]=intUtil[_0xb96e('0x86')](_0x2b21da[_0xb96e('0x85')]);_0x2b21da['serverUrl']=intUtil[_0xb96e('0x86')](_0x2b21da[_0xb96e('0x87')]);if(_0x261af9&&_0x261af9[_0xb96e('0x88')]){logger[_0xb96e('0x35')](_0xb96e('0x89'),_0xb96e('0x8a'));_0x1f3332['recordingURL']=_0x2b21da[_0xb96e('0x87')]+_0xb96e('0x8b')+_0x1f3332[_0xb96e('0x8c')]+_0xb96e('0x8d')+md5(_0x1f3332['uniqueid']);}else{_0x1f3332[_0xb96e('0x8e')]='';}var _0x3b175a=_0x2b21da[_0xb96e('0x85')]===_0xb96e('0x8f')?'eu':_0xb96e('0x90');return getAccessToken(_0x2b21da)[_0xb96e('0x2f')](function(_0x5ef1d5){_0x1645c3=_0x5ef1d5;return getUser(_0x1645c3,_0x3b175a,_0x2b21da,_0x5e3de6[_0xb96e('0x3e')]);})[_0xb96e('0x2f')](function(_0x1a80d2){_0x506265=_0x1a80d2;logger['info'](_0xb96e('0x91'),_0x506265['id']);return getEndUser(_0x1645c3,_0x3b175a,_0x2b21da,_0x1f3332[_0xb96e('0x92')],_0x1f3332[_0xb96e('0x93')],_0x506265,_0x5f462b);})[_0xb96e('0x2f')](function(_0x55ccff){_0x521e9e=_0x55ccff;return getCall(_0x1645c3,_0x3b175a,_0x2b21da,_0x506265,_0x521e9e,_0x5f462b,_0x1f3332,_0xb96e('0x7e'));})[_0xb96e('0x2f')](function(_0x283e91){if(_0x283e91){logger['info'](_0xb96e('0x94'),_0x283e91['id']);logger[_0xb96e('0x35')](_0xb96e('0x89'),_0xb96e('0x95'));emit(util[_0xb96e('0x38')](_0xb96e('0x96'),_0x5e3de6['name']),_0xb96e('0x97'),{'uri':'https://crm.'+_0x2b21da['host']+'/crm/EntityInfo.do?module=Calls&id='+_0x283e91['id']});}})['catch'](function(_0x16e2ac){logger[_0xb96e('0x32')]('[QUEUE]',JSON[_0xb96e('0x45')](_0x16e2ac));});};exports[_0xb96e('0x7c')]=function(_0x515535,_0x3580e8,_0x3f8d54,_0x396936,_0x3e6849,_0x4f62ff,_0x34fdfe){var _0x680952,_0x211c4c,_0x1c7872;_0x4f62ff[_0xb96e('0x85')]=intUtil[_0xb96e('0x86')](_0x4f62ff[_0xb96e('0x85')]);_0x4f62ff[_0xb96e('0x87')]=intUtil['stripTrailingSlash'](_0x4f62ff[_0xb96e('0x87')]);if(_0x34fdfe&&_0x34fdfe['recordingFormat']&&_0x34fdfe[_0xb96e('0x98')]!==_0xb96e('0x99')){logger[_0xb96e('0x35')](_0xb96e('0x9a'),_0xb96e('0x8a'));_0x3580e8[_0xb96e('0x8e')]=_0x4f62ff[_0xb96e('0x87')]+'/api/voice/recordings/'+_0x3580e8[_0xb96e('0x8c')]+_0xb96e('0x8d')+md5(_0x3580e8[_0xb96e('0x8c')]);}var _0x4b9ce9=_0x4f62ff[_0xb96e('0x85')]===_0xb96e('0x8f')?'eu':_0xb96e('0x90');return getAccessToken(_0x4f62ff)[_0xb96e('0x2f')](function(_0x3d5f7d){_0x1c7872=_0x3d5f7d;return getUser(_0x1c7872,_0x4b9ce9,_0x4f62ff,_0x396936['email']);})[_0xb96e('0x2f')](function(_0x38e448){_0x680952=_0x38e448;logger[_0xb96e('0x35')]('The\x20User\x20ID\x20is:',_0x680952['id']);return getEndUser(_0x1c7872,_0x4b9ce9,_0x4f62ff,_0x3580e8[_0xb96e('0x9b')],_0x3580e8[_0xb96e('0x9c')],_0x680952,_0x3f8d54);})[_0xb96e('0x2f')](function(_0x11a5ba){_0x211c4c=_0x11a5ba;return getCall(_0x1c7872,_0x4b9ce9,_0x4f62ff,_0x680952,_0x211c4c,_0x3f8d54,_0x3580e8,_0xb96e('0x9d'));})[_0xb96e('0x2f')](function(_0x2399ad){if(_0x2399ad){logger['info'](_0xb96e('0x94'),_0x2399ad['id']);logger[_0xb96e('0x35')](_0xb96e('0x9a'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0xb96e('0x96'),_0x396936['name']),_0xb96e('0x97'),{'uri':_0xb96e('0x9e')+_0x4f62ff[_0xb96e('0x85')]+_0xb96e('0x9f')+_0x2399ad['id']});}})['catch'](function(_0xfd7d43){logger['error'](_0xb96e('0x9a'),JSON[_0xb96e('0x45')](_0xfd7d43));});};exports[_0xb96e('0xa0')]=function(_0x42bfdb,_0xc57645,_0x31ff81,_0x1024e7,_0x27d169,_0x3ff37c){var _0xb1e16e,_0x41eb30,_0x57d719;_0x3ff37c[_0xb96e('0x85')]=intUtil['stripTrailingSlash'](_0x3ff37c[_0xb96e('0x85')]);_0x3ff37c[_0xb96e('0x87')]=intUtil[_0xb96e('0x86')](_0x3ff37c[_0xb96e('0x87')]);if(_0x27d169&&_0x27d169[_0xb96e('0x88')]){logger[_0xb96e('0x35')]('['+_0xc57645[_0xb96e('0xa1')][_0xb96e('0xa2')]()+']','Recording\x20is\x20enabled!');_0xc57645[_0xb96e('0x8e')]=_0x3ff37c['serverUrl']+_0xb96e('0x8b')+_0xc57645['uniqueid']+_0xb96e('0x8d')+md5(_0xc57645[_0xb96e('0x8c')]);}else{_0xc57645[_0xb96e('0x8e')]='';}var _0x4aece7=_0x3ff37c[_0xb96e('0x85')]===_0xb96e('0x8f')?'eu':'com';return getAccessToken(_0x3ff37c)[_0xb96e('0x2f')](function(_0x520396){_0x57d719=_0x520396;return getUser(_0x57d719,_0x4aece7,_0x3ff37c);})[_0xb96e('0x2f')](function(_0x56ba81){_0xb1e16e=_0x56ba81;logger[_0xb96e('0x35')](_0xb96e('0x91'),_0xb1e16e['id']);return getEndUser(_0x57d719,_0x4aece7,_0x3ff37c,_0xc57645[_0xb96e('0x92')],_0xc57645[_0xb96e('0x93')],_0xb1e16e,_0x31ff81);})[_0xb96e('0x2f')](function(_0x4467c3){_0x41eb30=_0x4467c3;return getCall(_0x57d719,_0x4aece7,_0x3ff37c,_0xb1e16e,_0x41eb30,_0x31ff81,_0xc57645,_0xb96e('0x7e'));})[_0xb96e('0x2f')](function(_0x42e56e){if(_0x42e56e){logger[_0xb96e('0x35')](_0xb96e('0x94'),_0x42e56e['id']);}})[_0xb96e('0x31')](function(_0x33b0b8){logger[_0xb96e('0x32')]('['+_0xc57645[_0xb96e('0xa1')]['toUpperCase']()+']',JSON[_0xb96e('0x45')](_0x33b0b8));});}; \ No newline at end of file +var _0xf65e=['profile','Administrator','user','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','The\x20failing\x20result\x20is','data','enduserType','startCase','moduleCreate','role','first_name','last_name','code','SUCCESS','details','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','then','https://www.zohoapis.','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','contact','nothing','lead','Creating\x20new\x20call...','Owner','getString','Subjects','Description','Descriptions','Full_Name','Last_Name','What_Id','First_Name','$se_module','talktime','Call_Duration','utc','endtime','YYYY-MM-DDTHH:mm:ss','diff','mm:ss','lastevent','Called','complete','connect','Call_Result','Answered','rejected','Rejected','Abandoned','timeout','Timeout','outbound','starttime','agentcalledAt','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','Call\x20created!','err','queue','host','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','/downloads?type=uniqueid&token=','uniqueid','com','email','calleridname','calleridnum','The\x20Call\x20ID\x20is:','user:%s','trigger:browser:url','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','zoho.eu','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Outbound','[OUTBOUND]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','https://crm.','unmanaged','toUpperCase','lodash','md5','util','moment','ioredis','bluebird','zoho','redis','localhost','socket.io-emitter','emit','[HTTP]','stringify','forEach','includes','picklist','type','idField','toString','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','isBefore','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refresh_token','access_token','add','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','format','ActiveUsers','users','findIndex','Agent\x20found!','Using\x20the\x20admin\x20account!'];(function(_0x5267db,_0x2f34a2){var _0x53f050=function(_0x4438bf){while(--_0x4438bf){_0x5267db['push'](_0x5267db['shift']());}};_0x53f050(++_0x2f34a2);}(_0xf65e,0xfa));var _0xef65=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf65e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xef65('0x0'));var rp=require('request-promise');var md5=require(_0xef65('0x1'));var util=require(_0xef65('0x2'));var intUtil=require('./util');var moment=require(_0xef65('0x3'));var Redis=require(_0xef65('0x4'));var BPromise=require(_0xef65('0x5'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0xef65('0x6'));config['redis']=_['defaults'](config[_0xef65('0x7')],{'host':_0xef65('0x8'),'port':0x18eb});var io=require(_0xef65('0x9'))(new Redis(config['redis']));function emit(_0x5bf763,_0x5f5687,_0x3f4765){io['to'](_0x5bf763)[_0xef65('0xa')](_0x5f5687,_0x3f4765);}function request(_0x42aa8d){logger['debug'](_0xef65('0xb'),JSON[_0xef65('0xc')](_0x42aa8d));return rp(_0x42aa8d);}function getCustomFields(_0x1c26de,_0x16d049){var _0x5a5ead={};if(_0x1c26de['length']>0x0){_[_0xef65('0xd')](_0x1c26de,function(_0x40d2b9){if(_[_0xef65('0xe')](['string',_0xef65('0xf')],_0x40d2b9[_0xef65('0x10')])&&_0x40d2b9[_0xef65('0x11')]){_0x5a5ead[_0x40d2b9['idField']]=_0x40d2b9['content'][_0xef65('0x12')]();}else if(_0x40d2b9[_0xef65('0x10')]===_0xef65('0x13')&&_0x40d2b9[_0xef65('0x14')]&&_0x40d2b9[_0xef65('0x11')]&&_0x16d049[_0x40d2b9[_0xef65('0x14')]]){_0x5a5ead[_0x40d2b9[_0xef65('0x11')]]=_0x16d049[_0x40d2b9[_0xef65('0x14')]][_0xef65('0x12')]();}else if(_0x40d2b9['type']===_0xef65('0x15')&&_0x40d2b9[_0xef65('0x16')]&&_0x40d2b9['Variable'][_0xef65('0x17')]&&_0x40d2b9[_0xef65('0x11')]&&_0x16d049[_0x40d2b9[_0xef65('0x16')][_0xef65('0x17')]['toLowerCase']()]){_0x5a5ead[_0x40d2b9[_0xef65('0x11')]]=_0x16d049[_0x40d2b9[_0xef65('0x16')]['name'][_0xef65('0x18')]()][_0xef65('0x12')]();}});}return _0x5a5ead;}function getName(_0x4e2100){if(_0x4e2100[_0xef65('0x19')]('\x20')>0x0){var _0x674e94=_0x4e2100[_0xef65('0x1a')](/ (.+)/);if(_0x674e94[0x1]){return _0x674e94;}}return[_0x4e2100,_0x4e2100];}var accountsTokens={};function getAccessToken(_0x247bb8){return new Promise(function(_0x2c7872,_0x234d3d){if(!_[_0xef65('0x1b')](accountsTokens[_0x247bb8['id']])&&!_['isNil'](accountsTokens[_0x247bb8['id']]['access_token'])){if(moment()[_0xef65('0x1c')](accountsTokens[_0x247bb8['id']]['expires_in'])){_0x2c7872(accountsTokens[_0x247bb8['id']]['access_token']);}}var _0xae26af;switch(_0x247bb8['zone']){case'US':_0xae26af=_0xef65('0x1d');break;case'AU':_0xae26af=_0xef65('0x1e');break;case'EU':_0xae26af=_0xef65('0x1f');break;case'IN':_0xae26af=_0xef65('0x20');break;case'CN':_0xae26af=_0xef65('0x21');break;default:_0xae26af=_0xef65('0x1f');break;}var _0x143f47={'method':_0xef65('0x22'),'uri':_0xae26af+_0xef65('0x23'),'qs':{'refresh_token':_0x247bb8['refreshToken'],'client_id':_0x247bb8['clientId'],'client_secret':_0x247bb8['clientSecret'],'grant_type':_0xef65('0x24')},'json':!![]};return rp(_0x143f47)['then'](function(_0x128dca){accountsTokens[_0x247bb8['id']]={'access_token':_0x128dca[_0xef65('0x25')],'expires_in':moment()[_0xef65('0x26')](_0x128dca['expires_in'],'seconds')};_0x2c7872(_0x128dca[_0xef65('0x25')]);})[_0xef65('0x27')](function(_0x5c16db){logger[_0xef65('0x28')](_0xef65('0x29'),_0x5c16db[_0xef65('0x2a')]);_0x234d3d(_0x5c16db);});});}function getUser(_0x4f5b92,_0x2fc751,_0x213376,_0x47f7d2){logger[_0xef65('0x2b')](_0xef65('0x2c'));return request({'method':_0xef65('0x2d'),'uri':util[_0xef65('0x2e')]('https://www.zohoapis.%s/crm/v2/users',_0x2fc751),'qs':{'type':_0xef65('0x2f')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x4f5b92},'json':!![]})['then'](function(_0x1b7571){if(_0x1b7571[_0xef65('0x30')]){var _0x5b74b5=-0x1;if(_['isArrayLikeObject'](_0x1b7571[_0xef65('0x30')])){if(!_[_0xef65('0x1b')](_0x47f7d2)){_0x5b74b5=_[_0xef65('0x31')](_0x1b7571[_0xef65('0x30')],function(_0x112063){return _0x112063['email']===_0x47f7d2;});}if(_0x5b74b5>=0x0){logger['info'](_0xef65('0x32'));}else{logger[_0xef65('0x2b')](_0xef65('0x33'));_0x5b74b5=_[_0xef65('0x31')](_0x1b7571[_0xef65('0x30')],function(_0x52e9cf){return _0x52e9cf[_0xef65('0x34')]['name']===_0xef65('0x35');});}return _0x1b7571[_0xef65('0x30')][_0x5b74b5];}else{if(_0x1b7571[_0xef65('0x36')]['profile']['name']==='Administrator'){logger[_0xef65('0x2b')]('Using\x20the\x20admin\x20account!');user=_0x1b7571['user'];return user;}else{logger[_0xef65('0x28')]('The\x20failing\x20result\x20is',JSON[_0xef65('0xc')](_0x1b7571));throw new Error(_0xef65('0x37')+JSON[_0xef65('0xc')](_0x1b7571));}}}else{logger[_0xef65('0x28')](_0xef65('0x38'),JSON['stringify'](_0x1b7571));throw new Error(_0xef65('0x37')+JSON[_0xef65('0xc')](_0x1b7571));}})['catch'](function(_0x431a0a){console[_0xef65('0x28')](_0x431a0a);});}function getZohoUser(_0x3d7a51,_0xcae97){return new BPromise(function(_0x5d5a41,_0x17e42d){request(_0x3d7a51)['then'](function(_0x4069e3){var _0x37019c=null;if(_0x4069e3){_0x37019c=_0x4069e3[_0xef65('0x39')][0x0];_0x37019c[_0xef65('0x3a')]=_0xcae97;}_0x5d5a41(_0x37019c);})[_0xef65('0x27')](function(_0x14a63a){_0x17e42d(_0x14a63a);});});}function createEndUser(_0x7e9026,_0x486c28,_0x330510,_0x29d451,_0x159c9d,_0x27cf4a){var _0x330510=getName(_0x330510);return request({'method':_0xef65('0x22'),'uri':'https://www.zohoapis.'+_0x486c28+'/crm/v2/'+_[_0xef65('0x3b')](_0x27cf4a[_0xef65('0x3c')])+'s','body':{'data':[{'Last_Name':_0x330510[0x1],'First_Name':_0x330510[0x0],'Phone':_0x29d451,'Owner':{'name':!_[_0xef65('0x1b')](_0x159c9d[_0xef65('0x3d')][_0xef65('0x17')])?_0x159c9d[_0xef65('0x3d')][_0xef65('0x17')]:!_[_0xef65('0x1b')](_0x159c9d[_0xef65('0x3e')])?_0x159c9d[_0xef65('0x3e')]+'\x20'+_0x159c9d[_0xef65('0x3f')]:_0x159c9d[_0xef65('0x3f')],'id':_0x159c9d['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x7e9026},'json':!![]})['then'](function(_0x2461f4){if(_0x2461f4&&_0x2461f4[_0xef65('0x39')][0x0][_0xef65('0x40')]===_0xef65('0x41')){var _0x5863f5=_0x2461f4[_0xef65('0x39')][0x0][_0xef65('0x42')];_0x5863f5['enduserType']=_[_0xef65('0x3b')](_0x27cf4a[_0xef65('0x3c')])+'s';return _0x5863f5;}logger[_0xef65('0x28')]('The\x20failing\x20result\x20is',JSON[_0xef65('0xc')](data));throw new Error('Error:\x20'+JSON['stringify'](data));})[_0xef65('0x27')](function(_0x3676d3){console[_0xef65('0x43')](_0xef65('0x44'),_0x3676d3);});}function getEndUser(_0x4e3a5d,_0x47be69,_0x283b15,_0x934acc,_0x233ef3,_0x5a4ab1,_0x320931){var _0x3b5038={'method':_0xef65('0x2d'),'uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x4e3a5d},'json':!![]};switch(_0x320931[_0xef65('0x45')]){case _0xef65('0x46'):_0x3b5038[_0xef65('0x47')]='https://www.zohoapis.'+_0x47be69+_0xef65('0x48')+_0x233ef3+'))';return getZohoUser(_0x3b5038,_0xef65('0x49'))[_0xef65('0x4a')](function(_0x1eedb9){if(_0x1eedb9)return _0x1eedb9;_0x3b5038[_0xef65('0x47')]=_0xef65('0x4b')+_0x47be69+_0xef65('0x4c')+_0x233ef3+'))';return getZohoUser(_0x3b5038,_0xef65('0x4d'))[_0xef65('0x4a')](function(_0x6901f4){if(_0x6901f4)return _0x6901f4;if(_0x320931[_0xef65('0x3c')]!='nothing'){return createEndUser(_0x4e3a5d,_0x47be69,_0x934acc,_0x233ef3,_0x5a4ab1,_0x320931);}else{return{};}});});break;case _0xef65('0x4e'):_0x3b5038[_0xef65('0x47')]=_0xef65('0x4b')+_0x47be69+_0xef65('0x48')+_0x233ef3+'))';return getZohoUser(_0x3b5038,_0xef65('0x49'))['then'](function(_0x53021b){if(_0x53021b)return _0x53021b;if(_0x320931[_0xef65('0x3c')]!=_0xef65('0x4f')){return createEndUser(_0x4e3a5d,_0x47be69,_0x934acc,_0x233ef3,_0x5a4ab1,_0x320931);}else{return{};}});break;case _0xef65('0x50'):_0x3b5038['uri']='https://www.zohoapis.'+_0x47be69+_0xef65('0x4c')+_0x233ef3+'))';return getZohoUser(_0x3b5038,_0xef65('0x4d'))[_0xef65('0x4a')](function(_0x42c290){if(_0x42c290)return _0x42c290;if(_0x320931['moduleCreate']!=_0xef65('0x4f')){return createEndUser(_0x4e3a5d,_0x47be69,_0x934acc,_0x233ef3,_0x5a4ab1,_0x320931);}else{return{};}});break;}}function getCall(_0x4e701b,_0x4f1f3c,_0x268e9f,_0x17e8ef,_0x3a41c2,_0x5540c0,_0x243ae0,_0x41e366){logger[_0xef65('0x2b')](_0xef65('0x51'));var _0x40d94f={};_0x40d94f[_0xef65('0x52')]={'name':!_['isNil'](_0x17e8ef[_0xef65('0x3d')][_0xef65('0x17')])&&!_[_0xef65('0x1b')](_0x17e8ef[_0xef65('0x34')][_0xef65('0x17')])&&_0x17e8ef[_0xef65('0x34')][_0xef65('0x17')]==='administrator'?_0x17e8ef['role'][_0xef65('0x17')]:!_[_0xef65('0x1b')](_0x17e8ef[_0xef65('0x3e')])?_0x17e8ef[_0xef65('0x3e')]+'\x20'+_0x17e8ef[_0xef65('0x3f')]:_0x17e8ef['last_name'],'id':_0x17e8ef['id']};_0x40d94f['Subject']=intUtil[_0xef65('0x53')](_0x5540c0[_0xef65('0x54')],_0x243ae0,'\x20');_0x40d94f[_0xef65('0x55')]=intUtil['getString'](_0x5540c0[_0xef65('0x56')],_0x243ae0,'\x0a');if(_0x3a41c2[_0xef65('0x3a')]===_0xef65('0x49')){_0x40d94f['Who_Id']={'name':!_[_0xef65('0x1b')](_0x3a41c2[_0xef65('0x57')])?_0x3a41c2['Full_Name']:!_[_0xef65('0x1b')](_0x3a41c2['First_Name'])?_0x3a41c2['First_Name']+'\x20'+_0x3a41c2['Last_Name']:_0x3a41c2[_0xef65('0x58')],'id':_0x3a41c2['id']};}if(_0x3a41c2[_0xef65('0x3a')]===_0xef65('0x4d')){_0x40d94f[_0xef65('0x59')]={'name':!_[_0xef65('0x1b')](_0x3a41c2[_0xef65('0x57')])?_0x3a41c2[_0xef65('0x57')]:!_[_0xef65('0x1b')](_0x3a41c2['First_Name'])?_0x3a41c2[_0xef65('0x5a')]+'\x20'+_0x3a41c2['Last_Name']:_0x3a41c2[_0xef65('0x58')],'id':_0x3a41c2['id']};_0x40d94f[_0xef65('0x5b')]=_[_0xef65('0x3b')](_0x3a41c2[_0xef65('0x3a')]);}if(_0x243ae0[_0xef65('0x5c')]){_0x40d94f[_0xef65('0x5d')]=moment[_0xef65('0x5e')](parseInt(_0x243ae0[_0xef65('0x5c')])*0x3e8)['format']('mm:ss');}else if(_0x243ae0['answertime']&&_0x243ae0[_0xef65('0x5f')]){_0x40d94f[_0xef65('0x5d')]=moment[_0xef65('0x5e')](moment(_0x243ae0['endtime'],_0xef65('0x60'))[_0xef65('0x61')](moment(_0x243ae0['starttime'],_0xef65('0x60'))))[_0xef65('0x2e')](_0xef65('0x62'));}switch(_0x243ae0[_0xef65('0x63')]){case'called':_0x40d94f['Call_Result']=_0xef65('0x64');break;case _0xef65('0x65'):case _0xef65('0x66'):_0x40d94f[_0xef65('0x67')]=_0xef65('0x68');break;case _0xef65('0x69'):_0x40d94f[_0xef65('0x67')]=_0xef65('0x6a');break;case'abandoned':_0x40d94f[_0xef65('0x67')]=_0xef65('0x6b');break;case _0xef65('0x6c'):_0x40d94f['Call_Result']=_0xef65('0x6d');default:}_0x40d94f['Call_Start_Time']=(_0x41e366===_0xef65('0x6e')?moment(_0x243ae0[_0xef65('0x6f')])['format'](_0xef65('0x60')):moment(_0x243ae0[_0xef65('0x70')])['format']('YYYY-MM-DDTHH:mm:ss'))||moment()[_0xef65('0x2e')]('YYYY-MM-DDTHH:mm:ss');_0x40d94f[_0xef65('0x71')]=_0x41e366||_0xef65('0x72');_0x40d94f=_[_0xef65('0x73')](_0x40d94f,getCustomFields(_0x5540c0[_0xef65('0x74')],_0x243ae0));return request({'method':_0xef65('0x22'),'uri':'https://www.zohoapis.'+_0x4f1f3c+_0xef65('0x75'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x4e701b},'body':{'data':[_0x40d94f]},'json':!![]})['then'](function(_0x57eaeb){if(_0x57eaeb&&_0x57eaeb[_0xef65('0x39')][0x0][_0xef65('0x40')]===_0xef65('0x41')){logger[_0xef65('0x2b')](_0xef65('0x76'));return{'id':_0x57eaeb['data'][0x0]['details']['id']};}})[_0xef65('0x27')](function(_0x2f009b){logger[_0xef65('0x2b')](_0xef65('0x77'),_0x2f009b['stack']);console[_0xef65('0x43')](_0xef65('0x77'),_0x2f009b);});}exports[_0xef65('0x78')]=function(_0x778b35,_0x3c4486,_0xbb741,_0x4f97f5,_0x13d173,_0x2086c8){var _0x129ebf,_0x5ed12f,_0x23ca83;_0x2086c8['host']=intUtil['stripTrailingSlash'](_0x2086c8[_0xef65('0x79')]);_0x2086c8[_0xef65('0x7a')]=intUtil[_0xef65('0x7b')](_0x2086c8[_0xef65('0x7a')]);if(_0x13d173&&_0x13d173[_0xef65('0x7c')]){logger[_0xef65('0x2b')](_0xef65('0x7d'),_0xef65('0x7e'));_0x3c4486[_0xef65('0x7f')]=_0x2086c8['serverUrl']+_0xef65('0x80')+_0x3c4486['uniqueid']+_0xef65('0x81')+md5(_0x3c4486[_0xef65('0x82')]);}else{_0x3c4486['recordingURL']='';}var _0x4c2df1=_0x2086c8[_0xef65('0x79')]==='zoho.eu'?'eu':_0xef65('0x83');return getAccessToken(_0x2086c8)[_0xef65('0x4a')](function(_0x36cc5e){_0x23ca83=_0x36cc5e;return getUser(_0x23ca83,_0x4c2df1,_0x2086c8,_0x4f97f5[_0xef65('0x84')]);})['then'](function(_0x5ed660){_0x129ebf=_0x5ed660;logger['info']('The\x20User\x20ID\x20is:',_0x129ebf['id']);return getEndUser(_0x23ca83,_0x4c2df1,_0x2086c8,_0x3c4486[_0xef65('0x85')],_0x3c4486[_0xef65('0x86')],_0x129ebf,_0xbb741);})[_0xef65('0x4a')](function(_0x3d6c1a){_0x5ed12f=_0x3d6c1a;return getCall(_0x23ca83,_0x4c2df1,_0x2086c8,_0x129ebf,_0x5ed12f,_0xbb741,_0x3c4486,_0xef65('0x72'));})[_0xef65('0x4a')](function(_0x320ae6){if(_0x320ae6){logger[_0xef65('0x2b')](_0xef65('0x87'),_0x320ae6['id']);logger[_0xef65('0x2b')]('[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0xef65('0x88'),_0x4f97f5[_0xef65('0x17')]),_0xef65('0x89'),{'uri':'https://crm.'+_0x2086c8[_0xef65('0x79')]+_0xef65('0x8a')+_0x320ae6['id']});}})['catch'](function(_0xa87d11){logger[_0xef65('0x28')]('[QUEUE]',JSON[_0xef65('0xc')](_0xa87d11));});};exports['outbound']=function(_0xe43e4c,_0x606023,_0x5c3152,_0x1a36ae,_0x539bcb,_0x1aa2db,_0x51fed){var _0x4a1142,_0x296488,_0x121bf8;_0x1aa2db[_0xef65('0x79')]=intUtil[_0xef65('0x7b')](_0x1aa2db[_0xef65('0x79')]);_0x1aa2db['serverUrl']=intUtil[_0xef65('0x7b')](_0x1aa2db[_0xef65('0x7a')]);if(_0x51fed&&_0x51fed[_0xef65('0x8b')]&&_0x51fed['recordingFormat']!==_0xef65('0x8c')){logger[_0xef65('0x2b')]('[OUTBOUND]',_0xef65('0x7e'));_0x606023[_0xef65('0x7f')]=_0x1aa2db[_0xef65('0x7a')]+_0xef65('0x80')+_0x606023[_0xef65('0x82')]+_0xef65('0x81')+md5(_0x606023['uniqueid']);}var _0x267208=_0x1aa2db[_0xef65('0x79')]===_0xef65('0x8d')?'eu':_0xef65('0x83');return getAccessToken(_0x1aa2db)[_0xef65('0x4a')](function(_0xe972b3){_0x121bf8=_0xe972b3;return getUser(_0x121bf8,_0x267208,_0x1aa2db,_0x1a36ae[_0xef65('0x84')]);})[_0xef65('0x4a')](function(_0x3bb2bd){_0x4a1142=_0x3bb2bd;logger['info'](_0xef65('0x8e'),_0x4a1142['id']);return getEndUser(_0x121bf8,_0x267208,_0x1aa2db,_0x606023[_0xef65('0x8f')],_0x606023[_0xef65('0x90')],_0x4a1142,_0x5c3152);})['then'](function(_0x35e31e){_0x296488=_0x35e31e;return getCall(_0x121bf8,_0x267208,_0x1aa2db,_0x4a1142,_0x296488,_0x5c3152,_0x606023,_0xef65('0x91'));})[_0xef65('0x4a')](function(_0x5979ee){if(_0x5979ee){logger['info'](_0xef65('0x87'),_0x5979ee['id']);logger[_0xef65('0x2b')](_0xef65('0x92'),_0xef65('0x93'));emit(util['format'](_0xef65('0x88'),_0x1a36ae['name']),_0xef65('0x89'),{'uri':_0xef65('0x94')+_0x1aa2db[_0xef65('0x79')]+_0xef65('0x8a')+_0x5979ee['id']});}})['catch'](function(_0x3351a5){logger[_0xef65('0x28')](_0xef65('0x92'),JSON[_0xef65('0xc')](_0x3351a5));});};exports[_0xef65('0x95')]=function(_0x3177ae,_0x352c29,_0x101b4e,_0x3dd345,_0x402125,_0x1a9b1a){var _0x597509,_0x10f11e,_0x463cc0;_0x1a9b1a[_0xef65('0x79')]=intUtil['stripTrailingSlash'](_0x1a9b1a[_0xef65('0x79')]);_0x1a9b1a[_0xef65('0x7a')]=intUtil[_0xef65('0x7b')](_0x1a9b1a[_0xef65('0x7a')]);if(_0x402125&&_0x402125[_0xef65('0x7c')]){logger[_0xef65('0x2b')]('['+_0x352c29['lastevent'][_0xef65('0x96')]()+']',_0xef65('0x7e'));_0x352c29[_0xef65('0x7f')]=_0x1a9b1a[_0xef65('0x7a')]+_0xef65('0x80')+_0x352c29[_0xef65('0x82')]+_0xef65('0x81')+md5(_0x352c29[_0xef65('0x82')]);}else{_0x352c29[_0xef65('0x7f')]='';}var _0x22a83a=_0x1a9b1a['host']===_0xef65('0x8d')?'eu':_0xef65('0x83');return getAccessToken(_0x1a9b1a)['then'](function(_0x26077f){_0x463cc0=_0x26077f;return getUser(_0x463cc0,_0x22a83a,_0x1a9b1a);})[_0xef65('0x4a')](function(_0x43f310){_0x597509=_0x43f310;logger[_0xef65('0x2b')](_0xef65('0x8e'),_0x597509['id']);return getEndUser(_0x463cc0,_0x22a83a,_0x1a9b1a,_0x352c29[_0xef65('0x85')],_0x352c29[_0xef65('0x86')],_0x597509,_0x101b4e);})['then'](function(_0x512853){_0x10f11e=_0x512853;return getCall(_0x463cc0,_0x22a83a,_0x1a9b1a,_0x597509,_0x10f11e,_0x101b4e,_0x352c29,_0xef65('0x72'));})[_0xef65('0x4a')](function(_0x39419d){if(_0x39419d){logger['info']('The\x20Call\x20ID\x20is:',_0x39419d['id']);}})[_0xef65('0x27')](function(_0x303510){logger[_0xef65('0x28')]('['+_0x352c29[_0xef65('0x63')]['toUpperCase']()+']',JSON['stringify'](_0x303510));});}; \ 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 e535d68..a463f74 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 _0x5874=['exec','data2','Script','render','data3','error','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','util','shelljs','mustache','../../../../config/logger','trigger'];(function(_0x929a3a,_0x2ce38d){var _0x315de3=function(_0x279c52){while(--_0x279c52){_0x929a3a['push'](_0x929a3a['shift']());}};_0x315de3(++_0x2ce38d);}(_0x5874,0x7d));var _0x4587=function(_0x59786a,_0x37e965){_0x59786a=_0x59786a-0x0;var _0x224a6a=_0x5874[_0x59786a];return _0x224a6a;};'use strict';var util=require(_0x4587('0x0'));var sh=require(_0x4587('0x1'));var Mustache=require(_0x4587('0x2'));var logger=require(_0x4587('0x3'))(_0x4587('0x4'));exports[_0x4587('0x5')]=function(_0x427607,_0x4fc1f9){var _0x3a0bec=_0x427607['data2']?_0x427607[_0x4587('0x6')]:_0x4587('0x7');var _0x3f3b8d=_0x427607['data3']?Mustache[_0x4587('0x8')](_0x427607[_0x4587('0x9')],_0x4fc1f9):_0x4fc1f9;sh[_0x4587('0x5')](_0x3f3b8d,function(_0x999f75,_0x1d5dbe,_0x498bd3){if(_0x999f75!==0x0){logger[_0x4587('0xa')](util['format'](_0x4587('0xb'),_0x3a0bec,_0x3f3b8d,_0x999f75,_0x498bd3));}else{logger[_0x4587('0xc')](util['format']('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x3a0bec,_0x3f3b8d,_0x1d5dbe));}});}; \ No newline at end of file +var _0x538d=['%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','trigger','exec','data2','Script','render','data3','error','format'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x538d,0xde));var _0xd538=function(_0xd7ea69,_0x3adec5){_0xd7ea69=_0xd7ea69-0x0;var _0x1ae37f=_0x538d[_0xd7ea69];return _0x1ae37f;};'use strict';var util=require(_0xd538('0x0'));var sh=require('shelljs');var Mustache=require('mustache');var logger=require('../../../../config/logger')(_0xd538('0x1'));exports[_0xd538('0x2')]=function(_0x3ed782,_0x5a54cb){var _0x4b27d8=_0x3ed782['data2']?_0x3ed782[_0xd538('0x3')]:_0xd538('0x4');var _0x5654ae=_0x3ed782['data3']?Mustache[_0xd538('0x5')](_0x3ed782[_0xd538('0x6')],_0x5a54cb):_0x5a54cb;sh[_0xd538('0x2')](_0x5654ae,function(_0x2b9ace,_0x5b53b2,_0x3ebed4){if(_0x2b9ace!==0x0){logger[_0xd538('0x7')](util[_0xd538('0x8')](_0xd538('0x9'),_0x4b27d8,_0x5654ae,_0x2b9ace,_0x3ebed4));}else{logger['info'](util[_0xd538('0x8')](_0xd538('0xa'),_0x4b27d8,_0x5654ae,_0x5b53b2));}});}; \ 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 7dc3774..a6e0bdf 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 _0x7d2b=['util','mustache','trigger','exec','data1','render','data5','headers','data6','parse','error','stack','toUpperCase','GET','DELETE','POST','PUT','data7','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','body','info','format','data2','stringify','isNil',',\x20request\x20body:\x20','object','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise'];(function(_0x204e54,_0x1962fa){var _0x346242=function(_0x1b11b9){while(--_0x1b11b9){_0x204e54['push'](_0x204e54['shift']());}};_0x346242(++_0x1962fa);}(_0x7d2b,0x1ee));var _0xb7d2=function(_0x54bae9,_0x5d8f10){_0x54bae9=_0x54bae9-0x0;var _0x513c68=_0x7d2b[_0x54bae9];return _0x513c68;};'use strict';var rp=require(_0xb7d2('0x0'));var util=require(_0xb7d2('0x1'));var _=require('lodash');var Mustache=require(_0xb7d2('0x2'));var logger=require('../../../../config/logger')(_0xb7d2('0x3'));exports[_0xb7d2('0x4')]=function(_0x3446f2,_0x4351c9){var _0x17fa27,_0x3e8501;var _0x9e6d84={'method':_0x3446f2[_0xb7d2('0x5')]['toUpperCase'](),'uri':Mustache[_0xb7d2('0x6')](_0x3446f2['data2'],_0x4351c9),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x3446f2[_0xb7d2('0x7')])==='number'&&parseInt(_0x3446f2[_0xb7d2('0x7')])>=0x1&&parseInt(_0x3446f2[_0xb7d2('0x7')])<=0xa?parseInt(_0x3446f2[_0xb7d2('0x7')])*0x3e8:0x5*0x3e8};try{_0x9e6d84[_0xb7d2('0x8')]=_0x3446f2[_0xb7d2('0x9')]?JSON[_0xb7d2('0xa')](Mustache['render'](_0x3446f2['data6'],_0x4351c9)):{};}catch(_0x2571b8){logger[_0xb7d2('0xb')](_0x2571b8[_0xb7d2('0xc')]);}switch(_0x3446f2[_0xb7d2('0x5')][_0xb7d2('0xd')]()){case _0xb7d2('0xe'):case _0xb7d2('0xf'):_0x17fa27=null;_0x9e6d84['qs']=_0x4351c9;break;case _0xb7d2('0x10'):case _0xb7d2('0x11'):if(_0x3446f2[_0xb7d2('0x12')]){try{_0x17fa27=JSON[_0xb7d2('0xa')](Mustache['render'](_0x3446f2[_0xb7d2('0x12')],_0x4351c9));_0x9e6d84['body']=_0x17fa27;}catch(_0x2ccec1){logger[_0xb7d2('0xb')](_0x2ccec1['stack']);logger[_0xb7d2('0xb')](_0xb7d2('0x13'));}}else{_0x17fa27=_0x4351c9;_0x9e6d84[_0xb7d2('0x14')]=_0x17fa27;}break;}logger[_0xb7d2('0x15')](util[_0xb7d2('0x16')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x3446f2[_0xb7d2('0x5')],_0x3446f2[_0xb7d2('0x17')],JSON[_0xb7d2('0x18')](_0x9e6d84)));rp(_0x9e6d84)['then'](function(_0x3b80e9){_0x17fa27=!_[_0xb7d2('0x19')](_0x17fa27)?_0xb7d2('0x1a')+_0x17fa27:'';_0x3e8501=typeof _0x3b80e9['body']===_0xb7d2('0x1b')?JSON[_0xb7d2('0x18')](_0x3b80e9['body']):_0x3b80e9['body'];logger['info'](util[_0xb7d2('0x16')]('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x3446f2[_0xb7d2('0x5')],_0x3446f2['data2'],_0x3b80e9[_0xb7d2('0x1c')],_0x3e8501));})[_0xb7d2('0x1d')](function(_0x20790f){logger[_0xb7d2('0xb')](util[_0xb7d2('0x16')](_0xb7d2('0x1e'),_0x3446f2[_0xb7d2('0x5')],_0x3446f2[_0xb7d2('0x17')],_0x20790f['statusCode'],_0x20790f[_0xb7d2('0x1f')],_0x20790f[_0xb7d2('0x20')]));});}; \ No newline at end of file +var _0xda13=['object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','message','request-promise','lodash','mustache','../../../../config/logger','trigger','exec','data1','render','data5','data6','parse','error','toUpperCase','GET','POST','PUT','data7','body','stack','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','data2','then','isNil'];(function(_0x3236d9,_0x1bd5a5){var _0x105a25=function(_0x419030){while(--_0x419030){_0x3236d9['push'](_0x3236d9['shift']());}};_0x105a25(++_0x1bd5a5);}(_0xda13,0x179));var _0x3da1=function(_0x2c50a6,_0x2a9854){_0x2c50a6=_0x2c50a6-0x0;var _0x3e6556=_0xda13[_0x2c50a6];return _0x3e6556;};'use strict';var rp=require(_0x3da1('0x0'));var util=require('util');var _=require(_0x3da1('0x1'));var Mustache=require(_0x3da1('0x2'));var logger=require(_0x3da1('0x3'))(_0x3da1('0x4'));exports[_0x3da1('0x5')]=function(_0x271ed7,_0x1add2c){var _0x3dd5a4,_0x463358;var _0x5c2ddc={'method':_0x271ed7[_0x3da1('0x6')]['toUpperCase'](),'uri':Mustache[_0x3da1('0x7')](_0x271ed7['data2'],_0x1add2c),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x271ed7['data5'])==='number'&&parseInt(_0x271ed7['data5'])>=0x1&&parseInt(_0x271ed7[_0x3da1('0x8')])<=0xa?parseInt(_0x271ed7['data5'])*0x3e8:0x5*0x3e8};try{_0x5c2ddc['headers']=_0x271ed7[_0x3da1('0x9')]?JSON[_0x3da1('0xa')](Mustache[_0x3da1('0x7')](_0x271ed7[_0x3da1('0x9')],_0x1add2c)):{};}catch(_0x2dd103){logger[_0x3da1('0xb')](_0x2dd103['stack']);}switch(_0x271ed7[_0x3da1('0x6')][_0x3da1('0xc')]()){case _0x3da1('0xd'):case'DELETE':_0x3dd5a4=null;_0x5c2ddc['qs']=_0x1add2c;break;case _0x3da1('0xe'):case _0x3da1('0xf'):if(_0x271ed7[_0x3da1('0x10')]){try{_0x3dd5a4=JSON[_0x3da1('0xa')](Mustache[_0x3da1('0x7')](_0x271ed7[_0x3da1('0x10')],_0x1add2c));_0x5c2ddc[_0x3da1('0x11')]=_0x3dd5a4;}catch(_0x1183c5){logger[_0x3da1('0xb')](_0x1183c5[_0x3da1('0x12')]);logger[_0x3da1('0xb')](_0x3da1('0x13'));}}else{_0x3dd5a4=_0x1add2c;_0x5c2ddc[_0x3da1('0x11')]=_0x3dd5a4;}break;}logger[_0x3da1('0x14')](util[_0x3da1('0x15')](_0x3da1('0x16'),_0x271ed7[_0x3da1('0x6')],_0x271ed7[_0x3da1('0x17')],JSON['stringify'](_0x5c2ddc)));rp(_0x5c2ddc)[_0x3da1('0x18')](function(_0x57d371){_0x3dd5a4=!_[_0x3da1('0x19')](_0x3dd5a4)?',\x20request\x20body:\x20'+_0x3dd5a4:'';_0x463358=typeof _0x57d371['body']===_0x3da1('0x1a')?JSON['stringify'](_0x57d371['body']):_0x57d371[_0x3da1('0x11')];logger[_0x3da1('0x14')](util[_0x3da1('0x15')](_0x3da1('0x1b'),_0x271ed7[_0x3da1('0x6')],_0x271ed7[_0x3da1('0x17')],_0x57d371[_0x3da1('0x1c')],_0x463358));})['catch'](function(_0x282459){logger[_0x3da1('0xb')](util['format'](_0x3da1('0x1d'),_0x271ed7[_0x3da1('0x6')],_0x271ed7[_0x3da1('0x17')],_0x282459[_0x3da1('0x1c')],_0x282459['name'],_0x282459[_0x3da1('0x1e')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index cca8126..3ccc269 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 _0x7405=['Request','request','then','error','rpc','message','result','jayson/promise','../../config/logger','routing','client','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7405,0x1e7));var _0x5740=function(_0x436849,_0x430b00){_0x436849=_0x436849-0x0;var _0x5c5f73=_0x7405[_0x436849];return _0x5c5f73;};'use strict';var jayson=require(_0x5740('0x0'));var BPromise=require('bluebird');var logger=require(_0x5740('0x1'))(_0x5740('0x2'));var client=jayson[_0x5740('0x3')][_0x5740('0x4')]({'port':0x2329});client[_0x5740('0x5')]=function(_0x2968d8,_0x33135d){return new BPromise(function(_0x4144ce,_0x4b4ecb){return client[_0x5740('0x6')](_0x2968d8,_0x33135d)[_0x5740('0x7')](function(_0x2f596f){logger['debug']('rpc',_0x5740('0x2'),_0x2968d8,_0x33135d,_0x2f596f);if(_0x2f596f['error']){logger[_0x5740('0x8')](_0x5740('0x9'),_0x5740('0x2'),_0x2968d8,_0x2f596f['error'][_0x5740('0xa')],_0x33135d);return _0x4b4ecb(_0x2f596f[_0x5740('0x8')][_0x5740('0xa')]);}else{return _0x4144ce(_0x2f596f[_0x5740('0xb')]);}})['catch'](function(_0x2978de){logger[_0x5740('0x8')](_0x5740('0x9'),_0x5740('0x2'),_0x2968d8,_0x2978de,_0x33135d);return _0x4b4ecb(_0x2978de);});});};module['exports']=client; \ No newline at end of file +var _0xa97f=['catch','exports','jayson/promise','bluebird','../../config/logger','client','Request','request','rpc','routing','error','result'];(function(_0x49b3d3,_0x518f0e){var _0x29d83c=function(_0x1d28dc){while(--_0x1d28dc){_0x49b3d3['push'](_0x49b3d3['shift']());}};_0x29d83c(++_0x518f0e);}(_0xa97f,0x86));var _0xfa97=function(_0x5ed7a0,_0x5ceb9a){_0x5ed7a0=_0x5ed7a0-0x0;var _0x53a3fd=_0xa97f[_0x5ed7a0];return _0x53a3fd;};'use strict';var jayson=require(_0xfa97('0x0'));var BPromise=require(_0xfa97('0x1'));var logger=require(_0xfa97('0x2'))('routing');var client=jayson[_0xfa97('0x3')]['http']({'port':0x2329});client[_0xfa97('0x4')]=function(_0x1fae5b,_0x1af6a2){return new BPromise(function(_0x2ab0ca,_0x48ceac){return client[_0xfa97('0x5')](_0x1fae5b,_0x1af6a2)['then'](function(_0xf2e451){logger['debug'](_0xfa97('0x6'),_0xfa97('0x7'),_0x1fae5b,_0x1af6a2,_0xf2e451);if(_0xf2e451[_0xfa97('0x8')]){logger[_0xfa97('0x8')]('rpc','routing',_0x1fae5b,_0xf2e451[_0xfa97('0x8')]['message'],_0x1af6a2);return _0x48ceac(_0xf2e451[_0xfa97('0x8')]['message']);}else{return _0x2ab0ca(_0xf2e451[_0xfa97('0x9')]);}})[_0xfa97('0xa')](function(_0x413246){logger['error'](_0xfa97('0x6'),_0xfa97('0x7'),_0x1fae5b,_0x413246,_0x1af6a2);return _0x48ceac(_0x413246);});});};module[_0xfa97('0xb')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 3bcd584..cc3dc4c 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 _0xb853=['./rpc/mailAccount','../../config/logger','email','then','getMailAccounts','initMailAccounts','refresh','mailAccounts','listen','getSettings','error','Email\x20service\x20initialization','./server','./realtime','./lib/email'];(function(_0x1aefad,_0x23de54){var _0x30f502=function(_0x35edca){while(--_0x35edca){_0x1aefad['push'](_0x1aefad['shift']());}};_0x30f502(++_0x23de54);}(_0xb853,0x174));var _0x3b85=function(_0x5bd4d0,_0x353cc1){_0x5bd4d0=_0x5bd4d0-0x0;var _0x1d5085=_0xb853[_0x5bd4d0];return _0x1d5085;};'use strict';var server=require(_0x3b85('0x0'));var Realtime=require(_0x3b85('0x1'));var EmailChannel=require(_0x3b85('0x2'));var mailAccount=require(_0x3b85('0x3'));var setting=require('./rpc/setting');var logger=require(_0x3b85('0x4'))(_0x3b85('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise['resolve']()[_0x3b85('0x6')](mailAccount[_0x3b85('0x7')]())['then'](realtime[_0x3b85('0x8')]())[_0x3b85('0x6')](function(){email[_0x3b85('0x9')](realtime[_0x3b85('0xa')]);return realtime;});}function main(){return server[_0x3b85('0xb')](realtime,email)[_0x3b85('0x6')](function(){return initRealtime();})[_0x3b85('0x6')](function(){return setting[_0x3b85('0xc')]();})[_0x3b85('0x6')](function(_0x1a4777){return setInterval(initRealtime,_0x1a4777['loginMailFrequency']*0x3e8);})['catch'](function(_0x4a0c6a){logger[_0x3b85('0xd')](_0x3b85('0xe'),_0x4a0c6a);});}main(); \ No newline at end of file +var _0xca99=['refresh','mailAccounts','getSettings','loginMailFrequency','catch','error','./server','./realtime','./rpc/mailAccount','./rpc/setting','../../config/logger','then','getMailAccounts'];(function(_0x3f3760,_0x1bef2f){var _0x1f958d=function(_0xbe71bf){while(--_0xbe71bf){_0x3f3760['push'](_0x3f3760['shift']());}};_0x1f958d(++_0x1bef2f);}(_0xca99,0x172));var _0x9ca9=function(_0x5a4a6c,_0x1d29a0){_0x5a4a6c=_0x5a4a6c-0x0;var _0x4ba0a4=_0xca99[_0x5a4a6c];return _0x4ba0a4;};'use strict';var server=require(_0x9ca9('0x0'));var Realtime=require(_0x9ca9('0x1'));var EmailChannel=require('./lib/email');var mailAccount=require(_0x9ca9('0x2'));var setting=require(_0x9ca9('0x3'));var logger=require(_0x9ca9('0x4'))('email');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise['resolve']()[_0x9ca9('0x5')](mailAccount[_0x9ca9('0x6')]())[_0x9ca9('0x5')](realtime['initMailAccounts']())[_0x9ca9('0x5')](function(){email[_0x9ca9('0x7')](realtime[_0x9ca9('0x8')]);return realtime;});}function main(){return server['listen'](realtime,email)['then'](function(){return initRealtime();})[_0x9ca9('0x5')](function(){return setting[_0x9ca9('0x9')]();})[_0x9ca9('0x5')](function(_0x11fab0){return setInterval(initRealtime,_0x11fab0[_0x9ca9('0xa')]*0x3e8);})[_0x9ca9('0xb')](function(_0x515c53){logger[_0x9ca9('0xc')]('Email\x20service\x20initialization',_0x515c53);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 3c2e8af..3305475 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 _0xdd45=['end','handleImapEnd','error','handleImapError','disabled','status','name','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','lastName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','lastSync','sendMail','send','verifySmtp','Smtp','verify','lodash','moment','bluebird','md5','ioredis','../../../config/logger','redis','defaults','socket.io-emitter','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','smtp','prototype','emit','key','active','Imap','messageStatus','total','isNil','stringify','refresh','service','custom','provider','imapAccounts','hasOwnProperty','email','box','handleImapBox','bind','handleImapEmail'];(function(_0x1489a0,_0x2738b6){var _0x4a1d5b=function(_0x311c8a){while(--_0x311c8a){_0x1489a0['push'](_0x1489a0['shift']());}};_0x4a1d5b(++_0x2738b6);}(_0xdd45,0x1d5));var _0x5dd4=function(_0x4a7b8c,_0x177c3a){_0x4a7b8c=_0x4a7b8c-0x0;var _0x419d58=_0xdd45[_0x4a7b8c];return _0x419d58;};'use strict';var _=require(_0x5dd4('0x0'));var moment=require(_0x5dd4('0x1'));var BPromise=require(_0x5dd4('0x2'));var md5=require(_0x5dd4('0x3'));var Redis=require(_0x5dd4('0x4'));var config=require('../../../config/environment');var logger=require(_0x5dd4('0x5'))('email');config[_0x5dd4('0x6')]=_[_0x5dd4('0x7')](config[_0x5dd4('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x5dd4('0x8'))(new Redis(config[_0x5dd4('0x6')]));var EmailImap=require('./imap');var EmailSmtp=require(_0x5dd4('0x9'));var mailAccount=require(_0x5dd4('0xa'));var md5Accounts={};function EmailChannel(_0x3762f2){logger[_0x5dd4('0xb')](_0x5dd4('0xc'));this[_0x5dd4('0xd')]=_0x3762f2[_0x5dd4('0xd')];this['imapAccounts']={};this[_0x5dd4('0xe')]=new EmailSmtp();}EmailChannel[_0x5dd4('0xf')][_0x5dd4('0x10')]=function(_0x5f0129){var _0x19df1c=this[_0x5dd4('0xd')][_0x5f0129];var _0x118421={'id':_0x19df1c['id'],'name':_0x19df1c['name'],'key':_0x19df1c[_0x5dd4('0x11')],'active':_0x19df1c[_0x5dd4('0x12')],'Imap':{'status':_0x19df1c['Imap']['status'],'messageStatus':_0x19df1c[_0x5dd4('0x13')][_0x5dd4('0x14')],'total':_0x19df1c['Imap'][_0x5dd4('0x15')]}};if(_[_0x5dd4('0x16')](md5Accounts[_0x5f0129])){md5Accounts[_0x5f0129]={};}var _0x415c04=md5(JSON[_0x5dd4('0x17')](_0x118421));if(md5Accounts[_0x5f0129][_0x5dd4('0x3')]!==_0x415c04){md5Accounts[_0x5f0129][_0x5dd4('0x3')]=_0x415c04;io[_0x5dd4('0x10')]('mailAccount:update',_0x118421);}};EmailChannel[_0x5dd4('0xf')][_0x5dd4('0x18')]=function(_0x434b67){for(var _0x26bea2 in _0x434b67){if(_0x434b67['hasOwnProperty'](_0x26bea2)){if(_0x434b67[_0x26bea2][_0x5dd4('0x13')]&&_0x434b67[_0x26bea2][_0x5dd4('0x12')]){var _0x15f890=_0x434b67[_0x26bea2][_0x5dd4('0x13')];if(!_0x15f890[_0x5dd4('0x19')]&&_0x434b67[_0x26bea2]['provider']!==_0x5dd4('0x1a'))_0x15f890[_0x5dd4('0x19')]=_0x434b67[_0x26bea2][_0x5dd4('0x1b')];if(!this[_0x5dd4('0x1c')][_0x5dd4('0x1d')](_0x15f890['id'])){this['imapAccounts'][_0x15f890['id']]=new EmailImap(_0x15f890,_0x434b67[_0x26bea2][_0x5dd4('0x1e')]);this[_0x5dd4('0x1c')][_0x15f890['id']]['on'](_0x5dd4('0x1f'),this[_0x5dd4('0x20')][_0x5dd4('0x21')](this,_0x26bea2));this[_0x5dd4('0x1c')][_0x15f890['id']]['on'](_0x5dd4('0x1e'),this[_0x5dd4('0x22')][_0x5dd4('0x21')](this,_0x26bea2));this[_0x5dd4('0x1c')][_0x15f890['id']]['on'](_0x5dd4('0x23'),this[_0x5dd4('0x24')][_0x5dd4('0x21')](this,_0x26bea2));this[_0x5dd4('0x1c')][_0x15f890['id']]['on'](_0x5dd4('0x25'),this[_0x5dd4('0x26')][_0x5dd4('0x21')](this,_0x26bea2));}}else{if(_[_0x5dd4('0x16')](this[_0x5dd4('0xd')][_0x26bea2]['Imap'])){this['mailAccounts'][_0x26bea2][_0x5dd4('0x13')]={};}this[_0x5dd4('0xd')][_0x26bea2][_0x5dd4('0x13')]['status']=_0x5dd4('0x27');this[_0x5dd4('0xd')][_0x26bea2][_0x5dd4('0x13')][_0x5dd4('0x14')]='';this[_0x5dd4('0x10')](_0x26bea2);}}}};EmailChannel[_0x5dd4('0xf')][_0x5dd4('0x20')]=function(_0x42bd92,_0x58f833){if(this['mailAccounts'][_0x42bd92]){this['mailAccounts'][_0x42bd92]['Imap'][_0x5dd4('0x28')]='connected';this[_0x5dd4('0xd')][_0x42bd92][_0x5dd4('0x13')][_0x5dd4('0x14')]=_0x58f833[_0x5dd4('0x29')];if(_0x58f833[_0x5dd4('0x2a')]){this[_0x5dd4('0xd')][_0x42bd92]['Imap'][_0x5dd4('0x15')]=_0x58f833[_0x5dd4('0x2a')][_0x5dd4('0x15')];}return this['emit'](_0x42bd92);}};EmailChannel[_0x5dd4('0xf')][_0x5dd4('0x22')]=function(_0x2c986d,_0x4f4961){logger['info'](_0x5dd4('0x2b'),_0x4f4961['firstName'],_0x4f4961[_0x5dd4('0x2c')],_0x4f4961[_0x5dd4('0x2d')],_0x2c986d);if(this[_0x5dd4('0xd')][_0x2c986d]){return mailAccount[_0x5dd4('0x2e')](_0x2c986d,_0x4f4961)[_0x5dd4('0x2f')](function(_0x9b1f9e){if(_0x9b1f9e){logger[_0x5dd4('0xb')](_0x5dd4('0x30'));}})[_0x5dd4('0x31')](function(_0x479747){logger['error']('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0x5dd4('0x17')](_0x479747));});}};EmailChannel[_0x5dd4('0xf')][_0x5dd4('0x24')]=function(_0xbc5668){if(this['mailAccounts'][_0xbc5668]&&this['mailAccounts'][_0xbc5668][_0x5dd4('0x13')]){if(this[_0x5dd4('0x1c')][this[_0x5dd4('0xd')][_0xbc5668][_0x5dd4('0x13')]['id']]){delete this[_0x5dd4('0x1c')][this[_0x5dd4('0xd')][_0xbc5668][_0x5dd4('0x13')]['id']];}this['mailAccounts'][_0xbc5668][_0x5dd4('0x13')][_0x5dd4('0x32')]=moment();this[_0x5dd4('0x10')](_0xbc5668);}};EmailChannel['prototype']['handleImapError']=function(_0x19bc75,_0x44a8ea){if(this[_0x5dd4('0xd')][_0x19bc75]){this[_0x5dd4('0xd')][_0x19bc75][_0x5dd4('0x13')]['status']=_0x5dd4('0x25');this[_0x5dd4('0xd')][_0x19bc75]['Imap'][_0x5dd4('0x14')]=_0x44a8ea;return this[_0x5dd4('0x10')](_0x19bc75);}};EmailChannel[_0x5dd4('0xf')][_0x5dd4('0x33')]=function(_0x5550a4,_0x5d796e){return this['smtp'][_0x5dd4('0x34')](_0x5550a4,_0x5d796e);};EmailChannel[_0x5dd4('0xf')][_0x5dd4('0x35')]=function(_0x346baa){var _0x5925f2=this;if(this[_0x5dd4('0xd')][_0x346baa['id']]){if(_[_0x5dd4('0x16')](this[_0x5dd4('0xd')][_0x346baa['id']][_0x5dd4('0x36')])){this[_0x5dd4('0xd')][_0x346baa['id']][_0x5dd4('0x36')]={};}this[_0x5dd4('0xd')][_0x346baa['id']]['Smtp'][_0x5dd4('0x32')]=moment();return new BPromise(function(_0x21eb14,_0x515091){return _0x5925f2[_0x5dd4('0xe')][_0x5dd4('0x37')](_0x346baa)[_0x5dd4('0x2f')](function(_0x216b95){_0x5925f2['mailAccounts'][_0x346baa['id']][_0x5dd4('0x36')][_0x5dd4('0x28')]='verified';_0x5925f2['mailAccounts'][_0x346baa['id']][_0x5dd4('0x36')][_0x5dd4('0x14')]='';_0x5925f2[_0x5dd4('0x10')](_0x346baa['id']);_0x21eb14(_0x216b95);})[_0x5dd4('0x31')](function(_0x21e025){_0x5925f2[_0x5dd4('0xd')][_0x346baa['id']][_0x5dd4('0x36')][_0x5dd4('0x28')]='error';_0x5925f2[_0x5dd4('0xd')][_0x346baa['id']]['Smtp']['messageStatus']=_0x21e025;_0x5925f2[_0x5dd4('0x10')](_0x346baa['id']);_0x515091(_0x21e025);});});}return this[_0x5dd4('0xe')][_0x5dd4('0x37')](_0x346baa);};module['exports']=EmailChannel; \ No newline at end of file +var _0xe624=['error','isNil','disabled','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','from','notify','then','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','sendMail','Smtp','verify','catch','exports','lodash','moment','bluebird','md5','../../../config/environment','defaults','socket.io-emitter','redis','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','imapAccounts','smtp','mailAccounts','name','key','status','Imap','messageStatus','total','emit','mailAccount:update','prototype','refresh','hasOwnProperty','active','service','provider','custom','box','handleImapBox','email','handleImapEmail','bind','end','handleImapEnd'];(function(_0x26f395,_0x5eba37){var _0x54b324=function(_0x59af54){while(--_0x59af54){_0x26f395['push'](_0x26f395['shift']());}};_0x54b324(++_0x5eba37);}(_0xe624,0x183));var _0x4e62=function(_0xed6f46,_0x1c9006){_0xed6f46=_0xed6f46-0x0;var _0x5b267c=_0xe624[_0xed6f46];return _0x5b267c;};'use strict';var _=require(_0x4e62('0x0'));var moment=require(_0x4e62('0x1'));var BPromise=require(_0x4e62('0x2'));var md5=require(_0x4e62('0x3'));var Redis=require('ioredis');var config=require(_0x4e62('0x4'));var logger=require('../../../config/logger')('email');config['redis']=_[_0x4e62('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x4e62('0x6'))(new Redis(config[_0x4e62('0x7')]));var EmailImap=require('./imap');var EmailSmtp=require(_0x4e62('0x8'));var mailAccount=require(_0x4e62('0x9'));var md5Accounts={};function EmailChannel(_0x35a841){logger[_0x4e62('0xa')](_0x4e62('0xb'));this['mailAccounts']=_0x35a841['mailAccounts'];this[_0x4e62('0xc')]={};this[_0x4e62('0xd')]=new EmailSmtp();}EmailChannel['prototype']['emit']=function(_0x1f49dc){var _0x479f40=this[_0x4e62('0xe')][_0x1f49dc];var _0x2e09e7={'id':_0x479f40['id'],'name':_0x479f40[_0x4e62('0xf')],'key':_0x479f40[_0x4e62('0x10')],'active':_0x479f40['active'],'Imap':{'status':_0x479f40['Imap'][_0x4e62('0x11')],'messageStatus':_0x479f40[_0x4e62('0x12')][_0x4e62('0x13')],'total':_0x479f40['Imap'][_0x4e62('0x14')]}};if(_['isNil'](md5Accounts[_0x1f49dc])){md5Accounts[_0x1f49dc]={};}var _0x464c7c=md5(JSON['stringify'](_0x2e09e7));if(md5Accounts[_0x1f49dc]['md5']!==_0x464c7c){md5Accounts[_0x1f49dc][_0x4e62('0x3')]=_0x464c7c;io[_0x4e62('0x15')](_0x4e62('0x16'),_0x2e09e7);}};EmailChannel[_0x4e62('0x17')][_0x4e62('0x18')]=function(_0x2d8a90){for(var _0x53f56e in _0x2d8a90){if(_0x2d8a90[_0x4e62('0x19')](_0x53f56e)){if(_0x2d8a90[_0x53f56e]['Imap']&&_0x2d8a90[_0x53f56e][_0x4e62('0x1a')]){var _0x4a3e86=_0x2d8a90[_0x53f56e][_0x4e62('0x12')];if(!_0x4a3e86[_0x4e62('0x1b')]&&_0x2d8a90[_0x53f56e][_0x4e62('0x1c')]!==_0x4e62('0x1d'))_0x4a3e86[_0x4e62('0x1b')]=_0x2d8a90[_0x53f56e][_0x4e62('0x1c')];if(!this[_0x4e62('0xc')]['hasOwnProperty'](_0x4a3e86['id'])){this[_0x4e62('0xc')][_0x4a3e86['id']]=new EmailImap(_0x4a3e86,_0x2d8a90[_0x53f56e]['email']);this[_0x4e62('0xc')][_0x4a3e86['id']]['on'](_0x4e62('0x1e'),this[_0x4e62('0x1f')]['bind'](this,_0x53f56e));this[_0x4e62('0xc')][_0x4a3e86['id']]['on'](_0x4e62('0x20'),this[_0x4e62('0x21')][_0x4e62('0x22')](this,_0x53f56e));this[_0x4e62('0xc')][_0x4a3e86['id']]['on'](_0x4e62('0x23'),this[_0x4e62('0x24')][_0x4e62('0x22')](this,_0x53f56e));this[_0x4e62('0xc')][_0x4a3e86['id']]['on'](_0x4e62('0x25'),this['handleImapError'][_0x4e62('0x22')](this,_0x53f56e));}}else{if(_[_0x4e62('0x26')](this[_0x4e62('0xe')][_0x53f56e][_0x4e62('0x12')])){this[_0x4e62('0xe')][_0x53f56e][_0x4e62('0x12')]={};}this[_0x4e62('0xe')][_0x53f56e][_0x4e62('0x12')][_0x4e62('0x11')]=_0x4e62('0x27');this[_0x4e62('0xe')][_0x53f56e][_0x4e62('0x12')][_0x4e62('0x13')]='';this[_0x4e62('0x15')](_0x53f56e);}}}};EmailChannel[_0x4e62('0x17')][_0x4e62('0x1f')]=function(_0x5b8dfc,_0x5f419e){if(this[_0x4e62('0xe')][_0x5b8dfc]){this[_0x4e62('0xe')][_0x5b8dfc][_0x4e62('0x12')][_0x4e62('0x11')]=_0x4e62('0x28');this['mailAccounts'][_0x5b8dfc]['Imap'][_0x4e62('0x13')]=_0x5f419e[_0x4e62('0xf')];if(_0x5f419e[_0x4e62('0x29')]){this[_0x4e62('0xe')][_0x5b8dfc]['Imap'][_0x4e62('0x14')]=_0x5f419e[_0x4e62('0x29')][_0x4e62('0x14')];}return this[_0x4e62('0x15')](_0x5b8dfc);}};EmailChannel[_0x4e62('0x17')][_0x4e62('0x21')]=function(_0x340db0,_0x495d5f){logger[_0x4e62('0xa')](_0x4e62('0x2a'),_0x495d5f['firstName'],_0x495d5f['lastName'],_0x495d5f[_0x4e62('0x2b')],_0x340db0);if(this[_0x4e62('0xe')][_0x340db0]){return mailAccount[_0x4e62('0x2c')](_0x340db0,_0x495d5f)[_0x4e62('0x2d')](function(_0x3cf3bf){if(_0x3cf3bf){logger[_0x4e62('0xa')]('Mail\x20accepted\x20from\x20routing');}})['catch'](function(_0x1b88e8){logger[_0x4e62('0x25')](_0x4e62('0x2e'),JSON['stringify'](_0x1b88e8));});}};EmailChannel[_0x4e62('0x17')][_0x4e62('0x24')]=function(_0x425894){if(this[_0x4e62('0xe')][_0x425894]&&this[_0x4e62('0xe')][_0x425894]['Imap']){if(this[_0x4e62('0xc')][this[_0x4e62('0xe')][_0x425894]['Imap']['id']]){delete this[_0x4e62('0xc')][this['mailAccounts'][_0x425894][_0x4e62('0x12')]['id']];}this['mailAccounts'][_0x425894][_0x4e62('0x12')][_0x4e62('0x2f')]=moment();this[_0x4e62('0x15')](_0x425894);}};EmailChannel['prototype']['handleImapError']=function(_0x48ed2c,_0x4de6b7){if(this['mailAccounts'][_0x48ed2c]){this[_0x4e62('0xe')][_0x48ed2c]['Imap']['status']=_0x4e62('0x25');this[_0x4e62('0xe')][_0x48ed2c][_0x4e62('0x12')][_0x4e62('0x13')]=_0x4de6b7;return this[_0x4e62('0x15')](_0x48ed2c);}};EmailChannel[_0x4e62('0x17')][_0x4e62('0x30')]=function(_0x2f14e0,_0x4d17c1){return this[_0x4e62('0xd')]['send'](_0x2f14e0,_0x4d17c1);};EmailChannel[_0x4e62('0x17')]['verifySmtp']=function(_0x4ace6c){var _0x593001=this;if(this[_0x4e62('0xe')][_0x4ace6c['id']]){if(_['isNil'](this[_0x4e62('0xe')][_0x4ace6c['id']][_0x4e62('0x31')])){this[_0x4e62('0xe')][_0x4ace6c['id']]['Smtp']={};}this[_0x4e62('0xe')][_0x4ace6c['id']][_0x4e62('0x31')][_0x4e62('0x2f')]=moment();return new BPromise(function(_0x17429e,_0x3136ee){return _0x593001[_0x4e62('0xd')][_0x4e62('0x32')](_0x4ace6c)[_0x4e62('0x2d')](function(_0x2a3c07){_0x593001[_0x4e62('0xe')][_0x4ace6c['id']][_0x4e62('0x31')][_0x4e62('0x11')]='verified';_0x593001[_0x4e62('0xe')][_0x4ace6c['id']][_0x4e62('0x31')][_0x4e62('0x13')]='';_0x593001[_0x4e62('0x15')](_0x4ace6c['id']);_0x17429e(_0x2a3c07);})[_0x4e62('0x33')](function(_0x229de2){_0x593001[_0x4e62('0xe')][_0x4ace6c['id']][_0x4e62('0x31')][_0x4e62('0x11')]=_0x4e62('0x25');_0x593001[_0x4e62('0xe')][_0x4ace6c['id']]['Smtp'][_0x4e62('0x13')]=_0x229de2;_0x593001['emit'](_0x4ace6c['id']);_0x3136ee(_0x229de2);});});}return this[_0x4e62('0xd')]['verify'](_0x4ace6c);};module[_0x4e62('0x34')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index db2a638..eea958e 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 _0xbcc4=['imap','mailparser','simpleParser','iconv','events','EventEmitter','email','mailbox','getAccount','account','once','ready','handleReady','handleEnd','bind','handleError','connect','inherits','prototype','connTimeout','authTimeout','service','user','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','data5','password','authentication','anonymous@xcally.com','host','port','tls','required','handleOpenBox','emit','box','readUnseen','handleCloseBox','end','UNSEEN','length','fetch','message','handleFetchMessage','error','handleFetchError','handleFetchEnd','closeBox','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','stringify','textCode','upperFirst','lodash'];(function(_0x3c8832,_0x16e93e){var _0xacf303=function(_0x1c7f46){while(--_0x1c7f46){_0x3c8832['push'](_0x3c8832['shift']());}};_0xacf303(++_0x16e93e);}(_0xbcc4,0x12b));var _0x4bcc=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xbcc4[_0x2b10c6];return _0x3789d2;};'use strict';var _=require(_0x4bcc('0x0'));var util=require('util');var Imap=require(_0x4bcc('0x1'));var simpleParser=require(_0x4bcc('0x2'))[_0x4bcc('0x3')];var Iconv=require(_0x4bcc('0x4'))['Iconv'];var EventEmitter=require(_0x4bcc('0x5'))[_0x4bcc('0x6')];var utils=require('./utils');var logger=require('../../../config/logger')(_0x4bcc('0x7'));function EmailImap(_0xbc8cf6,_0x2b318){this[_0x4bcc('0x8')]=_0xbc8cf6[_0x4bcc('0x8')];this['account']=this[_0x4bcc('0x9')](_0xbc8cf6,_0x2b318);this[_0x4bcc('0x1')]=new Imap(this[_0x4bcc('0xa')]);this[_0x4bcc('0x1')][_0x4bcc('0xb')](_0x4bcc('0xc'),this[_0x4bcc('0xd')]['bind'](this));this[_0x4bcc('0x1')][_0x4bcc('0xb')]('end',this[_0x4bcc('0xe')][_0x4bcc('0xf')](this));this[_0x4bcc('0x1')]['on']('error',this[_0x4bcc('0x10')][_0x4bcc('0xf')](this));this[_0x4bcc('0x1')][_0x4bcc('0x11')]();}util[_0x4bcc('0x12')](EmailImap,EventEmitter);EmailImap[_0x4bcc('0x13')]['getAccount']=function(_0x432595,_0x72ce74){var _0x16c4d6={'connTimeout':_0x432595['connTimeout']?_0x432595[_0x4bcc('0x14')]*0x3e8:0x2710,'authTimeout':_0x432595[_0x4bcc('0x15')]?_0x432595[_0x4bcc('0x15')]*0x3e8:0x1388};if(_0x432595[_0x4bcc('0x16')]){_0x16c4d6[_0x4bcc('0x17')]=_0x432595[_0x4bcc('0x17')];if(_0x432595[_0x4bcc('0x18')]){_0x16c4d6[_0x4bcc('0x19')]=utils[_0x4bcc('0x1a')](_0x432595[_0x4bcc('0x1b')][_0x4bcc('0x1c')],_0x432595[_0x4bcc('0x17')]);}else{_0x16c4d6[_0x4bcc('0x1d')]=_0x432595[_0x4bcc('0x1d')];}}else{if(_0x432595[_0x4bcc('0x1e')]){_0x16c4d6[_0x4bcc('0x17')]=_0x432595[_0x4bcc('0x17')];_0x16c4d6[_0x4bcc('0x1d')]=_0x432595['password'];}}_0x16c4d6[_0x4bcc('0x7')]=_0x72ce74||_0x432595['user']||_0x4bcc('0x1f');_0x16c4d6[_0x4bcc('0x20')]=_0x432595['host'];_0x16c4d6[_0x4bcc('0x21')]=_0x432595[_0x4bcc('0x21')]||0x3e1;if(_0x432595['tls']){_0x16c4d6[_0x4bcc('0x22')]=!![];}else{_0x16c4d6['tls']=![];_0x16c4d6['autotls']=_0x4bcc('0x23');}return _0x16c4d6;};EmailImap[_0x4bcc('0x13')][_0x4bcc('0xd')]=function(){this['imap']['openBox'](this[_0x4bcc('0x8')],![],this[_0x4bcc('0x24')][_0x4bcc('0xf')](this));};EmailImap['prototype'][_0x4bcc('0x24')]=function(_0x3255db,_0x41f4cd){if(_0x3255db){this[_0x4bcc('0x10')](_0x3255db,!![]);}else{this[_0x4bcc('0x25')](_0x4bcc('0x26'),_0x41f4cd);this[_0x4bcc('0x27')]();}};EmailImap[_0x4bcc('0x13')][_0x4bcc('0x28')]=function(_0x49447e){if(_0x49447e){this[_0x4bcc('0x10')](_0x49447e,!![]);}else{this[_0x4bcc('0x1')][_0x4bcc('0x29')]();}};EmailImap[_0x4bcc('0x13')][_0x4bcc('0x27')]=function(){this[_0x4bcc('0x1')]['search']([_0x4bcc('0x2a')],this['handleReadUnseen'][_0x4bcc('0xf')](this));};EmailImap['prototype']['handleReadUnseen']=function(_0x2ea6e5,_0x27068e){if(_0x2ea6e5){this['handleError'](_0x2ea6e5,!![]);}else{if(_0x27068e[_0x4bcc('0x2b')]){try{var _0x33c08e=this[_0x4bcc('0x1')][_0x4bcc('0x2c')](_0x27068e,{'bodies':'','markSeen':!![]});_0x33c08e['on'](_0x4bcc('0x2d'),this[_0x4bcc('0x2e')][_0x4bcc('0xf')](this));_0x33c08e['once'](_0x4bcc('0x2f'),this[_0x4bcc('0x30')][_0x4bcc('0xf')](this));_0x33c08e[_0x4bcc('0xb')](_0x4bcc('0x29'),this[_0x4bcc('0x31')][_0x4bcc('0xf')](this));}catch(_0x194418){logger[_0x4bcc('0x2f')](_0x194418);}}else{this[_0x4bcc('0x1')][_0x4bcc('0x32')](!![],this[_0x4bcc('0x28')]['bind'](this));}}};EmailImap[_0x4bcc('0x13')][_0x4bcc('0x2e')]=function(_0x1f3ba4){_0x1f3ba4['on']('body',this[_0x4bcc('0x33')][_0x4bcc('0xf')](this));_0x1f3ba4[_0x4bcc('0xb')](_0x4bcc('0x34'),this[_0x4bcc('0x35')]['bind'](this));_0x1f3ba4['once'](_0x4bcc('0x29'),this[_0x4bcc('0x36')][_0x4bcc('0xf')](this));};EmailImap[_0x4bcc('0x13')][_0x4bcc('0x33')]=function(_0x55dca2){simpleParser(_0x55dca2,{'Iconv':Iconv},this[_0x4bcc('0x37')][_0x4bcc('0xf')](this));};EmailImap[_0x4bcc('0x13')][_0x4bcc('0x35')]=function(){};EmailImap[_0x4bcc('0x13')][_0x4bcc('0x36')]=function(){};EmailImap[_0x4bcc('0x13')][_0x4bcc('0x37')]=function(_0x11afbe,_0x4f8971){if(_0x11afbe){logger[_0x4bcc('0x2f')](_0x11afbe);}else{var _0x185f5a=this;utils[_0x4bcc('0x38')](this[_0x4bcc('0xa')],_0x4f8971,function(_0x9592df){_0x185f5a[_0x4bcc('0x25')]('email',_0x9592df);});}};EmailImap[_0x4bcc('0x13')][_0x4bcc('0x31')]=function(){this[_0x4bcc('0x1')][_0x4bcc('0x32')](!![],this[_0x4bcc('0x28')]['bind'](this));};EmailImap['prototype']['handleFetchError']=function(_0x518b01){this[_0x4bcc('0x10')](_0x518b01);this[_0x4bcc('0x1')][_0x4bcc('0x32')](!![],this[_0x4bcc('0x28')][_0x4bcc('0xf')](this));};EmailImap['prototype'][_0x4bcc('0xe')]=function(){this[_0x4bcc('0x25')]('end');};EmailImap[_0x4bcc('0x13')]['handleError']=function(_0x4c5828,_0x42bea8){logger[_0x4bcc('0x2f')]('handleError',this[_0x4bcc('0xa')][_0x4bcc('0x7')],JSON[_0x4bcc('0x39')](_0x4c5828));var _0x10bfce='';if(_0x4c5828){if(_0x4c5828[_0x4bcc('0x3a')]){_0x10bfce=_0x4c5828['textCode'];}else{for(var _0x185b66 in _0x4c5828){if(_0x4c5828['hasOwnProperty'](_0x185b66)){_0x10bfce+=_[_0x4bcc('0x3b')](_0x185b66)+':\x20'+_0x4c5828[_0x185b66]+'\x0a';}}}}if(_0x42bea8){this[_0x4bcc('0x1')][_0x4bcc('0x29')]();}else{this[_0x4bcc('0x25')](_0x4bcc('0x2f'),_0x10bfce);this[_0x4bcc('0x25')]('end');}};module['exports']=EmailImap; \ No newline at end of file +var _0x7c8b=['password','authentication','anonymous@xcally.com','host','port','tls','autotls','required','handleOpenBox','emit','box','handleCloseBox','readUnseen','search','handleReadUnseen','length','fetch','message','handleFetchError','closeBox','handleFetchMessage','attributes','handleMessageAttributes','handleMessageBody','handleSimpleParser','handleMessageEnd','parser','handleFetchEnd','stringify','textCode','upperFirst','exports','lodash','util','imap','mailparser','simpleParser','iconv','Iconv','events','EventEmitter','../../../config/logger','email','mailbox','account','once','ready','handleReady','bind','end','error','handleError','connect','prototype','getAccount','connTimeout','authTimeout','modernAuthentication','xoauth2','generateXOAuth2Token','data5','user'];(function(_0x595add,_0x15feb9){var _0x52eb1a=function(_0x32fcec){while(--_0x32fcec){_0x595add['push'](_0x595add['shift']());}};_0x52eb1a(++_0x15feb9);}(_0x7c8b,0xda));var _0xb7c8=function(_0x4de72c,_0x91944f){_0x4de72c=_0x4de72c-0x0;var _0x39ff88=_0x7c8b[_0x4de72c];return _0x39ff88;};'use strict';var _=require(_0xb7c8('0x0'));var util=require(_0xb7c8('0x1'));var Imap=require(_0xb7c8('0x2'));var simpleParser=require(_0xb7c8('0x3'))[_0xb7c8('0x4')];var Iconv=require(_0xb7c8('0x5'))[_0xb7c8('0x6')];var EventEmitter=require(_0xb7c8('0x7'))[_0xb7c8('0x8')];var utils=require('./utils');var logger=require(_0xb7c8('0x9'))(_0xb7c8('0xa'));function EmailImap(_0x27ce50,_0x15e0ea){this['mailbox']=_0x27ce50[_0xb7c8('0xb')];this[_0xb7c8('0xc')]=this['getAccount'](_0x27ce50,_0x15e0ea);this['imap']=new Imap(this[_0xb7c8('0xc')]);this[_0xb7c8('0x2')][_0xb7c8('0xd')](_0xb7c8('0xe'),this[_0xb7c8('0xf')][_0xb7c8('0x10')](this));this['imap'][_0xb7c8('0xd')](_0xb7c8('0x11'),this['handleEnd']['bind'](this));this[_0xb7c8('0x2')]['on'](_0xb7c8('0x12'),this[_0xb7c8('0x13')]['bind'](this));this[_0xb7c8('0x2')][_0xb7c8('0x14')]();}util['inherits'](EmailImap,EventEmitter);EmailImap[_0xb7c8('0x15')][_0xb7c8('0x16')]=function(_0x37f445,_0x3b243f){var _0x235dc4={'connTimeout':_0x37f445[_0xb7c8('0x17')]?_0x37f445[_0xb7c8('0x17')]*0x3e8:0x2710,'authTimeout':_0x37f445[_0xb7c8('0x18')]?_0x37f445[_0xb7c8('0x18')]*0x3e8:0x1388};if(_0x37f445['service']){_0x235dc4['user']=_0x37f445['user'];if(_0x37f445[_0xb7c8('0x19')]){_0x235dc4[_0xb7c8('0x1a')]=utils[_0xb7c8('0x1b')](_0x37f445['CloudProvider'][_0xb7c8('0x1c')],_0x37f445[_0xb7c8('0x1d')]);}else{_0x235dc4[_0xb7c8('0x1e')]=_0x37f445[_0xb7c8('0x1e')];}}else{if(_0x37f445[_0xb7c8('0x1f')]){_0x235dc4[_0xb7c8('0x1d')]=_0x37f445[_0xb7c8('0x1d')];_0x235dc4[_0xb7c8('0x1e')]=_0x37f445['password'];}}_0x235dc4[_0xb7c8('0xa')]=_0x3b243f||_0x37f445[_0xb7c8('0x1d')]||_0xb7c8('0x20');_0x235dc4[_0xb7c8('0x21')]=_0x37f445[_0xb7c8('0x21')];_0x235dc4[_0xb7c8('0x22')]=_0x37f445[_0xb7c8('0x22')]||0x3e1;if(_0x37f445[_0xb7c8('0x23')]){_0x235dc4[_0xb7c8('0x23')]=!![];}else{_0x235dc4[_0xb7c8('0x23')]=![];_0x235dc4[_0xb7c8('0x24')]=_0xb7c8('0x25');}return _0x235dc4;};EmailImap['prototype']['handleReady']=function(){this[_0xb7c8('0x2')]['openBox'](this[_0xb7c8('0xb')],![],this[_0xb7c8('0x26')][_0xb7c8('0x10')](this));};EmailImap[_0xb7c8('0x15')][_0xb7c8('0x26')]=function(_0x578ad8,_0x15ff30){if(_0x578ad8){this['handleError'](_0x578ad8,!![]);}else{this[_0xb7c8('0x27')](_0xb7c8('0x28'),_0x15ff30);this['readUnseen']();}};EmailImap[_0xb7c8('0x15')][_0xb7c8('0x29')]=function(_0xe3fea4){if(_0xe3fea4){this[_0xb7c8('0x13')](_0xe3fea4,!![]);}else{this['imap'][_0xb7c8('0x11')]();}};EmailImap[_0xb7c8('0x15')][_0xb7c8('0x2a')]=function(){this['imap'][_0xb7c8('0x2b')](['UNSEEN'],this['handleReadUnseen']['bind'](this));};EmailImap['prototype'][_0xb7c8('0x2c')]=function(_0x488ea2,_0x3a9d42){if(_0x488ea2){this[_0xb7c8('0x13')](_0x488ea2,!![]);}else{if(_0x3a9d42[_0xb7c8('0x2d')]){try{var _0x14add2=this['imap'][_0xb7c8('0x2e')](_0x3a9d42,{'bodies':'','markSeen':!![]});_0x14add2['on'](_0xb7c8('0x2f'),this['handleFetchMessage'][_0xb7c8('0x10')](this));_0x14add2[_0xb7c8('0xd')](_0xb7c8('0x12'),this[_0xb7c8('0x30')]['bind'](this));_0x14add2[_0xb7c8('0xd')](_0xb7c8('0x11'),this['handleFetchEnd'][_0xb7c8('0x10')](this));}catch(_0x1434b8){logger[_0xb7c8('0x12')](_0x1434b8);}}else{this[_0xb7c8('0x2')][_0xb7c8('0x31')](!![],this[_0xb7c8('0x29')][_0xb7c8('0x10')](this));}}};EmailImap[_0xb7c8('0x15')][_0xb7c8('0x32')]=function(_0x4757b9){_0x4757b9['on']('body',this['handleMessageBody'][_0xb7c8('0x10')](this));_0x4757b9['once'](_0xb7c8('0x33'),this[_0xb7c8('0x34')][_0xb7c8('0x10')](this));_0x4757b9[_0xb7c8('0xd')](_0xb7c8('0x11'),this['handleMessageEnd'][_0xb7c8('0x10')](this));};EmailImap[_0xb7c8('0x15')][_0xb7c8('0x35')]=function(_0x14528d){simpleParser(_0x14528d,{'Iconv':Iconv},this[_0xb7c8('0x36')][_0xb7c8('0x10')](this));};EmailImap[_0xb7c8('0x15')][_0xb7c8('0x34')]=function(){};EmailImap[_0xb7c8('0x15')][_0xb7c8('0x37')]=function(){};EmailImap[_0xb7c8('0x15')][_0xb7c8('0x36')]=function(_0x207951,_0x432370){if(_0x207951){logger['error'](_0x207951);}else{var _0xaec3c2=this;utils[_0xb7c8('0x38')](this['account'],_0x432370,function(_0xba80c1){_0xaec3c2[_0xb7c8('0x27')](_0xb7c8('0xa'),_0xba80c1);});}};EmailImap[_0xb7c8('0x15')][_0xb7c8('0x39')]=function(){this[_0xb7c8('0x2')][_0xb7c8('0x31')](!![],this[_0xb7c8('0x29')][_0xb7c8('0x10')](this));};EmailImap['prototype'][_0xb7c8('0x30')]=function(_0x377f77){this[_0xb7c8('0x13')](_0x377f77);this['imap'][_0xb7c8('0x31')](!![],this[_0xb7c8('0x29')][_0xb7c8('0x10')](this));};EmailImap[_0xb7c8('0x15')]['handleEnd']=function(){this[_0xb7c8('0x27')](_0xb7c8('0x11'));};EmailImap[_0xb7c8('0x15')]['handleError']=function(_0xf95766,_0x590551){logger[_0xb7c8('0x12')](_0xb7c8('0x13'),this[_0xb7c8('0xc')][_0xb7c8('0xa')],JSON[_0xb7c8('0x3a')](_0xf95766));var _0x313f32='';if(_0xf95766){if(_0xf95766[_0xb7c8('0x3b')]){_0x313f32=_0xf95766[_0xb7c8('0x3b')];}else{for(var _0x332b04 in _0xf95766){if(_0xf95766['hasOwnProperty'](_0x332b04)){_0x313f32+=_[_0xb7c8('0x3c')](_0x332b04)+':\x20'+_0xf95766[_0x332b04]+'\x0a';}}}}if(_0x590551){this[_0xb7c8('0x2')][_0xb7c8('0x11')]();}else{this[_0xb7c8('0x27')](_0xb7c8('0x12'),_0x313f32);this['emit'](_0xb7c8('0x11'));}};module[_0xb7c8('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 519ef0b..21d34a1 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 _0xa844=['use','sendMail','toString','prototype','verify','exports','nodemailer','send','createTransport'];(function(_0x4dc07b,_0x19b772){var _0xbd2672=function(_0x5ec826){while(--_0x5ec826){_0x4dc07b['push'](_0x4dc07b['shift']());}};_0xbd2672(++_0x19b772);}(_0xa844,0x96));var _0x4a84=function(_0xd4e872,_0x340d7f){_0xd4e872=_0xd4e872-0x0;var _0x7d196f=_0xa844[_0xd4e872];return _0x7d196f;};'use strict';var nodemailer=require(_0x4a84('0x0'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp['prototype'][_0x4a84('0x1')]=function(_0xf9e773,_0x5381af){return new Promise(function(_0x338a83,_0x45b40c){var _0x4503c4=nodemailer[_0x4a84('0x2')](_0xf9e773);_0x4503c4[_0x4a84('0x3')]('compile',inlineBase64());_0x4503c4[_0x4a84('0x4')](_0x5381af,function(_0x2fdfe7,_0x383a42){if(_0x2fdfe7){_0x45b40c(_0x2fdfe7[_0x4a84('0x5')]());}else{_0x338a83(_0x383a42);}});});};EmailSmtp[_0x4a84('0x6')][_0x4a84('0x7')]=function(_0x1a63d8){return new Promise(function(_0x5117ac,_0x3dea46){var _0x3d5209=nodemailer[_0x4a84('0x2')](_0x1a63d8);_0x3d5209['verify'](function(_0x19ddf2,_0x216134){if(_0x19ddf2){_0x3dea46(_0x19ddf2[_0x4a84('0x5')]());}else{if(_0x216134){_0x5117ac(_0x216134);}else{_0x3dea46('Not\x20verifired');}}});});};module[_0x4a84('0x8')]=EmailSmtp; \ No newline at end of file +var _0xc4a7=['nodemailer-plugin-inline-base64','prototype','use','compile','sendMail','toString','verify','createTransport','nodemailer'];(function(_0x5ebc04,_0x14a363){var _0x17845c=function(_0x360850){while(--_0x360850){_0x5ebc04['push'](_0x5ebc04['shift']());}};_0x17845c(++_0x14a363);}(_0xc4a7,0xce));var _0x7c4a=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xc4a7[_0x167cc1];return _0x10bc4b;};'use strict';var nodemailer=require(_0x7c4a('0x0'));var inlineBase64=require(_0x7c4a('0x1'));function EmailSmtp(){}EmailSmtp[_0x7c4a('0x2')]['send']=function(_0x382715,_0x57a0e6){return new Promise(function(_0x124019,_0x3eb455){var _0x3271ea=nodemailer['createTransport'](_0x382715);_0x3271ea[_0x7c4a('0x3')](_0x7c4a('0x4'),inlineBase64());_0x3271ea[_0x7c4a('0x5')](_0x57a0e6,function(_0x40a881,_0xe999a8){if(_0x40a881){_0x3eb455(_0x40a881[_0x7c4a('0x6')]());}else{_0x124019(_0xe999a8);}});});};EmailSmtp[_0x7c4a('0x2')][_0x7c4a('0x7')]=function(_0x504362){return new Promise(function(_0x2a6c20,_0x328382){var _0x53b3df=nodemailer[_0x7c4a('0x8')](_0x504362);_0x53b3df['verify'](function(_0x1cbfe4,_0x505213){if(_0x1cbfe4){_0x328382(_0x1cbfe4[_0x7c4a('0x6')]());}else{if(_0x505213){_0x2a6c20(_0x505213);}else{_0x328382('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 5591a14..b8a0a3c 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 _0x7b81=['generate','@xcally.com','head','name','substring','indexOf','split','length','join','pop','html','test','replace','includes','\x20[Attachment:\x20','\x20]','body','textAsHtml','originTo','email','message','originCc','isEmpty','bcc','attachments','type','filename','format','now','writeFileSync','content','contentType','headerLines','Auto-Submitted:\x20auto-replied','Precedence:\x20auto_reply','line','isAutoreply','parser','from','subject','messageId','inReplyTo','date','filter','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','first','BodyHTML','

Empty\x20message

','Attachments','Title','Data','generateXOAuth2Token','user=','utf-8','toString','base64','lodash','moment','path','node-tnef','../../../config/logger','../../../config/environment','value','address','anonymous'];(function(_0x8d236d,_0x15f603){var _0x2d5e3e=function(_0x2b767a){while(--_0x2b767a){_0x8d236d['push'](_0x8d236d['shift']());}};_0x2d5e3e(++_0x15f603);}(_0x7b81,0x89));var _0x17b8=function(_0x8ef71a,_0x241bb0){_0x8ef71a=_0x8ef71a-0x0;var _0x34997f=_0x7b81[_0x8ef71a];return _0x34997f;};'use strict';var _=require(_0x17b8('0x0'));var moment=require(_0x17b8('0x1'));var random=require('randomstring');var fs=require('fs');var path=require(_0x17b8('0x2'));var util=require('util');var tnef=require(_0x17b8('0x3'));var logger=require(_0x17b8('0x4'))('email');var config=require(_0x17b8('0x5'));function getAddress(_0x1fdd1b){var _0x55c37d=_['head'](_0x1fdd1b[_0x17b8('0x6')]);return _0x55c37d&&_0x55c37d['address']?_0x55c37d[_0x17b8('0x7')]:_0x17b8('0x8')+random[_0x17b8('0x9')](0x6)+_0x17b8('0xa');}function getFirstName(_0x6619a2){var _0x310846=_[_0x17b8('0xb')](_0x6619a2[_0x17b8('0x6')]);if(_0x310846&&_0x310846[_0x17b8('0xc')]){if(_0x310846[_0x17b8('0xc')]==_0x310846[_0x17b8('0x7')]){return _0x310846['name'][_0x17b8('0xd')](0x0,_0x310846[_0x17b8('0xc')][_0x17b8('0xe')]('@'));}var _0x4e4996=_0x310846['name'][_0x17b8('0xf')](/\s+/);return _0x4e4996[_0x17b8('0x10')]>0x1?_0x4e4996['slice'](0x0,-0x1)[_0x17b8('0x11')]('\x20'):_0x310846[_0x17b8('0xc')];}return'Anonymous';}function getLastName(_0x158576){var _0x394821=_[_0x17b8('0xb')](_0x158576[_0x17b8('0x6')]);if(_0x394821&&_0x394821['name']){var _0xba2d2d=_0x394821['name'][_0x17b8('0xf')](/\s+/);return _0xba2d2d[_0x17b8('0x10')]>0x1?_0xba2d2d[_0x17b8('0x12')]():'';}return'';}function getMails(_0xd0d5f,_0x35ec2f){var _0x1b5ad5='';for(var _0x655ec2=0x0;_0x655ec2<_0x35ec2f['value'][_0x17b8('0x10')];_0x655ec2+=0x1){if(_0x35ec2f[_0x17b8('0x6')][_0x655ec2][_0x17b8('0x7')]!==_0xd0d5f){if(!_['isEmpty'](_0x1b5ad5)){_0x1b5ad5+=',';}_0x1b5ad5+=_0x35ec2f[_0x17b8('0x6')][_0x655ec2]['name']||_0x35ec2f[_0x17b8('0x6')][_0x655ec2][_0x17b8('0x7')]||'';_0x1b5ad5+='\x20<';_0x1b5ad5+=_0x35ec2f[_0x17b8('0x6')][_0x655ec2]['address']?_0x35ec2f[_0x17b8('0x6')][_0x655ec2][_0x17b8('0x7')]:'anonymous'+random[_0x17b8('0x9')](0x6)+_0x17b8('0xa');_0x1b5ad5+='>';}}return _0x1b5ad5;}function parseEmail(_0x5efaf6,_0x1c2ee6,_0x13bf3a){if(_0x1c2ee6[_0x17b8('0x13')]){var _0x9ffe10=/)<[^<]*)*<\/script>/gi;while(_0x9ffe10[_0x17b8('0x14')](_0x1c2ee6[_0x17b8('0x13')])){_0x1c2ee6['html']=_0x1c2ee6[_0x17b8('0x13')][_0x17b8('0x15')](_0x9ffe10,'');}if(_0x1c2ee6['html'][_0x17b8('0x16')](_0x17b8('0x17'))){var _0x2c242c=[];_0x1c2ee6['attachments'][_0x17b8('0x18')](_0x370f15=>{_0x2c242c[_0x17b8('0x19')](_0x370f15['filename']);});var _0x21017f=/]+>/g;var _0x1c21cc=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x66aa09=_0x1c2ee6[_0x17b8('0x13')][_0x17b8('0x15')](_0x1c21cc,_0x17b8('0x1a'));var _0x1178d6=_0x66aa09[_0x17b8('0x15')](_0x21017f,_0x17b8('0x1b'));for(let _0x27444f=0x0;_0x27444f<_0x2c242c[_0x17b8('0x10')];_0x27444f++){var _0x47a2f9=_0x1178d6[_0x17b8('0x15')](_0x17b8('0x1b'),_0x17b8('0x1c')+_0x2c242c[_0x27444f]+_0x17b8('0x1d'));_0x1178d6=_0x47a2f9;}_0x1c2ee6[_0x17b8('0x13')]=_0x1178d6;}_0x13bf3a[_0x17b8('0x1e')]=_0x1c2ee6[_0x17b8('0x13')];}else{_0x13bf3a[_0x17b8('0x1e')]=_0x1c2ee6[_0x17b8('0x1f')];}if(_0x13bf3a[_0x17b8('0x1e')]){_0x13bf3a[_0x17b8('0x1e')]=_0x13bf3a[_0x17b8('0x1e')][_0x17b8('0x15')](/0x0){var _0x2b1c0b=[_0x17b8('0x2f'),'X-Auto-Response-Suppress:\x20All',_0x17b8('0x30')];for(var _0x136a55=0x0;_0x136a55<_0x1c2ee6[_0x17b8('0x2e')][_0x17b8('0x10')];_0x136a55++){var _0x7562b5=_[_0x17b8('0xe')](_0x2b1c0b,_0x1c2ee6[_0x17b8('0x2e')][_0x136a55][_0x17b8('0x31')]);if(_0x7562b5>=0x0){_0x13bf3a[_0x17b8('0x32')]=!![];}}}return _0x13bf3a;}exports[_0x17b8('0x33')]=function(_0x18939e,_0x450340,_0x3d5911){var _0x39c521={'from':getAddress(_0x450340[_0x17b8('0x34')]),'firstName':getFirstName(_0x450340[_0x17b8('0x34')]),'lastName':getLastName(_0x450340[_0x17b8('0x34')]),'mapKey':_0x17b8('0x21'),'message':{'from':getMails(_0x18939e['email'],_0x450340[_0x17b8('0x34')]),'to':_0x18939e[_0x17b8('0x21')],'cc':'','subject':_0x450340[_0x17b8('0x35')]||'','messageId':_0x450340[_0x17b8('0x36')],'inReplyTo':_0x450340[_0x17b8('0x37')],'sentAt':moment(_0x450340[_0x17b8('0x38')])[_0x17b8('0x29')]('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x450340['html']&&!_0x450340[_0x17b8('0x1f')]){var _0x76ed1=_[_0x17b8('0x39')](_0x450340[_0x17b8('0x26')],{'contentType':_0x17b8('0x3a')});if(_0x76ed1['length']){logger[_0x17b8('0x3b')](util[_0x17b8('0x29')](_0x17b8('0x3c'),_0x450340['messageId']));tnef[_0x17b8('0x3d')](_[_0x17b8('0x3e')](_0x76ed1)[_0x17b8('0x2c')],function(_0x1a8be4,_0x716131){if(_0x716131){_0x450340[_0x17b8('0x13')]=_0x716131[_0x17b8('0x3f')]||_0x17b8('0x40');if(_0x716131[_0x17b8('0x41')]){for(var _0x599c03=0x0;_0x599c03<_0x716131[_0x17b8('0x41')][_0x17b8('0x10')];_0x599c03++){var _0x9d4e53=_0x716131['Attachments'][_0x599c03];_0x39c521[_0x17b8('0x22')][_0x17b8('0x26')][_0x17b8('0x19')]({'filename':_0x9d4e53[_0x17b8('0x42')],'content':Buffer['from'](_0x9d4e53[_0x17b8('0x43')])});}}}_0x3d5911(parseEmail(_0x18939e,_0x450340,_0x39c521));});}else{_0x450340['html']=_0x17b8('0x40');_0x3d5911(parseEmail(_0x18939e,_0x450340,_0x39c521));}}else{_0x3d5911(parseEmail(_0x18939e,_0x450340,_0x39c521));}};exports[_0x17b8('0x44')]=function(_0x517648,_0x1f79f4){var _0x8aaaca=[_0x17b8('0x45')+(_0x1f79f4||''),'auth=Bearer\x20'+_0x517648,'',''];return Buffer['from'](_0x8aaaca['join'](''),_0x17b8('0x46'))[_0x17b8('0x47')](_0x17b8('0x48'));}; \ No newline at end of file +var _0x5302=['originTo','bcc','attach','attachment','attachment-','format','%s-%s','root','writeFileSync','content','headerLines','Auto-Submitted:\x20auto-replied','Precedence:\x20auto_reply','isAutoreply','from','messageId','inReplyTo','application/ms-tnef','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','BodyHTML','

Empty\x20message

','Attachments','Data','utf-8','toString','base64','lodash','moment','path','util','node-tnef','head','value','address','anonymous','generate','@xcally.com','name','indexOf','length','slice','join','Anonymous','split','pop','isEmpty','html','test','includes','\x20[Attachment:\x20','\x20]','body','textAsHtml','0x1?_0x3b0d0c[_0x2530('0xe')](0x0,-0x1)[_0x2530('0xf')]('\x20'):_0x15a767[_0x2530('0xb')];}return _0x2530('0x10');}function getLastName(_0x22ef59){var _0x224b74=_[_0x2530('0x5')](_0x22ef59['value']);if(_0x224b74&&_0x224b74[_0x2530('0xb')]){var _0x56f873=_0x224b74['name'][_0x2530('0x11')](/\s+/);return _0x56f873['length']>0x1?_0x56f873[_0x2530('0x12')]():'';}return'';}function getMails(_0x155f02,_0x4d8dd8){var _0x11288f='';for(var _0x2993dd=0x0;_0x2993dd<_0x4d8dd8[_0x2530('0x6')][_0x2530('0xd')];_0x2993dd+=0x1){if(_0x4d8dd8[_0x2530('0x6')][_0x2993dd]['address']!==_0x155f02){if(!_[_0x2530('0x13')](_0x11288f)){_0x11288f+=',';}_0x11288f+=_0x4d8dd8['value'][_0x2993dd][_0x2530('0xb')]||_0x4d8dd8[_0x2530('0x6')][_0x2993dd][_0x2530('0x7')]||'';_0x11288f+='\x20<';_0x11288f+=_0x4d8dd8[_0x2530('0x6')][_0x2993dd]['address']?_0x4d8dd8['value'][_0x2993dd][_0x2530('0x7')]:_0x2530('0x8')+random[_0x2530('0x9')](0x6)+_0x2530('0xa');_0x11288f+='>';}}return _0x11288f;}function parseEmail(_0x59d570,_0x44f85d,_0x289c5f){if(_0x44f85d[_0x2530('0x14')]){var _0x353d91=/)<[^<]*)*<\/script>/gi;while(_0x353d91[_0x2530('0x15')](_0x44f85d['html'])){_0x44f85d['html']=_0x44f85d[_0x2530('0x14')]['replace'](_0x353d91,'');}if(_0x44f85d[_0x2530('0x14')][_0x2530('0x16')](_0x2530('0x17'))){var _0x13c48a=[];_0x44f85d[_0x2530('0x18')][_0x2530('0x19')](_0x1f7bb6=>{_0x13c48a[_0x2530('0x1a')](_0x1f7bb6[_0x2530('0x1b')]);});var _0x39a167=/]+>/g;var _0x20b243=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x56bf76=_0x44f85d[_0x2530('0x14')][_0x2530('0x1c')](_0x20b243,_0x2530('0x1d'));var _0x54b6c0=_0x56bf76[_0x2530('0x1c')](_0x39a167,_0x2530('0x1e'));for(let _0x45740c=0x0;_0x45740c<_0x13c48a['length'];_0x45740c++){var _0x36e69e=_0x54b6c0[_0x2530('0x1c')]('_IMG',_0x2530('0x1f')+_0x13c48a[_0x45740c]+_0x2530('0x20'));_0x54b6c0=_0x36e69e;}_0x44f85d[_0x2530('0x14')]=_0x54b6c0;}_0x289c5f['body']=_0x44f85d[_0x2530('0x14')];}else{_0x289c5f[_0x2530('0x21')]=_0x44f85d[_0x2530('0x22')];}if(_0x289c5f[_0x2530('0x21')]){_0x289c5f[_0x2530('0x21')]=_0x289c5f['body'][_0x2530('0x1c')](/0x0){var _0x4f3c5b=[_0x2530('0x32'),'X-Auto-Response-Suppress:\x20All',_0x2530('0x33')];for(var _0x17ac27=0x0;_0x17ac27<_0x44f85d['headerLines'][_0x2530('0xd')];_0x17ac27++){var _0xbaed55=_[_0x2530('0xc')](_0x4f3c5b,_0x44f85d[_0x2530('0x31')][_0x17ac27]['line']);if(_0xbaed55>=0x0){_0x289c5f[_0x2530('0x34')]=!![];}}}return _0x289c5f;}exports['parser']=function(_0x4ab555,_0x2cc65d,_0x276782){var _0x50fdc3={'from':getAddress(_0x2cc65d[_0x2530('0x35')]),'firstName':getFirstName(_0x2cc65d['from']),'lastName':getLastName(_0x2cc65d[_0x2530('0x35')]),'mapKey':_0x2530('0x25'),'message':{'from':getMails(_0x4ab555[_0x2530('0x25')],_0x2cc65d[_0x2530('0x35')]),'to':_0x4ab555[_0x2530('0x25')],'cc':'','subject':_0x2cc65d['subject']||'','messageId':_0x2cc65d[_0x2530('0x36')],'inReplyTo':_0x2cc65d[_0x2530('0x37')],'sentAt':moment(_0x2cc65d['date'])['format']('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x2cc65d[_0x2530('0x14')]&&!_0x2cc65d[_0x2530('0x22')]){var _0x4b2d3c=_['filter'](_0x2cc65d['attachments'],{'contentType':_0x2530('0x38')});if(_0x4b2d3c[_0x2530('0xd')]){logger['info'](util[_0x2530('0x2c')](_0x2530('0x39'),_0x2cc65d[_0x2530('0x36')]));tnef['parseBuffer'](_['first'](_0x4b2d3c)[_0x2530('0x30')],function(_0x47baeb,_0xb57c5a){if(_0xb57c5a){_0x2cc65d[_0x2530('0x14')]=_0xb57c5a[_0x2530('0x3a')]||_0x2530('0x3b');if(_0xb57c5a[_0x2530('0x3c')]){for(var _0xe68872=0x0;_0xe68872<_0xb57c5a[_0x2530('0x3c')][_0x2530('0xd')];_0xe68872++){var _0x326b1d=_0xb57c5a[_0x2530('0x3c')][_0xe68872];_0x50fdc3[_0x2530('0x24')][_0x2530('0x18')][_0x2530('0x1a')]({'filename':_0x326b1d['Title'],'content':Buffer[_0x2530('0x35')](_0x326b1d[_0x2530('0x3d')])});}}}_0x276782(parseEmail(_0x4ab555,_0x2cc65d,_0x50fdc3));});}else{_0x2cc65d[_0x2530('0x14')]='

Empty\x20message

';_0x276782(parseEmail(_0x4ab555,_0x2cc65d,_0x50fdc3));}}else{_0x276782(parseEmail(_0x4ab555,_0x2cc65d,_0x50fdc3));}};exports['generateXOAuth2Token']=function(_0x1136e7,_0x56d17a){var _0x375f3b=['user='+(_0x56d17a||''),'auth=Bearer\x20'+_0x1136e7,'',''];return Buffer[_0x2530('0x35')](_0x375f3b['join'](''),_0x2530('0x3e'))[_0x2530('0x3f')](_0x2530('0x40'));}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 5cf80bf..e195f2a 100644 --- a/server/services/email/model/mailAccount.js +++ b/server/services/email/model/mailAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe017=['name','Service','key','SERV','active','Imap','Smtp','exports'];(function(_0x29ad39,_0x1f3f1b){var _0xc5c7fb=function(_0x3a005f){while(--_0x3a005f){_0x29ad39['push'](_0x29ad39['shift']());}};_0xc5c7fb(++_0x1f3f1b);}(_0xe017,0x158));var _0x7e01=function(_0x43bceb,_0x23e4a3){_0x43bceb=_0x43bceb-0x0;var _0x3c00e9=_0xe017[_0x43bceb];return _0x3c00e9;};'use strict';var _=require('lodash');function MailAccount(_0x8cee6){this['id']=_0x8cee6['id']||0x0;this[_0x7e01('0x0')]=_0x8cee6[_0x7e01('0x0')]||_0x7e01('0x1');this[_0x7e01('0x2')]=_0x8cee6[_0x7e01('0x2')]||_0x7e01('0x3');this['active']=_0x8cee6[_0x7e01('0x4')]||![];this[_0x7e01('0x5')]=_0x8cee6[_0x7e01('0x5')]||[];this[_0x7e01('0x6')]=_0x8cee6[_0x7e01('0x6')]||[];}module[_0x7e01('0x7')]=MailAccount; \ No newline at end of file +var _0x868e=['Smtp','exports','lodash','name','key','SERV','active','Imap'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x868e,0x13a));var _0xe868=function(_0x2f2f6b,_0x3d457e){_0x2f2f6b=_0x2f2f6b-0x0;var _0x483665=_0x868e[_0x2f2f6b];return _0x483665;};'use strict';var _=require(_0xe868('0x0'));function MailAccount(_0x25362c){this['id']=_0x25362c['id']||0x0;this[_0xe868('0x1')]=_0x25362c[_0xe868('0x1')]||'Service';this['key']=_0x25362c[_0xe868('0x2')]||_0xe868('0x3');this[_0xe868('0x4')]=_0x25362c[_0xe868('0x4')]||![];this[_0xe868('0x5')]=_0x25362c[_0xe868('0x5')]||[];this['Smtp']=_0x25362c[_0xe868('0x6')]||[];}module[_0xe868('0x7')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 324bb3e..d7488c9 100644 --- a/server/services/email/realtime/index.js +++ b/server/services/email/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4ac2=['initMailAccounts','length','mailAccounts','exports','lodash','../model/mailAccount','mapKeys','hasOwnProperty','prototype','mergeFromDatabase'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x4ac2,0x126));var _0x24ac=function(_0x2290a7,_0x160575){_0x2290a7=_0x2290a7-0x0;var _0x7bd2f3=_0x4ac2[_0x2290a7];return _0x7bd2f3;};'use strict';var _=require(_0x24ac('0x0'));var MailAccount=require(_0x24ac('0x1'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x5a9b01,_0x19f661,_0x3dfae7){var _0x40b70e=_[_0x24ac('0x2')](_0x5a9b01,function(_0x51e22b,_0x3ee6b1){return _0x51e22b[_0x3dfae7];});for(var _0x107906 in _0x19f661){if(_0x19f661[_0x24ac('0x3')](_0x107906)){if(!_0x40b70e[_0x107906]){delete _0x19f661[_0x107906];}}}}Realtime[_0x24ac('0x4')][_0x24ac('0x5')]=function(_0x2be3cd,_0x1ce101){for(var _0x411856 in _0x1ce101){if(_0x2be3cd['hasOwnProperty'](_0x411856)){_0x2be3cd[_0x411856]=_0x1ce101[_0x411856];}}};Realtime[_0x24ac('0x4')][_0x24ac('0x6')]=function(){var _0x3b20e0=this;return function(_0x501a95){if(_0x501a95){freeIsNotKey(_0x501a95,_0x3b20e0['mailAccounts'],'id');for(var _0xb7d496=0x0,_0x9738a8={},_0x10163c={};_0xb7d496<_0x501a95[_0x24ac('0x7')];_0xb7d496+=0x1){_0x9738a8=_0x501a95[_0xb7d496];if(_['isUndefined'](_0x3b20e0['mailAccounts'][_0x9738a8['id']])){_0x3b20e0[_0x24ac('0x8')][_0x9738a8['id']]=new MailAccount(_0x9738a8);}else{_['merge'](_0x3b20e0['mailAccounts'][_0x9738a8['id']],_0x9738a8);}}}return _0x3b20e0[_0x24ac('0x8')];};};module[_0x24ac('0x9')]=Realtime; \ No newline at end of file +var _0x273d=['mergeFromDatabase','hasOwnProperty','prototype','length','isUndefined','lodash','../model/mailAccount','mailAccounts'];(function(_0xdb8408,_0x4d3152){var _0x52e21b=function(_0x28d965){while(--_0x28d965){_0xdb8408['push'](_0xdb8408['shift']());}};_0x52e21b(++_0x4d3152);}(_0x273d,0x1d5));var _0xd273=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x273d[_0x4fde08];return _0x12e725;};'use strict';var _=require(_0xd273('0x0'));var MailAccount=require(_0xd273('0x1'));var Realtime=function(){this[_0xd273('0x2')]={};};function freeIsNotKey(_0x417299,_0x4e78e4,_0x4c86ef){var _0x5e2f84=_['mapKeys'](_0x417299,function(_0x3f5c8c,_0x21f8a7){return _0x3f5c8c[_0x4c86ef];});for(var _0x58cd4f in _0x4e78e4){if(_0x4e78e4['hasOwnProperty'](_0x58cd4f)){if(!_0x5e2f84[_0x58cd4f]){delete _0x4e78e4[_0x58cd4f];}}}}Realtime['prototype'][_0xd273('0x3')]=function(_0x3d713b,_0x2bba3e){for(var _0x3e1580 in _0x2bba3e){if(_0x3d713b[_0xd273('0x4')](_0x3e1580)){_0x3d713b[_0x3e1580]=_0x2bba3e[_0x3e1580];}}};Realtime[_0xd273('0x5')]['initMailAccounts']=function(){var _0x59143b=this;return function(_0x4c02bf){if(_0x4c02bf){freeIsNotKey(_0x4c02bf,_0x59143b[_0xd273('0x2')],'id');for(var _0x34329f=0x0,_0x200ee0={},_0x409696={};_0x34329f<_0x4c02bf[_0xd273('0x6')];_0x34329f+=0x1){_0x200ee0=_0x4c02bf[_0x34329f];if(_[_0xd273('0x7')](_0x59143b['mailAccounts'][_0x200ee0['id']])){_0x59143b[_0xd273('0x2')][_0x200ee0['id']]=new MailAccount(_0x200ee0);}else{_['merge'](_0x59143b[_0xd273('0x2')][_0x200ee0['id']],_0x200ee0);}}}return _0x59143b['mailAccounts'];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index c7f77bc..7fa598a 100644 --- a/server/services/email/rpc/mailAccount.js +++ b/server/services/email/rpc/mailAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfe91=['Imap','CloudProvider','name','data5','Smtp','type','getMailAccount','NotifyMailAccount','../client','GetMailAccount','provider','service','email','active','key','ListId','TemplateId'];(function(_0x4ea69d,_0x290f53){var _0x5318e0=function(_0x18e081){while(--_0x18e081){_0x4ea69d['push'](_0x4ea69d['shift']());}};_0x5318e0(++_0x290f53);}(_0xfe91,0xd4));var _0x1fe9=function(_0x511bd1,_0x223e5b){_0x511bd1=_0x511bd1-0x0;var _0x4c48ec=_0xfe91[_0x511bd1];return _0x4c48ec;};'use strict';var client=require(_0x1fe9('0x0'));exports['getMailAccounts']=function(){return function(){return client['Request'](_0x1fe9('0x1'),{'options':{'attributes':['id','name',_0x1fe9('0x2'),_0x1fe9('0x3'),_0x1fe9('0x4'),_0x1fe9('0x5'),_0x1fe9('0x6'),_0x1fe9('0x7'),_0x1fe9('0x8')],'raw':![],'include':[{'model':'MailServerIn','as':_0x1fe9('0x9'),'include':[{'model':_0x1fe9('0xa'),'attributes':['id',_0x1fe9('0xb'),'service','type',_0x1fe9('0xc')],'as':_0x1fe9('0xa')}]},{'model':'MailServerOut','as':_0x1fe9('0xd'),'include':[{'model':_0x1fe9('0xa'),'attributes':['id',_0x1fe9('0xb'),_0x1fe9('0x3'),_0x1fe9('0xe'),_0x1fe9('0xc')],'as':_0x1fe9('0xa')}]}]},'log':_0x1fe9('0xf')});};};exports['notify']=function(_0x3e45f8,_0x22ea5f){return client['Request'](_0x1fe9('0x10'),{'account':{'id':_0x3e45f8},'body':_0x22ea5f,'log':_0x1fe9('0x10')});}; \ No newline at end of file +var _0x2041=['provider','service','active','key','ListId','TemplateId','MailServerIn','Imap','CloudProvider','data5','MailServerOut','Smtp','type','getMailAccount','notify','Request','NotifyMailAccount','../client','getMailAccounts','GetMailAccount','name'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0x2041,0x10d));var _0x1204=function(_0x5c083e,_0x3ea831){_0x5c083e=_0x5c083e-0x0;var _0x3fd6be=_0x2041[_0x5c083e];return _0x3fd6be;};'use strict';var client=require(_0x1204('0x0'));exports[_0x1204('0x1')]=function(){return function(){return client['Request'](_0x1204('0x2'),{'options':{'attributes':['id',_0x1204('0x3'),_0x1204('0x4'),_0x1204('0x5'),'email',_0x1204('0x6'),_0x1204('0x7'),_0x1204('0x8'),_0x1204('0x9')],'raw':![],'include':[{'model':_0x1204('0xa'),'as':_0x1204('0xb'),'include':[{'model':_0x1204('0xc'),'attributes':['id',_0x1204('0x3'),_0x1204('0x5'),'type',_0x1204('0xd')],'as':_0x1204('0xc')}]},{'model':_0x1204('0xe'),'as':_0x1204('0xf'),'include':[{'model':_0x1204('0xc'),'attributes':['id',_0x1204('0x3'),_0x1204('0x5'),_0x1204('0x10'),_0x1204('0xd')],'as':_0x1204('0xc')}]}]},'log':_0x1204('0x11')});};};exports[_0x1204('0x12')]=function(_0x401eed,_0x1fbfd8){return client[_0x1204('0x13')]('NotifyMailAccount',{'account':{'id':_0x401eed},'body':_0x1fbfd8,'log':_0x1204('0x14')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 4f6a00f..429ecda 100644 --- a/server/services/email/rpc/setting.js +++ b/server/services/email/rpc/setting.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x267d=['getSettings','Request','loginMailFrequency','GetSettings','../client'];(function(_0x4deae5,_0x4d9e8c){var _0xa23879=function(_0x1a5d7f){while(--_0x1a5d7f){_0x4deae5['push'](_0x4deae5['shift']());}};_0xa23879(++_0x4d9e8c);}(_0x267d,0x14e));var _0xd267=function(_0x1685e6,_0x44f7e5){_0x1685e6=_0x1685e6-0x0;var _0x3c9b66=_0x267d[_0x1685e6];return _0x3c9b66;};'use strict';var client=require(_0xd267('0x0'));exports[_0xd267('0x1')]=function(){return client[_0xd267('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xd267('0x3')]},'log':_0xd267('0x4')});}; \ No newline at end of file +var _0xe567=['Request','ShowSetting','loginMailFrequency','GetSettings','../client','getSettings'];(function(_0x1d50cd,_0xf067ab){var _0x54d0a2=function(_0x3b7d9d){while(--_0x3b7d9d){_0x1d50cd['push'](_0x1d50cd['shift']());}};_0x54d0a2(++_0xf067ab);}(_0xe567,0x7c));var _0x7e56=function(_0x10f132,_0x1506fe){_0x10f132=_0x10f132-0x0;var _0x2222db=_0xe567[_0x10f132];return _0x2222db;};'use strict';var client=require(_0x7e56('0x0'));exports[_0x7e56('0x1')]=function(){return client[_0x7e56('0x2')](_0x7e56('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x7e56('0x4')]},'log':_0x7e56('0x5')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index b57fc39..4959ed2 100644 --- a/server/services/email/server/index.js +++ b/server/services/email/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file +var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xa9e0[_0x521929];return _0x632436;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file diff --git a/server/services/express/index.js b/server/services/express/index.js index 47b8d33..102bdb0 100644 --- a/server/services/express/index.js +++ b/server/services/express/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6032=['Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','express','sticky-session','ioredis','../../config/environment','createServer','timeout','listen','port','socket.io','websocket','redis','defaults','adapter','../../config/triggers','default','../../config/express','../../routes','once','listening'];(function(_0x30c394,_0x38b025){var _0x5de181=function(_0x384cd2){while(--_0x384cd2){_0x30c394['push'](_0x30c394['shift']());}};_0x5de181(++_0x38b025);}(_0x6032,0x116));var _0x2603=function(_0x482d88,_0x1e4c15){_0x482d88=_0x482d88-0x0;var _0x54c7c2=_0x6032[_0x482d88];return _0x54c7c2;};'use strict';var _=require(_0x2603('0x0'));var http=require(_0x2603('0x1'));var express=require(_0x2603('0x2'));var sticky=require(_0x2603('0x3'));var Redis=require(_0x2603('0x4'));var config=require(_0x2603('0x5'));var app=express();var server=http[_0x2603('0x6')](app);server[_0x2603('0x7')]=0xdbba0;if(sticky[_0x2603('0x8')](server,config[_0x2603('0x9')])){var socketio=require(_0x2603('0xa'))(server,{'transports':[_0x2603('0xb'),'polling']});config[_0x2603('0xc')]=_[_0x2603('0xd')](config[_0x2603('0xc')],{'host':'localhost','port':0x18eb});socketio[_0x2603('0xe')](require('socket.io-redis')({'pubClient':new Redis(config[_0x2603('0xc')]),'subClient':new Redis(config[_0x2603('0xc')])}));require(_0x2603('0xf'))[_0x2603('0x10')]();require('../../config/socketio')['default'](socketio);require(_0x2603('0x11'))[_0x2603('0x10')](app);require(_0x2603('0x12'))[_0x2603('0x10')](app);}else{server[_0x2603('0x13')](_0x2603('0x14'),function(){console['log'](_0x2603('0x15'),config[_0x2603('0x9')]);});}exports=module[_0x2603('0x16')]=app; \ No newline at end of file +var _0x3377=['polling','redis','localhost','adapter','../../config/triggers','../../config/socketio','default','../../config/express','../../routes','once','listening','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','ioredis','../../config/environment','createServer','timeout','listen','port','socket.io'];(function(_0xcad8a8,_0x5ed2c4){var _0x2ac2ee=function(_0x33ee01){while(--_0x33ee01){_0xcad8a8['push'](_0xcad8a8['shift']());}};_0x2ac2ee(++_0x5ed2c4);}(_0x3377,0xca));var _0x7337=function(_0x146299,_0x4433ab){_0x146299=_0x146299-0x0;var _0x77726=_0x3377[_0x146299];return _0x77726;};'use strict';var _=require(_0x7337('0x0'));var http=require('http');var express=require('express');var sticky=require('sticky-session');var Redis=require(_0x7337('0x1'));var config=require(_0x7337('0x2'));var app=express();var server=http[_0x7337('0x3')](app);server[_0x7337('0x4')]=0xdbba0;if(sticky[_0x7337('0x5')](server,config[_0x7337('0x6')])){var socketio=require(_0x7337('0x7'))(server,{'transports':['websocket',_0x7337('0x8')]});config[_0x7337('0x9')]=_['defaults'](config[_0x7337('0x9')],{'host':_0x7337('0xa'),'port':0x18eb});socketio[_0x7337('0xb')](require('socket.io-redis')({'pubClient':new Redis(config[_0x7337('0x9')]),'subClient':new Redis(config['redis'])}));require(_0x7337('0xc'))['default']();require(_0x7337('0xd'))[_0x7337('0xe')](socketio);require(_0x7337('0xf'))[_0x7337('0xe')](app);require(_0x7337('0x10'))[_0x7337('0xe')](app);}else{server[_0x7337('0x11')](_0x7337('0x12'),function(){console['log'](_0x7337('0x13'),config[_0x7337('0x6')]);});}exports=module[_0x7337('0x14')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 3ef66a3..64a5714 100644 --- a/server/services/routing/client.js +++ b/server/services/routing/client.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x45e7=['bluebird','../../config/logger','routing','http','Request','request','then','debug','rpc','error','message','catch'];(function(_0x6f06d8,_0x27df2b){var _0xce6410=function(_0x5681d0){while(--_0x5681d0){_0x6f06d8['push'](_0x6f06d8['shift']());}};_0xce6410(++_0x27df2b);}(_0x45e7,0x174));var _0x745e=function(_0x173452,_0x3aa870){_0x173452=_0x173452-0x0;var _0xee3fd0=_0x45e7[_0x173452];return _0xee3fd0;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x745e('0x0'));var logger=require(_0x745e('0x1'))(_0x745e('0x2'));var client=jayson['client'][_0x745e('0x3')]({'port':0x2329});client[_0x745e('0x4')]=function(_0x1a5a1f,_0x445607){return new BPromise(function(_0x162d5e,_0x776a2b){return client[_0x745e('0x5')](_0x1a5a1f,_0x445607)[_0x745e('0x6')](function(_0x2a80e8){logger[_0x745e('0x7')](_0x745e('0x8'),_0x745e('0x2'),_0x1a5a1f,_0x445607,_0x2a80e8);if(_0x2a80e8[_0x745e('0x9')]){logger[_0x745e('0x9')](_0x745e('0x8'),_0x745e('0x2'),_0x1a5a1f,_0x2a80e8[_0x745e('0x9')][_0x745e('0xa')],_0x445607);return _0x776a2b(_0x2a80e8[_0x745e('0x9')][_0x745e('0xa')]);}else{return _0x162d5e(_0x2a80e8['result']);}})[_0x745e('0xb')](function(_0x21a138){logger[_0x745e('0x9')](_0x745e('0x8'),_0x745e('0x2'),_0x1a5a1f,_0x21a138,_0x445607);return _0x776a2b(_0x21a138);});});};module['exports']=client; \ No newline at end of file +var _0x5e64=['routing','client','http','Request','request','rpc','error','message','result','catch','../../config/logger'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5e64,0x78));var _0x45e6=function(_0x1ab20a,_0x50a80a){_0x1ab20a=_0x1ab20a-0x0;var _0x42c089=_0x5e64[_0x1ab20a];return _0x42c089;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x45e6('0x0'))(_0x45e6('0x1'));var client=jayson[_0x45e6('0x2')][_0x45e6('0x3')]({'port':0x2329});client[_0x45e6('0x4')]=function(_0x3940e2,_0x6661ab){return new BPromise(function(_0x34df26,_0x6cbbb1){return client[_0x45e6('0x5')](_0x3940e2,_0x6661ab)['then'](function(_0x43b07a){logger['debug'](_0x45e6('0x6'),_0x45e6('0x1'),_0x3940e2,_0x6661ab,_0x43b07a);if(_0x43b07a[_0x45e6('0x7')]){logger[_0x45e6('0x7')](_0x45e6('0x6'),'routing',_0x3940e2,_0x43b07a[_0x45e6('0x7')][_0x45e6('0x8')],_0x6661ab);return _0x6cbbb1(_0x43b07a[_0x45e6('0x7')]['message']);}else{return _0x34df26(_0x43b07a[_0x45e6('0x9')]);}})[_0x45e6('0xa')](function(_0x1715ca){logger[_0x45e6('0x7')](_0x45e6('0x6'),'routing',_0x3940e2,_0x1715ca,_0x6661ab);return _0x6cbbb1(_0x1715ca);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index b6d780a..dd4abe9 100644 --- a/server/services/routing/index.js +++ b/server/services/routing/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc058=['getAgents','initAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','listen','catch','log','bluebird','./realtime','./rpc/interval','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then'];(function(_0x446ea4,_0x132046){var _0xa5fa71=function(_0x19f58d){while(--_0x19f58d){_0x446ea4['push'](_0x446ea4['shift']());}};_0xa5fa71(++_0x132046);}(_0xc058,0x1ee));var _0x8c05=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0xc058[_0x3ab9ee];return _0x82ee88;};'use strict';var BPromise=require(_0x8c05('0x0'));var server=require('./server');var Realtime=require(_0x8c05('0x1'));var user=require('./rpc/user');var interval=require(_0x8c05('0x2'));var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0x8c05('0x3'));var smsQueue=require(_0x8c05('0x4'));var mailQueue=require(_0x8c05('0x5'));var faxQueue=require(_0x8c05('0x6'));var whatsappQueue=require(_0x8c05('0x7'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x8c05('0x8')]()[_0x8c05('0x9')](user[_0x8c05('0xa')]())['then'](realtime[_0x8c05('0xb')]())[_0x8c05('0x9')](interval[_0x8c05('0xc')]())[_0x8c05('0x9')](realtime[_0x8c05('0xd')]())[_0x8c05('0x9')](openchannelQueue[_0x8c05('0xe')]())['then'](realtime[_0x8c05('0xf')]())['then'](chatQueue[_0x8c05('0x10')]())[_0x8c05('0x9')](realtime[_0x8c05('0x11')]())[_0x8c05('0x9')](smsQueue[_0x8c05('0x12')]())[_0x8c05('0x9')](realtime[_0x8c05('0x13')]())[_0x8c05('0x9')](mailQueue[_0x8c05('0x14')]())[_0x8c05('0x9')](realtime[_0x8c05('0x15')]())['then'](faxQueue[_0x8c05('0x16')]())[_0x8c05('0x9')](realtime[_0x8c05('0x17')]())[_0x8c05('0x9')](whatsappQueue[_0x8c05('0x18')]())[_0x8c05('0x9')](realtime['initWhatsappQueues']())[_0x8c05('0x9')](function(){return realtime;});}function main(){return server[_0x8c05('0x19')](realtime)['then'](function(_0x1bfbe5){return initRealtime();})[_0x8c05('0x9')](function(_0xfcac56){return setInterval(initRealtime,0x1388);})[_0x8c05('0x1a')](function(_0x481b04){console[_0x8c05('0x1b')](_0x481b04);});}main(); \ No newline at end of file +var _0xc541=['./rpc/whatsappQueue','resolve','then','getAgents','getIntervals','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','log','bluebird','./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/faxQueue'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0xc541,0x1b1));var _0x1c54=function(_0x15797a,_0x16274f){_0x15797a=_0x15797a-0x0;var _0x3e2618=_0xc541[_0x15797a];return _0x3e2618;};'use strict';var BPromise=require(_0x1c54('0x0'));var server=require(_0x1c54('0x1'));var Realtime=require(_0x1c54('0x2'));var user=require(_0x1c54('0x3'));var interval=require(_0x1c54('0x4'));var openchannelQueue=require(_0x1c54('0x5'));var chatQueue=require(_0x1c54('0x6'));var smsQueue=require(_0x1c54('0x7'));var mailQueue=require('./rpc/mailQueue');var faxQueue=require(_0x1c54('0x8'));var whatsappQueue=require(_0x1c54('0x9'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x1c54('0xa')]()[_0x1c54('0xb')](user[_0x1c54('0xc')]())[_0x1c54('0xb')](realtime['initAgents']())[_0x1c54('0xb')](interval[_0x1c54('0xd')]())[_0x1c54('0xb')](realtime['initIntervals']())[_0x1c54('0xb')](openchannelQueue['getOpenchannelQueues']())[_0x1c54('0xb')](realtime[_0x1c54('0xe')]())[_0x1c54('0xb')](chatQueue[_0x1c54('0xf')]())['then'](realtime[_0x1c54('0x10')]())[_0x1c54('0xb')](smsQueue[_0x1c54('0x11')]())['then'](realtime[_0x1c54('0x12')]())[_0x1c54('0xb')](mailQueue[_0x1c54('0x13')]())['then'](realtime[_0x1c54('0x14')]())[_0x1c54('0xb')](faxQueue['getFaxQueues']())['then'](realtime[_0x1c54('0x15')]())['then'](whatsappQueue[_0x1c54('0x16')]())[_0x1c54('0xb')](realtime[_0x1c54('0x17')]())[_0x1c54('0xb')](function(){return realtime;});}function main(){return server[_0x1c54('0x18')](realtime)[_0x1c54('0xb')](function(_0xee8f95){return initRealtime();})[_0x1c54('0xb')](function(_0xa366f5){return setInterval(initRealtime,0x1388);})['catch'](function(_0x10327a){console[_0x1c54('0x19')](_0x10327a);});}main(); \ No newline at end of file diff --git a/server/services/routing/lib/rule-engine.js b/server/services/routing/lib/rule-engine.js index 56b83f6..9316399 100644 --- a/server/services/routing/lib/rule-engine.js +++ b/server/services/routing/lib/rule-engine.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['next','isEqual','restart','condition','matches','filter','turn','prioritize','findRules','length','priority','toJSON','map','toString','fromJSON','parse','object','exports','lodash','util','events','EventEmitter','isNil','register','ignoreFactChanges','inherits','rules','activeRules','prototype','isArray','concat','push','sync','orderBy','result','clone','consequence','name','index_','nextTick','ruleRef','call'];(function(_0x4a2441,_0x462750){var _0xc8cd5=function(_0x2adf07){while(--_0x2adf07){_0x4a2441['push'](_0x4a2441['shift']());}};_0xc8cd5(++_0x462750);}(_0x2ef3,0xba));var _0x32ef=function(_0xd6065b,_0x151263){_0xd6065b=_0xd6065b-0x0;var _0x398229=_0x2ef3[_0xd6065b];return _0x398229;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var EventEmitter=require(_0x32ef('0x2'))[_0x32ef('0x3')];function RuleEngine(_0x3944df,_0x38047b){this['init']();if(!_[_0x32ef('0x4')](_0x3944df)){this[_0x32ef('0x5')](_0x3944df);}if(_0x38047b){this['ignoreFactChanges']=_0x38047b[_0x32ef('0x6')];}return this;}util[_0x32ef('0x7')](RuleEngine,EventEmitter);RuleEngine['prototype']['init']=function(_0x2c0089){this[_0x32ef('0x8')]=[];this[_0x32ef('0x9')]=[];};RuleEngine[_0x32ef('0xa')][_0x32ef('0x5')]=function(_0x298066){if(Array[_0x32ef('0xb')](_0x298066)){this[_0x32ef('0x8')]=this[_0x32ef('0x8')][_0x32ef('0xc')](_0x298066);}else if(_0x298066!==null&&_['isObject'](_0x298066)){this['rules'][_0x32ef('0xd')](_0x298066);}this[_0x32ef('0xe')]();};RuleEngine[_0x32ef('0xa')][_0x32ef('0xe')]=function(){this['activeRules']=this[_0x32ef('0x8')]['filter'](function(_0x1a5106){if(_['isNil'](_0x1a5106['on'])){_0x1a5106['on']=!![];}if(_0x1a5106['on']===!![]){return _0x1a5106;}});this[_0x32ef('0x9')]=_[_0x32ef('0xf')](this['activeRules'],['p'],['asc']);};RuleEngine[_0x32ef('0xa')]['execute']=function(_0x326fce,_0x40a6e6){var _0x93d492=![];_0x326fce[_0x32ef('0x10')]=!![];var _0x57aff1=_['clone'](_0x326fce);var _0x531e30=_[_0x32ef('0x11')](_0x326fce);var _0x3950e6=this[_0x32ef('0x9')];var _0x53a5ca=[];var _0x5d559b=this[_0x32ef('0x6')];(function FnRuleLoop(_0x1a9476){var _0x286bfb={'rules':function(){return _0x3950e6;},'rule':function(){return _0x3950e6[_0x1a9476];},'when':function(_0x57863c){if(_0x57863c){var _0xbe37f6=_0x3950e6[_0x1a9476][_0x32ef('0x12')];_0xbe37f6['ruleRef']=_0x3950e6[_0x1a9476]['id']||_0x3950e6[_0x1a9476][_0x32ef('0x13')]||_0x32ef('0x14')+_0x1a9476;process[_0x32ef('0x15')](function(){_0x53a5ca[_0x32ef('0xd')](_0xbe37f6[_0x32ef('0x16')]);_0xbe37f6[_0x32ef('0x17')](_0x57aff1,_0x286bfb);});}else{process['nextTick'](function(){_0x286bfb[_0x32ef('0x18')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x93d492=!![];return FnRuleLoop(0x0);},'next':function(_0x5cc3ef){if(!_0x5d559b&&!_[_0x32ef('0x19')](_0x531e30,_0x57aff1)){_0x531e30=_[_0x32ef('0x11')](_0x57aff1);process['nextTick'](function(){_0x286bfb[_0x32ef('0x1a')]();});}else{process[_0x32ef('0x15')](function(){if(_[_0x32ef('0x4')](_0x5cc3ef)){return FnRuleLoop(_0x1a9476+0x1);}else{return FnRuleLoop(_0x5cc3ef);}});}}};if(_0x1a9476<_0x3950e6['length']&&_0x93d492===![]){var _0x57f5e5=_0x3950e6[_0x1a9476][_0x32ef('0x1b')];_0x57f5e5[_0x32ef('0x17')](_0x57aff1,_0x286bfb);}else{process[_0x32ef('0x15')](function(){_0x57aff1['matchPath']=_0x53a5ca;return _0x40a6e6?_0x40a6e6(_0x57aff1):_['noop']();});}}(0x0));};RuleEngine[_0x32ef('0xa')]['findRules']=function(_0x51a412){if(_[_0x32ef('0x4')](_0x51a412)){return this[_0x32ef('0x8')];}else{var _0x371540=_[_0x32ef('0x1c')](_0x51a412);return _[_0x32ef('0x1d')](this[_0x32ef('0x8')],_0x371540);}};RuleEngine[_0x32ef('0xa')][_0x32ef('0x1e')]=function(_0x338f19,_0x2f52d7){var _0x1335e2=_0x338f19==='on'||_0x338f19==='ON'?!![]:![];var _0xba4b3f=this['findRules'](_0x2f52d7);for(var _0xd65fde=0x0,_0x2f5d06=_0xba4b3f['length'];_0xd65fde<_0x2f5d06;_0xd65fde+=0x1){_0xba4b3f[_0xd65fde]['on']=_0x1335e2;}this[_0x32ef('0xe')]();};RuleEngine[_0x32ef('0xa')][_0x32ef('0x1f')]=function(_0x26e207,_0x50a95b){_0x26e207=parseInt(_0x26e207,0xa);var _0x10e38c=this[_0x32ef('0x20')](_0x50a95b);for(var _0x31dbc3=0x0,_0x2ac686=_0x10e38c[_0x32ef('0x21')];_0x31dbc3<_0x2ac686;_0x31dbc3+=0x1){_0x10e38c[_0x31dbc3][_0x32ef('0x22')]=_0x26e207;}this[_0x32ef('0xe')]();};RuleEngine['prototype'][_0x32ef('0x23')]=function(){var _0x537214=this[_0x32ef('0x8')];if(_0x537214 instanceof Array){_0x537214=_0x537214[_0x32ef('0x24')](function(_0x5a9565){_0x5a9565[_0x32ef('0x1b')]=_0x5a9565[_0x32ef('0x1b')][_0x32ef('0x25')]();_0x5a9565[_0x32ef('0x12')]=_0x5a9565[_0x32ef('0x12')]['toString']();return _0x5a9565;});}else if(!_['isNil'](_0x537214)){_0x537214[_0x32ef('0x1b')]=_0x537214['condition'][_0x32ef('0x25')]();_0x537214[_0x32ef('0x12')]=_0x537214[_0x32ef('0x12')][_0x32ef('0x25')]();}return _0x537214;};RuleEngine[_0x32ef('0xa')][_0x32ef('0x26')]=function(_0x566b56){this['init']();if(_['isString'](_0x566b56)){_0x566b56=JSON[_0x32ef('0x27')](_0x566b56);}if(_0x566b56 instanceof Array){_0x566b56=_0x566b56[_0x32ef('0x24')](function(_0x136b02){_0x136b02['condition']=eval('('+_0x136b02['condition']+')');_0x136b02[_0x32ef('0x12')]=eval('('+_0x136b02[_0x32ef('0x12')]+')');return _0x136b02;});}else if(_0x566b56!==null&&typeof _0x566b56==_0x32ef('0x28')){_0x566b56['condition']=eval('('+_0x566b56['condition']+')');_0x566b56[_0x32ef('0x12')]=eval('('+_0x566b56[_0x32ef('0x12')]+')');}this[_0x32ef('0x5')](_0x566b56);};module[_0x32ef('0x29')]=RuleEngine; \ No newline at end of file +var _0xc4aa=['ruleRef','name','nextTick','push','call','next','isEqual','restart','isNil','length','condition','matchPath','noop','findRules','matches','turn','prioritize','priority','toJSON','toString','fromJSON','isString','parse','register','exports','lodash','util','events','EventEmitter','ignoreFactChanges','inherits','prototype','init','rules','activeRules','isArray','concat','isObject','sync','filter','orderBy','asc','execute','result','clone','consequence'];(function(_0x2a8954,_0x5d1734){var _0x5604eb=function(_0x588704){while(--_0x588704){_0x2a8954['push'](_0x2a8954['shift']());}};_0x5604eb(++_0x5d1734);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xc4aa[_0x68c979];return _0x4f0001;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var EventEmitter=require(_0xac4a('0x2'))[_0xac4a('0x3')];function RuleEngine(_0x275161,_0x22469d){this['init']();if(!_['isNil'](_0x275161)){this['register'](_0x275161);}if(_0x22469d){this[_0xac4a('0x4')]=_0x22469d[_0xac4a('0x4')];}return this;}util[_0xac4a('0x5')](RuleEngine,EventEmitter);RuleEngine[_0xac4a('0x6')][_0xac4a('0x7')]=function(_0x15cd34){this[_0xac4a('0x8')]=[];this[_0xac4a('0x9')]=[];};RuleEngine['prototype']['register']=function(_0x1aba6d){if(Array[_0xac4a('0xa')](_0x1aba6d)){this[_0xac4a('0x8')]=this['rules'][_0xac4a('0xb')](_0x1aba6d);}else if(_0x1aba6d!==null&&_[_0xac4a('0xc')](_0x1aba6d)){this[_0xac4a('0x8')]['push'](_0x1aba6d);}this[_0xac4a('0xd')]();};RuleEngine['prototype'][_0xac4a('0xd')]=function(){this['activeRules']=this[_0xac4a('0x8')][_0xac4a('0xe')](function(_0x24291d){if(_['isNil'](_0x24291d['on'])){_0x24291d['on']=!![];}if(_0x24291d['on']===!![]){return _0x24291d;}});this[_0xac4a('0x9')]=_[_0xac4a('0xf')](this[_0xac4a('0x9')],['p'],[_0xac4a('0x10')]);};RuleEngine[_0xac4a('0x6')][_0xac4a('0x11')]=function(_0x34bc01,_0x33c287){var _0x190418=![];_0x34bc01[_0xac4a('0x12')]=!![];var _0x11e101=_[_0xac4a('0x13')](_0x34bc01);var _0x4a2119=_[_0xac4a('0x13')](_0x34bc01);var _0x34d797=this[_0xac4a('0x9')];var _0x144553=[];var _0x3e88e3=this[_0xac4a('0x4')];(function FnRuleLoop(_0x28e304){var _0x44ec59={'rules':function(){return _0x34d797;},'rule':function(){return _0x34d797[_0x28e304];},'when':function(_0x546c5d){if(_0x546c5d){var _0x5ac21e=_0x34d797[_0x28e304][_0xac4a('0x14')];_0x5ac21e[_0xac4a('0x15')]=_0x34d797[_0x28e304]['id']||_0x34d797[_0x28e304][_0xac4a('0x16')]||'index_'+_0x28e304;process[_0xac4a('0x17')](function(){_0x144553[_0xac4a('0x18')](_0x5ac21e[_0xac4a('0x15')]);_0x5ac21e[_0xac4a('0x19')](_0x11e101,_0x44ec59);});}else{process[_0xac4a('0x17')](function(){_0x44ec59[_0xac4a('0x1a')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x190418=!![];return FnRuleLoop(0x0);},'next':function(_0xe38996){if(!_0x3e88e3&&!_[_0xac4a('0x1b')](_0x4a2119,_0x11e101)){_0x4a2119=_['clone'](_0x11e101);process[_0xac4a('0x17')](function(){_0x44ec59[_0xac4a('0x1c')]();});}else{process['nextTick'](function(){if(_[_0xac4a('0x1d')](_0xe38996)){return FnRuleLoop(_0x28e304+0x1);}else{return FnRuleLoop(_0xe38996);}});}}};if(_0x28e304<_0x34d797[_0xac4a('0x1e')]&&_0x190418===![]){var _0x3eacd3=_0x34d797[_0x28e304][_0xac4a('0x1f')];_0x3eacd3['call'](_0x11e101,_0x44ec59);}else{process[_0xac4a('0x17')](function(){_0x11e101[_0xac4a('0x20')]=_0x144553;return _0x33c287?_0x33c287(_0x11e101):_[_0xac4a('0x21')]();});}}(0x0));};RuleEngine[_0xac4a('0x6')][_0xac4a('0x22')]=function(_0x2b0dc2){if(_[_0xac4a('0x1d')](_0x2b0dc2)){return this[_0xac4a('0x8')];}else{var _0x3e2c69=_[_0xac4a('0x23')](_0x2b0dc2);return _[_0xac4a('0xe')](this[_0xac4a('0x8')],_0x3e2c69);}};RuleEngine[_0xac4a('0x6')][_0xac4a('0x24')]=function(_0x1c13dc,_0x20202c){var _0x4e17ce=_0x1c13dc==='on'||_0x1c13dc==='ON'?!![]:![];var _0x23b061=this[_0xac4a('0x22')](_0x20202c);for(var _0x42a33c=0x0,_0x2772fe=_0x23b061[_0xac4a('0x1e')];_0x42a33c<_0x2772fe;_0x42a33c+=0x1){_0x23b061[_0x42a33c]['on']=_0x4e17ce;}this['sync']();};RuleEngine['prototype'][_0xac4a('0x25')]=function(_0x7a948b,_0x1f12d5){_0x7a948b=parseInt(_0x7a948b,0xa);var _0x546b65=this['findRules'](_0x1f12d5);for(var _0x355755=0x0,_0x2896bc=_0x546b65[_0xac4a('0x1e')];_0x355755<_0x2896bc;_0x355755+=0x1){_0x546b65[_0x355755][_0xac4a('0x26')]=_0x7a948b;}this[_0xac4a('0xd')]();};RuleEngine['prototype'][_0xac4a('0x27')]=function(){var _0x482afc=this[_0xac4a('0x8')];if(_0x482afc instanceof Array){_0x482afc=_0x482afc['map'](function(_0x17e6de){_0x17e6de[_0xac4a('0x1f')]=_0x17e6de[_0xac4a('0x1f')][_0xac4a('0x28')]();_0x17e6de[_0xac4a('0x14')]=_0x17e6de[_0xac4a('0x14')][_0xac4a('0x28')]();return _0x17e6de;});}else if(!_[_0xac4a('0x1d')](_0x482afc)){_0x482afc[_0xac4a('0x1f')]=_0x482afc[_0xac4a('0x1f')][_0xac4a('0x28')]();_0x482afc[_0xac4a('0x14')]=_0x482afc[_0xac4a('0x14')][_0xac4a('0x28')]();}return _0x482afc;};RuleEngine['prototype'][_0xac4a('0x29')]=function(_0x1c41fb){this['init']();if(_[_0xac4a('0x2a')](_0x1c41fb)){_0x1c41fb=JSON[_0xac4a('0x2b')](_0x1c41fb);}if(_0x1c41fb instanceof Array){_0x1c41fb=_0x1c41fb['map'](function(_0x58804b){_0x58804b[_0xac4a('0x1f')]=eval('('+_0x58804b[_0xac4a('0x1f')]+')');_0x58804b[_0xac4a('0x14')]=eval('('+_0x58804b[_0xac4a('0x14')]+')');return _0x58804b;});}else if(_0x1c41fb!==null&&typeof _0x1c41fb=='object'){_0x1c41fb[_0xac4a('0x1f')]=eval('('+_0x1c41fb[_0xac4a('0x1f')]+')');_0x1c41fb['consequence']=eval('('+_0x1c41fb[_0xac4a('0x14')]+')');}this[_0xac4a('0x2c')](_0x1c41fb);};module[_0xac4a('0x2d')]=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 15fba9a..5025f71 100644 --- a/server/services/routing/mailRpc/index.js +++ b/server/services/routing/mailRpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbb2b=['message','catch','sendMailMessage','SendMail','bluebird','jayson/promise','request','then','error'];(function(_0x2b1f78,_0x276826){var _0x1dbd33=function(_0x59d60c){while(--_0x59d60c){_0x2b1f78['push'](_0x2b1f78['shift']());}};_0x1dbd33(++_0x276826);}(_0xbb2b,0x148));var _0xbbb2=function(_0x324ccc,_0x218141){_0x324ccc=_0x324ccc-0x0;var _0x28e9d7=_0xbb2b[_0x324ccc];return _0x28e9d7;};'use strict';var BPromise=require(_0xbbb2('0x0'));var jayson=require(_0xbbb2('0x1'));var client=jayson['client']['http']({'port':0x232b});function request(_0x452260,_0x689d68){return new BPromise(function(_0x37c479,_0x3d5d5f){return client[_0xbbb2('0x2')](_0x452260,_0x689d68)[_0xbbb2('0x3')](function(_0xf589e3){if(_0xf589e3[_0xbbb2('0x4')]){return _0x3d5d5f(_0xf589e3[_0xbbb2('0x4')][_0xbbb2('0x5')]);}else{return _0x37c479(_0xf589e3['result']);}})[_0xbbb2('0x6')](function(_0x2d7aa4){return _0x3d5d5f(_0x2d7aa4);});});}exports[_0xbbb2('0x7')]=function(_0x5a9eb8,_0x1a2146){return request(_0xbbb2('0x8'),{'account':_0x5a9eb8,'message':_0x1a2146});}; \ No newline at end of file +var _0x16c2=['then','error','result','catch','sendMailMessage','SendMail','bluebird','client','request'];(function(_0x5c0974,_0x133f4a){var _0x45877a=function(_0xcca9c7){while(--_0xcca9c7){_0x5c0974['push'](_0x5c0974['shift']());}};_0x45877a(++_0x133f4a);}(_0x16c2,0x1da));var _0x216c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x16c2[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0x216c('0x0'));var jayson=require('jayson/promise');var client=jayson[_0x216c('0x1')]['http']({'port':0x232b});function request(_0x28f4af,_0x531cc1){return new BPromise(function(_0x439573,_0x11e05c){return client[_0x216c('0x2')](_0x28f4af,_0x531cc1)[_0x216c('0x3')](function(_0x1381f0){if(_0x1381f0['error']){return _0x11e05c(_0x1381f0[_0x216c('0x4')]['message']);}else{return _0x439573(_0x1381f0[_0x216c('0x5')]);}})[_0x216c('0x6')](function(_0x371e49){return _0x11e05c(_0x371e49);});});}exports[_0x216c('0x7')]=function(_0x19d96d,_0x5c7063){return request(_0x216c('0x8'),{'account':_0x19d96d,'message':_0x5c7063});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 2fa12eb..73472a2 100644 --- a/server/services/routing/model/agent.js +++ b/server/services/routing/model/agent.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1f19=['whatsappCapacity','faxWaitingInteractions','stringify','emit','user:save','exports','lodash','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','chatWaitingInteractions','mailWaitingInteractions','openchannelWaitingInteractions','smsWaitingInteractions','whatsappWaitingInteractions','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','working','mail','chat','fax','sms','length','Status','StatusTime','toNumber','format','mailStatusTime','whatsappStatusTime'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x1f19,0x198));var _0x91f1=function(_0x75e201,_0x34ac48){_0x75e201=_0x75e201-0x0;var _0x39b048=_0x1f19[_0x75e201];return _0x39b048;};'use strict';var _=require(_0x91f1('0x0'));var moment=require('moment');var md5=require(_0x91f1('0x1'));var Redis=require(_0x91f1('0x2'));var config=require(_0x91f1('0x3'));config[_0x91f1('0x4')]=_['defaults'](config[_0x91f1('0x4')],{'host':_0x91f1('0x5'),'port':0x18eb});var io=require(_0x91f1('0x6'))(new Redis(config['redis']));function Agent(_0x1e9a89){this['id']=_0x1e9a89['id']||0x0;this[_0x91f1('0x7')]=_0x1e9a89[_0x91f1('0x7')]||'';this[_0x91f1('0x8')]=_0x1e9a89[_0x91f1('0x8')]||!![];this[_0x91f1('0x9')]=_0x1e9a89[_0x91f1('0x9')]||![];this[_0x91f1('0xa')]=_0x1e9a89[_0x91f1('0xa')]||![];this[_0x91f1('0xb')]=_0x1e9a89[_0x91f1('0xb')]||![];this[_0x91f1('0xc')]=_0x1e9a89[_0x91f1('0xc')]||![];this[_0x91f1('0xd')]=_0x1e9a89[_0x91f1('0xd')]||![];this[_0x91f1('0xe')]=_0x1e9a89[_0x91f1('0xe')]||![];this[_0x91f1('0xf')]=_0x91f1('0x10');this[_0x91f1('0x11')]=0x0;this[_0x91f1('0x12')]=_0x1e9a89[_0x91f1('0x12')]||0x0;this[_0x91f1('0x13')]=0x0;this[_0x91f1('0x14')]=_0x91f1('0x10');this['mailStatusTime']=0x0;this[_0x91f1('0x15')]=_0x1e9a89['mailCapacity']||0x0;this[_0x91f1('0x16')]=0x0;this[_0x91f1('0x17')]='unknown';this[_0x91f1('0x18')]=0x0;this['faxCapacity']=_0x1e9a89[_0x91f1('0x19')]||0x0;this[_0x91f1('0x1a')]=0x0;this[_0x91f1('0x1b')]=_0x91f1('0x10');this[_0x91f1('0x1c')]=0x0;this[_0x91f1('0x1d')]=_0x1e9a89[_0x91f1('0x1d')]||0x0;this[_0x91f1('0x1e')]=0x0;this[_0x91f1('0x1f')]=_0x91f1('0x10');this['whatsappStatusTime']=0x0;this['whatsappCapacity']=_0x1e9a89['whatsappCapacity']||0x0;this[_0x91f1('0x20')]=0x0;this[_0x91f1('0x21')]=_0x91f1('0x10');this[_0x91f1('0x22')]=0x0;this[_0x91f1('0x23')]=_0x1e9a89[_0x91f1('0x23')]||0x0;this[_0x91f1('0x24')]=0x0;this[_0x91f1('0x25')]=![];this[_0x91f1('0x26')]=undefined;this[_0x91f1('0x1')]='';this[_0x91f1('0x27')]={};this['faxWaitingInteractions']={};this[_0x91f1('0x28')]={};this[_0x91f1('0x29')]={};this[_0x91f1('0x2a')]={};this[_0x91f1('0x2b')]={};this[_0x91f1('0x2c')]();}Agent[_0x91f1('0x2d')][_0x91f1('0x2e')]=function(_0x5ba429){if(this[_0x5ba429+_0x91f1('0x2f')]>0x0){if(this[_0x5ba429+_0x91f1('0x30')]>0x0&&this[_0x5ba429+'CurrentCapacity']>=this[_0x5ba429+_0x91f1('0x30')]){return'maxcapacity';}else{return _0x91f1('0x31');}}else{return'idle';}};Agent['prototype'][_0x91f1('0x2c')]=function(){var _0x17352f=[_0x91f1('0x32'),_0x91f1('0x33'),'openchannel',_0x91f1('0x34'),_0x91f1('0x35'),'whatsapp'];for(var _0x166291=0x0;_0x166291<_0x17352f[_0x91f1('0x36')];_0x166291+=0x1){var _0x43264c=this[_0x91f1('0x2e')](_0x17352f[_0x166291]);if(this[_0x17352f[_0x166291]+_0x91f1('0x37')]!==_0x43264c){this[_0x17352f[_0x166291]+_0x91f1('0x38')]=_[_0x91f1('0x39')](moment()[_0x91f1('0x3a')]('x'));}this[_0x17352f[_0x166291]+_0x91f1('0x37')]=_0x43264c;}var _0x35d047={'id':this['id'],'name':this[_0x91f1('0x7')],'online':this[_0x91f1('0x8')],'voicePause':this[_0x91f1('0x9')],'chatPause':this['chatPause'],'mailPause':this[_0x91f1('0xb')],'smsPause':this[_0x91f1('0xd')],'faxPause':this[_0x91f1('0xc')],'openchannelPause':this[_0x91f1('0xe')],'chatStatus':this[_0x91f1('0xf')],'chatStatusTime':this[_0x91f1('0x11')],'chatCapacity':this[_0x91f1('0x12')],'chatCurrentCapacity':this[_0x91f1('0x13')],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0x91f1('0x3b')],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0x91f1('0x16')],'faxStatus':this[_0x91f1('0x17')],'faxStatusTime':this[_0x91f1('0x18')],'faxCapacity':this[_0x91f1('0x19')],'faxCurrentCapacity':this[_0x91f1('0x1a')],'smsStatus':this['smsStatus'],'smsStatusTime':this[_0x91f1('0x1c')],'smsCapacity':this[_0x91f1('0x1d')],'smsCurrentCapacity':this[_0x91f1('0x1e')],'whatsappStatus':this[_0x91f1('0x1f')],'whatsappStatusTime':this[_0x91f1('0x3c')],'whatsappCapacity':this[_0x91f1('0x3d')],'whatsappCurrentCapacity':this[_0x91f1('0x20')],'openchannelStatus':this[_0x91f1('0x21')],'openchannelStatusTime':this[_0x91f1('0x22')],'openchannelCapacity':this[_0x91f1('0x23')],'openchannelCurrentCapacity':this[_0x91f1('0x24')],'busy':this['busy'],'busyQueue':this[_0x91f1('0x26')],'chatWaitingInteractions':this[_0x91f1('0x27')],'faxWaitingInteractions':this[_0x91f1('0x3e')],'mailWaitingInteractions':this[_0x91f1('0x28')],'openchannelWaitingInteractions':this['openchannelWaitingInteractions'],'smsWaitingInteractions':this[_0x91f1('0x2a')],'whatsappWaitingInteractions':this[_0x91f1('0x2b')]};var _0x17f107=md5(JSON[_0x91f1('0x3f')](_0x35d047));if(this[_0x91f1('0x1')]!==_0x17f107){this[_0x91f1('0x1')]=_0x17f107;io[_0x91f1('0x40')](_0x91f1('0x41'),_0x35d047);}};module[_0x91f1('0x42')]=Agent; \ No newline at end of file +var _0x627e=['voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','chatCapacity','chatCurrentCapacity','mailStatus','unknown','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','chatWaitingInteractions','faxWaitingInteractions','openchannelWaitingInteractions','smsWaitingInteractions','whatsappWaitingInteractions','prototype','getChannelStatus','Capacity','CurrentCapacity','maxcapacity','working','idle','mail','openchannel','fax','sms','whatsapp','length','Status','StatusTime','toNumber','chatStatusTime','mailWaitingInteractions','stringify','user:save','lodash','md5','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','online'];(function(_0xb47dc0,_0x407032){var _0x57f0b0=function(_0x11c030){while(--_0x11c030){_0xb47dc0['push'](_0xb47dc0['shift']());}};_0x57f0b0(++_0x407032);}(_0x627e,0x1be));var _0xe627=function(_0xc27fa5,_0xa8d53f){_0xc27fa5=_0xc27fa5-0x0;var _0x3cba94=_0x627e[_0xc27fa5];return _0x3cba94;};'use strict';var _=require(_0xe627('0x0'));var moment=require('moment');var md5=require(_0xe627('0x1'));var Redis=require('ioredis');var config=require(_0xe627('0x2'));config[_0xe627('0x3')]=_[_0xe627('0x4')](config['redis'],{'host':_0xe627('0x5'),'port':0x18eb});var io=require(_0xe627('0x6'))(new Redis(config[_0xe627('0x3')]));function Agent(_0x6bbac0){this['id']=_0x6bbac0['id']||0x0;this['name']=_0x6bbac0[_0xe627('0x7')]||'';this[_0xe627('0x8')]=_0x6bbac0[_0xe627('0x8')]||!![];this[_0xe627('0x9')]=_0x6bbac0[_0xe627('0x9')]||![];this[_0xe627('0xa')]=_0x6bbac0['chatPause']||![];this[_0xe627('0xb')]=_0x6bbac0[_0xe627('0xb')]||![];this[_0xe627('0xc')]=_0x6bbac0['faxPause']||![];this[_0xe627('0xd')]=_0x6bbac0[_0xe627('0xd')]||![];this['openchannelPause']=_0x6bbac0[_0xe627('0xe')]||![];this[_0xe627('0xf')]='unknown';this['chatStatusTime']=0x0;this['chatCapacity']=_0x6bbac0[_0xe627('0x10')]||0x0;this[_0xe627('0x11')]=0x0;this[_0xe627('0x12')]=_0xe627('0x13');this['mailStatusTime']=0x0;this[_0xe627('0x14')]=_0x6bbac0[_0xe627('0x14')]||0x0;this[_0xe627('0x15')]=0x0;this[_0xe627('0x16')]=_0xe627('0x13');this[_0xe627('0x17')]=0x0;this[_0xe627('0x18')]=_0x6bbac0[_0xe627('0x18')]||0x0;this[_0xe627('0x19')]=0x0;this[_0xe627('0x1a')]=_0xe627('0x13');this[_0xe627('0x1b')]=0x0;this[_0xe627('0x1c')]=_0x6bbac0['smsCapacity']||0x0;this[_0xe627('0x1d')]=0x0;this[_0xe627('0x1e')]=_0xe627('0x13');this[_0xe627('0x1f')]=0x0;this[_0xe627('0x20')]=_0x6bbac0[_0xe627('0x20')]||0x0;this[_0xe627('0x21')]=0x0;this[_0xe627('0x22')]='unknown';this[_0xe627('0x23')]=0x0;this[_0xe627('0x24')]=_0x6bbac0[_0xe627('0x24')]||0x0;this[_0xe627('0x25')]=0x0;this[_0xe627('0x26')]=![];this[_0xe627('0x27')]=undefined;this['md5']='';this[_0xe627('0x28')]={};this[_0xe627('0x29')]={};this['mailWaitingInteractions']={};this[_0xe627('0x2a')]={};this[_0xe627('0x2b')]={};this[_0xe627('0x2c')]={};this['updateRealtime']();}Agent[_0xe627('0x2d')][_0xe627('0x2e')]=function(_0x4b710a){if(this[_0x4b710a+'CurrentCapacity']>0x0){if(this[_0x4b710a+_0xe627('0x2f')]>0x0&&this[_0x4b710a+_0xe627('0x30')]>=this[_0x4b710a+_0xe627('0x2f')]){return _0xe627('0x31');}else{return _0xe627('0x32');}}else{return _0xe627('0x33');}};Agent[_0xe627('0x2d')]['updateRealtime']=function(){var _0x16802b=[_0xe627('0x34'),'chat',_0xe627('0x35'),_0xe627('0x36'),_0xe627('0x37'),_0xe627('0x38')];for(var _0x48aa3d=0x0;_0x48aa3d<_0x16802b[_0xe627('0x39')];_0x48aa3d+=0x1){var _0x4826ef=this['getChannelStatus'](_0x16802b[_0x48aa3d]);if(this[_0x16802b[_0x48aa3d]+_0xe627('0x3a')]!==_0x4826ef){this[_0x16802b[_0x48aa3d]+_0xe627('0x3b')]=_[_0xe627('0x3c')](moment()['format']('x'));}this[_0x16802b[_0x48aa3d]+_0xe627('0x3a')]=_0x4826ef;}var _0x449903={'id':this['id'],'name':this[_0xe627('0x7')],'online':this[_0xe627('0x8')],'voicePause':this['voicePause'],'chatPause':this[_0xe627('0xa')],'mailPause':this['mailPause'],'smsPause':this[_0xe627('0xd')],'faxPause':this[_0xe627('0xc')],'openchannelPause':this[_0xe627('0xe')],'chatStatus':this['chatStatus'],'chatStatusTime':this[_0xe627('0x3d')],'chatCapacity':this[_0xe627('0x10')],'chatCurrentCapacity':this[_0xe627('0x11')],'mailStatus':this['mailStatus'],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0xe627('0x14')],'mailCurrentCapacity':this[_0xe627('0x15')],'faxStatus':this['faxStatus'],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this[_0xe627('0x18')],'faxCurrentCapacity':this[_0xe627('0x19')],'smsStatus':this[_0xe627('0x1a')],'smsStatusTime':this[_0xe627('0x1b')],'smsCapacity':this[_0xe627('0x1c')],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0xe627('0x1f')],'whatsappCapacity':this[_0xe627('0x20')],'whatsappCurrentCapacity':this[_0xe627('0x21')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0xe627('0x23')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0xe627('0x25')],'busy':this[_0xe627('0x26')],'busyQueue':this[_0xe627('0x27')],'chatWaitingInteractions':this['chatWaitingInteractions'],'faxWaitingInteractions':this[_0xe627('0x29')],'mailWaitingInteractions':this[_0xe627('0x3e')],'openchannelWaitingInteractions':this['openchannelWaitingInteractions'],'smsWaitingInteractions':this[_0xe627('0x2b')],'whatsappWaitingInteractions':this[_0xe627('0x2c')]};var _0x33d39d=md5(JSON[_0xe627('0x3f')](_0x449903));if(this['md5']!==_0x33d39d){this[_0xe627('0x1')]=_0x33d39d;io['emit'](_0xe627('0x40'),_0x449903);}};module['exports']=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 5b3fa48..5e94941 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 _0x46bb=['map','loggedIn','paused','length','online','chatPause','available','stringify','format','chat:queue:%s','emit','chat_queue:save','lodash','util','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRealtime','prototype','updateRouting'];(function(_0x2644dd,_0x39d79e){var _0x4dad81=function(_0x4acbef){while(--_0x4acbef){_0x2644dd['push'](_0x2644dd['shift']());}};_0x4dad81(++_0x39d79e);}(_0x46bb,0xe5));var _0xb46b=function(_0x494b7f,_0x353334){_0x494b7f=_0x494b7f-0x0;var _0x37daf9=_0x46bb[_0x494b7f];return _0x37daf9;};'use strict';var _=require(_0xb46b('0x0'));var md5=require('md5');var util=require(_0xb46b('0x1'));var Redis=require(_0xb46b('0x2'));var config=require(_0xb46b('0x3'));config['redis']=_[_0xb46b('0x4')](config[_0xb46b('0x5')],{'host':_0xb46b('0x6'),'port':0x18eb});var io=require(_0xb46b('0x7'))(new Redis(config[_0xb46b('0x5')]));function ChatQueue(_0x323e3f){this['id']=_0x323e3f['id']||0x0;this[_0xb46b('0x8')]=_0x323e3f['name']||'';this[_0xb46b('0x9')]=_0x323e3f[_0xb46b('0x9')]||0xa;this[_0xb46b('0xa')]=_0x323e3f[_0xb46b('0xa')]||_0xb46b('0xb');this[_0xb46b('0xc')]=_0x323e3f[_0xb46b('0xc')];this[_0xb46b('0xd')]={};this[_0xb46b('0xe')]=0x0;this[_0xb46b('0xf')]='';this['updateRouting']();this[_0xb46b('0x10')]();}ChatQueue[_0xb46b('0x11')][_0xb46b('0x12')]=function(){var _0x1b5b7c=this[_0xb46b('0xd')]['_rr'];this[_0xb46b('0xd')]=_[_0xb46b('0x13')](this[_0xb46b('0xc')],'id');this[_0xb46b('0xd')]['_rr']=_0x1b5b7c;};ChatQueue[_0xb46b('0x11')][_0xb46b('0x10')]=function(){this[_0xb46b('0x14')]=0x0;this[_0xb46b('0x15')]=0x0;for(var _0xedb54e=0x0;_0xedb54e=0x0?this['available']:0x0;var _0x2de917={'id':this['id'],'available':this[_0xb46b('0x19')],'loggedIn':this[_0xb46b('0x14')],'name':this[_0xb46b('0x8')],'paused':this[_0xb46b('0x15')],'waiting':this[_0xb46b('0xe')]};var _0x51a0a5=md5(JSON[_0xb46b('0x1a')](_0x2de917));if(this['md5']!==_0x51a0a5){this[_0xb46b('0xf')]=_0x51a0a5;io['to'](util[_0xb46b('0x1b')](_0xb46b('0x1c'),_0x2de917['name']))[_0xb46b('0x1d')](_0xb46b('0x1e'),_0x2de917);}};module['exports']=ChatQueue; \ No newline at end of file +var _0xdf80=['strategy','beepall','Agents','updateRouting','updateRealtime','mapAgentsId','_rr','map','prototype','loggedIn','paused','length','online','chatPause','available','waiting','format','chat:queue:%s','emit','chat_queue:save','exports','lodash','md5','util','ioredis','redis','localhost','socket.io-emitter','name','timeout'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xdf80,0x15f));var _0x0df8=function(_0x928379,_0x32d3c5){_0x928379=_0x928379-0x0;var _0x1c0608=_0xdf80[_0x928379];return _0x1c0608;};'use strict';var _=require(_0x0df8('0x0'));var md5=require(_0x0df8('0x1'));var util=require(_0x0df8('0x2'));var Redis=require(_0x0df8('0x3'));var config=require('../../../config/environment');config[_0x0df8('0x4')]=_['defaults'](config['redis'],{'host':_0x0df8('0x5'),'port':0x18eb});var io=require(_0x0df8('0x6'))(new Redis(config[_0x0df8('0x4')]));function ChatQueue(_0x2621fa){this['id']=_0x2621fa['id']||0x0;this['name']=_0x2621fa[_0x0df8('0x7')]||'';this[_0x0df8('0x8')]=_0x2621fa[_0x0df8('0x8')]||0xa;this[_0x0df8('0x9')]=_0x2621fa[_0x0df8('0x9')]||_0x0df8('0xa');this[_0x0df8('0xb')]=_0x2621fa[_0x0df8('0xb')];this['mapAgentsId']={};this['waiting']=0x0;this[_0x0df8('0x1')]='';this[_0x0df8('0xc')]();this[_0x0df8('0xd')]();}ChatQueue['prototype'][_0x0df8('0xc')]=function(){var _0x3f81ee=this[_0x0df8('0xe')][_0x0df8('0xf')];this[_0x0df8('0xe')]=_[_0x0df8('0x10')](this[_0x0df8('0xb')],'id');this[_0x0df8('0xe')]['_rr']=_0x3f81ee;};ChatQueue[_0x0df8('0x11')][_0x0df8('0xd')]=function(){this[_0x0df8('0x12')]=0x0;this[_0x0df8('0x13')]=0x0;for(var _0x4eccd3=0x0;_0x4eccd3=0x0?this[_0x0df8('0x17')]:0x0;var _0x5d64ea={'id':this['id'],'available':this[_0x0df8('0x17')],'loggedIn':this[_0x0df8('0x12')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x0df8('0x18')]};var _0xb3cd92=md5(JSON['stringify'](_0x5d64ea));if(this['md5']!==_0xb3cd92){this[_0x0df8('0x1')]=_0xb3cd92;io['to'](util[_0x0df8('0x19')](_0x0df8('0x1a'),_0x5d64ea['name']))[_0x0df8('0x1b')](_0x0df8('0x1c'),_0x5d64ea);}};module[_0x0df8('0x1d')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 8c59038..c438579 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 _0xc3a8=['stringify','format','emit','fax_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','prototype','paused','length','online','loggedIn','faxPause','available'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0xc3a8,0xde));var _0x8c3a=function(_0x323bf6,_0x19aed6){_0x323bf6=_0x323bf6-0x0;var _0x18da88=_0xc3a8[_0x323bf6];return _0x18da88;};'use strict';var _=require(_0x8c3a('0x0'));var md5=require(_0x8c3a('0x1'));var util=require(_0x8c3a('0x2'));var Redis=require(_0x8c3a('0x3'));var config=require(_0x8c3a('0x4'));config[_0x8c3a('0x5')]=_[_0x8c3a('0x6')](config['redis'],{'host':_0x8c3a('0x7'),'port':0x18eb});var io=require(_0x8c3a('0x8'))(new Redis(config[_0x8c3a('0x5')]));function FaxQueue(_0x8e00ac){this['id']=_0x8e00ac['id']||0x0;this[_0x8c3a('0x9')]=_0x8e00ac[_0x8c3a('0x9')]||'';this[_0x8c3a('0xa')]=_0x8e00ac[_0x8c3a('0xa')]||0xa;this[_0x8c3a('0xb')]=_0x8e00ac[_0x8c3a('0xb')]||_0x8c3a('0xc');this[_0x8c3a('0xd')]=_0x8e00ac[_0x8c3a('0xd')];this[_0x8c3a('0xe')]={};this[_0x8c3a('0xf')]=0x0;this[_0x8c3a('0x1')]='';this[_0x8c3a('0x10')]();this[_0x8c3a('0x11')]();}FaxQueue['prototype']['updateRouting']=function(){var _0xbd91e=this[_0x8c3a('0xe')][_0x8c3a('0x12')];this[_0x8c3a('0xe')]=_['map'](this['Agents'],'id');this[_0x8c3a('0xe')][_0x8c3a('0x12')]=_0xbd91e;};FaxQueue[_0x8c3a('0x13')][_0x8c3a('0x11')]=function(){this['loggedIn']=0x0;this[_0x8c3a('0x14')]=0x0;for(var _0x13fd4a=0x0;_0x13fd4a=0x0?this[_0x8c3a('0x19')]:0x0;var _0x4a8210={'id':this['id'],'available':this[_0x8c3a('0x19')],'loggedIn':this[_0x8c3a('0x17')],'name':this[_0x8c3a('0x9')],'paused':this[_0x8c3a('0x14')],'waiting':this[_0x8c3a('0xf')]};var _0x3a27b7=md5(JSON[_0x8c3a('0x1a')](_0x4a8210));if(this[_0x8c3a('0x1')]!==_0x3a27b7){this[_0x8c3a('0x1')]=_0x3a27b7;io['to'](util[_0x8c3a('0x1b')]('fax:queue:%s',_0x4a8210['name']))[_0x8c3a('0x1c')](_0x8c3a('0x1d'),_0x4a8210);}};module[_0x8c3a('0x1e')]=FaxQueue; \ No newline at end of file +var _0x7373=['paused','stringify','format','fax:queue:%s','emit','fax_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','prototype','length','online','loggedIn','available'];(function(_0x133f81,_0x550e62){var _0x2eef30=function(_0x48e9bf){while(--_0x48e9bf){_0x133f81['push'](_0x133f81['shift']());}};_0x2eef30(++_0x550e62);}(_0x7373,0x11e));var _0x3737=function(_0xb13936,_0x318cc0){_0xb13936=_0xb13936-0x0;var _0xf44e96=_0x7373[_0xb13936];return _0xf44e96;};'use strict';var _=require(_0x3737('0x0'));var md5=require(_0x3737('0x1'));var util=require(_0x3737('0x2'));var Redis=require(_0x3737('0x3'));var config=require(_0x3737('0x4'));config[_0x3737('0x5')]=_[_0x3737('0x6')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x3737('0x7'))(new Redis(config[_0x3737('0x5')]));function FaxQueue(_0x1372b5){this['id']=_0x1372b5['id']||0x0;this[_0x3737('0x8')]=_0x1372b5[_0x3737('0x8')]||'';this[_0x3737('0x9')]=_0x1372b5[_0x3737('0x9')]||0xa;this[_0x3737('0xa')]=_0x1372b5[_0x3737('0xa')]||'beepall';this[_0x3737('0xb')]=_0x1372b5[_0x3737('0xb')];this[_0x3737('0xc')]={};this[_0x3737('0xd')]=0x0;this[_0x3737('0x1')]='';this[_0x3737('0xe')]();this[_0x3737('0xf')]();}FaxQueue['prototype']['updateRouting']=function(){var _0x4ecff2=this[_0x3737('0xc')][_0x3737('0x10')];this[_0x3737('0xc')]=_['map'](this[_0x3737('0xb')],'id');this[_0x3737('0xc')][_0x3737('0x10')]=_0x4ecff2;};FaxQueue[_0x3737('0x11')][_0x3737('0xf')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x45e8be=0x0;_0x45e8be=0x0?this['available']:0x0;var _0x201480={'id':this['id'],'available':this[_0x3737('0x15')],'loggedIn':this[_0x3737('0x14')],'name':this[_0x3737('0x8')],'paused':this[_0x3737('0x16')],'waiting':this[_0x3737('0xd')]};var _0x1db378=md5(JSON[_0x3737('0x17')](_0x201480));if(this['md5']!==_0x1db378){this[_0x3737('0x1')]=_0x1db378;io['to'](util[_0x3737('0x18')](_0x3737('0x19'),_0x201480[_0x3737('0x8')]))[_0x3737('0x1a')](_0x3737('0x1b'),_0x201480);}};module['exports']=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 40918ac..2b3e758 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 _0xac9a=['name','Intervals','exports'];(function(_0x5cc8b9,_0x20e3c3){var _0x58892e=function(_0x87457a){while(--_0x87457a){_0x5cc8b9['push'](_0x5cc8b9['shift']());}};_0x58892e(++_0x20e3c3);}(_0xac9a,0x12c));var _0xaac9=function(_0x1a8816,_0x2c7b08){_0x1a8816=_0x1a8816-0x0;var _0x3209d5=_0xac9a[_0x1a8816];return _0x3209d5;};'use strict';function Interval(_0x513c2a){this['id']=_0x513c2a['id']||0x0;this[_0xaac9('0x0')]=_0x513c2a[_0xaac9('0x0')]||'';this['Intervals']=_0x513c2a[_0xaac9('0x1')]||{};}module[_0xaac9('0x2')]=Interval; \ No newline at end of file +var _0xcd7f=['name','Intervals','exports'];(function(_0x51318d,_0x61f162){var _0x47552d=function(_0x20ca74){while(--_0x20ca74){_0x51318d['push'](_0x51318d['shift']());}};_0x47552d(++_0x61f162);}(_0xcd7f,0x123));var _0xfcd7=function(_0x2ff068,_0x5d6c86){_0x2ff068=_0x2ff068-0x0;var _0x2403ed=_0xcd7f[_0x2ff068];return _0x2403ed;};'use strict';function Interval(_0x11000b){this['id']=_0x11000b['id']||0x0;this['name']=_0x11000b[_0xfcd7('0x0')]||'';this[_0xfcd7('0x1')]=_0x11000b[_0xfcd7('0x1')]||{};}module[_0xfcd7('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 4c763f8..1046ed3 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 _0xc83c=['name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','loggedIn','paused','length','mailPause','available','stringify','mail:queue:%s','emit','mail_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','defaults'];(function(_0x10f95e,_0x91339a){var _0x1235bc=function(_0x2d238a){while(--_0x2d238a){_0x10f95e['push'](_0x10f95e['shift']());}};_0x1235bc(++_0x91339a);}(_0xc83c,0x13d));var _0xcc83=function(_0x5ae8f7,_0x330d91){_0x5ae8f7=_0x5ae8f7-0x0;var _0x54c636=_0xc83c[_0x5ae8f7];return _0x54c636;};'use strict';var _=require(_0xcc83('0x0'));var md5=require(_0xcc83('0x1'));var util=require(_0xcc83('0x2'));var Redis=require(_0xcc83('0x3'));var config=require(_0xcc83('0x4'));config[_0xcc83('0x5')]=_[_0xcc83('0x6')](config[_0xcc83('0x5')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xcc83('0x5')]));function MailQueue(_0x1cdeb0){this['id']=_0x1cdeb0['id']||0x0;this[_0xcc83('0x7')]=_0x1cdeb0[_0xcc83('0x7')]||'';this[_0xcc83('0x8')]=_0x1cdeb0[_0xcc83('0x8')]||0xa;this[_0xcc83('0x9')]=_0x1cdeb0['strategy']||_0xcc83('0xa');this['Agents']=_0x1cdeb0[_0xcc83('0xb')];this[_0xcc83('0xc')]={};this[_0xcc83('0xd')]=0x0;this[_0xcc83('0x1')]='';this[_0xcc83('0xe')]();this[_0xcc83('0xf')]();}MailQueue[_0xcc83('0x10')]['updateRouting']=function(){var _0x11eba5=this[_0xcc83('0xc')]['_rr'];this[_0xcc83('0xc')]=_[_0xcc83('0x11')](this[_0xcc83('0xb')],'id');this[_0xcc83('0xc')]['_rr']=_0x11eba5;};MailQueue[_0xcc83('0x10')][_0xcc83('0xf')]=function(){this[_0xcc83('0x12')]=0x0;this[_0xcc83('0x13')]=0x0;for(var _0xb22c75=0x0;_0xb22c75=0x0?this[_0xcc83('0x16')]:0x0;var _0x2cfa8c={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0xcc83('0x7')],'paused':this[_0xcc83('0x13')],'waiting':this[_0xcc83('0xd')]};var _0x2f1fa5=md5(JSON[_0xcc83('0x17')](_0x2cfa8c));if(this['md5']!==_0x2f1fa5){this[_0xcc83('0x1')]=_0x2f1fa5;io['to'](util['format'](_0xcc83('0x18'),_0x2cfa8c[_0xcc83('0x7')]))[_0xcc83('0x19')](_0xcc83('0x1a'),_0x2cfa8c);}};module['exports']=MailQueue; \ No newline at end of file +var _0x56de=['loggedIn','available','stringify','format','mail:queue:%s','emit','exports','md5','util','ioredis','redis','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','prototype','updateRouting','_rr','updateRealtime','paused','length','online'];(function(_0x3fef72,_0x5798ec){var _0x300fc3=function(_0x17b86f){while(--_0x17b86f){_0x3fef72['push'](_0x3fef72['shift']());}};_0x300fc3(++_0x5798ec);}(_0x56de,0xe8));var _0xe56d=function(_0x2eab2a,_0x2d5981){_0x2eab2a=_0x2eab2a-0x0;var _0x3f0c58=_0x56de[_0x2eab2a];return _0x3f0c58;};'use strict';var _=require('lodash');var md5=require(_0xe56d('0x0'));var util=require(_0xe56d('0x1'));var Redis=require(_0xe56d('0x2'));var config=require('../../../config/environment');config[_0xe56d('0x3')]=_['defaults'](config[_0xe56d('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0xe56d('0x4'))(new Redis(config['redis']));function MailQueue(_0x41c17d){this['id']=_0x41c17d['id']||0x0;this[_0xe56d('0x5')]=_0x41c17d[_0xe56d('0x5')]||'';this[_0xe56d('0x6')]=_0x41c17d['timeout']||0xa;this[_0xe56d('0x7')]=_0x41c17d['strategy']||_0xe56d('0x8');this[_0xe56d('0x9')]=_0x41c17d[_0xe56d('0x9')];this[_0xe56d('0xa')]={};this['waiting']=0x0;this[_0xe56d('0x0')]='';this['updateRouting']();this['updateRealtime']();}MailQueue[_0xe56d('0xb')][_0xe56d('0xc')]=function(){var _0x3b7528=this[_0xe56d('0xa')][_0xe56d('0xd')];this[_0xe56d('0xa')]=_['map'](this[_0xe56d('0x9')],'id');this[_0xe56d('0xa')][_0xe56d('0xd')]=_0x3b7528;};MailQueue[_0xe56d('0xb')][_0xe56d('0xe')]=function(){this['loggedIn']=0x0;this[_0xe56d('0xf')]=0x0;for(var _0x234499=0x0;_0x234499=0x0?this[_0xe56d('0x13')]:0x0;var _0x4ba685={'id':this['id'],'available':this[_0xe56d('0x13')],'loggedIn':this[_0xe56d('0x12')],'name':this[_0xe56d('0x5')],'paused':this[_0xe56d('0xf')],'waiting':this['waiting']};var _0x9aba3=md5(JSON[_0xe56d('0x14')](_0x4ba685));if(this['md5']!==_0x9aba3){this[_0xe56d('0x0')]=_0x9aba3;io['to'](util[_0xe56d('0x15')](_0xe56d('0x16'),_0x4ba685[_0xe56d('0x5')]))[_0xe56d('0x17')]('mail_queue:save',_0x4ba685);}};module[_0xe56d('0x18')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 55a497c..90a7bf8 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 _0x814b=['prototype','map','_rr','loggedIn','paused','length','online','openchannelPause','available','format','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime'];(function(_0x5be7e1,_0x40db1d){var _0x2aea26=function(_0x454b2a){while(--_0x454b2a){_0x5be7e1['push'](_0x5be7e1['shift']());}};_0x2aea26(++_0x40db1d);}(_0x814b,0x1a2));var _0xb814=function(_0x3cbe3a,_0x78bfce){_0x3cbe3a=_0x3cbe3a-0x0;var _0x24ffc1=_0x814b[_0x3cbe3a];return _0x24ffc1;};'use strict';var _=require(_0xb814('0x0'));var md5=require(_0xb814('0x1'));var util=require(_0xb814('0x2'));var Redis=require(_0xb814('0x3'));var config=require(_0xb814('0x4'));config[_0xb814('0x5')]=_['defaults'](config[_0xb814('0x5')],{'host':_0xb814('0x6'),'port':0x18eb});var io=require(_0xb814('0x7'))(new Redis(config[_0xb814('0x5')]));function OpenchannelQueue(_0x44931c){this['id']=_0x44931c['id']||0x0;this[_0xb814('0x8')]=_0x44931c['name']||'';this[_0xb814('0x9')]=_0x44931c[_0xb814('0x9')]||0xa;this['strategy']=_0x44931c[_0xb814('0xa')]||_0xb814('0xb');this[_0xb814('0xc')]=_0x44931c[_0xb814('0xc')];this[_0xb814('0xd')]={};this[_0xb814('0xe')]=0x0;this[_0xb814('0x1')]='';this[_0xb814('0xf')]();this[_0xb814('0x10')]();}OpenchannelQueue[_0xb814('0x11')][_0xb814('0xf')]=function(){var _0x4b5f14=this[_0xb814('0xd')]['_rr'];this[_0xb814('0xd')]=_[_0xb814('0x12')](this[_0xb814('0xc')],'id');this[_0xb814('0xd')][_0xb814('0x13')]=_0x4b5f14;};OpenchannelQueue[_0xb814('0x11')][_0xb814('0x10')]=function(){this[_0xb814('0x14')]=0x0;this[_0xb814('0x15')]=0x0;for(var _0x2ab627=0x0;_0x2ab627=0x0?this['available']:0x0;var _0x270598={'id':this['id'],'available':this[_0xb814('0x19')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this['paused'],'waiting':this[_0xb814('0xe')]};var _0x4d5276=md5(JSON['stringify'](_0x270598));if(this[_0xb814('0x1')]!==_0x4d5276){this[_0xb814('0x1')]=_0x4d5276;io['to'](util[_0xb814('0x1a')]('openchannel:queue:%s',_0x270598[_0xb814('0x8')]))['emit'](_0xb814('0x1b'),_0x270598);}};module[_0xb814('0x1c')]=OpenchannelQueue; \ No newline at end of file +var _0xc4aa=['strategy','Agents','mapAgentsId','updateRouting','updateRealtime','map','_rr','prototype','loggedIn','paused','length','online','available','waiting','stringify','format','openchannel:queue:%s','emit','openchannel_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','socket.io-emitter','name','timeout'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0xc4aa[_0x1caf6a];return _0x1bf493;};'use strict';var _=require(_0xac4a('0x0'));var md5=require(_0xac4a('0x1'));var util=require(_0xac4a('0x2'));var Redis=require(_0xac4a('0x3'));var config=require(_0xac4a('0x4'));config[_0xac4a('0x5')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xac4a('0x6'))(new Redis(config[_0xac4a('0x5')]));function OpenchannelQueue(_0x730a38){this['id']=_0x730a38['id']||0x0;this[_0xac4a('0x7')]=_0x730a38[_0xac4a('0x7')]||'';this[_0xac4a('0x8')]=_0x730a38[_0xac4a('0x8')]||0xa;this[_0xac4a('0x9')]=_0x730a38['strategy']||'beepall';this[_0xac4a('0xa')]=_0x730a38[_0xac4a('0xa')];this[_0xac4a('0xb')]={};this['waiting']=0x0;this[_0xac4a('0x1')]='';this[_0xac4a('0xc')]();this[_0xac4a('0xd')]();}OpenchannelQueue['prototype'][_0xac4a('0xc')]=function(){var _0x488e3c=this[_0xac4a('0xb')]['_rr'];this[_0xac4a('0xb')]=_[_0xac4a('0xe')](this[_0xac4a('0xa')],'id');this['mapAgentsId'][_0xac4a('0xf')]=_0x488e3c;};OpenchannelQueue[_0xac4a('0x10')][_0xac4a('0xd')]=function(){this[_0xac4a('0x11')]=0x0;this[_0xac4a('0x12')]=0x0;for(var _0x3b71c0=0x0;_0x3b71c0=0x0?this[_0xac4a('0x15')]:0x0;var _0x44ec59={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0xac4a('0x7')],'paused':this[_0xac4a('0x12')],'waiting':this[_0xac4a('0x16')]};var _0x4d837c=md5(JSON[_0xac4a('0x17')](_0x44ec59));if(this[_0xac4a('0x1')]!==_0x4d837c){this[_0xac4a('0x1')]=_0x4d837c;io['to'](util[_0xac4a('0x18')](_0xac4a('0x19'),_0x44ec59[_0xac4a('0x7')]))[_0xac4a('0x1a')](_0xac4a('0x1b'),_0x44ec59);}};module['exports']=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index cbd0f5e..1409246 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 _0xf257=['Agents','waiting','md5','prototype','mapAgentsId','_rr','map','updateRealtime','paused','length','smsPause','available','loggedIn','format','sms:queue:%s','emit','sms_queue:save','exports','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall'];(function(_0x238f44,_0xd51cf2){var _0x278bf6=function(_0x5558ea){while(--_0x5558ea){_0x238f44['push'](_0x238f44['shift']());}};_0x278bf6(++_0xd51cf2);}(_0xf257,0x82));var _0x7f25=function(_0x5ca52b,_0x4cd5ce){_0x5ca52b=_0x5ca52b-0x0;var _0x5f511f=_0xf257[_0x5ca52b];return _0x5f511f;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0x7f25('0x0'));var Redis=require(_0x7f25('0x1'));var config=require(_0x7f25('0x2'));config[_0x7f25('0x3')]=_['defaults'](config[_0x7f25('0x3')],{'host':_0x7f25('0x4'),'port':0x18eb});var io=require(_0x7f25('0x5'))(new Redis(config[_0x7f25('0x3')]));function SmsQueue(_0x2829d7){this['id']=_0x2829d7['id']||0x0;this[_0x7f25('0x6')]=_0x2829d7[_0x7f25('0x6')]||'';this[_0x7f25('0x7')]=_0x2829d7[_0x7f25('0x7')]||0xa;this[_0x7f25('0x8')]=_0x2829d7[_0x7f25('0x8')]||_0x7f25('0x9');this[_0x7f25('0xa')]=_0x2829d7[_0x7f25('0xa')];this['mapAgentsId']={};this[_0x7f25('0xb')]=0x0;this[_0x7f25('0xc')]='';this['updateRouting']();this['updateRealtime']();}SmsQueue[_0x7f25('0xd')]['updateRouting']=function(){var _0x1d9f33=this[_0x7f25('0xe')][_0x7f25('0xf')];this[_0x7f25('0xe')]=_[_0x7f25('0x10')](this[_0x7f25('0xa')],'id');this[_0x7f25('0xe')]['_rr']=_0x1d9f33;};SmsQueue['prototype'][_0x7f25('0x11')]=function(){this['loggedIn']=0x0;this[_0x7f25('0x12')]=0x0;for(var _0x19b76b=0x0;_0x19b76b=0x0?this[_0x7f25('0x15')]:0x0;var _0x5e0067={'id':this['id'],'available':this[_0x7f25('0x15')],'loggedIn':this[_0x7f25('0x16')],'name':this[_0x7f25('0x6')],'paused':this[_0x7f25('0x12')],'waiting':this[_0x7f25('0xb')]};var _0x16f9e3=md5(JSON['stringify'](_0x5e0067));if(this['md5']!==_0x16f9e3){this[_0x7f25('0xc')]=_0x16f9e3;io['to'](util[_0x7f25('0x17')](_0x7f25('0x18'),_0x5e0067[_0x7f25('0x6')]))[_0x7f25('0x19')](_0x7f25('0x1a'),_0x5e0067);}};module[_0x7f25('0x1b')]=SmsQueue; \ No newline at end of file +var _0x5044=['redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn','paused','length','online','smsPause','available','format','sms:queue:%s','emit','exports','md5','ioredis','../../../config/environment'];(function(_0x58afd5,_0x534a48){var _0x3e503b=function(_0x27ba44){while(--_0x27ba44){_0x58afd5['push'](_0x58afd5['shift']());}};_0x3e503b(++_0x534a48);}(_0x5044,0xc8));var _0x4504=function(_0x11c708,_0xd68536){_0x11c708=_0x11c708-0x0;var _0x2fe0ce=_0x5044[_0x11c708];return _0x2fe0ce;};'use strict';var _=require('lodash');var md5=require(_0x4504('0x0'));var util=require('util');var Redis=require(_0x4504('0x1'));var config=require(_0x4504('0x2'));config[_0x4504('0x3')]=_[_0x4504('0x4')](config[_0x4504('0x3')],{'host':_0x4504('0x5'),'port':0x18eb});var io=require(_0x4504('0x6'))(new Redis(config[_0x4504('0x3')]));function SmsQueue(_0x4d5c5a){this['id']=_0x4d5c5a['id']||0x0;this[_0x4504('0x7')]=_0x4d5c5a[_0x4504('0x7')]||'';this[_0x4504('0x8')]=_0x4d5c5a[_0x4504('0x8')]||0xa;this[_0x4504('0x9')]=_0x4d5c5a[_0x4504('0x9')]||_0x4504('0xa');this[_0x4504('0xb')]=_0x4d5c5a[_0x4504('0xb')];this['mapAgentsId']={};this[_0x4504('0xc')]=0x0;this['md5']='';this[_0x4504('0xd')]();this[_0x4504('0xe')]();}SmsQueue[_0x4504('0xf')][_0x4504('0xd')]=function(){var _0x2498c3=this[_0x4504('0x10')][_0x4504('0x11')];this[_0x4504('0x10')]=_[_0x4504('0x12')](this[_0x4504('0xb')],'id');this[_0x4504('0x10')][_0x4504('0x11')]=_0x2498c3;};SmsQueue[_0x4504('0xf')]['updateRealtime']=function(){this[_0x4504('0x13')]=0x0;this[_0x4504('0x14')]=0x0;for(var _0x564bc5=0x0;_0x564bc5=0x0?this['available']:0x0;var _0x35a355={'id':this['id'],'available':this[_0x4504('0x18')],'loggedIn':this[_0x4504('0x13')],'name':this[_0x4504('0x7')],'paused':this[_0x4504('0x14')],'waiting':this[_0x4504('0xc')]};var _0x5c9164=md5(JSON['stringify'](_0x35a355));if(this['md5']!==_0x5c9164){this[_0x4504('0x0')]=_0x5c9164;io['to'](util[_0x4504('0x19')](_0x4504('0x1a'),_0x35a355[_0x4504('0x7')]))[_0x4504('0x1b')]('sms_queue:save',_0x35a355);}};module[_0x4504('0x1c')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 9ee86d2..9d496be 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 _0x00cc=['name','timeout','strategy','beepall','Agents','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','length','online','loggedIn','whatsappPause','paused','available','stringify','format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','md5','util','ioredis','localhost','socket.io-emitter'];(function(_0x3ac45d,_0x4c5b96){var _0x96a186=function(_0x4aebd8){while(--_0x4aebd8){_0x3ac45d['push'](_0x3ac45d['shift']());}};_0x96a186(++_0x4c5b96);}(_0x00cc,0xe2));var _0xc00c=function(_0x3c912d,_0x33e946){_0x3c912d=_0x3c912d-0x0;var _0x5d9faa=_0x00cc[_0x3c912d];return _0x5d9faa;};'use strict';var _=require(_0xc00c('0x0'));var md5=require(_0xc00c('0x1'));var util=require(_0xc00c('0x2'));var Redis=require(_0xc00c('0x3'));var config=require('../../../config/environment');config['redis']=_['defaults'](config['redis'],{'host':_0xc00c('0x4'),'port':0x18eb});var io=require(_0xc00c('0x5'))(new Redis(config['redis']));function WhatsappQueue(_0x5dab3e){this['id']=_0x5dab3e['id']||0x0;this[_0xc00c('0x6')]=_0x5dab3e[_0xc00c('0x6')]||'';this['timeout']=_0x5dab3e[_0xc00c('0x7')]||0xa;this['strategy']=_0x5dab3e[_0xc00c('0x8')]||_0xc00c('0x9');this[_0xc00c('0xa')]=_0x5dab3e['Agents'];this['mapAgentsId']={};this['waiting']=0x0;this[_0xc00c('0x1')]='';this[_0xc00c('0xb')]();this[_0xc00c('0xc')]();}WhatsappQueue[_0xc00c('0xd')]['updateRouting']=function(){var _0x10eb19=this[_0xc00c('0xe')][_0xc00c('0xf')];this['mapAgentsId']=_[_0xc00c('0x10')](this[_0xc00c('0xa')],'id');this['mapAgentsId'][_0xc00c('0xf')]=_0x10eb19;};WhatsappQueue[_0xc00c('0xd')][_0xc00c('0xc')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x2ab0de=0x0;_0x2ab0de=0x0?this[_0xc00c('0x16')]:0x0;var _0x1a2732={'id':this['id'],'available':this[_0xc00c('0x16')],'loggedIn':this['loggedIn'],'name':this[_0xc00c('0x6')],'paused':this['paused'],'waiting':this['waiting']};var _0x33829e=md5(JSON[_0xc00c('0x17')](_0x1a2732));if(this[_0xc00c('0x1')]!==_0x33829e){this['md5']=_0x33829e;io['to'](util[_0xc00c('0x18')](_0xc00c('0x19'),_0x1a2732[_0xc00c('0x6')]))[_0xc00c('0x1a')](_0xc00c('0x1b'),_0x1a2732);}};module[_0xc00c('0x1c')]=WhatsappQueue; \ No newline at end of file +var _0x1969=['prototype','updateRouting','_rr','map','loggedIn','online','whatsappPause','paused','available','waiting','stringify','format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRealtime'];(function(_0x34f610,_0x4158fb){var _0x1467ed=function(_0x570942){while(--_0x570942){_0x34f610['push'](_0x34f610['shift']());}};_0x1467ed(++_0x4158fb);}(_0x1969,0x90));var _0x9196=function(_0x12fcf4,_0x2cd3fe){_0x12fcf4=_0x12fcf4-0x0;var _0x48ee34=_0x1969[_0x12fcf4];return _0x48ee34;};'use strict';var _=require(_0x9196('0x0'));var md5=require(_0x9196('0x1'));var util=require(_0x9196('0x2'));var Redis=require(_0x9196('0x3'));var config=require(_0x9196('0x4'));config[_0x9196('0x5')]=_[_0x9196('0x6')](config[_0x9196('0x5')],{'host':_0x9196('0x7'),'port':0x18eb});var io=require(_0x9196('0x8'))(new Redis(config[_0x9196('0x5')]));function WhatsappQueue(_0x5b9463){this['id']=_0x5b9463['id']||0x0;this[_0x9196('0x9')]=_0x5b9463[_0x9196('0x9')]||'';this[_0x9196('0xa')]=_0x5b9463['timeout']||0xa;this['strategy']=_0x5b9463[_0x9196('0xb')]||_0x9196('0xc');this[_0x9196('0xd')]=_0x5b9463[_0x9196('0xd')];this[_0x9196('0xe')]={};this['waiting']=0x0;this['md5']='';this['updateRouting']();this[_0x9196('0xf')]();}WhatsappQueue[_0x9196('0x10')][_0x9196('0x11')]=function(){var _0x166e99=this[_0x9196('0xe')][_0x9196('0x12')];this[_0x9196('0xe')]=_[_0x9196('0x13')](this[_0x9196('0xd')],'id');this['mapAgentsId'][_0x9196('0x12')]=_0x166e99;};WhatsappQueue[_0x9196('0x10')]['updateRealtime']=function(){this[_0x9196('0x14')]=0x0;this['paused']=0x0;for(var _0x1b39ec=0x0;_0x1b39ec=0x0?this[_0x9196('0x18')]:0x0;var _0x9f254a={'id':this['id'],'available':this['available'],'loggedIn':this[_0x9196('0x14')],'name':this[_0x9196('0x9')],'paused':this[_0x9196('0x17')],'waiting':this[_0x9196('0x19')]};var _0x3bec53=md5(JSON[_0x9196('0x1a')](_0x9f254a));if(this[_0x9196('0x1')]!==_0x3bec53){this[_0x9196('0x1')]=_0x3bec53;io['to'](util[_0x9196('0x1b')](_0x9196('0x1c'),_0x9f254a[_0x9196('0x9')]))[_0x9196('0x1d')](_0x9196('0x1e'),_0x9f254a);}};module[_0x9196('0x1f')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 3f552d1..b471a68 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 _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file +var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x1d11a5,_0x4c3215){var _0x49102c=function(_0x5e5dc8){while(--_0x5e5dc8){_0x1d11a5['push'](_0x1d11a5['shift']());}};_0x49102c(++_0x4c3215);}(_0xb10b,0x12a));var _0xbb10=function(_0x1b8bda,_0x43ad31){_0x1b8bda=_0x1b8bda-0x0;var _0x1f7050=_0xb10b[_0x1b8bda];return _0x1f7050;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index 26ea1d9..c0883bd 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 _0x9477=['update','Request','UpdateChatInteraction','addTags','addTagsToChatInteraction','../client'];(function(_0x231972,_0x416e54){var _0x368118=function(_0x25f06c){while(--_0x25f06c){_0x231972['push'](_0x231972['shift']());}};_0x368118(++_0x416e54);}(_0x9477,0x119));var _0x7947=function(_0x48d053,_0x3073eb){_0x48d053=_0x48d053-0x0;var _0x15f34f=_0x9477[_0x48d053];return _0x15f34f;};'use strict';var client=require(_0x7947('0x0'));exports[_0x7947('0x1')]=function(_0x4d6ace,_0x1f6704){return client[_0x7947('0x2')](_0x7947('0x3'),{'body':_0x1f6704,'options':{'where':{'id':_0x4d6ace}},'log':'updateChatInteraction'});};exports[_0x7947('0x4')]=function(_0x4cdbd9,_0x145151){return client[_0x7947('0x2')]('AddTagsToChatInteraction',{'body':_0x145151,'options':{'where':{'id':_0x4cdbd9}},'log':_0x7947('0x5')});}; \ No newline at end of file +var _0x43a7=['updateChatInteraction','addTags','addTagsToChatInteraction','update','Request','UpdateChatInteraction'];(function(_0x1abe9e,_0x1e41be){var _0x2e047e=function(_0xb7e425){while(--_0xb7e425){_0x1abe9e['push'](_0x1abe9e['shift']());}};_0x2e047e(++_0x1e41be);}(_0x43a7,0xd5));var _0x743a=function(_0x23292a,_0x1e08ea){_0x23292a=_0x23292a-0x0;var _0x4564f2=_0x43a7[_0x23292a];return _0x4564f2;};'use strict';var client=require('../client');exports[_0x743a('0x0')]=function(_0x3e3fdd,_0x4e0526){return client[_0x743a('0x1')](_0x743a('0x2'),{'body':_0x4e0526,'options':{'where':{'id':_0x3e3fdd}},'log':_0x743a('0x3')});};exports[_0x743a('0x4')]=function(_0x543e0e,_0x313a2c){return client['Request']('AddTagsToChatInteraction',{'body':_0x313a2c,'options':{'where':{'id':_0x543e0e}},'log':_0x743a('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 171dc8c..8ba9a10 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 _0xc51d=['../client','create','Request'];(function(_0x1309ee,_0x5db871){var _0x5c0ca6=function(_0x5e1ba1){while(--_0x5e1ba1){_0x1309ee['push'](_0x1309ee['shift']());}};_0x5c0ca6(++_0x5db871);}(_0xc51d,0x162));var _0xdc51=function(_0x509e2a,_0x478af6){_0x509e2a=_0x509e2a-0x0;var _0x44b411=_0xc51d[_0x509e2a];return _0x44b411;};'use strict';var client=require(_0xdc51('0x0'));exports[_0xdc51('0x1')]=function(_0x92460f){return client[_0xdc51('0x2')]('CreateChatMessage',{'body':_0x92460f,'log':'createChatMessage'});}; \ No newline at end of file +var _0xd709=['CreateChatMessage','createChatMessage','../client','create','Request'];(function(_0x220dbb,_0x99328d){var _0x2b77de=function(_0x15e966){while(--_0x15e966){_0x220dbb['push'](_0x220dbb['shift']());}};_0x2b77de(++_0x99328d);}(_0xd709,0x1bf));var _0x9d70=function(_0x267692,_0x229aaa){_0x267692=_0x267692-0x0;var _0x209905=_0xd709[_0x267692];return _0x209905;};'use strict';var client=require(_0x9d70('0x0'));exports[_0x9d70('0x1')]=function(_0x4e64c5){return client[_0x9d70('0x2')](_0x9d70('0x3'),{'body':_0x4e64c5,'log':_0x9d70('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 16f24e8..969bef5 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 _0xea81=['Request','GetChatQueue','strategy','User','Agents','name','online','../client','getChatQueues'];(function(_0x27999f,_0x54214d){var _0xcd35f3=function(_0xe2912f){while(--_0xe2912f){_0x27999f['push'](_0x27999f['shift']());}};_0xcd35f3(++_0x54214d);}(_0xea81,0x1ed));var _0x1ea8=function(_0x45a079,_0x2ff4fc){_0x45a079=_0x45a079-0x0;var _0xbe5d70=_0xea81[_0x45a079];return _0xbe5d70;};'use strict';var client=require(_0x1ea8('0x0'));exports[_0x1ea8('0x1')]=function(){return function(){return client[_0x1ea8('0x2')](_0x1ea8('0x3'),{'options':{'raw':![],'attributes':['id','name','timeout',_0x1ea8('0x4')],'include':[{'model':_0x1ea8('0x5'),'as':_0x1ea8('0x6'),'attributes':['id',_0x1ea8('0x7'),_0x1ea8('0x8'),'chatPause']}]},'log':'getChatQueues'});};}; \ No newline at end of file +var _0x5e17=['chatPause','getChatQueues','../client','strategy','User','Agents','name','online'];(function(_0x865410,_0x40f425){var _0x36418b=function(_0x34752b){while(--_0x34752b){_0x865410['push'](_0x865410['shift']());}};_0x36418b(++_0x40f425);}(_0x5e17,0x17a));var _0x75e1=function(_0x1ab3a7,_0xaf7bb0){_0x1ab3a7=_0x1ab3a7-0x0;var _0x3111c7=_0x5e17[_0x1ab3a7];return _0x3111c7;};'use strict';var client=require(_0x75e1('0x0'));exports['getChatQueues']=function(){return function(){return client['Request']('GetChatQueue',{'options':{'raw':![],'attributes':['id','name','timeout',_0x75e1('0x1')],'include':[{'model':_0x75e1('0x2'),'as':_0x75e1('0x3'),'attributes':['id',_0x75e1('0x4'),_0x75e1('0x5'),_0x75e1('0x6')]}]},'log':_0x75e1('0x7')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index c0b72e7..2afbd8a 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 _0xe79f=['Request','UpdateChatQueueReport','../client','CreateChatQueueReport'];(function(_0x26c4bf,_0x3e02ba){var _0x5ef571=function(_0x196ff2){while(--_0x196ff2){_0x26c4bf['push'](_0x26c4bf['shift']());}};_0x5ef571(++_0x3e02ba);}(_0xe79f,0x13a));var _0xfe79=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe79f[_0x321bb2];return _0x9c12ed;};'use strict';var client=require(_0xfe79('0x0'));exports['create']=function(_0x259811){return client['Request'](_0xfe79('0x1'),{'body':_0x259811,'log':'CreateChatQueueReport'});};exports['update']=function(_0x5901ba,_0x243f35){return client[_0xfe79('0x2')](_0xfe79('0x3'),{'body':_0x243f35,'options':{'where':{'uniqueid':_0x5901ba},'order':[['id','DESC']],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file +var _0xbe31=['DESC','create','Request','CreateChatQueueReport','update'];(function(_0x247ec9,_0x3aecc6){var _0x3a2306=function(_0x383c8b){while(--_0x383c8b){_0x247ec9['push'](_0x247ec9['shift']());}};_0x3a2306(++_0x3aecc6);}(_0xbe31,0x83));var _0x1be3=function(_0x3b3199,_0x10216d){_0x3b3199=_0x3b3199-0x0;var _0x4f592c=_0xbe31[_0x3b3199];return _0x4f592c;};'use strict';var client=require('../client');exports[_0x1be3('0x0')]=function(_0x18e467){return client[_0x1be3('0x1')](_0x1be3('0x2'),{'body':_0x18e467,'log':_0x1be3('0x2')});};exports[_0x1be3('0x3')]=function(_0xacfa1e,_0x2c1ddd){return client[_0x1be3('0x1')]('UpdateChatQueueReport',{'body':_0x2c1ddd,'options':{'where':{'uniqueid':_0xacfa1e},'order':[['id',_0x1be3('0x4')]],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 9010163..a8e50ed 100644 --- a/server/services/routing/rpc/faxInteraction.js +++ b/server/services/routing/rpc/faxInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0xfb42e6,_0x5f5d4b){var _0x27265b=function(_0x163e81){while(--_0x163e81){_0xfb42e6['push'](_0xfb42e6['shift']());}};_0x27265b(++_0x5f5d4b);}(_0x7a54,0x106));var _0x47a5=function(_0xfab1a8,_0x18b304){_0xfab1a8=_0xfab1a8-0x0;var _0x5f29ec=_0x7a54[_0xfab1a8];return _0x5f29ec;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file +var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x3e9550,_0x15f135){var _0x4d4ed5=function(_0x1ff875){while(--_0x1ff875){_0x3e9550['push'](_0x3e9550['shift']());}};_0x4d4ed5(++_0x15f135);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index 2bc2b7f..5276d3b 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 _0x3fb4=['create','Request','CreateFaxMessage'];(function(_0xb86edb,_0x42ff7c){var _0x2b62fc=function(_0x5da083){while(--_0x5da083){_0xb86edb['push'](_0xb86edb['shift']());}};_0x2b62fc(++_0x42ff7c);}(_0x3fb4,0xcc));var _0x43fb=function(_0x4c445a,_0x4ee80f){_0x4c445a=_0x4c445a-0x0;var _0x2f611c=_0x3fb4[_0x4c445a];return _0x2f611c;};'use strict';var client=require('../client');exports[_0x43fb('0x0')]=function(_0x3d0c76){return client[_0x43fb('0x1')](_0x43fb('0x2'),{'body':_0x3d0c76,'log':'createFaxMessage'});}; \ No newline at end of file +var _0x2af3=['CreateFaxMessage','createFaxMessage','create'];(function(_0x215e28,_0x380ff8){var _0x268c55=function(_0x1a2650){while(--_0x1a2650){_0x215e28['push'](_0x215e28['shift']());}};_0x268c55(++_0x380ff8);}(_0x2af3,0x6b));var _0x32af=function(_0xb1937e,_0x330b2f){_0xb1937e=_0xb1937e-0x0;var _0x44474f=_0x2af3[_0xb1937e];return _0x44474f;};'use strict';var client=require('../client');exports[_0x32af('0x0')]=function(_0x39b7e5){return client['Request'](_0x32af('0x1'),{'body':_0x39b7e5,'log':_0x32af('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 6812a0a..45f5e12 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 _0x8215=['online','faxPause','../client','getFaxQueues','Request','timeout','strategy','User','name'];(function(_0x3a1d7d,_0x11dfbd){var _0x2af564=function(_0x1f1dbc){while(--_0x1f1dbc){_0x3a1d7d['push'](_0x3a1d7d['shift']());}};_0x2af564(++_0x11dfbd);}(_0x8215,0x134));var _0x5821=function(_0x29831f,_0x39446e){_0x29831f=_0x29831f-0x0;var _0x39e002=_0x8215[_0x29831f];return _0x39e002;};'use strict';var client=require(_0x5821('0x0'));exports[_0x5821('0x1')]=function(){return function(){return client[_0x5821('0x2')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id','name',_0x5821('0x3'),_0x5821('0x4')],'include':[{'model':_0x5821('0x5'),'as':'Agents','attributes':['id',_0x5821('0x6'),_0x5821('0x7'),_0x5821('0x8')]}]},'log':_0x5821('0x1')});};}; \ No newline at end of file +var _0x9a59=['name','timeout','strategy','User','Agents','faxPause','getFaxQueues','../client','Request'];(function(_0x462fe4,_0x394d3e){var _0x82b23a=function(_0x2c071f){while(--_0x2c071f){_0x462fe4['push'](_0x462fe4['shift']());}};_0x82b23a(++_0x394d3e);}(_0x9a59,0x142));var _0x99a5=function(_0x484498,_0x159611){_0x484498=_0x484498-0x0;var _0x1f9c5f=_0x9a59[_0x484498];return _0x1f9c5f;};'use strict';var client=require(_0x99a5('0x0'));exports['getFaxQueues']=function(){return function(){return client[_0x99a5('0x1')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0x99a5('0x2'),_0x99a5('0x3'),_0x99a5('0x4')],'include':[{'model':_0x99a5('0x5'),'as':_0x99a5('0x6'),'attributes':['id','name','online',_0x99a5('0x7')]}]},'log':_0x99a5('0x8')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 5c56d48..d7c6b09 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 _0xd68c=['../client','create','Request','CreateFaxQueueReport','UpdateFaxQueueReport','DESC'];(function(_0x4f2ef4,_0x4965ba){var _0x1d51f3=function(_0x5a0035){while(--_0x5a0035){_0x4f2ef4['push'](_0x4f2ef4['shift']());}};_0x1d51f3(++_0x4965ba);}(_0xd68c,0x9c));var _0xcd68=function(_0x20dda3,_0xfcb775){_0x20dda3=_0x20dda3-0x0;var _0x547b71=_0xd68c[_0x20dda3];return _0x547b71;};'use strict';var client=require(_0xcd68('0x0'));exports[_0xcd68('0x1')]=function(_0x23f571){return client[_0xcd68('0x2')]('CreateFaxQueueReport',{'body':_0x23f571,'log':_0xcd68('0x3')});};exports['update']=function(_0x5502d7,_0x23215e){return client['Request'](_0xcd68('0x4'),{'body':_0x23215e,'options':{'where':{'uniqueid':_0x5502d7},'order':[['id',_0xcd68('0x5')]],'limit':0x1},'log':_0xcd68('0x4')});}; \ No newline at end of file +var _0xcf5d=['Request','update','DESC','../client','create'];(function(_0x410437,_0x53c9f3){var _0x31ef79=function(_0x8ad27b){while(--_0x8ad27b){_0x410437['push'](_0x410437['shift']());}};_0x31ef79(++_0x53c9f3);}(_0xcf5d,0x1ca));var _0xdcf5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcf5d[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xdcf5('0x0'));exports[_0xdcf5('0x1')]=function(_0x1d8206){return client[_0xdcf5('0x2')]('CreateFaxQueueReport',{'body':_0x1d8206,'log':'CreateFaxQueueReport'});};exports[_0xdcf5('0x3')]=function(_0x297808,_0x3f1323){return client[_0xdcf5('0x2')]('UpdateFaxQueueReport',{'body':_0x3f1323,'options':{'where':{'uniqueid':_0x297808},'order':[['id',_0xdcf5('0x4')]],'limit':0x1},'log':'UpdateFaxQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 9ce9ec6..44519e3 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 _0xbaba=['interval','../client','getIntervals','Request','GetInterval','name','Interval','Intervals'];(function(_0x1c8706,_0x162496){var _0x47da28=function(_0xb31491){while(--_0xb31491){_0x1c8706['push'](_0x1c8706['shift']());}};_0x47da28(++_0x162496);}(_0xbaba,0xa9));var _0xabab=function(_0x4d7c74,_0xf1b31){_0x4d7c74=_0x4d7c74-0x0;var _0x32988f=_0xbaba[_0x4d7c74];return _0x32988f;};'use strict';var client=require(_0xabab('0x0'));exports[_0xabab('0x1')]=function(){return function(){return client[_0xabab('0x2')](_0xabab('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xabab('0x4')],'include':[{'model':_0xabab('0x5'),'as':_0xabab('0x6'),'attributes':['id',_0xabab('0x4'),_0xabab('0x7')]}]},'log':_0xabab('0x1')});};}; \ No newline at end of file +var _0x0ba5=['Intervals','interval','../client','getIntervals','GetInterval','name','Interval'];(function(_0x5f3ef9,_0x4c8a49){var _0x4d978b=function(_0x4ca0a0){while(--_0x4ca0a0){_0x5f3ef9['push'](_0x5f3ef9['shift']());}};_0x4d978b(++_0x4c8a49);}(_0x0ba5,0x64));var _0x50ba=function(_0x1de55e,_0x136570){_0x1de55e=_0x1de55e-0x0;var _0x8d2760=_0x0ba5[_0x1de55e];return _0x8d2760;};'use strict';var client=require(_0x50ba('0x0'));exports[_0x50ba('0x1')]=function(){return function(){return client['Request'](_0x50ba('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x50ba('0x3')],'include':[{'model':_0x50ba('0x4'),'as':_0x50ba('0x5'),'attributes':['id',_0x50ba('0x3'),_0x50ba('0x6')]}]},'log':_0x50ba('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index c636f18..2a4ca2c 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 _0x3266=['addTagsToChatInteraction','../client','update','Request','UpdateMailInteraction','updateMailInteraction','addTags'];(function(_0x2045f6,_0x5079d9){var _0x1ba0e5=function(_0x44e650){while(--_0x44e650){_0x2045f6['push'](_0x2045f6['shift']());}};_0x1ba0e5(++_0x5079d9);}(_0x3266,0x6a));var _0x6326=function(_0x4c440b,_0x3ea627){_0x4c440b=_0x4c440b-0x0;var _0x2d48cf=_0x3266[_0x4c440b];return _0x2d48cf;};'use strict';var client=require(_0x6326('0x0'));exports[_0x6326('0x1')]=function(_0x3a3ebd,_0x2bed83){return client[_0x6326('0x2')](_0x6326('0x3'),{'body':_0x2bed83,'options':{'where':{'id':_0x3a3ebd}},'log':_0x6326('0x4')});};exports[_0x6326('0x5')]=function(_0x265264,_0x5a6b4d){return client[_0x6326('0x2')]('AddTagsToMailInteraction',{'body':_0x5a6b4d,'options':{'where':{'id':_0x265264}},'log':_0x6326('0x6')});}; \ No newline at end of file +var _0x9f0e=['Request','addTags','AddTagsToMailInteraction','../client','update'];(function(_0x27fc18,_0xc24f78){var _0x5b4caf=function(_0x57f4f5){while(--_0x57f4f5){_0x27fc18['push'](_0x27fc18['shift']());}};_0x5b4caf(++_0xc24f78);}(_0x9f0e,0x116));var _0xe9f0=function(_0x3127de,_0x29bdf5){_0x3127de=_0x3127de-0x0;var _0x24e76a=_0x9f0e[_0x3127de];return _0x24e76a;};'use strict';var client=require(_0xe9f0('0x0'));exports[_0xe9f0('0x1')]=function(_0x28c33d,_0x1a7796){return client[_0xe9f0('0x2')]('UpdateMailInteraction',{'body':_0x1a7796,'options':{'where':{'id':_0x28c33d}},'log':'updateMailInteraction'});};exports[_0xe9f0('0x3')]=function(_0x150a03,_0x3c589d){return client[_0xe9f0('0x2')](_0xe9f0('0x4'),{'body':_0x3c589d,'options':{'where':{'id':_0x150a03}},'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 b6e6bab..c953611 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 _0xfb26=['CreateMailMessage','../client','Request'];(function(_0x59cd5b,_0x326910){var _0x44a463=function(_0x5a02b0){while(--_0x5a02b0){_0x59cd5b['push'](_0x59cd5b['shift']());}};_0x44a463(++_0x326910);}(_0xfb26,0xb5));var _0x6fb2=function(_0x49c5b0,_0xca8692){_0x49c5b0=_0x49c5b0-0x0;var _0x4efb64=_0xfb26[_0x49c5b0];return _0x4efb64;};'use strict';var client=require(_0x6fb2('0x0'));exports['create']=function(_0x441531){return client[_0x6fb2('0x1')](_0x6fb2('0x2'),{'body':_0x441531,'log':'createMailMessage'});}; \ No newline at end of file +var _0x6713=['Request','CreateMailMessage','createMailMessage','../client','create'];(function(_0x5d6725,_0x3f6ef9){var _0x275399=function(_0x133ac1){while(--_0x133ac1){_0x5d6725['push'](_0x5d6725['shift']());}};_0x275399(++_0x3f6ef9);}(_0x6713,0x139));var _0x3671=function(_0x53f0db,_0x35c67c){_0x53f0db=_0x53f0db-0x0;var _0xae0a5c=_0x6713[_0x53f0db];return _0xae0a5c;};'use strict';var client=require(_0x3671('0x0'));exports[_0x3671('0x1')]=function(_0x48dc5b){return client[_0x3671('0x2')](_0x3671('0x3'),{'body':_0x48dc5b,'log':_0x3671('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index e39e235..41986bb 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 _0x2c4a=['strategy','User','Agents','online','mailPause','../client','Request','name','timeout'];(function(_0x2ff5af,_0x4c7cbc){var _0x28fe24=function(_0x1875de){while(--_0x1875de){_0x2ff5af['push'](_0x2ff5af['shift']());}};_0x28fe24(++_0x4c7cbc);}(_0x2c4a,0xd4));var _0xa2c4=function(_0x38a6fe,_0x780686){_0x38a6fe=_0x38a6fe-0x0;var _0x4363a5=_0x2c4a[_0x38a6fe];return _0x4363a5;};'use strict';var client=require(_0xa2c4('0x0'));exports['getMailQueues']=function(){return function(){return client[_0xa2c4('0x1')]('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0xa2c4('0x2'),_0xa2c4('0x3'),_0xa2c4('0x4')],'include':[{'model':_0xa2c4('0x5'),'as':_0xa2c4('0x6'),'attributes':['id',_0xa2c4('0x2'),_0xa2c4('0x7'),_0xa2c4('0x8')]}]},'log':'getMailQueues'});};}; \ No newline at end of file +var _0x7a0b=['name','timeout','strategy','Agents','online','../client','getMailQueues','Request'];(function(_0x17ac6f,_0x59bafc){var _0x24b6ca=function(_0x2242f1){while(--_0x2242f1){_0x17ac6f['push'](_0x17ac6f['shift']());}};_0x24b6ca(++_0x59bafc);}(_0x7a0b,0x85));var _0xb7a0=function(_0x45c045,_0x425778){_0x45c045=_0x45c045-0x0;var _0x39e1da=_0x7a0b[_0x45c045];return _0x39e1da;};'use strict';var client=require(_0xb7a0('0x0'));exports[_0xb7a0('0x1')]=function(){return function(){return client[_0xb7a0('0x2')]('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0xb7a0('0x3'),_0xb7a0('0x4'),_0xb7a0('0x5')],'include':[{'model':'User','as':_0xb7a0('0x6'),'attributes':['id',_0xb7a0('0x3'),_0xb7a0('0x7'),'mailPause']}]},'log':_0xb7a0('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 693e6ef..6326326 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 _0x48a2=['UpdateMailQueueReport','../client','create','CreateMailQueueReport'];(function(_0x299a3b,_0x1b5f83){var _0x4233c5=function(_0x24eebc){while(--_0x24eebc){_0x299a3b['push'](_0x299a3b['shift']());}};_0x4233c5(++_0x1b5f83);}(_0x48a2,0x9d));var _0x248a=function(_0x221c0e,_0x1cf4e5){_0x221c0e=_0x221c0e-0x0;var _0x1ffc3a=_0x48a2[_0x221c0e];return _0x1ffc3a;};'use strict';var client=require(_0x248a('0x0'));exports[_0x248a('0x1')]=function(_0xd6d4f0){return client['Request'](_0x248a('0x2'),{'body':_0xd6d4f0,'log':'CreateMailQueueReport'});};exports['update']=function(_0x3aff63,_0x11037f){return client['Request'](_0x248a('0x3'),{'body':_0x11037f,'options':{'where':{'uniqueid':_0x3aff63},'order':[['id','DESC']],'limit':0x1},'log':_0x248a('0x3')});}; \ No newline at end of file +var _0xf4b2=['update','DESC','UpdateMailQueueReport','Request','CreateMailQueueReport'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0xf4b2,0x9e));var _0x2f4b=function(_0x2b61d1,_0x2e982){_0x2b61d1=_0x2b61d1-0x0;var _0x20d7f2=_0xf4b2[_0x2b61d1];return _0x20d7f2;};'use strict';var client=require('../client');exports['create']=function(_0x49b6e9){return client[_0x2f4b('0x0')]('CreateMailQueueReport',{'body':_0x49b6e9,'log':_0x2f4b('0x1')});};exports[_0x2f4b('0x2')]=function(_0xfc0c39,_0x1cff20){return client[_0x2f4b('0x0')]('UpdateMailQueueReport',{'body':_0x1cff20,'options':{'where':{'uniqueid':_0xfc0c39},'order':[['id',_0x2f4b('0x3')]],'limit':0x1},'log':_0x2f4b('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index e0410db..127f612 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 _0x2930=['Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','addTagsToChatInteraction','../client'];(function(_0x411a2c,_0x2f7968){var _0x504091=function(_0x3200f9){while(--_0x3200f9){_0x411a2c['push'](_0x411a2c['shift']());}};_0x504091(++_0x2f7968);}(_0x2930,0x1d3));var _0x0293=function(_0x12f656,_0x2c1ee9){_0x12f656=_0x12f656-0x0;var _0x1ddb04=_0x2930[_0x12f656];return _0x1ddb04;};'use strict';var client=require(_0x0293('0x0'));exports['update']=function(_0x227f46,_0x8a0c12){return client[_0x0293('0x1')](_0x0293('0x2'),{'body':_0x8a0c12,'options':{'where':{'id':_0x227f46}},'log':_0x0293('0x3')});};exports[_0x0293('0x4')]=function(_0x5073ff,_0x3e8a7d){return client[_0x0293('0x1')]('AddTagsToOpenchannelInteraction',{'body':_0x3e8a7d,'options':{'where':{'id':_0x5073ff}},'log':_0x0293('0x5')});}; \ No newline at end of file +var _0x8e9e=['addTags','AddTagsToOpenchannelInteraction','../client','update','Request','UpdateOpenchannelInteraction'];(function(_0x27a591,_0x24c79b){var _0x2de723=function(_0x5c409f){while(--_0x5c409f){_0x27a591['push'](_0x27a591['shift']());}};_0x2de723(++_0x24c79b);}(_0x8e9e,0x140));var _0xe8e9=function(_0xb7cb72,_0x19d391){_0xb7cb72=_0xb7cb72-0x0;var _0x4b7570=_0x8e9e[_0xb7cb72];return _0x4b7570;};'use strict';var client=require(_0xe8e9('0x0'));exports[_0xe8e9('0x1')]=function(_0x369b44,_0x22d1e2){return client[_0xe8e9('0x2')](_0xe8e9('0x3'),{'body':_0x22d1e2,'options':{'where':{'id':_0x369b44}},'log':'updateOpenchannelInteraction'});};exports[_0xe8e9('0x4')]=function(_0x219624,_0x134d80){return client[_0xe8e9('0x2')](_0xe8e9('0x5'),{'body':_0x134d80,'options':{'where':{'id':_0x219624}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 861fba6..fad7c85 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 _0xf875=['createOpenchannelMessage','../client','CreateOpenchannelMessage'];(function(_0x2d61ac,_0x18ff36){var _0x3f7d3c=function(_0x2ba7e5){while(--_0x2ba7e5){_0x2d61ac['push'](_0x2d61ac['shift']());}};_0x3f7d3c(++_0x18ff36);}(_0xf875,0x1c3));var _0x5f87=function(_0x1bb939,_0x5905e9){_0x1bb939=_0x1bb939-0x0;var _0xf8e8a6=_0xf875[_0x1bb939];return _0xf8e8a6;};'use strict';var client=require(_0x5f87('0x0'));exports['create']=function(_0x55d078){return client['Request'](_0x5f87('0x1'),{'body':_0x55d078,'log':_0x5f87('0x2')});}; \ No newline at end of file +var _0x0c6f=['createOpenchannelMessage','CreateOpenchannelMessage'];(function(_0x54c110,_0x4bdc76){var _0xda2c0a=function(_0x35b41f){while(--_0x35b41f){_0x54c110['push'](_0x54c110['shift']());}};_0xda2c0a(++_0x4bdc76);}(_0x0c6f,0x17b));var _0xf0c6=function(_0x3b4783,_0x4e663e){_0x3b4783=_0x3b4783-0x0;var _0x82553e=_0x0c6f[_0x3b4783];return _0x82553e;};'use strict';var client=require('../client');exports['create']=function(_0x184e19){return client['Request'](_0xf0c6('0x0'),{'body':_0x184e19,'log':_0xf0c6('0x1')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 2623cb6..c4f2914 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 _0xbdf0=['online','../client','getOpenchannelQueues','name','strategy','User','Agents'];(function(_0x327518,_0x21022d){var _0x4c64a2=function(_0x19d818){while(--_0x19d818){_0x327518['push'](_0x327518['shift']());}};_0x4c64a2(++_0x21022d);}(_0xbdf0,0x71));var _0x0bdf=function(_0x152678,_0x11e0ac){_0x152678=_0x152678-0x0;var _0x311a9=_0xbdf0[_0x152678];return _0x311a9;};'use strict';var client=require(_0x0bdf('0x0'));exports[_0x0bdf('0x1')]=function(){return function(){return client['Request']('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0x0bdf('0x2'),'timeout',_0x0bdf('0x3')],'include':[{'model':_0x0bdf('0x4'),'as':_0x0bdf('0x5'),'attributes':['id',_0x0bdf('0x2'),_0x0bdf('0x6'),'openchannelPause']}]},'log':_0x0bdf('0x1')});};}; \ No newline at end of file +var _0x9d34=['strategy','User','Agents','openchannelPause','../client','getOpenchannelQueues','Request','name','timeout'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9d34,0x16c));var _0x49d3=function(_0x48ffc9,_0x581b31){_0x48ffc9=_0x48ffc9-0x0;var _0x1985cb=_0x9d34[_0x48ffc9];return _0x1985cb;};'use strict';var client=require(_0x49d3('0x0'));exports[_0x49d3('0x1')]=function(){return function(){return client[_0x49d3('0x2')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0x49d3('0x3'),_0x49d3('0x4'),_0x49d3('0x5')],'include':[{'model':_0x49d3('0x6'),'as':_0x49d3('0x7'),'attributes':['id',_0x49d3('0x3'),'online',_0x49d3('0x8')]}]},'log':_0x49d3('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 3a9db7a..cffc76f 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 _0xe37a=['CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','DESC','../client','create','Request'];(function(_0x22fb94,_0x2bea4b){var _0x3b1956=function(_0x1f32f2){while(--_0x1f32f2){_0x22fb94['push'](_0x22fb94['shift']());}};_0x3b1956(++_0x2bea4b);}(_0xe37a,0x14d));var _0xae37=function(_0x3a255f,_0x306144){_0x3a255f=_0x3a255f-0x0;var _0x480575=_0xe37a[_0x3a255f];return _0x480575;};'use strict';var client=require(_0xae37('0x0'));exports[_0xae37('0x1')]=function(_0x3db8c4){return client[_0xae37('0x2')](_0xae37('0x3'),{'body':_0x3db8c4,'log':_0xae37('0x3')});};exports['update']=function(_0x4d7b3e,_0x332cb0){return client['Request'](_0xae37('0x4'),{'body':_0x332cb0,'options':{'where':{'uniqueid':_0x4d7b3e},'order':[['id',_0xae37('0x5')]],'limit':0x1},'log':_0xae37('0x4')});}; \ No newline at end of file +var _0xbb2d=['../client','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','DESC'];(function(_0x467cb0,_0x303070){var _0x2153f7=function(_0x51775a){while(--_0x51775a){_0x467cb0['push'](_0x467cb0['shift']());}};_0x2153f7(++_0x303070);}(_0xbb2d,0x87));var _0xdbb2=function(_0x528575,_0x2e067d){_0x528575=_0x528575-0x0;var _0x3063b7=_0xbb2d[_0x528575];return _0x3063b7;};'use strict';var client=require(_0xdbb2('0x0'));exports['create']=function(_0x58e2c9){return client['Request'](_0xdbb2('0x1'),{'body':_0x58e2c9,'log':_0xdbb2('0x1')});};exports[_0xdbb2('0x2')]=function(_0x2c8983,_0x11b9ee){return client['Request'](_0xdbb2('0x3'),{'body':_0x11b9ee,'options':{'where':{'uniqueid':_0x2c8983},'order':[['id',_0xdbb2('0x4')]],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 26137d8..6f9923a 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 _0x81bd=['Request','UpdateSmsInteraction','updateSmsInteraction','addTagsToSmsInteraction','../client','update'];(function(_0x9aba,_0x557147){var _0x5a0616=function(_0x3dc6c7){while(--_0x3dc6c7){_0x9aba['push'](_0x9aba['shift']());}};_0x5a0616(++_0x557147);}(_0x81bd,0x7c));var _0xd81b=function(_0x1b6563,_0x3bf0f1){_0x1b6563=_0x1b6563-0x0;var _0xdea7b8=_0x81bd[_0x1b6563];return _0xdea7b8;};'use strict';var client=require(_0xd81b('0x0'));exports[_0xd81b('0x1')]=function(_0x1fd006,_0x2337b1){return client[_0xd81b('0x2')](_0xd81b('0x3'),{'body':_0x2337b1,'options':{'where':{'id':_0x1fd006}},'log':_0xd81b('0x4')});};exports['addTags']=function(_0x16e8de,_0x2c3d9e){return client[_0xd81b('0x2')]('AddTagsToSmsInteraction',{'body':_0x2c3d9e,'options':{'where':{'id':_0x16e8de}},'log':_0xd81b('0x5')});}; \ No newline at end of file +var _0x0e85=['update','Request','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client'];(function(_0x2bd66c,_0x4c3f5d){var _0x2cdcf5=function(_0x4658c6){while(--_0x4658c6){_0x2bd66c['push'](_0x2bd66c['shift']());}};_0x2cdcf5(++_0x4c3f5d);}(_0x0e85,0x7c));var _0x50e8=function(_0x47fd36,_0x41535d){_0x47fd36=_0x47fd36-0x0;var _0x21a0fc=_0x0e85[_0x47fd36];return _0x21a0fc;};'use strict';var client=require(_0x50e8('0x0'));exports[_0x50e8('0x1')]=function(_0x5a568b,_0x11a13a){return client[_0x50e8('0x2')]('UpdateSmsInteraction',{'body':_0x11a13a,'options':{'where':{'id':_0x5a568b}},'log':'updateSmsInteraction'});};exports['addTags']=function(_0x236cf3,_0x4e90e7){return client[_0x50e8('0x2')](_0x50e8('0x3'),{'body':_0x4e90e7,'options':{'where':{'id':_0x236cf3}},'log':_0x50e8('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 8d6fa8d..d239b75 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 _0x0dcf=['create','Request','CreateSmsMessage','createSmsMessage'];(function(_0x1e11b4,_0x224f22){var _0x4ddc3e=function(_0x4b6192){while(--_0x4b6192){_0x1e11b4['push'](_0x1e11b4['shift']());}};_0x4ddc3e(++_0x224f22);}(_0x0dcf,0x10c));var _0xf0dc=function(_0x5a54fc,_0x23c55a){_0x5a54fc=_0x5a54fc-0x0;var _0x3c8388=_0x0dcf[_0x5a54fc];return _0x3c8388;};'use strict';var client=require('../client');exports[_0xf0dc('0x0')]=function(_0x544142){return client[_0xf0dc('0x1')](_0xf0dc('0x2'),{'body':_0x544142,'log':_0xf0dc('0x3')});}; \ No newline at end of file +var _0x7afa=['createSmsMessage','create','Request','CreateSmsMessage'];(function(_0xb3b452,_0x582e8e){var _0x238983=function(_0x3bc866){while(--_0x3bc866){_0xb3b452['push'](_0xb3b452['shift']());}};_0x238983(++_0x582e8e);}(_0x7afa,0x95));var _0xa7af=function(_0x4cb1e9,_0x5d83bf){_0x4cb1e9=_0x4cb1e9-0x0;var _0x218656=_0x7afa[_0x4cb1e9];return _0x218656;};'use strict';var client=require('../client');exports[_0xa7af('0x0')]=function(_0x365e2b){return client[_0xa7af('0x1')](_0xa7af('0x2'),{'body':_0x365e2b,'log':_0xa7af('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 148c3f6..ca9609c 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 _0x9c44=['Request','GetSmsQueue','name','timeout','strategy','User','online','getSmsQueues'];(function(_0x56f96e,_0x5ad683){var _0x4e8af3=function(_0x511595){while(--_0x511595){_0x56f96e['push'](_0x56f96e['shift']());}};_0x4e8af3(++_0x5ad683);}(_0x9c44,0x178));var _0x49c4=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x9c44[_0x2e4aa2];return _0x5e6092;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':![],'attributes':['id',_0x49c4('0x2'),_0x49c4('0x3'),_0x49c4('0x4')],'include':[{'model':_0x49c4('0x5'),'as':'Agents','attributes':['id','name',_0x49c4('0x6'),'smsPause']}]},'log':_0x49c4('0x7')});};}; \ No newline at end of file +var _0x0713=['getSmsQueues','Request','GetSmsQueue','name','timeout','strategy','Agents','online','smsPause'];(function(_0x27b423,_0x312583){var _0x5c11b8=function(_0x22a3b9){while(--_0x22a3b9){_0x27b423['push'](_0x27b423['shift']());}};_0x5c11b8(++_0x312583);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':![],'attributes':['id',_0x3071('0x2'),_0x3071('0x3'),_0x3071('0x4')],'include':[{'model':'User','as':_0x3071('0x5'),'attributes':['id',_0x3071('0x2'),_0x3071('0x6'),_0x3071('0x7')]}]},'log':_0x3071('0x8')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index a2edab4..805cace 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 _0x3e74=['CreateSmsQueueReport','UpdateSmsQueueReport','DESC','../client','Request'];(function(_0x25e438,_0x2b79f3){var _0x413e47=function(_0x4d08fc){while(--_0x4d08fc){_0x25e438['push'](_0x25e438['shift']());}};_0x413e47(++_0x2b79f3);}(_0x3e74,0x175));var _0x43e7=function(_0x461953,_0x7f0c5b){_0x461953=_0x461953-0x0;var _0x355601=_0x3e74[_0x461953];return _0x355601;};'use strict';var client=require(_0x43e7('0x0'));exports['create']=function(_0x349480){return client[_0x43e7('0x1')](_0x43e7('0x2'),{'body':_0x349480,'log':'CreateSmsQueueReport'});};exports['update']=function(_0xc58479,_0x4f9bbe){return client[_0x43e7('0x1')](_0x43e7('0x3'),{'body':_0x4f9bbe,'options':{'where':{'uniqueid':_0xc58479},'order':[['id',_0x43e7('0x4')]],'limit':0x1},'log':_0x43e7('0x3')});}; \ No newline at end of file +var _0x008c=['../client','create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x21e97b,_0x65a77f){var _0x10ba44=function(_0x239ef2){while(--_0x239ef2){_0x21e97b['push'](_0x21e97b['shift']());}};_0x10ba44(++_0x65a77f);}(_0x008c,0x188));var _0xc008=function(_0x5df033,_0x29458b){_0x5df033=_0x5df033-0x0;var _0x445829=_0x008c[_0x5df033];return _0x445829;};'use strict';var client=require(_0xc008('0x0'));exports[_0xc008('0x1')]=function(_0x15aadc){return client[_0xc008('0x2')](_0xc008('0x3'),{'body':_0x15aadc,'log':'CreateSmsQueueReport'});};exports[_0xc008('0x4')]=function(_0x47063f,_0x10b33c){return client[_0xc008('0x2')](_0xc008('0x5'),{'body':_0x10b33c,'options':{'where':{'uniqueid':_0x47063f},'order':[['id',_0xc008('0x6')]],'limit':0x1},'log':_0xc008('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 8d910b1..6ff128a 100644 --- a/server/services/routing/rpc/user.js +++ b/server/services/routing/rpc/user.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['name','pauseType','lastPauseAt','voicePause','chatPause','mailPause','smsPause','whatsappPause','openchannelPause','faxCapacity','openchannelCapacity','../client','getAgents','Request'];(function(_0x5a61c5,_0x1567e7){var _0x4434b4=function(_0x2f4ffc){while(--_0x2f4ffc){_0x5a61c5['push'](_0x5a61c5['shift']());}};_0x4434b4(++_0x1567e7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'online',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'faxPause',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'chatCapacity','mailCapacity',_0x0a9e('0xc'),'smsCapacity','whatsappCapacity',_0x0a9e('0xd')]},'log':_0x0a9e('0x1')});};}; \ No newline at end of file +var _0xa9e0=['name','pauseType','lastPauseAt','voicePause','chatPause','mailPause','smsPause','whatsappPause','openchannelPause','faxCapacity','openchannelCapacity','../client','getAgents','Request'];(function(_0x41795d,_0x5ee43c){var _0x2ab57c=function(_0xa2b72){while(--_0xa2b72){_0x41795d['push'](_0x41795d['shift']());}};_0x2ab57c(++_0x5ee43c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'online',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'faxPause',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'chatCapacity','mailCapacity',_0x0a9e('0xc'),'smsCapacity','whatsappCapacity',_0x0a9e('0xd')]},'log':_0x0a9e('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappInteraction.js b/server/services/routing/rpc/whatsappInteraction.js index f667a6b..b249a28 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 _0x46cb=['addTags','Request','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','update','UpdateWhatsappInteraction','updateWhatsappInteraction'];(function(_0x24b6e6,_0x3b7e13){var _0x56fceb=function(_0x4c04a4){while(--_0x4c04a4){_0x24b6e6['push'](_0x24b6e6['shift']());}};_0x56fceb(++_0x3b7e13);}(_0x46cb,0x84));var _0xb46c=function(_0x3b45d7,_0xbc2848){_0x3b45d7=_0x3b45d7-0x0;var _0x4690e8=_0x46cb[_0x3b45d7];return _0x4690e8;};'use strict';var client=require(_0xb46c('0x0'));exports[_0xb46c('0x1')]=function(_0x31c6bf,_0x395326){return client['Request'](_0xb46c('0x2'),{'body':_0x395326,'options':{'where':{'id':_0x31c6bf}},'log':_0xb46c('0x3')});};exports[_0xb46c('0x4')]=function(_0x25157d,_0x5d3e63){return client[_0xb46c('0x5')](_0xb46c('0x6'),{'body':_0x5d3e63,'options':{'where':{'id':_0x25157d}},'log':_0xb46c('0x7')});}; \ No newline at end of file +var _0x814b=['Request','UpdateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','update'];(function(_0x340299,_0x1a080f){var _0x1c392d=function(_0x2b9f32){while(--_0x2b9f32){_0x340299['push'](_0x340299['shift']());}};_0x1c392d(++_0x1a080f);}(_0x814b,0x1a2));var _0xb814=function(_0x47fd36,_0x41535d){_0x47fd36=_0x47fd36-0x0;var _0x21a0fc=_0x814b[_0x47fd36];return _0x21a0fc;};'use strict';var client=require(_0xb814('0x0'));exports[_0xb814('0x1')]=function(_0x434f30,_0x2f4ece){return client[_0xb814('0x2')](_0xb814('0x3'),{'body':_0x2f4ece,'options':{'where':{'id':_0x434f30}},'log':'updateWhatsappInteraction'});};exports[_0xb814('0x4')]=function(_0x3e1e9,_0x258866){return client[_0xb814('0x2')](_0xb814('0x5'),{'body':_0x258866,'options':{'where':{'id':_0x3e1e9}},'log':_0xb814('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 5c80873..84dd88d 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 _0x4bfe=['Request','createWhatsappMessage','../client','create'];(function(_0x445510,_0x171042){var _0x5043a3=function(_0x3f88b0){while(--_0x3f88b0){_0x445510['push'](_0x445510['shift']());}};_0x5043a3(++_0x171042);}(_0x4bfe,0x16e));var _0xe4bf=function(_0x4a7a31,_0x2154d9){_0x4a7a31=_0x4a7a31-0x0;var _0x594b66=_0x4bfe[_0x4a7a31];return _0x594b66;};'use strict';var client=require(_0xe4bf('0x0'));exports[_0xe4bf('0x1')]=function(_0x437a66){return client[_0xe4bf('0x2')]('CreateWhatsappMessage',{'body':_0x437a66,'log':_0xe4bf('0x3')});}; \ No newline at end of file +var _0x4ec7=['../client','create','CreateWhatsappMessage'];(function(_0x58efca,_0x488bd0){var _0x3d9124=function(_0x20fc4f){while(--_0x20fc4f){_0x58efca['push'](_0x58efca['shift']());}};_0x3d9124(++_0x488bd0);}(_0x4ec7,0x1ef));var _0x74ec=function(_0x4701c7,_0x19b6fd){_0x4701c7=_0x4701c7-0x0;var _0x44da56=_0x4ec7[_0x4701c7];return _0x44da56;};'use strict';var client=require(_0x74ec('0x0'));exports[_0x74ec('0x1')]=function(_0x585ab3){return client['Request'](_0x74ec('0x2'),{'body':_0x585ab3,'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 8bf747c..20f1e81 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 _0xd071=['timeout','strategy','User','Agents','online','../client','getWhatsappQueues','Request','name'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xd071,0x15b));var _0x1d07=function(_0x5482fd,_0x355ba3){_0x5482fd=_0x5482fd-0x0;var _0x2f43bd=_0xd071[_0x5482fd];return _0x2f43bd;};'use strict';var client=require(_0x1d07('0x0'));exports[_0x1d07('0x1')]=function(){return function(){return client[_0x1d07('0x2')]('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id',_0x1d07('0x3'),_0x1d07('0x4'),_0x1d07('0x5')],'include':[{'model':_0x1d07('0x6'),'as':_0x1d07('0x7'),'attributes':['id',_0x1d07('0x3'),_0x1d07('0x8'),'whatsappPause']}]},'log':_0x1d07('0x1')});};}; \ No newline at end of file +var _0x09f0=['../client','getWhatsappQueues','Request','GetWhatsappQueue','name','strategy','online'];(function(_0x4ba2b7,_0x575bd7){var _0x67298e=function(_0x33b415){while(--_0x33b415){_0x4ba2b7['push'](_0x4ba2b7['shift']());}};_0x67298e(++_0x575bd7);}(_0x09f0,0x188));var _0x009f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x09f0[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x009f('0x0'));exports[_0x009f('0x1')]=function(){return function(){return client[_0x009f('0x2')](_0x009f('0x3'),{'options':{'raw':![],'attributes':['id',_0x009f('0x4'),'timeout',_0x009f('0x5')],'include':[{'model':'User','as':'Agents','attributes':['id',_0x009f('0x4'),_0x009f('0x6'),'whatsappPause']}]},'log':_0x009f('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 99cb659..7833f1f 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 _0x9424=['../client','create','Request','CreateWhatsappQueueReport','update','DESC','UpdateWhatsappQueueReport'];(function(_0x227f44,_0x10ab21){var _0x5cbe0e=function(_0xeec7c5){while(--_0xeec7c5){_0x227f44['push'](_0x227f44['shift']());}};_0x5cbe0e(++_0x10ab21);}(_0x9424,0xcb));var _0x4942=function(_0x2d16a9,_0x2c0530){_0x2d16a9=_0x2d16a9-0x0;var _0x54e8b0=_0x9424[_0x2d16a9];return _0x54e8b0;};'use strict';var client=require(_0x4942('0x0'));exports[_0x4942('0x1')]=function(_0x3207f3){return client[_0x4942('0x2')]('CreateWhatsappQueueReport',{'body':_0x3207f3,'log':_0x4942('0x3')});};exports[_0x4942('0x4')]=function(_0x201689,_0x1da5d5){return client[_0x4942('0x2')]('UpdateWhatsappQueueReport',{'body':_0x1da5d5,'options':{'where':{'uniqueid':_0x201689},'order':[['id',_0x4942('0x5')]],'limit':0x1},'log':_0x4942('0x6')});}; \ No newline at end of file +var _0x25fc=['update','Request','DESC','UpdateWhatsappQueueReport','../client','create','CreateWhatsappQueueReport'];(function(_0x1d9dfa,_0x30598d){var _0x252661=function(_0x4bcc24){while(--_0x4bcc24){_0x1d9dfa['push'](_0x1d9dfa['shift']());}};_0x252661(++_0x30598d);}(_0x25fc,0x17e));var _0xc25f=function(_0x3f7460,_0x19fe85){_0x3f7460=_0x3f7460-0x0;var _0xd733f4=_0x25fc[_0x3f7460];return _0xd733f4;};'use strict';var client=require(_0xc25f('0x0'));exports[_0xc25f('0x1')]=function(_0x4ec97d){return client['Request'](_0xc25f('0x2'),{'body':_0x4ec97d,'log':_0xc25f('0x2')});};exports[_0xc25f('0x3')]=function(_0x508e95,_0x14705e){return client[_0xc25f('0x4')]('UpdateWhatsappQueueReport',{'body':_0x14705e,'options':{'where':{'uniqueid':_0x508e95},'order':[['id',_0xc25f('0x5')]],'limit':0x1},'log':_0xc25f('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index bce11e2..d536af4 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 _0x0e08=['routing','./strategy','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','info','format','name','toLowerCase','consequence','error','map','join','stop','find','timeout','createQueue','atimeout','channel','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','[%s][AGENT]\x20ROUTING\x20END','next','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','validate','util','seq-queue','../../../../config/logger'];(function(_0x3161dd,_0x48247a){var _0x15ba16=function(_0xe8ac44){while(--_0xe8ac44){_0x3161dd['push'](_0x3161dd['shift']());}};_0x15ba16(++_0x48247a);}(_0x0e08,0x13c));var _0x80e0=function(_0x31fc63,_0x345376){_0x31fc63=_0x31fc63-0x0;var _0x36af4f=_0x0e08[_0x31fc63];return _0x36af4f;};'use strict';var schema=require(_0x80e0('0x0'));var _=require('lodash');var util=require(_0x80e0('0x1'));var seqqueue=require(_0x80e0('0x2'));var logger=require(_0x80e0('0x3'))(_0x80e0('0x4'));var strategy=require(_0x80e0('0x5'));var queue=schema({'name':{'type':'string','required':!![],'message':_0x80e0('0x6')},'timeout':{'type':'number','message':_0x80e0('0x7')}});function writeLog(_0x48e4c3,_0x29c1a4,_0x576d39){return logger[_0x80e0('0x8')](util[_0x80e0('0x9')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x48e4c3,_0x29c1a4[_0x80e0('0xa')],_0x576d39));}function handleFindAgent(_0x3f2cc7){return function(_0x3f1071){return _0x3f1071[_0x80e0('0xa')][_0x80e0('0xb')]()===_0x3f2cc7[_0x80e0('0xb')]();};}exports[_0x80e0('0xc')]=function(_0x4f8d1d,_0x45cde2,_0x34c855,_0x22179a){return function(_0x552554){try{var _0x544d73={'name':_0x45cde2[0x0],'timeout':_0x45cde2[0x1]};var _0x11d1e4=queue[_0x80e0('0x0')](_0x544d73,{'typecast':!![]});if(_0x11d1e4['length']){logger[_0x80e0('0xd')]('[%s][AGENT]\x20%s',_0x4f8d1d,_[_0x80e0('0xe')](_0x11d1e4,'message')[_0x80e0('0xf')](',\x20'));_0x552554[_0x80e0('0x10')]();}else{var _0x4ffe10=_[_0x80e0('0x11')](_0x34c855['agents'],handleFindAgent(_0x544d73['name']));if(_0x4ffe10){var _0x5a80b5=(_0x544d73[_0x80e0('0x12')]||0xa)*0x3e8;var _0x349e62,_0x53d83f;var _0x3393e9=seqqueue[_0x80e0('0x13')](_0x5a80b5);_0x3393e9['id']=_0x4f8d1d;_0x3393e9[_0x80e0('0x14')]=_0x5a80b5;_0x3393e9[_0x80e0('0x15')]=_0x22179a[_0x80e0('0x15')];writeLog(_0x4f8d1d,_0x4ffe10,util[_0x80e0('0x9')]('START:%s',_0x5a80b5));_0x34c855[_0x80e0('0x16')][_0x4f8d1d]['on'](_0x80e0('0x17'),function(){logger['info'](_0x80e0('0x18'),_0x4f8d1d);clearTimeout(_0x53d83f);_0x53d83f=undefined;_0x3393e9[_0x80e0('0x19')]();if(_0x34c855[_0x80e0('0x16')][_0x4f8d1d]){delete _0x34c855[_0x80e0('0x16')][_0x4f8d1d];}_0x552554[_0x80e0('0x10')]();});_0x34c855[_0x80e0('0x16')][_0x4f8d1d]['on'](_0x80e0('0x1a'),function(){if(_0x34c855[_0x80e0('0x16')][_0x4f8d1d]){delete _0x34c855[_0x80e0('0x16')][_0x4f8d1d];}});_0x53d83f=setTimeout(function(){logger[_0x80e0('0x8')](_0x80e0('0x1b'),_0x4f8d1d);clearTimeout(_0x53d83f);_0x3393e9[_0x80e0('0x19')]();_0x552554[_0x80e0('0x1c')]();},_0x5a80b5);strategy['agent'](_0x3393e9,_0x4ffe10,_0x34c855,_0x22179a);}else{logger[_0x80e0('0xd')](_0x80e0('0x1d'),_0x4f8d1d,_0x544d73[_0x80e0('0xa')]);_0x552554['stop']();}}}catch(_0x31d9f8){console[_0x80e0('0x1e')](_0x31d9f8);logger[_0x80e0('0xd')](_0x80e0('0x1f'),_0x4f8d1d,_0x31d9f8['stack']);_0x552554['stop']();}};}; \ No newline at end of file +var _0xa4ac=['timeout\x20is\x20a\x20number','info','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','validate','length','error','[%s][AGENT]\x20%s','map','message','join','stop','find','agents','createQueue','atimeout','channel','format','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','complete','[%s][AGENT]\x20ROUTING\x20END','close','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','stack','lodash','util','seq-queue','routing','./strategy','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'];(function(_0x3a5974,_0x4f0d3b){var _0x334401=function(_0x1d6aac){while(--_0x1d6aac){_0x3a5974['push'](_0x3a5974['shift']());}};_0x334401(++_0x4f0d3b);}(_0xa4ac,0x191));var _0xca4a=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa4ac[_0x40ac5e];return _0x2839d6;};'use strict';var schema=require('validate');var _=require(_0xca4a('0x0'));var util=require(_0xca4a('0x1'));var seqqueue=require(_0xca4a('0x2'));var logger=require('../../../../config/logger')(_0xca4a('0x3'));var strategy=require(_0xca4a('0x4'));var queue=schema({'name':{'type':'string','required':!![],'message':_0xca4a('0x5')},'timeout':{'type':'number','message':_0xca4a('0x6')}});function writeLog(_0x83a54f,_0x2fe67e,_0xe50200){return logger[_0xca4a('0x7')](util['format'](_0xca4a('0x8'),_0x83a54f,_0x2fe67e[_0xca4a('0x9')],_0xe50200));}function handleFindAgent(_0x4c55d8){return function(_0x430c6f){return _0x430c6f[_0xca4a('0x9')]['toLowerCase']()===_0x4c55d8[_0xca4a('0xa')]();};}exports[_0xca4a('0xb')]=function(_0x8b45ad,_0x310457,_0x2d4ffc,_0x5591d1){return function(_0x20b211){try{var _0x294524={'name':_0x310457[0x0],'timeout':_0x310457[0x1]};var _0x1619a8=queue[_0xca4a('0xc')](_0x294524,{'typecast':!![]});if(_0x1619a8[_0xca4a('0xd')]){logger[_0xca4a('0xe')](_0xca4a('0xf'),_0x8b45ad,_[_0xca4a('0x10')](_0x1619a8,_0xca4a('0x11'))[_0xca4a('0x12')](',\x20'));_0x20b211[_0xca4a('0x13')]();}else{var _0x4f342c=_[_0xca4a('0x14')](_0x2d4ffc[_0xca4a('0x15')],handleFindAgent(_0x294524[_0xca4a('0x9')]));if(_0x4f342c){var _0x2353af=(_0x294524['timeout']||0xa)*0x3e8;var _0x58a325,_0x140d70;var _0x5d628c=seqqueue[_0xca4a('0x16')](_0x2353af);_0x5d628c['id']=_0x8b45ad;_0x5d628c[_0xca4a('0x17')]=_0x2353af;_0x5d628c['channel']=_0x5591d1[_0xca4a('0x18')];writeLog(_0x8b45ad,_0x4f342c,util[_0xca4a('0x19')](_0xca4a('0x1a'),_0x2353af));_0x2d4ffc[_0xca4a('0x1b')][_0x8b45ad]['on'](_0xca4a('0x1c'),function(){logger['info'](_0xca4a('0x1d'),_0x8b45ad);clearTimeout(_0x140d70);_0x140d70=undefined;_0x5d628c['close']();if(_0x2d4ffc[_0xca4a('0x1b')][_0x8b45ad]){delete _0x2d4ffc[_0xca4a('0x1b')][_0x8b45ad];}_0x20b211['stop']();});_0x2d4ffc['rules'][_0x8b45ad]['on'](_0xca4a('0x1e'),function(){if(_0x2d4ffc[_0xca4a('0x1b')][_0x8b45ad]){delete _0x2d4ffc[_0xca4a('0x1b')][_0x8b45ad];}});_0x140d70=setTimeout(function(){logger[_0xca4a('0x7')](_0xca4a('0x1f'),_0x8b45ad);clearTimeout(_0x140d70);_0x5d628c[_0xca4a('0x20')]();_0x20b211[_0xca4a('0x21')]();},_0x2353af);strategy[_0xca4a('0x22')](_0x5d628c,_0x4f342c,_0x2d4ffc,_0x5591d1);}else{logger[_0xca4a('0xe')](_0xca4a('0x23'),_0x8b45ad,_0x294524['name']);_0x20b211['stop']();}}}catch(_0x5ad2be){console['log'](_0x5ad2be);logger[_0xca4a('0xe')]('[%s][QUEUE]\x20%s',_0x8b45ad,_0x5ad2be[_0xca4a('0x24')]);_0x20b211[_0xca4a('0x13')]();}};}; \ 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 a92e459..0a3f7d0 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 _0x3007=['next','amazonlex','providerName','providerResponse','Message','dialogState','[%s][AMAZONLEX]\x20%s','stringify','lodash','moment','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','isNil','interaction','UserId','info','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','phone','chat','account','AccountId','InteractionId','created','isEmpty','body','getMustacheRender','create','then','catch','error','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','$LATEST','message','toString','postText'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3007,0xbc));var _0x7300=function(_0x264689,_0x30b30c){_0x264689=_0x264689-0x0;var _0x4b8696=_0x3007[_0x264689];return _0x4b8696;};'use strict';var _=require(_0x7300('0x0'));var moment=require(_0x7300('0x1'));var AWS=require('aws-sdk');var utils=require('./utils');var logger=require(_0x7300('0x2'))(_0x7300('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x7300('0x4')),'mailMessage':require(_0x7300('0x5')),'smsMessage':require(_0x7300('0x6')),'faxMessage':require(_0x7300('0x7')),'whatsappMessage':require(_0x7300('0x8'))};exports['consequence']=function(_0x5291b3,_0x529566){return function(_0x206717){try{if(!_[_0x7300('0x9')](this[_0x7300('0xa')][_0x7300('0xb')])){logger[_0x7300('0xc')]('[%s][AMAZONLEX]\x20%s',_0x5291b3,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x206717['next']();}var _0x5cf71e={'ContactId':this['contact']['id'],'sentAt':moment()[_0x7300('0xd')](_0x7300('0xe')),'direction':_0x7300('0xf')};if(this[_0x7300('0x10')]==='sms'||this['channel']==='whatsapp'){_0x5cf71e[_0x7300('0x11')]=this[_0x7300('0xa')][_0x7300('0x11')];}var _0x33fac8=this['channel'];if(_0x33fac8===_0x7300('0x12')){_0x5cf71e['ChatWebsiteId']=this[_0x7300('0x13')]['id'];}else{_0x5cf71e[_['upperFirst'](_0x33fac8)+_0x7300('0x14')]=this['account']['id'];}_0x5cf71e[_['upperFirst'](_0x33fac8)+_0x7300('0x15')]=this[_0x7300('0xa')]['id'];if(this[_0x7300('0xa')][_0x7300('0x16')]){var _0x4eb5f4=_0x529566[0x4];if(!_[_0x7300('0x17')](_0x4eb5f4)){_0x5cf71e[_0x7300('0x18')]=utils[_0x7300('0x19')](_0x4eb5f4,this);return rpc[_0x33fac8+'Message'][_0x7300('0x1a')](_0x5cf71e)[_0x7300('0x1b')](function(_0x1bcdd5){logger[_0x7300('0xc')]('[%s][AMAZONLEX]\x20%s',_0x5291b3,_0x5cf71e[_0x7300('0x18')]);})[_0x7300('0x1c')](function(_0x32b0a2){logger[_0x7300('0x1d')]('[%s][AMAZONLEX]\x20%s',_0x5291b3,JSON['stringify'](_0x32b0a2));})[_0x7300('0x1e')](function(){logger[_0x7300('0xc')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x5291b3);_0x206717['stop']();});}else{logger[_0x7300('0xc')](_0x7300('0x1f'),_0x5291b3);_0x206717[_0x7300('0x20')]();}}else{var _0x4a2a6b=this;var _0x31e066=new AWS['LexRuntime']({'accessKeyId':_0x529566[0x0],'secretAccessKey':_0x529566[0x1],'region':_0x529566[0x2]});var _0x5d2557={'botAlias':_0x7300('0x21'),'botName':_0x529566[0x3],'inputText':this[_0x7300('0x22')][_0x7300('0x18')],'userId':this[_0x7300('0x10')]+':'+this[_0x7300('0xa')]['id'][_0x7300('0x23')]()};_0x31e066[_0x7300('0x24')](_0x5d2557,function(_0x2194ef,_0x4f878e){if(_0x2194ef){logger[_0x7300('0x1d')]('[%s][AMAZONLEX]\x20%s',_0x5291b3,_0x2194ef[_0x7300('0x22')]);_0x206717[_0x7300('0x25')]();}else if(_0x4f878e&&_0x4f878e[_0x7300('0x22')]){_0x4a2a6b['body'][_0x7300('0x26')]=_0x4f878e;_0x5cf71e[_0x7300('0x18')]=_0x4f878e['message'];_0x5cf71e[_0x7300('0x27')]=_0x7300('0x26');_0x5cf71e[_0x7300('0x28')]=JSON['stringify'](_0x4f878e);return rpc[_0x33fac8+_0x7300('0x29')][_0x7300('0x1a')](_0x5cf71e)['then'](function(_0x37dd28){logger['info']('[%s][AMAZONLEX]\x20%s',_0x5291b3,_0x5cf71e[_0x7300('0x18')]);if(_0x4f878e[_0x7300('0x2a')]=='Failed'){_0x206717[_0x7300('0x25')]();}else{_0x206717[_0x7300('0x20')]();}})[_0x7300('0x1c')](function(_0x4ebf32){logger[_0x7300('0x1d')](_0x7300('0x2b'),_0x5291b3,JSON[_0x7300('0x2c')](_0x4ebf32));_0x206717[_0x7300('0x25')]();});}else{_0x206717[_0x7300('0x25')]();}});}}catch(_0x485924){logger['error'](_0x7300('0x2b'),_0x5291b3,JSON[_0x7300('0x2c')](_0x485924));_0x206717[_0x7300('0x20')]();}};}; \ No newline at end of file +var _0xc434=['providerName','amazonlex','stringify','dialogState','Failed','catch','lodash','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','body','getMustacheRender','Message','create','then','info','finally','stop','$LATEST','message','toString','postText','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc434,0x16b));var _0x4c43=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0xc434[_0x12fc8d];return _0x3f9d04;};'use strict';var _=require(_0x4c43('0x0'));var moment=require(_0x4c43('0x1'));var AWS=require(_0x4c43('0x2'));var utils=require(_0x4c43('0x3'));var logger=require(_0x4c43('0x4'))(_0x4c43('0x5'));var rpc={'chatMessage':require(_0x4c43('0x6')),'openchannelMessage':require(_0x4c43('0x7')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x4c43('0x8')),'faxMessage':require(_0x4c43('0x9')),'whatsappMessage':require(_0x4c43('0xa'))};exports[_0x4c43('0xb')]=function(_0x20c8af,_0x38f781){return function(_0x7864b4){try{if(!_[_0x4c43('0xc')](this[_0x4c43('0xd')][_0x4c43('0xe')])){logger['info'](_0x4c43('0xf'),_0x20c8af,_0x4c43('0x10'));return _0x7864b4[_0x4c43('0x11')]();}var _0x4fb2fc={'ContactId':this[_0x4c43('0x12')]['id'],'sentAt':moment()[_0x4c43('0x13')](_0x4c43('0x14')),'direction':_0x4c43('0x15')};if(this[_0x4c43('0x16')]===_0x4c43('0x17')||this[_0x4c43('0x16')]===_0x4c43('0x18')){_0x4fb2fc['phone']=this[_0x4c43('0xd')]['phone'];}var _0x55827f=this[_0x4c43('0x16')];if(_0x55827f==='chat'){_0x4fb2fc[_0x4c43('0x19')]=this[_0x4c43('0x1a')]['id'];}else{_0x4fb2fc[_[_0x4c43('0x1b')](_0x55827f)+_0x4c43('0x1c')]=this[_0x4c43('0x1a')]['id'];}_0x4fb2fc[_['upperFirst'](_0x55827f)+_0x4c43('0x1d')]=this['interaction']['id'];if(this[_0x4c43('0xd')][_0x4c43('0x1e')]){var _0xd93120=_0x38f781[0x4];if(!_[_0x4c43('0x1f')](_0xd93120)){_0x4fb2fc[_0x4c43('0x20')]=utils[_0x4c43('0x21')](_0xd93120,this);return rpc[_0x55827f+_0x4c43('0x22')][_0x4c43('0x23')](_0x4fb2fc)[_0x4c43('0x24')](function(_0x2b978c){logger[_0x4c43('0x25')](_0x4c43('0xf'),_0x20c8af,_0x4fb2fc[_0x4c43('0x20')]);})['catch'](function(_0x5940c0){logger['error'](_0x4c43('0xf'),_0x20c8af,JSON['stringify'](_0x5940c0));})[_0x4c43('0x26')](function(){logger[_0x4c43('0x25')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x20c8af);_0x7864b4[_0x4c43('0x27')]();});}else{logger['info']('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x20c8af);_0x7864b4[_0x4c43('0x27')]();}}else{var _0x5cd40a=this;var _0x276c2c=new AWS['LexRuntime']({'accessKeyId':_0x38f781[0x0],'secretAccessKey':_0x38f781[0x1],'region':_0x38f781[0x2]});var _0x3bc22e={'botAlias':_0x4c43('0x28'),'botName':_0x38f781[0x3],'inputText':this[_0x4c43('0x29')]['body'],'userId':this[_0x4c43('0x16')]+':'+this[_0x4c43('0xd')]['id'][_0x4c43('0x2a')]()};_0x276c2c[_0x4c43('0x2b')](_0x3bc22e,function(_0x15f70f,_0x52b986){if(_0x15f70f){logger[_0x4c43('0x2c')](_0x4c43('0xf'),_0x20c8af,_0x15f70f[_0x4c43('0x29')]);_0x7864b4[_0x4c43('0x11')]();}else if(_0x52b986&&_0x52b986[_0x4c43('0x29')]){_0x5cd40a[_0x4c43('0x20')]['amazonlex']=_0x52b986;_0x4fb2fc[_0x4c43('0x20')]=_0x52b986[_0x4c43('0x29')];_0x4fb2fc[_0x4c43('0x2d')]=_0x4c43('0x2e');_0x4fb2fc['providerResponse']=JSON[_0x4c43('0x2f')](_0x52b986);return rpc[_0x55827f+_0x4c43('0x22')][_0x4c43('0x23')](_0x4fb2fc)[_0x4c43('0x24')](function(_0x2f0533){logger[_0x4c43('0x25')]('[%s][AMAZONLEX]\x20%s',_0x20c8af,_0x4fb2fc[_0x4c43('0x20')]);if(_0x52b986[_0x4c43('0x30')]==_0x4c43('0x31')){_0x7864b4[_0x4c43('0x11')]();}else{_0x7864b4[_0x4c43('0x27')]();}})[_0x4c43('0x32')](function(_0x299680){logger[_0x4c43('0x2c')]('[%s][AMAZONLEX]\x20%s',_0x20c8af,JSON[_0x4c43('0x2f')](_0x299680));_0x7864b4[_0x4c43('0x11')]();});}else{_0x7864b4[_0x4c43('0x11')]();}});}}catch(_0x336069){logger[_0x4c43('0x2c')](_0x4c43('0xf'),_0x20c8af,JSON[_0x4c43('0x2f')](_0x336069));_0x7864b4[_0x4c43('0x27')]();}};}; \ 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 12f8e5b..3f721b7 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 _0x4ed1=['replace','','headers','auto-replied','All','auto_reply','sendMailMessage','smtpOptions','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','then','catch','error','stringify','finally','Interaction','update','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','resolve','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','channel','mail','body','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','Autoreply\x20already\x20sent','autoreplyExecuted','One\x20Time\x20already\x20sent','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','getMustacheRender','message','from','phone','read','subject','startsWith','Re:','Re:\x20','chat','ChatWebsiteId','account','upperFirst','InteractionId','Message','inReplyTo','messageId','html',''];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x4ed1,0x13e));var _0x14ed=function(_0x5d2f34,_0x5a9e3b){_0x5d2f34=_0x5d2f34-0x0;var _0x4834a4=_0x4ed1[_0x5d2f34];return _0x4834a4;};'use strict';var _=require(_0x14ed('0x0'));var moment=require(_0x14ed('0x1'));var utils=require(_0x14ed('0x2'));var logger=require(_0x14ed('0x3'))(_0x14ed('0x4'));var rpc={'chatMessage':require(_0x14ed('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x14ed('0x6')),'faxMessage':require(_0x14ed('0x7')),'whatsappMessage':require(_0x14ed('0x8')),'chatInteraction':require(_0x14ed('0x9')),'openchannelInteraction':require(_0x14ed('0xa')),'mailInteraction':require(_0x14ed('0xb')),'smsInteraction':require(_0x14ed('0xc')),'faxInteraction':require(_0x14ed('0xd')),'whatsappInteraction':require(_0x14ed('0xe'))};var mailRpc=require(_0x14ed('0xf'));exports['consequence']=function(_0x13bd28,_0x1928b0,_0x50bacb,_0x46b2d7){return function(_0x1c2209){try{var _0x3b6409=this[_0x14ed('0x10')];if(_0x3b6409===_0x14ed('0x11')&&_0x46b2d7[_0x14ed('0x12')]['isAutoreply']){logger[_0x14ed('0x13')](_0x14ed('0x14'),_0x13bd28,_0x14ed('0x15'));return _0x1c2209[_0x14ed('0x16')]();}if(_0x1928b0[0x0]==='1'&&(_[_0x14ed('0x17')](this[_0x14ed('0x18')][_0x14ed('0x19')])||!this[_0x14ed('0x18')][_0x14ed('0x19')])){logger[_0x14ed('0x13')]('[%s][AUTOREPLY]\x20%s',_0x13bd28,_0x14ed('0x1a'));return _0x1c2209['next']();}if(_0x1928b0[0x0]==='2'&&this[_0x14ed('0x18')][_0x14ed('0x1b')]){logger[_0x14ed('0x13')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x13bd28,_0x14ed('0x1c'));return _0x1c2209[_0x14ed('0x16')]();}var _0xd6c29f={'ContactId':this[_0x14ed('0x1d')]['id'],'sentAt':moment()[_0x14ed('0x1e')](_0x14ed('0x1f')),'direction':_0x14ed('0x20')};if(this[_0x14ed('0x10')]==='mail'){_0xd6c29f[_0x14ed('0x12')]=utils['getMustacheRender'](_0x1928b0[0x2],this);}else{_0xd6c29f[_0x14ed('0x12')]=utils[_0x14ed('0x21')](_0x1928b0[0x1],this);}if(this[_0x14ed('0x22')]){_0xd6c29f['to']=this[_0x14ed('0x22')][_0x14ed('0x23')]||'';if(this[_0x14ed('0x10')]===_0x14ed('0x11')&&_0x1928b0[0x1]==='1'){_0xd6c29f['cc']=this[_0x14ed('0x22')]['cc']||'';}_0xd6c29f[_0x14ed('0x23')]=this[_0x14ed('0x22')]['to']||'';_0xd6c29f[_0x14ed('0x24')]=this[_0x14ed('0x22')]['phone']||'';_0xd6c29f[_0x14ed('0x25')]=!![];if(this[_0x14ed('0x22')][_0x14ed('0x26')]){_0xd6c29f[_0x14ed('0x26')]='';_0xd6c29f['subject']+=_[_0x14ed('0x27')](this[_0x14ed('0x22')][_0x14ed('0x26')],_0x14ed('0x28'))?'':_0x14ed('0x29');_0xd6c29f[_0x14ed('0x26')]+=this[_0x14ed('0x22')][_0x14ed('0x26')];}}if(this[_0x14ed('0x10')]===_0x14ed('0x2a')){_0xd6c29f[_0x14ed('0x2b')]=this[_0x14ed('0x2c')]['id'];}else{_0xd6c29f[_[_0x14ed('0x2d')](this['channel'])+'AccountId']=this[_0x14ed('0x2c')]['id'];}_0xd6c29f[_[_0x14ed('0x2d')](this[_0x14ed('0x10')])+_0x14ed('0x2e')]=this[_0x14ed('0x18')]['id'];var _0x1342a5=this['interaction'];if(rpc[this['channel']+_0x14ed('0x2f')]){if(this[_0x14ed('0x10')]===_0x14ed('0x11')){_0xd6c29f[_0x14ed('0x30')]=this[_0x14ed('0x22')][_0x14ed('0x31')];_0xd6c29f[_0x14ed('0x32')]=_0x14ed('0x33')+_[_0x14ed('0x34')](_0xd6c29f[_0x14ed('0x12')],_0x14ed('0x35'),_0x14ed('0x36'))+_0x14ed('0x37');_0xd6c29f[_0x14ed('0x38')]={'Auto-Submitted':_0x14ed('0x39'),'X-Auto-Response-Suppress':_0x14ed('0x3a'),'Precedence':_0x14ed('0x3b')};return mailRpc[_0x14ed('0x3c')](this[_0x14ed('0x2c')][_0x14ed('0x3d')],_0xd6c29f)['then'](function(_0x8cb4b5){logger[_0x14ed('0x13')](_0x14ed('0x3e'),_0x13bd28);_0xd6c29f[_0x14ed('0x31')]=_0x8cb4b5['message']['messageId'];return rpc[_0x3b6409+_0x14ed('0x2f')][_0x14ed('0x3f')](_0xd6c29f);})[_0x14ed('0x40')](function(_0x1c0d39){logger['info']('[%s][AUTOREPLY]\x20%s',_0x13bd28,JSON['stringify'](_0x1c0d39));})[_0x14ed('0x41')](function(_0x54a232){logger[_0x14ed('0x42')]('[RPC][%s][AUTOREPLY]\x20%s',_0x13bd28,JSON[_0x14ed('0x43')](_0x54a232));})[_0x14ed('0x44')](function(){Promise['resolve']()[_0x14ed('0x40')](function(){if(_0x1928b0[0x0]!=='2'||_0x1342a5[_0x14ed('0x1b')])return;return rpc[_0x3b6409+_0x14ed('0x45')][_0x14ed('0x46')](_0x1342a5['id'],{'autoreplyExecuted':!![]})[_0x14ed('0x40')](function(_0x27dfab){logger['info'](_0x14ed('0x47'),_0x13bd28,JSON['stringify'](_0x27dfab));})[_0x14ed('0x41')](function(_0x28a369){logger[_0x14ed('0x42')](_0x14ed('0x48'),_0x13bd28,JSON[_0x14ed('0x43')](_0x28a369));});})[_0x14ed('0x40')](function(){_0x1c2209[_0x14ed('0x16')]();});});}else{return rpc[this['channel']+_0x14ed('0x2f')][_0x14ed('0x3f')](_0xd6c29f)['then'](function(){logger['info'](_0x14ed('0x14'),_0x13bd28,_0xd6c29f[_0x14ed('0x12')]);})[_0x14ed('0x41')](function(_0x1ad8ab){logger['error'](_0x14ed('0x14'),_0x13bd28,JSON[_0x14ed('0x43')](_0x1ad8ab));})[_0x14ed('0x44')](function(){Promise[_0x14ed('0x49')]()['then'](function(){if(_0x1928b0[0x0]!=='2'||_0x1342a5[_0x14ed('0x1b')])return;return rpc[_0x3b6409+'Interaction']['update'](_0x1342a5['id'],{'autoreplyExecuted':!![]})[_0x14ed('0x40')](function(_0x2df491){logger[_0x14ed('0x13')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x13bd28,JSON[_0x14ed('0x43')](_0x2df491));})[_0x14ed('0x41')](function(_0xaaeca1){logger[_0x14ed('0x42')](_0x14ed('0x48'),_0x13bd28,JSON['stringify'](_0xaaeca1));});})[_0x14ed('0x40')](function(){_0x1c2209[_0x14ed('0x16')]();});});}}}catch(_0xb3020e){logger[_0x14ed('0x42')](_0x14ed('0x14'),_0x13bd28,JSON[_0x14ed('0x43')](_0xb3020e));_0x1c2209['stop']();}};}; \ No newline at end of file +var _0xd48e=['inReplyTo','messageId','html','','replace','','headers','All','auto_reply','smtpOptions','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','[%s][AUTOREPLY]\x20%s','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','resolve','Interaction','stop','lodash','moment','./utils','routing','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','channel','mail','body','isAutoreply','info','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','Autoreply\x20already\x20sent','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','getMustacheRender','message','from','phone','read','subject','startsWith','Re:\x20','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','Message'];(function(_0xcdf425,_0x145d56){var _0x3a6ef0=function(_0x53574c){while(--_0x53574c){_0xcdf425['push'](_0xcdf425['shift']());}};_0x3a6ef0(++_0x145d56);}(_0xd48e,0x187));var _0xed48=function(_0x5cb1af,_0x4bdc8c){_0x5cb1af=_0x5cb1af-0x0;var _0x8d7940=_0xd48e[_0x5cb1af];return _0x8d7940;};'use strict';var _=require(_0xed48('0x0'));var moment=require(_0xed48('0x1'));var utils=require(_0xed48('0x2'));var logger=require('../../../../config/logger')(_0xed48('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xed48('0x4')),'smsMessage':require(_0xed48('0x5')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xed48('0x6')),'chatInteraction':require(_0xed48('0x7')),'openchannelInteraction':require(_0xed48('0x8')),'mailInteraction':require(_0xed48('0x9')),'smsInteraction':require(_0xed48('0xa')),'faxInteraction':require(_0xed48('0xb')),'whatsappInteraction':require(_0xed48('0xc'))};var mailRpc=require('../../mailRpc');exports[_0xed48('0xd')]=function(_0x3c40da,_0x5d54cc,_0x228193,_0x2cf20c){return function(_0x5d148e){try{var _0x309441=this[_0xed48('0xe')];if(_0x309441===_0xed48('0xf')&&_0x2cf20c[_0xed48('0x10')][_0xed48('0x11')]){logger[_0xed48('0x12')]('[%s][AUTOREPLY]\x20%s',_0x3c40da,_0xed48('0x13'));return _0x5d148e[_0xed48('0x14')]();}if(_0x5d54cc[0x0]==='1'&&(_[_0xed48('0x15')](this[_0xed48('0x16')][_0xed48('0x17')])||!this['interaction'][_0xed48('0x17')])){logger['info']('[%s][AUTOREPLY]\x20%s',_0x3c40da,_0xed48('0x18'));return _0x5d148e['next']();}if(_0x5d54cc[0x0]==='2'&&this[_0xed48('0x16')][_0xed48('0x19')]){logger[_0xed48('0x12')](_0xed48('0x1a'),_0x3c40da,_0xed48('0x1b'));return _0x5d148e[_0xed48('0x14')]();}var _0xde2856={'ContactId':this[_0xed48('0x1c')]['id'],'sentAt':moment()[_0xed48('0x1d')](_0xed48('0x1e')),'direction':_0xed48('0x1f')};if(this[_0xed48('0xe')]===_0xed48('0xf')){_0xde2856[_0xed48('0x10')]=utils[_0xed48('0x20')](_0x5d54cc[0x2],this);}else{_0xde2856[_0xed48('0x10')]=utils[_0xed48('0x20')](_0x5d54cc[0x1],this);}if(this[_0xed48('0x21')]){_0xde2856['to']=this['message'][_0xed48('0x22')]||'';if(this[_0xed48('0xe')]===_0xed48('0xf')&&_0x5d54cc[0x1]==='1'){_0xde2856['cc']=this[_0xed48('0x21')]['cc']||'';}_0xde2856[_0xed48('0x22')]=this[_0xed48('0x21')]['to']||'';_0xde2856[_0xed48('0x23')]=this[_0xed48('0x21')][_0xed48('0x23')]||'';_0xde2856[_0xed48('0x24')]=!![];if(this[_0xed48('0x21')][_0xed48('0x25')]){_0xde2856[_0xed48('0x25')]='';_0xde2856[_0xed48('0x25')]+=_[_0xed48('0x26')](this['message'][_0xed48('0x25')],'Re:')?'':_0xed48('0x27');_0xde2856['subject']+=this[_0xed48('0x21')][_0xed48('0x25')];}}if(this[_0xed48('0xe')]===_0xed48('0x28')){_0xde2856[_0xed48('0x29')]=this[_0xed48('0x2a')]['id'];}else{_0xde2856[_[_0xed48('0x2b')](this[_0xed48('0xe')])+_0xed48('0x2c')]=this[_0xed48('0x2a')]['id'];}_0xde2856[_[_0xed48('0x2b')](this['channel'])+_0xed48('0x2d')]=this[_0xed48('0x16')]['id'];var _0x232830=this[_0xed48('0x16')];if(rpc[this[_0xed48('0xe')]+_0xed48('0x2e')]){if(this[_0xed48('0xe')]===_0xed48('0xf')){_0xde2856[_0xed48('0x2f')]=this[_0xed48('0x21')][_0xed48('0x30')];_0xde2856[_0xed48('0x31')]=_0xed48('0x32')+_[_0xed48('0x33')](_0xde2856['body'],_0xed48('0x34'),_0xed48('0x35'))+_0xed48('0x36');_0xde2856[_0xed48('0x37')]={'Auto-Submitted':'auto-replied','X-Auto-Response-Suppress':_0xed48('0x38'),'Precedence':_0xed48('0x39')};return mailRpc['sendMailMessage'](this[_0xed48('0x2a')][_0xed48('0x3a')],_0xde2856)[_0xed48('0x3b')](function(_0x34acd2){logger[_0xed48('0x12')](_0xed48('0x3c'),_0x3c40da);_0xde2856[_0xed48('0x30')]=_0x34acd2[_0xed48('0x21')][_0xed48('0x30')];return rpc[_0x309441+_0xed48('0x2e')][_0xed48('0x3d')](_0xde2856);})['then'](function(_0x33ce35){logger[_0xed48('0x12')](_0xed48('0x3e'),_0x3c40da,JSON[_0xed48('0x3f')](_0x33ce35));})[_0xed48('0x40')](function(_0x51857b){logger[_0xed48('0x41')](_0xed48('0x42'),_0x3c40da,JSON[_0xed48('0x3f')](_0x51857b));})[_0xed48('0x43')](function(){Promise['resolve']()[_0xed48('0x3b')](function(){if(_0x5d54cc[0x0]!=='2'||_0x232830['autoreplyExecuted'])return;return rpc[_0x309441+'Interaction'][_0xed48('0x44')](_0x232830['id'],{'autoreplyExecuted':!![]})[_0xed48('0x3b')](function(_0x51793d){logger['info'](_0xed48('0x1a'),_0x3c40da,JSON['stringify'](_0x51793d));})['catch'](function(_0x36dd35){logger[_0xed48('0x41')](_0xed48('0x45'),_0x3c40da,JSON[_0xed48('0x3f')](_0x36dd35));});})['then'](function(){_0x5d148e[_0xed48('0x14')]();});});}else{return rpc[this['channel']+_0xed48('0x2e')][_0xed48('0x3d')](_0xde2856)[_0xed48('0x3b')](function(){logger[_0xed48('0x12')](_0xed48('0x3e'),_0x3c40da,_0xde2856[_0xed48('0x10')]);})[_0xed48('0x40')](function(_0x1ebe0d){logger['error'](_0xed48('0x3e'),_0x3c40da,JSON[_0xed48('0x3f')](_0x1ebe0d));})[_0xed48('0x43')](function(){Promise[_0xed48('0x46')]()[_0xed48('0x3b')](function(){if(_0x5d54cc[0x0]!=='2'||_0x232830['autoreplyExecuted'])return;return rpc[_0x309441+_0xed48('0x47')][_0xed48('0x44')](_0x232830['id'],{'autoreplyExecuted':!![]})['then'](function(_0x3d955f){logger['info'](_0xed48('0x1a'),_0x3c40da,JSON[_0xed48('0x3f')](_0x3d955f));})[_0xed48('0x40')](function(_0xe27ea6){logger['error']('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x3c40da,JSON[_0xed48('0x3f')](_0xe27ea6));});})[_0xed48('0x3b')](function(){_0x5d148e[_0xed48('0x14')]();});});}}}catch(_0x189432){logger[_0xed48('0x41')]('[%s][AUTOREPLY]\x20%s',_0x3c40da,JSON[_0xed48('0x3f')](_0x189432));_0x5d148e[_0xed48('0x48')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/close.js b/server/services/routing/server/applications/close.js index 9812887..84b8c09 100644 --- a/server/services/routing/server/applications/close.js +++ b/server/services/routing/server/applications/close.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x45d5=['moment','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','YYYY-MM-DD\x20HH:mm:ss','channel','Interaction','interaction','then','info','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','stringify','finally','error','[%s][CLOSE]\x20%s'];(function(_0x5a20b8,_0x524d84){var _0x18cca4=function(_0x3b1d8e){while(--_0x3b1d8e){_0x5a20b8['push'](_0x5a20b8['shift']());}};_0x18cca4(++_0x524d84);}(_0x45d5,0xab));var _0x545d=function(_0x49bf1a,_0x1f6856){_0x49bf1a=_0x49bf1a-0x0;var _0x23162a=_0x45d5[_0x49bf1a];return _0x23162a;};'use strict';var moment=require(_0x545d('0x0'));var logger=require('../../../../config/logger')(_0x545d('0x1'));var rpc={'chatInteraction':require(_0x545d('0x2')),'openchannelInteraction':require(_0x545d('0x3')),'smsInteraction':require(_0x545d('0x4')),'mailInteraction':require(_0x545d('0x5')),'faxInteraction':require(_0x545d('0x6')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};exports['consequence']=function(_0x4f5bc8,_0x5ccdae,_0x19007b,_0x68f8fc){return function(_0x422f37){try{logger['info']('[%s][CLOSE]\x20reason\x20%s',_0x4f5bc8,_0x5ccdae[0x0]);var _0x2d540f={'closed':0x1,'closedAt':moment()['format'](_0x545d('0x7')),'closeReason':'system','disposition':_0x5ccdae[0x0]};if(rpc[_0x68f8fc[_0x545d('0x8')]+_0x545d('0x9')]){rpc[_0x68f8fc[_0x545d('0x8')]+'Interaction']['update'](_0x68f8fc[_0x545d('0xa')]['id'],_0x2d540f)[_0x545d('0xb')](function(_0x35fe9e){logger[_0x545d('0xc')](_0x545d('0xd'),_0x4f5bc8,_0x68f8fc[_0x545d('0xa')]['id']);})[_0x545d('0xe')](function(_0xae0bf0){logger['error']('[%s][CLOSE]\x20%s',_0x4f5bc8,JSON[_0x545d('0xf')](_0xae0bf0));})[_0x545d('0x10')](function(){_0x422f37['stop']();});}}catch(_0x9d9d81){logger[_0x545d('0x11')](_0x545d('0x12'),_0x4f5bc8,JSON['stringify'](_0x9d9d81));_0x422f37['stop']();}};}; \ No newline at end of file +var _0xebd1=['../../rpc/openchannelInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','interaction','info','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','stringify','finally','stop','moment','../../../../config/logger','routing','../../rpc/chatInteraction'];(function(_0x44cfab,_0xf35628){var _0x2fd092=function(_0x10ba6c){while(--_0x10ba6c){_0x44cfab['push'](_0x44cfab['shift']());}};_0x2fd092(++_0xf35628);}(_0xebd1,0x1ac));var _0x1ebd=function(_0x42bc91,_0x41f40a){_0x42bc91=_0x42bc91-0x0;var _0x3f5507=_0xebd1[_0x42bc91];return _0x3f5507;};'use strict';var moment=require(_0x1ebd('0x0'));var logger=require(_0x1ebd('0x1'))(_0x1ebd('0x2'));var rpc={'chatInteraction':require(_0x1ebd('0x3')),'openchannelInteraction':require(_0x1ebd('0x4')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0x1ebd('0x5')),'whatsappInteraction':require(_0x1ebd('0x6'))};exports[_0x1ebd('0x7')]=function(_0x3579c2,_0x127871,_0x1a8bbb,_0x44daab){return function(_0x1999c1){try{logger['info'](_0x1ebd('0x8'),_0x3579c2,_0x127871[0x0]);var _0x1e832b={'closed':0x1,'closedAt':moment()[_0x1ebd('0x9')](_0x1ebd('0xa')),'closeReason':_0x1ebd('0xb'),'disposition':_0x127871[0x0]};if(rpc[_0x44daab[_0x1ebd('0xc')]+_0x1ebd('0xd')]){rpc[_0x44daab[_0x1ebd('0xc')]+_0x1ebd('0xd')][_0x1ebd('0xe')](_0x44daab[_0x1ebd('0xf')]['id'],_0x1e832b)['then'](function(_0x3ae062){logger[_0x1ebd('0x10')](_0x1ebd('0x11'),_0x3579c2,_0x44daab[_0x1ebd('0xf')]['id']);})[_0x1ebd('0x12')](function(_0x495d45){logger[_0x1ebd('0x13')](_0x1ebd('0x14'),_0x3579c2,JSON[_0x1ebd('0x15')](_0x495d45));})[_0x1ebd('0x16')](function(){_0x1999c1[_0x1ebd('0x17')]();});}}catch(_0x5c8ed8){logger[_0x1ebd('0x13')](_0x1ebd('0x14'),_0x3579c2,JSON[_0x1ebd('0x15')](_0x5c8ed8));_0x1999c1['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflow.js b/server/services/routing/server/applications/dialogflow.js index 999d9cc..8dcc6f1 100644 --- a/server/services/routing/server/applications/dialogflow.js +++ b/server/services/routing/server/applications/dialogflow.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x855f=['YYYY-MM-DD\x20HH:mm:ss','channel','sms','phone','chat','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','isEmpty','body','getMustacheRender','create','then','catch','error','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','result','speech','providerName','dialogflow','providerResponse','metadata','endConversation','message','lodash','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format'];(function(_0x1c64d2,_0x4448b7){var _0x308680=function(_0x3d17ae){while(--_0x3d17ae){_0x1c64d2['push'](_0x1c64d2['shift']());}};_0x308680(++_0x4448b7);}(_0x855f,0x145));var _0xf855=function(_0x3190eb,_0xad367e){_0x3190eb=_0x3190eb-0x0;var _0x59de8d=_0x855f[_0x3190eb];return _0x59de8d;};'use strict';var _=require(_0xf855('0x0'));var moment=require('moment');var apiai=require(_0xf855('0x1'));var md5=require(_0xf855('0x2'));var utils=require(_0xf855('0x3'));var logger=require(_0xf855('0x4'))(_0xf855('0x5'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xf855('0x6')),'mailMessage':require(_0xf855('0x7')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xf855('0x8'))};exports[_0xf855('0x9')]=function(_0x41e1ac,_0x35cc05){return function(_0xe6470d){try{if(!_[_0xf855('0xa')](this[_0xf855('0xb')]['UserId'])){logger[_0xf855('0xc')](_0xf855('0xd'),_0x41e1ac,_0xf855('0xe'));return _0xe6470d[_0xf855('0xf')]();}var _0x88e71b={'ContactId':this[_0xf855('0x10')]['id'],'sentAt':moment()[_0xf855('0x11')](_0xf855('0x12')),'direction':'out'};if(this[_0xf855('0x13')]===_0xf855('0x14')||this[_0xf855('0x13')]==='whatsapp'){_0x88e71b[_0xf855('0x15')]=this[_0xf855('0xb')][_0xf855('0x15')];}var _0xc44fdb=this[_0xf855('0x13')];if(_0xc44fdb===_0xf855('0x16')){_0x88e71b[_0xf855('0x17')]=this['account']['id'];}else{_0x88e71b[_[_0xf855('0x18')](_0xc44fdb)+_0xf855('0x19')]=this[_0xf855('0x1a')]['id'];}_0x88e71b[_[_0xf855('0x18')](_0xc44fdb)+_0xf855('0x1b')]=this[_0xf855('0xb')]['id'];if(this[_0xf855('0xb')]['created']){var _0x5e7439=_0x35cc05[0x2];if(!_[_0xf855('0x1c')](_0x5e7439)){_0x88e71b[_0xf855('0x1d')]=utils[_0xf855('0x1e')](_0x5e7439,this);return rpc[_0xc44fdb+'Message'][_0xf855('0x1f')](_0x88e71b)[_0xf855('0x20')](function(_0x56438d){logger['info'](_0xf855('0xd'),_0x41e1ac,_0x88e71b[_0xf855('0x1d')]);})[_0xf855('0x21')](function(_0xd3e22f){logger[_0xf855('0x22')](_0xf855('0xd'),_0x41e1ac,JSON[_0xf855('0x23')](_0xd3e22f));})[_0xf855('0x24')](function(){logger[_0xf855('0xc')](_0xf855('0x25'),_0x41e1ac);_0xe6470d[_0xf855('0x26')]();});}else{logger[_0xf855('0xc')](_0xf855('0x27'),_0x41e1ac);_0xe6470d['stop']();}}else{var _0x343712=this;var _0x247345=apiai(_0x35cc05[0x0],{'language':_0x35cc05[0x1]||'en'});return _0x247345[_0xf855('0x28')](this['message'][_0xf855('0x1d')],{'sessionId':md5(this['interaction']['id'])})[_0xf855('0x20')](function(_0xffd637){_0x343712[_0xf855('0x1d')]['dialogflow']=_0xffd637;_0x88e71b[_0xf855('0x1d')]=_0xffd637[_0xf855('0x29')]['fulfillment'][_0xf855('0x2a')];_0x88e71b[_0xf855('0x2b')]=_0xf855('0x2c');_0x88e71b[_0xf855('0x2d')]=JSON[_0xf855('0x23')](_0xffd637);return rpc[_0xc44fdb+'Message']['create'](_0x88e71b)[_0xf855('0x20')](function(_0x482ae){logger['info'](_0xf855('0xd'),_0x41e1ac,_0x88e71b[_0xf855('0x1d')]);if(_0xffd637[_0xf855('0x29')][_0xf855('0x2e')][_0xf855('0x2f')]){_0xe6470d[_0xf855('0xf')]();}else{_0xe6470d[_0xf855('0x26')]();}})[_0xf855('0x21')](function(_0x8b8416){logger[_0xf855('0x22')](_0xf855('0xd'),_0x41e1ac,JSON['stringify'](_0x8b8416));_0xe6470d[_0xf855('0xf')]();});})['catch'](function(_0x515e32){logger['error'](_0xf855('0xd'),_0x41e1ac,_0x515e32[_0xf855('0x30')]);_0xe6470d[_0xf855('0xf')]();});}}catch(_0x2791ca){logger['error'](_0xf855('0xd'),_0x41e1ac,JSON[_0xf855('0x23')](_0x2791ca));_0xe6470d[_0xf855('0x26')]();}};}; \ No newline at end of file +var _0x74f3=['stringify','then','result','metadata','endConversation','error','lodash','moment','apiai-promise','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','YYYY-MM-DD\x20HH:mm:ss','out','sms','channel','whatsapp','phone','chat','account','AccountId','upperFirst','InteractionId','created','isEmpty','body','getMustacheRender','Message','create','info','catch','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','textRequest','message','dialogflow','fulfillment'];(function(_0x2876fc,_0x49813f){var _0x30ba9b=function(_0x14c2b8){while(--_0x14c2b8){_0x2876fc['push'](_0x2876fc['shift']());}};_0x30ba9b(++_0x49813f);}(_0x74f3,0x164));var _0x374f=function(_0x52221d,_0x134f58){_0x52221d=_0x52221d-0x0;var _0x1a5530=_0x74f3[_0x52221d];return _0x1a5530;};'use strict';var _=require(_0x374f('0x0'));var moment=require(_0x374f('0x1'));var apiai=require(_0x374f('0x2'));var md5=require('md5');var utils=require(_0x374f('0x3'));var logger=require(_0x374f('0x4'))(_0x374f('0x5'));var rpc={'chatMessage':require(_0x374f('0x6')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x374f('0x7')),'smsMessage':require(_0x374f('0x8')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x374f('0x9'))};exports[_0x374f('0xa')]=function(_0x405e93,_0x407df1){return function(_0x3bcc86){try{if(!_[_0x374f('0xb')](this[_0x374f('0xc')][_0x374f('0xd')])){logger['info'](_0x374f('0xe'),_0x405e93,_0x374f('0xf'));return _0x3bcc86[_0x374f('0x10')]();}var _0x272059={'ContactId':this[_0x374f('0x11')]['id'],'sentAt':moment()['format'](_0x374f('0x12')),'direction':_0x374f('0x13')};if(this['channel']===_0x374f('0x14')||this[_0x374f('0x15')]===_0x374f('0x16')){_0x272059['phone']=this[_0x374f('0xc')][_0x374f('0x17')];}var _0x579d1b=this[_0x374f('0x15')];if(_0x579d1b===_0x374f('0x18')){_0x272059['ChatWebsiteId']=this[_0x374f('0x19')]['id'];}else{_0x272059[_['upperFirst'](_0x579d1b)+_0x374f('0x1a')]=this[_0x374f('0x19')]['id'];}_0x272059[_[_0x374f('0x1b')](_0x579d1b)+_0x374f('0x1c')]=this[_0x374f('0xc')]['id'];if(this[_0x374f('0xc')][_0x374f('0x1d')]){var _0x9b6be5=_0x407df1[0x2];if(!_[_0x374f('0x1e')](_0x9b6be5)){_0x272059[_0x374f('0x1f')]=utils[_0x374f('0x20')](_0x9b6be5,this);return rpc[_0x579d1b+_0x374f('0x21')][_0x374f('0x22')](_0x272059)['then'](function(_0x55eb4f){logger[_0x374f('0x23')]('[%s][DIALOGFLOW]\x20%s',_0x405e93,_0x272059[_0x374f('0x1f')]);})[_0x374f('0x24')](function(_0x1fd21f){logger['error'](_0x374f('0xe'),_0x405e93,JSON['stringify'](_0x1fd21f));})[_0x374f('0x25')](function(){logger[_0x374f('0x23')](_0x374f('0x26'),_0x405e93);_0x3bcc86['stop']();});}else{logger[_0x374f('0x23')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x405e93);_0x3bcc86[_0x374f('0x27')]();}}else{var _0x27b9ae=this;var _0x2de93d=apiai(_0x407df1[0x0],{'language':_0x407df1[0x1]||'en'});return _0x2de93d[_0x374f('0x28')](this[_0x374f('0x29')][_0x374f('0x1f')],{'sessionId':md5(this['interaction']['id'])})['then'](function(_0x1146a3){_0x27b9ae[_0x374f('0x1f')][_0x374f('0x2a')]=_0x1146a3;_0x272059['body']=_0x1146a3['result'][_0x374f('0x2b')]['speech'];_0x272059['providerName']='dialogflow';_0x272059['providerResponse']=JSON[_0x374f('0x2c')](_0x1146a3);return rpc[_0x579d1b+_0x374f('0x21')]['create'](_0x272059)[_0x374f('0x2d')](function(_0xc69c14){logger[_0x374f('0x23')](_0x374f('0xe'),_0x405e93,_0x272059['body']);if(_0x1146a3[_0x374f('0x2e')][_0x374f('0x2f')][_0x374f('0x30')]){_0x3bcc86[_0x374f('0x10')]();}else{_0x3bcc86[_0x374f('0x27')]();}})[_0x374f('0x24')](function(_0x113177){logger[_0x374f('0x31')](_0x374f('0xe'),_0x405e93,JSON[_0x374f('0x2c')](_0x113177));_0x3bcc86[_0x374f('0x10')]();});})[_0x374f('0x24')](function(_0x5614a0){logger[_0x374f('0x31')](_0x374f('0xe'),_0x405e93,_0x5614a0['message']);_0x3bcc86[_0x374f('0x10')]();});}}catch(_0x4e36e7){logger[_0x374f('0x31')](_0x374f('0xe'),_0x405e93,JSON['stringify'](_0x4e36e7));_0x3bcc86[_0x374f('0x27')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflowV2.js b/server/services/routing/server/applications/dialogflowV2.js index 992488c..2f0d5c6 100644 --- a/server/services/routing/server/applications/dialogflowV2.js +++ b/server/services/routing/server/applications/dialogflowV2.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8712=['ChatWebsiteId','upperFirst','account','InteractionId','created','isEmpty','getMustacheRender','error','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','sessionPath','message','detectIntent','length','diagnosticInfo','queryResult','fields','end_conversation','boolValue','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','DIALOGFLOWV2_ENDCONVERSATION','name','DIALOGFLOWV2_INTENTDISPLAYNAME','intent','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','dialogflowV2','providerResponse','fulfillmentText','push','all','stack','lodash','moment','bluebird','../../../../config/logger','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','body','Message','create','then','info','catch','[%s][DIALOGFLOWV2]\x20%s','stringify','consequence','isNil','interaction','UserId','next','contact','format','out','channel','phone','chat'];(function(_0x210e22,_0x466f33){var _0x13b847=function(_0x1b2611){while(--_0x1b2611){_0x210e22['push'](_0x210e22['shift']());}};_0x13b847(++_0x466f33);}(_0x8712,0xf3));var _0x2871=function(_0x589081,_0x54d794){_0x589081=_0x589081-0x0;var _0x4b7e8c=_0x8712[_0x589081];return _0x4b7e8c;};'use strict';var _=require(_0x2871('0x0'));var dialogflow=require('dialogflow');var md5=require('md5');var moment=require(_0x2871('0x1'));var Promise=require(_0x2871('0x2'));var logger=require(_0x2871('0x3'))('routing');var utils=require(_0x2871('0x4'));var rpc={'chatMessage':require(_0x2871('0x5')),'openchannelMessage':require(_0x2871('0x6')),'mailMessage':require(_0x2871('0x7')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x2871('0x8')),'whatsappMessage':require(_0x2871('0x9'))};function createMessage(_0x4456d7,_0x32aba9,_0x110e4b,_0x134d5b){return new Promise(function(_0x4ad623,_0x3d4477){var _0x26734c=_['clone'](_0x110e4b);_0x26734c[_0x2871('0xa')]=_0x134d5b;return rpc[_0x32aba9+_0x2871('0xb')][_0x2871('0xc')](_0x26734c)[_0x2871('0xd')](function(){logger[_0x2871('0xe')]('[%s][DIALOGFLOWV2]\x20%s',_0x4456d7,_0x26734c[_0x2871('0xa')]);_0x4ad623();})[_0x2871('0xf')](function(_0x4c510b){logger['error'](_0x2871('0x10'),_0x4456d7,JSON[_0x2871('0x11')](_0x4c510b));_0x3d4477(_0x4c510b);});});}exports[_0x2871('0x12')]=function(_0x493ed8,_0x5bede3){return function(_0xb777aa){try{if(!_[_0x2871('0x13')](this[_0x2871('0x14')][_0x2871('0x15')])){logger['info']('[%s][DIALOGFLOWV2]\x20%s',_0x493ed8,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0xb777aa[_0x2871('0x16')]();}var _0x3f0dbb={'ContactId':this[_0x2871('0x17')]['id'],'sentAt':moment()[_0x2871('0x18')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x2871('0x19')};if(this[_0x2871('0x1a')]==='sms'||this[_0x2871('0x1a')]==='whatsapp'){_0x3f0dbb[_0x2871('0x1b')]=this['interaction'][_0x2871('0x1b')];}var _0x36cc12=this[_0x2871('0x1a')];if(_0x36cc12===_0x2871('0x1c')){_0x3f0dbb[_0x2871('0x1d')]=this['account']['id'];}else{_0x3f0dbb[_[_0x2871('0x1e')](_0x36cc12)+'AccountId']=this[_0x2871('0x1f')]['id'];}_0x3f0dbb[_[_0x2871('0x1e')](_0x36cc12)+_0x2871('0x20')]=this['interaction']['id'];if(this['interaction'][_0x2871('0x21')]){var _0x54dd1f=_0x5bede3[0x4];if(!_[_0x2871('0x22')](_0x54dd1f)){_0x3f0dbb['body']=utils[_0x2871('0x23')](_0x54dd1f,this);return rpc[_0x36cc12+_0x2871('0xb')]['create'](_0x3f0dbb)['then'](function(_0x42e892){logger['info'](_0x2871('0x10'),_0x493ed8,_0x3f0dbb[_0x2871('0xa')]);})[_0x2871('0xf')](function(_0x82bfa2){logger[_0x2871('0x24')]('[%s][DIALOGFLOWV2]\x20%s',_0x493ed8,JSON['stringify'](_0x82bfa2));})['finally'](function(){logger['info'](_0x2871('0x25'),_0x493ed8);_0xb777aa['stop']();});}else{logger[_0x2871('0xe')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x493ed8);_0xb777aa['stop']();}}else{var _0x1522a9=this;var _0x558893=_0x5bede3[0x2]['replace'](/\\n/g,'\x0a');var _0x153eb7={'credentials':{'private_key':_0x558893,'client_email':_0x5bede3[0x1]}};var _0x55cb2f=new dialogflow['SessionsClient'](_0x153eb7);var _0x3f7d96=_0x55cb2f[_0x2871('0x26')](_0x5bede3[0x0],md5(_0x1522a9[_0x2871('0x14')]['id']));var _0x48da72={'session':_0x3f7d96,'queryInput':{'text':{'text':_0x1522a9[_0x2871('0x27')]['body'],'languageCode':_0x5bede3[0x3]||'en'}}};return _0x55cb2f[_0x2871('0x28')](_0x48da72)[_0x2871('0xd')](function(_0x420942){if(_0x420942&&_0x420942[_0x2871('0x29')]){_0x1522a9[_0x2871('0xa')]['dialogflowV2']=_0x420942;var _0x5ec693=_0x420942[0x0];var _0x884e32=_0x5ec693['queryResult'][_0x2871('0x2a')]&&_0x5ec693[_0x2871('0x2b')][_0x2871('0x2a')][_0x2871('0x2c')]?_0x5ec693['queryResult'][_0x2871('0x2a')][_0x2871('0x2c')][_0x2871('0x2d')][_0x2871('0x2e')]:![];_0x1522a9[_0x2871('0xa')]['DIALOGFLOWV2_ACTION']=_0x5ec693[_0x2871('0x2b')][_0x2871('0x2f')];_0x1522a9['body'][_0x2871('0x30')]=_0x5ec693[_0x2871('0x2b')]['allRequiredParamsPresent'];_0x1522a9['body'][_0x2871('0x31')]=_0x5ec693[_0x2871('0x2b')][_0x2871('0x2a')]&&_0x5ec693[_0x2871('0x2b')][_0x2871('0x2a')][_0x2871('0x2c')]?_0x5ec693[_0x2871('0x2b')][_0x2871('0x2a')][_0x2871('0x2c')][_0x2871('0x2d')]['boolValue']:![];_0x1522a9[_0x2871('0xa')]['DIALOGFLOWV2_INTENTNAME']=_0x5ec693[_0x2871('0x2b')]['intent'][_0x2871('0x32')];_0x1522a9['body'][_0x2871('0x33')]=_0x5ec693[_0x2871('0x2b')][_0x2871('0x34')]['displayName'];_0x1522a9[_0x2871('0xa')][_0x2871('0x35')]=_0x5ec693[_0x2871('0x2b')][_0x2871('0x34')][_0x2871('0x36')];_0x1522a9[_0x2871('0xa')][_0x2871('0x37')]=_0x5ec693[_0x2871('0x2b')][_0x2871('0x38')];_0x1522a9[_0x2871('0xa')][_0x2871('0x39')]=_0x5ec693[_0x2871('0x2b')][_0x2871('0x3a')];_0x1522a9[_0x2871('0xa')][_0x2871('0x3b')]=_0x5ec693[_0x2871('0x2b')][_0x2871('0x3c')];_0x3f0dbb[_0x2871('0x3d')]=_0x2871('0x3e');_0x3f0dbb[_0x2871('0x3f')]=JSON[_0x2871('0x11')](_0x420942);var _0x1e7745=[];for(var _0x1d259c=0x0;_0x1d259c<_0x420942[_0x2871('0x29')];_0x1d259c++){var _0x5afadf=_0x420942[_0x1d259c];if(_0x5afadf&&_0x5afadf[_0x2871('0x2b')]&&_0x5afadf['queryResult'][_0x2871('0x40')]){_0x1e7745[_0x2871('0x41')](createMessage(_0x493ed8,_0x36cc12,_0x3f0dbb,_0x5afadf[_0x2871('0x2b')]['fulfillmentText']));}}return Promise[_0x2871('0x42')](_0x1e7745)[_0x2871('0xd')](function(){if(_0x884e32){_0xb777aa[_0x2871('0x16')]();}else{_0xb777aa['stop']();}})[_0x2871('0xf')](function(_0x1e82b3){logger[_0x2871('0x24')]('[%s][DIALOGFLOWV2]\x20%s',_0x493ed8,JSON['stringify'](_0x1e82b3));_0xb777aa[_0x2871('0x16')]();});}})[_0x2871('0xf')](function(_0x214cff){logger[_0x2871('0x24')]('[%s][DIALOGFLOWV2]\x20%s',_0x493ed8,_0x214cff[_0x2871('0x27')],_0x214cff[_0x2871('0x43')]);_0xb777aa[_0x2871('0x16')]();});}}catch(_0x4b3b29){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x493ed8,JSON[_0x2871('0x11')](_0x4b3b29));_0xb777aa['stop']();}};}; \ No newline at end of file +var _0x803f=['AccountId','InteractionId','created','isEmpty','create','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','replace','length','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','boolValue','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','providerResponse','fulfillmentText','push','all','stack','lodash','moment','bluebird','../../../../config/logger','routing','./utils','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','clone','Message','then','info','[%s][DIALOGFLOWV2]\x20%s','body','catch','error','stringify','consequence','isNil','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','sms','channel','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst'];(function(_0xbeddf6,_0x5205b8){var _0x276b45=function(_0x4d9b31){while(--_0x4d9b31){_0xbeddf6['push'](_0xbeddf6['shift']());}};_0x276b45(++_0x5205b8);}(_0x803f,0x6e));var _0xf803=function(_0x3e94e1,_0x44208a){_0x3e94e1=_0x3e94e1-0x0;var _0x14e79d=_0x803f[_0x3e94e1];return _0x14e79d;};'use strict';var _=require(_0xf803('0x0'));var dialogflow=require('dialogflow');var md5=require('md5');var moment=require(_0xf803('0x1'));var Promise=require(_0xf803('0x2'));var logger=require(_0xf803('0x3'))(_0xf803('0x4'));var utils=require(_0xf803('0x5'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xf803('0x6')),'mailMessage':require(_0xf803('0x7')),'smsMessage':require(_0xf803('0x8')),'faxMessage':require(_0xf803('0x9')),'whatsappMessage':require('../../rpc/whatsappMessage')};function createMessage(_0x1b7ee1,_0x54e875,_0x288805,_0x131264){return new Promise(function(_0x3d9a3c,_0x53f29a){var _0x1b4ec5=_[_0xf803('0xa')](_0x288805);_0x1b4ec5['body']=_0x131264;return rpc[_0x54e875+_0xf803('0xb')]['create'](_0x1b4ec5)[_0xf803('0xc')](function(){logger[_0xf803('0xd')](_0xf803('0xe'),_0x1b7ee1,_0x1b4ec5[_0xf803('0xf')]);_0x3d9a3c();})[_0xf803('0x10')](function(_0x1c1172){logger[_0xf803('0x11')](_0xf803('0xe'),_0x1b7ee1,JSON[_0xf803('0x12')](_0x1c1172));_0x53f29a(_0x1c1172);});});}exports[_0xf803('0x13')]=function(_0x2047d5,_0x481e79){return function(_0x1c669f){try{if(!_[_0xf803('0x14')](this[_0xf803('0x15')][_0xf803('0x16')])){logger[_0xf803('0xd')](_0xf803('0xe'),_0x2047d5,_0xf803('0x17'));return _0x1c669f[_0xf803('0x18')]();}var _0x143602={'ContactId':this[_0xf803('0x19')]['id'],'sentAt':moment()[_0xf803('0x1a')](_0xf803('0x1b')),'direction':'out'};if(this['channel']===_0xf803('0x1c')||this[_0xf803('0x1d')]===_0xf803('0x1e')){_0x143602[_0xf803('0x1f')]=this['interaction'][_0xf803('0x1f')];}var _0xafbb2b=this[_0xf803('0x1d')];if(_0xafbb2b===_0xf803('0x20')){_0x143602[_0xf803('0x21')]=this[_0xf803('0x22')]['id'];}else{_0x143602[_[_0xf803('0x23')](_0xafbb2b)+_0xf803('0x24')]=this[_0xf803('0x22')]['id'];}_0x143602[_[_0xf803('0x23')](_0xafbb2b)+_0xf803('0x25')]=this[_0xf803('0x15')]['id'];if(this[_0xf803('0x15')][_0xf803('0x26')]){var _0x149c1c=_0x481e79[0x4];if(!_[_0xf803('0x27')](_0x149c1c)){_0x143602[_0xf803('0xf')]=utils['getMustacheRender'](_0x149c1c,this);return rpc[_0xafbb2b+_0xf803('0xb')][_0xf803('0x28')](_0x143602)[_0xf803('0xc')](function(_0x3b5efd){logger[_0xf803('0xd')]('[%s][DIALOGFLOWV2]\x20%s',_0x2047d5,_0x143602['body']);})[_0xf803('0x10')](function(_0x3b1f3c){logger[_0xf803('0x11')](_0xf803('0xe'),_0x2047d5,JSON[_0xf803('0x12')](_0x3b1f3c));})[_0xf803('0x29')](function(){logger[_0xf803('0xd')](_0xf803('0x2a'),_0x2047d5);_0x1c669f[_0xf803('0x2b')]();});}else{logger[_0xf803('0xd')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x2047d5);_0x1c669f[_0xf803('0x2b')]();}}else{var _0x4e81f9=this;var _0x3b82ae=_0x481e79[0x2][_0xf803('0x2c')](/\\n/g,'\x0a');var _0x2614c5={'credentials':{'private_key':_0x3b82ae,'client_email':_0x481e79[0x1]}};var _0x495f91=new dialogflow['SessionsClient'](_0x2614c5);var _0x442a54=_0x495f91['sessionPath'](_0x481e79[0x0],md5(_0x4e81f9[_0xf803('0x15')]['id']));var _0x260149={'session':_0x442a54,'queryInput':{'text':{'text':_0x4e81f9['message']['body'],'languageCode':_0x481e79[0x3]||'en'}}};return _0x495f91['detectIntent'](_0x260149)[_0xf803('0xc')](function(_0x58ad8e){if(_0x58ad8e&&_0x58ad8e[_0xf803('0x2d')]){_0x4e81f9[_0xf803('0xf')][_0xf803('0x2e')]=_0x58ad8e;var _0x18191a=_0x58ad8e[0x0];var _0x1fcb2f=_0x18191a[_0xf803('0x2f')][_0xf803('0x30')]&&_0x18191a[_0xf803('0x2f')]['diagnosticInfo'][_0xf803('0x31')]?_0x18191a[_0xf803('0x2f')][_0xf803('0x30')][_0xf803('0x31')][_0xf803('0x32')]['boolValue']:![];_0x4e81f9[_0xf803('0xf')]['DIALOGFLOWV2_ACTION']=_0x18191a[_0xf803('0x2f')][_0xf803('0x33')];_0x4e81f9['body'][_0xf803('0x34')]=_0x18191a[_0xf803('0x2f')]['allRequiredParamsPresent'];_0x4e81f9[_0xf803('0xf')]['DIALOGFLOWV2_ENDCONVERSATION']=_0x18191a[_0xf803('0x2f')][_0xf803('0x30')]&&_0x18191a[_0xf803('0x2f')]['diagnosticInfo'][_0xf803('0x31')]?_0x18191a[_0xf803('0x2f')]['diagnosticInfo'][_0xf803('0x31')][_0xf803('0x32')][_0xf803('0x35')]:![];_0x4e81f9['body'][_0xf803('0x36')]=_0x18191a[_0xf803('0x2f')][_0xf803('0x37')][_0xf803('0x38')];_0x4e81f9[_0xf803('0xf')][_0xf803('0x39')]=_0x18191a[_0xf803('0x2f')][_0xf803('0x37')][_0xf803('0x3a')];_0x4e81f9['body'][_0xf803('0x3b')]=_0x18191a[_0xf803('0x2f')][_0xf803('0x37')][_0xf803('0x3c')];_0x4e81f9[_0xf803('0xf')][_0xf803('0x3d')]=_0x18191a['queryResult'][_0xf803('0x3e')];_0x4e81f9['body'][_0xf803('0x3f')]=_0x18191a[_0xf803('0x2f')][_0xf803('0x40')];_0x4e81f9['body'][_0xf803('0x41')]=_0x18191a[_0xf803('0x2f')][_0xf803('0x42')];_0x143602[_0xf803('0x43')]=_0xf803('0x2e');_0x143602[_0xf803('0x44')]=JSON[_0xf803('0x12')](_0x58ad8e);var _0x487ab9=[];for(var _0x4e83f9=0x0;_0x4e83f9<_0x58ad8e['length'];_0x4e83f9++){var _0x28a9cc=_0x58ad8e[_0x4e83f9];if(_0x28a9cc&&_0x28a9cc['queryResult']&&_0x28a9cc[_0xf803('0x2f')][_0xf803('0x45')]){_0x487ab9[_0xf803('0x46')](createMessage(_0x2047d5,_0xafbb2b,_0x143602,_0x28a9cc[_0xf803('0x2f')][_0xf803('0x45')]));}}return Promise[_0xf803('0x47')](_0x487ab9)[_0xf803('0xc')](function(){if(_0x1fcb2f){_0x1c669f[_0xf803('0x18')]();}else{_0x1c669f[_0xf803('0x2b')]();}})[_0xf803('0x10')](function(_0x2546f5){logger[_0xf803('0x11')](_0xf803('0xe'),_0x2047d5,JSON[_0xf803('0x12')](_0x2546f5));_0x1c669f[_0xf803('0x18')]();});}})['catch'](function(_0x25ec8b){logger[_0xf803('0x11')](_0xf803('0xe'),_0x2047d5,_0x25ec8b['message'],_0x25ec8b[_0xf803('0x48')]);_0x1c669f['next']();});}}catch(_0x18010e){logger['error'](_0xf803('0xe'),_0x2047d5,JSON[_0xf803('0x12')](_0x18010e));_0x1c669f['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotoif.js b/server/services/routing/server/applications/gotoif.js index 0eb71db..3291ce9 100644 --- a/server/services/routing/server/applications/gotoif.js +++ b/server/services/routing/server/applications/gotoif.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x87a6=['lodash','html-to-text','./utils','../../../../config/logger','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','fromString','getMustacheRender','validate','[%s][GOTOIF]\x20%s','map','join','stop','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify'];(function(_0x91d914,_0x2ee495){var _0x5a5937=function(_0x240404){while(--_0x240404){_0x91d914['push'](_0x91d914['shift']());}};_0x5a5937(++_0x2ee495);}(_0x87a6,0x16c));var _0x687a=function(_0x190d80,_0x1c6163){_0x190d80=_0x190d80-0x0;var _0x208b88=_0x87a6[_0x190d80];return _0x208b88;};'use strict';var schema=require('validate');var _=require(_0x687a('0x0'));var htmlToText=require(_0x687a('0x1'));var utils=require(_0x687a('0x2'));var logger=require(_0x687a('0x3'))('routing');var gotoif=schema({'condition':{'type':_0x687a('0x4'),'required':!![],'message':_0x687a('0x5')},'priorityTrue':{'type':_0x687a('0x6'),'message':_0x687a('0x7')},'priorityFalse':{'type':_0x687a('0x6'),'message':_0x687a('0x8')}});exports['consequence']=function(_0x39d536,_0x405e0d){return function(_0x5f5dca){try{var _0x43d8ac={'condition':htmlToText[_0x687a('0x9')](utils[_0x687a('0xa')](_0x405e0d[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x405e0d[0x1],'priorityFalse':_0x405e0d[0x2]};var _0xe2b25a=gotoif[_0x687a('0xb')](_0x43d8ac,{'typecast':!![]});if(_0xe2b25a['length']){logger['error'](_0x687a('0xc'),_0x39d536,_[_0x687a('0xd')](_0xe2b25a,'message')[_0x687a('0xe')](',\x20'));_0x5f5dca[_0x687a('0xf')]();}else{try{var _0x2cb6d9=eval('('+_0x43d8ac[_0x687a('0x10')]+')');var _0x31c260=_0x2cb6d9?_0x43d8ac[_0x687a('0x11')]:_0x43d8ac[_0x687a('0x12')];logger[_0x687a('0x13')](_0x687a('0x14'),_0x39d536,_0x43d8ac[_0x687a('0x10')],_0x2cb6d9,_0x31c260||_0x687a('0x15'));if(_0x31c260){var _0x5d0654=_[_0x687a('0x16')](_0x5f5dca[_0x687a('0x17')](),{'p':_0x31c260});if(_0x5d0654>=0x0){logger[_0x687a('0x13')](_0x687a('0x18'),_0x39d536,_0x31c260||_0x687a('0x15'),_0x5d0654);_0x5f5dca['next'](_0x5d0654);}else{logger[_0x687a('0x13')](_0x687a('0x19'),_0x39d536,_0x31c260||_0x687a('0x15'));_0x5f5dca['stop']();}}else{_0x5f5dca[_0x687a('0x15')]();}}catch(_0x14b0a0){logger['error'](_0x687a('0x1a'),_0x39d536,_0x14b0a0['message']);_0x5f5dca[_0x687a('0xf')]();}}}catch(_0xf5a53a){logger['error'](_0x687a('0xc'),_0x39d536,JSON[_0x687a('0x1b')](_0xf5a53a));_0x5f5dca[_0x687a('0xf')]();}};}; \ No newline at end of file +var _0xa9a3=['getMustacheRender','length','error','map','message','condition','priorityTrue','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','stop','[%s][GOTOIF]\x20%s','stringify','lodash','html-to-text','./utils','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString'];(function(_0x294f3d,_0x1b0f82){var _0x2c8f6c=function(_0x2303e6){while(--_0x2303e6){_0x294f3d['push'](_0x294f3d['shift']());}};_0x2c8f6c(++_0x1b0f82);}(_0xa9a3,0xa4));var _0x3a9a=function(_0x6287b6,_0x5682e7){_0x6287b6=_0x6287b6-0x0;var _0x5d6be4=_0xa9a3[_0x6287b6];return _0x5d6be4;};'use strict';var schema=require('validate');var _=require(_0x3a9a('0x0'));var htmlToText=require(_0x3a9a('0x1'));var utils=require(_0x3a9a('0x2'));var logger=require('../../../../config/logger')(_0x3a9a('0x3'));var gotoif=schema({'condition':{'type':_0x3a9a('0x4'),'required':!![],'message':_0x3a9a('0x5')},'priorityTrue':{'type':_0x3a9a('0x6'),'message':_0x3a9a('0x7')},'priorityFalse':{'type':_0x3a9a('0x6'),'message':_0x3a9a('0x8')}});exports[_0x3a9a('0x9')]=function(_0x5fab25,_0x4eb7d5){return function(_0x241b2d){try{var _0x5f303a={'condition':htmlToText[_0x3a9a('0xa')](utils[_0x3a9a('0xb')](_0x4eb7d5[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x4eb7d5[0x1],'priorityFalse':_0x4eb7d5[0x2]};var _0x485946=gotoif['validate'](_0x5f303a,{'typecast':!![]});if(_0x485946[_0x3a9a('0xc')]){logger[_0x3a9a('0xd')]('[%s][GOTOIF]\x20%s',_0x5fab25,_[_0x3a9a('0xe')](_0x485946,_0x3a9a('0xf'))['join'](',\x20'));_0x241b2d['stop']();}else{try{var _0x40dbba=eval('('+_0x5f303a[_0x3a9a('0x10')]+')');var _0x108f31=_0x40dbba?_0x5f303a[_0x3a9a('0x11')]:_0x5f303a['priorityFalse'];logger[_0x3a9a('0x12')](_0x3a9a('0x13'),_0x5fab25,_0x5f303a['condition'],_0x40dbba,_0x108f31||_0x3a9a('0x14'));if(_0x108f31){var _0x4c2ec9=_['findIndex'](_0x241b2d['rules'](),{'p':_0x108f31});if(_0x4c2ec9>=0x0){logger[_0x3a9a('0x12')](_0x3a9a('0x15'),_0x5fab25,_0x108f31||_0x3a9a('0x14'),_0x4c2ec9);_0x241b2d[_0x3a9a('0x14')](_0x4c2ec9);}else{logger['info']('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x5fab25,_0x108f31||_0x3a9a('0x14'));_0x241b2d[_0x3a9a('0x16')]();}}else{_0x241b2d[_0x3a9a('0x14')]();}}catch(_0x468278){logger['error']('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x5fab25,_0x468278[_0x3a9a('0xf')]);_0x241b2d[_0x3a9a('0x16')]();}}}catch(_0x293394){logger[_0x3a9a('0xd')](_0x3a9a('0x17'),_0x5fab25,JSON[_0x3a9a('0x18')](_0x293394));_0x241b2d['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 bcb62e0..936af8a 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 _0xa4fd=['stop','[%s][GOTOP]\x20priority\x20%s','priority','rules','info','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','stringify','validate','lodash','../../../../config/logger','routing','number','consequence','length','error','[%s][GOTOP]\x20%s','map','join'];(function(_0xad1417,_0xafe6af){var _0x462da4=function(_0x5cf6c1){while(--_0x5cf6c1){_0xad1417['push'](_0xad1417['shift']());}};_0x462da4(++_0xafe6af);}(_0xa4fd,0x138));var _0xda4f=function(_0x363a5f,_0x191240){_0x363a5f=_0x363a5f-0x0;var _0x2293dc=_0xa4fd[_0x363a5f];return _0x2293dc;};'use strict';var schema=require(_0xda4f('0x0'));var _=require(_0xda4f('0x1'));var logger=require(_0xda4f('0x2'))(_0xda4f('0x3'));var gotop=schema({'priority':{'type':_0xda4f('0x4'),'required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports[_0xda4f('0x5')]=function(_0x113817,_0x582fc9){return function(_0x3489f2){try{var _0x563c1c={'priority':_0x582fc9[0x0]};var _0x338070=gotop[_0xda4f('0x0')](_0x563c1c,{'typecast':!![]});if(_0x338070[_0xda4f('0x6')]){logger[_0xda4f('0x7')](_0xda4f('0x8'),_0x113817,_[_0xda4f('0x9')](_0x338070,'message')[_0xda4f('0xa')](',\x20'));_0x3489f2[_0xda4f('0xb')]();}else{logger['info'](_0xda4f('0xc'),_0x113817,_0x563c1c[_0xda4f('0xd')]);if(_0x563c1c[_0xda4f('0xd')]){var _0x3d8746=_['findIndex'](_0x3489f2[_0xda4f('0xe')](),{'p':_0x563c1c[_0xda4f('0xd')]});if(_0x3d8746>=0x0){logger[_0xda4f('0xf')](_0xda4f('0x10'),_0x113817,_0x563c1c[_0xda4f('0xd')]||'next',_0x3d8746);_0x3489f2[_0xda4f('0x11')](_0x3d8746);}else{logger[_0xda4f('0xf')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x113817,_0x563c1c[_0xda4f('0xd')]||_0xda4f('0x11'));_0x3489f2[_0xda4f('0xb')]();}}else{_0x3489f2['next']();}}}catch(_0x5d6d32){logger[_0xda4f('0x7')](_0xda4f('0x8'),_0x113817,JSON[_0xda4f('0x12')](_0x5d6d32));_0x3489f2[_0xda4f('0xb')]();}};}; \ No newline at end of file +var _0x94be=['priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','error','[%s][GOTOP]\x20%s','map','message','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','stop','validate','lodash','../../../../config/logger','routing','number'];(function(_0x3248fa,_0x1cc456){var _0x4cc732=function(_0x1d6fe9){while(--_0x1d6fe9){_0x3248fa['push'](_0x3248fa['shift']());}};_0x4cc732(++_0x1cc456);}(_0x94be,0x19f));var _0xe94b=function(_0x4b71ea,_0x1bbebe){_0x4b71ea=_0x4b71ea-0x0;var _0x1df833=_0x94be[_0x4b71ea];return _0x1df833;};'use strict';var schema=require(_0xe94b('0x0'));var _=require(_0xe94b('0x1'));var logger=require(_0xe94b('0x2'))(_0xe94b('0x3'));var gotop=schema({'priority':{'type':_0xe94b('0x4'),'required':!![],'message':_0xe94b('0x5')}});exports[_0xe94b('0x6')]=function(_0x58523b,_0x20b6c9){return function(_0x3a29bf){try{var _0x31eb49={'priority':_0x20b6c9[0x0]};var _0x17e9fd=gotop[_0xe94b('0x0')](_0x31eb49,{'typecast':!![]});if(_0x17e9fd['length']){logger[_0xe94b('0x7')](_0xe94b('0x8'),_0x58523b,_[_0xe94b('0x9')](_0x17e9fd,_0xe94b('0xa'))['join'](',\x20'));_0x3a29bf['stop']();}else{logger[_0xe94b('0xb')](_0xe94b('0xc'),_0x58523b,_0x31eb49[_0xe94b('0xd')]);if(_0x31eb49[_0xe94b('0xd')]){var _0x5622a5=_[_0xe94b('0xe')](_0x3a29bf[_0xe94b('0xf')](),{'p':_0x31eb49[_0xe94b('0xd')]});if(_0x5622a5>=0x0){logger[_0xe94b('0xb')](_0xe94b('0x10'),_0x58523b,_0x31eb49['priority']||_0xe94b('0x11'),_0x5622a5);_0x3a29bf[_0xe94b('0x11')](_0x5622a5);}else{logger[_0xe94b('0xb')](_0xe94b('0x12'),_0x58523b,_0x31eb49[_0xe94b('0xd')]||'next');_0x3a29bf['stop']();}}else{_0x3a29bf[_0xe94b('0x11')]();}}}catch(_0x5a4058){logger[_0xe94b('0x7')](_0xe94b('0x8'),_0x58523b,JSON[_0xe94b('0x13')](_0x5a4058));_0x3a29bf[_0xe94b('0x14')]();}};}; \ 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 bb027ab..f97e752 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 _0x7355=['getMustacheRender','contact','channel','ChatWebsiteId','account','upperFirst','InteractionId','Message','create','then','info','[%s][MESSAGE]\x20%s','body','catch','error','stringify','lodash','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage'];(function(_0x9b3efc,_0x577a0d){var _0x200f05=function(_0x15ad7c){while(--_0x15ad7c){_0x9b3efc['push'](_0x9b3efc['shift']());}};_0x200f05(++_0x577a0d);}(_0x7355,0xa0));var _0x5735=function(_0x30a1bf,_0x3c53f5){_0x30a1bf=_0x30a1bf-0x0;var _0x338b5a=_0x7355[_0x30a1bf];return _0x338b5a;};'use strict';var _=require(_0x5735('0x0'));var utils=require(_0x5735('0x1'));var logger=require('../../../../config/logger')(_0x5735('0x2'));var rpc={'chatMessage':require(_0x5735('0x3')),'openchannelMessage':require(_0x5735('0x4')),'mailMessage':require(_0x5735('0x5')),'smsMessage':require(_0x5735('0x6')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x5735('0x7'))};exports['consequence']=function(_0x1c1fd7,_0x59cfd2){return function(_0x2ecb1){try{var _0x16d87a={'body':utils[_0x5735('0x8')](_0x59cfd2[0x0],this),'ContactId':this[_0x5735('0x9')]['id']};if(this[_0x5735('0xa')]==='chat'){_0x16d87a[_0x5735('0xb')]=this[_0x5735('0xc')]['id'];}else{_0x16d87a[_[_0x5735('0xd')](this[_0x5735('0xa')])+'AccountId']=this['account']['id'];}_0x16d87a[_[_0x5735('0xd')](this[_0x5735('0xa')])+_0x5735('0xe')]=this['interaction']['id'];if(rpc[this[_0x5735('0xa')]+'Message']){return rpc[this[_0x5735('0xa')]+_0x5735('0xf')][_0x5735('0x10')](_0x16d87a)[_0x5735('0x11')](function(_0x261dcf){logger[_0x5735('0x12')](_0x5735('0x13'),_0x1c1fd7,_0x16d87a[_0x5735('0x14')]);_0x2ecb1['next']();})[_0x5735('0x15')](function(_0x581491){logger[_0x5735('0x16')](_0x5735('0x13'),_0x1c1fd7,JSON['stringify'](_0x581491));_0x2ecb1['stop']();});}}catch(_0x1b31a5){logger[_0x5735('0x16')](_0x5735('0x13'),_0x1c1fd7,JSON[_0x5735('0x17')](_0x1b31a5));_0x2ecb1['stop']();}};}; \ No newline at end of file +var _0xa7b5=['Message','create','then','info','body','next','catch','[%s][MESSAGE]\x20%s','stringify','stop','lodash','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','channel','chat','ChatWebsiteId','account','upperFirst','InteractionId','interaction'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xa7b5,0x15a));var _0x5a7b=function(_0x504bb0,_0x2fd6b8){_0x504bb0=_0x504bb0-0x0;var _0x4a6b50=_0xa7b5[_0x504bb0];return _0x4a6b50;};'use strict';var _=require(_0x5a7b('0x0'));var utils=require('./utils');var logger=require(_0x5a7b('0x1'))('routing');var rpc={'chatMessage':require(_0x5a7b('0x2')),'openchannelMessage':require(_0x5a7b('0x3')),'mailMessage':require(_0x5a7b('0x4')),'smsMessage':require(_0x5a7b('0x5')),'faxMessage':require(_0x5a7b('0x6')),'whatsappMessage':require(_0x5a7b('0x7'))};exports[_0x5a7b('0x8')]=function(_0x32f3f8,_0x371b69){return function(_0x3636c1){try{var _0x1f8f95={'body':utils[_0x5a7b('0x9')](_0x371b69[0x0],this),'ContactId':this[_0x5a7b('0xa')]['id']};if(this[_0x5a7b('0xb')]===_0x5a7b('0xc')){_0x1f8f95[_0x5a7b('0xd')]=this[_0x5a7b('0xe')]['id'];}else{_0x1f8f95[_[_0x5a7b('0xf')](this['channel'])+'AccountId']=this[_0x5a7b('0xe')]['id'];}_0x1f8f95[_['upperFirst'](this[_0x5a7b('0xb')])+_0x5a7b('0x10')]=this[_0x5a7b('0x11')]['id'];if(rpc[this[_0x5a7b('0xb')]+_0x5a7b('0x12')]){return rpc[this[_0x5a7b('0xb')]+_0x5a7b('0x12')][_0x5a7b('0x13')](_0x1f8f95)[_0x5a7b('0x14')](function(_0x388176){logger[_0x5a7b('0x15')]('[%s][MESSAGE]\x20%s',_0x32f3f8,_0x1f8f95[_0x5a7b('0x16')]);_0x3636c1[_0x5a7b('0x17')]();})[_0x5a7b('0x18')](function(_0x292a44){logger['error'](_0x5a7b('0x19'),_0x32f3f8,JSON[_0x5a7b('0x1a')](_0x292a44));_0x3636c1['stop']();});}}catch(_0x3e922e){logger['error'](_0x5a7b('0x19'),_0x32f3f8,JSON['stringify'](_0x3e922e));_0x3636c1[_0x5a7b('0x1b')]();}};}; \ 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 77af8ca..b720002 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 _0xcae3=['info','[%s][NOOP]\x20%s','error','stringify','./utils','../../../../config/logger','routing','consequence'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0xcae3,0xcc));var _0x3cae=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xcae3[_0x397e5f];return _0x5302b8;};'use strict';var utils=require(_0x3cae('0x0'));var logger=require(_0x3cae('0x1'))(_0x3cae('0x2'));exports[_0x3cae('0x3')]=function(_0x30ac79,_0x54cf31){return function(_0x55abc1){try{logger[_0x3cae('0x4')](_0x3cae('0x5'),_0x30ac79,utils['getMustacheRender'](_0x54cf31[0x0],this));_0x55abc1['next']();}catch(_0x2046ec){logger[_0x3cae('0x6')](_0x3cae('0x5'),_0x30ac79,JSON[_0x3cae('0x7')](_0x2046ec));_0x55abc1['stop']();}};}; \ No newline at end of file +var _0x6954=['../../../../config/logger','routing','getMustacheRender','next','error','stringify','./utils'];(function(_0x5e60e4,_0x1c629c){var _0x21b44a=function(_0x3ec39e){while(--_0x3ec39e){_0x5e60e4['push'](_0x5e60e4['shift']());}};_0x21b44a(++_0x1c629c);}(_0x6954,0x68));var _0x4695=function(_0xcf89b9,_0x35d612){_0xcf89b9=_0xcf89b9-0x0;var _0x491dc3=_0x6954[_0xcf89b9];return _0x491dc3;};'use strict';var utils=require(_0x4695('0x0'));var logger=require(_0x4695('0x1'))(_0x4695('0x2'));exports['consequence']=function(_0x5eee85,_0x4cea3b){return function(_0x22d854){try{logger['info']('[%s][NOOP]\x20%s',_0x5eee85,utils[_0x4695('0x3')](_0x4cea3b[0x0],this));_0x22d854[_0x4695('0x4')]();}catch(_0x11a398){logger[_0x4695('0x5')]('[%s][NOOP]\x20%s',_0x5eee85,JSON[_0x4695('0x6')](_0x11a398));_0x22d854['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/queue.js b/server/services/routing/server/applications/queue.js index 32afe6f..6f207d5 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 _0x41f5=['createQueue','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','stop','[%s][QUEUE]\x20APPLICATION\x20END','close','rrmemory','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','lodash','util','seq-queue','moment','ioredis','../../../../config/logger','routing','./strategy','redis','defaults','localhost','socket.io-emitter','queue_id','queue','from','joinAt','emit','clone','push','capitalize','InteractionId','format','pick','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','interaction','message','chat','AccountId','WebsiteId','account','info','[%s][START:QUEUE][NAME:%s]','name','create','catch','error','create\x20queue\x20report','waiting','accepted','QueueReport','update','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','find'];(function(_0x5db47a,_0x36c7ea){var _0x1f344f=function(_0x5c576e){while(--_0x5c576e){_0x5db47a['push'](_0x5db47a['shift']());}};_0x1f344f(++_0x36c7ea);}(_0x41f5,0xb3));var _0x541f=function(_0x4d4f5d,_0xc758de){_0x4d4f5d=_0x4d4f5d-0x0;var _0x2278a0=_0x41f5[_0x4d4f5d];return _0x2278a0;};'use strict';var schema=require(_0x541f('0x0'));var _=require(_0x541f('0x1'));var util=require(_0x541f('0x2'));var seqqueue=require(_0x541f('0x3'));var moment=require(_0x541f('0x4'));var Redis=require(_0x541f('0x5'));var config=require('../../../../config/environment');var logger=require(_0x541f('0x6'))(_0x541f('0x7'));var strategy=require(_0x541f('0x8'));config[_0x541f('0x9')]=_[_0x541f('0xa')](config[_0x541f('0x9')],{'host':_0x541f('0xb'),'port':0x18eb});var io=require(_0x541f('0xc'))(new Redis(config[_0x541f('0x9')]));var attributes=['id',_0x541f('0xd'),'account',_0x541f('0xe'),_0x541f('0xf'),_0x541f('0x10')];function emit(_0x2124ad,_0x63b812,_0x581098){io['to'](_0x2124ad)[_0x541f('0x11')](_0x63b812,_0x581098);}function emitChannelQueueInteraction(_0x3635f3,_0x3c54be,_0x4ad80d,_0x288ad9,_0x1841ba,_0x225d05,_0x39546f,_0x5c69f0){var _0x245444=_[_0x541f('0x12')](_0x4ad80d);_0x245444[_0x541f('0xd')]=_0x5c69f0;_0x245444[_0x541f('0xe')]=_0x3c54be;_0x245444['account']=_0x288ad9;_0x245444['id']=_0x1841ba;if(_0x225d05){attributes[_0x541f('0x13')](_[_0x541f('0x14')](_0x3635f3)+_0x541f('0x15'));_0x39546f[util[_0x541f('0x16')]('%sQueuesWaitingInteractions',_0x3635f3)][_0x1841ba]=_[_0x541f('0x17')](_0x245444,attributes);}else{delete _0x39546f[util[_0x541f('0x16')](_0x541f('0x18'),_0x3635f3)][_0x1841ba];}emit(util[_0x541f('0x16')](_0x541f('0x19'),_0x3635f3,_0x3c54be),util['format'](_0x541f('0x1a'),_0x3635f3,_0x225d05?'save':_0x541f('0x1b')),_['pick'](_0x245444,attributes));}var rpc={'openchannelQueueReport':require(_0x541f('0x1c')),'mailQueueReport':require(_0x541f('0x1d')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0x541f('0x1e')),'faxQueueReport':require(_0x541f('0x1f')),'whatsappQueueReport':require(_0x541f('0x20'))};var queue=schema({'name':{'type':'string','required':!![],'message':_0x541f('0x21')},'timeout':{'type':_0x541f('0x22'),'message':_0x541f('0x23')}});function startRouting(_0x4ab8ca,_0x5b1c55,_0x4beec8,_0x4d40ab){if(_0x4ab8ca&&_0x5b1c55&&_0x4beec8){_0x5b1c55['waiting']+=0x1;var _0x569ae1={'uniqueid':_0x4ab8ca,'from':_0x4beec8[_0x541f('0x24')]?_0x4beec8[_0x541f('0x24')][_0x541f('0xf')]:'','joinAt':moment()['format'](_0x541f('0x25')),'ContactId':_0x4beec8[_0x541f('0x26')]?_0x4beec8[_0x541f('0x26')]['id']:null,'ListId':_0x4beec8[_0x541f('0x27')]?_0x4beec8['list']['id']:null};_0x569ae1[_[_0x541f('0x28')](_0x4beec8[_0x541f('0x29')])+_0x541f('0x2a')]=_0x5b1c55['id']||null;_0x569ae1[_[_0x541f('0x28')](_0x4beec8[_0x541f('0x29')])+'InteractionId']=_0x4beec8[_0x541f('0x2b')]?_0x4beec8[_0x541f('0x2b')]['id']:null;_0x569ae1[_['upperFirst'](_0x4beec8[_0x541f('0x29')])+'MessageId']=_0x4beec8[_0x541f('0x2c')]?_0x4beec8['message']['id']:null;_0x569ae1[_[_0x541f('0x28')](_0x4beec8['channel'])+(_0x4beec8['channel']!==_0x541f('0x2d')?_0x541f('0x2e'):_0x541f('0x2f'))]=_0x4beec8[_0x541f('0x30')]?_0x4beec8['account']['id']:null;logger[_0x541f('0x31')](util[_0x541f('0x16')](_0x541f('0x32'),_0x4ab8ca,_0x5b1c55[_0x541f('0x33')]));emitChannelQueueInteraction(_0x4beec8[_0x541f('0x29')],_0x5b1c55[_0x541f('0x33')],_0x569ae1,_0x4beec8[_0x541f('0x30')][_0x541f('0x33')],_0x4beec8[_0x541f('0x2c')]['id'],!![],_0x4d40ab,_0x5b1c55['id']);if(rpc[_0x4beec8['channel']+'QueueReport']){return rpc[_0x4beec8['channel']+'QueueReport'][_0x541f('0x34')](_0x569ae1)[_0x541f('0x35')](function(_0xfbec36){logger[_0x541f('0x36')](_0x541f('0x37'));});}}}function stopRouting(_0x364753,_0x11b189,_0x5c3e70,_0x5ae774){if(_0x364753&&_0x11b189){_0x11b189[_0x541f('0x38')]-=0x1;var _0x592077={'leaveAt':moment()['format'](_0x541f('0x25')),'acceptAt':moment()[_0x541f('0x16')](_0x541f('0x25')),'reason':_0x541f('0x39')};logger[_0x541f('0x31')](util[_0x541f('0x16')]('[%s][STOP:QUEUE][NAME:%s]',_0x364753,_0x11b189[_0x541f('0x33')]));emitChannelQueueInteraction(_0x5c3e70[_0x541f('0x29')],_0x11b189[_0x541f('0x33')],_0x5c3e70[_0x541f('0x24')],_0x5c3e70['account'][_0x541f('0x33')],_0x5c3e70[_0x541f('0x2c')]['id'],![],_0x5ae774,_0x11b189['id']);if(rpc[_0x5c3e70[_0x541f('0x29')]+'QueueReport']){return rpc[_0x5c3e70[_0x541f('0x29')]+_0x541f('0x3a')][_0x541f('0x3b')](_0x364753,_0x592077)[_0x541f('0x35')](function(_0x26693d){logger[_0x541f('0x36')](_0x541f('0x3c'));});}}}function endRouting(_0x49914b,_0x2c1221,_0xb7ee02,_0x2c287f){if(_0x49914b&&_0x2c1221){_0x2c1221[_0x541f('0x38')]-=0x1;var _0x857070={'leaveAt':moment()[_0x541f('0x16')](_0x541f('0x25')),'exitAt':moment()['format'](_0x541f('0x25')),'reason':_0x541f('0x3d')};logger['info'](util[_0x541f('0x16')](_0x541f('0x3e'),_0x49914b,_0x2c1221['name']));emitChannelQueueInteraction(_0xb7ee02['channel'],_0x2c1221[_0x541f('0x33')],_0xb7ee02['body'],_0xb7ee02[_0x541f('0x30')][_0x541f('0x33')],_0xb7ee02['message']['id'],![],_0x2c287f);if(rpc[_0xb7ee02[_0x541f('0x29')]+'QueueReport']){return rpc[_0xb7ee02['channel']+_0x541f('0x3a')][_0x541f('0x3b')](_0x49914b,_0x857070)[_0x541f('0x35')](function(_0x414c5f){logger['error']('update\x20queue\x20report');});}}}function handleFindQueue(_0x1b89fb){return function(_0x29a17b){return _0x29a17b[_0x541f('0x33')][_0x541f('0x3f')]()===_0x1b89fb['toLowerCase']();};}exports[_0x541f('0x40')]=function(_0x6fe387,_0x14dfd1,_0x3acf8a,_0x4d0cb7){return function(_0x173df1){try{var _0x503e27={'name':_0x14dfd1[0x0],'timeout':_0x14dfd1[0x1]};var _0x55e49a=queue['validate'](_0x503e27,{'typecast':!![]});if(_0x55e49a[_0x541f('0x41')]){logger[_0x541f('0x36')](_0x541f('0x42'),_0x6fe387,_[_0x541f('0x43')](_0x55e49a,_0x541f('0x2c'))[_0x541f('0x44')](',\x20'));_0x173df1['stop']();}else{var _0x17cb8d=_[_0x541f('0x45')](_0x3acf8a[_0x4d0cb7[_0x541f('0x29')]+'Queues'],handleFindQueue(_0x503e27[_0x541f('0x33')]));if(_0x17cb8d){startRouting(_0x6fe387,_0x17cb8d,_0x4d0cb7,_0x3acf8a);var _0x4c9446=(_0x17cb8d[_0x541f('0x3d')]||0xa)*0x3e8;var _0x3dfc3f=(_0x503e27['timeout']||0x14)*0x3e8;var _0x31a590;if(_0x4c9446>_0x3dfc3f){_0x3dfc3f=_0x4c9446;}var _0x591f00=seqqueue[_0x541f('0x46')](_0x4c9446);_0x591f00['id']=_0x6fe387;_0x591f00[_0x541f('0x47')]=_0x4c9446;_0x591f00[_0x541f('0x48')]=_0x3dfc3f;_0x591f00[_0x541f('0x29')]=_0x4d0cb7[_0x541f('0x29')];_0x3acf8a[_0x541f('0x49')][_0x6fe387]['on'](_0x541f('0x4a'),function(){logger[_0x541f('0x31')](_0x541f('0x4b'),_0x6fe387);stopRouting(_0x6fe387,_0x17cb8d,_0x4d0cb7,_0x3acf8a);clearTimeout(_0x31a590);_0x31a590=undefined;_0x591f00['close'](!![]);if(_0x3acf8a['rules'][_0x6fe387]){delete _0x3acf8a['rules'][_0x6fe387];}_0x173df1[_0x541f('0x4c')]();});_0x3acf8a[_0x541f('0x49')][_0x6fe387]['on']('complete',function(){if(_0x3acf8a[_0x541f('0x49')][_0x6fe387]){delete _0x3acf8a['rules'][_0x6fe387];}});_0x31a590=setTimeout(function(){logger[_0x541f('0x31')](_0x541f('0x4d'),_0x6fe387);endRouting(_0x6fe387,_0x17cb8d,_0x4d0cb7,_0x3acf8a);clearTimeout(_0x31a590);_0x591f00[_0x541f('0x4e')](!![]);_0x173df1['next']();},_0x3dfc3f);switch(_0x17cb8d['strategy']){case _0x541f('0x4f'):strategy[_0x541f('0x4f')](_0x591f00,_0x17cb8d,_0x3acf8a,_0x4d0cb7);break;default:strategy['beepall'](_0x591f00,_0x17cb8d,_0x3acf8a,_0x4d0cb7);}}else{logger['error'](_0x541f('0x50'),_0x6fe387,_0x503e27['name']);_0x173df1['stop']();}}}catch(_0x201e1c){console[_0x541f('0x51')](_0x201e1c);logger[_0x541f('0x36')](_0x541f('0x42'),_0x6fe387,_0x201e1c[_0x541f('0x52')]);_0x173df1[_0x541f('0x4c')]();}};}; \ No newline at end of file +var _0x3268=['routing','redis','defaults','localhost','socket.io-emitter','queue_id','account','queue','from','joinAt','clone','%sQueuesWaitingInteractions','format','%s:queue:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','QueueId','InteractionId','channel','MessageId','chat','AccountId','WebsiteId','[%s][START:QUEUE][NAME:%s]','name','message','QueueReport','error','create\x20queue\x20report','waiting','accepted','info','[%s][STOP:QUEUE][NAME:%s]','update','catch','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','length','[%s][QUEUE]\x20%s','map','join','find','createQueue','qtimeout','rules','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stop','stack','validate','util','seq-queue','ioredis','../../../../config/logger'];(function(_0x4ad7c1,_0x3d87e9){var _0x21dd28=function(_0x4bb7c0){while(--_0x4bb7c0){_0x4ad7c1['push'](_0x4ad7c1['shift']());}};_0x21dd28(++_0x3d87e9);}(_0x3268,0xdc));var _0x8326=function(_0x5259f7,_0xdcdc61){_0x5259f7=_0x5259f7-0x0;var _0x11e597=_0x3268[_0x5259f7];return _0x11e597;};'use strict';var schema=require(_0x8326('0x0'));var _=require('lodash');var util=require(_0x8326('0x1'));var seqqueue=require(_0x8326('0x2'));var moment=require('moment');var Redis=require(_0x8326('0x3'));var config=require('../../../../config/environment');var logger=require(_0x8326('0x4'))(_0x8326('0x5'));var strategy=require('./strategy');config[_0x8326('0x6')]=_[_0x8326('0x7')](config[_0x8326('0x6')],{'host':_0x8326('0x8'),'port':0x18eb});var io=require(_0x8326('0x9'))(new Redis(config[_0x8326('0x6')]));var attributes=['id',_0x8326('0xa'),_0x8326('0xb'),_0x8326('0xc'),_0x8326('0xd'),_0x8326('0xe')];function emit(_0x34eaa1,_0x1f6c00,_0x4fd97c){io['to'](_0x34eaa1)['emit'](_0x1f6c00,_0x4fd97c);}function emitChannelQueueInteraction(_0x25d845,_0x3303fe,_0x3169b6,_0x599801,_0x796805,_0x1881cc,_0x1a0c80,_0x5f4b06){var _0x47c49e=_[_0x8326('0xf')](_0x3169b6);_0x47c49e[_0x8326('0xa')]=_0x5f4b06;_0x47c49e[_0x8326('0xc')]=_0x3303fe;_0x47c49e[_0x8326('0xb')]=_0x599801;_0x47c49e['id']=_0x796805;if(_0x1881cc){attributes['push'](_['capitalize'](_0x25d845)+'InteractionId');_0x1a0c80[util['format'](_0x8326('0x10'),_0x25d845)][_0x796805]=_['pick'](_0x47c49e,attributes);}else{delete _0x1a0c80[util[_0x8326('0x11')](_0x8326('0x10'),_0x25d845)][_0x796805];}emit(util['format'](_0x8326('0x12'),_0x25d845,_0x3303fe),util[_0x8326('0x11')]('%s_queue_waiting_interaction:%s',_0x25d845,_0x1881cc?_0x8326('0x13'):_0x8326('0x14')),_['pick'](_0x47c49e,attributes));}var rpc={'openchannelQueueReport':require(_0x8326('0x15')),'mailQueueReport':require(_0x8326('0x16')),'chatQueueReport':require(_0x8326('0x17')),'smsQueueReport':require(_0x8326('0x18')),'faxQueueReport':require(_0x8326('0x19')),'whatsappQueueReport':require(_0x8326('0x1a'))};var queue=schema({'name':{'type':'string','required':!![],'message':_0x8326('0x1b')},'timeout':{'type':_0x8326('0x1c'),'message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x3db56f,_0x376d43,_0x5a07b9,_0x372d11){if(_0x3db56f&&_0x376d43&&_0x5a07b9){_0x376d43['waiting']+=0x1;var _0x2ca03f={'uniqueid':_0x3db56f,'from':_0x5a07b9[_0x8326('0x1d')]?_0x5a07b9[_0x8326('0x1d')][_0x8326('0xd')]:'','joinAt':moment()[_0x8326('0x11')](_0x8326('0x1e')),'ContactId':_0x5a07b9[_0x8326('0x1f')]?_0x5a07b9[_0x8326('0x1f')]['id']:null,'ListId':_0x5a07b9[_0x8326('0x20')]?_0x5a07b9[_0x8326('0x20')]['id']:null};_0x2ca03f[_[_0x8326('0x21')](_0x5a07b9['channel'])+_0x8326('0x22')]=_0x376d43['id']||null;_0x2ca03f[_[_0x8326('0x21')](_0x5a07b9['channel'])+_0x8326('0x23')]=_0x5a07b9['interaction']?_0x5a07b9['interaction']['id']:null;_0x2ca03f[_['upperFirst'](_0x5a07b9[_0x8326('0x24')])+_0x8326('0x25')]=_0x5a07b9['message']?_0x5a07b9['message']['id']:null;_0x2ca03f[_[_0x8326('0x21')](_0x5a07b9['channel'])+(_0x5a07b9[_0x8326('0x24')]!==_0x8326('0x26')?_0x8326('0x27'):_0x8326('0x28'))]=_0x5a07b9['account']?_0x5a07b9['account']['id']:null;logger['info'](util[_0x8326('0x11')](_0x8326('0x29'),_0x3db56f,_0x376d43[_0x8326('0x2a')]));emitChannelQueueInteraction(_0x5a07b9[_0x8326('0x24')],_0x376d43[_0x8326('0x2a')],_0x2ca03f,_0x5a07b9[_0x8326('0xb')][_0x8326('0x2a')],_0x5a07b9[_0x8326('0x2b')]['id'],!![],_0x372d11,_0x376d43['id']);if(rpc[_0x5a07b9['channel']+_0x8326('0x2c')]){return rpc[_0x5a07b9[_0x8326('0x24')]+'QueueReport']['create'](_0x2ca03f)['catch'](function(_0x1eeec5){logger[_0x8326('0x2d')](_0x8326('0x2e'));});}}}function stopRouting(_0x1b80bb,_0x2deb02,_0x1e7e1c,_0x4efba7){if(_0x1b80bb&&_0x2deb02){_0x2deb02[_0x8326('0x2f')]-=0x1;var _0x16be46={'leaveAt':moment()[_0x8326('0x11')](_0x8326('0x1e')),'acceptAt':moment()[_0x8326('0x11')](_0x8326('0x1e')),'reason':_0x8326('0x30')};logger[_0x8326('0x31')](util[_0x8326('0x11')](_0x8326('0x32'),_0x1b80bb,_0x2deb02[_0x8326('0x2a')]));emitChannelQueueInteraction(_0x1e7e1c[_0x8326('0x24')],_0x2deb02['name'],_0x1e7e1c[_0x8326('0x1d')],_0x1e7e1c[_0x8326('0xb')]['name'],_0x1e7e1c[_0x8326('0x2b')]['id'],![],_0x4efba7,_0x2deb02['id']);if(rpc[_0x1e7e1c[_0x8326('0x24')]+_0x8326('0x2c')]){return rpc[_0x1e7e1c[_0x8326('0x24')]+_0x8326('0x2c')][_0x8326('0x33')](_0x1b80bb,_0x16be46)[_0x8326('0x34')](function(_0x1ec1de){logger[_0x8326('0x2d')](_0x8326('0x35'));});}}}function endRouting(_0x2915dc,_0x67b92a,_0xbd4c32,_0x3ed39e){if(_0x2915dc&&_0x67b92a){_0x67b92a['waiting']-=0x1;var _0x1b428={'leaveAt':moment()[_0x8326('0x11')](_0x8326('0x1e')),'exitAt':moment()['format'](_0x8326('0x1e')),'reason':_0x8326('0x36')};logger['info'](util[_0x8326('0x11')](_0x8326('0x37'),_0x2915dc,_0x67b92a[_0x8326('0x2a')]));emitChannelQueueInteraction(_0xbd4c32[_0x8326('0x24')],_0x67b92a[_0x8326('0x2a')],_0xbd4c32['body'],_0xbd4c32[_0x8326('0xb')]['name'],_0xbd4c32[_0x8326('0x2b')]['id'],![],_0x3ed39e);if(rpc[_0xbd4c32[_0x8326('0x24')]+'QueueReport']){return rpc[_0xbd4c32[_0x8326('0x24')]+'QueueReport'][_0x8326('0x33')](_0x2915dc,_0x1b428)['catch'](function(_0x3a1e98){logger['error'](_0x8326('0x35'));});}}}function handleFindQueue(_0x2a3d36){return function(_0x5e1a3d){return _0x5e1a3d[_0x8326('0x2a')][_0x8326('0x38')]()===_0x2a3d36[_0x8326('0x38')]();};}exports['consequence']=function(_0x247e08,_0x1aabc3,_0xb68ae0,_0x20f0d7){return function(_0x4d372e){try{var _0x29e25b={'name':_0x1aabc3[0x0],'timeout':_0x1aabc3[0x1]};var _0x240de6=queue[_0x8326('0x0')](_0x29e25b,{'typecast':!![]});if(_0x240de6[_0x8326('0x39')]){logger[_0x8326('0x2d')](_0x8326('0x3a'),_0x247e08,_[_0x8326('0x3b')](_0x240de6,_0x8326('0x2b'))[_0x8326('0x3c')](',\x20'));_0x4d372e['stop']();}else{var _0x4775aa=_[_0x8326('0x3d')](_0xb68ae0[_0x20f0d7[_0x8326('0x24')]+'Queues'],handleFindQueue(_0x29e25b[_0x8326('0x2a')]));if(_0x4775aa){startRouting(_0x247e08,_0x4775aa,_0x20f0d7,_0xb68ae0);var _0x2873ac=(_0x4775aa[_0x8326('0x36')]||0xa)*0x3e8;var _0x1e4023=(_0x29e25b[_0x8326('0x36')]||0x14)*0x3e8;var _0x3d5d8c;if(_0x2873ac>_0x1e4023){_0x1e4023=_0x2873ac;}var _0xe9546f=seqqueue[_0x8326('0x3e')](_0x2873ac);_0xe9546f['id']=_0x247e08;_0xe9546f['atimeout']=_0x2873ac;_0xe9546f[_0x8326('0x3f')]=_0x1e4023;_0xe9546f[_0x8326('0x24')]=_0x20f0d7[_0x8326('0x24')];_0xb68ae0[_0x8326('0x40')][_0x247e08]['on']('end',function(){logger[_0x8326('0x31')](_0x8326('0x41'),_0x247e08);stopRouting(_0x247e08,_0x4775aa,_0x20f0d7,_0xb68ae0);clearTimeout(_0x3d5d8c);_0x3d5d8c=undefined;_0xe9546f[_0x8326('0x42')](!![]);if(_0xb68ae0[_0x8326('0x40')][_0x247e08]){delete _0xb68ae0[_0x8326('0x40')][_0x247e08];}_0x4d372e['stop']();});_0xb68ae0[_0x8326('0x40')][_0x247e08]['on'](_0x8326('0x43'),function(){if(_0xb68ae0[_0x8326('0x40')][_0x247e08]){delete _0xb68ae0['rules'][_0x247e08];}});_0x3d5d8c=setTimeout(function(){logger[_0x8326('0x31')]('[%s][QUEUE]\x20APPLICATION\x20END',_0x247e08);endRouting(_0x247e08,_0x4775aa,_0x20f0d7,_0xb68ae0);clearTimeout(_0x3d5d8c);_0xe9546f[_0x8326('0x42')](!![]);_0x4d372e[_0x8326('0x44')]();},_0x1e4023);switch(_0x4775aa[_0x8326('0x45')]){case _0x8326('0x46'):strategy[_0x8326('0x46')](_0xe9546f,_0x4775aa,_0xb68ae0,_0x20f0d7);break;default:strategy[_0x8326('0x47')](_0xe9546f,_0x4775aa,_0xb68ae0,_0x20f0d7);}}else{logger[_0x8326('0x2d')](_0x8326('0x48'),_0x247e08,_0x29e25b['name']);_0x4d372e[_0x8326('0x49')]();}}}catch(_0x5f4478){console['log'](_0x5f4478);logger[_0x8326('0x2d')](_0x8326('0x3a'),_0x247e08,_0x5f4478[_0x8326('0x4a')]);_0x4d372e[_0x8326('0x49')]();}};}; \ 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 0f436a9..5ecec51 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 _0xb458=['[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','busyQueue','writeLog','STOP','TIMEOUT','exports','lodash','uuid','./util','squeue','routing','push','handleRun','bind','timeout','handleTimeout','drained','handleDrained','prototype','agent','isNil','realtime','agents','debug','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','busy','saveWaitingNotification','showNotification','notificationId','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available'];(function(_0x1225a9,_0x4377d5){var _0x31e525=function(_0x29d8da){while(--_0x29d8da){_0x1225a9['push'](_0x1225a9['shift']());}};_0x31e525(++_0x4377d5);}(_0xb458,0x103));var _0x8b45=function(_0x3e3cf6,_0x211b69){_0x3e3cf6=_0x3e3cf6-0x0;var _0x23d373=_0xb458[_0x3e3cf6];return _0x23d373;};'use strict';var _=require(_0x8b45('0x0'));var uuid=require(_0x8b45('0x1'));var util=require(_0x8b45('0x2'));var logger=require('../../../../../config/logger')('routing');var Agent=function(_0xdf89d4,_0x93d9cd,_0x141a44,_0x13a8c6){this['notificationId']=uuid['v4']();this[_0x8b45('0x3')]=_0xdf89d4;this['agent']=_0x93d9cd;this['realtime']=_0x141a44;this[_0x8b45('0x4')]=_0x13a8c6;this[_0x8b45('0x3')][_0x8b45('0x5')](this[_0x8b45('0x6')][_0x8b45('0x7')](this),this['handleTimeout'][_0x8b45('0x7')](this));this[_0x8b45('0x3')]['on'](_0x8b45('0x8'),this[_0x8b45('0x9')][_0x8b45('0x7')](this));this['squeue']['on'](_0x8b45('0xa'),this[_0x8b45('0xb')]['bind'](this));};Agent['prototype']['push']=function(){this['squeue'][_0x8b45('0x5')](this[_0x8b45('0x6')][_0x8b45('0x7')](this),this['handleTimeout'][_0x8b45('0x7')](this));};Agent[_0x8b45('0xc')][_0x8b45('0xb')]=function(){this[_0x8b45('0x9')](!![]);};Agent[_0x8b45('0xc')][_0x8b45('0x6')]=function(){logger['debug']('[%s][AGENT]\x20try\x20with\x20%s',this[_0x8b45('0x3')]['id'],this[_0x8b45('0xd')]['id']);if(_[_0x8b45('0xe')](this[_0x8b45('0xf')][_0x8b45('0x10')][this[_0x8b45('0xd')]['id']])){logger[_0x8b45('0x11')](_0x8b45('0x12'),this[_0x8b45('0x3')]['id'],this[_0x8b45('0xd')]['id']);setTimeout(this[_0x8b45('0x5')][_0x8b45('0x7')](this),0x3e8);}else{if(this[_0x8b45('0x4')][_0x8b45('0x13')]||util[_0x8b45('0x14')](this[_0x8b45('0x3')]['id'],this[_0x8b45('0xf')][_0x8b45('0x10')][this['agent']['id']],this[_0x8b45('0x3')][_0x8b45('0x15')],![])){this[_0x8b45('0xf')][_0x8b45('0x10')][this[_0x8b45('0xd')]['id']][_0x8b45('0x16')]=!![];this[_0x8b45('0xf')][_0x8b45('0x10')][this['agent']['id']]['busyQueue']=undefined;util[_0x8b45('0x17')](this['realtime'],this[_0x8b45('0x4')],this[_0x8b45('0xd')],this[_0x8b45('0x3')][_0x8b45('0x15')]);util[_0x8b45('0x18')](this[_0x8b45('0x19')],this[_0x8b45('0x3')]['id'],this['realtime']['agents'][this[_0x8b45('0xd')]['id']],null,this[_0x8b45('0x4')]);util['writeLog'](this['squeue']['id'],this[_0x8b45('0xf')][_0x8b45('0x10')][this[_0x8b45('0xd')]['id']],_0x8b45('0x1a')+(this['routing'][_0x8b45('0x13')]?_0x8b45('0x1b'):''));}else{logger[_0x8b45('0x11')](_0x8b45('0x1c'),this[_0x8b45('0x3')]['id'],this[_0x8b45('0xd')]['id']);setTimeout(this[_0x8b45('0x5')][_0x8b45('0x7')](this),0x3e8);}}};Agent[_0x8b45('0xc')][_0x8b45('0x9')]=function(_0x339c73){if(_[_0x8b45('0xe')](this[_0x8b45('0xf')]['agents'][this[_0x8b45('0xd')]['id']])){return logger[_0x8b45('0x11')](_0x8b45('0x12'),this[_0x8b45('0x3')]['id'],this[_0x8b45('0xd')]['id']);}else{logger[_0x8b45('0x11')](_0x8b45('0x1d'),this[_0x8b45('0x3')]['id'],this['agent']['id']);util[_0x8b45('0x1e')](this[_0x8b45('0x19')],this[_0x8b45('0x3')]['id'],this[_0x8b45('0xf')][_0x8b45('0x10')][this['agent']['id']],null,this[_0x8b45('0x4')]);this['realtime']['agents'][this[_0x8b45('0xd')]['id']][_0x8b45('0x16')]=![];this[_0x8b45('0xf')][_0x8b45('0x10')][this[_0x8b45('0xd')]['id']][_0x8b45('0x1f')]=undefined;util['removeWaitingNotification'](this[_0x8b45('0xf')],this[_0x8b45('0x4')],this[_0x8b45('0xd')],this[_0x8b45('0x3')]['channel']);util[_0x8b45('0x20')](this[_0x8b45('0x3')]['id'],this[_0x8b45('0xf')]['agents'][this[_0x8b45('0xd')]['id']],_0x339c73?_0x8b45('0x21'):_0x8b45('0x22'));}if(!_0x339c73){setTimeout(this['push'][_0x8b45('0x7')](this),0x3e8);}};function agent(_0x348a13,_0x3452fb,_0x4016b7,_0x58d94f){return new Agent(_0x348a13,_0x3452fb,_0x4016b7,_0x58d94f);}module[_0x8b45('0x23')]=agent; \ No newline at end of file +var _0x2d17=['routing','notificationId','agent','squeue','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','push','debug','[%s][AGENT]\x20try\x20with\x20%s','isNil','realtime','agents','forcedOwnership','channel','busy','saveWaitingNotification','showNotification','writeLog',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','busyQueue','removeWaitingNotification','STOP','TIMEOUT','exports','lodash','uuid','../../../../../config/logger'];(function(_0x5b1592,_0x29a565){var _0x3006c1=function(_0xdcd8c2){while(--_0xdcd8c2){_0x5b1592['push'](_0x5b1592['shift']());}};_0x3006c1(++_0x29a565);}(_0x2d17,0x17e));var _0x72d1=function(_0x2b793d,_0x14b331){_0x2b793d=_0x2b793d-0x0;var _0x323bed=_0x2d17[_0x2b793d];return _0x323bed;};'use strict';var _=require(_0x72d1('0x0'));var uuid=require(_0x72d1('0x1'));var util=require('./util');var logger=require(_0x72d1('0x2'))(_0x72d1('0x3'));var Agent=function(_0x531f4e,_0x3687bc,_0x38fec7,_0x55b722){this[_0x72d1('0x4')]=uuid['v4']();this['squeue']=_0x531f4e;this[_0x72d1('0x5')]=_0x3687bc;this['realtime']=_0x38fec7;this[_0x72d1('0x3')]=_0x55b722;this[_0x72d1('0x6')]['push'](this[_0x72d1('0x7')][_0x72d1('0x8')](this),this[_0x72d1('0x9')]['bind'](this));this[_0x72d1('0x6')]['on'](_0x72d1('0xa'),this[_0x72d1('0x9')]['bind'](this));this[_0x72d1('0x6')]['on'](_0x72d1('0xb'),this[_0x72d1('0xc')][_0x72d1('0x8')](this));};Agent[_0x72d1('0xd')][_0x72d1('0xe')]=function(){this[_0x72d1('0x6')][_0x72d1('0xe')](this[_0x72d1('0x7')][_0x72d1('0x8')](this),this['handleTimeout'][_0x72d1('0x8')](this));};Agent[_0x72d1('0xd')][_0x72d1('0xc')]=function(){this[_0x72d1('0x9')](!![]);};Agent[_0x72d1('0xd')][_0x72d1('0x7')]=function(){logger[_0x72d1('0xf')](_0x72d1('0x10'),this[_0x72d1('0x6')]['id'],this[_0x72d1('0x5')]['id']);if(_[_0x72d1('0x11')](this[_0x72d1('0x12')][_0x72d1('0x13')][this['agent']['id']])){logger[_0x72d1('0xf')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x72d1('0x6')]['id'],this[_0x72d1('0x5')]['id']);setTimeout(this['push'][_0x72d1('0x8')](this),0x3e8);}else{if(this[_0x72d1('0x3')][_0x72d1('0x14')]||util['isAgentAvailable'](this['squeue']['id'],this[_0x72d1('0x12')][_0x72d1('0x13')][this[_0x72d1('0x5')]['id']],this[_0x72d1('0x6')][_0x72d1('0x15')],![])){this[_0x72d1('0x12')][_0x72d1('0x13')][this['agent']['id']][_0x72d1('0x16')]=!![];this['realtime']['agents'][this['agent']['id']]['busyQueue']=undefined;util[_0x72d1('0x17')](this[_0x72d1('0x12')],this['routing'],this[_0x72d1('0x5')],this[_0x72d1('0x6')][_0x72d1('0x15')]);util[_0x72d1('0x18')](this[_0x72d1('0x4')],this['squeue']['id'],this['realtime'][_0x72d1('0x13')][this[_0x72d1('0x5')]['id']],null,this[_0x72d1('0x3')]);util[_0x72d1('0x19')](this[_0x72d1('0x6')]['id'],this[_0x72d1('0x12')][_0x72d1('0x13')][this['agent']['id']],'RINGING'+(this[_0x72d1('0x3')]['forcedOwnership']?_0x72d1('0x1a'):''));}else{logger[_0x72d1('0xf')](_0x72d1('0x1b'),this['squeue']['id'],this[_0x72d1('0x5')]['id']);setTimeout(this['push'][_0x72d1('0x8')](this),0x3e8);}}};Agent[_0x72d1('0xd')][_0x72d1('0x9')]=function(_0x2cc0c8){if(_['isNil'](this[_0x72d1('0x12')]['agents'][this[_0x72d1('0x5')]['id']])){return logger[_0x72d1('0xf')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x72d1('0x6')]['id'],this[_0x72d1('0x5')]['id']);}else{logger[_0x72d1('0xf')](_0x72d1('0x1c'),this[_0x72d1('0x6')]['id'],this['agent']['id']);util[_0x72d1('0x1d')](this[_0x72d1('0x4')],this[_0x72d1('0x6')]['id'],this['realtime'][_0x72d1('0x13')][this[_0x72d1('0x5')]['id']],null,this['routing']);this[_0x72d1('0x12')][_0x72d1('0x13')][this[_0x72d1('0x5')]['id']]['busy']=![];this[_0x72d1('0x12')]['agents'][this[_0x72d1('0x5')]['id']][_0x72d1('0x1e')]=undefined;util[_0x72d1('0x1f')](this[_0x72d1('0x12')],this[_0x72d1('0x3')],this[_0x72d1('0x5')],this[_0x72d1('0x6')][_0x72d1('0x15')]);util[_0x72d1('0x19')](this[_0x72d1('0x6')]['id'],this[_0x72d1('0x12')]['agents'][this[_0x72d1('0x5')]['id']],_0x2cc0c8?_0x72d1('0x20'):_0x72d1('0x21'));}if(!_0x2cc0c8){setTimeout(this[_0x72d1('0xe')]['bind'](this),0x3e8);}};function agent(_0x3eb3da,_0x3ae025,_0x2783bb,_0x4fb07b){return new Agent(_0x3eb3da,_0x3ae025,_0x2783bb,_0x4fb07b);}module[_0x72d1('0x22')]=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 cc06172..124827e 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 _0xe987=['isNil','Agents','length','debug','isAgentAvailable','agents','channel','writeLog','RINGING','busyQueue','name','saveWaitingNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','hideNotification','STOP','TIMEOUT','busy','removeWaitingNotification','exports','lodash','uuid','./util','../../../../../config/logger','notificationId','squeue','queue','realtime','routing','handleRun','bind','timeout','handleTimeout','drained','prototype','push','handleDrained'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xe987,0x145));var _0x7e98=function(_0x4e7e4d,_0x29332e){_0x4e7e4d=_0x4e7e4d-0x0;var _0x5f2246=_0xe987[_0x4e7e4d];return _0x5f2246;};'use strict';var _=require(_0x7e98('0x0'));var uuid=require(_0x7e98('0x1'));var util=require(_0x7e98('0x2'));var logger=require(_0x7e98('0x3'))('routing');var Beepall=function(_0x1a8aa9,_0x998cd5,_0x4e57bd,_0x3e1f8c){this[_0x7e98('0x4')]=uuid['v4']();this[_0x7e98('0x5')]=_0x1a8aa9;this[_0x7e98('0x6')]=_0x998cd5;this[_0x7e98('0x7')]=_0x4e57bd;this[_0x7e98('0x8')]=_0x3e1f8c;this[_0x7e98('0x5')]['push'](this[_0x7e98('0x9')]['bind'](this),this['handleTimeout'][_0x7e98('0xa')](this));this[_0x7e98('0x5')]['on'](_0x7e98('0xb'),this[_0x7e98('0xc')][_0x7e98('0xa')](this));this[_0x7e98('0x5')]['on'](_0x7e98('0xd'),this['handleDrained'][_0x7e98('0xa')](this));};Beepall[_0x7e98('0xe')][_0x7e98('0xf')]=function(){this[_0x7e98('0x5')]['push'](this[_0x7e98('0x9')][_0x7e98('0xa')](this),this[_0x7e98('0xc')][_0x7e98('0xa')](this));};Beepall[_0x7e98('0xe')][_0x7e98('0x10')]=function(){this[_0x7e98('0xc')](!![]);};Beepall[_0x7e98('0xe')]['handleRun']=function(){var _0x2be3b1=!![];if(!_[_0x7e98('0x11')](this[_0x7e98('0x6')])&&!_[_0x7e98('0x11')](this[_0x7e98('0x6')][_0x7e98('0x12')])&&this['queue'][_0x7e98('0x12')][_0x7e98('0x13')]>0x0){for(var _0x55167e=0x0,_0x50a10a;_0x55167e0x0){for(var _0x218dfb=0x0,_0xb08787;_0x218dfb0x0&&_0x4ac6c3[_0x2dead3+'CurrentCapacity']>=_0x4ac6c3[_0x2dead3+'Capacity']){writeLog(_0x4fb64a,_0x4ac6c3,_0x2dead3['toUpperCase']()+_0xac38('0x21'));return![];}}return!![];};exports[_0xac38('0x22')]=function(_0x38baaf,_0x479605,_0x13d069,_0x3a74d3,_0x431330){return sendNotification(!![],_0x38baaf,_0x479605,_0x13d069,_0x3a74d3,_0x431330);};exports['hideNotification']=function(_0x18f5aa,_0x417aee,_0x312646,_0x227630,_0x591560){return sendNotification(![],_0x18f5aa,_0x417aee,_0x312646,_0x227630,_0x591560);};exports['checkWaitingNotifications']=function(_0xf7f71,_0x341afa,_0x2bbcfc){var _0x142bc9=_0x341afa[_0xac38('0x23')][_0xac38('0x24')];if(!_0x142bc9&&_0x2bbcfc){_0x142bc9=_0x2bbcfc['id'];}var _0x1b8e79=_[_0xac38('0x25')](_0xf7f71[_0x341afa[_0xac38('0x26')]+_0xac38('0x27')],function(_0x180567){var _0x574a7b=_[_0xac38('0x28')](_0x341afa[_0xac38('0x26')])+'InteractionId';return _0x180567[_0x574a7b]===_0x341afa[_0xac38('0x23')]['id'];});if(!_0x1b8e79&&_0x142bc9){_0x1b8e79=_[_0xac38('0x25')](_0xf7f71[_0xac38('0x29')][_0x142bc9][_0x341afa[_0xac38('0x26')]+_0xac38('0x2a')],function(_0x2cc573){return _0x2cc573['id']===_0x341afa[_0xac38('0x23')]['id'];});}return _0x1b8e79;};exports[_0xac38('0x2b')]=function(_0x492fe8,_0x1f170e,_0xf6851f,_0x5ae3ae){_0x492fe8[_0xac38('0x29')][_0xf6851f['id']][_0x5ae3ae+_0xac38('0x2a')][_0x1f170e[_0xac38('0x16')]['id']]={'id':_0x1f170e[_0xac38('0x23')]['id']};};exports[_0xac38('0x2c')]=function(_0x18201b,_0x57a123,_0x505cff,_0x21c35f){delete _0x18201b[_0xac38('0x29')][_0x505cff['id']][_0x21c35f+'WaitingInteractions'][_0x57a123[_0xac38('0x16')]['id']];};exports['writeLog']=writeLog; \ No newline at end of file +var _0xe49a=['util','../utils','ioredis','../../../../../config/environment','../../../../../config/logger','routing','defaults','redis','localhost','format','user:%s','name','emit','split','\x20interaction','account','notificationShake','body','queue','msg','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','[%s][QUEUE]\x20%s','message','save','remove','[%s][QUEUE][AGENT:%s][STATUS:%s]','BUSY','online','OFFLINE','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','showNotification','hideNotification','checkWaitingNotifications','UserId','some','channel','InteractionId','agents','WaitingInteractions','interaction','removeWaitingNotification','writeLog'];(function(_0xff6d6,_0x55c0ea){var _0x1d3f22=function(_0x4394be){while(--_0x4394be){_0xff6d6['push'](_0xff6d6['shift']());}};_0x1d3f22(++_0x55c0ea);}(_0xe49a,0x157));var _0xae49=function(_0x4bdb3a,_0x3fe603){_0x4bdb3a=_0x4bdb3a-0x0;var _0x314ce9=_0xe49a[_0x4bdb3a];return _0x314ce9;};'use strict';var _=require('lodash');var util=require(_0xae49('0x0'));var utils=require(_0xae49('0x1'));var Redis=require(_0xae49('0x2'));var config=require(_0xae49('0x3'));var logger=require(_0xae49('0x4'))(_0xae49('0x5'));config['redis']=_[_0xae49('0x6')](config[_0xae49('0x7')],{'host':_0xae49('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xae49('0x7')]));function sendNotification(_0x1ae763,_0x2d8369,_0x43c9bc,_0x149b17,_0x23e6c1,_0x5b3384){io['to'](util[_0xae49('0x9')](_0xae49('0xa'),_0x149b17[_0xae49('0xb')]))[_0xae49('0xc')]('user:save',_0x149b17);var _0x81510f=_0x5b3384||{};var _0x2bb015=_0x43c9bc[_0xae49('0xd')]('.');var _0x211399={'uniqueid':_0x2d8369,'channel':_0x2bb015[0x0],'id':_0x2bb015[0x1],'title':_0x2bb015[0x0]+_0xae49('0xe'),'interactionId':_0x2bb015[0x2],'queue':_0x23e6c1?_0x23e6c1[_0xae49('0xb')]:null,'sound':_0x81510f[_0xae49('0xf')]['notificationSound'],'shake':_0x81510f[_0xae49('0xf')][_0xae49('0x10')]};try{if(!_0x81510f['body']){_0x81510f['body']={};}if(_0x23e6c1){_0x81510f[_0xae49('0x11')]['queue']=_0x23e6c1;}else if(_0x81510f[_0xae49('0x11')][_0xae49('0x12')]){delete _0x81510f[_0xae49('0x11')][_0xae49('0x12')];}_0x211399[_0xae49('0x13')]=utils['getMustacheRender'](_0x81510f['account'][_0xae49('0x14')],_0x81510f);}catch(_0x9d6738){_0x211399[_0xae49('0x13')]=_0xae49('0x15');logger['error'](util[_0xae49('0x9')](_0xae49('0x16'),_0x2d8369,_0x9d6738[_0xae49('0x17')]));}io['to'](util[_0xae49('0x9')](_0xae49('0xa'),_0x149b17[_0xae49('0xb')]))[_0xae49('0xc')](util['format']('notification:%s',_0x1ae763?_0xae49('0x18'):_0xae49('0x19')),_0x211399);}function writeLog(_0x594d87,_0x3d6fba,_0x251e2c){return logger['debug'](util[_0xae49('0x9')](_0xae49('0x1a'),_0x594d87,_0x3d6fba['name'],_0x251e2c));}exports['isAgentAvailable']=function(_0xca5c9d,_0x5054c6,_0x3fa3bd,_0x3107c9){if(_0x5054c6['busy']){writeLog(_0xca5c9d,_0x5054c6,_0xae49('0x1b'));return![];}if(!_0x5054c6[_0xae49('0x1c')]){writeLog(_0xca5c9d,_0x5054c6,_0xae49('0x1d'));return![];}if(_0x5054c6[_0x3fa3bd+_0xae49('0x1e')]){writeLog(_0xca5c9d,_0x5054c6,_0xae49('0x1f'));return![];}if(_0x3107c9&&_0x5054c6[_0xae49('0x20')](_0x3fa3bd+_0xae49('0x21'))&&_0x5054c6['hasOwnProperty'](_0x3fa3bd+_0xae49('0x22'))){if(_0x5054c6[_0x3fa3bd+_0xae49('0x21')]>0x0&&_0x5054c6[_0x3fa3bd+'CurrentCapacity']>=_0x5054c6[_0x3fa3bd+_0xae49('0x21')]){writeLog(_0xca5c9d,_0x5054c6,_0x3fa3bd[_0xae49('0x23')]()+_0xae49('0x24'));return![];}}return!![];};exports[_0xae49('0x25')]=function(_0x1f278d,_0x52ed59,_0x1a77b6,_0x3043d3,_0x519d8c){return sendNotification(!![],_0x1f278d,_0x52ed59,_0x1a77b6,_0x3043d3,_0x519d8c);};exports[_0xae49('0x26')]=function(_0x926b3d,_0x6aef3c,_0x5dbcac,_0x15ad70,_0x1b052c){return sendNotification(![],_0x926b3d,_0x6aef3c,_0x5dbcac,_0x15ad70,_0x1b052c);};exports[_0xae49('0x27')]=function(_0x13fa4e,_0x2c58e8,_0x14f348){var _0x4d7a2b=_0x2c58e8['interaction'][_0xae49('0x28')];if(!_0x4d7a2b&&_0x14f348){_0x4d7a2b=_0x14f348['id'];}var _0x56e845=_[_0xae49('0x29')](_0x13fa4e[_0x2c58e8[_0xae49('0x2a')]+'QueuesWaitingInteractions'],function(_0x206598){var _0x405afb=_['capitalize'](_0x2c58e8[_0xae49('0x2a')])+_0xae49('0x2b');return _0x206598[_0x405afb]===_0x2c58e8['interaction']['id'];});if(!_0x56e845&&_0x4d7a2b){_0x56e845=_[_0xae49('0x29')](_0x13fa4e[_0xae49('0x2c')][_0x4d7a2b][_0x2c58e8[_0xae49('0x2a')]+_0xae49('0x2d')],function(_0x3cebf4){return _0x3cebf4['id']===_0x2c58e8[_0xae49('0x2e')]['id'];});}return _0x56e845;};exports['saveWaitingNotification']=function(_0x435697,_0xf44c62,_0x310514,_0x4e2565){_0x435697[_0xae49('0x2c')][_0x310514['id']][_0x4e2565+_0xae49('0x2d')][_0xf44c62['message']['id']]={'id':_0xf44c62['interaction']['id']};};exports[_0xae49('0x2f')]=function(_0x377326,_0x89d7f3,_0x39c6c5,_0x4aeaeb){delete _0x377326['agents'][_0x39c6c5['id']][_0x4aeaeb+'WaitingInteractions'][_0x89d7f3[_0xae49('0x17')]['id']];};exports[_0xae49('0x30')]=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 68031f1..aa15fdd 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 _0x95ce=['error','message','join','info','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20%s','isObject','stringify','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','shelljs','lodash','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','length'];(function(_0x173b39,_0xb8ddf2){var _0x122202=function(_0x1def8a){while(--_0x1def8a){_0x173b39['push'](_0x173b39['shift']());}};_0x122202(++_0xb8ddf2);}(_0x95ce,0x1e6));var _0xe95c=function(_0x25f664,_0x182d05){_0x25f664=_0x25f664-0x0;var _0x45f9c9=_0x95ce[_0x25f664];return _0x45f9c9;};'use strict';var schema=require('validate');var sh=require(_0xe95c('0x0'));var _=require(_0xe95c('0x1'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0xe95c('0x2'));var system=schema({'command':{'type':_0xe95c('0x3'),'required':!![],'message':_0xe95c('0x4')}});exports[_0xe95c('0x5')]=function(_0x21ea12,_0x363215){return function(_0x2cdbfb){try{var _0x423077={'command':_0x363215[0x0]};var _0x5277d2=system[_0xe95c('0x6')](_0x423077,{'typecast':!![]});if(_0x5277d2[_0xe95c('0x7')]){logger[_0xe95c('0x8')]('[%s][SYSTEM]\x20%s',_0x21ea12,_['map'](_0x5277d2,_0xe95c('0x9'))[_0xe95c('0xa')](',\x20'));logger[_0xe95c('0xb')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x21ea12);_0x2cdbfb[_0xe95c('0xc')]();}else{var _0x56c8c4=this;var _0x4e9b7f=utils[_0xe95c('0xd')](_0x363215[0x0],this);logger[_0xe95c('0xb')](_0xe95c('0xe'),_0x21ea12,_0x4e9b7f);sh['exec'](_[_0xe95c('0xf')](_0x4e9b7f),function(_0x257562,_0x527bc0){logger[_0xe95c('0xb')](_0xe95c('0x10'),_0x21ea12,_0x257562);if(_0x257562==0x0){var _0x1feba5=_0x527bc0[_0xe95c('0x11')](/(\r\n|\n|\r)/gm,'');if(_[_0xe95c('0x12')](_0x363215[0x1])||_[_0xe95c('0x13')](_0x363215[0x1])){logger['info'](_0xe95c('0x14'),_0x21ea12);_0x56c8c4[_0xe95c('0x15')][_0x363215[0x1]]=_0x1feba5;}else{logger[_0xe95c('0xb')]('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x21ea12,_0x363215[0x1],_0x1feba5);_0x56c8c4['body'][_0x363215[0x1]]=_0x1feba5;}}_0x2cdbfb[_0xe95c('0xc')]();});}}catch(_0x42301d){logger[_0xe95c('0x8')](_0xe95c('0x16'),_0x21ea12,_[_0xe95c('0x17')](_0x42301d)?JSON[_0xe95c('0x18')](_0x42301d):_0x42301d);logger[_0xe95c('0xb')](_0xe95c('0x19'),_0x21ea12);_0x2cdbfb[_0xe95c('0xc')]();}};}; \ No newline at end of file +var _0xf611=['isObject','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','lodash','./utils','../../../../config/logger','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][SYSTEM]\x20%s','map','message','getMustacheRender','info','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s'];(function(_0x159c68,_0xc544c9){var _0x32792f=function(_0x3c4ed5){while(--_0x3c4ed5){_0x159c68['push'](_0x159c68['shift']());}};_0x32792f(++_0xc544c9);}(_0xf611,0x183));var _0x1f61=function(_0x2e846d,_0x370cd6){_0x2e846d=_0x2e846d-0x0;var _0x10a6ab=_0xf611[_0x2e846d];return _0x10a6ab;};'use strict';var schema=require('validate');var sh=require('shelljs');var _=require(_0x1f61('0x0'));var utils=require(_0x1f61('0x1'));var logger=require(_0x1f61('0x2'))('routing');var system=schema({'command':{'type':'string','required':!![],'message':_0x1f61('0x3')}});exports[_0x1f61('0x4')]=function(_0x224e7c,_0x3d3d0c){return function(_0x112fa5){try{var _0x2058e0={'command':_0x3d3d0c[0x0]};var _0x7e0966=system['validate'](_0x2058e0,{'typecast':!![]});if(_0x7e0966[_0x1f61('0x5')]){logger[_0x1f61('0x6')](_0x1f61('0x7'),_0x224e7c,_[_0x1f61('0x8')](_0x7e0966,_0x1f61('0x9'))['join'](',\x20'));logger['info']('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x224e7c);_0x112fa5['next']();}else{var _0x2ae751=this;var _0xebcf83=utils[_0x1f61('0xa')](_0x3d3d0c[0x0],this);logger[_0x1f61('0xb')](_0x1f61('0xc'),_0x224e7c,_0xebcf83);sh[_0x1f61('0xd')](_[_0x1f61('0xe')](_0xebcf83),function(_0x1614c3,_0x3b1f3b){logger[_0x1f61('0xb')](_0x1f61('0xf'),_0x224e7c,_0x1614c3);if(_0x1614c3==0x0){var _0x40763c=_0x3b1f3b[_0x1f61('0x10')](/(\r\n|\n|\r)/gm,'');if(_[_0x1f61('0x11')](_0x3d3d0c[0x1])||_[_0x1f61('0x12')](_0x3d3d0c[0x1])){logger[_0x1f61('0xb')]('[%s][SYSTEM]\x20no\x20variable',_0x224e7c);_0x2ae751[_0x1f61('0x13')][_0x3d3d0c[0x1]]=_0x40763c;}else{logger[_0x1f61('0xb')](_0x1f61('0x14'),_0x224e7c,_0x3d3d0c[0x1],_0x40763c);_0x2ae751['body'][_0x3d3d0c[0x1]]=_0x40763c;}}_0x112fa5['next']();});}}catch(_0x3651b4){logger[_0x1f61('0x6')](_0x1f61('0x7'),_0x224e7c,_[_0x1f61('0x15')](_0x3651b4)?JSON['stringify'](_0x3651b4):_0x3651b4);logger[_0x1f61('0xb')](_0x1f61('0x16'),_0x224e7c);_0x112fa5[_0x1f61('0x17')]();}};}; \ 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 2b34dc2..524ec71 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 _0x3cae=['finally','isObject','validate','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][TAG]\x20%s','map','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','interaction','then','catch','stringify'];(function(_0x839c2,_0x369af7){var _0xd919da=function(_0x21b7ba){while(--_0x21b7ba){_0x839c2['push'](_0x839c2['shift']());}};_0xd919da(++_0x369af7);}(_0x3cae,0x1a2));var _0xe3ca=function(_0x3afe18,_0x26922c){_0x3afe18=_0x3afe18-0x0;var _0x19ed1f=_0x3cae[_0x3afe18];return _0x19ed1f;};'use strict';var schema=require(_0xe3ca('0x0'));var _=require('lodash');var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0xe3ca('0x1')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0xe3ca('0x2')),'faxInteraction':require(_0xe3ca('0x3')),'whatsappInteraction':require(_0xe3ca('0x4'))};var logger=require(_0xe3ca('0x5'))(_0xe3ca('0x6'));var tag=schema({'tag':{'type':'number','required':!![],'message':_0xe3ca('0x7')}});exports[_0xe3ca('0x8')]=function(_0x266807,_0x18b73e,_0x2594f6,_0xc8b476){return function(_0x3e4a06){try{var _0x5e3d5c={'tag':_0x18b73e[0x0]};var _0x24bde2=tag[_0xe3ca('0x0')](_0x5e3d5c,{'typecast':!![]});if(_0x24bde2[_0xe3ca('0x9')]){logger[_0xe3ca('0xa')](_0xe3ca('0xb'),_0x266807,_[_0xe3ca('0xc')](_0x24bde2,'message')[_0xe3ca('0xd')](',\x20'));logger[_0xe3ca('0xe')](_0xe3ca('0xf'),_0x266807);_0x3e4a06[_0xe3ca('0x10')]();}else{var _0x93439f={'ids':[_0x18b73e[0x0]]};if(rpc[_0xc8b476[_0xe3ca('0x11')]+_0xe3ca('0x12')]){rpc[_0xc8b476[_0xe3ca('0x11')]+_0xe3ca('0x12')][_0xe3ca('0x13')](_0xc8b476[_0xe3ca('0x14')]['id'],_0x93439f)[_0xe3ca('0x15')](function(_0x5e57ba){logger['info']('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x266807,_0x18b73e[0x1],_0xc8b476[_0xe3ca('0x11')],_0xc8b476['interaction']['id']);})[_0xe3ca('0x16')](function(_0x23a714){logger[_0xe3ca('0xa')](_0xe3ca('0xb'),_0x266807,JSON[_0xe3ca('0x17')](_0x23a714));logger[_0xe3ca('0xe')](_0xe3ca('0xf'),_0x266807);})[_0xe3ca('0x18')](function(){_0x3e4a06[_0xe3ca('0x10')]();});}}}catch(_0x428a2e){logger[_0xe3ca('0xa')](_0xe3ca('0xb'),_0x266807,_[_0xe3ca('0x19')](_0x428a2e)?JSON['stringify'](_0x428a2e):_0x428a2e);logger[_0xe3ca('0xe')](_0xe3ca('0xf'),_0x266807);_0x3e4a06['next']();}};}; \ No newline at end of file +var _0xde67=['lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../../../config/logger','routing','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','error','[%s][TAG]\x20%s','map','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','Interaction','addTags','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','channel','catch','stringify','isObject','validate'];(function(_0xc27e57,_0x4190d1){var _0x265624=function(_0x2d3541){while(--_0x2d3541){_0xc27e57['push'](_0xc27e57['shift']());}};_0x265624(++_0x4190d1);}(_0xde67,0x6f));var _0x7de6=function(_0x33ad1f,_0xfc2fc8){_0x33ad1f=_0x33ad1f-0x0;var _0x26ef22=_0xde67[_0x33ad1f];return _0x26ef22;};'use strict';var schema=require(_0x7de6('0x0'));var _=require(_0x7de6('0x1'));var rpc={'chatInteraction':require(_0x7de6('0x2')),'openchannelInteraction':require(_0x7de6('0x3')),'smsInteraction':require(_0x7de6('0x4')),'mailInteraction':require(_0x7de6('0x5')),'faxInteraction':require(_0x7de6('0x6')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require(_0x7de6('0x7'))(_0x7de6('0x8'));var tag=schema({'tag':{'type':'number','required':!![],'message':_0x7de6('0x9')}});exports[_0x7de6('0xa')]=function(_0x59671c,_0x1bf118,_0x2df533,_0x500b24){return function(_0x50e04f){try{var _0x22b4f0={'tag':_0x1bf118[0x0]};var _0xd9d44d=tag[_0x7de6('0x0')](_0x22b4f0,{'typecast':!![]});if(_0xd9d44d['length']){logger[_0x7de6('0xb')](_0x7de6('0xc'),_0x59671c,_[_0x7de6('0xd')](_0xd9d44d,_0x7de6('0xe'))[_0x7de6('0xf')](',\x20'));logger[_0x7de6('0x10')](_0x7de6('0x11'),_0x59671c);_0x50e04f[_0x7de6('0x12')]();}else{var _0x3e2b16={'ids':[_0x1bf118[0x0]]};if(rpc[_0x500b24['channel']+_0x7de6('0x13')]){rpc[_0x500b24['channel']+_0x7de6('0x13')][_0x7de6('0x14')](_0x500b24[_0x7de6('0x15')]['id'],_0x3e2b16)[_0x7de6('0x16')](function(_0x3e51ea){logger[_0x7de6('0x10')](_0x7de6('0x17'),_0x59671c,_0x1bf118[0x1],_0x500b24[_0x7de6('0x18')],_0x500b24[_0x7de6('0x15')]['id']);})[_0x7de6('0x19')](function(_0x2e7dea){logger[_0x7de6('0xb')](_0x7de6('0xc'),_0x59671c,JSON[_0x7de6('0x1a')](_0x2e7dea));logger['info'](_0x7de6('0x11'),_0x59671c);})['finally'](function(){_0x50e04f[_0x7de6('0x12')]();});}}}catch(_0x202c0e){logger['error'](_0x7de6('0xc'),_0x59671c,_[_0x7de6('0x1b')](_0x202c0e)?JSON[_0x7de6('0x1a')](_0x202c0e):_0x202c0e);logger[_0x7de6('0x10')](_0x7de6('0x11'),_0x59671c);_0x50e04f['next']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tvox.js b/server/services/routing/server/applications/tvox.js index 60013fa..0dab610 100644 --- a/server/services/routing/server/applications/tvox.js +++ b/server/services/routing/server/applications/tvox.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6f70=['[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','error','isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','../../../../config/logger','routing','consequence','\x20-\x20','replace','includes','push','urlOnAnswer','?params=','urlOnRing','title','jsonrpc','login','params','POST','application/json-rpc','parse','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&sessionId=','then','info'];(function(_0x14265a,_0x369a81){var _0x3f70f5=function(_0x40e530){while(--_0x40e530){_0x14265a['push'](_0x14265a['shift']());}};_0x3f70f5(++_0x369a81);}(_0x6f70,0x147));var _0x06f7=function(_0x393960,_0x25d7e2){_0x393960=_0x393960-0x0;var _0x1c1de9=_0x6f70[_0x393960];return _0x1c1de9;};'use strict';var rp=require(_0x06f7('0x0'));var logger=require(_0x06f7('0x1'))(_0x06f7('0x2'));var _=require('lodash');var arr=[];exports[_0x06f7('0x3')]=function(_0x456b4f,_0x48bcb4){return function(_0x132f19){var _0x32aead=_0x48bcb4[0xa];var _0x5c7e23=_0x48bcb4[0xb];var _0x406924=_0x48bcb4[0xc];var _0x4d867e=_0x48bcb4[0xd];var _0x55e9c4=_0x48bcb4[0xe];var _0x50661b=_0x48bcb4[0xf]['replace'](/\n/g,_0x06f7('0x4'));var _0xe79280=_0x48bcb4[0x10][_0x06f7('0x5')](/\n/g,'\x20');if(!arr[_0x06f7('0x6')](_0x5c7e23)){arr[_0x06f7('0x7')](_0x5c7e23);var _0x329a1c=_0x48bcb4[0x3];var _0x111d4c=_0x48bcb4[0x4];var _0x14572d=_0x48bcb4[0x1];var _0x24c933=_0x48bcb4[0x0];var _0x18e5c3={};_0x18e5c3[_0x06f7('0x8')]=_0x48bcb4[0x8]+_0x06f7('0x9')+_0x406924+'|'+_0x32aead+'|'+_0x4d867e+'|'+_0x5c7e23+'|'+_0x55e9c4;_0x18e5c3[_0x06f7('0xa')]=_0x48bcb4[0x7]+_0x06f7('0x9')+_0x406924+'|'+_0x32aead+'|'+_0x4d867e+'|'+_0x5c7e23+'|'+_0x55e9c4+'|'+_0x50661b+'|'+_0xe79280;_0x18e5c3[_0x06f7('0xb')]=_0x48bcb4[0x9];var _0x329b3b={};_0x329b3b[_0x06f7('0xc')]='2.0';_0x329b3b['method']=_0x06f7('0xd');var _0x34c2eb=[];_0x34c2eb[_0x06f7('0x7')](_0x48bcb4[0x2]);_0x34c2eb[_0x06f7('0x7')](_0x48bcb4[0x5]);_0x34c2eb[_0x06f7('0x7')](_0x48bcb4[0x6]);_0x329b3b[_0x06f7('0xe')]=_0x34c2eb;_0x329b3b['id']=0x1;var _0x49ef1b=JSON['stringify'](_0x329b3b);var _0x24cdec={'encoding':'utf8','method':_0x06f7('0xf'),'timeout':0x2710,'url':_0x329a1c,'headers':{'Content-Type':_0x06f7('0x10')},'body':_0x49ef1b};return rp(_0x24cdec)['then'](function(_0x464f89){const _0x376e26=JSON[_0x06f7('0x11')](_0x464f89);if(!_0x376e26[_0x06f7('0x12')][_0x06f7('0x13')]){throw new Error(_0x06f7('0x14'));}var _0xafbb77=_0x5c7e23;var _0x114624=_0x06f7('0x15')+_0x14572d+'&serviceId='+_0x24c933+_0x06f7('0x16')+_0xafbb77+'&data='+JSON['stringify'](_0x18e5c3);var _0xd6ca0=_0x111d4c+'?'+_0x114624;return rp(_0xd6ca0);})[_0x06f7('0x17')](function(_0x4beeea){logger[_0x06f7('0x18')](_0x06f7('0x19'),_0x456b4f,_0x4beeea);_0x132f19[_0x06f7('0x1a')]();})[_0x06f7('0x1b')](function(_0x147c86){logger[_0x06f7('0x1c')]('[%s][TVOX]\x20%s',_0x456b4f,_[_0x06f7('0x1d')](_0x147c86)?JSON['stringify'](_0x147c86):_0x147c86);_0x132f19['stop']();});}else{logger[_0x06f7('0x18')](_0x06f7('0x1e'),_0x456b4f);_0x132f19[_0x06f7('0x1f')]();}};}; \ No newline at end of file +var _0xa0bb=['push','urlOnAnswer','?params=','urlOnRing','title','2.0','method','login','params','utf8','POST','application/json-rpc','then','parse','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','&serviceId=','&sessionId=','&data=','stringify','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','[%s][TVOX]\x20%s','isObject','info','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','../../../../config/logger','routing','lodash','replace','\x20-\x20','includes'];(function(_0x4242c3,_0x5bf663){var _0x1b1b66=function(_0x59b941){while(--_0x59b941){_0x4242c3['push'](_0x4242c3['shift']());}};_0x1b1b66(++_0x5bf663);}(_0xa0bb,0xe7));var _0xba0b=function(_0x2779b6,_0x552f58){_0x2779b6=_0x2779b6-0x0;var _0x1f6452=_0xa0bb[_0x2779b6];return _0x1f6452;};'use strict';var rp=require(_0xba0b('0x0'));var logger=require(_0xba0b('0x1'))(_0xba0b('0x2'));var _=require(_0xba0b('0x3'));var arr=[];exports['consequence']=function(_0x248966,_0xc34e99){return function(_0xedceb8){var _0x3ee648=_0xc34e99[0xa];var _0x277bdf=_0xc34e99[0xb];var _0xac3210=_0xc34e99[0xc];var _0x18c06e=_0xc34e99[0xd];var _0x318e71=_0xc34e99[0xe];var _0x5cc1ef=_0xc34e99[0xf][_0xba0b('0x4')](/\n/g,_0xba0b('0x5'));var _0x1ff713=_0xc34e99[0x10][_0xba0b('0x4')](/\n/g,'\x20');if(!arr[_0xba0b('0x6')](_0x277bdf)){arr[_0xba0b('0x7')](_0x277bdf);var _0x1f306b=_0xc34e99[0x3];var _0x5f4ca0=_0xc34e99[0x4];var _0x15254d=_0xc34e99[0x1];var _0x1610df=_0xc34e99[0x0];var _0x150c18={};_0x150c18[_0xba0b('0x8')]=_0xc34e99[0x8]+_0xba0b('0x9')+_0xac3210+'|'+_0x3ee648+'|'+_0x18c06e+'|'+_0x277bdf+'|'+_0x318e71;_0x150c18[_0xba0b('0xa')]=_0xc34e99[0x7]+_0xba0b('0x9')+_0xac3210+'|'+_0x3ee648+'|'+_0x18c06e+'|'+_0x277bdf+'|'+_0x318e71+'|'+_0x5cc1ef+'|'+_0x1ff713;_0x150c18[_0xba0b('0xb')]=_0xc34e99[0x9];var _0x5789e8={};_0x5789e8['jsonrpc']=_0xba0b('0xc');_0x5789e8[_0xba0b('0xd')]=_0xba0b('0xe');var _0x580448=[];_0x580448[_0xba0b('0x7')](_0xc34e99[0x2]);_0x580448[_0xba0b('0x7')](_0xc34e99[0x5]);_0x580448['push'](_0xc34e99[0x6]);_0x5789e8[_0xba0b('0xf')]=_0x580448;_0x5789e8['id']=0x1;var _0x549281=JSON['stringify'](_0x5789e8);var _0x4148a0={'encoding':_0xba0b('0x10'),'method':_0xba0b('0x11'),'timeout':0x2710,'url':_0x1f306b,'headers':{'Content-Type':_0xba0b('0x12')},'body':_0x549281};return rp(_0x4148a0)[_0xba0b('0x13')](function(_0x2b057b){const _0x5c3819=JSON[_0xba0b('0x14')](_0x2b057b);if(!_0x5c3819[_0xba0b('0x15')][_0xba0b('0x16')]){throw new Error(_0xba0b('0x17'));}var _0x9d0e8a=_0x277bdf;var _0x3ab664='channelId='+_0x15254d+_0xba0b('0x18')+_0x1610df+_0xba0b('0x19')+_0x9d0e8a+_0xba0b('0x1a')+JSON[_0xba0b('0x1b')](_0x150c18);var _0x1b7a82=_0x5f4ca0+'?'+_0x3ab664;return rp(_0x1b7a82);})[_0xba0b('0x13')](function(_0xeddeb3){logger['info'](_0xba0b('0x1c'),_0x248966,_0xeddeb3);_0xedceb8['stop']();})['catch'](function(_0x547634){logger['error'](_0xba0b('0x1d'),_0x248966,_[_0xba0b('0x1e')](_0x547634)?JSON[_0xba0b('0x1b')](_0x547634):_0x547634);_0xedceb8['stop']();});}else{logger[_0xba0b('0x1f')](_0xba0b('0x20'),_0x248966);_0xedceb8[_0xba0b('0x21')]();}};}; \ 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 4bcdb7b..bd300e3 100644 --- a/server/services/routing/server/applications/utils.js +++ b/server/services/routing/server/applications/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0x150bd5,_0x4345a3){var _0x370b3d=function(_0x48acd4){while(--_0x48acd4){_0x150bd5['push'](_0x150bd5['shift']());}};_0x370b3d(++_0x4345a3);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Mustache=require(_0x0d8b('0x0'));var _=require(_0x0d8b('0x1'));module['exports']={'getMustacheRender':function(_0x585166,_0x4b72b0){return Mustache[_0x0d8b('0x2')](_0x585166,_[_0x0d8b('0x3')](_0x4b72b0[_0x0d8b('0x4')],{'contact':_0x4b72b0[_0x0d8b('0x5')],'message':_0x4b72b0[_0x0d8b('0x6')],'account':_0x4b72b0['account'],'interaction':_0x4b72b0['interaction'],'list':_0x4b72b0[_0x0d8b('0x7')]}))||'';}}; \ No newline at end of file +var _0xa9e0=['message','account','interaction','mustache','lodash','exports','render','body','contact'];(function(_0x3ae292,_0x212d48){var _0x66d605=function(_0x2137d1){while(--_0x2137d1){_0x3ae292['push'](_0x3ae292['shift']());}};_0x66d605(++_0x212d48);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'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 diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index d165602..7564717 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 _0x2e6f=['length','join','app','autoreply','appdata','mail','push','slice','dialogflow','dialogflowv2','split','amazonlex','tag','TagId','getMustacheRender','account','notificationTemplate','ContactId','body','%s:%s:%s','condition','intervals','consequence','priority','Push\x20new\x20rule','\x20|\x20','execute','info','Applications\x20executed','matchPath','emit','complete','Skipped\x20routing\x20for\x20%s','No\x20applications\x20to\x20execute','error','routing\x20is\x20empty','agent','agents','busy','busyQueue','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','stack','message\x20is\x20empty','capacity','hasOwnProperty','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','find','chatQueues','available','name','paused','waiting','mailQueues','loggedIn','openchannelQueues','smsQueues','faxQueues','whatsappQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','http','127.0.0.1','log','lodash','path','bluebird','./applications/strategy/util','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/smsQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','message','interaction','checkWaitingNotifications','applications'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x2e6f,0x173));var _0xf2e6=function(_0xc037a1,_0x5a319e){_0xc037a1=_0xc037a1-0x0;var _0x107638=_0x2e6f[_0xc037a1];return _0x107638;};'use strict';var _=require(_0xf2e6('0x0'));var util=require('util');var path=require(_0xf2e6('0x1'));var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require(_0xf2e6('0x2'));var utils=require('./applications/utils');var sUtils=require(_0xf2e6('0x3'));var logger=require(_0xf2e6('0x4'))(_0xf2e6('0x5'));var rpc={'openchannelQueueReport':require(_0xf2e6('0x6')),'mailQueueReport':require(_0xf2e6('0x7')),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require(_0xf2e6('0x8')),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require(_0xf2e6('0x9'))};var RuleEngine=require(_0xf2e6('0xa'));function getId(_0x14f21a,_0x360b07,_0x431fd3){return util[_0xf2e6('0xb')](_0xf2e6('0xc'),_0x14f21a,_0x360b07||0x0,_0x431fd3||0x0);}function getIntervals(_0x50bf90,_0x4d7a62){var _0x3b4bb0=[];if(!_[_0xf2e6('0xd')](_0x4d7a62[_0xf2e6('0xe')])&&!_[_0xf2e6('0xd')](_0x50bf90[_0x4d7a62[_0xf2e6('0xe')]])&&!_[_0xf2e6('0xd')](_0x50bf90[_0x4d7a62[_0xf2e6('0xe')]][_0xf2e6('0xf')])){_0x3b4bb0=_[_0xf2e6('0x10')](_0x50bf90[_0x4d7a62[_0xf2e6('0xe')]][_0xf2e6('0xf')],_0xf2e6('0x11'));}else if(!_[_0xf2e6('0xd')](_0x4d7a62[_0xf2e6('0x11')])){_0x3b4bb0=[_0x4d7a62[_0xf2e6('0x11')]];}return _0x3b4bb0;}exports[_0xf2e6('0x12')]=function(_0x1bd413){_0x1bd413[_0xf2e6('0x13')]={};return new BPromise(function(_0x3df94e,_0x23131f){var _0x42e326={'Start':function(_0x3221fa){var _0x386cd2=this;return new Promise(function(_0x56a12d,_0x5c5308){if(_0x3221fa){try{var _0x19396e=[];var _0x132993=getId(_0x3221fa[_0xf2e6('0x14')],_0x3221fa[_0xf2e6('0x15')]?_0x3221fa[_0xf2e6('0x15')]['id']:0x0,_0x3221fa[_0xf2e6('0x16')]?_0x3221fa[_0xf2e6('0x16')]['id']:0x0);var _0x2763ef=sUtils[_0xf2e6('0x17')](_0x1bd413,_0x3221fa);if(!_0x2763ef&&_0x3221fa[_0xf2e6('0x18')]&&_['isArray'](_0x3221fa['applications'])&&_0x3221fa['applications'][_0xf2e6('0x19')]){for(var _0x54f231=0x0;_0x54f231<_0x3221fa[_0xf2e6('0x18')][_0xf2e6('0x19')];_0x54f231+=0x1){var _0x45178b=_0x3221fa[_0xf2e6('0x18')][_0x54f231];if(fs['existsSync'](path[_0xf2e6('0x1a')](__dirname,_0xf2e6('0x18'),_0x45178b[_0xf2e6('0x1b')]+'.js'))){var _0x48cb36=[];switch(_0x45178b[_0xf2e6('0x1b')]['toLowerCase']()){case _0xf2e6('0x1c'):var _0x7373da=_0x45178b[_0xf2e6('0x1d')]['split'](',');if(_0x3221fa['channel']===_0xf2e6('0x1e')){_0x48cb36[_0xf2e6('0x1f')](_0x7373da[0x0]);_0x48cb36['push'](_0x7373da[0x1]);_0x48cb36[_0xf2e6('0x1f')](_0x7373da[_0xf2e6('0x20')](0x2,_0x7373da['length'])[_0xf2e6('0x1a')](','));}else{_0x48cb36[_0xf2e6('0x1f')](_0x7373da[0x0]);_0x48cb36[_0xf2e6('0x1f')](_0x7373da[_0xf2e6('0x20')](0x1,_0x7373da[_0xf2e6('0x19')])['join'](','));}break;case _0xf2e6('0x21'):var _0x570cfb=_0x45178b[_0xf2e6('0x1d')]['split'](',');_0x48cb36[_0xf2e6('0x1f')](_0x570cfb[0x0]);_0x48cb36['push'](_0x570cfb[0x1]);_0x48cb36[_0xf2e6('0x1f')](_0x570cfb[_0xf2e6('0x20')](0x2,_0x570cfb[_0xf2e6('0x19')])['join'](','));break;case _0xf2e6('0x22'):var _0x5f57af=_0x45178b[_0xf2e6('0x1d')][_0xf2e6('0x23')](',');_0x48cb36['push'](_0x5f57af[0x0]);_0x48cb36[_0xf2e6('0x1f')](_0x5f57af[0x1]);_0x48cb36[_0xf2e6('0x1f')](_0x5f57af[0x2]);_0x48cb36['push'](_0x5f57af[0x3]);_0x48cb36[_0xf2e6('0x1f')](_0x5f57af[_0xf2e6('0x20')](0x4,_0x5f57af[_0xf2e6('0x19')])['join'](','));break;case _0xf2e6('0x24'):var _0x56564a=_0x45178b[_0xf2e6('0x1d')]['split'](',');_0x48cb36[_0xf2e6('0x1f')](_0x56564a[0x0]);_0x48cb36[_0xf2e6('0x1f')](_0x56564a[0x1]);_0x48cb36['push'](_0x56564a[0x2]);_0x48cb36[_0xf2e6('0x1f')](_0x56564a[0x3]);_0x48cb36[_0xf2e6('0x1f')](_0x56564a[_0xf2e6('0x20')](0x4,_0x56564a[_0xf2e6('0x19')])[_0xf2e6('0x1a')](','));break;case'message':_0x48cb36[_0xf2e6('0x1f')](_0x45178b[_0xf2e6('0x1d')]);break;case _0xf2e6('0x25'):_0x48cb36[_0xf2e6('0x1f')](_0x45178b[_0xf2e6('0x26')]);_0x48cb36['push'](_0x45178b[_0xf2e6('0x1d')]);break;case'tvox':var _0x3b6aff=utils[_0xf2e6('0x27')](_0x3221fa[_0xf2e6('0x28')][_0xf2e6('0x29')],_0x3221fa);var _0x4815ad=_0x45178b[_0xf2e6('0x1d')]['split'](',');_0x48cb36[_0xf2e6('0x1f')](_0x4815ad[0x0]);_0x48cb36[_0xf2e6('0x1f')](_0x4815ad[0x1]);_0x48cb36[_0xf2e6('0x1f')](_0x4815ad[0x2]);_0x48cb36[_0xf2e6('0x1f')](_0x4815ad[0x3]);_0x48cb36[_0xf2e6('0x1f')](_0x4815ad[0x4]);_0x48cb36[_0xf2e6('0x1f')](_0x4815ad[0x5]);_0x48cb36[_0xf2e6('0x1f')](_0x4815ad[0x6]);_0x48cb36[_0xf2e6('0x1f')](_0x4815ad[0x7]);_0x48cb36[_0xf2e6('0x1f')](_0x4815ad[0x8]);_0x48cb36['push'](_0x4815ad[0x9]);_0x48cb36['push'](_0x4815ad[0xa]);_0x48cb36[_0xf2e6('0x1f')](_0x3221fa[_0xf2e6('0x16')]['id']);_0x48cb36['push'](_0x3221fa[_0xf2e6('0x15')]['id']);_0x48cb36[_0xf2e6('0x1f')](_0x45178b['ChatWebsiteId']);_0x48cb36[_0xf2e6('0x1f')](_0x3221fa[_0xf2e6('0x16')][_0xf2e6('0x2a')]);_0x48cb36['push'](_0x3221fa[_0xf2e6('0x2b')]['body']);_0x48cb36[_0xf2e6('0x1f')](_0x3b6aff);break;default:_0x48cb36=_[_0xf2e6('0xd')](_0x45178b['appdata'])?[]:_0x45178b[_0xf2e6('0x1d')]['split'](',');}var _0x153356={'id':util[_0xf2e6('0xb')](_0xf2e6('0x2c'),_0x132993,_0x45178b['id'],_0x45178b['app']),'condition':require('./interval')[_0xf2e6('0x2d')](_0x132993,getIntervals(_0x1bd413[_0xf2e6('0x2e')],_0x45178b),_0x1bd413),'consequence':require('./applications/'+_0x45178b[_0xf2e6('0x1b')])[_0xf2e6('0x2f')](_0x132993,_0x48cb36,_0x1bd413,_0x3221fa),'p':_0x45178b[_0xf2e6('0x30')]||0x0};logger['info'](_0xf2e6('0x31'),_0x153356['id'],'on\x20interval',getIntervals(_0x1bd413['intervals'],_0x45178b)[_0xf2e6('0x1a')](_0xf2e6('0x32')));_0x19396e[_0xf2e6('0x1f')](_0x153356);}else{logger['error']('Please\x20create\x20a\x20new\x20file\x20under',path[_0xf2e6('0x1a')](__dirname,_0xf2e6('0x18'),_0x45178b[_0xf2e6('0x1b')]+'.js'));}}_0x1bd413[_0xf2e6('0x13')][_0x132993]=new RuleEngine(_0x19396e);_0x1bd413[_0xf2e6('0x13')][_0x132993][_0xf2e6('0x33')](_0x3221fa,function(_0x7db4b7){logger[_0xf2e6('0x34')](_0xf2e6('0x35'),JSON['stringify'](_0x7db4b7[_0xf2e6('0x36')]));if(_0x1bd413['rules'][_0x132993]){_0x1bd413[_0xf2e6('0x13')][_0x132993][_0xf2e6('0x37')](_0xf2e6('0x38'));}});return _0x56a12d({'code':0xc8,'message':_0x3221fa});}else{if(_0x2763ef){logger[_0xf2e6('0x34')](util[_0xf2e6('0xb')](_0xf2e6('0x39'),_0x132993));}else{logger[_0xf2e6('0x34')](_0xf2e6('0x3a'));}return _0x56a12d({'code':0xc8,'message':_0x3221fa});}}catch(_0xbcf22a){logger[_0xf2e6('0x3b')](_0xbcf22a['stack']);return _0x5c5308(_0x386cd2[_0xf2e6('0x3b')](0x1f4,_0xbcf22a));}}return _0x5c5308(_0xf2e6('0x3c'));});},'AcceptMessage':function(_0x475ecf){var _0x43c202=this;return new Promise(function(_0x4653d9,_0x46a10e){if(_0x475ecf[_0xf2e6('0x3d')]&&_0x475ecf['agent']['id']){if(_0x1bd413[_0xf2e6('0x3e')][_0x475ecf['agent']['id']]){_0x1bd413[_0xf2e6('0x3e')][_0x475ecf['agent']['id']][_0xf2e6('0x3f')]=![];_0x1bd413['agents'][_0x475ecf[_0xf2e6('0x3d')]['id']][_0xf2e6('0x40')]=undefined;}}if(_0x475ecf[_0xf2e6('0x15')]&&_0x475ecf[_0xf2e6('0x15')]['id']){try{var _0x326913=getId(_0x475ecf[_0xf2e6('0x14')],_0x475ecf[_0xf2e6('0x15')]?_0x475ecf['message']['id']:0x0,_0x475ecf[_0xf2e6('0x16')]?_0x475ecf[_0xf2e6('0x16')]['id']:0x0);if(_0x1bd413[_0xf2e6('0x13')][_0x326913]){_0x1bd413[_0xf2e6('0x13')][_0x326913][_0xf2e6('0x37')](_0xf2e6('0x41'));if(rpc[_0x475ecf['channel']+'QueueReport']){rpc[_0x475ecf[_0xf2e6('0x14')]+_0xf2e6('0x42')][_0xf2e6('0x43')](_0x326913,{'UserId':_0x475ecf[_0xf2e6('0x15')][_0xf2e6('0x44')]})[_0xf2e6('0x45')](function(){logger[_0xf2e6('0x3b')](_0xf2e6('0x46'));});}}return _0x4653d9({'code':0xc8,'message':_0x475ecf});}catch(_0xdc009){logger[_0xf2e6('0x3b')](_0xdc009[_0xf2e6('0x47')]);return _0x46a10e(_0x43c202[_0xf2e6('0x3b')](0x1f4,_0xdc009));}}logger[_0xf2e6('0x3b')]('message\x20is\x20empty');return _0x46a10e(_0x43c202['error'](0x1f4,_0xf2e6('0x48')));});},'RejectMessage':function(_0x137156){var _0x1f1da1=this;return new Promise(function(_0x353ad4,_0x4a3c6a){if(_0x137156[_0xf2e6('0x3d')]&&_0x137156[_0xf2e6('0x3d')]['id']){try{if(_0x1bd413[_0xf2e6('0x3e')][_0x137156[_0xf2e6('0x3d')]['id']]){_0x1bd413[_0xf2e6('0x3e')][_0x137156[_0xf2e6('0x3d')]['id']][_0xf2e6('0x3f')]=![];_0x1bd413[_0xf2e6('0x3e')][_0x137156[_0xf2e6('0x3d')]['id']][_0xf2e6('0x40')]=undefined;}return _0x353ad4({'code':0xc8,'message':_0x137156});}catch(_0x2fda9c){logger['error'](_0x2fda9c[_0xf2e6('0x47')]);return _0x4a3c6a(_0x1f1da1[_0xf2e6('0x3b')](0x1f4,_0x2fda9c));}}logger[_0xf2e6('0x3b')](_0xf2e6('0x48'));return _0x4a3c6a(_0x1f1da1[_0xf2e6('0x3b')](0x1f4,_0xf2e6('0x48')));});},'AbandonInteraction':function(_0x670caf){var _0x5a59d4=this;return new Promise(function(_0x1c3eca,_0xdbec3a){if(_0x670caf['channel']&&_0x670caf['interaction']&&_0x670caf[_0xf2e6('0x16')]['id']){try{var _0x3f5ea8=getId(_0x670caf[_0xf2e6('0x14')],_0x670caf['message']?_0x670caf[_0xf2e6('0x15')]['id']:0x0,_0x670caf[_0xf2e6('0x16')]?_0x670caf[_0xf2e6('0x16')]['id']:0x0);if(_0x1bd413[_0xf2e6('0x13')][_0x3f5ea8]){_0x1bd413[_0xf2e6('0x13')][_0x3f5ea8][_0xf2e6('0x37')](_0xf2e6('0x41'));}return _0x1c3eca({'code':0xc8,'message':_0x670caf});}catch(_0x461810){logger[_0xf2e6('0x3b')](_0x461810[_0xf2e6('0x47')]);return _0xdbec3a(_0x5a59d4[_0xf2e6('0x3b')](0x1f4,_0x461810));}}logger[_0xf2e6('0x3b')](_0xf2e6('0x48'));return _0xdbec3a(_0x5a59d4[_0xf2e6('0x3b')](0x1f4,_0xf2e6('0x48')));});},'AgentCapacity':function(_0x1a6b24){var _0x3779dc=this;return new Promise(function(_0x455322,_0x3f36ef){if(_0x1bd413[_0xf2e6('0x3e')]['hasOwnProperty'](_0x1a6b24['id'])){for(var _0x22f1f4 in _0x1a6b24[_0xf2e6('0x49')]){if(_0x1a6b24['capacity'][_0xf2e6('0x4a')](_0x22f1f4)){if(_0x1bd413[_0xf2e6('0x3e')][_0x1a6b24['id']]['hasOwnProperty'](_0x22f1f4+_0xf2e6('0x4b'))){_0x1bd413[_0xf2e6('0x3e')][_0x1a6b24['id']][_0x22f1f4+_0xf2e6('0x4b')]=parseInt(_0x1a6b24[_0xf2e6('0x49')][_0x22f1f4],0xa);}}}_0x1bd413[_0xf2e6('0x3e')][_0x1a6b24['id']][_0xf2e6('0x4c')]();return _0x455322({'code':0xc8,'message':_0x1bd413[_0xf2e6('0x3e')][_0x1a6b24['id']]});}else{return _0x3f36ef(_0x3779dc[_0xf2e6('0x3b')](0x1f4,_0xf2e6('0x4d')));}});},'Agents':function(_0x4c760f){return new Promise(function(_0x5531c6){var _0x4d34e1=_[_0xf2e6('0x4e')](_0x1bd413[_0xf2e6('0x3e')]);if(_0x4c760f&&_0x4c760f['id']){var _0x64b62c=_[_0xf2e6('0x4f')](_0x4d34e1,function(_0x2b9230){return _0x2b9230['id']===_0x4c760f['id'];});_0x5531c6(_0x64b62c);}else{_0x5531c6({'count':_0x4d34e1[_0xf2e6('0x19')],'rows':_0x4d34e1});}});},'ChatQueues':function(){return new Promise(function(_0x54d5df){var _0x137407=[];for(var _0x30d5e0 in _0x1bd413[_0xf2e6('0x50')]){if(_0x1bd413[_0xf2e6('0x50')][_0xf2e6('0x4a')](_0x30d5e0)){var _0x54570d=_0x1bd413[_0xf2e6('0x50')][_0x30d5e0];var _0x4f5df4={'id':_0x54570d['id'],'available':_0x54570d[_0xf2e6('0x51')],'loggedIn':_0x54570d['loggedIn'],'name':_0x54570d[_0xf2e6('0x52')],'paused':_0x54570d[_0xf2e6('0x53')],'waiting':_0x54570d[_0xf2e6('0x54')]};_0x137407['push'](_0x4f5df4);}}_0x54d5df({'count':_0x137407['length'],'rows':_0x137407});});},'MailQueues':function(){return new Promise(function(_0x12394c){var _0x3c14ef=[];for(var _0x35c6df in _0x1bd413['mailQueues']){if(_0x1bd413[_0xf2e6('0x55')][_0xf2e6('0x4a')](_0x35c6df)){var _0x19340d=_0x1bd413[_0xf2e6('0x55')][_0x35c6df];var _0x137aff={'id':_0x19340d['id'],'available':_0x19340d[_0xf2e6('0x51')],'loggedIn':_0x19340d[_0xf2e6('0x56')],'name':_0x19340d[_0xf2e6('0x52')],'paused':_0x19340d[_0xf2e6('0x53')],'waiting':_0x19340d[_0xf2e6('0x54')]};_0x3c14ef[_0xf2e6('0x1f')](_0x137aff);}}_0x12394c({'count':_0x3c14ef[_0xf2e6('0x19')],'rows':_0x3c14ef});});},'OpenchannelQueues':function(){return new Promise(function(_0x473a87){var _0x56eda2=[];for(var _0x4ce98c in _0x1bd413['openchannelQueues']){if(_0x1bd413[_0xf2e6('0x57')]['hasOwnProperty'](_0x4ce98c)){var _0x223b13=_0x1bd413[_0xf2e6('0x57')][_0x4ce98c];var _0xc7c9ac={'id':_0x223b13['id'],'available':_0x223b13['available'],'loggedIn':_0x223b13[_0xf2e6('0x56')],'name':_0x223b13[_0xf2e6('0x52')],'paused':_0x223b13[_0xf2e6('0x53')],'waiting':_0x223b13[_0xf2e6('0x54')]};_0x56eda2['push'](_0xc7c9ac);}}_0x473a87({'count':_0x56eda2[_0xf2e6('0x19')],'rows':_0x56eda2});});},'SmsQueues':function(){return new Promise(function(_0xc535f4){var _0x3b1922=[];for(var _0x113a11 in _0x1bd413[_0xf2e6('0x58')]){if(_0x1bd413[_0xf2e6('0x58')][_0xf2e6('0x4a')](_0x113a11)){var _0x234073=_0x1bd413['smsQueues'][_0x113a11];var _0x4e97db={'id':_0x234073['id'],'available':_0x234073[_0xf2e6('0x51')],'loggedIn':_0x234073[_0xf2e6('0x56')],'name':_0x234073['name'],'paused':_0x234073[_0xf2e6('0x53')],'waiting':_0x234073[_0xf2e6('0x54')]};_0x3b1922[_0xf2e6('0x1f')](_0x4e97db);}}_0xc535f4({'count':_0x3b1922['length'],'rows':_0x3b1922});});},'FaxQueues':function(){return new Promise(function(_0x245cfb){var _0x9257de=[];for(var _0x324708 in _0x1bd413[_0xf2e6('0x59')]){if(_0x1bd413[_0xf2e6('0x59')][_0xf2e6('0x4a')](_0x324708)){var _0x419e85=_0x1bd413[_0xf2e6('0x59')][_0x324708];var _0x3b735d={'id':_0x419e85['id'],'available':_0x419e85[_0xf2e6('0x51')],'loggedIn':_0x419e85[_0xf2e6('0x56')],'name':_0x419e85[_0xf2e6('0x52')],'paused':_0x419e85['paused'],'waiting':_0x419e85[_0xf2e6('0x54')]};_0x9257de[_0xf2e6('0x1f')](_0x3b735d);}}_0x245cfb({'count':_0x9257de[_0xf2e6('0x19')],'rows':_0x9257de});});},'WhatsappQueues':function(){return new Promise(function(_0x5765ef){var _0x1ca3a7=[];for(var _0x508f69 in _0x1bd413[_0xf2e6('0x5a')]){if(_0x1bd413[_0xf2e6('0x5a')][_0xf2e6('0x4a')](_0x508f69)){var _0x371c82=_0x1bd413[_0xf2e6('0x5a')][_0x508f69];var _0x26e54f={'id':_0x371c82['id'],'available':_0x371c82[_0xf2e6('0x51')],'loggedIn':_0x371c82['loggedIn'],'name':_0x371c82[_0xf2e6('0x52')],'paused':_0x371c82[_0xf2e6('0x53')],'waiting':_0x371c82['waiting']};_0x1ca3a7['push'](_0x26e54f);}}_0x5765ef({'count':_0x1ca3a7[_0xf2e6('0x19')],'rows':_0x1ca3a7});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0xd2870f){var _0x4c3199=_[_0xf2e6('0x4e')](_0x1bd413['chatQueuesWaitingInteractions']);_0xd2870f({'count':_0x4c3199[_0xf2e6('0x19')],'rows':_0x4c3199});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x33f972){var _0x2088e0=_[_0xf2e6('0x4e')](_0x1bd413[_0xf2e6('0x5b')]);_0x33f972({'count':_0x2088e0['length'],'rows':_0x2088e0});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x122ce9){var _0x14b4cc=_[_0xf2e6('0x4e')](_0x1bd413[_0xf2e6('0x5c')]);_0x122ce9({'count':_0x14b4cc[_0xf2e6('0x19')],'rows':_0x14b4cc});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x1e4388){var _0x1f18f5=_[_0xf2e6('0x4e')](_0x1bd413[_0xf2e6('0x5d')]);_0x1e4388({'count':_0x1f18f5['length'],'rows':_0x1f18f5});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x1679db){var _0x41c3ef=_[_0xf2e6('0x4e')](_0x1bd413[_0xf2e6('0x5e')]);_0x1679db({'count':_0x41c3ef[_0xf2e6('0x19')],'rows':_0x41c3ef});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x3a43b4){var _0x88c48b=_['values'](_0x1bd413['whatsappQueuesWaitingInteractions']);_0x3a43b4({'count':_0x88c48b[_0xf2e6('0x19')],'rows':_0x88c48b});});}};var _0x1a23ae=jayson[_0xf2e6('0x5f')](_0x42e326)[_0xf2e6('0x60')]();_0x1a23ae['on']('error',function(_0x3e81b0){logger[_0xf2e6('0x3b')](JSON['stringify'](_0x3e81b0));return _0x23131f(_0x3e81b0);});_0x1a23ae[_0xf2e6('0x12')](0x232c,_0xf2e6('0x61'),function(){console[_0xf2e6('0x62')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x3df94e('RPC\x20listening\x20on\x20port:'+0x232c);});});}; \ No newline at end of file +var _0x324b=['capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','find','chatQueues','name','paused','mailQueues','available','loggedIn','openchannelQueues','waiting','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','./applications/utils','./applications/strategy/util','../../../config/logger','routing','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','%s.%s.%s','isNil','IntervalId','Intervals','interval','listen','rules','channel','message','interaction','checkWaitingNotifications','isArray','applications','length','app','.js','toLowerCase','autoreply','appdata','split','mail','push','slice','join','dialogflowv2','amazonlex','TagId','tvox','getMustacheRender','notificationTemplate','ChatWebsiteId','ContactId','body','%s:%s:%s','./interval','condition','intervals','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','stringify','emit','complete','format','Skipped\x20routing\x20for\x20%s','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','busy','busyQueue','QueueReport','UserId','catch','message\x20is\x20empty','end','hasOwnProperty'];(function(_0x17406a,_0x1e2320){var _0x1501ff=function(_0x4b075a){while(--_0x4b075a){_0x17406a['push'](_0x17406a['shift']());}};_0x1501ff(++_0x1e2320);}(_0x324b,0x1b1));var _0xb324=function(_0x38886f,_0x2774df){_0x38886f=_0x38886f-0x0;var _0x56449d=_0x324b[_0x38886f];return _0x56449d;};'use strict';var _=require(_0xb324('0x0'));var util=require(_0xb324('0x1'));var path=require('path');var fs=require('fs');var jayson=require(_0xb324('0x2'));var BPromise=require('bluebird');var utils=require(_0xb324('0x3'));var sUtils=require(_0xb324('0x4'));var logger=require(_0xb324('0x5'))(_0xb324('0x6'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0xb324('0x7')),'chatQueueReport':require(_0xb324('0x8')),'smsQueueReport':require(_0xb324('0x9')),'faxQueueReport':require(_0xb324('0xa')),'whatsappQueueReport':require(_0xb324('0xb'))};var RuleEngine=require(_0xb324('0xc'));function getId(_0x150bd0,_0x134128,_0x47bfd2){return util['format'](_0xb324('0xd'),_0x150bd0,_0x134128||0x0,_0x47bfd2||0x0);}function getIntervals(_0x4514ec,_0x64d393){var _0x53ddcf=[];if(!_[_0xb324('0xe')](_0x64d393[_0xb324('0xf')])&&!_[_0xb324('0xe')](_0x4514ec[_0x64d393[_0xb324('0xf')]])&&!_[_0xb324('0xe')](_0x4514ec[_0x64d393[_0xb324('0xf')]][_0xb324('0x10')])){_0x53ddcf=_['map'](_0x4514ec[_0x64d393[_0xb324('0xf')]]['Intervals'],_0xb324('0x11'));}else if(!_[_0xb324('0xe')](_0x64d393[_0xb324('0x11')])){_0x53ddcf=[_0x64d393[_0xb324('0x11')]];}return _0x53ddcf;}exports[_0xb324('0x12')]=function(_0x41dbc3){_0x41dbc3[_0xb324('0x13')]={};return new BPromise(function(_0x28b787,_0x12ea42){var _0x2bf9f5={'Start':function(_0x23e007){var _0x1a90db=this;return new Promise(function(_0x50c315,_0x1fd4e6){if(_0x23e007){try{var _0x5e74e5=[];var _0x1a33c7=getId(_0x23e007[_0xb324('0x14')],_0x23e007[_0xb324('0x15')]?_0x23e007[_0xb324('0x15')]['id']:0x0,_0x23e007[_0xb324('0x16')]?_0x23e007[_0xb324('0x16')]['id']:0x0);var _0x310d5f=sUtils[_0xb324('0x17')](_0x41dbc3,_0x23e007);if(!_0x310d5f&&_0x23e007['applications']&&_[_0xb324('0x18')](_0x23e007[_0xb324('0x19')])&&_0x23e007[_0xb324('0x19')][_0xb324('0x1a')]){for(var _0x371d3d=0x0;_0x371d3d<_0x23e007[_0xb324('0x19')][_0xb324('0x1a')];_0x371d3d+=0x1){var _0x389162=_0x23e007[_0xb324('0x19')][_0x371d3d];if(fs['existsSync'](path['join'](__dirname,'applications',_0x389162[_0xb324('0x1b')]+_0xb324('0x1c')))){var _0x4822e5=[];switch(_0x389162['app'][_0xb324('0x1d')]()){case _0xb324('0x1e'):var _0x829d09=_0x389162[_0xb324('0x1f')][_0xb324('0x20')](',');if(_0x23e007[_0xb324('0x14')]===_0xb324('0x21')){_0x4822e5[_0xb324('0x22')](_0x829d09[0x0]);_0x4822e5[_0xb324('0x22')](_0x829d09[0x1]);_0x4822e5['push'](_0x829d09[_0xb324('0x23')](0x2,_0x829d09[_0xb324('0x1a')])['join'](','));}else{_0x4822e5['push'](_0x829d09[0x0]);_0x4822e5[_0xb324('0x22')](_0x829d09[_0xb324('0x23')](0x1,_0x829d09[_0xb324('0x1a')])['join'](','));}break;case'dialogflow':var _0xec7d8d=_0x389162[_0xb324('0x1f')][_0xb324('0x20')](',');_0x4822e5[_0xb324('0x22')](_0xec7d8d[0x0]);_0x4822e5['push'](_0xec7d8d[0x1]);_0x4822e5[_0xb324('0x22')](_0xec7d8d[_0xb324('0x23')](0x2,_0xec7d8d[_0xb324('0x1a')])[_0xb324('0x24')](','));break;case _0xb324('0x25'):var _0x7baec9=_0x389162['appdata'][_0xb324('0x20')](',');_0x4822e5[_0xb324('0x22')](_0x7baec9[0x0]);_0x4822e5[_0xb324('0x22')](_0x7baec9[0x1]);_0x4822e5[_0xb324('0x22')](_0x7baec9[0x2]);_0x4822e5[_0xb324('0x22')](_0x7baec9[0x3]);_0x4822e5[_0xb324('0x22')](_0x7baec9[_0xb324('0x23')](0x4,_0x7baec9[_0xb324('0x1a')])['join'](','));break;case _0xb324('0x26'):var _0x3ff45a=_0x389162[_0xb324('0x1f')][_0xb324('0x20')](',');_0x4822e5[_0xb324('0x22')](_0x3ff45a[0x0]);_0x4822e5[_0xb324('0x22')](_0x3ff45a[0x1]);_0x4822e5[_0xb324('0x22')](_0x3ff45a[0x2]);_0x4822e5[_0xb324('0x22')](_0x3ff45a[0x3]);_0x4822e5[_0xb324('0x22')](_0x3ff45a[_0xb324('0x23')](0x4,_0x3ff45a['length'])[_0xb324('0x24')](','));break;case _0xb324('0x15'):_0x4822e5['push'](_0x389162[_0xb324('0x1f')]);break;case'tag':_0x4822e5[_0xb324('0x22')](_0x389162[_0xb324('0x27')]);_0x4822e5[_0xb324('0x22')](_0x389162[_0xb324('0x1f')]);break;case _0xb324('0x28'):var _0x59509d=utils[_0xb324('0x29')](_0x23e007['account'][_0xb324('0x2a')],_0x23e007);var _0x25c38c=_0x389162[_0xb324('0x1f')]['split'](',');_0x4822e5['push'](_0x25c38c[0x0]);_0x4822e5['push'](_0x25c38c[0x1]);_0x4822e5['push'](_0x25c38c[0x2]);_0x4822e5[_0xb324('0x22')](_0x25c38c[0x3]);_0x4822e5[_0xb324('0x22')](_0x25c38c[0x4]);_0x4822e5[_0xb324('0x22')](_0x25c38c[0x5]);_0x4822e5[_0xb324('0x22')](_0x25c38c[0x6]);_0x4822e5[_0xb324('0x22')](_0x25c38c[0x7]);_0x4822e5[_0xb324('0x22')](_0x25c38c[0x8]);_0x4822e5['push'](_0x25c38c[0x9]);_0x4822e5[_0xb324('0x22')](_0x25c38c[0xa]);_0x4822e5[_0xb324('0x22')](_0x23e007['interaction']['id']);_0x4822e5['push'](_0x23e007[_0xb324('0x15')]['id']);_0x4822e5[_0xb324('0x22')](_0x389162[_0xb324('0x2b')]);_0x4822e5[_0xb324('0x22')](_0x23e007['interaction'][_0xb324('0x2c')]);_0x4822e5[_0xb324('0x22')](_0x23e007['body'][_0xb324('0x2d')]);_0x4822e5[_0xb324('0x22')](_0x59509d);break;default:_0x4822e5=_[_0xb324('0xe')](_0x389162[_0xb324('0x1f')])?[]:_0x389162['appdata']['split'](',');}var _0x1ad16c={'id':util['format'](_0xb324('0x2e'),_0x1a33c7,_0x389162['id'],_0x389162[_0xb324('0x1b')]),'condition':require(_0xb324('0x2f'))[_0xb324('0x30')](_0x1a33c7,getIntervals(_0x41dbc3[_0xb324('0x31')],_0x389162),_0x41dbc3),'consequence':require('./applications/'+_0x389162[_0xb324('0x1b')])[_0xb324('0x32')](_0x1a33c7,_0x4822e5,_0x41dbc3,_0x23e007),'p':_0x389162[_0xb324('0x33')]||0x0};logger[_0xb324('0x34')](_0xb324('0x35'),_0x1ad16c['id'],_0xb324('0x36'),getIntervals(_0x41dbc3['intervals'],_0x389162)[_0xb324('0x24')](_0xb324('0x37')));_0x5e74e5[_0xb324('0x22')](_0x1ad16c);}else{logger[_0xb324('0x38')](_0xb324('0x39'),path[_0xb324('0x24')](__dirname,'applications',_0x389162[_0xb324('0x1b')]+'.js'));}}_0x41dbc3[_0xb324('0x13')][_0x1a33c7]=new RuleEngine(_0x5e74e5);_0x41dbc3['rules'][_0x1a33c7][_0xb324('0x3a')](_0x23e007,function(_0x312f73){logger[_0xb324('0x34')]('Applications\x20executed',JSON[_0xb324('0x3b')](_0x312f73['matchPath']));if(_0x41dbc3[_0xb324('0x13')][_0x1a33c7]){_0x41dbc3['rules'][_0x1a33c7][_0xb324('0x3c')](_0xb324('0x3d'));}});return _0x50c315({'code':0xc8,'message':_0x23e007});}else{if(_0x310d5f){logger[_0xb324('0x34')](util[_0xb324('0x3e')](_0xb324('0x3f'),_0x1a33c7));}else{logger[_0xb324('0x34')](_0xb324('0x40'));}return _0x50c315({'code':0xc8,'message':_0x23e007});}}catch(_0x3efffe){logger[_0xb324('0x38')](_0x3efffe[_0xb324('0x41')]);return _0x1fd4e6(_0x1a90db['error'](0x1f4,_0x3efffe));}}return _0x1fd4e6(_0xb324('0x42'));});},'AcceptMessage':function(_0x1c33a9){var _0x36bc48=this;return new Promise(function(_0x1e691a,_0x1fe0ca){if(_0x1c33a9[_0xb324('0x43')]&&_0x1c33a9[_0xb324('0x43')]['id']){if(_0x41dbc3[_0xb324('0x44')][_0x1c33a9[_0xb324('0x43')]['id']]){_0x41dbc3[_0xb324('0x44')][_0x1c33a9[_0xb324('0x43')]['id']][_0xb324('0x45')]=![];_0x41dbc3[_0xb324('0x44')][_0x1c33a9[_0xb324('0x43')]['id']][_0xb324('0x46')]=undefined;}}if(_0x1c33a9[_0xb324('0x15')]&&_0x1c33a9[_0xb324('0x15')]['id']){try{var _0x5ee355=getId(_0x1c33a9[_0xb324('0x14')],_0x1c33a9[_0xb324('0x15')]?_0x1c33a9['message']['id']:0x0,_0x1c33a9['interaction']?_0x1c33a9['interaction']['id']:0x0);if(_0x41dbc3[_0xb324('0x13')][_0x5ee355]){_0x41dbc3[_0xb324('0x13')][_0x5ee355][_0xb324('0x3c')]('end');if(rpc[_0x1c33a9[_0xb324('0x14')]+_0xb324('0x47')]){rpc[_0x1c33a9[_0xb324('0x14')]+_0xb324('0x47')]['update'](_0x5ee355,{'UserId':_0x1c33a9[_0xb324('0x15')][_0xb324('0x48')]})[_0xb324('0x49')](function(){logger['error']('error\x20update\x20queue\x20report');});}}return _0x1e691a({'code':0xc8,'message':_0x1c33a9});}catch(_0x28ddee){logger[_0xb324('0x38')](_0x28ddee[_0xb324('0x41')]);return _0x1fe0ca(_0x36bc48['error'](0x1f4,_0x28ddee));}}logger[_0xb324('0x38')](_0xb324('0x4a'));return _0x1fe0ca(_0x36bc48[_0xb324('0x38')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x4138d1){var _0x2620c7=this;return new Promise(function(_0x2a81da,_0x46b898){if(_0x4138d1['agent']&&_0x4138d1[_0xb324('0x43')]['id']){try{if(_0x41dbc3['agents'][_0x4138d1[_0xb324('0x43')]['id']]){_0x41dbc3[_0xb324('0x44')][_0x4138d1[_0xb324('0x43')]['id']]['busy']=![];_0x41dbc3['agents'][_0x4138d1[_0xb324('0x43')]['id']][_0xb324('0x46')]=undefined;}return _0x2a81da({'code':0xc8,'message':_0x4138d1});}catch(_0x345d2d){logger[_0xb324('0x38')](_0x345d2d['stack']);return _0x46b898(_0x2620c7[_0xb324('0x38')](0x1f4,_0x345d2d));}}logger[_0xb324('0x38')]('message\x20is\x20empty');return _0x46b898(_0x2620c7['error'](0x1f4,_0xb324('0x4a')));});},'AbandonInteraction':function(_0x57b85c){var _0x4aa335=this;return new Promise(function(_0x3ee550,_0x466653){if(_0x57b85c['channel']&&_0x57b85c[_0xb324('0x16')]&&_0x57b85c[_0xb324('0x16')]['id']){try{var _0x541aa8=getId(_0x57b85c[_0xb324('0x14')],_0x57b85c[_0xb324('0x15')]?_0x57b85c[_0xb324('0x15')]['id']:0x0,_0x57b85c[_0xb324('0x16')]?_0x57b85c[_0xb324('0x16')]['id']:0x0);if(_0x41dbc3[_0xb324('0x13')][_0x541aa8]){_0x41dbc3[_0xb324('0x13')][_0x541aa8][_0xb324('0x3c')](_0xb324('0x4b'));}return _0x3ee550({'code':0xc8,'message':_0x57b85c});}catch(_0x30312a){logger['error'](_0x30312a[_0xb324('0x41')]);return _0x466653(_0x4aa335[_0xb324('0x38')](0x1f4,_0x30312a));}}logger[_0xb324('0x38')](_0xb324('0x4a'));return _0x466653(_0x4aa335['error'](0x1f4,_0xb324('0x4a')));});},'AgentCapacity':function(_0x2749a3){var _0x51aa9c=this;return new Promise(function(_0x47f148,_0x57b250){if(_0x41dbc3[_0xb324('0x44')][_0xb324('0x4c')](_0x2749a3['id'])){for(var _0x444632 in _0x2749a3['capacity']){if(_0x2749a3[_0xb324('0x4d')][_0xb324('0x4c')](_0x444632)){if(_0x41dbc3[_0xb324('0x44')][_0x2749a3['id']]['hasOwnProperty'](_0x444632+_0xb324('0x4e'))){_0x41dbc3[_0xb324('0x44')][_0x2749a3['id']][_0x444632+_0xb324('0x4e')]=parseInt(_0x2749a3[_0xb324('0x4d')][_0x444632],0xa);}}}_0x41dbc3[_0xb324('0x44')][_0x2749a3['id']][_0xb324('0x4f')]();return _0x47f148({'code':0xc8,'message':_0x41dbc3['agents'][_0x2749a3['id']]});}else{return _0x57b250(_0x51aa9c[_0xb324('0x38')](0x1f4,_0xb324('0x50')));}});},'Agents':function(_0x10ba53){return new Promise(function(_0x21524c){var _0xb8fcce=_[_0xb324('0x51')](_0x41dbc3[_0xb324('0x44')]);if(_0x10ba53&&_0x10ba53['id']){var _0x34d7d4=_[_0xb324('0x52')](_0xb8fcce,function(_0x453511){return _0x453511['id']===_0x10ba53['id'];});_0x21524c(_0x34d7d4);}else{_0x21524c({'count':_0xb8fcce[_0xb324('0x1a')],'rows':_0xb8fcce});}});},'ChatQueues':function(){return new Promise(function(_0x48360f){var _0x2fa768=[];for(var _0x56d6ae in _0x41dbc3[_0xb324('0x53')]){if(_0x41dbc3['chatQueues'][_0xb324('0x4c')](_0x56d6ae)){var _0x1aa041=_0x41dbc3[_0xb324('0x53')][_0x56d6ae];var _0x13294c={'id':_0x1aa041['id'],'available':_0x1aa041['available'],'loggedIn':_0x1aa041['loggedIn'],'name':_0x1aa041[_0xb324('0x54')],'paused':_0x1aa041[_0xb324('0x55')],'waiting':_0x1aa041['waiting']};_0x2fa768[_0xb324('0x22')](_0x13294c);}}_0x48360f({'count':_0x2fa768[_0xb324('0x1a')],'rows':_0x2fa768});});},'MailQueues':function(){return new Promise(function(_0x225422){var _0x2143f9=[];for(var _0x355992 in _0x41dbc3[_0xb324('0x56')]){if(_0x41dbc3[_0xb324('0x56')][_0xb324('0x4c')](_0x355992)){var _0x171b60=_0x41dbc3[_0xb324('0x56')][_0x355992];var _0x3ad3ef={'id':_0x171b60['id'],'available':_0x171b60[_0xb324('0x57')],'loggedIn':_0x171b60[_0xb324('0x58')],'name':_0x171b60[_0xb324('0x54')],'paused':_0x171b60[_0xb324('0x55')],'waiting':_0x171b60['waiting']};_0x2143f9[_0xb324('0x22')](_0x3ad3ef);}}_0x225422({'count':_0x2143f9[_0xb324('0x1a')],'rows':_0x2143f9});});},'OpenchannelQueues':function(){return new Promise(function(_0x17489f){var _0x1f01d2=[];for(var _0x42833c in _0x41dbc3['openchannelQueues']){if(_0x41dbc3[_0xb324('0x59')]['hasOwnProperty'](_0x42833c)){var _0x5089b8=_0x41dbc3[_0xb324('0x59')][_0x42833c];var _0x44f192={'id':_0x5089b8['id'],'available':_0x5089b8['available'],'loggedIn':_0x5089b8[_0xb324('0x58')],'name':_0x5089b8[_0xb324('0x54')],'paused':_0x5089b8[_0xb324('0x55')],'waiting':_0x5089b8[_0xb324('0x5a')]};_0x1f01d2[_0xb324('0x22')](_0x44f192);}}_0x17489f({'count':_0x1f01d2[_0xb324('0x1a')],'rows':_0x1f01d2});});},'SmsQueues':function(){return new Promise(function(_0x3ce1b8){var _0x1c4766=[];for(var _0x493152 in _0x41dbc3['smsQueues']){if(_0x41dbc3[_0xb324('0x5b')][_0xb324('0x4c')](_0x493152)){var _0x5a88d7=_0x41dbc3[_0xb324('0x5b')][_0x493152];var _0x577b76={'id':_0x5a88d7['id'],'available':_0x5a88d7[_0xb324('0x57')],'loggedIn':_0x5a88d7[_0xb324('0x58')],'name':_0x5a88d7[_0xb324('0x54')],'paused':_0x5a88d7['paused'],'waiting':_0x5a88d7[_0xb324('0x5a')]};_0x1c4766[_0xb324('0x22')](_0x577b76);}}_0x3ce1b8({'count':_0x1c4766[_0xb324('0x1a')],'rows':_0x1c4766});});},'FaxQueues':function(){return new Promise(function(_0x372a41){var _0x2c88bf=[];for(var _0x26d079 in _0x41dbc3[_0xb324('0x5c')]){if(_0x41dbc3[_0xb324('0x5c')][_0xb324('0x4c')](_0x26d079)){var _0x1b705c=_0x41dbc3['faxQueues'][_0x26d079];var _0x5119fa={'id':_0x1b705c['id'],'available':_0x1b705c[_0xb324('0x57')],'loggedIn':_0x1b705c[_0xb324('0x58')],'name':_0x1b705c[_0xb324('0x54')],'paused':_0x1b705c[_0xb324('0x55')],'waiting':_0x1b705c[_0xb324('0x5a')]};_0x2c88bf['push'](_0x5119fa);}}_0x372a41({'count':_0x2c88bf[_0xb324('0x1a')],'rows':_0x2c88bf});});},'WhatsappQueues':function(){return new Promise(function(_0x3876f3){var _0xad8d78=[];for(var _0x427fa5 in _0x41dbc3[_0xb324('0x5d')]){if(_0x41dbc3[_0xb324('0x5d')]['hasOwnProperty'](_0x427fa5)){var _0x337f6c=_0x41dbc3[_0xb324('0x5d')][_0x427fa5];var _0x381e28={'id':_0x337f6c['id'],'available':_0x337f6c['available'],'loggedIn':_0x337f6c[_0xb324('0x58')],'name':_0x337f6c['name'],'paused':_0x337f6c[_0xb324('0x55')],'waiting':_0x337f6c['waiting']};_0xad8d78[_0xb324('0x22')](_0x381e28);}}_0x3876f3({'count':_0xad8d78['length'],'rows':_0xad8d78});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x5c9f17){var _0x2b0d9c=_[_0xb324('0x51')](_0x41dbc3[_0xb324('0x5e')]);_0x5c9f17({'count':_0x2b0d9c[_0xb324('0x1a')],'rows':_0x2b0d9c});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0xb7fe62){var _0x3fb30b=_['values'](_0x41dbc3[_0xb324('0x5f')]);_0xb7fe62({'count':_0x3fb30b[_0xb324('0x1a')],'rows':_0x3fb30b});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x11c0d6){var _0x3dda96=_['values'](_0x41dbc3[_0xb324('0x60')]);_0x11c0d6({'count':_0x3dda96[_0xb324('0x1a')],'rows':_0x3dda96});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x5cb978){var _0x1bc999=_['values'](_0x41dbc3[_0xb324('0x61')]);_0x5cb978({'count':_0x1bc999[_0xb324('0x1a')],'rows':_0x1bc999});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x2cc5b5){var _0x4716dc=_[_0xb324('0x51')](_0x41dbc3[_0xb324('0x62')]);_0x2cc5b5({'count':_0x4716dc['length'],'rows':_0x4716dc});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x3c3b07){var _0x5a5a07=_['values'](_0x41dbc3[_0xb324('0x63')]);_0x3c3b07({'count':_0x5a5a07[_0xb324('0x1a')],'rows':_0x5a5a07});});}};var _0x2cf57a=jayson['server'](_0x2bf9f5)['http']();_0x2cf57a['on'](_0xb324('0x38'),function(_0x287986){logger[_0xb324('0x38')](JSON[_0xb324('0x3b')](_0x287986));return _0x12ea42(_0x287986);});_0x2cf57a[_0xb324('0x12')](0x232c,'127.0.0.1',function(){console['log'](_0xb324('0x64'),0x232c);return _0x28b787(_0xb324('0x65')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 335c436..6e67fb4 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 _0x853d=['iftime\x20%s','indexOf','true','all','then','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','catch','log','stack','stop','util','bluebird','jayson/promise','../../../config/logger','routing','client','http','request','error','message','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','length','Command','format'];(function(_0x2b3bc0,_0x506686){var _0x3ac12b=function(_0x1d57ce){while(--_0x1d57ce){_0x2b3bc0['push'](_0x2b3bc0['shift']());}};_0x3ac12b(++_0x506686);}(_0x853d,0xfe));var _0xd853=function(_0x12fd15,_0x59601a){_0x12fd15=_0x12fd15-0x0;var _0x43d2aa=_0x853d[_0x12fd15];return _0x43d2aa;};'use strict';var util=require(_0xd853('0x0'));var BPromise=require(_0xd853('0x1'));var jayson=require(_0xd853('0x2'));var _=require('lodash');var logger=require(_0xd853('0x3'))(_0xd853('0x4'));var client=jayson[_0xd853('0x5')][_0xd853('0x6')]({'port':0x232a});function request(_0x3e5353,_0x353be6){return new BPromise(function(_0x45f41d,_0x36c905){return client[_0xd853('0x7')](_0x3e5353,_0x353be6)['then'](function(_0xf5cd29){if(_0xf5cd29['error']){return _0x36c905(_0xf5cd29[_0xd853('0x8')][_0xd853('0x9')]);}else{return _0x45f41d(_0xf5cd29['result']);}})['catch'](function(_0x12201f){return _0x36c905(_0x12201f);});});}exports['condition']=function(_0x5687ec,_0x4b0694,_0x4981da){return function(_0x33bf4d){if(_0x4981da[_0xd853('0xa')]&&!_0x4981da[_0xd853('0xa')][_0x5687ec]){logger[_0xd853('0xb')](_0xd853('0xc'),_0x5687ec);return _0x33bf4d['stop']();}var _0x4e7847=[];for(var _0x37bf71=0x0;_0x37bf71<_0x4b0694[_0xd853('0xd')];_0x37bf71+=0x1){_0x4e7847['push'](request(_0xd853('0xe'),{'command':util[_0xd853('0xf')](_0xd853('0x10'),_0x4b0694[_0x37bf71])})['then'](function(_0x4e9f4b){return _0x4e9f4b&&_0x4e9f4b['message']&&_0x4e9f4b[_0xd853('0x9')][_0xd853('0x11')](_0xd853('0x12'))>=0x0?!![]:![];})['catch'](function(_0x2c2505){logger[_0xd853('0x8')]('[%s][INTERVAL]\x20%s',_0x5687ec,_0x4b0694[_0x37bf71]);}));}BPromise[_0xd853('0x13')](_0x4e7847)[_0xd853('0x14')](function(_0x2b2689){var _0x47991b=_[_0xd853('0x15')](_0x2b2689);logger[_0xd853('0xb')](_0xd853('0x16'),_0x5687ec,_0x4b0694[_0xd853('0x17')](_0xd853('0x18')),_0x47991b);_0x33bf4d[_0xd853('0x19')](_0x47991b);})[_0xd853('0x1a')](function(_0x586800){console[_0xd853('0x1b')](_0x586800);logger['error'](_0xd853('0x16'),_0x5687ec,_0x4b0694[_0xd853('0x17')](_0xd853('0x18')),_0x586800[_0xd853('0x1c')]);_0x33bf4d[_0xd853('0x1d')]();});};}; \ No newline at end of file +var _0x8342=['condition','rules','stop','length','push','iftime\x20%s','indexOf','true','catch','[%s][INTERVAL]\x20%s','all','some','info','join','\x20|\x20','log','[%s][INTERVAL]\x20%s\x20%s','stack','util','bluebird','jayson/promise','lodash','../../../config/logger','client','http','request','then','error','message','result'];(function(_0x5ae09f,_0x33a81b){var _0x5cdc22=function(_0x14c5fb){while(--_0x14c5fb){_0x5ae09f['push'](_0x5ae09f['shift']());}};_0x5cdc22(++_0x33a81b);}(_0x8342,0x8a));var _0x2834=function(_0xb98825,_0x554182){_0xb98825=_0xb98825-0x0;var _0x451d90=_0x8342[_0xb98825];return _0x451d90;};'use strict';var util=require(_0x2834('0x0'));var BPromise=require(_0x2834('0x1'));var jayson=require(_0x2834('0x2'));var _=require(_0x2834('0x3'));var logger=require(_0x2834('0x4'))('routing');var client=jayson[_0x2834('0x5')][_0x2834('0x6')]({'port':0x232a});function request(_0x273b29,_0xf6eaa4){return new BPromise(function(_0x2ed948,_0x47d7ce){return client[_0x2834('0x7')](_0x273b29,_0xf6eaa4)[_0x2834('0x8')](function(_0x17a5d7){if(_0x17a5d7[_0x2834('0x9')]){return _0x47d7ce(_0x17a5d7['error'][_0x2834('0xa')]);}else{return _0x2ed948(_0x17a5d7[_0x2834('0xb')]);}})['catch'](function(_0x3388c3){return _0x47d7ce(_0x3388c3);});});}exports[_0x2834('0xc')]=function(_0x20fc46,_0x5a918f,_0x3e4c40){return function(_0x46e8ff){if(_0x3e4c40[_0x2834('0xd')]&&!_0x3e4c40[_0x2834('0xd')][_0x20fc46]){logger['info']('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x20fc46);return _0x46e8ff[_0x2834('0xe')]();}var _0x535c6e=[];for(var _0x562978=0x0;_0x562978<_0x5a918f[_0x2834('0xf')];_0x562978+=0x1){_0x535c6e[_0x2834('0x10')](request('Command',{'command':util['format'](_0x2834('0x11'),_0x5a918f[_0x562978])})['then'](function(_0x32f08c){return _0x32f08c&&_0x32f08c[_0x2834('0xa')]&&_0x32f08c['message'][_0x2834('0x12')](_0x2834('0x13'))>=0x0?!![]:![];})[_0x2834('0x14')](function(_0x3a53a3){logger[_0x2834('0x9')](_0x2834('0x15'),_0x20fc46,_0x5a918f[_0x562978]);}));}BPromise[_0x2834('0x16')](_0x535c6e)[_0x2834('0x8')](function(_0x3150c6){var _0xc01ee8=_[_0x2834('0x17')](_0x3150c6);logger[_0x2834('0x18')]('[%s][INTERVAL]\x20%s\x20%s',_0x20fc46,_0x5a918f[_0x2834('0x19')](_0x2834('0x1a')),_0xc01ee8);_0x46e8ff['when'](_0xc01ee8);})[_0x2834('0x14')](function(_0x8f91c5){console[_0x2834('0x1b')](_0x8f91c5);logger[_0x2834('0x9')](_0x2834('0x1c'),_0x20fc46,_0x5a918f[_0x2834('0x19')]('\x20|\x20'),_0x8f91c5[_0x2834('0x1d')]);_0x46e8ff[_0x2834('0xe')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index a25e5d0..42150be 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 _0xa5fa=['[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','agentcalledAt','secondtransfererlinkedid','transfertype','secondtransfererexten','transferuniqueid','transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','rejected','indexOf','splice','agent','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','util','./utils','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','type','acw','acwTimeout','CreateVoiceAgentReport','request','uniqueid','destuniqueid','[%s][agents][agentcalled]','called','connectedlinename','info','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','isNil','debug','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','now','timeout','holdtime','ringtime','talktime','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','reason','abandoned','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','forIn','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','agentcomplete','[%s][agents][agentcomplete]','agentcompleteAt','diffTime','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','blind','transferexten','[%s][agents][blindtransfer]','attendedtransfer'];(function(_0x12fff2,_0x1e68e9){var _0x161e7a=function(_0x4ea3f2){while(--_0x4ea3f2){_0x12fff2['push'](_0x12fff2['shift']());}};_0x161e7a(++_0x1e68e9);}(_0xa5fa,0xc4));var _0xaa5f=function(_0x76dd6e,_0x14dd80){_0x76dd6e=_0x76dd6e-0x0;var _0x35fb11=_0xa5fa[_0x76dd6e];return _0x35fb11;};'use strict';var _=require('lodash');var util=require(_0xaa5f('0x0'));var utils=require(_0xaa5f('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x24d383,_0x1b7e1d){utils['info'](util[_0xaa5f('0x2')](_0xaa5f('0x3'),_0x24d383['uniqueid'],_0x24d383[_0xaa5f('0x4')],_0x24d383[_0xaa5f('0x5')],_0x24d383[_0xaa5f('0x6')],_0x24d383[_0xaa5f('0x7')],_0x24d383[_0xaa5f('0x8')],_0x24d383[_0xaa5f('0x9')],_0x24d383[_0xaa5f('0xa')]));if(_0x24d383[_0xaa5f('0x5')]){utils[_0xaa5f('0xb')](_0x24d383[_0xaa5f('0x5')])[_0xaa5f('0xc')](function(_0x4e5257){if(_0x4e5257){_0x24d383[_0xaa5f('0xd')]=_0x4e5257[_0xaa5f('0xd')];_0x24d383['agentacw']=_0x24d383['agentcomplete']?_0x4e5257[_0xaa5f('0xe')]:![];_0x24d383['acwtime']=_0x24d383['agentacw']?_0x4e5257[_0xaa5f('0xf')]:0x0;}utils['request'](_0xaa5f('0x10'),_0x24d383);});}else{utils[_0xaa5f('0x11')](_0xaa5f('0x10'),_0x24d383);}if(_0x1b7e1d){delete transfers[_0x24d383[_0xaa5f('0x12')]];}else{delete agents[_0x24d383[_0xaa5f('0x13')]];}}exports['agentcalled']=function(_0xbd4e10){try{utils['debug'](util[_0xaa5f('0x2')](_0xaa5f('0x14'),_0xbd4e10[_0xaa5f('0x12')]),_0xbd4e10);agents[_0xbd4e10[_0xaa5f('0x13')]]=_0xbd4e10;agents[_0xbd4e10[_0xaa5f('0x13')]]['agentcalledAt']=utils['now']();agents[_0xbd4e10[_0xaa5f('0x13')]][_0xaa5f('0xa')]=_0xaa5f('0x15');agents[_0xbd4e10[_0xaa5f('0x13')]][_0xaa5f('0x9')]=null;agents[_0xbd4e10[_0xaa5f('0x13')]][_0xaa5f('0x16')]=null;utils[_0xaa5f('0x17')](util[_0xaa5f('0x2')](_0xaa5f('0x18'),_0xbd4e10[_0xaa5f('0x12')],agents[_0xbd4e10[_0xaa5f('0x13')]]['membername'],_0xbd4e10[_0xaa5f('0x13')]));}catch(_0x4c0a9d){utils[_0xaa5f('0x19')](util[_0xaa5f('0x2')](_0xaa5f('0x14'),_0xbd4e10[_0xaa5f('0x12')]),_0x4c0a9d);}};exports[_0xaa5f('0x1a')]=function(_0x194691){try{if(!_[_0xaa5f('0x1b')](agents[_0x194691[_0xaa5f('0x13')]])){utils[_0xaa5f('0x1c')](util[_0xaa5f('0x2')](_0xaa5f('0x1d'),_0x194691['uniqueid']),_0x194691);utils[_0xaa5f('0x17')](util['format'](_0xaa5f('0x1e'),_0x194691[_0xaa5f('0x12')],agents[_0x194691['destuniqueid']][_0xaa5f('0x6')],_0x194691[_0xaa5f('0x13')]));agents[_0x194691['destuniqueid']][_0xaa5f('0x1a')]=!![];agents[_0x194691[_0xaa5f('0x13')]][_0xaa5f('0x1f')]=utils[_0xaa5f('0x20')]();agents[_0x194691[_0xaa5f('0x13')]][_0xaa5f('0xa')]=_0xaa5f('0x21');agents[_0x194691[_0xaa5f('0x13')]]['reason']=_0xaa5f('0x21');agents[_0x194691[_0xaa5f('0x13')]][_0xaa5f('0x22')]=_0x194691['ringtime']?parseInt(_0x194691[_0xaa5f('0x23')])/0x3e8:0x0;agents[_0x194691[_0xaa5f('0x13')]][_0xaa5f('0x24')]=0x0;unanswered['push'](_0x194691[_0xaa5f('0x13')]);}}catch(_0x479f29){utils['error'](util[_0xaa5f('0x2')]('[%s][agents][agentringnoanswer]',_0x194691[_0xaa5f('0x12')]),_0x479f29);}};exports['queuecallerabandon']=function(_0x4c5dc0){try{_['forIn'](agents,function(_0x26a90d,_0x4ddebd){if(_0x26a90d[_0xaa5f('0x12')]==_0x4c5dc0[_0xaa5f('0x12')]&&!_['includes'](unanswered,_0x26a90d['destuniqueid'])){utils[_0xaa5f('0x1c')](util['format'](_0xaa5f('0x25'),_0x4c5dc0[_0xaa5f('0x12')]),_0x4c5dc0);utils['info'](util[_0xaa5f('0x2')](_0xaa5f('0x26'),_0x4c5dc0[_0xaa5f('0x12')],_0x26a90d['membername'],_0x26a90d[_0xaa5f('0x13')]));_0x26a90d[_0xaa5f('0x1a')]=!![];_0x26a90d['agentringnoanswerAt']=utils['now']();_0x26a90d['lastevent']='abandoned';_0x26a90d[_0xaa5f('0x27')]=_0xaa5f('0x28');_0x26a90d[_0xaa5f('0x22')]=_0x4c5dc0[_0xaa5f('0x22')];_0x26a90d[_0xaa5f('0x24')]=0x0;writeDB(_0x26a90d);}});}catch(_0x3bcaf6){utils[_0xaa5f('0x19')](util['format'](_0xaa5f('0x25'),_0x4c5dc0[_0xaa5f('0x12')]),_0x3bcaf6);}};exports[_0xaa5f('0x29')]=function(_0x1f3268){try{if(agents[_0x1f3268[_0xaa5f('0x13')]]){utils[_0xaa5f('0x1c')](util['format'](_0xaa5f('0x2a'),_0x1f3268[_0xaa5f('0x12')]),_0x1f3268);utils[_0xaa5f('0x17')](util[_0xaa5f('0x2')](_0xaa5f('0x2b'),_0x1f3268['uniqueid'],agents[_0x1f3268['destuniqueid']][_0xaa5f('0x6')],_0x1f3268[_0xaa5f('0x13')]));agents[_0x1f3268[_0xaa5f('0x13')]][_0xaa5f('0x2c')]=utils['now']();agents[_0x1f3268[_0xaa5f('0x13')]][_0xaa5f('0x9')]=_0x1f3268[_0xaa5f('0x9')];agents[_0x1f3268[_0xaa5f('0x13')]][_0xaa5f('0x16')]=_0x1f3268[_0xaa5f('0x16')];agents[_0x1f3268[_0xaa5f('0x13')]][_0xaa5f('0x22')]=_0x1f3268[_0xaa5f('0x23')];agents[_0x1f3268[_0xaa5f('0x13')]][_0xaa5f('0xa')]='connect';_[_0xaa5f('0x2d')](agents,function(_0x2562ce,_0xcd9c30){if(_0x2562ce[_0xaa5f('0x13')]!=_0x1f3268[_0xaa5f('0x13')]&&_0x2562ce[_0xaa5f('0x12')]==_0x1f3268[_0xaa5f('0x12')]){_0x2562ce[_0xaa5f('0x24')]=0x0;_0x2562ce[_0xaa5f('0x22')]=_0x1f3268[_0xaa5f('0x23')];_0x2562ce['agentringnoanswer']=!![];_0x2562ce[_0xaa5f('0x1f')]=utils['now']();_0x2562ce[_0xaa5f('0xa')]=_0xaa5f('0x2e');_0x2562ce[_0xaa5f('0x27')]='answered_elsewhere';_0x2562ce[_0xaa5f('0x2f')]=_0x1f3268[_0xaa5f('0x13')];_0x2562ce[_0xaa5f('0x30')]=_0x1f3268['membername'];writeDB(_0x2562ce);}});}}catch(_0x12a8e4){utils[_0xaa5f('0x19')](util[_0xaa5f('0x2')](_0xaa5f('0x2a'),_0x1f3268['uniqueid']),_0x12a8e4);}};exports[_0xaa5f('0x31')]=function(_0x2b2b4c){try{if(!_[_0xaa5f('0x1b')](agents[_0x2b2b4c[_0xaa5f('0x13')]])){utils[_0xaa5f('0x1c')](util[_0xaa5f('0x2')](_0xaa5f('0x32'),_0x2b2b4c[_0xaa5f('0x12')]),_0x2b2b4c);utils['info'](util[_0xaa5f('0x2')]('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x2b2b4c[_0xaa5f('0x12')],agents[_0x2b2b4c['destuniqueid']][_0xaa5f('0x6')],_0x2b2b4c[_0xaa5f('0x13')]));agents[_0x2b2b4c['destuniqueid']][_0xaa5f('0x31')]=!![];agents[_0x2b2b4c[_0xaa5f('0x13')]][_0xaa5f('0x33')]=utils['now']();agents[_0x2b2b4c['destuniqueid']]['talktime']=utils[_0xaa5f('0x34')](agents[_0x2b2b4c['destuniqueid']][_0xaa5f('0x33')],agents[_0x2b2b4c[_0xaa5f('0x13')]][_0xaa5f('0x2c')]);agents[_0x2b2b4c[_0xaa5f('0x13')]]['reason']=_0x2b2b4c[_0xaa5f('0x27')];agents[_0x2b2b4c[_0xaa5f('0x13')]][_0xaa5f('0xa')]=_0xaa5f('0x35');writeDB(agents[_0x2b2b4c[_0xaa5f('0x13')]]);}}catch(_0x1f9629){utils[_0xaa5f('0x19')](util[_0xaa5f('0x2')](_0xaa5f('0x32'),_0x2b2b4c[_0xaa5f('0x12')]),_0x1f9629);}};exports[_0xaa5f('0x36')]=function(_0x2de737){try{if(!_[_0xaa5f('0x1b')](agents[_0x2de737[_0xaa5f('0x37')]])){utils[_0xaa5f('0x1c')](util[_0xaa5f('0x2')]('[%s][agents][blindtransfer]',_0x2de737[_0xaa5f('0x12')]),_0x2de737);utils[_0xaa5f('0x17')](util[_0xaa5f('0x2')](_0xaa5f('0x38'),_0x2de737[_0xaa5f('0x12')],agents[_0x2de737[_0xaa5f('0x37')]][_0xaa5f('0x6')],agents[_0x2de737['transfereruniqueid']][_0xaa5f('0x12')]));agents[_0x2de737[_0xaa5f('0x37')]][_0xaa5f('0x39')]=!![];agents[_0x2de737[_0xaa5f('0x37')]]['transfertype']=_0xaa5f('0x3a');agents[_0x2de737[_0xaa5f('0x37')]][_0xaa5f('0x3b')]=_0x2de737['extension'];agents[_0x2de737['transfereruniqueid']]['transferuniqueid']=agents[_0x2de737['transfereruniqueid']]['uniqueid'];}}catch(_0x509c61){utils[_0xaa5f('0x19')](util[_0xaa5f('0x2')](_0xaa5f('0x3c'),_0x2de737[_0xaa5f('0x12')]),_0x509c61);}};exports[_0xaa5f('0x3d')]=function(_0x17b872){try{utils['debug'](util['format'](_0xaa5f('0x3e'),_0x17b872[_0xaa5f('0x3f')]),_0x17b872);if(_0x17b872['origtransfereruniqueid']==_0x17b872[_0xaa5f('0x40')]){if(!_[_0xaa5f('0x1b')](agents[_0x17b872[_0xaa5f('0x41')]])){utils[_0xaa5f('0x17')](util[_0xaa5f('0x2')](_0xaa5f('0x42'),_0x17b872[_0xaa5f('0x3f')],agents[_0x17b872['secondtransfereruniqueid']]['membername']));agents[_0x17b872[_0xaa5f('0x41')]][_0xaa5f('0x39')]=!![];agents[_0x17b872['secondtransfereruniqueid']]['transfertype']='ATTENDED';agents[_0x17b872[_0xaa5f('0x41')]]['transferexten']=_0x17b872[_0xaa5f('0x43')];agents[_0x17b872['secondtransfereruniqueid']]['transferuniqueid']=_0x17b872[_0xaa5f('0x3f')];}if(_0x17b872[_0xaa5f('0x44')]&&agents[_0x17b872[_0xaa5f('0x44')]]){agents[_0x17b872['transfereeuniqueid']][_0xaa5f('0x45')]=0x1;transfers[_0x17b872[_0xaa5f('0x44')]]=_[_0xaa5f('0x46')](agents[_0x17b872['transfereeuniqueid']]);transfers[_0x17b872[_0xaa5f('0x44')]][_0xaa5f('0x8')]=agents[_0x17b872['secondtransfereruniqueid']][_0xaa5f('0x8')];transfers[_0x17b872[_0xaa5f('0x44')]][_0xaa5f('0x47')]=agents[_0x17b872[_0xaa5f('0x41')]][_0xaa5f('0x47')];transfers[_0x17b872[_0xaa5f('0x44')]][_0xaa5f('0x48')]=utils[_0xaa5f('0x20')]();transfers[_0x17b872[_0xaa5f('0x44')]]['agentconnectAt']=utils[_0xaa5f('0x20')]();transfers[_0x17b872[_0xaa5f('0x44')]][_0xaa5f('0x22')]=0x0;transfers[_0x17b872[_0xaa5f('0x44')]][_0xaa5f('0x45')]=0x2;}}else if(_0x17b872[_0xaa5f('0x41')]==_0x17b872[_0xaa5f('0x49')]){if(!_[_0xaa5f('0x1b')](agents[_0x17b872['origtransfereruniqueid']])){utils[_0xaa5f('0x17')](util['format'](_0xaa5f('0x42'),_0x17b872[_0xaa5f('0x3f')],agents[_0x17b872[_0xaa5f('0x3f')]][_0xaa5f('0x6')]));agents[_0x17b872['origtransfereruniqueid']][_0xaa5f('0x39')]=!![];agents[_0x17b872[_0xaa5f('0x3f')]][_0xaa5f('0x4a')]='ATTENDED';agents[_0x17b872[_0xaa5f('0x3f')]]['transferexten']=_0x17b872[_0xaa5f('0x4b')];agents[_0x17b872['origtransfereruniqueid']][_0xaa5f('0x4c')]=_0x17b872[_0xaa5f('0x41')];}if(_0x17b872[_0xaa5f('0x4d')]&&agents[_0x17b872[_0xaa5f('0x4d')]]){agents[_0x17b872['transfertargetuniqueid']][_0xaa5f('0x45')]=0x1;transfers[_0x17b872[_0xaa5f('0x4d')]]=_['clone'](agents[_0x17b872['transfertargetuniqueid']]);transfers[_0x17b872[_0xaa5f('0x4d')]][_0xaa5f('0x8')]=agents[_0x17b872['origtransfereruniqueid']][_0xaa5f('0x8')];transfers[_0x17b872[_0xaa5f('0x4d')]][_0xaa5f('0x47')]=agents[_0x17b872['origtransfereruniqueid']][_0xaa5f('0x47')];transfers[_0x17b872[_0xaa5f('0x4d')]]['agentcalledAt']=utils[_0xaa5f('0x20')]();transfers[_0x17b872[_0xaa5f('0x4d')]][_0xaa5f('0x2c')]=utils['now']();transfers[_0x17b872[_0xaa5f('0x4d')]][_0xaa5f('0x22')]=0x0;transfers[_0x17b872['transfertargetuniqueid']][_0xaa5f('0x45')]=0x2;}}}catch(_0x309605){utils[_0xaa5f('0x19')](util[_0xaa5f('0x2')](_0xaa5f('0x3e'),_0x17b872['origtransfereruniqueid']),_0x309605);}};exports[_0xaa5f('0x4e')]=function(_0x2ba378){try{utils[_0xaa5f('0x1c')](util[_0xaa5f('0x2')](_0xaa5f('0x4f'),_0x2ba378['uniqueid']),_0x2ba378);if(agents[_0x2ba378[_0xaa5f('0x12')]]&&agents[_0x2ba378['uniqueid']][_0xaa5f('0x27')]===_0xaa5f('0x21')){if(_0x2ba378[_0xaa5f('0x50')]==='21'){agents[_0x2ba378[_0xaa5f('0x12')]]['reason']=_0xaa5f('0x51');agents[_0x2ba378[_0xaa5f('0x12')]][_0xaa5f('0xa')]=_0xaa5f('0x51');}utils[_0xaa5f('0x17')](util[_0xaa5f('0x2')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x2ba378['uniqueid'],agents[_0x2ba378[_0xaa5f('0x12')]][_0xaa5f('0x6')],agents[_0x2ba378[_0xaa5f('0x12')]][_0xaa5f('0x27')],agents[_0x2ba378[_0xaa5f('0x12')]]['lastevent']));writeDB(agents[_0x2ba378['uniqueid']]);var _0x104079=unanswered[_0xaa5f('0x52')](_0x2ba378['uniqueid']);if(_0x104079>-0x1){unanswered[_0xaa5f('0x53')](_0x104079,0x1);}}if(transfers[_0x2ba378['uniqueid']]){transfers[_0x2ba378[_0xaa5f('0x12')]][_0xaa5f('0x31')]=!![];transfers[_0x2ba378['uniqueid']][_0xaa5f('0x33')]=utils[_0xaa5f('0x20')]();transfers[_0x2ba378[_0xaa5f('0x12')]][_0xaa5f('0x24')]=utils[_0xaa5f('0x34')](transfers[_0x2ba378[_0xaa5f('0x12')]][_0xaa5f('0x33')],transfers[_0x2ba378['uniqueid']][_0xaa5f('0x2c')]);transfers[_0x2ba378[_0xaa5f('0x12')]][_0xaa5f('0x27')]='agent';transfers[_0x2ba378[_0xaa5f('0x12')]][_0xaa5f('0xa')]=_0xaa5f('0x35');utils[_0xaa5f('0x17')](util[_0xaa5f('0x2')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x2ba378[_0xaa5f('0x12')],transfers[_0x2ba378[_0xaa5f('0x12')]][_0xaa5f('0x6')],transfers[_0x2ba378[_0xaa5f('0x12')]][_0xaa5f('0x27')],transfers[_0x2ba378[_0xaa5f('0x12')]][_0xaa5f('0xa')]));writeDB(transfers[_0x2ba378[_0xaa5f('0x12')]],!![]);}if(agents[_0x2ba378[_0xaa5f('0x12')]]&&agents[_0x2ba378[_0xaa5f('0x12')]]['agentconnectAt']){agents[_0x2ba378['uniqueid']][_0xaa5f('0x31')]=!![];agents[_0x2ba378[_0xaa5f('0x12')]][_0xaa5f('0x33')]=utils[_0xaa5f('0x20')]();agents[_0x2ba378[_0xaa5f('0x12')]][_0xaa5f('0x24')]=utils[_0xaa5f('0x34')](agents[_0x2ba378[_0xaa5f('0x12')]]['agentcompleteAt'],agents[_0x2ba378[_0xaa5f('0x12')]][_0xaa5f('0x2c')]);agents[_0x2ba378[_0xaa5f('0x12')]]['reason']=agents[_0x2ba378['uniqueid']][_0xaa5f('0x39')]?_0xaa5f('0x39'):_0xaa5f('0x54');agents[_0x2ba378[_0xaa5f('0x12')]][_0xaa5f('0xa')]=_0xaa5f('0x35');utils[_0xaa5f('0x17')](util[_0xaa5f('0x2')](_0xaa5f('0x55'),_0x2ba378[_0xaa5f('0x12')],agents[_0x2ba378['uniqueid']][_0xaa5f('0x6')],agents[_0x2ba378[_0xaa5f('0x12')]][_0xaa5f('0x27')],agents[_0x2ba378[_0xaa5f('0x12')]][_0xaa5f('0xa')]));writeDB(agents[_0x2ba378['uniqueid']]);}}catch(_0x4183c0){utils[_0xaa5f('0x19')](util[_0xaa5f('0x2')]('[%s][agents][hangup]',_0x2ba378['uniqueid']),_0x4183c0);}}; \ No newline at end of file +var _0x13f6=['[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinenum','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','[%s][agents][agentcomplete]','blindtransfer','transfereruniqueid','transfer','transfertype','blind','extension','transferuniqueid','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','transferexten','origtransfererexten','transfereeuniqueid','calleridname','agententerreason','transfertargetuniqueid','clone','hangup','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','diffTime','agent','lodash','util','info','format','uniqueid','channel','queue','interface','calleridnum','then','type','agentacw','agentcomplete','acw','acwTimeout','request','CreateVoiceAgentReport','debug','[%s][agents][agentcalled]','destuniqueid','agentcalledAt','now','called','connectedlinename','membername','error','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswer','agentringnoanswerAt','lastevent','reason','timeout','ringtime','talktime','push','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','abandoned','holdtime','[%s][agents][agentconnect]'];(function(_0x3a682d,_0x2d39cb){var _0x9d96ea=function(_0x19f1be){while(--_0x19f1be){_0x3a682d['push'](_0x3a682d['shift']());}};_0x9d96ea(++_0x2d39cb);}(_0x13f6,0x124));var _0x613f=function(_0x3a3f3c,_0x548d42){_0x3a3f3c=_0x3a3f3c-0x0;var _0x577c07=_0x13f6[_0x3a3f3c];return _0x577c07;};'use strict';var _=require(_0x613f('0x0'));var util=require(_0x613f('0x1'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x563492,_0xd04cfd){utils[_0x613f('0x2')](util[_0x613f('0x3')]('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x563492[_0x613f('0x4')],_0x563492[_0x613f('0x5')],_0x563492[_0x613f('0x6')],_0x563492['membername'],_0x563492[_0x613f('0x7')],_0x563492[_0x613f('0x8')],_0x563492['connectedlinenum'],_0x563492['lastevent']));if(_0x563492['queue']){utils['getVoiceQueueByName'](_0x563492[_0x613f('0x6')])[_0x613f('0x9')](function(_0x363736){if(_0x363736){_0x563492[_0x613f('0xa')]=_0x363736['type'];_0x563492[_0x613f('0xb')]=_0x563492[_0x613f('0xc')]?_0x363736[_0x613f('0xd')]:![];_0x563492['acwtime']=_0x563492[_0x613f('0xb')]?_0x363736[_0x613f('0xe')]:0x0;}utils[_0x613f('0xf')]('CreateVoiceAgentReport',_0x563492);});}else{utils[_0x613f('0xf')](_0x613f('0x10'),_0x563492);}if(_0xd04cfd){delete transfers[_0x563492['uniqueid']];}else{delete agents[_0x563492['destuniqueid']];}}exports['agentcalled']=function(_0x38d90a){try{utils[_0x613f('0x11')](util[_0x613f('0x3')](_0x613f('0x12'),_0x38d90a[_0x613f('0x4')]),_0x38d90a);agents[_0x38d90a[_0x613f('0x13')]]=_0x38d90a;agents[_0x38d90a[_0x613f('0x13')]][_0x613f('0x14')]=utils[_0x613f('0x15')]();agents[_0x38d90a[_0x613f('0x13')]]['lastevent']=_0x613f('0x16');agents[_0x38d90a['destuniqueid']]['connectedlinenum']=null;agents[_0x38d90a[_0x613f('0x13')]][_0x613f('0x17')]=null;utils['info'](util[_0x613f('0x3')]('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x38d90a[_0x613f('0x4')],agents[_0x38d90a[_0x613f('0x13')]][_0x613f('0x18')],_0x38d90a[_0x613f('0x13')]));}catch(_0x3c0feb){utils[_0x613f('0x19')](util['format']('[%s][agents][agentcalled]',_0x38d90a[_0x613f('0x4')]),_0x3c0feb);}};exports['agentringnoanswer']=function(_0x48493c){try{if(!_[_0x613f('0x1a')](agents[_0x48493c[_0x613f('0x13')]])){utils['debug'](util[_0x613f('0x3')](_0x613f('0x1b'),_0x48493c[_0x613f('0x4')]),_0x48493c);utils['info'](util['format'](_0x613f('0x1c'),_0x48493c[_0x613f('0x4')],agents[_0x48493c[_0x613f('0x13')]]['membername'],_0x48493c[_0x613f('0x13')]));agents[_0x48493c[_0x613f('0x13')]][_0x613f('0x1d')]=!![];agents[_0x48493c[_0x613f('0x13')]][_0x613f('0x1e')]=utils['now']();agents[_0x48493c[_0x613f('0x13')]][_0x613f('0x1f')]='timeout';agents[_0x48493c[_0x613f('0x13')]][_0x613f('0x20')]=_0x613f('0x21');agents[_0x48493c['destuniqueid']]['holdtime']=_0x48493c['ringtime']?parseInt(_0x48493c[_0x613f('0x22')])/0x3e8:0x0;agents[_0x48493c['destuniqueid']][_0x613f('0x23')]=0x0;unanswered[_0x613f('0x24')](_0x48493c['destuniqueid']);}}catch(_0x121241){utils[_0x613f('0x19')](util['format']('[%s][agents][agentringnoanswer]',_0x48493c['uniqueid']),_0x121241);}};exports[_0x613f('0x25')]=function(_0x7c1a94){try{_[_0x613f('0x26')](agents,function(_0x47f4af,_0x23eda8){if(_0x47f4af[_0x613f('0x4')]==_0x7c1a94[_0x613f('0x4')]&&!_[_0x613f('0x27')](unanswered,_0x47f4af['destuniqueid'])){utils[_0x613f('0x11')](util[_0x613f('0x3')](_0x613f('0x28'),_0x7c1a94[_0x613f('0x4')]),_0x7c1a94);utils[_0x613f('0x2')](util[_0x613f('0x3')]('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x7c1a94[_0x613f('0x4')],_0x47f4af[_0x613f('0x18')],_0x47f4af[_0x613f('0x13')]));_0x47f4af['agentringnoanswer']=!![];_0x47f4af[_0x613f('0x1e')]=utils['now']();_0x47f4af[_0x613f('0x1f')]=_0x613f('0x29');_0x47f4af[_0x613f('0x20')]=_0x613f('0x29');_0x47f4af[_0x613f('0x2a')]=_0x7c1a94[_0x613f('0x2a')];_0x47f4af['talktime']=0x0;writeDB(_0x47f4af);}});}catch(_0x1a18ce){utils[_0x613f('0x19')](util[_0x613f('0x3')](_0x613f('0x28'),_0x7c1a94[_0x613f('0x4')]),_0x1a18ce);}};exports['agentconnect']=function(_0x59236e){try{if(agents[_0x59236e['destuniqueid']]){utils[_0x613f('0x11')](util[_0x613f('0x3')](_0x613f('0x2b'),_0x59236e[_0x613f('0x4')]),_0x59236e);utils['info'](util[_0x613f('0x3')](_0x613f('0x2c'),_0x59236e['uniqueid'],agents[_0x59236e[_0x613f('0x13')]]['membername'],_0x59236e[_0x613f('0x13')]));agents[_0x59236e['destuniqueid']][_0x613f('0x2d')]=utils['now']();agents[_0x59236e[_0x613f('0x13')]][_0x613f('0x2e')]=_0x59236e[_0x613f('0x2e')];agents[_0x59236e['destuniqueid']][_0x613f('0x17')]=_0x59236e[_0x613f('0x17')];agents[_0x59236e[_0x613f('0x13')]][_0x613f('0x2a')]=_0x59236e[_0x613f('0x22')];agents[_0x59236e[_0x613f('0x13')]][_0x613f('0x1f')]=_0x613f('0x2f');_[_0x613f('0x26')](agents,function(_0x3313c1,_0x4da8d3){if(_0x3313c1[_0x613f('0x13')]!=_0x59236e[_0x613f('0x13')]&&_0x3313c1[_0x613f('0x4')]==_0x59236e[_0x613f('0x4')]){_0x3313c1[_0x613f('0x23')]=0x0;_0x3313c1[_0x613f('0x2a')]=_0x59236e[_0x613f('0x22')];_0x3313c1['agentringnoanswer']=!![];_0x3313c1[_0x613f('0x1e')]=utils[_0x613f('0x15')]();_0x3313c1[_0x613f('0x1f')]=_0x613f('0x30');_0x3313c1[_0x613f('0x20')]=_0x613f('0x30');_0x3313c1[_0x613f('0x31')]=_0x59236e['destuniqueid'];_0x3313c1[_0x613f('0x32')]=_0x59236e[_0x613f('0x18')];writeDB(_0x3313c1);}});}}catch(_0x3bb605){utils[_0x613f('0x19')](util[_0x613f('0x3')](_0x613f('0x2b'),_0x59236e[_0x613f('0x4')]),_0x3bb605);}};exports[_0x613f('0xc')]=function(_0x403feb){try{if(!_[_0x613f('0x1a')](agents[_0x403feb[_0x613f('0x13')]])){utils[_0x613f('0x11')](util[_0x613f('0x3')]('[%s][agents][agentcomplete]',_0x403feb[_0x613f('0x4')]),_0x403feb);utils[_0x613f('0x2')](util[_0x613f('0x3')](_0x613f('0x33'),_0x403feb['uniqueid'],agents[_0x403feb[_0x613f('0x13')]][_0x613f('0x18')],_0x403feb[_0x613f('0x13')]));agents[_0x403feb[_0x613f('0x13')]][_0x613f('0xc')]=!![];agents[_0x403feb[_0x613f('0x13')]][_0x613f('0x34')]=utils[_0x613f('0x15')]();agents[_0x403feb[_0x613f('0x13')]][_0x613f('0x23')]=utils['diffTime'](agents[_0x403feb['destuniqueid']][_0x613f('0x34')],agents[_0x403feb[_0x613f('0x13')]]['agentconnectAt']);agents[_0x403feb[_0x613f('0x13')]][_0x613f('0x20')]=_0x403feb[_0x613f('0x20')];agents[_0x403feb[_0x613f('0x13')]][_0x613f('0x1f')]=_0x613f('0x35');writeDB(agents[_0x403feb[_0x613f('0x13')]]);}}catch(_0x3a7f95){utils[_0x613f('0x19')](util[_0x613f('0x3')](_0x613f('0x36'),_0x403feb[_0x613f('0x4')]),_0x3a7f95);}};exports[_0x613f('0x37')]=function(_0x17f8e5){try{if(!_[_0x613f('0x1a')](agents[_0x17f8e5[_0x613f('0x38')]])){utils[_0x613f('0x11')](util[_0x613f('0x3')]('[%s][agents][blindtransfer]',_0x17f8e5['uniqueid']),_0x17f8e5);utils[_0x613f('0x2')](util[_0x613f('0x3')]('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x17f8e5['uniqueid'],agents[_0x17f8e5[_0x613f('0x38')]]['membername'],agents[_0x17f8e5['transfereruniqueid']][_0x613f('0x4')]));agents[_0x17f8e5[_0x613f('0x38')]][_0x613f('0x39')]=!![];agents[_0x17f8e5['transfereruniqueid']][_0x613f('0x3a')]=_0x613f('0x3b');agents[_0x17f8e5['transfereruniqueid']]['transferexten']=_0x17f8e5[_0x613f('0x3c')];agents[_0x17f8e5[_0x613f('0x38')]][_0x613f('0x3d')]=agents[_0x17f8e5[_0x613f('0x38')]][_0x613f('0x4')];}}catch(_0x395357){utils[_0x613f('0x19')](util['format']('[%s][agents][blindtransfer]',_0x17f8e5[_0x613f('0x4')]),_0x395357);}};exports['attendedtransfer']=function(_0x5dd54e){try{utils[_0x613f('0x11')](util[_0x613f('0x3')](_0x613f('0x3e'),_0x5dd54e['origtransfereruniqueid']),_0x5dd54e);if(_0x5dd54e[_0x613f('0x3f')]==_0x5dd54e[_0x613f('0x40')]){if(!_[_0x613f('0x1a')](agents[_0x5dd54e[_0x613f('0x41')]])){utils[_0x613f('0x2')](util[_0x613f('0x3')](_0x613f('0x42'),_0x5dd54e['origtransfereruniqueid'],agents[_0x5dd54e[_0x613f('0x41')]]['membername']));agents[_0x5dd54e[_0x613f('0x41')]][_0x613f('0x39')]=!![];agents[_0x5dd54e[_0x613f('0x41')]][_0x613f('0x3a')]=_0x613f('0x43');agents[_0x5dd54e[_0x613f('0x41')]][_0x613f('0x44')]=_0x5dd54e[_0x613f('0x45')];agents[_0x5dd54e[_0x613f('0x41')]][_0x613f('0x3d')]=_0x5dd54e[_0x613f('0x3f')];}if(_0x5dd54e[_0x613f('0x46')]&&agents[_0x5dd54e[_0x613f('0x46')]]){agents[_0x5dd54e['transfereeuniqueid']]['agententerreason']=0x1;transfers[_0x5dd54e[_0x613f('0x46')]]=_['clone'](agents[_0x5dd54e[_0x613f('0x46')]]);transfers[_0x5dd54e[_0x613f('0x46')]][_0x613f('0x8')]=agents[_0x5dd54e[_0x613f('0x41')]][_0x613f('0x8')];transfers[_0x5dd54e[_0x613f('0x46')]][_0x613f('0x47')]=agents[_0x5dd54e[_0x613f('0x41')]][_0x613f('0x47')];transfers[_0x5dd54e[_0x613f('0x46')]][_0x613f('0x14')]=utils['now']();transfers[_0x5dd54e[_0x613f('0x46')]][_0x613f('0x2d')]=utils[_0x613f('0x15')]();transfers[_0x5dd54e[_0x613f('0x46')]]['holdtime']=0x0;transfers[_0x5dd54e[_0x613f('0x46')]][_0x613f('0x48')]=0x2;}}else if(_0x5dd54e['secondtransfereruniqueid']==_0x5dd54e['secondtransfererlinkedid']){if(!_[_0x613f('0x1a')](agents[_0x5dd54e['origtransfereruniqueid']])){utils['info'](util['format'](_0x613f('0x42'),_0x5dd54e['origtransfereruniqueid'],agents[_0x5dd54e['origtransfereruniqueid']]['membername']));agents[_0x5dd54e[_0x613f('0x3f')]][_0x613f('0x39')]=!![];agents[_0x5dd54e['origtransfereruniqueid']][_0x613f('0x3a')]=_0x613f('0x43');agents[_0x5dd54e[_0x613f('0x3f')]][_0x613f('0x44')]=_0x5dd54e['secondtransfererexten'];agents[_0x5dd54e[_0x613f('0x3f')]][_0x613f('0x3d')]=_0x5dd54e['secondtransfereruniqueid'];}if(_0x5dd54e[_0x613f('0x49')]&&agents[_0x5dd54e[_0x613f('0x49')]]){agents[_0x5dd54e[_0x613f('0x49')]][_0x613f('0x48')]=0x1;transfers[_0x5dd54e[_0x613f('0x49')]]=_[_0x613f('0x4a')](agents[_0x5dd54e[_0x613f('0x49')]]);transfers[_0x5dd54e[_0x613f('0x49')]][_0x613f('0x8')]=agents[_0x5dd54e[_0x613f('0x3f')]][_0x613f('0x8')];transfers[_0x5dd54e[_0x613f('0x49')]]['calleridname']=agents[_0x5dd54e[_0x613f('0x3f')]][_0x613f('0x47')];transfers[_0x5dd54e[_0x613f('0x49')]][_0x613f('0x14')]=utils[_0x613f('0x15')]();transfers[_0x5dd54e[_0x613f('0x49')]]['agentconnectAt']=utils[_0x613f('0x15')]();transfers[_0x5dd54e[_0x613f('0x49')]][_0x613f('0x2a')]=0x0;transfers[_0x5dd54e[_0x613f('0x49')]][_0x613f('0x48')]=0x2;}}}catch(_0x2ae459){utils['error'](util['format'](_0x613f('0x3e'),_0x5dd54e[_0x613f('0x3f')]),_0x2ae459);}};exports[_0x613f('0x4b')]=function(_0xddcd6){try{utils['debug'](util[_0x613f('0x3')](_0x613f('0x4c'),_0xddcd6[_0x613f('0x4')]),_0xddcd6);if(agents[_0xddcd6[_0x613f('0x4')]]&&agents[_0xddcd6['uniqueid']][_0x613f('0x20')]===_0x613f('0x21')){if(_0xddcd6[_0x613f('0x4d')]==='21'){agents[_0xddcd6[_0x613f('0x4')]][_0x613f('0x20')]=_0x613f('0x4e');agents[_0xddcd6[_0x613f('0x4')]][_0x613f('0x1f')]='rejected';}utils[_0x613f('0x2')](util[_0x613f('0x3')](_0x613f('0x4f'),_0xddcd6[_0x613f('0x4')],agents[_0xddcd6[_0x613f('0x4')]][_0x613f('0x18')],agents[_0xddcd6[_0x613f('0x4')]][_0x613f('0x20')],agents[_0xddcd6[_0x613f('0x4')]][_0x613f('0x1f')]));writeDB(agents[_0xddcd6['uniqueid']]);var _0x2c4b88=unanswered[_0x613f('0x50')](_0xddcd6[_0x613f('0x4')]);if(_0x2c4b88>-0x1){unanswered[_0x613f('0x51')](_0x2c4b88,0x1);}}if(transfers[_0xddcd6[_0x613f('0x4')]]){transfers[_0xddcd6[_0x613f('0x4')]][_0x613f('0xc')]=!![];transfers[_0xddcd6[_0x613f('0x4')]][_0x613f('0x34')]=utils[_0x613f('0x15')]();transfers[_0xddcd6[_0x613f('0x4')]]['talktime']=utils[_0x613f('0x52')](transfers[_0xddcd6[_0x613f('0x4')]][_0x613f('0x34')],transfers[_0xddcd6[_0x613f('0x4')]][_0x613f('0x2d')]);transfers[_0xddcd6[_0x613f('0x4')]][_0x613f('0x20')]=_0x613f('0x53');transfers[_0xddcd6[_0x613f('0x4')]][_0x613f('0x1f')]=_0x613f('0x35');utils[_0x613f('0x2')](util['format'](_0x613f('0x4f'),_0xddcd6[_0x613f('0x4')],transfers[_0xddcd6['uniqueid']][_0x613f('0x18')],transfers[_0xddcd6['uniqueid']][_0x613f('0x20')],transfers[_0xddcd6['uniqueid']]['lastevent']));writeDB(transfers[_0xddcd6[_0x613f('0x4')]],!![]);}if(agents[_0xddcd6[_0x613f('0x4')]]&&agents[_0xddcd6[_0x613f('0x4')]][_0x613f('0x2d')]){agents[_0xddcd6[_0x613f('0x4')]][_0x613f('0xc')]=!![];agents[_0xddcd6[_0x613f('0x4')]]['agentcompleteAt']=utils[_0x613f('0x15')]();agents[_0xddcd6[_0x613f('0x4')]][_0x613f('0x23')]=utils[_0x613f('0x52')](agents[_0xddcd6[_0x613f('0x4')]]['agentcompleteAt'],agents[_0xddcd6[_0x613f('0x4')]][_0x613f('0x2d')]);agents[_0xddcd6['uniqueid']][_0x613f('0x20')]=agents[_0xddcd6[_0x613f('0x4')]][_0x613f('0x39')]?'transfer':'agent';agents[_0xddcd6['uniqueid']][_0x613f('0x1f')]=_0x613f('0x35');utils['info'](util[_0x613f('0x3')](_0x613f('0x4f'),_0xddcd6[_0x613f('0x4')],agents[_0xddcd6['uniqueid']][_0x613f('0x18')],agents[_0xddcd6['uniqueid']][_0x613f('0x20')],agents[_0xddcd6['uniqueid']]['lastevent']));writeDB(agents[_0xddcd6[_0x613f('0x4')]]);}}catch(_0x1b5f6e){utils[_0x613f('0x19')](util[_0x613f('0x3')](_0x613f('0x4c'),_0xddcd6[_0x613f('0x4')]),_0x1b5f6e);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index ff51c21..21b7432 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 _0xc962=['lastIndexOf','includes','noop','execif','gotoif','lastdata','lodash','NO\x20ANSWER','FAILED','ANSWERED','BUSY','blinds','uniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','then','CreateVoiceCallReport','request','recording','newchannel','debug','[%s][calls][newchannel]','OutgoingSpoolFailed','context','exten','now','DOCUMENTATION','newstate','[%s][calls][newstate]','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','isNil','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','linkedid','answertime','disposition','error','hangup','[%s][calls][hangup]','callerid','calleridname','endtime','duration','diffTime','billableseconds','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfereruniqueid','destinationchannel','_attended','transfertargetchannel','origtransfererchannel','userfield','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid-preview','xmcs-queue','xmd-queue','lastapplication','xmd-contactid','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','routeid','sipcallid','newexten','[%s][calls][newexten]','application','appdata','toLowerCase','set','startsWith','cdr','split','substring'];(function(_0x1d2476,_0x1535f3){var _0x3baafd=function(_0x139ab1){while(--_0x139ab1){_0x1d2476['push'](_0x1d2476['shift']());}};_0x3baafd(++_0x1535f3);}(_0xc962,0x6d));var _0x2c96=function(_0x203655,_0x39d847){_0x203655=_0x203655-0x0;var _0x385a0f=_0xc962[_0x203655];return _0x385a0f;};'use strict';var _=require(_0x2c96('0x0'));var util=require('util');var utils=require('./utils');var transfers=require('./transfers.controller');var dispositions=[_0x2c96('0x1'),_0x2c96('0x2'),_0x2c96('0x2'),_0x2c96('0x1'),_0x2c96('0x1'),_0x2c96('0x1'),_0x2c96('0x3'),_0x2c96('0x4'),'FAILED',_0x2c96('0x2'),_0x2c96('0x2')];var channels={};function writeDB(_0x1f9859){var _0x17a493;if(transfers[_0x2c96('0x5')][_0x1f9859[_0x2c96('0x6')]]){_0x17a493=_0x1f9859[_0x2c96('0x6')];_0x1f9859[_0x2c96('0x6')]=transfers[_0x2c96('0x5')][_0x1f9859['uniqueid']]['transfereeuniqueid'];}utils[_0x2c96('0x7')](util[_0x2c96('0x8')](_0x2c96('0x9'),_0x1f9859[_0x2c96('0x6')],_0x1f9859[_0x2c96('0xa')],_0x1f9859[_0x2c96('0xb')],_0x1f9859['membername'],_0x1f9859['interface'],_0x1f9859[_0x2c96('0xc')],_0x1f9859[_0x2c96('0xd')],_0x1f9859[_0x2c96('0xe')]));if(_0x1f9859[_0x2c96('0xf')]){utils[_0x2c96('0x10')](_0x1f9859[_0x2c96('0xf')])[_0x2c96('0x11')](function(_0x534203){if(_0x534203){_0x1f9859['UserId']=_0x534203['id'];}utils['request'](_0x2c96('0x12'),_0x1f9859);});}else{utils[_0x2c96('0x13')]('CreateVoiceCallReport',_0x1f9859);}if(channels[_0x1f9859[_0x2c96('0x6')]]){delete channels[_0x1f9859[_0x2c96('0x6')]];}else if(_0x17a493&&channels[_0x17a493]){if(!transfers['blinds'][_0x17a493][_0x2c96('0x14')])delete transfers[_0x2c96('0x5')][_0x17a493];delete channels[_0x17a493];}}exports[_0x2c96('0x15')]=function(_0x36dc59){try{utils[_0x2c96('0x16')](util[_0x2c96('0x8')](_0x2c96('0x17'),_0x36dc59[_0x2c96('0x6')]),_0x36dc59);if(_0x36dc59[_0x2c96('0x6')]==_0x36dc59['linkedid']&&_0x36dc59['channel']!=_0x2c96('0x18')){utils[_0x2c96('0x7')](util[_0x2c96('0x8')]('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0x36dc59[_0x2c96('0x6')],_0x36dc59[_0x2c96('0x19')],_0x36dc59[_0x2c96('0x1a')]));channels[_0x36dc59['uniqueid']]={'uniqueid':_0x36dc59[_0x2c96('0x6')],'accountcode':_0x36dc59[_0x2c96('0xf')],'source':_0x36dc59['calleridnum'],'destination':_0x36dc59[_0x2c96('0x1a')],'destinationcontext':_0x36dc59[_0x2c96('0x19')],'channel':_0x36dc59[_0x2c96('0xa')],'starttime':utils[_0x2c96('0x1b')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x2c96('0x1'),'amaflags':_0x2c96('0x1c')};}}catch(_0x623e95){utils['error'](util[_0x2c96('0x8')]('[%s][calls][newchannel]',_0x36dc59['uniqueid']),_0x623e95);}};exports[_0x2c96('0x1d')]=function(_0x549313){try{utils[_0x2c96('0x16')](util[_0x2c96('0x8')](_0x2c96('0x1e'),_0x549313[_0x2c96('0x6')]),_0x549313);if(!_['isNil'](channels[_0x549313[_0x2c96('0x6')]])&&_0x549313[_0x2c96('0x1f')]==0x6){utils['info'](util[_0x2c96('0x8')](_0x2c96('0x20'),_0x549313[_0x2c96('0x6')],_0x549313[_0x2c96('0x19')],_0x549313['channel']));if(_[_0x2c96('0x21')](channels[_0x549313[_0x2c96('0x6')]][_0x2c96('0x22')])){channels[_0x549313[_0x2c96('0x6')]]['systemanswertime']=utils[_0x2c96('0x1b')]();}}else if(!_[_0x2c96('0x21')](channels[_0x549313['linkedid']])&&_0x549313[_0x2c96('0x1f')]==0x6&&_0x549313['context']!=_0x2c96('0x23')){utils[_0x2c96('0x7')](util[_0x2c96('0x8')](_0x2c96('0x24'),_0x549313[_0x2c96('0x6')],_0x549313[_0x2c96('0x25')],_0x549313[_0x2c96('0x19')],_0x549313[_0x2c96('0xa')]));channels[_0x549313['linkedid']][_0x2c96('0xf')]=_0x549313[_0x2c96('0xf')];channels[_0x549313[_0x2c96('0x25')]]['destinationchannel']=_0x549313[_0x2c96('0xa')];if(_[_0x2c96('0x21')](channels[_0x549313[_0x2c96('0x25')]]['answertime'])){channels[_0x549313[_0x2c96('0x25')]][_0x2c96('0x26')]=utils[_0x2c96('0x1b')]();}channels[_0x549313[_0x2c96('0x25')]][_0x2c96('0x27')]=dispositions[_['toNumber'](_0x549313[_0x2c96('0x1f')])]||_0x2c96('0x3');}}catch(_0x1fcc52){utils[_0x2c96('0x28')](util[_0x2c96('0x8')](_0x2c96('0x1e'),_0x549313[_0x2c96('0x6')]),_0x1fcc52);}};exports[_0x2c96('0x29')]=function(_0x486b16){try{if(!_['isNil'](channels[_0x486b16[_0x2c96('0x6')]])){utils[_0x2c96('0x16')](util[_0x2c96('0x8')](_0x2c96('0x2a'),_0x486b16['uniqueid']),_0x486b16);if(_[_0x2c96('0x21')](channels[_0x486b16['uniqueid']][_0x2c96('0x2b')])){channels[_0x486b16[_0x2c96('0x6')]][_0x2c96('0x2b')]=_0x486b16[_0x2c96('0x2c')]+'\x20<'+_0x486b16[_0x2c96('0xc')]+'>';}utils['info'](util[_0x2c96('0x8')]('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x486b16[_0x2c96('0x6')],channels[_0x486b16[_0x2c96('0x6')]]['callerid'],_0x486b16['cause-txt']));channels[_0x486b16[_0x2c96('0x6')]][_0x2c96('0x2d')]=utils[_0x2c96('0x1b')]();channels[_0x486b16[_0x2c96('0x6')]][_0x2c96('0x2e')]=utils[_0x2c96('0x2f')](channels[_0x486b16['uniqueid']][_0x2c96('0x2d')],channels[_0x486b16[_0x2c96('0x6')]]['starttime']);channels[_0x486b16['uniqueid']][_0x2c96('0x30')]=channels[_0x486b16[_0x2c96('0x6')]][_0x2c96('0x26')]?utils[_0x2c96('0x2f')](channels[_0x486b16[_0x2c96('0x6')]][_0x2c96('0x2d')],channels[_0x486b16[_0x2c96('0x6')]][_0x2c96('0x26')]):0x0;writeDB(channels[_0x486b16[_0x2c96('0x6')]]);}}catch(_0x53968c){utils[_0x2c96('0x28')](util[_0x2c96('0x8')]('[%s][calls][hangup]',_0x486b16['uniqueid']),_0x53968c);}};exports[_0x2c96('0x31')]=function(_0x48931f){try{if(!_[_0x2c96('0x21')](channels[_0x48931f[_0x2c96('0x32')]])){utils[_0x2c96('0x16')](util[_0x2c96('0x8')](_0x2c96('0x33'),_0x48931f['origtransfereruniqueid']),_0x48931f);if(channels[_0x48931f['localtwolinkedid']][_0x2c96('0xa')]==_0x48931f['transfereechannel']){utils[_0x2c96('0x7')](util[_0x2c96('0x8')](_0x2c96('0x34'),_0x48931f[_0x2c96('0x35')],_0x48931f[_0x2c96('0x32')],_0x48931f['secondtransfererchannel']));channels[_0x48931f[_0x2c96('0x32')]][_0x2c96('0x36')]=_0x48931f['secondtransfererchannel'];channels[_0x48931f[_0x2c96('0x32')]]['userfield']=_0x2c96('0x37');}else if(channels[_0x48931f[_0x2c96('0x32')]][_0x2c96('0xa')]=_0x48931f[_0x2c96('0x38')]){utils[_0x2c96('0x7')](util[_0x2c96('0x8')](_0x2c96('0x34'),_0x48931f[_0x2c96('0x35')],_0x48931f['localtwolinkedid'],_0x48931f[_0x2c96('0x39')]));channels[_0x48931f[_0x2c96('0x32')]][_0x2c96('0x36')]=_0x48931f[_0x2c96('0x39')];channels[_0x48931f['localtwolinkedid']][_0x2c96('0x3a')]=_0x2c96('0x37');}}}catch(_0x422df1){utils[_0x2c96('0x28')](util[_0x2c96('0x8')]('[%s][calls][attendedtransfer]',_0x48931f[_0x2c96('0x35')]),_0x422df1);}};exports[_0x2c96('0x3b')]=function(_0x4a23b5){try{if(!_[_0x2c96('0x21')](channels[_0x4a23b5['uniqueid']])){utils[_0x2c96('0x16')](util[_0x2c96('0x8')](_0x2c96('0x3c'),_0x4a23b5[_0x2c96('0x6')]),_0x4a23b5);channels[_0x4a23b5[_0x2c96('0x6')]][_0x2c96('0x3d')]=utils[_0x2c96('0x1b')]();utils[_0x2c96('0x7')](util[_0x2c96('0x8')](_0x2c96('0x3e'),_0x4a23b5[_0x2c96('0x6')],channels[_0x4a23b5['uniqueid']][_0x2c96('0x3d')]));}}catch(_0x61ac58){utils[_0x2c96('0x28')](util[_0x2c96('0x8')](_0x2c96('0x3c'),_0x4a23b5['uniqueid']),_0x61ac58);}};exports[_0x2c96('0x3f')]=function(_0x54ee48){try{if(!_[_0x2c96('0x21')](channels[_0x54ee48[_0x2c96('0x6')]])){utils['debug'](util[_0x2c96('0x8')](_0x2c96('0x40'),_0x54ee48[_0x2c96('0x6')]),_0x54ee48);if(!_[_0x2c96('0x21')](channels[_0x54ee48[_0x2c96('0x6')]][_0x2c96('0x3d')])){channels[_0x54ee48['uniqueid']][_0x2c96('0x41')]+=utils[_0x2c96('0x2f')](utils['now'](),channels[_0x54ee48[_0x2c96('0x6')]]['musiconholdstartAt']);utils[_0x2c96('0x7')](util['format']('[%s][calls][musiconholdstop]\x20mohtime:%s',_0x54ee48[_0x2c96('0x6')],channels[_0x54ee48[_0x2c96('0x6')]][_0x2c96('0x41')]));delete channels[_0x54ee48['uniqueid']]['musiconholdstartAt'];}}}catch(_0x157b42){utils[_0x2c96('0x28')](util[_0x2c96('0x8')](_0x2c96('0x40'),_0x54ee48[_0x2c96('0x6')]),_0x157b42);}};exports[_0x2c96('0x42')]=function(_0x26ad84){try{if(!_[_0x2c96('0x21')](channels[_0x26ad84[_0x2c96('0x6')]])){utils[_0x2c96('0x16')](util['format'](_0x2c96('0x43'),_0x26ad84[_0x2c96('0x6')]),_0x26ad84);if(!_[_0x2c96('0x21')](_0x26ad84[_0x2c96('0x44')][_0x2c96('0x45')])){utils['info'](util[_0x2c96('0x8')]('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x26ad84[_0x2c96('0x6')],_0x26ad84[_0x2c96('0x46')]));channels[_0x26ad84['uniqueid']][_0x2c96('0x47')]=_0x26ad84[_0x2c96('0x46')];}if(!_['isNil'](_0x26ad84[_0x2c96('0x44')][_0x2c96('0x48')])){utils[_0x2c96('0x7')](util[_0x2c96('0x8')](_0x2c96('0x49'),_0x26ad84[_0x2c96('0x6')],_0x26ad84[_0x2c96('0x46')]));channels[_0x26ad84[_0x2c96('0x6')]]['destination']=_0x26ad84[_0x2c96('0x46')];channels[_0x26ad84['uniqueid']]['callerid']='\x22'+_0x26ad84['value']+'\x22\x20<'+_0x26ad84[_0x2c96('0x46')]+'>';}if(!_[_0x2c96('0x21')](_0x26ad84[_0x2c96('0x44')]['xmd-callerid-preview'])||!_[_0x2c96('0x21')](_0x26ad84['variable'][_0x2c96('0x4a')])){utils[_0x2c96('0x7')](util[_0x2c96('0x8')](_0x2c96('0x4b'),_0x26ad84[_0x2c96('0x6')],!_[_0x2c96('0x21')](_0x26ad84['variable']['xmd-callerid-preview'])?_0x2c96('0x4c'):_0x2c96('0x4a'),_0x26ad84[_0x2c96('0x46')]));channels[_0x26ad84[_0x2c96('0x6')]][_0x2c96('0x2b')]=_0x26ad84['value'];}if(!_['isNil'](_0x26ad84[_0x2c96('0x44')]['xmd-queue'])||!_[_0x2c96('0x21')](_0x26ad84[_0x2c96('0x44')][_0x2c96('0x4d')])){utils[_0x2c96('0x7')](util[_0x2c96('0x8')](_0x2c96('0x4b'),_0x26ad84[_0x2c96('0x6')],!_['isNil'](_0x26ad84[_0x2c96('0x44')]['xmd-queue'])?_0x2c96('0x4e'):_0x2c96('0x4d'),_0x26ad84['value']));channels[_0x26ad84[_0x2c96('0x6')]][_0x2c96('0x4f')]='Queue';channels[_0x26ad84[_0x2c96('0x6')]]['lastdata']=_0x26ad84[_0x2c96('0x46')];channels[_0x26ad84[_0x2c96('0x6')]][_0x2c96('0xb')]=!![];}if(!_[_0x2c96('0x21')](_0x26ad84[_0x2c96('0x44')][_0x2c96('0x50')])){utils[_0x2c96('0x7')](util[_0x2c96('0x8')]('[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s',_0x26ad84[_0x2c96('0x6')],_0x26ad84[_0x2c96('0x46')]));channels[_0x26ad84[_0x2c96('0x6')]][_0x2c96('0x51')]=_0x26ad84[_0x2c96('0x46')];}if(!_[_0x2c96('0x21')](_0x26ad84[_0x2c96('0x44')][_0x2c96('0x52')])){utils[_0x2c96('0x7')](util[_0x2c96('0x8')](_0x2c96('0x53'),_0x26ad84[_0x2c96('0x6')],_0x26ad84[_0x2c96('0x46')]));channels[_0x26ad84[_0x2c96('0x6')]][_0x2c96('0x54')]=_0x26ad84[_0x2c96('0x46')];}if(!_[_0x2c96('0x21')](_0x26ad84[_0x2c96('0x44')]['outboundrouteid'])){utils[_0x2c96('0x7')](util[_0x2c96('0x8')]('[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s',_0x26ad84['uniqueid'],_0x26ad84[_0x2c96('0x46')]));channels[_0x26ad84[_0x2c96('0x6')]][_0x2c96('0x55')]=_0x26ad84['value'];}if(!_[_0x2c96('0x21')](_0x26ad84[_0x2c96('0x44')][_0x2c96('0x56')])){utils[_0x2c96('0x7')](util[_0x2c96('0x8')]('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x26ad84['uniqueid'],_0x26ad84[_0x2c96('0x46')]));channels[_0x26ad84[_0x2c96('0x6')]]['sipcallid']=_0x26ad84[_0x2c96('0x46')];}}}catch(_0x49a9f3){utils['error'](util[_0x2c96('0x8')](_0x2c96('0x43'),_0x26ad84['uniqueid']),_0x49a9f3);}};exports[_0x2c96('0x57')]=function(_0x1904ca){try{if(!_[_0x2c96('0x21')](channels[_0x1904ca['uniqueid']])){utils[_0x2c96('0x16')](util[_0x2c96('0x8')](_0x2c96('0x58'),_0x1904ca[_0x2c96('0x6')]),_0x1904ca);utils[_0x2c96('0x7')](util[_0x2c96('0x8')]('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x1904ca[_0x2c96('0x6')],_0x1904ca[_0x2c96('0x59')],_0x1904ca[_0x2c96('0x5a')]));if(_0x1904ca[_0x2c96('0x59')][_0x2c96('0x5b')]()==_0x2c96('0x5c')&&_[_0x2c96('0x5d')](_0x1904ca[_0x2c96('0x5a')][_0x2c96('0x5b')](),_0x2c96('0x5e'))){var _0x59da83=_0x1904ca[_0x2c96('0x5a')][_0x2c96('0x5f')]('=');var _0x123e08=_0x59da83[0x0][_0x2c96('0x60')](_0x59da83[0x0]['lastIndexOf']('(')+0x1,_0x59da83[0x0][_0x2c96('0x61')](')'));var _0x34ab81=_0x59da83[0x1];channels[_0x1904ca['uniqueid']][_0x123e08]=_0x34ab81;}if(!_[_0x2c96('0x62')]([_0x2c96('0x29'),_0x2c96('0x63'),_0x2c96('0x64'),_0x2c96('0x5c'),_0x2c96('0x65')],_0x1904ca['application']['toLowerCase']())){channels[_0x1904ca[_0x2c96('0x6')]]['lastapplication']=_0x1904ca[_0x2c96('0x59')];channels[_0x1904ca['uniqueid']][_0x2c96('0x66')]=_0x1904ca[_0x2c96('0x5a')];}}}catch(_0x3b2196){utils[_0x2c96('0x28')](util[_0x2c96('0x8')](_0x2c96('0x58'),_0x1904ca[_0x2c96('0x6')]),_0x3b2196);}}; \ No newline at end of file +var _0x3e47=['_attended','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmcs-queue','xmd-queue','lastapplication','Queue','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','appdata','set','toLowerCase','cdr','substring','lastIndexOf','includes','hangup','gotoif','application','lastdata','lodash','util','./utils','NO\x20ANSWER','FAILED','ANSWERED','BUSY','info','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','queue','membername','connectedlinenum','accountcode','then','UserId','request','CreateVoiceCallReport','newchannel','debug','[%s][calls][newchannel]','channel','OutgoingSpoolFailed','format','context','calleridnum','exten','now','newstate','[%s][calls][newstate]','[%s][calls][newstate]\x20context:%s\x20channel:%s','isNil','systemanswertime','linkedid','channelstate','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','error','[%s][calls][hangup]','callerid','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','duration','diffTime','endtime','billableseconds','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','transfertargetchannel','origtransfererchannel'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x3e47,0x97));var _0x73e4=function(_0x1ad901,_0x852d9e){_0x1ad901=_0x1ad901-0x0;var _0x3c0249=_0x3e47[_0x1ad901];return _0x3c0249;};'use strict';var _=require(_0x73e4('0x0'));var util=require(_0x73e4('0x1'));var utils=require(_0x73e4('0x2'));var dispositions=[_0x73e4('0x3'),_0x73e4('0x4'),_0x73e4('0x4'),'NO\x20ANSWER','NO\x20ANSWER',_0x73e4('0x3'),_0x73e4('0x5'),_0x73e4('0x6'),_0x73e4('0x4'),_0x73e4('0x4'),_0x73e4('0x4')];var channels={};function writeDB(_0x32c739){utils[_0x73e4('0x7')](util['format'](_0x73e4('0x8'),_0x32c739[_0x73e4('0x9')],_0x32c739['channel'],_0x32c739[_0x73e4('0xa')],_0x32c739[_0x73e4('0xb')],_0x32c739['interface'],_0x32c739['calleridnum'],_0x32c739[_0x73e4('0xc')],_0x32c739['lastevent']));if(_0x32c739[_0x73e4('0xd')]){utils['getUserByInternal'](_0x32c739[_0x73e4('0xd')])[_0x73e4('0xe')](function(_0x320164){if(_0x320164){_0x32c739[_0x73e4('0xf')]=_0x320164['id'];}utils[_0x73e4('0x10')](_0x73e4('0x11'),_0x32c739);});}else{utils[_0x73e4('0x10')](_0x73e4('0x11'),_0x32c739);}if(channels[_0x32c739[_0x73e4('0x9')]]){delete channels[_0x32c739['uniqueid']];}}exports[_0x73e4('0x12')]=function(_0x1e4988){try{utils[_0x73e4('0x13')](util['format'](_0x73e4('0x14'),_0x1e4988[_0x73e4('0x9')]),_0x1e4988);if(_0x1e4988[_0x73e4('0x9')]==_0x1e4988['linkedid']&&_0x1e4988[_0x73e4('0x15')]!=_0x73e4('0x16')){utils[_0x73e4('0x7')](util[_0x73e4('0x17')]('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0x1e4988[_0x73e4('0x9')],_0x1e4988[_0x73e4('0x18')],_0x1e4988['exten']));channels[_0x1e4988[_0x73e4('0x9')]]={'uniqueid':_0x1e4988['uniqueid'],'accountcode':_0x1e4988['accountcode'],'source':_0x1e4988[_0x73e4('0x19')],'destination':_0x1e4988[_0x73e4('0x1a')],'destinationcontext':_0x1e4988['context'],'channel':_0x1e4988[_0x73e4('0x15')],'starttime':utils[_0x73e4('0x1b')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':'DOCUMENTATION'};}}catch(_0x213c29){utils['error'](util[_0x73e4('0x17')](_0x73e4('0x14'),_0x1e4988['uniqueid']),_0x213c29);}};exports[_0x73e4('0x1c')]=function(_0x41bad5){try{utils[_0x73e4('0x13')](util['format'](_0x73e4('0x1d'),_0x41bad5[_0x73e4('0x9')]),_0x41bad5);if(!_['isNil'](channels[_0x41bad5[_0x73e4('0x9')]])&&_0x41bad5['channelstate']==0x6){utils[_0x73e4('0x7')](util[_0x73e4('0x17')](_0x73e4('0x1e'),_0x41bad5[_0x73e4('0x9')],_0x41bad5[_0x73e4('0x18')],_0x41bad5['channel']));if(_[_0x73e4('0x1f')](channels[_0x41bad5[_0x73e4('0x9')]][_0x73e4('0x20')])){channels[_0x41bad5[_0x73e4('0x9')]][_0x73e4('0x20')]=utils[_0x73e4('0x1b')]();}}else if(!_[_0x73e4('0x1f')](channels[_0x41bad5[_0x73e4('0x21')]])&&_0x41bad5[_0x73e4('0x22')]==0x6&&_0x41bad5[_0x73e4('0x18')]!=_0x73e4('0x23')){utils[_0x73e4('0x7')](util[_0x73e4('0x17')](_0x73e4('0x24'),_0x41bad5[_0x73e4('0x9')],_0x41bad5[_0x73e4('0x21')],_0x41bad5['context'],_0x41bad5[_0x73e4('0x15')]));channels[_0x41bad5[_0x73e4('0x21')]]['accountcode']=_0x41bad5[_0x73e4('0xd')];channels[_0x41bad5[_0x73e4('0x21')]][_0x73e4('0x25')]=_0x41bad5[_0x73e4('0x15')];if(_['isNil'](channels[_0x41bad5['linkedid']][_0x73e4('0x26')])){channels[_0x41bad5[_0x73e4('0x21')]][_0x73e4('0x26')]=utils['now']();}channels[_0x41bad5[_0x73e4('0x21')]][_0x73e4('0x27')]=dispositions[_[_0x73e4('0x28')](_0x41bad5['channelstate'])]||'ANSWERED';}}catch(_0x2ec9f2){utils[_0x73e4('0x29')](util[_0x73e4('0x17')](_0x73e4('0x1d'),_0x41bad5[_0x73e4('0x9')]),_0x2ec9f2);}};exports['hangup']=function(_0x21bb33){try{if(!_['isNil'](channels[_0x21bb33[_0x73e4('0x9')]])){utils[_0x73e4('0x13')](util[_0x73e4('0x17')](_0x73e4('0x2a'),_0x21bb33[_0x73e4('0x9')]),_0x21bb33);if(_[_0x73e4('0x1f')](channels[_0x21bb33[_0x73e4('0x9')]][_0x73e4('0x2b')])){channels[_0x21bb33[_0x73e4('0x9')]][_0x73e4('0x2b')]=_0x21bb33['calleridname']+'\x20<'+_0x21bb33[_0x73e4('0x19')]+'>';}utils[_0x73e4('0x7')](util[_0x73e4('0x17')](_0x73e4('0x2c'),_0x21bb33[_0x73e4('0x9')],channels[_0x21bb33[_0x73e4('0x9')]][_0x73e4('0x2b')],_0x21bb33[_0x73e4('0x2d')]));channels[_0x21bb33[_0x73e4('0x9')]]['endtime']=utils['now']();channels[_0x21bb33['uniqueid']][_0x73e4('0x2e')]=utils[_0x73e4('0x2f')](channels[_0x21bb33['uniqueid']][_0x73e4('0x30')],channels[_0x21bb33[_0x73e4('0x9')]]['starttime']);channels[_0x21bb33['uniqueid']][_0x73e4('0x31')]=channels[_0x21bb33[_0x73e4('0x9')]]['answertime']?utils[_0x73e4('0x2f')](channels[_0x21bb33[_0x73e4('0x9')]][_0x73e4('0x30')],channels[_0x21bb33[_0x73e4('0x9')]][_0x73e4('0x26')]):0x0;writeDB(channels[_0x21bb33[_0x73e4('0x9')]]);}}catch(_0x2ad473){utils[_0x73e4('0x29')](util['format'](_0x73e4('0x2a'),_0x21bb33['uniqueid']),_0x2ad473);}};exports[_0x73e4('0x32')]=function(_0x8d8194){try{if(!_[_0x73e4('0x1f')](channels[_0x8d8194[_0x73e4('0x33')]])){utils[_0x73e4('0x13')](util[_0x73e4('0x17')](_0x73e4('0x34'),_0x8d8194[_0x73e4('0x35')]),_0x8d8194);if(channels[_0x8d8194[_0x73e4('0x33')]][_0x73e4('0x15')]==_0x8d8194['transfereechannel']){utils[_0x73e4('0x7')](util['format'](_0x73e4('0x36'),_0x8d8194[_0x73e4('0x35')],_0x8d8194[_0x73e4('0x33')],_0x8d8194[_0x73e4('0x37')]));channels[_0x8d8194[_0x73e4('0x33')]]['destinationchannel']=_0x8d8194['secondtransfererchannel'];channels[_0x8d8194[_0x73e4('0x33')]][_0x73e4('0x38')]='_attended';}else if(channels[_0x8d8194[_0x73e4('0x33')]][_0x73e4('0x15')]=_0x8d8194[_0x73e4('0x39')]){utils[_0x73e4('0x7')](util['format'](_0x73e4('0x36'),_0x8d8194[_0x73e4('0x35')],_0x8d8194[_0x73e4('0x33')],_0x8d8194[_0x73e4('0x3a')]));channels[_0x8d8194[_0x73e4('0x33')]]['destinationchannel']=_0x8d8194['origtransfererchannel'];channels[_0x8d8194[_0x73e4('0x33')]][_0x73e4('0x38')]=_0x73e4('0x3b');}}}catch(_0x2a2ee0){utils['error'](util['format'](_0x73e4('0x34'),_0x8d8194[_0x73e4('0x35')]),_0x2a2ee0);}};exports[_0x73e4('0x3c')]=function(_0xf6ea8d){try{if(!_[_0x73e4('0x1f')](channels[_0xf6ea8d[_0x73e4('0x9')]])){utils[_0x73e4('0x13')](util[_0x73e4('0x17')](_0x73e4('0x3d'),_0xf6ea8d[_0x73e4('0x9')]),_0xf6ea8d);channels[_0xf6ea8d['uniqueid']][_0x73e4('0x3e')]=utils[_0x73e4('0x1b')]();utils['info'](util[_0x73e4('0x17')]('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0xf6ea8d[_0x73e4('0x9')],channels[_0xf6ea8d[_0x73e4('0x9')]]['musiconholdstartAt']));}}catch(_0x4768fd){utils['error'](util['format'](_0x73e4('0x3d'),_0xf6ea8d[_0x73e4('0x9')]),_0x4768fd);}};exports[_0x73e4('0x3f')]=function(_0x514f2e){try{if(!_[_0x73e4('0x1f')](channels[_0x514f2e[_0x73e4('0x9')]])){utils['debug'](util[_0x73e4('0x17')](_0x73e4('0x40'),_0x514f2e['uniqueid']),_0x514f2e);if(!_[_0x73e4('0x1f')](channels[_0x514f2e[_0x73e4('0x9')]][_0x73e4('0x3e')])){channels[_0x514f2e[_0x73e4('0x9')]][_0x73e4('0x41')]+=utils[_0x73e4('0x2f')](utils[_0x73e4('0x1b')](),channels[_0x514f2e[_0x73e4('0x9')]][_0x73e4('0x3e')]);utils[_0x73e4('0x7')](util[_0x73e4('0x17')](_0x73e4('0x42'),_0x514f2e[_0x73e4('0x9')],channels[_0x514f2e['uniqueid']][_0x73e4('0x41')]));delete channels[_0x514f2e[_0x73e4('0x9')]][_0x73e4('0x3e')];}}}catch(_0x222ecd){utils[_0x73e4('0x29')](util['format'](_0x73e4('0x40'),_0x514f2e[_0x73e4('0x9')]),_0x222ecd);}};exports['varset']=function(_0x37ae56){try{if(!_[_0x73e4('0x1f')](channels[_0x37ae56[_0x73e4('0x9')]])){utils[_0x73e4('0x13')](util['format'](_0x73e4('0x43'),_0x37ae56['uniqueid']),_0x37ae56);if(!_[_0x73e4('0x1f')](_0x37ae56[_0x73e4('0x44')][_0x73e4('0x45')])){utils[_0x73e4('0x7')](util[_0x73e4('0x17')](_0x73e4('0x46'),_0x37ae56[_0x73e4('0x9')],_0x37ae56[_0x73e4('0x47')]));channels[_0x37ae56[_0x73e4('0x9')]][_0x73e4('0x48')]=_0x37ae56[_0x73e4('0x47')];}if(!_[_0x73e4('0x1f')](_0x37ae56[_0x73e4('0x44')]['xmd-phone'])){utils[_0x73e4('0x7')](util[_0x73e4('0x17')]('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0x37ae56['uniqueid'],_0x37ae56['value']));channels[_0x37ae56[_0x73e4('0x9')]][_0x73e4('0x49')]=_0x37ae56[_0x73e4('0x47')];channels[_0x37ae56[_0x73e4('0x9')]]['callerid']='\x22'+_0x37ae56[_0x73e4('0x47')]+_0x73e4('0x4a')+_0x37ae56['value']+'>';}if(!_[_0x73e4('0x1f')](_0x37ae56['variable'][_0x73e4('0x4b')])||!_['isNil'](_0x37ae56['variable'][_0x73e4('0x4c')])){utils[_0x73e4('0x7')](util[_0x73e4('0x17')](_0x73e4('0x4d'),_0x37ae56[_0x73e4('0x9')],!_[_0x73e4('0x1f')](_0x37ae56[_0x73e4('0x44')][_0x73e4('0x4b')])?_0x73e4('0x4b'):_0x73e4('0x4c'),_0x37ae56['value']));channels[_0x37ae56[_0x73e4('0x9')]][_0x73e4('0x2b')]=_0x37ae56['value'];}if(!_[_0x73e4('0x1f')](_0x37ae56[_0x73e4('0x44')]['xmd-queue'])||!_[_0x73e4('0x1f')](_0x37ae56[_0x73e4('0x44')][_0x73e4('0x4e')])){utils['info'](util[_0x73e4('0x17')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x37ae56[_0x73e4('0x9')],!_[_0x73e4('0x1f')](_0x37ae56['variable'][_0x73e4('0x4f')])?_0x73e4('0x4f'):_0x73e4('0x4e'),_0x37ae56['value']));channels[_0x37ae56[_0x73e4('0x9')]][_0x73e4('0x50')]=_0x73e4('0x51');channels[_0x37ae56[_0x73e4('0x9')]]['lastdata']=_0x37ae56[_0x73e4('0x47')];channels[_0x37ae56[_0x73e4('0x9')]][_0x73e4('0xa')]=!![];}if(!_[_0x73e4('0x1f')](_0x37ae56['variable']['xmd-contactid'])){utils['info'](util[_0x73e4('0x17')](_0x73e4('0x52'),_0x37ae56[_0x73e4('0x9')],_0x37ae56['value']));channels[_0x37ae56[_0x73e4('0x9')]][_0x73e4('0x53')]=_0x37ae56[_0x73e4('0x47')];}if(!_[_0x73e4('0x1f')](_0x37ae56['variable'][_0x73e4('0x54')])){utils[_0x73e4('0x7')](util[_0x73e4('0x17')](_0x73e4('0x55'),_0x37ae56[_0x73e4('0x9')],_0x37ae56[_0x73e4('0x47')]));channels[_0x37ae56[_0x73e4('0x9')]][_0x73e4('0x56')]=_0x37ae56[_0x73e4('0x47')];}if(!_[_0x73e4('0x1f')](_0x37ae56[_0x73e4('0x44')][_0x73e4('0x57')])){utils[_0x73e4('0x7')](util[_0x73e4('0x17')](_0x73e4('0x58'),_0x37ae56[_0x73e4('0x9')],_0x37ae56['value']));channels[_0x37ae56[_0x73e4('0x9')]][_0x73e4('0x59')]=_0x37ae56[_0x73e4('0x47')];}if(!_[_0x73e4('0x1f')](_0x37ae56['variable'][_0x73e4('0x5a')])){utils['info'](util[_0x73e4('0x17')](_0x73e4('0x5b'),_0x37ae56[_0x73e4('0x9')],_0x37ae56['value']));channels[_0x37ae56[_0x73e4('0x9')]]['sipcallid']=_0x37ae56[_0x73e4('0x47')];}}}catch(_0x5c9693){utils['error'](util['format'](_0x73e4('0x43'),_0x37ae56[_0x73e4('0x9')]),_0x5c9693);}};exports['newexten']=function(_0x43b8f4){try{if(!_[_0x73e4('0x1f')](channels[_0x43b8f4[_0x73e4('0x9')]])){utils[_0x73e4('0x13')](util[_0x73e4('0x17')](_0x73e4('0x5c'),_0x43b8f4[_0x73e4('0x9')]),_0x43b8f4);utils[_0x73e4('0x7')](util[_0x73e4('0x17')](_0x73e4('0x5d'),_0x43b8f4[_0x73e4('0x9')],_0x43b8f4['application'],_0x43b8f4[_0x73e4('0x5e')]));if(_0x43b8f4['application']['toLowerCase']()==_0x73e4('0x5f')&&_['startsWith'](_0x43b8f4[_0x73e4('0x5e')][_0x73e4('0x60')](),_0x73e4('0x61'))){var _0x21f005=_0x43b8f4['appdata']['split']('=');var _0x842309=_0x21f005[0x0][_0x73e4('0x62')](_0x21f005[0x0]['lastIndexOf']('(')+0x1,_0x21f005[0x0][_0x73e4('0x63')](')'));var _0x18f113=_0x21f005[0x1];channels[_0x43b8f4[_0x73e4('0x9')]][_0x842309]=_0x18f113;}if(!_[_0x73e4('0x64')]([_0x73e4('0x65'),'noop','execif','set',_0x73e4('0x66')],_0x43b8f4[_0x73e4('0x67')]['toLowerCase']())){channels[_0x43b8f4['uniqueid']][_0x73e4('0x50')]=_0x43b8f4['application'];channels[_0x43b8f4[_0x73e4('0x9')]][_0x73e4('0x68')]=_0x43b8f4[_0x73e4('0x5e')];}}}catch(_0x55e61e){utils[_0x73e4('0x29')](util['format'](_0x73e4('0x5c'),_0x43b8f4[_0x73e4('0x9')]),_0x55e61e);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index d8a8018..ed67e39 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 _0x81a5=['[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error','close','info','[core]\x20connected','shutdown'];(function(_0xa2bf0b,_0x43563d){var _0x106286=function(_0x7e5f53){while(--_0x7e5f53){_0xa2bf0b['push'](_0xa2bf0b['shift']());}};_0x106286(++_0x43563d);}(_0x81a5,0x7b));var _0x581a=function(_0x4a8089,_0x5b47ad){_0x4a8089=_0x4a8089-0x0;var _0xcbbffa=_0x81a5[_0x4a8089];return _0xcbbffa;};'use strict';var utils=require('./utils');exports['connect']=function(){utils[_0x581a('0x0')](_0x581a('0x1'));};exports[_0x581a('0x2')]=function(){utils['info'](_0x581a('0x3'));};exports[_0x581a('0x4')]=function(){utils['info'](_0x581a('0x5'));};exports[_0x581a('0x6')]=function(_0x24d610){utils['error'](_0x581a('0x7'),_0x24d610);};exports[_0x581a('0x8')]=function(){utils['info']('[core]\x20close');};exports['managerevent']=function(_0x3c03bf){}; \ No newline at end of file +var _0xecad=['close','managerevent','connect','[core]\x20connected','[core]\x20shutdown','fullybooted','info','[core]\x20fullybooted','error'];(function(_0x3c8e9a,_0x384306){var _0x2d4c57=function(_0x43d408){while(--_0x43d408){_0x3c8e9a['push'](_0x3c8e9a['shift']());}};_0x2d4c57(++_0x384306);}(_0xecad,0x173));var _0xdeca=function(_0x22f85a,_0x195ed5){_0x22f85a=_0x22f85a-0x0;var _0xaa717=_0xecad[_0x22f85a];return _0xaa717;};'use strict';var utils=require('./utils');exports[_0xdeca('0x0')]=function(){utils['info'](_0xdeca('0x1'));};exports['shutdown']=function(){utils['info'](_0xdeca('0x2'));};exports[_0xdeca('0x3')]=function(){utils[_0xdeca('0x4')](_0xdeca('0x5'));};exports[_0xdeca('0x6')]=function(_0x14465a){utils['error']('[core]\x20error',_0x14465a);};exports[_0xdeca('0x7')]=function(){utils[_0xdeca('0x4')]('[core]\x20close');};exports[_0xdeca('0x8')]=function(_0x22453d){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 65b9dd5..16f4422 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 _0xcc77=['diffTime','endtime','holdtime','billableseconds','./utils','info','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','newexten','debug','[%s][dials][newexten]','format','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','cdr(routeid)','split','varset','[%s][dials][varset]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','error','dialbegin','assign','starttime','now','[%s][dials][dialbegin]','[%s][dials][dialend]','ANSWER','lastevent','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','answertime','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][hangup]','cause-txt','complete'];(function(_0x2dd25a,_0x473907){var _0x59f26c=function(_0x4d2253){while(--_0x4d2253){_0x2dd25a['push'](_0x2dd25a['shift']());}};_0x59f26c(++_0x473907);}(_0xcc77,0x174));var _0x7cc7=function(_0x5eef6e,_0x45c35e){_0x5eef6e=_0x5eef6e-0x0;var _0x6c758f=_0xcc77[_0x5eef6e];return _0x6c758f;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x7cc7('0x0'));var dials={};function writeDB(_0x15debf){utils[_0x7cc7('0x1')](util['format'](_0x7cc7('0x2'),_0x15debf[_0x7cc7('0x3')],_0x15debf[_0x7cc7('0x4')],_0x15debf[_0x7cc7('0x5')],_0x15debf[_0x7cc7('0x6')],_0x15debf[_0x7cc7('0x7')],_0x15debf[_0x7cc7('0x8')]));utils[_0x7cc7('0x9')](_0x7cc7('0xa'),_0x15debf);delete dials[_0x15debf['uniqueid']];}exports[_0x7cc7('0xb')]=function(_0x185627){try{utils[_0x7cc7('0xc')](util['format'](_0x7cc7('0xd'),_0x185627[_0x7cc7('0x3')]),_0x185627);utils[_0x7cc7('0x1')](util[_0x7cc7('0xe')](_0x7cc7('0xf'),_0x185627[_0x7cc7('0x3')],_0x185627[_0x7cc7('0x10')],_0x185627[_0x7cc7('0x11')]));if(_0x185627[_0x7cc7('0x10')]['toLowerCase']()=='set'&&_['startsWith'](_0x185627[_0x7cc7('0x11')]['toLowerCase'](),_0x7cc7('0x12'))){var _0x46c7d1=_0x185627[_0x7cc7('0x11')][_0x7cc7('0x13')]('=');dials[_0x185627[_0x7cc7('0x3')]]={'routeId':_0x46c7d1[0x1]};}}catch(_0xe26b95){utils['error'](util[_0x7cc7('0xe')]('[%s][dials][newexten]',_0x185627[_0x7cc7('0x3')]),_0xe26b95);}};exports[_0x7cc7('0x14')]=function(_0x2e7ffb){try{utils[_0x7cc7('0xc')](util['format'](_0x7cc7('0x15'),_0x2e7ffb[_0x7cc7('0x3')]),_0x2e7ffb);if(!_[_0x7cc7('0x16')](_0x2e7ffb[_0x7cc7('0x17')][_0x7cc7('0x18')])){utils[_0x7cc7('0x1')](util[_0x7cc7('0xe')](_0x7cc7('0x19'),_0x2e7ffb[_0x7cc7('0x3')],_0x2e7ffb[_0x7cc7('0x1a')]));dials[_0x2e7ffb['uniqueid']]={'routeId':_0x2e7ffb[_0x7cc7('0x1a')]};}}catch(_0x279118){utils[_0x7cc7('0x1b')](util[_0x7cc7('0xe')](_0x7cc7('0x15'),_0x2e7ffb[_0x7cc7('0x3')]),_0x279118);}};exports[_0x7cc7('0x1c')]=function(_0x34178d){try{if(!_[_0x7cc7('0x16')](dials[_0x34178d[_0x7cc7('0x3')]])){utils[_0x7cc7('0xc')](util[_0x7cc7('0xe')]('[%s][dials][dialbegin]',_0x34178d[_0x7cc7('0x3')]),_0x34178d);dials[_0x34178d[_0x7cc7('0x3')]]=_[_0x7cc7('0x1d')](dials[_0x34178d[_0x7cc7('0x3')]],_0x34178d);dials[_0x34178d[_0x7cc7('0x3')]][_0x7cc7('0x1e')]=utils[_0x7cc7('0x1f')]();dials[_0x34178d[_0x7cc7('0x3')]]['lastevent']='called';utils[_0x7cc7('0x1')](util[_0x7cc7('0xe')]('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x34178d['uniqueid'],dials[_0x34178d[_0x7cc7('0x3')]][_0x7cc7('0x1e')]));}}catch(_0x3297e7){utils[_0x7cc7('0x1b')](util[_0x7cc7('0xe')](_0x7cc7('0x20'),_0x34178d[_0x7cc7('0x3')]),_0x3297e7);}};exports['dialend']=function(_0x3507b2){try{if(!_[_0x7cc7('0x16')](dials[_0x3507b2['uniqueid']])){utils['debug'](util[_0x7cc7('0xe')](_0x7cc7('0x21'),_0x3507b2[_0x7cc7('0x3')]),_0x3507b2);dials[_0x3507b2[_0x7cc7('0x3')]][_0x7cc7('0x8')]=_0x3507b2[_0x7cc7('0x8')];if(_0x3507b2[_0x7cc7('0x8')]==_0x7cc7('0x22')){dials[_0x3507b2[_0x7cc7('0x3')]]=_[_0x7cc7('0x1d')](dials[_0x3507b2[_0x7cc7('0x3')]],_0x3507b2);dials[_0x3507b2['uniqueid']]['answertime']=utils[_0x7cc7('0x1f')]();dials[_0x3507b2[_0x7cc7('0x3')]][_0x7cc7('0x23')]='connect';utils['info'](util[_0x7cc7('0xe')](_0x7cc7('0x24'),_0x3507b2[_0x7cc7('0x3')],_0x3507b2['dialstatus'],dials[_0x3507b2[_0x7cc7('0x3')]][_0x7cc7('0x25')]));}else{utils[_0x7cc7('0x1')](util[_0x7cc7('0xe')](_0x7cc7('0x26'),_0x3507b2[_0x7cc7('0x3')],_0x3507b2[_0x7cc7('0x8')]));}}}catch(_0x3c466a){utils[_0x7cc7('0x1b')](util['format']('[%s][dials][dialend]',_0x3507b2['uniqueid']),_0x3c466a);}};exports['hangup']=function(_0x1dd631){try{if(!_[_0x7cc7('0x16')](dials[_0x1dd631[_0x7cc7('0x3')]])){utils[_0x7cc7('0xc')](util[_0x7cc7('0xe')](_0x7cc7('0x27'),_0x1dd631['uniqueid']),_0x1dd631);utils[_0x7cc7('0x1')](util[_0x7cc7('0xe')]('[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s',_0x1dd631[_0x7cc7('0x3')],_0x1dd631[_0x7cc7('0x6')],_0x1dd631['calleridname'],_0x1dd631[_0x7cc7('0x28')]));dials[_0x1dd631[_0x7cc7('0x3')]]=_[_0x7cc7('0x1d')](dials[_0x1dd631[_0x7cc7('0x3')]],{'endtime':utils[_0x7cc7('0x1f')](),'lastevent':_0x7cc7('0x29')});dials[_0x1dd631[_0x7cc7('0x3')]]['duration']=utils[_0x7cc7('0x2a')](dials[_0x1dd631['uniqueid']][_0x7cc7('0x2b')],dials[_0x1dd631[_0x7cc7('0x3')]][_0x7cc7('0x1e')]);dials[_0x1dd631['uniqueid']][_0x7cc7('0x2c')]=utils[_0x7cc7('0x2a')](dials[_0x1dd631['uniqueid']]['answertime']||dials[_0x1dd631[_0x7cc7('0x3')]][_0x7cc7('0x2b')],dials[_0x1dd631[_0x7cc7('0x3')]][_0x7cc7('0x1e')]);dials[_0x1dd631[_0x7cc7('0x3')]][_0x7cc7('0x2d')]=dials[_0x1dd631[_0x7cc7('0x3')]][_0x7cc7('0x25')]?utils[_0x7cc7('0x2a')](dials[_0x1dd631[_0x7cc7('0x3')]][_0x7cc7('0x2b')],dials[_0x1dd631['uniqueid']]['answertime']):0x0;writeDB(dials[_0x1dd631['uniqueid']]);}}catch(_0x362eff){utils[_0x7cc7('0x1b')](util[_0x7cc7('0xe')](_0x7cc7('0x27'),_0x1dd631[_0x7cc7('0x3')]),_0x362eff);}}; \ No newline at end of file +var _0x57dc=['cause-txt','complete','duration','endtime','holdtime','billableseconds','diffTime','util','./utils','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','calleridnum','connectedlinenum','dialstatus','debug','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','startsWith','cdr(routeid)','[%s][dials][varset]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','error','dialbegin','[%s][dials][dialbegin]','assign','starttime','lastevent','called','info','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','[%s][dials][dialend]','ANSWER','answertime','now','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname'];(function(_0x1c5fee,_0x235491){var _0x1f39a9=function(_0x229b57){while(--_0x229b57){_0x1c5fee['push'](_0x1c5fee['shift']());}};_0x1f39a9(++_0x235491);}(_0x57dc,0x165));var _0xc57d=function(_0xb4cc12,_0x41436e){_0xb4cc12=_0xb4cc12-0x0;var _0x8593b5=_0x57dc[_0xb4cc12];return _0x8593b5;};'use strict';var _=require('lodash');var util=require(_0xc57d('0x0'));var utils=require(_0xc57d('0x1'));var dials={};function writeDB(_0x141edf){utils['info'](util[_0xc57d('0x2')](_0xc57d('0x3'),_0x141edf[_0xc57d('0x4')],_0x141edf['channel'],_0x141edf['dialstring'],_0x141edf[_0xc57d('0x5')],_0x141edf[_0xc57d('0x6')],_0x141edf[_0xc57d('0x7')]));utils['request']('CreateVoiceDialReport',_0x141edf);delete dials[_0x141edf['uniqueid']];}exports['newexten']=function(_0x261ea2){try{utils[_0xc57d('0x8')](util[_0xc57d('0x2')](_0xc57d('0x9'),_0x261ea2[_0xc57d('0x4')]),_0x261ea2);utils['info'](util[_0xc57d('0x2')](_0xc57d('0xa'),_0x261ea2[_0xc57d('0x4')],_0x261ea2[_0xc57d('0xb')],_0x261ea2[_0xc57d('0xc')]));if(_0x261ea2[_0xc57d('0xb')][_0xc57d('0xd')]()=='set'&&_[_0xc57d('0xe')](_0x261ea2[_0xc57d('0xc')][_0xc57d('0xd')](),_0xc57d('0xf'))){var _0xb7ed9d=_0x261ea2[_0xc57d('0xc')]['split']('=');dials[_0x261ea2[_0xc57d('0x4')]]={'routeId':_0xb7ed9d[0x1]};}}catch(_0x19a478){utils['error'](util[_0xc57d('0x2')](_0xc57d('0x9'),_0x261ea2[_0xc57d('0x4')]),_0x19a478);}};exports['varset']=function(_0x5084f7){try{utils['debug'](util[_0xc57d('0x2')](_0xc57d('0x10'),_0x5084f7['uniqueid']),_0x5084f7);if(!_[_0xc57d('0x11')](_0x5084f7[_0xc57d('0x12')][_0xc57d('0x13')])){utils['info'](util[_0xc57d('0x2')](_0xc57d('0x14'),_0x5084f7[_0xc57d('0x4')],_0x5084f7['value']));dials[_0x5084f7[_0xc57d('0x4')]]={'routeId':_0x5084f7[_0xc57d('0x15')]};}}catch(_0x310426){utils[_0xc57d('0x16')](util[_0xc57d('0x2')](_0xc57d('0x10'),_0x5084f7['uniqueid']),_0x310426);}};exports[_0xc57d('0x17')]=function(_0x5ca7f7){try{if(!_['isNil'](dials[_0x5ca7f7['uniqueid']])){utils[_0xc57d('0x8')](util[_0xc57d('0x2')](_0xc57d('0x18'),_0x5ca7f7[_0xc57d('0x4')]),_0x5ca7f7);dials[_0x5ca7f7[_0xc57d('0x4')]]=_[_0xc57d('0x19')](dials[_0x5ca7f7[_0xc57d('0x4')]],_0x5ca7f7);dials[_0x5ca7f7[_0xc57d('0x4')]][_0xc57d('0x1a')]=utils['now']();dials[_0x5ca7f7[_0xc57d('0x4')]][_0xc57d('0x1b')]=_0xc57d('0x1c');utils[_0xc57d('0x1d')](util[_0xc57d('0x2')](_0xc57d('0x1e'),_0x5ca7f7[_0xc57d('0x4')],dials[_0x5ca7f7[_0xc57d('0x4')]][_0xc57d('0x1a')]));}}catch(_0x301ccf){utils['error'](util['format']('[%s][dials][dialbegin]',_0x5ca7f7[_0xc57d('0x4')]),_0x301ccf);}};exports[_0xc57d('0x1f')]=function(_0x260a29){try{if(!_[_0xc57d('0x11')](dials[_0x260a29[_0xc57d('0x4')]])){utils[_0xc57d('0x8')](util[_0xc57d('0x2')](_0xc57d('0x20'),_0x260a29[_0xc57d('0x4')]),_0x260a29);dials[_0x260a29[_0xc57d('0x4')]][_0xc57d('0x7')]=_0x260a29[_0xc57d('0x7')];if(_0x260a29['dialstatus']==_0xc57d('0x21')){dials[_0x260a29[_0xc57d('0x4')]]=_[_0xc57d('0x19')](dials[_0x260a29[_0xc57d('0x4')]],_0x260a29);dials[_0x260a29[_0xc57d('0x4')]][_0xc57d('0x22')]=utils[_0xc57d('0x23')]();dials[_0x260a29[_0xc57d('0x4')]][_0xc57d('0x1b')]=_0xc57d('0x24');utils[_0xc57d('0x1d')](util[_0xc57d('0x2')](_0xc57d('0x25'),_0x260a29[_0xc57d('0x4')],_0x260a29[_0xc57d('0x7')],dials[_0x260a29[_0xc57d('0x4')]]['answertime']));}else{utils[_0xc57d('0x1d')](util['format'](_0xc57d('0x26'),_0x260a29[_0xc57d('0x4')],_0x260a29[_0xc57d('0x7')]));}}}catch(_0x58919c){utils['error'](util[_0xc57d('0x2')](_0xc57d('0x20'),_0x260a29[_0xc57d('0x4')]),_0x58919c);}};exports[_0xc57d('0x27')]=function(_0x1cc4c9){try{if(!_['isNil'](dials[_0x1cc4c9['uniqueid']])){utils['debug'](util[_0xc57d('0x2')](_0xc57d('0x28'),_0x1cc4c9[_0xc57d('0x4')]),_0x1cc4c9);utils[_0xc57d('0x1d')](util[_0xc57d('0x2')](_0xc57d('0x29'),_0x1cc4c9[_0xc57d('0x4')],_0x1cc4c9['calleridnum'],_0x1cc4c9[_0xc57d('0x2a')],_0x1cc4c9[_0xc57d('0x2b')]));dials[_0x1cc4c9['uniqueid']]=_[_0xc57d('0x19')](dials[_0x1cc4c9['uniqueid']],{'endtime':utils['now'](),'lastevent':_0xc57d('0x2c')});dials[_0x1cc4c9[_0xc57d('0x4')]][_0xc57d('0x2d')]=utils['diffTime'](dials[_0x1cc4c9[_0xc57d('0x4')]][_0xc57d('0x2e')],dials[_0x1cc4c9[_0xc57d('0x4')]][_0xc57d('0x1a')]);dials[_0x1cc4c9['uniqueid']][_0xc57d('0x2f')]=utils['diffTime'](dials[_0x1cc4c9['uniqueid']]['answertime']||dials[_0x1cc4c9[_0xc57d('0x4')]][_0xc57d('0x2e')],dials[_0x1cc4c9[_0xc57d('0x4')]][_0xc57d('0x1a')]);dials[_0x1cc4c9[_0xc57d('0x4')]][_0xc57d('0x30')]=dials[_0x1cc4c9['uniqueid']]['answertime']?utils[_0xc57d('0x31')](dials[_0x1cc4c9[_0xc57d('0x4')]][_0xc57d('0x2e')],dials[_0x1cc4c9['uniqueid']][_0xc57d('0x22')]):0x0;writeDB(dials[_0x1cc4c9[_0xc57d('0x4')]]);}}catch(_0x53eb63){utils[_0xc57d('0x16')](util[_0xc57d('0x2')](_0xc57d('0x28'),_0x1cc4c9[_0xc57d('0x4')]),_0x53eb63);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index ba26033..63ba0e9 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 _0xcd3e=['newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','[%s][index][cdr]','cdr','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','origtransfereruniqueid','[%s][index][attendedtransfer]','[%s][index][varset]','varset','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','./utils','util','xdr','disabled','env','production','local','asterisk','port','username','password','keepConnected','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','format','[%s][index][devicestatechange]','device','debug','uniqueid','agentcalled','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]'];(function(_0xb8dc95,_0x4fdda5){var _0x73714a=function(_0x94c04e){while(--_0x94c04e){_0xb8dc95['push'](_0xb8dc95['shift']());}};_0x73714a(++_0x4fdda5);}(_0xcd3e,0x1d2));var _0xecd3=function(_0xcfeff4,_0x3f2e19){_0xcfeff4=_0xcfeff4-0x0;var _0xb2fadc=_0xcd3e[_0xcfeff4];return _0xb2fadc;};var AsteriskManager=require(_0xecd3('0x0'));var config=require('../../config/environment');var utils=require(_0xecd3('0x1'));var util=require(_0xecd3('0x2'));var isXDREnabled=config[_0xecd3('0x3')]&&config['xdr'][_0xecd3('0x4')]?!config[_0xecd3('0x3')][_0xecd3('0x4')]:!![];var isProduction=config[_0xecd3('0x5')]===_0xecd3('0x6')||![];var isLocalAsterisk=config[_0xecd3('0x3')]&&config['xdr'][_0xecd3('0x7')]===!![]||![];var ami=new AsteriskManager(config[_0xecd3('0x8')][_0xecd3('0x9')],config[_0xecd3('0x8')]['ip'],config[_0xecd3('0x8')][_0xecd3('0xa')],config[_0xecd3('0x8')][_0xecd3('0xb')],!![]);ami[_0xecd3('0xc')]();if(!isXDREnabled){utils[_0xecd3('0xd')](_0xecd3('0xe'));}else if(!isProduction&&!isLocalAsterisk){utils[_0xecd3('0xd')](_0xecd3('0xf'));}else{var agents=require(_0xecd3('0x10'));var calls=require('./calls.controller');var queues=require(_0xecd3('0x11'));var recordings=require(_0xecd3('0x12'));var members=require(_0xecd3('0x13'));var dials=require(_0xecd3('0x14'));var transfers=require(_0xecd3('0x15'));var core=require(_0xecd3('0x16'));ami['on'](_0xecd3('0x17'),core[_0xecd3('0x17')]);ami['on'](_0xecd3('0x18'),core[_0xecd3('0x18')]);ami['on'](_0xecd3('0x19'),core['fullybooted']);ami['on']('error',core[_0xecd3('0x1a')]);ami['on']('close',core[_0xecd3('0x1b')]);ami['on'](_0xecd3('0x1c'),core[_0xecd3('0x1c')]);ami['on'](_0xecd3('0x1d'),function(_0x57b02a){try{utils['debug'](util[_0xecd3('0x1e')](_0xecd3('0x1f'),_0x57b02a[_0xecd3('0x20')]),_0x57b02a);members[_0xecd3('0x1d')](_0x57b02a);}catch(_0x2e8c52){utils[_0xecd3('0x1a')](util[_0xecd3('0x1e')](_0xecd3('0x1f'),_0x57b02a[_0xecd3('0x20')]),_0x2e8c52);}});ami['on']('agentcalled',function(_0x23b940){try{utils[_0xecd3('0x21')](util['format']('[%s][index][agentcalled]',_0x23b940[_0xecd3('0x22')]),_0x23b940);agents[_0xecd3('0x23')](_0x23b940);}catch(_0x585a0d){utils[_0xecd3('0x1a')](util[_0xecd3('0x1e')]('[%s][index][agentcalled]',_0x23b940[_0xecd3('0x22')]),_0x585a0d);}});ami['on'](_0xecd3('0x24'),function(_0x557f90){try{utils['debug'](util['format'](_0xecd3('0x25'),_0x557f90[_0xecd3('0x22')]),_0x557f90);agents[_0xecd3('0x24')](_0x557f90);}catch(_0x1a2af9){utils['error'](util[_0xecd3('0x1e')](_0xecd3('0x25'),_0x557f90[_0xecd3('0x22')]),_0x1a2af9);}});ami['on'](_0xecd3('0x26'),function(_0x2c0b06){try{utils[_0xecd3('0x21')](util[_0xecd3('0x1e')]('[%s][index][agentconnect]',_0x2c0b06[_0xecd3('0x22')]),_0x2c0b06);agents[_0xecd3('0x26')](_0x2c0b06);queues['agentconnect'](_0x2c0b06);}catch(_0x31ea93){utils[_0xecd3('0x1a')](util['format'](_0xecd3('0x27'),_0x2c0b06[_0xecd3('0x22')]),_0x31ea93);}});ami['on']('agentcomplete',function(_0x3b316f){try{utils['debug'](util[_0xecd3('0x1e')]('[%s][index][agentcomplete]',_0x3b316f['uniqueid']),_0x3b316f);agents[_0xecd3('0x28')](_0x3b316f);queues[_0xecd3('0x28')](_0x3b316f);members[_0xecd3('0x28')](_0x3b316f);}catch(_0x2da5b1){utils['error'](util['format'](_0xecd3('0x29'),_0x3b316f[_0xecd3('0x22')]),_0x2da5b1);}});ami['on']('queuecallerabandon',function(_0x962542){try{utils[_0xecd3('0x21')](util[_0xecd3('0x1e')]('[%s][index][queuecallerabandon]',_0x962542[_0xecd3('0x22')]),_0x962542);agents[_0xecd3('0x2a')](_0x962542);queues[_0xecd3('0x2a')](_0x962542);}catch(_0x401d2d){utils[_0xecd3('0x1a')](util[_0xecd3('0x1e')](_0xecd3('0x2b'),_0x962542[_0xecd3('0x22')]),_0x401d2d);}});ami['on'](_0xecd3('0x2c'),function(_0xaf1588){try{utils[_0xecd3('0x21')](util[_0xecd3('0x1e')](_0xecd3('0x2d'),_0xaf1588['uniqueid']),_0xaf1588);queues[_0xecd3('0x2c')](_0xaf1588);recordings[_0xecd3('0x2c')](_0xaf1588);}catch(_0x43ad86){utils['error'](util['format'](_0xecd3('0x2d'),_0xaf1588[_0xecd3('0x22')]),_0x43ad86);}});ami['on'](_0xecd3('0x2e'),function(_0x37a6eb){try{utils[_0xecd3('0x21')](util[_0xecd3('0x1e')](_0xecd3('0x2f'),_0x37a6eb['uniqueid']),_0x37a6eb);queues['queuecallerleave'](_0x37a6eb);}catch(_0x2eea99){utils[_0xecd3('0x1a')](util['format']('[%s][index][queuecallerleave]',_0x37a6eb[_0xecd3('0x22')]),_0x2eea99);}});ami['on'](_0xecd3('0x30'),function(_0x13b9df){try{utils[_0xecd3('0x21')](util[_0xecd3('0x1e')](_0xecd3('0x31'),_0x13b9df['uniqueid']),_0x13b9df);queues[_0xecd3('0x30')](_0x13b9df);calls[_0xecd3('0x30')](_0x13b9df);}catch(_0x526df9){utils[_0xecd3('0x1a')](util[_0xecd3('0x1e')](_0xecd3('0x31'),_0x13b9df[_0xecd3('0x22')]),_0x526df9);}});ami['on'](_0xecd3('0x32'),function(_0x49dbc6){try{utils['debug'](util['format'](_0xecd3('0x33'),_0x49dbc6[_0xecd3('0x22')]),_0x49dbc6);queues[_0xecd3('0x32')](_0x49dbc6);calls[_0xecd3('0x32')](_0x49dbc6);}catch(_0x2e78ca){utils[_0xecd3('0x1a')](util['format'](_0xecd3('0x33'),_0x49dbc6['uniqueid']),_0x2e78ca);}});ami['on'](_0xecd3('0x34'),function(_0x4bac88){try{utils[_0xecd3('0x21')](util['format'](_0xecd3('0x35'),_0x4bac88['uniqueid']),_0x4bac88);calls[_0xecd3('0x34')](_0x4bac88);recordings[_0xecd3('0x34')](_0x4bac88);}catch(_0x45a7e0){utils['error'](util[_0xecd3('0x1e')](_0xecd3('0x35'),_0x4bac88[_0xecd3('0x22')]),_0x45a7e0);}});ami['on'](_0xecd3('0x36'),function(_0x256904){try{utils[_0xecd3('0x21')](util[_0xecd3('0x1e')](_0xecd3('0x37'),_0x256904[_0xecd3('0x22')]),_0x256904);calls[_0xecd3('0x36')](_0x256904);recordings[_0xecd3('0x36')](_0x256904);dials[_0xecd3('0x36')](_0x256904);agents[_0xecd3('0x36')](_0x256904);queues['hangup'](_0x256904);}catch(_0x24041e){utils[_0xecd3('0x1a')](util['format'](_0xecd3('0x37'),_0x256904[_0xecd3('0x22')]),_0x24041e);}});ami['on']('cdr',function(_0x12cc1e){try{utils[_0xecd3('0x21')](util[_0xecd3('0x1e')](_0xecd3('0x38'),_0x12cc1e[_0xecd3('0x22')]),_0x12cc1e);members[_0xecd3('0x39')](_0x12cc1e);}catch(_0x39b809){utils[_0xecd3('0x1a')](util[_0xecd3('0x1e')](_0xecd3('0x38'),_0x12cc1e[_0xecd3('0x22')]),_0x39b809);}});ami['on'](_0xecd3('0x3a'),function(_0x154f2e){try{utils['debug'](util[_0xecd3('0x1e')](_0xecd3('0x3b'),_0x154f2e[_0xecd3('0x22')]),_0x154f2e);queues['blindtransfer'](_0x154f2e);agents['blindtransfer'](_0x154f2e);transfers[_0xecd3('0x3a')](_0x154f2e);recordings[_0xecd3('0x3a')](_0x154f2e);}catch(_0x30781a){utils[_0xecd3('0x1a')](util[_0xecd3('0x1e')](_0xecd3('0x3b'),_0x154f2e[_0xecd3('0x22')]),_0x30781a);}});ami['on'](_0xecd3('0x3c'),function(_0x48e70b){try{utils[_0xecd3('0x21')](util[_0xecd3('0x1e')]('[%s][index][attendedtransfer]',_0x48e70b[_0xecd3('0x3d')]),_0x48e70b);queues[_0xecd3('0x3c')](_0x48e70b);transfers['attendedtransfer'](_0x48e70b);agents[_0xecd3('0x3c')](_0x48e70b);calls[_0xecd3('0x3c')](_0x48e70b);}catch(_0x524bdc){utils[_0xecd3('0x1a')](util[_0xecd3('0x1e')](_0xecd3('0x3e'),_0x48e70b[_0xecd3('0x3d')]),_0x524bdc);}});ami['on']('varset',function(_0x57dbc4){try{utils[_0xecd3('0x21')](util[_0xecd3('0x1e')](_0xecd3('0x3f'),_0x57dbc4[_0xecd3('0x22')]),_0x57dbc4);queues[_0xecd3('0x40')](_0x57dbc4);recordings[_0xecd3('0x40')](_0x57dbc4);calls[_0xecd3('0x40')](_0x57dbc4);dials[_0xecd3('0x40')](_0x57dbc4);}catch(_0x21f7be){utils[_0xecd3('0x1a')](util[_0xecd3('0x1e')](_0xecd3('0x3f'),_0x57dbc4[_0xecd3('0x22')]),_0x21f7be);}});ami['on'](_0xecd3('0x41'),function(_0x5ce416){try{utils['debug'](util[_0xecd3('0x1e')](_0xecd3('0x42'),_0x5ce416[_0xecd3('0x22')]),_0x5ce416);calls[_0xecd3('0x41')](_0x5ce416);recordings[_0xecd3('0x41')](_0x5ce416);dials[_0xecd3('0x41')](_0x5ce416);}catch(_0x4b4ddf){utils[_0xecd3('0x1a')](util[_0xecd3('0x1e')](_0xecd3('0x42'),_0x5ce416[_0xecd3('0x22')]),_0x4b4ddf);}});ami['on'](_0xecd3('0x43'),function(_0x4a3a8d){try{utils[_0xecd3('0x21')](util[_0xecd3('0x1e')](_0xecd3('0x44'),_0x4a3a8d[_0xecd3('0x22')]),_0x4a3a8d);calls[_0xecd3('0x43')](_0x4a3a8d);recordings[_0xecd3('0x43')](_0x4a3a8d);}catch(_0xd72752){utils[_0xecd3('0x1a')](util[_0xecd3('0x1e')]('[%s][index][newchannel]',_0x4a3a8d[_0xecd3('0x22')]),_0xd72752);}});ami['on'](_0xecd3('0x45'),function(_0x4fd2de){try{utils[_0xecd3('0x21')](util[_0xecd3('0x1e')](_0xecd3('0x46'),_0x4fd2de[_0xecd3('0x22')]),_0x4fd2de);dials[_0xecd3('0x45')](_0x4fd2de);}catch(_0x281c41){utils[_0xecd3('0x1a')](util['format'](_0xecd3('0x47'),_0x4fd2de[_0xecd3('0x22')]),_0x281c41);}});ami['on'](_0xecd3('0x48'),function(_0x4c0169){try{utils[_0xecd3('0x21')](util[_0xecd3('0x1e')](_0xecd3('0x49'),_0x4c0169[_0xecd3('0x22')]),_0x4c0169);dials['dialend'](_0x4c0169);}catch(_0x420a98){utils[_0xecd3('0x1a')](util['format'](_0xecd3('0x49'),_0x4c0169['uniqueid']),_0x420a98);}});} \ No newline at end of file +var _0x5eb5=['username','password','keepConnected','info','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./transfers.controller','./core.controller','connect','fullybooted','error','close','managerevent','devicestatechange','debug','[%s][index][devicestatechange]','device','format','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','[%s][index][queuecallerabandon]','queuecallerabandon','[%s][index][queuecallerjoin]','queuecallerjoin','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','[%s][index][attendedtransfer]','attendedtransfer','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s]dialbegin','dialend','[%s][index][dialend]','xdr','disabled','env','production','local','asterisk'];(function(_0x3ffd3a,_0x10996c){var _0x35b227=function(_0x3aa4f9){while(--_0x3aa4f9){_0x3ffd3a['push'](_0x3ffd3a['shift']());}};_0x35b227(++_0x10996c);}(_0x5eb5,0x18c));var _0x55eb=function(_0x4ed49e,_0x3b2d49){_0x4ed49e=_0x4ed49e-0x0;var _0x52cbfa=_0x5eb5[_0x4ed49e];return _0x52cbfa;};var AsteriskManager=require('asterisk-manager');var config=require('../../config/environment');var utils=require('./utils');var util=require('util');var isXDREnabled=config[_0x55eb('0x0')]&&config[_0x55eb('0x0')]['disabled']?!config[_0x55eb('0x0')][_0x55eb('0x1')]:!![];var isProduction=config[_0x55eb('0x2')]===_0x55eb('0x3')||![];var isLocalAsterisk=config[_0x55eb('0x0')]&&config[_0x55eb('0x0')][_0x55eb('0x4')]===!![]||![];var ami=new AsteriskManager(config[_0x55eb('0x5')]['port'],config[_0x55eb('0x5')]['ip'],config['asterisk'][_0x55eb('0x6')],config['asterisk'][_0x55eb('0x7')],!![]);ami[_0x55eb('0x8')]();if(!isXDREnabled){utils[_0x55eb('0x9')]('XDR\x20DISABLED');}else if(!isProduction&&!isLocalAsterisk){utils[_0x55eb('0x9')](_0x55eb('0xa'));}else{var agents=require(_0x55eb('0xb'));var calls=require(_0x55eb('0xc'));var queues=require(_0x55eb('0xd'));var recordings=require(_0x55eb('0xe'));var members=require(_0x55eb('0xf'));var dials=require('./dials.controller');var transfers=require(_0x55eb('0x10'));var core=require(_0x55eb('0x11'));ami['on'](_0x55eb('0x12'),core[_0x55eb('0x12')]);ami['on']('shutdown',core['shutdown']);ami['on'](_0x55eb('0x13'),core[_0x55eb('0x13')]);ami['on']('error',core[_0x55eb('0x14')]);ami['on'](_0x55eb('0x15'),core['close']);ami['on'](_0x55eb('0x16'),core[_0x55eb('0x16')]);ami['on'](_0x55eb('0x17'),function(_0x3f829f){try{utils[_0x55eb('0x18')](util['format'](_0x55eb('0x19'),_0x3f829f[_0x55eb('0x1a')]),_0x3f829f);members[_0x55eb('0x17')](_0x3f829f);}catch(_0x1c5722){utils[_0x55eb('0x14')](util[_0x55eb('0x1b')](_0x55eb('0x19'),_0x3f829f[_0x55eb('0x1a')]),_0x1c5722);}});ami['on'](_0x55eb('0x1c'),function(_0x34be3d){try{utils[_0x55eb('0x18')](util[_0x55eb('0x1b')](_0x55eb('0x1d'),_0x34be3d[_0x55eb('0x1e')]),_0x34be3d);agents[_0x55eb('0x1c')](_0x34be3d);}catch(_0x316951){utils[_0x55eb('0x14')](util[_0x55eb('0x1b')](_0x55eb('0x1d'),_0x34be3d[_0x55eb('0x1e')]),_0x316951);}});ami['on'](_0x55eb('0x1f'),function(_0x26cb35){try{utils['debug'](util[_0x55eb('0x1b')](_0x55eb('0x20'),_0x26cb35[_0x55eb('0x1e')]),_0x26cb35);agents[_0x55eb('0x1f')](_0x26cb35);}catch(_0xecb452){utils[_0x55eb('0x14')](util[_0x55eb('0x1b')]('[%s][index][agentringnoanswer]',_0x26cb35['uniqueid']),_0xecb452);}});ami['on'](_0x55eb('0x21'),function(_0x1ba655){try{utils[_0x55eb('0x18')](util[_0x55eb('0x1b')](_0x55eb('0x22'),_0x1ba655[_0x55eb('0x1e')]),_0x1ba655);agents[_0x55eb('0x21')](_0x1ba655);queues[_0x55eb('0x21')](_0x1ba655);}catch(_0x16bd2d){utils[_0x55eb('0x14')](util[_0x55eb('0x1b')]('[%s][index][agentconnect]',_0x1ba655[_0x55eb('0x1e')]),_0x16bd2d);}});ami['on']('agentcomplete',function(_0x476614){try{utils[_0x55eb('0x18')](util[_0x55eb('0x1b')]('[%s][index][agentcomplete]',_0x476614['uniqueid']),_0x476614);agents['agentcomplete'](_0x476614);queues[_0x55eb('0x23')](_0x476614);members[_0x55eb('0x23')](_0x476614);}catch(_0x194c0f){utils[_0x55eb('0x14')](util[_0x55eb('0x1b')](_0x55eb('0x24'),_0x476614['uniqueid']),_0x194c0f);}});ami['on']('queuecallerabandon',function(_0x479eab){try{utils['debug'](util['format'](_0x55eb('0x25'),_0x479eab[_0x55eb('0x1e')]),_0x479eab);agents['queuecallerabandon'](_0x479eab);queues[_0x55eb('0x26')](_0x479eab);}catch(_0xd52776){utils[_0x55eb('0x14')](util[_0x55eb('0x1b')](_0x55eb('0x25'),_0x479eab['uniqueid']),_0xd52776);}});ami['on']('queuecallerjoin',function(_0x9d82fe){try{utils[_0x55eb('0x18')](util[_0x55eb('0x1b')](_0x55eb('0x27'),_0x9d82fe[_0x55eb('0x1e')]),_0x9d82fe);queues[_0x55eb('0x28')](_0x9d82fe);recordings[_0x55eb('0x28')](_0x9d82fe);}catch(_0x3499bb){utils[_0x55eb('0x14')](util[_0x55eb('0x1b')](_0x55eb('0x27'),_0x9d82fe['uniqueid']),_0x3499bb);}});ami['on']('queuecallerleave',function(_0x3213fe){try{utils[_0x55eb('0x18')](util[_0x55eb('0x1b')](_0x55eb('0x29'),_0x3213fe[_0x55eb('0x1e')]),_0x3213fe);queues['queuecallerleave'](_0x3213fe);}catch(_0xa1df04){utils['error'](util[_0x55eb('0x1b')](_0x55eb('0x29'),_0x3213fe[_0x55eb('0x1e')]),_0xa1df04);}});ami['on'](_0x55eb('0x2a'),function(_0x410bb9){try{utils[_0x55eb('0x18')](util[_0x55eb('0x1b')]('[%s][index][musiconholdstart]',_0x410bb9[_0x55eb('0x1e')]),_0x410bb9);queues['musiconholdstart'](_0x410bb9);calls[_0x55eb('0x2a')](_0x410bb9);}catch(_0x32cd1c){utils[_0x55eb('0x14')](util[_0x55eb('0x1b')](_0x55eb('0x2b'),_0x410bb9[_0x55eb('0x1e')]),_0x32cd1c);}});ami['on'](_0x55eb('0x2c'),function(_0x3ceaed){try{utils[_0x55eb('0x18')](util[_0x55eb('0x1b')](_0x55eb('0x2d'),_0x3ceaed['uniqueid']),_0x3ceaed);queues[_0x55eb('0x2c')](_0x3ceaed);calls[_0x55eb('0x2c')](_0x3ceaed);}catch(_0x3be41f){utils[_0x55eb('0x14')](util[_0x55eb('0x1b')](_0x55eb('0x2d'),_0x3ceaed[_0x55eb('0x1e')]),_0x3be41f);}});ami['on'](_0x55eb('0x2e'),function(_0x6718a3){try{utils['debug'](util[_0x55eb('0x1b')](_0x55eb('0x2f'),_0x6718a3[_0x55eb('0x1e')]),_0x6718a3);calls['newstate'](_0x6718a3);recordings[_0x55eb('0x2e')](_0x6718a3);}catch(_0x30552e){utils[_0x55eb('0x14')](util[_0x55eb('0x1b')](_0x55eb('0x2f'),_0x6718a3[_0x55eb('0x1e')]),_0x30552e);}});ami['on'](_0x55eb('0x30'),function(_0x178f1e){try{utils[_0x55eb('0x18')](util['format'](_0x55eb('0x31'),_0x178f1e['uniqueid']),_0x178f1e);calls[_0x55eb('0x30')](_0x178f1e);recordings[_0x55eb('0x30')](_0x178f1e);dials['hangup'](_0x178f1e);agents[_0x55eb('0x30')](_0x178f1e);queues['hangup'](_0x178f1e);}catch(_0xc20979){utils[_0x55eb('0x14')](util['format']('[%s][index][hangup]',_0x178f1e[_0x55eb('0x1e')]),_0xc20979);}});ami['on'](_0x55eb('0x32'),function(_0x4b6d67){try{utils['debug'](util[_0x55eb('0x1b')]('[%s][index][cdr]',_0x4b6d67[_0x55eb('0x1e')]),_0x4b6d67);members['cdr'](_0x4b6d67);}catch(_0x261062){utils['error'](util[_0x55eb('0x1b')](_0x55eb('0x33'),_0x4b6d67['uniqueid']),_0x261062);}});ami['on'](_0x55eb('0x34'),function(_0x2fe909){try{utils[_0x55eb('0x18')](util[_0x55eb('0x1b')](_0x55eb('0x35'),_0x2fe909[_0x55eb('0x1e')]),_0x2fe909);queues['blindtransfer'](_0x2fe909);agents[_0x55eb('0x34')](_0x2fe909);transfers[_0x55eb('0x34')](_0x2fe909);}catch(_0x5cdef9){utils[_0x55eb('0x14')](util[_0x55eb('0x1b')](_0x55eb('0x35'),_0x2fe909['uniqueid']),_0x5cdef9);}});ami['on']('attendedtransfer',function(_0x567158){try{utils['debug'](util[_0x55eb('0x1b')](_0x55eb('0x36'),_0x567158['origtransfereruniqueid']),_0x567158);queues[_0x55eb('0x37')](_0x567158);transfers[_0x55eb('0x37')](_0x567158);agents[_0x55eb('0x37')](_0x567158);calls[_0x55eb('0x37')](_0x567158);}catch(_0x26f86e){utils[_0x55eb('0x14')](util['format'](_0x55eb('0x36'),_0x567158[_0x55eb('0x38')]),_0x26f86e);}});ami['on'](_0x55eb('0x39'),function(_0xd66fa0){try{utils[_0x55eb('0x18')](util[_0x55eb('0x1b')](_0x55eb('0x3a'),_0xd66fa0[_0x55eb('0x1e')]),_0xd66fa0);queues['varset'](_0xd66fa0);recordings['varset'](_0xd66fa0);calls[_0x55eb('0x39')](_0xd66fa0);dials['varset'](_0xd66fa0);}catch(_0x256960){utils[_0x55eb('0x14')](util[_0x55eb('0x1b')]('[%s][index][varset]',_0xd66fa0[_0x55eb('0x1e')]),_0x256960);}});ami['on'](_0x55eb('0x3b'),function(_0x585690){try{utils['debug'](util[_0x55eb('0x1b')](_0x55eb('0x3c'),_0x585690[_0x55eb('0x1e')]),_0x585690);calls[_0x55eb('0x3b')](_0x585690);recordings[_0x55eb('0x3b')](_0x585690);dials[_0x55eb('0x3b')](_0x585690);}catch(_0x169f20){utils[_0x55eb('0x14')](util[_0x55eb('0x1b')](_0x55eb('0x3c'),_0x585690[_0x55eb('0x1e')]),_0x169f20);}});ami['on'](_0x55eb('0x3d'),function(_0x2fadaf){try{utils['debug'](util[_0x55eb('0x1b')](_0x55eb('0x3e'),_0x2fadaf[_0x55eb('0x1e')]),_0x2fadaf);calls[_0x55eb('0x3d')](_0x2fadaf);recordings[_0x55eb('0x3d')](_0x2fadaf);}catch(_0x367038){utils[_0x55eb('0x14')](util[_0x55eb('0x1b')]('[%s][index][newchannel]',_0x2fadaf[_0x55eb('0x1e')]),_0x367038);}});ami['on'](_0x55eb('0x3f'),function(_0x4ddd4d){try{utils[_0x55eb('0x18')](util[_0x55eb('0x1b')]('[%s][index][dialbegin]',_0x4ddd4d[_0x55eb('0x1e')]),_0x4ddd4d);dials['dialbegin'](_0x4ddd4d);}catch(_0x1b86f8){utils['error'](util['format'](_0x55eb('0x40'),_0x4ddd4d[_0x55eb('0x1e')]),_0x1b86f8);}});ami['on'](_0x55eb('0x41'),function(_0x5dee69){try{utils[_0x55eb('0x18')](util[_0x55eb('0x1b')](_0x55eb('0x42'),_0x5dee69[_0x55eb('0x1e')]),_0x5dee69);dials[_0x55eb('0x41')](_0x5dee69);}catch(_0x2d509){utils[_0x55eb('0x14')](util[_0x55eb('0x1b')]('[%s][index][dialend]',_0x5dee69[_0x55eb('0x1e')]),_0x2d509);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 29c0bfc..e8b335d 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 _0x7e93=['enterAt','agentcomplete','isNil','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','[%s][members][agentcomplete]','cdr','[%s][members][cdr]','data1','type','source','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','destination','exitAt','lodash','util','./utils','Local/_attended@transfer','info','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','channel','data2','membername','interface','getUserByInterface','name','internal','request','CreateMemberReport','getUserByName','split','then','error','format','[%s][members][writeDB]','uniqueid','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','TALKING','now','NOT_INUSE','diffTime'];(function(_0x1dff07,_0x17c57e){var _0x32f65b=function(_0x2a6a2c){while(--_0x2a6a2c){_0x1dff07['push'](_0x1dff07['shift']());}};_0x32f65b(++_0x17c57e);}(_0x7e93,0x78));var _0x37e9=function(_0x3b0931,_0x513331){_0x3b0931=_0x3b0931-0x0;var _0x4bdb79=_0x7e93[_0x3b0931];return _0x4bdb79;};'use strict';var _=require(_0x37e9('0x0'));var util=require(_0x37e9('0x1'));var utils=require(_0x37e9('0x2'));var members={};var exclude=[_0x37e9('0x3'),'Queue:'];function writeDB(_0x1a6b18){utils[_0x37e9('0x4')](util['format'](_0x37e9('0x5'),_0x1a6b18['uniqueid'],_0x1a6b18['interface'],_0x1a6b18[_0x37e9('0x6')],_0x1a6b18[_0x37e9('0x7')],_0x1a6b18[_0x37e9('0x8')],_0x1a6b18['type']));if(_0x1a6b18[_0x37e9('0x9')]){utils[_0x37e9('0xa')](_0x1a6b18[_0x37e9('0x9')])['then'](function(_0x40e030){if(_0x40e030){_0x1a6b18[_0x37e9('0x8')]=_0x40e030[_0x37e9('0xb')];_0x1a6b18[_0x37e9('0xc')]=_0x40e030['internal'];utils[_0x37e9('0xd')](_0x37e9('0xe'),_0x1a6b18);}else{utils[_0x37e9('0xf')](_0x1a6b18[_0x37e9('0x9')][_0x37e9('0x10')]('/')[0x1])[_0x37e9('0x11')](function(_0x350fb9){if(_0x350fb9){_0x1a6b18[_0x37e9('0x8')]=_0x350fb9[_0x37e9('0xb')];_0x1a6b18[_0x37e9('0xc')]=_0x350fb9[_0x37e9('0xc')];utils[_0x37e9('0xd')]('CreateMemberReport',_0x1a6b18);}});}})['catch'](function(_0x361b04){utils[_0x37e9('0x12')](util[_0x37e9('0x13')](_0x37e9('0x14'),_0x1a6b18[_0x37e9('0x15')]),_0x361b04);});}delete members[_0x1a6b18[_0x37e9('0x9')]];}function startsWith(_0x31a222,_0x3fc9a8){return _['some'](_0x31a222,function(_0x113b90){return _[_0x37e9('0x16')](_0x3fc9a8,_0x113b90);});}exports[_0x37e9('0x17')]=function(_0x4e2d4f){try{utils[_0x37e9('0x18')](util[_0x37e9('0x13')](_0x37e9('0x19'),members[_0x4e2d4f[_0x37e9('0x1a')]]?members[_0x4e2d4f[_0x37e9('0x1a')]][_0x37e9('0x15')]:_0x4e2d4f['device']),_0x4e2d4f);utils[_0x37e9('0x4')](util[_0x37e9('0x13')](_0x37e9('0x1b'),members[_0x4e2d4f[_0x37e9('0x1a')]]?members[_0x4e2d4f[_0x37e9('0x1a')]][_0x37e9('0x15')]:_0x4e2d4f[_0x37e9('0x1a')],_0x4e2d4f[_0x37e9('0x1c')],_0x4e2d4f[_0x37e9('0x1a')]));switch(_0x4e2d4f[_0x37e9('0x1c')]){case _0x37e9('0x1d'):case _0x37e9('0x1e'):if(!startsWith(exclude,_0x4e2d4f['device'])){members[_0x4e2d4f['device']]={'channel':_0x37e9('0x1f'),'interface':_0x4e2d4f['device'],'type':_0x37e9('0x20'),'enterAt':utils[_0x37e9('0x21')](),'role':'agent'};}break;case _0x37e9('0x22'):if(!_['isNil'](members[_0x4e2d4f[_0x37e9('0x1a')]])){members[_0x4e2d4f[_0x37e9('0x1a')]]['exitAt']=utils['now']();members[_0x4e2d4f[_0x37e9('0x1a')]]['duration']=utils[_0x37e9('0x23')](members[_0x4e2d4f[_0x37e9('0x1a')]]['exitAt'],members[_0x4e2d4f[_0x37e9('0x1a')]][_0x37e9('0x24')]);if(members[_0x4e2d4f[_0x37e9('0x1a')]][_0x37e9('0x15')]){writeDB(members[_0x4e2d4f[_0x37e9('0x1a')]]);}}break;default:break;}}catch(_0x3b9b00){utils['error'](util[_0x37e9('0x13')](_0x37e9('0x19'),members[_0x4e2d4f[_0x37e9('0x1a')]]?members[_0x4e2d4f[_0x37e9('0x1a')]][_0x37e9('0x15')]:_0x4e2d4f[_0x37e9('0x1a')]),_0x3b9b00);}};exports[_0x37e9('0x25')]=function(_0x84b1f8){try{if(!_[_0x37e9('0x26')](members[_0x84b1f8['interface']])){utils['debug'](util['format']('[%s][members][agentcomplete]',_0x84b1f8['uniqueid']),_0x84b1f8);utils['info'](util[_0x37e9('0x13')](_0x37e9('0x27'),_0x84b1f8[_0x37e9('0x15')],_0x84b1f8['interface'],_0x84b1f8[_0x37e9('0x28')]));members[_0x84b1f8[_0x37e9('0x9')]]=_[_0x37e9('0x29')](members[_0x84b1f8[_0x37e9('0x9')]],{'data4':_0x84b1f8[_0x37e9('0x28')],'uniqueid':_0x84b1f8['uniqueid']});}}catch(_0x1294b){utils[_0x37e9('0x12')](util['format'](_0x37e9('0x2a'),_0x84b1f8[_0x37e9('0x15')]),_0x1294b);}};exports[_0x37e9('0x2b')]=function(_0x37ca51){try{utils[_0x37e9('0x18')](util[_0x37e9('0x13')](_0x37e9('0x2c'),_0x37ca51[_0x37e9('0x15')]),_0x37ca51);if(_0x37ca51['channel']){var _0x2a3802=_0x37ca51[_0x37e9('0x6')][_0x37e9('0x10')]('-')[0x0];if(!_[_0x37e9('0x26')](members[_0x2a3802])){members[_0x2a3802]=_[_0x37e9('0x29')](members[_0x2a3802],{'data1':members[_0x2a3802][_0x37e9('0x2d')]||_0x37ca51[_0x37e9('0x2e')],'data2':members[_0x2a3802]['data2']||_0x37ca51[_0x37e9('0x2f')],'data3':members[_0x2a3802]['data3']||_0x37ca51['destination'],'uniqueid':members[_0x2a3802][_0x37e9('0x15')]||_0x37ca51[_0x37e9('0x15')]});utils[_0x37e9('0x4')](util['format'](_0x37e9('0x30'),_0x37ca51[_0x37e9('0x15')],members[_0x2a3802][_0x37e9('0x2d')],members[_0x2a3802][_0x37e9('0x7')],members[_0x2a3802]['data3']));if(members[_0x2a3802]['exitAt']){writeDB(members[_0x2a3802]);}}}if(_0x37ca51['destinationchannel']){var _0x45c899=_0x37ca51[_0x37e9('0x31')]['split']('-')[0x0];if(!_[_0x37e9('0x26')](members[_0x45c899])){members[_0x45c899]=_[_0x37e9('0x29')](members[_0x45c899],{'data1':members[_0x45c899][_0x37e9('0x2d')]||_0x37ca51[_0x37e9('0x2e')],'data2':members[_0x45c899][_0x37e9('0x7')]||_0x37ca51[_0x37e9('0x2f')],'data3':members[_0x45c899]['data3']||_0x37ca51[_0x37e9('0x32')],'uniqueid':members[_0x45c899][_0x37e9('0x15')]||_0x37ca51['uniqueid']});utils['info'](util[_0x37e9('0x13')](_0x37e9('0x30'),_0x37ca51[_0x37e9('0x15')],members[_0x45c899][_0x37e9('0x2d')],members[_0x45c899][_0x37e9('0x7')],members[_0x45c899]['data3']));if(members[_0x45c899][_0x37e9('0x33')]){writeDB(members[_0x45c899]);}}}}catch(_0x5b5d18){utils['error'](util[_0x37e9('0x13')]('[%s][members][cdr]',_0x37ca51[_0x37e9('0x15')]),_0x5b5d18);}}; \ No newline at end of file +var _0x73bd=['channel','split','data1','data2','source','data3','destination','lodash','./utils','Local/_attended@transfer','Queue:','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','interface','membername','type','getUserByInterface','then','name','request','CreateMemberReport','getUserByName','catch','error','[%s][members][writeDB]','uniqueid','some','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','state','INUSE','BUSY','voice','TALKING','now','agent','NOT_INUSE','isNil','exitAt','duration','enterAt','agentcomplete','[%s][members][agentcomplete]','info','queue','assign','[%s][members][cdr]'];(function(_0x48326a,_0x8cfa0c){var _0x466709=function(_0x5ab1b7){while(--_0x5ab1b7){_0x48326a['push'](_0x48326a['shift']());}};_0x466709(++_0x8cfa0c);}(_0x73bd,0x6b));var _0xd73b=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x73bd[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0xd73b('0x0'));var util=require('util');var utils=require(_0xd73b('0x1'));var members={};var exclude=[_0xd73b('0x2'),_0xd73b('0x3')];function writeDB(_0x4672b5){utils['info'](util[_0xd73b('0x4')](_0xd73b('0x5'),_0x4672b5['uniqueid'],_0x4672b5[_0xd73b('0x6')],_0x4672b5['channel'],_0x4672b5['data2'],_0x4672b5[_0xd73b('0x7')],_0x4672b5[_0xd73b('0x8')]));if(_0x4672b5[_0xd73b('0x6')]){utils[_0xd73b('0x9')](_0x4672b5[_0xd73b('0x6')])[_0xd73b('0xa')](function(_0x5207a8){if(_0x5207a8){_0x4672b5[_0xd73b('0x7')]=_0x5207a8[_0xd73b('0xb')];_0x4672b5['internal']=_0x5207a8['internal'];utils[_0xd73b('0xc')](_0xd73b('0xd'),_0x4672b5);}else{utils[_0xd73b('0xe')](_0x4672b5[_0xd73b('0x6')]['split']('/')[0x1])[_0xd73b('0xa')](function(_0x3c9504){if(_0x3c9504){_0x4672b5['membername']=_0x3c9504[_0xd73b('0xb')];_0x4672b5['internal']=_0x3c9504['internal'];utils['request'](_0xd73b('0xd'),_0x4672b5);}});}})[_0xd73b('0xf')](function(_0xf186c9){utils[_0xd73b('0x10')](util[_0xd73b('0x4')](_0xd73b('0x11'),_0x4672b5[_0xd73b('0x12')]),_0xf186c9);});}delete members[_0x4672b5[_0xd73b('0x6')]];}function startsWith(_0x4ee79d,_0x7c5516){return _[_0xd73b('0x13')](_0x4ee79d,function(_0x3fefaa){return _[_0xd73b('0x14')](_0x7c5516,_0x3fefaa);});}exports[_0xd73b('0x15')]=function(_0x5b9558){try{utils[_0xd73b('0x16')](util[_0xd73b('0x4')](_0xd73b('0x17'),members[_0x5b9558[_0xd73b('0x18')]]?members[_0x5b9558['device']]['uniqueid']:_0x5b9558['device']),_0x5b9558);utils['info'](util[_0xd73b('0x4')]('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x5b9558['device']]?members[_0x5b9558[_0xd73b('0x18')]][_0xd73b('0x12')]:_0x5b9558[_0xd73b('0x18')],_0x5b9558[_0xd73b('0x19')],_0x5b9558[_0xd73b('0x18')]));switch(_0x5b9558['state']){case _0xd73b('0x1a'):case _0xd73b('0x1b'):if(!startsWith(exclude,_0x5b9558['device'])){members[_0x5b9558['device']]={'channel':_0xd73b('0x1c'),'interface':_0x5b9558['device'],'type':_0xd73b('0x1d'),'enterAt':utils[_0xd73b('0x1e')](),'role':_0xd73b('0x1f')};}break;case _0xd73b('0x20'):if(!_[_0xd73b('0x21')](members[_0x5b9558['device']])){members[_0x5b9558['device']][_0xd73b('0x22')]=utils[_0xd73b('0x1e')]();members[_0x5b9558['device']][_0xd73b('0x23')]=utils['diffTime'](members[_0x5b9558[_0xd73b('0x18')]]['exitAt'],members[_0x5b9558[_0xd73b('0x18')]][_0xd73b('0x24')]);if(members[_0x5b9558['device']][_0xd73b('0x12')]){writeDB(members[_0x5b9558[_0xd73b('0x18')]]);}}break;default:break;}}catch(_0x1c5df8){utils[_0xd73b('0x10')](util[_0xd73b('0x4')]('[%s][members][devicestatechange]',members[_0x5b9558[_0xd73b('0x18')]]?members[_0x5b9558[_0xd73b('0x18')]][_0xd73b('0x12')]:_0x5b9558[_0xd73b('0x18')]),_0x1c5df8);}};exports[_0xd73b('0x25')]=function(_0x3fe9e4){try{if(!_['isNil'](members[_0x3fe9e4[_0xd73b('0x6')]])){utils[_0xd73b('0x16')](util[_0xd73b('0x4')](_0xd73b('0x26'),_0x3fe9e4[_0xd73b('0x12')]),_0x3fe9e4);utils[_0xd73b('0x27')](util['format']('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x3fe9e4['uniqueid'],_0x3fe9e4[_0xd73b('0x6')],_0x3fe9e4[_0xd73b('0x28')]));members[_0x3fe9e4[_0xd73b('0x6')]]=_[_0xd73b('0x29')](members[_0x3fe9e4['interface']],{'data4':_0x3fe9e4['queue'],'uniqueid':_0x3fe9e4['uniqueid']});}}catch(_0x147ad9){utils[_0xd73b('0x10')](util[_0xd73b('0x4')]('[%s][members][agentcomplete]',_0x3fe9e4['uniqueid']),_0x147ad9);}};exports['cdr']=function(_0x42aeb6){try{utils[_0xd73b('0x16')](util[_0xd73b('0x4')](_0xd73b('0x2a'),_0x42aeb6['uniqueid']),_0x42aeb6);if(_0x42aeb6[_0xd73b('0x2b')]){var _0x378076=_0x42aeb6[_0xd73b('0x2b')][_0xd73b('0x2c')]('-')[0x0];if(!_[_0xd73b('0x21')](members[_0x378076])){members[_0x378076]=_['assign'](members[_0x378076],{'data1':members[_0x378076][_0xd73b('0x2d')]||_0x42aeb6[_0xd73b('0x8')],'data2':members[_0x378076][_0xd73b('0x2e')]||_0x42aeb6[_0xd73b('0x2f')],'data3':members[_0x378076][_0xd73b('0x30')]||_0x42aeb6[_0xd73b('0x31')],'uniqueid':members[_0x378076][_0xd73b('0x12')]||_0x42aeb6[_0xd73b('0x12')]});utils['info'](util['format']('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x42aeb6[_0xd73b('0x12')],members[_0x378076]['data1'],members[_0x378076][_0xd73b('0x2e')],members[_0x378076][_0xd73b('0x30')]));if(members[_0x378076][_0xd73b('0x22')]){writeDB(members[_0x378076]);}}}if(_0x42aeb6['destinationchannel']){var _0x3b69ae=_0x42aeb6['destinationchannel'][_0xd73b('0x2c')]('-')[0x0];if(!_[_0xd73b('0x21')](members[_0x3b69ae])){members[_0x3b69ae]=_[_0xd73b('0x29')](members[_0x3b69ae],{'data1':members[_0x3b69ae][_0xd73b('0x2d')]||_0x42aeb6['type'],'data2':members[_0x3b69ae][_0xd73b('0x2e')]||_0x42aeb6[_0xd73b('0x2f')],'data3':members[_0x3b69ae]['data3']||_0x42aeb6['destination'],'uniqueid':members[_0x3b69ae][_0xd73b('0x12')]||_0x42aeb6[_0xd73b('0x12')]});utils[_0xd73b('0x27')](util[_0xd73b('0x4')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x42aeb6[_0xd73b('0x12')],members[_0x3b69ae][_0xd73b('0x2d')],members[_0x3b69ae][_0xd73b('0x2e')],members[_0x3b69ae]['data3']));if(members[_0x3b69ae]['exitAt']){writeDB(members[_0x3b69ae]);}}}}catch(_0x5ac819){utils['error'](util[_0xd73b('0x4')](_0xd73b('0x2a'),_0x42aeb6['uniqueid']),_0x5ac819);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 5540e0b..3599bfd 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 _0x1491=['secondtransfererlinkedid','ATTENDED','origtransfererexten','ATTENDEDTRANSFER','origtransfererlinkedid','transfereelinkedid','clone','transfertargetuniqueid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','secondtransfereruniqueid','secondtransfererexten','transfertype','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','[%s][queues][musiconholdstop]','lodash','util','./utils','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','queue','getVoiceQueueByName','type','CreateVoiceQueueReport','request','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','[%s][queues][hangup]','queuecallerleaveAt','queuecallercomplete','COMPLETEDBYAGENT','info','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','[%s][queues][varset]','variable','value','toUpperCase','CONTINUE','isNil','queuecallerabandon','queuecallerabandonAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','queuecallerexit','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','error','[%s][queues][queuecallerabandon]','queuecallerleave','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','holdtime','diffTime','queuecallerjoinAt','count','[%s][queues][queuecallerleave]','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','destaccountcode','assigned','membername','agentcomplete','[%s][queues][agentcomplete]','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','transfereeuniqueid','BLIND','transferexten','extension','transferuniqueid','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','[%s][queues][blindtransfer]','origtransfereruniqueid'];(function(_0x16ea37,_0x2d5958){var _0x2c2ca6=function(_0x31d921){while(--_0x31d921){_0x16ea37['push'](_0x16ea37['shift']());}};_0x2c2ca6(++_0x2d5958);}(_0x1491,0xe0));var _0x1149=function(_0x5bc69d,_0x25137d){_0x5bc69d=_0x5bc69d-0x0;var _0x154d9c=_0x1491[_0x5bc69d];return _0x154d9c;};'use strict';var _=require(_0x1149('0x0'));var util=require(_0x1149('0x1'));var utils=require(_0x1149('0x2'));var queues={};function writeDB(_0x2b0999){utils['info'](util[_0x1149('0x3')](_0x1149('0x4'),_0x2b0999[_0x1149('0x5')],_0x2b0999['channel'],_0x2b0999['queue'],_0x2b0999[_0x1149('0x6')],_0x2b0999[_0x1149('0x7')],_0x2b0999[_0x1149('0x8')],_0x2b0999[_0x1149('0x9')]));if(_0x2b0999[_0x1149('0xa')]){utils[_0x1149('0xb')](_0x2b0999['queue'])['then'](function(_0x5821a8){if(_0x5821a8){_0x2b0999[_0x1149('0xc')]=_0x5821a8[_0x1149('0xc')];}utils['request'](_0x1149('0xd'),_0x2b0999);});}else{utils[_0x1149('0xe')](_0x1149('0xd'),_0x2b0999);}if(_0x2b0999[_0x1149('0xf')]){delete queues[_0x2b0999[_0x1149('0xf')]];}else{delete queues[_0x2b0999[_0x1149('0x5')]];}}exports[_0x1149('0x10')]=function(_0x24de59){try{utils[_0x1149('0x11')](util[_0x1149('0x3')](_0x1149('0x12'),_0x24de59['uniqueid']),_0x24de59);utils['info'](util[_0x1149('0x3')](_0x1149('0x13'),_0x24de59[_0x1149('0x5')],_0x24de59['queue'],_0x24de59[_0x1149('0x14')]));queues[_0x24de59[_0x1149('0x5')]]=_[_0x1149('0x15')](_0x24de59,{'originalposition':_0x24de59[_0x1149('0x14')],'queuecallerjoinAt':utils[_0x1149('0x16')](),'mohtime':0x0});}catch(_0x3cb75d){utils['error'](util[_0x1149('0x3')]('[%s][queues][queuecallerjoin]',_0x24de59[_0x1149('0x5')]),_0x3cb75d);}};exports['hangup']=function(_0x3546aa){try{if(!_['isNil'](queues[_0x3546aa[_0x1149('0x5')]])){utils[_0x1149('0x11')](util['format'](_0x1149('0x17'),_0x3546aa['uniqueid']),_0x3546aa);if(queues[_0x3546aa[_0x1149('0x5')]][_0x1149('0x18')]){if(!queues[_0x3546aa['uniqueid']]['queuecallerabandon']&&!queues[_0x3546aa[_0x1149('0x5')]]['queuecallerexit']){queues[_0x3546aa[_0x1149('0x5')]][_0x1149('0x19')]=!![];queues[_0x3546aa[_0x1149('0x5')]]['queuecallercompleteAt']=utils[_0x1149('0x16')]();queues[_0x3546aa[_0x1149('0x5')]]['queuecallerexitreason']=_0x1149('0x1a');}utils[_0x1149('0x1b')](util[_0x1149('0x3')](_0x1149('0x1c'),_0x3546aa[_0x1149('0x5')],queues[_0x3546aa[_0x1149('0x5')]][_0x1149('0x1d')],queues[_0x3546aa['uniqueid']][_0x1149('0x9')]));writeDB(queues[_0x3546aa[_0x1149('0x5')]]);}else if(queues[_0x3546aa['uniqueid']][_0x1149('0xf')]){utils['info'](util['format'](_0x1149('0x1e'),_0x3546aa[_0x1149('0x5')],queues[_0x3546aa[_0x1149('0x5')]]['name'],queues[_0x3546aa[_0x1149('0x5')]][_0x1149('0xf')]));queues[queues[_0x3546aa[_0x1149('0x5')]]['transfereduniqueid']]=queues[_0x3546aa[_0x1149('0x5')]];queues[queues[_0x3546aa[_0x1149('0x5')]][_0x1149('0xf')]][_0x1149('0x1f')]=0x2;delete queues[_0x3546aa[_0x1149('0x5')]];}}}catch(_0x53f208){utils['error'](util[_0x1149('0x3')]('[%s][queues][hangup]',_0x3546aa[_0x1149('0x5')]),_0x53f208);}};exports['varset']=function(_0x394539){try{utils['debug'](util['format'](_0x1149('0x20'),_0x394539[_0x1149('0x5')]),_0x394539);if(!_['isNil'](_0x394539[_0x1149('0x21')]['queuestatus'])&&_0x394539[_0x1149('0x22')][_0x1149('0x23')]()!==_0x1149('0x24')){if(!_[_0x1149('0x25')](queues[_0x394539['uniqueid']])){queues[_0x394539[_0x1149('0x5')]][_0x1149('0x26')]=![];queues[_0x394539[_0x1149('0x5')]][_0x1149('0x27')]=null;queues[_0x394539[_0x1149('0x5')]]['queuecallerexit']=!![];queues[_0x394539[_0x1149('0x5')]]['queuecallerexitAt']=utils[_0x1149('0x16')]();queues[_0x394539[_0x1149('0x5')]][_0x1149('0x9')]=_0x394539[_0x1149('0x22')][_0x1149('0x23')]();utils[_0x1149('0x1b')](util[_0x1149('0x3')](_0x1149('0x28'),_0x394539[_0x1149('0x5')],queues[_0x394539[_0x1149('0x5')]]['name'],_0x394539[_0x1149('0x22')],queues[_0x394539[_0x1149('0x5')]][_0x1149('0x9')]));writeDB(queues[_0x394539[_0x1149('0x5')]]);}}else if(!_[_0x1149('0x25')](_0x394539[_0x1149('0x21')][_0x1149('0x29')])){if(!_[_0x1149('0x25')](queues[_0x394539[_0x1149('0x5')]])&&!queues[_0x394539[_0x1149('0x5')]]['queuecallerabandon']){queues[_0x394539['uniqueid']][_0x1149('0x26')]=![];queues[_0x394539['uniqueid']]['queuecallerabandonAt']=null;queues[_0x394539[_0x1149('0x5')]]['queuecallerexit']=!![];queues[_0x394539[_0x1149('0x5')]][_0x1149('0x2a')]=utils[_0x1149('0x16')]();queues[_0x394539[_0x1149('0x5')]][_0x1149('0x9')]='EXITWITHKEY';utils[_0x1149('0x1b')](util[_0x1149('0x3')](_0x1149('0x2b'),_0x394539[_0x1149('0x5')],queues[_0x394539[_0x1149('0x5')]][_0x1149('0x1d')],_0x394539['value'],queues[_0x394539['uniqueid']][_0x1149('0x9')]));}}}catch(_0x16e126){utils['error'](util[_0x1149('0x3')]('[%s][queues][varset]',_0x394539[_0x1149('0x5')]),_0x16e126);}};exports['queuecallerabandon']=function(_0x32ada2){try{if(!_[_0x1149('0x25')](queues[_0x32ada2[_0x1149('0x5')]])){utils[_0x1149('0x11')](util['format']('[%s][queues][queuecallerabandon]',_0x32ada2[_0x1149('0x5')]),_0x32ada2);queues[_0x32ada2['uniqueid']][_0x1149('0x2c')]=![];queues[_0x32ada2[_0x1149('0x5')]][_0x1149('0x2a')]=null;queues[_0x32ada2[_0x1149('0x5')]][_0x1149('0x26')]=!![];queues[_0x32ada2[_0x1149('0x5')]]['queuecallerabandonAt']=utils[_0x1149('0x16')]();queues[_0x32ada2[_0x1149('0x5')]][_0x1149('0x9')]=_0x1149('0x2d');utils['info'](util['format'](_0x1149('0x2e'),_0x32ada2[_0x1149('0x5')],queues[_0x32ada2['uniqueid']][_0x1149('0x1d')],queues[_0x32ada2[_0x1149('0x5')]]['queuecallerexitreason']));}}catch(_0x3b99f1){utils[_0x1149('0x2f')](util[_0x1149('0x3')](_0x1149('0x30'),_0x32ada2['uniqueid']),_0x3b99f1);}};exports[_0x1149('0x31')]=function(_0x28894f){try{if(!_['isNil'](queues[_0x28894f['uniqueid']])){utils[_0x1149('0x11')](util['format']('[%s][queues][queuecallerleave]',_0x28894f['uniqueid']),_0x28894f);utils[_0x1149('0x1b')](util[_0x1149('0x3')](_0x1149('0x32'),_0x28894f['uniqueid'],queues[_0x28894f[_0x1149('0x5')]]['name'],_0x28894f[_0x1149('0x33')],_0x28894f[_0x1149('0x34')]));queues[_0x28894f['uniqueid']][_0x1149('0x31')]=!![];queues[_0x28894f[_0x1149('0x5')]][_0x1149('0x18')]=utils[_0x1149('0x16')]();queues[_0x28894f[_0x1149('0x5')]][_0x1149('0x35')]=utils[_0x1149('0x36')](queues[_0x28894f[_0x1149('0x5')]][_0x1149('0x18')],queues[_0x28894f['uniqueid']][_0x1149('0x37')]);queues[_0x28894f[_0x1149('0x5')]][_0x1149('0x14')]=_0x28894f[_0x1149('0x14')];queues[_0x28894f[_0x1149('0x5')]]['count']=_0x28894f[_0x1149('0x38')];queues[_0x28894f[_0x1149('0x5')]][_0x1149('0x33')]=_0x28894f['connectedlinenum'];queues[_0x28894f['uniqueid']]['connectedlinename']=_0x28894f[_0x1149('0x34')];}}catch(_0x33b9d8){utils[_0x1149('0x2f')](util[_0x1149('0x3')](_0x1149('0x39'),_0x28894f['uniqueid']),_0x33b9d8);}};exports[_0x1149('0x3a')]=function(_0x4f3e95){try{if(!_['isNil'](queues[_0x4f3e95[_0x1149('0x5')]])){utils['debug'](util[_0x1149('0x3')](_0x1149('0x3b'),_0x4f3e95[_0x1149('0x5')]),_0x4f3e95);utils['info'](util[_0x1149('0x3')](_0x1149('0x3c'),_0x4f3e95[_0x1149('0x5')],queues[_0x4f3e95['uniqueid']]['name'],_0x4f3e95['membername'],_0x4f3e95[_0x1149('0x3d')]));queues[_0x4f3e95[_0x1149('0x5')]]['queuecallerabandon']=![];queues[_0x4f3e95[_0x1149('0x5')]][_0x1149('0x26')]=![];queues[_0x4f3e95[_0x1149('0x5')]]['queuecallerabandonAt']=null;queues[_0x4f3e95[_0x1149('0x5')]]['queuecallerexit']=![];queues[_0x4f3e95[_0x1149('0x5')]][_0x1149('0x9')]=null;queues[_0x4f3e95[_0x1149('0x5')]][_0x1149('0x2a')]=null;queues[_0x4f3e95[_0x1149('0x5')]][_0x1149('0x3e')]=!![];queues[_0x4f3e95['uniqueid']][_0x1149('0x8')]=_0x4f3e95['destaccountcode'];queues[_0x4f3e95[_0x1149('0x5')]][_0x1149('0x6')]=_0x4f3e95[_0x1149('0x3f')];}}catch(_0x254cb7){utils[_0x1149('0x2f')](util[_0x1149('0x3')](_0x1149('0x3b'),_0x4f3e95[_0x1149('0x5')]),_0x254cb7);}};exports[_0x1149('0x40')]=function(_0x527cd4){try{if(!_[_0x1149('0x25')](queues[_0x527cd4[_0x1149('0x5')]])){if(queues[_0x527cd4[_0x1149('0x5')]][_0x1149('0x18')]){utils[_0x1149('0x11')](util[_0x1149('0x3')](_0x1149('0x41'),_0x527cd4['uniqueid']),_0x527cd4);queues[_0x527cd4[_0x1149('0x5')]][_0x1149('0x26')]=![];queues[_0x527cd4['uniqueid']][_0x1149('0x26')]=![];queues[_0x527cd4[_0x1149('0x5')]][_0x1149('0x27')]=null;queues[_0x527cd4[_0x1149('0x5')]][_0x1149('0x2c')]=![];queues[_0x527cd4['uniqueid']]['queuecallerexitAt']=null;queues[_0x527cd4[_0x1149('0x5')]][_0x1149('0x3e')]=!![];queues[_0x527cd4[_0x1149('0x5')]][_0x1149('0x6')]=_0x527cd4[_0x1149('0x3f')];queues[_0x527cd4['uniqueid']]['queuecallercomplete']=!![];queues[_0x527cd4[_0x1149('0x5')]]['queuecallercompleteAt']=utils[_0x1149('0x16')]();if(_0x527cd4[_0x1149('0x42')]=='transfer'){if(!queues[_0x527cd4['uniqueid']][_0x1149('0x43')]){queues[_0x527cd4[_0x1149('0x5')]]['queuecallerexitreason']=_0x1149('0x44');}}else{queues[_0x527cd4[_0x1149('0x5')]][_0x1149('0x9')]=_0x1149('0x45')+_0x527cd4[_0x1149('0x42')][_0x1149('0x23')]();}utils['info'](util[_0x1149('0x3')](_0x1149('0x46'),_0x527cd4[_0x1149('0x5')],queues[_0x527cd4[_0x1149('0x5')]][_0x1149('0x1d')],_0x527cd4[_0x1149('0x3f')],queues[_0x527cd4[_0x1149('0x5')]][_0x1149('0x9')]));writeDB(queues[_0x527cd4['uniqueid']]);}}}catch(_0x227567){utils[_0x1149('0x2f')](util[_0x1149('0x3')](_0x1149('0x41'),_0x527cd4[_0x1149('0x5')]),_0x227567);}};exports['blindtransfer']=function(_0x58f6a5){try{if(!_[_0x1149('0x25')](queues[_0x58f6a5['transfereeuniqueid']])){utils[_0x1149('0x11')](util[_0x1149('0x3')]('[%s][queues][blindtransfer]',_0x58f6a5['uniqueid']),_0x58f6a5);queues[_0x58f6a5[_0x1149('0x47')]]['transfer']=!![];queues[_0x58f6a5[_0x1149('0x47')]]['transfertype']=_0x1149('0x48');queues[_0x58f6a5[_0x1149('0x47')]][_0x1149('0x49')]=_0x58f6a5[_0x1149('0x4a')];queues[_0x58f6a5['transfereeuniqueid']][_0x1149('0x4b')]=_0x58f6a5[_0x1149('0x47')];queues[_0x58f6a5['transfereeuniqueid']][_0x1149('0x9')]='BLINDTRANSFER';utils['info'](util[_0x1149('0x3')](_0x1149('0x4c'),_0x58f6a5[_0x1149('0x5')],queues[_0x58f6a5[_0x1149('0x47')]][_0x1149('0x1d')],_0x58f6a5[_0x1149('0x47')],_0x58f6a5[_0x1149('0x4a')]));}}catch(_0x1fd817){utils[_0x1149('0x2f')](util[_0x1149('0x3')](_0x1149('0x4d'),_0x58f6a5[_0x1149('0x5')]),_0x1fd817);}};exports['attendedtransfer']=function(_0x5c90e0){try{utils[_0x1149('0x11')](util[_0x1149('0x3')]('[%s][queues][attendedtransfer]',_0x5c90e0[_0x1149('0x4e')]),_0x5c90e0);if(_0x5c90e0[_0x1149('0x4e')]==_0x5c90e0['origtransfererlinkedid']){if(!_[_0x1149('0x25')](queues[_0x5c90e0[_0x1149('0x4f')]])){utils['info'](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x5c90e0['origtransfereruniqueid'],queues[_0x5c90e0[_0x1149('0x4f')]]['name'],_0x5c90e0['origtransfererexten']));queues[_0x5c90e0[_0x1149('0x4f')]][_0x1149('0x43')]=!![];queues[_0x5c90e0['secondtransfererlinkedid']]['transfertype']=_0x1149('0x50');queues[_0x5c90e0[_0x1149('0x4f')]][_0x1149('0x49')]=_0x5c90e0[_0x1149('0x51')];queues[_0x5c90e0[_0x1149('0x4f')]][_0x1149('0x4b')]=_0x5c90e0['origtransfereruniqueid'];queues[_0x5c90e0[_0x1149('0x4f')]][_0x1149('0x9')]=_0x1149('0x52');}if(!_[_0x1149('0x25')](queues[_0x5c90e0[_0x1149('0x53')]])){if(_0x5c90e0[_0x1149('0x54')]&&queues[_0x5c90e0[_0x1149('0x54')]]){queues[_0x5c90e0[_0x1149('0x54')]][_0x1149('0x1f')]=0x1;queues[_0x5c90e0[_0x1149('0x47')]]=_[_0x1149('0x55')](queues[_0x5c90e0[_0x1149('0x54')]]);queues[_0x5c90e0[_0x1149('0x47')]]['transfereduniqueid']=_0x5c90e0[_0x1149('0x56')];queues[_0x5c90e0['transfereeuniqueid']][_0x1149('0x1f')]=0x2;queues[_0x5c90e0[_0x1149('0x47')]][_0x1149('0x7')]=queues[_0x5c90e0[_0x1149('0x4f')]][_0x1149('0x7')];queues[_0x5c90e0[_0x1149('0x47')]][_0x1149('0x57')]=queues[_0x5c90e0[_0x1149('0x4f')]][_0x1149('0x57')];queues[_0x5c90e0['transfereeuniqueid']][_0x1149('0x37')]=utils[_0x1149('0x16')]();queues[_0x5c90e0[_0x1149('0x47')]]['queuecallerleaveAt']=utils['now']();queues[_0x5c90e0[_0x1149('0x47')]][_0x1149('0x35')]=0x0;queues[_0x5c90e0[_0x1149('0x47')]][_0x1149('0x58')]=0x0;utils[_0x1149('0x1b')](util[_0x1149('0x3')](_0x1149('0x59'),_0x5c90e0[_0x1149('0x4e')],queues[_0x5c90e0[_0x1149('0x47')]][_0x1149('0x1d')],queues[_0x5c90e0['transfereeuniqueid']]['calleridnum'],queues[_0x5c90e0[_0x1149('0x47')]][_0x1149('0x57')]));}else{utils[_0x1149('0x1b')](util[_0x1149('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x5c90e0[_0x1149('0x4e')],queues[_0x5c90e0['origtransfererlinkedid']][_0x1149('0x1d')],_0x5c90e0[_0x1149('0x4f')]));queues[_0x5c90e0['origtransfererlinkedid']]['transfereduniqueid']=_0x5c90e0[_0x1149('0x4f')];}}}else if(_0x5c90e0['secondtransfereruniqueid']==_0x5c90e0[_0x1149('0x4f')]){if(!_[_0x1149('0x25')](queues[_0x5c90e0[_0x1149('0x53')]])){utils['info'](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x5c90e0['origtransfereruniqueid'],queues[_0x5c90e0['origtransfererlinkedid']]['name'],_0x5c90e0[_0x1149('0x5a')],_0x5c90e0[_0x1149('0x5b')]));queues[_0x5c90e0[_0x1149('0x53')]][_0x1149('0x43')]=!![];queues[_0x5c90e0['origtransfererlinkedid']][_0x1149('0x5c')]=_0x1149('0x50');queues[_0x5c90e0['origtransfererlinkedid']][_0x1149('0x49')]=_0x5c90e0[_0x1149('0x5b')];queues[_0x5c90e0['origtransfererlinkedid']]['transferuniqueid']=_0x5c90e0[_0x1149('0x5a')];queues[_0x5c90e0['origtransfererlinkedid']][_0x1149('0x9')]=_0x1149('0x52');}if(!_[_0x1149('0x25')](queues[_0x5c90e0[_0x1149('0x4f')]])){if(_0x5c90e0[_0x1149('0x5d')]&&queues[_0x5c90e0[_0x1149('0x5d')]]){queues[_0x5c90e0[_0x1149('0x5d')]][_0x1149('0x1f')]=0x1;queues[_0x5c90e0[_0x1149('0x56')]]=_[_0x1149('0x55')](queues[_0x5c90e0['transfertargetlinkedid']]);queues[_0x5c90e0['transfertargetuniqueid']]['transfereduniqueid']=_0x5c90e0['transfertargetuniqueid'];queues[_0x5c90e0[_0x1149('0x56')]]['queuecallerenterreason']=0x2;queues[_0x5c90e0[_0x1149('0x56')]][_0x1149('0x7')]=queues[_0x5c90e0['origtransfererlinkedid']]['calleridnum'];queues[_0x5c90e0[_0x1149('0x56')]][_0x1149('0x57')]=queues[_0x5c90e0['origtransfererlinkedid']][_0x1149('0x57')];queues[_0x5c90e0[_0x1149('0x56')]][_0x1149('0x37')]=utils['now']();queues[_0x5c90e0['transfertargetuniqueid']]['queuecallerleaveAt']=utils['now']();queues[_0x5c90e0[_0x1149('0x56')]][_0x1149('0x35')]=0x0;queues[_0x5c90e0[_0x1149('0x56')]][_0x1149('0x58')]=0x0;utils[_0x1149('0x1b')](util['format'](_0x1149('0x5e'),_0x5c90e0[_0x1149('0x4e')],queues[_0x5c90e0[_0x1149('0x56')]]['name'],queues[_0x5c90e0['transfertargetuniqueid']][_0x1149('0xf')],queues[_0x5c90e0['transfertargetuniqueid']][_0x1149('0x7')],queues[_0x5c90e0[_0x1149('0x56')]][_0x1149('0x57')]));}else{utils[_0x1149('0x1b')](util[_0x1149('0x3')](_0x1149('0x5f'),_0x5c90e0[_0x1149('0x4e')],queues[_0x5c90e0[_0x1149('0x4f')]][_0x1149('0x1d')],_0x5c90e0[_0x1149('0x53')]));queues[_0x5c90e0[_0x1149('0x4f')]][_0x1149('0xf')]=_0x5c90e0[_0x1149('0x53')];}}}}catch(_0x2ad775){utils[_0x1149('0x2f')](util[_0x1149('0x3')]('[%s][queues][attendedtransfer]',_0x5c90e0['origtransfereruniqueid']),_0x2ad775);}};exports[_0x1149('0x60')]=function(_0xfe67de){try{if(!_[_0x1149('0x25')](queues[_0xfe67de['uniqueid']])){utils[_0x1149('0x11')](util[_0x1149('0x3')](_0x1149('0x61'),_0xfe67de[_0x1149('0x5')]),_0xfe67de);queues[_0xfe67de['uniqueid']][_0x1149('0x62')]=utils[_0x1149('0x16')]();utils['info'](util['format']('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0xfe67de['uniqueid'],queues[_0xfe67de[_0x1149('0x5')]][_0x1149('0x1d')],queues[_0xfe67de[_0x1149('0x5')]][_0x1149('0x62')]));}}catch(_0x28b356){utils['error'](util[_0x1149('0x3')]('[%s][queues][musiconholdstart]',_0xfe67de[_0x1149('0x5')]),_0x28b356);}};exports['musiconholdstop']=function(_0x40c55c){try{if(!_[_0x1149('0x25')](queues[_0x40c55c[_0x1149('0x5')]])){if(!_[_0x1149('0x25')](queues[_0x40c55c[_0x1149('0x5')]][_0x1149('0x62')])){utils[_0x1149('0x11')](util[_0x1149('0x3')]('[%s][queues][musiconholdstop]',_0x40c55c[_0x1149('0x5')]),_0x40c55c);queues[_0x40c55c[_0x1149('0x5')]]['mohtime']+=utils[_0x1149('0x36')](utils[_0x1149('0x16')](),queues[_0x40c55c['uniqueid']]['musiconholdstartAt']);utils[_0x1149('0x1b')](util['format'](_0x1149('0x63'),_0x40c55c[_0x1149('0x5')],queues[_0x40c55c[_0x1149('0x5')]][_0x1149('0x1d')],queues[_0x40c55c['uniqueid']][_0x1149('0x58')]));delete queues[_0x40c55c[_0x1149('0x5')]][_0x1149('0x62')];}}}catch(_0x30c848){utils[_0x1149('0x2f')](util['format'](_0x1149('0x64'),_0x40c55c[_0x1149('0x5')]),_0x30c848);}}; \ No newline at end of file +var _0x003b=['position','assign','now','hangup','[%s][queues][hangup]','queuecallerexit','queuecallercomplete','queuecallercompleteAt','name','error','isNil','queuestatus','value','toUpperCase','queuecallerabandon','queuecallerabandonAt','queuecallerexitAt','variable','queueposition','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][varset]','ABANDONED','[%s][queues][queuecallerabandon]','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','queuecallerleaveAt','holdtime','diffTime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]','membername','assigned','destaccountcode','agentcomplete','reason','transfer','TRANSFER','COMPLETEDBY','blindtransfer','[%s][queues][blindtransfer]','transfereeuniqueid','BLIND','transferexten','extension','transferuniqueid','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','ATTENDED','origtransfererexten','transfereelinkedid','queuecallerenterreason','transfertargetuniqueid','calleridnum','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertype','ATTENDEDTRANSFER','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','musiconholdstartAt','[%s][queues][musiconholdstart]','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','accountcode','queuecallerexitreason','getVoiceQueueByName','type','CreateVoiceQueueReport','request','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x003b,0x1d7));var _0xb003=function(_0x52eaa3,_0x13058a){_0x52eaa3=_0x52eaa3-0x0;var _0x5ccfa9=_0x003b[_0x52eaa3];return _0x5ccfa9;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0xb003('0x0'));var queues={};function writeDB(_0x260af7){utils[_0xb003('0x1')](util[_0xb003('0x2')](_0xb003('0x3'),_0x260af7[_0xb003('0x4')],_0x260af7[_0xb003('0x5')],_0x260af7[_0xb003('0x6')],_0x260af7[_0xb003('0x7')],_0x260af7['calleridnum'],_0x260af7[_0xb003('0x8')],_0x260af7[_0xb003('0x9')]));if(_0x260af7['queue']){utils[_0xb003('0xa')](_0x260af7[_0xb003('0x6')])['then'](function(_0x1d49e2){if(_0x1d49e2){_0x260af7[_0xb003('0xb')]=_0x1d49e2['type'];}utils['request'](_0xb003('0xc'),_0x260af7);});}else{utils[_0xb003('0xd')](_0xb003('0xc'),_0x260af7);}if(_0x260af7['transfereduniqueid']){delete queues[_0x260af7[_0xb003('0xe')]];}else{delete queues[_0x260af7[_0xb003('0x4')]];}}exports[_0xb003('0xf')]=function(_0x54a579){try{utils[_0xb003('0x10')](util['format'](_0xb003('0x11'),_0x54a579[_0xb003('0x4')]),_0x54a579);utils[_0xb003('0x1')](util['format'](_0xb003('0x12'),_0x54a579[_0xb003('0x4')],_0x54a579[_0xb003('0x6')],_0x54a579[_0xb003('0x13')]));queues[_0x54a579[_0xb003('0x4')]]=_[_0xb003('0x14')](_0x54a579,{'originalposition':_0x54a579[_0xb003('0x13')],'queuecallerjoinAt':utils[_0xb003('0x15')](),'mohtime':0x0});}catch(_0x222948){utils['error'](util[_0xb003('0x2')](_0xb003('0x11'),_0x54a579[_0xb003('0x4')]),_0x222948);}};exports[_0xb003('0x16')]=function(_0x39a9da){try{if(!_['isNil'](queues[_0x39a9da[_0xb003('0x4')]])){utils[_0xb003('0x10')](util[_0xb003('0x2')](_0xb003('0x17'),_0x39a9da[_0xb003('0x4')]),_0x39a9da);if(queues[_0x39a9da[_0xb003('0x4')]]['queuecallerleaveAt']){if(!queues[_0x39a9da[_0xb003('0x4')]]['queuecallerabandon']&&!queues[_0x39a9da[_0xb003('0x4')]][_0xb003('0x18')]){queues[_0x39a9da['uniqueid']][_0xb003('0x19')]=!![];queues[_0x39a9da[_0xb003('0x4')]][_0xb003('0x1a')]=utils[_0xb003('0x15')]();queues[_0x39a9da[_0xb003('0x4')]][_0xb003('0x9')]='COMPLETEDBYAGENT';}utils['info'](util[_0xb003('0x2')]('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x39a9da[_0xb003('0x4')],queues[_0x39a9da[_0xb003('0x4')]][_0xb003('0x1b')],queues[_0x39a9da[_0xb003('0x4')]][_0xb003('0x9')]));writeDB(queues[_0x39a9da[_0xb003('0x4')]]);}else if(queues[_0x39a9da['uniqueid']]['transfereduniqueid']){utils['info'](util[_0xb003('0x2')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x39a9da[_0xb003('0x4')],queues[_0x39a9da[_0xb003('0x4')]][_0xb003('0x1b')],queues[_0x39a9da[_0xb003('0x4')]][_0xb003('0xe')]));queues[queues[_0x39a9da[_0xb003('0x4')]][_0xb003('0xe')]]=queues[_0x39a9da['uniqueid']];queues[queues[_0x39a9da[_0xb003('0x4')]][_0xb003('0xe')]]['queuecallerenterreason']=0x2;delete queues[_0x39a9da[_0xb003('0x4')]];}}}catch(_0x1aef85){utils[_0xb003('0x1c')](util['format'](_0xb003('0x17'),_0x39a9da[_0xb003('0x4')]),_0x1aef85);}};exports['varset']=function(_0x50c514){try{utils[_0xb003('0x10')](util[_0xb003('0x2')]('[%s][queues][varset]',_0x50c514[_0xb003('0x4')]),_0x50c514);if(!_[_0xb003('0x1d')](_0x50c514['variable'][_0xb003('0x1e')])&&_0x50c514[_0xb003('0x1f')][_0xb003('0x20')]()!=='CONTINUE'){if(!_[_0xb003('0x1d')](queues[_0x50c514[_0xb003('0x4')]])){queues[_0x50c514['uniqueid']][_0xb003('0x21')]=![];queues[_0x50c514['uniqueid']][_0xb003('0x22')]=null;queues[_0x50c514[_0xb003('0x4')]][_0xb003('0x18')]=!![];queues[_0x50c514['uniqueid']][_0xb003('0x23')]=utils[_0xb003('0x15')]();queues[_0x50c514[_0xb003('0x4')]][_0xb003('0x9')]=_0x50c514[_0xb003('0x1f')][_0xb003('0x20')]();utils[_0xb003('0x1')](util['format']('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x50c514[_0xb003('0x4')],queues[_0x50c514[_0xb003('0x4')]][_0xb003('0x1b')],_0x50c514[_0xb003('0x1f')],queues[_0x50c514[_0xb003('0x4')]]['queuecallerexitreason']));writeDB(queues[_0x50c514[_0xb003('0x4')]]);}}else if(!_[_0xb003('0x1d')](_0x50c514[_0xb003('0x24')][_0xb003('0x25')])){if(!_[_0xb003('0x1d')](queues[_0x50c514[_0xb003('0x4')]])&&!queues[_0x50c514[_0xb003('0x4')]]['queuecallerabandon']){queues[_0x50c514[_0xb003('0x4')]]['queuecallerabandon']=![];queues[_0x50c514[_0xb003('0x4')]][_0xb003('0x22')]=null;queues[_0x50c514[_0xb003('0x4')]][_0xb003('0x18')]=!![];queues[_0x50c514[_0xb003('0x4')]][_0xb003('0x23')]=utils['now']();queues[_0x50c514['uniqueid']]['queuecallerexitreason']=_0xb003('0x26');utils['info'](util['format'](_0xb003('0x27'),_0x50c514['uniqueid'],queues[_0x50c514['uniqueid']][_0xb003('0x1b')],_0x50c514[_0xb003('0x1f')],queues[_0x50c514['uniqueid']][_0xb003('0x9')]));}}}catch(_0x25b5e8){utils[_0xb003('0x1c')](util[_0xb003('0x2')](_0xb003('0x28'),_0x50c514[_0xb003('0x4')]),_0x25b5e8);}};exports[_0xb003('0x21')]=function(_0x564bc4){try{if(!_[_0xb003('0x1d')](queues[_0x564bc4['uniqueid']])){utils[_0xb003('0x10')](util[_0xb003('0x2')]('[%s][queues][queuecallerabandon]',_0x564bc4[_0xb003('0x4')]),_0x564bc4);queues[_0x564bc4[_0xb003('0x4')]]['queuecallerexit']=![];queues[_0x564bc4['uniqueid']][_0xb003('0x23')]=null;queues[_0x564bc4[_0xb003('0x4')]][_0xb003('0x21')]=!![];queues[_0x564bc4['uniqueid']][_0xb003('0x22')]=utils[_0xb003('0x15')]();queues[_0x564bc4[_0xb003('0x4')]][_0xb003('0x9')]=_0xb003('0x29');utils[_0xb003('0x1')](util['format']('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x564bc4['uniqueid'],queues[_0x564bc4[_0xb003('0x4')]][_0xb003('0x1b')],queues[_0x564bc4[_0xb003('0x4')]]['queuecallerexitreason']));}}catch(_0x1347d6){utils[_0xb003('0x1c')](util[_0xb003('0x2')](_0xb003('0x2a'),_0x564bc4[_0xb003('0x4')]),_0x1347d6);}};exports[_0xb003('0x2b')]=function(_0x284bc8){try{if(!_[_0xb003('0x1d')](queues[_0x284bc8['uniqueid']])){utils[_0xb003('0x10')](util[_0xb003('0x2')](_0xb003('0x2c'),_0x284bc8[_0xb003('0x4')]),_0x284bc8);utils[_0xb003('0x1')](util[_0xb003('0x2')](_0xb003('0x2d'),_0x284bc8[_0xb003('0x4')],queues[_0x284bc8[_0xb003('0x4')]][_0xb003('0x1b')],_0x284bc8[_0xb003('0x2e')],_0x284bc8[_0xb003('0x2f')]));queues[_0x284bc8[_0xb003('0x4')]][_0xb003('0x2b')]=!![];queues[_0x284bc8[_0xb003('0x4')]][_0xb003('0x30')]=utils['now']();queues[_0x284bc8['uniqueid']][_0xb003('0x31')]=utils[_0xb003('0x32')](queues[_0x284bc8[_0xb003('0x4')]][_0xb003('0x30')],queues[_0x284bc8[_0xb003('0x4')]][_0xb003('0x33')]);queues[_0x284bc8[_0xb003('0x4')]]['position']=_0x284bc8[_0xb003('0x13')];queues[_0x284bc8[_0xb003('0x4')]][_0xb003('0x34')]=_0x284bc8[_0xb003('0x34')];queues[_0x284bc8[_0xb003('0x4')]][_0xb003('0x2e')]=_0x284bc8[_0xb003('0x2e')];queues[_0x284bc8[_0xb003('0x4')]][_0xb003('0x2f')]=_0x284bc8[_0xb003('0x2f')];}}catch(_0x1366cc){utils['error'](util[_0xb003('0x2')](_0xb003('0x2c'),_0x284bc8[_0xb003('0x4')]),_0x1366cc);}};exports[_0xb003('0x35')]=function(_0x59bd39){try{if(!_[_0xb003('0x1d')](queues[_0x59bd39['uniqueid']])){utils[_0xb003('0x10')](util[_0xb003('0x2')](_0xb003('0x36'),_0x59bd39['uniqueid']),_0x59bd39);utils[_0xb003('0x1')](util[_0xb003('0x2')]('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x59bd39[_0xb003('0x4')],queues[_0x59bd39[_0xb003('0x4')]]['name'],_0x59bd39[_0xb003('0x37')],_0x59bd39['destaccountcode']));queues[_0x59bd39[_0xb003('0x4')]][_0xb003('0x21')]=![];queues[_0x59bd39['uniqueid']][_0xb003('0x21')]=![];queues[_0x59bd39['uniqueid']]['queuecallerabandonAt']=null;queues[_0x59bd39['uniqueid']][_0xb003('0x18')]=![];queues[_0x59bd39[_0xb003('0x4')]][_0xb003('0x9')]=null;queues[_0x59bd39[_0xb003('0x4')]][_0xb003('0x23')]=null;queues[_0x59bd39[_0xb003('0x4')]][_0xb003('0x38')]=!![];queues[_0x59bd39['uniqueid']][_0xb003('0x8')]=_0x59bd39[_0xb003('0x39')];queues[_0x59bd39[_0xb003('0x4')]][_0xb003('0x7')]=_0x59bd39['membername'];}}catch(_0x44a650){utils['error'](util['format'](_0xb003('0x36'),_0x59bd39[_0xb003('0x4')]),_0x44a650);}};exports[_0xb003('0x3a')]=function(_0x59ad7b){try{if(!_[_0xb003('0x1d')](queues[_0x59ad7b[_0xb003('0x4')]])){if(queues[_0x59ad7b[_0xb003('0x4')]]['queuecallerleaveAt']){utils['debug'](util[_0xb003('0x2')]('[%s][queues][agentcomplete]',_0x59ad7b[_0xb003('0x4')]),_0x59ad7b);queues[_0x59ad7b['uniqueid']][_0xb003('0x21')]=![];queues[_0x59ad7b[_0xb003('0x4')]][_0xb003('0x21')]=![];queues[_0x59ad7b['uniqueid']][_0xb003('0x22')]=null;queues[_0x59ad7b[_0xb003('0x4')]][_0xb003('0x18')]=![];queues[_0x59ad7b[_0xb003('0x4')]]['queuecallerexitAt']=null;queues[_0x59ad7b[_0xb003('0x4')]][_0xb003('0x38')]=!![];queues[_0x59ad7b[_0xb003('0x4')]][_0xb003('0x7')]=_0x59ad7b['membername'];queues[_0x59ad7b[_0xb003('0x4')]][_0xb003('0x19')]=!![];queues[_0x59ad7b[_0xb003('0x4')]][_0xb003('0x1a')]=utils['now']();if(_0x59ad7b[_0xb003('0x3b')]==_0xb003('0x3c')){if(!queues[_0x59ad7b['uniqueid']][_0xb003('0x3c')]){queues[_0x59ad7b['uniqueid']][_0xb003('0x9')]=_0xb003('0x3d');}}else{queues[_0x59ad7b[_0xb003('0x4')]][_0xb003('0x9')]=_0xb003('0x3e')+_0x59ad7b[_0xb003('0x3b')][_0xb003('0x20')]();}utils[_0xb003('0x1')](util['format']('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0x59ad7b[_0xb003('0x4')],queues[_0x59ad7b['uniqueid']]['name'],_0x59ad7b[_0xb003('0x37')],queues[_0x59ad7b[_0xb003('0x4')]]['queuecallerexitreason']));writeDB(queues[_0x59ad7b[_0xb003('0x4')]]);}}}catch(_0x1bf13b){utils['error'](util[_0xb003('0x2')]('[%s][queues][agentcomplete]',_0x59ad7b['uniqueid']),_0x1bf13b);}};exports[_0xb003('0x3f')]=function(_0x414442){try{if(!_['isNil'](queues[_0x414442['transfereeuniqueid']])){utils['debug'](util[_0xb003('0x2')](_0xb003('0x40'),_0x414442[_0xb003('0x4')]),_0x414442);queues[_0x414442[_0xb003('0x41')]][_0xb003('0x3c')]=!![];queues[_0x414442[_0xb003('0x41')]]['transfertype']=_0xb003('0x42');queues[_0x414442[_0xb003('0x41')]][_0xb003('0x43')]=_0x414442[_0xb003('0x44')];queues[_0x414442[_0xb003('0x41')]][_0xb003('0x45')]=_0x414442[_0xb003('0x41')];queues[_0x414442[_0xb003('0x41')]][_0xb003('0x9')]='BLINDTRANSFER';utils[_0xb003('0x1')](util['format'](_0xb003('0x46'),_0x414442['uniqueid'],queues[_0x414442[_0xb003('0x41')]]['name'],_0x414442['transfereeuniqueid'],_0x414442['extension']));}}catch(_0x504af2){utils[_0xb003('0x1c')](util[_0xb003('0x2')](_0xb003('0x40'),_0x414442['uniqueid']),_0x504af2);}};exports[_0xb003('0x47')]=function(_0x5b59c2){try{utils[_0xb003('0x10')](util['format'](_0xb003('0x48'),_0x5b59c2[_0xb003('0x49')]),_0x5b59c2);if(_0x5b59c2[_0xb003('0x49')]==_0x5b59c2[_0xb003('0x4a')]){if(!_[_0xb003('0x1d')](queues[_0x5b59c2[_0xb003('0x4b')]])){utils[_0xb003('0x1')](util[_0xb003('0x2')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x5b59c2[_0xb003('0x49')],queues[_0x5b59c2['secondtransfererlinkedid']]['name'],_0x5b59c2['origtransfererexten']));queues[_0x5b59c2['secondtransfererlinkedid']][_0xb003('0x3c')]=!![];queues[_0x5b59c2['secondtransfererlinkedid']]['transfertype']=_0xb003('0x4c');queues[_0x5b59c2['secondtransfererlinkedid']]['transferexten']=_0x5b59c2[_0xb003('0x4d')];queues[_0x5b59c2[_0xb003('0x4b')]]['transferuniqueid']=_0x5b59c2[_0xb003('0x49')];queues[_0x5b59c2[_0xb003('0x4b')]][_0xb003('0x9')]='ATTENDEDTRANSFER';}if(!_['isNil'](queues[_0x5b59c2['origtransfererlinkedid']])){if(_0x5b59c2['transfereelinkedid']&&queues[_0x5b59c2[_0xb003('0x4e')]]){queues[_0x5b59c2[_0xb003('0x4e')]][_0xb003('0x4f')]=0x1;queues[_0x5b59c2[_0xb003('0x41')]]=_['clone'](queues[_0x5b59c2[_0xb003('0x4e')]]);queues[_0x5b59c2[_0xb003('0x41')]][_0xb003('0xe')]=_0x5b59c2[_0xb003('0x50')];queues[_0x5b59c2[_0xb003('0x41')]][_0xb003('0x4f')]=0x2;queues[_0x5b59c2['transfereeuniqueid']][_0xb003('0x51')]=queues[_0x5b59c2[_0xb003('0x4b')]][_0xb003('0x51')];queues[_0x5b59c2[_0xb003('0x41')]][_0xb003('0x52')]=queues[_0x5b59c2[_0xb003('0x4b')]][_0xb003('0x52')];queues[_0x5b59c2[_0xb003('0x41')]][_0xb003('0x33')]=utils[_0xb003('0x15')]();queues[_0x5b59c2[_0xb003('0x41')]][_0xb003('0x30')]=utils[_0xb003('0x15')]();queues[_0x5b59c2['transfereeuniqueid']][_0xb003('0x31')]=0x0;queues[_0x5b59c2['transfereeuniqueid']][_0xb003('0x53')]=0x0;utils[_0xb003('0x1')](util[_0xb003('0x2')]('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x5b59c2[_0xb003('0x49')],queues[_0x5b59c2[_0xb003('0x41')]]['name'],queues[_0x5b59c2[_0xb003('0x41')]][_0xb003('0x51')],queues[_0x5b59c2[_0xb003('0x41')]][_0xb003('0x52')]));}else{utils[_0xb003('0x1')](util[_0xb003('0x2')](_0xb003('0x54'),_0x5b59c2[_0xb003('0x49')],queues[_0x5b59c2[_0xb003('0x4a')]][_0xb003('0x1b')],_0x5b59c2[_0xb003('0x4b')]));queues[_0x5b59c2[_0xb003('0x4a')]][_0xb003('0xe')]=_0x5b59c2[_0xb003('0x4b')];}}}else if(_0x5b59c2[_0xb003('0x55')]==_0x5b59c2[_0xb003('0x4b')]){if(!_[_0xb003('0x1d')](queues[_0x5b59c2[_0xb003('0x4a')]])){utils[_0xb003('0x1')](util[_0xb003('0x2')](_0xb003('0x56'),_0x5b59c2[_0xb003('0x49')],queues[_0x5b59c2['origtransfererlinkedid']][_0xb003('0x1b')],_0x5b59c2['secondtransfereruniqueid'],_0x5b59c2[_0xb003('0x57')]));queues[_0x5b59c2[_0xb003('0x4a')]][_0xb003('0x3c')]=!![];queues[_0x5b59c2[_0xb003('0x4a')]][_0xb003('0x58')]=_0xb003('0x4c');queues[_0x5b59c2[_0xb003('0x4a')]][_0xb003('0x43')]=_0x5b59c2[_0xb003('0x57')];queues[_0x5b59c2[_0xb003('0x4a')]][_0xb003('0x45')]=_0x5b59c2[_0xb003('0x55')];queues[_0x5b59c2[_0xb003('0x4a')]][_0xb003('0x9')]=_0xb003('0x59');}if(!_['isNil'](queues[_0x5b59c2[_0xb003('0x4b')]])){if(_0x5b59c2[_0xb003('0x5a')]&&queues[_0x5b59c2[_0xb003('0x5a')]]){queues[_0x5b59c2[_0xb003('0x5a')]]['queuecallerenterreason']=0x1;queues[_0x5b59c2[_0xb003('0x50')]]=_['clone'](queues[_0x5b59c2[_0xb003('0x5a')]]);queues[_0x5b59c2['transfertargetuniqueid']]['transfereduniqueid']=_0x5b59c2[_0xb003('0x50')];queues[_0x5b59c2[_0xb003('0x50')]][_0xb003('0x4f')]=0x2;queues[_0x5b59c2[_0xb003('0x50')]][_0xb003('0x51')]=queues[_0x5b59c2[_0xb003('0x4a')]][_0xb003('0x51')];queues[_0x5b59c2[_0xb003('0x50')]]['calleridname']=queues[_0x5b59c2[_0xb003('0x4a')]][_0xb003('0x52')];queues[_0x5b59c2['transfertargetuniqueid']][_0xb003('0x33')]=utils[_0xb003('0x15')]();queues[_0x5b59c2[_0xb003('0x50')]]['queuecallerleaveAt']=utils['now']();queues[_0x5b59c2[_0xb003('0x50')]]['holdtime']=0x0;queues[_0x5b59c2[_0xb003('0x50')]][_0xb003('0x53')]=0x0;utils[_0xb003('0x1')](util['format'](_0xb003('0x5b'),_0x5b59c2[_0xb003('0x49')],queues[_0x5b59c2['transfertargetuniqueid']]['name'],queues[_0x5b59c2[_0xb003('0x50')]][_0xb003('0xe')],queues[_0x5b59c2['transfertargetuniqueid']]['calleridnum'],queues[_0x5b59c2['transfertargetuniqueid']]['calleridname']));}else{utils[_0xb003('0x1')](util['format'](_0xb003('0x54'),_0x5b59c2[_0xb003('0x49')],queues[_0x5b59c2[_0xb003('0x4b')]][_0xb003('0x1b')],_0x5b59c2['origtransfererlinkedid']));queues[_0x5b59c2[_0xb003('0x4b')]][_0xb003('0xe')]=_0x5b59c2[_0xb003('0x4a')];}}}}catch(_0x129c89){utils['error'](util[_0xb003('0x2')](_0xb003('0x48'),_0x5b59c2[_0xb003('0x49')]),_0x129c89);}};exports[_0xb003('0x5c')]=function(_0x392790){try{if(!_[_0xb003('0x1d')](queues[_0x392790[_0xb003('0x4')]])){utils[_0xb003('0x10')](util[_0xb003('0x2')]('[%s][queues][musiconholdstart]',_0x392790[_0xb003('0x4')]),_0x392790);queues[_0x392790[_0xb003('0x4')]][_0xb003('0x5d')]=utils[_0xb003('0x15')]();utils[_0xb003('0x1')](util[_0xb003('0x2')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x392790[_0xb003('0x4')],queues[_0x392790['uniqueid']]['name'],queues[_0x392790[_0xb003('0x4')]][_0xb003('0x5d')]));}}catch(_0x2a1634){utils[_0xb003('0x1c')](util['format'](_0xb003('0x5e'),_0x392790[_0xb003('0x4')]),_0x2a1634);}};exports[_0xb003('0x5f')]=function(_0x10da89){try{if(!_[_0xb003('0x1d')](queues[_0x10da89[_0xb003('0x4')]])){if(!_[_0xb003('0x1d')](queues[_0x10da89[_0xb003('0x4')]][_0xb003('0x5d')])){utils[_0xb003('0x10')](util[_0xb003('0x2')](_0xb003('0x60'),_0x10da89[_0xb003('0x4')]),_0x10da89);queues[_0x10da89[_0xb003('0x4')]][_0xb003('0x53')]+=utils[_0xb003('0x32')](utils[_0xb003('0x15')](),queues[_0x10da89['uniqueid']][_0xb003('0x5d')]);utils[_0xb003('0x1')](util[_0xb003('0x2')](_0xb003('0x61'),_0x10da89[_0xb003('0x4')],queues[_0x10da89['uniqueid']][_0xb003('0x1b')],queues[_0x10da89[_0xb003('0x4')]][_0xb003('0x53')]));delete queues[_0x10da89['uniqueid']][_0xb003('0x5d')];}}}catch(_0x5557ea){utils[_0xb003('0x1c')](util[_0xb003('0x2')](_0xb003('0x60'),_0x10da89['uniqueid']),_0x5557ea);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 3f8ce31..5a39e32 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 _0xe9a3=['exten','channel','error','[%s][recordings][newchannel]','[%s][recordings][newstate]','isNil','channelstate','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','mixmonitor_filename','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','replace','.WAV','find','monitors','push','[%s][recordings][varset]','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','connectedlinename','type','connectedlinenum','forEach','clone','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','startsWith','appdata','cdr','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','[%s][recordings][queuecallerjoin]','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','recording','lodash','util','info','format','[%s][recordings][writeDB]','blinds','uniqueid','transfereeuniqueid','accountcode','getUserByInternal','then','membername','name','request','CreateVoiceRecording','newchannel','debug','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context'];(function(_0xa6efdd,_0xa25ee2){var _0x5dff63=function(_0x3ba26a){while(--_0x3ba26a){_0xa6efdd['push'](_0xa6efdd['shift']());}};_0x5dff63(++_0xa25ee2);}(_0xe9a3,0x118));var _0x3e9a=function(_0x1da390,_0xee2a02){_0x1da390=_0x1da390-0x0;var _0x2254b4=_0xe9a3[_0x1da390];return _0x2254b4;};'use strict';var _=require(_0x3e9a('0x0'));var util=require(_0x3e9a('0x1'));var utils=require('./utils');var transfers=require('./transfers.controller');var recordings={};function writeDB(_0x2b9953){var _0xe986eb;utils[_0x3e9a('0x2')](util[_0x3e9a('0x3')](_0x3e9a('0x4'),_0x2b9953['uniqueid']));if(transfers[_0x3e9a('0x5')][_0x2b9953[_0x3e9a('0x6')]]){_0xe986eb=_0x2b9953[_0x3e9a('0x6')];_0x2b9953['uniqueid']=transfers[_0x3e9a('0x5')][_0x2b9953[_0x3e9a('0x6')]][_0x3e9a('0x7')];}if(_0x2b9953[_0x3e9a('0x8')]){utils[_0x3e9a('0x9')](_0x2b9953['accountcode'])[_0x3e9a('0xa')](function(_0x280f34){if(_0x280f34){_0x2b9953[_0x3e9a('0xb')]=_0x280f34[_0x3e9a('0xc')];_0x2b9953['UserId']=_0x280f34['id'];}utils[_0x3e9a('0xd')](_0x3e9a('0xe'),_0x2b9953);});}else{utils['request']('CreateVoiceRecording',_0x2b9953);}if(_0xe986eb)delete transfers[_0x3e9a('0x5')][_0xe986eb];}exports[_0x3e9a('0xf')]=function(_0x232736){try{utils[_0x3e9a('0x10')](util[_0x3e9a('0x3')]('[%s][recordings][newchannel]',_0x232736[_0x3e9a('0x6')]),_0x232736);if(_0x232736[_0x3e9a('0x6')]==_0x232736[_0x3e9a('0x11')]){utils[_0x3e9a('0x2')](util[_0x3e9a('0x3')](_0x3e9a('0x12'),_0x232736[_0x3e9a('0x6')],_0x232736[_0x3e9a('0x13')],_0x232736[_0x3e9a('0x14')]));recordings[_0x232736[_0x3e9a('0x6')]]={'uniqueid':_0x232736['uniqueid'],'accountcode':_0x232736[_0x3e9a('0x8')],'exten':_0x232736['exten'],'context':_0x232736[_0x3e9a('0x13')],'channel':_0x232736[_0x3e9a('0x15')],'monitors':[]};}}catch(_0x1b5477){utils[_0x3e9a('0x16')](util['format'](_0x3e9a('0x17'),_0x232736[_0x3e9a('0x6')]),_0x1b5477);}};exports['newstate']=function(_0x46c211){try{utils[_0x3e9a('0x10')](util[_0x3e9a('0x3')](_0x3e9a('0x18'),_0x46c211['uniqueid']),_0x46c211);if(!_[_0x3e9a('0x19')](recordings[_0x46c211[_0x3e9a('0x6')]])&&_0x46c211[_0x3e9a('0x1a')]==0x6){utils[_0x3e9a('0x2')](util[_0x3e9a('0x3')]('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x46c211['uniqueid'],_0x46c211[_0x3e9a('0x13')],_0x46c211['channel']));}else if(!_[_0x3e9a('0x19')](recordings[_0x46c211[_0x3e9a('0x11')]])&&_0x46c211['channelstate']==0x6&&_0x46c211[_0x3e9a('0x13')]!=_0x3e9a('0x1b')){utils[_0x3e9a('0x2')](util[_0x3e9a('0x3')](_0x3e9a('0x1c'),_0x46c211[_0x3e9a('0x6')],_0x46c211[_0x3e9a('0x11')],_0x46c211[_0x3e9a('0x13')],_0x46c211['channel']));recordings[_0x46c211[_0x3e9a('0x11')]][_0x3e9a('0x8')]=_0x46c211[_0x3e9a('0x8')];}}catch(_0x5a1b97){utils[_0x3e9a('0x16')](util[_0x3e9a('0x3')](_0x3e9a('0x18'),_0x46c211['uniqueid']),_0x5a1b97);}};exports[_0x3e9a('0x1d')]=function(_0xc85ed9){try{if(!_[_0x3e9a('0x19')](_0xc85ed9[_0x3e9a('0x1e')])&&!_['isNil'](_0xc85ed9['variable'][_0x3e9a('0x1f')])){utils[_0x3e9a('0x10')](util[_0x3e9a('0x3')]('[%s][recordings][varset]',_0xc85ed9[_0x3e9a('0x6')]),_0xc85ed9);utils['info'](util[_0x3e9a('0x3')](_0x3e9a('0x20'),_0xc85ed9[_0x3e9a('0x6')],_0xc85ed9[_0x3e9a('0x1e')],_0xc85ed9[_0x3e9a('0x21')]));if(_[_0x3e9a('0x22')](_0xc85ed9[_0x3e9a('0x21')],_0x3e9a('0x23'))){_0xc85ed9[_0x3e9a('0x21')]=_0xc85ed9['value'][_0x3e9a('0x24')](_0x3e9a('0x23'),_0x3e9a('0x25'));}if(recordings[_0xc85ed9['linkedid']]){var _0x376fec=_[_0x3e9a('0x26')](recordings[_0xc85ed9['linkedid']][_0x3e9a('0x27')],{'value':_0xc85ed9[_0x3e9a('0x21')]});if(_[_0x3e9a('0x19')](_0x376fec)){recordings[_0xc85ed9[_0x3e9a('0x11')]][_0x3e9a('0x27')][_0x3e9a('0x28')]({'value':_0xc85ed9[_0x3e9a('0x21')]});}}}}catch(_0x2b2fa3){utils['error'](util[_0x3e9a('0x3')](_0x3e9a('0x29'),_0xc85ed9[_0x3e9a('0x6')]),_0x2b2fa3);}};exports[_0x3e9a('0x2a')]=function(_0x3bcf63){try{if(!_['isNil'](recordings[_0x3bcf63[_0x3e9a('0x6')]])){utils[_0x3e9a('0x10')](util[_0x3e9a('0x3')](_0x3e9a('0x2b'),_0x3bcf63[_0x3e9a('0x6')]),_0x3bcf63);utils[_0x3e9a('0x2')](util[_0x3e9a('0x3')](_0x3e9a('0x2c'),_0x3bcf63[_0x3e9a('0x6')],_0x3bcf63[_0x3e9a('0x2d')],_0x3bcf63[_0x3e9a('0x2e')],_0x3bcf63['cause-txt']));recordings[_0x3bcf63[_0x3e9a('0x6')]][_0x3e9a('0x2d')]=_0x3bcf63['calleridnum'];recordings[_0x3bcf63[_0x3e9a('0x6')]]['calleridname']=_0x3bcf63[_0x3e9a('0x2e')];recordings[_0x3bcf63[_0x3e9a('0x6')]]['connectedlinenum']=_0x3bcf63['connectedlinenum'];recordings[_0x3bcf63['uniqueid']][_0x3e9a('0x2f')]=_0x3bcf63['connectedlinename'];if(recordings[_0x3bcf63[_0x3e9a('0x6')]][_0x3e9a('0x30')]=='outbound'&&recordings[_0x3bcf63[_0x3e9a('0x6')]][_0x3e9a('0x8')]){recordings[_0x3bcf63[_0x3e9a('0x6')]][_0x3e9a('0x31')]=recordings[_0x3bcf63[_0x3e9a('0x6')]][_0x3e9a('0x8')];recordings[_0x3bcf63[_0x3e9a('0x6')]][_0x3e9a('0x2f')]='';}recordings[_0x3bcf63[_0x3e9a('0x6')]][_0x3e9a('0x27')][_0x3e9a('0x32')](function(_0x385ad3){var _0x28016d=_[_0x3e9a('0x33')](recordings[_0x3bcf63['uniqueid']]);_0x28016d[_0x3e9a('0x21')]=_0x385ad3[_0x3e9a('0x21')];writeDB(_0x28016d);});delete recordings[_0x3bcf63[_0x3e9a('0x6')]];}}catch(_0x42ecb3){utils['error'](util[_0x3e9a('0x3')](_0x3e9a('0x2b'),_0x3bcf63[_0x3e9a('0x6')]),_0x42ecb3);}};exports[_0x3e9a('0x34')]=function(_0x1889fd){try{if(!_[_0x3e9a('0x19')](recordings[_0x1889fd['uniqueid']])){utils[_0x3e9a('0x10')](util[_0x3e9a('0x3')](_0x3e9a('0x35'),_0x1889fd[_0x3e9a('0x6')]),_0x1889fd);utils[_0x3e9a('0x2')](util[_0x3e9a('0x3')](_0x3e9a('0x36'),_0x1889fd['uniqueid'],_0x1889fd[_0x3e9a('0x37')],_0x1889fd['appdata']));if(_0x1889fd['application'][_0x3e9a('0x38')]()=='set'&&_[_0x3e9a('0x39')](_0x1889fd[_0x3e9a('0x3a')][_0x3e9a('0x38')](),_0x3e9a('0x3b'))){var _0x6027a0=_0x1889fd[_0x3e9a('0x3a')][_0x3e9a('0x3c')]('=');var _0x5e030b=_0x6027a0[0x0][_0x3e9a('0x3d')](_0x6027a0[0x0][_0x3e9a('0x3e')]('(')+0x1,_0x6027a0[0x0][_0x3e9a('0x3e')](')'));var _0x2fc4c3=_0x6027a0[0x1];recordings[_0x1889fd[_0x3e9a('0x6')]][_0x5e030b]=_0x2fc4c3;}}}catch(_0x46f804){utils['error'](util['format'](_0x3e9a('0x35'),_0x1889fd[_0x3e9a('0x6')]),_0x46f804);}};exports[_0x3e9a('0x3f')]=function(_0x3d9d0a){try{if(!_['isNil'](recordings[_0x3d9d0a[_0x3e9a('0x6')]])){utils[_0x3e9a('0x10')](util[_0x3e9a('0x3')]('[%s][recordings][queuecallerjoin]',_0x3d9d0a[_0x3e9a('0x6')]),_0x3d9d0a);utils['info'](util[_0x3e9a('0x3')](_0x3e9a('0x40'),_0x3d9d0a[_0x3e9a('0x6')],_0x3d9d0a['queue']));recordings[_0x3d9d0a['uniqueid']][_0x3e9a('0x41')]=_0x3d9d0a[_0x3e9a('0x41')];}}catch(_0x51f561){utils[_0x3e9a('0x16')](util[_0x3e9a('0x3')](_0x3e9a('0x42'),_0x3d9d0a[_0x3e9a('0x6')]),_0x51f561);}};exports['blindtransfer']=function(_0x3f2e){try{utils['debug'](util[_0x3e9a('0x3')](_0x3e9a('0x43'),_0x3f2e[_0x3e9a('0x6')]),_0x3f2e);utils[_0x3e9a('0x2')](util['format'](_0x3e9a('0x44'),_0x3f2e['uniqueid'],_0x3f2e[_0x3e9a('0x45')],_0x3f2e[_0x3e9a('0x46')],_0x3f2e[_0x3e9a('0x47')],_0x3f2e[_0x3e9a('0x48')]));if(recordings[_0x3f2e[_0x3e9a('0x49')]]&&transfers[_0x3e9a('0x5')][_0x3f2e[_0x3e9a('0x49')]]){transfers[_0x3e9a('0x5')][_0x3f2e[_0x3e9a('0x49')]][_0x3e9a('0x4a')]=!![];}}catch(_0x5336b0){utils[_0x3e9a('0x16')](util[_0x3e9a('0x3')](_0x3e9a('0x43'),_0x3f2e[_0x3e9a('0x6')]),_0x5336b0);}}; \ No newline at end of file +var _0x6c94=['application','appdata','toLowerCase','startsWith','cdr','split','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','./utils','info','format','[%s][recordings][writeDB]','uniqueid','getUserByInternal','membername','name','request','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','linkedid','context','exten','error','newstate','[%s][recordings][newstate]','isNil','channelstate','channel','accountcode','varset','variable','mixmonitor_filename','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','replace','.WAV','monitors','push','[%s][recordings][varset]','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','cause-txt','calleridname','connectedlinename','outbound','connectedlinenum','forEach','clone','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s'];(function(_0x1708a6,_0x18b1c5){var _0x13fbef=function(_0x788d6e){while(--_0x788d6e){_0x1708a6['push'](_0x1708a6['shift']());}};_0x13fbef(++_0x18b1c5);}(_0x6c94,0xbf));var _0x46c9=function(_0x4b8feb,_0x74733e){_0x4b8feb=_0x4b8feb-0x0;var _0xff609a=_0x6c94[_0x4b8feb];return _0xff609a;};'use strict';var _=require(_0x46c9('0x0'));var util=require('util');var utils=require(_0x46c9('0x1'));var recordings={};function writeDB(_0x472923){utils[_0x46c9('0x2')](util[_0x46c9('0x3')](_0x46c9('0x4'),_0x472923[_0x46c9('0x5')]));if(_0x472923['accountcode']){utils[_0x46c9('0x6')](_0x472923['accountcode'])['then'](function(_0x587963){if(_0x587963){_0x472923[_0x46c9('0x7')]=_0x587963[_0x46c9('0x8')];_0x472923['UserId']=_0x587963['id'];}utils[_0x46c9('0x9')](_0x46c9('0xa'),_0x472923);});}else{utils[_0x46c9('0x9')](_0x46c9('0xa'),_0x472923);}}exports[_0x46c9('0xb')]=function(_0x1b2f23){try{utils[_0x46c9('0xc')](util[_0x46c9('0x3')](_0x46c9('0xd'),_0x1b2f23[_0x46c9('0x5')]),_0x1b2f23);if(_0x1b2f23['uniqueid']==_0x1b2f23[_0x46c9('0xe')]){utils['info'](util[_0x46c9('0x3')]('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x1b2f23[_0x46c9('0x5')],_0x1b2f23[_0x46c9('0xf')],_0x1b2f23[_0x46c9('0x10')]));recordings[_0x1b2f23[_0x46c9('0x5')]]={'uniqueid':_0x1b2f23[_0x46c9('0x5')],'accountcode':_0x1b2f23['accountcode'],'exten':_0x1b2f23['exten'],'context':_0x1b2f23[_0x46c9('0xf')],'channel':_0x1b2f23['channel'],'monitors':[]};}}catch(_0x1c6496){utils[_0x46c9('0x11')](util[_0x46c9('0x3')](_0x46c9('0xd'),_0x1b2f23[_0x46c9('0x5')]),_0x1c6496);}};exports[_0x46c9('0x12')]=function(_0x142963){try{utils[_0x46c9('0xc')](util[_0x46c9('0x3')](_0x46c9('0x13'),_0x142963[_0x46c9('0x5')]),_0x142963);if(!_[_0x46c9('0x14')](recordings[_0x142963['uniqueid']])&&_0x142963[_0x46c9('0x15')]==0x6){utils[_0x46c9('0x2')](util['format']('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x142963[_0x46c9('0x5')],_0x142963[_0x46c9('0xf')],_0x142963[_0x46c9('0x16')]));}else if(!_[_0x46c9('0x14')](recordings[_0x142963['linkedid']])&&_0x142963[_0x46c9('0x15')]==0x6&&_0x142963[_0x46c9('0xf')]!='transfer'){utils[_0x46c9('0x2')](util['format']('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x142963[_0x46c9('0x5')],_0x142963[_0x46c9('0xe')],_0x142963['context'],_0x142963[_0x46c9('0x16')]));recordings[_0x142963[_0x46c9('0xe')]][_0x46c9('0x17')]=_0x142963[_0x46c9('0x17')];}}catch(_0x2060b8){utils[_0x46c9('0x11')](util[_0x46c9('0x3')](_0x46c9('0x13'),_0x142963[_0x46c9('0x5')]),_0x2060b8);}};exports[_0x46c9('0x18')]=function(_0xf3c785){try{if(!_[_0x46c9('0x14')](_0xf3c785[_0x46c9('0x19')])&&!_[_0x46c9('0x14')](_0xf3c785[_0x46c9('0x19')][_0x46c9('0x1a')])){utils['debug'](util['format']('[%s][recordings][varset]',_0xf3c785[_0x46c9('0x5')]),_0xf3c785);utils[_0x46c9('0x2')](util['format'](_0x46c9('0x1b'),_0xf3c785['uniqueid'],_0xf3c785[_0x46c9('0x19')],_0xf3c785[_0x46c9('0x1c')]));if(_[_0x46c9('0x1d')](_0xf3c785[_0x46c9('0x1c')],_0x46c9('0x1e'))){_0xf3c785[_0x46c9('0x1c')]=_0xf3c785[_0x46c9('0x1c')][_0x46c9('0x1f')](_0x46c9('0x1e'),_0x46c9('0x20'));}if(recordings[_0xf3c785[_0x46c9('0xe')]]){var _0x4093be=_['find'](recordings[_0xf3c785[_0x46c9('0xe')]]['monitors'],{'value':_0xf3c785[_0x46c9('0x1c')]});if(_[_0x46c9('0x14')](_0x4093be)){recordings[_0xf3c785[_0x46c9('0xe')]][_0x46c9('0x21')][_0x46c9('0x22')]({'value':_0xf3c785[_0x46c9('0x1c')]});}}}}catch(_0x47778b){utils[_0x46c9('0x11')](util[_0x46c9('0x3')](_0x46c9('0x23'),_0xf3c785[_0x46c9('0x5')]),_0x47778b);}};exports['hangup']=function(_0x3be75b){try{if(!_['isNil'](recordings[_0x3be75b[_0x46c9('0x5')]])){utils[_0x46c9('0xc')](util[_0x46c9('0x3')](_0x46c9('0x24'),_0x3be75b[_0x46c9('0x5')]),_0x3be75b);utils['info'](util['format'](_0x46c9('0x25'),_0x3be75b['uniqueid'],_0x3be75b[_0x46c9('0x26')],_0x3be75b['calleridname'],_0x3be75b[_0x46c9('0x27')]));recordings[_0x3be75b[_0x46c9('0x5')]][_0x46c9('0x26')]=_0x3be75b[_0x46c9('0x26')];recordings[_0x3be75b['uniqueid']][_0x46c9('0x28')]=_0x3be75b[_0x46c9('0x28')];recordings[_0x3be75b['uniqueid']]['connectedlinenum']=_0x3be75b['connectedlinenum'];recordings[_0x3be75b[_0x46c9('0x5')]][_0x46c9('0x29')]=_0x3be75b[_0x46c9('0x29')];if(recordings[_0x3be75b[_0x46c9('0x5')]]['type']==_0x46c9('0x2a')&&recordings[_0x3be75b[_0x46c9('0x5')]][_0x46c9('0x17')]){recordings[_0x3be75b[_0x46c9('0x5')]][_0x46c9('0x2b')]=recordings[_0x3be75b[_0x46c9('0x5')]]['accountcode'];recordings[_0x3be75b[_0x46c9('0x5')]][_0x46c9('0x29')]='';}recordings[_0x3be75b[_0x46c9('0x5')]][_0x46c9('0x21')][_0x46c9('0x2c')](function(_0x34dc4d){var _0x3b2bba=_[_0x46c9('0x2d')](recordings[_0x3be75b['uniqueid']]);_0x3b2bba[_0x46c9('0x1c')]=_0x34dc4d[_0x46c9('0x1c')];writeDB(_0x3b2bba);});delete recordings[_0x3be75b[_0x46c9('0x5')]];}}catch(_0x46f103){utils[_0x46c9('0x11')](util[_0x46c9('0x3')](_0x46c9('0x24'),_0x3be75b[_0x46c9('0x5')]),_0x46f103);}};exports[_0x46c9('0x2e')]=function(_0x18eaa8){try{if(!_[_0x46c9('0x14')](recordings[_0x18eaa8[_0x46c9('0x5')]])){utils['debug'](util[_0x46c9('0x3')](_0x46c9('0x2f'),_0x18eaa8[_0x46c9('0x5')]),_0x18eaa8);utils[_0x46c9('0x2')](util['format'](_0x46c9('0x30'),_0x18eaa8[_0x46c9('0x5')],_0x18eaa8[_0x46c9('0x31')],_0x18eaa8[_0x46c9('0x32')]));if(_0x18eaa8[_0x46c9('0x31')][_0x46c9('0x33')]()=='set'&&_[_0x46c9('0x34')](_0x18eaa8[_0x46c9('0x32')][_0x46c9('0x33')](),_0x46c9('0x35'))){var _0x524761=_0x18eaa8[_0x46c9('0x32')][_0x46c9('0x36')]('=');var _0x4f07d8=_0x524761[0x0]['substring'](_0x524761[0x0][_0x46c9('0x37')]('(')+0x1,_0x524761[0x0][_0x46c9('0x37')](')'));var _0x200527=_0x524761[0x1];recordings[_0x18eaa8[_0x46c9('0x5')]][_0x4f07d8]=_0x200527;}}}catch(_0x34c0a6){utils['error'](util['format'](_0x46c9('0x2f'),_0x18eaa8['uniqueid']),_0x34c0a6);}};exports[_0x46c9('0x38')]=function(_0x2e12e8){try{if(!_[_0x46c9('0x14')](recordings[_0x2e12e8[_0x46c9('0x5')]])){utils[_0x46c9('0xc')](util[_0x46c9('0x3')](_0x46c9('0x39'),_0x2e12e8[_0x46c9('0x5')]),_0x2e12e8);utils[_0x46c9('0x2')](util[_0x46c9('0x3')](_0x46c9('0x3a'),_0x2e12e8[_0x46c9('0x5')],_0x2e12e8[_0x46c9('0x3b')]));recordings[_0x2e12e8[_0x46c9('0x5')]][_0x46c9('0x3b')]=_0x2e12e8[_0x46c9('0x3b')];}}catch(_0x5675d8){utils[_0x46c9('0x11')](util['format']('[%s][recordings][queuecallerjoin]',_0x2e12e8[_0x46c9('0x5')]),_0x5675d8);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index ebd306d..74d7b1e 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 _0xce09=['secondtransfererexten','origtransfererlinkedid','origtransfererexten','attended','isNil','transfereechannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','error','lodash','util','info','format','[%s][transfers][writeDB]\x20type:%s','type','origtransfereruniqueid','request','blinds','blindtransfer','[%s][transfers][blindtransfer]','uniqueid','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','blind','transfereruniqueid','attendedtransfer','debug','[%s][transfers][attendedtransfer]','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext'];(function(_0x1f2d8e,_0x31408e){var _0x325ea5=function(_0x146f15){while(--_0x146f15){_0x1f2d8e['push'](_0x1f2d8e['shift']());}};_0x325ea5(++_0x31408e);}(_0xce09,0x187));var _0x9ce0=function(_0x49d82a,_0x37a629){_0x49d82a=_0x49d82a-0x0;var _0x52a3bc=_0xce09[_0x49d82a];return _0x52a3bc;};'use strict';var _=require(_0x9ce0('0x0'));var util=require(_0x9ce0('0x1'));var utils=require('./utils');function writeDB(_0x55dc06){utils[_0x9ce0('0x2')](util[_0x9ce0('0x3')](_0x9ce0('0x4'),_0x55dc06[_0x9ce0('0x5')]==='attended'?_0x55dc06[_0x9ce0('0x6')]:_0x55dc06['uniqueid'],_0x55dc06[_0x9ce0('0x5')]));utils[_0x9ce0('0x7')]('CreateVoiceTransferReport',_0x55dc06);}exports[_0x9ce0('0x8')]={};exports[_0x9ce0('0x9')]=function(_0x2f6eaf){try{utils['debug'](util[_0x9ce0('0x3')](_0x9ce0('0xa'),_0x2f6eaf[_0x9ce0('0xb')]),_0x2f6eaf);utils[_0x9ce0('0x2')](util['format'](_0x9ce0('0xc'),_0x2f6eaf[_0x9ce0('0xb')],_0x2f6eaf[_0x9ce0('0xd')],_0x2f6eaf[_0x9ce0('0xe')],_0x2f6eaf[_0x9ce0('0xf')],_0x2f6eaf['transfereecalleridname']));_0x2f6eaf[_0x9ce0('0x5')]=_0x9ce0('0x10');exports['blinds'][_0x2f6eaf[_0x9ce0('0x11')]]=_0x2f6eaf;writeDB(_0x2f6eaf);}catch(_0x513883){utils['error'](util[_0x9ce0('0x3')](_0x9ce0('0xa'),_0x2f6eaf[_0x9ce0('0xb')]),_0x513883);}};exports[_0x9ce0('0x12')]=function(_0x37e8fb){try{utils[_0x9ce0('0x13')](util['format'](_0x9ce0('0x14'),_0x37e8fb[_0x9ce0('0x6')]),_0x37e8fb);utils[_0x9ce0('0x2')](util['format']('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x37e8fb[_0x9ce0('0x6')],_0x37e8fb['origtransferercalleridnum'],_0x37e8fb[_0x9ce0('0x15')],_0x37e8fb[_0x9ce0('0x16')],_0x37e8fb[_0x9ce0('0x17')]));_0x37e8fb=_[_0x9ce0('0x18')](_0x37e8fb,{'transfererchannel':_0x37e8fb[_0x9ce0('0x19')],'transferercalleridnum':_0x37e8fb['origtransferercalleridnum'],'transferercalleridname':_0x37e8fb['origtransferercalleridname'],'transfererconnectedlinenum':_0x37e8fb['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x37e8fb[_0x9ce0('0x1a')],'transfereraccountcode':_0x37e8fb[_0x9ce0('0x1b')],'transferercontext':_0x37e8fb[_0x9ce0('0x1c')],'transfererexten':_0x37e8fb[_0x9ce0('0x1d')],'transfererlinkedid':_0x37e8fb[_0x9ce0('0x1e')],'context':_0x37e8fb['origtransferercontext'],'extension':_0x37e8fb[_0x9ce0('0x1f')],'type':_0x9ce0('0x20')});if(_[_0x9ce0('0x21')](_0x37e8fb[_0x9ce0('0x22')])){_0x37e8fb=_[_0x9ce0('0x18')](_0x37e8fb,{'transfereechannel':_0x37e8fb['transfertargetchannel'],'transfereecalleridnum':_0x37e8fb['transfertargetcalleridnum'],'transfereecalleridname':_0x37e8fb['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x37e8fb[_0x9ce0('0x23')],'transfereeconnectedlinename':_0x37e8fb[_0x9ce0('0x24')],'transfereeaccountcode':_0x37e8fb[_0x9ce0('0x25')],'transfereecontext':_0x37e8fb[_0x9ce0('0x26')],'transfereeexten':_0x37e8fb[_0x9ce0('0x27')],'transfereelinkedid':_0x37e8fb[_0x9ce0('0x28')]});}writeDB(_0x37e8fb);}catch(_0x20b954){utils[_0x9ce0('0x29')](util[_0x9ce0('0x3')]('[%s][transfers][attendedtransfer]',_0x37e8fb[_0x9ce0('0x6')]),_0x20b954);}}; \ No newline at end of file +var _0xc662=['transfertargetcalleridnum','transfertargetcalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','origtransfererexten','transfereechannel','assign','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid','lodash','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','attended','uniqueid','request','CreateVoiceTransferReport','blindtransfer','debug','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridname','transfereecalleridnum','transfereecalleridname','type','blind','error','[%s][transfers][blindtransfer]','attendedtransfer','[%s][transfers][attendedtransfer]','origtransfereruniqueid','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname'];(function(_0x166742,_0x55520c){var _0xb7814a=function(_0x18feaf){while(--_0x18feaf){_0x166742['push'](_0x166742['shift']());}};_0xb7814a(++_0x55520c);}(_0xc662,0x106));var _0x2c66=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xc662[_0x40ac5e];return _0x2839d6;};'use strict';var _=require(_0x2c66('0x0'));var util=require('util');var utils=require(_0x2c66('0x1'));function writeDB(_0x464271){utils[_0x2c66('0x2')](util[_0x2c66('0x3')](_0x2c66('0x4'),_0x464271['type']===_0x2c66('0x5')?_0x464271['origtransfereruniqueid']:_0x464271[_0x2c66('0x6')],_0x464271['type']));utils[_0x2c66('0x7')](_0x2c66('0x8'),_0x464271);}exports[_0x2c66('0x9')]=function(_0x126ae8){try{utils[_0x2c66('0xa')](util[_0x2c66('0x3')]('[%s][transfers][blindtransfer]',_0x126ae8[_0x2c66('0x6')]),_0x126ae8);utils['info'](util[_0x2c66('0x3')](_0x2c66('0xb'),_0x126ae8[_0x2c66('0x6')],_0x126ae8['transferercalleridnum'],_0x126ae8[_0x2c66('0xc')],_0x126ae8[_0x2c66('0xd')],_0x126ae8[_0x2c66('0xe')]));_0x126ae8[_0x2c66('0xf')]=_0x2c66('0x10');writeDB(_0x126ae8);}catch(_0x5e05d8){utils[_0x2c66('0x11')](util['format'](_0x2c66('0x12'),_0x126ae8[_0x2c66('0x6')]),_0x5e05d8);}};exports[_0x2c66('0x13')]=function(_0x62cb3e){try{utils[_0x2c66('0xa')](util['format'](_0x2c66('0x14'),_0x62cb3e[_0x2c66('0x15')]),_0x62cb3e);utils[_0x2c66('0x2')](util['format'](_0x2c66('0x16'),_0x62cb3e['origtransfereruniqueid'],_0x62cb3e[_0x2c66('0x17')],_0x62cb3e[_0x2c66('0x18')],_0x62cb3e[_0x2c66('0x19')],_0x62cb3e[_0x2c66('0x1a')]));_0x62cb3e=_['assign'](_0x62cb3e,{'transfererchannel':_0x62cb3e['origtransfererchannel'],'transferercalleridnum':_0x62cb3e[_0x2c66('0x17')],'transferercalleridname':_0x62cb3e[_0x2c66('0x18')],'transfererconnectedlinenum':_0x62cb3e[_0x2c66('0x1b')],'transfererconnectedlinename':_0x62cb3e[_0x2c66('0x1c')],'transfereraccountcode':_0x62cb3e[_0x2c66('0x1d')],'transferercontext':_0x62cb3e['secondtransferercontext'],'transfererexten':_0x62cb3e[_0x2c66('0x1e')],'transfererlinkedid':_0x62cb3e[_0x2c66('0x1f')],'context':_0x62cb3e['origtransferercontext'],'extension':_0x62cb3e[_0x2c66('0x20')],'type':_0x2c66('0x5')});if(_['isNil'](_0x62cb3e[_0x2c66('0x21')])){_0x62cb3e=_[_0x2c66('0x22')](_0x62cb3e,{'transfereechannel':_0x62cb3e[_0x2c66('0x23')],'transfereecalleridnum':_0x62cb3e[_0x2c66('0x19')],'transfereecalleridname':_0x62cb3e['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x62cb3e[_0x2c66('0x24')],'transfereeconnectedlinename':_0x62cb3e[_0x2c66('0x25')],'transfereeaccountcode':_0x62cb3e[_0x2c66('0x26')],'transfereecontext':_0x62cb3e['transfertargetcontext'],'transfereeexten':_0x62cb3e[_0x2c66('0x27')],'transfereelinkedid':_0x62cb3e[_0x2c66('0x28')]});}writeDB(_0x62cb3e);}catch(_0x35a348){utils['error'](util[_0x2c66('0x3')](_0x2c66('0x14'),_0x62cb3e[_0x2c66('0x15')]),_0x35a348);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 79b9e62..ded1ee7 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 _0x686c=['internal','name','interface','[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','found','notfound','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type','acw','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtract','diffTime','diff','sumTime','now','isAfter','isBefore','bluebird','moment','util','../../config/logger','info','inspect','debug','error','request','then','catch','GetUser'];(function(_0x286004,_0x1aea3e){var _0x4b745a=function(_0x5ada3d){while(--_0x5ada3d){_0x286004['push'](_0x286004['shift']());}};_0x4b745a(++_0x1aea3e);}(_0x686c,0x1de));var _0xc686=function(_0x4a0c88,_0x1443f1){_0x4a0c88=_0x4a0c88-0x0;var _0xe10074=_0x686c[_0x4a0c88];return _0xe10074;};'use strict';var BPromise=require(_0xc686('0x0'));var jayson=require('jayson/promise');var moment=require(_0xc686('0x1'));var util=require(_0xc686('0x2'));var client=jayson['client']['http']({'port':0x2329});var logger=require(_0xc686('0x3'))('xdr');exports['info']=function(_0x58d145,_0x85f306){logger[_0xc686('0x4')](_0x58d145,_0x85f306?util[_0xc686('0x5')](_0x85f306,{'showHidden':![],'depth':null}):'');};exports[_0xc686('0x6')]=function(_0x16dcac,_0x3ec3fc){logger[_0xc686('0x6')](_0x16dcac,_0x3ec3fc?util[_0xc686('0x5')](_0x3ec3fc,{'showHidden':![],'depth':null}):'');};exports[_0xc686('0x7')]=function(_0x1b9f2a,_0x4f641c){logger[_0xc686('0x7')](_0x1b9f2a,_0x4f641c?util[_0xc686('0x5')](_0x4f641c,{'showHidden':![],'depth':null}):'');};exports[_0xc686('0x8')]=function(_0x173a98,_0x537775){return client[_0xc686('0x8')](_0x173a98,{'body':_0x537775})[_0xc686('0x9')](function(_0x34250c){logger[_0xc686('0x6')]('[utils][request]\x20name:%s',_0x173a98,_0x34250c?util[_0xc686('0x5')](_0x34250c,{'showHidden':![],'depth':null}):'');})[_0xc686('0xa')](function(_0x4a6520){logger[_0xc686('0x7')]('[utils][request]\x20name:%s',_0x173a98,_0x4a6520?util[_0xc686('0x5')](_0x4a6520,{'showHidden':![],'depth':null}):'');});};function getUser(_0x9bb13d){return client[_0xc686('0x8')](_0xc686('0xb'),{'options':{'raw':!![],'attributes':['id',_0xc686('0xc'),_0xc686('0xd'),_0xc686('0xe')],'where':_0x9bb13d,'limit':0x1}})[_0xc686('0x9')](function(_0x57ac33){logger[_0xc686('0x6')](_0xc686('0xf'),JSON[_0xc686('0x10')](_0x9bb13d),_0x57ac33?util[_0xc686('0x5')](_0x57ac33,{'showHidden':![],'depth':null}):'');return _0x57ac33[_0xc686('0x11')][_0xc686('0x12')]?_0x57ac33['result'][0x0]:null;});}exports[_0xc686('0x13')]=function(_0x59b20b){return new BPromise(function(_0x5ce36a,_0x3129a1){if(_0x59b20b){return getUser({'internal':_0x59b20b})['then'](function(_0x5e11e9){logger[_0xc686('0x4')](_0xc686('0x14'),_0x59b20b,_0x5e11e9?'found':'notfound');return _0x5ce36a(_0x5e11e9);})[_0xc686('0xa')](function(_0x4c8b33){logger[_0xc686('0x7')](_0xc686('0x15'),_0x4c8b33?util[_0xc686('0x5')](_0x4c8b33,{'showHidden':![],'depth':null}):'');return _0x5ce36a(null);});}return _0x5ce36a(null);});};exports[_0xc686('0x16')]=function(_0x438049){return new BPromise(function(_0x2252bd,_0x3c504e){if(_0x438049){return getUser({'interface':_0x438049})[_0xc686('0x9')](function(_0x1e590a){logger[_0xc686('0x4')](_0xc686('0x17'),_0x438049,_0x1e590a?_0xc686('0x18'):_0xc686('0x19'));return _0x2252bd(_0x1e590a);})[_0xc686('0xa')](function(_0x3145e1){logger[_0xc686('0x7')](_0xc686('0x1a'),_0x3145e1?util[_0xc686('0x5')](_0x3145e1,{'showHidden':![],'depth':null}):'');return _0x2252bd(null);});}return _0x2252bd(null);});};exports[_0xc686('0x1b')]=function(_0x2cf9c4){return new BPromise(function(_0x26bc9d,_0x298d09){if(_0x2cf9c4){return getUser({'name':_0x2cf9c4})[_0xc686('0x9')](function(_0x1d1482){logger['info'](_0xc686('0x1c'),_0x2cf9c4,_0x1d1482?_0xc686('0x18'):_0xc686('0x19'));return _0x26bc9d(_0x1d1482);})[_0xc686('0xa')](function(_0xa4d866){logger[_0xc686('0x7')](_0xc686('0x1d'),_0xa4d866?util['inspect'](_0xa4d866,{'showHidden':![],'depth':null}):'');return _0x26bc9d(null);});}return _0x26bc9d(null);});};exports[_0xc686('0x1e')]=function(_0x5aa9b2){return new BPromise(function(_0x40ed63,_0x59cc8e){if(_0x5aa9b2){return client[_0xc686('0x8')](_0xc686('0x1f'),{'options':{'raw':!![],'attributes':['id','name',_0xc686('0x20'),_0xc686('0x21'),'acwTimeout'],'where':{'name':_0x5aa9b2},'limit':0x1}})['then'](function(_0x30e5c9){logger[_0xc686('0x6')](_0xc686('0x22'),_0x5aa9b2,_0x30e5c9?util[_0xc686('0x5')](_0x30e5c9,{'showHidden':![],'depth':null}):'');logger['info'](_0xc686('0x23'),_0x5aa9b2,_0x30e5c9?_0xc686('0x18'):_0xc686('0x19'));return _0x40ed63(_0x30e5c9[_0xc686('0x11')][_0xc686('0x12')]?_0x30e5c9[_0xc686('0x11')][0x0]:null);})[_0xc686('0xa')](function(_0x18d72d){logger[_0xc686('0x7')](_0xc686('0x24'),_0x18d72d?util[_0xc686('0x5')](_0x18d72d,{'showHidden':![],'depth':null}):'');return _0x40ed63(null);});}return _0x40ed63(null);});};exports[_0xc686('0x25')]=function(_0x50419b,_0x54624b){return moment(_0x50419b)[_0xc686('0x26')](_0x54624b,_0xc686('0x27'))[_0xc686('0x28')](_0xc686('0x29'));};exports['subtractTime']=function(_0x568b46,_0x19400c){return moment(_0x568b46)[_0xc686('0x2a')](_0x19400c,_0xc686('0x27'))[_0xc686('0x28')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xc686('0x2b')]=function(_0x5e10ed,_0x3b142c){return moment(_0x5e10ed)[_0xc686('0x2c')](moment(_0x3b142c),_0xc686('0x27'));};exports[_0xc686('0x2d')]=function(_0x10b620,_0x19e7bf){return parseInt(_0x10b620,0xa)+parseInt(_0x19e7bf,0xa);};exports[_0xc686('0x2e')]=function(){return moment()[_0xc686('0x28')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xc686('0x2f')]=function(_0x1cc277,_0x1c91b3){if(_0x1c91b3){return moment(_0x1cc277)['isAfter'](_0x1c91b3);}return!![];};exports[_0xc686('0x30')]=function(_0x3a876c,_0x4632b5){if(_0x4632b5){return moment(_0x3a876c)[_0xc686('0x30')](_0x4632b5);}else if(_0x3a876c){return!![];}return![];}; \ No newline at end of file +var _0x80f1=['length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','[utils][getUserByInternal]','getUserByInterface','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','notfound','[utils][getUserByName]','getVoiceQueueByName','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s\x20%s','addTime','add','seconds','format','subtractTime','YYYY-MM-DD\x20HH:mm:ss','diff','now','isAfter','isBefore','bluebird','util','client','http','../../config/logger','xdr','info','inspect','request','[utils][request]\x20name:%s','catch','error','GetUser','internal','name','interface','then','[utils][getUser]\x20where:%s','result'];(function(_0x2160a9,_0x3cbd9e){var _0xa88cf7=function(_0x51ab6f){while(--_0x51ab6f){_0x2160a9['push'](_0x2160a9['shift']());}};_0xa88cf7(++_0x3cbd9e);}(_0x80f1,0x71));var _0x180f=function(_0xd3f178,_0x539870){_0xd3f178=_0xd3f178-0x0;var _0x352c47=_0x80f1[_0xd3f178];return _0x352c47;};'use strict';var BPromise=require(_0x180f('0x0'));var jayson=require('jayson/promise');var moment=require('moment');var util=require(_0x180f('0x1'));var client=jayson[_0x180f('0x2')][_0x180f('0x3')]({'port':0x2329});var logger=require(_0x180f('0x4'))(_0x180f('0x5'));exports[_0x180f('0x6')]=function(_0x41168b,_0x58893a){logger[_0x180f('0x6')](_0x41168b,_0x58893a?util[_0x180f('0x7')](_0x58893a,{'showHidden':![],'depth':null}):'');};exports['debug']=function(_0x3f92c2,_0x4b7266){logger['debug'](_0x3f92c2,_0x4b7266?util[_0x180f('0x7')](_0x4b7266,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0x4c3a0f,_0x9a4440){logger['error'](_0x4c3a0f,_0x9a4440?util[_0x180f('0x7')](_0x9a4440,{'showHidden':![],'depth':null}):'');};exports[_0x180f('0x8')]=function(_0x23da9a,_0x12ce87){return client[_0x180f('0x8')](_0x23da9a,{'body':_0x12ce87})['then'](function(_0x2f3d3a){logger['debug'](_0x180f('0x9'),_0x23da9a,_0x2f3d3a?util['inspect'](_0x2f3d3a,{'showHidden':![],'depth':null}):'');})[_0x180f('0xa')](function(_0x228b0a){logger[_0x180f('0xb')]('[utils][request]\x20name:%s',_0x23da9a,_0x228b0a?util[_0x180f('0x7')](_0x228b0a,{'showHidden':![],'depth':null}):'');});};function getUser(_0x3f64d4){return client[_0x180f('0x8')](_0x180f('0xc'),{'options':{'raw':!![],'attributes':['id',_0x180f('0xd'),_0x180f('0xe'),_0x180f('0xf')],'where':_0x3f64d4,'limit':0x1}})[_0x180f('0x10')](function(_0x2f2197){logger['debug'](_0x180f('0x11'),JSON['stringify'](_0x3f64d4),_0x2f2197?util[_0x180f('0x7')](_0x2f2197,{'showHidden':![],'depth':null}):'');return _0x2f2197[_0x180f('0x12')][_0x180f('0x13')]?_0x2f2197['result'][0x0]:null;});}exports[_0x180f('0x14')]=function(_0x1b1c6c){return new BPromise(function(_0x177390,_0x2472d3){if(_0x1b1c6c){return getUser({'internal':_0x1b1c6c})[_0x180f('0x10')](function(_0x5a806e){logger[_0x180f('0x6')](_0x180f('0x15'),_0x1b1c6c,_0x5a806e?_0x180f('0x16'):'notfound');return _0x177390(_0x5a806e);})['catch'](function(_0x42b966){logger[_0x180f('0xb')](_0x180f('0x17'),_0x42b966?util[_0x180f('0x7')](_0x42b966,{'showHidden':![],'depth':null}):'');return _0x177390(null);});}return _0x177390(null);});};exports[_0x180f('0x18')]=function(_0x45e023){return new BPromise(function(_0x1a18e5,_0x32dca7){if(_0x45e023){return getUser({'interface':_0x45e023})[_0x180f('0x10')](function(_0x111a99){logger[_0x180f('0x6')]('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x45e023,_0x111a99?_0x180f('0x16'):'notfound');return _0x1a18e5(_0x111a99);})[_0x180f('0xa')](function(_0x8c8a88){logger['error']('[utils][getUserByInterface]',_0x8c8a88?util[_0x180f('0x7')](_0x8c8a88,{'showHidden':![],'depth':null}):'');return _0x1a18e5(null);});}return _0x1a18e5(null);});};exports[_0x180f('0x19')]=function(_0x2e1b71){return new BPromise(function(_0x219576,_0x599c79){if(_0x2e1b71){return getUser({'name':_0x2e1b71})[_0x180f('0x10')](function(_0x48fbf9){logger['info'](_0x180f('0x1a'),_0x2e1b71,_0x48fbf9?_0x180f('0x16'):_0x180f('0x1b'));return _0x219576(_0x48fbf9);})[_0x180f('0xa')](function(_0x28a5f9){logger[_0x180f('0xb')](_0x180f('0x1c'),_0x28a5f9?util['inspect'](_0x28a5f9,{'showHidden':![],'depth':null}):'');return _0x219576(null);});}return _0x219576(null);});};exports[_0x180f('0x1d')]=function(_0x57e918){return new BPromise(function(_0x27b66d,_0x1e746f){if(_0x57e918){return client[_0x180f('0x8')]('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id',_0x180f('0xe'),_0x180f('0x1e'),_0x180f('0x1f'),_0x180f('0x20')],'where':{'name':_0x57e918},'limit':0x1}})[_0x180f('0x10')](function(_0x2cd0f){logger['debug']('[utils][getVoiceQueueByName]\x20name:%s',_0x57e918,_0x2cd0f?util[_0x180f('0x7')](_0x2cd0f,{'showHidden':![],'depth':null}):'');logger[_0x180f('0x6')](_0x180f('0x21'),_0x57e918,_0x2cd0f?'found':_0x180f('0x1b'));return _0x27b66d(_0x2cd0f[_0x180f('0x12')]['length']?_0x2cd0f[_0x180f('0x12')][0x0]:null);})[_0x180f('0xa')](function(_0x478b9b){logger[_0x180f('0xb')]('[utils][getVoiceQueueByName]',_0x478b9b?util[_0x180f('0x7')](_0x478b9b,{'showHidden':![],'depth':null}):'');return _0x27b66d(null);});}return _0x27b66d(null);});};exports[_0x180f('0x22')]=function(_0xe649f2,_0x217230){return moment(_0xe649f2)[_0x180f('0x23')](_0x217230,_0x180f('0x24'))[_0x180f('0x25')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x180f('0x26')]=function(_0x5a9134,_0x3575b9){return moment(_0x5a9134)['subtract'](_0x3575b9,_0x180f('0x24'))['format'](_0x180f('0x27'));};exports['diffTime']=function(_0x4d2752,_0xfc5dd){return moment(_0x4d2752)[_0x180f('0x28')](moment(_0xfc5dd),'seconds');};exports['sumTime']=function(_0x52eea0,_0x267936){return parseInt(_0x52eea0,0xa)+parseInt(_0x267936,0xa);};exports[_0x180f('0x29')]=function(){return moment()[_0x180f('0x25')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x180f('0x2a')]=function(_0x53ad30,_0x3dbf45){if(_0x3dbf45){return moment(_0x53ad30)[_0x180f('0x2a')](_0x3dbf45);}return!![];};exports[_0x180f('0x2b')]=function(_0xb4c90,_0x1b75ee){if(_0x1b75ee){return moment(_0xb4c90)[_0x180f('0x2b')](_0x1b75ee);}else if(_0xb4c90){return!![];}return![];}; \ No newline at end of file diff --git a/server/utils/client-side-logger.js b/server/utils/client-side-logger.js index c896139..3dc4e09 100644 --- a/server/utils/client-side-logger.js +++ b/server/utils/client-side-logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9186=['url','statusCode','responseTime','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','name','other','agent_name','test','setupLoggers','lodash','express-winston','path','util','fileLogger','safeTemplate','./mask-sensitive-data','maskSensitiveData','join','/var','log','xcally','role','ensureDir','then','client','catch','user','no-user','data','timestamp','api','auth','set','client-side-logger','use','logger','isEmpty','\x20body=%s','body','format','method','headers','x-forwarded-for','connection','remoteAddress'];(function(_0x4c83ca,_0x5d7909){var _0x388977=function(_0x367a71){while(--_0x367a71){_0x4c83ca['push'](_0x4c83ca['shift']());}};_0x388977(++_0x5d7909);}(_0x9186,0x102));var _0x6918=function(_0x237da8,_0x37b77a){_0x237da8=_0x237da8-0x0;var _0x558825=_0x9186[_0x237da8];return _0x558825;};var fs=require('fs-extra');var _=require(_0x6918('0x0'));var ewinston=require(_0x6918('0x1'));var path=require(_0x6918('0x2'));var util=require(_0x6918('0x3'));var fileLogger=require('./loggers')[_0x6918('0x4')];var safeTemplate=require('./safe-template')[_0x6918('0x5')];var maskSensitiveData=require(_0x6918('0x6'))[_0x6918('0x7')];function ClientSideLogger(){function _0x20d0f7(_0x25c115){var _0x33fbcb=path[_0x6918('0x8')](_0x6918('0x9'),_0x6918('0xa'),_0x6918('0xb'));var _0x519ffa=path['join']('client',_0x25c115[_0x6918('0xc')]+'-'+_0x25c115['name']);return fs[_0x6918('0xd')](path[_0x6918('0x8')](_0x33fbcb,_0x519ffa))[_0x6918('0xe')](function(){var _0x249099=fileLogger(_0x6918('0xf'),path[_0x6918('0x8')](_0x33fbcb,_0x519ffa));return _0x249099;})[_0x6918('0x10')](function(_0x2b4462){throw _0x2b4462;});}this[_0x6918('0xa')]=function(_0x52af5d,_0x460302,_0x47a5f3,_0x2d80d9){return _0x20d0f7(_0x52af5d['user'])[_0x6918('0xe')](function(_0x5a7eb5){var _0x4b566e=_0x5a7eb5[_0x460302];return _0x4b566e;})[_0x6918('0xe')](function(_0x15d24d){var _0x1ed8a2=_0x52af5d[_0x6918('0x11')]?_0x52af5d[_0x6918('0x11')]['id']:_0x6918('0x12');var _0x41aaeb=_0x2d80d9[_0x6918('0x13')];var _0x53f6a0=_0x2d80d9[_0x6918('0x14')];var _0x78038b=new Date(Number(_0x53f6a0));return _0x15d24d(_0x1ed8a2,_0x78038b,_0x47a5f3,_0x41aaeb);})['catch'](function(_0x4670e0){fileLogger(_0x6918('0xf'))['error'](_0x4670e0);});};}function setupLoggers(_0x276882){return new Promise(function(_0x390e00){var _0x333ab5=new ClientSideLogger();var _0x28892f=fileLogger(_0x6918('0x15'));var _0x50282a=fileLogger(_0x6918('0x16'));_0x276882[_0x6918('0x17')](_0x6918('0x18'),_0x333ab5);_0x276882[_0x6918('0x19')](ewinston[_0x6918('0x1a')]({'winstonInstance':_0x28892f,'meta':![],'statusLevels':!![],'msg':function(_0x1bc261,_0x95d715){var _0x3e2775='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_[_0x6918('0x1b')](_0x1bc261['body'])){_0x3e2775+=_0x6918('0x1c');var _0x3ae3d5=_0x1bc261[_0x6918('0x1d')];maskSensitiveData(_0x3ae3d5);}return safeTemplate(util[_0x6918('0x1e')](_0x3e2775,_0x1bc261[_0x6918('0x1f')],_0x1bc261[_0x6918('0x20')][_0x6918('0x21')]?_0x1bc261[_0x6918('0x20')]['x-forwarded-for']:_0x1bc261[_0x6918('0x22')][_0x6918('0x23')]||_0x1bc261['ip'],_0x1bc261[_0x6918('0x24')],_0x95d715[_0x6918('0x25')],_0x95d715[_0x6918('0x26')],_0x1bc261['user']?_0x1bc261[_0x6918('0x11')]['id']:null,_0x1bc261[_0x6918('0x11')]?_0x1bc261[_0x6918('0x11')]['name']:null,_0x1bc261[_0x6918('0x11')]?_0x1bc261[_0x6918('0x11')]['role']:null,_0x3ae3d5?util[_0x6918('0x27')](_0x3ae3d5,![],null):''));}}));_0x276882['use'](ewinston['logger']({'winstonInstance':_0x50282a,'meta':![],'statusLevels':!![],'msg':function(_0x4e7a06,_0x236ebf){var _0x72c37d=_0x6918('0x28');if(_0x4e7a06[_0x6918('0x1d')]&&_0x4e7a06['body'][_0x6918('0x29')]&&_0x4e7a06[_0x6918('0x1d')][_0x6918('0x2a')]){_0x72c37d=_0x6918('0x2b');}return util[_0x6918('0x1e')](_0x72c37d,_0x4e7a06['method'],_0x4e7a06['headers'][_0x6918('0x21')]?_0x4e7a06[_0x6918('0x20')][_0x6918('0x21')]:_0x4e7a06[_0x6918('0x22')][_0x6918('0x23')]||_0x4e7a06['ip'],_0x4e7a06['url'],_0x236ebf['statusCode'],_0x236ebf[_0x6918('0x26')],_0x4e7a06[_0x6918('0x11')]?_0x4e7a06[_0x6918('0x11')]['id']:null,_0x4e7a06[_0x6918('0x11')]?_0x4e7a06['user'][_0x6918('0x2c')]:null,_0x4e7a06[_0x6918('0x11')]?_0x4e7a06[_0x6918('0x11')][_0x6918('0xc')]:null,_0x4e7a06['body']&&_0x4e7a06[_0x6918('0x1d')][_0x6918('0x29')]?_0x4e7a06[_0x6918('0x1d')][_0x6918('0x29')]:_0x6918('0x2d'),_0x4e7a06[_0x6918('0x1d')]&&_0x4e7a06['body'][_0x6918('0x2a')]?_0x4e7a06['body'][_0x6918('0x2a')]:'',_0x4e7a06[_0x6918('0x1d')]&&_0x4e7a06[_0x6918('0x1d')][_0x6918('0x2e')]?_0x4e7a06[_0x6918('0x1d')][_0x6918('0x2e')]:'');},'ignoreRoute':function(_0x9a6379){var _0x8afe16=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x8afe16[_0x6918('0x2f')](_0x9a6379[_0x6918('0x24')]);}}));return _0x390e00();});}exports[_0x6918('0x30')]=setupLoggers; \ No newline at end of file +var _0x41a2=['body','\x20body=%s','format','headers','x-forwarded-for','remoteAddress','statusCode','responseTime','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','method','connection','agent_name','test','setupLoggers','lodash','express-winston','path','util','./loggers','fileLogger','./safe-template','safeTemplate','./mask-sensitive-data','join','client','role','name','catch','log','user','then','no-user','client-side-logger','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s'];(function(_0x2179f1,_0x21c653){var _0x176ec9=function(_0x4c4a4c){while(--_0x4c4a4c){_0x2179f1['push'](_0x2179f1['shift']());}};_0x176ec9(++_0x21c653);}(_0x41a2,0x1b2));var _0x241a=function(_0x2f485e,_0x1ce4ff){_0x2f485e=_0x2f485e-0x0;var _0x1ca654=_0x41a2[_0x2f485e];return _0x1ca654;};var fs=require('fs-extra');var _=require(_0x241a('0x0'));var ewinston=require(_0x241a('0x1'));var path=require(_0x241a('0x2'));var util=require(_0x241a('0x3'));var fileLogger=require(_0x241a('0x4'))[_0x241a('0x5')];var safeTemplate=require(_0x241a('0x6'))[_0x241a('0x7')];var maskSensitiveData=require(_0x241a('0x8'))['maskSensitiveData'];function ClientSideLogger(){function _0x12bad9(_0x2beb84){var _0x48cef2=path[_0x241a('0x9')]('/var','log','xcally');var _0x24e159=path[_0x241a('0x9')](_0x241a('0xa'),_0x2beb84[_0x241a('0xb')]+'-'+_0x2beb84[_0x241a('0xc')]);return fs['ensureDir'](path[_0x241a('0x9')](_0x48cef2,_0x24e159))['then'](function(){var _0x599fe6=fileLogger(_0x241a('0xa'),path[_0x241a('0x9')](_0x48cef2,_0x24e159));return _0x599fe6;})[_0x241a('0xd')](function(_0x33478d){throw _0x33478d;});}this[_0x241a('0xe')]=function(_0x17acf0,_0x2fe997,_0x30d3c2,_0x8007){return _0x12bad9(_0x17acf0[_0x241a('0xf')])['then'](function(_0x4b8ea0){var _0x1868fa=_0x4b8ea0[_0x2fe997];return _0x1868fa;})[_0x241a('0x10')](function(_0x211658){var _0x3bcade=_0x17acf0[_0x241a('0xf')]?_0x17acf0[_0x241a('0xf')]['id']:_0x241a('0x11');var _0x5a15b0=_0x8007['data'];var _0x1cbbba=_0x8007['timestamp'];var _0x4fa348=new Date(Number(_0x1cbbba));return _0x211658(_0x3bcade,_0x4fa348,_0x30d3c2,_0x5a15b0);})[_0x241a('0xd')](function(_0x44d132){fileLogger('client')['error'](_0x44d132);});};}function setupLoggers(_0x3f6b2a){return new Promise(function(_0x12aa92){var _0x56325e=new ClientSideLogger();var _0x30e931=fileLogger('api');var _0x56a56b=fileLogger('auth');_0x3f6b2a['set'](_0x241a('0x12'),_0x56325e);_0x3f6b2a[_0x241a('0x13')](ewinston[_0x241a('0x14')]({'winstonInstance':_0x30e931,'meta':![],'statusLevels':!![],'msg':function(_0x32901b,_0x7d459a){var _0x34633f=_0x241a('0x15');if(!_['isEmpty'](_0x32901b[_0x241a('0x16')])){_0x34633f+=_0x241a('0x17');var _0x52653d=_0x32901b['body'];maskSensitiveData(_0x52653d);}return safeTemplate(util[_0x241a('0x18')](_0x34633f,_0x32901b['method'],_0x32901b[_0x241a('0x19')][_0x241a('0x1a')]?_0x32901b[_0x241a('0x19')][_0x241a('0x1a')]:_0x32901b['connection'][_0x241a('0x1b')]||_0x32901b['ip'],_0x32901b['url'],_0x7d459a[_0x241a('0x1c')],_0x7d459a[_0x241a('0x1d')],_0x32901b[_0x241a('0xf')]?_0x32901b[_0x241a('0xf')]['id']:null,_0x32901b[_0x241a('0xf')]?_0x32901b[_0x241a('0xf')][_0x241a('0xc')]:null,_0x32901b[_0x241a('0xf')]?_0x32901b[_0x241a('0xf')][_0x241a('0xb')]:null,_0x52653d?util['inspect'](_0x52653d,![],null):''));}}));_0x3f6b2a[_0x241a('0x13')](ewinston[_0x241a('0x14')]({'winstonInstance':_0x56a56b,'meta':![],'statusLevels':!![],'msg':function(_0x387696,_0xd00f07){var _0x4bfc27='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x387696[_0x241a('0x16')]&&_0x387696[_0x241a('0x16')][_0x241a('0x1e')]&&_0x387696[_0x241a('0x16')][_0x241a('0x1f')]){_0x4bfc27=_0x241a('0x20');}return util[_0x241a('0x18')](_0x4bfc27,_0x387696[_0x241a('0x21')],_0x387696[_0x241a('0x19')][_0x241a('0x1a')]?_0x387696['headers']['x-forwarded-for']:_0x387696[_0x241a('0x22')][_0x241a('0x1b')]||_0x387696['ip'],_0x387696['url'],_0xd00f07['statusCode'],_0xd00f07[_0x241a('0x1d')],_0x387696[_0x241a('0xf')]?_0x387696[_0x241a('0xf')]['id']:null,_0x387696[_0x241a('0xf')]?_0x387696[_0x241a('0xf')][_0x241a('0xc')]:null,_0x387696[_0x241a('0xf')]?_0x387696['user'][_0x241a('0xb')]:null,_0x387696[_0x241a('0x16')]&&_0x387696[_0x241a('0x16')][_0x241a('0x1e')]?_0x387696[_0x241a('0x16')][_0x241a('0x1e')]:'other',_0x387696['body']&&_0x387696[_0x241a('0x16')]['agent_id']?_0x387696[_0x241a('0x16')][_0x241a('0x1f')]:'',_0x387696['body']&&_0x387696[_0x241a('0x16')][_0x241a('0x23')]?_0x387696[_0x241a('0x16')][_0x241a('0x23')]:'');},'ignoreRoute':function(_0x5c2b5e){var _0x56f01b=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x56f01b[_0x241a('0x24')](_0x5c2b5e['url']);}}));return _0x12aa92();});}exports[_0x241a('0x25')]=setupLoggers; \ No newline at end of file diff --git a/server/utils/iftime.js b/server/utils/iftime.js index bb0b14c..9eeb243 100644 --- a/server/utils/iftime.js +++ b/server/utils/iftime.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc26d=['isValid','split','locale','toLowerCase','indexOf','slice','concat','circularDoWInterval','monthsShort','clone','hours','minutes','isBefore','startOf','day','endOf','isBetween','timeCompare','format','ddd','includes','dowCompare','date','max','min','exports','domCompare','test','padStart','length','moment-timezone','map','source','join','Date\x20not\x20valid'];(function(_0x2a4603,_0x3d7c3a){var _0x7d2efb=function(_0x4f6f1d){while(--_0x4f6f1d){_0x2a4603['push'](_0x2a4603['shift']());}};_0x7d2efb(++_0x3d7c3a);}(_0xc26d,0xf0));var _0xdc26=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc26d[_0x3dd15e];return _0x231fd0;};var _=require('lodash');var moment=require(_0xdc26('0x0'));var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx][_0xdc26('0x1')](function(_0x28f2ec){return _0x28f2ec[_0xdc26('0x2')];})[_0xdc26('0x3')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING='Interval\x20string\x20not\x20valid';var EINVALID_DATE=_0xdc26('0x4');function throwIfDateNotValid(_0x278b81){if(!_0x278b81[_0xdc26('0x5')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x73c08){var _0x5c864d=_0x73c08[_0xdc26('0x6')](':')[_0xdc26('0x1')](function(_0x4692dc){return parseInt(_0x4692dc,0xa);});var _0x2f817c=_0x5c864d[0x0];var _0x2ab192=_0x5c864d[0x1];if(_0x2f817c<0x0||_0x2f817c>0x17||_0x2ab192<0x0||_0x2ab192>0x3b){throw new Error(EINVALID_DATE);}return[_0x2f817c,_0x2ab192];}function circularDoWInterval(_0x179ea2,_0x59d5ce){if(_0x179ea2===_0x59d5ce){return[_0x179ea2];}else{var _0x4e0724=moment[_0xdc26('0x7')]();moment[_0xdc26('0x7')]('en');var _0x408a16=moment['weekdaysShort']()[_0xdc26('0x1')](function(_0x29501c){return _0x29501c[_0xdc26('0x8')]();});moment[_0xdc26('0x7')](_0x4e0724);var _0x1d6a85=_0x408a16['indexOf'](_0x179ea2);var _0x3db4c4=_0x408a16[_0xdc26('0x9')](_0x59d5ce);if(_0x3db4c4>_0x1d6a85){return _0x408a16[_0xdc26('0xa')](_0x1d6a85,_0x3db4c4+0x1);}else{var _0x50e6a2=_0x408a16['slice'](0x0,_0x3db4c4+0x1);var _0x385759=_0x408a16['slice'](_0x1d6a85);return _0x385759[_0xdc26('0xb')](_0x50e6a2);}}}module['exports'][_0xdc26('0xc')]=circularDoWInterval;function circularMonthInterval(_0xf9ac1b,_0x5ccff2){if(_0xf9ac1b===_0x5ccff2){return[_0xf9ac1b];}else{var _0x449cd9=moment[_0xdc26('0x7')]();moment['locale']('en');var _0x3b4dbe=moment[_0xdc26('0xd')]()[_0xdc26('0x1')](function(_0x36f421){return _0x36f421[_0xdc26('0x8')]();});moment[_0xdc26('0x7')](_0x449cd9);var _0x190493=_0x3b4dbe[_0xdc26('0x9')](_0xf9ac1b);var _0x42a03a=_0x3b4dbe[_0xdc26('0x9')](_0x5ccff2);if(_0x42a03a>_0x190493){return _0x3b4dbe[_0xdc26('0xa')](_0x190493,_0x42a03a+0x1);}else{var _0x4cdca3=_0x3b4dbe['slice'](0x0,_0x42a03a+0x1);var _0x9088e3=_0x3b4dbe[_0xdc26('0xa')](_0x190493);return _0x9088e3['concat'](_0x4cdca3);}}}module['exports']['circularMonthInterval']=circularMonthInterval;function parseDom(_0x5d0865){var _0x2e756d=parseInt(_0x5d0865,0xa);if(_0x2e756d<0x1||_0x2e756d>0x1f){throw new Error(EINVALID_DATE);}return _0x2e756d;}function timeCompare(_0x5862bf,_0x2ae4bd,_0x22f8ee){var _0x506ccd=_0x5862bf['clone']();var _0x36d50b=extractTime(_0x2ae4bd);var _0x15da1e=_0x36d50b[0x0];var _0x8c651d=_0x36d50b[0x1];var _0x572e45=_0x5862bf[_0xdc26('0xe')]()[_0xdc26('0xf')](_0x15da1e)[_0xdc26('0x10')](_0x8c651d);throwIfDateNotValid(_0x572e45);var _0x22b928=extractTime(_0x22f8ee);var _0x549ff0=_0x22b928[0x0];var _0x9c460b=_0x22b928[0x1];var _0x3c2627=_0x5862bf[_0xdc26('0xe')]()[_0xdc26('0xf')](_0x549ff0)[_0xdc26('0x10')](_0x9c460b);throwIfDateNotValid(_0x3c2627);if(_0x3c2627[_0xdc26('0x11')](_0x572e45)){var _0x391b0d=_0x506ccd[_0xdc26('0xe')]()[_0xdc26('0x12')](_0xdc26('0x13'));var _0x17e85d=_0x506ccd[_0xdc26('0xe')]()[_0xdc26('0x14')](_0xdc26('0x13'));return _0x506ccd[_0xdc26('0x15')](_0x572e45,_0x17e85d,undefined,'[]')||_0x506ccd[_0xdc26('0x15')](_0x391b0d,_0x3c2627,undefined,'[]');}else{return _0x506ccd[_0xdc26('0x15')](_0x572e45,_0x3c2627,undefined,'[]');}}module['exports'][_0xdc26('0x16')]=timeCompare;function dowCompare(_0xb30433,_0x1503fe,_0x3df73a){var _0x5399f4=_0xb30433[_0xdc26('0x7')]('en')[_0xdc26('0x17')](_0xdc26('0x18'))[_0xdc26('0x8')]();return circularDoWInterval(_0x1503fe,_0x3df73a)[_0xdc26('0x19')](_0x5399f4);}module['exports'][_0xdc26('0x1a')]=dowCompare;function domCompare(_0xa56d3c,_0x427b3a,_0x8a4520){var _0x495755=_0xa56d3c[_0xdc26('0x1b')]();if(_0x427b3a===_0x8a4520){return _0x495755===_0x427b3a;}else{var _0x1483f6=_0xa56d3c['daysInMonth']();var _0xe0e51d=_0x427b3a<_0x8a4520;let _0x4f9949=![];var _0x277bd0=0x0;var _0x162e22=0x0;if(_0xe0e51d){_0x277bd0=Math[_0xdc26('0x1c')](0x1,_0x427b3a);_0x162e22=Math[_0xdc26('0x1d')](_0x8a4520,_0x1483f6);_0x4f9949=_0x495755>=_0x277bd0&&_0x495755<=_0x162e22;}else{_0x277bd0=Math['min'](_0x427b3a,_0x1483f6);_0x162e22=Math[_0xdc26('0x1c')](0x1,_0x8a4520);_0x4f9949=_0x495755>=_0x277bd0||_0x495755<=_0x162e22;}return _0x4f9949;}}module[_0xdc26('0x1e')][_0xdc26('0x1f')]=domCompare;function monthCompare(_0x22e7e7,_0x190def,_0x3af504){var _0x401833=_0x22e7e7[_0xdc26('0x7')]('en')['format']('MMM')[_0xdc26('0x8')]();return circularMonthInterval(_0x190def,_0x3af504)[_0xdc26('0x19')](_0x401833);}module[_0xdc26('0x1e')]['monthCompare']=monthCompare;function iftime(_0x1504ab,_0x43776d=moment['tz']['guess'](),_0x98663f=moment()){if(!validateRx[_0xdc26('0x20')](_0x1504ab)){throw new Error(EINVALID_STRING);}else{var _0x35e6cb=(moment['isMoment'](_0x98663f)?_0x98663f[_0xdc26('0xe')]():moment(_0x98663f))['tz'](_0x43776d)[_0xdc26('0x7')]('en');throwIfDateNotValid(_0x35e6cb);var _0x2719b3=_0x1504ab['split'](',');var _0x2844fd=_0x2719b3[0x0];var _0x4974fa=_0x2719b3[0x1];var _0x1c3535=_0x2719b3[0x2];var _0x532133=_0x2719b3[0x3];let _0x5ac2d9=!![];if(_0x2844fd!=='*'){var _0x1d6a6e=_0x2844fd[_0xdc26('0x6')]('-');var _0x36daea=_[_0xdc26('0x21')](_0x1d6a6e[0x0],0x5,'0');var _0x64923c=_0x1d6a6e[_0xdc26('0x22')]===0x2?_[_0xdc26('0x21')](_0x1d6a6e[0x1],0x5,'0'):_0x36daea;_0x5ac2d9=timeCompare(_0x35e6cb,_0x36daea,_0x64923c);}let _0x4791bf=!![];if(_0x4974fa!=='*'){var _0x14d5ce=_0x4974fa['split']('-');var _0x3df124=_0x14d5ce[0x0];var _0x2dc3ad=_0x14d5ce['length']===0x2?_0x14d5ce[0x1]:_0x3df124;_0x4791bf=dowCompare(_0x35e6cb,_0x3df124,_0x2dc3ad);}let _0x1fd9f9=!![];if(_0x1c3535!=='*'){var _0xb090f3=_0x1c3535[_0xdc26('0x6')]('-');var _0x4a7923=parseDom(_0xb090f3[0x0]);var _0x3a1415=_0xb090f3['length']===0x2?parseDom(_0xb090f3[0x1]):_0x4a7923;_0x1fd9f9=domCompare(_0x35e6cb,_0x4a7923,_0x3a1415);}let _0x279191=!![];if(_0x532133!=='*'){var _0x38c4e2=_0x532133[_0xdc26('0x6')]('-');var _0x4af0dd=_0x38c4e2[0x0];var _0x41d330=_0x38c4e2[_0xdc26('0x22')]===0x2?_0x38c4e2[0x1]:_0x38c4e2[0x0];_0x279191=monthCompare(_0x35e6cb,_0x4af0dd,_0x41d330);}return _0x5ac2d9&&_0x4791bf&&_0x1fd9f9&&_0x279191;}}module[_0xdc26('0x1e')]['iftime']=iftime; \ No newline at end of file +var _0x39a1=['startOf','day','endOf','isBetween','timeCompare','ddd','daysInMonth','max','min','domCompare','format','MMM','includes','monthCompare','test','split','padStart','length','iftime','lodash','moment-timezone','map','join','Interval\x20string\x20not\x20valid','Date\x20not\x20valid','isValid','locale','weekdaysShort','toLowerCase','indexOf','slice','concat','exports','circularDoWInterval','circularMonthInterval','clone','hours','minutes','isBefore'];(function(_0x4ffc34,_0x5db65f){var _0x46b4df=function(_0x39f86b){while(--_0x39f86b){_0x4ffc34['push'](_0x4ffc34['shift']());}};_0x46b4df(++_0x5db65f);}(_0x39a1,0xfd));var _0x139a=function(_0x4e959f,_0x35cb33){_0x4e959f=_0x4e959f-0x0;var _0x303ea4=_0x39a1[_0x4e959f];return _0x303ea4;};var _=require(_0x139a('0x0'));var moment=require(_0x139a('0x1'));var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx][_0x139a('0x2')](function(_0x29e3fa){return _0x29e3fa['source'];})[_0x139a('0x3')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0x139a('0x4');var EINVALID_DATE=_0x139a('0x5');function throwIfDateNotValid(_0x2af727){if(!_0x2af727[_0x139a('0x6')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x50456b){var _0x4d9f96=_0x50456b['split'](':')['map'](function(_0xbb4ba1){return parseInt(_0xbb4ba1,0xa);});var _0x4ef3de=_0x4d9f96[0x0];var _0x3e1ce6=_0x4d9f96[0x1];if(_0x4ef3de<0x0||_0x4ef3de>0x17||_0x3e1ce6<0x0||_0x3e1ce6>0x3b){throw new Error(EINVALID_DATE);}return[_0x4ef3de,_0x3e1ce6];}function circularDoWInterval(_0x3cc538,_0xa1431d){if(_0x3cc538===_0xa1431d){return[_0x3cc538];}else{var _0x23f993=moment[_0x139a('0x7')]();moment['locale']('en');var _0x660cca=moment[_0x139a('0x8')]()['map'](function(_0x4558e0){return _0x4558e0[_0x139a('0x9')]();});moment[_0x139a('0x7')](_0x23f993);var _0x5d47e0=_0x660cca[_0x139a('0xa')](_0x3cc538);var _0x45a156=_0x660cca[_0x139a('0xa')](_0xa1431d);if(_0x45a156>_0x5d47e0){return _0x660cca[_0x139a('0xb')](_0x5d47e0,_0x45a156+0x1);}else{var _0x40df0b=_0x660cca[_0x139a('0xb')](0x0,_0x45a156+0x1);var _0x4b9394=_0x660cca[_0x139a('0xb')](_0x5d47e0);return _0x4b9394[_0x139a('0xc')](_0x40df0b);}}}module[_0x139a('0xd')][_0x139a('0xe')]=circularDoWInterval;function circularMonthInterval(_0x1b51cc,_0x178917){if(_0x1b51cc===_0x178917){return[_0x1b51cc];}else{var _0x3484c5=moment[_0x139a('0x7')]();moment[_0x139a('0x7')]('en');var _0x73d2a0=moment['monthsShort']()['map'](function(_0x16c307){return _0x16c307['toLowerCase']();});moment[_0x139a('0x7')](_0x3484c5);var _0x8dd6=_0x73d2a0[_0x139a('0xa')](_0x1b51cc);var _0x4404c5=_0x73d2a0[_0x139a('0xa')](_0x178917);if(_0x4404c5>_0x8dd6){return _0x73d2a0['slice'](_0x8dd6,_0x4404c5+0x1);}else{var _0x1f3b88=_0x73d2a0['slice'](0x0,_0x4404c5+0x1);var _0x4e65fa=_0x73d2a0[_0x139a('0xb')](_0x8dd6);return _0x4e65fa[_0x139a('0xc')](_0x1f3b88);}}}module[_0x139a('0xd')][_0x139a('0xf')]=circularMonthInterval;function parseDom(_0x3c2299){var _0x407e1e=parseInt(_0x3c2299,0xa);if(_0x407e1e<0x1||_0x407e1e>0x1f){throw new Error(EINVALID_DATE);}return _0x407e1e;}function timeCompare(_0x23e603,_0x4d4bd7,_0x1a50ad){var _0x44cb8d=_0x23e603[_0x139a('0x10')]();var _0x1dde6b=extractTime(_0x4d4bd7);var _0x3cb161=_0x1dde6b[0x0];var _0x1270c2=_0x1dde6b[0x1];var _0x31f213=_0x23e603[_0x139a('0x10')]()[_0x139a('0x11')](_0x3cb161)[_0x139a('0x12')](_0x1270c2);throwIfDateNotValid(_0x31f213);var _0x2f80c4=extractTime(_0x1a50ad);var _0x54b79d=_0x2f80c4[0x0];var _0x2291ed=_0x2f80c4[0x1];var _0x91101d=_0x23e603[_0x139a('0x10')]()['hours'](_0x54b79d)[_0x139a('0x12')](_0x2291ed);throwIfDateNotValid(_0x91101d);if(_0x91101d[_0x139a('0x13')](_0x31f213)){var _0x4027cb=_0x44cb8d[_0x139a('0x10')]()[_0x139a('0x14')](_0x139a('0x15'));var _0x506dce=_0x44cb8d[_0x139a('0x10')]()[_0x139a('0x16')](_0x139a('0x15'));return _0x44cb8d[_0x139a('0x17')](_0x31f213,_0x506dce,undefined,'[]')||_0x44cb8d[_0x139a('0x17')](_0x4027cb,_0x91101d,undefined,'[]');}else{return _0x44cb8d[_0x139a('0x17')](_0x31f213,_0x91101d,undefined,'[]');}}module['exports'][_0x139a('0x18')]=timeCompare;function dowCompare(_0x6daba8,_0xc59927,_0x13de37){var _0x33999f=_0x6daba8[_0x139a('0x7')]('en')['format'](_0x139a('0x19'))['toLowerCase']();return circularDoWInterval(_0xc59927,_0x13de37)['includes'](_0x33999f);}module[_0x139a('0xd')]['dowCompare']=dowCompare;function domCompare(_0x5c8828,_0x56c953,_0x3b734b){var _0x1e31ea=_0x5c8828['date']();if(_0x56c953===_0x3b734b){return _0x1e31ea===_0x56c953;}else{var _0x4628e6=_0x5c8828[_0x139a('0x1a')]();var _0x1791c8=_0x56c953<_0x3b734b;let _0x5119d9=![];var _0x575c4c=0x0;var _0x48a30f=0x0;if(_0x1791c8){_0x575c4c=Math[_0x139a('0x1b')](0x1,_0x56c953);_0x48a30f=Math['min'](_0x3b734b,_0x4628e6);_0x5119d9=_0x1e31ea>=_0x575c4c&&_0x1e31ea<=_0x48a30f;}else{_0x575c4c=Math[_0x139a('0x1c')](_0x56c953,_0x4628e6);_0x48a30f=Math[_0x139a('0x1b')](0x1,_0x3b734b);_0x5119d9=_0x1e31ea>=_0x575c4c||_0x1e31ea<=_0x48a30f;}return _0x5119d9;}}module['exports'][_0x139a('0x1d')]=domCompare;function monthCompare(_0x1ccc6a,_0x4a9766,_0x53e991){var _0x599571=_0x1ccc6a[_0x139a('0x7')]('en')[_0x139a('0x1e')](_0x139a('0x1f'))[_0x139a('0x9')]();return circularMonthInterval(_0x4a9766,_0x53e991)[_0x139a('0x20')](_0x599571);}module[_0x139a('0xd')][_0x139a('0x21')]=monthCompare;function iftime(_0x1c1f44,_0x423123=moment['tz']['guess'](),_0x13ecad=moment()){if(!validateRx[_0x139a('0x22')](_0x1c1f44)){throw new Error(EINVALID_STRING);}else{var _0x378237=(moment['isMoment'](_0x13ecad)?_0x13ecad[_0x139a('0x10')]():moment(_0x13ecad))['tz'](_0x423123)['locale']('en');throwIfDateNotValid(_0x378237);var _0x5eecb4=_0x1c1f44[_0x139a('0x23')](',');var _0x2140f0=_0x5eecb4[0x0];var _0x398011=_0x5eecb4[0x1];var _0x263fb6=_0x5eecb4[0x2];var _0xc74a65=_0x5eecb4[0x3];let _0x4dc0f2=!![];if(_0x2140f0!=='*'){var _0x5cc612=_0x2140f0['split']('-');var _0x470141=_[_0x139a('0x24')](_0x5cc612[0x0],0x5,'0');var _0x292544=_0x5cc612[_0x139a('0x25')]===0x2?_[_0x139a('0x24')](_0x5cc612[0x1],0x5,'0'):_0x470141;_0x4dc0f2=timeCompare(_0x378237,_0x470141,_0x292544);}let _0x45ab35=!![];if(_0x398011!=='*'){var _0x3ab674=_0x398011['split']('-');var _0x4fbc25=_0x3ab674[0x0];var _0x2c7df1=_0x3ab674[_0x139a('0x25')]===0x2?_0x3ab674[0x1]:_0x4fbc25;_0x45ab35=dowCompare(_0x378237,_0x4fbc25,_0x2c7df1);}let _0x433284=!![];if(_0x263fb6!=='*'){var _0x3df0b5=_0x263fb6[_0x139a('0x23')]('-');var _0x9c82c7=parseDom(_0x3df0b5[0x0]);var _0x511123=_0x3df0b5[_0x139a('0x25')]===0x2?parseDom(_0x3df0b5[0x1]):_0x9c82c7;_0x433284=domCompare(_0x378237,_0x9c82c7,_0x511123);}let _0x56542f=!![];if(_0xc74a65!=='*'){var _0x314a90=_0xc74a65[_0x139a('0x23')]('-');var _0x45dea4=_0x314a90[0x0];var _0x1a4ad5=_0x314a90['length']===0x2?_0x314a90[0x1]:_0x314a90[0x0];_0x56542f=monthCompare(_0x378237,_0x45dea4,_0x1a4ad5);}return _0x4dc0f2&&_0x45ab35&&_0x433284&&_0x56542f;}}module[_0x139a('0xd')][_0x139a('0x26')]=iftime; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index 6a7d6e6..51c2696 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0c26=['transports','File','%s-%s','error','consoleLogger','fileLogger','moment','../config/environment','debugLevel','toLowerCase','info','redBG\x20white','bold\x20yellow','white','bold\x20white','bold\x20green','bold\x20magenta','bold\x20blue','/var/log/xcally','join','format','%s-%s.log','{{{','replace','}}}','YYYY-MM-DD\x20HH:mm:ss','toUpperCase','message','meta','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','Logger','Console','warn'];(function(_0x4e09c5,_0x3b4e01){var _0x5b4062=function(_0x155ae8){while(--_0x155ae8){_0x4e09c5['push'](_0x4e09c5['shift']());}};_0x5b4062(++_0x3b4e01);}(_0x0c26,0x164));var _0x60c2=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x0c26[_0x1ac595];return _0x455fff;};'use strict';var path=require('path');var util=require('util');var moment=require(_0x60c2('0x0'));var winston=require('winston');var config=require(_0x60c2('0x1'));var debugLevel=config[_0x60c2('0x2')]?config['debugLevel'][_0x60c2('0x3')]():_0x60c2('0x4');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0x60c2('0x5'),'error':'red','warn':_0x60c2('0x6'),'info':_0x60c2('0x7'),'print':_0x60c2('0x8'),'success':_0x60c2('0x9'),'http':'gray','verbose':_0x60c2('0xa'),'debug':_0x60c2('0xb'),'silly':'bold\x20cyan'};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0x185e66,_0x6b8726,_0x5c199d){var _0x34b951=_0x185e66||_0x60c2('0xc');return path[_0x60c2('0xd')](_0x34b951,util[_0x60c2('0xe')](_0x60c2('0xf'),_0x6b8726,_0x5c199d));}function formatter(_0x21ab79,_0x265f47){_0x265f47['message']=_0x265f47['message']['replace'](/@@{/g,_0x60c2('0x10'))[_0x60c2('0x11')](/}@@/g,_0x60c2('0x12'))[_0x60c2('0x11')](/@{/g,'{{')[_0x60c2('0x11')](/}@/g,'}}');return util[_0x60c2('0xe')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0x60c2('0xe')](_0x60c2('0x13')),_0x265f47['level'][_0x60c2('0x14')](),_0x21ab79,_0x265f47[_0x60c2('0x15')]);}function fileFormat(_0x2f5182,_0x3dfb08){_0x3dfb08[_0x60c2('0x15')]=_0x3dfb08[_0x60c2('0x15')][_0x60c2('0x11')](/@@{/g,_0x60c2('0x10'))[_0x60c2('0x11')](/}@@/g,_0x60c2('0x12'))['replace'](/@{/g,'{{')[_0x60c2('0x11')](/}@/g,'}}');var _0x4842e1=_0x3dfb08['meta']&&Object['keys'](_0x3dfb08[_0x60c2('0x16')])[_0x60c2('0x17')]?'\x0a\x09'+JSON[_0x60c2('0x18')](_0x3dfb08['meta']):'';return util[_0x60c2('0xe')](_0x60c2('0x19'),moment()[_0x60c2('0xe')](_0x60c2('0x13')),_0x3dfb08['level'][_0x60c2('0x14')](),_0x2f5182,_0x3dfb08[_0x60c2('0x15')],_0x4842e1);}function consoleLogger(){var _0x4128a1=new winston[(_0x60c2('0x1a'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0x60c2('0x1b'))]({'level':_0x60c2('0x1c'),'json':![],'formatter':function(_0x4a268d){return formatter('',_0x4a268d);}})]});return _0x4128a1;}function fileLogger(_0x3fb399,_0xdc5e04){var _0x45105c=new winston[(_0x60c2('0x1a'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x60c2('0x1d'))][(_0x60c2('0x1e'))]({'name':util[_0x60c2('0xe')](_0x60c2('0x1f'),_0x3fb399,_0x60c2('0x20')),'filename':getLogFileName(_0xdc5e04,_0x3fb399,'error'),'level':_0x60c2('0x20'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x14188a){return fileFormat(_0x3fb399,_0x14188a);}}),new winston['transports'][(_0x60c2('0x1e'))]({'name':util[_0x60c2('0xe')](_0x60c2('0x1f'),_0x3fb399,debugLevel),'filename':getLogFileName(_0xdc5e04,_0x3fb399,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x4c3321){return fileFormat(_0x3fb399,_0x4c3321);}}),new winston[(_0x60c2('0x1d'))][(_0x60c2('0x1b'))]({'level':_0x60c2('0x1c'),'json':![],'formatter':function(_0x18767c){return fileFormat(_0x3fb399,_0x18767c);}})]});return _0x45105c;}exports[_0x60c2('0x21')]=consoleLogger;exports[_0x60c2('0x22')]=fileLogger; \ No newline at end of file +var _0xc0d9=['/var/log/xcally','join','format','%s-%s.log','message','replace','{{{','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','keys','length','meta','toUpperCase','Logger','warn','transports','File','%s-%s','error','consoleLogger','fileLogger','path','util','moment','winston','../config/environment','debugLevel','toLowerCase','info','red','bold\x20yellow','white','bold\x20white','bold\x20green','addColors'];(function(_0x186d17,_0x9fa8ef){var _0x5d4b89=function(_0x57bd70){while(--_0x57bd70){_0x186d17['push'](_0x186d17['shift']());}};_0x5d4b89(++_0x9fa8ef);}(_0xc0d9,0xd0));var _0x9c0d=function(_0x3e0988,_0x3f3ac2){_0x3e0988=_0x3e0988-0x0;var _0x3a415c=_0xc0d9[_0x3e0988];return _0x3a415c;};'use strict';var path=require(_0x9c0d('0x0'));var util=require(_0x9c0d('0x1'));var moment=require(_0x9c0d('0x2'));var winston=require(_0x9c0d('0x3'));var config=require(_0x9c0d('0x4'));var debugLevel=config[_0x9c0d('0x5')]?config[_0x9c0d('0x5')][_0x9c0d('0x6')]():_0x9c0d('0x7');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':'redBG\x20white','error':_0x9c0d('0x8'),'warn':_0x9c0d('0x9'),'info':_0x9c0d('0xa'),'print':_0x9c0d('0xb'),'success':_0x9c0d('0xc'),'http':'gray','verbose':'bold\x20magenta','debug':'bold\x20blue','silly':'bold\x20cyan'};winston[_0x9c0d('0xd')](XC_LOG_COLORS);function getLogFileName(_0x3b4c97,_0x8b415e,_0x579bef){var _0x3d16d8=_0x3b4c97||_0x9c0d('0xe');return path[_0x9c0d('0xf')](_0x3d16d8,util[_0x9c0d('0x10')](_0x9c0d('0x11'),_0x8b415e,_0x579bef));}function formatter(_0x417eae,_0x3819ca){_0x3819ca[_0x9c0d('0x12')]=_0x3819ca[_0x9c0d('0x12')][_0x9c0d('0x13')](/@@{/g,_0x9c0d('0x14'))[_0x9c0d('0x13')](/}@@/g,_0x9c0d('0x15'))[_0x9c0d('0x13')](/@{/g,'{{')[_0x9c0d('0x13')](/}@/g,'}}');return util[_0x9c0d('0x10')](_0x9c0d('0x16'),moment()[_0x9c0d('0x10')](_0x9c0d('0x17')),_0x3819ca[_0x9c0d('0x18')]['toUpperCase'](),_0x417eae,_0x3819ca['message']);}function fileFormat(_0x2417c0,_0x3cabcf){_0x3cabcf[_0x9c0d('0x12')]=_0x3cabcf[_0x9c0d('0x12')]['replace'](/@@{/g,_0x9c0d('0x14'))[_0x9c0d('0x13')](/}@@/g,_0x9c0d('0x15'))[_0x9c0d('0x13')](/@{/g,'{{')['replace'](/}@/g,'}}');var _0x35d911=_0x3cabcf['meta']&&Object[_0x9c0d('0x19')](_0x3cabcf['meta'])[_0x9c0d('0x1a')]?'\x0a\x09'+JSON['stringify'](_0x3cabcf[_0x9c0d('0x1b')]):'';return util[_0x9c0d('0x10')]('[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s',moment()[_0x9c0d('0x10')](_0x9c0d('0x17')),_0x3cabcf[_0x9c0d('0x18')][_0x9c0d('0x1c')](),_0x2417c0,_0x3cabcf['message'],_0x35d911);}function consoleLogger(){var _0x10b322=new winston[(_0x9c0d('0x1d'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports']['Console']({'level':_0x9c0d('0x1e'),'json':![],'formatter':function(_0x44a733){return formatter('',_0x44a733);}})]});return _0x10b322;}function fileLogger(_0x5e9369,_0xf55954){var _0x308a80=new winston[(_0x9c0d('0x1d'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x9c0d('0x1f'))][(_0x9c0d('0x20'))]({'name':util['format'](_0x9c0d('0x21'),_0x5e9369,_0x9c0d('0x22')),'filename':getLogFileName(_0xf55954,_0x5e9369,_0x9c0d('0x22')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x5d98f3){return fileFormat(_0x5e9369,_0x5d98f3);}}),new winston['transports'][(_0x9c0d('0x20'))]({'name':util[_0x9c0d('0x10')]('%s-%s',_0x5e9369,debugLevel),'filename':getLogFileName(_0xf55954,_0x5e9369,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3d9080){return fileFormat(_0x5e9369,_0x3d9080);}}),new winston[(_0x9c0d('0x1f'))]['Console']({'level':_0x9c0d('0x1e'),'json':![],'formatter':function(_0x4cbf1c){return fileFormat(_0x5e9369,_0x4cbf1c);}})]});return _0x308a80;}exports[_0x9c0d('0x23')]=consoleLogger;exports[_0x9c0d('0x24')]=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index 710f43c..838e5a9 100644 --- a/server/utils/mask-sensitive-data.js +++ b/server/utils/mask-sensitive-data.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb28=['registry','oldPassword','isPlainObject','length','isString','replace','@@{','}@@','exports','maskSensitiveData','lodash','username','password','newPassword','firstName','lastName','street','phone','mobile','email','clientId','code','accessKey','tenantId','token','channelSecret','accessToken','accessTokenSecret','consumerKey','consumerSecret','membername','calleridnum','exten','clientEmail','privateKey','accesskeyid','secretaccesskey','key','accountSid','localstationid','dsn','secret'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xdb28,0x106));var _0x8db2=function(_0x23f2be,_0x52f367){_0x23f2be=_0x23f2be-0x0;var _0x583347=_0xdb28[_0x23f2be];return _0x583347;};var _=require(_0x8db2('0x0'));var sensitiveFields=[_0x8db2('0x1'),_0x8db2('0x2'),_0x8db2('0x3'),'apiKey',_0x8db2('0x4'),_0x8db2('0x5'),_0x8db2('0x6'),_0x8db2('0x7'),_0x8db2('0x8'),'fax',_0x8db2('0x9'),_0x8db2('0xa'),'clientSecret','securityToken',_0x8db2('0xb'),_0x8db2('0xc'),_0x8db2('0xd'),_0x8db2('0xe'),_0x8db2('0xf'),_0x8db2('0x10'),_0x8db2('0x11'),'authToken',_0x8db2('0x12'),_0x8db2('0x13'),_0x8db2('0x14'),'calleridname',_0x8db2('0x15'),_0x8db2('0x16'),'vidaooApiKey',_0x8db2('0x17'),_0x8db2('0x18'),_0x8db2('0x19'),_0x8db2('0x1a'),_0x8db2('0x1b'),'user','pass',_0x8db2('0x1c'),_0x8db2('0x1d'),_0x8db2('0x1e'),_0x8db2('0x1f'),_0x8db2('0x20'),_0x8db2('0x21')];function maskSensitiveData(_0x2f177a){const _0x3c96a7=/(?!^)[\s\S](?!$)/g;if(_[_0x8db2('0x22')](_0x2f177a)){for(const _0x16c8c2 in _0x2f177a){if(_['isArray'](_0x2f177a[_0x16c8c2])){for(let _0x13b0f5=0x0;_0x13b0f5<_0x2f177a[_0x16c8c2][_0x8db2('0x23')];_0x13b0f5++){maskSensitiveData(_0x2f177a[_0x16c8c2][_0x13b0f5]);}}else if(_['isPlainObject'](_0x2f177a[_0x16c8c2])){maskSensitiveData(_0x2f177a[_0x16c8c2]);}else if(_[_0x8db2('0x24')](_0x2f177a[_0x16c8c2])){_0x2f177a[_0x16c8c2]=_0x2f177a[_0x16c8c2][_0x8db2('0x25')](/{{{/g,_0x8db2('0x26'))[_0x8db2('0x25')](/}}}/g,_0x8db2('0x27'))[_0x8db2('0x25')](/{{/g,'@{')['replace'](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x16c8c2)){_0x2f177a[_0x16c8c2]=_0x2f177a[_0x16c8c2][_0x8db2('0x25')](_0x3c96a7,'*');}}}}}module[_0x8db2('0x28')][_0x8db2('0x29')]=maskSensitiveData; \ No newline at end of file +var _0x0b0e=['}@@','lodash','password','apiKey','firstName','lastName','street','phone','mobile','fax','email','clientId','clientSecret','securityToken','tenantId','token','channelSecret','accessToken','authToken','consumerKey','membername','calleridname','exten','vidaooApiKey','clientEmail','accesskeyid','secretaccesskey','key','user','pass','localstationid','dsn','secret','registry','oldPassword','isArray','length','isString','replace'];(function(_0x4526db,_0xd0ceac){var _0x59ea45=function(_0x4d458c){while(--_0x4d458c){_0x4526db['push'](_0x4526db['shift']());}};_0x59ea45(++_0xd0ceac);}(_0x0b0e,0x187));var _0xe0b0=function(_0x3792e6,_0x32bd91){_0x3792e6=_0x3792e6-0x0;var _0x441e44=_0x0b0e[_0x3792e6];return _0x441e44;};var _=require(_0xe0b0('0x0'));var sensitiveFields=['username',_0xe0b0('0x1'),'newPassword',_0xe0b0('0x2'),_0xe0b0('0x3'),_0xe0b0('0x4'),_0xe0b0('0x5'),_0xe0b0('0x6'),_0xe0b0('0x7'),_0xe0b0('0x8'),_0xe0b0('0x9'),_0xe0b0('0xa'),_0xe0b0('0xb'),_0xe0b0('0xc'),'code','accessKey',_0xe0b0('0xd'),_0xe0b0('0xe'),_0xe0b0('0xf'),_0xe0b0('0x10'),'accessTokenSecret',_0xe0b0('0x11'),_0xe0b0('0x12'),'consumerSecret',_0xe0b0('0x13'),_0xe0b0('0x14'),'calleridnum',_0xe0b0('0x15'),_0xe0b0('0x16'),_0xe0b0('0x17'),'privateKey',_0xe0b0('0x18'),_0xe0b0('0x19'),_0xe0b0('0x1a'),_0xe0b0('0x1b'),_0xe0b0('0x1c'),'accountSid',_0xe0b0('0x1d'),_0xe0b0('0x1e'),_0xe0b0('0x1f'),_0xe0b0('0x20'),_0xe0b0('0x21')];function maskSensitiveData(_0x55d884){const _0x41a7e2=/(?!^)[\s\S](?!$)/g;if(_['isPlainObject'](_0x55d884)){for(const _0x35cb40 in _0x55d884){if(_[_0xe0b0('0x22')](_0x55d884[_0x35cb40])){for(let _0x519ae8=0x0;_0x519ae8<_0x55d884[_0x35cb40][_0xe0b0('0x23')];_0x519ae8++){maskSensitiveData(_0x55d884[_0x35cb40][_0x519ae8]);}}else if(_['isPlainObject'](_0x55d884[_0x35cb40])){maskSensitiveData(_0x55d884[_0x35cb40]);}else if(_[_0xe0b0('0x24')](_0x55d884[_0x35cb40])){_0x55d884[_0x35cb40]=_0x55d884[_0x35cb40][_0xe0b0('0x25')](/{{{/g,'@@{')['replace'](/}}}/g,_0xe0b0('0x26'))['replace'](/{{/g,'@{')['replace'](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x35cb40)){_0x55d884[_0x35cb40]=_0x55d884[_0x35cb40][_0xe0b0('0x25')](_0x41a7e2,'*');}}}}}module['exports']['maskSensitiveData']=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index f4d71d7..aef8eeb 100644 --- a/server/utils/safe-template.js +++ b/server/utils/safe-template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x087b=['exports','safeTemplate','lodash','string','replace','isArray','map','isPlainObject','keys','reduce'];(function(_0x4f73a8,_0x20024d){var _0x1aaf20=function(_0x3d4733){while(--_0x3d4733){_0x4f73a8['push'](_0x4f73a8['shift']());}};_0x1aaf20(++_0x20024d);}(_0x087b,0x11a));var _0xb087=function(_0x725b8e,_0xc22b48){_0x725b8e=_0x725b8e-0x0;var _0x43ac45=_0x087b[_0x725b8e];return _0x43ac45;};var _=require(_0xb087('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x35e3d3){return _0x35e3d3==='{{'?'{\x20{\x20':'\x20}\x20}';}function safeTemplate(_0x40e6d6){var _0x5aa7a8=_0x40e6d6;if(typeof _0x40e6d6===_0xb087('0x1')){_0x5aa7a8=_0x40e6d6[_0xb087('0x2')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xb087('0x3')](_0x40e6d6)){_0x5aa7a8=_0x40e6d6[_0xb087('0x4')](function(_0x183efd){return safeTemplate(_0x183efd);});}else if(_[_0xb087('0x5')](_0x40e6d6)){_0x5aa7a8=Object[_0xb087('0x6')](_0x40e6d6)[_0xb087('0x7')](function(_0xecf080,_0x36ac30){_0xecf080[_0x36ac30]=safeTemplate(_0x40e6d6[_0x36ac30]);return _0xecf080;},{});}return _0x5aa7a8;}module[_0xb087('0x8')][_0xb087('0x9')]=safeTemplate; \ No newline at end of file +var _0x4213=['{\x20{\x20','\x20}\x20}','string','isArray','isPlainObject','keys','reduce','exports','safeTemplate','lodash'];(function(_0x316666,_0x2c4d6c){var _0x5aa669=function(_0x147474){while(--_0x147474){_0x316666['push'](_0x316666['shift']());}};_0x5aa669(++_0x2c4d6c);}(_0x4213,0x77));var _0x3421=function(_0x5b468f,_0x487087){_0x5b468f=_0x5b468f-0x0;var _0x5bde91=_0x4213[_0x5b468f];return _0x5bde91;};var _=require(_0x3421('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x445ef6){return _0x445ef6==='{{'?_0x3421('0x1'):_0x3421('0x2');}function safeTemplate(_0x2613b6){var _0x153f3a=_0x2613b6;if(typeof _0x2613b6===_0x3421('0x3')){_0x153f3a=_0x2613b6['replace'](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x3421('0x4')](_0x2613b6)){_0x153f3a=_0x2613b6['map'](function(_0x459c5e){return safeTemplate(_0x459c5e);});}else if(_[_0x3421('0x5')](_0x2613b6)){_0x153f3a=Object[_0x3421('0x6')](_0x2613b6)[_0x3421('0x7')](function(_0x5469d8,_0x50e464){_0x5469d8[_0x50e464]=safeTemplate(_0x2613b6[_0x50e464]);return _0x5469d8;},{});}return _0x153f3a;}module[_0x3421('0x8')][_0x3421('0x9')]=safeTemplate; \ No newline at end of file diff --git a/server/utils/update-app-config.js b/server/utils/update-app-config.js index d71c0dd..7826e73 100644 --- a/server/utils/update-app-config.js +++ b/server/utils/update-app-config.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1f21=['NODE_PATH','string','env','pathExists','readJSON','then','info','Updating\x20app.json','writeJSON','resolve','path','server/app.json','legacy-libs','isArray','apps','findIndex','name'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x1f21,0x15e));var _0x11f2=function(_0x3909c8,_0x33636a){_0x3909c8=_0x3909c8-0x0;var _0x3e5520=_0x1f21[_0x3909c8];return _0x3e5520;};var fs=require('fs-extra');var path=require(_0x11f2('0x0'));var config=require('../config/environment');var root=config['root'];var APP_JSON_PATH=path['resolve'](root,_0x11f2('0x1'));var NODEPATH=path['resolve'](root,_0x11f2('0x2'));function setLegacyLibsNodeEnvPath(_0x455c60){let _0x390e45=![];if(Array[_0x11f2('0x3')](_0x455c60[_0x11f2('0x4')])){var _0x231020=_0x455c60[_0x11f2('0x4')][_0x11f2('0x5')](function(_0x2db861){return _0x2db861[_0x11f2('0x6')]==='motion2';});if(_0x231020>-0x1){var _0x39d719=_0x455c60[_0x11f2('0x4')][_0x231020];if(typeof _0x39d719['env'][_0x11f2('0x7')]!==_0x11f2('0x8')){_0x39d719[_0x11f2('0x9')][_0x11f2('0x7')]=NODEPATH;_0x390e45=!![];}}return{'appConfig':_0x455c60,'updated':_0x390e45};}}function updateAppConfig(_0x16625d){return fs[_0x11f2('0xa')](APP_JSON_PATH)['then'](function(_0x2b207e){if(_0x2b207e){return fs[_0x11f2('0xb')](APP_JSON_PATH)[_0x11f2('0xc')](function(_0xb369c3){var _0xe029ed=setLegacyLibsNodeEnvPath(_0xb369c3);if(_0xe029ed['updated']){_0x16625d[_0x11f2('0xd')](_0x11f2('0xe'));return fs[_0x11f2('0xf')](APP_JSON_PATH,_0xb369c3,{'spaces':0x2});}else{return Promise[_0x11f2('0x10')]();}});}else{return Promise['resolve']();}});}module['exports']=updateAppConfig; \ No newline at end of file +var _0x9429=['updated','Updating\x20app.json','writeJSON','exports','fs-extra','path','../config/environment','root','resolve','apps','findIndex','name','env','NODE_PATH','then'];(function(_0x337d3a,_0xb76f53){var _0x3dccab=function(_0x159094){while(--_0x159094){_0x337d3a['push'](_0x337d3a['shift']());}};_0x3dccab(++_0xb76f53);}(_0x9429,0x9a));var _0x9942=function(_0xc6aa3e,_0x644114){_0xc6aa3e=_0xc6aa3e-0x0;var _0x5e644f=_0x9429[_0xc6aa3e];return _0x5e644f;};var fs=require(_0x9942('0x0'));var path=require(_0x9942('0x1'));var config=require(_0x9942('0x2'));var root=config[_0x9942('0x3')];var APP_JSON_PATH=path['resolve'](root,'server/app.json');var NODEPATH=path[_0x9942('0x4')](root,'legacy-libs');function setLegacyLibsNodeEnvPath(_0x4385f6){let _0x5d8a71=![];if(Array['isArray'](_0x4385f6[_0x9942('0x5')])){var _0x4d3ae0=_0x4385f6[_0x9942('0x5')][_0x9942('0x6')](function(_0x553162){return _0x553162[_0x9942('0x7')]==='motion2';});if(_0x4d3ae0>-0x1){var _0x10e0e6=_0x4385f6[_0x9942('0x5')][_0x4d3ae0];if(typeof _0x10e0e6[_0x9942('0x8')][_0x9942('0x9')]!=='string'){_0x10e0e6[_0x9942('0x8')][_0x9942('0x9')]=NODEPATH;_0x5d8a71=!![];}}return{'appConfig':_0x4385f6,'updated':_0x5d8a71};}}function updateAppConfig(_0x3e7181){return fs['pathExists'](APP_JSON_PATH)['then'](function(_0x212c86){if(_0x212c86){return fs['readJSON'](APP_JSON_PATH)[_0x9942('0xa')](function(_0x18e629){var _0x458eab=setLegacyLibsNodeEnvPath(_0x18e629);if(_0x458eab[_0x9942('0xb')]){_0x3e7181['info'](_0x9942('0xc'));return fs[_0x9942('0xd')](APP_JSON_PATH,_0x18e629,{'spaces':0x2});}else{return Promise[_0x9942('0x4')]();}});}else{return Promise['resolve']();}});}module[_0x9942('0xe')]=updateAppConfig; \ No newline at end of file -- 1.7.1